From: Andrea Bianco Date: Thu, 22 Jul 2021 21:01:13 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.6.0 X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=aaa9c3d185bd1abffaf9c0849bc1be93404ebdba;p=motion2.git Built motion from commit (unavailable).|2.6.0 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index c68aa38..867e70e 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-07-20T12:36:20.772Z", + "time": "2021-07-22T20:54:17.192Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index c475aa0..9110cb3 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-07-20T12:36:20.772Z", + "time": "2021-07-22T20:54:17.192Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 37a907d..7873102 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 _0x8317=['exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','motionbar[NULL,NULL,WinAppArguments]','TEXT'];(function(_0x123c77,_0xeb6c1b){var _0x59ddd9=function(_0x27a9c1){while(--_0x27a9c1){_0x123c77['push'](_0x123c77['shift']());}};_0x59ddd9(++_0xeb6c1b);}(_0x8317,0x17a));var _0x7831=function(_0x19be26,_0x53668c){_0x19be26=_0x19be26-0x0;var _0x31ccd6=_0x8317[_0x19be26];return _0x31ccd6;};'use strict';var Sequelize=require('sequelize');module[_0x7831('0x0')]={'name':{'type':Sequelize[_0x7831('0x1')],'get':function(_0x42e8e8){return this[_0x7831('0x2')]('action');}},'action':{'type':Sequelize[_0x7831('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7831('0x4'),_0x7831('0x5'),_0x7831('0x6'),'jscripty',_0x7831('0x7'),_0x7831('0x8'),_0x7831('0x9'),_0x7831('0xa')]],'msg':_0x7831('0xb')}},'comment':_0x7831('0xb')},'data1':{'type':Sequelize[_0x7831('0x3')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0x7831('0x3')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x7831('0xc')},'data4':{'type':Sequelize[_0x7831('0x3')](0x1000)},'data5':{'type':Sequelize[_0x7831('0x3')](0x1000)},'data6':{'type':Sequelize[_0x7831('0x3')]},'data7':{'type':Sequelize[_0x7831('0xd')]}}; \ No newline at end of file +var _0x0c67=['getDataValue','action','STRING','contactManager','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','exports'];(function(_0x235fc5,_0xac5c59){var _0x43e315=function(_0x5b8d91){while(--_0x5b8d91){_0x235fc5['push'](_0x235fc5['shift']());}};_0x43e315(++_0xac5c59);}(_0x0c67,0xd7));var _0x70c6=function(_0x37c43c,_0x2bfc5b){_0x37c43c=_0x37c43c-0x0;var _0x5964b7=_0x0c67[_0x37c43c];return _0x5964b7;};'use strict';var Sequelize=require('sequelize');module[_0x70c6('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x35f429){return this[_0x70c6('0x1')](_0x70c6('0x2'));}},'action':{'type':Sequelize[_0x70c6('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x70c6('0x4'),'integration','motionbar',_0x70c6('0x5'),'urlForward',_0x70c6('0x6'),'bot',_0x70c6('0x7')]],'msg':_0x70c6('0x8')}},'comment':_0x70c6('0x8')},'data1':{'type':Sequelize[_0x70c6('0x3')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0x70c6('0x3')](0x1000),'comment':_0x70c6('0x9')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x70c6('0xa')},'data4':{'type':Sequelize[_0x70c6('0x3')](0x1000)},'data5':{'type':Sequelize[_0x70c6('0x3')](0x1000)},'data6':{'type':Sequelize[_0x70c6('0x3')]},'data7':{'type':Sequelize[_0x70c6('0xb')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 6d463c8..ca9e85c 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 _0x2cb4=['undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','body','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3ebe19,_0x477eba){var _0x28f7c1=function(_0x447627){while(--_0x447627){_0x3ebe19['push'](_0x3ebe19['shift']());}};_0x28f7c1(++_0x477eba);}(_0x2cb4,0x13e));var _0x42cb=function(_0x3f3bad,_0x193f06){_0x3f3bad=_0x3f3bad-0x0;var _0x4f0801=_0x2cb4[_0x3f3bad];return _0x4f0801;};'use strict';var emlformat=require(_0x42cb('0x0'));var rimraf=require(_0x42cb('0x1'));var zipdir=require(_0x42cb('0x2'));var jsonpatch=require(_0x42cb('0x3'));var rp=require(_0x42cb('0x4'));var moment=require(_0x42cb('0x5'));var BPromise=require(_0x42cb('0x6'));var Mustache=require('mustache');var util=require(_0x42cb('0x7'));var path=require(_0x42cb('0x8'));var sox=require(_0x42cb('0x9'));var csv=require(_0x42cb('0xa'));var ejs=require(_0x42cb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42cb('0xc'));var squel=require(_0x42cb('0xd'));var crypto=require(_0x42cb('0xe'));var jsforce=require(_0x42cb('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x42cb('0xa'));var querystring=require(_0x42cb('0x10'));var Papa=require(_0x42cb('0x11'));var Redis=require(_0x42cb('0x12'));var authService=require(_0x42cb('0x13'));var qs=require(_0x42cb('0x14'));var as=require(_0x42cb('0x15'));var hardwareService=require(_0x42cb('0x16'));var logger=require(_0x42cb('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x42cb('0x18'));var licenseUtil=require(_0x42cb('0x19'));var db=require(_0x42cb('0x1a'))['db'];function respondWithStatusCode(_0x417080,_0x2b6ee2){_0x2b6ee2=_0x2b6ee2||0xcc;return function(_0x6d1207){if(_0x6d1207){return _0x417080[_0x42cb('0x1b')](_0x2b6ee2);}return _0x417080[_0x42cb('0x1c')](_0x2b6ee2)[_0x42cb('0x1d')]();};}function respondWithResult(_0x497e60,_0xfb073a){_0xfb073a=_0xfb073a||0xc8;return function(_0x15b801){if(_0x15b801){return _0x497e60[_0x42cb('0x1c')](_0xfb073a)[_0x42cb('0x1e')](_0x15b801);}};}function respondWithFilteredResult(_0x29e947,_0x47f50c){return function(_0x125c0e){if(_0x125c0e){var _0x263888=typeof _0x47f50c[_0x42cb('0x1f')]===_0x42cb('0x20')&&typeof _0x47f50c[_0x42cb('0x21')]===_0x42cb('0x20');var _0x4df2ab=_0x125c0e[_0x42cb('0x22')];var _0x3104be=_0x263888?0x0:_0x47f50c[_0x42cb('0x1f')];var _0x5c5a6f=_0x263888?_0x125c0e['count']:_0x47f50c[_0x42cb('0x1f')]+_0x47f50c[_0x42cb('0x21')];var _0x130003;if(_0x5c5a6f>=_0x4df2ab){_0x5c5a6f=_0x4df2ab;_0x130003=0xc8;}else{_0x130003=0xce;}_0x29e947[_0x42cb('0x1c')](_0x130003);return _0x29e947[_0x42cb('0x23')]('Content-Range',_0x3104be+'-'+_0x5c5a6f+'/'+_0x4df2ab)[_0x42cb('0x1e')](_0x125c0e);}return null;};}function patchUpdates(_0x4919a3){return function(_0x46b1c9){try{jsonpatch[_0x42cb('0x24')](_0x46b1c9,_0x4919a3,!![]);}catch(_0x1f8cd2){return BPromise[_0x42cb('0x25')](_0x1f8cd2);}return _0x46b1c9[_0x42cb('0x26')]();};}function saveUpdates(_0x1ebc28,_0x33c8f9){return function(_0x13eebf){if(_0x13eebf){return _0x13eebf[_0x42cb('0x27')](_0x1ebc28)[_0x42cb('0x28')](function(_0x1fe157){return _0x1fe157;});}return null;};}function removeEntity(_0x22a76b,_0x23ced0){return function(_0x5df6e7){if(_0x5df6e7){return _0x5df6e7[_0x42cb('0x29')]()['then'](function(){_0x22a76b[_0x42cb('0x1c')](0xcc)[_0x42cb('0x1d')]();});}};}function handleEntityNotFound(_0x1a4fa1,_0x464a73){return function(_0x488401){if(!_0x488401){_0x1a4fa1[_0x42cb('0x1b')](0x194);}return _0x488401;};}function handleError(_0x257404,_0x304fe2){_0x304fe2=_0x304fe2||0x1f4;return function(_0x2053fc){logger[_0x42cb('0x2a')](_0x2053fc[_0x42cb('0x2b')]);if(_0x2053fc[_0x42cb('0x2c')]){delete _0x2053fc['name'];}_0x257404[_0x42cb('0x1c')](_0x304fe2)[_0x42cb('0x2d')](_0x2053fc);};}exports[_0x42cb('0x27')]=function(_0x11b477,_0x3f76f2){if(_0x11b477[_0x42cb('0x2e')]['id']){delete _0x11b477[_0x42cb('0x2e')]['id'];}return db['Action'][_0x42cb('0x2f')]({'where':{'id':_0x11b477['params']['id']}})['then'](handleEntityNotFound(_0x3f76f2,null))[_0x42cb('0x28')](saveUpdates(_0x11b477['body'],null))[_0x42cb('0x28')](respondWithResult(_0x3f76f2,null))[_0x42cb('0x30')](handleError(_0x3f76f2,null));};exports['destroy']=function(_0x3d35dc,_0x545630){return db['Action']['find']({'where':{'id':_0x3d35dc[_0x42cb('0x31')]['id']}})[_0x42cb('0x28')](handleEntityNotFound(_0x545630,null))['then'](removeEntity(_0x545630,null))[_0x42cb('0x30')](handleError(_0x545630,null));}; \ No newline at end of file +var _0x861a=['undefined','offset','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit'];(function(_0x4f293a,_0x29666d){var _0x2a7f60=function(_0x2f8dcd){while(--_0x2f8dcd){_0x4f293a['push'](_0x4f293a['shift']());}};_0x2a7f60(++_0x29666d);}(_0x861a,0x194));var _0xa861=function(_0x2411f9,_0x39a0f5){_0x2411f9=_0x2411f9-0x0;var _0x5ab105=_0x861a[_0x2411f9];return _0x5ab105;};'use strict';var emlformat=require(_0xa861('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa861('0x1'));var jsonpatch=require(_0xa861('0x2'));var rp=require(_0xa861('0x3'));var moment=require(_0xa861('0x4'));var BPromise=require(_0xa861('0x5'));var Mustache=require(_0xa861('0x6'));var util=require('util');var path=require(_0xa861('0x7'));var sox=require(_0xa861('0x8'));var csv=require(_0xa861('0x9'));var ejs=require(_0xa861('0xa'));var fs=require('fs');var fs_extra=require(_0xa861('0xb'));var _=require('lodash');var squel=require(_0xa861('0xc'));var crypto=require(_0xa861('0xd'));var jsforce=require(_0xa861('0xe'));var deskjs=require(_0xa861('0xf'));var toCsv=require(_0xa861('0x9'));var querystring=require(_0xa861('0x10'));var Papa=require(_0xa861('0x11'));var Redis=require(_0xa861('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa861('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa861('0x14'));var utils=require(_0xa861('0x15'));var config=require(_0xa861('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa861('0x17'))['db'];function respondWithStatusCode(_0xf01095,_0x44c425){_0x44c425=_0x44c425||0xcc;return function(_0x35f59b){if(_0x35f59b){return _0xf01095[_0xa861('0x18')](_0x44c425);}return _0xf01095['status'](_0x44c425)['end']();};}function respondWithResult(_0x8b05bd,_0x4df9aa){_0x4df9aa=_0x4df9aa||0xc8;return function(_0x4a7f27){if(_0x4a7f27){return _0x8b05bd[_0xa861('0x19')](_0x4df9aa)[_0xa861('0x1a')](_0x4a7f27);}};}function respondWithFilteredResult(_0x405e23,_0xb5ce78){return function(_0x4792d3){if(_0x4792d3){var _0x2e69c1=typeof _0xb5ce78['offset']==='undefined'&&typeof _0xb5ce78[_0xa861('0x1b')]===_0xa861('0x1c');var _0x18c897=_0x4792d3['count'];var _0xc85eb3=_0x2e69c1?0x0:_0xb5ce78[_0xa861('0x1d')];var _0x2cbdae=_0x2e69c1?_0x4792d3[_0xa861('0x1e')]:_0xb5ce78[_0xa861('0x1d')]+_0xb5ce78['limit'];var _0x20e465;if(_0x2cbdae>=_0x18c897){_0x2cbdae=_0x18c897;_0x20e465=0xc8;}else{_0x20e465=0xce;}_0x405e23[_0xa861('0x19')](_0x20e465);return _0x405e23[_0xa861('0x1f')](_0xa861('0x20'),_0xc85eb3+'-'+_0x2cbdae+'/'+_0x18c897)[_0xa861('0x1a')](_0x4792d3);}return null;};}function patchUpdates(_0x52ca65){return function(_0x398e49){try{jsonpatch[_0xa861('0x21')](_0x398e49,_0x52ca65,!![]);}catch(_0x2437ad){return BPromise['reject'](_0x2437ad);}return _0x398e49[_0xa861('0x22')]();};}function saveUpdates(_0x353299,_0x58270d){return function(_0x24e305){if(_0x24e305){return _0x24e305[_0xa861('0x23')](_0x353299)[_0xa861('0x24')](function(_0x53d561){return _0x53d561;});}return null;};}function removeEntity(_0x3fd022,_0x225d1f){return function(_0x59bc73){if(_0x59bc73){return _0x59bc73[_0xa861('0x25')]()[_0xa861('0x24')](function(){_0x3fd022['status'](0xcc)[_0xa861('0x26')]();});}};}function handleEntityNotFound(_0x133c81,_0x1653a1){return function(_0x598b72){if(!_0x598b72){_0x133c81[_0xa861('0x18')](0x194);}return _0x598b72;};}function handleError(_0x358915,_0x364589){_0x364589=_0x364589||0x1f4;return function(_0x2176d3){logger[_0xa861('0x27')](_0x2176d3[_0xa861('0x28')]);if(_0x2176d3[_0xa861('0x29')]){delete _0x2176d3['name'];}_0x358915[_0xa861('0x19')](_0x364589)[_0xa861('0x2a')](_0x2176d3);};}exports[_0xa861('0x23')]=function(_0x58a58c,_0x332f41){if(_0x58a58c[_0xa861('0x2b')]['id']){delete _0x58a58c[_0xa861('0x2b')]['id'];}return db[_0xa861('0x2c')][_0xa861('0x2d')]({'where':{'id':_0x58a58c[_0xa861('0x2e')]['id']}})['then'](handleEntityNotFound(_0x332f41,null))['then'](saveUpdates(_0x58a58c['body'],null))[_0xa861('0x24')](respondWithResult(_0x332f41,null))['catch'](handleError(_0x332f41,null));};exports[_0xa861('0x25')]=function(_0x31481a,_0x22ae63){return db[_0xa861('0x2c')]['find']({'where':{'id':_0x31481a[_0xa861('0x2e')]['id']}})[_0xa861('0x24')](handleEntityNotFound(_0x22ae63,null))[_0xa861('0x24')](removeEntity(_0x22ae63,null))[_0xa861('0x2f')](handleError(_0x22ae63,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index e434048..438c51f 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 _0xcbef=['rimraf','../../config/environment','./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5f1b77,_0x22f647){var _0x51b9a7=function(_0x36af2a){while(--_0x36af2a){_0x5f1b77['push'](_0x5f1b77['shift']());}};_0x51b9a7(++_0x22f647);}(_0xcbef,0x180));var _0xfcbe=function(_0x56a37a,_0xffb054){_0x56a37a=_0x56a37a-0x0;var _0x3a57ff=_0xcbef[_0x56a37a];return _0x3a57ff;};'use strict';var _=require(_0xfcbe('0x0'));var util=require(_0xfcbe('0x1'));var logger=require(_0xfcbe('0x2'))(_0xfcbe('0x3'));var moment=require(_0xfcbe('0x4'));var BPromise=require(_0xfcbe('0x5'));var rp=require(_0xfcbe('0x6'));var fs=require('fs');var path=require(_0xfcbe('0x7'));var rimraf=require(_0xfcbe('0x8'));var config=require(_0xfcbe('0x9'));var attributes=require(_0xfcbe('0xa'));module['exports']=function(_0x3825c4,_0x46113f){return _0x3825c4[_0xfcbe('0xb')](_0xfcbe('0xc'),attributes,{'tableName':_0xfcbe('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x29e5=['exports','define','Action','tools_actions','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x11a6c2,_0x501fdf){var _0x46f007=function(_0x59104e){while(--_0x59104e){_0x11a6c2['push'](_0x11a6c2['shift']());}};_0x46f007(++_0x501fdf);}(_0x29e5,0xb8));var _0x529e=function(_0x86d5c,_0x4f0973){_0x86d5c=_0x86d5c-0x0;var _0xf88676=_0x29e5[_0x86d5c];return _0xf88676;};'use strict';var _=require(_0x529e('0x0'));var util=require(_0x529e('0x1'));var logger=require('../../config/logger')(_0x529e('0x2'));var moment=require(_0x529e('0x3'));var BPromise=require('bluebird');var rp=require(_0x529e('0x4'));var fs=require('fs');var path=require(_0x529e('0x5'));var rimraf=require(_0x529e('0x6'));var config=require(_0x529e('0x7'));var attributes=require('./action.attributes');module[_0x529e('0x8')]=function(_0xa53f8f,_0x42c228){return _0xa53f8f[_0x529e('0x9')](_0x529e('0xa'),attributes,{'tableName':_0x529e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index c82f011..2a4ae5c 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 _0x70e0=['code','Action,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3ec4f3,_0x545ca0){var _0x485e5c=function(_0x1b462d){while(--_0x1b462d){_0x3ec4f3['push'](_0x3ec4f3['shift']());}};_0x485e5c(++_0x545ca0);}(_0x70e0,0x17b));var _0x070e=function(_0x3df35b,_0x48959a){_0x3df35b=_0x3df35b-0x0;var _0x26a2ce=_0x70e0[_0x3df35b];return _0x26a2ce;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('Action,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('Action,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x0713=['Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0x1249fe,_0x1d03b3){var _0x8e5a5c=function(_0x1f792c){while(--_0x1f792c){_0x1249fe['push'](_0x1249fe['shift']());}};_0x8e5a5c(++_0x1d03b3);}(_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')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('Action,\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')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 3df7f47..7832de4 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 _0x91a7=['/:id','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','./action.controller','put','isAuthenticated','delete'];(function(_0x227d62,_0xbc4952){var _0x39559c=function(_0x114df3){while(--_0x114df3){_0x227d62['push'](_0x227d62['shift']());}};_0x39559c(++_0xbc4952);}(_0x91a7,0xe7));var _0x791a=function(_0x2f4d5f,_0xda7f63){_0x2f4d5f=_0x2f4d5f-0x0;var _0x13dfeb=_0x91a7[_0x2f4d5f];return _0x13dfeb;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/:id',auth[_0x791a('0x7')](),controller['update']);router[_0x791a('0x8')](_0x791a('0x9'),auth['isAuthenticated'](),controller[_0x791a('0xa')]);module[_0x791a('0xb')]=router; \ No newline at end of file +var _0xbd5c=['../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4193d2,_0x4a3447){var _0x53db9a=function(_0x170a9b){while(--_0x170a9b){_0x4193d2['push'](_0x4193d2['shift']());}};_0x53db9a(++_0x4a3447);}(_0xbd5c,0x19d));var _0xcbd5=function(_0x3b6c3a,_0x19ab5e){_0x3b6c3a=_0x3b6c3a-0x0;var _0x2d9586=_0xbd5c[_0x3b6c3a];return _0x2d9586;};'use strict';var multer=require(_0xcbd5('0x0'));var util=require(_0xcbd5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcbd5('0x2'));var router=express[_0xcbd5('0x3')]();var fs_extra=require(_0xcbd5('0x4'));var auth=require(_0xcbd5('0x5'));var interaction=require(_0xcbd5('0x6'));var config=require(_0xcbd5('0x7'));var controller=require(_0xcbd5('0x8'));router[_0xcbd5('0x9')](_0xcbd5('0xa'),auth[_0xcbd5('0xb')](),controller['update']);router[_0xcbd5('0xc')](_0xcbd5('0xa'),auth[_0xcbd5('0xb')](),controller[_0xcbd5('0xd')]);module[_0xcbd5('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 7c8015b..e5ed772 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 _0x1fd1=['exports','STRING','TEXT'];(function(_0x402e22,_0x463875){var _0x1c5472=function(_0x9d17ec){while(--_0x9d17ec){_0x402e22['push'](_0x402e22['shift']());}};_0x1c5472(++_0x463875);}(_0x1fd1,0x1b0));var _0x11fd=function(_0x2cede9,_0x38277c){_0x2cede9=_0x2cede9-0x0;var _0x59b642=_0x1fd1[_0x2cede9];return _0x59b642;};'use strict';var Sequelize=require('sequelize');module[_0x11fd('0x0')]={'name':{'type':Sequelize[_0x11fd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x11fd('0x1')]},'parent':{'type':Sequelize[_0x11fd('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x11fd('0x2')]},'joins':{'type':Sequelize[_0x11fd('0x2')]}}; \ No newline at end of file +var _0x264c=['TEXT','sequelize','exports','STRING'];(function(_0x40ce01,_0x1e39c8){var _0xa0f16e=function(_0x2356ad){while(--_0x2356ad){_0x40ce01['push'](_0x40ce01['shift']());}};_0xa0f16e(++_0x1e39c8);}(_0x264c,0x9d));var _0xc264=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x264c[_0x2283dc];return _0x16db90;};'use strict';var Sequelize=require(_0xc264('0x0'));module[_0xc264('0x1')]={'name':{'type':Sequelize[_0xc264('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc264('0x2')]},'parent':{'type':Sequelize[_0xc264('0x2')]},'table':{'type':Sequelize[_0xc264('0x2')]},'conditions':{'type':Sequelize[_0xc264('0x3')]},'joins':{'type':Sequelize[_0xc264('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 0035028..b5dee2e 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 _0xa9e0=['then','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','rules','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','MAX(%s)','SEC_TO_TIME(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','value','orderBy','output','web','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','IS\x20NOT\x20EMPTY','operator','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','destroy'];(function(_0x2a7d1f,_0x2b12e5){var _0x2e2d40=function(_0x8ce437){while(--_0x8ce437){_0x2a7d1f['push'](_0x2a7d1f['shift']());}};_0x2e2d40(++_0x2b12e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];var dbH=require(_0x0a9e('0x14'))[_0x0a9e('0x15')];function respondWithStatusCode(_0x32d742,_0x69aeb7){_0x69aeb7=_0x69aeb7||0xcc;return function(_0x5db4b0){if(_0x5db4b0){return _0x32d742[_0x0a9e('0x16')](_0x69aeb7);}return _0x32d742[_0x0a9e('0x17')](_0x69aeb7)[_0x0a9e('0x18')]();};}function respondWithResult(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xc8;return function(_0x4d5611){if(_0x4d5611){return _0x281129['status'](_0x44dcfd)[_0x0a9e('0x19')](_0x4d5611);}};}function respondWithFilteredResult(_0x5d0880,_0x1985b6){return function(_0x519dfd){if(_0x519dfd){var _0x16033c=typeof _0x1985b6[_0x0a9e('0x1a')]==='undefined'&&typeof _0x1985b6[_0x0a9e('0x1b')]==='undefined';var _0x459eb1=_0x519dfd[_0x0a9e('0x1c')];var _0x106033=_0x16033c?0x0:_0x1985b6[_0x0a9e('0x1a')];var _0x31b1ca=_0x16033c?_0x519dfd[_0x0a9e('0x1c')]:_0x1985b6[_0x0a9e('0x1a')]+_0x1985b6[_0x0a9e('0x1b')];var _0x1314ae;if(_0x31b1ca>=_0x459eb1){_0x31b1ca=_0x459eb1;_0x1314ae=0xc8;}else{_0x1314ae=0xce;}_0x5d0880[_0x0a9e('0x17')](_0x1314ae);return _0x5d0880[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x106033+'-'+_0x31b1ca+'/'+_0x459eb1)['json'](_0x519dfd);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x1f')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x20')]()[_0x0a9e('0x21')](function(){var _0x16b1ca=_0x4d00e6['get']({'plain':!![]});var _0x59181e=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x59181e,'resourceId':_0x16b1ca['id']}})[_0x0a9e('0x21')](function(){return _0x4d00e6;});})['then'](function(){_0x2fb0e4[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45a1e7,_0x5bfb33){return function(_0x1dc186){if(!_0x1dc186){_0x45a1e7[_0x0a9e('0x16')](0x194);}return _0x1dc186;};}function handleError(_0x25fba9,_0x14433c){_0x14433c=_0x14433c||0x1f4;return function(_0x140511){logger[_0x0a9e('0x24')](_0x140511[_0x0a9e('0x25')]);if(_0x140511[_0x0a9e('0x26')]){delete _0x140511['name'];}_0x25fba9[_0x0a9e('0x17')](_0x14433c)[_0x0a9e('0x27')](_0x140511);};}exports[_0x0a9e('0x28')]=function(_0x2ec755,_0x5c877d){var _0x15b200={},_0x40e7a3={},_0x1843b2={'count':0x0,'rows':[]};var _0x824a4f=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x2e8759){return{'name':_0x2e8759[_0x0a9e('0x2c')],'type':_0x2e8759['type'][_0x0a9e('0x2d')]};});_0x40e7a3['model']=_[_0x0a9e('0x29')](_0x824a4f,_0x0a9e('0x26'));_0x40e7a3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x2ec755[_0x0a9e('0x2e')]);_0x40e7a3['filters']=_[_0x0a9e('0x30')](_0x40e7a3[_0x0a9e('0x31')],_0x40e7a3[_0x0a9e('0x2e')]);_0x15b200[_0x0a9e('0x32')]=_[_0x0a9e('0x30')](_0x40e7a3[_0x0a9e('0x31')],qs[_0x0a9e('0x33')](_0x2ec755[_0x0a9e('0x2e')]['fields']));_0x15b200[_0x0a9e('0x32')]=_0x15b200['attributes'][_0x0a9e('0x34')]?_0x15b200[_0x0a9e('0x32')]:_0x40e7a3[_0x0a9e('0x31')];if(!_0x2ec755[_0x0a9e('0x2e')]['hasOwnProperty'](_0x0a9e('0x35'))){_0x15b200[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x2ec755[_0x0a9e('0x2e')]['limit']);_0x15b200['offset']=qs[_0x0a9e('0x1a')](_0x2ec755['query'][_0x0a9e('0x1a')]);}_0x15b200[_0x0a9e('0x36')]=qs[_0x0a9e('0x37')](_0x2ec755[_0x0a9e('0x2e')]['sort']);_0x15b200[_0x0a9e('0x38')]=qs[_0x0a9e('0x39')](_[_0x0a9e('0x3a')](_0x2ec755['query'],_0x40e7a3[_0x0a9e('0x39')]),_0x824a4f);if(_0x2ec755[_0x0a9e('0x2e')][_0x0a9e('0x3b')]){_0x15b200['where']=_['merge'](_0x15b200[_0x0a9e('0x38')],{'$or':_[_0x0a9e('0x29')](_0x824a4f,function(_0x5adda1){if(_0x5adda1[_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x2e1b3a={};_0x2e1b3a[_0x5adda1[_0x0a9e('0x26')]]={'$like':'%'+_0x2ec755['query']['filter']+'%'};return _0x2e1b3a;}})});}_0x15b200=_[_0x0a9e('0x3e')]({},_0x15b200,_0x2ec755[_0x0a9e('0x3f')]);var _0x53f3ee={'where':_0x15b200[_0x0a9e('0x38')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x1c')](_0x53f3ee)['then'](function(_0x316c8f){_0x1843b2[_0x0a9e('0x1c')]=_0x316c8f;if(_0x2ec755[_0x0a9e('0x2e')][_0x0a9e('0x40')]){_0x15b200[_0x0a9e('0x41')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x42')](_0x15b200);})[_0x0a9e('0x21')](function(_0x23b089){_0x1843b2[_0x0a9e('0x43')]=_0x23b089;return _0x1843b2;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x5c877d,_0x15b200))[_0x0a9e('0x44')](handleError(_0x5c877d,null));};exports[_0x0a9e('0x45')]=function(_0x11ca30,_0x37f6cc){var _0x4d04c8={'raw':![],'where':{'id':_0x11ca30[_0x0a9e('0x46')]['id']}},_0x52628e={};_0x52628e[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x52628e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x11ca30[_0x0a9e('0x2e')]);_0x52628e[_0x0a9e('0x39')]=_[_0x0a9e('0x30')](_0x52628e[_0x0a9e('0x31')],_0x52628e[_0x0a9e('0x2e')]);_0x4d04c8['attributes']=_[_0x0a9e('0x30')](_0x52628e[_0x0a9e('0x31')],qs[_0x0a9e('0x33')](_0x11ca30[_0x0a9e('0x2e')][_0x0a9e('0x33')]));_0x4d04c8[_0x0a9e('0x32')]=_0x4d04c8[_0x0a9e('0x32')][_0x0a9e('0x34')]?_0x4d04c8['attributes']:_0x52628e[_0x0a9e('0x31')];if(_0x11ca30['query'][_0x0a9e('0x40')]){_0x4d04c8[_0x0a9e('0x41')]=[{'all':!![]}];}_0x4d04c8=_[_0x0a9e('0x3e')]({},_0x4d04c8,_0x11ca30['options']);return db[_0x0a9e('0x2a')][_0x0a9e('0x47')](_0x4d04c8)[_0x0a9e('0x21')](handleEntityNotFound(_0x37f6cc,null))[_0x0a9e('0x21')](respondWithResult(_0x37f6cc,null))[_0x0a9e('0x44')](handleError(_0x37f6cc,null));};exports[_0x0a9e('0x48')]=function(_0x45bf7f,_0x5bbcde){return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x45bf7f[_0x0a9e('0x49')],{})[_0x0a9e('0x21')](function(_0x409789){var _0x992c77=_0x45bf7f[_0x0a9e('0x4a')][_0x0a9e('0x4b')]({'plain':!![]});if(!_0x992c77)throw new Error(_0x0a9e('0x4c'));if(_0x992c77['role']===_0x0a9e('0x4a')){var _0x3fe430=_0x409789['get']({'plain':!![]});var _0x4ae14b='Reports';return db[_0x0a9e('0x4d')][_0x0a9e('0x47')]({'where':{'name':_0x4ae14b,'userProfileId':_0x992c77[_0x0a9e('0x4e')]},'raw':!![]})[_0x0a9e('0x21')](function(_0x61bb17){if(_0x61bb17&&_0x61bb17[_0x0a9e('0x4f')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x48')]({'name':_0x3fe430['name'],'resourceId':_0x3fe430['id'],'type':'CustomReports','sectionId':_0x61bb17['id']},{})['then'](function(){return _0x409789;});}else{return _0x409789;}})[_0x0a9e('0x44')](function(_0x204173){logger[_0x0a9e('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x204173);throw _0x204173;});}return _0x409789;})[_0x0a9e('0x21')](respondWithResult(_0x5bbcde,0xc9))[_0x0a9e('0x44')](handleError(_0x5bbcde,null));};exports['update']=function(_0x5a88da,_0x2ef381){if(_0x5a88da['body']['id']){delete _0x5a88da[_0x0a9e('0x49')]['id'];}return db['AnalyticCustomReport'][_0x0a9e('0x47')]({'where':{'id':_0x5a88da[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2ef381,null))['then'](saveUpdates(_0x5a88da[_0x0a9e('0x49')],null))[_0x0a9e('0x21')](respondWithResult(_0x2ef381,null))['catch'](handleError(_0x2ef381,null));};exports['destroy']=function(_0x128aa6,_0x3aedd0){return db['AnalyticCustomReport'][_0x0a9e('0x47')]({'where':{'id':_0x128aa6['params']['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x3aedd0,null))['then'](removeEntity(_0x3aedd0,null))[_0x0a9e('0x44')](handleError(_0x3aedd0,null));};exports['preview']=function(_0x5da27d,_0x5df0ad){var _0x2da03c=0xa;var _0x47de4c=[_0x0a9e('0x50'),_0x0a9e('0x51'),_0x0a9e('0x52'),_0x0a9e('0x53')];var _0x232830={'SUM':_0x0a9e('0x54'),'COUNT':_0x0a9e('0x55'),'COUNT DISTINCT':_0x0a9e('0x56'),'MAX':'MAX(%s)','MIN':_0x0a9e('0x57'),'AVG':_0x0a9e('0x58'),'GROUP_CONCAT':_0x0a9e('0x59'),'GROUP_CONCAT ASC':_0x0a9e('0x5a'),'GROUP_CONCAT DESC':_0x0a9e('0x5b')};var _0x156662={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0a9e('0x5c'),'HOUR':_0x0a9e('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0a9e('0x5e')};var _0x5cc8fb=function(_0x20c668){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x0a9e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x20c668);};var _0x2244d6=function(_0x1fc70e){if(!_0x1fc70e||!_0x1fc70e[_0x0a9e('0x60')][_0x0a9e('0x34')]){return'';}for(var _0x1cca9f='(',_0x26d7db=0x0;_0x26d7db<_0x1fc70e['rules'][_0x0a9e('0x34')];_0x26d7db+=0x1){_0x26d7db>0x0&&(_0x1cca9f+='\x20'+_0x1fc70e['operator']+'\x20');_0x1cca9f+=_0x1fc70e[_0x0a9e('0x60')][_0x26d7db][_0x0a9e('0x61')]?_0x2244d6(_0x1fc70e[_0x0a9e('0x60')][_0x26d7db]['group']):_0x1fc70e[_0x0a9e('0x60')][_0x26d7db][_0x0a9e('0x62')]+'\x20'+_0x1fc70e[_0x0a9e('0x60')][_0x26d7db][_0x0a9e('0x63')]+(_0x5cc8fb(_0x1fc70e['rules'][_0x26d7db][_0x0a9e('0x63')])?'\x20'+_0x1fc70e[_0x0a9e('0x60')][_0x26d7db]['value']:'');}return _0x1cca9f+')';};var _0x797b45={'where':{'id':_0x5da27d[_0x0a9e('0x46')]['id']}},_0x17e88c,_0x88dcbf,_0x409b29,_0x401837,_0x4d4a35;_0x797b45=_[_0x0a9e('0x3e')]({},_0x797b45,_0x5da27d[_0x0a9e('0x3f')]);return db['AnalyticCustomReport'][_0x0a9e('0x47')](_0x797b45)['then'](function(_0x5211e3){if(_0x5211e3){_0x17e88c=_0x5211e3;return _0x5211e3[_0x0a9e('0x64')]();}return null;})[_0x0a9e('0x21')](function(_0x9375fb){if(_0x9375fb){if(!_0x9375fb[_0x0a9e('0x34')]){throw new db[(_0x0a9e('0x65'))][(_0x0a9e('0x66'))](_0x0a9e('0x67'),0x193);}_0x88dcbf=_0x9375fb;return db[_0x0a9e('0x68')][_0x0a9e('0x42')]({'raw':!![]});}return null;})[_0x0a9e('0x21')](function(_0x2e89b7){if(_0x2e89b7){_0x409b29=_[_0x0a9e('0x69')](_0x2e89b7,'id');var _0x2bbb86;var _0x2b8192=squel[_0x0a9e('0x6a')]();_0x2b8192[_0x0a9e('0x6b')](_0x17e88c[_0x0a9e('0x6c')]);for(var _0x4257c9=0x0;_0x4257c9<_0x88dcbf['length'];_0x4257c9+=0x1){_0x2bbb86=_0x88dcbf[_0x4257c9][_0x0a9e('0x6d')]?_0x409b29[_0x88dcbf[_0x4257c9][_0x0a9e('0x6d')]][_0x0a9e('0x6e')]:_0x88dcbf[_0x4257c9]['field'];_0x2bbb86=_0x88dcbf[_0x4257c9][_0x0a9e('0x6f')]?_[_0x0a9e('0x70')](_0x232830[_0x88dcbf[_0x4257c9]['function']],'%s',_0x2bbb86):_0x2bbb86;_0x2bbb86=_0x88dcbf[_0x4257c9][_0x0a9e('0x71')]?_[_0x0a9e('0x70')](_0x156662[_0x88dcbf[_0x4257c9][_0x0a9e('0x71')]],'%s',_0x2bbb86):_0x2bbb86;if(_0x88dcbf[_0x4257c9][_0x0a9e('0x72')]){_0x2b8192[_0x0a9e('0x61')](_0x2bbb86);}_0x88dcbf[_0x4257c9]['orderBy']&&_0x2b8192['order'](_0x2bbb86,_0x88dcbf[_0x4257c9]['orderBy']===_0x0a9e('0x73')?![]:!![]);_0x2b8192[_0x0a9e('0x62')](_0x2bbb86,_0x88dcbf[_0x4257c9][_0x0a9e('0x74')]||_0x2bbb86);}if(_0x17e88c[_0x0a9e('0x75')]){_0x17e88c[_0x0a9e('0x75')]=JSON[_0x0a9e('0x76')](_0x17e88c[_0x0a9e('0x75')]);for(var _0x1a0677=0x0;_0x1a0677<_0x17e88c['joins'][_0x0a9e('0x34')];_0x1a0677+=0x1){if(_0x17e88c[_0x0a9e('0x75')][_0x1a0677][_0x0a9e('0x3c')]&&_['includes'](_0x47de4c,_0x17e88c[_0x0a9e('0x75')][_0x1a0677]['type'])&&_0x17e88c[_0x0a9e('0x75')][_0x1a0677][_0x0a9e('0x77')]&&_0x17e88c['joins'][_0x1a0677][_0x0a9e('0x78')]&&_0x17e88c[_0x0a9e('0x75')][_0x1a0677][_0x0a9e('0x79')]){_0x2b8192[_0x17e88c[_0x0a9e('0x75')][_0x1a0677]['type']](_0x17e88c[_0x0a9e('0x75')][_0x1a0677][_0x0a9e('0x78')],null,util[_0x0a9e('0x71')](_0x0a9e('0x7a'),_0x17e88c['table'],_0x17e88c[_0x0a9e('0x75')][_0x1a0677][_0x0a9e('0x77')],_0x17e88c[_0x0a9e('0x75')][_0x1a0677][_0x0a9e('0x78')],_0x17e88c['joins'][_0x1a0677][_0x0a9e('0x79')]));}}}if(_0x17e88c[_0x0a9e('0x7b')]){_0x17e88c[_0x0a9e('0x7b')]=JSON[_0x0a9e('0x76')](_0x17e88c[_0x0a9e('0x7b')]);_0x2b8192[_0x0a9e('0x38')](_0x2244d6(_0x17e88c[_0x0a9e('0x7b')][_0x0a9e('0x61')]));}_0x4d4a35=_0x2b8192[_0x0a9e('0x7c')]();_0x2b8192[_0x0a9e('0x1b')](_0x2da03c);_0x2b8192[_0x0a9e('0x1a')](0x0);logger[_0x0a9e('0x7d')](_0x0a9e('0x7e'),_0x2b8192[_0x0a9e('0x7f')]());return dbH['sequelize'][_0x0a9e('0x2e')](_0x2b8192[_0x0a9e('0x7f')](),{'type':dbH[_0x0a9e('0x80')]['QueryTypes'][_0x0a9e('0x81')]});}})[_0x0a9e('0x21')](respondWithResult(_0x5df0ad,null))[_0x0a9e('0x44')](handleError(_0x5df0ad,null));};function runReport(_0x2b9463,_0x56d650,_0x541e80){var _0x7ebea8=_0x56d650[_0x0a9e('0x26')];var _0x4c54fa=0xa;var _0x45108c=['join',_0x0a9e('0x51'),_0x0a9e('0x52'),'cross_join'];var _0x28a942={'SUM':_0x0a9e('0x54'),'COUNT':_0x0a9e('0x55'),'COUNT DISTINCT':_0x0a9e('0x56'),'MAX':_0x0a9e('0x82'),'MIN':_0x0a9e('0x57'),'AVG':_0x0a9e('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0a9e('0x5a'),'GROUP_CONCAT DESC':_0x0a9e('0x5b')};var _0x45c109={'SEC_TO_TIME':_0x0a9e('0x83'),'DATE':'DATE(%s)','HOUR':_0x0a9e('0x5d'),'ROUND':_0x0a9e('0x84'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1d6834=function(_0x5b7940){return!_[_0x0a9e('0x85')]([_0x0a9e('0x86'),_0x0a9e('0x87'),_0x0a9e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x5b7940);};var _0x51ccd7=function(_0x353384){if(!_0x353384||!_0x353384[_0x0a9e('0x60')][_0x0a9e('0x34')]){return'';}for(var _0x5ac73d='(',_0x3b4a9f=0x0;_0x3b4a9f<_0x353384[_0x0a9e('0x60')]['length'];_0x3b4a9f+=0x1){_0x3b4a9f>0x0&&(_0x5ac73d+='\x20'+_0x353384['operator']+'\x20');_0x5ac73d+=_0x353384[_0x0a9e('0x60')][_0x3b4a9f]['group']?_0x51ccd7(_0x353384['rules'][_0x3b4a9f]['group']):_0x353384[_0x0a9e('0x60')][_0x3b4a9f][_0x0a9e('0x62')]+'\x20'+_0x353384[_0x0a9e('0x60')][_0x3b4a9f][_0x0a9e('0x63')]+(_0x1d6834(_0x353384[_0x0a9e('0x60')][_0x3b4a9f][_0x0a9e('0x63')])?'\x20'+_0x353384['rules'][_0x3b4a9f][_0x0a9e('0x88')]:'');}return _0x5ac73d+')';};var _0x5955f1={'where':{'id':_0x2b9463['id']}},_0x2871c1,_0x2aabab,_0x18ad56,_0x4566b0,_0x50f8d7;_0x5955f1=_[_0x0a9e('0x3e')]({},_0x5955f1,_0x541e80);return db[_0x0a9e('0x2a')][_0x0a9e('0x47')](_0x5955f1)['then'](function(_0xb6e411){if(_0xb6e411){_0x2871c1=_0xb6e411;return _0xb6e411[_0x0a9e('0x64')]();}return null;})[_0x0a9e('0x21')](function(_0x22063c){if(_0x22063c){if(!_0x22063c[_0x0a9e('0x34')]){throw new db[(_0x0a9e('0x65'))][(_0x0a9e('0x66'))](_0x0a9e('0x67'),0x193);}_0x2aabab=_0x22063c;return db['AnalyticMetric'][_0x0a9e('0x42')]({'raw':!![]});}return null;})[_0x0a9e('0x21')](function(_0x589ff3){if(_0x589ff3){_0x18ad56=_[_0x0a9e('0x69')](_0x589ff3,'id');var _0x982340;var _0x3a1974=squel['select']();_0x3a1974[_0x0a9e('0x6b')](_0x2871c1['table']);for(var _0x8c8fbe=0x0;_0x8c8fbe<_0x2aabab[_0x0a9e('0x34')];_0x8c8fbe+=0x1){_0x982340=_0x2aabab[_0x8c8fbe][_0x0a9e('0x6d')]?_0x18ad56[_0x2aabab[_0x8c8fbe][_0x0a9e('0x6d')]][_0x0a9e('0x6e')]:_0x2aabab[_0x8c8fbe][_0x0a9e('0x62')];_0x982340=_0x2aabab[_0x8c8fbe][_0x0a9e('0x6f')]?_[_0x0a9e('0x70')](_0x28a942[_0x2aabab[_0x8c8fbe]['function']],'%s',_0x982340):_0x982340;_0x982340=_0x2aabab[_0x8c8fbe][_0x0a9e('0x71')]?_[_0x0a9e('0x70')](_0x45c109[_0x2aabab[_0x8c8fbe][_0x0a9e('0x71')]],'%s',_0x982340):_0x982340;if(_0x2aabab[_0x8c8fbe][_0x0a9e('0x72')]){_0x3a1974[_0x0a9e('0x61')](_0x982340);}_0x2aabab[_0x8c8fbe][_0x0a9e('0x89')]&&_0x3a1974[_0x0a9e('0x36')](_0x982340,_0x2aabab[_0x8c8fbe][_0x0a9e('0x89')]===_0x0a9e('0x73')?![]:!![]);_0x3a1974[_0x0a9e('0x62')](_0x982340,_0x2aabab[_0x8c8fbe][_0x0a9e('0x74')]||_0x982340);}if(_0x2871c1[_0x0a9e('0x75')]){_0x2871c1[_0x0a9e('0x75')]=JSON['parse'](_0x2871c1[_0x0a9e('0x75')]);for(var _0x23e2bd=0x0;_0x23e2bd<_0x2871c1[_0x0a9e('0x75')][_0x0a9e('0x34')];_0x23e2bd+=0x1){if(_0x2871c1[_0x0a9e('0x75')][_0x23e2bd]['type']&&_[_0x0a9e('0x85')](_0x45108c,_0x2871c1[_0x0a9e('0x75')][_0x23e2bd]['type'])&&_0x2871c1[_0x0a9e('0x75')][_0x23e2bd]['parentKey']&&_0x2871c1[_0x0a9e('0x75')][_0x23e2bd][_0x0a9e('0x78')]&&_0x2871c1[_0x0a9e('0x75')][_0x23e2bd][_0x0a9e('0x79')]){_0x3a1974[_0x2871c1['joins'][_0x23e2bd][_0x0a9e('0x3c')]](_0x2871c1['joins'][_0x23e2bd][_0x0a9e('0x78')],null,util[_0x0a9e('0x71')]('%s.%s\x20=\x20%s.%s',_0x2871c1[_0x0a9e('0x6c')],_0x2871c1[_0x0a9e('0x75')][_0x23e2bd][_0x0a9e('0x77')],_0x2871c1['joins'][_0x23e2bd]['foreignTable'],_0x2871c1[_0x0a9e('0x75')][_0x23e2bd][_0x0a9e('0x79')]));}}}if(_0x2871c1[_0x0a9e('0x7b')]){_0x2871c1[_0x0a9e('0x7b')]=JSON[_0x0a9e('0x76')](_0x2871c1[_0x0a9e('0x7b')]);_0x3a1974[_0x0a9e('0x38')](_0x51ccd7(_0x2871c1[_0x0a9e('0x7b')][_0x0a9e('0x61')]));}_0x50f8d7=_0x3a1974['clone']();_0x3a1974[_0x0a9e('0x1b')](_0x4c54fa);_0x3a1974['offset'](0x0);return;}})[_0x0a9e('0x21')](function(){if(_0x56d650[_0x0a9e('0x8a')]===_0x0a9e('0x8b')){return null;}var _0x28ce92=_[_0x0a9e('0x3e')](_0x56d650,{'name':_0x56d650['fullPath']||_0x56d650[_0x0a9e('0x26')]||_0x2871c1[_0x0a9e('0x26')],'basename':_0x7ebea8,'savename':util[_0x0a9e('0x71')](_0x0a9e('0x8c'),_0x56d650[_0x0a9e('0x26')]||_0x2871c1['name'],require('randomstring')[_0x0a9e('0x8d')](0x4),_0x56d650['output']||_0x0a9e('0x8e')),'reportId':_0x2871c1['id'],'reportType':_0x0a9e('0x8f')});return db[_0x0a9e('0x90')][_0x0a9e('0x48')](_0x28ce92,{'raw':!![]});})[_0x0a9e('0x21')](function(_0x213e5d){if(_0x2871c1['table']==='cdr'){_0x50f8d7[_0x0a9e('0x38')](_0x2871c1['table']+_0x0a9e('0x91'),_0x56d650['startDate'],_0x56d650[_0x0a9e('0x92')]);}else{_0x50f8d7['where'](_0x2871c1['table']+_0x0a9e('0x93'),_0x56d650[_0x0a9e('0x94')],_0x56d650['endDate']);}if(_0x213e5d){logger[_0x0a9e('0x95')](_0x0a9e('0x96'),_0x50f8d7[_0x0a9e('0x7f')]());require(_0x0a9e('0x97'))[_0x0a9e('0x98')](path['join'](__dirname,'../../components/export/',_0x213e5d[_0x0a9e('0x8a')]),[_0x213e5d['id'],_0x50f8d7[_0x0a9e('0x7f')](),path[_0x0a9e('0x50')](__dirname,_0x0a9e('0x99'),_0x213e5d[_0x0a9e('0x9a')]),_0x7ebea8]);return _0x213e5d;}else{var _0x576d3b=squel[_0x0a9e('0x6a')]();_0x576d3b[_0x0a9e('0x6b')]('('+_0x50f8d7['toString']()+')',_0x0a9e('0x9b'));_0x576d3b[_0x0a9e('0x62')](_0x0a9e('0x9c'),_0x0a9e('0x1c'));_0x50f8d7[_0x0a9e('0x1b')](_0x56d650[_0x0a9e('0x1b')]||_0x4c54fa);_0x50f8d7[_0x0a9e('0x1a')](_0x56d650[_0x0a9e('0x1a')]||0x0);return dbH[_0x0a9e('0x80')][_0x0a9e('0x2e')](_0x576d3b['toString'](),{'type':dbH[_0x0a9e('0x80')][_0x0a9e('0x9d')][_0x0a9e('0x81')]})[_0x0a9e('0x21')](function(_0x1d0b02){if(!_0x1d0b02['length']){_0x4566b0=0x0;}else{_0x4566b0=_0x1d0b02[0x0]['count']||0x0;}return dbH[_0x0a9e('0x80')][_0x0a9e('0x2e')](_0x50f8d7[_0x0a9e('0x7f')](),{'type':dbH[_0x0a9e('0x80')][_0x0a9e('0x9d')]['SELECT']});})[_0x0a9e('0x21')](function(_0x3c775a){return{'rows':_0x3c775a||[],'count':_0x4566b0};});}});}exports[_0x0a9e('0x9e')]=function(_0x52b661,_0x318fc3){return runReport(_0x52b661['params'],_0x52b661[_0x0a9e('0x2e')],_0x52b661['options'])[_0x0a9e('0x21')](respondWithResult(_0x318fc3,null))[_0x0a9e('0x44')](handleError(_0x318fc3,null));};exports[_0x0a9e('0x9f')]=runReport;exports['query']=function(_0xc9529d,_0x5ed560){var _0x4383da=0xa;var _0x2b1824=[_0x0a9e('0x50'),_0x0a9e('0x51'),_0x0a9e('0x52'),_0x0a9e('0x53')];var _0x4014c7={'SUM':_0x0a9e('0x54'),'COUNT':_0x0a9e('0x55'),'COUNT DISTINCT':_0x0a9e('0x56'),'MAX':_0x0a9e('0x82'),'MIN':_0x0a9e('0x57'),'AVG':_0x0a9e('0x58'),'GROUP_CONCAT':_0x0a9e('0x59'),'GROUP_CONCAT ASC':_0x0a9e('0x5a'),'GROUP_CONCAT DESC':_0x0a9e('0x5b')};var _0x5b93dd={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0a9e('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x0a9e('0x84'),'UNIX_TIMESTAMP':_0x0a9e('0x5e')};var _0x5d6b69=function(_0x1a3754){return!_[_0x0a9e('0x85')]([_0x0a9e('0x86'),_0x0a9e('0x87'),'IS\x20EMPTY',_0x0a9e('0xa0')],_0x1a3754);};var _0x26cb76=function(_0x374f0b){if(!_0x374f0b||!_0x374f0b[_0x0a9e('0x60')]['length']){return'';}for(var _0x19e9ed='(',_0x1a0b08=0x0;_0x1a0b08<_0x374f0b[_0x0a9e('0x60')]['length'];_0x1a0b08+=0x1){_0x1a0b08>0x0&&(_0x19e9ed+='\x20'+_0x374f0b[_0x0a9e('0xa1')]+'\x20');_0x19e9ed+=_0x374f0b[_0x0a9e('0x60')][_0x1a0b08][_0x0a9e('0x61')]?_0x26cb76(_0x374f0b['rules'][_0x1a0b08][_0x0a9e('0x61')]):_0x374f0b[_0x0a9e('0x60')][_0x1a0b08][_0x0a9e('0x62')]+'\x20'+_0x374f0b[_0x0a9e('0x60')][_0x1a0b08][_0x0a9e('0x63')]+(_0x5d6b69(_0x374f0b['rules'][_0x1a0b08][_0x0a9e('0x63')])?'\x20'+_0x374f0b[_0x0a9e('0x60')][_0x1a0b08]['value']:'');}return _0x19e9ed+')';};var _0x3bab3e={'where':{'id':_0xc9529d[_0x0a9e('0x46')]['id']}},_0x1fcfe6,_0x1f6f1c,_0x5822a7,_0x5c3b6f,_0x523d08;_0x3bab3e=_[_0x0a9e('0x3e')]({},_0x3bab3e,_0xc9529d['options']);return db[_0x0a9e('0x2a')][_0x0a9e('0x47')](_0x3bab3e)[_0x0a9e('0x21')](function(_0x54ce11){if(_0x54ce11){_0x1fcfe6=_0x54ce11;return _0x54ce11[_0x0a9e('0x64')]();}return null;})[_0x0a9e('0x21')](function(_0x213d4e){if(_0x213d4e){if(!_0x213d4e[_0x0a9e('0x34')]){throw new db[(_0x0a9e('0x65'))][(_0x0a9e('0x66'))](_0x0a9e('0x67'),0x193);}_0x1f6f1c=_0x213d4e;return db[_0x0a9e('0x68')][_0x0a9e('0x42')]({'raw':!![]});}return null;})['then'](function(_0x43c397){if(_0x43c397){_0x5822a7=_['keyBy'](_0x43c397,'id');var _0x138cf5;var _0x4093e6=squel[_0x0a9e('0x6a')]();_0x4093e6[_0x0a9e('0x6b')](_0x1fcfe6[_0x0a9e('0x6c')]);for(var _0x344cd4=0x0;_0x344cd4<_0x1f6f1c['length'];_0x344cd4+=0x1){_0x138cf5=_0x1f6f1c[_0x344cd4][_0x0a9e('0x6d')]?_0x5822a7[_0x1f6f1c[_0x344cd4][_0x0a9e('0x6d')]][_0x0a9e('0x6e')]:_0x1f6f1c[_0x344cd4][_0x0a9e('0x62')];_0x138cf5=_0x1f6f1c[_0x344cd4]['function']?_[_0x0a9e('0x70')](_0x4014c7[_0x1f6f1c[_0x344cd4][_0x0a9e('0x6f')]],'%s',_0x138cf5):_0x138cf5;_0x138cf5=_0x1f6f1c[_0x344cd4][_0x0a9e('0x71')]?_[_0x0a9e('0x70')](_0x5b93dd[_0x1f6f1c[_0x344cd4][_0x0a9e('0x71')]],'%s',_0x138cf5):_0x138cf5;if(_0x1f6f1c[_0x344cd4][_0x0a9e('0x72')]){_0x4093e6[_0x0a9e('0x61')](_0x138cf5);}_0x1f6f1c[_0x344cd4][_0x0a9e('0x89')]&&_0x4093e6[_0x0a9e('0x36')](_0x138cf5,_0x1f6f1c[_0x344cd4][_0x0a9e('0x89')]==='DESC'?![]:!![]);_0x4093e6[_0x0a9e('0x62')](_0x138cf5,_0x1f6f1c[_0x344cd4][_0x0a9e('0x74')]||_0x138cf5);}if(_0x1fcfe6[_0x0a9e('0x75')]){_0x1fcfe6[_0x0a9e('0x75')]=JSON[_0x0a9e('0x76')](_0x1fcfe6[_0x0a9e('0x75')]);for(var _0x2895c5=0x0;_0x2895c5<_0x1fcfe6[_0x0a9e('0x75')]['length'];_0x2895c5+=0x1){if(_0x1fcfe6[_0x0a9e('0x75')][_0x2895c5][_0x0a9e('0x3c')]&&_[_0x0a9e('0x85')](_0x2b1824,_0x1fcfe6['joins'][_0x2895c5][_0x0a9e('0x3c')])&&_0x1fcfe6[_0x0a9e('0x75')][_0x2895c5][_0x0a9e('0x77')]&&_0x1fcfe6[_0x0a9e('0x75')][_0x2895c5][_0x0a9e('0x78')]&&_0x1fcfe6[_0x0a9e('0x75')][_0x2895c5][_0x0a9e('0x79')]){_0x4093e6[_0x1fcfe6[_0x0a9e('0x75')][_0x2895c5][_0x0a9e('0x3c')]](_0x1fcfe6[_0x0a9e('0x75')][_0x2895c5]['foreignTable'],null,util[_0x0a9e('0x71')](_0x0a9e('0x7a'),_0x1fcfe6[_0x0a9e('0x6c')],_0x1fcfe6[_0x0a9e('0x75')][_0x2895c5][_0x0a9e('0x77')],_0x1fcfe6[_0x0a9e('0x75')][_0x2895c5]['foreignTable'],_0x1fcfe6[_0x0a9e('0x75')][_0x2895c5]['foreignKey']));}}}if(_0x1fcfe6['conditions']){_0x1fcfe6['conditions']=JSON[_0x0a9e('0x76')](_0x1fcfe6[_0x0a9e('0x7b')]);_0x4093e6[_0x0a9e('0x38')](_0x26cb76(_0x1fcfe6[_0x0a9e('0x7b')]['group']));}_0x523d08=_0x4093e6[_0x0a9e('0x7c')]();_0x4093e6[_0x0a9e('0x1b')](_0x4383da);_0x4093e6[_0x0a9e('0x1a')](0x0);logger[_0x0a9e('0x7d')](_0x0a9e('0x7e'),_0x4093e6['toString']());return dbH['sequelize'][_0x0a9e('0x2e')](_0x4093e6[_0x0a9e('0x7f')](),{'type':dbH[_0x0a9e('0x80')]['QueryTypes'][_0x0a9e('0x81')]});}})[_0x0a9e('0x21')](function(){return{'sql':_0x523d08[_0x0a9e('0x7f')]()};})['then'](respondWithResult(_0x5ed560,null))[_0x0a9e('0x44')](handleError(_0x5ed560,null));}; \ No newline at end of file +var _0xb10b=['offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','catch','params','keys','find','create','body','user','role','get','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','table','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','AVG(%s)','GROUP_CONCAT(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','value','getFields','from','groupBy','fullPath','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','select','findAll','debug','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','dbH','status','end','json'];(function(_0x267a2d,_0x4f46e9){var _0x42057c=function(_0x5a56c9){while(--_0x5a56c9){_0x267a2d['push'](_0x267a2d['shift']());}};_0x42057c(++_0x4f46e9);}(_0xb10b,0x12a));var _0xbb10=function(_0x1db153,_0x1ab5d){_0x1db153=_0x1db153-0x0;var _0x530cbe=_0xb10b[_0x1db153];return _0x530cbe;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];var dbH=require(_0xbb10('0x17'))[_0xbb10('0x18')];function respondWithStatusCode(_0x193a27,_0x442548){_0x442548=_0x442548||0xcc;return function(_0x147230){if(_0x147230){return _0x193a27['sendStatus'](_0x442548);}return _0x193a27[_0xbb10('0x19')](_0x442548)[_0xbb10('0x1a')]();};}function respondWithResult(_0x45b9d6,_0x17fd46){_0x17fd46=_0x17fd46||0xc8;return function(_0x3df17b){if(_0x3df17b){return _0x45b9d6[_0xbb10('0x19')](_0x17fd46)[_0xbb10('0x1b')](_0x3df17b);}};}function respondWithFilteredResult(_0x36b5e8,_0x3e26f4){return function(_0x2b184e){if(_0x2b184e){var _0x4a2bfc=typeof _0x3e26f4[_0xbb10('0x1c')]===_0xbb10('0x1d')&&typeof _0x3e26f4[_0xbb10('0x1e')]===_0xbb10('0x1d');var _0x378da8=_0x2b184e[_0xbb10('0x1f')];var _0x575cca=_0x4a2bfc?0x0:_0x3e26f4[_0xbb10('0x1c')];var _0xbf2906=_0x4a2bfc?_0x2b184e[_0xbb10('0x1f')]:_0x3e26f4['offset']+_0x3e26f4[_0xbb10('0x1e')];var _0x19f48d;if(_0xbf2906>=_0x378da8){_0xbf2906=_0x378da8;_0x19f48d=0xc8;}else{_0x19f48d=0xce;}_0x36b5e8[_0xbb10('0x19')](_0x19f48d);return _0x36b5e8[_0xbb10('0x20')](_0xbb10('0x21'),_0x575cca+'-'+_0xbf2906+'/'+_0x378da8)[_0xbb10('0x1b')](_0x2b184e);}return null;};}function patchUpdates(_0x4deb49){return function(_0x12f888){try{jsonpatch[_0xbb10('0x22')](_0x12f888,_0x4deb49,!![]);}catch(_0x50aea1){return BPromise['reject'](_0x50aea1);}return _0x12f888[_0xbb10('0x23')]();};}function saveUpdates(_0x311abe,_0x2e911d){return function(_0x317da4){if(_0x317da4){return _0x317da4[_0xbb10('0x24')](_0x311abe)[_0xbb10('0x25')](function(_0x407cb4){return _0x407cb4;});}return null;};}function removeEntity(_0x436104,_0x7f2377){return function(_0x395404){if(_0x395404){return _0x395404[_0xbb10('0x26')]()[_0xbb10('0x25')](function(){var _0x537898=_0x395404['get']({'plain':!![]});var _0x4fb5e0=_0xbb10('0x27');return db[_0xbb10('0x28')][_0xbb10('0x26')]({'where':{'type':_0x4fb5e0,'resourceId':_0x537898['id']}})['then'](function(){return _0x395404;});})[_0xbb10('0x25')](function(){_0x436104[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1d5e95,_0x1acce9){return function(_0x20d946){if(!_0x20d946){_0x1d5e95[_0xbb10('0x29')](0x194);}return _0x20d946;};}function handleError(_0x4aabb9,_0x3796c7){_0x3796c7=_0x3796c7||0x1f4;return function(_0x21ac54){logger[_0xbb10('0x2a')](_0x21ac54[_0xbb10('0x2b')]);if(_0x21ac54[_0xbb10('0x2c')]){delete _0x21ac54[_0xbb10('0x2c')];}_0x4aabb9['status'](_0x3796c7)[_0xbb10('0x2d')](_0x21ac54);};}exports['index']=function(_0x448d5c,_0x56f2da){var _0x16ad2a={},_0x1dcc9c={},_0x1b59f9={'count':0x0,'rows':[]};var _0x491db4=_['map'](db[_0xbb10('0x2e')][_0xbb10('0x2f')],function(_0x4f590d){return{'name':_0x4f590d[_0xbb10('0x30')],'type':_0x4f590d[_0xbb10('0x31')][_0xbb10('0x32')]};});_0x1dcc9c[_0xbb10('0x33')]=_[_0xbb10('0x34')](_0x491db4,_0xbb10('0x2c'));_0x1dcc9c[_0xbb10('0x35')]=_['keys'](_0x448d5c[_0xbb10('0x35')]);_0x1dcc9c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x1dcc9c[_0xbb10('0x33')],_0x1dcc9c[_0xbb10('0x35')]);_0x16ad2a[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x1dcc9c[_0xbb10('0x33')],qs[_0xbb10('0x39')](_0x448d5c['query'][_0xbb10('0x39')]));_0x16ad2a[_0xbb10('0x38')]=_0x16ad2a[_0xbb10('0x38')][_0xbb10('0x3a')]?_0x16ad2a['attributes']:_0x1dcc9c[_0xbb10('0x33')];if(!_0x448d5c['query']['hasOwnProperty'](_0xbb10('0x3b'))){_0x16ad2a[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x448d5c[_0xbb10('0x35')][_0xbb10('0x1e')]);_0x16ad2a[_0xbb10('0x1c')]=qs['offset'](_0x448d5c[_0xbb10('0x35')][_0xbb10('0x1c')]);}_0x16ad2a['order']=qs['sort'](_0x448d5c['query'][_0xbb10('0x3c')]);_0x16ad2a[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x448d5c[_0xbb10('0x35')],_0x1dcc9c[_0xbb10('0x36')]),_0x491db4);if(_0x448d5c[_0xbb10('0x35')]['filter']){_0x16ad2a[_0xbb10('0x3d')]=_[_0xbb10('0x3e')](_0x16ad2a[_0xbb10('0x3d')],{'$or':_[_0xbb10('0x34')](_0x491db4,function(_0x4f1cdd){if(_0x4f1cdd[_0xbb10('0x31')]!==_0xbb10('0x3f')){var _0x5835fd={};_0x5835fd[_0x4f1cdd[_0xbb10('0x2c')]]={'$like':'%'+_0x448d5c[_0xbb10('0x35')][_0xbb10('0x40')]+'%'};return _0x5835fd;}})});}_0x16ad2a=_[_0xbb10('0x3e')]({},_0x16ad2a,_0x448d5c[_0xbb10('0x41')]);var _0x185a52={'where':_0x16ad2a['where']};return db[_0xbb10('0x2e')][_0xbb10('0x1f')](_0x185a52)[_0xbb10('0x25')](function(_0x3d3c41){_0x1b59f9['count']=_0x3d3c41;if(_0x448d5c[_0xbb10('0x35')][_0xbb10('0x42')]){_0x16ad2a[_0xbb10('0x43')]=[{'all':!![]}];}return db[_0xbb10('0x2e')]['findAll'](_0x16ad2a);})[_0xbb10('0x25')](function(_0x202c60){_0x1b59f9['rows']=_0x202c60;return _0x1b59f9;})['then'](respondWithFilteredResult(_0x56f2da,_0x16ad2a))[_0xbb10('0x44')](handleError(_0x56f2da,null));};exports['show']=function(_0x318984,_0x180933){var _0x4c66d8={'raw':![],'where':{'id':_0x318984[_0xbb10('0x45')]['id']}},_0x366608={};_0x366608[_0xbb10('0x33')]=_['keys'](db[_0xbb10('0x2e')][_0xbb10('0x2f')]);_0x366608[_0xbb10('0x35')]=_[_0xbb10('0x46')](_0x318984[_0xbb10('0x35')]);_0x366608[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x366608[_0xbb10('0x33')],_0x366608[_0xbb10('0x35')]);_0x4c66d8[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x366608[_0xbb10('0x33')],qs['fields'](_0x318984[_0xbb10('0x35')][_0xbb10('0x39')]));_0x4c66d8['attributes']=_0x4c66d8[_0xbb10('0x38')][_0xbb10('0x3a')]?_0x4c66d8[_0xbb10('0x38')]:_0x366608[_0xbb10('0x33')];if(_0x318984[_0xbb10('0x35')][_0xbb10('0x42')]){_0x4c66d8[_0xbb10('0x43')]=[{'all':!![]}];}_0x4c66d8=_['merge']({},_0x4c66d8,_0x318984['options']);return db[_0xbb10('0x2e')][_0xbb10('0x47')](_0x4c66d8)[_0xbb10('0x25')](handleEntityNotFound(_0x180933,null))['then'](respondWithResult(_0x180933,null))['catch'](handleError(_0x180933,null));};exports[_0xbb10('0x48')]=function(_0x34cf4e,_0x1bd054){return db[_0xbb10('0x2e')][_0xbb10('0x48')](_0x34cf4e[_0xbb10('0x49')],{})[_0xbb10('0x25')](function(_0x460788){var _0x2626d8=_0x34cf4e[_0xbb10('0x4a')]['get']({'plain':!![]});if(!_0x2626d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2626d8[_0xbb10('0x4b')]===_0xbb10('0x4a')){var _0x36ab7d=_0x460788[_0xbb10('0x4c')]({'plain':!![]});var _0x36aa7d=_0xbb10('0x4d');return db[_0xbb10('0x4e')][_0xbb10('0x47')]({'where':{'name':_0x36aa7d,'userProfileId':_0x2626d8[_0xbb10('0x4f')]},'raw':!![]})[_0xbb10('0x25')](function(_0x19ca3e){if(_0x19ca3e&&_0x19ca3e[_0xbb10('0x50')]===0x0){return db[_0xbb10('0x28')][_0xbb10('0x48')]({'name':_0x36ab7d[_0xbb10('0x2c')],'resourceId':_0x36ab7d['id'],'type':'CustomReports','sectionId':_0x19ca3e['id']},{})[_0xbb10('0x25')](function(){return _0x460788;});}else{return _0x460788;}})['catch'](function(_0x33d60a){logger[_0xbb10('0x2a')](_0xbb10('0x51'),_0x33d60a);throw _0x33d60a;});}return _0x460788;})[_0xbb10('0x25')](respondWithResult(_0x1bd054,0xc9))[_0xbb10('0x44')](handleError(_0x1bd054,null));};exports[_0xbb10('0x24')]=function(_0x2e3326,_0x44eec1){if(_0x2e3326[_0xbb10('0x49')]['id']){delete _0x2e3326[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x2e')][_0xbb10('0x47')]({'where':{'id':_0x2e3326[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x44eec1,null))[_0xbb10('0x25')](saveUpdates(_0x2e3326['body'],null))[_0xbb10('0x25')](respondWithResult(_0x44eec1,null))[_0xbb10('0x44')](handleError(_0x44eec1,null));};exports[_0xbb10('0x26')]=function(_0x4ce8e7,_0xbffa3c){return db[_0xbb10('0x2e')]['find']({'where':{'id':_0x4ce8e7[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0xbffa3c,null))[_0xbb10('0x25')](removeEntity(_0xbffa3c,null))[_0xbb10('0x44')](handleError(_0xbffa3c,null));};exports[_0xbb10('0x52')]=function(_0x22de7f,_0x175872){var _0x12ec18=0xa;var _0x205e01=[_0xbb10('0x53'),_0xbb10('0x54'),_0xbb10('0x55'),_0xbb10('0x56')];var _0x4e7fac={'SUM':'SUM(%s)','COUNT':_0xbb10('0x57'),'COUNT DISTINCT':_0xbb10('0x58'),'MAX':_0xbb10('0x59'),'MIN':_0xbb10('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbb10('0x5b'),'GROUP_CONCAT DESC':_0xbb10('0x5c')};var _0x410bef={'SEC_TO_TIME':_0xbb10('0x5d'),'DATE':_0xbb10('0x5e'),'HOUR':_0xbb10('0x5f'),'ROUND':_0xbb10('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x117e84=function(_0x216cff){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xbb10('0x61'),_0xbb10('0x62')],_0x216cff);};var _0x155dc5=function(_0x5bd1c0){if(!_0x5bd1c0||!_0x5bd1c0['rules']['length']){return'';}for(var _0x3ebc5f='(',_0x249b33=0x0;_0x249b33<_0x5bd1c0[_0xbb10('0x63')]['length'];_0x249b33+=0x1){_0x249b33>0x0&&(_0x3ebc5f+='\x20'+_0x5bd1c0[_0xbb10('0x64')]+'\x20');_0x3ebc5f+=_0x5bd1c0[_0xbb10('0x63')][_0x249b33]['group']?_0x155dc5(_0x5bd1c0['rules'][_0x249b33][_0xbb10('0x65')]):_0x5bd1c0[_0xbb10('0x63')][_0x249b33][_0xbb10('0x66')]+'\x20'+_0x5bd1c0[_0xbb10('0x63')][_0x249b33]['condition']+(_0x117e84(_0x5bd1c0[_0xbb10('0x63')][_0x249b33][_0xbb10('0x67')])?'\x20'+_0x5bd1c0[_0xbb10('0x63')][_0x249b33]['value']:'');}return _0x3ebc5f+')';};var _0x402a01={'where':{'id':_0x22de7f[_0xbb10('0x45')]['id']}},_0x2f05bc,_0x3e3617,_0x5b2bd4,_0x2ca491,_0x31e85e;_0x402a01=_[_0xbb10('0x3e')]({},_0x402a01,_0x22de7f['options']);return db[_0xbb10('0x2e')][_0xbb10('0x47')](_0x402a01)[_0xbb10('0x25')](function(_0x2d0f4b){if(_0x2d0f4b){_0x2f05bc=_0x2d0f4b;return _0x2d0f4b['getFields']();}return null;})[_0xbb10('0x25')](function(_0x277fe7){if(_0x277fe7){if(!_0x277fe7[_0xbb10('0x3a')]){throw new db[(_0xbb10('0x68'))][(_0xbb10('0x69'))](_0xbb10('0x6a'),0x193);}_0x3e3617=_0x277fe7;return db[_0xbb10('0x6b')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x5acd5e){if(_0x5acd5e){_0x5b2bd4=_[_0xbb10('0x6c')](_0x5acd5e,'id');var _0x9c672d;var _0x3eda96=squel['select']();_0x3eda96['from'](_0x2f05bc[_0xbb10('0x6d')]);for(var _0x1b11c0=0x0;_0x1b11c0<_0x3e3617[_0xbb10('0x3a')];_0x1b11c0+=0x1){_0x9c672d=_0x3e3617[_0x1b11c0][_0xbb10('0x6e')]?_0x5b2bd4[_0x3e3617[_0x1b11c0][_0xbb10('0x6e')]][_0xbb10('0x6f')]:_0x3e3617[_0x1b11c0]['field'];_0x9c672d=_0x3e3617[_0x1b11c0][_0xbb10('0x70')]?_[_0xbb10('0x71')](_0x4e7fac[_0x3e3617[_0x1b11c0][_0xbb10('0x70')]],'%s',_0x9c672d):_0x9c672d;_0x9c672d=_0x3e3617[_0x1b11c0][_0xbb10('0x72')]?_[_0xbb10('0x71')](_0x410bef[_0x3e3617[_0x1b11c0]['format']],'%s',_0x9c672d):_0x9c672d;if(_0x3e3617[_0x1b11c0]['groupBy']){_0x3eda96['group'](_0x9c672d);}_0x3e3617[_0x1b11c0][_0xbb10('0x73')]&&_0x3eda96[_0xbb10('0x74')](_0x9c672d,_0x3e3617[_0x1b11c0][_0xbb10('0x73')]===_0xbb10('0x75')?![]:!![]);_0x3eda96[_0xbb10('0x66')](_0x9c672d,_0x3e3617[_0x1b11c0][_0xbb10('0x76')]||_0x9c672d);}if(_0x2f05bc['joins']){_0x2f05bc[_0xbb10('0x77')]=JSON['parse'](_0x2f05bc['joins']);for(var _0x519a54=0x0;_0x519a54<_0x2f05bc[_0xbb10('0x77')][_0xbb10('0x3a')];_0x519a54+=0x1){if(_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x31')]&&_['includes'](_0x205e01,_0x2f05bc[_0xbb10('0x77')][_0x519a54]['type'])&&_0x2f05bc['joins'][_0x519a54][_0xbb10('0x78')]&&_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x79')]&&_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x7a')]){_0x3eda96[_0x2f05bc['joins'][_0x519a54][_0xbb10('0x31')]](_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x79')],null,util[_0xbb10('0x72')](_0xbb10('0x7b'),_0x2f05bc[_0xbb10('0x6d')],_0x2f05bc[_0xbb10('0x77')][_0x519a54]['parentKey'],_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x79')],_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x7a')]));}}}if(_0x2f05bc[_0xbb10('0x7c')]){_0x2f05bc[_0xbb10('0x7c')]=JSON[_0xbb10('0x7d')](_0x2f05bc[_0xbb10('0x7c')]);_0x3eda96['where'](_0x155dc5(_0x2f05bc[_0xbb10('0x7c')][_0xbb10('0x65')]));}_0x31e85e=_0x3eda96[_0xbb10('0x7e')]();_0x3eda96['limit'](_0x12ec18);_0x3eda96['offset'](0x0);logger['debug'](_0xbb10('0x7f'),_0x3eda96['toString']());return dbH['sequelize'][_0xbb10('0x35')](_0x3eda96[_0xbb10('0x80')](),{'type':dbH[_0xbb10('0x81')][_0xbb10('0x82')][_0xbb10('0x83')]});}})[_0xbb10('0x25')](respondWithResult(_0x175872,null))[_0xbb10('0x44')](handleError(_0x175872,null));};function runReport(_0x417304,_0x188b97,_0x5206e1){var _0x318a14=_0x188b97[_0xbb10('0x2c')];var _0x46b6d2=0xa;var _0x35b811=['join','left_join',_0xbb10('0x55'),_0xbb10('0x56')];var _0x30f0a4={'SUM':_0xbb10('0x84'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xbb10('0x58'),'MAX':_0xbb10('0x59'),'MIN':_0xbb10('0x5a'),'AVG':_0xbb10('0x85'),'GROUP_CONCAT':_0xbb10('0x86'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x372636={'SEC_TO_TIME':_0xbb10('0x5d'),'DATE':_0xbb10('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0xbb10('0x60'),'UNIX_TIMESTAMP':_0xbb10('0x87')};var _0x50bcc9=function(_0x5caa06){return!_[_0xbb10('0x88')]([_0xbb10('0x89'),_0xbb10('0x8a'),'IS\x20EMPTY',_0xbb10('0x62')],_0x5caa06);};var _0x3a17fc=function(_0xfbb365){if(!_0xfbb365||!_0xfbb365[_0xbb10('0x63')][_0xbb10('0x3a')]){return'';}for(var _0x5de006='(',_0x45bd4e=0x0;_0x45bd4e<_0xfbb365[_0xbb10('0x63')][_0xbb10('0x3a')];_0x45bd4e+=0x1){_0x45bd4e>0x0&&(_0x5de006+='\x20'+_0xfbb365['operator']+'\x20');_0x5de006+=_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x65')]?_0x3a17fc(_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x65')]):_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x66')]+'\x20'+_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x67')]+(_0x50bcc9(_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x67')])?'\x20'+_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x8b')]:'');}return _0x5de006+')';};var _0x59e985={'where':{'id':_0x417304['id']}},_0x51f106,_0xe1fc51,_0x3fa344,_0x458615,_0x3fd367;_0x59e985=_[_0xbb10('0x3e')]({},_0x59e985,_0x5206e1);return db['AnalyticCustomReport'][_0xbb10('0x47')](_0x59e985)[_0xbb10('0x25')](function(_0x3b4d0b){if(_0x3b4d0b){_0x51f106=_0x3b4d0b;return _0x3b4d0b[_0xbb10('0x8c')]();}return null;})[_0xbb10('0x25')](function(_0x379d49){if(_0x379d49){if(!_0x379d49['length']){throw new db[(_0xbb10('0x68'))][(_0xbb10('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xe1fc51=_0x379d49;return db[_0xbb10('0x6b')]['findAll']({'raw':!![]});}return null;})[_0xbb10('0x25')](function(_0x28bd76){if(_0x28bd76){_0x3fa344=_[_0xbb10('0x6c')](_0x28bd76,'id');var _0xa99bf5;var _0x3a4a6e=squel['select']();_0x3a4a6e[_0xbb10('0x8d')](_0x51f106['table']);for(var _0x3fcc55=0x0;_0x3fcc55<_0xe1fc51[_0xbb10('0x3a')];_0x3fcc55+=0x1){_0xa99bf5=_0xe1fc51[_0x3fcc55]['MetricId']?_0x3fa344[_0xe1fc51[_0x3fcc55]['MetricId']][_0xbb10('0x6f')]:_0xe1fc51[_0x3fcc55][_0xbb10('0x66')];_0xa99bf5=_0xe1fc51[_0x3fcc55][_0xbb10('0x70')]?_[_0xbb10('0x71')](_0x30f0a4[_0xe1fc51[_0x3fcc55][_0xbb10('0x70')]],'%s',_0xa99bf5):_0xa99bf5;_0xa99bf5=_0xe1fc51[_0x3fcc55][_0xbb10('0x72')]?_[_0xbb10('0x71')](_0x372636[_0xe1fc51[_0x3fcc55][_0xbb10('0x72')]],'%s',_0xa99bf5):_0xa99bf5;if(_0xe1fc51[_0x3fcc55][_0xbb10('0x8e')]){_0x3a4a6e[_0xbb10('0x65')](_0xa99bf5);}_0xe1fc51[_0x3fcc55][_0xbb10('0x73')]&&_0x3a4a6e['order'](_0xa99bf5,_0xe1fc51[_0x3fcc55][_0xbb10('0x73')]===_0xbb10('0x75')?![]:!![]);_0x3a4a6e[_0xbb10('0x66')](_0xa99bf5,_0xe1fc51[_0x3fcc55][_0xbb10('0x76')]||_0xa99bf5);}if(_0x51f106[_0xbb10('0x77')]){_0x51f106[_0xbb10('0x77')]=JSON[_0xbb10('0x7d')](_0x51f106[_0xbb10('0x77')]);for(var _0x3e6fe2=0x0;_0x3e6fe2<_0x51f106[_0xbb10('0x77')][_0xbb10('0x3a')];_0x3e6fe2+=0x1){if(_0x51f106[_0xbb10('0x77')][_0x3e6fe2]['type']&&_[_0xbb10('0x88')](_0x35b811,_0x51f106['joins'][_0x3e6fe2][_0xbb10('0x31')])&&_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x78')]&&_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x79')]&&_0x51f106['joins'][_0x3e6fe2][_0xbb10('0x7a')]){_0x3a4a6e[_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x31')]](_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x79')],null,util[_0xbb10('0x72')]('%s.%s\x20=\x20%s.%s',_0x51f106['table'],_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x78')],_0x51f106[_0xbb10('0x77')][_0x3e6fe2]['foreignTable'],_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x7a')]));}}}if(_0x51f106['conditions']){_0x51f106[_0xbb10('0x7c')]=JSON[_0xbb10('0x7d')](_0x51f106['conditions']);_0x3a4a6e[_0xbb10('0x3d')](_0x3a17fc(_0x51f106['conditions'][_0xbb10('0x65')]));}_0x3fd367=_0x3a4a6e[_0xbb10('0x7e')]();_0x3a4a6e['limit'](_0x46b6d2);_0x3a4a6e[_0xbb10('0x1c')](0x0);return;}})[_0xbb10('0x25')](function(){if(_0x188b97['output']==='web'){return null;}var _0xea6bf2=_[_0xbb10('0x3e')](_0x188b97,{'name':_0x188b97[_0xbb10('0x8f')]||_0x188b97[_0xbb10('0x2c')]||_0x51f106[_0xbb10('0x2c')],'basename':_0x318a14,'savename':util['format'](_0xbb10('0x90'),_0x188b97[_0xbb10('0x2c')]||_0x51f106[_0xbb10('0x2c')],require('randomstring')[_0xbb10('0x91')](0x4),_0x188b97[_0xbb10('0x92')]||_0xbb10('0x93')),'reportId':_0x51f106['id'],'reportType':_0xbb10('0x94')});return db[_0xbb10('0x95')][_0xbb10('0x48')](_0xea6bf2,{'raw':!![]});})[_0xbb10('0x25')](function(_0x189f07){if(_0x51f106[_0xbb10('0x6d')]==='cdr'){_0x3fd367['where'](_0x51f106[_0xbb10('0x6d')]+_0xbb10('0x96'),_0x188b97[_0xbb10('0x97')],_0x188b97[_0xbb10('0x98')]);}else{_0x3fd367[_0xbb10('0x3d')](_0x51f106[_0xbb10('0x6d')]+_0xbb10('0x99'),_0x188b97[_0xbb10('0x97')],_0x188b97[_0xbb10('0x98')]);}if(_0x189f07){logger[_0xbb10('0x9a')](_0xbb10('0x9b'),_0x3fd367[_0xbb10('0x80')]());require(_0xbb10('0x9c'))['fork'](path[_0xbb10('0x53')](__dirname,_0xbb10('0x9d'),_0x189f07[_0xbb10('0x92')]),[_0x189f07['id'],_0x3fd367[_0xbb10('0x80')](),path[_0xbb10('0x53')](__dirname,_0xbb10('0x9e'),_0x189f07[_0xbb10('0x9f')]),_0x318a14]);return _0x189f07;}else{var _0x1421e2=squel[_0xbb10('0xa0')]();_0x1421e2[_0xbb10('0x8d')]('('+_0x3fd367[_0xbb10('0x80')]()+')','countTable');_0x1421e2[_0xbb10('0x66')]('COUNT(*)',_0xbb10('0x1f'));_0x3fd367[_0xbb10('0x1e')](_0x188b97[_0xbb10('0x1e')]||_0x46b6d2);_0x3fd367[_0xbb10('0x1c')](_0x188b97[_0xbb10('0x1c')]||0x0);return dbH[_0xbb10('0x81')]['query'](_0x1421e2[_0xbb10('0x80')](),{'type':dbH['sequelize'][_0xbb10('0x82')][_0xbb10('0x83')]})[_0xbb10('0x25')](function(_0x576bb6){if(!_0x576bb6[_0xbb10('0x3a')]){_0x458615=0x0;}else{_0x458615=_0x576bb6[0x0][_0xbb10('0x1f')]||0x0;}return dbH[_0xbb10('0x81')][_0xbb10('0x35')](_0x3fd367[_0xbb10('0x80')](),{'type':dbH[_0xbb10('0x81')][_0xbb10('0x82')][_0xbb10('0x83')]});})['then'](function(_0x3696b3){return{'rows':_0x3696b3||[],'count':_0x458615};});}});}exports['run']=function(_0xe70161,_0x36e9b0){return runReport(_0xe70161[_0xbb10('0x45')],_0xe70161[_0xbb10('0x35')],_0xe70161[_0xbb10('0x41')])[_0xbb10('0x25')](respondWithResult(_0x36e9b0,null))[_0xbb10('0x44')](handleError(_0x36e9b0,null));};exports['runReport']=runReport;exports[_0xbb10('0x35')]=function(_0x5ca9a0,_0x51063a){var _0x1513e0=0xa;var _0x35cbb9=[_0xbb10('0x53'),_0xbb10('0x54'),_0xbb10('0x55'),_0xbb10('0x56')];var _0x5d1077={'SUM':_0xbb10('0x84'),'COUNT':_0xbb10('0x57'),'COUNT DISTINCT':_0xbb10('0x58'),'MAX':_0xbb10('0x59'),'MIN':_0xbb10('0x5a'),'AVG':_0xbb10('0x85'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbb10('0x5b'),'GROUP_CONCAT DESC':_0xbb10('0x5c')};var _0xb7c454={'SEC_TO_TIME':_0xbb10('0x5d'),'DATE':_0xbb10('0x5e'),'HOUR':_0xbb10('0x5f'),'ROUND':_0xbb10('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x33a43e=function(_0x5e4ae9){return!_[_0xbb10('0x88')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xbb10('0x61'),_0xbb10('0x62')],_0x5e4ae9);};var _0x24edcb=function(_0x3b7552){if(!_0x3b7552||!_0x3b7552[_0xbb10('0x63')]['length']){return'';}for(var _0xa42b80='(',_0x565ddf=0x0;_0x565ddf<_0x3b7552['rules']['length'];_0x565ddf+=0x1){_0x565ddf>0x0&&(_0xa42b80+='\x20'+_0x3b7552[_0xbb10('0x64')]+'\x20');_0xa42b80+=_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x65')]?_0x24edcb(_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x65')]):_0x3b7552['rules'][_0x565ddf][_0xbb10('0x66')]+'\x20'+_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x67')]+(_0x33a43e(_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x67')])?'\x20'+_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x8b')]:'');}return _0xa42b80+')';};var _0x485c1a={'where':{'id':_0x5ca9a0[_0xbb10('0x45')]['id']}},_0x4c95c2,_0x584a62,_0x386eac,_0x1581ef,_0x2ae3c6;_0x485c1a=_[_0xbb10('0x3e')]({},_0x485c1a,_0x5ca9a0[_0xbb10('0x41')]);return db[_0xbb10('0x2e')][_0xbb10('0x47')](_0x485c1a)[_0xbb10('0x25')](function(_0x3b1131){if(_0x3b1131){_0x4c95c2=_0x3b1131;return _0x3b1131['getFields']();}return null;})['then'](function(_0x4dce53){if(_0x4dce53){if(!_0x4dce53[_0xbb10('0x3a')]){throw new db[(_0xbb10('0x68'))][(_0xbb10('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x584a62=_0x4dce53;return db[_0xbb10('0x6b')][_0xbb10('0xa1')]({'raw':!![]});}return null;})[_0xbb10('0x25')](function(_0x290280){if(_0x290280){_0x386eac=_[_0xbb10('0x6c')](_0x290280,'id');var _0x11279d;var _0x485f46=squel['select']();_0x485f46[_0xbb10('0x8d')](_0x4c95c2['table']);for(var _0x370215=0x0;_0x370215<_0x584a62[_0xbb10('0x3a')];_0x370215+=0x1){_0x11279d=_0x584a62[_0x370215][_0xbb10('0x6e')]?_0x386eac[_0x584a62[_0x370215][_0xbb10('0x6e')]][_0xbb10('0x6f')]:_0x584a62[_0x370215][_0xbb10('0x66')];_0x11279d=_0x584a62[_0x370215][_0xbb10('0x70')]?_[_0xbb10('0x71')](_0x5d1077[_0x584a62[_0x370215][_0xbb10('0x70')]],'%s',_0x11279d):_0x11279d;_0x11279d=_0x584a62[_0x370215][_0xbb10('0x72')]?_['replace'](_0xb7c454[_0x584a62[_0x370215][_0xbb10('0x72')]],'%s',_0x11279d):_0x11279d;if(_0x584a62[_0x370215]['groupBy']){_0x485f46[_0xbb10('0x65')](_0x11279d);}_0x584a62[_0x370215]['orderBy']&&_0x485f46[_0xbb10('0x74')](_0x11279d,_0x584a62[_0x370215][_0xbb10('0x73')]===_0xbb10('0x75')?![]:!![]);_0x485f46[_0xbb10('0x66')](_0x11279d,_0x584a62[_0x370215]['alias']||_0x11279d);}if(_0x4c95c2[_0xbb10('0x77')]){_0x4c95c2['joins']=JSON[_0xbb10('0x7d')](_0x4c95c2[_0xbb10('0x77')]);for(var _0xcdaf04=0x0;_0xcdaf04<_0x4c95c2['joins'][_0xbb10('0x3a')];_0xcdaf04+=0x1){if(_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x31')]&&_[_0xbb10('0x88')](_0x35cbb9,_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x31')])&&_0x4c95c2['joins'][_0xcdaf04]['parentKey']&&_0x4c95c2['joins'][_0xcdaf04][_0xbb10('0x79')]&&_0x4c95c2['joins'][_0xcdaf04][_0xbb10('0x7a')]){_0x485f46[_0x4c95c2['joins'][_0xcdaf04][_0xbb10('0x31')]](_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x79')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4c95c2[_0xbb10('0x6d')],_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x78')],_0x4c95c2['joins'][_0xcdaf04][_0xbb10('0x79')],_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x7a')]));}}}if(_0x4c95c2['conditions']){_0x4c95c2['conditions']=JSON['parse'](_0x4c95c2[_0xbb10('0x7c')]);_0x485f46['where'](_0x24edcb(_0x4c95c2[_0xbb10('0x7c')][_0xbb10('0x65')]));}_0x2ae3c6=_0x485f46[_0xbb10('0x7e')]();_0x485f46[_0xbb10('0x1e')](_0x1513e0);_0x485f46[_0xbb10('0x1c')](0x0);logger[_0xbb10('0xa2')](_0xbb10('0x7f'),_0x485f46[_0xbb10('0x80')]());return dbH[_0xbb10('0x81')][_0xbb10('0x35')](_0x485f46[_0xbb10('0x80')](),{'type':dbH['sequelize'][_0xbb10('0x82')][_0xbb10('0x83')]});}})['then'](function(){return{'sql':_0x2ae3c6[_0xbb10('0x80')]()};})['then'](respondWithResult(_0x51063a,null))['catch'](handleError(_0x51063a,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index cd6d1dc..910969a 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 _0x9fc5=['exports','analytics_custom_reports','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0xcbe0a2,_0x3bcec3){var _0x2da492=function(_0x5ad278){while(--_0x5ad278){_0xcbe0a2['push'](_0xcbe0a2['shift']());}};_0x2da492(++_0x3bcec3);}(_0x9fc5,0x16a));var _0x59fc=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0x9fc5[_0x28b0a4];return _0x105ce6;};'use strict';var _=require('lodash');var util=require(_0x59fc('0x0'));var logger=require(_0x59fc('0x1'))(_0x59fc('0x2'));var moment=require(_0x59fc('0x3'));var BPromise=require(_0x59fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x59fc('0x5'));var config=require(_0x59fc('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0x59fc('0x7')]=function(_0x351355,_0x1fbb93){return _0x351355['define']('AnalyticCustomReport',attributes,{'tableName':_0x59fc('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3913=['AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','path','./analyticCustomReport.attributes','exports','define'];(function(_0x3601e8,_0x26e6c6){var _0x39382a=function(_0x2abaff){while(--_0x2abaff){_0x3601e8['push'](_0x3601e8['shift']());}};_0x39382a(++_0x26e6c6);}(_0x3913,0x110));var _0x3391=function(_0x54b5c1,_0x272a6e){_0x54b5c1=_0x54b5c1-0x0;var _0x51936c=_0x3913[_0x54b5c1];return _0x51936c;};'use strict';var _=require(_0x3391('0x0'));var util=require('util');var logger=require(_0x3391('0x1'))('api');var moment=require(_0x3391('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3391('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3391('0x4'));module[_0x3391('0x5')]=function(_0x301cea,_0x51fe5e){return _0x301cea[_0x3391('0x6')](_0x3391('0x7'),attributes,{'tableName':_0x3391('0x8'),'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 e7debf5..481be16 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 _0x5897=['result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0x5897,0x12e));var _0x7589=function(_0x5b26cb,_0x527ab0){_0x5b26cb=_0x5b26cb-0x0;var _0x563d12=_0x5897[_0x5b26cb];return _0x563d12;};'use strict';var _=require(_0x7589('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7589('0x1'));var rs=require(_0x7589('0x2'));var fs=require('fs');var Redis=require(_0x7589('0x3'));var db=require(_0x7589('0x4'))['db'];var utils=require(_0x7589('0x5'));var logger=require(_0x7589('0x6'))('rpc');var config=require(_0x7589('0x7'));var jayson=require(_0x7589('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29450a,_0x1e8c94,_0x39980c){return new BPromise(function(_0x24e638,_0x588c40){return client[_0x7589('0x9')](_0x29450a,_0x39980c)[_0x7589('0xa')](function(_0x3275b9){logger[_0x7589('0xb')](_0x7589('0xc'),_0x1e8c94,_0x7589('0xd'));logger[_0x7589('0xe')](_0x7589('0xf'),_0x1e8c94,_0x7589('0xd'),JSON['stringify'](_0x3275b9));if(_0x3275b9[_0x7589('0x10')]){if(_0x3275b9[_0x7589('0x10')]['code']===0x1f4){logger[_0x7589('0x10')](_0x7589('0xc'),_0x1e8c94,_0x3275b9[_0x7589('0x10')]['message']);return _0x588c40(_0x3275b9[_0x7589('0x10')][_0x7589('0x11')]);}logger[_0x7589('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1e8c94,_0x3275b9[_0x7589('0x10')]['message']);return _0x24e638(_0x3275b9[_0x7589('0x10')]['message']);}else{logger[_0x7589('0xb')](_0x7589('0xc'),_0x1e8c94,_0x7589('0xd'));_0x24e638(_0x3275b9[_0x7589('0x12')][_0x7589('0x11')]);}})[_0x7589('0x13')](function(_0x1957ea){logger['error'](_0x7589('0xc'),_0x1e8c94,_0x1957ea);_0x588c40(_0x1957ea);});});} \ No newline at end of file +var _0x1e3c=['then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x21cefb,_0x12aa66){var _0x1a7dc6=function(_0xa69318){while(--_0xa69318){_0x21cefb['push'](_0x21cefb['shift']());}};_0x1a7dc6(++_0x12aa66);}(_0x1e3c,0x73));var _0xc1e3=function(_0x7e142c,_0x1f24bb){_0x7e142c=_0x7e142c-0x0;var _0x3e7610=_0x1e3c[_0x7e142c];return _0x3e7610;};'use strict';var _=require('lodash');var util=require(_0xc1e3('0x0'));var moment=require(_0xc1e3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1e3('0x2'));var db=require(_0xc1e3('0x3'))['db'];var utils=require(_0xc1e3('0x4'));var logger=require(_0xc1e3('0x5'))('rpc');var config=require(_0xc1e3('0x6'));var jayson=require(_0xc1e3('0x7'));var client=jayson[_0xc1e3('0x8')][_0xc1e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c3ee1,_0x2e09e6,_0x1b2b25){return new BPromise(function(_0xb0f69a,_0xc361b1){return client[_0xc1e3('0xa')](_0x4c3ee1,_0x1b2b25)[_0xc1e3('0xb')](function(_0x55c98e){logger[_0xc1e3('0xc')](_0xc1e3('0xd'),_0x2e09e6,_0xc1e3('0xe'));logger[_0xc1e3('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x2e09e6,_0xc1e3('0xe'),JSON[_0xc1e3('0x10')](_0x55c98e));if(_0x55c98e[_0xc1e3('0x11')]){if(_0x55c98e['error']['code']===0x1f4){logger['error'](_0xc1e3('0xd'),_0x2e09e6,_0x55c98e[_0xc1e3('0x11')][_0xc1e3('0x12')]);return _0xc361b1(_0x55c98e[_0xc1e3('0x11')][_0xc1e3('0x12')]);}logger['error'](_0xc1e3('0xd'),_0x2e09e6,_0x55c98e[_0xc1e3('0x11')]['message']);return _0xb0f69a(_0x55c98e[_0xc1e3('0x11')][_0xc1e3('0x12')]);}else{logger['info'](_0xc1e3('0xd'),_0x2e09e6,_0xc1e3('0xe'));_0xb0f69a(_0x55c98e[_0xc1e3('0x13')][_0xc1e3('0x12')]);}})[_0xc1e3('0x14')](function(_0x155c4d){logger['error'](_0xc1e3('0xd'),_0x2e09e6,_0x155c4d);_0xc361b1(_0x155c4d);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index bf0d8e1..5e532f9 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 _0x3274=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','/:id','get','/:id/preview','preview','/:id/run','query','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0xe30506,_0x153809){var _0x21bba9=function(_0x5929bb){while(--_0x5929bb){_0xe30506['push'](_0xe30506['shift']());}};_0x21bba9(++_0x153809);}(_0x3274,0x134));var _0x4327=function(_0x20b242,_0x497d0c){_0x20b242=_0x20b242-0x0;var _0x4bb6c5=_0x3274[_0x20b242];return _0x4bb6c5;};'use strict';var multer=require(_0x4327('0x0'));var util=require('util');var path=require(_0x4327('0x1'));var timeout=require(_0x4327('0x2'));var express=require('express');var router=express[_0x4327('0x3')]();var fs_extra=require(_0x4327('0x4'));var auth=require(_0x4327('0x5'));var interaction=require(_0x4327('0x6'));var config=require(_0x4327('0x7'));var controller=require(_0x4327('0x8'));router['get']('/',auth[_0x4327('0x9')](),controller[_0x4327('0xa')]);router['get'](_0x4327('0xb'),auth[_0x4327('0x9')](),controller['show']);router[_0x4327('0xc')](_0x4327('0xd'),auth['isAuthenticated'](),controller[_0x4327('0xe')]);router['get'](_0x4327('0xf'),auth[_0x4327('0x9')](),controller['run']);router[_0x4327('0xc')]('/:id/query',auth[_0x4327('0x9')](),controller[_0x4327('0x10')]);router[_0x4327('0x11')]('/',auth['isAuthenticated'](),controller[_0x4327('0x12')]);router[_0x4327('0x13')](_0x4327('0xb'),auth['isAuthenticated'](),controller[_0x4327('0x14')]);router[_0x4327('0x15')](_0x4327('0xb'),auth['isAuthenticated'](),controller[_0x4327('0x16')]);module[_0x4327('0x17')]=router; \ No newline at end of file +var _0x0a39=['isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x0a39,0x176));var _0x90a3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0a39[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x90a3('0x0'));var util=require('util');var path=require(_0x90a3('0x1'));var timeout=require(_0x90a3('0x2'));var express=require('express');var router=express[_0x90a3('0x3')]();var fs_extra=require(_0x90a3('0x4'));var auth=require(_0x90a3('0x5'));var interaction=require(_0x90a3('0x6'));var config=require(_0x90a3('0x7'));var controller=require(_0x90a3('0x8'));router[_0x90a3('0x9')]('/',auth[_0x90a3('0xa')](),controller[_0x90a3('0xb')]);router[_0x90a3('0x9')](_0x90a3('0xc'),auth[_0x90a3('0xa')](),controller[_0x90a3('0xd')]);router['get'](_0x90a3('0xe'),auth[_0x90a3('0xa')](),controller[_0x90a3('0xf')]);router[_0x90a3('0x9')](_0x90a3('0x10'),auth['isAuthenticated'](),controller['run']);router[_0x90a3('0x9')](_0x90a3('0x11'),auth[_0x90a3('0xa')](),controller['query']);router['post']('/',auth[_0x90a3('0xa')](),controller[_0x90a3('0x12')]);router[_0x90a3('0x13')](_0x90a3('0xc'),auth[_0x90a3('0xa')](),controller[_0x90a3('0x14')]);router[_0x90a3('0x15')](_0x90a3('0xc'),auth[_0x90a3('0xa')](),controller[_0x90a3('0x16')]);module[_0x90a3('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 1d82319..9e383b0 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 _0xfb6f=['exports','STRING','TEXT'];(function(_0x279150,_0x1bc284){var _0x10dd1f=function(_0x52509c){while(--_0x52509c){_0x279150['push'](_0x279150['shift']());}};_0x10dd1f(++_0x1bc284);}(_0xfb6f,0x1a4));var _0xffb6=function(_0x34499c,_0x3dd55a){_0x34499c=_0x34499c-0x0;var _0x495f15=_0xfb6f[_0x34499c];return _0x495f15;};'use strict';var Sequelize=require('sequelize');module[_0xffb6('0x0')]={'name':{'type':Sequelize[_0xffb6('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xffb6('0x1')]},'parent':{'type':Sequelize[_0xffb6('0x1')]},'table':{'type':Sequelize[_0xffb6('0x1')]},'conditions':{'type':Sequelize[_0xffb6('0x2')]},'joins':{'type':Sequelize[_0xffb6('0x2')]}}; \ No newline at end of file +var _0x53e0=['STRING','TEXT','sequelize'];(function(_0x709af9,_0x13238f){var _0x594410=function(_0x3bcffd){while(--_0x3bcffd){_0x709af9['push'](_0x709af9['shift']());}};_0x594410(++_0x13238f);}(_0x53e0,0x1a0));var _0x053e=function(_0x317cc5,_0x3b6179){_0x317cc5=_0x317cc5-0x0;var _0x44fe81=_0x53e0[_0x317cc5];return _0x44fe81;};'use strict';var Sequelize=require(_0x053e('0x0'));module['exports']={'name':{'type':Sequelize[_0x053e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x053e('0x1')]},'parent':{'type':Sequelize[_0x053e('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x053e('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 840676f..35cf045 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 _0x9a9c=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Reports','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','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)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20NULL','value','Please\x20insert\x20at\x20least\x20one\x20field','metric','alias','output','web','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','DefaultReports','UserProfileResource','then','stack','name','send','map','AnalyticDefaultReport','rawAttributes','type','key','model'];(function(_0x2c0dc0,_0x19900d){var _0x4c0990=function(_0x530791){while(--_0x530791){_0x2c0dc0['push'](_0x2c0dc0['shift']());}};_0x4c0990(++_0x19900d);}(_0x9a9c,0x1c1));var _0xc9a9=function(_0x81d7c0,_0x11ac68){_0x81d7c0=_0x81d7c0-0x0;var _0x3d8ff5=_0x9a9c[_0x81d7c0];return _0x3d8ff5;};'use strict';var emlformat=require(_0xc9a9('0x0'));var rimraf=require(_0xc9a9('0x1'));var zipdir=require(_0xc9a9('0x2'));var jsonpatch=require(_0xc9a9('0x3'));var rp=require(_0xc9a9('0x4'));var moment=require(_0xc9a9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc9a9('0x6'));var util=require(_0xc9a9('0x7'));var path=require(_0xc9a9('0x8'));var sox=require(_0xc9a9('0x9'));var csv=require(_0xc9a9('0xa'));var ejs=require(_0xc9a9('0xb'));var fs=require('fs');var fs_extra=require(_0xc9a9('0xc'));var _=require(_0xc9a9('0xd'));var squel=require('squel');var crypto=require(_0xc9a9('0xe'));var jsforce=require(_0xc9a9('0xf'));var deskjs=require(_0xc9a9('0x10'));var toCsv=require(_0xc9a9('0xa'));var querystring=require('querystring');var Papa=require(_0xc9a9('0x11'));var Redis=require('ioredis');var authService=require(_0xc9a9('0x12'));var qs=require(_0xc9a9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc9a9('0x14'))(_0xc9a9('0x15'));var utils=require(_0xc9a9('0x16'));var config=require(_0xc9a9('0x17'));var licenseUtil=require(_0xc9a9('0x18'));var db=require(_0xc9a9('0x19'))['db'];var dbH=require(_0xc9a9('0x19'))[_0xc9a9('0x1a')];function respondWithStatusCode(_0x3df27a,_0x5abe65){_0x5abe65=_0x5abe65||0xcc;return function(_0x3dedcb){if(_0x3dedcb){return _0x3df27a[_0xc9a9('0x1b')](_0x5abe65);}return _0x3df27a[_0xc9a9('0x1c')](_0x5abe65)[_0xc9a9('0x1d')]();};}function respondWithResult(_0x674ee,_0x3580c1){_0x3580c1=_0x3580c1||0xc8;return function(_0x1cd2cb){if(_0x1cd2cb){return _0x674ee[_0xc9a9('0x1c')](_0x3580c1)[_0xc9a9('0x1e')](_0x1cd2cb);}};}function respondWithFilteredResult(_0x230536,_0x10981e){return function(_0x1e4a83){if(_0x1e4a83){var _0x1fed8e=typeof _0x10981e[_0xc9a9('0x1f')]===_0xc9a9('0x20')&&typeof _0x10981e[_0xc9a9('0x21')]===_0xc9a9('0x20');var _0x5b9e52=_0x1e4a83[_0xc9a9('0x22')];var _0x530c73=_0x1fed8e?0x0:_0x10981e['offset'];var _0x2c6c74=_0x1fed8e?_0x1e4a83[_0xc9a9('0x22')]:_0x10981e[_0xc9a9('0x1f')]+_0x10981e[_0xc9a9('0x21')];var _0x516dd8;if(_0x2c6c74>=_0x5b9e52){_0x2c6c74=_0x5b9e52;_0x516dd8=0xc8;}else{_0x516dd8=0xce;}_0x230536[_0xc9a9('0x1c')](_0x516dd8);return _0x230536[_0xc9a9('0x23')](_0xc9a9('0x24'),_0x530c73+'-'+_0x2c6c74+'/'+_0x5b9e52)[_0xc9a9('0x1e')](_0x1e4a83);}return null;};}function patchUpdates(_0x3a1d21){return function(_0x49fad5){try{jsonpatch[_0xc9a9('0x25')](_0x49fad5,_0x3a1d21,!![]);}catch(_0x1084c7){return BPromise[_0xc9a9('0x26')](_0x1084c7);}return _0x49fad5['save']();};}function saveUpdates(_0x3095c1,_0x55d0af){return function(_0x3c271f){if(_0x3c271f){return _0x3c271f['update'](_0x3095c1)['then'](function(_0x43a90b){return _0x43a90b;});}return null;};}function removeEntity(_0x5ad062,_0x341a5f){return function(_0x3529ca){if(_0x3529ca){return _0x3529ca[_0xc9a9('0x27')]()['then'](function(){var _0x2c227b=_0x3529ca['get']({'plain':!![]});var _0x5cb203=_0xc9a9('0x28');return db[_0xc9a9('0x29')][_0xc9a9('0x27')]({'where':{'type':_0x5cb203,'resourceId':_0x2c227b['id']}})[_0xc9a9('0x2a')](function(){return _0x3529ca;});})[_0xc9a9('0x2a')](function(){_0x5ad062['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x295eba,_0x33abbc){return function(_0x448055){if(!_0x448055){_0x295eba['sendStatus'](0x194);}return _0x448055;};}function handleError(_0xf52e9f,_0xd7f5dc){_0xd7f5dc=_0xd7f5dc||0x1f4;return function(_0x28c4f6){logger['error'](_0x28c4f6[_0xc9a9('0x2b')]);if(_0x28c4f6[_0xc9a9('0x2c')]){delete _0x28c4f6[_0xc9a9('0x2c')];}_0xf52e9f[_0xc9a9('0x1c')](_0xd7f5dc)[_0xc9a9('0x2d')](_0x28c4f6);};}exports['index']=function(_0x10034f,_0x4716e4){var _0x5d5538={},_0xa29277={},_0x29850f={'count':0x0,'rows':[]};var _0x46200c=_[_0xc9a9('0x2e')](db[_0xc9a9('0x2f')][_0xc9a9('0x30')],function(_0x37e50b){return{'name':_0x37e50b['fieldName'],'type':_0x37e50b[_0xc9a9('0x31')][_0xc9a9('0x32')]};});_0xa29277[_0xc9a9('0x33')]=_[_0xc9a9('0x2e')](_0x46200c,_0xc9a9('0x2c'));_0xa29277[_0xc9a9('0x34')]=_['keys'](_0x10034f[_0xc9a9('0x34')]);_0xa29277[_0xc9a9('0x35')]=_[_0xc9a9('0x36')](_0xa29277['model'],_0xa29277[_0xc9a9('0x34')]);_0x5d5538[_0xc9a9('0x37')]=_['intersection'](_0xa29277['model'],qs[_0xc9a9('0x38')](_0x10034f['query'][_0xc9a9('0x38')]));_0x5d5538[_0xc9a9('0x37')]=_0x5d5538['attributes']['length']?_0x5d5538['attributes']:_0xa29277['model'];if(!_0x10034f[_0xc9a9('0x34')][_0xc9a9('0x39')](_0xc9a9('0x3a'))){_0x5d5538[_0xc9a9('0x21')]=qs[_0xc9a9('0x21')](_0x10034f[_0xc9a9('0x34')][_0xc9a9('0x21')]);_0x5d5538[_0xc9a9('0x1f')]=qs['offset'](_0x10034f[_0xc9a9('0x34')]['offset']);}_0x5d5538[_0xc9a9('0x3b')]=qs[_0xc9a9('0x3c')](_0x10034f[_0xc9a9('0x34')][_0xc9a9('0x3c')]);_0x5d5538['where']=qs[_0xc9a9('0x35')](_[_0xc9a9('0x3d')](_0x10034f[_0xc9a9('0x34')],_0xa29277[_0xc9a9('0x35')]),_0x46200c);if(_0x10034f[_0xc9a9('0x34')]['filter']){_0x5d5538[_0xc9a9('0x3e')]=_['merge'](_0x5d5538[_0xc9a9('0x3e')],{'$or':_[_0xc9a9('0x2e')](_0x46200c,function(_0xc2c570){if(_0xc2c570['type']!=='VIRTUAL'){var _0xa028f7={};_0xa028f7[_0xc2c570[_0xc9a9('0x2c')]]={'$like':'%'+_0x10034f[_0xc9a9('0x34')][_0xc9a9('0x3f')]+'%'};return _0xa028f7;}})});}_0x5d5538=_[_0xc9a9('0x40')]({},_0x5d5538,_0x10034f[_0xc9a9('0x41')]);var _0x38e239={'where':_0x5d5538[_0xc9a9('0x3e')]};return db[_0xc9a9('0x2f')][_0xc9a9('0x22')](_0x38e239)[_0xc9a9('0x2a')](function(_0x3d775e){_0x29850f[_0xc9a9('0x22')]=_0x3d775e;if(_0x10034f['query'][_0xc9a9('0x42')]){_0x5d5538[_0xc9a9('0x43')]=[{'all':!![]}];}return db[_0xc9a9('0x2f')][_0xc9a9('0x44')](_0x5d5538);})[_0xc9a9('0x2a')](function(_0x384a68){_0x29850f['rows']=_0x384a68;return _0x29850f;})[_0xc9a9('0x2a')](respondWithFilteredResult(_0x4716e4,_0x5d5538))[_0xc9a9('0x45')](handleError(_0x4716e4,null));};exports[_0xc9a9('0x46')]=function(_0x2ae187,_0x3af8c5){var _0x1f0291={'raw':!![],'where':{'id':_0x2ae187[_0xc9a9('0x47')]['id']}},_0x54d673={};_0x54d673[_0xc9a9('0x33')]=_[_0xc9a9('0x48')](db[_0xc9a9('0x2f')][_0xc9a9('0x30')]);_0x54d673[_0xc9a9('0x34')]=_[_0xc9a9('0x48')](_0x2ae187[_0xc9a9('0x34')]);_0x54d673[_0xc9a9('0x35')]=_['intersection'](_0x54d673['model'],_0x54d673[_0xc9a9('0x34')]);_0x1f0291[_0xc9a9('0x37')]=_[_0xc9a9('0x36')](_0x54d673['model'],qs[_0xc9a9('0x38')](_0x2ae187[_0xc9a9('0x34')][_0xc9a9('0x38')]));_0x1f0291['attributes']=_0x1f0291['attributes'][_0xc9a9('0x49')]?_0x1f0291[_0xc9a9('0x37')]:_0x54d673['model'];if(_0x2ae187[_0xc9a9('0x34')][_0xc9a9('0x42')]){_0x1f0291['include']=[{'all':!![]}];}_0x1f0291=_[_0xc9a9('0x40')]({},_0x1f0291,_0x2ae187[_0xc9a9('0x41')]);return db['AnalyticDefaultReport']['find'](_0x1f0291)['then'](handleEntityNotFound(_0x3af8c5,null))['then'](respondWithResult(_0x3af8c5,null))[_0xc9a9('0x45')](handleError(_0x3af8c5,null));};exports[_0xc9a9('0x4a')]=function(_0x5729a7,_0x2a0424){return db[_0xc9a9('0x2f')][_0xc9a9('0x4a')](_0x5729a7[_0xc9a9('0x4b')],{})['then'](function(_0x53e781){var _0x490b87=_0x5729a7[_0xc9a9('0x4c')]['get']({'plain':!![]});if(!_0x490b87)throw new Error(_0xc9a9('0x4d'));if(_0x490b87['role']===_0xc9a9('0x4c')){var _0x35b7de=_0x53e781[_0xc9a9('0x4e')]({'plain':!![]});var _0x1e4f1c=_0xc9a9('0x4f');return db[_0xc9a9('0x50')][_0xc9a9('0x51')]({'where':{'name':_0x1e4f1c,'userProfileId':_0x490b87[_0xc9a9('0x52')]},'raw':!![]})[_0xc9a9('0x2a')](function(_0x32b495){if(_0x32b495&&_0x32b495['autoAssociation']===0x0){return db['UserProfileResource'][_0xc9a9('0x4a')]({'name':_0x35b7de[_0xc9a9('0x2c')],'resourceId':_0x35b7de['id'],'type':_0xc9a9('0x28'),'sectionId':_0x32b495['id']},{})[_0xc9a9('0x2a')](function(){return _0x53e781;});}else{return _0x53e781;}})[_0xc9a9('0x45')](function(_0x46f1b9){logger[_0xc9a9('0x53')](_0xc9a9('0x54'),_0x46f1b9);throw _0x46f1b9;});}return _0x53e781;})[_0xc9a9('0x2a')](respondWithResult(_0x2a0424,0xc9))[_0xc9a9('0x45')](handleError(_0x2a0424,null));};exports[_0xc9a9('0x55')]=function(_0xb48a55,_0x151d25){if(_0xb48a55[_0xc9a9('0x4b')]['id']){delete _0xb48a55[_0xc9a9('0x4b')]['id'];}return db[_0xc9a9('0x2f')][_0xc9a9('0x51')]({'where':{'id':_0xb48a55[_0xc9a9('0x47')]['id']}})['then'](handleEntityNotFound(_0x151d25,null))[_0xc9a9('0x2a')](saveUpdates(_0xb48a55[_0xc9a9('0x4b')],null))[_0xc9a9('0x2a')](respondWithResult(_0x151d25,null))[_0xc9a9('0x45')](handleError(_0x151d25,null));};exports[_0xc9a9('0x27')]=function(_0xbb40e7,_0x50b8cb){return db[_0xc9a9('0x2f')][_0xc9a9('0x51')]({'where':{'id':_0xbb40e7[_0xc9a9('0x47')]['id']}})[_0xc9a9('0x2a')](handleEntityNotFound(_0x50b8cb,null))[_0xc9a9('0x2a')](removeEntity(_0x50b8cb,null))['catch'](handleError(_0x50b8cb,null));};exports[_0xc9a9('0x56')]=function(_0x532678,_0x515d08){var _0x33fe6a=0xa;var _0x46cd57=[_0xc9a9('0x57'),_0xc9a9('0x58'),_0xc9a9('0x59'),_0xc9a9('0x5a')];var _0x2c4e1f={'SUM':_0xc9a9('0x5b'),'COUNT':_0xc9a9('0x5c'),'COUNT DISTINCT':_0xc9a9('0x5d'),'MAX':_0xc9a9('0x5e'),'MIN':_0xc9a9('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc9a9('0x60'),'GROUP_CONCAT ASC':_0xc9a9('0x61'),'GROUP_CONCAT DESC':_0xc9a9('0x62')};var _0x3cd862={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xc9a9('0x63'),'ROUND':_0xc9a9('0x64'),'UNIX_TIMESTAMP':_0xc9a9('0x65')};var _0x66be74=function(_0x194a21){return!_[_0xc9a9('0x66')]([_0xc9a9('0x67'),'IS\x20NOT\x20NULL',_0xc9a9('0x68'),_0xc9a9('0x69')],_0x194a21);};var _0x39684e=function(_0x453951){if(!_0x453951||!_0x453951['rules'][_0xc9a9('0x49')]){return'';}for(var _0x58238e='(',_0x2647dd=0x0;_0x2647dd<_0x453951[_0xc9a9('0x6a')][_0xc9a9('0x49')];_0x2647dd+=0x1){_0x2647dd>0x0&&(_0x58238e+='\x20'+_0x453951[_0xc9a9('0x6b')]+'\x20');_0x58238e+=_0x453951[_0xc9a9('0x6a')][_0x2647dd][_0xc9a9('0x6c')]?_0x39684e(_0x453951['rules'][_0x2647dd][_0xc9a9('0x6c')]):_0x453951[_0xc9a9('0x6a')][_0x2647dd][_0xc9a9('0x6d')]+'\x20'+_0x453951[_0xc9a9('0x6a')][_0x2647dd][_0xc9a9('0x6e')]+(_0x66be74(_0x453951[_0xc9a9('0x6a')][_0x2647dd]['condition'])?'\x20'+_0x453951[_0xc9a9('0x6a')][_0x2647dd]['value']:'');}return _0x58238e+')';};var _0x3b3af9={'where':{'id':_0x532678[_0xc9a9('0x47')]['id']}},_0x57fafa,_0x215557,_0x4d556b,_0x1bc759,_0x306ac5;_0x3b3af9=_[_0xc9a9('0x40')]({},_0x3b3af9,_0x532678['options']);return db[_0xc9a9('0x2f')][_0xc9a9('0x51')](_0x3b3af9)['then'](function(_0x2ec2e9){if(_0x2ec2e9){_0x57fafa=_0x2ec2e9;return _0x2ec2e9[_0xc9a9('0x6f')]();}return null;})['then'](function(_0x36891a){if(_0x36891a){if(!_0x36891a[_0xc9a9('0x49')]){throw new db[(_0xc9a9('0x70'))][(_0xc9a9('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x215557=_0x36891a;return db[_0xc9a9('0x72')][_0xc9a9('0x44')]({'raw':!![]});}return null;})[_0xc9a9('0x2a')](function(_0x231c89){if(_0x231c89){_0x4d556b=_[_0xc9a9('0x73')](_0x231c89,'id');var _0x4ef1c9;var _0x46c018=squel[_0xc9a9('0x74')]();_0x46c018[_0xc9a9('0x75')](_0x57fafa[_0xc9a9('0x76')]);for(var _0x359d71=0x0;_0x359d71<_0x215557[_0xc9a9('0x49')];_0x359d71+=0x1){_0x4ef1c9=_0x215557[_0x359d71][_0xc9a9('0x77')]?_0x4d556b[_0x215557[_0x359d71][_0xc9a9('0x77')]]['metric']:_0x215557[_0x359d71][_0xc9a9('0x6d')];_0x4ef1c9=_0x215557[_0x359d71][_0xc9a9('0x78')]?_[_0xc9a9('0x79')](_0x2c4e1f[_0x215557[_0x359d71][_0xc9a9('0x78')]],'%s',_0x4ef1c9):_0x4ef1c9;_0x4ef1c9=_0x215557[_0x359d71][_0xc9a9('0x7a')]?_[_0xc9a9('0x79')](_0x3cd862[_0x215557[_0x359d71]['format']],'%s',_0x4ef1c9):_0x4ef1c9;if(_0x215557[_0x359d71][_0xc9a9('0x7b')]){_0x46c018[_0xc9a9('0x6c')](_0x4ef1c9);}_0x215557[_0x359d71][_0xc9a9('0x7c')]&&_0x46c018['order'](_0x4ef1c9,_0x215557[_0x359d71]['orderBy']===_0xc9a9('0x7d')?![]:!![]);_0x46c018[_0xc9a9('0x6d')](_0x4ef1c9,_0x215557[_0x359d71]['alias']||_0x4ef1c9);}if(_0x57fafa[_0xc9a9('0x7e')]){_0x57fafa[_0xc9a9('0x7e')]=JSON[_0xc9a9('0x7f')](_0x57fafa[_0xc9a9('0x7e')]);for(var _0x6cf7b9=0x0;_0x6cf7b9<_0x57fafa[_0xc9a9('0x7e')][_0xc9a9('0x49')];_0x6cf7b9+=0x1){if(_0x57fafa[_0xc9a9('0x7e')][_0x6cf7b9]['type']&&_[_0xc9a9('0x66')](_0x46cd57,_0x57fafa[_0xc9a9('0x7e')][_0x6cf7b9][_0xc9a9('0x31')])&&_0x57fafa[_0xc9a9('0x7e')][_0x6cf7b9][_0xc9a9('0x80')]&&_0x57fafa[_0xc9a9('0x7e')][_0x6cf7b9][_0xc9a9('0x81')]&&_0x57fafa[_0xc9a9('0x7e')][_0x6cf7b9][_0xc9a9('0x82')]){_0x46c018[_0x57fafa[_0xc9a9('0x7e')][_0x6cf7b9][_0xc9a9('0x31')]](_0x57fafa['joins'][_0x6cf7b9][_0xc9a9('0x81')],null,util[_0xc9a9('0x7a')](_0xc9a9('0x83'),_0x57fafa[_0xc9a9('0x76')],_0x57fafa['joins'][_0x6cf7b9][_0xc9a9('0x80')],_0x57fafa[_0xc9a9('0x7e')][_0x6cf7b9][_0xc9a9('0x81')],_0x57fafa[_0xc9a9('0x7e')][_0x6cf7b9][_0xc9a9('0x82')]));}}}if(_0x57fafa[_0xc9a9('0x84')]){_0x57fafa[_0xc9a9('0x84')]=JSON[_0xc9a9('0x7f')](_0x57fafa[_0xc9a9('0x84')]);_0x46c018['where'](_0x39684e(_0x57fafa[_0xc9a9('0x84')]['group']));}_0x306ac5=_0x46c018[_0xc9a9('0x85')]();_0x46c018[_0xc9a9('0x21')](_0x33fe6a);_0x46c018[_0xc9a9('0x1f')](0x0);logger[_0xc9a9('0x86')](_0xc9a9('0x87'),_0x46c018[_0xc9a9('0x88')]());return dbH[_0xc9a9('0x89')][_0xc9a9('0x34')](_0x46c018['toString'](),{'type':dbH[_0xc9a9('0x89')][_0xc9a9('0x8a')]['SELECT']});}})[_0xc9a9('0x2a')](respondWithResult(_0x515d08,null))['catch'](handleError(_0x515d08,null));};function runReport(_0x2aa23a,_0x579b43,_0x122d66){var _0x42ee39=_0x579b43['name'];var _0x598607=0xa;var _0x402212=[_0xc9a9('0x57'),_0xc9a9('0x58'),_0xc9a9('0x59'),_0xc9a9('0x5a')];var _0x59b8f0={'SUM':_0xc9a9('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xc9a9('0x5f'),'AVG':_0xc9a9('0x8b'),'GROUP_CONCAT':_0xc9a9('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4c6fd8={'SEC_TO_TIME':_0xc9a9('0x8c'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xc9a9('0x64'),'UNIX_TIMESTAMP':_0xc9a9('0x65')};var _0x39ab40=function(_0x36d06e){return!_[_0xc9a9('0x66')]([_0xc9a9('0x67'),_0xc9a9('0x8d'),'IS\x20EMPTY',_0xc9a9('0x69')],_0x36d06e);};var _0x5b9a3b=function(_0x193f5d){if(!_0x193f5d||!_0x193f5d[_0xc9a9('0x6a')][_0xc9a9('0x49')]){return'';}for(var _0x322d80='(',_0x39991d=0x0;_0x39991d<_0x193f5d[_0xc9a9('0x6a')]['length'];_0x39991d+=0x1){_0x39991d>0x0&&(_0x322d80+='\x20'+_0x193f5d[_0xc9a9('0x6b')]+'\x20');_0x322d80+=_0x193f5d[_0xc9a9('0x6a')][_0x39991d]['group']?_0x5b9a3b(_0x193f5d[_0xc9a9('0x6a')][_0x39991d]['group']):_0x193f5d[_0xc9a9('0x6a')][_0x39991d][_0xc9a9('0x6d')]+'\x20'+_0x193f5d[_0xc9a9('0x6a')][_0x39991d][_0xc9a9('0x6e')]+(_0x39ab40(_0x193f5d[_0xc9a9('0x6a')][_0x39991d][_0xc9a9('0x6e')])?'\x20'+_0x193f5d[_0xc9a9('0x6a')][_0x39991d][_0xc9a9('0x8e')]:'');}return _0x322d80+')';};var _0x1fa908={'where':{'id':_0x2aa23a['id']}},_0x40f4d8,_0x1631f7,_0x180ed3,_0x4a6bea,_0xf07d78;_0x1fa908=_[_0xc9a9('0x40')]({},_0x1fa908,_0x122d66);return db[_0xc9a9('0x2f')][_0xc9a9('0x51')](_0x1fa908)[_0xc9a9('0x2a')](function(_0xe8142c){if(_0xe8142c){_0x40f4d8=_0xe8142c;return _0xe8142c[_0xc9a9('0x6f')]();}return null;})['then'](function(_0x139ffa){if(_0x139ffa){if(!_0x139ffa[_0xc9a9('0x49')]){throw new db[(_0xc9a9('0x70'))]['ValidationErrorItem'](_0xc9a9('0x8f'),0x193);}_0x1631f7=_0x139ffa;return db[_0xc9a9('0x72')][_0xc9a9('0x44')]({'raw':!![]});}return null;})[_0xc9a9('0x2a')](function(_0x3afef2){if(_0x3afef2){_0x180ed3=_[_0xc9a9('0x73')](_0x3afef2,'id');var _0xb51252;var _0x52c21f=squel['select']();_0x52c21f['from'](_0x40f4d8['table']);for(var _0x2e2bc3=0x0;_0x2e2bc3<_0x1631f7['length'];_0x2e2bc3+=0x1){_0xb51252=_0x1631f7[_0x2e2bc3][_0xc9a9('0x77')]?_0x180ed3[_0x1631f7[_0x2e2bc3][_0xc9a9('0x77')]][_0xc9a9('0x90')]:_0x1631f7[_0x2e2bc3][_0xc9a9('0x6d')];_0xb51252=_0x1631f7[_0x2e2bc3][_0xc9a9('0x78')]?_[_0xc9a9('0x79')](_0x59b8f0[_0x1631f7[_0x2e2bc3][_0xc9a9('0x78')]],'%s',_0xb51252):_0xb51252;_0xb51252=_0x1631f7[_0x2e2bc3]['format']?_[_0xc9a9('0x79')](_0x4c6fd8[_0x1631f7[_0x2e2bc3][_0xc9a9('0x7a')]],'%s',_0xb51252):_0xb51252;if(_0x1631f7[_0x2e2bc3][_0xc9a9('0x7b')]){_0x52c21f[_0xc9a9('0x6c')](_0xb51252);}_0x1631f7[_0x2e2bc3]['orderBy']&&_0x52c21f[_0xc9a9('0x3b')](_0xb51252,_0x1631f7[_0x2e2bc3][_0xc9a9('0x7c')]===_0xc9a9('0x7d')?![]:!![]);_0x52c21f[_0xc9a9('0x6d')](_0xb51252,_0x1631f7[_0x2e2bc3][_0xc9a9('0x91')]||_0xb51252);}if(_0x40f4d8[_0xc9a9('0x7e')]){_0x40f4d8[_0xc9a9('0x7e')]=JSON[_0xc9a9('0x7f')](_0x40f4d8[_0xc9a9('0x7e')]);for(var _0x33282f=0x0;_0x33282f<_0x40f4d8[_0xc9a9('0x7e')][_0xc9a9('0x49')];_0x33282f+=0x1){if(_0x40f4d8[_0xc9a9('0x7e')][_0x33282f]['type']&&_[_0xc9a9('0x66')](_0x402212,_0x40f4d8[_0xc9a9('0x7e')][_0x33282f]['type'])&&_0x40f4d8[_0xc9a9('0x7e')][_0x33282f][_0xc9a9('0x80')]&&_0x40f4d8['joins'][_0x33282f][_0xc9a9('0x81')]&&_0x40f4d8[_0xc9a9('0x7e')][_0x33282f][_0xc9a9('0x82')]){_0x52c21f[_0x40f4d8['joins'][_0x33282f][_0xc9a9('0x31')]](_0x40f4d8['joins'][_0x33282f][_0xc9a9('0x81')],null,util[_0xc9a9('0x7a')]('%s.%s\x20=\x20%s.%s',_0x40f4d8[_0xc9a9('0x76')],_0x40f4d8[_0xc9a9('0x7e')][_0x33282f]['parentKey'],_0x40f4d8[_0xc9a9('0x7e')][_0x33282f][_0xc9a9('0x81')],_0x40f4d8[_0xc9a9('0x7e')][_0x33282f][_0xc9a9('0x82')]));}}}if(_0x40f4d8[_0xc9a9('0x84')]){_0x40f4d8['conditions']=JSON['parse'](_0x40f4d8[_0xc9a9('0x84')]);_0x52c21f['where'](_0x5b9a3b(_0x40f4d8[_0xc9a9('0x84')][_0xc9a9('0x6c')]));}_0xf07d78=_0x52c21f[_0xc9a9('0x85')]();_0x52c21f['limit'](_0x598607);_0x52c21f[_0xc9a9('0x1f')](0x0);return;}})[_0xc9a9('0x2a')](function(){if(_0x579b43[_0xc9a9('0x92')]===_0xc9a9('0x93')){return null;}var _0x2cecbb=_['merge'](_0x579b43,{'name':_0x579b43['fullPath']||_0x579b43['name']||_0x40f4d8[_0xc9a9('0x2c')],'basename':_0x42ee39,'savename':util['format'](_0xc9a9('0x94'),_0x579b43[_0xc9a9('0x2c')]||_0x40f4d8['name'],require(_0xc9a9('0x95'))[_0xc9a9('0x96')](0x4),_0x579b43[_0xc9a9('0x92')]||_0xc9a9('0x97')),'reportId':_0x40f4d8['id'],'reportType':'default'});return db[_0xc9a9('0x98')][_0xc9a9('0x4a')](_0x2cecbb,{'raw':!![]});})[_0xc9a9('0x2a')](function(_0x1373cf){if(_0x40f4d8[_0xc9a9('0x76')]===_0xc9a9('0x99')){_0xf07d78[_0xc9a9('0x3e')](_0x40f4d8[_0xc9a9('0x76')]+_0xc9a9('0x9a'),_0x579b43[_0xc9a9('0x9b')],_0x579b43['endDate']);}else{_0xf07d78[_0xc9a9('0x3e')](_0x40f4d8[_0xc9a9('0x76')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x579b43[_0xc9a9('0x9b')],_0x579b43['endDate']);}if(_0x1373cf){logger['info'](_0xc9a9('0x9c'),_0xf07d78[_0xc9a9('0x88')]());require(_0xc9a9('0x9d'))[_0xc9a9('0x9e')](path[_0xc9a9('0x57')](__dirname,_0xc9a9('0x9f'),_0x1373cf[_0xc9a9('0x92')]),[_0x1373cf['id'],_0xf07d78['toString'](),path[_0xc9a9('0x57')](__dirname,_0xc9a9('0xa0'),_0x1373cf[_0xc9a9('0xa1')]),_0x42ee39]);return _0x1373cf;}else{var _0x4c6ac3=squel['select']();_0x4c6ac3['from']('('+_0xf07d78[_0xc9a9('0x88')]()+')',_0xc9a9('0xa2'));_0x4c6ac3[_0xc9a9('0x6d')](_0xc9a9('0xa3'),_0xc9a9('0x22'));_0xf07d78['limit'](_0x579b43['limit']||_0x598607);_0xf07d78[_0xc9a9('0x1f')](_0x579b43[_0xc9a9('0x1f')]||0x0);return dbH[_0xc9a9('0x89')]['query'](_0x4c6ac3['toString'](),{'type':dbH['sequelize'][_0xc9a9('0x8a')]['SELECT']})[_0xc9a9('0x2a')](function(_0x14080c){if(!_0x14080c[_0xc9a9('0x49')]){_0x4a6bea=0x0;}else{_0x4a6bea=_0x14080c[0x0]['count']||0x0;}return dbH[_0xc9a9('0x89')][_0xc9a9('0x34')](_0xf07d78[_0xc9a9('0x88')](),{'type':dbH[_0xc9a9('0x89')]['QueryTypes'][_0xc9a9('0xa4')]});})['then'](function(_0x30d04e){return{'rows':_0x30d04e||[],'count':_0x4a6bea};});}});}exports[_0xc9a9('0xa5')]=function(_0x5a2b07,_0x21085d){return runReport(_0x5a2b07[_0xc9a9('0x47')],_0x5a2b07[_0xc9a9('0x34')],_0x5a2b07[_0xc9a9('0x41')])[_0xc9a9('0x2a')](respondWithResult(_0x21085d,null))[_0xc9a9('0x45')](handleError(_0x21085d,null));};exports[_0xc9a9('0xa6')]=runReport;exports['query']=function(_0x2ea97a,_0x2d8dc0){var _0xacd05f=0xa;var _0x356df9=[_0xc9a9('0x57'),'left_join','right_join','cross_join'];var _0x2e30ea={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc9a9('0x5d'),'MAX':_0xc9a9('0x5e'),'MIN':'MIN(%s)','AVG':_0xc9a9('0x8b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc9a9('0x61'),'GROUP_CONCAT DESC':_0xc9a9('0x62')};var _0xa7ec7c={'SEC_TO_TIME':_0xc9a9('0x8c'),'DATE':'DATE(%s)','HOUR':_0xc9a9('0x63'),'ROUND':_0xc9a9('0x64'),'UNIX_TIMESTAMP':_0xc9a9('0x65')};var _0x31caa5=function(_0x80c163){return!_[_0xc9a9('0x66')]([_0xc9a9('0x67'),'IS\x20NOT\x20NULL',_0xc9a9('0x68'),_0xc9a9('0x69')],_0x80c163);};var _0x238c75=function(_0x2cd2de){if(!_0x2cd2de||!_0x2cd2de['rules'][_0xc9a9('0x49')]){return'';}for(var _0x1452b5='(',_0x4aecd8=0x0;_0x4aecd8<_0x2cd2de[_0xc9a9('0x6a')]['length'];_0x4aecd8+=0x1){_0x4aecd8>0x0&&(_0x1452b5+='\x20'+_0x2cd2de['operator']+'\x20');_0x1452b5+=_0x2cd2de['rules'][_0x4aecd8]['group']?_0x238c75(_0x2cd2de['rules'][_0x4aecd8][_0xc9a9('0x6c')]):_0x2cd2de['rules'][_0x4aecd8][_0xc9a9('0x6d')]+'\x20'+_0x2cd2de[_0xc9a9('0x6a')][_0x4aecd8]['condition']+(_0x31caa5(_0x2cd2de[_0xc9a9('0x6a')][_0x4aecd8][_0xc9a9('0x6e')])?'\x20'+_0x2cd2de[_0xc9a9('0x6a')][_0x4aecd8][_0xc9a9('0x8e')]:'');}return _0x1452b5+')';};var _0x2fe30e={'where':{'id':_0x2ea97a['params']['id']}},_0x50c143,_0x1871ab,_0x31c6e2,_0x238c33,_0x383211;_0x2fe30e=_[_0xc9a9('0x40')]({},_0x2fe30e,_0x2ea97a[_0xc9a9('0x41')]);return db['AnalyticDefaultReport'][_0xc9a9('0x51')](_0x2fe30e)[_0xc9a9('0x2a')](function(_0xbc1770){if(_0xbc1770){_0x50c143=_0xbc1770;return _0xbc1770[_0xc9a9('0x6f')]();}return null;})[_0xc9a9('0x2a')](function(_0x4ff1ba){if(_0x4ff1ba){if(!_0x4ff1ba[_0xc9a9('0x49')]){throw new db[(_0xc9a9('0x70'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1871ab=_0x4ff1ba;return db['AnalyticMetric'][_0xc9a9('0x44')]({'raw':!![]});}return null;})['then'](function(_0x53879b){if(_0x53879b){_0x31c6e2=_[_0xc9a9('0x73')](_0x53879b,'id');var _0x512c14;var _0x501f3b=squel[_0xc9a9('0x74')]();_0x501f3b[_0xc9a9('0x75')](_0x50c143[_0xc9a9('0x76')]);for(var _0x1246f2=0x0;_0x1246f2<_0x1871ab[_0xc9a9('0x49')];_0x1246f2+=0x1){_0x512c14=_0x1871ab[_0x1246f2][_0xc9a9('0x77')]?_0x31c6e2[_0x1871ab[_0x1246f2][_0xc9a9('0x77')]][_0xc9a9('0x90')]:_0x1871ab[_0x1246f2][_0xc9a9('0x6d')];_0x512c14=_0x1871ab[_0x1246f2][_0xc9a9('0x78')]?_[_0xc9a9('0x79')](_0x2e30ea[_0x1871ab[_0x1246f2][_0xc9a9('0x78')]],'%s',_0x512c14):_0x512c14;_0x512c14=_0x1871ab[_0x1246f2][_0xc9a9('0x7a')]?_['replace'](_0xa7ec7c[_0x1871ab[_0x1246f2][_0xc9a9('0x7a')]],'%s',_0x512c14):_0x512c14;if(_0x1871ab[_0x1246f2][_0xc9a9('0x7b')]){_0x501f3b[_0xc9a9('0x6c')](_0x512c14);}_0x1871ab[_0x1246f2][_0xc9a9('0x7c')]&&_0x501f3b[_0xc9a9('0x3b')](_0x512c14,_0x1871ab[_0x1246f2][_0xc9a9('0x7c')]===_0xc9a9('0x7d')?![]:!![]);_0x501f3b['field'](_0x512c14,_0x1871ab[_0x1246f2]['alias']||_0x512c14);}if(_0x50c143['joins']){_0x50c143[_0xc9a9('0x7e')]=JSON['parse'](_0x50c143[_0xc9a9('0x7e')]);for(var _0x2a6c4c=0x0;_0x2a6c4c<_0x50c143[_0xc9a9('0x7e')][_0xc9a9('0x49')];_0x2a6c4c+=0x1){if(_0x50c143['joins'][_0x2a6c4c][_0xc9a9('0x31')]&&_[_0xc9a9('0x66')](_0x356df9,_0x50c143[_0xc9a9('0x7e')][_0x2a6c4c]['type'])&&_0x50c143[_0xc9a9('0x7e')][_0x2a6c4c][_0xc9a9('0x80')]&&_0x50c143[_0xc9a9('0x7e')][_0x2a6c4c]['foreignTable']&&_0x50c143[_0xc9a9('0x7e')][_0x2a6c4c][_0xc9a9('0x82')]){_0x501f3b[_0x50c143[_0xc9a9('0x7e')][_0x2a6c4c][_0xc9a9('0x31')]](_0x50c143['joins'][_0x2a6c4c][_0xc9a9('0x81')],null,util[_0xc9a9('0x7a')]('%s.%s\x20=\x20%s.%s',_0x50c143[_0xc9a9('0x76')],_0x50c143[_0xc9a9('0x7e')][_0x2a6c4c][_0xc9a9('0x80')],_0x50c143[_0xc9a9('0x7e')][_0x2a6c4c][_0xc9a9('0x81')],_0x50c143['joins'][_0x2a6c4c][_0xc9a9('0x82')]));}}}if(_0x50c143[_0xc9a9('0x84')]){_0x50c143['conditions']=JSON[_0xc9a9('0x7f')](_0x50c143[_0xc9a9('0x84')]);_0x501f3b['where'](_0x238c75(_0x50c143[_0xc9a9('0x84')]['group']));}_0x383211=_0x501f3b[_0xc9a9('0x85')]();_0x501f3b[_0xc9a9('0x21')](_0xacd05f);_0x501f3b[_0xc9a9('0x1f')](0x0);logger[_0xc9a9('0x86')]('Limited\x20Query:',_0x501f3b[_0xc9a9('0x88')]());return dbH[_0xc9a9('0x89')]['query'](_0x501f3b[_0xc9a9('0x88')](),{'type':dbH[_0xc9a9('0x89')][_0xc9a9('0x8a')][_0xc9a9('0xa4')]});}})[_0xc9a9('0x2a')](function(){return{'sql':_0x383211['toString']()};})[_0xc9a9('0x2a')](respondWithResult(_0x2d8dc0,null))[_0xc9a9('0x45')](handleError(_0x2d8dc0,null));}; \ No newline at end of file +var _0xbd7f=['SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','MetricId','metric','function','replace','format','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','cross_join','COUNT(DISTINCT\x20%s)','includes','AnalyticMetric','groupBy','%s.%s\x20=\x20%s.%s','clone','fullPath','%s-%s.%s','randomstring','generate','output','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','SELECT','run','SEC_TO_TIME(%s)','operator','keyBy','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','DefaultReports','UserProfileResource','then','sendStatus','error','stack','name','send','map','AnalyticDefaultReport','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','right_join'];(function(_0x3a5bd5,_0xd52a42){var _0x3d7e7f=function(_0x50603a){while(--_0x50603a){_0x3a5bd5['push'](_0x3a5bd5['shift']());}};_0x3d7e7f(++_0xd52a42);}(_0xbd7f,0x1a7));var _0xfbd7=function(_0x2041ba,_0x449294){_0x2041ba=_0x2041ba-0x0;var _0x169e20=_0xbd7f[_0x2041ba];return _0x169e20;};'use strict';var emlformat=require(_0xfbd7('0x0'));var rimraf=require(_0xfbd7('0x1'));var zipdir=require(_0xfbd7('0x2'));var jsonpatch=require(_0xfbd7('0x3'));var rp=require(_0xfbd7('0x4'));var moment=require(_0xfbd7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfbd7('0x6'));var util=require(_0xfbd7('0x7'));var path=require(_0xfbd7('0x8'));var sox=require(_0xfbd7('0x9'));var csv=require(_0xfbd7('0xa'));var ejs=require(_0xfbd7('0xb'));var fs=require('fs');var fs_extra=require(_0xfbd7('0xc'));var _=require(_0xfbd7('0xd'));var squel=require(_0xfbd7('0xe'));var crypto=require(_0xfbd7('0xf'));var jsforce=require(_0xfbd7('0x10'));var deskjs=require(_0xfbd7('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfbd7('0x12'));var Redis=require(_0xfbd7('0x13'));var authService=require(_0xfbd7('0x14'));var qs=require(_0xfbd7('0x15'));var as=require(_0xfbd7('0x16'));var hardwareService=require(_0xfbd7('0x17'));var logger=require(_0xfbd7('0x18'))(_0xfbd7('0x19'));var utils=require(_0xfbd7('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfbd7('0x1b'))['db'];var dbH=require(_0xfbd7('0x1b'))[_0xfbd7('0x1c')];function respondWithStatusCode(_0x16486e,_0x3682fc){_0x3682fc=_0x3682fc||0xcc;return function(_0x57f73c){if(_0x57f73c){return _0x16486e['sendStatus'](_0x3682fc);}return _0x16486e[_0xfbd7('0x1d')](_0x3682fc)[_0xfbd7('0x1e')]();};}function respondWithResult(_0xc0e741,_0x327206){_0x327206=_0x327206||0xc8;return function(_0x2ec439){if(_0x2ec439){return _0xc0e741[_0xfbd7('0x1d')](_0x327206)[_0xfbd7('0x1f')](_0x2ec439);}};}function respondWithFilteredResult(_0x277c9f,_0x3e9941){return function(_0x222a60){if(_0x222a60){var _0x3fb1fe=typeof _0x3e9941[_0xfbd7('0x20')]===_0xfbd7('0x21')&&typeof _0x3e9941[_0xfbd7('0x22')]==='undefined';var _0x4926c2=_0x222a60[_0xfbd7('0x23')];var _0x21471f=_0x3fb1fe?0x0:_0x3e9941[_0xfbd7('0x20')];var _0x51052c=_0x3fb1fe?_0x222a60[_0xfbd7('0x23')]:_0x3e9941['offset']+_0x3e9941[_0xfbd7('0x22')];var _0x8d135f;if(_0x51052c>=_0x4926c2){_0x51052c=_0x4926c2;_0x8d135f=0xc8;}else{_0x8d135f=0xce;}_0x277c9f[_0xfbd7('0x1d')](_0x8d135f);return _0x277c9f[_0xfbd7('0x24')](_0xfbd7('0x25'),_0x21471f+'-'+_0x51052c+'/'+_0x4926c2)[_0xfbd7('0x1f')](_0x222a60);}return null;};}function patchUpdates(_0x54e6c6){return function(_0x4ca4c7){try{jsonpatch[_0xfbd7('0x26')](_0x4ca4c7,_0x54e6c6,!![]);}catch(_0x103d8b){return BPromise[_0xfbd7('0x27')](_0x103d8b);}return _0x4ca4c7[_0xfbd7('0x28')]();};}function saveUpdates(_0x4386b8,_0x4ff740){return function(_0x471804){if(_0x471804){return _0x471804[_0xfbd7('0x29')](_0x4386b8)['then'](function(_0x1f5e02){return _0x1f5e02;});}return null;};}function removeEntity(_0x33db45,_0x5418fa){return function(_0x5aafb0){if(_0x5aafb0){return _0x5aafb0[_0xfbd7('0x2a')]()['then'](function(){var _0x2d9e4b=_0x5aafb0[_0xfbd7('0x2b')]({'plain':!![]});var _0x479fdd=_0xfbd7('0x2c');return db[_0xfbd7('0x2d')][_0xfbd7('0x2a')]({'where':{'type':_0x479fdd,'resourceId':_0x2d9e4b['id']}})[_0xfbd7('0x2e')](function(){return _0x5aafb0;});})[_0xfbd7('0x2e')](function(){_0x33db45[_0xfbd7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17be58,_0x57e708){return function(_0x30471c){if(!_0x30471c){_0x17be58[_0xfbd7('0x2f')](0x194);}return _0x30471c;};}function handleError(_0x3210ab,_0x330d51){_0x330d51=_0x330d51||0x1f4;return function(_0x16fdb8){logger[_0xfbd7('0x30')](_0x16fdb8[_0xfbd7('0x31')]);if(_0x16fdb8[_0xfbd7('0x32')]){delete _0x16fdb8[_0xfbd7('0x32')];}_0x3210ab['status'](_0x330d51)[_0xfbd7('0x33')](_0x16fdb8);};}exports['index']=function(_0x4b4761,_0x4529dd){var _0x1f24c9={},_0x37aa67={},_0x1a00b3={'count':0x0,'rows':[]};var _0x4795b6=_[_0xfbd7('0x34')](db[_0xfbd7('0x35')]['rawAttributes'],function(_0x4ff3e3){return{'name':_0x4ff3e3[_0xfbd7('0x36')],'type':_0x4ff3e3['type'][_0xfbd7('0x37')]};});_0x37aa67[_0xfbd7('0x38')]=_['map'](_0x4795b6,_0xfbd7('0x32'));_0x37aa67[_0xfbd7('0x39')]=_[_0xfbd7('0x3a')](_0x4b4761[_0xfbd7('0x39')]);_0x37aa67[_0xfbd7('0x3b')]=_[_0xfbd7('0x3c')](_0x37aa67['model'],_0x37aa67[_0xfbd7('0x39')]);_0x1f24c9[_0xfbd7('0x3d')]=_[_0xfbd7('0x3c')](_0x37aa67['model'],qs['fields'](_0x4b4761[_0xfbd7('0x39')]['fields']));_0x1f24c9['attributes']=_0x1f24c9[_0xfbd7('0x3d')][_0xfbd7('0x3e')]?_0x1f24c9[_0xfbd7('0x3d')]:_0x37aa67['model'];if(!_0x4b4761[_0xfbd7('0x39')][_0xfbd7('0x3f')](_0xfbd7('0x40'))){_0x1f24c9[_0xfbd7('0x22')]=qs[_0xfbd7('0x22')](_0x4b4761[_0xfbd7('0x39')][_0xfbd7('0x22')]);_0x1f24c9[_0xfbd7('0x20')]=qs[_0xfbd7('0x20')](_0x4b4761['query']['offset']);}_0x1f24c9[_0xfbd7('0x41')]=qs[_0xfbd7('0x42')](_0x4b4761[_0xfbd7('0x39')][_0xfbd7('0x42')]);_0x1f24c9[_0xfbd7('0x43')]=qs[_0xfbd7('0x3b')](_[_0xfbd7('0x44')](_0x4b4761[_0xfbd7('0x39')],_0x37aa67['filters']),_0x4795b6);if(_0x4b4761[_0xfbd7('0x39')][_0xfbd7('0x45')]){_0x1f24c9[_0xfbd7('0x43')]=_['merge'](_0x1f24c9['where'],{'$or':_[_0xfbd7('0x34')](_0x4795b6,function(_0x2b39ac){if(_0x2b39ac[_0xfbd7('0x46')]!==_0xfbd7('0x47')){var _0xebb764={};_0xebb764[_0x2b39ac[_0xfbd7('0x32')]]={'$like':'%'+_0x4b4761[_0xfbd7('0x39')][_0xfbd7('0x45')]+'%'};return _0xebb764;}})});}_0x1f24c9=_[_0xfbd7('0x48')]({},_0x1f24c9,_0x4b4761[_0xfbd7('0x49')]);var _0x3c266e={'where':_0x1f24c9[_0xfbd7('0x43')]};return db[_0xfbd7('0x35')]['count'](_0x3c266e)[_0xfbd7('0x2e')](function(_0xb4104d){_0x1a00b3[_0xfbd7('0x23')]=_0xb4104d;if(_0x4b4761[_0xfbd7('0x39')][_0xfbd7('0x4a')]){_0x1f24c9['include']=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0xfbd7('0x4b')](_0x1f24c9);})[_0xfbd7('0x2e')](function(_0x429ba5){_0x1a00b3[_0xfbd7('0x4c')]=_0x429ba5;return _0x1a00b3;})[_0xfbd7('0x2e')](respondWithFilteredResult(_0x4529dd,_0x1f24c9))[_0xfbd7('0x4d')](handleError(_0x4529dd,null));};exports[_0xfbd7('0x4e')]=function(_0x37ddd6,_0x4db891){var _0x586615={'raw':!![],'where':{'id':_0x37ddd6[_0xfbd7('0x4f')]['id']}},_0x3143ec={};_0x3143ec[_0xfbd7('0x38')]=_[_0xfbd7('0x3a')](db[_0xfbd7('0x35')][_0xfbd7('0x50')]);_0x3143ec[_0xfbd7('0x39')]=_[_0xfbd7('0x3a')](_0x37ddd6[_0xfbd7('0x39')]);_0x3143ec[_0xfbd7('0x3b')]=_[_0xfbd7('0x3c')](_0x3143ec[_0xfbd7('0x38')],_0x3143ec['query']);_0x586615[_0xfbd7('0x3d')]=_[_0xfbd7('0x3c')](_0x3143ec[_0xfbd7('0x38')],qs['fields'](_0x37ddd6[_0xfbd7('0x39')]['fields']));_0x586615[_0xfbd7('0x3d')]=_0x586615[_0xfbd7('0x3d')][_0xfbd7('0x3e')]?_0x586615[_0xfbd7('0x3d')]:_0x3143ec['model'];if(_0x37ddd6[_0xfbd7('0x39')][_0xfbd7('0x4a')]){_0x586615[_0xfbd7('0x51')]=[{'all':!![]}];}_0x586615=_['merge']({},_0x586615,_0x37ddd6[_0xfbd7('0x49')]);return db[_0xfbd7('0x35')][_0xfbd7('0x52')](_0x586615)[_0xfbd7('0x2e')](handleEntityNotFound(_0x4db891,null))[_0xfbd7('0x2e')](respondWithResult(_0x4db891,null))[_0xfbd7('0x4d')](handleError(_0x4db891,null));};exports[_0xfbd7('0x53')]=function(_0x30b3e0,_0x18d574){return db[_0xfbd7('0x35')][_0xfbd7('0x53')](_0x30b3e0['body'],{})[_0xfbd7('0x2e')](function(_0x5a4197){var _0x2a120d=_0x30b3e0[_0xfbd7('0x54')][_0xfbd7('0x2b')]({'plain':!![]});if(!_0x2a120d)throw new Error(_0xfbd7('0x55'));if(_0x2a120d[_0xfbd7('0x56')]===_0xfbd7('0x54')){var _0x50739e=_0x5a4197[_0xfbd7('0x2b')]({'plain':!![]});var _0x21dbe7=_0xfbd7('0x57');return db[_0xfbd7('0x58')][_0xfbd7('0x52')]({'where':{'name':_0x21dbe7,'userProfileId':_0x2a120d[_0xfbd7('0x59')]},'raw':!![]})['then'](function(_0x52ad75){if(_0x52ad75&&_0x52ad75[_0xfbd7('0x5a')]===0x0){return db[_0xfbd7('0x2d')]['create']({'name':_0x50739e[_0xfbd7('0x32')],'resourceId':_0x50739e['id'],'type':_0xfbd7('0x2c'),'sectionId':_0x52ad75['id']},{})['then'](function(){return _0x5a4197;});}else{return _0x5a4197;}})[_0xfbd7('0x4d')](function(_0x2fb0d6){logger[_0xfbd7('0x30')](_0xfbd7('0x5b'),_0x2fb0d6);throw _0x2fb0d6;});}return _0x5a4197;})[_0xfbd7('0x2e')](respondWithResult(_0x18d574,0xc9))[_0xfbd7('0x4d')](handleError(_0x18d574,null));};exports[_0xfbd7('0x29')]=function(_0x3f9a3b,_0x2cbf42){if(_0x3f9a3b[_0xfbd7('0x5c')]['id']){delete _0x3f9a3b['body']['id'];}return db[_0xfbd7('0x35')][_0xfbd7('0x52')]({'where':{'id':_0x3f9a3b[_0xfbd7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2cbf42,null))[_0xfbd7('0x2e')](saveUpdates(_0x3f9a3b[_0xfbd7('0x5c')],null))['then'](respondWithResult(_0x2cbf42,null))[_0xfbd7('0x4d')](handleError(_0x2cbf42,null));};exports['destroy']=function(_0x53322d,_0x5ef480){return db[_0xfbd7('0x35')]['find']({'where':{'id':_0x53322d[_0xfbd7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5ef480,null))[_0xfbd7('0x2e')](removeEntity(_0x5ef480,null))[_0xfbd7('0x4d')](handleError(_0x5ef480,null));};exports['preview']=function(_0x2a6c77,_0x3d301b){var _0x9c473b=0xa;var _0x9e0cea=[_0xfbd7('0x5d'),_0xfbd7('0x5e'),_0xfbd7('0x5f'),'cross_join'];var _0x4f446c={'SUM':_0xfbd7('0x60'),'COUNT':_0xfbd7('0x61'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfbd7('0x62'),'MIN':_0xfbd7('0x63'),'AVG':_0xfbd7('0x64'),'GROUP_CONCAT':_0xfbd7('0x65'),'GROUP_CONCAT ASC':_0xfbd7('0x66'),'GROUP_CONCAT DESC':_0xfbd7('0x67')};var _0x3fd6c4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfbd7('0x68'),'HOUR':_0xfbd7('0x69'),'ROUND':_0xfbd7('0x6a'),'UNIX_TIMESTAMP':_0xfbd7('0x6b')};var _0x2e576f=function(_0x268faa){return!_['includes']([_0xfbd7('0x6c'),_0xfbd7('0x6d'),_0xfbd7('0x6e'),_0xfbd7('0x6f')],_0x268faa);};var _0x15ed60=function(_0x5f2be1){if(!_0x5f2be1||!_0x5f2be1[_0xfbd7('0x70')][_0xfbd7('0x3e')]){return'';}for(var _0xcec721='(',_0x5106fd=0x0;_0x5106fd<_0x5f2be1[_0xfbd7('0x70')]['length'];_0x5106fd+=0x1){_0x5106fd>0x0&&(_0xcec721+='\x20'+_0x5f2be1['operator']+'\x20');_0xcec721+=_0x5f2be1[_0xfbd7('0x70')][_0x5106fd][_0xfbd7('0x71')]?_0x15ed60(_0x5f2be1[_0xfbd7('0x70')][_0x5106fd][_0xfbd7('0x71')]):_0x5f2be1[_0xfbd7('0x70')][_0x5106fd][_0xfbd7('0x72')]+'\x20'+_0x5f2be1[_0xfbd7('0x70')][_0x5106fd][_0xfbd7('0x73')]+(_0x2e576f(_0x5f2be1[_0xfbd7('0x70')][_0x5106fd][_0xfbd7('0x73')])?'\x20'+_0x5f2be1[_0xfbd7('0x70')][_0x5106fd][_0xfbd7('0x74')]:'');}return _0xcec721+')';};var _0x4cabbc={'where':{'id':_0x2a6c77[_0xfbd7('0x4f')]['id']}},_0xccf496,_0x3a62b7,_0x11388d,_0xc9e1bb,_0x5b5175;_0x4cabbc=_['merge']({},_0x4cabbc,_0x2a6c77[_0xfbd7('0x49')]);return db[_0xfbd7('0x35')][_0xfbd7('0x52')](_0x4cabbc)['then'](function(_0x3fa8be){if(_0x3fa8be){_0xccf496=_0x3fa8be;return _0x3fa8be[_0xfbd7('0x75')]();}return null;})['then'](function(_0x1256ee){if(_0x1256ee){if(!_0x1256ee[_0xfbd7('0x3e')]){throw new db[(_0xfbd7('0x76'))][(_0xfbd7('0x77'))](_0xfbd7('0x78'),0x193);}_0x3a62b7=_0x1256ee;return db['AnalyticMetric'][_0xfbd7('0x4b')]({'raw':!![]});}return null;})[_0xfbd7('0x2e')](function(_0x316bc3){if(_0x316bc3){_0x11388d=_['keyBy'](_0x316bc3,'id');var _0x29c3b4;var _0x22cddb=squel[_0xfbd7('0x79')]();_0x22cddb[_0xfbd7('0x7a')](_0xccf496[_0xfbd7('0x7b')]);for(var _0x3cea8d=0x0;_0x3cea8d<_0x3a62b7[_0xfbd7('0x3e')];_0x3cea8d+=0x1){_0x29c3b4=_0x3a62b7[_0x3cea8d]['MetricId']?_0x11388d[_0x3a62b7[_0x3cea8d][_0xfbd7('0x7c')]][_0xfbd7('0x7d')]:_0x3a62b7[_0x3cea8d][_0xfbd7('0x72')];_0x29c3b4=_0x3a62b7[_0x3cea8d][_0xfbd7('0x7e')]?_['replace'](_0x4f446c[_0x3a62b7[_0x3cea8d]['function']],'%s',_0x29c3b4):_0x29c3b4;_0x29c3b4=_0x3a62b7[_0x3cea8d]['format']?_[_0xfbd7('0x7f')](_0x3fd6c4[_0x3a62b7[_0x3cea8d][_0xfbd7('0x80')]],'%s',_0x29c3b4):_0x29c3b4;if(_0x3a62b7[_0x3cea8d]['groupBy']){_0x22cddb[_0xfbd7('0x71')](_0x29c3b4);}_0x3a62b7[_0x3cea8d]['orderBy']&&_0x22cddb['order'](_0x29c3b4,_0x3a62b7[_0x3cea8d][_0xfbd7('0x81')]==='DESC'?![]:!![]);_0x22cddb[_0xfbd7('0x72')](_0x29c3b4,_0x3a62b7[_0x3cea8d][_0xfbd7('0x82')]||_0x29c3b4);}if(_0xccf496['joins']){_0xccf496[_0xfbd7('0x83')]=JSON[_0xfbd7('0x84')](_0xccf496[_0xfbd7('0x83')]);for(var _0x81290f=0x0;_0x81290f<_0xccf496[_0xfbd7('0x83')][_0xfbd7('0x3e')];_0x81290f+=0x1){if(_0xccf496[_0xfbd7('0x83')][_0x81290f]['type']&&_['includes'](_0x9e0cea,_0xccf496[_0xfbd7('0x83')][_0x81290f][_0xfbd7('0x46')])&&_0xccf496[_0xfbd7('0x83')][_0x81290f][_0xfbd7('0x85')]&&_0xccf496['joins'][_0x81290f][_0xfbd7('0x86')]&&_0xccf496[_0xfbd7('0x83')][_0x81290f][_0xfbd7('0x87')]){_0x22cddb[_0xccf496[_0xfbd7('0x83')][_0x81290f][_0xfbd7('0x46')]](_0xccf496['joins'][_0x81290f][_0xfbd7('0x86')],null,util[_0xfbd7('0x80')]('%s.%s\x20=\x20%s.%s',_0xccf496['table'],_0xccf496[_0xfbd7('0x83')][_0x81290f][_0xfbd7('0x85')],_0xccf496[_0xfbd7('0x83')][_0x81290f]['foreignTable'],_0xccf496['joins'][_0x81290f][_0xfbd7('0x87')]));}}}if(_0xccf496['conditions']){_0xccf496[_0xfbd7('0x88')]=JSON[_0xfbd7('0x84')](_0xccf496[_0xfbd7('0x88')]);_0x22cddb[_0xfbd7('0x43')](_0x15ed60(_0xccf496[_0xfbd7('0x88')]['group']));}_0x5b5175=_0x22cddb['clone']();_0x22cddb['limit'](_0x9c473b);_0x22cddb[_0xfbd7('0x20')](0x0);logger[_0xfbd7('0x89')](_0xfbd7('0x8a'),_0x22cddb[_0xfbd7('0x8b')]());return dbH[_0xfbd7('0x8c')]['query'](_0x22cddb['toString'](),{'type':dbH[_0xfbd7('0x8c')][_0xfbd7('0x8d')]['SELECT']});}})[_0xfbd7('0x2e')](respondWithResult(_0x3d301b,null))[_0xfbd7('0x4d')](handleError(_0x3d301b,null));};function runReport(_0x459dbb,_0x283e63,_0x36cbf8){var _0x29bdb3=_0x283e63[_0xfbd7('0x32')];var _0x2474e2=0xa;var _0x16cfff=[_0xfbd7('0x5d'),'left_join',_0xfbd7('0x5f'),_0xfbd7('0x8e')];var _0x251b66={'SUM':_0xfbd7('0x60'),'COUNT':_0xfbd7('0x61'),'COUNT DISTINCT':_0xfbd7('0x8f'),'MAX':'MAX(%s)','MIN':_0xfbd7('0x63'),'AVG':_0xfbd7('0x64'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfbd7('0x66'),'GROUP_CONCAT DESC':_0xfbd7('0x67')};var _0x1cdaa0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xfbd7('0x69'),'ROUND':_0xfbd7('0x6a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x8c89f2=function(_0x51a086){return!_[_0xfbd7('0x90')]([_0xfbd7('0x6c'),_0xfbd7('0x6d'),_0xfbd7('0x6e'),_0xfbd7('0x6f')],_0x51a086);};var _0x343061=function(_0x2aca90){if(!_0x2aca90||!_0x2aca90[_0xfbd7('0x70')][_0xfbd7('0x3e')]){return'';}for(var _0x18c341='(',_0x1cf8bc=0x0;_0x1cf8bc<_0x2aca90['rules'][_0xfbd7('0x3e')];_0x1cf8bc+=0x1){_0x1cf8bc>0x0&&(_0x18c341+='\x20'+_0x2aca90['operator']+'\x20');_0x18c341+=_0x2aca90[_0xfbd7('0x70')][_0x1cf8bc][_0xfbd7('0x71')]?_0x343061(_0x2aca90[_0xfbd7('0x70')][_0x1cf8bc]['group']):_0x2aca90[_0xfbd7('0x70')][_0x1cf8bc][_0xfbd7('0x72')]+'\x20'+_0x2aca90[_0xfbd7('0x70')][_0x1cf8bc]['condition']+(_0x8c89f2(_0x2aca90[_0xfbd7('0x70')][_0x1cf8bc]['condition'])?'\x20'+_0x2aca90[_0xfbd7('0x70')][_0x1cf8bc][_0xfbd7('0x74')]:'');}return _0x18c341+')';};var _0x121d28={'where':{'id':_0x459dbb['id']}},_0x2c592e,_0x1edc0c,_0x19affe,_0xc6ba85,_0x4be463;_0x121d28=_['merge']({},_0x121d28,_0x36cbf8);return db['AnalyticDefaultReport'][_0xfbd7('0x52')](_0x121d28)['then'](function(_0x67b7f){if(_0x67b7f){_0x2c592e=_0x67b7f;return _0x67b7f[_0xfbd7('0x75')]();}return null;})[_0xfbd7('0x2e')](function(_0x20b3ae){if(_0x20b3ae){if(!_0x20b3ae[_0xfbd7('0x3e')]){throw new db['Sequelize'][(_0xfbd7('0x77'))](_0xfbd7('0x78'),0x193);}_0x1edc0c=_0x20b3ae;return db[_0xfbd7('0x91')][_0xfbd7('0x4b')]({'raw':!![]});}return null;})['then'](function(_0x58cac2){if(_0x58cac2){_0x19affe=_['keyBy'](_0x58cac2,'id');var _0x54897a;var _0x563a0f=squel['select']();_0x563a0f[_0xfbd7('0x7a')](_0x2c592e[_0xfbd7('0x7b')]);for(var _0x1e89e3=0x0;_0x1e89e3<_0x1edc0c['length'];_0x1e89e3+=0x1){_0x54897a=_0x1edc0c[_0x1e89e3][_0xfbd7('0x7c')]?_0x19affe[_0x1edc0c[_0x1e89e3][_0xfbd7('0x7c')]][_0xfbd7('0x7d')]:_0x1edc0c[_0x1e89e3][_0xfbd7('0x72')];_0x54897a=_0x1edc0c[_0x1e89e3][_0xfbd7('0x7e')]?_[_0xfbd7('0x7f')](_0x251b66[_0x1edc0c[_0x1e89e3]['function']],'%s',_0x54897a):_0x54897a;_0x54897a=_0x1edc0c[_0x1e89e3][_0xfbd7('0x80')]?_[_0xfbd7('0x7f')](_0x1cdaa0[_0x1edc0c[_0x1e89e3][_0xfbd7('0x80')]],'%s',_0x54897a):_0x54897a;if(_0x1edc0c[_0x1e89e3][_0xfbd7('0x92')]){_0x563a0f[_0xfbd7('0x71')](_0x54897a);}_0x1edc0c[_0x1e89e3]['orderBy']&&_0x563a0f[_0xfbd7('0x41')](_0x54897a,_0x1edc0c[_0x1e89e3][_0xfbd7('0x81')]==='DESC'?![]:!![]);_0x563a0f[_0xfbd7('0x72')](_0x54897a,_0x1edc0c[_0x1e89e3][_0xfbd7('0x82')]||_0x54897a);}if(_0x2c592e[_0xfbd7('0x83')]){_0x2c592e[_0xfbd7('0x83')]=JSON[_0xfbd7('0x84')](_0x2c592e[_0xfbd7('0x83')]);for(var _0x5260cb=0x0;_0x5260cb<_0x2c592e['joins']['length'];_0x5260cb+=0x1){if(_0x2c592e[_0xfbd7('0x83')][_0x5260cb][_0xfbd7('0x46')]&&_[_0xfbd7('0x90')](_0x16cfff,_0x2c592e[_0xfbd7('0x83')][_0x5260cb]['type'])&&_0x2c592e['joins'][_0x5260cb][_0xfbd7('0x85')]&&_0x2c592e[_0xfbd7('0x83')][_0x5260cb]['foreignTable']&&_0x2c592e[_0xfbd7('0x83')][_0x5260cb][_0xfbd7('0x87')]){_0x563a0f[_0x2c592e[_0xfbd7('0x83')][_0x5260cb]['type']](_0x2c592e['joins'][_0x5260cb][_0xfbd7('0x86')],null,util[_0xfbd7('0x80')](_0xfbd7('0x93'),_0x2c592e[_0xfbd7('0x7b')],_0x2c592e[_0xfbd7('0x83')][_0x5260cb][_0xfbd7('0x85')],_0x2c592e[_0xfbd7('0x83')][_0x5260cb][_0xfbd7('0x86')],_0x2c592e['joins'][_0x5260cb][_0xfbd7('0x87')]));}}}if(_0x2c592e[_0xfbd7('0x88')]){_0x2c592e['conditions']=JSON[_0xfbd7('0x84')](_0x2c592e[_0xfbd7('0x88')]);_0x563a0f[_0xfbd7('0x43')](_0x343061(_0x2c592e[_0xfbd7('0x88')][_0xfbd7('0x71')]));}_0x4be463=_0x563a0f[_0xfbd7('0x94')]();_0x563a0f[_0xfbd7('0x22')](_0x2474e2);_0x563a0f[_0xfbd7('0x20')](0x0);return;}})['then'](function(){if(_0x283e63['output']==='web'){return null;}var _0xf033b5=_[_0xfbd7('0x48')](_0x283e63,{'name':_0x283e63[_0xfbd7('0x95')]||_0x283e63['name']||_0x2c592e['name'],'basename':_0x29bdb3,'savename':util[_0xfbd7('0x80')](_0xfbd7('0x96'),_0x283e63['name']||_0x2c592e[_0xfbd7('0x32')],require(_0xfbd7('0x97'))[_0xfbd7('0x98')](0x4),_0x283e63[_0xfbd7('0x99')]||'csv'),'reportId':_0x2c592e['id'],'reportType':_0xfbd7('0x9a')});return db['AnalyticExtractedReport'][_0xfbd7('0x53')](_0xf033b5,{'raw':!![]});})[_0xfbd7('0x2e')](function(_0xf5394){if(_0x2c592e[_0xfbd7('0x7b')]===_0xfbd7('0x9b')){_0x4be463[_0xfbd7('0x43')](_0x2c592e[_0xfbd7('0x7b')]+_0xfbd7('0x9c'),_0x283e63['startDate'],_0x283e63[_0xfbd7('0x9d')]);}else{_0x4be463[_0xfbd7('0x43')](_0x2c592e[_0xfbd7('0x7b')]+_0xfbd7('0x9e'),_0x283e63[_0xfbd7('0x9f')],_0x283e63[_0xfbd7('0x9d')]);}if(_0xf5394){logger['info'](_0xfbd7('0xa0'),_0x4be463[_0xfbd7('0x8b')]());require(_0xfbd7('0xa1'))[_0xfbd7('0xa2')](path[_0xfbd7('0x5d')](__dirname,_0xfbd7('0xa3'),_0xf5394[_0xfbd7('0x99')]),[_0xf5394['id'],_0x4be463[_0xfbd7('0x8b')](),path[_0xfbd7('0x5d')](__dirname,'../../files/reports',_0xf5394[_0xfbd7('0xa4')]),_0x29bdb3]);return _0xf5394;}else{var _0x23f61d=squel[_0xfbd7('0x79')]();_0x23f61d[_0xfbd7('0x7a')]('('+_0x4be463[_0xfbd7('0x8b')]()+')',_0xfbd7('0xa5'));_0x23f61d[_0xfbd7('0x72')](_0xfbd7('0xa6'),_0xfbd7('0x23'));_0x4be463[_0xfbd7('0x22')](_0x283e63[_0xfbd7('0x22')]||_0x2474e2);_0x4be463[_0xfbd7('0x20')](_0x283e63['offset']||0x0);return dbH[_0xfbd7('0x8c')][_0xfbd7('0x39')](_0x23f61d[_0xfbd7('0x8b')](),{'type':dbH[_0xfbd7('0x8c')][_0xfbd7('0x8d')][_0xfbd7('0xa7')]})[_0xfbd7('0x2e')](function(_0x155a5c){if(!_0x155a5c[_0xfbd7('0x3e')]){_0xc6ba85=0x0;}else{_0xc6ba85=_0x155a5c[0x0]['count']||0x0;}return dbH[_0xfbd7('0x8c')][_0xfbd7('0x39')](_0x4be463[_0xfbd7('0x8b')](),{'type':dbH[_0xfbd7('0x8c')]['QueryTypes'][_0xfbd7('0xa7')]});})[_0xfbd7('0x2e')](function(_0x4d271b){return{'rows':_0x4d271b||[],'count':_0xc6ba85};});}});}exports[_0xfbd7('0xa8')]=function(_0x13b7c3,_0x4ae5ca){return runReport(_0x13b7c3[_0xfbd7('0x4f')],_0x13b7c3[_0xfbd7('0x39')],_0x13b7c3['options'])[_0xfbd7('0x2e')](respondWithResult(_0x4ae5ca,null))[_0xfbd7('0x4d')](handleError(_0x4ae5ca,null));};exports['runReport']=runReport;exports['query']=function(_0x52b29c,_0x36eb59){var _0x201946=0xa;var _0x3ba007=[_0xfbd7('0x5d'),_0xfbd7('0x5e'),_0xfbd7('0x5f'),_0xfbd7('0x8e')];var _0x1e97a4={'SUM':_0xfbd7('0x60'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfbd7('0x8f'),'MAX':_0xfbd7('0x62'),'MIN':'MIN(%s)','AVG':_0xfbd7('0x64'),'GROUP_CONCAT':_0xfbd7('0x65'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfbd7('0x67')};var _0x2363d2={'SEC_TO_TIME':_0xfbd7('0xa9'),'DATE':_0xfbd7('0x68'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4cffaf=function(_0x2d830c){return!_['includes']([_0xfbd7('0x6c'),_0xfbd7('0x6d'),_0xfbd7('0x6e'),'IS\x20NOT\x20EMPTY'],_0x2d830c);};var _0x5958be=function(_0x44d264){if(!_0x44d264||!_0x44d264['rules'][_0xfbd7('0x3e')]){return'';}for(var _0x416d86='(',_0x652ee6=0x0;_0x652ee6<_0x44d264[_0xfbd7('0x70')][_0xfbd7('0x3e')];_0x652ee6+=0x1){_0x652ee6>0x0&&(_0x416d86+='\x20'+_0x44d264[_0xfbd7('0xaa')]+'\x20');_0x416d86+=_0x44d264[_0xfbd7('0x70')][_0x652ee6][_0xfbd7('0x71')]?_0x5958be(_0x44d264[_0xfbd7('0x70')][_0x652ee6]['group']):_0x44d264[_0xfbd7('0x70')][_0x652ee6][_0xfbd7('0x72')]+'\x20'+_0x44d264[_0xfbd7('0x70')][_0x652ee6][_0xfbd7('0x73')]+(_0x4cffaf(_0x44d264[_0xfbd7('0x70')][_0x652ee6][_0xfbd7('0x73')])?'\x20'+_0x44d264[_0xfbd7('0x70')][_0x652ee6][_0xfbd7('0x74')]:'');}return _0x416d86+')';};var _0x1e334f={'where':{'id':_0x52b29c[_0xfbd7('0x4f')]['id']}},_0x506c3e,_0x28db38,_0x345ea5,_0x2b717c,_0x338de4;_0x1e334f=_[_0xfbd7('0x48')]({},_0x1e334f,_0x52b29c[_0xfbd7('0x49')]);return db['AnalyticDefaultReport']['find'](_0x1e334f)[_0xfbd7('0x2e')](function(_0x28d0b3){if(_0x28d0b3){_0x506c3e=_0x28d0b3;return _0x28d0b3[_0xfbd7('0x75')]();}return null;})[_0xfbd7('0x2e')](function(_0x222e9c){if(_0x222e9c){if(!_0x222e9c[_0xfbd7('0x3e')]){throw new db[(_0xfbd7('0x76'))]['ValidationErrorItem'](_0xfbd7('0x78'),0x193);}_0x28db38=_0x222e9c;return db[_0xfbd7('0x91')][_0xfbd7('0x4b')]({'raw':!![]});}return null;})[_0xfbd7('0x2e')](function(_0x1bb907){if(_0x1bb907){_0x345ea5=_[_0xfbd7('0xab')](_0x1bb907,'id');var _0x21d603;var _0x1167d5=squel[_0xfbd7('0x79')]();_0x1167d5[_0xfbd7('0x7a')](_0x506c3e['table']);for(var _0x19ffe9=0x0;_0x19ffe9<_0x28db38['length'];_0x19ffe9+=0x1){_0x21d603=_0x28db38[_0x19ffe9][_0xfbd7('0x7c')]?_0x345ea5[_0x28db38[_0x19ffe9][_0xfbd7('0x7c')]]['metric']:_0x28db38[_0x19ffe9][_0xfbd7('0x72')];_0x21d603=_0x28db38[_0x19ffe9][_0xfbd7('0x7e')]?_[_0xfbd7('0x7f')](_0x1e97a4[_0x28db38[_0x19ffe9][_0xfbd7('0x7e')]],'%s',_0x21d603):_0x21d603;_0x21d603=_0x28db38[_0x19ffe9][_0xfbd7('0x80')]?_[_0xfbd7('0x7f')](_0x2363d2[_0x28db38[_0x19ffe9][_0xfbd7('0x80')]],'%s',_0x21d603):_0x21d603;if(_0x28db38[_0x19ffe9][_0xfbd7('0x92')]){_0x1167d5[_0xfbd7('0x71')](_0x21d603);}_0x28db38[_0x19ffe9][_0xfbd7('0x81')]&&_0x1167d5[_0xfbd7('0x41')](_0x21d603,_0x28db38[_0x19ffe9][_0xfbd7('0x81')]===_0xfbd7('0xac')?![]:!![]);_0x1167d5[_0xfbd7('0x72')](_0x21d603,_0x28db38[_0x19ffe9][_0xfbd7('0x82')]||_0x21d603);}if(_0x506c3e['joins']){_0x506c3e[_0xfbd7('0x83')]=JSON[_0xfbd7('0x84')](_0x506c3e[_0xfbd7('0x83')]);for(var _0xe64b9f=0x0;_0xe64b9f<_0x506c3e[_0xfbd7('0x83')][_0xfbd7('0x3e')];_0xe64b9f+=0x1){if(_0x506c3e[_0xfbd7('0x83')][_0xe64b9f]['type']&&_[_0xfbd7('0x90')](_0x3ba007,_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x46')])&&_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x85')]&&_0x506c3e['joins'][_0xe64b9f][_0xfbd7('0x86')]&&_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x87')]){_0x1167d5[_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x46')]](_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x86')],null,util[_0xfbd7('0x80')](_0xfbd7('0x93'),_0x506c3e['table'],_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x85')],_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x86')],_0x506c3e['joins'][_0xe64b9f][_0xfbd7('0x87')]));}}}if(_0x506c3e['conditions']){_0x506c3e[_0xfbd7('0x88')]=JSON[_0xfbd7('0x84')](_0x506c3e[_0xfbd7('0x88')]);_0x1167d5[_0xfbd7('0x43')](_0x5958be(_0x506c3e[_0xfbd7('0x88')][_0xfbd7('0x71')]));}_0x338de4=_0x1167d5[_0xfbd7('0x94')]();_0x1167d5[_0xfbd7('0x22')](_0x201946);_0x1167d5['offset'](0x0);logger[_0xfbd7('0x89')](_0xfbd7('0x8a'),_0x1167d5['toString']());return dbH['sequelize']['query'](_0x1167d5['toString'](),{'type':dbH[_0xfbd7('0x8c')]['QueryTypes'][_0xfbd7('0xa7')]});}})[_0xfbd7('0x2e')](function(){return{'sql':_0x338de4[_0xfbd7('0x8b')]()};})[_0xfbd7('0x2e')](respondWithResult(_0x36eb59,null))['catch'](handleError(_0x36eb59,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index ce4eb70..17cadc1 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 _0x2d88=['bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment'];(function(_0x1cd762,_0x2ede25){var _0x53c2ef=function(_0x431c7a){while(--_0x431c7a){_0x1cd762['push'](_0x1cd762['shift']());}};_0x53c2ef(++_0x2ede25);}(_0x2d88,0x127));var _0x82d8=function(_0x5bd040,_0x39e437){_0x5bd040=_0x5bd040-0x0;var _0x49c4d5=_0x2d88[_0x5bd040];return _0x49c4d5;};'use strict';var _=require(_0x82d8('0x0'));var util=require(_0x82d8('0x1'));var logger=require('../../config/logger')(_0x82d8('0x2'));var moment=require(_0x82d8('0x3'));var BPromise=require(_0x82d8('0x4'));var rp=require(_0x82d8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82d8('0x6'));var config=require(_0x82d8('0x7'));var attributes=require(_0x82d8('0x8'));module[_0x82d8('0x9')]=function(_0x56e158,_0x292801){return _0x56e158[_0x82d8('0xa')](_0x82d8('0xb'),attributes,{'tableName':_0x82d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34ab=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x11c331,_0x523ccf){var _0x1b89e1=function(_0x33d7b6){while(--_0x33d7b6){_0x11c331['push'](_0x11c331['shift']());}};_0x1b89e1(++_0x523ccf);}(_0x34ab,0xf1));var _0xb34a=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x34ab[_0xda464c];return _0x19e222;};'use strict';var _=require(_0xb34a('0x0'));var util=require(_0xb34a('0x1'));var logger=require(_0xb34a('0x2'))(_0xb34a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb34a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb34a('0x5'));var config=require(_0xb34a('0x6'));var attributes=require(_0xb34a('0x7'));module['exports']=function(_0x6e669,_0x1f6df3){return _0x6e669[_0xb34a('0x8')](_0xb34a('0x9'),attributes,{'tableName':_0xb34a('0xa'),'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 78c4327..b1a7aaa 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 _0xd52d=['jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x43fd38,_0x226b81){var _0x4cb7bd=function(_0x320be6){while(--_0x320be6){_0x43fd38['push'](_0x43fd38['shift']());}};_0x4cb7bd(++_0x226b81);}(_0xd52d,0x1c7));var _0xdd52=function(_0x14ee73,_0x2f0b8d){_0x14ee73=_0x14ee73-0x0;var _0x108140=_0xd52d[_0x14ee73];return _0x108140;};'use strict';var _=require('lodash');var util=require(_0xdd52('0x0'));var moment=require(_0xdd52('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd52('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdd52('0x3'));var logger=require(_0xdd52('0x4'))(_0xdd52('0x5'));var config=require(_0xdd52('0x6'));var jayson=require(_0xdd52('0x7'));var client=jayson[_0xdd52('0x8')][_0xdd52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18d01d,_0x4ca1a2,_0x1b8b74){return new BPromise(function(_0x6ab1e3,_0x8a6170){return client[_0xdd52('0xa')](_0x18d01d,_0x1b8b74)[_0xdd52('0xb')](function(_0xb6616a){logger[_0xdd52('0xc')](_0xdd52('0xd'),_0x4ca1a2,_0xdd52('0xe'));logger[_0xdd52('0xf')](_0xdd52('0x10'),_0x4ca1a2,_0xdd52('0xe'),JSON[_0xdd52('0x11')](_0xb6616a));if(_0xb6616a['error']){if(_0xb6616a[_0xdd52('0x12')][_0xdd52('0x13')]===0x1f4){logger[_0xdd52('0x12')](_0xdd52('0xd'),_0x4ca1a2,_0xb6616a[_0xdd52('0x12')][_0xdd52('0x14')]);return _0x8a6170(_0xb6616a['error'][_0xdd52('0x14')]);}logger[_0xdd52('0x12')](_0xdd52('0xd'),_0x4ca1a2,_0xb6616a['error'][_0xdd52('0x14')]);return _0x6ab1e3(_0xb6616a[_0xdd52('0x12')][_0xdd52('0x14')]);}else{logger[_0xdd52('0xc')](_0xdd52('0xd'),_0x4ca1a2,_0xdd52('0xe'));_0x6ab1e3(_0xb6616a[_0xdd52('0x15')][_0xdd52('0x14')]);}})['catch'](function(_0x468c7a){logger['error'](_0xdd52('0xd'),_0x4ca1a2,_0x468c7a);_0x8a6170(_0x468c7a);});});} \ No newline at end of file +var _0x195e=['info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x131be9,_0x5c8e73){var _0x4ed332=function(_0x179b05){while(--_0x179b05){_0x131be9['push'](_0x131be9['shift']());}};_0x4ed332(++_0x5c8e73);}(_0x195e,0xfb));var _0xe195=function(_0x30361e,_0x2c6205){_0x30361e=_0x30361e-0x0;var _0x35be38=_0x195e[_0x30361e];return _0x35be38;};'use strict';var _=require(_0xe195('0x0'));var util=require(_0xe195('0x1'));var moment=require(_0xe195('0x2'));var BPromise=require(_0xe195('0x3'));var rs=require(_0xe195('0x4'));var fs=require('fs');var Redis=require(_0xe195('0x5'));var db=require(_0xe195('0x6'))['db'];var utils=require(_0xe195('0x7'));var logger=require(_0xe195('0x8'))(_0xe195('0x9'));var config=require(_0xe195('0xa'));var jayson=require(_0xe195('0xb'));var client=jayson[_0xe195('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a1acc,_0x663106,_0x2ead59){return new BPromise(function(_0x28c1a9,_0x3164c3){return client['request'](_0x2a1acc,_0x2ead59)['then'](function(_0x5f333b){logger[_0xe195('0xd')](_0xe195('0xe'),_0x663106,_0xe195('0xf'));logger[_0xe195('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x663106,_0xe195('0xf'),JSON[_0xe195('0x11')](_0x5f333b));if(_0x5f333b[_0xe195('0x12')]){if(_0x5f333b['error'][_0xe195('0x13')]===0x1f4){logger[_0xe195('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x663106,_0x5f333b[_0xe195('0x12')][_0xe195('0x14')]);return _0x3164c3(_0x5f333b[_0xe195('0x12')][_0xe195('0x14')]);}logger['error'](_0xe195('0xe'),_0x663106,_0x5f333b[_0xe195('0x12')]['message']);return _0x28c1a9(_0x5f333b['error'][_0xe195('0x14')]);}else{logger['info'](_0xe195('0xe'),_0x663106,'request\x20sent');_0x28c1a9(_0x5f333b['result'][_0xe195('0x14')]);}})[_0xe195('0x15')](function(_0x277362){logger[_0xe195('0x12')](_0xe195('0xe'),_0x663106,_0x277362);_0x3164c3(_0x277362);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 2ee0c16..ea9c30b 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 _0x6692=['show','/:id/preview','preview','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','/:id'];(function(_0x265ae0,_0x3e3ac5){var _0x554876=function(_0xae2dc6){while(--_0xae2dc6){_0x265ae0['push'](_0x265ae0['shift']());}};_0x554876(++_0x3e3ac5);}(_0x6692,0x198));var _0x2669=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0x6692[_0xf48cce];return _0x2a5c38;};'use strict';var multer=require(_0x2669('0x0'));var util=require(_0x2669('0x1'));var path=require(_0x2669('0x2'));var timeout=require(_0x2669('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2669('0x4'));var interaction=require(_0x2669('0x5'));var config=require('../../config/environment');var controller=require(_0x2669('0x6'));router[_0x2669('0x7')]('/',auth[_0x2669('0x8')](),controller['index']);router['get'](_0x2669('0x9'),auth[_0x2669('0x8')](),controller[_0x2669('0xa')]);router[_0x2669('0x7')](_0x2669('0xb'),auth[_0x2669('0x8')](),controller[_0x2669('0xc')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x2669('0xd')]);router[_0x2669('0x7')](_0x2669('0xe'),auth[_0x2669('0x8')](),controller[_0x2669('0xf')]);router['post']('/',auth[_0x2669('0x8')](),controller[_0x2669('0x10')]);router[_0x2669('0x11')](_0x2669('0x9'),auth[_0x2669('0x8')](),controller[_0x2669('0x12')]);router[_0x2669('0x13')](_0x2669('0x9'),auth[_0x2669('0x8')](),controller[_0x2669('0x14')]);module[_0x2669('0x15')]=router; \ No newline at end of file +var _0xcc4f=['get','isAuthenticated','index','/:id/preview','preview','run','/:id/query','query','put','update','delete','/:id','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x4e6444,_0x11cd1d){var _0x4cb105=function(_0x1b3778){while(--_0x1b3778){_0x4e6444['push'](_0x4e6444['shift']());}};_0x4cb105(++_0x11cd1d);}(_0xcc4f,0x90));var _0xfcc4=function(_0x7d8b5e,_0x6a7253){_0x7d8b5e=_0x7d8b5e-0x0;var _0x40c789=_0xcc4f[_0x7d8b5e];return _0x40c789;};'use strict';var multer=require(_0xfcc4('0x0'));var util=require(_0xfcc4('0x1'));var path=require(_0xfcc4('0x2'));var timeout=require(_0xfcc4('0x3'));var express=require(_0xfcc4('0x4'));var router=express[_0xfcc4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfcc4('0x6'));var interaction=require(_0xfcc4('0x7'));var config=require(_0xfcc4('0x8'));var controller=require(_0xfcc4('0x9'));router[_0xfcc4('0xa')]('/',auth[_0xfcc4('0xb')](),controller[_0xfcc4('0xc')]);router[_0xfcc4('0xa')]('/:id',auth[_0xfcc4('0xb')](),controller['show']);router[_0xfcc4('0xa')](_0xfcc4('0xd'),auth[_0xfcc4('0xb')](),controller[_0xfcc4('0xe')]);router[_0xfcc4('0xa')]('/:id/run',auth['isAuthenticated'](),controller[_0xfcc4('0xf')]);router[_0xfcc4('0xa')](_0xfcc4('0x10'),auth['isAuthenticated'](),controller[_0xfcc4('0x11')]);router['post']('/',auth[_0xfcc4('0xb')](),controller['create']);router[_0xfcc4('0x12')]('/:id',auth[_0xfcc4('0xb')](),controller[_0xfcc4('0x13')]);router[_0xfcc4('0x14')](_0xfcc4('0x15'),auth[_0xfcc4('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index b660d28..56e3f5a 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 _0x76c8=['INTEGER','sequelize','moment','exports','STRING','ENUM','pdf','xlsx','DATE','Loading','manual'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x76c8,0xb1));var _0x876c=function(_0x35c11a,_0x3ec30f){_0x35c11a=_0x35c11a-0x0;var _0x16cb6a=_0x76c8[_0x35c11a];return _0x16cb6a;};'use strict';var Sequelize=require(_0x876c('0x0'));var moment=require(_0x876c('0x1'));module[_0x876c('0x2')]={'name':{'type':Sequelize[_0x876c('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x876c('0x4')]('csv',_0x876c('0x5'),_0x876c('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x876c('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x876c('0x7')]},'endDate':{'type':Sequelize[_0x876c('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x876c('0x8')},'type':{'type':Sequelize['ENUM'](_0x876c('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x876c('0x9')},'reportId':{'type':Sequelize[_0x876c('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x876c('0x3')]}}; \ No newline at end of file +var _0x6b7d=['moment','exports','STRING','csv','DATE','ENUM','scheduled','manual','INTEGER','UNSIGNED'];(function(_0x5aaf8a,_0x11cb3f){var _0x12a226=function(_0x239b14){while(--_0x239b14){_0x5aaf8a['push'](_0x5aaf8a['shift']());}};_0x12a226(++_0x11cb3f);}(_0x6b7d,0xb4));var _0xd6b7=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6b7d[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd6b7('0x0'));module[_0xd6b7('0x1')]={'name':{'type':Sequelize[_0xd6b7('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xd6b7('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xd6b7('0x3'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xd6b7('0x3')},'savename':{'type':Sequelize[_0xd6b7('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd6b7('0x4')]},'endDate':{'type':Sequelize[_0xd6b7('0x4')]},'status':{'type':Sequelize[_0xd6b7('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xd6b7('0x5')]('manual',_0xd6b7('0x6')),'allowNull':![],'defaultValue':_0xd6b7('0x7')},'reportId':{'type':Sequelize[_0xd6b7('0x8')](0xb)[_0xd6b7('0x9')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 249cae8..76a7fa5 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 _0x0598=['json','undefined','limit','count','offset','set','apply','update','destroy','then','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','join','server/files/reports','Report\x20not\x20found\x20or\x20empty','exists','root','format','toLowerCase','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status'];(function(_0x5e462b,_0x187b06){var _0xb01a65=function(_0x2cc9a3){while(--_0x2cc9a3){_0x5e462b['push'](_0x5e462b['shift']());}};_0xb01a65(++_0x187b06);}(_0x0598,0x92));var _0x8059=function(_0x37df29,_0x3dccd3){_0x37df29=_0x37df29-0x0;var _0x2eb360=_0x0598[_0x37df29];return _0x2eb360;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require(_0x8059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8059('0x3'));var Mustache=require(_0x8059('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8059('0x5'));var ejs=require(_0x8059('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ead10,_0x2d26e2){_0x2d26e2=_0x2d26e2||0xcc;return function(_0x306467){if(_0x306467){return _0x1ead10[_0x8059('0x12')](_0x2d26e2);}return _0x1ead10[_0x8059('0x13')](_0x2d26e2)['end']();};}function respondWithResult(_0x11218f,_0x5480a5){_0x5480a5=_0x5480a5||0xc8;return function(_0x346b23){if(_0x346b23){return _0x11218f['status'](_0x5480a5)[_0x8059('0x14')](_0x346b23);}};}function respondWithFilteredResult(_0x13bf07,_0x4810fd){return function(_0x4d3873){if(_0x4d3873){var _0x516c1f=typeof _0x4810fd['offset']===_0x8059('0x15')&&typeof _0x4810fd[_0x8059('0x16')]===_0x8059('0x15');var _0x246c9d=_0x4d3873[_0x8059('0x17')];var _0x4b6d55=_0x516c1f?0x0:_0x4810fd[_0x8059('0x18')];var _0x2bb670=_0x516c1f?_0x4d3873[_0x8059('0x17')]:_0x4810fd[_0x8059('0x18')]+_0x4810fd['limit'];var _0x5456a9;if(_0x2bb670>=_0x246c9d){_0x2bb670=_0x246c9d;_0x5456a9=0xc8;}else{_0x5456a9=0xce;}_0x13bf07['status'](_0x5456a9);return _0x13bf07[_0x8059('0x19')]('Content-Range',_0x4b6d55+'-'+_0x2bb670+'/'+_0x246c9d)[_0x8059('0x14')](_0x4d3873);}return null;};}function patchUpdates(_0x56d794){return function(_0x466a88){try{jsonpatch[_0x8059('0x1a')](_0x466a88,_0x56d794,!![]);}catch(_0x1e9ac5){return BPromise['reject'](_0x1e9ac5);}return _0x466a88['save']();};}function saveUpdates(_0x21a80f,_0x232f1b){return function(_0x32aeda){if(_0x32aeda){return _0x32aeda[_0x8059('0x1b')](_0x21a80f)['then'](function(_0x3bc226){return _0x3bc226;});}return null;};}function removeEntity(_0x21ac82,_0x3da080){return function(_0x5449d9){if(_0x5449d9){return _0x5449d9[_0x8059('0x1c')]()[_0x8059('0x1d')](function(){var _0x3e1067=_0x5449d9[_0x8059('0x1e')]({'plain':!![]});var _0x59d3a6=_0x8059('0x1f');return db[_0x8059('0x20')][_0x8059('0x1c')]({'where':{'type':_0x59d3a6,'resourceId':_0x3e1067['id']}})[_0x8059('0x1d')](function(){return _0x5449d9;});})[_0x8059('0x1d')](function(){_0x21ac82['status'](0xcc)[_0x8059('0x21')]();});}};}function handleEntityNotFound(_0x19b95a,_0xd1fa7e){return function(_0x4a294f){if(!_0x4a294f){_0x19b95a['sendStatus'](0x194);}return _0x4a294f;};}function handleError(_0x5d5b45,_0x1f3d05){_0x1f3d05=_0x1f3d05||0x1f4;return function(_0xbebe0e){logger[_0x8059('0x22')](_0xbebe0e[_0x8059('0x23')]);if(_0xbebe0e['name']){delete _0xbebe0e[_0x8059('0x24')];}_0x5d5b45['status'](_0x1f3d05)[_0x8059('0x25')](_0xbebe0e);};}exports[_0x8059('0x26')]=function(_0x5ecf7f,_0x3814f5){var _0x1aead2={},_0x30aac2={},_0x260ba8={'count':0x0,'rows':[]};var _0x2799b7=_[_0x8059('0x27')](db[_0x8059('0x28')][_0x8059('0x29')],function(_0x505756){return{'name':_0x505756[_0x8059('0x2a')],'type':_0x505756[_0x8059('0x2b')][_0x8059('0x2c')]};});_0x30aac2[_0x8059('0x2d')]=_[_0x8059('0x27')](_0x2799b7,'name');_0x30aac2[_0x8059('0x2e')]=_[_0x8059('0x2f')](_0x5ecf7f[_0x8059('0x2e')]);_0x30aac2[_0x8059('0x30')]=_[_0x8059('0x31')](_0x30aac2[_0x8059('0x2d')],_0x30aac2[_0x8059('0x2e')]);_0x1aead2[_0x8059('0x32')]=_[_0x8059('0x31')](_0x30aac2[_0x8059('0x2d')],qs['fields'](_0x5ecf7f[_0x8059('0x2e')]['fields']));_0x1aead2[_0x8059('0x32')]=_0x1aead2['attributes']['length']?_0x1aead2[_0x8059('0x32')]:_0x30aac2['model'];if(!_0x5ecf7f[_0x8059('0x2e')]['hasOwnProperty'](_0x8059('0x33'))){_0x1aead2['limit']=qs[_0x8059('0x16')](_0x5ecf7f[_0x8059('0x2e')]['limit']);_0x1aead2[_0x8059('0x18')]=qs[_0x8059('0x18')](_0x5ecf7f[_0x8059('0x2e')]['offset']);}_0x1aead2[_0x8059('0x34')]=qs['sort'](_0x5ecf7f[_0x8059('0x2e')]['sort']);_0x1aead2[_0x8059('0x35')]=qs[_0x8059('0x30')](_[_0x8059('0x36')](_0x5ecf7f[_0x8059('0x2e')],_0x30aac2['filters']),_0x2799b7);if(_0x5ecf7f[_0x8059('0x2e')]['filter']){_0x1aead2['where']=_[_0x8059('0x37')](_0x1aead2[_0x8059('0x35')],{'$or':_[_0x8059('0x27')](_0x2799b7,function(_0x8aa012){if(_0x8aa012[_0x8059('0x2b')]!=='VIRTUAL'){var _0x47c3b9={};_0x47c3b9[_0x8aa012['name']]={'$like':'%'+_0x5ecf7f['query'][_0x8059('0x38')]+'%'};return _0x47c3b9;}})});}_0x1aead2=_[_0x8059('0x37')]({},_0x1aead2,_0x5ecf7f[_0x8059('0x39')]);var _0x4a0323={'where':_0x1aead2[_0x8059('0x35')]};return db[_0x8059('0x28')]['count'](_0x4a0323)[_0x8059('0x1d')](function(_0x2980cb){_0x260ba8[_0x8059('0x17')]=_0x2980cb;if(_0x5ecf7f['query'][_0x8059('0x3a')]){_0x1aead2[_0x8059('0x3b')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x8059('0x3c')](_0x1aead2);})[_0x8059('0x1d')](function(_0x3f00de){_0x260ba8[_0x8059('0x3d')]=_0x3f00de;return _0x260ba8;})[_0x8059('0x1d')](respondWithFilteredResult(_0x3814f5,_0x1aead2))[_0x8059('0x3e')](handleError(_0x3814f5,null));};exports[_0x8059('0x3f')]=function(_0x1bf30e,_0x3687a0){var _0x3b7a28={'raw':!![],'where':{'id':_0x1bf30e[_0x8059('0x40')]['id']}},_0x1d64db={};_0x1d64db[_0x8059('0x2d')]=_[_0x8059('0x2f')](db[_0x8059('0x28')][_0x8059('0x29')]);_0x1d64db[_0x8059('0x2e')]=_[_0x8059('0x2f')](_0x1bf30e[_0x8059('0x2e')]);_0x1d64db[_0x8059('0x30')]=_[_0x8059('0x31')](_0x1d64db[_0x8059('0x2d')],_0x1d64db[_0x8059('0x2e')]);_0x3b7a28['attributes']=_[_0x8059('0x31')](_0x1d64db['model'],qs['fields'](_0x1bf30e[_0x8059('0x2e')]['fields']));_0x3b7a28[_0x8059('0x32')]=_0x3b7a28['attributes'][_0x8059('0x41')]?_0x3b7a28[_0x8059('0x32')]:_0x1d64db[_0x8059('0x2d')];if(_0x1bf30e[_0x8059('0x2e')][_0x8059('0x3a')]){_0x3b7a28[_0x8059('0x3b')]=[{'all':!![]}];}_0x3b7a28=_['merge']({},_0x3b7a28,_0x1bf30e[_0x8059('0x39')]);return db['AnalyticExtractedReport'][_0x8059('0x42')](_0x3b7a28)[_0x8059('0x1d')](handleEntityNotFound(_0x3687a0,null))[_0x8059('0x1d')](respondWithResult(_0x3687a0,null))['catch'](handleError(_0x3687a0,null));};exports[_0x8059('0x43')]=function(_0x120665,_0x46bec8){return db[_0x8059('0x28')]['create'](_0x120665[_0x8059('0x44')],{})[_0x8059('0x1d')](function(_0x109748){var _0x48e3bb=_0x120665[_0x8059('0x45')]['get']({'plain':!![]});if(!_0x48e3bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48e3bb[_0x8059('0x46')]==='user'){var _0x20caa3=_0x109748['get']({'plain':!![]});var _0x261967=_0x8059('0x1f');return db['UserProfileSection'][_0x8059('0x42')]({'where':{'name':_0x261967,'userProfileId':_0x48e3bb['userProfileId']},'raw':!![]})[_0x8059('0x1d')](function(_0x7a844b){if(_0x7a844b&&_0x7a844b[_0x8059('0x47')]===0x0){return db['UserProfileResource'][_0x8059('0x43')]({'name':_0x20caa3['name'],'resourceId':_0x20caa3['id'],'type':_0x7a844b[_0x8059('0x24')],'sectionId':_0x7a844b['id']},{})[_0x8059('0x1d')](function(){return _0x109748;});}else{return _0x109748;}})[_0x8059('0x3e')](function(_0xb63fee){logger['error'](_0x8059('0x48'),_0xb63fee);throw _0xb63fee;});}return _0x109748;})[_0x8059('0x1d')](respondWithResult(_0x46bec8,0xc9))['catch'](handleError(_0x46bec8,null));};exports[_0x8059('0x1b')]=function(_0x5886fd,_0xa1b2cf){if(_0x5886fd['body']['id']){delete _0x5886fd['body']['id'];}return db[_0x8059('0x28')][_0x8059('0x42')]({'where':{'id':_0x5886fd[_0x8059('0x40')]['id']}})[_0x8059('0x1d')](handleEntityNotFound(_0xa1b2cf,null))[_0x8059('0x1d')](saveUpdates(_0x5886fd[_0x8059('0x44')],null))[_0x8059('0x1d')](respondWithResult(_0xa1b2cf,null))['catch'](handleError(_0xa1b2cf,null));};exports['destroy']=function(_0x52ed37,_0x50eef3){return db[_0x8059('0x28')][_0x8059('0x42')]({'where':{'id':_0x52ed37['params']['id']}})[_0x8059('0x1d')](handleEntityNotFound(_0x50eef3,null))['then'](removeEntity(_0x50eef3,null))['catch'](handleError(_0x50eef3,null));};exports[_0x8059('0x49')]=function(_0x55cb8d,_0x11b69a,_0x27dfa5){return db[_0x8059('0x28')]['find']({'where':{'id':_0x55cb8d['params']['id']},'attributes':[_0x8059('0x24'),_0x8059('0x4a'),_0x8059('0x4b'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x11b69a,null))[_0x8059('0x1d')](function(_0x538460){if(_0x538460){if(!fs['existsSync'](path[_0x8059('0x4c')](config['root'],_0x8059('0x4d'),_0x538460[_0x8059('0x4b')]))){throw new db['Sequelize']['ValidationError'](_0x8059('0x4e'));}if(_0x55cb8d[_0x8059('0x2e')][_0x8059('0x4f')]){return _0x11b69a['sendStatus'](0xc8);}return _0x11b69a[_0x8059('0x49')](path[_0x8059('0x4c')](config[_0x8059('0x50')],_0x8059('0x4d'),_0x538460['savename']),util[_0x8059('0x51')]('%s.%s',_0x538460[_0x8059('0x4a')]||_0x538460[_0x8059('0x24')],_0x538460['output'][_0x8059('0x52')]()));}})['catch'](handleError(_0x11b69a,null));}; \ No newline at end of file +var _0x9354=['get','ExtractedReports','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','map','VIRTUAL','filter','merge','options','AnalyticExtractedReport','include','findAll','catch','params','keys','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','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','format','%s.%s','toLowerCase','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy'];(function(_0x531e37,_0x4c86dd){var _0x2a48ab=function(_0x48f769){while(--_0x48f769){_0x531e37['push'](_0x531e37['shift']());}};_0x2a48ab(++_0x4c86dd);}(_0x9354,0x96));var _0x4935=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x9354[_0x513aa5];return _0x1a1a7c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4935('0x0'));var zipdir=require(_0x4935('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4935('0x2'));var moment=require(_0x4935('0x3'));var BPromise=require(_0x4935('0x4'));var Mustache=require(_0x4935('0x5'));var util=require('util');var path=require(_0x4935('0x6'));var sox=require(_0x4935('0x7'));var csv=require(_0x4935('0x8'));var ejs=require(_0x4935('0x9'));var fs=require('fs');var fs_extra=require(_0x4935('0xa'));var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x8'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var as=require(_0x4935('0x13'));var hardwareService=require(_0x4935('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4935('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4935('0x16'))['db'];function respondWithStatusCode(_0x32916f,_0x3bb388){_0x3bb388=_0x3bb388||0xcc;return function(_0x1c6c22){if(_0x1c6c22){return _0x32916f[_0x4935('0x17')](_0x3bb388);}return _0x32916f[_0x4935('0x18')](_0x3bb388)[_0x4935('0x19')]();};}function respondWithResult(_0x3a7c30,_0x57549f){_0x57549f=_0x57549f||0xc8;return function(_0x237e28){if(_0x237e28){return _0x3a7c30[_0x4935('0x18')](_0x57549f)[_0x4935('0x1a')](_0x237e28);}};}function respondWithFilteredResult(_0xa41961,_0x3652c4){return function(_0x24cc99){if(_0x24cc99){var _0x395a43=typeof _0x3652c4['offset']===_0x4935('0x1b')&&typeof _0x3652c4[_0x4935('0x1c')]===_0x4935('0x1b');var _0x123300=_0x24cc99[_0x4935('0x1d')];var _0x429ef3=_0x395a43?0x0:_0x3652c4['offset'];var _0xd70eff=_0x395a43?_0x24cc99[_0x4935('0x1d')]:_0x3652c4['offset']+_0x3652c4[_0x4935('0x1c')];var _0x10407f;if(_0xd70eff>=_0x123300){_0xd70eff=_0x123300;_0x10407f=0xc8;}else{_0x10407f=0xce;}_0xa41961[_0x4935('0x18')](_0x10407f);return _0xa41961['set']('Content-Range',_0x429ef3+'-'+_0xd70eff+'/'+_0x123300)[_0x4935('0x1a')](_0x24cc99);}return null;};}function patchUpdates(_0x6b849f){return function(_0x1ae059){try{jsonpatch[_0x4935('0x1e')](_0x1ae059,_0x6b849f,!![]);}catch(_0x41d76e){return BPromise[_0x4935('0x1f')](_0x41d76e);}return _0x1ae059[_0x4935('0x20')]();};}function saveUpdates(_0xe482a5,_0x58b2f3){return function(_0x2f520a){if(_0x2f520a){return _0x2f520a[_0x4935('0x21')](_0xe482a5)[_0x4935('0x22')](function(_0x2c701f){return _0x2c701f;});}return null;};}function removeEntity(_0x52c65a,_0x53530f){return function(_0x4dc1f5){if(_0x4dc1f5){return _0x4dc1f5[_0x4935('0x23')]()[_0x4935('0x22')](function(){var _0x3786ff=_0x4dc1f5[_0x4935('0x24')]({'plain':!![]});var _0x344e51=_0x4935('0x25');return db[_0x4935('0x26')][_0x4935('0x23')]({'where':{'type':_0x344e51,'resourceId':_0x3786ff['id']}})[_0x4935('0x22')](function(){return _0x4dc1f5;});})[_0x4935('0x22')](function(){_0x52c65a[_0x4935('0x18')](0xcc)[_0x4935('0x19')]();});}};}function handleEntityNotFound(_0x2c47ab,_0xbb00d6){return function(_0x359522){if(!_0x359522){_0x2c47ab['sendStatus'](0x194);}return _0x359522;};}function handleError(_0x5c3aaa,_0x5cec4d){_0x5cec4d=_0x5cec4d||0x1f4;return function(_0x1fc218){logger[_0x4935('0x27')](_0x1fc218['stack']);if(_0x1fc218[_0x4935('0x28')]){delete _0x1fc218[_0x4935('0x28')];}_0x5c3aaa[_0x4935('0x18')](_0x5cec4d)[_0x4935('0x29')](_0x1fc218);};}exports[_0x4935('0x2a')]=function(_0x24262e,_0x28afc2){var _0x2fe6da={},_0x5b3c8e={},_0xb7fe2a={'count':0x0,'rows':[]};var _0x2dcb0b=_['map'](db['AnalyticExtractedReport'][_0x4935('0x2b')],function(_0x479d28){return{'name':_0x479d28[_0x4935('0x2c')],'type':_0x479d28[_0x4935('0x2d')][_0x4935('0x2e')]};});_0x5b3c8e['model']=_['map'](_0x2dcb0b,_0x4935('0x28'));_0x5b3c8e[_0x4935('0x2f')]=_['keys'](_0x24262e[_0x4935('0x2f')]);_0x5b3c8e[_0x4935('0x30')]=_[_0x4935('0x31')](_0x5b3c8e[_0x4935('0x32')],_0x5b3c8e[_0x4935('0x2f')]);_0x2fe6da['attributes']=_['intersection'](_0x5b3c8e[_0x4935('0x32')],qs[_0x4935('0x33')](_0x24262e['query']['fields']));_0x2fe6da[_0x4935('0x34')]=_0x2fe6da['attributes'][_0x4935('0x35')]?_0x2fe6da[_0x4935('0x34')]:_0x5b3c8e[_0x4935('0x32')];if(!_0x24262e[_0x4935('0x2f')][_0x4935('0x36')](_0x4935('0x37'))){_0x2fe6da['limit']=qs[_0x4935('0x1c')](_0x24262e['query'][_0x4935('0x1c')]);_0x2fe6da['offset']=qs[_0x4935('0x38')](_0x24262e['query'][_0x4935('0x38')]);}_0x2fe6da[_0x4935('0x39')]=qs[_0x4935('0x3a')](_0x24262e[_0x4935('0x2f')][_0x4935('0x3a')]);_0x2fe6da[_0x4935('0x3b')]=qs[_0x4935('0x30')](_['pick'](_0x24262e['query'],_0x5b3c8e[_0x4935('0x30')]),_0x2dcb0b);if(_0x24262e['query']['filter']){_0x2fe6da[_0x4935('0x3b')]=_['merge'](_0x2fe6da[_0x4935('0x3b')],{'$or':_[_0x4935('0x3c')](_0x2dcb0b,function(_0x2d67e3){if(_0x2d67e3[_0x4935('0x2d')]!==_0x4935('0x3d')){var _0x53aac5={};_0x53aac5[_0x2d67e3['name']]={'$like':'%'+_0x24262e[_0x4935('0x2f')][_0x4935('0x3e')]+'%'};return _0x53aac5;}})});}_0x2fe6da=_[_0x4935('0x3f')]({},_0x2fe6da,_0x24262e[_0x4935('0x40')]);var _0x4d9436={'where':_0x2fe6da[_0x4935('0x3b')]};return db[_0x4935('0x41')][_0x4935('0x1d')](_0x4d9436)['then'](function(_0x4e94f6){_0xb7fe2a[_0x4935('0x1d')]=_0x4e94f6;if(_0x24262e[_0x4935('0x2f')]['includeAll']){_0x2fe6da[_0x4935('0x42')]=[{'all':!![]}];}return db[_0x4935('0x41')][_0x4935('0x43')](_0x2fe6da);})[_0x4935('0x22')](function(_0x52ab0c){_0xb7fe2a['rows']=_0x52ab0c;return _0xb7fe2a;})[_0x4935('0x22')](respondWithFilteredResult(_0x28afc2,_0x2fe6da))[_0x4935('0x44')](handleError(_0x28afc2,null));};exports['show']=function(_0x1eaa47,_0x40f5ff){var _0x2195da={'raw':!![],'where':{'id':_0x1eaa47[_0x4935('0x45')]['id']}},_0x5135fd={};_0x5135fd[_0x4935('0x32')]=_[_0x4935('0x46')](db[_0x4935('0x41')][_0x4935('0x2b')]);_0x5135fd[_0x4935('0x2f')]=_[_0x4935('0x46')](_0x1eaa47[_0x4935('0x2f')]);_0x5135fd[_0x4935('0x30')]=_[_0x4935('0x31')](_0x5135fd[_0x4935('0x32')],_0x5135fd[_0x4935('0x2f')]);_0x2195da[_0x4935('0x34')]=_[_0x4935('0x31')](_0x5135fd[_0x4935('0x32')],qs[_0x4935('0x33')](_0x1eaa47[_0x4935('0x2f')][_0x4935('0x33')]));_0x2195da['attributes']=_0x2195da[_0x4935('0x34')]['length']?_0x2195da[_0x4935('0x34')]:_0x5135fd[_0x4935('0x32')];if(_0x1eaa47[_0x4935('0x2f')][_0x4935('0x47')]){_0x2195da['include']=[{'all':!![]}];}_0x2195da=_[_0x4935('0x3f')]({},_0x2195da,_0x1eaa47[_0x4935('0x40')]);return db[_0x4935('0x41')][_0x4935('0x48')](_0x2195da)[_0x4935('0x22')](handleEntityNotFound(_0x40f5ff,null))[_0x4935('0x22')](respondWithResult(_0x40f5ff,null))[_0x4935('0x44')](handleError(_0x40f5ff,null));};exports[_0x4935('0x49')]=function(_0x29b932,_0x392cba){return db['AnalyticExtractedReport'][_0x4935('0x49')](_0x29b932[_0x4935('0x4a')],{})['then'](function(_0x447a64){var _0x2636f4=_0x29b932[_0x4935('0x4b')][_0x4935('0x24')]({'plain':!![]});if(!_0x2636f4)throw new Error(_0x4935('0x4c'));if(_0x2636f4[_0x4935('0x4d')]===_0x4935('0x4b')){var _0x471fb1=_0x447a64['get']({'plain':!![]});var _0x57d0d9='ExtractedReports';return db['UserProfileSection'][_0x4935('0x48')]({'where':{'name':_0x57d0d9,'userProfileId':_0x2636f4[_0x4935('0x4e')]},'raw':!![]})[_0x4935('0x22')](function(_0x2072df){if(_0x2072df&&_0x2072df[_0x4935('0x4f')]===0x0){return db['UserProfileResource'][_0x4935('0x49')]({'name':_0x471fb1[_0x4935('0x28')],'resourceId':_0x471fb1['id'],'type':_0x2072df[_0x4935('0x28')],'sectionId':_0x2072df['id']},{})[_0x4935('0x22')](function(){return _0x447a64;});}else{return _0x447a64;}})[_0x4935('0x44')](function(_0x8196b4){logger[_0x4935('0x27')](_0x4935('0x50'),_0x8196b4);throw _0x8196b4;});}return _0x447a64;})[_0x4935('0x22')](respondWithResult(_0x392cba,0xc9))[_0x4935('0x44')](handleError(_0x392cba,null));};exports['update']=function(_0x24b83b,_0x4e99bb){if(_0x24b83b[_0x4935('0x4a')]['id']){delete _0x24b83b[_0x4935('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0x4935('0x48')]({'where':{'id':_0x24b83b['params']['id']}})['then'](handleEntityNotFound(_0x4e99bb,null))['then'](saveUpdates(_0x24b83b[_0x4935('0x4a')],null))[_0x4935('0x22')](respondWithResult(_0x4e99bb,null))[_0x4935('0x44')](handleError(_0x4e99bb,null));};exports[_0x4935('0x23')]=function(_0xd5a489,_0x56db7f){return db['AnalyticExtractedReport'][_0x4935('0x48')]({'where':{'id':_0xd5a489[_0x4935('0x45')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x56db7f,null))['then'](removeEntity(_0x56db7f,null))[_0x4935('0x44')](handleError(_0x56db7f,null));};exports[_0x4935('0x51')]=function(_0x24141a,_0xc92288,_0x5009c9){return db[_0x4935('0x41')]['find']({'where':{'id':_0x24141a['params']['id']},'attributes':['name',_0x4935('0x52'),_0x4935('0x53'),'output'],'raw':!![]})[_0x4935('0x22')](handleEntityNotFound(_0xc92288,null))[_0x4935('0x22')](function(_0x57b448){if(_0x57b448){if(!fs[_0x4935('0x54')](path[_0x4935('0x55')](config[_0x4935('0x56')],_0x4935('0x57'),_0x57b448[_0x4935('0x53')]))){throw new db[(_0x4935('0x58'))][(_0x4935('0x59'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x24141a[_0x4935('0x2f')]['exists']){return _0xc92288['sendStatus'](0xc8);}return _0xc92288[_0x4935('0x51')](path[_0x4935('0x55')](config['root'],'server/files/reports',_0x57b448[_0x4935('0x53')]),util[_0x4935('0x5a')](_0x4935('0x5b'),_0x57b448['basename']||_0x57b448[_0x4935('0x28')],_0x57b448['output'][_0x4935('0x5c')]()));}})[_0x4935('0x44')](handleError(_0xc92288,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index a1c8f98..7421095 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 _0xd4e7=['rimraf','../../config/environment','./analyticExtractedReport.attributes','define','analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd4e7,0x1d3));var _0x7d4e=function(_0x5f423b,_0x1c2c3b){_0x5f423b=_0x5f423b-0x0;var _0x5a9972=_0xd4e7[_0x5f423b];return _0x5a9972;};'use strict';var _=require(_0x7d4e('0x0'));var util=require('util');var logger=require(_0x7d4e('0x1'))(_0x7d4e('0x2'));var moment=require(_0x7d4e('0x3'));var BPromise=require(_0x7d4e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d4e('0x5'));var rimraf=require(_0x7d4e('0x6'));var config=require(_0x7d4e('0x7'));var attributes=require(_0x7d4e('0x8'));module['exports']=function(_0x30a619,_0xf33641){return _0x30a619[_0x7d4e('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x7d4e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43c6=['util','../../config/logger','api','bluebird','rimraf','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x3ff204,_0x46a3c4){var _0x2afc80=function(_0x28a464){while(--_0x28a464){_0x3ff204['push'](_0x3ff204['shift']());}};_0x2afc80(++_0x46a3c4);}(_0x43c6,0xa1));var _0x643c=function(_0xe15ae0,_0x3ff30c){_0xe15ae0=_0xe15ae0-0x0;var _0x5c77ad=_0x43c6[_0xe15ae0];return _0x5c77ad;};'use strict';var _=require(_0x643c('0x0'));var util=require(_0x643c('0x1'));var logger=require(_0x643c('0x2'))(_0x643c('0x3'));var moment=require('moment');var BPromise=require(_0x643c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x643c('0x5'));var config=require('../../config/environment');var attributes=require(_0x643c('0x6'));module['exports']=function(_0x1dadc4,_0x4ebce3){return _0x1dadc4['define'](_0x643c('0x7'),attributes,{'tableName':_0x643c('0x8'),'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 7f9031e..038bf2d 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 _0xe4e8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x15f3c0,_0x165a64){var _0x1adfe0=function(_0x212cfc){while(--_0x212cfc){_0x15f3c0['push'](_0x15f3c0['shift']());}};_0x1adfe0(++_0x165a64);}(_0xe4e8,0x1dc));var _0x8e4e=function(_0x9bf8b1,_0x39f7fd){_0x9bf8b1=_0x9bf8b1-0x0;var _0x30c31c=_0xe4e8[_0x9bf8b1];return _0x30c31c;};'use strict';var _=require(_0x8e4e('0x0'));var util=require(_0x8e4e('0x1'));var moment=require('moment');var BPromise=require(_0x8e4e('0x2'));var rs=require(_0x8e4e('0x3'));var fs=require('fs');var Redis=require(_0x8e4e('0x4'));var db=require(_0x8e4e('0x5'))['db'];var utils=require(_0x8e4e('0x6'));var logger=require(_0x8e4e('0x7'))(_0x8e4e('0x8'));var config=require(_0x8e4e('0x9'));var jayson=require(_0x8e4e('0xa'));var client=jayson[_0x8e4e('0xb')][_0x8e4e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe85646,_0x3f4cb4,_0x3d6c4f){return new BPromise(function(_0xa2fef2,_0x4de118){return client[_0x8e4e('0xd')](_0xe85646,_0x3d6c4f)['then'](function(_0x2c0e19){logger[_0x8e4e('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3f4cb4,_0x8e4e('0xf'));logger[_0x8e4e('0x10')](_0x8e4e('0x11'),_0x3f4cb4,_0x8e4e('0xf'),JSON[_0x8e4e('0x12')](_0x2c0e19));if(_0x2c0e19[_0x8e4e('0x13')]){if(_0x2c0e19[_0x8e4e('0x13')]['code']===0x1f4){logger[_0x8e4e('0x13')](_0x8e4e('0x14'),_0x3f4cb4,_0x2c0e19['error'][_0x8e4e('0x15')]);return _0x4de118(_0x2c0e19['error'][_0x8e4e('0x15')]);}logger[_0x8e4e('0x13')](_0x8e4e('0x14'),_0x3f4cb4,_0x2c0e19[_0x8e4e('0x13')]['message']);return _0xa2fef2(_0x2c0e19['error'][_0x8e4e('0x15')]);}else{logger[_0x8e4e('0xe')](_0x8e4e('0x14'),_0x3f4cb4,'request\x20sent');_0xa2fef2(_0x2c0e19[_0x8e4e('0x16')][_0x8e4e('0x15')]);}})[_0x8e4e('0x17')](function(_0x2e60b1){logger['error'](_0x8e4e('0x14'),_0x3f4cb4,_0x2e60b1);_0x4de118(_0x2e60b1);});});} \ No newline at end of file +var _0x436f=['lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x5b8317,_0x5e89cb){var _0x5ed04f=function(_0x1fe5bb){while(--_0x1fe5bb){_0x5b8317['push'](_0x5b8317['shift']());}};_0x5ed04f(++_0x5e89cb);}(_0x436f,0xbd));var _0xf436=function(_0x5948b5,_0x39dd07){_0x5948b5=_0x5948b5-0x0;var _0x534f6e=_0x436f[_0x5948b5];return _0x534f6e;};'use strict';var _=require(_0xf436('0x0'));var util=require('util');var moment=require(_0xf436('0x1'));var BPromise=require('bluebird');var rs=require(_0xf436('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf436('0x3'))['db'];var utils=require(_0xf436('0x4'));var logger=require(_0xf436('0x5'))('rpc');var config=require(_0xf436('0x6'));var jayson=require(_0xf436('0x7'));var client=jayson['client'][_0xf436('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x298375,_0x268769,_0x591819){return new BPromise(function(_0x401dbb,_0x1b53ea){return client[_0xf436('0x9')](_0x298375,_0x591819)[_0xf436('0xa')](function(_0x5693ce){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x268769,_0xf436('0xb'));logger[_0xf436('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x268769,_0xf436('0xb'),JSON[_0xf436('0xd')](_0x5693ce));if(_0x5693ce['error']){if(_0x5693ce[_0xf436('0xe')][_0xf436('0xf')]===0x1f4){logger['error'](_0xf436('0x10'),_0x268769,_0x5693ce['error'][_0xf436('0x11')]);return _0x1b53ea(_0x5693ce[_0xf436('0xe')][_0xf436('0x11')]);}logger[_0xf436('0xe')](_0xf436('0x10'),_0x268769,_0x5693ce[_0xf436('0xe')][_0xf436('0x11')]);return _0x401dbb(_0x5693ce[_0xf436('0xe')][_0xf436('0x11')]);}else{logger[_0xf436('0x12')](_0xf436('0x10'),_0x268769,'request\x20sent');_0x401dbb(_0x5693ce[_0xf436('0x13')][_0xf436('0x11')]);}})[_0xf436('0x14')](function(_0x458648){logger[_0xf436('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x268769,_0x458648);_0x1b53ea(_0x458648);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 1bbac58..71b6154 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 _0x1c84=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create'];(function(_0x22ca79,_0x2b9706){var _0x50b7b3=function(_0x4a9b21){while(--_0x4a9b21){_0x22ca79['push'](_0x22ca79['shift']());}};_0x50b7b3(++_0x2b9706);}(_0x1c84,0x138));var _0x41c8=function(_0xca6909,_0x31d421){_0xca6909=_0xca6909-0x0;var _0x44d08e=_0x1c84[_0xca6909];return _0x44d08e;};'use strict';var multer=require(_0x41c8('0x0'));var util=require(_0x41c8('0x1'));var path=require(_0x41c8('0x2'));var timeout=require(_0x41c8('0x3'));var express=require(_0x41c8('0x4'));var router=express[_0x41c8('0x5')]();var fs_extra=require(_0x41c8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x41c8('0x7'));var config=require(_0x41c8('0x8'));var controller=require(_0x41c8('0x9'));router[_0x41c8('0xa')]('/',auth[_0x41c8('0xb')](),controller['index']);router[_0x41c8('0xa')](_0x41c8('0xc'),auth[_0x41c8('0xb')](),controller[_0x41c8('0xd')]);router['get'](_0x41c8('0xe'),auth[_0x41c8('0xb')](),controller[_0x41c8('0xf')]);router[_0x41c8('0x10')]('/',auth['isAuthenticated'](),controller[_0x41c8('0x11')]);router[_0x41c8('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x41c8('0x13')]);router['delete'](_0x41c8('0xc'),auth['isAuthenticated'](),controller[_0x41c8('0x14')]);module[_0x41c8('0x15')]=router; \ No newline at end of file +var _0xaafc=['/:id','show','/:id/download','download','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','index','get'];(function(_0x1b4b7b,_0x31ca72){var _0x40ca6a=function(_0x4a058c){while(--_0x4a058c){_0x1b4b7b['push'](_0x1b4b7b['shift']());}};_0x40ca6a(++_0x31ca72);}(_0xaafc,0xb4));var _0xcaaf=function(_0x14650b,_0x4e7e56){_0x14650b=_0x14650b-0x0;var _0x58bf19=_0xaafc[_0x14650b];return _0x58bf19;};'use strict';var multer=require(_0xcaaf('0x0'));var util=require(_0xcaaf('0x1'));var path=require(_0xcaaf('0x2'));var timeout=require(_0xcaaf('0x3'));var express=require(_0xcaaf('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcaaf('0x5'));var config=require('../../config/environment');var controller=require(_0xcaaf('0x6'));router['get']('/',auth[_0xcaaf('0x7')](),controller[_0xcaaf('0x8')]);router[_0xcaaf('0x9')](_0xcaaf('0xa'),auth[_0xcaaf('0x7')](),controller[_0xcaaf('0xb')]);router[_0xcaaf('0x9')](_0xcaaf('0xc'),auth[_0xcaaf('0x7')](),controller[_0xcaaf('0xd')]);router['post']('/',auth[_0xcaaf('0x7')](),controller[_0xcaaf('0xe')]);router[_0xcaaf('0xf')](_0xcaaf('0xa'),auth[_0xcaaf('0x7')](),controller[_0xcaaf('0x10')]);router['delete'](_0xcaaf('0xa'),auth[_0xcaaf('0x7')](),controller[_0xcaaf('0x11')]);module[_0xcaaf('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 383ecfe..116870c 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(_0x230127,_0x4d989b){var _0x234e71=function(_0x2c694b){while(--_0x2c694b){_0x230127['push'](_0x230127['shift']());}};_0x234e71(++_0x4d989b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x5fc3[_0x31a576];return _0x30b1d3;};'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 _0x814b=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x11bf38,_0x213d7f){var _0x202699=function(_0x33659f){while(--_0x33659f){_0x11bf38['push'](_0x11bf38['shift']());}};_0x202699(++_0x213d7f);}(_0x814b,0x1a2));var _0xb814=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0x814b[_0x51d129];return _0x44c377;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'field':{'type':Sequelize[_0xb814('0x2')]},'alias':{'type':Sequelize[_0xb814('0x3')]},'function':{'type':Sequelize[_0xb814('0x3')]},'format':{'type':Sequelize[_0xb814('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb814('0x3')]},'custom':{'type':Sequelize[_0xb814('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index db2ac5a..152ad6e 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 _0xa9e0=['util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','catch','show','params','find','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','eml-format','rimraf','zip-dir','moment','mustache'];(function(_0xd1f854,_0x532346){var _0x548294=function(_0x4be823){while(--_0x4be823){_0xd1f854['push'](_0xd1f854['shift']());}};_0x548294(++_0x532346);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x45')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x28')]['bulkCreate'](_0x45c845[_0x0a9e('0x44')],{'raw':![],'individualHooks':!![]})[_0x0a9e('0x22')](respondWithResult(_0x37be73,0xc9))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x21')]=function(_0x409789,_0x992c77){if(_0x409789[_0x0a9e('0x44')]['id']){delete _0x409789[_0x0a9e('0x44')]['id'];}return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x409789[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x992c77,null))['then'](saveUpdates(_0x409789['body'],null))['then'](respondWithResult(_0x992c77,null))[_0x0a9e('0x40')](handleError(_0x992c77,null));};exports[_0x0a9e('0x23')]=function(_0x37edaa,_0x11545a){return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x37edaa[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x11545a,null))['then'](removeEntity(_0x11545a,null))['catch'](handleError(_0x11545a,null));};exports['bulkDestroy']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x28')]['destroy']({'where':{'id':_0x39d77d[_0x0a9e('0x2e')][_0x0a9e('0x46')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x204173,0xcc))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x47')]=function(_0x59c6ff,_0x443e72,_0x4c3845){return db[_0x0a9e('0x48')][_0x0a9e('0x49')]({'where':{'id':_0x59c6ff[_0x0a9e('0x42')]['id']}})['then'](handleEntityNotFound(_0x443e72,null))[_0x0a9e('0x22')](function(_0x1bf38a){if(_0x1bf38a){return db['sequelize']['transaction'](function(_0x128aa6){return db[_0x0a9e('0x28')]['destroy']({'where':{'CustomReportId':_0x59c6ff[_0x0a9e('0x42')]['id']},'transaction':_0x128aa6})['then'](function(_0x211ef9){var _0x523cd2=_[_0x0a9e('0x2d')](_0x59c6ff['body'],function(_0x5da27d){delete _0x5da27d['id'];_0x5da27d['CustomReportId']=_0x59c6ff[_0x0a9e('0x42')]['id'];return _0x5da27d;});return db['AnalyticFieldReport'][_0x0a9e('0x45')](_0x523cd2,{'transaction':_0x128aa6});});})[_0x0a9e('0x22')](function(){return db[_0x0a9e('0x28')][_0x0a9e('0x3f')]({'where':{'CustomReportId':_0x59c6ff[_0x0a9e('0x42')]['id']}});});}})[_0x0a9e('0x22')](respondWithResult(_0x443e72,null))[_0x0a9e('0x40')](handleError(_0x443e72,null));}; \ No newline at end of file +var _0xa9e0=['util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','catch','show','params','find','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','eml-format','rimraf','zip-dir','moment','mustache'];(function(_0x33b259,_0x2036be){var _0xf95548=function(_0x5b3424){while(--_0x5b3424){_0x33b259['push'](_0x33b259['shift']());}};_0xf95548(++_0x2036be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x45')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x28')]['bulkCreate'](_0x45c845[_0x0a9e('0x44')],{'raw':![],'individualHooks':!![]})[_0x0a9e('0x22')](respondWithResult(_0x37be73,0xc9))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x21')]=function(_0x409789,_0x992c77){if(_0x409789[_0x0a9e('0x44')]['id']){delete _0x409789[_0x0a9e('0x44')]['id'];}return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x409789[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x992c77,null))['then'](saveUpdates(_0x409789['body'],null))['then'](respondWithResult(_0x992c77,null))[_0x0a9e('0x40')](handleError(_0x992c77,null));};exports[_0x0a9e('0x23')]=function(_0x37edaa,_0x11545a){return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x37edaa[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x11545a,null))['then'](removeEntity(_0x11545a,null))['catch'](handleError(_0x11545a,null));};exports['bulkDestroy']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x28')]['destroy']({'where':{'id':_0x39d77d[_0x0a9e('0x2e')][_0x0a9e('0x46')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x204173,0xcc))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x47')]=function(_0x59c6ff,_0x443e72,_0x4c3845){return db[_0x0a9e('0x48')][_0x0a9e('0x49')]({'where':{'id':_0x59c6ff[_0x0a9e('0x42')]['id']}})['then'](handleEntityNotFound(_0x443e72,null))[_0x0a9e('0x22')](function(_0x1bf38a){if(_0x1bf38a){return db['sequelize']['transaction'](function(_0x128aa6){return db[_0x0a9e('0x28')]['destroy']({'where':{'CustomReportId':_0x59c6ff[_0x0a9e('0x42')]['id']},'transaction':_0x128aa6})['then'](function(_0x211ef9){var _0x523cd2=_[_0x0a9e('0x2d')](_0x59c6ff['body'],function(_0x5da27d){delete _0x5da27d['id'];_0x5da27d['CustomReportId']=_0x59c6ff[_0x0a9e('0x42')]['id'];return _0x5da27d;});return db['AnalyticFieldReport'][_0x0a9e('0x45')](_0x523cd2,{'transaction':_0x128aa6});});})[_0x0a9e('0x22')](function(){return db[_0x0a9e('0x28')][_0x0a9e('0x3f')]({'where':{'CustomReportId':_0x59c6ff[_0x0a9e('0x42')]['id']}});});}})[_0x0a9e('0x22')](respondWithResult(_0x443e72,null))[_0x0a9e('0x40')](handleError(_0x443e72,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index cae87bf..35ce82d 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 _0x9956=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x1a0c16,_0x46b7ea){var _0x435b04=function(_0x1e70b7){while(--_0x1e70b7){_0x1a0c16['push'](_0x1a0c16['shift']());}};_0x435b04(++_0x46b7ea);}(_0x9956,0x1cc));var _0x6995=function(_0x297788,_0x3334c2){_0x297788=_0x297788-0x0;var _0x271736=_0x9956[_0x297788];return _0x271736;};'use strict';var _=require(_0x6995('0x0'));var util=require(_0x6995('0x1'));var logger=require(_0x6995('0x2'))(_0x6995('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6995('0x4'));var fs=require('fs');var path=require(_0x6995('0x5'));var rimraf=require(_0x6995('0x6'));var config=require(_0x6995('0x7'));var attributes=require(_0x6995('0x8'));module[_0x6995('0x9')]=function(_0x38602a,_0x11d0d4){return _0x38602a[_0x6995('0xa')](_0x6995('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x769e=['AnalyticFieldReport','analytics_report_fields','moment','bluebird','request-promise','path','../../config/environment','define'];(function(_0x4ca12c,_0x1dfdbb){var _0x2350b2=function(_0x13cc5f){while(--_0x13cc5f){_0x4ca12c['push'](_0x4ca12c['shift']());}};_0x2350b2(++_0x1dfdbb);}(_0x769e,0x1e2));var _0xe769=function(_0x40b329,_0x5ead1f){_0x40b329=_0x40b329-0x0;var _0x309a2b=_0x769e[_0x40b329];return _0x309a2b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe769('0x0'));var BPromise=require(_0xe769('0x1'));var rp=require(_0xe769('0x2'));var fs=require('fs');var path=require(_0xe769('0x3'));var rimraf=require('rimraf');var config=require(_0xe769('0x4'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x573489,_0x43210a){return _0x573489[_0xe769('0x5')](_0xe769('0x6'),attributes,{'tableName':_0xe769('0x7'),'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 2c898ce..31f1a40 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 _0x9e6e=['code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x29cc08,_0x1b58dc){var _0xd9877e=function(_0x1ce11a){while(--_0x1ce11a){_0x29cc08['push'](_0x29cc08['shift']());}};_0xd9877e(++_0x1b58dc);}(_0x9e6e,0xc1));var _0xe9e6=function(_0x4d843f,_0x4a4401){_0x4d843f=_0x4d843f-0x0;var _0x58a99e=_0x9e6e[_0x4d843f];return _0x58a99e;};'use strict';var _=require(_0xe9e6('0x0'));var util=require(_0xe9e6('0x1'));var moment=require(_0xe9e6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9e6('0x3'));var db=require(_0xe9e6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9e6('0x5'))(_0xe9e6('0x6'));var config=require(_0xe9e6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe9e6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cc033,_0x45ad16,_0x24b1ef){return new BPromise(function(_0x2738c4,_0x588d6a){return client[_0xe9e6('0x9')](_0x3cc033,_0x24b1ef)['then'](function(_0xaa470c){logger[_0xe9e6('0xa')](_0xe9e6('0xb'),_0x45ad16,_0xe9e6('0xc'));logger[_0xe9e6('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x45ad16,_0xe9e6('0xc'),JSON[_0xe9e6('0xe')](_0xaa470c));if(_0xaa470c[_0xe9e6('0xf')]){if(_0xaa470c[_0xe9e6('0xf')][_0xe9e6('0x10')]===0x1f4){logger[_0xe9e6('0xf')](_0xe9e6('0xb'),_0x45ad16,_0xaa470c['error']['message']);return _0x588d6a(_0xaa470c['error']['message']);}logger[_0xe9e6('0xf')](_0xe9e6('0xb'),_0x45ad16,_0xaa470c[_0xe9e6('0xf')]['message']);return _0x2738c4(_0xaa470c[_0xe9e6('0xf')][_0xe9e6('0x11')]);}else{logger[_0xe9e6('0xa')](_0xe9e6('0xb'),_0x45ad16,'request\x20sent');_0x2738c4(_0xaa470c['result'][_0xe9e6('0x11')]);}})[_0xe9e6('0x12')](function(_0xc384bd){logger[_0xe9e6('0xf')](_0xe9e6('0xb'),_0x45ad16,_0xc384bd);_0x588d6a(_0xc384bd);});});} \ No newline at end of file +var _0x290a=['error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x370d15,_0x31ef09){var _0x2304d1=function(_0x14b7cc){while(--_0x14b7cc){_0x370d15['push'](_0x370d15['shift']());}};_0x2304d1(++_0x31ef09);}(_0x290a,0x1e6));var _0xa290=function(_0x5b8b31,_0x14b4c4){_0x5b8b31=_0x5b8b31-0x0;var _0x995533=_0x290a[_0x5b8b31];return _0x995533;};'use strict';var _=require('lodash');var util=require(_0xa290('0x0'));var moment=require(_0xa290('0x1'));var BPromise=require(_0xa290('0x2'));var rs=require(_0xa290('0x3'));var fs=require('fs');var Redis=require(_0xa290('0x4'));var db=require(_0xa290('0x5'))['db'];var utils=require(_0xa290('0x6'));var logger=require(_0xa290('0x7'))(_0xa290('0x8'));var config=require(_0xa290('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa290('0xa')][_0xa290('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5759bc,_0x321c7d,_0x2e3a76){return new BPromise(function(_0x55216c,_0xc2b41a){return client[_0xa290('0xc')](_0x5759bc,_0x2e3a76)[_0xa290('0xd')](function(_0x52f4ad){logger['info'](_0xa290('0xe'),_0x321c7d,_0xa290('0xf'));logger[_0xa290('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x321c7d,_0xa290('0xf'),JSON[_0xa290('0x11')](_0x52f4ad));if(_0x52f4ad[_0xa290('0x12')]){if(_0x52f4ad['error'][_0xa290('0x13')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x321c7d,_0x52f4ad['error'][_0xa290('0x14')]);return _0xc2b41a(_0x52f4ad[_0xa290('0x12')][_0xa290('0x14')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x321c7d,_0x52f4ad[_0xa290('0x12')][_0xa290('0x14')]);return _0x55216c(_0x52f4ad['error'][_0xa290('0x14')]);}else{logger[_0xa290('0x15')](_0xa290('0xe'),_0x321c7d,_0xa290('0xf'));_0x55216c(_0x52f4ad[_0xa290('0x16')][_0xa290('0x14')]);}})[_0xa290('0x17')](function(_0x106124){logger['error'](_0xa290('0xe'),_0x321c7d,_0x106124);_0xc2b41a(_0x106124);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index dd682bf..4d9344b 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 _0xb215=['update','/destroy_many','bulkDestroy','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','post','bulkCreate','/:id/create_many','addFields','put'];(function(_0x4a95b8,_0x347dbd){var _0x182c44=function(_0x1ad58d){while(--_0x1ad58d){_0x4a95b8['push'](_0x4a95b8['shift']());}};_0x182c44(++_0x347dbd);}(_0xb215,0xa7));var _0x5b21=function(_0x340c8d,_0x52809a){_0x340c8d=_0x340c8d-0x0;var _0x343c80=_0xb215[_0x340c8d];return _0x343c80;};'use strict';var multer=require(_0x5b21('0x0'));var util=require('util');var path=require(_0x5b21('0x1'));var timeout=require(_0x5b21('0x2'));var express=require(_0x5b21('0x3'));var router=express[_0x5b21('0x4')]();var fs_extra=require(_0x5b21('0x5'));var auth=require(_0x5b21('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0x5b21('0x7')]('/',auth[_0x5b21('0x8')](),controller[_0x5b21('0x9')]);router[_0x5b21('0x7')](_0x5b21('0xa'),auth[_0x5b21('0x8')](),controller[_0x5b21('0xb')]);router[_0x5b21('0xc')]('/',auth[_0x5b21('0x8')](),controller['create']);router['post']('/create_many',auth['isAuthenticated'](),controller[_0x5b21('0xd')]);router[_0x5b21('0xc')](_0x5b21('0xe'),auth[_0x5b21('0x8')](),controller[_0x5b21('0xf')]);router[_0x5b21('0x10')](_0x5b21('0xa'),auth[_0x5b21('0x8')](),controller[_0x5b21('0x11')]);router['delete'](_0x5b21('0x12'),auth[_0x5b21('0x8')](),controller[_0x5b21('0x13')]);router[_0x5b21('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x5b21('0x15')]);module[_0x5b21('0x16')]=router; \ No newline at end of file +var _0xcca6=['update','delete','bulkDestroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','/create_many','bulkCreate','addFields'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xcca6,0xcc));var _0x6cca=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0xcca6[_0x382c73];return _0x1dd0bf;};'use strict';var multer=require(_0x6cca('0x0'));var util=require(_0x6cca('0x1'));var path=require(_0x6cca('0x2'));var timeout=require('connect-timeout');var express=require(_0x6cca('0x3'));var router=express[_0x6cca('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6cca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6cca('0x6'));var controller=require('./analyticFieldReport.controller');router['get']('/',auth[_0x6cca('0x7')](),controller[_0x6cca('0x8')]);router[_0x6cca('0x9')](_0x6cca('0xa'),auth[_0x6cca('0x7')](),controller[_0x6cca('0xb')]);router['post']('/',auth[_0x6cca('0x7')](),controller[_0x6cca('0xc')]);router['post'](_0x6cca('0xd'),auth[_0x6cca('0x7')](),controller[_0x6cca('0xe')]);router['post']('/:id/create_many',auth['isAuthenticated'](),controller[_0x6cca('0xf')]);router['put'](_0x6cca('0xa'),auth[_0x6cca('0x7')](),controller[_0x6cca('0x10')]);router[_0x6cca('0x11')]('/destroy_many',auth['isAuthenticated'](),controller[_0x6cca('0x12')]);router[_0x6cca('0x11')](_0x6cca('0xa'),auth[_0x6cca('0x7')](),controller['destroy']);module[_0x6cca('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 87e63ab..91b59b4 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 _0x63a2=['STRING','sequelize','exports','name','TEXT'];(function(_0x2d736f,_0x41a79d){var _0x126801=function(_0x5ea5af){while(--_0x5ea5af){_0x2d736f['push'](_0x2d736f['shift']());}};_0x126801(++_0x41a79d);}(_0x63a2,0x1e1));var _0x263a=function(_0x58039d,_0x572459){_0x58039d=_0x58039d-0x0;var _0x580a6f=_0x63a2[_0x58039d];return _0x580a6f;};'use strict';var Sequelize=require(_0x263a('0x0'));module[_0x263a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x263a('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x263a('0x3')]},'description':{'type':Sequelize[_0x263a('0x4')]}}; \ No newline at end of file +var _0xc771=['STRING','name','TEXT','sequelize','exports'];(function(_0x5ae642,_0x3bd071){var _0x29a019=function(_0xebe837){while(--_0xebe837){_0x5ae642['push'](_0x5ae642['shift']());}};_0x29a019(++_0x3bd071);}(_0xc771,0x1d9));var _0x1c77=function(_0xa33a79,_0xa8021e){_0xa33a79=_0xa33a79-0x0;var _0xcd2c61=_0xc771[_0xa33a79];return _0xcd2c61;};'use strict';var Sequelize=require(_0x1c77('0x0'));module[_0x1c77('0x1')]={'name':{'type':Sequelize[_0x1c77('0x2')],'allowNull':![],'unique':_0x1c77('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1c77('0x4')]},'description':{'type':Sequelize[_0x1c77('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index d75d3fa..b138536 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 _0x417f=['attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','params','include','options','find','catch','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','get','Metrics','UserProfileResource','error','name','index','map','AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection'];(function(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0x417f,0xac));var _0xf417=function(_0x216d27,_0x1e825e){_0x216d27=_0x216d27-0x0;var _0x583aa6=_0x417f[_0x216d27];return _0x583aa6;};'use strict';var emlformat=require(_0xf417('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf417('0x1'));var jsonpatch=require(_0xf417('0x2'));var rp=require(_0xf417('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf417('0x4'));var path=require(_0xf417('0x5'));var sox=require('sox');var csv=require(_0xf417('0x6'));var ejs=require(_0xf417('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf417('0x8'));var squel=require('squel');var crypto=require(_0xf417('0x9'));var jsforce=require(_0xf417('0xa'));var deskjs=require(_0xf417('0xb'));var toCsv=require(_0xf417('0x6'));var querystring=require(_0xf417('0xc'));var Papa=require(_0xf417('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf417('0xe'));var as=require(_0xf417('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf417('0x10'))(_0xf417('0x11'));var utils=require('../../config/utils');var config=require(_0xf417('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xf417('0x13'))['db'];function respondWithStatusCode(_0x44b4ab,_0x417e01){_0x417e01=_0x417e01||0xcc;return function(_0x6c0fe7){if(_0x6c0fe7){return _0x44b4ab[_0xf417('0x14')](_0x417e01);}return _0x44b4ab[_0xf417('0x15')](_0x417e01)[_0xf417('0x16')]();};}function respondWithResult(_0x2e0f12,_0x2ddd9e){_0x2ddd9e=_0x2ddd9e||0xc8;return function(_0x4acb5e){if(_0x4acb5e){return _0x2e0f12[_0xf417('0x15')](_0x2ddd9e)[_0xf417('0x17')](_0x4acb5e);}};}function respondWithFilteredResult(_0x296dec,_0x1bb2db){return function(_0x3fb6f3){if(_0x3fb6f3){var _0x2b531d=typeof _0x1bb2db['offset']===_0xf417('0x18')&&typeof _0x1bb2db[_0xf417('0x19')]==='undefined';var _0x551714=_0x3fb6f3['count'];var _0xc4aa24=_0x2b531d?0x0:_0x1bb2db[_0xf417('0x1a')];var _0x44d9af=_0x2b531d?_0x3fb6f3[_0xf417('0x1b')]:_0x1bb2db[_0xf417('0x1a')]+_0x1bb2db[_0xf417('0x19')];var _0x5698be;if(_0x44d9af>=_0x551714){_0x44d9af=_0x551714;_0x5698be=0xc8;}else{_0x5698be=0xce;}_0x296dec[_0xf417('0x15')](_0x5698be);return _0x296dec[_0xf417('0x1c')](_0xf417('0x1d'),_0xc4aa24+'-'+_0x44d9af+'/'+_0x551714)[_0xf417('0x17')](_0x3fb6f3);}return null;};}function patchUpdates(_0x3dbfd1){return function(_0x2eafca){try{jsonpatch[_0xf417('0x1e')](_0x2eafca,_0x3dbfd1,!![]);}catch(_0x17eb25){return BPromise['reject'](_0x17eb25);}return _0x2eafca[_0xf417('0x1f')]();};}function saveUpdates(_0xfc8f6d,_0xdb1e30){return function(_0x4a48e9){if(_0x4a48e9){return _0x4a48e9[_0xf417('0x20')](_0xfc8f6d)[_0xf417('0x21')](function(_0x2aa9ae){return _0x2aa9ae;});}return null;};}function removeEntity(_0x4add0f,_0x51a27){return function(_0x3df8ae){if(_0x3df8ae){return _0x3df8ae[_0xf417('0x22')]()['then'](function(){var _0x126678=_0x3df8ae[_0xf417('0x23')]({'plain':!![]});var _0xed30e8=_0xf417('0x24');return db[_0xf417('0x25')][_0xf417('0x22')]({'where':{'type':_0xed30e8,'resourceId':_0x126678['id']}})[_0xf417('0x21')](function(){return _0x3df8ae;});})['then'](function(){_0x4add0f['status'](0xcc)[_0xf417('0x16')]();});}};}function handleEntityNotFound(_0x37a12b,_0x44d6aa){return function(_0x56bbeb){if(!_0x56bbeb){_0x37a12b[_0xf417('0x14')](0x194);}return _0x56bbeb;};}function handleError(_0x2819ea,_0x3febef){_0x3febef=_0x3febef||0x1f4;return function(_0x58419f){logger[_0xf417('0x26')](_0x58419f['stack']);if(_0x58419f[_0xf417('0x27')]){delete _0x58419f[_0xf417('0x27')];}_0x2819ea[_0xf417('0x15')](_0x3febef)['send'](_0x58419f);};}exports[_0xf417('0x28')]=function(_0x508ac7,_0x2375cc){var _0x580b08={},_0x1dfc26={},_0x5212b8={'count':0x0,'rows':[]};var _0x3175f9=_[_0xf417('0x29')](db[_0xf417('0x2a')][_0xf417('0x2b')],function(_0x1bd41d){return{'name':_0x1bd41d['fieldName'],'type':_0x1bd41d[_0xf417('0x2c')]['key']};});_0x1dfc26[_0xf417('0x2d')]=_[_0xf417('0x29')](_0x3175f9,_0xf417('0x27'));_0x1dfc26[_0xf417('0x2e')]=_[_0xf417('0x2f')](_0x508ac7[_0xf417('0x2e')]);_0x1dfc26[_0xf417('0x30')]=_[_0xf417('0x31')](_0x1dfc26[_0xf417('0x2d')],_0x1dfc26[_0xf417('0x2e')]);_0x580b08[_0xf417('0x32')]=_[_0xf417('0x31')](_0x1dfc26[_0xf417('0x2d')],qs[_0xf417('0x33')](_0x508ac7['query'][_0xf417('0x33')]));_0x580b08[_0xf417('0x32')]=_0x580b08['attributes']['length']?_0x580b08[_0xf417('0x32')]:_0x1dfc26['model'];if(!_0x508ac7[_0xf417('0x2e')]['hasOwnProperty'](_0xf417('0x34'))){_0x580b08[_0xf417('0x19')]=qs['limit'](_0x508ac7[_0xf417('0x2e')][_0xf417('0x19')]);_0x580b08['offset']=qs[_0xf417('0x1a')](_0x508ac7[_0xf417('0x2e')][_0xf417('0x1a')]);}_0x580b08[_0xf417('0x35')]=qs[_0xf417('0x36')](_0x508ac7[_0xf417('0x2e')]['sort']);_0x580b08[_0xf417('0x37')]=qs[_0xf417('0x30')](_[_0xf417('0x38')](_0x508ac7[_0xf417('0x2e')],_0x1dfc26[_0xf417('0x30')]),_0x3175f9);if(_0x508ac7['query'][_0xf417('0x39')]){_0x580b08[_0xf417('0x37')]=_[_0xf417('0x3a')](_0x580b08['where'],{'$or':_[_0xf417('0x29')](_0x3175f9,function(_0x360e95){if(_0x360e95['type']!==_0xf417('0x3b')){var _0x5c2da5={};_0x5c2da5[_0x360e95[_0xf417('0x27')]]={'$like':'%'+_0x508ac7[_0xf417('0x2e')][_0xf417('0x39')]+'%'};return _0x5c2da5;}})});}_0x580b08=_[_0xf417('0x3a')]({},_0x580b08,_0x508ac7['options']);var _0x37ad22={'where':_0x580b08['where']};return db[_0xf417('0x2a')][_0xf417('0x1b')](_0x37ad22)[_0xf417('0x21')](function(_0x324d80){_0x5212b8[_0xf417('0x1b')]=_0x324d80;if(_0x508ac7[_0xf417('0x2e')][_0xf417('0x3c')]){_0x580b08['include']=[{'all':!![]}];}return db[_0xf417('0x2a')][_0xf417('0x3d')](_0x580b08);})[_0xf417('0x21')](function(_0x423431){_0x5212b8[_0xf417('0x3e')]=_0x423431;return _0x5212b8;})[_0xf417('0x21')](respondWithFilteredResult(_0x2375cc,_0x580b08))['catch'](handleError(_0x2375cc,null));};exports['show']=function(_0xc27b81,_0xb430b8){var _0x25b809={'raw':!![],'where':{'id':_0xc27b81[_0xf417('0x3f')]['id']}},_0x39b899={};_0x39b899[_0xf417('0x2d')]=_[_0xf417('0x2f')](db[_0xf417('0x2a')][_0xf417('0x2b')]);_0x39b899['query']=_[_0xf417('0x2f')](_0xc27b81[_0xf417('0x2e')]);_0x39b899[_0xf417('0x30')]=_[_0xf417('0x31')](_0x39b899[_0xf417('0x2d')],_0x39b899[_0xf417('0x2e')]);_0x25b809[_0xf417('0x32')]=_['intersection'](_0x39b899['model'],qs[_0xf417('0x33')](_0xc27b81[_0xf417('0x2e')][_0xf417('0x33')]));_0x25b809['attributes']=_0x25b809['attributes']['length']?_0x25b809[_0xf417('0x32')]:_0x39b899['model'];if(_0xc27b81[_0xf417('0x2e')]['includeAll']){_0x25b809[_0xf417('0x40')]=[{'all':!![]}];}_0x25b809=_[_0xf417('0x3a')]({},_0x25b809,_0xc27b81[_0xf417('0x41')]);return db[_0xf417('0x2a')][_0xf417('0x42')](_0x25b809)[_0xf417('0x21')](handleEntityNotFound(_0xb430b8,null))[_0xf417('0x21')](respondWithResult(_0xb430b8,null))[_0xf417('0x43')](handleError(_0xb430b8,null));};exports[_0xf417('0x44')]=function(_0x2bb7c2,_0x37c0a4){return db[_0xf417('0x2a')][_0xf417('0x44')](_0x2bb7c2[_0xf417('0x45')],{})[_0xf417('0x21')](function(_0x4dc855){var _0x30cf98=_0x2bb7c2[_0xf417('0x46')][_0xf417('0x23')]({'plain':!![]});if(!_0x30cf98)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30cf98['role']===_0xf417('0x46')){var _0x122565=_0x4dc855[_0xf417('0x23')]({'plain':!![]});var _0x49530c='Metrics';return db['UserProfileSection'][_0xf417('0x42')]({'where':{'name':_0x49530c,'userProfileId':_0x30cf98[_0xf417('0x47')]},'raw':!![]})[_0xf417('0x21')](function(_0x21124f){if(_0x21124f&&_0x21124f[_0xf417('0x48')]===0x0){return db[_0xf417('0x25')][_0xf417('0x44')]({'name':_0x122565[_0xf417('0x27')],'resourceId':_0x122565['id'],'type':_0x21124f[_0xf417('0x27')],'sectionId':_0x21124f['id']},{})[_0xf417('0x21')](function(){return _0x4dc855;});}else{return _0x4dc855;}})['catch'](function(_0x251cde){logger['error'](_0xf417('0x49'),_0x251cde);throw _0x251cde;});}return _0x4dc855;})[_0xf417('0x21')](respondWithResult(_0x37c0a4,0xc9))[_0xf417('0x43')](handleError(_0x37c0a4,null));};exports[_0xf417('0x20')]=function(_0x381891,_0x274840){if(_0x381891['body']['id']){delete _0x381891[_0xf417('0x45')]['id'];}return db[_0xf417('0x2a')][_0xf417('0x42')]({'where':{'id':_0x381891['params']['id']}})[_0xf417('0x21')](handleEntityNotFound(_0x274840,null))[_0xf417('0x21')](saveUpdates(_0x381891[_0xf417('0x45')],null))['then'](respondWithResult(_0x274840,null))[_0xf417('0x43')](handleError(_0x274840,null));};exports[_0xf417('0x22')]=function(_0x3946b6,_0x49d41c){return db[_0xf417('0x2a')]['find']({'where':{'id':_0x3946b6['params']['id']}})[_0xf417('0x21')](handleEntityNotFound(_0x49d41c,null))['then'](removeEntity(_0x49d41c,null))[_0xf417('0x43')](handleError(_0x49d41c,null));}; \ No newline at end of file +var _0x55e9=['error','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','limit','where','filter','VIRTUAL','options','includeAll','include','findAll','catch','keys','merge','create','body','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','then','destroy','get','Metrics','UserProfileResource'];(function(_0x373eaa,_0x24f131){var _0x5a1b12=function(_0x39eb52){while(--_0x39eb52){_0x373eaa['push'](_0x373eaa['shift']());}};_0x5a1b12(++_0x24f131);}(_0x55e9,0xcd));var _0x955e=function(_0x2d36a6,_0x2f8cd0){_0x2d36a6=_0x2d36a6-0x0;var _0x59cec0=_0x55e9[_0x2d36a6];return _0x59cec0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x955e('0x0'));var zipdir=require(_0x955e('0x1'));var jsonpatch=require(_0x955e('0x2'));var rp=require(_0x955e('0x3'));var moment=require(_0x955e('0x4'));var BPromise=require(_0x955e('0x5'));var Mustache=require(_0x955e('0x6'));var util=require(_0x955e('0x7'));var path=require(_0x955e('0x8'));var sox=require(_0x955e('0x9'));var csv=require('to-csv');var ejs=require(_0x955e('0xa'));var fs=require('fs');var fs_extra=require(_0x955e('0xb'));var _=require(_0x955e('0xc'));var squel=require('squel');var crypto=require(_0x955e('0xd'));var jsforce=require(_0x955e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x955e('0xf'));var querystring=require(_0x955e('0x10'));var Papa=require(_0x955e('0x11'));var Redis=require(_0x955e('0x12'));var authService=require(_0x955e('0x13'));var qs=require(_0x955e('0x14'));var as=require(_0x955e('0x15'));var hardwareService=require(_0x955e('0x16'));var logger=require(_0x955e('0x17'))(_0x955e('0x18'));var utils=require(_0x955e('0x19'));var config=require(_0x955e('0x1a'));var licenseUtil=require(_0x955e('0x1b'));var db=require(_0x955e('0x1c'))['db'];function respondWithStatusCode(_0x30d3c6,_0x301f48){_0x301f48=_0x301f48||0xcc;return function(_0xe8132){if(_0xe8132){return _0x30d3c6[_0x955e('0x1d')](_0x301f48);}return _0x30d3c6[_0x955e('0x1e')](_0x301f48)['end']();};}function respondWithResult(_0x588ac5,_0x5acfca){_0x5acfca=_0x5acfca||0xc8;return function(_0x683fa4){if(_0x683fa4){return _0x588ac5[_0x955e('0x1e')](_0x5acfca)[_0x955e('0x1f')](_0x683fa4);}};}function respondWithFilteredResult(_0xe8a9eb,_0x14b2bc){return function(_0xb24016){if(_0xb24016){var _0xc464d2=typeof _0x14b2bc[_0x955e('0x20')]===_0x955e('0x21')&&typeof _0x14b2bc['limit']===_0x955e('0x21');var _0x207ba2=_0xb24016[_0x955e('0x22')];var _0x53973a=_0xc464d2?0x0:_0x14b2bc[_0x955e('0x20')];var _0xdc8e5e=_0xc464d2?_0xb24016[_0x955e('0x22')]:_0x14b2bc[_0x955e('0x20')]+_0x14b2bc['limit'];var _0x598d12;if(_0xdc8e5e>=_0x207ba2){_0xdc8e5e=_0x207ba2;_0x598d12=0xc8;}else{_0x598d12=0xce;}_0xe8a9eb[_0x955e('0x1e')](_0x598d12);return _0xe8a9eb['set'](_0x955e('0x23'),_0x53973a+'-'+_0xdc8e5e+'/'+_0x207ba2)['json'](_0xb24016);}return null;};}function patchUpdates(_0x56f826){return function(_0x56c0ec){try{jsonpatch[_0x955e('0x24')](_0x56c0ec,_0x56f826,!![]);}catch(_0x109bd0){return BPromise[_0x955e('0x25')](_0x109bd0);}return _0x56c0ec[_0x955e('0x26')]();};}function saveUpdates(_0xb604e7,_0x1593bb){return function(_0x3add7e){if(_0x3add7e){return _0x3add7e['update'](_0xb604e7)[_0x955e('0x27')](function(_0x153389){return _0x153389;});}return null;};}function removeEntity(_0x226e57,_0x5743a3){return function(_0x53b382){if(_0x53b382){return _0x53b382[_0x955e('0x28')]()[_0x955e('0x27')](function(){var _0x1548cc=_0x53b382[_0x955e('0x29')]({'plain':!![]});var _0x3cc7b7=_0x955e('0x2a');return db[_0x955e('0x2b')][_0x955e('0x28')]({'where':{'type':_0x3cc7b7,'resourceId':_0x1548cc['id']}})[_0x955e('0x27')](function(){return _0x53b382;});})['then'](function(){_0x226e57[_0x955e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x574cb8,_0x233c51){return function(_0x33e992){if(!_0x33e992){_0x574cb8['sendStatus'](0x194);}return _0x33e992;};}function handleError(_0x400941,_0x27e25d){_0x27e25d=_0x27e25d||0x1f4;return function(_0xfd897c){logger[_0x955e('0x2c')](_0xfd897c['stack']);if(_0xfd897c[_0x955e('0x2d')]){delete _0xfd897c[_0x955e('0x2d')];}_0x400941[_0x955e('0x1e')](_0x27e25d)[_0x955e('0x2e')](_0xfd897c);};}exports[_0x955e('0x2f')]=function(_0x3c693d,_0x2cba54){var _0x467349={},_0x1fc846={},_0x305868={'count':0x0,'rows':[]};var _0x39490a=_[_0x955e('0x30')](db[_0x955e('0x31')][_0x955e('0x32')],function(_0x30d311){return{'name':_0x30d311[_0x955e('0x33')],'type':_0x30d311[_0x955e('0x34')][_0x955e('0x35')]};});_0x1fc846['model']=_[_0x955e('0x30')](_0x39490a,_0x955e('0x2d'));_0x1fc846[_0x955e('0x36')]=_['keys'](_0x3c693d[_0x955e('0x36')]);_0x1fc846[_0x955e('0x37')]=_[_0x955e('0x38')](_0x1fc846[_0x955e('0x39')],_0x1fc846[_0x955e('0x36')]);_0x467349[_0x955e('0x3a')]=_[_0x955e('0x38')](_0x1fc846[_0x955e('0x39')],qs[_0x955e('0x3b')](_0x3c693d[_0x955e('0x36')][_0x955e('0x3b')]));_0x467349['attributes']=_0x467349[_0x955e('0x3a')][_0x955e('0x3c')]?_0x467349[_0x955e('0x3a')]:_0x1fc846['model'];if(!_0x3c693d['query']['hasOwnProperty'](_0x955e('0x3d'))){_0x467349[_0x955e('0x3e')]=qs['limit'](_0x3c693d[_0x955e('0x36')][_0x955e('0x3e')]);_0x467349['offset']=qs[_0x955e('0x20')](_0x3c693d[_0x955e('0x36')]['offset']);}_0x467349['order']=qs['sort'](_0x3c693d[_0x955e('0x36')]['sort']);_0x467349[_0x955e('0x3f')]=qs[_0x955e('0x37')](_['pick'](_0x3c693d[_0x955e('0x36')],_0x1fc846['filters']),_0x39490a);if(_0x3c693d[_0x955e('0x36')][_0x955e('0x40')]){_0x467349[_0x955e('0x3f')]=_['merge'](_0x467349['where'],{'$or':_[_0x955e('0x30')](_0x39490a,function(_0x56aa01){if(_0x56aa01['type']!==_0x955e('0x41')){var _0x40ce5a={};_0x40ce5a[_0x56aa01[_0x955e('0x2d')]]={'$like':'%'+_0x3c693d['query'][_0x955e('0x40')]+'%'};return _0x40ce5a;}})});}_0x467349=_['merge']({},_0x467349,_0x3c693d[_0x955e('0x42')]);var _0x2f8382={'where':_0x467349[_0x955e('0x3f')]};return db[_0x955e('0x31')][_0x955e('0x22')](_0x2f8382)[_0x955e('0x27')](function(_0x93644d){_0x305868['count']=_0x93644d;if(_0x3c693d[_0x955e('0x36')][_0x955e('0x43')]){_0x467349[_0x955e('0x44')]=[{'all':!![]}];}return db[_0x955e('0x31')][_0x955e('0x45')](_0x467349);})['then'](function(_0xa6e85f){_0x305868['rows']=_0xa6e85f;return _0x305868;})[_0x955e('0x27')](respondWithFilteredResult(_0x2cba54,_0x467349))[_0x955e('0x46')](handleError(_0x2cba54,null));};exports['show']=function(_0x27a173,_0x4c8f74){var _0x59d887={'raw':!![],'where':{'id':_0x27a173['params']['id']}},_0x59be84={};_0x59be84[_0x955e('0x39')]=_[_0x955e('0x47')](db[_0x955e('0x31')][_0x955e('0x32')]);_0x59be84[_0x955e('0x36')]=_[_0x955e('0x47')](_0x27a173[_0x955e('0x36')]);_0x59be84[_0x955e('0x37')]=_[_0x955e('0x38')](_0x59be84[_0x955e('0x39')],_0x59be84[_0x955e('0x36')]);_0x59d887[_0x955e('0x3a')]=_[_0x955e('0x38')](_0x59be84[_0x955e('0x39')],qs[_0x955e('0x3b')](_0x27a173[_0x955e('0x36')]['fields']));_0x59d887['attributes']=_0x59d887[_0x955e('0x3a')][_0x955e('0x3c')]?_0x59d887[_0x955e('0x3a')]:_0x59be84[_0x955e('0x39')];if(_0x27a173[_0x955e('0x36')][_0x955e('0x43')]){_0x59d887[_0x955e('0x44')]=[{'all':!![]}];}_0x59d887=_[_0x955e('0x48')]({},_0x59d887,_0x27a173[_0x955e('0x42')]);return db[_0x955e('0x31')]['find'](_0x59d887)[_0x955e('0x27')](handleEntityNotFound(_0x4c8f74,null))[_0x955e('0x27')](respondWithResult(_0x4c8f74,null))['catch'](handleError(_0x4c8f74,null));};exports[_0x955e('0x49')]=function(_0x5d7f28,_0x738a9a){return db[_0x955e('0x31')][_0x955e('0x49')](_0x5d7f28[_0x955e('0x4a')],{})['then'](function(_0x2b2ec9){var _0x1dd30e=_0x5d7f28['user']['get']({'plain':!![]});if(!_0x1dd30e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1dd30e[_0x955e('0x4b')]==='user'){var _0x4864d8=_0x2b2ec9['get']({'plain':!![]});var _0xddc753=_0x955e('0x2a');return db[_0x955e('0x4c')][_0x955e('0x4d')]({'where':{'name':_0xddc753,'userProfileId':_0x1dd30e[_0x955e('0x4e')]},'raw':!![]})[_0x955e('0x27')](function(_0x537867){if(_0x537867&&_0x537867[_0x955e('0x4f')]===0x0){return db['UserProfileResource'][_0x955e('0x49')]({'name':_0x4864d8[_0x955e('0x2d')],'resourceId':_0x4864d8['id'],'type':_0x537867[_0x955e('0x2d')],'sectionId':_0x537867['id']},{})[_0x955e('0x27')](function(){return _0x2b2ec9;});}else{return _0x2b2ec9;}})['catch'](function(_0x2c5fa9){logger['error'](_0x955e('0x50'),_0x2c5fa9);throw _0x2c5fa9;});}return _0x2b2ec9;})[_0x955e('0x27')](respondWithResult(_0x738a9a,0xc9))[_0x955e('0x46')](handleError(_0x738a9a,null));};exports[_0x955e('0x51')]=function(_0x4ba5aa,_0x31bc32){if(_0x4ba5aa[_0x955e('0x4a')]['id']){delete _0x4ba5aa[_0x955e('0x4a')]['id'];}return db[_0x955e('0x31')][_0x955e('0x4d')]({'where':{'id':_0x4ba5aa[_0x955e('0x52')]['id']}})[_0x955e('0x27')](handleEntityNotFound(_0x31bc32,null))['then'](saveUpdates(_0x4ba5aa[_0x955e('0x4a')],null))[_0x955e('0x27')](respondWithResult(_0x31bc32,null))['catch'](handleError(_0x31bc32,null));};exports[_0x955e('0x28')]=function(_0x11609d,_0x3e897d){return db[_0x955e('0x31')][_0x955e('0x4d')]({'where':{'id':_0x11609d[_0x955e('0x52')]['id']}})[_0x955e('0x27')](handleEntityNotFound(_0x3e897d,null))[_0x955e('0x27')](removeEntity(_0x3e897d,null))[_0x955e('0x46')](handleError(_0x3e897d,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 722ed8f..44e05c4 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 _0x2e91=['bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment'];(function(_0x257d17,_0x54bbc7){var _0x4dd4f1=function(_0x575309){while(--_0x575309){_0x257d17['push'](_0x257d17['shift']());}};_0x4dd4f1(++_0x54bbc7);}(_0x2e91,0x1bb));var _0x12e9=function(_0x26fdfd,_0x561340){_0x26fdfd=_0x26fdfd-0x0;var _0x5460f5=_0x2e91[_0x26fdfd];return _0x5460f5;};'use strict';var _=require(_0x12e9('0x0'));var util=require(_0x12e9('0x1'));var logger=require(_0x12e9('0x2'))(_0x12e9('0x3'));var moment=require(_0x12e9('0x4'));var BPromise=require(_0x12e9('0x5'));var rp=require(_0x12e9('0x6'));var fs=require('fs');var path=require(_0x12e9('0x7'));var rimraf=require('rimraf');var config=require(_0x12e9('0x8'));var attributes=require(_0x12e9('0x9'));module[_0x12e9('0xa')]=function(_0x3f22be,_0x34619b){return _0x3f22be[_0x12e9('0xb')](_0x12e9('0xc'),attributes,{'tableName':_0x12e9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43b7=['request-promise','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','api','moment'];(function(_0x38a74f,_0x338460){var _0x346506=function(_0x1f4b03){while(--_0x1f4b03){_0x38a74f['push'](_0x38a74f['shift']());}};_0x346506(++_0x338460);}(_0x43b7,0x13c));var _0x743b=function(_0x13fe48,_0x437d73){_0x13fe48=_0x13fe48-0x0;var _0x160e83=_0x43b7[_0x13fe48];return _0x160e83;};'use strict';var _=require(_0x743b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x743b('0x1'));var moment=require(_0x743b('0x2'));var BPromise=require('bluebird');var rp=require(_0x743b('0x3'));var fs=require('fs');var path=require(_0x743b('0x4'));var rimraf=require(_0x743b('0x5'));var config=require('../../config/environment');var attributes=require(_0x743b('0x6'));module[_0x743b('0x7')]=function(_0x1eecd8,_0x559368){return _0x1eecd8[_0x743b('0x8')](_0x743b('0x9'),attributes,{'tableName':_0x743b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index fdb8339..a0513e9 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 _0x29c2=['../../config/environment','jayson/promise','client','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x54f87e,_0x336419){var _0x3e20ce=function(_0x486831){while(--_0x486831){_0x54f87e['push'](_0x54f87e['shift']());}};_0x3e20ce(++_0x336419);}(_0x29c2,0x10c));var _0x229c=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x29c2[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0x229c('0x0'));var moment=require('moment');var BPromise=require(_0x229c('0x1'));var rs=require(_0x229c('0x2'));var fs=require('fs');var Redis=require(_0x229c('0x3'));var db=require(_0x229c('0x4'))['db'];var utils=require(_0x229c('0x5'));var logger=require(_0x229c('0x6'))(_0x229c('0x7'));var config=require(_0x229c('0x8'));var jayson=require(_0x229c('0x9'));var client=jayson[_0x229c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20ed01,_0x34906d,_0x80e0b4){return new BPromise(function(_0x4ec1e0,_0x534c8f){return client['request'](_0x20ed01,_0x80e0b4)[_0x229c('0xb')](function(_0x1b018d){logger[_0x229c('0xc')](_0x229c('0xd'),_0x34906d,_0x229c('0xe'));logger[_0x229c('0xf')](_0x229c('0x10'),_0x34906d,'request\x20sent',JSON[_0x229c('0x11')](_0x1b018d));if(_0x1b018d['error']){if(_0x1b018d['error'][_0x229c('0x12')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x34906d,_0x1b018d['error'][_0x229c('0x13')]);return _0x534c8f(_0x1b018d['error'][_0x229c('0x13')]);}logger[_0x229c('0x14')](_0x229c('0xd'),_0x34906d,_0x1b018d['error']['message']);return _0x4ec1e0(_0x1b018d[_0x229c('0x14')][_0x229c('0x13')]);}else{logger[_0x229c('0xc')](_0x229c('0xd'),_0x34906d,_0x229c('0xe'));_0x4ec1e0(_0x1b018d[_0x229c('0x15')][_0x229c('0x13')]);}})[_0x229c('0x16')](function(_0x4aea52){logger[_0x229c('0x14')](_0x229c('0xd'),_0x34906d,_0x4aea52);_0x534c8f(_0x4aea52);});});} \ No newline at end of file +var _0xbaf3=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xbaf3,0xd7));var _0x3baf=function(_0x4858b0,_0x9dea28){_0x4858b0=_0x4858b0-0x0;var _0x5b05b5=_0xbaf3[_0x4858b0];return _0x5b05b5;};'use strict';var _=require(_0x3baf('0x0'));var util=require('util');var moment=require(_0x3baf('0x1'));var BPromise=require(_0x3baf('0x2'));var rs=require(_0x3baf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3baf('0x4'))['db'];var utils=require(_0x3baf('0x5'));var logger=require(_0x3baf('0x6'))(_0x3baf('0x7'));var config=require(_0x3baf('0x8'));var jayson=require(_0x3baf('0x9'));var client=jayson[_0x3baf('0xa')][_0x3baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x92c93,_0x236365,_0x524aa7){return new BPromise(function(_0xc932c6,_0x49ae51){return client['request'](_0x92c93,_0x524aa7)[_0x3baf('0xc')](function(_0x172fdf){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x236365,_0x3baf('0xd'));logger[_0x3baf('0xe')](_0x3baf('0xf'),_0x236365,'request\x20sent',JSON['stringify'](_0x172fdf));if(_0x172fdf[_0x3baf('0x10')]){if(_0x172fdf['error'][_0x3baf('0x11')]===0x1f4){logger[_0x3baf('0x10')](_0x3baf('0x12'),_0x236365,_0x172fdf['error'][_0x3baf('0x13')]);return _0x49ae51(_0x172fdf['error'][_0x3baf('0x13')]);}logger[_0x3baf('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x236365,_0x172fdf['error'][_0x3baf('0x13')]);return _0xc932c6(_0x172fdf[_0x3baf('0x10')]['message']);}else{logger['info'](_0x3baf('0x12'),_0x236365,_0x3baf('0xd'));_0xc932c6(_0x172fdf[_0x3baf('0x14')][_0x3baf('0x13')]);}})[_0x3baf('0x15')](function(_0xa98715){logger[_0x3baf('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x236365,_0xa98715);_0x49ae51(_0xa98715);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index fae4d14..1ed9c4d 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 _0x878f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','/:id','isAuthenticated','update','exports','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x878f,0x173));var _0xf878=function(_0x58b857,_0x4c2aa6){_0x58b857=_0x58b857-0x0;var _0x20b9ba=_0x878f[_0x58b857];return _0x20b9ba;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf878('0xc')](),controller['create']);router['put'](_0xf878('0xb'),auth[_0xf878('0xc')](),controller[_0xf878('0xd')]);router['delete'](_0xf878('0xb'),auth[_0xf878('0xc')](),controller['destroy']);module[_0xf878('0xe')]=router; \ No newline at end of file +var _0xbdb7=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','index','get','show','post','put','/:id','isAuthenticated','update'];(function(_0x5427c8,_0x18f384){var _0x33a129=function(_0x1940e8){while(--_0x1940e8){_0x5427c8['push'](_0x5427c8['shift']());}};_0x33a129(++_0x18f384);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xc8a02c,_0x4809d3){_0xc8a02c=_0xc8a02c-0x0;var _0x3d89da=_0xbdb7[_0xc8a02c];return _0x3d89da;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7bdb('0xe')](_0x7bdb('0xf'),auth[_0x7bdb('0x10')](),controller[_0x7bdb('0x11')]);router[_0x7bdb('0x12')](_0x7bdb('0xf'),auth[_0x7bdb('0x10')](),controller[_0x7bdb('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index eb866dc..fb067f8 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 _0x77ca=['sequelize','exports','TEXT'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x77ca,0x15f));var _0xa77c=function(_0xe5228,_0x4255a0){_0xe5228=_0xe5228-0x0;var _0x1b14e0=_0x77ca[_0xe5228];return _0x1b14e0;};'use strict';var Sequelize=require(_0xa77c('0x0'));module[_0xa77c('0x1')]={'tree':{'type':Sequelize[_0xa77c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf3ff=['sequelize','exports','TEXT'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xf3ff,0x10b));var _0xff3f=function(_0x541665,_0x334c41){_0x541665=_0x541665-0x0;var _0x3b6923=_0xf3ff[_0x541665];return _0x3b6923;};'use strict';var Sequelize=require(_0xff3f('0x0'));module[_0xff3f('0x1')]={'tree':{'type':Sequelize[_0xff3f('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 4bb8296..64cedd0 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 _0x795c=['stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','params','keys','length','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','sendStatus','error'];(function(_0x42580e,_0x2b650c){var _0xe52227=function(_0x25ec8a){while(--_0x25ec8a){_0x42580e['push'](_0x42580e['shift']());}};_0xe52227(++_0x2b650c);}(_0x795c,0x1e1));var _0xc795=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x795c[_0x481bf7];return _0x461787;};'use strict';var emlformat=require(_0xc795('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc795('0x1'));var jsonpatch=require(_0xc795('0x2'));var rp=require(_0xc795('0x3'));var moment=require(_0xc795('0x4'));var BPromise=require(_0xc795('0x5'));var Mustache=require(_0xc795('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc795('0x7'));var csv=require('to-csv');var ejs=require(_0xc795('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc795('0x9'));var squel=require('squel');var crypto=require(_0xc795('0xa'));var jsforce=require(_0xc795('0xb'));var deskjs=require(_0xc795('0xc'));var toCsv=require(_0xc795('0xd'));var querystring=require(_0xc795('0xe'));var Papa=require('papaparse');var Redis=require(_0xc795('0xf'));var authService=require(_0xc795('0x10'));var qs=require(_0xc795('0x11'));var as=require(_0xc795('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc795('0x13'))(_0xc795('0x14'));var utils=require(_0xc795('0x15'));var config=require(_0xc795('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc795('0x17'))['db'];function respondWithStatusCode(_0x20343e,_0x43e803){_0x43e803=_0x43e803||0xcc;return function(_0x5452be){if(_0x5452be){return _0x20343e['sendStatus'](_0x43e803);}return _0x20343e[_0xc795('0x18')](_0x43e803)[_0xc795('0x19')]();};}function respondWithResult(_0x449c14,_0x31cd42){_0x31cd42=_0x31cd42||0xc8;return function(_0x5e3275){if(_0x5e3275){return _0x449c14['status'](_0x31cd42)[_0xc795('0x1a')](_0x5e3275);}};}function respondWithFilteredResult(_0x28d0cb,_0x2feb40){return function(_0x5976d1){if(_0x5976d1){var _0x54c4e1=typeof _0x2feb40['offset']===_0xc795('0x1b')&&typeof _0x2feb40[_0xc795('0x1c')]===_0xc795('0x1b');var _0x39c0e3=_0x5976d1[_0xc795('0x1d')];var _0x233e06=_0x54c4e1?0x0:_0x2feb40[_0xc795('0x1e')];var _0x82fae3=_0x54c4e1?_0x5976d1[_0xc795('0x1d')]:_0x2feb40[_0xc795('0x1e')]+_0x2feb40[_0xc795('0x1c')];var _0x3b8f0f;if(_0x82fae3>=_0x39c0e3){_0x82fae3=_0x39c0e3;_0x3b8f0f=0xc8;}else{_0x3b8f0f=0xce;}_0x28d0cb['status'](_0x3b8f0f);return _0x28d0cb[_0xc795('0x1f')](_0xc795('0x20'),_0x233e06+'-'+_0x82fae3+'/'+_0x39c0e3)['json'](_0x5976d1);}return null;};}function patchUpdates(_0x4e8551){return function(_0x42902d){try{jsonpatch['apply'](_0x42902d,_0x4e8551,!![]);}catch(_0x50c1f2){return BPromise[_0xc795('0x21')](_0x50c1f2);}return _0x42902d['save']();};}function saveUpdates(_0x887988,_0x1b42d6){return function(_0x59c293){if(_0x59c293){return _0x59c293[_0xc795('0x22')](_0x887988)['then'](function(_0x2aeff1){return _0x2aeff1;});}return null;};}function removeEntity(_0x27217f,_0x8a12a9){return function(_0x2b2387){if(_0x2b2387){return _0x2b2387['destroy']()['then'](function(){_0x27217f[_0xc795('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b3611,_0x410713){return function(_0x22273a){if(!_0x22273a){_0x1b3611[_0xc795('0x23')](0x194);}return _0x22273a;};}function handleError(_0x437590,_0x2f00fe){_0x2f00fe=_0x2f00fe||0x1f4;return function(_0x559bd3){logger[_0xc795('0x24')](_0x559bd3[_0xc795('0x25')]);if(_0x559bd3[_0xc795('0x26')]){delete _0x559bd3['name'];}_0x437590['status'](_0x2f00fe)[_0xc795('0x27')](_0x559bd3);};}exports[_0xc795('0x28')]=function(_0x2f3274,_0x5a71e6){var _0x299c64={},_0x33d6ad={},_0x50d98b={'count':0x0,'rows':[]};var _0xace2ce=_[_0xc795('0x29')](db[_0xc795('0x2a')][_0xc795('0x2b')],function(_0x178c84){return{'name':_0x178c84[_0xc795('0x2c')],'type':_0x178c84[_0xc795('0x2d')][_0xc795('0x2e')]};});_0x33d6ad[_0xc795('0x2f')]=_[_0xc795('0x29')](_0xace2ce,_0xc795('0x26'));_0x33d6ad['query']=_['keys'](_0x2f3274[_0xc795('0x30')]);_0x33d6ad[_0xc795('0x31')]=_[_0xc795('0x32')](_0x33d6ad[_0xc795('0x2f')],_0x33d6ad[_0xc795('0x30')]);_0x299c64[_0xc795('0x33')]=_[_0xc795('0x32')](_0x33d6ad[_0xc795('0x2f')],qs[_0xc795('0x34')](_0x2f3274[_0xc795('0x30')][_0xc795('0x34')]));_0x299c64[_0xc795('0x33')]=_0x299c64['attributes']['length']?_0x299c64['attributes']:_0x33d6ad[_0xc795('0x2f')];if(!_0x2f3274[_0xc795('0x30')]['hasOwnProperty'](_0xc795('0x35'))){_0x299c64[_0xc795('0x1c')]=qs[_0xc795('0x1c')](_0x2f3274[_0xc795('0x30')][_0xc795('0x1c')]);_0x299c64[_0xc795('0x1e')]=qs[_0xc795('0x1e')](_0x2f3274[_0xc795('0x30')][_0xc795('0x1e')]);}_0x299c64[_0xc795('0x36')]=qs[_0xc795('0x37')](_0x2f3274[_0xc795('0x30')][_0xc795('0x37')]);_0x299c64[_0xc795('0x38')]=qs[_0xc795('0x31')](_['pick'](_0x2f3274[_0xc795('0x30')],_0x33d6ad[_0xc795('0x31')]),_0xace2ce);if(_0x2f3274['query'][_0xc795('0x39')]){_0x299c64[_0xc795('0x38')]=_[_0xc795('0x3a')](_0x299c64[_0xc795('0x38')],{'$or':_[_0xc795('0x29')](_0xace2ce,function(_0x427424){if(_0x427424[_0xc795('0x2d')]!==_0xc795('0x3b')){var _0x3403e6={};_0x3403e6[_0x427424[_0xc795('0x26')]]={'$like':'%'+_0x2f3274[_0xc795('0x30')][_0xc795('0x39')]+'%'};return _0x3403e6;}})});}_0x299c64=_['merge']({},_0x299c64,_0x2f3274[_0xc795('0x3c')]);var _0x5a48b8={'where':_0x299c64[_0xc795('0x38')]};return db[_0xc795('0x2a')][_0xc795('0x1d')](_0x5a48b8)['then'](function(_0x23b603){_0x50d98b[_0xc795('0x1d')]=_0x23b603;if(_0x2f3274[_0xc795('0x30')][_0xc795('0x3d')]){_0x299c64[_0xc795('0x3e')]=[{'all':!![]}];}return db[_0xc795('0x2a')][_0xc795('0x3f')](_0x299c64);})[_0xc795('0x40')](function(_0x1c7487){_0x50d98b[_0xc795('0x41')]=_0x1c7487;return _0x50d98b;})[_0xc795('0x40')](respondWithFilteredResult(_0x5a71e6,_0x299c64))[_0xc795('0x42')](handleError(_0x5a71e6,null));};exports['show']=function(_0x432faa,_0x1f245e){var _0x57a2b7={'raw':!![],'where':{'id':_0x432faa[_0xc795('0x43')]['id']}},_0xfbe3e9={};_0xfbe3e9[_0xc795('0x2f')]=_[_0xc795('0x44')](db['AnalyticTreeReport']['rawAttributes']);_0xfbe3e9[_0xc795('0x30')]=_['keys'](_0x432faa[_0xc795('0x30')]);_0xfbe3e9[_0xc795('0x31')]=_[_0xc795('0x32')](_0xfbe3e9['model'],_0xfbe3e9[_0xc795('0x30')]);_0x57a2b7[_0xc795('0x33')]=_[_0xc795('0x32')](_0xfbe3e9[_0xc795('0x2f')],qs[_0xc795('0x34')](_0x432faa['query'][_0xc795('0x34')]));_0x57a2b7[_0xc795('0x33')]=_0x57a2b7[_0xc795('0x33')][_0xc795('0x45')]?_0x57a2b7[_0xc795('0x33')]:_0xfbe3e9[_0xc795('0x2f')];if(_0x432faa['query'][_0xc795('0x3d')]){_0x57a2b7[_0xc795('0x3e')]=[{'all':!![]}];}_0x57a2b7=_['merge']({},_0x57a2b7,_0x432faa[_0xc795('0x3c')]);return db[_0xc795('0x2a')][_0xc795('0x46')](_0x57a2b7)[_0xc795('0x40')](handleEntityNotFound(_0x1f245e,null))[_0xc795('0x40')](respondWithResult(_0x1f245e,null))[_0xc795('0x42')](handleError(_0x1f245e,null));};exports[_0xc795('0x47')]=function(_0x85c11b,_0x54ad92){return db[_0xc795('0x2a')][_0xc795('0x47')](_0x85c11b[_0xc795('0x48')],{})[_0xc795('0x40')](respondWithResult(_0x54ad92,0xc9))['catch'](handleError(_0x54ad92,null));};exports[_0xc795('0x22')]=function(_0x992cf8,_0x19f112){if(_0x992cf8['body']['id']){delete _0x992cf8[_0xc795('0x48')]['id'];}return db[_0xc795('0x2a')]['find']({'where':{'id':_0x992cf8[_0xc795('0x43')]['id']}})[_0xc795('0x40')](handleEntityNotFound(_0x19f112,null))[_0xc795('0x40')](saveUpdates(_0x992cf8[_0xc795('0x48')],null))[_0xc795('0x40')](respondWithResult(_0x19f112,null))['catch'](handleError(_0x19f112,null));};exports[_0xc795('0x49')]=function(_0x5431fb,_0x1a9c29){return db[_0xc795('0x2a')]['find']({'where':{'id':_0x5431fb[_0xc795('0x43')]['id']}})[_0xc795('0x40')](handleEntityNotFound(_0x1a9c29,null))[_0xc795('0x40')](removeEntity(_0x1a9c29,null))['catch'](handleError(_0x1a9c29,null));}; \ No newline at end of file +var _0x67b1=['end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x67b1,0x15d));var _0x167b=function(_0x28e74e,_0x53fdf1){_0x28e74e=_0x28e74e-0x0;var _0xb45ac1=_0x67b1[_0x28e74e];return _0xb45ac1;};'use strict';var emlformat=require(_0x167b('0x0'));var rimraf=require(_0x167b('0x1'));var zipdir=require(_0x167b('0x2'));var jsonpatch=require(_0x167b('0x3'));var rp=require(_0x167b('0x4'));var moment=require(_0x167b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x167b('0x6'));var util=require(_0x167b('0x7'));var path=require(_0x167b('0x8'));var sox=require(_0x167b('0x9'));var csv=require(_0x167b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x167b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x167b('0xc'));var jsforce=require(_0x167b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x167b('0xa'));var querystring=require(_0x167b('0xe'));var Papa=require(_0x167b('0xf'));var Redis=require('ioredis');var authService=require(_0x167b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x167b('0x11'));var hardwareService=require(_0x167b('0x12'));var logger=require(_0x167b('0x13'))(_0x167b('0x14'));var utils=require(_0x167b('0x15'));var config=require(_0x167b('0x16'));var licenseUtil=require(_0x167b('0x17'));var db=require(_0x167b('0x18'))['db'];function respondWithStatusCode(_0x508988,_0x1c4c72){_0x1c4c72=_0x1c4c72||0xcc;return function(_0x557ed2){if(_0x557ed2){return _0x508988['sendStatus'](_0x1c4c72);}return _0x508988[_0x167b('0x19')](_0x1c4c72)[_0x167b('0x1a')]();};}function respondWithResult(_0x28f869,_0x59cc38){_0x59cc38=_0x59cc38||0xc8;return function(_0x441d52){if(_0x441d52){return _0x28f869['status'](_0x59cc38)[_0x167b('0x1b')](_0x441d52);}};}function respondWithFilteredResult(_0x52d387,_0x27dae6){return function(_0x4e6198){if(_0x4e6198){var _0x45b52e=typeof _0x27dae6[_0x167b('0x1c')]===_0x167b('0x1d')&&typeof _0x27dae6['limit']===_0x167b('0x1d');var _0x1133f2=_0x4e6198['count'];var _0x126300=_0x45b52e?0x0:_0x27dae6[_0x167b('0x1c')];var _0x377be5=_0x45b52e?_0x4e6198[_0x167b('0x1e')]:_0x27dae6['offset']+_0x27dae6[_0x167b('0x1f')];var _0x20a340;if(_0x377be5>=_0x1133f2){_0x377be5=_0x1133f2;_0x20a340=0xc8;}else{_0x20a340=0xce;}_0x52d387[_0x167b('0x19')](_0x20a340);return _0x52d387[_0x167b('0x20')](_0x167b('0x21'),_0x126300+'-'+_0x377be5+'/'+_0x1133f2)[_0x167b('0x1b')](_0x4e6198);}return null;};}function patchUpdates(_0x262806){return function(_0x732f43){try{jsonpatch[_0x167b('0x22')](_0x732f43,_0x262806,!![]);}catch(_0xcc14a5){return BPromise['reject'](_0xcc14a5);}return _0x732f43['save']();};}function saveUpdates(_0x14e381,_0x526289){return function(_0x3216a3){if(_0x3216a3){return _0x3216a3[_0x167b('0x23')](_0x14e381)[_0x167b('0x24')](function(_0x4f3160){return _0x4f3160;});}return null;};}function removeEntity(_0x254ab,_0x39a6bc){return function(_0xae0bc0){if(_0xae0bc0){return _0xae0bc0[_0x167b('0x25')]()[_0x167b('0x24')](function(){_0x254ab[_0x167b('0x19')](0xcc)[_0x167b('0x1a')]();});}};}function handleEntityNotFound(_0x4271fb,_0x4e279c){return function(_0xc7aba2){if(!_0xc7aba2){_0x4271fb['sendStatus'](0x194);}return _0xc7aba2;};}function handleError(_0x2589ee,_0x41bebc){_0x41bebc=_0x41bebc||0x1f4;return function(_0x25ce81){logger[_0x167b('0x26')](_0x25ce81[_0x167b('0x27')]);if(_0x25ce81[_0x167b('0x28')]){delete _0x25ce81[_0x167b('0x28')];}_0x2589ee[_0x167b('0x19')](_0x41bebc)[_0x167b('0x29')](_0x25ce81);};}exports[_0x167b('0x2a')]=function(_0x4ba2a2,_0x48aef4){var _0x18cc4c={},_0x593c77={},_0x3a4b70={'count':0x0,'rows':[]};var _0xf91dc7=_[_0x167b('0x2b')](db[_0x167b('0x2c')][_0x167b('0x2d')],function(_0x4f6c64){return{'name':_0x4f6c64[_0x167b('0x2e')],'type':_0x4f6c64['type'][_0x167b('0x2f')]};});_0x593c77[_0x167b('0x30')]=_[_0x167b('0x2b')](_0xf91dc7,'name');_0x593c77[_0x167b('0x31')]=_[_0x167b('0x32')](_0x4ba2a2[_0x167b('0x31')]);_0x593c77[_0x167b('0x33')]=_[_0x167b('0x34')](_0x593c77[_0x167b('0x30')],_0x593c77[_0x167b('0x31')]);_0x18cc4c[_0x167b('0x35')]=_[_0x167b('0x34')](_0x593c77[_0x167b('0x30')],qs[_0x167b('0x36')](_0x4ba2a2['query']['fields']));_0x18cc4c[_0x167b('0x35')]=_0x18cc4c[_0x167b('0x35')][_0x167b('0x37')]?_0x18cc4c[_0x167b('0x35')]:_0x593c77[_0x167b('0x30')];if(!_0x4ba2a2[_0x167b('0x31')][_0x167b('0x38')](_0x167b('0x39'))){_0x18cc4c['limit']=qs['limit'](_0x4ba2a2['query'][_0x167b('0x1f')]);_0x18cc4c['offset']=qs[_0x167b('0x1c')](_0x4ba2a2[_0x167b('0x31')]['offset']);}_0x18cc4c[_0x167b('0x3a')]=qs[_0x167b('0x3b')](_0x4ba2a2[_0x167b('0x31')][_0x167b('0x3b')]);_0x18cc4c[_0x167b('0x3c')]=qs[_0x167b('0x33')](_[_0x167b('0x3d')](_0x4ba2a2[_0x167b('0x31')],_0x593c77['filters']),_0xf91dc7);if(_0x4ba2a2[_0x167b('0x31')]['filter']){_0x18cc4c[_0x167b('0x3c')]=_[_0x167b('0x3e')](_0x18cc4c['where'],{'$or':_['map'](_0xf91dc7,function(_0x3484f4){if(_0x3484f4['type']!=='VIRTUAL'){var _0xa2c8dd={};_0xa2c8dd[_0x3484f4[_0x167b('0x28')]]={'$like':'%'+_0x4ba2a2[_0x167b('0x31')][_0x167b('0x3f')]+'%'};return _0xa2c8dd;}})});}_0x18cc4c=_[_0x167b('0x3e')]({},_0x18cc4c,_0x4ba2a2[_0x167b('0x40')]);var _0x400208={'where':_0x18cc4c[_0x167b('0x3c')]};return db['AnalyticTreeReport'][_0x167b('0x1e')](_0x400208)[_0x167b('0x24')](function(_0x35fea8){_0x3a4b70[_0x167b('0x1e')]=_0x35fea8;if(_0x4ba2a2[_0x167b('0x31')][_0x167b('0x41')]){_0x18cc4c[_0x167b('0x42')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x167b('0x43')](_0x18cc4c);})['then'](function(_0x22acc4){_0x3a4b70[_0x167b('0x44')]=_0x22acc4;return _0x3a4b70;})['then'](respondWithFilteredResult(_0x48aef4,_0x18cc4c))[_0x167b('0x45')](handleError(_0x48aef4,null));};exports[_0x167b('0x46')]=function(_0x53b046,_0x3e9456){var _0x26427e={'raw':!![],'where':{'id':_0x53b046['params']['id']}},_0x1647d2={};_0x1647d2['model']=_['keys'](db[_0x167b('0x2c')][_0x167b('0x2d')]);_0x1647d2['query']=_['keys'](_0x53b046['query']);_0x1647d2[_0x167b('0x33')]=_[_0x167b('0x34')](_0x1647d2[_0x167b('0x30')],_0x1647d2['query']);_0x26427e[_0x167b('0x35')]=_[_0x167b('0x34')](_0x1647d2[_0x167b('0x30')],qs['fields'](_0x53b046[_0x167b('0x31')][_0x167b('0x36')]));_0x26427e['attributes']=_0x26427e[_0x167b('0x35')][_0x167b('0x37')]?_0x26427e[_0x167b('0x35')]:_0x1647d2['model'];if(_0x53b046[_0x167b('0x31')][_0x167b('0x41')]){_0x26427e[_0x167b('0x42')]=[{'all':!![]}];}_0x26427e=_['merge']({},_0x26427e,_0x53b046[_0x167b('0x40')]);return db[_0x167b('0x2c')][_0x167b('0x47')](_0x26427e)[_0x167b('0x24')](handleEntityNotFound(_0x3e9456,null))[_0x167b('0x24')](respondWithResult(_0x3e9456,null))['catch'](handleError(_0x3e9456,null));};exports[_0x167b('0x48')]=function(_0x1e7671,_0x24e422){return db[_0x167b('0x2c')][_0x167b('0x48')](_0x1e7671[_0x167b('0x49')],{})[_0x167b('0x24')](respondWithResult(_0x24e422,0xc9))[_0x167b('0x45')](handleError(_0x24e422,null));};exports['update']=function(_0x2ce8e6,_0x2de1a8){if(_0x2ce8e6[_0x167b('0x49')]['id']){delete _0x2ce8e6[_0x167b('0x49')]['id'];}return db[_0x167b('0x2c')]['find']({'where':{'id':_0x2ce8e6['params']['id']}})[_0x167b('0x24')](handleEntityNotFound(_0x2de1a8,null))[_0x167b('0x24')](saveUpdates(_0x2ce8e6['body'],null))[_0x167b('0x24')](respondWithResult(_0x2de1a8,null))[_0x167b('0x45')](handleError(_0x2de1a8,null));};exports['destroy']=function(_0x310a9a,_0x56ae12){return db[_0x167b('0x2c')][_0x167b('0x47')]({'where':{'id':_0x310a9a[_0x167b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56ae12,null))[_0x167b('0x24')](removeEntity(_0x56ae12,null))[_0x167b('0x45')](handleError(_0x56ae12,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 3068baf..b024232 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 _0x3f35=['AnalyticTreeReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./analyticTreeReport.attributes','define'];(function(_0x3fff0d,_0x2f7f1c){var _0x58d7e3=function(_0x5790cb){while(--_0x5790cb){_0x3fff0d['push'](_0x3fff0d['shift']());}};_0x58d7e3(++_0x2f7f1c);}(_0x3f35,0x1ae));var _0x53f3=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x3f35[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0x53f3('0x0'));var util=require(_0x53f3('0x1'));var logger=require(_0x53f3('0x2'))(_0x53f3('0x3'));var moment=require(_0x53f3('0x4'));var BPromise=require(_0x53f3('0x5'));var rp=require(_0x53f3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53f3('0x7'));var config=require('../../config/environment');var attributes=require(_0x53f3('0x8'));module['exports']=function(_0x1b84bf,_0x325130){return _0x1b84bf[_0x53f3('0x9')](_0x53f3('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e56=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0xf61c79,_0x43c6fa){var _0x127d26=function(_0x598bf6){while(--_0x598bf6){_0xf61c79['push'](_0xf61c79['shift']());}};_0x127d26(++_0x43c6fa);}(_0x0e56,0xf5));var _0x60e5=function(_0x486f67,_0x31a5ba){_0x486f67=_0x486f67-0x0;var _0x51e075=_0x0e56[_0x486f67];return _0x51e075;};'use strict';var _=require(_0x60e5('0x0'));var util=require(_0x60e5('0x1'));var logger=require('../../config/logger')(_0x60e5('0x2'));var moment=require(_0x60e5('0x3'));var BPromise=require('bluebird');var rp=require(_0x60e5('0x4'));var fs=require('fs');var path=require(_0x60e5('0x5'));var rimraf=require(_0x60e5('0x6'));var config=require(_0x60e5('0x7'));var attributes=require(_0x60e5('0x8'));module[_0x60e5('0x9')]=function(_0x25b3a4,_0x54422a){return _0x25b3a4[_0x60e5('0xa')](_0x60e5('0xb'),attributes,{'tableName':_0x60e5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 319b423..128d19f 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 _0xd896=['debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticTreeReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xd896,0xb8));var _0x6d89=function(_0x2641e9,_0x298654){_0x2641e9=_0x2641e9-0x0;var _0x5a5b0f=_0xd896[_0x2641e9];return _0x5a5b0f;};'use strict';var _=require(_0x6d89('0x0'));var util=require(_0x6d89('0x1'));var moment=require(_0x6d89('0x2'));var BPromise=require(_0x6d89('0x3'));var rs=require(_0x6d89('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d89('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6d89('0x6'));var config=require(_0x6d89('0x7'));var jayson=require(_0x6d89('0x8'));var client=jayson[_0x6d89('0x9')][_0x6d89('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x201a51,_0xd4330f,_0x214359){return new BPromise(function(_0x546d20,_0x1d92e6){return client['request'](_0x201a51,_0x214359)[_0x6d89('0xb')](function(_0x43cd52){logger[_0x6d89('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0xd4330f,_0x6d89('0xd'));logger[_0x6d89('0xe')](_0x6d89('0xf'),_0xd4330f,_0x6d89('0xd'),JSON[_0x6d89('0x10')](_0x43cd52));if(_0x43cd52[_0x6d89('0x11')]){if(_0x43cd52[_0x6d89('0x11')][_0x6d89('0x12')]===0x1f4){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0xd4330f,_0x43cd52[_0x6d89('0x11')][_0x6d89('0x13')]);return _0x1d92e6(_0x43cd52['error'][_0x6d89('0x13')]);}logger[_0x6d89('0x11')](_0x6d89('0x14'),_0xd4330f,_0x43cd52[_0x6d89('0x11')][_0x6d89('0x13')]);return _0x546d20(_0x43cd52['error']['message']);}else{logger[_0x6d89('0xc')](_0x6d89('0x14'),_0xd4330f,'request\x20sent');_0x546d20(_0x43cd52[_0x6d89('0x15')][_0x6d89('0x13')]);}})['catch'](function(_0xc6b220){logger[_0x6d89('0x11')](_0x6d89('0x14'),_0xd4330f,_0xc6b220);_0x1d92e6(_0xc6b220);});});} \ No newline at end of file +var _0xeb85=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util'];(function(_0x76f5bd,_0xe83ddb){var _0x59c523=function(_0x71947c){while(--_0x71947c){_0x76f5bd['push'](_0x76f5bd['shift']());}};_0x59c523(++_0xe83ddb);}(_0xeb85,0xb6));var _0x5eb8=function(_0x387580,_0x4e8c53){_0x387580=_0x387580-0x0;var _0x244aa0=_0xeb85[_0x387580];return _0x244aa0;};'use strict';var _=require(_0x5eb8('0x0'));var util=require(_0x5eb8('0x1'));var moment=require(_0x5eb8('0x2'));var BPromise=require(_0x5eb8('0x3'));var rs=require(_0x5eb8('0x4'));var fs=require('fs');var Redis=require(_0x5eb8('0x5'));var db=require(_0x5eb8('0x6'))['db'];var utils=require(_0x5eb8('0x7'));var logger=require('../../config/logger')(_0x5eb8('0x8'));var config=require(_0x5eb8('0x9'));var jayson=require(_0x5eb8('0xa'));var client=jayson[_0x5eb8('0xb')][_0x5eb8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e5dd6,_0x2ca7c8,_0x377d45){return new BPromise(function(_0x395d00,_0x5e47ee){return client[_0x5eb8('0xd')](_0x1e5dd6,_0x377d45)['then'](function(_0x231bcc){logger['info'](_0x5eb8('0xe'),_0x2ca7c8,_0x5eb8('0xf'));logger[_0x5eb8('0x10')](_0x5eb8('0x11'),_0x2ca7c8,'request\x20sent',JSON[_0x5eb8('0x12')](_0x231bcc));if(_0x231bcc['error']){if(_0x231bcc['error'][_0x5eb8('0x13')]===0x1f4){logger['error'](_0x5eb8('0xe'),_0x2ca7c8,_0x231bcc[_0x5eb8('0x14')][_0x5eb8('0x15')]);return _0x5e47ee(_0x231bcc[_0x5eb8('0x14')][_0x5eb8('0x15')]);}logger[_0x5eb8('0x14')](_0x5eb8('0xe'),_0x2ca7c8,_0x231bcc['error'][_0x5eb8('0x15')]);return _0x395d00(_0x231bcc[_0x5eb8('0x14')]['message']);}else{logger['info'](_0x5eb8('0xe'),_0x2ca7c8,_0x5eb8('0xf'));_0x395d00(_0x231bcc['result'][_0x5eb8('0x15')]);}})[_0x5eb8('0x16')](function(_0x1568a9){logger[_0x5eb8('0x14')](_0x5eb8('0xe'),_0x2ca7c8,_0x1568a9);_0x5e47ee(_0x1568a9);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index e81cd99..d24b06c 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 _0xc06e=['/:id','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x2643d1,_0x533989){var _0x34b74e=function(_0x2b73c8){while(--_0x2b73c8){_0x2643d1['push'](_0x2643d1['shift']());}};_0x34b74e(++_0x533989);}(_0xc06e,0xd5));var _0xec06=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xc06e[_0xca1f0e];return _0x35e4ef;};'use strict';var multer=require(_0xec06('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xec06('0x1'));var express=require(_0xec06('0x2'));var router=express[_0xec06('0x3')]();var fs_extra=require(_0xec06('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xec06('0x5'));var config=require(_0xec06('0x6'));var controller=require(_0xec06('0x7'));router[_0xec06('0x8')]('/',auth[_0xec06('0x9')](),controller[_0xec06('0xa')]);router['get']('/:id',auth[_0xec06('0x9')](),controller[_0xec06('0xb')]);router[_0xec06('0xc')]('/',auth['isAuthenticated'](),controller[_0xec06('0xd')]);router[_0xec06('0xe')](_0xec06('0xf'),auth[_0xec06('0x9')](),controller[_0xec06('0x10')]);router[_0xec06('0x11')](_0xec06('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xec06('0x12')]=router; \ No newline at end of file +var _0x44d9=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44d9,0x155));var _0x944d=function(_0x531d65,_0x489f0a){_0x531d65=_0x531d65-0x0;var _0x3b65ce=_0x44d9[_0x531d65];return _0x3b65ce;};'use strict';var multer=require(_0x944d('0x0'));var util=require(_0x944d('0x1'));var path=require(_0x944d('0x2'));var timeout=require(_0x944d('0x3'));var express=require(_0x944d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x944d('0x5'));var interaction=require(_0x944d('0x6'));var config=require('../../config/environment');var controller=require(_0x944d('0x7'));router['get']('/',auth[_0x944d('0x8')](),controller[_0x944d('0x9')]);router[_0x944d('0xa')](_0x944d('0xb'),auth[_0x944d('0x8')](),controller[_0x944d('0xc')]);router[_0x944d('0xd')]('/',auth['isAuthenticated'](),controller[_0x944d('0xe')]);router[_0x944d('0xf')](_0x944d('0xb'),auth['isAuthenticated'](),controller[_0x944d('0x10')]);router[_0x944d('0x11')](_0x944d('0xb'),auth[_0x944d('0x8')](),controller[_0x944d('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index daf2fa3..f8777b6 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 _0x1fce=['STRING','sequelize','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x1fce,0x1db));var _0xe1fc=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x1fce[_0x2a56ad];return _0x425175;};'use strict';var Sequelize=require(_0xe1fc('0x0'));module[_0xe1fc('0x1')]={'name':{'type':Sequelize[_0xe1fc('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0cb1=['STRING','exports'];(function(_0xf59e56,_0x57960a){var _0x42e155=function(_0xbd1f91){while(--_0xbd1f91){_0xf59e56['push'](_0xf59e56['shift']());}};_0x42e155(++_0x57960a);}(_0x0cb1,0x18b));var _0x10cb=function(_0x41271c,_0x2e505b){_0x41271c=_0x41271c-0x0;var _0x22c7a0=_0x0cb1[_0x41271c];return _0x22c7a0;};'use strict';var Sequelize=require('sequelize');module[_0x10cb('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x10cb('0x1')]},'type':{'type':Sequelize[_0x10cb('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index dcd74e6..74fe4d2 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 _0xe16e=['name','send','index','map','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','then','includeAll','findAll','catch','show','params','Attachment','include','clone','find','get','omit','createdAt','body','updatedAt','create','update','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','sendStatus','error','stack'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0xe16e,0x1df));var _0xee16=function(_0x54a761,_0x431fd4){_0x54a761=_0x54a761-0x0;var _0x37d1da=_0xe16e[_0x54a761];return _0x37d1da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee16('0x0'));var zipdir=require(_0xee16('0x1'));var jsonpatch=require(_0xee16('0x2'));var rp=require(_0xee16('0x3'));var moment=require('moment');var BPromise=require(_0xee16('0x4'));var Mustache=require(_0xee16('0x5'));var util=require(_0xee16('0x6'));var path=require('path');var sox=require(_0xee16('0x7'));var csv=require(_0xee16('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee16('0x9'));var squel=require(_0xee16('0xa'));var crypto=require(_0xee16('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xee16('0x8'));var querystring=require('querystring');var Papa=require(_0xee16('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xee16('0xd'));var as=require(_0xee16('0xe'));var hardwareService=require(_0xee16('0xf'));var logger=require(_0xee16('0x10'))(_0xee16('0x11'));var utils=require(_0xee16('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xee16('0x13'));var db=require(_0xee16('0x14'))['db'];function respondWithStatusCode(_0x1f3024,_0x533640){_0x533640=_0x533640||0xcc;return function(_0xc921d9){if(_0xc921d9){return _0x1f3024['sendStatus'](_0x533640);}return _0x1f3024[_0xee16('0x15')](_0x533640)[_0xee16('0x16')]();};}function respondWithResult(_0x209f93,_0xf73dba){_0xf73dba=_0xf73dba||0xc8;return function(_0x46dfdd){if(_0x46dfdd){return _0x209f93[_0xee16('0x15')](_0xf73dba)['json'](_0x46dfdd);}};}function respondWithFilteredResult(_0x5d9125,_0x184aef){return function(_0xb487c6){if(_0xb487c6){var _0x5c41d3=typeof _0x184aef[_0xee16('0x17')]===_0xee16('0x18')&&typeof _0x184aef[_0xee16('0x19')]===_0xee16('0x18');var _0x368458=_0xb487c6[_0xee16('0x1a')];var _0x57834d=_0x5c41d3?0x0:_0x184aef[_0xee16('0x17')];var _0x529baa=_0x5c41d3?_0xb487c6[_0xee16('0x1a')]:_0x184aef[_0xee16('0x17')]+_0x184aef[_0xee16('0x19')];var _0x22caeb;if(_0x529baa>=_0x368458){_0x529baa=_0x368458;_0x22caeb=0xc8;}else{_0x22caeb=0xce;}_0x5d9125[_0xee16('0x15')](_0x22caeb);return _0x5d9125[_0xee16('0x1b')](_0xee16('0x1c'),_0x57834d+'-'+_0x529baa+'/'+_0x368458)[_0xee16('0x1d')](_0xb487c6);}return null;};}function patchUpdates(_0x5eb3e0){return function(_0xdff893){try{jsonpatch[_0xee16('0x1e')](_0xdff893,_0x5eb3e0,!![]);}catch(_0x415644){return BPromise[_0xee16('0x1f')](_0x415644);}return _0xdff893[_0xee16('0x20')]();};}function saveUpdates(_0x15e9ad,_0x3a70e2){return function(_0x43e75a){if(_0x43e75a){return _0x43e75a['update'](_0x15e9ad)['then'](function(_0x583a8e){return _0x583a8e;});}return null;};}function removeEntity(_0x564623,_0x261f5f){return function(_0x4f617c){if(_0x4f617c){return _0x4f617c[_0xee16('0x21')]()['then'](function(){_0x564623[_0xee16('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5476f2,_0x4f3c8a){return function(_0x4e4550){if(!_0x4e4550){_0x5476f2[_0xee16('0x22')](0x194);}return _0x4e4550;};}function handleError(_0x5821f8,_0x171d34){_0x171d34=_0x171d34||0x1f4;return function(_0xb1a3be){logger[_0xee16('0x23')](_0xb1a3be[_0xee16('0x24')]);if(_0xb1a3be[_0xee16('0x25')]){delete _0xb1a3be[_0xee16('0x25')];}_0x5821f8[_0xee16('0x15')](_0x171d34)[_0xee16('0x26')](_0xb1a3be);};}exports[_0xee16('0x27')]=function(_0x25caaa,_0xfc370f){var _0x21e320={},_0x36d1fd={},_0x3e8afe={'count':0x0,'rows':[]};var _0x1e7bd2=_[_0xee16('0x28')](db['Attachment']['rawAttributes'],function(_0x4a775c){return{'name':_0x4a775c[_0xee16('0x29')],'type':_0x4a775c['type']['key']};});_0x36d1fd[_0xee16('0x2a')]=_[_0xee16('0x28')](_0x1e7bd2,'name');_0x36d1fd[_0xee16('0x2b')]=_[_0xee16('0x2c')](_0x25caaa[_0xee16('0x2b')]);_0x36d1fd['filters']=_[_0xee16('0x2d')](_0x36d1fd[_0xee16('0x2a')],_0x36d1fd[_0xee16('0x2b')]);_0x21e320[_0xee16('0x2e')]=_['intersection'](_0x36d1fd[_0xee16('0x2a')],qs['fields'](_0x25caaa[_0xee16('0x2b')][_0xee16('0x2f')]));_0x21e320[_0xee16('0x2e')]=_0x21e320[_0xee16('0x2e')][_0xee16('0x30')]?_0x21e320[_0xee16('0x2e')]:_0x36d1fd[_0xee16('0x2a')];if(!_0x25caaa[_0xee16('0x2b')][_0xee16('0x31')](_0xee16('0x32'))){_0x21e320[_0xee16('0x19')]=qs[_0xee16('0x19')](_0x25caaa['query']['limit']);_0x21e320['offset']=qs[_0xee16('0x17')](_0x25caaa['query'][_0xee16('0x17')]);}_0x21e320['order']=qs['sort'](_0x25caaa[_0xee16('0x2b')][_0xee16('0x33')]);_0x21e320[_0xee16('0x34')]=qs[_0xee16('0x35')](_[_0xee16('0x36')](_0x25caaa[_0xee16('0x2b')],_0x36d1fd[_0xee16('0x35')]),_0x1e7bd2);if(_0x25caaa[_0xee16('0x2b')][_0xee16('0x37')]){_0x21e320[_0xee16('0x34')]=_[_0xee16('0x38')](_0x21e320['where'],{'$or':_[_0xee16('0x28')](_0x1e7bd2,function(_0x269f7f){if(_0x269f7f[_0xee16('0x39')]!==_0xee16('0x3a')){var _0x304dd6={};_0x304dd6[_0x269f7f[_0xee16('0x25')]]={'$like':'%'+_0x25caaa[_0xee16('0x2b')][_0xee16('0x37')]+'%'};return _0x304dd6;}})});}_0x21e320=_[_0xee16('0x38')]({},_0x21e320,_0x25caaa[_0xee16('0x3b')]);var _0x2deeba={'where':_0x21e320[_0xee16('0x34')]};return db['Attachment'][_0xee16('0x1a')](_0x2deeba)[_0xee16('0x3c')](function(_0x4abf93){_0x3e8afe['count']=_0x4abf93;if(_0x25caaa[_0xee16('0x2b')][_0xee16('0x3d')]){_0x21e320['include']=[{'all':!![]}];}return db['Attachment'][_0xee16('0x3e')](_0x21e320);})['then'](function(_0x44702b){_0x3e8afe['rows']=_0x44702b;return _0x3e8afe;})[_0xee16('0x3c')](respondWithFilteredResult(_0xfc370f,_0x21e320))[_0xee16('0x3f')](handleError(_0xfc370f,null));};exports[_0xee16('0x40')]=function(_0x5ab0eb,_0x3c103f){var _0x288e68={'raw':!![],'where':{'id':_0x5ab0eb[_0xee16('0x41')]['id']}},_0x549871={};_0x549871[_0xee16('0x2a')]=_['keys'](db[_0xee16('0x42')]['rawAttributes']);_0x549871[_0xee16('0x2b')]=_[_0xee16('0x2c')](_0x5ab0eb[_0xee16('0x2b')]);_0x549871[_0xee16('0x35')]=_[_0xee16('0x2d')](_0x549871[_0xee16('0x2a')],_0x549871[_0xee16('0x2b')]);_0x288e68['attributes']=_[_0xee16('0x2d')](_0x549871[_0xee16('0x2a')],qs[_0xee16('0x2f')](_0x5ab0eb[_0xee16('0x2b')][_0xee16('0x2f')]));_0x288e68[_0xee16('0x2e')]=_0x288e68['attributes'][_0xee16('0x30')]?_0x288e68[_0xee16('0x2e')]:_0x549871['model'];if(_0x5ab0eb[_0xee16('0x2b')]['includeAll']){_0x288e68[_0xee16('0x43')]=[{'all':!![]}];}_0x288e68=_[_0xee16('0x38')]({},_0x288e68,_0x5ab0eb[_0xee16('0x3b')]);return db['Attachment']['find'](_0x288e68)['then'](handleEntityNotFound(_0x3c103f,null))[_0xee16('0x3c')](respondWithResult(_0x3c103f,null))[_0xee16('0x3f')](handleError(_0x3c103f,null));};exports[_0xee16('0x44')]=function(_0xd3e76d,_0x50011b){var _0x3102e3={'where':{'id':_0xd3e76d['params']['id']}},_0x131fcd={};_0x131fcd[_0xee16('0x2a')]=_['keys'](db['Attachment']['rawAttributes']);_0x3102e3[_0xee16('0x2e')]=_['intersection'](_0x131fcd[_0xee16('0x2a')],qs[_0xee16('0x2f')](_0xd3e76d[_0xee16('0x2b')][_0xee16('0x2f')]));_0x3102e3[_0xee16('0x2e')]=_0x3102e3[_0xee16('0x2e')][_0xee16('0x30')]?_0x3102e3[_0xee16('0x2e')]:_0x131fcd[_0xee16('0x2a')];if(_0xd3e76d[_0xee16('0x2b')]['includeAll']){_0x3102e3['include']=[{'all':!![]}];}_0x3102e3=_[_0xee16('0x38')]({},_0x3102e3,_0xd3e76d['options']);return db[_0xee16('0x42')][_0xee16('0x45')](_0x3102e3)['then'](handleEntityNotFound(_0x50011b,null))['then'](function(_0x201bd3){if(_0x201bd3){var _0x2c63f6=_0x201bd3[_0xee16('0x46')]({'plain':!![]});_0x2c63f6=qs[_0xee16('0x47')](_0x2c63f6,['id',_0xee16('0x48'),'updatedAt']);_0xd3e76d[_0xee16('0x49')]=_['omit'](_0xd3e76d[_0xee16('0x49')],['id',_0xee16('0x48'),_0xee16('0x4a')]);return db[_0xee16('0x42')][_0xee16('0x4b')](_[_0xee16('0x38')](_0x2c63f6,_0xd3e76d['body']),{'include':_0xd3e76d[_0xee16('0x2b')][_0xee16('0x3d')]?[{'all':!![]}]:undefined});}})[_0xee16('0x3c')](respondWithResult(_0x50011b,0xc9))['catch'](handleError(_0x50011b,null));};exports[_0xee16('0x4c')]=function(_0x42d541,_0x23f06f){if(_0x42d541[_0xee16('0x49')]['id']){delete _0x42d541['body']['id'];}return db[_0xee16('0x42')][_0xee16('0x45')]({'where':{'id':_0x42d541[_0xee16('0x41')]['id']}})[_0xee16('0x3c')](handleEntityNotFound(_0x23f06f,null))[_0xee16('0x3c')](saveUpdates(_0x42d541[_0xee16('0x49')],null))[_0xee16('0x3c')](respondWithResult(_0x23f06f,null))[_0xee16('0x3f')](handleError(_0x23f06f,null));};exports[_0xee16('0x21')]=function(_0x198009,_0x4850d4){return db[_0xee16('0x42')]['find']({'where':{'id':_0x198009['params']['id']}})[_0xee16('0x3c')](handleEntityNotFound(_0x4850d4,null))[_0xee16('0x3c')](removeEntity(_0x4850d4,null))['catch'](handleError(_0x4850d4,null));};exports[_0xee16('0x4b')]=function(_0x111424,_0x341aa1,_0x40275b){_0x111424[_0xee16('0x49')]['name']=_0x111424[_0xee16('0x4d')][_0xee16('0x4e')];_0x111424['body'][_0xee16('0x4f')]=_0x111424[_0xee16('0x4d')][_0xee16('0x50')];_0x111424[_0xee16('0x49')][_0xee16('0x39')]=_0x111424['file']['mimetype'];return db['Attachment'][_0xee16('0x4b')](_0x111424[_0xee16('0x49')])['then'](respondWithResult(_0x341aa1,0xc9))[_0xee16('0x3f')](handleError(_0x341aa1,null));};exports[_0xee16('0x51')]=function(_0x534dbb,_0x57423d,_0x4ed436){return db['Attachment'][_0xee16('0x52')]({'where':{'id':_0x534dbb['params']['id']},'raw':!![]})[_0xee16('0x3c')](handleEntityNotFound(_0x57423d,null))[_0xee16('0x3c')](function(_0x312212){if(_0x312212){var _0x35b20a=_0x312212[_0xee16('0x53')]!==null;var _0x320b7d=path[_0xee16('0x54')](config['root'],'server/files/attachments/');if(_0x35b20a){_0x320b7d=path[_0xee16('0x54')](_0x320b7d,_0xee16('0x55'));}var _0x2d868a=path[_0xee16('0x54')](_0x320b7d,_0x312212[_0xee16('0x4f')]);return _0x57423d[_0xee16('0x51')](_0x2d868a);}})[_0xee16('0x3f')](handleError(_0x57423d,null));}; \ No newline at end of file +var _0x37f8=['query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Attachment','includeAll','findAll','rows','params','include','find','catch','omit','updatedAt','body','createdAt','update','create','originalname','basename','file','filename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','reject','then','destroy','stack','name','send','index','rawAttributes','fieldName','key','map','keys'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x37f8,0x1d2));var _0x837f=function(_0x43c92a,_0x7292bb){_0x43c92a=_0x43c92a-0x0;var _0x584e28=_0x37f8[_0x43c92a];return _0x584e28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x837f('0x0'));var zipdir=require(_0x837f('0x1'));var jsonpatch=require(_0x837f('0x2'));var rp=require(_0x837f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x837f('0x4'));var util=require('util');var path=require('path');var sox=require(_0x837f('0x5'));var csv=require(_0x837f('0x6'));var ejs=require(_0x837f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x837f('0x8'));var squel=require(_0x837f('0x9'));var crypto=require(_0x837f('0xa'));var jsforce=require(_0x837f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x837f('0x6'));var querystring=require(_0x837f('0xc'));var Papa=require(_0x837f('0xd'));var Redis=require(_0x837f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x837f('0xf'));var hardwareService=require(_0x837f('0x10'));var logger=require(_0x837f('0x11'))('api');var utils=require(_0x837f('0x12'));var config=require(_0x837f('0x13'));var licenseUtil=require(_0x837f('0x14'));var db=require(_0x837f('0x15'))['db'];function respondWithStatusCode(_0x23df85,_0x278d16){_0x278d16=_0x278d16||0xcc;return function(_0x49b3d2){if(_0x49b3d2){return _0x23df85[_0x837f('0x16')](_0x278d16);}return _0x23df85['status'](_0x278d16)[_0x837f('0x17')]();};}function respondWithResult(_0x403df2,_0x4cd961){_0x4cd961=_0x4cd961||0xc8;return function(_0x155aff){if(_0x155aff){return _0x403df2[_0x837f('0x18')](_0x4cd961)[_0x837f('0x19')](_0x155aff);}};}function respondWithFilteredResult(_0x4ca7a0,_0x5cc388){return function(_0x4cc7db){if(_0x4cc7db){var _0x56c127=typeof _0x5cc388['offset']===_0x837f('0x1a')&&typeof _0x5cc388['limit']===_0x837f('0x1a');var _0x43061f=_0x4cc7db['count'];var _0x50ae29=_0x56c127?0x0:_0x5cc388['offset'];var _0x26d02e=_0x56c127?_0x4cc7db[_0x837f('0x1b')]:_0x5cc388[_0x837f('0x1c')]+_0x5cc388[_0x837f('0x1d')];var _0x597952;if(_0x26d02e>=_0x43061f){_0x26d02e=_0x43061f;_0x597952=0xc8;}else{_0x597952=0xce;}_0x4ca7a0[_0x837f('0x18')](_0x597952);return _0x4ca7a0[_0x837f('0x1e')](_0x837f('0x1f'),_0x50ae29+'-'+_0x26d02e+'/'+_0x43061f)[_0x837f('0x19')](_0x4cc7db);}return null;};}function patchUpdates(_0xda5609){return function(_0x2cdf4d){try{jsonpatch['apply'](_0x2cdf4d,_0xda5609,!![]);}catch(_0x302858){return BPromise[_0x837f('0x20')](_0x302858);}return _0x2cdf4d['save']();};}function saveUpdates(_0x3cd873,_0x1c699e){return function(_0x22c85c){if(_0x22c85c){return _0x22c85c['update'](_0x3cd873)[_0x837f('0x21')](function(_0x39b770){return _0x39b770;});}return null;};}function removeEntity(_0x510af3,_0x595ac3){return function(_0x12439d){if(_0x12439d){return _0x12439d[_0x837f('0x22')]()['then'](function(){_0x510af3[_0x837f('0x18')](0xcc)[_0x837f('0x17')]();});}};}function handleEntityNotFound(_0xe24b7d,_0xa9dd13){return function(_0x474028){if(!_0x474028){_0xe24b7d[_0x837f('0x16')](0x194);}return _0x474028;};}function handleError(_0x12bc75,_0x17d5fe){_0x17d5fe=_0x17d5fe||0x1f4;return function(_0x2df407){logger['error'](_0x2df407[_0x837f('0x23')]);if(_0x2df407['name']){delete _0x2df407[_0x837f('0x24')];}_0x12bc75[_0x837f('0x18')](_0x17d5fe)[_0x837f('0x25')](_0x2df407);};}exports[_0x837f('0x26')]=function(_0x435468,_0x43b35c){var _0xf19e0a={},_0x40a7e9={},_0x505559={'count':0x0,'rows':[]};var _0x47d3a9=_['map'](db['Attachment'][_0x837f('0x27')],function(_0x280776){return{'name':_0x280776[_0x837f('0x28')],'type':_0x280776['type'][_0x837f('0x29')]};});_0x40a7e9['model']=_[_0x837f('0x2a')](_0x47d3a9,_0x837f('0x24'));_0x40a7e9['query']=_[_0x837f('0x2b')](_0x435468[_0x837f('0x2c')]);_0x40a7e9[_0x837f('0x2d')]=_[_0x837f('0x2e')](_0x40a7e9[_0x837f('0x2f')],_0x40a7e9[_0x837f('0x2c')]);_0xf19e0a[_0x837f('0x30')]=_[_0x837f('0x2e')](_0x40a7e9[_0x837f('0x2f')],qs['fields'](_0x435468[_0x837f('0x2c')][_0x837f('0x31')]));_0xf19e0a[_0x837f('0x30')]=_0xf19e0a[_0x837f('0x30')][_0x837f('0x32')]?_0xf19e0a['attributes']:_0x40a7e9[_0x837f('0x2f')];if(!_0x435468[_0x837f('0x2c')][_0x837f('0x33')]('nolimit')){_0xf19e0a['limit']=qs['limit'](_0x435468[_0x837f('0x2c')][_0x837f('0x1d')]);_0xf19e0a[_0x837f('0x1c')]=qs['offset'](_0x435468[_0x837f('0x2c')][_0x837f('0x1c')]);}_0xf19e0a[_0x837f('0x34')]=qs['sort'](_0x435468[_0x837f('0x2c')][_0x837f('0x35')]);_0xf19e0a[_0x837f('0x36')]=qs['filters'](_[_0x837f('0x37')](_0x435468['query'],_0x40a7e9[_0x837f('0x2d')]),_0x47d3a9);if(_0x435468[_0x837f('0x2c')][_0x837f('0x38')]){_0xf19e0a[_0x837f('0x36')]=_[_0x837f('0x39')](_0xf19e0a[_0x837f('0x36')],{'$or':_[_0x837f('0x2a')](_0x47d3a9,function(_0x31dde0){if(_0x31dde0[_0x837f('0x3a')]!==_0x837f('0x3b')){var _0x10b5c7={};_0x10b5c7[_0x31dde0[_0x837f('0x24')]]={'$like':'%'+_0x435468[_0x837f('0x2c')][_0x837f('0x38')]+'%'};return _0x10b5c7;}})});}_0xf19e0a=_[_0x837f('0x39')]({},_0xf19e0a,_0x435468[_0x837f('0x3c')]);var _0x224c4b={'where':_0xf19e0a[_0x837f('0x36')]};return db[_0x837f('0x3d')][_0x837f('0x1b')](_0x224c4b)['then'](function(_0x591c9a){_0x505559[_0x837f('0x1b')]=_0x591c9a;if(_0x435468['query'][_0x837f('0x3e')]){_0xf19e0a['include']=[{'all':!![]}];}return db['Attachment'][_0x837f('0x3f')](_0xf19e0a);})['then'](function(_0xdf0b56){_0x505559[_0x837f('0x40')]=_0xdf0b56;return _0x505559;})['then'](respondWithFilteredResult(_0x43b35c,_0xf19e0a))['catch'](handleError(_0x43b35c,null));};exports['show']=function(_0x5f32cb,_0x50102d){var _0x279d52={'raw':!![],'where':{'id':_0x5f32cb[_0x837f('0x41')]['id']}},_0x22564b={};_0x22564b['model']=_[_0x837f('0x2b')](db['Attachment']['rawAttributes']);_0x22564b[_0x837f('0x2c')]=_[_0x837f('0x2b')](_0x5f32cb[_0x837f('0x2c')]);_0x22564b[_0x837f('0x2d')]=_[_0x837f('0x2e')](_0x22564b['model'],_0x22564b[_0x837f('0x2c')]);_0x279d52['attributes']=_[_0x837f('0x2e')](_0x22564b[_0x837f('0x2f')],qs[_0x837f('0x31')](_0x5f32cb[_0x837f('0x2c')][_0x837f('0x31')]));_0x279d52[_0x837f('0x30')]=_0x279d52[_0x837f('0x30')][_0x837f('0x32')]?_0x279d52[_0x837f('0x30')]:_0x22564b[_0x837f('0x2f')];if(_0x5f32cb['query'][_0x837f('0x3e')]){_0x279d52[_0x837f('0x42')]=[{'all':!![]}];}_0x279d52=_[_0x837f('0x39')]({},_0x279d52,_0x5f32cb[_0x837f('0x3c')]);return db[_0x837f('0x3d')][_0x837f('0x43')](_0x279d52)[_0x837f('0x21')](handleEntityNotFound(_0x50102d,null))[_0x837f('0x21')](respondWithResult(_0x50102d,null))[_0x837f('0x44')](handleError(_0x50102d,null));};exports['clone']=function(_0x272d9a,_0x54a312){var _0x4eafb9={'where':{'id':_0x272d9a[_0x837f('0x41')]['id']}},_0x2e1075={};_0x2e1075[_0x837f('0x2f')]=_[_0x837f('0x2b')](db[_0x837f('0x3d')][_0x837f('0x27')]);_0x4eafb9['attributes']=_[_0x837f('0x2e')](_0x2e1075[_0x837f('0x2f')],qs['fields'](_0x272d9a[_0x837f('0x2c')]['fields']));_0x4eafb9[_0x837f('0x30')]=_0x4eafb9[_0x837f('0x30')]['length']?_0x4eafb9[_0x837f('0x30')]:_0x2e1075[_0x837f('0x2f')];if(_0x272d9a['query'][_0x837f('0x3e')]){_0x4eafb9['include']=[{'all':!![]}];}_0x4eafb9=_[_0x837f('0x39')]({},_0x4eafb9,_0x272d9a[_0x837f('0x3c')]);return db[_0x837f('0x3d')][_0x837f('0x43')](_0x4eafb9)['then'](handleEntityNotFound(_0x54a312,null))['then'](function(_0x537d5b){if(_0x537d5b){var _0x141e4a=_0x537d5b['get']({'plain':!![]});_0x141e4a=qs[_0x837f('0x45')](_0x141e4a,['id','createdAt',_0x837f('0x46')]);_0x272d9a['body']=_[_0x837f('0x45')](_0x272d9a[_0x837f('0x47')],['id',_0x837f('0x48'),_0x837f('0x46')]);return db[_0x837f('0x3d')]['create'](_['merge'](_0x141e4a,_0x272d9a[_0x837f('0x47')]),{'include':_0x272d9a['query'][_0x837f('0x3e')]?[{'all':!![]}]:undefined});}})[_0x837f('0x21')](respondWithResult(_0x54a312,0xc9))['catch'](handleError(_0x54a312,null));};exports[_0x837f('0x49')]=function(_0x45b4f9,_0x260f63){if(_0x45b4f9[_0x837f('0x47')]['id']){delete _0x45b4f9[_0x837f('0x47')]['id'];}return db[_0x837f('0x3d')][_0x837f('0x43')]({'where':{'id':_0x45b4f9[_0x837f('0x41')]['id']}})[_0x837f('0x21')](handleEntityNotFound(_0x260f63,null))[_0x837f('0x21')](saveUpdates(_0x45b4f9[_0x837f('0x47')],null))['then'](respondWithResult(_0x260f63,null))['catch'](handleError(_0x260f63,null));};exports['destroy']=function(_0x4b403f,_0x12a79d){return db[_0x837f('0x3d')][_0x837f('0x43')]({'where':{'id':_0x4b403f[_0x837f('0x41')]['id']}})['then'](handleEntityNotFound(_0x12a79d,null))[_0x837f('0x21')](removeEntity(_0x12a79d,null))[_0x837f('0x44')](handleError(_0x12a79d,null));};exports[_0x837f('0x4a')]=function(_0x4ee8dd,_0x3e2eb6,_0x2b113f){_0x4ee8dd['body']['name']=_0x4ee8dd['file'][_0x837f('0x4b')];_0x4ee8dd[_0x837f('0x47')][_0x837f('0x4c')]=_0x4ee8dd[_0x837f('0x4d')][_0x837f('0x4e')];_0x4ee8dd[_0x837f('0x47')]['type']=_0x4ee8dd[_0x837f('0x4d')]['mimetype'];return db[_0x837f('0x3d')]['create'](_0x4ee8dd['body'])[_0x837f('0x21')](respondWithResult(_0x3e2eb6,0xc9))[_0x837f('0x44')](handleError(_0x3e2eb6,null));};exports['download']=function(_0x421f12,_0x22ee2e,_0x40cbe6){return db[_0x837f('0x3d')][_0x837f('0x4f')]({'where':{'id':_0x421f12[_0x837f('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x22ee2e,null))[_0x837f('0x21')](function(_0x2bd8d8){if(_0x2bd8d8){var _0x14b4a8=_0x2bd8d8[_0x837f('0x50')]!==null;var _0xdfabda=path[_0x837f('0x51')](config[_0x837f('0x52')],_0x837f('0x53'));if(_0x14b4a8){_0xdfabda=path[_0x837f('0x51')](_0xdfabda,_0x837f('0x54'));}var _0xf2a463=path[_0x837f('0x51')](_0xdfabda,_0x2bd8d8['basename']);return _0x22ee2e['download'](_0xf2a463);}})[_0x837f('0x44')](handleError(_0x22ee2e,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 2ddd23e..5d1f514 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 _0x5d86=['attachments','lodash','util','moment','request-promise','path','../../config/environment','exports','define'];(function(_0x2b8aac,_0x58900a){var _0x3d847d=function(_0x26419e){while(--_0x26419e){_0x2b8aac['push'](_0x2b8aac['shift']());}};_0x3d847d(++_0x58900a);}(_0x5d86,0x76));var _0x65d8=function(_0x1e830c,_0x31776b){_0x1e830c=_0x1e830c-0x0;var _0x3196e9=_0x5d86[_0x1e830c];return _0x3196e9;};'use strict';var _=require(_0x65d8('0x0'));var util=require(_0x65d8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x65d8('0x2'));var BPromise=require('bluebird');var rp=require(_0x65d8('0x3'));var fs=require('fs');var path=require(_0x65d8('0x4'));var rimraf=require('rimraf');var config=require(_0x65d8('0x5'));var attributes=require('./attachment.attributes');module[_0x65d8('0x6')]=function(_0x50c922,_0x1581a6){return _0x50c922[_0x65d8('0x7')]('Attachment',attributes,{'tableName':_0x65d8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b72=['../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x5ee4c1,_0x431ce9){var _0x5537e0=function(_0x42048a){while(--_0x42048a){_0x5ee4c1['push'](_0x5ee4c1['shift']());}};_0x5537e0(++_0x431ce9);}(_0x6b72,0x19d));var _0x26b7=function(_0x3bac35,_0x532607){_0x3bac35=_0x3bac35-0x0;var _0x3c956f=_0x6b72[_0x3bac35];return _0x3c956f;};'use strict';var _=require(_0x26b7('0x0'));var util=require('util');var logger=require(_0x26b7('0x1'))(_0x26b7('0x2'));var moment=require('moment');var BPromise=require(_0x26b7('0x3'));var rp=require(_0x26b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x26b7('0x5'));var attributes=require(_0x26b7('0x6'));module[_0x26b7('0x7')]=function(_0x5bf038,_0x26ac11){return _0x5bf038[_0x26b7('0x8')](_0x26b7('0x9'),attributes,{'tableName':_0x26b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index e041e44..3b1e2fd 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 _0xa1e2=['info','result','catch','create','body','options','CreateAttachment','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','Attachment,\x20%s,\x20%s','message'];(function(_0x1834be,_0x22a86a){var _0x6b78de=function(_0x266984){while(--_0x266984){_0x1834be['push'](_0x1834be['shift']());}};_0x6b78de(++_0x22a86a);}(_0xa1e2,0x116));var _0x2a1e=function(_0x1baec2,_0x18bdb4){_0x1baec2=_0x1baec2-0x0;var _0x5c2861=_0xa1e2[_0x1baec2];return _0x5c2861;};'use strict';var _=require(_0x2a1e('0x0'));var util=require(_0x2a1e('0x1'));var moment=require(_0x2a1e('0x2'));var BPromise=require(_0x2a1e('0x3'));var rs=require(_0x2a1e('0x4'));var fs=require('fs');var Redis=require(_0x2a1e('0x5'));var db=require(_0x2a1e('0x6'))['db'];var utils=require(_0x2a1e('0x7'));var logger=require(_0x2a1e('0x8'))(_0x2a1e('0x9'));var config=require(_0x2a1e('0xa'));var jayson=require(_0x2a1e('0xb'));var client=jayson[_0x2a1e('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53a9c6,_0x100d81,_0x5d0682){return new BPromise(function(_0x46ea04,_0x235190){return client[_0x2a1e('0xd')](_0x53a9c6,_0x5d0682)[_0x2a1e('0xe')](function(_0x17282d){logger['info']('Attachment,\x20%s,\x20%s',_0x100d81,_0x2a1e('0xf'));logger[_0x2a1e('0x10')](_0x2a1e('0x11'),_0x100d81,_0x2a1e('0xf'),JSON['stringify'](_0x17282d));if(_0x17282d[_0x2a1e('0x12')]){if(_0x17282d[_0x2a1e('0x12')][_0x2a1e('0x13')]===0x1f4){logger[_0x2a1e('0x12')](_0x2a1e('0x14'),_0x100d81,_0x17282d[_0x2a1e('0x12')][_0x2a1e('0x15')]);return _0x235190(_0x17282d[_0x2a1e('0x12')][_0x2a1e('0x15')]);}logger[_0x2a1e('0x12')]('Attachment,\x20%s,\x20%s',_0x100d81,_0x17282d[_0x2a1e('0x12')][_0x2a1e('0x15')]);return _0x46ea04(_0x17282d['error'][_0x2a1e('0x15')]);}else{logger[_0x2a1e('0x16')]('Attachment,\x20%s,\x20%s',_0x100d81,_0x2a1e('0xf'));_0x46ea04(_0x17282d[_0x2a1e('0x17')][_0x2a1e('0x15')]);}})[_0x2a1e('0x18')](function(_0x30fdda){logger[_0x2a1e('0x12')](_0x2a1e('0x14'),_0x100d81,_0x30fdda);_0x235190(_0x30fdda);});});}exports['CreateAttachment']=function(_0x49a5cc){var _0x48917b=this;return new Promise(function(_0x8f189b,_0x1f0e0e){return db['Attachment'][_0x2a1e('0x19')](_0x49a5cc[_0x2a1e('0x1a')],{'raw':_0x49a5cc['options']?_0x49a5cc[_0x2a1e('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x2a1e('0xe')](function(_0x3bdfa0){logger[_0x2a1e('0x16')](_0x2a1e('0x1c'),_0x49a5cc);logger['debug'](_0x2a1e('0x1c'),_0x49a5cc,JSON[_0x2a1e('0x1d')](_0x3bdfa0));_0x8f189b(_0x3bdfa0);})[_0x2a1e('0x18')](function(_0x4d0360){logger[_0x2a1e('0x12')]('CreateAttachment',_0x4d0360[_0x2a1e('0x15')],_0x49a5cc);_0x1f0e0e(_0x48917b[_0x2a1e('0x12')](0x1f4,_0x4d0360[_0x2a1e('0x15')]));});});}; \ No newline at end of file +var _0xa964=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','Attachment,\x20%s,\x20%s','message','result','catch','Attachment','create','body','options','CreateAttachment','lodash'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0xa964,0x144));var _0x4a96=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0xa964[_0x568a61];return _0x334c3b;};'use strict';var _=require(_0x4a96('0x0'));var util=require('util');var moment=require(_0x4a96('0x1'));var BPromise=require('bluebird');var rs=require(_0x4a96('0x2'));var fs=require('fs');var Redis=require(_0x4a96('0x3'));var db=require(_0x4a96('0x4'))['db'];var utils=require(_0x4a96('0x5'));var logger=require('../../config/logger')(_0x4a96('0x6'));var config=require('../../config/environment');var jayson=require(_0x4a96('0x7'));var client=jayson[_0x4a96('0x8')][_0x4a96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4182b5,_0x2ae66e,_0x3a3b18){return new BPromise(function(_0x1079c6,_0x4cbc49){return client['request'](_0x4182b5,_0x3a3b18)[_0x4a96('0xa')](function(_0x188c4b){logger[_0x4a96('0xb')]('Attachment,\x20%s,\x20%s',_0x2ae66e,_0x4a96('0xc'));logger[_0x4a96('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x2ae66e,_0x4a96('0xc'),JSON[_0x4a96('0xe')](_0x188c4b));if(_0x188c4b['error']){if(_0x188c4b[_0x4a96('0xf')]['code']===0x1f4){logger[_0x4a96('0xf')](_0x4a96('0x10'),_0x2ae66e,_0x188c4b[_0x4a96('0xf')][_0x4a96('0x11')]);return _0x4cbc49(_0x188c4b[_0x4a96('0xf')][_0x4a96('0x11')]);}logger[_0x4a96('0xf')](_0x4a96('0x10'),_0x2ae66e,_0x188c4b[_0x4a96('0xf')]['message']);return _0x1079c6(_0x188c4b[_0x4a96('0xf')][_0x4a96('0x11')]);}else{logger[_0x4a96('0xb')](_0x4a96('0x10'),_0x2ae66e,_0x4a96('0xc'));_0x1079c6(_0x188c4b[_0x4a96('0x12')][_0x4a96('0x11')]);}})[_0x4a96('0x13')](function(_0x3b1c21){logger[_0x4a96('0xf')](_0x4a96('0x10'),_0x2ae66e,_0x3b1c21);_0x4cbc49(_0x3b1c21);});});}exports['CreateAttachment']=function(_0x59a128){var _0x4e6272=this;return new Promise(function(_0x31fef7,_0x10b05c){return db[_0x4a96('0x14')][_0x4a96('0x15')](_0x59a128[_0x4a96('0x16')],{'raw':_0x59a128[_0x4a96('0x17')]?_0x59a128[_0x4a96('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x4a96('0xa')](function(_0x2e6c5d){logger[_0x4a96('0xb')](_0x4a96('0x18'),_0x59a128);logger[_0x4a96('0xd')]('CreateAttachment',_0x59a128,JSON[_0x4a96('0xe')](_0x2e6c5d));_0x31fef7(_0x2e6c5d);})[_0x4a96('0x13')](function(_0x4e4b94){logger['error'](_0x4a96('0x18'),_0x4e4b94[_0x4a96('0x11')],_0x59a128);_0x10b05c(_0x4e6272[_0x4a96('0xf')](0x1f4,_0x4e4b94[_0x4a96('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 93e03e6..42b0bdd 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 _0xa149=['get','index','/:id','isAuthenticated','show','post','/:id/clone','clone','diskStorage','server/files/attachments/','%s-%s','replace','single','file','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./attachment.controller'];(function(_0x5505b8,_0x5876ea){var _0x5c57ca=function(_0x251c3c){while(--_0x251c3c){_0x5505b8['push'](_0x5505b8['shift']());}};_0x5c57ca(++_0x5876ea);}(_0xa149,0x18c));var _0x9a14=function(_0x255c1f,_0x572d75){_0x255c1f=_0x255c1f-0x0;var _0x44b30b=_0xa149[_0x255c1f];return _0x44b30b;};'use strict';var multer=require(_0x9a14('0x0'));var util=require(_0x9a14('0x1'));var path=require(_0x9a14('0x2'));var timeout=require(_0x9a14('0x3'));var express=require(_0x9a14('0x4'));var router=express[_0x9a14('0x5')]();var fs_extra=require(_0x9a14('0x6'));var auth=require(_0x9a14('0x7'));var interaction=require(_0x9a14('0x8'));var config=require('../../config/environment');var controller=require(_0x9a14('0x9'));router[_0x9a14('0xa')]('/',auth['isAuthenticated'](),controller[_0x9a14('0xb')]);router[_0x9a14('0xa')](_0x9a14('0xc'),auth[_0x9a14('0xd')](),controller[_0x9a14('0xe')]);router[_0x9a14('0xa')]('/:id/download',auth[_0x9a14('0xd')](),controller['download']);router[_0x9a14('0xf')](_0x9a14('0x10'),auth[_0x9a14('0xd')](),controller[_0x9a14('0x11')]);var upload=multer({'storage':multer[_0x9a14('0x12')]({'destination':function(_0x1444a5,_0x50c6d4,_0x5d4ed8){_0x5d4ed8(null,path['join'](config['root'],_0x9a14('0x13')));},'filename':function(_0x34c392,_0x4f358b,_0x231f1a){_0x231f1a(null,util['format'](_0x9a14('0x14'),Date['now'](),_0x4f358b['originalname'][_0x9a14('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9a14('0xf')]('/',upload[_0x9a14('0x16')](_0x9a14('0x17')),controller['create']);router[_0x9a14('0x18')](_0x9a14('0xc'),auth[_0x9a14('0xd')](),controller[_0x9a14('0x19')]);router[_0x9a14('0x1a')](_0x9a14('0xc'),auth[_0x9a14('0xd')](),controller[_0x9a14('0x1b')]);module[_0x9a14('0x1c')]=router; \ No newline at end of file +var _0x9e6b=['update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','post','/:id/clone','clone','diskStorage','join','server/files/attachments/','%s-%s','now','single','file','create'];(function(_0xf8e76d,_0x12c182){var _0x2ee23e=function(_0x1092e9){while(--_0x1092e9){_0xf8e76d['push'](_0xf8e76d['shift']());}};_0x2ee23e(++_0x12c182);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x9e6b[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xb9e6('0x0'));var util=require(_0xb9e6('0x1'));var path=require('path');var timeout=require(_0xb9e6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb9e6('0x3'));var auth=require(_0xb9e6('0x4'));var interaction=require(_0xb9e6('0x5'));var config=require(_0xb9e6('0x6'));var controller=require('./attachment.controller');router[_0xb9e6('0x7')]('/',auth[_0xb9e6('0x8')](),controller[_0xb9e6('0x9')]);router['get'](_0xb9e6('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb9e6('0xb'),auth['isAuthenticated'](),controller[_0xb9e6('0xc')]);router[_0xb9e6('0xd')](_0xb9e6('0xe'),auth[_0xb9e6('0x8')](),controller[_0xb9e6('0xf')]);var upload=multer({'storage':multer[_0xb9e6('0x10')]({'destination':function(_0xe8c995,_0x2e0081,_0x165903){_0x165903(null,path[_0xb9e6('0x11')](config['root'],_0xb9e6('0x12')));},'filename':function(_0x21ee09,_0x1229a8,_0x1eac5e){_0x1eac5e(null,util['format'](_0xb9e6('0x13'),Date[_0xb9e6('0x14')](),_0x1229a8['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb9e6('0xd')]('/',upload[_0xb9e6('0x15')](_0xb9e6('0x16')),controller[_0xb9e6('0x17')]);router['put'](_0xb9e6('0xa'),auth[_0xb9e6('0x8')](),controller[_0xb9e6('0x18')]);router[_0xb9e6('0x19')](_0xb9e6('0xa'),auth[_0xb9e6('0x8')](),controller[_0xb9e6('0x1a')]);module[_0xb9e6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 3340eb4..12943bf 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 _0x8afb=['agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','Strategy','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','authenticate','/login','profile','email','callback','google','clientID','secret','Setting','findOne','allowedLoginAttempts','blockDuration','User','find','value','admin','user'];(function(_0x5238ca,_0x462d41){var _0x5be68a=function(_0x827775){while(--_0x827775){_0x5238ca['push'](_0x5238ca['shift']());}};_0x5be68a(++_0x462d41);}(_0x8afb,0x1d1));var _0xb8af=function(_0x4e9640,_0x51dd90){_0x4e9640=_0x4e9640-0x0;var _0x346066=_0x8afb[_0x4e9640];return _0x346066;};'use strict';var _=require(_0xb8af('0x0'));var passport=require(_0xb8af('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0xb8af('0x2')];var moment=require(_0xb8af('0x3'));var db=require(_0xb8af('0x4'))['db'];var config=require(_0xb8af('0x5'));var signToken=require('../../components/auth/service')[_0xb8af('0x6')];var utils=require(_0xb8af('0x7'));exports['login']=passport[_0xb8af('0x8')]('google',{'failureRedirect':_0xb8af('0x9'),'scope':[_0xb8af('0xa'),_0xb8af('0xb')],'session':![]});exports[_0xb8af('0xc')]=passport[_0xb8af('0x8')](_0xb8af('0xd'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xb8af('0xd')]?config[_0xb8af('0xd')][_0xb8af('0xe')]:'id','clientSecret':config[_0xb8af('0xd')]?config[_0xb8af('0xd')]['clientSecret']:_0xb8af('0xf'),'callbackURL':config['google']?config[_0xb8af('0xd')]['callbackURL']:''},function(_0x41137f,_0x2e3f0f,_0x2fb7b5,_0x36d97b){var _0x52bd28,_0x4750b1;return db[_0xb8af('0x10')][_0xb8af('0x11')]({'where':{'id':0x1},'attributes':[_0xb8af('0x12'),_0xb8af('0x13')],'raw':!![]})['then'](function(_0x5a0527){_0x52bd28=_0x5a0527;return db[_0xb8af('0x14')][_0xb8af('0x15')]({'where':{'email':_['map'](_0x2fb7b5['emails'],_0xb8af('0x16')),'role':{'$or':[_0xb8af('0x17'),_0xb8af('0x18'),_0xb8af('0x19')]}}});})[_0xb8af('0x1a')](function(_0x1fe80a){_0x4750b1=_0x1fe80a;if(_0x4750b1){if(_0x4750b1['disabled']){return _0x36d97b(_0xb8af('0x1b'));}else if(_0x52bd28['blockDuration']>0x0){if(_0x4750b1[_0xb8af('0x1c')]){if(moment(_0x4750b1[_0xb8af('0x1d')])[_0xb8af('0x1e')](_0x52bd28[_0xb8af('0x13')],_0xb8af('0x1f'))>moment()){return _0x36d97b(_0xb8af('0x1b'));}else{return utils[_0xb8af('0x20')](_0x4750b1,0x0,![],null)[_0xb8af('0x1a')](function(){return utils['getLicense'](_0x4750b1);})['then'](function(){return _0x36d97b(null,_0x4750b1);});}}else{return utils[_0xb8af('0x21')](_0x4750b1)['then'](function(){return _0x36d97b(null,_0x4750b1);});}}else{return utils['getLicense'](_0x4750b1)[_0xb8af('0x1a')](function(){return _0x36d97b(null,_0x4750b1);});}}return _0x36d97b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xb8af('0x22')](function(_0x49d766){_0x36d97b(_0x49d766);});})); \ No newline at end of file +var _0x757c=['../../components/auth/service','../../config/utils','login','authenticate','/login','profile','callback','google','use','clientID','secret','callbackURL','findOne','allowedLoginAttempts','User','find','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment'];(function(_0x1f92bb,_0x8fe53a){var _0x4678d2=function(_0x175fc2){while(--_0x175fc2){_0x1f92bb['push'](_0x1f92bb['shift']());}};_0x4678d2(++_0x8fe53a);}(_0x757c,0xf5));var _0xc757=function(_0x3d426d,_0x131f72){_0x3d426d=_0x3d426d-0x0;var _0x2e6d48=_0x757c[_0x3d426d];return _0x2e6d48;};'use strict';var _=require(_0xc757('0x0'));var passport=require(_0xc757('0x1'));var GoogleStrategy=require(_0xc757('0x2'))[_0xc757('0x3')];var moment=require(_0xc757('0x4'));var db=require(_0xc757('0x5'))['db'];var config=require(_0xc757('0x6'));var signToken=require(_0xc757('0x7'))['signToken'];var utils=require(_0xc757('0x8'));exports[_0xc757('0x9')]=passport[_0xc757('0xa')]('google',{'failureRedirect':_0xc757('0xb'),'scope':[_0xc757('0xc'),'email'],'session':![]});exports[_0xc757('0xd')]=passport[_0xc757('0xa')](_0xc757('0xe'),{'failureRedirect':_0xc757('0xb'),'session':![]});passport[_0xc757('0xf')](new GoogleStrategy({'clientID':config[_0xc757('0xe')]?config[_0xc757('0xe')][_0xc757('0x10')]:'id','clientSecret':config[_0xc757('0xe')]?config[_0xc757('0xe')]['clientSecret']:_0xc757('0x11'),'callbackURL':config[_0xc757('0xe')]?config[_0xc757('0xe')][_0xc757('0x12')]:''},function(_0x5b394f,_0x302d2b,_0x5818e0,_0x53e826){var _0x116519,_0x33617e;return db['Setting'][_0xc757('0x13')]({'where':{'id':0x1},'attributes':[_0xc757('0x14'),'blockDuration'],'raw':!![]})['then'](function(_0x17e5e6){_0x116519=_0x17e5e6;return db[_0xc757('0x15')][_0xc757('0x16')]({'where':{'email':_['map'](_0x5818e0['emails'],_0xc757('0x17')),'role':{'$or':[_0xc757('0x18'),_0xc757('0x19'),'agent']}}});})[_0xc757('0x1a')](function(_0x12c6f3){_0x33617e=_0x12c6f3;if(_0x33617e){if(_0x33617e[_0xc757('0x1b')]){return _0x53e826(_0xc757('0x1c'));}else if(_0x116519[_0xc757('0x1d')]>0x0){if(_0x33617e[_0xc757('0x1e')]){if(moment(_0x33617e['blockedAt'])[_0xc757('0x1f')](_0x116519['blockDuration'],_0xc757('0x20'))>moment()){return _0x53e826('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0xc757('0x21')](_0x33617e,0x0,![],null)[_0xc757('0x1a')](function(){return utils['getLicense'](_0x33617e);})[_0xc757('0x1a')](function(){return _0x53e826(null,_0x33617e);});}}else{return utils[_0xc757('0x22')](_0x33617e)[_0xc757('0x1a')](function(){return _0x53e826(null,_0x33617e);});}}else{return utils[_0xc757('0x22')](_0x33617e)[_0xc757('0x1a')](function(){return _0x53e826(null,_0x33617e);});}}return _0x53e826(_0xc757('0x1c'));})[_0xc757('0x23')](function(_0x245a7c){_0x53e826(_0x245a7c);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 8549fd9..09e5c11 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 _0x3fb7=['login','setTokenCookie','exports','passport','./authGoogle.controller','../user/user.controller.js','get','/callback','callback','isMiddleware'];(function(_0x36a469,_0x59d84c){var _0x3347fc=function(_0x3860e7){while(--_0x3860e7){_0x36a469['push'](_0x36a469['shift']());}};_0x3347fc(++_0x59d84c);}(_0x3fb7,0x189));var _0x73fb=function(_0x4b15c4,_0x4dfd3a){_0x4b15c4=_0x4b15c4-0x0;var _0x160aad=_0x3fb7[_0x4b15c4];return _0x160aad;};'use strict';var express=require('express');var passport=require(_0x73fb('0x0'));var router=express['Router']();var controller=require(_0x73fb('0x1'));var userController=require(_0x73fb('0x2'));var authService=require('../../components/auth/service');router[_0x73fb('0x3')]('/',controller['login']);router[_0x73fb('0x3')](_0x73fb('0x4'),controller[_0x73fb('0x5')],authService[_0x73fb('0x6')],userController[_0x73fb('0x7')],authService[_0x73fb('0x8')]);module[_0x73fb('0x9')]=router; \ No newline at end of file +var _0x4c4e=['get','login','callback','setTokenCookie','exports','express','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0x4a2de2,_0x4918fc){var _0x284bd0=function(_0x37c989){while(--_0x37c989){_0x4a2de2['push'](_0x4a2de2['shift']());}};_0x284bd0(++_0x4918fc);}(_0x4c4e,0x152));var _0xe4c4=function(_0x290bf7,_0x493301){_0x290bf7=_0x290bf7-0x0;var _0x475f0f=_0x4c4e[_0x290bf7];return _0x475f0f;};'use strict';var express=require(_0xe4c4('0x0'));var passport=require('passport');var router=express[_0xe4c4('0x1')]();var controller=require(_0xe4c4('0x2'));var userController=require(_0xe4c4('0x3'));var authService=require('../../components/auth/service');router[_0xe4c4('0x4')]('/',controller[_0xe4c4('0x5')]);router[_0xe4c4('0x4')]('/callback',controller[_0xe4c4('0x6')],authService['isMiddleware'],userController[_0xe4c4('0x5')],authService[_0xe4c4('0x7')]);module[_0xe4c4('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index e1bf12a..3d8dadc 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 _0x7ee1=['authenticate','allowedLoginAttempts','blockDuration','blockedAt','add','clearBlockUser','disabled','getLicense','catch','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','message','status','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','User','util','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','name','password','salt','role','blocked','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x7ee1,0x8d));var _0x17ee=function(_0x68558,_0x8a85ea){_0x68558=_0x68558-0x0;var _0x2aa004=_0x7ee1[_0x68558];return _0x2aa004;};'use strict';var util=require(_0x17ee('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x17ee('0x1'));var _=require(_0x17ee('0x2'));var rs=require(_0x17ee('0x3'));var moment=require('moment');var db=require(_0x17ee('0x4'))['db'];var authService=require(_0x17ee('0x5'));var utils=require(_0x17ee('0x6'));var client=jayson[_0x17ee('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x52b1db,_0x29b9eb,_0x54b4f6,_0x3f61af){var _0x57e1d1,_0x3d767b;return db[_0x17ee('0x8')][_0x17ee('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x17f935){_0x57e1d1=_0x17f935;return _0x52b1db['findOne']({'attributes':['id',_0x17ee('0xa'),_0x17ee('0xb'),_0x17ee('0xc'),_0x17ee('0xd'),'disabled',_0x17ee('0xe'),'blockedAt',_0x17ee('0xf')],'where':{'name':_0x29b9eb,'role':{'$or':[_0x17ee('0x10'),_0x17ee('0x11'),_0x17ee('0x12')]}}});})[_0x17ee('0x13')](function(_0xca5e20){if(!_0xca5e20||_0xca5e20&&_0xca5e20[_0x17ee('0xa')]!==_0x29b9eb){throw new Error(_0x17ee('0x14'));}else{_0x3d767b=_0xca5e20;return _0x3d767b;}})[_0x17ee('0x13')](function(){_0x3d767b[_0x17ee('0x15')](_0x54b4f6,function(_0x329af2,_0x52d679){var _0x4b66be=_0x3d767b['loginAttempts']+0x1;if(_0x329af2){return _0x3f61af(_0x329af2);}else if(!_0x52d679){if(_0x3d767b['disabled']){return _0x3f61af(null,![],{'message':_0x17ee('0x14')});}else if(_0x57e1d1[_0x17ee('0x16')]>0x0){if(_0x3d767b[_0x17ee('0xe')]){if(_0x57e1d1[_0x17ee('0x17')]>0x0){if(moment(_0x3d767b[_0x17ee('0x18')])[_0x17ee('0x19')](_0x57e1d1[_0x17ee('0x17')],'minutes')>moment()){return _0x3f61af(null,![],{'message':_0x17ee('0x14')});}else{return utils[_0x17ee('0x1a')](_0x3d767b,_0x4b66be,![],null)[_0x17ee('0x13')](function(){return _0x3f61af(null,![],{'message':_0x17ee('0x14')});});}}else{return _0x3f61af(null,![],{'message':_0x17ee('0x14')});}}else{if(_0x4b66be>=_0x57e1d1['allowedLoginAttempts']){return utils[_0x17ee('0x1a')](_0x3d767b,0x0,!![],moment())['then'](function(){return _0x3f61af(null,![],{'message':_0x17ee('0x14')});});}else{return utils['clearBlockUser'](_0x3d767b,_0x4b66be,![],null)[_0x17ee('0x13')](function(){return _0x3f61af(null,![],{'message':_0x17ee('0x14')});});}}}else{return _0x3f61af(null,![],{'message':_0x17ee('0x14')});}}else{if(_0x3d767b[_0x17ee('0x1b')]){return _0x3f61af(null,![],{'message':_0x17ee('0x14')});}else if(_0x57e1d1[_0x17ee('0x16')]>0x0){if(_0x3d767b[_0x17ee('0xe')]){if(_0x57e1d1[_0x17ee('0x17')]>0x0){if(moment(_0x3d767b[_0x17ee('0x18')])[_0x17ee('0x19')](_0x57e1d1[_0x17ee('0x17')],'minutes')>moment()){return _0x3f61af(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x17ee('0x1a')](_0x3d767b,0x0,![],null)[_0x17ee('0x13')](function(){return utils[_0x17ee('0x1c')](_0x3d767b);})[_0x17ee('0x13')](function(){return _0x3f61af(null,_0x3d767b);});}}else{return _0x3f61af(null,![],{'message':_0x17ee('0x14')});}}else{return utils[_0x17ee('0x1a')](_0x3d767b,0x0,![],null)[_0x17ee('0x13')](function(){return utils[_0x17ee('0x1c')](_0x3d767b);})[_0x17ee('0x13')](function(){return _0x3f61af(null,_0x3d767b);})[_0x17ee('0x1d')](function(_0xfcfade){return _0x3f61af(null,![],_0xfcfade);});}}else{if(_0x3d767b[_0x17ee('0xe')]){return _0x3f61af(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x17ee('0x1c')](_0x3d767b)[_0x17ee('0x13')](function(){return _0x3f61af(null,_0x3d767b);});}}}});})[_0x17ee('0x1d')](function(_0x258018){return _0x3f61af(null,![],_0x258018);});}function sendServiceMail(_0x125513){return db['MailAccount'][_0x17ee('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x17ee('0xa'),_0x17ee('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0x17ee('0x20')}]})[_0x17ee('0x13')](function(_0x56c6ba){if(!_0x56c6ba){throw new Error(_0x17ee('0x21'));}var _0x549e3b={'tls':{'rejectUnauthorized':![]}};if(_0x56c6ba[_0x17ee('0x20')]['service']){_0x549e3b[_0x17ee('0x22')]=_0x56c6ba[_0x17ee('0x20')][_0x17ee('0x22')];}else{_0x549e3b['host']=_0x56c6ba[_0x17ee('0x20')][_0x17ee('0x23')];_0x549e3b['port']=_0x56c6ba[_0x17ee('0x20')][_0x17ee('0x24')];_0x549e3b[_0x17ee('0x25')]=_0x56c6ba['Smtp']['secure'];}if(_0x56c6ba[_0x17ee('0x20')][_0x17ee('0x26')]){_0x549e3b[_0x17ee('0x27')]={'user':_0x56c6ba[_0x17ee('0x20')]['user'],'pass':_0x56c6ba['Smtp'][_0x17ee('0x28')]};}var _0x2408af={'account':_0x549e3b,'message':_[_0x17ee('0x29')]({'from':util[_0x17ee('0x2a')](_0x17ee('0x2b'),_0x56c6ba[_0x17ee('0xa')],_0x56c6ba[_0x17ee('0x1f')]||_0x56c6ba['Smtp']['user'])},_0x125513)};return client['request'](_0x17ee('0x2c'),_0x2408af);})['then'](function(_0x1aa9a7){if(_0x1aa9a7[_0x17ee('0x2d')]){throw new Error(util[_0x17ee('0x2a')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1aa9a7[_0x17ee('0x2d')][_0x17ee('0x2e')]||JSON['stringify'](_0x1aa9a7['error'])));}return!![];});}function handleError(_0xe93fc2,_0xa6657e,_0x12cedc){return _0xe93fc2[_0x17ee('0x2f')](_0xa6657e||0x1f4)[_0x17ee('0x30')]({'message':_0x12cedc?_0x12cedc['message']||_0x12cedc:''});}exports['login']=function(_0x36c2f0,_0x6d383e,_0x1cc0fa){passport[_0x17ee('0x15')](_0x17ee('0x31'),function(_0xe60d2f,_0x4bb35b,_0x50b909){var _0xe24eec=_0xe60d2f||_0x50b909;if(_0xe24eec){return handleError(_0x6d383e,0x191,_0xe24eec);}if(!_0x4bb35b){return handleError(_0x6d383e,0x194,{'message':_0x17ee('0x32')});}else{var _0x2580b4={'payload':{'id':_0x4bb35b['id'],'role':_0x4bb35b[_0x17ee('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0x17ee('0x33')](_0x2580b4)[_0x17ee('0x13')](function(_0x463f98){_0x6d383e[_0x17ee('0x34')]({'id':_0x4bb35b['id'],'token':_0x463f98,'statusCall':'','isAlreadyLogged':_0x4bb35b[_0x17ee('0x35')]});});}})(_0x36c2f0,_0x6d383e,_0x1cc0fa);};exports[_0x17ee('0x36')]=function(_0x53cb88,_0x4f37f0,_0x4c3954){if(!_0x53cb88[_0x17ee('0x37')][_0x17ee('0x1f')]){return handleError(_0x4f37f0,0x1f4,{'message':_0x17ee('0x38')});}var _0x3a1ace=rs['generate']();_0x53cb88[_0x17ee('0x37')][_0x17ee('0x1f')]=_0x53cb88[_0x17ee('0x37')][_0x17ee('0x1f')]['trim']()[_0x17ee('0x39')]();var _0x55b4e2;return db[_0x17ee('0x8')][_0x17ee('0x9')]({'where':{'id':0x1},'attributes':[_0x17ee('0x16'),_0x17ee('0x17')],'raw':!![]})[_0x17ee('0x13')](function(_0x1f105a){_0x55b4e2=_0x1f105a;return db['User'][_0x17ee('0x1e')]({'where':{'email':_0x53cb88[_0x17ee('0x37')][_0x17ee('0x1f')]}});})[_0x17ee('0x13')](function(_0x7d3eb6){if(!_0x7d3eb6){throw new Error(_0x17ee('0x3a'));}if(_0x7d3eb6[_0x17ee('0x1b')]){throw new Error(_0x17ee('0x3b'));}if(_0x7d3eb6[_0x17ee('0xe')]){if(moment(_0x7d3eb6[_0x17ee('0x18')])[_0x17ee('0x19')](_0x55b4e2[_0x17ee('0x17')],'minutes')>moment()){throw new Error(_0x17ee('0x3c'));}else{_0x7d3eb6[_0x17ee('0xe')]=![];_0x7d3eb6['blockedAt']=null;}}_0x7d3eb6['resetPasswordToken']=_0x3a1ace;_0x7d3eb6['resetPasswordExpires']=Date[_0x17ee('0x3d')]()+0x36ee80;return _0x7d3eb6[_0x17ee('0x3e')]();})[_0x17ee('0x13')](function(){return sendServiceMail({'to':_0x53cb88[_0x17ee('0x37')][_0x17ee('0x1f')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x17ee('0x3f')+_0x17ee('0x40')+_0x17ee('0x41')+_0x53cb88[_0x17ee('0x42')][_0x17ee('0x23')]+_0x17ee('0x43')+_0x3a1ace+'\x0a\x0a'+_0x17ee('0x44')});})[_0x17ee('0x13')](function(){_0x4f37f0[_0x17ee('0x2f')](0xc8)[_0x17ee('0x30')]({'message':_0x17ee('0x45')});})[_0x17ee('0x1d')](function(_0x4a99bf){return handleError(_0x4f37f0,0x1f4,_0x4a99bf);});};exports['reset']=function(_0x348e6b,_0x3cecb2,_0x5a4b78){return db['User'][_0x17ee('0x1e')]({'where':{'resetPasswordToken':_0x348e6b['params'][_0x17ee('0x46')],'resetPasswordExpires':{'$gt':Date[_0x17ee('0x3d')]()}}})[_0x17ee('0x13')](function(_0x177552){if(!_0x177552){throw new Error(_0x17ee('0x47'));}return db[_0x17ee('0x8')][_0x17ee('0x9')]({'attributes':['id',_0x17ee('0x48'),_0x17ee('0x49'),_0x17ee('0x4a')]})[_0x17ee('0x13')](function(_0x34e572){if(_0x34e572[_0x17ee('0x48')])authService['validatePasswordPattern'](_0x348e6b[_0x17ee('0x37')][_0x17ee('0xb')]);if(!_0x34e572['enforcePasswordHistory']||!_0x177552[_0x17ee('0x4b')])return _0x177552;authService[_0x17ee('0x4c')](_0x348e6b['body'][_0x17ee('0xb')],_0x177552[_0x17ee('0x4b')],_0x34e572[_0x17ee('0x4a')]);return _0x177552;})[_0x17ee('0x13')](function(){_0x177552[_0x17ee('0xb')]=_0x348e6b[_0x17ee('0x37')][_0x17ee('0xb')];_0x177552['resetPasswordToken']=null;_0x177552[_0x17ee('0x4d')]=null;return _0x177552['save']();});})['then'](function(){_0x3cecb2[_0x17ee('0x2f')](0xc8)[_0x17ee('0x30')]({'message':_0x17ee('0x4e')});})['catch'](function(_0x575ff0){return handleError(_0x3cecb2,0x1f4,_0x575ff0);});};passport[_0x17ee('0x4f')](new LocalStrategy({'usernameField':_0x17ee('0xa'),'passwordField':_0x17ee('0xb')},function(_0x2dbe4a,_0x2dbabe,_0x2b98f1){return localAuthenticate(db[_0x17ee('0x50')],_0x2dbe4a,_0x2dbabe,_0x2b98f1);})); \ No newline at end of file +var _0x77d4=['passport','Strategy','lodash','randomstring','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','blocked','blockedAt','user','agent','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','message','stringify','status','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use'];(function(_0x2219a2,_0x37d194){var _0x3e4a29=function(_0x1da431){while(--_0x1da431){_0x2219a2['push'](_0x2219a2['shift']());}};_0x3e4a29(++_0x37d194);}(_0x77d4,0x108));var _0x477d=function(_0x49b446,_0x2e7a57){_0x49b446=_0x49b446-0x0;var _0x41875c=_0x77d4[_0x49b446];return _0x41875c;};'use strict';var util=require('util');var passport=require(_0x477d('0x0'));var LocalStrategy=require('passport-local')[_0x477d('0x1')];var jayson=require('jayson/promise');var _=require(_0x477d('0x2'));var rs=require(_0x477d('0x3'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x477d('0x4'));var utils=require(_0x477d('0x5'));var client=jayson[_0x477d('0x6')][_0x477d('0x7')]({'port':0x232b});function localAuthenticate(_0x2545e5,_0x45ca2d,_0x5153df,_0x4f4fb4){var _0x2dd5d2,_0x579859;return db['Setting'][_0x477d('0x8')]({'where':{'id':0x1},'attributes':[_0x477d('0x9'),_0x477d('0xa')],'raw':!![]})[_0x477d('0xb')](function(_0x1cef1c){_0x2dd5d2=_0x1cef1c;return _0x2545e5['findOne']({'attributes':['id',_0x477d('0xc'),'password',_0x477d('0xd'),_0x477d('0xe'),'disabled',_0x477d('0xf'),_0x477d('0x10'),'loginAttempts'],'where':{'name':_0x45ca2d,'role':{'$or':['admin',_0x477d('0x11'),_0x477d('0x12')]}}});})['then'](function(_0x290d46){if(!_0x290d46||_0x290d46&&_0x290d46[_0x477d('0xc')]!==_0x45ca2d){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x579859=_0x290d46;return _0x579859;}})['then'](function(){_0x579859[_0x477d('0x13')](_0x5153df,function(_0x4bbfef,_0x30481f){var _0x234b99=_0x579859[_0x477d('0x14')]+0x1;if(_0x4bbfef){return _0x4f4fb4(_0x4bbfef);}else if(!_0x30481f){if(_0x579859['disabled']){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}else if(_0x2dd5d2[_0x477d('0x9')]>0x0){if(_0x579859[_0x477d('0xf')]){if(_0x2dd5d2[_0x477d('0xa')]>0x0){if(moment(_0x579859['blockedAt'])[_0x477d('0x16')](_0x2dd5d2['blockDuration'],_0x477d('0x17'))>moment()){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}else{return utils[_0x477d('0x18')](_0x579859,_0x234b99,![],null)[_0x477d('0xb')](function(){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});});}}else{return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}}else{if(_0x234b99>=_0x2dd5d2['allowedLoginAttempts']){return utils[_0x477d('0x18')](_0x579859,0x0,!![],moment())['then'](function(){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});});}else{return utils[_0x477d('0x18')](_0x579859,_0x234b99,![],null)[_0x477d('0xb')](function(){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});});}}}else{return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}}else{if(_0x579859[_0x477d('0x19')]){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}else if(_0x2dd5d2[_0x477d('0x9')]>0x0){if(_0x579859[_0x477d('0xf')]){if(_0x2dd5d2[_0x477d('0xa')]>0x0){if(moment(_0x579859[_0x477d('0x10')])[_0x477d('0x16')](_0x2dd5d2[_0x477d('0xa')],_0x477d('0x17'))>moment()){return _0x4f4fb4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x477d('0x18')](_0x579859,0x0,![],null)['then'](function(){return utils[_0x477d('0x1a')](_0x579859);})[_0x477d('0xb')](function(){return _0x4f4fb4(null,_0x579859);});}}else{return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}}else{return utils[_0x477d('0x18')](_0x579859,0x0,![],null)['then'](function(){return utils[_0x477d('0x1a')](_0x579859);})[_0x477d('0xb')](function(){return _0x4f4fb4(null,_0x579859);})[_0x477d('0x1b')](function(_0x48ee5e){return _0x4f4fb4(null,![],_0x48ee5e);});}}else{if(_0x579859['blocked']){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}else{return utils[_0x477d('0x1a')](_0x579859)[_0x477d('0xb')](function(){return _0x4f4fb4(null,_0x579859);});}}}});})['catch'](function(_0x254141){return _0x4f4fb4(null,![],_0x254141);});}function sendServiceMail(_0x297d15){return db[_0x477d('0x1c')][_0x477d('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x477d('0xc'),'email'],'include':[{'model':db[_0x477d('0x1e')],'as':_0x477d('0x1f')}]})[_0x477d('0xb')](function(_0x25a329){if(!_0x25a329){throw new Error(_0x477d('0x20'));}var _0x385eb4={'tls':{'rejectUnauthorized':![]}};if(_0x25a329[_0x477d('0x1f')][_0x477d('0x21')]){_0x385eb4[_0x477d('0x21')]=_0x25a329[_0x477d('0x1f')][_0x477d('0x21')];}else{_0x385eb4[_0x477d('0x22')]=_0x25a329[_0x477d('0x1f')][_0x477d('0x22')];_0x385eb4[_0x477d('0x23')]=_0x25a329[_0x477d('0x1f')][_0x477d('0x23')];_0x385eb4[_0x477d('0x24')]=_0x25a329[_0x477d('0x1f')][_0x477d('0x24')];}if(_0x25a329['Smtp'][_0x477d('0x25')]){_0x385eb4['auth']={'user':_0x25a329[_0x477d('0x1f')][_0x477d('0x11')],'pass':_0x25a329[_0x477d('0x1f')]['pass']};}var _0x117c97={'account':_0x385eb4,'message':_[_0x477d('0x26')]({'from':util[_0x477d('0x27')](_0x477d('0x28'),_0x25a329[_0x477d('0xc')],_0x25a329[_0x477d('0x29')]||_0x25a329[_0x477d('0x1f')][_0x477d('0x11')])},_0x297d15)};return client[_0x477d('0x2a')](_0x477d('0x2b'),_0x117c97);})['then'](function(_0x36a247){if(_0x36a247[_0x477d('0x2c')]){throw new Error(util[_0x477d('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x36a247[_0x477d('0x2c')][_0x477d('0x2d')]||JSON[_0x477d('0x2e')](_0x36a247['error'])));}return!![];});}function handleError(_0x5ecbc3,_0x21de5c,_0x3f818d){return _0x5ecbc3[_0x477d('0x2f')](_0x21de5c||0x1f4)[_0x477d('0x30')]({'message':_0x3f818d?_0x3f818d[_0x477d('0x2d')]||_0x3f818d:''});}exports['login']=function(_0x304055,_0x59ad77,_0x7b73b9){passport[_0x477d('0x13')](_0x477d('0x31'),function(_0x54355a,_0x5170fe,_0x184d50){var _0x2c7089=_0x54355a||_0x184d50;if(_0x2c7089){return handleError(_0x59ad77,0x191,_0x2c7089);}if(!_0x5170fe){return handleError(_0x59ad77,0x194,{'message':_0x477d('0x32')});}else{var _0x4758a5={'payload':{'id':_0x5170fe['id'],'role':_0x5170fe['role']},'options':{'expiresIn':0x15180}};return authService[_0x477d('0x33')](_0x4758a5)[_0x477d('0xb')](function(_0x40fdc0){_0x59ad77[_0x477d('0x34')]({'id':_0x5170fe['id'],'token':_0x40fdc0,'statusCall':'','isAlreadyLogged':_0x5170fe[_0x477d('0x35')]});});}})(_0x304055,_0x59ad77,_0x7b73b9);};exports['forgot']=function(_0x472149,_0x3142d5,_0x4d1c8e){if(!_0x472149[_0x477d('0x36')]['email']){return handleError(_0x3142d5,0x1f4,{'message':_0x477d('0x37')});}var _0x7a5a47=rs[_0x477d('0x38')]();_0x472149[_0x477d('0x36')][_0x477d('0x29')]=_0x472149[_0x477d('0x36')][_0x477d('0x29')][_0x477d('0x39')]()[_0x477d('0x3a')]();var _0x4c22f5;return db[_0x477d('0x3b')][_0x477d('0x8')]({'where':{'id':0x1},'attributes':[_0x477d('0x9'),_0x477d('0xa')],'raw':!![]})['then'](function(_0x4e0db1){_0x4c22f5=_0x4e0db1;return db[_0x477d('0x3c')][_0x477d('0x1d')]({'where':{'email':_0x472149['body'][_0x477d('0x29')]}});})['then'](function(_0x51ec10){if(!_0x51ec10){throw new Error(_0x477d('0x3d'));}if(_0x51ec10[_0x477d('0x19')]){throw new Error(_0x477d('0x3e'));}if(_0x51ec10[_0x477d('0xf')]){if(moment(_0x51ec10[_0x477d('0x10')])[_0x477d('0x16')](_0x4c22f5['blockDuration'],_0x477d('0x17'))>moment()){throw new Error(_0x477d('0x3f'));}else{_0x51ec10[_0x477d('0xf')]=![];_0x51ec10[_0x477d('0x10')]=null;}}_0x51ec10[_0x477d('0x40')]=_0x7a5a47;_0x51ec10['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x51ec10[_0x477d('0x41')]();})[_0x477d('0xb')](function(){return sendServiceMail({'to':_0x472149[_0x477d('0x36')]['email'],'subject':_0x477d('0x42'),'text':_0x477d('0x43')+_0x477d('0x44')+_0x477d('0x45')+_0x472149[_0x477d('0x46')][_0x477d('0x22')]+_0x477d('0x47')+_0x7a5a47+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x477d('0xb')](function(){_0x3142d5[_0x477d('0x2f')](0xc8)[_0x477d('0x30')]({'message':_0x477d('0x48')});})[_0x477d('0x1b')](function(_0x32b430){return handleError(_0x3142d5,0x1f4,_0x32b430);});};exports[_0x477d('0x49')]=function(_0x30e474,_0x113162,_0x33df7f){return db[_0x477d('0x3c')][_0x477d('0x1d')]({'where':{'resetPasswordToken':_0x30e474[_0x477d('0x4a')][_0x477d('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x477d('0x4c')]()}}})['then'](function(_0xa20d0b){if(!_0xa20d0b){throw new Error(_0x477d('0x4d'));}return db['Setting']['findOne']({'attributes':['id','securePassword',_0x477d('0x4e'),_0x477d('0x4f')]})[_0x477d('0xb')](function(_0x6c7541){if(_0x6c7541[_0x477d('0x50')])authService[_0x477d('0x51')](_0x30e474[_0x477d('0x36')][_0x477d('0x52')]);if(!_0x6c7541['enforcePasswordHistory']||!_0xa20d0b[_0x477d('0x53')])return _0xa20d0b;authService[_0x477d('0x54')](_0x30e474[_0x477d('0x36')][_0x477d('0x52')],_0xa20d0b[_0x477d('0x53')],_0x6c7541[_0x477d('0x4f')]);return _0xa20d0b;})[_0x477d('0xb')](function(){_0xa20d0b[_0x477d('0x52')]=_0x30e474['body'][_0x477d('0x52')];_0xa20d0b[_0x477d('0x40')]=null;_0xa20d0b[_0x477d('0x55')]=null;return _0xa20d0b[_0x477d('0x41')]();});})[_0x477d('0xb')](function(){_0x113162['status'](0xc8)[_0x477d('0x30')]({'message':_0x477d('0x56')});})[_0x477d('0x1b')](function(_0x239ece){return handleError(_0x113162,0x1f4,_0x239ece);});};passport[_0x477d('0x57')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x3b287f,_0xb175d1,_0x95f9e0){return localAuthenticate(db[_0x477d('0x3c')],_0x3b287f,_0xb175d1,_0x95f9e0);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 86b91b4..a71be82 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 _0xcabc=['post','login','forgot','reset','exports','Router','./authLocal.controller'];(function(_0x414655,_0x79d916){var _0x237884=function(_0x2737d9){while(--_0x2737d9){_0x414655['push'](_0x414655['shift']());}};_0x237884(++_0x79d916);}(_0xcabc,0x16a));var _0xccab=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xcabc[_0x57b54c];return _0x59cc19;};'use strict';var express=require('express');var router=express[_0xccab('0x0')]();var controller=require(_0xccab('0x1'));router[_0xccab('0x2')]('/',controller[_0xccab('0x3')]);router[_0xccab('0x2')]('/forgot',controller[_0xccab('0x4')]);router[_0xccab('0x2')]('/reset/:token',controller[_0xccab('0x5')]);module[_0xccab('0x6')]=router; \ No newline at end of file +var _0x9380=['Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0xcb5438,_0x56cc82){var _0x2f8738=function(_0x5e0c2f){while(--_0x5e0c2f){_0xcb5438['push'](_0xcb5438['shift']());}};_0x2f8738(++_0x56cc82);}(_0x9380,0x117));var _0x0938=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x9380[_0x1203f];return _0x365f0a;};'use strict';var express=require(_0x0938('0x0'));var router=express[_0x0938('0x1')]();var controller=require(_0x0938('0x2'));router[_0x0938('0x3')]('/',controller[_0x0938('0x4')]);router[_0x0938('0x3')](_0x0938('0x5'),controller[_0x0938('0x6')]);router[_0x0938('0x3')](_0x0938('0x7'),controller[_0x0938('0x8')]);module[_0x0938('0x9')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index aeb0c66..c8dc609 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 _0x56a9=['sequelize','exports','STRING','BOOLEAN'];(function(_0x19d179,_0x4d4c53){var _0x5ae2e4=function(_0xa058c8){while(--_0xa058c8){_0x19d179['push'](_0x19d179['shift']());}};_0x5ae2e4(++_0x4d4c53);}(_0x56a9,0x16c));var _0x956a=function(_0x4206f5,_0x21f338){_0x4206f5=_0x4206f5-0x0;var _0xa29cf3=_0x56a9[_0x4206f5];return _0xa29cf3;};'use strict';var Sequelize=require(_0x956a('0x0'));module[_0x956a('0x1')]={'name':{'type':Sequelize[_0x956a('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x956a('0x2')]},'status':{'type':Sequelize[_0x956a('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x7c30=['BOOLEAN','INTEGER','STRING'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7c30,0x125));var _0x07c3=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7c30[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x07c3('0x0')]},'status':{'type':Sequelize[_0x07c3('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x07c3('0x2')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 3e11818..61b0c8c 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 _0x81c1=['query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','then','includeAll','Automation','findAll','rows','include','catch','create','body','find','params','addConditions','ids','getConditions','nolimit','addActions','Action','omit','getActions','pick','length','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x52a7a9,_0x4df6fc){var _0x5253e4=function(_0xc13118){while(--_0xc13118){_0x52a7a9['push'](_0x52a7a9['shift']());}};_0x5253e4(++_0x4df6fc);}(_0x81c1,0xcb));var _0x181c=function(_0x45dfa3,_0x43b8f9){_0x45dfa3=_0x45dfa3-0x0;var _0x22e742=_0x81c1[_0x45dfa3];return _0x22e742;};'use strict';var emlformat=require(_0x181c('0x0'));var rimraf=require(_0x181c('0x1'));var zipdir=require(_0x181c('0x2'));var jsonpatch=require(_0x181c('0x3'));var rp=require(_0x181c('0x4'));var moment=require(_0x181c('0x5'));var BPromise=require(_0x181c('0x6'));var Mustache=require(_0x181c('0x7'));var util=require(_0x181c('0x8'));var path=require(_0x181c('0x9'));var sox=require(_0x181c('0xa'));var csv=require(_0x181c('0xb'));var ejs=require(_0x181c('0xc'));var fs=require('fs');var fs_extra=require(_0x181c('0xd'));var _=require(_0x181c('0xe'));var squel=require('squel');var crypto=require(_0x181c('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x181c('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x181c('0x11'));var Redis=require(_0x181c('0x12'));var authService=require(_0x181c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x181c('0x14'));var hardwareService=require(_0x181c('0x15'));var logger=require(_0x181c('0x16'))(_0x181c('0x17'));var utils=require(_0x181c('0x18'));var config=require(_0x181c('0x19'));var licenseUtil=require(_0x181c('0x1a'));var db=require(_0x181c('0x1b'))['db'];function respondWithStatusCode(_0x3d8a66,_0x443e94){_0x443e94=_0x443e94||0xcc;return function(_0x1a358a){if(_0x1a358a){return _0x3d8a66[_0x181c('0x1c')](_0x443e94);}return _0x3d8a66[_0x181c('0x1d')](_0x443e94)[_0x181c('0x1e')]();};}function respondWithResult(_0x2395c4,_0x3ddbb5){_0x3ddbb5=_0x3ddbb5||0xc8;return function(_0x487cda){if(_0x487cda){return _0x2395c4[_0x181c('0x1d')](_0x3ddbb5)[_0x181c('0x1f')](_0x487cda);}};}function respondWithFilteredResult(_0x1d75f7,_0x918e40){return function(_0x3d4d4f){if(_0x3d4d4f){var _0x1346cd=typeof _0x918e40[_0x181c('0x20')]===_0x181c('0x21')&&typeof _0x918e40[_0x181c('0x22')]===_0x181c('0x21');var _0x3a8f1e=_0x3d4d4f[_0x181c('0x23')];var _0x545347=_0x1346cd?0x0:_0x918e40[_0x181c('0x20')];var _0x33a10f=_0x1346cd?_0x3d4d4f['count']:_0x918e40[_0x181c('0x20')]+_0x918e40[_0x181c('0x22')];var _0x4495b9;if(_0x33a10f>=_0x3a8f1e){_0x33a10f=_0x3a8f1e;_0x4495b9=0xc8;}else{_0x4495b9=0xce;}_0x1d75f7[_0x181c('0x1d')](_0x4495b9);return _0x1d75f7['set']('Content-Range',_0x545347+'-'+_0x33a10f+'/'+_0x3a8f1e)['json'](_0x3d4d4f);}return null;};}function patchUpdates(_0x46081d){return function(_0x35a98d){try{jsonpatch[_0x181c('0x24')](_0x35a98d,_0x46081d,!![]);}catch(_0x49e526){return BPromise[_0x181c('0x25')](_0x49e526);}return _0x35a98d['save']();};}function saveUpdates(_0x580d58,_0x28e9b7){return function(_0x86cc07){if(_0x86cc07){return _0x86cc07['update'](_0x580d58)['then'](function(_0x3add55){return _0x3add55;});}return null;};}function removeEntity(_0xfe6fb0,_0x2171d7){return function(_0x37e4e1){if(_0x37e4e1){return _0x37e4e1[_0x181c('0x26')]()['then'](function(){_0xfe6fb0[_0x181c('0x1d')](0xcc)[_0x181c('0x1e')]();});}};}function handleEntityNotFound(_0x14c99b,_0x44eed6){return function(_0x269c92){if(!_0x269c92){_0x14c99b[_0x181c('0x1c')](0x194);}return _0x269c92;};}function handleError(_0x3b4920,_0x5a491f){_0x5a491f=_0x5a491f||0x1f4;return function(_0x25368f){logger[_0x181c('0x27')](_0x25368f['stack']);if(_0x25368f[_0x181c('0x28')]){delete _0x25368f['name'];}_0x3b4920['status'](_0x5a491f)[_0x181c('0x29')](_0x25368f);};}exports[_0x181c('0x2a')]=function(_0x26a02d,_0x4bec98){var _0x19e41f={},_0x55710c={},_0xfb1073={'count':0x0,'rows':[]};var _0x42640e=_[_0x181c('0x2b')](db['Automation'][_0x181c('0x2c')],function(_0x58e0d3){return{'name':_0x58e0d3[_0x181c('0x2d')],'type':_0x58e0d3[_0x181c('0x2e')][_0x181c('0x2f')]};});_0x55710c[_0x181c('0x30')]=_[_0x181c('0x2b')](_0x42640e,_0x181c('0x28'));_0x55710c[_0x181c('0x31')]=_[_0x181c('0x32')](_0x26a02d[_0x181c('0x31')]);_0x55710c[_0x181c('0x33')]=_['intersection'](_0x55710c['model'],_0x55710c[_0x181c('0x31')]);_0x19e41f[_0x181c('0x34')]=_[_0x181c('0x35')](_0x55710c[_0x181c('0x30')],qs[_0x181c('0x36')](_0x26a02d[_0x181c('0x31')][_0x181c('0x36')]));_0x19e41f['attributes']=_0x19e41f['attributes']['length']?_0x19e41f[_0x181c('0x34')]:_0x55710c[_0x181c('0x30')];if(!_0x26a02d[_0x181c('0x31')][_0x181c('0x37')]('nolimit')){_0x19e41f[_0x181c('0x22')]=qs['limit'](_0x26a02d['query'][_0x181c('0x22')]);_0x19e41f[_0x181c('0x20')]=qs['offset'](_0x26a02d[_0x181c('0x31')][_0x181c('0x20')]);}_0x19e41f[_0x181c('0x38')]=qs[_0x181c('0x39')](_0x26a02d[_0x181c('0x31')][_0x181c('0x39')]);_0x19e41f[_0x181c('0x3a')]=qs[_0x181c('0x33')](_['pick'](_0x26a02d[_0x181c('0x31')],_0x55710c[_0x181c('0x33')]),_0x42640e);if(_0x26a02d[_0x181c('0x31')]['filter']){_0x19e41f[_0x181c('0x3a')]=_[_0x181c('0x3b')](_0x19e41f[_0x181c('0x3a')],{'$or':_[_0x181c('0x2b')](_0x42640e,function(_0x122bb0){if(_0x122bb0['type']!==_0x181c('0x3c')){var _0x408116={};_0x408116[_0x122bb0[_0x181c('0x28')]]={'$like':'%'+_0x26a02d[_0x181c('0x31')][_0x181c('0x3d')]+'%'};return _0x408116;}})});}_0x19e41f=_[_0x181c('0x3b')]({},_0x19e41f,_0x26a02d[_0x181c('0x3e')]);var _0x11eba3={'where':_0x19e41f[_0x181c('0x3a')]};return db['Automation'][_0x181c('0x23')](_0x11eba3)[_0x181c('0x3f')](function(_0x36660b){_0xfb1073[_0x181c('0x23')]=_0x36660b;if(_0x26a02d[_0x181c('0x31')][_0x181c('0x40')]){_0x19e41f['include']=[{'all':!![]}];}return db[_0x181c('0x41')][_0x181c('0x42')](_0x19e41f);})[_0x181c('0x3f')](function(_0x54a708){_0xfb1073[_0x181c('0x43')]=_0x54a708;return _0xfb1073;})[_0x181c('0x3f')](respondWithFilteredResult(_0x4bec98,_0x19e41f))['catch'](handleError(_0x4bec98,null));};exports['show']=function(_0x31350b,_0x4aced7){var _0x528072={'raw':![],'where':{'id':_0x31350b['params']['id']}},_0x3d987f={};_0x3d987f[_0x181c('0x30')]=_[_0x181c('0x32')](db[_0x181c('0x41')]['rawAttributes']);_0x3d987f['query']=_['keys'](_0x31350b[_0x181c('0x31')]);_0x3d987f[_0x181c('0x33')]=_[_0x181c('0x35')](_0x3d987f[_0x181c('0x30')],_0x3d987f[_0x181c('0x31')]);_0x528072[_0x181c('0x34')]=_['intersection'](_0x3d987f[_0x181c('0x30')],qs[_0x181c('0x36')](_0x31350b[_0x181c('0x31')][_0x181c('0x36')]));_0x528072[_0x181c('0x34')]=_0x528072[_0x181c('0x34')]['length']?_0x528072[_0x181c('0x34')]:_0x3d987f[_0x181c('0x30')];if(_0x31350b[_0x181c('0x31')][_0x181c('0x40')]){_0x528072[_0x181c('0x44')]=[{'all':!![]}];}_0x528072=_['merge']({},_0x528072,_0x31350b[_0x181c('0x3e')]);return db[_0x181c('0x41')]['find'](_0x528072)[_0x181c('0x3f')](handleEntityNotFound(_0x4aced7,null))['then'](respondWithResult(_0x4aced7,null))[_0x181c('0x45')](handleError(_0x4aced7,null));};exports['create']=function(_0x352020,_0x3a018e){return db[_0x181c('0x41')][_0x181c('0x46')](_0x352020[_0x181c('0x47')],{})['then'](respondWithResult(_0x3a018e,0xc9))['catch'](handleError(_0x3a018e,null));};exports['update']=function(_0x4102e1,_0x2840ac){if(_0x4102e1[_0x181c('0x47')]['id']){delete _0x4102e1[_0x181c('0x47')]['id'];}return db[_0x181c('0x41')][_0x181c('0x48')]({'where':{'id':_0x4102e1[_0x181c('0x49')]['id']}})[_0x181c('0x3f')](handleEntityNotFound(_0x2840ac,null))[_0x181c('0x3f')](saveUpdates(_0x4102e1['body'],null))['then'](respondWithResult(_0x2840ac,null))['catch'](handleError(_0x2840ac,null));};exports[_0x181c('0x26')]=function(_0x47ee9f,_0x56bb18){return db['Automation'][_0x181c('0x48')]({'where':{'id':_0x47ee9f['params']['id']}})['then'](handleEntityNotFound(_0x56bb18,null))['then'](removeEntity(_0x56bb18,null))[_0x181c('0x45')](handleError(_0x56bb18,null));};exports['addConditions']=function(_0x2d9083,_0x1a1bfe,_0x5f4341){return db['Condition'][_0x181c('0x48')]({'where':{'id':_0x2d9083['params']['id']}})['then'](handleEntityNotFound(_0x1a1bfe,null))[_0x181c('0x3f')](function(_0x5b9232){if(_0x5b9232){return _0x5b9232[_0x181c('0x4a')](_0x2d9083[_0x181c('0x47')]['ids'],_['omit'](_0x2d9083[_0x181c('0x47')],[_0x181c('0x4b'),'id'])||{});}})[_0x181c('0x3f')](respondWithResult(_0x1a1bfe,null))[_0x181c('0x45')](handleError(_0x1a1bfe,null));};exports[_0x181c('0x4c')]=function(_0x3cdd03,_0x1088fd,_0x35e96b){var _0x52b7c4={};var _0x188010={};var _0x1f772e;var _0x49b316;return db[_0x181c('0x41')]['findOne']({'where':{'id':_0x3cdd03['params']['id']}})[_0x181c('0x3f')](handleEntityNotFound(_0x1088fd,null))['then'](function(_0x27442c){if(_0x27442c){_0x1f772e=_0x27442c;_0x188010['model']=_['keys'](db['Condition']['rawAttributes']);_0x188010[_0x181c('0x31')]=_['keys'](_0x3cdd03[_0x181c('0x31')]);_0x188010[_0x181c('0x33')]=_[_0x181c('0x35')](_0x188010[_0x181c('0x30')],_0x188010[_0x181c('0x31')]);_0x52b7c4[_0x181c('0x34')]=_[_0x181c('0x35')](_0x188010[_0x181c('0x30')],qs['fields'](_0x3cdd03[_0x181c('0x31')][_0x181c('0x36')]));_0x52b7c4[_0x181c('0x34')]=_0x52b7c4[_0x181c('0x34')]['length']?_0x52b7c4[_0x181c('0x34')]:_0x188010[_0x181c('0x30')];_0x52b7c4[_0x181c('0x38')]=qs['sort'](_0x3cdd03[_0x181c('0x31')][_0x181c('0x39')]);_0x52b7c4['where']=qs[_0x181c('0x33')](_['pick'](_0x3cdd03[_0x181c('0x31')],_0x188010[_0x181c('0x33')]));if(_0x3cdd03[_0x181c('0x31')][_0x181c('0x3d')]){_0x52b7c4[_0x181c('0x3a')]=_[_0x181c('0x3b')](_0x52b7c4['where'],{'$or':_[_0x181c('0x2b')](_0x52b7c4[_0x181c('0x34')],function(_0x2909c2){var _0x1937ea={};_0x1937ea[_0x2909c2]={'$like':'%'+_0x3cdd03[_0x181c('0x31')][_0x181c('0x3d')]+'%'};return _0x1937ea;})});}_0x52b7c4=_['merge']({},_0x52b7c4,_0x3cdd03[_0x181c('0x3e')]);return _0x1f772e[_0x181c('0x4c')](_0x52b7c4);}})['then'](function(_0x1d4c50){if(_0x1d4c50){_0x49b316=_0x1d4c50['length'];if(!_0x3cdd03['query']['hasOwnProperty'](_0x181c('0x4d'))){_0x52b7c4['limit']=qs['limit'](_0x3cdd03[_0x181c('0x31')]['limit']);_0x52b7c4['offset']=qs[_0x181c('0x20')](_0x3cdd03['query']['offset']);}return _0x1f772e[_0x181c('0x4c')](_0x52b7c4);}})[_0x181c('0x3f')](function(_0x4fcc37){if(_0x4fcc37){return _0x4fcc37?{'count':_0x49b316,'rows':_0x4fcc37}:null;}})[_0x181c('0x3f')](respondWithResult(_0x1088fd,null))['catch'](handleError(_0x1088fd,null));};exports[_0x181c('0x4e')]=function(_0x2f133f,_0x1cf30e,_0x5c8ebc){return db[_0x181c('0x4f')]['find']({'where':{'id':_0x2f133f[_0x181c('0x49')]['id']}})[_0x181c('0x3f')](handleEntityNotFound(_0x1cf30e,null))['then'](function(_0x7e30ae){if(_0x7e30ae){return _0x7e30ae['addActions'](_0x2f133f[_0x181c('0x47')]['ids'],_[_0x181c('0x50')](_0x2f133f[_0x181c('0x47')],[_0x181c('0x4b'),'id'])||{});}})[_0x181c('0x3f')](respondWithResult(_0x1cf30e,null))[_0x181c('0x45')](handleError(_0x1cf30e,null));};exports[_0x181c('0x51')]=function(_0x120998,_0x4bb0d0,_0x3743cd){var _0x5ad225={};var _0x32e69e={};var _0x25e949;var _0x14c2fc;return db[_0x181c('0x41')]['findOne']({'where':{'id':_0x120998['params']['id']}})['then'](handleEntityNotFound(_0x4bb0d0,null))[_0x181c('0x3f')](function(_0x1983f6){if(_0x1983f6){_0x25e949=_0x1983f6;_0x32e69e[_0x181c('0x30')]=_['keys'](db[_0x181c('0x4f')][_0x181c('0x2c')]);_0x32e69e['query']=_['keys'](_0x120998[_0x181c('0x31')]);_0x32e69e['filters']=_[_0x181c('0x35')](_0x32e69e[_0x181c('0x30')],_0x32e69e[_0x181c('0x31')]);_0x5ad225[_0x181c('0x34')]=_[_0x181c('0x35')](_0x32e69e[_0x181c('0x30')],qs[_0x181c('0x36')](_0x120998[_0x181c('0x31')][_0x181c('0x36')]));_0x5ad225[_0x181c('0x34')]=_0x5ad225[_0x181c('0x34')]['length']?_0x5ad225['attributes']:_0x32e69e[_0x181c('0x30')];_0x5ad225[_0x181c('0x38')]=qs[_0x181c('0x39')](_0x120998[_0x181c('0x31')][_0x181c('0x39')]);_0x5ad225[_0x181c('0x3a')]=qs['filters'](_[_0x181c('0x52')](_0x120998[_0x181c('0x31')],_0x32e69e['filters']));if(_0x120998[_0x181c('0x31')][_0x181c('0x3d')]){_0x5ad225[_0x181c('0x3a')]=_['merge'](_0x5ad225['where'],{'$or':_[_0x181c('0x2b')](_0x5ad225[_0x181c('0x34')],function(_0x18d8a7){var _0x8ee720={};_0x8ee720[_0x18d8a7]={'$like':'%'+_0x120998['query'][_0x181c('0x3d')]+'%'};return _0x8ee720;})});}_0x5ad225=_[_0x181c('0x3b')]({},_0x5ad225,_0x120998[_0x181c('0x3e')]);return _0x25e949[_0x181c('0x51')](_0x5ad225);}})[_0x181c('0x3f')](function(_0x177f2d){if(_0x177f2d){_0x14c2fc=_0x177f2d[_0x181c('0x53')];if(!_0x120998[_0x181c('0x31')][_0x181c('0x37')](_0x181c('0x4d'))){_0x5ad225[_0x181c('0x22')]=qs['limit'](_0x120998[_0x181c('0x31')][_0x181c('0x22')]);_0x5ad225['offset']=qs['offset'](_0x120998[_0x181c('0x31')][_0x181c('0x20')]);}return _0x25e949[_0x181c('0x51')](_0x5ad225);}})['then'](function(_0x449af8){if(_0x449af8){return _0x449af8?{'count':_0x14c2fc,'rows':_0x449af8}:null;}})[_0x181c('0x3f')](respondWithResult(_0x4bb0d0,null))[_0x181c('0x45')](handleError(_0x4bb0d0,null));}; \ No newline at end of file +var _0xbe26=['length','options','create','body','catch','find','addConditions','Condition','ids','order','getConditions','addActions','Action','omit','getActions','findOne','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','includeAll','include','rows','show','params','fields'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xbe26,0x175));var _0x6be2=function(_0x12c93d,_0xf99032){_0x12c93d=_0x12c93d-0x0;var _0x21eadb=_0xbe26[_0x12c93d];return _0x21eadb;};'use strict';var emlformat=require(_0x6be2('0x0'));var rimraf=require(_0x6be2('0x1'));var zipdir=require(_0x6be2('0x2'));var jsonpatch=require(_0x6be2('0x3'));var rp=require(_0x6be2('0x4'));var moment=require(_0x6be2('0x5'));var BPromise=require(_0x6be2('0x6'));var Mustache=require(_0x6be2('0x7'));var util=require(_0x6be2('0x8'));var path=require(_0x6be2('0x9'));var sox=require(_0x6be2('0xa'));var csv=require(_0x6be2('0xb'));var ejs=require(_0x6be2('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6be2('0xd'));var squel=require(_0x6be2('0xe'));var crypto=require(_0x6be2('0xf'));var jsforce=require(_0x6be2('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6be2('0xb'));var querystring=require('querystring');var Papa=require(_0x6be2('0x11'));var Redis=require(_0x6be2('0x12'));var authService=require(_0x6be2('0x13'));var qs=require(_0x6be2('0x14'));var as=require(_0x6be2('0x15'));var hardwareService=require(_0x6be2('0x16'));var logger=require(_0x6be2('0x17'))(_0x6be2('0x18'));var utils=require(_0x6be2('0x19'));var config=require(_0x6be2('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x6be2('0x1b'))['db'];function respondWithStatusCode(_0x2e8b69,_0x26cc31){_0x26cc31=_0x26cc31||0xcc;return function(_0x51462d){if(_0x51462d){return _0x2e8b69[_0x6be2('0x1c')](_0x26cc31);}return _0x2e8b69[_0x6be2('0x1d')](_0x26cc31)[_0x6be2('0x1e')]();};}function respondWithResult(_0x8f4829,_0x2a9697){_0x2a9697=_0x2a9697||0xc8;return function(_0x558d96){if(_0x558d96){return _0x8f4829[_0x6be2('0x1d')](_0x2a9697)[_0x6be2('0x1f')](_0x558d96);}};}function respondWithFilteredResult(_0x51f509,_0x2c20ef){return function(_0x2a09a6){if(_0x2a09a6){var _0x4474f1=typeof _0x2c20ef[_0x6be2('0x20')]===_0x6be2('0x21')&&typeof _0x2c20ef[_0x6be2('0x22')]==='undefined';var _0x3282fa=_0x2a09a6[_0x6be2('0x23')];var _0x2e886a=_0x4474f1?0x0:_0x2c20ef['offset'];var _0x12a399=_0x4474f1?_0x2a09a6[_0x6be2('0x23')]:_0x2c20ef[_0x6be2('0x20')]+_0x2c20ef['limit'];var _0x20e01b;if(_0x12a399>=_0x3282fa){_0x12a399=_0x3282fa;_0x20e01b=0xc8;}else{_0x20e01b=0xce;}_0x51f509['status'](_0x20e01b);return _0x51f509[_0x6be2('0x24')](_0x6be2('0x25'),_0x2e886a+'-'+_0x12a399+'/'+_0x3282fa)[_0x6be2('0x1f')](_0x2a09a6);}return null;};}function patchUpdates(_0x5da352){return function(_0x5d6402){try{jsonpatch[_0x6be2('0x26')](_0x5d6402,_0x5da352,!![]);}catch(_0x26a7b8){return BPromise[_0x6be2('0x27')](_0x26a7b8);}return _0x5d6402['save']();};}function saveUpdates(_0x4ef9f8,_0x493bd3){return function(_0x1af414){if(_0x1af414){return _0x1af414['update'](_0x4ef9f8)[_0x6be2('0x28')](function(_0x1103ba){return _0x1103ba;});}return null;};}function removeEntity(_0x59e79e,_0x260e53){return function(_0x20588d){if(_0x20588d){return _0x20588d[_0x6be2('0x29')]()[_0x6be2('0x28')](function(){_0x59e79e[_0x6be2('0x1d')](0xcc)[_0x6be2('0x1e')]();});}};}function handleEntityNotFound(_0x387336,_0x1ab724){return function(_0x2ecdd8){if(!_0x2ecdd8){_0x387336[_0x6be2('0x1c')](0x194);}return _0x2ecdd8;};}function handleError(_0x1a0b3a,_0x45de49){_0x45de49=_0x45de49||0x1f4;return function(_0x34204b){logger[_0x6be2('0x2a')](_0x34204b[_0x6be2('0x2b')]);if(_0x34204b[_0x6be2('0x2c')]){delete _0x34204b[_0x6be2('0x2c')];}_0x1a0b3a['status'](_0x45de49)[_0x6be2('0x2d')](_0x34204b);};}exports[_0x6be2('0x2e')]=function(_0x45449f,_0xe8e21){var _0x4f3900={},_0x357fa4={},_0x1467a8={'count':0x0,'rows':[]};var _0x534740=_[_0x6be2('0x2f')](db[_0x6be2('0x30')][_0x6be2('0x31')],function(_0x1c8678){return{'name':_0x1c8678[_0x6be2('0x32')],'type':_0x1c8678['type'][_0x6be2('0x33')]};});_0x357fa4[_0x6be2('0x34')]=_[_0x6be2('0x2f')](_0x534740,'name');_0x357fa4[_0x6be2('0x35')]=_[_0x6be2('0x36')](_0x45449f[_0x6be2('0x35')]);_0x357fa4[_0x6be2('0x37')]=_[_0x6be2('0x38')](_0x357fa4[_0x6be2('0x34')],_0x357fa4[_0x6be2('0x35')]);_0x4f3900['attributes']=_[_0x6be2('0x38')](_0x357fa4[_0x6be2('0x34')],qs['fields'](_0x45449f[_0x6be2('0x35')]['fields']));_0x4f3900[_0x6be2('0x39')]=_0x4f3900[_0x6be2('0x39')]['length']?_0x4f3900[_0x6be2('0x39')]:_0x357fa4[_0x6be2('0x34')];if(!_0x45449f[_0x6be2('0x35')][_0x6be2('0x3a')](_0x6be2('0x3b'))){_0x4f3900[_0x6be2('0x22')]=qs[_0x6be2('0x22')](_0x45449f['query'][_0x6be2('0x22')]);_0x4f3900['offset']=qs[_0x6be2('0x20')](_0x45449f[_0x6be2('0x35')][_0x6be2('0x20')]);}_0x4f3900['order']=qs[_0x6be2('0x3c')](_0x45449f[_0x6be2('0x35')]['sort']);_0x4f3900[_0x6be2('0x3d')]=qs['filters'](_['pick'](_0x45449f[_0x6be2('0x35')],_0x357fa4['filters']),_0x534740);if(_0x45449f[_0x6be2('0x35')][_0x6be2('0x3e')]){_0x4f3900[_0x6be2('0x3d')]=_['merge'](_0x4f3900[_0x6be2('0x3d')],{'$or':_['map'](_0x534740,function(_0x234452){if(_0x234452[_0x6be2('0x3f')]!==_0x6be2('0x40')){var _0x174325={};_0x174325[_0x234452[_0x6be2('0x2c')]]={'$like':'%'+_0x45449f[_0x6be2('0x35')]['filter']+'%'};return _0x174325;}})});}_0x4f3900=_[_0x6be2('0x41')]({},_0x4f3900,_0x45449f['options']);var _0x50ef20={'where':_0x4f3900['where']};return db[_0x6be2('0x30')]['count'](_0x50ef20)[_0x6be2('0x28')](function(_0x33b2d4){_0x1467a8[_0x6be2('0x23')]=_0x33b2d4;if(_0x45449f[_0x6be2('0x35')][_0x6be2('0x42')]){_0x4f3900[_0x6be2('0x43')]=[{'all':!![]}];}return db[_0x6be2('0x30')]['findAll'](_0x4f3900);})[_0x6be2('0x28')](function(_0x43f494){_0x1467a8[_0x6be2('0x44')]=_0x43f494;return _0x1467a8;})['then'](respondWithFilteredResult(_0xe8e21,_0x4f3900))['catch'](handleError(_0xe8e21,null));};exports[_0x6be2('0x45')]=function(_0x510bb7,_0xe23509){var _0x2e90ba={'raw':![],'where':{'id':_0x510bb7[_0x6be2('0x46')]['id']}},_0xf8c504={};_0xf8c504['model']=_[_0x6be2('0x36')](db[_0x6be2('0x30')][_0x6be2('0x31')]);_0xf8c504['query']=_[_0x6be2('0x36')](_0x510bb7[_0x6be2('0x35')]);_0xf8c504[_0x6be2('0x37')]=_[_0x6be2('0x38')](_0xf8c504[_0x6be2('0x34')],_0xf8c504[_0x6be2('0x35')]);_0x2e90ba['attributes']=_[_0x6be2('0x38')](_0xf8c504[_0x6be2('0x34')],qs[_0x6be2('0x47')](_0x510bb7[_0x6be2('0x35')][_0x6be2('0x47')]));_0x2e90ba[_0x6be2('0x39')]=_0x2e90ba[_0x6be2('0x39')][_0x6be2('0x48')]?_0x2e90ba[_0x6be2('0x39')]:_0xf8c504[_0x6be2('0x34')];if(_0x510bb7[_0x6be2('0x35')][_0x6be2('0x42')]){_0x2e90ba[_0x6be2('0x43')]=[{'all':!![]}];}_0x2e90ba=_['merge']({},_0x2e90ba,_0x510bb7[_0x6be2('0x49')]);return db['Automation']['find'](_0x2e90ba)[_0x6be2('0x28')](handleEntityNotFound(_0xe23509,null))[_0x6be2('0x28')](respondWithResult(_0xe23509,null))['catch'](handleError(_0xe23509,null));};exports['create']=function(_0x27ed4e,_0x2b95db){return db[_0x6be2('0x30')][_0x6be2('0x4a')](_0x27ed4e[_0x6be2('0x4b')],{})[_0x6be2('0x28')](respondWithResult(_0x2b95db,0xc9))[_0x6be2('0x4c')](handleError(_0x2b95db,null));};exports['update']=function(_0x4dd29b,_0x5eef99){if(_0x4dd29b[_0x6be2('0x4b')]['id']){delete _0x4dd29b[_0x6be2('0x4b')]['id'];}return db[_0x6be2('0x30')][_0x6be2('0x4d')]({'where':{'id':_0x4dd29b[_0x6be2('0x46')]['id']}})[_0x6be2('0x28')](handleEntityNotFound(_0x5eef99,null))[_0x6be2('0x28')](saveUpdates(_0x4dd29b[_0x6be2('0x4b')],null))['then'](respondWithResult(_0x5eef99,null))[_0x6be2('0x4c')](handleError(_0x5eef99,null));};exports[_0x6be2('0x29')]=function(_0x4dae47,_0x2ed683){return db['Automation'][_0x6be2('0x4d')]({'where':{'id':_0x4dae47[_0x6be2('0x46')]['id']}})[_0x6be2('0x28')](handleEntityNotFound(_0x2ed683,null))['then'](removeEntity(_0x2ed683,null))['catch'](handleError(_0x2ed683,null));};exports[_0x6be2('0x4e')]=function(_0x4baa3c,_0x57b4ef,_0x4a6687){return db[_0x6be2('0x4f')][_0x6be2('0x4d')]({'where':{'id':_0x4baa3c[_0x6be2('0x46')]['id']}})[_0x6be2('0x28')](handleEntityNotFound(_0x57b4ef,null))[_0x6be2('0x28')](function(_0x280c9f){if(_0x280c9f){return _0x280c9f[_0x6be2('0x4e')](_0x4baa3c[_0x6be2('0x4b')][_0x6be2('0x50')],_['omit'](_0x4baa3c['body'],[_0x6be2('0x50'),'id'])||{});}})[_0x6be2('0x28')](respondWithResult(_0x57b4ef,null))[_0x6be2('0x4c')](handleError(_0x57b4ef,null));};exports['getConditions']=function(_0x21ddc6,_0x164622,_0x236cb7){var _0x27b0df={};var _0x4fec25={};var _0x3e3f73;var _0x4b2f59;return db['Automation']['findOne']({'where':{'id':_0x21ddc6[_0x6be2('0x46')]['id']}})[_0x6be2('0x28')](handleEntityNotFound(_0x164622,null))[_0x6be2('0x28')](function(_0x83569){if(_0x83569){_0x3e3f73=_0x83569;_0x4fec25[_0x6be2('0x34')]=_[_0x6be2('0x36')](db['Condition'][_0x6be2('0x31')]);_0x4fec25['query']=_[_0x6be2('0x36')](_0x21ddc6[_0x6be2('0x35')]);_0x4fec25[_0x6be2('0x37')]=_[_0x6be2('0x38')](_0x4fec25[_0x6be2('0x34')],_0x4fec25[_0x6be2('0x35')]);_0x27b0df[_0x6be2('0x39')]=_[_0x6be2('0x38')](_0x4fec25['model'],qs['fields'](_0x21ddc6[_0x6be2('0x35')][_0x6be2('0x47')]));_0x27b0df['attributes']=_0x27b0df[_0x6be2('0x39')]['length']?_0x27b0df[_0x6be2('0x39')]:_0x4fec25[_0x6be2('0x34')];_0x27b0df[_0x6be2('0x51')]=qs[_0x6be2('0x3c')](_0x21ddc6['query'][_0x6be2('0x3c')]);_0x27b0df['where']=qs[_0x6be2('0x37')](_['pick'](_0x21ddc6[_0x6be2('0x35')],_0x4fec25[_0x6be2('0x37')]));if(_0x21ddc6[_0x6be2('0x35')][_0x6be2('0x3e')]){_0x27b0df[_0x6be2('0x3d')]=_[_0x6be2('0x41')](_0x27b0df[_0x6be2('0x3d')],{'$or':_[_0x6be2('0x2f')](_0x27b0df[_0x6be2('0x39')],function(_0x2a05ee){var _0x4787c7={};_0x4787c7[_0x2a05ee]={'$like':'%'+_0x21ddc6[_0x6be2('0x35')]['filter']+'%'};return _0x4787c7;})});}_0x27b0df=_[_0x6be2('0x41')]({},_0x27b0df,_0x21ddc6[_0x6be2('0x49')]);return _0x3e3f73[_0x6be2('0x52')](_0x27b0df);}})[_0x6be2('0x28')](function(_0x191749){if(_0x191749){_0x4b2f59=_0x191749[_0x6be2('0x48')];if(!_0x21ddc6[_0x6be2('0x35')][_0x6be2('0x3a')]('nolimit')){_0x27b0df[_0x6be2('0x22')]=qs[_0x6be2('0x22')](_0x21ddc6['query'][_0x6be2('0x22')]);_0x27b0df[_0x6be2('0x20')]=qs[_0x6be2('0x20')](_0x21ddc6[_0x6be2('0x35')][_0x6be2('0x20')]);}return _0x3e3f73[_0x6be2('0x52')](_0x27b0df);}})['then'](function(_0x396632){if(_0x396632){return _0x396632?{'count':_0x4b2f59,'rows':_0x396632}:null;}})['then'](respondWithResult(_0x164622,null))[_0x6be2('0x4c')](handleError(_0x164622,null));};exports[_0x6be2('0x53')]=function(_0x5e9a5f,_0x2f3180,_0x4e572e){return db[_0x6be2('0x54')][_0x6be2('0x4d')]({'where':{'id':_0x5e9a5f[_0x6be2('0x46')]['id']}})[_0x6be2('0x28')](handleEntityNotFound(_0x2f3180,null))[_0x6be2('0x28')](function(_0x14442f){if(_0x14442f){return _0x14442f['addActions'](_0x5e9a5f[_0x6be2('0x4b')][_0x6be2('0x50')],_[_0x6be2('0x55')](_0x5e9a5f[_0x6be2('0x4b')],[_0x6be2('0x50'),'id'])||{});}})['then'](respondWithResult(_0x2f3180,null))[_0x6be2('0x4c')](handleError(_0x2f3180,null));};exports[_0x6be2('0x56')]=function(_0x50caab,_0x388024,_0x5d1cb9){var _0x893a31={};var _0x39eded={};var _0x9f514e;var _0x2af0b3;return db[_0x6be2('0x30')][_0x6be2('0x57')]({'where':{'id':_0x50caab[_0x6be2('0x46')]['id']}})['then'](handleEntityNotFound(_0x388024,null))[_0x6be2('0x28')](function(_0x3f368e){if(_0x3f368e){_0x9f514e=_0x3f368e;_0x39eded['model']=_['keys'](db[_0x6be2('0x54')][_0x6be2('0x31')]);_0x39eded[_0x6be2('0x35')]=_[_0x6be2('0x36')](_0x50caab['query']);_0x39eded[_0x6be2('0x37')]=_[_0x6be2('0x38')](_0x39eded[_0x6be2('0x34')],_0x39eded[_0x6be2('0x35')]);_0x893a31[_0x6be2('0x39')]=_['intersection'](_0x39eded['model'],qs[_0x6be2('0x47')](_0x50caab['query'][_0x6be2('0x47')]));_0x893a31[_0x6be2('0x39')]=_0x893a31['attributes'][_0x6be2('0x48')]?_0x893a31[_0x6be2('0x39')]:_0x39eded[_0x6be2('0x34')];_0x893a31[_0x6be2('0x51')]=qs[_0x6be2('0x3c')](_0x50caab['query'][_0x6be2('0x3c')]);_0x893a31[_0x6be2('0x3d')]=qs[_0x6be2('0x37')](_[_0x6be2('0x58')](_0x50caab[_0x6be2('0x35')],_0x39eded[_0x6be2('0x37')]));if(_0x50caab['query'][_0x6be2('0x3e')]){_0x893a31['where']=_[_0x6be2('0x41')](_0x893a31[_0x6be2('0x3d')],{'$or':_[_0x6be2('0x2f')](_0x893a31['attributes'],function(_0x67ac24){var _0x25a55c={};_0x25a55c[_0x67ac24]={'$like':'%'+_0x50caab[_0x6be2('0x35')]['filter']+'%'};return _0x25a55c;})});}_0x893a31=_['merge']({},_0x893a31,_0x50caab[_0x6be2('0x49')]);return _0x9f514e[_0x6be2('0x56')](_0x893a31);}})['then'](function(_0xaedc){if(_0xaedc){_0x2af0b3=_0xaedc['length'];if(!_0x50caab[_0x6be2('0x35')]['hasOwnProperty'](_0x6be2('0x3b'))){_0x893a31[_0x6be2('0x22')]=qs[_0x6be2('0x22')](_0x50caab[_0x6be2('0x35')][_0x6be2('0x22')]);_0x893a31[_0x6be2('0x20')]=qs[_0x6be2('0x20')](_0x50caab[_0x6be2('0x35')][_0x6be2('0x20')]);}return _0x9f514e[_0x6be2('0x56')](_0x893a31);}})['then'](function(_0x1620f8){if(_0x1620f8){return _0x1620f8?{'count':_0x2af0b3,'rows':_0x1620f8}:null;}})[_0x6be2('0x28')](respondWithResult(_0x388024,null))[_0x6be2('0x4c')](handleError(_0x388024,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 8c57b84..9934e4b 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 _0x0d74=['exports','Automation','lodash','util','moment','bluebird','rimraf','../../config/environment','./automation.attributes'];(function(_0x3c20c7,_0x339e21){var _0x5cb0dd=function(_0xa9e4d9){while(--_0xa9e4d9){_0x3c20c7['push'](_0x3c20c7['shift']());}};_0x5cb0dd(++_0x339e21);}(_0x0d74,0x146));var _0x40d7=function(_0x38bbbe,_0x4cd210){_0x38bbbe=_0x38bbbe-0x0;var _0x2b097f=_0x0d74[_0x38bbbe];return _0x2b097f;};'use strict';var _=require(_0x40d7('0x0'));var util=require(_0x40d7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x40d7('0x2'));var BPromise=require(_0x40d7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x40d7('0x4'));var config=require(_0x40d7('0x5'));var attributes=require(_0x40d7('0x6'));module[_0x40d7('0x7')]=function(_0x5edb57,_0x5280f0){return _0x5edb57['define'](_0x40d7('0x8'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8fb=['lodash','util','api','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xd8fb,0x79));var _0xbd8f=function(_0x42d98d,_0x147db9){_0x42d98d=_0x42d98d-0x0;var _0x295ce9=_0xd8fb[_0x42d98d];return _0x295ce9;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require('../../config/logger')(_0xbd8f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbd8f('0x3'));var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require(_0xbd8f('0x6'));var attributes=require(_0xbd8f('0x7'));module[_0xbd8f('0x8')]=function(_0x2a0d0e,_0x5a8676){return _0x2a0d0e['define'](_0xbd8f('0x9'),attributes,{'tableName':_0xbd8f('0xa'),'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 2b6ab7f..d84693f 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 _0xdc97=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5cb831,_0x5ecfca){var _0x5e0cfd=function(_0x1d6190){while(--_0x1d6190){_0x5cb831['push'](_0x5cb831['shift']());}};_0x5e0cfd(++_0x5ecfca);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3ca0b9,_0x1403fe){_0x3ca0b9=_0x3ca0b9-0x0;var _0x5db207=_0xdc97[_0x3ca0b9];return _0x5db207;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dc9('0x4'))['db'];var utils=require(_0x7dc9('0x5'));var logger=require('../../config/logger')(_0x7dc9('0x6'));var config=require(_0x7dc9('0x7'));var jayson=require(_0x7dc9('0x8'));var client=jayson[_0x7dc9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2636ef,_0x4f91c7,_0x4b3229){return new BPromise(function(_0x2ff923,_0x23737d){return client[_0x7dc9('0xa')](_0x2636ef,_0x4b3229)[_0x7dc9('0xb')](function(_0x3dd07e){logger['info'](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));logger[_0x7dc9('0xe')](_0x7dc9('0xf'),_0x4f91c7,_0x7dc9('0xd'),JSON[_0x7dc9('0x10')](_0x3dd07e));if(_0x3dd07e[_0x7dc9('0x11')]){if(_0x3dd07e['error']['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x23737d(_0x3dd07e['error'][_0x7dc9('0x12')]);}logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x2ff923(_0x3dd07e[_0x7dc9('0x11')]['message']);}else{logger[_0x7dc9('0x13')](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));_0x2ff923(_0x3dd07e[_0x7dc9('0x14')][_0x7dc9('0x12')]);}})[_0x7dc9('0x15')](function(_0x45698c){logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x45698c);_0x23737d(_0x45698c);});});} \ No newline at end of file +var _0x8733=['code','Automation,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','error'];(function(_0x40b909,_0x11f814){var _0x5e220f=function(_0x3d87e8){while(--_0x3d87e8){_0x40b909['push'](_0x40b909['shift']());}};_0x5e220f(++_0x11f814);}(_0x8733,0xd7));var _0x3873=function(_0x5e7692,_0x1caa40){_0x5e7692=_0x5e7692-0x0;var _0x120367=_0x8733[_0x5e7692];return _0x120367;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3873('0x0'));var BPromise=require(_0x3873('0x1'));var rs=require(_0x3873('0x2'));var fs=require('fs');var Redis=require(_0x3873('0x3'));var db=require(_0x3873('0x4'))['db'];var utils=require(_0x3873('0x5'));var logger=require(_0x3873('0x6'))(_0x3873('0x7'));var config=require('../../config/environment');var jayson=require(_0x3873('0x8'));var client=jayson[_0x3873('0x9')][_0x3873('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c37e1,_0x2b303a,_0x2fa708){return new BPromise(function(_0x37af67,_0x3fba92){return client[_0x3873('0xb')](_0x4c37e1,_0x2fa708)[_0x3873('0xc')](function(_0x3b9423){logger[_0x3873('0xd')]('Automation,\x20%s,\x20%s',_0x2b303a,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x2b303a,_0x3873('0xe'),JSON['stringify'](_0x3b9423));if(_0x3b9423[_0x3873('0xf')]){if(_0x3b9423['error'][_0x3873('0x10')]===0x1f4){logger[_0x3873('0xf')](_0x3873('0x11'),_0x2b303a,_0x3b9423['error'][_0x3873('0x12')]);return _0x3fba92(_0x3b9423[_0x3873('0xf')]['message']);}logger[_0x3873('0xf')]('Automation,\x20%s,\x20%s',_0x2b303a,_0x3b9423['error']['message']);return _0x37af67(_0x3b9423[_0x3873('0xf')]['message']);}else{logger[_0x3873('0xd')]('Automation,\x20%s,\x20%s',_0x2b303a,_0x3873('0xe'));_0x37af67(_0x3b9423[_0x3873('0x13')][_0x3873('0x12')]);}})[_0x3873('0x14')](function(_0x58c5d6){logger[_0x3873('0xf')]('Automation,\x20%s,\x20%s',_0x2b303a,_0x58c5d6);_0x3fba92(_0x58c5d6);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index ade7fa6..0855455 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 _0x7767=['../../components/interaction/service','./automation.controller','isAuthenticated','index','get','show','/:id/conditions','getConditions','/:id/actions','post','addConditions','put','/:id','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x42fa48,_0x4467ac){var _0xc99c55=function(_0x5d09e4){while(--_0x5d09e4){_0x42fa48['push'](_0x42fa48['shift']());}};_0xc99c55(++_0x4467ac);}(_0x7767,0x16f));var _0x7776=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x7767[_0x38537f];return _0x141e23;};'use strict';var multer=require(_0x7776('0x0'));var util=require('util');var path=require(_0x7776('0x1'));var timeout=require(_0x7776('0x2'));var express=require(_0x7776('0x3'));var router=express[_0x7776('0x4')]();var fs_extra=require(_0x7776('0x5'));var auth=require(_0x7776('0x6'));var interaction=require(_0x7776('0x7'));var config=require('../../config/environment');var controller=require(_0x7776('0x8'));router['get']('/',auth[_0x7776('0x9')](),controller[_0x7776('0xa')]);router[_0x7776('0xb')]('/:id',auth[_0x7776('0x9')](),controller[_0x7776('0xc')]);router[_0x7776('0xb')](_0x7776('0xd'),auth['isAuthenticated'](),controller[_0x7776('0xe')]);router[_0x7776('0xb')](_0x7776('0xf'),auth[_0x7776('0x9')](),controller['getActions']);router[_0x7776('0x10')]('/',auth[_0x7776('0x9')](),controller['create']);router[_0x7776('0x10')](_0x7776('0xd'),auth[_0x7776('0x9')](),controller[_0x7776('0x11')]);router['post'](_0x7776('0xf'),auth[_0x7776('0x9')](),controller['addActions']);router[_0x7776('0x12')](_0x7776('0x13'),auth[_0x7776('0x9')](),controller[_0x7776('0x14')]);router['delete'](_0x7776('0x13'),auth[_0x7776('0x9')](),controller[_0x7776('0x15')]);module['exports']=router; \ No newline at end of file +var _0x84ec=['/:id/actions','getActions','post','create','addConditions','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions'];(function(_0x36cd80,_0x41e617){var _0x3ac5a1=function(_0x2c06b2){while(--_0x2c06b2){_0x36cd80['push'](_0x36cd80['shift']());}};_0x3ac5a1(++_0x41e617);}(_0x84ec,0xe4));var _0xc84e=function(_0x8199b8,_0x124bbe){_0x8199b8=_0x8199b8-0x0;var _0x2a3185=_0x84ec[_0x8199b8];return _0x2a3185;};'use strict';var multer=require(_0xc84e('0x0'));var util=require(_0xc84e('0x1'));var path=require(_0xc84e('0x2'));var timeout=require(_0xc84e('0x3'));var express=require('express');var router=express[_0xc84e('0x4')]();var fs_extra=require(_0xc84e('0x5'));var auth=require(_0xc84e('0x6'));var interaction=require(_0xc84e('0x7'));var config=require('../../config/environment');var controller=require(_0xc84e('0x8'));router[_0xc84e('0x9')]('/',auth[_0xc84e('0xa')](),controller['index']);router[_0xc84e('0x9')](_0xc84e('0xb'),auth[_0xc84e('0xa')](),controller[_0xc84e('0xc')]);router[_0xc84e('0x9')](_0xc84e('0xd'),auth['isAuthenticated'](),controller['getConditions']);router['get'](_0xc84e('0xe'),auth[_0xc84e('0xa')](),controller[_0xc84e('0xf')]);router[_0xc84e('0x10')]('/',auth['isAuthenticated'](),controller[_0xc84e('0x11')]);router[_0xc84e('0x10')](_0xc84e('0xd'),auth['isAuthenticated'](),controller[_0xc84e('0x12')]);router[_0xc84e('0x10')](_0xc84e('0xe'),auth[_0xc84e('0xa')](),controller['addActions']);router[_0xc84e('0x13')](_0xc84e('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc84e('0x14')](_0xc84e('0xb'),auth[_0xc84e('0xa')](),controller[_0xc84e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 37f1444..223dde9 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 _0x81fe=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','INTEGER','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x81fe,0xcd));var _0xe81f=function(_0x2dc878,_0x187970){_0x2dc878=_0x2dc878-0x0;var _0x1ccb2c=_0x81fe[_0x2dc878];return _0x1ccb2c;};'use strict';var Sequelize=require(_0xe81f('0x0'));module['exports']={'name':{'type':Sequelize[_0xe81f('0x1')],'unique':_0xe81f('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xe81f('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xe81f('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xe81f('0x5')],'defaultValue':0x0,'comment':_0xe81f('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xe81f('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xe81f('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe81f('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe81f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe81f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe81f('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe81f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe81f('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe81f('0xb')](0x5)[_0xe81f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe81f('0xb')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xe81f('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe81f('0xb')](0x5)[_0xe81f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xe81f('0xb')](0x3)[_0xe81f('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe81f('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe81f('0x1')],'defaultValue':_0xe81f('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xe81f('0x3')]('always',_0xe81f('0xf'),_0xe81f('0x10')),'defaultValue':_0xe81f('0x11')},'dialAMDActive':{'type':Sequelize[_0xe81f('0x5')],'defaultValue':0x0,'comment':_0xe81f('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xe81f('0xb')](0x9)[_0xe81f('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe81f('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xe81f('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe81f('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe81f('0xb')](0x9)[_0xe81f('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe81f('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe81f('0xb')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe81f('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xe81f('0xb')](0x9)[_0xe81f('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe81f('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe81f('0xb')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe81f('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe81f('0xb')](0x9)[_0xe81f('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe81f('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe81f('0xb')](0x5)[_0xe81f('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe81f('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe81f('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe81f('0x3')](_0xe81f('0x1c'),_0xe81f('0x1d')),'defaultValue':_0xe81f('0x1c')},'dialPrefix':{'type':Sequelize[_0xe81f('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe81f('0xb')](0x3)[_0xe81f('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe81f('0x1e')},'dialCutDigit':{'type':Sequelize[_0xe81f('0xb')](0x3)[_0xe81f('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe81f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe81f('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe81f('0xb')](0x5)[_0xe81f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe81f('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe81f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe81f('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe81f('0xb')](0x3)[_0xe81f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe81f('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe81f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe81f('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe81f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe81f('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xe81f('0xb')](0x5)[_0xe81f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe81f('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe81f('0xb')](0x3)[_0xe81f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe81f('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe81f('0xb')](0x5)[_0xe81f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe81f('0x27')}}; \ No newline at end of file +var _0x517c=['never','onlyIfOpen','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always'];(function(_0x7eecb4,_0x38dbc7){var _0x10bddf=function(_0x539133){while(--_0x539133){_0x7eecb4['push'](_0x7eecb4['shift']());}};_0x10bddf(++_0x38dbc7);}(_0x517c,0x187));var _0xc517=function(_0x313903,_0x338dc6){_0x313903=_0x313903-0x0;var _0x4c6d4b=_0x517c[_0x313903];return _0x4c6d4b;};'use strict';var Sequelize=require(_0xc517('0x0'));module[_0xc517('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc517('0x2')]('ivr'),'allowNull':![],'defaultValue':_0xc517('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xc517('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xc517('0x5')](0x4)[_0xc517('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc517('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc517('0x8')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc517('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xc517('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc517('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc517('0xe')},'dialTimezone':{'type':Sequelize[_0xc517('0x8')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xc517('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xc517('0x2')](_0xc517('0x10'),_0xc517('0x11'),_0xc517('0x12')),'defaultValue':_0xc517('0x10')},'dialAMDActive':{'type':Sequelize[_0xc517('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc517('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc517('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc517('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc517('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc517('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xc517('0x2')](_0xc517('0x16'),_0xc517('0x17')),'defaultValue':_0xc517('0x16')},'dialPrefix':{'type':Sequelize[_0xc517('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc517('0x18')},'dialCutDigit':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc517('0x1a')},'dialDropMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc517('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc517('0x1e')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc517('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc517('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc517('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 3f59a47..4de41c4 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 _0xda20=['findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','rows','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','cm_hopper','scheduledAt','ContactId','ListId','phone','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','into','CmListId','ListId\x20=\x20?','fromQuery','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','save','update','destroy','then','get','UserProfileResource','end','sendStatus','error','name','send','index','fieldName','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','filter','merge','options','Campaign','includeAll','findAll','params','keys','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','IvrCampaigns','getHoppers'];(function(_0x7af729,_0x43763d){var _0x10e5f8=function(_0x3fc464){while(--_0x3fc464){_0x7af729['push'](_0x7af729['shift']());}};_0x10e5f8(++_0x43763d);}(_0xda20,0x1d9));var _0x0da2=function(_0x1472cf,_0x449630){_0x1472cf=_0x1472cf-0x0;var _0x50c661=_0xda20[_0x1472cf];return _0x50c661;};'use strict';var emlformat=require(_0x0da2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0da2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0da2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0da2('0x3'));var util=require(_0x0da2('0x4'));var path=require('path');var sox=require(_0x0da2('0x5'));var csv=require(_0x0da2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0da2('0x7'));var _=require(_0x0da2('0x8'));var squel=require(_0x0da2('0x9'));var crypto=require(_0x0da2('0xa'));var jsforce=require(_0x0da2('0xb'));var deskjs=require(_0x0da2('0xc'));var toCsv=require(_0x0da2('0x6'));var querystring=require(_0x0da2('0xd'));var Papa=require(_0x0da2('0xe'));var Redis=require('ioredis');var authService=require(_0x0da2('0xf'));var qs=require(_0x0da2('0x10'));var as=require(_0x0da2('0x11'));var hardwareService=require(_0x0da2('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x0da2('0x13'));var config=require(_0x0da2('0x14'));var licenseUtil=require(_0x0da2('0x15'));var db=require(_0x0da2('0x16'))['db'];function respondWithStatusCode(_0x19226a,_0x40b4d9){_0x40b4d9=_0x40b4d9||0xcc;return function(_0x34013e){if(_0x34013e){return _0x19226a['sendStatus'](_0x40b4d9);}return _0x19226a[_0x0da2('0x17')](_0x40b4d9)['end']();};}function respondWithResult(_0x5496f5,_0x4cc28c){_0x4cc28c=_0x4cc28c||0xc8;return function(_0x2289c2){if(_0x2289c2){return _0x5496f5['status'](_0x4cc28c)[_0x0da2('0x18')](_0x2289c2);}};}function respondWithFilteredResult(_0x4cae2e,_0x5d0f4e){return function(_0xa0613c){if(_0xa0613c){var _0x65f77=typeof _0x5d0f4e['offset']===_0x0da2('0x19')&&typeof _0x5d0f4e[_0x0da2('0x1a')]===_0x0da2('0x19');var _0x5bd0a7=_0xa0613c[_0x0da2('0x1b')];var _0x395513=_0x65f77?0x0:_0x5d0f4e['offset'];var _0x54a235=_0x65f77?_0xa0613c[_0x0da2('0x1b')]:_0x5d0f4e['offset']+_0x5d0f4e[_0x0da2('0x1a')];var _0x569834;if(_0x54a235>=_0x5bd0a7){_0x54a235=_0x5bd0a7;_0x569834=0xc8;}else{_0x569834=0xce;}_0x4cae2e['status'](_0x569834);return _0x4cae2e['set']('Content-Range',_0x395513+'-'+_0x54a235+'/'+_0x5bd0a7)[_0x0da2('0x18')](_0xa0613c);}return null;};}function patchUpdates(_0x1d685c){return function(_0x2371f1){try{jsonpatch['apply'](_0x2371f1,_0x1d685c,!![]);}catch(_0x5304af){return BPromise['reject'](_0x5304af);}return _0x2371f1[_0x0da2('0x1c')]();};}function saveUpdates(_0x2ce4c4,_0x2f4e01){return function(_0x3d7e96){if(_0x3d7e96){return _0x3d7e96[_0x0da2('0x1d')](_0x2ce4c4)['then'](function(_0x7a3708){return _0x7a3708;});}return null;};}function removeEntity(_0x113c40,_0x1c3ab0){return function(_0x3c3dbc){if(_0x3c3dbc){return _0x3c3dbc[_0x0da2('0x1e')]()[_0x0da2('0x1f')](function(){var _0x3ae5a0=_0x3c3dbc[_0x0da2('0x20')]({'plain':!![]});var _0x3604d3='IvrCampaigns';return db[_0x0da2('0x21')]['destroy']({'where':{'type':_0x3604d3,'resourceId':_0x3ae5a0['id']}})[_0x0da2('0x1f')](function(){return _0x3c3dbc;});})[_0x0da2('0x1f')](function(){_0x113c40[_0x0da2('0x17')](0xcc)[_0x0da2('0x22')]();});}};}function handleEntityNotFound(_0x4b9333,_0x1e9ac4){return function(_0x2a931d){if(!_0x2a931d){_0x4b9333[_0x0da2('0x23')](0x194);}return _0x2a931d;};}function handleError(_0x1d94b3,_0x22c6bf){_0x22c6bf=_0x22c6bf||0x1f4;return function(_0x5083e0){logger[_0x0da2('0x24')](_0x5083e0['stack']);if(_0x5083e0[_0x0da2('0x25')]){delete _0x5083e0[_0x0da2('0x25')];}_0x1d94b3[_0x0da2('0x17')](_0x22c6bf)[_0x0da2('0x26')](_0x5083e0);};}exports[_0x0da2('0x27')]=function(_0x103857,_0x44c3bb){var _0x3c5460={},_0x1f2b6f={},_0x20d591={'count':0x0,'rows':[]};var _0x3981a5=_['map'](db['Campaign']['rawAttributes'],function(_0x94accb){return{'name':_0x94accb[_0x0da2('0x28')],'type':_0x94accb['type']['key']};});_0x1f2b6f[_0x0da2('0x29')]=_[_0x0da2('0x2a')](_0x3981a5,_0x0da2('0x25'));_0x1f2b6f[_0x0da2('0x2b')]=_['keys'](_0x103857[_0x0da2('0x2b')]);_0x1f2b6f['filters']=_[_0x0da2('0x2c')](_0x1f2b6f[_0x0da2('0x29')],_0x1f2b6f[_0x0da2('0x2b')]);_0x3c5460[_0x0da2('0x2d')]=_[_0x0da2('0x2c')](_0x1f2b6f[_0x0da2('0x29')],qs[_0x0da2('0x2e')](_0x103857['query'][_0x0da2('0x2e')]));_0x3c5460[_0x0da2('0x2d')]=_0x3c5460[_0x0da2('0x2d')][_0x0da2('0x2f')]?_0x3c5460[_0x0da2('0x2d')]:_0x1f2b6f[_0x0da2('0x29')];if(!_0x103857['query'][_0x0da2('0x30')](_0x0da2('0x31'))){_0x3c5460[_0x0da2('0x1a')]=qs[_0x0da2('0x1a')](_0x103857['query']['limit']);_0x3c5460[_0x0da2('0x32')]=qs[_0x0da2('0x32')](_0x103857[_0x0da2('0x2b')][_0x0da2('0x32')]);}_0x3c5460[_0x0da2('0x33')]=qs[_0x0da2('0x34')](_0x103857[_0x0da2('0x2b')][_0x0da2('0x34')]);_0x3c5460[_0x0da2('0x35')]=qs['filters'](_[_0x0da2('0x36')](_0x103857[_0x0da2('0x2b')],_0x1f2b6f[_0x0da2('0x37')]),_0x3981a5);if(_0x103857[_0x0da2('0x2b')][_0x0da2('0x38')]){_0x3c5460[_0x0da2('0x35')]=_[_0x0da2('0x39')](_0x3c5460[_0x0da2('0x35')],{'$or':_['map'](_0x3981a5,function(_0x2a5266){if(_0x2a5266['type']!=='VIRTUAL'){var _0xd15984={};_0xd15984[_0x2a5266['name']]={'$like':'%'+_0x103857[_0x0da2('0x2b')][_0x0da2('0x38')]+'%'};return _0xd15984;}})});}_0x3c5460=_[_0x0da2('0x39')]({},_0x3c5460,_0x103857[_0x0da2('0x3a')]);var _0x5eb2e9={'where':_0x3c5460[_0x0da2('0x35')]};return db[_0x0da2('0x3b')][_0x0da2('0x1b')](_0x5eb2e9)[_0x0da2('0x1f')](function(_0x40bbae){_0x20d591[_0x0da2('0x1b')]=_0x40bbae;if(_0x103857[_0x0da2('0x2b')][_0x0da2('0x3c')]){_0x3c5460['include']=[{'all':!![]}];}return db['Campaign'][_0x0da2('0x3d')](_0x3c5460);})['then'](function(_0x325732){_0x20d591['rows']=_0x325732;return _0x20d591;})[_0x0da2('0x1f')](respondWithFilteredResult(_0x44c3bb,_0x3c5460))['catch'](handleError(_0x44c3bb,null));};exports['show']=function(_0x5693ca,_0xa9ef0){var _0x428fd4={'raw':![],'where':{'id':_0x5693ca[_0x0da2('0x3e')]['id']}},_0x11ade3={};_0x11ade3['model']=_[_0x0da2('0x3f')](db['Campaign'][_0x0da2('0x40')]);_0x11ade3[_0x0da2('0x2b')]=_['keys'](_0x5693ca[_0x0da2('0x2b')]);_0x11ade3[_0x0da2('0x37')]=_[_0x0da2('0x2c')](_0x11ade3[_0x0da2('0x29')],_0x11ade3['query']);_0x428fd4[_0x0da2('0x2d')]=_[_0x0da2('0x2c')](_0x11ade3['model'],qs[_0x0da2('0x2e')](_0x5693ca[_0x0da2('0x2b')][_0x0da2('0x2e')]));_0x428fd4[_0x0da2('0x2d')]=_0x428fd4['attributes'][_0x0da2('0x2f')]?_0x428fd4['attributes']:_0x11ade3[_0x0da2('0x29')];if(_0x5693ca[_0x0da2('0x2b')][_0x0da2('0x3c')]){_0x428fd4[_0x0da2('0x41')]=[{'all':!![]}];}_0x428fd4=_[_0x0da2('0x39')]({},_0x428fd4,_0x5693ca['options']);return db[_0x0da2('0x3b')][_0x0da2('0x42')](_0x428fd4)[_0x0da2('0x1f')](handleEntityNotFound(_0xa9ef0,null))[_0x0da2('0x1f')](respondWithResult(_0xa9ef0,null))['catch'](handleError(_0xa9ef0,null));};exports[_0x0da2('0x43')]=function(_0x2b50b7,_0x2c9172){return db[_0x0da2('0x3b')][_0x0da2('0x43')](_0x2b50b7['body'],{})[_0x0da2('0x1f')](function(_0x3054bc){var _0x2937b8=_0x2b50b7[_0x0da2('0x44')][_0x0da2('0x20')]({'plain':!![]});if(!_0x2937b8)throw new Error(_0x0da2('0x45'));if(_0x2937b8[_0x0da2('0x46')]==='user'){var _0x2346fc=_0x3054bc['get']({'plain':!![]});var _0x515612='IvrCampaigns';return db[_0x0da2('0x47')][_0x0da2('0x42')]({'where':{'name':_0x515612,'userProfileId':_0x2937b8[_0x0da2('0x48')]},'raw':!![]})[_0x0da2('0x1f')](function(_0x5537e4){if(_0x5537e4&&_0x5537e4[_0x0da2('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x2346fc['name'],'resourceId':_0x2346fc['id'],'type':_0x5537e4[_0x0da2('0x25')],'sectionId':_0x5537e4['id']},{})[_0x0da2('0x1f')](function(){return _0x3054bc;});}else{return _0x3054bc;}})[_0x0da2('0x4a')](function(_0x33e030){logger['error'](_0x0da2('0x4b'),_0x33e030);throw _0x33e030;});}return _0x3054bc;})[_0x0da2('0x1f')](respondWithResult(_0x2c9172,0xc9))[_0x0da2('0x4a')](handleError(_0x2c9172,null));};exports[_0x0da2('0x4c')]=function(_0x3693b6,_0x1cf2ff){var _0x44e99a={'where':{'id':_0x3693b6[_0x0da2('0x3e')]['id']}},_0x57a920={};_0x57a920[_0x0da2('0x29')]=_[_0x0da2('0x3f')](db[_0x0da2('0x3b')][_0x0da2('0x40')]);_0x44e99a['attributes']=_['intersection'](_0x57a920[_0x0da2('0x29')],qs[_0x0da2('0x2e')](_0x3693b6['query']['fields']));_0x44e99a[_0x0da2('0x2d')]=_0x44e99a[_0x0da2('0x2d')][_0x0da2('0x2f')]?_0x44e99a[_0x0da2('0x2d')]:_0x57a920[_0x0da2('0x29')];if(_0x3693b6[_0x0da2('0x2b')][_0x0da2('0x3c')]){_0x44e99a[_0x0da2('0x41')]=[{'all':!![]}];}_0x44e99a=_[_0x0da2('0x39')]({},_0x44e99a,_0x3693b6[_0x0da2('0x3a')]);return db[_0x0da2('0x3b')][_0x0da2('0x42')](_0x44e99a)[_0x0da2('0x1f')](handleEntityNotFound(_0x1cf2ff,null))[_0x0da2('0x1f')](function(_0x489e36){if(_0x489e36){var _0x10cda4=_0x489e36['get']({'plain':!![]});_0x10cda4=qs['omit'](_0x10cda4,['id',_0x0da2('0x4d'),_0x0da2('0x4e')]);_0x3693b6[_0x0da2('0x4f')]=_[_0x0da2('0x50')](_0x3693b6[_0x0da2('0x4f')],['id',_0x0da2('0x4d'),_0x0da2('0x4e')]);return db['Campaign']['create'](_[_0x0da2('0x39')](_0x10cda4,_0x3693b6['body']),{'include':_0x3693b6['query'][_0x0da2('0x3c')]?[{'all':!![]}]:undefined})[_0x0da2('0x1f')](function(_0x1cbf7b){var _0xed6587=_0x3693b6[_0x0da2('0x44')][_0x0da2('0x20')]({'plain':!![]});if(!_0xed6587)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xed6587[_0x0da2('0x46')]===_0x0da2('0x44')){var _0x1cfc42=_0x1cbf7b[_0x0da2('0x20')]({'plain':!![]});var _0x4d2cf9=_0x0da2('0x51');return db[_0x0da2('0x47')]['find']({'where':{'name':_0x4d2cf9,'userProfileId':_0xed6587[_0x0da2('0x48')]},'raw':!![]})['then'](function(_0x19db59){if(_0x19db59&&_0x19db59[_0x0da2('0x49')]===0x0){return db[_0x0da2('0x21')][_0x0da2('0x43')]({'name':_0x1cfc42[_0x0da2('0x25')],'resourceId':_0x1cfc42['id'],'type':_0x19db59[_0x0da2('0x25')],'sectionId':_0x19db59['id']},{})['then'](function(){return _0x1cbf7b;});}else{return _0x1cbf7b;}})['catch'](function(_0x54b440){logger[_0x0da2('0x24')](_0x0da2('0x4b'),_0x54b440);throw _0x54b440;});}return _0x1cbf7b;});}})[_0x0da2('0x1f')](respondWithResult(_0x1cf2ff,0xc9))['catch'](handleError(_0x1cf2ff,null));};exports['update']=function(_0x20529b,_0x51c1cf){if(_0x20529b[_0x0da2('0x4f')]['id']){delete _0x20529b[_0x0da2('0x4f')]['id'];}return db[_0x0da2('0x3b')][_0x0da2('0x42')]({'where':{'id':_0x20529b[_0x0da2('0x3e')]['id']}})[_0x0da2('0x1f')](handleEntityNotFound(_0x51c1cf,null))[_0x0da2('0x1f')](saveUpdates(_0x20529b[_0x0da2('0x4f')],null))[_0x0da2('0x1f')](respondWithResult(_0x51c1cf,null))['catch'](handleError(_0x51c1cf,null));};exports['destroy']=function(_0xb71616,_0x7c45b6){return db[_0x0da2('0x3b')][_0x0da2('0x42')]({'where':{'id':_0xb71616[_0x0da2('0x3e')]['id']}})[_0x0da2('0x1f')](handleEntityNotFound(_0x7c45b6,null))[_0x0da2('0x1f')](removeEntity(_0x7c45b6,null))[_0x0da2('0x4a')](handleError(_0x7c45b6,null));};exports[_0x0da2('0x52')]=function(_0x1d21d7,_0x45706f,_0x297983){var _0x1b5c11={'raw':!![],'where':{}};var _0x3c9f73={};var _0x32b0d8={'count':0x0,'rows':[]};return db['Campaign'][_0x0da2('0x53')]({'where':{'id':_0x1d21d7[_0x0da2('0x3e')]['id']}})['then'](handleEntityNotFound(_0x45706f,null))[_0x0da2('0x1f')](function(_0x254564){if(_0x254564){_0x3c9f73[_0x0da2('0x29')]=_[_0x0da2('0x3f')](db['CmHopper']['rawAttributes']);_0x3c9f73[_0x0da2('0x2b')]=_[_0x0da2('0x3f')](_0x1d21d7[_0x0da2('0x2b')]);_0x3c9f73[_0x0da2('0x37')]=_[_0x0da2('0x2c')](_0x3c9f73[_0x0da2('0x29')],_0x3c9f73[_0x0da2('0x2b')]);_0x1b5c11['attributes']=_[_0x0da2('0x2c')](_0x3c9f73[_0x0da2('0x29')],qs[_0x0da2('0x2e')](_0x1d21d7[_0x0da2('0x2b')][_0x0da2('0x2e')]));_0x1b5c11['attributes']=_0x1b5c11[_0x0da2('0x2d')][_0x0da2('0x2f')]?_0x1b5c11['attributes']:_0x3c9f73[_0x0da2('0x29')];if(!_0x1d21d7[_0x0da2('0x2b')][_0x0da2('0x30')](_0x0da2('0x31'))){_0x1b5c11[_0x0da2('0x1a')]=qs[_0x0da2('0x1a')](_0x1d21d7[_0x0da2('0x2b')][_0x0da2('0x1a')]);_0x1b5c11[_0x0da2('0x32')]=qs[_0x0da2('0x32')](_0x1d21d7[_0x0da2('0x2b')][_0x0da2('0x32')]);}_0x1b5c11['order']=qs['sort'](_0x1d21d7[_0x0da2('0x2b')][_0x0da2('0x34')]);_0x1b5c11['where']=qs[_0x0da2('0x37')](_[_0x0da2('0x36')](_0x1d21d7[_0x0da2('0x2b')],_0x3c9f73[_0x0da2('0x37')]));_0x1b5c11[_0x0da2('0x35')][_0x0da2('0x54')]=_0x254564['id'];if(_0x1d21d7[_0x0da2('0x2b')][_0x0da2('0x38')]){_0x1b5c11['where']=_[_0x0da2('0x39')](_0x1b5c11[_0x0da2('0x35')],{'$or':_[_0x0da2('0x2a')](_0x1b5c11[_0x0da2('0x2d')],function(_0x4c1de0){var _0x3d52ba={};_0x3d52ba[_0x4c1de0]={'$like':'%'+_0x1d21d7[_0x0da2('0x2b')][_0x0da2('0x38')]+'%'};return _0x3d52ba;})});}_0x1b5c11=_[_0x0da2('0x39')]({},_0x1b5c11,_0x1d21d7['options']);return db['CmHopper'][_0x0da2('0x1b')]({'where':_0x1b5c11['where']})['then'](function(_0xced00a){_0x32b0d8[_0x0da2('0x1b')]=_0xced00a;if(_0x1d21d7[_0x0da2('0x2b')][_0x0da2('0x3c')]){_0x1b5c11[_0x0da2('0x41')]=[{'all':!![]}];}return db[_0x0da2('0x55')][_0x0da2('0x3d')](_0x1b5c11);})[_0x0da2('0x1f')](function(_0x4448fc){_0x32b0d8['rows']=_0x4448fc;return _0x32b0d8;});}})[_0x0da2('0x1f')](respondWithFilteredResult(_0x45706f,_0x1b5c11))[_0x0da2('0x4a')](handleError(_0x45706f,null));};exports[_0x0da2('0x56')]=function(_0x47fedb,_0x3ffd97,_0x3fca49){var _0x270d7d={'raw':!![],'where':{}};var _0x4396aa={};var _0x3fa6a0={'count':0x0,'rows':[]};return db[_0x0da2('0x3b')][_0x0da2('0x53')]({'where':{'id':_0x47fedb[_0x0da2('0x3e')]['id']}})[_0x0da2('0x1f')](handleEntityNotFound(_0x3ffd97,null))[_0x0da2('0x1f')](function(_0x15ac52){if(_0x15ac52){_0x4396aa['model']=_[_0x0da2('0x3f')](db[_0x0da2('0x57')]['rawAttributes']);_0x4396aa[_0x0da2('0x2b')]=_['keys'](_0x47fedb[_0x0da2('0x2b')]);_0x4396aa[_0x0da2('0x37')]=_[_0x0da2('0x2c')](_0x4396aa[_0x0da2('0x29')],_0x4396aa[_0x0da2('0x2b')]);_0x270d7d[_0x0da2('0x2d')]=_[_0x0da2('0x2c')](_0x4396aa['model'],qs[_0x0da2('0x2e')](_0x47fedb[_0x0da2('0x2b')]['fields']));_0x270d7d[_0x0da2('0x2d')]=_0x270d7d[_0x0da2('0x2d')][_0x0da2('0x2f')]?_0x270d7d['attributes']:_0x4396aa[_0x0da2('0x29')];if(!_0x47fedb[_0x0da2('0x2b')][_0x0da2('0x30')]('nolimit')){_0x270d7d[_0x0da2('0x1a')]=qs[_0x0da2('0x1a')](_0x47fedb[_0x0da2('0x2b')][_0x0da2('0x1a')]);_0x270d7d[_0x0da2('0x32')]=qs[_0x0da2('0x32')](_0x47fedb[_0x0da2('0x2b')][_0x0da2('0x32')]);}_0x270d7d[_0x0da2('0x33')]=qs[_0x0da2('0x34')](_0x47fedb[_0x0da2('0x2b')][_0x0da2('0x34')]);_0x270d7d[_0x0da2('0x35')]=qs[_0x0da2('0x37')](_[_0x0da2('0x36')](_0x47fedb[_0x0da2('0x2b')],_0x4396aa['filters']));_0x270d7d[_0x0da2('0x35')][_0x0da2('0x54')]=_0x15ac52['id'];if(_0x47fedb[_0x0da2('0x2b')][_0x0da2('0x38')]){_0x270d7d[_0x0da2('0x35')]=_[_0x0da2('0x39')](_0x270d7d[_0x0da2('0x35')],{'$or':_[_0x0da2('0x2a')](_0x270d7d[_0x0da2('0x2d')],function(_0x5b4095){var _0x2f695d={};_0x2f695d[_0x5b4095]={'$like':'%'+_0x47fedb[_0x0da2('0x2b')][_0x0da2('0x38')]+'%'};return _0x2f695d;})});}_0x270d7d=_[_0x0da2('0x39')]({},_0x270d7d,_0x47fedb['options']);return db['CmHopperHistory'][_0x0da2('0x1b')]({'where':_0x270d7d[_0x0da2('0x35')]})[_0x0da2('0x1f')](function(_0x728223){_0x3fa6a0['count']=_0x728223;if(_0x47fedb[_0x0da2('0x2b')][_0x0da2('0x3c')]){_0x270d7d[_0x0da2('0x41')]=[{'all':!![]}];}return db[_0x0da2('0x57')][_0x0da2('0x3d')](_0x270d7d);})['then'](function(_0x3b368b){_0x3fa6a0['rows']=_0x3b368b;return _0x3fa6a0;});}})[_0x0da2('0x1f')](respondWithFilteredResult(_0x3ffd97,_0x270d7d))[_0x0da2('0x4a')](handleError(_0x3ffd97,null));};exports['getHopperFinals']=function(_0x2c625f,_0x5ab27b,_0x51553e){var _0x303653={'raw':!![],'where':{}};var _0x2100cd={};var _0x9000eb={'count':0x0,'rows':[]};return db['Campaign'][_0x0da2('0x53')]({'where':{'id':_0x2c625f[_0x0da2('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5ab27b,null))[_0x0da2('0x1f')](function(_0x2ab70d){if(_0x2ab70d){_0x2100cd[_0x0da2('0x29')]=_[_0x0da2('0x3f')](db[_0x0da2('0x58')][_0x0da2('0x40')]);_0x2100cd['query']=_[_0x0da2('0x3f')](_0x2c625f[_0x0da2('0x2b')]);_0x2100cd[_0x0da2('0x37')]=_[_0x0da2('0x2c')](_0x2100cd['model'],_0x2100cd[_0x0da2('0x2b')]);_0x303653['attributes']=_['intersection'](_0x2100cd['model'],qs[_0x0da2('0x2e')](_0x2c625f[_0x0da2('0x2b')][_0x0da2('0x2e')]));_0x303653[_0x0da2('0x2d')]=_0x303653[_0x0da2('0x2d')]['length']?_0x303653[_0x0da2('0x2d')]:_0x2100cd[_0x0da2('0x29')];if(!_0x2c625f['query'][_0x0da2('0x30')](_0x0da2('0x31'))){_0x303653[_0x0da2('0x1a')]=qs[_0x0da2('0x1a')](_0x2c625f[_0x0da2('0x2b')]['limit']);_0x303653[_0x0da2('0x32')]=qs['offset'](_0x2c625f[_0x0da2('0x2b')][_0x0da2('0x32')]);}_0x303653[_0x0da2('0x33')]=qs['sort'](_0x2c625f['query'][_0x0da2('0x34')]);_0x303653['where']=qs[_0x0da2('0x37')](_[_0x0da2('0x36')](_0x2c625f['query'],_0x2100cd['filters']));_0x303653[_0x0da2('0x35')][_0x0da2('0x54')]=_0x2ab70d['id'];if(_0x2c625f[_0x0da2('0x2b')][_0x0da2('0x38')]){_0x303653[_0x0da2('0x35')]=_[_0x0da2('0x39')](_0x303653['where'],{'$or':_[_0x0da2('0x2a')](_0x303653[_0x0da2('0x2d')],function(_0x328114){var _0x447da1={};_0x447da1[_0x328114]={'$like':'%'+_0x2c625f[_0x0da2('0x2b')][_0x0da2('0x38')]+'%'};return _0x447da1;})});}_0x303653=_[_0x0da2('0x39')]({},_0x303653,_0x2c625f[_0x0da2('0x3a')]);return db[_0x0da2('0x58')]['count']({'where':_0x303653[_0x0da2('0x35')]})[_0x0da2('0x1f')](function(_0xd19581){_0x9000eb[_0x0da2('0x1b')]=_0xd19581;if(_0x2c625f['query'][_0x0da2('0x3c')]){_0x303653['include']=[{'all':!![]}];}return db[_0x0da2('0x58')]['findAll'](_0x303653);})[_0x0da2('0x1f')](function(_0x2ec20c){_0x9000eb[_0x0da2('0x59')]=_0x2ec20c;return _0x9000eb;});}})[_0x0da2('0x1f')](respondWithFilteredResult(_0x5ab27b,_0x303653))[_0x0da2('0x4a')](handleError(_0x5ab27b,null));};exports[_0x0da2('0x5a')]=function(_0xb6b6dc,_0x2923c9,_0x2131e1){var _0x301c01={'raw':!![],'where':{}};var _0x24a39f={};var _0x160327={'count':0x0,'rows':[]};return db[_0x0da2('0x3b')][_0x0da2('0x53')]({'where':{'id':_0xb6b6dc['params']['id']}})['then'](handleEntityNotFound(_0x2923c9,null))[_0x0da2('0x1f')](function(_0x2f38f0){if(_0x2f38f0){_0x24a39f[_0x0da2('0x29')]=_[_0x0da2('0x3f')](db[_0x0da2('0x5b')][_0x0da2('0x40')]);_0x24a39f['query']=_[_0x0da2('0x3f')](_0xb6b6dc[_0x0da2('0x2b')]);_0x24a39f[_0x0da2('0x37')]=_[_0x0da2('0x2c')](_0x24a39f[_0x0da2('0x29')],_0x24a39f['query']);_0x301c01['attributes']=_[_0x0da2('0x2c')](_0x24a39f[_0x0da2('0x29')],qs['fields'](_0xb6b6dc[_0x0da2('0x2b')][_0x0da2('0x2e')]));_0x301c01[_0x0da2('0x2d')]=_0x301c01[_0x0da2('0x2d')][_0x0da2('0x2f')]?_0x301c01[_0x0da2('0x2d')]:_0x24a39f[_0x0da2('0x29')];if(!_0xb6b6dc[_0x0da2('0x2b')][_0x0da2('0x30')](_0x0da2('0x31'))){_0x301c01[_0x0da2('0x1a')]=qs['limit'](_0xb6b6dc[_0x0da2('0x2b')][_0x0da2('0x1a')]);_0x301c01[_0x0da2('0x32')]=qs[_0x0da2('0x32')](_0xb6b6dc[_0x0da2('0x2b')][_0x0da2('0x32')]);}_0x301c01[_0x0da2('0x33')]=qs[_0x0da2('0x34')](_0xb6b6dc[_0x0da2('0x2b')][_0x0da2('0x34')]);_0x301c01[_0x0da2('0x35')]=qs['filters'](_[_0x0da2('0x36')](_0xb6b6dc['query'],_0x24a39f[_0x0da2('0x37')]));_0x301c01[_0x0da2('0x35')][_0x0da2('0x54')]=_0x2f38f0['id'];if(_0xb6b6dc['query'][_0x0da2('0x38')]){_0x301c01[_0x0da2('0x35')]=_['merge'](_0x301c01['where'],{'$or':_[_0x0da2('0x2a')](_0x301c01[_0x0da2('0x2d')],function(_0x308738){var _0x26d7b3={};_0x26d7b3[_0x308738]={'$like':'%'+_0xb6b6dc[_0x0da2('0x2b')][_0x0da2('0x38')]+'%'};return _0x26d7b3;})});}_0x301c01=_[_0x0da2('0x39')]({},_0x301c01,_0xb6b6dc['options']);return db['CmHopperBlack'][_0x0da2('0x1b')]({'where':_0x301c01['where']})[_0x0da2('0x1f')](function(_0x278149){_0x160327[_0x0da2('0x1b')]=_0x278149;if(_0xb6b6dc['query']['includeAll']){_0x301c01[_0x0da2('0x41')]=[{'all':!![]}];}return db[_0x0da2('0x5b')][_0x0da2('0x3d')](_0x301c01);})['then'](function(_0x36fce7){_0x160327[_0x0da2('0x59')]=_0x36fce7;return _0x160327;});}})[_0x0da2('0x1f')](respondWithFilteredResult(_0x2923c9,_0x301c01))['catch'](handleError(_0x2923c9,null));};exports[_0x0da2('0x5c')]=function(_0x2bbcf0,_0x15246d,_0x4b0371){var _0x191fa6={};var _0x23d946={};var _0x109e81;var _0x4c1616;return db[_0x0da2('0x3b')][_0x0da2('0x53')]({'where':{'id':_0x2bbcf0['params']['id']}})[_0x0da2('0x1f')](handleEntityNotFound(_0x15246d,null))[_0x0da2('0x1f')](function(_0x303b79){if(_0x303b79){_0x109e81=_0x303b79;_0x23d946[_0x0da2('0x29')]=_[_0x0da2('0x3f')](db[_0x0da2('0x5d')]['rawAttributes']);_0x23d946[_0x0da2('0x2b')]=_[_0x0da2('0x3f')](_0x2bbcf0['query']);_0x23d946['filters']=_[_0x0da2('0x2c')](_0x23d946[_0x0da2('0x29')],_0x23d946['query']);_0x191fa6[_0x0da2('0x2d')]=_['intersection'](_0x23d946[_0x0da2('0x29')],qs[_0x0da2('0x2e')](_0x2bbcf0['query']['fields']));_0x191fa6[_0x0da2('0x2d')]=_0x191fa6[_0x0da2('0x2d')][_0x0da2('0x2f')]?_0x191fa6[_0x0da2('0x2d')]:_0x23d946[_0x0da2('0x29')];_0x191fa6[_0x0da2('0x33')]=qs[_0x0da2('0x34')](_0x2bbcf0[_0x0da2('0x2b')]['sort']);_0x191fa6[_0x0da2('0x35')]=qs['filters'](_[_0x0da2('0x36')](_0x2bbcf0[_0x0da2('0x2b')],_0x23d946[_0x0da2('0x37')]));if(_0x2bbcf0['query'][_0x0da2('0x38')]){_0x191fa6[_0x0da2('0x35')]=_[_0x0da2('0x39')](_0x191fa6['where'],{'$or':_[_0x0da2('0x2a')](_0x191fa6[_0x0da2('0x2d')],function(_0x4b82ec){var _0x1b0749={};_0x1b0749[_0x4b82ec]={'$like':'%'+_0x2bbcf0['query'][_0x0da2('0x38')]+'%'};return _0x1b0749;})});}_0x191fa6=_[_0x0da2('0x39')]({},_0x191fa6,_0x2bbcf0['options']);return _0x109e81['getLists'](_0x191fa6);}})['then'](function(_0xa64830){if(_0xa64830){_0x4c1616=_0xa64830[_0x0da2('0x2f')];if(!_0x2bbcf0[_0x0da2('0x2b')][_0x0da2('0x30')](_0x0da2('0x31'))){_0x191fa6[_0x0da2('0x1a')]=qs[_0x0da2('0x1a')](_0x2bbcf0[_0x0da2('0x2b')]['limit']);_0x191fa6[_0x0da2('0x32')]=qs['offset'](_0x2bbcf0[_0x0da2('0x2b')][_0x0da2('0x32')]);}return _0x109e81[_0x0da2('0x5c')](_0x191fa6);}})[_0x0da2('0x1f')](function(_0x3a459b){if(_0x3a459b){return _0x3a459b?{'count':_0x4c1616,'rows':_0x3a459b}:null;}})[_0x0da2('0x1f')](respondWithResult(_0x15246d,null))['catch'](handleError(_0x15246d,null));};exports[_0x0da2('0x5e')]=function(_0x312b77,_0x3fde97,_0x4cd567){var _0x451041,_0x3b9e19;var _0x540169=[];var _0x32e2a6=moment()[_0x0da2('0x5f')](_0x0da2('0x60'));return db['Campaign']['find']({'where':{'id':_0x312b77[_0x0da2('0x3e')]['id']}})[_0x0da2('0x1f')](handleEntityNotFound(_0x3fde97,null))[_0x0da2('0x1f')](function(_0xb49063){if(_0xb49063){_0x3b9e19=_0xb49063;return _0xb49063[_0x0da2('0x5e')](_0x312b77[_0x0da2('0x4f')][_0x0da2('0x61')],_['omit'](_0x312b77[_0x0da2('0x4f')],[_0x0da2('0x61'),'id'])||{});}return null;})[_0x0da2('0x62')](function(_0x492182){var _0x636c1b;var _0x5abddd;_0x451041=_0x492182||[];var _0x4733ac=[];if(_0x492182){for(var _0x5cb0ef=0x0;_0x5cb0ef<_0x492182[_0x0da2('0x2f')];_0x5cb0ef+=0x1){var _0x5b4dbf=_0x492182[_0x5cb0ef]['get']({'plain':!![]});_0x3b9e19[_0x0da2('0x63')]=_0x312b77[_0x0da2('0x4f')][_0x0da2('0x63')]?_0x312b77[_0x0da2('0x4f')][_0x0da2('0x63')]:_0x3b9e19[_0x0da2('0x63')];switch(_0x3b9e19['dialCheckDuplicateType']){case'always':_0x636c1b=squel[_0x0da2('0x64')]()['into'](_0x0da2('0x65'))['fromQuery'](['phone',_0x0da2('0x66'),_0x0da2('0x67'),_0x0da2('0x68'),_0x0da2('0x54'),_0x0da2('0x4d'),_0x0da2('0x4e')],squel['select']()['field'](_0x0da2('0x69'),_0x0da2('0x69'))[_0x0da2('0x6a')](_0x0da2('0x6b'),_0x0da2('0x66'))['field']('id','ContactId')[_0x0da2('0x6a')](_0x5b4dbf['CmListId'][_0x0da2('0x6c')](),_0x0da2('0x68'))[_0x0da2('0x6a')](_0x312b77[_0x0da2('0x3e')]['id'][_0x0da2('0x6c')](),_0x0da2('0x54'))['field']('\x27'+_0x32e2a6+'\x27','createdAt')[_0x0da2('0x6a')]('\x27'+_0x32e2a6+'\x27',_0x0da2('0x4e'))['from'](_0x0da2('0x6d'))['where'](_0x0da2('0x6e'))[_0x0da2('0x35')]('ListId\x20=\x20?',_0x5b4dbf['CmListId'][_0x0da2('0x6c')]())[_0x0da2('0x35')](_0x0da2('0x6f'))['where'](_0x0da2('0x70'),squel[_0x0da2('0x71')]()['field'](_0x0da2('0x72'))[_0x0da2('0x73')]('cm_hopper_final')[_0x0da2('0x35')]('CampaignId\x20=\x20?',_0x312b77['params']['id'][_0x0da2('0x6c')]()))['where'](_0x0da2('0x70'),squel[_0x0da2('0x71')]()['field'](_0x0da2('0x74'))[_0x0da2('0x73')]('cm_hopper')[_0x0da2('0x35')](_0x0da2('0x75'),_0x312b77[_0x0da2('0x3e')]['id'][_0x0da2('0x6c')]())))[_0x0da2('0x6c')]();break;case _0x0da2('0x76'):_0x636c1b=squel['insert']()[_0x0da2('0x77')]('cm_hopper')['fromQuery']([_0x0da2('0x69'),_0x0da2('0x66'),_0x0da2('0x67'),_0x0da2('0x68'),'CampaignId',_0x0da2('0x4d'),'updatedAt'],squel['select']()[_0x0da2('0x6a')]('phone','phone')[_0x0da2('0x6a')](_0x0da2('0x6b'),_0x0da2('0x66'))[_0x0da2('0x6a')]('id',_0x0da2('0x67'))[_0x0da2('0x6a')](_0x5b4dbf[_0x0da2('0x78')][_0x0da2('0x6c')](),_0x0da2('0x68'))[_0x0da2('0x6a')](_0x312b77[_0x0da2('0x3e')]['id'][_0x0da2('0x6c')](),'CampaignId')[_0x0da2('0x6a')]('\x27'+_0x32e2a6+'\x27',_0x0da2('0x4d'))[_0x0da2('0x6a')]('\x27'+_0x32e2a6+'\x27',_0x0da2('0x4e'))[_0x0da2('0x73')](_0x0da2('0x6d'))[_0x0da2('0x35')](_0x0da2('0x6e'))[_0x0da2('0x35')](_0x0da2('0x79'),_0x5b4dbf['CmListId'][_0x0da2('0x6c')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x0da2('0x35')](_0x0da2('0x70'),squel[_0x0da2('0x71')]()[_0x0da2('0x6a')](_0x0da2('0x74'))[_0x0da2('0x73')](_0x0da2('0x65'))[_0x0da2('0x35')]('CampaignId\x20=\x20?',_0x312b77[_0x0da2('0x3e')]['id'][_0x0da2('0x6c')]())))['toString']();break;default:_0x636c1b=squel[_0x0da2('0x64')]()['into'](_0x0da2('0x65'))[_0x0da2('0x7a')](['phone',_0x0da2('0x66'),_0x0da2('0x67'),_0x0da2('0x68'),_0x0da2('0x54'),_0x0da2('0x4d'),_0x0da2('0x4e')],squel['select']()[_0x0da2('0x6a')](_0x0da2('0x69'),_0x0da2('0x69'))[_0x0da2('0x6a')]('NOW()',_0x0da2('0x66'))['field']('id',_0x0da2('0x67'))[_0x0da2('0x6a')](_0x5b4dbf[_0x0da2('0x78')]['toString'](),_0x0da2('0x68'))[_0x0da2('0x6a')](_0x312b77['params']['id'][_0x0da2('0x6c')](),_0x0da2('0x54'))[_0x0da2('0x6a')]('\x27'+_0x32e2a6+'\x27',_0x0da2('0x4d'))[_0x0da2('0x6a')]('\x27'+_0x32e2a6+'\x27',_0x0da2('0x4e'))[_0x0da2('0x73')]('cm_contacts')[_0x0da2('0x35')](_0x0da2('0x6e'))[_0x0da2('0x35')](_0x0da2('0x79'),_0x5b4dbf[_0x0da2('0x78')]['toString']())[_0x0da2('0x35')](_0x0da2('0x6f')))[_0x0da2('0x6c')]();}_0x5abddd=squel[_0x0da2('0x64')]()[_0x0da2('0x77')]('cm_hopper_additional_phones')[_0x0da2('0x7a')](['cmHopperId',_0x0da2('0x66'),_0x0da2('0x69'),_0x0da2('0x7b'),_0x0da2('0x4d'),_0x0da2('0x4e')],squel[_0x0da2('0x71')]()[_0x0da2('0x6a')]('h.id','id')[_0x0da2('0x6a')](_0x0da2('0x6b'),_0x0da2('0x66'))[_0x0da2('0x6a')](_0x0da2('0x7c'),_0x0da2('0x69'))[_0x0da2('0x6a')](_0x0da2('0x7d'),_0x0da2('0x7b'))[_0x0da2('0x6a')]('\x27'+_0x32e2a6+'\x27',_0x0da2('0x4d'))[_0x0da2('0x6a')]('\x27'+_0x32e2a6+'\x27','updatedAt')[_0x0da2('0x73')](_0x0da2('0x7e'),'ci')[_0x0da2('0x7f')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x0da2('0x35')](_0x0da2('0x80'),_0x5b4dbf[_0x0da2('0x78')]['toString']())['where'](_0x0da2('0x81'),_0x312b77[_0x0da2('0x3e')]['id'][_0x0da2('0x6c')]())['where'](_0x0da2('0x82'),_0x32e2a6))[_0x0da2('0x6c')]();_0x4733ac['push'](db[_0x0da2('0x83')]['query'](_0x636c1b));_0x540169[_0x0da2('0x84')](db[_0x0da2('0x83')][_0x0da2('0x2b')](_0x5abddd));}return BPromise['all'](_0x4733ac);}})[_0x0da2('0x1f')](function(){return BPromise[_0x0da2('0x85')](_0x540169);})[_0x0da2('0x1f')](function(){return _0x451041;})[_0x0da2('0x1f')](respondWithResult(_0x3fde97,null))['catch'](handleError(_0x3fde97,null));};exports[_0x0da2('0x86')]=function(_0x3f0494,_0x41a1be,_0xf992c){return db['Campaign'][_0x0da2('0x42')]({'where':{'id':_0x3f0494[_0x0da2('0x3e')]['id']}})[_0x0da2('0x1f')](handleEntityNotFound(_0x41a1be,null))[_0x0da2('0x1f')](function(_0x3d4e71){if(_0x3d4e71){return _0x3d4e71['removeLists'](_0x3f0494[_0x0da2('0x2b')]['ids']);}})[_0x0da2('0x1f')](function(_0x2012cf){if(_0x2012cf){return db['CmHopper'][_0x0da2('0x1e')]({'where':{'ListId':_0x3f0494['query'][_0x0da2('0x61')],'CampaignId':_0x3f0494[_0x0da2('0x3e')]['id']}})['then'](function(){return _0x2012cf;});}})['then'](respondWithStatusCode(_0x41a1be,null))[_0x0da2('0x4a')](handleError(_0x41a1be,null));};exports[_0x0da2('0x87')]=function(_0xf263e3,_0x6eb228,_0x3c5f97){var _0x4fcc11={};var _0x1075e3={};var _0x2992a0;var _0x407091;return db[_0x0da2('0x3b')][_0x0da2('0x53')]({'where':{'id':_0xf263e3[_0x0da2('0x3e')]['id']}})[_0x0da2('0x1f')](handleEntityNotFound(_0x6eb228,null))['then'](function(_0x2cd974){if(_0x2cd974){_0x2992a0=_0x2cd974;_0x1075e3['model']=_[_0x0da2('0x3f')](db[_0x0da2('0x5d')]['rawAttributes']);_0x1075e3[_0x0da2('0x2b')]=_[_0x0da2('0x3f')](_0xf263e3[_0x0da2('0x2b')]);_0x1075e3[_0x0da2('0x37')]=_[_0x0da2('0x2c')](_0x1075e3[_0x0da2('0x29')],_0x1075e3[_0x0da2('0x2b')]);_0x4fcc11[_0x0da2('0x2d')]=_[_0x0da2('0x2c')](_0x1075e3[_0x0da2('0x29')],qs[_0x0da2('0x2e')](_0xf263e3[_0x0da2('0x2b')][_0x0da2('0x2e')]));_0x4fcc11[_0x0da2('0x2d')]=_0x4fcc11[_0x0da2('0x2d')]['length']?_0x4fcc11[_0x0da2('0x2d')]:_0x1075e3[_0x0da2('0x29')];_0x4fcc11['order']=qs[_0x0da2('0x34')](_0xf263e3[_0x0da2('0x2b')][_0x0da2('0x34')]);_0x4fcc11['where']=qs[_0x0da2('0x37')](_[_0x0da2('0x36')](_0xf263e3[_0x0da2('0x2b')],_0x1075e3[_0x0da2('0x37')]));if(_0xf263e3['query'][_0x0da2('0x38')]){_0x4fcc11['where']=_[_0x0da2('0x39')](_0x4fcc11[_0x0da2('0x35')],{'$or':_[_0x0da2('0x2a')](_0x4fcc11[_0x0da2('0x2d')],function(_0xb6b73b){var _0x33ebb7={};_0x33ebb7[_0xb6b73b]={'$like':'%'+_0xf263e3[_0x0da2('0x2b')][_0x0da2('0x38')]+'%'};return _0x33ebb7;})});}_0x4fcc11=_[_0x0da2('0x39')]({},_0x4fcc11,_0xf263e3[_0x0da2('0x3a')]);return _0x2992a0['getBlackLists'](_0x4fcc11);}})[_0x0da2('0x1f')](function(_0xb7e803){if(_0xb7e803){_0x407091=_0xb7e803[_0x0da2('0x2f')];if(!_0xf263e3[_0x0da2('0x2b')][_0x0da2('0x30')](_0x0da2('0x31'))){_0x4fcc11[_0x0da2('0x1a')]=qs[_0x0da2('0x1a')](_0xf263e3[_0x0da2('0x2b')][_0x0da2('0x1a')]);_0x4fcc11[_0x0da2('0x32')]=qs[_0x0da2('0x32')](_0xf263e3[_0x0da2('0x2b')]['offset']);}return _0x2992a0[_0x0da2('0x87')](_0x4fcc11);}})[_0x0da2('0x1f')](function(_0x116f95){if(_0x116f95){return _0x116f95?{'count':_0x407091,'rows':_0x116f95}:null;}})[_0x0da2('0x1f')](respondWithResult(_0x6eb228,null))['catch'](handleError(_0x6eb228,null));};exports[_0x0da2('0x88')]=function(_0x38ce20,_0xfbfe3,_0x4a1a39){var _0x30993f,_0x45a090;var _0x4a36c3=[];var _0x2b1841=moment()[_0x0da2('0x5f')](_0x0da2('0x60'));return db[_0x0da2('0x3b')][_0x0da2('0x42')]({'where':{'id':_0x38ce20['params']['id']}})['then'](handleEntityNotFound(_0xfbfe3,null))[_0x0da2('0x1f')](function(_0x576100){if(_0x576100){_0x45a090=_0x576100;return _0x576100[_0x0da2('0x88')](_0x38ce20['body']['ids'],_[_0x0da2('0x50')](_0x38ce20[_0x0da2('0x4f')],[_0x0da2('0x61'),'id'])||{});}return null;})[_0x0da2('0x62')](function(_0x3e49ca){var _0x4b5d34;var _0x82c84e;_0x30993f=_0x3e49ca||[];var _0x477045=[];if(_0x3e49ca){for(var _0x4670e3=0x0;_0x4670e3<_0x3e49ca[_0x0da2('0x2f')];_0x4670e3+=0x1){var _0x316f63=_0x3e49ca[_0x4670e3]['get']({'plain':!![]});_0x4b5d34=squel['insert']()['into'](_0x0da2('0x89'))['fromQuery']([_0x0da2('0x69'),'ContactId',_0x0da2('0x68'),'CampaignId','createdAt',_0x0da2('0x4e')],squel['select']()['field'](_0x0da2('0x69'),_0x0da2('0x69'))['field']('id','ContactId')[_0x0da2('0x6a')](_0x316f63['CmListId'][_0x0da2('0x6c')](),_0x0da2('0x68'))[_0x0da2('0x6a')](_0x38ce20['params']['id']['toString'](),_0x0da2('0x54'))[_0x0da2('0x6a')](_0x0da2('0x6b'),_0x0da2('0x4d'))[_0x0da2('0x6a')](_0x0da2('0x6b'),_0x0da2('0x4e'))[_0x0da2('0x73')](_0x0da2('0x6d'))[_0x0da2('0x35')]('deletedAt\x20IS\x20NULL')['where'](_0x0da2('0x79'),_0x316f63['CmListId'][_0x0da2('0x6c')]())[_0x0da2('0x35')](_0x0da2('0x6f')))[_0x0da2('0x6c')]();_0x477045[_0x0da2('0x84')](db[_0x0da2('0x83')][_0x0da2('0x2b')](_0x4b5d34));}return BPromise[_0x0da2('0x85')](_0x477045);}})[_0x0da2('0x1f')](function(){return _0x30993f;})[_0x0da2('0x1f')](respondWithResult(_0xfbfe3,null))['catch'](handleError(_0xfbfe3,null));};exports[_0x0da2('0x8a')]=function(_0x239b66,_0x5b0667,_0x378574){return db[_0x0da2('0x3b')][_0x0da2('0x42')]({'where':{'id':_0x239b66[_0x0da2('0x3e')]['id']}})[_0x0da2('0x1f')](handleEntityNotFound(_0x5b0667,null))[_0x0da2('0x1f')](function(_0x4a1ef1){if(_0x4a1ef1){return _0x4a1ef1[_0x0da2('0x8a')](_0x239b66[_0x0da2('0x2b')][_0x0da2('0x61')]);}})['then'](function(_0x162ed9){if(_0x162ed9){return db[_0x0da2('0x5b')]['destroy']({'where':{'ListId':_0x239b66[_0x0da2('0x2b')]['ids'],'CampaignId':_0x239b66[_0x0da2('0x3e')]['id']}})[_0x0da2('0x1f')](function(){return _0x162ed9;});}})[_0x0da2('0x1f')](respondWithStatusCode(_0x5b0667,null))[_0x0da2('0x4a')](handleError(_0x5b0667,null));}; \ No newline at end of file +var _0xdca3=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','order','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','NOW()','field','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','cm_contacts','COALESCE(phone,\x27\x27)','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','fieldName','key','model','query'];(function(_0x4987ca,_0x521560){var _0x18dca4=function(_0x9a579f){while(--_0x9a579f){_0x4987ca['push'](_0x4987ca['shift']());}};_0x18dca4(++_0x521560);}(_0xdca3,0x64));var _0x3dca=function(_0x2a69c3,_0x2ac376){_0x2a69c3=_0x2a69c3-0x0;var _0x5eb837=_0xdca3[_0x2a69c3];return _0x5eb837;};'use strict';var emlformat=require(_0x3dca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dca('0x1'));var jsonpatch=require(_0x3dca('0x2'));var rp=require(_0x3dca('0x3'));var moment=require(_0x3dca('0x4'));var BPromise=require(_0x3dca('0x5'));var Mustache=require(_0x3dca('0x6'));var util=require(_0x3dca('0x7'));var path=require(_0x3dca('0x8'));var sox=require(_0x3dca('0x9'));var csv=require(_0x3dca('0xa'));var ejs=require(_0x3dca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3dca('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3dca('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3dca('0xa'));var querystring=require(_0x3dca('0xe'));var Papa=require(_0x3dca('0xf'));var Redis=require(_0x3dca('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3dca('0x11'));var as=require(_0x3dca('0x12'));var hardwareService=require(_0x3dca('0x13'));var logger=require(_0x3dca('0x14'))(_0x3dca('0x15'));var utils=require(_0x3dca('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3dca('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bfeda,_0x24c6c9){_0x24c6c9=_0x24c6c9||0xcc;return function(_0x11f54e){if(_0x11f54e){return _0x5bfeda[_0x3dca('0x18')](_0x24c6c9);}return _0x5bfeda[_0x3dca('0x19')](_0x24c6c9)[_0x3dca('0x1a')]();};}function respondWithResult(_0x344892,_0xa4149a){_0xa4149a=_0xa4149a||0xc8;return function(_0xf1350d){if(_0xf1350d){return _0x344892[_0x3dca('0x19')](_0xa4149a)[_0x3dca('0x1b')](_0xf1350d);}};}function respondWithFilteredResult(_0x3d1154,_0x911042){return function(_0x1b5906){if(_0x1b5906){var _0x5dc428=typeof _0x911042['offset']===_0x3dca('0x1c')&&typeof _0x911042[_0x3dca('0x1d')]===_0x3dca('0x1c');var _0x1a4ee=_0x1b5906[_0x3dca('0x1e')];var _0x8c046c=_0x5dc428?0x0:_0x911042['offset'];var _0x3a16b4=_0x5dc428?_0x1b5906[_0x3dca('0x1e')]:_0x911042[_0x3dca('0x1f')]+_0x911042[_0x3dca('0x1d')];var _0x4a3cd1;if(_0x3a16b4>=_0x1a4ee){_0x3a16b4=_0x1a4ee;_0x4a3cd1=0xc8;}else{_0x4a3cd1=0xce;}_0x3d1154[_0x3dca('0x19')](_0x4a3cd1);return _0x3d1154[_0x3dca('0x20')](_0x3dca('0x21'),_0x8c046c+'-'+_0x3a16b4+'/'+_0x1a4ee)['json'](_0x1b5906);}return null;};}function patchUpdates(_0x501201){return function(_0x4399ba){try{jsonpatch['apply'](_0x4399ba,_0x501201,!![]);}catch(_0x5f1ad3){return BPromise[_0x3dca('0x22')](_0x5f1ad3);}return _0x4399ba['save']();};}function saveUpdates(_0x4316b7,_0x592459){return function(_0x5b0dee){if(_0x5b0dee){return _0x5b0dee[_0x3dca('0x23')](_0x4316b7)[_0x3dca('0x24')](function(_0x439b6a){return _0x439b6a;});}return null;};}function removeEntity(_0x25f8e7,_0x59be49){return function(_0x18a452){if(_0x18a452){return _0x18a452[_0x3dca('0x25')]()[_0x3dca('0x24')](function(){var _0x4ab095=_0x18a452[_0x3dca('0x26')]({'plain':!![]});var _0x3148ce='IvrCampaigns';return db[_0x3dca('0x27')][_0x3dca('0x25')]({'where':{'type':_0x3148ce,'resourceId':_0x4ab095['id']}})[_0x3dca('0x24')](function(){return _0x18a452;});})[_0x3dca('0x24')](function(){_0x25f8e7[_0x3dca('0x19')](0xcc)[_0x3dca('0x1a')]();});}};}function handleEntityNotFound(_0x212be2,_0x218a56){return function(_0x21973a){if(!_0x21973a){_0x212be2[_0x3dca('0x18')](0x194);}return _0x21973a;};}function handleError(_0x1e277f,_0x225a40){_0x225a40=_0x225a40||0x1f4;return function(_0xa14500){logger[_0x3dca('0x28')](_0xa14500[_0x3dca('0x29')]);if(_0xa14500[_0x3dca('0x2a')]){delete _0xa14500[_0x3dca('0x2a')];}_0x1e277f[_0x3dca('0x19')](_0x225a40)[_0x3dca('0x2b')](_0xa14500);};}exports['index']=function(_0x2cddce,_0x3f064a){var _0x424c41={},_0x2b07c4={},_0x420367={'count':0x0,'rows':[]};var _0x45f346=_[_0x3dca('0x2c')](db['Campaign']['rawAttributes'],function(_0x59b102){return{'name':_0x59b102[_0x3dca('0x2d')],'type':_0x59b102['type'][_0x3dca('0x2e')]};});_0x2b07c4[_0x3dca('0x2f')]=_[_0x3dca('0x2c')](_0x45f346,_0x3dca('0x2a'));_0x2b07c4[_0x3dca('0x30')]=_[_0x3dca('0x31')](_0x2cddce[_0x3dca('0x30')]);_0x2b07c4[_0x3dca('0x32')]=_[_0x3dca('0x33')](_0x2b07c4[_0x3dca('0x2f')],_0x2b07c4[_0x3dca('0x30')]);_0x424c41['attributes']=_[_0x3dca('0x33')](_0x2b07c4[_0x3dca('0x2f')],qs[_0x3dca('0x34')](_0x2cddce[_0x3dca('0x30')]['fields']));_0x424c41[_0x3dca('0x35')]=_0x424c41['attributes'][_0x3dca('0x36')]?_0x424c41[_0x3dca('0x35')]:_0x2b07c4[_0x3dca('0x2f')];if(!_0x2cddce[_0x3dca('0x30')][_0x3dca('0x37')](_0x3dca('0x38'))){_0x424c41[_0x3dca('0x1d')]=qs['limit'](_0x2cddce[_0x3dca('0x30')][_0x3dca('0x1d')]);_0x424c41[_0x3dca('0x1f')]=qs[_0x3dca('0x1f')](_0x2cddce[_0x3dca('0x30')][_0x3dca('0x1f')]);}_0x424c41['order']=qs[_0x3dca('0x39')](_0x2cddce[_0x3dca('0x30')][_0x3dca('0x39')]);_0x424c41[_0x3dca('0x3a')]=qs[_0x3dca('0x32')](_[_0x3dca('0x3b')](_0x2cddce['query'],_0x2b07c4[_0x3dca('0x32')]),_0x45f346);if(_0x2cddce[_0x3dca('0x30')][_0x3dca('0x3c')]){_0x424c41[_0x3dca('0x3a')]=_[_0x3dca('0x3d')](_0x424c41[_0x3dca('0x3a')],{'$or':_[_0x3dca('0x2c')](_0x45f346,function(_0xa20ef4){if(_0xa20ef4[_0x3dca('0x3e')]!==_0x3dca('0x3f')){var _0x232b77={};_0x232b77[_0xa20ef4[_0x3dca('0x2a')]]={'$like':'%'+_0x2cddce[_0x3dca('0x30')][_0x3dca('0x3c')]+'%'};return _0x232b77;}})});}_0x424c41=_[_0x3dca('0x3d')]({},_0x424c41,_0x2cddce[_0x3dca('0x40')]);var _0x27e241={'where':_0x424c41['where']};return db[_0x3dca('0x41')][_0x3dca('0x1e')](_0x27e241)['then'](function(_0x184588){_0x420367[_0x3dca('0x1e')]=_0x184588;if(_0x2cddce[_0x3dca('0x30')][_0x3dca('0x42')]){_0x424c41[_0x3dca('0x43')]=[{'all':!![]}];}return db[_0x3dca('0x41')][_0x3dca('0x44')](_0x424c41);})[_0x3dca('0x24')](function(_0x299567){_0x420367[_0x3dca('0x45')]=_0x299567;return _0x420367;})['then'](respondWithFilteredResult(_0x3f064a,_0x424c41))[_0x3dca('0x46')](handleError(_0x3f064a,null));};exports[_0x3dca('0x47')]=function(_0x3d9c9c,_0x4060ab){var _0x1f9012={'raw':![],'where':{'id':_0x3d9c9c[_0x3dca('0x48')]['id']}},_0x57b2e7={};_0x57b2e7['model']=_['keys'](db['Campaign']['rawAttributes']);_0x57b2e7[_0x3dca('0x30')]=_[_0x3dca('0x31')](_0x3d9c9c[_0x3dca('0x30')]);_0x57b2e7[_0x3dca('0x32')]=_['intersection'](_0x57b2e7[_0x3dca('0x2f')],_0x57b2e7[_0x3dca('0x30')]);_0x1f9012[_0x3dca('0x35')]=_[_0x3dca('0x33')](_0x57b2e7['model'],qs[_0x3dca('0x34')](_0x3d9c9c[_0x3dca('0x30')][_0x3dca('0x34')]));_0x1f9012['attributes']=_0x1f9012[_0x3dca('0x35')][_0x3dca('0x36')]?_0x1f9012[_0x3dca('0x35')]:_0x57b2e7[_0x3dca('0x2f')];if(_0x3d9c9c[_0x3dca('0x30')][_0x3dca('0x42')]){_0x1f9012[_0x3dca('0x43')]=[{'all':!![]}];}_0x1f9012=_['merge']({},_0x1f9012,_0x3d9c9c['options']);return db['Campaign']['find'](_0x1f9012)[_0x3dca('0x24')](handleEntityNotFound(_0x4060ab,null))[_0x3dca('0x24')](respondWithResult(_0x4060ab,null))[_0x3dca('0x46')](handleError(_0x4060ab,null));};exports[_0x3dca('0x49')]=function(_0x1ea5ac,_0x5af8cd){return db[_0x3dca('0x41')][_0x3dca('0x49')](_0x1ea5ac[_0x3dca('0x4a')],{})[_0x3dca('0x24')](function(_0x4252b6){var _0x3fe52f=_0x1ea5ac[_0x3dca('0x4b')][_0x3dca('0x26')]({'plain':!![]});if(!_0x3fe52f)throw new Error(_0x3dca('0x4c'));if(_0x3fe52f[_0x3dca('0x4d')]==='user'){var _0x212544=_0x4252b6[_0x3dca('0x26')]({'plain':!![]});var _0x1c1ef9=_0x3dca('0x4e');return db[_0x3dca('0x4f')][_0x3dca('0x50')]({'where':{'name':_0x1c1ef9,'userProfileId':_0x3fe52f[_0x3dca('0x51')]},'raw':!![]})[_0x3dca('0x24')](function(_0x31831f){if(_0x31831f&&_0x31831f[_0x3dca('0x52')]===0x0){return db['UserProfileResource'][_0x3dca('0x49')]({'name':_0x212544[_0x3dca('0x2a')],'resourceId':_0x212544['id'],'type':_0x31831f[_0x3dca('0x2a')],'sectionId':_0x31831f['id']},{})[_0x3dca('0x24')](function(){return _0x4252b6;});}else{return _0x4252b6;}})[_0x3dca('0x46')](function(_0x24d58f){logger['error'](_0x3dca('0x53'),_0x24d58f);throw _0x24d58f;});}return _0x4252b6;})[_0x3dca('0x24')](respondWithResult(_0x5af8cd,0xc9))['catch'](handleError(_0x5af8cd,null));};exports[_0x3dca('0x54')]=function(_0x32f3f1,_0x5ee396){var _0x47ab1e={'where':{'id':_0x32f3f1[_0x3dca('0x48')]['id']}},_0x5ad335={};_0x5ad335[_0x3dca('0x2f')]=_[_0x3dca('0x31')](db[_0x3dca('0x41')][_0x3dca('0x55')]);_0x47ab1e[_0x3dca('0x35')]=_[_0x3dca('0x33')](_0x5ad335[_0x3dca('0x2f')],qs['fields'](_0x32f3f1[_0x3dca('0x30')][_0x3dca('0x34')]));_0x47ab1e[_0x3dca('0x35')]=_0x47ab1e[_0x3dca('0x35')][_0x3dca('0x36')]?_0x47ab1e[_0x3dca('0x35')]:_0x5ad335['model'];if(_0x32f3f1[_0x3dca('0x30')][_0x3dca('0x42')]){_0x47ab1e[_0x3dca('0x43')]=[{'all':!![]}];}_0x47ab1e=_[_0x3dca('0x3d')]({},_0x47ab1e,_0x32f3f1[_0x3dca('0x40')]);return db[_0x3dca('0x41')][_0x3dca('0x50')](_0x47ab1e)[_0x3dca('0x24')](handleEntityNotFound(_0x5ee396,null))[_0x3dca('0x24')](function(_0x380cd9){if(_0x380cd9){var _0x2d100e=_0x380cd9[_0x3dca('0x26')]({'plain':!![]});_0x2d100e=qs[_0x3dca('0x56')](_0x2d100e,['id','createdAt','updatedAt']);_0x32f3f1['body']=_[_0x3dca('0x56')](_0x32f3f1[_0x3dca('0x4a')],['id',_0x3dca('0x57'),_0x3dca('0x58')]);return db[_0x3dca('0x41')][_0x3dca('0x49')](_[_0x3dca('0x3d')](_0x2d100e,_0x32f3f1[_0x3dca('0x4a')]),{'include':_0x32f3f1[_0x3dca('0x30')][_0x3dca('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x2063a4){var _0x468a9b=_0x32f3f1[_0x3dca('0x4b')][_0x3dca('0x26')]({'plain':!![]});if(!_0x468a9b)throw new Error(_0x3dca('0x4c'));if(_0x468a9b[_0x3dca('0x4d')]===_0x3dca('0x4b')){var _0x45e010=_0x2063a4[_0x3dca('0x26')]({'plain':!![]});var _0xf14197=_0x3dca('0x4e');return db[_0x3dca('0x4f')][_0x3dca('0x50')]({'where':{'name':_0xf14197,'userProfileId':_0x468a9b[_0x3dca('0x51')]},'raw':!![]})['then'](function(_0x40e717){if(_0x40e717&&_0x40e717['autoAssociation']===0x0){return db[_0x3dca('0x27')]['create']({'name':_0x45e010['name'],'resourceId':_0x45e010['id'],'type':_0x40e717[_0x3dca('0x2a')],'sectionId':_0x40e717['id']},{})['then'](function(){return _0x2063a4;});}else{return _0x2063a4;}})[_0x3dca('0x46')](function(_0x2f4189){logger[_0x3dca('0x28')](_0x3dca('0x53'),_0x2f4189);throw _0x2f4189;});}return _0x2063a4;});}})['then'](respondWithResult(_0x5ee396,0xc9))[_0x3dca('0x46')](handleError(_0x5ee396,null));};exports[_0x3dca('0x23')]=function(_0x51c7ec,_0x53aacf){if(_0x51c7ec['body']['id']){delete _0x51c7ec[_0x3dca('0x4a')]['id'];}return db[_0x3dca('0x41')][_0x3dca('0x50')]({'where':{'id':_0x51c7ec[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x53aacf,null))[_0x3dca('0x24')](saveUpdates(_0x51c7ec['body'],null))[_0x3dca('0x24')](respondWithResult(_0x53aacf,null))[_0x3dca('0x46')](handleError(_0x53aacf,null));};exports['destroy']=function(_0x4af7c4,_0x25cd75){return db[_0x3dca('0x41')][_0x3dca('0x50')]({'where':{'id':_0x4af7c4[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x25cd75,null))[_0x3dca('0x24')](removeEntity(_0x25cd75,null))[_0x3dca('0x46')](handleError(_0x25cd75,null));};exports[_0x3dca('0x59')]=function(_0x2020a3,_0x40551d,_0xf4c30){var _0x2a5b45={'raw':!![],'where':{}};var _0x450c8b={};var _0x44f216={'count':0x0,'rows':[]};return db['Campaign'][_0x3dca('0x5a')]({'where':{'id':_0x2020a3[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x40551d,null))['then'](function(_0x104a0e){if(_0x104a0e){_0x450c8b['model']=_[_0x3dca('0x31')](db[_0x3dca('0x5b')][_0x3dca('0x55')]);_0x450c8b[_0x3dca('0x30')]=_[_0x3dca('0x31')](_0x2020a3['query']);_0x450c8b[_0x3dca('0x32')]=_[_0x3dca('0x33')](_0x450c8b[_0x3dca('0x2f')],_0x450c8b[_0x3dca('0x30')]);_0x2a5b45[_0x3dca('0x35')]=_['intersection'](_0x450c8b[_0x3dca('0x2f')],qs['fields'](_0x2020a3[_0x3dca('0x30')][_0x3dca('0x34')]));_0x2a5b45[_0x3dca('0x35')]=_0x2a5b45[_0x3dca('0x35')][_0x3dca('0x36')]?_0x2a5b45[_0x3dca('0x35')]:_0x450c8b[_0x3dca('0x2f')];if(!_0x2020a3['query']['hasOwnProperty'](_0x3dca('0x38'))){_0x2a5b45[_0x3dca('0x1d')]=qs[_0x3dca('0x1d')](_0x2020a3[_0x3dca('0x30')][_0x3dca('0x1d')]);_0x2a5b45[_0x3dca('0x1f')]=qs['offset'](_0x2020a3['query'][_0x3dca('0x1f')]);}_0x2a5b45[_0x3dca('0x5c')]=qs[_0x3dca('0x39')](_0x2020a3[_0x3dca('0x30')][_0x3dca('0x39')]);_0x2a5b45[_0x3dca('0x3a')]=qs['filters'](_[_0x3dca('0x3b')](_0x2020a3['query'],_0x450c8b['filters']));_0x2a5b45[_0x3dca('0x3a')][_0x3dca('0x5d')]=_0x104a0e['id'];if(_0x2020a3[_0x3dca('0x30')][_0x3dca('0x3c')]){_0x2a5b45[_0x3dca('0x3a')]=_[_0x3dca('0x3d')](_0x2a5b45[_0x3dca('0x3a')],{'$or':_['map'](_0x2a5b45['attributes'],function(_0x4fe483){var _0x3dfae0={};_0x3dfae0[_0x4fe483]={'$like':'%'+_0x2020a3[_0x3dca('0x30')][_0x3dca('0x3c')]+'%'};return _0x3dfae0;})});}_0x2a5b45=_[_0x3dca('0x3d')]({},_0x2a5b45,_0x2020a3[_0x3dca('0x40')]);return db[_0x3dca('0x5b')][_0x3dca('0x1e')]({'where':_0x2a5b45[_0x3dca('0x3a')]})[_0x3dca('0x24')](function(_0x2acdbd){_0x44f216[_0x3dca('0x1e')]=_0x2acdbd;if(_0x2020a3['query'][_0x3dca('0x42')]){_0x2a5b45[_0x3dca('0x43')]=[{'all':!![]}];}return db[_0x3dca('0x5b')][_0x3dca('0x44')](_0x2a5b45);})[_0x3dca('0x24')](function(_0x5650f7){_0x44f216[_0x3dca('0x45')]=_0x5650f7;return _0x44f216;});}})[_0x3dca('0x24')](respondWithFilteredResult(_0x40551d,_0x2a5b45))[_0x3dca('0x46')](handleError(_0x40551d,null));};exports[_0x3dca('0x5e')]=function(_0x298b94,_0x5647eb,_0x109dbf){var _0x2f631d={'raw':!![],'where':{}};var _0x1f3390={};var _0x16f946={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x298b94['params']['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x5647eb,null))[_0x3dca('0x24')](function(_0x6b6b41){if(_0x6b6b41){_0x1f3390['model']=_[_0x3dca('0x31')](db[_0x3dca('0x5f')][_0x3dca('0x55')]);_0x1f3390[_0x3dca('0x30')]=_[_0x3dca('0x31')](_0x298b94[_0x3dca('0x30')]);_0x1f3390[_0x3dca('0x32')]=_[_0x3dca('0x33')](_0x1f3390[_0x3dca('0x2f')],_0x1f3390[_0x3dca('0x30')]);_0x2f631d['attributes']=_[_0x3dca('0x33')](_0x1f3390[_0x3dca('0x2f')],qs[_0x3dca('0x34')](_0x298b94[_0x3dca('0x30')][_0x3dca('0x34')]));_0x2f631d['attributes']=_0x2f631d[_0x3dca('0x35')][_0x3dca('0x36')]?_0x2f631d[_0x3dca('0x35')]:_0x1f3390[_0x3dca('0x2f')];if(!_0x298b94['query'][_0x3dca('0x37')](_0x3dca('0x38'))){_0x2f631d[_0x3dca('0x1d')]=qs[_0x3dca('0x1d')](_0x298b94[_0x3dca('0x30')][_0x3dca('0x1d')]);_0x2f631d[_0x3dca('0x1f')]=qs[_0x3dca('0x1f')](_0x298b94[_0x3dca('0x30')]['offset']);}_0x2f631d['order']=qs[_0x3dca('0x39')](_0x298b94[_0x3dca('0x30')][_0x3dca('0x39')]);_0x2f631d[_0x3dca('0x3a')]=qs['filters'](_[_0x3dca('0x3b')](_0x298b94[_0x3dca('0x30')],_0x1f3390['filters']));_0x2f631d[_0x3dca('0x3a')][_0x3dca('0x5d')]=_0x6b6b41['id'];if(_0x298b94[_0x3dca('0x30')][_0x3dca('0x3c')]){_0x2f631d[_0x3dca('0x3a')]=_[_0x3dca('0x3d')](_0x2f631d[_0x3dca('0x3a')],{'$or':_[_0x3dca('0x2c')](_0x2f631d['attributes'],function(_0x2ded82){var _0x510b21={};_0x510b21[_0x2ded82]={'$like':'%'+_0x298b94[_0x3dca('0x30')][_0x3dca('0x3c')]+'%'};return _0x510b21;})});}_0x2f631d=_[_0x3dca('0x3d')]({},_0x2f631d,_0x298b94[_0x3dca('0x40')]);return db['CmHopperHistory'][_0x3dca('0x1e')]({'where':_0x2f631d['where']})[_0x3dca('0x24')](function(_0x933518){_0x16f946[_0x3dca('0x1e')]=_0x933518;if(_0x298b94[_0x3dca('0x30')][_0x3dca('0x42')]){_0x2f631d[_0x3dca('0x43')]=[{'all':!![]}];}return db[_0x3dca('0x5f')][_0x3dca('0x44')](_0x2f631d);})[_0x3dca('0x24')](function(_0x659e94){_0x16f946['rows']=_0x659e94;return _0x16f946;});}})['then'](respondWithFilteredResult(_0x5647eb,_0x2f631d))[_0x3dca('0x46')](handleError(_0x5647eb,null));};exports[_0x3dca('0x60')]=function(_0x57dd8b,_0x4fd410,_0x18d6c1){var _0x4688cf={'raw':!![],'where':{}};var _0x22bd9e={};var _0x1b354d={'count':0x0,'rows':[]};return db[_0x3dca('0x41')][_0x3dca('0x5a')]({'where':{'id':_0x57dd8b['params']['id']}})['then'](handleEntityNotFound(_0x4fd410,null))[_0x3dca('0x24')](function(_0x116ca9){if(_0x116ca9){_0x22bd9e[_0x3dca('0x2f')]=_[_0x3dca('0x31')](db[_0x3dca('0x61')][_0x3dca('0x55')]);_0x22bd9e['query']=_[_0x3dca('0x31')](_0x57dd8b[_0x3dca('0x30')]);_0x22bd9e[_0x3dca('0x32')]=_[_0x3dca('0x33')](_0x22bd9e[_0x3dca('0x2f')],_0x22bd9e[_0x3dca('0x30')]);_0x4688cf[_0x3dca('0x35')]=_['intersection'](_0x22bd9e['model'],qs[_0x3dca('0x34')](_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x34')]));_0x4688cf[_0x3dca('0x35')]=_0x4688cf[_0x3dca('0x35')][_0x3dca('0x36')]?_0x4688cf[_0x3dca('0x35')]:_0x22bd9e[_0x3dca('0x2f')];if(!_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x37')](_0x3dca('0x38'))){_0x4688cf[_0x3dca('0x1d')]=qs[_0x3dca('0x1d')](_0x57dd8b['query']['limit']);_0x4688cf[_0x3dca('0x1f')]=qs[_0x3dca('0x1f')](_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x1f')]);}_0x4688cf[_0x3dca('0x5c')]=qs['sort'](_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x39')]);_0x4688cf[_0x3dca('0x3a')]=qs[_0x3dca('0x32')](_[_0x3dca('0x3b')](_0x57dd8b[_0x3dca('0x30')],_0x22bd9e[_0x3dca('0x32')]));_0x4688cf['where']['CampaignId']=_0x116ca9['id'];if(_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x3c')]){_0x4688cf[_0x3dca('0x3a')]=_[_0x3dca('0x3d')](_0x4688cf['where'],{'$or':_[_0x3dca('0x2c')](_0x4688cf['attributes'],function(_0x5d1361){var _0x5dc558={};_0x5dc558[_0x5d1361]={'$like':'%'+_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x3c')]+'%'};return _0x5dc558;})});}_0x4688cf=_['merge']({},_0x4688cf,_0x57dd8b[_0x3dca('0x40')]);return db[_0x3dca('0x61')][_0x3dca('0x1e')]({'where':_0x4688cf[_0x3dca('0x3a')]})['then'](function(_0x5069d7){_0x1b354d[_0x3dca('0x1e')]=_0x5069d7;if(_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x42')]){_0x4688cf[_0x3dca('0x43')]=[{'all':!![]}];}return db[_0x3dca('0x61')][_0x3dca('0x44')](_0x4688cf);})[_0x3dca('0x24')](function(_0x5914d4){_0x1b354d[_0x3dca('0x45')]=_0x5914d4;return _0x1b354d;});}})['then'](respondWithFilteredResult(_0x4fd410,_0x4688cf))['catch'](handleError(_0x4fd410,null));};exports['getHopperBlacks']=function(_0x320c87,_0x5641fe,_0x4eb2ad){var _0x3b4b51={'raw':!![],'where':{}};var _0x2e8d04={};var _0x3289e8={'count':0x0,'rows':[]};return db['Campaign'][_0x3dca('0x5a')]({'where':{'id':_0x320c87[_0x3dca('0x48')]['id']}})['then'](handleEntityNotFound(_0x5641fe,null))['then'](function(_0x4325a7){if(_0x4325a7){_0x2e8d04[_0x3dca('0x2f')]=_['keys'](db['CmHopperBlack'][_0x3dca('0x55')]);_0x2e8d04['query']=_[_0x3dca('0x31')](_0x320c87[_0x3dca('0x30')]);_0x2e8d04[_0x3dca('0x32')]=_[_0x3dca('0x33')](_0x2e8d04['model'],_0x2e8d04['query']);_0x3b4b51[_0x3dca('0x35')]=_['intersection'](_0x2e8d04[_0x3dca('0x2f')],qs[_0x3dca('0x34')](_0x320c87[_0x3dca('0x30')]['fields']));_0x3b4b51['attributes']=_0x3b4b51['attributes'][_0x3dca('0x36')]?_0x3b4b51[_0x3dca('0x35')]:_0x2e8d04[_0x3dca('0x2f')];if(!_0x320c87['query']['hasOwnProperty']('nolimit')){_0x3b4b51[_0x3dca('0x1d')]=qs[_0x3dca('0x1d')](_0x320c87[_0x3dca('0x30')][_0x3dca('0x1d')]);_0x3b4b51[_0x3dca('0x1f')]=qs[_0x3dca('0x1f')](_0x320c87[_0x3dca('0x30')][_0x3dca('0x1f')]);}_0x3b4b51[_0x3dca('0x5c')]=qs['sort'](_0x320c87[_0x3dca('0x30')][_0x3dca('0x39')]);_0x3b4b51['where']=qs['filters'](_[_0x3dca('0x3b')](_0x320c87[_0x3dca('0x30')],_0x2e8d04[_0x3dca('0x32')]));_0x3b4b51[_0x3dca('0x3a')]['CampaignId']=_0x4325a7['id'];if(_0x320c87[_0x3dca('0x30')]['filter']){_0x3b4b51[_0x3dca('0x3a')]=_[_0x3dca('0x3d')](_0x3b4b51[_0x3dca('0x3a')],{'$or':_['map'](_0x3b4b51['attributes'],function(_0x450a14){var _0x347c36={};_0x347c36[_0x450a14]={'$like':'%'+_0x320c87[_0x3dca('0x30')][_0x3dca('0x3c')]+'%'};return _0x347c36;})});}_0x3b4b51=_[_0x3dca('0x3d')]({},_0x3b4b51,_0x320c87['options']);return db[_0x3dca('0x62')][_0x3dca('0x1e')]({'where':_0x3b4b51['where']})['then'](function(_0x1b927f){_0x3289e8[_0x3dca('0x1e')]=_0x1b927f;if(_0x320c87['query'][_0x3dca('0x42')]){_0x3b4b51[_0x3dca('0x43')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x3b4b51);})[_0x3dca('0x24')](function(_0x12fa9b){_0x3289e8['rows']=_0x12fa9b;return _0x3289e8;});}})[_0x3dca('0x24')](respondWithFilteredResult(_0x5641fe,_0x3b4b51))[_0x3dca('0x46')](handleError(_0x5641fe,null));};exports[_0x3dca('0x63')]=function(_0x1f4dde,_0x485c16,_0x2528b2){var _0x145094={};var _0x583668={};var _0x5b514f;var _0x480b1e;return db[_0x3dca('0x41')][_0x3dca('0x5a')]({'where':{'id':_0x1f4dde[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x485c16,null))[_0x3dca('0x24')](function(_0xc1c26f){if(_0xc1c26f){_0x5b514f=_0xc1c26f;_0x583668[_0x3dca('0x2f')]=_[_0x3dca('0x31')](db[_0x3dca('0x64')][_0x3dca('0x55')]);_0x583668['query']=_['keys'](_0x1f4dde['query']);_0x583668[_0x3dca('0x32')]=_['intersection'](_0x583668['model'],_0x583668[_0x3dca('0x30')]);_0x145094['attributes']=_[_0x3dca('0x33')](_0x583668['model'],qs[_0x3dca('0x34')](_0x1f4dde[_0x3dca('0x30')]['fields']));_0x145094[_0x3dca('0x35')]=_0x145094[_0x3dca('0x35')][_0x3dca('0x36')]?_0x145094['attributes']:_0x583668[_0x3dca('0x2f')];_0x145094['order']=qs['sort'](_0x1f4dde['query'][_0x3dca('0x39')]);_0x145094[_0x3dca('0x3a')]=qs['filters'](_['pick'](_0x1f4dde['query'],_0x583668[_0x3dca('0x32')]));if(_0x1f4dde[_0x3dca('0x30')][_0x3dca('0x3c')]){_0x145094[_0x3dca('0x3a')]=_['merge'](_0x145094['where'],{'$or':_[_0x3dca('0x2c')](_0x145094[_0x3dca('0x35')],function(_0x9c01fc){var _0x428081={};_0x428081[_0x9c01fc]={'$like':'%'+_0x1f4dde[_0x3dca('0x30')]['filter']+'%'};return _0x428081;})});}_0x145094=_[_0x3dca('0x3d')]({},_0x145094,_0x1f4dde['options']);return _0x5b514f[_0x3dca('0x63')](_0x145094);}})['then'](function(_0x2e38d4){if(_0x2e38d4){_0x480b1e=_0x2e38d4[_0x3dca('0x36')];if(!_0x1f4dde['query'][_0x3dca('0x37')](_0x3dca('0x38'))){_0x145094[_0x3dca('0x1d')]=qs[_0x3dca('0x1d')](_0x1f4dde[_0x3dca('0x30')][_0x3dca('0x1d')]);_0x145094[_0x3dca('0x1f')]=qs['offset'](_0x1f4dde[_0x3dca('0x30')]['offset']);}return _0x5b514f[_0x3dca('0x63')](_0x145094);}})[_0x3dca('0x24')](function(_0x304e65){if(_0x304e65){return _0x304e65?{'count':_0x480b1e,'rows':_0x304e65}:null;}})['then'](respondWithResult(_0x485c16,null))[_0x3dca('0x46')](handleError(_0x485c16,null));};exports[_0x3dca('0x65')]=function(_0x2e4f2c,_0x460820,_0x240dd4){var _0xa2dca0,_0x1db782;var _0x155884=[];var _0x476188=moment()['format'](_0x3dca('0x66'));return db[_0x3dca('0x41')][_0x3dca('0x50')]({'where':{'id':_0x2e4f2c[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x460820,null))[_0x3dca('0x24')](function(_0x5681e5){if(_0x5681e5){_0x1db782=_0x5681e5;return _0x5681e5[_0x3dca('0x65')](_0x2e4f2c[_0x3dca('0x4a')][_0x3dca('0x67')],_[_0x3dca('0x56')](_0x2e4f2c['body'],[_0x3dca('0x67'),'id'])||{});}return null;})[_0x3dca('0x68')](function(_0xa440c4){var _0x44f882;var _0x542293;_0xa2dca0=_0xa440c4||[];var _0x4f7768=[];if(_0xa440c4){for(var _0x34e4cb=0x0;_0x34e4cb<_0xa440c4['length'];_0x34e4cb+=0x1){var _0x592be8=_0xa440c4[_0x34e4cb][_0x3dca('0x26')]({'plain':!![]});_0x1db782[_0x3dca('0x69')]=_0x2e4f2c[_0x3dca('0x4a')][_0x3dca('0x69')]?_0x2e4f2c[_0x3dca('0x4a')][_0x3dca('0x69')]:_0x1db782['dialCheckDuplicateType'];switch(_0x1db782[_0x3dca('0x69')]){case _0x3dca('0x6a'):_0x44f882=squel[_0x3dca('0x6b')]()[_0x3dca('0x6c')](_0x3dca('0x6d'))['fromQuery']([_0x3dca('0x6e'),_0x3dca('0x6f'),_0x3dca('0x70'),_0x3dca('0x71'),_0x3dca('0x5d'),_0x3dca('0x57'),_0x3dca('0x58')],squel[_0x3dca('0x72')]()['field']('phone',_0x3dca('0x6e'))['field'](_0x3dca('0x73'),_0x3dca('0x6f'))[_0x3dca('0x74')]('id','ContactId')[_0x3dca('0x74')](_0x592be8[_0x3dca('0x75')]['toString'](),_0x3dca('0x71'))[_0x3dca('0x74')](_0x2e4f2c[_0x3dca('0x48')]['id'][_0x3dca('0x76')](),_0x3dca('0x5d'))['field']('\x27'+_0x476188+'\x27',_0x3dca('0x57'))[_0x3dca('0x74')]('\x27'+_0x476188+'\x27',_0x3dca('0x58'))[_0x3dca('0x77')]('cm_contacts')['where'](_0x3dca('0x78'))[_0x3dca('0x3a')](_0x3dca('0x79'),_0x592be8['CmListId'][_0x3dca('0x76')]())['where'](_0x3dca('0x7a'))[_0x3dca('0x3a')](_0x3dca('0x7b'),squel['select']()[_0x3dca('0x74')](_0x3dca('0x7c'))['from']('cm_hopper_final')[_0x3dca('0x3a')](_0x3dca('0x7d'),_0x2e4f2c[_0x3dca('0x48')]['id']['toString']()))[_0x3dca('0x3a')](_0x3dca('0x7b'),squel[_0x3dca('0x72')]()[_0x3dca('0x74')]('COALESCE(phone,\x27\x27)')[_0x3dca('0x77')](_0x3dca('0x6d'))[_0x3dca('0x3a')](_0x3dca('0x7d'),_0x2e4f2c[_0x3dca('0x48')]['id'][_0x3dca('0x76')]())))['toString']();break;case _0x3dca('0x7e'):_0x44f882=squel[_0x3dca('0x6b')]()[_0x3dca('0x6c')](_0x3dca('0x6d'))[_0x3dca('0x7f')](['phone',_0x3dca('0x6f'),_0x3dca('0x70'),_0x3dca('0x71'),_0x3dca('0x5d'),_0x3dca('0x57'),_0x3dca('0x58')],squel[_0x3dca('0x72')]()[_0x3dca('0x74')](_0x3dca('0x6e'),'phone')[_0x3dca('0x74')](_0x3dca('0x73'),'scheduledAt')[_0x3dca('0x74')]('id',_0x3dca('0x70'))[_0x3dca('0x74')](_0x592be8[_0x3dca('0x75')][_0x3dca('0x76')](),_0x3dca('0x71'))[_0x3dca('0x74')](_0x2e4f2c[_0x3dca('0x48')]['id']['toString'](),_0x3dca('0x5d'))[_0x3dca('0x74')]('\x27'+_0x476188+'\x27',_0x3dca('0x57'))['field']('\x27'+_0x476188+'\x27',_0x3dca('0x58'))[_0x3dca('0x77')](_0x3dca('0x80'))[_0x3dca('0x3a')](_0x3dca('0x78'))[_0x3dca('0x3a')](_0x3dca('0x79'),_0x592be8[_0x3dca('0x75')][_0x3dca('0x76')]())[_0x3dca('0x3a')](_0x3dca('0x7a'))['where'](_0x3dca('0x7b'),squel['select']()['field'](_0x3dca('0x81'))[_0x3dca('0x77')]('cm_hopper')[_0x3dca('0x3a')](_0x3dca('0x7d'),_0x2e4f2c[_0x3dca('0x48')]['id'][_0x3dca('0x76')]())))[_0x3dca('0x76')]();break;default:_0x44f882=squel[_0x3dca('0x6b')]()[_0x3dca('0x6c')](_0x3dca('0x6d'))[_0x3dca('0x7f')](['phone',_0x3dca('0x6f'),_0x3dca('0x70'),_0x3dca('0x71'),_0x3dca('0x5d'),'createdAt',_0x3dca('0x58')],squel[_0x3dca('0x72')]()['field'](_0x3dca('0x6e'),_0x3dca('0x6e'))[_0x3dca('0x74')](_0x3dca('0x73'),_0x3dca('0x6f'))[_0x3dca('0x74')]('id',_0x3dca('0x70'))[_0x3dca('0x74')](_0x592be8['CmListId']['toString'](),'ListId')[_0x3dca('0x74')](_0x2e4f2c[_0x3dca('0x48')]['id'][_0x3dca('0x76')](),_0x3dca('0x5d'))[_0x3dca('0x74')]('\x27'+_0x476188+'\x27','createdAt')['field']('\x27'+_0x476188+'\x27',_0x3dca('0x58'))[_0x3dca('0x77')](_0x3dca('0x80'))[_0x3dca('0x3a')](_0x3dca('0x78'))[_0x3dca('0x3a')]('ListId\x20=\x20?',_0x592be8[_0x3dca('0x75')]['toString']())[_0x3dca('0x3a')](_0x3dca('0x7a')))['toString']();}_0x542293=squel[_0x3dca('0x6b')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x3dca('0x82'),_0x3dca('0x6f'),'phone',_0x3dca('0x83'),_0x3dca('0x57'),_0x3dca('0x58')],squel[_0x3dca('0x72')]()[_0x3dca('0x74')](_0x3dca('0x84'),'id')[_0x3dca('0x74')](_0x3dca('0x73'),_0x3dca('0x6f'))[_0x3dca('0x74')](_0x3dca('0x85'),_0x3dca('0x6e'))[_0x3dca('0x74')](_0x3dca('0x86'),'OrderBy')[_0x3dca('0x74')]('\x27'+_0x476188+'\x27','createdAt')[_0x3dca('0x74')]('\x27'+_0x476188+'\x27',_0x3dca('0x58'))['from'](_0x3dca('0x87'),'ci')[_0x3dca('0x88')](_0x3dca('0x6d'),'h',_0x3dca('0x89'))[_0x3dca('0x3a')]('h.ListId\x20=\x20?',_0x592be8['CmListId'][_0x3dca('0x76')]())[_0x3dca('0x3a')](_0x3dca('0x8a'),_0x2e4f2c['params']['id']['toString']())[_0x3dca('0x3a')](_0x3dca('0x8b'),_0x476188))[_0x3dca('0x76')]();_0x4f7768[_0x3dca('0x8c')](db[_0x3dca('0x8d')][_0x3dca('0x30')](_0x44f882));_0x155884['push'](db[_0x3dca('0x8d')][_0x3dca('0x30')](_0x542293));}return BPromise['all'](_0x4f7768);}})[_0x3dca('0x24')](function(){return BPromise[_0x3dca('0x8e')](_0x155884);})[_0x3dca('0x24')](function(){return _0xa2dca0;})[_0x3dca('0x24')](respondWithResult(_0x460820,null))[_0x3dca('0x46')](handleError(_0x460820,null));};exports[_0x3dca('0x8f')]=function(_0x1424c5,_0x49806e,_0x1689d6){return db['Campaign']['find']({'where':{'id':_0x1424c5[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x49806e,null))[_0x3dca('0x24')](function(_0x3c2a75){if(_0x3c2a75){return _0x3c2a75[_0x3dca('0x8f')](_0x1424c5['query'][_0x3dca('0x67')]);}})[_0x3dca('0x24')](function(_0x32685f){if(_0x32685f){return db[_0x3dca('0x5b')][_0x3dca('0x25')]({'where':{'ListId':_0x1424c5[_0x3dca('0x30')][_0x3dca('0x67')],'CampaignId':_0x1424c5['params']['id']}})['then'](function(){return _0x32685f;});}})[_0x3dca('0x24')](respondWithStatusCode(_0x49806e,null))[_0x3dca('0x46')](handleError(_0x49806e,null));};exports['getBlackLists']=function(_0x30e788,_0x32a051,_0x4cf13a){var _0x581ca8={};var _0x183bca={};var _0x5bcc67;var _0x2e387f;return db[_0x3dca('0x41')][_0x3dca('0x5a')]({'where':{'id':_0x30e788['params']['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x32a051,null))[_0x3dca('0x24')](function(_0x599cfc){if(_0x599cfc){_0x5bcc67=_0x599cfc;_0x183bca['model']=_['keys'](db['CmList'][_0x3dca('0x55')]);_0x183bca[_0x3dca('0x30')]=_[_0x3dca('0x31')](_0x30e788['query']);_0x183bca['filters']=_[_0x3dca('0x33')](_0x183bca[_0x3dca('0x2f')],_0x183bca[_0x3dca('0x30')]);_0x581ca8['attributes']=_[_0x3dca('0x33')](_0x183bca[_0x3dca('0x2f')],qs['fields'](_0x30e788['query'][_0x3dca('0x34')]));_0x581ca8['attributes']=_0x581ca8[_0x3dca('0x35')][_0x3dca('0x36')]?_0x581ca8[_0x3dca('0x35')]:_0x183bca['model'];_0x581ca8['order']=qs['sort'](_0x30e788[_0x3dca('0x30')][_0x3dca('0x39')]);_0x581ca8[_0x3dca('0x3a')]=qs[_0x3dca('0x32')](_[_0x3dca('0x3b')](_0x30e788['query'],_0x183bca[_0x3dca('0x32')]));if(_0x30e788[_0x3dca('0x30')]['filter']){_0x581ca8[_0x3dca('0x3a')]=_[_0x3dca('0x3d')](_0x581ca8[_0x3dca('0x3a')],{'$or':_['map'](_0x581ca8['attributes'],function(_0x2c2406){var _0x37fab5={};_0x37fab5[_0x2c2406]={'$like':'%'+_0x30e788[_0x3dca('0x30')][_0x3dca('0x3c')]+'%'};return _0x37fab5;})});}_0x581ca8=_[_0x3dca('0x3d')]({},_0x581ca8,_0x30e788[_0x3dca('0x40')]);return _0x5bcc67[_0x3dca('0x90')](_0x581ca8);}})[_0x3dca('0x24')](function(_0x283d21){if(_0x283d21){_0x2e387f=_0x283d21['length'];if(!_0x30e788['query'][_0x3dca('0x37')](_0x3dca('0x38'))){_0x581ca8[_0x3dca('0x1d')]=qs[_0x3dca('0x1d')](_0x30e788['query']['limit']);_0x581ca8[_0x3dca('0x1f')]=qs['offset'](_0x30e788[_0x3dca('0x30')]['offset']);}return _0x5bcc67['getBlackLists'](_0x581ca8);}})[_0x3dca('0x24')](function(_0x48edb2){if(_0x48edb2){return _0x48edb2?{'count':_0x2e387f,'rows':_0x48edb2}:null;}})['then'](respondWithResult(_0x32a051,null))[_0x3dca('0x46')](handleError(_0x32a051,null));};exports[_0x3dca('0x91')]=function(_0xb29b5,_0x5c701e,_0x1f4515){var _0x4be4f9,_0x2ee861;var _0x454a6e=[];var _0x591bbf=moment()[_0x3dca('0x92')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3dca('0x41')][_0x3dca('0x50')]({'where':{'id':_0xb29b5['params']['id']}})['then'](handleEntityNotFound(_0x5c701e,null))[_0x3dca('0x24')](function(_0x552c11){if(_0x552c11){_0x2ee861=_0x552c11;return _0x552c11[_0x3dca('0x91')](_0xb29b5[_0x3dca('0x4a')]['ids'],_['omit'](_0xb29b5['body'],[_0x3dca('0x67'),'id'])||{});}return null;})['spread'](function(_0x1ad506){var _0xa421cf;var _0x511153;_0x4be4f9=_0x1ad506||[];var _0x525ece=[];if(_0x1ad506){for(var _0x3d2e5a=0x0;_0x3d2e5a<_0x1ad506[_0x3dca('0x36')];_0x3d2e5a+=0x1){var _0x1229a5=_0x1ad506[_0x3d2e5a][_0x3dca('0x26')]({'plain':!![]});_0xa421cf=squel[_0x3dca('0x6b')]()['into'](_0x3dca('0x93'))['fromQuery']([_0x3dca('0x6e'),_0x3dca('0x70'),_0x3dca('0x71'),_0x3dca('0x5d'),'createdAt',_0x3dca('0x58')],squel[_0x3dca('0x72')]()[_0x3dca('0x74')](_0x3dca('0x6e'),'phone')['field']('id',_0x3dca('0x70'))[_0x3dca('0x74')](_0x1229a5[_0x3dca('0x75')]['toString'](),_0x3dca('0x71'))[_0x3dca('0x74')](_0xb29b5[_0x3dca('0x48')]['id']['toString'](),_0x3dca('0x5d'))[_0x3dca('0x74')]('NOW()',_0x3dca('0x57'))['field']('NOW()',_0x3dca('0x58'))[_0x3dca('0x77')]('cm_contacts')[_0x3dca('0x3a')]('deletedAt\x20IS\x20NULL')[_0x3dca('0x3a')](_0x3dca('0x79'),_0x1229a5[_0x3dca('0x75')][_0x3dca('0x76')]())[_0x3dca('0x3a')](_0x3dca('0x7a')))[_0x3dca('0x76')]();_0x525ece[_0x3dca('0x8c')](db[_0x3dca('0x8d')][_0x3dca('0x30')](_0xa421cf));}return BPromise['all'](_0x525ece);}})[_0x3dca('0x24')](function(){return _0x4be4f9;})['then'](respondWithResult(_0x5c701e,null))[_0x3dca('0x46')](handleError(_0x5c701e,null));};exports[_0x3dca('0x94')]=function(_0x2e1aa0,_0x5a05e6,_0x273843){return db['Campaign'][_0x3dca('0x50')]({'where':{'id':_0x2e1aa0[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x5a05e6,null))[_0x3dca('0x24')](function(_0x16176b){if(_0x16176b){return _0x16176b[_0x3dca('0x94')](_0x2e1aa0[_0x3dca('0x30')][_0x3dca('0x67')]);}})[_0x3dca('0x24')](function(_0x1ac89a){if(_0x1ac89a){return db['CmHopperBlack'][_0x3dca('0x25')]({'where':{'ListId':_0x2e1aa0[_0x3dca('0x30')][_0x3dca('0x67')],'CampaignId':_0x2e1aa0[_0x3dca('0x48')]['id']}})['then'](function(){return _0x1ac89a;});}})['then'](respondWithStatusCode(_0x5a05e6,null))[_0x3dca('0x46')](handleError(_0x5a05e6,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 1f9f1c0..858891b 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 _0x4ecb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./campaign.attributes','exports','define','Campaign'];(function(_0x1d4104,_0x398367){var _0x35a5ea=function(_0x345b04){while(--_0x345b04){_0x1d4104['push'](_0x1d4104['shift']());}};_0x35a5ea(++_0x398367);}(_0x4ecb,0x1c7));var _0xb4ec=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x4ecb[_0x122096];return _0x3d1966;};'use strict';var _=require(_0xb4ec('0x0'));var util=require(_0xb4ec('0x1'));var logger=require(_0xb4ec('0x2'))(_0xb4ec('0x3'));var moment=require(_0xb4ec('0x4'));var BPromise=require(_0xb4ec('0x5'));var rp=require(_0xb4ec('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4ec('0x7'));var config=require(_0xb4ec('0x8'));var attributes=require(_0xb4ec('0x9'));module[_0xb4ec('0xa')]=function(_0xe71ab8,_0x3eb469){return _0xe71ab8[_0xb4ec('0xb')](_0xb4ec('0xc'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c97=['./campaign.attributes','exports','define','Campaign','campaigns','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3f19ff,_0x28033e){var _0x261c33=function(_0x11feac){while(--_0x11feac){_0x3f19ff['push'](_0x3f19ff['shift']());}};_0x261c33(++_0x28033e);}(_0x7c97,0x17e));var _0x77c9=function(_0x1328de,_0x3a1f2d){_0x1328de=_0x1328de-0x0;var _0x535a22=_0x7c97[_0x1328de];return _0x535a22;};'use strict';var _=require('lodash');var util=require(_0x77c9('0x0'));var logger=require(_0x77c9('0x1'))(_0x77c9('0x2'));var moment=require('moment');var BPromise=require(_0x77c9('0x3'));var rp=require(_0x77c9('0x4'));var fs=require('fs');var path=require(_0x77c9('0x5'));var rimraf=require(_0x77c9('0x6'));var config=require(_0x77c9('0x7'));var attributes=require(_0x77c9('0x8'));module[_0x77c9('0x9')]=function(_0xf0586,_0x3a93b5){return _0xf0586[_0x77c9('0xa')](_0x77c9('0xb'),attributes,{'tableName':_0x77c9('0xc'),'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 f597a81..d38efa4 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(_0x3ea196,_0x19f049){var _0xc8e6d3=function(_0x328cc5){while(--_0x328cc5){_0x3ea196['push'](_0x3ea196['shift']());}};_0xc8e6d3(++_0x19f049);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('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(_0x5ec354,_0x4a0d56){var _0xbbaf7f=function(_0xf3f7aa){while(--_0xf3f7aa){_0x5ec354['push'](_0x5ec354['shift']());}};_0xbbaf7f(++_0x4a0d56);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 328becf..9ac5ff5 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 _0x2568=['update','delete','destroy','removeLists','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put'];(function(_0x5dcf1b,_0x7e6b4d){var _0x7c83=function(_0x2b011a){while(--_0x2b011a){_0x5dcf1b['push'](_0x5dcf1b['shift']());}};_0x7c83(++_0x7e6b4d);}(_0x2568,0x1a8));var _0x8256=function(_0x40d3fc,_0x56b986){_0x40d3fc=_0x40d3fc-0x0;var _0x5ccd67=_0x2568[_0x40d3fc];return _0x5ccd67;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8256('0x0'));var timeout=require(_0x8256('0x1'));var express=require(_0x8256('0x2'));var router=express[_0x8256('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8256('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x8256('0x5')]('/',auth[_0x8256('0x6')](),controller[_0x8256('0x7')]);router[_0x8256('0x5')](_0x8256('0x8'),auth[_0x8256('0x6')](),controller[_0x8256('0x9')]);router[_0x8256('0x5')]('/:id/hoppers',auth[_0x8256('0x6')](),controller[_0x8256('0xa')]);router[_0x8256('0x5')](_0x8256('0xb'),auth[_0x8256('0x6')](),controller[_0x8256('0xc')]);router[_0x8256('0x5')](_0x8256('0xd'),auth[_0x8256('0x6')](),controller[_0x8256('0xe')]);router['get'](_0x8256('0xf'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x8256('0x5')](_0x8256('0x10'),auth[_0x8256('0x6')](),controller[_0x8256('0x11')]);router[_0x8256('0x5')](_0x8256('0x12'),auth[_0x8256('0x6')](),controller[_0x8256('0x13')]);router[_0x8256('0x14')]('/',auth['isAuthenticated'](),controller[_0x8256('0x15')]);router[_0x8256('0x14')](_0x8256('0x16'),auth['isAuthenticated'](),controller['clone']);router[_0x8256('0x14')](_0x8256('0x10'),auth[_0x8256('0x6')](),controller[_0x8256('0x17')]);router[_0x8256('0x14')](_0x8256('0x12'),auth[_0x8256('0x6')](),controller[_0x8256('0x18')]);router[_0x8256('0x19')](_0x8256('0x8'),auth[_0x8256('0x6')](),controller[_0x8256('0x1a')]);router[_0x8256('0x1b')](_0x8256('0x8'),auth['isAuthenticated'](),controller[_0x8256('0x1c')]);router[_0x8256('0x1b')](_0x8256('0x10'),auth['isAuthenticated'](),controller[_0x8256('0x1d')]);router[_0x8256('0x1b')](_0x8256('0x12'),auth[_0x8256('0x6')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0xf410=['delete','destroy','removeLists','removeBlackLists','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','/:id/blacklists','addBlackLists','update'];(function(_0x45b9b3,_0x509426){var _0x313cff=function(_0xbff450){while(--_0xbff450){_0x45b9b3['push'](_0x45b9b3['shift']());}};_0x313cff(++_0x509426);}(_0xf410,0x8c));var _0x0f41=function(_0x2aa818,_0x53b9ce){_0x2aa818=_0x2aa818-0x0;var _0x284a5b=_0xf410[_0x2aa818];return _0x284a5b;};'use strict';var multer=require(_0x0f41('0x0'));var util=require(_0x0f41('0x1'));var path=require('path');var timeout=require(_0x0f41('0x2'));var express=require(_0x0f41('0x3'));var router=express['Router']();var fs_extra=require(_0x0f41('0x4'));var auth=require(_0x0f41('0x5'));var interaction=require(_0x0f41('0x6'));var config=require(_0x0f41('0x7'));var controller=require(_0x0f41('0x8'));router[_0x0f41('0x9')]('/',auth[_0x0f41('0xa')](),controller[_0x0f41('0xb')]);router[_0x0f41('0x9')](_0x0f41('0xc'),auth[_0x0f41('0xa')](),controller[_0x0f41('0xd')]);router['get'](_0x0f41('0xe'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x0f41('0x9')](_0x0f41('0xf'),auth[_0x0f41('0xa')](),controller[_0x0f41('0x10')]);router[_0x0f41('0x9')](_0x0f41('0x11'),auth[_0x0f41('0xa')](),controller['getHopperFinals']);router['get'](_0x0f41('0x12'),auth['isAuthenticated'](),controller[_0x0f41('0x13')]);router[_0x0f41('0x9')](_0x0f41('0x14'),auth[_0x0f41('0xa')](),controller[_0x0f41('0x15')]);router[_0x0f41('0x9')]('/:id/blacklists',auth[_0x0f41('0xa')](),controller[_0x0f41('0x16')]);router[_0x0f41('0x17')]('/',auth[_0x0f41('0xa')](),controller[_0x0f41('0x18')]);router['post'](_0x0f41('0x19'),auth['isAuthenticated'](),controller[_0x0f41('0x1a')]);router[_0x0f41('0x17')](_0x0f41('0x14'),auth[_0x0f41('0xa')](),controller['addLists']);router[_0x0f41('0x17')](_0x0f41('0x1b'),auth[_0x0f41('0xa')](),controller[_0x0f41('0x1c')]);router['put'](_0x0f41('0xc'),auth['isAuthenticated'](),controller[_0x0f41('0x1d')]);router[_0x0f41('0x1e')]('/:id',auth[_0x0f41('0xa')](),controller[_0x0f41('0x1f')]);router[_0x0f41('0x1e')](_0x0f41('0x14'),auth[_0x0f41('0xa')](),controller[_0x0f41('0x20')]);router[_0x0f41('0x1e')](_0x0f41('0x1b'),auth['isAuthenticated'](),controller[_0x0f41('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 6a96bf8..3d770c4 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 _0x397f=['key','sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x6411e5,_0x47ddb4){var _0x3343f1=function(_0x3a357f){while(--_0x3a357f){_0x6411e5['push'](_0x6411e5['shift']());}};_0x3343f1(++_0x47ddb4);}(_0x397f,0xf6));var _0xf397=function(_0x386cc2,_0x30a175){_0x386cc2=_0x386cc2-0x0;var _0x1ae9ce=_0x397f[_0x386cc2];return _0x1ae9ce;};'use strict';var Sequelize=require(_0xf397('0x0'));module[_0xf397('0x1')]={'key':{'type':Sequelize[_0xf397('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xf397('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xf397('0x4')],'get':function(){return this[_0xf397('0x5')](_0xf397('0x6'));}}}; \ No newline at end of file +var _0xcff0=['getDataValue','sequelize','STRING','VIRTUAL'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xcff0,0x1dd));var _0x0cff=function(_0x21311f,_0x29dc32){_0x21311f=_0x21311f-0x0;var _0x5b0e1e=_0xcff0[_0x21311f];return _0x5b0e1e;};'use strict';var Sequelize=require(_0x0cff('0x0'));module['exports']={'key':{'type':Sequelize[_0x0cff('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x0cff('0x1')]},'name':{'type':Sequelize[_0x0cff('0x2')],'get':function(){return this[_0x0cff('0x3')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index e64cf38..ab486b2 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 _0xff24=['role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','keys','rawAttributes','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x5b0909,_0x71dc3d){var _0x59b22c=function(_0x71b0b6){while(--_0x71b0b6){_0x5b0909['push'](_0x5b0909['shift']());}};_0x59b22c(++_0x71dc3d);}(_0xff24,0xb6));var _0x4ff2=function(_0x1963c8,_0x2e3ced){_0x1963c8=_0x1963c8-0x0;var _0x51ea58=_0xff24[_0x1963c8];return _0x51ea58;};'use strict';var emlformat=require(_0x4ff2('0x0'));var rimraf=require(_0x4ff2('0x1'));var zipdir=require(_0x4ff2('0x2'));var jsonpatch=require(_0x4ff2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ff2('0x4'));var Mustache=require('mustache');var util=require(_0x4ff2('0x5'));var path=require(_0x4ff2('0x6'));var sox=require(_0x4ff2('0x7'));var csv=require('to-csv');var ejs=require(_0x4ff2('0x8'));var fs=require('fs');var fs_extra=require(_0x4ff2('0x9'));var _=require(_0x4ff2('0xa'));var squel=require('squel');var crypto=require(_0x4ff2('0xb'));var jsforce=require(_0x4ff2('0xc'));var deskjs=require(_0x4ff2('0xd'));var toCsv=require(_0x4ff2('0xe'));var querystring=require(_0x4ff2('0xf'));var Papa=require(_0x4ff2('0x10'));var Redis=require(_0x4ff2('0x11'));var authService=require(_0x4ff2('0x12'));var qs=require(_0x4ff2('0x13'));var as=require(_0x4ff2('0x14'));var hardwareService=require(_0x4ff2('0x15'));var logger=require(_0x4ff2('0x16'))('api');var utils=require(_0x4ff2('0x17'));var config=require(_0x4ff2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4ff2('0x19'))['db'];function respondWithStatusCode(_0x1ff4e4,_0x4d08cf){_0x4d08cf=_0x4d08cf||0xcc;return function(_0x354b95){if(_0x354b95){return _0x1ff4e4[_0x4ff2('0x1a')](_0x4d08cf);}return _0x1ff4e4['status'](_0x4d08cf)[_0x4ff2('0x1b')]();};}function respondWithResult(_0x45b21a,_0xbd80a7){_0xbd80a7=_0xbd80a7||0xc8;return function(_0x3d34ad){if(_0x3d34ad){return _0x45b21a[_0x4ff2('0x1c')](_0xbd80a7)[_0x4ff2('0x1d')](_0x3d34ad);}};}function respondWithFilteredResult(_0x82ec2e,_0x384e46){return function(_0x192c8b){if(_0x192c8b){var _0x374be6=typeof _0x384e46[_0x4ff2('0x1e')]===_0x4ff2('0x1f')&&typeof _0x384e46['limit']===_0x4ff2('0x1f');var _0x600fb5=_0x192c8b[_0x4ff2('0x20')];var _0x4de624=_0x374be6?0x0:_0x384e46[_0x4ff2('0x1e')];var _0x277bf1=_0x374be6?_0x192c8b[_0x4ff2('0x20')]:_0x384e46[_0x4ff2('0x1e')]+_0x384e46[_0x4ff2('0x21')];var _0xf23e9d;if(_0x277bf1>=_0x600fb5){_0x277bf1=_0x600fb5;_0xf23e9d=0xc8;}else{_0xf23e9d=0xce;}_0x82ec2e[_0x4ff2('0x1c')](_0xf23e9d);return _0x82ec2e['set'](_0x4ff2('0x22'),_0x4de624+'-'+_0x277bf1+'/'+_0x600fb5)[_0x4ff2('0x1d')](_0x192c8b);}return null;};}function patchUpdates(_0x506014){return function(_0x5ed8f0){try{jsonpatch[_0x4ff2('0x23')](_0x5ed8f0,_0x506014,!![]);}catch(_0x356e2a){return BPromise[_0x4ff2('0x24')](_0x356e2a);}return _0x5ed8f0[_0x4ff2('0x25')]();};}function saveUpdates(_0x15f2be,_0x1b0a5e){return function(_0x9d1d3d){if(_0x9d1d3d){return _0x9d1d3d[_0x4ff2('0x26')](_0x15f2be)[_0x4ff2('0x27')](function(_0x55d0c3){return _0x55d0c3;});}return null;};}function removeEntity(_0x398293,_0x1f83cf){return function(_0x270e28){if(_0x270e28){return _0x270e28[_0x4ff2('0x28')]()['then'](function(){var _0x185200=_0x270e28[_0x4ff2('0x29')]({'plain':!![]});var _0x5a6cd0=_0x4ff2('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x5a6cd0,'resourceId':_0x185200['id']}})['then'](function(){return _0x270e28;});})[_0x4ff2('0x27')](function(){_0x398293[_0x4ff2('0x1c')](0xcc)[_0x4ff2('0x1b')]();});}};}function handleEntityNotFound(_0x25486e,_0x5e3c42){return function(_0xa99bf2){if(!_0xa99bf2){_0x25486e[_0x4ff2('0x1a')](0x194);}return _0xa99bf2;};}function handleError(_0x5bbe63,_0x53ef43){_0x53ef43=_0x53ef43||0x1f4;return function(_0x2ed831){logger[_0x4ff2('0x2b')](_0x2ed831[_0x4ff2('0x2c')]);if(_0x2ed831['name']){delete _0x2ed831[_0x4ff2('0x2d')];}_0x5bbe63[_0x4ff2('0x1c')](_0x53ef43)[_0x4ff2('0x2e')](_0x2ed831);};}exports[_0x4ff2('0x2f')]=function(_0x1abfe7,_0xdfd7f1){var _0x15dc54={},_0x1c112e={},_0x317c9a={'count':0x0,'rows':[]};var _0x2081a0=_[_0x4ff2('0x30')](db[_0x4ff2('0x31')]['rawAttributes'],function(_0x4f84f4){return{'name':_0x4f84f4[_0x4ff2('0x32')],'type':_0x4f84f4[_0x4ff2('0x33')][_0x4ff2('0x34')]};});_0x1c112e[_0x4ff2('0x35')]=_['map'](_0x2081a0,_0x4ff2('0x2d'));_0x1c112e[_0x4ff2('0x36')]=_['keys'](_0x1abfe7['query']);_0x1c112e[_0x4ff2('0x37')]=_['intersection'](_0x1c112e[_0x4ff2('0x35')],_0x1c112e[_0x4ff2('0x36')]);_0x15dc54[_0x4ff2('0x38')]=_[_0x4ff2('0x39')](_0x1c112e[_0x4ff2('0x35')],qs[_0x4ff2('0x3a')](_0x1abfe7[_0x4ff2('0x36')][_0x4ff2('0x3a')]));_0x15dc54[_0x4ff2('0x38')]=_0x15dc54[_0x4ff2('0x38')][_0x4ff2('0x3b')]?_0x15dc54[_0x4ff2('0x38')]:_0x1c112e[_0x4ff2('0x35')];if(!_0x1abfe7[_0x4ff2('0x36')][_0x4ff2('0x3c')](_0x4ff2('0x3d'))){_0x15dc54[_0x4ff2('0x21')]=qs[_0x4ff2('0x21')](_0x1abfe7[_0x4ff2('0x36')][_0x4ff2('0x21')]);_0x15dc54[_0x4ff2('0x1e')]=qs[_0x4ff2('0x1e')](_0x1abfe7['query'][_0x4ff2('0x1e')]);}_0x15dc54[_0x4ff2('0x3e')]=qs[_0x4ff2('0x3f')](_0x1abfe7[_0x4ff2('0x36')][_0x4ff2('0x3f')]);_0x15dc54[_0x4ff2('0x40')]=qs[_0x4ff2('0x37')](_[_0x4ff2('0x41')](_0x1abfe7[_0x4ff2('0x36')],_0x1c112e[_0x4ff2('0x37')]),_0x2081a0);if(_0x1abfe7[_0x4ff2('0x36')][_0x4ff2('0x42')]){_0x15dc54['where']=_['merge'](_0x15dc54[_0x4ff2('0x40')],{'$or':[{'key':{'$like':'%'+_0x1abfe7[_0x4ff2('0x36')]['filter']+'%'}},{'value':{'$like':'%'+_0x1abfe7[_0x4ff2('0x36')]['filter']+'%'}}]});}_0x15dc54=_[_0x4ff2('0x43')]({},_0x15dc54,_0x1abfe7[_0x4ff2('0x44')]);var _0x228490={'where':_0x15dc54[_0x4ff2('0x40')]};return db['CannedAnswer'][_0x4ff2('0x20')](_0x228490)[_0x4ff2('0x27')](function(_0xd4b261){_0x317c9a['count']=_0xd4b261;if(_0x1abfe7['query']['includeAll']){_0x15dc54[_0x4ff2('0x45')]=[{'all':!![]}];}return db[_0x4ff2('0x31')]['findAll'](_0x15dc54);})[_0x4ff2('0x27')](function(_0x378206){_0x317c9a[_0x4ff2('0x46')]=_0x378206;return _0x317c9a;})[_0x4ff2('0x27')](respondWithFilteredResult(_0xdfd7f1,_0x15dc54))[_0x4ff2('0x47')](handleError(_0xdfd7f1,null));};exports['show']=function(_0x357d28,_0x10ace0){var _0x23a9e4={'raw':!![],'where':{'id':_0x357d28['params']['id']}},_0x2a12ea={};_0x2a12ea[_0x4ff2('0x35')]=_[_0x4ff2('0x48')](db['CannedAnswer'][_0x4ff2('0x49')]);_0x2a12ea[_0x4ff2('0x36')]=_[_0x4ff2('0x48')](_0x357d28[_0x4ff2('0x36')]);_0x2a12ea['filters']=_[_0x4ff2('0x39')](_0x2a12ea['model'],_0x2a12ea[_0x4ff2('0x36')]);_0x23a9e4['attributes']=_[_0x4ff2('0x39')](_0x2a12ea[_0x4ff2('0x35')],qs[_0x4ff2('0x3a')](_0x357d28[_0x4ff2('0x36')][_0x4ff2('0x3a')]));_0x23a9e4[_0x4ff2('0x38')]=_0x23a9e4[_0x4ff2('0x38')][_0x4ff2('0x3b')]?_0x23a9e4[_0x4ff2('0x38')]:_0x2a12ea[_0x4ff2('0x35')];if(_0x357d28[_0x4ff2('0x36')]['includeAll']){_0x23a9e4[_0x4ff2('0x45')]=[{'all':!![]}];}_0x23a9e4=_[_0x4ff2('0x43')]({},_0x23a9e4,_0x357d28[_0x4ff2('0x44')]);return db['CannedAnswer'][_0x4ff2('0x4a')](_0x23a9e4)[_0x4ff2('0x27')](handleEntityNotFound(_0x10ace0,null))[_0x4ff2('0x27')](respondWithResult(_0x10ace0,null))['catch'](handleError(_0x10ace0,null));};exports['update']=function(_0x4610da,_0x165d3c){if(_0x4610da[_0x4ff2('0x4b')]['id']){delete _0x4610da[_0x4ff2('0x4b')]['id'];}return db[_0x4ff2('0x31')][_0x4ff2('0x4a')]({'where':{'id':_0x4610da['params']['id']}})[_0x4ff2('0x27')](handleEntityNotFound(_0x165d3c,null))[_0x4ff2('0x27')](saveUpdates(_0x4610da['body'],null))[_0x4ff2('0x27')](respondWithResult(_0x165d3c,null))[_0x4ff2('0x47')](handleError(_0x165d3c,null));};exports[_0x4ff2('0x28')]=function(_0x41eb0e,_0x3eb2cb){return db['CannedAnswer'][_0x4ff2('0x4a')]({'where':{'id':_0x41eb0e['params']['id']}})['then'](handleEntityNotFound(_0x3eb2cb,null))[_0x4ff2('0x27')](removeEntity(_0x3eb2cb,null))[_0x4ff2('0x47')](handleError(_0x3eb2cb,null));};exports[_0x4ff2('0x4c')]=function(_0x8a4a4,_0x523ad4){var _0x2819c0={'key':_0x8a4a4[_0x4ff2('0x4b')][_0x4ff2('0x34')]};if(_0x8a4a4[_0x4ff2('0x4b')][_0x4ff2('0x4d')]){_0x2819c0['MailAccountId']=_0x8a4a4[_0x4ff2('0x4b')]['MailAccountId'];}else if(_0x8a4a4[_0x4ff2('0x4b')][_0x4ff2('0x4e')]){_0x2819c0[_0x4ff2('0x4e')]=_0x8a4a4[_0x4ff2('0x4b')]['SmsAccountId'];}else if(_0x8a4a4[_0x4ff2('0x4b')]['OpenchannelAccountId']){_0x2819c0[_0x4ff2('0x4f')]=_0x8a4a4[_0x4ff2('0x4b')][_0x4ff2('0x4f')];}else if(_0x8a4a4[_0x4ff2('0x4b')]['ChatWebsiteId']){_0x2819c0[_0x4ff2('0x50')]=_0x8a4a4[_0x4ff2('0x4b')]['ChatWebsiteId'];}return db[_0x4ff2('0x31')][_0x4ff2('0x4a')]({'where':_0x2819c0})['then'](function(_0x1534bf){if(_0x1534bf){throw new db[(_0x4ff2('0x51'))]['ValidationError'](_0x4ff2('0x52'));}return db[_0x4ff2('0x31')][_0x4ff2('0x4c')](_0x8a4a4['body']);})[_0x4ff2('0x27')](function(_0x50014f){var _0x1922ec=_0x8a4a4[_0x4ff2('0x53')]['get']({'plain':!![]});if(!_0x1922ec)throw new Error(_0x4ff2('0x54'));if(_0x1922ec[_0x4ff2('0x55')]===_0x4ff2('0x53')){var _0x121fe8=_0x50014f[_0x4ff2('0x29')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x4ff2('0x2a'),'userProfileId':_0x1922ec[_0x4ff2('0x56')]},'raw':!![]})['then'](function(_0x5165de){if(_0x5165de&&_0x5165de['autoAssociation']===0x0){return db[_0x4ff2('0x57')][_0x4ff2('0x4c')]({'name':_0x121fe8[_0x4ff2('0x2d')],'resourceId':_0x121fe8['id'],'type':_0x5165de[_0x4ff2('0x2d')],'sectionId':_0x5165de['id']},{})[_0x4ff2('0x27')](function(){return _0x50014f;});}else{return _0x50014f;}})[_0x4ff2('0x47')](function(_0x3f2670){logger[_0x4ff2('0x2b')](_0x4ff2('0x58'),_0x3f2670);throw _0x3f2670;});}return _0x50014f;})[_0x4ff2('0x27')](respondWithResult(_0x523ad4,0xc9))['catch'](handleError(_0x523ad4,null));}; \ No newline at end of file +var _0x287f=['attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','options','CannedAnswer','includeAll','include','rows','catch','params','body','find','create','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','CannedAnswers','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query'];(function(_0x120b1e,_0x4d2bec){var _0x186859=function(_0xed22d){while(--_0xed22d){_0x120b1e['push'](_0x120b1e['shift']());}};_0x186859(++_0x4d2bec);}(_0x287f,0xc7));var _0xf287=function(_0xc0af27,_0x506cbb){_0xc0af27=_0xc0af27-0x0;var _0x2b224c=_0x287f[_0xc0af27];return _0x2b224c;};'use strict';var emlformat=require(_0xf287('0x0'));var rimraf=require(_0xf287('0x1'));var zipdir=require(_0xf287('0x2'));var jsonpatch=require(_0xf287('0x3'));var rp=require(_0xf287('0x4'));var moment=require(_0xf287('0x5'));var BPromise=require(_0xf287('0x6'));var Mustache=require(_0xf287('0x7'));var util=require('util');var path=require(_0xf287('0x8'));var sox=require(_0xf287('0x9'));var csv=require(_0xf287('0xa'));var ejs=require(_0xf287('0xb'));var fs=require('fs');var fs_extra=require(_0xf287('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf287('0xd'));var jsforce=require(_0xf287('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf287('0xf'));var authService=require(_0xf287('0x10'));var qs=require(_0xf287('0x11'));var as=require(_0xf287('0x12'));var hardwareService=require(_0xf287('0x13'));var logger=require(_0xf287('0x14'))(_0xf287('0x15'));var utils=require(_0xf287('0x16'));var config=require(_0xf287('0x17'));var licenseUtil=require(_0xf287('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57335b,_0x523a59){_0x523a59=_0x523a59||0xcc;return function(_0x5bd95d){if(_0x5bd95d){return _0x57335b[_0xf287('0x19')](_0x523a59);}return _0x57335b[_0xf287('0x1a')](_0x523a59)[_0xf287('0x1b')]();};}function respondWithResult(_0x1320ff,_0x46ad0e){_0x46ad0e=_0x46ad0e||0xc8;return function(_0x501c3f){if(_0x501c3f){return _0x1320ff[_0xf287('0x1a')](_0x46ad0e)['json'](_0x501c3f);}};}function respondWithFilteredResult(_0x14ac1d,_0x4292d3){return function(_0x3b52ee){if(_0x3b52ee){var _0x143769=typeof _0x4292d3['offset']===_0xf287('0x1c')&&typeof _0x4292d3['limit']===_0xf287('0x1c');var _0x1dc8e3=_0x3b52ee[_0xf287('0x1d')];var _0x144a8e=_0x143769?0x0:_0x4292d3[_0xf287('0x1e')];var _0x3e78e6=_0x143769?_0x3b52ee['count']:_0x4292d3[_0xf287('0x1e')]+_0x4292d3[_0xf287('0x1f')];var _0x34857e;if(_0x3e78e6>=_0x1dc8e3){_0x3e78e6=_0x1dc8e3;_0x34857e=0xc8;}else{_0x34857e=0xce;}_0x14ac1d['status'](_0x34857e);return _0x14ac1d[_0xf287('0x20')](_0xf287('0x21'),_0x144a8e+'-'+_0x3e78e6+'/'+_0x1dc8e3)[_0xf287('0x22')](_0x3b52ee);}return null;};}function patchUpdates(_0x3f844c){return function(_0x4879eb){try{jsonpatch[_0xf287('0x23')](_0x4879eb,_0x3f844c,!![]);}catch(_0x3e3289){return BPromise[_0xf287('0x24')](_0x3e3289);}return _0x4879eb[_0xf287('0x25')]();};}function saveUpdates(_0x3461cc,_0x20855f){return function(_0x77d199){if(_0x77d199){return _0x77d199[_0xf287('0x26')](_0x3461cc)[_0xf287('0x27')](function(_0xb360de){return _0xb360de;});}return null;};}function removeEntity(_0x3c9cfd,_0x3501d2){return function(_0x18ee11){if(_0x18ee11){return _0x18ee11['destroy']()[_0xf287('0x27')](function(){var _0x55fe79=_0x18ee11['get']({'plain':!![]});var _0x42b4d8=_0xf287('0x28');return db[_0xf287('0x29')]['destroy']({'where':{'type':_0x42b4d8,'resourceId':_0x55fe79['id']}})[_0xf287('0x27')](function(){return _0x18ee11;});})[_0xf287('0x27')](function(){_0x3c9cfd[_0xf287('0x1a')](0xcc)[_0xf287('0x1b')]();});}};}function handleEntityNotFound(_0x45af85,_0x590721){return function(_0x55e04d){if(!_0x55e04d){_0x45af85[_0xf287('0x19')](0x194);}return _0x55e04d;};}function handleError(_0x2cab99,_0x3b91b7){_0x3b91b7=_0x3b91b7||0x1f4;return function(_0x15ad7d){logger[_0xf287('0x2a')](_0x15ad7d[_0xf287('0x2b')]);if(_0x15ad7d['name']){delete _0x15ad7d[_0xf287('0x2c')];}_0x2cab99[_0xf287('0x1a')](_0x3b91b7)['send'](_0x15ad7d);};}exports[_0xf287('0x2d')]=function(_0x71e850,_0x211002){var _0x2c3d92={},_0x2ddff4={},_0x586c77={'count':0x0,'rows':[]};var _0x528052=_[_0xf287('0x2e')](db['CannedAnswer'][_0xf287('0x2f')],function(_0x5e3206){return{'name':_0x5e3206[_0xf287('0x30')],'type':_0x5e3206[_0xf287('0x31')][_0xf287('0x32')]};});_0x2ddff4['model']=_[_0xf287('0x2e')](_0x528052,_0xf287('0x2c'));_0x2ddff4['query']=_[_0xf287('0x33')](_0x71e850['query']);_0x2ddff4[_0xf287('0x34')]=_[_0xf287('0x35')](_0x2ddff4[_0xf287('0x36')],_0x2ddff4[_0xf287('0x37')]);_0x2c3d92[_0xf287('0x38')]=_[_0xf287('0x35')](_0x2ddff4[_0xf287('0x36')],qs['fields'](_0x71e850[_0xf287('0x37')][_0xf287('0x39')]));_0x2c3d92['attributes']=_0x2c3d92['attributes'][_0xf287('0x3a')]?_0x2c3d92['attributes']:_0x2ddff4[_0xf287('0x36')];if(!_0x71e850[_0xf287('0x37')][_0xf287('0x3b')]('nolimit')){_0x2c3d92[_0xf287('0x1f')]=qs['limit'](_0x71e850[_0xf287('0x37')][_0xf287('0x1f')]);_0x2c3d92[_0xf287('0x1e')]=qs[_0xf287('0x1e')](_0x71e850['query'][_0xf287('0x1e')]);}_0x2c3d92['order']=qs[_0xf287('0x3c')](_0x71e850[_0xf287('0x37')][_0xf287('0x3c')]);_0x2c3d92['where']=qs[_0xf287('0x34')](_[_0xf287('0x3d')](_0x71e850[_0xf287('0x37')],_0x2ddff4[_0xf287('0x34')]),_0x528052);if(_0x71e850['query'][_0xf287('0x3e')]){_0x2c3d92['where']=_[_0xf287('0x3f')](_0x2c3d92[_0xf287('0x40')],{'$or':[{'key':{'$like':'%'+_0x71e850['query'][_0xf287('0x3e')]+'%'}},{'value':{'$like':'%'+_0x71e850['query'][_0xf287('0x3e')]+'%'}}]});}_0x2c3d92=_['merge']({},_0x2c3d92,_0x71e850[_0xf287('0x41')]);var _0x35662d={'where':_0x2c3d92[_0xf287('0x40')]};return db[_0xf287('0x42')][_0xf287('0x1d')](_0x35662d)['then'](function(_0x4754b9){_0x586c77['count']=_0x4754b9;if(_0x71e850[_0xf287('0x37')][_0xf287('0x43')]){_0x2c3d92[_0xf287('0x44')]=[{'all':!![]}];}return db[_0xf287('0x42')]['findAll'](_0x2c3d92);})['then'](function(_0x1aafdc){_0x586c77[_0xf287('0x45')]=_0x1aafdc;return _0x586c77;})[_0xf287('0x27')](respondWithFilteredResult(_0x211002,_0x2c3d92))[_0xf287('0x46')](handleError(_0x211002,null));};exports['show']=function(_0x52e2cf,_0x3a1889){var _0x57441e={'raw':!![],'where':{'id':_0x52e2cf[_0xf287('0x47')]['id']}},_0x433952={};_0x433952[_0xf287('0x36')]=_[_0xf287('0x33')](db['CannedAnswer'][_0xf287('0x2f')]);_0x433952[_0xf287('0x37')]=_[_0xf287('0x33')](_0x52e2cf[_0xf287('0x37')]);_0x433952['filters']=_[_0xf287('0x35')](_0x433952[_0xf287('0x36')],_0x433952['query']);_0x57441e['attributes']=_['intersection'](_0x433952[_0xf287('0x36')],qs[_0xf287('0x39')](_0x52e2cf[_0xf287('0x37')][_0xf287('0x39')]));_0x57441e[_0xf287('0x38')]=_0x57441e['attributes'][_0xf287('0x3a')]?_0x57441e[_0xf287('0x38')]:_0x433952[_0xf287('0x36')];if(_0x52e2cf[_0xf287('0x37')][_0xf287('0x43')]){_0x57441e[_0xf287('0x44')]=[{'all':!![]}];}_0x57441e=_[_0xf287('0x3f')]({},_0x57441e,_0x52e2cf[_0xf287('0x41')]);return db[_0xf287('0x42')]['find'](_0x57441e)[_0xf287('0x27')](handleEntityNotFound(_0x3a1889,null))[_0xf287('0x27')](respondWithResult(_0x3a1889,null))['catch'](handleError(_0x3a1889,null));};exports['update']=function(_0x24cf7b,_0x445b75){if(_0x24cf7b[_0xf287('0x48')]['id']){delete _0x24cf7b['body']['id'];}return db[_0xf287('0x42')][_0xf287('0x49')]({'where':{'id':_0x24cf7b['params']['id']}})[_0xf287('0x27')](handleEntityNotFound(_0x445b75,null))[_0xf287('0x27')](saveUpdates(_0x24cf7b[_0xf287('0x48')],null))['then'](respondWithResult(_0x445b75,null))[_0xf287('0x46')](handleError(_0x445b75,null));};exports['destroy']=function(_0x3668e5,_0x2ad7c7){return db[_0xf287('0x42')][_0xf287('0x49')]({'where':{'id':_0x3668e5[_0xf287('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ad7c7,null))[_0xf287('0x27')](removeEntity(_0x2ad7c7,null))[_0xf287('0x46')](handleError(_0x2ad7c7,null));};exports[_0xf287('0x4a')]=function(_0x6837f0,_0x3f1df5){var _0x3593fa={'key':_0x6837f0['body'][_0xf287('0x32')]};if(_0x6837f0[_0xf287('0x48')]['MailAccountId']){_0x3593fa['MailAccountId']=_0x6837f0['body']['MailAccountId'];}else if(_0x6837f0[_0xf287('0x48')][_0xf287('0x4b')]){_0x3593fa[_0xf287('0x4b')]=_0x6837f0[_0xf287('0x48')][_0xf287('0x4b')];}else if(_0x6837f0['body'][_0xf287('0x4c')]){_0x3593fa[_0xf287('0x4c')]=_0x6837f0[_0xf287('0x48')][_0xf287('0x4c')];}else if(_0x6837f0[_0xf287('0x48')][_0xf287('0x4d')]){_0x3593fa[_0xf287('0x4d')]=_0x6837f0[_0xf287('0x48')][_0xf287('0x4d')];}return db[_0xf287('0x42')]['find']({'where':_0x3593fa})['then'](function(_0x580bc3){if(_0x580bc3){throw new db['Sequelize'][(_0xf287('0x4e'))](_0xf287('0x4f'));}return db[_0xf287('0x42')][_0xf287('0x4a')](_0x6837f0['body']);})[_0xf287('0x27')](function(_0x51eaa7){var _0x49724b=_0x6837f0[_0xf287('0x50')]['get']({'plain':!![]});if(!_0x49724b)throw new Error(_0xf287('0x51'));if(_0x49724b['role']===_0xf287('0x50')){var _0xd25a12=_0x51eaa7[_0xf287('0x52')]({'plain':!![]});return db[_0xf287('0x53')][_0xf287('0x49')]({'where':{'name':_0xf287('0x28'),'userProfileId':_0x49724b['userProfileId']},'raw':!![]})['then'](function(_0x5a3b7d){if(_0x5a3b7d&&_0x5a3b7d[_0xf287('0x54')]===0x0){return db[_0xf287('0x29')]['create']({'name':_0xd25a12['name'],'resourceId':_0xd25a12['id'],'type':_0x5a3b7d['name'],'sectionId':_0x5a3b7d['id']},{})[_0xf287('0x27')](function(){return _0x51eaa7;});}else{return _0x51eaa7;}})[_0xf287('0x46')](function(_0x142e60){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x142e60);throw _0x142e60;});}return _0x51eaa7;})[_0xf287('0x27')](respondWithResult(_0x3f1df5,0xc9))['catch'](handleError(_0x3f1df5,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 03e66ee..f36ed34 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 _0x4ce6=['moment','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x5c91b1,_0x1eeb65){var _0xbce0ff=function(_0x181dd6){while(--_0x181dd6){_0x5c91b1['push'](_0x5c91b1['shift']());}};_0xbce0ff(++_0x1eeb65);}(_0x4ce6,0x15a));var _0x64ce=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x4ce6[_0x725a4c];return _0x37b2cc;};'use strict';var _=require(_0x64ce('0x0'));var util=require(_0x64ce('0x1'));var logger=require(_0x64ce('0x2'))(_0x64ce('0x3'));var moment=require(_0x64ce('0x4'));var BPromise=require('bluebird');var rp=require(_0x64ce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64ce('0x6'));var config=require(_0x64ce('0x7'));var attributes=require(_0x64ce('0x8'));module[_0x64ce('0x9')]=function(_0x8c1982,_0x50898d){return _0x8c1982[_0x64ce('0xa')]('CannedAnswer',attributes,{'tableName':_0x64ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x64ce('0xc'),'collate':_0x64ce('0xd')});}; \ No newline at end of file +var _0xa4e3=['CannedAnswer','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xa4e3,0x17c));var _0x3a4e=function(_0x5637ab,_0x38755b){_0x5637ab=_0x5637ab-0x0;var _0x50b5a7=_0xa4e3[_0x5637ab];return _0x50b5a7;};'use strict';var _=require(_0x3a4e('0x0'));var util=require(_0x3a4e('0x1'));var logger=require('../../config/logger')(_0x3a4e('0x2'));var moment=require(_0x3a4e('0x3'));var BPromise=require(_0x3a4e('0x4'));var rp=require(_0x3a4e('0x5'));var fs=require('fs');var path=require(_0x3a4e('0x6'));var rimraf=require(_0x3a4e('0x7'));var config=require(_0x3a4e('0x8'));var attributes=require(_0x3a4e('0x9'));module[_0x3a4e('0xa')]=function(_0xfbe0e5,_0x1f26be){return _0xfbe0e5[_0x3a4e('0xb')](_0x3a4e('0xc'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3a4e('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 2ddad78..6d5326f 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 _0xc25d=['then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x304655,_0x15b109){var _0x2fa58a=function(_0x7d144){while(--_0x7d144){_0x304655['push'](_0x304655['shift']());}};_0x2fa58a(++_0x15b109);}(_0xc25d,0x9e));var _0xdc25=function(_0xd02bb,_0x26e2d0){_0xd02bb=_0xd02bb-0x0;var _0x1cdf23=_0xc25d[_0xd02bb];return _0x1cdf23;};'use strict';var _=require(_0xdc25('0x0'));var util=require(_0xdc25('0x1'));var moment=require(_0xdc25('0x2'));var BPromise=require('bluebird');var rs=require(_0xdc25('0x3'));var fs=require('fs');var Redis=require(_0xdc25('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc25('0x5'));var logger=require('../../config/logger')(_0xdc25('0x6'));var config=require(_0xdc25('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdc25('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c1178,_0x3dc5b3,_0x3523fc){return new BPromise(function(_0x32d65d,_0x50d9c0){return client[_0xdc25('0x9')](_0x4c1178,_0x3523fc)[_0xdc25('0xa')](function(_0x362bb5){logger[_0xdc25('0xb')](_0xdc25('0xc'),_0x3dc5b3,_0xdc25('0xd'));logger[_0xdc25('0xe')](_0xdc25('0xf'),_0x3dc5b3,_0xdc25('0xd'),JSON['stringify'](_0x362bb5));if(_0x362bb5[_0xdc25('0x10')]){if(_0x362bb5[_0xdc25('0x10')][_0xdc25('0x11')]===0x1f4){logger[_0xdc25('0x10')](_0xdc25('0xc'),_0x3dc5b3,_0x362bb5[_0xdc25('0x10')][_0xdc25('0x12')]);return _0x50d9c0(_0x362bb5[_0xdc25('0x10')]['message']);}logger[_0xdc25('0x10')](_0xdc25('0xc'),_0x3dc5b3,_0x362bb5[_0xdc25('0x10')][_0xdc25('0x12')]);return _0x32d65d(_0x362bb5[_0xdc25('0x10')][_0xdc25('0x12')]);}else{logger[_0xdc25('0xb')](_0xdc25('0xc'),_0x3dc5b3,'request\x20sent');_0x32d65d(_0x362bb5[_0xdc25('0x13')][_0xdc25('0x12')]);}})[_0xdc25('0x14')](function(_0x43fe69){logger[_0xdc25('0x10')](_0xdc25('0xc'),_0x3dc5b3,_0x43fe69);_0x50d9c0(_0x43fe69);});});} \ No newline at end of file +var _0xdb62=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then','CannedAnswer,\x20%s,\x20%s','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','moment'];(function(_0x43466a,_0x7d42ef){var _0x4a7f49=function(_0xbfa96b){while(--_0xbfa96b){_0x43466a['push'](_0x43466a['shift']());}};_0x4a7f49(++_0x7d42ef);}(_0xdb62,0x83));var _0x2db6=function(_0x37de50,_0x27f82a){_0x37de50=_0x37de50-0x0;var _0x2c37dc=_0xdb62[_0x37de50];return _0x2c37dc;};'use strict';var _=require(_0x2db6('0x0'));var util=require('util');var moment=require(_0x2db6('0x1'));var BPromise=require('bluebird');var rs=require(_0x2db6('0x2'));var fs=require('fs');var Redis=require(_0x2db6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2db6('0x4'));var logger=require(_0x2db6('0x5'))(_0x2db6('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2db6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xc3e21f,_0x3f8e06,_0x588f8c){return new BPromise(function(_0x20bf52,_0x1aa213){return client[_0x2db6('0x8')](_0xc3e21f,_0x588f8c)[_0x2db6('0x9')](function(_0x3c08a4){logger['info'](_0x2db6('0xa'),_0x3f8e06,'request\x20sent');logger[_0x2db6('0xb')](_0x2db6('0xc'),_0x3f8e06,_0x2db6('0xd'),JSON[_0x2db6('0xe')](_0x3c08a4));if(_0x3c08a4[_0x2db6('0xf')]){if(_0x3c08a4['error'][_0x2db6('0x10')]===0x1f4){logger[_0x2db6('0xf')](_0x2db6('0xa'),_0x3f8e06,_0x3c08a4['error'][_0x2db6('0x11')]);return _0x1aa213(_0x3c08a4[_0x2db6('0xf')][_0x2db6('0x11')]);}logger['error'](_0x2db6('0xa'),_0x3f8e06,_0x3c08a4[_0x2db6('0xf')]['message']);return _0x20bf52(_0x3c08a4[_0x2db6('0xf')]['message']);}else{logger[_0x2db6('0x12')]('CannedAnswer,\x20%s,\x20%s',_0x3f8e06,_0x2db6('0xd'));_0x20bf52(_0x3c08a4['result'][_0x2db6('0x11')]);}})['catch'](function(_0x59a20b){logger[_0x2db6('0xf')](_0x2db6('0xa'),_0x3f8e06,_0x59a20b);_0x1aa213(_0x59a20b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index e678f4c..d33d4ee 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 _0xbe19=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x608732,_0x167853){var _0x312df5=function(_0x381f07){while(--_0x381f07){_0x608732['push'](_0x608732['shift']());}};_0x312df5(++_0x167853);}(_0xbe19,0xd1));var _0x9be1=function(_0x2e0214,_0x20d86b){_0x2e0214=_0x2e0214-0x0;var _0x35932c=_0xbe19[_0x2e0214];return _0x35932c;};'use strict';var multer=require(_0x9be1('0x0'));var util=require(_0x9be1('0x1'));var path=require(_0x9be1('0x2'));var timeout=require(_0x9be1('0x3'));var express=require(_0x9be1('0x4'));var router=express[_0x9be1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9be1('0x6'));var interaction=require(_0x9be1('0x7'));var config=require(_0x9be1('0x8'));var controller=require(_0x9be1('0x9'));router[_0x9be1('0xa')]('/',auth[_0x9be1('0xb')](),controller[_0x9be1('0xc')]);router[_0x9be1('0xa')](_0x9be1('0xd'),auth[_0x9be1('0xb')](),controller[_0x9be1('0xe')]);router[_0x9be1('0xf')]('/',auth[_0x9be1('0xb')](),controller[_0x9be1('0x10')]);router['put'](_0x9be1('0xd'),auth[_0x9be1('0xb')](),controller[_0x9be1('0x11')]);router[_0x9be1('0x12')](_0x9be1('0xd'),auth['isAuthenticated'](),controller[_0x9be1('0x13')]);module[_0x9be1('0x14')]=router; \ No newline at end of file +var _0xc872=['delete','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0xc872,0x1f2));var _0x2c87=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0xc872[_0xe15270];return _0x1e813b;};'use strict';var multer=require('multer');var util=require(_0x2c87('0x0'));var path=require(_0x2c87('0x1'));var timeout=require('connect-timeout');var express=require(_0x2c87('0x2'));var router=express['Router']();var fs_extra=require(_0x2c87('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2c87('0x4'));var config=require(_0x2c87('0x5'));var controller=require(_0x2c87('0x6'));router[_0x2c87('0x7')]('/',auth[_0x2c87('0x8')](),controller['index']);router[_0x2c87('0x7')](_0x2c87('0x9'),auth['isAuthenticated'](),controller[_0x2c87('0xa')]);router[_0x2c87('0xb')]('/',auth[_0x2c87('0x8')](),controller['create']);router['put'](_0x2c87('0x9'),auth[_0x2c87('0x8')](),controller['update']);router[_0x2c87('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x2c87('0xd')]);module[_0x2c87('0xe')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 330113b..a5dfa01 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 _0xf493=['sequelize','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1e162f,_0x11f330){var _0x4a5a4a=function(_0x4d1876){while(--_0x4d1876){_0x1e162f['push'](_0x1e162f['shift']());}};_0x4a5a4a(++_0x11f330);}(_0xf493,0x108));var _0x3f49=function(_0x115934,_0x374c8f){_0x115934=_0x115934-0x0;var _0x14b99b=_0xf493[_0x115934];return _0x14b99b;};'use strict';var Sequelize=require(_0x3f49('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x3f49('0x1')},'clid':{'type':Sequelize[_0x3f49('0x2')]},'src':{'type':Sequelize[_0x3f49('0x2')]},'dst':{'type':Sequelize[_0x3f49('0x2')]},'dcontext':{'type':Sequelize[_0x3f49('0x2')]},'channel':{'type':Sequelize[_0x3f49('0x2')]},'dstchannel':{'type':Sequelize[_0x3f49('0x2')]},'lastapp':{'type':Sequelize[_0x3f49('0x2')]},'lastdata':{'type':Sequelize[_0x3f49('0x2')]},'duration':{'type':Sequelize[_0x3f49('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3f49('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3f49('0x2')]},'amaflags':{'type':Sequelize[_0x3f49('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3f49('0x2')]},'sequence':{'type':Sequelize[_0x3f49('0x2')]},'peeraccount':{'type':Sequelize[_0x3f49('0x2')]},'type':{'type':Sequelize[_0x3f49('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5c26=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x56bad9,_0x32f618){var _0x296e15=function(_0x32214d){while(--_0x32214d){_0x56bad9['push'](_0x56bad9['shift']());}};_0x296e15(++_0x32f618);}(_0x5c26,0xf0));var _0x65c2=function(_0x38c62a,_0x30022c){_0x38c62a=_0x38c62a-0x0;var _0xe4f41f=_0x5c26[_0x38c62a];return _0xe4f41f;};'use strict';var Sequelize=require('sequelize');module[_0x65c2('0x0')]={'calldate':{'type':Sequelize[_0x65c2('0x1')],'allowNull':![],'defaultValue':_0x65c2('0x2')},'clid':{'type':Sequelize[_0x65c2('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x65c2('0x3')]},'channel':{'type':Sequelize[_0x65c2('0x3')]},'dstchannel':{'type':Sequelize[_0x65c2('0x3')]},'lastapp':{'type':Sequelize[_0x65c2('0x3')]},'lastdata':{'type':Sequelize[_0x65c2('0x3')]},'duration':{'type':Sequelize[_0x65c2('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x65c2('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x65c2('0x3')]},'amaflags':{'type':Sequelize[_0x65c2('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x65c2('0x3')]},'userfield':{'type':Sequelize[_0x65c2('0x3')]},'uniqueid':{'type':Sequelize[_0x65c2('0x3')]},'linkedid':{'type':Sequelize[_0x65c2('0x3')]},'sequence':{'type':Sequelize[_0x65c2('0x3')]},'peeraccount':{'type':Sequelize[_0x65c2('0x3')]},'type':{'type':Sequelize[_0x65c2('0x3')]},'tag':{'type':Sequelize[_0x65c2('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index b3fe61a..f18786a 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 _0xb10b=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','Cdr','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir'];(function(_0x4fa4dd,_0x4fa75){var _0x25d2ea=function(_0x537950){while(--_0x537950){_0x4fa4dd['push'](_0x4fa4dd['shift']());}};_0x25d2ea(++_0x4fa75);}(_0xb10b,0x12a));var _0xbb10=function(_0x8014d8,_0x134a36){_0x8014d8=_0x8014d8-0x0;var _0x581b7b=_0xb10b[_0x8014d8];return _0x581b7b;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['Cdr'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'all':!![]}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x1c7fae){_0x2e0249[_0xbb10('0x43')]=_0x1c7fae;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x44')]=function(_0x331751,_0x23dc18){var _0x403beb={'raw':!![],'where':{'id':_0x331751[_0xbb10('0x45')]['id']}},_0x5e2cfa={};_0x5e2cfa[_0xbb10('0x2f')]=_['keys'](db['Cdr'][_0xbb10('0x2c')]);_0x5e2cfa['query']=_[_0xbb10('0x30')](_0x331751[_0xbb10('0x31')]);_0x5e2cfa['filters']=_[_0xbb10('0x32')](_0x5e2cfa[_0xbb10('0x2f')],_0x5e2cfa[_0xbb10('0x31')]);_0x403beb['attributes']=_[_0xbb10('0x32')](_0x5e2cfa[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x331751[_0xbb10('0x31')][_0xbb10('0x34')]));_0x403beb[_0xbb10('0x33')]=_0x403beb[_0xbb10('0x33')][_0xbb10('0x35')]?_0x403beb[_0xbb10('0x33')]:_0x5e2cfa[_0xbb10('0x2f')];if(_0x331751[_0xbb10('0x31')][_0xbb10('0x41')]){_0x403beb['include']=[{'all':!![]}];}_0x403beb=_[_0xbb10('0x3e')]({},_0x403beb,_0x331751[_0xbb10('0x3f')]);return db['Cdr'][_0xbb10('0x46')](_0x403beb)[_0xbb10('0x23')](handleEntityNotFound(_0x23dc18,null))[_0xbb10('0x23')](respondWithResult(_0x23dc18,null))[_0xbb10('0x47')](handleError(_0x23dc18,null));};exports[_0xbb10('0x48')]=function(_0x39f0de,_0x3e06b0){return db['Cdr']['create'](_0x39f0de[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x3e06b0,0xc9))[_0xbb10('0x47')](handleError(_0x3e06b0,null));};exports['update']=function(_0x5f0c12,_0x3cd6f3){if(_0x5f0c12[_0xbb10('0x49')]['id']){delete _0x5f0c12[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x40')][_0xbb10('0x46')]({'where':{'id':_0x5f0c12[_0xbb10('0x45')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x3cd6f3,null))[_0xbb10('0x23')](saveUpdates(_0x5f0c12[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x3cd6f3,null))['catch'](handleError(_0x3cd6f3,null));};exports['destroy']=function(_0x412e13,_0x467dba){return db[_0xbb10('0x40')][_0xbb10('0x46')]({'where':{'id':_0x412e13[_0xbb10('0x45')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x467dba,null))[_0xbb10('0x23')](removeEntity(_0x467dba,null))[_0xbb10('0x47')](handleError(_0x467dba,null));};exports[_0xbb10('0x4a')]=function(_0x1214f7,_0x19ca3e){return db[_0xbb10('0x40')][_0xbb10('0x4a')]()[_0xbb10('0x23')](respondWithResult(_0x19ca3e,null))[_0xbb10('0x47')](handleError(_0x19ca3e,null));}; \ No newline at end of file +var _0xb10b=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','Cdr','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir'];(function(_0x201fac,_0x197176){var _0x435913=function(_0x33d9ad){while(--_0x33d9ad){_0x201fac['push'](_0x201fac['shift']());}};_0x435913(++_0x197176);}(_0xb10b,0x12a));var _0xbb10=function(_0x65f140,_0x45cbc7){_0x65f140=_0x65f140-0x0;var _0x18fbda=_0xb10b[_0x65f140];return _0x18fbda;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['Cdr'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'all':!![]}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x1c7fae){_0x2e0249[_0xbb10('0x43')]=_0x1c7fae;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x44')]=function(_0x331751,_0x23dc18){var _0x403beb={'raw':!![],'where':{'id':_0x331751[_0xbb10('0x45')]['id']}},_0x5e2cfa={};_0x5e2cfa[_0xbb10('0x2f')]=_['keys'](db['Cdr'][_0xbb10('0x2c')]);_0x5e2cfa['query']=_[_0xbb10('0x30')](_0x331751[_0xbb10('0x31')]);_0x5e2cfa['filters']=_[_0xbb10('0x32')](_0x5e2cfa[_0xbb10('0x2f')],_0x5e2cfa[_0xbb10('0x31')]);_0x403beb['attributes']=_[_0xbb10('0x32')](_0x5e2cfa[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x331751[_0xbb10('0x31')][_0xbb10('0x34')]));_0x403beb[_0xbb10('0x33')]=_0x403beb[_0xbb10('0x33')][_0xbb10('0x35')]?_0x403beb[_0xbb10('0x33')]:_0x5e2cfa[_0xbb10('0x2f')];if(_0x331751[_0xbb10('0x31')][_0xbb10('0x41')]){_0x403beb['include']=[{'all':!![]}];}_0x403beb=_[_0xbb10('0x3e')]({},_0x403beb,_0x331751[_0xbb10('0x3f')]);return db['Cdr'][_0xbb10('0x46')](_0x403beb)[_0xbb10('0x23')](handleEntityNotFound(_0x23dc18,null))[_0xbb10('0x23')](respondWithResult(_0x23dc18,null))[_0xbb10('0x47')](handleError(_0x23dc18,null));};exports[_0xbb10('0x48')]=function(_0x39f0de,_0x3e06b0){return db['Cdr']['create'](_0x39f0de[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x3e06b0,0xc9))[_0xbb10('0x47')](handleError(_0x3e06b0,null));};exports['update']=function(_0x5f0c12,_0x3cd6f3){if(_0x5f0c12[_0xbb10('0x49')]['id']){delete _0x5f0c12[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x40')][_0xbb10('0x46')]({'where':{'id':_0x5f0c12[_0xbb10('0x45')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x3cd6f3,null))[_0xbb10('0x23')](saveUpdates(_0x5f0c12[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x3cd6f3,null))['catch'](handleError(_0x3cd6f3,null));};exports['destroy']=function(_0x412e13,_0x467dba){return db[_0xbb10('0x40')][_0xbb10('0x46')]({'where':{'id':_0x412e13[_0xbb10('0x45')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x467dba,null))[_0xbb10('0x23')](removeEntity(_0x467dba,null))[_0xbb10('0x47')](handleError(_0x467dba,null));};exports[_0xbb10('0x4a')]=function(_0x1214f7,_0x19ca3e){return db[_0xbb10('0x40')][_0xbb10('0x4a')]()[_0xbb10('0x23')](respondWithResult(_0x19ca3e,null))[_0xbb10('0x47')](handleError(_0x19ca3e,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index e6483f5..69dc8a6 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 _0xda19=['accountcode','disposition','dst','src','uniqueid','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr'];(function(_0x18ea50,_0x403b06){var _0x1aae7d=function(_0xc87f9f){while(--_0xc87f9f){_0x18ea50['push'](_0x18ea50['shift']());}};_0x1aae7d(++_0x403b06);}(_0xda19,0xd5));var _0x9da1=function(_0x5f3e0d,_0x5f259e){_0x5f3e0d=_0x5f3e0d-0x0;var _0x1b9915=_0xda19[_0x5f3e0d];return _0x1b9915;};'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':['accountcode']},{'name':'calldate','fields':['calldate']},{'name':_0x9da1('0xc'),'fields':['disposition']},{'name':_0x9da1('0xd'),'fields':[_0x9da1('0xd')]},{'name':_0x9da1('0xe'),'fields':[_0x9da1('0xe')]},{'name':_0x9da1('0xf'),'fields':[_0x9da1('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0xf494=['disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','accountcode','calldate'];(function(_0x559060,_0x38a41c){var _0x9b469e=function(_0x1ed735){while(--_0x1ed735){_0x559060['push'](_0x559060['shift']());}};_0x9b469e(++_0x38a41c);}(_0xf494,0x1c6));var _0x4f49=function(_0x4daa0e,_0x31698c){_0x4daa0e=_0x4daa0e-0x0;var _0x384c04=_0xf494[_0x4daa0e];return _0x384c04;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Cdr',attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]},{'name':_0x4f49('0xd'),'fields':[_0x4f49('0xd')]},{'name':_0x4f49('0xe'),'fields':[_0x4f49('0xe')]},{'name':_0x4f49('0xf'),'fields':[_0x4f49('0xf')]},{'name':'src','fields':[_0x4f49('0x10')]},{'name':_0x4f49('0x11'),'fields':['uniqueid']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index f625daf..179fbd3 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 _0x2029=['Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','debug'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x2029,0xf7));var _0x9202=function(_0x5dcb76,_0x21ff02){_0x5dcb76=_0x5dcb76-0x0;var _0x4fc065=_0x2029[_0x5dcb76];return _0x4fc065;};'use strict';var _=require(_0x9202('0x0'));var util=require(_0x9202('0x1'));var moment=require(_0x9202('0x2'));var BPromise=require(_0x9202('0x3'));var rs=require(_0x9202('0x4'));var fs=require('fs');var Redis=require(_0x9202('0x5'));var db=require(_0x9202('0x6'))['db'];var utils=require(_0x9202('0x7'));var logger=require(_0x9202('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9202('0x9'));var client=jayson[_0x9202('0xa')][_0x9202('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x365d4b,_0x4c40ae,_0x99554d){return new BPromise(function(_0x54b330,_0x17526c){return client[_0x9202('0xc')](_0x365d4b,_0x99554d)[_0x9202('0xd')](function(_0x37639d){logger[_0x9202('0xe')](_0x9202('0xf'),_0x4c40ae,'request\x20sent');logger[_0x9202('0x10')](_0x9202('0x11'),_0x4c40ae,_0x9202('0x12'),JSON[_0x9202('0x13')](_0x37639d));if(_0x37639d[_0x9202('0x14')]){if(_0x37639d[_0x9202('0x14')]['code']===0x1f4){logger[_0x9202('0x14')]('Cdr,\x20%s,\x20%s',_0x4c40ae,_0x37639d[_0x9202('0x14')][_0x9202('0x15')]);return _0x17526c(_0x37639d[_0x9202('0x14')][_0x9202('0x15')]);}logger[_0x9202('0x14')]('Cdr,\x20%s,\x20%s',_0x4c40ae,_0x37639d['error']['message']);return _0x54b330(_0x37639d[_0x9202('0x14')][_0x9202('0x15')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x4c40ae,_0x9202('0x12'));_0x54b330(_0x37639d[_0x9202('0x16')][_0x9202('0x15')]);}})[_0x9202('0x17')](function(_0x3b9647){logger[_0x9202('0x14')](_0x9202('0xf'),_0x4c40ae,_0x3b9647);_0x17526c(_0x3b9647);});});} \ No newline at end of file +var _0xe159=['info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xe159,0x16f));var _0x9e15=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe159[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x9e15('0x0'));var util=require(_0x9e15('0x1'));var moment=require(_0x9e15('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e15('0x3'))['db'];var utils=require(_0x9e15('0x4'));var logger=require(_0x9e15('0x5'))(_0x9e15('0x6'));var config=require(_0x9e15('0x7'));var jayson=require(_0x9e15('0x8'));var client=jayson[_0x9e15('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1595d1,_0x251158,_0x64d057){return new BPromise(function(_0xc55082,_0x16ad3a){return client[_0x9e15('0xa')](_0x1595d1,_0x64d057)['then'](function(_0xd938a){logger[_0x9e15('0xb')](_0x9e15('0xc'),_0x251158,_0x9e15('0xd'));logger[_0x9e15('0xe')](_0x9e15('0xf'),_0x251158,_0x9e15('0xd'),JSON[_0x9e15('0x10')](_0xd938a));if(_0xd938a[_0x9e15('0x11')]){if(_0xd938a['error'][_0x9e15('0x12')]===0x1f4){logger[_0x9e15('0x11')]('Cdr,\x20%s,\x20%s',_0x251158,_0xd938a[_0x9e15('0x11')][_0x9e15('0x13')]);return _0x16ad3a(_0xd938a[_0x9e15('0x11')][_0x9e15('0x13')]);}logger['error'](_0x9e15('0xc'),_0x251158,_0xd938a[_0x9e15('0x11')][_0x9e15('0x13')]);return _0xc55082(_0xd938a[_0x9e15('0x11')][_0x9e15('0x13')]);}else{logger['info'](_0x9e15('0xc'),_0x251158,_0x9e15('0xd'));_0xc55082(_0xd938a['result'][_0x9e15('0x13')]);}})[_0x9e15('0x14')](function(_0x58b15d){logger['error']('Cdr,\x20%s,\x20%s',_0x251158,_0x58b15d);_0x16ad3a(_0x58b15d);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 40ae8f5..302c471 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 _0xfb12=['./cdr.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xfb12,0x1ce));var _0x2fb1=function(_0x1f0d02,_0x544507){_0x1f0d02=_0x1f0d02-0x0;var _0x7cb25=_0xfb12[_0x1f0d02];return _0x7cb25;};'use strict';var multer=require('multer');var util=require(_0x2fb1('0x0'));var path=require('path');var timeout=require(_0x2fb1('0x1'));var express=require('express');var router=express[_0x2fb1('0x2')]();var fs_extra=require(_0x2fb1('0x3'));var auth=require(_0x2fb1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2fb1('0x5'));var controller=require(_0x2fb1('0x6'));router[_0x2fb1('0x7')]('/',auth[_0x2fb1('0x8')](),controller[_0x2fb1('0x9')]);router['get'](_0x2fb1('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2fb1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x2fb1('0xc')]('/',auth[_0x2fb1('0x8')](),controller[_0x2fb1('0xd')]);router[_0x2fb1('0xe')](_0x2fb1('0xb'),auth[_0x2fb1('0x8')](),controller['update']);router[_0x2fb1('0xf')](_0x2fb1('0xb'),auth[_0x2fb1('0x8')](),controller[_0x2fb1('0x10')]);module[_0x2fb1('0x11')]=router; \ No newline at end of file +var _0x5f7b=['create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cdr.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x4d421c,_0x84ccf0){var _0x28bb3d=function(_0x32df55){while(--_0x32df55){_0x4d421c['push'](_0x4d421c['shift']());}};_0x28bb3d(++_0x84ccf0);}(_0x5f7b,0x1b9));var _0xb5f7=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x5f7b[_0x819464];return _0x49dcc0;};'use strict';var multer=require(_0xb5f7('0x0'));var util=require(_0xb5f7('0x1'));var path=require(_0xb5f7('0x2'));var timeout=require(_0xb5f7('0x3'));var express=require(_0xb5f7('0x4'));var router=express[_0xb5f7('0x5')]();var fs_extra=require(_0xb5f7('0x6'));var auth=require(_0xb5f7('0x7'));var interaction=require(_0xb5f7('0x8'));var config=require('../../config/environment');var controller=require(_0xb5f7('0x9'));router[_0xb5f7('0xa')]('/',auth[_0xb5f7('0xb')](),controller['index']);router[_0xb5f7('0xa')]('/describe',auth[_0xb5f7('0xb')](),controller[_0xb5f7('0xc')]);router[_0xb5f7('0xa')](_0xb5f7('0xd'),auth[_0xb5f7('0xb')](),controller[_0xb5f7('0xe')]);router['post']('/',auth[_0xb5f7('0xb')](),controller[_0xb5f7('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb5f7('0x10')]);router[_0xb5f7('0x11')](_0xb5f7('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xb5f7('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index a75477d..939983b 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 _0xae3f=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x4b9be2,_0x7f791e){var _0x43093c=function(_0x31ca54){while(--_0x31ca54){_0x4b9be2['push'](_0x4b9be2['shift']());}};_0x43093c(++_0x7f791e);}(_0xae3f,0x136));var _0xfae3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xae3f[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0xfae3('0x0')]={'priority':{'type':Sequelize[_0xfae3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xfae3('0x2')],'allowNull':![],'defaultValue':_0xfae3('0x3')},'appdata':{'type':Sequelize[_0xfae3('0x4')]()},'description':{'type':Sequelize[_0xfae3('0x2')]},'interval':{'type':Sequelize[_0xfae3('0x2')],'defaultValue':_0xfae3('0x5')}}; \ No newline at end of file +var _0xfebd=['TEXT','exports','INTEGER','STRING'];(function(_0x276c01,_0x32fad2){var _0x3e87f7=function(_0x4680cc){while(--_0x4680cc){_0x276c01['push'](_0x276c01['shift']());}};_0x3e87f7(++_0x32fad2);}(_0xfebd,0xb5));var _0xdfeb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfebd[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xdfeb('0x0')]={'priority':{'type':Sequelize[_0xdfeb('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xdfeb('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xdfeb('0x3')]()},'description':{'type':Sequelize[_0xdfeb('0x2')]},'interval':{'type':Sequelize[_0xdfeb('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 2d1076a..e6569a2 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 _0xdfb3=['../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','send','params','model','ChatApplication','query','intersection','fields','attributes','includeAll','include','merge','options','update','body','find','catch','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x1efe63,_0x4eaa61){var _0x442c2a=function(_0x5122aa){while(--_0x5122aa){_0x1efe63['push'](_0x1efe63['shift']());}};_0x442c2a(++_0x4eaa61);}(_0xdfb3,0x144));var _0x3dfb=function(_0x2ff9a,_0x4d2e32){_0x2ff9a=_0x2ff9a-0x0;var _0xb3382f=_0xdfb3[_0x2ff9a];return _0xb3382f;};'use strict';var emlformat=require(_0x3dfb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dfb('0x1'));var jsonpatch=require(_0x3dfb('0x2'));var rp=require(_0x3dfb('0x3'));var moment=require(_0x3dfb('0x4'));var BPromise=require(_0x3dfb('0x5'));var Mustache=require('mustache');var util=require(_0x3dfb('0x6'));var path=require(_0x3dfb('0x7'));var sox=require(_0x3dfb('0x8'));var csv=require(_0x3dfb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3dfb('0xa'));var _=require(_0x3dfb('0xb'));var squel=require(_0x3dfb('0xc'));var crypto=require(_0x3dfb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3dfb('0xe'));var toCsv=require(_0x3dfb('0x9'));var querystring=require(_0x3dfb('0xf'));var Papa=require('papaparse');var Redis=require(_0x3dfb('0x10'));var authService=require(_0x3dfb('0x11'));var qs=require(_0x3dfb('0x12'));var as=require(_0x3dfb('0x13'));var hardwareService=require(_0x3dfb('0x14'));var logger=require(_0x3dfb('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x3dfb('0x16'));var licenseUtil=require(_0x3dfb('0x17'));var db=require(_0x3dfb('0x18'))['db'];function respondWithStatusCode(_0x523c43,_0x2e1ee5){_0x2e1ee5=_0x2e1ee5||0xcc;return function(_0x2d453a){if(_0x2d453a){return _0x523c43[_0x3dfb('0x19')](_0x2e1ee5);}return _0x523c43['status'](_0x2e1ee5)[_0x3dfb('0x1a')]();};}function respondWithResult(_0x1f55bd,_0x2b7cfc){_0x2b7cfc=_0x2b7cfc||0xc8;return function(_0x4c1d78){if(_0x4c1d78){return _0x1f55bd[_0x3dfb('0x1b')](_0x2b7cfc)[_0x3dfb('0x1c')](_0x4c1d78);}};}function respondWithFilteredResult(_0xcd7760,_0x19beb1){return function(_0x54efa1){if(_0x54efa1){var _0x4d71cf=typeof _0x19beb1[_0x3dfb('0x1d')]===_0x3dfb('0x1e')&&typeof _0x19beb1[_0x3dfb('0x1f')]===_0x3dfb('0x1e');var _0x5c190f=_0x54efa1[_0x3dfb('0x20')];var _0x3e0064=_0x4d71cf?0x0:_0x19beb1['offset'];var _0x1c18f9=_0x4d71cf?_0x54efa1[_0x3dfb('0x20')]:_0x19beb1[_0x3dfb('0x1d')]+_0x19beb1[_0x3dfb('0x1f')];var _0x5c7336;if(_0x1c18f9>=_0x5c190f){_0x1c18f9=_0x5c190f;_0x5c7336=0xc8;}else{_0x5c7336=0xce;}_0xcd7760['status'](_0x5c7336);return _0xcd7760[_0x3dfb('0x21')]('Content-Range',_0x3e0064+'-'+_0x1c18f9+'/'+_0x5c190f)['json'](_0x54efa1);}return null;};}function patchUpdates(_0xc0b1c6){return function(_0x5a5e62){try{jsonpatch[_0x3dfb('0x22')](_0x5a5e62,_0xc0b1c6,!![]);}catch(_0xc2c30a){return BPromise[_0x3dfb('0x23')](_0xc2c30a);}return _0x5a5e62[_0x3dfb('0x24')]();};}function saveUpdates(_0x36c7ba,_0x37a6fa){return function(_0x14f287){if(_0x14f287){return _0x14f287['update'](_0x36c7ba)[_0x3dfb('0x25')](function(_0xdd12a2){return _0xdd12a2;});}return null;};}function removeEntity(_0x3659a1,_0x311dea){return function(_0x1998c7){if(_0x1998c7){return _0x1998c7['destroy']()[_0x3dfb('0x25')](function(){_0x3659a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x414e5d,_0x2fcac4){return function(_0x146811){if(!_0x146811){_0x414e5d[_0x3dfb('0x19')](0x194);}return _0x146811;};}function handleError(_0xe23a35,_0x7f2a64){_0x7f2a64=_0x7f2a64||0x1f4;return function(_0x5e10ad){logger[_0x3dfb('0x26')](_0x5e10ad[_0x3dfb('0x27')]);if(_0x5e10ad[_0x3dfb('0x28')]){delete _0x5e10ad[_0x3dfb('0x28')];}_0xe23a35[_0x3dfb('0x1b')](_0x7f2a64)[_0x3dfb('0x29')](_0x5e10ad);};}exports['show']=function(_0xcfecc7,_0x43c188){var _0x78a6bd={'raw':!![],'where':{'id':_0xcfecc7[_0x3dfb('0x2a')]['id']}},_0x23482c={};_0x23482c[_0x3dfb('0x2b')]=_['keys'](db[_0x3dfb('0x2c')]['rawAttributes']);_0x23482c[_0x3dfb('0x2d')]=_['keys'](_0xcfecc7['query']);_0x23482c['filters']=_[_0x3dfb('0x2e')](_0x23482c[_0x3dfb('0x2b')],_0x23482c[_0x3dfb('0x2d')]);_0x78a6bd['attributes']=_[_0x3dfb('0x2e')](_0x23482c['model'],qs[_0x3dfb('0x2f')](_0xcfecc7[_0x3dfb('0x2d')][_0x3dfb('0x2f')]));_0x78a6bd[_0x3dfb('0x30')]=_0x78a6bd[_0x3dfb('0x30')]['length']?_0x78a6bd[_0x3dfb('0x30')]:_0x23482c[_0x3dfb('0x2b')];if(_0xcfecc7['query'][_0x3dfb('0x31')]){_0x78a6bd[_0x3dfb('0x32')]=[{'all':!![]}];}_0x78a6bd=_[_0x3dfb('0x33')]({},_0x78a6bd,_0xcfecc7[_0x3dfb('0x34')]);return db[_0x3dfb('0x2c')]['find'](_0x78a6bd)[_0x3dfb('0x25')](handleEntityNotFound(_0x43c188,null))[_0x3dfb('0x25')](respondWithResult(_0x43c188,null))['catch'](handleError(_0x43c188,null));};exports[_0x3dfb('0x35')]=function(_0x6b8ba1,_0x176e42){if(_0x6b8ba1['body']['id']){delete _0x6b8ba1[_0x3dfb('0x36')]['id'];}return db['ChatApplication'][_0x3dfb('0x37')]({'where':{'id':_0x6b8ba1[_0x3dfb('0x2a')]['id']}})[_0x3dfb('0x25')](handleEntityNotFound(_0x176e42,null))['then'](saveUpdates(_0x6b8ba1['body'],null))[_0x3dfb('0x25')](respondWithResult(_0x176e42,null))[_0x3dfb('0x38')](handleError(_0x176e42,null));};exports[_0x3dfb('0x39')]=function(_0x493a26,_0x226f62){return db['ChatApplication']['find']({'where':{'id':_0x493a26[_0x3dfb('0x2a')]['id']}})['then'](handleEntityNotFound(_0x226f62,null))[_0x3dfb('0x25')](removeEntity(_0x226f62,null))[_0x3dfb('0x38')](handleError(_0x226f62,null));}; \ No newline at end of file +var _0xaa10=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x4e1c00,_0x4418ea){var _0x45ae12=function(_0xce8803){while(--_0xce8803){_0x4e1c00['push'](_0x4e1c00['shift']());}};_0x45ae12(++_0x4418ea);}(_0xaa10,0xd9));var _0x0aa1=function(_0xcc3e08,_0x50407e){_0xcc3e08=_0xcc3e08-0x0;var _0xc9ca9e=_0xaa10[_0xcc3e08];return _0xc9ca9e;};'use strict';var emlformat=require(_0x0aa1('0x0'));var rimraf=require(_0x0aa1('0x1'));var zipdir=require(_0x0aa1('0x2'));var jsonpatch=require(_0x0aa1('0x3'));var rp=require(_0x0aa1('0x4'));var moment=require(_0x0aa1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0aa1('0x6'));var util=require('util');var path=require(_0x0aa1('0x7'));var sox=require(_0x0aa1('0x8'));var csv=require(_0x0aa1('0x9'));var ejs=require(_0x0aa1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0aa1('0xb'));var squel=require(_0x0aa1('0xc'));var crypto=require(_0x0aa1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0aa1('0xe'));var toCsv=require(_0x0aa1('0x9'));var querystring=require(_0x0aa1('0xf'));var Papa=require(_0x0aa1('0x10'));var Redis=require('ioredis');var authService=require(_0x0aa1('0x11'));var qs=require(_0x0aa1('0x12'));var as=require(_0x0aa1('0x13'));var hardwareService=require(_0x0aa1('0x14'));var logger=require(_0x0aa1('0x15'))(_0x0aa1('0x16'));var utils=require(_0x0aa1('0x17'));var config=require(_0x0aa1('0x18'));var licenseUtil=require(_0x0aa1('0x19'));var db=require(_0x0aa1('0x1a'))['db'];function respondWithStatusCode(_0x2a828d,_0x3bc50a){_0x3bc50a=_0x3bc50a||0xcc;return function(_0x264d8b){if(_0x264d8b){return _0x2a828d[_0x0aa1('0x1b')](_0x3bc50a);}return _0x2a828d[_0x0aa1('0x1c')](_0x3bc50a)[_0x0aa1('0x1d')]();};}function respondWithResult(_0x2318b0,_0x89e590){_0x89e590=_0x89e590||0xc8;return function(_0x3b2d97){if(_0x3b2d97){return _0x2318b0[_0x0aa1('0x1c')](_0x89e590)[_0x0aa1('0x1e')](_0x3b2d97);}};}function respondWithFilteredResult(_0x33a7a0,_0x2894d7){return function(_0xda6b55){if(_0xda6b55){var _0x574490=typeof _0x2894d7[_0x0aa1('0x1f')]===_0x0aa1('0x20')&&typeof _0x2894d7[_0x0aa1('0x21')]===_0x0aa1('0x20');var _0x1b11df=_0xda6b55[_0x0aa1('0x22')];var _0x34a191=_0x574490?0x0:_0x2894d7[_0x0aa1('0x1f')];var _0x1dd3c3=_0x574490?_0xda6b55[_0x0aa1('0x22')]:_0x2894d7[_0x0aa1('0x1f')]+_0x2894d7['limit'];var _0x56777e;if(_0x1dd3c3>=_0x1b11df){_0x1dd3c3=_0x1b11df;_0x56777e=0xc8;}else{_0x56777e=0xce;}_0x33a7a0[_0x0aa1('0x1c')](_0x56777e);return _0x33a7a0['set'](_0x0aa1('0x23'),_0x34a191+'-'+_0x1dd3c3+'/'+_0x1b11df)[_0x0aa1('0x1e')](_0xda6b55);}return null;};}function patchUpdates(_0x5a83b1){return function(_0x41e454){try{jsonpatch[_0x0aa1('0x24')](_0x41e454,_0x5a83b1,!![]);}catch(_0x59441c){return BPromise[_0x0aa1('0x25')](_0x59441c);}return _0x41e454[_0x0aa1('0x26')]();};}function saveUpdates(_0x5d55ee,_0x45d13f){return function(_0x39a6b8){if(_0x39a6b8){return _0x39a6b8[_0x0aa1('0x27')](_0x5d55ee)[_0x0aa1('0x28')](function(_0x5963a6){return _0x5963a6;});}return null;};}function removeEntity(_0x76dcc0,_0x2d90a5){return function(_0x193d2c){if(_0x193d2c){return _0x193d2c[_0x0aa1('0x29')]()[_0x0aa1('0x28')](function(){_0x76dcc0[_0x0aa1('0x1c')](0xcc)[_0x0aa1('0x1d')]();});}};}function handleEntityNotFound(_0x2fb783,_0x34a5d6){return function(_0x3cb2a9){if(!_0x3cb2a9){_0x2fb783['sendStatus'](0x194);}return _0x3cb2a9;};}function handleError(_0x3558f3,_0x30a17b){_0x30a17b=_0x30a17b||0x1f4;return function(_0x1d76ad){logger[_0x0aa1('0x2a')](_0x1d76ad[_0x0aa1('0x2b')]);if(_0x1d76ad[_0x0aa1('0x2c')]){delete _0x1d76ad[_0x0aa1('0x2c')];}_0x3558f3[_0x0aa1('0x1c')](_0x30a17b)['send'](_0x1d76ad);};}exports['show']=function(_0x4a6260,_0x41d199){var _0x40d605={'raw':!![],'where':{'id':_0x4a6260[_0x0aa1('0x2d')]['id']}},_0x6281b9={};_0x6281b9[_0x0aa1('0x2e')]=_[_0x0aa1('0x2f')](db[_0x0aa1('0x30')][_0x0aa1('0x31')]);_0x6281b9[_0x0aa1('0x32')]=_[_0x0aa1('0x2f')](_0x4a6260[_0x0aa1('0x32')]);_0x6281b9[_0x0aa1('0x33')]=_[_0x0aa1('0x34')](_0x6281b9['model'],_0x6281b9[_0x0aa1('0x32')]);_0x40d605[_0x0aa1('0x35')]=_[_0x0aa1('0x34')](_0x6281b9[_0x0aa1('0x2e')],qs[_0x0aa1('0x36')](_0x4a6260[_0x0aa1('0x32')][_0x0aa1('0x36')]));_0x40d605['attributes']=_0x40d605[_0x0aa1('0x35')][_0x0aa1('0x37')]?_0x40d605[_0x0aa1('0x35')]:_0x6281b9[_0x0aa1('0x2e')];if(_0x4a6260[_0x0aa1('0x32')][_0x0aa1('0x38')]){_0x40d605[_0x0aa1('0x39')]=[{'all':!![]}];}_0x40d605=_[_0x0aa1('0x3a')]({},_0x40d605,_0x4a6260[_0x0aa1('0x3b')]);return db[_0x0aa1('0x30')][_0x0aa1('0x3c')](_0x40d605)[_0x0aa1('0x28')](handleEntityNotFound(_0x41d199,null))[_0x0aa1('0x28')](respondWithResult(_0x41d199,null))[_0x0aa1('0x3d')](handleError(_0x41d199,null));};exports[_0x0aa1('0x27')]=function(_0x5be116,_0x281785){if(_0x5be116[_0x0aa1('0x3e')]['id']){delete _0x5be116[_0x0aa1('0x3e')]['id'];}return db[_0x0aa1('0x30')][_0x0aa1('0x3c')]({'where':{'id':_0x5be116[_0x0aa1('0x2d')]['id']}})[_0x0aa1('0x28')](handleEntityNotFound(_0x281785,null))[_0x0aa1('0x28')](saveUpdates(_0x5be116[_0x0aa1('0x3e')],null))[_0x0aa1('0x28')](respondWithResult(_0x281785,null))[_0x0aa1('0x3d')](handleError(_0x281785,null));};exports[_0x0aa1('0x29')]=function(_0x5ac938,_0x140f76){return db[_0x0aa1('0x30')][_0x0aa1('0x3c')]({'where':{'id':_0x5ac938[_0x0aa1('0x2d')]['id']}})[_0x0aa1('0x28')](handleEntityNotFound(_0x140f76,null))[_0x0aa1('0x28')](removeEntity(_0x140f76,null))[_0x0aa1('0x3d')](handleError(_0x140f76,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 29f964e..1ba7c1b 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 d9fb1fc..02dd22f 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 _0xaca9=['code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xaca9,0x10c));var _0x9aca=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xaca9[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x9aca('0x0'));var util=require(_0x9aca('0x1'));var moment=require(_0x9aca('0x2'));var BPromise=require(_0x9aca('0x3'));var rs=require(_0x9aca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9aca('0x5'))['db'];var utils=require(_0x9aca('0x6'));var logger=require(_0x9aca('0x7'))(_0x9aca('0x8'));var config=require('../../config/environment');var jayson=require(_0x9aca('0x9'));var client=jayson[_0x9aca('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29478f,_0x1549e2,_0x176ea4){return new BPromise(function(_0xfe27f6,_0x476331){return client[_0x9aca('0xb')](_0x29478f,_0x176ea4)[_0x9aca('0xc')](function(_0x82a06d){logger['info'](_0x9aca('0xd'),_0x1549e2,_0x9aca('0xe'));logger['debug'](_0x9aca('0xf'),_0x1549e2,'request\x20sent',JSON[_0x9aca('0x10')](_0x82a06d));if(_0x82a06d[_0x9aca('0x11')]){if(_0x82a06d[_0x9aca('0x11')][_0x9aca('0x12')]===0x1f4){logger[_0x9aca('0x11')](_0x9aca('0xd'),_0x1549e2,_0x82a06d[_0x9aca('0x11')][_0x9aca('0x13')]);return _0x476331(_0x82a06d['error'][_0x9aca('0x13')]);}logger[_0x9aca('0x11')](_0x9aca('0xd'),_0x1549e2,_0x82a06d['error'][_0x9aca('0x13')]);return _0xfe27f6(_0x82a06d[_0x9aca('0x11')][_0x9aca('0x13')]);}else{logger[_0x9aca('0x14')]('ChatApplication,\x20%s,\x20%s',_0x1549e2,_0x9aca('0xe'));_0xfe27f6(_0x82a06d[_0x9aca('0x15')][_0x9aca('0x13')]);}})['catch'](function(_0x4edd4a){logger[_0x9aca('0x11')](_0x9aca('0xd'),_0x1549e2,_0x4edd4a);_0x476331(_0x4edd4a);});});} \ No newline at end of file +var _0x858e=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x4df1e3,_0x2d211a){var _0x4b7236=function(_0x404339){while(--_0x404339){_0x4df1e3['push'](_0x4df1e3['shift']());}};_0x4b7236(++_0x2d211a);}(_0x858e,0x1c8));var _0xe858=function(_0x322752,_0x1ab149){_0x322752=_0x322752-0x0;var _0x2a6840=_0x858e[_0x322752];return _0x2a6840;};'use strict';var _=require(_0xe858('0x0'));var util=require(_0xe858('0x1'));var moment=require(_0xe858('0x2'));var BPromise=require(_0xe858('0x3'));var rs=require(_0xe858('0x4'));var fs=require('fs');var Redis=require(_0xe858('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe858('0x6'));var logger=require(_0xe858('0x7'))(_0xe858('0x8'));var config=require(_0xe858('0x9'));var jayson=require(_0xe858('0xa'));var client=jayson[_0xe858('0xb')][_0xe858('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22a553,_0x263875,_0x147627){return new BPromise(function(_0x107e52,_0x45d31f){return client[_0xe858('0xd')](_0x22a553,_0x147627)[_0xe858('0xe')](function(_0x1e9634){logger[_0xe858('0xf')](_0xe858('0x10'),_0x263875,_0xe858('0x11'));logger[_0xe858('0x12')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x263875,_0xe858('0x11'),JSON[_0xe858('0x13')](_0x1e9634));if(_0x1e9634[_0xe858('0x14')]){if(_0x1e9634[_0xe858('0x14')]['code']===0x1f4){logger[_0xe858('0x14')]('ChatApplication,\x20%s,\x20%s',_0x263875,_0x1e9634[_0xe858('0x14')][_0xe858('0x15')]);return _0x45d31f(_0x1e9634['error'][_0xe858('0x15')]);}logger[_0xe858('0x14')](_0xe858('0x10'),_0x263875,_0x1e9634[_0xe858('0x14')][_0xe858('0x15')]);return _0x107e52(_0x1e9634['error'][_0xe858('0x15')]);}else{logger[_0xe858('0xf')](_0xe858('0x10'),_0x263875,'request\x20sent');_0x107e52(_0x1e9634[_0xe858('0x16')][_0xe858('0x15')]);}})[_0xe858('0x17')](function(_0xccf10b){logger[_0xe858('0x14')](_0xe858('0x10'),_0x263875,_0xccf10b);_0x45d31f(_0xccf10b);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 41eba7c..9300718 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 _0x8f05=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','update','delete','exports'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0x8f05,0x159));var _0x58f0=function(_0x437e08,_0x1cab6c){_0x437e08=_0x437e08-0x0;var _0xcf57f2=_0x8f05[_0x437e08];return _0xcf57f2;};'use strict';var multer=require('multer');var util=require(_0x58f0('0x0'));var path=require(_0x58f0('0x1'));var timeout=require(_0x58f0('0x2'));var express=require(_0x58f0('0x3'));var router=express['Router']();var fs_extra=require(_0x58f0('0x4'));var auth=require(_0x58f0('0x5'));var interaction=require(_0x58f0('0x6'));var config=require(_0x58f0('0x7'));var controller=require(_0x58f0('0x8'));router['get'](_0x58f0('0x9'),auth[_0x58f0('0xa')](),controller[_0x58f0('0xb')]);router['put']('/:id',auth[_0x58f0('0xa')](),controller[_0x58f0('0xc')]);router[_0x58f0('0xd')](_0x58f0('0x9'),auth[_0x58f0('0xa')](),controller['destroy']);module[_0x58f0('0xe')]=router; \ No newline at end of file +var _0xda1d=['./chatApplication.controller','/:id','isAuthenticated','show','put','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5c89a3,_0x501c9f){var _0x17a382=function(_0x313f2b){while(--_0x313f2b){_0x5c89a3['push'](_0x5c89a3['shift']());}};_0x17a382(++_0x501c9f);}(_0xda1d,0x1f2));var _0xdda1=function(_0x4788ca,_0x5cda70){_0x4788ca=_0x4788ca-0x0;var _0x28a6f5=_0xda1d[_0x4788ca];return _0x28a6f5;};'use strict';var multer=require(_0xdda1('0x0'));var util=require('util');var path=require(_0xdda1('0x1'));var timeout=require('connect-timeout');var express=require(_0xdda1('0x2'));var router=express['Router']();var fs_extra=require(_0xdda1('0x3'));var auth=require(_0xdda1('0x4'));var interaction=require(_0xdda1('0x5'));var config=require('../../config/environment');var controller=require(_0xdda1('0x6'));router['get'](_0xdda1('0x7'),auth[_0xdda1('0x8')](),controller[_0xdda1('0x9')]);router[_0xdda1('0xa')](_0xdda1('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xdda1('0x7'),auth[_0xdda1('0x8')](),controller['destroy']);module[_0xdda1('0xb')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 7a5d441..d462bd2 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 _0x8293=['STRING','BOOLEAN','exports'];(function(_0x41ed37,_0xbcd1d4){var _0x13f7ea=function(_0x270235){while(--_0x270235){_0x41ed37['push'](_0x41ed37['shift']());}};_0x13f7ea(++_0xbcd1d4);}(_0x8293,0xc5));var _0x3829=function(_0x566906,_0x20b94c){_0x566906=_0x566906-0x0;var _0x197756=_0x8293[_0x566906];return _0x197756;};'use strict';var Sequelize=require('sequelize');module[_0x3829('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3829('0x1')]},'write':{'type':Sequelize[_0x3829('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4ff6=['BOOLEAN','sequelize','exports','STRING'];(function(_0x36fe2e,_0x3f47c0){var _0x4d5f3e=function(_0x474a92){while(--_0x474a92){_0x36fe2e['push'](_0x36fe2e['shift']());}};_0x4d5f3e(++_0x3f47c0);}(_0x4ff6,0xe9));var _0x64ff=function(_0x2088e6,_0x40bb23){_0x2088e6=_0x2088e6-0x0;var _0x22819f=_0x4ff6[_0x2088e6];return _0x22819f;};'use strict';var Sequelize=require(_0x64ff('0x0'));module[_0x64ff('0x1')]={'name':{'type':Sequelize[_0x64ff('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x64ff('0x2')]},'write':{'type':Sequelize[_0x64ff('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 3fd106c..82aa7f7 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 _0x6cd3=['rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','ChatGroup','includeAll','include','rows','show','params','fields','find','create','body','destroy','describe','getUnread','user','toInteger','addMembers','omit','ids','getMembers','findOne','removeMembers','addMessage','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','stack','name','send','index','map'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0x6cd3,0x107));var _0x36cd=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0x6cd3[_0x4d7f3f];return _0x5d67cc;};'use strict';var emlformat=require(_0x36cd('0x0'));var rimraf=require(_0x36cd('0x1'));var zipdir=require(_0x36cd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x36cd('0x3'));var moment=require(_0x36cd('0x4'));var BPromise=require(_0x36cd('0x5'));var Mustache=require('mustache');var util=require(_0x36cd('0x6'));var path=require(_0x36cd('0x7'));var sox=require(_0x36cd('0x8'));var csv=require(_0x36cd('0x9'));var ejs=require(_0x36cd('0xa'));var fs=require('fs');var fs_extra=require(_0x36cd('0xb'));var _=require(_0x36cd('0xc'));var squel=require(_0x36cd('0xd'));var crypto=require(_0x36cd('0xe'));var jsforce=require(_0x36cd('0xf'));var deskjs=require(_0x36cd('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x36cd('0x11'));var Redis=require(_0x36cd('0x12'));var authService=require(_0x36cd('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x36cd('0x14'));var hardwareService=require(_0x36cd('0x15'));var logger=require('../../config/logger')(_0x36cd('0x16'));var utils=require('../../config/utils');var config=require(_0x36cd('0x17'));var licenseUtil=require(_0x36cd('0x18'));var db=require('../../mysqldb')['db'];config[_0x36cd('0x19')]=_[_0x36cd('0x1a')](config[_0x36cd('0x19')],{'host':_0x36cd('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x36cd('0x19')]));require(_0x36cd('0x1c'))[_0x36cd('0x1d')](socket);var jayson=require(_0x36cd('0x1e'));var client=jayson['client'][_0x36cd('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x19969a,_0x5828f7,_0x5b3188,_0x479641){return new BPromise(function(_0x3d83ec,_0x209a68){var _0x2755d4=_0x479641||client;return _0x2755d4['request'](_0x19969a,_0x5b3188)[_0x36cd('0x20')](function(_0x361be0){logger[_0x36cd('0x21')]('ChatGroup,\x20%s,\x20%s',_0x5828f7,_0x36cd('0x22'));logger[_0x36cd('0x23')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5828f7,'request\x20sent',JSON[_0x36cd('0x24')](_0x361be0));if(_0x361be0[_0x36cd('0x25')]){if(_0x361be0[_0x36cd('0x25')][_0x36cd('0x26')]===0x1f4){logger[_0x36cd('0x25')](_0x36cd('0x27'),_0x5828f7,_0x361be0[_0x36cd('0x25')]['message']);return _0x209a68(_0x361be0[_0x36cd('0x25')]['message']);}logger[_0x36cd('0x25')](_0x36cd('0x27'),_0x5828f7,_0x361be0[_0x36cd('0x25')][_0x36cd('0x28')]);return _0x3d83ec(_0x361be0[_0x36cd('0x25')]['message']);}else{logger[_0x36cd('0x21')]('ChatGroup,\x20%s,\x20%s',_0x5828f7,_0x36cd('0x22'));_0x3d83ec(_0x361be0[_0x36cd('0x29')]['message']);}})[_0x36cd('0x2a')](function(_0x5af218){logger[_0x36cd('0x25')]('ChatGroup,\x20%s,\x20%s',_0x5828f7,_0x5af218);_0x209a68(_0x5af218);});});}function respondWithStatusCode(_0x3f789e,_0x453742){_0x453742=_0x453742||0xcc;return function(_0x158c5d){if(_0x158c5d){return _0x3f789e[_0x36cd('0x2b')](_0x453742);}return _0x3f789e[_0x36cd('0x2c')](_0x453742)[_0x36cd('0x2d')]();};}function respondWithResult(_0x5b466a,_0x2c7e80){_0x2c7e80=_0x2c7e80||0xc8;return function(_0x329dd0){if(_0x329dd0){return _0x5b466a[_0x36cd('0x2c')](_0x2c7e80)[_0x36cd('0x2e')](_0x329dd0);}};}function respondWithFilteredResult(_0x30765d,_0xfec836){return function(_0x5b4bc2){if(_0x5b4bc2){var _0x52b979=typeof _0xfec836['offset']===_0x36cd('0x2f')&&typeof _0xfec836[_0x36cd('0x30')]===_0x36cd('0x2f');var _0x5e5c18=_0x5b4bc2[_0x36cd('0x31')];var _0x43450a=_0x52b979?0x0:_0xfec836[_0x36cd('0x32')];var _0x132c6=_0x52b979?_0x5b4bc2[_0x36cd('0x31')]:_0xfec836[_0x36cd('0x32')]+_0xfec836[_0x36cd('0x30')];var _0x89e113;if(_0x132c6>=_0x5e5c18){_0x132c6=_0x5e5c18;_0x89e113=0xc8;}else{_0x89e113=0xce;}_0x30765d['status'](_0x89e113);return _0x30765d[_0x36cd('0x33')](_0x36cd('0x34'),_0x43450a+'-'+_0x132c6+'/'+_0x5e5c18)[_0x36cd('0x2e')](_0x5b4bc2);}return null;};}function patchUpdates(_0x180fc2){return function(_0x5c9c17){try{jsonpatch[_0x36cd('0x35')](_0x5c9c17,_0x180fc2,!![]);}catch(_0x3d8a76){return BPromise[_0x36cd('0x36')](_0x3d8a76);}return _0x5c9c17['save']();};}function saveUpdates(_0x447a0d,_0x25db1c){return function(_0x2421af){if(_0x2421af){return _0x2421af[_0x36cd('0x37')](_0x447a0d)[_0x36cd('0x20')](function(_0x15f9f0){return _0x15f9f0;});}return null;};}function removeEntity(_0x37e920,_0xaa0c3e){return function(_0x40123e){if(_0x40123e){return _0x40123e['destroy']()[_0x36cd('0x20')](function(){_0x37e920[_0x36cd('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d0e2f,_0x50f707){return function(_0x44b3b6){if(!_0x44b3b6){_0x3d0e2f[_0x36cd('0x2b')](0x194);}return _0x44b3b6;};}function handleError(_0x4dd779,_0x24b23e){_0x24b23e=_0x24b23e||0x1f4;return function(_0x10f214){logger[_0x36cd('0x25')](_0x10f214[_0x36cd('0x38')]);if(_0x10f214[_0x36cd('0x39')]){delete _0x10f214['name'];}_0x4dd779[_0x36cd('0x2c')](_0x24b23e)[_0x36cd('0x3a')](_0x10f214);};}exports[_0x36cd('0x3b')]=function(_0x3ecfdc,_0x3df002){var _0xabafcc={},_0x2ec8f1={},_0x584415={'count':0x0,'rows':[]};var _0x628db=_[_0x36cd('0x3c')](db['ChatGroup'][_0x36cd('0x3d')],function(_0x150f14){return{'name':_0x150f14[_0x36cd('0x3e')],'type':_0x150f14[_0x36cd('0x3f')]['key']};});_0x2ec8f1['model']=_[_0x36cd('0x3c')](_0x628db,_0x36cd('0x39'));_0x2ec8f1['query']=_[_0x36cd('0x40')](_0x3ecfdc[_0x36cd('0x41')]);_0x2ec8f1[_0x36cd('0x42')]=_[_0x36cd('0x43')](_0x2ec8f1[_0x36cd('0x44')],_0x2ec8f1[_0x36cd('0x41')]);_0xabafcc[_0x36cd('0x45')]=_[_0x36cd('0x43')](_0x2ec8f1[_0x36cd('0x44')],qs['fields'](_0x3ecfdc[_0x36cd('0x41')]['fields']));_0xabafcc[_0x36cd('0x45')]=_0xabafcc[_0x36cd('0x45')][_0x36cd('0x46')]?_0xabafcc[_0x36cd('0x45')]:_0x2ec8f1['model'];if(!_0x3ecfdc[_0x36cd('0x41')][_0x36cd('0x47')](_0x36cd('0x48'))){_0xabafcc[_0x36cd('0x30')]=qs[_0x36cd('0x30')](_0x3ecfdc['query'][_0x36cd('0x30')]);_0xabafcc['offset']=qs[_0x36cd('0x32')](_0x3ecfdc['query']['offset']);}_0xabafcc[_0x36cd('0x49')]=qs[_0x36cd('0x4a')](_0x3ecfdc[_0x36cd('0x41')][_0x36cd('0x4a')]);_0xabafcc['where']=qs['filters'](_[_0x36cd('0x4b')](_0x3ecfdc[_0x36cd('0x41')],_0x2ec8f1[_0x36cd('0x42')]),_0x628db);if(_0x3ecfdc['query'][_0x36cd('0x4c')]){_0xabafcc['where']=_[_0x36cd('0x4d')](_0xabafcc[_0x36cd('0x4e')],{'$or':_[_0x36cd('0x3c')](_0x628db,function(_0x40f86e){if(_0x40f86e[_0x36cd('0x3f')]!=='VIRTUAL'){var _0x12edf4={};_0x12edf4[_0x40f86e[_0x36cd('0x39')]]={'$like':'%'+_0x3ecfdc[_0x36cd('0x41')][_0x36cd('0x4c')]+'%'};return _0x12edf4;}})});}_0xabafcc=_[_0x36cd('0x4d')]({},_0xabafcc,_0x3ecfdc[_0x36cd('0x4f')]);var _0x336741={'where':_0xabafcc[_0x36cd('0x4e')]};return db[_0x36cd('0x50')]['count'](_0x336741)[_0x36cd('0x20')](function(_0x308a37){_0x584415['count']=_0x308a37;if(_0x3ecfdc[_0x36cd('0x41')][_0x36cd('0x51')]){_0xabafcc[_0x36cd('0x52')]=[{'all':!![]}];}return db[_0x36cd('0x50')]['findAll'](_0xabafcc);})[_0x36cd('0x20')](function(_0x1a0f1d){_0x584415[_0x36cd('0x53')]=_0x1a0f1d;return _0x584415;})['then'](respondWithFilteredResult(_0x3df002,_0xabafcc))[_0x36cd('0x2a')](handleError(_0x3df002,null));};exports[_0x36cd('0x54')]=function(_0x18acdd,_0x496274){var _0x252f72={'raw':!![],'where':{'id':_0x18acdd[_0x36cd('0x55')]['id']}},_0xfab180={};_0xfab180[_0x36cd('0x44')]=_[_0x36cd('0x40')](db[_0x36cd('0x50')][_0x36cd('0x3d')]);_0xfab180[_0x36cd('0x41')]=_[_0x36cd('0x40')](_0x18acdd['query']);_0xfab180['filters']=_['intersection'](_0xfab180['model'],_0xfab180[_0x36cd('0x41')]);_0x252f72[_0x36cd('0x45')]=_[_0x36cd('0x43')](_0xfab180[_0x36cd('0x44')],qs[_0x36cd('0x56')](_0x18acdd[_0x36cd('0x41')]['fields']));_0x252f72[_0x36cd('0x45')]=_0x252f72[_0x36cd('0x45')][_0x36cd('0x46')]?_0x252f72[_0x36cd('0x45')]:_0xfab180[_0x36cd('0x44')];if(_0x18acdd[_0x36cd('0x41')][_0x36cd('0x51')]){_0x252f72['include']=[{'all':!![]}];}_0x252f72=_[_0x36cd('0x4d')]({},_0x252f72,_0x18acdd[_0x36cd('0x4f')]);return db[_0x36cd('0x50')][_0x36cd('0x57')](_0x252f72)[_0x36cd('0x20')](handleEntityNotFound(_0x496274,null))[_0x36cd('0x20')](respondWithResult(_0x496274,null))[_0x36cd('0x2a')](handleError(_0x496274,null));};exports[_0x36cd('0x58')]=function(_0x3ba235,_0x47e190){return db[_0x36cd('0x50')][_0x36cd('0x58')](_0x3ba235[_0x36cd('0x59')],{})[_0x36cd('0x20')](respondWithResult(_0x47e190,0xc9))[_0x36cd('0x2a')](handleError(_0x47e190,null));};exports[_0x36cd('0x37')]=function(_0x56c369,_0x563c45){if(_0x56c369[_0x36cd('0x59')]['id']){delete _0x56c369[_0x36cd('0x59')]['id'];}return db[_0x36cd('0x50')][_0x36cd('0x57')]({'where':{'id':_0x56c369[_0x36cd('0x55')]['id']}})[_0x36cd('0x20')](handleEntityNotFound(_0x563c45,null))[_0x36cd('0x20')](saveUpdates(_0x56c369[_0x36cd('0x59')],null))[_0x36cd('0x20')](respondWithResult(_0x563c45,null))[_0x36cd('0x2a')](handleError(_0x563c45,null));};exports[_0x36cd('0x5a')]=function(_0x49dac9,_0x39c022){return db[_0x36cd('0x50')][_0x36cd('0x57')]({'where':{'id':_0x49dac9[_0x36cd('0x55')]['id']}})['then'](handleEntityNotFound(_0x39c022,null))['then'](removeEntity(_0x39c022,null))['catch'](handleError(_0x39c022,null));};exports[_0x36cd('0x5b')]=function(_0x350ba5,_0x198c81){return db[_0x36cd('0x50')]['describe']()[_0x36cd('0x20')](respondWithResult(_0x198c81,null))['catch'](handleError(_0x198c81,null));};exports[_0x36cd('0x5c')]=function(_0xba53e9,_0x61fa75,_0x43af30){return db['ChatInternalMessage'][_0x36cd('0x31')]({'where':{'ChatGroupId':_0xba53e9[_0x36cd('0x55')]['id'],'ToId':_0xba53e9[_0x36cd('0x5d')]['id'],'read':![]}})[_0x36cd('0x20')](function(_0xd7904f){return{'id':_[_0x36cd('0x5e')](_0xba53e9[_0x36cd('0x55')]['id']),'count':_0xd7904f};})[_0x36cd('0x20')](respondWithResult(_0x61fa75,null))[_0x36cd('0x2a')](handleError(_0x61fa75,null));};exports[_0x36cd('0x5f')]=function(_0x5c9c4d,_0x5c78d5,_0x27da35){return db[_0x36cd('0x50')]['find']({'where':{'id':_0x5c9c4d[_0x36cd('0x55')]['id']}})['then'](handleEntityNotFound(_0x5c78d5,null))[_0x36cd('0x20')](function(_0x474512){if(_0x474512){return _0x474512[_0x36cd('0x5f')](_0x5c9c4d[_0x36cd('0x59')]['ids'],_[_0x36cd('0x60')](_0x5c9c4d[_0x36cd('0x59')],[_0x36cd('0x61'),'id'])||{});}})['then'](respondWithResult(_0x5c78d5,null))[_0x36cd('0x2a')](handleError(_0x5c78d5,null));};exports[_0x36cd('0x62')]=function(_0xc52dfa,_0x30f924,_0x440d95){var _0x285b1d={};var _0xc3308d={};var _0x5e502a;var _0x1511f2;return db[_0x36cd('0x50')][_0x36cd('0x63')]({'where':{'id':_0xc52dfa[_0x36cd('0x55')]['id']}})[_0x36cd('0x20')](handleEntityNotFound(_0x30f924,null))[_0x36cd('0x20')](function(_0x2acf90){if(_0x2acf90){_0x5e502a=_0x2acf90;_0xc3308d[_0x36cd('0x44')]=_['keys'](db['User'][_0x36cd('0x3d')]);_0xc3308d[_0x36cd('0x41')]=_[_0x36cd('0x40')](_0xc52dfa[_0x36cd('0x41')]);_0xc3308d['filters']=_['intersection'](_0xc3308d[_0x36cd('0x44')],_0xc3308d[_0x36cd('0x41')]);_0x285b1d[_0x36cd('0x45')]=_[_0x36cd('0x43')](_0xc3308d[_0x36cd('0x44')],qs[_0x36cd('0x56')](_0xc52dfa[_0x36cd('0x41')][_0x36cd('0x56')]));_0x285b1d[_0x36cd('0x45')]=_0x285b1d[_0x36cd('0x45')]['length']?_0x285b1d[_0x36cd('0x45')]:_0xc3308d[_0x36cd('0x44')];_0x285b1d[_0x36cd('0x49')]=qs[_0x36cd('0x4a')](_0xc52dfa[_0x36cd('0x41')][_0x36cd('0x4a')]);_0x285b1d[_0x36cd('0x4e')]=qs['filters'](_[_0x36cd('0x4b')](_0xc52dfa[_0x36cd('0x41')],_0xc3308d[_0x36cd('0x42')]));if(_0xc52dfa[_0x36cd('0x41')]['filter']){_0x285b1d[_0x36cd('0x4e')]=_[_0x36cd('0x4d')](_0x285b1d['where'],{'$or':_['map'](_0x285b1d['attributes'],function(_0x4a06a0){var _0x3822ad={};_0x3822ad[_0x4a06a0]={'$like':'%'+_0xc52dfa[_0x36cd('0x41')][_0x36cd('0x4c')]+'%'};return _0x3822ad;})});}_0x285b1d=_[_0x36cd('0x4d')]({},_0x285b1d,_0xc52dfa[_0x36cd('0x4f')]);return _0x5e502a[_0x36cd('0x62')](_0x285b1d);}})[_0x36cd('0x20')](function(_0x307b58){if(_0x307b58){_0x1511f2=_0x307b58['length'];if(!_0xc52dfa[_0x36cd('0x41')][_0x36cd('0x47')](_0x36cd('0x48'))){_0x285b1d['limit']=qs[_0x36cd('0x30')](_0xc52dfa[_0x36cd('0x41')][_0x36cd('0x30')]);_0x285b1d[_0x36cd('0x32')]=qs[_0x36cd('0x32')](_0xc52dfa[_0x36cd('0x41')][_0x36cd('0x32')]);}return _0x5e502a[_0x36cd('0x62')](_0x285b1d);}})['then'](function(_0x50c23c){if(_0x50c23c){return _0x50c23c?{'count':_0x1511f2,'rows':_0x50c23c}:null;}})[_0x36cd('0x20')](respondWithResult(_0x30f924,null))[_0x36cd('0x2a')](handleError(_0x30f924,null));};exports[_0x36cd('0x64')]=function(_0xd9714,_0x102d2a,_0x308318){return db[_0x36cd('0x50')]['find']({'where':{'id':_0xd9714[_0x36cd('0x55')]['id']}})[_0x36cd('0x20')](handleEntityNotFound(_0x102d2a,null))[_0x36cd('0x20')](function(_0x1cea0c){if(_0x1cea0c){return _0x1cea0c[_0x36cd('0x64')](_0xd9714[_0x36cd('0x41')][_0x36cd('0x61')]);}})[_0x36cd('0x20')](respondWithStatusCode(_0x102d2a,null))[_0x36cd('0x2a')](handleError(_0x102d2a,null));};exports[_0x36cd('0x65')]=function(_0x28df2d,_0x2dd5de,_0x5998fc){if(_0x28df2d[_0x36cd('0x59')]['id']){delete _0x28df2d[_0x36cd('0x59')]['id'];}return db['ChatGroup'][_0x36cd('0x57')]({'where':{'id':_0x28df2d['params']['id']}})[_0x36cd('0x20')](handleEntityNotFound(_0x2dd5de,null))[_0x36cd('0x20')](function(_0x15a0dc){if(_0x15a0dc){_0x28df2d['body']['ChatGroupId']=_0x15a0dc['id'];return db[_0x36cd('0x66')][_0x36cd('0x58')](_0x28df2d[_0x36cd('0x59')]);}})['then'](respondWithResult(_0x2dd5de,null))[_0x36cd('0x2a')](handleError(_0x2dd5de,null));};exports['getMessages']=function(_0x1d40d3,_0x10172d,_0x3498b4){var _0x39f199={};var _0x5d8e71={};var _0x584c73;var _0x37d9db;return db[_0x36cd('0x50')][_0x36cd('0x63')]({'where':{'id':_0x1d40d3[_0x36cd('0x55')]['id']}})[_0x36cd('0x20')](handleEntityNotFound(_0x10172d,null))[_0x36cd('0x20')](function(_0x1cb1da){if(_0x1cb1da){_0x584c73=_0x1cb1da;_0x5d8e71[_0x36cd('0x44')]=_[_0x36cd('0x40')](db[_0x36cd('0x66')][_0x36cd('0x3d')]);_0x5d8e71[_0x36cd('0x41')]=_[_0x36cd('0x40')](_0x1d40d3['query']);_0x5d8e71[_0x36cd('0x42')]=_[_0x36cd('0x43')](_0x5d8e71[_0x36cd('0x44')],_0x5d8e71['query']);_0x39f199['attributes']=_[_0x36cd('0x43')](_0x5d8e71[_0x36cd('0x44')],qs['fields'](_0x1d40d3['query'][_0x36cd('0x56')]));_0x39f199[_0x36cd('0x45')]=_0x39f199[_0x36cd('0x45')]['length']?_0x39f199[_0x36cd('0x45')]:_0x5d8e71[_0x36cd('0x44')];_0x39f199[_0x36cd('0x49')]=qs[_0x36cd('0x4a')](_0x1d40d3[_0x36cd('0x41')][_0x36cd('0x4a')]);_0x39f199['where']=qs['filters'](_[_0x36cd('0x4b')](_0x1d40d3[_0x36cd('0x41')],_0x5d8e71[_0x36cd('0x42')]));if(_0x1d40d3[_0x36cd('0x41')]['filter']){_0x39f199[_0x36cd('0x4e')]=_[_0x36cd('0x4d')](_0x39f199['where'],{'$or':_[_0x36cd('0x3c')](_0x39f199[_0x36cd('0x45')],function(_0x143656){var _0x33c44c={};_0x33c44c[_0x143656]={'$like':'%'+_0x1d40d3[_0x36cd('0x41')][_0x36cd('0x4c')]+'%'};return _0x33c44c;})});}if(_0x1d40d3[_0x36cd('0x41')][_0x36cd('0x67')]){var _0x59aea4=_0x1d40d3[_0x36cd('0x41')]['$gte'][_0x36cd('0x68')](',');var _0x3b7eaf={};_0x3b7eaf[_0x59aea4[0x0]]={'$gte':moment(_0x59aea4[0x1])[_0x36cd('0x69')](_0x36cd('0x6a'))};_0x39f199[_0x36cd('0x4e')]=_[_0x36cd('0x4d')](_0x39f199[_0x36cd('0x4e')],_0x3b7eaf);}_0x39f199=_['merge']({},_0x39f199,_0x1d40d3['options']);return _0x584c73['getMessages'](_0x39f199);}})['then'](function(_0x46a0b9){if(_0x46a0b9){_0x37d9db=_0x46a0b9[_0x36cd('0x46')];if(!_0x1d40d3[_0x36cd('0x41')]['hasOwnProperty'](_0x36cd('0x48'))){_0x39f199[_0x36cd('0x30')]=qs[_0x36cd('0x30')](_0x1d40d3[_0x36cd('0x41')][_0x36cd('0x30')]);_0x39f199[_0x36cd('0x32')]=qs[_0x36cd('0x32')](_0x1d40d3[_0x36cd('0x41')][_0x36cd('0x32')]);}return _0x584c73[_0x36cd('0x6b')](_0x39f199);}})[_0x36cd('0x20')](function(_0xedf264){if(_0xedf264){return _0xedf264?{'count':_0x37d9db,'rows':_0xedf264}:null;}})[_0x36cd('0x20')](respondWithResult(_0x10172d,null))['catch'](handleError(_0x10172d,null));}; \ No newline at end of file +var _0xe0fd=['options','ChatGroup','includeAll','include','findAll','rows','params','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','nolimit','getMembers','removeMembers','addMessage','ChatGroupId','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','./chatGroup.socket','jayson/promise','client','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL'];(function(_0x3d060f,_0x107628){var _0x50dfd3=function(_0x13c656){while(--_0x13c656){_0x3d060f['push'](_0x3d060f['shift']());}};_0x50dfd3(++_0x107628);}(_0xe0fd,0x15e));var _0xde0f=function(_0x33722e,_0xb4360){_0x33722e=_0x33722e-0x0;var _0x42878b=_0xe0fd[_0x33722e];return _0x42878b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xde0f('0x0'));var jsonpatch=require(_0xde0f('0x1'));var rp=require(_0xde0f('0x2'));var moment=require(_0xde0f('0x3'));var BPromise=require(_0xde0f('0x4'));var Mustache=require(_0xde0f('0x5'));var util=require(_0xde0f('0x6'));var path=require(_0xde0f('0x7'));var sox=require(_0xde0f('0x8'));var csv=require(_0xde0f('0x9'));var ejs=require(_0xde0f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde0f('0xb'));var squel=require('squel');var crypto=require(_0xde0f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xde0f('0xd'));var toCsv=require(_0xde0f('0x9'));var querystring=require('querystring');var Papa=require(_0xde0f('0xe'));var Redis=require(_0xde0f('0xf'));var authService=require(_0xde0f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xde0f('0x11'));var hardwareService=require(_0xde0f('0x12'));var logger=require(_0xde0f('0x13'))(_0xde0f('0x14'));var utils=require(_0xde0f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xde0f('0x16'));var db=require('../../mysqldb')['db'];config[_0xde0f('0x17')]=_['defaults'](config[_0xde0f('0x17')],{'host':_0xde0f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde0f('0x17')]));require(_0xde0f('0x19'))['register'](socket);var jayson=require(_0xde0f('0x1a'));var client=jayson[_0xde0f('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33b4ff,_0x3e0c52,_0x5ad970,_0x1463ad){return new BPromise(function(_0x36455f,_0xc448d8){var _0x524cf3=_0x1463ad||client;return _0x524cf3[_0xde0f('0x1c')](_0x33b4ff,_0x5ad970)[_0xde0f('0x1d')](function(_0x2c0b1f){logger[_0xde0f('0x1e')](_0xde0f('0x1f'),_0x3e0c52,_0xde0f('0x20'));logger['debug'](_0xde0f('0x21'),_0x3e0c52,_0xde0f('0x20'),JSON[_0xde0f('0x22')](_0x2c0b1f));if(_0x2c0b1f[_0xde0f('0x23')]){if(_0x2c0b1f['error'][_0xde0f('0x24')]===0x1f4){logger[_0xde0f('0x23')](_0xde0f('0x1f'),_0x3e0c52,_0x2c0b1f['error'][_0xde0f('0x25')]);return _0xc448d8(_0x2c0b1f[_0xde0f('0x23')][_0xde0f('0x25')]);}logger[_0xde0f('0x23')]('ChatGroup,\x20%s,\x20%s',_0x3e0c52,_0x2c0b1f[_0xde0f('0x23')][_0xde0f('0x25')]);return _0x36455f(_0x2c0b1f[_0xde0f('0x23')]['message']);}else{logger[_0xde0f('0x1e')](_0xde0f('0x1f'),_0x3e0c52,'request\x20sent');_0x36455f(_0x2c0b1f[_0xde0f('0x26')]['message']);}})['catch'](function(_0x2b59a1){logger[_0xde0f('0x23')](_0xde0f('0x1f'),_0x3e0c52,_0x2b59a1);_0xc448d8(_0x2b59a1);});});}function respondWithStatusCode(_0x22dfb1,_0x364a8d){_0x364a8d=_0x364a8d||0xcc;return function(_0x2ef0bd){if(_0x2ef0bd){return _0x22dfb1[_0xde0f('0x27')](_0x364a8d);}return _0x22dfb1[_0xde0f('0x28')](_0x364a8d)[_0xde0f('0x29')]();};}function respondWithResult(_0x5c427d,_0x444f78){_0x444f78=_0x444f78||0xc8;return function(_0x2981b6){if(_0x2981b6){return _0x5c427d['status'](_0x444f78)['json'](_0x2981b6);}};}function respondWithFilteredResult(_0x33e288,_0x55f501){return function(_0x20fee1){if(_0x20fee1){var _0x198db7=typeof _0x55f501[_0xde0f('0x2a')]==='undefined'&&typeof _0x55f501[_0xde0f('0x2b')]==='undefined';var _0x211f2a=_0x20fee1[_0xde0f('0x2c')];var _0x2b4d87=_0x198db7?0x0:_0x55f501[_0xde0f('0x2a')];var _0x1a257d=_0x198db7?_0x20fee1['count']:_0x55f501[_0xde0f('0x2a')]+_0x55f501[_0xde0f('0x2b')];var _0x360dc1;if(_0x1a257d>=_0x211f2a){_0x1a257d=_0x211f2a;_0x360dc1=0xc8;}else{_0x360dc1=0xce;}_0x33e288[_0xde0f('0x28')](_0x360dc1);return _0x33e288[_0xde0f('0x2d')](_0xde0f('0x2e'),_0x2b4d87+'-'+_0x1a257d+'/'+_0x211f2a)[_0xde0f('0x2f')](_0x20fee1);}return null;};}function patchUpdates(_0x5ae8fb){return function(_0x28e6a4){try{jsonpatch[_0xde0f('0x30')](_0x28e6a4,_0x5ae8fb,!![]);}catch(_0x4a5746){return BPromise[_0xde0f('0x31')](_0x4a5746);}return _0x28e6a4[_0xde0f('0x32')]();};}function saveUpdates(_0x3e5c59,_0x64a02e){return function(_0x10f97a){if(_0x10f97a){return _0x10f97a[_0xde0f('0x33')](_0x3e5c59)[_0xde0f('0x1d')](function(_0x49676a){return _0x49676a;});}return null;};}function removeEntity(_0x16e547,_0x1e196a){return function(_0x4044e4){if(_0x4044e4){return _0x4044e4[_0xde0f('0x34')]()[_0xde0f('0x1d')](function(){_0x16e547[_0xde0f('0x28')](0xcc)[_0xde0f('0x29')]();});}};}function handleEntityNotFound(_0x4f4c5d,_0x21af0a){return function(_0x1c113b){if(!_0x1c113b){_0x4f4c5d['sendStatus'](0x194);}return _0x1c113b;};}function handleError(_0x4c736b,_0x59b171){_0x59b171=_0x59b171||0x1f4;return function(_0x892962){logger[_0xde0f('0x23')](_0x892962[_0xde0f('0x35')]);if(_0x892962[_0xde0f('0x36')]){delete _0x892962[_0xde0f('0x36')];}_0x4c736b[_0xde0f('0x28')](_0x59b171)[_0xde0f('0x37')](_0x892962);};}exports[_0xde0f('0x38')]=function(_0x5d5788,_0x408b86){var _0x40a629={},_0x30d8da={},_0x5d0bb0={'count':0x0,'rows':[]};var _0x14e936=_[_0xde0f('0x39')](db['ChatGroup'][_0xde0f('0x3a')],function(_0x2cd343){return{'name':_0x2cd343[_0xde0f('0x3b')],'type':_0x2cd343[_0xde0f('0x3c')][_0xde0f('0x3d')]};});_0x30d8da[_0xde0f('0x3e')]=_[_0xde0f('0x39')](_0x14e936,_0xde0f('0x36'));_0x30d8da['query']=_[_0xde0f('0x3f')](_0x5d5788[_0xde0f('0x40')]);_0x30d8da['filters']=_[_0xde0f('0x41')](_0x30d8da[_0xde0f('0x3e')],_0x30d8da[_0xde0f('0x40')]);_0x40a629[_0xde0f('0x42')]=_[_0xde0f('0x41')](_0x30d8da['model'],qs[_0xde0f('0x43')](_0x5d5788[_0xde0f('0x40')][_0xde0f('0x43')]));_0x40a629[_0xde0f('0x42')]=_0x40a629['attributes'][_0xde0f('0x44')]?_0x40a629['attributes']:_0x30d8da[_0xde0f('0x3e')];if(!_0x5d5788['query'][_0xde0f('0x45')]('nolimit')){_0x40a629['limit']=qs['limit'](_0x5d5788[_0xde0f('0x40')]['limit']);_0x40a629[_0xde0f('0x2a')]=qs['offset'](_0x5d5788['query']['offset']);}_0x40a629[_0xde0f('0x46')]=qs[_0xde0f('0x47')](_0x5d5788[_0xde0f('0x40')][_0xde0f('0x47')]);_0x40a629[_0xde0f('0x48')]=qs['filters'](_[_0xde0f('0x49')](_0x5d5788[_0xde0f('0x40')],_0x30d8da[_0xde0f('0x4a')]),_0x14e936);if(_0x5d5788[_0xde0f('0x40')][_0xde0f('0x4b')]){_0x40a629[_0xde0f('0x48')]=_[_0xde0f('0x4c')](_0x40a629[_0xde0f('0x48')],{'$or':_[_0xde0f('0x39')](_0x14e936,function(_0x155140){if(_0x155140['type']!==_0xde0f('0x4d')){var _0xa037b9={};_0xa037b9[_0x155140[_0xde0f('0x36')]]={'$like':'%'+_0x5d5788[_0xde0f('0x40')][_0xde0f('0x4b')]+'%'};return _0xa037b9;}})});}_0x40a629=_[_0xde0f('0x4c')]({},_0x40a629,_0x5d5788[_0xde0f('0x4e')]);var _0x3f6d59={'where':_0x40a629[_0xde0f('0x48')]};return db[_0xde0f('0x4f')][_0xde0f('0x2c')](_0x3f6d59)[_0xde0f('0x1d')](function(_0x5456bb){_0x5d0bb0[_0xde0f('0x2c')]=_0x5456bb;if(_0x5d5788['query'][_0xde0f('0x50')]){_0x40a629[_0xde0f('0x51')]=[{'all':!![]}];}return db[_0xde0f('0x4f')][_0xde0f('0x52')](_0x40a629);})[_0xde0f('0x1d')](function(_0x1bd9a1){_0x5d0bb0[_0xde0f('0x53')]=_0x1bd9a1;return _0x5d0bb0;})[_0xde0f('0x1d')](respondWithFilteredResult(_0x408b86,_0x40a629))['catch'](handleError(_0x408b86,null));};exports['show']=function(_0x3a6ae9,_0x12df8f){var _0x3ea14c={'raw':!![],'where':{'id':_0x3a6ae9[_0xde0f('0x54')]['id']}},_0x1c262b={};_0x1c262b['model']=_[_0xde0f('0x3f')](db[_0xde0f('0x4f')][_0xde0f('0x3a')]);_0x1c262b[_0xde0f('0x40')]=_[_0xde0f('0x3f')](_0x3a6ae9[_0xde0f('0x40')]);_0x1c262b['filters']=_[_0xde0f('0x41')](_0x1c262b['model'],_0x1c262b[_0xde0f('0x40')]);_0x3ea14c[_0xde0f('0x42')]=_[_0xde0f('0x41')](_0x1c262b['model'],qs[_0xde0f('0x43')](_0x3a6ae9[_0xde0f('0x40')]['fields']));_0x3ea14c['attributes']=_0x3ea14c[_0xde0f('0x42')]['length']?_0x3ea14c[_0xde0f('0x42')]:_0x1c262b['model'];if(_0x3a6ae9[_0xde0f('0x40')][_0xde0f('0x50')]){_0x3ea14c['include']=[{'all':!![]}];}_0x3ea14c=_[_0xde0f('0x4c')]({},_0x3ea14c,_0x3a6ae9[_0xde0f('0x4e')]);return db[_0xde0f('0x4f')][_0xde0f('0x55')](_0x3ea14c)[_0xde0f('0x1d')](handleEntityNotFound(_0x12df8f,null))['then'](respondWithResult(_0x12df8f,null))[_0xde0f('0x56')](handleError(_0x12df8f,null));};exports[_0xde0f('0x57')]=function(_0x489fce,_0x6887e3){return db['ChatGroup']['create'](_0x489fce[_0xde0f('0x58')],{})[_0xde0f('0x1d')](respondWithResult(_0x6887e3,0xc9))[_0xde0f('0x56')](handleError(_0x6887e3,null));};exports[_0xde0f('0x33')]=function(_0x47627c,_0x40c48f){if(_0x47627c['body']['id']){delete _0x47627c[_0xde0f('0x58')]['id'];}return db[_0xde0f('0x4f')][_0xde0f('0x55')]({'where':{'id':_0x47627c[_0xde0f('0x54')]['id']}})['then'](handleEntityNotFound(_0x40c48f,null))[_0xde0f('0x1d')](saveUpdates(_0x47627c[_0xde0f('0x58')],null))[_0xde0f('0x1d')](respondWithResult(_0x40c48f,null))[_0xde0f('0x56')](handleError(_0x40c48f,null));};exports[_0xde0f('0x34')]=function(_0x1280b5,_0x6bfdad){return db['ChatGroup']['find']({'where':{'id':_0x1280b5[_0xde0f('0x54')]['id']}})['then'](handleEntityNotFound(_0x6bfdad,null))[_0xde0f('0x1d')](removeEntity(_0x6bfdad,null))[_0xde0f('0x56')](handleError(_0x6bfdad,null));};exports[_0xde0f('0x59')]=function(_0x490ec7,_0x45b064){return db[_0xde0f('0x4f')][_0xde0f('0x59')]()[_0xde0f('0x1d')](respondWithResult(_0x45b064,null))['catch'](handleError(_0x45b064,null));};exports[_0xde0f('0x5a')]=function(_0x3632e0,_0x3b637c,_0x5f1d07){return db[_0xde0f('0x5b')][_0xde0f('0x2c')]({'where':{'ChatGroupId':_0x3632e0[_0xde0f('0x54')]['id'],'ToId':_0x3632e0[_0xde0f('0x5c')]['id'],'read':![]}})[_0xde0f('0x1d')](function(_0x58366d){return{'id':_['toInteger'](_0x3632e0[_0xde0f('0x54')]['id']),'count':_0x58366d};})['then'](respondWithResult(_0x3b637c,null))['catch'](handleError(_0x3b637c,null));};exports[_0xde0f('0x5d')]=function(_0x1703dd,_0x540c52,_0x110a19){return db[_0xde0f('0x4f')][_0xde0f('0x55')]({'where':{'id':_0x1703dd[_0xde0f('0x54')]['id']}})[_0xde0f('0x1d')](handleEntityNotFound(_0x540c52,null))[_0xde0f('0x1d')](function(_0x295e26){if(_0x295e26){return _0x295e26['addMembers'](_0x1703dd['body'][_0xde0f('0x5e')],_[_0xde0f('0x5f')](_0x1703dd['body'],[_0xde0f('0x5e'),'id'])||{});}})[_0xde0f('0x1d')](respondWithResult(_0x540c52,null))[_0xde0f('0x56')](handleError(_0x540c52,null));};exports['getMembers']=function(_0x2d4870,_0x466ad3,_0x383c45){var _0x543fcd={};var _0x4e477a={};var _0xcef59e;var _0x309780;return db[_0xde0f('0x4f')]['findOne']({'where':{'id':_0x2d4870[_0xde0f('0x54')]['id']}})[_0xde0f('0x1d')](handleEntityNotFound(_0x466ad3,null))['then'](function(_0x59f56d){if(_0x59f56d){_0xcef59e=_0x59f56d;_0x4e477a[_0xde0f('0x3e')]=_['keys'](db['User'][_0xde0f('0x3a')]);_0x4e477a[_0xde0f('0x40')]=_[_0xde0f('0x3f')](_0x2d4870[_0xde0f('0x40')]);_0x4e477a[_0xde0f('0x4a')]=_[_0xde0f('0x41')](_0x4e477a['model'],_0x4e477a[_0xde0f('0x40')]);_0x543fcd[_0xde0f('0x42')]=_['intersection'](_0x4e477a[_0xde0f('0x3e')],qs[_0xde0f('0x43')](_0x2d4870['query'][_0xde0f('0x43')]));_0x543fcd['attributes']=_0x543fcd[_0xde0f('0x42')][_0xde0f('0x44')]?_0x543fcd[_0xde0f('0x42')]:_0x4e477a[_0xde0f('0x3e')];_0x543fcd['order']=qs['sort'](_0x2d4870['query'][_0xde0f('0x47')]);_0x543fcd[_0xde0f('0x48')]=qs['filters'](_['pick'](_0x2d4870[_0xde0f('0x40')],_0x4e477a[_0xde0f('0x4a')]));if(_0x2d4870[_0xde0f('0x40')][_0xde0f('0x4b')]){_0x543fcd[_0xde0f('0x48')]=_[_0xde0f('0x4c')](_0x543fcd['where'],{'$or':_[_0xde0f('0x39')](_0x543fcd[_0xde0f('0x42')],function(_0x16f08b){var _0x361f8a={};_0x361f8a[_0x16f08b]={'$like':'%'+_0x2d4870[_0xde0f('0x40')]['filter']+'%'};return _0x361f8a;})});}_0x543fcd=_[_0xde0f('0x4c')]({},_0x543fcd,_0x2d4870['options']);return _0xcef59e['getMembers'](_0x543fcd);}})[_0xde0f('0x1d')](function(_0x2561e5){if(_0x2561e5){_0x309780=_0x2561e5[_0xde0f('0x44')];if(!_0x2d4870[_0xde0f('0x40')][_0xde0f('0x45')](_0xde0f('0x60'))){_0x543fcd[_0xde0f('0x2b')]=qs[_0xde0f('0x2b')](_0x2d4870[_0xde0f('0x40')][_0xde0f('0x2b')]);_0x543fcd[_0xde0f('0x2a')]=qs[_0xde0f('0x2a')](_0x2d4870[_0xde0f('0x40')]['offset']);}return _0xcef59e[_0xde0f('0x61')](_0x543fcd);}})[_0xde0f('0x1d')](function(_0x96113a){if(_0x96113a){return _0x96113a?{'count':_0x309780,'rows':_0x96113a}:null;}})[_0xde0f('0x1d')](respondWithResult(_0x466ad3,null))[_0xde0f('0x56')](handleError(_0x466ad3,null));};exports[_0xde0f('0x62')]=function(_0x29725b,_0x49f888,_0x59e6fb){return db[_0xde0f('0x4f')]['find']({'where':{'id':_0x29725b[_0xde0f('0x54')]['id']}})[_0xde0f('0x1d')](handleEntityNotFound(_0x49f888,null))[_0xde0f('0x1d')](function(_0x42db09){if(_0x42db09){return _0x42db09[_0xde0f('0x62')](_0x29725b[_0xde0f('0x40')][_0xde0f('0x5e')]);}})['then'](respondWithStatusCode(_0x49f888,null))['catch'](handleError(_0x49f888,null));};exports[_0xde0f('0x63')]=function(_0x5f1067,_0x4a42f8,_0x1bca7f){if(_0x5f1067[_0xde0f('0x58')]['id']){delete _0x5f1067[_0xde0f('0x58')]['id'];}return db[_0xde0f('0x4f')][_0xde0f('0x55')]({'where':{'id':_0x5f1067[_0xde0f('0x54')]['id']}})['then'](handleEntityNotFound(_0x4a42f8,null))[_0xde0f('0x1d')](function(_0x43f613){if(_0x43f613){_0x5f1067[_0xde0f('0x58')][_0xde0f('0x64')]=_0x43f613['id'];return db['ChatInternalMessage'][_0xde0f('0x57')](_0x5f1067[_0xde0f('0x58')]);}})['then'](respondWithResult(_0x4a42f8,null))[_0xde0f('0x56')](handleError(_0x4a42f8,null));};exports['getMessages']=function(_0xb9ed1,_0x54cdc6,_0x289edf){var _0xe8495a={};var _0x30c174={};var _0x1106eb;var _0x4cd728;return db[_0xde0f('0x4f')][_0xde0f('0x65')]({'where':{'id':_0xb9ed1[_0xde0f('0x54')]['id']}})['then'](handleEntityNotFound(_0x54cdc6,null))[_0xde0f('0x1d')](function(_0x252d08){if(_0x252d08){_0x1106eb=_0x252d08;_0x30c174[_0xde0f('0x3e')]=_[_0xde0f('0x3f')](db[_0xde0f('0x5b')]['rawAttributes']);_0x30c174[_0xde0f('0x40')]=_[_0xde0f('0x3f')](_0xb9ed1[_0xde0f('0x40')]);_0x30c174[_0xde0f('0x4a')]=_['intersection'](_0x30c174[_0xde0f('0x3e')],_0x30c174[_0xde0f('0x40')]);_0xe8495a['attributes']=_[_0xde0f('0x41')](_0x30c174[_0xde0f('0x3e')],qs[_0xde0f('0x43')](_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x43')]));_0xe8495a[_0xde0f('0x42')]=_0xe8495a[_0xde0f('0x42')][_0xde0f('0x44')]?_0xe8495a['attributes']:_0x30c174[_0xde0f('0x3e')];_0xe8495a[_0xde0f('0x46')]=qs[_0xde0f('0x47')](_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x47')]);_0xe8495a[_0xde0f('0x48')]=qs[_0xde0f('0x4a')](_['pick'](_0xb9ed1['query'],_0x30c174['filters']));if(_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x4b')]){_0xe8495a[_0xde0f('0x48')]=_[_0xde0f('0x4c')](_0xe8495a[_0xde0f('0x48')],{'$or':_['map'](_0xe8495a[_0xde0f('0x42')],function(_0x12649c){var _0x1ccca4={};_0x1ccca4[_0x12649c]={'$like':'%'+_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x4b')]+'%'};return _0x1ccca4;})});}if(_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x66')]){var _0x24eb0b=_0xb9ed1['query'][_0xde0f('0x66')][_0xde0f('0x67')](',');var _0x571c53={};_0x571c53[_0x24eb0b[0x0]]={'$gte':moment(_0x24eb0b[0x1])[_0xde0f('0x68')](_0xde0f('0x69'))};_0xe8495a[_0xde0f('0x48')]=_[_0xde0f('0x4c')](_0xe8495a[_0xde0f('0x48')],_0x571c53);}_0xe8495a=_[_0xde0f('0x4c')]({},_0xe8495a,_0xb9ed1[_0xde0f('0x4e')]);return _0x1106eb[_0xde0f('0x6a')](_0xe8495a);}})[_0xde0f('0x1d')](function(_0x1e5933){if(_0x1e5933){_0x4cd728=_0x1e5933['length'];if(!_0xb9ed1['query'][_0xde0f('0x45')](_0xde0f('0x60'))){_0xe8495a['limit']=qs[_0xde0f('0x2b')](_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x2b')]);_0xe8495a[_0xde0f('0x2a')]=qs['offset'](_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x2a')]);}return _0x1106eb[_0xde0f('0x6a')](_0xe8495a);}})['then'](function(_0x5d2566){if(_0x5d2566){return _0x5d2566?{'count':_0x4cd728,'rows':_0x5d2566}:null;}})['then'](respondWithResult(_0x54cdc6,null))['catch'](handleError(_0x54cdc6,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index bb7619b..eb77c1c 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 _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0xadb5,0xad));var _0x5adb=function(_0x3cd509,_0x12e4a4){_0x3cd509=_0x3cd509-0x0;var _0x1093ed=_0xadb5[_0x3cd509];return _0x1093ed;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x5adb('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatGroupEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatGroupEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatGroup[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x32ea4c,_0x2d84a1){var _0x1861b4=function(_0x310ab4){while(--_0x310ab4){_0x32ea4c['push'](_0x32ea4c['shift']());}};_0x1861b4(++_0x2d84a1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x39d532,_0x4a561e){_0x39d532=_0x39d532-0x0;var _0x56cdf8=_0x5f2f[_0x39d532];return _0x56cdf8;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatGroup=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatGroupEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatGroupEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatGroup[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 024ffa9..84e3c89 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 _0x27c9=['ChatGroup','chat_groups','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define'];(function(_0x42c08f,_0x12ebd1){var _0x7f1b3b=function(_0x5a7165){while(--_0x5a7165){_0x42c08f['push'](_0x42c08f['shift']());}};_0x7f1b3b(++_0x12ebd1);}(_0x27c9,0x1af));var _0x927c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x27c9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x927c('0x0'));var util=require(_0x927c('0x1'));var logger=require(_0x927c('0x2'))(_0x927c('0x3'));var moment=require('moment');var BPromise=require(_0x927c('0x4'));var rp=require(_0x927c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x927c('0x6'));var config=require(_0x927c('0x7'));var attributes=require(_0x927c('0x8'));module[_0x927c('0x9')]=function(_0x338730,_0x5b09de){return _0x338730[_0x927c('0xa')](_0x927c('0xb'),attributes,{'tableName':_0x927c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9485=['request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','util','../../config/logger','api','bluebird'];(function(_0x1defa0,_0x373af5){var _0x36798c=function(_0x296b33){while(--_0x296b33){_0x1defa0['push'](_0x1defa0['shift']());}};_0x36798c(++_0x373af5);}(_0x9485,0x8b));var _0x5948=function(_0x3ddfd5,_0x56c373){_0x3ddfd5=_0x3ddfd5-0x0;var _0x44855e=_0x9485[_0x3ddfd5];return _0x44855e;};'use strict';var _=require(_0x5948('0x0'));var util=require(_0x5948('0x1'));var logger=require(_0x5948('0x2'))(_0x5948('0x3'));var moment=require('moment');var BPromise=require(_0x5948('0x4'));var rp=require(_0x5948('0x5'));var fs=require('fs');var path=require(_0x5948('0x6'));var rimraf=require('rimraf');var config=require(_0x5948('0x7'));var attributes=require(_0x5948('0x8'));module[_0x5948('0x9')]=function(_0x4312a8,_0x19ccdd){return _0x4312a8[_0x5948('0xa')]('ChatGroup',attributes,{'tableName':_0x5948('0xb'),'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 c3a482c..5241ba4 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 _0x32e6=['debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','request\x20sent'];(function(_0x3f618a,_0x14ece5){var _0x429a4a=function(_0x3af0ab){while(--_0x3af0ab){_0x3f618a['push'](_0x3f618a['shift']());}};_0x429a4a(++_0x14ece5);}(_0x32e6,0x165));var _0x632e=function(_0x30202f,_0x500a61){_0x30202f=_0x30202f-0x0;var _0x50f7db=_0x32e6[_0x30202f];return _0x50f7db;};'use strict';var _=require(_0x632e('0x0'));var util=require('util');var moment=require(_0x632e('0x1'));var BPromise=require(_0x632e('0x2'));var rs=require(_0x632e('0x3'));var fs=require('fs');var Redis=require(_0x632e('0x4'));var db=require(_0x632e('0x5'))['db'];var utils=require(_0x632e('0x6'));var logger=require(_0x632e('0x7'))(_0x632e('0x8'));var config=require('../../config/environment');var jayson=require(_0x632e('0x9'));var client=jayson[_0x632e('0xa')][_0x632e('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x632e('0xc')],{'host':_0x632e('0xd'),'port':0x18eb});var socket=require(_0x632e('0xe'))(new Redis(config[_0x632e('0xc')]));require(_0x632e('0xf'))[_0x632e('0x10')](socket);function respondWithRpcPromise(_0x54ca9a,_0x1a5f27,_0x262bb7){return new BPromise(function(_0x1a4804,_0x6aed2){return client[_0x632e('0x11')](_0x54ca9a,_0x262bb7)[_0x632e('0x12')](function(_0x278e9b){logger['info']('ChatGroup,\x20%s,\x20%s',_0x1a5f27,_0x632e('0x13'));logger[_0x632e('0x14')](_0x632e('0x15'),_0x1a5f27,_0x632e('0x13'),JSON['stringify'](_0x278e9b));if(_0x278e9b['error']){if(_0x278e9b[_0x632e('0x16')][_0x632e('0x17')]===0x1f4){logger[_0x632e('0x16')](_0x632e('0x18'),_0x1a5f27,_0x278e9b[_0x632e('0x16')][_0x632e('0x19')]);return _0x6aed2(_0x278e9b['error'][_0x632e('0x19')]);}logger[_0x632e('0x16')](_0x632e('0x18'),_0x1a5f27,_0x278e9b['error'][_0x632e('0x19')]);return _0x1a4804(_0x278e9b['error'][_0x632e('0x19')]);}else{logger[_0x632e('0x1a')](_0x632e('0x18'),_0x1a5f27,'request\x20sent');_0x1a4804(_0x278e9b[_0x632e('0x1b')][_0x632e('0x19')]);}})[_0x632e('0x1c')](function(_0x58f9da){logger[_0x632e('0x16')]('ChatGroup,\x20%s,\x20%s',_0x1a5f27,_0x58f9da);_0x6aed2(_0x58f9da);});});} \ No newline at end of file +var _0xf25e=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','./chatGroup.socket','register','request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3ffcb2,_0x35e65f){var _0xe5182d=function(_0x56e779){while(--_0x56e779){_0x3ffcb2['push'](_0x3ffcb2['shift']());}};_0xe5182d(++_0x35e65f);}(_0xf25e,0xf6));var _0xef25=function(_0x3a2777,_0x4f1968){_0x3a2777=_0x3a2777-0x0;var _0x173fff=_0xf25e[_0x3a2777];return _0x173fff;};'use strict';var _=require(_0xef25('0x0'));var util=require(_0xef25('0x1'));var moment=require('moment');var BPromise=require(_0xef25('0x2'));var rs=require(_0xef25('0x3'));var fs=require('fs');var Redis=require(_0xef25('0x4'));var db=require(_0xef25('0x5'))['db'];var utils=require(_0xef25('0x6'));var logger=require('../../config/logger')(_0xef25('0x7'));var config=require(_0xef25('0x8'));var jayson=require(_0xef25('0x9'));var client=jayson[_0xef25('0xa')][_0xef25('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xef25('0xc'),'port':0x18eb});var socket=require(_0xef25('0xd'))(new Redis(config[_0xef25('0xe')]));require(_0xef25('0xf'))[_0xef25('0x10')](socket);function respondWithRpcPromise(_0x34fe9a,_0x3fbc59,_0x2565b0){return new BPromise(function(_0x150145,_0x317882){return client[_0xef25('0x11')](_0x34fe9a,_0x2565b0)['then'](function(_0x31ea2e){logger[_0xef25('0x12')]('ChatGroup,\x20%s,\x20%s',_0x3fbc59,_0xef25('0x13'));logger[_0xef25('0x14')](_0xef25('0x15'),_0x3fbc59,_0xef25('0x13'),JSON[_0xef25('0x16')](_0x31ea2e));if(_0x31ea2e['error']){if(_0x31ea2e[_0xef25('0x17')]['code']===0x1f4){logger['error'](_0xef25('0x18'),_0x3fbc59,_0x31ea2e[_0xef25('0x17')]['message']);return _0x317882(_0x31ea2e[_0xef25('0x17')][_0xef25('0x19')]);}logger['error'](_0xef25('0x18'),_0x3fbc59,_0x31ea2e['error'][_0xef25('0x19')]);return _0x150145(_0x31ea2e['error'][_0xef25('0x19')]);}else{logger[_0xef25('0x12')](_0xef25('0x18'),_0x3fbc59,_0xef25('0x13'));_0x150145(_0x31ea2e[_0xef25('0x1a')][_0xef25('0x19')]);}})[_0xef25('0x1b')](function(_0x541369){logger['error']('ChatGroup,\x20%s,\x20%s',_0x3fbc59,_0x541369);_0x317882(_0x541369);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 6452ff7..60b10d1 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 _0xaaba=['length','chatGroup:','save','remove','update','emit','register'];(function(_0x277a2e,_0x30dd0e){var _0x4d9be4=function(_0x1b1db5){while(--_0x1b1db5){_0x277a2e['push'](_0x277a2e['shift']());}};_0x4d9be4(++_0x30dd0e);}(_0xaaba,0x113));var _0xaaab=function(_0x38bccc,_0xd4090e){_0x38bccc=_0x38bccc-0x0;var _0x5a5109=_0xaaba[_0x38bccc];return _0x5a5109;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xaaab('0x0'),_0xaaab('0x1'),_0xaaab('0x2')];function createListener(_0x5a4f8d,_0x965ece){return function(_0x2e6b13){_0x965ece[_0xaaab('0x3')](_0x5a4f8d,_0x2e6b13);};}function removeListener(_0x562641,_0x512d73){return function(){ChatGroupEvents['removeListener'](_0x562641,_0x512d73);};}exports[_0xaaab('0x4')]=function(_0x179c99){for(var _0x53dd86=0x0,_0x7e8a3c=events[_0xaaab('0x5')];_0x53dd86<_0x7e8a3c;_0x53dd86++){var _0x573c3c=events[_0x53dd86];var _0x5bfe8c=createListener(_0xaaab('0x6')+_0x573c3c,_0x179c99);ChatGroupEvents['on'](_0x573c3c,_0x5bfe8c);}}; \ No newline at end of file +var _0x29bb=['length','chatGroup:','remove','update','emit','removeListener','register'];(function(_0x6b7c2f,_0x293d2a){var _0x3cef8d=function(_0xd2ab1){while(--_0xd2ab1){_0x6b7c2f['push'](_0x6b7c2f['shift']());}};_0x3cef8d(++_0x293d2a);}(_0x29bb,0x113));var _0xb29b=function(_0x112bd0,_0x210742){_0x112bd0=_0x112bd0-0x0;var _0xcf89bf=_0x29bb[_0x112bd0];return _0xcf89bf;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0xb29b('0x0'),_0xb29b('0x1')];function createListener(_0x2a51fe,_0x2728c8){return function(_0x30dcbf){_0x2728c8[_0xb29b('0x2')](_0x2a51fe,_0x30dcbf);};}function removeListener(_0x173ee4,_0x5594e4){return function(){ChatGroupEvents[_0xb29b('0x3')](_0x173ee4,_0x5594e4);};}exports[_0xb29b('0x4')]=function(_0x5892f0){for(var _0x34fc91=0x0,_0xe77214=events[_0xb29b('0x5')];_0x34fc91<_0xe77214;_0x34fc91++){var _0x143990=events[_0x34fc91];var _0x40925e=createListener(_0xb29b('0x6')+_0x143990,_0x5892f0);ChatGroupEvents['on'](_0x143990,_0x40925e);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 993b6de..52e48b7 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 _0xfcbb=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','update','delete','destroy','removeMembers','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x541396,_0x453b59){_0x541396=_0x541396-0x0;var _0x132bfe=_0xfcbb[_0x541396];return _0x132bfe;};'use strict';var multer=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var path=require(_0xbfcb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbfcb('0x3')]();var fs_extra=require(_0xbfcb('0x4'));var auth=require(_0xbfcb('0x5'));var interaction=require(_0xbfcb('0x6'));var config=require(_0xbfcb('0x7'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xbfcb('0x8')](),controller[_0xbfcb('0x9')]);router[_0xbfcb('0xa')](_0xbfcb('0xb'),auth[_0xbfcb('0x8')](),controller[_0xbfcb('0xc')]);router[_0xbfcb('0xa')]('/:id',auth[_0xbfcb('0x8')](),controller[_0xbfcb('0xd')]);router[_0xbfcb('0xa')]('/:id/unread',auth[_0xbfcb('0x8')](),controller[_0xbfcb('0xe')]);router[_0xbfcb('0xa')](_0xbfcb('0xf'),auth[_0xbfcb('0x8')](),controller[_0xbfcb('0x10')]);router['get'](_0xbfcb('0x11'),auth[_0xbfcb('0x8')](),controller[_0xbfcb('0x12')]);router[_0xbfcb('0x13')]('/',auth['isAuthenticated'](),controller[_0xbfcb('0x14')]);router['post'](_0xbfcb('0xf'),auth[_0xbfcb('0x8')](),controller[_0xbfcb('0x15')]);router[_0xbfcb('0x13')](_0xbfcb('0x11'),auth[_0xbfcb('0x8')](),controller[_0xbfcb('0x16')]);router[_0xbfcb('0x17')](_0xbfcb('0x18'),auth[_0xbfcb('0x8')](),controller[_0xbfcb('0x19')]);router[_0xbfcb('0x1a')](_0xbfcb('0x18'),auth[_0xbfcb('0x8')](),controller[_0xbfcb('0x1b')]);router[_0xbfcb('0x1a')](_0xbfcb('0xf'),auth[_0xbfcb('0x8')](),controller[_0xbfcb('0x1c')]);module[_0xbfcb('0x1d')]=router; \ No newline at end of file +var _0x68a5=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getUnread','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','put','update','delete','removeMembers','exports'];(function(_0x58a09c,_0x1548ba){var _0x4bfc32=function(_0x2aaec1){while(--_0x2aaec1){_0x58a09c['push'](_0x58a09c['shift']());}};_0x4bfc32(++_0x1548ba);}(_0x68a5,0xfc));var _0x568a=function(_0x231dcb,_0x55410){_0x231dcb=_0x231dcb-0x0;var _0x1867ef=_0x68a5[_0x231dcb];return _0x1867ef;};'use strict';var multer=require(_0x568a('0x0'));var util=require('util');var path=require(_0x568a('0x1'));var timeout=require(_0x568a('0x2'));var express=require('express');var router=express[_0x568a('0x3')]();var fs_extra=require(_0x568a('0x4'));var auth=require(_0x568a('0x5'));var interaction=require(_0x568a('0x6'));var config=require('../../config/environment');var controller=require(_0x568a('0x7'));router['get']('/',auth[_0x568a('0x8')](),controller[_0x568a('0x9')]);router[_0x568a('0xa')](_0x568a('0xb'),auth['isAuthenticated'](),controller[_0x568a('0xc')]);router['get'](_0x568a('0xd'),auth[_0x568a('0x8')](),controller[_0x568a('0xe')]);router[_0x568a('0xa')]('/:id/unread',auth['isAuthenticated'](),controller[_0x568a('0xf')]);router[_0x568a('0xa')]('/:id/members',auth[_0x568a('0x8')](),controller['getMembers']);router[_0x568a('0xa')](_0x568a('0x10'),auth[_0x568a('0x8')](),controller[_0x568a('0x11')]);router[_0x568a('0x12')]('/',auth[_0x568a('0x8')](),controller[_0x568a('0x13')]);router[_0x568a('0x12')](_0x568a('0x14'),auth[_0x568a('0x8')](),controller[_0x568a('0x15')]);router[_0x568a('0x12')](_0x568a('0x10'),auth[_0x568a('0x8')](),controller[_0x568a('0x16')]);router[_0x568a('0x17')](_0x568a('0xd'),auth['isAuthenticated'](),controller[_0x568a('0x18')]);router['delete'](_0x568a('0xd'),auth[_0x568a('0x8')](),controller['destroy']);router[_0x568a('0x19')]('/:id/members',auth[_0x568a('0x8')](),controller[_0x568a('0x1a')]);module[_0x568a('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index ec72d78..63dc671 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 _0x06bd=['STRING','DATE','long','ENUM','sequelize','exports','BOOLEAN','star','TEXT'];(function(_0x5b1394,_0x17f08d){var _0x483150=function(_0x1d9539){while(--_0x1d9539){_0x5b1394['push'](_0x5b1394['shift']());}};_0x483150(++_0x17f08d);}(_0x06bd,0x15a));var _0xd06b=function(_0x44784c,_0x4498c1){_0x44784c=_0x44784c-0x0;var _0x4bbfb1=_0x06bd[_0x44784c];return _0x4bbfb1;};'use strict';var Sequelize=require(_0xd06b('0x0'));module[_0xd06b('0x1')]={'closed':{'type':Sequelize[_0xd06b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0xd06b('0x3'),'thumb'),'defaultValue':_0xd06b('0x3')},'ratingMessage':{'type':Sequelize[_0xd06b('0x4')]},'pathTranscript':{'type':Sequelize[_0xd06b('0x4')]},'mailTranscript':{'type':Sequelize[_0xd06b('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd06b('0x6')]},'disposition':{'type':Sequelize[_0xd06b('0x5')]},'secondDisposition':{'type':Sequelize[_0xd06b('0x5')]},'thirdDisposition':{'type':Sequelize[_0xd06b('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xd06b('0x5')]},'browserVersion':{'type':Sequelize[_0xd06b('0x5')]},'osName':{'type':Sequelize[_0xd06b('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xd06b('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xd06b('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd06b('0x4')](_0xd06b('0x7'))},'read1stAt':{'type':Sequelize[_0xd06b('0x6')]},'lastMsgAt':{'type':Sequelize[_0xd06b('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xd06b('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd06b('0x5')]},'customerPort':{'type':Sequelize[_0xd06b('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xd06b('0x4')]}}; \ No newline at end of file +var _0x775d=['ENUM','star','thumb','TEXT','STRING','DATE','long','out','exports','INTEGER'];(function(_0x3d26da,_0x57e7f0){var _0x3dfb46=function(_0x452fdd){while(--_0x452fdd){_0x3d26da['push'](_0x3d26da['shift']());}};_0x3dfb46(++_0x57e7f0);}(_0x775d,0x18e));var _0xd775=function(_0x5c593f,_0x46358e){_0x5c593f=_0x5c593f-0x0;var _0x1d5b52=_0x775d[_0x5c593f];return _0x1d5b52;};'use strict';var Sequelize=require('sequelize');module[_0xd775('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd775('0x1')]},'ratingType':{'type':Sequelize[_0xd775('0x2')](_0xd775('0x3'),_0xd775('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xd775('0x5')]},'pathTranscript':{'type':Sequelize[_0xd775('0x5')]},'mailTranscript':{'type':Sequelize[_0xd775('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd775('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd775('0x6')]},'thirdDisposition':{'type':Sequelize[_0xd775('0x6')]},'note':{'type':Sequelize[_0xd775('0x6')]},'browserName':{'type':Sequelize[_0xd775('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xd775('0x6')]},'osVersion':{'type':Sequelize[_0xd775('0x6')]},'deviceModel':{'type':Sequelize[_0xd775('0x6')]},'deviceVendor':{'type':Sequelize[_0xd775('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xd775('0x5')]},'customerIp':{'type':Sequelize[_0xd775('0x6')]},'formData':{'type':Sequelize[_0xd775('0x5')](_0xd775('0x8'))},'read1stAt':{'type':Sequelize[_0xd775('0x7')]},'lastMsgAt':{'type':Sequelize[_0xd775('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xd775('0x2')]('in',_0xd775('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd775('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xd775('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index a1bb704..eb0adc6 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 _0x952e=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','keys','includeAll','create','params','destroy','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','isNull','follow','metadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','closed','disposition','AbandonInteraction','attachmentUpload','originalname','file','filename','mimetype','attachmentDownload','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','%s%d','agentAlias','customer','Visitor','agentIdentifier','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','$gte','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','getMyMessages','addTags','omit','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','lastName','Owner','get','mkdirSync','Account','createdAt','closedAt','browserName','osName','customerPort','N.A.','existsSync','createReadStream','pipe','createWriteStream','firstName','renderFile','downloadInteraction.html','.pdf','Chat','createPdfFromHTML','log','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','jayson/promise','client','http','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','sendStatus','status','offset','undefined','count','set','json','reject','save','update','then','stack','name','merge','body','contact','interaction','account','Users','fullname','Tags','TagIds','split','forEach','push','map','rawAttributes','fieldName','key','model','query','attributes','intersection','length','hasOwnProperty','limit','order','sort','filters','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','end','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','where','parse','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','isEmpty','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','role','agent','sequelize','toString','keyBy','ChatInteraction','fields','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname'];(function(_0x346922,_0x580409){var _0x5f1c78=function(_0x201135){while(--_0x201135){_0x346922['push'](_0x346922['shift']());}};_0x5f1c78(++_0x580409);}(_0x952e,0x1b4));var _0xe952=function(_0xc6151,_0x285138){_0xc6151=_0xc6151-0x0;var _0xf7864f=_0x952e[_0xc6151];return _0xf7864f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe952('0x0'));var zipdir=require(_0xe952('0x1'));var jsonpatch=require(_0xe952('0x2'));var rp=require('request-promise');var moment=require(_0xe952('0x3'));var BPromise=require(_0xe952('0x4'));var Mustache=require('mustache');var util=require(_0xe952('0x5'));var path=require(_0xe952('0x6'));var sox=require(_0xe952('0x7'));var csv=require(_0xe952('0x8'));var ejs=require(_0xe952('0x9'));var fs=require('fs');var fs_extra=require(_0xe952('0xa'));var _=require('lodash');var squel=require(_0xe952('0xb'));var crypto=require(_0xe952('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe952('0xd'));var toCsv=require(_0xe952('0x8'));var querystring=require('querystring');var Papa=require(_0xe952('0xe'));var Redis=require('ioredis');var authService=require(_0xe952('0xf'));var qs=require(_0xe952('0x10'));var as=require(_0xe952('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xe952('0x12'));var logger=require(_0xe952('0x13'))('api');var utils=require(_0xe952('0x14'));var config=require(_0xe952('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe952('0x16'))['db'];config['redis']=_[_0xe952('0x17')](config[_0xe952('0x18')],{'host':_0xe952('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe952('0x18')]));require(_0xe952('0x1a'))['register'](socket);var jayson=require(_0xe952('0x1b'));var client=jayson[_0xe952('0x1c')][_0xe952('0x1d')]({'port':0x232b});var client9004=jayson[_0xe952('0x1c')][_0xe952('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x5c86a3,_0x55950b,_0x2a7ecd,_0x2c250a){return new BPromise(function(_0x12e718,_0x1a69f){var _0x164180=_0x2c250a||client;return _0x164180['request'](_0x5c86a3,_0x2a7ecd)['then'](function(_0x16c713){logger[_0xe952('0x1e')](_0xe952('0x1f'),_0x55950b,'request\x20sent');logger['debug'](_0xe952('0x20'),_0x55950b,_0xe952('0x21'),JSON['stringify'](_0x16c713));if(_0x16c713['error']){if(_0x16c713['error'][_0xe952('0x22')]===0x1f4){logger[_0xe952('0x23')](_0xe952('0x1f'),_0x55950b,_0x16c713[_0xe952('0x23')][_0xe952('0x24')]);return _0x1a69f(_0x16c713[_0xe952('0x23')]['message']);}logger[_0xe952('0x23')](_0xe952('0x1f'),_0x55950b,_0x16c713[_0xe952('0x23')]['message']);return _0x12e718(_0x16c713['error'][_0xe952('0x24')]);}else{logger[_0xe952('0x1e')](_0xe952('0x1f'),_0x55950b,_0xe952('0x21'));_0x12e718(_0x16c713[_0xe952('0x25')][_0xe952('0x24')]);}})[_0xe952('0x26')](function(_0x5bad58){logger[_0xe952('0x23')](_0xe952('0x1f'),_0x55950b,_0x5bad58);_0x1a69f(_0x5bad58);});});}function respondWithStatusCode(_0x4cac89,_0x151526){_0x151526=_0x151526||0xcc;return function(_0x1a1dd4){if(_0x1a1dd4){return _0x4cac89[_0xe952('0x27')](_0x151526);}return _0x4cac89[_0xe952('0x28')](_0x151526)['end']();};}function respondWithResult(_0x2f2ba4,_0x1efa85){_0x1efa85=_0x1efa85||0xc8;return function(_0x1c0e81){if(_0x1c0e81){return _0x2f2ba4[_0xe952('0x28')](_0x1efa85)['json'](_0x1c0e81);}};}function respondWithFilteredResult(_0x5b538a,_0x2d495e){return function(_0x2ae471){if(_0x2ae471){var _0x275a41=typeof _0x2d495e[_0xe952('0x29')]==='undefined'&&typeof _0x2d495e['limit']===_0xe952('0x2a');var _0x54dbb2=_0x2ae471['count'];var _0x40a9c7=_0x275a41?0x0:_0x2d495e[_0xe952('0x29')];var _0x29a4bf=_0x275a41?_0x2ae471[_0xe952('0x2b')]:_0x2d495e[_0xe952('0x29')]+_0x2d495e['limit'];var _0x62954d;if(_0x29a4bf>=_0x54dbb2){_0x29a4bf=_0x54dbb2;_0x62954d=0xc8;}else{_0x62954d=0xce;}_0x5b538a['status'](_0x62954d);return _0x5b538a[_0xe952('0x2c')]('Content-Range',_0x40a9c7+'-'+_0x29a4bf+'/'+_0x54dbb2)[_0xe952('0x2d')](_0x2ae471);}return null;};}function patchUpdates(_0x185478){return function(_0x59e75e){try{jsonpatch['apply'](_0x59e75e,_0x185478,!![]);}catch(_0x238d67){return BPromise[_0xe952('0x2e')](_0x238d67);}return _0x59e75e[_0xe952('0x2f')]();};}function saveUpdates(_0xbd7fb4,_0x53278){return function(_0x2489de){if(_0x2489de){return _0x2489de[_0xe952('0x30')](_0xbd7fb4)[_0xe952('0x31')](function(_0x5524d8){return _0x5524d8;});}return null;};}function removeEntity(_0x3848df,_0x4c37f3){return function(_0x2eb207){if(_0x2eb207){return _0x2eb207['destroy']()[_0xe952('0x31')](function(){_0x3848df[_0xe952('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb24758,_0x14196f){return function(_0x46d22e){if(!_0x46d22e){_0xb24758['sendStatus'](0x194);}return _0x46d22e;};}function handleError(_0x5b40d3,_0x513106){_0x513106=_0x513106||0x1f4;return function(_0x194be6){logger[_0xe952('0x23')](_0x194be6[_0xe952('0x32')]);if(_0x194be6[_0xe952('0x33')]){delete _0x194be6[_0xe952('0x33')];}_0x5b40d3[_0xe952('0x28')](_0x513106)['send'](_0x194be6);};}function getMustacheRender(_0x1d4068,_0x4ee12a){return Mustache['render'](_0x1d4068,_[_0xe952('0x34')](_0x4ee12a[_0xe952('0x35')],{'contact':_0x4ee12a[_0xe952('0x36')],'message':_0x4ee12a[_0xe952('0x24')],'agent':_0x4ee12a['agent'],'interaction':_0x4ee12a[_0xe952('0x37')],'account':_0x4ee12a[_0xe952('0x38')]}))||'';}function getInteractionUsers(_0x3e49f2,_0x559a54){return new BPromise(function(_0x3cc089,_0x538058){try{if(_0x559a54[_0x3e49f2['id']]){_0x3e49f2[_0xe952('0x39')]=_['map'](_0x559a54[_0x3e49f2['id']],function(_0x26f6dc){return{'id':_0x26f6dc['id'],'fullname':_0x26f6dc[_0xe952('0x3a')]};});}}catch(_0x52e016){_0x538058(_0x52e016);}_0x3cc089(_0x3e49f2);});}function getInteractionTags(_0x18c43b,_0x595cff){return new BPromise(function(_0x3c64d4,_0x58caf9){try{if(_0x18c43b['TagIds']){_0x18c43b[_0xe952('0x3b')]=[];_0x18c43b[_0xe952('0x3c')][_0xe952('0x3d')](',')[_0xe952('0x3e')](function(_0x58806a){_0x18c43b[_0xe952('0x3b')][_0xe952('0x3f')](_0x595cff[_0x58806a]);});}delete _0x18c43b['TagIds'];}catch(_0x535b8f){_0x58caf9(_0x535b8f);}_0x3c64d4(_0x18c43b);});}function updateChatInteraction(_0x2206b2,_0x330cf1,_0x170b0b){return new BPromise(function(_0x46c22a,_0x528250){return getInteractionUsers(_0x2206b2,_0x170b0b)[_0xe952('0x31')](function(_0x69e37e){return getInteractionTags(_0x69e37e,_0x330cf1);})[_0xe952('0x31')](function(_0x2d4931){_0x46c22a(_0x2d4931);})[_0xe952('0x26')](function(_0x2ae974){_0x528250(_0x2ae974);});});}exports['index']=function(_0x436709,_0x1731ee){var _0x3e221e={},_0x2f2929={},_0x1261ce={'count':0x0,'rows':[]};var _0x53e344=_[_0xe952('0x40')](db['ChatInteraction'][_0xe952('0x41')],function(_0x1926c2){return{'name':_0x1926c2[_0xe952('0x42')],'type':_0x1926c2['type'][_0xe952('0x43')]};});_0x2f2929[_0xe952('0x44')]=_[_0xe952('0x40')](_0x53e344,_0xe952('0x33'));_0x2f2929[_0xe952('0x45')]=_['keys'](_0x436709['query']);_0x2f2929['filters']=_['intersection'](_0x2f2929[_0xe952('0x44')],_0x2f2929['query']);_0x3e221e[_0xe952('0x46')]=_[_0xe952('0x47')](_0x2f2929[_0xe952('0x44')],qs['fields'](_0x436709[_0xe952('0x45')]['fields']));_0x3e221e[_0xe952('0x46')]=_0x3e221e[_0xe952('0x46')][_0xe952('0x48')]?_0x3e221e[_0xe952('0x46')]:_0x2f2929[_0xe952('0x44')];if(!_0x436709[_0xe952('0x45')][_0xe952('0x49')]('nolimit')){_0x3e221e[_0xe952('0x4a')]=qs[_0xe952('0x4a')](_0x436709[_0xe952('0x45')][_0xe952('0x4a')]);_0x3e221e[_0xe952('0x29')]=qs[_0xe952('0x29')](_0x436709[_0xe952('0x45')][_0xe952('0x29')]);}_0x3e221e[_0xe952('0x4b')]=qs['sort'](_0x436709['query'][_0xe952('0x4c')]);_0x3e221e['where']=qs[_0xe952('0x4d')](_[_0xe952('0x4e')](_0x436709[_0xe952('0x45')],_0x2f2929['filters']),_0x53e344);var _0x2e4b97=[];var _0x4995b1=squel['select']()[_0xe952('0x4f')]('id')[_0xe952('0x4f')]('name')['field'](_0xe952('0x50'))[_0xe952('0x51')](_0xe952('0x52'));var _0x5e373c=squel[_0xe952('0x53')]()[_0xe952('0x4f')](_0xe952('0x54'))[_0xe952('0x4f')](_0xe952('0x55'))[_0xe952('0x4f')](_0xe952('0x56'))[_0xe952('0x51')](_0xe952('0x57'),'ui')[_0xe952('0x58')]('users','u',_0xe952('0x59'));var _0x24bf61=squel[_0xe952('0x53')]()[_0xe952('0x51')](_0xe952('0x5a'),'i')['left_join']('cm_contacts','c',_0xe952('0x5b'))[_0xe952('0x58')]('users','o',_0xe952('0x5c'))['left_join']('chat_websites','a',_0xe952('0x5d'))['left_join'](_0xe952('0x5e'),'me',_0xe952('0x5f'))[_0xe952('0x58')](_0xe952('0x60'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xe952('0x58')](_0xe952('0x52'),'t','t.id\x20=\x20it.TagId');var _0x15f72a=squel[_0xe952('0x61')]();var _0x5686e3=[];var _0x1337f4=squel['expr']();var _0x3f11d6;if(_0x436709[_0xe952('0x45')][_0xe952('0x62')]){_0x3f11d6=as[_0xe952('0x63')](_0x436709[_0xe952('0x45')][_0xe952('0x62')]);var _0x20315f=_0x3f11d6[_0xe952('0x64')];for(var _0x276c2e=0x0;_0x276c2e<_0x3f11d6[_0xe952('0x65')][_0xe952('0x48')];_0x276c2e++){var _0x44bf29=_0x3f11d6[_0xe952('0x65')][_0x276c2e];var _0x37da0c='i';var _0x799601=_[_0xe952('0x66')](_0x53e344,[_0xe952('0x33'),_0x44bf29['field']]);if(!_0x799601){switch(_0x44bf29['field']){case _0xe952('0x67'):if(_0x44bf29['value']==0x1){_0x24bf61[_0xe952('0x68')]('`'+_0x44bf29[_0xe952('0x4f')]+_0xe952('0x69'));}else{_0x24bf61['having']('`'+_0x44bf29[_0xe952('0x4f')]+_0xe952('0x6a'));}break;case _0xe952('0x6b'):if(_0x44bf29[_0xe952('0x6c')]===_0xe952('0x6d')){if(_0x44bf29[_0xe952('0x6e')][_0xe952('0x3d')]('\x20')[_0xe952('0x48')]>0x1){_0x15f72a[_0x20315f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x44bf29[_0xe952('0x6e')]),null);}else{var _0x1c8a0e='%'+_0x44bf29[_0xe952('0x6e')]+'%';_0x15f72a[_0x20315f](_0xe952('0x6f'),_0x1c8a0e,_0x1c8a0e,_0x1c8a0e);}}else{_0x799601=_[_0xe952('0x66')](_0x53e344,[_0xe952('0x33'),_0xe952('0x70')]);_0x44bf29[_0xe952('0x4f')]=_0xe952('0x70');_0x50dc8e=as['buildExpression'](_0x37da0c,_0x799601[_0xe952('0x71')],_0x44bf29);_0x15f72a[_0x20315f](_0x50dc8e[_0xe952('0x72')],_0x50dc8e[_0xe952('0x6e')][_0xe952('0x73')],_0x50dc8e[_0xe952('0x6e')][_0xe952('0x74')]);}break;case _0xe952('0x75'):var _0x4d7667=_0x44bf29[_0xe952('0x6e')][_0xe952('0x3d')](',')[_0xe952('0x40')](function(_0x1b4cb9){return Number(_0x1b4cb9);});_0x4d7667[_0xe952('0x3e')](function(_0x422699){_0x1337f4['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x422699+',%');});_0x5686e3=_[_0xe952('0x76')](_0x5686e3,_0x4d7667);break;case _0xe952('0x77'):if(_0x44bf29['operator']==='$substring'){_0x15f72a[_0x20315f](_0xe952('0x78'),'%'+_0x44bf29[_0xe952('0x6e')]+'%',null);}else{_0x799601=_['find'](_0x53e344,[_0xe952('0x33'),'UserId']);_0x44bf29[_0xe952('0x4f')]=_0xe952('0x79');_0x50dc8e=as[_0xe952('0x7a')](_0x37da0c,_0x799601['type'],_0x44bf29);_0x15f72a[_0x20315f](_0x50dc8e[_0xe952('0x72')],_0x50dc8e[_0xe952('0x6e')][_0xe952('0x73')],_0x50dc8e[_0xe952('0x6e')][_0xe952('0x74')]);}break;case _0xe952('0x35'):_0x50dc8e=as[_0xe952('0x7a')]('me',null,_0x44bf29);_0x15f72a[_0x20315f](_0x50dc8e[_0xe952('0x72')],_0x50dc8e[_0xe952('0x6e')]['start'],_0x50dc8e[_0xe952('0x6e')]['end']);break;}}else{var _0x50dc8e=as['buildExpression'](_0x37da0c,_0x799601[_0xe952('0x71')],_0x44bf29);_0x15f72a[_0x20315f](_0x50dc8e[_0xe952('0x72')],_0x50dc8e[_0xe952('0x6e')][_0xe952('0x73')],_0x50dc8e[_0xe952('0x6e')][_0xe952('0x74')]);}}}else{var _0x2a3d21=_(_0x436709[_0xe952('0x45')])['keys']()['map'](function(_0x38856c){return _[_0xe952('0x7b')](_0x53e344,[_0xe952('0x33'),_0x38856c])?_0x38856c:undefined;})[_0xe952('0x7c')]()[_0xe952('0x6e')]();if(!_['isEmpty'](_0x2a3d21)){_0x2a3d21[_0xe952('0x3e')](function(_0x158d59){if(_0x158d59==='ChatWebsiteId'){_0x24bf61[_0xe952('0x7d')]('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x436709[_0xe952('0x45')][_0x158d59]));}else if(_0x158d59==='createdAt'){var _0x3f3f70=JSON[_0xe952('0x7e')](_0x436709[_0xe952('0x45')][_0x158d59])['$gte'];var _0x1038b5=JSON[_0xe952('0x7e')](_0x436709[_0xe952('0x45')][_0x158d59])[_0xe952('0x7f')];_0x24bf61[_0xe952('0x7d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3f3f70,_0x1038b5);}else{if(_0x436709[_0xe952('0x45')][_0x158d59]==='null'){_0x24bf61[_0xe952('0x7d')]('i.'+_0x158d59+_0xe952('0x80'));}else{_0x24bf61[_0xe952('0x7d')]('i.'+_0x158d59+_0xe952('0x81'),_0x436709['query'][_0x158d59]);}}});}if(_0x436709[_0xe952('0x45')]['read']){if(_0x436709[_0xe952('0x45')][_0xe952('0x82')]==0x1){_0x24bf61[_0xe952('0x68')](_0xe952('0x83'));}else{_0x24bf61[_0xe952('0x68')](_0xe952('0x84'));}}if(_0x436709[_0xe952('0x45')]['tag']){_0x5686e3=_[_0xe952('0x85')](_0x436709[_0xe952('0x45')][_0xe952('0x86')])?_0x436709[_0xe952('0x45')][_0xe952('0x86')]:new Array(_0x436709[_0xe952('0x45')][_0xe952('0x86')]);_0x5686e3[_0xe952('0x3e')](function(_0x5af734){_0x1337f4['or'](_0xe952('0x87'),'%,'+_0x5af734+',%');});}if(_0x436709[_0xe952('0x45')]['filter']){var _0x1d49c9=_0x436709[_0xe952('0x45')][_0xe952('0x88')][_0xe952('0x89')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1d49c9)){_0x15f72a['or'](_0xe952('0x8a'),_0x1d49c9+'%');}else{_0x15f72a['or'](_0xe952('0x8b'),qs['getFullTextValue'](_0x1d49c9))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1d49c9+'%');}}}_0x24bf61[_0xe952('0x7d')](_0x15f72a);_0x24bf61[_0xe952('0x8c')](_0xe952('0x8d'));var _0x527108={'type':db[_0xe952('0x8e')][_0xe952('0x8f')][_0xe952('0x90')],'raw':!![]};var _0x4ff2c8=_0x24bf61[_0xe952('0x91')]();_0x4ff2c8[_0xe952('0x4f')](_0xe952('0x8d'));_0x4ff2c8[_0xe952('0x4f')](_0xe952('0x92'),_0xe952('0x67'));if(_0x3e221e[_0xe952('0x4b')]){_0x3e221e[_0xe952('0x4b')][_0xe952('0x3e')](function(_0x107aae){var _0x4f1bc0=_0x107aae[0x0]===_0xe952('0x93')?_0x107aae[0x0]:'i.'+_0x107aae[0x0];_0x24bf61[_0xe952('0x4b')](_0x4f1bc0,_0x107aae[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe952('0x94')](_0x5686e3)){_0x24bf61[_0xe952('0x68')](_0x1337f4);_0x4ff2c8[_0xe952('0x7d')](_0xe952('0x95'),_0x5686e3);}BPromise[_0xe952('0x96')]()[_0xe952('0x31')](function(){if(!_0x3f11d6){if(_0x436709[_0xe952('0x45')][_0xe952('0x97')])return;_0x4ff2c8['where'](_0xe952('0x98'));_0x24bf61[_0xe952('0x7d')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x436709[_0xe952('0x99')]['role']!=='agent')return;return _0x436709[_0xe952('0x99')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xe952('0x31')](function(_0x50d6b9){if(_[_0xe952('0x94')](_0x50d6b9)){_0x4ff2c8[_0xe952('0x7d')](_0xe952('0x9a'));_0x24bf61[_0xe952('0x7d')](_0xe952('0x9a'));}else{_0x4ff2c8[_0xe952('0x7d')](_0xe952('0x9b'),_[_0xe952('0x40')](_0x50d6b9,'id'));_0x24bf61[_0xe952('0x7d')]('i.ChatWebsiteId\x20IN\x20?',_[_0xe952('0x40')](_0x50d6b9,'id'));}});})[_0xe952('0x31')](function(){if(_0x436709['user'][_0xe952('0x9c')]===_0xe952('0x9d')&&!_0x3f11d6&&!_0x436709['query'][_0xe952('0x97')])return[];return db[_0xe952('0x9e')][_0xe952('0x45')](_0x4ff2c8[_0xe952('0x9f')](),_0x527108);})[_0xe952('0x31')](function(_0x21f3e0){_0x1261ce['count']=_0x21f3e0['length'];if(_0x1261ce[_0xe952('0x2b')]===0x0)return[];return db[_0xe952('0x9e')]['query'](_0x4995b1['toString'](),_0x527108)[_0xe952('0x31')](function(_0x49aa9c){_0x2e4b97=_[_0xe952('0xa0')](_0x49aa9c,'id');_0x527108=_[_0xe952('0x34')](_0x527108,{'model':db[_0xe952('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x436709['query'][_0xe952('0xa2')]){_0x3e221e[_0xe952('0x46')][_0xe952('0x3e')](function(_0xa81565){_0x24bf61[_0xe952('0x4f')]('i.'+_0xa81565);});}else{_0x24bf61[_0xe952('0x4f')](_0xe952('0x92'),_0xe952('0x67'));_0x24bf61['field']('a.key','Account.key');_0x24bf61[_0xe952('0x4f')](_0xe952('0xa3'),'Account.mandatoryDisposition');_0x24bf61[_0xe952('0x4f')](_0xe952('0xa4'),_0xe952('0x93'));_0x24bf61[_0xe952('0x4f')](_0xe952('0xa5'));_0x24bf61[_0xe952('0x4f')](_0xe952('0xa6'),_0xe952('0xa7'));_0x24bf61[_0xe952('0x4f')]('c.lastName',_0xe952('0xa8'));_0x24bf61[_0xe952('0x4f')](_0xe952('0xa9'),'Contact.email');_0x24bf61[_0xe952('0x4f')](_0xe952('0xaa'),_0xe952('0xab'));_0x24bf61['field']('c.mobile',_0xe952('0xac'));_0x24bf61['field'](_0xe952('0xad'),_0xe952('0xae'));_0x24bf61[_0xe952('0x4f')]('o.fullname',_0xe952('0xaf'));_0x24bf61['field'](_0xe952('0xb0'),_0xe952('0xb1'));_0x24bf61[_0xe952('0x4f')](_0xe952('0xb2'),_0xe952('0x3c'));}if(_0x3e221e[_0xe952('0x4a')])_0x24bf61[_0xe952('0x4a')](_0x3e221e[_0xe952('0x4a')]);if(_0x3e221e[_0xe952('0x29')])_0x24bf61[_0xe952('0x29')](_0x3e221e[_0xe952('0x29')]);return db[_0xe952('0x9e')]['query'](_0x24bf61['toString'](),_0x527108);})[_0xe952('0x31')](function(_0x1d7b73){if(_0x1d7b73[_0xe952('0x48')]>0x0)_0x5e373c[_0xe952('0x7d')](_0xe952('0xb3'),_['map'](_0x1d7b73,'id'));return db[_0xe952('0x9e')]['query'](_0x5e373c[_0xe952('0x9f')](),_0x527108)['then'](function(_0x47e67f){var _0x2b0562=_[_0xe952('0xb4')](_0x47e67f,_0xe952('0xb5'));var _0x5d42ab=[];_0x1d7b73[_0xe952('0x3e')](function(_0x8f5af){_0x5d42ab[_0xe952('0x3f')](updateChatInteraction(_0x8f5af,_0x2e4b97,_0x2b0562));});return BPromise[_0xe952('0xb6')](_0x5d42ab);});});})[_0xe952('0x31')](function(_0x4c6319){_0x1261ce[_0xe952('0xb7')]=_0x4c6319;return _0x1261ce;})['then'](respondWithFilteredResult(_0x1731ee,_0x3e221e))[_0xe952('0x26')](handleError(_0x1731ee,null));};exports[_0xe952('0xb8')]=function(_0x1cb7fe,_0xd67062){var _0x589f7e={'raw':![],'where':{'id':_0x1cb7fe['params']['id']}},_0x3073b3={};_0x3073b3[_0xe952('0x44')]=_[_0xe952('0xb9')](db[_0xe952('0xa1')][_0xe952('0x41')]);_0x3073b3[_0xe952('0x45')]=_[_0xe952('0xb9')](_0x1cb7fe[_0xe952('0x45')]);_0x3073b3[_0xe952('0x4d')]=_[_0xe952('0x47')](_0x3073b3[_0xe952('0x44')],_0x3073b3['query']);_0x589f7e[_0xe952('0x46')]=_['intersection'](_0x3073b3[_0xe952('0x44')],qs[_0xe952('0xa2')](_0x1cb7fe['query']['fields']));_0x589f7e[_0xe952('0x46')]=_0x589f7e[_0xe952('0x46')][_0xe952('0x48')]?_0x589f7e[_0xe952('0x46')]:_0x3073b3[_0xe952('0x44')];if(_0x1cb7fe[_0xe952('0x45')][_0xe952('0xba')]){_0x589f7e['include']=[{'all':!![]}];}_0x589f7e=_[_0xe952('0x34')]({},_0x589f7e,_0x1cb7fe['options']);return db[_0xe952('0xa1')]['find'](_0x589f7e)['then'](handleEntityNotFound(_0xd67062,null))['then'](respondWithResult(_0xd67062,null))[_0xe952('0x26')](handleError(_0xd67062,null));};exports[_0xe952('0xbb')]=function(_0x577f58,_0x5e0bb1){return db[_0xe952('0xa1')][_0xe952('0xbb')](_0x577f58['body'],{})['then'](respondWithResult(_0x5e0bb1,0xc9))[_0xe952('0x26')](handleError(_0x5e0bb1,null));};exports['update']=function(_0x4c049c,_0x58991d){if(_0x4c049c['body']['id']){delete _0x4c049c[_0xe952('0x35')]['id'];}return db[_0xe952('0xa1')]['find']({'where':{'id':_0x4c049c[_0xe952('0xbc')]['id']}})[_0xe952('0x31')](handleEntityNotFound(_0x58991d,null))['then'](saveUpdates(_0x4c049c[_0xe952('0x35')],null))['then'](respondWithResult(_0x58991d,null))[_0xe952('0x26')](handleError(_0x58991d,null));};exports[_0xe952('0xbd')]=function(_0x19b939,_0x91f4dc){return db[_0xe952('0xa1')][_0xe952('0x66')]({'where':{'id':_0x19b939[_0xe952('0xbc')]['id']}})[_0xe952('0x31')](handleEntityNotFound(_0x91f4dc,null))[_0xe952('0x31')](removeEntity(_0x91f4dc,null))[_0xe952('0x26')](handleError(_0x91f4dc,null));};exports[_0xe952('0xbe')]=function(_0x3c2598,_0x351607){return db['ChatInteraction']['describe']()[_0xe952('0x31')](respondWithResult(_0x351607,null))['catch'](handleError(_0x351607,null));};exports[_0xe952('0xbf')]=function(_0x242add,_0x33fc9a){var _0x527ace=_0x242add['params']['id'];var _0x356a8b;var _0x4731a9;var _0xf0a6d;return db['ChatInteraction']['findOne']({'where':{'id':_0x527ace}})[_0xe952('0x31')](function(_0x54071d){_0x356a8b=_0x54071d;return db[_0xe952('0xc0')][_0xe952('0xc1')]({'where':{'id':_0x54071d[_0xe952('0x97')]},'attributes':['id',_0xe952('0xc2'),_0xe952('0xc3'),_0xe952('0xc4'),_0xe952('0xc5'),_0xe952('0xc6')],'raw':!![]});})[_0xe952('0x31')](function(_0x388ae6){if(_0x388ae6&&_0x388ae6['vidaooApiKey']&&_0x388ae6[_0xe952('0xc3')]){_0x4731a9=_0x388ae6;var _0x39eb73={'interaction':{'id':_0x527ace},'agent':{'id':_0x242add[_0xe952('0x99')]['id'],'name':_0x242add[_0xe952('0x99')]['name'],'fullname':_0x242add[_0xe952('0x99')]['fullname'],'email':_0x242add[_0xe952('0x99')][_0xe952('0xc7')]},'contact':_0x242add[_0xe952('0x35')]['contact'],'account':_0x242add[_0xe952('0x35')][_0xe952('0x38')]};var _0x550509={'rejectUnauthorized':![],'method':_0xe952('0xc8'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x388ae6[_0xe952('0xc2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x242add[_0xe952('0x99')][_0xe952('0xc7')]],'buttons':null,'topic':_0x4731a9[_0xe952('0xc4')],'note':_[_0xe952('0xc9')](_0x4731a9[_0xe952('0xc5')])?null:getMustacheRender(_0x4731a9[_0xe952('0xc5')],_0x39eb73),'metadata':null},'redirect':_0xe952('0xca'),'json':!![]};try{if(!_['isNull'](_0x4731a9[_0xe952('0xc6')])){var _0x151b4e=getMustacheRender(_0x4731a9[_0xe952('0xc6')],_0x39eb73);var _0xdf5f5=JSON[_0xe952('0x7e')](_0x151b4e);_0x550509['body'][_0xe952('0xcb')]=_0xdf5f5;}}catch(_0x214685){throw new db[(_0xe952('0x8e'))]['ValidationError'](_0xe952('0xcc'));}return rp(_0x550509);}else{throw new db[(_0xe952('0x8e'))][(_0xe952('0xcd'))](_0xe952('0xce'));}})['then'](function(_0x34cfae){_0xf0a6d=_0x34cfae;if(_0xf0a6d['id']){var _0x5b5d={'body':_0xf0a6d['join_url'],'ChatWebsiteId':_0x4731a9['id'],'ChatInteractionId':_0x356a8b['id'],'direction':'out','UserId':_0x242add[_0xe952('0x99')]['id']};return db[_0xe952('0xcf')][_0xe952('0xbb')](_0x5b5d,{});}else{throw new db[(_0xe952('0x8e'))]['ValidationError'](_0xe952('0xd0'));}})[_0xe952('0x31')](function(){return _0x356a8b[_0xe952('0xd1')]({'vidaooSessionId':_0xf0a6d['id']});})[_0xe952('0x31')](respondWithResult(_0x33fc9a,null))[_0xe952('0x26')](handleError(_0x33fc9a,null));};exports['customUpdate']=function(_0x4db4f2,_0x31376){if(_0x4db4f2[_0xe952('0x35')]['id']){delete _0x4db4f2[_0xe952('0x35')]['id'];}return db[_0xe952('0xa1')][_0xe952('0x66')]({'where':{'id':_0x4db4f2[_0xe952('0xbc')]['id']},'include':[{'model':db[_0xe952('0xd2')],'as':_0xe952('0x6b')}]})['then'](handleEntityNotFound(_0x31376,null))['then'](saveUpdates(_0x4db4f2[_0xe952('0x35')],null))[_0xe952('0x31')](respondWithResult(_0x31376,null))[_0xe952('0x26')](handleError(_0x31376,null));};exports[_0xe952('0xd3')]=function(_0x33ee81,_0x292cf2,_0x5ecdfb){if(_0x33ee81[_0xe952('0x35')]['id']){delete _0x33ee81[_0xe952('0x35')]['id'];}return db['ChatInteraction'][_0xe952('0x66')]({'where':{'id':_0x33ee81[_0xe952('0xbc')]['id']}})['then'](function(_0xe238ea){if(!_0xe238ea){logger[_0xe952('0x23')](_0xe952('0xd4'),_0xe952('0xd3'),0x194,'entity\x20not\x20found');_0x292cf2[_0xe952('0x27')](0x194);}else{if(_0xe238ea['UserId']){throw new db[(_0xe952('0x8e'))][(_0xe952('0xcd'))]('Interaction\x20already\x20assigned');}}return _0xe238ea;})[_0xe952('0x31')](function(_0x7d1c1f){if(_0x7d1c1f){return _0x7d1c1f[_0xe952('0x30')]({'closed':_0x33ee81[_0xe952('0x35')][_0xe952('0xd5')],'disposition':_0x33ee81['body'][_0xe952('0xd6')]})['then'](function(_0x2f5fcc){return _0x2f5fcc;});}})[_0xe952('0x31')](function(_0x477eb4){return respondWithRpcPromise(_0xe952('0xd7'),_0xe952('0xd3'),_0x33ee81[_0xe952('0x35')],client9004);})[_0xe952('0x31')](respondWithResult(_0x292cf2,null))[_0xe952('0x26')](handleError(_0x292cf2,null));};exports[_0xe952('0xd8')]=function(_0x453ac6,_0x4e41b6,_0x3577af){_0x453ac6[_0xe952('0x35')][_0xe952('0x33')]=_0x453ac6['file'][_0xe952('0xd9')];_0x453ac6['body']['basename']=_0x453ac6[_0xe952('0xda')][_0xe952('0xdb')];_0x453ac6[_0xe952('0x35')][_0xe952('0x71')]=_0x453ac6[_0xe952('0xda')][_0xe952('0xdc')];return db['Attachment']['create'](_0x453ac6[_0xe952('0x35')])[_0xe952('0x31')](respondWithResult(_0x4e41b6,0xc9))[_0xe952('0x26')](handleError(_0x4e41b6,null));};exports[_0xe952('0xdd')]=function(_0x538bbb,_0x55ebe0,_0x59f0a8){return db[_0xe952('0xa1')][_0xe952('0xc1')]({'where':{'id':_0x538bbb[_0xe952('0xbc')]['id']},'raw':!![]})[_0xe952('0x31')](handleEntityNotFound(_0x55ebe0,null))[_0xe952('0x31')](function(_0x413401){if(_0x413401){if(_0x413401['closed']){return _0x55ebe0[_0xe952('0x28')](0x193)[_0xe952('0x2d')]({'status':0x193,'message':'Unauthorized'});}return db[_0xe952('0xde')][_0xe952('0xc1')]({'where':{'id':_0x538bbb[_0xe952('0x45')][_0xe952('0xdf')]},'raw':!![]})[_0xe952('0x31')](handleEntityNotFound(_0x55ebe0,null));}})['then'](function(_0x38f97b){if(_0x38f97b){var _0x4e0420=_0x38f97b[_0xe952('0xe0')]!==null;var _0x4e8834=path[_0xe952('0xe1')](config[_0xe952('0xe2')],_0xe952('0xe3'));if(_0x4e0420){_0x4e8834=path['join'](_0x4e8834,_0xe952('0xe4'));}var _0x1ba274=path[_0xe952('0xe1')](_0x4e8834,_0x38f97b[_0xe952('0xe5')]);return _0x55ebe0['download'](_0x1ba274);}})[_0xe952('0x26')](handleError(_0x55ebe0,null));};exports[_0xe952('0xe6')]=function(_0xc69754,_0x4f9e0c){var _0x5679e8=null;var _0x54c537=null;var _0x597728=null;var _0xc65d5b=null;if(_0xc69754[_0xe952('0x35')]['id']){delete _0xc69754[_0xe952('0x35')]['id'];}if(_0xc69754[_0xe952('0x35')][_0xe952('0xe7')]){_0xc65d5b=path[_0xe952('0xe1')](config[_0xe952('0xe2')],_0xe952('0xe8'),util[_0xe952('0xe9')](_0xe952('0xea'),Date['now']()));_0xc69754['body'][_0xe952('0xeb')]=_0xc65d5b;}return db[_0xe952('0xa1')][_0xe952('0x66')]({'where':{'id':_0xc69754[_0xe952('0xbc')]['id']},'include':[{'model':db[_0xe952('0xcf')],'as':_0xe952('0xec'),'include':[{'model':db[_0xe952('0x77')],'as':'User'}]}]})[_0xe952('0x31')](handleEntityNotFound(_0x4f9e0c,null))[_0xe952('0x31')](saveUpdates(_0xc69754[_0xe952('0x35')],null))[_0xe952('0x31')](function(_0x3c0104){if(_0x3c0104){_0x5679e8=_0x3c0104;return db['ChatWebsite'][_0xe952('0x66')]({'where':{'id':_0x5679e8[_0xe952('0x97')]}});}})[_0xe952('0x31')](function(_0x57cfca){if(_0x57cfca){_0x597728=_0x57cfca;return db[_0xe952('0xd2')]['find']({'where':{'id':_0x5679e8['ContactId']}});}})['then'](function(_0x563356){if(_0x563356){_0x54c537=_0x563356;if(_0xc65d5b){var _0x5ad595=null;for(var _0x209c00=0x1;_0x209c00<_0x5679e8[_0xe952('0xec')]['length'];++_0x209c00){_0x5ad595=_0x5679e8[_0xe952('0xec')][_0x209c00];var _0xd5cac0=_0x5ad595['UserId']?util[_0xe952('0xe9')](_0xe952('0xed'),_0x597728[_0xe952('0xee')],_0x5ad595[_0xe952('0x79')]):'System';var _0x2482eb=_0xc69754[_0xe952('0x35')][_0xe952('0xef')]||util[_0xe952('0xe9')](_0xe952('0xed'),_0xe952('0xf0'),_0x5ad595[_0xe952('0x70')]);switch(_0x597728[_0xe952('0xf1')]){case'website_alias':_0xd5cac0=_0x5ad595[_0xe952('0x79')]?util[_0xe952('0xe9')](_0xe952('0xed'),_0x597728[_0xe952('0xee')],_0x5ad595[_0xe952('0x79')]):_0xe952('0xf2');break;case'agent_alias':_0xd5cac0=_0x5ad595[_0xe952('0x79')]?_0x5ad595[_0xe952('0x77')][_0xe952('0xf3')]||_0x5ad595[_0xe952('0x77')]['fullname']:_0xe952('0xf2');break;case _0xe952('0xf4'):_0xd5cac0=_0x5ad595[_0xe952('0x79')]?_0x5ad595[_0xe952('0x77')][_0xe952('0x3a')]:'System';break;default:_0xd5cac0=_0x5ad595['UserId']?util[_0xe952('0xe9')](_0xe952('0xed'),_0x597728[_0xe952('0xee')],_0x5ad595[_0xe952('0x79')]):'System';}var _0x52f695=util[_0xe952('0xe9')](_0xe952('0xf5'),moment(_0x5ad595['createdAt'])[_0xe952('0xe9')](_0xe952('0xf6')),_0x5ad595[_0xe952('0xf7')]==='in'?_0x2482eb:_0xd5cac0,_0x5ad595[_0xe952('0x35')]);if(!_0x5ad595[_0xe952('0xf8')]){fs[_0xe952('0xf9')](_0xc65d5b,_0x52f695);}}return db[_0xe952('0xfa')][_0xe952('0xc1')]({'where':{'service':!![]},'include':[{'model':db[_0xe952('0xfb')],'as':_0xe952('0xfc'),'raw':!![]}]});}}})[_0xe952('0x31')](function(_0x46c3c2){if(_0x46c3c2&&_0x46c3c2[_0xe952('0xfc')]&&_0xc69754[_0xe952('0x35')]){var _0x83d7ed={'tls':{'rejectUnauthorized':![]}};if(_0x46c3c2[_0xe952('0xfc')][_0xe952('0xfd')]){_0x83d7ed['service']=_0x46c3c2[_0xe952('0xfc')][_0xe952('0xfd')];}else{_0x83d7ed[_0xe952('0xfe')]=_0x46c3c2[_0xe952('0xfc')][_0xe952('0xfe')];_0x83d7ed[_0xe952('0xff')]=_0x46c3c2[_0xe952('0xfc')][_0xe952('0xff')];_0x83d7ed['secure']=_0x46c3c2['Smtp'][_0xe952('0x100')];}if(_0x46c3c2[_0xe952('0xfc')][_0xe952('0x101')]){_0x83d7ed[_0xe952('0x102')]={'user':_0x46c3c2[_0xe952('0xfc')][_0xe952('0x99')],'pass':_0x46c3c2[_0xe952('0xfc')][_0xe952('0x103')]};}return respondWithRpcPromise(_0xe952('0x104'),_0xe952('0x105'),{'account':_0x83d7ed,'message':{'from':util[_0xe952('0xe9')]('\x22%s\x22\x20<%s>',_0x46c3c2[_0xe952('0x33')],_0x46c3c2['email']||_0x46c3c2['Smtp']['user']),'to':_0xc69754[_0xe952('0x35')][_0xe952('0xe7')],'subject':_0xe952('0x106'),'text':util[_0xe952('0xe9')](_0xe952('0x107'),_0xc69754['body'][_0xe952('0xe7')]),'attachments':[{'path':_0xc65d5b}]}})[_0xe952('0x31')](function(){return _0x5679e8;})['catch'](function(_0x5498c5){console[_0xe952('0x23')](_0x5498c5);});}else{return _0x5679e8;}})['then'](respondWithStatusCode(_0x4f9e0c,0xc8))[_0xe952('0x26')](handleError(_0x4f9e0c,null));};exports[_0xe952('0x108')]=function(_0x314726,_0x4b34ee,_0x36d8d7){return db['ChatMessage'][_0xe952('0x66')]({'where':{'id':_0x314726['params']['id']}})[_0xe952('0x31')](handleEntityNotFound(_0x4b34ee,null))[_0xe952('0x31')](function(_0xc38d9b){if(_0xc38d9b){return _0xc38d9b[_0xe952('0x108')](_0x314726[_0xe952('0x35')][_0xe952('0x109')],_['omit'](_0x314726[_0xe952('0x35')],[_0xe952('0x109'),'id'])||{});}})[_0xe952('0x31')](respondWithResult(_0x4b34ee,null))[_0xe952('0x26')](handleError(_0x4b34ee,null));};exports[_0xe952('0x10a')]=function(_0x3a1697,_0x58eee4,_0x3bfc09){var _0x176b1e={'raw':![],'where':{}};var _0x3da12d={};var _0x397d3b={'count':0x0,'rows':[]};return db[_0xe952('0xa1')]['findOne']({'where':{'id':_0x3a1697['params']['id']}})[_0xe952('0x31')](handleEntityNotFound(_0x58eee4,null))[_0xe952('0x31')](function(_0x5681eb){if(_0x5681eb){_0x3da12d[_0xe952('0x44')]=_[_0xe952('0xb9')](db[_0xe952('0xcf')]['rawAttributes']);_0x3da12d[_0xe952('0x45')]=_[_0xe952('0xb9')](_0x3a1697[_0xe952('0x45')]);_0x3da12d[_0xe952('0x4d')]=_[_0xe952('0x47')](_0x3da12d[_0xe952('0x44')],_0x3da12d[_0xe952('0x45')]);_0x176b1e['attributes']=_['intersection'](_0x3da12d['model'],qs[_0xe952('0xa2')](_0x3a1697[_0xe952('0x45')]['fields']));_0x176b1e[_0xe952('0x46')]=_0x176b1e['attributes'][_0xe952('0x48')]?_0x176b1e[_0xe952('0x46')]:_0x3da12d[_0xe952('0x44')];if(!_0x3a1697['query'][_0xe952('0x49')](_0xe952('0x10b'))){_0x176b1e[_0xe952('0x4a')]=qs[_0xe952('0x4a')](_0x3a1697[_0xe952('0x45')][_0xe952('0x4a')]);_0x176b1e['offset']=qs[_0xe952('0x29')](_0x3a1697[_0xe952('0x45')][_0xe952('0x29')]);}_0x176b1e[_0xe952('0x4b')]=qs[_0xe952('0x4c')](_0x3a1697[_0xe952('0x45')][_0xe952('0x4c')]);_0x176b1e['where']=qs[_0xe952('0x4d')](_[_0xe952('0x4e')](_0x3a1697[_0xe952('0x45')],_0x3da12d[_0xe952('0x4d')]));_0x176b1e[_0xe952('0x7d')][_0xe952('0xb5')]=_0x5681eb['id'];if(_0x3a1697[_0xe952('0x45')][_0xe952('0x88')]){_0x176b1e[_0xe952('0x7d')]=_[_0xe952('0x34')](_0x176b1e[_0xe952('0x7d')],{'$or':_['map'](_0x176b1e[_0xe952('0x46')],function(_0x42082c){var _0x4e67ee={};_0x4e67ee[_0x42082c]={'$like':'%'+_0x3a1697['query']['filter']+'%'};return _0x4e67ee;})});}if(_0x3a1697['query'][_0xe952('0x10c')]){var _0x47cd6e=_0x3a1697[_0xe952('0x45')][_0xe952('0x10c')][_0xe952('0x3d')](',');var _0x4753d8={};_0x4753d8[_0x47cd6e[0x0]]={'$gte':moment(_0x47cd6e[0x1])['format'](_0xe952('0x10d'))};_0x176b1e[_0xe952('0x7d')]=_[_0xe952('0x34')](_0x176b1e[_0xe952('0x7d')],_0x4753d8);}_0x176b1e=_[_0xe952('0x34')]({},_0x176b1e,_0x3a1697[_0xe952('0x10e')]);return db['ChatMessage'][_0xe952('0x2b')]({'where':_0x176b1e[_0xe952('0x7d')]})['then'](function(_0x11fdc9){_0x397d3b[_0xe952('0x2b')]=_0x11fdc9;if(_0x3a1697[_0xe952('0x45')][_0xe952('0xba')]){_0x176b1e[_0xe952('0x10f')]=[{'all':!![]}];}return db['ChatMessage'][_0xe952('0x110')](_0x176b1e);})[_0xe952('0x31')](function(_0x8da6bf){_0x397d3b[_0xe952('0xb7')]=_0x8da6bf;return _0x397d3b;});}})[_0xe952('0x31')](respondWithFilteredResult(_0x58eee4,_0x176b1e))[_0xe952('0x26')](handleError(_0x58eee4,null));};exports[_0xe952('0x111')]=function(_0x4baf3d,_0x51b52,_0x462bab){var _0x1ca6bc={'where':{}},_0x1f9582={},_0x5888cf={'count':0x0,'rows':[]};return db[_0xe952('0xa1')][_0xe952('0xc1')]({'where':{'id':_0x4baf3d[_0xe952('0xbc')]['id']}})[_0xe952('0x31')](handleEntityNotFound(_0x51b52,null))[_0xe952('0x31')](function(_0x1894c7){if(_0x1894c7){_0x1f9582['model']=_[_0xe952('0xb9')](db[_0xe952('0xcf')][_0xe952('0x41')]);_0x1f9582[_0xe952('0x45')]=_[_0xe952('0xb9')](_0x4baf3d['query']);_0x1f9582[_0xe952('0x4d')]=_[_0xe952('0x47')](_0x1f9582[_0xe952('0x44')],_0x1f9582[_0xe952('0x45')]);_0x1ca6bc['attributes']=_['intersection'](_0x1f9582[_0xe952('0x44')],qs[_0xe952('0xa2')](_0x4baf3d[_0xe952('0x45')][_0xe952('0xa2')]));_0x1ca6bc[_0xe952('0x46')]=_0x1ca6bc['attributes']['length']?_0x1ca6bc['attributes']:_0x1f9582[_0xe952('0x44')];if(!_0x4baf3d['query'][_0xe952('0x49')](_0xe952('0x10b'))){_0x1ca6bc[_0xe952('0x4a')]=qs['limit'](_0x4baf3d['query'][_0xe952('0x4a')]);_0x1ca6bc[_0xe952('0x29')]=qs[_0xe952('0x29')](_0x4baf3d[_0xe952('0x45')][_0xe952('0x29')]);}_0x1ca6bc['order']=qs[_0xe952('0x4c')](_0x4baf3d[_0xe952('0x45')][_0xe952('0x4c')]);_0x1ca6bc[_0xe952('0x7d')]=qs['filters'](_[_0xe952('0x4e')](_0x4baf3d['query'],_0x1f9582[_0xe952('0x4d')]));_0x1ca6bc[_0xe952('0x7d')][_0xe952('0xb5')]=_0x1894c7['id'];if(_0x4baf3d[_0xe952('0x45')][_0xe952('0x88')]){_0x1ca6bc[_0xe952('0x7d')]=_['merge'](_0x1ca6bc[_0xe952('0x7d')],{'$or':_[_0xe952('0x40')](_0x1ca6bc[_0xe952('0x46')],function(_0x968aa5){var _0x34748b={};_0x34748b[_0x968aa5]={'$like':'%'+_0x4baf3d[_0xe952('0x45')]['filter']+'%'};return _0x34748b;})});}_0x1ca6bc[_0xe952('0x7d')][_0xe952('0xf8')]=![];if(_0x4baf3d[_0xe952('0x45')]['id']){_0x1ca6bc[_0xe952('0x7d')]['id']={'$gt':_0x4baf3d[_0xe952('0x45')]['id']};}_0x1ca6bc=_[_0xe952('0x34')]({},_0x1ca6bc,_0x4baf3d['options']);return db[_0xe952('0xcf')][_0xe952('0x2b')]({'where':_0x1ca6bc['where']})[_0xe952('0x31')](function(_0x625fa2){_0x5888cf[_0xe952('0x2b')]=_0x625fa2;_0x1ca6bc[_0xe952('0x10f')]=[];if(_0x4baf3d[_0xe952('0x45')]['includeAgent']){_0x1ca6bc[_0xe952('0x10f')]['push']({'model':db['User'],'as':_0xe952('0x77'),'attributes':['id',_0xe952('0x3a'),_0xe952('0xf3')]});}if(_0x4baf3d[_0xe952('0x45')][_0xe952('0xba')]){_0x1ca6bc[_0xe952('0x10f')]=[{'all':!![]}];}return db[_0xe952('0xcf')][_0xe952('0x110')](_0x1ca6bc);})['then'](function(_0x4abb56){_0x5888cf['rows']=_0x4abb56;return _0x5888cf;});}})[_0xe952('0x31')](respondWithFilteredResult(_0x51b52,_0x1ca6bc))[_0xe952('0x26')](handleError(_0x51b52,null));};exports[_0xe952('0x112')]=function(_0x26674f,_0x13cd7e,_0x468b18){return db[_0xe952('0xa1')][_0xe952('0x66')]({'where':{'id':_0x26674f[_0xe952('0xbc')]['id']}})['then'](handleEntityNotFound(_0x13cd7e,null))[_0xe952('0x31')](function(_0x18dae8){if(_0x18dae8){return _0x18dae8['setTags'](_0x26674f[_0xe952('0x35')][_0xe952('0x109')],_[_0xe952('0x113')](_0x26674f[_0xe952('0x35')],[_0xe952('0x109'),'id'])||{})['spread'](function(){return db[_0xe952('0x75')][_0xe952('0x110')]({'attributes':['id','name',_0xe952('0x50')],'where':{'id':_0x26674f[_0xe952('0x35')][_0xe952('0x109')]}});})[_0xe952('0x31')](function(_0x4a8866){socket[_0xe952('0x114')](_0xe952('0x115'),{'id':Number(_0x26674f[_0xe952('0xbc')]['id']),'tags':_0x4a8866||[]});return{'id':Number(_0x26674f[_0xe952('0xbc')]['id']),'tags':_0x4a8866||[]};});}})['then'](respondWithResult(_0x13cd7e,null))[_0xe952('0x26')](handleError(_0x13cd7e,null));};exports['removeTags']=function(_0x564e99,_0x29e3fd,_0x4132bf){return db[_0xe952('0xa1')][_0xe952('0x66')]({'where':{'id':_0x564e99[_0xe952('0xbc')]['id']}})[_0xe952('0x31')](handleEntityNotFound(_0x29e3fd,null))[_0xe952('0x31')](function(_0x52474b){if(_0x52474b){return _0x52474b[_0xe952('0x116')](_0x564e99[_0xe952('0x45')][_0xe952('0x109')]);}})['then'](respondWithStatusCode(_0x29e3fd,null))[_0xe952('0x26')](handleError(_0x29e3fd,null));};exports['download']=function(_0x198063,_0x5b183a){var _0x3f5f19=moment()[_0xe952('0x117')]()['toString']();var _0x38a8a8=path[_0xe952('0xe1')](config[_0xe952('0xe2')],_0xe952('0x118'),'files',_0xe952('0x119'));var _0x4bbe60=path['join'](config[_0xe952('0xe2')],_0xe952('0x118'),_0xe952('0x11a'),_0xe952('0x11b'));var _0x41cde3=path[_0xe952('0xe1')](_0x38a8a8,_0x3f5f19);var _0x1f3a6f=util[_0xe952('0xe9')]('transcript-%d-%s.zip',_0x198063['params']['id'],_0x3f5f19);var _0x116a25=path[_0xe952('0xe1')](_0x38a8a8,_0x1f3a6f);var _0x4aa7c5=[];_0x4aa7c5[_0xe952('0x3f')]({'model':db[_0xe952('0x77')],'as':_0xe952('0x77'),'attributes':['id',_0xe952('0x3a')],'raw':!![]});_0x4aa7c5[_0xe952('0x3f')]({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName',_0xe952('0x11c')],'raw':!![]});if(_0x198063[_0xe952('0x45')][_0xe952('0x11b')]){_0x4aa7c5[_0xe952('0x3f')]({'model':db['Attachment'],'as':_0xe952('0xde'),'raw':!![]});}var _0x4b4e41=[{'model':db[_0xe952('0xcf')],'as':_0xe952('0xec'),'attributes':['id',_0xe952('0x35'),'createdAt',_0xe952('0xf7'),_0xe952('0xf8'),_0xe952('0x82')],'include':_0x4aa7c5}];_0x4b4e41[_0xe952('0x3f')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0xe952('0x33')]});_0x4b4e41[_0xe952('0x3f')]({'model':db[_0xe952('0x77')],'as':_0xe952('0x11d'),'attributes':['id',_0xe952('0x3a')]});return db[_0xe952('0xa1')]['find']({'where':{'id':_0x198063['params']['id']},'include':_0x4b4e41})[_0xe952('0x31')](handleEntityNotFound(_0x5b183a,null))['then'](function(_0x5ceb6a){if(_0x5ceb6a){var _0x30200f=_0x5ceb6a[_0xe952('0x11e')]({'plain':!![]});fs[_0xe952('0x11f')](_0x41cde3);var _0x521ef0={'channel':'Chat','account':_0x30200f[_0xe952('0x120')][_0xe952('0x33')],'agent':_0x30200f[_0xe952('0x11d')]?_0x30200f['Owner'][_0xe952('0x3a')]:'N.A.','createdAt':moment(_0x30200f[_0xe952('0x121')])[_0xe952('0xe9')](_0xe952('0x10d'))[_0xe952('0x9f')](),'closedAt':_0x30200f[_0xe952('0xd5')]?moment(_0x30200f[_0xe952('0x122')])[_0xe952('0xe9')](_0xe952('0x10d'))[_0xe952('0x9f')]():'','disposition':_0x30200f[_0xe952('0xd6')],'chatInfo':{'browser':_0x30200f[_0xe952('0x123')],'os':_0x30200f[_0xe952('0x124')],'referer':_0x30200f['referer'],'customerIp':_0x30200f['customerIp'],'customerPort':_0x30200f['customerPort']?_0x30200f[_0xe952('0x125')]:_0xe952('0x126')},'messages':_(_0x30200f[_0xe952('0xec')])['tail']()['filter']({'secret':![]})[_0xe952('0x40')](function(_0xe9071){if(_0xe9071[_0xe952('0xde')]){var _0x5e73b1=path['join'](_0x4bbe60,_0xe9071[_0xe952('0xde')]['basename']);if(fs[_0xe952('0x127')](_0x5e73b1)){fs[_0xe952('0x128')](_0x5e73b1)[_0xe952('0x129')](fs[_0xe952('0x12a')](path[_0xe952('0xe1')](_0x41cde3,_0xe9071[_0xe952('0xde')][_0xe952('0xe5')])));}}return{'date':moment(_0xe9071[_0xe952('0x121')])[_0xe952('0xe9')](_0xe952('0x10d'))[_0xe952('0x9f')](),'sender':_0xe9071[_0xe952('0xf7')]==='out'?_0xe9071[_0xe952('0x77')]?_0xe9071[_0xe952('0x77')][_0xe952('0x3a')]:_0xe952('0xf2'):_0xe9071[_0xe952('0x6b')][_0xe952('0x12b')]+(_0xe9071['Contact']['lastName']?'\x20'+_0xe9071[_0xe952('0x6b')][_0xe952('0x11c')]:''),'body':_0xe9071[_0xe952('0xde')]?_0xe9071[_0xe952('0xde')][_0xe952('0xe5')]:_0xe9071[_0xe952('0x35')],'direction':_0xe9071['direction']==='out'?'A':'C','secret':_0xe9071[_0xe952('0xf8')],'read':_0xe9071[_0xe952('0x82')],'attachment':_0xe9071[_0xe952('0xde')]};})['value']()};return ejs[_0xe952('0x12c')](path['join'](config[_0xe952('0xe2')],_0xe952('0x118'),'views',_0xe952('0x12d')),{'interaction':_0x521ef0})[_0xe952('0x31')](function(_0x25d6a1){var _0x177ce8=path[_0xe952('0xe1')](_0x41cde3,'transcript-'+_0x30200f['id']+'-'+_0x3f5f19+_0xe952('0x12e'));var _0x58fa9f={'path':_0x177ce8,'channel':_0xe952('0x12f'),'interactionId':_0x30200f['id']};return pdf[_0xe952('0x130')](_0x25d6a1,_0x58fa9f);})[_0xe952('0x31')](function(){return new BPromise(function(_0xdb833,_0x9ecbd8){zipdir(_0x41cde3,{'saveTo':_0x116a25},function(_0x308e98,_0xa47f0c){if(_0x308e98)return _0x9ecbd8(_0x308e98);return _0xdb833(_0xa47f0c);});})[_0xe952('0x31')](function(){return new BPromise(function(_0x47e43b,_0x3cec20){rimraf(_0x41cde3,function(_0x46d916){if(_0x46d916)_0x3cec20(_0x46d916);return _0x47e43b();});});})[_0xe952('0x31')](function(){return _0x5b183a['download'](_0x116a25,_0x1f3a6f,function(_0x8feb46){if(_0x8feb46){console[_0xe952('0x131')]('err',_0x8feb46);}else{fs['unlinkSync'](_0x116a25);}});});});}else{return _0x5b183a['sendStatus'](0xc8);}})['catch'](handleError(_0x5b183a,null));}; \ No newline at end of file +var _0xbc53=['alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','secret','includeAgent','includeAll','findAll','setTags','omit','chatInteractionTags:save','removeTags','unix','server','files','transcript-%d-%s.zip','firstName','lastName','attachments','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.html','.pdf','createPdfFromHTML','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','set','apply','reject','save','update','sendStatus','stack','name','merge','body','contact','agent','interaction','account','map','Tags','TagIds','split','forEach','push','index','ChatInteraction','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','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','parseSearch','sqlOperator','conditions','find','unreadMessages','value','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)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','some','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','$gte','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','count','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.email','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ChatInteractionId','all','rows','params','rawAttributes','include','options','create','destroy','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','ChatWebsite','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias'];(function(_0x2c9e03,_0x3f8cc1){var _0x36c756=function(_0x53116a){while(--_0x53116a){_0x2c9e03['push'](_0x2c9e03['shift']());}};_0x36c756(++_0x3f8cc1);}(_0xbc53,0x180));var _0x3bc5=function(_0x52dcbc,_0x19e173){_0x52dcbc=_0x52dcbc-0x0;var _0x39b16a=_0xbc53[_0x52dcbc];return _0x39b16a;};'use strict';var emlformat=require(_0x3bc5('0x0'));var rimraf=require(_0x3bc5('0x1'));var zipdir=require(_0x3bc5('0x2'));var jsonpatch=require(_0x3bc5('0x3'));var rp=require(_0x3bc5('0x4'));var moment=require(_0x3bc5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3bc5('0x6'));var util=require(_0x3bc5('0x7'));var path=require(_0x3bc5('0x8'));var sox=require(_0x3bc5('0x9'));var csv=require(_0x3bc5('0xa'));var ejs=require(_0x3bc5('0xb'));var fs=require('fs');var fs_extra=require(_0x3bc5('0xc'));var _=require(_0x3bc5('0xd'));var squel=require(_0x3bc5('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3bc5('0xf'));var Papa=require(_0x3bc5('0x10'));var Redis=require(_0x3bc5('0x11'));var authService=require(_0x3bc5('0x12'));var qs=require(_0x3bc5('0x13'));var as=require(_0x3bc5('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x3bc5('0x15'));var logger=require(_0x3bc5('0x16'))(_0x3bc5('0x17'));var utils=require(_0x3bc5('0x18'));var config=require(_0x3bc5('0x19'));var licenseUtil=require(_0x3bc5('0x1a'));var db=require('../../mysqldb')['db'];config[_0x3bc5('0x1b')]=_[_0x3bc5('0x1c')](config[_0x3bc5('0x1b')],{'host':_0x3bc5('0x1d'),'port':0x18eb});var socket=require(_0x3bc5('0x1e'))(new Redis(config['redis']));require(_0x3bc5('0x1f'))[_0x3bc5('0x20')](socket);var jayson=require(_0x3bc5('0x21'));var client=jayson[_0x3bc5('0x22')][_0x3bc5('0x23')]({'port':0x232b});var client9004=jayson[_0x3bc5('0x22')][_0x3bc5('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x4110e5,_0x59ac99,_0x26b648,_0x1cf18){return new BPromise(function(_0x11dff1,_0x266875){var _0x346e1a=_0x1cf18||client;return _0x346e1a[_0x3bc5('0x24')](_0x4110e5,_0x26b648)[_0x3bc5('0x25')](function(_0x3c9c1e){logger[_0x3bc5('0x26')](_0x3bc5('0x27'),_0x59ac99,_0x3bc5('0x28'));logger[_0x3bc5('0x29')](_0x3bc5('0x2a'),_0x59ac99,'request\x20sent',JSON[_0x3bc5('0x2b')](_0x3c9c1e));if(_0x3c9c1e['error']){if(_0x3c9c1e[_0x3bc5('0x2c')][_0x3bc5('0x2d')]===0x1f4){logger[_0x3bc5('0x2c')](_0x3bc5('0x27'),_0x59ac99,_0x3c9c1e[_0x3bc5('0x2c')][_0x3bc5('0x2e')]);return _0x266875(_0x3c9c1e['error']['message']);}logger['error'](_0x3bc5('0x27'),_0x59ac99,_0x3c9c1e['error'][_0x3bc5('0x2e')]);return _0x11dff1(_0x3c9c1e[_0x3bc5('0x2c')][_0x3bc5('0x2e')]);}else{logger[_0x3bc5('0x26')](_0x3bc5('0x27'),_0x59ac99,'request\x20sent');_0x11dff1(_0x3c9c1e[_0x3bc5('0x2f')][_0x3bc5('0x2e')]);}})[_0x3bc5('0x30')](function(_0x1627f7){logger['error'](_0x3bc5('0x27'),_0x59ac99,_0x1627f7);_0x266875(_0x1627f7);});});}function respondWithStatusCode(_0x441866,_0x30f611){_0x30f611=_0x30f611||0xcc;return function(_0x3bbcd6){if(_0x3bbcd6){return _0x441866['sendStatus'](_0x30f611);}return _0x441866[_0x3bc5('0x31')](_0x30f611)[_0x3bc5('0x32')]();};}function respondWithResult(_0x5e0b64,_0x191822){_0x191822=_0x191822||0xc8;return function(_0x2c5307){if(_0x2c5307){return _0x5e0b64[_0x3bc5('0x31')](_0x191822)[_0x3bc5('0x33')](_0x2c5307);}};}function respondWithFilteredResult(_0x1cf02a,_0x5b6590){return function(_0x209479){if(_0x209479){var _0x429681=typeof _0x5b6590[_0x3bc5('0x34')]===_0x3bc5('0x35')&&typeof _0x5b6590[_0x3bc5('0x36')]===_0x3bc5('0x35');var _0x9a2c9c=_0x209479['count'];var _0x24b7f8=_0x429681?0x0:_0x5b6590[_0x3bc5('0x34')];var _0x1ef2e9=_0x429681?_0x209479['count']:_0x5b6590[_0x3bc5('0x34')]+_0x5b6590['limit'];var _0x12a896;if(_0x1ef2e9>=_0x9a2c9c){_0x1ef2e9=_0x9a2c9c;_0x12a896=0xc8;}else{_0x12a896=0xce;}_0x1cf02a[_0x3bc5('0x31')](_0x12a896);return _0x1cf02a[_0x3bc5('0x37')]('Content-Range',_0x24b7f8+'-'+_0x1ef2e9+'/'+_0x9a2c9c)[_0x3bc5('0x33')](_0x209479);}return null;};}function patchUpdates(_0x154eb8){return function(_0x101476){try{jsonpatch[_0x3bc5('0x38')](_0x101476,_0x154eb8,!![]);}catch(_0x20ca4e){return BPromise[_0x3bc5('0x39')](_0x20ca4e);}return _0x101476[_0x3bc5('0x3a')]();};}function saveUpdates(_0x3abf8e,_0x1f3356){return function(_0x4576a5){if(_0x4576a5){return _0x4576a5[_0x3bc5('0x3b')](_0x3abf8e)['then'](function(_0x566db7){return _0x566db7;});}return null;};}function removeEntity(_0x2168ca,_0x29f8fe){return function(_0x39df21){if(_0x39df21){return _0x39df21['destroy']()['then'](function(){_0x2168ca[_0x3bc5('0x31')](0xcc)[_0x3bc5('0x32')]();});}};}function handleEntityNotFound(_0x33aaef,_0x2ac9c8){return function(_0x206eb2){if(!_0x206eb2){_0x33aaef[_0x3bc5('0x3c')](0x194);}return _0x206eb2;};}function handleError(_0x13a56f,_0xf0f0d4){_0xf0f0d4=_0xf0f0d4||0x1f4;return function(_0x2d5eed){logger['error'](_0x2d5eed[_0x3bc5('0x3d')]);if(_0x2d5eed['name']){delete _0x2d5eed[_0x3bc5('0x3e')];}_0x13a56f['status'](_0xf0f0d4)['send'](_0x2d5eed);};}function getMustacheRender(_0x2278b3,_0x49800d){return Mustache['render'](_0x2278b3,_[_0x3bc5('0x3f')](_0x49800d[_0x3bc5('0x40')],{'contact':_0x49800d[_0x3bc5('0x41')],'message':_0x49800d['message'],'agent':_0x49800d[_0x3bc5('0x42')],'interaction':_0x49800d[_0x3bc5('0x43')],'account':_0x49800d[_0x3bc5('0x44')]}))||'';}function getInteractionUsers(_0x148cd8,_0x1f38aa){return new BPromise(function(_0x2f8b5a,_0x3ac30c){try{if(_0x1f38aa[_0x148cd8['id']]){_0x148cd8['Users']=_[_0x3bc5('0x45')](_0x1f38aa[_0x148cd8['id']],function(_0x686b0f){return{'id':_0x686b0f['id'],'fullname':_0x686b0f['fullname']};});}}catch(_0x159c3f){_0x3ac30c(_0x159c3f);}_0x2f8b5a(_0x148cd8);});}function getInteractionTags(_0x2f967c,_0x4b6ad3){return new BPromise(function(_0x1ce7bc,_0x4932c8){try{if(_0x2f967c['TagIds']){_0x2f967c[_0x3bc5('0x46')]=[];_0x2f967c[_0x3bc5('0x47')][_0x3bc5('0x48')](',')[_0x3bc5('0x49')](function(_0x261919){_0x2f967c[_0x3bc5('0x46')][_0x3bc5('0x4a')](_0x4b6ad3[_0x261919]);});}delete _0x2f967c[_0x3bc5('0x47')];}catch(_0x5457a4){_0x4932c8(_0x5457a4);}_0x1ce7bc(_0x2f967c);});}function updateChatInteraction(_0x16e8a0,_0x28432c,_0xa955e){return new BPromise(function(_0xe84986,_0x489af3){return getInteractionUsers(_0x16e8a0,_0xa955e)[_0x3bc5('0x25')](function(_0x4bc361){return getInteractionTags(_0x4bc361,_0x28432c);})[_0x3bc5('0x25')](function(_0x2c090b){_0xe84986(_0x2c090b);})['catch'](function(_0x351c71){_0x489af3(_0x351c71);});});}exports[_0x3bc5('0x4b')]=function(_0x5e8be3,_0x43f4a4){var _0x521e93={},_0x38ad75={},_0xec2117={'count':0x0,'rows':[]};var _0x5e69d0=_['map'](db[_0x3bc5('0x4c')]['rawAttributes'],function(_0x48834b){return{'name':_0x48834b[_0x3bc5('0x4d')],'type':_0x48834b[_0x3bc5('0x4e')]['key']};});_0x38ad75['model']=_['map'](_0x5e69d0,'name');_0x38ad75[_0x3bc5('0x4f')]=_[_0x3bc5('0x50')](_0x5e8be3[_0x3bc5('0x4f')]);_0x38ad75[_0x3bc5('0x51')]=_[_0x3bc5('0x52')](_0x38ad75[_0x3bc5('0x53')],_0x38ad75['query']);_0x521e93[_0x3bc5('0x54')]=_[_0x3bc5('0x52')](_0x38ad75[_0x3bc5('0x53')],qs[_0x3bc5('0x55')](_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x55')]));_0x521e93[_0x3bc5('0x54')]=_0x521e93[_0x3bc5('0x54')][_0x3bc5('0x56')]?_0x521e93[_0x3bc5('0x54')]:_0x38ad75['model'];if(!_0x5e8be3[_0x3bc5('0x4f')]['hasOwnProperty'](_0x3bc5('0x57'))){_0x521e93['limit']=qs[_0x3bc5('0x36')](_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x36')]);_0x521e93[_0x3bc5('0x34')]=qs['offset'](_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x34')]);}_0x521e93[_0x3bc5('0x58')]=qs['sort'](_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x59')]);_0x521e93['where']=qs[_0x3bc5('0x51')](_[_0x3bc5('0x5a')](_0x5e8be3[_0x3bc5('0x4f')],_0x38ad75['filters']),_0x5e69d0);var _0x677036=[];var _0x4184d7=squel[_0x3bc5('0x5b')]()[_0x3bc5('0x5c')]('id')[_0x3bc5('0x5c')](_0x3bc5('0x3e'))['field'](_0x3bc5('0x5d'))[_0x3bc5('0x5e')]('tools_tags');var _0x54d46b=squel[_0x3bc5('0x5b')]()[_0x3bc5('0x5c')](_0x3bc5('0x5f'))[_0x3bc5('0x5c')](_0x3bc5('0x60'))[_0x3bc5('0x5c')](_0x3bc5('0x61'))[_0x3bc5('0x5e')](_0x3bc5('0x62'),'ui')[_0x3bc5('0x63')](_0x3bc5('0x64'),'u',_0x3bc5('0x65'));var _0xdba4ca=squel['select']()[_0x3bc5('0x5e')](_0x3bc5('0x66'),'i')[_0x3bc5('0x63')](_0x3bc5('0x67'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3bc5('0x63')]('users','o',_0x3bc5('0x68'))[_0x3bc5('0x63')](_0x3bc5('0x69'),'a',_0x3bc5('0x6a'))[_0x3bc5('0x63')](_0x3bc5('0x6b'),'me',_0x3bc5('0x6c'))[_0x3bc5('0x63')](_0x3bc5('0x6d'),'it',_0x3bc5('0x6e'))[_0x3bc5('0x63')](_0x3bc5('0x6f'),'t',_0x3bc5('0x70'));var _0x4c9946=squel[_0x3bc5('0x71')]();var _0x50a42c=[];var _0x1ac212=squel[_0x3bc5('0x71')]();var _0x3001c2;if(_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x72')]){_0x3001c2=as[_0x3bc5('0x73')](_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x72')]);var _0x2b5b21=_0x3001c2[_0x3bc5('0x74')];for(var _0x33bb80=0x0;_0x33bb80<_0x3001c2[_0x3bc5('0x75')]['length'];_0x33bb80++){var _0x3dd7cf=_0x3001c2['conditions'][_0x33bb80];var _0x583cfb='i';var _0x4cfcba=_[_0x3bc5('0x76')](_0x5e69d0,[_0x3bc5('0x3e'),_0x3dd7cf[_0x3bc5('0x5c')]]);if(!_0x4cfcba){switch(_0x3dd7cf[_0x3bc5('0x5c')]){case _0x3bc5('0x77'):if(_0x3dd7cf[_0x3bc5('0x78')]==0x1){_0xdba4ca[_0x3bc5('0x79')]('`'+_0x3dd7cf[_0x3bc5('0x5c')]+_0x3bc5('0x7a'));}else{_0xdba4ca[_0x3bc5('0x79')]('`'+_0x3dd7cf[_0x3bc5('0x5c')]+'`\x20>\x200');}break;case _0x3bc5('0x7b'):if(_0x3dd7cf[_0x3bc5('0x7c')]===_0x3bc5('0x7d')){if(_0x3dd7cf[_0x3bc5('0x78')][_0x3bc5('0x48')]('\x20')[_0x3bc5('0x56')]>0x1){_0x4c9946[_0x2b5b21](_0x3bc5('0x7e'),qs[_0x3bc5('0x7f')](_0x3dd7cf[_0x3bc5('0x78')]),null);}else{var _0x395b31='%'+_0x3dd7cf['value']+'%';_0x4c9946[_0x2b5b21](_0x3bc5('0x80'),_0x395b31,_0x395b31,_0x395b31);}}else{_0x4cfcba=_['find'](_0x5e69d0,[_0x3bc5('0x3e'),_0x3bc5('0x81')]);_0x3dd7cf[_0x3bc5('0x5c')]=_0x3bc5('0x81');_0x51699e=as['buildExpression'](_0x583cfb,_0x4cfcba[_0x3bc5('0x4e')],_0x3dd7cf);_0x4c9946[_0x2b5b21](_0x51699e[_0x3bc5('0x82')],_0x51699e[_0x3bc5('0x78')]['start'],_0x51699e[_0x3bc5('0x78')]['end']);}break;case _0x3bc5('0x83'):var _0x40f0ac=_0x3dd7cf[_0x3bc5('0x78')][_0x3bc5('0x48')](',')['map'](function(_0x4a2fe9){return Number(_0x4a2fe9);});_0x40f0ac[_0x3bc5('0x49')](function(_0x400166){_0x1ac212['or'](_0x3bc5('0x84'),'%,'+_0x400166+',%');});_0x50a42c=_[_0x3bc5('0x85')](_0x50a42c,_0x40f0ac);break;case _0x3bc5('0x86'):if(_0x3dd7cf[_0x3bc5('0x7c')]===_0x3bc5('0x7d')){_0x4c9946[_0x2b5b21](_0x3bc5('0x87'),'%'+_0x3dd7cf[_0x3bc5('0x78')]+'%',null);}else{_0x4cfcba=_['find'](_0x5e69d0,[_0x3bc5('0x3e'),_0x3bc5('0x88')]);_0x3dd7cf[_0x3bc5('0x5c')]='UserId';_0x51699e=as[_0x3bc5('0x89')](_0x583cfb,_0x4cfcba[_0x3bc5('0x4e')],_0x3dd7cf);_0x4c9946[_0x2b5b21](_0x51699e[_0x3bc5('0x82')],_0x51699e[_0x3bc5('0x78')][_0x3bc5('0x8a')],_0x51699e[_0x3bc5('0x78')][_0x3bc5('0x32')]);}break;case'body':_0x51699e=as[_0x3bc5('0x89')]('me',null,_0x3dd7cf);_0x4c9946[_0x2b5b21](_0x51699e[_0x3bc5('0x82')],_0x51699e[_0x3bc5('0x78')][_0x3bc5('0x8a')],_0x51699e[_0x3bc5('0x78')]['end']);break;}}else{var _0x51699e=as['buildExpression'](_0x583cfb,_0x4cfcba[_0x3bc5('0x4e')],_0x3dd7cf);_0x4c9946[_0x2b5b21](_0x51699e[_0x3bc5('0x82')],_0x51699e[_0x3bc5('0x78')][_0x3bc5('0x8a')],_0x51699e[_0x3bc5('0x78')][_0x3bc5('0x32')]);}}}else{var _0x2b8c9e=_(_0x5e8be3[_0x3bc5('0x4f')])[_0x3bc5('0x50')]()[_0x3bc5('0x45')](function(_0x76fc0){return _[_0x3bc5('0x8b')](_0x5e69d0,['name',_0x76fc0])?_0x76fc0:undefined;})['compact']()[_0x3bc5('0x78')]();if(!_[_0x3bc5('0x8c')](_0x2b8c9e)){_0x2b8c9e[_0x3bc5('0x49')](function(_0x4e1cd1){if(_0x4e1cd1==='ChatWebsiteId'){_0xdba4ca['where'](_0x3bc5('0x8d'),[][_0x3bc5('0x8e')](_0x5e8be3[_0x3bc5('0x4f')][_0x4e1cd1]));}else if(_0x4e1cd1==='createdAt'){var _0x40e284=JSON['parse'](_0x5e8be3['query'][_0x4e1cd1])[_0x3bc5('0x8f')];var _0x41d385=JSON[_0x3bc5('0x90')](_0x5e8be3['query'][_0x4e1cd1])[_0x3bc5('0x91')];_0xdba4ca[_0x3bc5('0x92')](_0x3bc5('0x93'),_0x40e284,_0x41d385);}else{if(_0x5e8be3['query'][_0x4e1cd1]===_0x3bc5('0x94')){_0xdba4ca[_0x3bc5('0x92')]('i.'+_0x4e1cd1+_0x3bc5('0x95'));}else{_0xdba4ca['where']('i.'+_0x4e1cd1+_0x3bc5('0x96'),_0x5e8be3['query'][_0x4e1cd1]);}}});}if(_0x5e8be3['query'][_0x3bc5('0x97')]){if(_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x97')]==0x1){_0xdba4ca[_0x3bc5('0x79')]('`unreadMessages`\x20=\x200');}else{_0xdba4ca[_0x3bc5('0x79')](_0x3bc5('0x98'));}}if(_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x99')]){_0x50a42c=_[_0x3bc5('0x9a')](_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x99')])?_0x5e8be3['query'][_0x3bc5('0x99')]:new Array(_0x5e8be3[_0x3bc5('0x4f')]['tag']);_0x50a42c['forEach'](function(_0xac2bea){_0x1ac212['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xac2bea+',%');});}if(_0x5e8be3['query']['filter']){var _0x469f49=_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x9b')]['replace']('\x5c','\x5c\x5c')[_0x3bc5('0x9c')](/'/g,'\x27\x27');if(qs[_0x3bc5('0x9d')](_0x469f49)){_0x4c9946['or'](_0x3bc5('0x9e'),_0x469f49+'%');}else{_0x4c9946['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3bc5('0x7f')](_0x469f49))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x469f49+'%');}}}_0xdba4ca[_0x3bc5('0x92')](_0x4c9946);_0xdba4ca['group'](_0x3bc5('0x9f'));var _0x367436={'type':db[_0x3bc5('0xa0')][_0x3bc5('0xa1')][_0x3bc5('0xa2')],'raw':!![]};var _0x51e8b5=_0xdba4ca['clone']();_0x51e8b5[_0x3bc5('0x5c')](_0x3bc5('0x9f'));_0x51e8b5[_0x3bc5('0x5c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3bc5('0x77'));if(_0x521e93[_0x3bc5('0x58')]){_0x521e93[_0x3bc5('0x58')][_0x3bc5('0x49')](function(_0x17f6f7){var _0x11a4e2=_0x17f6f7[0x0]===_0x3bc5('0xa3')?_0x17f6f7[0x0]:'i.'+_0x17f6f7[0x0];_0xdba4ca[_0x3bc5('0x58')](_0x11a4e2,_0x17f6f7[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x50a42c)){_0xdba4ca[_0x3bc5('0x79')](_0x1ac212);_0x51e8b5[_0x3bc5('0x92')](_0x3bc5('0xa4'),_0x50a42c);}BPromise[_0x3bc5('0xa5')]()['then'](function(){if(!_0x3001c2){if(_0x5e8be3[_0x3bc5('0x4f')]['ChatWebsiteId'])return;_0x51e8b5[_0x3bc5('0x92')](_0x3bc5('0xa6'));_0xdba4ca[_0x3bc5('0x92')](_0x3bc5('0xa6'));return;}if(_0x5e8be3[_0x3bc5('0xa7')]['role']!==_0x3bc5('0x42'))return;return _0x5e8be3[_0x3bc5('0xa7')][_0x3bc5('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x306079){if(_[_0x3bc5('0x8c')](_0x306079)){_0x51e8b5['where'](_0x3bc5('0xa9'));_0xdba4ca[_0x3bc5('0x92')](_0x3bc5('0xa9'));}else{_0x51e8b5[_0x3bc5('0x92')](_0x3bc5('0x8d'),_[_0x3bc5('0x45')](_0x306079,'id'));_0xdba4ca[_0x3bc5('0x92')](_0x3bc5('0x8d'),_[_0x3bc5('0x45')](_0x306079,'id'));}});})[_0x3bc5('0x25')](function(){if(_0x5e8be3[_0x3bc5('0xa7')][_0x3bc5('0xaa')]==='agent'&&!_0x3001c2&&!_0x5e8be3[_0x3bc5('0x4f')]['ChatWebsiteId'])return[];return db[_0x3bc5('0xab')]['query'](_0x51e8b5['toString'](),_0x367436);})[_0x3bc5('0x25')](function(_0x1a90f2){_0xec2117[_0x3bc5('0xac')]=_0x1a90f2[_0x3bc5('0x56')];if(_0xec2117[_0x3bc5('0xac')]===0x0)return[];return db[_0x3bc5('0xab')][_0x3bc5('0x4f')](_0x4184d7[_0x3bc5('0xad')](),_0x367436)[_0x3bc5('0x25')](function(_0x1f3154){_0x677036=_[_0x3bc5('0xae')](_0x1f3154,'id');_0x367436=_[_0x3bc5('0x3f')](_0x367436,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x55')]){_0x521e93[_0x3bc5('0x54')]['forEach'](function(_0x23da13){_0xdba4ca[_0x3bc5('0x5c')]('i.'+_0x23da13);});}else{_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xaf'),_0x3bc5('0x77'));_0xdba4ca['field']('a.key','Account.key');_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xb0'),_0x3bc5('0xb1'));_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xb2'),_0x3bc5('0xa3'));_0xdba4ca[_0x3bc5('0x5c')]('i.*');_0xdba4ca['field'](_0x3bc5('0xb3'),_0x3bc5('0xb4'));_0xdba4ca['field'](_0x3bc5('0xb5'),'Contact.lastName');_0xdba4ca['field']('c.email',_0x3bc5('0xb6'));_0xdba4ca[_0x3bc5('0x5c')]('c.phone','Contact.phone');_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xb7'),_0x3bc5('0xb8'));_0xdba4ca[_0x3bc5('0x5c')]('c.fax','Contact.fax');_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xb9'),_0x3bc5('0xba'));_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xbb'),_0x3bc5('0xbc'));_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xbd'),'TagIds');}if(_0x521e93['limit'])_0xdba4ca['limit'](_0x521e93[_0x3bc5('0x36')]);if(_0x521e93[_0x3bc5('0x34')])_0xdba4ca[_0x3bc5('0x34')](_0x521e93[_0x3bc5('0x34')]);return db[_0x3bc5('0xab')][_0x3bc5('0x4f')](_0xdba4ca[_0x3bc5('0xad')](),_0x367436);})[_0x3bc5('0x25')](function(_0x50ce64){if(_0x50ce64[_0x3bc5('0x56')]>0x0)_0x54d46b[_0x3bc5('0x92')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x50ce64,'id'));return db['sequelize']['query'](_0x54d46b[_0x3bc5('0xad')](),_0x367436)[_0x3bc5('0x25')](function(_0x5a59fb){var _0x10c9c5=_['groupBy'](_0x5a59fb,_0x3bc5('0xbe'));var _0x254c27=[];_0x50ce64[_0x3bc5('0x49')](function(_0x35d9a5){_0x254c27[_0x3bc5('0x4a')](updateChatInteraction(_0x35d9a5,_0x677036,_0x10c9c5));});return BPromise[_0x3bc5('0xbf')](_0x254c27);});});})['then'](function(_0x5a8141){_0xec2117[_0x3bc5('0xc0')]=_0x5a8141;return _0xec2117;})[_0x3bc5('0x25')](respondWithFilteredResult(_0x43f4a4,_0x521e93))[_0x3bc5('0x30')](handleError(_0x43f4a4,null));};exports['show']=function(_0x11dbd5,_0x3c0cbf){var _0x11c6f6={'raw':![],'where':{'id':_0x11dbd5[_0x3bc5('0xc1')]['id']}},_0x434035={};_0x434035['model']=_[_0x3bc5('0x50')](db[_0x3bc5('0x4c')][_0x3bc5('0xc2')]);_0x434035['query']=_[_0x3bc5('0x50')](_0x11dbd5['query']);_0x434035[_0x3bc5('0x51')]=_[_0x3bc5('0x52')](_0x434035[_0x3bc5('0x53')],_0x434035['query']);_0x11c6f6['attributes']=_['intersection'](_0x434035[_0x3bc5('0x53')],qs[_0x3bc5('0x55')](_0x11dbd5[_0x3bc5('0x4f')][_0x3bc5('0x55')]));_0x11c6f6[_0x3bc5('0x54')]=_0x11c6f6[_0x3bc5('0x54')][_0x3bc5('0x56')]?_0x11c6f6[_0x3bc5('0x54')]:_0x434035[_0x3bc5('0x53')];if(_0x11dbd5['query']['includeAll']){_0x11c6f6[_0x3bc5('0xc3')]=[{'all':!![]}];}_0x11c6f6=_[_0x3bc5('0x3f')]({},_0x11c6f6,_0x11dbd5[_0x3bc5('0xc4')]);return db[_0x3bc5('0x4c')][_0x3bc5('0x76')](_0x11c6f6)[_0x3bc5('0x25')](handleEntityNotFound(_0x3c0cbf,null))['then'](respondWithResult(_0x3c0cbf,null))[_0x3bc5('0x30')](handleError(_0x3c0cbf,null));};exports[_0x3bc5('0xc5')]=function(_0x32d4cc,_0x29add5){return db[_0x3bc5('0x4c')][_0x3bc5('0xc5')](_0x32d4cc[_0x3bc5('0x40')],{})[_0x3bc5('0x25')](respondWithResult(_0x29add5,0xc9))['catch'](handleError(_0x29add5,null));};exports[_0x3bc5('0x3b')]=function(_0x52991d,_0x243d8f){if(_0x52991d[_0x3bc5('0x40')]['id']){delete _0x52991d[_0x3bc5('0x40')]['id'];}return db[_0x3bc5('0x4c')]['find']({'where':{'id':_0x52991d[_0x3bc5('0xc1')]['id']}})[_0x3bc5('0x25')](handleEntityNotFound(_0x243d8f,null))['then'](saveUpdates(_0x52991d[_0x3bc5('0x40')],null))[_0x3bc5('0x25')](respondWithResult(_0x243d8f,null))[_0x3bc5('0x30')](handleError(_0x243d8f,null));};exports[_0x3bc5('0xc6')]=function(_0x776df1,_0x24fb86){return db[_0x3bc5('0x4c')][_0x3bc5('0x76')]({'where':{'id':_0x776df1['params']['id']}})[_0x3bc5('0x25')](handleEntityNotFound(_0x24fb86,null))[_0x3bc5('0x25')](removeEntity(_0x24fb86,null))['catch'](handleError(_0x24fb86,null));};exports[_0x3bc5('0xc7')]=function(_0x1e6e5f,_0x41e335){return db['ChatInteraction']['describe']()['then'](respondWithResult(_0x41e335,null))[_0x3bc5('0x30')](handleError(_0x41e335,null));};exports[_0x3bc5('0xc8')]=function(_0x7a12cf,_0xc32eb0){var _0x380cb5=_0x7a12cf[_0x3bc5('0xc1')]['id'];var _0x137593;var _0xaeb537;var _0x5b607f;return db[_0x3bc5('0x4c')][_0x3bc5('0xc9')]({'where':{'id':_0x380cb5}})[_0x3bc5('0x25')](function(_0x57baec){_0x137593=_0x57baec;return db['ChatWebsite'][_0x3bc5('0xc9')]({'where':{'id':_0x57baec[_0x3bc5('0xca')]},'attributes':['id',_0x3bc5('0xcb'),_0x3bc5('0xcc'),_0x3bc5('0xcd'),_0x3bc5('0xce'),_0x3bc5('0xcf')],'raw':!![]});})['then'](function(_0x33183c){if(_0x33183c&&_0x33183c[_0x3bc5('0xcb')]&&_0x33183c[_0x3bc5('0xcc')]){_0xaeb537=_0x33183c;var _0x477cae={'interaction':{'id':_0x380cb5},'agent':{'id':_0x7a12cf[_0x3bc5('0xa7')]['id'],'name':_0x7a12cf[_0x3bc5('0xa7')][_0x3bc5('0x3e')],'fullname':_0x7a12cf[_0x3bc5('0xa7')][_0x3bc5('0xd0')],'email':_0x7a12cf[_0x3bc5('0xa7')][_0x3bc5('0xd1')]},'contact':_0x7a12cf['body'][_0x3bc5('0x41')],'account':_0x7a12cf[_0x3bc5('0x40')][_0x3bc5('0x44')]};var _0x161cb7={'rejectUnauthorized':![],'method':'POST','url':_0x3bc5('0xd2'),'headers':{'X-APIKEY':_0x33183c[_0x3bc5('0xcb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x7a12cf[_0x3bc5('0xa7')][_0x3bc5('0xd1')]],'buttons':null,'topic':_0xaeb537[_0x3bc5('0xcd')],'note':_[_0x3bc5('0xd3')](_0xaeb537[_0x3bc5('0xce')])?null:getMustacheRender(_0xaeb537[_0x3bc5('0xce')],_0x477cae),'metadata':null},'redirect':_0x3bc5('0xd4'),'json':!![]};try{if(!_[_0x3bc5('0xd3')](_0xaeb537['vidaooMetadata'])){var _0x3e3bc6=getMustacheRender(_0xaeb537[_0x3bc5('0xcf')],_0x477cae);var _0x59f816=JSON[_0x3bc5('0x90')](_0x3e3bc6);_0x161cb7['body'][_0x3bc5('0xd5')]=_0x59f816;}}catch(_0x2b5fa0){throw new db[(_0x3bc5('0xa0'))][(_0x3bc5('0xd6'))](_0x3bc5('0xd7'));}return rp(_0x161cb7);}else{throw new db['Sequelize'][(_0x3bc5('0xd6'))](_0x3bc5('0xd8'));}})[_0x3bc5('0x25')](function(_0x2393e3){_0x5b607f=_0x2393e3;if(_0x5b607f['id']){var _0x2a951d={'body':_0x5b607f[_0x3bc5('0xd9')],'ChatWebsiteId':_0xaeb537['id'],'ChatInteractionId':_0x137593['id'],'direction':_0x3bc5('0xda'),'UserId':_0x7a12cf[_0x3bc5('0xa7')]['id']};return db[_0x3bc5('0xdb')][_0x3bc5('0xc5')](_0x2a951d,{});}else{throw new db['Sequelize'][(_0x3bc5('0xd6'))](_0x3bc5('0xdc'));}})['then'](function(){return _0x137593[_0x3bc5('0xdd')]({'vidaooSessionId':_0x5b607f['id']});})['then'](respondWithResult(_0xc32eb0,null))[_0x3bc5('0x30')](handleError(_0xc32eb0,null));};exports[_0x3bc5('0xde')]=function(_0x4d65af,_0x44206f){if(_0x4d65af[_0x3bc5('0x40')]['id']){delete _0x4d65af[_0x3bc5('0x40')]['id'];}return db[_0x3bc5('0x4c')][_0x3bc5('0x76')]({'where':{'id':_0x4d65af[_0x3bc5('0xc1')]['id']},'include':[{'model':db[_0x3bc5('0xdf')],'as':_0x3bc5('0x7b')}]})[_0x3bc5('0x25')](handleEntityNotFound(_0x44206f,null))[_0x3bc5('0x25')](saveUpdates(_0x4d65af[_0x3bc5('0x40')],null))[_0x3bc5('0x25')](respondWithResult(_0x44206f,null))[_0x3bc5('0x30')](handleError(_0x44206f,null));};exports[_0x3bc5('0xe0')]=function(_0x1edbf0,_0x382a1a,_0x5e6a43){if(_0x1edbf0[_0x3bc5('0x40')]['id']){delete _0x1edbf0[_0x3bc5('0x40')]['id'];}return db[_0x3bc5('0x4c')][_0x3bc5('0x76')]({'where':{'id':_0x1edbf0[_0x3bc5('0xc1')]['id']}})[_0x3bc5('0x25')](function(_0x117665){if(!_0x117665){logger[_0x3bc5('0x2c')](_0x3bc5('0xe1'),_0x3bc5('0xe0'),0x194,_0x3bc5('0xe2'));_0x382a1a[_0x3bc5('0x3c')](0x194);}else{if(_0x117665[_0x3bc5('0x88')]){throw new db['Sequelize'][(_0x3bc5('0xd6'))]('Interaction\x20already\x20assigned');}}return _0x117665;})[_0x3bc5('0x25')](function(_0x20ee63){if(_0x20ee63){return _0x20ee63[_0x3bc5('0x3b')]({'closed':_0x1edbf0[_0x3bc5('0x40')]['closed'],'disposition':_0x1edbf0[_0x3bc5('0x40')][_0x3bc5('0xe3')]})[_0x3bc5('0x25')](function(_0x1413c8){return _0x1413c8;});}})[_0x3bc5('0x25')](function(_0x17a0de){return respondWithRpcPromise(_0x3bc5('0xe4'),_0x3bc5('0xe0'),_0x1edbf0[_0x3bc5('0x40')],client9004);})[_0x3bc5('0x25')](respondWithResult(_0x382a1a,null))[_0x3bc5('0x30')](handleError(_0x382a1a,null));};exports[_0x3bc5('0xe5')]=function(_0x280341,_0x3e7793,_0x14f0af){_0x280341['body']['name']=_0x280341[_0x3bc5('0xe6')][_0x3bc5('0xe7')];_0x280341[_0x3bc5('0x40')][_0x3bc5('0xe8')]=_0x280341['file'][_0x3bc5('0xe9')];_0x280341[_0x3bc5('0x40')][_0x3bc5('0x4e')]=_0x280341[_0x3bc5('0xe6')][_0x3bc5('0xea')];return db[_0x3bc5('0xeb')][_0x3bc5('0xc5')](_0x280341[_0x3bc5('0x40')])[_0x3bc5('0x25')](respondWithResult(_0x3e7793,0xc9))[_0x3bc5('0x30')](handleError(_0x3e7793,null));};exports[_0x3bc5('0xec')]=function(_0x21bae9,_0x5cf5da,_0x36d903){return db['ChatInteraction'][_0x3bc5('0xc9')]({'where':{'id':_0x21bae9[_0x3bc5('0xc1')]['id']},'raw':!![]})[_0x3bc5('0x25')](handleEntityNotFound(_0x5cf5da,null))[_0x3bc5('0x25')](function(_0xddb16f){if(_0xddb16f){if(_0xddb16f[_0x3bc5('0xed')]){return _0x5cf5da['status'](0x193)[_0x3bc5('0x33')]({'status':0x193,'message':_0x3bc5('0xee')});}return db['Attachment']['findOne']({'where':{'id':_0x21bae9['query'][_0x3bc5('0xef')]},'raw':!![]})[_0x3bc5('0x25')](handleEntityNotFound(_0x5cf5da,null));}})[_0x3bc5('0x25')](function(_0x376dae){if(_0x376dae){var _0x3b6977=_0x376dae[_0x3bc5('0xf0')]!==null;var _0x3ad93b=path['join'](config[_0x3bc5('0xf1')],_0x3bc5('0xf2'));if(_0x3b6977){_0x3ad93b=path[_0x3bc5('0xf3')](_0x3ad93b,_0x3bc5('0xf4'));}var _0x5820da=path['join'](_0x3ad93b,_0x376dae[_0x3bc5('0xe8')]);return _0x5cf5da[_0x3bc5('0xf5')](_0x5820da);}})[_0x3bc5('0x30')](handleError(_0x5cf5da,null));};exports[_0x3bc5('0xf6')]=function(_0x46017f,_0x189118){var _0x3f29b3=null;var _0x464a2a=null;var _0x464c50=null;var _0x49873d=null;if(_0x46017f['body']['id']){delete _0x46017f[_0x3bc5('0x40')]['id'];}if(_0x46017f[_0x3bc5('0x40')]['mailTranscript']){_0x49873d=path[_0x3bc5('0xf3')](config['root'],_0x3bc5('0xf7'),util[_0x3bc5('0xf8')](_0x3bc5('0xf9'),Date[_0x3bc5('0xfa')]()));_0x46017f[_0x3bc5('0x40')]['pathTranscript']=_0x49873d;}return db[_0x3bc5('0x4c')][_0x3bc5('0x76')]({'where':{'id':_0x46017f[_0x3bc5('0xc1')]['id']},'include':[{'model':db[_0x3bc5('0xdb')],'as':_0x3bc5('0xfb'),'include':[{'model':db[_0x3bc5('0x86')],'as':'User'}]}]})[_0x3bc5('0x25')](handleEntityNotFound(_0x189118,null))[_0x3bc5('0x25')](saveUpdates(_0x46017f[_0x3bc5('0x40')],null))[_0x3bc5('0x25')](function(_0x4f2039){if(_0x4f2039){_0x3f29b3=_0x4f2039;return db[_0x3bc5('0xfc')][_0x3bc5('0x76')]({'where':{'id':_0x3f29b3['ChatWebsiteId']}});}})[_0x3bc5('0x25')](function(_0x5ce872){if(_0x5ce872){_0x464c50=_0x5ce872;return db['CmContact'][_0x3bc5('0x76')]({'where':{'id':_0x3f29b3[_0x3bc5('0x81')]}});}})[_0x3bc5('0x25')](function(_0x515dd9){if(_0x515dd9){_0x464a2a=_0x515dd9;if(_0x49873d){var _0x340673=null;for(var _0xfea989=0x1;_0xfea989<_0x3f29b3[_0x3bc5('0xfb')][_0x3bc5('0x56')];++_0xfea989){_0x340673=_0x3f29b3['Messages'][_0xfea989];var _0x491326=_0x340673['UserId']?util[_0x3bc5('0xf8')](_0x3bc5('0xfd'),_0x464c50[_0x3bc5('0xfe')],_0x340673['UserId']):_0x3bc5('0xff');var _0x6a38c5=_0x46017f['body'][_0x3bc5('0x100')]||util[_0x3bc5('0xf8')](_0x3bc5('0xfd'),_0x3bc5('0x101'),_0x340673['ContactId']);switch(_0x464c50[_0x3bc5('0x102')]){case _0x3bc5('0x103'):_0x491326=_0x340673['UserId']?util[_0x3bc5('0xf8')](_0x3bc5('0xfd'),_0x464c50[_0x3bc5('0xfe')],_0x340673[_0x3bc5('0x88')]):_0x3bc5('0xff');break;case'agent_alias':_0x491326=_0x340673[_0x3bc5('0x88')]?_0x340673[_0x3bc5('0x86')][_0x3bc5('0x104')]||_0x340673['User'][_0x3bc5('0xd0')]:_0x3bc5('0xff');break;case _0x3bc5('0x105'):_0x491326=_0x340673[_0x3bc5('0x88')]?_0x340673[_0x3bc5('0x86')][_0x3bc5('0xd0')]:_0x3bc5('0xff');break;default:_0x491326=_0x340673['UserId']?util[_0x3bc5('0xf8')](_0x3bc5('0xfd'),_0x464c50[_0x3bc5('0xfe')],_0x340673[_0x3bc5('0x88')]):_0x3bc5('0xff');}var _0x4aa51f=util['format'](_0x3bc5('0x106'),moment(_0x340673[_0x3bc5('0x107')])[_0x3bc5('0xf8')]('MM/DD/YYYY\x20HH:mm:ss'),_0x340673[_0x3bc5('0x108')]==='in'?_0x6a38c5:_0x491326,_0x340673['body']);if(!_0x340673['secret']){fs[_0x3bc5('0x109')](_0x49873d,_0x4aa51f);}}return db['MailAccount'][_0x3bc5('0xc9')]({'where':{'service':!![]},'include':[{'model':db[_0x3bc5('0x10a')],'as':_0x3bc5('0x10b'),'raw':!![]}]});}}})[_0x3bc5('0x25')](function(_0x313875){if(_0x313875&&_0x313875['Smtp']&&_0x46017f[_0x3bc5('0x40')]){var _0x19266a={'tls':{'rejectUnauthorized':![]}};if(_0x313875[_0x3bc5('0x10b')]['service']){_0x19266a[_0x3bc5('0x10c')]=_0x313875[_0x3bc5('0x10b')][_0x3bc5('0x10c')];}else{_0x19266a[_0x3bc5('0x10d')]=_0x313875[_0x3bc5('0x10b')][_0x3bc5('0x10d')];_0x19266a[_0x3bc5('0x10e')]=_0x313875['Smtp']['port'];_0x19266a[_0x3bc5('0x10f')]=_0x313875[_0x3bc5('0x10b')][_0x3bc5('0x10f')];}if(_0x313875[_0x3bc5('0x10b')][_0x3bc5('0x110')]){_0x19266a[_0x3bc5('0x111')]={'user':_0x313875[_0x3bc5('0x10b')][_0x3bc5('0xa7')],'pass':_0x313875[_0x3bc5('0x10b')]['pass']};}return respondWithRpcPromise(_0x3bc5('0x112'),_0x3bc5('0x113'),{'account':_0x19266a,'message':{'from':util[_0x3bc5('0xf8')](_0x3bc5('0x114'),_0x313875[_0x3bc5('0x3e')],_0x313875[_0x3bc5('0xd1')]||_0x313875[_0x3bc5('0x10b')]['user']),'to':_0x46017f['body'][_0x3bc5('0x115')],'subject':'Mail\x20Transcript','text':util['format'](_0x3bc5('0x116'),_0x46017f[_0x3bc5('0x40')][_0x3bc5('0x115')]),'attachments':[{'path':_0x49873d}]}})['then'](function(){return _0x3f29b3;})[_0x3bc5('0x30')](function(_0x3a7d6a){console['error'](_0x3a7d6a);});}else{return _0x3f29b3;}})[_0x3bc5('0x25')](respondWithStatusCode(_0x189118,0xc8))['catch'](handleError(_0x189118,null));};exports[_0x3bc5('0x117')]=function(_0x25a7cb,_0x33f858,_0x3557){return db['ChatMessage'][_0x3bc5('0x76')]({'where':{'id':_0x25a7cb['params']['id']}})[_0x3bc5('0x25')](handleEntityNotFound(_0x33f858,null))[_0x3bc5('0x25')](function(_0x14a154){if(_0x14a154){return _0x14a154[_0x3bc5('0x117')](_0x25a7cb[_0x3bc5('0x40')][_0x3bc5('0x118')],_['omit'](_0x25a7cb['body'],[_0x3bc5('0x118'),'id'])||{});}})[_0x3bc5('0x25')](respondWithResult(_0x33f858,null))[_0x3bc5('0x30')](handleError(_0x33f858,null));};exports[_0x3bc5('0x119')]=function(_0x1f71fc,_0x1d1ed5,_0x3005a3){var _0x178bf6={'raw':![],'where':{}};var _0xa52da5={};var _0x103c4d={'count':0x0,'rows':[]};return db[_0x3bc5('0x4c')][_0x3bc5('0xc9')]({'where':{'id':_0x1f71fc['params']['id']}})[_0x3bc5('0x25')](handleEntityNotFound(_0x1d1ed5,null))[_0x3bc5('0x25')](function(_0x435ab0){if(_0x435ab0){_0xa52da5[_0x3bc5('0x53')]=_['keys'](db['ChatMessage'][_0x3bc5('0xc2')]);_0xa52da5[_0x3bc5('0x4f')]=_['keys'](_0x1f71fc[_0x3bc5('0x4f')]);_0xa52da5['filters']=_['intersection'](_0xa52da5[_0x3bc5('0x53')],_0xa52da5['query']);_0x178bf6[_0x3bc5('0x54')]=_['intersection'](_0xa52da5['model'],qs[_0x3bc5('0x55')](_0x1f71fc['query']['fields']));_0x178bf6[_0x3bc5('0x54')]=_0x178bf6[_0x3bc5('0x54')]['length']?_0x178bf6[_0x3bc5('0x54')]:_0xa52da5[_0x3bc5('0x53')];if(!_0x1f71fc[_0x3bc5('0x4f')][_0x3bc5('0x11a')](_0x3bc5('0x57'))){_0x178bf6[_0x3bc5('0x36')]=qs['limit'](_0x1f71fc[_0x3bc5('0x4f')][_0x3bc5('0x36')]);_0x178bf6[_0x3bc5('0x34')]=qs[_0x3bc5('0x34')](_0x1f71fc[_0x3bc5('0x4f')][_0x3bc5('0x34')]);}_0x178bf6[_0x3bc5('0x58')]=qs[_0x3bc5('0x59')](_0x1f71fc['query'][_0x3bc5('0x59')]);_0x178bf6[_0x3bc5('0x92')]=qs['filters'](_[_0x3bc5('0x5a')](_0x1f71fc[_0x3bc5('0x4f')],_0xa52da5[_0x3bc5('0x51')]));_0x178bf6['where'][_0x3bc5('0xbe')]=_0x435ab0['id'];if(_0x1f71fc[_0x3bc5('0x4f')][_0x3bc5('0x9b')]){_0x178bf6[_0x3bc5('0x92')]=_['merge'](_0x178bf6[_0x3bc5('0x92')],{'$or':_[_0x3bc5('0x45')](_0x178bf6['attributes'],function(_0x1de556){var _0x25e305={};_0x25e305[_0x1de556]={'$like':'%'+_0x1f71fc['query'][_0x3bc5('0x9b')]+'%'};return _0x25e305;})});}if(_0x1f71fc[_0x3bc5('0x4f')][_0x3bc5('0x8f')]){var _0x612909=_0x1f71fc[_0x3bc5('0x4f')][_0x3bc5('0x8f')]['split'](',');var _0x1fa9b6={};_0x1fa9b6[_0x612909[0x0]]={'$gte':moment(_0x612909[0x1])[_0x3bc5('0xf8')](_0x3bc5('0x11b'))};_0x178bf6['where']=_[_0x3bc5('0x3f')](_0x178bf6[_0x3bc5('0x92')],_0x1fa9b6);}_0x178bf6=_[_0x3bc5('0x3f')]({},_0x178bf6,_0x1f71fc[_0x3bc5('0xc4')]);return db[_0x3bc5('0xdb')][_0x3bc5('0xac')]({'where':_0x178bf6[_0x3bc5('0x92')]})['then'](function(_0xb7b3d){_0x103c4d['count']=_0xb7b3d;if(_0x1f71fc[_0x3bc5('0x4f')]['includeAll']){_0x178bf6[_0x3bc5('0xc3')]=[{'all':!![]}];}return db[_0x3bc5('0xdb')]['findAll'](_0x178bf6);})[_0x3bc5('0x25')](function(_0x318196){_0x103c4d['rows']=_0x318196;return _0x103c4d;});}})['then'](respondWithFilteredResult(_0x1d1ed5,_0x178bf6))[_0x3bc5('0x30')](handleError(_0x1d1ed5,null));};exports[_0x3bc5('0x11c')]=function(_0x19ab6f,_0x217b20,_0x551774){var _0x1d4bd1={'where':{}},_0x206e5e={},_0x12f78c={'count':0x0,'rows':[]};return db[_0x3bc5('0x4c')][_0x3bc5('0xc9')]({'where':{'id':_0x19ab6f[_0x3bc5('0xc1')]['id']}})['then'](handleEntityNotFound(_0x217b20,null))['then'](function(_0x51ec25){if(_0x51ec25){_0x206e5e['model']=_['keys'](db[_0x3bc5('0xdb')][_0x3bc5('0xc2')]);_0x206e5e['query']=_[_0x3bc5('0x50')](_0x19ab6f['query']);_0x206e5e[_0x3bc5('0x51')]=_['intersection'](_0x206e5e[_0x3bc5('0x53')],_0x206e5e[_0x3bc5('0x4f')]);_0x1d4bd1[_0x3bc5('0x54')]=_[_0x3bc5('0x52')](_0x206e5e[_0x3bc5('0x53')],qs[_0x3bc5('0x55')](_0x19ab6f[_0x3bc5('0x4f')][_0x3bc5('0x55')]));_0x1d4bd1[_0x3bc5('0x54')]=_0x1d4bd1[_0x3bc5('0x54')]['length']?_0x1d4bd1[_0x3bc5('0x54')]:_0x206e5e[_0x3bc5('0x53')];if(!_0x19ab6f[_0x3bc5('0x4f')][_0x3bc5('0x11a')]('nolimit')){_0x1d4bd1[_0x3bc5('0x36')]=qs['limit'](_0x19ab6f[_0x3bc5('0x4f')]['limit']);_0x1d4bd1['offset']=qs[_0x3bc5('0x34')](_0x19ab6f[_0x3bc5('0x4f')][_0x3bc5('0x34')]);}_0x1d4bd1[_0x3bc5('0x58')]=qs[_0x3bc5('0x59')](_0x19ab6f['query'][_0x3bc5('0x59')]);_0x1d4bd1[_0x3bc5('0x92')]=qs[_0x3bc5('0x51')](_[_0x3bc5('0x5a')](_0x19ab6f[_0x3bc5('0x4f')],_0x206e5e[_0x3bc5('0x51')]));_0x1d4bd1[_0x3bc5('0x92')]['ChatInteractionId']=_0x51ec25['id'];if(_0x19ab6f[_0x3bc5('0x4f')][_0x3bc5('0x9b')]){_0x1d4bd1[_0x3bc5('0x92')]=_[_0x3bc5('0x3f')](_0x1d4bd1[_0x3bc5('0x92')],{'$or':_[_0x3bc5('0x45')](_0x1d4bd1[_0x3bc5('0x54')],function(_0x89858e){var _0x2d2847={};_0x2d2847[_0x89858e]={'$like':'%'+_0x19ab6f[_0x3bc5('0x4f')]['filter']+'%'};return _0x2d2847;})});}_0x1d4bd1[_0x3bc5('0x92')][_0x3bc5('0x11d')]=![];if(_0x19ab6f[_0x3bc5('0x4f')]['id']){_0x1d4bd1[_0x3bc5('0x92')]['id']={'$gt':_0x19ab6f[_0x3bc5('0x4f')]['id']};}_0x1d4bd1=_[_0x3bc5('0x3f')]({},_0x1d4bd1,_0x19ab6f[_0x3bc5('0xc4')]);return db[_0x3bc5('0xdb')][_0x3bc5('0xac')]({'where':_0x1d4bd1['where']})['then'](function(_0x3767f4){_0x12f78c['count']=_0x3767f4;_0x1d4bd1[_0x3bc5('0xc3')]=[];if(_0x19ab6f[_0x3bc5('0x4f')][_0x3bc5('0x11e')]){_0x1d4bd1['include'][_0x3bc5('0x4a')]({'model':db[_0x3bc5('0x86')],'as':'User','attributes':['id','fullname',_0x3bc5('0x104')]});}if(_0x19ab6f[_0x3bc5('0x4f')][_0x3bc5('0x11f')]){_0x1d4bd1[_0x3bc5('0xc3')]=[{'all':!![]}];}return db[_0x3bc5('0xdb')][_0x3bc5('0x120')](_0x1d4bd1);})[_0x3bc5('0x25')](function(_0x5241eb){_0x12f78c[_0x3bc5('0xc0')]=_0x5241eb;return _0x12f78c;});}})[_0x3bc5('0x25')](respondWithFilteredResult(_0x217b20,_0x1d4bd1))[_0x3bc5('0x30')](handleError(_0x217b20,null));};exports['addTags']=function(_0x438d93,_0x53986e,_0x165d92){return db[_0x3bc5('0x4c')][_0x3bc5('0x76')]({'where':{'id':_0x438d93[_0x3bc5('0xc1')]['id']}})['then'](handleEntityNotFound(_0x53986e,null))['then'](function(_0x3162f3){if(_0x3162f3){return _0x3162f3[_0x3bc5('0x121')](_0x438d93[_0x3bc5('0x40')]['ids'],_[_0x3bc5('0x122')](_0x438d93[_0x3bc5('0x40')],[_0x3bc5('0x118'),'id'])||{})['spread'](function(){return db[_0x3bc5('0x83')][_0x3bc5('0x120')]({'attributes':['id','name',_0x3bc5('0x5d')],'where':{'id':_0x438d93[_0x3bc5('0x40')][_0x3bc5('0x118')]}});})[_0x3bc5('0x25')](function(_0x2662aa){socket['emit'](_0x3bc5('0x123'),{'id':Number(_0x438d93['params']['id']),'tags':_0x2662aa||[]});return{'id':Number(_0x438d93[_0x3bc5('0xc1')]['id']),'tags':_0x2662aa||[]};});}})['then'](respondWithResult(_0x53986e,null))['catch'](handleError(_0x53986e,null));};exports[_0x3bc5('0x124')]=function(_0x4ae836,_0x542d5f,_0x120e90){return db['ChatInteraction']['find']({'where':{'id':_0x4ae836['params']['id']}})[_0x3bc5('0x25')](handleEntityNotFound(_0x542d5f,null))[_0x3bc5('0x25')](function(_0x1faf0f){if(_0x1faf0f){return _0x1faf0f[_0x3bc5('0x124')](_0x4ae836[_0x3bc5('0x4f')]['ids']);}})['then'](respondWithStatusCode(_0x542d5f,null))[_0x3bc5('0x30')](handleError(_0x542d5f,null));};exports[_0x3bc5('0xf5')]=function(_0xa30e1,_0x49191b){var _0xf70245=moment()[_0x3bc5('0x125')]()['toString']();var _0x21df41=path[_0x3bc5('0xf3')](config[_0x3bc5('0xf1')],_0x3bc5('0x126'),_0x3bc5('0x127'),'tmp');var _0x1d00c6=path['join'](config[_0x3bc5('0xf1')],'server','files','attachments');var _0x2250bd=path[_0x3bc5('0xf3')](_0x21df41,_0xf70245);var _0x1fa948=util[_0x3bc5('0xf8')](_0x3bc5('0x128'),_0xa30e1[_0x3bc5('0xc1')]['id'],_0xf70245);var _0x2f88c3=path[_0x3bc5('0xf3')](_0x21df41,_0x1fa948);var _0x4a5519=[];_0x4a5519[_0x3bc5('0x4a')]({'model':db[_0x3bc5('0x86')],'as':_0x3bc5('0x86'),'attributes':['id','fullname'],'raw':!![]});_0x4a5519[_0x3bc5('0x4a')]({'model':db[_0x3bc5('0xdf')],'as':'Contact','attributes':['id',_0x3bc5('0x129'),_0x3bc5('0x12a')],'raw':!![]});if(_0xa30e1[_0x3bc5('0x4f')][_0x3bc5('0x12b')]){_0x4a5519[_0x3bc5('0x4a')]({'model':db[_0x3bc5('0xeb')],'as':_0x3bc5('0xeb'),'raw':!![]});}var _0x17f2ea=[{'model':db[_0x3bc5('0xdb')],'as':'Messages','attributes':['id',_0x3bc5('0x40'),_0x3bc5('0x107'),_0x3bc5('0x108'),_0x3bc5('0x11d'),_0x3bc5('0x97')],'include':_0x4a5519}];_0x17f2ea[_0x3bc5('0x4a')]({'model':db[_0x3bc5('0xfc')],'as':_0x3bc5('0x12c'),'attributes':['id',_0x3bc5('0x3e')]});_0x17f2ea[_0x3bc5('0x4a')]({'model':db[_0x3bc5('0x86')],'as':_0x3bc5('0x12d'),'attributes':['id',_0x3bc5('0xd0')]});return db[_0x3bc5('0x4c')][_0x3bc5('0x76')]({'where':{'id':_0xa30e1[_0x3bc5('0xc1')]['id']},'include':_0x17f2ea})[_0x3bc5('0x25')](handleEntityNotFound(_0x49191b,null))[_0x3bc5('0x25')](function(_0x584fdd){if(_0x584fdd){var _0x5114ed=_0x584fdd['get']({'plain':!![]});fs[_0x3bc5('0x12e')](_0x2250bd);var _0x5ed469={'channel':_0x3bc5('0x12f'),'account':_0x5114ed[_0x3bc5('0x12c')][_0x3bc5('0x3e')],'agent':_0x5114ed[_0x3bc5('0x12d')]?_0x5114ed[_0x3bc5('0x12d')][_0x3bc5('0xd0')]:_0x3bc5('0x130'),'createdAt':moment(_0x5114ed[_0x3bc5('0x107')])[_0x3bc5('0xf8')](_0x3bc5('0x11b'))[_0x3bc5('0xad')](),'closedAt':_0x5114ed[_0x3bc5('0xed')]?moment(_0x5114ed[_0x3bc5('0x131')])[_0x3bc5('0xf8')](_0x3bc5('0x11b'))[_0x3bc5('0xad')]():'','disposition':_0x5114ed[_0x3bc5('0xe3')],'chatInfo':{'browser':_0x5114ed[_0x3bc5('0x132')],'os':_0x5114ed[_0x3bc5('0x133')],'referer':_0x5114ed[_0x3bc5('0x134')],'customerIp':_0x5114ed[_0x3bc5('0x135')],'customerPort':_0x5114ed[_0x3bc5('0x136')]?_0x5114ed[_0x3bc5('0x136')]:'N.A.'},'messages':_(_0x5114ed[_0x3bc5('0xfb')])[_0x3bc5('0x137')]()['filter']({'secret':![]})[_0x3bc5('0x45')](function(_0x16e01a){if(_0x16e01a['Attachment']){var _0x284eac=path[_0x3bc5('0xf3')](_0x1d00c6,_0x16e01a[_0x3bc5('0xeb')][_0x3bc5('0xe8')]);if(fs[_0x3bc5('0x138')](_0x284eac)){fs[_0x3bc5('0x139')](_0x284eac)[_0x3bc5('0x13a')](fs[_0x3bc5('0x13b')](path[_0x3bc5('0xf3')](_0x2250bd,_0x16e01a[_0x3bc5('0xeb')][_0x3bc5('0xe8')])));}}return{'date':moment(_0x16e01a[_0x3bc5('0x107')])['format'](_0x3bc5('0x11b'))['toString'](),'sender':_0x16e01a[_0x3bc5('0x108')]===_0x3bc5('0xda')?_0x16e01a['User']?_0x16e01a[_0x3bc5('0x86')][_0x3bc5('0xd0')]:'System':_0x16e01a['Contact'][_0x3bc5('0x129')]+(_0x16e01a[_0x3bc5('0x7b')][_0x3bc5('0x12a')]?'\x20'+_0x16e01a[_0x3bc5('0x7b')][_0x3bc5('0x12a')]:''),'body':_0x16e01a[_0x3bc5('0xeb')]?_0x16e01a['Attachment']['basename']:_0x16e01a['body'],'direction':_0x16e01a[_0x3bc5('0x108')]===_0x3bc5('0xda')?'A':'C','secret':_0x16e01a[_0x3bc5('0x11d')],'read':_0x16e01a['read'],'attachment':_0x16e01a[_0x3bc5('0xeb')]};})['value']()};return ejs[_0x3bc5('0x13c')](path[_0x3bc5('0xf3')](config[_0x3bc5('0xf1')],_0x3bc5('0x126'),_0x3bc5('0x13d'),_0x3bc5('0x13e')),{'interaction':_0x5ed469})['then'](function(_0x2da83f){var _0xa25286=path[_0x3bc5('0xf3')](_0x2250bd,'transcript-'+_0x5114ed['id']+'-'+_0xf70245+_0x3bc5('0x13f'));var _0x1b202c={'path':_0xa25286,'channel':_0x3bc5('0x12f'),'interactionId':_0x5114ed['id']};return pdf[_0x3bc5('0x140')](_0x2da83f,_0x1b202c);})[_0x3bc5('0x25')](function(){return new BPromise(function(_0x5a7fb8,_0x4c5916){zipdir(_0x2250bd,{'saveTo':_0x2f88c3},function(_0x523083,_0x5da0b1){if(_0x523083)return _0x4c5916(_0x523083);return _0x5a7fb8(_0x5da0b1);});})['then'](function(){return new BPromise(function(_0x421a29,_0x445e70){rimraf(_0x2250bd,function(_0x380a75){if(_0x380a75)_0x445e70(_0x380a75);return _0x421a29();});});})[_0x3bc5('0x25')](function(){return _0x49191b['download'](_0x2f88c3,_0x1fa948,function(_0x377c8c){if(_0x377c8c){console['log']('err',_0x377c8c);}else{fs[_0x3bc5('0x141')](_0x2f88c3);}});});});}else{return _0x49191b[_0x3bc5('0x3c')](0xc8);}})[_0x3bc5('0x30')](handleError(_0x49191b,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 6b610cc..8f64b22 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 _0xc283=['then','Users','findAll','setDataValue','unreadMessages','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xc283,0x189));var _0x3c28=function(_0x29c5a8,_0x214f5a){_0x29c5a8=_0x29c5a8-0x0;var _0x1bad94=_0xc283[_0x29c5a8];return _0x1bad94;};'use strict';var EventEmitter=require(_0x3c28('0x0'));var ChatInteraction=require(_0x3c28('0x1'))['db'][_0x3c28('0x2')];var ChatMessage=require(_0x3c28('0x1'))['db'][_0x3c28('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3c28('0x4')](0x0);var events={'afterCreate':_0x3c28('0x5'),'afterUpdate':_0x3c28('0x6'),'afterDestroy':'remove'};function emitEvent(_0x5365ba){return function(_0x925a95,_0x57a842,_0x58015a){_0x925a95['getUsers']({'attributes':['id'],'raw':!![]})[_0x3c28('0x7')](function(_0x5577bc){_0x925a95['setDataValue'](_0x3c28('0x8'),_0x5577bc['map'](function(_0xe4e6c2){return{'id':_0xe4e6c2['id']};}));return ChatMessage[_0x3c28('0x9')]({'where':{'ChatInteractionId':_0x925a95['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3c28('0x7')](function(_0x5de861){_0x925a95[_0x3c28('0xa')](_0x3c28('0xb'),_0x5de861['length']);ChatInteractionEvents['emit'](_0x5365ba+':'+_0x925a95['id'],_0x925a95);ChatInteractionEvents['emit'](_0x5365ba,_0x925a95);_0x58015a(null);})[_0x3c28('0xc')](_0x58015a(null));};}for(var e in events){if(events[_0x3c28('0xd')](e)){var event=events[e];ChatInteraction[_0x3c28('0xe')](e,emitEvent(event));}}module[_0x3c28('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0xf198=['ChatMessage','setMaxListeners','update','remove','then','setDataValue','Users','map','length','emit','catch','hook','exports','../../mysqldb'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf198,0xd1));var _0x8f19=function(_0x506565,_0x1cb75b){_0x506565=_0x506565-0x0;var _0x372967=_0xf198[_0x506565];return _0x372967;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x8f19('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x8f19('0x0'))['db'][_0x8f19('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8f19('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f19('0x3'),'afterDestroy':_0x8f19('0x4')};function emitEvent(_0x3a7997){return function(_0x3d85ab,_0x38eb84,_0x2892e9){_0x3d85ab['getUsers']({'attributes':['id'],'raw':!![]})[_0x8f19('0x5')](function(_0x202eb1){_0x3d85ab[_0x8f19('0x6')](_0x8f19('0x7'),_0x202eb1[_0x8f19('0x8')](function(_0x1b5be2){return{'id':_0x1b5be2['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3d85ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8f19('0x5')](function(_0x26171d){_0x3d85ab[_0x8f19('0x6')]('unreadMessages',_0x26171d[_0x8f19('0x9')]);ChatInteractionEvents[_0x8f19('0xa')](_0x3a7997+':'+_0x3d85ab['id'],_0x3d85ab);ChatInteractionEvents[_0x8f19('0xa')](_0x3a7997,_0x3d85ab);_0x2892e9(null);})[_0x8f19('0xb')](_0x2892e9(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x8f19('0xc')](e,emitEvent(event));}}module[_0x8f19('0xd')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index d1330bb..b0a2ba7 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 _0xed0b=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed0b,0xb4));var _0xbed0=function(_0x4d8a8f,_0x2afd4c){_0x4d8a8f=_0x4d8a8f-0x0;var _0xfc4adc=_0xed0b[_0x4d8a8f];return _0xfc4adc;};'use strict';var _=require(_0xbed0('0x0'));var util=require(_0xbed0('0x1'));var logger=require(_0xbed0('0x2'))(_0xbed0('0x3'));var moment=require(_0xbed0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbed0('0x5'));var attributes=require('./chatInteraction.attributes');module[_0xbed0('0x6')]=function(_0x4de271,_0x53b132){return _0x4de271[_0xbed0('0x7')](_0xbed0('0x8'),attributes,{'tableName':_0xbed0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e28a2,_0x5bdb6d,_0x1441e8){if(_0x2e28a2[_0xbed0('0xa')](_0xbed0('0xb'))){_0x2e28a2[_0xbed0('0xc')]=moment()['format'](_0xbed0('0xd'));}_0x1441e8(null,_0x2e28a2);}},'charset':_0xbed0('0xe'),'collate':_0xbed0('0xf')});}; \ No newline at end of file +var _0xbe78=['../../config/logger','api','bluebird','request-promise','path','rimraf','define','ChatInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x4e54a7,_0x3b444e){var _0x3ad0d2=function(_0x4b0dde){while(--_0x4b0dde){_0x4e54a7['push'](_0x4e54a7['shift']());}};_0x3ad0d2(++_0x3b444e);}(_0xbe78,0xee));var _0x8be7=function(_0x2a4a61,_0x3c3cae){_0x2a4a61=_0x2a4a61-0x0;var _0x308182=_0xbe78[_0x2a4a61];return _0x308182;};'use strict';var _=require(_0x8be7('0x0'));var util=require(_0x8be7('0x1'));var logger=require(_0x8be7('0x2'))(_0x8be7('0x3'));var moment=require('moment');var BPromise=require(_0x8be7('0x4'));var rp=require(_0x8be7('0x5'));var fs=require('fs');var path=require(_0x8be7('0x6'));var rimraf=require(_0x8be7('0x7'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x59f313,_0x2bdb8a){return _0x59f313[_0x8be7('0x8')](_0x8be7('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b4de0,_0x55123e,_0x2fca1a){if(_0x2b4de0[_0x8be7('0xa')](_0x8be7('0xb'))){_0x2b4de0['closedAt']=moment()[_0x8be7('0xc')](_0x8be7('0xd'));}_0x2fca1a(null,_0x2b4de0);}},'charset':_0x8be7('0xe'),'collate':_0x8be7('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 46f7aad..f359f90 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 _0x7c71=['../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','code','message','error','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','attributes','limit','where','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis'];(function(_0x4d17bc,_0xb04503){var _0x5b6350=function(_0x5b2627){while(--_0x5b2627){_0x4d17bc['push'](_0x4d17bc['shift']());}};_0x5b6350(++_0xb04503);}(_0x7c71,0x19d));var _0x17c7=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0x7c71[_0xdbe2de];return _0x2facd7;};'use strict';var _=require('lodash');var util=require(_0x17c7('0x0'));var moment=require(_0x17c7('0x1'));var BPromise=require(_0x17c7('0x2'));var rs=require(_0x17c7('0x3'));var fs=require('fs');var Redis=require(_0x17c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x17c7('0x5'));var logger=require(_0x17c7('0x6'))(_0x17c7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x17c7('0x8')]({'port':0x232a});config[_0x17c7('0x9')]=_[_0x17c7('0xa')](config[_0x17c7('0x9')],{'host':_0x17c7('0xb'),'port':0x18eb});var socket=require(_0x17c7('0xc'))(new Redis(config[_0x17c7('0x9')]));require('./chatInteraction.socket')[_0x17c7('0xd')](socket);function respondWithRpcPromise(_0x3c0475,_0x242938,_0x4a52bf){return new BPromise(function(_0x532c91,_0x5ff49d){return client['request'](_0x3c0475,_0x4a52bf)[_0x17c7('0xe')](function(_0x4c7711){logger[_0x17c7('0xf')](_0x17c7('0x10'),_0x242938,'request\x20sent');logger[_0x17c7('0x11')](_0x17c7('0x12'),_0x242938,_0x17c7('0x13'),JSON['stringify'](_0x4c7711));if(_0x4c7711['error']){if(_0x4c7711['error'][_0x17c7('0x14')]===0x1f4){logger['error'](_0x17c7('0x10'),_0x242938,_0x4c7711['error'][_0x17c7('0x15')]);return _0x5ff49d(_0x4c7711['error'][_0x17c7('0x15')]);}logger[_0x17c7('0x16')](_0x17c7('0x10'),_0x242938,_0x4c7711['error'][_0x17c7('0x15')]);return _0x532c91(_0x4c7711[_0x17c7('0x16')][_0x17c7('0x15')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x242938,_0x17c7('0x13'));_0x532c91(_0x4c7711[_0x17c7('0x17')]['message']);}})[_0x17c7('0x18')](function(_0x3ff43d){logger[_0x17c7('0x16')](_0x17c7('0x10'),_0x242938,_0x3ff43d);_0x5ff49d(_0x3ff43d);});});}exports[_0x17c7('0x19')]=function(_0x69b32f){var _0x3bfbf4=this;return new Promise(function(_0x4e9d5f,_0x2b3c39){return db[_0x17c7('0x1a')][_0x17c7('0x1b')](_0x69b32f[_0x17c7('0x1c')],{'raw':_0x69b32f['options']?_0x69b32f[_0x17c7('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x69b32f[_0x17c7('0x1d')]?_0x69b32f[_0x17c7('0x1d')]['where']||null:null,'attributes':_0x69b32f[_0x17c7('0x1d')]?_0x69b32f['options'][_0x17c7('0x1e')]||null:null,'limit':_0x69b32f[_0x17c7('0x1d')]?_0x69b32f[_0x17c7('0x1d')][_0x17c7('0x1f')]||null:null})[_0x17c7('0xe')](function(_0x59e181){logger[_0x17c7('0xf')](_0x17c7('0x19'),_0x69b32f);logger[_0x17c7('0x11')](_0x17c7('0x19'),_0x69b32f,JSON['stringify'](_0x59e181));_0x4e9d5f(_0x59e181);})[_0x17c7('0x18')](function(_0x5964f9){logger[_0x17c7('0x16')](_0x17c7('0x19'),_0x5964f9[_0x17c7('0x15')],_0x69b32f);_0x2b3c39(_0x3bfbf4[_0x17c7('0x16')](0x1f4,_0x5964f9[_0x17c7('0x15')]));});});};exports['AddTagsToChatInteraction']=function(_0x390ea6){return new Promise(function(_0x49a2b9,_0x24c946){return db[_0x17c7('0x1a')]['find']({'where':_0x390ea6[_0x17c7('0x1d')]?_0x390ea6[_0x17c7('0x1d')][_0x17c7('0x20')]||null:null})[_0x17c7('0xe')](function(_0x37a857){if(_0x37a857){return _0x37a857[_0x17c7('0x21')](_0x390ea6[_0x17c7('0x1c')][_0x17c7('0x22')],_[_0x17c7('0x23')](_0x390ea6['body'],[_0x17c7('0x22'),'id'])||{});}})[_0x17c7('0x24')](function(_0x5c7e97){logger['info'](_0x17c7('0x25'),_0x390ea6);logger['debug'](_0x17c7('0x25'),_0x390ea6,JSON['stringify'](_0x5c7e97));_0x49a2b9(_0x5c7e97);})['catch'](function(_0x388adc){logger['error']('AddTags',_0x388adc[_0x17c7('0x15')],_0x390ea6);_0x24c946(_this[_0x17c7('0x16')](0x1f4,_0x388adc['message']));});});}; \ No newline at end of file +var _0x9bd0=['find','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction'];(function(_0x5c711f,_0x222826){var _0x1300be=function(_0x4daa3c){while(--_0x4daa3c){_0x5c711f['push'](_0x5c711f['shift']());}};_0x1300be(++_0x222826);}(_0x9bd0,0x165));var _0x09bd=function(_0x24de1f,_0x437c83){_0x24de1f=_0x24de1f-0x0;var _0x15a3f=_0x9bd0[_0x24de1f];return _0x15a3f;};'use strict';var _=require('lodash');var util=require(_0x09bd('0x0'));var moment=require(_0x09bd('0x1'));var BPromise=require(_0x09bd('0x2'));var rs=require(_0x09bd('0x3'));var fs=require('fs');var Redis=require(_0x09bd('0x4'));var db=require(_0x09bd('0x5'))['db'];var utils=require(_0x09bd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x09bd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x09bd('0x8')][_0x09bd('0x9')]({'port':0x232a});config[_0x09bd('0xa')]=_[_0x09bd('0xb')](config['redis'],{'host':_0x09bd('0xc'),'port':0x18eb});var socket=require(_0x09bd('0xd'))(new Redis(config['redis']));require(_0x09bd('0xe'))[_0x09bd('0xf')](socket);function respondWithRpcPromise(_0x1b13c1,_0x72391a,_0x212a8b){return new BPromise(function(_0x26dc4f,_0x17b476){return client[_0x09bd('0x10')](_0x1b13c1,_0x212a8b)[_0x09bd('0x11')](function(_0x3c9409){logger[_0x09bd('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x72391a,_0x09bd('0x13'));logger[_0x09bd('0x14')](_0x09bd('0x15'),_0x72391a,'request\x20sent',JSON[_0x09bd('0x16')](_0x3c9409));if(_0x3c9409[_0x09bd('0x17')]){if(_0x3c9409['error'][_0x09bd('0x18')]===0x1f4){logger[_0x09bd('0x17')](_0x09bd('0x19'),_0x72391a,_0x3c9409[_0x09bd('0x17')][_0x09bd('0x1a')]);return _0x17b476(_0x3c9409[_0x09bd('0x17')][_0x09bd('0x1a')]);}logger['error'](_0x09bd('0x19'),_0x72391a,_0x3c9409['error'][_0x09bd('0x1a')]);return _0x26dc4f(_0x3c9409[_0x09bd('0x17')][_0x09bd('0x1a')]);}else{logger[_0x09bd('0x12')](_0x09bd('0x19'),_0x72391a,_0x09bd('0x13'));_0x26dc4f(_0x3c9409[_0x09bd('0x1b')][_0x09bd('0x1a')]);}})[_0x09bd('0x1c')](function(_0x3df100){logger[_0x09bd('0x17')](_0x09bd('0x19'),_0x72391a,_0x3df100);_0x17b476(_0x3df100);});});}exports[_0x09bd('0x1d')]=function(_0x44704c){var _0x5d0867=this;return new Promise(function(_0x52a2b9,_0x3e5504){return db[_0x09bd('0x1e')][_0x09bd('0x1f')](_0x44704c[_0x09bd('0x20')],{'raw':_0x44704c['options']?_0x44704c[_0x09bd('0x21')][_0x09bd('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44704c['options']?_0x44704c[_0x09bd('0x21')][_0x09bd('0x23')]||null:null,'attributes':_0x44704c[_0x09bd('0x21')]?_0x44704c['options'][_0x09bd('0x24')]||null:null,'limit':_0x44704c[_0x09bd('0x21')]?_0x44704c['options'][_0x09bd('0x25')]||null:null})[_0x09bd('0x11')](function(_0x49a21b){logger[_0x09bd('0x12')](_0x09bd('0x1d'),_0x44704c);logger['debug']('UpdateChatInteraction',_0x44704c,JSON[_0x09bd('0x16')](_0x49a21b));_0x52a2b9(_0x49a21b);})[_0x09bd('0x1c')](function(_0x45ed9c){logger[_0x09bd('0x17')](_0x09bd('0x1d'),_0x45ed9c[_0x09bd('0x1a')],_0x44704c);_0x3e5504(_0x5d0867[_0x09bd('0x17')](0x1f4,_0x45ed9c[_0x09bd('0x1a')]));});});};exports[_0x09bd('0x26')]=function(_0x40b54c){return new Promise(function(_0x5df107,_0x23e454){return db[_0x09bd('0x1e')][_0x09bd('0x27')]({'where':_0x40b54c[_0x09bd('0x21')]?_0x40b54c[_0x09bd('0x21')]['where']||null:null})[_0x09bd('0x11')](function(_0x306ffe){if(_0x306ffe){return _0x306ffe['addTags'](_0x40b54c[_0x09bd('0x20')][_0x09bd('0x28')],_[_0x09bd('0x29')](_0x40b54c[_0x09bd('0x20')],[_0x09bd('0x28'),'id'])||{});}})[_0x09bd('0x2a')](function(_0x550505){logger[_0x09bd('0x12')](_0x09bd('0x2b'),_0x40b54c);logger[_0x09bd('0x14')](_0x09bd('0x2b'),_0x40b54c,JSON[_0x09bd('0x16')](_0x550505));_0x5df107(_0x550505);})[_0x09bd('0x1c')](function(_0x1ab2c5){logger[_0x09bd('0x17')](_0x09bd('0x2b'),_0x1ab2c5['message'],_0x40b54c);_0x23e454(_this[_0x09bd('0x17')](0x1f4,_0x1ab2c5[_0x09bd('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index d87d8af..0085efb 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 _0xbfbe=['register','length','chatInteraction:','./chatInteraction.events','save','emit','removeListener'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xbfbe,0x1ae));var _0xebfb=function(_0x2b9847,_0x5b5294){_0x2b9847=_0x2b9847-0x0;var _0x4e393f=_0xbfbe[_0x2b9847];return _0x4e393f;};'use strict';var ChatInteractionEvents=require(_0xebfb('0x0'));var events=[_0xebfb('0x1'),'remove','update'];function createListener(_0x3296e1,_0x5107bf){return function(_0x25963e){_0x5107bf[_0xebfb('0x2')](_0x3296e1,_0x25963e);};}function removeListener(_0x5ba29b,_0x408d8f){return function(){ChatInteractionEvents[_0xebfb('0x3')](_0x5ba29b,_0x408d8f);};}exports[_0xebfb('0x4')]=function(_0x1c20d7){for(var _0x2f0d44=0x0,_0x14ad39=events[_0xebfb('0x5')];_0x2f0d44<_0x14ad39;_0x2f0d44++){var _0x648519=events[_0x2f0d44];var _0x5bab06=createListener(_0xebfb('0x6')+_0x648519,_0x1c20d7);ChatInteractionEvents['on'](_0x648519,_0x5bab06);}}; \ No newline at end of file +var _0xa4e3=['./chatInteraction.events','save','remove','update','emit','removeListener','length','chatInteraction:'];(function(_0x42bf0b,_0x465c08){var _0x3e333f=function(_0xcc97b8){while(--_0xcc97b8){_0x42bf0b['push'](_0x42bf0b['shift']());}};_0x3e333f(++_0x465c08);}(_0xa4e3,0x1b0));var _0x3a4e=function(_0x10f344,_0x814dcd){_0x10f344=_0x10f344-0x0;var _0xcdf71f=_0xa4e3[_0x10f344];return _0xcdf71f;};'use strict';var ChatInteractionEvents=require(_0x3a4e('0x0'));var events=[_0x3a4e('0x1'),_0x3a4e('0x2'),_0x3a4e('0x3')];function createListener(_0x31d08e,_0x1a3e8f){return function(_0x1848a1){_0x1a3e8f[_0x3a4e('0x4')](_0x31d08e,_0x1848a1);};}function removeListener(_0x345993,_0x331847){return function(){ChatInteractionEvents[_0x3a4e('0x5')](_0x345993,_0x331847);};}exports['register']=function(_0x50559d){for(var _0x5a993c=0x0,_0x23d353=events[_0x3a4e('0x6')];_0x5a993c<_0x23d353;_0x5a993c++){var _0x14ae53=events[_0x5a993c];var _0x3b5196=createListener(_0x3a4e('0x7')+_0x14ae53,_0x50559d);ChatInteractionEvents['on'](_0x14ae53,_0x3b5196);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 5f91ae9..034fd0a 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 _0x5cb0=['isAuthenticated','describe','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','post','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','abandon','/:id/close','close','chatinteraction:destroy','delete','/:id/tags','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x13867f,_0x29d839){var _0x56b8b2=function(_0x17b46b){while(--_0x17b46b){_0x13867f['push'](_0x13867f['shift']());}};_0x56b8b2(++_0x29d839);}(_0x5cb0,0xbc));var _0x05cb=function(_0x175d2d,_0x254160){_0x175d2d=_0x175d2d-0x0;var _0x30dc2a=_0x5cb0[_0x175d2d];return _0x30dc2a;};'use strict';var multer=require(_0x05cb('0x0'));var util=require(_0x05cb('0x1'));var path=require('path');var timeout=require(_0x05cb('0x2'));var express=require('express');var router=express[_0x05cb('0x3')]();var fs_extra=require(_0x05cb('0x4'));var auth=require(_0x05cb('0x5'));var interaction=require(_0x05cb('0x6'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x05cb('0x7')]('/',auth[_0x05cb('0x8')](),controller['index']);router['get']('/describe',auth[_0x05cb('0x8')](),controller[_0x05cb('0x9')]);router['get']('/:id',auth['isChatInteractionAuthorized'](),controller[_0x05cb('0xa')]);router[_0x05cb('0x7')](_0x05cb('0xb'),auth[_0x05cb('0xc')](),controller[_0x05cb('0xd')]);router[_0x05cb('0x7')]('/:id/messages',auth[_0x05cb('0x8')](),controller[_0x05cb('0xe')]);router[_0x05cb('0x7')](_0x05cb('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x05cb('0x10')]);router[_0x05cb('0x7')](_0x05cb('0x11'),auth[_0x05cb('0x8')](),controller[_0x05cb('0x12')]);router['post']('/',auth[_0x05cb('0x8')](),controller[_0x05cb('0x13')]);router['post'](_0x05cb('0x14'),auth[_0x05cb('0x8')](),controller[_0x05cb('0x15')]);var upload=multer({'storage':multer[_0x05cb('0x16')]({'destination':function(_0x2d2c17,_0x4aeb0a,_0x59df9){_0x59df9(null,path[_0x05cb('0x17')](config[_0x05cb('0x18')],_0x05cb('0x19')));},'filename':function(_0x1d440d,_0x3e4cb8,_0x5ad0c9){_0x5ad0c9(null,util[_0x05cb('0x1a')](_0x05cb('0x1b'),Date['now'](),_0x3e4cb8[_0x05cb('0x1c')][_0x05cb('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x05cb('0x1e')]('/:id/attachment_upload',upload[_0x05cb('0x1f')](_0x05cb('0x20')),controller[_0x05cb('0x21')]);router[_0x05cb('0x1e')]('/:id/messages',auth[_0x05cb('0xc')](),controller[_0x05cb('0x22')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x05cb('0x23')](_0x05cb('0x24'),_0x05cb('0x25')),controller[_0x05cb('0x26')]);router[_0x05cb('0x27')](_0x05cb('0x28'),auth[_0x05cb('0x8')](),interaction[_0x05cb('0x23')](_0x05cb('0x24'),_0x05cb('0x29')),controller['update']);router[_0x05cb('0x27')]('/:id/custom_update',controller['customUpdate']);router['put']('/:id/abandon',auth[_0x05cb('0xc')](),controller[_0x05cb('0x2a')]);router['put'](_0x05cb('0x2b'),controller[_0x05cb('0x2c')]);router['delete'](_0x05cb('0x28'),auth[_0x05cb('0x8')](),interaction[_0x05cb('0x23')](_0x05cb('0x24'),_0x05cb('0x2d')),controller['destroy']);router[_0x05cb('0x2e')](_0x05cb('0x2f'),auth[_0x05cb('0x8')](),controller['removeTags']);module[_0x05cb('0x30')]=router; \ No newline at end of file +var _0xe836=['single','file','attachmentUpload','/:id/messages','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload'];(function(_0x3dc9c3,_0x460eef){var _0x5b669e=function(_0x129e97){while(--_0x129e97){_0x3dc9c3['push'](_0x3dc9c3['shift']());}};_0x5b669e(++_0x460eef);}(_0xe836,0x10b));var _0x6e83=function(_0x37e967,_0xb3c159){_0x37e967=_0x37e967-0x0;var _0x259861=_0xe836[_0x37e967];return _0x259861;};'use strict';var multer=require(_0x6e83('0x0'));var util=require(_0x6e83('0x1'));var path=require(_0x6e83('0x2'));var timeout=require(_0x6e83('0x3'));var express=require(_0x6e83('0x4'));var router=express[_0x6e83('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6e83('0x6'));var config=require(_0x6e83('0x7'));var controller=require('./chatInteraction.controller');router[_0x6e83('0x8')]('/',auth[_0x6e83('0x9')](),controller[_0x6e83('0xa')]);router[_0x6e83('0x8')](_0x6e83('0xb'),auth[_0x6e83('0x9')](),controller[_0x6e83('0xc')]);router['get'](_0x6e83('0xd'),auth[_0x6e83('0xe')](),controller[_0x6e83('0xf')]);router['get']('/:id/attachment_download',auth[_0x6e83('0xe')](),controller[_0x6e83('0x10')]);router[_0x6e83('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6e83('0x11')]);router[_0x6e83('0x8')](_0x6e83('0x12'),auth[_0x6e83('0xe')](),controller[_0x6e83('0x13')]);router[_0x6e83('0x8')](_0x6e83('0x14'),auth[_0x6e83('0x9')](),controller[_0x6e83('0x15')]);router['post']('/',auth[_0x6e83('0x9')](),controller[_0x6e83('0x16')]);router[_0x6e83('0x17')](_0x6e83('0x18'),auth[_0x6e83('0x9')](),controller[_0x6e83('0x19')]);var upload=multer({'storage':multer[_0x6e83('0x1a')]({'destination':function(_0xbbef31,_0x1c85ae,_0x406f04){_0x406f04(null,path['join'](config['root'],_0x6e83('0x1b')));},'filename':function(_0x3d7ab5,_0x35e8b6,_0x333ece){_0x333ece(null,util[_0x6e83('0x1c')](_0x6e83('0x1d'),Date['now'](),_0x35e8b6[_0x6e83('0x1e')][_0x6e83('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6e83('0x17')](_0x6e83('0x20'),upload[_0x6e83('0x21')](_0x6e83('0x22')),controller[_0x6e83('0x23')]);router[_0x6e83('0x17')](_0x6e83('0x24'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x6e83('0x17')](_0x6e83('0x25'),auth[_0x6e83('0x9')](),interaction[_0x6e83('0x26')](_0x6e83('0x27'),_0x6e83('0x28')),controller[_0x6e83('0x29')]);router[_0x6e83('0x2a')]('/:id',auth[_0x6e83('0x9')](),interaction[_0x6e83('0x26')]('chat',_0x6e83('0x2b')),controller['update']);router[_0x6e83('0x2a')]('/:id/custom_update',controller[_0x6e83('0x2c')]);router[_0x6e83('0x2a')]('/:id/abandon',auth[_0x6e83('0xe')](),controller[_0x6e83('0x2d')]);router[_0x6e83('0x2a')](_0x6e83('0x2e'),controller[_0x6e83('0x2f')]);router[_0x6e83('0x30')](_0x6e83('0xd'),auth[_0x6e83('0x9')](),interaction[_0x6e83('0x26')](_0x6e83('0x27'),_0x6e83('0x31')),controller['destroy']);router[_0x6e83('0x30')](_0x6e83('0x25'),auth[_0x6e83('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index f6db62a..17c4c43 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 _0x57ca=['exports','TEXT','BOOLEAN','INTEGER'];(function(_0x3089cf,_0x4a1fd1){var _0x39dbec=function(_0x5ed01f){while(--_0x5ed01f){_0x3089cf['push'](_0x3089cf['shift']());}};_0x39dbec(++_0x4a1fd1);}(_0x57ca,0x108));var _0xa57c=function(_0x55f22c,_0x186d97){_0x55f22c=_0x55f22c-0x0;var _0x261087=_0x57ca[_0x55f22c];return _0x261087;};'use strict';var Sequelize=require('sequelize');module[_0xa57c('0x0')]={'body':{'type':Sequelize[_0xa57c('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa57c('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa57c('0x3')]}}; \ No newline at end of file +var _0x14a0=['BOOLEAN','INTEGER','exports','TEXT','medium'];(function(_0x4824f7,_0x56c0bb){var _0x2f56b7=function(_0x5452e7){while(--_0x5452e7){_0x4824f7['push'](_0x4824f7['shift']());}};_0x2f56b7(++_0x56c0bb);}(_0x14a0,0x8e));var _0x014a=function(_0x9f4785,_0x43fd4c){_0x9f4785=_0x9f4785-0x0;var _0x279349=_0x14a0[_0x9f4785];return _0x279349;};'use strict';var Sequelize=require('sequelize');module[_0x014a('0x0')]={'body':{'type':Sequelize[_0x014a('0x1')](_0x014a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x014a('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x014a('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 32f6690..1313927 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 _0x5111=['VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','push','FromId','ToId','read','all','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInternalMessage.socket','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','create','body','describe','get','messages','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue'];(function(_0x499e40,_0x15b99e){var _0x1b747a=function(_0x193e40){while(--_0x193e40){_0x499e40['push'](_0x499e40['shift']());}};_0x1b747a(++_0x15b99e);}(_0x5111,0x1c9));var _0x1511=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5111[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1511('0x0'));var zipdir=require(_0x1511('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1511('0x2'));var moment=require(_0x1511('0x3'));var BPromise=require(_0x1511('0x4'));var Mustache=require(_0x1511('0x5'));var util=require(_0x1511('0x6'));var path=require(_0x1511('0x7'));var sox=require(_0x1511('0x8'));var csv=require('to-csv');var ejs=require(_0x1511('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1511('0xa'));var squel=require(_0x1511('0xb'));var crypto=require('crypto');var jsforce=require(_0x1511('0xc'));var deskjs=require(_0x1511('0xd'));var toCsv=require(_0x1511('0xe'));var querystring=require(_0x1511('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1511('0x10'));var qs=require(_0x1511('0x11'));var as=require(_0x1511('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1511('0x13'))('api');var utils=require(_0x1511('0x14'));var config=require(_0x1511('0x15'));var licenseUtil=require(_0x1511('0x16'));var db=require(_0x1511('0x17'))['db'];config['redis']=_[_0x1511('0x18')](config[_0x1511('0x19')],{'host':_0x1511('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1511('0x19')]));require(_0x1511('0x1b'))['register'](socket);function respondWithStatusCode(_0x3d8d44,_0x28862f){_0x28862f=_0x28862f||0xcc;return function(_0x4bac73){if(_0x4bac73){return _0x3d8d44[_0x1511('0x1c')](_0x28862f);}return _0x3d8d44[_0x1511('0x1d')](_0x28862f)['end']();};}function respondWithResult(_0x3d7f06,_0xf81817){_0xf81817=_0xf81817||0xc8;return function(_0x1586b7){if(_0x1586b7){return _0x3d7f06[_0x1511('0x1d')](_0xf81817)['json'](_0x1586b7);}};}function respondWithFilteredResult(_0x56f80c,_0x5d787d){return function(_0x10b9ca){if(_0x10b9ca){var _0x454b7f=typeof _0x5d787d[_0x1511('0x1e')]===_0x1511('0x1f')&&typeof _0x5d787d[_0x1511('0x20')]===_0x1511('0x1f');var _0x593f95=_0x10b9ca[_0x1511('0x21')];var _0x208546=_0x454b7f?0x0:_0x5d787d[_0x1511('0x1e')];var _0x2849b0=_0x454b7f?_0x10b9ca[_0x1511('0x21')]:_0x5d787d[_0x1511('0x1e')]+_0x5d787d['limit'];var _0x30dc1e;if(_0x2849b0>=_0x593f95){_0x2849b0=_0x593f95;_0x30dc1e=0xc8;}else{_0x30dc1e=0xce;}_0x56f80c[_0x1511('0x1d')](_0x30dc1e);return _0x56f80c[_0x1511('0x22')]('Content-Range',_0x208546+'-'+_0x2849b0+'/'+_0x593f95)[_0x1511('0x23')](_0x10b9ca);}return null;};}function patchUpdates(_0x5d2bca){return function(_0x1b3c1f){try{jsonpatch[_0x1511('0x24')](_0x1b3c1f,_0x5d2bca,!![]);}catch(_0x3d8316){return BPromise[_0x1511('0x25')](_0x3d8316);}return _0x1b3c1f[_0x1511('0x26')]();};}function saveUpdates(_0x411cbc,_0x549f72){return function(_0x16c36a){if(_0x16c36a){return _0x16c36a[_0x1511('0x27')](_0x411cbc)[_0x1511('0x28')](function(_0x13a4c0){return _0x13a4c0;});}return null;};}function removeEntity(_0x548634,_0x2512c8){return function(_0x3ef478){if(_0x3ef478){return _0x3ef478[_0x1511('0x29')]()['then'](function(){_0x548634[_0x1511('0x1d')](0xcc)[_0x1511('0x2a')]();});}};}function handleEntityNotFound(_0xd8de1f,_0x2a2142){return function(_0x519802){if(!_0x519802){_0xd8de1f['sendStatus'](0x194);}return _0x519802;};}function handleError(_0x3dae66,_0x13e396){_0x13e396=_0x13e396||0x1f4;return function(_0x277708){logger[_0x1511('0x2b')](_0x277708[_0x1511('0x2c')]);if(_0x277708['name']){delete _0x277708[_0x1511('0x2d')];}_0x3dae66['status'](_0x13e396)[_0x1511('0x2e')](_0x277708);};}exports['index']=function(_0x377d77,_0x1732b4){var _0x50b4a7={},_0x5cea25={},_0x30d139={'count':0x0,'rows':[]};var _0x5be64c=_['map'](db[_0x1511('0x2f')][_0x1511('0x30')],function(_0x203737){return{'name':_0x203737[_0x1511('0x31')],'type':_0x203737[_0x1511('0x32')][_0x1511('0x33')]};});_0x5cea25[_0x1511('0x34')]=_[_0x1511('0x35')](_0x5be64c,_0x1511('0x2d'));_0x5cea25[_0x1511('0x36')]=_[_0x1511('0x37')](_0x377d77[_0x1511('0x36')]);_0x5cea25[_0x1511('0x38')]=_[_0x1511('0x39')](_0x5cea25[_0x1511('0x34')],_0x5cea25['query']);_0x50b4a7[_0x1511('0x3a')]=_[_0x1511('0x39')](_0x5cea25[_0x1511('0x34')],qs[_0x1511('0x3b')](_0x377d77[_0x1511('0x36')]['fields']));_0x50b4a7[_0x1511('0x3a')]=_0x50b4a7[_0x1511('0x3a')][_0x1511('0x3c')]?_0x50b4a7[_0x1511('0x3a')]:_0x5cea25['model'];if(!_0x377d77[_0x1511('0x36')][_0x1511('0x3d')]('nolimit')){_0x50b4a7[_0x1511('0x20')]=qs[_0x1511('0x20')](_0x377d77[_0x1511('0x36')]['limit']);_0x50b4a7[_0x1511('0x1e')]=qs[_0x1511('0x1e')](_0x377d77[_0x1511('0x36')]['offset']);}_0x50b4a7[_0x1511('0x3e')]=qs[_0x1511('0x3f')](_0x377d77[_0x1511('0x36')][_0x1511('0x3f')]);_0x50b4a7[_0x1511('0x40')]=qs[_0x1511('0x38')](_[_0x1511('0x41')](_0x377d77['query'],_0x5cea25[_0x1511('0x38')]),_0x5be64c);if(_0x377d77[_0x1511('0x36')][_0x1511('0x42')]){_0x50b4a7[_0x1511('0x40')]=_[_0x1511('0x43')](_0x50b4a7['where'],{'$or':_[_0x1511('0x35')](_0x5be64c,function(_0x2820c6){if(_0x2820c6[_0x1511('0x32')]!==_0x1511('0x44')){var _0x4e49bc={};_0x4e49bc[_0x2820c6[_0x1511('0x2d')]]={'$like':'%'+_0x377d77[_0x1511('0x36')][_0x1511('0x42')]+'%'};return _0x4e49bc;}})});}_0x50b4a7=_[_0x1511('0x43')]({},_0x50b4a7,_0x377d77['options']);var _0x2fbec3={'where':_0x50b4a7[_0x1511('0x40')]};return db['ChatInternalMessage'][_0x1511('0x21')](_0x2fbec3)[_0x1511('0x28')](function(_0x3c4b0b){_0x30d139[_0x1511('0x21')]=_0x3c4b0b;if(_0x377d77[_0x1511('0x36')][_0x1511('0x45')]){_0x50b4a7['include']=[{'all':!![]}];}return db[_0x1511('0x2f')][_0x1511('0x46')](_0x50b4a7);})[_0x1511('0x28')](function(_0x5db879){_0x30d139['rows']=_0x5db879;return _0x30d139;})[_0x1511('0x28')](respondWithFilteredResult(_0x1732b4,_0x50b4a7))[_0x1511('0x47')](handleError(_0x1732b4,null));};exports[_0x1511('0x48')]=function(_0x59cfdf,_0x4a201a){var _0x30317a={'raw':!![],'where':{'id':_0x59cfdf[_0x1511('0x49')]['id']}},_0x1c978b={};_0x1c978b['model']=_[_0x1511('0x37')](db[_0x1511('0x2f')][_0x1511('0x30')]);_0x1c978b['query']=_['keys'](_0x59cfdf[_0x1511('0x36')]);_0x1c978b[_0x1511('0x38')]=_['intersection'](_0x1c978b[_0x1511('0x34')],_0x1c978b[_0x1511('0x36')]);_0x30317a['attributes']=_['intersection'](_0x1c978b[_0x1511('0x34')],qs[_0x1511('0x3b')](_0x59cfdf[_0x1511('0x36')][_0x1511('0x3b')]));_0x30317a['attributes']=_0x30317a[_0x1511('0x3a')][_0x1511('0x3c')]?_0x30317a[_0x1511('0x3a')]:_0x1c978b[_0x1511('0x34')];if(_0x59cfdf['query'][_0x1511('0x45')]){_0x30317a[_0x1511('0x4a')]=[{'all':!![]}];}_0x30317a=_[_0x1511('0x43')]({},_0x30317a,_0x59cfdf[_0x1511('0x4b')]);return db['ChatInternalMessage'][_0x1511('0x4c')](_0x30317a)[_0x1511('0x28')](handleEntityNotFound(_0x4a201a,null))['then'](respondWithResult(_0x4a201a,null))[_0x1511('0x47')](handleError(_0x4a201a,null));};exports[_0x1511('0x4d')]=function(_0x1eeb28,_0xbd841e){return db[_0x1511('0x2f')]['create'](_0x1eeb28['body'],{})[_0x1511('0x28')](respondWithResult(_0xbd841e,0xc9))[_0x1511('0x47')](handleError(_0xbd841e,null));};exports[_0x1511('0x27')]=function(_0x520ed9,_0x38227b){if(_0x520ed9['body']['id']){delete _0x520ed9[_0x1511('0x4e')]['id'];}return db[_0x1511('0x2f')]['find']({'where':{'id':_0x520ed9['params']['id']}})[_0x1511('0x28')](handleEntityNotFound(_0x38227b,null))[_0x1511('0x28')](saveUpdates(_0x520ed9[_0x1511('0x4e')],null))[_0x1511('0x28')](respondWithResult(_0x38227b,null))[_0x1511('0x47')](handleError(_0x38227b,null));};exports['destroy']=function(_0x383012,_0x35533a){return db[_0x1511('0x2f')][_0x1511('0x4c')]({'where':{'id':_0x383012[_0x1511('0x49')]['id']}})['then'](handleEntityNotFound(_0x35533a,null))['then'](removeEntity(_0x35533a,null))[_0x1511('0x47')](handleError(_0x35533a,null));};exports[_0x1511('0x4f')]=function(_0x530a89,_0x4cb30d){return db['ChatInternalMessage']['describe']()[_0x1511('0x28')](respondWithResult(_0x4cb30d,null))[_0x1511('0x47')](handleError(_0x4cb30d,null));};function wrapUser(_0xc8042b){return function(_0x5692f9){var _0x2396f6=_0xc8042b[_0x1511('0x50')]({'plain':!![]});_0x2396f6[_0x1511('0x51')]=[];if(_0x5692f9){_0x2396f6['lastMessageAt']=_0x5692f9[_0x1511('0x52')];_0x2396f6[_0x1511('0x53')]=_0x5692f9;}else{_0x2396f6['lastMessageAt']=moment(0x0)[_0x1511('0x54')](_0x1511('0x55'));_0x2396f6[_0x1511('0x53')]={};}return _0x2396f6;};}exports[_0x1511('0x56')]=function(_0x374c62,_0x5eddca,_0x1ed841){var _0x2ffa8f=[];return db[_0x1511('0x57')]['findAll']({'where':{'role':[_0x1511('0x58'),_0x1511('0x59'),'user']},'attributes':['id',_0x1511('0x5a'),_0x1511('0x2d'),_0x1511('0x5b'),_0x1511('0x5c'),_0x1511('0x5d'),_0x1511('0x5e'),_0x1511('0x5f'),_0x1511('0x60'),'showWebBar'],'order':qs[_0x1511('0x3f')]('-online'),'include':[{'model':db[_0x1511('0x61')],'as':_0x1511('0x62'),'attributes':['id',_0x1511('0x2d'),_0x1511('0x32')],'through':{'attributes':[]}}]})[_0x1511('0x28')](function(_0x3be2ab){if(_0x3be2ab){var _0x12dd67=_0x374c62[_0x1511('0x63')][_0x1511('0x50')]({'plain':!![]});if(!_0x12dd67)throw new Error(_0x1511('0x64'));if(_0x12dd67[_0x1511('0x5b')]===_0x1511('0x63')){return db[_0x1511('0x65')]['find']({'where':{'name':_0x1511('0x66'),'userProfileId':_0x12dd67['userProfileId']},'raw':!![]})['then'](function(_0x2d90c1){if(_0x2d90c1){if(_0x2d90c1[_0x1511('0x67')]===0x0){return db[_0x1511('0x68')][_0x1511('0x46')]({'where':{'sectionId':_0x2d90c1['id']},'raw':!![]})['then'](function(_0x48ed7a){var _0x296c04=[];if(_[_0x1511('0x69')](_0x48ed7a)){_0x296c04=_['filter'](_0x3be2ab,function(_0x3ded4a){if(_0x3ded4a[_0x1511('0x5b')]!=='agent'){return _0x3ded4a;}});return _0x296c04;}else{for(var _0x22179a=0x0;_0x22179a<_0x3be2ab[_0x1511('0x3c')];_0x22179a++){var _0x49c045=_0x3be2ab[_0x22179a];if(_0x49c045[_0x1511('0x5b')]===_0x1511('0x58')){var _0x3d25dc=_['find'](_0x48ed7a,function(_0x4a4448){return _0x4a4448['resourceId']===_0x49c045['id'];});if(_0x3d25dc)_0x296c04['push'](_0x49c045);}else{_0x296c04[_0x1511('0x6a')](_0x49c045);}}return _0x296c04;}});}else{return _0x3be2ab;}}else{var _0x783a38=_[_0x1511('0x42')](_0x3be2ab,function(_0x306147){if(_0x306147[_0x1511('0x5b')]!==_0x1511('0x58')){return _0x306147;}});return _0x783a38;}});}else{return _0x3be2ab;}}})[_0x1511('0x28')](function(_0x54f98f){var _0x5be1f7=[];if(_0x54f98f){_0x2ffa8f=_0x54f98f;for(var _0x113374=0x0;_0x113374<_0x54f98f[_0x1511('0x3c')];_0x113374+=0x1){_0x2ffa8f[_0x113374][_0x1511('0x51')]=[];_0x5be1f7[_0x1511('0x6a')](db[_0x1511('0x2f')][_0x1511('0x4c')]({'where':{'FromId':[_0x374c62[_0x1511('0x63')]['id'],_0x54f98f[_0x113374]['id']],'ToId':[_0x374c62['user']['id'],_0x54f98f[_0x113374]['id']],'ChatGroupId':null},'attributes':['id',_0x1511('0x52'),_0x1511('0x6b'),_0x1511('0x6c'),_0x1511('0x6d'),'body'],'order':qs[_0x1511('0x3f')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x1511('0x28')](wrapUser(_0x54f98f[_0x113374])));}return BPromise[_0x1511('0x6e')](_0x5be1f7);}return[];})[_0x1511('0x28')](function(_0x13b93f){return{'rows':_0x13b93f,'count':_0x13b93f[_0x1511('0x3c')]};})[_0x1511('0x28')](respondWithResult(_0x5eddca,null))[_0x1511('0x47')](handleError(_0x5eddca,null));}; \ No newline at end of file +var _0xa6ed=['query','keys','filters','attributes','intersection','fields','length','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','user','role','userpic','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model'];(function(_0x4eac2f,_0x19eda1){var _0x739a1c=function(_0x240d08){while(--_0x240d08){_0x4eac2f['push'](_0x4eac2f['shift']());}};_0x739a1c(++_0x19eda1);}(_0xa6ed,0x111));var _0xda6e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xa6ed[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0xda6e('0x0'));var rimraf=require(_0xda6e('0x1'));var zipdir=require(_0xda6e('0x2'));var jsonpatch=require(_0xda6e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xda6e('0x4'));var Mustache=require(_0xda6e('0x5'));var util=require(_0xda6e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xda6e('0x7'));var ejs=require(_0xda6e('0x8'));var fs=require('fs');var fs_extra=require(_0xda6e('0x9'));var _=require('lodash');var squel=require(_0xda6e('0xa'));var crypto=require(_0xda6e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xda6e('0xc'));var toCsv=require(_0xda6e('0x7'));var querystring=require(_0xda6e('0xd'));var Papa=require(_0xda6e('0xe'));var Redis=require(_0xda6e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xda6e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda6e('0x11'));var logger=require(_0xda6e('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xda6e('0x13'));var licenseUtil=require(_0xda6e('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xda6e('0x15')](config[_0xda6e('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xda6e('0x17'))(new Redis(config[_0xda6e('0x16')]));require(_0xda6e('0x18'))[_0xda6e('0x19')](socket);function respondWithStatusCode(_0x203b02,_0x2a3c6e){_0x2a3c6e=_0x2a3c6e||0xcc;return function(_0x55f160){if(_0x55f160){return _0x203b02['sendStatus'](_0x2a3c6e);}return _0x203b02[_0xda6e('0x1a')](_0x2a3c6e)[_0xda6e('0x1b')]();};}function respondWithResult(_0x11ff98,_0x197543){_0x197543=_0x197543||0xc8;return function(_0x152564){if(_0x152564){return _0x11ff98[_0xda6e('0x1a')](_0x197543)[_0xda6e('0x1c')](_0x152564);}};}function respondWithFilteredResult(_0x2d6486,_0x4c9603){return function(_0x2c031e){if(_0x2c031e){var _0x2f18d5=typeof _0x4c9603[_0xda6e('0x1d')]===_0xda6e('0x1e')&&typeof _0x4c9603['limit']===_0xda6e('0x1e');var _0x2d4baf=_0x2c031e[_0xda6e('0x1f')];var _0x4e0c2e=_0x2f18d5?0x0:_0x4c9603[_0xda6e('0x1d')];var _0x13c6f4=_0x2f18d5?_0x2c031e['count']:_0x4c9603[_0xda6e('0x1d')]+_0x4c9603['limit'];var _0x4b5cd5;if(_0x13c6f4>=_0x2d4baf){_0x13c6f4=_0x2d4baf;_0x4b5cd5=0xc8;}else{_0x4b5cd5=0xce;}_0x2d6486[_0xda6e('0x1a')](_0x4b5cd5);return _0x2d6486[_0xda6e('0x20')](_0xda6e('0x21'),_0x4e0c2e+'-'+_0x13c6f4+'/'+_0x2d4baf)[_0xda6e('0x1c')](_0x2c031e);}return null;};}function patchUpdates(_0x5917b9){return function(_0xaccf9){try{jsonpatch[_0xda6e('0x22')](_0xaccf9,_0x5917b9,!![]);}catch(_0x43ceaa){return BPromise[_0xda6e('0x23')](_0x43ceaa);}return _0xaccf9['save']();};}function saveUpdates(_0x43cf4e,_0xcc213e){return function(_0x18d26e){if(_0x18d26e){return _0x18d26e[_0xda6e('0x24')](_0x43cf4e)[_0xda6e('0x25')](function(_0x4d9a81){return _0x4d9a81;});}return null;};}function removeEntity(_0x3de347,_0x495983){return function(_0x5b738a){if(_0x5b738a){return _0x5b738a[_0xda6e('0x26')]()[_0xda6e('0x25')](function(){_0x3de347[_0xda6e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51c2f8,_0x27eb2a){return function(_0x2b83a3){if(!_0x2b83a3){_0x51c2f8[_0xda6e('0x27')](0x194);}return _0x2b83a3;};}function handleError(_0x5d1085,_0x2d3804){_0x2d3804=_0x2d3804||0x1f4;return function(_0x5d8c0c){logger[_0xda6e('0x28')](_0x5d8c0c[_0xda6e('0x29')]);if(_0x5d8c0c[_0xda6e('0x2a')]){delete _0x5d8c0c['name'];}_0x5d1085['status'](_0x2d3804)['send'](_0x5d8c0c);};}exports[_0xda6e('0x2b')]=function(_0x562e6f,_0x557470){var _0x96461d={},_0x56e00e={},_0x138ee9={'count':0x0,'rows':[]};var _0x5bfbd2=_[_0xda6e('0x2c')](db[_0xda6e('0x2d')][_0xda6e('0x2e')],function(_0x5a36a0){return{'name':_0x5a36a0[_0xda6e('0x2f')],'type':_0x5a36a0[_0xda6e('0x30')][_0xda6e('0x31')]};});_0x56e00e[_0xda6e('0x32')]=_[_0xda6e('0x2c')](_0x5bfbd2,_0xda6e('0x2a'));_0x56e00e[_0xda6e('0x33')]=_[_0xda6e('0x34')](_0x562e6f['query']);_0x56e00e[_0xda6e('0x35')]=_['intersection'](_0x56e00e[_0xda6e('0x32')],_0x56e00e['query']);_0x96461d[_0xda6e('0x36')]=_[_0xda6e('0x37')](_0x56e00e[_0xda6e('0x32')],qs[_0xda6e('0x38')](_0x562e6f['query'][_0xda6e('0x38')]));_0x96461d[_0xda6e('0x36')]=_0x96461d[_0xda6e('0x36')][_0xda6e('0x39')]?_0x96461d[_0xda6e('0x36')]:_0x56e00e['model'];if(!_0x562e6f['query']['hasOwnProperty'](_0xda6e('0x3a'))){_0x96461d[_0xda6e('0x3b')]=qs[_0xda6e('0x3b')](_0x562e6f[_0xda6e('0x33')][_0xda6e('0x3b')]);_0x96461d[_0xda6e('0x1d')]=qs[_0xda6e('0x1d')](_0x562e6f[_0xda6e('0x33')][_0xda6e('0x1d')]);}_0x96461d['order']=qs[_0xda6e('0x3c')](_0x562e6f[_0xda6e('0x33')][_0xda6e('0x3c')]);_0x96461d[_0xda6e('0x3d')]=qs[_0xda6e('0x35')](_[_0xda6e('0x3e')](_0x562e6f['query'],_0x56e00e[_0xda6e('0x35')]),_0x5bfbd2);if(_0x562e6f['query'][_0xda6e('0x3f')]){_0x96461d['where']=_[_0xda6e('0x40')](_0x96461d[_0xda6e('0x3d')],{'$or':_[_0xda6e('0x2c')](_0x5bfbd2,function(_0x8b34be){if(_0x8b34be[_0xda6e('0x30')]!==_0xda6e('0x41')){var _0x111c1f={};_0x111c1f[_0x8b34be[_0xda6e('0x2a')]]={'$like':'%'+_0x562e6f[_0xda6e('0x33')][_0xda6e('0x3f')]+'%'};return _0x111c1f;}})});}_0x96461d=_['merge']({},_0x96461d,_0x562e6f[_0xda6e('0x42')]);var _0x218ca5={'where':_0x96461d[_0xda6e('0x3d')]};return db[_0xda6e('0x2d')][_0xda6e('0x1f')](_0x218ca5)[_0xda6e('0x25')](function(_0x22b9f5){_0x138ee9[_0xda6e('0x1f')]=_0x22b9f5;if(_0x562e6f[_0xda6e('0x33')][_0xda6e('0x43')]){_0x96461d[_0xda6e('0x44')]=[{'all':!![]}];}return db[_0xda6e('0x2d')]['findAll'](_0x96461d);})['then'](function(_0x126c9e){_0x138ee9[_0xda6e('0x45')]=_0x126c9e;return _0x138ee9;})[_0xda6e('0x25')](respondWithFilteredResult(_0x557470,_0x96461d))[_0xda6e('0x46')](handleError(_0x557470,null));};exports[_0xda6e('0x47')]=function(_0x20c35c,_0x26a4e7){var _0x20fb9d={'raw':!![],'where':{'id':_0x20c35c['params']['id']}},_0x22c093={};_0x22c093['model']=_[_0xda6e('0x34')](db[_0xda6e('0x2d')]['rawAttributes']);_0x22c093[_0xda6e('0x33')]=_[_0xda6e('0x34')](_0x20c35c[_0xda6e('0x33')]);_0x22c093[_0xda6e('0x35')]=_[_0xda6e('0x37')](_0x22c093[_0xda6e('0x32')],_0x22c093[_0xda6e('0x33')]);_0x20fb9d[_0xda6e('0x36')]=_[_0xda6e('0x37')](_0x22c093[_0xda6e('0x32')],qs['fields'](_0x20c35c[_0xda6e('0x33')][_0xda6e('0x38')]));_0x20fb9d[_0xda6e('0x36')]=_0x20fb9d[_0xda6e('0x36')]['length']?_0x20fb9d[_0xda6e('0x36')]:_0x22c093['model'];if(_0x20c35c[_0xda6e('0x33')][_0xda6e('0x43')]){_0x20fb9d[_0xda6e('0x44')]=[{'all':!![]}];}_0x20fb9d=_[_0xda6e('0x40')]({},_0x20fb9d,_0x20c35c[_0xda6e('0x42')]);return db['ChatInternalMessage'][_0xda6e('0x48')](_0x20fb9d)['then'](handleEntityNotFound(_0x26a4e7,null))['then'](respondWithResult(_0x26a4e7,null))['catch'](handleError(_0x26a4e7,null));};exports[_0xda6e('0x49')]=function(_0x1732cf,_0x5c342d){return db['ChatInternalMessage'][_0xda6e('0x49')](_0x1732cf[_0xda6e('0x4a')],{})[_0xda6e('0x25')](respondWithResult(_0x5c342d,0xc9))[_0xda6e('0x46')](handleError(_0x5c342d,null));};exports[_0xda6e('0x24')]=function(_0x3764ad,_0x282fa3){if(_0x3764ad[_0xda6e('0x4a')]['id']){delete _0x3764ad['body']['id'];}return db[_0xda6e('0x2d')][_0xda6e('0x48')]({'where':{'id':_0x3764ad[_0xda6e('0x4b')]['id']}})[_0xda6e('0x25')](handleEntityNotFound(_0x282fa3,null))['then'](saveUpdates(_0x3764ad[_0xda6e('0x4a')],null))['then'](respondWithResult(_0x282fa3,null))[_0xda6e('0x46')](handleError(_0x282fa3,null));};exports['destroy']=function(_0xce9d97,_0x3a01ba){return db[_0xda6e('0x2d')][_0xda6e('0x48')]({'where':{'id':_0xce9d97['params']['id']}})[_0xda6e('0x25')](handleEntityNotFound(_0x3a01ba,null))[_0xda6e('0x25')](removeEntity(_0x3a01ba,null))[_0xda6e('0x46')](handleError(_0x3a01ba,null));};exports[_0xda6e('0x4c')]=function(_0x3fa49e,_0x3b4d79){return db['ChatInternalMessage'][_0xda6e('0x4c')]()[_0xda6e('0x25')](respondWithResult(_0x3b4d79,null))[_0xda6e('0x46')](handleError(_0x3b4d79,null));};function wrapUser(_0x45c36c){return function(_0x5eb94e){var _0x49cb92=_0x45c36c[_0xda6e('0x4d')]({'plain':!![]});_0x49cb92[_0xda6e('0x4e')]=[];if(_0x5eb94e){_0x49cb92['lastMessageAt']=_0x5eb94e[_0xda6e('0x4f')];_0x49cb92[_0xda6e('0x50')]=_0x5eb94e;}else{_0x49cb92[_0xda6e('0x51')]=moment(0x0)[_0xda6e('0x52')](_0xda6e('0x53'));_0x49cb92[_0xda6e('0x50')]={};}return _0x49cb92;};}exports[_0xda6e('0x54')]=function(_0x3ade11,_0x46f0fc,_0x16c5f4){var _0x57ac34=[];return db[_0xda6e('0x55')][_0xda6e('0x56')]({'where':{'role':[_0xda6e('0x57'),_0xda6e('0x58'),_0xda6e('0x59')]},'attributes':['id','fullname','name',_0xda6e('0x5a'),_0xda6e('0x5b'),'internal','online','lastLoginAt',_0xda6e('0x5c'),_0xda6e('0x5d')],'order':qs[_0xda6e('0x3c')]('-online'),'include':[{'model':db[_0xda6e('0x5e')],'as':_0xda6e('0x5f'),'attributes':['id',_0xda6e('0x2a'),_0xda6e('0x30')],'through':{'attributes':[]}}]})[_0xda6e('0x25')](function(_0xe2dde9){if(_0xe2dde9){var _0x1711b7=_0x3ade11[_0xda6e('0x59')][_0xda6e('0x4d')]({'plain':!![]});if(!_0x1711b7)throw new Error(_0xda6e('0x60'));if(_0x1711b7['role']===_0xda6e('0x59')){return db[_0xda6e('0x61')][_0xda6e('0x48')]({'where':{'name':'Agents','userProfileId':_0x1711b7[_0xda6e('0x62')]},'raw':!![]})[_0xda6e('0x25')](function(_0x13ae06){if(_0x13ae06){if(_0x13ae06[_0xda6e('0x63')]===0x0){return db[_0xda6e('0x64')][_0xda6e('0x56')]({'where':{'sectionId':_0x13ae06['id']},'raw':!![]})[_0xda6e('0x25')](function(_0x460139){var _0xaee8b2=[];if(_['isEmpty'](_0x460139)){_0xaee8b2=_[_0xda6e('0x3f')](_0xe2dde9,function(_0xffd7dd){if(_0xffd7dd[_0xda6e('0x5a')]!=='agent'){return _0xffd7dd;}});return _0xaee8b2;}else{for(var _0x27195a=0x0;_0x27195a<_0xe2dde9[_0xda6e('0x39')];_0x27195a++){var _0x3cf7ff=_0xe2dde9[_0x27195a];if(_0x3cf7ff[_0xda6e('0x5a')]===_0xda6e('0x57')){var _0x4133cd=_[_0xda6e('0x48')](_0x460139,function(_0x3461f8){return _0x3461f8[_0xda6e('0x65')]===_0x3cf7ff['id'];});if(_0x4133cd)_0xaee8b2[_0xda6e('0x66')](_0x3cf7ff);}else{_0xaee8b2[_0xda6e('0x66')](_0x3cf7ff);}}return _0xaee8b2;}});}else{return _0xe2dde9;}}else{var _0x11df34=_[_0xda6e('0x3f')](_0xe2dde9,function(_0x185deb){if(_0x185deb[_0xda6e('0x5a')]!==_0xda6e('0x57')){return _0x185deb;}});return _0x11df34;}});}else{return _0xe2dde9;}}})[_0xda6e('0x25')](function(_0x30dfac){var _0x5d4440=[];if(_0x30dfac){_0x57ac34=_0x30dfac;for(var _0x252ef3=0x0;_0x252ef3<_0x30dfac['length'];_0x252ef3+=0x1){_0x57ac34[_0x252ef3][_0xda6e('0x4e')]=[];_0x5d4440[_0xda6e('0x66')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x3ade11[_0xda6e('0x59')]['id'],_0x30dfac[_0x252ef3]['id']],'ToId':[_0x3ade11['user']['id'],_0x30dfac[_0x252ef3]['id']],'ChatGroupId':null},'attributes':['id',_0xda6e('0x4f'),_0xda6e('0x67'),_0xda6e('0x68'),_0xda6e('0x69'),_0xda6e('0x4a')],'order':qs[_0xda6e('0x3c')](_0xda6e('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xda6e('0x25')](wrapUser(_0x30dfac[_0x252ef3])));}return BPromise[_0xda6e('0x6b')](_0x5d4440);}return[];})[_0xda6e('0x25')](function(_0x506685){return{'rows':_0x506685,'count':_0x506685[_0xda6e('0x39')]};})[_0xda6e('0x25')](respondWithResult(_0x46f0fc,null))[_0xda6e('0x46')](handleError(_0x46f0fc,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index c452c76..6b4e8e4 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 _0xb51e=['emit','hook','events','../../mysqldb','save','update','remove'];(function(_0xf69022,_0x20fd31){var _0x2c91b9=function(_0x44ad0e){while(--_0x44ad0e){_0xf69022['push'](_0xf69022['shift']());}};_0x2c91b9(++_0x20fd31);}(_0xb51e,0x12f));var _0xeb51=function(_0x51119d,_0x5ac5b2){_0x51119d=_0x51119d-0x0;var _0x25779e=_0xb51e[_0x51119d];return _0x25779e;};'use strict';var EventEmitter=require(_0xeb51('0x0'));var ChatInternalMessage=require(_0xeb51('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb51('0x2'),'afterUpdate':_0xeb51('0x3'),'afterDestroy':_0xeb51('0x4')};function emitEvent(_0x3a5503){return function(_0x29c8be,_0x299960,_0x10ce2a){ChatInternalMessageEvents[_0xeb51('0x5')](_0x3a5503+':'+_0x29c8be['id'],_0x29c8be);ChatInternalMessageEvents[_0xeb51('0x5')](_0x3a5503,_0x29c8be);_0x10ce2a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xeb51('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xb2b5=['emit','hasOwnProperty','hook','save','update'];(function(_0x443b26,_0x198bff){var _0x277c86=function(_0x341176){while(--_0x341176){_0x443b26['push'](_0x443b26['shift']());}};_0x277c86(++_0x198bff);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xb2b5[_0x13e741];return _0x3f8bb3;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5b2b('0x0'),'afterUpdate':_0x5b2b('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4eee87){return function(_0x31784d,_0x11fae1,_0x51e747){ChatInternalMessageEvents[_0x5b2b('0x2')](_0x4eee87+':'+_0x31784d['id'],_0x31784d);ChatInternalMessageEvents['emit'](_0x4eee87,_0x31784d);_0x51e747(null);};}for(var e in events){if(events[_0x5b2b('0x3')](e)){var event=events[e];ChatInternalMessage[_0x5b2b('0x4')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 2a04c63..f6adc2b 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 _0xaa88=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage'];(function(_0x44d72e,_0x132777){var _0x3ddc1a=function(_0x234170){while(--_0x234170){_0x44d72e['push'](_0x44d72e['shift']());}};_0x3ddc1a(++_0x132777);}(_0xaa88,0x137));var _0x8aa8=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0xaa88[_0x5a6de2];return _0x2c0525;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8aa8('0xc'),'collate':_0x8aa8('0xd')});}; \ No newline at end of file +var _0xda3f=['../../config/environment','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','request-promise','rimraf'];(function(_0x409a1,_0x2742ca){var _0x7dcf8c=function(_0x519b45){while(--_0x519b45){_0x409a1['push'](_0x409a1['shift']());}};_0x7dcf8c(++_0x2742ca);}(_0xda3f,0xec));var _0xfda3=function(_0x43b583,_0x519b92){_0x43b583=_0x43b583-0x0;var _0x24104f=_0xda3f[_0x43b583];return _0x24104f;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfda3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var attributes=require('./chatInternalMessage.attributes');module[_0xfda3('0x5')]=function(_0x43a010,_0x47e7e2){return _0x43a010['define'](_0xfda3('0x6'),attributes,{'tableName':_0xfda3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfda3('0x8'),'collate':_0xfda3('0x9')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index c43fb12..cb6e0d0 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 _0x6890=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x5ba956,_0x15358d){var _0x5a397b=function(_0x41a9f1){while(--_0x41a9f1){_0x5ba956['push'](_0x5ba956['shift']());}};_0x5a397b(++_0x15358d);}(_0x6890,0xe3));var _0x0689=function(_0x3f7dd8,_0x5be711){_0x3f7dd8=_0x3f7dd8-0x0;var _0xf1745c=_0x6890[_0x3f7dd8];return _0xf1745c;};'use strict';var _=require(_0x0689('0x0'));var util=require(_0x0689('0x1'));var moment=require(_0x0689('0x2'));var BPromise=require(_0x0689('0x3'));var rs=require(_0x0689('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0689('0x5'));var logger=require(_0x0689('0x6'))(_0x0689('0x7'));var config=require(_0x0689('0x8'));var jayson=require(_0x0689('0x9'));var client=jayson[_0x0689('0xa')]['http']({'port':0x232a});config[_0x0689('0xb')]=_[_0x0689('0xc')](config[_0x0689('0xb')],{'host':_0x0689('0xd'),'port':0x18eb});var socket=require(_0x0689('0xe'))(new Redis(config[_0x0689('0xb')]));require(_0x0689('0xf'))[_0x0689('0x10')](socket);function respondWithRpcPromise(_0x28789e,_0x5903e4,_0x5803f4){return new BPromise(function(_0x29f15a,_0x217718){return client[_0x0689('0x11')](_0x28789e,_0x5803f4)[_0x0689('0x12')](function(_0x43bd4a){logger[_0x0689('0x13')](_0x0689('0x14'),_0x5903e4,_0x0689('0x15'));logger[_0x0689('0x16')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x5903e4,'request\x20sent',JSON['stringify'](_0x43bd4a));if(_0x43bd4a[_0x0689('0x17')]){if(_0x43bd4a[_0x0689('0x17')][_0x0689('0x18')]===0x1f4){logger[_0x0689('0x17')](_0x0689('0x14'),_0x5903e4,_0x43bd4a[_0x0689('0x17')]['message']);return _0x217718(_0x43bd4a['error'][_0x0689('0x19')]);}logger[_0x0689('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x5903e4,_0x43bd4a[_0x0689('0x17')]['message']);return _0x29f15a(_0x43bd4a[_0x0689('0x17')][_0x0689('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x5903e4,_0x0689('0x15'));_0x29f15a(_0x43bd4a[_0x0689('0x1a')][_0x0689('0x19')]);}})[_0x0689('0x1b')](function(_0x47f5d7){logger[_0x0689('0x17')](_0x0689('0x14'),_0x5903e4,_0x47f5d7);_0x217718(_0x47f5d7);});});} \ No newline at end of file +var _0xf680=['../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xce201f,_0x3a0737){var _0xb052f4=function(_0x43fbee){while(--_0x43fbee){_0xce201f['push'](_0xce201f['shift']());}};_0xb052f4(++_0x3a0737);}(_0xf680,0xd7));var _0x0f68=function(_0x6dae5d,_0x204649){_0x6dae5d=_0x6dae5d-0x0;var _0x2350c9=_0xf680[_0x6dae5d];return _0x2350c9;};'use strict';var _=require(_0x0f68('0x0'));var util=require(_0x0f68('0x1'));var moment=require(_0x0f68('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f68('0x3'));var fs=require('fs');var Redis=require(_0x0f68('0x4'));var db=require(_0x0f68('0x5'))['db'];var utils=require(_0x0f68('0x6'));var logger=require(_0x0f68('0x7'))(_0x0f68('0x8'));var config=require(_0x0f68('0x9'));var jayson=require(_0x0f68('0xa'));var client=jayson[_0x0f68('0xb')]['http']({'port':0x232a});config[_0x0f68('0xc')]=_[_0x0f68('0xd')](config[_0x0f68('0xc')],{'host':_0x0f68('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f68('0xc')]));require(_0x0f68('0xf'))[_0x0f68('0x10')](socket);function respondWithRpcPromise(_0x577d27,_0x464bfa,_0x24da84){return new BPromise(function(_0x4856b5,_0x2993c4){return client[_0x0f68('0x11')](_0x577d27,_0x24da84)[_0x0f68('0x12')](function(_0x7136f2){logger[_0x0f68('0x13')](_0x0f68('0x14'),_0x464bfa,_0x0f68('0x15'));logger[_0x0f68('0x16')](_0x0f68('0x17'),_0x464bfa,_0x0f68('0x15'),JSON['stringify'](_0x7136f2));if(_0x7136f2[_0x0f68('0x18')]){if(_0x7136f2[_0x0f68('0x18')]['code']===0x1f4){logger[_0x0f68('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x464bfa,_0x7136f2[_0x0f68('0x18')][_0x0f68('0x19')]);return _0x2993c4(_0x7136f2[_0x0f68('0x18')]['message']);}logger[_0x0f68('0x18')](_0x0f68('0x14'),_0x464bfa,_0x7136f2[_0x0f68('0x18')][_0x0f68('0x19')]);return _0x4856b5(_0x7136f2['error'][_0x0f68('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x464bfa,_0x0f68('0x15'));_0x4856b5(_0x7136f2[_0x0f68('0x1a')]['message']);}})[_0x0f68('0x1b')](function(_0x24dac9){logger['error'](_0x0f68('0x14'),_0x464bfa,_0x24dac9);_0x2993c4(_0x24dac9);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 3f72677..0c57c03 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 _0x24cd=['update','emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x3ac31c,_0x189d40){var _0x536ae6=function(_0x581c4e){while(--_0x581c4e){_0x3ac31c['push'](_0x3ac31c['shift']());}};_0x536ae6(++_0x189d40);}(_0x24cd,0x83));var _0xd24c=function(_0x2ecaa7,_0x3aaffe){_0x2ecaa7=_0x2ecaa7-0x0;var _0x32c0a8=_0x24cd[_0x2ecaa7];return _0x32c0a8;};'use strict';var ChatInternalMessageEvents=require(_0xd24c('0x0'));var events=[_0xd24c('0x1'),'remove',_0xd24c('0x2')];function createListener(_0x4fcd89,_0x282e8f){return function(_0x30398b){_0x282e8f[_0xd24c('0x3')](_0x4fcd89,_0x30398b);};}function removeListener(_0x4d515c,_0x21a58c){return function(){ChatInternalMessageEvents[_0xd24c('0x4')](_0x4d515c,_0x21a58c);};}exports['register']=function(_0x1c30fc){for(var _0x2721be=0x0,_0x2a432a=events[_0xd24c('0x5')];_0x2721be<_0x2a432a;_0x2721be++){var _0x3d4d20=events[_0x2721be];var _0x411706=createListener(_0xd24c('0x6')+_0x3d4d20,_0x1c30fc);ChatInternalMessageEvents['on'](_0x3d4d20,_0x411706);}}; \ No newline at end of file +var _0x1306=['./chatInternalMessage.events','save','remove','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x9b8e79,_0x197724){var _0x17341f=function(_0x4e74d5){while(--_0x4e74d5){_0x9b8e79['push'](_0x9b8e79['shift']());}};_0x17341f(++_0x197724);}(_0x1306,0x17a));var _0x6130=function(_0x52d226,_0xe40310){_0x52d226=_0x52d226-0x0;var _0x16bc17=_0x1306[_0x52d226];return _0x16bc17;};'use strict';var ChatInternalMessageEvents=require(_0x6130('0x0'));var events=[_0x6130('0x1'),_0x6130('0x2'),_0x6130('0x3')];function createListener(_0x193b62,_0x31415c){return function(_0xdfa9cd){_0x31415c[_0x6130('0x4')](_0x193b62,_0xdfa9cd);};}function removeListener(_0x1c10f4,_0x33f042){return function(){ChatInternalMessageEvents[_0x6130('0x5')](_0x1c10f4,_0x33f042);};}exports[_0x6130('0x6')]=function(_0x213e6a){for(var _0x2b965d=0x0,_0x1db089=events[_0x6130('0x7')];_0x2b965d<_0x1db089;_0x2b965d++){var _0x354501=events[_0x2b965d];var _0x288b1d=createListener(_0x6130('0x8')+_0x354501,_0x213e6a);ChatInternalMessageEvents['on'](_0x354501,_0x288b1d);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index ddc7636..cec77be 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 _0x48f5=['put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','describe','isAuthenticated','getUsers','/:id','show','post'];(function(_0x4465ce,_0x2d1bd4){var _0x446769=function(_0x2daae6){while(--_0x2daae6){_0x4465ce['push'](_0x4465ce['shift']());}};_0x446769(++_0x2d1bd4);}(_0x48f5,0x68));var _0x548f=function(_0x499be6,_0x484f8d){_0x499be6=_0x499be6-0x0;var _0x3e20ee=_0x48f5[_0x499be6];return _0x3e20ee;};'use strict';var multer=require(_0x548f('0x0'));var util=require(_0x548f('0x1'));var path=require(_0x548f('0x2'));var timeout=require(_0x548f('0x3'));var express=require(_0x548f('0x4'));var router=express['Router']();var fs_extra=require(_0x548f('0x5'));var auth=require(_0x548f('0x6'));var interaction=require(_0x548f('0x7'));var config=require('../../config/environment');var controller=require(_0x548f('0x8'));router[_0x548f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x548f('0xa')]);router['get']('/users',auth[_0x548f('0xb')](),controller[_0x548f('0xc')]);router[_0x548f('0x9')](_0x548f('0xd'),auth[_0x548f('0xb')](),controller[_0x548f('0xe')]);router[_0x548f('0xf')]('/',auth[_0x548f('0xb')](),controller['create']);router[_0x548f('0x10')](_0x548f('0xd'),controller[_0x548f('0x11')]);router[_0x548f('0x12')]('/:id',auth[_0x548f('0xb')](),controller[_0x548f('0x13')]);module['exports']=router; \ No newline at end of file +var _0xfaf0=['show','post','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','/:id'];(function(_0x2e7eed,_0x3e5943){var _0x532742=function(_0x51fc51){while(--_0x51fc51){_0x2e7eed['push'](_0x2e7eed['shift']());}};_0x532742(++_0x3e5943);}(_0xfaf0,0x6a));var _0x0faf=function(_0x1d6690,_0x1b7247){_0x1d6690=_0x1d6690-0x0;var _0x3cf294=_0xfaf0[_0x1d6690];return _0x3cf294;};'use strict';var multer=require(_0x0faf('0x0'));var util=require(_0x0faf('0x1'));var path=require('path');var timeout=require(_0x0faf('0x2'));var express=require(_0x0faf('0x3'));var router=express['Router']();var fs_extra=require(_0x0faf('0x4'));var auth=require(_0x0faf('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0faf('0x6'));router['get']('/',auth[_0x0faf('0x7')](),controller[_0x0faf('0x8')]);router[_0x0faf('0x9')](_0x0faf('0xa'),auth['isAuthenticated'](),controller[_0x0faf('0xb')]);router[_0x0faf('0x9')](_0x0faf('0xc'),auth['isAuthenticated'](),controller['getUsers']);router[_0x0faf('0x9')](_0x0faf('0xd'),auth[_0x0faf('0x7')](),controller[_0x0faf('0xe')]);router[_0x0faf('0xf')]('/',auth[_0x0faf('0x7')](),controller['create']);router[_0x0faf('0x10')](_0x0faf('0xd'),controller[_0x0faf('0x11')]);router['delete'](_0x0faf('0xd'),auth['isAuthenticated'](),controller[_0x0faf('0x12')]);module[_0x0faf('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 5f4ad4b..6187b92 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 _0xd450=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x21b3bd,_0x833127){var _0x3460fb=function(_0x3c9dac){while(--_0x3c9dac){_0x21b3bd['push'](_0x21b3bd['shift']());}};_0x3460fb(++_0x833127);}(_0xd450,0x119));var _0x0d45=function(_0x19cf58,_0x30b51b){_0x19cf58=_0x19cf58-0x0;var _0x36b62f=_0xd450[_0x19cf58];return _0x36b62f;};'use strict';var Sequelize=require(_0x0d45('0x0'));module[_0x0d45('0x1')]={'body':{'type':Sequelize[_0x0d45('0x2')](_0x0d45('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x0d45('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0d45('0x5')),'defaultValue':_0x0d45('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0d45('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3c38=['DATE','STRING','sequelize','exports','TEXT','medium','ENUM','out'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3c38,0x8a));var _0x83c3=function(_0x558958,_0x98f5ca){_0x558958=_0x558958-0x0;var _0xef3c17=_0x3c38[_0x558958];return _0xef3c17;};'use strict';var Sequelize=require(_0x83c3('0x0'));module[_0x83c3('0x1')]={'body':{'type':Sequelize[_0x83c3('0x2')](_0x83c3('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x83c3('0x4')]('in',_0x83c3('0x5')),'defaultValue':_0x83c3('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x83c3('0x6')]},'providerName':{'type':Sequelize[_0x83c3('0x7')]},'providerResponse':{'type':Sequelize[_0x83c3('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 9082103..6d669d4 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 _0x2ddf=['end','json','offset','undefined','limit','count','set','reject','save','update','destroy','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','then','show','params','length','includeAll','find','create','body','describe','chat-interactions','accept','read','readAt','format','UserId','agent','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','cf_','ContactId','sequelize','Sequelize','SELECT','contact','manual','interface','channel','EventManager','chat','RejectMessage','rejectMessage','push','QueryTypes','SIP/%s','event','parse','formData','eml-format','rimraf','fast-json-patch','moment','util','path','sox','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x2ddf,0xd8));var _0xf2dd=function(_0x132e04,_0x42349a){_0x132e04=_0x132e04-0x0;var _0x36f2aa=_0x2ddf[_0x132e04];return _0x36f2aa;};'use strict';var emlformat=require(_0xf2dd('0x0'));var rimraf=require(_0xf2dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf2dd('0x2'));var rp=require('request-promise');var moment=require(_0xf2dd('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf2dd('0x4'));var path=require(_0xf2dd('0x5'));var sox=require(_0xf2dd('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf2dd('0x7'));var crypto=require(_0xf2dd('0x8'));var jsforce=require(_0xf2dd('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf2dd('0xa'));var Redis=require(_0xf2dd('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xf2dd('0xc'));var as=require(_0xf2dd('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf2dd('0xe'))(_0xf2dd('0xf'));var utils=require(_0xf2dd('0x10'));var config=require(_0xf2dd('0x11'));var licenseUtil=require(_0xf2dd('0x12'));var db=require(_0xf2dd('0x13'))['db'];config[_0xf2dd('0x14')]=_['defaults'](config['redis'],{'host':_0xf2dd('0x15'),'port':0x18eb});var socket=require(_0xf2dd('0x16'))(new Redis(config[_0xf2dd('0x14')]));require(_0xf2dd('0x17'))[_0xf2dd('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf2dd('0x19')][_0xf2dd('0x1a')]({'port':0x232c});var client9002=jayson[_0xf2dd('0x19')][_0xf2dd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4ea42c,_0x3e611d,_0x54dac3,_0xd7329e){return new BPromise(function(_0x56089c,_0x1604cd){var _0x4f2ebd=_0xd7329e||client;return _0x4f2ebd['request'](_0x4ea42c,_0x54dac3)['then'](function(_0x4b5630){logger['info'](_0xf2dd('0x1b'),_0x3e611d,_0xf2dd('0x1c'));logger['debug'](_0xf2dd('0x1d'),_0x3e611d,_0xf2dd('0x1c'),JSON[_0xf2dd('0x1e')](_0x4b5630));if(_0x4b5630['error']){if(_0x4b5630[_0xf2dd('0x1f')]['code']===0x1f4){logger[_0xf2dd('0x1f')](_0xf2dd('0x1b'),_0x3e611d,_0x4b5630[_0xf2dd('0x1f')][_0xf2dd('0x20')]);return _0x1604cd(_0x4b5630[_0xf2dd('0x1f')][_0xf2dd('0x20')]);}logger[_0xf2dd('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x3e611d,_0x4b5630['error'][_0xf2dd('0x20')]);return _0x56089c(_0x4b5630[_0xf2dd('0x1f')]['message']);}else{logger[_0xf2dd('0x21')](_0xf2dd('0x1b'),_0x3e611d,_0xf2dd('0x1c'));_0x56089c(_0x4b5630[_0xf2dd('0x22')][_0xf2dd('0x20')]);}})[_0xf2dd('0x23')](function(_0x259425){logger[_0xf2dd('0x1f')](_0xf2dd('0x1b'),_0x3e611d,_0x259425);_0x1604cd(_0x259425);});});}function respondWithStatusCode(_0x448bfc,_0x418580){_0x418580=_0x418580||0xcc;return function(_0x4b98c8){if(_0x4b98c8){return _0x448bfc[_0xf2dd('0x24')](_0x418580);}return _0x448bfc[_0xf2dd('0x25')](_0x418580)[_0xf2dd('0x26')]();};}function respondWithResult(_0x178689,_0x5f378a){_0x5f378a=_0x5f378a||0xc8;return function(_0x5a2aa0){if(_0x5a2aa0){return _0x178689[_0xf2dd('0x25')](_0x5f378a)[_0xf2dd('0x27')](_0x5a2aa0);}};}function respondWithFilteredResult(_0x43050b,_0x45bc0c){return function(_0x5a651a){if(_0x5a651a){var _0x17be0a=typeof _0x45bc0c[_0xf2dd('0x28')]===_0xf2dd('0x29')&&typeof _0x45bc0c[_0xf2dd('0x2a')]===_0xf2dd('0x29');var _0x4543ed=_0x5a651a[_0xf2dd('0x2b')];var _0x36a34a=_0x17be0a?0x0:_0x45bc0c[_0xf2dd('0x28')];var _0x1e0fc9=_0x17be0a?_0x5a651a[_0xf2dd('0x2b')]:_0x45bc0c[_0xf2dd('0x28')]+_0x45bc0c[_0xf2dd('0x2a')];var _0x19153f;if(_0x1e0fc9>=_0x4543ed){_0x1e0fc9=_0x4543ed;_0x19153f=0xc8;}else{_0x19153f=0xce;}_0x43050b[_0xf2dd('0x25')](_0x19153f);return _0x43050b[_0xf2dd('0x2c')]('Content-Range',_0x36a34a+'-'+_0x1e0fc9+'/'+_0x4543ed)[_0xf2dd('0x27')](_0x5a651a);}return null;};}function patchUpdates(_0x216766){return function(_0x1ce63f){try{jsonpatch['apply'](_0x1ce63f,_0x216766,!![]);}catch(_0x4cc100){return BPromise[_0xf2dd('0x2d')](_0x4cc100);}return _0x1ce63f[_0xf2dd('0x2e')]();};}function saveUpdates(_0x50b4f4,_0x2704dc){return function(_0x230d55){if(_0x230d55){return _0x230d55[_0xf2dd('0x2f')](_0x50b4f4)['then'](function(_0xd021e0){return _0xd021e0;});}return null;};}function removeEntity(_0x396abc,_0x51348e){return function(_0x4fd49c){if(_0x4fd49c){return _0x4fd49c[_0xf2dd('0x30')]()['then'](function(){_0x396abc[_0xf2dd('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a8fe3,_0x268b9a){return function(_0x52bea4){if(!_0x52bea4){_0x1a8fe3[_0xf2dd('0x24')](0x194);}return _0x52bea4;};}function handleError(_0x5ac351,_0x4eb3ef){_0x4eb3ef=_0x4eb3ef||0x1f4;return function(_0x520587){logger[_0xf2dd('0x1f')](_0x520587[_0xf2dd('0x31')]);if(_0x520587[_0xf2dd('0x32')]){delete _0x520587[_0xf2dd('0x32')];}_0x5ac351['status'](_0x4eb3ef)['send'](_0x520587);};}exports[_0xf2dd('0x33')]=function(_0x15d404,_0x5dacc7){var _0x393686={},_0x3f24ce={},_0xb4c626={'count':0x0,'rows':[]};var _0x3a1100=_[_0xf2dd('0x34')](db[_0xf2dd('0x35')][_0xf2dd('0x36')],function(_0x524ab8){return{'name':_0x524ab8[_0xf2dd('0x37')],'type':_0x524ab8[_0xf2dd('0x38')][_0xf2dd('0x39')]};});_0x3f24ce[_0xf2dd('0x3a')]=_[_0xf2dd('0x34')](_0x3a1100,_0xf2dd('0x32'));_0x3f24ce[_0xf2dd('0x3b')]=_[_0xf2dd('0x3c')](_0x15d404['query']);_0x3f24ce[_0xf2dd('0x3d')]=_[_0xf2dd('0x3e')](_0x3f24ce['model'],_0x3f24ce[_0xf2dd('0x3b')]);_0x393686[_0xf2dd('0x3f')]=_[_0xf2dd('0x3e')](_0x3f24ce[_0xf2dd('0x3a')],qs[_0xf2dd('0x40')](_0x15d404['query']['fields']));_0x393686[_0xf2dd('0x3f')]=_0x393686[_0xf2dd('0x3f')]['length']?_0x393686[_0xf2dd('0x3f')]:_0x3f24ce[_0xf2dd('0x3a')];if(!_0x15d404[_0xf2dd('0x3b')][_0xf2dd('0x41')](_0xf2dd('0x42'))){_0x393686[_0xf2dd('0x2a')]=qs[_0xf2dd('0x2a')](_0x15d404[_0xf2dd('0x3b')][_0xf2dd('0x2a')]);_0x393686[_0xf2dd('0x28')]=qs[_0xf2dd('0x28')](_0x15d404[_0xf2dd('0x3b')][_0xf2dd('0x28')]);}_0x393686[_0xf2dd('0x43')]=qs[_0xf2dd('0x44')](_0x15d404[_0xf2dd('0x3b')]['sort']);_0x393686['where']=qs['filters'](_[_0xf2dd('0x45')](_0x15d404['query'],_0x3f24ce[_0xf2dd('0x3d')]),_0x3a1100);if(_0x15d404[_0xf2dd('0x3b')][_0xf2dd('0x46')]){_0x393686[_0xf2dd('0x47')]=_[_0xf2dd('0x48')](_0x393686[_0xf2dd('0x47')],{'$or':_[_0xf2dd('0x34')](_0x3a1100,function(_0x12370a){if(_0x12370a[_0xf2dd('0x38')]!==_0xf2dd('0x49')){var _0x330aa0={};_0x330aa0[_0x12370a[_0xf2dd('0x32')]]={'$like':'%'+_0x15d404[_0xf2dd('0x3b')]['filter']+'%'};return _0x330aa0;}})});}_0x393686=_[_0xf2dd('0x48')]({},_0x393686,_0x15d404[_0xf2dd('0x4a')]);var _0x5f5ac4={'where':_0x393686[_0xf2dd('0x47')]};return db['ChatMessage'][_0xf2dd('0x2b')](_0x5f5ac4)['then'](function(_0x5e0d99){_0xb4c626[_0xf2dd('0x2b')]=_0x5e0d99;if(_0x15d404[_0xf2dd('0x3b')]['includeAll']){_0x393686[_0xf2dd('0x4b')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x393686);})['then'](function(_0x8ab571){_0xb4c626[_0xf2dd('0x4c')]=_0x8ab571;return _0xb4c626;})[_0xf2dd('0x4d')](respondWithFilteredResult(_0x5dacc7,_0x393686))[_0xf2dd('0x23')](handleError(_0x5dacc7,null));};exports[_0xf2dd('0x4e')]=function(_0x3e4e26,_0x27dbd0){var _0x1ade53={'raw':!![],'where':{'id':_0x3e4e26[_0xf2dd('0x4f')]['id']}},_0x204fc5={};_0x204fc5[_0xf2dd('0x3a')]=_[_0xf2dd('0x3c')](db[_0xf2dd('0x35')][_0xf2dd('0x36')]);_0x204fc5[_0xf2dd('0x3b')]=_[_0xf2dd('0x3c')](_0x3e4e26[_0xf2dd('0x3b')]);_0x204fc5[_0xf2dd('0x3d')]=_['intersection'](_0x204fc5[_0xf2dd('0x3a')],_0x204fc5['query']);_0x1ade53[_0xf2dd('0x3f')]=_[_0xf2dd('0x3e')](_0x204fc5['model'],qs['fields'](_0x3e4e26[_0xf2dd('0x3b')]['fields']));_0x1ade53[_0xf2dd('0x3f')]=_0x1ade53['attributes'][_0xf2dd('0x50')]?_0x1ade53[_0xf2dd('0x3f')]:_0x204fc5[_0xf2dd('0x3a')];if(_0x3e4e26[_0xf2dd('0x3b')][_0xf2dd('0x51')]){_0x1ade53[_0xf2dd('0x4b')]=[{'all':!![]}];}_0x1ade53=_[_0xf2dd('0x48')]({},_0x1ade53,_0x3e4e26[_0xf2dd('0x4a')]);return db[_0xf2dd('0x35')][_0xf2dd('0x52')](_0x1ade53)[_0xf2dd('0x4d')](handleEntityNotFound(_0x27dbd0,null))['then'](respondWithResult(_0x27dbd0,null))[_0xf2dd('0x23')](handleError(_0x27dbd0,null));};exports['create']=function(_0x27f1a9,_0x196abc){return db[_0xf2dd('0x35')][_0xf2dd('0x53')](_0x27f1a9[_0xf2dd('0x54')],{})[_0xf2dd('0x4d')](respondWithResult(_0x196abc,0xc9))[_0xf2dd('0x23')](handleError(_0x196abc,null));};exports['update']=function(_0x786848,_0x391d93){if(_0x786848['body']['id']){delete _0x786848['body']['id'];}return db[_0xf2dd('0x35')][_0xf2dd('0x52')]({'where':{'id':_0x786848[_0xf2dd('0x4f')]['id']}})['then'](handleEntityNotFound(_0x391d93,null))[_0xf2dd('0x4d')](saveUpdates(_0x786848[_0xf2dd('0x54')],null))['then'](respondWithResult(_0x391d93,null))[_0xf2dd('0x23')](handleError(_0x391d93,null));};exports[_0xf2dd('0x30')]=function(_0x52d2ab,_0x101357){return db[_0xf2dd('0x35')][_0xf2dd('0x52')]({'where':{'id':_0x52d2ab[_0xf2dd('0x4f')]['id']}})[_0xf2dd('0x4d')](handleEntityNotFound(_0x101357,null))[_0xf2dd('0x4d')](removeEntity(_0x101357,null))[_0xf2dd('0x23')](handleError(_0x101357,null));};exports[_0xf2dd('0x55')]=function(_0x289691,_0x17e2f1){return db['ChatMessage'][_0xf2dd('0x55')]()[_0xf2dd('0x4d')](respondWithResult(_0x17e2f1,null))[_0xf2dd('0x23')](handleError(_0x17e2f1,null));};var interaction_log=require(_0xf2dd('0xe'))(_0xf2dd('0x56'));exports[_0xf2dd('0x57')]=function(_0x548cc5,_0x52a224,_0x233791){var _0x7f1064={'agent':{},'channel':'chat'};if(_0x548cc5[_0xf2dd('0x54')]['id']){delete _0x548cc5[_0xf2dd('0x54')]['id'];}_0x548cc5[_0xf2dd('0x54')][_0xf2dd('0x58')]=!![];_0x548cc5[_0xf2dd('0x54')][_0xf2dd('0x59')]=moment()[_0xf2dd('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x548cc5[_0xf2dd('0x54')][_0xf2dd('0x5b')]=_0x548cc5['body'][_0xf2dd('0x5b')]||_0x548cc5['user']['id'];_0x7f1064[_0xf2dd('0x5c')]['id']=_0x548cc5[_0xf2dd('0x54')][_0xf2dd('0x5b')];return db[_0xf2dd('0x35')][_0xf2dd('0x52')]({'where':{'id':_0x548cc5[_0xf2dd('0x4f')]['id'],'UserId':null},'include':[{'model':db[_0xf2dd('0x5d')],'as':_0xf2dd('0x5e')}]})[_0xf2dd('0x4d')](handleEntityNotFound(_0x52a224,null))['then'](saveUpdates(_0x548cc5[_0xf2dd('0x54')],null))[_0xf2dd('0x4d')](function(_0x316b8c){if(_0x316b8c){_0x7f1064['message']=_0x316b8c[_0xf2dd('0x5f')]({'plain':!![]});return db[_0xf2dd('0x60')]['find']({'where':{'id':_0x316b8c[_0xf2dd('0x61')]}});}return null;})[_0xf2dd('0x4d')](handleEntityNotFound(_0x52a224,null))[_0xf2dd('0x4d')](function(_0x377218){if(_0x377218){return _0x377218[_0xf2dd('0x2f')]({'UserId':_0x548cc5[_0xf2dd('0x54')][_0xf2dd('0x5b')],'read1stAt':_[_0xf2dd('0x62')](_0x377218[_0xf2dd('0x63')])?moment()['format'](_0xf2dd('0x64')):undefined});}return null;})[_0xf2dd('0x4d')](function(_0x2d72a1){if(_0x2d72a1){_0x7f1064[_0xf2dd('0x65')]=_0x2d72a1[_0xf2dd('0x5f')]({'plain':!![]});interaction_log[_0xf2dd('0x21')](_0xf2dd('0x66'),_0x548cc5['user']['id'],_0x548cc5[_0xf2dd('0x67')][_0xf2dd('0x32')],_0x548cc5['user'][_0xf2dd('0x68')],_0x7f1064[_0xf2dd('0x65')]['id'],_0x548cc5[_0xf2dd('0x54')]?JSON['stringify'](_0x548cc5[_0xf2dd('0x54')]):_0xf2dd('0x69'));return respondWithRpcPromise(_0xf2dd('0x6a'),_0xf2dd('0x6b'),_0x7f1064);}return null;})[_0xf2dd('0x4d')](function(_0xeb93d0){return db[_0xf2dd('0x5d')][_0xf2dd('0x55')]()['then'](function(_0x5ea7cf){var _0x3d5a41=[];for(var _0x4875e7=0x0;_0x4875e7=_0x1fc439){_0x2d2ca0=_0x1fc439;_0x337fdd=0xc8;}else{_0x337fdd=0xce;}_0xfc6130[_0xed71('0x2d')](_0x337fdd);return _0xfc6130['set'](_0xed71('0x34'),_0x4c610e+'-'+_0x2d2ca0+'/'+_0x1fc439)[_0xed71('0x2f')](_0x296daf);}return null;};}function patchUpdates(_0x5cc24e){return function(_0x5656a9){try{jsonpatch[_0xed71('0x35')](_0x5656a9,_0x5cc24e,!![]);}catch(_0x1a918b){return BPromise[_0xed71('0x36')](_0x1a918b);}return _0x5656a9[_0xed71('0x37')]();};}function saveUpdates(_0x4479da,_0x3e44c5){return function(_0x53274){if(_0x53274){return _0x53274[_0xed71('0x38')](_0x4479da)[_0xed71('0x22')](function(_0x3d5a9f){return _0x3d5a9f;});}return null;};}function removeEntity(_0x156a08,_0x2b0593){return function(_0x1e9588){if(_0x1e9588){return _0x1e9588[_0xed71('0x39')]()[_0xed71('0x22')](function(){_0x156a08[_0xed71('0x2d')](0xcc)[_0xed71('0x2e')]();});}};}function handleEntityNotFound(_0x4f86df,_0x115b2f){return function(_0x13ab0d){if(!_0x13ab0d){_0x4f86df[_0xed71('0x2c')](0x194);}return _0x13ab0d;};}function handleError(_0x3a29f8,_0x3d0d87){_0x3d0d87=_0x3d0d87||0x1f4;return function(_0x4a5498){logger[_0xed71('0x27')](_0x4a5498['stack']);if(_0x4a5498[_0xed71('0x3a')]){delete _0x4a5498[_0xed71('0x3a')];}_0x3a29f8[_0xed71('0x2d')](_0x3d0d87)[_0xed71('0x3b')](_0x4a5498);};}exports[_0xed71('0x3c')]=function(_0x2e82cc,_0xb29b44){var _0x5207cc={},_0x3d7b58={},_0x17c239={'count':0x0,'rows':[]};var _0x841e48=_['map'](db[_0xed71('0x3d')][_0xed71('0x3e')],function(_0x115f58){return{'name':_0x115f58[_0xed71('0x3f')],'type':_0x115f58['type'][_0xed71('0x40')]};});_0x3d7b58[_0xed71('0x41')]=_['map'](_0x841e48,'name');_0x3d7b58['query']=_[_0xed71('0x42')](_0x2e82cc[_0xed71('0x43')]);_0x3d7b58[_0xed71('0x44')]=_[_0xed71('0x45')](_0x3d7b58[_0xed71('0x41')],_0x3d7b58[_0xed71('0x43')]);_0x5207cc[_0xed71('0x46')]=_[_0xed71('0x45')](_0x3d7b58[_0xed71('0x41')],qs['fields'](_0x2e82cc['query'][_0xed71('0x47')]));_0x5207cc[_0xed71('0x46')]=_0x5207cc['attributes'][_0xed71('0x48')]?_0x5207cc[_0xed71('0x46')]:_0x3d7b58[_0xed71('0x41')];if(!_0x2e82cc[_0xed71('0x43')][_0xed71('0x49')]('nolimit')){_0x5207cc['limit']=qs[_0xed71('0x32')](_0x2e82cc[_0xed71('0x43')][_0xed71('0x32')]);_0x5207cc[_0xed71('0x30')]=qs[_0xed71('0x30')](_0x2e82cc[_0xed71('0x43')][_0xed71('0x30')]);}_0x5207cc[_0xed71('0x4a')]=qs[_0xed71('0x4b')](_0x2e82cc[_0xed71('0x43')]['sort']);_0x5207cc[_0xed71('0x4c')]=qs[_0xed71('0x44')](_[_0xed71('0x4d')](_0x2e82cc[_0xed71('0x43')],_0x3d7b58[_0xed71('0x44')]),_0x841e48);if(_0x2e82cc[_0xed71('0x43')][_0xed71('0x4e')]){_0x5207cc[_0xed71('0x4c')]=_[_0xed71('0x4f')](_0x5207cc[_0xed71('0x4c')],{'$or':_[_0xed71('0x50')](_0x841e48,function(_0x2bf9e9){if(_0x2bf9e9['type']!==_0xed71('0x51')){var _0x533223={};_0x533223[_0x2bf9e9['name']]={'$like':'%'+_0x2e82cc[_0xed71('0x43')][_0xed71('0x4e')]+'%'};return _0x533223;}})});}_0x5207cc=_[_0xed71('0x4f')]({},_0x5207cc,_0x2e82cc['options']);var _0x388d8b={'where':_0x5207cc[_0xed71('0x4c')]};return db[_0xed71('0x3d')][_0xed71('0x33')](_0x388d8b)[_0xed71('0x22')](function(_0x2e1be1){_0x17c239[_0xed71('0x33')]=_0x2e1be1;if(_0x2e82cc['query'][_0xed71('0x52')]){_0x5207cc['include']=[{'all':!![]}];}return db[_0xed71('0x3d')][_0xed71('0x53')](_0x5207cc);})[_0xed71('0x22')](function(_0xe436e0){_0x17c239[_0xed71('0x54')]=_0xe436e0;return _0x17c239;})[_0xed71('0x22')](respondWithFilteredResult(_0xb29b44,_0x5207cc))['catch'](handleError(_0xb29b44,null));};exports[_0xed71('0x55')]=function(_0x369b6a,_0x138ee1){var _0x1f3b53={'raw':!![],'where':{'id':_0x369b6a[_0xed71('0x56')]['id']}},_0xc5a87={};_0xc5a87[_0xed71('0x41')]=_[_0xed71('0x42')](db[_0xed71('0x3d')][_0xed71('0x3e')]);_0xc5a87[_0xed71('0x43')]=_[_0xed71('0x42')](_0x369b6a[_0xed71('0x43')]);_0xc5a87[_0xed71('0x44')]=_[_0xed71('0x45')](_0xc5a87[_0xed71('0x41')],_0xc5a87['query']);_0x1f3b53[_0xed71('0x46')]=_[_0xed71('0x45')](_0xc5a87[_0xed71('0x41')],qs[_0xed71('0x47')](_0x369b6a[_0xed71('0x43')][_0xed71('0x47')]));_0x1f3b53[_0xed71('0x46')]=_0x1f3b53[_0xed71('0x46')][_0xed71('0x48')]?_0x1f3b53['attributes']:_0xc5a87['model'];if(_0x369b6a['query'][_0xed71('0x52')]){_0x1f3b53[_0xed71('0x57')]=[{'all':!![]}];}_0x1f3b53=_['merge']({},_0x1f3b53,_0x369b6a['options']);return db[_0xed71('0x3d')][_0xed71('0x58')](_0x1f3b53)[_0xed71('0x22')](handleEntityNotFound(_0x138ee1,null))[_0xed71('0x22')](respondWithResult(_0x138ee1,null))['catch'](handleError(_0x138ee1,null));};exports[_0xed71('0x59')]=function(_0x2248d9,_0x1b8d32){return db[_0xed71('0x3d')][_0xed71('0x59')](_0x2248d9[_0xed71('0x5a')],{})[_0xed71('0x22')](respondWithResult(_0x1b8d32,0xc9))[_0xed71('0x2b')](handleError(_0x1b8d32,null));};exports[_0xed71('0x38')]=function(_0x1d5f99,_0x4bf3f1){if(_0x1d5f99[_0xed71('0x5a')]['id']){delete _0x1d5f99[_0xed71('0x5a')]['id'];}return db[_0xed71('0x3d')][_0xed71('0x58')]({'where':{'id':_0x1d5f99['params']['id']}})['then'](handleEntityNotFound(_0x4bf3f1,null))[_0xed71('0x22')](saveUpdates(_0x1d5f99[_0xed71('0x5a')],null))['then'](respondWithResult(_0x4bf3f1,null))[_0xed71('0x2b')](handleError(_0x4bf3f1,null));};exports[_0xed71('0x39')]=function(_0x566846,_0x579a4b){return db[_0xed71('0x3d')][_0xed71('0x58')]({'where':{'id':_0x566846[_0xed71('0x56')]['id']}})['then'](handleEntityNotFound(_0x579a4b,null))[_0xed71('0x22')](removeEntity(_0x579a4b,null))[_0xed71('0x2b')](handleError(_0x579a4b,null));};exports[_0xed71('0x5b')]=function(_0x4dca18,_0x97dc40){return db[_0xed71('0x3d')][_0xed71('0x5b')]()[_0xed71('0x22')](respondWithResult(_0x97dc40,null))['catch'](handleError(_0x97dc40,null));};var interaction_log=require(_0xed71('0x15'))(_0xed71('0x5c'));exports[_0xed71('0x5d')]=function(_0xa6ec89,_0x598b71,_0x66ab60){var _0x5279e9={'agent':{},'channel':_0xed71('0x5e')};if(_0xa6ec89[_0xed71('0x5a')]['id']){delete _0xa6ec89[_0xed71('0x5a')]['id'];}_0xa6ec89[_0xed71('0x5a')][_0xed71('0x5f')]=!![];_0xa6ec89[_0xed71('0x5a')][_0xed71('0x60')]=moment()['format'](_0xed71('0x61'));_0xa6ec89[_0xed71('0x5a')][_0xed71('0x62')]=_0xa6ec89[_0xed71('0x5a')]['UserId']||_0xa6ec89[_0xed71('0x63')]['id'];_0x5279e9[_0xed71('0x64')]['id']=_0xa6ec89[_0xed71('0x5a')][_0xed71('0x62')];return db['ChatMessage']['find']({'where':{'id':_0xa6ec89['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xed71('0x65')}]})[_0xed71('0x22')](handleEntityNotFound(_0x598b71,null))[_0xed71('0x22')](saveUpdates(_0xa6ec89[_0xed71('0x5a')],null))[_0xed71('0x22')](function(_0x7e7be1){if(_0x7e7be1){_0x5279e9['message']=_0x7e7be1['get']({'plain':!![]});return db[_0xed71('0x66')][_0xed71('0x58')]({'where':{'id':_0x7e7be1[_0xed71('0x67')]}});}return null;})[_0xed71('0x22')](handleEntityNotFound(_0x598b71,null))[_0xed71('0x22')](function(_0x233b4a){if(_0x233b4a){return _0x233b4a['update']({'UserId':_0xa6ec89[_0xed71('0x5a')][_0xed71('0x62')],'read1stAt':_[_0xed71('0x68')](_0x233b4a[_0xed71('0x69')])?moment()[_0xed71('0x6a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2b8250){if(_0x2b8250){_0x5279e9[_0xed71('0x6b')]=_0x2b8250[_0xed71('0x6c')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa6ec89[_0xed71('0x63')]['id'],_0xa6ec89[_0xed71('0x63')][_0xed71('0x3a')],_0xa6ec89[_0xed71('0x63')][_0xed71('0x6d')],_0x5279e9['interaction']['id'],_0xa6ec89[_0xed71('0x5a')]?JSON[_0xed71('0x26')](_0xa6ec89[_0xed71('0x5a')]):_0xed71('0x6e'));return respondWithRpcPromise(_0xed71('0x6f'),_0xed71('0x70'),_0x5279e9);}return null;})[_0xed71('0x22')](function(_0x1df1b9){return db['CmContact'][_0xed71('0x5b')]()[_0xed71('0x22')](function(_0x1e8872){var _0x1ad5f1=[];for(var _0x2bcd3c=0x0;_0x2bcd3c=_0x28e37b){_0x1a50bd=_0x28e37b;_0x1576c2=0xc8;}else{_0x1576c2=0xce;}_0xdee385[_0x4722('0x1c')](_0x1576c2);return _0xdee385['set']('Content-Range',_0x334798+'-'+_0x1a50bd+'/'+_0x28e37b)[_0x4722('0x1d')](_0x32e858);}return null;};}function patchUpdates(_0x407ceb){return function(_0x3e3686){try{jsonpatch[_0x4722('0x22')](_0x3e3686,_0x407ceb,!![]);}catch(_0xd1f4e9){return BPromise['reject'](_0xd1f4e9);}return _0x3e3686[_0x4722('0x23')]();};}function saveUpdates(_0x3a29ee,_0x3efe8b){return function(_0x3df7b5){if(_0x3df7b5){return _0x3df7b5[_0x4722('0x24')](_0x3a29ee)['then'](function(_0x24cc58){return _0x24cc58;});}return null;};}function removeEntity(_0x23f774,_0x4502b0){return function(_0x3b0da3){if(_0x3b0da3){return _0x3b0da3[_0x4722('0x25')]()[_0x4722('0x26')](function(){_0x23f774[_0x4722('0x1c')](0xcc)[_0x4722('0x27')]();});}};}function handleEntityNotFound(_0xb7eb05,_0x245712){return function(_0x38debe){if(!_0x38debe){_0xb7eb05[_0x4722('0x1b')](0x194);}return _0x38debe;};}function handleError(_0x5cfd13,_0x117da6){_0x117da6=_0x117da6||0x1f4;return function(_0x38f709){logger[_0x4722('0x28')](_0x38f709[_0x4722('0x29')]);if(_0x38f709['name']){delete _0x38f709[_0x4722('0x2a')];}_0x5cfd13[_0x4722('0x1c')](_0x117da6)[_0x4722('0x2b')](_0x38f709);};}exports['index']=function(_0x36a655,_0x2f6702){var _0x5933dc={},_0x20b418={},_0x284df5={'count':0x0,'rows':[]};var _0x5a91aa=_[_0x4722('0x2c')](db['ChatOfflineMessage'][_0x4722('0x2d')],function(_0x1eb019){return{'name':_0x1eb019[_0x4722('0x2e')],'type':_0x1eb019[_0x4722('0x2f')][_0x4722('0x30')]};});_0x20b418['model']=_[_0x4722('0x2c')](_0x5a91aa,'name');_0x20b418[_0x4722('0x31')]=_[_0x4722('0x32')](_0x36a655[_0x4722('0x31')]);_0x20b418['filters']=_[_0x4722('0x33')](_0x20b418[_0x4722('0x34')],_0x20b418[_0x4722('0x31')]);_0x5933dc['attributes']=_[_0x4722('0x33')](_0x20b418['model'],qs[_0x4722('0x35')](_0x36a655['query'][_0x4722('0x35')]));_0x5933dc[_0x4722('0x36')]=_0x5933dc[_0x4722('0x36')]['length']?_0x5933dc[_0x4722('0x36')]:_0x20b418['model'];if(!_0x36a655[_0x4722('0x31')][_0x4722('0x37')](_0x4722('0x38'))){_0x5933dc[_0x4722('0x20')]=qs[_0x4722('0x20')](_0x36a655[_0x4722('0x31')][_0x4722('0x20')]);_0x5933dc[_0x4722('0x1e')]=qs['offset'](_0x36a655[_0x4722('0x31')][_0x4722('0x1e')]);}_0x5933dc[_0x4722('0x39')]=qs[_0x4722('0x3a')](_0x36a655[_0x4722('0x31')][_0x4722('0x3a')]);_0x5933dc[_0x4722('0x3b')]=qs[_0x4722('0x3c')](_[_0x4722('0x3d')](_0x36a655[_0x4722('0x31')],_0x20b418['filters']),_0x5a91aa);if(_0x36a655[_0x4722('0x31')][_0x4722('0x3e')]){_0x5933dc[_0x4722('0x3b')]=_[_0x4722('0x3f')](_0x5933dc['where'],{'$or':_[_0x4722('0x2c')](_0x5a91aa,function(_0x12c1f4){if(_0x12c1f4[_0x4722('0x2f')]!==_0x4722('0x40')){var _0x15da1a={};_0x15da1a[_0x12c1f4[_0x4722('0x2a')]]={'$like':'%'+_0x36a655[_0x4722('0x31')][_0x4722('0x3e')]+'%'};return _0x15da1a;}})});}_0x5933dc=_[_0x4722('0x3f')]({},_0x5933dc,_0x36a655[_0x4722('0x41')]);var _0x348d69={'where':_0x5933dc[_0x4722('0x3b')]};return db[_0x4722('0x42')][_0x4722('0x21')](_0x348d69)[_0x4722('0x26')](function(_0x37179d){_0x284df5[_0x4722('0x21')]=_0x37179d;if(_0x36a655['query'][_0x4722('0x43')]){_0x5933dc[_0x4722('0x44')]=[{'all':!![]}];}return db['ChatOfflineMessage']['findAll'](_0x5933dc);})['then'](function(_0x2d0343){_0x284df5['rows']=_0x2d0343;return _0x284df5;})[_0x4722('0x26')](respondWithFilteredResult(_0x2f6702,_0x5933dc))[_0x4722('0x45')](handleError(_0x2f6702,null));};exports['show']=function(_0x112324,_0x29d824){var _0x2eace8={'raw':!![],'where':{'id':_0x112324[_0x4722('0x46')]['id']}},_0x21a32c={};_0x21a32c['model']=_[_0x4722('0x32')](db[_0x4722('0x42')][_0x4722('0x2d')]);_0x21a32c[_0x4722('0x31')]=_[_0x4722('0x32')](_0x112324['query']);_0x21a32c['filters']=_[_0x4722('0x33')](_0x21a32c['model'],_0x21a32c[_0x4722('0x31')]);_0x2eace8[_0x4722('0x36')]=_[_0x4722('0x33')](_0x21a32c['model'],qs[_0x4722('0x35')](_0x112324[_0x4722('0x31')][_0x4722('0x35')]));_0x2eace8[_0x4722('0x36')]=_0x2eace8[_0x4722('0x36')]['length']?_0x2eace8[_0x4722('0x36')]:_0x21a32c[_0x4722('0x34')];if(_0x112324[_0x4722('0x31')][_0x4722('0x43')]){_0x2eace8[_0x4722('0x44')]=[{'all':!![]}];}_0x2eace8=_[_0x4722('0x3f')]({},_0x2eace8,_0x112324['options']);return db['ChatOfflineMessage'][_0x4722('0x47')](_0x2eace8)[_0x4722('0x26')](handleEntityNotFound(_0x29d824,null))['then'](respondWithResult(_0x29d824,null))[_0x4722('0x45')](handleError(_0x29d824,null));};exports[_0x4722('0x48')]=function(_0x3495ac,_0x55db1b){return db['ChatOfflineMessage']['create'](_0x3495ac[_0x4722('0x49')],{})[_0x4722('0x26')](respondWithResult(_0x55db1b,0xc9))[_0x4722('0x45')](handleError(_0x55db1b,null));};exports[_0x4722('0x24')]=function(_0x1a0216,_0x1e5f3b){if(_0x1a0216[_0x4722('0x49')]['id']){delete _0x1a0216[_0x4722('0x49')]['id'];}return db[_0x4722('0x42')][_0x4722('0x47')]({'where':{'id':_0x1a0216[_0x4722('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e5f3b,null))[_0x4722('0x26')](saveUpdates(_0x1a0216[_0x4722('0x49')],null))[_0x4722('0x26')](respondWithResult(_0x1e5f3b,null))[_0x4722('0x45')](handleError(_0x1e5f3b,null));};exports[_0x4722('0x25')]=function(_0xadd448,_0x15fbd6){return db[_0x4722('0x4a')][_0x4722('0x4b')]({'where':{'ChatOfflineMessageId':_0xadd448['params']['id']},'raw':!![]})[_0x4722('0x26')](function(_0x1d3ebe){_0x1d3ebe[_0x4722('0x4c')](function(_0xb1c0ec){var _0x1865cd=path[_0x4722('0x4d')](config[_0x4722('0x4e')],_0x4722('0x4f'),_0x4722('0x50'),_0x4722('0x51'),_0x4722('0x52'),_0xb1c0ec[_0x4722('0x53')]);var _0x49ed0a=fs[_0x4722('0x54')](_0x1865cd);if(_0x49ed0a)fs_extra[_0x4722('0x55')](_0x1865cd);});})[_0x4722('0x26')](function(){return db[_0x4722('0x42')][_0x4722('0x47')]({'where':{'id':_0xadd448['params']['id']},'individualHooks':!![]});})[_0x4722('0x26')](handleEntityNotFound(_0x15fbd6,null))[_0x4722('0x26')](removeEntity(_0x15fbd6,null))[_0x4722('0x45')](handleError(_0x15fbd6,null));};exports[_0x4722('0x56')]=function(_0x5b66e2,_0xb783c6){return db[_0x4722('0x42')][_0x4722('0x56')]()['then'](respondWithResult(_0xb783c6,null))[_0x4722('0x45')](handleError(_0xb783c6,null));}; \ No newline at end of file +var _0xee80=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','offset','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','key','model','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','ChatOfflineMessage','count','includeAll','include','rows','catch','show','params','keys','create','body','find','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x3f0553,_0x1ee7d8){var _0x185007=function(_0x47adc1){while(--_0x47adc1){_0x3f0553['push'](_0x3f0553['shift']());}};_0x185007(++_0x1ee7d8);}(_0xee80,0x1ef));var _0x0ee8=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xee80[_0x368fb9];return _0x4892fb;};'use strict';var emlformat=require(_0x0ee8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0ee8('0x1'));var jsonpatch=require(_0x0ee8('0x2'));var rp=require(_0x0ee8('0x3'));var moment=require(_0x0ee8('0x4'));var BPromise=require(_0x0ee8('0x5'));var Mustache=require(_0x0ee8('0x6'));var util=require(_0x0ee8('0x7'));var path=require(_0x0ee8('0x8'));var sox=require('sox');var csv=require(_0x0ee8('0x9'));var ejs=require(_0x0ee8('0xa'));var fs=require('fs');var fs_extra=require(_0x0ee8('0xb'));var _=require(_0x0ee8('0xc'));var squel=require(_0x0ee8('0xd'));var crypto=require(_0x0ee8('0xe'));var jsforce=require(_0x0ee8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0ee8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0ee8('0x10'));var authService=require(_0x0ee8('0x11'));var qs=require(_0x0ee8('0x12'));var as=require(_0x0ee8('0x13'));var hardwareService=require(_0x0ee8('0x14'));var logger=require(_0x0ee8('0x15'))(_0x0ee8('0x16'));var utils=require('../../config/utils');var config=require(_0x0ee8('0x17'));var licenseUtil=require(_0x0ee8('0x18'));var db=require(_0x0ee8('0x19'))['db'];function respondWithStatusCode(_0xe5d8b3,_0x2b7617){_0x2b7617=_0x2b7617||0xcc;return function(_0x4db126){if(_0x4db126){return _0xe5d8b3['sendStatus'](_0x2b7617);}return _0xe5d8b3[_0x0ee8('0x1a')](_0x2b7617)[_0x0ee8('0x1b')]();};}function respondWithResult(_0x34177d,_0x158274){_0x158274=_0x158274||0xc8;return function(_0x2df8e8){if(_0x2df8e8){return _0x34177d[_0x0ee8('0x1a')](_0x158274)['json'](_0x2df8e8);}};}function respondWithFilteredResult(_0x4c14ff,_0x25a548){return function(_0x151579){if(_0x151579){var _0x281de4=typeof _0x25a548['offset']===_0x0ee8('0x1c')&&typeof _0x25a548[_0x0ee8('0x1d')]==='undefined';var _0x4fb352=_0x151579['count'];var _0xe616dc=_0x281de4?0x0:_0x25a548[_0x0ee8('0x1e')];var _0x38814e=_0x281de4?_0x151579['count']:_0x25a548[_0x0ee8('0x1e')]+_0x25a548[_0x0ee8('0x1d')];var _0x3aa805;if(_0x38814e>=_0x4fb352){_0x38814e=_0x4fb352;_0x3aa805=0xc8;}else{_0x3aa805=0xce;}_0x4c14ff[_0x0ee8('0x1a')](_0x3aa805);return _0x4c14ff['set'](_0x0ee8('0x1f'),_0xe616dc+'-'+_0x38814e+'/'+_0x4fb352)['json'](_0x151579);}return null;};}function patchUpdates(_0x20ecba){return function(_0x4c84b0){try{jsonpatch[_0x0ee8('0x20')](_0x4c84b0,_0x20ecba,!![]);}catch(_0x497a38){return BPromise[_0x0ee8('0x21')](_0x497a38);}return _0x4c84b0[_0x0ee8('0x22')]();};}function saveUpdates(_0x155a34,_0x1e20d1){return function(_0x1f6e64){if(_0x1f6e64){return _0x1f6e64['update'](_0x155a34)[_0x0ee8('0x23')](function(_0x47f6cb){return _0x47f6cb;});}return null;};}function removeEntity(_0x36bed0,_0xb61956){return function(_0x599187){if(_0x599187){return _0x599187[_0x0ee8('0x24')]()['then'](function(){_0x36bed0[_0x0ee8('0x1a')](0xcc)[_0x0ee8('0x1b')]();});}};}function handleEntityNotFound(_0x506a32,_0x1aab4b){return function(_0x176217){if(!_0x176217){_0x506a32['sendStatus'](0x194);}return _0x176217;};}function handleError(_0x3f07ee,_0x55d6e6){_0x55d6e6=_0x55d6e6||0x1f4;return function(_0x5dab56){logger[_0x0ee8('0x25')](_0x5dab56['stack']);if(_0x5dab56[_0x0ee8('0x26')]){delete _0x5dab56[_0x0ee8('0x26')];}_0x3f07ee[_0x0ee8('0x1a')](_0x55d6e6)[_0x0ee8('0x27')](_0x5dab56);};}exports[_0x0ee8('0x28')]=function(_0x3e3373,_0x2fd1dc){var _0xd7940c={},_0x33af28={},_0x13898c={'count':0x0,'rows':[]};var _0x38447e=_[_0x0ee8('0x29')](db['ChatOfflineMessage'][_0x0ee8('0x2a')],function(_0x510add){return{'name':_0x510add['fieldName'],'type':_0x510add['type'][_0x0ee8('0x2b')]};});_0x33af28[_0x0ee8('0x2c')]=_[_0x0ee8('0x29')](_0x38447e,'name');_0x33af28['query']=_['keys'](_0x3e3373['query']);_0x33af28['filters']=_[_0x0ee8('0x2d')](_0x33af28[_0x0ee8('0x2c')],_0x33af28[_0x0ee8('0x2e')]);_0xd7940c['attributes']=_[_0x0ee8('0x2d')](_0x33af28['model'],qs[_0x0ee8('0x2f')](_0x3e3373[_0x0ee8('0x2e')][_0x0ee8('0x2f')]));_0xd7940c[_0x0ee8('0x30')]=_0xd7940c[_0x0ee8('0x30')][_0x0ee8('0x31')]?_0xd7940c[_0x0ee8('0x30')]:_0x33af28[_0x0ee8('0x2c')];if(!_0x3e3373[_0x0ee8('0x2e')][_0x0ee8('0x32')](_0x0ee8('0x33'))){_0xd7940c[_0x0ee8('0x1d')]=qs[_0x0ee8('0x1d')](_0x3e3373['query'][_0x0ee8('0x1d')]);_0xd7940c[_0x0ee8('0x1e')]=qs[_0x0ee8('0x1e')](_0x3e3373['query']['offset']);}_0xd7940c[_0x0ee8('0x34')]=qs[_0x0ee8('0x35')](_0x3e3373['query'][_0x0ee8('0x35')]);_0xd7940c['where']=qs[_0x0ee8('0x36')](_[_0x0ee8('0x37')](_0x3e3373[_0x0ee8('0x2e')],_0x33af28[_0x0ee8('0x36')]),_0x38447e);if(_0x3e3373[_0x0ee8('0x2e')]['filter']){_0xd7940c[_0x0ee8('0x38')]=_[_0x0ee8('0x39')](_0xd7940c['where'],{'$or':_[_0x0ee8('0x29')](_0x38447e,function(_0xf51b39){if(_0xf51b39['type']!==_0x0ee8('0x3a')){var _0x3d7ba1={};_0x3d7ba1[_0xf51b39[_0x0ee8('0x26')]]={'$like':'%'+_0x3e3373[_0x0ee8('0x2e')][_0x0ee8('0x3b')]+'%'};return _0x3d7ba1;}})});}_0xd7940c=_[_0x0ee8('0x39')]({},_0xd7940c,_0x3e3373[_0x0ee8('0x3c')]);var _0x4a96d7={'where':_0xd7940c[_0x0ee8('0x38')]};return db[_0x0ee8('0x3d')][_0x0ee8('0x3e')](_0x4a96d7)[_0x0ee8('0x23')](function(_0x432f44){_0x13898c[_0x0ee8('0x3e')]=_0x432f44;if(_0x3e3373[_0x0ee8('0x2e')][_0x0ee8('0x3f')]){_0xd7940c[_0x0ee8('0x40')]=[{'all':!![]}];}return db['ChatOfflineMessage']['findAll'](_0xd7940c);})[_0x0ee8('0x23')](function(_0x1accb1){_0x13898c[_0x0ee8('0x41')]=_0x1accb1;return _0x13898c;})[_0x0ee8('0x23')](respondWithFilteredResult(_0x2fd1dc,_0xd7940c))[_0x0ee8('0x42')](handleError(_0x2fd1dc,null));};exports[_0x0ee8('0x43')]=function(_0x56a404,_0x303259){var _0x418d71={'raw':!![],'where':{'id':_0x56a404[_0x0ee8('0x44')]['id']}},_0x18c535={};_0x18c535[_0x0ee8('0x2c')]=_[_0x0ee8('0x45')](db[_0x0ee8('0x3d')][_0x0ee8('0x2a')]);_0x18c535[_0x0ee8('0x2e')]=_['keys'](_0x56a404[_0x0ee8('0x2e')]);_0x18c535['filters']=_['intersection'](_0x18c535[_0x0ee8('0x2c')],_0x18c535['query']);_0x418d71['attributes']=_[_0x0ee8('0x2d')](_0x18c535['model'],qs['fields'](_0x56a404[_0x0ee8('0x2e')][_0x0ee8('0x2f')]));_0x418d71[_0x0ee8('0x30')]=_0x418d71[_0x0ee8('0x30')]['length']?_0x418d71[_0x0ee8('0x30')]:_0x18c535[_0x0ee8('0x2c')];if(_0x56a404[_0x0ee8('0x2e')][_0x0ee8('0x3f')]){_0x418d71[_0x0ee8('0x40')]=[{'all':!![]}];}_0x418d71=_[_0x0ee8('0x39')]({},_0x418d71,_0x56a404[_0x0ee8('0x3c')]);return db[_0x0ee8('0x3d')]['find'](_0x418d71)[_0x0ee8('0x23')](handleEntityNotFound(_0x303259,null))['then'](respondWithResult(_0x303259,null))[_0x0ee8('0x42')](handleError(_0x303259,null));};exports[_0x0ee8('0x46')]=function(_0x4fe295,_0x510bff){return db[_0x0ee8('0x3d')][_0x0ee8('0x46')](_0x4fe295['body'],{})['then'](respondWithResult(_0x510bff,0xc9))[_0x0ee8('0x42')](handleError(_0x510bff,null));};exports['update']=function(_0x337f85,_0xa81d66){if(_0x337f85[_0x0ee8('0x47')]['id']){delete _0x337f85[_0x0ee8('0x47')]['id'];}return db[_0x0ee8('0x3d')][_0x0ee8('0x48')]({'where':{'id':_0x337f85[_0x0ee8('0x44')]['id']}})[_0x0ee8('0x23')](handleEntityNotFound(_0xa81d66,null))['then'](saveUpdates(_0x337f85[_0x0ee8('0x47')],null))[_0x0ee8('0x23')](respondWithResult(_0xa81d66,null))[_0x0ee8('0x42')](handleError(_0xa81d66,null));};exports[_0x0ee8('0x24')]=function(_0x2dde4a,_0x3fb8e7){return db['Attachment']['findAll']({'where':{'ChatOfflineMessageId':_0x2dde4a[_0x0ee8('0x44')]['id']},'raw':!![]})[_0x0ee8('0x23')](function(_0x4a954a){_0x4a954a[_0x0ee8('0x49')](function(_0x327457){var _0x4f0969=path[_0x0ee8('0x4a')](config[_0x0ee8('0x4b')],_0x0ee8('0x4c'),_0x0ee8('0x4d'),_0x0ee8('0x4e'),'offline-chat',_0x327457[_0x0ee8('0x4f')]);var _0x4cea25=fs[_0x0ee8('0x50')](_0x4f0969);if(_0x4cea25)fs_extra[_0x0ee8('0x51')](_0x4f0969);});})[_0x0ee8('0x23')](function(){return db[_0x0ee8('0x3d')][_0x0ee8('0x48')]({'where':{'id':_0x2dde4a[_0x0ee8('0x44')]['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x3fb8e7,null))[_0x0ee8('0x23')](removeEntity(_0x3fb8e7,null))[_0x0ee8('0x42')](handleError(_0x3fb8e7,null));};exports[_0x0ee8('0x52')]=function(_0x485aae,_0x149b25){return db[_0x0ee8('0x3d')][_0x0ee8('0x52')]()['then'](respondWithResult(_0x149b25,null))[_0x0ee8('0x42')](handleError(_0x149b25,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 0da83e9..4fc5fbe 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 _0xd2ea=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x267dd0,_0x45fe4c){var _0x3faa22=function(_0x16d5f0){while(--_0x16d5f0){_0x267dd0['push'](_0x267dd0['shift']());}};_0x3faa22(++_0x45fe4c);}(_0xd2ea,0x15f));var _0xad2e=function(_0x38fb0d,_0x52b5db){_0x38fb0d=_0x38fb0d-0x0;var _0x30a5d6=_0xd2ea[_0x38fb0d];return _0x30a5d6;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var fs=require('fs');var path=require(_0xad2e('0x6'));var rimraf=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var attributes=require(_0xad2e('0x9'));module[_0xad2e('0xa')]=function(_0x29e97f,_0x592e8b){return _0x29e97f[_0xad2e('0xb')](_0xad2e('0xc'),attributes,{'tableName':_0xad2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xad2e('0xe')});}; \ No newline at end of file +var _0xb66c=['rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x5e3a45,_0x45f0c5){var _0x13419f=function(_0x5ac996){while(--_0x5ac996){_0x5e3a45['push'](_0x5e3a45['shift']());}};_0x13419f(++_0x45f0c5);}(_0xb66c,0x175));var _0xcb66=function(_0x85cf5c,_0x126429){_0x85cf5c=_0x85cf5c-0x0;var _0xaf04db=_0xb66c[_0x85cf5c];return _0xaf04db;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var logger=require(_0xcb66('0x1'))('api');var moment=require(_0xcb66('0x2'));var BPromise=require(_0xcb66('0x3'));var rp=require(_0xcb66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var attributes=require(_0xcb66('0x7'));module[_0xcb66('0x8')]=function(_0x5d766d,_0x518163){return _0x5d766d[_0xcb66('0x9')](_0xcb66('0xa'),attributes,{'tableName':_0xcb66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb66('0xc'),'collate':_0xcb66('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index e83272d..5723e0e 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 _0xcadb=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4fed34,_0x137772){var _0x542a1f=function(_0xba3036){while(--_0xba3036){_0x4fed34['push'](_0x4fed34['shift']());}};_0x542a1f(++_0x137772);}(_0xcadb,0x1dd));var _0xbcad=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xcadb[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xbcad('0x0'));var util=require(_0xbcad('0x1'));var moment=require('moment');var BPromise=require(_0xbcad('0x2'));var rs=require(_0xbcad('0x3'));var fs=require('fs');var Redis=require(_0xbcad('0x4'));var db=require(_0xbcad('0x5'))['db'];var utils=require(_0xbcad('0x6'));var logger=require(_0xbcad('0x7'))(_0xbcad('0x8'));var config=require(_0xbcad('0x9'));var jayson=require(_0xbcad('0xa'));var client=jayson['client'][_0xbcad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1408e6,_0x3d5f1c,_0x252269){return new BPromise(function(_0x372c08,_0x1eb27b){return client['request'](_0x1408e6,_0x252269)['then'](function(_0x3a735f){logger[_0xbcad('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3d5f1c,_0xbcad('0xd'));logger[_0xbcad('0xe')](_0xbcad('0xf'),_0x3d5f1c,_0xbcad('0xd'),JSON[_0xbcad('0x10')](_0x3a735f));if(_0x3a735f['error']){if(_0x3a735f[_0xbcad('0x11')][_0xbcad('0x12')]===0x1f4){logger[_0xbcad('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3d5f1c,_0x3a735f[_0xbcad('0x11')]['message']);return _0x1eb27b(_0x3a735f[_0xbcad('0x11')][_0xbcad('0x13')]);}logger[_0xbcad('0x11')](_0xbcad('0x14'),_0x3d5f1c,_0x3a735f['error'][_0xbcad('0x13')]);return _0x372c08(_0x3a735f['error']['message']);}else{logger['info'](_0xbcad('0x14'),_0x3d5f1c,'request\x20sent');_0x372c08(_0x3a735f[_0xbcad('0x15')][_0xbcad('0x13')]);}})[_0xbcad('0x16')](function(_0x3fd220){logger[_0xbcad('0x11')](_0xbcad('0x14'),_0x3d5f1c,_0x3fd220);_0x1eb27b(_0x3fd220);});});} \ No newline at end of file +var _0x28bc=['ChatOfflineMessage,\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','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2a6d76,_0x4ab61c){var _0x20a712=function(_0x9b6de){while(--_0x9b6de){_0x2a6d76['push'](_0x2a6d76['shift']());}};_0x20a712(++_0x4ab61c);}(_0x28bc,0x97));var _0xc28b=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0x28bc[_0x34eb31];return _0x254994;};'use strict';var _=require(_0xc28b('0x0'));var util=require(_0xc28b('0x1'));var moment=require(_0xc28b('0x2'));var BPromise=require(_0xc28b('0x3'));var rs=require(_0xc28b('0x4'));var fs=require('fs');var Redis=require(_0xc28b('0x5'));var db=require(_0xc28b('0x6'))['db'];var utils=require(_0xc28b('0x7'));var logger=require('../../config/logger')(_0xc28b('0x8'));var config=require(_0xc28b('0x9'));var jayson=require(_0xc28b('0xa'));var client=jayson['client'][_0xc28b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55b12d,_0x2d91e5,_0x3543f2){return new BPromise(function(_0x1e573b,_0x112534){return client[_0xc28b('0xc')](_0x55b12d,_0x3543f2)['then'](function(_0x42f71a){logger[_0xc28b('0xd')](_0xc28b('0xe'),_0x2d91e5,_0xc28b('0xf'));logger[_0xc28b('0x10')](_0xc28b('0x11'),_0x2d91e5,'request\x20sent',JSON[_0xc28b('0x12')](_0x42f71a));if(_0x42f71a[_0xc28b('0x13')]){if(_0x42f71a[_0xc28b('0x13')][_0xc28b('0x14')]===0x1f4){logger[_0xc28b('0x13')](_0xc28b('0xe'),_0x2d91e5,_0x42f71a['error'][_0xc28b('0x15')]);return _0x112534(_0x42f71a[_0xc28b('0x13')][_0xc28b('0x15')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x2d91e5,_0x42f71a['error']['message']);return _0x1e573b(_0x42f71a[_0xc28b('0x13')][_0xc28b('0x15')]);}else{logger[_0xc28b('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2d91e5,_0xc28b('0xf'));_0x1e573b(_0x42f71a[_0xc28b('0x16')][_0xc28b('0x15')]);}})[_0xc28b('0x17')](function(_0x2fcf6e){logger[_0xc28b('0x13')](_0xc28b('0xe'),_0x2d91e5,_0x2fcf6e);_0x112534(_0x2fcf6e);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index de34cfa..1a2bea3 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 _0x9ebd=['/:id','post','create','update','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ebd,0x1c9));var _0xd9eb=function(_0x4ab4d7,_0x1b7319){_0x4ab4d7=_0x4ab4d7-0x0;var _0x368c01=_0x9ebd[_0x4ab4d7];return _0x368c01;};'use strict';var multer=require(_0xd9eb('0x0'));var util=require(_0xd9eb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd9eb('0x2'));var auth=require(_0xd9eb('0x3'));var interaction=require(_0xd9eb('0x4'));var config=require('../../config/environment');var controller=require(_0xd9eb('0x5'));router[_0xd9eb('0x6')]('/',auth[_0xd9eb('0x7')](),controller[_0xd9eb('0x8')]);router['get'](_0xd9eb('0x9'),auth['isAuthenticated'](),controller[_0xd9eb('0xa')]);router[_0xd9eb('0x6')](_0xd9eb('0xb'),auth[_0xd9eb('0x7')](),controller['show']);router[_0xd9eb('0xc')]('/',auth[_0xd9eb('0x7')](),controller[_0xd9eb('0xd')]);router['put'](_0xd9eb('0xb'),auth[_0xd9eb('0x7')](),controller[_0xd9eb('0xe')]);router[_0xd9eb('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd9eb('0x10')]);module[_0xd9eb('0x11')]=router; \ No newline at end of file +var _0x8b59=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x8b59,0x1dd));var _0x98b5=function(_0x38dc61,_0x5a6b7c){_0x38dc61=_0x38dc61-0x0;var _0x1a318d=_0x8b59[_0x38dc61];return _0x1a318d;};'use strict';var multer=require(_0x98b5('0x0'));var util=require(_0x98b5('0x1'));var path=require(_0x98b5('0x2'));var timeout=require(_0x98b5('0x3'));var express=require(_0x98b5('0x4'));var router=express[_0x98b5('0x5')]();var fs_extra=require(_0x98b5('0x6'));var auth=require(_0x98b5('0x7'));var interaction=require(_0x98b5('0x8'));var config=require(_0x98b5('0x9'));var controller=require(_0x98b5('0xa'));router['get']('/',auth[_0x98b5('0xb')](),controller[_0x98b5('0xc')]);router['get'](_0x98b5('0xd'),auth[_0x98b5('0xb')](),controller['describe']);router['get'](_0x98b5('0xe'),auth[_0x98b5('0xb')](),controller[_0x98b5('0xf')]);router[_0x98b5('0x10')]('/',auth['isAuthenticated'](),controller[_0x98b5('0x11')]);router['put'](_0x98b5('0xe'),auth[_0x98b5('0xb')](),controller[_0x98b5('0x12')]);router[_0x98b5('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x98b5('0x14')]);module[_0x98b5('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 11ba01f..72b8c34 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 _0x1498=['timeout','INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x318895,_0x1711e5){var _0x42676b=function(_0x5d83e4){while(--_0x5d83e4){_0x318895['push'](_0x318895['shift']());}};_0x42676b(++_0x1711e5);}(_0x1498,0x1d0));var _0x8149=function(_0x4e2969,_0x5bedba){_0x4e2969=_0x4e2969-0x0;var _0x4717fc=_0x1498[_0x4e2969];return _0x4717fc;};'use strict';var Sequelize=require(_0x8149('0x0'));module[_0x8149('0x1')]={'name':{'type':Sequelize[_0x8149('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8149('0x3'),_0x8149('0x4')),'defaultValue':_0x8149('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8149('0x5')]}}; \ No newline at end of file +var _0x6867=['mouseOver','INTEGER','sequelize','exports','STRING','ENUM','timeout'];(function(_0x171bef,_0x4cba08){var _0x28828a=function(_0x19d85c){while(--_0x19d85c){_0x171bef['push'](_0x171bef['shift']());}};_0x28828a(++_0x4cba08);}(_0x6867,0x167));var _0x7686=function(_0x36d1af,_0x38cc9a){_0x36d1af=_0x36d1af-0x0;var _0x476db9=_0x6867[_0x36d1af];return _0x476db9;};'use strict';var Sequelize=require(_0x7686('0x0'));module[_0x7686('0x1')]={'name':{'type':Sequelize[_0x7686('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7686('0x3')]('mouseOver',_0x7686('0x4')),'defaultValue':_0x7686('0x5')},'selector':{'type':Sequelize[_0x7686('0x2')]},'timeout':{'type':Sequelize[_0x7686('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index ba40c36..c77fdea 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 _0xb10b=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','show','params','model','keys','rawAttributes','filters','intersection','query','fields','attributes','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x9f18b5,_0x291e21){var _0x4ceeb7=function(_0x31d807){while(--_0x31d807){_0x9f18b5['push'](_0x9f18b5['shift']());}};_0x4ceeb7(++_0x291e21);}(_0xb10b,0x12a));var _0xbb10=function(_0x3072e2,_0x648a09){_0x3072e2=_0x3072e2-0x0;var _0x42c45b=_0xb10b[_0x3072e2];return _0x42c45b;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={'raw':!![],'where':{'id':_0x4aabb9[_0xbb10('0x2b')]['id']}},_0xfc3595={};_0xfc3595[_0xbb10('0x2c')]=_[_0xbb10('0x2d')](db['ChatProactiveAction'][_0xbb10('0x2e')]);_0xfc3595['query']=_[_0xbb10('0x2d')](_0x4aabb9['query']);_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0xfc3595[_0xbb10('0x2c')],_0xfc3595['query']);_0x21ac54['attributes']=_[_0xbb10('0x30')](_0xfc3595[_0xbb10('0x2c')],qs['fields'](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x32')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x34')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2c')];if(_0x4aabb9['query'][_0xbb10('0x35')]){_0x21ac54[_0xbb10('0x36')]=[{'all':!![]}];}_0x21ac54=_[_0xbb10('0x37')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x38')]);return db[_0xbb10('0x39')][_0xbb10('0x3a')](_0x21ac54)[_0xbb10('0x23')](handleEntityNotFound(_0x3796c7,null))[_0xbb10('0x23')](respondWithResult(_0x3796c7,null))[_0xbb10('0x3b')](handleError(_0x3796c7,null));};exports['create']=function(_0x2b5352,_0x150107){return db[_0xbb10('0x39')][_0xbb10('0x3c')](_0x2b5352['body'],{})[_0xbb10('0x23')](respondWithResult(_0x150107,0xc9))['catch'](handleError(_0x150107,null));};exports['update']=function(_0x3eb3cc,_0x40c164){if(_0x3eb3cc[_0xbb10('0x3d')]['id']){delete _0x3eb3cc[_0xbb10('0x3d')]['id'];}return db[_0xbb10('0x39')][_0xbb10('0x3a')]({'where':{'id':_0x3eb3cc['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x40c164,null))[_0xbb10('0x23')](saveUpdates(_0x3eb3cc['body'],null))['then'](respondWithResult(_0x40c164,null))['catch'](handleError(_0x40c164,null));};exports[_0xbb10('0x24')]=function(_0x2b0b45,_0x2b658a){return db['ChatProactiveAction'][_0xbb10('0x3a')]({'where':{'id':_0x2b0b45[_0xbb10('0x2b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x2b658a,null))['then'](removeEntity(_0x2b658a,null))[_0xbb10('0x3b')](handleError(_0x2b658a,null));}; \ No newline at end of file +var _0xb10b=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','show','params','model','keys','rawAttributes','filters','intersection','query','fields','attributes','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x23642f,_0x2c6953){var _0x20e1b6=function(_0x5f2079){while(--_0x5f2079){_0x23642f['push'](_0x23642f['shift']());}};_0x20e1b6(++_0x2c6953);}(_0xb10b,0x12a));var _0xbb10=function(_0x47c902,_0x220fd2){_0x47c902=_0x47c902-0x0;var _0x1ad6a0=_0xb10b[_0x47c902];return _0x1ad6a0;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={'raw':!![],'where':{'id':_0x4aabb9[_0xbb10('0x2b')]['id']}},_0xfc3595={};_0xfc3595[_0xbb10('0x2c')]=_[_0xbb10('0x2d')](db['ChatProactiveAction'][_0xbb10('0x2e')]);_0xfc3595['query']=_[_0xbb10('0x2d')](_0x4aabb9['query']);_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0xfc3595[_0xbb10('0x2c')],_0xfc3595['query']);_0x21ac54['attributes']=_[_0xbb10('0x30')](_0xfc3595[_0xbb10('0x2c')],qs['fields'](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x32')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x34')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2c')];if(_0x4aabb9['query'][_0xbb10('0x35')]){_0x21ac54[_0xbb10('0x36')]=[{'all':!![]}];}_0x21ac54=_[_0xbb10('0x37')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x38')]);return db[_0xbb10('0x39')][_0xbb10('0x3a')](_0x21ac54)[_0xbb10('0x23')](handleEntityNotFound(_0x3796c7,null))[_0xbb10('0x23')](respondWithResult(_0x3796c7,null))[_0xbb10('0x3b')](handleError(_0x3796c7,null));};exports['create']=function(_0x2b5352,_0x150107){return db[_0xbb10('0x39')][_0xbb10('0x3c')](_0x2b5352['body'],{})[_0xbb10('0x23')](respondWithResult(_0x150107,0xc9))['catch'](handleError(_0x150107,null));};exports['update']=function(_0x3eb3cc,_0x40c164){if(_0x3eb3cc[_0xbb10('0x3d')]['id']){delete _0x3eb3cc[_0xbb10('0x3d')]['id'];}return db[_0xbb10('0x39')][_0xbb10('0x3a')]({'where':{'id':_0x3eb3cc['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x40c164,null))[_0xbb10('0x23')](saveUpdates(_0x3eb3cc['body'],null))['then'](respondWithResult(_0x40c164,null))['catch'](handleError(_0x40c164,null));};exports[_0xbb10('0x24')]=function(_0x2b0b45,_0x2b658a){return db['ChatProactiveAction'][_0xbb10('0x3a')]({'where':{'id':_0x2b0b45[_0xbb10('0x2b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x2b658a,null))['then'](removeEntity(_0x2b658a,null))[_0xbb10('0x3b')](handleError(_0x2b658a,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 7f2f985..5e1256c 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 _0xd119=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','util','api','bluebird','request-promise','path'];(function(_0x2383c0,_0x28b6fb){var _0x40a109=function(_0x83ad9c){while(--_0x83ad9c){_0x2383c0['push'](_0x2383c0['shift']());}};_0x40a109(++_0x28b6fb);}(_0xd119,0x192));var _0x9d11=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xd119[_0x1762b4];return _0x29beda;};'use strict';var _=require('lodash');var util=require(_0x9d11('0x0'));var logger=require('../../config/logger')(_0x9d11('0x1'));var moment=require('moment');var BPromise=require(_0x9d11('0x2'));var rp=require(_0x9d11('0x3'));var fs=require('fs');var path=require(_0x9d11('0x4'));var rimraf=require(_0x9d11('0x5'));var config=require(_0x9d11('0x6'));var attributes=require(_0x9d11('0x7'));module[_0x9d11('0x8')]=function(_0x55408c,_0x5a4cad){return _0x55408c[_0x9d11('0x9')](_0x9d11('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d8f=['lodash','util','../../config/logger','api','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','chat_proactive_actions'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x9d8f,0x1e6));var _0xf9d8=function(_0x2664da,_0x3ce139){_0x2664da=_0x2664da-0x0;var _0x541f04=_0x9d8f[_0x2664da];return _0x541f04;};'use strict';var _=require(_0xf9d8('0x0'));var util=require(_0xf9d8('0x1'));var logger=require(_0xf9d8('0x2'))(_0xf9d8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf9d8('0x4'));var config=require(_0xf9d8('0x5'));var attributes=require(_0xf9d8('0x6'));module[_0xf9d8('0x7')]=function(_0x185b58,_0x2d71a5){return _0x185b58['define']('ChatProactiveAction',attributes,{'tableName':_0xf9d8('0x8'),'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 5f65dcb..acfb506 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 _0x8ffc=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info'];(function(_0x5a3313,_0x434d58){var _0x8b4747=function(_0x1ee998){while(--_0x1ee998){_0x5a3313['push'](_0x5a3313['shift']());}};_0x8b4747(++_0x434d58);}(_0x8ffc,0x19f));var _0xc8ff=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x8ffc[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require(_0xc8ff('0x0'));var moment=require(_0xc8ff('0x1'));var BPromise=require(_0xc8ff('0x2'));var rs=require(_0xc8ff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc8ff('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc8ff('0x5'))(_0xc8ff('0x6'));var config=require(_0xc8ff('0x7'));var jayson=require(_0xc8ff('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51d073,_0x13bf05,_0x72fc2f){return new BPromise(function(_0xa506bb,_0x156562){return client[_0xc8ff('0x9')](_0x51d073,_0x72fc2f)['then'](function(_0x5eaa11){logger['info'](_0xc8ff('0xa'),_0x13bf05,'request\x20sent');logger[_0xc8ff('0xb')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x13bf05,_0xc8ff('0xc'),JSON[_0xc8ff('0xd')](_0x5eaa11));if(_0x5eaa11[_0xc8ff('0xe')]){if(_0x5eaa11['error']['code']===0x1f4){logger[_0xc8ff('0xe')](_0xc8ff('0xa'),_0x13bf05,_0x5eaa11[_0xc8ff('0xe')][_0xc8ff('0xf')]);return _0x156562(_0x5eaa11[_0xc8ff('0xe')][_0xc8ff('0xf')]);}logger[_0xc8ff('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x13bf05,_0x5eaa11['error'][_0xc8ff('0xf')]);return _0xa506bb(_0x5eaa11['error']['message']);}else{logger[_0xc8ff('0x10')](_0xc8ff('0xa'),_0x13bf05,_0xc8ff('0xc'));_0xa506bb(_0x5eaa11['result'][_0xc8ff('0xf')]);}})[_0xc8ff('0x11')](function(_0x35622c){logger[_0xc8ff('0xe')](_0xc8ff('0xa'),_0x13bf05,_0x35622c);_0x156562(_0x35622c);});});} \ No newline at end of file +var _0xa213=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result'];(function(_0x5a30d0,_0x205574){var _0x415371=function(_0xcea570){while(--_0xcea570){_0x5a30d0['push'](_0x5a30d0['shift']());}};_0x415371(++_0x205574);}(_0xa213,0x1a3));var _0x3a21=function(_0x48ab64,_0xc30f22){_0x48ab64=_0x48ab64-0x0;var _0x40e1dc=_0xa213[_0x48ab64];return _0x40e1dc;};'use strict';var _=require(_0x3a21('0x0'));var util=require(_0x3a21('0x1'));var moment=require(_0x3a21('0x2'));var BPromise=require(_0x3a21('0x3'));var rs=require(_0x3a21('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a21('0x5'))['db'];var utils=require(_0x3a21('0x6'));var logger=require(_0x3a21('0x7'))(_0x3a21('0x8'));var config=require(_0x3a21('0x9'));var jayson=require(_0x3a21('0xa'));var client=jayson['client'][_0x3a21('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x94f61b,_0x143fe9,_0x106e0e){return new BPromise(function(_0x32820e,_0x19d428){return client['request'](_0x94f61b,_0x106e0e)['then'](function(_0x60335a){logger[_0x3a21('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x143fe9,_0x3a21('0xd'));logger['debug'](_0x3a21('0xe'),_0x143fe9,_0x3a21('0xd'),JSON[_0x3a21('0xf')](_0x60335a));if(_0x60335a[_0x3a21('0x10')]){if(_0x60335a[_0x3a21('0x10')][_0x3a21('0x11')]===0x1f4){logger[_0x3a21('0x10')](_0x3a21('0x12'),_0x143fe9,_0x60335a[_0x3a21('0x10')][_0x3a21('0x13')]);return _0x19d428(_0x60335a[_0x3a21('0x10')][_0x3a21('0x13')]);}logger[_0x3a21('0x10')](_0x3a21('0x12'),_0x143fe9,_0x60335a[_0x3a21('0x10')][_0x3a21('0x13')]);return _0x32820e(_0x60335a[_0x3a21('0x10')][_0x3a21('0x13')]);}else{logger['info'](_0x3a21('0x12'),_0x143fe9,_0x3a21('0xd'));_0x32820e(_0x60335a[_0x3a21('0x14')]['message']);}})[_0x3a21('0x15')](function(_0x4bfab5){logger[_0x3a21('0x10')](_0x3a21('0x12'),_0x143fe9,_0x4bfab5);_0x19d428(_0x4bfab5);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 041b37a..60c694a 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 _0x2c20=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0x3b35be,_0x539aa3){var _0x4721e1=function(_0x1a55ca){while(--_0x1a55ca){_0x3b35be['push'](_0x3b35be['shift']());}};_0x4721e1(++_0x539aa3);}(_0x2c20,0x70));var _0x02c2=function(_0x383d00,_0x4b4a54){_0x383d00=_0x383d00-0x0;var _0x290afc=_0x2c20[_0x383d00];return _0x290afc;};'use strict';var multer=require('multer');var util=require(_0x02c2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x02c2('0x1'));var router=express[_0x02c2('0x2')]();var fs_extra=require(_0x02c2('0x3'));var auth=require(_0x02c2('0x4'));var interaction=require(_0x02c2('0x5'));var config=require(_0x02c2('0x6'));var controller=require(_0x02c2('0x7'));router[_0x02c2('0x8')](_0x02c2('0x9'),auth[_0x02c2('0xa')](),controller[_0x02c2('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x02c2('0xc')](_0x02c2('0x9'),auth[_0x02c2('0xa')](),controller[_0x02c2('0xd')]);router[_0x02c2('0xe')](_0x02c2('0x9'),auth[_0x02c2('0xa')](),controller[_0x02c2('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0ef8=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0x0ef8,0x10b));var _0x80ef=function(_0x5c43f0,_0x8f72ed){_0x5c43f0=_0x5c43f0-0x0;var _0x2ccbad=_0x0ef8[_0x5c43f0];return _0x2ccbad;};'use strict';var multer=require(_0x80ef('0x0'));var util=require('util');var path=require(_0x80ef('0x1'));var timeout=require(_0x80ef('0x2'));var express=require('express');var router=express[_0x80ef('0x3')]();var fs_extra=require(_0x80ef('0x4'));var auth=require(_0x80ef('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x80ef('0x6'));var controller=require(_0x80ef('0x7'));router[_0x80ef('0x8')](_0x80ef('0x9'),auth[_0x80ef('0xa')](),controller[_0x80ef('0xb')]);router[_0x80ef('0xc')]('/',auth[_0x80ef('0xa')](),controller[_0x80ef('0xd')]);router[_0x80ef('0xe')]('/:id',auth[_0x80ef('0xa')](),controller[_0x80ef('0xf')]);router[_0x80ef('0x10')](_0x80ef('0x9'),auth['isAuthenticated'](),controller[_0x80ef('0x11')]);module[_0x80ef('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 5b15af2..5f98f72 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 _0x3a2b=['name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x5575cd,_0x73ab7a){var _0x4979a0=function(_0x1ac744){while(--_0x1ac744){_0x5575cd['push'](_0x5575cd['shift']());}};_0x4979a0(++_0x73ab7a);}(_0x3a2b,0xbd));var _0xb3a2=function(_0x211f59,_0x207567){_0x211f59=_0x211f59-0x0;var _0x2e56a1=_0x3a2b[_0x211f59];return _0x2e56a1;};'use strict';var Sequelize=require(_0xb3a2('0x0'));module[_0xb3a2('0x1')]={'name':{'type':Sequelize[_0xb3a2('0x2')],'unique':_0xb3a2('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb3a2('0x2')]},'timeout':{'type':Sequelize[_0xb3a2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb3a2('0x5')](_0xb3a2('0x6'),_0xb3a2('0x7'),'roundrobin')}}; \ No newline at end of file +var _0xcd00=['exports','STRING','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x562c6c,_0x4321f9){var _0x2d69f0=function(_0x17cbb3){while(--_0x17cbb3){_0x562c6c['push'](_0x562c6c['shift']());}};_0x2d69f0(++_0x4321f9);}(_0xcd00,0x109));var _0x0cd0=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcd00[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x0cd0('0x0'));module[_0x0cd0('0x1')]={'name':{'type':Sequelize[_0x0cd0('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0cd0('0x3')](_0x0cd0('0x4'),_0x0cd0('0x5'),_0x0cd0('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 8da7306..44b22d0 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 _0x4912=['addAgents','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','jayson/promise','client','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','get','ChatQueues','UserProfileResource','destroy','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','describe','getMembers','findOne','hasOwnProperty','order','ChatQueueId','merge','UserChatQueue','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','getTeams','Team','addTeams','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','Agents','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','union','value','sequelize','isEmpty','removeAgents','userChatQueue:remove'];(function(_0x51bc88,_0x5a924e){var _0x177d42=function(_0x40218d){while(--_0x40218d){_0x51bc88['push'](_0x51bc88['shift']());}};_0x177d42(++_0x5a924e);}(_0x4912,0x1c0));var _0x2491=function(_0x49a3fc,_0x1515fa){_0x49a3fc=_0x49a3fc-0x0;var _0xed87e6=_0x4912[_0x49a3fc];return _0xed87e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2491('0x0'));var zipdir=require(_0x2491('0x1'));var jsonpatch=require(_0x2491('0x2'));var rp=require(_0x2491('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2491('0x4'));var util=require(_0x2491('0x5'));var path=require(_0x2491('0x6'));var sox=require(_0x2491('0x7'));var csv=require(_0x2491('0x8'));var ejs=require(_0x2491('0x9'));var fs=require('fs');var fs_extra=require(_0x2491('0xa'));var _=require(_0x2491('0xb'));var squel=require('squel');var crypto=require(_0x2491('0xc'));var jsforce=require(_0x2491('0xd'));var deskjs=require(_0x2491('0xe'));var toCsv=require(_0x2491('0x8'));var querystring=require(_0x2491('0xf'));var Papa=require('papaparse');var Redis=require(_0x2491('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2491('0x11'));var as=require(_0x2491('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2491('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2491('0x14'))['db'];config[_0x2491('0x15')]=_[_0x2491('0x16')](config[_0x2491('0x15')],{'host':_0x2491('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2491('0x18'))['register'](socket);var jayson=require(_0x2491('0x19'));var client=jayson[_0x2491('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6585e1,_0x181c11,_0x2ecdde,_0x4702e9){return new BPromise(function(_0x43ac21,_0xf679cb){var _0x1a9025=_0x4702e9||client;return _0x1a9025['request'](_0x6585e1,_0x2ecdde)[_0x2491('0x1b')](function(_0x269f18){logger[_0x2491('0x1c')](_0x2491('0x1d'),_0x181c11,_0x2491('0x1e'));logger[_0x2491('0x1f')](_0x2491('0x20'),_0x181c11,_0x2491('0x1e'),JSON[_0x2491('0x21')](_0x269f18));if(_0x269f18[_0x2491('0x22')]){if(_0x269f18[_0x2491('0x22')][_0x2491('0x23')]===0x1f4){logger[_0x2491('0x22')]('ChatQueue,\x20%s,\x20%s',_0x181c11,_0x269f18[_0x2491('0x22')][_0x2491('0x24')]);return _0xf679cb(_0x269f18[_0x2491('0x22')][_0x2491('0x24')]);}logger['error'](_0x2491('0x1d'),_0x181c11,_0x269f18[_0x2491('0x22')][_0x2491('0x24')]);return _0x43ac21(_0x269f18[_0x2491('0x22')][_0x2491('0x24')]);}else{logger['info'](_0x2491('0x1d'),_0x181c11,'request\x20sent');_0x43ac21(_0x269f18[_0x2491('0x25')][_0x2491('0x24')]);}})[_0x2491('0x26')](function(_0xad67f0){logger[_0x2491('0x22')](_0x2491('0x1d'),_0x181c11,_0xad67f0);_0xf679cb(_0xad67f0);});});}function respondWithStatusCode(_0x2c5b2d,_0x371545){_0x371545=_0x371545||0xcc;return function(_0x3458c8){if(_0x3458c8){return _0x2c5b2d[_0x2491('0x27')](_0x371545);}return _0x2c5b2d[_0x2491('0x28')](_0x371545)[_0x2491('0x29')]();};}function respondWithResult(_0xbf3d5f,_0x56a58d){_0x56a58d=_0x56a58d||0xc8;return function(_0x367994){if(_0x367994){return _0xbf3d5f[_0x2491('0x28')](_0x56a58d)[_0x2491('0x2a')](_0x367994);}};}function respondWithFilteredResult(_0x3de546,_0x23ce59){return function(_0x5a0bf0){if(_0x5a0bf0){var _0x1192ae=typeof _0x23ce59[_0x2491('0x2b')]==='undefined'&&typeof _0x23ce59[_0x2491('0x2c')]===_0x2491('0x2d');var _0x461cd8=_0x5a0bf0[_0x2491('0x2e')];var _0x4b95e7=_0x1192ae?0x0:_0x23ce59[_0x2491('0x2b')];var _0x18d35e=_0x1192ae?_0x5a0bf0['count']:_0x23ce59[_0x2491('0x2b')]+_0x23ce59[_0x2491('0x2c')];var _0x3af277;if(_0x18d35e>=_0x461cd8){_0x18d35e=_0x461cd8;_0x3af277=0xc8;}else{_0x3af277=0xce;}_0x3de546[_0x2491('0x28')](_0x3af277);return _0x3de546[_0x2491('0x2f')](_0x2491('0x30'),_0x4b95e7+'-'+_0x18d35e+'/'+_0x461cd8)[_0x2491('0x2a')](_0x5a0bf0);}return null;};}function patchUpdates(_0x5b5239){return function(_0xf90e85){try{jsonpatch[_0x2491('0x31')](_0xf90e85,_0x5b5239,!![]);}catch(_0x468cca){return BPromise[_0x2491('0x32')](_0x468cca);}return _0xf90e85['save']();};}function saveUpdates(_0x5b428d,_0x2e5435){return function(_0x4f5ea6){if(_0x4f5ea6){return _0x4f5ea6[_0x2491('0x33')](_0x5b428d)[_0x2491('0x1b')](function(_0x832235){return _0x832235;});}return null;};}function removeEntity(_0x25e44a,_0x4de644){return function(_0xfa6a99){if(_0xfa6a99){return _0xfa6a99['destroy']()['then'](function(){var _0x37944e=_0xfa6a99[_0x2491('0x34')]({'plain':!![]});var _0x21b552=_0x2491('0x35');return db[_0x2491('0x36')][_0x2491('0x37')]({'where':{'type':_0x21b552,'resourceId':_0x37944e['id']}})[_0x2491('0x1b')](function(){return _0xfa6a99;});})[_0x2491('0x1b')](function(){_0x25e44a['status'](0xcc)[_0x2491('0x29')]();});}};}function handleEntityNotFound(_0x167e2a,_0xcdf08e){return function(_0x5c2dca){if(!_0x5c2dca){_0x167e2a['sendStatus'](0x194);}return _0x5c2dca;};}function handleError(_0x1f5ee2,_0x3d214f){_0x3d214f=_0x3d214f||0x1f4;return function(_0x230dd0){logger[_0x2491('0x22')](_0x230dd0[_0x2491('0x38')]);if(_0x230dd0['name']){delete _0x230dd0[_0x2491('0x39')];}_0x1f5ee2[_0x2491('0x28')](_0x3d214f)[_0x2491('0x3a')](_0x230dd0);};}exports[_0x2491('0x3b')]=function(_0x24d77a,_0x12ba82){var _0x547fa7={},_0x3c2fc6={},_0x10138f={'count':0x0,'rows':[]};var _0xe3cbb7=_[_0x2491('0x3c')](db[_0x2491('0x3d')][_0x2491('0x3e')],function(_0x54dbaf){return{'name':_0x54dbaf[_0x2491('0x3f')],'type':_0x54dbaf[_0x2491('0x40')][_0x2491('0x41')]};});_0x3c2fc6[_0x2491('0x42')]=_[_0x2491('0x3c')](_0xe3cbb7,_0x2491('0x39'));_0x3c2fc6[_0x2491('0x43')]=_[_0x2491('0x44')](_0x24d77a[_0x2491('0x43')]);_0x3c2fc6[_0x2491('0x45')]=_['intersection'](_0x3c2fc6['model'],_0x3c2fc6[_0x2491('0x43')]);_0x547fa7[_0x2491('0x46')]=_[_0x2491('0x47')](_0x3c2fc6[_0x2491('0x42')],qs[_0x2491('0x48')](_0x24d77a[_0x2491('0x43')][_0x2491('0x48')]));_0x547fa7[_0x2491('0x46')]=_0x547fa7[_0x2491('0x46')][_0x2491('0x49')]?_0x547fa7['attributes']:_0x3c2fc6['model'];if(!_0x24d77a[_0x2491('0x43')]['hasOwnProperty'](_0x2491('0x4a'))){_0x547fa7[_0x2491('0x2c')]=qs[_0x2491('0x2c')](_0x24d77a[_0x2491('0x43')][_0x2491('0x2c')]);_0x547fa7[_0x2491('0x2b')]=qs['offset'](_0x24d77a[_0x2491('0x43')][_0x2491('0x2b')]);}_0x547fa7['order']=qs[_0x2491('0x4b')](_0x24d77a[_0x2491('0x43')][_0x2491('0x4b')]);_0x547fa7[_0x2491('0x4c')]=qs[_0x2491('0x45')](_[_0x2491('0x4d')](_0x24d77a[_0x2491('0x43')],_0x3c2fc6[_0x2491('0x45')]),_0xe3cbb7);if(_0x24d77a[_0x2491('0x43')][_0x2491('0x4e')]){_0x547fa7[_0x2491('0x4c')]=_['merge'](_0x547fa7['where'],{'$or':_['map'](_0xe3cbb7,function(_0x18ad52){if(_0x18ad52['type']!==_0x2491('0x4f')){var _0x25c396={};_0x25c396[_0x18ad52[_0x2491('0x39')]]={'$like':'%'+_0x24d77a['query']['filter']+'%'};return _0x25c396;}})});}_0x547fa7=_['merge']({},_0x547fa7,_0x24d77a[_0x2491('0x50')]);var _0x3b5c94={'where':_0x547fa7['where']};return db[_0x2491('0x3d')][_0x2491('0x2e')](_0x3b5c94)['then'](function(_0x12cd88){_0x10138f[_0x2491('0x2e')]=_0x12cd88;if(_0x24d77a['query'][_0x2491('0x51')]){_0x547fa7[_0x2491('0x52')]=[{'all':!![]}];}return db[_0x2491('0x3d')][_0x2491('0x53')](_0x547fa7);})[_0x2491('0x1b')](function(_0x270070){_0x10138f[_0x2491('0x54')]=_0x270070;return _0x10138f;})[_0x2491('0x1b')](respondWithFilteredResult(_0x12ba82,_0x547fa7))['catch'](handleError(_0x12ba82,null));};exports['show']=function(_0xceb26a,_0x26390c){var _0x20703d={'raw':!![],'where':{'id':_0xceb26a[_0x2491('0x55')]['id']}},_0x403f55={};_0x403f55[_0x2491('0x42')]=_[_0x2491('0x44')](db[_0x2491('0x3d')][_0x2491('0x3e')]);_0x403f55['query']=_[_0x2491('0x44')](_0xceb26a[_0x2491('0x43')]);_0x403f55['filters']=_[_0x2491('0x47')](_0x403f55[_0x2491('0x42')],_0x403f55[_0x2491('0x43')]);_0x20703d[_0x2491('0x46')]=_[_0x2491('0x47')](_0x403f55[_0x2491('0x42')],qs['fields'](_0xceb26a[_0x2491('0x43')][_0x2491('0x48')]));_0x20703d[_0x2491('0x46')]=_0x20703d['attributes']['length']?_0x20703d[_0x2491('0x46')]:_0x403f55[_0x2491('0x42')];if(_0xceb26a[_0x2491('0x43')][_0x2491('0x51')]){_0x20703d[_0x2491('0x52')]=[{'all':!![]}];}_0x20703d=_['merge']({},_0x20703d,_0xceb26a[_0x2491('0x50')]);return db[_0x2491('0x3d')]['find'](_0x20703d)[_0x2491('0x1b')](handleEntityNotFound(_0x26390c,null))['then'](respondWithResult(_0x26390c,null))[_0x2491('0x26')](handleError(_0x26390c,null));};exports[_0x2491('0x56')]=function(_0x12fbb6,_0x5a73bb){return db[_0x2491('0x3d')][_0x2491('0x56')](_0x12fbb6[_0x2491('0x57')],{})['then'](function(_0x416bc8){var _0x207605=_0x12fbb6[_0x2491('0x58')][_0x2491('0x34')]({'plain':!![]});if(!_0x207605)throw new Error(_0x2491('0x59'));if(_0x207605[_0x2491('0x5a')]===_0x2491('0x58')){var _0x4dc2ca=_0x416bc8[_0x2491('0x34')]({'plain':!![]});var _0x413fed=_0x2491('0x35');return db['UserProfileSection'][_0x2491('0x5b')]({'where':{'name':_0x413fed,'userProfileId':_0x207605['userProfileId']},'raw':!![]})[_0x2491('0x1b')](function(_0x390467){if(_0x390467&&_0x390467[_0x2491('0x5c')]===0x0){return db[_0x2491('0x36')][_0x2491('0x56')]({'name':_0x4dc2ca['name'],'resourceId':_0x4dc2ca['id'],'type':_0x390467[_0x2491('0x39')],'sectionId':_0x390467['id']},{})[_0x2491('0x1b')](function(){return _0x416bc8;});}else{return _0x416bc8;}})['catch'](function(_0xadf37f){logger[_0x2491('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xadf37f);throw _0xadf37f;});}return _0x416bc8;})[_0x2491('0x1b')](respondWithResult(_0x5a73bb,0xc9))[_0x2491('0x26')](handleError(_0x5a73bb,null));};exports[_0x2491('0x33')]=function(_0x2c3ca6,_0x2f3365){if(_0x2c3ca6['body']['id']){delete _0x2c3ca6[_0x2491('0x57')]['id'];}return db['ChatQueue'][_0x2491('0x5b')]({'where':{'id':_0x2c3ca6['params']['id']}})['then'](handleEntityNotFound(_0x2f3365,null))[_0x2491('0x1b')](saveUpdates(_0x2c3ca6[_0x2491('0x57')],null))[_0x2491('0x1b')](respondWithResult(_0x2f3365,null))[_0x2491('0x26')](handleError(_0x2f3365,null));};exports[_0x2491('0x37')]=function(_0x5bb799,_0x56dd1b){return db[_0x2491('0x3d')]['find']({'where':{'id':_0x5bb799[_0x2491('0x55')]['id']}})[_0x2491('0x1b')](handleEntityNotFound(_0x56dd1b,null))[_0x2491('0x1b')](removeEntity(_0x56dd1b,null))[_0x2491('0x26')](handleError(_0x56dd1b,null));};exports['describe']=function(_0x33f927,_0x396f4d){return db[_0x2491('0x3d')][_0x2491('0x5d')]()[_0x2491('0x1b')](respondWithResult(_0x396f4d,null))[_0x2491('0x26')](handleError(_0x396f4d,null));};exports[_0x2491('0x5e')]=function(_0x170672,_0x281ec9,_0x293209){var _0x33eabe={'raw':!![],'where':{}},_0x417df1={},_0x5a1e33;return db[_0x2491('0x3d')][_0x2491('0x5f')]({'where':{'id':_0x170672[_0x2491('0x55')]['id']}})[_0x2491('0x1b')](handleEntityNotFound(_0x281ec9,null))['then'](function(_0x3221f8){if(_0x3221f8){_0x5a1e33=_0x3221f8[_0x2491('0x34')]({'plain':!![]});_0x417df1[_0x2491('0x42')]=_[_0x2491('0x44')](db['UserChatQueue'][_0x2491('0x3e')]);_0x417df1['query']=_[_0x2491('0x44')](_0x170672[_0x2491('0x43')]);_0x417df1[_0x2491('0x45')]=_[_0x2491('0x47')](_0x417df1['model'],_0x417df1[_0x2491('0x43')]);_0x33eabe[_0x2491('0x46')]=_[_0x2491('0x47')](_0x417df1[_0x2491('0x42')],qs[_0x2491('0x48')](_0x170672[_0x2491('0x43')][_0x2491('0x48')]));_0x33eabe[_0x2491('0x46')]=_0x33eabe['attributes']['length']?_0x33eabe['attributes']:_0x417df1[_0x2491('0x42')];if(!_0x170672['query'][_0x2491('0x60')](_0x2491('0x4a'))){_0x33eabe[_0x2491('0x2c')]=qs[_0x2491('0x2c')](_0x170672[_0x2491('0x43')][_0x2491('0x2c')]);_0x33eabe[_0x2491('0x2b')]=qs[_0x2491('0x2b')](_0x170672['query'][_0x2491('0x2b')]);}_0x33eabe[_0x2491('0x61')]=qs[_0x2491('0x4b')](_0x170672[_0x2491('0x43')][_0x2491('0x4b')]);_0x33eabe['where']=qs['filters'](_[_0x2491('0x4d')](_0x170672['query'],_0x417df1[_0x2491('0x45')]));_0x33eabe[_0x2491('0x4c')][_0x2491('0x62')]=_0x3221f8['id'];if(_0x170672[_0x2491('0x43')][_0x2491('0x4e')]){_0x33eabe[_0x2491('0x4c')]=_[_0x2491('0x63')](_0x33eabe[_0x2491('0x4c')],{'$or':_[_0x2491('0x3c')](_0x33eabe[_0x2491('0x46')],function(_0x418339){var _0x193ebc={};_0x193ebc[_0x418339]={'$like':'%'+_0x170672[_0x2491('0x43')][_0x2491('0x4e')]+'%'};return _0x193ebc;})});}_0x33eabe=_[_0x2491('0x63')]({},_0x33eabe,_0x170672[_0x2491('0x50')]);return db[_0x2491('0x64')][_0x2491('0x53')](_0x33eabe);}})['then'](function(_0x50d1e0){if(_0x50d1e0){return db[_0x2491('0x65')][_0x2491('0x66')]({'where':{'id':_[_0x2491('0x3c')](_0x50d1e0,'UserId'),'role':_0x2491('0x67')},'attributes':['id',_0x2491('0x39'),_0x2491('0x68'),_0x2491('0x69'),_0x2491('0x6a')]});}})['then'](function(_0xea8451){if(_0xea8451){return{'count':_0xea8451[_0x2491('0x2e')],'rows':_[_0x2491('0x3c')](_0xea8451[_0x2491('0x54')],function(_0xd39739){return{'membername':_0xd39739[_0x2491('0x39')],'UserId':_0xd39739['id'],'queue_name':_0x5a1e33[_0x2491('0x39')],'ChatQueueId':_0x5a1e33['id'],'interface':util[_0x2491('0x6b')]('%s/%s','SIP',_0xd39739['name']),'penalty':0x0,'paused':_0xd39739[_0x2491('0x68')],'createdAt':_0xd39739[_0x2491('0x6a')],'updatedAt':_0xd39739[_0x2491('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2491('0x1b')](respondWithFilteredResult(_0x281ec9,_0x33eabe))['catch'](handleError(_0x281ec9,null));};exports[_0x2491('0x6c')]=function(_0x2084f3,_0x8b2613,_0x350d93){var _0x2aea31={};var _0x5e3e66={};var _0x5df6f1;var _0x74e3ec;return db[_0x2491('0x3d')][_0x2491('0x5f')]({'where':{'id':_0x2084f3[_0x2491('0x55')]['id']}})[_0x2491('0x1b')](handleEntityNotFound(_0x8b2613,null))[_0x2491('0x1b')](function(_0x26e4f7){if(_0x26e4f7){_0x5df6f1=_0x26e4f7;_0x5e3e66['model']=_[_0x2491('0x44')](db[_0x2491('0x6d')][_0x2491('0x3e')]);_0x5e3e66[_0x2491('0x43')]=_[_0x2491('0x44')](_0x2084f3[_0x2491('0x43')]);_0x5e3e66[_0x2491('0x45')]=_[_0x2491('0x47')](_0x5e3e66[_0x2491('0x42')],_0x5e3e66[_0x2491('0x43')]);_0x2aea31['attributes']=_[_0x2491('0x47')](_0x5e3e66[_0x2491('0x42')],qs[_0x2491('0x48')](_0x2084f3['query']['fields']));_0x2aea31[_0x2491('0x46')]=_0x2aea31['attributes'][_0x2491('0x49')]?_0x2aea31[_0x2491('0x46')]:_0x5e3e66[_0x2491('0x42')];_0x2aea31[_0x2491('0x61')]=qs[_0x2491('0x4b')](_0x2084f3[_0x2491('0x43')][_0x2491('0x4b')]);_0x2aea31[_0x2491('0x4c')]=qs['filters'](_[_0x2491('0x4d')](_0x2084f3['query'],_0x5e3e66['filters']));if(_0x2084f3[_0x2491('0x43')][_0x2491('0x4e')]){_0x2aea31[_0x2491('0x4c')]=_[_0x2491('0x63')](_0x2aea31[_0x2491('0x4c')],{'$or':_[_0x2491('0x3c')](_0x2aea31[_0x2491('0x46')],function(_0xd961c6){var _0x5c8011={};_0x5c8011[_0xd961c6]={'$like':'%'+_0x2084f3[_0x2491('0x43')][_0x2491('0x4e')]+'%'};return _0x5c8011;})});}_0x2aea31=_['merge']({},_0x2aea31,_0x2084f3[_0x2491('0x50')]);return _0x5df6f1[_0x2491('0x6c')](_0x2aea31);}})['then'](function(_0x2b4770){if(_0x2b4770){_0x74e3ec=_0x2b4770['length'];if(!_0x2084f3[_0x2491('0x43')]['hasOwnProperty']('nolimit')){_0x2aea31['limit']=qs['limit'](_0x2084f3[_0x2491('0x43')][_0x2491('0x2c')]);_0x2aea31[_0x2491('0x2b')]=qs[_0x2491('0x2b')](_0x2084f3[_0x2491('0x43')][_0x2491('0x2b')]);}return _0x5df6f1[_0x2491('0x6c')](_0x2aea31);}})[_0x2491('0x1b')](function(_0x3c90b4){if(_0x3c90b4){return _0x3c90b4?{'count':_0x74e3ec,'rows':_0x3c90b4}:null;}})[_0x2491('0x1b')](respondWithResult(_0x8b2613,null))[_0x2491('0x26')](handleError(_0x8b2613,null));};exports[_0x2491('0x6e')]=function(_0x38d409,_0x35c136,_0x303bab){var _0x187e33=_0x38d409[_0x2491('0x57')]['ids'];return db[_0x2491('0x6d')][_0x2491('0x53')]({'where':{'id':_0x187e33},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x2491('0x39'),_0x2491('0x6f'),_0x2491('0x70'),_0x2491('0x71')],'raw':!![]}]})[_0x2491('0x1b')](function(_0x27bb4b){if(_0x27bb4b){var _0x341330=_[_0x2491('0x72')](_0x27bb4b,function(_0x5a3d00){var _0x55f9c3=_0x5a3d00[_0x2491('0x34')]({'plain':!![]});return _0x55f9c3['Agents'];});return db[_0x2491('0x3d')]['find']({'where':{'id':_0x38d409['params']['id']}})['then'](function(_0x5781e2){return db['sequelize'][_0x2491('0x73')](function(_0x54a9cc){return _0x5781e2[_0x2491('0x6e')](_0x187e33,{'transaction':_0x54a9cc})[_0x2491('0x1b')](function(){return BPromise[_0x2491('0x74')](_0x341330,function(_0x12b233){return db['UserChatQueue'][_0x2491('0x75')]({'where':{'UserId':_0x12b233['id'],'ChatQueueId':_0x38d409[_0x2491('0x55')]['id']},'transaction':_0x54a9cc});});})['then'](function(){_0x341330[_0x2491('0x76')](function(_0x3c83b0){socket[_0x2491('0x77')](_0x2491('0x78'),{'UserId':_0x3c83b0['id'],'ChatQueueId':_0x5781e2['id']});});});});});}})[_0x2491('0x1b')](respondWithStatusCode(_0x35c136,null))[_0x2491('0x26')](handleError(_0x35c136,null));};exports[_0x2491('0x79')]=function(_0x24b970,_0x243685,_0xd3a40){return db[_0x2491('0x6d')][_0x2491('0x53')]({'where':{'id':_0x24b970[_0x2491('0x43')][_0x2491('0x7a')]},'attributes':['id'],'include':[{'model':db[_0x2491('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2491('0x1b')](handleEntityNotFound(_0x243685,null))[_0x2491('0x1b')](function(_0x1e5324){var _0x1d9fcf=_['map'](_0x1e5324,'id');var _0x4bb11a=[];var _0x323b07=[];var _0x3e239c=squel[_0x2491('0x7b')]();_0x3e239c[_0x2491('0x7c')](_0x2491('0x7d'))[_0x2491('0x7e')](_0x2491('0x7f'),'tq')['join'](_0x2491('0x80'),'ut',_0x2491('0x81'))[_0x2491('0x4c')](_0x2491('0x82'),_0x24b970['params']['id']);for(var _0x23662e=0x0;_0x23662e<_0x1e5324['length'];_0x23662e+=0x1){let _0x39713a=_0x1e5324[_0x23662e];for(var _0x474249=0x0;_0x474249<_0x39713a[_0x2491('0x83')][_0x2491('0x49')];_0x474249+=0x1){let _0x43ad64=_0x39713a[_0x2491('0x83')][_0x474249];var _0x86289b=_0x3e239c['clone']();_0x86289b[_0x2491('0x4c')](_0x2491('0x84'),_0x43ad64['id']);_0x323b07[_0x2491('0x85')](db['sequelize'][_0x2491('0x43')](_0x86289b['toString'](),{'type':db['sequelize'][_0x2491('0x86')][_0x2491('0x87')]})[_0x2491('0x1b')](function(_0x44b1a2){if(_0x44b1a2[_0x2491('0x49')]===0x1){return _0x43ad64['id'];}else{var _0x445b25=_[_0x2491('0x88')](_['map'](_0x44b1a2,_0x2491('0x89')),function(_0x439f1d){return _['includes'](_0x1d9fcf,_0x439f1d);});if(_0x445b25){return _0x43ad64['id'];}}}));}}return BPromise['all'](_0x323b07)[_0x2491('0x1b')](function(_0x2295d2){_0x4bb11a=_(_0x4bb11a)[_0x2491('0x8a')](_0x2295d2)['compact']()[_0x2491('0x8b')]();return db['ChatQueue'][_0x2491('0x5b')]({'where':{'id':_0x24b970['params']['id']}})['then'](function(_0x2cef45){return db[_0x2491('0x8c')][_0x2491('0x73')](function(_0x47c734){return _0x2cef45[_0x2491('0x79')](_0x24b970[_0x2491('0x43')][_0x2491('0x7a')],{'transaction':_0x47c734})[_0x2491('0x1b')](function(){if(!_[_0x2491('0x8d')](_0x4bb11a)){return _0x2cef45[_0x2491('0x8e')](_0x4bb11a,{'transaction':_0x47c734});}})[_0x2491('0x1b')](function(){_0x4bb11a['forEach'](function(_0x19fddc){socket[_0x2491('0x77')](_0x2491('0x8f'),{'UserId':_0x19fddc,'ChatQueueId':_0x2cef45['id']});});});});});});})[_0x2491('0x1b')](respondWithStatusCode(_0x243685,null))[_0x2491('0x26')](handleError(_0x243685,null));};exports[_0x2491('0x90')]=function(_0xd8c106,_0x51e62c,_0xc9ce90){return db[_0x2491('0x3d')][_0x2491('0x5b')]({'where':{'id':_0xd8c106[_0x2491('0x55')]['id']}})['then'](handleEntityNotFound(_0x51e62c,null))[_0x2491('0x1b')](function(_0x1581ca){if(_0x1581ca){return _0x1581ca['addAgents'](_0xd8c106['body']['ids'],_['omit'](_0xd8c106[_0x2491('0x57')],[_0x2491('0x7a'),'id'])||{})[_0x2491('0x91')](function(_0x2c6967){for(var _0x28a77c=0x0;_0x28a77c<_0xd8c106['body'][_0x2491('0x7a')][_0x2491('0x49')];_0x28a77c+=0x1){socket['emit'](_0x2491('0x78'),{'UserId':_0xd8c106['body'][_0x2491('0x7a')][_0x28a77c],'ChatQueueId':_0xd8c106[_0x2491('0x55')]['id']});}return _0x2c6967;});}})[_0x2491('0x1b')](respondWithResult(_0x51e62c,null))[_0x2491('0x26')](handleError(_0x51e62c,null));};exports[_0x2491('0x8e')]=function(_0x56afc1,_0x19a585,_0x1b770d){return db['ChatQueue'][_0x2491('0x5b')]({'where':{'id':_0x56afc1[_0x2491('0x55')]['id']}})[_0x2491('0x1b')](handleEntityNotFound(_0x19a585,null))[_0x2491('0x1b')](function(_0x2a67b4){if(_0x2a67b4){return _0x2a67b4['removeAgents'](_0x56afc1[_0x2491('0x43')][_0x2491('0x7a')])[_0x2491('0x1b')](function(){if(_[_0x2491('0x92')](_0x56afc1[_0x2491('0x43')][_0x2491('0x7a')])){for(var _0x113172=0x0;_0x113172<_0x56afc1['query']['ids'][_0x2491('0x49')];_0x113172+=0x1){socket[_0x2491('0x77')](_0x2491('0x8f'),{'UserId':Number(_0x56afc1[_0x2491('0x43')][_0x2491('0x7a')][_0x113172]),'ChatQueueId':Number(_0x56afc1[_0x2491('0x55')]['id'])});}}else{socket[_0x2491('0x77')](_0x2491('0x8f'),{'UserId':Number(_0x56afc1[_0x2491('0x43')][_0x2491('0x7a')]),'ChatQueueId':Number(_0x56afc1[_0x2491('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x19a585,null))[_0x2491('0x26')](handleError(_0x19a585,null));};exports['getAgents']=function(_0x2f3b8e,_0x2b7bb0,_0x14a1fc){var _0x23a714={};var _0x2aadf8={};var _0x32aada;var _0x22b809;return db[_0x2491('0x3d')][_0x2491('0x5f')]({'where':{'id':_0x2f3b8e[_0x2491('0x55')]['id']}})[_0x2491('0x1b')](handleEntityNotFound(_0x2b7bb0,null))[_0x2491('0x1b')](function(_0x397922){if(_0x397922){_0x32aada=_0x397922;_0x2aadf8[_0x2491('0x42')]=_[_0x2491('0x44')](db[_0x2491('0x65')][_0x2491('0x3e')]);_0x2aadf8[_0x2491('0x43')]=_[_0x2491('0x44')](_0x2f3b8e['query']);_0x2aadf8['filters']=_[_0x2491('0x47')](_0x2aadf8[_0x2491('0x42')],_0x2aadf8[_0x2491('0x43')]);_0x23a714[_0x2491('0x46')]=_[_0x2491('0x47')](_0x2aadf8[_0x2491('0x42')],qs[_0x2491('0x48')](_0x2f3b8e[_0x2491('0x43')][_0x2491('0x48')]));_0x23a714['attributes']=_0x23a714[_0x2491('0x46')][_0x2491('0x49')]?_0x23a714[_0x2491('0x46')]:_0x2aadf8[_0x2491('0x42')];_0x23a714[_0x2491('0x61')]=qs[_0x2491('0x4b')](_0x2f3b8e['query'][_0x2491('0x4b')]);_0x23a714[_0x2491('0x4c')]=qs[_0x2491('0x45')](_[_0x2491('0x4d')](_0x2f3b8e['query'],_0x2aadf8['filters']));if(_0x2f3b8e['query'][_0x2491('0x4e')]){_0x23a714['where']=_['merge'](_0x23a714[_0x2491('0x4c')],{'$or':_[_0x2491('0x3c')](_0x23a714[_0x2491('0x46')],function(_0x564640){var _0x489b3f={};_0x489b3f[_0x564640]={'$like':'%'+_0x2f3b8e[_0x2491('0x43')][_0x2491('0x4e')]+'%'};return _0x489b3f;})});}_0x23a714=_[_0x2491('0x63')]({},_0x23a714,_0x2f3b8e[_0x2491('0x50')]);return _0x32aada['getAgents'](_0x23a714);}})['then'](function(_0x52ff4c){if(_0x52ff4c){_0x22b809=_0x52ff4c[_0x2491('0x49')];if(!_0x2f3b8e[_0x2491('0x43')][_0x2491('0x60')](_0x2491('0x4a'))){_0x23a714[_0x2491('0x2c')]=qs[_0x2491('0x2c')](_0x2f3b8e[_0x2491('0x43')][_0x2491('0x2c')]);_0x23a714[_0x2491('0x2b')]=qs[_0x2491('0x2b')](_0x2f3b8e[_0x2491('0x43')][_0x2491('0x2b')]);}return _0x32aada[_0x2491('0x93')](_0x23a714);}})[_0x2491('0x1b')](function(_0x360cce){if(_0x360cce){return _0x360cce?{'count':_0x22b809,'rows':_0x360cce}:null;}})[_0x2491('0x1b')](respondWithResult(_0x2b7bb0,null))[_0x2491('0x26')](handleError(_0x2b7bb0,null));}; \ No newline at end of file +var _0xe0e8=['model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','show','params','keys','ChatQueue','includeAll','include','create','user','get','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','order','ChatQueueId','UserChatQueue','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','each','emit','userChatQueue:save','removeTeams','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','all','union','value','transaction','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','json','offset','limit','undefined','count','set','reject','save','ChatQueues','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','query','intersection'];(function(_0x27c0f8,_0xd1bd2f){var _0x426b4e=function(_0x1d3f4b){while(--_0x1d3f4b){_0x27c0f8['push'](_0x27c0f8['shift']());}};_0x426b4e(++_0xd1bd2f);}(_0xe0e8,0xe9));var _0x8e0e=function(_0x28fe8c,_0xe91932){_0x28fe8c=_0x28fe8c-0x0;var _0x39285a=_0xe0e8[_0x28fe8c];return _0x39285a;};'use strict';var emlformat=require(_0x8e0e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8e0e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e0e('0x2'));var moment=require(_0x8e0e('0x3'));var BPromise=require(_0x8e0e('0x4'));var Mustache=require('mustache');var util=require(_0x8e0e('0x5'));var path=require(_0x8e0e('0x6'));var sox=require(_0x8e0e('0x7'));var csv=require(_0x8e0e('0x8'));var ejs=require(_0x8e0e('0x9'));var fs=require('fs');var fs_extra=require(_0x8e0e('0xa'));var _=require(_0x8e0e('0xb'));var squel=require('squel');var crypto=require(_0x8e0e('0xc'));var jsforce=require(_0x8e0e('0xd'));var deskjs=require(_0x8e0e('0xe'));var toCsv=require(_0x8e0e('0x8'));var querystring=require('querystring');var Papa=require(_0x8e0e('0xf'));var Redis=require(_0x8e0e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8e0e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e0e('0x12'));var logger=require(_0x8e0e('0x13'))(_0x8e0e('0x14'));var utils=require('../../config/utils');var config=require(_0x8e0e('0x15'));var licenseUtil=require(_0x8e0e('0x16'));var db=require(_0x8e0e('0x17'))['db'];config[_0x8e0e('0x18')]=_[_0x8e0e('0x19')](config[_0x8e0e('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e0e('0x1a'))(new Redis(config[_0x8e0e('0x18')]));require(_0x8e0e('0x1b'))['register'](socket);var jayson=require(_0x8e0e('0x1c'));var client=jayson[_0x8e0e('0x1d')][_0x8e0e('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x15b1b0,_0x52c5d0,_0x3a994c,_0x3b4f40){return new BPromise(function(_0x387a12,_0x136160){var _0x12b59e=_0x3b4f40||client;return _0x12b59e[_0x8e0e('0x1f')](_0x15b1b0,_0x3a994c)[_0x8e0e('0x20')](function(_0x39fde6){logger[_0x8e0e('0x21')](_0x8e0e('0x22'),_0x52c5d0,_0x8e0e('0x23'));logger[_0x8e0e('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x52c5d0,_0x8e0e('0x23'),JSON['stringify'](_0x39fde6));if(_0x39fde6['error']){if(_0x39fde6[_0x8e0e('0x25')][_0x8e0e('0x26')]===0x1f4){logger[_0x8e0e('0x25')]('ChatQueue,\x20%s,\x20%s',_0x52c5d0,_0x39fde6[_0x8e0e('0x25')][_0x8e0e('0x27')]);return _0x136160(_0x39fde6[_0x8e0e('0x25')][_0x8e0e('0x27')]);}logger[_0x8e0e('0x25')](_0x8e0e('0x22'),_0x52c5d0,_0x39fde6[_0x8e0e('0x25')][_0x8e0e('0x27')]);return _0x387a12(_0x39fde6[_0x8e0e('0x25')][_0x8e0e('0x27')]);}else{logger[_0x8e0e('0x21')](_0x8e0e('0x22'),_0x52c5d0,_0x8e0e('0x23'));_0x387a12(_0x39fde6[_0x8e0e('0x28')][_0x8e0e('0x27')]);}})[_0x8e0e('0x29')](function(_0x5c7505){logger[_0x8e0e('0x25')]('ChatQueue,\x20%s,\x20%s',_0x52c5d0,_0x5c7505);_0x136160(_0x5c7505);});});}function respondWithStatusCode(_0x11e599,_0x103c9d){_0x103c9d=_0x103c9d||0xcc;return function(_0x163f91){if(_0x163f91){return _0x11e599['sendStatus'](_0x103c9d);}return _0x11e599[_0x8e0e('0x2a')](_0x103c9d)['end']();};}function respondWithResult(_0x4e765d,_0xf9f0ee){_0xf9f0ee=_0xf9f0ee||0xc8;return function(_0x1c7e2a){if(_0x1c7e2a){return _0x4e765d[_0x8e0e('0x2a')](_0xf9f0ee)[_0x8e0e('0x2b')](_0x1c7e2a);}};}function respondWithFilteredResult(_0x2a02e3,_0x19505c){return function(_0x44b895){if(_0x44b895){var _0x5e7f4d=typeof _0x19505c[_0x8e0e('0x2c')]==='undefined'&&typeof _0x19505c[_0x8e0e('0x2d')]===_0x8e0e('0x2e');var _0x968655=_0x44b895[_0x8e0e('0x2f')];var _0x3a4eb0=_0x5e7f4d?0x0:_0x19505c[_0x8e0e('0x2c')];var _0x443080=_0x5e7f4d?_0x44b895[_0x8e0e('0x2f')]:_0x19505c[_0x8e0e('0x2c')]+_0x19505c[_0x8e0e('0x2d')];var _0x333b00;if(_0x443080>=_0x968655){_0x443080=_0x968655;_0x333b00=0xc8;}else{_0x333b00=0xce;}_0x2a02e3[_0x8e0e('0x2a')](_0x333b00);return _0x2a02e3[_0x8e0e('0x30')]('Content-Range',_0x3a4eb0+'-'+_0x443080+'/'+_0x968655)[_0x8e0e('0x2b')](_0x44b895);}return null;};}function patchUpdates(_0x2371e6){return function(_0x422b06){try{jsonpatch['apply'](_0x422b06,_0x2371e6,!![]);}catch(_0x2e62ef){return BPromise[_0x8e0e('0x31')](_0x2e62ef);}return _0x422b06[_0x8e0e('0x32')]();};}function saveUpdates(_0x2e6f3d,_0x193103){return function(_0x394acc){if(_0x394acc){return _0x394acc['update'](_0x2e6f3d)[_0x8e0e('0x20')](function(_0x18ab5e){return _0x18ab5e;});}return null;};}function removeEntity(_0x124950,_0x449f04){return function(_0x186c57){if(_0x186c57){return _0x186c57['destroy']()[_0x8e0e('0x20')](function(){var _0x1ae405=_0x186c57['get']({'plain':!![]});var _0x5e6ef9=_0x8e0e('0x33');return db[_0x8e0e('0x34')][_0x8e0e('0x35')]({'where':{'type':_0x5e6ef9,'resourceId':_0x1ae405['id']}})[_0x8e0e('0x20')](function(){return _0x186c57;});})[_0x8e0e('0x20')](function(){_0x124950[_0x8e0e('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d25a3,_0x1ba614){return function(_0x59968f){if(!_0x59968f){_0x1d25a3[_0x8e0e('0x36')](0x194);}return _0x59968f;};}function handleError(_0x19a9b7,_0x4fd8f0){_0x4fd8f0=_0x4fd8f0||0x1f4;return function(_0x4aa12d){logger[_0x8e0e('0x25')](_0x4aa12d[_0x8e0e('0x37')]);if(_0x4aa12d['name']){delete _0x4aa12d[_0x8e0e('0x38')];}_0x19a9b7[_0x8e0e('0x2a')](_0x4fd8f0)[_0x8e0e('0x39')](_0x4aa12d);};}exports[_0x8e0e('0x3a')]=function(_0xe074c2,_0x991ae0){var _0x1aefbb={},_0x518d10={},_0x8ebff0={'count':0x0,'rows':[]};var _0x21552d=_[_0x8e0e('0x3b')](db['ChatQueue'][_0x8e0e('0x3c')],function(_0x8de3c){return{'name':_0x8de3c[_0x8e0e('0x3d')],'type':_0x8de3c['type'][_0x8e0e('0x3e')]};});_0x518d10['model']=_[_0x8e0e('0x3b')](_0x21552d,_0x8e0e('0x38'));_0x518d10[_0x8e0e('0x3f')]=_['keys'](_0xe074c2['query']);_0x518d10['filters']=_['intersection'](_0x518d10['model'],_0x518d10[_0x8e0e('0x3f')]);_0x1aefbb['attributes']=_[_0x8e0e('0x40')](_0x518d10[_0x8e0e('0x41')],qs[_0x8e0e('0x42')](_0xe074c2[_0x8e0e('0x3f')]['fields']));_0x1aefbb['attributes']=_0x1aefbb[_0x8e0e('0x43')][_0x8e0e('0x44')]?_0x1aefbb['attributes']:_0x518d10[_0x8e0e('0x41')];if(!_0xe074c2[_0x8e0e('0x3f')][_0x8e0e('0x45')](_0x8e0e('0x46'))){_0x1aefbb[_0x8e0e('0x2d')]=qs['limit'](_0xe074c2[_0x8e0e('0x3f')][_0x8e0e('0x2d')]);_0x1aefbb[_0x8e0e('0x2c')]=qs['offset'](_0xe074c2[_0x8e0e('0x3f')]['offset']);}_0x1aefbb['order']=qs[_0x8e0e('0x47')](_0xe074c2['query'][_0x8e0e('0x47')]);_0x1aefbb[_0x8e0e('0x48')]=qs[_0x8e0e('0x49')](_[_0x8e0e('0x4a')](_0xe074c2['query'],_0x518d10[_0x8e0e('0x49')]),_0x21552d);if(_0xe074c2[_0x8e0e('0x3f')][_0x8e0e('0x4b')]){_0x1aefbb[_0x8e0e('0x48')]=_[_0x8e0e('0x4c')](_0x1aefbb[_0x8e0e('0x48')],{'$or':_['map'](_0x21552d,function(_0x41f8e4){if(_0x41f8e4[_0x8e0e('0x4d')]!==_0x8e0e('0x4e')){var _0x26df27={};_0x26df27[_0x41f8e4[_0x8e0e('0x38')]]={'$like':'%'+_0xe074c2['query'][_0x8e0e('0x4b')]+'%'};return _0x26df27;}})});}_0x1aefbb=_[_0x8e0e('0x4c')]({},_0x1aefbb,_0xe074c2[_0x8e0e('0x4f')]);var _0x2e3288={'where':_0x1aefbb[_0x8e0e('0x48')]};return db['ChatQueue'][_0x8e0e('0x2f')](_0x2e3288)[_0x8e0e('0x20')](function(_0x5747ea){_0x8ebff0['count']=_0x5747ea;if(_0xe074c2[_0x8e0e('0x3f')]['includeAll']){_0x1aefbb['include']=[{'all':!![]}];}return db['ChatQueue'][_0x8e0e('0x50')](_0x1aefbb);})[_0x8e0e('0x20')](function(_0x2d48ec){_0x8ebff0['rows']=_0x2d48ec;return _0x8ebff0;})[_0x8e0e('0x20')](respondWithFilteredResult(_0x991ae0,_0x1aefbb))['catch'](handleError(_0x991ae0,null));};exports[_0x8e0e('0x51')]=function(_0x40003c,_0x2725f9){var _0x3aa046={'raw':!![],'where':{'id':_0x40003c[_0x8e0e('0x52')]['id']}},_0x243105={};_0x243105[_0x8e0e('0x41')]=_[_0x8e0e('0x53')](db[_0x8e0e('0x54')]['rawAttributes']);_0x243105[_0x8e0e('0x3f')]=_[_0x8e0e('0x53')](_0x40003c[_0x8e0e('0x3f')]);_0x243105['filters']=_[_0x8e0e('0x40')](_0x243105[_0x8e0e('0x41')],_0x243105['query']);_0x3aa046[_0x8e0e('0x43')]=_[_0x8e0e('0x40')](_0x243105[_0x8e0e('0x41')],qs['fields'](_0x40003c[_0x8e0e('0x3f')][_0x8e0e('0x42')]));_0x3aa046[_0x8e0e('0x43')]=_0x3aa046[_0x8e0e('0x43')][_0x8e0e('0x44')]?_0x3aa046['attributes']:_0x243105[_0x8e0e('0x41')];if(_0x40003c[_0x8e0e('0x3f')][_0x8e0e('0x55')]){_0x3aa046[_0x8e0e('0x56')]=[{'all':!![]}];}_0x3aa046=_[_0x8e0e('0x4c')]({},_0x3aa046,_0x40003c[_0x8e0e('0x4f')]);return db[_0x8e0e('0x54')]['find'](_0x3aa046)[_0x8e0e('0x20')](handleEntityNotFound(_0x2725f9,null))[_0x8e0e('0x20')](respondWithResult(_0x2725f9,null))[_0x8e0e('0x29')](handleError(_0x2725f9,null));};exports[_0x8e0e('0x57')]=function(_0x40f7a6,_0x3eb3d6){return db['ChatQueue'][_0x8e0e('0x57')](_0x40f7a6['body'],{})[_0x8e0e('0x20')](function(_0x3fb155){var _0x55f5ef=_0x40f7a6[_0x8e0e('0x58')][_0x8e0e('0x59')]({'plain':!![]});if(!_0x55f5ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55f5ef[_0x8e0e('0x5a')]===_0x8e0e('0x58')){var _0x40a22a=_0x3fb155[_0x8e0e('0x59')]({'plain':!![]});var _0x22cb92='ChatQueues';return db[_0x8e0e('0x5b')][_0x8e0e('0x5c')]({'where':{'name':_0x22cb92,'userProfileId':_0x55f5ef['userProfileId']},'raw':!![]})[_0x8e0e('0x20')](function(_0x57ceeb){if(_0x57ceeb&&_0x57ceeb[_0x8e0e('0x5d')]===0x0){return db[_0x8e0e('0x34')][_0x8e0e('0x57')]({'name':_0x40a22a[_0x8e0e('0x38')],'resourceId':_0x40a22a['id'],'type':_0x57ceeb[_0x8e0e('0x38')],'sectionId':_0x57ceeb['id']},{})[_0x8e0e('0x20')](function(){return _0x3fb155;});}else{return _0x3fb155;}})[_0x8e0e('0x29')](function(_0x174dcc){logger[_0x8e0e('0x25')](_0x8e0e('0x5e'),_0x174dcc);throw _0x174dcc;});}return _0x3fb155;})[_0x8e0e('0x20')](respondWithResult(_0x3eb3d6,0xc9))[_0x8e0e('0x29')](handleError(_0x3eb3d6,null));};exports[_0x8e0e('0x5f')]=function(_0x6541c9,_0x1e165f){if(_0x6541c9[_0x8e0e('0x60')]['id']){delete _0x6541c9['body']['id'];}return db['ChatQueue']['find']({'where':{'id':_0x6541c9[_0x8e0e('0x52')]['id']}})[_0x8e0e('0x20')](handleEntityNotFound(_0x1e165f,null))['then'](saveUpdates(_0x6541c9[_0x8e0e('0x60')],null))[_0x8e0e('0x20')](respondWithResult(_0x1e165f,null))[_0x8e0e('0x29')](handleError(_0x1e165f,null));};exports['destroy']=function(_0x24cc85,_0x7ea471){return db[_0x8e0e('0x54')]['find']({'where':{'id':_0x24cc85[_0x8e0e('0x52')]['id']}})['then'](handleEntityNotFound(_0x7ea471,null))['then'](removeEntity(_0x7ea471,null))['catch'](handleError(_0x7ea471,null));};exports[_0x8e0e('0x61')]=function(_0x41c564,_0x1145ad){return db[_0x8e0e('0x54')][_0x8e0e('0x61')]()[_0x8e0e('0x20')](respondWithResult(_0x1145ad,null))['catch'](handleError(_0x1145ad,null));};exports[_0x8e0e('0x62')]=function(_0x4e1c8d,_0x344cea,_0x1ec971){var _0x1f7508={'raw':!![],'where':{}},_0x11e1fe={},_0x34f5fc;return db[_0x8e0e('0x54')][_0x8e0e('0x63')]({'where':{'id':_0x4e1c8d[_0x8e0e('0x52')]['id']}})[_0x8e0e('0x20')](handleEntityNotFound(_0x344cea,null))[_0x8e0e('0x20')](function(_0x77492d){if(_0x77492d){_0x34f5fc=_0x77492d[_0x8e0e('0x59')]({'plain':!![]});_0x11e1fe[_0x8e0e('0x41')]=_[_0x8e0e('0x53')](db['UserChatQueue'][_0x8e0e('0x3c')]);_0x11e1fe['query']=_[_0x8e0e('0x53')](_0x4e1c8d[_0x8e0e('0x3f')]);_0x11e1fe[_0x8e0e('0x49')]=_['intersection'](_0x11e1fe[_0x8e0e('0x41')],_0x11e1fe[_0x8e0e('0x3f')]);_0x1f7508['attributes']=_[_0x8e0e('0x40')](_0x11e1fe['model'],qs['fields'](_0x4e1c8d[_0x8e0e('0x3f')][_0x8e0e('0x42')]));_0x1f7508['attributes']=_0x1f7508[_0x8e0e('0x43')][_0x8e0e('0x44')]?_0x1f7508['attributes']:_0x11e1fe['model'];if(!_0x4e1c8d[_0x8e0e('0x3f')][_0x8e0e('0x45')](_0x8e0e('0x46'))){_0x1f7508[_0x8e0e('0x2d')]=qs[_0x8e0e('0x2d')](_0x4e1c8d[_0x8e0e('0x3f')]['limit']);_0x1f7508[_0x8e0e('0x2c')]=qs[_0x8e0e('0x2c')](_0x4e1c8d[_0x8e0e('0x3f')][_0x8e0e('0x2c')]);}_0x1f7508[_0x8e0e('0x64')]=qs[_0x8e0e('0x47')](_0x4e1c8d[_0x8e0e('0x3f')][_0x8e0e('0x47')]);_0x1f7508['where']=qs['filters'](_[_0x8e0e('0x4a')](_0x4e1c8d[_0x8e0e('0x3f')],_0x11e1fe['filters']));_0x1f7508['where'][_0x8e0e('0x65')]=_0x77492d['id'];if(_0x4e1c8d[_0x8e0e('0x3f')][_0x8e0e('0x4b')]){_0x1f7508['where']=_[_0x8e0e('0x4c')](_0x1f7508[_0x8e0e('0x48')],{'$or':_[_0x8e0e('0x3b')](_0x1f7508[_0x8e0e('0x43')],function(_0x159ec3){var _0x19c862={};_0x19c862[_0x159ec3]={'$like':'%'+_0x4e1c8d[_0x8e0e('0x3f')][_0x8e0e('0x4b')]+'%'};return _0x19c862;})});}_0x1f7508=_[_0x8e0e('0x4c')]({},_0x1f7508,_0x4e1c8d[_0x8e0e('0x4f')]);return db[_0x8e0e('0x66')]['findAll'](_0x1f7508);}})['then'](function(_0x1bfe66){if(_0x1bfe66){return db[_0x8e0e('0x67')][_0x8e0e('0x68')]({'where':{'id':_[_0x8e0e('0x3b')](_0x1bfe66,'UserId'),'role':_0x8e0e('0x69')},'attributes':['id',_0x8e0e('0x38'),_0x8e0e('0x6a'),_0x8e0e('0x6b'),_0x8e0e('0x6c')]});}})[_0x8e0e('0x20')](function(_0x5d65c9){if(_0x5d65c9){return{'count':_0x5d65c9['count'],'rows':_['map'](_0x5d65c9[_0x8e0e('0x6d')],function(_0x3beedb){return{'membername':_0x3beedb[_0x8e0e('0x38')],'UserId':_0x3beedb['id'],'queue_name':_0x34f5fc['name'],'ChatQueueId':_0x34f5fc['id'],'interface':util[_0x8e0e('0x6e')](_0x8e0e('0x6f'),_0x8e0e('0x70'),_0x3beedb[_0x8e0e('0x38')]),'penalty':0x0,'paused':_0x3beedb[_0x8e0e('0x6a')],'createdAt':_0x3beedb[_0x8e0e('0x6c')],'updatedAt':_0x3beedb[_0x8e0e('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8e0e('0x20')](respondWithFilteredResult(_0x344cea,_0x1f7508))['catch'](handleError(_0x344cea,null));};exports[_0x8e0e('0x71')]=function(_0x434c97,_0x45f471,_0x34c1e8){var _0x544ce7={};var _0x4bda98={};var _0x318036;var _0x1f4d06;return db[_0x8e0e('0x54')][_0x8e0e('0x63')]({'where':{'id':_0x434c97[_0x8e0e('0x52')]['id']}})[_0x8e0e('0x20')](handleEntityNotFound(_0x45f471,null))[_0x8e0e('0x20')](function(_0x91c0a6){if(_0x91c0a6){_0x318036=_0x91c0a6;_0x4bda98['model']=_[_0x8e0e('0x53')](db[_0x8e0e('0x72')][_0x8e0e('0x3c')]);_0x4bda98[_0x8e0e('0x3f')]=_[_0x8e0e('0x53')](_0x434c97['query']);_0x4bda98[_0x8e0e('0x49')]=_['intersection'](_0x4bda98['model'],_0x4bda98[_0x8e0e('0x3f')]);_0x544ce7[_0x8e0e('0x43')]=_[_0x8e0e('0x40')](_0x4bda98[_0x8e0e('0x41')],qs[_0x8e0e('0x42')](_0x434c97['query'][_0x8e0e('0x42')]));_0x544ce7['attributes']=_0x544ce7[_0x8e0e('0x43')][_0x8e0e('0x44')]?_0x544ce7[_0x8e0e('0x43')]:_0x4bda98[_0x8e0e('0x41')];_0x544ce7[_0x8e0e('0x64')]=qs[_0x8e0e('0x47')](_0x434c97[_0x8e0e('0x3f')][_0x8e0e('0x47')]);_0x544ce7[_0x8e0e('0x48')]=qs[_0x8e0e('0x49')](_['pick'](_0x434c97['query'],_0x4bda98[_0x8e0e('0x49')]));if(_0x434c97[_0x8e0e('0x3f')][_0x8e0e('0x4b')]){_0x544ce7[_0x8e0e('0x48')]=_[_0x8e0e('0x4c')](_0x544ce7[_0x8e0e('0x48')],{'$or':_['map'](_0x544ce7['attributes'],function(_0x72304a){var _0x208723={};_0x208723[_0x72304a]={'$like':'%'+_0x434c97['query'][_0x8e0e('0x4b')]+'%'};return _0x208723;})});}_0x544ce7=_['merge']({},_0x544ce7,_0x434c97[_0x8e0e('0x4f')]);return _0x318036[_0x8e0e('0x71')](_0x544ce7);}})['then'](function(_0x356794){if(_0x356794){_0x1f4d06=_0x356794[_0x8e0e('0x44')];if(!_0x434c97['query'][_0x8e0e('0x45')](_0x8e0e('0x46'))){_0x544ce7[_0x8e0e('0x2d')]=qs[_0x8e0e('0x2d')](_0x434c97[_0x8e0e('0x3f')][_0x8e0e('0x2d')]);_0x544ce7[_0x8e0e('0x2c')]=qs[_0x8e0e('0x2c')](_0x434c97[_0x8e0e('0x3f')][_0x8e0e('0x2c')]);}return _0x318036['getTeams'](_0x544ce7);}})[_0x8e0e('0x20')](function(_0x4c3df1){if(_0x4c3df1){return _0x4c3df1?{'count':_0x1f4d06,'rows':_0x4c3df1}:null;}})[_0x8e0e('0x20')](respondWithResult(_0x45f471,null))[_0x8e0e('0x29')](handleError(_0x45f471,null));};exports[_0x8e0e('0x73')]=function(_0x3c7a58,_0x1c6923,_0x555b47){var _0xd986e5=_0x3c7a58[_0x8e0e('0x60')][_0x8e0e('0x74')];return db['Team'][_0x8e0e('0x50')]({'where':{'id':_0xd986e5},'attributes':['id'],'include':[{'model':db[_0x8e0e('0x67')],'as':'Agents','attributes':['id',_0x8e0e('0x38'),_0x8e0e('0x75'),_0x8e0e('0x76'),_0x8e0e('0x77')],'raw':!![]}]})[_0x8e0e('0x20')](function(_0x27bde6){if(_0x27bde6){var _0x10240e=_[_0x8e0e('0x78')](_0x27bde6,function(_0x18c60c){var _0x5e7a56=_0x18c60c['get']({'plain':!![]});return _0x5e7a56[_0x8e0e('0x79')];});return db[_0x8e0e('0x54')][_0x8e0e('0x5c')]({'where':{'id':_0x3c7a58['params']['id']}})[_0x8e0e('0x20')](function(_0x32b93a){return db[_0x8e0e('0x7a')]['transaction'](function(_0x6aae29){return _0x32b93a[_0x8e0e('0x73')](_0xd986e5,{'transaction':_0x6aae29})[_0x8e0e('0x20')](function(){return BPromise[_0x8e0e('0x7b')](_0x10240e,function(_0x19ab52){return db[_0x8e0e('0x66')]['findOrCreate']({'where':{'UserId':_0x19ab52['id'],'ChatQueueId':_0x3c7a58[_0x8e0e('0x52')]['id']},'transaction':_0x6aae29});});})['then'](function(){_0x10240e['forEach'](function(_0x421439){socket[_0x8e0e('0x7c')](_0x8e0e('0x7d'),{'UserId':_0x421439['id'],'ChatQueueId':_0x32b93a['id']});});});});});}})[_0x8e0e('0x20')](respondWithStatusCode(_0x1c6923,null))[_0x8e0e('0x29')](handleError(_0x1c6923,null));};exports[_0x8e0e('0x7e')]=function(_0x589ab9,_0x826ce0,_0x1d8b92){return db[_0x8e0e('0x72')]['findAll']({'where':{'id':_0x589ab9['query'][_0x8e0e('0x74')]},'attributes':['id'],'include':[{'model':db[_0x8e0e('0x67')],'as':_0x8e0e('0x79'),'attributes':['id'],'raw':!![]}]})[_0x8e0e('0x20')](handleEntityNotFound(_0x826ce0,null))['then'](function(_0x33f764){var _0x56be50=_[_0x8e0e('0x3b')](_0x33f764,'id');var _0x31559d=[];var _0x1b871c=[];var _0x493400=squel['select']();_0x493400['field'](_0x8e0e('0x7f'))[_0x8e0e('0x80')]('team_has_chat_queues','tq')['join'](_0x8e0e('0x81'),'ut',_0x8e0e('0x82'))[_0x8e0e('0x48')](_0x8e0e('0x83'),_0x589ab9[_0x8e0e('0x52')]['id']);for(var _0x1a8b8a=0x0;_0x1a8b8a<_0x33f764['length'];_0x1a8b8a+=0x1){let _0x210fa5=_0x33f764[_0x1a8b8a];for(var _0x406066=0x0;_0x406066<_0x210fa5[_0x8e0e('0x79')][_0x8e0e('0x44')];_0x406066+=0x1){let _0x38df43=_0x210fa5[_0x8e0e('0x79')][_0x406066];var _0x20c996=_0x493400[_0x8e0e('0x84')]();_0x20c996[_0x8e0e('0x48')]('ut.UserId\x20=\x20?',_0x38df43['id']);_0x1b871c[_0x8e0e('0x85')](db['sequelize'][_0x8e0e('0x3f')](_0x20c996[_0x8e0e('0x86')](),{'type':db[_0x8e0e('0x7a')][_0x8e0e('0x87')][_0x8e0e('0x88')]})[_0x8e0e('0x20')](function(_0x1a70a8){if(_0x1a70a8[_0x8e0e('0x44')]===0x1){return _0x38df43['id'];}else{var _0x2ba115=_[_0x8e0e('0x89')](_[_0x8e0e('0x3b')](_0x1a70a8,'TeamId'),function(_0x306722){return _['includes'](_0x56be50,_0x306722);});if(_0x2ba115){return _0x38df43['id'];}}}));}}return BPromise[_0x8e0e('0x8a')](_0x1b871c)[_0x8e0e('0x20')](function(_0x171fde){_0x31559d=_(_0x31559d)[_0x8e0e('0x8b')](_0x171fde)['compact']()[_0x8e0e('0x8c')]();return db[_0x8e0e('0x54')]['find']({'where':{'id':_0x589ab9[_0x8e0e('0x52')]['id']}})[_0x8e0e('0x20')](function(_0x3642b1){return db[_0x8e0e('0x7a')][_0x8e0e('0x8d')](function(_0x34ba45){return _0x3642b1[_0x8e0e('0x7e')](_0x589ab9[_0x8e0e('0x3f')][_0x8e0e('0x74')],{'transaction':_0x34ba45})[_0x8e0e('0x20')](function(){if(!_['isEmpty'](_0x31559d)){return _0x3642b1[_0x8e0e('0x8e')](_0x31559d,{'transaction':_0x34ba45});}})['then'](function(){_0x31559d['forEach'](function(_0x37aaf3){socket[_0x8e0e('0x7c')](_0x8e0e('0x8f'),{'UserId':_0x37aaf3,'ChatQueueId':_0x3642b1['id']});});});});});});})[_0x8e0e('0x20')](respondWithStatusCode(_0x826ce0,null))[_0x8e0e('0x29')](handleError(_0x826ce0,null));};exports['addAgents']=function(_0x5ba4bb,_0x174160,_0x20b1a6){return db[_0x8e0e('0x54')][_0x8e0e('0x5c')]({'where':{'id':_0x5ba4bb['params']['id']}})[_0x8e0e('0x20')](handleEntityNotFound(_0x174160,null))[_0x8e0e('0x20')](function(_0x15712a){if(_0x15712a){return _0x15712a[_0x8e0e('0x90')](_0x5ba4bb[_0x8e0e('0x60')][_0x8e0e('0x74')],_[_0x8e0e('0x91')](_0x5ba4bb[_0x8e0e('0x60')],['ids','id'])||{})[_0x8e0e('0x92')](function(_0x305f74){for(var _0x4df317=0x0;_0x4df317<_0x5ba4bb['body'][_0x8e0e('0x74')][_0x8e0e('0x44')];_0x4df317+=0x1){socket[_0x8e0e('0x7c')](_0x8e0e('0x7d'),{'UserId':_0x5ba4bb[_0x8e0e('0x60')][_0x8e0e('0x74')][_0x4df317],'ChatQueueId':_0x5ba4bb[_0x8e0e('0x52')]['id']});}return _0x305f74;});}})[_0x8e0e('0x20')](respondWithResult(_0x174160,null))['catch'](handleError(_0x174160,null));};exports[_0x8e0e('0x8e')]=function(_0x58865e,_0x102103,_0x2e89e9){return db[_0x8e0e('0x54')][_0x8e0e('0x5c')]({'where':{'id':_0x58865e[_0x8e0e('0x52')]['id']}})[_0x8e0e('0x20')](handleEntityNotFound(_0x102103,null))[_0x8e0e('0x20')](function(_0x977626){if(_0x977626){return _0x977626[_0x8e0e('0x8e')](_0x58865e['query'][_0x8e0e('0x74')])[_0x8e0e('0x20')](function(){if(_[_0x8e0e('0x93')](_0x58865e[_0x8e0e('0x3f')][_0x8e0e('0x74')])){for(var _0x5c5bb4=0x0;_0x5c5bb4<_0x58865e[_0x8e0e('0x3f')][_0x8e0e('0x74')][_0x8e0e('0x44')];_0x5c5bb4+=0x1){socket[_0x8e0e('0x7c')](_0x8e0e('0x8f'),{'UserId':Number(_0x58865e[_0x8e0e('0x3f')][_0x8e0e('0x74')][_0x5c5bb4]),'ChatQueueId':Number(_0x58865e[_0x8e0e('0x52')]['id'])});}}else{socket[_0x8e0e('0x7c')]('userChatQueue:remove',{'UserId':Number(_0x58865e['query'][_0x8e0e('0x74')]),'ChatQueueId':Number(_0x58865e[_0x8e0e('0x52')]['id'])});}});}})[_0x8e0e('0x20')](respondWithStatusCode(_0x102103,null))[_0x8e0e('0x29')](handleError(_0x102103,null));};exports[_0x8e0e('0x94')]=function(_0x1d02d1,_0x1d331b,_0x401239){var _0x2b2ac9={};var _0x1b448c={};var _0x13cbe8;var _0x4de161;return db[_0x8e0e('0x54')]['findOne']({'where':{'id':_0x1d02d1[_0x8e0e('0x52')]['id']}})['then'](handleEntityNotFound(_0x1d331b,null))[_0x8e0e('0x20')](function(_0x4c64b3){if(_0x4c64b3){_0x13cbe8=_0x4c64b3;_0x1b448c[_0x8e0e('0x41')]=_[_0x8e0e('0x53')](db[_0x8e0e('0x67')]['rawAttributes']);_0x1b448c['query']=_['keys'](_0x1d02d1[_0x8e0e('0x3f')]);_0x1b448c['filters']=_[_0x8e0e('0x40')](_0x1b448c[_0x8e0e('0x41')],_0x1b448c[_0x8e0e('0x3f')]);_0x2b2ac9[_0x8e0e('0x43')]=_[_0x8e0e('0x40')](_0x1b448c[_0x8e0e('0x41')],qs[_0x8e0e('0x42')](_0x1d02d1['query']['fields']));_0x2b2ac9['attributes']=_0x2b2ac9[_0x8e0e('0x43')][_0x8e0e('0x44')]?_0x2b2ac9['attributes']:_0x1b448c[_0x8e0e('0x41')];_0x2b2ac9[_0x8e0e('0x64')]=qs['sort'](_0x1d02d1['query'][_0x8e0e('0x47')]);_0x2b2ac9[_0x8e0e('0x48')]=qs[_0x8e0e('0x49')](_[_0x8e0e('0x4a')](_0x1d02d1[_0x8e0e('0x3f')],_0x1b448c['filters']));if(_0x1d02d1['query']['filter']){_0x2b2ac9['where']=_[_0x8e0e('0x4c')](_0x2b2ac9[_0x8e0e('0x48')],{'$or':_[_0x8e0e('0x3b')](_0x2b2ac9[_0x8e0e('0x43')],function(_0x3a9113){var _0x39bb29={};_0x39bb29[_0x3a9113]={'$like':'%'+_0x1d02d1[_0x8e0e('0x3f')][_0x8e0e('0x4b')]+'%'};return _0x39bb29;})});}_0x2b2ac9=_[_0x8e0e('0x4c')]({},_0x2b2ac9,_0x1d02d1[_0x8e0e('0x4f')]);return _0x13cbe8[_0x8e0e('0x94')](_0x2b2ac9);}})['then'](function(_0x5f3683){if(_0x5f3683){_0x4de161=_0x5f3683[_0x8e0e('0x44')];if(!_0x1d02d1[_0x8e0e('0x3f')]['hasOwnProperty'](_0x8e0e('0x46'))){_0x2b2ac9['limit']=qs[_0x8e0e('0x2d')](_0x1d02d1[_0x8e0e('0x3f')][_0x8e0e('0x2d')]);_0x2b2ac9['offset']=qs[_0x8e0e('0x2c')](_0x1d02d1[_0x8e0e('0x3f')][_0x8e0e('0x2c')]);}return _0x13cbe8[_0x8e0e('0x94')](_0x2b2ac9);}})[_0x8e0e('0x20')](function(_0x4d235a){if(_0x4d235a){return _0x4d235a?{'count':_0x4de161,'rows':_0x4d235a}:null;}})[_0x8e0e('0x20')](respondWithResult(_0x1d331b,null))[_0x8e0e('0x29')](handleError(_0x1d331b,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 3a2620c..285e324 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 _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x34d275,_0x5d84ee){var _0x1379cc=function(_0x320fbe){while(--_0x320fbe){_0x34d275['push'](_0x34d275['shift']());}};_0x1379cc(++_0x5d84ee);}(_0xadb5,0xad));var _0x5adb=function(_0x5d8763,_0x1b8327){_0x5d8763=_0x5d8763-0x0;var _0x36a714=_0xadb5[_0x5d8763];return _0x36a714;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x5adb('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatQueueEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatQueueEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatQueue[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x2ee46c,_0x27af4f){var _0x829f33=function(_0x31d4bf){while(--_0x31d4bf){_0x2ee46c['push'](_0x2ee46c['shift']());}};_0x829f33(++_0x27af4f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1c2ade,_0x1cd24d){_0x1c2ade=_0x1c2ade-0x0;var _0x166ee7=_0x5f2f[_0x1c2ade];return _0x166ee7;};'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 85755dc..f78b566 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 _0x504c=['bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','../../config/logger','api'];(function(_0x486b00,_0x501df5){var _0x47ea82=function(_0x997782){while(--_0x997782){_0x486b00['push'](_0x486b00['shift']());}};_0x47ea82(++_0x501df5);}(_0x504c,0x1cb));var _0xc504=function(_0x33dcf7,_0x3d5390){_0x33dcf7=_0x33dcf7-0x0;var _0x542d4e=_0x504c[_0x33dcf7];return _0x542d4e;};'use strict';var _=require(_0xc504('0x0'));var util=require('util');var logger=require(_0xc504('0x1'))(_0xc504('0x2'));var moment=require('moment');var BPromise=require(_0xc504('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc504('0x4'));var rimraf=require(_0xc504('0x5'));var config=require(_0xc504('0x6'));var attributes=require(_0xc504('0x7'));module[_0xc504('0x8')]=function(_0x950956,_0x46ac88){return _0x950956[_0xc504('0x9')]('ChatQueue',attributes,{'tableName':_0xc504('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x643e=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','lodash'];(function(_0x247aab,_0x6d308){var _0x198cd0=function(_0x2bf3a4){while(--_0x2bf3a4){_0x247aab['push'](_0x247aab['shift']());}};_0x198cd0(++_0x6d308);}(_0x643e,0x13a));var _0xe643=function(_0x4ea27,_0x54c12b){_0x4ea27=_0x4ea27-0x0;var _0x532384=_0x643e[_0x4ea27];return _0x532384;};'use strict';var _=require(_0xe643('0x0'));var util=require('util');var logger=require(_0xe643('0x1'))(_0xe643('0x2'));var moment=require(_0xe643('0x3'));var BPromise=require('bluebird');var rp=require(_0xe643('0x4'));var fs=require('fs');var path=require(_0xe643('0x5'));var rimraf=require(_0xe643('0x6'));var config=require(_0xe643('0x7'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x13f6ad,_0x1eb33a){return _0x13f6ad[_0xe643('0x8')]('ChatQueue',attributes,{'tableName':'chat_queues','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 fa05fa4..e677183 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 _0x2f0c=['map','model','stringify','ShowChatQueue','find','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x56557f,_0xc4df7a){var _0x28ae74=function(_0x140cca){while(--_0x140cca){_0x56557f['push'](_0x56557f['shift']());}};_0x28ae74(++_0xc4df7a);}(_0x2f0c,0x1b2));var _0xc2f0=function(_0x40eec9,_0x817a67){_0x40eec9=_0x40eec9-0x0;var _0xfee890=_0x2f0c[_0x40eec9];return _0xfee890;};'use strict';var _=require(_0xc2f0('0x0'));var util=require(_0xc2f0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc2f0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2f0('0x3'))['db'];var utils=require(_0xc2f0('0x4'));var logger=require('../../config/logger')(_0xc2f0('0x5'));var config=require(_0xc2f0('0x6'));var jayson=require(_0xc2f0('0x7'));var client=jayson['client'][_0xc2f0('0x8')]({'port':0x232a});config['redis']=_[_0xc2f0('0x9')](config[_0xc2f0('0xa')],{'host':_0xc2f0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc2f0('0xa')]));require(_0xc2f0('0xc'))[_0xc2f0('0xd')](socket);function respondWithRpcPromise(_0xc3c26c,_0x6996be,_0x2356af){return new BPromise(function(_0x27920e,_0x14ee86){return client[_0xc2f0('0xe')](_0xc3c26c,_0x2356af)[_0xc2f0('0xf')](function(_0x49231b){logger[_0xc2f0('0x10')](_0xc2f0('0x11'),_0x6996be,_0xc2f0('0x12'));logger[_0xc2f0('0x13')](_0xc2f0('0x14'),_0x6996be,'request\x20sent',JSON['stringify'](_0x49231b));if(_0x49231b[_0xc2f0('0x15')]){if(_0x49231b[_0xc2f0('0x15')][_0xc2f0('0x16')]===0x1f4){logger['error'](_0xc2f0('0x11'),_0x6996be,_0x49231b[_0xc2f0('0x15')]['message']);return _0x14ee86(_0x49231b[_0xc2f0('0x15')][_0xc2f0('0x17')]);}logger[_0xc2f0('0x15')](_0xc2f0('0x11'),_0x6996be,_0x49231b['error'][_0xc2f0('0x17')]);return _0x27920e(_0x49231b[_0xc2f0('0x15')]['message']);}else{logger[_0xc2f0('0x10')](_0xc2f0('0x11'),_0x6996be,_0xc2f0('0x12'));_0x27920e(_0x49231b['result']['message']);}})[_0xc2f0('0x18')](function(_0x1b51e3){logger[_0xc2f0('0x15')]('ChatQueue,\x20%s,\x20%s',_0x6996be,_0x1b51e3);_0x14ee86(_0x1b51e3);});});}exports[_0xc2f0('0x19')]=function(_0x570018){var _0x1d5135=this;return new Promise(function(_0x1b32d1,_0x4b868f){return db[_0xc2f0('0x1a')][_0xc2f0('0x1b')]({'raw':_0x570018[_0xc2f0('0x1c')]?_0x570018['options'][_0xc2f0('0x1d')]===undefined?!![]:![]:!![],'where':_0x570018[_0xc2f0('0x1c')]?_0x570018[_0xc2f0('0x1c')][_0xc2f0('0x1e')]||null:null,'attributes':_0x570018['options']?_0x570018['options'][_0xc2f0('0x1f')]||null:null,'limit':_0x570018[_0xc2f0('0x1c')]?_0x570018['options'][_0xc2f0('0x20')]||null:null,'include':_0x570018[_0xc2f0('0x1c')]?_0x570018[_0xc2f0('0x1c')][_0xc2f0('0x21')]?_[_0xc2f0('0x22')](_0x570018[_0xc2f0('0x1c')]['include'],function(_0x391ef5){return{'model':db[_0x391ef5[_0xc2f0('0x23')]],'as':_0x391ef5['as'],'attributes':_0x391ef5[_0xc2f0('0x1f')],'include':_0x391ef5[_0xc2f0('0x21')]?_['map'](_0x391ef5[_0xc2f0('0x21')],function(_0x302996){return{'model':db[_0x302996[_0xc2f0('0x23')]],'as':_0x302996['as'],'attributes':_0x302996[_0xc2f0('0x1f')],'include':_0x302996['include']?_['map'](_0x302996[_0xc2f0('0x21')],function(_0x245502){return{'model':db[_0x245502['model']],'as':_0x245502['as'],'attributes':_0x245502[_0xc2f0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc2f0('0xf')](function(_0x59d0cb){logger[_0xc2f0('0x10')](_0xc2f0('0x19'),_0x570018);logger[_0xc2f0('0x13')](_0xc2f0('0x19'),_0x570018,JSON[_0xc2f0('0x24')](_0x59d0cb));_0x1b32d1(_0x59d0cb);})['catch'](function(_0xee0399){logger[_0xc2f0('0x15')]('GetChatQueue',_0xee0399['message'],_0x570018);_0x4b868f(_0x1d5135[_0xc2f0('0x15')](0x1f4,_0xee0399['message']));});});};exports[_0xc2f0('0x25')]=function(_0x2ccb37){var _0x2ae67a=this;return new Promise(function(_0x13581a,_0x2dfd25){return db['ChatQueue'][_0xc2f0('0x26')]({'raw':_0x2ccb37['options']?_0x2ccb37[_0xc2f0('0x1c')][_0xc2f0('0x1d')]===undefined?!![]:![]:!![],'where':_0x2ccb37[_0xc2f0('0x1c')]?_0x2ccb37[_0xc2f0('0x1c')][_0xc2f0('0x1e')]||null:null,'attributes':_0x2ccb37[_0xc2f0('0x1c')]?_0x2ccb37[_0xc2f0('0x1c')][_0xc2f0('0x1f')]||null:null,'include':_0x2ccb37[_0xc2f0('0x1c')]?_0x2ccb37['options'][_0xc2f0('0x21')]?_[_0xc2f0('0x22')](_0x2ccb37[_0xc2f0('0x1c')]['include'],function(_0x3e67b6){return{'model':db[_0x3e67b6['model']],'as':_0x3e67b6['as'],'attributes':_0x3e67b6[_0xc2f0('0x1f')],'include':_0x3e67b6[_0xc2f0('0x21')]?_[_0xc2f0('0x22')](_0x3e67b6['include'],function(_0x5584b5){return{'model':db[_0x5584b5[_0xc2f0('0x23')]],'as':_0x5584b5['as'],'attributes':_0x5584b5[_0xc2f0('0x1f')],'include':_0x5584b5[_0xc2f0('0x21')]?_[_0xc2f0('0x22')](_0x5584b5['include'],function(_0x46ccd6){return{'model':db[_0x46ccd6[_0xc2f0('0x23')]],'as':_0x46ccd6['as'],'attributes':_0x46ccd6[_0xc2f0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc2f0('0xf')](function(_0x3b2dd4){logger[_0xc2f0('0x10')](_0xc2f0('0x25'),_0x2ccb37);logger[_0xc2f0('0x13')](_0xc2f0('0x25'),_0x2ccb37,JSON[_0xc2f0('0x24')](_0x3b2dd4));_0x13581a(_0x3b2dd4);})[_0xc2f0('0x18')](function(_0x17f194){logger[_0xc2f0('0x15')](_0xc2f0('0x25'),_0x17f194[_0xc2f0('0x17')],_0x2ccb37);_0x2dfd25(_0x2ae67a[_0xc2f0('0x15')](0x1f4,_0x17f194['message']));});});}; \ No newline at end of file +var _0xa0a3=['ChatQueue','findAll','options','where','attributes','limit','include','map','model','ShowChatQueue','find','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatQueue.socket','register','then','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','catch','GetChatQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x9fb47,_0x2aa792){_0x9fb47=_0x9fb47-0x0;var _0x4973c9=_0xa0a3[_0x9fb47];return _0x4973c9;};'use strict';var _=require('lodash');var util=require(_0x3a0a('0x0'));var moment=require(_0x3a0a('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a0a('0x2'));var fs=require('fs');var Redis=require(_0x3a0a('0x3'));var db=require(_0x3a0a('0x4'))['db'];var utils=require(_0x3a0a('0x5'));var logger=require(_0x3a0a('0x6'))(_0x3a0a('0x7'));var config=require(_0x3a0a('0x8'));var jayson=require(_0x3a0a('0x9'));var client=jayson[_0x3a0a('0xa')][_0x3a0a('0xb')]({'port':0x232a});config[_0x3a0a('0xc')]=_[_0x3a0a('0xd')](config[_0x3a0a('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a0a('0xc')]));require(_0x3a0a('0xe'))[_0x3a0a('0xf')](socket);function respondWithRpcPromise(_0x3460be,_0x43e9ec,_0x272435){return new BPromise(function(_0x42235e,_0x53f366){return client['request'](_0x3460be,_0x272435)[_0x3a0a('0x10')](function(_0x3b1003){logger['info']('ChatQueue,\x20%s,\x20%s',_0x43e9ec,_0x3a0a('0x11'));logger[_0x3a0a('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x43e9ec,_0x3a0a('0x11'),JSON[_0x3a0a('0x13')](_0x3b1003));if(_0x3b1003[_0x3a0a('0x14')]){if(_0x3b1003[_0x3a0a('0x14')][_0x3a0a('0x15')]===0x1f4){logger[_0x3a0a('0x14')](_0x3a0a('0x16'),_0x43e9ec,_0x3b1003[_0x3a0a('0x14')][_0x3a0a('0x17')]);return _0x53f366(_0x3b1003[_0x3a0a('0x14')][_0x3a0a('0x17')]);}logger[_0x3a0a('0x14')](_0x3a0a('0x16'),_0x43e9ec,_0x3b1003[_0x3a0a('0x14')]['message']);return _0x42235e(_0x3b1003[_0x3a0a('0x14')]['message']);}else{logger[_0x3a0a('0x18')](_0x3a0a('0x16'),_0x43e9ec,_0x3a0a('0x11'));_0x42235e(_0x3b1003['result'][_0x3a0a('0x17')]);}})[_0x3a0a('0x19')](function(_0x4f0372){logger[_0x3a0a('0x14')](_0x3a0a('0x16'),_0x43e9ec,_0x4f0372);_0x53f366(_0x4f0372);});});}exports[_0x3a0a('0x1a')]=function(_0x36ca41){var _0x91d764=this;return new Promise(function(_0x423990,_0x3e99f9){return db[_0x3a0a('0x1b')][_0x3a0a('0x1c')]({'raw':_0x36ca41[_0x3a0a('0x1d')]?_0x36ca41['options']['raw']===undefined?!![]:![]:!![],'where':_0x36ca41['options']?_0x36ca41[_0x3a0a('0x1d')][_0x3a0a('0x1e')]||null:null,'attributes':_0x36ca41[_0x3a0a('0x1d')]?_0x36ca41[_0x3a0a('0x1d')][_0x3a0a('0x1f')]||null:null,'limit':_0x36ca41['options']?_0x36ca41[_0x3a0a('0x1d')][_0x3a0a('0x20')]||null:null,'include':_0x36ca41[_0x3a0a('0x1d')]?_0x36ca41['options'][_0x3a0a('0x21')]?_[_0x3a0a('0x22')](_0x36ca41['options']['include'],function(_0x16e93d){return{'model':db[_0x16e93d[_0x3a0a('0x23')]],'as':_0x16e93d['as'],'attributes':_0x16e93d[_0x3a0a('0x1f')],'include':_0x16e93d['include']?_[_0x3a0a('0x22')](_0x16e93d[_0x3a0a('0x21')],function(_0x130ca6){return{'model':db[_0x130ca6[_0x3a0a('0x23')]],'as':_0x130ca6['as'],'attributes':_0x130ca6[_0x3a0a('0x1f')],'include':_0x130ca6['include']?_['map'](_0x130ca6[_0x3a0a('0x21')],function(_0x3d01d8){return{'model':db[_0x3d01d8['model']],'as':_0x3d01d8['as'],'attributes':_0x3d01d8['attributes']};}):[]};}):[]};}):[]:[]})[_0x3a0a('0x10')](function(_0x2e7481){logger[_0x3a0a('0x18')](_0x3a0a('0x1a'),_0x36ca41);logger['debug']('GetChatQueue',_0x36ca41,JSON[_0x3a0a('0x13')](_0x2e7481));_0x423990(_0x2e7481);})[_0x3a0a('0x19')](function(_0x177181){logger['error'](_0x3a0a('0x1a'),_0x177181[_0x3a0a('0x17')],_0x36ca41);_0x3e99f9(_0x91d764[_0x3a0a('0x14')](0x1f4,_0x177181[_0x3a0a('0x17')]));});});};exports[_0x3a0a('0x24')]=function(_0x3184cb){var _0x26ff5d=this;return new Promise(function(_0x1218fd,_0x21be1c){return db['ChatQueue'][_0x3a0a('0x25')]({'raw':_0x3184cb[_0x3a0a('0x1d')]?_0x3184cb[_0x3a0a('0x1d')][_0x3a0a('0x26')]===undefined?!![]:![]:!![],'where':_0x3184cb[_0x3a0a('0x1d')]?_0x3184cb['options'][_0x3a0a('0x1e')]||null:null,'attributes':_0x3184cb[_0x3a0a('0x1d')]?_0x3184cb[_0x3a0a('0x1d')][_0x3a0a('0x1f')]||null:null,'include':_0x3184cb[_0x3a0a('0x1d')]?_0x3184cb[_0x3a0a('0x1d')]['include']?_[_0x3a0a('0x22')](_0x3184cb[_0x3a0a('0x1d')][_0x3a0a('0x21')],function(_0x32c2e1){return{'model':db[_0x32c2e1[_0x3a0a('0x23')]],'as':_0x32c2e1['as'],'attributes':_0x32c2e1[_0x3a0a('0x1f')],'include':_0x32c2e1[_0x3a0a('0x21')]?_[_0x3a0a('0x22')](_0x32c2e1['include'],function(_0x2301be){return{'model':db[_0x2301be[_0x3a0a('0x23')]],'as':_0x2301be['as'],'attributes':_0x2301be[_0x3a0a('0x1f')],'include':_0x2301be[_0x3a0a('0x21')]?_[_0x3a0a('0x22')](_0x2301be[_0x3a0a('0x21')],function(_0x2ab6d2){return{'model':db[_0x2ab6d2[_0x3a0a('0x23')]],'as':_0x2ab6d2['as'],'attributes':_0x2ab6d2['attributes']};}):[]};}):[]};}):[]:[]})[_0x3a0a('0x10')](function(_0x143696){logger[_0x3a0a('0x18')](_0x3a0a('0x24'),_0x3184cb);logger[_0x3a0a('0x12')](_0x3a0a('0x24'),_0x3184cb,JSON[_0x3a0a('0x13')](_0x143696));_0x1218fd(_0x143696);})[_0x3a0a('0x19')](function(_0xea232d){logger['error'](_0x3a0a('0x24'),_0xea232d['message'],_0x3184cb);_0x21be1c(_0x26ff5d[_0x3a0a('0x14')](0x1f4,_0xea232d[_0x3a0a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 053e0d0..15f410c 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 _0xbaf0=['removeListener','register','length','chatQueue:','save','remove','update'];(function(_0xa04c75,_0x431bcd){var _0x51c8f5=function(_0x1d1d1f){while(--_0x1d1d1f){_0xa04c75['push'](_0xa04c75['shift']());}};_0x51c8f5(++_0x431bcd);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x0baf('0x0'),_0x0baf('0x1'),_0x0baf('0x2')];function createListener(_0x263f79,_0x1688bc){return function(_0x4d2e72){_0x1688bc['emit'](_0x263f79,_0x4d2e72);};}function removeListener(_0x232cc7,_0x1c383e){return function(){ChatQueueEvents[_0x0baf('0x3')](_0x232cc7,_0x1c383e);};}exports[_0x0baf('0x4')]=function(_0xe4c3c4){for(var _0x335e24=0x0,_0x1a10b1=events[_0x0baf('0x5')];_0x335e24<_0x1a10b1;_0x335e24++){var _0x1d0a0d=events[_0x335e24];var _0x5f5030=createListener(_0x0baf('0x6')+_0x1d0a0d,_0xe4c3c4);ChatQueueEvents['on'](_0x1d0a0d,_0x5f5030);}}; \ No newline at end of file +var _0xadb5=['update','emit','register','length','chatQueue:','save'];(function(_0x258874,_0x44e5fa){var _0x29a74a=function(_0x3df241){while(--_0x3df241){_0x258874['push'](_0x258874['shift']());}};_0x29a74a(++_0x44e5fa);}(_0xadb5,0xad));var _0x5adb=function(_0x50f8aa,_0x3cb8c1){_0x50f8aa=_0x50f8aa-0x0;var _0x569c26=_0xadb5[_0x50f8aa];return _0x569c26;};'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 de7af28..1376ece 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 _0x4201=['/:id','/:id/members','getMembers','getTeams','getAgents','post','/:id/teams','addTeams','addAgents','put','delete','destroy','/:id/users','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x37e0e7,_0x3dea19){var _0x1f1ad9=function(_0x533c98){while(--_0x533c98){_0x37e0e7['push'](_0x37e0e7['shift']());}};_0x1f1ad9(++_0x3dea19);}(_0x4201,0x102));var _0x1420=function(_0x585b83,_0x25d403){_0x585b83=_0x585b83-0x0;var _0x2faa24=_0x4201[_0x585b83];return _0x2faa24;};'use strict';var multer=require(_0x1420('0x0'));var util=require(_0x1420('0x1'));var path=require(_0x1420('0x2'));var timeout=require('connect-timeout');var express=require(_0x1420('0x3'));var router=express[_0x1420('0x4')]();var fs_extra=require(_0x1420('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1420('0x6'));var controller=require(_0x1420('0x7'));router[_0x1420('0x8')]('/',auth[_0x1420('0x9')](),controller[_0x1420('0xa')]);router[_0x1420('0x8')](_0x1420('0xb'),auth[_0x1420('0x9')](),controller['describe']);router[_0x1420('0x8')](_0x1420('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x1420('0x8')](_0x1420('0xd'),auth[_0x1420('0x9')](),controller[_0x1420('0xe')]);router[_0x1420('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0x1420('0xf')]);router[_0x1420('0x8')]('/:id/users',auth[_0x1420('0x9')](),controller[_0x1420('0x10')]);router[_0x1420('0x11')]('/',auth[_0x1420('0x9')](),controller['create']);router[_0x1420('0x11')](_0x1420('0x12'),auth[_0x1420('0x9')](),controller[_0x1420('0x13')]);router[_0x1420('0x11')]('/:id/users',auth[_0x1420('0x9')](),controller[_0x1420('0x14')]);router[_0x1420('0x15')](_0x1420('0xc'),auth[_0x1420('0x9')](),controller['update']);router[_0x1420('0x16')](_0x1420('0xc'),auth['isAuthenticated'](),controller[_0x1420('0x17')]);router[_0x1420('0x16')](_0x1420('0x12'),auth[_0x1420('0x9')](),controller['removeTeams']);router[_0x1420('0x16')](_0x1420('0x18'),auth[_0x1420('0x9')](),controller[_0x1420('0x19')]);module[_0x1420('0x1a')]=router; \ No newline at end of file +var _0x89e5=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','/describe','isAuthenticated','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','update','destroy','removeTeams','removeAgents','exports','multer','util'];(function(_0x43b2f3,_0x248b7f){var _0x56650c=function(_0x4b68b9){while(--_0x4b68b9){_0x43b2f3['push'](_0x43b2f3['shift']());}};_0x56650c(++_0x248b7f);}(_0x89e5,0x186));var _0x589e=function(_0x4e0950,_0x109075){_0x4e0950=_0x4e0950-0x0;var _0x39524d=_0x89e5[_0x4e0950];return _0x39524d;};'use strict';var multer=require(_0x589e('0x0'));var util=require(_0x589e('0x1'));var path=require(_0x589e('0x2'));var timeout=require(_0x589e('0x3'));var express=require(_0x589e('0x4'));var router=express[_0x589e('0x5')]();var fs_extra=require(_0x589e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x589e('0x7'));var config=require(_0x589e('0x8'));var controller=require(_0x589e('0x9'));router[_0x589e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x589e('0xa')](_0x589e('0xb'),auth[_0x589e('0xc')](),controller['describe']);router[_0x589e('0xa')](_0x589e('0xd'),auth['isAuthenticated'](),controller[_0x589e('0xe')]);router[_0x589e('0xa')]('/:id/members',auth[_0x589e('0xc')](),controller[_0x589e('0xf')]);router[_0x589e('0xa')](_0x589e('0x10'),auth[_0x589e('0xc')](),controller[_0x589e('0x11')]);router['get'](_0x589e('0x12'),auth[_0x589e('0xc')](),controller[_0x589e('0x13')]);router[_0x589e('0x14')]('/',auth[_0x589e('0xc')](),controller[_0x589e('0x15')]);router[_0x589e('0x14')](_0x589e('0x10'),auth[_0x589e('0xc')](),controller[_0x589e('0x16')]);router[_0x589e('0x14')](_0x589e('0x12'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x589e('0xd'),auth[_0x589e('0xc')](),controller[_0x589e('0x17')]);router['delete'](_0x589e('0xd'),auth[_0x589e('0xc')](),controller[_0x589e('0x18')]);router['delete'](_0x589e('0x10'),auth[_0x589e('0xc')](),controller[_0x589e('0x19')]);router['delete'](_0x589e('0x12'),auth[_0x589e('0xc')](),controller[_0x589e('0x1a')]);module[_0x589e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index ce70dea..866ba40 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 _0x74ab=['DATE','moment','sequelize','exports','STRING'];(function(_0x3c3313,_0x1ea90d){var _0xb947aa=function(_0x2d911f){while(--_0x2d911f){_0x3c3313['push'](_0x3c3313['shift']());}};_0xb947aa(++_0x1ea90d);}(_0x74ab,0x92));var _0xb74a=function(_0x15402a,_0x4fa192){_0x15402a=_0x15402a-0x0;var _0x227919=_0x74ab[_0x15402a];return _0x227919;};'use strict';var moment=require(_0xb74a('0x0'));var Sequelize=require(_0xb74a('0x1'));module[_0xb74a('0x2')]={'uniqueid':{'type':Sequelize[_0xb74a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xb74a('0x4')]},'leaveAt':{'type':Sequelize[_0xb74a('0x4')]},'acceptAt':{'type':Sequelize[_0xb74a('0x4')]},'exitAt':{'type':Sequelize[_0xb74a('0x4')]},'reason':{'type':Sequelize[_0xb74a('0x3')]}}; \ No newline at end of file +var _0x22c6=['moment','STRING','DATE'];(function(_0x4b7c1b,_0x55f8ee){var _0x184800=function(_0x3ce0e7){while(--_0x3ce0e7){_0x4b7c1b['push'](_0x4b7c1b['shift']());}};_0x184800(++_0x55f8ee);}(_0x22c6,0x126));var _0x622c=function(_0x40579d,_0x5e007d){_0x40579d=_0x40579d-0x0;var _0xbd53e2=_0x22c6[_0x40579d];return _0xbd53e2;};'use strict';var moment=require(_0x622c('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x622c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x622c('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x622c('0x2')]},'acceptAt':{'type':Sequelize[_0x622c('0x2')]},'exitAt':{'type':Sequelize[_0x622c('0x2')]},'reason':{'type':Sequelize[_0x622c('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 6563aed..85ee252 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 _0xcedb=['VIRTUAL','filter','options','includeAll','include','show','params','find','catch','create','body','describe','eml-format','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','type'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xcedb,0xde));var _0xbced=function(_0x587cb9,_0x29eb20){_0x587cb9=_0x587cb9-0x0;var _0x250e54=_0xcedb[_0x587cb9];return _0x250e54;};'use strict';var emlformat=require(_0xbced('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbced('0x1'));var rp=require('request-promise');var moment=require(_0xbced('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbced('0x3'));var util=require(_0xbced('0x4'));var path=require('path');var sox=require(_0xbced('0x5'));var csv=require(_0xbced('0x6'));var ejs=require(_0xbced('0x7'));var fs=require('fs');var fs_extra=require(_0xbced('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbced('0x9'));var jsforce=require(_0xbced('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xbced('0x6'));var querystring=require(_0xbced('0xb'));var Papa=require(_0xbced('0xc'));var Redis=require(_0xbced('0xd'));var authService=require(_0xbced('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbced('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbced('0x10'))(_0xbced('0x11'));var utils=require(_0xbced('0x12'));var config=require(_0xbced('0x13'));var licenseUtil=require(_0xbced('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24e387,_0x1c87e3){_0x1c87e3=_0x1c87e3||0xcc;return function(_0x546995){if(_0x546995){return _0x24e387['sendStatus'](_0x1c87e3);}return _0x24e387[_0xbced('0x15')](_0x1c87e3)[_0xbced('0x16')]();};}function respondWithResult(_0x512016,_0x42d22c){_0x42d22c=_0x42d22c||0xc8;return function(_0x31749c){if(_0x31749c){return _0x512016[_0xbced('0x15')](_0x42d22c)['json'](_0x31749c);}};}function respondWithFilteredResult(_0x46d88e,_0x9fe12f){return function(_0x7bdba2){if(_0x7bdba2){var _0x320fd2=typeof _0x9fe12f[_0xbced('0x17')]==='undefined'&&typeof _0x9fe12f[_0xbced('0x18')]===_0xbced('0x19');var _0x26f470=_0x7bdba2[_0xbced('0x1a')];var _0x1d43f6=_0x320fd2?0x0:_0x9fe12f['offset'];var _0x178d81=_0x320fd2?_0x7bdba2['count']:_0x9fe12f['offset']+_0x9fe12f[_0xbced('0x18')];var _0x3c9c68;if(_0x178d81>=_0x26f470){_0x178d81=_0x26f470;_0x3c9c68=0xc8;}else{_0x3c9c68=0xce;}_0x46d88e[_0xbced('0x15')](_0x3c9c68);return _0x46d88e[_0xbced('0x1b')](_0xbced('0x1c'),_0x1d43f6+'-'+_0x178d81+'/'+_0x26f470)[_0xbced('0x1d')](_0x7bdba2);}return null;};}function patchUpdates(_0x4d5c09){return function(_0xc325aa){try{jsonpatch[_0xbced('0x1e')](_0xc325aa,_0x4d5c09,!![]);}catch(_0x178ca8){return BPromise[_0xbced('0x1f')](_0x178ca8);}return _0xc325aa[_0xbced('0x20')]();};}function saveUpdates(_0x20c592,_0x3fc235){return function(_0x3d5ab3){if(_0x3d5ab3){return _0x3d5ab3[_0xbced('0x21')](_0x20c592)[_0xbced('0x22')](function(_0x1a1ed4){return _0x1a1ed4;});}return null;};}function removeEntity(_0x23f371,_0x448444){return function(_0x32cc08){if(_0x32cc08){return _0x32cc08['destroy']()[_0xbced('0x22')](function(){_0x23f371[_0xbced('0x15')](0xcc)[_0xbced('0x16')]();});}};}function handleEntityNotFound(_0xe8f377,_0x1edf99){return function(_0x305fd5){if(!_0x305fd5){_0xe8f377['sendStatus'](0x194);}return _0x305fd5;};}function handleError(_0x3f2378,_0x54e638){_0x54e638=_0x54e638||0x1f4;return function(_0x3f0ca3){logger[_0xbced('0x23')](_0x3f0ca3[_0xbced('0x24')]);if(_0x3f0ca3['name']){delete _0x3f0ca3[_0xbced('0x25')];}_0x3f2378[_0xbced('0x15')](_0x54e638)[_0xbced('0x26')](_0x3f0ca3);};}exports[_0xbced('0x27')]=function(_0x451d64,_0x4ebae3){var _0x5bd388={},_0xb6cc63={},_0x4c4937={'count':0x0,'rows':[]};var _0x2b65ae=_[_0xbced('0x28')](db[_0xbced('0x29')][_0xbced('0x2a')],function(_0x4665db){return{'name':_0x4665db['fieldName'],'type':_0x4665db['type']['key']};});_0xb6cc63['model']=_[_0xbced('0x28')](_0x2b65ae,'name');_0xb6cc63[_0xbced('0x2b')]=_[_0xbced('0x2c')](_0x451d64['query']);_0xb6cc63[_0xbced('0x2d')]=_['intersection'](_0xb6cc63[_0xbced('0x2e')],_0xb6cc63[_0xbced('0x2b')]);_0x5bd388[_0xbced('0x2f')]=_[_0xbced('0x30')](_0xb6cc63[_0xbced('0x2e')],qs[_0xbced('0x31')](_0x451d64[_0xbced('0x2b')][_0xbced('0x31')]));_0x5bd388[_0xbced('0x2f')]=_0x5bd388[_0xbced('0x2f')][_0xbced('0x32')]?_0x5bd388[_0xbced('0x2f')]:_0xb6cc63['model'];if(!_0x451d64[_0xbced('0x2b')]['hasOwnProperty'](_0xbced('0x33'))){_0x5bd388[_0xbced('0x18')]=qs[_0xbced('0x18')](_0x451d64[_0xbced('0x2b')][_0xbced('0x18')]);_0x5bd388[_0xbced('0x17')]=qs[_0xbced('0x17')](_0x451d64[_0xbced('0x2b')][_0xbced('0x17')]);}_0x5bd388[_0xbced('0x34')]=qs[_0xbced('0x35')](_0x451d64['query'][_0xbced('0x35')]);_0x5bd388['where']=qs[_0xbced('0x2d')](_[_0xbced('0x36')](_0x451d64[_0xbced('0x2b')],_0xb6cc63['filters']),_0x2b65ae);if(_0x451d64[_0xbced('0x2b')]['filter']){_0x5bd388[_0xbced('0x37')]=_[_0xbced('0x38')](_0x5bd388[_0xbced('0x37')],{'$or':_['map'](_0x2b65ae,function(_0x952c11){if(_0x952c11[_0xbced('0x39')]!==_0xbced('0x3a')){var _0x4034af={};_0x4034af[_0x952c11['name']]={'$like':'%'+_0x451d64[_0xbced('0x2b')][_0xbced('0x3b')]+'%'};return _0x4034af;}})});}_0x5bd388=_['merge']({},_0x5bd388,_0x451d64[_0xbced('0x3c')]);var _0x1fa648={'where':_0x5bd388[_0xbced('0x37')]};return db[_0xbced('0x29')][_0xbced('0x1a')](_0x1fa648)[_0xbced('0x22')](function(_0xffb10f){_0x4c4937['count']=_0xffb10f;if(_0x451d64[_0xbced('0x2b')][_0xbced('0x3d')]){_0x5bd388[_0xbced('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x5bd388);})[_0xbced('0x22')](function(_0x14ca44){_0x4c4937['rows']=_0x14ca44;return _0x4c4937;})['then'](respondWithFilteredResult(_0x4ebae3,_0x5bd388))['catch'](handleError(_0x4ebae3,null));};exports[_0xbced('0x3f')]=function(_0x113e5c,_0x29095d){var _0x166e88={'raw':!![],'where':{'id':_0x113e5c[_0xbced('0x40')]['id']}},_0x303d7e={};_0x303d7e[_0xbced('0x2e')]=_[_0xbced('0x2c')](db[_0xbced('0x29')]['rawAttributes']);_0x303d7e['query']=_['keys'](_0x113e5c[_0xbced('0x2b')]);_0x303d7e[_0xbced('0x2d')]=_[_0xbced('0x30')](_0x303d7e['model'],_0x303d7e[_0xbced('0x2b')]);_0x166e88[_0xbced('0x2f')]=_[_0xbced('0x30')](_0x303d7e[_0xbced('0x2e')],qs[_0xbced('0x31')](_0x113e5c['query'][_0xbced('0x31')]));_0x166e88[_0xbced('0x2f')]=_0x166e88[_0xbced('0x2f')]['length']?_0x166e88['attributes']:_0x303d7e[_0xbced('0x2e')];if(_0x113e5c[_0xbced('0x2b')][_0xbced('0x3d')]){_0x166e88[_0xbced('0x3e')]=[{'all':!![]}];}_0x166e88=_['merge']({},_0x166e88,_0x113e5c[_0xbced('0x3c')]);return db[_0xbced('0x29')][_0xbced('0x41')](_0x166e88)[_0xbced('0x22')](handleEntityNotFound(_0x29095d,null))[_0xbced('0x22')](respondWithResult(_0x29095d,null))[_0xbced('0x42')](handleError(_0x29095d,null));};exports[_0xbced('0x43')]=function(_0xb5d006,_0x20d168){return db['ChatQueueReport'][_0xbced('0x43')](_0xb5d006[_0xbced('0x44')],{})['then'](respondWithResult(_0x20d168,0xc9))['catch'](handleError(_0x20d168,null));};exports[_0xbced('0x21')]=function(_0x221173,_0x4d9dd1){if(_0x221173[_0xbced('0x44')]['id']){delete _0x221173[_0xbced('0x44')]['id'];}return db[_0xbced('0x29')][_0xbced('0x41')]({'where':{'id':_0x221173[_0xbced('0x40')]['id']}})['then'](handleEntityNotFound(_0x4d9dd1,null))[_0xbced('0x22')](saveUpdates(_0x221173[_0xbced('0x44')],null))[_0xbced('0x22')](respondWithResult(_0x4d9dd1,null))[_0xbced('0x42')](handleError(_0x4d9dd1,null));};exports['destroy']=function(_0x5ef751,_0x26b987){return db['ChatQueueReport']['find']({'where':{'id':_0x5ef751[_0xbced('0x40')]['id']}})['then'](handleEntityNotFound(_0x26b987,null))[_0xbced('0x22')](removeEntity(_0x26b987,null))['catch'](handleError(_0x26b987,null));};exports[_0xbced('0x45')]=function(_0x16ce5d,_0x1a20d9){return db[_0xbced('0x29')][_0xbced('0x45')]()[_0xbced('0x22')](respondWithResult(_0x1a20d9,null))[_0xbced('0x42')](handleError(_0x1a20d9,null));}; \ No newline at end of file +var _0xc57b=['filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4a7794,_0xba2116){var _0x13e343=function(_0x33f927){while(--_0x33f927){_0x4a7794['push'](_0x4a7794['shift']());}};_0x13e343(++_0xba2116);}(_0xc57b,0x19c));var _0xbc57=function(_0x4df8c2,_0x553f19){_0x4df8c2=_0x4df8c2-0x0;var _0x49ed23=_0xc57b[_0x4df8c2];return _0x49ed23;};'use strict';var emlformat=require(_0xbc57('0x0'));var rimraf=require(_0xbc57('0x1'));var zipdir=require(_0xbc57('0x2'));var jsonpatch=require(_0xbc57('0x3'));var rp=require(_0xbc57('0x4'));var moment=require(_0xbc57('0x5'));var BPromise=require(_0xbc57('0x6'));var Mustache=require(_0xbc57('0x7'));var util=require(_0xbc57('0x8'));var path=require(_0xbc57('0x9'));var sox=require(_0xbc57('0xa'));var csv=require('to-csv');var ejs=require(_0xbc57('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbc57('0xc'));var crypto=require('crypto');var jsforce=require(_0xbc57('0xd'));var deskjs=require(_0xbc57('0xe'));var toCsv=require(_0xbc57('0xf'));var querystring=require(_0xbc57('0x10'));var Papa=require(_0xbc57('0x11'));var Redis=require('ioredis');var authService=require(_0xbc57('0x12'));var qs=require(_0xbc57('0x13'));var as=require(_0xbc57('0x14'));var hardwareService=require(_0xbc57('0x15'));var logger=require(_0xbc57('0x16'))(_0xbc57('0x17'));var utils=require(_0xbc57('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xbc57('0x19'));var db=require(_0xbc57('0x1a'))['db'];function respondWithStatusCode(_0x3407e3,_0x5fcd8f){_0x5fcd8f=_0x5fcd8f||0xcc;return function(_0x478e65){if(_0x478e65){return _0x3407e3[_0xbc57('0x1b')](_0x5fcd8f);}return _0x3407e3[_0xbc57('0x1c')](_0x5fcd8f)[_0xbc57('0x1d')]();};}function respondWithResult(_0x2d9b3c,_0x10f5f7){_0x10f5f7=_0x10f5f7||0xc8;return function(_0x34dd03){if(_0x34dd03){return _0x2d9b3c[_0xbc57('0x1c')](_0x10f5f7)[_0xbc57('0x1e')](_0x34dd03);}};}function respondWithFilteredResult(_0x227240,_0x214f3b){return function(_0x6db744){if(_0x6db744){var _0x1cb1d7=typeof _0x214f3b[_0xbc57('0x1f')]===_0xbc57('0x20')&&typeof _0x214f3b[_0xbc57('0x21')]==='undefined';var _0x1af972=_0x6db744[_0xbc57('0x22')];var _0x586db7=_0x1cb1d7?0x0:_0x214f3b[_0xbc57('0x1f')];var _0x19e1fa=_0x1cb1d7?_0x6db744['count']:_0x214f3b['offset']+_0x214f3b[_0xbc57('0x21')];var _0x513d3f;if(_0x19e1fa>=_0x1af972){_0x19e1fa=_0x1af972;_0x513d3f=0xc8;}else{_0x513d3f=0xce;}_0x227240[_0xbc57('0x1c')](_0x513d3f);return _0x227240[_0xbc57('0x23')](_0xbc57('0x24'),_0x586db7+'-'+_0x19e1fa+'/'+_0x1af972)['json'](_0x6db744);}return null;};}function patchUpdates(_0x276b5f){return function(_0x684e6f){try{jsonpatch['apply'](_0x684e6f,_0x276b5f,!![]);}catch(_0x1e6055){return BPromise['reject'](_0x1e6055);}return _0x684e6f[_0xbc57('0x25')]();};}function saveUpdates(_0x2a9366,_0x4f339b){return function(_0x1bb0ed){if(_0x1bb0ed){return _0x1bb0ed['update'](_0x2a9366)[_0xbc57('0x26')](function(_0x6cd9c6){return _0x6cd9c6;});}return null;};}function removeEntity(_0x1e1772,_0x1e597c){return function(_0x459d87){if(_0x459d87){return _0x459d87[_0xbc57('0x27')]()['then'](function(){_0x1e1772['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ccbb0,_0x1f5d21){return function(_0x2a8c4e){if(!_0x2a8c4e){_0x3ccbb0['sendStatus'](0x194);}return _0x2a8c4e;};}function handleError(_0x36a99b,_0x486294){_0x486294=_0x486294||0x1f4;return function(_0x5d4a73){logger[_0xbc57('0x28')](_0x5d4a73[_0xbc57('0x29')]);if(_0x5d4a73['name']){delete _0x5d4a73[_0xbc57('0x2a')];}_0x36a99b['status'](_0x486294)[_0xbc57('0x2b')](_0x5d4a73);};}exports[_0xbc57('0x2c')]=function(_0x139dd0,_0x28b963){var _0x26d5fc={},_0x5f1b13={},_0x31d896={'count':0x0,'rows':[]};var _0x111a21=_[_0xbc57('0x2d')](db[_0xbc57('0x2e')]['rawAttributes'],function(_0x4778d7){return{'name':_0x4778d7[_0xbc57('0x2f')],'type':_0x4778d7[_0xbc57('0x30')][_0xbc57('0x31')]};});_0x5f1b13[_0xbc57('0x32')]=_[_0xbc57('0x2d')](_0x111a21,_0xbc57('0x2a'));_0x5f1b13[_0xbc57('0x33')]=_[_0xbc57('0x34')](_0x139dd0[_0xbc57('0x33')]);_0x5f1b13['filters']=_[_0xbc57('0x35')](_0x5f1b13[_0xbc57('0x32')],_0x5f1b13[_0xbc57('0x33')]);_0x26d5fc[_0xbc57('0x36')]=_['intersection'](_0x5f1b13[_0xbc57('0x32')],qs[_0xbc57('0x37')](_0x139dd0[_0xbc57('0x33')]['fields']));_0x26d5fc[_0xbc57('0x36')]=_0x26d5fc[_0xbc57('0x36')][_0xbc57('0x38')]?_0x26d5fc['attributes']:_0x5f1b13[_0xbc57('0x32')];if(!_0x139dd0['query'][_0xbc57('0x39')](_0xbc57('0x3a'))){_0x26d5fc['limit']=qs[_0xbc57('0x21')](_0x139dd0[_0xbc57('0x33')]['limit']);_0x26d5fc['offset']=qs[_0xbc57('0x1f')](_0x139dd0['query']['offset']);}_0x26d5fc[_0xbc57('0x3b')]=qs[_0xbc57('0x3c')](_0x139dd0[_0xbc57('0x33')]['sort']);_0x26d5fc[_0xbc57('0x3d')]=qs[_0xbc57('0x3e')](_['pick'](_0x139dd0[_0xbc57('0x33')],_0x5f1b13[_0xbc57('0x3e')]),_0x111a21);if(_0x139dd0[_0xbc57('0x33')][_0xbc57('0x3f')]){_0x26d5fc[_0xbc57('0x3d')]=_['merge'](_0x26d5fc[_0xbc57('0x3d')],{'$or':_[_0xbc57('0x2d')](_0x111a21,function(_0x46ff72){if(_0x46ff72[_0xbc57('0x30')]!==_0xbc57('0x40')){var _0x246776={};_0x246776[_0x46ff72['name']]={'$like':'%'+_0x139dd0[_0xbc57('0x33')][_0xbc57('0x3f')]+'%'};return _0x246776;}})});}_0x26d5fc=_[_0xbc57('0x41')]({},_0x26d5fc,_0x139dd0[_0xbc57('0x42')]);var _0x28aa33={'where':_0x26d5fc[_0xbc57('0x3d')]};return db[_0xbc57('0x2e')][_0xbc57('0x22')](_0x28aa33)[_0xbc57('0x26')](function(_0x528545){_0x31d896['count']=_0x528545;if(_0x139dd0['query']['includeAll']){_0x26d5fc[_0xbc57('0x43')]=[{'all':!![]}];}return db[_0xbc57('0x2e')][_0xbc57('0x44')](_0x26d5fc);})[_0xbc57('0x26')](function(_0x5597d7){_0x31d896[_0xbc57('0x45')]=_0x5597d7;return _0x31d896;})[_0xbc57('0x26')](respondWithFilteredResult(_0x28b963,_0x26d5fc))[_0xbc57('0x46')](handleError(_0x28b963,null));};exports[_0xbc57('0x47')]=function(_0x30bf8c,_0x57ce87){var _0x2b8674={'raw':!![],'where':{'id':_0x30bf8c[_0xbc57('0x48')]['id']}},_0x92d278={};_0x92d278[_0xbc57('0x32')]=_[_0xbc57('0x34')](db[_0xbc57('0x2e')][_0xbc57('0x49')]);_0x92d278['query']=_[_0xbc57('0x34')](_0x30bf8c[_0xbc57('0x33')]);_0x92d278[_0xbc57('0x3e')]=_['intersection'](_0x92d278[_0xbc57('0x32')],_0x92d278[_0xbc57('0x33')]);_0x2b8674[_0xbc57('0x36')]=_[_0xbc57('0x35')](_0x92d278[_0xbc57('0x32')],qs[_0xbc57('0x37')](_0x30bf8c['query'][_0xbc57('0x37')]));_0x2b8674[_0xbc57('0x36')]=_0x2b8674[_0xbc57('0x36')][_0xbc57('0x38')]?_0x2b8674['attributes']:_0x92d278[_0xbc57('0x32')];if(_0x30bf8c[_0xbc57('0x33')][_0xbc57('0x4a')]){_0x2b8674['include']=[{'all':!![]}];}_0x2b8674=_[_0xbc57('0x41')]({},_0x2b8674,_0x30bf8c[_0xbc57('0x42')]);return db[_0xbc57('0x2e')]['find'](_0x2b8674)[_0xbc57('0x26')](handleEntityNotFound(_0x57ce87,null))[_0xbc57('0x26')](respondWithResult(_0x57ce87,null))[_0xbc57('0x46')](handleError(_0x57ce87,null));};exports[_0xbc57('0x4b')]=function(_0x5d6ca8,_0x29a448){return db['ChatQueueReport'][_0xbc57('0x4b')](_0x5d6ca8[_0xbc57('0x4c')],{})['then'](respondWithResult(_0x29a448,0xc9))[_0xbc57('0x46')](handleError(_0x29a448,null));};exports['update']=function(_0x4cc19e,_0x4c9df8){if(_0x4cc19e['body']['id']){delete _0x4cc19e['body']['id'];}return db[_0xbc57('0x2e')][_0xbc57('0x4d')]({'where':{'id':_0x4cc19e[_0xbc57('0x48')]['id']}})[_0xbc57('0x26')](handleEntityNotFound(_0x4c9df8,null))[_0xbc57('0x26')](saveUpdates(_0x4cc19e[_0xbc57('0x4c')],null))[_0xbc57('0x26')](respondWithResult(_0x4c9df8,null))[_0xbc57('0x46')](handleError(_0x4c9df8,null));};exports['destroy']=function(_0x3b1944,_0x279cef){return db[_0xbc57('0x2e')]['find']({'where':{'id':_0x3b1944['params']['id']}})['then'](handleEntityNotFound(_0x279cef,null))['then'](removeEntity(_0x279cef,null))['catch'](handleError(_0x279cef,null));};exports[_0xbc57('0x4e')]=function(_0x32bd90,_0x3f8b99){return db[_0xbc57('0x2e')][_0xbc57('0x4e')]()[_0xbc57('0x26')](respondWithResult(_0x3f8b99,null))[_0xbc57('0x46')](handleError(_0x3f8b99,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 79aea31..ee67847 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 _0xdbab=['path','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','moment','request-promise'];(function(_0xd41f6c,_0x2ee0b2){var _0x4db302=function(_0x1446d9){while(--_0x1446d9){_0xd41f6c['push'](_0xd41f6c['shift']());}};_0x4db302(++_0x2ee0b2);}(_0xdbab,0x15a));var _0xbdba=function(_0x4527f1,_0x2d1dec){_0x4527f1=_0x4527f1-0x0;var _0x107e4d=_0xdbab[_0x4527f1];return _0x107e4d;};'use strict';var _=require(_0xbdba('0x0'));var util=require(_0xbdba('0x1'));var logger=require(_0xbdba('0x2'))('api');var moment=require(_0xbdba('0x3'));var BPromise=require('bluebird');var rp=require(_0xbdba('0x4'));var fs=require('fs');var path=require(_0xbdba('0x5'));var rimraf=require('rimraf');var config=require(_0xbdba('0x6'));var attributes=require(_0xbdba('0x7'));module[_0xbdba('0x8')]=function(_0x4b24fd,_0x34bcfa){return _0x4b24fd[_0xbdba('0x9')](_0xbdba('0xa'),attributes,{'tableName':_0xbdba('0xb'),'paranoid':![],'indexes':[{'name':_0xbdba('0xc'),'fields':[_0xbdba('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfee3=['report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','ChatQueueReport'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfee3,0xc5));var _0x3fee=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0xfee3[_0x393d69];return _0x3cee37;};'use strict';var _=require('lodash');var util=require(_0x3fee('0x0'));var logger=require(_0x3fee('0x1'))(_0x3fee('0x2'));var moment=require(_0x3fee('0x3'));var BPromise=require(_0x3fee('0x4'));var rp=require(_0x3fee('0x5'));var fs=require('fs');var path=require(_0x3fee('0x6'));var rimraf=require(_0x3fee('0x7'));var config=require(_0x3fee('0x8'));var attributes=require(_0x3fee('0x9'));module['exports']=function(_0x5e2fdf,_0xa09b5c){return _0x5e2fdf['define'](_0x3fee('0xa'),attributes,{'tableName':_0x3fee('0xb'),'paranoid':![],'indexes':[{'name':_0x3fee('0xc'),'fields':[_0x3fee('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 330d3e1..b926ff4 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 _0x63ee=['UpdateChatQueueReport','body','raw','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','CreateChatQueueReport','ChatQueueReport','create','options','catch'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x63ee,0x105));var _0xe63e=function(_0x261c6f,_0x31215c){_0x261c6f=_0x261c6f-0x0;var _0x542ced=_0x63ee[_0x261c6f];return _0x542ced;};'use strict';var _=require(_0xe63e('0x0'));var util=require(_0xe63e('0x1'));var moment=require('moment');var BPromise=require(_0xe63e('0x2'));var rs=require(_0xe63e('0x3'));var fs=require('fs');var Redis=require(_0xe63e('0x4'));var db=require(_0xe63e('0x5'))['db'];var utils=require(_0xe63e('0x6'));var logger=require(_0xe63e('0x7'))(_0xe63e('0x8'));var config=require(_0xe63e('0x9'));var jayson=require(_0xe63e('0xa'));var client=jayson[_0xe63e('0xb')][_0xe63e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x135031,_0x900144,_0x569bb5){return new BPromise(function(_0x39df56,_0x9c3aa4){return client['request'](_0x135031,_0x569bb5)[_0xe63e('0xd')](function(_0x3153a1){logger[_0xe63e('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x900144,_0xe63e('0xf'));logger[_0xe63e('0x10')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x900144,'request\x20sent',JSON[_0xe63e('0x11')](_0x3153a1));if(_0x3153a1[_0xe63e('0x12')]){if(_0x3153a1[_0xe63e('0x12')]['code']===0x1f4){logger['error'](_0xe63e('0x13'),_0x900144,_0x3153a1[_0xe63e('0x12')]['message']);return _0x9c3aa4(_0x3153a1[_0xe63e('0x12')][_0xe63e('0x14')]);}logger[_0xe63e('0x12')](_0xe63e('0x13'),_0x900144,_0x3153a1['error'][_0xe63e('0x14')]);return _0x39df56(_0x3153a1[_0xe63e('0x12')][_0xe63e('0x14')]);}else{logger['info'](_0xe63e('0x13'),_0x900144,'request\x20sent');_0x39df56(_0x3153a1[_0xe63e('0x15')][_0xe63e('0x14')]);}})['catch'](function(_0x578452){logger[_0xe63e('0x12')](_0xe63e('0x13'),_0x900144,_0x578452);_0x9c3aa4(_0x578452);});});}exports[_0xe63e('0x16')]=function(_0x4e12a8){var _0x120873=this;return new Promise(function(_0x19c37f,_0x2129aa){return db[_0xe63e('0x17')][_0xe63e('0x18')](_0x4e12a8['body'],{'raw':_0x4e12a8[_0xe63e('0x19')]?_0x4e12a8['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x543c3d){logger['info'](_0xe63e('0x16'),_0x4e12a8);logger[_0xe63e('0x10')](_0xe63e('0x16'),_0x4e12a8,JSON[_0xe63e('0x11')](_0x543c3d));_0x19c37f(_0x543c3d);})[_0xe63e('0x1a')](function(_0x266b4d){logger[_0xe63e('0x12')](_0xe63e('0x16'),_0x266b4d[_0xe63e('0x14')],_0x4e12a8);_0x2129aa(_0x120873['error'](0x1f4,_0x266b4d[_0xe63e('0x14')]));});});};exports[_0xe63e('0x1b')]=function(_0x3a28b6){var _0x2b89ee=this;return new Promise(function(_0x5da8e7,_0x24ca41){return db[_0xe63e('0x17')]['update'](_0x3a28b6[_0xe63e('0x1c')],{'raw':_0x3a28b6[_0xe63e('0x19')]?_0x3a28b6[_0xe63e('0x19')][_0xe63e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a28b6[_0xe63e('0x19')]?_0x3a28b6[_0xe63e('0x19')][_0xe63e('0x1e')]||null:null,'attributes':_0x3a28b6[_0xe63e('0x19')]?_0x3a28b6[_0xe63e('0x19')][_0xe63e('0x1f')]||null:null,'limit':_0x3a28b6[_0xe63e('0x19')]?_0x3a28b6['options']['limit']||null:null})[_0xe63e('0xd')](function(_0x36534f){logger[_0xe63e('0xe')](_0xe63e('0x1b'),_0x3a28b6);logger[_0xe63e('0x10')](_0xe63e('0x1b'),_0x3a28b6,JSON[_0xe63e('0x11')](_0x36534f));_0x5da8e7(_0x36534f);})[_0xe63e('0x1a')](function(_0x56fd9e){logger[_0xe63e('0x12')](_0xe63e('0x1b'),_0x56fd9e['message'],_0x3a28b6);_0x24ca41(_0x2b89ee[_0xe63e('0x12')](0x1f4,_0x56fd9e['message']));});});}; \ No newline at end of file +var _0xaa88=['create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','debug','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0xaa88,0xea));var _0x8aa8=function(_0x75ce5b,_0x3b582f){_0x75ce5b=_0x75ce5b-0x0;var _0x22195e=_0xaa88[_0x75ce5b];return _0x22195e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8aa8('0x0'));var fs=require('fs');var Redis=require(_0x8aa8('0x1'));var db=require(_0x8aa8('0x2'))['db'];var utils=require(_0x8aa8('0x3'));var logger=require(_0x8aa8('0x4'))(_0x8aa8('0x5'));var config=require(_0x8aa8('0x6'));var jayson=require(_0x8aa8('0x7'));var client=jayson[_0x8aa8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x126683,_0x201ee6,_0x151a66){return new BPromise(function(_0x36e99d,_0x510df2){return client[_0x8aa8('0x9')](_0x126683,_0x151a66)[_0x8aa8('0xa')](function(_0xefdc33){logger[_0x8aa8('0xb')](_0x8aa8('0xc'),_0x201ee6,_0x8aa8('0xd'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x201ee6,_0x8aa8('0xd'),JSON[_0x8aa8('0xe')](_0xefdc33));if(_0xefdc33[_0x8aa8('0xf')]){if(_0xefdc33['error'][_0x8aa8('0x10')]===0x1f4){logger[_0x8aa8('0xf')](_0x8aa8('0xc'),_0x201ee6,_0xefdc33[_0x8aa8('0xf')][_0x8aa8('0x11')]);return _0x510df2(_0xefdc33[_0x8aa8('0xf')]['message']);}logger[_0x8aa8('0xf')](_0x8aa8('0xc'),_0x201ee6,_0xefdc33[_0x8aa8('0xf')]['message']);return _0x36e99d(_0xefdc33[_0x8aa8('0xf')][_0x8aa8('0x11')]);}else{logger[_0x8aa8('0xb')](_0x8aa8('0xc'),_0x201ee6,_0x8aa8('0xd'));_0x36e99d(_0xefdc33[_0x8aa8('0x12')][_0x8aa8('0x11')]);}})[_0x8aa8('0x13')](function(_0x60cef){logger[_0x8aa8('0xf')](_0x8aa8('0xc'),_0x201ee6,_0x60cef);_0x510df2(_0x60cef);});});}exports[_0x8aa8('0x14')]=function(_0x4dfc08){var _0x20c87d=this;return new Promise(function(_0x1ecce7,_0x54c39f){return db[_0x8aa8('0x15')][_0x8aa8('0x16')](_0x4dfc08[_0x8aa8('0x17')],{'raw':_0x4dfc08[_0x8aa8('0x18')]?_0x4dfc08[_0x8aa8('0x18')][_0x8aa8('0x19')]===undefined?!![]:![]:!![]})[_0x8aa8('0xa')](function(_0x54ba8b){logger[_0x8aa8('0xb')](_0x8aa8('0x14'),_0x4dfc08);logger['debug']('CreateChatQueueReport',_0x4dfc08,JSON[_0x8aa8('0xe')](_0x54ba8b));_0x1ecce7(_0x54ba8b);})[_0x8aa8('0x13')](function(_0x561e51){logger[_0x8aa8('0xf')](_0x8aa8('0x14'),_0x561e51['message'],_0x4dfc08);_0x54c39f(_0x20c87d[_0x8aa8('0xf')](0x1f4,_0x561e51[_0x8aa8('0x11')]));});});};exports[_0x8aa8('0x1a')]=function(_0x51624d){var _0x1cb77a=this;return new Promise(function(_0x51ae5e,_0x264c68){return db[_0x8aa8('0x15')][_0x8aa8('0x1b')](_0x51624d[_0x8aa8('0x17')],{'raw':_0x51624d[_0x8aa8('0x18')]?_0x51624d[_0x8aa8('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51624d[_0x8aa8('0x18')]?_0x51624d[_0x8aa8('0x18')][_0x8aa8('0x1c')]||null:null,'attributes':_0x51624d[_0x8aa8('0x18')]?_0x51624d[_0x8aa8('0x18')][_0x8aa8('0x1d')]||null:null,'limit':_0x51624d['options']?_0x51624d[_0x8aa8('0x18')][_0x8aa8('0x1e')]||null:null})[_0x8aa8('0xa')](function(_0x2864bd){logger[_0x8aa8('0xb')](_0x8aa8('0x1a'),_0x51624d);logger[_0x8aa8('0x1f')]('UpdateChatQueueReport',_0x51624d,JSON[_0x8aa8('0xe')](_0x2864bd));_0x51ae5e(_0x2864bd);})[_0x8aa8('0x13')](function(_0x50253b){logger[_0x8aa8('0xf')](_0x8aa8('0x1a'),_0x50253b[_0x8aa8('0x11')],_0x51624d);_0x264c68(_0x1cb77a[_0x8aa8('0xf')](0x1f4,_0x50253b[_0x8aa8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 61a32cd..8ac8931 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 _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','delete'];(function(_0x228608,_0x26364d){var _0xb65159=function(_0x38ddc4){while(--_0x38ddc4){_0x228608['push'](_0x228608['shift']());}};_0xb65159(++_0x26364d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0x389d1f,_0x3b1cdc){var _0x56d107=function(_0xb77af7){while(--_0xb77af7){_0x389d1f['push'](_0x389d1f['shift']());}};_0x56d107(++_0x3b1cdc);}(_0x7a54,0x106));var _0x47a5=function(_0x43a446,_0x36227e){_0x43a446=_0x43a446-0x0;var _0x5569c6=_0x7a54[_0x43a446];return _0x5569c6;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 976bca0..efe4d49 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 _0xa6cb=['account','agent','queue','DATE','NOW','sequelize','exports','ENUM'];(function(_0x25ad1c,_0x545903){var _0x149e31=function(_0x5c284d){while(--_0x5c284d){_0x25ad1c['push'](_0x25ad1c['shift']());}};_0x149e31(++_0x545903);}(_0xa6cb,0x1cd));var _0xba6c=function(_0x58b99,_0x1f3434){_0x58b99=_0x58b99-0x0;var _0x3c12ac=_0xa6cb[_0x58b99];return _0x3c12ac;};'use strict';var moment=require('moment');var Sequelize=require(_0xba6c('0x0'));module[_0xba6c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xba6c('0x2')](_0xba6c('0x3'),_0xba6c('0x4'),'queue'),'allowNull':![],'defaultValue':_0xba6c('0x5')},'transferredAt':{'type':Sequelize[_0xba6c('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xba6c('0x7')]}}; \ No newline at end of file +var _0x905e=['DATE','moment','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0xd0cd0b,_0x490956){var _0x59cced=function(_0x567251){while(--_0x567251){_0xd0cd0b['push'](_0xd0cd0b['shift']());}};_0x59cced(++_0x490956);}(_0x905e,0x1de));var _0xe905=function(_0x22a83d,_0x23cda6){_0x22a83d=_0x22a83d-0x0;var _0x18c41c=_0x905e[_0x22a83d];return _0x18c41c;};'use strict';var moment=require(_0xe905('0x0'));var Sequelize=require(_0xe905('0x1'));module[_0xe905('0x2')]={'uniqueid':{'type':Sequelize[_0xe905('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xe905('0x4')](_0xe905('0x5'),_0xe905('0x6'),_0xe905('0x7')),'allowNull':![],'defaultValue':_0xe905('0x7')},'transferredAt':{'type':Sequelize[_0xe905('0x8')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index c22d2fc..67bcced 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 _0x2559=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','options','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','model','query'];(function(_0x462ca7,_0x40a1f9){var _0x503899=function(_0x3ff6e5){while(--_0x3ff6e5){_0x462ca7['push'](_0x462ca7['shift']());}};_0x503899(++_0x40a1f9);}(_0x2559,0xe5));var _0x9255=function(_0x580b03,_0x5bf4e3){_0x580b03=_0x580b03-0x0;var _0x35d78b=_0x2559[_0x580b03];return _0x35d78b;};'use strict';var emlformat=require(_0x9255('0x0'));var rimraf=require(_0x9255('0x1'));var zipdir=require(_0x9255('0x2'));var jsonpatch=require(_0x9255('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9255('0x4'));var Mustache=require('mustache');var util=require(_0x9255('0x5'));var path=require(_0x9255('0x6'));var sox=require('sox');var csv=require(_0x9255('0x7'));var ejs=require(_0x9255('0x8'));var fs=require('fs');var fs_extra=require(_0x9255('0x9'));var _=require(_0x9255('0xa'));var squel=require(_0x9255('0xb'));var crypto=require(_0x9255('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9255('0xd'));var toCsv=require(_0x9255('0x7'));var querystring=require('querystring');var Papa=require(_0x9255('0xe'));var Redis=require(_0x9255('0xf'));var authService=require(_0x9255('0x10'));var qs=require(_0x9255('0x11'));var as=require(_0x9255('0x12'));var hardwareService=require(_0x9255('0x13'));var logger=require(_0x9255('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9255('0x15'));var db=require(_0x9255('0x16'))['db'];function respondWithStatusCode(_0x62bd14,_0x31495e){_0x31495e=_0x31495e||0xcc;return function(_0x4f5d87){if(_0x4f5d87){return _0x62bd14[_0x9255('0x17')](_0x31495e);}return _0x62bd14[_0x9255('0x18')](_0x31495e)[_0x9255('0x19')]();};}function respondWithResult(_0x5e18a4,_0x160781){_0x160781=_0x160781||0xc8;return function(_0x5cdbf4){if(_0x5cdbf4){return _0x5e18a4[_0x9255('0x18')](_0x160781)['json'](_0x5cdbf4);}};}function respondWithFilteredResult(_0x551530,_0x42f0f6){return function(_0x3c4193){if(_0x3c4193){var _0x427da0=typeof _0x42f0f6[_0x9255('0x1a')]==='undefined'&&typeof _0x42f0f6['limit']===_0x9255('0x1b');var _0x4bbfce=_0x3c4193[_0x9255('0x1c')];var _0xb20921=_0x427da0?0x0:_0x42f0f6[_0x9255('0x1a')];var _0x5549e1=_0x427da0?_0x3c4193[_0x9255('0x1c')]:_0x42f0f6[_0x9255('0x1a')]+_0x42f0f6[_0x9255('0x1d')];var _0x1181aa;if(_0x5549e1>=_0x4bbfce){_0x5549e1=_0x4bbfce;_0x1181aa=0xc8;}else{_0x1181aa=0xce;}_0x551530[_0x9255('0x18')](_0x1181aa);return _0x551530[_0x9255('0x1e')](_0x9255('0x1f'),_0xb20921+'-'+_0x5549e1+'/'+_0x4bbfce)[_0x9255('0x20')](_0x3c4193);}return null;};}function patchUpdates(_0x2ca8be){return function(_0x56f29b){try{jsonpatch['apply'](_0x56f29b,_0x2ca8be,!![]);}catch(_0x121bc2){return BPromise[_0x9255('0x21')](_0x121bc2);}return _0x56f29b[_0x9255('0x22')]();};}function saveUpdates(_0x493034,_0x1808b2){return function(_0x1a7aa6){if(_0x1a7aa6){return _0x1a7aa6[_0x9255('0x23')](_0x493034)[_0x9255('0x24')](function(_0x1f7159){return _0x1f7159;});}return null;};}function removeEntity(_0x1e6ce6,_0x1b59c9){return function(_0x437db3){if(_0x437db3){return _0x437db3['destroy']()[_0x9255('0x24')](function(){_0x1e6ce6[_0x9255('0x18')](0xcc)[_0x9255('0x19')]();});}};}function handleEntityNotFound(_0x55dccf,_0x5a3179){return function(_0x2f04eb){if(!_0x2f04eb){_0x55dccf[_0x9255('0x17')](0x194);}return _0x2f04eb;};}function handleError(_0x5f4e8e,_0x1ed7d6){_0x1ed7d6=_0x1ed7d6||0x1f4;return function(_0x4aea82){logger['error'](_0x4aea82[_0x9255('0x25')]);if(_0x4aea82[_0x9255('0x26')]){delete _0x4aea82[_0x9255('0x26')];}_0x5f4e8e[_0x9255('0x18')](_0x1ed7d6)[_0x9255('0x27')](_0x4aea82);};}exports['index']=function(_0x407a4d,_0x3ef9c5){var _0x13534e={},_0x14ec89={},_0x128876={'count':0x0,'rows':[]};var _0x2e465e=_[_0x9255('0x28')](db[_0x9255('0x29')][_0x9255('0x2a')],function(_0x49fece){return{'name':_0x49fece[_0x9255('0x2b')],'type':_0x49fece[_0x9255('0x2c')]['key']};});_0x14ec89[_0x9255('0x2d')]=_[_0x9255('0x28')](_0x2e465e,_0x9255('0x26'));_0x14ec89[_0x9255('0x2e')]=_[_0x9255('0x2f')](_0x407a4d[_0x9255('0x2e')]);_0x14ec89[_0x9255('0x30')]=_[_0x9255('0x31')](_0x14ec89['model'],_0x14ec89['query']);_0x13534e[_0x9255('0x32')]=_['intersection'](_0x14ec89[_0x9255('0x2d')],qs[_0x9255('0x33')](_0x407a4d[_0x9255('0x2e')][_0x9255('0x33')]));_0x13534e['attributes']=_0x13534e['attributes'][_0x9255('0x34')]?_0x13534e[_0x9255('0x32')]:_0x14ec89['model'];if(!_0x407a4d['query'][_0x9255('0x35')](_0x9255('0x36'))){_0x13534e[_0x9255('0x1d')]=qs[_0x9255('0x1d')](_0x407a4d[_0x9255('0x2e')][_0x9255('0x1d')]);_0x13534e['offset']=qs[_0x9255('0x1a')](_0x407a4d['query'][_0x9255('0x1a')]);}_0x13534e['order']=qs[_0x9255('0x37')](_0x407a4d[_0x9255('0x2e')][_0x9255('0x37')]);_0x13534e[_0x9255('0x38')]=qs[_0x9255('0x30')](_['pick'](_0x407a4d[_0x9255('0x2e')],_0x14ec89[_0x9255('0x30')]),_0x2e465e);if(_0x407a4d[_0x9255('0x2e')]['filter']){_0x13534e['where']=_[_0x9255('0x39')](_0x13534e[_0x9255('0x38')],{'$or':_['map'](_0x2e465e,function(_0x5530b6){if(_0x5530b6[_0x9255('0x2c')]!=='VIRTUAL'){var _0x2e0709={};_0x2e0709[_0x5530b6[_0x9255('0x26')]]={'$like':'%'+_0x407a4d[_0x9255('0x2e')]['filter']+'%'};return _0x2e0709;}})});}_0x13534e=_['merge']({},_0x13534e,_0x407a4d[_0x9255('0x3a')]);var _0x8070cd={'where':_0x13534e[_0x9255('0x38')]};return db[_0x9255('0x29')][_0x9255('0x1c')](_0x8070cd)['then'](function(_0x7c7fec){_0x128876[_0x9255('0x1c')]=_0x7c7fec;if(_0x407a4d['query'][_0x9255('0x3b')]){_0x13534e[_0x9255('0x3c')]=[{'all':!![]}];}return db[_0x9255('0x29')]['findAll'](_0x13534e);})[_0x9255('0x24')](function(_0x5ad874){_0x128876[_0x9255('0x3d')]=_0x5ad874;return _0x128876;})[_0x9255('0x24')](respondWithFilteredResult(_0x3ef9c5,_0x13534e))['catch'](handleError(_0x3ef9c5,null));};exports[_0x9255('0x3e')]=function(_0x32f650,_0x156c93){var _0x3889ab={'raw':!![],'where':{'id':_0x32f650[_0x9255('0x3f')]['id']}},_0x1c409d={};_0x1c409d[_0x9255('0x2d')]=_[_0x9255('0x2f')](db[_0x9255('0x29')][_0x9255('0x2a')]);_0x1c409d[_0x9255('0x2e')]=_[_0x9255('0x2f')](_0x32f650['query']);_0x1c409d[_0x9255('0x30')]=_['intersection'](_0x1c409d['model'],_0x1c409d['query']);_0x3889ab[_0x9255('0x32')]=_[_0x9255('0x31')](_0x1c409d[_0x9255('0x2d')],qs[_0x9255('0x33')](_0x32f650['query'][_0x9255('0x33')]));_0x3889ab['attributes']=_0x3889ab['attributes']['length']?_0x3889ab[_0x9255('0x32')]:_0x1c409d[_0x9255('0x2d')];if(_0x32f650[_0x9255('0x2e')][_0x9255('0x3b')]){_0x3889ab['include']=[{'all':!![]}];}_0x3889ab=_[_0x9255('0x39')]({},_0x3889ab,_0x32f650[_0x9255('0x3a')]);return db['ChatTransferReport'][_0x9255('0x40')](_0x3889ab)[_0x9255('0x24')](handleEntityNotFound(_0x156c93,null))[_0x9255('0x24')](respondWithResult(_0x156c93,null))[_0x9255('0x41')](handleError(_0x156c93,null));};exports[_0x9255('0x42')]=function(_0x347b7b,_0x40303b){return db['ChatTransferReport'][_0x9255('0x42')](_0x347b7b['body'],{})[_0x9255('0x24')](respondWithResult(_0x40303b,0xc9))[_0x9255('0x41')](handleError(_0x40303b,null));};exports[_0x9255('0x23')]=function(_0x2f68a1,_0x54405a){if(_0x2f68a1['body']['id']){delete _0x2f68a1[_0x9255('0x43')]['id'];}return db[_0x9255('0x29')][_0x9255('0x40')]({'where':{'id':_0x2f68a1[_0x9255('0x3f')]['id']}})['then'](handleEntityNotFound(_0x54405a,null))[_0x9255('0x24')](saveUpdates(_0x2f68a1[_0x9255('0x43')],null))['then'](respondWithResult(_0x54405a,null))[_0x9255('0x41')](handleError(_0x54405a,null));};exports['destroy']=function(_0x1d3aad,_0xbe600a){return db[_0x9255('0x29')]['find']({'where':{'id':_0x1d3aad[_0x9255('0x3f')]['id']}})[_0x9255('0x24')](handleEntityNotFound(_0xbe600a,null))[_0x9255('0x24')](removeEntity(_0xbe600a,null))[_0x9255('0x41')](handleError(_0xbe600a,null));};exports[_0x9255('0x44')]=function(_0x4a2e9f,_0x12d819){return db[_0x9255('0x29')][_0x9255('0x44')]()[_0x9255('0x24')](respondWithResult(_0x12d819,null))[_0x9255('0x41')](handleError(_0x12d819,null));}; \ No newline at end of file +var _0x3e67=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','send','rawAttributes','fieldName','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','squel','crypto'];(function(_0x51b15c,_0x2e6246){var _0x4bd87d=function(_0x16ff5c){while(--_0x16ff5c){_0x51b15c['push'](_0x51b15c['shift']());}};_0x4bd87d(++_0x2e6246);}(_0x3e67,0x179));var _0x73e6=function(_0x56608c,_0x29eb74){_0x56608c=_0x56608c-0x0;var _0x3c7fb0=_0x3e67[_0x56608c];return _0x3c7fb0;};'use strict';var emlformat=require(_0x73e6('0x0'));var rimraf=require(_0x73e6('0x1'));var zipdir=require(_0x73e6('0x2'));var jsonpatch=require(_0x73e6('0x3'));var rp=require(_0x73e6('0x4'));var moment=require(_0x73e6('0x5'));var BPromise=require(_0x73e6('0x6'));var Mustache=require('mustache');var util=require(_0x73e6('0x7'));var path=require('path');var sox=require(_0x73e6('0x8'));var csv=require('to-csv');var ejs=require(_0x73e6('0x9'));var fs=require('fs');var fs_extra=require(_0x73e6('0xa'));var _=require('lodash');var squel=require(_0x73e6('0xb'));var crypto=require(_0x73e6('0xc'));var jsforce=require(_0x73e6('0xd'));var deskjs=require(_0x73e6('0xe'));var toCsv=require(_0x73e6('0xf'));var querystring=require(_0x73e6('0x10'));var Papa=require(_0x73e6('0x11'));var Redis=require(_0x73e6('0x12'));var authService=require(_0x73e6('0x13'));var qs=require(_0x73e6('0x14'));var as=require(_0x73e6('0x15'));var hardwareService=require(_0x73e6('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x73e6('0x17'));var config=require(_0x73e6('0x18'));var licenseUtil=require(_0x73e6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x293a3f,_0x19c66d){_0x19c66d=_0x19c66d||0xcc;return function(_0x22bd76){if(_0x22bd76){return _0x293a3f[_0x73e6('0x1a')](_0x19c66d);}return _0x293a3f[_0x73e6('0x1b')](_0x19c66d)[_0x73e6('0x1c')]();};}function respondWithResult(_0x558b50,_0x424be7){_0x424be7=_0x424be7||0xc8;return function(_0x4d8d02){if(_0x4d8d02){return _0x558b50[_0x73e6('0x1b')](_0x424be7)[_0x73e6('0x1d')](_0x4d8d02);}};}function respondWithFilteredResult(_0x13aa65,_0x993957){return function(_0x1cdee1){if(_0x1cdee1){var _0x8af51c=typeof _0x993957[_0x73e6('0x1e')]==='undefined'&&typeof _0x993957['limit']===_0x73e6('0x1f');var _0x10d7c7=_0x1cdee1[_0x73e6('0x20')];var _0x18c54c=_0x8af51c?0x0:_0x993957[_0x73e6('0x1e')];var _0xfdbfc=_0x8af51c?_0x1cdee1[_0x73e6('0x20')]:_0x993957[_0x73e6('0x1e')]+_0x993957[_0x73e6('0x21')];var _0x47192b;if(_0xfdbfc>=_0x10d7c7){_0xfdbfc=_0x10d7c7;_0x47192b=0xc8;}else{_0x47192b=0xce;}_0x13aa65[_0x73e6('0x1b')](_0x47192b);return _0x13aa65[_0x73e6('0x22')](_0x73e6('0x23'),_0x18c54c+'-'+_0xfdbfc+'/'+_0x10d7c7)[_0x73e6('0x1d')](_0x1cdee1);}return null;};}function patchUpdates(_0x55c843){return function(_0x974b71){try{jsonpatch[_0x73e6('0x24')](_0x974b71,_0x55c843,!![]);}catch(_0x3b935f){return BPromise[_0x73e6('0x25')](_0x3b935f);}return _0x974b71[_0x73e6('0x26')]();};}function saveUpdates(_0x277e8c,_0x57623e){return function(_0x4cdf57){if(_0x4cdf57){return _0x4cdf57['update'](_0x277e8c)[_0x73e6('0x27')](function(_0x19885b){return _0x19885b;});}return null;};}function removeEntity(_0x474b95,_0x2101f3){return function(_0x56714d){if(_0x56714d){return _0x56714d['destroy']()[_0x73e6('0x27')](function(){_0x474b95[_0x73e6('0x1b')](0xcc)[_0x73e6('0x1c')]();});}};}function handleEntityNotFound(_0x57cf78,_0x39e84){return function(_0x439594){if(!_0x439594){_0x57cf78[_0x73e6('0x1a')](0x194);}return _0x439594;};}function handleError(_0x4ee40f,_0x19e665){_0x19e665=_0x19e665||0x1f4;return function(_0xf3baf){logger[_0x73e6('0x28')](_0xf3baf[_0x73e6('0x29')]);if(_0xf3baf['name']){delete _0xf3baf['name'];}_0x4ee40f[_0x73e6('0x1b')](_0x19e665)[_0x73e6('0x2a')](_0xf3baf);};}exports['index']=function(_0x2e3d7c,_0x93a9ae){var _0x50da32={},_0x5b64de={},_0x896020={'count':0x0,'rows':[]};var _0x1a90d1=_['map'](db['ChatTransferReport'][_0x73e6('0x2b')],function(_0x1ccb44){return{'name':_0x1ccb44[_0x73e6('0x2c')],'type':_0x1ccb44['type'][_0x73e6('0x2d')]};});_0x5b64de[_0x73e6('0x2e')]=_['map'](_0x1a90d1,_0x73e6('0x2f'));_0x5b64de['query']=_[_0x73e6('0x30')](_0x2e3d7c[_0x73e6('0x31')]);_0x5b64de[_0x73e6('0x32')]=_['intersection'](_0x5b64de['model'],_0x5b64de[_0x73e6('0x31')]);_0x50da32['attributes']=_[_0x73e6('0x33')](_0x5b64de['model'],qs[_0x73e6('0x34')](_0x2e3d7c[_0x73e6('0x31')][_0x73e6('0x34')]));_0x50da32['attributes']=_0x50da32[_0x73e6('0x35')][_0x73e6('0x36')]?_0x50da32[_0x73e6('0x35')]:_0x5b64de[_0x73e6('0x2e')];if(!_0x2e3d7c[_0x73e6('0x31')][_0x73e6('0x37')]('nolimit')){_0x50da32[_0x73e6('0x21')]=qs['limit'](_0x2e3d7c[_0x73e6('0x31')][_0x73e6('0x21')]);_0x50da32[_0x73e6('0x1e')]=qs[_0x73e6('0x1e')](_0x2e3d7c[_0x73e6('0x31')]['offset']);}_0x50da32[_0x73e6('0x38')]=qs[_0x73e6('0x39')](_0x2e3d7c[_0x73e6('0x31')][_0x73e6('0x39')]);_0x50da32['where']=qs['filters'](_[_0x73e6('0x3a')](_0x2e3d7c[_0x73e6('0x31')],_0x5b64de[_0x73e6('0x32')]),_0x1a90d1);if(_0x2e3d7c[_0x73e6('0x31')][_0x73e6('0x3b')]){_0x50da32[_0x73e6('0x3c')]=_[_0x73e6('0x3d')](_0x50da32[_0x73e6('0x3c')],{'$or':_[_0x73e6('0x3e')](_0x1a90d1,function(_0x4c7b6c){if(_0x4c7b6c[_0x73e6('0x3f')]!==_0x73e6('0x40')){var _0x25a9a8={};_0x25a9a8[_0x4c7b6c[_0x73e6('0x2f')]]={'$like':'%'+_0x2e3d7c[_0x73e6('0x31')][_0x73e6('0x3b')]+'%'};return _0x25a9a8;}})});}_0x50da32=_[_0x73e6('0x3d')]({},_0x50da32,_0x2e3d7c[_0x73e6('0x41')]);var _0x32e032={'where':_0x50da32['where']};return db[_0x73e6('0x42')]['count'](_0x32e032)['then'](function(_0x2958ed){_0x896020['count']=_0x2958ed;if(_0x2e3d7c[_0x73e6('0x31')][_0x73e6('0x43')]){_0x50da32[_0x73e6('0x44')]=[{'all':!![]}];}return db[_0x73e6('0x42')][_0x73e6('0x45')](_0x50da32);})[_0x73e6('0x27')](function(_0x2555e5){_0x896020[_0x73e6('0x46')]=_0x2555e5;return _0x896020;})[_0x73e6('0x27')](respondWithFilteredResult(_0x93a9ae,_0x50da32))[_0x73e6('0x47')](handleError(_0x93a9ae,null));};exports['show']=function(_0x52844d,_0xa69c6e){var _0x5ba5bb={'raw':!![],'where':{'id':_0x52844d[_0x73e6('0x48')]['id']}},_0x562b2b={};_0x562b2b[_0x73e6('0x2e')]=_[_0x73e6('0x30')](db['ChatTransferReport'][_0x73e6('0x2b')]);_0x562b2b[_0x73e6('0x31')]=_[_0x73e6('0x30')](_0x52844d['query']);_0x562b2b[_0x73e6('0x32')]=_[_0x73e6('0x33')](_0x562b2b[_0x73e6('0x2e')],_0x562b2b[_0x73e6('0x31')]);_0x5ba5bb[_0x73e6('0x35')]=_[_0x73e6('0x33')](_0x562b2b[_0x73e6('0x2e')],qs[_0x73e6('0x34')](_0x52844d['query'][_0x73e6('0x34')]));_0x5ba5bb[_0x73e6('0x35')]=_0x5ba5bb[_0x73e6('0x35')][_0x73e6('0x36')]?_0x5ba5bb['attributes']:_0x562b2b[_0x73e6('0x2e')];if(_0x52844d['query'][_0x73e6('0x43')]){_0x5ba5bb[_0x73e6('0x44')]=[{'all':!![]}];}_0x5ba5bb=_[_0x73e6('0x3d')]({},_0x5ba5bb,_0x52844d[_0x73e6('0x41')]);return db[_0x73e6('0x42')][_0x73e6('0x49')](_0x5ba5bb)[_0x73e6('0x27')](handleEntityNotFound(_0xa69c6e,null))[_0x73e6('0x27')](respondWithResult(_0xa69c6e,null))[_0x73e6('0x47')](handleError(_0xa69c6e,null));};exports[_0x73e6('0x4a')]=function(_0x51a588,_0x2f8c32){return db[_0x73e6('0x42')][_0x73e6('0x4a')](_0x51a588[_0x73e6('0x4b')],{})[_0x73e6('0x27')](respondWithResult(_0x2f8c32,0xc9))[_0x73e6('0x47')](handleError(_0x2f8c32,null));};exports[_0x73e6('0x4c')]=function(_0x1c07c0,_0x22f700){if(_0x1c07c0[_0x73e6('0x4b')]['id']){delete _0x1c07c0[_0x73e6('0x4b')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x1c07c0[_0x73e6('0x48')]['id']}})['then'](handleEntityNotFound(_0x22f700,null))[_0x73e6('0x27')](saveUpdates(_0x1c07c0['body'],null))['then'](respondWithResult(_0x22f700,null))[_0x73e6('0x47')](handleError(_0x22f700,null));};exports['destroy']=function(_0x3957de,_0x4fd26a){return db[_0x73e6('0x42')][_0x73e6('0x49')]({'where':{'id':_0x3957de[_0x73e6('0x48')]['id']}})[_0x73e6('0x27')](handleEntityNotFound(_0x4fd26a,null))[_0x73e6('0x27')](removeEntity(_0x4fd26a,null))[_0x73e6('0x47')](handleError(_0x4fd26a,null));};exports[_0x73e6('0x4d')]=function(_0xb0335c,_0x3d7821){return db[_0x73e6('0x42')][_0x73e6('0x4d')]()[_0x73e6('0x27')](respondWithResult(_0x3d7821,null))[_0x73e6('0x47')](handleError(_0x3d7821,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index ffff963..c37c59e 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 _0x4cd5=['./chatTransferReport.attributes','exports','define','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x45a92c,_0x4d81a7){var _0x1f3097=function(_0x5c889f){while(--_0x5c889f){_0x45a92c['push'](_0x45a92c['shift']());}};_0x1f3097(++_0x4d81a7);}(_0x4cd5,0xe1));var _0x54cd=function(_0x4de2c0,_0x4822ea){_0x4de2c0=_0x4de2c0-0x0;var _0x440f3d=_0x4cd5[_0x4de2c0];return _0x440f3d;};'use strict';var _=require(_0x54cd('0x0'));var util=require('util');var logger=require(_0x54cd('0x1'))(_0x54cd('0x2'));var moment=require(_0x54cd('0x3'));var BPromise=require(_0x54cd('0x4'));var rp=require(_0x54cd('0x5'));var fs=require('fs');var path=require(_0x54cd('0x6'));var rimraf=require(_0x54cd('0x7'));var config=require(_0x54cd('0x8'));var attributes=require(_0x54cd('0x9'));module[_0x54cd('0xa')]=function(_0x1802ea,_0x23b2bb){return _0x1802ea[_0x54cd('0xb')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x54cd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa8d3=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatTransferReport.attributes','define'];(function(_0x4913df,_0x358237){var _0x2f9ba2=function(_0x4fcd50){while(--_0x4fcd50){_0x4913df['push'](_0x4913df['shift']());}};_0x2f9ba2(++_0x358237);}(_0xa8d3,0x121));var _0x3a8d=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa8d3[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x3a8d('0x0'));var util=require(_0x3a8d('0x1'));var logger=require(_0x3a8d('0x2'))(_0x3a8d('0x3'));var moment=require(_0x3a8d('0x4'));var BPromise=require(_0x3a8d('0x5'));var rp=require(_0x3a8d('0x6'));var fs=require('fs');var path=require(_0x3a8d('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3a8d('0x8'));module['exports']=function(_0x2fe788,_0x520fc9){return _0x2fe788[_0x3a8d('0x9')](_0x3a8d('0xa'),attributes,{'tableName':_0x3a8d('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3a8d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 6df47e8..7e5fa02 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 _0x0766=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x9911a6,_0x3f751d){var _0x5b445d=function(_0x40a6b8){while(--_0x40a6b8){_0x9911a6['push'](_0x9911a6['shift']());}};_0x5b445d(++_0x3f751d);}(_0x0766,0x195));var _0x6076=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0766[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6076('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6076('0x1'));var rs=require(_0x6076('0x2'));var fs=require('fs');var Redis=require(_0x6076('0x3'));var db=require(_0x6076('0x4'))['db'];var utils=require(_0x6076('0x5'));var logger=require(_0x6076('0x6'))('rpc');var config=require(_0x6076('0x7'));var jayson=require(_0x6076('0x8'));var client=jayson[_0x6076('0x9')][_0x6076('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23849f,_0x24cb48,_0x2ba2e3){return new BPromise(function(_0x594496,_0x2ea0ae){return client[_0x6076('0xb')](_0x23849f,_0x2ba2e3)['then'](function(_0x2eaeb0){logger[_0x6076('0xc')](_0x6076('0xd'),_0x24cb48,_0x6076('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x24cb48,_0x6076('0xe'),JSON['stringify'](_0x2eaeb0));if(_0x2eaeb0['error']){if(_0x2eaeb0[_0x6076('0xf')][_0x6076('0x10')]===0x1f4){logger[_0x6076('0xf')](_0x6076('0xd'),_0x24cb48,_0x2eaeb0[_0x6076('0xf')]['message']);return _0x2ea0ae(_0x2eaeb0[_0x6076('0xf')]['message']);}logger[_0x6076('0xf')](_0x6076('0xd'),_0x24cb48,_0x2eaeb0[_0x6076('0xf')][_0x6076('0x11')]);return _0x594496(_0x2eaeb0[_0x6076('0xf')][_0x6076('0x11')]);}else{logger[_0x6076('0xc')](_0x6076('0xd'),_0x24cb48,'request\x20sent');_0x594496(_0x2eaeb0[_0x6076('0x12')][_0x6076('0x11')]);}})['catch'](function(_0x2be723){logger['error'](_0x6076('0xd'),_0x24cb48,_0x2be723);_0x2ea0ae(_0x2be723);});});} \ No newline at end of file +var _0x85f1=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4d4df6,_0x42fe2a){var _0x3d24dd=function(_0x1ef303){while(--_0x1ef303){_0x4d4df6['push'](_0x4d4df6['shift']());}};_0x3d24dd(++_0x42fe2a);}(_0x85f1,0x8f));var _0x185f=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x85f1[_0x34021d];return _0x16597b;};'use strict';var _=require(_0x185f('0x0'));var util=require(_0x185f('0x1'));var moment=require(_0x185f('0x2'));var BPromise=require(_0x185f('0x3'));var rs=require(_0x185f('0x4'));var fs=require('fs');var Redis=require(_0x185f('0x5'));var db=require(_0x185f('0x6'))['db'];var utils=require(_0x185f('0x7'));var logger=require(_0x185f('0x8'))(_0x185f('0x9'));var config=require(_0x185f('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x185f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4be68c,_0x1e8550,_0x1ed928){return new BPromise(function(_0xbd5a00,_0x23da5e){return client[_0x185f('0xc')](_0x4be68c,_0x1ed928)[_0x185f('0xd')](function(_0x236fa9){logger[_0x185f('0xe')](_0x185f('0xf'),_0x1e8550,_0x185f('0x10'));logger[_0x185f('0x11')](_0x185f('0x12'),_0x1e8550,_0x185f('0x10'),JSON[_0x185f('0x13')](_0x236fa9));if(_0x236fa9[_0x185f('0x14')]){if(_0x236fa9[_0x185f('0x14')][_0x185f('0x15')]===0x1f4){logger[_0x185f('0x14')](_0x185f('0xf'),_0x1e8550,_0x236fa9[_0x185f('0x14')][_0x185f('0x16')]);return _0x23da5e(_0x236fa9[_0x185f('0x14')][_0x185f('0x16')]);}logger[_0x185f('0x14')](_0x185f('0xf'),_0x1e8550,_0x236fa9[_0x185f('0x14')][_0x185f('0x16')]);return _0xbd5a00(_0x236fa9[_0x185f('0x14')][_0x185f('0x16')]);}else{logger[_0x185f('0xe')](_0x185f('0xf'),_0x1e8550,_0x185f('0x10'));_0xbd5a00(_0x236fa9[_0x185f('0x17')][_0x185f('0x16')]);}})[_0x185f('0x18')](function(_0x501b18){logger[_0x185f('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x1e8550,_0x501b18);_0x23da5e(_0x501b18);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 72716b6..9942bdb 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 _0xb544=['create','put','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post'];(function(_0x139a4f,_0x5c6d66){var _0x46ed1c=function(_0x1190e4){while(--_0x1190e4){_0x139a4f['push'](_0x139a4f['shift']());}};_0x46ed1c(++_0x5c6d66);}(_0xb544,0xd0));var _0x4b54=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xb544[_0x565ed7];return _0x183ad7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4b54('0x0'));var timeout=require(_0x4b54('0x1'));var express=require(_0x4b54('0x2'));var router=express[_0x4b54('0x3')]();var fs_extra=require(_0x4b54('0x4'));var auth=require(_0x4b54('0x5'));var interaction=require(_0x4b54('0x6'));var config=require(_0x4b54('0x7'));var controller=require('./chatTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4b54('0x8')]('/describe',auth[_0x4b54('0x9')](),controller['describe']);router[_0x4b54('0x8')](_0x4b54('0xa'),auth['isAuthenticated'](),controller[_0x4b54('0xb')]);router[_0x4b54('0xc')]('/',auth[_0x4b54('0x9')](),controller[_0x4b54('0xd')]);router[_0x4b54('0xe')](_0x4b54('0xa'),auth[_0x4b54('0x9')](),controller['update']);router[_0x4b54('0xf')](_0x4b54('0xa'),auth[_0x4b54('0x9')](),controller['destroy']);module[_0x4b54('0x10')]=router; \ No newline at end of file +var _0xd485=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x54ba5b,_0x5b7508){var _0x5e16ac=function(_0x131aed){while(--_0x131aed){_0x54ba5b['push'](_0x54ba5b['shift']());}};_0x5e16ac(++_0x5b7508);}(_0xd485,0x1e6));var _0x5d48=function(_0x11172b,_0x485571){_0x11172b=_0x11172b-0x0;var _0x4bb6ae=_0xd485[_0x11172b];return _0x4bb6ae;};'use strict';var multer=require('multer');var util=require(_0x5d48('0x0'));var path=require(_0x5d48('0x1'));var timeout=require(_0x5d48('0x2'));var express=require(_0x5d48('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5d48('0x4'));var config=require(_0x5d48('0x5'));var controller=require('./chatTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5d48('0x6')](_0x5d48('0x7'),auth[_0x5d48('0x8')](),controller[_0x5d48('0x9')]);router[_0x5d48('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5d48('0xa')]('/',auth[_0x5d48('0x8')](),controller[_0x5d48('0xb')]);router[_0x5d48('0xc')](_0x5d48('0xd'),auth[_0x5d48('0x8')](),controller[_0x5d48('0xe')]);router[_0x5d48('0xf')]('/:id',auth[_0x5d48('0x8')](),controller[_0x5d48('0x10')]);module[_0x5d48('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 6278578..c1397b5 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 _0x62b4=['Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','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','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x62b4,0x174));var _0x462b=function(_0x2e7f1e,_0x32f286){_0x2e7f1e=_0x2e7f1e-0x0;var _0x3dffa5=_0x62b4[_0x2e7f1e];return _0x3dffa5;};'use strict';var Sequelize=require(_0x462b('0x0'));var rs=require(_0x462b('0x1'));module[_0x462b('0x2')]={'name':{'type':Sequelize[_0x462b('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x462b('0x3')],'allowNull':![],'unique':_0x462b('0x4')},'description':{'type':Sequelize[_0x462b('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x462b('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x462b('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x6')},'customerAlias':{'type':Sequelize[_0x462b('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x462b('0x3')],'allowNull':![],'defaultValue':_0x462b('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x462b('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x462b('0x3')],'allowNull':![],'defaultValue':_0x462b('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x462b('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x462b('0x3')]},'animation':{'type':Sequelize[_0x462b('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x462b('0xb')]('rounded',_0x462b('0xc')),'defaultValue':_0x462b('0xd')},'header_online':{'type':Sequelize[_0x462b('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0xe')},'offline_chat_button':{'type':Sequelize[_0x462b('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x462b('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x462b('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x462b('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x462b('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x462b('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x13')},'noteTitle':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x14')},'placeholderMessage':{'type':Sequelize[_0x462b('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x15')},'closingMessageButton':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x16')},'skipMessageButton':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x17')},'conditionAgreement':{'type':Sequelize[_0x462b('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x462b('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x462b('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x18')},'ratingType':{'type':Sequelize[_0x462b('0xb')](_0x462b('0x19'),_0x462b('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x462b('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x462b('0x11')],'defaultValue':function(){return JSON[_0x462b('0x1b')]({'items':[{'type':_0x462b('0x1c'),'variable':null,'config':{'placeholder':_0x462b('0x1d'),'type':_0x462b('0x1e'),'required':!![]},'props':{'title':_0x462b('0x1d'),'helpText':''}},{'type':_0x462b('0x1c'),'props':{'title':_0x462b('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x462b('0x5'),'type':_0x462b('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x462b('0x1f')](_0x462b('0x20'))?JSON[_0x462b('0x21')](this[_0x462b('0x1f')](_0x462b('0x20'))):{};},'set':function(_0x550650){return this[_0x462b('0x22')](_0x462b('0x20'),JSON['stringify'](_0x550650));}},'offlineForm':{'type':Sequelize[_0x462b('0x11')],'defaultValue':function(){return JSON[_0x462b('0x1b')]({'items':[{'type':_0x462b('0x1c'),'props':{'title':_0x462b('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x462b('0x5'),'type':_0x462b('0x5')},'variable':null},{'type':_0x462b('0x23'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x462b('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x462b('0x1f')](_0x462b('0x25'))?JSON[_0x462b('0x21')](this[_0x462b('0x1f')](_0x462b('0x25'))):{};},'set':function(_0x5fb207){return this['setDataValue'](_0x462b('0x25'),JSON[_0x462b('0x1b')](_0x5fb207));}},'token':{'type':Sequelize[_0x462b('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x462b('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x462b('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x462b('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x462b('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x462b('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x462b('0x26')},'waitingMessage':{'type':Sequelize[_0x462b('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x27')},'offlineMessageBody':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x462b('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x29')},'skipUnmanaged':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x17')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x462b('0x16')},'enableCustomerAttachment':{'type':Sequelize[_0x462b('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x462b('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x462b('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x462b('0x2a');}},'notificationSound':{'type':Sequelize[_0x462b('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x462b('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x462b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x462b('0x2c')},'verticalAlignment':{'type':Sequelize[_0x462b('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x462b('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x462b('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x462b('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x462b('0x3')],'allowNull':![],'defaultValue':_0x462b('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x462b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x462b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x462b('0x3')],'defaultValue':_0x462b('0x2f')},'systemAvatar':{'type':Sequelize[_0x462b('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x462b('0x9')],'comment':_0x462b('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x462b('0x31'),'set':function(_0x3994b0){if(!_0x3994b0)this[_0x462b('0x22')](_0x462b('0x32'),null);this[_0x462b('0x22')](_0x462b('0x33'),_0x3994b0);}},'vidaooEscalation':{'type':Sequelize[_0x462b('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x462b('0x34')},'vidaooNote':{'type':Sequelize[_0x462b('0x3')],'defaultValue':function(){return _0x462b('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x462b('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x462b('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x462b('0x11')]}}; \ No newline at end of file +var _0xe769=['rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','TEXT','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','BOOLEAN','ENUM'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe769,0x6a));var _0x9e76=function(_0x142be6,_0x55f613){_0x142be6=_0x142be6-0x0;var _0x3630d9=_0xe769[_0x142be6];return _0x3630d9;};'use strict';var Sequelize=require(_0x9e76('0x0'));var rs=require(_0x9e76('0x1'));module[_0x9e76('0x2')]={'name':{'type':Sequelize[_0x9e76('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x9e76('0x3')],'allowNull':![],'unique':_0x9e76('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0x5')},'mapKeyOffline':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x9e76('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9e76('0x3')],'allowNull':![],'defaultValue':_0x9e76('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9e76('0x3')],'allowNull':![],'defaultValue':_0x9e76('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9e76('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9e76('0x3')]},'animation':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9e76('0x9')](_0x9e76('0xa'),_0x9e76('0xb')),'defaultValue':_0x9e76('0xa')},'header_online':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0xc')},'start_chat_button':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0xd')},'offline_chat_button':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x9e76('0xe')},'download_transcript':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9e76('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x9e76('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9e76('0x13')},'noteTitle':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0x14')},'placeholderMessage':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0x15')},'closingMessage':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0x16')},'closingMessageButton':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0x17')},'skipMessageButton':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0x18')},'conditionAgreement':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9e76('0x19')},'ratingType':{'type':Sequelize[_0x9e76('0x9')](_0x9e76('0x1a'),_0x9e76('0x1b')),'defaultValue':_0x9e76('0x1a')},'ratingStarsNumber':{'type':Sequelize[_0x9e76('0xf')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9e76('0x1c')],'defaultValue':function(){return JSON[_0x9e76('0x1d')]({'items':[{'type':_0x9e76('0x1e'),'variable':null,'config':{'placeholder':_0x9e76('0x1f'),'type':_0x9e76('0x20'),'required':!![]},'props':{'title':_0x9e76('0x1f'),'helpText':''}},{'type':_0x9e76('0x1e'),'props':{'title':_0x9e76('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x9e76('0x5'),'type':_0x9e76('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9e76('0x21')](_0x9e76('0x22'))?JSON[_0x9e76('0x23')](this[_0x9e76('0x21')](_0x9e76('0x22'))):{};},'set':function(_0x1c5dbd){return this['setDataValue'](_0x9e76('0x22'),JSON[_0x9e76('0x1d')](_0x1c5dbd));}},'offlineForm':{'type':Sequelize[_0x9e76('0x1c')],'defaultValue':function(){return JSON[_0x9e76('0x1d')]({'items':[{'type':'input','props':{'title':_0x9e76('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x9e76('0x5'),'type':'email'},'variable':null},{'type':_0x9e76('0x24'),'config':{'placeholder':_0x9e76('0x25')},'props':{'title':_0x9e76('0x25'),'helpText':_0x9e76('0x26')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x9e76('0x27'))?JSON[_0x9e76('0x23')](this[_0x9e76('0x21')](_0x9e76('0x27'))):{};},'set':function(_0x108458){return this[_0x9e76('0x28')](_0x9e76('0x27'),JSON[_0x9e76('0x1d')](_0x108458));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9e76('0x29')]();}},'autoclose':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9e76('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9e76('0x3')]},'waitingTitle':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0x2a')},'waitingMessage':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0x2b')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x9e76('0x2c')},'offlineMessageBody':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0x2d')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9e76('0x2e')},'skipUnmanaged':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0x17')},'enableCustomerAttachment':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9e76('0x1c')]},'showAgentAvatar':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9e76('0x2f');}},'notificationSound':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':_0x9e76('0x30')},'waitForTheAssignedAgent':{'type':Sequelize[_0x9e76('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x9e76('0x31')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x9e76('0x3')]},'customerAvatar':{'type':Sequelize[_0x9e76('0x1c')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9e76('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9e76('0x32'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9e76('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x9e76('0x33')},'systemAvatar':{'type':Sequelize[_0x9e76('0x1c')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9e76('0xf')],'comment':_0x9e76('0x34')},'mandatoryDisposition':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':![],'comment':_0x9e76('0x35'),'set':function(_0x2cd0bf){if(!_0x2cd0bf)this[_0x9e76('0x28')](_0x9e76('0x36'),null);this[_0x9e76('0x28')](_0x9e76('0x37'),_0x2cd0bf);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x9e76('0x3')],'allowNull':![],'defaultValue':_0x9e76('0x38')},'vidaooNote':{'type':Sequelize[_0x9e76('0x3')],'defaultValue':function(){return _0x9e76('0x39');}},'vidaooMetadata':{'type':Sequelize[_0x9e76('0x1c')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9e76('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9e76('0x1c')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 020c07a..09c5815 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 _0x81bd=['spread','messageId','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','offline','files','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','port','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','readFileSync','server/files/chat/iframe.js','remote','x-real-ip','connection','referer','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','end','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Pause','describe','addDisposition','ChatWebsiteId','Disposition','findOne','hasOwnProperty','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLicense','custom','isNil','existsSync','join','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','applications','Applications','list','orderBy','priority','asc','account','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','%s\x20%s','unknown','format','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0x81bd,0x7c));var _0xd81b=function(_0x57a50d,_0x2871f8){_0x57a50d=_0x57a50d-0x0;var _0x1b25b3=_0x81bd[_0x57a50d];return _0x1b25b3;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];config[_0xd81b('0x1b')]=_['defaults'](config[_0xd81b('0x1b')],{'host':_0xd81b('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd81b('0x1b')]));require('./chatWebsite.socket')[_0xd81b('0x1d')](socket);var jayson=require(_0xd81b('0x1e'));var client=jayson[_0xd81b('0x1f')][_0xd81b('0x20')]({'port':0x232c});var client9002=jayson[_0xd81b('0x1f')]['http']({'port':0x232a});var client9003=jayson[_0xd81b('0x1f')][_0xd81b('0x20')]({'port':0x232b});var client9001=jayson['client'][_0xd81b('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x26df61,_0x4657cf,_0x15e860,_0x5f7db6){return new BPromise(function(_0xc49b8d,_0x6746f0){var _0x3d4d34=_0x5f7db6||client;return _0x3d4d34[_0xd81b('0x21')](_0x26df61,_0x15e860)[_0xd81b('0x22')](function(_0x1ff3c6){logger[_0xd81b('0x23')](_0xd81b('0x24'),_0x4657cf,_0xd81b('0x25'));logger[_0xd81b('0x26')](_0xd81b('0x27'),_0x4657cf,'request\x20sent',JSON['stringify'](_0x1ff3c6));if(_0x1ff3c6[_0xd81b('0x28')]){if(_0x1ff3c6[_0xd81b('0x28')][_0xd81b('0x29')]===0x1f4){logger['error'](_0xd81b('0x24'),_0x4657cf,_0x1ff3c6[_0xd81b('0x28')]['message']);return _0x6746f0(_0x1ff3c6[_0xd81b('0x28')][_0xd81b('0x2a')]);}logger[_0xd81b('0x28')](_0xd81b('0x24'),_0x4657cf,_0x1ff3c6[_0xd81b('0x28')][_0xd81b('0x2a')]);return _0xc49b8d(_0x1ff3c6[_0xd81b('0x28')][_0xd81b('0x2a')]);}else{logger[_0xd81b('0x23')](_0xd81b('0x24'),_0x4657cf,_0xd81b('0x25'));_0xc49b8d(_0x1ff3c6[_0xd81b('0x2b')]['message']);}})[_0xd81b('0x2c')](function(_0x99dbc9){logger[_0xd81b('0x28')](_0xd81b('0x24'),_0x4657cf,_0x99dbc9);_0x6746f0(_0x99dbc9);});});}function respondWithStatusCode(_0x3266c2,_0x2d0d02){_0x2d0d02=_0x2d0d02||0xcc;return function(_0x3e28dd){if(_0x3e28dd){return _0x3266c2[_0xd81b('0x2d')](_0x2d0d02);}return _0x3266c2[_0xd81b('0x2e')](_0x2d0d02)['end']();};}function respondWithResult(_0x469cc4,_0x4e2eff){_0x4e2eff=_0x4e2eff||0xc8;return function(_0x5c8aee){if(_0x5c8aee){return _0x469cc4[_0xd81b('0x2e')](_0x4e2eff)[_0xd81b('0x2f')](_0x5c8aee);}};}function respondWithFilteredResult(_0x5141e6,_0x481454){return function(_0x4093c8){if(_0x4093c8){var _0xf10fe0=typeof _0x481454[_0xd81b('0x30')]===_0xd81b('0x31')&&typeof _0x481454[_0xd81b('0x32')]===_0xd81b('0x31');var _0x5527ed=_0x4093c8[_0xd81b('0x33')];var _0x26f629=_0xf10fe0?0x0:_0x481454['offset'];var _0x56d80b=_0xf10fe0?_0x4093c8[_0xd81b('0x33')]:_0x481454[_0xd81b('0x30')]+_0x481454['limit'];var _0x50ce25;if(_0x56d80b>=_0x5527ed){_0x56d80b=_0x5527ed;_0x50ce25=0xc8;}else{_0x50ce25=0xce;}_0x5141e6['status'](_0x50ce25);return _0x5141e6[_0xd81b('0x34')](_0xd81b('0x35'),_0x26f629+'-'+_0x56d80b+'/'+_0x5527ed)[_0xd81b('0x2f')](_0x4093c8);}return null;};}function patchUpdates(_0x1c4cf7){return function(_0xa56339){try{jsonpatch[_0xd81b('0x36')](_0xa56339,_0x1c4cf7,!![]);}catch(_0x29aabf){return BPromise['reject'](_0x29aabf);}return _0xa56339[_0xd81b('0x37')]();};}function saveUpdates(_0x51e19c,_0x34634a){return function(_0xb1a7c9){if(_0xb1a7c9){return _0xb1a7c9[_0xd81b('0x38')](_0x51e19c)[_0xd81b('0x22')](function(_0x36c69f){return _0x36c69f;});}return null;};}function removeEntity(_0x221e1f,_0x1c20d3){return function(_0x2d23b9){if(_0x2d23b9){return _0x2d23b9[_0xd81b('0x39')]()[_0xd81b('0x22')](function(){var _0x1be4e2=_0x2d23b9[_0xd81b('0x3a')]({'plain':!![]});var _0x346038='ChatWebsites';return db['UserProfileResource'][_0xd81b('0x39')]({'where':{'type':_0x346038,'resourceId':_0x1be4e2['id']}})[_0xd81b('0x22')](function(){return _0x2d23b9;});})[_0xd81b('0x22')](function(){_0x221e1f['status'](0xcc)[_0xd81b('0x3b')]();});}};}function handleEntityNotFound(_0x37ba34,_0x5a236a){return function(_0x46f058){if(!_0x46f058){_0x37ba34[_0xd81b('0x2d')](0x194);}return _0x46f058;};}function handleError(_0x512e39,_0xed5272){_0xed5272=_0xed5272||0x1f4;return function(_0x5a48e8){logger[_0xd81b('0x28')](_0x5a48e8[_0xd81b('0x3c')]);if(_0x5a48e8[_0xd81b('0x3d')]){delete _0x5a48e8[_0xd81b('0x3d')];}_0x512e39['status'](_0xed5272)[_0xd81b('0x3e')](_0x5a48e8);};}exports[_0xd81b('0x3f')]=function(_0x3e391f,_0x67fbe5){var _0x3abd60={'include':[{'model':db['Pause'],'as':_0xd81b('0x40')}]},_0x466e98={},_0x3976fc={'count':0x0,'rows':[]};var _0x35a295=_[_0xd81b('0x41')](db['ChatWebsite'][_0xd81b('0x42')],function(_0x3a05f4){return{'name':_0x3a05f4[_0xd81b('0x43')],'type':_0x3a05f4[_0xd81b('0x44')][_0xd81b('0x45')]};});_0x466e98['model']=_[_0xd81b('0x41')](_0x35a295,_0xd81b('0x3d'));_0x466e98[_0xd81b('0x46')]=_[_0xd81b('0x47')](_0x3e391f[_0xd81b('0x46')]);_0x466e98[_0xd81b('0x48')]=_[_0xd81b('0x49')](_0x466e98[_0xd81b('0x4a')],_0x466e98[_0xd81b('0x46')]);_0x3abd60[_0xd81b('0x4b')]=_[_0xd81b('0x49')](_0x466e98['model'],qs[_0xd81b('0x4c')](_0x3e391f[_0xd81b('0x46')][_0xd81b('0x4c')]));_0x3abd60[_0xd81b('0x4b')]=_0x3abd60[_0xd81b('0x4b')][_0xd81b('0x4d')]?_0x3abd60[_0xd81b('0x4b')]:_0x466e98[_0xd81b('0x4a')];if(!_0x3e391f['query']['hasOwnProperty'](_0xd81b('0x4e'))){_0x3abd60[_0xd81b('0x32')]=qs[_0xd81b('0x32')](_0x3e391f[_0xd81b('0x46')][_0xd81b('0x32')]);_0x3abd60[_0xd81b('0x30')]=qs[_0xd81b('0x30')](_0x3e391f[_0xd81b('0x46')][_0xd81b('0x30')]);}_0x3abd60[_0xd81b('0x4f')]=qs[_0xd81b('0x50')](_0x3e391f[_0xd81b('0x46')]['sort']);_0x3abd60[_0xd81b('0x51')]=qs[_0xd81b('0x48')](_[_0xd81b('0x52')](_0x3e391f[_0xd81b('0x46')],_0x466e98[_0xd81b('0x48')]),_0x35a295);if(_0x3e391f[_0xd81b('0x46')][_0xd81b('0x53')]){_0x3abd60[_0xd81b('0x51')]=_[_0xd81b('0x54')](_0x3abd60['where'],{'$or':_[_0xd81b('0x41')](_0x35a295,function(_0x2368dd){if(_0x2368dd[_0xd81b('0x44')]!==_0xd81b('0x55')){var _0x55326b={};_0x55326b[_0x2368dd[_0xd81b('0x3d')]]={'$like':'%'+_0x3e391f[_0xd81b('0x46')][_0xd81b('0x53')]+'%'};return _0x55326b;}})});}_0x3abd60=_[_0xd81b('0x54')]({},_0x3abd60,_0x3e391f[_0xd81b('0x56')]);var _0x434ae5={'where':_0x3abd60[_0xd81b('0x51')]};return db[_0xd81b('0x57')][_0xd81b('0x33')](_0x434ae5)['then'](function(_0x534d10){_0x3976fc[_0xd81b('0x33')]=_0x534d10;if(_0x3e391f[_0xd81b('0x46')][_0xd81b('0x58')]){_0x3abd60[_0xd81b('0x59')]=[{'all':!![]}];}return db[_0xd81b('0x57')][_0xd81b('0x5a')](_0x3abd60);})[_0xd81b('0x22')](function(_0x1f2e10){_0x3976fc['rows']=_0x1f2e10;return _0x3976fc;})[_0xd81b('0x22')](respondWithFilteredResult(_0x67fbe5,_0x3abd60))[_0xd81b('0x2c')](handleError(_0x67fbe5,null));};exports[_0xd81b('0x5b')]=function(_0x3d171a,_0x4651d3){var _0x59b13b={'raw':![],'where':{'id':_0x3d171a[_0xd81b('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xd81b('0x40')}]},_0x647c56={};_0x647c56[_0xd81b('0x4a')]=_[_0xd81b('0x47')](db[_0xd81b('0x57')][_0xd81b('0x42')]);_0x647c56[_0xd81b('0x46')]=_[_0xd81b('0x47')](_0x3d171a[_0xd81b('0x46')]);_0x647c56[_0xd81b('0x48')]=_[_0xd81b('0x49')](_0x647c56[_0xd81b('0x4a')],_0x647c56['query']);_0x59b13b[_0xd81b('0x4b')]=_['intersection'](_0x647c56[_0xd81b('0x4a')],qs[_0xd81b('0x4c')](_0x3d171a[_0xd81b('0x46')][_0xd81b('0x4c')]));_0x59b13b[_0xd81b('0x4b')]=_0x59b13b[_0xd81b('0x4b')]['length']?_0x59b13b[_0xd81b('0x4b')]:_0x647c56[_0xd81b('0x4a')];if(_0x3d171a['query']['includeAll']){_0x59b13b[_0xd81b('0x59')]=[{'all':!![]}];}_0x59b13b=_['merge']({},_0x59b13b,_0x3d171a[_0xd81b('0x56')]);return db['ChatWebsite'][_0xd81b('0x5d')](_0x59b13b)[_0xd81b('0x22')](handleEntityNotFound(_0x4651d3,null))[_0xd81b('0x22')](respondWithResult(_0x4651d3,null))['catch'](handleError(_0x4651d3,null));};exports[_0xd81b('0x5e')]=function(_0x10ed99,_0x5b7b64){return db[_0xd81b('0x57')][_0xd81b('0x5e')](_0x10ed99['body'],{})[_0xd81b('0x22')](function(_0x5e1cd7){var _0x3c9264=_0x10ed99[_0xd81b('0x5f')][_0xd81b('0x3a')]({'plain':!![]});if(!_0x3c9264)throw new Error(_0xd81b('0x60'));if(_0x3c9264[_0xd81b('0x61')]===_0xd81b('0x5f')){var _0x2f2afe=_0x5e1cd7[_0xd81b('0x3a')]({'plain':!![]});var _0xc55960=_0xd81b('0x62');return db['UserProfileSection'][_0xd81b('0x5d')]({'where':{'name':_0xc55960,'userProfileId':_0x3c9264[_0xd81b('0x63')]},'raw':!![]})[_0xd81b('0x22')](function(_0x3e4c33){if(_0x3e4c33&&_0x3e4c33[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x65')][_0xd81b('0x5e')]({'name':_0x2f2afe['name'],'resourceId':_0x2f2afe['id'],'type':_0x3e4c33['name'],'sectionId':_0x3e4c33['id']},{})['then'](function(){return _0x5e1cd7;});}else{return _0x5e1cd7;}})[_0xd81b('0x2c')](function(_0x12b0bf){logger[_0xd81b('0x28')](_0xd81b('0x66'),_0x12b0bf);throw _0x12b0bf;});}return _0x5e1cd7;})[_0xd81b('0x22')](respondWithResult(_0x5b7b64,0xc9))[_0xd81b('0x2c')](handleError(_0x5b7b64,null));};exports[_0xd81b('0x38')]=function(_0x5afecf,_0x3fcd8c){if(_0x5afecf[_0xd81b('0x67')]['id']){delete _0x5afecf[_0xd81b('0x67')]['id'];}return db[_0xd81b('0x57')][_0xd81b('0x5d')]({'where':{'id':_0x5afecf[_0xd81b('0x5c')]['id']},'include':[{'model':db[_0xd81b('0x68')],'as':'mandatoryDispositionPause'}]})[_0xd81b('0x22')](handleEntityNotFound(_0x3fcd8c,null))[_0xd81b('0x22')](saveUpdates(_0x5afecf[_0xd81b('0x67')],null))[_0xd81b('0x22')](respondWithResult(_0x3fcd8c,null))[_0xd81b('0x2c')](handleError(_0x3fcd8c,null));};exports[_0xd81b('0x39')]=function(_0x1be43d,_0x19d4f0){return db[_0xd81b('0x57')][_0xd81b('0x5d')]({'where':{'id':_0x1be43d[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x19d4f0,null))['then'](removeEntity(_0x19d4f0,null))[_0xd81b('0x2c')](handleError(_0x19d4f0,null));};exports['describe']=function(_0x2e7141,_0x6fa974){return db[_0xd81b('0x57')][_0xd81b('0x69')]()[_0xd81b('0x22')](respondWithResult(_0x6fa974,null))[_0xd81b('0x2c')](handleError(_0x6fa974,null));};exports[_0xd81b('0x6a')]=function(_0x18f2ac,_0x10d6d2,_0x36fb7a){if(_0x18f2ac['body']['id']){delete _0x18f2ac[_0xd81b('0x67')]['id'];}return db[_0xd81b('0x57')][_0xd81b('0x5d')]({'where':{'id':_0x18f2ac[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x10d6d2,null))['then'](function(_0x582ca1){if(_0x582ca1){_0x18f2ac[_0xd81b('0x67')][_0xd81b('0x6b')]=_0x582ca1['id'];return db[_0xd81b('0x6c')][_0xd81b('0x5e')](_0x18f2ac[_0xd81b('0x67')]);}})[_0xd81b('0x22')](respondWithResult(_0x10d6d2,null))[_0xd81b('0x2c')](handleError(_0x10d6d2,null));};exports['getDispositions']=function(_0x2190df,_0x41ac46,_0x9fd6d){var _0x1c6ec8={'raw':![],'where':{}};var _0x1f874d={};var _0x21d039={'count':0x0,'rows':[]};return db[_0xd81b('0x57')][_0xd81b('0x6d')]({'where':{'id':_0x2190df[_0xd81b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x41ac46,null))[_0xd81b('0x22')](function(_0x34d6dc){if(_0x34d6dc){_0x1f874d[_0xd81b('0x4a')]=_[_0xd81b('0x47')](db[_0xd81b('0x6c')]['rawAttributes']);_0x1f874d[_0xd81b('0x46')]=_[_0xd81b('0x47')](_0x2190df['query']);_0x1f874d[_0xd81b('0x48')]=_[_0xd81b('0x49')](_0x1f874d['model'],_0x1f874d[_0xd81b('0x46')]);_0x1c6ec8[_0xd81b('0x4b')]=_[_0xd81b('0x49')](_0x1f874d['model'],qs[_0xd81b('0x4c')](_0x2190df[_0xd81b('0x46')][_0xd81b('0x4c')]));_0x1c6ec8['attributes']=_0x1c6ec8['attributes'][_0xd81b('0x4d')]?_0x1c6ec8[_0xd81b('0x4b')]:_0x1f874d[_0xd81b('0x4a')];if(!_0x2190df['query'][_0xd81b('0x6e')](_0xd81b('0x4e'))){_0x1c6ec8[_0xd81b('0x32')]=qs[_0xd81b('0x32')](_0x2190df['query']['limit']);_0x1c6ec8[_0xd81b('0x30')]=qs[_0xd81b('0x30')](_0x2190df[_0xd81b('0x46')][_0xd81b('0x30')]);}_0x1c6ec8['order']=qs[_0xd81b('0x50')](_0x2190df[_0xd81b('0x46')]['sort']);_0x1c6ec8[_0xd81b('0x51')]=qs['filters'](_[_0xd81b('0x52')](_0x2190df[_0xd81b('0x46')],_0x1f874d['filters']));_0x1c6ec8[_0xd81b('0x51')][_0xd81b('0x6b')]=_0x34d6dc['id'];if(_0x2190df[_0xd81b('0x46')][_0xd81b('0x53')]){_0x1c6ec8[_0xd81b('0x51')]=_['merge'](_0x1c6ec8[_0xd81b('0x51')],{'$or':_[_0xd81b('0x41')](_0x1c6ec8[_0xd81b('0x4b')],function(_0x2cc2d2){var _0x1919b2={};_0x1919b2[_0x2cc2d2]={'$like':'%'+_0x2190df[_0xd81b('0x46')]['filter']+'%'};return _0x1919b2;})});}_0x1c6ec8=_['merge']({},_0x1c6ec8,_0x2190df[_0xd81b('0x56')]);return db[_0xd81b('0x6c')][_0xd81b('0x33')]({'where':_0x1c6ec8[_0xd81b('0x51')]})['then'](function(_0x1afacb){_0x21d039[_0xd81b('0x33')]=_0x1afacb;if(_0x2190df[_0xd81b('0x46')][_0xd81b('0x58')]){_0x1c6ec8[_0xd81b('0x59')]=[{'all':!![]}];}return db['Disposition'][_0xd81b('0x5a')](_0x1c6ec8);})[_0xd81b('0x22')](function(_0x159b28){_0x21d039[_0xd81b('0x6f')]=_0x159b28;return _0x21d039;});}})[_0xd81b('0x22')](respondWithFilteredResult(_0x41ac46,_0x1c6ec8))[_0xd81b('0x2c')](handleError(_0x41ac46,null));};exports[_0xd81b('0x70')]=function(_0x57179a,_0x3dc419,_0x2ef7ae){return db[_0xd81b('0x57')][_0xd81b('0x5d')]({'where':{'id':_0x57179a[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x3dc419,null))['then'](function(_0x451fd3){if(_0x451fd3){return _0x451fd3['removeDispositions'](_0x57179a[_0xd81b('0x46')][_0xd81b('0x71')]);}})[_0xd81b('0x22')](respondWithStatusCode(_0x3dc419,null))['catch'](handleError(_0x3dc419,null));};exports[_0xd81b('0x72')]=function(_0x27f848,_0x3ee396,_0x5060dc){if(_0x27f848[_0xd81b('0x67')]['id']){delete _0x27f848[_0xd81b('0x67')]['id'];}return db['ChatWebsite'][_0xd81b('0x5d')]({'where':{'id':_0x27f848['params']['id']}})['then'](handleEntityNotFound(_0x3ee396,null))[_0xd81b('0x22')](function(_0x428317){if(_0x428317){_0x27f848[_0xd81b('0x67')]['ChatWebsiteId']=_0x428317['id'];return db[_0xd81b('0x73')][_0xd81b('0x5e')](_0x27f848[_0xd81b('0x67')]);}})[_0xd81b('0x22')](respondWithResult(_0x3ee396,null))[_0xd81b('0x2c')](handleError(_0x3ee396,null));};exports[_0xd81b('0x74')]=function(_0x57586b,_0x22c044,_0x4390c3){var _0x10a27a={'raw':![],'where':{}};var _0xea1be={};var _0x19792d={'count':0x0,'rows':[]};return db[_0xd81b('0x57')][_0xd81b('0x6d')]({'where':{'id':_0x57586b[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x22c044,null))[_0xd81b('0x22')](function(_0x2fea95){if(_0x2fea95){_0xea1be[_0xd81b('0x4a')]=_[_0xd81b('0x47')](db[_0xd81b('0x73')][_0xd81b('0x42')]);_0xea1be['query']=_[_0xd81b('0x47')](_0x57586b['query']);_0xea1be[_0xd81b('0x48')]=_[_0xd81b('0x49')](_0xea1be[_0xd81b('0x4a')],_0xea1be[_0xd81b('0x46')]);_0x10a27a[_0xd81b('0x4b')]=_[_0xd81b('0x49')](_0xea1be['model'],qs[_0xd81b('0x4c')](_0x57586b[_0xd81b('0x46')][_0xd81b('0x4c')]));_0x10a27a[_0xd81b('0x4b')]=_0x10a27a[_0xd81b('0x4b')][_0xd81b('0x4d')]?_0x10a27a[_0xd81b('0x4b')]:_0xea1be[_0xd81b('0x4a')];if(!_0x57586b[_0xd81b('0x46')][_0xd81b('0x6e')](_0xd81b('0x4e'))){_0x10a27a[_0xd81b('0x32')]=qs['limit'](_0x57586b[_0xd81b('0x46')][_0xd81b('0x32')]);_0x10a27a[_0xd81b('0x30')]=qs[_0xd81b('0x30')](_0x57586b[_0xd81b('0x46')]['offset']);}_0x10a27a[_0xd81b('0x4f')]=qs[_0xd81b('0x50')](_0x57586b[_0xd81b('0x46')][_0xd81b('0x50')]);_0x10a27a[_0xd81b('0x51')]=qs[_0xd81b('0x48')](_['pick'](_0x57586b[_0xd81b('0x46')],_0xea1be['filters']));_0x10a27a[_0xd81b('0x51')][_0xd81b('0x6b')]=_0x2fea95['id'];if(_0x57586b[_0xd81b('0x46')][_0xd81b('0x53')]){_0x10a27a['where']=_[_0xd81b('0x54')](_0x10a27a[_0xd81b('0x51')],{'$or':_['map'](_0x10a27a[_0xd81b('0x4b')],function(_0x142d78){var _0x2c1a0e={};_0x2c1a0e[_0x142d78]={'$like':'%'+_0x57586b[_0xd81b('0x46')][_0xd81b('0x53')]+'%'};return _0x2c1a0e;})});}_0x10a27a=_['merge']({},_0x10a27a,_0x57586b['options']);return db[_0xd81b('0x73')]['count']({'where':_0x10a27a[_0xd81b('0x51')]})['then'](function(_0x509001){_0x19792d[_0xd81b('0x33')]=_0x509001;if(_0x57586b[_0xd81b('0x46')]['includeAll']){_0x10a27a['include']=[{'all':!![]}];}return db[_0xd81b('0x73')][_0xd81b('0x5a')](_0x10a27a);})['then'](function(_0x3bd71a){_0x19792d[_0xd81b('0x6f')]=_0x3bd71a;return _0x19792d;});}})[_0xd81b('0x22')](respondWithFilteredResult(_0x22c044,_0x10a27a))[_0xd81b('0x2c')](handleError(_0x22c044,null));};exports['removeAnswers']=function(_0xc4ece6,_0x41ee4c,_0x105e33){return db['ChatWebsite']['find']({'where':{'id':_0xc4ece6[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x41ee4c,null))[_0xd81b('0x22')](function(_0x3a1ca9){if(_0x3a1ca9){return _0x3a1ca9[_0xd81b('0x75')](_0xc4ece6['query']['ids']);}})[_0xd81b('0x22')](respondWithStatusCode(_0x41ee4c,null))[_0xd81b('0x2c')](handleError(_0x41ee4c,null));};exports['addLogo']=function(_0x4846ca,_0x3a5357,_0x3619be){_0x4846ca[_0xd81b('0x67')][_0xd81b('0x76')]=_0x4846ca[_0xd81b('0x77')][_0xd81b('0x78')];return db[_0xd81b('0x57')][_0xd81b('0x5d')]({'where':{'id':_0x4846ca[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x3a5357,null))['then'](saveUpdates(_0x4846ca['body'],null))[_0xd81b('0x22')](respondWithResult(_0x3a5357,null))[_0xd81b('0x2c')](handleError(_0x3a5357,null));};exports[_0xd81b('0x79')]=function(_0x7319a,_0x145c8a,_0x3cc2fa){_0x7319a[_0xd81b('0x67')][_0xd81b('0x7a')]=_0x7319a[_0xd81b('0x77')][_0xd81b('0x78')];return db[_0xd81b('0x57')][_0xd81b('0x5d')]({'where':{'id':_0x7319a[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x145c8a,null))[_0xd81b('0x22')](saveUpdates(_0x7319a['body'],null))[_0xd81b('0x22')](respondWithResult(_0x145c8a,null))[_0xd81b('0x2c')](handleError(_0x145c8a,null));};exports[_0xd81b('0x7b')]=function(_0x5209de,_0x18cde7,_0x3bd28c){_0x5209de[_0xd81b('0x67')][_0xd81b('0x7c')]=_0x5209de[_0xd81b('0x77')]['filename'];return db[_0xd81b('0x57')][_0xd81b('0x5d')]({'where':{'id':_0x5209de[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x18cde7,null))[_0xd81b('0x22')](saveUpdates(_0x5209de[_0xd81b('0x67')],null))[_0xd81b('0x22')](respondWithResult(_0x18cde7,null))[_0xd81b('0x2c')](handleError(_0x18cde7,null));};exports[_0xd81b('0x7d')]=function(_0x282e83,_0x18949b,_0x3a0aee){_0x282e83['body'][_0xd81b('0x7e')]=_0x282e83[_0xd81b('0x77')][_0xd81b('0x78')];return db['ChatWebsite'][_0xd81b('0x5d')]({'where':{'id':_0x282e83[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x18949b,null))[_0xd81b('0x22')](saveUpdates(_0x282e83['body'],null))[_0xd81b('0x22')](respondWithResult(_0x18949b,null))['catch'](handleError(_0x18949b,null));};exports['getLogo']=function(_0x1ed83e,_0x26548a,_0x22e737){var _0x1a0ae3=path['join'](config['root'],'server/files/images/logos/default_logo.svg');var _0xf0c9a0={'where':{'id':_0x1ed83e[_0xd81b('0x5c')]['id']},'attributes':['id',_0xd81b('0x76')],'raw':!![]};var _0xf37aa6=![];return require(_0xd81b('0x1a'))[_0xd81b('0x7f')]()[_0xd81b('0x22')](function(_0xf9ee1d){if(_0xf9ee1d){_0xf37aa6=_0xf9ee1d[_0xd81b('0x80')];}})[_0xd81b('0x22')](function(){return db[_0xd81b('0x57')][_0xd81b('0x5d')](_0xf0c9a0);})[_0xd81b('0x22')](handleEntityNotFound(_0x26548a,null))[_0xd81b('0x22')](function(_0x33db02){if(_0x33db02){if(!_[_0xd81b('0x81')](_0x33db02[_0xd81b('0x76')])){if(fs[_0xd81b('0x82')](path[_0xd81b('0x83')](config[_0xd81b('0x84')],'server/files/images/logos/',_0x33db02[_0xd81b('0x76')]))&&_0xf37aa6){_0x1a0ae3=path[_0xd81b('0x83')](config[_0xd81b('0x84')],_0xd81b('0x85'),_0x33db02[_0xd81b('0x76')]);}}return _0x26548a['download'](_0x1a0ae3);}})[_0xd81b('0x2c')](handleError(_0x26548a,null));};exports[_0xd81b('0x86')]=function(_0x59a51a,_0x8f3a9f,_0x4610f4){var _0x468372=path[_0xd81b('0x83')](config[_0xd81b('0x84')],_0xd81b('0x87'));var _0x22e808={'where':{'id':_0x59a51a[_0xd81b('0x5c')]['id']},'attributes':['id',_0xd81b('0x7a')],'raw':!![]};return db[_0xd81b('0x57')][_0xd81b('0x5d')](_0x22e808)[_0xd81b('0x22')](handleEntityNotFound(_0x8f3a9f,null))[_0xd81b('0x22')](function(_0xf4ed2a){if(_0xf4ed2a){if(!_['isNil'](_0xf4ed2a[_0xd81b('0x7a')])){if(fs['existsSync'](path[_0xd81b('0x83')](config[_0xd81b('0x84')],_0xd81b('0x88'),_0xf4ed2a['agentAvatar']))){_0x468372=path[_0xd81b('0x83')](config[_0xd81b('0x84')],_0xd81b('0x88'),_0xf4ed2a[_0xd81b('0x7a')]);}}return _0x8f3a9f['download'](_0x468372);}})[_0xd81b('0x2c')](handleError(_0x8f3a9f,null));};exports[_0xd81b('0x89')]=function(_0x1fb71f,_0xf2e1b5,_0x441e6b){var _0x2977fb=path[_0xd81b('0x83')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x2e48b5={'where':{'id':_0x1fb71f[_0xd81b('0x5c')]['id']},'attributes':['id',_0xd81b('0x7c'),'showCustomerAvatar'],'raw':!![]};return db[_0xd81b('0x57')]['find'](_0x2e48b5)[_0xd81b('0x22')](handleEntityNotFound(_0xf2e1b5,null))[_0xd81b('0x22')](function(_0xc12aa2){if(_0xc12aa2){if(!_[_0xd81b('0x81')](_0xc12aa2[_0xd81b('0x7c')])){if(fs[_0xd81b('0x82')](path[_0xd81b('0x83')](config[_0xd81b('0x84')],_0xd81b('0x88'),_0xc12aa2['customerAvatar']))&&_0xc12aa2[_0xd81b('0x8a')]){_0x2977fb=path[_0xd81b('0x83')](config[_0xd81b('0x84')],'server/files/images/avatars/',_0xc12aa2['customerAvatar']);}}return _0xf2e1b5[_0xd81b('0x8b')](_0x2977fb);}})[_0xd81b('0x2c')](handleError(_0xf2e1b5,null));};exports[_0xd81b('0x8c')]=function(_0x3e6a85,_0x3a6ac2,_0x175d02){var _0x151693=path[_0xd81b('0x83')](config['root'],_0xd81b('0x8d'));var _0x1f9cf3={'where':{'id':_0x3e6a85[_0xd81b('0x5c')]['id']},'attributes':['id',_0xd81b('0x7e')],'raw':!![]};return db['ChatWebsite'][_0xd81b('0x5d')](_0x1f9cf3)['then'](handleEntityNotFound(_0x3a6ac2,null))[_0xd81b('0x22')](function(_0xecf9c6){if(_0xecf9c6){if(!_[_0xd81b('0x81')](_0xecf9c6['systemAvatar'])){if(fs[_0xd81b('0x82')](path[_0xd81b('0x83')](config['root'],_0xd81b('0x88'),_0xecf9c6['systemAvatar']))){_0x151693=path[_0xd81b('0x83')](config[_0xd81b('0x84')],_0xd81b('0x88'),_0xecf9c6['systemAvatar']);}}return _0x3a6ac2[_0xd81b('0x8b')](_0x151693);}})[_0xd81b('0x2c')](handleError(_0x3a6ac2,null));};exports[_0xd81b('0x8e')]=function(_0x1dc3d7,_0x1e2612,_0x5dc7b1){var _0x51b399=require(_0xd81b('0x8f'));var _0x188c72=new _0x51b399();var _0xe523e6=_0x188c72['setUA'](_0x1dc3d7[_0xd81b('0x90')][_0xd81b('0x91')])[_0xd81b('0x92')]();var _0x211d28={'body':_0x1dc3d7[_0xd81b('0x67')],'channel':_0xd81b('0x93')};var _0x23ffb1=[];var _0x52643b=[];var _0x4bb34f={};var _0x56b536=![];return db[_0xd81b('0x94')][_0xd81b('0x69')]()['then'](function(_0x1d2e40){if(!_0x1d2e40){throw new db['Sequelize']['ValidationError'](_0xd81b('0x95'));}_0x23ffb1=_[_0xd81b('0x96')](_[_0xd81b('0x47')](_0x1d2e40),[_0xd81b('0x97'),_0xd81b('0x98')]);_0x52643b=_[_0xd81b('0x96')](_[_0xd81b('0x47')](_0x1d2e40),[_0xd81b('0x97'),_0xd81b('0x98'),_0xd81b('0x99'),_0xd81b('0x9a')]);if(_0x1dc3d7[_0xd81b('0x67')]['id']){delete _0x1dc3d7[_0xd81b('0x67')]['id'];}if(_[_0xd81b('0x81')](_0x1dc3d7[_0xd81b('0x67')]['from'])){throw new db[(_0xd81b('0x9b'))][(_0xd81b('0x9c'))]('from\x20is\x20mandatory');}if(_[_0xd81b('0x81')](_0x1dc3d7['body'][_0xd81b('0x67')])||_0x1dc3d7['body'][_0xd81b('0x67')]===''){throw new db[(_0xd81b('0x9b'))][(_0xd81b('0x9c'))](_0xd81b('0x9d'));}if(_[_0xd81b('0x81')](_0x1dc3d7[_0xd81b('0x67')][_0xd81b('0x9e')])){throw new db[(_0xd81b('0x9b'))][(_0xd81b('0x9c'))](_0xd81b('0x9f')+_0x52643b);}if(!_[_0xd81b('0xa0')](_0x52643b,_0x1dc3d7[_0xd81b('0x67')]['mapKey'])){throw new db[(_0xd81b('0x9b'))][(_0xd81b('0x9c'))](_0xd81b('0xa1')+_0x52643b);}_0x4bb34f[_0x1dc3d7[_0xd81b('0x67')][_0xd81b('0x9e')]]=_0x1dc3d7[_0xd81b('0x67')][_0xd81b('0xa2')];})[_0xd81b('0x22')](function(){return db[_0xd81b('0x57')][_0xd81b('0x5d')]({'where':{'id':_0x1dc3d7['params']['id']},'include':[{'model':db[_0xd81b('0xa3')],'as':_0xd81b('0xa4'),'include':[{'model':db['CmContact'],'as':_0xd81b('0xa5'),'where':_0x4bb34f,'limit':0x1,'order':[['updatedAt',_0xd81b('0xa6')]]}]},{'model':db[_0xd81b('0xa7')],'as':'Applications'}]});})[_0xd81b('0x22')](handleEntityNotFound(_0x1e2612,null))[_0xd81b('0x22')](function(_0x3255bd){if(_0x3255bd&&_0x3255bd[_0xd81b('0xa4')]){_0x211d28['account']=_0x3255bd;_0x211d28[_0xd81b('0xa8')]=_0x3255bd[_0xd81b('0xa9')];_0x211d28[_0xd81b('0xaa')]=_0x3255bd[_0xd81b('0xa4')];_0x211d28[_0xd81b('0xa8')]=_[_0xd81b('0xab')](_0x211d28['applications'],[_0xd81b('0xac')],[_0xd81b('0xad')]);if(_0x211d28[_0xd81b('0xae')]['Applications']){delete _0x211d28['account'][_0xd81b('0xa9')];}if(_0x211d28[_0xd81b('0xae')][_0xd81b('0xa4')]&&_0x211d28['account'][_0xd81b('0xa4')][_0xd81b('0xa5')][_0xd81b('0x4d')]){return _0x211d28[_0xd81b('0xae')][_0xd81b('0xa4')][_0xd81b('0xa5')][0x0];}var _0x4fa362=_[_0xd81b('0xaf')](_0x1dc3d7[_0xd81b('0x67')],{'firstName':_0x1dc3d7['body'][_0xd81b('0xa2')],'ListId':_0x3255bd[_0xd81b('0x9a')]});_0x4fa362[_0x1dc3d7['body'][_0xd81b('0x9e')]]=_0x1dc3d7[_0xd81b('0x67')][_0xd81b('0xa2')];return db[_0xd81b('0x94')][_0xd81b('0x5e')](_0x4fa362,{'fields':_0x23ffb1,'raw':!![]});}})[_0xd81b('0x22')](handleEntityNotFound(_0x1e2612,null))[_0xd81b('0x22')](function(_0x51c3e3){_0x211d28[_0xd81b('0xb0')]=_0x51c3e3;var _0x203311=_0x1dc3d7['body'][_0xd81b('0xb1')];if(_0x1dc3d7[_0xd81b('0x90')]['cf-connecting-ip']){_0x203311=_0x1dc3d7[_0xd81b('0x90')][_0xd81b('0xb2')];}else if(_0x1dc3d7[_0xd81b('0x90')][_0xd81b('0xb3')]){_0x203311=_[_0xd81b('0xb4')](_0x1dc3d7['headers'][_0xd81b('0xb3')][_0xd81b('0xb5')](','));}if(_0x51c3e3){var _0x13a568={'ContactId':_0x51c3e3['id'],'ChatWebsiteId':_0x1dc3d7[_0xd81b('0x5c')]['id'],'from':(_0x51c3e3[_0xd81b('0xb6')]||'')+'\x20'+(_0x51c3e3[_0xd81b('0xb7')]||''),'customerIp':_0x203311,'customerPort':_0x1dc3d7[_0xd81b('0x90')][_0xd81b('0xb8')]?_0x1dc3d7[_0xd81b('0x90')][_0xd81b('0xb8')]:null,'referer':_0x1dc3d7[_0xd81b('0x67')]['referer'],'browserName':_0xe523e6['browser'][_0xd81b('0x3d')]&&_0xe523e6[_0xd81b('0xb9')][_0xd81b('0xba')]?util['format'](_0xd81b('0xbb'),_0xe523e6[_0xd81b('0xb9')][_0xd81b('0x3d')],_0xe523e6['browser'][_0xd81b('0xba')]):_0xd81b('0xbc'),'browserVersion':_0xe523e6['browser'][_0xd81b('0xba')]||_0xd81b('0xbc'),'osName':util[_0xd81b('0xbd')](_0xd81b('0xbb'),_0xe523e6['os'][_0xd81b('0x3d')],_0xe523e6['os'][_0xd81b('0xba')]),'osVersion':_0xe523e6['os'][_0xd81b('0xba')],'deviceModel':_0xe523e6['device'][_0xd81b('0x4a')]&&_0xe523e6[_0xd81b('0xbe')]['vendor']?util[_0xd81b('0xbd')]('%s\x20%s\x20%s',_0xe523e6[_0xd81b('0xbe')][_0xd81b('0x4a')],_0xe523e6[_0xd81b('0xbe')][_0xd81b('0xbf')],_0xe523e6[_0xd81b('0xbe')][_0xd81b('0x44')]):null,'deviceVendor':_0xe523e6[_0xd81b('0xbe')]['vendor'],'deviceType':_0xe523e6[_0xd81b('0xbe')]['type'],'formData':JSON['stringify'](_0x1dc3d7[_0xd81b('0x67')])};var _0x4ab039={'ChatWebsiteId':_0x1dc3d7[_0xd81b('0x5c')]['id'],'closed':![]};if(_0x1dc3d7[_0xd81b('0x67')][_0xd81b('0xc0')]){_0x4ab039[_0xd81b('0xc0')]=_0x1dc3d7['body']['threadId'];return db[_0xd81b('0xc1')][_0xd81b('0x5d')]({'where':_0x4ab039})['then'](function(_0x2ec729){if(_0x2ec729){return[_0x2ec729,![]];}_0x13a568[_0xd81b('0xc0')]=_0x1dc3d7[_0xd81b('0x67')]['threadId'];_0x13a568[_0xd81b('0xc2')]=_0x1dc3d7[_0xd81b('0x67')]['externalUrl'];return db[_0xd81b('0xc1')][_0xd81b('0x5e')](_0x13a568)[_0xd81b('0x22')](function(_0x167944){return[_0x167944,!![]];});});}_0x4ab039[_0xd81b('0xc3')]=_0x51c3e3['id'];if(_0x1dc3d7['body']['interaction']&&_0x1dc3d7[_0xd81b('0x67')][_0xd81b('0xc4')]['id']){_0x4ab039['id']=_0x1dc3d7[_0xd81b('0x67')][_0xd81b('0xc4')]['id'];return db['ChatInteraction'][_0xd81b('0x5d')]({'where':_0x4ab039})['then'](function(_0x206b13){if(_0x206b13){return[_0x206b13,![]];}return db[_0xd81b('0xc1')]['create'](_0x13a568)[_0xd81b('0x22')](function(_0x264d72){return[_0x264d72,!![]];});});}return db[_0xd81b('0xc1')]['create'](_0x13a568)[_0xd81b('0x22')](function(_0x239f69){return[_0x239f69,!![]];});}})[_0xd81b('0xc5')](function(_0x56e80f,_0x3cc12d){if(_0x56e80f){_0x56b536=_0x3cc12d;if(!_0x3cc12d){var _0x11e278={'from':(_0x211d28[_0xd81b('0xb0')][_0xd81b('0xb6')]||'')+'\x20'+(_0x211d28[_0xd81b('0xb0')]['lastName']||'')};if(_0x1dc3d7['body'][_0xd81b('0xc0')]&&_0x1dc3d7[_0xd81b('0x67')][_0xd81b('0xc6')]&&_0x1dc3d7[_0xd81b('0x67')]['threadId']!=_0x1dc3d7[_0xd81b('0x67')][_0xd81b('0xc6')]){_0x11e278[_0xd81b('0xc0')]=_0x1dc3d7['body'][_0xd81b('0xc6')];}return _0x56e80f[_0xd81b('0x38')](_0x11e278);}else{return _0x56e80f;}}})[_0xd81b('0x22')](function(_0x515bee){_0x211d28['interaction']=_0x515bee['get']({'plain':!![]});_0x211d28[_0xd81b('0xc4')]['created']=_0x56b536;if(_0x211d28[_0xd81b('0xc4')][_0xd81b('0xc7')]){if(_0x211d28[_0xd81b('0xae')]['autoclose']){_0x211d28['applications'][_0xd81b('0xc8')]({'id':0x0,'priority':_0x211d28['applications'][_0xd81b('0x4d')]+0x1,'app':_0xd81b('0xc9'),'appdata':_0xd81b('0xca'),'interval':_0xd81b('0xcb')});}}return db['ChatMessage'][_0xd81b('0x5e')]({'body':_0x1dc3d7[_0xd81b('0x67')][_0xd81b('0x67')],'ChatWebsiteId':_0x1dc3d7['params']['id'],'ChatInteractionId':_0x515bee['id'],'direction':'in','ContactId':_0x211d28[_0xd81b('0xb0')]['id'],'AttachmentId':_0x1dc3d7['body'][_0xd81b('0xcc')]});})[_0xd81b('0x22')](function(_0x5ceeb0){_0x211d28[_0xd81b('0x2a')]=_0x5ceeb0;if(_0x211d28[_0xd81b('0xc4')][_0xd81b('0xcd')]){return db['User']['find']({'attributes':['id',_0xd81b('0x3d')],'where':{'id':_0x211d28[_0xd81b('0xc4')][_0xd81b('0xcd')]}})[_0xd81b('0x22')](function(_0x2e611d){if(_0x2e611d){_0x211d28[_0xd81b('0xa8')][_0xd81b('0xce')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2e611d['name']+','+(_0x211d28[_0xd81b('0xae')][_0xd81b('0xcf')]||0xa),'interval':_0xd81b('0xcb')});_0x211d28[_0xd81b('0xd0')]=!![];}return respondWithRpcPromise('Start',_0xd81b('0xd1'),_0x211d28);});}return respondWithRpcPromise(_0xd81b('0xd2'),_0xd81b('0xd1'),_0x211d28);})[_0xd81b('0x22')](function(_0x1224ee){respondWithRpcPromise('EventManager','EventManager',{'event':_0xd81b('0x8e'),'message':_0x1224ee},client9002);return _0x1224ee;})[_0xd81b('0x22')](respondWithResult(_0x1e2612,null))[_0xd81b('0x2c')](handleError(_0x1e2612,null));};exports[_0xd81b('0xd3')]=function(_0x14833d,_0x5ce2b1,_0x49e5dd){var _0x30ddbd,_0x5890b2,_0x32cf81;var _0x282bb0=[];var _0x2e008a=[];var _0x3ddf0b={};var _0x2f2e19=_0x14833d[_0xd81b('0xd4')]||[];var _0x30440c=[];var _0xad0a5b;return db[_0xd81b('0x94')][_0xd81b('0x69')]()[_0xd81b('0x22')](function(_0x43a84b){if(!_0x43a84b){throw new db[(_0xd81b('0x9b'))][(_0xd81b('0x9c'))](_0xd81b('0x95'));}_0x2e008a=_[_0xd81b('0x96')](_['keys'](_0x43a84b),[_0xd81b('0x97'),'updatedAt']);_0x282bb0=_[_0xd81b('0x96')](_[_0xd81b('0x47')](_0x43a84b),[_0xd81b('0x97'),_0xd81b('0x98'),'CompanyId',_0xd81b('0x9a')]);if(_0x14833d['body']['id']){delete _0x14833d[_0xd81b('0x67')]['id'];}if(_[_0xd81b('0x81')](_0x14833d['body'][_0xd81b('0xa2')])){throw _0x5ce2b1['status'](0x1f4)[_0xd81b('0x3e')](new db[(_0xd81b('0x9b'))][(_0xd81b('0x9c'))](_0xd81b('0xd5')));}if(_[_0xd81b('0x81')](_0x14833d[_0xd81b('0x67')][_0xd81b('0x67')])||_0x14833d[_0xd81b('0x67')][_0xd81b('0x67')]===''){throw _0x5ce2b1[_0xd81b('0x2e')](0x1f4)[_0xd81b('0x3e')](new db[(_0xd81b('0x9b'))]['ValidationError'](_0xd81b('0x9d')));}if(_['isNil'](_0x14833d[_0xd81b('0x67')][_0xd81b('0xd6')])){throw _0x5ce2b1[_0xd81b('0x2e')](0x1f4)[_0xd81b('0x3e')](new db[(_0xd81b('0x9b'))][(_0xd81b('0x9c'))](_0xd81b('0xd7')+_0x282bb0));}if(!_['includes'](_0x282bb0,_0x14833d[_0xd81b('0x67')]['mapKeyOffline'])){throw _0x5ce2b1[_0xd81b('0x2e')](0x1f4)['send'](new db[(_0xd81b('0x9b'))]['ValidationError'](_0xd81b('0xd8')+_0x282bb0));}_0x3ddf0b[_0x14833d[_0xd81b('0x67')][_0xd81b('0xd6')]]=_0x14833d[_0xd81b('0x67')]['from'];})[_0xd81b('0x22')](function(){return db[_0xd81b('0x57')]['find']({'where':{'id':_0x14833d['params']['id']},'include':[{'model':db['CmList'],'as':_0xd81b('0xa4')},{'model':db[_0xd81b('0xd9')],'as':_0xd81b('0xd9')}]});})[_0xd81b('0x22')](handleEntityNotFound(_0x5ce2b1,null))[_0xd81b('0x22')](function(_0x6f49fd){if(_0x6f49fd&&_0x6f49fd['List']){_0x5890b2=_0x6f49fd;var _0x5e4621=_[_0xd81b('0xaf')](_0x14833d['body'],{'firstName':_0x14833d[_0xd81b('0x67')][_0xd81b('0xa2')],'phone':_0x14833d[_0xd81b('0x67')][_0xd81b('0xa2')],'ListId':_0x6f49fd[_0xd81b('0x9a')]});_0x5e4621[_0x14833d[_0xd81b('0x67')][_0xd81b('0xd6')]]=_0x14833d[_0xd81b('0x67')][_0xd81b('0xa2')];return db[_0xd81b('0x94')][_0xd81b('0xda')]({'where':_0x3ddf0b,'defaults':_0x5e4621});}})[_0xd81b('0xc5')](function(_0x12012b){if(_0x12012b){_0x32cf81=_0x12012b;var _0x1efe61=fs['readFileSync'](path[_0xd81b('0x83')](config[_0xd81b('0x84')],_0xd81b('0xdb')),_0xd81b('0xdc'));var _0x47382b=ejs['render'](_0x1efe61,{'body':_[_0xd81b('0xdd')](_0x14833d['body']['body']),'bodyTitle':_0x5890b2[_0xd81b('0xde')]});return db['ChatOfflineMessage'][_0xd81b('0x5e')]({'body':_0x47382b,'ContactId':_0x12012b['id'],'ChatWebsiteId':_0x5890b2['id']});}})[_0xd81b('0x22')](function(_0x312120){_0xad0a5b=_0x312120;if(_0x2f2e19['length']){var _0x317c20=_0x2f2e19[_0xd81b('0x41')](function(_0x2ddc4d){return{'name':_0x2ddc4d['originalname'],'basename':_0x2ddc4d[_0xd81b('0x78')],'type':_0x2ddc4d[_0xd81b('0xdf')],'ChatOfflineMessageId':_0x312120['id']};});_0x30440c=_0x317c20[_0xd81b('0x41')](_0xad9c8f=>{var _0x202d6a={'filename':_0xad9c8f[_0xd81b('0x3d')],'path':path['join'](config[_0xd81b('0x84')],_0xd81b('0xe0'),_0xd81b('0xd4'),_0xd81b('0xe1'),_0xd81b('0xe2'),_0xad9c8f[_0xd81b('0xe3')])};return _0x202d6a;});if(!_0x5890b2[_0xd81b('0xe4')]){return db[_0xd81b('0xe5')][_0xd81b('0xe6')](function(_0x5059a6){return db[_0xd81b('0xe7')][_0xd81b('0xe8')](_0x317c20,{'transaction':_0x5059a6});});}}})[_0xd81b('0x22')](function(){if(_0xad0a5b){_0x30ddbd=_0xad0a5b;return db[_0xd81b('0xd9')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xd81b('0xe9')],'as':_0xd81b('0xea'),'raw':!![]}]});}})[_0xd81b('0x22')](function(_0x5338a2){if(_0x5338a2&&_0x5338a2[_0xd81b('0xea')]&&_0x5890b2[_0xd81b('0xeb')]&&_0x5890b2[_0xd81b('0xec')]){var _0x37e45c={'tls':{'rejectUnauthorized':![]}};if(_0x5338a2[_0xd81b('0xea')]['service']){_0x37e45c[_0xd81b('0xed')]=_0x5338a2[_0xd81b('0xea')][_0xd81b('0xed')];}else{_0x37e45c['host']=_0x5338a2[_0xd81b('0xea')]['host'];_0x37e45c['port']=_0x5338a2[_0xd81b('0xea')][_0xd81b('0xee')];_0x37e45c['secure']=_0x5338a2[_0xd81b('0xea')]['secure'];}if(_0x5338a2[_0xd81b('0xea')][_0xd81b('0xef')]){_0x37e45c[_0xd81b('0xf0')]={'user':_0x5338a2[_0xd81b('0xea')]['user'],'pass':_0x5338a2[_0xd81b('0xea')][_0xd81b('0xf1')]};}return respondWithRpcPromise(_0xd81b('0xf2'),_0xd81b('0xf3'),{'account':_0x37e45c,'message':{'from':util[_0xd81b('0xbd')](_0xd81b('0xf4'),_0x5338a2['name'],_0x5338a2[_0xd81b('0xf5')]||_0x5338a2['Smtp']['user']),'to':_0x5890b2[_0xd81b('0xec')],'subject':_0x5890b2[_0xd81b('0xf6')],'html':_0x30ddbd[_0xd81b('0x67')],'attachments':_0x30440c}},client9003)['then'](function(){return _0x30ddbd;})[_0xd81b('0x2c')](function(_0x1c8cd9){console['error'](_0x1c8cd9);});}})['then'](function(){if(_0x5890b2&&_0x5890b2[_0xd81b('0xe4')]&&_0x5890b2[_0xd81b('0xf7')]){var _0x44e2a8=[];if(_0x2f2e19[_0xd81b('0x4d')]){_0x44e2a8=_0x2f2e19[_0xd81b('0x41')](function(_0xe64036){return{'name':_0xe64036[_0xd81b('0xf8')],'basename':_0xe64036[_0xd81b('0x78')],'type':_0xe64036[_0xd81b('0xdf')],'ChatOfflineMessageId':_0xad0a5b['id']};});}var _0x41d12a;if(!_[_0xd81b('0x81')](_0x5890b2[_0xd81b('0xf9')])){var _0x2f3170=_[_0xd81b('0x41')](_0x14833d['body'],function(_0x25939f){return _0x25939f;});var _0x2afc53=_['toPairsIn'](_0x2f3170)[0x0];var _0x3d12ee=_[_0xd81b('0xfa')](_0x2afc53,function(_0x3a6139){return _0x3a6139;});_0x41d12a=_0x3d12ee[0x1][_0x5890b2[_0xd81b('0xf9')]];}var _0x541758={'from':_0x32cf81[_0xd81b('0xf5')],'firstName':_0x32cf81[_0xd81b('0xb6')],'lastName':_0x32cf81[_0xd81b('0xb7')],'mapKey':_0xd81b('0xf5'),'message':{'from':_0x32cf81[_0xd81b('0xf5')],'to':_0x5890b2[_0xd81b('0xd9')]['email'],'cc':'','subject':_[_0xd81b('0x81')](_0x41d12a)?_0x5890b2[_0xd81b('0xf6')]:_0x41d12a,'messageId':'','sentAt':new Date(),'attach':_0x44e2a8[_0xd81b('0x4d')],'attachments':_0x44e2a8,'originChannel':_0xd81b('0xfb'),'ChatWebsiteId':_0x5890b2['id'],'ChatOfflineMessageId':_0x30ddbd['id'],'originTo':_0x5890b2[_0xd81b('0xd9')][_0xd81b('0xf5')]},'body':_0x30ddbd['body']};var _0x5db623={'account':{'id':_0x5890b2[_0xd81b('0xf7')]},'body':_0x541758,'log':_0xd81b('0xfc')};return respondWithRpcPromise(_0xd81b('0xfc'),_0xd81b('0xfd'),_0x5db623,client9001)['then'](function(){return _0x30ddbd;})[_0xd81b('0x2c')](function(_0x4f326f){console[_0xd81b('0x28')](_0x4f326f);});}return;})[_0xd81b('0x22')](function(){if(_0x30ddbd){return _0x30ddbd;}})[_0xd81b('0x22')](respondWithResult(_0x5ce2b1,null))['catch'](function(_0x62f9ac){console['error'](_0xd81b('0x2c'),_0x62f9ac);for(var _0x29e584 of _0x2f2e19){var _0x5d1811=path['join'](config[_0xd81b('0x84')],'server','files',_0xd81b('0xe1'),_0xd81b('0xe2'),_0x29e584[_0xd81b('0x78')]);fs_extra['remove'](_0x5d1811)['catch'](function(_0x32fb6a){console[_0xd81b('0x28')](_0xd81b('0xfe'),_0x5d1811,_0x32fb6a);});}});};exports['addInteraction']=function(_0xfad675,_0xae9cb8,_0x4b0e9b){return db['ChatInteraction'][_0xd81b('0x5d')]({'where':{'id':_0xfad675[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0xae9cb8,null))['then'](function(_0x21b703){if(_0x21b703){return _0x21b703[_0xd81b('0xff')](_0xfad675['body'][_0xd81b('0x71')],_[_0xd81b('0x100')](_0xfad675[_0xd81b('0x67')],['ids','id'])||{});}})['then'](respondWithResult(_0xae9cb8,null))[_0xd81b('0x2c')](handleError(_0xae9cb8,null));};exports[_0xd81b('0x101')]=function(_0xeaefb8,_0x4378f1,_0x35e483){var _0x525220={'raw':![],'where':{}};var _0xb4376e={};var _0x52c868={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd81b('0x6d')]({'where':{'id':_0xeaefb8[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x4378f1,null))['then'](function(_0x69ac88){if(_0x69ac88){_0xb4376e['model']=_[_0xd81b('0x47')](db['ChatInteraction'][_0xd81b('0x42')]);_0xb4376e[_0xd81b('0x46')]=_[_0xd81b('0x47')](_0xeaefb8[_0xd81b('0x46')]);_0xb4376e[_0xd81b('0x48')]=_[_0xd81b('0x49')](_0xb4376e['model'],_0xb4376e['query']);_0x525220[_0xd81b('0x4b')]=_[_0xd81b('0x49')](_0xb4376e[_0xd81b('0x4a')],qs[_0xd81b('0x4c')](_0xeaefb8[_0xd81b('0x46')][_0xd81b('0x4c')]));_0x525220[_0xd81b('0x4b')]=_0x525220[_0xd81b('0x4b')]['length']?_0x525220[_0xd81b('0x4b')]:_0xb4376e[_0xd81b('0x4a')];if(!_0xeaefb8[_0xd81b('0x46')][_0xd81b('0x6e')]('nolimit')){_0x525220[_0xd81b('0x32')]=qs[_0xd81b('0x32')](_0xeaefb8[_0xd81b('0x46')][_0xd81b('0x32')]);_0x525220['offset']=qs[_0xd81b('0x30')](_0xeaefb8['query']['offset']);}_0x525220[_0xd81b('0x4f')]=qs[_0xd81b('0x50')](_0xeaefb8[_0xd81b('0x46')][_0xd81b('0x50')]);_0x525220[_0xd81b('0x51')]=qs[_0xd81b('0x48')](_[_0xd81b('0x52')](_0xeaefb8['query'],_0xb4376e[_0xd81b('0x48')]));_0x525220[_0xd81b('0x51')][_0xd81b('0x6b')]=_0x69ac88['id'];if(_0xeaefb8[_0xd81b('0x46')]['filter']){_0x525220[_0xd81b('0x51')]=_[_0xd81b('0x54')](_0x525220['where'],{'$or':_[_0xd81b('0x41')](_0x525220['attributes'],function(_0x35426a){var _0x56ee69={};_0x56ee69[_0x35426a]={'$like':'%'+_0xeaefb8['query'][_0xd81b('0x53')]+'%'};return _0x56ee69;})});}_0x525220=_[_0xd81b('0x54')]({},_0x525220,_0xeaefb8[_0xd81b('0x56')]);return db[_0xd81b('0xc1')]['count']({'where':_0x525220[_0xd81b('0x51')]})['then'](function(_0x37c1f0){_0x52c868[_0xd81b('0x33')]=_0x37c1f0;if(_0xeaefb8[_0xd81b('0x46')][_0xd81b('0x58')]){_0x525220[_0xd81b('0x59')]=[{'model':db[_0xd81b('0x94')],'as':_0xd81b('0x102'),'required':![]},{'model':db[_0xd81b('0x103')],'as':_0xd81b('0x104'),'attributes':['name',_0xd81b('0x105'),_0xd81b('0x106')],'required':![]},{'model':db[_0xd81b('0x107')],'as':_0xd81b('0x108'),'attributes':['id',_0xd81b('0x3d'),_0xd81b('0x109')],'where':_0xeaefb8[_0xd81b('0x46')][_0xd81b('0x10a')]?{'id':_0xeaefb8[_0xd81b('0x46')][_0xd81b('0x10a')]}:undefined,'required':_0xeaefb8['query'][_0xd81b('0x10a')]?!![]:![]}];}return db[_0xd81b('0xc1')][_0xd81b('0x5a')](_0x525220);})[_0xd81b('0x22')](function(_0x25f776){_0x52c868[_0xd81b('0x6f')]=_0x25f776;return _0x52c868;});}})[_0xd81b('0x22')](respondWithFilteredResult(_0x4378f1,_0x525220))[_0xd81b('0x2c')](handleError(_0x4378f1,null));};function iftimePromise(_0x1467e0,_0x3ecba8){return respondWithRpcPromise(_0xd81b('0x10b'),_0xd81b('0x10c'),{'command':_0x3ecba8[_0xd81b('0x10d')]?util[_0xd81b('0xbd')](_0xd81b('0x10e'),_0x1467e0[_0xd81b('0x10f')],_0x3ecba8[_0xd81b('0x10d')]):util['format'](_0xd81b('0x110'),_0x1467e0['interval'])},client9002)[_0xd81b('0x22')](function(_0x1c3879){var _0xf114d8=_0x1c3879&&_0x1c3879[_0xd81b('0x111')](_0xd81b('0x112'))>=0x0?!![]:![];logger['info'](_0xd81b('0x113'),_0x3ecba8['id'],_0x1467e0['id'],_0x1467e0[_0xd81b('0x10f')],_0xf114d8?_0xd81b('0x114'):'OFFLINE',_0x3ecba8['timezone']?_0x3ecba8[_0xd81b('0x10d')]:_0xd81b('0x115'));return _0xf114d8;})['catch'](function(_0x64e5c){logger[_0xd81b('0x28')](_0xd81b('0x113'),_0x3ecba8['id'],_0x1467e0['id'],_0x1467e0[_0xd81b('0x10f')],util[_0xd81b('0x116')](_0x64e5c,{'showHidden':![],'depth':null}),_0x3ecba8[_0xd81b('0x10d')]?_0x3ecba8[_0xd81b('0x10d')]:_0xd81b('0x115'));return![];});}exports[_0xd81b('0x10c')]=function(_0x108b7d,_0x88ee25,_0x10b022){var _0xe0b626=0x0;var _0x5a187a=0x0;var _0x73ddd1=![];var _0x4a47d8;var _0x4427f3;return db[_0xd81b('0x57')][_0xd81b('0x5d')]({'where':{'id':_0x108b7d['params']['id']},'include':[{'model':db[_0xd81b('0x117')],'as':'Interval','include':[{'model':db['Interval'],'as':_0xd81b('0x118'),'attributes':['id',_0xd81b('0x10f')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x88ee25,null))['then'](function(_0x3f2ac0){if(_0x3f2ac0){_0x4a47d8=_0x3f2ac0;return _0x3f2ac0[_0xd81b('0x119')]({'raw':!![]});}})[_0xd81b('0x22')](function(_0x155f6c){if(_0x4a47d8){if(_0x155f6c){_0x4427f3=_0x155f6c;}}return require(_0xd81b('0x1a'))['getLicense']();})[_0xd81b('0x22')](function(_0x3cbf88){if(_0x3cbf88){_0x5a187a=_0x3cbf88[_0xd81b('0x11a')];_0x73ddd1=_0x3cbf88[_0xd81b('0x80')];}})['then'](function(){return db['ChatInteraction'][_0xd81b('0x33')]({'where':{'closed':![]}});})[_0xd81b('0x22')](function(_0x39eb20){_0xe0b626=_0x39eb20;if(_0x5a187a&&_0x39eb20>_0x5a187a){return db[_0xd81b('0x11b')][_0xd81b('0x6d')]({'where':{'id':0x1}})[_0xd81b('0x22')](function(_0x49a071){if(_0x49a071){_0x49a071[_0xd81b('0x11c')](_0xd81b('0x11d'));}});}})['then'](function(){if(_0x4a47d8[_0xd81b('0x117')]&&_0x4a47d8[_0xd81b('0x117')][_0xd81b('0x118')]){var _0x1049cf=[];for(var _0x54e8db=0x0;_0x54e8db<_0x4a47d8[_0xd81b('0x117')][_0xd81b('0x118')][_0xd81b('0x4d')];_0x54e8db++){var _0x34beee=_0x4a47d8[_0xd81b('0x117')][_0xd81b('0x118')][_0x54e8db][_0xd81b('0x3a')]({'plain':!![]});_0x1049cf[_0xd81b('0xc8')](iftimePromise(_0x34beee,_0x4a47d8));}return BPromise[_0xd81b('0x11e')](_0x1049cf)[_0xd81b('0x22')](function(_0x43dfeb){return _['some'](_0x43dfeb);});}else{return!![];}})[_0xd81b('0x22')](function(_0x41ae2f){var _0x3061f8=fs[_0xd81b('0x11f')](path[_0xd81b('0x83')](config[_0xd81b('0x84')],_0xd81b('0x120')),_0xd81b('0xdc'));var _0x34cf85={'remote':_0x4a47d8[_0xd81b('0x121')],'query':querystring['stringify'](_[_0xd81b('0x54')](_0x4a47d8[_0xd81b('0x3a')]({'plain':!![]}),{'customerIp':_0x108b7d['headers'][_0xd81b('0xb3')]||_0x108b7d[_0xd81b('0x90')][_0xd81b('0x122')]||_0x108b7d[_0xd81b('0x123')]['remoteAddress']||_0x108b7d['ip'],'referer':_0x108b7d[_0xd81b('0x90')][_0xd81b('0x124')],'openedInteractions':_0xe0b626,'maxInteractions':_0x5a187a,'virtual':_0x73ddd1[_0xd81b('0x11a')],'online':_0x41ae2f,'custom':_0x73ddd1}))[_0xd81b('0x125')](/'/g,'\x5c\x27')};_0x88ee25[_0xd81b('0x3e')](ejs[_0xd81b('0x126')](Mustache[_0xd81b('0x126')](_0x3061f8,_0x34cf85),{'proactiveActions':_0x4427f3,'alignment':_0x4a47d8[_0xd81b('0x127')],'verticalAlignment':_0x4a47d8[_0xd81b('0x128')],'div_color':_0x4a47d8[_0xd81b('0x109')],'text_color':_0x4a47d8[_0xd81b('0x129')],'button_color':_0x4a47d8[_0xd81b('0x12a')],'background_color':_0x4a47d8[_0xd81b('0x12b')]}));})[_0xd81b('0x2c')](handleError(_0x88ee25,null));};exports[_0xd81b('0x12c')]=function(_0x52516b,_0x428f8a,_0x12ad20){return db[_0xd81b('0x57')]['findOne']({'where':{'id':_0x52516b['params']['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x428f8a,null))['then'](function(_0x7a2b07){if(_0x7a2b07){return db['sequelize'][_0xd81b('0xe6')](function(_0x7a990e){return db[_0xd81b('0xa7')][_0xd81b('0x39')]({'where':{'ChatWebsiteId':_0x52516b['params']['id']},'transaction':_0x7a990e})['then'](function(_0x17f804){var _0x47592f=_[_0xd81b('0x41')](_0x52516b[_0xd81b('0x67')],function(_0x6121cf){_0x6121cf[_0xd81b('0x6b')]=_0x52516b[_0xd81b('0x5c')]['id'];return _0x6121cf;});return db[_0xd81b('0xa7')][_0xd81b('0xe8')](_0x47592f,{'transaction':_0x7a990e});});})['then'](function(){return db['ChatApplication'][_0xd81b('0x12d')]({'where':{'ChatWebsiteId':_0x52516b[_0xd81b('0x5c')]['id']},'order':'priority'});});}})[_0xd81b('0x22')](respondWithResult(_0x428f8a,null))[_0xd81b('0x2c')](handleError(_0x428f8a,null));};exports[_0xd81b('0x12e')]=function(_0x72d484,_0x319b3d,_0x27f456){var _0x54b2ed={};var _0x59a3cb={};var _0x3bf879;var _0x2b2473;return db['ChatWebsite']['findOne']({'where':{'id':_0x72d484[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x319b3d,null))['then'](function(_0x46d5f3){if(_0x46d5f3){_0x3bf879=_0x46d5f3;_0x59a3cb[_0xd81b('0x4a')]=_['keys'](db[_0xd81b('0xa7')][_0xd81b('0x42')]);_0x59a3cb[_0xd81b('0x46')]=_['keys'](_0x72d484[_0xd81b('0x46')]);_0x59a3cb[_0xd81b('0x48')]=_[_0xd81b('0x49')](_0x59a3cb[_0xd81b('0x4a')],_0x59a3cb[_0xd81b('0x46')]);_0x54b2ed['attributes']=_[_0xd81b('0x49')](_0x59a3cb[_0xd81b('0x4a')],qs[_0xd81b('0x4c')](_0x72d484[_0xd81b('0x46')][_0xd81b('0x4c')]));_0x54b2ed[_0xd81b('0x4b')]=_0x54b2ed[_0xd81b('0x4b')][_0xd81b('0x4d')]?_0x54b2ed[_0xd81b('0x4b')]:_0x59a3cb[_0xd81b('0x4a')];_0x54b2ed['order']=qs[_0xd81b('0x50')](_0x72d484[_0xd81b('0x46')][_0xd81b('0x50')]);_0x54b2ed[_0xd81b('0x51')]=qs[_0xd81b('0x48')](_[_0xd81b('0x52')](_0x72d484[_0xd81b('0x46')],_0x59a3cb['filters']));if(_0x72d484['query'][_0xd81b('0x53')]){_0x54b2ed[_0xd81b('0x51')]=_[_0xd81b('0x54')](_0x54b2ed['where'],{'$or':_[_0xd81b('0x41')](_0x54b2ed[_0xd81b('0x4b')],function(_0x30a103){var _0x463110={};_0x463110[_0x30a103]={'$like':'%'+_0x72d484[_0xd81b('0x46')]['filter']+'%'};return _0x463110;})});}_0x54b2ed=_[_0xd81b('0x54')]({},_0x54b2ed,_0x72d484[_0xd81b('0x56')]);return _0x3bf879[_0xd81b('0x12e')](_0x54b2ed);}})[_0xd81b('0x22')](function(_0x89764a){if(_0x89764a){_0x2b2473=_0x89764a[_0xd81b('0x4d')];if(!_0x72d484[_0xd81b('0x46')]['hasOwnProperty']('nolimit')){_0x54b2ed['limit']=qs['limit'](_0x72d484['query'][_0xd81b('0x32')]);_0x54b2ed[_0xd81b('0x30')]=qs[_0xd81b('0x30')](_0x72d484['query'][_0xd81b('0x30')]);}return _0x3bf879['getApplications'](_0x54b2ed);}})[_0xd81b('0x22')](function(_0x406b40){if(_0x406b40){return _0x406b40?{'count':_0x2b2473,'rows':_0x406b40}:null;}})[_0xd81b('0x22')](respondWithResult(_0x319b3d,null))['catch'](handleError(_0x319b3d,null));};exports[_0xd81b('0x12f')]=function(_0x444551,_0x1be7ad,_0xd09d12){return db[_0xd81b('0x130')][_0xd81b('0x5d')]({'where':{'id':_0x444551['params']['id']}})['then'](handleEntityNotFound(_0x1be7ad,null))[_0xd81b('0x22')](function(_0x19c9d3){if(_0x19c9d3){return _0x19c9d3[_0xd81b('0x12f')](_0x444551[_0xd81b('0x67')]['ids'],_[_0xd81b('0x100')](_0x444551['body'],[_0xd81b('0x71'),'id'])||{});}})[_0xd81b('0x22')](respondWithResult(_0x1be7ad,null))[_0xd81b('0x2c')](handleError(_0x1be7ad,null));};exports[_0xd81b('0x119')]=function(_0x5c69b8,_0x4a1f5d,_0x16af59){var _0x29a1ad={};var _0xac896e={};var _0xe6b5f1;var _0x1f375f;return db[_0xd81b('0x57')][_0xd81b('0x6d')]({'where':{'id':_0x5c69b8['params']['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x4a1f5d,null))['then'](function(_0x557b6a){if(_0x557b6a){_0xe6b5f1=_0x557b6a;_0xac896e['model']=_[_0xd81b('0x47')](db[_0xd81b('0x131')][_0xd81b('0x42')]);_0xac896e[_0xd81b('0x46')]=_[_0xd81b('0x47')](_0x5c69b8['query']);_0xac896e[_0xd81b('0x48')]=_[_0xd81b('0x49')](_0xac896e[_0xd81b('0x4a')],_0xac896e[_0xd81b('0x46')]);_0x29a1ad['attributes']=_['intersection'](_0xac896e[_0xd81b('0x4a')],qs[_0xd81b('0x4c')](_0x5c69b8['query'][_0xd81b('0x4c')]));_0x29a1ad[_0xd81b('0x4b')]=_0x29a1ad[_0xd81b('0x4b')][_0xd81b('0x4d')]?_0x29a1ad[_0xd81b('0x4b')]:_0xac896e[_0xd81b('0x4a')];_0x29a1ad[_0xd81b('0x4f')]=qs['sort'](_0x5c69b8['query'][_0xd81b('0x50')]);_0x29a1ad['where']=qs[_0xd81b('0x48')](_['pick'](_0x5c69b8[_0xd81b('0x46')],_0xac896e[_0xd81b('0x48')]));if(_0x5c69b8[_0xd81b('0x46')][_0xd81b('0x53')]){_0x29a1ad[_0xd81b('0x51')]=_[_0xd81b('0x54')](_0x29a1ad[_0xd81b('0x51')],{'$or':_[_0xd81b('0x41')](_0x29a1ad['attributes'],function(_0x22de27){var _0x3ab22b={};_0x3ab22b[_0x22de27]={'$like':'%'+_0x5c69b8[_0xd81b('0x46')][_0xd81b('0x53')]+'%'};return _0x3ab22b;})});}_0x29a1ad=_[_0xd81b('0x54')]({},_0x29a1ad,_0x5c69b8['options']);return _0xe6b5f1[_0xd81b('0x119')](_0x29a1ad);}})['then'](function(_0x29e4f7){if(_0x29e4f7){_0x1f375f=_0x29e4f7[_0xd81b('0x4d')];if(!_0x5c69b8[_0xd81b('0x46')][_0xd81b('0x6e')]('nolimit')){_0x29a1ad[_0xd81b('0x32')]=qs[_0xd81b('0x32')](_0x5c69b8[_0xd81b('0x46')][_0xd81b('0x32')]);_0x29a1ad[_0xd81b('0x30')]=qs[_0xd81b('0x30')](_0x5c69b8['query'][_0xd81b('0x30')]);}return _0xe6b5f1['getProactiveActions'](_0x29a1ad);}})[_0xd81b('0x22')](function(_0x597c54){if(_0x597c54){return _0x597c54?{'count':_0x1f375f,'rows':_0x597c54}:null;}})['then'](respondWithResult(_0x4a1f5d,null))['catch'](handleError(_0x4a1f5d,null));};exports[_0xd81b('0x132')]=function(_0x4f46a1,_0x1c70e1,_0x410776){var _0x498ce1=_0x4f46a1[_0xd81b('0x46')][_0xd81b('0x133')]===_0xd81b('0x134')?'offlineForm':'onlineForm';return db[_0xd81b('0x57')][_0xd81b('0x5d')]({'attributes':['id',_0x498ce1],'where':{'id':_0x4f46a1[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x1c70e1,null))[_0xd81b('0x22')](function(_0x5db932){if(_0x5db932){var _0x5365fd=_0x5db932[_0x498ce1];var _0x1639ab=_0x5365fd&&_0x5365fd[_0xd81b('0x135')]?_0x5365fd[_0xd81b('0x135')]:[];_0x1c70e1[_0xd81b('0x3e')]({'fromKey':_[_0xd81b('0x81')](_0x5365fd[_0xd81b('0x136')])?undefined:_0x5365fd['fromKey'],'count':_0x1639ab['length'],'rows':_0x1639ab});}})[_0xd81b('0x2c')](handleError(_0x1c70e1,null));};exports[_0xd81b('0x137')]=function(_0x30d5a6,_0xe8ea93,_0x478d3a){var _0x2ec889={'raw':![],'where':{}};var _0x4cfcaf={};var _0x3d7acf={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd81b('0x6d')]({'where':{'id':_0x30d5a6[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0xe8ea93,null))['then'](function(_0x2782b6){if(_0x2782b6){_0x4cfcaf[_0xd81b('0x4a')]=_[_0xd81b('0x47')](db[_0xd81b('0x138')][_0xd81b('0x42')]);_0x4cfcaf[_0xd81b('0x46')]=_[_0xd81b('0x47')](_0x30d5a6[_0xd81b('0x46')]);_0x4cfcaf[_0xd81b('0x48')]=_['intersection'](_0x4cfcaf[_0xd81b('0x4a')],_0x4cfcaf[_0xd81b('0x46')]);_0x2ec889[_0xd81b('0x4b')]=_[_0xd81b('0x49')](_0x4cfcaf[_0xd81b('0x4a')],qs[_0xd81b('0x4c')](_0x30d5a6[_0xd81b('0x46')][_0xd81b('0x4c')]));_0x2ec889[_0xd81b('0x4b')]=_0x2ec889[_0xd81b('0x4b')]['length']?_0x2ec889[_0xd81b('0x4b')]:_0x4cfcaf[_0xd81b('0x4a')];if(!_0x30d5a6[_0xd81b('0x46')][_0xd81b('0x6e')](_0xd81b('0x4e'))){_0x2ec889[_0xd81b('0x32')]=qs[_0xd81b('0x32')](_0x30d5a6[_0xd81b('0x46')][_0xd81b('0x32')]);_0x2ec889['offset']=qs['offset'](_0x30d5a6[_0xd81b('0x46')]['offset']);}_0x2ec889[_0xd81b('0x4f')]=qs[_0xd81b('0x50')](_0x30d5a6[_0xd81b('0x46')][_0xd81b('0x50')]);_0x2ec889[_0xd81b('0x51')]=qs[_0xd81b('0x48')](_[_0xd81b('0x52')](_0x30d5a6[_0xd81b('0x46')],_0x4cfcaf['filters']));_0x2ec889[_0xd81b('0x51')][_0xd81b('0x6b')]=_0x2782b6['id'];if(_0x30d5a6['query'][_0xd81b('0x53')]){_0x2ec889[_0xd81b('0x51')]=_['merge'](_0x2ec889['where'],{'$or':_[_0xd81b('0x41')](_0x2ec889[_0xd81b('0x4b')],function(_0x619df4){var _0x22551={};_0x22551[_0x619df4]={'$like':'%'+_0x30d5a6[_0xd81b('0x46')][_0xd81b('0x53')]+'%'};return _0x22551;})});}_0x2ec889=_['merge']({},_0x2ec889,_0x30d5a6[_0xd81b('0x56')]);return db[_0xd81b('0x138')]['count']({'where':_0x2ec889[_0xd81b('0x51')]})[_0xd81b('0x22')](function(_0x212f03){_0x3d7acf[_0xd81b('0x33')]=_0x212f03;if(_0x30d5a6[_0xd81b('0x46')][_0xd81b('0x58')]){_0x2ec889[_0xd81b('0x59')]=[{'all':!![]}];}else{_0x2ec889[_0xd81b('0x59')]=[{'model':db[_0xd81b('0x94')],'as':_0xd81b('0x102'),'required':![]},{'model':db['Attachment'],'as':_0xd81b('0x139'),'required':![]}];}return db[_0xd81b('0x138')][_0xd81b('0x5a')](_0x2ec889);})[_0xd81b('0x22')](function(_0x46e79d){_0x3d7acf[_0xd81b('0x6f')]=_0x46e79d;return _0x3d7acf;});}})[_0xd81b('0x22')](respondWithFilteredResult(_0xe8ea93,_0x2ec889))['catch'](handleError(_0xe8ea93,null));};exports[_0xd81b('0x13a')]=function(_0x18c41f,_0x155a07,_0x368ae6){return db['ChatWebsite'][_0xd81b('0x5d')]({'where':{'id':_0x18c41f[_0xd81b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x155a07,null))['then'](function(_0x42b93a){if(_0x42b93a){return _0x42b93a[_0xd81b('0x13a')](_0x18c41f[_0xd81b('0x67')]['ids'],_[_0xd81b('0x100')](_0x18c41f['body'],[_0xd81b('0x71'),'id'])||{})[_0xd81b('0xc5')](function(_0x4c684a){for(var _0x45ac59=0x0;_0x45ac59<_0x18c41f['body'][_0xd81b('0x71')]['length'];_0x45ac59+=0x1){socket[_0xd81b('0x13b')](_0xd81b('0x13c'),{'UserId':_0x18c41f[_0xd81b('0x67')]['ids'][_0x45ac59],'ChatWebsiteId':_0x18c41f[_0xd81b('0x5c')]['id']});}return _0x4c684a;});}})[_0xd81b('0x22')](respondWithResult(_0x155a07,null))[_0xd81b('0x2c')](handleError(_0x155a07,null));};exports[_0xd81b('0x13d')]=function(_0xb5bcd5,_0x135537,_0x2f9752){return db['ChatWebsite'][_0xd81b('0x5d')]({'where':{'id':_0xb5bcd5[_0xd81b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x135537,null))['then'](function(_0x52f86b){if(_0x52f86b){return _0x52f86b[_0xd81b('0x13d')](_0xb5bcd5[_0xd81b('0x46')][_0xd81b('0x71')])[_0xd81b('0x22')](function(){if(_[_0xd81b('0x13e')](_0xb5bcd5[_0xd81b('0x46')]['ids'])){for(var _0x1f76aa=0x0;_0x1f76aa<_0xb5bcd5[_0xd81b('0x46')][_0xd81b('0x71')][_0xd81b('0x4d')];_0x1f76aa+=0x1){socket[_0xd81b('0x13b')]('userChatWebsite:remove',{'UserId':Number(_0xb5bcd5[_0xd81b('0x46')]['ids'][_0x1f76aa]),'ChatWebsiteId':Number(_0xb5bcd5[_0xd81b('0x5c')]['id'])});}}else{socket['emit'](_0xd81b('0x13f'),{'UserId':Number(_0xb5bcd5['query'][_0xd81b('0x71')]),'ChatWebsiteId':Number(_0xb5bcd5[_0xd81b('0x5c')]['id'])});}});}})[_0xd81b('0x22')](respondWithStatusCode(_0x135537,null))['catch'](handleError(_0x135537,null));};exports[_0xd81b('0x140')]=function(_0x22bf91,_0x155ad6,_0x5e8fc4){var _0xcbffcf={};var _0x494165={};var _0x550752;var _0x5eb467;return db[_0xd81b('0x57')][_0xd81b('0x6d')]({'where':{'id':_0x22bf91[_0xd81b('0x5c')]['id']}})[_0xd81b('0x22')](handleEntityNotFound(_0x155ad6,null))[_0xd81b('0x22')](function(_0x35ae89){if(_0x35ae89){_0x550752=_0x35ae89;_0x494165['model']=_[_0xd81b('0x47')](db[_0xd81b('0x103')][_0xd81b('0x42')]);_0x494165[_0xd81b('0x46')]=_[_0xd81b('0x47')](_0x22bf91[_0xd81b('0x46')]);_0x494165[_0xd81b('0x48')]=_[_0xd81b('0x49')](_0x494165[_0xd81b('0x4a')],_0x494165[_0xd81b('0x46')]);_0xcbffcf['attributes']=_[_0xd81b('0x49')](_0x494165['model'],qs[_0xd81b('0x4c')](_0x22bf91['query'][_0xd81b('0x4c')]));_0xcbffcf[_0xd81b('0x4b')]=_0xcbffcf[_0xd81b('0x4b')][_0xd81b('0x4d')]?_0xcbffcf[_0xd81b('0x4b')]:_0x494165[_0xd81b('0x4a')];_0xcbffcf[_0xd81b('0x4f')]=qs['sort'](_0x22bf91[_0xd81b('0x46')][_0xd81b('0x50')]);_0xcbffcf[_0xd81b('0x51')]=qs[_0xd81b('0x48')](_['pick'](_0x22bf91[_0xd81b('0x46')],_0x494165[_0xd81b('0x48')]));if(_0x22bf91[_0xd81b('0x46')][_0xd81b('0x53')]){_0xcbffcf['where']=_['merge'](_0xcbffcf[_0xd81b('0x51')],{'$or':_[_0xd81b('0x41')](_0xcbffcf[_0xd81b('0x4b')],function(_0x1360fb){var _0x450634={};_0x450634[_0x1360fb]={'$like':'%'+_0x22bf91[_0xd81b('0x46')][_0xd81b('0x53')]+'%'};return _0x450634;})});}_0xcbffcf=_['merge']({},_0xcbffcf,_0x22bf91[_0xd81b('0x56')]);return _0x550752['getAgents'](_0xcbffcf);}})[_0xd81b('0x22')](function(_0x189e1e){if(_0x189e1e){_0x5eb467=_0x189e1e[_0xd81b('0x4d')];if(!_0x22bf91[_0xd81b('0x46')][_0xd81b('0x6e')](_0xd81b('0x4e'))){_0xcbffcf[_0xd81b('0x32')]=qs[_0xd81b('0x32')](_0x22bf91[_0xd81b('0x46')]['limit']);_0xcbffcf[_0xd81b('0x30')]=qs['offset'](_0x22bf91[_0xd81b('0x46')][_0xd81b('0x30')]);}return _0x550752[_0xd81b('0x140')](_0xcbffcf);}})[_0xd81b('0x22')](function(_0x33d47c){if(_0x33d47c){return _0x33d47c?{'count':_0x5eb467,'rows':_0x33d47c}:null;}})[_0xd81b('0x22')](respondWithResult(_0x155ad6,null))['catch'](handleError(_0x155ad6,null));}; \ No newline at end of file +var _0xf3cd=['rawAttributes','fieldName','model','name','query','keys','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','findAll','rows','show','params','intersection','merge','find','catch','create','body','user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','ChatWebsiteId','Disposition','findOne','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','sitepic','getLicense','isNil','existsSync','server/files/images/logos/','getAvatar','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','notify','setUA','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','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','CmList','CmContact','DESC','ChatApplication','Applications','applications','asc','account','List','Contacts','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','server','attachments','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','originalname','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','custom','License','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.js','x-real-ip','connection','virtual','replace','alignment','verticalAlignment','color','textColor','color_button','backgroundColor','addApplications','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','get','ChatWebsites','sendStatus','stack','index','Pause','mandatoryDispositionPause','map','ChatWebsite'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x92713a,_0x68f8b0){_0x92713a=_0x92713a-0x0;var _0x1893e1=_0xf3cd[_0x92713a];return _0x1893e1;};'use strict';var emlformat=require(_0xdf3c('0x0'));var rimraf=require(_0xdf3c('0x1'));var zipdir=require(_0xdf3c('0x2'));var jsonpatch=require(_0xdf3c('0x3'));var rp=require(_0xdf3c('0x4'));var moment=require(_0xdf3c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf3c('0x6'));var util=require(_0xdf3c('0x7'));var path=require(_0xdf3c('0x8'));var sox=require('sox');var csv=require(_0xdf3c('0x9'));var ejs=require(_0xdf3c('0xa'));var fs=require('fs');var fs_extra=require(_0xdf3c('0xb'));var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var as=require(_0xdf3c('0x13'));var hardwareService=require(_0xdf3c('0x14'));var logger=require(_0xdf3c('0x15'))(_0xdf3c('0x16'));var utils=require(_0xdf3c('0x17'));var config=require(_0xdf3c('0x18'));var licenseUtil=require(_0xdf3c('0x19'));var db=require('../../mysqldb')['db'];config[_0xdf3c('0x1a')]=_[_0xdf3c('0x1b')](config[_0xdf3c('0x1a')],{'host':_0xdf3c('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf3c('0x1a')]));require(_0xdf3c('0x1d'))[_0xdf3c('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdf3c('0x1f')][_0xdf3c('0x20')]({'port':0x232c});var client9002=jayson[_0xdf3c('0x1f')][_0xdf3c('0x20')]({'port':0x232a});var client9003=jayson[_0xdf3c('0x1f')][_0xdf3c('0x20')]({'port':0x232b});var client9001=jayson[_0xdf3c('0x1f')][_0xdf3c('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x2986d0,_0x5d3991,_0x54cdd4,_0x13b0e6){return new BPromise(function(_0x465e7d,_0xf1da1f){var _0x18d4ec=_0x13b0e6||client;return _0x18d4ec[_0xdf3c('0x21')](_0x2986d0,_0x54cdd4)[_0xdf3c('0x22')](function(_0x16b02b){logger[_0xdf3c('0x23')](_0xdf3c('0x24'),_0x5d3991,_0xdf3c('0x25'));logger[_0xdf3c('0x26')](_0xdf3c('0x27'),_0x5d3991,_0xdf3c('0x25'),JSON['stringify'](_0x16b02b));if(_0x16b02b['error']){if(_0x16b02b[_0xdf3c('0x28')]['code']===0x1f4){logger[_0xdf3c('0x28')](_0xdf3c('0x24'),_0x5d3991,_0x16b02b[_0xdf3c('0x28')][_0xdf3c('0x29')]);return _0xf1da1f(_0x16b02b[_0xdf3c('0x28')][_0xdf3c('0x29')]);}logger['error'](_0xdf3c('0x24'),_0x5d3991,_0x16b02b[_0xdf3c('0x28')][_0xdf3c('0x29')]);return _0x465e7d(_0x16b02b[_0xdf3c('0x28')][_0xdf3c('0x29')]);}else{logger[_0xdf3c('0x23')](_0xdf3c('0x24'),_0x5d3991,_0xdf3c('0x25'));_0x465e7d(_0x16b02b[_0xdf3c('0x2a')][_0xdf3c('0x29')]);}})['catch'](function(_0xd284d7){logger[_0xdf3c('0x28')]('ChatWebsite,\x20%s,\x20%s',_0x5d3991,_0xd284d7);_0xf1da1f(_0xd284d7);});});}function respondWithStatusCode(_0xdc8962,_0x59659e){_0x59659e=_0x59659e||0xcc;return function(_0x4eaced){if(_0x4eaced){return _0xdc8962['sendStatus'](_0x59659e);}return _0xdc8962[_0xdf3c('0x2b')](_0x59659e)[_0xdf3c('0x2c')]();};}function respondWithResult(_0x52b8f6,_0x5c3b5a){_0x5c3b5a=_0x5c3b5a||0xc8;return function(_0x37ecfd){if(_0x37ecfd){return _0x52b8f6[_0xdf3c('0x2b')](_0x5c3b5a)[_0xdf3c('0x2d')](_0x37ecfd);}};}function respondWithFilteredResult(_0x1ccdd4,_0x5c98a2){return function(_0x43ce06){if(_0x43ce06){var _0x2a2d94=typeof _0x5c98a2['offset']==='undefined'&&typeof _0x5c98a2[_0xdf3c('0x2e')]===_0xdf3c('0x2f');var _0x36937e=_0x43ce06['count'];var _0x2355f6=_0x2a2d94?0x0:_0x5c98a2[_0xdf3c('0x30')];var _0x21e7b8=_0x2a2d94?_0x43ce06[_0xdf3c('0x31')]:_0x5c98a2['offset']+_0x5c98a2[_0xdf3c('0x2e')];var _0x46b445;if(_0x21e7b8>=_0x36937e){_0x21e7b8=_0x36937e;_0x46b445=0xc8;}else{_0x46b445=0xce;}_0x1ccdd4['status'](_0x46b445);return _0x1ccdd4[_0xdf3c('0x32')](_0xdf3c('0x33'),_0x2355f6+'-'+_0x21e7b8+'/'+_0x36937e)[_0xdf3c('0x2d')](_0x43ce06);}return null;};}function patchUpdates(_0x2287f){return function(_0x5d705d){try{jsonpatch[_0xdf3c('0x34')](_0x5d705d,_0x2287f,!![]);}catch(_0x360d5c){return BPromise[_0xdf3c('0x35')](_0x360d5c);}return _0x5d705d[_0xdf3c('0x36')]();};}function saveUpdates(_0x4c1f49,_0x474564){return function(_0x3e7a4b){if(_0x3e7a4b){return _0x3e7a4b['update'](_0x4c1f49)['then'](function(_0x12cc19){return _0x12cc19;});}return null;};}function removeEntity(_0x588d02,_0x216115){return function(_0x5e8130){if(_0x5e8130){return _0x5e8130['destroy']()['then'](function(){var _0x44a478=_0x5e8130[_0xdf3c('0x37')]({'plain':!![]});var _0x1d0b8a=_0xdf3c('0x38');return db['UserProfileResource']['destroy']({'where':{'type':_0x1d0b8a,'resourceId':_0x44a478['id']}})[_0xdf3c('0x22')](function(){return _0x5e8130;});})['then'](function(){_0x588d02[_0xdf3c('0x2b')](0xcc)[_0xdf3c('0x2c')]();});}};}function handleEntityNotFound(_0x3628ae,_0xcdd731){return function(_0x1004e9){if(!_0x1004e9){_0x3628ae[_0xdf3c('0x39')](0x194);}return _0x1004e9;};}function handleError(_0x1c7335,_0x809f3d){_0x809f3d=_0x809f3d||0x1f4;return function(_0x398c76){logger['error'](_0x398c76[_0xdf3c('0x3a')]);if(_0x398c76['name']){delete _0x398c76['name'];}_0x1c7335[_0xdf3c('0x2b')](_0x809f3d)['send'](_0x398c76);};}exports[_0xdf3c('0x3b')]=function(_0x4f93d5,_0x2a94c3){var _0x27ee91={'include':[{'model':db[_0xdf3c('0x3c')],'as':_0xdf3c('0x3d')}]},_0x1c6dee={},_0x1349a4={'count':0x0,'rows':[]};var _0x736ef5=_[_0xdf3c('0x3e')](db[_0xdf3c('0x3f')][_0xdf3c('0x40')],function(_0x424acf){return{'name':_0x424acf[_0xdf3c('0x41')],'type':_0x424acf['type']['key']};});_0x1c6dee[_0xdf3c('0x42')]=_['map'](_0x736ef5,_0xdf3c('0x43'));_0x1c6dee[_0xdf3c('0x44')]=_[_0xdf3c('0x45')](_0x4f93d5[_0xdf3c('0x44')]);_0x1c6dee['filters']=_['intersection'](_0x1c6dee[_0xdf3c('0x42')],_0x1c6dee[_0xdf3c('0x44')]);_0x27ee91[_0xdf3c('0x46')]=_['intersection'](_0x1c6dee[_0xdf3c('0x42')],qs[_0xdf3c('0x47')](_0x4f93d5[_0xdf3c('0x44')][_0xdf3c('0x47')]));_0x27ee91['attributes']=_0x27ee91[_0xdf3c('0x46')][_0xdf3c('0x48')]?_0x27ee91[_0xdf3c('0x46')]:_0x1c6dee[_0xdf3c('0x42')];if(!_0x4f93d5[_0xdf3c('0x44')]['hasOwnProperty'](_0xdf3c('0x49'))){_0x27ee91[_0xdf3c('0x2e')]=qs[_0xdf3c('0x2e')](_0x4f93d5[_0xdf3c('0x44')][_0xdf3c('0x2e')]);_0x27ee91[_0xdf3c('0x30')]=qs['offset'](_0x4f93d5['query'][_0xdf3c('0x30')]);}_0x27ee91[_0xdf3c('0x4a')]=qs['sort'](_0x4f93d5['query'][_0xdf3c('0x4b')]);_0x27ee91[_0xdf3c('0x4c')]=qs[_0xdf3c('0x4d')](_[_0xdf3c('0x4e')](_0x4f93d5[_0xdf3c('0x44')],_0x1c6dee[_0xdf3c('0x4d')]),_0x736ef5);if(_0x4f93d5[_0xdf3c('0x44')][_0xdf3c('0x4f')]){_0x27ee91[_0xdf3c('0x4c')]=_['merge'](_0x27ee91[_0xdf3c('0x4c')],{'$or':_[_0xdf3c('0x3e')](_0x736ef5,function(_0x1c293d){if(_0x1c293d[_0xdf3c('0x50')]!==_0xdf3c('0x51')){var _0x385824={};_0x385824[_0x1c293d[_0xdf3c('0x43')]]={'$like':'%'+_0x4f93d5['query'][_0xdf3c('0x4f')]+'%'};return _0x385824;}})});}_0x27ee91=_['merge']({},_0x27ee91,_0x4f93d5[_0xdf3c('0x52')]);var _0x47b101={'where':_0x27ee91[_0xdf3c('0x4c')]};return db[_0xdf3c('0x3f')][_0xdf3c('0x31')](_0x47b101)[_0xdf3c('0x22')](function(_0x5eef94){_0x1349a4['count']=_0x5eef94;if(_0x4f93d5['query'][_0xdf3c('0x53')]){_0x27ee91['include']=[{'all':!![]}];}return db[_0xdf3c('0x3f')][_0xdf3c('0x54')](_0x27ee91);})[_0xdf3c('0x22')](function(_0x1901c4){_0x1349a4[_0xdf3c('0x55')]=_0x1901c4;return _0x1349a4;})['then'](respondWithFilteredResult(_0x2a94c3,_0x27ee91))['catch'](handleError(_0x2a94c3,null));};exports[_0xdf3c('0x56')]=function(_0x27a541,_0x591018){var _0x3b215d={'raw':![],'where':{'id':_0x27a541[_0xdf3c('0x57')]['id']},'include':[{'model':db[_0xdf3c('0x3c')],'as':_0xdf3c('0x3d')}]},_0x9864ec={};_0x9864ec[_0xdf3c('0x42')]=_[_0xdf3c('0x45')](db['ChatWebsite']['rawAttributes']);_0x9864ec[_0xdf3c('0x44')]=_[_0xdf3c('0x45')](_0x27a541[_0xdf3c('0x44')]);_0x9864ec[_0xdf3c('0x4d')]=_[_0xdf3c('0x58')](_0x9864ec[_0xdf3c('0x42')],_0x9864ec[_0xdf3c('0x44')]);_0x3b215d[_0xdf3c('0x46')]=_[_0xdf3c('0x58')](_0x9864ec[_0xdf3c('0x42')],qs[_0xdf3c('0x47')](_0x27a541['query'][_0xdf3c('0x47')]));_0x3b215d['attributes']=_0x3b215d['attributes']['length']?_0x3b215d['attributes']:_0x9864ec['model'];if(_0x27a541[_0xdf3c('0x44')][_0xdf3c('0x53')]){_0x3b215d['include']=[{'all':!![]}];}_0x3b215d=_[_0xdf3c('0x59')]({},_0x3b215d,_0x27a541[_0xdf3c('0x52')]);return db['ChatWebsite'][_0xdf3c('0x5a')](_0x3b215d)[_0xdf3c('0x22')](handleEntityNotFound(_0x591018,null))[_0xdf3c('0x22')](respondWithResult(_0x591018,null))[_0xdf3c('0x5b')](handleError(_0x591018,null));};exports[_0xdf3c('0x5c')]=function(_0x28f387,_0xb54629){return db[_0xdf3c('0x3f')][_0xdf3c('0x5c')](_0x28f387[_0xdf3c('0x5d')],{})[_0xdf3c('0x22')](function(_0x503d94){var _0x1ed898=_0x28f387[_0xdf3c('0x5e')][_0xdf3c('0x37')]({'plain':!![]});if(!_0x1ed898)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ed898[_0xdf3c('0x5f')]===_0xdf3c('0x5e')){var _0x235d6c=_0x503d94['get']({'plain':!![]});var _0x1effdb=_0xdf3c('0x38');return db['UserProfileSection'][_0xdf3c('0x5a')]({'where':{'name':_0x1effdb,'userProfileId':_0x1ed898['userProfileId']},'raw':!![]})[_0xdf3c('0x22')](function(_0x1b03e7){if(_0x1b03e7&&_0x1b03e7[_0xdf3c('0x60')]===0x0){return db[_0xdf3c('0x61')][_0xdf3c('0x5c')]({'name':_0x235d6c[_0xdf3c('0x43')],'resourceId':_0x235d6c['id'],'type':_0x1b03e7[_0xdf3c('0x43')],'sectionId':_0x1b03e7['id']},{})[_0xdf3c('0x22')](function(){return _0x503d94;});}else{return _0x503d94;}})[_0xdf3c('0x5b')](function(_0x330730){logger[_0xdf3c('0x28')](_0xdf3c('0x62'),_0x330730);throw _0x330730;});}return _0x503d94;})[_0xdf3c('0x22')](respondWithResult(_0xb54629,0xc9))[_0xdf3c('0x5b')](handleError(_0xb54629,null));};exports[_0xdf3c('0x63')]=function(_0xe42432,_0xd7fb2d){if(_0xe42432['body']['id']){delete _0xe42432['body']['id'];}return db[_0xdf3c('0x3f')][_0xdf3c('0x5a')]({'where':{'id':_0xe42432[_0xdf3c('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xdf3c('0x3d')}]})['then'](handleEntityNotFound(_0xd7fb2d,null))['then'](saveUpdates(_0xe42432[_0xdf3c('0x5d')],null))[_0xdf3c('0x22')](respondWithResult(_0xd7fb2d,null))[_0xdf3c('0x5b')](handleError(_0xd7fb2d,null));};exports[_0xdf3c('0x64')]=function(_0x68f487,_0x9b7034){return db[_0xdf3c('0x3f')][_0xdf3c('0x5a')]({'where':{'id':_0x68f487[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x9b7034,null))[_0xdf3c('0x22')](removeEntity(_0x9b7034,null))[_0xdf3c('0x5b')](handleError(_0x9b7034,null));};exports[_0xdf3c('0x65')]=function(_0x4be79a,_0x3febac){return db[_0xdf3c('0x3f')][_0xdf3c('0x65')]()[_0xdf3c('0x22')](respondWithResult(_0x3febac,null))[_0xdf3c('0x5b')](handleError(_0x3febac,null));};exports['addDisposition']=function(_0x18bf4f,_0x1c3355,_0x163666){if(_0x18bf4f[_0xdf3c('0x5d')]['id']){delete _0x18bf4f[_0xdf3c('0x5d')]['id'];}return db[_0xdf3c('0x3f')][_0xdf3c('0x5a')]({'where':{'id':_0x18bf4f[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x1c3355,null))[_0xdf3c('0x22')](function(_0x55010b){if(_0x55010b){_0x18bf4f[_0xdf3c('0x5d')][_0xdf3c('0x66')]=_0x55010b['id'];return db[_0xdf3c('0x67')][_0xdf3c('0x5c')](_0x18bf4f[_0xdf3c('0x5d')]);}})[_0xdf3c('0x22')](respondWithResult(_0x1c3355,null))[_0xdf3c('0x5b')](handleError(_0x1c3355,null));};exports['getDispositions']=function(_0x2b6069,_0x662fd5,_0x4e1b77){var _0x52a2e1={'raw':![],'where':{}};var _0x12893d={};var _0x3c79c0={'count':0x0,'rows':[]};return db[_0xdf3c('0x3f')][_0xdf3c('0x68')]({'where':{'id':_0x2b6069[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x662fd5,null))[_0xdf3c('0x22')](function(_0x38af90){if(_0x38af90){_0x12893d['model']=_[_0xdf3c('0x45')](db[_0xdf3c('0x67')][_0xdf3c('0x40')]);_0x12893d['query']=_[_0xdf3c('0x45')](_0x2b6069[_0xdf3c('0x44')]);_0x12893d[_0xdf3c('0x4d')]=_['intersection'](_0x12893d[_0xdf3c('0x42')],_0x12893d[_0xdf3c('0x44')]);_0x52a2e1[_0xdf3c('0x46')]=_[_0xdf3c('0x58')](_0x12893d[_0xdf3c('0x42')],qs[_0xdf3c('0x47')](_0x2b6069['query']['fields']));_0x52a2e1['attributes']=_0x52a2e1['attributes']['length']?_0x52a2e1[_0xdf3c('0x46')]:_0x12893d[_0xdf3c('0x42')];if(!_0x2b6069[_0xdf3c('0x44')]['hasOwnProperty'](_0xdf3c('0x49'))){_0x52a2e1[_0xdf3c('0x2e')]=qs[_0xdf3c('0x2e')](_0x2b6069['query']['limit']);_0x52a2e1[_0xdf3c('0x30')]=qs['offset'](_0x2b6069[_0xdf3c('0x44')]['offset']);}_0x52a2e1[_0xdf3c('0x4a')]=qs[_0xdf3c('0x4b')](_0x2b6069[_0xdf3c('0x44')][_0xdf3c('0x4b')]);_0x52a2e1['where']=qs['filters'](_[_0xdf3c('0x4e')](_0x2b6069[_0xdf3c('0x44')],_0x12893d[_0xdf3c('0x4d')]));_0x52a2e1[_0xdf3c('0x4c')][_0xdf3c('0x66')]=_0x38af90['id'];if(_0x2b6069[_0xdf3c('0x44')]['filter']){_0x52a2e1[_0xdf3c('0x4c')]=_['merge'](_0x52a2e1[_0xdf3c('0x4c')],{'$or':_[_0xdf3c('0x3e')](_0x52a2e1[_0xdf3c('0x46')],function(_0x5398ba){var _0xe9a21b={};_0xe9a21b[_0x5398ba]={'$like':'%'+_0x2b6069['query'][_0xdf3c('0x4f')]+'%'};return _0xe9a21b;})});}_0x52a2e1=_[_0xdf3c('0x59')]({},_0x52a2e1,_0x2b6069[_0xdf3c('0x52')]);return db['Disposition']['count']({'where':_0x52a2e1['where']})['then'](function(_0x41861e){_0x3c79c0[_0xdf3c('0x31')]=_0x41861e;if(_0x2b6069[_0xdf3c('0x44')][_0xdf3c('0x53')]){_0x52a2e1[_0xdf3c('0x69')]=[{'all':!![]}];}return db[_0xdf3c('0x67')]['findAll'](_0x52a2e1);})[_0xdf3c('0x22')](function(_0x585871){_0x3c79c0[_0xdf3c('0x55')]=_0x585871;return _0x3c79c0;});}})[_0xdf3c('0x22')](respondWithFilteredResult(_0x662fd5,_0x52a2e1))[_0xdf3c('0x5b')](handleError(_0x662fd5,null));};exports[_0xdf3c('0x6a')]=function(_0x320452,_0x3a221d,_0x2f7002){return db[_0xdf3c('0x3f')][_0xdf3c('0x5a')]({'where':{'id':_0x320452[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x3a221d,null))[_0xdf3c('0x22')](function(_0x161219){if(_0x161219){return _0x161219[_0xdf3c('0x6a')](_0x320452['query'][_0xdf3c('0x6b')]);}})[_0xdf3c('0x22')](respondWithStatusCode(_0x3a221d,null))[_0xdf3c('0x5b')](handleError(_0x3a221d,null));};exports[_0xdf3c('0x6c')]=function(_0x5bbe5c,_0x9c7bdd,_0x1c8fe4){if(_0x5bbe5c['body']['id']){delete _0x5bbe5c['body']['id'];}return db[_0xdf3c('0x3f')][_0xdf3c('0x5a')]({'where':{'id':_0x5bbe5c[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x9c7bdd,null))[_0xdf3c('0x22')](function(_0x56fc77){if(_0x56fc77){_0x5bbe5c[_0xdf3c('0x5d')][_0xdf3c('0x66')]=_0x56fc77['id'];return db[_0xdf3c('0x6d')][_0xdf3c('0x5c')](_0x5bbe5c[_0xdf3c('0x5d')]);}})[_0xdf3c('0x22')](respondWithResult(_0x9c7bdd,null))['catch'](handleError(_0x9c7bdd,null));};exports[_0xdf3c('0x6e')]=function(_0x3581ef,_0x18f13f,_0x1b8d64){var _0x3d0e45={'raw':![],'where':{}};var _0x5dfb3f={};var _0x4bedde={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xdf3c('0x68')]({'where':{'id':_0x3581ef[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x18f13f,null))[_0xdf3c('0x22')](function(_0x115f11){if(_0x115f11){_0x5dfb3f[_0xdf3c('0x42')]=_[_0xdf3c('0x45')](db[_0xdf3c('0x6d')]['rawAttributes']);_0x5dfb3f[_0xdf3c('0x44')]=_[_0xdf3c('0x45')](_0x3581ef[_0xdf3c('0x44')]);_0x5dfb3f[_0xdf3c('0x4d')]=_[_0xdf3c('0x58')](_0x5dfb3f[_0xdf3c('0x42')],_0x5dfb3f['query']);_0x3d0e45[_0xdf3c('0x46')]=_[_0xdf3c('0x58')](_0x5dfb3f['model'],qs['fields'](_0x3581ef[_0xdf3c('0x44')]['fields']));_0x3d0e45[_0xdf3c('0x46')]=_0x3d0e45[_0xdf3c('0x46')]['length']?_0x3d0e45[_0xdf3c('0x46')]:_0x5dfb3f[_0xdf3c('0x42')];if(!_0x3581ef[_0xdf3c('0x44')][_0xdf3c('0x6f')](_0xdf3c('0x49'))){_0x3d0e45[_0xdf3c('0x2e')]=qs['limit'](_0x3581ef[_0xdf3c('0x44')][_0xdf3c('0x2e')]);_0x3d0e45[_0xdf3c('0x30')]=qs[_0xdf3c('0x30')](_0x3581ef[_0xdf3c('0x44')][_0xdf3c('0x30')]);}_0x3d0e45[_0xdf3c('0x4a')]=qs['sort'](_0x3581ef['query'][_0xdf3c('0x4b')]);_0x3d0e45[_0xdf3c('0x4c')]=qs[_0xdf3c('0x4d')](_['pick'](_0x3581ef[_0xdf3c('0x44')],_0x5dfb3f['filters']));_0x3d0e45['where'][_0xdf3c('0x66')]=_0x115f11['id'];if(_0x3581ef[_0xdf3c('0x44')]['filter']){_0x3d0e45[_0xdf3c('0x4c')]=_['merge'](_0x3d0e45[_0xdf3c('0x4c')],{'$or':_['map'](_0x3d0e45[_0xdf3c('0x46')],function(_0x3676a2){var _0x284635={};_0x284635[_0x3676a2]={'$like':'%'+_0x3581ef[_0xdf3c('0x44')][_0xdf3c('0x4f')]+'%'};return _0x284635;})});}_0x3d0e45=_[_0xdf3c('0x59')]({},_0x3d0e45,_0x3581ef[_0xdf3c('0x52')]);return db[_0xdf3c('0x6d')][_0xdf3c('0x31')]({'where':_0x3d0e45[_0xdf3c('0x4c')]})[_0xdf3c('0x22')](function(_0x404761){_0x4bedde[_0xdf3c('0x31')]=_0x404761;if(_0x3581ef[_0xdf3c('0x44')]['includeAll']){_0x3d0e45[_0xdf3c('0x69')]=[{'all':!![]}];}return db[_0xdf3c('0x6d')][_0xdf3c('0x54')](_0x3d0e45);})['then'](function(_0x2cdf93){_0x4bedde[_0xdf3c('0x55')]=_0x2cdf93;return _0x4bedde;});}})[_0xdf3c('0x22')](respondWithFilteredResult(_0x18f13f,_0x3d0e45))[_0xdf3c('0x5b')](handleError(_0x18f13f,null));};exports[_0xdf3c('0x70')]=function(_0x29df40,_0x43f2a1,_0x1f83af){return db[_0xdf3c('0x3f')][_0xdf3c('0x5a')]({'where':{'id':_0x29df40[_0xdf3c('0x57')]['id']}})['then'](handleEntityNotFound(_0x43f2a1,null))[_0xdf3c('0x22')](function(_0x85ec3e){if(_0x85ec3e){return _0x85ec3e[_0xdf3c('0x70')](_0x29df40[_0xdf3c('0x44')][_0xdf3c('0x6b')]);}})[_0xdf3c('0x22')](respondWithStatusCode(_0x43f2a1,null))[_0xdf3c('0x5b')](handleError(_0x43f2a1,null));};exports[_0xdf3c('0x71')]=function(_0x467ffd,_0x260c63,_0x119abc){_0x467ffd[_0xdf3c('0x5d')]['sitepic']=_0x467ffd[_0xdf3c('0x72')][_0xdf3c('0x73')];return db[_0xdf3c('0x3f')][_0xdf3c('0x5a')]({'where':{'id':_0x467ffd[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x260c63,null))[_0xdf3c('0x22')](saveUpdates(_0x467ffd['body'],null))[_0xdf3c('0x22')](respondWithResult(_0x260c63,null))[_0xdf3c('0x5b')](handleError(_0x260c63,null));};exports[_0xdf3c('0x74')]=function(_0x131eb8,_0x4ea2ba,_0x4265cb){_0x131eb8[_0xdf3c('0x5d')]['agentAvatar']=_0x131eb8[_0xdf3c('0x72')]['filename'];return db[_0xdf3c('0x3f')][_0xdf3c('0x5a')]({'where':{'id':_0x131eb8['params']['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x4ea2ba,null))[_0xdf3c('0x22')](saveUpdates(_0x131eb8[_0xdf3c('0x5d')],null))['then'](respondWithResult(_0x4ea2ba,null))['catch'](handleError(_0x4ea2ba,null));};exports[_0xdf3c('0x75')]=function(_0x5ea218,_0x182380,_0x82225d){_0x5ea218[_0xdf3c('0x5d')][_0xdf3c('0x76')]=_0x5ea218['file'][_0xdf3c('0x73')];return db[_0xdf3c('0x3f')]['find']({'where':{'id':_0x5ea218[_0xdf3c('0x57')]['id']}})['then'](handleEntityNotFound(_0x182380,null))[_0xdf3c('0x22')](saveUpdates(_0x5ea218[_0xdf3c('0x5d')],null))['then'](respondWithResult(_0x182380,null))['catch'](handleError(_0x182380,null));};exports[_0xdf3c('0x77')]=function(_0x4e01ca,_0x37ed69,_0x306930){_0x4e01ca[_0xdf3c('0x5d')][_0xdf3c('0x78')]=_0x4e01ca[_0xdf3c('0x72')][_0xdf3c('0x73')];return db[_0xdf3c('0x3f')][_0xdf3c('0x5a')]({'where':{'id':_0x4e01ca[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x37ed69,null))[_0xdf3c('0x22')](saveUpdates(_0x4e01ca['body'],null))[_0xdf3c('0x22')](respondWithResult(_0x37ed69,null))[_0xdf3c('0x5b')](handleError(_0x37ed69,null));};exports['getLogo']=function(_0x164d11,_0x367e4d,_0x21c508){var _0x307179=path[_0xdf3c('0x79')](config[_0xdf3c('0x7a')],'server/files/images/logos/default_logo.svg');var _0x19796f={'where':{'id':_0x164d11['params']['id']},'attributes':['id',_0xdf3c('0x7b')],'raw':!![]};var _0x13683e=![];return require(_0xdf3c('0x19'))[_0xdf3c('0x7c')]()[_0xdf3c('0x22')](function(_0x117949){if(_0x117949){_0x13683e=_0x117949['custom'];}})[_0xdf3c('0x22')](function(){return db[_0xdf3c('0x3f')]['find'](_0x19796f);})[_0xdf3c('0x22')](handleEntityNotFound(_0x367e4d,null))[_0xdf3c('0x22')](function(_0x204b5a){if(_0x204b5a){if(!_[_0xdf3c('0x7d')](_0x204b5a[_0xdf3c('0x7b')])){if(fs[_0xdf3c('0x7e')](path[_0xdf3c('0x79')](config[_0xdf3c('0x7a')],'server/files/images/logos/',_0x204b5a['sitepic']))&&_0x13683e){_0x307179=path[_0xdf3c('0x79')](config[_0xdf3c('0x7a')],_0xdf3c('0x7f'),_0x204b5a[_0xdf3c('0x7b')]);}}return _0x367e4d['download'](_0x307179);}})['catch'](handleError(_0x367e4d,null));};exports[_0xdf3c('0x80')]=function(_0x5c15d3,_0x1a8e1f,_0x5a7c04){var _0x3d8d09=path[_0xdf3c('0x79')](config[_0xdf3c('0x7a')],'server/files/images/avatars/default_avatar.png');var _0x292798={'where':{'id':_0x5c15d3[_0xdf3c('0x57')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0xdf3c('0x5a')](_0x292798)[_0xdf3c('0x22')](handleEntityNotFound(_0x1a8e1f,null))[_0xdf3c('0x22')](function(_0x1a1c13){if(_0x1a1c13){if(!_[_0xdf3c('0x7d')](_0x1a1c13[_0xdf3c('0x81')])){if(fs[_0xdf3c('0x7e')](path['join'](config['root'],_0xdf3c('0x82'),_0x1a1c13[_0xdf3c('0x81')]))){_0x3d8d09=path[_0xdf3c('0x79')](config[_0xdf3c('0x7a')],_0xdf3c('0x82'),_0x1a1c13[_0xdf3c('0x81')]);}}return _0x1a8e1f[_0xdf3c('0x83')](_0x3d8d09);}})[_0xdf3c('0x5b')](handleError(_0x1a8e1f,null));};exports[_0xdf3c('0x84')]=function(_0x354deb,_0x3e4a0e,_0x322cf5){var _0x10f2bf=path[_0xdf3c('0x79')](config[_0xdf3c('0x7a')],_0xdf3c('0x85'));var _0x244bf0={'where':{'id':_0x354deb[_0xdf3c('0x57')]['id']},'attributes':['id',_0xdf3c('0x76'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xdf3c('0x5a')](_0x244bf0)['then'](handleEntityNotFound(_0x3e4a0e,null))['then'](function(_0x20f3f5){if(_0x20f3f5){if(!_['isNil'](_0x20f3f5[_0xdf3c('0x76')])){if(fs[_0xdf3c('0x7e')](path['join'](config['root'],'server/files/images/avatars/',_0x20f3f5[_0xdf3c('0x76')]))&&_0x20f3f5[_0xdf3c('0x86')]){_0x10f2bf=path[_0xdf3c('0x79')](config['root'],_0xdf3c('0x82'),_0x20f3f5['customerAvatar']);}}return _0x3e4a0e[_0xdf3c('0x83')](_0x10f2bf);}})['catch'](handleError(_0x3e4a0e,null));};exports['getSystemAvatar']=function(_0xc2a38c,_0x35c941,_0x3ff959){var _0x1aa490=path[_0xdf3c('0x79')](config[_0xdf3c('0x7a')],'server/files/images/avatars/system_avatar.png');var _0x4f017c={'where':{'id':_0xc2a38c[_0xdf3c('0x57')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xdf3c('0x3f')][_0xdf3c('0x5a')](_0x4f017c)[_0xdf3c('0x22')](handleEntityNotFound(_0x35c941,null))[_0xdf3c('0x22')](function(_0x2d3f44){if(_0x2d3f44){if(!_[_0xdf3c('0x7d')](_0x2d3f44[_0xdf3c('0x78')])){if(fs['existsSync'](path['join'](config[_0xdf3c('0x7a')],_0xdf3c('0x82'),_0x2d3f44[_0xdf3c('0x78')]))){_0x1aa490=path[_0xdf3c('0x79')](config['root'],_0xdf3c('0x82'),_0x2d3f44[_0xdf3c('0x78')]);}}return _0x35c941[_0xdf3c('0x83')](_0x1aa490);}})[_0xdf3c('0x5b')](handleError(_0x35c941,null));};exports[_0xdf3c('0x87')]=function(_0x4363f6,_0x524482,_0x38ed5d){var _0x4545ce=require('user-agent-parser');var _0x242327=new _0x4545ce();var _0x32e7f7=_0x242327[_0xdf3c('0x88')](_0x4363f6['headers'][_0xdf3c('0x89')])[_0xdf3c('0x8a')]();var _0x3487cf={'body':_0x4363f6[_0xdf3c('0x5d')],'channel':_0xdf3c('0x8b')};var _0x147769=[];var _0x3c91ba=[];var _0x12ffd3={};var _0x1bfa83=![];return db['CmContact'][_0xdf3c('0x65')]()['then'](function(_0x24dd51){if(!_0x24dd51){throw new db[(_0xdf3c('0x8c'))][(_0xdf3c('0x8d'))](_0xdf3c('0x8e'));}_0x147769=_[_0xdf3c('0x8f')](_[_0xdf3c('0x45')](_0x24dd51),[_0xdf3c('0x90'),_0xdf3c('0x91')]);_0x3c91ba=_[_0xdf3c('0x8f')](_[_0xdf3c('0x45')](_0x24dd51),[_0xdf3c('0x90'),'updatedAt',_0xdf3c('0x92'),_0xdf3c('0x93')]);if(_0x4363f6['body']['id']){delete _0x4363f6[_0xdf3c('0x5d')]['id'];}if(_[_0xdf3c('0x7d')](_0x4363f6[_0xdf3c('0x5d')][_0xdf3c('0x94')])){throw new db['Sequelize'][(_0xdf3c('0x8d'))](_0xdf3c('0x95'));}if(_[_0xdf3c('0x7d')](_0x4363f6['body']['body'])||_0x4363f6['body'][_0xdf3c('0x5d')]===''){throw new db[(_0xdf3c('0x8c'))][(_0xdf3c('0x8d'))](_0xdf3c('0x96'));}if(_[_0xdf3c('0x7d')](_0x4363f6[_0xdf3c('0x5d')][_0xdf3c('0x97')])){throw new db[(_0xdf3c('0x8c'))]['ValidationError'](_0xdf3c('0x98')+_0x3c91ba);}if(!_['includes'](_0x3c91ba,_0x4363f6[_0xdf3c('0x5d')][_0xdf3c('0x97')])){throw new db[(_0xdf3c('0x8c'))][(_0xdf3c('0x8d'))](_0xdf3c('0x99')+_0x3c91ba);}_0x12ffd3[_0x4363f6[_0xdf3c('0x5d')]['mapKey']]=_0x4363f6[_0xdf3c('0x5d')][_0xdf3c('0x94')];})['then'](function(){return db[_0xdf3c('0x3f')][_0xdf3c('0x5a')]({'where':{'id':_0x4363f6[_0xdf3c('0x57')]['id']},'include':[{'model':db[_0xdf3c('0x9a')],'as':'List','include':[{'model':db[_0xdf3c('0x9b')],'as':'Contacts','where':_0x12ffd3,'limit':0x1,'order':[[_0xdf3c('0x91'),_0xdf3c('0x9c')]]}]},{'model':db[_0xdf3c('0x9d')],'as':_0xdf3c('0x9e')}]});})[_0xdf3c('0x22')](handleEntityNotFound(_0x524482,null))[_0xdf3c('0x22')](function(_0x5be97e){if(_0x5be97e&&_0x5be97e['List']){_0x3487cf['account']=_0x5be97e;_0x3487cf[_0xdf3c('0x9f')]=_0x5be97e[_0xdf3c('0x9e')];_0x3487cf['list']=_0x5be97e['List'];_0x3487cf[_0xdf3c('0x9f')]=_['orderBy'](_0x3487cf['applications'],['priority'],[_0xdf3c('0xa0')]);if(_0x3487cf[_0xdf3c('0xa1')][_0xdf3c('0x9e')]){delete _0x3487cf['account'][_0xdf3c('0x9e')];}if(_0x3487cf['account'][_0xdf3c('0xa2')]&&_0x3487cf[_0xdf3c('0xa1')][_0xdf3c('0xa2')][_0xdf3c('0xa3')][_0xdf3c('0x48')]){return _0x3487cf[_0xdf3c('0xa1')][_0xdf3c('0xa2')][_0xdf3c('0xa3')][0x0];}var _0x2c4ba2=_['defaults'](_0x4363f6[_0xdf3c('0x5d')],{'firstName':_0x4363f6[_0xdf3c('0x5d')]['from'],'ListId':_0x5be97e[_0xdf3c('0x93')]});_0x2c4ba2[_0x4363f6[_0xdf3c('0x5d')]['mapKey']]=_0x4363f6[_0xdf3c('0x5d')]['from'];return db[_0xdf3c('0x9b')][_0xdf3c('0x5c')](_0x2c4ba2,{'fields':_0x147769,'raw':!![]});}})[_0xdf3c('0x22')](handleEntityNotFound(_0x524482,null))[_0xdf3c('0x22')](function(_0x2d1ae3){_0x3487cf[_0xdf3c('0xa4')]=_0x2d1ae3;var _0x232b34=_0x4363f6[_0xdf3c('0x5d')][_0xdf3c('0xa5')];if(_0x4363f6[_0xdf3c('0xa6')][_0xdf3c('0xa7')]){_0x232b34=_0x4363f6[_0xdf3c('0xa6')][_0xdf3c('0xa7')];}else if(_0x4363f6[_0xdf3c('0xa6')][_0xdf3c('0xa8')]){_0x232b34=_[_0xdf3c('0xa9')](_0x4363f6['headers'][_0xdf3c('0xa8')][_0xdf3c('0xaa')](','));}if(_0x2d1ae3){var _0x4a8e6e={'ContactId':_0x2d1ae3['id'],'ChatWebsiteId':_0x4363f6[_0xdf3c('0x57')]['id'],'from':(_0x2d1ae3[_0xdf3c('0xab')]||'')+'\x20'+(_0x2d1ae3[_0xdf3c('0xac')]||''),'customerIp':_0x232b34,'customerPort':_0x4363f6[_0xdf3c('0xa6')]['x-real-port']?_0x4363f6[_0xdf3c('0xa6')][_0xdf3c('0xad')]:null,'referer':_0x4363f6['body'][_0xdf3c('0xae')],'browserName':_0x32e7f7[_0xdf3c('0xaf')]['name']&&_0x32e7f7['browser'][_0xdf3c('0xb0')]?util[_0xdf3c('0xb1')](_0xdf3c('0xb2'),_0x32e7f7['browser'][_0xdf3c('0x43')],_0x32e7f7['browser'][_0xdf3c('0xb0')]):_0xdf3c('0xb3'),'browserVersion':_0x32e7f7[_0xdf3c('0xaf')][_0xdf3c('0xb0')]||_0xdf3c('0xb3'),'osName':util[_0xdf3c('0xb1')]('%s\x20%s',_0x32e7f7['os'][_0xdf3c('0x43')],_0x32e7f7['os']['version']),'osVersion':_0x32e7f7['os'][_0xdf3c('0xb0')],'deviceModel':_0x32e7f7[_0xdf3c('0xb4')][_0xdf3c('0x42')]&&_0x32e7f7['device'][_0xdf3c('0xb5')]?util['format'](_0xdf3c('0xb6'),_0x32e7f7[_0xdf3c('0xb4')]['model'],_0x32e7f7[_0xdf3c('0xb4')][_0xdf3c('0xb5')],_0x32e7f7[_0xdf3c('0xb4')][_0xdf3c('0x50')]):null,'deviceVendor':_0x32e7f7['device'][_0xdf3c('0xb5')],'deviceType':_0x32e7f7[_0xdf3c('0xb4')][_0xdf3c('0x50')],'formData':JSON[_0xdf3c('0xb7')](_0x4363f6[_0xdf3c('0x5d')])};var _0x2be582={'ChatWebsiteId':_0x4363f6[_0xdf3c('0x57')]['id'],'closed':![]};if(_0x4363f6['body'][_0xdf3c('0xb8')]){_0x2be582[_0xdf3c('0xb8')]=_0x4363f6[_0xdf3c('0x5d')][_0xdf3c('0xb8')];return db[_0xdf3c('0xb9')][_0xdf3c('0x5a')]({'where':_0x2be582})[_0xdf3c('0x22')](function(_0x6e0498){if(_0x6e0498){return[_0x6e0498,![]];}_0x4a8e6e[_0xdf3c('0xb8')]=_0x4363f6[_0xdf3c('0x5d')][_0xdf3c('0xb8')];_0x4a8e6e['externalUrl']=_0x4363f6[_0xdf3c('0x5d')][_0xdf3c('0xba')];return db[_0xdf3c('0xb9')]['create'](_0x4a8e6e)[_0xdf3c('0x22')](function(_0x109153){return[_0x109153,!![]];});});}_0x2be582[_0xdf3c('0xbb')]=_0x2d1ae3['id'];if(_0x4363f6[_0xdf3c('0x5d')][_0xdf3c('0xbc')]&&_0x4363f6['body'][_0xdf3c('0xbc')]['id']){_0x2be582['id']=_0x4363f6[_0xdf3c('0x5d')]['interaction']['id'];return db[_0xdf3c('0xb9')][_0xdf3c('0x5a')]({'where':_0x2be582})[_0xdf3c('0x22')](function(_0xb39cc){if(_0xb39cc){return[_0xb39cc,![]];}return db[_0xdf3c('0xb9')][_0xdf3c('0x5c')](_0x4a8e6e)[_0xdf3c('0x22')](function(_0x3d9041){return[_0x3d9041,!![]];});});}return db[_0xdf3c('0xb9')]['create'](_0x4a8e6e)[_0xdf3c('0x22')](function(_0x1e1134){return[_0x1e1134,!![]];});}})['spread'](function(_0x39bc51,_0x3e599a){if(_0x39bc51){_0x1bfa83=_0x3e599a;if(!_0x3e599a){var _0x52679b={'from':(_0x3487cf['contact'][_0xdf3c('0xab')]||'')+'\x20'+(_0x3487cf[_0xdf3c('0xa4')][_0xdf3c('0xac')]||'')};if(_0x4363f6[_0xdf3c('0x5d')][_0xdf3c('0xb8')]&&_0x4363f6[_0xdf3c('0x5d')][_0xdf3c('0xbd')]&&_0x4363f6[_0xdf3c('0x5d')]['threadId']!=_0x4363f6[_0xdf3c('0x5d')][_0xdf3c('0xbd')]){_0x52679b[_0xdf3c('0xb8')]=_0x4363f6[_0xdf3c('0x5d')]['messageId'];}return _0x39bc51[_0xdf3c('0x63')](_0x52679b);}else{return _0x39bc51;}}})[_0xdf3c('0x22')](function(_0x137d99){_0x3487cf[_0xdf3c('0xbc')]=_0x137d99['get']({'plain':!![]});_0x3487cf[_0xdf3c('0xbc')][_0xdf3c('0xbe')]=_0x1bfa83;if(_0x3487cf[_0xdf3c('0xbc')]['created']){if(_0x3487cf['account'][_0xdf3c('0xbf')]){_0x3487cf[_0xdf3c('0x9f')][_0xdf3c('0xc0')]({'id':0x0,'priority':_0x3487cf['applications'][_0xdf3c('0x48')]+0x1,'app':_0xdf3c('0xc1'),'appdata':_0xdf3c('0xc2'),'interval':_0xdf3c('0xc3')});}}return db[_0xdf3c('0xc4')]['create']({'body':_0x4363f6['body'][_0xdf3c('0x5d')],'ChatWebsiteId':_0x4363f6['params']['id'],'ChatInteractionId':_0x137d99['id'],'direction':'in','ContactId':_0x3487cf[_0xdf3c('0xa4')]['id'],'AttachmentId':_0x4363f6[_0xdf3c('0x5d')][_0xdf3c('0xc5')]});})[_0xdf3c('0x22')](function(_0x3b55c2){_0x3487cf[_0xdf3c('0x29')]=_0x3b55c2;if(_0x3487cf['interaction'][_0xdf3c('0xc6')]){return db[_0xdf3c('0xc7')][_0xdf3c('0x5a')]({'attributes':['id',_0xdf3c('0x43')],'where':{'id':_0x3487cf['interaction'][_0xdf3c('0xc6')]}})[_0xdf3c('0x22')](function(_0x234c08){if(_0x234c08){_0x3487cf['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xdf3c('0xc8'),'appdata':_0x234c08[_0xdf3c('0x43')]+','+(_0x3487cf['account'][_0xdf3c('0xc9')]||0xa),'interval':'*,*,*,*'});_0x3487cf[_0xdf3c('0xca')]=!![];}return respondWithRpcPromise(_0xdf3c('0xcb'),_0xdf3c('0xcc'),_0x3487cf);});}return respondWithRpcPromise(_0xdf3c('0xcb'),_0xdf3c('0xcc'),_0x3487cf);})[_0xdf3c('0x22')](function(_0x5e5dad){respondWithRpcPromise(_0xdf3c('0xcd'),_0xdf3c('0xcd'),{'event':_0xdf3c('0x87'),'message':_0x5e5dad},client9002);return _0x5e5dad;})[_0xdf3c('0x22')](respondWithResult(_0x524482,null))[_0xdf3c('0x5b')](handleError(_0x524482,null));};exports[_0xdf3c('0xce')]=function(_0x34332b,_0x1dee13,_0x43ce1f){var _0x127bfb,_0x340107,_0x4ac0c8;var _0x29b303=[];var _0x17fb63=[];var _0x5a14cd={};var _0x17b6fe=_0x34332b[_0xdf3c('0xcf')]||[];var _0x2accb4=[];var _0x31ec26;return db[_0xdf3c('0x9b')]['describe']()[_0xdf3c('0x22')](function(_0xa89529){if(!_0xa89529){throw new db[(_0xdf3c('0x8c'))][(_0xdf3c('0x8d'))](_0xdf3c('0x8e'));}_0x17fb63=_[_0xdf3c('0x8f')](_[_0xdf3c('0x45')](_0xa89529),[_0xdf3c('0x90'),_0xdf3c('0x91')]);_0x29b303=_[_0xdf3c('0x8f')](_[_0xdf3c('0x45')](_0xa89529),[_0xdf3c('0x90'),_0xdf3c('0x91'),'CompanyId',_0xdf3c('0x93')]);if(_0x34332b[_0xdf3c('0x5d')]['id']){delete _0x34332b['body']['id'];}if(_[_0xdf3c('0x7d')](_0x34332b[_0xdf3c('0x5d')][_0xdf3c('0x94')])){throw _0x1dee13[_0xdf3c('0x2b')](0x1f4)[_0xdf3c('0xd0')](new db[(_0xdf3c('0x8c'))][(_0xdf3c('0x8d'))](_0xdf3c('0x95')));}if(_[_0xdf3c('0x7d')](_0x34332b[_0xdf3c('0x5d')]['body'])||_0x34332b[_0xdf3c('0x5d')][_0xdf3c('0x5d')]===''){throw _0x1dee13['status'](0x1f4)[_0xdf3c('0xd0')](new db['Sequelize'][(_0xdf3c('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xdf3c('0x7d')](_0x34332b['body'][_0xdf3c('0xd1')])){throw _0x1dee13[_0xdf3c('0x2b')](0x1f4)[_0xdf3c('0xd0')](new db[(_0xdf3c('0x8c'))][(_0xdf3c('0x8d'))](_0xdf3c('0xd2')+_0x29b303));}if(!_[_0xdf3c('0xd3')](_0x29b303,_0x34332b[_0xdf3c('0x5d')]['mapKeyOffline'])){throw _0x1dee13[_0xdf3c('0x2b')](0x1f4)[_0xdf3c('0xd0')](new db[(_0xdf3c('0x8c'))]['ValidationError'](_0xdf3c('0xd4')+_0x29b303));}_0x5a14cd[_0x34332b[_0xdf3c('0x5d')][_0xdf3c('0xd1')]]=_0x34332b[_0xdf3c('0x5d')]['from'];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x34332b[_0xdf3c('0x57')]['id']},'include':[{'model':db[_0xdf3c('0x9a')],'as':_0xdf3c('0xa2')},{'model':db[_0xdf3c('0xd5')],'as':_0xdf3c('0xd5')}]});})[_0xdf3c('0x22')](handleEntityNotFound(_0x1dee13,null))[_0xdf3c('0x22')](function(_0x56e307){if(_0x56e307&&_0x56e307[_0xdf3c('0xa2')]){_0x340107=_0x56e307;var _0x53d331=_[_0xdf3c('0x1b')](_0x34332b[_0xdf3c('0x5d')],{'firstName':_0x34332b[_0xdf3c('0x5d')][_0xdf3c('0x94')],'phone':_0x34332b[_0xdf3c('0x5d')][_0xdf3c('0x94')],'ListId':_0x56e307[_0xdf3c('0x93')]});_0x53d331[_0x34332b[_0xdf3c('0x5d')]['mapKeyOffline']]=_0x34332b[_0xdf3c('0x5d')][_0xdf3c('0x94')];return db[_0xdf3c('0x9b')][_0xdf3c('0xd6')]({'where':_0x5a14cd,'defaults':_0x53d331});}})[_0xdf3c('0xd7')](function(_0x5489e7){if(_0x5489e7){_0x4ac0c8=_0x5489e7;var _0x59f580=fs[_0xdf3c('0xd8')](path[_0xdf3c('0x79')](config[_0xdf3c('0x7a')],_0xdf3c('0xd9')),_0xdf3c('0xda'));var _0x10b160=ejs[_0xdf3c('0xdb')](_0x59f580,{'body':_[_0xdf3c('0xdc')](_0x34332b[_0xdf3c('0x5d')][_0xdf3c('0x5d')]),'bodyTitle':_0x340107[_0xdf3c('0xdd')]});return db['ChatOfflineMessage'][_0xdf3c('0x5c')]({'body':_0x10b160,'ContactId':_0x5489e7['id'],'ChatWebsiteId':_0x340107['id']});}})[_0xdf3c('0x22')](function(_0xc27d02){_0x31ec26=_0xc27d02;if(_0x17b6fe[_0xdf3c('0x48')]){var _0x2f451b=_0x17b6fe[_0xdf3c('0x3e')](function(_0x184a55){return{'name':_0x184a55['originalname'],'basename':_0x184a55[_0xdf3c('0x73')],'type':_0x184a55['mimetype'],'ChatOfflineMessageId':_0xc27d02['id']};});_0x2accb4=_0x2f451b[_0xdf3c('0x3e')](_0x4c208c=>{var _0x14b7fc={'filename':_0x4c208c[_0xdf3c('0x43')],'path':path['join'](config['root'],_0xdf3c('0xde'),_0xdf3c('0xcf'),_0xdf3c('0xdf'),_0xdf3c('0xe0'),_0x4c208c[_0xdf3c('0xe1')])};return _0x14b7fc;});if(!_0x340107['openNewInteraction']){return db[_0xdf3c('0xe2')][_0xdf3c('0xe3')](function(_0x3d1e8b){return db[_0xdf3c('0xe4')][_0xdf3c('0xe5')](_0x2f451b,{'transaction':_0x3d1e8b});});}}})['then'](function(){if(_0x31ec26){_0x127bfb=_0x31ec26;return db[_0xdf3c('0xd5')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xdf3c('0xe6')],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x42d720){if(_0x42d720&&_0x42d720[_0xdf3c('0xe7')]&&_0x340107[_0xdf3c('0xe8')]&&_0x340107[_0xdf3c('0xe9')]){var _0x14ac0a={'tls':{'rejectUnauthorized':![]}};if(_0x42d720['Smtp'][_0xdf3c('0xea')]){_0x14ac0a[_0xdf3c('0xea')]=_0x42d720['Smtp'][_0xdf3c('0xea')];}else{_0x14ac0a[_0xdf3c('0xeb')]=_0x42d720[_0xdf3c('0xe7')][_0xdf3c('0xeb')];_0x14ac0a[_0xdf3c('0xec')]=_0x42d720['Smtp'][_0xdf3c('0xec')];_0x14ac0a[_0xdf3c('0xed')]=_0x42d720[_0xdf3c('0xe7')][_0xdf3c('0xed')];}if(_0x42d720[_0xdf3c('0xe7')]['authentication']){_0x14ac0a[_0xdf3c('0xee')]={'user':_0x42d720[_0xdf3c('0xe7')][_0xdf3c('0x5e')],'pass':_0x42d720[_0xdf3c('0xe7')][_0xdf3c('0xef')]};}return respondWithRpcPromise(_0xdf3c('0xf0'),_0xdf3c('0xf1'),{'account':_0x14ac0a,'message':{'from':util[_0xdf3c('0xb1')](_0xdf3c('0xf2'),_0x42d720[_0xdf3c('0x43')],_0x42d720[_0xdf3c('0xf3')]||_0x42d720[_0xdf3c('0xe7')][_0xdf3c('0x5e')]),'to':_0x340107[_0xdf3c('0xe9')],'subject':_0x340107[_0xdf3c('0xf4')],'html':_0x127bfb[_0xdf3c('0x5d')],'attachments':_0x2accb4}},client9003)[_0xdf3c('0x22')](function(){return _0x127bfb;})[_0xdf3c('0x5b')](function(_0x5e4089){console[_0xdf3c('0x28')](_0x5e4089);});}})[_0xdf3c('0x22')](function(){if(_0x340107&&_0x340107[_0xdf3c('0xf5')]&&_0x340107['MailAccountId']){var _0xb9f71c=[];if(_0x17b6fe['length']){_0xb9f71c=_0x17b6fe[_0xdf3c('0x3e')](function(_0x4ac3d7){return{'name':_0x4ac3d7[_0xdf3c('0xf6')],'basename':_0x4ac3d7[_0xdf3c('0x73')],'type':_0x4ac3d7[_0xdf3c('0xf7')],'ChatOfflineMessageId':_0x31ec26['id']};});}var _0xd9aaa5;if(!_[_0xdf3c('0x7d')](_0x340107[_0xdf3c('0xf8')])){var _0xd8be1=_[_0xdf3c('0x3e')](_0x34332b[_0xdf3c('0x5d')],function(_0x4e3a41){return _0x4e3a41;});var _0x3ef6db=_[_0xdf3c('0xf9')](_0xd8be1)[0x0];var _0x341b5e=_[_0xdf3c('0xfa')](_0x3ef6db,function(_0x4e9752){return _0x4e9752;});_0xd9aaa5=_0x341b5e[0x1][_0x340107['subjectOffline']];}var _0x7f1dee={'from':_0x4ac0c8[_0xdf3c('0xf3')],'firstName':_0x4ac0c8[_0xdf3c('0xab')],'lastName':_0x4ac0c8[_0xdf3c('0xac')],'mapKey':'email','message':{'from':_0x4ac0c8[_0xdf3c('0xf3')],'to':_0x340107['MailAccount']['email'],'cc':'','subject':_[_0xdf3c('0x7d')](_0xd9aaa5)?_0x340107[_0xdf3c('0xf4')]:_0xd9aaa5,'messageId':'','sentAt':new Date(),'attach':_0xb9f71c['length'],'attachments':_0xb9f71c,'originChannel':_0xdf3c('0xfb'),'ChatWebsiteId':_0x340107['id'],'ChatOfflineMessageId':_0x127bfb['id'],'originTo':_0x340107[_0xdf3c('0xd5')]['email']},'body':_0x127bfb[_0xdf3c('0x5d')]};var _0x5f3dfa={'account':{'id':_0x340107['MailAccountId']},'body':_0x7f1dee,'log':_0xdf3c('0xfc')};return respondWithRpcPromise(_0xdf3c('0xfc'),_0xdf3c('0xfd'),_0x5f3dfa,client9001)[_0xdf3c('0x22')](function(){return _0x127bfb;})[_0xdf3c('0x5b')](function(_0x2923a7){console['error'](_0x2923a7);});}return;})['then'](function(){if(_0x127bfb){return _0x127bfb;}})[_0xdf3c('0x22')](respondWithResult(_0x1dee13,null))[_0xdf3c('0x5b')](function(_0x1e95b4){console[_0xdf3c('0x28')](_0xdf3c('0x5b'),_0x1e95b4);for(var _0x43feef of _0x17b6fe){var _0x5173b5=path[_0xdf3c('0x79')](config[_0xdf3c('0x7a')],_0xdf3c('0xde'),_0xdf3c('0xcf'),'attachments',_0xdf3c('0xe0'),_0x43feef[_0xdf3c('0x73')]);fs_extra['remove'](_0x5173b5)[_0xdf3c('0x5b')](function(_0x34ef43){console[_0xdf3c('0x28')](_0xdf3c('0xfe'),_0x5173b5,_0x34ef43);});}});};exports['addInteraction']=function(_0x486ddb,_0xcb362a,_0x43cff2){return db[_0xdf3c('0xb9')]['find']({'where':{'id':_0x486ddb['params']['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0xcb362a,null))[_0xdf3c('0x22')](function(_0x8709b5){if(_0x8709b5){return _0x8709b5[_0xdf3c('0xff')](_0x486ddb[_0xdf3c('0x5d')][_0xdf3c('0x6b')],_[_0xdf3c('0x100')](_0x486ddb[_0xdf3c('0x5d')],['ids','id'])||{});}})[_0xdf3c('0x22')](respondWithResult(_0xcb362a,null))[_0xdf3c('0x5b')](handleError(_0xcb362a,null));};exports['getInteractions']=function(_0x1eece0,_0x197b3e,_0x5bddc6){var _0x3d497d={'raw':![],'where':{}};var _0x52585f={};var _0x3c572d={'count':0x0,'rows':[]};return db[_0xdf3c('0x3f')][_0xdf3c('0x68')]({'where':{'id':_0x1eece0[_0xdf3c('0x57')]['id']}})['then'](handleEntityNotFound(_0x197b3e,null))['then'](function(_0x515d88){if(_0x515d88){_0x52585f[_0xdf3c('0x42')]=_[_0xdf3c('0x45')](db[_0xdf3c('0xb9')][_0xdf3c('0x40')]);_0x52585f[_0xdf3c('0x44')]=_[_0xdf3c('0x45')](_0x1eece0[_0xdf3c('0x44')]);_0x52585f['filters']=_[_0xdf3c('0x58')](_0x52585f[_0xdf3c('0x42')],_0x52585f['query']);_0x3d497d[_0xdf3c('0x46')]=_['intersection'](_0x52585f[_0xdf3c('0x42')],qs[_0xdf3c('0x47')](_0x1eece0[_0xdf3c('0x44')]['fields']));_0x3d497d[_0xdf3c('0x46')]=_0x3d497d[_0xdf3c('0x46')][_0xdf3c('0x48')]?_0x3d497d[_0xdf3c('0x46')]:_0x52585f[_0xdf3c('0x42')];if(!_0x1eece0['query'][_0xdf3c('0x6f')](_0xdf3c('0x49'))){_0x3d497d[_0xdf3c('0x2e')]=qs[_0xdf3c('0x2e')](_0x1eece0[_0xdf3c('0x44')][_0xdf3c('0x2e')]);_0x3d497d[_0xdf3c('0x30')]=qs['offset'](_0x1eece0[_0xdf3c('0x44')][_0xdf3c('0x30')]);}_0x3d497d[_0xdf3c('0x4a')]=qs['sort'](_0x1eece0[_0xdf3c('0x44')]['sort']);_0x3d497d[_0xdf3c('0x4c')]=qs[_0xdf3c('0x4d')](_['pick'](_0x1eece0[_0xdf3c('0x44')],_0x52585f[_0xdf3c('0x4d')]));_0x3d497d[_0xdf3c('0x4c')][_0xdf3c('0x66')]=_0x515d88['id'];if(_0x1eece0[_0xdf3c('0x44')][_0xdf3c('0x4f')]){_0x3d497d[_0xdf3c('0x4c')]=_[_0xdf3c('0x59')](_0x3d497d[_0xdf3c('0x4c')],{'$or':_[_0xdf3c('0x3e')](_0x3d497d[_0xdf3c('0x46')],function(_0x265d99){var _0x59d1db={};_0x59d1db[_0x265d99]={'$like':'%'+_0x1eece0[_0xdf3c('0x44')]['filter']+'%'};return _0x59d1db;})});}_0x3d497d=_['merge']({},_0x3d497d,_0x1eece0['options']);return db['ChatInteraction'][_0xdf3c('0x31')]({'where':_0x3d497d[_0xdf3c('0x4c')]})[_0xdf3c('0x22')](function(_0x1eb736){_0x3c572d[_0xdf3c('0x31')]=_0x1eb736;if(_0x1eece0[_0xdf3c('0x44')]['includeAll']){_0x3d497d[_0xdf3c('0x69')]=[{'model':db['CmContact'],'as':_0xdf3c('0x101'),'required':![]},{'model':db[_0xdf3c('0xc7')],'as':_0xdf3c('0x102'),'attributes':[_0xdf3c('0x43'),_0xdf3c('0x103'),_0xdf3c('0x104')],'required':![]},{'model':db[_0xdf3c('0x105')],'as':_0xdf3c('0x106'),'attributes':['id',_0xdf3c('0x43'),'color'],'where':_0x1eece0[_0xdf3c('0x44')][_0xdf3c('0x107')]?{'id':_0x1eece0[_0xdf3c('0x44')][_0xdf3c('0x107')]}:undefined,'required':_0x1eece0['query']['tag']?!![]:![]}];}return db[_0xdf3c('0xb9')][_0xdf3c('0x54')](_0x3d497d);})[_0xdf3c('0x22')](function(_0x5f557c){_0x3c572d['rows']=_0x5f557c;return _0x3c572d;});}})[_0xdf3c('0x22')](respondWithFilteredResult(_0x197b3e,_0x3d497d))[_0xdf3c('0x5b')](handleError(_0x197b3e,null));};function iftimePromise(_0x1cc94d,_0x3a2347){return respondWithRpcPromise(_0xdf3c('0x108'),_0xdf3c('0x109'),{'command':_0x3a2347[_0xdf3c('0x10a')]?util['format'](_0xdf3c('0x10b'),_0x1cc94d[_0xdf3c('0x10c')],_0x3a2347[_0xdf3c('0x10a')]):util[_0xdf3c('0xb1')](_0xdf3c('0x10d'),_0x1cc94d[_0xdf3c('0x10c')])},client9002)['then'](function(_0x4cfc67){var _0xf24286=_0x4cfc67&&_0x4cfc67[_0xdf3c('0x10e')](_0xdf3c('0x10f'))>=0x0?!![]:![];logger[_0xdf3c('0x23')](_0xdf3c('0x110'),_0x3a2347['id'],_0x1cc94d['id'],_0x1cc94d['interval'],_0xf24286?_0xdf3c('0x111'):_0xdf3c('0x112'),_0x3a2347[_0xdf3c('0x10a')]?_0x3a2347[_0xdf3c('0x10a')]:_0xdf3c('0x113'));return _0xf24286;})[_0xdf3c('0x5b')](function(_0x55bd8f){logger[_0xdf3c('0x28')](_0xdf3c('0x110'),_0x3a2347['id'],_0x1cc94d['id'],_0x1cc94d['interval'],util[_0xdf3c('0x114')](_0x55bd8f,{'showHidden':![],'depth':null}),_0x3a2347['timezone']?_0x3a2347[_0xdf3c('0x10a')]:_0xdf3c('0x113'));return![];});}exports[_0xdf3c('0x109')]=function(_0x16b173,_0x578e41,_0x4815ee){var _0xa523c8=0x0;var _0x52ae27=0x0;var _0xe4ea87=![];var _0x176f4d;var _0x29d64d;return db['ChatWebsite'][_0xdf3c('0x5a')]({'where':{'id':_0x16b173[_0xdf3c('0x57')]['id']},'include':[{'model':db[_0xdf3c('0x115')],'as':_0xdf3c('0x115'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xdf3c('0x10c')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x578e41,null))[_0xdf3c('0x22')](function(_0x2d6308){if(_0x2d6308){_0x176f4d=_0x2d6308;return _0x2d6308[_0xdf3c('0x116')]({'raw':!![]});}})[_0xdf3c('0x22')](function(_0x3f5455){if(_0x176f4d){if(_0x3f5455){_0x29d64d=_0x3f5455;}}return require('../../config/license/util')[_0xdf3c('0x7c')]();})[_0xdf3c('0x22')](function(_0x21aade){if(_0x21aade){_0x52ae27=_0x21aade['virtual'];_0xe4ea87=_0x21aade[_0xdf3c('0x117')];}})[_0xdf3c('0x22')](function(){return db[_0xdf3c('0xb9')][_0xdf3c('0x31')]({'where':{'closed':![]}});})[_0xdf3c('0x22')](function(_0xc2306c){_0xa523c8=_0xc2306c;if(_0x52ae27&&_0xc2306c>_0x52ae27){return db[_0xdf3c('0x118')]['findOne']({'where':{'id':0x1}})['then'](function(_0x112caa){if(_0x112caa){_0x112caa['increment'](_0xdf3c('0x119'));}});}})[_0xdf3c('0x22')](function(){if(_0x176f4d[_0xdf3c('0x115')]&&_0x176f4d[_0xdf3c('0x115')]['Intervals']){var _0x1bf0ec=[];for(var _0x4fe805=0x0;_0x4fe805<_0x176f4d[_0xdf3c('0x115')]['Intervals'][_0xdf3c('0x48')];_0x4fe805++){var _0x46b908=_0x176f4d[_0xdf3c('0x115')][_0xdf3c('0x11a')][_0x4fe805][_0xdf3c('0x37')]({'plain':!![]});_0x1bf0ec[_0xdf3c('0xc0')](iftimePromise(_0x46b908,_0x176f4d));}return BPromise[_0xdf3c('0x11b')](_0x1bf0ec)['then'](function(_0x318357){return _[_0xdf3c('0x11c')](_0x318357);});}else{return!![];}})[_0xdf3c('0x22')](function(_0xf8ab05){var _0x5bccce=fs[_0xdf3c('0xd8')](path[_0xdf3c('0x79')](config[_0xdf3c('0x7a')],_0xdf3c('0x11d')),_0xdf3c('0xda'));var _0x526533={'remote':_0x176f4d['remote'],'query':querystring['stringify'](_[_0xdf3c('0x59')](_0x176f4d['get']({'plain':!![]}),{'customerIp':_0x16b173[_0xdf3c('0xa6')]['x-forwarded-for']||_0x16b173[_0xdf3c('0xa6')][_0xdf3c('0x11e')]||_0x16b173[_0xdf3c('0x11f')]['remoteAddress']||_0x16b173['ip'],'referer':_0x16b173['headers']['referer'],'openedInteractions':_0xa523c8,'maxInteractions':_0x52ae27,'virtual':_0xe4ea87[_0xdf3c('0x120')],'online':_0xf8ab05,'custom':_0xe4ea87}))[_0xdf3c('0x121')](/'/g,'\x5c\x27')};_0x578e41['send'](ejs[_0xdf3c('0xdb')](Mustache[_0xdf3c('0xdb')](_0x5bccce,_0x526533),{'proactiveActions':_0x29d64d,'alignment':_0x176f4d[_0xdf3c('0x122')],'verticalAlignment':_0x176f4d[_0xdf3c('0x123')],'div_color':_0x176f4d[_0xdf3c('0x124')],'text_color':_0x176f4d[_0xdf3c('0x125')],'button_color':_0x176f4d[_0xdf3c('0x126')],'background_color':_0x176f4d[_0xdf3c('0x127')]}));})['catch'](handleError(_0x578e41,null));};exports[_0xdf3c('0x128')]=function(_0x300680,_0x37e578,_0x11436f){return db[_0xdf3c('0x3f')]['findOne']({'where':{'id':_0x300680[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x37e578,null))[_0xdf3c('0x22')](function(_0x1be5e3){if(_0x1be5e3){return db[_0xdf3c('0xe2')][_0xdf3c('0xe3')](function(_0x48093a){return db[_0xdf3c('0x9d')]['destroy']({'where':{'ChatWebsiteId':_0x300680[_0xdf3c('0x57')]['id']},'transaction':_0x48093a})[_0xdf3c('0x22')](function(_0x393dc9){var _0x1094d0=_[_0xdf3c('0x3e')](_0x300680[_0xdf3c('0x5d')],function(_0x3c1a8a){_0x3c1a8a[_0xdf3c('0x66')]=_0x300680[_0xdf3c('0x57')]['id'];return _0x3c1a8a;});return db['ChatApplication'][_0xdf3c('0xe5')](_0x1094d0,{'transaction':_0x48093a});});})[_0xdf3c('0x22')](function(){return db[_0xdf3c('0x9d')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x300680[_0xdf3c('0x57')]['id']},'order':'priority'});});}})[_0xdf3c('0x22')](respondWithResult(_0x37e578,null))[_0xdf3c('0x5b')](handleError(_0x37e578,null));};exports[_0xdf3c('0x129')]=function(_0x129f20,_0x44abeb,_0xb1c654){var _0x311098={};var _0x260d6f={};var _0x26645e;var _0x33230c;return db[_0xdf3c('0x3f')][_0xdf3c('0x68')]({'where':{'id':_0x129f20['params']['id']}})['then'](handleEntityNotFound(_0x44abeb,null))['then'](function(_0x374ac7){if(_0x374ac7){_0x26645e=_0x374ac7;_0x260d6f[_0xdf3c('0x42')]=_[_0xdf3c('0x45')](db[_0xdf3c('0x9d')][_0xdf3c('0x40')]);_0x260d6f[_0xdf3c('0x44')]=_[_0xdf3c('0x45')](_0x129f20[_0xdf3c('0x44')]);_0x260d6f[_0xdf3c('0x4d')]=_[_0xdf3c('0x58')](_0x260d6f[_0xdf3c('0x42')],_0x260d6f[_0xdf3c('0x44')]);_0x311098[_0xdf3c('0x46')]=_['intersection'](_0x260d6f['model'],qs[_0xdf3c('0x47')](_0x129f20[_0xdf3c('0x44')][_0xdf3c('0x47')]));_0x311098['attributes']=_0x311098[_0xdf3c('0x46')]['length']?_0x311098[_0xdf3c('0x46')]:_0x260d6f[_0xdf3c('0x42')];_0x311098['order']=qs[_0xdf3c('0x4b')](_0x129f20[_0xdf3c('0x44')][_0xdf3c('0x4b')]);_0x311098[_0xdf3c('0x4c')]=qs[_0xdf3c('0x4d')](_[_0xdf3c('0x4e')](_0x129f20[_0xdf3c('0x44')],_0x260d6f[_0xdf3c('0x4d')]));if(_0x129f20['query'][_0xdf3c('0x4f')]){_0x311098[_0xdf3c('0x4c')]=_[_0xdf3c('0x59')](_0x311098[_0xdf3c('0x4c')],{'$or':_['map'](_0x311098['attributes'],function(_0x3aca0b){var _0x375297={};_0x375297[_0x3aca0b]={'$like':'%'+_0x129f20[_0xdf3c('0x44')][_0xdf3c('0x4f')]+'%'};return _0x375297;})});}_0x311098=_['merge']({},_0x311098,_0x129f20['options']);return _0x26645e[_0xdf3c('0x129')](_0x311098);}})[_0xdf3c('0x22')](function(_0x381d88){if(_0x381d88){_0x33230c=_0x381d88['length'];if(!_0x129f20[_0xdf3c('0x44')]['hasOwnProperty'](_0xdf3c('0x49'))){_0x311098[_0xdf3c('0x2e')]=qs[_0xdf3c('0x2e')](_0x129f20['query']['limit']);_0x311098[_0xdf3c('0x30')]=qs[_0xdf3c('0x30')](_0x129f20[_0xdf3c('0x44')]['offset']);}return _0x26645e[_0xdf3c('0x129')](_0x311098);}})[_0xdf3c('0x22')](function(_0x4b16d8){if(_0x4b16d8){return _0x4b16d8?{'count':_0x33230c,'rows':_0x4b16d8}:null;}})[_0xdf3c('0x22')](respondWithResult(_0x44abeb,null))[_0xdf3c('0x5b')](handleError(_0x44abeb,null));};exports[_0xdf3c('0x12a')]=function(_0x3886f8,_0x2f1979,_0x3e8060){return db[_0xdf3c('0x12b')][_0xdf3c('0x5a')]({'where':{'id':_0x3886f8[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x2f1979,null))[_0xdf3c('0x22')](function(_0x544131){if(_0x544131){return _0x544131[_0xdf3c('0x12a')](_0x3886f8[_0xdf3c('0x5d')][_0xdf3c('0x6b')],_['omit'](_0x3886f8[_0xdf3c('0x5d')],[_0xdf3c('0x6b'),'id'])||{});}})[_0xdf3c('0x22')](respondWithResult(_0x2f1979,null))[_0xdf3c('0x5b')](handleError(_0x2f1979,null));};exports['getProactiveActions']=function(_0x3a163f,_0x33266f,_0x317d42){var _0xe89ca2={};var _0x1b21cd={};var _0x3ee81b;var _0x59b3f2;return db[_0xdf3c('0x3f')]['findOne']({'where':{'id':_0x3a163f[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x33266f,null))[_0xdf3c('0x22')](function(_0x3221e1){if(_0x3221e1){_0x3ee81b=_0x3221e1;_0x1b21cd[_0xdf3c('0x42')]=_[_0xdf3c('0x45')](db[_0xdf3c('0x12c')][_0xdf3c('0x40')]);_0x1b21cd['query']=_[_0xdf3c('0x45')](_0x3a163f['query']);_0x1b21cd[_0xdf3c('0x4d')]=_['intersection'](_0x1b21cd['model'],_0x1b21cd[_0xdf3c('0x44')]);_0xe89ca2[_0xdf3c('0x46')]=_['intersection'](_0x1b21cd[_0xdf3c('0x42')],qs['fields'](_0x3a163f['query'][_0xdf3c('0x47')]));_0xe89ca2[_0xdf3c('0x46')]=_0xe89ca2[_0xdf3c('0x46')][_0xdf3c('0x48')]?_0xe89ca2[_0xdf3c('0x46')]:_0x1b21cd[_0xdf3c('0x42')];_0xe89ca2[_0xdf3c('0x4a')]=qs[_0xdf3c('0x4b')](_0x3a163f['query'][_0xdf3c('0x4b')]);_0xe89ca2[_0xdf3c('0x4c')]=qs[_0xdf3c('0x4d')](_[_0xdf3c('0x4e')](_0x3a163f[_0xdf3c('0x44')],_0x1b21cd[_0xdf3c('0x4d')]));if(_0x3a163f['query'][_0xdf3c('0x4f')]){_0xe89ca2[_0xdf3c('0x4c')]=_[_0xdf3c('0x59')](_0xe89ca2[_0xdf3c('0x4c')],{'$or':_['map'](_0xe89ca2['attributes'],function(_0x418076){var _0x4971b9={};_0x4971b9[_0x418076]={'$like':'%'+_0x3a163f[_0xdf3c('0x44')]['filter']+'%'};return _0x4971b9;})});}_0xe89ca2=_[_0xdf3c('0x59')]({},_0xe89ca2,_0x3a163f[_0xdf3c('0x52')]);return _0x3ee81b['getProactiveActions'](_0xe89ca2);}})[_0xdf3c('0x22')](function(_0x2a37bc){if(_0x2a37bc){_0x59b3f2=_0x2a37bc[_0xdf3c('0x48')];if(!_0x3a163f[_0xdf3c('0x44')][_0xdf3c('0x6f')](_0xdf3c('0x49'))){_0xe89ca2['limit']=qs['limit'](_0x3a163f[_0xdf3c('0x44')]['limit']);_0xe89ca2[_0xdf3c('0x30')]=qs[_0xdf3c('0x30')](_0x3a163f[_0xdf3c('0x44')][_0xdf3c('0x30')]);}return _0x3ee81b[_0xdf3c('0x116')](_0xe89ca2);}})[_0xdf3c('0x22')](function(_0x5ef7a6){if(_0x5ef7a6){return _0x5ef7a6?{'count':_0x59b3f2,'rows':_0x5ef7a6}:null;}})['then'](respondWithResult(_0x33266f,null))['catch'](handleError(_0x33266f,null));};exports[_0xdf3c('0x12d')]=function(_0x4a053a,_0x2b95a7,_0x2efa8d){var _0x5ddb69=_0x4a053a[_0xdf3c('0x44')][_0xdf3c('0x12e')]===_0xdf3c('0x12f')?_0xdf3c('0x130'):_0xdf3c('0x131');return db[_0xdf3c('0x3f')][_0xdf3c('0x5a')]({'attributes':['id',_0x5ddb69],'where':{'id':_0x4a053a[_0xdf3c('0x57')]['id']}})['then'](handleEntityNotFound(_0x2b95a7,null))[_0xdf3c('0x22')](function(_0x2de97b){if(_0x2de97b){var _0x1c625f=_0x2de97b[_0x5ddb69];var _0x123213=_0x1c625f&&_0x1c625f[_0xdf3c('0x132')]?_0x1c625f[_0xdf3c('0x132')]:[];_0x2b95a7[_0xdf3c('0xd0')]({'fromKey':_[_0xdf3c('0x7d')](_0x1c625f[_0xdf3c('0x133')])?undefined:_0x1c625f[_0xdf3c('0x133')],'count':_0x123213[_0xdf3c('0x48')],'rows':_0x123213});}})[_0xdf3c('0x5b')](handleError(_0x2b95a7,null));};exports[_0xdf3c('0x134')]=function(_0x6df8b5,_0x201309,_0x516aa3){var _0x3a2125={'raw':![],'where':{}};var _0x4b9ff8={};var _0x3bfd59={'count':0x0,'rows':[]};return db[_0xdf3c('0x3f')]['findOne']({'where':{'id':_0x6df8b5[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x201309,null))['then'](function(_0x1fa049){if(_0x1fa049){_0x4b9ff8[_0xdf3c('0x42')]=_[_0xdf3c('0x45')](db[_0xdf3c('0x135')]['rawAttributes']);_0x4b9ff8['query']=_[_0xdf3c('0x45')](_0x6df8b5[_0xdf3c('0x44')]);_0x4b9ff8['filters']=_[_0xdf3c('0x58')](_0x4b9ff8[_0xdf3c('0x42')],_0x4b9ff8[_0xdf3c('0x44')]);_0x3a2125[_0xdf3c('0x46')]=_[_0xdf3c('0x58')](_0x4b9ff8[_0xdf3c('0x42')],qs[_0xdf3c('0x47')](_0x6df8b5[_0xdf3c('0x44')]['fields']));_0x3a2125[_0xdf3c('0x46')]=_0x3a2125[_0xdf3c('0x46')][_0xdf3c('0x48')]?_0x3a2125[_0xdf3c('0x46')]:_0x4b9ff8[_0xdf3c('0x42')];if(!_0x6df8b5[_0xdf3c('0x44')][_0xdf3c('0x6f')]('nolimit')){_0x3a2125[_0xdf3c('0x2e')]=qs[_0xdf3c('0x2e')](_0x6df8b5[_0xdf3c('0x44')][_0xdf3c('0x2e')]);_0x3a2125[_0xdf3c('0x30')]=qs[_0xdf3c('0x30')](_0x6df8b5[_0xdf3c('0x44')][_0xdf3c('0x30')]);}_0x3a2125[_0xdf3c('0x4a')]=qs[_0xdf3c('0x4b')](_0x6df8b5['query'][_0xdf3c('0x4b')]);_0x3a2125[_0xdf3c('0x4c')]=qs[_0xdf3c('0x4d')](_[_0xdf3c('0x4e')](_0x6df8b5[_0xdf3c('0x44')],_0x4b9ff8[_0xdf3c('0x4d')]));_0x3a2125[_0xdf3c('0x4c')][_0xdf3c('0x66')]=_0x1fa049['id'];if(_0x6df8b5['query']['filter']){_0x3a2125[_0xdf3c('0x4c')]=_['merge'](_0x3a2125[_0xdf3c('0x4c')],{'$or':_[_0xdf3c('0x3e')](_0x3a2125[_0xdf3c('0x46')],function(_0x2ae851){var _0x15a1f1={};_0x15a1f1[_0x2ae851]={'$like':'%'+_0x6df8b5['query'][_0xdf3c('0x4f')]+'%'};return _0x15a1f1;})});}_0x3a2125=_[_0xdf3c('0x59')]({},_0x3a2125,_0x6df8b5[_0xdf3c('0x52')]);return db[_0xdf3c('0x135')][_0xdf3c('0x31')]({'where':_0x3a2125['where']})['then'](function(_0x471f69){_0x3bfd59[_0xdf3c('0x31')]=_0x471f69;if(_0x6df8b5[_0xdf3c('0x44')][_0xdf3c('0x53')]){_0x3a2125[_0xdf3c('0x69')]=[{'all':!![]}];}else{_0x3a2125[_0xdf3c('0x69')]=[{'model':db['CmContact'],'as':_0xdf3c('0x101'),'required':![]},{'model':db[_0xdf3c('0xe4')],'as':_0xdf3c('0x136'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x3a2125);})[_0xdf3c('0x22')](function(_0x584fbb){_0x3bfd59['rows']=_0x584fbb;return _0x3bfd59;});}})[_0xdf3c('0x22')](respondWithFilteredResult(_0x201309,_0x3a2125))[_0xdf3c('0x5b')](handleError(_0x201309,null));};exports['addAgents']=function(_0x34fa27,_0x1a27f3,_0xc23548){return db[_0xdf3c('0x3f')][_0xdf3c('0x5a')]({'where':{'id':_0x34fa27[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x1a27f3,null))['then'](function(_0x4a8c32){if(_0x4a8c32){return _0x4a8c32[_0xdf3c('0x137')](_0x34fa27[_0xdf3c('0x5d')][_0xdf3c('0x6b')],_[_0xdf3c('0x100')](_0x34fa27[_0xdf3c('0x5d')],[_0xdf3c('0x6b'),'id'])||{})[_0xdf3c('0xd7')](function(_0x20e6b0){for(var _0x197cd9=0x0;_0x197cd9<_0x34fa27[_0xdf3c('0x5d')][_0xdf3c('0x6b')][_0xdf3c('0x48')];_0x197cd9+=0x1){socket['emit'](_0xdf3c('0x138'),{'UserId':_0x34fa27[_0xdf3c('0x5d')][_0xdf3c('0x6b')][_0x197cd9],'ChatWebsiteId':_0x34fa27[_0xdf3c('0x57')]['id']});}return _0x20e6b0;});}})[_0xdf3c('0x22')](respondWithResult(_0x1a27f3,null))[_0xdf3c('0x5b')](handleError(_0x1a27f3,null));};exports[_0xdf3c('0x139')]=function(_0x3c67b6,_0x426c7d,_0x243447){return db['ChatWebsite'][_0xdf3c('0x5a')]({'where':{'id':_0x3c67b6[_0xdf3c('0x57')]['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x426c7d,null))['then'](function(_0x3ca5b2){if(_0x3ca5b2){return _0x3ca5b2[_0xdf3c('0x139')](_0x3c67b6[_0xdf3c('0x44')][_0xdf3c('0x6b')])['then'](function(){if(_[_0xdf3c('0x13a')](_0x3c67b6['query'][_0xdf3c('0x6b')])){for(var _0x2af066=0x0;_0x2af066<_0x3c67b6['query'][_0xdf3c('0x6b')][_0xdf3c('0x48')];_0x2af066+=0x1){socket[_0xdf3c('0x13b')](_0xdf3c('0x13c'),{'UserId':Number(_0x3c67b6['query'][_0xdf3c('0x6b')][_0x2af066]),'ChatWebsiteId':Number(_0x3c67b6[_0xdf3c('0x57')]['id'])});}}else{socket['emit'](_0xdf3c('0x13c'),{'UserId':Number(_0x3c67b6['query'][_0xdf3c('0x6b')]),'ChatWebsiteId':Number(_0x3c67b6['params']['id'])});}});}})[_0xdf3c('0x22')](respondWithStatusCode(_0x426c7d,null))[_0xdf3c('0x5b')](handleError(_0x426c7d,null));};exports['getAgents']=function(_0x32d80c,_0x5c8dcc,_0x399564){var _0xe21bfd={};var _0x46b7ad={};var _0x336678;var _0xf1fea2;return db[_0xdf3c('0x3f')]['findOne']({'where':{'id':_0x32d80c['params']['id']}})[_0xdf3c('0x22')](handleEntityNotFound(_0x5c8dcc,null))['then'](function(_0x31fe92){if(_0x31fe92){_0x336678=_0x31fe92;_0x46b7ad[_0xdf3c('0x42')]=_[_0xdf3c('0x45')](db['User'][_0xdf3c('0x40')]);_0x46b7ad[_0xdf3c('0x44')]=_['keys'](_0x32d80c['query']);_0x46b7ad[_0xdf3c('0x4d')]=_['intersection'](_0x46b7ad[_0xdf3c('0x42')],_0x46b7ad[_0xdf3c('0x44')]);_0xe21bfd[_0xdf3c('0x46')]=_[_0xdf3c('0x58')](_0x46b7ad['model'],qs['fields'](_0x32d80c[_0xdf3c('0x44')][_0xdf3c('0x47')]));_0xe21bfd[_0xdf3c('0x46')]=_0xe21bfd[_0xdf3c('0x46')][_0xdf3c('0x48')]?_0xe21bfd['attributes']:_0x46b7ad[_0xdf3c('0x42')];_0xe21bfd[_0xdf3c('0x4a')]=qs[_0xdf3c('0x4b')](_0x32d80c[_0xdf3c('0x44')][_0xdf3c('0x4b')]);_0xe21bfd[_0xdf3c('0x4c')]=qs['filters'](_[_0xdf3c('0x4e')](_0x32d80c['query'],_0x46b7ad[_0xdf3c('0x4d')]));if(_0x32d80c['query'][_0xdf3c('0x4f')]){_0xe21bfd[_0xdf3c('0x4c')]=_['merge'](_0xe21bfd[_0xdf3c('0x4c')],{'$or':_['map'](_0xe21bfd[_0xdf3c('0x46')],function(_0x123166){var _0x241f9d={};_0x241f9d[_0x123166]={'$like':'%'+_0x32d80c[_0xdf3c('0x44')][_0xdf3c('0x4f')]+'%'};return _0x241f9d;})});}_0xe21bfd=_[_0xdf3c('0x59')]({},_0xe21bfd,_0x32d80c[_0xdf3c('0x52')]);return _0x336678[_0xdf3c('0x13d')](_0xe21bfd);}})[_0xdf3c('0x22')](function(_0xfa1485){if(_0xfa1485){_0xf1fea2=_0xfa1485[_0xdf3c('0x48')];if(!_0x32d80c[_0xdf3c('0x44')][_0xdf3c('0x6f')]('nolimit')){_0xe21bfd[_0xdf3c('0x2e')]=qs[_0xdf3c('0x2e')](_0x32d80c[_0xdf3c('0x44')][_0xdf3c('0x2e')]);_0xe21bfd[_0xdf3c('0x30')]=qs[_0xdf3c('0x30')](_0x32d80c['query']['offset']);}return _0x336678[_0xdf3c('0x13d')](_0xe21bfd);}})[_0xdf3c('0x22')](function(_0x2fe4b1){if(_0x2fe4b1){return _0x2fe4b1?{'count':_0xf1fea2,'rows':_0x2fe4b1}:null;}})[_0xdf3c('0x22')](respondWithResult(_0x5c8dcc,null))['catch'](handleError(_0x5c8dcc,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index e735137..5a994a2 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 _0xb1dc=['emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x2922e5,_0x1dd576){var _0x10a186=function(_0x185e63){while(--_0x185e63){_0x2922e5['push'](_0x2922e5['shift']());}};_0x10a186(++_0x1dd576);}(_0xb1dc,0x133));var _0xcb1d=function(_0x15106b,_0x4d96f6){_0x15106b=_0x15106b-0x0;var _0x521203=_0xb1dc[_0x15106b];return _0x521203;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xcb1d('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xcb1d('0x1')](0x0);var events={'afterCreate':_0xcb1d('0x2'),'afterUpdate':_0xcb1d('0x3'),'afterDestroy':_0xcb1d('0x4')};function emitEvent(_0x11d8dc){return function(_0xc3e297,_0x1028de,_0x477930){ChatWebsiteEvents[_0xcb1d('0x5')](_0x11d8dc+':'+_0xc3e297['id'],_0xc3e297);ChatWebsiteEvents[_0xcb1d('0x5')](_0x11d8dc,_0xc3e297);_0x477930(null);};}for(var e in events){if(events[_0xcb1d('0x6')](e)){var event=events[e];ChatWebsite[_0xcb1d('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x535f=['hook','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x42fffb,_0x34cad6){var _0x5ce507=function(_0x3b3850){while(--_0x3b3850){_0x42fffb['push'](_0x42fffb['shift']());}};_0x5ce507(++_0x34cad6);}(_0x535f,0x111));var _0xf535=function(_0x20a070,_0x2f0ff9){_0x20a070=_0x20a070-0x0;var _0x433d80=_0x535f[_0x20a070];return _0x433d80;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xf535('0x0'))['db'][_0xf535('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf535('0x2'),'afterUpdate':_0xf535('0x3'),'afterDestroy':_0xf535('0x4')};function emitEvent(_0x19ec32){return function(_0x4ff0b3,_0xd1ee93,_0x24a323){ChatWebsiteEvents[_0xf535('0x5')](_0x19ec32+':'+_0x4ff0b3['id'],_0x4ff0b3);ChatWebsiteEvents[_0xf535('0x5')](_0x19ec32,_0x4ff0b3);_0x24a323(null);};}for(var e in events){if(events[_0xf535('0x6')](e)){var event=events[e];ChatWebsite[_0xf535('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 1ee30c9..77f6bae 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 _0x3495=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','ChatWebsite','lodash','util'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x3495,0x1de));var _0x5349=function(_0x320706,_0x4e0bfc){_0x320706=_0x320706-0x0;var _0x58c92f=_0x3495[_0x320706];return _0x58c92f;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var logger=require(_0x5349('0x2'))(_0x5349('0x3'));var moment=require(_0x5349('0x4'));var BPromise=require(_0x5349('0x5'));var rp=require(_0x5349('0x6'));var fs=require('fs');var path=require(_0x5349('0x7'));var rimraf=require(_0x5349('0x8'));var config=require('../../config/environment');var attributes=require(_0x5349('0x9'));module[_0x5349('0xa')]=function(_0x5ce2cd,_0xcb5a1){return _0x5ce2cd['define'](_0x5349('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0490=['exports','define','chat_websites','util','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x1e1831,_0x3d5cd3){var _0x46b204=function(_0x588627){while(--_0x588627){_0x1e1831['push'](_0x1e1831['shift']());}};_0x46b204(++_0x3d5cd3);}(_0x0490,0x147));var _0x0049=function(_0x38ee7c,_0x2df4be){_0x38ee7c=_0x38ee7c-0x0;var _0x52706a=_0x0490[_0x38ee7c];return _0x52706a;};'use strict';var _=require('lodash');var util=require(_0x0049('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0049('0x1'));var fs=require('fs');var path=require(_0x0049('0x2'));var rimraf=require(_0x0049('0x3'));var config=require(_0x0049('0x4'));var attributes=require(_0x0049('0x5'));module[_0x0049('0x6')]=function(_0x2957b6,_0x4dde1){return _0x2957b6[_0x0049('0x7')]('ChatWebsite',attributes,{'tableName':_0x0049('0x8'),'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 96ce709..aded157 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 _0x1a37=['rpc','jayson/promise','http','redis','defaults','register','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x214871,_0x289576){var _0xe096f2=function(_0x40e713){while(--_0x40e713){_0x214871['push'](_0x214871['shift']());}};_0xe096f2(++_0x289576);}(_0x1a37,0xb4));var _0x71a3=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x1a37[_0x381589];return _0x2a075d;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});config[_0x71a3('0xc')]=_[_0x71a3('0xd')](config[_0x71a3('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x71a3('0xe')](socket);function respondWithRpcPromise(_0x18320a,_0x3709bc,_0x3aeb48){return new BPromise(function(_0x3a7fc1,_0x2215f2){return client[_0x71a3('0xf')](_0x18320a,_0x3aeb48)[_0x71a3('0x10')](function(_0x5c464c){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x3709bc,_0x71a3('0x11'));logger[_0x71a3('0x12')](_0x71a3('0x13'),_0x3709bc,_0x71a3('0x11'),JSON[_0x71a3('0x14')](_0x5c464c));if(_0x5c464c[_0x71a3('0x15')]){if(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x16')]===0x1f4){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5c464c[_0x71a3('0x15')]['message']);return _0x2215f2(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3709bc,_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);return _0x3a7fc1(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}else{logger[_0x71a3('0x19')](_0x71a3('0x17'),_0x3709bc,'request\x20sent');_0x3a7fc1(_0x5c464c[_0x71a3('0x1a')][_0x71a3('0x18')]);}})['catch'](function(_0x5f4562){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5f4562);_0x2215f2(_0x5f4562);});});} \ No newline at end of file +var _0x4888=['../../config/environment','jayson/promise','client','http','redis','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x15e0a3,_0x3da4b5){var _0x261c01=function(_0x427cff){while(--_0x427cff){_0x15e0a3['push'](_0x15e0a3['shift']());}};_0x261c01(++_0x3da4b5);}(_0x4888,0x198));var _0x8488=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0x4888[_0x3818c0];return _0x55ec33;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));var BPromise=require(_0x8488('0x2'));var rs=require(_0x8488('0x3'));var fs=require('fs');var Redis=require(_0x8488('0x4'));var db=require(_0x8488('0x5'))['db'];var utils=require(_0x8488('0x6'));var logger=require('../../config/logger')(_0x8488('0x7'));var config=require(_0x8488('0x8'));var jayson=require(_0x8488('0x9'));var client=jayson[_0x8488('0xa')][_0x8488('0xb')]({'port':0x232a});config[_0x8488('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8488('0xc')]));require(_0x8488('0xd'))['register'](socket);function respondWithRpcPromise(_0x19c994,_0x1334fe,_0x98223){return new BPromise(function(_0x19a2ee,_0x515ea8){return client[_0x8488('0xe')](_0x19c994,_0x98223)[_0x8488('0xf')](function(_0x468896){logger[_0x8488('0x10')](_0x8488('0x11'),_0x1334fe,'request\x20sent');logger[_0x8488('0x12')](_0x8488('0x13'),_0x1334fe,'request\x20sent',JSON['stringify'](_0x468896));if(_0x468896[_0x8488('0x14')]){if(_0x468896['error'][_0x8488('0x15')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1334fe,_0x468896[_0x8488('0x14')][_0x8488('0x16')]);return _0x515ea8(_0x468896[_0x8488('0x14')][_0x8488('0x16')]);}logger[_0x8488('0x14')](_0x8488('0x11'),_0x1334fe,_0x468896[_0x8488('0x14')]['message']);return _0x19a2ee(_0x468896[_0x8488('0x14')][_0x8488('0x16')]);}else{logger[_0x8488('0x10')](_0x8488('0x11'),_0x1334fe,_0x8488('0x17'));_0x19a2ee(_0x468896[_0x8488('0x18')][_0x8488('0x16')]);}})[_0x8488('0x19')](function(_0x514c31){logger[_0x8488('0x14')](_0x8488('0x11'),_0x1334fe,_0x514c31);_0x515ea8(_0x514c31);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index d8562d0..9f96345 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 _0xb10b=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0x3d131a,_0x2ee691){var _0x44c22d=function(_0xa7a9fe){while(--_0xa7a9fe){_0x3d131a['push'](_0x3d131a['shift']());}};_0x44c22d(++_0x2ee691);}(_0xb10b,0x12a));var _0xbb10=function(_0x269a6f,_0x4c43c5){_0x269a6f=_0x269a6f-0x0;var _0x29e1e6=_0xb10b[_0x269a6f];return _0x29e1e6;};'use strict';var ChatWebsiteEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatWebsiteEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatWebsiteEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x5c883f,_0x38f092){var _0x4210cc=function(_0x51be71){while(--_0x51be71){_0x5c883f['push'](_0x5c883f['shift']());}};_0x4210cc(++_0x38f092);}(_0x5f2f,0x73));var _0xf5f2=function(_0x34e2c1,_0x31e287){_0x34e2c1=_0x34e2c1-0x0;var _0xb3d893=_0x5f2f[_0x34e2c1];return _0xb3d893;};'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 48bd4ed..6e7b8b4 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 _0x8882=['getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','file','addAvatar','addCustomerAvatar','format','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions'];(function(_0x428ecc,_0x3b3f07){var _0x8781ba=function(_0x2e1ac9){while(--_0x2e1ac9){_0x428ecc['push'](_0x428ecc['shift']());}};_0x8781ba(++_0x3b3f07);}(_0x8882,0x1b7));var _0x2888=function(_0x4ca527,_0x5c1d9a){_0x4ca527=_0x4ca527-0x0;var _0x2c46ae=_0x8882[_0x4ca527];return _0x2c46ae;};'use strict';var multer=require(_0x2888('0x0'));var util=require(_0x2888('0x1'));var path=require(_0x2888('0x2'));var timeout=require(_0x2888('0x3'));var express=require('express');var router=express[_0x2888('0x4')]();var fs_extra=require(_0x2888('0x5'));var auth=require(_0x2888('0x6'));var interaction=require(_0x2888('0x7'));var config=require(_0x2888('0x8'));var controller=require(_0x2888('0x9'));router[_0x2888('0xa')]('/',auth[_0x2888('0xb')](),controller[_0x2888('0xc')]);router[_0x2888('0xa')](_0x2888('0xd'),auth[_0x2888('0xb')](),controller['describe']);router['get'](_0x2888('0xe'),auth['isAuthenticated'](),controller[_0x2888('0xf')]);router['get']('/:id/dispositions',auth[_0x2888('0xb')](),controller[_0x2888('0x10')]);router[_0x2888('0xa')]('/:id/canned_answers',auth[_0x2888('0xb')](),controller[_0x2888('0x11')]);router[_0x2888('0xa')](_0x2888('0x12'),controller[_0x2888('0x13')]);router[_0x2888('0xa')](_0x2888('0x14'),controller[_0x2888('0x15')]);router['get'](_0x2888('0x16'),controller[_0x2888('0x17')]);router[_0x2888('0xa')](_0x2888('0x18'),controller[_0x2888('0x19')]);router[_0x2888('0xa')](_0x2888('0x1a'),auth['isAuthenticated'](),controller[_0x2888('0x1b')]);router[_0x2888('0xa')](_0x2888('0x1c'),controller[_0x2888('0x1d')]);router[_0x2888('0xa')](_0x2888('0x1e'),auth[_0x2888('0xb')](),controller[_0x2888('0x1f')]);router[_0x2888('0xa')]('/:id/proactive_actions',auth[_0x2888('0xb')](),controller['getProactiveActions']);router[_0x2888('0xa')]('/:id/fields',controller[_0x2888('0x20')]);router[_0x2888('0xa')](_0x2888('0x21'),auth['isAuthenticated'](),controller[_0x2888('0x22')]);router['get'](_0x2888('0x23'),auth[_0x2888('0xb')](),controller['getAgents']);router['post']('/',auth[_0x2888('0xb')](),controller['create']);router[_0x2888('0x24')](_0x2888('0x25'),auth[_0x2888('0xb')](),controller[_0x2888('0x26')]);router[_0x2888('0x24')](_0x2888('0x27'),auth[_0x2888('0xb')](),controller[_0x2888('0x28')]);var upload=multer({'storage':multer[_0x2888('0x29')]({'destination':function(_0x27e287,_0x3fc8d7,_0x28821d){_0x28821d(null,path[_0x2888('0x2a')](config[_0x2888('0x2b')],'server/files/images/logos/'));},'filename':function(_0x104105,_0x357aed,_0x3886c4){_0x3886c4(null,util['format'](_0x2888('0x2c'),Date[_0x2888('0x2d')](),_0x357aed[_0x2888('0x2e')]));}})});router[_0x2888('0x24')]('/:id/logo',upload[_0x2888('0x2f')]('file'),controller[_0x2888('0x30')]);var upload=multer({'storage':multer[_0x2888('0x29')]({'destination':function(_0x42f987,_0x5bc6a6,_0x382743){_0x382743(null,path['join'](config[_0x2888('0x2b')],_0x2888('0x31')));},'filename':function(_0x58bc51,_0x2405f4,_0xfaa9f8){_0xfaa9f8(null,util['format'](_0x2888('0x2c'),Date[_0x2888('0x2d')](),_0x2405f4[_0x2888('0x2e')]));}})});router[_0x2888('0x24')](_0x2888('0x14'),upload[_0x2888('0x2f')](_0x2888('0x32')),controller[_0x2888('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x336d77,_0x3b6dab,_0x43be83){_0x43be83(null,path[_0x2888('0x2a')](config[_0x2888('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x1a7685,_0x396768,_0x56d425){_0x56d425(null,util['format'](_0x2888('0x2c'),Date[_0x2888('0x2d')](),_0x396768[_0x2888('0x2e')]));}})});router[_0x2888('0x24')](_0x2888('0x16'),upload['single'](_0x2888('0x32')),controller[_0x2888('0x34')]);var upload=multer({'storage':multer[_0x2888('0x29')]({'destination':function(_0x4ce757,_0x3ecd8d,_0x53a2b1){_0x53a2b1(null,path['join'](config[_0x2888('0x2b')],_0x2888('0x31')));},'filename':function(_0x52d0e5,_0x1f3d34,_0x25d33c){_0x25d33c(null,util[_0x2888('0x35')]('%s-%s',Date['now'](),_0x1f3d34['originalname']));}})});router[_0x2888('0x24')]('/:id/system_avatar',upload[_0x2888('0x2f')](_0x2888('0x32')),controller['addSystemAvatar']);router[_0x2888('0x24')](_0x2888('0x36'),controller[_0x2888('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x2888('0x29')]({'destination':function(_0x423347,_0x419eee,_0xb2dd4a){const _0xcd1d1d=path[_0x2888('0x2a')](config['root'],_0x2888('0x38'),_0x2888('0x39'),_0x2888('0x3a'));fs_extra[_0x2888('0x3b')](_0xcd1d1d,function(){_0xb2dd4a(null,_0xcd1d1d);});},'filename':function(_0x36d29c,_0x23be0f,_0x1842fb){const _0xdd0917=_0x23be0f[_0x2888('0x2e')][_0x2888('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x429c8c=path[_0x2888('0x3d')](_0xdd0917);const _0x33adf8=Date['now']()+'-'+_0xdd0917[_0x2888('0x3c')](_0x429c8c,'')+_0x429c8c;_0x1842fb(null,_0x33adf8);}})});router[_0x2888('0x24')](_0x2888('0x3e'),offlineUploadMulter[_0x2888('0x3f')](),controller[_0x2888('0x40')]);router['post'](_0x2888('0x1a'),auth[_0x2888('0xb')](),controller[_0x2888('0x41')]);router['post']('/:id/applications',auth[_0x2888('0xb')](),controller[_0x2888('0x42')]);router[_0x2888('0x24')]('/:id/proactive_actions',auth[_0x2888('0xb')](),controller[_0x2888('0x43')]);router[_0x2888('0x24')](_0x2888('0x23'),auth[_0x2888('0xb')](),controller[_0x2888('0x44')]);router[_0x2888('0x45')]('/:id',auth[_0x2888('0xb')](),controller[_0x2888('0x46')]);router[_0x2888('0x47')](_0x2888('0xe'),auth[_0x2888('0xb')](),controller[_0x2888('0x48')]);router[_0x2888('0x47')](_0x2888('0x25'),auth[_0x2888('0xb')](),controller[_0x2888('0x49')]);router['delete']('/:id/canned_answers',auth[_0x2888('0xb')](),controller[_0x2888('0x4a')]);router[_0x2888('0x47')](_0x2888('0x23'),auth[_0x2888('0xb')](),controller[_0x2888('0x4b')]);module['exports']=router; \ No newline at end of file +var _0x32cf=['getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','originalname','/:id/logo','single','join','server/files/images/avatars/','file','addAvatar','now','addSystemAvatar','notify','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getLogo','/:id/avatar','/:id/customer_avatar'];(function(_0x51b665,_0x39ba8e){var _0x5bef86=function(_0x3dd7d5){while(--_0x3dd7d5){_0x51b665['push'](_0x51b665['shift']());}};_0x5bef86(++_0x39ba8e);}(_0x32cf,0xc5));var _0xf32c=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x32cf[_0x310504];return _0x5b36d0;};'use strict';var multer=require(_0xf32c('0x0'));var util=require(_0xf32c('0x1'));var path=require('path');var timeout=require(_0xf32c('0x2'));var express=require(_0xf32c('0x3'));var router=express[_0xf32c('0x4')]();var fs_extra=require(_0xf32c('0x5'));var auth=require(_0xf32c('0x6'));var interaction=require(_0xf32c('0x7'));var config=require(_0xf32c('0x8'));var controller=require(_0xf32c('0x9'));router[_0xf32c('0xa')]('/',auth['isAuthenticated'](),controller[_0xf32c('0xb')]);router[_0xf32c('0xa')](_0xf32c('0xc'),auth[_0xf32c('0xd')](),controller[_0xf32c('0xe')]);router[_0xf32c('0xa')](_0xf32c('0xf'),auth['isAuthenticated'](),controller[_0xf32c('0x10')]);router[_0xf32c('0xa')](_0xf32c('0x11'),auth[_0xf32c('0xd')](),controller[_0xf32c('0x12')]);router[_0xf32c('0xa')]('/:id/canned_answers',auth[_0xf32c('0xd')](),controller['getAnswers']);router[_0xf32c('0xa')]('/:id/logo',controller[_0xf32c('0x13')]);router[_0xf32c('0xa')](_0xf32c('0x14'),controller['getAvatar']);router['get'](_0xf32c('0x15'),controller[_0xf32c('0x16')]);router[_0xf32c('0xa')](_0xf32c('0x17'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0xf32c('0xd')](),controller[_0xf32c('0x18')]);router[_0xf32c('0xa')](_0xf32c('0x19'),controller[_0xf32c('0x1a')]);router[_0xf32c('0xa')](_0xf32c('0x1b'),auth['isAuthenticated'](),controller[_0xf32c('0x1c')]);router['get'](_0xf32c('0x1d'),auth[_0xf32c('0xd')](),controller[_0xf32c('0x1e')]);router[_0xf32c('0xa')](_0xf32c('0x1f'),controller[_0xf32c('0x20')]);router['get'](_0xf32c('0x21'),auth[_0xf32c('0xd')](),controller[_0xf32c('0x22')]);router[_0xf32c('0xa')](_0xf32c('0x23'),auth['isAuthenticated'](),controller['getAgents']);router[_0xf32c('0x24')]('/',auth[_0xf32c('0xd')](),controller[_0xf32c('0x25')]);router[_0xf32c('0x24')](_0xf32c('0x11'),auth['isAuthenticated'](),controller[_0xf32c('0x26')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xf32c('0x27')]);var upload=multer({'storage':multer[_0xf32c('0x28')]({'destination':function(_0x47fdcf,_0x29604e,_0x2b33d6){_0x2b33d6(null,path['join'](config[_0xf32c('0x29')],_0xf32c('0x2a')));},'filename':function(_0x49d861,_0x587684,_0x20ddfd){_0x20ddfd(null,util[_0xf32c('0x2b')](_0xf32c('0x2c'),Date['now'](),_0x587684[_0xf32c('0x2d')]));}})});router[_0xf32c('0x24')](_0xf32c('0x2e'),upload[_0xf32c('0x2f')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf0dfcb,_0x320a16,_0x39b18e){_0x39b18e(null,path[_0xf32c('0x30')](config[_0xf32c('0x29')],_0xf32c('0x31')));},'filename':function(_0x4714b6,_0x1b95a1,_0x3d17ff){_0x3d17ff(null,util[_0xf32c('0x2b')](_0xf32c('0x2c'),Date['now'](),_0x1b95a1['originalname']));}})});router[_0xf32c('0x24')]('/:id/avatar',upload[_0xf32c('0x2f')](_0xf32c('0x32')),controller[_0xf32c('0x33')]);var upload=multer({'storage':multer[_0xf32c('0x28')]({'destination':function(_0x3f01da,_0x557955,_0x306069){_0x306069(null,path['join'](config['root'],_0xf32c('0x31')));},'filename':function(_0x238898,_0x2e21ba,_0x25c6cf){_0x25c6cf(null,util[_0xf32c('0x2b')](_0xf32c('0x2c'),Date[_0xf32c('0x34')](),_0x2e21ba['originalname']));}})});router[_0xf32c('0x24')]('/:id/customer_avatar',upload[_0xf32c('0x2f')](_0xf32c('0x32')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xf32c('0x28')]({'destination':function(_0x2e9710,_0x38c738,_0x26c704){_0x26c704(null,path['join'](config[_0xf32c('0x29')],_0xf32c('0x31')));},'filename':function(_0x5f32f9,_0x2d7aaa,_0x2cf5ca){_0x2cf5ca(null,util['format'](_0xf32c('0x2c'),Date[_0xf32c('0x34')](),_0x2d7aaa[_0xf32c('0x2d')]));}})});router[_0xf32c('0x24')](_0xf32c('0x17'),upload['single']('file'),controller[_0xf32c('0x35')]);router[_0xf32c('0x24')]('/:id/notify',controller[_0xf32c('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3b6533,_0x4a2a38,_0x48f2c5){const _0x45a306=path[_0xf32c('0x30')](config[_0xf32c('0x29')],'server/files',_0xf32c('0x37'),'offline-chat');fs_extra[_0xf32c('0x38')](_0x45a306,function(){_0x48f2c5(null,_0x45a306);});},'filename':function(_0x224deb,_0x52736d,_0x514176){const _0x310a12=_0x52736d[_0xf32c('0x2d')][_0xf32c('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x53c20d=path[_0xf32c('0x3a')](_0x310a12);const _0x22a442=Date[_0xf32c('0x34')]()+'-'+_0x310a12['replace'](_0x53c20d,'')+_0x53c20d;_0x514176(null,_0x22a442);}})});router['post'](_0xf32c('0x3b'),offlineUploadMulter[_0xf32c('0x3c')](),controller[_0xf32c('0x3d')]);router[_0xf32c('0x24')]('/:id/interactions',auth[_0xf32c('0xd')](),controller[_0xf32c('0x3e')]);router[_0xf32c('0x24')]('/:id/applications',auth[_0xf32c('0xd')](),controller['addApplications']);router[_0xf32c('0x24')](_0xf32c('0x1d'),auth[_0xf32c('0xd')](),controller[_0xf32c('0x3f')]);router['post'](_0xf32c('0x23'),auth[_0xf32c('0xd')](),controller[_0xf32c('0x40')]);router[_0xf32c('0x41')](_0xf32c('0xf'),auth[_0xf32c('0xd')](),controller[_0xf32c('0x42')]);router[_0xf32c('0x43')](_0xf32c('0xf'),auth['isAuthenticated'](),controller[_0xf32c('0x44')]);router['delete'](_0xf32c('0x11'),auth[_0xf32c('0xd')](),controller[_0xf32c('0x45')]);router[_0xf32c('0x43')](_0xf32c('0x46'),auth[_0xf32c('0xd')](),controller[_0xf32c('0x47')]);router[_0xf32c('0x43')]('/:id/users',auth[_0xf32c('0xd')](),controller['removeAgents']);module[_0xf32c('0x48')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 3770f88..ccae7a1 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6e9=['Google','sequelize','exports','STRING','AmazonAWS'];(function(_0x3c7ed4,_0x271b34){var _0x4e7d67=function(_0x2e95ec){while(--_0x2e95ec){_0x3c7ed4['push'](_0x3c7ed4['shift']());}};_0x4e7d67(++_0x271b34);}(_0xe6e9,0x182));var _0x9e6e=function(_0x2d5a73,_0x8ab2fe){_0x2d5a73=_0x2d5a73-0x0;var _0x2ff862=_0xe6e9[_0x2d5a73];return _0x2ff862;};'use strict';var Sequelize=require(_0x9e6e('0x0'));module[_0x9e6e('0x1')]={'name':{'type':Sequelize[_0x9e6e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x9e6e('0x3'),_0x9e6e('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x9e6e('0x2')]},'data2':{'type':Sequelize[_0x9e6e('0x2')]}}; \ No newline at end of file +var _0x7b27=['sequelize','STRING','ENUM','AmazonAWS','Google'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0x7b27,0x186));var _0x77b2=function(_0x153e46,_0x250111){_0x153e46=_0x153e46-0x0;var _0x456c36=_0x7b27[_0x153e46];return _0x456c36;};'use strict';var Sequelize=require(_0x77b2('0x0'));module['exports']={'name':{'type':Sequelize[_0x77b2('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x77b2('0x2')](_0x77b2('0x3'),_0x77b2('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x77b2('0x1')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 8d16f45..ddf59a4 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08ac=['ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','CloudProvider','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','keys','options','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv'];(function(_0x2c931f,_0x12d1c9){var _0x5f1470=function(_0x3b5d03){while(--_0x3b5d03){_0x2c931f['push'](_0x2c931f['shift']());}};_0x5f1470(++_0x12d1c9);}(_0x08ac,0x126));var _0xc08a=function(_0x398f63,_0x3a7d21){_0x398f63=_0x398f63-0x0;var _0x3fb582=_0x08ac[_0x398f63];return _0x3fb582;};'use strict';var emlformat=require(_0xc08a('0x0'));var rimraf=require(_0xc08a('0x1'));var zipdir=require(_0xc08a('0x2'));var jsonpatch=require(_0xc08a('0x3'));var rp=require(_0xc08a('0x4'));var moment=require(_0xc08a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc08a('0x6'));var path=require(_0xc08a('0x7'));var sox=require(_0xc08a('0x8'));var csv=require(_0xc08a('0x9'));var ejs=require(_0xc08a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc08a('0xb'));var squel=require('squel');var crypto=require(_0xc08a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc08a('0xd'));var toCsv=require(_0xc08a('0x9'));var querystring=require('querystring');var Papa=require(_0xc08a('0xe'));var Redis=require(_0xc08a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc08a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc08a('0x11'));var logger=require(_0xc08a('0x12'))(_0xc08a('0x13'));var utils=require(_0xc08a('0x14'));var config=require(_0xc08a('0x15'));var licenseUtil=require(_0xc08a('0x16'));var db=require(_0xc08a('0x17'))['db'];function respondWithStatusCode(_0x41a941,_0x538b3e){_0x538b3e=_0x538b3e||0xcc;return function(_0x428beb){if(_0x428beb){return _0x41a941[_0xc08a('0x18')](_0x538b3e);}return _0x41a941['status'](_0x538b3e)['end']();};}function respondWithResult(_0x18fdcb,_0x88faa9){_0x88faa9=_0x88faa9||0xc8;return function(_0x567082){if(_0x567082){return _0x18fdcb['status'](_0x88faa9)[_0xc08a('0x19')](_0x567082);}};}function respondWithFilteredResult(_0x23aa82,_0x2b6c24){return function(_0x43e053){if(_0x43e053){var _0x1be836=typeof _0x2b6c24['offset']===_0xc08a('0x1a')&&typeof _0x2b6c24[_0xc08a('0x1b')]==='undefined';var _0x451a65=_0x43e053[_0xc08a('0x1c')];var _0x40ebcc=_0x1be836?0x0:_0x2b6c24[_0xc08a('0x1d')];var _0x4b4636=_0x1be836?_0x43e053[_0xc08a('0x1c')]:_0x2b6c24[_0xc08a('0x1d')]+_0x2b6c24[_0xc08a('0x1b')];var _0x1a749a;if(_0x4b4636>=_0x451a65){_0x4b4636=_0x451a65;_0x1a749a=0xc8;}else{_0x1a749a=0xce;}_0x23aa82[_0xc08a('0x1e')](_0x1a749a);return _0x23aa82[_0xc08a('0x1f')](_0xc08a('0x20'),_0x40ebcc+'-'+_0x4b4636+'/'+_0x451a65)[_0xc08a('0x19')](_0x43e053);}return null;};}function patchUpdates(_0x168bc5){return function(_0x484a24){try{jsonpatch[_0xc08a('0x21')](_0x484a24,_0x168bc5,!![]);}catch(_0x267d92){return BPromise[_0xc08a('0x22')](_0x267d92);}return _0x484a24[_0xc08a('0x23')]();};}function saveUpdates(_0x2e8aed,_0xd367ee){return function(_0x39858e){if(_0x39858e){return _0x39858e[_0xc08a('0x24')](_0x2e8aed)[_0xc08a('0x25')](function(_0x327020){return _0x327020;});}return null;};}function removeEntity(_0x203592,_0x361263){return function(_0x5ea6d1){if(_0x5ea6d1){return _0x5ea6d1['destroy']()[_0xc08a('0x25')](function(){_0x203592[_0xc08a('0x1e')](0xcc)[_0xc08a('0x26')]();});}};}function handleEntityNotFound(_0xab657d,_0x44bf87){return function(_0x190e1d){if(!_0x190e1d){_0xab657d[_0xc08a('0x18')](0x194);}return _0x190e1d;};}function handleError(_0x1964e6,_0x181260){_0x181260=_0x181260||0x1f4;return function(_0x31c64d){logger[_0xc08a('0x27')](_0x31c64d[_0xc08a('0x28')]);if(_0x31c64d[_0xc08a('0x29')]){delete _0x31c64d[_0xc08a('0x29')];}_0x1964e6['status'](_0x181260)[_0xc08a('0x2a')](_0x31c64d);};}exports[_0xc08a('0x2b')]=function(_0x4d3278,_0x2e54fe){var _0x18ae4b={},_0x9bbca1={},_0x1068ea={'count':0x0,'rows':[]};var _0x2c4788=_[_0xc08a('0x2c')](db[_0xc08a('0x2d')][_0xc08a('0x2e')],function(_0x152e87){return{'name':_0x152e87['fieldName'],'type':_0x152e87[_0xc08a('0x2f')][_0xc08a('0x30')]};});_0x9bbca1['model']=_[_0xc08a('0x2c')](_0x2c4788,'name');_0x9bbca1['query']=_['keys'](_0x4d3278[_0xc08a('0x31')]);_0x9bbca1[_0xc08a('0x32')]=_[_0xc08a('0x33')](_0x9bbca1[_0xc08a('0x34')],_0x9bbca1[_0xc08a('0x31')]);_0x18ae4b[_0xc08a('0x35')]=_[_0xc08a('0x33')](_0x9bbca1[_0xc08a('0x34')],qs[_0xc08a('0x36')](_0x4d3278[_0xc08a('0x31')][_0xc08a('0x36')]));_0x18ae4b[_0xc08a('0x35')]=_0x18ae4b[_0xc08a('0x35')][_0xc08a('0x37')]?_0x18ae4b[_0xc08a('0x35')]:_0x9bbca1['model'];if(!_0x4d3278[_0xc08a('0x31')][_0xc08a('0x38')]('nolimit')){_0x18ae4b['limit']=qs['limit'](_0x4d3278[_0xc08a('0x31')][_0xc08a('0x1b')]);_0x18ae4b['offset']=qs[_0xc08a('0x1d')](_0x4d3278[_0xc08a('0x31')]['offset']);}_0x18ae4b[_0xc08a('0x39')]=qs[_0xc08a('0x3a')](_0x4d3278[_0xc08a('0x31')][_0xc08a('0x3a')]);_0x18ae4b[_0xc08a('0x3b')]=qs['filters'](_[_0xc08a('0x3c')](_0x4d3278[_0xc08a('0x31')],_0x9bbca1[_0xc08a('0x32')]),_0x2c4788);if(_0x4d3278[_0xc08a('0x31')][_0xc08a('0x3d')]){_0x18ae4b[_0xc08a('0x3b')]=_[_0xc08a('0x3e')](_0x18ae4b[_0xc08a('0x3b')],{'$or':_[_0xc08a('0x2c')](_0x2c4788,function(_0x3ec84a){if(_0x3ec84a[_0xc08a('0x2f')]!==_0xc08a('0x3f')){var _0x40e8cb={};_0x40e8cb[_0x3ec84a[_0xc08a('0x29')]]={'$like':'%'+_0x4d3278['query'][_0xc08a('0x3d')]+'%'};return _0x40e8cb;}})});}_0x18ae4b=_[_0xc08a('0x3e')]({},_0x18ae4b,_0x4d3278['options']);var _0x371de0={'where':_0x18ae4b[_0xc08a('0x3b')]};return db[_0xc08a('0x2d')][_0xc08a('0x1c')](_0x371de0)[_0xc08a('0x25')](function(_0x2a2a59){_0x1068ea[_0xc08a('0x1c')]=_0x2a2a59;if(_0x4d3278[_0xc08a('0x31')][_0xc08a('0x40')]){_0x18ae4b[_0xc08a('0x41')]=[{'all':!![]}];}return db[_0xc08a('0x2d')][_0xc08a('0x42')](_0x18ae4b);})[_0xc08a('0x25')](function(_0x3fa1b1){_0x1068ea['rows']=_0x3fa1b1;return _0x1068ea;})['then'](respondWithFilteredResult(_0x2e54fe,_0x18ae4b))['catch'](handleError(_0x2e54fe,null));};exports[_0xc08a('0x43')]=function(_0x131bf4,_0x425152){var _0x58496c={'raw':!![],'where':{'id':_0x131bf4[_0xc08a('0x44')]['id']}},_0x56455b={};_0x56455b[_0xc08a('0x34')]=_[_0xc08a('0x45')](db[_0xc08a('0x2d')][_0xc08a('0x2e')]);_0x56455b[_0xc08a('0x31')]=_['keys'](_0x131bf4[_0xc08a('0x31')]);_0x56455b[_0xc08a('0x32')]=_['intersection'](_0x56455b[_0xc08a('0x34')],_0x56455b[_0xc08a('0x31')]);_0x58496c[_0xc08a('0x35')]=_['intersection'](_0x56455b['model'],qs[_0xc08a('0x36')](_0x131bf4[_0xc08a('0x31')]['fields']));_0x58496c[_0xc08a('0x35')]=_0x58496c[_0xc08a('0x35')][_0xc08a('0x37')]?_0x58496c[_0xc08a('0x35')]:_0x56455b[_0xc08a('0x34')];if(_0x131bf4[_0xc08a('0x31')][_0xc08a('0x40')]){_0x58496c[_0xc08a('0x41')]=[{'all':!![]}];}_0x58496c=_[_0xc08a('0x3e')]({},_0x58496c,_0x131bf4[_0xc08a('0x46')]);return db[_0xc08a('0x2d')]['find'](_0x58496c)[_0xc08a('0x25')](handleEntityNotFound(_0x425152,null))[_0xc08a('0x25')](respondWithResult(_0x425152,null))[_0xc08a('0x47')](handleError(_0x425152,null));};exports[_0xc08a('0x48')]=function(_0x181e73,_0x3e4ca5){return db[_0xc08a('0x2d')]['create'](_0x181e73[_0xc08a('0x49')],{})[_0xc08a('0x25')](respondWithResult(_0x3e4ca5,0xc9))[_0xc08a('0x47')](handleError(_0x3e4ca5,null));};exports[_0xc08a('0x24')]=function(_0x1d2ac3,_0x9d627){if(_0x1d2ac3[_0xc08a('0x49')]['id']){delete _0x1d2ac3['body']['id'];}return db[_0xc08a('0x2d')][_0xc08a('0x4a')]({'where':{'id':_0x1d2ac3[_0xc08a('0x44')]['id']}})[_0xc08a('0x25')](handleEntityNotFound(_0x9d627,null))['then'](saveUpdates(_0x1d2ac3[_0xc08a('0x49')],null))[_0xc08a('0x25')](respondWithResult(_0x9d627,null))[_0xc08a('0x47')](handleError(_0x9d627,null));};exports[_0xc08a('0x4b')]=function(_0x5852e2,_0x58f121){return db[_0xc08a('0x2d')][_0xc08a('0x4a')]({'where':{'id':_0x5852e2[_0xc08a('0x44')]['id']}})[_0xc08a('0x25')](handleEntityNotFound(_0x58f121,null))['then'](removeEntity(_0x58f121,null))[_0xc08a('0x47')](handleError(_0x58f121,null));}; \ No newline at end of file +var _0x1dc4=['end','status','json','offset','limit','undefined','count','set','apply','update','destroy','then','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','CloudProvider','includeAll','include','findAll','rows','catch','show','params','fields','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x24e543,_0x176a21){var _0x1fe2e4=function(_0x5d32fd){while(--_0x5d32fd){_0x24e543['push'](_0x24e543['shift']());}};_0x1fe2e4(++_0x176a21);}(_0x1dc4,0x15f));var _0x41dc=function(_0xc00012,_0x3b9858){_0xc00012=_0xc00012-0x0;var _0x38b822=_0x1dc4[_0xc00012];return _0x38b822;};'use strict';var emlformat=require(_0x41dc('0x0'));var rimraf=require(_0x41dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x41dc('0x2'));var rp=require(_0x41dc('0x3'));var moment=require(_0x41dc('0x4'));var BPromise=require(_0x41dc('0x5'));var Mustache=require(_0x41dc('0x6'));var util=require(_0x41dc('0x7'));var path=require('path');var sox=require(_0x41dc('0x8'));var csv=require(_0x41dc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x41dc('0xa'));var _=require(_0x41dc('0xb'));var squel=require(_0x41dc('0xc'));var crypto=require(_0x41dc('0xd'));var jsforce=require(_0x41dc('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x41dc('0xf'));var Redis=require(_0x41dc('0x10'));var authService=require(_0x41dc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x41dc('0x12'));var hardwareService=require(_0x41dc('0x13'));var logger=require(_0x41dc('0x14'))('api');var utils=require(_0x41dc('0x15'));var config=require(_0x41dc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x41dc('0x17'))['db'];function respondWithStatusCode(_0x5d2299,_0x1646d4){_0x1646d4=_0x1646d4||0xcc;return function(_0x422a57){if(_0x422a57){return _0x5d2299['sendStatus'](_0x1646d4);}return _0x5d2299['status'](_0x1646d4)[_0x41dc('0x18')]();};}function respondWithResult(_0x1d23d8,_0x3825ed){_0x3825ed=_0x3825ed||0xc8;return function(_0x4ede27){if(_0x4ede27){return _0x1d23d8[_0x41dc('0x19')](_0x3825ed)[_0x41dc('0x1a')](_0x4ede27);}};}function respondWithFilteredResult(_0x4b865a,_0x585f5c){return function(_0x5b3323){if(_0x5b3323){var _0x306462=typeof _0x585f5c[_0x41dc('0x1b')]==='undefined'&&typeof _0x585f5c[_0x41dc('0x1c')]===_0x41dc('0x1d');var _0x40f237=_0x5b3323[_0x41dc('0x1e')];var _0x4867cd=_0x306462?0x0:_0x585f5c['offset'];var _0x135b73=_0x306462?_0x5b3323[_0x41dc('0x1e')]:_0x585f5c[_0x41dc('0x1b')]+_0x585f5c[_0x41dc('0x1c')];var _0x402d70;if(_0x135b73>=_0x40f237){_0x135b73=_0x40f237;_0x402d70=0xc8;}else{_0x402d70=0xce;}_0x4b865a[_0x41dc('0x19')](_0x402d70);return _0x4b865a[_0x41dc('0x1f')]('Content-Range',_0x4867cd+'-'+_0x135b73+'/'+_0x40f237)[_0x41dc('0x1a')](_0x5b3323);}return null;};}function patchUpdates(_0x296906){return function(_0x44c285){try{jsonpatch[_0x41dc('0x20')](_0x44c285,_0x296906,!![]);}catch(_0x16615f){return BPromise['reject'](_0x16615f);}return _0x44c285['save']();};}function saveUpdates(_0x40bbe8,_0x40b567){return function(_0x49a506){if(_0x49a506){return _0x49a506[_0x41dc('0x21')](_0x40bbe8)['then'](function(_0x22d4d4){return _0x22d4d4;});}return null;};}function removeEntity(_0x522e00,_0x38f71b){return function(_0x5ee010){if(_0x5ee010){return _0x5ee010[_0x41dc('0x22')]()[_0x41dc('0x23')](function(){_0x522e00[_0x41dc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x229f2d,_0xd892ce){return function(_0x2e36ba){if(!_0x2e36ba){_0x229f2d[_0x41dc('0x24')](0x194);}return _0x2e36ba;};}function handleError(_0x4f5c4a,_0x3d85ca){_0x3d85ca=_0x3d85ca||0x1f4;return function(_0x51991a){logger['error'](_0x51991a[_0x41dc('0x25')]);if(_0x51991a[_0x41dc('0x26')]){delete _0x51991a[_0x41dc('0x26')];}_0x4f5c4a[_0x41dc('0x19')](_0x3d85ca)[_0x41dc('0x27')](_0x51991a);};}exports[_0x41dc('0x28')]=function(_0xe89f4a,_0x4ca605){var _0x2e4e3a={},_0x2e67da={},_0xc6b1c1={'count':0x0,'rows':[]};var _0x1d41ff=_['map'](db['CloudProvider'][_0x41dc('0x29')],function(_0x478bfc){return{'name':_0x478bfc[_0x41dc('0x2a')],'type':_0x478bfc[_0x41dc('0x2b')][_0x41dc('0x2c')]};});_0x2e67da[_0x41dc('0x2d')]=_['map'](_0x1d41ff,'name');_0x2e67da['query']=_[_0x41dc('0x2e')](_0xe89f4a[_0x41dc('0x2f')]);_0x2e67da[_0x41dc('0x30')]=_[_0x41dc('0x31')](_0x2e67da[_0x41dc('0x2d')],_0x2e67da[_0x41dc('0x2f')]);_0x2e4e3a[_0x41dc('0x32')]=_[_0x41dc('0x31')](_0x2e67da[_0x41dc('0x2d')],qs['fields'](_0xe89f4a['query']['fields']));_0x2e4e3a[_0x41dc('0x32')]=_0x2e4e3a[_0x41dc('0x32')]['length']?_0x2e4e3a['attributes']:_0x2e67da[_0x41dc('0x2d')];if(!_0xe89f4a[_0x41dc('0x2f')][_0x41dc('0x33')](_0x41dc('0x34'))){_0x2e4e3a[_0x41dc('0x1c')]=qs[_0x41dc('0x1c')](_0xe89f4a[_0x41dc('0x2f')][_0x41dc('0x1c')]);_0x2e4e3a[_0x41dc('0x1b')]=qs[_0x41dc('0x1b')](_0xe89f4a[_0x41dc('0x2f')][_0x41dc('0x1b')]);}_0x2e4e3a[_0x41dc('0x35')]=qs[_0x41dc('0x36')](_0xe89f4a[_0x41dc('0x2f')][_0x41dc('0x36')]);_0x2e4e3a[_0x41dc('0x37')]=qs[_0x41dc('0x30')](_[_0x41dc('0x38')](_0xe89f4a[_0x41dc('0x2f')],_0x2e67da[_0x41dc('0x30')]),_0x1d41ff);if(_0xe89f4a[_0x41dc('0x2f')][_0x41dc('0x39')]){_0x2e4e3a['where']=_['merge'](_0x2e4e3a['where'],{'$or':_[_0x41dc('0x3a')](_0x1d41ff,function(_0x1c545c){if(_0x1c545c['type']!==_0x41dc('0x3b')){var _0x379d12={};_0x379d12[_0x1c545c[_0x41dc('0x26')]]={'$like':'%'+_0xe89f4a['query'][_0x41dc('0x39')]+'%'};return _0x379d12;}})});}_0x2e4e3a=_[_0x41dc('0x3c')]({},_0x2e4e3a,_0xe89f4a[_0x41dc('0x3d')]);var _0x2cf57c={'where':_0x2e4e3a[_0x41dc('0x37')]};return db[_0x41dc('0x3e')]['count'](_0x2cf57c)[_0x41dc('0x23')](function(_0x522b94){_0xc6b1c1[_0x41dc('0x1e')]=_0x522b94;if(_0xe89f4a[_0x41dc('0x2f')][_0x41dc('0x3f')]){_0x2e4e3a[_0x41dc('0x40')]=[{'all':!![]}];}return db['CloudProvider'][_0x41dc('0x41')](_0x2e4e3a);})[_0x41dc('0x23')](function(_0x485c2c){_0xc6b1c1[_0x41dc('0x42')]=_0x485c2c;return _0xc6b1c1;})[_0x41dc('0x23')](respondWithFilteredResult(_0x4ca605,_0x2e4e3a))[_0x41dc('0x43')](handleError(_0x4ca605,null));};exports[_0x41dc('0x44')]=function(_0x425221,_0x1e079a){var _0x583faa={'raw':!![],'where':{'id':_0x425221[_0x41dc('0x45')]['id']}},_0x1557ba={};_0x1557ba['model']=_['keys'](db[_0x41dc('0x3e')][_0x41dc('0x29')]);_0x1557ba['query']=_[_0x41dc('0x2e')](_0x425221['query']);_0x1557ba[_0x41dc('0x30')]=_[_0x41dc('0x31')](_0x1557ba['model'],_0x1557ba[_0x41dc('0x2f')]);_0x583faa['attributes']=_[_0x41dc('0x31')](_0x1557ba['model'],qs[_0x41dc('0x46')](_0x425221[_0x41dc('0x2f')][_0x41dc('0x46')]));_0x583faa[_0x41dc('0x32')]=_0x583faa['attributes'][_0x41dc('0x47')]?_0x583faa[_0x41dc('0x32')]:_0x1557ba[_0x41dc('0x2d')];if(_0x425221[_0x41dc('0x2f')][_0x41dc('0x3f')]){_0x583faa[_0x41dc('0x40')]=[{'all':!![]}];}_0x583faa=_[_0x41dc('0x3c')]({},_0x583faa,_0x425221[_0x41dc('0x3d')]);return db['CloudProvider'][_0x41dc('0x48')](_0x583faa)['then'](handleEntityNotFound(_0x1e079a,null))[_0x41dc('0x23')](respondWithResult(_0x1e079a,null))[_0x41dc('0x43')](handleError(_0x1e079a,null));};exports[_0x41dc('0x49')]=function(_0x2cdbcd,_0xe036ce){return db[_0x41dc('0x3e')][_0x41dc('0x49')](_0x2cdbcd[_0x41dc('0x4a')],{})['then'](respondWithResult(_0xe036ce,0xc9))[_0x41dc('0x43')](handleError(_0xe036ce,null));};exports[_0x41dc('0x21')]=function(_0x10f9ec,_0x304cfe){if(_0x10f9ec[_0x41dc('0x4a')]['id']){delete _0x10f9ec[_0x41dc('0x4a')]['id'];}return db[_0x41dc('0x3e')][_0x41dc('0x48')]({'where':{'id':_0x10f9ec[_0x41dc('0x45')]['id']}})[_0x41dc('0x23')](handleEntityNotFound(_0x304cfe,null))['then'](saveUpdates(_0x10f9ec[_0x41dc('0x4a')],null))[_0x41dc('0x23')](respondWithResult(_0x304cfe,null))['catch'](handleError(_0x304cfe,null));};exports['destroy']=function(_0x1e5ea5,_0x42c3c9){return db[_0x41dc('0x3e')]['find']({'where':{'id':_0x1e5ea5[_0x41dc('0x45')]['id']}})[_0x41dc('0x23')](handleEntityNotFound(_0x42c3c9,null))[_0x41dc('0x23')](removeEntity(_0x42c3c9,null))[_0x41dc('0x43')](handleError(_0x42c3c9,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 8e65c3c..3cf4bf1 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0411=['./cloudProvider.attributes','CloudProvider','cloud_providers','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x91120b,_0x12ea29){var _0x40e280=function(_0x1f8d28){while(--_0x1f8d28){_0x91120b['push'](_0x91120b['shift']());}};_0x40e280(++_0x12ea29);}(_0x0411,0x1b3));var _0x1041=function(_0x296588,_0x49f98d){_0x296588=_0x296588-0x0;var _0x2f6d92=_0x0411[_0x296588];return _0x2f6d92;};'use strict';var _=require(_0x1041('0x0'));var util=require(_0x1041('0x1'));var logger=require('../../config/logger')(_0x1041('0x2'));var moment=require(_0x1041('0x3'));var BPromise=require(_0x1041('0x4'));var rp=require(_0x1041('0x5'));var fs=require('fs');var path=require(_0x1041('0x6'));var rimraf=require(_0x1041('0x7'));var config=require(_0x1041('0x8'));var attributes=require(_0x1041('0x9'));module['exports']=function(_0x1d848c,_0x26f44b){return _0x1d848c['define'](_0x1041('0xa'),attributes,{'tableName':_0x1041('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3670=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x33caa4,_0x32a082){var _0x2a7e75=function(_0x1cc036){while(--_0x1cc036){_0x33caa4['push'](_0x33caa4['shift']());}};_0x2a7e75(++_0x32a082);}(_0x3670,0xcc));var _0x0367=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3670[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0367('0x0'));var util=require(_0x0367('0x1'));var logger=require(_0x0367('0x2'))('api');var moment=require(_0x0367('0x3'));var BPromise=require(_0x0367('0x4'));var rp=require(_0x0367('0x5'));var fs=require('fs');var path=require(_0x0367('0x6'));var rimraf=require(_0x0367('0x7'));var config=require(_0x0367('0x8'));var attributes=require(_0x0367('0x9'));module[_0x0367('0xa')]=function(_0x4f61ab,_0x538512){return _0x4f61ab[_0x0367('0xb')](_0x0367('0xc'),attributes,{'tableName':_0x0367('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 46ea807..b916d54 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x664f=['jayson/promise','client','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5c9f56,_0x42c9ad){var _0x2a726b=function(_0x4a13cd){while(--_0x4a13cd){_0x5c9f56['push'](_0x5c9f56['shift']());}};_0x2a726b(++_0x42c9ad);}(_0x664f,0x186));var _0xf664=function(_0x452450,_0x40b419){_0x452450=_0x452450-0x0;var _0x448b19=_0x664f[_0x452450];return _0x448b19;};'use strict';var _=require(_0xf664('0x0'));var util=require(_0xf664('0x1'));var moment=require(_0xf664('0x2'));var BPromise=require('bluebird');var rs=require(_0xf664('0x3'));var fs=require('fs');var Redis=require(_0xf664('0x4'));var db=require(_0xf664('0x5'))['db'];var utils=require(_0xf664('0x6'));var logger=require(_0xf664('0x7'))(_0xf664('0x8'));var config=require(_0xf664('0x9'));var jayson=require(_0xf664('0xa'));var client=jayson[_0xf664('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2efec0,_0x2e3fe0,_0x1fd747){return new BPromise(function(_0x200697,_0x4b6073){return client[_0xf664('0xc')](_0x2efec0,_0x1fd747)[_0xf664('0xd')](function(_0x615664){logger[_0xf664('0xe')]('CloudProvider,\x20%s,\x20%s',_0x2e3fe0,_0xf664('0xf'));logger[_0xf664('0x10')](_0xf664('0x11'),_0x2e3fe0,_0xf664('0xf'),JSON[_0xf664('0x12')](_0x615664));if(_0x615664[_0xf664('0x13')]){if(_0x615664[_0xf664('0x13')][_0xf664('0x14')]===0x1f4){logger[_0xf664('0x13')](_0xf664('0x15'),_0x2e3fe0,_0x615664[_0xf664('0x13')][_0xf664('0x16')]);return _0x4b6073(_0x615664[_0xf664('0x13')][_0xf664('0x16')]);}logger['error'](_0xf664('0x15'),_0x2e3fe0,_0x615664['error'][_0xf664('0x16')]);return _0x200697(_0x615664[_0xf664('0x13')][_0xf664('0x16')]);}else{logger['info'](_0xf664('0x15'),_0x2e3fe0,_0xf664('0xf'));_0x200697(_0x615664[_0xf664('0x17')]['message']);}})[_0xf664('0x18')](function(_0x20e582){logger[_0xf664('0x13')](_0xf664('0x15'),_0x2e3fe0,_0x20e582);_0x4b6073(_0x20e582);});});} \ No newline at end of file +var _0x8911=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x413562,_0x54a96d){var _0x59565c=function(_0x396616){while(--_0x396616){_0x413562['push'](_0x413562['shift']());}};_0x59565c(++_0x54a96d);}(_0x8911,0xf6));var _0x1891=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8911[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1891('0x0'));var util=require(_0x1891('0x1'));var moment=require(_0x1891('0x2'));var BPromise=require(_0x1891('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1891('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1891('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1891('0x6'));var jayson=require(_0x1891('0x7'));var client=jayson[_0x1891('0x8')][_0x1891('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21155b,_0x121eca,_0x325313){return new BPromise(function(_0x13d0b8,_0x3af78a){return client[_0x1891('0xa')](_0x21155b,_0x325313)[_0x1891('0xb')](function(_0x4515ad){logger[_0x1891('0xc')]('CloudProvider,\x20%s,\x20%s',_0x121eca,_0x1891('0xd'));logger[_0x1891('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x121eca,_0x1891('0xd'),JSON[_0x1891('0xf')](_0x4515ad));if(_0x4515ad['error']){if(_0x4515ad[_0x1891('0x10')]['code']===0x1f4){logger[_0x1891('0x10')](_0x1891('0x11'),_0x121eca,_0x4515ad[_0x1891('0x10')][_0x1891('0x12')]);return _0x3af78a(_0x4515ad[_0x1891('0x10')][_0x1891('0x12')]);}logger[_0x1891('0x10')](_0x1891('0x11'),_0x121eca,_0x4515ad['error'][_0x1891('0x12')]);return _0x13d0b8(_0x4515ad[_0x1891('0x10')][_0x1891('0x12')]);}else{logger[_0x1891('0xc')]('CloudProvider,\x20%s,\x20%s',_0x121eca,'request\x20sent');_0x13d0b8(_0x4515ad[_0x1891('0x13')][_0x1891('0x12')]);}})[_0x1891('0x14')](function(_0x457489){logger[_0x1891('0x10')](_0x1891('0x11'),_0x121eca,_0x457489);_0x3af78a(_0x457489);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 7a6ce94..c578efe 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18ca=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','show','create','put','/:id','update'];(function(_0x46c6e4,_0x211abf){var _0x1ad288=function(_0x17826d){while(--_0x17826d){_0x46c6e4['push'](_0x46c6e4['shift']());}};_0x1ad288(++_0x211abf);}(_0x18ca,0x146));var _0xa18c=function(_0x1ec375,_0x314f89){_0x1ec375=_0x1ec375-0x0;var _0x5cb903=_0x18ca[_0x1ec375];return _0x5cb903;};'use strict';var multer=require(_0xa18c('0x0'));var util=require('util');var path=require(_0xa18c('0x1'));var timeout=require(_0xa18c('0x2'));var express=require(_0xa18c('0x3'));var router=express[_0xa18c('0x4')]();var fs_extra=require(_0xa18c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa18c('0x6'));var config=require(_0xa18c('0x7'));var controller=require(_0xa18c('0x8'));router[_0xa18c('0x9')]('/',auth[_0xa18c('0xa')](),controller['index']);router[_0xa18c('0x9')]('/:id',auth[_0xa18c('0xa')](),controller[_0xa18c('0xb')]);router['post']('/',auth[_0xa18c('0xa')](),controller[_0xa18c('0xc')]);router[_0xa18c('0xd')](_0xa18c('0xe'),auth[_0xa18c('0xa')](),controller[_0xa18c('0xf')]);router[_0xa18c('0x10')](_0xa18c('0xe'),auth['isAuthenticated'](),controller[_0xa18c('0x11')]);module[_0xa18c('0x12')]=router; \ No newline at end of file +var _0xfbe4=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','post','create','/:id','update','delete','exports'];(function(_0x2962e4,_0xc25e04){var _0x38a4a9=function(_0x5b0570){while(--_0x5b0570){_0x2962e4['push'](_0x2962e4['shift']());}};_0x38a4a9(++_0xc25e04);}(_0xfbe4,0xdd));var _0x4fbe=function(_0x3f6f0f,_0xa4c916){_0x3f6f0f=_0x3f6f0f-0x0;var _0x47a325=_0xfbe4[_0x3f6f0f];return _0x47a325;};'use strict';var multer=require(_0x4fbe('0x0'));var util=require(_0x4fbe('0x1'));var path=require(_0x4fbe('0x2'));var timeout=require(_0x4fbe('0x3'));var express=require(_0x4fbe('0x4'));var router=express[_0x4fbe('0x5')]();var fs_extra=require(_0x4fbe('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4fbe('0x7'));var config=require(_0x4fbe('0x8'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0x4fbe('0x9')](),controller[_0x4fbe('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4fbe('0xb')]('/',auth['isAuthenticated'](),controller[_0x4fbe('0xc')]);router['put'](_0x4fbe('0xd'),auth[_0x4fbe('0x9')](),controller[_0x4fbe('0xe')]);router[_0x4fbe('0xf')](_0x4fbe('0xd'),auth[_0x4fbe('0x9')](),controller['destroy']);module[_0x4fbe('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index e159ca4..2ab145f 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 _0xe4c1=['name','STRING','sequelize','exports'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xe4c1,0x8e));var _0x1e4c=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xe4c1[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require(_0x1e4c('0x0'));module[_0x1e4c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1e4c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x1e4c('0x3')]},'phone':{'type':Sequelize[_0x1e4c('0x3')]},'fax':{'type':Sequelize[_0x1e4c('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x1e4c('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1e4c('0x3')]},'country':{'type':Sequelize[_0x1e4c('0x3')]},'email':{'type':Sequelize[_0x1e4c('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1e4c('0x3')]},'sStreet':{'type':Sequelize[_0x1e4c('0x3')]},'sPostalCode':{'type':Sequelize[_0x1e4c('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x1e4c('0x3')]},'description':{'type':Sequelize[_0x1e4c('0x3')]}}; \ No newline at end of file +var _0x2faa=['name','sequelize','exports','STRING'];(function(_0x9fc76c,_0x1daf20){var _0xcd6ded=function(_0x374343){while(--_0x374343){_0x9fc76c['push'](_0x9fc76c['shift']());}};_0xcd6ded(++_0x1daf20);}(_0x2faa,0x115));var _0xa2fa=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2faa[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xa2fa('0x0'));module[_0xa2fa('0x1')]={'name':{'type':Sequelize[_0xa2fa('0x2')],'unique':_0xa2fa('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xa2fa('0x2')]},'website':{'type':Sequelize[_0xa2fa('0x2')]},'phone':{'type':Sequelize[_0xa2fa('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xa2fa('0x2')]},'postalCode':{'type':Sequelize[_0xa2fa('0x2')]},'city':{'type':Sequelize[_0xa2fa('0x2')]},'country':{'type':Sequelize[_0xa2fa('0x2')]},'email':{'type':Sequelize[_0xa2fa('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa2fa('0x2')]},'sStreet':{'type':Sequelize[_0xa2fa('0x2')]},'sPostalCode':{'type':Sequelize[_0xa2fa('0x2')]},'sCity':{'type':Sequelize[_0xa2fa('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa2fa('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 76a1f91..a29ba7f 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 _0xb7e7=['catch','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addContacts','CmContact','omit','ids','findOne','options','getContacts','eml-format','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','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','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','destroy','error','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge','includeAll','include','findAll','rows'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xb7e7[_0x42bc91];return _0x3f5507;};'use strict';var emlformat=require(_0x7b7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b7e('0x2'));var moment=require('moment');var BPromise=require(_0x7b7e('0x3'));var Mustache=require('mustache');var util=require(_0x7b7e('0x4'));var path=require(_0x7b7e('0x5'));var sox=require(_0x7b7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b7e('0x7'));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 licenseUtil=require(_0x7b7e('0x17'));var db=require(_0x7b7e('0x18'))['db'];function respondWithStatusCode(_0xaadda,_0x54d8ce){_0x54d8ce=_0x54d8ce||0xcc;return function(_0x267446){if(_0x267446){return _0xaadda[_0x7b7e('0x19')](_0x54d8ce);}return _0xaadda['status'](_0x54d8ce)[_0x7b7e('0x1a')]();};}function respondWithResult(_0x5976ac,_0x4c6011){_0x4c6011=_0x4c6011||0xc8;return function(_0x2889ed){if(_0x2889ed){return _0x5976ac[_0x7b7e('0x1b')](_0x4c6011)[_0x7b7e('0x1c')](_0x2889ed);}};}function respondWithFilteredResult(_0x457ec5,_0x3d2fb2){return function(_0x5703fd){if(_0x5703fd){var _0x51baf6=typeof _0x3d2fb2[_0x7b7e('0x1d')]===_0x7b7e('0x1e')&&typeof _0x3d2fb2[_0x7b7e('0x1f')]===_0x7b7e('0x1e');var _0x2cc400=_0x5703fd[_0x7b7e('0x20')];var _0x242368=_0x51baf6?0x0:_0x3d2fb2[_0x7b7e('0x1d')];var _0x2acb8c=_0x51baf6?_0x5703fd[_0x7b7e('0x20')]:_0x3d2fb2[_0x7b7e('0x1d')]+_0x3d2fb2[_0x7b7e('0x1f')];var _0x448980;if(_0x2acb8c>=_0x2cc400){_0x2acb8c=_0x2cc400;_0x448980=0xc8;}else{_0x448980=0xce;}_0x457ec5[_0x7b7e('0x1b')](_0x448980);return _0x457ec5[_0x7b7e('0x21')](_0x7b7e('0x22'),_0x242368+'-'+_0x2acb8c+'/'+_0x2cc400)[_0x7b7e('0x1c')](_0x5703fd);}return null;};}function patchUpdates(_0x49eddb){return function(_0x69262b){try{jsonpatch[_0x7b7e('0x23')](_0x69262b,_0x49eddb,!![]);}catch(_0x24718c){return BPromise['reject'](_0x24718c);}return _0x69262b[_0x7b7e('0x24')]();};}function saveUpdates(_0xbf0cb3,_0x14243b){return function(_0x200156){if(_0x200156){return _0x200156[_0x7b7e('0x25')](_0xbf0cb3)[_0x7b7e('0x26')](function(_0x28bf43){return _0x28bf43;});}return null;};}function removeEntity(_0x10a66a,_0x53bbb3){return function(_0x5d6215){if(_0x5d6215){return _0x5d6215['destroy']()[_0x7b7e('0x26')](function(){var _0x22598e=_0x5d6215[_0x7b7e('0x27')]({'plain':!![]});var _0x483c6f='Companies';return db['UserProfileResource'][_0x7b7e('0x28')]({'where':{'type':_0x483c6f,'resourceId':_0x22598e['id']}})[_0x7b7e('0x26')](function(){return _0x5d6215;});})[_0x7b7e('0x26')](function(){_0x10a66a[_0x7b7e('0x1b')](0xcc)[_0x7b7e('0x1a')]();});}};}function handleEntityNotFound(_0x48fad1,_0x6a1e71){return function(_0x21a15){if(!_0x21a15){_0x48fad1['sendStatus'](0x194);}return _0x21a15;};}function handleError(_0x57b9da,_0x4e5de7){_0x4e5de7=_0x4e5de7||0x1f4;return function(_0x12ef0b){logger[_0x7b7e('0x29')](_0x12ef0b['stack']);if(_0x12ef0b[_0x7b7e('0x2a')]){delete _0x12ef0b['name'];}_0x57b9da[_0x7b7e('0x1b')](_0x4e5de7)[_0x7b7e('0x2b')](_0x12ef0b);};}exports[_0x7b7e('0x2c')]=function(_0x5515ca,_0x3960b8){var _0xe31336={},_0x35602a={},_0x326dd2={'count':0x0,'rows':[]};return db[_0x7b7e('0x2d')]['describe']()[_0x7b7e('0x26')](function(_0x51c010){_0x35602a[_0x7b7e('0x2e')]=_[_0x7b7e('0x2f')](_0x51c010);_0x35602a[_0x7b7e('0x30')]=_[_0x7b7e('0x2f')](_0x5515ca[_0x7b7e('0x30')]);_0x35602a[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x35602a['model'],_0x35602a['query']);_0xe31336[_0x7b7e('0x33')]=_[_0x7b7e('0x32')](_0x35602a['model'],qs[_0x7b7e('0x34')](_0x5515ca[_0x7b7e('0x30')][_0x7b7e('0x34')]));_0xe31336['attributes']=_0xe31336[_0x7b7e('0x33')][_0x7b7e('0x35')]?_0xe31336[_0x7b7e('0x33')]:_0x35602a[_0x7b7e('0x2e')];if(!_0x5515ca[_0x7b7e('0x30')][_0x7b7e('0x36')](_0x7b7e('0x37'))){_0xe31336[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0x5515ca[_0x7b7e('0x30')][_0x7b7e('0x1f')]);_0xe31336[_0x7b7e('0x1d')]=qs[_0x7b7e('0x1d')](_0x5515ca[_0x7b7e('0x30')][_0x7b7e('0x1d')]);}_0xe31336[_0x7b7e('0x38')]=qs['sort'](_0x5515ca[_0x7b7e('0x30')][_0x7b7e('0x39')]);_0xe31336[_0x7b7e('0x3a')]=qs[_0x7b7e('0x31')](_[_0x7b7e('0x3b')](_0x5515ca[_0x7b7e('0x30')],_0x35602a[_0x7b7e('0x31')]),_0x51c010);if(_0x5515ca[_0x7b7e('0x30')][_0x7b7e('0x3c')]){_0xe31336[_0x7b7e('0x3a')]=_['merge'](_0xe31336[_0x7b7e('0x3a')],{'$or':_[_0x7b7e('0x3d')](_0xe31336[_0x7b7e('0x33')],function(_0x1d43da){var _0x5a5720={};_0x5a5720[_0x1d43da]={'$like':'%'+_0x5515ca[_0x7b7e('0x30')][_0x7b7e('0x3c')]+'%'};return _0x5a5720;})});}_0xe31336=_[_0x7b7e('0x3e')]({},_0xe31336,_0x5515ca['options']);var _0x4a2888={'where':_0xe31336[_0x7b7e('0x3a')]};return db['CmCompany'][_0x7b7e('0x20')](_0x4a2888)[_0x7b7e('0x26')](function(_0x4de331){_0x326dd2[_0x7b7e('0x20')]=_0x4de331;if(_0x5515ca[_0x7b7e('0x30')][_0x7b7e('0x3f')]){_0xe31336[_0x7b7e('0x40')]=[{'all':!![]}];}return db[_0x7b7e('0x2d')][_0x7b7e('0x41')](_0xe31336);})[_0x7b7e('0x26')](function(_0x1d9bb9){_0x326dd2[_0x7b7e('0x42')]=_0x1d9bb9;return _0x326dd2;})['then'](respondWithFilteredResult(_0x3960b8,_0xe31336))['catch'](handleError(_0x3960b8,null));})[_0x7b7e('0x43')](handleError(_0x3960b8,null));};exports['show']=function(_0x41c8a6,_0x5e8b5d){var _0x48dd74={'raw':![],'where':{'id':_0x41c8a6['params']['id']}},_0x356db0={};_0x356db0[_0x7b7e('0x2e')]=_['keys'](db[_0x7b7e('0x2d')][_0x7b7e('0x44')]);_0x356db0[_0x7b7e('0x30')]=_[_0x7b7e('0x2f')](_0x41c8a6['query']);_0x356db0[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x356db0[_0x7b7e('0x2e')],_0x356db0[_0x7b7e('0x30')]);_0x48dd74[_0x7b7e('0x33')]=_[_0x7b7e('0x32')](_0x356db0['model'],qs['fields'](_0x41c8a6['query'][_0x7b7e('0x34')]));_0x48dd74[_0x7b7e('0x33')]=_0x48dd74[_0x7b7e('0x33')][_0x7b7e('0x35')]?_0x48dd74[_0x7b7e('0x33')]:_0x356db0[_0x7b7e('0x2e')];if(_0x41c8a6['query'][_0x7b7e('0x3f')]){_0x48dd74[_0x7b7e('0x40')]=[{'all':!![]}];}_0x48dd74=_['merge']({},_0x48dd74,_0x41c8a6['options']);return db[_0x7b7e('0x2d')][_0x7b7e('0x45')](_0x48dd74)[_0x7b7e('0x26')](handleEntityNotFound(_0x5e8b5d,null))[_0x7b7e('0x26')](respondWithResult(_0x5e8b5d,null))[_0x7b7e('0x43')](handleError(_0x5e8b5d,null));};exports[_0x7b7e('0x46')]=function(_0x590154,_0x2673eb){return db['CmCompany'][_0x7b7e('0x46')](_0x590154[_0x7b7e('0x47')],{})[_0x7b7e('0x26')](function(_0x5874e2){var _0x58e4e6=_0x590154[_0x7b7e('0x48')][_0x7b7e('0x27')]({'plain':!![]});if(!_0x58e4e6)throw new Error(_0x7b7e('0x49'));if(_0x58e4e6[_0x7b7e('0x4a')]===_0x7b7e('0x48')){var _0x5cce7c=_0x5874e2[_0x7b7e('0x27')]({'plain':!![]});var _0x270c4a=_0x7b7e('0x4b');return db[_0x7b7e('0x4c')][_0x7b7e('0x45')]({'where':{'name':_0x270c4a,'userProfileId':_0x58e4e6['userProfileId']},'raw':!![]})[_0x7b7e('0x26')](function(_0x29024e){if(_0x29024e&&_0x29024e[_0x7b7e('0x4d')]===0x0){return db[_0x7b7e('0x4e')][_0x7b7e('0x46')]({'name':_0x5cce7c[_0x7b7e('0x2a')],'resourceId':_0x5cce7c['id'],'type':_0x29024e[_0x7b7e('0x2a')],'sectionId':_0x29024e['id']},{})['then'](function(){return _0x5874e2;});}else{return _0x5874e2;}})[_0x7b7e('0x43')](function(_0x5d7c89){logger[_0x7b7e('0x29')](_0x7b7e('0x4f'),_0x5d7c89);throw _0x5d7c89;});}return _0x5874e2;})['then'](respondWithResult(_0x2673eb,0xc9))[_0x7b7e('0x43')](handleError(_0x2673eb,null));};exports[_0x7b7e('0x25')]=function(_0x16c81d,_0x3afe88){if(_0x16c81d[_0x7b7e('0x47')]['id']){delete _0x16c81d[_0x7b7e('0x47')]['id'];}return db[_0x7b7e('0x2d')]['find']({'where':{'id':_0x16c81d[_0x7b7e('0x50')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x3afe88,null))[_0x7b7e('0x26')](saveUpdates(_0x16c81d[_0x7b7e('0x47')],null))['then'](respondWithResult(_0x3afe88,null))['catch'](handleError(_0x3afe88,null));};exports['destroy']=function(_0x2471ad,_0x41530f){return db[_0x7b7e('0x2d')]['find']({'where':{'id':_0x2471ad['params']['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x41530f,null))[_0x7b7e('0x26')](removeEntity(_0x41530f,null))['catch'](handleError(_0x41530f,null));};exports[_0x7b7e('0x51')]=function(_0xbe02ed,_0x44c30a){return db['CmCompany'][_0x7b7e('0x51')]()[_0x7b7e('0x26')](respondWithResult(_0x44c30a,null))['catch'](handleError(_0x44c30a,null));};exports[_0x7b7e('0x52')]=function(_0x441c3c,_0x1d7db1,_0x267aef){return db[_0x7b7e('0x53')][_0x7b7e('0x45')]({'where':{'id':_0x441c3c[_0x7b7e('0x50')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x1d7db1,null))[_0x7b7e('0x26')](function(_0x5509ad){if(_0x5509ad){return _0x5509ad[_0x7b7e('0x52')](_0x441c3c[_0x7b7e('0x47')]['ids'],_[_0x7b7e('0x54')](_0x441c3c[_0x7b7e('0x47')],[_0x7b7e('0x55'),'id'])||{});}})['then'](respondWithResult(_0x1d7db1,null))[_0x7b7e('0x43')](handleError(_0x1d7db1,null));};exports['getContacts']=function(_0x50c544,_0x206ee7,_0x51aa97){var _0x2a17c7={};var _0x3b3168={};var _0x561158;var _0x2dcb35;return db[_0x7b7e('0x2d')][_0x7b7e('0x56')]({'where':{'id':_0x50c544[_0x7b7e('0x50')]['id']}})['then'](handleEntityNotFound(_0x206ee7,null))[_0x7b7e('0x26')](function(_0x73904d){if(_0x73904d){_0x561158=_0x73904d;_0x3b3168[_0x7b7e('0x2e')]=_[_0x7b7e('0x2f')](db[_0x7b7e('0x53')][_0x7b7e('0x44')]);_0x3b3168[_0x7b7e('0x30')]=_[_0x7b7e('0x2f')](_0x50c544[_0x7b7e('0x30')]);_0x3b3168[_0x7b7e('0x31')]=_['intersection'](_0x3b3168[_0x7b7e('0x2e')],_0x3b3168['query']);_0x2a17c7['attributes']=_[_0x7b7e('0x32')](_0x3b3168[_0x7b7e('0x2e')],qs[_0x7b7e('0x34')](_0x50c544[_0x7b7e('0x30')]['fields']));_0x2a17c7[_0x7b7e('0x33')]=_0x2a17c7[_0x7b7e('0x33')][_0x7b7e('0x35')]?_0x2a17c7[_0x7b7e('0x33')]:_0x3b3168[_0x7b7e('0x2e')];_0x2a17c7[_0x7b7e('0x38')]=qs['sort'](_0x50c544[_0x7b7e('0x30')]['sort']);_0x2a17c7['where']=qs[_0x7b7e('0x31')](_['pick'](_0x50c544[_0x7b7e('0x30')],_0x3b3168['filters']));if(_0x50c544[_0x7b7e('0x30')][_0x7b7e('0x3c')]){_0x2a17c7['where']=_[_0x7b7e('0x3e')](_0x2a17c7[_0x7b7e('0x3a')],{'$or':_['map'](_0x2a17c7[_0x7b7e('0x33')],function(_0x27a552){var _0x50184c={};_0x50184c[_0x27a552]={'$like':'%'+_0x50c544[_0x7b7e('0x30')][_0x7b7e('0x3c')]+'%'};return _0x50184c;})});}_0x2a17c7=_[_0x7b7e('0x3e')]({},_0x2a17c7,_0x50c544[_0x7b7e('0x57')]);return _0x561158[_0x7b7e('0x58')](_0x2a17c7);}})[_0x7b7e('0x26')](function(_0x17e5ba){if(_0x17e5ba){_0x2dcb35=_0x17e5ba['length'];if(!_0x50c544['query'][_0x7b7e('0x36')](_0x7b7e('0x37'))){_0x2a17c7[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0x50c544[_0x7b7e('0x30')][_0x7b7e('0x1f')]);_0x2a17c7[_0x7b7e('0x1d')]=qs['offset'](_0x50c544[_0x7b7e('0x30')][_0x7b7e('0x1d')]);}return _0x561158['getContacts'](_0x2a17c7);}})[_0x7b7e('0x26')](function(_0x3f8162){if(_0x3f8162){return _0x3f8162?{'count':_0x2dcb35,'rows':_0x3f8162}:null;}})[_0x7b7e('0x26')](respondWithResult(_0x206ee7,null))[_0x7b7e('0x43')](handleError(_0x206ee7,null));}; \ No newline at end of file +var _0x5f66=['nolimit','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','Companies','UserProfileResource','name','send','index','CmCompany','describe','model','keys','query','filters','attributes','fields','hasOwnProperty','where','pick','merge','map','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addContacts','CmContact','ids','getContacts','order','sort'];(function(_0x49ddc0,_0x39c3b5){var _0x3f5302=function(_0x580734){while(--_0x580734){_0x49ddc0['push'](_0x49ddc0['shift']());}};_0x3f5302(++_0x39c3b5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');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('0x7'));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 licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){var _0x2774a1=_0x1eeaaa['get']({'plain':!![]});var _0x9d7bb0=_0x65f6('0x22');return db[_0x65f6('0x23')]['destroy']({'where':{'type':_0x9d7bb0,'resourceId':_0x2774a1['id']}})['then'](function(){return _0x1eeaaa;});})['then'](function(){_0xd173f4[_0x65f6('0x15')](0xcc)[_0x65f6('0x16')]();});}};}function handleEntityNotFound(_0x4b2292,_0x296cd9){return function(_0x28f710){if(!_0x28f710){_0x4b2292['sendStatus'](0x194);}return _0x28f710;};}function handleError(_0x325cb4,_0x2bff2b){_0x2bff2b=_0x2bff2b||0x1f4;return function(_0x28d0df){logger['error'](_0x28d0df['stack']);if(_0x28d0df['name']){delete _0x28d0df[_0x65f6('0x24')];}_0x325cb4[_0x65f6('0x15')](_0x2bff2b)[_0x65f6('0x25')](_0x28d0df);};}exports[_0x65f6('0x26')]=function(_0x518cac,_0x14a387){var _0x144e55={},_0x4ace4c={},_0x4ea23d={'count':0x0,'rows':[]};return db[_0x65f6('0x27')][_0x65f6('0x28')]()['then'](function(_0x4e50c0){_0x4ace4c[_0x65f6('0x29')]=_[_0x65f6('0x2a')](_0x4e50c0);_0x4ace4c[_0x65f6('0x2b')]=_[_0x65f6('0x2a')](_0x518cac[_0x65f6('0x2b')]);_0x4ace4c[_0x65f6('0x2c')]=_['intersection'](_0x4ace4c[_0x65f6('0x29')],_0x4ace4c[_0x65f6('0x2b')]);_0x144e55[_0x65f6('0x2d')]=_['intersection'](_0x4ace4c[_0x65f6('0x29')],qs[_0x65f6('0x2e')](_0x518cac[_0x65f6('0x2b')][_0x65f6('0x2e')]));_0x144e55[_0x65f6('0x2d')]=_0x144e55[_0x65f6('0x2d')]['length']?_0x144e55[_0x65f6('0x2d')]:_0x4ace4c[_0x65f6('0x29')];if(!_0x518cac['query'][_0x65f6('0x2f')]('nolimit')){_0x144e55[_0x65f6('0x19')]=qs['limit'](_0x518cac[_0x65f6('0x2b')][_0x65f6('0x19')]);_0x144e55['offset']=qs[_0x65f6('0x1b')](_0x518cac[_0x65f6('0x2b')][_0x65f6('0x1b')]);}_0x144e55['order']=qs['sort'](_0x518cac[_0x65f6('0x2b')]['sort']);_0x144e55[_0x65f6('0x30')]=qs['filters'](_[_0x65f6('0x31')](_0x518cac[_0x65f6('0x2b')],_0x4ace4c['filters']),_0x4e50c0);if(_0x518cac[_0x65f6('0x2b')]['filter']){_0x144e55['where']=_[_0x65f6('0x32')](_0x144e55[_0x65f6('0x30')],{'$or':_[_0x65f6('0x33')](_0x144e55[_0x65f6('0x2d')],function(_0xbe54fe){var _0x28845a={};_0x28845a[_0xbe54fe]={'$like':'%'+_0x518cac[_0x65f6('0x2b')][_0x65f6('0x34')]+'%'};return _0x28845a;})});}_0x144e55=_['merge']({},_0x144e55,_0x518cac[_0x65f6('0x35')]);var _0x49d8ee={'where':_0x144e55[_0x65f6('0x30')]};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x49d8ee)[_0x65f6('0x21')](function(_0x5ef5c2){_0x4ea23d[_0x65f6('0x1a')]=_0x5ef5c2;if(_0x518cac[_0x65f6('0x2b')][_0x65f6('0x36')]){_0x144e55[_0x65f6('0x37')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x38')](_0x144e55);})[_0x65f6('0x21')](function(_0x2acca5){_0x4ea23d[_0x65f6('0x39')]=_0x2acca5;return _0x4ea23d;})['then'](respondWithFilteredResult(_0x14a387,_0x144e55))[_0x65f6('0x3a')](handleError(_0x14a387,null));})[_0x65f6('0x3a')](handleError(_0x14a387,null));};exports[_0x65f6('0x3b')]=function(_0x181798,_0x83e2d9){var _0x1ac040={'raw':![],'where':{'id':_0x181798[_0x65f6('0x3c')]['id']}},_0xe0b72d={};_0xe0b72d[_0x65f6('0x29')]=_[_0x65f6('0x2a')](db[_0x65f6('0x27')][_0x65f6('0x3d')]);_0xe0b72d[_0x65f6('0x2b')]=_[_0x65f6('0x2a')](_0x181798[_0x65f6('0x2b')]);_0xe0b72d[_0x65f6('0x2c')]=_['intersection'](_0xe0b72d[_0x65f6('0x29')],_0xe0b72d[_0x65f6('0x2b')]);_0x1ac040[_0x65f6('0x2d')]=_[_0x65f6('0x3e')](_0xe0b72d['model'],qs[_0x65f6('0x2e')](_0x181798[_0x65f6('0x2b')][_0x65f6('0x2e')]));_0x1ac040['attributes']=_0x1ac040[_0x65f6('0x2d')][_0x65f6('0x3f')]?_0x1ac040[_0x65f6('0x2d')]:_0xe0b72d[_0x65f6('0x29')];if(_0x181798['query'][_0x65f6('0x36')]){_0x1ac040['include']=[{'all':!![]}];}_0x1ac040=_[_0x65f6('0x32')]({},_0x1ac040,_0x181798[_0x65f6('0x35')]);return db['CmCompany'][_0x65f6('0x40')](_0x1ac040)['then'](handleEntityNotFound(_0x83e2d9,null))[_0x65f6('0x21')](respondWithResult(_0x83e2d9,null))[_0x65f6('0x3a')](handleError(_0x83e2d9,null));};exports[_0x65f6('0x41')]=function(_0xc0db01,_0x3ec18f){return db[_0x65f6('0x27')]['create'](_0xc0db01['body'],{})[_0x65f6('0x21')](function(_0x15d3ba){var _0x3b647a=_0xc0db01[_0x65f6('0x42')][_0x65f6('0x43')]({'plain':!![]});if(!_0x3b647a)throw new Error(_0x65f6('0x44'));if(_0x3b647a[_0x65f6('0x45')]===_0x65f6('0x42')){var _0x414f49=_0x15d3ba['get']({'plain':!![]});var _0x1f16cf=_0x65f6('0x22');return db[_0x65f6('0x46')]['find']({'where':{'name':_0x1f16cf,'userProfileId':_0x3b647a[_0x65f6('0x47')]},'raw':!![]})[_0x65f6('0x21')](function(_0x49ba5a){if(_0x49ba5a&&_0x49ba5a[_0x65f6('0x48')]===0x0){return db[_0x65f6('0x23')]['create']({'name':_0x414f49[_0x65f6('0x24')],'resourceId':_0x414f49['id'],'type':_0x49ba5a['name'],'sectionId':_0x49ba5a['id']},{})[_0x65f6('0x21')](function(){return _0x15d3ba;});}else{return _0x15d3ba;}})[_0x65f6('0x3a')](function(_0x1ca67e){logger['error'](_0x65f6('0x49'),_0x1ca67e);throw _0x1ca67e;});}return _0x15d3ba;})[_0x65f6('0x21')](respondWithResult(_0x3ec18f,0xc9))['catch'](handleError(_0x3ec18f,null));};exports[_0x65f6('0x4a')]=function(_0x34312c,_0x48a2ed){if(_0x34312c[_0x65f6('0x4b')]['id']){delete _0x34312c[_0x65f6('0x4b')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x34312c[_0x65f6('0x3c')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x48a2ed,null))[_0x65f6('0x21')](saveUpdates(_0x34312c[_0x65f6('0x4b')],null))['then'](respondWithResult(_0x48a2ed,null))['catch'](handleError(_0x48a2ed,null));};exports['destroy']=function(_0x19f40c,_0x2091f1){return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x19f40c['params']['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x2091f1,null))[_0x65f6('0x21')](removeEntity(_0x2091f1,null))[_0x65f6('0x3a')](handleError(_0x2091f1,null));};exports['describe']=function(_0x19c5fa,_0x2eb08f){return db[_0x65f6('0x27')]['describe']()['then'](respondWithResult(_0x2eb08f,null))[_0x65f6('0x3a')](handleError(_0x2eb08f,null));};exports[_0x65f6('0x4c')]=function(_0x4125cb,_0x39364f,_0x2a76b3){return db[_0x65f6('0x4d')][_0x65f6('0x40')]({'where':{'id':_0x4125cb[_0x65f6('0x3c')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x39364f,null))[_0x65f6('0x21')](function(_0xa7eee9){if(_0xa7eee9){return _0xa7eee9[_0x65f6('0x4c')](_0x4125cb[_0x65f6('0x4b')][_0x65f6('0x4e')],_['omit'](_0x4125cb[_0x65f6('0x4b')],[_0x65f6('0x4e'),'id'])||{});}})[_0x65f6('0x21')](respondWithResult(_0x39364f,null))['catch'](handleError(_0x39364f,null));};exports[_0x65f6('0x4f')]=function(_0x16dec0,_0x4638c9,_0x3096b8){var _0x4ef333={};var _0x12a5c9={};var _0x4227f5;var _0xe5fc65;return db[_0x65f6('0x27')]['findOne']({'where':{'id':_0x16dec0[_0x65f6('0x3c')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x4638c9,null))['then'](function(_0x28682b){if(_0x28682b){_0x4227f5=_0x28682b;_0x12a5c9[_0x65f6('0x29')]=_[_0x65f6('0x2a')](db['CmContact'][_0x65f6('0x3d')]);_0x12a5c9[_0x65f6('0x2b')]=_[_0x65f6('0x2a')](_0x16dec0[_0x65f6('0x2b')]);_0x12a5c9[_0x65f6('0x2c')]=_[_0x65f6('0x3e')](_0x12a5c9['model'],_0x12a5c9['query']);_0x4ef333['attributes']=_[_0x65f6('0x3e')](_0x12a5c9[_0x65f6('0x29')],qs[_0x65f6('0x2e')](_0x16dec0[_0x65f6('0x2b')][_0x65f6('0x2e')]));_0x4ef333[_0x65f6('0x2d')]=_0x4ef333['attributes'][_0x65f6('0x3f')]?_0x4ef333[_0x65f6('0x2d')]:_0x12a5c9['model'];_0x4ef333[_0x65f6('0x50')]=qs[_0x65f6('0x51')](_0x16dec0[_0x65f6('0x2b')]['sort']);_0x4ef333[_0x65f6('0x30')]=qs[_0x65f6('0x2c')](_['pick'](_0x16dec0[_0x65f6('0x2b')],_0x12a5c9[_0x65f6('0x2c')]));if(_0x16dec0[_0x65f6('0x2b')][_0x65f6('0x34')]){_0x4ef333[_0x65f6('0x30')]=_[_0x65f6('0x32')](_0x4ef333[_0x65f6('0x30')],{'$or':_['map'](_0x4ef333['attributes'],function(_0x3eb33e){var _0x3da139={};_0x3da139[_0x3eb33e]={'$like':'%'+_0x16dec0['query'][_0x65f6('0x34')]+'%'};return _0x3da139;})});}_0x4ef333=_['merge']({},_0x4ef333,_0x16dec0[_0x65f6('0x35')]);return _0x4227f5['getContacts'](_0x4ef333);}})[_0x65f6('0x21')](function(_0xdc8989){if(_0xdc8989){_0xe5fc65=_0xdc8989[_0x65f6('0x3f')];if(!_0x16dec0[_0x65f6('0x2b')][_0x65f6('0x2f')](_0x65f6('0x52'))){_0x4ef333[_0x65f6('0x19')]=qs[_0x65f6('0x19')](_0x16dec0[_0x65f6('0x2b')]['limit']);_0x4ef333['offset']=qs[_0x65f6('0x1b')](_0x16dec0[_0x65f6('0x2b')][_0x65f6('0x1b')]);}return _0x4227f5['getContacts'](_0x4ef333);}})['then'](function(_0x2dbec2){if(_0x2dbec2){return _0x2dbec2?{'count':_0xe5fc65,'rows':_0x2dbec2}:null;}})[_0x65f6('0x21')](respondWithResult(_0x4638c9,null))[_0x65f6('0x3a')](handleError(_0x4638c9,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 060d51c..c810a92 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 _0x0fda=['bluebird','request-promise','path','rimraf','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment'];(function(_0x1abc25,_0x55567d){var _0x480310=function(_0x406eac){while(--_0x406eac){_0x1abc25['push'](_0x1abc25['shift']());}};_0x480310(++_0x55567d);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x2b2d36,_0x35eb07){_0x2b2d36=_0x2b2d36-0x0;var _0x2158a7=_0x0fda[_0x2b2d36];return _0x2158a7;};'use strict';var _=require(_0xa0fd('0x0'));var util=require('util');var logger=require(_0xa0fd('0x1'))(_0xa0fd('0x2'));var moment=require(_0xa0fd('0x3'));var BPromise=require(_0xa0fd('0x4'));var rp=require(_0xa0fd('0x5'));var fs=require('fs');var path=require(_0xa0fd('0x6'));var rimraf=require(_0xa0fd('0x7'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0xa0fd('0x8')]=function(_0x4aec58,_0x49b3c1){return _0x4aec58[_0xa0fd('0x9')](_0xa0fd('0xa'),attributes,{'tableName':_0xa0fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ab=['rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','path'];(function(_0x12c0b1,_0x1b5fb8){var _0x10b2ec=function(_0x3ce764){while(--_0x3ce764){_0x12c0b1['push'](_0x12c0b1['shift']());}};_0x10b2ec(++_0x1b5fb8);}(_0xc6ab,0x96));var _0xbc6a=function(_0x229ec8,_0x1b05ef){_0x229ec8=_0x229ec8-0x0;var _0x16ad37=_0xc6ab[_0x229ec8];return _0x16ad37;};'use strict';var _=require(_0xbc6a('0x0'));var util=require(_0xbc6a('0x1'));var logger=require(_0xbc6a('0x2'))(_0xbc6a('0x3'));var moment=require(_0xbc6a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc6a('0x5'));var rimraf=require(_0xbc6a('0x6'));var config=require(_0xbc6a('0x7'));var attributes=require(_0xbc6a('0x8'));module[_0xbc6a('0x9')]=function(_0x4ccd07,_0x45ed96){return _0x4ccd07[_0xbc6a('0xa')](_0xbc6a('0xb'),attributes,{'tableName':_0xbc6a('0xc'),'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 87c386a..e301d8f 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 _0x65f1=['debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x65f1,0x181));var _0x165f=function(_0x568cf0,_0x1a44cb){_0x568cf0=_0x568cf0-0x0;var _0x360f81=_0x65f1[_0x568cf0];return _0x360f81;};'use strict';var _=require(_0x165f('0x0'));var util=require('util');var moment=require(_0x165f('0x1'));var BPromise=require('bluebird');var rs=require(_0x165f('0x2'));var fs=require('fs');var Redis=require(_0x165f('0x3'));var db=require(_0x165f('0x4'))['db'];var utils=require(_0x165f('0x5'));var logger=require(_0x165f('0x6'))('rpc');var config=require(_0x165f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x165f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1883d8,_0x10fe5e,_0x57776c){return new BPromise(function(_0x290699,_0x9672e3){return client[_0x165f('0x9')](_0x1883d8,_0x57776c)[_0x165f('0xa')](function(_0x2544a9){logger[_0x165f('0xb')](_0x165f('0xc'),_0x10fe5e,_0x165f('0xd'));logger[_0x165f('0xe')](_0x165f('0xf'),_0x10fe5e,'request\x20sent',JSON[_0x165f('0x10')](_0x2544a9));if(_0x2544a9[_0x165f('0x11')]){if(_0x2544a9['error'][_0x165f('0x12')]===0x1f4){logger[_0x165f('0x11')](_0x165f('0xc'),_0x10fe5e,_0x2544a9['error'][_0x165f('0x13')]);return _0x9672e3(_0x2544a9[_0x165f('0x11')][_0x165f('0x13')]);}logger[_0x165f('0x11')](_0x165f('0xc'),_0x10fe5e,_0x2544a9[_0x165f('0x11')][_0x165f('0x13')]);return _0x290699(_0x2544a9[_0x165f('0x11')][_0x165f('0x13')]);}else{logger[_0x165f('0xb')](_0x165f('0xc'),_0x10fe5e,_0x165f('0xd'));_0x290699(_0x2544a9[_0x165f('0x14')][_0x165f('0x13')]);}})['catch'](function(_0x390e3c){logger[_0x165f('0x11')]('CmCompany,\x20%s,\x20%s',_0x10fe5e,_0x390e3c);_0x9672e3(_0x390e3c);});});} \ No newline at end of file +var _0x5077=['info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5077,0x1ba));var _0x7507=function(_0x5c0afc,_0x4308ff){_0x5c0afc=_0x5c0afc-0x0;var _0x1d91bd=_0x5077[_0x5c0afc];return _0x1d91bd;};'use strict';var _=require(_0x7507('0x0'));var util=require(_0x7507('0x1'));var moment=require(_0x7507('0x2'));var BPromise=require(_0x7507('0x3'));var rs=require(_0x7507('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7507('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7507('0x6'))(_0x7507('0x7'));var config=require(_0x7507('0x8'));var jayson=require(_0x7507('0x9'));var client=jayson[_0x7507('0xa')][_0x7507('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50e8c4,_0x16ed91,_0x498746){return new BPromise(function(_0x28d586,_0x504bfa){return client[_0x7507('0xc')](_0x50e8c4,_0x498746)[_0x7507('0xd')](function(_0x41ff8e){logger[_0x7507('0xe')]('CmCompany,\x20%s,\x20%s',_0x16ed91,_0x7507('0xf'));logger[_0x7507('0x10')](_0x7507('0x11'),_0x16ed91,_0x7507('0xf'),JSON[_0x7507('0x12')](_0x41ff8e));if(_0x41ff8e[_0x7507('0x13')]){if(_0x41ff8e[_0x7507('0x13')][_0x7507('0x14')]===0x1f4){logger[_0x7507('0x13')]('CmCompany,\x20%s,\x20%s',_0x16ed91,_0x41ff8e[_0x7507('0x13')]['message']);return _0x504bfa(_0x41ff8e[_0x7507('0x13')][_0x7507('0x15')]);}logger[_0x7507('0x13')](_0x7507('0x16'),_0x16ed91,_0x41ff8e[_0x7507('0x13')]['message']);return _0x28d586(_0x41ff8e[_0x7507('0x13')][_0x7507('0x15')]);}else{logger['info'](_0x7507('0x16'),_0x16ed91,_0x7507('0xf'));_0x28d586(_0x41ff8e['result'][_0x7507('0x15')]);}})[_0x7507('0x17')](function(_0x19676f){logger['error'](_0x7507('0x16'),_0x16ed91,_0x19676f);_0x504bfa(_0x19676f);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index c7e5961..8837549 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 _0x3110=['show','/:id/contacts','getContacts','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x5f0651,_0x38cde2){var _0x3f5ce1=function(_0xff317a){while(--_0xff317a){_0x5f0651['push'](_0x5f0651['shift']());}};_0x3f5ce1(++_0x38cde2);}(_0x3110,0x1d7));var _0x0311=function(_0x36ae75,_0x2b8a84){_0x36ae75=_0x36ae75-0x0;var _0xf2b9f3=_0x3110[_0x36ae75];return _0xf2b9f3;};'use strict';var multer=require(_0x0311('0x0'));var util=require(_0x0311('0x1'));var path=require('path');var timeout=require(_0x0311('0x2'));var express=require(_0x0311('0x3'));var router=express[_0x0311('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0311('0x5'));var controller=require(_0x0311('0x6'));router[_0x0311('0x7')]('/',auth[_0x0311('0x8')](),controller[_0x0311('0x9')]);router[_0x0311('0x7')](_0x0311('0xa'),auth[_0x0311('0x8')](),controller['describe']);router[_0x0311('0x7')](_0x0311('0xb'),auth[_0x0311('0x8')](),controller[_0x0311('0xc')]);router[_0x0311('0x7')](_0x0311('0xd'),auth['isAuthenticated'](),controller[_0x0311('0xe')]);router[_0x0311('0xf')]('/',auth[_0x0311('0x8')](),controller[_0x0311('0x10')]);router['post'](_0x0311('0xd'),auth['isAuthenticated'](),controller['addContacts']);router['put']('/:id',auth[_0x0311('0x8')](),controller[_0x0311('0x11')]);router[_0x0311('0x12')](_0x0311('0xb'),auth[_0x0311('0x8')](),controller[_0x0311('0x13')]);module[_0x0311('0x14')]=router; \ No newline at end of file +var _0x15f0=['/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated'];(function(_0x5e897d,_0x408f10){var _0x2079d2=function(_0x2ad944){while(--_0x2ad944){_0x5e897d['push'](_0x5e897d['shift']());}};_0x2079d2(++_0x408f10);}(_0x15f0,0x14d));var _0x015f=function(_0x1ba6ee,_0x34a71d){_0x1ba6ee=_0x1ba6ee-0x0;var _0x166117=_0x15f0[_0x1ba6ee];return _0x166117;};'use strict';var multer=require(_0x015f('0x0'));var util=require(_0x015f('0x1'));var path=require(_0x015f('0x2'));var timeout=require('connect-timeout');var express=require(_0x015f('0x3'));var router=express[_0x015f('0x4')]();var fs_extra=require(_0x015f('0x5'));var auth=require(_0x015f('0x6'));var interaction=require(_0x015f('0x7'));var config=require(_0x015f('0x8'));var controller=require(_0x015f('0x9'));router[_0x015f('0xa')]('/',auth[_0x015f('0xb')](),controller['index']);router[_0x015f('0xa')](_0x015f('0xc'),auth[_0x015f('0xb')](),controller[_0x015f('0xd')]);router['get'](_0x015f('0xe'),auth[_0x015f('0xb')](),controller[_0x015f('0xf')]);router[_0x015f('0xa')](_0x015f('0x10'),auth['isAuthenticated'](),controller[_0x015f('0x11')]);router[_0x015f('0x12')]('/',auth['isAuthenticated'](),controller[_0x015f('0x13')]);router['post'](_0x015f('0x10'),auth[_0x015f('0xb')](),controller[_0x015f('0x14')]);router['put'](_0x015f('0xe'),auth['isAuthenticated'](),controller[_0x015f('0x15')]);router['delete'](_0x015f('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x015f('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 7ecaaf8..c49f826 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 _0xc2bf=['exports','STRING','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xc2bf,0x166));var _0xfc2b=function(_0x399021,_0x14a825){_0x399021=_0x399021-0x0;var _0x2e5e93=_0xc2bf[_0x399021];return _0x2e5e93;};'use strict';var _=require(_0xfc2b('0x0'));var Sequelize=require(_0xfc2b('0x1'));module[_0xfc2b('0x2')]={'firstName':{'type':Sequelize[_0xfc2b('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xfc2b('0x3')]},'street':{'type':Sequelize[_0xfc2b('0x3')]},'postalCode':{'type':Sequelize[_0xfc2b('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xfc2b('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xfc2b('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xfc2b('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xfc2b('0x3')]},'facebook':{'type':Sequelize[_0xfc2b('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xfc2b('0x3')]},'skype':{'type':Sequelize[_0xfc2b('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xfc2b('0x3')]},'telegram':{'type':Sequelize[_0xfc2b('0x3')]},'UserId':{'type':Sequelize[_0xfc2b('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xfc2b('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xfc2b('0x6')],'defaultValue':Sequelize[_0xfc2b('0x7')]}}; \ No newline at end of file +var _0xccb8=['sequelize','exports','STRING','TEXT','UNSIGNED','DATE','NOW','lodash'];(function(_0x1ee9e3,_0x2dd132){var _0x3138b1=function(_0x9530f8){while(--_0x9530f8){_0x1ee9e3['push'](_0x1ee9e3['shift']());}};_0x3138b1(++_0x2dd132);}(_0xccb8,0x19f));var _0x8ccb=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xccb8[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0x8ccb('0x0'));var Sequelize=require(_0x8ccb('0x1'));module[_0x8ccb('0x2')]={'firstName':{'type':Sequelize[_0x8ccb('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8ccb('0x3')]},'postalCode':{'type':Sequelize[_0x8ccb('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x8ccb('0x3')]},'dateOfBirth':{'type':Sequelize[_0x8ccb('0x3')]},'description':{'type':Sequelize[_0x8ccb('0x4')]},'phone':{'type':Sequelize[_0x8ccb('0x3')]},'mobile':{'type':Sequelize[_0x8ccb('0x3')]},'fax':{'type':Sequelize[_0x8ccb('0x3')]},'email':{'type':Sequelize[_0x8ccb('0x3')]},'url':{'type':Sequelize[_0x8ccb('0x3')]},'facebook':{'type':Sequelize[_0x8ccb('0x3')]},'fb_data':{'type':Sequelize[_0x8ccb('0x3')]},'twitter':{'type':Sequelize[_0x8ccb('0x3')]},'skype':{'type':Sequelize[_0x8ccb('0x3')]},'teams':{'type':Sequelize[_0x8ccb('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x8ccb('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x8ccb('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x8ccb('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8ccb('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x8ccb('0x6')],'defaultValue':Sequelize[_0x8ccb('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 7417134..77f39d6 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 _0xa9e0=['status','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','index','CmContact','describe','keys','length','cf_','push','CmCustomField','findOne','trimStart','all','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','castTo','DATE','buildExpression','text','start','filter','Contact','isEmpty','ListId','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.phone\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','QueryTypes','clone','DESC','t.id\x20IN\x20?','resolve','user','agent','some','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','role','sequelize','toString','c.firstName','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','split','rows','find','startsWith','displayName','columnName','custom','catch','body','findAll','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','additionalPhones','bulkCreate','each','duplicates','$or','findOrCreate','spread','contact','show','Phones','params','ContactItemType','ItemType','literal','`Phones.ItemType`.OrderBy','log','$and','omit','format','cf_%d','pickBy','setFields','id\x20=\x20?','values','phone','getTags','rawAttributes','pick','merge','options','setTags','ids','setAdditionalPhones','items','item_types','isNil','ItemTypeId','description','CmHopperAdditionalPhone','item','OrderBy','`ItemType`.OrderBy','ItemType.OrderBy','getAdditionalPhones','PHONE','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','ContactId','includeAll','include','getHopperHistories','getHopperFinals','uploadCsv','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','send','upload','file','parse','json','meta','No\x20ListId\x20specified','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','message','mail','chat','sms','fax','voice','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','alias','Website','closed','closedAt','disposition','secondDisposition','Account','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','startCase','flatten','sortBy','slice','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register'];(function(_0xf99887,_0x2969f7){var _0x1df2a7=function(_0x254c46){while(--_0x254c46){_0xf99887['push'](_0xf99887['shift']());}};_0x1df2a7(++_0x2969f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=typeof _0x5a0a06[_0x0a9e('0x1b')]===_0x0a9e('0x1c')&&typeof _0x5a0a06[_0x0a9e('0x1d')]===_0x0a9e('0x1c');var _0x530eb7=_0x459eb1[_0x0a9e('0x1e')];var _0x1314ae=_0x478723?0x0:_0x5a0a06[_0x0a9e('0x1b')];var _0x1c696a=_0x478723?_0x459eb1[_0x0a9e('0x1e')]:_0x5a0a06['offset']+_0x5a0a06[_0x0a9e('0x1d')];var _0x155cce;if(_0x1c696a>=_0x530eb7){_0x1c696a=_0x530eb7;_0x155cce=0xc8;}else{_0x155cce=0xce;}_0x225616['status'](_0x155cce);return _0x225616[_0x0a9e('0x1f')]('Content-Range',_0x1314ae+'-'+_0x1c696a+'/'+_0x530eb7)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x3a02e1){return function(_0x432e56){try{jsonpatch[_0x0a9e('0x20')](_0x432e56,_0x3a02e1,!![]);}catch(_0x30bae6){return BPromise['reject'](_0x30bae6);}return _0x432e56[_0x0a9e('0x21')]();};}function saveUpdates(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x22')](_0x2fb0e4)[_0x0a9e('0x23')](function(_0x16b1ca){return _0x16b1ca;});}return null;};}function removeEntity(_0x5ea472,_0x59181e){return function(_0x197ec0){if(_0x197ec0){return _0x197ec0[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){_0x5ea472[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x25')](_0x25fba9[_0x0a9e('0x26')]);if(_0x25fba9[_0x0a9e('0x27')]){delete _0x25fba9[_0x0a9e('0x27')];}_0x1dc186[_0x0a9e('0x1a')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x28')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]()[_0x0a9e('0x23')](function(_0x58b06f){var _0x563b45=[];for(var _0x296f41=0x0;_0x296f410x1){_0x10b040['or'](_0x0a9e('0x66'),qs['getFullTextValue'](_0x121cef),null);}else{if(qs[_0x0a9e('0x67')](_0x121cef)){_0x10b040['or']('c.id\x20LIKE\x20?',_0x121cef+'%');_0x10b040['or'](_0x0a9e('0x68'),_0x121cef+'%');_0x10b040['or']('c.mobile\x20LIKE\x20?',_0x121cef+'%');_0x10b040['or']('c.fax\x20LIKE\x20?',_0x121cef+'%');}else if(qs['isEmail'](_0x121cef)){_0x10b040['or'](_0x0a9e('0x69'),_0x121cef+'%');}else{_0x10b040['or']('c.firstName\x20LIKE\x20?','%'+_0x121cef+'%');_0x10b040['or'](_0x0a9e('0x6a'),'%'+_0x121cef+'%');_0x10b040['or'](_0x0a9e('0x69'),'%'+_0x121cef+'%');}}}}_0x23b089[_0x0a9e('0x3e')](_0x10b040);_0x23b089[_0x0a9e('0x6b')](_0x0a9e('0x6c'));var _0x26d7db={'type':db['Sequelize'][_0x0a9e('0x6d')]['SELECT'],'raw':!![]};var _0xca4ade=_0x23b089[_0x0a9e('0x6e')]()[_0x0a9e('0x40')]('c.id');if(_0x2ec755[_0x0a9e('0x3c')]){_0x2ec755[_0x0a9e('0x3c')][_0x0a9e('0x53')](function(_0x32e134){_0x23b089['order']('c.'+_0x32e134[0x0],_0x32e134[0x1]===_0x0a9e('0x6f')?![]:!![]);});}if(!_[_0x0a9e('0x5f')](_0x432fcc)){_0x23b089['having'](_0x25c6e6);_0xca4ade[_0x0a9e('0x3e')](_0x0a9e('0x70'),_0x432fcc);}BPromise[_0x0a9e('0x71')]()[_0x0a9e('0x23')](function(){if(!_0x35ed4a)return;if(_0x468813[_0x0a9e('0x72')]['role']!==_0x0a9e('0x73'))return;if(!_[_0x0a9e('0x74')](_0x35ed4a[_0x0a9e('0x4f')],['field',_0x0a9e('0x56')])){return _0x468813['user']['getLists']({'attributes':['id'],'raw':!![]})[_0x0a9e('0x23')](function(_0x4556c5){if(_[_0x0a9e('0x5f')](_0x4556c5)){_0xca4ade[_0x0a9e('0x3e')](_0x0a9e('0x75'));_0x23b089[_0x0a9e('0x3e')](_0x0a9e('0x75'));}else{_0xca4ade[_0x0a9e('0x3e')](_0x0a9e('0x76'),_[_0x0a9e('0x52')](_0x4556c5,'id'));_0x23b089[_0x0a9e('0x3e')](_0x0a9e('0x76'),_[_0x0a9e('0x52')](_0x4556c5,'id'));}});}})[_0x0a9e('0x23')](function(){if(_0x468813[_0x0a9e('0x72')][_0x0a9e('0x77')]===_0x0a9e('0x73')&&!_0x35ed4a&&!_0x468813[_0x0a9e('0x35')]['ListId'])return[];return db[_0x0a9e('0x78')][_0x0a9e('0x35')](_0xca4ade[_0x0a9e('0x79')](),_0x26d7db);})['then'](function(_0x1148a1){_0x15b200[_0x0a9e('0x1e')]=_0x1148a1['length'];if(_0x15b200[_0x0a9e('0x1e')]===0x0)return[];return db[_0x0a9e('0x78')][_0x0a9e('0x35')](_0x5b4f5e[_0x0a9e('0x79')](),_0x26d7db)[_0x0a9e('0x23')](function(_0x4a43a8){_0x1459bb=_['keyBy'](_0x4a43a8,'id');_0x26d7db=_['merge'](_0x26d7db,{'model':db[_0x0a9e('0x29')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x468813[_0x0a9e('0x35')][_0x0a9e('0x38')]){_0x2ec755[_0x0a9e('0x39')][_0x0a9e('0x53')](function(_0x380ab3){_0x23b089[_0x0a9e('0x40')]('c.'+_0x380ab3);});}else{_0x23b089[_0x0a9e('0x40')]('c.id');_0x23b089[_0x0a9e('0x40')](_0x0a9e('0x7a'));_0x23b089[_0x0a9e('0x40')]('c.lastName');_0x23b089[_0x0a9e('0x40')]('c.phone');_0x23b089[_0x0a9e('0x40')](_0x0a9e('0x7b'));_0x23b089['field'](_0x0a9e('0x7c'));_0x23b089[_0x0a9e('0x40')](_0x0a9e('0x7d'));_0x23b089[_0x0a9e('0x40')]('c.ListId');_0x23b089[_0x0a9e('0x40')](_0x0a9e('0x7e'));_0x23b089[_0x0a9e('0x40')](_0x0a9e('0x7f'));_0x23b089['field'](_0x0a9e('0x80'));_0x23b089[_0x0a9e('0x40')](_0x0a9e('0x81'),_0x0a9e('0x82'));}if(_0x2ec755['limit'])_0x23b089[_0x0a9e('0x1d')](_0x2ec755[_0x0a9e('0x1d')]);if(_0x2ec755[_0x0a9e('0x1b')])_0x23b089[_0x0a9e('0x1b')](_0x2ec755[_0x0a9e('0x1b')]);return db[_0x0a9e('0x78')][_0x0a9e('0x35')](_0x23b089[_0x0a9e('0x79')](),_0x26d7db);});})[_0x0a9e('0x23')](function(_0x336dc3){_0x336dc3[_0x0a9e('0x53')](function(_0x1f10ef){if(_0x1f10ef[_0x0a9e('0x82')]){_0x1f10ef[_0x0a9e('0x83')]=[];_0x1f10ef['TagIds'][_0x0a9e('0x84')](',')[_0x0a9e('0x53')](function(_0xc599b3){_0x1f10ef['Tags'][_0x0a9e('0x2e')](_0x1459bb[_0xc599b3]);});}delete _0x1f10ef[_0x0a9e('0x82')];});_0x15b200[_0x0a9e('0x85')]=_0x336dc3;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755));})['catch'](handleError(_0x2b1f27,null));};exports['destroy']=function(_0x7ebea8,_0x2bbdb5){return db['CmContact'][_0x0a9e('0x86')]({'where':{'id':_0x7ebea8['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2bbdb5,null))[_0x0a9e('0x23')](removeEntity(_0x2bbdb5,null))['catch'](handleError(_0x2bbdb5,null));};exports[_0x0a9e('0x2a')]=function(_0x41cf12,_0x2d2286){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]()[_0x0a9e('0x23')](function(_0x444f1f){delete _0x444f1f['tags'];for(var _0x2973d3=0x0;_0x2973d30x0){return new Promise(function(_0x4a70ce,_0x55f91a){var _0x183244=[];for(var _0x1f78b4=0x0;_0x1f78b4<_0x5c4be0[_0x0a9e('0x2c')];_0x1f78b4++){_0x183244['push'](insertAdditionalPhones(_0x5c4be0[_0x1f78b4][_0x0a9e('0xb6')],_0x5c4be0[_0x1f78b4][_0x0a9e('0xaf')]));}Promise[_0x0a9e('0x32')](_0x183244)[_0x0a9e('0x23')](function(){_0x4a70ce(0x1);});})[_0x0a9e('0x23')](function(){return{'success':_0x5b93dd,'failure':_0x556443,'duplicates':_0x6eaaf0};});}else{return{'success':_0x5b93dd,'failure':_0x556443,'duplicates':_0x6eaaf0};}}})[_0x0a9e('0x23')](respondWithResult(_0x98c62c,0xc9))[_0x0a9e('0x8b')](handleError(_0x98c62c,null));};exports[_0x0a9e('0xb7')]=function(_0x3b5bda,_0x5a1848,_0x43c397){var _0x5526a7;return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]()[_0x0a9e('0x23')](function(_0x3cf222){return db[_0x0a9e('0x29')][_0x0a9e('0x86')]({'where':{'id':_0x3b5bda['params']['id']},'include':[{'model':db[_0x0a9e('0x50')],'as':_0x0a9e('0x83'),'attributes':['id',_0x0a9e('0x27'),_0x0a9e('0x41')],'required':_0x3b5bda['query'][_0x0a9e('0x64')]?!![]:![]},{'model':db[_0x0a9e('0xa3')],'as':_0x0a9e('0xb8'),'where':{'CmContactId':_0x3b5bda[_0x0a9e('0xb9')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0xba')],'as':_0x0a9e('0xbb')}]}],'order':[db[_0x0a9e('0x78')][_0x0a9e('0xbc')](_0x0a9e('0xbd'))],'logging':console[_0x0a9e('0xbe')],'attributes':_['keys'](_0x3cf222)});})[_0x0a9e('0x23')](function(_0x88b25f){_0x5526a7=_0x88b25f[_0x0a9e('0x8e')]({'plain':!![]});var _0x26b826={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x88b25f&&_0x88b25f[_0x0a9e('0x60')]){if(_0x88b25f[_0x0a9e('0x60')]){_0x26b826[_0x0a9e('0x3e')][_0x0a9e('0xbf')]['push']({'ListId':{'$ne':_0x88b25f[_0x0a9e('0x60')]}});}}return db[_0x0a9e('0x2f')][_0x0a9e('0x8d')](_0x26b826);})['then'](function(_0x1402c7){return _[_0x0a9e('0xc0')](_0x5526a7,_[_0x0a9e('0x52')](_0x1402c7,function(_0x97d5b5){return util[_0x0a9e('0xc1')](_0x0a9e('0xc2'),_0x97d5b5['id']);}));})[_0x0a9e('0x23')](handleEntityNotFound(_0x5a1848,null))[_0x0a9e('0x23')](respondWithResult(_0x5a1848,null))[_0x0a9e('0x8b')](handleError(_0x5a1848,null));};exports[_0x0a9e('0x22')]=function(_0x5a7dad,_0x251753){var _0x446e6;if(_0x5a7dad[_0x0a9e('0x8c')]['id']){delete _0x5a7dad[_0x0a9e('0x8c')]['id'];}return db[_0x0a9e('0x29')][_0x0a9e('0x86')]({'where':{'id':_0x5a7dad['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x251753,null))['then'](saveUpdates(_0x5a7dad['body'],null))['then'](function(_0x19e4e6){_0x446e6=_0x19e4e6;var _0x3fa3f2={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x19e4e6&&_0x19e4e6[_0x0a9e('0x60')]){if(_0x19e4e6[_0x0a9e('0x60')]){_0x3fa3f2['where'][_0x0a9e('0xbf')][_0x0a9e('0x2e')]({'ListId':{'$ne':_0x19e4e6[_0x0a9e('0x60')]}});}}return db[_0x0a9e('0x2f')][_0x0a9e('0x8d')](_0x3fa3f2);})['then'](function(_0x57b1b1){if(_0x57b1b1){return _[_0x0a9e('0xc0')](_[_0x0a9e('0xc3')](_0x5a7dad[_0x0a9e('0x8c')],function(_0x5e85d0,_0x319752){return _[_0x0a9e('0x87')](_0x319752,_0x0a9e('0x2d'));}),_['map'](_0x57b1b1,function(_0x8ad1c0){return util[_0x0a9e('0xc1')](_0x0a9e('0xc2'),_0x8ad1c0['id']);}));}})['then'](function(_0x272291){if(_0x272291&&!_[_0x0a9e('0x5f')](_0x272291)){var _0x3b7213=squel['update']()['table']('cm_contacts')[_0x0a9e('0xc4')](_0x272291)[_0x0a9e('0x3e')](_0x0a9e('0xc5'),_0x5a7dad[_0x0a9e('0xb9')]['id'])['toParam']();return db[_0x0a9e('0x78')]['query'](_0x3b7213[_0x0a9e('0x5b')],{'replacements':_0x3b7213[_0x0a9e('0xc6')]});}})[_0x0a9e('0x23')](function(){if(_0x5a7dad['body'][_0x0a9e('0xc7')]&&_0x446e6){return db[_0x0a9e('0x94')][_0x0a9e('0x22')]({'phone':_0x5a7dad['body'][_0x0a9e('0xc7')]},{'where':{'ContactId':_0x446e6['id']}});}})['then'](function(){return _0x446e6;})[_0x0a9e('0x23')](respondWithResult(_0x251753,null))['catch'](handleError(_0x251753,null));};exports[_0x0a9e('0xc8')]=function(_0x57b7d4,_0xb14971,_0x37215d){var _0xa288e4={};var _0x10ace8={};var _0x1e306c;var _0x251dd9;return db[_0x0a9e('0x29')]['findOne']({'where':{'id':_0x57b7d4[_0x0a9e('0xb9')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0xb14971,null))['then'](function(_0xf4fb77){if(_0xf4fb77){_0x1e306c=_0xf4fb77;_0x10ace8[_0x0a9e('0x34')]=_['keys'](db[_0x0a9e('0x50')][_0x0a9e('0xc9')]);_0x10ace8[_0x0a9e('0x35')]=_['keys'](_0x57b7d4[_0x0a9e('0x35')]);_0x10ace8[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x10ace8[_0x0a9e('0x34')],_0x10ace8[_0x0a9e('0x35')]);_0xa288e4[_0x0a9e('0x39')]=_[_0x0a9e('0x37')](_0x10ace8[_0x0a9e('0x34')],qs[_0x0a9e('0x38')](_0x57b7d4[_0x0a9e('0x35')]['fields']));_0xa288e4[_0x0a9e('0x39')]=_0xa288e4['attributes'][_0x0a9e('0x2c')]?_0xa288e4[_0x0a9e('0x39')]:_0x10ace8[_0x0a9e('0x34')];_0xa288e4[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x57b7d4[_0x0a9e('0x35')]['sort']);_0xa288e4[_0x0a9e('0x3e')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0xca')](_0x57b7d4['query'],_0x10ace8[_0x0a9e('0x36')]));if(_0x57b7d4[_0x0a9e('0x35')][_0x0a9e('0x5d')]){_0xa288e4[_0x0a9e('0x3e')]=_[_0x0a9e('0xcb')](_0xa288e4[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x52')](_0xa288e4['attributes'],function(_0x4e1b3){var _0x228c10={};_0x228c10[_0x4e1b3]={'$like':'%'+_0x57b7d4[_0x0a9e('0x35')][_0x0a9e('0x5d')]+'%'};return _0x228c10;})});}_0xa288e4=_[_0x0a9e('0xcb')]({},_0xa288e4,_0x57b7d4[_0x0a9e('0xcc')]);return _0x1e306c[_0x0a9e('0xc8')](_0xa288e4);}})['then'](function(_0x5c8720){if(_0x5c8720){_0x251dd9=_0x5c8720[_0x0a9e('0x2c')];if(!_0x57b7d4[_0x0a9e('0x35')][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0xa288e4[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x57b7d4[_0x0a9e('0x35')]['limit']);_0xa288e4[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x57b7d4[_0x0a9e('0x35')][_0x0a9e('0x1b')]);}return _0x1e306c[_0x0a9e('0xc8')](_0xa288e4);}})[_0x0a9e('0x23')](function(_0x16be7e){if(_0x16be7e){return _0x16be7e?{'count':_0x251dd9,'rows':_0x16be7e}:null;}})['then'](respondWithResult(_0xb14971,null))[_0x0a9e('0x8b')](handleError(_0xb14971,null));};exports[_0x0a9e('0xcd')]=function(_0x231826,_0x5885c3,_0x2b8ad4){if(_0x231826[_0x0a9e('0x8c')]['id']){delete _0x231826[_0x0a9e('0x8c')]['id'];}return db[_0x0a9e('0x29')]['findOne']({'where':{'id':_0x231826[_0x0a9e('0xb9')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5885c3,null))[_0x0a9e('0x23')](function(_0x93d953){if(_0x93d953){return _0x93d953[_0x0a9e('0xcd')](_0x231826[_0x0a9e('0x8c')][_0x0a9e('0xce')]||[]);}return null;})[_0x0a9e('0x23')](respondWithResult(_0x5885c3,null))['catch'](handleError(_0x5885c3,null));};exports[_0x0a9e('0xcf')]=function(_0x266aa1,_0x25e41f){var _0x397771=[];_0x397771['push'](addAdditionalPhones(_0x266aa1['body']));Promise[_0x0a9e('0x32')](_0x397771)[_0x0a9e('0x23')](function(){_0x397771=[];_0x397771[_0x0a9e('0x2e')](deleteCmHopperPhones(_0x266aa1['body']['id']));_0x397771[_0x0a9e('0x2e')](addCmHopperPhones(_0x266aa1[_0x0a9e('0x8c')]['id']));Promise['all'](_0x397771)[_0x0a9e('0x23')](function(){return[0x1];})['then'](respondWithResult(_0x25e41f,null));});};function addAdditionalPhones(_0x35cc2a){return new Promise(function(_0x54dbbf,_0x5b42b9){return db['CmContactHasItem'][_0x0a9e('0x24')]({'where':{'CmContactId':_0x35cc2a['id']}})[_0x0a9e('0x23')](function(){var _0x19f800=[];for(var _0x20007e=0x0;_0x20007e<_0x35cc2a[_0x0a9e('0xd0')][_0x0a9e('0x2c')];_0x20007e++){_0x19f800['push'](addAdditionalPhone(_0x35cc2a['id'],_0x35cc2a[_0x0a9e('0xd0')][_0x20007e][_0x0a9e('0xc7')],_0x35cc2a[_0x0a9e('0xd1')]?_[_0x0a9e('0xd2')](_0x35cc2a[_0x0a9e('0xd1')][_0x20007e])?null:_0x35cc2a[_0x0a9e('0xd1')][_0x20007e]:_0x35cc2a[_0x0a9e('0xd0')][_0x20007e]['ItemTypeId']?_0x35cc2a['items'][_0x20007e][_0x0a9e('0xd3')]:null,_0x20007e,_0x35cc2a['items'][_0x20007e][_0x0a9e('0xd4')]));}Promise[_0x0a9e('0x32')](_0x19f800)[_0x0a9e('0x23')](function(){_0x54dbbf(0x1);});});});}function addAdditionalPhone(_0xa3695f,_0x37a448,_0x383dd8,_0x594f25,_0x4716d1){return db['CmContactHasItem']['find']({'where':{'CmContactId':_0xa3695f,'item':_0x37a448}})[_0x0a9e('0x23')](function(_0x593f9e){if(_0x593f9e)logger[_0x0a9e('0x92')]('contact\x20phone\x20exists',_0x593f9e);else{db['CmContactHasItem'][_0x0a9e('0x98')]({'CmContactId':_0xa3695f,'item':_0x37a448,'ItemTypeId':_0x383dd8,'OrderBy':_0x594f25,'ItemClass':'PHONE','description':_0x4716d1});}});}function deletePhones(_0x24470a){return db[_0x0a9e('0xa3')][_0x0a9e('0x24')]({'where':{'CmContactId':_0x24470a}});}function deleteCmHopperPhones(_0x48f532){return new Promise(function(_0x4152cd,_0x1209c4){return db[_0x0a9e('0x94')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x48f532}})['then'](function(_0xdc77d){db[_0x0a9e('0xd5')][_0x0a9e('0x24')]({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x52')](_0xdc77d,'id')}}});})[_0x0a9e('0x23')](function(){_0x4152cd(0x1);});});}function addCmHopperPhones(_0x376b97){return new Promise(function(_0x247a6c,_0x170b3d){return db[_0x0a9e('0x94')][_0x0a9e('0x8d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x376b97}})['then'](function(_0x51fa33){var _0x558171=[];_[_0x0a9e('0x52')](_0x51fa33,function(_0x19dcc2){_0x558171[_0x0a9e('0x2e')](createCmHopperPhone(_0x376b97,_0x19dcc2['id']));});Promise[_0x0a9e('0x32')](_0x558171)[_0x0a9e('0x23')](function(){_0x247a6c(0x1);});});});}function createCmHopperPhone(_0x2dc202,_0x2b97fc){return new Promise(function(_0x307d13,_0x5d74e9){db['CmContactHasItem'][_0x0a9e('0x8d')]({'raw':!![],'attributes':[_0x0a9e('0xd6')],'where':{'CmContactId':_0x2dc202,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0xba')],'attributes':[_0x0a9e('0xd7')],'as':_0x0a9e('0xbb')}],'order':[db[_0x0a9e('0x78')][_0x0a9e('0xbc')](_0x0a9e('0xd8'))]})[_0x0a9e('0x23')](function(_0x262281){var _0x59f8f7=0x1;var _0x400800=_[_0x0a9e('0x52')](_0x262281,function(_0x20e191){_0x20e191['CmHopperId']=_0x2b97fc;_0x20e191[_0x0a9e('0xc7')]=_0x20e191[_0x0a9e('0xd6')];_0x20e191[_0x0a9e('0xd7')]=_0x20e191[_0x0a9e('0xd9')]||_0x59f8f7;delete _0x20e191[_0x0a9e('0xd9')];_0x59f8f7=_0x59f8f7+0x1;return _0x20e191;});return db[_0x0a9e('0xd5')][_0x0a9e('0xb0')](_0x400800,{});})[_0x0a9e('0x23')](function(){_0x307d13(0x1);});});}function insertAdditionalPhones(_0x3a9c0f,_0x3f1959){return new Promise(function(_0x6b048e,_0x3ba472){var _0x4e6eb9=[];for(var _0x572a72=0x0;_0x572a72<_0x3f1959[_0x0a9e('0x2c')];_0x572a72++){var _0x401207=_0x3f1959[_0x572a72];_0x4e6eb9[_0x0a9e('0x2e')](parseContactItemType(_0x401207));}Promise[_0x0a9e('0x32')](_0x4e6eb9)[_0x0a9e('0x23')](function(){var _0x1e29e2={'id':_0x3a9c0f['id'],'items':_0x3f1959};return addAdditionalPhones(_0x1e29e2)[_0x0a9e('0x23')](function(_0x4f7907){return addCmHopperPhones(_0x3a9c0f['id']);});})[_0x0a9e('0x23')](function(){_0x6b048e(_0x3a9c0f);});});}function parseContactItemType(_0x49fd0e){return new Promise(function(_0x26aa44,_0x1ad1d7){if(_0x49fd0e[_0x0a9e('0x3a')](_0x0a9e('0xd3'))){_0x26aa44(_0x49fd0e);}else{return db[_0x0a9e('0xba')][_0x0a9e('0x86')]({'where':{'name':_0x49fd0e[_0x0a9e('0xbb')]}})[_0x0a9e('0x23')](function(_0xa7a754){if(_[_0x0a9e('0xd2')](_0xa7a754))_0x49fd0e[_0x0a9e('0xd3')]=null;else _0x49fd0e[_0x0a9e('0xd3')]=_0xa7a754['id'];_0x26aa44(_0x49fd0e);});}});}exports[_0x0a9e('0xda')]=function(_0x3f7cb6,_0x3c8a9a){return db[_0x0a9e('0xa3')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3f7cb6['params']['id'],'ItemClass':_0x0a9e('0xdb')},'include':[{'model':db[_0x0a9e('0xba')],'as':'ItemType'}],'order':[[db['sequelize'][_0x0a9e('0xbc')](_0x0a9e('0xd8'))],[_0x0a9e('0xd7')]]})['then'](function(_0x268eae){return _0x268eae;})['then'](respondWithResult(_0x3c8a9a,null))[_0x0a9e('0x8b')](handleError(_0x3c8a9a,null));};exports['duplicateAdditionalPhones']=function(_0x22d31f,_0x5e9c92){return db[_0x0a9e('0xa3')][_0x0a9e('0x8d')]({'raw':!![],'where':{'CmContactId':_0x22d31f[_0x0a9e('0x8c')]['fromContactId']}})[_0x0a9e('0x23')](function(_0x497fda){var _0x505ffd=_[_0x0a9e('0x52')](_0x497fda,function(_0x23993f){_0x23993f[_0x0a9e('0xdc')]=_0x22d31f[_0x0a9e('0x8c')][_0x0a9e('0xdd')];return _0x23993f;});return db[_0x0a9e('0xa3')][_0x0a9e('0xb0')](_0x505ffd,{});})[_0x0a9e('0x23')](function(_0x1a3143){return addCmHopperPhones(_0x22d31f[_0x0a9e('0x8c')][_0x0a9e('0xdd')]);})[_0x0a9e('0x23')](function(_0x26361f){return['ok'];})[_0x0a9e('0x23')](respondWithResult(_0x5e9c92,null))[_0x0a9e('0x8b')](handleError(_0x5e9c92,null));};exports[_0x0a9e('0xde')]=function(_0x310026,_0x643f66){var _0x153de1=[];_0x153de1['push'](createCmHopperPhone(_0x310026[_0x0a9e('0x8c')]['id'],_0x310026[_0x0a9e('0x8c')][_0x0a9e('0xdf')]));Promise[_0x0a9e('0x32')](_0x153de1)['then'](function(){return[0x1];})['then'](respondWithResult(_0x643f66,null));};exports['getHoppers']=function(_0x2b8823,_0x55926d,_0xea26ca){var _0x1fafc2={'raw':![],'where':{}};var _0x130ae8={};var _0x43fe24={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x30')]({'where':{'id':_0x2b8823[_0x0a9e('0xb9')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x55926d,null))[_0x0a9e('0x23')](function(_0x6b948a){if(_0x6b948a){_0x130ae8['model']=_[_0x0a9e('0x2b')](db['CmHopper'][_0x0a9e('0xc9')]);_0x130ae8['query']=_[_0x0a9e('0x2b')](_0x2b8823[_0x0a9e('0x35')]);_0x130ae8[_0x0a9e('0x36')]=_['intersection'](_0x130ae8[_0x0a9e('0x34')],_0x130ae8[_0x0a9e('0x35')]);_0x1fafc2['attributes']=_['intersection'](_0x130ae8[_0x0a9e('0x34')],qs[_0x0a9e('0x38')](_0x2b8823[_0x0a9e('0x35')]['fields']));_0x1fafc2['attributes']=_0x1fafc2['attributes'][_0x0a9e('0x2c')]?_0x1fafc2[_0x0a9e('0x39')]:_0x130ae8[_0x0a9e('0x34')];if(!_0x2b8823[_0x0a9e('0x35')][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x1fafc2[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x2b8823[_0x0a9e('0x35')][_0x0a9e('0x1d')]);_0x1fafc2[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x2b8823[_0x0a9e('0x35')][_0x0a9e('0x1b')]);}_0x1fafc2[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2b8823[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x1fafc2['where']=qs[_0x0a9e('0x36')](_[_0x0a9e('0xca')](_0x2b8823[_0x0a9e('0x35')],_0x130ae8[_0x0a9e('0x36')]));_0x1fafc2[_0x0a9e('0x3e')][_0x0a9e('0xe0')]=_0x6b948a['id'];if(_0x2b8823['query'][_0x0a9e('0x5d')]){_0x1fafc2[_0x0a9e('0x3e')]=_[_0x0a9e('0xcb')](_0x1fafc2[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x52')](_0x1fafc2[_0x0a9e('0x39')],function(_0x103ad9){var _0x7c4ce2={};_0x7c4ce2[_0x103ad9]={'$like':'%'+_0x2b8823[_0x0a9e('0x35')]['filter']+'%'};return _0x7c4ce2;})});}_0x1fafc2=_['merge']({},_0x1fafc2,_0x2b8823[_0x0a9e('0xcc')]);return db[_0x0a9e('0x94')]['count']({'where':_0x1fafc2[_0x0a9e('0x3e')]})[_0x0a9e('0x23')](function(_0x4c8d75){_0x43fe24[_0x0a9e('0x1e')]=_0x4c8d75;if(_0x2b8823['query'][_0x0a9e('0xe1')]){_0x1fafc2[_0x0a9e('0xe2')]=[{'all':!![]}];}return db['CmHopper'][_0x0a9e('0x8d')](_0x1fafc2);})[_0x0a9e('0x23')](function(_0x5952c8){_0x43fe24[_0x0a9e('0x85')]=_0x5952c8;return _0x43fe24;});}})[_0x0a9e('0x23')](respondWithFilteredResult(_0x55926d,_0x1fafc2))['catch'](handleError(_0x55926d,null));};exports[_0x0a9e('0xe3')]=function(_0x237994,_0x28a078,_0x24361){var _0x8f68ec={'raw':!![],'where':{}};var _0x17a0d5={};var _0x5d525f={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x30')]({'where':{'id':_0x237994['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x28a078,null))[_0x0a9e('0x23')](function(_0x22c390){if(_0x22c390){_0x17a0d5[_0x0a9e('0x34')]=_[_0x0a9e('0x2b')](db[_0x0a9e('0xa5')][_0x0a9e('0xc9')]);_0x17a0d5['query']=_['keys'](_0x237994['query']);_0x17a0d5['filters']=_['intersection'](_0x17a0d5[_0x0a9e('0x34')],_0x17a0d5[_0x0a9e('0x35')]);_0x8f68ec['attributes']=_['intersection'](_0x17a0d5[_0x0a9e('0x34')],qs['fields'](_0x237994[_0x0a9e('0x35')][_0x0a9e('0x38')]));_0x8f68ec[_0x0a9e('0x39')]=_0x8f68ec[_0x0a9e('0x39')][_0x0a9e('0x2c')]?_0x8f68ec[_0x0a9e('0x39')]:_0x17a0d5['model'];if(!_0x237994[_0x0a9e('0x35')][_0x0a9e('0x3a')]('nolimit')){_0x8f68ec[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x237994[_0x0a9e('0x35')][_0x0a9e('0x1d')]);_0x8f68ec[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x237994[_0x0a9e('0x35')]['offset']);}_0x8f68ec[_0x0a9e('0x3c')]=qs['sort'](_0x237994[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x8f68ec['where']=qs[_0x0a9e('0x36')](_[_0x0a9e('0xca')](_0x237994['query'],_0x17a0d5[_0x0a9e('0x36')]));_0x8f68ec['where'][_0x0a9e('0xe0')]=_0x22c390['id'];if(_0x237994[_0x0a9e('0x35')]['filter']){_0x8f68ec[_0x0a9e('0x3e')]=_['merge'](_0x8f68ec[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x52')](_0x8f68ec[_0x0a9e('0x39')],function(_0x37ef45){var _0x288127={};_0x288127[_0x37ef45]={'$like':'%'+_0x237994[_0x0a9e('0x35')][_0x0a9e('0x5d')]+'%'};return _0x288127;})});}_0x8f68ec=_['merge']({},_0x8f68ec,_0x237994[_0x0a9e('0xcc')]);return db[_0x0a9e('0xa5')][_0x0a9e('0x1e')]({'where':_0x8f68ec[_0x0a9e('0x3e')]})[_0x0a9e('0x23')](function(_0x5932ad){_0x5d525f[_0x0a9e('0x1e')]=_0x5932ad;if(_0x237994['query']['includeAll']){_0x8f68ec[_0x0a9e('0xe2')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x8d')](_0x8f68ec);})[_0x0a9e('0x23')](function(_0x58d5fd){_0x5d525f[_0x0a9e('0x85')]=_0x58d5fd;return _0x5d525f;});}})[_0x0a9e('0x23')](respondWithFilteredResult(_0x28a078,_0x8f68ec))[_0x0a9e('0x8b')](handleError(_0x28a078,null));};exports[_0x0a9e('0xe4')]=function(_0x2e1adc,_0x25eb44,_0x3d2bb0){var _0xb8c15={'raw':!![],'where':{}};var _0x3d02ae={};var _0x5871d7={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x30')]({'where':{'id':_0x2e1adc[_0x0a9e('0xb9')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x25eb44,null))['then'](function(_0x38d95a){if(_0x38d95a){_0x3d02ae[_0x0a9e('0x34')]=_[_0x0a9e('0x2b')](db['CmHopperFinal'][_0x0a9e('0xc9')]);_0x3d02ae[_0x0a9e('0x35')]=_[_0x0a9e('0x2b')](_0x2e1adc['query']);_0x3d02ae[_0x0a9e('0x36')]=_['intersection'](_0x3d02ae[_0x0a9e('0x34')],_0x3d02ae[_0x0a9e('0x35')]);_0xb8c15[_0x0a9e('0x39')]=_[_0x0a9e('0x37')](_0x3d02ae[_0x0a9e('0x34')],qs[_0x0a9e('0x38')](_0x2e1adc[_0x0a9e('0x35')]['fields']));_0xb8c15[_0x0a9e('0x39')]=_0xb8c15[_0x0a9e('0x39')][_0x0a9e('0x2c')]?_0xb8c15[_0x0a9e('0x39')]:_0x3d02ae[_0x0a9e('0x34')];if(!_0x2e1adc[_0x0a9e('0x35')][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0xb8c15[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x2e1adc[_0x0a9e('0x35')][_0x0a9e('0x1d')]);_0xb8c15[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x2e1adc[_0x0a9e('0x35')][_0x0a9e('0x1b')]);}_0xb8c15[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2e1adc[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0xb8c15[_0x0a9e('0x3e')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0xca')](_0x2e1adc['query'],_0x3d02ae[_0x0a9e('0x36')]));_0xb8c15[_0x0a9e('0x3e')][_0x0a9e('0xe0')]=_0x38d95a['id'];if(_0x2e1adc['query'][_0x0a9e('0x5d')]){_0xb8c15['where']=_[_0x0a9e('0xcb')](_0xb8c15[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x52')](_0xb8c15[_0x0a9e('0x39')],function(_0x455bca){var _0xb09ef6={};_0xb09ef6[_0x455bca]={'$like':'%'+_0x2e1adc[_0x0a9e('0x35')][_0x0a9e('0x5d')]+'%'};return _0xb09ef6;})});}_0xb8c15=_['merge']({},_0xb8c15,_0x2e1adc[_0x0a9e('0xcc')]);return db[_0x0a9e('0xa4')]['count']({'where':_0xb8c15[_0x0a9e('0x3e')]})[_0x0a9e('0x23')](function(_0x579bb0){_0x5871d7['count']=_0x579bb0;if(_0x2e1adc[_0x0a9e('0x35')][_0x0a9e('0xe1')]){_0xb8c15[_0x0a9e('0xe2')]=[{'all':!![]}];}return db[_0x0a9e('0xa4')]['findAll'](_0xb8c15);})[_0x0a9e('0x23')](function(_0x31648e){_0x5871d7[_0x0a9e('0x85')]=_0x31648e;return _0x5871d7;});}})[_0x0a9e('0x23')](respondWithFilteredResult(_0x25eb44,_0xb8c15))[_0x0a9e('0x8b')](handleError(_0x25eb44,null));};exports['getJscriptySessions']=function(_0xa3ba12,_0x3fc431,_0x4df303){var _0x34112c={'raw':!![],'where':{}};var _0x2d20a0={};var _0x38284a={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0xa3ba12[_0x0a9e('0xb9')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x3fc431,null))[_0x0a9e('0x23')](function(_0x283bbb){if(_0x283bbb){_0x2d20a0[_0x0a9e('0x34')]=_[_0x0a9e('0x2b')](db[_0x0a9e('0xab')][_0x0a9e('0xc9')]);_0x2d20a0['query']=_['keys'](_0xa3ba12[_0x0a9e('0x35')]);_0x2d20a0['filters']=_[_0x0a9e('0x37')](_0x2d20a0[_0x0a9e('0x34')],_0x2d20a0[_0x0a9e('0x35')]);_0x34112c[_0x0a9e('0x39')]=_['intersection'](_0x2d20a0[_0x0a9e('0x34')],qs[_0x0a9e('0x38')](_0xa3ba12['query'][_0x0a9e('0x38')]));_0x34112c['attributes']=_0x34112c[_0x0a9e('0x39')][_0x0a9e('0x2c')]?_0x34112c[_0x0a9e('0x39')]:_0x2d20a0[_0x0a9e('0x34')];if(!_0xa3ba12[_0x0a9e('0x35')][_0x0a9e('0x3a')]('nolimit')){_0x34112c[_0x0a9e('0x1d')]=qs['limit'](_0xa3ba12[_0x0a9e('0x35')][_0x0a9e('0x1d')]);_0x34112c[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0xa3ba12[_0x0a9e('0x35')][_0x0a9e('0x1b')]);}_0x34112c[_0x0a9e('0x3c')]=qs['sort'](_0xa3ba12[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x34112c[_0x0a9e('0x3e')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0xca')](_0xa3ba12['query'],_0x2d20a0[_0x0a9e('0x36')]));_0x34112c[_0x0a9e('0x3e')]['ContactId']=_0x283bbb['id'];if(_0xa3ba12['query'][_0x0a9e('0x5d')]){_0x34112c[_0x0a9e('0x3e')]=_[_0x0a9e('0xcb')](_0x34112c[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x52')](_0x34112c[_0x0a9e('0x39')],function(_0x4d35ed){var _0x1e31c2={};_0x1e31c2[_0x4d35ed]={'$like':'%'+_0xa3ba12[_0x0a9e('0x35')][_0x0a9e('0x5d')]+'%'};return _0x1e31c2;})});}_0x34112c=_['merge']({},_0x34112c,_0xa3ba12[_0x0a9e('0xcc')]);return db[_0x0a9e('0xab')][_0x0a9e('0x1e')]({'where':_0x34112c[_0x0a9e('0x3e')]})['then'](function(_0x5d4935){_0x38284a[_0x0a9e('0x1e')]=_0x5d4935;if(_0xa3ba12[_0x0a9e('0x35')][_0x0a9e('0xe1')]){_0x34112c[_0x0a9e('0xe2')]=[{'all':!![]}];}return db[_0x0a9e('0xab')][_0x0a9e('0x8d')](_0x34112c);})[_0x0a9e('0x23')](function(_0x23dd12){_0x38284a['rows']=_0x23dd12;return _0x38284a;});}})[_0x0a9e('0x23')](respondWithFilteredResult(_0x3fc431,_0x34112c))['catch'](handleError(_0x3fc431,null));};exports[_0x0a9e('0xe5')]=function(_0x20dcfd,_0x3fd399,_0x4984b1){try{if(!_0x20dcfd['body'][_0x0a9e('0x60')]){throw new Error('No\x20ListId\x20specified');}if(!_0x20dcfd[_0x0a9e('0x8c')]['binding_keys']){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xe6')]){throw new Error(_0x0a9e('0xe7'));}if(!_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xe8')]){throw new Error(_0x0a9e('0xe9'));}var _0x2f64ef=_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xea')][_0x0a9e('0x84')](',');var _0x81f495=_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xe6')]['split'](',');if(!_0x2f64ef['length']||!_0x81f495[_0x0a9e('0x2c')]||_0x2f64ef['length']!==_0x81f495[_0x0a9e('0x2c')]){throw new Error(_0x0a9e('0xeb'));}_0x20dcfd[_0x0a9e('0x8c')]['fields']=_['zipObject'](_0x2f64ef,_0x81f495);if(!_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0x38')][_0x0a9e('0xc7')]){throw new Error(_0x0a9e('0xec'));}if(!_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0x38')][_0x0a9e('0xed')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x12984a=path['join'](config[_0x0a9e('0xee')],_0x0a9e('0xef'),_0x20dcfd['file'][_0x0a9e('0xf0')]);fs[_0x0a9e('0xf1')](_0x12984a,parseInt(_0x0a9e('0xf2'),0x8));var _0x4524b8=require(_0x0a9e('0xf3'))[_0x0a9e('0xf4')](path['join'](__dirname,_0x0a9e('0xf5')),[_0x12984a,_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xea')],_0x20dcfd['body'][_0x0a9e('0xe6')],_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0x60')],_0x20dcfd['body'][_0x0a9e('0xf6')],_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xb2')],_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xe8')]]);return _0x3fd399[_0x0a9e('0x1a')](0xc8)['json']({'message':'File\x20uploaded\x20correctly!','pid':_0x4524b8[_0x0a9e('0xf7')]});}catch(_0x1e01af){return _0x3fd399['status'](0x1f4)[_0x0a9e('0xf8')](_0x1e01af);}};exports[_0x0a9e('0xf9')]=function(_0x315735,_0x35dadd,_0x2e413d){var _0x4e3983=fs['createReadStream'](_0x315735[_0x0a9e('0xfa')][_0x0a9e('0x6')]);Papa[_0x0a9e('0xfb')](_0x4e3983,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4edb79){return _0x35dadd[_0x0a9e('0x1a')](0xc8)[_0x0a9e('0xfc')]({'file':_0x315735[_0x0a9e('0xfa')],'fields':_0x4edb79[_0x0a9e('0xfd')]['fields']});}});};exports['import']=function(_0x46b143,_0x14b098,_0x16b4ae){return db['User'][_0x0a9e('0x8d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0x73')}})[_0x0a9e('0x23')](function(_0x1fc545){var _0x45616c=![];if(!_0x46b143[_0x0a9e('0x8c')][_0x0a9e('0x60')]){throw new Error(_0x0a9e('0xfe'));}if(!_0x46b143['body']['binding'][_0x0a9e('0xc7')]){throw new Error(_0x0a9e('0xec'));}if(!_0x46b143['body'][_0x0a9e('0xff')]['firstName']){throw new Error(_0x0a9e('0x100'));}if(!_0x46b143[_0x0a9e('0x8c')]['socket_timestamp']){throw new Error(_0x0a9e('0xe9'));}var _0xd6570f=require('child_process')[_0x0a9e('0xf4')](path[_0x0a9e('0x91')](__dirname,_0x0a9e('0x101')),[_0x46b143[_0x0a9e('0xb9')]['id'],JSON[_0x0a9e('0x102')](_0x46b143[_0x0a9e('0x8c')]),JSON[_0x0a9e('0x102')](_0x1fc545)]);_0xd6570f['on']('message',function(_0x1da68c){_0x45616c=!![];return _0x14b098[_0x0a9e('0x1a')](0xc8)[_0x0a9e('0xfc')]({'message':_0x0a9e('0x103'),'pid':_0xd6570f[_0x0a9e('0xf7')]});});_0xd6570f['on'](_0x0a9e('0x104'),function(_0x456884){if(_0x456884&&!_0x45616c){return _0x14b098['status'](0x1f4)['json']({'message':_0x0a9e('0x105'),'pid':_0xd6570f[_0x0a9e('0xf7')]});}});})[_0x0a9e('0x8b')](handleError(_0x14b098,null));};exports['importUpdates']=function(_0x5cf1ba,_0xf7ddca,_0x55075d){return db[_0x0a9e('0x56')][_0x0a9e('0x8d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0x73')}})[_0x0a9e('0x23')](function(_0x20f4cb){var _0x13c6df=![];if(!_0x5cf1ba[_0x0a9e('0x8c')][_0x0a9e('0x60')]){throw new Error(_0x0a9e('0xfe'));}if(!_0x5cf1ba['body']['binding'][_0x0a9e('0xc7')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x5cf1ba[_0x0a9e('0x8c')][_0x0a9e('0xff')][_0x0a9e('0xed')]){throw new Error(_0x0a9e('0x100'));}if(!_0x5cf1ba['body'][_0x0a9e('0xe8')]){throw new Error(_0x0a9e('0xe9'));}var _0x2bc6a3=require('child_process')[_0x0a9e('0xf4')](path[_0x0a9e('0x91')](__dirname,_0x0a9e('0x106')),[_0x5cf1ba['params']['id'],JSON[_0x0a9e('0x102')](_0x5cf1ba[_0x0a9e('0x8c')]),JSON[_0x0a9e('0x102')](_0x20f4cb)]);_0x2bc6a3['on'](_0x0a9e('0x107'),function(_0x69b4d6){_0x13c6df=!![];return _0xf7ddca[_0x0a9e('0x1a')](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x2bc6a3[_0x0a9e('0xf7')]});});_0x2bc6a3['on'](_0x0a9e('0x104'),function(_0x10d713){if(_0x10d713&&!_0x13c6df){return _0xf7ddca['status'](0x1f4)['json']({'message':_0x0a9e('0x105'),'pid':_0x2bc6a3[_0x0a9e('0xf7')]});}});})[_0x0a9e('0x8b')](handleError(_0xf7ddca,null));};exports['getJourney']=function(_0x4b51ff,_0x12d1dd){var _0x2c8d95=[_0x0a9e('0x108'),_0x0a9e('0x109'),_0x0a9e('0x10a'),'openchannel',_0x0a9e('0x10b'),'whatsapp',_0x0a9e('0x10c')];var _0x311e40={'offset':0x0,'order':qs[_0x0a9e('0x3d')]('-createdAt')},_0x57e719={'count':0x0,'rows':[]};Promise[_0x0a9e('0x71')]()[_0x0a9e('0x23')](function(){if(_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x10d')]){if(!_[_0x0a9e('0x10e')](_0x2c8d95,_0x4b51ff['query'][_0x0a9e('0x10d')][_0x0a9e('0x10f')]())){throw new Error(_0x0a9e('0x110'));}_0x2c8d95=[_0x4b51ff['query'][_0x0a9e('0x10d')]['toLowerCase']()];}if(_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x111')]){try{var _0x2777fe=JSON['parse'](_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x111')]);if(!moment(_0x2777fe[_0x0a9e('0x42')])[_0x0a9e('0x112')]()){throw new Error(_0x0a9e('0x113'));}if(!moment(_0x2777fe['to'])[_0x0a9e('0x112')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x3057c9){throw new Error(_0x0a9e('0x114'));}}if(!_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x311e40[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x4b51ff[_0x0a9e('0x35')]['limit']||0xa);_0x311e40[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x1b')]);}var _0x55a300=_0x2c8d95[_0x0a9e('0x52')](function(_0x57c3c4){if(_0x57c3c4===_0x0a9e('0x10c')){var _0x22ef0f={'attributes':['id',_0x0a9e('0x115'),'type',_0x0a9e('0x116'),_0x0a9e('0x117'),_0x0a9e('0x118'),_0x0a9e('0x119'),'endtime',_0x0a9e('0x11a'),_0x0a9e('0x11b'),_0x0a9e('0x11c'),_0x0a9e('0x11d'),_0x0a9e('0x11e'),_0x0a9e('0x11f'),_0x0a9e('0x120')],'where':{'ContactId':_0x4b51ff['params']['id']},'include':[{'model':db[_0x0a9e('0x56')],'as':_0x0a9e('0x56'),'attributes':['id',_0x0a9e('0x27'),_0x0a9e('0x121'),'alias']}],'order':[[_0x0a9e('0x11c'),'DESC']]};if(_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x111')]){_0x22ef0f[_0x0a9e('0x3e')][_0x0a9e('0x11c')]={'$gte':_0x2777fe[_0x0a9e('0x42')],'$lte':_0x2777fe['to']};}return db[_0x0a9e('0xa6')][_0x0a9e('0x122')](_0x22ef0f)['then'](function(_0x173f03){_0x57e719['count']+=_0x173f03[_0x0a9e('0x1e')];return _[_0x0a9e('0x52')](_0x173f03['rows'],function(_0x2ebed3){var _0x167f89=_0x2ebed3[_0x0a9e('0x8e')]({'plain':!![]});_0x167f89[_0x0a9e('0x10d')]=_0x57c3c4;if(_0x167f89['User']){_0x167f89[_0x0a9e('0x56')]={'id':_0x167f89[_0x0a9e('0x56')]['id'],'name':_0x167f89['User'][_0x0a9e('0x27')],'fullname':_0x167f89['User']['fullname'],'alias':_0x167f89['User'][_0x0a9e('0x123')]};}return _0x167f89;});});}else{var _0x2ec662=_['startCase'](_0x57c3c4)+(_0x57c3c4===_0x0a9e('0x109')?_0x0a9e('0x124'):'Account');var _0xc48226={'attributes':['id',_0x0a9e('0x125'),_0x0a9e('0x126'),_0x0a9e('0x11c'),_0x0a9e('0x11b'),_0x0a9e('0x127'),_0x0a9e('0x128'),'thirdDisposition',_0x0a9e('0x120'),_0x2ec662+'Id'],'where':{'ContactId':_0x4b51ff['params']['id']},'include':[{'model':db[_0x2ec662],'as':_0x0a9e('0x129'),'attributes':['id',_0x0a9e('0x27'),_0x0a9e('0x12a')]},{'model':db[_0x0a9e('0x56')],'as':_0x0a9e('0x12b'),'attributes':['id',_0x0a9e('0x27'),'fullname']},{'model':db[_0x0a9e('0x50')],'as':_0x0a9e('0x83'),'attributes':['id',_0x0a9e('0x27'),'color'],'through':{'attributes':[]}}],'order':[[_0x0a9e('0x11c'),_0x0a9e('0x6f')]]};if(_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x111')]){_0xc48226[_0x0a9e('0x3e')][_0x0a9e('0x11c')]={'$gte':_0x2777fe[_0x0a9e('0x42')],'$lte':_0x2777fe['to']};}switch(_0x57c3c4){case _0x0a9e('0x109'):_0xc48226[_0x0a9e('0x39')][_0x0a9e('0x2e')](_0x0a9e('0x12c'),_0x0a9e('0x12d'),_0x0a9e('0x12e'),_0x0a9e('0x12f'),_0x0a9e('0x130'),_0x0a9e('0x131'),'ratingType',_0x0a9e('0x132'),_0x0a9e('0x133'));break;case _0x0a9e('0x108'):_0xc48226['attributes'][_0x0a9e('0x2e')](_0x0a9e('0x134'),_0x0a9e('0x135'));break;case _0x0a9e('0x136'):_0xc48226['attributes'][_0x0a9e('0x2e')](_0x0a9e('0x137'),_0x0a9e('0x138'));break;}return db[_[_0x0a9e('0x139')](_0x57c3c4)+'Interaction'][_0x0a9e('0x122')](_0xc48226)[_0x0a9e('0x23')](function(_0x132455){_0x57e719[_0x0a9e('0x1e')]+=_0x132455['count'];return _['map'](_0x132455[_0x0a9e('0x85')],function(_0x44343f){var _0x2de997=_0x44343f[_0x0a9e('0x8e')]({'plain':!![]});_0x2de997[_0x0a9e('0x10d')]=_0x57c3c4;if(_0x2de997[_0x0a9e('0x12b')]){_0x2de997[_0x0a9e('0x12b')]={'id':_0x2de997[_0x0a9e('0x12b')]['id'],'name':_0x2de997[_0x0a9e('0x12b')][_0x0a9e('0x27')],'fullname':_0x2de997[_0x0a9e('0x12b')][_0x0a9e('0x121')]};}return _0x2de997;});});}});return Promise[_0x0a9e('0x32')](_0x55a300);})[_0x0a9e('0x23')](function(_0x4f5ebd){return _(_0x4f5ebd)[_0x0a9e('0x13a')]()[_0x0a9e('0x13b')](_0x0a9e('0x11c'))['reverse']()['value']();})[_0x0a9e('0x23')](function(_0x51ec16){_0x57e719[_0x0a9e('0x85')]=_0x311e40[_0x0a9e('0x1d')]?_0x51ec16[_0x0a9e('0x13c')](_0x311e40[_0x0a9e('0x1b')],_0x311e40['offset']+_0x311e40['limit']):_0x51ec16;return _0x57e719;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x12d1dd,_0x311e40))[_0x0a9e('0x8b')](handleError(_0x12d1dd,null));}; \ No newline at end of file +var _0xa9e0=['status','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','index','CmContact','describe','keys','length','cf_','push','CmCustomField','findOne','trimStart','all','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','castTo','DATE','buildExpression','text','start','filter','Contact','isEmpty','ListId','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.phone\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','QueryTypes','clone','DESC','t.id\x20IN\x20?','resolve','user','agent','some','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','role','sequelize','toString','c.firstName','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','split','rows','find','startsWith','displayName','columnName','custom','catch','body','findAll','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','additionalPhones','bulkCreate','each','duplicates','$or','findOrCreate','spread','contact','show','Phones','params','ContactItemType','ItemType','literal','`Phones.ItemType`.OrderBy','log','$and','omit','format','cf_%d','pickBy','setFields','id\x20=\x20?','values','phone','getTags','rawAttributes','pick','merge','options','setTags','ids','setAdditionalPhones','items','item_types','isNil','ItemTypeId','description','CmHopperAdditionalPhone','item','OrderBy','`ItemType`.OrderBy','ItemType.OrderBy','getAdditionalPhones','PHONE','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','ContactId','includeAll','include','getHopperHistories','getHopperFinals','uploadCsv','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','send','upload','file','parse','json','meta','No\x20ListId\x20specified','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','message','mail','chat','sms','fax','voice','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','alias','Website','closed','closedAt','disposition','secondDisposition','Account','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','startCase','flatten','sortBy','slice','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register'];(function(_0x26fe78,_0x2d59f3){var _0x2b92f1=function(_0x2bb367){while(--_0x2bb367){_0x26fe78['push'](_0x26fe78['shift']());}};_0x2b92f1(++_0x2d59f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=typeof _0x5a0a06[_0x0a9e('0x1b')]===_0x0a9e('0x1c')&&typeof _0x5a0a06[_0x0a9e('0x1d')]===_0x0a9e('0x1c');var _0x530eb7=_0x459eb1[_0x0a9e('0x1e')];var _0x1314ae=_0x478723?0x0:_0x5a0a06[_0x0a9e('0x1b')];var _0x1c696a=_0x478723?_0x459eb1[_0x0a9e('0x1e')]:_0x5a0a06['offset']+_0x5a0a06[_0x0a9e('0x1d')];var _0x155cce;if(_0x1c696a>=_0x530eb7){_0x1c696a=_0x530eb7;_0x155cce=0xc8;}else{_0x155cce=0xce;}_0x225616['status'](_0x155cce);return _0x225616[_0x0a9e('0x1f')]('Content-Range',_0x1314ae+'-'+_0x1c696a+'/'+_0x530eb7)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x3a02e1){return function(_0x432e56){try{jsonpatch[_0x0a9e('0x20')](_0x432e56,_0x3a02e1,!![]);}catch(_0x30bae6){return BPromise['reject'](_0x30bae6);}return _0x432e56[_0x0a9e('0x21')]();};}function saveUpdates(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x22')](_0x2fb0e4)[_0x0a9e('0x23')](function(_0x16b1ca){return _0x16b1ca;});}return null;};}function removeEntity(_0x5ea472,_0x59181e){return function(_0x197ec0){if(_0x197ec0){return _0x197ec0[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){_0x5ea472[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x25')](_0x25fba9[_0x0a9e('0x26')]);if(_0x25fba9[_0x0a9e('0x27')]){delete _0x25fba9[_0x0a9e('0x27')];}_0x1dc186[_0x0a9e('0x1a')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x28')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]()[_0x0a9e('0x23')](function(_0x58b06f){var _0x563b45=[];for(var _0x296f41=0x0;_0x296f410x1){_0x10b040['or'](_0x0a9e('0x66'),qs['getFullTextValue'](_0x121cef),null);}else{if(qs[_0x0a9e('0x67')](_0x121cef)){_0x10b040['or']('c.id\x20LIKE\x20?',_0x121cef+'%');_0x10b040['or'](_0x0a9e('0x68'),_0x121cef+'%');_0x10b040['or']('c.mobile\x20LIKE\x20?',_0x121cef+'%');_0x10b040['or']('c.fax\x20LIKE\x20?',_0x121cef+'%');}else if(qs['isEmail'](_0x121cef)){_0x10b040['or'](_0x0a9e('0x69'),_0x121cef+'%');}else{_0x10b040['or']('c.firstName\x20LIKE\x20?','%'+_0x121cef+'%');_0x10b040['or'](_0x0a9e('0x6a'),'%'+_0x121cef+'%');_0x10b040['or'](_0x0a9e('0x69'),'%'+_0x121cef+'%');}}}}_0x23b089[_0x0a9e('0x3e')](_0x10b040);_0x23b089[_0x0a9e('0x6b')](_0x0a9e('0x6c'));var _0x26d7db={'type':db['Sequelize'][_0x0a9e('0x6d')]['SELECT'],'raw':!![]};var _0xca4ade=_0x23b089[_0x0a9e('0x6e')]()[_0x0a9e('0x40')]('c.id');if(_0x2ec755[_0x0a9e('0x3c')]){_0x2ec755[_0x0a9e('0x3c')][_0x0a9e('0x53')](function(_0x32e134){_0x23b089['order']('c.'+_0x32e134[0x0],_0x32e134[0x1]===_0x0a9e('0x6f')?![]:!![]);});}if(!_[_0x0a9e('0x5f')](_0x432fcc)){_0x23b089['having'](_0x25c6e6);_0xca4ade[_0x0a9e('0x3e')](_0x0a9e('0x70'),_0x432fcc);}BPromise[_0x0a9e('0x71')]()[_0x0a9e('0x23')](function(){if(!_0x35ed4a)return;if(_0x468813[_0x0a9e('0x72')]['role']!==_0x0a9e('0x73'))return;if(!_[_0x0a9e('0x74')](_0x35ed4a[_0x0a9e('0x4f')],['field',_0x0a9e('0x56')])){return _0x468813['user']['getLists']({'attributes':['id'],'raw':!![]})[_0x0a9e('0x23')](function(_0x4556c5){if(_[_0x0a9e('0x5f')](_0x4556c5)){_0xca4ade[_0x0a9e('0x3e')](_0x0a9e('0x75'));_0x23b089[_0x0a9e('0x3e')](_0x0a9e('0x75'));}else{_0xca4ade[_0x0a9e('0x3e')](_0x0a9e('0x76'),_[_0x0a9e('0x52')](_0x4556c5,'id'));_0x23b089[_0x0a9e('0x3e')](_0x0a9e('0x76'),_[_0x0a9e('0x52')](_0x4556c5,'id'));}});}})[_0x0a9e('0x23')](function(){if(_0x468813[_0x0a9e('0x72')][_0x0a9e('0x77')]===_0x0a9e('0x73')&&!_0x35ed4a&&!_0x468813[_0x0a9e('0x35')]['ListId'])return[];return db[_0x0a9e('0x78')][_0x0a9e('0x35')](_0xca4ade[_0x0a9e('0x79')](),_0x26d7db);})['then'](function(_0x1148a1){_0x15b200[_0x0a9e('0x1e')]=_0x1148a1['length'];if(_0x15b200[_0x0a9e('0x1e')]===0x0)return[];return db[_0x0a9e('0x78')][_0x0a9e('0x35')](_0x5b4f5e[_0x0a9e('0x79')](),_0x26d7db)[_0x0a9e('0x23')](function(_0x4a43a8){_0x1459bb=_['keyBy'](_0x4a43a8,'id');_0x26d7db=_['merge'](_0x26d7db,{'model':db[_0x0a9e('0x29')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x468813[_0x0a9e('0x35')][_0x0a9e('0x38')]){_0x2ec755[_0x0a9e('0x39')][_0x0a9e('0x53')](function(_0x380ab3){_0x23b089[_0x0a9e('0x40')]('c.'+_0x380ab3);});}else{_0x23b089[_0x0a9e('0x40')]('c.id');_0x23b089[_0x0a9e('0x40')](_0x0a9e('0x7a'));_0x23b089[_0x0a9e('0x40')]('c.lastName');_0x23b089[_0x0a9e('0x40')]('c.phone');_0x23b089[_0x0a9e('0x40')](_0x0a9e('0x7b'));_0x23b089['field'](_0x0a9e('0x7c'));_0x23b089[_0x0a9e('0x40')](_0x0a9e('0x7d'));_0x23b089[_0x0a9e('0x40')]('c.ListId');_0x23b089[_0x0a9e('0x40')](_0x0a9e('0x7e'));_0x23b089[_0x0a9e('0x40')](_0x0a9e('0x7f'));_0x23b089['field'](_0x0a9e('0x80'));_0x23b089[_0x0a9e('0x40')](_0x0a9e('0x81'),_0x0a9e('0x82'));}if(_0x2ec755['limit'])_0x23b089[_0x0a9e('0x1d')](_0x2ec755[_0x0a9e('0x1d')]);if(_0x2ec755[_0x0a9e('0x1b')])_0x23b089[_0x0a9e('0x1b')](_0x2ec755[_0x0a9e('0x1b')]);return db[_0x0a9e('0x78')][_0x0a9e('0x35')](_0x23b089[_0x0a9e('0x79')](),_0x26d7db);});})[_0x0a9e('0x23')](function(_0x336dc3){_0x336dc3[_0x0a9e('0x53')](function(_0x1f10ef){if(_0x1f10ef[_0x0a9e('0x82')]){_0x1f10ef[_0x0a9e('0x83')]=[];_0x1f10ef['TagIds'][_0x0a9e('0x84')](',')[_0x0a9e('0x53')](function(_0xc599b3){_0x1f10ef['Tags'][_0x0a9e('0x2e')](_0x1459bb[_0xc599b3]);});}delete _0x1f10ef[_0x0a9e('0x82')];});_0x15b200[_0x0a9e('0x85')]=_0x336dc3;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755));})['catch'](handleError(_0x2b1f27,null));};exports['destroy']=function(_0x7ebea8,_0x2bbdb5){return db['CmContact'][_0x0a9e('0x86')]({'where':{'id':_0x7ebea8['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2bbdb5,null))[_0x0a9e('0x23')](removeEntity(_0x2bbdb5,null))['catch'](handleError(_0x2bbdb5,null));};exports[_0x0a9e('0x2a')]=function(_0x41cf12,_0x2d2286){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]()[_0x0a9e('0x23')](function(_0x444f1f){delete _0x444f1f['tags'];for(var _0x2973d3=0x0;_0x2973d30x0){return new Promise(function(_0x4a70ce,_0x55f91a){var _0x183244=[];for(var _0x1f78b4=0x0;_0x1f78b4<_0x5c4be0[_0x0a9e('0x2c')];_0x1f78b4++){_0x183244['push'](insertAdditionalPhones(_0x5c4be0[_0x1f78b4][_0x0a9e('0xb6')],_0x5c4be0[_0x1f78b4][_0x0a9e('0xaf')]));}Promise[_0x0a9e('0x32')](_0x183244)[_0x0a9e('0x23')](function(){_0x4a70ce(0x1);});})[_0x0a9e('0x23')](function(){return{'success':_0x5b93dd,'failure':_0x556443,'duplicates':_0x6eaaf0};});}else{return{'success':_0x5b93dd,'failure':_0x556443,'duplicates':_0x6eaaf0};}}})[_0x0a9e('0x23')](respondWithResult(_0x98c62c,0xc9))[_0x0a9e('0x8b')](handleError(_0x98c62c,null));};exports[_0x0a9e('0xb7')]=function(_0x3b5bda,_0x5a1848,_0x43c397){var _0x5526a7;return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]()[_0x0a9e('0x23')](function(_0x3cf222){return db[_0x0a9e('0x29')][_0x0a9e('0x86')]({'where':{'id':_0x3b5bda['params']['id']},'include':[{'model':db[_0x0a9e('0x50')],'as':_0x0a9e('0x83'),'attributes':['id',_0x0a9e('0x27'),_0x0a9e('0x41')],'required':_0x3b5bda['query'][_0x0a9e('0x64')]?!![]:![]},{'model':db[_0x0a9e('0xa3')],'as':_0x0a9e('0xb8'),'where':{'CmContactId':_0x3b5bda[_0x0a9e('0xb9')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0xba')],'as':_0x0a9e('0xbb')}]}],'order':[db[_0x0a9e('0x78')][_0x0a9e('0xbc')](_0x0a9e('0xbd'))],'logging':console[_0x0a9e('0xbe')],'attributes':_['keys'](_0x3cf222)});})[_0x0a9e('0x23')](function(_0x88b25f){_0x5526a7=_0x88b25f[_0x0a9e('0x8e')]({'plain':!![]});var _0x26b826={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x88b25f&&_0x88b25f[_0x0a9e('0x60')]){if(_0x88b25f[_0x0a9e('0x60')]){_0x26b826[_0x0a9e('0x3e')][_0x0a9e('0xbf')]['push']({'ListId':{'$ne':_0x88b25f[_0x0a9e('0x60')]}});}}return db[_0x0a9e('0x2f')][_0x0a9e('0x8d')](_0x26b826);})['then'](function(_0x1402c7){return _[_0x0a9e('0xc0')](_0x5526a7,_[_0x0a9e('0x52')](_0x1402c7,function(_0x97d5b5){return util[_0x0a9e('0xc1')](_0x0a9e('0xc2'),_0x97d5b5['id']);}));})[_0x0a9e('0x23')](handleEntityNotFound(_0x5a1848,null))[_0x0a9e('0x23')](respondWithResult(_0x5a1848,null))[_0x0a9e('0x8b')](handleError(_0x5a1848,null));};exports[_0x0a9e('0x22')]=function(_0x5a7dad,_0x251753){var _0x446e6;if(_0x5a7dad[_0x0a9e('0x8c')]['id']){delete _0x5a7dad[_0x0a9e('0x8c')]['id'];}return db[_0x0a9e('0x29')][_0x0a9e('0x86')]({'where':{'id':_0x5a7dad['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x251753,null))['then'](saveUpdates(_0x5a7dad['body'],null))['then'](function(_0x19e4e6){_0x446e6=_0x19e4e6;var _0x3fa3f2={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x19e4e6&&_0x19e4e6[_0x0a9e('0x60')]){if(_0x19e4e6[_0x0a9e('0x60')]){_0x3fa3f2['where'][_0x0a9e('0xbf')][_0x0a9e('0x2e')]({'ListId':{'$ne':_0x19e4e6[_0x0a9e('0x60')]}});}}return db[_0x0a9e('0x2f')][_0x0a9e('0x8d')](_0x3fa3f2);})['then'](function(_0x57b1b1){if(_0x57b1b1){return _[_0x0a9e('0xc0')](_[_0x0a9e('0xc3')](_0x5a7dad[_0x0a9e('0x8c')],function(_0x5e85d0,_0x319752){return _[_0x0a9e('0x87')](_0x319752,_0x0a9e('0x2d'));}),_['map'](_0x57b1b1,function(_0x8ad1c0){return util[_0x0a9e('0xc1')](_0x0a9e('0xc2'),_0x8ad1c0['id']);}));}})['then'](function(_0x272291){if(_0x272291&&!_[_0x0a9e('0x5f')](_0x272291)){var _0x3b7213=squel['update']()['table']('cm_contacts')[_0x0a9e('0xc4')](_0x272291)[_0x0a9e('0x3e')](_0x0a9e('0xc5'),_0x5a7dad[_0x0a9e('0xb9')]['id'])['toParam']();return db[_0x0a9e('0x78')]['query'](_0x3b7213[_0x0a9e('0x5b')],{'replacements':_0x3b7213[_0x0a9e('0xc6')]});}})[_0x0a9e('0x23')](function(){if(_0x5a7dad['body'][_0x0a9e('0xc7')]&&_0x446e6){return db[_0x0a9e('0x94')][_0x0a9e('0x22')]({'phone':_0x5a7dad['body'][_0x0a9e('0xc7')]},{'where':{'ContactId':_0x446e6['id']}});}})['then'](function(){return _0x446e6;})[_0x0a9e('0x23')](respondWithResult(_0x251753,null))['catch'](handleError(_0x251753,null));};exports[_0x0a9e('0xc8')]=function(_0x57b7d4,_0xb14971,_0x37215d){var _0xa288e4={};var _0x10ace8={};var _0x1e306c;var _0x251dd9;return db[_0x0a9e('0x29')]['findOne']({'where':{'id':_0x57b7d4[_0x0a9e('0xb9')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0xb14971,null))['then'](function(_0xf4fb77){if(_0xf4fb77){_0x1e306c=_0xf4fb77;_0x10ace8[_0x0a9e('0x34')]=_['keys'](db[_0x0a9e('0x50')][_0x0a9e('0xc9')]);_0x10ace8[_0x0a9e('0x35')]=_['keys'](_0x57b7d4[_0x0a9e('0x35')]);_0x10ace8[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x10ace8[_0x0a9e('0x34')],_0x10ace8[_0x0a9e('0x35')]);_0xa288e4[_0x0a9e('0x39')]=_[_0x0a9e('0x37')](_0x10ace8[_0x0a9e('0x34')],qs[_0x0a9e('0x38')](_0x57b7d4[_0x0a9e('0x35')]['fields']));_0xa288e4[_0x0a9e('0x39')]=_0xa288e4['attributes'][_0x0a9e('0x2c')]?_0xa288e4[_0x0a9e('0x39')]:_0x10ace8[_0x0a9e('0x34')];_0xa288e4[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x57b7d4[_0x0a9e('0x35')]['sort']);_0xa288e4[_0x0a9e('0x3e')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0xca')](_0x57b7d4['query'],_0x10ace8[_0x0a9e('0x36')]));if(_0x57b7d4[_0x0a9e('0x35')][_0x0a9e('0x5d')]){_0xa288e4[_0x0a9e('0x3e')]=_[_0x0a9e('0xcb')](_0xa288e4[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x52')](_0xa288e4['attributes'],function(_0x4e1b3){var _0x228c10={};_0x228c10[_0x4e1b3]={'$like':'%'+_0x57b7d4[_0x0a9e('0x35')][_0x0a9e('0x5d')]+'%'};return _0x228c10;})});}_0xa288e4=_[_0x0a9e('0xcb')]({},_0xa288e4,_0x57b7d4[_0x0a9e('0xcc')]);return _0x1e306c[_0x0a9e('0xc8')](_0xa288e4);}})['then'](function(_0x5c8720){if(_0x5c8720){_0x251dd9=_0x5c8720[_0x0a9e('0x2c')];if(!_0x57b7d4[_0x0a9e('0x35')][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0xa288e4[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x57b7d4[_0x0a9e('0x35')]['limit']);_0xa288e4[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x57b7d4[_0x0a9e('0x35')][_0x0a9e('0x1b')]);}return _0x1e306c[_0x0a9e('0xc8')](_0xa288e4);}})[_0x0a9e('0x23')](function(_0x16be7e){if(_0x16be7e){return _0x16be7e?{'count':_0x251dd9,'rows':_0x16be7e}:null;}})['then'](respondWithResult(_0xb14971,null))[_0x0a9e('0x8b')](handleError(_0xb14971,null));};exports[_0x0a9e('0xcd')]=function(_0x231826,_0x5885c3,_0x2b8ad4){if(_0x231826[_0x0a9e('0x8c')]['id']){delete _0x231826[_0x0a9e('0x8c')]['id'];}return db[_0x0a9e('0x29')]['findOne']({'where':{'id':_0x231826[_0x0a9e('0xb9')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5885c3,null))[_0x0a9e('0x23')](function(_0x93d953){if(_0x93d953){return _0x93d953[_0x0a9e('0xcd')](_0x231826[_0x0a9e('0x8c')][_0x0a9e('0xce')]||[]);}return null;})[_0x0a9e('0x23')](respondWithResult(_0x5885c3,null))['catch'](handleError(_0x5885c3,null));};exports[_0x0a9e('0xcf')]=function(_0x266aa1,_0x25e41f){var _0x397771=[];_0x397771['push'](addAdditionalPhones(_0x266aa1['body']));Promise[_0x0a9e('0x32')](_0x397771)[_0x0a9e('0x23')](function(){_0x397771=[];_0x397771[_0x0a9e('0x2e')](deleteCmHopperPhones(_0x266aa1['body']['id']));_0x397771[_0x0a9e('0x2e')](addCmHopperPhones(_0x266aa1[_0x0a9e('0x8c')]['id']));Promise['all'](_0x397771)[_0x0a9e('0x23')](function(){return[0x1];})['then'](respondWithResult(_0x25e41f,null));});};function addAdditionalPhones(_0x35cc2a){return new Promise(function(_0x54dbbf,_0x5b42b9){return db['CmContactHasItem'][_0x0a9e('0x24')]({'where':{'CmContactId':_0x35cc2a['id']}})[_0x0a9e('0x23')](function(){var _0x19f800=[];for(var _0x20007e=0x0;_0x20007e<_0x35cc2a[_0x0a9e('0xd0')][_0x0a9e('0x2c')];_0x20007e++){_0x19f800['push'](addAdditionalPhone(_0x35cc2a['id'],_0x35cc2a[_0x0a9e('0xd0')][_0x20007e][_0x0a9e('0xc7')],_0x35cc2a[_0x0a9e('0xd1')]?_[_0x0a9e('0xd2')](_0x35cc2a[_0x0a9e('0xd1')][_0x20007e])?null:_0x35cc2a[_0x0a9e('0xd1')][_0x20007e]:_0x35cc2a[_0x0a9e('0xd0')][_0x20007e]['ItemTypeId']?_0x35cc2a['items'][_0x20007e][_0x0a9e('0xd3')]:null,_0x20007e,_0x35cc2a['items'][_0x20007e][_0x0a9e('0xd4')]));}Promise[_0x0a9e('0x32')](_0x19f800)[_0x0a9e('0x23')](function(){_0x54dbbf(0x1);});});});}function addAdditionalPhone(_0xa3695f,_0x37a448,_0x383dd8,_0x594f25,_0x4716d1){return db['CmContactHasItem']['find']({'where':{'CmContactId':_0xa3695f,'item':_0x37a448}})[_0x0a9e('0x23')](function(_0x593f9e){if(_0x593f9e)logger[_0x0a9e('0x92')]('contact\x20phone\x20exists',_0x593f9e);else{db['CmContactHasItem'][_0x0a9e('0x98')]({'CmContactId':_0xa3695f,'item':_0x37a448,'ItemTypeId':_0x383dd8,'OrderBy':_0x594f25,'ItemClass':'PHONE','description':_0x4716d1});}});}function deletePhones(_0x24470a){return db[_0x0a9e('0xa3')][_0x0a9e('0x24')]({'where':{'CmContactId':_0x24470a}});}function deleteCmHopperPhones(_0x48f532){return new Promise(function(_0x4152cd,_0x1209c4){return db[_0x0a9e('0x94')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x48f532}})['then'](function(_0xdc77d){db[_0x0a9e('0xd5')][_0x0a9e('0x24')]({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x52')](_0xdc77d,'id')}}});})[_0x0a9e('0x23')](function(){_0x4152cd(0x1);});});}function addCmHopperPhones(_0x376b97){return new Promise(function(_0x247a6c,_0x170b3d){return db[_0x0a9e('0x94')][_0x0a9e('0x8d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x376b97}})['then'](function(_0x51fa33){var _0x558171=[];_[_0x0a9e('0x52')](_0x51fa33,function(_0x19dcc2){_0x558171[_0x0a9e('0x2e')](createCmHopperPhone(_0x376b97,_0x19dcc2['id']));});Promise[_0x0a9e('0x32')](_0x558171)[_0x0a9e('0x23')](function(){_0x247a6c(0x1);});});});}function createCmHopperPhone(_0x2dc202,_0x2b97fc){return new Promise(function(_0x307d13,_0x5d74e9){db['CmContactHasItem'][_0x0a9e('0x8d')]({'raw':!![],'attributes':[_0x0a9e('0xd6')],'where':{'CmContactId':_0x2dc202,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0xba')],'attributes':[_0x0a9e('0xd7')],'as':_0x0a9e('0xbb')}],'order':[db[_0x0a9e('0x78')][_0x0a9e('0xbc')](_0x0a9e('0xd8'))]})[_0x0a9e('0x23')](function(_0x262281){var _0x59f8f7=0x1;var _0x400800=_[_0x0a9e('0x52')](_0x262281,function(_0x20e191){_0x20e191['CmHopperId']=_0x2b97fc;_0x20e191[_0x0a9e('0xc7')]=_0x20e191[_0x0a9e('0xd6')];_0x20e191[_0x0a9e('0xd7')]=_0x20e191[_0x0a9e('0xd9')]||_0x59f8f7;delete _0x20e191[_0x0a9e('0xd9')];_0x59f8f7=_0x59f8f7+0x1;return _0x20e191;});return db[_0x0a9e('0xd5')][_0x0a9e('0xb0')](_0x400800,{});})[_0x0a9e('0x23')](function(){_0x307d13(0x1);});});}function insertAdditionalPhones(_0x3a9c0f,_0x3f1959){return new Promise(function(_0x6b048e,_0x3ba472){var _0x4e6eb9=[];for(var _0x572a72=0x0;_0x572a72<_0x3f1959[_0x0a9e('0x2c')];_0x572a72++){var _0x401207=_0x3f1959[_0x572a72];_0x4e6eb9[_0x0a9e('0x2e')](parseContactItemType(_0x401207));}Promise[_0x0a9e('0x32')](_0x4e6eb9)[_0x0a9e('0x23')](function(){var _0x1e29e2={'id':_0x3a9c0f['id'],'items':_0x3f1959};return addAdditionalPhones(_0x1e29e2)[_0x0a9e('0x23')](function(_0x4f7907){return addCmHopperPhones(_0x3a9c0f['id']);});})[_0x0a9e('0x23')](function(){_0x6b048e(_0x3a9c0f);});});}function parseContactItemType(_0x49fd0e){return new Promise(function(_0x26aa44,_0x1ad1d7){if(_0x49fd0e[_0x0a9e('0x3a')](_0x0a9e('0xd3'))){_0x26aa44(_0x49fd0e);}else{return db[_0x0a9e('0xba')][_0x0a9e('0x86')]({'where':{'name':_0x49fd0e[_0x0a9e('0xbb')]}})[_0x0a9e('0x23')](function(_0xa7a754){if(_[_0x0a9e('0xd2')](_0xa7a754))_0x49fd0e[_0x0a9e('0xd3')]=null;else _0x49fd0e[_0x0a9e('0xd3')]=_0xa7a754['id'];_0x26aa44(_0x49fd0e);});}});}exports[_0x0a9e('0xda')]=function(_0x3f7cb6,_0x3c8a9a){return db[_0x0a9e('0xa3')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3f7cb6['params']['id'],'ItemClass':_0x0a9e('0xdb')},'include':[{'model':db[_0x0a9e('0xba')],'as':'ItemType'}],'order':[[db['sequelize'][_0x0a9e('0xbc')](_0x0a9e('0xd8'))],[_0x0a9e('0xd7')]]})['then'](function(_0x268eae){return _0x268eae;})['then'](respondWithResult(_0x3c8a9a,null))[_0x0a9e('0x8b')](handleError(_0x3c8a9a,null));};exports['duplicateAdditionalPhones']=function(_0x22d31f,_0x5e9c92){return db[_0x0a9e('0xa3')][_0x0a9e('0x8d')]({'raw':!![],'where':{'CmContactId':_0x22d31f[_0x0a9e('0x8c')]['fromContactId']}})[_0x0a9e('0x23')](function(_0x497fda){var _0x505ffd=_[_0x0a9e('0x52')](_0x497fda,function(_0x23993f){_0x23993f[_0x0a9e('0xdc')]=_0x22d31f[_0x0a9e('0x8c')][_0x0a9e('0xdd')];return _0x23993f;});return db[_0x0a9e('0xa3')][_0x0a9e('0xb0')](_0x505ffd,{});})[_0x0a9e('0x23')](function(_0x1a3143){return addCmHopperPhones(_0x22d31f[_0x0a9e('0x8c')][_0x0a9e('0xdd')]);})[_0x0a9e('0x23')](function(_0x26361f){return['ok'];})[_0x0a9e('0x23')](respondWithResult(_0x5e9c92,null))[_0x0a9e('0x8b')](handleError(_0x5e9c92,null));};exports[_0x0a9e('0xde')]=function(_0x310026,_0x643f66){var _0x153de1=[];_0x153de1['push'](createCmHopperPhone(_0x310026[_0x0a9e('0x8c')]['id'],_0x310026[_0x0a9e('0x8c')][_0x0a9e('0xdf')]));Promise[_0x0a9e('0x32')](_0x153de1)['then'](function(){return[0x1];})['then'](respondWithResult(_0x643f66,null));};exports['getHoppers']=function(_0x2b8823,_0x55926d,_0xea26ca){var _0x1fafc2={'raw':![],'where':{}};var _0x130ae8={};var _0x43fe24={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x30')]({'where':{'id':_0x2b8823[_0x0a9e('0xb9')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x55926d,null))[_0x0a9e('0x23')](function(_0x6b948a){if(_0x6b948a){_0x130ae8['model']=_[_0x0a9e('0x2b')](db['CmHopper'][_0x0a9e('0xc9')]);_0x130ae8['query']=_[_0x0a9e('0x2b')](_0x2b8823[_0x0a9e('0x35')]);_0x130ae8[_0x0a9e('0x36')]=_['intersection'](_0x130ae8[_0x0a9e('0x34')],_0x130ae8[_0x0a9e('0x35')]);_0x1fafc2['attributes']=_['intersection'](_0x130ae8[_0x0a9e('0x34')],qs[_0x0a9e('0x38')](_0x2b8823[_0x0a9e('0x35')]['fields']));_0x1fafc2['attributes']=_0x1fafc2['attributes'][_0x0a9e('0x2c')]?_0x1fafc2[_0x0a9e('0x39')]:_0x130ae8[_0x0a9e('0x34')];if(!_0x2b8823[_0x0a9e('0x35')][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x1fafc2[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x2b8823[_0x0a9e('0x35')][_0x0a9e('0x1d')]);_0x1fafc2[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x2b8823[_0x0a9e('0x35')][_0x0a9e('0x1b')]);}_0x1fafc2[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2b8823[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x1fafc2['where']=qs[_0x0a9e('0x36')](_[_0x0a9e('0xca')](_0x2b8823[_0x0a9e('0x35')],_0x130ae8[_0x0a9e('0x36')]));_0x1fafc2[_0x0a9e('0x3e')][_0x0a9e('0xe0')]=_0x6b948a['id'];if(_0x2b8823['query'][_0x0a9e('0x5d')]){_0x1fafc2[_0x0a9e('0x3e')]=_[_0x0a9e('0xcb')](_0x1fafc2[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x52')](_0x1fafc2[_0x0a9e('0x39')],function(_0x103ad9){var _0x7c4ce2={};_0x7c4ce2[_0x103ad9]={'$like':'%'+_0x2b8823[_0x0a9e('0x35')]['filter']+'%'};return _0x7c4ce2;})});}_0x1fafc2=_['merge']({},_0x1fafc2,_0x2b8823[_0x0a9e('0xcc')]);return db[_0x0a9e('0x94')]['count']({'where':_0x1fafc2[_0x0a9e('0x3e')]})[_0x0a9e('0x23')](function(_0x4c8d75){_0x43fe24[_0x0a9e('0x1e')]=_0x4c8d75;if(_0x2b8823['query'][_0x0a9e('0xe1')]){_0x1fafc2[_0x0a9e('0xe2')]=[{'all':!![]}];}return db['CmHopper'][_0x0a9e('0x8d')](_0x1fafc2);})[_0x0a9e('0x23')](function(_0x5952c8){_0x43fe24[_0x0a9e('0x85')]=_0x5952c8;return _0x43fe24;});}})[_0x0a9e('0x23')](respondWithFilteredResult(_0x55926d,_0x1fafc2))['catch'](handleError(_0x55926d,null));};exports[_0x0a9e('0xe3')]=function(_0x237994,_0x28a078,_0x24361){var _0x8f68ec={'raw':!![],'where':{}};var _0x17a0d5={};var _0x5d525f={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x30')]({'where':{'id':_0x237994['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x28a078,null))[_0x0a9e('0x23')](function(_0x22c390){if(_0x22c390){_0x17a0d5[_0x0a9e('0x34')]=_[_0x0a9e('0x2b')](db[_0x0a9e('0xa5')][_0x0a9e('0xc9')]);_0x17a0d5['query']=_['keys'](_0x237994['query']);_0x17a0d5['filters']=_['intersection'](_0x17a0d5[_0x0a9e('0x34')],_0x17a0d5[_0x0a9e('0x35')]);_0x8f68ec['attributes']=_['intersection'](_0x17a0d5[_0x0a9e('0x34')],qs['fields'](_0x237994[_0x0a9e('0x35')][_0x0a9e('0x38')]));_0x8f68ec[_0x0a9e('0x39')]=_0x8f68ec[_0x0a9e('0x39')][_0x0a9e('0x2c')]?_0x8f68ec[_0x0a9e('0x39')]:_0x17a0d5['model'];if(!_0x237994[_0x0a9e('0x35')][_0x0a9e('0x3a')]('nolimit')){_0x8f68ec[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x237994[_0x0a9e('0x35')][_0x0a9e('0x1d')]);_0x8f68ec[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x237994[_0x0a9e('0x35')]['offset']);}_0x8f68ec[_0x0a9e('0x3c')]=qs['sort'](_0x237994[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x8f68ec['where']=qs[_0x0a9e('0x36')](_[_0x0a9e('0xca')](_0x237994['query'],_0x17a0d5[_0x0a9e('0x36')]));_0x8f68ec['where'][_0x0a9e('0xe0')]=_0x22c390['id'];if(_0x237994[_0x0a9e('0x35')]['filter']){_0x8f68ec[_0x0a9e('0x3e')]=_['merge'](_0x8f68ec[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x52')](_0x8f68ec[_0x0a9e('0x39')],function(_0x37ef45){var _0x288127={};_0x288127[_0x37ef45]={'$like':'%'+_0x237994[_0x0a9e('0x35')][_0x0a9e('0x5d')]+'%'};return _0x288127;})});}_0x8f68ec=_['merge']({},_0x8f68ec,_0x237994[_0x0a9e('0xcc')]);return db[_0x0a9e('0xa5')][_0x0a9e('0x1e')]({'where':_0x8f68ec[_0x0a9e('0x3e')]})[_0x0a9e('0x23')](function(_0x5932ad){_0x5d525f[_0x0a9e('0x1e')]=_0x5932ad;if(_0x237994['query']['includeAll']){_0x8f68ec[_0x0a9e('0xe2')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x8d')](_0x8f68ec);})[_0x0a9e('0x23')](function(_0x58d5fd){_0x5d525f[_0x0a9e('0x85')]=_0x58d5fd;return _0x5d525f;});}})[_0x0a9e('0x23')](respondWithFilteredResult(_0x28a078,_0x8f68ec))[_0x0a9e('0x8b')](handleError(_0x28a078,null));};exports[_0x0a9e('0xe4')]=function(_0x2e1adc,_0x25eb44,_0x3d2bb0){var _0xb8c15={'raw':!![],'where':{}};var _0x3d02ae={};var _0x5871d7={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x30')]({'where':{'id':_0x2e1adc[_0x0a9e('0xb9')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x25eb44,null))['then'](function(_0x38d95a){if(_0x38d95a){_0x3d02ae[_0x0a9e('0x34')]=_[_0x0a9e('0x2b')](db['CmHopperFinal'][_0x0a9e('0xc9')]);_0x3d02ae[_0x0a9e('0x35')]=_[_0x0a9e('0x2b')](_0x2e1adc['query']);_0x3d02ae[_0x0a9e('0x36')]=_['intersection'](_0x3d02ae[_0x0a9e('0x34')],_0x3d02ae[_0x0a9e('0x35')]);_0xb8c15[_0x0a9e('0x39')]=_[_0x0a9e('0x37')](_0x3d02ae[_0x0a9e('0x34')],qs[_0x0a9e('0x38')](_0x2e1adc[_0x0a9e('0x35')]['fields']));_0xb8c15[_0x0a9e('0x39')]=_0xb8c15[_0x0a9e('0x39')][_0x0a9e('0x2c')]?_0xb8c15[_0x0a9e('0x39')]:_0x3d02ae[_0x0a9e('0x34')];if(!_0x2e1adc[_0x0a9e('0x35')][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0xb8c15[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x2e1adc[_0x0a9e('0x35')][_0x0a9e('0x1d')]);_0xb8c15[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x2e1adc[_0x0a9e('0x35')][_0x0a9e('0x1b')]);}_0xb8c15[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2e1adc[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0xb8c15[_0x0a9e('0x3e')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0xca')](_0x2e1adc['query'],_0x3d02ae[_0x0a9e('0x36')]));_0xb8c15[_0x0a9e('0x3e')][_0x0a9e('0xe0')]=_0x38d95a['id'];if(_0x2e1adc['query'][_0x0a9e('0x5d')]){_0xb8c15['where']=_[_0x0a9e('0xcb')](_0xb8c15[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x52')](_0xb8c15[_0x0a9e('0x39')],function(_0x455bca){var _0xb09ef6={};_0xb09ef6[_0x455bca]={'$like':'%'+_0x2e1adc[_0x0a9e('0x35')][_0x0a9e('0x5d')]+'%'};return _0xb09ef6;})});}_0xb8c15=_['merge']({},_0xb8c15,_0x2e1adc[_0x0a9e('0xcc')]);return db[_0x0a9e('0xa4')]['count']({'where':_0xb8c15[_0x0a9e('0x3e')]})[_0x0a9e('0x23')](function(_0x579bb0){_0x5871d7['count']=_0x579bb0;if(_0x2e1adc[_0x0a9e('0x35')][_0x0a9e('0xe1')]){_0xb8c15[_0x0a9e('0xe2')]=[{'all':!![]}];}return db[_0x0a9e('0xa4')]['findAll'](_0xb8c15);})[_0x0a9e('0x23')](function(_0x31648e){_0x5871d7[_0x0a9e('0x85')]=_0x31648e;return _0x5871d7;});}})[_0x0a9e('0x23')](respondWithFilteredResult(_0x25eb44,_0xb8c15))[_0x0a9e('0x8b')](handleError(_0x25eb44,null));};exports['getJscriptySessions']=function(_0xa3ba12,_0x3fc431,_0x4df303){var _0x34112c={'raw':!![],'where':{}};var _0x2d20a0={};var _0x38284a={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0xa3ba12[_0x0a9e('0xb9')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x3fc431,null))[_0x0a9e('0x23')](function(_0x283bbb){if(_0x283bbb){_0x2d20a0[_0x0a9e('0x34')]=_[_0x0a9e('0x2b')](db[_0x0a9e('0xab')][_0x0a9e('0xc9')]);_0x2d20a0['query']=_['keys'](_0xa3ba12[_0x0a9e('0x35')]);_0x2d20a0['filters']=_[_0x0a9e('0x37')](_0x2d20a0[_0x0a9e('0x34')],_0x2d20a0[_0x0a9e('0x35')]);_0x34112c[_0x0a9e('0x39')]=_['intersection'](_0x2d20a0[_0x0a9e('0x34')],qs[_0x0a9e('0x38')](_0xa3ba12['query'][_0x0a9e('0x38')]));_0x34112c['attributes']=_0x34112c[_0x0a9e('0x39')][_0x0a9e('0x2c')]?_0x34112c[_0x0a9e('0x39')]:_0x2d20a0[_0x0a9e('0x34')];if(!_0xa3ba12[_0x0a9e('0x35')][_0x0a9e('0x3a')]('nolimit')){_0x34112c[_0x0a9e('0x1d')]=qs['limit'](_0xa3ba12[_0x0a9e('0x35')][_0x0a9e('0x1d')]);_0x34112c[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0xa3ba12[_0x0a9e('0x35')][_0x0a9e('0x1b')]);}_0x34112c[_0x0a9e('0x3c')]=qs['sort'](_0xa3ba12[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x34112c[_0x0a9e('0x3e')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0xca')](_0xa3ba12['query'],_0x2d20a0[_0x0a9e('0x36')]));_0x34112c[_0x0a9e('0x3e')]['ContactId']=_0x283bbb['id'];if(_0xa3ba12['query'][_0x0a9e('0x5d')]){_0x34112c[_0x0a9e('0x3e')]=_[_0x0a9e('0xcb')](_0x34112c[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x52')](_0x34112c[_0x0a9e('0x39')],function(_0x4d35ed){var _0x1e31c2={};_0x1e31c2[_0x4d35ed]={'$like':'%'+_0xa3ba12[_0x0a9e('0x35')][_0x0a9e('0x5d')]+'%'};return _0x1e31c2;})});}_0x34112c=_['merge']({},_0x34112c,_0xa3ba12[_0x0a9e('0xcc')]);return db[_0x0a9e('0xab')][_0x0a9e('0x1e')]({'where':_0x34112c[_0x0a9e('0x3e')]})['then'](function(_0x5d4935){_0x38284a[_0x0a9e('0x1e')]=_0x5d4935;if(_0xa3ba12[_0x0a9e('0x35')][_0x0a9e('0xe1')]){_0x34112c[_0x0a9e('0xe2')]=[{'all':!![]}];}return db[_0x0a9e('0xab')][_0x0a9e('0x8d')](_0x34112c);})[_0x0a9e('0x23')](function(_0x23dd12){_0x38284a['rows']=_0x23dd12;return _0x38284a;});}})[_0x0a9e('0x23')](respondWithFilteredResult(_0x3fc431,_0x34112c))['catch'](handleError(_0x3fc431,null));};exports[_0x0a9e('0xe5')]=function(_0x20dcfd,_0x3fd399,_0x4984b1){try{if(!_0x20dcfd['body'][_0x0a9e('0x60')]){throw new Error('No\x20ListId\x20specified');}if(!_0x20dcfd[_0x0a9e('0x8c')]['binding_keys']){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xe6')]){throw new Error(_0x0a9e('0xe7'));}if(!_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xe8')]){throw new Error(_0x0a9e('0xe9'));}var _0x2f64ef=_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xea')][_0x0a9e('0x84')](',');var _0x81f495=_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xe6')]['split'](',');if(!_0x2f64ef['length']||!_0x81f495[_0x0a9e('0x2c')]||_0x2f64ef['length']!==_0x81f495[_0x0a9e('0x2c')]){throw new Error(_0x0a9e('0xeb'));}_0x20dcfd[_0x0a9e('0x8c')]['fields']=_['zipObject'](_0x2f64ef,_0x81f495);if(!_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0x38')][_0x0a9e('0xc7')]){throw new Error(_0x0a9e('0xec'));}if(!_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0x38')][_0x0a9e('0xed')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x12984a=path['join'](config[_0x0a9e('0xee')],_0x0a9e('0xef'),_0x20dcfd['file'][_0x0a9e('0xf0')]);fs[_0x0a9e('0xf1')](_0x12984a,parseInt(_0x0a9e('0xf2'),0x8));var _0x4524b8=require(_0x0a9e('0xf3'))[_0x0a9e('0xf4')](path['join'](__dirname,_0x0a9e('0xf5')),[_0x12984a,_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xea')],_0x20dcfd['body'][_0x0a9e('0xe6')],_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0x60')],_0x20dcfd['body'][_0x0a9e('0xf6')],_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xb2')],_0x20dcfd[_0x0a9e('0x8c')][_0x0a9e('0xe8')]]);return _0x3fd399[_0x0a9e('0x1a')](0xc8)['json']({'message':'File\x20uploaded\x20correctly!','pid':_0x4524b8[_0x0a9e('0xf7')]});}catch(_0x1e01af){return _0x3fd399['status'](0x1f4)[_0x0a9e('0xf8')](_0x1e01af);}};exports[_0x0a9e('0xf9')]=function(_0x315735,_0x35dadd,_0x2e413d){var _0x4e3983=fs['createReadStream'](_0x315735[_0x0a9e('0xfa')][_0x0a9e('0x6')]);Papa[_0x0a9e('0xfb')](_0x4e3983,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4edb79){return _0x35dadd[_0x0a9e('0x1a')](0xc8)[_0x0a9e('0xfc')]({'file':_0x315735[_0x0a9e('0xfa')],'fields':_0x4edb79[_0x0a9e('0xfd')]['fields']});}});};exports['import']=function(_0x46b143,_0x14b098,_0x16b4ae){return db['User'][_0x0a9e('0x8d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0x73')}})[_0x0a9e('0x23')](function(_0x1fc545){var _0x45616c=![];if(!_0x46b143[_0x0a9e('0x8c')][_0x0a9e('0x60')]){throw new Error(_0x0a9e('0xfe'));}if(!_0x46b143['body']['binding'][_0x0a9e('0xc7')]){throw new Error(_0x0a9e('0xec'));}if(!_0x46b143['body'][_0x0a9e('0xff')]['firstName']){throw new Error(_0x0a9e('0x100'));}if(!_0x46b143[_0x0a9e('0x8c')]['socket_timestamp']){throw new Error(_0x0a9e('0xe9'));}var _0xd6570f=require('child_process')[_0x0a9e('0xf4')](path[_0x0a9e('0x91')](__dirname,_0x0a9e('0x101')),[_0x46b143[_0x0a9e('0xb9')]['id'],JSON[_0x0a9e('0x102')](_0x46b143[_0x0a9e('0x8c')]),JSON[_0x0a9e('0x102')](_0x1fc545)]);_0xd6570f['on']('message',function(_0x1da68c){_0x45616c=!![];return _0x14b098[_0x0a9e('0x1a')](0xc8)[_0x0a9e('0xfc')]({'message':_0x0a9e('0x103'),'pid':_0xd6570f[_0x0a9e('0xf7')]});});_0xd6570f['on'](_0x0a9e('0x104'),function(_0x456884){if(_0x456884&&!_0x45616c){return _0x14b098['status'](0x1f4)['json']({'message':_0x0a9e('0x105'),'pid':_0xd6570f[_0x0a9e('0xf7')]});}});})[_0x0a9e('0x8b')](handleError(_0x14b098,null));};exports['importUpdates']=function(_0x5cf1ba,_0xf7ddca,_0x55075d){return db[_0x0a9e('0x56')][_0x0a9e('0x8d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0x73')}})[_0x0a9e('0x23')](function(_0x20f4cb){var _0x13c6df=![];if(!_0x5cf1ba[_0x0a9e('0x8c')][_0x0a9e('0x60')]){throw new Error(_0x0a9e('0xfe'));}if(!_0x5cf1ba['body']['binding'][_0x0a9e('0xc7')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x5cf1ba[_0x0a9e('0x8c')][_0x0a9e('0xff')][_0x0a9e('0xed')]){throw new Error(_0x0a9e('0x100'));}if(!_0x5cf1ba['body'][_0x0a9e('0xe8')]){throw new Error(_0x0a9e('0xe9'));}var _0x2bc6a3=require('child_process')[_0x0a9e('0xf4')](path[_0x0a9e('0x91')](__dirname,_0x0a9e('0x106')),[_0x5cf1ba['params']['id'],JSON[_0x0a9e('0x102')](_0x5cf1ba[_0x0a9e('0x8c')]),JSON[_0x0a9e('0x102')](_0x20f4cb)]);_0x2bc6a3['on'](_0x0a9e('0x107'),function(_0x69b4d6){_0x13c6df=!![];return _0xf7ddca[_0x0a9e('0x1a')](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x2bc6a3[_0x0a9e('0xf7')]});});_0x2bc6a3['on'](_0x0a9e('0x104'),function(_0x10d713){if(_0x10d713&&!_0x13c6df){return _0xf7ddca['status'](0x1f4)['json']({'message':_0x0a9e('0x105'),'pid':_0x2bc6a3[_0x0a9e('0xf7')]});}});})[_0x0a9e('0x8b')](handleError(_0xf7ddca,null));};exports['getJourney']=function(_0x4b51ff,_0x12d1dd){var _0x2c8d95=[_0x0a9e('0x108'),_0x0a9e('0x109'),_0x0a9e('0x10a'),'openchannel',_0x0a9e('0x10b'),'whatsapp',_0x0a9e('0x10c')];var _0x311e40={'offset':0x0,'order':qs[_0x0a9e('0x3d')]('-createdAt')},_0x57e719={'count':0x0,'rows':[]};Promise[_0x0a9e('0x71')]()[_0x0a9e('0x23')](function(){if(_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x10d')]){if(!_[_0x0a9e('0x10e')](_0x2c8d95,_0x4b51ff['query'][_0x0a9e('0x10d')][_0x0a9e('0x10f')]())){throw new Error(_0x0a9e('0x110'));}_0x2c8d95=[_0x4b51ff['query'][_0x0a9e('0x10d')]['toLowerCase']()];}if(_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x111')]){try{var _0x2777fe=JSON['parse'](_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x111')]);if(!moment(_0x2777fe[_0x0a9e('0x42')])[_0x0a9e('0x112')]()){throw new Error(_0x0a9e('0x113'));}if(!moment(_0x2777fe['to'])[_0x0a9e('0x112')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x3057c9){throw new Error(_0x0a9e('0x114'));}}if(!_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x311e40[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x4b51ff[_0x0a9e('0x35')]['limit']||0xa);_0x311e40[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x1b')]);}var _0x55a300=_0x2c8d95[_0x0a9e('0x52')](function(_0x57c3c4){if(_0x57c3c4===_0x0a9e('0x10c')){var _0x22ef0f={'attributes':['id',_0x0a9e('0x115'),'type',_0x0a9e('0x116'),_0x0a9e('0x117'),_0x0a9e('0x118'),_0x0a9e('0x119'),'endtime',_0x0a9e('0x11a'),_0x0a9e('0x11b'),_0x0a9e('0x11c'),_0x0a9e('0x11d'),_0x0a9e('0x11e'),_0x0a9e('0x11f'),_0x0a9e('0x120')],'where':{'ContactId':_0x4b51ff['params']['id']},'include':[{'model':db[_0x0a9e('0x56')],'as':_0x0a9e('0x56'),'attributes':['id',_0x0a9e('0x27'),_0x0a9e('0x121'),'alias']}],'order':[[_0x0a9e('0x11c'),'DESC']]};if(_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x111')]){_0x22ef0f[_0x0a9e('0x3e')][_0x0a9e('0x11c')]={'$gte':_0x2777fe[_0x0a9e('0x42')],'$lte':_0x2777fe['to']};}return db[_0x0a9e('0xa6')][_0x0a9e('0x122')](_0x22ef0f)['then'](function(_0x173f03){_0x57e719['count']+=_0x173f03[_0x0a9e('0x1e')];return _[_0x0a9e('0x52')](_0x173f03['rows'],function(_0x2ebed3){var _0x167f89=_0x2ebed3[_0x0a9e('0x8e')]({'plain':!![]});_0x167f89[_0x0a9e('0x10d')]=_0x57c3c4;if(_0x167f89['User']){_0x167f89[_0x0a9e('0x56')]={'id':_0x167f89[_0x0a9e('0x56')]['id'],'name':_0x167f89['User'][_0x0a9e('0x27')],'fullname':_0x167f89['User']['fullname'],'alias':_0x167f89['User'][_0x0a9e('0x123')]};}return _0x167f89;});});}else{var _0x2ec662=_['startCase'](_0x57c3c4)+(_0x57c3c4===_0x0a9e('0x109')?_0x0a9e('0x124'):'Account');var _0xc48226={'attributes':['id',_0x0a9e('0x125'),_0x0a9e('0x126'),_0x0a9e('0x11c'),_0x0a9e('0x11b'),_0x0a9e('0x127'),_0x0a9e('0x128'),'thirdDisposition',_0x0a9e('0x120'),_0x2ec662+'Id'],'where':{'ContactId':_0x4b51ff['params']['id']},'include':[{'model':db[_0x2ec662],'as':_0x0a9e('0x129'),'attributes':['id',_0x0a9e('0x27'),_0x0a9e('0x12a')]},{'model':db[_0x0a9e('0x56')],'as':_0x0a9e('0x12b'),'attributes':['id',_0x0a9e('0x27'),'fullname']},{'model':db[_0x0a9e('0x50')],'as':_0x0a9e('0x83'),'attributes':['id',_0x0a9e('0x27'),'color'],'through':{'attributes':[]}}],'order':[[_0x0a9e('0x11c'),_0x0a9e('0x6f')]]};if(_0x4b51ff[_0x0a9e('0x35')][_0x0a9e('0x111')]){_0xc48226[_0x0a9e('0x3e')][_0x0a9e('0x11c')]={'$gte':_0x2777fe[_0x0a9e('0x42')],'$lte':_0x2777fe['to']};}switch(_0x57c3c4){case _0x0a9e('0x109'):_0xc48226[_0x0a9e('0x39')][_0x0a9e('0x2e')](_0x0a9e('0x12c'),_0x0a9e('0x12d'),_0x0a9e('0x12e'),_0x0a9e('0x12f'),_0x0a9e('0x130'),_0x0a9e('0x131'),'ratingType',_0x0a9e('0x132'),_0x0a9e('0x133'));break;case _0x0a9e('0x108'):_0xc48226['attributes'][_0x0a9e('0x2e')](_0x0a9e('0x134'),_0x0a9e('0x135'));break;case _0x0a9e('0x136'):_0xc48226['attributes'][_0x0a9e('0x2e')](_0x0a9e('0x137'),_0x0a9e('0x138'));break;}return db[_[_0x0a9e('0x139')](_0x57c3c4)+'Interaction'][_0x0a9e('0x122')](_0xc48226)[_0x0a9e('0x23')](function(_0x132455){_0x57e719[_0x0a9e('0x1e')]+=_0x132455['count'];return _['map'](_0x132455[_0x0a9e('0x85')],function(_0x44343f){var _0x2de997=_0x44343f[_0x0a9e('0x8e')]({'plain':!![]});_0x2de997[_0x0a9e('0x10d')]=_0x57c3c4;if(_0x2de997[_0x0a9e('0x12b')]){_0x2de997[_0x0a9e('0x12b')]={'id':_0x2de997[_0x0a9e('0x12b')]['id'],'name':_0x2de997[_0x0a9e('0x12b')][_0x0a9e('0x27')],'fullname':_0x2de997[_0x0a9e('0x12b')][_0x0a9e('0x121')]};}return _0x2de997;});});}});return Promise[_0x0a9e('0x32')](_0x55a300);})[_0x0a9e('0x23')](function(_0x4f5ebd){return _(_0x4f5ebd)[_0x0a9e('0x13a')]()[_0x0a9e('0x13b')](_0x0a9e('0x11c'))['reverse']()['value']();})[_0x0a9e('0x23')](function(_0x51ec16){_0x57e719[_0x0a9e('0x85')]=_0x311e40[_0x0a9e('0x1d')]?_0x51ec16[_0x0a9e('0x13c')](_0x311e40[_0x0a9e('0x1b')],_0x311e40['offset']+_0x311e40['limit']):_0x51ec16;return _0x57e719;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x12d1dd,_0x311e40))[_0x0a9e('0x8b')](handleError(_0x12d1dd,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 5b08eda..4b41425 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e6f=['emit','hasOwnProperty','hook','../../mysqldb','CmContact','setMaxListeners','save','update'];(function(_0x7b5d26,_0x2d6622){var _0x66c4f1=function(_0x1a4056){while(--_0x1a4056){_0x7b5d26['push'](_0x7b5d26['shift']());}};_0x66c4f1(++_0x2d6622);}(_0x2e6f,0x13b));var _0xf2e6=function(_0x3c74bb,_0x50da75){_0x3c74bb=_0x3c74bb-0x0;var _0x45f571=_0x2e6f[_0x3c74bb];return _0x45f571;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xf2e6('0x0'))['db'][_0xf2e6('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xf2e6('0x2')](0x0);var events={'afterCreate':_0xf2e6('0x3'),'afterUpdate':_0xf2e6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2aa032){return function(_0x15f525,_0x13c704,_0xf6b3){CmContactEvents[_0xf2e6('0x5')](_0x2aa032+':'+_0x15f525['id'],_0x15f525);CmContactEvents[_0xf2e6('0x5')](_0x2aa032,_0x15f525);_0xf6b3(null);};}for(var e in events){if(events[_0xf2e6('0x6')](e)){var event=events[e];CmContact[_0xf2e6('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x803c=['CmContact','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x803c,0x128));var _0xc803=function(_0x59d0bf,_0xa83590){_0x59d0bf=_0x59d0bf-0x0;var _0x2e5cf2=_0x803c[_0x59d0bf];return _0x2e5cf2;};'use strict';var EventEmitter=require(_0xc803('0x0'));var CmContact=require('../../mysqldb')['db'][_0xc803('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xc803('0x2')](0x0);var events={'afterCreate':_0xc803('0x3'),'afterUpdate':'update','afterDestroy':_0xc803('0x4')};function emitEvent(_0x15beda){return function(_0x23e2f4,_0x45775a,_0x36f68d){CmContactEvents[_0xc803('0x5')](_0x15beda+':'+_0x23e2f4['id'],_0x23e2f4);CmContactEvents[_0xc803('0x5')](_0x15beda,_0x23e2f4);_0x36f68d(null);};}for(var e in events){if(events[_0xc803('0x6')](e)){var event=events[e];CmContact[_0xc803('0x7')](e,emitEvent(event));}}module[_0xc803('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 8fe487a..3be2f4b 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0c1=['priority','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','findOne','CmHopperFinal','cmContact,\x20afterCreate,\x20','scheduledat','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','onlyIfOpen','Campaign','message','List\x20not\x20found','isEmpty','destroy','VoiceQueueId','CampaignId','push','all','lodash','util','../../config/logger','api','moment','bluebird','request-promise','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','mobile','fax','email','models','get','error','cmContact','afterCreate','inspect','CmHopper','then','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId'];(function(_0x3d728e,_0x4325cf){var _0x627520=function(_0x2d713b){while(--_0x2d713b){_0x3d728e['push'](_0x3d728e['shift']());}};_0x627520(++_0x4325cf);}(_0xe0c1,0x10f));var _0x1e0c=function(_0x276de3,_0x264aeb){_0x276de3=_0x276de3-0x0;var _0x2eb959=_0xe0c1[_0x276de3];return _0x2eb959;};'use strict';var _=require(_0x1e0c('0x0'));var util=require(_0x1e0c('0x1'));var logger=require(_0x1e0c('0x2'))(_0x1e0c('0x3'));var moment=require(_0x1e0c('0x4'));var BPromise=require(_0x1e0c('0x5'));var rp=require(_0x1e0c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmContact.attributes');module['exports']=function(_0x57c88f,_0x935e3b){return _0x57c88f[_0x1e0c('0x7')](_0x1e0c('0x8'),attributes,{'tableName':_0x1e0c('0x9'),'paranoid':!![],'indexes':[{'name':_0x1e0c('0xa'),'fields':[_0x1e0c('0xa')]},{'name':_0x1e0c('0xb'),'fields':[_0x1e0c('0xc'),'lastName',_0x1e0c('0xa'),_0x1e0c('0xd'),_0x1e0c('0xe'),_0x1e0c('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x452aee,_0x42b407,_0x2bd205){var _0x506e0a=_0x57c88f[_0x1e0c('0x10')];var _0x504f4d=_0x452aee[_0x1e0c('0x11')]({'plain':!![]});function _0x39305e(){return function(_0x432542){logger[_0x1e0c('0x12')](_0x1e0c('0x13'),_0x1e0c('0x14'),util[_0x1e0c('0x15')](_0x432542,{'showHidden':![],'depth':null}));};}var _0x1c2616=function(_0x1fbc44){return new BPromise(function(_0x452248,_0x599d0b){_0x506e0a[_0x1e0c('0x16')]['findOne']({'where':{'phone':_0x504f4d[_0x1e0c('0xa')],'VoiceQueueId':_0x1fbc44['id']}})[_0x1e0c('0x17')](function(_0x13840b){if(!_[_0x1e0c('0x18')](_0x13840b)){throw new Error(_0x1e0c('0x19')+_0x504f4d[_0x1e0c('0xa')]+_0x1e0c('0x1a')+_0x1fbc44['id']);}return _0x506e0a['CmHopper'][_0x1e0c('0x1b')]({'phone':_0x504f4d[_0x1e0c('0xa')],'ContactId':_0x504f4d['id'],'ListId':_0x504f4d[_0x1e0c('0x1c')],'priority':_0x504f4d[_0x1e0c('0x1d')]?_0x504f4d['priority']:0x2,'scheduledat':_0x504f4d['scheduledat']?_0x504f4d['scheduledat']:moment()[_0x1e0c('0x1e')](_0x1e0c('0x1f')),'callback':_0x504f4d[_0x1e0c('0x20')]?!![]:![],'callbackuniqueid':_0x504f4d[_0x1e0c('0x20')]?_0x504f4d[_0x1e0c('0x20')]:undefined,'callbackat':_0x504f4d[_0x1e0c('0x20')]?moment()[_0x1e0c('0x1e')](_0x1e0c('0x1f')):undefined,'VoiceQueueId':_0x1fbc44['id']});})['catch'](function(_0x5d6943){_0x599d0b(_0x5d6943);});});};var _0x3885d2=function(_0x38d8bd){return new BPromise(function(_0x3b1200,_0xb29b17){_0x506e0a['CmHopper'][_0x1e0c('0x21')]({'where':{'phone':_0x504f4d[_0x1e0c('0xa')],'VoiceQueueId':_0x38d8bd['id']}})[_0x1e0c('0x17')](function(_0x1cf772){if(!_[_0x1e0c('0x18')](_0x1cf772)){throw new Error(_0x1e0c('0x19')+_0x504f4d['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x38d8bd['id']);}return _0x506e0a[_0x1e0c('0x22')][_0x1e0c('0x21')]({'where':{'calleridnum':_0x504f4d[_0x1e0c('0xa')],'VoiceQueueId':_0x38d8bd['id']}});})[_0x1e0c('0x17')](function(_0x5cec62){if(!_[_0x1e0c('0x18')](_0x5cec62)){throw new Error(_0x1e0c('0x23')+_0x504f4d[_0x1e0c('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x38d8bd['id']);}return _0x506e0a[_0x1e0c('0x16')][_0x1e0c('0x1b')]({'phone':_0x504f4d[_0x1e0c('0xa')],'ContactId':_0x504f4d['id'],'ListId':_0x504f4d[_0x1e0c('0x1c')],'priority':_0x504f4d[_0x1e0c('0x1d')]?_0x504f4d['priority']:0x2,'scheduledat':_0x504f4d[_0x1e0c('0x24')]?_0x504f4d['scheduledat']:moment()[_0x1e0c('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x504f4d[_0x1e0c('0x20')]?!![]:![],'callbackuniqueid':_0x504f4d[_0x1e0c('0x20')]?_0x504f4d[_0x1e0c('0x20')]:undefined,'callbackat':_0x504f4d[_0x1e0c('0x20')]?moment()[_0x1e0c('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x38d8bd['id']});})[_0x1e0c('0x25')](function(_0x2cae9e){_0xb29b17(_0x2cae9e);});});};function _0x57dfb6(){return function(_0x5b3259){logger[_0x1e0c('0x12')]('cmContact',_0x1e0c('0x14'),util[_0x1e0c('0x15')](_0x5b3259,{'showHidden':![],'depth':null}));};}var _0xca3b86=function(_0x47424e){return new BPromise(function(_0xa7bb00,_0x452e76){_0x506e0a[_0x1e0c('0x16')][_0x1e0c('0x21')]({'where':{'phone':_0x504f4d[_0x1e0c('0xa')],'CampaignId':_0x47424e['id']}})[_0x1e0c('0x17')](function(_0x533b9c){if(!_[_0x1e0c('0x18')](_0x533b9c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x504f4d[_0x1e0c('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x47424e['id']);}return _0x506e0a[_0x1e0c('0x16')]['create']({'phone':_0x504f4d[_0x1e0c('0xa')],'ContactId':_0x504f4d['id'],'ListId':_0x504f4d[_0x1e0c('0x1c')],'priority':_0x504f4d['priority']?_0x504f4d['priority']:0x2,'scheduledat':_0x504f4d['scheduledat']?_0x504f4d[_0x1e0c('0x24')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x504f4d[_0x1e0c('0x20')]?!![]:![],'callbackuniqueid':_0x504f4d[_0x1e0c('0x20')]?_0x504f4d[_0x1e0c('0x20')]:undefined,'callbackat':_0x504f4d[_0x1e0c('0x20')]?moment()[_0x1e0c('0x1e')](_0x1e0c('0x1f')):undefined,'CampaignId':_0x47424e['id']});})['catch'](function(_0x458a45){_0x452e76(_0x458a45);});});};var _0x3c112b=function(_0x416bfb){return new BPromise(function(_0x3bd6fd,_0x3f3500){_0x506e0a[_0x1e0c('0x16')]['findOne']({'where':{'phone':_0x504f4d[_0x1e0c('0xa')],'CampaignId':_0x416bfb['id']}})[_0x1e0c('0x17')](function(_0x1b729b){if(!_[_0x1e0c('0x18')](_0x1b729b)){throw new Error(_0x1e0c('0x19')+_0x504f4d[_0x1e0c('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x416bfb['id']);}return _0x506e0a[_0x1e0c('0x22')][_0x1e0c('0x21')]({'where':{'calleridnum':_0x504f4d['phone'],'CampaignId':_0x416bfb['id']}});})[_0x1e0c('0x17')](function(_0x2ffc0c){if(!_['isNil'](_0x2ffc0c)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x504f4d[_0x1e0c('0xa')]+_0x1e0c('0x26')+_0x416bfb['id']);}return _0x506e0a[_0x1e0c('0x16')][_0x1e0c('0x1b')]({'phone':_0x504f4d['phone'],'ContactId':_0x504f4d['id'],'ListId':_0x504f4d['ListId'],'priority':_0x504f4d[_0x1e0c('0x1d')]?_0x504f4d['priority']:0x2,'scheduledat':_0x504f4d[_0x1e0c('0x24')]?_0x504f4d[_0x1e0c('0x24')]:moment()[_0x1e0c('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x504f4d['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x504f4d[_0x1e0c('0x20')]?_0x504f4d['callbackUniqueid']:undefined,'callbackat':_0x504f4d[_0x1e0c('0x20')]?moment()['format'](_0x1e0c('0x1f')):undefined,'CampaignId':_0x416bfb['id']});})['catch'](function(_0x3ab785){_0x3f3500(_0x3ab785);});});};if(_0x504f4d['ListId']){_0x506e0a[_0x1e0c('0x27')][_0x1e0c('0x28')]({'where':{'type':_0x1e0c('0x29')},'attributes':['id',_0x1e0c('0x2a')],'include':[{'model':_0x506e0a[_0x1e0c('0x2b')],'as':_0x1e0c('0x2c'),'where':{'id':_0x504f4d['ListId']}}]})['then'](function(_0x477583){if(_0x477583){var _0x24d0c5=[];for(var _0x39bc5b=0x0,_0x41ded5;_0x39bc5b<_0x477583[_0x1e0c('0x2d')];_0x39bc5b+=0x1){_0x41ded5=_0x477583[_0x39bc5b][_0x1e0c('0x11')]({'plain':!![]});switch(_0x41ded5['dialCheckDuplicateType']){case _0x1e0c('0x2e'):_0x3885d2(_0x41ded5)[_0x1e0c('0x25')](_0x39305e());break;case'onlyIfOpen':_0x1c2616(_0x41ded5)['catch'](_0x39305e());break;default:_0x506e0a[_0x1e0c('0x16')][_0x1e0c('0x1b')]({'phone':_0x504f4d[_0x1e0c('0xa')],'ContactId':_0x504f4d['id'],'ListId':_0x504f4d[_0x1e0c('0x1c')],'scheduledat':_0x504f4d[_0x1e0c('0x24')]?_0x504f4d[_0x1e0c('0x24')]:moment()[_0x1e0c('0x1e')](_0x1e0c('0x1f')),'priority':_0x504f4d[_0x1e0c('0x1d')]?_0x504f4d[_0x1e0c('0x1d')]:0x2,'callback':_0x504f4d[_0x1e0c('0x20')]?!![]:![],'callbackuniqueid':_0x504f4d[_0x1e0c('0x20')]?_0x504f4d['callbackUniqueid']:undefined,'callbackat':_0x504f4d[_0x1e0c('0x20')]?moment()['format'](_0x1e0c('0x1f')):undefined,'VoiceQueueId':_0x41ded5['id']})[_0x1e0c('0x25')](_0x39305e());}}}})[_0x1e0c('0x17')](function(){return _0x506e0a[_0x1e0c('0x27')][_0x1e0c('0x28')]({'where':{'type':_0x1e0c('0x29')},'attributes':['id'],'include':[{'model':_0x506e0a[_0x1e0c('0x2b')],'as':_0x1e0c('0x2f'),'where':{'id':_0x504f4d['ListId']}}]})['then'](function(_0x2f3f40){if(_0x2f3f40){var _0x30153b=[];for(var _0x157490=0x0,_0x4ed5cf;_0x157490<_0x2f3f40[_0x1e0c('0x2d')];_0x157490+=0x1){_0x4ed5cf=_0x2f3f40[_0x157490][_0x1e0c('0x11')]({'plain':!![]});_0x506e0a[_0x1e0c('0x30')]['create']({'phone':_0x504f4d['phone'],'ContactId':_0x504f4d['id'],'ListId':_0x504f4d[_0x1e0c('0x1c')],'VoiceQueueId':_0x4ed5cf['id']})[_0x1e0c('0x25')](function(_0x5be24a){logger[_0x1e0c('0x12')](_0x1e0c('0x31'),_0x1e0c('0x14'),_0x5be24a['message']);});}}});})[_0x1e0c('0x17')](function(){return _0x506e0a['Campaign'][_0x1e0c('0x28')]({'attributes':['id',_0x1e0c('0x2a')],'include':[{'model':_0x506e0a[_0x1e0c('0x2b')],'as':_0x1e0c('0x2c'),'where':{'id':_0x504f4d[_0x1e0c('0x1c')]}}]})[_0x1e0c('0x17')](function(_0x918127){if(_0x918127){var _0x1c1532=[];for(var _0x364bf0=0x0,_0x5eb3ec;_0x364bf0<_0x918127['length'];_0x364bf0+=0x1){_0x5eb3ec=_0x918127[_0x364bf0][_0x1e0c('0x11')]({'plain':!![]});switch(_0x5eb3ec[_0x1e0c('0x2a')]){case _0x1e0c('0x2e'):_0x3c112b(_0x5eb3ec)[_0x1e0c('0x25')](_0x57dfb6());break;case _0x1e0c('0x32'):_0xca3b86(_0x5eb3ec)[_0x1e0c('0x25')](_0x57dfb6());break;default:_0x506e0a['CmHopper'][_0x1e0c('0x1b')]({'phone':_0x504f4d['phone'],'ContactId':_0x504f4d['id'],'ListId':_0x504f4d['ListId'],'scheduledat':_0x504f4d[_0x1e0c('0x24')]?_0x504f4d['scheduledat']:moment()[_0x1e0c('0x1e')](_0x1e0c('0x1f')),'priority':_0x504f4d['priority']?_0x504f4d['priority']:0x2,'callback':_0x504f4d[_0x1e0c('0x20')]?!![]:![],'callbackuniqueid':_0x504f4d['callbackUniqueid']?_0x504f4d[_0x1e0c('0x20')]:undefined,'callbackat':_0x504f4d[_0x1e0c('0x20')]?moment()['format'](_0x1e0c('0x1f')):undefined,'CampaignId':_0x5eb3ec['id']})[_0x1e0c('0x25')](_0x57dfb6());}}}});})[_0x1e0c('0x17')](function(){return _0x506e0a[_0x1e0c('0x33')][_0x1e0c('0x28')]({'attributes':['id'],'include':[{'model':_0x506e0a[_0x1e0c('0x2b')],'as':'BlackLists','where':{'id':_0x504f4d['ListId']}}]})[_0x1e0c('0x17')](function(_0x6f0a04){if(_0x6f0a04){var _0x3f4b2e=[];for(var _0x2de85c=0x0,_0x177fbb;_0x2de85c<_0x6f0a04[_0x1e0c('0x2d')];_0x2de85c+=0x1){_0x177fbb=_0x6f0a04[_0x2de85c][_0x1e0c('0x11')]({'plain':!![]});_0x506e0a['CmHopperBlack'][_0x1e0c('0x1b')]({'phone':_0x504f4d[_0x1e0c('0xa')],'ContactId':_0x504f4d['id'],'ListId':_0x504f4d[_0x1e0c('0x1c')],'CampaignId':_0x177fbb['id']})[_0x1e0c('0x25')](function(_0x3df41e){logger[_0x1e0c('0x12')](_0x1e0c('0x31'),'afterCreate',_0x3df41e['message']);});}}});})[_0x1e0c('0x17')](function(){_0x2bd205();})['catch'](function(_0x282b93){logger[_0x1e0c('0x12')](_0x1e0c('0x31'),_0x1e0c('0x14'),_0x282b93[_0x1e0c('0x34')]);_0x2bd205(_0x282b93);});}else{_0x2bd205(new Error(_0x1e0c('0x35')));}},'afterDestroy':function(_0x48cc46,_0x117914,_0x326c10){var _0x47699e=_0x57c88f[_0x1e0c('0x10')];var _0x421578=_0x48cc46['get']({'plain':!![]});return _0x47699e[_0x1e0c('0x16')]['findAll']({'raw':!![],'where':{'ListId':_0x421578[_0x1e0c('0x1c')],'ContactId':_0x421578['id']}})[_0x1e0c('0x17')](function(_0x184a89){if(!_[_0x1e0c('0x36')](_0x184a89)){var _0x37ad53=[];for(var _0x440059=0x0;_0x440059<_0x184a89['length'];_0x440059+=0x1){var _0x24334f=_0x47699e[_0x1e0c('0x16')][_0x1e0c('0x37')]({'where':{'ListId':_0x184a89[_0x440059][_0x1e0c('0x1c')],'ContactId':_0x184a89[_0x440059]['ContactId'],'VoiceQueueId':_0x184a89[_0x440059][_0x1e0c('0x38')],'CampaignId':_0x184a89[_0x440059][_0x1e0c('0x39')]}});_0x37ad53[_0x1e0c('0x3a')](_0x24334f);}return BPromise[_0x1e0c('0x3b')](_0x37ad53);}})[_0x1e0c('0x17')](function(_0x2584da){logger['info']('[CmContact][afterDestroy][Succesfull]',util[_0x1e0c('0x15')](_0x2584da,{'showHidden':![],'depth':null}));_0x326c10();})[_0x1e0c('0x25')](function(_0x126969){logger[_0x1e0c('0x12')]('[CmContact][afterDestroy][Error]',util[_0x1e0c('0x15')](_0x126969,{'showHidden':![],'depth':null}));_0x326c10(_0x126969);});}}});}; \ No newline at end of file +var _0xdded=['path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','mobile','email','models','get','error','cmContact','afterCreate','inspect','CmHopper','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','scheduledat','callbackUniqueid','format','YYYY-MM-DD\x20HH:mm:ss','isNil','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','then','cmContact,\x20afterCreate,\x20','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','dialCheckDuplicateType','Lists','always','onlyIfOpen','outbound','CmList','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','length','BlackLists','isEmpty','destroy','ContactId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5f25b3,_0x35481a){var _0x4ab9bf=function(_0x49baf7){while(--_0x49baf7){_0x5f25b3['push'](_0x5f25b3['shift']());}};_0x4ab9bf(++_0x35481a);}(_0xdded,0x17a));var _0xddde=function(_0x39c4bb,_0x2e7841){_0x39c4bb=_0x39c4bb-0x0;var _0x13b9ad=_0xdded[_0x39c4bb];return _0x13b9ad;};'use strict';var _=require(_0xddde('0x0'));var util=require(_0xddde('0x1'));var logger=require(_0xddde('0x2'))(_0xddde('0x3'));var moment=require(_0xddde('0x4'));var BPromise=require(_0xddde('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xddde('0x6'));var rimraf=require(_0xddde('0x7'));var config=require(_0xddde('0x8'));var attributes=require(_0xddde('0x9'));module[_0xddde('0xa')]=function(_0x39fd85,_0x3c3021){return _0x39fd85[_0xddde('0xb')](_0xddde('0xc'),attributes,{'tableName':_0xddde('0xd'),'paranoid':!![],'indexes':[{'name':_0xddde('0xe'),'fields':['phone']},{'name':_0xddde('0xf'),'fields':['firstName','lastName','phone',_0xddde('0x10'),'fax',_0xddde('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x473781,_0x2880de,_0xaaed0c){var _0x27a882=_0x39fd85[_0xddde('0x12')];var _0xb8ed21=_0x473781[_0xddde('0x13')]({'plain':!![]});function _0x35172e(){return function(_0x57e121){logger[_0xddde('0x14')](_0xddde('0x15'),_0xddde('0x16'),util[_0xddde('0x17')](_0x57e121,{'showHidden':![],'depth':null}));};}var _0x7cbcee=function(_0x31c111){return new BPromise(function(_0x491be5,_0x20b440){_0x27a882[_0xddde('0x18')][_0xddde('0x19')]({'where':{'phone':_0xb8ed21['phone'],'VoiceQueueId':_0x31c111['id']}})['then'](function(_0xadd497){if(!_['isNil'](_0xadd497)){throw new Error(_0xddde('0x1a')+_0xb8ed21[_0xddde('0xe')]+_0xddde('0x1b')+_0x31c111['id']);}return _0x27a882[_0xddde('0x18')][_0xddde('0x1c')]({'phone':_0xb8ed21['phone'],'ContactId':_0xb8ed21['id'],'ListId':_0xb8ed21[_0xddde('0x1d')],'priority':_0xb8ed21[_0xddde('0x1e')]?_0xb8ed21['priority']:0x2,'scheduledat':_0xb8ed21[_0xddde('0x1f')]?_0xb8ed21[_0xddde('0x1f')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xb8ed21[_0xddde('0x20')]?!![]:![],'callbackuniqueid':_0xb8ed21['callbackUniqueid']?_0xb8ed21[_0xddde('0x20')]:undefined,'callbackat':_0xb8ed21['callbackUniqueid']?moment()[_0xddde('0x21')](_0xddde('0x22')):undefined,'VoiceQueueId':_0x31c111['id']});})['catch'](function(_0x4ae0a8){_0x20b440(_0x4ae0a8);});});};var _0x3cfd91=function(_0x107bca){return new BPromise(function(_0x97bb0f,_0x275f76){_0x27a882[_0xddde('0x18')][_0xddde('0x19')]({'where':{'phone':_0xb8ed21[_0xddde('0xe')],'VoiceQueueId':_0x107bca['id']}})['then'](function(_0x59320f){if(!_[_0xddde('0x23')](_0x59320f)){throw new Error(_0xddde('0x1a')+_0xb8ed21[_0xddde('0xe')]+_0xddde('0x24')+_0x107bca['id']);}return _0x27a882[_0xddde('0x25')]['findOne']({'where':{'calleridnum':_0xb8ed21[_0xddde('0xe')],'VoiceQueueId':_0x107bca['id']}});})[_0xddde('0x26')](function(_0x4ca351){if(!_['isNil'](_0x4ca351)){throw new Error(_0xddde('0x27')+_0xb8ed21[_0xddde('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x107bca['id']);}return _0x27a882[_0xddde('0x18')][_0xddde('0x1c')]({'phone':_0xb8ed21['phone'],'ContactId':_0xb8ed21['id'],'ListId':_0xb8ed21[_0xddde('0x1d')],'priority':_0xb8ed21[_0xddde('0x1e')]?_0xb8ed21[_0xddde('0x1e')]:0x2,'scheduledat':_0xb8ed21[_0xddde('0x1f')]?_0xb8ed21[_0xddde('0x1f')]:moment()[_0xddde('0x21')](_0xddde('0x22')),'callback':_0xb8ed21[_0xddde('0x20')]?!![]:![],'callbackuniqueid':_0xb8ed21[_0xddde('0x20')]?_0xb8ed21[_0xddde('0x20')]:undefined,'callbackat':_0xb8ed21[_0xddde('0x20')]?moment()[_0xddde('0x21')](_0xddde('0x22')):undefined,'VoiceQueueId':_0x107bca['id']});})[_0xddde('0x28')](function(_0x5e04d6){_0x275f76(_0x5e04d6);});});};function _0x380acb(){return function(_0x5312bb){logger[_0xddde('0x14')](_0xddde('0x15'),_0xddde('0x16'),util['inspect'](_0x5312bb,{'showHidden':![],'depth':null}));};}var _0x49b18c=function(_0x973fc9){return new BPromise(function(_0x3be6ea,_0x45c3b8){_0x27a882['CmHopper']['findOne']({'where':{'phone':_0xb8ed21[_0xddde('0xe')],'CampaignId':_0x973fc9['id']}})[_0xddde('0x26')](function(_0x2ba559){if(!_[_0xddde('0x23')](_0x2ba559)){throw new Error('cmContact,\x20afterCreate\x20'+_0xb8ed21[_0xddde('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x973fc9['id']);}return _0x27a882[_0xddde('0x18')][_0xddde('0x1c')]({'phone':_0xb8ed21[_0xddde('0xe')],'ContactId':_0xb8ed21['id'],'ListId':_0xb8ed21[_0xddde('0x1d')],'priority':_0xb8ed21[_0xddde('0x1e')]?_0xb8ed21[_0xddde('0x1e')]:0x2,'scheduledat':_0xb8ed21[_0xddde('0x1f')]?_0xb8ed21[_0xddde('0x1f')]:moment()[_0xddde('0x21')](_0xddde('0x22')),'callback':_0xb8ed21[_0xddde('0x20')]?!![]:![],'callbackuniqueid':_0xb8ed21[_0xddde('0x20')]?_0xb8ed21['callbackUniqueid']:undefined,'callbackat':_0xb8ed21[_0xddde('0x20')]?moment()[_0xddde('0x21')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x973fc9['id']});})['catch'](function(_0x49c0ab){_0x45c3b8(_0x49c0ab);});});};var _0x143c85=function(_0x384d48){return new BPromise(function(_0x4570ee,_0x12431d){_0x27a882[_0xddde('0x18')][_0xddde('0x19')]({'where':{'phone':_0xb8ed21[_0xddde('0xe')],'CampaignId':_0x384d48['id']}})['then'](function(_0x554724){if(!_[_0xddde('0x23')](_0x554724)){throw new Error('cmContact,\x20afterCreate\x20'+_0xb8ed21[_0xddde('0xe')]+_0xddde('0x29')+_0x384d48['id']);}return _0x27a882['CmHopperFinal'][_0xddde('0x19')]({'where':{'calleridnum':_0xb8ed21[_0xddde('0xe')],'CampaignId':_0x384d48['id']}});})[_0xddde('0x26')](function(_0x535e82){if(!_['isNil'](_0x535e82)){throw new Error(_0xddde('0x27')+_0xb8ed21['phone']+_0xddde('0x2a')+_0x384d48['id']);}return _0x27a882[_0xddde('0x18')][_0xddde('0x1c')]({'phone':_0xb8ed21[_0xddde('0xe')],'ContactId':_0xb8ed21['id'],'ListId':_0xb8ed21[_0xddde('0x1d')],'priority':_0xb8ed21[_0xddde('0x1e')]?_0xb8ed21['priority']:0x2,'scheduledat':_0xb8ed21[_0xddde('0x1f')]?_0xb8ed21[_0xddde('0x1f')]:moment()[_0xddde('0x21')](_0xddde('0x22')),'callback':_0xb8ed21[_0xddde('0x20')]?!![]:![],'callbackuniqueid':_0xb8ed21['callbackUniqueid']?_0xb8ed21[_0xddde('0x20')]:undefined,'callbackat':_0xb8ed21[_0xddde('0x20')]?moment()[_0xddde('0x21')](_0xddde('0x22')):undefined,'CampaignId':_0x384d48['id']});})[_0xddde('0x28')](function(_0xb0c016){_0x12431d(_0xb0c016);});});};if(_0xb8ed21[_0xddde('0x1d')]){_0x27a882[_0xddde('0x2b')][_0xddde('0x2c')]({'where':{'type':'outbound'},'attributes':['id',_0xddde('0x2d')],'include':[{'model':_0x27a882['CmList'],'as':_0xddde('0x2e'),'where':{'id':_0xb8ed21[_0xddde('0x1d')]}}]})['then'](function(_0x28069c){if(_0x28069c){var _0x3e7667=[];for(var _0x3b154b=0x0,_0x4c70ae;_0x3b154b<_0x28069c['length'];_0x3b154b+=0x1){_0x4c70ae=_0x28069c[_0x3b154b]['get']({'plain':!![]});switch(_0x4c70ae[_0xddde('0x2d')]){case _0xddde('0x2f'):_0x3cfd91(_0x4c70ae)[_0xddde('0x28')](_0x35172e());break;case _0xddde('0x30'):_0x7cbcee(_0x4c70ae)['catch'](_0x35172e());break;default:_0x27a882[_0xddde('0x18')][_0xddde('0x1c')]({'phone':_0xb8ed21[_0xddde('0xe')],'ContactId':_0xb8ed21['id'],'ListId':_0xb8ed21['ListId'],'scheduledat':_0xb8ed21[_0xddde('0x1f')]?_0xb8ed21[_0xddde('0x1f')]:moment()[_0xddde('0x21')](_0xddde('0x22')),'priority':_0xb8ed21[_0xddde('0x1e')]?_0xb8ed21['priority']:0x2,'callback':_0xb8ed21[_0xddde('0x20')]?!![]:![],'callbackuniqueid':_0xb8ed21['callbackUniqueid']?_0xb8ed21[_0xddde('0x20')]:undefined,'callbackat':_0xb8ed21['callbackUniqueid']?moment()[_0xddde('0x21')](_0xddde('0x22')):undefined,'VoiceQueueId':_0x4c70ae['id']})[_0xddde('0x28')](_0x35172e());}}}})[_0xddde('0x26')](function(){return _0x27a882[_0xddde('0x2b')][_0xddde('0x2c')]({'where':{'type':_0xddde('0x31')},'attributes':['id'],'include':[{'model':_0x27a882[_0xddde('0x32')],'as':'BlackLists','where':{'id':_0xb8ed21[_0xddde('0x1d')]}}]})[_0xddde('0x26')](function(_0x26133a){if(_0x26133a){var _0xe9610e=[];for(var _0x37ff35=0x0,_0x409485;_0x37ff35<_0x26133a['length'];_0x37ff35+=0x1){_0x409485=_0x26133a[_0x37ff35][_0xddde('0x13')]({'plain':!![]});_0x27a882[_0xddde('0x33')][_0xddde('0x1c')]({'phone':_0xb8ed21[_0xddde('0xe')],'ContactId':_0xb8ed21['id'],'ListId':_0xb8ed21[_0xddde('0x1d')],'VoiceQueueId':_0x409485['id']})['catch'](function(_0x2a8537){logger[_0xddde('0x14')](_0xddde('0x34'),_0xddde('0x16'),_0x2a8537[_0xddde('0x35')]);});}}});})[_0xddde('0x26')](function(){return _0x27a882[_0xddde('0x36')][_0xddde('0x2c')]({'attributes':['id',_0xddde('0x2d')],'include':[{'model':_0x27a882[_0xddde('0x32')],'as':_0xddde('0x2e'),'where':{'id':_0xb8ed21[_0xddde('0x1d')]}}]})[_0xddde('0x26')](function(_0x1966dc){if(_0x1966dc){var _0x3947ee=[];for(var _0xd58937=0x0,_0x34ccf1;_0xd58937<_0x1966dc[_0xddde('0x37')];_0xd58937+=0x1){_0x34ccf1=_0x1966dc[_0xd58937]['get']({'plain':!![]});switch(_0x34ccf1['dialCheckDuplicateType']){case _0xddde('0x2f'):_0x143c85(_0x34ccf1)[_0xddde('0x28')](_0x380acb());break;case _0xddde('0x30'):_0x49b18c(_0x34ccf1)[_0xddde('0x28')](_0x380acb());break;default:_0x27a882[_0xddde('0x18')]['create']({'phone':_0xb8ed21[_0xddde('0xe')],'ContactId':_0xb8ed21['id'],'ListId':_0xb8ed21[_0xddde('0x1d')],'scheduledat':_0xb8ed21[_0xddde('0x1f')]?_0xb8ed21[_0xddde('0x1f')]:moment()[_0xddde('0x21')](_0xddde('0x22')),'priority':_0xb8ed21['priority']?_0xb8ed21[_0xddde('0x1e')]:0x2,'callback':_0xb8ed21[_0xddde('0x20')]?!![]:![],'callbackuniqueid':_0xb8ed21[_0xddde('0x20')]?_0xb8ed21['callbackUniqueid']:undefined,'callbackat':_0xb8ed21[_0xddde('0x20')]?moment()[_0xddde('0x21')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x34ccf1['id']})['catch'](_0x380acb());}}}});})['then'](function(){return _0x27a882[_0xddde('0x36')]['findAll']({'attributes':['id'],'include':[{'model':_0x27a882[_0xddde('0x32')],'as':_0xddde('0x38'),'where':{'id':_0xb8ed21[_0xddde('0x1d')]}}]})[_0xddde('0x26')](function(_0x44b52c){if(_0x44b52c){var _0x58d4bc=[];for(var _0x5cdc94=0x0,_0x4775b4;_0x5cdc94<_0x44b52c[_0xddde('0x37')];_0x5cdc94+=0x1){_0x4775b4=_0x44b52c[_0x5cdc94]['get']({'plain':!![]});_0x27a882[_0xddde('0x33')][_0xddde('0x1c')]({'phone':_0xb8ed21[_0xddde('0xe')],'ContactId':_0xb8ed21['id'],'ListId':_0xb8ed21[_0xddde('0x1d')],'CampaignId':_0x4775b4['id']})[_0xddde('0x28')](function(_0x2f2f0c){logger[_0xddde('0x14')](_0xddde('0x34'),_0xddde('0x16'),_0x2f2f0c[_0xddde('0x35')]);});}}});})['then'](function(){_0xaaed0c();})[_0xddde('0x28')](function(_0x4f92fa){logger[_0xddde('0x14')](_0xddde('0x34'),'afterCreate',_0x4f92fa['message']);_0xaaed0c(_0x4f92fa);});}else{_0xaaed0c(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x1430bb,_0x51589c,_0x31eb36){var _0x20f512=_0x39fd85[_0xddde('0x12')];var _0x4ea2ad=_0x1430bb[_0xddde('0x13')]({'plain':!![]});return _0x20f512[_0xddde('0x18')][_0xddde('0x2c')]({'raw':!![],'where':{'ListId':_0x4ea2ad['ListId'],'ContactId':_0x4ea2ad['id']}})[_0xddde('0x26')](function(_0x195d06){if(!_[_0xddde('0x39')](_0x195d06)){var _0x98c824=[];for(var _0xa89ab2=0x0;_0xa89ab2<_0x195d06['length'];_0xa89ab2+=0x1){var _0x2d06b7=_0x20f512['CmHopper'][_0xddde('0x3a')]({'where':{'ListId':_0x195d06[_0xa89ab2][_0xddde('0x1d')],'ContactId':_0x195d06[_0xa89ab2][_0xddde('0x3b')],'VoiceQueueId':_0x195d06[_0xa89ab2]['VoiceQueueId'],'CampaignId':_0x195d06[_0xa89ab2]['CampaignId']}});_0x98c824[_0xddde('0x3c')](_0x2d06b7);}return BPromise['all'](_0x98c824);}})[_0xddde('0x26')](function(_0x14a71f){logger[_0xddde('0x3d')](_0xddde('0x3e'),util[_0xddde('0x17')](_0x14a71f,{'showHidden':![],'depth':null}));_0x31eb36();})[_0xddde('0x28')](function(_0x29b5b1){logger[_0xddde('0x14')](_0xddde('0x3f'),util['inspect'](_0x29b5b1,{'showHidden':![],'depth':null}));_0x31eb36(_0x29b5b1);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index b0bcbbd..c0595a3 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa901=['options','attributes','include','map','model','CreateCmContact','body','raw','keys','length','startsWith','update','table','cm_contacts','set','where','toString','query','debug','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetCmContact','CmContact','findAll'];(function(_0x28c74a,_0x2bf678){var _0x44a4ba=function(_0x5ef84c){while(--_0x5ef84c){_0x28c74a['push'](_0x28c74a['shift']());}};_0x44a4ba(++_0x2bf678);}(_0xa901,0x193));var _0x1a90=function(_0x424770,_0x2c3002){_0x424770=_0x424770-0x0;var _0x24c497=_0xa901[_0x424770];return _0x24c497;};'use strict';var _=require('lodash');var util=require(_0x1a90('0x0'));var moment=require('moment');var BPromise=require(_0x1a90('0x1'));var rs=require(_0x1a90('0x2'));var fs=require('fs');var Redis=require(_0x1a90('0x3'));var squel=require('squel');var db=require('../../mysqldb')['db'];var utils=require(_0x1a90('0x4'));var logger=require(_0x1a90('0x5'))(_0x1a90('0x6'));var config=require(_0x1a90('0x7'));var jayson=require(_0x1a90('0x8'));var client=jayson[_0x1a90('0x9')][_0x1a90('0xa')]({'port':0x232a});config[_0x1a90('0xb')]=_[_0x1a90('0xc')](config[_0x1a90('0xb')],{'host':_0x1a90('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a90('0xb')]));require(_0x1a90('0xe'))[_0x1a90('0xf')](socket);function respondWithRpcPromise(_0x289942,_0x376861,_0x4e6435){return new BPromise(function(_0x5e556e,_0x2d7914){return client[_0x1a90('0x10')](_0x289942,_0x4e6435)[_0x1a90('0x11')](function(_0x2f32a3){logger[_0x1a90('0x12')](_0x1a90('0x13'),_0x376861,_0x1a90('0x14'));logger['debug']('CmContact,\x20%s,\x20%s,\x20%s',_0x376861,_0x1a90('0x14'),JSON[_0x1a90('0x15')](_0x2f32a3));if(_0x2f32a3[_0x1a90('0x16')]){if(_0x2f32a3[_0x1a90('0x16')][_0x1a90('0x17')]===0x1f4){logger['error'](_0x1a90('0x13'),_0x376861,_0x2f32a3[_0x1a90('0x16')][_0x1a90('0x18')]);return _0x2d7914(_0x2f32a3['error'][_0x1a90('0x18')]);}logger[_0x1a90('0x16')](_0x1a90('0x13'),_0x376861,_0x2f32a3[_0x1a90('0x16')][_0x1a90('0x18')]);return _0x5e556e(_0x2f32a3['error']['message']);}else{logger[_0x1a90('0x12')](_0x1a90('0x13'),_0x376861,_0x1a90('0x14'));_0x5e556e(_0x2f32a3['result'][_0x1a90('0x18')]);}})[_0x1a90('0x19')](function(_0x2c1f4b){logger[_0x1a90('0x16')](_0x1a90('0x13'),_0x376861,_0x2c1f4b);_0x2d7914(_0x2c1f4b);});});}exports[_0x1a90('0x1a')]=function(_0x5a877a){var _0x264e38=this;return new Promise(function(_0x135003,_0x2d9233){return db[_0x1a90('0x1b')][_0x1a90('0x1c')]({'raw':_0x5a877a[_0x1a90('0x1d')]?_0x5a877a['options']['raw']===undefined?!![]:![]:!![],'where':_0x5a877a[_0x1a90('0x1d')]?_0x5a877a[_0x1a90('0x1d')]['where']||null:null,'attributes':_0x5a877a['options']?_0x5a877a['options'][_0x1a90('0x1e')]||null:null,'limit':_0x5a877a['options']?_0x5a877a[_0x1a90('0x1d')]['limit']||null:null,'include':_0x5a877a['options']?_0x5a877a[_0x1a90('0x1d')][_0x1a90('0x1f')]?_[_0x1a90('0x20')](_0x5a877a[_0x1a90('0x1d')][_0x1a90('0x1f')],function(_0x56359b){return{'model':db[_0x56359b['model']],'as':_0x56359b['as'],'attributes':_0x56359b[_0x1a90('0x1e')],'include':_0x56359b[_0x1a90('0x1f')]?_[_0x1a90('0x20')](_0x56359b['include'],function(_0x4c8d6b){return{'model':db[_0x4c8d6b[_0x1a90('0x21')]],'as':_0x4c8d6b['as'],'attributes':_0x4c8d6b[_0x1a90('0x1e')],'include':_0x4c8d6b[_0x1a90('0x1f')]?_[_0x1a90('0x20')](_0x4c8d6b[_0x1a90('0x1f')],function(_0xed3684){return{'model':db[_0xed3684[_0x1a90('0x21')]],'as':_0xed3684['as'],'attributes':_0xed3684['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a90('0x11')](function(_0x36561c){logger['info']('GetCmContact',_0x5a877a);logger['debug'](_0x1a90('0x1a'),_0x5a877a,JSON[_0x1a90('0x15')](_0x36561c));_0x135003(_0x36561c);})[_0x1a90('0x19')](function(_0x492764){logger[_0x1a90('0x16')]('GetCmContact',_0x492764[_0x1a90('0x18')],_0x5a877a);_0x2d9233(_0x264e38['error'](0x1f4,_0x492764[_0x1a90('0x18')]));});});};exports[_0x1a90('0x22')]=function(_0x3f983e){var _0x32517d=this;return new Promise(function(_0x3a4b9d,_0x553644){return db[_0x1a90('0x1b')]['create'](_0x3f983e[_0x1a90('0x23')],{'raw':_0x3f983e['options']?_0x3f983e[_0x1a90('0x1d')][_0x1a90('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x27d5dd){var _0x2b0880;for(var _0x2a4d71=0x0;_0x2a4d71{}\s\\|]/g,'-');_0x33783d(null,util[_0x42ec('0x25')](_0x42ec('0x26'),path[_0x42ec('0x27')](_0x1e08a2['originalname'],path[_0x42ec('0x28')](_0x1e08a2[_0x42ec('0x24')])),Date[_0x42ec('0x29')](),path['extname'](_0x1e08a2[_0x42ec('0x24')])));}})});router[_0x42ec('0x19')](_0x42ec('0x2a'),upload[_0x42ec('0x2b')]('file'),controller['uploadCsv']);var upload=multer({'storage':multer[_0x42ec('0x21')]({'destination':function(_0x482c62,_0x24b351,_0x5e1a7){_0x5e1a7(null,path[_0x42ec('0x22')](config[_0x42ec('0x2c')],_0x42ec('0x23')));},'filename':function(_0x5483d6,_0xa0a750,_0xd419bc){_0xa0a750[_0x42ec('0x24')]=_0xa0a750[_0x42ec('0x24')][_0x42ec('0x2d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xd419bc(null,util[_0x42ec('0x25')](_0x42ec('0x26'),path[_0x42ec('0x27')](_0xa0a750[_0x42ec('0x24')],path['extname'](_0xa0a750['originalname'])),Date[_0x42ec('0x29')](),path[_0x42ec('0x28')](_0xa0a750[_0x42ec('0x24')])));}})});router[_0x42ec('0x19')](_0x42ec('0x2e'),upload['single']('file'),controller[_0x42ec('0x2f')]);router[_0x42ec('0x19')](_0x42ec('0x30'),auth['isAuthenticated'](),controller[_0x42ec('0x31')]);router['post'](_0x42ec('0x32'),auth[_0x42ec('0xa')](),controller[_0x42ec('0x33')]);router[_0x42ec('0x34')](_0x42ec('0xd'),auth[_0x42ec('0xa')](),controller[_0x42ec('0x35')]);router[_0x42ec('0x36')](_0x42ec('0xd'),auth[_0x42ec('0xa')](),controller[_0x42ec('0x37')]);module[_0x42ec('0x38')]=router; \ No newline at end of file +var _0x12c8=['/merge','merge','/create_many','bulkCreate','/:id/phones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','diskStorage','root','server/files/tmp','originalname','replace','%s-%s%s','extname','now','single','file','uploadCsv','join','format','basename','/upload','upload','/uploadUpdates/:id','importUpdates','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','/describe','describe','show','/:id/tags','getTags','getAdditionalPhones','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','getJourney','post'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0x12c8,0x1ae));var _0x812c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12c8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x812c('0x0'));var util=require(_0x812c('0x1'));var path=require(_0x812c('0x2'));var timeout=require(_0x812c('0x3'));var express=require('express');var router=express[_0x812c('0x4')]();var fs_extra=require(_0x812c('0x5'));var auth=require(_0x812c('0x6'));var interaction=require(_0x812c('0x7'));var config=require(_0x812c('0x8'));var controller=require(_0x812c('0x9'));router[_0x812c('0xa')]('/',auth[_0x812c('0xb')](),controller['index']);router[_0x812c('0xa')](_0x812c('0xc'),auth[_0x812c('0xb')](),controller[_0x812c('0xd')]);router[_0x812c('0xa')]('/:id',auth[_0x812c('0xb')](),controller[_0x812c('0xe')]);router['get'](_0x812c('0xf'),auth['isAuthenticated'](),controller[_0x812c('0x10')]);router[_0x812c('0xa')]('/:id/phones',auth['isAuthenticated'](),controller[_0x812c('0x11')]);router['get'](_0x812c('0x12'),auth[_0x812c('0xb')](),controller[_0x812c('0x13')]);router[_0x812c('0xa')](_0x812c('0x14'),auth[_0x812c('0xb')](),controller['getHopperHistories']);router[_0x812c('0xa')]('/:id/hopper_finals',auth[_0x812c('0xb')](),controller[_0x812c('0x15')]);router[_0x812c('0xa')](_0x812c('0x16'),auth[_0x812c('0xb')](),controller[_0x812c('0x17')]);router[_0x812c('0xa')]('/:id/journey',auth['isAuthenticated'](),controller[_0x812c('0x18')]);router[_0x812c('0x19')](_0x812c('0x1a'),auth['isAuthenticated'](),controller[_0x812c('0x1b')]);router[_0x812c('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x812c('0x19')](_0x812c('0x1c'),auth[_0x812c('0xb')](),controller[_0x812c('0x1d')]);router[_0x812c('0x19')](_0x812c('0xf'),auth[_0x812c('0xb')](),controller['setTags']);router[_0x812c('0x19')](_0x812c('0x1e'),auth[_0x812c('0xb')](),controller['setAdditionalPhones']);router[_0x812c('0x19')](_0x812c('0x1f'),auth[_0x812c('0xb')](),controller['duplicateAdditionalPhones']);router[_0x812c('0x19')](_0x812c('0x20'),auth[_0x812c('0xb')](),controller[_0x812c('0x21')]);var upload=multer({'storage':multer[_0x812c('0x22')]({'destination':function(_0x281770,_0x1aaae0,_0x1b0f8d){_0x1b0f8d(null,path['join'](config[_0x812c('0x23')],_0x812c('0x24')));},'filename':function(_0x21ac97,_0x325e14,_0x39c2a2){_0x325e14[_0x812c('0x25')]=_0x325e14[_0x812c('0x25')][_0x812c('0x26')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x39c2a2(null,util['format'](_0x812c('0x27'),path['basename'](_0x325e14[_0x812c('0x25')],path[_0x812c('0x28')](_0x325e14[_0x812c('0x25')])),Date[_0x812c('0x29')](),path[_0x812c('0x28')](_0x325e14[_0x812c('0x25')])));}})});router[_0x812c('0x19')]('/csv',upload[_0x812c('0x2a')](_0x812c('0x2b')),controller[_0x812c('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x507077,_0x28e94f,_0x504007){_0x504007(null,path[_0x812c('0x2d')](config[_0x812c('0x23')],_0x812c('0x24')));},'filename':function(_0x740d7e,_0x186f0a,_0x426e86){_0x186f0a[_0x812c('0x25')]=_0x186f0a[_0x812c('0x25')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x426e86(null,util[_0x812c('0x2e')]('%s-%s%s',path[_0x812c('0x2f')](_0x186f0a[_0x812c('0x25')],path[_0x812c('0x28')](_0x186f0a['originalname'])),Date[_0x812c('0x29')](),path['extname'](_0x186f0a[_0x812c('0x25')])));}})});router[_0x812c('0x19')](_0x812c('0x30'),upload[_0x812c('0x2a')](_0x812c('0x2b')),controller[_0x812c('0x31')]);router[_0x812c('0x19')]('/upload/:id',auth[_0x812c('0xb')](),controller['import']);router[_0x812c('0x19')](_0x812c('0x32'),auth[_0x812c('0xb')](),controller[_0x812c('0x33')]);router[_0x812c('0x34')](_0x812c('0x35'),auth[_0x812c('0xb')](),controller['update']);router[_0x812c('0x36')]('/:id',auth[_0x812c('0xb')](),controller[_0x812c('0x37')]);module[_0x812c('0x38')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 6f44542..bab01e7 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b93=['PHONE','INTEGER','STRING'];(function(_0x459b74,_0x5773bd){var _0x46cb16=function(_0x97867f){while(--_0x97867f){_0x459b74['push'](_0x459b74['shift']());}};_0x46cb16(++_0x5773bd);}(_0x2b93,0x82));var _0x32b9=function(_0x1505e5,_0x5cc291){_0x1505e5=_0x1505e5-0x0;var _0x5b1dcd=_0x2b93[_0x1505e5];return _0x5b1dcd;};'use strict';var Sequelize=require('sequelize');module['exports']={'CmContactId':{'type':Sequelize[_0x32b9('0x0')],'primaryKey':!![]},'item':{'type':Sequelize[_0x32b9('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x32b9('0x0')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x32b9('0x1')],'defaultValue':_0x32b9('0x2')},'OrderBy':{'type':Sequelize[_0x32b9('0x0')],'defaultValue':null},'description':{'type':Sequelize[_0x32b9('0x1')],'defaultValue':null}}; \ No newline at end of file +var _0x505c=['STRING','PHONE','sequelize','INTEGER'];(function(_0x38dd73,_0x4f2717){var _0x24fb4a=function(_0x5e48d3){while(--_0x5e48d3){_0x38dd73['push'](_0x38dd73['shift']());}};_0x24fb4a(++_0x4f2717);}(_0x505c,0x8e));var _0xc505=function(_0x280a97,_0x1c3a99){_0x280a97=_0x280a97-0x0;var _0x54e2a2=_0x505c[_0x280a97];return _0x54e2a2;};'use strict';var Sequelize=require(_0xc505('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xc505('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xc505('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xc505('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xc505('0x3')},'OrderBy':{'type':Sequelize[_0xc505('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xc505('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 196a2f6..2ad8311 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0197=['fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','get','CmContactHasItems','UserProfileResource','destroy','then','error','name','send','index','CmContactHasItem','fieldName','type','key','map','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','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','eml-format','rimraf','zip-dir'];(function(_0xa9e0e5,_0x2b12d5){var _0x1c42ea=function(_0x28318d){while(--_0x28318d){_0xa9e0e5['push'](_0xa9e0e5['shift']());}};_0x1c42ea(++_0x2b12d5);}(_0x0197,0x1ab));var _0x7019=function(_0x5d1a7f,_0x32f096){_0x5d1a7f=_0x5d1a7f-0x0;var _0x2ccabd=_0x0197[_0x5d1a7f];return _0x2ccabd;};'use strict';var emlformat=require(_0x7019('0x0'));var rimraf=require(_0x7019('0x1'));var zipdir=require(_0x7019('0x2'));var jsonpatch=require(_0x7019('0x3'));var rp=require(_0x7019('0x4'));var moment=require(_0x7019('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7019('0x6'));var util=require(_0x7019('0x7'));var path=require(_0x7019('0x8'));var sox=require('sox');var csv=require(_0x7019('0x9'));var ejs=require(_0x7019('0xa'));var fs=require('fs');var fs_extra=require(_0x7019('0xb'));var _=require(_0x7019('0xc'));var squel=require(_0x7019('0xd'));var crypto=require(_0x7019('0xe'));var jsforce=require(_0x7019('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7019('0x9'));var querystring=require(_0x7019('0x10'));var Papa=require(_0x7019('0x11'));var Redis=require('ioredis');var authService=require(_0x7019('0x12'));var qs=require(_0x7019('0x13'));var as=require(_0x7019('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7019('0x15'))('api');var utils=require(_0x7019('0x16'));var config=require(_0x7019('0x17'));var licenseUtil=require(_0x7019('0x18'));var db=require(_0x7019('0x19'))['db'];function respondWithStatusCode(_0x363230,_0x35828f){_0x35828f=_0x35828f||0xcc;return function(_0x2d8bf4){if(_0x2d8bf4){return _0x363230[_0x7019('0x1a')](_0x35828f);}return _0x363230[_0x7019('0x1b')](_0x35828f)[_0x7019('0x1c')]();};}function respondWithResult(_0x198ee5,_0x57cede){_0x57cede=_0x57cede||0xc8;return function(_0x158218){if(_0x158218){return _0x198ee5[_0x7019('0x1b')](_0x57cede)[_0x7019('0x1d')](_0x158218);}};}function respondWithFilteredResult(_0x2bfe5b,_0xab4c3b){return function(_0x1275af){if(_0x1275af){var _0x105b04=typeof _0xab4c3b[_0x7019('0x1e')]===_0x7019('0x1f')&&typeof _0xab4c3b['limit']==='undefined';var _0x5bd6e3=_0x1275af['count'];var _0x22c0a6=_0x105b04?0x0:_0xab4c3b['offset'];var _0x40d98e=_0x105b04?_0x1275af[_0x7019('0x20')]:_0xab4c3b[_0x7019('0x1e')]+_0xab4c3b[_0x7019('0x21')];var _0x27eaf1;if(_0x40d98e>=_0x5bd6e3){_0x40d98e=_0x5bd6e3;_0x27eaf1=0xc8;}else{_0x27eaf1=0xce;}_0x2bfe5b[_0x7019('0x1b')](_0x27eaf1);return _0x2bfe5b['set'](_0x7019('0x22'),_0x22c0a6+'-'+_0x40d98e+'/'+_0x5bd6e3)[_0x7019('0x1d')](_0x1275af);}return null;};}function patchUpdates(_0x120f32){return function(_0x39559a){try{jsonpatch[_0x7019('0x23')](_0x39559a,_0x120f32,!![]);}catch(_0x1b1b59){return BPromise['reject'](_0x1b1b59);}return _0x39559a[_0x7019('0x24')]();};}function saveUpdates(_0x12220b,_0x1c93b3){return function(_0x226721){if(_0x226721){return _0x226721[_0x7019('0x25')](_0x12220b)['then'](function(_0x5b925e){return _0x5b925e;});}return null;};}function removeEntity(_0x4aaa9f,_0x5e1c0e){return function(_0x194887){if(_0x194887){return _0x194887['destroy']()['then'](function(){var _0x4d8a1f=_0x194887[_0x7019('0x26')]({'plain':!![]});var _0x1cec1f=_0x7019('0x27');return db[_0x7019('0x28')][_0x7019('0x29')]({'where':{'type':_0x1cec1f,'resourceId':_0x4d8a1f['id']}})[_0x7019('0x2a')](function(){return _0x194887;});})[_0x7019('0x2a')](function(){_0x4aaa9f[_0x7019('0x1b')](0xcc)[_0x7019('0x1c')]();});}};}function handleEntityNotFound(_0x1e0ffb,_0x4c4340){return function(_0x7441c5){if(!_0x7441c5){_0x1e0ffb[_0x7019('0x1a')](0x194);}return _0x7441c5;};}function handleError(_0x517ba3,_0x9be7bc){_0x9be7bc=_0x9be7bc||0x1f4;return function(_0x27d859){logger[_0x7019('0x2b')](_0x27d859['stack']);if(_0x27d859['name']){delete _0x27d859[_0x7019('0x2c')];}_0x517ba3[_0x7019('0x1b')](_0x9be7bc)[_0x7019('0x2d')](_0x27d859);};}exports[_0x7019('0x2e')]=function(_0x50b199,_0x278dad){var _0x4b9fc5={},_0x382ca4={},_0x304cdf={'count':0x0,'rows':[]};var _0x68f122=_['map'](db[_0x7019('0x2f')]['rawAttributes'],function(_0x324f6d){return{'name':_0x324f6d[_0x7019('0x30')],'type':_0x324f6d[_0x7019('0x31')][_0x7019('0x32')]};});_0x382ca4['model']=_[_0x7019('0x33')](_0x68f122,_0x7019('0x2c'));_0x382ca4[_0x7019('0x34')]=_[_0x7019('0x35')](_0x50b199[_0x7019('0x34')]);_0x382ca4[_0x7019('0x36')]=_['intersection'](_0x382ca4['model'],_0x382ca4[_0x7019('0x34')]);_0x4b9fc5[_0x7019('0x37')]=_[_0x7019('0x38')](_0x382ca4[_0x7019('0x39')],qs[_0x7019('0x3a')](_0x50b199[_0x7019('0x34')][_0x7019('0x3a')]));_0x4b9fc5['attributes']=_0x4b9fc5[_0x7019('0x37')][_0x7019('0x3b')]?_0x4b9fc5[_0x7019('0x37')]:_0x382ca4[_0x7019('0x39')];if(!_0x50b199[_0x7019('0x34')][_0x7019('0x3c')]('nolimit')){_0x4b9fc5['limit']=qs['limit'](_0x50b199[_0x7019('0x34')][_0x7019('0x21')]);_0x4b9fc5['offset']=qs[_0x7019('0x1e')](_0x50b199[_0x7019('0x34')][_0x7019('0x1e')]);}_0x4b9fc5[_0x7019('0x3d')]=qs[_0x7019('0x3e')](_0x50b199[_0x7019('0x34')]['sort']);_0x4b9fc5[_0x7019('0x3f')]=qs[_0x7019('0x36')](_[_0x7019('0x40')](_0x50b199[_0x7019('0x34')],_0x382ca4[_0x7019('0x36')]),_0x68f122);if(_0x50b199[_0x7019('0x34')][_0x7019('0x41')]){_0x4b9fc5[_0x7019('0x3f')]=_[_0x7019('0x42')](_0x4b9fc5['where'],{'$or':_['map'](_0x68f122,function(_0x9796ac){if(_0x9796ac[_0x7019('0x31')]!=='VIRTUAL'){var _0x3defcd={};_0x3defcd[_0x9796ac[_0x7019('0x2c')]]={'$like':'%'+_0x50b199[_0x7019('0x34')][_0x7019('0x41')]+'%'};return _0x3defcd;}})});}_0x4b9fc5=_[_0x7019('0x42')]({},_0x4b9fc5,_0x50b199[_0x7019('0x43')]);var _0x4c3ad7={'where':_0x4b9fc5[_0x7019('0x3f')]};return db[_0x7019('0x2f')]['count'](_0x4c3ad7)['then'](function(_0x56a36f){_0x304cdf[_0x7019('0x20')]=_0x56a36f;if(_0x50b199[_0x7019('0x34')][_0x7019('0x44')]){_0x4b9fc5[_0x7019('0x45')]=[{'all':!![]}];}return db[_0x7019('0x2f')][_0x7019('0x46')](_0x4b9fc5);})[_0x7019('0x2a')](function(_0xec1827){_0x304cdf[_0x7019('0x47')]=_0xec1827;return _0x304cdf;})[_0x7019('0x2a')](respondWithFilteredResult(_0x278dad,_0x4b9fc5))[_0x7019('0x48')](handleError(_0x278dad,null));};exports[_0x7019('0x49')]=function(_0x106072,_0xfb69ca){var _0x42486e={'raw':!![],'where':{'id':_0x106072[_0x7019('0x4a')]['id']}},_0x5a85b6={};_0x5a85b6[_0x7019('0x39')]=_[_0x7019('0x35')](db[_0x7019('0x2f')][_0x7019('0x4b')]);_0x5a85b6[_0x7019('0x34')]=_[_0x7019('0x35')](_0x106072[_0x7019('0x34')]);_0x5a85b6['filters']=_[_0x7019('0x38')](_0x5a85b6[_0x7019('0x39')],_0x5a85b6[_0x7019('0x34')]);_0x42486e[_0x7019('0x37')]=_[_0x7019('0x38')](_0x5a85b6['model'],qs[_0x7019('0x3a')](_0x106072[_0x7019('0x34')][_0x7019('0x3a')]));_0x42486e[_0x7019('0x37')]=_0x42486e['attributes'][_0x7019('0x3b')]?_0x42486e['attributes']:_0x5a85b6['model'];if(_0x106072['query'][_0x7019('0x44')]){_0x42486e[_0x7019('0x45')]=[{'all':!![]}];}_0x42486e=_['merge']({},_0x42486e,_0x106072[_0x7019('0x43')]);return db['CmContactHasItem'][_0x7019('0x4c')](_0x42486e)[_0x7019('0x2a')](handleEntityNotFound(_0xfb69ca,null))[_0x7019('0x2a')](respondWithResult(_0xfb69ca,null))[_0x7019('0x48')](handleError(_0xfb69ca,null));};exports[_0x7019('0x4d')]=function(_0x382eaa,_0x4a312e){return db[_0x7019('0x2f')][_0x7019('0x4d')](_0x382eaa[_0x7019('0x4e')],{})[_0x7019('0x2a')](function(_0x537397){var _0x29f187=_0x382eaa[_0x7019('0x4f')][_0x7019('0x26')]({'plain':!![]});if(!_0x29f187)throw new Error(_0x7019('0x50'));if(_0x29f187[_0x7019('0x51')]===_0x7019('0x4f')){var _0x53d244=_0x537397[_0x7019('0x26')]({'plain':!![]});var _0x4565bc='CmContactHasItems';return db[_0x7019('0x52')][_0x7019('0x4c')]({'where':{'name':_0x4565bc,'userProfileId':_0x29f187[_0x7019('0x53')]},'raw':!![]})[_0x7019('0x2a')](function(_0xb1f042){if(_0xb1f042&&_0xb1f042[_0x7019('0x54')]===0x0){return db['UserProfileResource'][_0x7019('0x4d')]({'name':_0x53d244['name'],'resourceId':_0x53d244['id'],'type':_0xb1f042[_0x7019('0x2c')],'sectionId':_0xb1f042['id']},{})[_0x7019('0x2a')](function(){return _0x537397;});}else{return _0x537397;}})[_0x7019('0x48')](function(_0x2c9bba){logger['error'](_0x7019('0x55'),_0x2c9bba);throw _0x2c9bba;});}return _0x537397;})[_0x7019('0x2a')](respondWithResult(_0x4a312e,0xc9))[_0x7019('0x48')](handleError(_0x4a312e,null));};exports[_0x7019('0x25')]=function(_0x4833ed,_0x1256ad){if(_0x4833ed['body']['id']){delete _0x4833ed['body']['id'];}return db[_0x7019('0x2f')][_0x7019('0x4c')]({'where':{'id':_0x4833ed[_0x7019('0x4a')]['id']}})[_0x7019('0x2a')](handleEntityNotFound(_0x1256ad,null))[_0x7019('0x2a')](saveUpdates(_0x4833ed[_0x7019('0x4e')],null))[_0x7019('0x2a')](respondWithResult(_0x1256ad,null))[_0x7019('0x48')](handleError(_0x1256ad,null));};exports[_0x7019('0x29')]=function(_0x3ea92e,_0x3a6033){return db[_0x7019('0x2f')][_0x7019('0x4c')]({'where':{'id':_0x3ea92e[_0x7019('0x4a')]['id']}})[_0x7019('0x2a')](handleEntityNotFound(_0x3a6033,null))[_0x7019('0x2a')](removeEntity(_0x3a6033,null))[_0x7019('0x48')](handleError(_0x3a6033,null));}; \ No newline at end of file +var _0x80b6=['merge','includeAll','include','findAll','rows','catch','show','length','options','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','create','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','CmContactHasItems','UserProfileResource','sendStatus','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0x80b6,0x162));var _0x680b=function(_0x5b320e,_0x4c182d){_0x5b320e=_0x5b320e-0x0;var _0x22a7c4=_0x80b6[_0x5b320e];return _0x22a7c4;};'use strict';var emlformat=require(_0x680b('0x0'));var rimraf=require(_0x680b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x680b('0x2'));var rp=require(_0x680b('0x3'));var moment=require(_0x680b('0x4'));var BPromise=require(_0x680b('0x5'));var Mustache=require(_0x680b('0x6'));var util=require('util');var path=require(_0x680b('0x7'));var sox=require(_0x680b('0x8'));var csv=require(_0x680b('0x9'));var ejs=require(_0x680b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x680b('0xb'));var squel=require('squel');var crypto=require(_0x680b('0xc'));var jsforce=require(_0x680b('0xd'));var deskjs=require(_0x680b('0xe'));var toCsv=require(_0x680b('0x9'));var querystring=require(_0x680b('0xf'));var Papa=require(_0x680b('0x10'));var Redis=require(_0x680b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x680b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x680b('0x13'))(_0x680b('0x14'));var utils=require(_0x680b('0x15'));var config=require(_0x680b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x680b('0x17'))['db'];function respondWithStatusCode(_0x3d409e,_0x40abd5){_0x40abd5=_0x40abd5||0xcc;return function(_0x139953){if(_0x139953){return _0x3d409e['sendStatus'](_0x40abd5);}return _0x3d409e[_0x680b('0x18')](_0x40abd5)[_0x680b('0x19')]();};}function respondWithResult(_0x3dd58d,_0x20ea7d){_0x20ea7d=_0x20ea7d||0xc8;return function(_0x3f6450){if(_0x3f6450){return _0x3dd58d[_0x680b('0x18')](_0x20ea7d)[_0x680b('0x1a')](_0x3f6450);}};}function respondWithFilteredResult(_0x1e09ca,_0x457075){return function(_0x5d4aad){if(_0x5d4aad){var _0xdaaa0f=typeof _0x457075['offset']===_0x680b('0x1b')&&typeof _0x457075[_0x680b('0x1c')]===_0x680b('0x1b');var _0x5f4101=_0x5d4aad[_0x680b('0x1d')];var _0x573760=_0xdaaa0f?0x0:_0x457075[_0x680b('0x1e')];var _0x398e26=_0xdaaa0f?_0x5d4aad['count']:_0x457075[_0x680b('0x1e')]+_0x457075[_0x680b('0x1c')];var _0x2f4437;if(_0x398e26>=_0x5f4101){_0x398e26=_0x5f4101;_0x2f4437=0xc8;}else{_0x2f4437=0xce;}_0x1e09ca[_0x680b('0x18')](_0x2f4437);return _0x1e09ca[_0x680b('0x1f')](_0x680b('0x20'),_0x573760+'-'+_0x398e26+'/'+_0x5f4101)['json'](_0x5d4aad);}return null;};}function patchUpdates(_0x1d7a43){return function(_0x89fcc6){try{jsonpatch[_0x680b('0x21')](_0x89fcc6,_0x1d7a43,!![]);}catch(_0x153431){return BPromise[_0x680b('0x22')](_0x153431);}return _0x89fcc6[_0x680b('0x23')]();};}function saveUpdates(_0x402d99,_0x8fe28f){return function(_0x4c1430){if(_0x4c1430){return _0x4c1430[_0x680b('0x24')](_0x402d99)[_0x680b('0x25')](function(_0x4e507d){return _0x4e507d;});}return null;};}function removeEntity(_0x1a5dea,_0x1657c1){return function(_0x9ff5ec){if(_0x9ff5ec){return _0x9ff5ec[_0x680b('0x26')]()[_0x680b('0x25')](function(){var _0x50024f=_0x9ff5ec['get']({'plain':!![]});var _0x4a95cc=_0x680b('0x27');return db[_0x680b('0x28')][_0x680b('0x26')]({'where':{'type':_0x4a95cc,'resourceId':_0x50024f['id']}})['then'](function(){return _0x9ff5ec;});})[_0x680b('0x25')](function(){_0x1a5dea[_0x680b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x344312,_0x87a337){return function(_0x112d48){if(!_0x112d48){_0x344312[_0x680b('0x29')](0x194);}return _0x112d48;};}function handleError(_0x31145f,_0x530f6c){_0x530f6c=_0x530f6c||0x1f4;return function(_0x5ef0b6){logger[_0x680b('0x2a')](_0x5ef0b6[_0x680b('0x2b')]);if(_0x5ef0b6['name']){delete _0x5ef0b6[_0x680b('0x2c')];}_0x31145f[_0x680b('0x18')](_0x530f6c)[_0x680b('0x2d')](_0x5ef0b6);};}exports[_0x680b('0x2e')]=function(_0x3885c9,_0x3b6a3a){var _0x1119c2={},_0x5a543f={},_0x1246a0={'count':0x0,'rows':[]};var _0x37a7f2=_[_0x680b('0x2f')](db[_0x680b('0x30')][_0x680b('0x31')],function(_0x13d42e){return{'name':_0x13d42e[_0x680b('0x32')],'type':_0x13d42e[_0x680b('0x33')][_0x680b('0x34')]};});_0x5a543f['model']=_[_0x680b('0x2f')](_0x37a7f2,_0x680b('0x2c'));_0x5a543f[_0x680b('0x35')]=_[_0x680b('0x36')](_0x3885c9[_0x680b('0x35')]);_0x5a543f[_0x680b('0x37')]=_[_0x680b('0x38')](_0x5a543f[_0x680b('0x39')],_0x5a543f[_0x680b('0x35')]);_0x1119c2[_0x680b('0x3a')]=_[_0x680b('0x38')](_0x5a543f['model'],qs[_0x680b('0x3b')](_0x3885c9['query'][_0x680b('0x3b')]));_0x1119c2[_0x680b('0x3a')]=_0x1119c2['attributes']['length']?_0x1119c2[_0x680b('0x3a')]:_0x5a543f[_0x680b('0x39')];if(!_0x3885c9[_0x680b('0x35')][_0x680b('0x3c')](_0x680b('0x3d'))){_0x1119c2[_0x680b('0x1c')]=qs[_0x680b('0x1c')](_0x3885c9[_0x680b('0x35')][_0x680b('0x1c')]);_0x1119c2[_0x680b('0x1e')]=qs[_0x680b('0x1e')](_0x3885c9[_0x680b('0x35')][_0x680b('0x1e')]);}_0x1119c2[_0x680b('0x3e')]=qs[_0x680b('0x3f')](_0x3885c9['query'][_0x680b('0x3f')]);_0x1119c2[_0x680b('0x40')]=qs[_0x680b('0x37')](_['pick'](_0x3885c9['query'],_0x5a543f[_0x680b('0x37')]),_0x37a7f2);if(_0x3885c9[_0x680b('0x35')][_0x680b('0x41')]){_0x1119c2['where']=_[_0x680b('0x42')](_0x1119c2['where'],{'$or':_['map'](_0x37a7f2,function(_0x1325a2){if(_0x1325a2[_0x680b('0x33')]!=='VIRTUAL'){var _0x1ae2c9={};_0x1ae2c9[_0x1325a2[_0x680b('0x2c')]]={'$like':'%'+_0x3885c9[_0x680b('0x35')][_0x680b('0x41')]+'%'};return _0x1ae2c9;}})});}_0x1119c2=_[_0x680b('0x42')]({},_0x1119c2,_0x3885c9['options']);var _0x29eeae={'where':_0x1119c2[_0x680b('0x40')]};return db['CmContactHasItem'][_0x680b('0x1d')](_0x29eeae)['then'](function(_0x1273fa){_0x1246a0[_0x680b('0x1d')]=_0x1273fa;if(_0x3885c9[_0x680b('0x35')][_0x680b('0x43')]){_0x1119c2[_0x680b('0x44')]=[{'all':!![]}];}return db[_0x680b('0x30')][_0x680b('0x45')](_0x1119c2);})[_0x680b('0x25')](function(_0x271ca8){_0x1246a0[_0x680b('0x46')]=_0x271ca8;return _0x1246a0;})[_0x680b('0x25')](respondWithFilteredResult(_0x3b6a3a,_0x1119c2))[_0x680b('0x47')](handleError(_0x3b6a3a,null));};exports[_0x680b('0x48')]=function(_0x55fb3d,_0x631930){var _0x4fa6b8={'raw':!![],'where':{'id':_0x55fb3d['params']['id']}},_0x145fee={};_0x145fee[_0x680b('0x39')]=_[_0x680b('0x36')](db[_0x680b('0x30')]['rawAttributes']);_0x145fee['query']=_[_0x680b('0x36')](_0x55fb3d[_0x680b('0x35')]);_0x145fee[_0x680b('0x37')]=_['intersection'](_0x145fee[_0x680b('0x39')],_0x145fee[_0x680b('0x35')]);_0x4fa6b8['attributes']=_[_0x680b('0x38')](_0x145fee[_0x680b('0x39')],qs[_0x680b('0x3b')](_0x55fb3d[_0x680b('0x35')]['fields']));_0x4fa6b8[_0x680b('0x3a')]=_0x4fa6b8['attributes'][_0x680b('0x49')]?_0x4fa6b8[_0x680b('0x3a')]:_0x145fee[_0x680b('0x39')];if(_0x55fb3d[_0x680b('0x35')][_0x680b('0x43')]){_0x4fa6b8[_0x680b('0x44')]=[{'all':!![]}];}_0x4fa6b8=_[_0x680b('0x42')]({},_0x4fa6b8,_0x55fb3d[_0x680b('0x4a')]);return db[_0x680b('0x30')]['find'](_0x4fa6b8)['then'](handleEntityNotFound(_0x631930,null))[_0x680b('0x25')](respondWithResult(_0x631930,null))[_0x680b('0x47')](handleError(_0x631930,null));};exports['create']=function(_0xea6f68,_0x2ca079){return db[_0x680b('0x30')]['create'](_0xea6f68[_0x680b('0x4b')],{})[_0x680b('0x25')](function(_0x40aeac){var _0x20e51d=_0xea6f68['user'][_0x680b('0x4c')]({'plain':!![]});if(!_0x20e51d)throw new Error(_0x680b('0x4d'));if(_0x20e51d[_0x680b('0x4e')]==='user'){var _0x3dd71f=_0x40aeac[_0x680b('0x4c')]({'plain':!![]});var _0x130bf6=_0x680b('0x27');return db[_0x680b('0x4f')][_0x680b('0x50')]({'where':{'name':_0x130bf6,'userProfileId':_0x20e51d['userProfileId']},'raw':!![]})[_0x680b('0x25')](function(_0x16dfff){if(_0x16dfff&&_0x16dfff[_0x680b('0x51')]===0x0){return db[_0x680b('0x28')][_0x680b('0x52')]({'name':_0x3dd71f[_0x680b('0x2c')],'resourceId':_0x3dd71f['id'],'type':_0x16dfff[_0x680b('0x2c')],'sectionId':_0x16dfff['id']},{})[_0x680b('0x25')](function(){return _0x40aeac;});}else{return _0x40aeac;}})[_0x680b('0x47')](function(_0x349df4){logger[_0x680b('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x349df4);throw _0x349df4;});}return _0x40aeac;})[_0x680b('0x25')](respondWithResult(_0x2ca079,0xc9))['catch'](handleError(_0x2ca079,null));};exports[_0x680b('0x24')]=function(_0x1bbe21,_0x18f338){if(_0x1bbe21[_0x680b('0x4b')]['id']){delete _0x1bbe21[_0x680b('0x4b')]['id'];}return db[_0x680b('0x30')]['find']({'where':{'id':_0x1bbe21['params']['id']}})[_0x680b('0x25')](handleEntityNotFound(_0x18f338,null))[_0x680b('0x25')](saveUpdates(_0x1bbe21[_0x680b('0x4b')],null))[_0x680b('0x25')](respondWithResult(_0x18f338,null))[_0x680b('0x47')](handleError(_0x18f338,null));};exports[_0x680b('0x26')]=function(_0x3e6f16,_0x41db29){return db[_0x680b('0x30')][_0x680b('0x50')]({'where':{'id':_0x3e6f16[_0x680b('0x53')]['id']}})[_0x680b('0x25')](handleEntityNotFound(_0x41db29,null))[_0x680b('0x25')](removeEntity(_0x41db29,null))[_0x680b('0x47')](handleError(_0x41db29,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 71a2899..e2406a3 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46ed=['lodash','util','api','moment','bluebird','path','rimraf','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x46ed,0x168));var _0xd46e=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x46ed[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x160bcf,_0x25cf78){return _0x160bcf[_0xd46e('0x9')](_0xd46e('0xa'),attributes,{'tableName':_0xd46e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f47=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','util'];(function(_0x285426,_0x30d8be){var _0x101dd5=function(_0x3b8340){while(--_0x3b8340){_0x285426['push'](_0x285426['shift']());}};_0x101dd5(++_0x30d8be);}(_0x6f47,0xc7));var _0x76f4=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6f47[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require(_0x76f4('0x1'))('api');var moment=require(_0x76f4('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var attributes=require(_0x76f4('0x6'));module[_0x76f4('0x7')]=function(_0x5754ca,_0x35602f){return _0x5754ca[_0x76f4('0x8')](_0x76f4('0x9'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index c1b934a..7c6d56e 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4509=['request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x36df0b,_0x461795){var _0x326ed7=function(_0x12e8b2){while(--_0x12e8b2){_0x36df0b['push'](_0x36df0b['shift']());}};_0x326ed7(++_0x461795);}(_0x4509,0xd7));var _0x9450=function(_0x24fc52,_0x12cf9f){_0x24fc52=_0x24fc52-0x0;var _0x344dfc=_0x4509[_0x24fc52];return _0x344dfc;};'use strict';var _=require(_0x9450('0x0'));var util=require(_0x9450('0x1'));var moment=require(_0x9450('0x2'));var BPromise=require('bluebird');var rs=require(_0x9450('0x3'));var fs=require('fs');var Redis=require(_0x9450('0x4'));var db=require(_0x9450('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9450('0x6'))(_0x9450('0x7'));var config=require(_0x9450('0x8'));var jayson=require(_0x9450('0x9'));var client=jayson[_0x9450('0xa')][_0x9450('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e4a97,_0x2ef1e9,_0x2efc8a){return new BPromise(function(_0x2d1deb,_0x2de5e4){return client[_0x9450('0xc')](_0x4e4a97,_0x2efc8a)[_0x9450('0xd')](function(_0x4ed083){logger[_0x9450('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x2ef1e9,_0x9450('0xf'));logger['debug'](_0x9450('0x10'),_0x2ef1e9,_0x9450('0xf'),JSON[_0x9450('0x11')](_0x4ed083));if(_0x4ed083[_0x9450('0x12')]){if(_0x4ed083['error'][_0x9450('0x13')]===0x1f4){logger['error'](_0x9450('0x14'),_0x2ef1e9,_0x4ed083[_0x9450('0x12')]['message']);return _0x2de5e4(_0x4ed083['error']['message']);}logger['error'](_0x9450('0x14'),_0x2ef1e9,_0x4ed083[_0x9450('0x12')][_0x9450('0x15')]);return _0x2d1deb(_0x4ed083[_0x9450('0x12')]['message']);}else{logger[_0x9450('0xe')](_0x9450('0x14'),_0x2ef1e9,_0x9450('0xf'));_0x2d1deb(_0x4ed083['result'][_0x9450('0x15')]);}})[_0x9450('0x16')](function(_0x22d721){logger[_0x9450('0x12')](_0x9450('0x14'),_0x2ef1e9,_0x22d721);_0x2de5e4(_0x22d721);});});} \ No newline at end of file +var _0xa92e=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x46920d,_0x1b30c9){var _0x4f5814=function(_0xe5c891){while(--_0xe5c891){_0x46920d['push'](_0x46920d['shift']());}};_0x4f5814(++_0x1b30c9);}(_0xa92e,0x1e5));var _0xea92=function(_0x464225,_0x5133ff){_0x464225=_0x464225-0x0;var _0x302494=_0xa92e[_0x464225];return _0x302494;};'use strict';var _=require(_0xea92('0x0'));var util=require('util');var moment=require(_0xea92('0x1'));var BPromise=require(_0xea92('0x2'));var rs=require(_0xea92('0x3'));var fs=require('fs');var Redis=require(_0xea92('0x4'));var db=require(_0xea92('0x5'))['db'];var utils=require(_0xea92('0x6'));var logger=require(_0xea92('0x7'))(_0xea92('0x8'));var config=require('../../config/environment');var jayson=require(_0xea92('0x9'));var client=jayson[_0xea92('0xa')][_0xea92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fd307,_0x154cd2,_0x1da756){return new BPromise(function(_0x1fd59d,_0x564a22){return client[_0xea92('0xc')](_0x1fd307,_0x1da756)['then'](function(_0x2647a5){logger['info'](_0xea92('0xd'),_0x154cd2,_0xea92('0xe'));logger['debug'](_0xea92('0xf'),_0x154cd2,'request\x20sent',JSON['stringify'](_0x2647a5));if(_0x2647a5[_0xea92('0x10')]){if(_0x2647a5[_0xea92('0x10')]['code']===0x1f4){logger[_0xea92('0x10')](_0xea92('0xd'),_0x154cd2,_0x2647a5[_0xea92('0x10')][_0xea92('0x11')]);return _0x564a22(_0x2647a5[_0xea92('0x10')][_0xea92('0x11')]);}logger[_0xea92('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x154cd2,_0x2647a5[_0xea92('0x10')]['message']);return _0x1fd59d(_0x2647a5[_0xea92('0x10')][_0xea92('0x11')]);}else{logger[_0xea92('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x154cd2,_0xea92('0xe'));_0x1fd59d(_0x2647a5[_0xea92('0x13')][_0xea92('0x11')]);}})[_0xea92('0x14')](function(_0x1b9e1a){logger[_0xea92('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x154cd2,_0x1b9e1a);_0x564a22(_0x1b9e1a);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 67f7456..b1e3fd2 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe137=['./cmContactHasItem.controller','get','isAuthenticated','index','show','post','create','update','delete','/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4bea9b,_0x20f36f){var _0x401452=function(_0x5e5c12){while(--_0x5e5c12){_0x4bea9b['push'](_0x4bea9b['shift']());}};_0x401452(++_0x20f36f);}(_0xe137,0xdd));var _0x7e13=function(_0x56a871,_0x18b7fe){_0x56a871=_0x56a871-0x0;var _0x124954=_0xe137[_0x56a871];return _0x124954;};'use strict';var multer=require('multer');var util=require(_0x7e13('0x0'));var path=require('path');var timeout=require(_0x7e13('0x1'));var express=require(_0x7e13('0x2'));var router=express[_0x7e13('0x3')]();var fs_extra=require(_0x7e13('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7e13('0x5'));var config=require(_0x7e13('0x6'));var controller=require(_0x7e13('0x7'));router[_0x7e13('0x8')]('/',auth[_0x7e13('0x9')](),controller[_0x7e13('0xa')]);router[_0x7e13('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7e13('0xb')]);router[_0x7e13('0xc')]('/',auth['isAuthenticated'](),controller[_0x7e13('0xd')]);router['put']('/:id',auth[_0x7e13('0x9')](),controller[_0x7e13('0xe')]);router[_0x7e13('0xf')](_0x7e13('0x10'),auth[_0x7e13('0x9')](),controller[_0x7e13('0x11')]);module[_0x7e13('0x12')]=router; \ No newline at end of file +var _0x3feb=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','show','post','create','put','/:id','destroy'];(function(_0x1cb2e6,_0x2ccaf8){var _0x15f8c0=function(_0x41726a){while(--_0x41726a){_0x1cb2e6['push'](_0x1cb2e6['shift']());}};_0x15f8c0(++_0x2ccaf8);}(_0x3feb,0x1c3));var _0xb3fe=function(_0x391a4f,_0x591b29){_0x391a4f=_0x391a4f-0x0;var _0x172065=_0x3feb[_0x391a4f];return _0x172065;};'use strict';var multer=require('multer');var util=require(_0xb3fe('0x0'));var path=require(_0xb3fe('0x1'));var timeout=require(_0xb3fe('0x2'));var express=require('express');var router=express[_0xb3fe('0x3')]();var fs_extra=require(_0xb3fe('0x4'));var auth=require(_0xb3fe('0x5'));var interaction=require(_0xb3fe('0x6'));var config=require(_0xb3fe('0x7'));var controller=require(_0xb3fe('0x8'));router[_0xb3fe('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb3fe('0x9')]('/:id',auth[_0xb3fe('0xa')](),controller[_0xb3fe('0xb')]);router[_0xb3fe('0xc')]('/',auth[_0xb3fe('0xa')](),controller[_0xb3fe('0xd')]);router[_0xb3fe('0xe')]('/:id',auth[_0xb3fe('0xa')](),controller['update']);router['delete'](_0xb3fe('0xf'),auth[_0xb3fe('0xa')](),controller[_0xb3fe('0x10')]);module[_0xb3fe('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index be4142f..c267b94 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 _0xcb66=['select','parse','values','isArray','BOOLEAN','ENUM','voice','lodash','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','TEXT','long','type'];(function(_0x111c69,_0x5445d8){var _0x5635bc=function(_0x1cfc18){while(--_0x1cfc18){_0x111c69['push'](_0x111c69['shift']());}};_0x5635bc(++_0x5445d8);}(_0xcb66,0x19f));var _0x6cb6=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0xcb66[_0x5d860f];return _0x236490;};'use strict';var Sequelize=require('sequelize');var _=require(_0x6cb6('0x0'));module[_0x6cb6('0x1')]={'name':{'type':Sequelize[_0x6cb6('0x2')],'get':function(_0x3f607b){return this[_0x6cb6('0x3')]('alias');}},'alias':{'type':Sequelize[_0x6cb6('0x4')],'allowNull':![],'set':function(_0x2d7dbb){this[_0x6cb6('0x5')](_0x6cb6('0x6'),_0x2d7dbb?_0x2d7dbb:this[_0x6cb6('0x3')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x6cb6('0x7')](_0x6cb6('0x8')),'get':function(){if(this[_0x6cb6('0x3')](_0x6cb6('0x9'))===_0x6cb6('0xa')){return JSON[_0x6cb6('0xb')](this[_0x6cb6('0x3')](_0x6cb6('0xc')));}else{return this[_0x6cb6('0x3')](_0x6cb6('0xc'));}},'set':function(_0x3aa2b5){if(Array[_0x6cb6('0xd')](_0x3aa2b5)){this[_0x6cb6('0x5')]('values',JSON['stringify'](_0x3aa2b5));}else{this['setDataValue']('values',_0x3aa2b5);}}},'required':{'type':Sequelize[_0x6cb6('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x6cb6('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x6cb6('0xf')](_0x6cb6('0x10'))}}; \ No newline at end of file +var _0x5301=['stringify','BOOLEAN','voice','lodash','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','name','TEXT','type','select','parse','values','isArray'];(function(_0x5900f6,_0x1ff746){var _0x3bb4ab=function(_0x1c49ec){while(--_0x1c49ec){_0x5900f6['push'](_0x5900f6['shift']());}};_0x3bb4ab(++_0x1ff746);}(_0x5301,0x157));var _0x1530=function(_0xebb8b1,_0x24c462){_0xebb8b1=_0xebb8b1-0x0;var _0x44ff13=_0x5301[_0xebb8b1];return _0x44ff13;};'use strict';var Sequelize=require('sequelize');var _=require(_0x1530('0x0'));module[_0x1530('0x1')]={'name':{'type':Sequelize[_0x1530('0x2')],'get':function(_0x126400){return this[_0x1530('0x3')]('alias');}},'alias':{'type':Sequelize[_0x1530('0x4')],'allowNull':![],'set':function(_0x639c58){this[_0x1530('0x5')](_0x1530('0x6'),_0x639c58?_0x639c58:this['getDataValue'](_0x1530('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x1530('0x8')]('long'),'get':function(){if(this[_0x1530('0x3')](_0x1530('0x9'))===_0x1530('0xa')){return JSON[_0x1530('0xb')](this[_0x1530('0x3')]('values'));}else{return this['getDataValue'](_0x1530('0xc'));}},'set':function(_0x46fc58){if(Array[_0x1530('0xd')](_0x46fc58)){this[_0x1530('0x5')]('values',JSON[_0x1530('0xe')](_0x46fc58));}else{this[_0x1530('0x5')](_0x1530('0xc'),_0x46fc58);}}},'required':{'type':Sequelize[_0x1530('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x1530('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index d25f4f0..a5f0e70 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 _0x305e=['switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','destroy','then','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','differenceBy','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','Sequelize','TEXT','number','INTEGER'];(function(_0x4d462e,_0x1339a3){var _0x37c688=function(_0x179948){while(--_0x179948){_0x4d462e['push'](_0x4d462e['shift']());}};_0x37c688(++_0x1339a3);}(_0x305e,0x16d));var _0xe305=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x305e[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xe305('0x0'));var rimraf=require(_0xe305('0x1'));var zipdir=require(_0xe305('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe305('0x3'));var moment=require(_0xe305('0x4'));var BPromise=require(_0xe305('0x5'));var Mustache=require(_0xe305('0x6'));var util=require(_0xe305('0x7'));var path=require('path');var sox=require(_0xe305('0x8'));var csv=require('to-csv');var ejs=require(_0xe305('0x9'));var fs=require('fs');var fs_extra=require(_0xe305('0xa'));var _=require(_0xe305('0xb'));var squel=require(_0xe305('0xc'));var crypto=require(_0xe305('0xd'));var jsforce=require(_0xe305('0xe'));var deskjs=require(_0xe305('0xf'));var toCsv=require(_0xe305('0x10'));var querystring=require(_0xe305('0x11'));var Papa=require('papaparse');var Redis=require(_0xe305('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe305('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe305('0x14'));var logger=require('../../config/logger')(_0xe305('0x15'));var utils=require(_0xe305('0x16'));var config=require(_0xe305('0x17'));var licenseUtil=require(_0xe305('0x18'));var db=require(_0xe305('0x19'))['db'];function respondWithStatusCode(_0x1436f9,_0x513ead){_0x513ead=_0x513ead||0xcc;return function(_0x5ceb5d){if(_0x5ceb5d){return _0x1436f9[_0xe305('0x1a')](_0x513ead);}return _0x1436f9[_0xe305('0x1b')](_0x513ead)[_0xe305('0x1c')]();};}function respondWithResult(_0x2a6f3d,_0x4dc34b){_0x4dc34b=_0x4dc34b||0xc8;return function(_0x16cf58){if(_0x16cf58){return _0x2a6f3d[_0xe305('0x1b')](_0x4dc34b)[_0xe305('0x1d')](_0x16cf58);}};}function respondWithFilteredResult(_0x6cb00c,_0x2fa058){return function(_0x21c651){if(_0x21c651){var _0x36d558=typeof _0x2fa058['offset']==='undefined'&&typeof _0x2fa058[_0xe305('0x1e')]===_0xe305('0x1f');var _0x18b62b=_0x21c651[_0xe305('0x20')];var _0x1469bc=_0x36d558?0x0:_0x2fa058[_0xe305('0x21')];var _0x3efd0a=_0x36d558?_0x21c651['count']:_0x2fa058[_0xe305('0x21')]+_0x2fa058[_0xe305('0x1e')];var _0x42b8a5;if(_0x3efd0a>=_0x18b62b){_0x3efd0a=_0x18b62b;_0x42b8a5=0xc8;}else{_0x42b8a5=0xce;}_0x6cb00c[_0xe305('0x1b')](_0x42b8a5);return _0x6cb00c['set'](_0xe305('0x22'),_0x1469bc+'-'+_0x3efd0a+'/'+_0x18b62b)[_0xe305('0x1d')](_0x21c651);}return null;};}function patchUpdates(_0x430c8f){return function(_0x2be6b2){try{jsonpatch['apply'](_0x2be6b2,_0x430c8f,!![]);}catch(_0x1a61d9){return BPromise[_0xe305('0x23')](_0x1a61d9);}return _0x2be6b2[_0xe305('0x24')]();};}function saveUpdates(_0x2835d6,_0xe1b874){return function(_0x2f57c3){if(_0x2f57c3){return _0x2f57c3[_0xe305('0x25')](_0x2835d6)['then'](function(_0x31e795){return _0x31e795;});}return null;};}function removeEntity(_0x23541f,_0x41d288){return function(_0x43121c){if(_0x43121c){return _0x43121c[_0xe305('0x26')]()[_0xe305('0x27')](function(){_0x23541f[_0xe305('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f2732,_0x5583b0){return function(_0x5d37fb){if(!_0x5d37fb){_0x3f2732[_0xe305('0x1a')](0x194);}return _0x5d37fb;};}function handleError(_0x4dc524,_0x1c905f){_0x1c905f=_0x1c905f||0x1f4;return function(_0x16c0c5){logger['error'](_0x16c0c5['stack']);if(_0x16c0c5['name']){delete _0x16c0c5[_0xe305('0x28')];}_0x4dc524[_0xe305('0x1b')](_0x1c905f)[_0xe305('0x29')](_0x16c0c5);};}exports[_0xe305('0x2a')]=function(_0x2ad6a1,_0x31b1ac){var _0x2a0c05={},_0x1b8ebe={},_0x37c824={'count':0x0,'rows':[]};var _0x393197=_[_0xe305('0x2b')](db[_0xe305('0x2c')][_0xe305('0x2d')],function(_0x34ae58){return{'name':_0x34ae58[_0xe305('0x2e')],'type':_0x34ae58[_0xe305('0x2f')]['key']};});_0x1b8ebe['model']=_[_0xe305('0x30')](_[_0xe305('0x2b')](_0x393197,_0xe305('0x28')),['name']);_0x1b8ebe[_0xe305('0x31')]=_['keys'](_0x2ad6a1[_0xe305('0x31')]);_0x1b8ebe[_0xe305('0x32')]=_['intersection'](_0x1b8ebe[_0xe305('0x33')],_0x1b8ebe[_0xe305('0x31')]);_0x2a0c05[_0xe305('0x34')]=_[_0xe305('0x35')](_0x1b8ebe[_0xe305('0x33')],qs[_0xe305('0x36')](_0x2ad6a1[_0xe305('0x31')][_0xe305('0x36')]));_0x2a0c05[_0xe305('0x34')]=_0x2a0c05[_0xe305('0x34')][_0xe305('0x37')]?_0x2a0c05[_0xe305('0x34')]:_0x1b8ebe[_0xe305('0x33')];if(!_0x2ad6a1['query']['hasOwnProperty'](_0xe305('0x38'))){_0x2a0c05[_0xe305('0x1e')]=qs['limit'](_0x2ad6a1[_0xe305('0x31')][_0xe305('0x1e')]);_0x2a0c05[_0xe305('0x21')]=qs[_0xe305('0x21')](_0x2ad6a1['query'][_0xe305('0x21')]);}_0x2a0c05[_0xe305('0x39')]=qs[_0xe305('0x3a')](_0x2ad6a1['query'][_0xe305('0x3a')]);_0x2a0c05['where']=qs[_0xe305('0x32')](_[_0xe305('0x3b')](_0x2ad6a1[_0xe305('0x31')],_0x1b8ebe[_0xe305('0x32')]),_0x393197);if(_0x2ad6a1[_0xe305('0x31')]['filter']){_0x2a0c05[_0xe305('0x3c')]=_[_0xe305('0x3d')](_0x2a0c05[_0xe305('0x3c')],{'$or':_['map'](_0x393197,function(_0x13ea7d){if(_0x13ea7d['type']!==_0xe305('0x3e')){var _0x46f236={};_0x46f236[_0x13ea7d[_0xe305('0x28')]]={'$like':'%'+_0x2ad6a1[_0xe305('0x31')][_0xe305('0x3f')]+'%'};return _0x46f236;}})});}_0x2a0c05=_[_0xe305('0x3d')]({},_0x2a0c05,_0x2ad6a1[_0xe305('0x40')]);var _0x45c2de={'where':_0x2a0c05[_0xe305('0x3c')]};return db[_0xe305('0x2c')][_0xe305('0x20')](_0x45c2de)[_0xe305('0x27')](function(_0x1a6798){_0x37c824[_0xe305('0x20')]=_0x1a6798;if(_0x2ad6a1['query'][_0xe305('0x41')]){_0x2a0c05[_0xe305('0x42')]=[{'all':!![]}];}return db[_0xe305('0x2c')][_0xe305('0x43')](_0x2a0c05);})['then'](function(_0x36e2d0){_0x37c824[_0xe305('0x44')]=_0x36e2d0;return _0x37c824;})[_0xe305('0x27')](respondWithFilteredResult(_0x31b1ac,_0x2a0c05))[_0xe305('0x45')](handleError(_0x31b1ac,null));};exports[_0xe305('0x46')]=function(_0x3e90f6,_0x1e960a){var _0x40ad3f={'raw':!![],'where':{'id':_0x3e90f6[_0xe305('0x47')]['id']}},_0x2a90ca={};_0x2a90ca[_0xe305('0x33')]=_['keys'](db[_0xe305('0x2c')][_0xe305('0x2d')]);_0x2a90ca[_0xe305('0x31')]=_[_0xe305('0x48')](_0x3e90f6[_0xe305('0x31')]);_0x2a90ca['filters']=_[_0xe305('0x35')](_0x2a90ca['model'],_0x2a90ca['query']);_0x40ad3f[_0xe305('0x34')]=_[_0xe305('0x35')](_0x2a90ca['model'],qs[_0xe305('0x36')](_0x3e90f6[_0xe305('0x31')][_0xe305('0x36')]));_0x40ad3f[_0xe305('0x34')]=_0x40ad3f[_0xe305('0x34')][_0xe305('0x37')]?_0x40ad3f['attributes']:_0x2a90ca[_0xe305('0x33')];if(_0x3e90f6[_0xe305('0x31')][_0xe305('0x41')]){_0x40ad3f[_0xe305('0x42')]=[{'all':!![]}];}_0x40ad3f=_['merge']({},_0x40ad3f,_0x3e90f6[_0xe305('0x40')]);return db['CmCustomField'][_0xe305('0x49')](_0x40ad3f)[_0xe305('0x27')](handleEntityNotFound(_0x1e960a,null))[_0xe305('0x27')](respondWithResult(_0x1e960a,null))['catch'](handleError(_0x1e960a,null));};exports['update']=function(_0x3037aa,_0x1ee78a){if(_0x3037aa['body']['id']){delete _0x3037aa[_0xe305('0x4a')]['id'];}return db[_0xe305('0x2c')][_0xe305('0x49')]({'where':{'id':_0x3037aa[_0xe305('0x47')]['id']}})[_0xe305('0x27')](handleEntityNotFound(_0x1ee78a,null))['then'](saveUpdates(_0x3037aa['body'],null))['then'](respondWithResult(_0x1ee78a,null))[_0xe305('0x45')](handleError(_0x1ee78a,null));};exports[_0xe305('0x26')]=function(_0xcec947,_0x12da34){return db[_0xe305('0x2c')][_0xe305('0x49')]({'where':{'id':_0xcec947[_0xe305('0x47')]['id']}})[_0xe305('0x27')](handleEntityNotFound(_0x12da34,null))[_0xe305('0x27')](removeEntity(_0x12da34,null))[_0xe305('0x45')](handleError(_0x12da34,null));};exports[_0xe305('0x4b')]=function(_0x236507,_0x3ebf10){var _0x5d4213;return db['sequelize']['transaction'](function(_0x950b5e){return db['CmCustomField']['create'](_0x236507[_0xe305('0x4a')],{'transaction':_0x950b5e})[_0xe305('0x27')](function(_0x143293){_0x5d4213=_0x143293;var _0x2bea0d={'type':db[_0xe305('0x4c')][_0xe305('0x4d')],'transaction':_0x950b5e};switch(_0x236507['body'][_0xe305('0x2f')]){case'text':_0x2bea0d[_0xe305('0x2f')]=db['Sequelize']['TEXT'];break;case _0xe305('0x4e'):_0x2bea0d[_0xe305('0x2f')]=db['Sequelize'][_0xe305('0x4f')];break;case _0xe305('0x50'):_0x2bea0d[_0xe305('0x2f')]=db['Sequelize'][_0xe305('0x51')];_0x2bea0d[_0xe305('0x52')]=![];break;default:}return db[_0xe305('0x53')][_0xe305('0x54')][_0xe305('0x55')](_0xe305('0x56'),util[_0xe305('0x57')](_0xe305('0x58'),_0x5d4213['id']),_0x2bea0d);})[_0xe305('0x27')](function(){return _0x5d4213;});})['then'](respondWithResult(_0x3ebf10,0xc9))[_0xe305('0x45')](handleError(_0x3ebf10,null));}; \ No newline at end of file +var _0xf19c=['fields','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','body','destroy','create','sequelize','transaction','Sequelize','TEXT','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','CmCustomField','rawAttributes','fieldName','model','differenceBy','map','query','keys','filters','intersection','attributes'];(function(_0x1b42ff,_0x1e5564){var _0x186aef=function(_0x3b4218){while(--_0x3b4218){_0x1b42ff['push'](_0x1b42ff['shift']());}};_0x186aef(++_0x1e5564);}(_0xf19c,0x12a));var _0xcf19=function(_0x424c92,_0x19635c){_0x424c92=_0x424c92-0x0;var _0x21d904=_0xf19c[_0x424c92];return _0x21d904;};'use strict';var emlformat=require(_0xcf19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf19('0x1'));var jsonpatch=require(_0xcf19('0x2'));var rp=require(_0xcf19('0x3'));var moment=require(_0xcf19('0x4'));var BPromise=require(_0xcf19('0x5'));var Mustache=require(_0xcf19('0x6'));var util=require(_0xcf19('0x7'));var path=require(_0xcf19('0x8'));var sox=require(_0xcf19('0x9'));var csv=require(_0xcf19('0xa'));var ejs=require(_0xcf19('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcf19('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcf19('0xd'));var toCsv=require(_0xcf19('0xa'));var querystring=require('querystring');var Papa=require(_0xcf19('0xe'));var Redis=require('ioredis');var authService=require(_0xcf19('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xcf19('0x10'));var hardwareService=require(_0xcf19('0x11'));var logger=require(_0xcf19('0x12'))(_0xcf19('0x13'));var utils=require(_0xcf19('0x14'));var config=require(_0xcf19('0x15'));var licenseUtil=require(_0xcf19('0x16'));var db=require(_0xcf19('0x17'))['db'];function respondWithStatusCode(_0xba7295,_0x1d8f7d){_0x1d8f7d=_0x1d8f7d||0xcc;return function(_0x516d92){if(_0x516d92){return _0xba7295[_0xcf19('0x18')](_0x1d8f7d);}return _0xba7295[_0xcf19('0x19')](_0x1d8f7d)[_0xcf19('0x1a')]();};}function respondWithResult(_0x42a346,_0x15a5a0){_0x15a5a0=_0x15a5a0||0xc8;return function(_0x18dc9e){if(_0x18dc9e){return _0x42a346[_0xcf19('0x19')](_0x15a5a0)['json'](_0x18dc9e);}};}function respondWithFilteredResult(_0x3591e6,_0xac2680){return function(_0x3846e9){if(_0x3846e9){var _0x3c3f0c=typeof _0xac2680[_0xcf19('0x1b')]===_0xcf19('0x1c')&&typeof _0xac2680[_0xcf19('0x1d')]===_0xcf19('0x1c');var _0x6cb90d=_0x3846e9['count'];var _0x4aebbc=_0x3c3f0c?0x0:_0xac2680[_0xcf19('0x1b')];var _0x5afb5e=_0x3c3f0c?_0x3846e9[_0xcf19('0x1e')]:_0xac2680[_0xcf19('0x1b')]+_0xac2680[_0xcf19('0x1d')];var _0x36af31;if(_0x5afb5e>=_0x6cb90d){_0x5afb5e=_0x6cb90d;_0x36af31=0xc8;}else{_0x36af31=0xce;}_0x3591e6['status'](_0x36af31);return _0x3591e6[_0xcf19('0x1f')](_0xcf19('0x20'),_0x4aebbc+'-'+_0x5afb5e+'/'+_0x6cb90d)[_0xcf19('0x21')](_0x3846e9);}return null;};}function patchUpdates(_0xdf8b36){return function(_0x5b1b74){try{jsonpatch[_0xcf19('0x22')](_0x5b1b74,_0xdf8b36,!![]);}catch(_0x541651){return BPromise[_0xcf19('0x23')](_0x541651);}return _0x5b1b74[_0xcf19('0x24')]();};}function saveUpdates(_0x5b3a9a,_0x463ff1){return function(_0x541a37){if(_0x541a37){return _0x541a37[_0xcf19('0x25')](_0x5b3a9a)[_0xcf19('0x26')](function(_0x33c6a9){return _0x33c6a9;});}return null;};}function removeEntity(_0x3084c8,_0x6b865){return function(_0x31edce){if(_0x31edce){return _0x31edce['destroy']()[_0xcf19('0x26')](function(){_0x3084c8[_0xcf19('0x19')](0xcc)[_0xcf19('0x1a')]();});}};}function handleEntityNotFound(_0xe7d512,_0x15fb0a){return function(_0x53d2fc){if(!_0x53d2fc){_0xe7d512['sendStatus'](0x194);}return _0x53d2fc;};}function handleError(_0x4e3ce8,_0x250a12){_0x250a12=_0x250a12||0x1f4;return function(_0xe27697){logger['error'](_0xe27697[_0xcf19('0x27')]);if(_0xe27697[_0xcf19('0x28')]){delete _0xe27697[_0xcf19('0x28')];}_0x4e3ce8['status'](_0x250a12)[_0xcf19('0x29')](_0xe27697);};}exports[_0xcf19('0x2a')]=function(_0x33e83d,_0x10722e){var _0x35b896={},_0x470618={},_0x4704b1={'count':0x0,'rows':[]};var _0x154d0e=_['map'](db[_0xcf19('0x2b')][_0xcf19('0x2c')],function(_0x2845db){return{'name':_0x2845db[_0xcf19('0x2d')],'type':_0x2845db['type']['key']};});_0x470618[_0xcf19('0x2e')]=_[_0xcf19('0x2f')](_[_0xcf19('0x30')](_0x154d0e,_0xcf19('0x28')),['name']);_0x470618[_0xcf19('0x31')]=_[_0xcf19('0x32')](_0x33e83d[_0xcf19('0x31')]);_0x470618[_0xcf19('0x33')]=_[_0xcf19('0x34')](_0x470618[_0xcf19('0x2e')],_0x470618[_0xcf19('0x31')]);_0x35b896[_0xcf19('0x35')]=_[_0xcf19('0x34')](_0x470618[_0xcf19('0x2e')],qs[_0xcf19('0x36')](_0x33e83d[_0xcf19('0x31')][_0xcf19('0x36')]));_0x35b896[_0xcf19('0x35')]=_0x35b896[_0xcf19('0x35')]['length']?_0x35b896[_0xcf19('0x35')]:_0x470618[_0xcf19('0x2e')];if(!_0x33e83d[_0xcf19('0x31')][_0xcf19('0x37')](_0xcf19('0x38'))){_0x35b896[_0xcf19('0x1d')]=qs['limit'](_0x33e83d[_0xcf19('0x31')][_0xcf19('0x1d')]);_0x35b896[_0xcf19('0x1b')]=qs[_0xcf19('0x1b')](_0x33e83d[_0xcf19('0x31')]['offset']);}_0x35b896['order']=qs[_0xcf19('0x39')](_0x33e83d[_0xcf19('0x31')][_0xcf19('0x39')]);_0x35b896[_0xcf19('0x3a')]=qs['filters'](_[_0xcf19('0x3b')](_0x33e83d[_0xcf19('0x31')],_0x470618[_0xcf19('0x33')]),_0x154d0e);if(_0x33e83d[_0xcf19('0x31')]['filter']){_0x35b896[_0xcf19('0x3a')]=_[_0xcf19('0x3c')](_0x35b896[_0xcf19('0x3a')],{'$or':_['map'](_0x154d0e,function(_0x4e77ef){if(_0x4e77ef[_0xcf19('0x3d')]!==_0xcf19('0x3e')){var _0x5b17d0={};_0x5b17d0[_0x4e77ef['name']]={'$like':'%'+_0x33e83d[_0xcf19('0x31')]['filter']+'%'};return _0x5b17d0;}})});}_0x35b896=_['merge']({},_0x35b896,_0x33e83d['options']);var _0x1caf6e={'where':_0x35b896['where']};return db[_0xcf19('0x2b')]['count'](_0x1caf6e)[_0xcf19('0x26')](function(_0x4aa301){_0x4704b1[_0xcf19('0x1e')]=_0x4aa301;if(_0x33e83d[_0xcf19('0x31')][_0xcf19('0x3f')]){_0x35b896[_0xcf19('0x40')]=[{'all':!![]}];}return db[_0xcf19('0x2b')][_0xcf19('0x41')](_0x35b896);})['then'](function(_0x416f28){_0x4704b1[_0xcf19('0x42')]=_0x416f28;return _0x4704b1;})[_0xcf19('0x26')](respondWithFilteredResult(_0x10722e,_0x35b896))[_0xcf19('0x43')](handleError(_0x10722e,null));};exports[_0xcf19('0x44')]=function(_0x5d5344,_0x4a9ab1){var _0x124a77={'raw':!![],'where':{'id':_0x5d5344[_0xcf19('0x45')]['id']}},_0x136818={};_0x136818[_0xcf19('0x2e')]=_[_0xcf19('0x32')](db[_0xcf19('0x2b')][_0xcf19('0x2c')]);_0x136818[_0xcf19('0x31')]=_['keys'](_0x5d5344[_0xcf19('0x31')]);_0x136818[_0xcf19('0x33')]=_[_0xcf19('0x34')](_0x136818[_0xcf19('0x2e')],_0x136818['query']);_0x124a77[_0xcf19('0x35')]=_[_0xcf19('0x34')](_0x136818[_0xcf19('0x2e')],qs['fields'](_0x5d5344[_0xcf19('0x31')][_0xcf19('0x36')]));_0x124a77[_0xcf19('0x35')]=_0x124a77[_0xcf19('0x35')]['length']?_0x124a77[_0xcf19('0x35')]:_0x136818[_0xcf19('0x2e')];if(_0x5d5344[_0xcf19('0x31')][_0xcf19('0x3f')]){_0x124a77[_0xcf19('0x40')]=[{'all':!![]}];}_0x124a77=_['merge']({},_0x124a77,_0x5d5344[_0xcf19('0x46')]);return db['CmCustomField'][_0xcf19('0x47')](_0x124a77)[_0xcf19('0x26')](handleEntityNotFound(_0x4a9ab1,null))[_0xcf19('0x26')](respondWithResult(_0x4a9ab1,null))['catch'](handleError(_0x4a9ab1,null));};exports[_0xcf19('0x25')]=function(_0xbd341c,_0x1ef33c){if(_0xbd341c[_0xcf19('0x48')]['id']){delete _0xbd341c['body']['id'];}return db[_0xcf19('0x2b')][_0xcf19('0x47')]({'where':{'id':_0xbd341c[_0xcf19('0x45')]['id']}})[_0xcf19('0x26')](handleEntityNotFound(_0x1ef33c,null))['then'](saveUpdates(_0xbd341c[_0xcf19('0x48')],null))['then'](respondWithResult(_0x1ef33c,null))['catch'](handleError(_0x1ef33c,null));};exports[_0xcf19('0x49')]=function(_0x51f58e,_0x5aab42){return db[_0xcf19('0x2b')][_0xcf19('0x47')]({'where':{'id':_0x51f58e[_0xcf19('0x45')]['id']}})[_0xcf19('0x26')](handleEntityNotFound(_0x5aab42,null))['then'](removeEntity(_0x5aab42,null))[_0xcf19('0x43')](handleError(_0x5aab42,null));};exports[_0xcf19('0x4a')]=function(_0x1b1f0a,_0x310627){var _0x2207a5;return db[_0xcf19('0x4b')][_0xcf19('0x4c')](function(_0x52b8e6){return db['CmCustomField'][_0xcf19('0x4a')](_0x1b1f0a[_0xcf19('0x48')],{'transaction':_0x52b8e6})[_0xcf19('0x26')](function(_0x329564){_0x2207a5=_0x329564;var _0x2a50d0={'type':db[_0xcf19('0x4d')]['TEXT'],'transaction':_0x52b8e6};switch(_0x1b1f0a[_0xcf19('0x48')][_0xcf19('0x3d')]){case'text':_0x2a50d0['type']=db[_0xcf19('0x4d')][_0xcf19('0x4e')];break;case _0xcf19('0x4f'):_0x2a50d0[_0xcf19('0x3d')]=db[_0xcf19('0x4d')][_0xcf19('0x50')];break;case'switch':_0x2a50d0['type']=db[_0xcf19('0x4d')][_0xcf19('0x51')];_0x2a50d0[_0xcf19('0x52')]=![];break;default:}return db[_0xcf19('0x4b')][_0xcf19('0x53')][_0xcf19('0x54')](_0xcf19('0x55'),util[_0xcf19('0x56')](_0xcf19('0x57'),_0x2207a5['id']),_0x2a50d0);})[_0xcf19('0x26')](function(){return _0x2207a5;});})[_0xcf19('0x26')](respondWithResult(_0x310627,0xc9))[_0xcf19('0x43')](handleError(_0x310627,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 6c211b0..18688d2 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 _0xa92a=['api','moment','bluebird','path','define','CmCustomField','cm_custom_fields','lodash'];(function(_0x5e850b,_0x562dc6){var _0x20291a=function(_0x4df258){while(--_0x4df258){_0x5e850b['push'](_0x5e850b['shift']());}};_0x20291a(++_0x562dc6);}(_0xa92a,0x1c7));var _0xaa92=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0xa92a[_0x1b3564];return _0x504069;};'use strict';var _=require(_0xaa92('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa92('0x1'));var moment=require(_0xaa92('0x2'));var BPromise=require(_0xaa92('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa92('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x18bbf3,_0x321a7e){return _0x18bbf3[_0xaa92('0x5')](_0xaa92('0x6'),attributes,{'tableName':_0xaa92('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x954c=['cm_custom_fields','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./cmCustomField.attributes','CmCustomField'];(function(_0x119280,_0x439c3e){var _0x481797=function(_0x4265cb){while(--_0x4265cb){_0x119280['push'](_0x119280['shift']());}};_0x481797(++_0x439c3e);}(_0x954c,0x155));var _0xc954=function(_0x1cfd37,_0x207cb3){_0x1cfd37=_0x1cfd37-0x0;var _0x7e436c=_0x954c[_0x1cfd37];return _0x7e436c;};'use strict';var _=require('lodash');var util=require(_0xc954('0x0'));var logger=require(_0xc954('0x1'))(_0xc954('0x2'));var moment=require(_0xc954('0x3'));var BPromise=require('bluebird');var rp=require(_0xc954('0x4'));var fs=require('fs');var path=require(_0xc954('0x5'));var rimraf=require('rimraf');var config=require(_0xc954('0x6'));var attributes=require(_0xc954('0x7'));module['exports']=function(_0x3596b1,_0x2e0410){return _0x3596b1['define'](_0xc954('0x8'),attributes,{'tableName':_0xc954('0x9'),'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 4eee63a..b2fd56d 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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x11848b,_0x20c997){var _0x30b95b=function(_0x639f91){while(--_0x639f91){_0x11848b['push'](_0x11848b['shift']());}};_0x30b95b(++_0x20c997);}(_0x55ca,0x126));var _0xa55c=function(_0x4f6f04,_0x59c6ba){_0x4f6f04=_0x4f6f04-0x0;var _0x606b2c=_0x55ca[_0x4f6f04];return _0x606b2c;};'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')]('CmCustomField,\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')]('CmCustomField,\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);});});} \ No newline at end of file +var _0xadb8=['CmCustomField,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x42d4c3,_0x58eaef){var _0x2e02d1=function(_0x1e0e22){while(--_0x1e0e22){_0x42d4c3['push'](_0x42d4c3['shift']());}};_0x2e02d1(++_0x58eaef);}(_0xadb8,0x1d0));var _0x8adb=function(_0x5400b,_0x55943a){_0x5400b=_0x5400b-0x0;var _0x36a39b=_0xadb8[_0x5400b];return _0x36a39b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8adb('0x0'));var BPromise=require('bluebird');var rs=require(_0x8adb('0x1'));var fs=require('fs');var Redis=require(_0x8adb('0x2'));var db=require(_0x8adb('0x3'))['db'];var utils=require(_0x8adb('0x4'));var logger=require(_0x8adb('0x5'))(_0x8adb('0x6'));var config=require(_0x8adb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8adb('0x8')][_0x8adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9f435,_0x2bebfe,_0x271bed){return new BPromise(function(_0x16b932,_0x27d994){return client['request'](_0x9f435,_0x271bed)['then'](function(_0x58ad1a){logger[_0x8adb('0xa')]('CmCustomField,\x20%s,\x20%s',_0x2bebfe,'request\x20sent');logger['debug'](_0x8adb('0xb'),_0x2bebfe,_0x8adb('0xc'),JSON[_0x8adb('0xd')](_0x58ad1a));if(_0x58ad1a[_0x8adb('0xe')]){if(_0x58ad1a[_0x8adb('0xe')][_0x8adb('0xf')]===0x1f4){logger[_0x8adb('0xe')](_0x8adb('0x10'),_0x2bebfe,_0x58ad1a[_0x8adb('0xe')][_0x8adb('0x11')]);return _0x27d994(_0x58ad1a['error']['message']);}logger['error'](_0x8adb('0x10'),_0x2bebfe,_0x58ad1a['error'][_0x8adb('0x11')]);return _0x16b932(_0x58ad1a[_0x8adb('0xe')][_0x8adb('0x11')]);}else{logger['info'](_0x8adb('0x10'),_0x2bebfe,_0x8adb('0xc'));_0x16b932(_0x58ad1a[_0x8adb('0x12')][_0x8adb('0x11')]);}})[_0x8adb('0x13')](function(_0x13659c){logger['error'](_0x8adb('0x10'),_0x2bebfe,_0x13659c);_0x27d994(_0x13659c);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index dbd181c..9ef1b0a 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 _0x8808=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x43eb95,_0x55c45e){var _0x8b3994=function(_0x1cd807){while(--_0x1cd807){_0x43eb95['push'](_0x43eb95['shift']());}};_0x8b3994(++_0x55c45e);}(_0x8808,0x1c7));var _0x8880=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8808[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x8880('0x0'));var path=require(_0x8880('0x1'));var timeout=require(_0x8880('0x2'));var express=require(_0x8880('0x3'));var router=express[_0x8880('0x4')]();var fs_extra=require(_0x8880('0x5'));var auth=require(_0x8880('0x6'));var interaction=require(_0x8880('0x7'));var config=require(_0x8880('0x8'));var controller=require(_0x8880('0x9'));router[_0x8880('0xa')]('/',auth[_0x8880('0xb')](),controller[_0x8880('0xc')]);router[_0x8880('0xa')](_0x8880('0xd'),auth[_0x8880('0xb')](),controller[_0x8880('0xe')]);router[_0x8880('0xf')]('/',auth[_0x8880('0xb')](),controller[_0x8880('0x10')]);router['put']('/:id',auth[_0x8880('0xb')](),controller[_0x8880('0x11')]);router[_0x8880('0x12')](_0x8880('0xd'),auth[_0x8880('0xb')](),controller[_0x8880('0x13')]);module['exports']=router; \ No newline at end of file +var _0xca60=['Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x517648,_0x3e4708){var _0xb5372a=function(_0x4b0628){while(--_0x4b0628){_0x517648['push'](_0x517648['shift']());}};_0xb5372a(++_0x3e4708);}(_0xca60,0x1c4));var _0x0ca6=function(_0x32c98a,_0x5e6eb0){_0x32c98a=_0x32c98a-0x0;var _0x1796d3=_0xca60[_0x32c98a];return _0x1796d3;};'use strict';var multer=require('multer');var util=require(_0x0ca6('0x0'));var path=require(_0x0ca6('0x1'));var timeout=require(_0x0ca6('0x2'));var express=require(_0x0ca6('0x3'));var router=express[_0x0ca6('0x4')]();var fs_extra=require(_0x0ca6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ca6('0x6'));var config=require(_0x0ca6('0x7'));var controller=require(_0x0ca6('0x8'));router[_0x0ca6('0x9')]('/',auth[_0x0ca6('0xa')](),controller['index']);router[_0x0ca6('0x9')](_0x0ca6('0xb'),auth[_0x0ca6('0xa')](),controller[_0x0ca6('0xc')]);router[_0x0ca6('0xd')]('/',auth[_0x0ca6('0xa')](),controller[_0x0ca6('0xe')]);router['put'](_0x0ca6('0xb'),auth[_0x0ca6('0xa')](),controller[_0x0ca6('0xf')]);router[_0x0ca6('0x10')]('/:id',auth[_0x0ca6('0xa')](),controller[_0x0ca6('0x11')]);module[_0x0ca6('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index fc6ff43..d98131f 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 _0xa571=['BOOLEAN','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','DATE','format','INTEGER'];(function(_0x40c0dd,_0x171ea5){var _0x2d4984=function(_0x28088a){while(--_0x28088a){_0x40c0dd['push'](_0x40c0dd['shift']());}};_0x2d4984(++_0x171ea5);}(_0xa571,0x107));var _0x1a57=function(_0x3be367,_0x4f89a9){_0x3be367=_0x3be367-0x0;var _0x490567=_0xa571[_0x3be367];return _0x490567;};'use strict';var moment=require(_0x1a57('0x0'));var Sequelize=require(_0x1a57('0x1'));module[_0x1a57('0x2')]={'phone':{'type':Sequelize[_0x1a57('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x1a57('0x4')],'defaultValue':moment()[_0x1a57('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1a57('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x1a57('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1a57('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1a57('0x4')]},'priority':{'type':Sequelize[_0x1a57('0x6')](0x2)[_0x1a57('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x1a57('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x1a57('0x9')},'ListId':{'type':Sequelize[_0x1a57('0x6')],'unique':_0x1a57('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x1a57('0x6')],'unique':_0x1a57('0x9')},'CampaignId':{'type':Sequelize[_0x1a57('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x1a57('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1a57('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1a57('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1a57('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1a57('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0}}; \ No newline at end of file +var _0xb43b=['UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4a4d53,_0x37b9bb){_0x4a4d53=_0x4a4d53-0x0;var _0x4e358e=_0xb43b[_0x4a4d53];return _0x4e358e;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'phone':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xbb43('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xbb43('0x4')],'defaultValue':moment()['format'](_0xbb43('0x5'))},'countbusyretry':{'type':Sequelize[_0xbb43('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbb43('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbb43('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbb43('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xbb43('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xbb43('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xbb43('0x6')],'unique':_0xbb43('0x8')},'ListId':{'type':Sequelize[_0xbb43('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xbb43('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xbb43('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xbb43('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xbb43('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbb43('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbb43('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbb43('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbb43('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 4a5d38c..bc8c01e 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 _0xb39c=['$contains','$contained','$any','attributes','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','describe','getVoiceQueues','preview','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','dialOrderByScheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','CmContact','Contact','Company','CmList','List','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','concat','$gt','$lt','$lte','$between','$notBetween','$notIn','$like','$iLike','$notILike'];(function(_0x45a60c,_0x38caed){var _0x3e17dc=function(_0xdacd4f){while(--_0xdacd4f){_0x45a60c['push'](_0x45a60c['shift']());}};_0x3e17dc(++_0x38caed);}(_0xb39c,0x1f1));var _0xcb39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb39c[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xcb39('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb39('0x1'));var jsonpatch=require(_0xcb39('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcb39('0x3'));var Mustache=require(_0xcb39('0x4'));var util=require(_0xcb39('0x5'));var path=require(_0xcb39('0x6'));var sox=require(_0xcb39('0x7'));var csv=require(_0xcb39('0x8'));var ejs=require(_0xcb39('0x9'));var fs=require('fs');var fs_extra=require(_0xcb39('0xa'));var _=require(_0xcb39('0xb'));var squel=require(_0xcb39('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcb39('0x8'));var querystring=require('querystring');var Papa=require(_0xcb39('0xd'));var Redis=require(_0xcb39('0xe'));var authService=require(_0xcb39('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xcb39('0x10'));var hardwareService=require(_0xcb39('0x11'));var logger=require(_0xcb39('0x12'))(_0xcb39('0x13'));var utils=require(_0xcb39('0x14'));var config=require(_0xcb39('0x15'));var licenseUtil=require(_0xcb39('0x16'));var db=require(_0xcb39('0x17'))['db'];function respondWithStatusCode(_0x3aeaa1,_0x4a5899){_0x4a5899=_0x4a5899||0xcc;return function(_0xb2435a){if(_0xb2435a){return _0x3aeaa1[_0xcb39('0x18')](_0x4a5899);}return _0x3aeaa1[_0xcb39('0x19')](_0x4a5899)[_0xcb39('0x1a')]();};}function respondWithResult(_0x4a1cbc,_0x2a68ff){_0x2a68ff=_0x2a68ff||0xc8;return function(_0x84a8f0){if(_0x84a8f0){return _0x4a1cbc[_0xcb39('0x19')](_0x2a68ff)[_0xcb39('0x1b')](_0x84a8f0);}};}function respondWithFilteredResult(_0x44b0df,_0x23f55f){return function(_0x2b9de7){if(_0x2b9de7){var _0x323bbc=typeof _0x23f55f['offset']==='undefined'&&typeof _0x23f55f[_0xcb39('0x1c')]===_0xcb39('0x1d');var _0x5286ad=_0x2b9de7[_0xcb39('0x1e')];var _0x484528=_0x323bbc?0x0:_0x23f55f['offset'];var _0x310273=_0x323bbc?_0x2b9de7[_0xcb39('0x1e')]:_0x23f55f[_0xcb39('0x1f')]+_0x23f55f['limit'];var _0x5b97f9;if(_0x310273>=_0x5286ad){_0x310273=_0x5286ad;_0x5b97f9=0xc8;}else{_0x5b97f9=0xce;}_0x44b0df[_0xcb39('0x19')](_0x5b97f9);return _0x44b0df['set'](_0xcb39('0x20'),_0x484528+'-'+_0x310273+'/'+_0x5286ad)['json'](_0x2b9de7);}return null;};}function patchUpdates(_0x1a0d72){return function(_0x46a559){try{jsonpatch[_0xcb39('0x21')](_0x46a559,_0x1a0d72,!![]);}catch(_0x58e10e){return BPromise['reject'](_0x58e10e);}return _0x46a559[_0xcb39('0x22')]();};}function saveUpdates(_0x10e5a0,_0x2e3e74){return function(_0xe9e9d3){if(_0xe9e9d3){return _0xe9e9d3[_0xcb39('0x23')](_0x10e5a0)['then'](function(_0x36b967){return _0x36b967;});}return null;};}function removeEntity(_0x190c90,_0x27d508){return function(_0x14d500){if(_0x14d500){return _0x14d500[_0xcb39('0x24')]()[_0xcb39('0x25')](function(){_0x190c90[_0xcb39('0x19')](0xcc)[_0xcb39('0x1a')]();});}};}function handleEntityNotFound(_0x4bd6aa,_0x2c94f2){return function(_0x4834df){if(!_0x4834df){_0x4bd6aa[_0xcb39('0x18')](0x194);}return _0x4834df;};}function handleError(_0x4949c5,_0xd3e724){_0xd3e724=_0xd3e724||0x1f4;return function(_0x15d413){logger[_0xcb39('0x26')](_0x15d413[_0xcb39('0x27')]);if(_0x15d413[_0xcb39('0x28')]){delete _0x15d413[_0xcb39('0x28')];}_0x4949c5[_0xcb39('0x19')](_0xd3e724)[_0xcb39('0x29')](_0x15d413);};}exports[_0xcb39('0x2a')]=function(_0x2b13a9,_0x1ba591){var _0x429e80={},_0x20c729={},_0x150de4={'count':0x0,'rows':[]};var _0x2c9411=_['map'](db[_0xcb39('0x2b')][_0xcb39('0x2c')],function(_0x2b78c7){return{'name':_0x2b78c7[_0xcb39('0x2d')],'type':_0x2b78c7[_0xcb39('0x2e')][_0xcb39('0x2f')]};});_0x20c729[_0xcb39('0x30')]=_[_0xcb39('0x31')](_0x2c9411,_0xcb39('0x28'));_0x20c729[_0xcb39('0x32')]=_['keys'](_0x2b13a9[_0xcb39('0x32')]);_0x20c729[_0xcb39('0x33')]=_[_0xcb39('0x34')](_0x20c729[_0xcb39('0x30')],_0x20c729[_0xcb39('0x32')]);_0x20c729[_0xcb39('0x33')]=_[_0xcb39('0x35')](_0x20c729[_0xcb39('0x33')],['$and','$or',_0xcb39('0x36'),'$gte',_0xcb39('0x37'),_0xcb39('0x38'),'$ne','$eq','$not',_0xcb39('0x39'),_0xcb39('0x3a'),'$in',_0xcb39('0x3b'),_0xcb39('0x3c'),'$notLike',_0xcb39('0x3d'),_0xcb39('0x3e'),_0xcb39('0x3c'),'$overlap',_0xcb39('0x3f'),_0xcb39('0x40'),_0xcb39('0x41')]);_0x429e80[_0xcb39('0x42')]=_[_0xcb39('0x34')](_0x20c729[_0xcb39('0x30')],qs['fields'](_0x2b13a9[_0xcb39('0x32')]['fields']));_0x429e80[_0xcb39('0x42')]=_0x429e80[_0xcb39('0x42')][_0xcb39('0x43')]?_0x429e80[_0xcb39('0x42')]:_0x20c729[_0xcb39('0x30')];if(!_0x2b13a9['query']['hasOwnProperty'](_0xcb39('0x44'))){_0x429e80[_0xcb39('0x1c')]=qs[_0xcb39('0x1c')](_0x2b13a9[_0xcb39('0x32')][_0xcb39('0x1c')]);_0x429e80[_0xcb39('0x1f')]=qs[_0xcb39('0x1f')](_0x2b13a9[_0xcb39('0x32')]['offset']);}_0x429e80['order']=qs[_0xcb39('0x45')](_0x2b13a9[_0xcb39('0x32')][_0xcb39('0x45')]);_0x429e80[_0xcb39('0x46')]=qs[_0xcb39('0x33')](_[_0xcb39('0x47')](_0x2b13a9[_0xcb39('0x32')],_0x20c729[_0xcb39('0x33')]),_0x2c9411);if(_0x2b13a9['query'][_0xcb39('0x48')]){_0x429e80[_0xcb39('0x46')]=_[_0xcb39('0x49')](_0x429e80[_0xcb39('0x46')],{'$or':_[_0xcb39('0x31')](_0x2c9411,function(_0x516518){if(_0x516518[_0xcb39('0x2e')]!=='VIRTUAL'){var _0x3410cd={};_0x3410cd[_0x516518[_0xcb39('0x28')]]={'$like':'%'+_0x2b13a9[_0xcb39('0x32')][_0xcb39('0x48')]+'%'};return _0x3410cd;}})});}_0x429e80=_['merge']({},_0x429e80,_0x2b13a9[_0xcb39('0x4a')]);var _0x356d57={'where':_0x429e80[_0xcb39('0x46')]};return db['CmHopper'][_0xcb39('0x1e')](_0x356d57)[_0xcb39('0x25')](function(_0x265cbd){_0x150de4[_0xcb39('0x1e')]=_0x265cbd;if(_0x2b13a9[_0xcb39('0x32')][_0xcb39('0x4b')]){_0x429e80[_0xcb39('0x4c')]=[{'all':!![]}];}return db[_0xcb39('0x2b')][_0xcb39('0x4d')](_0x429e80);})[_0xcb39('0x25')](function(_0x44d311){_0x150de4[_0xcb39('0x4e')]=_0x44d311;return _0x150de4;})[_0xcb39('0x25')](respondWithFilteredResult(_0x1ba591,_0x429e80))[_0xcb39('0x4f')](handleError(_0x1ba591,null));};exports[_0xcb39('0x50')]=function(_0x3f8c4c,_0x33ddd9){var _0x118c2a={'raw':!![],'where':{'id':_0x3f8c4c[_0xcb39('0x51')]['id']}},_0x50bab0={};_0x50bab0[_0xcb39('0x30')]=_[_0xcb39('0x52')](db[_0xcb39('0x2b')]['rawAttributes']);_0x50bab0['query']=_[_0xcb39('0x52')](_0x3f8c4c[_0xcb39('0x32')]);_0x50bab0[_0xcb39('0x33')]=_[_0xcb39('0x34')](_0x50bab0[_0xcb39('0x30')],_0x50bab0[_0xcb39('0x32')]);_0x118c2a[_0xcb39('0x42')]=_['intersection'](_0x50bab0[_0xcb39('0x30')],qs[_0xcb39('0x53')](_0x3f8c4c[_0xcb39('0x32')][_0xcb39('0x53')]));_0x118c2a[_0xcb39('0x42')]=_0x118c2a['attributes'][_0xcb39('0x43')]?_0x118c2a[_0xcb39('0x42')]:_0x50bab0[_0xcb39('0x30')];if(_0x3f8c4c[_0xcb39('0x32')][_0xcb39('0x4b')]){_0x118c2a[_0xcb39('0x4c')]=[{'all':!![]}];}_0x118c2a=_['merge']({},_0x118c2a,_0x3f8c4c['options']);return db[_0xcb39('0x2b')][_0xcb39('0x54')](_0x118c2a)[_0xcb39('0x25')](handleEntityNotFound(_0x33ddd9,null))[_0xcb39('0x25')](respondWithResult(_0x33ddd9,null))[_0xcb39('0x4f')](handleError(_0x33ddd9,null));};exports[_0xcb39('0x55')]=function(_0x45ede7,_0x46ecc1){return db['CmHopper']['create'](_0x45ede7[_0xcb39('0x56')],{})[_0xcb39('0x25')](respondWithResult(_0x46ecc1,0xc9))['catch'](handleError(_0x46ecc1,null));};exports[_0xcb39('0x23')]=function(_0x4b75d9,_0x599129){if(_0x4b75d9[_0xcb39('0x56')]['id']){delete _0x4b75d9[_0xcb39('0x56')]['id'];}return db[_0xcb39('0x2b')][_0xcb39('0x54')]({'where':{'id':_0x4b75d9[_0xcb39('0x51')]['id']}})[_0xcb39('0x25')](handleEntityNotFound(_0x599129,null))['then'](saveUpdates(_0x4b75d9[_0xcb39('0x56')],null))['then'](respondWithResult(_0x599129,null))[_0xcb39('0x4f')](handleError(_0x599129,null));};exports['describe']=function(_0x43495b,_0xb6fdf7){return db[_0xcb39('0x2b')]['describe']()[_0xcb39('0x25')](respondWithResult(_0xb6fdf7,null))[_0xcb39('0x4f')](handleError(_0xb6fdf7,null));};exports[_0xcb39('0x24')]=function(_0x2b9ea9,_0x5277a1){var _0x5e549b;var _0x44807c=_0x2b9ea9[_0xcb39('0x51')]['id'];return db[_0xcb39('0x2b')][_0xcb39('0x54')]({'where':{'id':_0x2b9ea9['params']['id']}})['then'](handleEntityNotFound(_0x5277a1,null))[_0xcb39('0x25')](function(_0x4c42fe){if(_0x4c42fe){return _0x4c42fe[_0xcb39('0x24')]()['then'](function(_0x526e95){return _0x526e95;});}})[_0xcb39('0x25')](function(_0x4bbd40){_0x5e549b=_0x4bbd40;if(_0x4bbd40){if(_0x4bbd40['VoiceQueueId']||_0x4bbd40['CampaignId']){return db[_0x4bbd40[_0xcb39('0x57')]?_0xcb39('0x58'):_0xcb39('0x59')][_0xcb39('0x54')]({'where':{'id':_0x4bbd40['VoiceQueueId']?_0x4bbd40[_0xcb39('0x57')]:_0x4bbd40['CampaignId']},'attributes':['id',_0xcb39('0x28')],'raw':!![]});}}})['then'](function(_0x1aa3e8){var _0x66dfd1={};if(_0x1aa3e8){_[_0xcb39('0x49')](_0x66dfd1,_[_0xcb39('0x5a')](_0x5e549b[_0xcb39('0x5b')],[_0xcb39('0x5c'),_0xcb39('0x5d'),'id']));_0x66dfd1[_0xcb39('0x5e')]=0x15;_0x66dfd1[_0xcb39('0x5f')]=_0xcb39('0x60');_0x66dfd1[_0xcb39('0x61')]=_0x1aa3e8['name'];_0x66dfd1['membername']=_0x2b9ea9[_0xcb39('0x62')][_0xcb39('0x28')];_0x66dfd1['UserId']=_0x2b9ea9['user']['id'];_0x66dfd1[_0xcb39('0x60')]=!![];_0x66dfd1[_0xcb39('0x63')]=moment()[_0xcb39('0x64')](_0xcb39('0x65'));_0x66dfd1['calleridnum']=_0x5e549b[_0xcb39('0x66')];_0x66dfd1[_0xcb39('0x67')]=_0x5e549b[_0xcb39('0x57')]?_0xcb39('0x68'):_0xcb39('0x69');return db['CmContact'][_0xcb39('0x54')]({'where':{'id':_0x66dfd1[_0xcb39('0x6a')]},'attributes':[_0xcb39('0x6b'),_0xcb39('0x6c')]})['then'](function(_0x491dbe){if(!_[_0xcb39('0x6d')](_0x5277a1)&&!_[_0xcb39('0x6d')](_0x491dbe[_0xcb39('0x6b')])){_0x66dfd1[_0xcb39('0x6e')]=_0x491dbe[_0xcb39('0x6b')];if(!_[_0xcb39('0x6d')](_0x491dbe[_0xcb39('0x6c')])){_0x66dfd1[_0xcb39('0x6e')]+='\x20'+_0x491dbe[_0xcb39('0x6c')];}}})[_0xcb39('0x6f')](function(){return db[_0xcb39('0x70')]['create'](_0x66dfd1);});}})['then'](function(_0x711992){return db['CmHopperAdditionalPhone'][_0xcb39('0x24')]({'where':{'CmHopperId':_0x44807c}});})[_0xcb39('0x25')](function(){return _0x5277a1[_0xcb39('0x19')](0xcc)['end']();})[_0xcb39('0x4f')](handleError(_0x5277a1,null));};exports['getPreview']=function(_0xb55477,_0x404e8e,_0x1f0160){var _0x4c9786=[];return db['CmContact'][_0xcb39('0x71')]()[_0xcb39('0x25')](function(_0x2da789){_0x4c9786=_[_0xcb39('0x52')](_0x2da789);return _0xb55477[_0xcb39('0x62')][_0xcb39('0x72')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xcb39('0x73')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0xcb39('0x25')](function(_0x4edc23){if(_0x4edc23&&_0x4edc23['length']){return db[_0xcb39('0x74')][_0xcb39('0x75')](function(_0x4b31e6){var _0x2dc5a1={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcb39('0x64')](_0xcb39('0x65'))},'VoiceQueueId':{'$in':_['map'](_0x4edc23,'id')},'$or':[{'UserId':null},{'UserId':_0xb55477[_0xcb39('0x62')]['id']}]};var _0x2e8a42=[];if(_0xb55477[_0xcb39('0x56')][_0xcb39('0x76')]&&_0xb55477[_0xcb39('0x56')][_0xcb39('0x76')]===_0xcb39('0x77')){if(!_[_0xcb39('0x78')](_0xb55477[_0xcb39('0x56')]['hopperIds'])){_0x2dc5a1['id']={'$in':_0xb55477[_0xcb39('0x56')][_0xcb39('0x79')]};}_0x2e8a42=[[_0xcb39('0x7a'),_0xcb39('0x7b')],['scheduledAt',_0x4edc23[0x0]['dialOrderByScheduledAt']===_0xcb39('0x7b')?_0xcb39('0x7c'):_0xcb39('0x7b')],db['sequelize'][_0xcb39('0x7d')](_0xcb39('0x7e')),['id','DESC']];}else{if(!_[_0xcb39('0x78')](_0xb55477[_0xcb39('0x56')][_0xcb39('0x79')])){_0x2dc5a1['id']={'$notIn':_0xb55477[_0xcb39('0x56')]['hopperIds']};}_0x2e8a42=[['priority',_0xcb39('0x7c')],[_0xcb39('0x7f'),_0x4edc23[0x0][_0xcb39('0x80')]],db[_0xcb39('0x74')]['literal'](_0xcb39('0x81')),['id',_0xcb39('0x7b')]];}return db['CmHopper']['findOne']({'attributes':['id',_0xcb39('0x82'),_0xcb39('0x66')],'where':_0x2dc5a1,'order':_0x2e8a42,'transaction':_0x4b31e6,'lock':_0x4b31e6[_0xcb39('0x83')]['UPDATE'],'include':[{'model':db[_0xcb39('0x84')],'as':_0xcb39('0x85'),'attributes':_0x4c9786,'include':[{'model':db['CmCompany'],'as':_0xcb39('0x86'),'attributes':['id','name']}]},{'model':db[_0xcb39('0x87')],'as':_0xcb39('0x88'),'attributes':['id','name']},{'model':db[_0xcb39('0x58')],'as':'Queue','attributes':['id',_0xcb39('0x28'),'dialActive']}]})[_0xcb39('0x25')](function(_0x56aeb7){if(_0x56aeb7){return _0x56aeb7['update']({'UserId':_0xb55477[_0xcb39('0x62')]['id']},{'transaction':_0x4b31e6});}});});}})[_0xcb39('0x25')](handleEntityNotFound(_0x404e8e,null))[_0xcb39('0x25')](respondWithResult(_0x404e8e,null))['catch'](handleError(_0x404e8e,null));};exports['getOpenContacts']=function(_0x17c8af,_0x826339,_0x583f6c){return _0x17c8af['user'][_0xcb39('0x72')]({'where':{'type':_0xcb39('0x89'),'dialActive':!![],'dialMethod':_0xcb39('0x73')},'attributes':['id'],'raw':!![]})[_0xcb39('0x25')](function(_0x2d1450){if(_0x2d1450&&_0x2d1450[_0xcb39('0x43')]){return db[_0xcb39('0x2b')][_0xcb39('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcb39('0x64')](_0xcb39('0x65'))},'VoiceQueueId':{'$in':_[_0xcb39('0x31')](_0x2d1450,'id')},'$or':[{'UserId':null},{'UserId':_0x17c8af['user']['id']}]}});}return 0x0;})['then'](function(_0x49cc0b){if(!_[_0xcb39('0x6d')](_0x49cc0b)&&_[_0xcb39('0x8a')](_0x49cc0b)){return _0x826339['status'](0xc8)[_0xcb39('0x1b')]({'contacts':_0x49cc0b});}else{logger[_0xcb39('0x26')](_0xcb39('0x8b'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x826339[_0xcb39('0x18')](0x194);}})[_0xcb39('0x4f')](handleError(_0x826339,null));}; \ No newline at end of file +var _0x4e51=['statedesc','deleted','campaign','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','getVoiceQueues','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','preview','isNumber','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','send','CmHopper','rawAttributes','fieldName','key','query','keys','filters','model','concat','$and','$or','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$like','$notLike','$notILike','$contained','$any','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','map','type','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state'];(function(_0x37545c,_0x9906f5){var _0x4cd312=function(_0x21536b){while(--_0x21536b){_0x37545c['push'](_0x37545c['shift']());}};_0x4cd312(++_0x9906f5);}(_0x4e51,0xc7));var _0x14e5=function(_0xfd9b19,_0x21d75f){_0xfd9b19=_0xfd9b19-0x0;var _0x514918=_0x4e51[_0xfd9b19];return _0x514918;};'use strict';var emlformat=require(_0x14e5('0x0'));var rimraf=require(_0x14e5('0x1'));var zipdir=require(_0x14e5('0x2'));var jsonpatch=require(_0x14e5('0x3'));var rp=require(_0x14e5('0x4'));var moment=require(_0x14e5('0x5'));var BPromise=require(_0x14e5('0x6'));var Mustache=require(_0x14e5('0x7'));var util=require(_0x14e5('0x8'));var path=require('path');var sox=require(_0x14e5('0x9'));var csv=require(_0x14e5('0xa'));var ejs=require(_0x14e5('0xb'));var fs=require('fs');var fs_extra=require(_0x14e5('0xc'));var _=require(_0x14e5('0xd'));var squel=require('squel');var crypto=require(_0x14e5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x14e5('0xa'));var querystring=require(_0x14e5('0xf'));var Papa=require(_0x14e5('0x10'));var Redis=require(_0x14e5('0x11'));var authService=require(_0x14e5('0x12'));var qs=require(_0x14e5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14e5('0x14'));var logger=require(_0x14e5('0x15'))(_0x14e5('0x16'));var utils=require('../../config/utils');var config=require(_0x14e5('0x17'));var licenseUtil=require(_0x14e5('0x18'));var db=require(_0x14e5('0x19'))['db'];function respondWithStatusCode(_0xe12d8c,_0x2760a3){_0x2760a3=_0x2760a3||0xcc;return function(_0x353b73){if(_0x353b73){return _0xe12d8c['sendStatus'](_0x2760a3);}return _0xe12d8c[_0x14e5('0x1a')](_0x2760a3)[_0x14e5('0x1b')]();};}function respondWithResult(_0x432a6a,_0x22ebc1){_0x22ebc1=_0x22ebc1||0xc8;return function(_0x363117){if(_0x363117){return _0x432a6a[_0x14e5('0x1a')](_0x22ebc1)[_0x14e5('0x1c')](_0x363117);}};}function respondWithFilteredResult(_0x4c02bf,_0xbae96e){return function(_0x5182c9){if(_0x5182c9){var _0x2882d9=typeof _0xbae96e['offset']===_0x14e5('0x1d')&&typeof _0xbae96e[_0x14e5('0x1e')]===_0x14e5('0x1d');var _0x439b11=_0x5182c9[_0x14e5('0x1f')];var _0x36b536=_0x2882d9?0x0:_0xbae96e[_0x14e5('0x20')];var _0x330c3b=_0x2882d9?_0x5182c9['count']:_0xbae96e[_0x14e5('0x20')]+_0xbae96e[_0x14e5('0x1e')];var _0x381907;if(_0x330c3b>=_0x439b11){_0x330c3b=_0x439b11;_0x381907=0xc8;}else{_0x381907=0xce;}_0x4c02bf[_0x14e5('0x1a')](_0x381907);return _0x4c02bf['set'](_0x14e5('0x21'),_0x36b536+'-'+_0x330c3b+'/'+_0x439b11)[_0x14e5('0x1c')](_0x5182c9);}return null;};}function patchUpdates(_0x5b3c09){return function(_0x464493){try{jsonpatch[_0x14e5('0x22')](_0x464493,_0x5b3c09,!![]);}catch(_0x6c2904){return BPromise[_0x14e5('0x23')](_0x6c2904);}return _0x464493[_0x14e5('0x24')]();};}function saveUpdates(_0x1216a7,_0x12486c){return function(_0x3d22a4){if(_0x3d22a4){return _0x3d22a4[_0x14e5('0x25')](_0x1216a7)[_0x14e5('0x26')](function(_0x3cc8c7){return _0x3cc8c7;});}return null;};}function removeEntity(_0x3145c3,_0x33b5c5){return function(_0x15feb6){if(_0x15feb6){return _0x15feb6['destroy']()[_0x14e5('0x26')](function(){_0x3145c3[_0x14e5('0x1a')](0xcc)[_0x14e5('0x1b')]();});}};}function handleEntityNotFound(_0x55f839,_0x6cbf82){return function(_0x3bf01f){if(!_0x3bf01f){_0x55f839['sendStatus'](0x194);}return _0x3bf01f;};}function handleError(_0x5f4e27,_0x567dce){_0x567dce=_0x567dce||0x1f4;return function(_0x1e5e0e){logger[_0x14e5('0x27')](_0x1e5e0e[_0x14e5('0x28')]);if(_0x1e5e0e['name']){delete _0x1e5e0e[_0x14e5('0x29')];}_0x5f4e27[_0x14e5('0x1a')](_0x567dce)[_0x14e5('0x2a')](_0x1e5e0e);};}exports['index']=function(_0x4410ea,_0x487a79){var _0x2334af={},_0xc95421={},_0x590029={'count':0x0,'rows':[]};var _0x5a1439=_['map'](db[_0x14e5('0x2b')][_0x14e5('0x2c')],function(_0x1aec6e){return{'name':_0x1aec6e[_0x14e5('0x2d')],'type':_0x1aec6e['type'][_0x14e5('0x2e')]};});_0xc95421['model']=_['map'](_0x5a1439,_0x14e5('0x29'));_0xc95421[_0x14e5('0x2f')]=_[_0x14e5('0x30')](_0x4410ea['query']);_0xc95421[_0x14e5('0x31')]=_['intersection'](_0xc95421[_0x14e5('0x32')],_0xc95421['query']);_0xc95421[_0x14e5('0x31')]=_[_0x14e5('0x33')](_0xc95421[_0x14e5('0x31')],[_0x14e5('0x34'),_0x14e5('0x35'),'$gt',_0x14e5('0x36'),_0x14e5('0x37'),_0x14e5('0x38'),_0x14e5('0x39'),_0x14e5('0x3a'),'$not',_0x14e5('0x3b'),_0x14e5('0x3c'),_0x14e5('0x3d'),'$notIn',_0x14e5('0x3e'),_0x14e5('0x3f'),'$iLike',_0x14e5('0x40'),_0x14e5('0x3e'),'$overlap','$contains',_0x14e5('0x41'),_0x14e5('0x42')]);_0x2334af['attributes']=_[_0x14e5('0x43')](_0xc95421[_0x14e5('0x32')],qs[_0x14e5('0x44')](_0x4410ea[_0x14e5('0x2f')][_0x14e5('0x44')]));_0x2334af['attributes']=_0x2334af[_0x14e5('0x45')][_0x14e5('0x46')]?_0x2334af[_0x14e5('0x45')]:_0xc95421[_0x14e5('0x32')];if(!_0x4410ea[_0x14e5('0x2f')][_0x14e5('0x47')](_0x14e5('0x48'))){_0x2334af[_0x14e5('0x1e')]=qs[_0x14e5('0x1e')](_0x4410ea[_0x14e5('0x2f')][_0x14e5('0x1e')]);_0x2334af[_0x14e5('0x20')]=qs[_0x14e5('0x20')](_0x4410ea['query'][_0x14e5('0x20')]);}_0x2334af[_0x14e5('0x49')]=qs[_0x14e5('0x4a')](_0x4410ea[_0x14e5('0x2f')][_0x14e5('0x4a')]);_0x2334af['where']=qs[_0x14e5('0x31')](_[_0x14e5('0x4b')](_0x4410ea['query'],_0xc95421[_0x14e5('0x31')]),_0x5a1439);if(_0x4410ea['query'][_0x14e5('0x4c')]){_0x2334af['where']=_[_0x14e5('0x4d')](_0x2334af['where'],{'$or':_[_0x14e5('0x4e')](_0x5a1439,function(_0x53b312){if(_0x53b312[_0x14e5('0x4f')]!==_0x14e5('0x50')){var _0x2d427a={};_0x2d427a[_0x53b312[_0x14e5('0x29')]]={'$like':'%'+_0x4410ea[_0x14e5('0x2f')][_0x14e5('0x4c')]+'%'};return _0x2d427a;}})});}_0x2334af=_[_0x14e5('0x4d')]({},_0x2334af,_0x4410ea[_0x14e5('0x51')]);var _0x47acfd={'where':_0x2334af[_0x14e5('0x52')]};return db['CmHopper'][_0x14e5('0x1f')](_0x47acfd)['then'](function(_0x588058){_0x590029['count']=_0x588058;if(_0x4410ea[_0x14e5('0x2f')][_0x14e5('0x53')]){_0x2334af[_0x14e5('0x54')]=[{'all':!![]}];}return db[_0x14e5('0x2b')][_0x14e5('0x55')](_0x2334af);})[_0x14e5('0x26')](function(_0x5f016d){_0x590029[_0x14e5('0x56')]=_0x5f016d;return _0x590029;})[_0x14e5('0x26')](respondWithFilteredResult(_0x487a79,_0x2334af))[_0x14e5('0x57')](handleError(_0x487a79,null));};exports[_0x14e5('0x58')]=function(_0x4a502e,_0x12537c){var _0x246c1f={'raw':!![],'where':{'id':_0x4a502e[_0x14e5('0x59')]['id']}},_0x259eb4={};_0x259eb4[_0x14e5('0x32')]=_[_0x14e5('0x30')](db[_0x14e5('0x2b')][_0x14e5('0x2c')]);_0x259eb4['query']=_[_0x14e5('0x30')](_0x4a502e[_0x14e5('0x2f')]);_0x259eb4['filters']=_[_0x14e5('0x43')](_0x259eb4['model'],_0x259eb4[_0x14e5('0x2f')]);_0x246c1f[_0x14e5('0x45')]=_[_0x14e5('0x43')](_0x259eb4[_0x14e5('0x32')],qs['fields'](_0x4a502e[_0x14e5('0x2f')]['fields']));_0x246c1f[_0x14e5('0x45')]=_0x246c1f['attributes'][_0x14e5('0x46')]?_0x246c1f['attributes']:_0x259eb4[_0x14e5('0x32')];if(_0x4a502e['query'][_0x14e5('0x53')]){_0x246c1f['include']=[{'all':!![]}];}_0x246c1f=_['merge']({},_0x246c1f,_0x4a502e[_0x14e5('0x51')]);return db[_0x14e5('0x2b')][_0x14e5('0x5a')](_0x246c1f)[_0x14e5('0x26')](handleEntityNotFound(_0x12537c,null))[_0x14e5('0x26')](respondWithResult(_0x12537c,null))[_0x14e5('0x57')](handleError(_0x12537c,null));};exports['create']=function(_0x5f2584,_0x2f0699){return db[_0x14e5('0x2b')][_0x14e5('0x5b')](_0x5f2584[_0x14e5('0x5c')],{})[_0x14e5('0x26')](respondWithResult(_0x2f0699,0xc9))[_0x14e5('0x57')](handleError(_0x2f0699,null));};exports['update']=function(_0x3afe52,_0x24ef5f){if(_0x3afe52[_0x14e5('0x5c')]['id']){delete _0x3afe52['body']['id'];}return db['CmHopper'][_0x14e5('0x5a')]({'where':{'id':_0x3afe52[_0x14e5('0x59')]['id']}})[_0x14e5('0x26')](handleEntityNotFound(_0x24ef5f,null))[_0x14e5('0x26')](saveUpdates(_0x3afe52[_0x14e5('0x5c')],null))['then'](respondWithResult(_0x24ef5f,null))[_0x14e5('0x57')](handleError(_0x24ef5f,null));};exports['describe']=function(_0x5252d1,_0x26c898){return db[_0x14e5('0x2b')][_0x14e5('0x5d')]()[_0x14e5('0x26')](respondWithResult(_0x26c898,null))['catch'](handleError(_0x26c898,null));};exports[_0x14e5('0x5e')]=function(_0x3f5709,_0x5f3493){var _0x49803c;var _0x5c7ed1=_0x3f5709['params']['id'];return db['CmHopper'][_0x14e5('0x5a')]({'where':{'id':_0x3f5709['params']['id']}})['then'](handleEntityNotFound(_0x5f3493,null))[_0x14e5('0x26')](function(_0x3013a1){if(_0x3013a1){return _0x3013a1[_0x14e5('0x5e')]()[_0x14e5('0x26')](function(_0x55d038){return _0x55d038;});}})[_0x14e5('0x26')](function(_0x5dd766){_0x49803c=_0x5dd766;if(_0x5dd766){if(_0x5dd766['VoiceQueueId']||_0x5dd766[_0x14e5('0x5f')]){return db[_0x5dd766[_0x14e5('0x60')]?_0x14e5('0x61'):'Campaign'][_0x14e5('0x5a')]({'where':{'id':_0x5dd766[_0x14e5('0x60')]?_0x5dd766[_0x14e5('0x60')]:_0x5dd766['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0x14e5('0x26')](function(_0xda3ff8){var _0x1556c9={};if(_0xda3ff8){_[_0x14e5('0x4d')](_0x1556c9,_[_0x14e5('0x62')](_0x49803c[_0x14e5('0x63')],[_0x14e5('0x64'),_0x14e5('0x65'),'id']));_0x1556c9[_0x14e5('0x66')]=0x15;_0x1556c9[_0x14e5('0x67')]=_0x14e5('0x68');_0x1556c9[_0x14e5('0x69')]=_0xda3ff8[_0x14e5('0x29')];_0x1556c9['membername']=_0x3f5709[_0x14e5('0x6a')][_0x14e5('0x29')];_0x1556c9['UserId']=_0x3f5709[_0x14e5('0x6a')]['id'];_0x1556c9[_0x14e5('0x68')]=!![];_0x1556c9[_0x14e5('0x6b')]=moment()[_0x14e5('0x6c')](_0x14e5('0x6d'));_0x1556c9[_0x14e5('0x6e')]=_0x49803c[_0x14e5('0x6f')];_0x1556c9[_0x14e5('0x70')]=_0x49803c['VoiceQueueId']?_0x14e5('0x71'):_0x14e5('0x72');return db[_0x14e5('0x73')][_0x14e5('0x5a')]({'where':{'id':_0x1556c9[_0x14e5('0x74')]},'attributes':[_0x14e5('0x75'),'lastName']})[_0x14e5('0x26')](function(_0x3d0120){if(!_[_0x14e5('0x76')](_0x5f3493)&&!_['isNil'](_0x3d0120[_0x14e5('0x75')])){_0x1556c9[_0x14e5('0x77')]=_0x3d0120[_0x14e5('0x75')];if(!_['isNil'](_0x3d0120['lastName'])){_0x1556c9[_0x14e5('0x77')]+='\x20'+_0x3d0120[_0x14e5('0x78')];}}})[_0x14e5('0x79')](function(){return db[_0x14e5('0x7a')]['create'](_0x1556c9);});}})['then'](function(_0x1690da){return db[_0x14e5('0x7b')][_0x14e5('0x5e')]({'where':{'CmHopperId':_0x5c7ed1}});})['then'](function(){return _0x5f3493['status'](0xcc)['end']();})['catch'](handleError(_0x5f3493,null));};exports[_0x14e5('0x7c')]=function(_0x50d398,_0x4949d7,_0x5a5d81){var _0x472c88=[];return db[_0x14e5('0x73')][_0x14e5('0x5d')]()[_0x14e5('0x26')](function(_0x160898){_0x472c88=_[_0x14e5('0x30')](_0x160898);return _0x50d398[_0x14e5('0x6a')][_0x14e5('0x7d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x14e5('0x7e')],'raw':!![]});})[_0x14e5('0x26')](function(_0x3a11d0){if(_0x3a11d0&&_0x3a11d0['length']){return db[_0x14e5('0x7f')][_0x14e5('0x80')](function(_0x2c4821){var _0x2ad3ae={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x14e5('0x6c')](_0x14e5('0x6d'))},'VoiceQueueId':{'$in':_[_0x14e5('0x4e')](_0x3a11d0,'id')},'$or':[{'UserId':null},{'UserId':_0x50d398[_0x14e5('0x6a')]['id']}]};var _0x2742af=[];if(_0x50d398[_0x14e5('0x5c')][_0x14e5('0x81')]&&_0x50d398['body']['direction']===_0x14e5('0x82')){if(!_[_0x14e5('0x83')](_0x50d398[_0x14e5('0x5c')][_0x14e5('0x84')])){_0x2ad3ae['id']={'$in':_0x50d398[_0x14e5('0x5c')][_0x14e5('0x84')]};}_0x2742af=[['priority',_0x14e5('0x85')],[_0x14e5('0x86'),_0x3a11d0[0x0][_0x14e5('0x7e')]===_0x14e5('0x85')?_0x14e5('0x87'):_0x14e5('0x85')],db[_0x14e5('0x7f')][_0x14e5('0x88')](_0x14e5('0x89')),['id',_0x14e5('0x87')]];}else{if(!_[_0x14e5('0x83')](_0x50d398[_0x14e5('0x5c')][_0x14e5('0x84')])){_0x2ad3ae['id']={'$notIn':_0x50d398[_0x14e5('0x5c')][_0x14e5('0x84')]};}_0x2742af=[['priority',_0x14e5('0x87')],[_0x14e5('0x86'),_0x3a11d0[0x0]['dialOrderByScheduledAt']],db[_0x14e5('0x7f')][_0x14e5('0x88')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x14e5('0x85')]];}return db['CmHopper']['findOne']({'attributes':['id','scheduledat','phone'],'where':_0x2ad3ae,'order':_0x2742af,'transaction':_0x2c4821,'lock':_0x2c4821[_0x14e5('0x8a')][_0x14e5('0x8b')],'include':[{'model':db[_0x14e5('0x73')],'as':_0x14e5('0x8c'),'attributes':_0x472c88,'include':[{'model':db[_0x14e5('0x8d')],'as':_0x14e5('0x8e'),'attributes':['id',_0x14e5('0x29')]}]},{'model':db[_0x14e5('0x8f')],'as':_0x14e5('0x90'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0x14e5('0x91'),'attributes':['id',_0x14e5('0x29'),_0x14e5('0x92')]}]})['then'](function(_0x195b63){if(_0x195b63){return _0x195b63['update']({'UserId':_0x50d398[_0x14e5('0x6a')]['id']},{'transaction':_0x2c4821});}});});}})[_0x14e5('0x26')](handleEntityNotFound(_0x4949d7,null))[_0x14e5('0x26')](respondWithResult(_0x4949d7,null))[_0x14e5('0x57')](handleError(_0x4949d7,null));};exports[_0x14e5('0x93')]=function(_0x428ba0,_0x4deb20,_0x4cd387){return _0x428ba0['user'][_0x14e5('0x7d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x14e5('0x94')},'attributes':['id'],'raw':!![]})[_0x14e5('0x26')](function(_0x48fc1){if(_0x48fc1&&_0x48fc1[_0x14e5('0x46')]){return db[_0x14e5('0x2b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x14e5('0x6c')](_0x14e5('0x6d'))},'VoiceQueueId':{'$in':_[_0x14e5('0x4e')](_0x48fc1,'id')},'$or':[{'UserId':null},{'UserId':_0x428ba0[_0x14e5('0x6a')]['id']}]}});}return 0x0;})[_0x14e5('0x26')](function(_0xdc114a){if(!_[_0x14e5('0x76')](_0xdc114a)&&_[_0x14e5('0x95')](_0xdc114a)){return _0x4deb20['status'](0xc8)[_0x14e5('0x1c')]({'contacts':_0xdc114a});}else{logger[_0x14e5('0x27')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x14e5('0x93'),0x194,_0x14e5('0x96'));_0x4deb20['sendStatus'](0x194);}})[_0x14e5('0x57')](handleError(_0x4deb20,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 443dab5..cb29cba 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 _0x4d34=['cm_hopper','scheduledat','phone','priority','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper'];(function(_0x3e23dd,_0x5735e8){var _0x5b57c1=function(_0x3f01be){while(--_0x3f01be){_0x3e23dd['push'](_0x3e23dd['shift']());}};_0x5b57c1(++_0x5735e8);}(_0x4d34,0x114));var _0x44d3=function(_0xd0cdac,_0x13c979){_0xd0cdac=_0xd0cdac-0x0;var _0x135708=_0x4d34[_0xd0cdac];return _0x135708;};'use strict';var _=require(_0x44d3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x44d3('0x1'));var moment=require(_0x44d3('0x2'));var BPromise=require(_0x44d3('0x3'));var rp=require(_0x44d3('0x4'));var fs=require('fs');var path=require(_0x44d3('0x5'));var rimraf=require(_0x44d3('0x6'));var config=require(_0x44d3('0x7'));var attributes=require(_0x44d3('0x8'));module[_0x44d3('0x9')]=function(_0x2832f2,_0x5ec0a9){return _0x2832f2[_0x44d3('0xa')](_0x44d3('0xb'),attributes,{'tableName':_0x44d3('0xc'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x44d3('0xd')]},{'name':'phone','fields':[_0x44d3('0xe')]},{'name':_0x44d3('0xf'),'fields':[_0x44d3('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c0e=['rimraf','../../config/environment','./cmHopper.attributes','cm_hopper','scheduledat','phone','../../config/logger','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c0e,0x1ad));var _0xe5c0=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x5c0e[_0x466af7];return _0x348c96;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe5c0('0x0'))('api');var moment=require(_0xe5c0('0x1'));var BPromise=require('bluebird');var rp=require(_0xe5c0('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe5c0('0x3'));var config=require(_0xe5c0('0x4'));var attributes=require(_0xe5c0('0x5'));module['exports']=function(_0x34a66e,_0x4f183b){return _0x34a66e['define']('CmHopper',attributes,{'tableName':_0xe5c0('0x6'),'paranoid':![],'indexes':[{'name':_0xe5c0('0x7'),'fields':[_0xe5c0('0x7')]},{'name':_0xe5c0('0x8'),'fields':[_0xe5c0('0x8')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index c56a962..5f6bdc2 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 _0x5fce=['literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','GetContactRecallMe','GetCmHopperPreview','describe','Contact','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','ShowCmHopper','find','create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','order','LOCK','UPDATE','keys','User','Agent','name','length','UserId','push','includes','all','MoveContactManagedDialer','transaction','CountReScheduled','COUNT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fce,0x1eb));var _0xe5fc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5fce[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xe5fc('0x0'));var util=require(_0xe5fc('0x1'));var moment=require(_0xe5fc('0x2'));var BPromise=require(_0xe5fc('0x3'));var rs=require(_0xe5fc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe5fc('0x5'))['db'];var utils=require(_0xe5fc('0x6'));var logger=require(_0xe5fc('0x7'))('rpc');var config=require(_0xe5fc('0x8'));var jayson=require(_0xe5fc('0x9'));var client=jayson[_0xe5fc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14d49e,_0x1497bf,_0x3bb993){return new BPromise(function(_0xafefab,_0x563a79){return client['request'](_0x14d49e,_0x3bb993)[_0xe5fc('0xb')](function(_0x2ec8d0){logger[_0xe5fc('0xc')]('CmHopper,\x20%s,\x20%s',_0x1497bf,_0xe5fc('0xd'));logger[_0xe5fc('0xe')](_0xe5fc('0xf'),_0x1497bf,_0xe5fc('0xd'),JSON[_0xe5fc('0x10')](_0x2ec8d0));if(_0x2ec8d0[_0xe5fc('0x11')]){if(_0x2ec8d0[_0xe5fc('0x11')][_0xe5fc('0x12')]===0x1f4){logger[_0xe5fc('0x11')](_0xe5fc('0x13'),_0x1497bf,_0x2ec8d0[_0xe5fc('0x11')][_0xe5fc('0x14')]);return _0x563a79(_0x2ec8d0[_0xe5fc('0x11')][_0xe5fc('0x14')]);}logger[_0xe5fc('0x11')](_0xe5fc('0x13'),_0x1497bf,_0x2ec8d0[_0xe5fc('0x11')]['message']);return _0xafefab(_0x2ec8d0['error'][_0xe5fc('0x14')]);}else{logger[_0xe5fc('0xc')](_0xe5fc('0x13'),_0x1497bf,_0xe5fc('0xd'));_0xafefab(_0x2ec8d0['result'][_0xe5fc('0x14')]);}})[_0xe5fc('0x15')](function(_0x5bd8d0){logger[_0xe5fc('0x11')](_0xe5fc('0x13'),_0x1497bf,_0x5bd8d0);_0x563a79(_0x5bd8d0);});});}exports[_0xe5fc('0x16')]=function(_0x168002){var _0x43f8fe=this;return new Promise(function(_0x264ba9,_0x4bb7c0){return db[_0xe5fc('0x17')][_0xe5fc('0x18')]({'raw':_0x168002[_0xe5fc('0x19')]?_0x168002[_0xe5fc('0x19')][_0xe5fc('0x1a')]===undefined?!![]:![]:!![],'where':_0x168002[_0xe5fc('0x19')]?_0x168002['options'][_0xe5fc('0x1b')]||null:null,'attributes':_0x168002[_0xe5fc('0x19')]?_0x168002['options'][_0xe5fc('0x1c')]||null:null,'limit':_0x168002[_0xe5fc('0x19')]?_0x168002['options'][_0xe5fc('0x1d')]||null:null,'include':_0x168002[_0xe5fc('0x19')]?_0x168002[_0xe5fc('0x19')][_0xe5fc('0x1e')]?_[_0xe5fc('0x1f')](_0x168002[_0xe5fc('0x19')][_0xe5fc('0x1e')],function(_0x1b9f98){return{'model':db[_0x1b9f98[_0xe5fc('0x20')]],'as':_0x1b9f98['as'],'attributes':_0x1b9f98[_0xe5fc('0x1c')],'include':_0x1b9f98['include']?_[_0xe5fc('0x1f')](_0x1b9f98[_0xe5fc('0x1e')],function(_0x374804){return{'model':db[_0x374804[_0xe5fc('0x20')]],'as':_0x374804['as'],'attributes':_0x374804[_0xe5fc('0x1c')],'include':_0x374804[_0xe5fc('0x1e')]?_[_0xe5fc('0x1f')](_0x374804[_0xe5fc('0x1e')],function(_0x39923f){return{'model':db[_0x39923f[_0xe5fc('0x20')]],'as':_0x39923f['as'],'attributes':_0x39923f['attributes']};}):[]};}):[]};}):[]:[]})[_0xe5fc('0xb')](function(_0x3985c6){logger[_0xe5fc('0xc')](_0xe5fc('0x16'),_0x168002);logger['debug'](_0xe5fc('0x16'),_0x168002,JSON[_0xe5fc('0x10')](_0x3985c6));_0x264ba9(_0x3985c6);})[_0xe5fc('0x15')](function(_0x26814c){logger[_0xe5fc('0x11')](_0xe5fc('0x16'),_0x26814c['message'],_0x168002);_0x4bb7c0(_0x43f8fe['error'](0x1f4,_0x26814c[_0xe5fc('0x14')]));});});};exports[_0xe5fc('0x21')]=function(_0x12664f){var _0x347a71=this;return new Promise(function(_0xa528ee,_0x58439b){return db['CmHopper'][_0xe5fc('0x22')]({'raw':_0x12664f[_0xe5fc('0x19')]?_0x12664f[_0xe5fc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x12664f[_0xe5fc('0x19')]?_0x12664f['options'][_0xe5fc('0x1b')]||null:null,'attributes':_0x12664f['options']?_0x12664f[_0xe5fc('0x19')]['attributes']||null:null,'include':_0x12664f[_0xe5fc('0x19')]?_0x12664f[_0xe5fc('0x19')]['include']?_['map'](_0x12664f[_0xe5fc('0x19')][_0xe5fc('0x1e')],function(_0x4fec3e){return{'model':db[_0x4fec3e['model']],'as':_0x4fec3e['as'],'attributes':_0x4fec3e['attributes'],'include':_0x4fec3e['include']?_[_0xe5fc('0x1f')](_0x4fec3e[_0xe5fc('0x1e')],function(_0xcd4e0f){return{'model':db[_0xcd4e0f['model']],'as':_0xcd4e0f['as'],'attributes':_0xcd4e0f[_0xe5fc('0x1c')],'include':_0xcd4e0f[_0xe5fc('0x1e')]?_['map'](_0xcd4e0f['include'],function(_0x12939b){return{'model':db[_0x12939b[_0xe5fc('0x20')]],'as':_0x12939b['as'],'attributes':_0x12939b[_0xe5fc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe5fc('0xb')](function(_0x26e1fd){logger['info'](_0xe5fc('0x21'),_0x12664f);logger[_0xe5fc('0xe')](_0xe5fc('0x21'),_0x12664f,JSON[_0xe5fc('0x10')](_0x26e1fd));_0xa528ee(_0x26e1fd);})[_0xe5fc('0x15')](function(_0x5de841){logger[_0xe5fc('0x11')](_0xe5fc('0x21'),_0x5de841[_0xe5fc('0x14')],_0x12664f);_0x58439b(_0x347a71[_0xe5fc('0x11')](0x1f4,_0x5de841['message']));});});};exports['CreateCmHopper']=function(_0xe6fdb7){var _0x1432a5=this;return new Promise(function(_0x5b7711,_0x546ac3){return db[_0xe5fc('0x17')][_0xe5fc('0x23')](_0xe6fdb7[_0xe5fc('0x24')],{'raw':_0xe6fdb7[_0xe5fc('0x19')]?_0xe6fdb7[_0xe5fc('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xe5fc('0xb')](function(_0x103268){logger[_0xe5fc('0xc')](_0xe5fc('0x25'),_0xe6fdb7);logger[_0xe5fc('0xe')](_0xe5fc('0x25'),_0xe6fdb7,JSON['stringify'](_0x103268));_0x5b7711(_0x103268);})[_0xe5fc('0x15')](function(_0x5c05b3){logger[_0xe5fc('0x11')](_0xe5fc('0x25'),_0x5c05b3[_0xe5fc('0x14')],_0xe6fdb7);_0x546ac3(_0x1432a5[_0xe5fc('0x11')](0x1f4,_0x5c05b3[_0xe5fc('0x14')]));});});};exports[_0xe5fc('0x26')]=function(_0x36be8a){var _0x13b8a5=this;return new Promise(function(_0x3654c1,_0x2b07e8){return db['CmHopper'][_0xe5fc('0x27')](_0x36be8a[_0xe5fc('0x24')],{'raw':_0x36be8a[_0xe5fc('0x19')]?_0x36be8a['options'][_0xe5fc('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36be8a['options']?_0x36be8a[_0xe5fc('0x19')][_0xe5fc('0x1b')]||null:null,'attributes':_0x36be8a[_0xe5fc('0x19')]?_0x36be8a[_0xe5fc('0x19')]['attributes']||null:null,'limit':_0x36be8a[_0xe5fc('0x19')]?_0x36be8a[_0xe5fc('0x19')]['limit']||null:null})[_0xe5fc('0xb')](function(_0x491405){logger[_0xe5fc('0xc')]('UpdateCmHopper',_0x36be8a);logger[_0xe5fc('0xe')]('UpdateCmHopper',_0x36be8a,JSON['stringify'](_0x491405));_0x3654c1(_0x491405);})[_0xe5fc('0x15')](function(_0x1bebc3){logger[_0xe5fc('0x11')](_0xe5fc('0x26'),_0x1bebc3[_0xe5fc('0x14')],_0x36be8a);_0x2b07e8(_0x13b8a5['error'](0x1f4,_0x1bebc3[_0xe5fc('0x14')]));});});};exports[_0xe5fc('0x28')]=function(_0x1750f4){var _0x2ae8c3=this;return new Promise(function(_0x1bd012,_0x25f7da){return db['CmHopper'][_0xe5fc('0x29')]({'where':_0x1750f4[_0xe5fc('0x19')]?_0x1750f4[_0xe5fc('0x19')][_0xe5fc('0x1b')]||null:null})[_0xe5fc('0xb')](function(_0x14b2a4){logger[_0xe5fc('0xc')](_0xe5fc('0x28'),_0x1750f4);logger[_0xe5fc('0xe')](_0xe5fc('0x28'),_0x1750f4,JSON[_0xe5fc('0x10')](_0x14b2a4));_0x1bd012(_0x14b2a4);})['catch'](function(_0x414037){logger['error'](_0xe5fc('0x28'),_0x414037[_0xe5fc('0x14')],_0x1750f4);_0x25f7da(_0x2ae8c3[_0xe5fc('0x11')](0x1f4,_0x414037[_0xe5fc('0x14')]));});});};exports[_0xe5fc('0x2a')]=function(_0x535518){var _0xc0ce1=this;return new Promise(function(_0x5b95ec,_0x184a68){return db[_0xe5fc('0x2b')]['describe']()[_0xe5fc('0xb')](function(_0x366259){return db[_0xe5fc('0x2c')]['transaction'](function(_0x3898a1){return db[_0xe5fc('0x17')][_0xe5fc('0x18')]({'where':_0x535518['options']?_0x535518[_0xe5fc('0x19')][_0xe5fc('0x1b')]||null:null,'attributes':_0x535518[_0xe5fc('0x19')]?_0x535518['options'][_0xe5fc('0x1c')]||null:null,'limit':_0x535518['options']?_0x535518[_0xe5fc('0x19')][_0xe5fc('0x1d')]||null:null,'order':_0x535518['options']?_0x535518[_0xe5fc('0x19')][_0xe5fc('0x2d')]||null:null,'transaction':_0x3898a1,'lock':_0x3898a1[_0xe5fc('0x2e')][_0xe5fc('0x2f')],'include':[{'model':db[_0xe5fc('0x2b')],'as':'Contact','attributes':_[_0xe5fc('0x30')](_0x366259)},{'model':db[_0xe5fc('0x31')],'as':_0xe5fc('0x32'),'attributes':['id',_0xe5fc('0x33'),'voicePause']}]})[_0xe5fc('0xb')](function(_0x16e9d8){var _0x330d74=[];var _0x3f5ead=[];for(var _0x17180b=0x0;_0x17180b<_0x16e9d8[_0xe5fc('0x34')];_0x17180b+=0x1){var _0x5eb30f=_0x16e9d8[_0x17180b][_0xe5fc('0x35')];if(_0x5eb30f===null){_0x330d74[_0xe5fc('0x36')](_0x16e9d8[_0x17180b]['update'](_0x535518[_0xe5fc('0x24')],{'transaction':_0x3898a1}));}else if(!_0x3f5ead[_0xe5fc('0x37')](_0x5eb30f)){_0x3f5ead[_0xe5fc('0x36')](_0x5eb30f);_0x330d74['push'](_0x16e9d8[_0x17180b][_0xe5fc('0x27')](_0x535518[_0xe5fc('0x24')],{'transaction':_0x3898a1}));}}return BPromise[_0xe5fc('0x38')](_0x330d74);});})['then'](function(_0x1c85ac){logger[_0xe5fc('0xc')](_0xe5fc('0x2a'),_0x535518);logger[_0xe5fc('0xe')]('GetContactDialer',_0x535518,JSON[_0xe5fc('0x10')](_0x1c85ac));_0x5b95ec(_0x1c85ac);})[_0xe5fc('0x15')](function(_0x4b4a1d){logger[_0xe5fc('0x11')](_0xe5fc('0x2a'),_0x4b4a1d[_0xe5fc('0x14')],_0x535518);_0x184a68(_0xc0ce1[_0xe5fc('0x11')](0x1f4,_0x4b4a1d[_0xe5fc('0x14')]));});});});};exports[_0xe5fc('0x39')]=function(_0x1e3f20){var _0x1f0d02=this;return new Promise(function(_0x2b3478,_0x4eb889){return db[_0xe5fc('0x2c')][_0xe5fc('0x3a')](function(_0x483210){return db['CmHopperFinal'][_0xe5fc('0x23')](_0x1e3f20[_0xe5fc('0x24')],{'raw':_0x1e3f20[_0xe5fc('0x19')]?_0x1e3f20['options'][_0xe5fc('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x483210})[_0xe5fc('0xb')](function(){return db[_0xe5fc('0x17')][_0xe5fc('0x29')]({'where':_0x1e3f20[_0xe5fc('0x19')]?_0x1e3f20['options'][_0xe5fc('0x1b')]||null:null,'transaction':_0x483210});});})[_0xe5fc('0xb')](function(_0x1f3939){logger[_0xe5fc('0xc')](_0xe5fc('0x39'),_0x1e3f20);logger[_0xe5fc('0xe')](_0xe5fc('0x39'),_0x1e3f20,JSON[_0xe5fc('0x10')](_0x1f3939));_0x2b3478(_0x1f3939);})[_0xe5fc('0x15')](function(_0xc41548){logger[_0xe5fc('0x11')](_0xe5fc('0x39'),_0xc41548['message'],_0x1e3f20);_0x4eb889(_0x1f0d02[_0xe5fc('0x11')](0x1f4,_0xc41548[_0xe5fc('0x14')]));});});};exports[_0xe5fc('0x3b')]=function(_0x268ba0){var _0x580c2c=this;return new Promise(function(_0x1f0b22,_0x19a535){return db['CmHopper'][_0xe5fc('0x18')]({'raw':_0x268ba0[_0xe5fc('0x19')]?_0x268ba0[_0xe5fc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x268ba0[_0xe5fc('0x19')]?_0x268ba0[_0xe5fc('0x19')][_0xe5fc('0x1b')]||null:null,'attributes':[[db[_0xe5fc('0x2c')]['fn'](_0xe5fc('0x3c'),db['sequelize']['fn']('IF',db[_0xe5fc('0x2c')][_0xe5fc('0x3d')](_0xe5fc('0x3e')+util[_0xe5fc('0x3f')](_0xe5fc('0x40'),moment()[_0xe5fc('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})['then'](function(_0x3c7201){logger['info'](_0xe5fc('0x3b'),_0x268ba0);logger[_0xe5fc('0xe')]('CountReScheduled',_0x268ba0,JSON[_0xe5fc('0x10')](_0x3c7201));_0x1f0b22(_0x3c7201);})[_0xe5fc('0x15')](function(_0x5dda09){logger['error'](_0xe5fc('0x3b'),_0x5dda09[_0xe5fc('0x14')],_0x268ba0);_0x19a535(_0x580c2c[_0xe5fc('0x11')](0x1f4,_0x5dda09[_0xe5fc('0x14')]));});});};exports[_0xe5fc('0x41')]=function(_0x4f0ca0){var _0x44b8c5=this;return new Promise(function(_0x5228e6,_0x1190fd){return db[_0xe5fc('0x2b')]['describe']()[_0xe5fc('0xb')](function(_0xac8bbc){return db[_0xe5fc('0x2c')]['transaction'](function(_0x308074){return db[_0xe5fc('0x17')][_0xe5fc('0x18')]({'where':_0x4f0ca0[_0xe5fc('0x19')]?_0x4f0ca0['options']['where']||null:null,'attributes':_0x4f0ca0[_0xe5fc('0x19')]?_0x4f0ca0[_0xe5fc('0x19')]['attributes']||null:null,'limit':0x1,'order':_0x4f0ca0[_0xe5fc('0x19')]?_0x4f0ca0[_0xe5fc('0x19')]['order']||null:null,'group':db[_0xe5fc('0x17')]['UserId'],'transaction':_0x308074,'lock':_0x308074[_0xe5fc('0x2e')][_0xe5fc('0x2f')],'include':_0x4f0ca0[_0xe5fc('0x19')]?_0x4f0ca0['options'][_0xe5fc('0x1e')]?_[_0xe5fc('0x1f')](_0x4f0ca0[_0xe5fc('0x19')]['include'],function(_0x196306){return{'model':db[_0x196306['model']],'as':_0x196306['as'],'attributes':_0x196306[_0xe5fc('0x1c')],'include':_0x196306[_0xe5fc('0x1e')]?_['map'](_0x196306['include'],function(_0x3dff97){return{'model':db[_0x3dff97[_0xe5fc('0x20')]],'as':_0x3dff97['as'],'attributes':_0x3dff97[_0xe5fc('0x1c')],'include':_0x3dff97['include']?_[_0xe5fc('0x1f')](_0x3dff97[_0xe5fc('0x1e')],function(_0x26a406){return{'model':db[_0x26a406[_0xe5fc('0x20')]],'as':_0x26a406['as'],'attributes':_0x26a406[_0xe5fc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe5fc('0xb')](function(_0x58e61a){var _0x2b2ed4=[];for(var _0x24ddb3=0x0;_0x24ddb3<_0x58e61a['length'];_0x24ddb3+=0x1){_0x2b2ed4[_0xe5fc('0x36')](_0x58e61a[_0x24ddb3][_0xe5fc('0x27')](_0x4f0ca0[_0xe5fc('0x24')],{'transaction':_0x308074}));}return BPromise[_0xe5fc('0x38')](_0x2b2ed4);});})[_0xe5fc('0xb')](function(_0x32c30a){logger[_0xe5fc('0xc')]('GetContactRecallMe',_0x4f0ca0);logger[_0xe5fc('0xe')](_0xe5fc('0x41'),_0x4f0ca0,JSON[_0xe5fc('0x10')](_0x32c30a));_0x5228e6(_0x32c30a);})['catch'](function(_0x4d4d5d){logger[_0xe5fc('0x11')](_0xe5fc('0x41'),_0x4d4d5d['message'],_0x4f0ca0);_0x1190fd(_0x44b8c5['error'](0x1f4,_0x4d4d5d['message']));});});});};exports[_0xe5fc('0x42')]=function(_0x148e8d){var _0x1fc014=this;return new Promise(function(_0x586e61,_0x1a0ce8){db[_0xe5fc('0x2b')][_0xe5fc('0x43')]()['then'](function(_0x48e912){return db[_0xe5fc('0x17')][_0xe5fc('0x18')]({'raw':_0x148e8d[_0xe5fc('0x19')]?_0x148e8d[_0xe5fc('0x19')][_0xe5fc('0x1a')]===undefined?!![]:![]:!![],'where':_0x148e8d[_0xe5fc('0x19')]?_0x148e8d[_0xe5fc('0x19')][_0xe5fc('0x1b')]||null:null,'attributes':_0x148e8d['options']?_0x148e8d[_0xe5fc('0x19')][_0xe5fc('0x1c')]||null:null,'limit':_0x148e8d[_0xe5fc('0x19')]?_0x148e8d[_0xe5fc('0x19')][_0xe5fc('0x1d')]||null:null,'include':_0x148e8d[_0xe5fc('0x19')]?_0x148e8d[_0xe5fc('0x19')][_0xe5fc('0x1e')]?_['map'](_0x148e8d['options'][_0xe5fc('0x1e')],function(_0xdac35b){return{'model':db[_0xdac35b['model']],'as':_0xdac35b['as'],'attributes':_0xdac35b['as']===_0xe5fc('0x44')?_[_0xe5fc('0x30')](_0x48e912):_0xdac35b[_0xe5fc('0x1c')],'include':_0xdac35b[_0xe5fc('0x1e')]?_['map'](_0xdac35b[_0xe5fc('0x1e')],function(_0x383f88){return{'model':db[_0x383f88[_0xe5fc('0x20')]],'as':_0x383f88['as'],'attributes':_0x383f88[_0xe5fc('0x1c')],'include':_0x383f88[_0xe5fc('0x1e')]?_[_0xe5fc('0x1f')](_0x383f88[_0xe5fc('0x1e')],function(_0xb747f9){return{'model':db[_0xb747f9['model']],'as':_0xb747f9['as'],'attributes':_0xb747f9[_0xe5fc('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a0670){logger[_0xe5fc('0xc')](_0xe5fc('0x16'),_0x148e8d);logger[_0xe5fc('0xe')]('GetCmHopper',_0x148e8d,JSON[_0xe5fc('0x10')](_0x4a0670));_0x586e61(_0x4a0670);})[_0xe5fc('0x15')](function(_0xc22200){logger['error'](_0xe5fc('0x16'),_0xc22200['message'],_0x148e8d);_0x1a0ce8(_0x1fc014[_0xe5fc('0x11')](0x1f4,_0xc22200[_0xe5fc('0x14')]));});});});}; \ No newline at end of file +var _0xfb46=['update','all','MoveContactManagedDialer','CmHopperFinal','create','CountReScheduled','COUNT','literal','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','LOCK','length','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','CmHopper,\x20%s,\x20%s','message','info','result','catch','CmHopper','findAll','options','raw','where','attributes','limit','map','model','include','GetCmHopper','ShowCmHopper','find','CreateCmHopper','body','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','UPDATE','Contact','keys','User','Agent','name','voicePause','UserId','push'];(function(_0x5913f0,_0x310d5a){var _0xd8a93a=function(_0x36ba9d){while(--_0x36ba9d){_0x5913f0['push'](_0x5913f0['shift']());}};_0xd8a93a(++_0x310d5a);}(_0xfb46,0x1ae));var _0x6fb4=function(_0x151334,_0x1e11ac){_0x151334=_0x151334-0x0;var _0x3d03da=_0xfb46[_0x151334];return _0x3d03da;};'use strict';var _=require('lodash');var util=require(_0x6fb4('0x0'));var moment=require('moment');var BPromise=require(_0x6fb4('0x1'));var rs=require(_0x6fb4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6fb4('0x3'))['db'];var utils=require(_0x6fb4('0x4'));var logger=require(_0x6fb4('0x5'))(_0x6fb4('0x6'));var config=require('../../config/environment');var jayson=require(_0x6fb4('0x7'));var client=jayson['client'][_0x6fb4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33633e,_0x1ca16f,_0x6ab633){return new BPromise(function(_0x81631,_0x56f895){return client[_0x6fb4('0x9')](_0x33633e,_0x6ab633)[_0x6fb4('0xa')](function(_0x1e67bd){logger['info']('CmHopper,\x20%s,\x20%s',_0x1ca16f,_0x6fb4('0xb'));logger[_0x6fb4('0xc')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x1ca16f,_0x6fb4('0xb'),JSON[_0x6fb4('0xd')](_0x1e67bd));if(_0x1e67bd[_0x6fb4('0xe')]){if(_0x1e67bd[_0x6fb4('0xe')][_0x6fb4('0xf')]===0x1f4){logger[_0x6fb4('0xe')](_0x6fb4('0x10'),_0x1ca16f,_0x1e67bd['error'][_0x6fb4('0x11')]);return _0x56f895(_0x1e67bd[_0x6fb4('0xe')][_0x6fb4('0x11')]);}logger[_0x6fb4('0xe')](_0x6fb4('0x10'),_0x1ca16f,_0x1e67bd[_0x6fb4('0xe')]['message']);return _0x81631(_0x1e67bd[_0x6fb4('0xe')]['message']);}else{logger[_0x6fb4('0x12')](_0x6fb4('0x10'),_0x1ca16f,_0x6fb4('0xb'));_0x81631(_0x1e67bd[_0x6fb4('0x13')][_0x6fb4('0x11')]);}})[_0x6fb4('0x14')](function(_0x1b3cd9){logger[_0x6fb4('0xe')](_0x6fb4('0x10'),_0x1ca16f,_0x1b3cd9);_0x56f895(_0x1b3cd9);});});}exports['GetCmHopper']=function(_0xf8dd14){var _0x465b56=this;return new Promise(function(_0x4cafb8,_0xd13d44){return db[_0x6fb4('0x15')][_0x6fb4('0x16')]({'raw':_0xf8dd14[_0x6fb4('0x17')]?_0xf8dd14[_0x6fb4('0x17')][_0x6fb4('0x18')]===undefined?!![]:![]:!![],'where':_0xf8dd14[_0x6fb4('0x17')]?_0xf8dd14[_0x6fb4('0x17')][_0x6fb4('0x19')]||null:null,'attributes':_0xf8dd14[_0x6fb4('0x17')]?_0xf8dd14[_0x6fb4('0x17')][_0x6fb4('0x1a')]||null:null,'limit':_0xf8dd14[_0x6fb4('0x17')]?_0xf8dd14['options'][_0x6fb4('0x1b')]||null:null,'include':_0xf8dd14[_0x6fb4('0x17')]?_0xf8dd14[_0x6fb4('0x17')]['include']?_[_0x6fb4('0x1c')](_0xf8dd14[_0x6fb4('0x17')]['include'],function(_0x8d58c){return{'model':db[_0x8d58c[_0x6fb4('0x1d')]],'as':_0x8d58c['as'],'attributes':_0x8d58c[_0x6fb4('0x1a')],'include':_0x8d58c['include']?_['map'](_0x8d58c[_0x6fb4('0x1e')],function(_0x3229b1){return{'model':db[_0x3229b1[_0x6fb4('0x1d')]],'as':_0x3229b1['as'],'attributes':_0x3229b1[_0x6fb4('0x1a')],'include':_0x3229b1[_0x6fb4('0x1e')]?_[_0x6fb4('0x1c')](_0x3229b1[_0x6fb4('0x1e')],function(_0x440a6c){return{'model':db[_0x440a6c['model']],'as':_0x440a6c['as'],'attributes':_0x440a6c[_0x6fb4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6fb4('0xa')](function(_0x434113){logger['info'](_0x6fb4('0x1f'),_0xf8dd14);logger[_0x6fb4('0xc')]('GetCmHopper',_0xf8dd14,JSON['stringify'](_0x434113));_0x4cafb8(_0x434113);})[_0x6fb4('0x14')](function(_0x1b53f1){logger[_0x6fb4('0xe')]('GetCmHopper',_0x1b53f1[_0x6fb4('0x11')],_0xf8dd14);_0xd13d44(_0x465b56[_0x6fb4('0xe')](0x1f4,_0x1b53f1[_0x6fb4('0x11')]));});});};exports[_0x6fb4('0x20')]=function(_0x3e7ae9){var _0x17d6c7=this;return new Promise(function(_0x8f121d,_0x4717d2){return db['CmHopper'][_0x6fb4('0x21')]({'raw':_0x3e7ae9['options']?_0x3e7ae9[_0x6fb4('0x17')][_0x6fb4('0x18')]===undefined?!![]:![]:!![],'where':_0x3e7ae9[_0x6fb4('0x17')]?_0x3e7ae9[_0x6fb4('0x17')][_0x6fb4('0x19')]||null:null,'attributes':_0x3e7ae9[_0x6fb4('0x17')]?_0x3e7ae9[_0x6fb4('0x17')]['attributes']||null:null,'include':_0x3e7ae9[_0x6fb4('0x17')]?_0x3e7ae9[_0x6fb4('0x17')][_0x6fb4('0x1e')]?_[_0x6fb4('0x1c')](_0x3e7ae9[_0x6fb4('0x17')][_0x6fb4('0x1e')],function(_0x44bd6f){return{'model':db[_0x44bd6f[_0x6fb4('0x1d')]],'as':_0x44bd6f['as'],'attributes':_0x44bd6f[_0x6fb4('0x1a')],'include':_0x44bd6f['include']?_[_0x6fb4('0x1c')](_0x44bd6f[_0x6fb4('0x1e')],function(_0x575cd8){return{'model':db[_0x575cd8[_0x6fb4('0x1d')]],'as':_0x575cd8['as'],'attributes':_0x575cd8['attributes'],'include':_0x575cd8[_0x6fb4('0x1e')]?_['map'](_0x575cd8[_0x6fb4('0x1e')],function(_0x3d1cda){return{'model':db[_0x3d1cda[_0x6fb4('0x1d')]],'as':_0x3d1cda['as'],'attributes':_0x3d1cda[_0x6fb4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6fb4('0xa')](function(_0x44563e){logger[_0x6fb4('0x12')]('ShowCmHopper',_0x3e7ae9);logger[_0x6fb4('0xc')](_0x6fb4('0x20'),_0x3e7ae9,JSON[_0x6fb4('0xd')](_0x44563e));_0x8f121d(_0x44563e);})[_0x6fb4('0x14')](function(_0x15b894){logger['error']('ShowCmHopper',_0x15b894['message'],_0x3e7ae9);_0x4717d2(_0x17d6c7[_0x6fb4('0xe')](0x1f4,_0x15b894[_0x6fb4('0x11')]));});});};exports[_0x6fb4('0x22')]=function(_0x360ecb){var _0x305fbc=this;return new Promise(function(_0x41b96b,_0x33e803){return db[_0x6fb4('0x15')]['create'](_0x360ecb[_0x6fb4('0x23')],{'raw':_0x360ecb['options']?_0x360ecb[_0x6fb4('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x6fb4('0xa')](function(_0x268c30){logger[_0x6fb4('0x12')](_0x6fb4('0x22'),_0x360ecb);logger[_0x6fb4('0xc')](_0x6fb4('0x22'),_0x360ecb,JSON[_0x6fb4('0xd')](_0x268c30));_0x41b96b(_0x268c30);})[_0x6fb4('0x14')](function(_0x15ac45){logger[_0x6fb4('0xe')](_0x6fb4('0x22'),_0x15ac45[_0x6fb4('0x11')],_0x360ecb);_0x33e803(_0x305fbc[_0x6fb4('0xe')](0x1f4,_0x15ac45['message']));});});};exports[_0x6fb4('0x24')]=function(_0x59d719){var _0x407bbb=this;return new Promise(function(_0x453423,_0x5c51b9){return db[_0x6fb4('0x15')]['update'](_0x59d719[_0x6fb4('0x23')],{'raw':_0x59d719[_0x6fb4('0x17')]?_0x59d719[_0x6fb4('0x17')][_0x6fb4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59d719[_0x6fb4('0x17')]?_0x59d719[_0x6fb4('0x17')][_0x6fb4('0x19')]||null:null,'attributes':_0x59d719['options']?_0x59d719['options'][_0x6fb4('0x1a')]||null:null,'limit':_0x59d719[_0x6fb4('0x17')]?_0x59d719[_0x6fb4('0x17')][_0x6fb4('0x1b')]||null:null})[_0x6fb4('0xa')](function(_0x1160a5){logger[_0x6fb4('0x12')](_0x6fb4('0x24'),_0x59d719);logger[_0x6fb4('0xc')](_0x6fb4('0x24'),_0x59d719,JSON[_0x6fb4('0xd')](_0x1160a5));_0x453423(_0x1160a5);})['catch'](function(_0x1ba211){logger[_0x6fb4('0xe')](_0x6fb4('0x24'),_0x1ba211['message'],_0x59d719);_0x5c51b9(_0x407bbb[_0x6fb4('0xe')](0x1f4,_0x1ba211[_0x6fb4('0x11')]));});});};exports[_0x6fb4('0x25')]=function(_0x22b0e8){var _0x1e135d=this;return new Promise(function(_0x56922f,_0x544c27){return db[_0x6fb4('0x15')][_0x6fb4('0x26')]({'where':_0x22b0e8[_0x6fb4('0x17')]?_0x22b0e8[_0x6fb4('0x17')][_0x6fb4('0x19')]||null:null})[_0x6fb4('0xa')](function(_0x34667b){logger['info']('DestroyCmHopper',_0x22b0e8);logger[_0x6fb4('0xc')](_0x6fb4('0x25'),_0x22b0e8,JSON[_0x6fb4('0xd')](_0x34667b));_0x56922f(_0x34667b);})[_0x6fb4('0x14')](function(_0x34e10f){logger[_0x6fb4('0xe')](_0x6fb4('0x25'),_0x34e10f['message'],_0x22b0e8);_0x544c27(_0x1e135d[_0x6fb4('0xe')](0x1f4,_0x34e10f[_0x6fb4('0x11')]));});});};exports[_0x6fb4('0x27')]=function(_0x5b9658){var _0x591019=this;return new Promise(function(_0x2a115,_0x280ac0){return db[_0x6fb4('0x28')][_0x6fb4('0x29')]()[_0x6fb4('0xa')](function(_0x5d58d7){return db[_0x6fb4('0x2a')][_0x6fb4('0x2b')](function(_0x21e2e7){return db[_0x6fb4('0x15')][_0x6fb4('0x16')]({'where':_0x5b9658[_0x6fb4('0x17')]?_0x5b9658['options'][_0x6fb4('0x19')]||null:null,'attributes':_0x5b9658[_0x6fb4('0x17')]?_0x5b9658['options'][_0x6fb4('0x1a')]||null:null,'limit':_0x5b9658[_0x6fb4('0x17')]?_0x5b9658[_0x6fb4('0x17')][_0x6fb4('0x1b')]||null:null,'order':_0x5b9658[_0x6fb4('0x17')]?_0x5b9658[_0x6fb4('0x17')]['order']||null:null,'transaction':_0x21e2e7,'lock':_0x21e2e7['LOCK'][_0x6fb4('0x2c')],'include':[{'model':db[_0x6fb4('0x28')],'as':_0x6fb4('0x2d'),'attributes':_[_0x6fb4('0x2e')](_0x5d58d7)},{'model':db[_0x6fb4('0x2f')],'as':_0x6fb4('0x30'),'attributes':['id',_0x6fb4('0x31'),_0x6fb4('0x32')]}]})['then'](function(_0x206831){var _0x5091a1=[];var _0x23c448=[];for(var _0x13e647=0x0;_0x13e647<_0x206831['length'];_0x13e647+=0x1){var _0x4cb48a=_0x206831[_0x13e647][_0x6fb4('0x33')];if(_0x4cb48a===null){_0x5091a1[_0x6fb4('0x34')](_0x206831[_0x13e647][_0x6fb4('0x35')](_0x5b9658[_0x6fb4('0x23')],{'transaction':_0x21e2e7}));}else if(!_0x23c448['includes'](_0x4cb48a)){_0x23c448[_0x6fb4('0x34')](_0x4cb48a);_0x5091a1[_0x6fb4('0x34')](_0x206831[_0x13e647]['update'](_0x5b9658[_0x6fb4('0x23')],{'transaction':_0x21e2e7}));}}return BPromise[_0x6fb4('0x36')](_0x5091a1);});})[_0x6fb4('0xa')](function(_0x36f39b){logger['info'](_0x6fb4('0x27'),_0x5b9658);logger[_0x6fb4('0xc')](_0x6fb4('0x27'),_0x5b9658,JSON['stringify'](_0x36f39b));_0x2a115(_0x36f39b);})[_0x6fb4('0x14')](function(_0x496799){logger[_0x6fb4('0xe')](_0x6fb4('0x27'),_0x496799[_0x6fb4('0x11')],_0x5b9658);_0x280ac0(_0x591019[_0x6fb4('0xe')](0x1f4,_0x496799[_0x6fb4('0x11')]));});});});};exports[_0x6fb4('0x37')]=function(_0x1bf290){var _0x39367b=this;return new Promise(function(_0x3a14d9,_0x1aa849){return db['sequelize'][_0x6fb4('0x2b')](function(_0x5409ba){return db[_0x6fb4('0x38')][_0x6fb4('0x39')](_0x1bf290['body'],{'raw':_0x1bf290[_0x6fb4('0x17')]?_0x1bf290[_0x6fb4('0x17')]['raw']===undefined?!![]:![]:!![],'transaction':_0x5409ba})[_0x6fb4('0xa')](function(){return db[_0x6fb4('0x15')][_0x6fb4('0x26')]({'where':_0x1bf290['options']?_0x1bf290[_0x6fb4('0x17')][_0x6fb4('0x19')]||null:null,'transaction':_0x5409ba});});})[_0x6fb4('0xa')](function(_0x5df274){logger['info'](_0x6fb4('0x37'),_0x1bf290);logger['debug'](_0x6fb4('0x37'),_0x1bf290,JSON['stringify'](_0x5df274));_0x3a14d9(_0x5df274);})[_0x6fb4('0x14')](function(_0x5daead){logger['error'](_0x6fb4('0x37'),_0x5daead[_0x6fb4('0x11')],_0x1bf290);_0x1aa849(_0x39367b[_0x6fb4('0xe')](0x1f4,_0x5daead[_0x6fb4('0x11')]));});});};exports[_0x6fb4('0x3a')]=function(_0x2dc0f5){var _0x4303f7=this;return new Promise(function(_0x264a7,_0x5633b5){return db['CmHopper'][_0x6fb4('0x16')]({'raw':_0x2dc0f5[_0x6fb4('0x17')]?_0x2dc0f5['options'][_0x6fb4('0x18')]===undefined?!![]:![]:!![],'where':_0x2dc0f5['options']?_0x2dc0f5[_0x6fb4('0x17')][_0x6fb4('0x19')]||null:null,'attributes':[[db[_0x6fb4('0x2a')]['fn'](_0x6fb4('0x3b'),db[_0x6fb4('0x2a')]['fn']('IF',db[_0x6fb4('0x2a')][_0x6fb4('0x3c')]('`scheduledat`\x20>=\x20'+util['format'](_0x6fb4('0x3d'),moment()[_0x6fb4('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x6fb4('0x3f')))),_0x6fb4('0x40')]]})[_0x6fb4('0xa')](function(_0x5b0d82){logger[_0x6fb4('0x12')](_0x6fb4('0x3a'),_0x2dc0f5);logger[_0x6fb4('0xc')](_0x6fb4('0x3a'),_0x2dc0f5,JSON[_0x6fb4('0xd')](_0x5b0d82));_0x264a7(_0x5b0d82);})[_0x6fb4('0x14')](function(_0x34793c){logger['error']('CountReScheduled',_0x34793c['message'],_0x2dc0f5);_0x5633b5(_0x4303f7[_0x6fb4('0xe')](0x1f4,_0x34793c[_0x6fb4('0x11')]));});});};exports[_0x6fb4('0x41')]=function(_0x1e043e){var _0x4508f9=this;return new Promise(function(_0x9d082d,_0x13ec3b){return db[_0x6fb4('0x28')][_0x6fb4('0x29')]()[_0x6fb4('0xa')](function(_0xb9f151){return db[_0x6fb4('0x2a')][_0x6fb4('0x2b')](function(_0x4ccecd){return db[_0x6fb4('0x15')]['findAll']({'where':_0x1e043e['options']?_0x1e043e[_0x6fb4('0x17')][_0x6fb4('0x19')]||null:null,'attributes':_0x1e043e[_0x6fb4('0x17')]?_0x1e043e['options'][_0x6fb4('0x1a')]||null:null,'limit':0x1,'order':_0x1e043e[_0x6fb4('0x17')]?_0x1e043e[_0x6fb4('0x17')][_0x6fb4('0x42')]||null:null,'group':db[_0x6fb4('0x15')]['UserId'],'transaction':_0x4ccecd,'lock':_0x4ccecd[_0x6fb4('0x43')][_0x6fb4('0x2c')],'include':_0x1e043e[_0x6fb4('0x17')]?_0x1e043e[_0x6fb4('0x17')][_0x6fb4('0x1e')]?_['map'](_0x1e043e[_0x6fb4('0x17')][_0x6fb4('0x1e')],function(_0x22efbb){return{'model':db[_0x22efbb[_0x6fb4('0x1d')]],'as':_0x22efbb['as'],'attributes':_0x22efbb[_0x6fb4('0x1a')],'include':_0x22efbb[_0x6fb4('0x1e')]?_[_0x6fb4('0x1c')](_0x22efbb[_0x6fb4('0x1e')],function(_0x53a45b){return{'model':db[_0x53a45b[_0x6fb4('0x1d')]],'as':_0x53a45b['as'],'attributes':_0x53a45b[_0x6fb4('0x1a')],'include':_0x53a45b['include']?_[_0x6fb4('0x1c')](_0x53a45b[_0x6fb4('0x1e')],function(_0x25e3ab){return{'model':db[_0x25e3ab[_0x6fb4('0x1d')]],'as':_0x25e3ab['as'],'attributes':_0x25e3ab[_0x6fb4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6fb4('0xa')](function(_0x43ed76){var _0x2a6edb=[];for(var _0x4e4546=0x0;_0x4e4546<_0x43ed76[_0x6fb4('0x44')];_0x4e4546+=0x1){_0x2a6edb[_0x6fb4('0x34')](_0x43ed76[_0x4e4546]['update'](_0x1e043e[_0x6fb4('0x23')],{'transaction':_0x4ccecd}));}return BPromise[_0x6fb4('0x36')](_0x2a6edb);});})[_0x6fb4('0xa')](function(_0x3dc1ab){logger['info'](_0x6fb4('0x41'),_0x1e043e);logger[_0x6fb4('0xc')](_0x6fb4('0x41'),_0x1e043e,JSON[_0x6fb4('0xd')](_0x3dc1ab));_0x9d082d(_0x3dc1ab);})['catch'](function(_0x1f8551){logger[_0x6fb4('0xe')](_0x6fb4('0x41'),_0x1f8551[_0x6fb4('0x11')],_0x1e043e);_0x13ec3b(_0x4508f9['error'](0x1f4,_0x1f8551['message']));});});});};exports['GetCmHopperPreview']=function(_0x584b88){var _0x3306ed=this;return new Promise(function(_0x557365,_0x10184e){db['CmContact'][_0x6fb4('0x29')]()[_0x6fb4('0xa')](function(_0x5d9e2a){return db[_0x6fb4('0x15')][_0x6fb4('0x16')]({'raw':_0x584b88['options']?_0x584b88['options'][_0x6fb4('0x18')]===undefined?!![]:![]:!![],'where':_0x584b88[_0x6fb4('0x17')]?_0x584b88['options'][_0x6fb4('0x19')]||null:null,'attributes':_0x584b88[_0x6fb4('0x17')]?_0x584b88[_0x6fb4('0x17')]['attributes']||null:null,'limit':_0x584b88[_0x6fb4('0x17')]?_0x584b88[_0x6fb4('0x17')][_0x6fb4('0x1b')]||null:null,'include':_0x584b88[_0x6fb4('0x17')]?_0x584b88[_0x6fb4('0x17')][_0x6fb4('0x1e')]?_['map'](_0x584b88[_0x6fb4('0x17')][_0x6fb4('0x1e')],function(_0x4220d4){return{'model':db[_0x4220d4[_0x6fb4('0x1d')]],'as':_0x4220d4['as'],'attributes':_0x4220d4['as']===_0x6fb4('0x2d')?_['keys'](_0x5d9e2a):_0x4220d4[_0x6fb4('0x1a')],'include':_0x4220d4[_0x6fb4('0x1e')]?_[_0x6fb4('0x1c')](_0x4220d4[_0x6fb4('0x1e')],function(_0x3151ef){return{'model':db[_0x3151ef[_0x6fb4('0x1d')]],'as':_0x3151ef['as'],'attributes':_0x3151ef[_0x6fb4('0x1a')],'include':_0x3151ef[_0x6fb4('0x1e')]?_[_0x6fb4('0x1c')](_0x3151ef[_0x6fb4('0x1e')],function(_0x19ec9d){return{'model':db[_0x19ec9d[_0x6fb4('0x1d')]],'as':_0x19ec9d['as'],'attributes':_0x19ec9d[_0x6fb4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6fb4('0xa')](function(_0x164f2a){logger['info'](_0x6fb4('0x1f'),_0x584b88);logger[_0x6fb4('0xc')](_0x6fb4('0x1f'),_0x584b88,JSON[_0x6fb4('0xd')](_0x164f2a));_0x557365(_0x164f2a);})[_0x6fb4('0x14')](function(_0xaf3221){logger['error'](_0x6fb4('0x1f'),_0xaf3221[_0x6fb4('0x11')],_0x584b88);_0x10184e(_0x3306ed[_0x6fb4('0xe')](0x1f4,_0xaf3221[_0x6fb4('0x11')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 6dae06d..7783000 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 _0xe33f=['util','path','express','../../config/environment','./cmHopper.controller','get','isAuthenticated','/describe','describe','getOpenContacts','show','post','create','/preview','getPreview','put','/:id','update','delete','destroy','exports','multer'];(function(_0xf8f75a,_0x543004){var _0x7cccdc=function(_0xb5df66){while(--_0xb5df66){_0xf8f75a['push'](_0xf8f75a['shift']());}};_0x7cccdc(++_0x543004);}(_0xe33f,0x1e3));var _0xfe33=function(_0x5a71fc,_0x2e6190){_0x5a71fc=_0x5a71fc-0x0;var _0x295d6e=_0xe33f[_0x5a71fc];return _0x295d6e;};'use strict';var multer=require(_0xfe33('0x0'));var util=require(_0xfe33('0x1'));var path=require(_0xfe33('0x2'));var timeout=require('connect-timeout');var express=require(_0xfe33('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfe33('0x4'));var controller=require(_0xfe33('0x5'));router[_0xfe33('0x6')]('/',auth[_0xfe33('0x7')](),controller['index']);router[_0xfe33('0x6')](_0xfe33('0x8'),auth['isAuthenticated'](),controller[_0xfe33('0x9')]);router['get']('/opencontacts',auth[_0xfe33('0x7')](),controller[_0xfe33('0xa')]);router[_0xfe33('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xfe33('0xb')]);router[_0xfe33('0xc')]('/',auth['isAuthenticated'](),controller[_0xfe33('0xd')]);router[_0xfe33('0xc')](_0xfe33('0xe'),auth[_0xfe33('0x7')](),controller[_0xfe33('0xf')]);router[_0xfe33('0x10')](_0xfe33('0x11'),auth['isAuthenticated'](),controller[_0xfe33('0x12')]);router[_0xfe33('0x13')](_0xfe33('0x11'),auth['isAuthenticated'](),controller[_0xfe33('0x14')]);module[_0xfe33('0x15')]=router; \ No newline at end of file +var _0x73bd=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','show','post','create','/preview','getPreview','put','update','delete','/:id','exports','multer'];(function(_0x2762ce,_0x4505a0){var _0x444b75=function(_0xad562a){while(--_0xad562a){_0x2762ce['push'](_0x2762ce['shift']());}};_0x444b75(++_0x4505a0);}(_0x73bd,0xf9));var _0xd73b=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x73bd[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xd73b('0x0'));var util=require(_0xd73b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd73b('0x2'));var router=express[_0xd73b('0x3')]();var fs_extra=require(_0xd73b('0x4'));var auth=require(_0xd73b('0x5'));var interaction=require(_0xd73b('0x6'));var config=require(_0xd73b('0x7'));var controller=require(_0xd73b('0x8'));router[_0xd73b('0x9')]('/',auth[_0xd73b('0xa')](),controller[_0xd73b('0xb')]);router['get'](_0xd73b('0xc'),auth[_0xd73b('0xa')](),controller[_0xd73b('0xd')]);router[_0xd73b('0x9')](_0xd73b('0xe'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0xd73b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd73b('0xf')]);router[_0xd73b('0x10')]('/',auth[_0xd73b('0xa')](),controller[_0xd73b('0x11')]);router[_0xd73b('0x10')](_0xd73b('0x12'),auth[_0xd73b('0xa')](),controller[_0xd73b('0x13')]);router[_0xd73b('0x14')]('/:id',auth[_0xd73b('0xa')](),controller[_0xd73b('0x15')]);router[_0xd73b('0x16')](_0xd73b('0x17'),auth[_0xd73b('0xa')](),controller['destroy']);module[_0xd73b('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 275cfcf..d25e0b9 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2892=['STRING','INTEGER','DATE','YYYY-MM-DD\x20HH:mm:ss','exports'];(function(_0x3de7e0,_0x28cbff){var _0x11d0b3=function(_0xd95412){while(--_0xd95412){_0x3de7e0['push'](_0x3de7e0['shift']());}};_0x11d0b3(++_0x28cbff);}(_0x2892,0x11c));var _0x2289=function(_0x729acc,_0x4af909){_0x729acc=_0x729acc-0x0;var _0x282b47=_0x2892[_0x729acc];return _0x282b47;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x2289('0x0')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x2289('0x1')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x2289('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x2289('0x3')],'defaultValue':moment()['format'](_0x2289('0x4'))},'countbusyretry':{'type':Sequelize[_0x2289('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2289('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2289('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x2289('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2289('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2289('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2289('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdde4=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','STRING','INTEGER'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xdde4,0xdb));var _0x4dde=function(_0x20724c,_0x2c72cc){_0x20724c=_0x20724c-0x0;var _0x50fe4c=_0xdde4[_0x20724c];return _0x50fe4c;};'use strict';var moment=require(_0x4dde('0x0'));var Sequelize=require(_0x4dde('0x1'));module[_0x4dde('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x4dde('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x4dde('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x4dde('0x5')],'defaultValue':moment()[_0x4dde('0x6')](_0x4dde('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4dde('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4dde('0x4')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x4dde('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4dde('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4dde('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4dde('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4dde('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 67cadae..6bd60f0 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c3d=['where','includeAll','include','findAll','show','params','length','options','find','catch','create','body','user','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','sendStatus','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','merge','VIRTUAL'];(function(_0x2b883c,_0x266b94){var _0x522203=function(_0x57e1b8){while(--_0x57e1b8){_0x2b883c['push'](_0x2b883c['shift']());}};_0x522203(++_0x266b94);}(_0x1c3d,0x68));var _0xd1c3=function(_0x2c87b3,_0x25d3df){_0x2c87b3=_0x2c87b3-0x0;var _0x32f2e6=_0x1c3d[_0x2c87b3];return _0x32f2e6;};'use strict';var emlformat=require(_0xd1c3('0x0'));var rimraf=require(_0xd1c3('0x1'));var zipdir=require(_0xd1c3('0x2'));var jsonpatch=require(_0xd1c3('0x3'));var rp=require(_0xd1c3('0x4'));var moment=require('moment');var BPromise=require(_0xd1c3('0x5'));var Mustache=require(_0xd1c3('0x6'));var util=require(_0xd1c3('0x7'));var path=require(_0xd1c3('0x8'));var sox=require(_0xd1c3('0x9'));var csv=require(_0xd1c3('0xa'));var ejs=require(_0xd1c3('0xb'));var fs=require('fs');var fs_extra=require(_0xd1c3('0xc'));var _=require(_0xd1c3('0xd'));var squel=require(_0xd1c3('0xe'));var crypto=require(_0xd1c3('0xf'));var jsforce=require(_0xd1c3('0x10'));var deskjs=require(_0xd1c3('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd1c3('0x12'));var Papa=require(_0xd1c3('0x13'));var Redis=require(_0xd1c3('0x14'));var authService=require(_0xd1c3('0x15'));var qs=require(_0xd1c3('0x16'));var as=require(_0xd1c3('0x17'));var hardwareService=require(_0xd1c3('0x18'));var logger=require(_0xd1c3('0x19'))(_0xd1c3('0x1a'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3889f4,_0x38cd87){_0x38cd87=_0x38cd87||0xcc;return function(_0x5c2e99){if(_0x5c2e99){return _0x3889f4['sendStatus'](_0x38cd87);}return _0x3889f4['status'](_0x38cd87)[_0xd1c3('0x1b')]();};}function respondWithResult(_0x3e9ff0,_0x47cf3d){_0x47cf3d=_0x47cf3d||0xc8;return function(_0x413257){if(_0x413257){return _0x3e9ff0[_0xd1c3('0x1c')](_0x47cf3d)[_0xd1c3('0x1d')](_0x413257);}};}function respondWithFilteredResult(_0x1716f7,_0x5aaeea){return function(_0x51ab1a){if(_0x51ab1a){var _0xd839c3=typeof _0x5aaeea[_0xd1c3('0x1e')]==='undefined'&&typeof _0x5aaeea['limit']===_0xd1c3('0x1f');var _0x3b07ca=_0x51ab1a[_0xd1c3('0x20')];var _0x4cfdee=_0xd839c3?0x0:_0x5aaeea['offset'];var _0x474791=_0xd839c3?_0x51ab1a[_0xd1c3('0x20')]:_0x5aaeea[_0xd1c3('0x1e')]+_0x5aaeea[_0xd1c3('0x21')];var _0x4054a0;if(_0x474791>=_0x3b07ca){_0x474791=_0x3b07ca;_0x4054a0=0xc8;}else{_0x4054a0=0xce;}_0x1716f7[_0xd1c3('0x1c')](_0x4054a0);return _0x1716f7[_0xd1c3('0x22')](_0xd1c3('0x23'),_0x4cfdee+'-'+_0x474791+'/'+_0x3b07ca)[_0xd1c3('0x1d')](_0x51ab1a);}return null;};}function patchUpdates(_0x301b0e){return function(_0x42a12e){try{jsonpatch[_0xd1c3('0x24')](_0x42a12e,_0x301b0e,!![]);}catch(_0x2fef09){return BPromise[_0xd1c3('0x25')](_0x2fef09);}return _0x42a12e[_0xd1c3('0x26')]();};}function saveUpdates(_0x3f1f2b,_0x3f19f0){return function(_0x3ee91b){if(_0x3ee91b){return _0x3ee91b[_0xd1c3('0x27')](_0x3f1f2b)[_0xd1c3('0x28')](function(_0x2c1ae4){return _0x2c1ae4;});}return null;};}function removeEntity(_0x1fe705,_0xdf6074){return function(_0x56bbd1){if(_0x56bbd1){return _0x56bbd1['destroy']()[_0xd1c3('0x28')](function(){var _0x953158=_0x56bbd1[_0xd1c3('0x29')]({'plain':!![]});var _0x3fea9c='CmHopperAdditionalPhones';return db['UserProfileResource']['destroy']({'where':{'type':_0x3fea9c,'resourceId':_0x953158['id']}})[_0xd1c3('0x28')](function(){return _0x56bbd1;});})[_0xd1c3('0x28')](function(){_0x1fe705['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cf210,_0x16d755){return function(_0x1dca36){if(!_0x1dca36){_0x4cf210[_0xd1c3('0x2a')](0x194);}return _0x1dca36;};}function handleError(_0xe35b76,_0x5b54b8){_0x5b54b8=_0x5b54b8||0x1f4;return function(_0x40d896){logger[_0xd1c3('0x2b')](_0x40d896[_0xd1c3('0x2c')]);if(_0x40d896[_0xd1c3('0x2d')]){delete _0x40d896[_0xd1c3('0x2d')];}_0xe35b76[_0xd1c3('0x1c')](_0x5b54b8)[_0xd1c3('0x2e')](_0x40d896);};}exports[_0xd1c3('0x2f')]=function(_0x2d0ca1,_0x26b98e){var _0x5a9635={},_0x1e6f2c={},_0x10530a={'count':0x0,'rows':[]};var _0x5b74c9=_[_0xd1c3('0x30')](db[_0xd1c3('0x31')][_0xd1c3('0x32')],function(_0x37a393){return{'name':_0x37a393[_0xd1c3('0x33')],'type':_0x37a393[_0xd1c3('0x34')][_0xd1c3('0x35')]};});_0x1e6f2c[_0xd1c3('0x36')]=_[_0xd1c3('0x30')](_0x5b74c9,'name');_0x1e6f2c[_0xd1c3('0x37')]=_[_0xd1c3('0x38')](_0x2d0ca1[_0xd1c3('0x37')]);_0x1e6f2c[_0xd1c3('0x39')]=_[_0xd1c3('0x3a')](_0x1e6f2c[_0xd1c3('0x36')],_0x1e6f2c['query']);_0x5a9635['attributes']=_[_0xd1c3('0x3a')](_0x1e6f2c[_0xd1c3('0x36')],qs[_0xd1c3('0x3b')](_0x2d0ca1['query']['fields']));_0x5a9635[_0xd1c3('0x3c')]=_0x5a9635[_0xd1c3('0x3c')]['length']?_0x5a9635[_0xd1c3('0x3c')]:_0x1e6f2c[_0xd1c3('0x36')];if(!_0x2d0ca1[_0xd1c3('0x37')][_0xd1c3('0x3d')]('nolimit')){_0x5a9635[_0xd1c3('0x21')]=qs[_0xd1c3('0x21')](_0x2d0ca1['query'][_0xd1c3('0x21')]);_0x5a9635[_0xd1c3('0x1e')]=qs[_0xd1c3('0x1e')](_0x2d0ca1['query']['offset']);}_0x5a9635['order']=qs[_0xd1c3('0x3e')](_0x2d0ca1['query'][_0xd1c3('0x3e')]);_0x5a9635['where']=qs[_0xd1c3('0x39')](_[_0xd1c3('0x3f')](_0x2d0ca1[_0xd1c3('0x37')],_0x1e6f2c[_0xd1c3('0x39')]),_0x5b74c9);if(_0x2d0ca1[_0xd1c3('0x37')]['filter']){_0x5a9635['where']=_[_0xd1c3('0x40')](_0x5a9635['where'],{'$or':_[_0xd1c3('0x30')](_0x5b74c9,function(_0x11b46e){if(_0x11b46e[_0xd1c3('0x34')]!==_0xd1c3('0x41')){var _0x46f0ff={};_0x46f0ff[_0x11b46e['name']]={'$like':'%'+_0x2d0ca1[_0xd1c3('0x37')]['filter']+'%'};return _0x46f0ff;}})});}_0x5a9635=_[_0xd1c3('0x40')]({},_0x5a9635,_0x2d0ca1['options']);var _0x5d29aa={'where':_0x5a9635[_0xd1c3('0x42')]};return db['CmHopperAdditionalPhone'][_0xd1c3('0x20')](_0x5d29aa)[_0xd1c3('0x28')](function(_0x40588c){_0x10530a[_0xd1c3('0x20')]=_0x40588c;if(_0x2d0ca1[_0xd1c3('0x37')][_0xd1c3('0x43')]){_0x5a9635[_0xd1c3('0x44')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0xd1c3('0x45')](_0x5a9635);})[_0xd1c3('0x28')](function(_0x183075){_0x10530a['rows']=_0x183075;return _0x10530a;})[_0xd1c3('0x28')](respondWithFilteredResult(_0x26b98e,_0x5a9635))['catch'](handleError(_0x26b98e,null));};exports[_0xd1c3('0x46')]=function(_0x430e4c,_0x54a288){var _0x273f46={'raw':!![],'where':{'id':_0x430e4c[_0xd1c3('0x47')]['id']}},_0x349807={};_0x349807[_0xd1c3('0x36')]=_[_0xd1c3('0x38')](db[_0xd1c3('0x31')][_0xd1c3('0x32')]);_0x349807[_0xd1c3('0x37')]=_[_0xd1c3('0x38')](_0x430e4c[_0xd1c3('0x37')]);_0x349807[_0xd1c3('0x39')]=_[_0xd1c3('0x3a')](_0x349807[_0xd1c3('0x36')],_0x349807['query']);_0x273f46['attributes']=_[_0xd1c3('0x3a')](_0x349807[_0xd1c3('0x36')],qs[_0xd1c3('0x3b')](_0x430e4c[_0xd1c3('0x37')]['fields']));_0x273f46[_0xd1c3('0x3c')]=_0x273f46[_0xd1c3('0x3c')][_0xd1c3('0x48')]?_0x273f46[_0xd1c3('0x3c')]:_0x349807[_0xd1c3('0x36')];if(_0x430e4c[_0xd1c3('0x37')]['includeAll']){_0x273f46['include']=[{'all':!![]}];}_0x273f46=_[_0xd1c3('0x40')]({},_0x273f46,_0x430e4c[_0xd1c3('0x49')]);return db['CmHopperAdditionalPhone'][_0xd1c3('0x4a')](_0x273f46)[_0xd1c3('0x28')](handleEntityNotFound(_0x54a288,null))[_0xd1c3('0x28')](respondWithResult(_0x54a288,null))[_0xd1c3('0x4b')](handleError(_0x54a288,null));};exports[_0xd1c3('0x4c')]=function(_0x1f939e,_0x590dd6){return db[_0xd1c3('0x31')][_0xd1c3('0x4c')](_0x1f939e[_0xd1c3('0x4d')],{})['then'](function(_0x44af87){var _0x21599b=_0x1f939e[_0xd1c3('0x4e')]['get']({'plain':!![]});if(!_0x21599b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21599b['role']===_0xd1c3('0x4e')){var _0x9a72e1=_0x44af87[_0xd1c3('0x29')]({'plain':!![]});var _0x295b7e=_0xd1c3('0x4f');return db[_0xd1c3('0x50')][_0xd1c3('0x4a')]({'where':{'name':_0x295b7e,'userProfileId':_0x21599b[_0xd1c3('0x51')]},'raw':!![]})['then'](function(_0x3c0e3a){if(_0x3c0e3a&&_0x3c0e3a[_0xd1c3('0x52')]===0x0){return db[_0xd1c3('0x53')][_0xd1c3('0x4c')]({'name':_0x9a72e1[_0xd1c3('0x2d')],'resourceId':_0x9a72e1['id'],'type':_0x3c0e3a['name'],'sectionId':_0x3c0e3a['id']},{})['then'](function(){return _0x44af87;});}else{return _0x44af87;}})[_0xd1c3('0x4b')](function(_0x2ff49b){logger[_0xd1c3('0x2b')](_0xd1c3('0x54'),_0x2ff49b);throw _0x2ff49b;});}return _0x44af87;})['then'](respondWithResult(_0x590dd6,0xc9))[_0xd1c3('0x4b')](handleError(_0x590dd6,null));};exports[_0xd1c3('0x27')]=function(_0x1687d0,_0x15451a){if(_0x1687d0[_0xd1c3('0x4d')]['id']){delete _0x1687d0[_0xd1c3('0x4d')]['id'];}return db[_0xd1c3('0x31')][_0xd1c3('0x4a')]({'where':{'id':_0x1687d0['params']['id']}})[_0xd1c3('0x28')](handleEntityNotFound(_0x15451a,null))[_0xd1c3('0x28')](saveUpdates(_0x1687d0[_0xd1c3('0x4d')],null))['then'](respondWithResult(_0x15451a,null))['catch'](handleError(_0x15451a,null));};exports['destroy']=function(_0xa46040,_0x55eaf0){return db[_0xd1c3('0x31')][_0xd1c3('0x4a')]({'where':{'id':_0xa46040['params']['id']}})[_0xd1c3('0x28')](handleEntityNotFound(_0x55eaf0,null))[_0xd1c3('0x28')](removeEntity(_0x55eaf0,null))['catch'](handleError(_0x55eaf0,null));}; \ No newline at end of file +var _0x0eb2=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','error','name','CmHopperAdditionalPhone'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0eb2,0x11c));var _0x20eb=function(_0x3a00cb,_0x407ba5){_0x3a00cb=_0x3a00cb-0x0;var _0x2cf4c2=_0x0eb2[_0x3a00cb];return _0x2cf4c2;};'use strict';var emlformat=require(_0x20eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x20eb('0x1'));var jsonpatch=require(_0x20eb('0x2'));var rp=require(_0x20eb('0x3'));var moment=require(_0x20eb('0x4'));var BPromise=require(_0x20eb('0x5'));var Mustache=require('mustache');var util=require(_0x20eb('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x20eb('0x7'));var fs=require('fs');var fs_extra=require(_0x20eb('0x8'));var _=require(_0x20eb('0x9'));var squel=require('squel');var crypto=require(_0x20eb('0xa'));var jsforce=require(_0x20eb('0xb'));var deskjs=require(_0x20eb('0xc'));var toCsv=require(_0x20eb('0xd'));var querystring=require(_0x20eb('0xe'));var Papa=require(_0x20eb('0xf'));var Redis=require(_0x20eb('0x10'));var authService=require(_0x20eb('0x11'));var qs=require(_0x20eb('0x12'));var as=require(_0x20eb('0x13'));var hardwareService=require(_0x20eb('0x14'));var logger=require(_0x20eb('0x15'))(_0x20eb('0x16'));var utils=require(_0x20eb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x20eb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x120651,_0x5371a8){_0x5371a8=_0x5371a8||0xcc;return function(_0x2ffef9){if(_0x2ffef9){return _0x120651[_0x20eb('0x19')](_0x5371a8);}return _0x120651[_0x20eb('0x1a')](_0x5371a8)[_0x20eb('0x1b')]();};}function respondWithResult(_0xfee98d,_0xa548eb){_0xa548eb=_0xa548eb||0xc8;return function(_0x4160b2){if(_0x4160b2){return _0xfee98d[_0x20eb('0x1a')](_0xa548eb)[_0x20eb('0x1c')](_0x4160b2);}};}function respondWithFilteredResult(_0x45473f,_0x155545){return function(_0x11b1cc){if(_0x11b1cc){var _0x150704=typeof _0x155545[_0x20eb('0x1d')]===_0x20eb('0x1e')&&typeof _0x155545['limit']===_0x20eb('0x1e');var _0x579270=_0x11b1cc[_0x20eb('0x1f')];var _0x21765e=_0x150704?0x0:_0x155545[_0x20eb('0x1d')];var _0x3c083a=_0x150704?_0x11b1cc[_0x20eb('0x1f')]:_0x155545[_0x20eb('0x1d')]+_0x155545[_0x20eb('0x20')];var _0x51eb8d;if(_0x3c083a>=_0x579270){_0x3c083a=_0x579270;_0x51eb8d=0xc8;}else{_0x51eb8d=0xce;}_0x45473f[_0x20eb('0x1a')](_0x51eb8d);return _0x45473f[_0x20eb('0x21')]('Content-Range',_0x21765e+'-'+_0x3c083a+'/'+_0x579270)[_0x20eb('0x1c')](_0x11b1cc);}return null;};}function patchUpdates(_0x3eb2be){return function(_0x5d5d8d){try{jsonpatch[_0x20eb('0x22')](_0x5d5d8d,_0x3eb2be,!![]);}catch(_0x1c7853){return BPromise[_0x20eb('0x23')](_0x1c7853);}return _0x5d5d8d['save']();};}function saveUpdates(_0x989b4,_0x258a64){return function(_0x431f82){if(_0x431f82){return _0x431f82['update'](_0x989b4)[_0x20eb('0x24')](function(_0x15bac3){return _0x15bac3;});}return null;};}function removeEntity(_0x22350d,_0x5dc978){return function(_0x2a1b56){if(_0x2a1b56){return _0x2a1b56['destroy']()[_0x20eb('0x24')](function(){var _0x363ece=_0x2a1b56[_0x20eb('0x25')]({'plain':!![]});var _0x3b88b3=_0x20eb('0x26');return db[_0x20eb('0x27')][_0x20eb('0x28')]({'where':{'type':_0x3b88b3,'resourceId':_0x363ece['id']}})[_0x20eb('0x24')](function(){return _0x2a1b56;});})[_0x20eb('0x24')](function(){_0x22350d['status'](0xcc)[_0x20eb('0x1b')]();});}};}function handleEntityNotFound(_0x33a365,_0x25a523){return function(_0x5117c7){if(!_0x5117c7){_0x33a365['sendStatus'](0x194);}return _0x5117c7;};}function handleError(_0x5ef0b0,_0x55f1e8){_0x55f1e8=_0x55f1e8||0x1f4;return function(_0x42455f){logger[_0x20eb('0x29')](_0x42455f['stack']);if(_0x42455f[_0x20eb('0x2a')]){delete _0x42455f['name'];}_0x5ef0b0[_0x20eb('0x1a')](_0x55f1e8)['send'](_0x42455f);};}exports['index']=function(_0x125a23,_0x3999ec){var _0x4fb803={},_0x5abe40={},_0xfa014d={'count':0x0,'rows':[]};var _0x3ae2b0=_['map'](db[_0x20eb('0x2b')][_0x20eb('0x2c')],function(_0x58e0b5){return{'name':_0x58e0b5[_0x20eb('0x2d')],'type':_0x58e0b5[_0x20eb('0x2e')]['key']};});_0x5abe40[_0x20eb('0x2f')]=_['map'](_0x3ae2b0,_0x20eb('0x2a'));_0x5abe40[_0x20eb('0x30')]=_[_0x20eb('0x31')](_0x125a23['query']);_0x5abe40[_0x20eb('0x32')]=_[_0x20eb('0x33')](_0x5abe40[_0x20eb('0x2f')],_0x5abe40[_0x20eb('0x30')]);_0x4fb803['attributes']=_[_0x20eb('0x33')](_0x5abe40[_0x20eb('0x2f')],qs[_0x20eb('0x34')](_0x125a23[_0x20eb('0x30')][_0x20eb('0x34')]));_0x4fb803[_0x20eb('0x35')]=_0x4fb803[_0x20eb('0x35')][_0x20eb('0x36')]?_0x4fb803[_0x20eb('0x35')]:_0x5abe40[_0x20eb('0x2f')];if(!_0x125a23[_0x20eb('0x30')]['hasOwnProperty'](_0x20eb('0x37'))){_0x4fb803[_0x20eb('0x20')]=qs[_0x20eb('0x20')](_0x125a23[_0x20eb('0x30')]['limit']);_0x4fb803[_0x20eb('0x1d')]=qs[_0x20eb('0x1d')](_0x125a23[_0x20eb('0x30')]['offset']);}_0x4fb803[_0x20eb('0x38')]=qs[_0x20eb('0x39')](_0x125a23[_0x20eb('0x30')][_0x20eb('0x39')]);_0x4fb803[_0x20eb('0x3a')]=qs[_0x20eb('0x32')](_[_0x20eb('0x3b')](_0x125a23[_0x20eb('0x30')],_0x5abe40[_0x20eb('0x32')]),_0x3ae2b0);if(_0x125a23[_0x20eb('0x30')]['filter']){_0x4fb803[_0x20eb('0x3a')]=_['merge'](_0x4fb803[_0x20eb('0x3a')],{'$or':_[_0x20eb('0x3c')](_0x3ae2b0,function(_0x279a34){if(_0x279a34[_0x20eb('0x2e')]!==_0x20eb('0x3d')){var _0x2b8d14={};_0x2b8d14[_0x279a34[_0x20eb('0x2a')]]={'$like':'%'+_0x125a23[_0x20eb('0x30')][_0x20eb('0x3e')]+'%'};return _0x2b8d14;}})});}_0x4fb803=_['merge']({},_0x4fb803,_0x125a23[_0x20eb('0x3f')]);var _0x4cba6e={'where':_0x4fb803[_0x20eb('0x3a')]};return db['CmHopperAdditionalPhone'][_0x20eb('0x1f')](_0x4cba6e)[_0x20eb('0x24')](function(_0x565f6b){_0xfa014d[_0x20eb('0x1f')]=_0x565f6b;if(_0x125a23[_0x20eb('0x30')][_0x20eb('0x40')]){_0x4fb803[_0x20eb('0x41')]=[{'all':!![]}];}return db[_0x20eb('0x2b')][_0x20eb('0x42')](_0x4fb803);})[_0x20eb('0x24')](function(_0x8fb3af){_0xfa014d[_0x20eb('0x43')]=_0x8fb3af;return _0xfa014d;})[_0x20eb('0x24')](respondWithFilteredResult(_0x3999ec,_0x4fb803))[_0x20eb('0x44')](handleError(_0x3999ec,null));};exports[_0x20eb('0x45')]=function(_0xeb74d2,_0x265b02){var _0x212092={'raw':!![],'where':{'id':_0xeb74d2[_0x20eb('0x46')]['id']}},_0xa59e81={};_0xa59e81[_0x20eb('0x2f')]=_[_0x20eb('0x31')](db['CmHopperAdditionalPhone'][_0x20eb('0x2c')]);_0xa59e81[_0x20eb('0x30')]=_[_0x20eb('0x31')](_0xeb74d2[_0x20eb('0x30')]);_0xa59e81[_0x20eb('0x32')]=_['intersection'](_0xa59e81[_0x20eb('0x2f')],_0xa59e81[_0x20eb('0x30')]);_0x212092['attributes']=_[_0x20eb('0x33')](_0xa59e81['model'],qs[_0x20eb('0x34')](_0xeb74d2[_0x20eb('0x30')][_0x20eb('0x34')]));_0x212092[_0x20eb('0x35')]=_0x212092['attributes'][_0x20eb('0x36')]?_0x212092[_0x20eb('0x35')]:_0xa59e81[_0x20eb('0x2f')];if(_0xeb74d2['query'][_0x20eb('0x40')]){_0x212092['include']=[{'all':!![]}];}_0x212092=_[_0x20eb('0x47')]({},_0x212092,_0xeb74d2[_0x20eb('0x3f')]);return db[_0x20eb('0x2b')]['find'](_0x212092)[_0x20eb('0x24')](handleEntityNotFound(_0x265b02,null))[_0x20eb('0x24')](respondWithResult(_0x265b02,null))[_0x20eb('0x44')](handleError(_0x265b02,null));};exports[_0x20eb('0x48')]=function(_0x4aa040,_0xcd25ff){return db[_0x20eb('0x2b')][_0x20eb('0x48')](_0x4aa040[_0x20eb('0x49')],{})[_0x20eb('0x24')](function(_0x4ab8d3){var _0x2d4247=_0x4aa040[_0x20eb('0x4a')][_0x20eb('0x25')]({'plain':!![]});if(!_0x2d4247)throw new Error(_0x20eb('0x4b'));if(_0x2d4247[_0x20eb('0x4c')]==='user'){var _0x1ffce3=_0x4ab8d3[_0x20eb('0x25')]({'plain':!![]});var _0x37a1fb='CmHopperAdditionalPhones';return db[_0x20eb('0x4d')][_0x20eb('0x4e')]({'where':{'name':_0x37a1fb,'userProfileId':_0x2d4247[_0x20eb('0x4f')]},'raw':!![]})[_0x20eb('0x24')](function(_0x21683e){if(_0x21683e&&_0x21683e[_0x20eb('0x50')]===0x0){return db['UserProfileResource'][_0x20eb('0x48')]({'name':_0x1ffce3[_0x20eb('0x2a')],'resourceId':_0x1ffce3['id'],'type':_0x21683e['name'],'sectionId':_0x21683e['id']},{})[_0x20eb('0x24')](function(){return _0x4ab8d3;});}else{return _0x4ab8d3;}})[_0x20eb('0x44')](function(_0x2d4b0d){logger[_0x20eb('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d4b0d);throw _0x2d4b0d;});}return _0x4ab8d3;})[_0x20eb('0x24')](respondWithResult(_0xcd25ff,0xc9))['catch'](handleError(_0xcd25ff,null));};exports[_0x20eb('0x51')]=function(_0x210a65,_0x23a5da){if(_0x210a65[_0x20eb('0x49')]['id']){delete _0x210a65[_0x20eb('0x49')]['id'];}return db[_0x20eb('0x2b')]['find']({'where':{'id':_0x210a65[_0x20eb('0x46')]['id']}})[_0x20eb('0x24')](handleEntityNotFound(_0x23a5da,null))[_0x20eb('0x24')](saveUpdates(_0x210a65['body'],null))['then'](respondWithResult(_0x23a5da,null))[_0x20eb('0x44')](handleError(_0x23a5da,null));};exports[_0x20eb('0x28')]=function(_0x145c95,_0x2117c2){return db[_0x20eb('0x2b')]['find']({'where':{'id':_0x145c95[_0x20eb('0x46')]['id']}})[_0x20eb('0x24')](handleEntityNotFound(_0x2117c2,null))[_0x20eb('0x24')](removeEntity(_0x2117c2,null))['catch'](handleError(_0x2117c2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 705266c..74c64b8 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e8e=['./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x521f06,_0x1f8e7c){var _0x410a40=function(_0x471e9d){while(--_0x471e9d){_0x521f06['push'](_0x521f06['shift']());}};_0x410a40(++_0x1f8e7c);}(_0x9e8e,0xb7));var _0xe9e8=function(_0x490797,_0x33302b){_0x490797=_0x490797-0x0;var _0x30bb98=_0x9e8e[_0x490797];return _0x30bb98;};'use strict';var _=require('lodash');var util=require(_0xe9e8('0x0'));var logger=require(_0xe9e8('0x1'))(_0xe9e8('0x2'));var moment=require(_0xe9e8('0x3'));var BPromise=require(_0xe9e8('0x4'));var rp=require(_0xe9e8('0x5'));var fs=require('fs');var path=require(_0xe9e8('0x6'));var rimraf=require(_0xe9e8('0x7'));var config=require(_0xe9e8('0x8'));var attributes=require(_0xe9e8('0x9'));module['exports']=function(_0x3a0dd2,_0x134afa){return _0x3a0dd2[_0xe9e8('0xa')](_0xe9e8('0xb'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fde=['./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5a9017,_0x4312fc){var _0x596e52=function(_0x35843d){while(--_0x35843d){_0x5a9017['push'](_0x5a9017['shift']());}};_0x596e52(++_0x4312fc);}(_0x0fde,0x1a9));var _0xe0fd=function(_0x447191,_0x4b3214){_0x447191=_0x447191-0x0;var _0x34e552=_0x0fde[_0x447191];return _0x34e552;};'use strict';var _=require(_0xe0fd('0x0'));var util=require(_0xe0fd('0x1'));var logger=require(_0xe0fd('0x2'))(_0xe0fd('0x3'));var moment=require(_0xe0fd('0x4'));var BPromise=require('bluebird');var rp=require(_0xe0fd('0x5'));var fs=require('fs');var path=require(_0xe0fd('0x6'));var rimraf=require(_0xe0fd('0x7'));var config=require(_0xe0fd('0x8'));var attributes=require(_0xe0fd('0x9'));module[_0xe0fd('0xa')]=function(_0x4aa096,_0x35eed4){return _0x4aa096[_0xe0fd('0xb')](_0xe0fd('0xc'),attributes,{'tableName':_0xe0fd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index c11ae49..544a382 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa3f=['entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countcongestionretry','VerifyAdditionalPhones','SwapAdditionalPhones','CmHopper','duration','waitTime','add','minutes','isNil','createdAt','updatedAt','hopperToAdd','additionalToHop','sequelize','update','IncrementPreviewCounters','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CmHopperAdditionalPhone,\x20%s,\x20%s','catch','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','then','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x101a17,_0x5d047a){var _0x3b76ee=function(_0x89be1b){while(--_0x89be1b){_0x101a17['push'](_0x101a17['shift']());}};_0x3b76ee(++_0x5d047a);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x5712b0,_0x457fb1){_0x5712b0=_0x5712b0-0x0;var _0x20297e=_0xaa3f[_0x5712b0];return _0x20297e;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var moment=require(_0xfaa3('0x2'));var BPromise=require(_0xfaa3('0x3'));var rs=require(_0xfaa3('0x4'));var fs=require('fs');var Redis=require(_0xfaa3('0x5'));var db=require(_0xfaa3('0x6'))['db'];var utils=require(_0xfaa3('0x7'));var logger=require(_0xfaa3('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfaa3('0x9'));var client=jayson['client'][_0xfaa3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeecce5,_0x352958,_0xbf270c){return new BPromise(function(_0x328d5f,_0x2e422d){return client[_0xfaa3('0xb')](_0xeecce5,_0xbf270c)['then'](function(_0x37bcd5){logger[_0xfaa3('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x352958,'request\x20sent');logger[_0xfaa3('0xd')](_0xfaa3('0xe'),_0x352958,_0xfaa3('0xf'),JSON[_0xfaa3('0x10')](_0x37bcd5));if(_0x37bcd5[_0xfaa3('0x11')]){if(_0x37bcd5[_0xfaa3('0x11')]['code']===0x1f4){logger[_0xfaa3('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x352958,_0x37bcd5[_0xfaa3('0x11')][_0xfaa3('0x12')]);return _0x2e422d(_0x37bcd5[_0xfaa3('0x11')]['message']);}logger[_0xfaa3('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x352958,_0x37bcd5[_0xfaa3('0x11')][_0xfaa3('0x12')]);return _0x328d5f(_0x37bcd5[_0xfaa3('0x11')][_0xfaa3('0x12')]);}else{logger[_0xfaa3('0xc')](_0xfaa3('0x13'),_0x352958,'request\x20sent');_0x328d5f(_0x37bcd5['result'][_0xfaa3('0x12')]);}})[_0xfaa3('0x14')](function(_0x407384){logger[_0xfaa3('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x352958,_0x407384);_0x2e422d(_0x407384);});});}exports['VerifyAdditionalPhones']=function(_0x50f121){var _0x598473=this;return new Promise(function(_0x499148,_0x275a07){return db['CmHopper'][_0xfaa3('0x15')]({'raw':!![],'where':{'ContactId':_0x50f121[_0xfaa3('0x16')][_0xfaa3('0x17')],'ListId':_0x50f121[_0xfaa3('0x16')][_0xfaa3('0x18')],'VoiceQueueId':_0x50f121[_0xfaa3('0x16')][_0xfaa3('0x19')]===undefined?null:_0x50f121[_0xfaa3('0x16')][_0xfaa3('0x19')],'CampaignId':_0x50f121[_0xfaa3('0x16')]['CampaignId']===undefined?null:_0x50f121[_0xfaa3('0x16')][_0xfaa3('0x1a')]}})[_0xfaa3('0x1b')](function(_0x42b214){if(_0x42b214!=null){return db['CmHopperAdditionalPhone'][_0xfaa3('0x15')]({'raw':!![],'where':{'CmHopperId':_0x42b214['id'],'OrderBy':{'$gt':_0x42b214[_0xfaa3('0x1c')]}},'order':[[_0xfaa3('0x1c'),_0xfaa3('0x1d')]]})[_0xfaa3('0x1b')](function(_0x1fc244){var _0x2f2989=0x0;if(_0x1fc244){if(_0x1fc244[_0xfaa3('0x1e')]+_0x1fc244['countcongestionretry']+_0x1fc244[_0xfaa3('0x1f')]+_0x1fc244[_0xfaa3('0x20')]+_0x1fc244[_0xfaa3('0x21')]+_0x1fc244[_0xfaa3('0x22')]+_0x1fc244[_0xfaa3('0x23')]+_0x1fc244[_0xfaa3('0x24')]<_0x50f121[_0xfaa3('0x25')][_0xfaa3('0x26')])_0x2f2989=0x1;_0x499148({'additional':_0x2f2989});}else{return db[_0xfaa3('0x27')][_0xfaa3('0x15')]({'raw':!![],'where':{'CmHopperId':_0x42b214['id']},'order':[[_0xfaa3('0x1c'),_0xfaa3('0x1d')]]})[_0xfaa3('0x1b')](function(_0x1bc202){var _0x2d7c43=0x0;if(_0x1bc202){if(_0x1bc202['countbusyretry']+_0x1bc202[_0xfaa3('0x28')]+_0x1bc202[_0xfaa3('0x1f')]+_0x1bc202[_0xfaa3('0x20')]+_0x1bc202['countdropretry']+_0x1bc202[_0xfaa3('0x22')]+_0x1bc202['countmachineretry']+_0x1bc202[_0xfaa3('0x24')]<_0x50f121['entity'][_0xfaa3('0x26')])_0x2d7c43=0x1;_0x499148({'additional':_0x2d7c43});}else{_0x499148({'additional':0x0});}})[_0xfaa3('0x14')](function(_0x3a39c3){logger[_0xfaa3('0x11')](_0xfaa3('0x29'),_0x3a39c3[_0xfaa3('0x12')],_0x50f121);_0x275a07(_0x598473[_0xfaa3('0x11')](0x1f4,_0x3a39c3[_0xfaa3('0x12')]));});}})['catch'](function(_0x3992c5){logger[_0xfaa3('0x11')](_0xfaa3('0x29'),_0x3992c5[_0xfaa3('0x12')],_0x50f121);_0x275a07(_0x598473[_0xfaa3('0x11')](0x1f4,_0x3992c5[_0xfaa3('0x12')]));});}else _0x499148({'additional':0x0});});});};exports[_0xfaa3('0x2a')]=function(_0x102c4e){var _0x3fb3ab=this;return new Promise(function(_0x12cadf,_0x2d88fb){return db[_0xfaa3('0x2b')][_0xfaa3('0x15')]({'raw':!![],'where':{'ContactId':_0x102c4e[_0xfaa3('0x16')][_0xfaa3('0x17')],'ListId':_0x102c4e[_0xfaa3('0x16')]['ListId'],'VoiceQueueId':_0x102c4e[_0xfaa3('0x16')][_0xfaa3('0x19')]===undefined?null:_0x102c4e[_0xfaa3('0x16')][_0xfaa3('0x19')],'CampaignId':_0x102c4e[_0xfaa3('0x16')][_0xfaa3('0x1a')]===undefined?null:_0x102c4e[_0xfaa3('0x16')][_0xfaa3('0x1a')]}})['then'](function(_0x304fab){if(_0x304fab!=null){return db[_0xfaa3('0x27')][_0xfaa3('0x15')]({'raw':!![],'where':{'CmHopperId':_0x304fab['id'],'OrderBy':{'$gte':_0x304fab['OrderBy']}},'order':[[_0xfaa3('0x1c'),_0xfaa3('0x1d')]]})['then'](function(_0x458fa6){if(_0x458fa6)return activateAdditionalPhone(_0x304fab,_0x102c4e[_0xfaa3('0x16')],_0x458fa6,_0x102c4e[_0xfaa3('0x2c')],_0x102c4e[_0xfaa3('0x2d')])[_0xfaa3('0x1b')](function(_0x2ea061){_0x12cadf(_0x2ea061);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x304fab['id']},'order':[[_0xfaa3('0x1c'),_0xfaa3('0x1d')]]})['then'](function(_0x4ae1c3){if(_0x4ae1c3)return activateAdditionalPhone(_0x304fab,_0x102c4e[_0xfaa3('0x16')],_0x4ae1c3,_0x102c4e['duration'],_0x102c4e[_0xfaa3('0x2d')])[_0xfaa3('0x1b')](function(_0x37e89a){_0x12cadf(_0x37e89a);});else{_0x12cadf({'id':_0x304fab['id'],'phone':''});}})[_0xfaa3('0x14')](function(_0x3100c3){logger[_0xfaa3('0x11')](_0xfaa3('0x29'),_0x3100c3[_0xfaa3('0x12')],_0x102c4e);_0x2d88fb(_0x3fb3ab['error'](0x1f4,_0x3100c3['message']));});}})['catch'](function(_0x5b4ab2){logger[_0xfaa3('0x11')](_0xfaa3('0x29'),_0x5b4ab2['message'],_0x102c4e);_0x2d88fb(_0x3fb3ab[_0xfaa3('0x11')](0x1f4,_0x5b4ab2[_0xfaa3('0x12')]));});}else _0x12cadf(0x1);});});};function activateAdditionalPhone(_0x46683d,_0x4abf3a,_0x47e2be,_0x1e5d33,_0x4c19fc){return new Promise(function(_0x1701bc,_0x57b77c){logger['info'](_0xfaa3('0x29'),_0x47e2be);var _0x2ee593;if(moment()>moment(_0x47e2be['scheduledat'])){_0x2ee593=moment()[_0xfaa3('0x2e')](_0x4c19fc||0x3,'minutes');}else{if(_0x47e2be[_0xfaa3('0x1c')]==0x0){_0x2ee593=moment(_0x47e2be['scheduledat']);}else{_0x2ee593=moment()[_0xfaa3('0x2e')](_0x4c19fc||0x3,_0xfaa3('0x2f'));}}var _0x149d7e={'phone':_0x46683d['phone'],'active':0x0,'OrderBy':_[_0xfaa3('0x30')](_0x46683d[_0xfaa3('0x1c')])?0x0:_0x46683d['OrderBy'],'scheduledat':moment()[_0xfaa3('0x2e')](_0x1e5d33||0x1,_0xfaa3('0x2f')),'countbusyretry':_0x4abf3a[_0xfaa3('0x1e')],'countcongestionretry':_0x4abf3a[_0xfaa3('0x28')],'countnoanswerretry':_0x4abf3a['countnoanswerretry'],'countnosuchnumberretry':_0x4abf3a[_0xfaa3('0x20')],'countdropretry':_0x4abf3a[_0xfaa3('0x21')],'countabandonedretry':_0x4abf3a['countabandonedretry'],'countmachineretry':_0x4abf3a[_0xfaa3('0x23')],'countagentrejectretry':_0x4abf3a['countagentrejectretry'],'createdAt':_0x4abf3a[_0xfaa3('0x31')],'updatedAt':_0x4abf3a[_0xfaa3('0x32')]};var _0xb4df09={'CmHopperId':_0x46683d['id'],'phone':_0x47e2be['phone'],'active':0x0,'OrderBy':_[_0xfaa3('0x30')](_0x47e2be['OrderBy'])?0x0:_0x47e2be['OrderBy'],'scheduledat':_0x2ee593,'countbusyretry':_0x47e2be[_0xfaa3('0x1e')],'countcongestionretry':_0x47e2be[_0xfaa3('0x28')],'countnoanswerretry':_0x47e2be[_0xfaa3('0x1f')],'countnosuchnumberretry':_0x47e2be[_0xfaa3('0x20')],'countdropretry':_0x47e2be[_0xfaa3('0x21')],'countabandonedretry':_0x47e2be[_0xfaa3('0x22')],'countmachineretry':_0x47e2be[_0xfaa3('0x23')],'countagentrejectretry':_0x47e2be['countagentrejectretry'],'createdAt':_0x47e2be[_0xfaa3('0x31')],'updatedAt':_0x47e2be[_0xfaa3('0x32')]};logger[_0xfaa3('0xc')](_0xfaa3('0x33'),_0x149d7e);logger[_0xfaa3('0xc')](_0xfaa3('0x34'),_0xb4df09);return db[_0xfaa3('0x35')]['transaction'](function(_0x49c075){return db['CmHopperAdditionalPhone'][_0xfaa3('0x36')](_0x149d7e,{'where':{'id':_0x47e2be['id']}},{'transaction':_0x49c075})[_0xfaa3('0x1b')](function(){return db[_0xfaa3('0x2b')][_0xfaa3('0x36')](_0xb4df09,{'where':{'id':_0x46683d['id']}},{'transaction':_0x49c075});});})['then'](function(_0x43a636){_0x1701bc({'id':_0x46683d['id'],'phone':_0x47e2be['phone']});})['catch'](function(_0x4d81b9){logger['error']('VerifyAdditionalPhones',_0x4d81b9[_0xfaa3('0x12')],req);_0x57b77c(_this[_0xfaa3('0x11')](0x1f4,_0x4d81b9[_0xfaa3('0x12')]));});});}exports[_0xfaa3('0x37')]=function(_0x32ab8d){var _0x1c856b=this;return new Promise(function(_0x3c422d,_0x45984c){return db['CmHopper'][_0xfaa3('0x36')](_0x32ab8d['body']['field'],{'where':{'id':_0x32ab8d[_0xfaa3('0x16')]['id']}})[_0xfaa3('0x1b')](function(_0x461e87){_0x3c422d(_0x461e87);})[_0xfaa3('0x14')](function(_0x29158f){logger[_0xfaa3('0x11')](_0xfaa3('0x37'),_0x29158f[_0xfaa3('0x12')],_0x32ab8d);_0x45984c(_0x1c856b[_0xfaa3('0x11')](0x1f4,_0x29158f[_0xfaa3('0x12')]));});});}; \ No newline at end of file +var _0xeec6=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','entity','dialGlobalMaxRetry','ASC','countmachineretry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','scheduledat','add','minutes','phone','isNil','createdAt','hopperToAdd','additionalToHop','sequelize','transaction','update','IncrementPreviewCounters','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x5b8a7d,_0x5a59be){var _0x5c2a42=function(_0x368624){while(--_0x368624){_0x5b8a7d['push'](_0x5b8a7d['shift']());}};_0x5c2a42(++_0x5a59be);}(_0xeec6,0x1c2));var _0x6eec=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xeec6[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){return client['request'](_0x48064a,_0x1c810e)[_0x6eec('0xc')](function(_0x3aca38){logger[_0x6eec('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x5a5e47,'request\x20sent');logger['debug'](_0x6eec('0xe'),_0x5a5e47,_0x6eec('0xf'),JSON['stringify'](_0x3aca38));if(_0x3aca38['error']){if(_0x3aca38[_0x6eec('0x10')]['code']===0x1f4){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x834c2(_0x3aca38[_0x6eec('0x10')]['message']);}logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x3443c2(_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);}else{logger[_0x6eec('0xd')](_0x6eec('0x11'),_0x5a5e47,_0x6eec('0xf'));_0x3443c2(_0x3aca38[_0x6eec('0x13')]['message']);}})[_0x6eec('0x14')](function(_0x5f1f33){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x5f1f33);_0x834c2(_0x5f1f33);});});}exports['VerifyAdditionalPhones']=function(_0x3ee353){var _0x80736b=this;return new Promise(function(_0xb1eab7,_0x56c78b){return db[_0x6eec('0x15')][_0x6eec('0x16')]({'raw':!![],'where':{'ContactId':_0x3ee353[_0x6eec('0x17')][_0x6eec('0x18')],'ListId':_0x3ee353[_0x6eec('0x17')][_0x6eec('0x19')],'VoiceQueueId':_0x3ee353['body'][_0x6eec('0x1a')]===undefined?null:_0x3ee353[_0x6eec('0x17')][_0x6eec('0x1a')],'CampaignId':_0x3ee353[_0x6eec('0x17')][_0x6eec('0x1b')]===undefined?null:_0x3ee353[_0x6eec('0x17')]['CampaignId']}})[_0x6eec('0xc')](function(_0x852d08){if(_0x852d08!=null){return db[_0x6eec('0x1c')][_0x6eec('0x16')]({'raw':!![],'where':{'CmHopperId':_0x852d08['id'],'OrderBy':{'$gt':_0x852d08[_0x6eec('0x1d')]}},'order':[[_0x6eec('0x1d'),'ASC']]})[_0x6eec('0xc')](function(_0x2ad14b){var _0xd664f5=0x0;if(_0x2ad14b){if(_0x2ad14b[_0x6eec('0x1e')]+_0x2ad14b[_0x6eec('0x1f')]+_0x2ad14b[_0x6eec('0x20')]+_0x2ad14b[_0x6eec('0x21')]+_0x2ad14b[_0x6eec('0x22')]+_0x2ad14b[_0x6eec('0x23')]+_0x2ad14b['countmachineretry']+_0x2ad14b[_0x6eec('0x24')]<_0x3ee353[_0x6eec('0x25')][_0x6eec('0x26')])_0xd664f5=0x1;_0xb1eab7({'additional':_0xd664f5});}else{return db[_0x6eec('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x852d08['id']},'order':[[_0x6eec('0x1d'),_0x6eec('0x27')]]})['then'](function(_0x54b446){var _0x3240c3=0x0;if(_0x54b446){if(_0x54b446['countbusyretry']+_0x54b446[_0x6eec('0x1f')]+_0x54b446[_0x6eec('0x20')]+_0x54b446[_0x6eec('0x21')]+_0x54b446[_0x6eec('0x22')]+_0x54b446[_0x6eec('0x23')]+_0x54b446[_0x6eec('0x28')]+_0x54b446[_0x6eec('0x24')]<_0x3ee353[_0x6eec('0x25')][_0x6eec('0x26')])_0x3240c3=0x1;_0xb1eab7({'additional':_0x3240c3});}else{_0xb1eab7({'additional':0x0});}})[_0x6eec('0x14')](function(_0x48f66f){logger[_0x6eec('0x10')]('VerifyAdditionalPhones',_0x48f66f[_0x6eec('0x12')],_0x3ee353);_0x56c78b(_0x80736b[_0x6eec('0x10')](0x1f4,_0x48f66f[_0x6eec('0x12')]));});}})['catch'](function(_0x57b40b){logger['error'](_0x6eec('0x29'),_0x57b40b[_0x6eec('0x12')],_0x3ee353);_0x56c78b(_0x80736b[_0x6eec('0x10')](0x1f4,_0x57b40b[_0x6eec('0x12')]));});}else _0xb1eab7({'additional':0x0});});});};exports[_0x6eec('0x2a')]=function(_0x23547d){var _0x22e0cb=this;return new Promise(function(_0x167c8d,_0x2bc106){return db[_0x6eec('0x15')][_0x6eec('0x16')]({'raw':!![],'where':{'ContactId':_0x23547d[_0x6eec('0x17')]['ContactId'],'ListId':_0x23547d[_0x6eec('0x17')][_0x6eec('0x19')],'VoiceQueueId':_0x23547d[_0x6eec('0x17')]['VoiceQueueId']===undefined?null:_0x23547d[_0x6eec('0x17')][_0x6eec('0x1a')],'CampaignId':_0x23547d[_0x6eec('0x17')][_0x6eec('0x1b')]===undefined?null:_0x23547d[_0x6eec('0x17')][_0x6eec('0x1b')]}})['then'](function(_0x45cfb6){if(_0x45cfb6!=null){return db[_0x6eec('0x1c')][_0x6eec('0x16')]({'raw':!![],'where':{'CmHopperId':_0x45cfb6['id'],'OrderBy':{'$gte':_0x45cfb6['OrderBy']}},'order':[['OrderBy',_0x6eec('0x27')]]})[_0x6eec('0xc')](function(_0x10960b){if(_0x10960b)return activateAdditionalPhone(_0x45cfb6,_0x23547d[_0x6eec('0x17')],_0x10960b,_0x23547d[_0x6eec('0x2b')],_0x23547d['waitTime'])[_0x6eec('0xc')](function(_0x2c3b14){_0x167c8d(_0x2c3b14);});else{return db[_0x6eec('0x1c')][_0x6eec('0x16')]({'raw':!![],'where':{'CmHopperId':_0x45cfb6['id']},'order':[[_0x6eec('0x1d'),_0x6eec('0x27')]]})[_0x6eec('0xc')](function(_0x1deed2){if(_0x1deed2)return activateAdditionalPhone(_0x45cfb6,_0x23547d['body'],_0x1deed2,_0x23547d[_0x6eec('0x2b')],_0x23547d[_0x6eec('0x2c')])['then'](function(_0x5b3283){_0x167c8d(_0x5b3283);});else{_0x167c8d({'id':_0x45cfb6['id'],'phone':''});}})[_0x6eec('0x14')](function(_0x66f786){logger[_0x6eec('0x10')](_0x6eec('0x29'),_0x66f786['message'],_0x23547d);_0x2bc106(_0x22e0cb['error'](0x1f4,_0x66f786[_0x6eec('0x12')]));});}})['catch'](function(_0x5ac8b2){logger[_0x6eec('0x10')](_0x6eec('0x29'),_0x5ac8b2[_0x6eec('0x12')],_0x23547d);_0x2bc106(_0x22e0cb[_0x6eec('0x10')](0x1f4,_0x5ac8b2[_0x6eec('0x12')]));});}else _0x167c8d(0x1);});});};function activateAdditionalPhone(_0x58dfe7,_0x931bcf,_0x3a4d25,_0x4e0709,_0x2fd444){return new Promise(function(_0x241512,_0x5028a2){logger[_0x6eec('0xd')](_0x6eec('0x29'),_0x3a4d25);var _0x4e3b1e;if(moment()>moment(_0x3a4d25[_0x6eec('0x2d')])){_0x4e3b1e=moment()[_0x6eec('0x2e')](_0x2fd444||0x3,_0x6eec('0x2f'));}else{if(_0x3a4d25[_0x6eec('0x1d')]==0x0){_0x4e3b1e=moment(_0x3a4d25['scheduledat']);}else{_0x4e3b1e=moment()[_0x6eec('0x2e')](_0x2fd444||0x3,_0x6eec('0x2f'));}}var _0x45e22a={'phone':_0x58dfe7[_0x6eec('0x30')],'active':0x0,'OrderBy':_[_0x6eec('0x31')](_0x58dfe7['OrderBy'])?0x0:_0x58dfe7['OrderBy'],'scheduledat':moment()[_0x6eec('0x2e')](_0x4e0709||0x1,_0x6eec('0x2f')),'countbusyretry':_0x931bcf[_0x6eec('0x1e')],'countcongestionretry':_0x931bcf[_0x6eec('0x1f')],'countnoanswerretry':_0x931bcf[_0x6eec('0x20')],'countnosuchnumberretry':_0x931bcf['countnosuchnumberretry'],'countdropretry':_0x931bcf[_0x6eec('0x22')],'countabandonedretry':_0x931bcf['countabandonedretry'],'countmachineretry':_0x931bcf[_0x6eec('0x28')],'countagentrejectretry':_0x931bcf[_0x6eec('0x24')],'createdAt':_0x931bcf[_0x6eec('0x32')],'updatedAt':_0x931bcf['updatedAt']};var _0x2b83f2={'CmHopperId':_0x58dfe7['id'],'phone':_0x3a4d25[_0x6eec('0x30')],'active':0x0,'OrderBy':_[_0x6eec('0x31')](_0x3a4d25[_0x6eec('0x1d')])?0x0:_0x3a4d25[_0x6eec('0x1d')],'scheduledat':_0x4e3b1e,'countbusyretry':_0x3a4d25['countbusyretry'],'countcongestionretry':_0x3a4d25[_0x6eec('0x1f')],'countnoanswerretry':_0x3a4d25['countnoanswerretry'],'countnosuchnumberretry':_0x3a4d25['countnosuchnumberretry'],'countdropretry':_0x3a4d25[_0x6eec('0x22')],'countabandonedretry':_0x3a4d25['countabandonedretry'],'countmachineretry':_0x3a4d25[_0x6eec('0x28')],'countagentrejectretry':_0x3a4d25[_0x6eec('0x24')],'createdAt':_0x3a4d25[_0x6eec('0x32')],'updatedAt':_0x3a4d25['updatedAt']};logger['info'](_0x6eec('0x33'),_0x45e22a);logger[_0x6eec('0xd')](_0x6eec('0x34'),_0x2b83f2);return db[_0x6eec('0x35')][_0x6eec('0x36')](function(_0x2c9650){return db[_0x6eec('0x1c')][_0x6eec('0x37')](_0x45e22a,{'where':{'id':_0x3a4d25['id']}},{'transaction':_0x2c9650})[_0x6eec('0xc')](function(){return db[_0x6eec('0x15')]['update'](_0x2b83f2,{'where':{'id':_0x58dfe7['id']}},{'transaction':_0x2c9650});});})['then'](function(_0x1a8cf6){_0x241512({'id':_0x58dfe7['id'],'phone':_0x3a4d25[_0x6eec('0x30')]});})[_0x6eec('0x14')](function(_0x577fb6){logger[_0x6eec('0x10')](_0x6eec('0x29'),_0x577fb6[_0x6eec('0x12')],req);_0x5028a2(_this[_0x6eec('0x10')](0x1f4,_0x577fb6[_0x6eec('0x12')]));});});}exports[_0x6eec('0x38')]=function(_0x10c10a){var _0x413de9=this;return new Promise(function(_0x5a6e05,_0xdf888d){return db[_0x6eec('0x15')][_0x6eec('0x37')](_0x10c10a[_0x6eec('0x17')]['field'],{'where':{'id':_0x10c10a['body']['id']}})['then'](function(_0x36c49b){_0x5a6e05(_0x36c49b);})[_0x6eec('0x14')](function(_0x8e903b){logger[_0x6eec('0x10')]('IncrementPreviewCounters',_0x8e903b['message'],_0x10c10a);_0xdf888d(_0x413de9[_0x6eec('0x10')](0x1f4,_0x8e903b[_0x6eec('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 361187f..d19b56d 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf64f=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id','show','create','put','update','destroy','exports'];(function(_0x2202d2,_0x529a53){var _0x55094b=function(_0x46d701){while(--_0x46d701){_0x2202d2['push'](_0x2202d2['shift']());}};_0x55094b(++_0x529a53);}(_0xf64f,0xb4));var _0xff64=function(_0x3ca6f2,_0x7c849e){_0x3ca6f2=_0x3ca6f2-0x0;var _0x4fdf23=_0xf64f[_0x3ca6f2];return _0x4fdf23;};'use strict';var multer=require(_0xff64('0x0'));var util=require('util');var path=require(_0xff64('0x1'));var timeout=require(_0xff64('0x2'));var express=require(_0xff64('0x3'));var router=express[_0xff64('0x4')]();var fs_extra=require(_0xff64('0x5'));var auth=require(_0xff64('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xff64('0x7'));var controller=require(_0xff64('0x8'));router[_0xff64('0x9')]('/',auth[_0xff64('0xa')](),controller['index']);router[_0xff64('0x9')](_0xff64('0xb'),auth['isAuthenticated'](),controller[_0xff64('0xc')]);router['post']('/',auth[_0xff64('0xa')](),controller[_0xff64('0xd')]);router[_0xff64('0xe')]('/:id',auth[_0xff64('0xa')](),controller[_0xff64('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xff64('0x10')]);module[_0xff64('0x11')]=router; \ No newline at end of file +var _0x0ba2=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x108de9,_0x59c896){var _0x3038af=function(_0x417e23){while(--_0x417e23){_0x108de9['push'](_0x108de9['shift']());}};_0x3038af(++_0x59c896);}(_0x0ba2,0x11c));var _0x20ba=function(_0x4d33d9,_0x5e25cf){_0x4d33d9=_0x4d33d9-0x0;var _0x399baf=_0x0ba2[_0x4d33d9];return _0x399baf;};'use strict';var multer=require(_0x20ba('0x0'));var util=require(_0x20ba('0x1'));var path=require(_0x20ba('0x2'));var timeout=require(_0x20ba('0x3'));var express=require('express');var router=express[_0x20ba('0x4')]();var fs_extra=require(_0x20ba('0x5'));var auth=require(_0x20ba('0x6'));var interaction=require(_0x20ba('0x7'));var config=require(_0x20ba('0x8'));var controller=require(_0x20ba('0x9'));router['get']('/',auth[_0x20ba('0xa')](),controller[_0x20ba('0xb')]);router[_0x20ba('0xc')](_0x20ba('0xd'),auth[_0x20ba('0xa')](),controller[_0x20ba('0xe')]);router[_0x20ba('0xf')]('/',auth[_0x20ba('0xa')](),controller['create']);router[_0x20ba('0x10')](_0x20ba('0xd'),auth[_0x20ba('0xa')](),controller[_0x20ba('0x11')]);router['delete'](_0x20ba('0xd'),auth[_0x20ba('0xa')](),controller[_0x20ba('0x12')]);module[_0x20ba('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 c02100f..844780c 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 _0x322a=['INTEGER','contactListQueue','moment','exports','STRING'];(function(_0x3d3be1,_0x448174){var _0x232e83=function(_0x2ff17c){while(--_0x2ff17c){_0x3d3be1['push'](_0x3d3be1['shift']());}};_0x232e83(++_0x448174);}(_0x322a,0x129));var _0xa322=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0x322a[_0x28394f];return _0x2618d2;};'use strict';var moment=require(_0xa322('0x0'));var Sequelize=require('sequelize');module[_0xa322('0x1')]={'phone':{'type':Sequelize[_0xa322('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa322('0x3')],'unique':_0xa322('0x4')},'ListId':{'type':Sequelize[_0xa322('0x3')],'unique':_0xa322('0x4')},'VoiceQueueId':{'type':Sequelize[_0xa322('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0xd07c=['moment','exports','STRING','INTEGER','contactListQueue'];(function(_0x565130,_0x27cfde){var _0x38de76=function(_0x344725){while(--_0x344725){_0x565130['push'](_0x565130['shift']());}};_0x38de76(++_0x27cfde);}(_0xd07c,0xbe));var _0xcd07=function(_0x56b07a,_0x4de01c){_0x56b07a=_0x56b07a-0x0;var _0x3cdb49=_0xd07c[_0x56b07a];return _0x3cdb49;};'use strict';var moment=require(_0xcd07('0x0'));var Sequelize=require('sequelize');module[_0xcd07('0x1')]={'phone':{'type':Sequelize[_0xcd07('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xcd07('0x3')],'unique':_0xcd07('0x4')},'ListId':{'type':Sequelize[_0xcd07('0x3')],'unique':_0xcd07('0x4')},'VoiceQueueId':{'type':Sequelize[_0xcd07('0x3')],'unique':_0xcd07('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 8ab6618..76e2edb 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 _0x323a=['type','key','model','keys','filters','intersection','query','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName'];(function(_0x3a63b4,_0x6e7870){var _0x36006b=function(_0x493681){while(--_0x493681){_0x3a63b4['push'](_0x3a63b4['shift']());}};_0x36006b(++_0x6e7870);}(_0x323a,0x68));var _0xa323=function(_0x36e1bf,_0x47317e){_0x36e1bf=_0x36e1bf-0x0;var _0x3a2aba=_0x323a[_0x36e1bf];return _0x3a2aba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa323('0x0'));var zipdir=require(_0xa323('0x1'));var jsonpatch=require(_0xa323('0x2'));var rp=require(_0xa323('0x3'));var moment=require(_0xa323('0x4'));var BPromise=require(_0xa323('0x5'));var Mustache=require('mustache');var util=require(_0xa323('0x6'));var path=require('path');var sox=require(_0xa323('0x7'));var csv=require('to-csv');var ejs=require(_0xa323('0x8'));var fs=require('fs');var fs_extra=require(_0xa323('0x9'));var _=require(_0xa323('0xa'));var squel=require(_0xa323('0xb'));var crypto=require(_0xa323('0xc'));var jsforce=require(_0xa323('0xd'));var deskjs=require(_0xa323('0xe'));var toCsv=require(_0xa323('0xf'));var querystring=require(_0xa323('0x10'));var Papa=require(_0xa323('0x11'));var Redis=require(_0xa323('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa323('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa323('0x14'));var logger=require(_0xa323('0x15'))(_0xa323('0x16'));var utils=require(_0xa323('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa323('0x18'));var db=require(_0xa323('0x19'))['db'];function respondWithStatusCode(_0x58e1b5,_0x1ec74f){_0x1ec74f=_0x1ec74f||0xcc;return function(_0x340dfe){if(_0x340dfe){return _0x58e1b5['sendStatus'](_0x1ec74f);}return _0x58e1b5[_0xa323('0x1a')](_0x1ec74f)[_0xa323('0x1b')]();};}function respondWithResult(_0x2e7999,_0x1d4965){_0x1d4965=_0x1d4965||0xc8;return function(_0x1f612c){if(_0x1f612c){return _0x2e7999[_0xa323('0x1a')](_0x1d4965)['json'](_0x1f612c);}};}function respondWithFilteredResult(_0x4e5685,_0x3b7395){return function(_0x304797){if(_0x304797){var _0x543d8a=typeof _0x3b7395[_0xa323('0x1c')]===_0xa323('0x1d')&&typeof _0x3b7395[_0xa323('0x1e')]==='undefined';var _0x38e158=_0x304797[_0xa323('0x1f')];var _0x32205f=_0x543d8a?0x0:_0x3b7395[_0xa323('0x1c')];var _0x344dbd=_0x543d8a?_0x304797[_0xa323('0x1f')]:_0x3b7395['offset']+_0x3b7395[_0xa323('0x1e')];var _0x401b34;if(_0x344dbd>=_0x38e158){_0x344dbd=_0x38e158;_0x401b34=0xc8;}else{_0x401b34=0xce;}_0x4e5685[_0xa323('0x1a')](_0x401b34);return _0x4e5685[_0xa323('0x20')](_0xa323('0x21'),_0x32205f+'-'+_0x344dbd+'/'+_0x38e158)[_0xa323('0x22')](_0x304797);}return null;};}function patchUpdates(_0x11f3a8){return function(_0x6c5f1f){try{jsonpatch[_0xa323('0x23')](_0x6c5f1f,_0x11f3a8,!![]);}catch(_0x45eb32){return BPromise[_0xa323('0x24')](_0x45eb32);}return _0x6c5f1f[_0xa323('0x25')]();};}function saveUpdates(_0x5c4c98,_0x5c3b51){return function(_0x2b810b){if(_0x2b810b){return _0x2b810b[_0xa323('0x26')](_0x5c4c98)[_0xa323('0x27')](function(_0x595a25){return _0x595a25;});}return null;};}function removeEntity(_0x45ef03,_0x50efce){return function(_0x4884af){if(_0x4884af){return _0x4884af[_0xa323('0x28')]()[_0xa323('0x27')](function(){_0x45ef03[_0xa323('0x1a')](0xcc)[_0xa323('0x1b')]();});}};}function handleEntityNotFound(_0x336943,_0x4ec476){return function(_0x27bb4f){if(!_0x27bb4f){_0x336943[_0xa323('0x29')](0x194);}return _0x27bb4f;};}function handleError(_0x57dd52,_0x85896b){_0x85896b=_0x85896b||0x1f4;return function(_0x18d8cd){logger[_0xa323('0x2a')](_0x18d8cd['stack']);if(_0x18d8cd[_0xa323('0x2b')]){delete _0x18d8cd[_0xa323('0x2b')];}_0x57dd52[_0xa323('0x1a')](_0x85896b)[_0xa323('0x2c')](_0x18d8cd);};}exports[_0xa323('0x2d')]=function(_0x254027,_0x4ab20b){var _0xf8c6b3={},_0x3ea25a={},_0x294911={'count':0x0,'rows':[]};var _0x1071ac=_[_0xa323('0x2e')](db[_0xa323('0x2f')][_0xa323('0x30')],function(_0x241591){return{'name':_0x241591[_0xa323('0x31')],'type':_0x241591[_0xa323('0x32')][_0xa323('0x33')]};});_0x3ea25a[_0xa323('0x34')]=_['map'](_0x1071ac,'name');_0x3ea25a['query']=_[_0xa323('0x35')](_0x254027['query']);_0x3ea25a[_0xa323('0x36')]=_[_0xa323('0x37')](_0x3ea25a[_0xa323('0x34')],_0x3ea25a[_0xa323('0x38')]);_0xf8c6b3[_0xa323('0x39')]=_['intersection'](_0x3ea25a[_0xa323('0x34')],qs['fields'](_0x254027[_0xa323('0x38')]['fields']));_0xf8c6b3['attributes']=_0xf8c6b3[_0xa323('0x39')]['length']?_0xf8c6b3['attributes']:_0x3ea25a[_0xa323('0x34')];if(!_0x254027[_0xa323('0x38')][_0xa323('0x3a')](_0xa323('0x3b'))){_0xf8c6b3['limit']=qs['limit'](_0x254027[_0xa323('0x38')][_0xa323('0x1e')]);_0xf8c6b3[_0xa323('0x1c')]=qs[_0xa323('0x1c')](_0x254027[_0xa323('0x38')]['offset']);}_0xf8c6b3[_0xa323('0x3c')]=qs['sort'](_0x254027[_0xa323('0x38')][_0xa323('0x3d')]);_0xf8c6b3[_0xa323('0x3e')]=qs[_0xa323('0x36')](_[_0xa323('0x3f')](_0x254027['query'],_0x3ea25a[_0xa323('0x36')]),_0x1071ac);if(_0x254027['query'][_0xa323('0x40')]){_0xf8c6b3['where']=_['merge'](_0xf8c6b3[_0xa323('0x3e')],{'$or':_['map'](_0x1071ac,function(_0x244a88){if(_0x244a88[_0xa323('0x32')]!=='VIRTUAL'){var _0x220f7d={};_0x220f7d[_0x244a88[_0xa323('0x2b')]]={'$like':'%'+_0x254027[_0xa323('0x38')][_0xa323('0x40')]+'%'};return _0x220f7d;}})});}_0xf8c6b3=_[_0xa323('0x41')]({},_0xf8c6b3,_0x254027[_0xa323('0x42')]);var _0x3fd832={'where':_0xf8c6b3['where']};return db[_0xa323('0x2f')][_0xa323('0x1f')](_0x3fd832)['then'](function(_0x3b5c0d){_0x294911[_0xa323('0x1f')]=_0x3b5c0d;if(_0x254027['query'][_0xa323('0x43')]){_0xf8c6b3[_0xa323('0x44')]=[{'all':!![]}];}return db[_0xa323('0x2f')][_0xa323('0x45')](_0xf8c6b3);})[_0xa323('0x27')](function(_0x28dfeb){_0x294911[_0xa323('0x46')]=_0x28dfeb;return _0x294911;})[_0xa323('0x27')](respondWithFilteredResult(_0x4ab20b,_0xf8c6b3))[_0xa323('0x47')](handleError(_0x4ab20b,null));};exports[_0xa323('0x48')]=function(_0x51743c,_0x4624ce){var _0x599759={'raw':!![],'where':{'id':_0x51743c['params']['id']}},_0x3d42ab={};_0x3d42ab['model']=_['keys'](db[_0xa323('0x2f')][_0xa323('0x30')]);_0x3d42ab[_0xa323('0x38')]=_['keys'](_0x51743c[_0xa323('0x38')]);_0x3d42ab[_0xa323('0x36')]=_['intersection'](_0x3d42ab[_0xa323('0x34')],_0x3d42ab['query']);_0x599759[_0xa323('0x39')]=_[_0xa323('0x37')](_0x3d42ab[_0xa323('0x34')],qs['fields'](_0x51743c['query']['fields']));_0x599759[_0xa323('0x39')]=_0x599759['attributes']['length']?_0x599759[_0xa323('0x39')]:_0x3d42ab[_0xa323('0x34')];if(_0x51743c[_0xa323('0x38')][_0xa323('0x43')]){_0x599759[_0xa323('0x44')]=[{'all':!![]}];}_0x599759=_[_0xa323('0x41')]({},_0x599759,_0x51743c[_0xa323('0x42')]);return db['CmHopperBlack']['find'](_0x599759)['then'](handleEntityNotFound(_0x4624ce,null))[_0xa323('0x27')](respondWithResult(_0x4624ce,null))['catch'](handleError(_0x4624ce,null));};exports[_0xa323('0x26')]=function(_0x2bd8d4,_0x227d47){if(_0x2bd8d4[_0xa323('0x49')]['id']){delete _0x2bd8d4['body']['id'];}return db[_0xa323('0x2f')]['find']({'where':{'id':_0x2bd8d4['params']['id']}})[_0xa323('0x27')](handleEntityNotFound(_0x227d47,null))[_0xa323('0x27')](saveUpdates(_0x2bd8d4[_0xa323('0x49')],null))[_0xa323('0x27')](respondWithResult(_0x227d47,null))[_0xa323('0x47')](handleError(_0x227d47,null));};exports[_0xa323('0x28')]=function(_0x38c4a3,_0x350622){return db['CmHopperBlack'][_0xa323('0x4a')]({'where':{'id':_0x38c4a3[_0xa323('0x4b')]['id']}})[_0xa323('0x27')](handleEntityNotFound(_0x350622,null))[_0xa323('0x27')](removeEntity(_0x350622,null))[_0xa323('0x47')](handleError(_0x350622,null));};exports['describe']=function(_0x5332b9,_0x4c8348){return db[_0xa323('0x2f')][_0xa323('0x4c')]()[_0xa323('0x27')](respondWithResult(_0x4c8348,null))[_0xa323('0x47')](handleError(_0x4c8348,null));}; \ No newline at end of file +var _0x781c=['name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','length','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','update','then','destroy','end','error','stack'];(function(_0x1d6b17,_0x36587){var _0x370b62=function(_0x402b13){while(--_0x402b13){_0x1d6b17['push'](_0x1d6b17['shift']());}};_0x370b62(++_0x36587);}(_0x781c,0x105));var _0xc781=function(_0x958715,_0xdf1601){_0x958715=_0x958715-0x0;var _0x23e11e=_0x781c[_0x958715];return _0x23e11e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc781('0x0'));var zipdir=require(_0xc781('0x1'));var jsonpatch=require(_0xc781('0x2'));var rp=require(_0xc781('0x3'));var moment=require(_0xc781('0x4'));var BPromise=require(_0xc781('0x5'));var Mustache=require(_0xc781('0x6'));var util=require(_0xc781('0x7'));var path=require(_0xc781('0x8'));var sox=require(_0xc781('0x9'));var csv=require(_0xc781('0xa'));var ejs=require(_0xc781('0xb'));var fs=require('fs');var fs_extra=require(_0xc781('0xc'));var _=require(_0xc781('0xd'));var squel=require(_0xc781('0xe'));var crypto=require(_0xc781('0xf'));var jsforce=require(_0xc781('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xc781('0xa'));var querystring=require(_0xc781('0x11'));var Papa=require('papaparse');var Redis=require(_0xc781('0x12'));var authService=require(_0xc781('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc781('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc781('0x15'));var db=require(_0xc781('0x16'))['db'];function respondWithStatusCode(_0x4b4c6c,_0x24ab70){_0x24ab70=_0x24ab70||0xcc;return function(_0x21414e){if(_0x21414e){return _0x4b4c6c[_0xc781('0x17')](_0x24ab70);}return _0x4b4c6c[_0xc781('0x18')](_0x24ab70)['end']();};}function respondWithResult(_0x29e613,_0x43a7b7){_0x43a7b7=_0x43a7b7||0xc8;return function(_0x27bb73){if(_0x27bb73){return _0x29e613[_0xc781('0x18')](_0x43a7b7)['json'](_0x27bb73);}};}function respondWithFilteredResult(_0x16ff12,_0x1f68c2){return function(_0x43572d){if(_0x43572d){var _0xd89fa8=typeof _0x1f68c2[_0xc781('0x19')]===_0xc781('0x1a')&&typeof _0x1f68c2['limit']==='undefined';var _0x455077=_0x43572d[_0xc781('0x1b')];var _0x3bbbbd=_0xd89fa8?0x0:_0x1f68c2[_0xc781('0x19')];var _0x3109e1=_0xd89fa8?_0x43572d[_0xc781('0x1b')]:_0x1f68c2[_0xc781('0x19')]+_0x1f68c2[_0xc781('0x1c')];var _0x1ad690;if(_0x3109e1>=_0x455077){_0x3109e1=_0x455077;_0x1ad690=0xc8;}else{_0x1ad690=0xce;}_0x16ff12['status'](_0x1ad690);return _0x16ff12[_0xc781('0x1d')]('Content-Range',_0x3bbbbd+'-'+_0x3109e1+'/'+_0x455077)[_0xc781('0x1e')](_0x43572d);}return null;};}function patchUpdates(_0x1f6393){return function(_0xc141da){try{jsonpatch[_0xc781('0x1f')](_0xc141da,_0x1f6393,!![]);}catch(_0x330aaf){return BPromise[_0xc781('0x20')](_0x330aaf);}return _0xc141da['save']();};}function saveUpdates(_0x54515c,_0x857639){return function(_0x2b9689){if(_0x2b9689){return _0x2b9689[_0xc781('0x21')](_0x54515c)[_0xc781('0x22')](function(_0x44a3ba){return _0x44a3ba;});}return null;};}function removeEntity(_0xf85c6e,_0x306b8e){return function(_0x13df86){if(_0x13df86){return _0x13df86[_0xc781('0x23')]()[_0xc781('0x22')](function(){_0xf85c6e[_0xc781('0x18')](0xcc)[_0xc781('0x24')]();});}};}function handleEntityNotFound(_0x6d1d52,_0x44cd23){return function(_0x15fc5a){if(!_0x15fc5a){_0x6d1d52[_0xc781('0x17')](0x194);}return _0x15fc5a;};}function handleError(_0x1f78f2,_0x3fa666){_0x3fa666=_0x3fa666||0x1f4;return function(_0x175402){logger[_0xc781('0x25')](_0x175402[_0xc781('0x26')]);if(_0x175402[_0xc781('0x27')]){delete _0x175402['name'];}_0x1f78f2[_0xc781('0x18')](_0x3fa666)[_0xc781('0x28')](_0x175402);};}exports[_0xc781('0x29')]=function(_0x343fb6,_0x406565){var _0x412870={},_0x14219f={},_0x15b831={'count':0x0,'rows':[]};var _0x161611=_[_0xc781('0x2a')](db[_0xc781('0x2b')][_0xc781('0x2c')],function(_0x2346ce){return{'name':_0x2346ce[_0xc781('0x2d')],'type':_0x2346ce[_0xc781('0x2e')][_0xc781('0x2f')]};});_0x14219f[_0xc781('0x30')]=_[_0xc781('0x2a')](_0x161611,_0xc781('0x27'));_0x14219f[_0xc781('0x31')]=_['keys'](_0x343fb6[_0xc781('0x31')]);_0x14219f[_0xc781('0x32')]=_['intersection'](_0x14219f[_0xc781('0x30')],_0x14219f[_0xc781('0x31')]);_0x412870['attributes']=_[_0xc781('0x33')](_0x14219f['model'],qs[_0xc781('0x34')](_0x343fb6['query']['fields']));_0x412870[_0xc781('0x35')]=_0x412870[_0xc781('0x35')]['length']?_0x412870[_0xc781('0x35')]:_0x14219f[_0xc781('0x30')];if(!_0x343fb6['query'][_0xc781('0x36')](_0xc781('0x37'))){_0x412870[_0xc781('0x1c')]=qs[_0xc781('0x1c')](_0x343fb6[_0xc781('0x31')][_0xc781('0x1c')]);_0x412870[_0xc781('0x19')]=qs[_0xc781('0x19')](_0x343fb6[_0xc781('0x31')][_0xc781('0x19')]);}_0x412870[_0xc781('0x38')]=qs[_0xc781('0x39')](_0x343fb6['query']['sort']);_0x412870[_0xc781('0x3a')]=qs[_0xc781('0x32')](_[_0xc781('0x3b')](_0x343fb6[_0xc781('0x31')],_0x14219f[_0xc781('0x32')]),_0x161611);if(_0x343fb6['query'][_0xc781('0x3c')]){_0x412870[_0xc781('0x3a')]=_['merge'](_0x412870[_0xc781('0x3a')],{'$or':_[_0xc781('0x2a')](_0x161611,function(_0x3ca494){if(_0x3ca494['type']!==_0xc781('0x3d')){var _0x1803a8={};_0x1803a8[_0x3ca494[_0xc781('0x27')]]={'$like':'%'+_0x343fb6['query'][_0xc781('0x3c')]+'%'};return _0x1803a8;}})});}_0x412870=_[_0xc781('0x3e')]({},_0x412870,_0x343fb6[_0xc781('0x3f')]);var _0x330bba={'where':_0x412870[_0xc781('0x3a')]};return db[_0xc781('0x2b')][_0xc781('0x1b')](_0x330bba)[_0xc781('0x22')](function(_0x404bed){_0x15b831[_0xc781('0x1b')]=_0x404bed;if(_0x343fb6[_0xc781('0x31')][_0xc781('0x40')]){_0x412870[_0xc781('0x41')]=[{'all':!![]}];}return db[_0xc781('0x2b')]['findAll'](_0x412870);})['then'](function(_0xaadfab){_0x15b831[_0xc781('0x42')]=_0xaadfab;return _0x15b831;})[_0xc781('0x22')](respondWithFilteredResult(_0x406565,_0x412870))[_0xc781('0x43')](handleError(_0x406565,null));};exports[_0xc781('0x44')]=function(_0x1712b8,_0x3bc949){var _0x589e98={'raw':!![],'where':{'id':_0x1712b8[_0xc781('0x45')]['id']}},_0x27ed7a={};_0x27ed7a['model']=_[_0xc781('0x46')](db['CmHopperBlack'][_0xc781('0x2c')]);_0x27ed7a['query']=_[_0xc781('0x46')](_0x1712b8['query']);_0x27ed7a[_0xc781('0x32')]=_[_0xc781('0x33')](_0x27ed7a[_0xc781('0x30')],_0x27ed7a[_0xc781('0x31')]);_0x589e98[_0xc781('0x35')]=_[_0xc781('0x33')](_0x27ed7a[_0xc781('0x30')],qs['fields'](_0x1712b8['query']['fields']));_0x589e98[_0xc781('0x35')]=_0x589e98[_0xc781('0x35')][_0xc781('0x47')]?_0x589e98[_0xc781('0x35')]:_0x27ed7a[_0xc781('0x30')];if(_0x1712b8[_0xc781('0x31')][_0xc781('0x40')]){_0x589e98['include']=[{'all':!![]}];}_0x589e98=_[_0xc781('0x3e')]({},_0x589e98,_0x1712b8[_0xc781('0x3f')]);return db['CmHopperBlack']['find'](_0x589e98)[_0xc781('0x22')](handleEntityNotFound(_0x3bc949,null))[_0xc781('0x22')](respondWithResult(_0x3bc949,null))['catch'](handleError(_0x3bc949,null));};exports[_0xc781('0x21')]=function(_0x5c7d86,_0x1d5d55){if(_0x5c7d86[_0xc781('0x48')]['id']){delete _0x5c7d86['body']['id'];}return db[_0xc781('0x2b')]['find']({'where':{'id':_0x5c7d86[_0xc781('0x45')]['id']}})[_0xc781('0x22')](handleEntityNotFound(_0x1d5d55,null))[_0xc781('0x22')](saveUpdates(_0x5c7d86['body'],null))[_0xc781('0x22')](respondWithResult(_0x1d5d55,null))[_0xc781('0x43')](handleError(_0x1d5d55,null));};exports[_0xc781('0x23')]=function(_0x951136,_0x45a623){return db['CmHopperBlack'][_0xc781('0x49')]({'where':{'id':_0x951136[_0xc781('0x45')]['id']}})[_0xc781('0x22')](handleEntityNotFound(_0x45a623,null))[_0xc781('0x22')](removeEntity(_0x45a623,null))[_0xc781('0x43')](handleError(_0x45a623,null));};exports[_0xc781('0x4a')]=function(_0x45887f,_0x1cef23){return db[_0xc781('0x2b')]['describe']()['then'](respondWithResult(_0x1cef23,null))[_0xc781('0x43')](handleError(_0x1cef23,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index fff997c..3a3b368 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 _0x8a51=['util','../../config/logger','api','moment','bluebird','path','./cmHopperBlack.attributes','define','CmHopperBlack','lodash'];(function(_0x1f2ca3,_0x8516e7){var _0x195079=function(_0x1ba283){while(--_0x1ba283){_0x1f2ca3['push'](_0x1f2ca3['shift']());}};_0x195079(++_0x8516e7);}(_0x8a51,0xe5));var _0x18a5=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x8a51[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x18a5('0x0'));var util=require(_0x18a5('0x1'));var logger=require(_0x18a5('0x2'))(_0x18a5('0x3'));var moment=require(_0x18a5('0x4'));var BPromise=require(_0x18a5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x18a5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x18a5('0x7'));module['exports']=function(_0xab4f35,_0x4b400f){return _0xab4f35[_0x18a5('0x8')](_0x18a5('0x9'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35b4=['define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports'];(function(_0x355c9b,_0x53dffe){var _0x1b904e=function(_0x31f744){while(--_0x31f744){_0x355c9b['push'](_0x355c9b['shift']());}};_0x1b904e(++_0x53dffe);}(_0x35b4,0xc6));var _0x435b=function(_0xbee93e,_0x2bee60){_0xbee93e=_0xbee93e-0x0;var _0x554df8=_0x35b4[_0xbee93e];return _0x554df8;};'use strict';var _=require(_0x435b('0x0'));var util=require(_0x435b('0x1'));var logger=require(_0x435b('0x2'))(_0x435b('0x3'));var moment=require(_0x435b('0x4'));var BPromise=require(_0x435b('0x5'));var rp=require(_0x435b('0x6'));var fs=require('fs');var path=require(_0x435b('0x7'));var rimraf=require(_0x435b('0x8'));var config=require(_0x435b('0x9'));var attributes=require(_0x435b('0xa'));module[_0x435b('0xb')]=function(_0x4f6e4f,_0x5946dd){return _0x4f6e4f[_0x435b('0xc')](_0x435b('0xd'),attributes,{'tableName':_0x435b('0xe'),'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 9788762..b34ee1e 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 _0x024b=['stringify','code','error','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s'];(function(_0x419116,_0x5f2d14){var _0x293051=function(_0x276683){while(--_0x276683){_0x419116['push'](_0x419116['shift']());}};_0x293051(++_0x5f2d14);}(_0x024b,0x146));var _0xb024=function(_0xe977f5,_0x2ecc12){_0xe977f5=_0xe977f5-0x0;var _0x2c5800=_0x024b[_0xe977f5];return _0x2c5800;};'use strict';var _=require(_0xb024('0x0'));var util=require('util');var moment=require(_0xb024('0x1'));var BPromise=require(_0xb024('0x2'));var rs=require(_0xb024('0x3'));var fs=require('fs');var Redis=require(_0xb024('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb024('0x5'));var config=require(_0xb024('0x6'));var jayson=require(_0xb024('0x7'));var client=jayson[_0xb024('0x8')][_0xb024('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5468e4,_0x530a08,_0x29bfb0){return new BPromise(function(_0x266261,_0xa0c777){return client[_0xb024('0xa')](_0x5468e4,_0x29bfb0)[_0xb024('0xb')](function(_0x48ea76){logger['info'](_0xb024('0xc'),_0x530a08,_0xb024('0xd'));logger[_0xb024('0xe')](_0xb024('0xf'),_0x530a08,'request\x20sent',JSON[_0xb024('0x10')](_0x48ea76));if(_0x48ea76['error']){if(_0x48ea76['error'][_0xb024('0x11')]===0x1f4){logger[_0xb024('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x530a08,_0x48ea76['error'][_0xb024('0x13')]);return _0xa0c777(_0x48ea76[_0xb024('0x12')][_0xb024('0x13')]);}logger[_0xb024('0x12')](_0xb024('0xc'),_0x530a08,_0x48ea76[_0xb024('0x12')]['message']);return _0x266261(_0x48ea76[_0xb024('0x12')][_0xb024('0x13')]);}else{logger[_0xb024('0x14')](_0xb024('0xc'),_0x530a08,_0xb024('0xd'));_0x266261(_0x48ea76[_0xb024('0x15')][_0xb024('0x13')]);}})[_0xb024('0x16')](function(_0x32e446){logger['error'](_0xb024('0xc'),_0x530a08,_0x32e446);_0xa0c777(_0x32e446);});});}exports[_0xb024('0x17')]=function(_0x29ede0){var _0x3b3c9d=this;return new Promise(function(_0x5f4e08,_0x17fdc5){return db[_0xb024('0x18')]['findAll']({'raw':_0x29ede0['options']?_0x29ede0[_0xb024('0x19')][_0xb024('0x1a')]===undefined?!![]:![]:!![],'where':_0x29ede0[_0xb024('0x19')]?_0x29ede0[_0xb024('0x19')][_0xb024('0x1b')]||null:null,'attributes':_0x29ede0[_0xb024('0x19')]?_0x29ede0[_0xb024('0x19')][_0xb024('0x1c')]||null:null,'limit':_0x29ede0['options']?_0x29ede0['options'][_0xb024('0x1d')]||null:null,'include':_0x29ede0['options']?_0x29ede0['options'][_0xb024('0x1e')]?_['map'](_0x29ede0[_0xb024('0x19')][_0xb024('0x1e')],function(_0x182b86){return{'model':db[_0x182b86['model']],'as':_0x182b86['as'],'attributes':_0x182b86[_0xb024('0x1c')],'include':_0x182b86[_0xb024('0x1e')]?_['map'](_0x182b86[_0xb024('0x1e')],function(_0x132481){return{'model':db[_0x132481['model']],'as':_0x132481['as'],'attributes':_0x132481['attributes'],'include':_0x132481[_0xb024('0x1e')]?_[_0xb024('0x1f')](_0x132481[_0xb024('0x1e')],function(_0x274fb8){return{'model':db[_0x274fb8[_0xb024('0x20')]],'as':_0x274fb8['as'],'attributes':_0x274fb8[_0xb024('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb024('0xb')](function(_0x4d993d){logger[_0xb024('0x14')](_0xb024('0x17'),_0x29ede0);logger[_0xb024('0xe')](_0xb024('0x17'),_0x29ede0,JSON[_0xb024('0x10')](_0x4d993d));_0x5f4e08(_0x4d993d);})['catch'](function(_0x4d9d53){logger['error'](_0xb024('0x17'),_0x4d9d53[_0xb024('0x13')],_0x29ede0);_0x17fdc5(_0x3b3c9d[_0xb024('0x12')](0x1f4,_0x4d9d53[_0xb024('0x13')]));});});};exports[_0xb024('0x21')]=function(_0x272d15){var _0x5aebc0=this;return new Promise(function(_0x5357dd,_0x1171c8){return db[_0xb024('0x18')][_0xb024('0x22')](_0x272d15[_0xb024('0x23')],{'raw':_0x272d15[_0xb024('0x19')]?_0x272d15[_0xb024('0x19')][_0xb024('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x272d15['options']?_0x272d15[_0xb024('0x19')][_0xb024('0x1b')]||null:null,'attributes':_0x272d15[_0xb024('0x19')]?_0x272d15[_0xb024('0x19')]['attributes']||null:null,'limit':_0x272d15['options']?_0x272d15['options']['limit']||null:null})['then'](function(_0x38f94a){logger[_0xb024('0x14')]('UpdateCmHopperBlack',_0x272d15);logger[_0xb024('0xe')](_0xb024('0x21'),_0x272d15,JSON[_0xb024('0x10')](_0x38f94a));_0x5357dd(_0x38f94a);})[_0xb024('0x16')](function(_0x2201e6){logger['error'](_0xb024('0x21'),_0x2201e6[_0xb024('0x13')],_0x272d15);_0x1171c8(_0x5aebc0[_0xb024('0x12')](0x1f4,_0x2201e6[_0xb024('0x13')]));});});};exports[_0xb024('0x24')]=function(_0x3f7190){var _0x6fbd91=this;return new Promise(function(_0x780cdd,_0x1f61d0){return db[_0xb024('0x18')][_0xb024('0x25')]({'where':_0x3f7190[_0xb024('0x19')]?_0x3f7190[_0xb024('0x19')][_0xb024('0x1b')]||null:null})[_0xb024('0xb')](function(_0x1609d3){logger[_0xb024('0x14')](_0xb024('0x24'),_0x3f7190);logger[_0xb024('0xe')](_0xb024('0x24'),_0x3f7190,JSON[_0xb024('0x10')](_0x1609d3));_0x780cdd(_0x1609d3);})[_0xb024('0x16')](function(_0xead70d){logger[_0xb024('0x12')](_0xb024('0x24'),_0xead70d[_0xb024('0x13')],_0x3f7190);_0x1f61d0(_0x6fbd91[_0xb024('0x12')](0x1f4,_0xead70d['message']));});});}; \ No newline at end of file +var _0x4581=['../../mysqldb','../../config/utils','../../config/logger','client','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','code','error','message','result','GetCmHopperBlack','findAll','options','raw','where','include','model','map','attributes','stringify','catch','UpdateCmHopperBlack','CmHopperBlack','body','destroy','info','DestroyCmHopperBlack','moment','bluebird','randomstring','ioredis'];(function(_0x1cf9c5,_0x2e7562){var _0x367892=function(_0x34fd54){while(--_0x34fd54){_0x1cf9c5['push'](_0x1cf9c5['shift']());}};_0x367892(++_0x2e7562);}(_0x4581,0x1e6));var _0x1458=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4581[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1458('0x0'));var BPromise=require(_0x1458('0x1'));var rs=require(_0x1458('0x2'));var fs=require('fs');var Redis=require(_0x1458('0x3'));var db=require(_0x1458('0x4'))['db'];var utils=require(_0x1458('0x5'));var logger=require(_0x1458('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1458('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x191a7d,_0x5262ee,_0x5d72cf){return new BPromise(function(_0x494e9f,_0x94a013){return client[_0x1458('0x8')](_0x191a7d,_0x5d72cf)[_0x1458('0x9')](function(_0x125401){logger['info'](_0x1458('0xa'),_0x5262ee,_0x1458('0xb'));logger[_0x1458('0xc')](_0x1458('0xd'),_0x5262ee,_0x1458('0xb'),JSON['stringify'](_0x125401));if(_0x125401['error']){if(_0x125401['error'][_0x1458('0xe')]===0x1f4){logger['error'](_0x1458('0xa'),_0x5262ee,_0x125401[_0x1458('0xf')][_0x1458('0x10')]);return _0x94a013(_0x125401[_0x1458('0xf')][_0x1458('0x10')]);}logger[_0x1458('0xf')](_0x1458('0xa'),_0x5262ee,_0x125401['error'][_0x1458('0x10')]);return _0x494e9f(_0x125401[_0x1458('0xf')][_0x1458('0x10')]);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x5262ee,'request\x20sent');_0x494e9f(_0x125401[_0x1458('0x11')][_0x1458('0x10')]);}})['catch'](function(_0x4e1ffe){logger[_0x1458('0xf')](_0x1458('0xa'),_0x5262ee,_0x4e1ffe);_0x94a013(_0x4e1ffe);});});}exports[_0x1458('0x12')]=function(_0x1ebfa2){var _0x3d7549=this;return new Promise(function(_0x3fac29,_0x5e592f){return db['CmHopperBlack'][_0x1458('0x13')]({'raw':_0x1ebfa2[_0x1458('0x14')]?_0x1ebfa2[_0x1458('0x14')][_0x1458('0x15')]===undefined?!![]:![]:!![],'where':_0x1ebfa2[_0x1458('0x14')]?_0x1ebfa2[_0x1458('0x14')][_0x1458('0x16')]||null:null,'attributes':_0x1ebfa2[_0x1458('0x14')]?_0x1ebfa2[_0x1458('0x14')]['attributes']||null:null,'limit':_0x1ebfa2['options']?_0x1ebfa2['options']['limit']||null:null,'include':_0x1ebfa2[_0x1458('0x14')]?_0x1ebfa2['options'][_0x1458('0x17')]?_['map'](_0x1ebfa2[_0x1458('0x14')][_0x1458('0x17')],function(_0x396b24){return{'model':db[_0x396b24[_0x1458('0x18')]],'as':_0x396b24['as'],'attributes':_0x396b24['attributes'],'include':_0x396b24[_0x1458('0x17')]?_[_0x1458('0x19')](_0x396b24[_0x1458('0x17')],function(_0xe6abc8){return{'model':db[_0xe6abc8['model']],'as':_0xe6abc8['as'],'attributes':_0xe6abc8['attributes'],'include':_0xe6abc8[_0x1458('0x17')]?_[_0x1458('0x19')](_0xe6abc8['include'],function(_0x3eccf6){return{'model':db[_0x3eccf6[_0x1458('0x18')]],'as':_0x3eccf6['as'],'attributes':_0x3eccf6[_0x1458('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a4c79){logger['info'](_0x1458('0x12'),_0x1ebfa2);logger[_0x1458('0xc')](_0x1458('0x12'),_0x1ebfa2,JSON[_0x1458('0x1b')](_0x4a4c79));_0x3fac29(_0x4a4c79);})[_0x1458('0x1c')](function(_0x508cbe){logger[_0x1458('0xf')]('GetCmHopperBlack',_0x508cbe[_0x1458('0x10')],_0x1ebfa2);_0x5e592f(_0x3d7549[_0x1458('0xf')](0x1f4,_0x508cbe['message']));});});};exports[_0x1458('0x1d')]=function(_0x40be5b){var _0x439a99=this;return new Promise(function(_0x2e55d0,_0x5576af){return db[_0x1458('0x1e')]['update'](_0x40be5b[_0x1458('0x1f')],{'raw':_0x40be5b[_0x1458('0x14')]?_0x40be5b[_0x1458('0x14')][_0x1458('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40be5b[_0x1458('0x14')]?_0x40be5b[_0x1458('0x14')]['where']||null:null,'attributes':_0x40be5b['options']?_0x40be5b['options'][_0x1458('0x1a')]||null:null,'limit':_0x40be5b[_0x1458('0x14')]?_0x40be5b[_0x1458('0x14')]['limit']||null:null})[_0x1458('0x9')](function(_0x5329f6){logger['info']('UpdateCmHopperBlack',_0x40be5b);logger[_0x1458('0xc')]('UpdateCmHopperBlack',_0x40be5b,JSON['stringify'](_0x5329f6));_0x2e55d0(_0x5329f6);})[_0x1458('0x1c')](function(_0x213a18){logger[_0x1458('0xf')](_0x1458('0x1d'),_0x213a18['message'],_0x40be5b);_0x5576af(_0x439a99[_0x1458('0xf')](0x1f4,_0x213a18[_0x1458('0x10')]));});});};exports['DestroyCmHopperBlack']=function(_0x263d47){var _0x2bb2d7=this;return new Promise(function(_0x15d26d,_0x2476f1){return db[_0x1458('0x1e')][_0x1458('0x20')]({'where':_0x263d47[_0x1458('0x14')]?_0x263d47[_0x1458('0x14')][_0x1458('0x16')]||null:null})[_0x1458('0x9')](function(_0x3130ac){logger[_0x1458('0x21')](_0x1458('0x22'),_0x263d47);logger[_0x1458('0xc')](_0x1458('0x22'),_0x263d47,JSON['stringify'](_0x3130ac));_0x15d26d(_0x3130ac);})['catch'](function(_0x57084f){logger[_0x1458('0xf')]('DestroyCmHopperBlack',_0x57084f['message'],_0x263d47);_0x2476f1(_0x2bb2d7[_0x1458('0xf')](0x1f4,_0x57084f[_0x1458('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 2539851..163c601 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 _0x6f44=['get','index','/describe','/:id','show','update','delete','isAuthenticated','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x6f44,0x1ea));var _0x46f4=function(_0x18705e,_0x860be2){_0x18705e=_0x18705e-0x0;var _0x4e0717=_0x6f44[_0x18705e];return _0x4e0717;};'use strict';var multer=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var path=require('path');var timeout=require(_0x46f4('0x2'));var express=require(_0x46f4('0x3'));var router=express[_0x46f4('0x4')]();var fs_extra=require(_0x46f4('0x5'));var auth=require(_0x46f4('0x6'));var interaction=require(_0x46f4('0x7'));var config=require(_0x46f4('0x8'));var controller=require(_0x46f4('0x9'));router[_0x46f4('0xa')]('/',auth['isAuthenticated'](),controller[_0x46f4('0xb')]);router[_0x46f4('0xa')](_0x46f4('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x46f4('0xa')](_0x46f4('0xd'),auth['isAuthenticated'](),controller[_0x46f4('0xe')]);router['put'](_0x46f4('0xd'),auth['isAuthenticated'](),controller[_0x46f4('0xf')]);router[_0x46f4('0x10')](_0x46f4('0xd'),auth[_0x46f4('0x11')](),controller[_0x46f4('0x12')]);module[_0x46f4('0x13')]=router; \ No newline at end of file +var _0x687b=['isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get'];(function(_0x28fca4,_0x11e78b){var _0x42fd01=function(_0x33a97e){while(--_0x33a97e){_0x28fca4['push'](_0x28fca4['shift']());}};_0x42fd01(++_0x11e78b);}(_0x687b,0x14a));var _0xb687=function(_0x30b159,_0x3fbb50){_0x30b159=_0x30b159-0x0;var _0x23c3f9=_0x687b[_0x30b159];return _0x23c3f9;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb687('0x4'));var auth=require(_0xb687('0x5'));var interaction=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var controller=require(_0xb687('0x8'));router[_0xb687('0x9')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0xb')]);router[_0xb687('0x9')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0x9')]('/:id',auth[_0xb687('0xa')](),controller[_0xb687('0xe')]);router[_0xb687('0xf')](_0xb687('0x10'),auth[_0xb687('0xa')](),controller[_0xb687('0x11')]);router[_0xb687('0x12')](_0xb687('0x10'),auth[_0xb687('0xa')](),controller['destroy']);module[_0xb687('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index ec8e0d5..15acbcf 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 _0x7727=['diff','seconds','BOOLEAN','moment','INTEGER','DATE','STRING','getDataValue','endtime','followuptime'];(function(_0x2549a7,_0x4bb1ec){var _0x35f470=function(_0x19ecac){while(--_0x19ecac){_0x2549a7['push'](_0x2549a7['shift']());}};_0x35f470(++_0x4bb1ec);}(_0x7727,0x143));var _0x7772=function(_0x2a03fb,_0x392cf0){_0x2a03fb=_0x2a03fb-0x0;var _0xe23717=_0x7727[_0x2a03fb];return _0xe23717;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7772('0x0'));module['exports']={'state':{'type':Sequelize[_0x7772('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x7772('0x2')]},'countbusyretry':{'type':Sequelize[_0x7772('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7772('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7772('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7772('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x7772('0x3')]},'originatecalleridname':{'type':Sequelize[_0x7772('0x3')]},'calleridnum':{'type':Sequelize[_0x7772('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x7772('0x2')]},'responsetime':{'type':Sequelize[_0x7772('0x2')]},'answertime':{'type':Sequelize[_0x7772('0x2')]},'droptime':{'type':Sequelize[_0x7772('0x2')]},'endtime':{'type':Sequelize[_0x7772('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7772('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7772('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7772('0x3')]},'campaign':{'type':Sequelize[_0x7772('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x7772('0x3')]},'disposition':{'type':Sequelize[_0x7772('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x7772('0x2')],'set':function(_0x40303a){var _0x306dbc=this[_0x7772('0x4')](_0x7772('0x5'));if(_0x306dbc&&_0x40303a){this['setDataValue'](_0x7772('0x6'),moment(_0x40303a)[_0x7772('0x7')](moment(_0x306dbc),_0x7772('0x8')));}}},'amd':{'type':Sequelize[_0x7772('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x7772('0x2')]},'callback':{'type':Sequelize[_0x7772('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7772('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7772('0x2')]},'deleted':{'type':Sequelize[_0x7772('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x7772('0x2')]},'recallme':{'type':Sequelize[_0x7772('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x7772('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7772('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7772('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbbf6=['exports','INTEGER','STRING','DATE','getDataValue','setDataValue','diff','BOOLEAN','sequelize'];(function(_0x3bbba6,_0x1b66f4){var _0x1a6895=function(_0x473c0a){while(--_0x473c0a){_0x3bbba6['push'](_0x3bbba6['shift']());}};_0x1a6895(++_0x1b66f4);}(_0xbbf6,0x143));var _0x6bbf=function(_0x3087d5,_0x5af83c){_0x3087d5=_0x3087d5-0x0;var _0x2f400c=_0xbbf6[_0x3087d5];return _0x2f400c;};'use strict';var Sequelize=require(_0x6bbf('0x0'));var moment=require('moment');module[_0x6bbf('0x1')]={'state':{'type':Sequelize[_0x6bbf('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6bbf('0x3')]},'scheduledat':{'type':Sequelize[_0x6bbf('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6bbf('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6bbf('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6bbf('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x6bbf('0x3')]},'originatecalleridname':{'type':Sequelize[_0x6bbf('0x3')]},'calleridnum':{'type':Sequelize[_0x6bbf('0x3')]},'calleridname':{'type':Sequelize[_0x6bbf('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x6bbf('0x4')]},'answertime':{'type':Sequelize[_0x6bbf('0x4')]},'droptime':{'type':Sequelize[_0x6bbf('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x6bbf('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6bbf('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6bbf('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x6bbf('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6bbf('0x3')]},'reason':{'type':Sequelize[_0x6bbf('0x3')]},'disposition':{'type':Sequelize[_0x6bbf('0x3')]},'secondDisposition':{'type':Sequelize[_0x6bbf('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6bbf('0x3')]},'dispositionat':{'type':Sequelize[_0x6bbf('0x4')],'set':function(_0x3e2a3a){var _0x2d0030=this[_0x6bbf('0x5')]('endtime');if(_0x2d0030&&_0x3e2a3a){this[_0x6bbf('0x6')]('followuptime',moment(_0x3e2a3a)[_0x6bbf('0x7')](moment(_0x2d0030),'seconds'));}}},'amd':{'type':Sequelize[_0x6bbf('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6bbf('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x6bbf('0x4')]},'callback':{'type':Sequelize[_0x6bbf('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6bbf('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6bbf('0x4')]},'deleted':{'type':Sequelize[_0x6bbf('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x6bbf('0x4')]},'recallme':{'type':Sequelize[_0x6bbf('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x6bbf('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x6bbf('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6bbf('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6bbf('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6bbf('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6bbf('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 79384fb..7c84bfc 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 _0x3601=['noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','reCallContacts','moveContactsQueueCampaignHopperFinal','find','insert','into','phone','scheduledAt','ContactId','ListId','VoiceQueueId','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','createdAt','updatedAt','VoiceQueueId\x20=\x20?','state\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','from','cm_hopper','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','calleridnum','group','checkContactHopper','CmHopper','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','length','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null'];(function(_0x1cb043,_0xd453c1){var _0x168cf9=function(_0x546461){while(--_0x546461){_0x1cb043['push'](_0x1cb043['shift']());}};_0x168cf9(++_0xd453c1);}(_0x3601,0x138));var _0x1360=function(_0x35b320,_0x2d73cb){_0x35b320=_0x35b320-0x0;var _0x2fcd04=_0x3601[_0x35b320];return _0x2fcd04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1360('0x0'));var zipdir=require(_0x1360('0x1'));var jsonpatch=require(_0x1360('0x2'));var rp=require(_0x1360('0x3'));var moment=require(_0x1360('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1360('0x5'));var util=require(_0x1360('0x6'));var path=require(_0x1360('0x7'));var sox=require(_0x1360('0x8'));var csv=require(_0x1360('0x9'));var ejs=require(_0x1360('0xa'));var fs=require('fs');var fs_extra=require(_0x1360('0xb'));var _=require(_0x1360('0xc'));var squel=require('squel');var crypto=require(_0x1360('0xd'));var jsforce=require(_0x1360('0xe'));var deskjs=require(_0x1360('0xf'));var toCsv=require(_0x1360('0x9'));var querystring=require('querystring');var Papa=require(_0x1360('0x10'));var Redis=require('ioredis');var authService=require(_0x1360('0x11'));var qs=require(_0x1360('0x12'));var as=require(_0x1360('0x13'));var hardwareService=require(_0x1360('0x14'));var logger=require(_0x1360('0x15'))('api');var utils=require(_0x1360('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1360('0x17'));var db=require(_0x1360('0x18'))['db'];function respondWithStatusCode(_0x160463,_0x4a1f5e){_0x4a1f5e=_0x4a1f5e||0xcc;return function(_0x1592e6){if(_0x1592e6){return _0x160463['sendStatus'](_0x4a1f5e);}return _0x160463[_0x1360('0x19')](_0x4a1f5e)['end']();};}function respondWithResult(_0x114b01,_0x10aab9){_0x10aab9=_0x10aab9||0xc8;return function(_0x1363f0){if(_0x1363f0){return _0x114b01[_0x1360('0x19')](_0x10aab9)['json'](_0x1363f0);}};}function respondWithFilteredResult(_0x2361bb,_0x117ced){return function(_0x193fc){if(_0x193fc){var _0x298f46=typeof _0x117ced[_0x1360('0x1a')]===_0x1360('0x1b')&&typeof _0x117ced[_0x1360('0x1c')]===_0x1360('0x1b');var _0xdc2e5f=_0x193fc[_0x1360('0x1d')];var _0x33966e=_0x298f46?0x0:_0x117ced[_0x1360('0x1a')];var _0x3099e6=_0x298f46?_0x193fc[_0x1360('0x1d')]:_0x117ced[_0x1360('0x1a')]+_0x117ced[_0x1360('0x1c')];var _0x936bc3;if(_0x3099e6>=_0xdc2e5f){_0x3099e6=_0xdc2e5f;_0x936bc3=0xc8;}else{_0x936bc3=0xce;}_0x2361bb['status'](_0x936bc3);return _0x2361bb['set'](_0x1360('0x1e'),_0x33966e+'-'+_0x3099e6+'/'+_0xdc2e5f)['json'](_0x193fc);}return null;};}function patchUpdates(_0x13cf45){return function(_0x5cd711){try{jsonpatch[_0x1360('0x1f')](_0x5cd711,_0x13cf45,!![]);}catch(_0x42fb04){return BPromise['reject'](_0x42fb04);}return _0x5cd711[_0x1360('0x20')]();};}function saveUpdates(_0x33b252,_0x5ad2d3){return function(_0x535a3a){if(_0x535a3a){return _0x535a3a[_0x1360('0x21')](_0x33b252)[_0x1360('0x22')](function(_0x404565){return _0x404565;});}return null;};}function removeEntity(_0x478742,_0x366164){return function(_0x548b4d){if(_0x548b4d){return _0x548b4d[_0x1360('0x23')]()['then'](function(){_0x478742[_0x1360('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x545808,_0x2a4cd0){return function(_0x36813c){if(!_0x36813c){_0x545808[_0x1360('0x24')](0x194);}return _0x36813c;};}function handleError(_0x531ac8,_0x2f0299){_0x2f0299=_0x2f0299||0x1f4;return function(_0x58ba64){logger[_0x1360('0x25')](_0x58ba64['stack']);if(_0x58ba64[_0x1360('0x26')]){delete _0x58ba64[_0x1360('0x26')];}_0x531ac8[_0x1360('0x19')](_0x2f0299)[_0x1360('0x27')](_0x58ba64);};}exports[_0x1360('0x28')]=function(_0x1ea32c,_0xe0031f){var _0x4515fd={},_0x276504={},_0x358169={'count':0x0,'rows':[]};var _0x9aacc5=_[_0x1360('0x29')](db[_0x1360('0x2a')][_0x1360('0x2b')],function(_0x5daaad){return{'name':_0x5daaad[_0x1360('0x2c')],'type':_0x5daaad[_0x1360('0x2d')][_0x1360('0x2e')]};});_0x276504[_0x1360('0x2f')]=_[_0x1360('0x29')](_0x9aacc5,_0x1360('0x26'));_0x276504[_0x1360('0x30')]=_[_0x1360('0x31')](_0x1ea32c[_0x1360('0x30')]);_0x276504['filters']=_[_0x1360('0x32')](_0x276504[_0x1360('0x2f')],_0x276504[_0x1360('0x30')]);_0x4515fd[_0x1360('0x33')]=_[_0x1360('0x32')](_0x276504['model'],qs[_0x1360('0x34')](_0x1ea32c[_0x1360('0x30')][_0x1360('0x34')]));_0x4515fd[_0x1360('0x33')]=_0x4515fd['attributes']['length']?_0x4515fd[_0x1360('0x33')]:_0x276504[_0x1360('0x2f')];if(!_0x1ea32c[_0x1360('0x30')]['hasOwnProperty'](_0x1360('0x35'))){_0x4515fd['limit']=qs[_0x1360('0x1c')](_0x1ea32c[_0x1360('0x30')][_0x1360('0x1c')]);_0x4515fd['offset']=qs[_0x1360('0x1a')](_0x1ea32c[_0x1360('0x30')]['offset']);}_0x4515fd[_0x1360('0x36')]=qs[_0x1360('0x37')](_0x1ea32c['query'][_0x1360('0x37')]);_0x4515fd[_0x1360('0x38')]=qs['filters'](_[_0x1360('0x39')](_0x1ea32c[_0x1360('0x30')],_0x276504['filters']),_0x9aacc5);if(_0x1ea32c['query'][_0x1360('0x3a')]){_0x4515fd[_0x1360('0x38')]=_[_0x1360('0x3b')](_0x4515fd[_0x1360('0x38')],{'$or':_[_0x1360('0x29')](_0x9aacc5,function(_0x576519){if(_0x576519[_0x1360('0x2d')]!==_0x1360('0x3c')){var _0x1bff33={};_0x1bff33[_0x576519[_0x1360('0x26')]]={'$like':'%'+_0x1ea32c[_0x1360('0x30')][_0x1360('0x3a')]+'%'};return _0x1bff33;}})});}_0x4515fd=_['merge']({},_0x4515fd,_0x1ea32c[_0x1360('0x3d')]);var _0xc39ae8={'where':_0x4515fd[_0x1360('0x38')]};return db[_0x1360('0x2a')][_0x1360('0x1d')](_0xc39ae8)['then'](function(_0x350a5f){_0x358169['count']=_0x350a5f;if(_0x1ea32c[_0x1360('0x30')][_0x1360('0x3e')]){_0x4515fd[_0x1360('0x3f')]=[{'all':!![]}];}return db[_0x1360('0x2a')][_0x1360('0x40')](_0x4515fd);})[_0x1360('0x22')](function(_0x15bee5){_0x358169[_0x1360('0x41')]=_0x15bee5;return _0x358169;})[_0x1360('0x22')](respondWithFilteredResult(_0xe0031f,_0x4515fd))['catch'](handleError(_0xe0031f,null));};exports[_0x1360('0x42')]=function(_0x3ee4fe,_0x18d1c1){var _0x2a73f2={'raw':!![],'where':{'id':_0x3ee4fe['params']['id']}},_0x22f8ad={};_0x22f8ad[_0x1360('0x2f')]=_[_0x1360('0x31')](db[_0x1360('0x2a')]['rawAttributes']);_0x22f8ad['query']=_[_0x1360('0x31')](_0x3ee4fe[_0x1360('0x30')]);_0x22f8ad['filters']=_['intersection'](_0x22f8ad[_0x1360('0x2f')],_0x22f8ad[_0x1360('0x30')]);_0x2a73f2[_0x1360('0x33')]=_[_0x1360('0x32')](_0x22f8ad[_0x1360('0x2f')],qs[_0x1360('0x34')](_0x3ee4fe[_0x1360('0x30')]['fields']));_0x2a73f2[_0x1360('0x33')]=_0x2a73f2['attributes'][_0x1360('0x43')]?_0x2a73f2[_0x1360('0x33')]:_0x22f8ad['model'];if(_0x3ee4fe[_0x1360('0x30')][_0x1360('0x3e')]){_0x2a73f2[_0x1360('0x3f')]=[{'all':!![]}];}_0x2a73f2=_[_0x1360('0x3b')]({},_0x2a73f2,_0x3ee4fe['options']);return db['CmHopperFinal']['find'](_0x2a73f2)[_0x1360('0x22')](handleEntityNotFound(_0x18d1c1,null))['then'](respondWithResult(_0x18d1c1,null))[_0x1360('0x44')](handleError(_0x18d1c1,null));};exports[_0x1360('0x45')]=function(_0x10c4f7,_0x1070f5){return db[_0x1360('0x2a')][_0x1360('0x45')]()['then'](respondWithResult(_0x1070f5,null))[_0x1360('0x44')](handleError(_0x1070f5,null));};exports[_0x1360('0x21')]=function(_0x377ede,_0x22feb2){if(_0x377ede[_0x1360('0x46')][_0x1360('0x47')]){delete _0x377ede[_0x1360('0x46')][_0x1360('0x47')];}return db[_0x1360('0x2a')]['find']({'where':{'uniqueid':_0x377ede[_0x1360('0x48')]['id']}})['then'](handleEntityNotFound(_0x22feb2,null))[_0x1360('0x22')](saveUpdates(_0x377ede['body'],null))[_0x1360('0x22')](respondWithResult(_0x22feb2,null))['catch'](handleError(_0x22feb2,null));};exports[_0x1360('0x49')]=function(_0x306d9b,_0x3ebca6,_0x19b2a8){return db[_0x1360('0x2a')][_0x1360('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x306d9b[_0x1360('0x48')]['id']},'attributes':[[db[_0x1360('0x4a')]['fn'](_0x1360('0x4b'),db[_0x1360('0x4a')]['fn']('IF',db[_0x1360('0x4a')][_0x1360('0x4c')](_0x1360('0x4d')))),_0x1360('0x4e')],[db[_0x1360('0x4a')]['fn'](_0x1360('0x4b'),db['sequelize']['fn']('IF',db[_0x1360('0x4a')][_0x1360('0x4c')](_0x1360('0x4f')))),'noAnswerContacts'],[db[_0x1360('0x4a')]['fn'](_0x1360('0x4b'),db['sequelize']['fn']('IF',db[_0x1360('0x4a')][_0x1360('0x4c')](_0x1360('0x50')))),_0x1360('0x51')],[db['sequelize']['fn']('COUNT',db[_0x1360('0x4a')]['fn']('IF',db[_0x1360('0x4a')][_0x1360('0x4c')](_0x1360('0x52')))),_0x1360('0x53')],[db[_0x1360('0x4a')]['fn']('COUNT',db[_0x1360('0x4a')]['fn']('IF',db[_0x1360('0x4a')][_0x1360('0x4c')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x1360('0x54')],[db['sequelize']['fn'](_0x1360('0x4b'),db[_0x1360('0x4a')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x1360('0x55')],[db[_0x1360('0x4a')]['fn'](_0x1360('0x4b'),db['sequelize']['fn']('IF',db[_0x1360('0x4a')][_0x1360('0x4c')](_0x1360('0x56')))),'reCallContacts'],[db[_0x1360('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1360('0x4a')][_0x1360('0x4c')](_0x1360('0x57')))),_0x1360('0x58')]]})['then'](handleEntityNotFound(_0x3ebca6,null))[_0x1360('0x22')](respondWithResult(_0x3ebca6,null))['catch'](handleError(_0x3ebca6,null));};exports[_0x1360('0x59')]=function(_0x5c9cca,_0x1616bb,_0x13a5a9){return db[_0x1360('0x2a')][_0x1360('0x40')]({'raw':![],'where':{'CampaignId':_0x5c9cca[_0x1360('0x48')]['id']},'attributes':[[db[_0x1360('0x4a')]['fn'](_0x1360('0x4b'),db[_0x1360('0x4a')]['fn']('IF',db['sequelize'][_0x1360('0x4c')](_0x1360('0x4d')))),_0x1360('0x4e')],[db['sequelize']['fn']('COUNT',db[_0x1360('0x4a')]['fn']('IF',db['sequelize'][_0x1360('0x4c')](_0x1360('0x4f')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x1360('0x4b'),db[_0x1360('0x4a')]['fn']('IF',db[_0x1360('0x4a')][_0x1360('0x4c')](_0x1360('0x50')))),'busyContacts'],[db['sequelize']['fn'](_0x1360('0x4b'),db[_0x1360('0x4a')]['fn']('IF',db[_0x1360('0x4a')]['literal'](_0x1360('0x52')))),'congestionContacts'],[db[_0x1360('0x4a')]['fn'](_0x1360('0x4b'),db[_0x1360('0x4a')]['fn']('IF',db['sequelize'][_0x1360('0x4c')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x1360('0x54')],[db['sequelize']['fn'](_0x1360('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x1360('0x4c')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x1360('0x55')],[db[_0x1360('0x4a')]['fn']('COUNT',db[_0x1360('0x4a')]['fn']('IF',db[_0x1360('0x4a')]['literal'](_0x1360('0x56')))),_0x1360('0x5a')],[db[_0x1360('0x4a')]['fn'](_0x1360('0x4b'),db['sequelize']['fn']('IF',db[_0x1360('0x4a')][_0x1360('0x4c')](_0x1360('0x57')))),_0x1360('0x58')]]})[_0x1360('0x22')](handleEntityNotFound(_0x1616bb,null))['then'](respondWithResult(_0x1616bb,null))[_0x1360('0x44')](handleError(_0x1616bb,null));};exports[_0x1360('0x5b')]=function(_0x4147c1,_0x1cb452,_0x4f63b5){return db['VoiceQueue'][_0x1360('0x5c')]({'where':{'id':_0x4147c1[_0x1360('0x48')]['id']}})[_0x1360('0x22')](handleEntityNotFound(_0x1cb452,null))['then'](function(_0x35b18c){var _0x90e78d;if(_0x35b18c){_0x90e78d=squel[_0x1360('0x5d')]()[_0x1360('0x5e')]('cm_hopper')['fromQuery']([_0x1360('0x5f'),_0x1360('0x60'),_0x1360('0x61'),_0x1360('0x62'),_0x1360('0x63'),'createdAt','updatedAt'],squel[_0x1360('0x64')]()[_0x1360('0x65')](_0x1360('0x66'),'phone')[_0x1360('0x65')](_0x1360('0x67'),'scheduledAt')[_0x1360('0x65')]('ANY_VALUE(ContactId)',_0x1360('0x61'))[_0x1360('0x65')](_0x1360('0x68'),'ListId')[_0x1360('0x65')](_0x1360('0x69'),_0x1360('0x63'))[_0x1360('0x65')](_0x1360('0x67'),_0x1360('0x6a'))[_0x1360('0x65')](_0x1360('0x67'),_0x1360('0x6b'))['from']('cm_hopper_final')[_0x1360('0x38')](_0x1360('0x6c'),_0x4147c1[_0x1360('0x48')]['id']['toString']())[_0x1360('0x38')](_0x1360('0x6d'),_0x4147c1[_0x1360('0x46')]['state'][_0x1360('0x6e')]())['where'](_0x1360('0x6f'))[_0x1360('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x1360('0x5f'))[_0x1360('0x70')](_0x1360('0x71'))[_0x1360('0x38')]('VoiceQueueId\x20=\x20?',_0x4147c1[_0x1360('0x48')]['id']['toString']()))['where'](_0x1360('0x72'),squel[_0x1360('0x64')]()[_0x1360('0x65')]('calleridnum')[_0x1360('0x70')](_0x1360('0x73'))[_0x1360('0x38')]('VoiceQueueId\x20=\x20?',_0x4147c1[_0x1360('0x48')]['id'][_0x1360('0x6e')]())[_0x1360('0x38')](_0x1360('0x74')))['group']('ContactId'))[_0x1360('0x6e')]();return db['sequelize'][_0x1360('0x30')](_0x90e78d);}return[];})[_0x1360('0x22')](respondWithResult(_0x1cb452,null))[_0x1360('0x44')](handleError(_0x1cb452,null));};exports[_0x1360('0x75')]=function(_0x2dd5e1,_0x41a726,_0x28c748){return db[_0x1360('0x76')]['find']({'where':{'id':_0x2dd5e1[_0x1360('0x48')]['id']}})[_0x1360('0x22')](handleEntityNotFound(_0x41a726,null))[_0x1360('0x22')](function(_0x45dece){var _0xcab1b0;if(_0x45dece){_0xcab1b0=squel[_0x1360('0x5d')]()['into']('cm_hopper')[_0x1360('0x77')]([_0x1360('0x5f'),_0x1360('0x60'),_0x1360('0x61'),'ListId',_0x1360('0x78'),'createdAt',_0x1360('0x6b')],squel[_0x1360('0x64')]()[_0x1360('0x65')](_0x1360('0x66'),_0x1360('0x5f'))['field']('NOW()','scheduledAt')[_0x1360('0x65')](_0x1360('0x79'),'ContactId')[_0x1360('0x65')]('ANY_VALUE(ListId)',_0x1360('0x62'))[_0x1360('0x65')](_0x1360('0x7a'),_0x1360('0x78'))[_0x1360('0x65')]('NOW()',_0x1360('0x6a'))['field'](_0x1360('0x67'),_0x1360('0x6b'))['from'](_0x1360('0x73'))['where'](_0x1360('0x7b'),_0x2dd5e1[_0x1360('0x48')]['id']['toString']())[_0x1360('0x38')](_0x1360('0x6d'),_0x2dd5e1[_0x1360('0x46')][_0x1360('0x7c')][_0x1360('0x6e')]())[_0x1360('0x38')](_0x1360('0x6f'))[_0x1360('0x38')](_0x1360('0x72'),squel['select']()[_0x1360('0x65')](_0x1360('0x5f'))[_0x1360('0x70')]('cm_hopper')[_0x1360('0x38')]('CampaignId\x20=\x20?',_0x2dd5e1[_0x1360('0x48')]['id'][_0x1360('0x6e')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1360('0x64')]()[_0x1360('0x65')](_0x1360('0x7d'))[_0x1360('0x70')]('cm_hopper_final')[_0x1360('0x38')](_0x1360('0x7b'),_0x2dd5e1['params']['id'][_0x1360('0x6e')]())[_0x1360('0x38')](_0x1360('0x74')))[_0x1360('0x7e')]('ContactId'))['toString']();return db[_0x1360('0x4a')][_0x1360('0x30')](_0xcab1b0);}return[];})[_0x1360('0x22')](respondWithResult(_0x41a726,null))['catch'](handleError(_0x41a726,null));};exports[_0x1360('0x7f')]=function(_0x4ca130,_0x53b700,_0x56b62a){return db[_0x1360('0x80')][_0x1360('0x81')]({'where':{'VoiceQueueId':_0x4ca130[_0x1360('0x46')]['VoiceQueueId'],'CampaignId':_0x4ca130[_0x1360('0x46')][_0x1360('0x78')],'ContactId':_0x4ca130['body']['ContactId']}})[_0x1360('0x22')](handleEntityNotFound(_0x53b700,null))[_0x1360('0x22')](function(_0x251eb5){if(_0x251eb5){return _0x251eb5;}return null;})[_0x1360('0x22')](respondWithResult(_0x53b700,null))[_0x1360('0x44')](handleError(_0x53b700,null));}; \ No newline at end of file +var _0xbf7a=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','keys','CmHopperFinal','describe','uniqueid','find','params','body','countContactsQueueCampaignHopperFinal','findAll','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','from','cm_hopper_final','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','toString','calleridnum','VoiceQueueId\x20=\x20?','group','ContactId','moveContactsIvrCampaignHopperFinal','into','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId','state','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs'];(function(_0x1bed23,_0x394e7e){var _0x21dbe1=function(_0x5806dd){while(--_0x5806dd){_0x1bed23['push'](_0x1bed23['shift']());}};_0x21dbe1(++_0x394e7e);}(_0xbf7a,0x16e));var _0xabf7=function(_0x3892af,_0xa41575){_0x3892af=_0x3892af-0x0;var _0x39917d=_0xbf7a[_0x3892af];return _0x39917d;};'use strict';var emlformat=require(_0xabf7('0x0'));var rimraf=require(_0xabf7('0x1'));var zipdir=require(_0xabf7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabf7('0x3'));var moment=require(_0xabf7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xabf7('0x5'));var util=require(_0xabf7('0x6'));var path=require('path');var sox=require(_0xabf7('0x7'));var csv=require(_0xabf7('0x8'));var ejs=require(_0xabf7('0x9'));var fs=require('fs');var fs_extra=require(_0xabf7('0xa'));var _=require(_0xabf7('0xb'));var squel=require(_0xabf7('0xc'));var crypto=require(_0xabf7('0xd'));var jsforce=require(_0xabf7('0xe'));var deskjs=require(_0xabf7('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xabf7('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xabf7('0x11'));var as=require(_0xabf7('0x12'));var hardwareService=require(_0xabf7('0x13'));var logger=require(_0xabf7('0x14'))(_0xabf7('0x15'));var utils=require('../../config/utils');var config=require(_0xabf7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xabf7('0x17'))['db'];function respondWithStatusCode(_0x255aae,_0x2d3519){_0x2d3519=_0x2d3519||0xcc;return function(_0x3aa2b6){if(_0x3aa2b6){return _0x255aae['sendStatus'](_0x2d3519);}return _0x255aae[_0xabf7('0x18')](_0x2d3519)[_0xabf7('0x19')]();};}function respondWithResult(_0x12bf67,_0x5a9ec1){_0x5a9ec1=_0x5a9ec1||0xc8;return function(_0x28f7d0){if(_0x28f7d0){return _0x12bf67[_0xabf7('0x18')](_0x5a9ec1)['json'](_0x28f7d0);}};}function respondWithFilteredResult(_0x329ad7,_0x5db44e){return function(_0x1f2332){if(_0x1f2332){var _0x46f37f=typeof _0x5db44e['offset']===_0xabf7('0x1a')&&typeof _0x5db44e['limit']===_0xabf7('0x1a');var _0x446b38=_0x1f2332['count'];var _0x2047ae=_0x46f37f?0x0:_0x5db44e['offset'];var _0xc79d46=_0x46f37f?_0x1f2332[_0xabf7('0x1b')]:_0x5db44e[_0xabf7('0x1c')]+_0x5db44e[_0xabf7('0x1d')];var _0x341588;if(_0xc79d46>=_0x446b38){_0xc79d46=_0x446b38;_0x341588=0xc8;}else{_0x341588=0xce;}_0x329ad7[_0xabf7('0x18')](_0x341588);return _0x329ad7[_0xabf7('0x1e')]('Content-Range',_0x2047ae+'-'+_0xc79d46+'/'+_0x446b38)[_0xabf7('0x1f')](_0x1f2332);}return null;};}function patchUpdates(_0x2eb961){return function(_0x2a38d1){try{jsonpatch[_0xabf7('0x20')](_0x2a38d1,_0x2eb961,!![]);}catch(_0x3fd95e){return BPromise[_0xabf7('0x21')](_0x3fd95e);}return _0x2a38d1[_0xabf7('0x22')]();};}function saveUpdates(_0x281658,_0x2fa861){return function(_0x5b3f3e){if(_0x5b3f3e){return _0x5b3f3e[_0xabf7('0x23')](_0x281658)['then'](function(_0x1866c4){return _0x1866c4;});}return null;};}function removeEntity(_0x2f576d,_0x4846fa){return function(_0x2e87a9){if(_0x2e87a9){return _0x2e87a9['destroy']()[_0xabf7('0x24')](function(){_0x2f576d[_0xabf7('0x18')](0xcc)[_0xabf7('0x19')]();});}};}function handleEntityNotFound(_0x3cb173,_0x35c95f){return function(_0xc32aa2){if(!_0xc32aa2){_0x3cb173['sendStatus'](0x194);}return _0xc32aa2;};}function handleError(_0x193f73,_0x46d395){_0x46d395=_0x46d395||0x1f4;return function(_0xf6dd87){logger[_0xabf7('0x25')](_0xf6dd87['stack']);if(_0xf6dd87[_0xabf7('0x26')]){delete _0xf6dd87[_0xabf7('0x26')];}_0x193f73[_0xabf7('0x18')](_0x46d395)[_0xabf7('0x27')](_0xf6dd87);};}exports[_0xabf7('0x28')]=function(_0x76b150,_0x5b0d63){var _0xaf88a2={},_0x15be60={},_0x1f1709={'count':0x0,'rows':[]};var _0x13cac0=_[_0xabf7('0x29')](db['CmHopperFinal'][_0xabf7('0x2a')],function(_0x127af7){return{'name':_0x127af7[_0xabf7('0x2b')],'type':_0x127af7[_0xabf7('0x2c')][_0xabf7('0x2d')]};});_0x15be60[_0xabf7('0x2e')]=_['map'](_0x13cac0,_0xabf7('0x26'));_0x15be60[_0xabf7('0x2f')]=_['keys'](_0x76b150[_0xabf7('0x2f')]);_0x15be60[_0xabf7('0x30')]=_[_0xabf7('0x31')](_0x15be60[_0xabf7('0x2e')],_0x15be60['query']);_0xaf88a2[_0xabf7('0x32')]=_[_0xabf7('0x31')](_0x15be60['model'],qs[_0xabf7('0x33')](_0x76b150[_0xabf7('0x2f')][_0xabf7('0x33')]));_0xaf88a2[_0xabf7('0x32')]=_0xaf88a2[_0xabf7('0x32')][_0xabf7('0x34')]?_0xaf88a2[_0xabf7('0x32')]:_0x15be60[_0xabf7('0x2e')];if(!_0x76b150[_0xabf7('0x2f')][_0xabf7('0x35')]('nolimit')){_0xaf88a2[_0xabf7('0x1d')]=qs[_0xabf7('0x1d')](_0x76b150[_0xabf7('0x2f')]['limit']);_0xaf88a2[_0xabf7('0x1c')]=qs[_0xabf7('0x1c')](_0x76b150[_0xabf7('0x2f')][_0xabf7('0x1c')]);}_0xaf88a2[_0xabf7('0x36')]=qs[_0xabf7('0x37')](_0x76b150['query'][_0xabf7('0x37')]);_0xaf88a2[_0xabf7('0x38')]=qs[_0xabf7('0x30')](_[_0xabf7('0x39')](_0x76b150[_0xabf7('0x2f')],_0x15be60['filters']),_0x13cac0);if(_0x76b150[_0xabf7('0x2f')][_0xabf7('0x3a')]){_0xaf88a2[_0xabf7('0x38')]=_[_0xabf7('0x3b')](_0xaf88a2[_0xabf7('0x38')],{'$or':_[_0xabf7('0x29')](_0x13cac0,function(_0x524112){if(_0x524112['type']!=='VIRTUAL'){var _0x19ea83={};_0x19ea83[_0x524112[_0xabf7('0x26')]]={'$like':'%'+_0x76b150[_0xabf7('0x2f')]['filter']+'%'};return _0x19ea83;}})});}_0xaf88a2=_[_0xabf7('0x3b')]({},_0xaf88a2,_0x76b150[_0xabf7('0x3c')]);var _0x30c047={'where':_0xaf88a2['where']};return db['CmHopperFinal'][_0xabf7('0x1b')](_0x30c047)[_0xabf7('0x24')](function(_0x2778cf){_0x1f1709[_0xabf7('0x1b')]=_0x2778cf;if(_0x76b150[_0xabf7('0x2f')][_0xabf7('0x3d')]){_0xaf88a2[_0xabf7('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0xaf88a2);})[_0xabf7('0x24')](function(_0x160f47){_0x1f1709[_0xabf7('0x3f')]=_0x160f47;return _0x1f1709;})[_0xabf7('0x24')](respondWithFilteredResult(_0x5b0d63,_0xaf88a2))[_0xabf7('0x40')](handleError(_0x5b0d63,null));};exports['show']=function(_0x47917d,_0x3eb9b1){var _0x4c5d1f={'raw':!![],'where':{'id':_0x47917d['params']['id']}},_0x486468={};_0x486468[_0xabf7('0x2e')]=_[_0xabf7('0x41')](db[_0xabf7('0x42')]['rawAttributes']);_0x486468[_0xabf7('0x2f')]=_[_0xabf7('0x41')](_0x47917d[_0xabf7('0x2f')]);_0x486468[_0xabf7('0x30')]=_[_0xabf7('0x31')](_0x486468[_0xabf7('0x2e')],_0x486468[_0xabf7('0x2f')]);_0x4c5d1f[_0xabf7('0x32')]=_[_0xabf7('0x31')](_0x486468['model'],qs[_0xabf7('0x33')](_0x47917d[_0xabf7('0x2f')][_0xabf7('0x33')]));_0x4c5d1f[_0xabf7('0x32')]=_0x4c5d1f['attributes'][_0xabf7('0x34')]?_0x4c5d1f['attributes']:_0x486468[_0xabf7('0x2e')];if(_0x47917d[_0xabf7('0x2f')][_0xabf7('0x3d')]){_0x4c5d1f[_0xabf7('0x3e')]=[{'all':!![]}];}_0x4c5d1f=_[_0xabf7('0x3b')]({},_0x4c5d1f,_0x47917d[_0xabf7('0x3c')]);return db[_0xabf7('0x42')]['find'](_0x4c5d1f)[_0xabf7('0x24')](handleEntityNotFound(_0x3eb9b1,null))[_0xabf7('0x24')](respondWithResult(_0x3eb9b1,null))['catch'](handleError(_0x3eb9b1,null));};exports[_0xabf7('0x43')]=function(_0x3ba277,_0x33b880){return db[_0xabf7('0x42')][_0xabf7('0x43')]()[_0xabf7('0x24')](respondWithResult(_0x33b880,null))['catch'](handleError(_0x33b880,null));};exports[_0xabf7('0x23')]=function(_0x4dca31,_0x333bef){if(_0x4dca31['body']['uniqueid']){delete _0x4dca31['body'][_0xabf7('0x44')];}return db['CmHopperFinal'][_0xabf7('0x45')]({'where':{'uniqueid':_0x4dca31[_0xabf7('0x46')]['id']}})[_0xabf7('0x24')](handleEntityNotFound(_0x333bef,null))[_0xabf7('0x24')](saveUpdates(_0x4dca31[_0xabf7('0x47')],null))[_0xabf7('0x24')](respondWithResult(_0x333bef,null))[_0xabf7('0x40')](handleError(_0x333bef,null));};exports[_0xabf7('0x48')]=function(_0x56a3ba,_0x5f36b4,_0x3c009f){return db[_0xabf7('0x42')][_0xabf7('0x49')]({'raw':![],'where':{'VoiceQueueId':_0x56a3ba[_0xabf7('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0xabf7('0x4a'),db[_0xabf7('0x4b')]['fn']('IF',db['sequelize'][_0xabf7('0x4c')](_0xabf7('0x4d')))),'noSuchContacts'],[db['sequelize']['fn'](_0xabf7('0x4a'),db[_0xabf7('0x4b')]['fn']('IF',db[_0xabf7('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xabf7('0x4b')]['fn'](_0xabf7('0x4a'),db[_0xabf7('0x4b')]['fn']('IF',db[_0xabf7('0x4b')][_0xabf7('0x4c')]('`state`\x20=\x205,\x201,\x20null'))),_0xabf7('0x4e')],[db[_0xabf7('0x4b')]['fn'](_0xabf7('0x4a'),db[_0xabf7('0x4b')]['fn']('IF',db['sequelize'][_0xabf7('0x4c')](_0xabf7('0x4f')))),'congestionContacts'],[db[_0xabf7('0x4b')]['fn'](_0xabf7('0x4a'),db[_0xabf7('0x4b')]['fn']('IF',db[_0xabf7('0x4b')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xabf7('0x50')],[db['sequelize']['fn'](_0xabf7('0x4a'),db[_0xabf7('0x4b')]['fn']('IF',db['sequelize'][_0xabf7('0x4c')](_0xabf7('0x51')))),'abandonedContacts'],[db[_0xabf7('0x4b')]['fn'](_0xabf7('0x4a'),db[_0xabf7('0x4b')]['fn']('IF',db[_0xabf7('0x4b')][_0xabf7('0x4c')](_0xabf7('0x52')))),_0xabf7('0x53')],[db[_0xabf7('0x4b')]['fn'](_0xabf7('0x4a'),db['sequelize']['fn']('IF',db[_0xabf7('0x4b')][_0xabf7('0x4c')](_0xabf7('0x54')))),_0xabf7('0x55')]]})[_0xabf7('0x24')](handleEntityNotFound(_0x5f36b4,null))['then'](respondWithResult(_0x5f36b4,null))[_0xabf7('0x40')](handleError(_0x5f36b4,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5d2000,_0x49c5bc,_0x5b6fc2){return db['CmHopperFinal'][_0xabf7('0x49')]({'raw':![],'where':{'CampaignId':_0x5d2000['params']['id']},'attributes':[[db[_0xabf7('0x4b')]['fn'](_0xabf7('0x4a'),db[_0xabf7('0x4b')]['fn']('IF',db[_0xabf7('0x4b')][_0xabf7('0x4c')](_0xabf7('0x4d')))),_0xabf7('0x56')],[db[_0xabf7('0x4b')]['fn']('COUNT',db[_0xabf7('0x4b')]['fn']('IF',db[_0xabf7('0x4b')][_0xabf7('0x4c')](_0xabf7('0x57')))),_0xabf7('0x58')],[db['sequelize']['fn'](_0xabf7('0x4a'),db[_0xabf7('0x4b')]['fn']('IF',db[_0xabf7('0x4b')][_0xabf7('0x4c')]('`state`\x20=\x205,\x201,\x20null'))),_0xabf7('0x4e')],[db[_0xabf7('0x4b')]['fn'](_0xabf7('0x4a'),db[_0xabf7('0x4b')]['fn']('IF',db[_0xabf7('0x4b')][_0xabf7('0x4c')](_0xabf7('0x4f')))),_0xabf7('0x59')],[db['sequelize']['fn']('COUNT',db[_0xabf7('0x4b')]['fn']('IF',db['sequelize'][_0xabf7('0x4c')](_0xabf7('0x5a')))),_0xabf7('0x50')],[db[_0xabf7('0x4b')]['fn'](_0xabf7('0x4a'),db[_0xabf7('0x4b')]['fn']('IF',db[_0xabf7('0x4b')]['literal'](_0xabf7('0x51')))),_0xabf7('0x5b')],[db['sequelize']['fn'](_0xabf7('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0xabf7('0x4c')](_0xabf7('0x52')))),_0xabf7('0x53')],[db[_0xabf7('0x4b')]['fn'](_0xabf7('0x4a'),db[_0xabf7('0x4b')]['fn']('IF',db[_0xabf7('0x4b')]['literal'](_0xabf7('0x54')))),'answeringMachine']]})[_0xabf7('0x24')](handleEntityNotFound(_0x49c5bc,null))['then'](respondWithResult(_0x49c5bc,null))[_0xabf7('0x40')](handleError(_0x49c5bc,null));};exports[_0xabf7('0x5c')]=function(_0xad2d53,_0x1fb0bf,_0x237e19){return db[_0xabf7('0x5d')]['find']({'where':{'id':_0xad2d53['params']['id']}})[_0xabf7('0x24')](handleEntityNotFound(_0x1fb0bf,null))[_0xabf7('0x24')](function(_0x30678a){var _0x1e39cd;if(_0x30678a){_0x1e39cd=squel[_0xabf7('0x5e')]()['into'](_0xabf7('0x5f'))[_0xabf7('0x60')]([_0xabf7('0x61'),_0xabf7('0x62'),'ContactId',_0xabf7('0x63'),_0xabf7('0x64'),_0xabf7('0x65'),_0xabf7('0x66')],squel[_0xabf7('0x67')]()[_0xabf7('0x68')](_0xabf7('0x69'),_0xabf7('0x61'))[_0xabf7('0x68')](_0xabf7('0x6a'),'scheduledAt')['field'](_0xabf7('0x6b'),'ContactId')[_0xabf7('0x68')]('ANY_VALUE(ListId)',_0xabf7('0x63'))[_0xabf7('0x68')]('ANY_VALUE(VoiceQueueId)',_0xabf7('0x64'))[_0xabf7('0x68')](_0xabf7('0x6a'),'createdAt')['field'](_0xabf7('0x6a'),_0xabf7('0x66'))[_0xabf7('0x6c')](_0xabf7('0x6d'))['where']('VoiceQueueId\x20=\x20?',_0xad2d53[_0xabf7('0x46')]['id']['toString']())[_0xabf7('0x38')](_0xabf7('0x6e'),_0xad2d53[_0xabf7('0x47')]['state']['toString']())[_0xabf7('0x38')](_0xabf7('0x6f'))[_0xabf7('0x38')](_0xabf7('0x70'),squel[_0xabf7('0x67')]()[_0xabf7('0x68')](_0xabf7('0x61'))[_0xabf7('0x6c')](_0xabf7('0x5f'))['where']('VoiceQueueId\x20=\x20?',_0xad2d53[_0xabf7('0x46')]['id'][_0xabf7('0x71')]()))[_0xabf7('0x38')](_0xabf7('0x70'),squel[_0xabf7('0x67')]()['field'](_0xabf7('0x72'))[_0xabf7('0x6c')]('cm_hopper_final')['where'](_0xabf7('0x73'),_0xad2d53[_0xabf7('0x46')]['id']['toString']())['where']('state\x20=\x204'))[_0xabf7('0x74')](_0xabf7('0x75')))[_0xabf7('0x71')]();return db[_0xabf7('0x4b')][_0xabf7('0x2f')](_0x1e39cd);}return[];})[_0xabf7('0x24')](respondWithResult(_0x1fb0bf,null))[_0xabf7('0x40')](handleError(_0x1fb0bf,null));};exports[_0xabf7('0x76')]=function(_0x387e91,_0x3f1e8b,_0x450084){return db['Campaign'][_0xabf7('0x45')]({'where':{'id':_0x387e91[_0xabf7('0x46')]['id']}})[_0xabf7('0x24')](handleEntityNotFound(_0x3f1e8b,null))[_0xabf7('0x24')](function(_0xa3045){var _0x58fbe9;if(_0xa3045){_0x58fbe9=squel[_0xabf7('0x5e')]()[_0xabf7('0x77')](_0xabf7('0x5f'))['fromQuery']([_0xabf7('0x61'),_0xabf7('0x62'),'ContactId',_0xabf7('0x63'),'CampaignId',_0xabf7('0x65'),_0xabf7('0x66')],squel[_0xabf7('0x67')]()[_0xabf7('0x68')]('ANY_VALUE(calleridnum)',_0xabf7('0x61'))[_0xabf7('0x68')](_0xabf7('0x6a'),_0xabf7('0x62'))['field'](_0xabf7('0x6b'),'ContactId')['field'](_0xabf7('0x78'),_0xabf7('0x63'))[_0xabf7('0x68')](_0xabf7('0x79'),_0xabf7('0x7a'))['field'](_0xabf7('0x6a'),_0xabf7('0x65'))['field'](_0xabf7('0x6a'),_0xabf7('0x66'))['from']('cm_hopper_final')[_0xabf7('0x38')]('CampaignId\x20=\x20?',_0x387e91[_0xabf7('0x46')]['id'][_0xabf7('0x71')]())['where'](_0xabf7('0x6e'),_0x387e91[_0xabf7('0x47')][_0xabf7('0x7b')][_0xabf7('0x71')]())[_0xabf7('0x38')](_0xabf7('0x6f'))[_0xabf7('0x38')](_0xabf7('0x70'),squel[_0xabf7('0x67')]()['field'](_0xabf7('0x61'))[_0xabf7('0x6c')]('cm_hopper')[_0xabf7('0x38')]('CampaignId\x20=\x20?',_0x387e91['params']['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xabf7('0x67')]()[_0xabf7('0x68')](_0xabf7('0x72'))[_0xabf7('0x6c')]('cm_hopper_final')[_0xabf7('0x38')](_0xabf7('0x7c'),_0x387e91[_0xabf7('0x46')]['id'][_0xabf7('0x71')]())['where']('state\x20=\x204'))['group'](_0xabf7('0x75')))['toString']();return db[_0xabf7('0x4b')][_0xabf7('0x2f')](_0x58fbe9);}return[];})[_0xabf7('0x24')](respondWithResult(_0x3f1e8b,null))[_0xabf7('0x40')](handleError(_0x3f1e8b,null));};exports[_0xabf7('0x7d')]=function(_0x53c95c,_0x3e7168,_0x75a5d4){return db[_0xabf7('0x7e')][_0xabf7('0x7f')]({'where':{'VoiceQueueId':_0x53c95c['body']['VoiceQueueId'],'CampaignId':_0x53c95c[_0xabf7('0x47')][_0xabf7('0x7a')],'ContactId':_0x53c95c[_0xabf7('0x47')][_0xabf7('0x75')]}})['then'](handleEntityNotFound(_0x3e7168,null))[_0xabf7('0x24')](function(_0x63ba48){if(_0x63ba48){return _0x63ba48;}return null;})['then'](respondWithResult(_0x3e7168,null))['catch'](handleError(_0x3e7168,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index eb193ef..3766795 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 _0x595f=['CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./cmHopperFinal.attributes','exports'];(function(_0x46dedf,_0xa59cac){var _0x3851dc=function(_0x3bd161){while(--_0x3bd161){_0x46dedf['push'](_0x46dedf['shift']());}};_0x3851dc(++_0xa59cac);}(_0x595f,0x197));var _0xf595=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x595f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf595('0x0'));var util=require(_0xf595('0x1'));var logger=require(_0xf595('0x2'))(_0xf595('0x3'));var moment=require(_0xf595('0x4'));var BPromise=require(_0xf595('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf595('0x6'));var config=require('../../config/environment');var attributes=require(_0xf595('0x7'));module[_0xf595('0x8')]=function(_0x166f88,_0x169d11){return _0x166f88['define'](_0xf595('0x9'),attributes,{'tableName':_0xf595('0xa'),'paranoid':![],'indexes':[{'name':_0xf595('0xb'),'fields':[_0xf595('0xb')]},{'name':_0xf595('0xc'),'fields':[_0xf595('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc283=['calleridnum','uniqueid','util','../../config/logger','rimraf','../../config/environment','exports','CmHopperFinal','cm_hopper_final'];(function(_0x487496,_0x249683){var _0x539dc8=function(_0x2c38e1){while(--_0x2c38e1){_0x487496['push'](_0x487496['shift']());}};_0x539dc8(++_0x249683);}(_0xc283,0xa4));var _0x3c28=function(_0x591b48,_0xc7fd90){_0x591b48=_0x591b48-0x0;var _0x5785ea=_0xc283[_0x591b48];return _0x5785ea;};'use strict';var _=require('lodash');var util=require(_0x3c28('0x0'));var logger=require(_0x3c28('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3c28('0x2'));var config=require(_0x3c28('0x3'));var attributes=require('./cmHopperFinal.attributes');module[_0x3c28('0x4')]=function(_0x1ccf17,_0x534c02){return _0x1ccf17['define'](_0x3c28('0x5'),attributes,{'tableName':_0x3c28('0x6'),'paranoid':![],'indexes':[{'name':_0x3c28('0x7'),'fields':[_0x3c28('0x7')]},{'name':_0x3c28('0x8'),'fields':[_0x3c28('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 4c1ff86..326d962 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 _0xe59f=['request\x20sent','stringify','error','message','result','catch','CreateCmHopperFinal','CmHopperFinal','create','body','options','debug','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperFinal,\x20%s,\x20%s'];(function(_0x5f5d60,_0x3a3eaf){var _0x4abc85=function(_0x2df878){while(--_0x2df878){_0x5f5d60['push'](_0x5f5d60['shift']());}};_0x4abc85(++_0x3a3eaf);}(_0xe59f,0x15e));var _0xfe59=function(_0x1d7fb5,_0x2ee2d3){_0x1d7fb5=_0x1d7fb5-0x0;var _0x5ba978=_0xe59f[_0x1d7fb5];return _0x5ba978;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfe59('0x0'));var BPromise=require('bluebird');var rs=require(_0xfe59('0x1'));var fs=require('fs');var Redis=require(_0xfe59('0x2'));var db=require(_0xfe59('0x3'))['db'];var utils=require(_0xfe59('0x4'));var logger=require(_0xfe59('0x5'))('rpc');var config=require(_0xfe59('0x6'));var jayson=require(_0xfe59('0x7'));var client=jayson[_0xfe59('0x8')][_0xfe59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52b125,_0x2a8f25,_0x3f9335){return new BPromise(function(_0x312ff9,_0x35e1ed){return client[_0xfe59('0xa')](_0x52b125,_0x3f9335)[_0xfe59('0xb')](function(_0x2e28cf){logger[_0xfe59('0xc')](_0xfe59('0xd'),_0x2a8f25,_0xfe59('0xe'));logger['debug']('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x2a8f25,_0xfe59('0xe'),JSON[_0xfe59('0xf')](_0x2e28cf));if(_0x2e28cf['error']){if(_0x2e28cf[_0xfe59('0x10')]['code']===0x1f4){logger[_0xfe59('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x2a8f25,_0x2e28cf[_0xfe59('0x10')][_0xfe59('0x11')]);return _0x35e1ed(_0x2e28cf['error'][_0xfe59('0x11')]);}logger[_0xfe59('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x2a8f25,_0x2e28cf[_0xfe59('0x10')]['message']);return _0x312ff9(_0x2e28cf[_0xfe59('0x10')][_0xfe59('0x11')]);}else{logger[_0xfe59('0xc')]('CmHopperFinal,\x20%s,\x20%s',_0x2a8f25,_0xfe59('0xe'));_0x312ff9(_0x2e28cf[_0xfe59('0x12')][_0xfe59('0x11')]);}})[_0xfe59('0x13')](function(_0x2d5c6b){logger[_0xfe59('0x10')](_0xfe59('0xd'),_0x2a8f25,_0x2d5c6b);_0x35e1ed(_0x2d5c6b);});});}exports[_0xfe59('0x14')]=function(_0x213918){var _0x26ba40=this;return new Promise(function(_0x2d2a63,_0xa5140f){return db[_0xfe59('0x15')][_0xfe59('0x16')](_0x213918[_0xfe59('0x17')],{'raw':_0x213918[_0xfe59('0x18')]?_0x213918[_0xfe59('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xfe59('0xb')](function(_0x30c953){logger[_0xfe59('0xc')]('CreateCmHopperFinal',_0x213918);logger[_0xfe59('0x19')](_0xfe59('0x14'),_0x213918,JSON[_0xfe59('0xf')](_0x30c953));_0x2d2a63(_0x30c953);})[_0xfe59('0x13')](function(_0x412474){logger[_0xfe59('0x10')]('CreateCmHopperFinal',_0x412474[_0xfe59('0x11')],_0x213918);_0xa5140f(_0x26ba40['error'](0x1f4,_0x412474[_0xfe59('0x11')]));});});}; \ No newline at end of file +var _0x0f1f=['then','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x51ba79,_0x43bba6){var _0x2e2aab=function(_0x47abff){while(--_0x47abff){_0x51ba79['push'](_0x51ba79['shift']());}};_0x2e2aab(++_0x43bba6);}(_0x0f1f,0x1d6));var _0xf0f1=function(_0x1b7ab6,_0x4323b0){_0x1b7ab6=_0x1b7ab6-0x0;var _0x3d1e62=_0x0f1f[_0x1b7ab6];return _0x3d1e62;};'use strict';var _=require(_0xf0f1('0x0'));var util=require(_0xf0f1('0x1'));var moment=require(_0xf0f1('0x2'));var BPromise=require(_0xf0f1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0f1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf0f1('0x5'));var logger=require(_0xf0f1('0x6'))(_0xf0f1('0x7'));var config=require(_0xf0f1('0x8'));var jayson=require(_0xf0f1('0x9'));var client=jayson[_0xf0f1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25dd14,_0xc2b63b,_0x4015ec){return new BPromise(function(_0x6033c,_0x259cc9){return client['request'](_0x25dd14,_0x4015ec)['then'](function(_0x25714e){logger[_0xf0f1('0xb')](_0xf0f1('0xc'),_0xc2b63b,_0xf0f1('0xd'));logger['debug'](_0xf0f1('0xe'),_0xc2b63b,_0xf0f1('0xd'),JSON['stringify'](_0x25714e));if(_0x25714e[_0xf0f1('0xf')]){if(_0x25714e['error'][_0xf0f1('0x10')]===0x1f4){logger['error'](_0xf0f1('0xc'),_0xc2b63b,_0x25714e[_0xf0f1('0xf')][_0xf0f1('0x11')]);return _0x259cc9(_0x25714e[_0xf0f1('0xf')][_0xf0f1('0x11')]);}logger[_0xf0f1('0xf')]('CmHopperFinal,\x20%s,\x20%s',_0xc2b63b,_0x25714e['error'][_0xf0f1('0x11')]);return _0x6033c(_0x25714e[_0xf0f1('0xf')]['message']);}else{logger['info'](_0xf0f1('0xc'),_0xc2b63b,_0xf0f1('0xd'));_0x6033c(_0x25714e['result'][_0xf0f1('0x11')]);}})[_0xf0f1('0x12')](function(_0x5ca5d1){logger[_0xf0f1('0xf')]('CmHopperFinal,\x20%s,\x20%s',_0xc2b63b,_0x5ca5d1);_0x259cc9(_0x5ca5d1);});});}exports[_0xf0f1('0x13')]=function(_0x596765){var _0x1a85d9=this;return new Promise(function(_0x28e96b,_0x29cd66){return db[_0xf0f1('0x14')][_0xf0f1('0x15')](_0x596765['body'],{'raw':_0x596765[_0xf0f1('0x16')]?_0x596765[_0xf0f1('0x16')][_0xf0f1('0x17')]===undefined?!![]:![]:!![]})[_0xf0f1('0x18')](function(_0x4c95cb){logger[_0xf0f1('0xb')](_0xf0f1('0x13'),_0x596765);logger['debug']('CreateCmHopperFinal',_0x596765,JSON[_0xf0f1('0x19')](_0x4c95cb));_0x28e96b(_0x4c95cb);})[_0xf0f1('0x12')](function(_0x3eef78){logger['error']('CreateCmHopperFinal',_0x3eef78[_0xf0f1('0x11')],_0x596765);_0x29cd66(_0x1a85d9[_0xf0f1('0xf')](0x1f4,_0x3eef78[_0xf0f1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 4089484..9190fea 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 _0x4ea0=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util'];(function(_0x573423,_0x179191){var _0x224f01=function(_0x1ece6e){while(--_0x1ece6e){_0x573423['push'](_0x573423['shift']());}};_0x224f01(++_0x179191);}(_0x4ea0,0xf1));var _0x04ea=function(_0x594e11,_0x28f652){_0x594e11=_0x594e11-0x0;var _0x5418ad=_0x4ea0[_0x594e11];return _0x5418ad;};'use strict';var multer=require(_0x04ea('0x0'));var util=require(_0x04ea('0x1'));var path=require('path');var timeout=require(_0x04ea('0x2'));var express=require('express');var router=express[_0x04ea('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x04ea('0x4'));var interaction=require(_0x04ea('0x5'));var config=require(_0x04ea('0x6'));var controller=require(_0x04ea('0x7'));router[_0x04ea('0x8')]('/',auth[_0x04ea('0x9')](),controller[_0x04ea('0xa')]);router[_0x04ea('0x8')](_0x04ea('0xb'),auth[_0x04ea('0x9')](),controller[_0x04ea('0xc')]);router[_0x04ea('0x8')](_0x04ea('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x04ea('0xe'),auth['isAuthenticated'](),controller[_0x04ea('0xf')]);router['get'](_0x04ea('0x10'),auth[_0x04ea('0x9')](),controller[_0x04ea('0x11')]);router[_0x04ea('0x12')]('/voice/queue/moveContacts/:id',auth[_0x04ea('0x9')](),controller[_0x04ea('0x13')]);router['post'](_0x04ea('0x14'),auth[_0x04ea('0x9')](),controller[_0x04ea('0x15')]);router['post'](_0x04ea('0x16'),auth[_0x04ea('0x9')](),controller[_0x04ea('0x17')]);router[_0x04ea('0x18')]('/:id',auth[_0x04ea('0x9')](),controller[_0x04ea('0x19')]);module[_0x04ea('0x1a')]=router; \ No newline at end of file +var _0xcb8a=['countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xcb8a,0x1ed));var _0xacb8=function(_0x5adf2f,_0x5c0f21){_0x5adf2f=_0x5adf2f-0x0;var _0x28ca04=_0xcb8a[_0x5adf2f];return _0x28ca04;};'use strict';var multer=require(_0xacb8('0x0'));var util=require('util');var path=require(_0xacb8('0x1'));var timeout=require('connect-timeout');var express=require(_0xacb8('0x2'));var router=express[_0xacb8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xacb8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xacb8('0x5'));var controller=require(_0xacb8('0x6'));router[_0xacb8('0x7')]('/',auth[_0xacb8('0x8')](),controller[_0xacb8('0x9')]);router[_0xacb8('0x7')](_0xacb8('0xa'),auth[_0xacb8('0x8')](),controller['describe']);router[_0xacb8('0x7')](_0xacb8('0xb'),auth[_0xacb8('0x8')](),controller[_0xacb8('0xc')]);router[_0xacb8('0x7')]('/voice/queue/countAttributes/:id',auth[_0xacb8('0x8')](),controller[_0xacb8('0xd')]);router['get'](_0xacb8('0xe'),auth[_0xacb8('0x8')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xacb8('0xf')]('/voice/queue/moveContacts/:id',auth[_0xacb8('0x8')](),controller[_0xacb8('0x10')]);router[_0xacb8('0xf')](_0xacb8('0x11'),auth[_0xacb8('0x8')](),controller[_0xacb8('0x12')]);router[_0xacb8('0xf')](_0xacb8('0x13'),auth[_0xacb8('0x8')](),controller[_0xacb8('0x14')]);router[_0xacb8('0x15')](_0xacb8('0xb'),auth[_0xacb8('0x8')](),controller['update']);module[_0xacb8('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 8f94df4..d4eb40b 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 _0x9bfc=['INTEGER','STRING','DATE','BOOLEAN','exports'];(function(_0x1311d5,_0x4b4113){var _0x294c60=function(_0x311472){while(--_0x311472){_0x1311d5['push'](_0x1311d5['shift']());}};_0x294c60(++_0x4b4113);}(_0x9bfc,0x1da));var _0xc9bf=function(_0x528ffb,_0x2df4e0){_0x528ffb=_0x528ffb-0x0;var _0x41895=_0x9bfc[_0x528ffb];return _0x41895;};'use strict';var Sequelize=require('sequelize');module[_0xc9bf('0x0')]={'state':{'type':Sequelize[_0xc9bf('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc9bf('0x2')]},'scheduledat':{'type':Sequelize[_0xc9bf('0x3')]},'countbusyretry':{'type':Sequelize[_0xc9bf('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc9bf('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc9bf('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc9bf('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xc9bf('0x2')]},'calleridnum':{'type':Sequelize[_0xc9bf('0x2')]},'calleridname':{'type':Sequelize[_0xc9bf('0x2')]},'starttime':{'type':Sequelize[_0xc9bf('0x3')]},'responsetime':{'type':Sequelize[_0xc9bf('0x3')]},'answertime':{'type':Sequelize[_0xc9bf('0x3')]},'droptime':{'type':Sequelize[_0xc9bf('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xc9bf('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc9bf('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc9bf('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc9bf('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc9bf('0x2')]},'campaign':{'type':Sequelize[_0xc9bf('0x2')]},'campaigntype':{'type':Sequelize[_0xc9bf('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xc9bf('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xc9bf('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xc9bf('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xc9bf('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xc9bf('0x3')]},'edited':{'type':Sequelize[_0xc9bf('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xc9bf('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc9bf('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc9bf('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc9bf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x20c0=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x19fae8,_0x287951){var _0xe2b0e8=function(_0x3f40b0){while(--_0x3f40b0){_0x19fae8['push'](_0x19fae8['shift']());}};_0xe2b0e8(++_0x287951);}(_0x20c0,0x135));var _0x020c=function(_0x1a72f7,_0x294718){_0x1a72f7=_0x1a72f7-0x0;var _0x2204fd=_0x20c0[_0x1a72f7];return _0x2204fd;};'use strict';var Sequelize=require(_0x020c('0x0'));module[_0x020c('0x1')]={'state':{'type':Sequelize[_0x020c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x020c('0x3')]},'scheduledat':{'type':Sequelize[_0x020c('0x4')]},'countbusyretry':{'type':Sequelize[_0x020c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x020c('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x020c('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x020c('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x020c('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x020c('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x020c('0x3')]},'starttime':{'type':Sequelize[_0x020c('0x4')]},'responsetime':{'type':Sequelize[_0x020c('0x4')]},'answertime':{'type':Sequelize[_0x020c('0x4')]},'droptime':{'type':Sequelize[_0x020c('0x4')]},'endtime':{'type':Sequelize[_0x020c('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x020c('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x020c('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x020c('0x3')]},'campaign':{'type':Sequelize[_0x020c('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x020c('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x020c('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x020c('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x020c('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x020c('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x020c('0x4')]},'recallme':{'type':Sequelize[_0x020c('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x020c('0x4')]},'edited':{'type':Sequelize[_0x020c('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x020c('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x020c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x020c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x020c('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x020c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 5fdd8c9..a1981cf 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 _0xfbba=['name','send','map','CmHopperHistory','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','uniqueid','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack'];(function(_0x5e9f1d,_0x57de63){var _0xa64898=function(_0x38a442){while(--_0x38a442){_0x5e9f1d['push'](_0x5e9f1d['shift']());}};_0xa64898(++_0x57de63);}(_0xfbba,0x18f));var _0xafbb=function(_0x2972d2,_0x5594c8){_0x2972d2=_0x2972d2-0x0;var _0x322d93=_0xfbba[_0x2972d2];return _0x322d93;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xafbb('0x0'));var rp=require(_0xafbb('0x1'));var moment=require('moment');var BPromise=require(_0xafbb('0x2'));var Mustache=require(_0xafbb('0x3'));var util=require(_0xafbb('0x4'));var path=require(_0xafbb('0x5'));var sox=require(_0xafbb('0x6'));var csv=require(_0xafbb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xafbb('0x8'));var _=require(_0xafbb('0x9'));var squel=require('squel');var crypto=require(_0xafbb('0xa'));var jsforce=require(_0xafbb('0xb'));var deskjs=require(_0xafbb('0xc'));var toCsv=require(_0xafbb('0x7'));var querystring=require('querystring');var Papa=require(_0xafbb('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xafbb('0xe'));var as=require(_0xafbb('0xf'));var hardwareService=require(_0xafbb('0x10'));var logger=require(_0xafbb('0x11'))(_0xafbb('0x12'));var utils=require(_0xafbb('0x13'));var config=require(_0xafbb('0x14'));var licenseUtil=require(_0xafbb('0x15'));var db=require(_0xafbb('0x16'))['db'];function respondWithStatusCode(_0x4d60fe,_0x27a6b1){_0x27a6b1=_0x27a6b1||0xcc;return function(_0x637b36){if(_0x637b36){return _0x4d60fe[_0xafbb('0x17')](_0x27a6b1);}return _0x4d60fe['status'](_0x27a6b1)[_0xafbb('0x18')]();};}function respondWithResult(_0x43b77a,_0x42348c){_0x42348c=_0x42348c||0xc8;return function(_0x5b6778){if(_0x5b6778){return _0x43b77a[_0xafbb('0x19')](_0x42348c)['json'](_0x5b6778);}};}function respondWithFilteredResult(_0x12b334,_0x4f5b6c){return function(_0x234c89){if(_0x234c89){var _0x524c1b=typeof _0x4f5b6c[_0xafbb('0x1a')]==='undefined'&&typeof _0x4f5b6c[_0xafbb('0x1b')]==='undefined';var _0x48d385=_0x234c89[_0xafbb('0x1c')];var _0x2f9c11=_0x524c1b?0x0:_0x4f5b6c[_0xafbb('0x1a')];var _0x254387=_0x524c1b?_0x234c89[_0xafbb('0x1c')]:_0x4f5b6c['offset']+_0x4f5b6c[_0xafbb('0x1b')];var _0x5efe36;if(_0x254387>=_0x48d385){_0x254387=_0x48d385;_0x5efe36=0xc8;}else{_0x5efe36=0xce;}_0x12b334[_0xafbb('0x19')](_0x5efe36);return _0x12b334[_0xafbb('0x1d')](_0xafbb('0x1e'),_0x2f9c11+'-'+_0x254387+'/'+_0x48d385)[_0xafbb('0x1f')](_0x234c89);}return null;};}function patchUpdates(_0x172be3){return function(_0x3244e3){try{jsonpatch['apply'](_0x3244e3,_0x172be3,!![]);}catch(_0x529906){return BPromise[_0xafbb('0x20')](_0x529906);}return _0x3244e3[_0xafbb('0x21')]();};}function saveUpdates(_0x268a7d,_0x3a5a61){return function(_0x1f860d){if(_0x1f860d){return _0x1f860d[_0xafbb('0x22')](_0x268a7d)[_0xafbb('0x23')](function(_0x29d6af){return _0x29d6af;});}return null;};}function removeEntity(_0x232596,_0x1ba461){return function(_0x14f3a2){if(_0x14f3a2){return _0x14f3a2[_0xafbb('0x24')]()['then'](function(){_0x232596['status'](0xcc)[_0xafbb('0x18')]();});}};}function handleEntityNotFound(_0x3178dc,_0x311c5e){return function(_0x2c8d50){if(!_0x2c8d50){_0x3178dc[_0xafbb('0x17')](0x194);}return _0x2c8d50;};}function handleError(_0x4f0404,_0x1da945){_0x1da945=_0x1da945||0x1f4;return function(_0x2d94ba){logger[_0xafbb('0x25')](_0x2d94ba[_0xafbb('0x26')]);if(_0x2d94ba[_0xafbb('0x27')]){delete _0x2d94ba[_0xafbb('0x27')];}_0x4f0404[_0xafbb('0x19')](_0x1da945)[_0xafbb('0x28')](_0x2d94ba);};}exports['index']=function(_0x21ca61,_0x355365){var _0x1becf3={},_0x123038={},_0x59bb17={'count':0x0,'rows':[]};var _0x5100e2=_[_0xafbb('0x29')](db[_0xafbb('0x2a')][_0xafbb('0x2b')],function(_0xc34e50){return{'name':_0xc34e50[_0xafbb('0x2c')],'type':_0xc34e50[_0xafbb('0x2d')]['key']};});_0x123038['model']=_[_0xafbb('0x29')](_0x5100e2,_0xafbb('0x27'));_0x123038[_0xafbb('0x2e')]=_[_0xafbb('0x2f')](_0x21ca61[_0xafbb('0x2e')]);_0x123038['filters']=_[_0xafbb('0x30')](_0x123038['model'],_0x123038[_0xafbb('0x2e')]);_0x1becf3[_0xafbb('0x31')]=_[_0xafbb('0x30')](_0x123038[_0xafbb('0x32')],qs[_0xafbb('0x33')](_0x21ca61['query'][_0xafbb('0x33')]));_0x1becf3[_0xafbb('0x31')]=_0x1becf3[_0xafbb('0x31')][_0xafbb('0x34')]?_0x1becf3[_0xafbb('0x31')]:_0x123038['model'];if(!_0x21ca61[_0xafbb('0x2e')][_0xafbb('0x35')](_0xafbb('0x36'))){_0x1becf3[_0xafbb('0x1b')]=qs[_0xafbb('0x1b')](_0x21ca61['query'][_0xafbb('0x1b')]);_0x1becf3[_0xafbb('0x1a')]=qs['offset'](_0x21ca61[_0xafbb('0x2e')]['offset']);}_0x1becf3['order']=qs[_0xafbb('0x37')](_0x21ca61[_0xafbb('0x2e')]['sort']);_0x1becf3[_0xafbb('0x38')]=qs[_0xafbb('0x39')](_['pick'](_0x21ca61[_0xafbb('0x2e')],_0x123038[_0xafbb('0x39')]),_0x5100e2);if(_0x21ca61['query']['filter']){_0x1becf3[_0xafbb('0x38')]=_['merge'](_0x1becf3[_0xafbb('0x38')],{'$or':_[_0xafbb('0x29')](_0x5100e2,function(_0x523e85){if(_0x523e85[_0xafbb('0x2d')]!==_0xafbb('0x3a')){var _0x2dfce0={};_0x2dfce0[_0x523e85[_0xafbb('0x27')]]={'$like':'%'+_0x21ca61[_0xafbb('0x2e')]['filter']+'%'};return _0x2dfce0;}})});}_0x1becf3=_[_0xafbb('0x3b')]({},_0x1becf3,_0x21ca61[_0xafbb('0x3c')]);var _0x5f664a={'where':_0x1becf3[_0xafbb('0x38')]};return db[_0xafbb('0x2a')][_0xafbb('0x1c')](_0x5f664a)[_0xafbb('0x23')](function(_0x22d851){_0x59bb17[_0xafbb('0x1c')]=_0x22d851;if(_0x21ca61[_0xafbb('0x2e')][_0xafbb('0x3d')]){_0x1becf3['include']=[{'all':!![]}];}return db[_0xafbb('0x2a')][_0xafbb('0x3e')](_0x1becf3);})[_0xafbb('0x23')](function(_0x2f7bbb){_0x59bb17[_0xafbb('0x3f')]=_0x2f7bbb;return _0x59bb17;})[_0xafbb('0x23')](respondWithFilteredResult(_0x355365,_0x1becf3))[_0xafbb('0x40')](handleError(_0x355365,null));};exports[_0xafbb('0x41')]=function(_0x5128b5,_0x373f0b){var _0x40584c={'raw':!![],'where':{'id':_0x5128b5[_0xafbb('0x42')]['id']}},_0x4963a7={};_0x4963a7[_0xafbb('0x32')]=_[_0xafbb('0x2f')](db['CmHopperHistory'][_0xafbb('0x2b')]);_0x4963a7[_0xafbb('0x2e')]=_[_0xafbb('0x2f')](_0x5128b5[_0xafbb('0x2e')]);_0x4963a7[_0xafbb('0x39')]=_[_0xafbb('0x30')](_0x4963a7[_0xafbb('0x32')],_0x4963a7[_0xafbb('0x2e')]);_0x40584c[_0xafbb('0x31')]=_['intersection'](_0x4963a7[_0xafbb('0x32')],qs[_0xafbb('0x33')](_0x5128b5[_0xafbb('0x2e')][_0xafbb('0x33')]));_0x40584c['attributes']=_0x40584c['attributes'][_0xafbb('0x34')]?_0x40584c[_0xafbb('0x31')]:_0x4963a7['model'];if(_0x5128b5[_0xafbb('0x2e')]['includeAll']){_0x40584c[_0xafbb('0x43')]=[{'all':!![]}];}_0x40584c=_[_0xafbb('0x3b')]({},_0x40584c,_0x5128b5['options']);return db[_0xafbb('0x2a')][_0xafbb('0x44')](_0x40584c)[_0xafbb('0x23')](handleEntityNotFound(_0x373f0b,null))[_0xafbb('0x23')](respondWithResult(_0x373f0b,null))[_0xafbb('0x40')](handleError(_0x373f0b,null));};exports[_0xafbb('0x45')]=function(_0x30baa6,_0x576572){return db['CmHopperHistory'][_0xafbb('0x45')](_0x30baa6[_0xafbb('0x46')],{})['then'](respondWithResult(_0x576572,0xc9))['catch'](handleError(_0x576572,null));};exports[_0xafbb('0x47')]=function(_0x2d4c78,_0x3e2347){return db[_0xafbb('0x2a')][_0xafbb('0x47')]()[_0xafbb('0x23')](respondWithResult(_0x3e2347,null))['catch'](handleError(_0x3e2347,null));};exports[_0xafbb('0x22')]=function(_0x52f39b,_0x31623b){if(_0x52f39b[_0xafbb('0x46')][_0xafbb('0x48')]){delete _0x52f39b[_0xafbb('0x46')][_0xafbb('0x48')];}return db[_0xafbb('0x2a')][_0xafbb('0x44')]({'where':{'uniqueid':_0x52f39b[_0xafbb('0x42')]['id']}})[_0xafbb('0x23')](handleEntityNotFound(_0x31623b,null))[_0xafbb('0x23')](saveUpdates(_0x52f39b[_0xafbb('0x46')],null))[_0xafbb('0x23')](respondWithResult(_0x31623b,null))[_0xafbb('0x40')](handleError(_0x31623b,null));}; \ No newline at end of file +var _0xc05e=['rows','show','params','find','create','body','catch','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc05e,0x18f));var _0xec05=function(_0x4c6436,_0x2aec52){_0x4c6436=_0x4c6436-0x0;var _0x1219a2=_0xc05e[_0x4c6436];return _0x1219a2;};'use strict';var emlformat=require(_0xec05('0x0'));var rimraf=require(_0xec05('0x1'));var zipdir=require(_0xec05('0x2'));var jsonpatch=require(_0xec05('0x3'));var rp=require(_0xec05('0x4'));var moment=require('moment');var BPromise=require(_0xec05('0x5'));var Mustache=require('mustache');var util=require(_0xec05('0x6'));var path=require(_0xec05('0x7'));var sox=require(_0xec05('0x8'));var csv=require('to-csv');var ejs=require(_0xec05('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec05('0xa'));var squel=require(_0xec05('0xb'));var crypto=require(_0xec05('0xc'));var jsforce=require(_0xec05('0xd'));var deskjs=require(_0xec05('0xe'));var toCsv=require(_0xec05('0xf'));var querystring=require(_0xec05('0x10'));var Papa=require(_0xec05('0x11'));var Redis=require(_0xec05('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xec05('0x13'));var as=require(_0xec05('0x14'));var hardwareService=require(_0xec05('0x15'));var logger=require('../../config/logger')(_0xec05('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xec05('0x17'))['db'];function respondWithStatusCode(_0x4c7f61,_0x46335e){_0x46335e=_0x46335e||0xcc;return function(_0x21d778){if(_0x21d778){return _0x4c7f61[_0xec05('0x18')](_0x46335e);}return _0x4c7f61[_0xec05('0x19')](_0x46335e)[_0xec05('0x1a')]();};}function respondWithResult(_0x39ba11,_0x3002b5){_0x3002b5=_0x3002b5||0xc8;return function(_0x1342b8){if(_0x1342b8){return _0x39ba11['status'](_0x3002b5)['json'](_0x1342b8);}};}function respondWithFilteredResult(_0x226209,_0x24f6ae){return function(_0xe676a8){if(_0xe676a8){var _0x16c64e=typeof _0x24f6ae[_0xec05('0x1b')]==='undefined'&&typeof _0x24f6ae[_0xec05('0x1c')]===_0xec05('0x1d');var _0x2171c4=_0xe676a8[_0xec05('0x1e')];var _0x419928=_0x16c64e?0x0:_0x24f6ae[_0xec05('0x1b')];var _0x3c708a=_0x16c64e?_0xe676a8[_0xec05('0x1e')]:_0x24f6ae[_0xec05('0x1b')]+_0x24f6ae['limit'];var _0x149adc;if(_0x3c708a>=_0x2171c4){_0x3c708a=_0x2171c4;_0x149adc=0xc8;}else{_0x149adc=0xce;}_0x226209['status'](_0x149adc);return _0x226209[_0xec05('0x1f')](_0xec05('0x20'),_0x419928+'-'+_0x3c708a+'/'+_0x2171c4)[_0xec05('0x21')](_0xe676a8);}return null;};}function patchUpdates(_0x33eda0){return function(_0x1b6121){try{jsonpatch[_0xec05('0x22')](_0x1b6121,_0x33eda0,!![]);}catch(_0x169e9c){return BPromise[_0xec05('0x23')](_0x169e9c);}return _0x1b6121[_0xec05('0x24')]();};}function saveUpdates(_0x3d1ec0,_0x502149){return function(_0x5c13fd){if(_0x5c13fd){return _0x5c13fd[_0xec05('0x25')](_0x3d1ec0)[_0xec05('0x26')](function(_0x573741){return _0x573741;});}return null;};}function removeEntity(_0x1dbdff,_0x13ba81){return function(_0x4b34cb){if(_0x4b34cb){return _0x4b34cb['destroy']()[_0xec05('0x26')](function(){_0x1dbdff['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x363c5a,_0x52620e){return function(_0x357afb){if(!_0x357afb){_0x363c5a['sendStatus'](0x194);}return _0x357afb;};}function handleError(_0x27d332,_0x148299){_0x148299=_0x148299||0x1f4;return function(_0x2d2ad0){logger[_0xec05('0x27')](_0x2d2ad0[_0xec05('0x28')]);if(_0x2d2ad0[_0xec05('0x29')]){delete _0x2d2ad0[_0xec05('0x29')];}_0x27d332[_0xec05('0x19')](_0x148299)[_0xec05('0x2a')](_0x2d2ad0);};}exports[_0xec05('0x2b')]=function(_0x2e01d7,_0x417df5){var _0x16c9db={},_0x1916ad={},_0x40588b={'count':0x0,'rows':[]};var _0x5634f=_[_0xec05('0x2c')](db[_0xec05('0x2d')][_0xec05('0x2e')],function(_0x421829){return{'name':_0x421829[_0xec05('0x2f')],'type':_0x421829[_0xec05('0x30')][_0xec05('0x31')]};});_0x1916ad[_0xec05('0x32')]=_[_0xec05('0x2c')](_0x5634f,'name');_0x1916ad['query']=_[_0xec05('0x33')](_0x2e01d7[_0xec05('0x34')]);_0x1916ad[_0xec05('0x35')]=_['intersection'](_0x1916ad['model'],_0x1916ad[_0xec05('0x34')]);_0x16c9db[_0xec05('0x36')]=_[_0xec05('0x37')](_0x1916ad[_0xec05('0x32')],qs[_0xec05('0x38')](_0x2e01d7[_0xec05('0x34')][_0xec05('0x38')]));_0x16c9db[_0xec05('0x36')]=_0x16c9db[_0xec05('0x36')][_0xec05('0x39')]?_0x16c9db[_0xec05('0x36')]:_0x1916ad[_0xec05('0x32')];if(!_0x2e01d7[_0xec05('0x34')][_0xec05('0x3a')]('nolimit')){_0x16c9db['limit']=qs[_0xec05('0x1c')](_0x2e01d7[_0xec05('0x34')][_0xec05('0x1c')]);_0x16c9db['offset']=qs[_0xec05('0x1b')](_0x2e01d7['query'][_0xec05('0x1b')]);}_0x16c9db[_0xec05('0x3b')]=qs[_0xec05('0x3c')](_0x2e01d7[_0xec05('0x34')]['sort']);_0x16c9db['where']=qs[_0xec05('0x35')](_['pick'](_0x2e01d7[_0xec05('0x34')],_0x1916ad[_0xec05('0x35')]),_0x5634f);if(_0x2e01d7['query'][_0xec05('0x3d')]){_0x16c9db[_0xec05('0x3e')]=_[_0xec05('0x3f')](_0x16c9db[_0xec05('0x3e')],{'$or':_[_0xec05('0x2c')](_0x5634f,function(_0x323397){if(_0x323397[_0xec05('0x30')]!==_0xec05('0x40')){var _0x24de31={};_0x24de31[_0x323397['name']]={'$like':'%'+_0x2e01d7[_0xec05('0x34')][_0xec05('0x3d')]+'%'};return _0x24de31;}})});}_0x16c9db=_[_0xec05('0x3f')]({},_0x16c9db,_0x2e01d7[_0xec05('0x41')]);var _0x361fe3={'where':_0x16c9db[_0xec05('0x3e')]};return db[_0xec05('0x2d')][_0xec05('0x1e')](_0x361fe3)[_0xec05('0x26')](function(_0x3c13ae){_0x40588b[_0xec05('0x1e')]=_0x3c13ae;if(_0x2e01d7[_0xec05('0x34')][_0xec05('0x42')]){_0x16c9db[_0xec05('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xec05('0x44')](_0x16c9db);})[_0xec05('0x26')](function(_0xbbb0bf){_0x40588b[_0xec05('0x45')]=_0xbbb0bf;return _0x40588b;})[_0xec05('0x26')](respondWithFilteredResult(_0x417df5,_0x16c9db))['catch'](handleError(_0x417df5,null));};exports[_0xec05('0x46')]=function(_0x3c2134,_0x47156b){var _0x1ec25f={'raw':!![],'where':{'id':_0x3c2134[_0xec05('0x47')]['id']}},_0xf80245={};_0xf80245['model']=_[_0xec05('0x33')](db[_0xec05('0x2d')][_0xec05('0x2e')]);_0xf80245['query']=_[_0xec05('0x33')](_0x3c2134[_0xec05('0x34')]);_0xf80245['filters']=_[_0xec05('0x37')](_0xf80245[_0xec05('0x32')],_0xf80245['query']);_0x1ec25f[_0xec05('0x36')]=_[_0xec05('0x37')](_0xf80245[_0xec05('0x32')],qs[_0xec05('0x38')](_0x3c2134['query'][_0xec05('0x38')]));_0x1ec25f['attributes']=_0x1ec25f['attributes'][_0xec05('0x39')]?_0x1ec25f[_0xec05('0x36')]:_0xf80245[_0xec05('0x32')];if(_0x3c2134[_0xec05('0x34')][_0xec05('0x42')]){_0x1ec25f[_0xec05('0x43')]=[{'all':!![]}];}_0x1ec25f=_['merge']({},_0x1ec25f,_0x3c2134[_0xec05('0x41')]);return db[_0xec05('0x2d')][_0xec05('0x48')](_0x1ec25f)[_0xec05('0x26')](handleEntityNotFound(_0x47156b,null))[_0xec05('0x26')](respondWithResult(_0x47156b,null))['catch'](handleError(_0x47156b,null));};exports[_0xec05('0x49')]=function(_0x57d665,_0x586b16){return db[_0xec05('0x2d')][_0xec05('0x49')](_0x57d665[_0xec05('0x4a')],{})[_0xec05('0x26')](respondWithResult(_0x586b16,0xc9))[_0xec05('0x4b')](handleError(_0x586b16,null));};exports[_0xec05('0x4c')]=function(_0x3f5db0,_0x8da94d){return db[_0xec05('0x2d')]['describe']()[_0xec05('0x26')](respondWithResult(_0x8da94d,null))[_0xec05('0x4b')](handleError(_0x8da94d,null));};exports[_0xec05('0x25')]=function(_0x4029b6,_0x28adaf){if(_0x4029b6[_0xec05('0x4a')][_0xec05('0x4d')]){delete _0x4029b6[_0xec05('0x4a')][_0xec05('0x4d')];}return db[_0xec05('0x2d')][_0xec05('0x48')]({'where':{'uniqueid':_0x4029b6['params']['id']}})[_0xec05('0x26')](handleEntityNotFound(_0x28adaf,null))[_0xec05('0x26')](saveUpdates(_0x4029b6['body'],null))[_0xec05('0x26')](respondWithResult(_0x28adaf,null))[_0xec05('0x4b')](handleError(_0x28adaf,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 22c6a78..b4f0731 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 _0x6687=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0x6687,0x17b));var _0x7668=function(_0x1d8f33,_0x192d34){_0x1d8f33=_0x1d8f33-0x0;var _0x5a4a69=_0x6687[_0x1d8f33];return _0x5a4a69;};'use strict';var _=require(_0x7668('0x0'));var util=require(_0x7668('0x1'));var logger=require(_0x7668('0x2'))(_0x7668('0x3'));var moment=require(_0x7668('0x4'));var BPromise=require(_0x7668('0x5'));var rp=require(_0x7668('0x6'));var fs=require('fs');var path=require(_0x7668('0x7'));var rimraf=require(_0x7668('0x8'));var config=require(_0x7668('0x9'));var attributes=require(_0x7668('0xa'));module[_0x7668('0xb')]=function(_0x43e091,_0x4cb476){return _0x43e091[_0x7668('0xc')](_0x7668('0xd'),attributes,{'tableName':_0x7668('0xe'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0x7668('0xf'),'fields':[_0x7668('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b00=['lodash','api','moment','request-promise','path','rimraf','../../config/environment','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x5cdc79,_0x24beb1){var _0x22ddcf=function(_0x1f92bf){while(--_0x1f92bf){_0x5cdc79['push'](_0x5cdc79['shift']());}};_0x22ddcf(++_0x24beb1);}(_0x0b00,0x1a4));var _0x00b0=function(_0x5b62ae,_0x2ad7ea){_0x5b62ae=_0x5b62ae-0x0;var _0x56db8f=_0x0b00[_0x5b62ae];return _0x56db8f;};'use strict';var _=require(_0x00b0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x00b0('0x1'));var moment=require(_0x00b0('0x2'));var BPromise=require('bluebird');var rp=require(_0x00b0('0x3'));var fs=require('fs');var path=require(_0x00b0('0x4'));var rimraf=require(_0x00b0('0x5'));var config=require(_0x00b0('0x6'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x15547d,_0x49842a){return _0x15547d[_0x00b0('0x7')](_0x00b0('0x8'),attributes,{'tableName':_0x00b0('0x9'),'paranoid':![],'indexes':[{'name':_0x00b0('0xa'),'fields':[_0x00b0('0xa')]},{'name':_0x00b0('0xb'),'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 b4979c3..563f823 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 _0x4d02=['`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','ivrAnswerCallsDay','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateCmHopperHistory','create','options','raw','CmHopperHistory','findAll','where','sequelize','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null'];(function(_0x25fd7f,_0x1fc310){var _0x558eac=function(_0x47c161){while(--_0x47c161){_0x25fd7f['push'](_0x25fd7f['shift']());}};_0x558eac(++_0x1fc310);}(_0x4d02,0xff));var _0x24d0=function(_0x2e316a,_0x36559f){_0x2e316a=_0x2e316a-0x0;var _0x5c9790=_0x4d02[_0x2e316a];return _0x5c9790;};'use strict';var _=require(_0x24d0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x24d0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24d0('0x2'));var db=require(_0x24d0('0x3'))['db'];var utils=require(_0x24d0('0x4'));var logger=require(_0x24d0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x24d0('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4851a0,_0x34cfd2,_0x2cf9e9){return new BPromise(function(_0x4247a5,_0x4ae8a5){return client[_0x24d0('0x7')](_0x4851a0,_0x2cf9e9)[_0x24d0('0x8')](function(_0x25cf37){logger[_0x24d0('0x9')](_0x24d0('0xa'),_0x34cfd2,'request\x20sent');logger[_0x24d0('0xb')](_0x24d0('0xc'),_0x34cfd2,_0x24d0('0xd'),JSON[_0x24d0('0xe')](_0x25cf37));if(_0x25cf37[_0x24d0('0xf')]){if(_0x25cf37[_0x24d0('0xf')][_0x24d0('0x10')]===0x1f4){logger[_0x24d0('0xf')](_0x24d0('0xa'),_0x34cfd2,_0x25cf37[_0x24d0('0xf')][_0x24d0('0x11')]);return _0x4ae8a5(_0x25cf37[_0x24d0('0xf')]['message']);}logger['error'](_0x24d0('0xa'),_0x34cfd2,_0x25cf37[_0x24d0('0xf')]['message']);return _0x4247a5(_0x25cf37['error'][_0x24d0('0x11')]);}else{logger['info'](_0x24d0('0xa'),_0x34cfd2,_0x24d0('0xd'));_0x4247a5(_0x25cf37['result'][_0x24d0('0x11')]);}})[_0x24d0('0x12')](function(_0x316e38){logger[_0x24d0('0xf')](_0x24d0('0xa'),_0x34cfd2,_0x316e38);_0x4ae8a5(_0x316e38);});});}exports[_0x24d0('0x13')]=function(_0x585154){var _0x39ae63=this;return new Promise(function(_0x27cc59,_0x2ada22){return db['CmHopperHistory'][_0x24d0('0x14')](_0x585154['body'],{'raw':_0x585154[_0x24d0('0x15')]?_0x585154[_0x24d0('0x15')][_0x24d0('0x16')]===undefined?!![]:![]:!![]})[_0x24d0('0x8')](function(_0x423ac1){logger[_0x24d0('0x9')](_0x24d0('0x13'),_0x585154);logger[_0x24d0('0xb')]('CreateCmHopperHistory',_0x585154,JSON['stringify'](_0x423ac1));_0x27cc59(_0x423ac1);})[_0x24d0('0x12')](function(_0x517774){logger[_0x24d0('0xf')](_0x24d0('0x13'),_0x517774['message'],_0x585154);_0x2ada22(_0x39ae63[_0x24d0('0xf')](0x1f4,_0x517774['message']));});});};exports['AvgHandleTime']=function(_0x14eda2){var _0x12ee7d=this;return new Promise(function(_0x261980,_0x5e0b81){return db[_0x24d0('0x17')][_0x24d0('0x18')]({'raw':_0x14eda2['options']?_0x14eda2[_0x24d0('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x14eda2[_0x24d0('0x15')]?_0x14eda2[_0x24d0('0x15')][_0x24d0('0x19')]||null:null,'attributes':[[db[_0x24d0('0x1a')]['fn']('COUNT',db[_0x24d0('0x1a')]['col']('id')),_0x24d0('0x1b')],[db['sequelize']['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db['sequelize'][_0x24d0('0x1d')](_0x24d0('0x1e')))),_0x24d0('0x1f')],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x24d0('0x20')],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db[_0x24d0('0x1a')][_0x24d0('0x1d')](_0x24d0('0x21')))),_0x24d0('0x22')],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x23'),db[_0x24d0('0x1a')]['fn']('IF',db['sequelize'][_0x24d0('0x1d')](_0x24d0('0x24')))),_0x24d0('0x25')],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x23'),db[_0x24d0('0x1a')]['fn']('IF',db['sequelize'][_0x24d0('0x1d')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0x24d0('0x8')](function(_0x3061b9){logger[_0x24d0('0x9')](_0x24d0('0x26'),_0x14eda2);logger[_0x24d0('0xb')](_0x24d0('0x26'),_0x14eda2,JSON[_0x24d0('0xe')](_0x3061b9));_0x261980(_0x3061b9);})['catch'](function(_0x35ca11){logger[_0x24d0('0xf')](_0x24d0('0x26'),_0x35ca11[_0x24d0('0x11')],_0x14eda2);_0x5e0b81(_0x12ee7d['error'](0x1f4,_0x35ca11['message']));});});};exports[_0x24d0('0x27')]=function(_0x34531b){var _0x12fdfa=this;return new Promise(function(_0x325f28,_0x445d8b){return db[_0x24d0('0x17')][_0x24d0('0x18')]({'raw':_0x34531b[_0x24d0('0x15')]?_0x34531b['options'][_0x24d0('0x16')]===undefined?!![]:![]:!![],'where':_0x34531b[_0x24d0('0x15')]?_0x34531b[_0x24d0('0x15')][_0x24d0('0x19')]||null:null,'attributes':[[_0x24d0('0x28'),_0x24d0('0x29')],[db[_0x24d0('0x1a')]['fn']('COUNT',db[_0x24d0('0x1a')]['fn']('IF',db[_0x24d0('0x1a')][_0x24d0('0x1d')](_0x24d0('0x2a')))),_0x24d0('0x2b')],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db[_0x24d0('0x1a')][_0x24d0('0x1d')](_0x24d0('0x2c')))),_0x24d0('0x2d')],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db[_0x24d0('0x1a')][_0x24d0('0x1d')](_0x24d0('0x1e')))),_0x24d0('0x2e')],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db['sequelize'][_0x24d0('0x1d')](_0x24d0('0x2f')))),'outboundBusyCallsDay'],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db[_0x24d0('0x1a')][_0x24d0('0x1d')](_0x24d0('0x30')))),'outboundCongestionCallsDay'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x24d0('0x1a')][_0x24d0('0x1d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db[_0x24d0('0x1a')][_0x24d0('0x1d')](_0x24d0('0x31')))),'outboundDropCallsDayCallersExit'],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db['sequelize'][_0x24d0('0x1d')](_0x24d0('0x32')))),'outboundUnknownCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x24d0('0x1a')]['fn']('IF',db[_0x24d0('0x1a')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x24d0('0x33')],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db[_0x24d0('0x1a')][_0x24d0('0x1d')]('`state`\x20=\x2014,\x201,\x20null'))),_0x24d0('0x34')],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db['sequelize'][_0x24d0('0x1d')](_0x24d0('0x35')))),'outboundRejectCallsDay'],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db['sequelize'][_0x24d0('0x1d')](_0x24d0('0x36')))),'outboundAnswerAgiCallsDay'],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x1c'),db['sequelize']['fn']('IF',db[_0x24d0('0x1a')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x24d0('0x37')],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db[_0x24d0('0x1a')][_0x24d0('0x1d')](_0x24d0('0x38')))),_0x24d0('0x39')]],'group':[_0x24d0('0x28')]})[_0x24d0('0x8')](function(_0x6886cc){logger[_0x24d0('0x9')]('GetVoiceQueueHopperHistory',_0x34531b);logger[_0x24d0('0xb')]('GetVoiceQueueHopperHistory',_0x34531b,JSON[_0x24d0('0xe')](_0x6886cc));_0x325f28(_0x6886cc);})[_0x24d0('0x12')](function(_0x2491c4){logger[_0x24d0('0xf')](_0x24d0('0x27'),_0x2491c4[_0x24d0('0x11')],_0x34531b);_0x445d8b(_0x12fdfa[_0x24d0('0xf')](0x1f4,_0x2491c4[_0x24d0('0x11')]));});});};exports[_0x24d0('0x3a')]=function(_0x738a3e){var _0x1896af=this;return new Promise(function(_0x4de976,_0x102129){return db[_0x24d0('0x17')][_0x24d0('0x18')]({'raw':_0x738a3e[_0x24d0('0x15')]?_0x738a3e[_0x24d0('0x15')][_0x24d0('0x16')]===undefined?!![]:![]:!![],'where':_0x738a3e['options']?_0x738a3e[_0x24d0('0x15')]['where']||null:null,'attributes':[['campaign',_0x24d0('0x29')],[db['sequelize']['fn']('COUNT',db['sequelize'][_0x24d0('0x3b')]('id')),'ivrTotalCallsDays'],[db[_0x24d0('0x1a')]['fn'](_0x24d0('0x1c'),db[_0x24d0('0x1a')]['fn']('IF',db[_0x24d0('0x1a')][_0x24d0('0x1d')](_0x24d0('0x1e')))),_0x24d0('0x3c')]],'group':['campaign']})[_0x24d0('0x8')](function(_0x5a7934){logger[_0x24d0('0x9')](_0x24d0('0x3a'),_0x738a3e);logger[_0x24d0('0xb')]('GetCampaignHopperHistory',_0x738a3e,JSON['stringify'](_0x5a7934));_0x4de976(_0x5a7934);})[_0x24d0('0x12')](function(_0xd64df9){logger[_0x24d0('0xf')](_0x24d0('0x3a'),_0xd64df9['message'],_0x738a3e);_0x102129(_0x1896af[_0x24d0('0xf')](0x1f4,_0xd64df9[_0x24d0('0x11')]));});});}; \ No newline at end of file +var _0x33d7=['`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay'];(function(_0x57a536,_0x2daac9){var _0x1758c4=function(_0x381257){while(--_0x381257){_0x57a536['push'](_0x57a536['shift']());}};_0x1758c4(++_0x2daac9);}(_0x33d7,0x117));var _0x733d=function(_0x4031f8,_0x27dbcf){_0x4031f8=_0x4031f8-0x0;var _0x262189=_0x33d7[_0x4031f8];return _0x262189;};'use strict';var _=require('lodash');var util=require(_0x733d('0x0'));var moment=require(_0x733d('0x1'));var BPromise=require(_0x733d('0x2'));var rs=require(_0x733d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x733d('0x4'))(_0x733d('0x5'));var config=require(_0x733d('0x6'));var jayson=require(_0x733d('0x7'));var client=jayson['client'][_0x733d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42560b,_0x43d5d1,_0x55faec){return new BPromise(function(_0x1c48ee,_0x74af68){return client[_0x733d('0x9')](_0x42560b,_0x55faec)[_0x733d('0xa')](function(_0x183d09){logger[_0x733d('0xb')](_0x733d('0xc'),_0x43d5d1,_0x733d('0xd'));logger[_0x733d('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x43d5d1,'request\x20sent',JSON[_0x733d('0xf')](_0x183d09));if(_0x183d09[_0x733d('0x10')]){if(_0x183d09[_0x733d('0x10')][_0x733d('0x11')]===0x1f4){logger['error'](_0x733d('0xc'),_0x43d5d1,_0x183d09[_0x733d('0x10')][_0x733d('0x12')]);return _0x74af68(_0x183d09[_0x733d('0x10')][_0x733d('0x12')]);}logger[_0x733d('0x10')](_0x733d('0xc'),_0x43d5d1,_0x183d09['error'][_0x733d('0x12')]);return _0x1c48ee(_0x183d09[_0x733d('0x10')][_0x733d('0x12')]);}else{logger[_0x733d('0xb')](_0x733d('0xc'),_0x43d5d1,'request\x20sent');_0x1c48ee(_0x183d09[_0x733d('0x13')][_0x733d('0x12')]);}})[_0x733d('0x14')](function(_0x5dfa76){logger['error'](_0x733d('0xc'),_0x43d5d1,_0x5dfa76);_0x74af68(_0x5dfa76);});});}exports[_0x733d('0x15')]=function(_0x27caad){var _0x301feb=this;return new Promise(function(_0xea35b8,_0x589f9d){return db[_0x733d('0x16')][_0x733d('0x17')](_0x27caad[_0x733d('0x18')],{'raw':_0x27caad[_0x733d('0x19')]?_0x27caad[_0x733d('0x19')][_0x733d('0x1a')]===undefined?!![]:![]:!![]})[_0x733d('0xa')](function(_0x38034f){logger[_0x733d('0xb')](_0x733d('0x15'),_0x27caad);logger[_0x733d('0xe')](_0x733d('0x15'),_0x27caad,JSON[_0x733d('0xf')](_0x38034f));_0xea35b8(_0x38034f);})['catch'](function(_0x8072ff){logger[_0x733d('0x10')]('CreateCmHopperHistory',_0x8072ff[_0x733d('0x12')],_0x27caad);_0x589f9d(_0x301feb[_0x733d('0x10')](0x1f4,_0x8072ff['message']));});});};exports[_0x733d('0x1b')]=function(_0x1b9881){var _0xd8cfa3=this;return new Promise(function(_0x30d452,_0x41cbac){return db[_0x733d('0x16')][_0x733d('0x1c')]({'raw':_0x1b9881[_0x733d('0x19')]?_0x1b9881[_0x733d('0x19')][_0x733d('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b9881[_0x733d('0x19')]?_0x1b9881[_0x733d('0x19')]['where']||null:null,'attributes':[[db[_0x733d('0x1d')]['fn'](_0x733d('0x1e'),db['sequelize'][_0x733d('0x1f')]('id')),_0x733d('0x20')],[db[_0x733d('0x1d')]['fn']('COUNT',db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')](_0x733d('0x22')))),_0x733d('0x23')],[db[_0x733d('0x1d')]['fn'](_0x733d('0x1e'),db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x733d('0x1d')]['fn'](_0x733d('0x1e'),db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')]['literal'](_0x733d('0x24')))),_0x733d('0x25')],[db[_0x733d('0x1d')]['fn'](_0x733d('0x26'),db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')](_0x733d('0x27')))),'predictiveIntervalAvgHoldtime'],[db[_0x733d('0x1d')]['fn']('AVG',db['sequelize']['fn']('IF',db['sequelize'][_0x733d('0x21')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0x733d('0xa')](function(_0x60dfbd){logger[_0x733d('0xb')](_0x733d('0x1b'),_0x1b9881);logger[_0x733d('0xe')](_0x733d('0x1b'),_0x1b9881,JSON['stringify'](_0x60dfbd));_0x30d452(_0x60dfbd);})[_0x733d('0x14')](function(_0x56d259){logger[_0x733d('0x10')](_0x733d('0x1b'),_0x56d259[_0x733d('0x12')],_0x1b9881);_0x41cbac(_0xd8cfa3[_0x733d('0x10')](0x1f4,_0x56d259[_0x733d('0x12')]));});});};exports[_0x733d('0x28')]=function(_0x547449){var _0x326729=this;return new Promise(function(_0x3f471a,_0x2400ab){return db[_0x733d('0x16')][_0x733d('0x1c')]({'raw':_0x547449[_0x733d('0x19')]?_0x547449[_0x733d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x547449[_0x733d('0x19')]?_0x547449['options'][_0x733d('0x29')]||null:null,'attributes':[[_0x733d('0x2a'),_0x733d('0x2b')],[db[_0x733d('0x1d')]['fn'](_0x733d('0x1e'),db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')](_0x733d('0x2c')))),_0x733d('0x2d')],[db[_0x733d('0x1d')]['fn']('COUNT',db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')](_0x733d('0x2e')))),_0x733d('0x2f')],[db[_0x733d('0x1d')]['fn'](_0x733d('0x1e'),db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')]('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0x733d('0x1d')]['fn'](_0x733d('0x1e'),db[_0x733d('0x1d')]['fn']('IF',db['sequelize'][_0x733d('0x21')](_0x733d('0x30')))),_0x733d('0x31')],[db[_0x733d('0x1d')]['fn'](_0x733d('0x1e'),db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x733d('0x1d')]['fn']('COUNT',db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')](_0x733d('0x32')))),'outboundDropCallsDayTimeout'],[db[_0x733d('0x1d')]['fn']('COUNT',db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')](_0x733d('0x33')))),_0x733d('0x34')],[db['sequelize']['fn'](_0x733d('0x1e'),db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')](_0x733d('0x35')))),_0x733d('0x36')],[db['sequelize']['fn'](_0x733d('0x1e'),db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')](_0x733d('0x37')))),'outboundBlacklistCallsDay'],[db[_0x733d('0x1d')]['fn']('COUNT',db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db[_0x733d('0x1d')]['fn'](_0x733d('0x1e'),db[_0x733d('0x1d')]['fn']('IF',db['sequelize'][_0x733d('0x21')](_0x733d('0x38')))),_0x733d('0x39')],[db[_0x733d('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0x733d('0x3a')],[db[_0x733d('0x1d')]['fn'](_0x733d('0x1e'),db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')](_0x733d('0x3b')))),_0x733d('0x39')],[db[_0x733d('0x1d')]['fn'](_0x733d('0x1e'),db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')](_0x733d('0x3c')))),_0x733d('0x3d')]],'group':['campaign']})[_0x733d('0xa')](function(_0x419a79){logger[_0x733d('0xb')](_0x733d('0x28'),_0x547449);logger[_0x733d('0xe')](_0x733d('0x28'),_0x547449,JSON[_0x733d('0xf')](_0x419a79));_0x3f471a(_0x419a79);})[_0x733d('0x14')](function(_0x43d4c2){logger[_0x733d('0x10')](_0x733d('0x28'),_0x43d4c2[_0x733d('0x12')],_0x547449);_0x2400ab(_0x326729['error'](0x1f4,_0x43d4c2[_0x733d('0x12')]));});});};exports[_0x733d('0x3e')]=function(_0x7da578){var _0x1d4b61=this;return new Promise(function(_0x457e65,_0x53a540){return db[_0x733d('0x16')][_0x733d('0x1c')]({'raw':_0x7da578[_0x733d('0x19')]?_0x7da578[_0x733d('0x19')][_0x733d('0x1a')]===undefined?!![]:![]:!![],'where':_0x7da578[_0x733d('0x19')]?_0x7da578['options'][_0x733d('0x29')]||null:null,'attributes':[[_0x733d('0x2a'),'name'],[db[_0x733d('0x1d')]['fn'](_0x733d('0x1e'),db[_0x733d('0x1d')][_0x733d('0x1f')]('id')),_0x733d('0x3f')],[db[_0x733d('0x1d')]['fn'](_0x733d('0x1e'),db[_0x733d('0x1d')]['fn']('IF',db[_0x733d('0x1d')][_0x733d('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x733d('0x40')]],'group':[_0x733d('0x2a')]})[_0x733d('0xa')](function(_0x33d6c5){logger[_0x733d('0xb')](_0x733d('0x3e'),_0x7da578);logger['debug'](_0x733d('0x3e'),_0x7da578,JSON[_0x733d('0xf')](_0x33d6c5));_0x457e65(_0x33d6c5);})[_0x733d('0x14')](function(_0x4e8ed3){logger[_0x733d('0x10')](_0x733d('0x3e'),_0x4e8ed3[_0x733d('0x12')],_0x7da578);_0x53a540(_0x1d4b61[_0x733d('0x10')](0x1f4,_0x4e8ed3[_0x733d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index d35bcb4..0cb2682 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 _0x7de9=['/describe','isAuthenticated','describe','/:id','show','post','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','index','get'];(function(_0x4af01e,_0x543f5c){var _0x178c11=function(_0x2c2f76){while(--_0x2c2f76){_0x4af01e['push'](_0x4af01e['shift']());}};_0x178c11(++_0x543f5c);}(_0x7de9,0x7a));var _0x97de=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x7de9[_0x5416db];return _0x243e35;};'use strict';var multer=require(_0x97de('0x0'));var util=require(_0x97de('0x1'));var path=require(_0x97de('0x2'));var timeout=require(_0x97de('0x3'));var express=require(_0x97de('0x4'));var router=express['Router']();var fs_extra=require(_0x97de('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x97de('0x6'));var config=require(_0x97de('0x7'));var controller=require(_0x97de('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x97de('0x9')]);router[_0x97de('0xa')](_0x97de('0xb'),auth[_0x97de('0xc')](),controller[_0x97de('0xd')]);router[_0x97de('0xa')](_0x97de('0xe'),auth['isAuthenticated'](),controller[_0x97de('0xf')]);router[_0x97de('0x10')]('/',auth[_0x97de('0xc')](),controller['create']);router['put'](_0x97de('0xe'),auth[_0x97de('0xc')](),controller[_0x97de('0x11')]);module[_0x97de('0x12')]=router; \ No newline at end of file +var _0x1165=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','exports','multer','util','path','connect-timeout','express'];(function(_0x16c0b1,_0x58962f){var _0x43a670=function(_0x38ff63){while(--_0x38ff63){_0x16c0b1['push'](_0x16c0b1['shift']());}};_0x43a670(++_0x58962f);}(_0x1165,0xab));var _0x5116=function(_0x435d3a,_0x206efd){_0x435d3a=_0x435d3a-0x0;var _0x5a53ef=_0x1165[_0x435d3a];return _0x5a53ef;};'use strict';var multer=require(_0x5116('0x0'));var util=require(_0x5116('0x1'));var path=require(_0x5116('0x2'));var timeout=require(_0x5116('0x3'));var express=require(_0x5116('0x4'));var router=express[_0x5116('0x5')]();var fs_extra=require(_0x5116('0x6'));var auth=require(_0x5116('0x7'));var interaction=require(_0x5116('0x8'));var config=require(_0x5116('0x9'));var controller=require(_0x5116('0xa'));router[_0x5116('0xb')]('/',auth[_0x5116('0xc')](),controller[_0x5116('0xd')]);router[_0x5116('0xb')](_0x5116('0xe'),auth[_0x5116('0xc')](),controller[_0x5116('0xf')]);router[_0x5116('0xb')](_0x5116('0x10'),auth[_0x5116('0xc')](),controller[_0x5116('0x11')]);router[_0x5116('0x12')]('/',auth[_0x5116('0xc')](),controller[_0x5116('0x13')]);router[_0x5116('0x14')](_0x5116('0x10'),auth['isAuthenticated'](),controller['update']);module[_0x5116('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 3935cc2..1926406 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 _0x269a=['STRING','exports'];(function(_0x491468,_0x42f169){var _0x5b8c22=function(_0x407a9b){while(--_0x407a9b){_0x491468['push'](_0x491468['shift']());}};_0x5b8c22(++_0x42f169);}(_0x269a,0x103));var _0xa269=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x269a[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module[_0xa269('0x0')]={'name':{'type':Sequelize[_0xa269('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa269('0x1')]},'dialPrefix':{'type':Sequelize[_0xa269('0x1')]}}; \ No newline at end of file +var _0xf440=['exports','STRING','name'];(function(_0x3a3377,_0x16d56f){var _0x2cd17e=function(_0x58409d){while(--_0x58409d){_0x3a3377['push'](_0x3a3377['shift']());}};_0x2cd17e(++_0x16d56f);}(_0xf440,0x174));var _0x0f44=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xf440[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module[_0x0f44('0x0')]={'name':{'type':Sequelize[_0x0f44('0x1')],'unique':_0x0f44('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0f44('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 1f37cb4..90ffd9e 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 _0x8866=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','params','describe','addDisposition','ListId','getDispositions','Disposition','nolimit','include','removeDispositions','addContacts','CmContact','tags','push','each','ids','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','download','addCustomField','findOne','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','userCmList:save','removeAgents','isArray','emit','userCmList:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','Lists','UserProfileResource','destroy','end','name','index','map','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','CmList','includeAll','findAll','rows','catch','show','merge'];(function(_0x1d9dfa,_0x30598d){var _0x252661=function(_0x4bcc24){while(--_0x4bcc24){_0x1d9dfa['push'](_0x1d9dfa['shift']());}};_0x252661(++_0x30598d);}(_0x8866,0xd7));var _0x6886=function(_0x41cc9a,_0x4f8fc4){_0x41cc9a=_0x41cc9a-0x0;var _0x3982e9=_0x8866[_0x41cc9a];return _0x3982e9;};'use strict';var emlformat=require(_0x6886('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6886('0x1'));var jsonpatch=require(_0x6886('0x2'));var rp=require('request-promise');var moment=require(_0x6886('0x3'));var BPromise=require(_0x6886('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6886('0x5'));var sox=require(_0x6886('0x6'));var csv=require(_0x6886('0x7'));var ejs=require(_0x6886('0x8'));var fs=require('fs');var fs_extra=require(_0x6886('0x9'));var _=require(_0x6886('0xa'));var squel=require(_0x6886('0xb'));var crypto=require(_0x6886('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6886('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6886('0xe'));var Papa=require(_0x6886('0xf'));var Redis=require('ioredis');var authService=require(_0x6886('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6886('0x11'));var hardwareService=require(_0x6886('0x12'));var logger=require(_0x6886('0x13'))(_0x6886('0x14'));var utils=require(_0x6886('0x15'));var config=require(_0x6886('0x16'));var licenseUtil=require(_0x6886('0x17'));var db=require(_0x6886('0x18'))['db'];config['redis']=_[_0x6886('0x19')](config[_0x6886('0x1a')],{'host':_0x6886('0x1b'),'port':0x18eb});var socket=require(_0x6886('0x1c'))(new Redis(config[_0x6886('0x1a')]));require(_0x6886('0x1d'))['register'](socket);function respondWithStatusCode(_0x43e8f6,_0x1bf7c7){_0x1bf7c7=_0x1bf7c7||0xcc;return function(_0x2317e6){if(_0x2317e6){return _0x43e8f6[_0x6886('0x1e')](_0x1bf7c7);}return _0x43e8f6[_0x6886('0x1f')](_0x1bf7c7)['end']();};}function respondWithResult(_0x4bb546,_0x4aac13){_0x4aac13=_0x4aac13||0xc8;return function(_0xd3e211){if(_0xd3e211){return _0x4bb546[_0x6886('0x1f')](_0x4aac13)[_0x6886('0x20')](_0xd3e211);}};}function respondWithFilteredResult(_0x567227,_0x9c2971){return function(_0x577715){if(_0x577715){var _0x4c2481=typeof _0x9c2971[_0x6886('0x21')]===_0x6886('0x22')&&typeof _0x9c2971['limit']==='undefined';var _0x1dfb31=_0x577715[_0x6886('0x23')];var _0x5d1c57=_0x4c2481?0x0:_0x9c2971[_0x6886('0x21')];var _0x1eff20=_0x4c2481?_0x577715[_0x6886('0x23')]:_0x9c2971[_0x6886('0x21')]+_0x9c2971[_0x6886('0x24')];var _0x594a6c;if(_0x1eff20>=_0x1dfb31){_0x1eff20=_0x1dfb31;_0x594a6c=0xc8;}else{_0x594a6c=0xce;}_0x567227[_0x6886('0x1f')](_0x594a6c);return _0x567227[_0x6886('0x25')](_0x6886('0x26'),_0x5d1c57+'-'+_0x1eff20+'/'+_0x1dfb31)[_0x6886('0x20')](_0x577715);}return null;};}function patchUpdates(_0x293564){return function(_0x36d67f){try{jsonpatch['apply'](_0x36d67f,_0x293564,!![]);}catch(_0x4fcfb5){return BPromise['reject'](_0x4fcfb5);}return _0x36d67f[_0x6886('0x27')]();};}function saveUpdates(_0x440b0f,_0x3c0a05){return function(_0x3cfdc6){if(_0x3cfdc6){return _0x3cfdc6[_0x6886('0x28')](_0x440b0f)[_0x6886('0x29')](function(_0x4877f5){return _0x4877f5;});}return null;};}function removeEntity(_0x29ae22,_0x3725b4){return function(_0x446ad6){if(_0x446ad6){return _0x446ad6['destroy']()[_0x6886('0x29')](function(){var _0x222a89=_0x446ad6['get']({'plain':!![]});var _0x19c54f=_0x6886('0x2a');return db[_0x6886('0x2b')][_0x6886('0x2c')]({'where':{'type':_0x19c54f,'resourceId':_0x222a89['id']}})['then'](function(){return _0x446ad6;});})[_0x6886('0x29')](function(){_0x29ae22[_0x6886('0x1f')](0xcc)[_0x6886('0x2d')]();});}};}function handleEntityNotFound(_0x4e4e1a,_0x43b840){return function(_0x50e65f){if(!_0x50e65f){_0x4e4e1a[_0x6886('0x1e')](0x194);}return _0x50e65f;};}function handleError(_0x54cf9d,_0x4260b5){_0x4260b5=_0x4260b5||0x1f4;return function(_0x4b38d2){logger['error'](_0x4b38d2['stack']);if(_0x4b38d2['name']){delete _0x4b38d2[_0x6886('0x2e')];}_0x54cf9d['status'](_0x4260b5)['send'](_0x4b38d2);};}exports[_0x6886('0x2f')]=function(_0x36c2c4,_0x3802fb){var _0x4d11f1={},_0x547136={},_0x5a3af6={'count':0x0,'rows':[]};var _0x19597f=_[_0x6886('0x30')](db['CmList'][_0x6886('0x31')],function(_0x3eddbb){return{'name':_0x3eddbb['fieldName'],'type':_0x3eddbb[_0x6886('0x32')][_0x6886('0x33')]};});_0x547136['model']=_[_0x6886('0x30')](_0x19597f,_0x6886('0x2e'));_0x547136[_0x6886('0x34')]=_[_0x6886('0x35')](_0x36c2c4[_0x6886('0x34')]);_0x547136[_0x6886('0x36')]=_[_0x6886('0x37')](_0x547136['model'],_0x547136[_0x6886('0x34')]);_0x4d11f1[_0x6886('0x38')]=_[_0x6886('0x37')](_0x547136[_0x6886('0x39')],qs[_0x6886('0x3a')](_0x36c2c4[_0x6886('0x34')][_0x6886('0x3a')]));_0x4d11f1[_0x6886('0x38')]=_0x4d11f1[_0x6886('0x38')][_0x6886('0x3b')]?_0x4d11f1[_0x6886('0x38')]:_0x547136['model'];if(!_0x36c2c4[_0x6886('0x34')][_0x6886('0x3c')]('nolimit')){_0x4d11f1[_0x6886('0x24')]=qs[_0x6886('0x24')](_0x36c2c4[_0x6886('0x34')][_0x6886('0x24')]);_0x4d11f1[_0x6886('0x21')]=qs[_0x6886('0x21')](_0x36c2c4[_0x6886('0x34')][_0x6886('0x21')]);}_0x4d11f1[_0x6886('0x3d')]=qs[_0x6886('0x3e')](_0x36c2c4['query'][_0x6886('0x3e')]);_0x4d11f1['where']=qs[_0x6886('0x36')](_[_0x6886('0x3f')](_0x36c2c4[_0x6886('0x34')],_0x547136[_0x6886('0x36')]),_0x19597f);if(_0x36c2c4[_0x6886('0x34')][_0x6886('0x40')]){_0x4d11f1[_0x6886('0x41')]=_['merge'](_0x4d11f1[_0x6886('0x41')],{'$or':_[_0x6886('0x30')](_0x19597f,function(_0x3e3e80){if(_0x3e3e80['type']!==_0x6886('0x42')){var _0x46101c={};_0x46101c[_0x3e3e80[_0x6886('0x2e')]]={'$like':'%'+_0x36c2c4[_0x6886('0x34')][_0x6886('0x40')]+'%'};return _0x46101c;}})});}_0x4d11f1=_['merge']({},_0x4d11f1,_0x36c2c4[_0x6886('0x43')]);var _0x5a67fc={'where':_0x4d11f1[_0x6886('0x41')]};return db[_0x6886('0x44')][_0x6886('0x23')](_0x5a67fc)[_0x6886('0x29')](function(_0xec38f7){_0x5a3af6[_0x6886('0x23')]=_0xec38f7;if(_0x36c2c4[_0x6886('0x34')][_0x6886('0x45')]){_0x4d11f1['include']=[{'all':!![]}];}return db[_0x6886('0x44')][_0x6886('0x46')](_0x4d11f1);})[_0x6886('0x29')](function(_0x4a96e9){_0x5a3af6[_0x6886('0x47')]=_0x4a96e9;return _0x5a3af6;})[_0x6886('0x29')](respondWithFilteredResult(_0x3802fb,_0x4d11f1))[_0x6886('0x48')](handleError(_0x3802fb,null));};exports[_0x6886('0x49')]=function(_0xd5525d,_0xf0774b){var _0x4185e5={'raw':![],'where':{'id':_0xd5525d['params']['id']}},_0x20b5db={};_0x20b5db[_0x6886('0x39')]=_[_0x6886('0x35')](db[_0x6886('0x44')][_0x6886('0x31')]);_0x20b5db[_0x6886('0x34')]=_[_0x6886('0x35')](_0xd5525d[_0x6886('0x34')]);_0x20b5db[_0x6886('0x36')]=_[_0x6886('0x37')](_0x20b5db[_0x6886('0x39')],_0x20b5db[_0x6886('0x34')]);_0x4185e5[_0x6886('0x38')]=_[_0x6886('0x37')](_0x20b5db['model'],qs['fields'](_0xd5525d['query'][_0x6886('0x3a')]));_0x4185e5[_0x6886('0x38')]=_0x4185e5[_0x6886('0x38')][_0x6886('0x3b')]?_0x4185e5[_0x6886('0x38')]:_0x20b5db['model'];if(_0xd5525d['query'][_0x6886('0x45')]){_0x4185e5['include']=[{'all':!![]}];}_0x4185e5=_[_0x6886('0x4a')]({},_0x4185e5,_0xd5525d[_0x6886('0x43')]);return db[_0x6886('0x44')][_0x6886('0x4b')](_0x4185e5)['then'](handleEntityNotFound(_0xf0774b,null))[_0x6886('0x29')](respondWithResult(_0xf0774b,null))[_0x6886('0x48')](handleError(_0xf0774b,null));};exports['create']=function(_0x482ece,_0x932dfe){return db[_0x6886('0x44')][_0x6886('0x4c')](_0x482ece[_0x6886('0x4d')],{})[_0x6886('0x29')](function(_0x59021c){var _0x1a8566=_0x482ece[_0x6886('0x4e')]['get']({'plain':!![]});if(!_0x1a8566)throw new Error(_0x6886('0x4f'));if(_0x1a8566['role']===_0x6886('0x4e')){var _0x2a4e98=_0x59021c['get']({'plain':!![]});var _0x260691=_0x6886('0x2a');return db[_0x6886('0x50')][_0x6886('0x4b')]({'where':{'name':_0x260691,'userProfileId':_0x1a8566[_0x6886('0x51')]},'raw':!![]})['then'](function(_0x2293cd){if(_0x2293cd&&_0x2293cd[_0x6886('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x2a4e98[_0x6886('0x2e')],'resourceId':_0x2a4e98['id'],'type':_0x2293cd[_0x6886('0x2e')],'sectionId':_0x2293cd['id']},{})[_0x6886('0x29')](function(){return _0x59021c;});}else{return _0x59021c;}})['catch'](function(_0x140adc){logger[_0x6886('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x140adc);throw _0x140adc;});}return _0x59021c;})['then'](respondWithResult(_0x932dfe,0xc9))[_0x6886('0x48')](handleError(_0x932dfe,null));};exports['update']=function(_0x21d964,_0x203cc6){if(_0x21d964[_0x6886('0x4d')]['id']){delete _0x21d964[_0x6886('0x4d')]['id'];}return db['CmList'][_0x6886('0x4b')]({'where':{'id':_0x21d964[_0x6886('0x54')]['id']}})[_0x6886('0x29')](handleEntityNotFound(_0x203cc6,null))[_0x6886('0x29')](saveUpdates(_0x21d964['body'],null))[_0x6886('0x29')](respondWithResult(_0x203cc6,null))[_0x6886('0x48')](handleError(_0x203cc6,null));};exports[_0x6886('0x2c')]=function(_0x35d68b,_0x5afc59){return db[_0x6886('0x44')][_0x6886('0x4b')]({'where':{'id':_0x35d68b[_0x6886('0x54')]['id']}})[_0x6886('0x29')](handleEntityNotFound(_0x5afc59,null))['then'](removeEntity(_0x5afc59,null))[_0x6886('0x48')](handleError(_0x5afc59,null));};exports[_0x6886('0x55')]=function(_0x5611aa,_0x4a9911){return db[_0x6886('0x44')][_0x6886('0x55')]()['then'](respondWithResult(_0x4a9911,null))[_0x6886('0x48')](handleError(_0x4a9911,null));};exports[_0x6886('0x56')]=function(_0x221924,_0x5220c0,_0x34bcb6){if(_0x221924[_0x6886('0x4d')]['id']){delete _0x221924[_0x6886('0x4d')]['id'];}return db[_0x6886('0x44')][_0x6886('0x4b')]({'where':{'id':_0x221924[_0x6886('0x54')]['id']}})[_0x6886('0x29')](handleEntityNotFound(_0x5220c0,null))[_0x6886('0x29')](function(_0x4edd81){if(_0x4edd81){_0x221924['body'][_0x6886('0x57')]=_0x4edd81['id'];return db['Disposition'][_0x6886('0x4c')](_0x221924[_0x6886('0x4d')]);}})[_0x6886('0x29')](respondWithResult(_0x5220c0,null))[_0x6886('0x48')](handleError(_0x5220c0,null));};exports[_0x6886('0x58')]=function(_0x1481b5,_0x3ad792,_0x260852){var _0x10b171={'raw':![],'where':{}};var _0x52a769={};var _0x43bf9c={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x1481b5['params']['id']}})['then'](handleEntityNotFound(_0x3ad792,null))[_0x6886('0x29')](function(_0x2cd822){if(_0x2cd822){_0x52a769['model']=_[_0x6886('0x35')](db[_0x6886('0x59')][_0x6886('0x31')]);_0x52a769[_0x6886('0x34')]=_[_0x6886('0x35')](_0x1481b5[_0x6886('0x34')]);_0x52a769[_0x6886('0x36')]=_[_0x6886('0x37')](_0x52a769[_0x6886('0x39')],_0x52a769[_0x6886('0x34')]);_0x10b171[_0x6886('0x38')]=_[_0x6886('0x37')](_0x52a769[_0x6886('0x39')],qs[_0x6886('0x3a')](_0x1481b5[_0x6886('0x34')]['fields']));_0x10b171['attributes']=_0x10b171[_0x6886('0x38')]['length']?_0x10b171[_0x6886('0x38')]:_0x52a769[_0x6886('0x39')];if(!_0x1481b5[_0x6886('0x34')][_0x6886('0x3c')](_0x6886('0x5a'))){_0x10b171['limit']=qs[_0x6886('0x24')](_0x1481b5['query']['limit']);_0x10b171[_0x6886('0x21')]=qs[_0x6886('0x21')](_0x1481b5['query'][_0x6886('0x21')]);}_0x10b171[_0x6886('0x3d')]=qs[_0x6886('0x3e')](_0x1481b5[_0x6886('0x34')]['sort']);_0x10b171[_0x6886('0x41')]=qs[_0x6886('0x36')](_[_0x6886('0x3f')](_0x1481b5[_0x6886('0x34')],_0x52a769[_0x6886('0x36')]));_0x10b171['where'][_0x6886('0x57')]=_0x2cd822['id'];if(_0x1481b5[_0x6886('0x34')][_0x6886('0x40')]){_0x10b171[_0x6886('0x41')]=_[_0x6886('0x4a')](_0x10b171[_0x6886('0x41')],{'$or':_[_0x6886('0x30')](_0x10b171[_0x6886('0x38')],function(_0x599d76){var _0x5267db={};_0x5267db[_0x599d76]={'$like':'%'+_0x1481b5[_0x6886('0x34')]['filter']+'%'};return _0x5267db;})});}_0x10b171=_[_0x6886('0x4a')]({},_0x10b171,_0x1481b5[_0x6886('0x43')]);return db[_0x6886('0x59')]['count']({'where':_0x10b171[_0x6886('0x41')]})['then'](function(_0x1b955b){_0x43bf9c[_0x6886('0x23')]=_0x1b955b;if(_0x1481b5[_0x6886('0x34')][_0x6886('0x45')]){_0x10b171[_0x6886('0x5b')]=[{'all':!![]}];}return db[_0x6886('0x59')][_0x6886('0x46')](_0x10b171);})['then'](function(_0xf2df74){_0x43bf9c[_0x6886('0x47')]=_0xf2df74;return _0x43bf9c;});}})[_0x6886('0x29')](respondWithFilteredResult(_0x3ad792,_0x10b171))[_0x6886('0x48')](handleError(_0x3ad792,null));};exports[_0x6886('0x5c')]=function(_0x3a01b5,_0x594441,_0xa7b565){return db[_0x6886('0x44')][_0x6886('0x4b')]({'where':{'id':_0x3a01b5[_0x6886('0x54')]['id']}})['then'](handleEntityNotFound(_0x594441,null))[_0x6886('0x29')](function(_0x3b9800){if(_0x3b9800){return _0x3b9800[_0x6886('0x5c')](_0x3a01b5[_0x6886('0x34')]['ids']);}})[_0x6886('0x29')](respondWithStatusCode(_0x594441,null))['catch'](handleError(_0x594441,null));};exports[_0x6886('0x5d')]=function(_0x1ae972,_0x25a6d2,_0x2619c8){return db[_0x6886('0x44')][_0x6886('0x4b')]({'where':{'id':_0x1ae972[_0x6886('0x54')]['id']}})[_0x6886('0x29')](handleEntityNotFound(_0x25a6d2,null))['then'](function(_0x17fcca){if(_0x17fcca){var _0x20fd04=[];var _0x437ab5={'success':[],'errors':[]};return db[_0x6886('0x5e')]['describe']()[_0x6886('0x29')](function(_0x1ac18d){if(_0x1ae972[_0x6886('0x4d')][_0x6886('0x5f')]&&_['isArray'](_0x1ae972['body']['tags'])){if(_0x1ae972[_0x6886('0x4d')]['tags'][_0x6886('0x3b')]){_0x1ae972[_0x6886('0x4d')][_0x6886('0x5f')]=_0x1ae972['body'][_0x6886('0x5f')]['join'](';')+';';}else{_0x1ae972[_0x6886('0x4d')][_0x6886('0x5f')]=null;}}else{_0x1ae972['body'][_0x6886('0x5f')]=null;}if(_0x1ae972[_0x6886('0x4d')]&&_['isArray'](_0x1ae972[_0x6886('0x4d')])){for(var _0x4f06c3=0x0;_0x4f06c3<_0x1ae972[_0x6886('0x4d')][_0x6886('0x3b')];_0x4f06c3+=0x1){_0x1ae972[_0x6886('0x4d')][_0x4f06c3][_0x6886('0x57')]=_0x1ae972[_0x6886('0x54')]['id'];_0x20fd04[_0x6886('0x60')](_0x1ae972[_0x6886('0x4d')][_0x4f06c3]);}return BPromise[_0x6886('0x61')](_0x20fd04,function(_0x1cd929){return db[_0x6886('0x5e')][_0x6886('0x4c')](_['omit'](_0x1cd929,[_0x6886('0x62'),'id'])||{},{'fields':_[_0x6886('0x35')](_0x1ac18d),'raw':!![]})[_0x6886('0x29')](function(_0x1e8939){_0x437ab5[_0x6886('0x63')][_0x6886('0x60')](_0x1e8939['dataValues']);})[_0x6886('0x48')](function(_0x4d9b24){_0x437ab5[_0x6886('0x64')][_0x6886('0x60')]({'data':_0x1cd929,'error':_0x4d9b24[_0x6886('0x65')]});});})[_0x6886('0x29')](function(_0x165046){return _0x437ab5;})[_0x6886('0x48')](function(_0xaa0d69){return _0xaa0d69;});}else{_0x25a6d2[_0x6886('0x1f')](0x190)[_0x6886('0x20')]({'message':_0x6886('0x66')});}});}})['then'](respondWithResult(_0x25a6d2,null))[_0x6886('0x48')](handleError(_0x25a6d2,null));};exports[_0x6886('0x67')]=function(_0x19770f,_0xe89cc0,_0x43761c){var _0x3159a7;return db[_0x6886('0x44')][_0x6886('0x4b')]({'where':{'id':_0x19770f[_0x6886('0x54')]['id']},'include':[{'model':db[_0x6886('0x68')],'as':_0x6886('0x69')}]})[_0x6886('0x29')](handleEntityNotFound(_0xe89cc0,null))[_0x6886('0x29')](function(_0x5680d5){if(_0x5680d5){_0x3159a7=_0x5680d5;return db['CmContact'][_0x6886('0x31')];}})[_0x6886('0x29')](function(_0x261cde){if(_0x261cde){var _0x1d8fe6={};var _0x584d01={};_0x584d01['model']=_[_0x6886('0x6a')](_['keys'](_0x261cde),_[_0x6886('0x30')](_0x3159a7[_0x6886('0x69')],function(_0x603f61){return util[_0x6886('0x6b')](_0x6886('0x6c'),_0x603f61['id']);}));_0x584d01[_0x6886('0x34')]=_[_0x6886('0x35')](_0x19770f[_0x6886('0x34')]);_0x584d01[_0x6886('0x36')]=_[_0x6886('0x37')](_0x584d01[_0x6886('0x39')],_0x584d01[_0x6886('0x34')]);_0x1d8fe6[_0x6886('0x38')]=_['intersection'](_0x584d01[_0x6886('0x39')],qs['fields'](_0x19770f[_0x6886('0x34')][_0x6886('0x3a')]));_0x1d8fe6[_0x6886('0x38')]=_0x1d8fe6[_0x6886('0x38')][_0x6886('0x3b')]?_0x1d8fe6[_0x6886('0x38')]:_0x584d01[_0x6886('0x39')];if(!_0x19770f['query'][_0x6886('0x3c')]('nolimit')){_0x1d8fe6[_0x6886('0x24')]=qs['limit'](_0x19770f[_0x6886('0x34')]['limit']);_0x1d8fe6[_0x6886('0x21')]=qs[_0x6886('0x21')](_0x19770f['query'][_0x6886('0x21')]);}_0x1d8fe6[_0x6886('0x3d')]=qs[_0x6886('0x3e')](_0x19770f[_0x6886('0x34')][_0x6886('0x3e')]);_0x1d8fe6[_0x6886('0x41')]=qs[_0x6886('0x36')](_[_0x6886('0x3f')](_0x19770f[_0x6886('0x34')],_0x584d01[_0x6886('0x36')]));_0x1d8fe6[_0x6886('0x6d')]=!![];if(_0x19770f[_0x6886('0x34')][_0x6886('0x40')]){_0x1d8fe6[_0x6886('0x41')]=_[_0x6886('0x4a')](_0x1d8fe6['where'],{'$or':_[_0x6886('0x30')](_0x1d8fe6[_0x6886('0x38')],function(_0x1c3a4a){var _0x2b3d49={};_0x2b3d49[_0x1c3a4a]={'$like':'%'+_0x19770f[_0x6886('0x34')]['filter']+'%'};return _0x2b3d49;})});}_0x1d8fe6=_[_0x6886('0x4a')]({},_0x1d8fe6,_0x19770f[_0x6886('0x43')]);return _0x3159a7[_0x6886('0x67')](_0x1d8fe6);}})[_0x6886('0x29')](respondWithResult(_0xe89cc0,null))['catch'](handleError(_0xe89cc0,null));};exports['getContactsCsv']=function(_0xe0c245,_0x1c5bae,_0x54db71){var _0x15841e;return db[_0x6886('0x44')][_0x6886('0x4b')]({'where':{'id':_0xe0c245[_0x6886('0x54')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x6886('0x69')}]})['then'](handleEntityNotFound(_0x1c5bae,null))['then'](function(_0x5bca58){if(_0x5bca58){_0x15841e=_0x5bca58;return db[_0x6886('0x5e')][_0x6886('0x31')];}})['then'](function(_0xb892f8){if(_0xb892f8){var _0x34aa8a={};var _0x2480e7={};_0x2480e7[_0x6886('0x39')]=_[_0x6886('0x6a')](_['keys'](_0xb892f8),_[_0x6886('0x30')](_0x15841e[_0x6886('0x69')],function(_0x22915b){return util[_0x6886('0x6b')](_0x6886('0x6c'),_0x22915b['id']);}));_0x2480e7[_0x6886('0x34')]=_['keys'](_0xe0c245[_0x6886('0x34')]);_0x2480e7[_0x6886('0x36')]=_[_0x6886('0x37')](_0x2480e7['model'],_0x2480e7[_0x6886('0x34')]);_0x34aa8a[_0x6886('0x38')]=_[_0x6886('0x37')](_0x2480e7['model'],qs[_0x6886('0x3a')](_0xe0c245[_0x6886('0x34')][_0x6886('0x3a')]));_0x34aa8a[_0x6886('0x38')]=_0x34aa8a[_0x6886('0x38')][_0x6886('0x3b')]?_0x34aa8a[_0x6886('0x38')]:_0x2480e7[_0x6886('0x39')];if(!_0xe0c245[_0x6886('0x34')][_0x6886('0x3c')](_0x6886('0x5a'))){_0x34aa8a[_0x6886('0x24')]=qs[_0x6886('0x24')](_0xe0c245[_0x6886('0x34')]['limit']);_0x34aa8a['offset']=qs['offset'](_0xe0c245[_0x6886('0x34')]['offset']);}_0x34aa8a[_0x6886('0x3d')]=qs[_0x6886('0x3e')](_0xe0c245['query'][_0x6886('0x3e')]);_0x34aa8a[_0x6886('0x41')]=qs['filters'](_['pick'](_0xe0c245[_0x6886('0x34')],_0x2480e7['filters']));_0x34aa8a[_0x6886('0x6d')]=!![];if(_0xe0c245[_0x6886('0x34')][_0x6886('0x40')]){_0x34aa8a[_0x6886('0x41')]=_[_0x6886('0x4a')](_0x34aa8a[_0x6886('0x41')],{'$or':_[_0x6886('0x30')](_0x34aa8a[_0x6886('0x38')],function(_0x59f621){var _0x4f51fa={};_0x4f51fa[_0x59f621]={'$like':'%'+_0xe0c245[_0x6886('0x34')][_0x6886('0x40')]+'%'};return _0x4f51fa;})});}_0x34aa8a=_[_0x6886('0x4a')]({},_0x34aa8a,_0xe0c245['options']);return _0x15841e[_0x6886('0x67')](_0x34aa8a);}})[_0x6886('0x29')](function(_0x1fb18c){if(!_[_0x6886('0x6e')](_0x1fb18c)){var _0x3d740d=toCsv(_0x1fb18c);var _0x328026=Date[_0x6886('0x6f')]();fs['writeFileSync'](util[_0x6886('0x6b')](_0x6886('0x70'),_0x15841e['id'],_0x328026),_0x3d740d);_0x1c5bae[_0x6886('0x71')](_0x6886('0x72'),_0x6886('0x73')+util['format'](_0x6886('0x74'),_0x15841e['id'],_0x328026));_0x1c5bae[_0x6886('0x71')](_0x6886('0x75'),'text/csv');return _0x1c5bae[_0x6886('0x76')](util['format'](_0x6886('0x70'),_0x15841e['id'],_0x328026));}else{return _0x1c5bae[_0x6886('0x1e')](0xcc);}})[_0x6886('0x48')](handleError(_0x1c5bae,null));};exports[_0x6886('0x77')]=function(_0x21234f,_0x165fb0,_0x4b422c){var _0x55b6d8;delete _0x21234f['body']['id'];return db[_0x6886('0x44')][_0x6886('0x78')]({'where':{'id':_0x21234f[_0x6886('0x54')]['id']}})[_0x6886('0x29')](handleEntityNotFound(_0x165fb0,null))[_0x6886('0x29')](function(_0x15ef7d){if(_0x15ef7d){return db[_0x6886('0x79')][_0x6886('0x7a')](function(_0x44d483){return db['CmCustomField'][_0x6886('0x4c')](_0x21234f[_0x6886('0x4d')],{'transaction':_0x44d483})['then'](function(_0x6b3bdf){_0x55b6d8=_0x6b3bdf;return _0x15ef7d[_0x6886('0x7b')](_0x6b3bdf,{'transaction':_0x44d483});})[_0x6886('0x29')](function(){var _0x49583f={'type':db[_0x6886('0x7c')][_0x6886('0x7d')],'transaction':_0x44d483};switch(_0x21234f[_0x6886('0x4d')][_0x6886('0x32')]){case'text':_0x49583f[_0x6886('0x32')]=db[_0x6886('0x7c')]['TEXT'];break;case _0x6886('0x7e'):_0x49583f[_0x6886('0x32')]=db['Sequelize'][_0x6886('0x7f')];break;case _0x6886('0x80'):_0x49583f['type']=db[_0x6886('0x7c')][_0x6886('0x81')];_0x49583f['defaultValue']=![];break;default:}return db[_0x6886('0x79')][_0x6886('0x82')][_0x6886('0x83')](_0x6886('0x84'),util[_0x6886('0x6b')](_0x6886('0x85'),_0x55b6d8['id']),_0x49583f);})[_0x6886('0x29')](function(){return _0x55b6d8;});});}})['then'](respondWithResult(_0x165fb0,null))[_0x6886('0x48')](handleError(_0x165fb0,null));};exports[_0x6886('0x86')]=function(_0x52c9ee,_0x5389e5,_0x577e6b){var _0xab2e4={};var _0x461be2={};var _0x24ed74;var _0x3acd9a;return db['CmList'][_0x6886('0x78')]({'where':{'id':_0x52c9ee[_0x6886('0x54')]['id']}})[_0x6886('0x29')](handleEntityNotFound(_0x5389e5,null))[_0x6886('0x29')](function(_0xbf5dda){if(_0xbf5dda){_0x24ed74=_0xbf5dda;_0x461be2[_0x6886('0x39')]=_[_0x6886('0x35')](db[_0x6886('0x68')]['rawAttributes']);_0x461be2[_0x6886('0x34')]=_[_0x6886('0x35')](_0x52c9ee[_0x6886('0x34')]);_0x461be2[_0x6886('0x36')]=_[_0x6886('0x37')](_0x461be2['model'],_0x461be2['query']);_0xab2e4[_0x6886('0x38')]=_['intersection'](_0x461be2['model'],qs['fields'](_0x52c9ee['query'][_0x6886('0x3a')]));_0xab2e4['attributes']=_0xab2e4['attributes'][_0x6886('0x3b')]?_0xab2e4['attributes']:_0x461be2[_0x6886('0x39')];_0xab2e4['order']=qs[_0x6886('0x3e')](_0x52c9ee[_0x6886('0x34')][_0x6886('0x3e')]);_0xab2e4[_0x6886('0x41')]=qs[_0x6886('0x36')](_[_0x6886('0x3f')](_0x52c9ee[_0x6886('0x34')],_0x461be2[_0x6886('0x36')]));_0xab2e4['where']=_[_0x6886('0x4a')](_0xab2e4[_0x6886('0x41')],{'$or':[{'ListId':_0xbf5dda['id']},{'ListId':null}]});if(_0x52c9ee[_0x6886('0x34')][_0x6886('0x40')]){_0xab2e4[_0x6886('0x41')]=_[_0x6886('0x4a')](_0xab2e4[_0x6886('0x41')],{'$or':_[_0x6886('0x30')](_0xab2e4[_0x6886('0x38')],function(_0x3033f5){var _0x44422b={};_0x44422b[_0x3033f5]={'$like':'%'+_0x52c9ee['query'][_0x6886('0x40')]+'%'};return _0x44422b;})});}_0xab2e4=_['merge']({},_0xab2e4,_0x52c9ee['options']);return db[_0x6886('0x68')][_0x6886('0x87')](_0xab2e4);}})['then'](respondWithResult(_0x5389e5,null))[_0x6886('0x48')](handleError(_0x5389e5,null));};exports[_0x6886('0x88')]=function(_0x406d9c,_0x58ca1a,_0x37bdbc){return db[_0x6886('0x44')][_0x6886('0x4b')]({'where':{'id':_0x406d9c[_0x6886('0x54')]['id']}})[_0x6886('0x29')](handleEntityNotFound(_0x58ca1a,null))['then'](function(_0xee3ba){if(_0xee3ba){return _0xee3ba[_0x6886('0x88')](_0x406d9c['body'][_0x6886('0x62')],_[_0x6886('0x89')](_0x406d9c[_0x6886('0x4d')],['ids','id'])||{})['spread'](function(_0xf4ec58){for(var _0x5f3ac1=0x0;_0x5f3ac1<_0x406d9c[_0x6886('0x4d')][_0x6886('0x62')]['length'];_0x5f3ac1+=0x1){socket['emit'](_0x6886('0x8a'),{'UserId':_0x406d9c[_0x6886('0x4d')]['ids'][_0x5f3ac1],'CmListId':_0x406d9c[_0x6886('0x54')]['id']});}return _0xf4ec58;});}})[_0x6886('0x29')](respondWithResult(_0x58ca1a,null))[_0x6886('0x48')](handleError(_0x58ca1a,null));};exports[_0x6886('0x8b')]=function(_0x111ed3,_0x4c2734,_0x3a5100){return db['CmList']['find']({'where':{'id':_0x111ed3['params']['id']}})[_0x6886('0x29')](handleEntityNotFound(_0x4c2734,null))[_0x6886('0x29')](function(_0x1510ff){if(_0x1510ff){return _0x1510ff[_0x6886('0x8b')](_0x111ed3[_0x6886('0x34')][_0x6886('0x62')])[_0x6886('0x29')](function(){if(_[_0x6886('0x8c')](_0x111ed3['query'][_0x6886('0x62')])){for(var _0x5334b5=0x0;_0x5334b5<_0x111ed3[_0x6886('0x34')][_0x6886('0x62')][_0x6886('0x3b')];_0x5334b5+=0x1){socket[_0x6886('0x8d')](_0x6886('0x8e'),{'UserId':Number(_0x111ed3[_0x6886('0x34')][_0x6886('0x62')][_0x5334b5]),'CmListId':Number(_0x111ed3[_0x6886('0x54')]['id'])});}}else{socket[_0x6886('0x8d')]('userCmList:remove',{'UserId':Number(_0x111ed3[_0x6886('0x34')][_0x6886('0x62')]),'CmListId':Number(_0x111ed3['params']['id'])});}});}})[_0x6886('0x29')](respondWithStatusCode(_0x4c2734,null))[_0x6886('0x48')](handleError(_0x4c2734,null));};exports[_0x6886('0x8f')]=function(_0x1a2700,_0x1e7100,_0x418c90){var _0xe6f8fd={};var _0x1705ed={};var _0x8485c9;var _0x4d9ee5;return db[_0x6886('0x44')][_0x6886('0x78')]({'where':{'id':_0x1a2700[_0x6886('0x54')]['id']}})[_0x6886('0x29')](handleEntityNotFound(_0x1e7100,null))[_0x6886('0x29')](function(_0x30aaf5){if(_0x30aaf5){_0x8485c9=_0x30aaf5;_0x1705ed['model']=_[_0x6886('0x35')](db[_0x6886('0x90')][_0x6886('0x31')]);_0x1705ed[_0x6886('0x34')]=_[_0x6886('0x35')](_0x1a2700[_0x6886('0x34')]);_0x1705ed[_0x6886('0x36')]=_['intersection'](_0x1705ed[_0x6886('0x39')],_0x1705ed[_0x6886('0x34')]);_0xe6f8fd[_0x6886('0x38')]=_[_0x6886('0x37')](_0x1705ed['model'],qs[_0x6886('0x3a')](_0x1a2700[_0x6886('0x34')][_0x6886('0x3a')]));_0xe6f8fd[_0x6886('0x38')]=_0xe6f8fd[_0x6886('0x38')][_0x6886('0x3b')]?_0xe6f8fd[_0x6886('0x38')]:_0x1705ed['model'];_0xe6f8fd[_0x6886('0x3d')]=qs[_0x6886('0x3e')](_0x1a2700[_0x6886('0x34')][_0x6886('0x3e')]);_0xe6f8fd[_0x6886('0x41')]=qs[_0x6886('0x36')](_[_0x6886('0x3f')](_0x1a2700['query'],_0x1705ed['filters']));if(_0x1a2700[_0x6886('0x34')]['filter']){_0xe6f8fd[_0x6886('0x41')]=_[_0x6886('0x4a')](_0xe6f8fd[_0x6886('0x41')],{'$or':_[_0x6886('0x30')](_0xe6f8fd[_0x6886('0x38')],function(_0x3049f7){var _0x3a395a={};_0x3a395a[_0x3049f7]={'$like':'%'+_0x1a2700[_0x6886('0x34')][_0x6886('0x40')]+'%'};return _0x3a395a;})});}_0xe6f8fd=_['merge']({},_0xe6f8fd,_0x1a2700[_0x6886('0x43')]);return _0x8485c9[_0x6886('0x8f')](_0xe6f8fd);}})[_0x6886('0x29')](function(_0x475989){if(_0x475989){_0x4d9ee5=_0x475989[_0x6886('0x3b')];if(!_0x1a2700['query'][_0x6886('0x3c')](_0x6886('0x5a'))){_0xe6f8fd[_0x6886('0x24')]=qs[_0x6886('0x24')](_0x1a2700[_0x6886('0x34')][_0x6886('0x24')]);_0xe6f8fd[_0x6886('0x21')]=qs['offset'](_0x1a2700[_0x6886('0x34')][_0x6886('0x21')]);}return _0x8485c9['getAgents'](_0xe6f8fd);}})[_0x6886('0x29')](function(_0x2bf9cc){if(_0x2bf9cc){return _0x2bf9cc?{'count':_0x4d9ee5,'rows':_0x2bf9cc}:null;}})[_0x6886('0x29')](respondWithResult(_0x1e7100,null))[_0x6886('0x48')](handleError(_0x1e7100,null));}; \ No newline at end of file +var _0x5286=['INTEGER','switch','BOOLEAN','defaultValue','addColumn','cf_%s','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','eml-format','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','name','merge','options','CmList','includeAll','include','findAll','rows','catch','params','find','create','body','user','Lists','UserProfileSection','autoAssociation','describe','Disposition','getDispositions','hasOwnProperty','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','findOne','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number'];(function(_0x40bfa1,_0x524a77){var _0x1e0515=function(_0x2379e8){while(--_0x2379e8){_0x40bfa1['push'](_0x40bfa1['shift']());}};_0x1e0515(++_0x524a77);}(_0x5286,0x123));var _0x6528=function(_0x4b935a,_0x327ee3){_0x4b935a=_0x4b935a-0x0;var _0xa298f0=_0x5286[_0x4b935a];return _0xa298f0;};'use strict';var emlformat=require(_0x6528('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6528('0x1'));var rp=require('request-promise');var moment=require(_0x6528('0x2'));var BPromise=require(_0x6528('0x3'));var Mustache=require('mustache');var util=require(_0x6528('0x4'));var path=require(_0x6528('0x5'));var sox=require('sox');var csv=require(_0x6528('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6528('0x7'));var _=require(_0x6528('0x8'));var squel=require(_0x6528('0x9'));var crypto=require(_0x6528('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6528('0xb'));var toCsv=require(_0x6528('0x6'));var querystring=require(_0x6528('0xc'));var Papa=require(_0x6528('0xd'));var Redis=require(_0x6528('0xe'));var authService=require(_0x6528('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6528('0x10'));var hardwareService=require(_0x6528('0x11'));var logger=require(_0x6528('0x12'))(_0x6528('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6528('0x14'));var db=require(_0x6528('0x15'))['db'];config[_0x6528('0x16')]=_[_0x6528('0x17')](config[_0x6528('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x6528('0x18'))(new Redis(config[_0x6528('0x16')]));require(_0x6528('0x19'))[_0x6528('0x1a')](socket);function respondWithStatusCode(_0x4f9dbe,_0x4e888e){_0x4e888e=_0x4e888e||0xcc;return function(_0x4d4a1e){if(_0x4d4a1e){return _0x4f9dbe[_0x6528('0x1b')](_0x4e888e);}return _0x4f9dbe[_0x6528('0x1c')](_0x4e888e)[_0x6528('0x1d')]();};}function respondWithResult(_0x3707af,_0x58fd2d){_0x58fd2d=_0x58fd2d||0xc8;return function(_0x32492f){if(_0x32492f){return _0x3707af['status'](_0x58fd2d)[_0x6528('0x1e')](_0x32492f);}};}function respondWithFilteredResult(_0x2d4a1d,_0x5a0325){return function(_0x2790d1){if(_0x2790d1){var _0x156680=typeof _0x5a0325[_0x6528('0x1f')]==='undefined'&&typeof _0x5a0325[_0x6528('0x20')]===_0x6528('0x21');var _0x473107=_0x2790d1[_0x6528('0x22')];var _0x1d2e2f=_0x156680?0x0:_0x5a0325[_0x6528('0x1f')];var _0x501b4d=_0x156680?_0x2790d1['count']:_0x5a0325[_0x6528('0x1f')]+_0x5a0325[_0x6528('0x20')];var _0x5978cc;if(_0x501b4d>=_0x473107){_0x501b4d=_0x473107;_0x5978cc=0xc8;}else{_0x5978cc=0xce;}_0x2d4a1d[_0x6528('0x1c')](_0x5978cc);return _0x2d4a1d[_0x6528('0x23')](_0x6528('0x24'),_0x1d2e2f+'-'+_0x501b4d+'/'+_0x473107)['json'](_0x2790d1);}return null;};}function patchUpdates(_0xeab291){return function(_0x2becda){try{jsonpatch[_0x6528('0x25')](_0x2becda,_0xeab291,!![]);}catch(_0xbf961f){return BPromise[_0x6528('0x26')](_0xbf961f);}return _0x2becda[_0x6528('0x27')]();};}function saveUpdates(_0x2b5c43,_0x288f8e){return function(_0x36bdcd){if(_0x36bdcd){return _0x36bdcd[_0x6528('0x28')](_0x2b5c43)[_0x6528('0x29')](function(_0x447e73){return _0x447e73;});}return null;};}function removeEntity(_0x4002b3,_0x364d64){return function(_0x1f7afc){if(_0x1f7afc){return _0x1f7afc[_0x6528('0x2a')]()[_0x6528('0x29')](function(){var _0x58014c=_0x1f7afc[_0x6528('0x2b')]({'plain':!![]});var _0x31d5f5='Lists';return db[_0x6528('0x2c')]['destroy']({'where':{'type':_0x31d5f5,'resourceId':_0x58014c['id']}})[_0x6528('0x29')](function(){return _0x1f7afc;});})['then'](function(){_0x4002b3[_0x6528('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1040b2,_0x2cbcba){return function(_0x1d5fcd){if(!_0x1d5fcd){_0x1040b2[_0x6528('0x1b')](0x194);}return _0x1d5fcd;};}function handleError(_0x14a1aa,_0x2bf76b){_0x2bf76b=_0x2bf76b||0x1f4;return function(_0x97550f){logger[_0x6528('0x2d')](_0x97550f[_0x6528('0x2e')]);if(_0x97550f['name']){delete _0x97550f['name'];}_0x14a1aa[_0x6528('0x1c')](_0x2bf76b)[_0x6528('0x2f')](_0x97550f);};}exports[_0x6528('0x30')]=function(_0x1cee6e,_0x1cb43a){var _0x45d855={},_0xa20506={},_0x38078d={'count':0x0,'rows':[]};var _0x5b3b4a=_[_0x6528('0x31')](db['CmList'][_0x6528('0x32')],function(_0x4b585f){return{'name':_0x4b585f[_0x6528('0x33')],'type':_0x4b585f[_0x6528('0x34')][_0x6528('0x35')]};});_0xa20506[_0x6528('0x36')]=_[_0x6528('0x31')](_0x5b3b4a,'name');_0xa20506['query']=_[_0x6528('0x37')](_0x1cee6e['query']);_0xa20506[_0x6528('0x38')]=_[_0x6528('0x39')](_0xa20506['model'],_0xa20506[_0x6528('0x3a')]);_0x45d855[_0x6528('0x3b')]=_[_0x6528('0x39')](_0xa20506['model'],qs[_0x6528('0x3c')](_0x1cee6e[_0x6528('0x3a')][_0x6528('0x3c')]));_0x45d855[_0x6528('0x3b')]=_0x45d855[_0x6528('0x3b')][_0x6528('0x3d')]?_0x45d855['attributes']:_0xa20506[_0x6528('0x36')];if(!_0x1cee6e[_0x6528('0x3a')]['hasOwnProperty'](_0x6528('0x3e'))){_0x45d855['limit']=qs[_0x6528('0x20')](_0x1cee6e[_0x6528('0x3a')][_0x6528('0x20')]);_0x45d855[_0x6528('0x1f')]=qs[_0x6528('0x1f')](_0x1cee6e[_0x6528('0x3a')][_0x6528('0x1f')]);}_0x45d855[_0x6528('0x3f')]=qs[_0x6528('0x40')](_0x1cee6e[_0x6528('0x3a')][_0x6528('0x40')]);_0x45d855[_0x6528('0x41')]=qs[_0x6528('0x38')](_[_0x6528('0x42')](_0x1cee6e[_0x6528('0x3a')],_0xa20506[_0x6528('0x38')]),_0x5b3b4a);if(_0x1cee6e[_0x6528('0x3a')][_0x6528('0x43')]){_0x45d855[_0x6528('0x41')]=_['merge'](_0x45d855['where'],{'$or':_[_0x6528('0x31')](_0x5b3b4a,function(_0x37c7fb){if(_0x37c7fb[_0x6528('0x34')]!==_0x6528('0x44')){var _0x2341d8={};_0x2341d8[_0x37c7fb[_0x6528('0x45')]]={'$like':'%'+_0x1cee6e[_0x6528('0x3a')][_0x6528('0x43')]+'%'};return _0x2341d8;}})});}_0x45d855=_[_0x6528('0x46')]({},_0x45d855,_0x1cee6e[_0x6528('0x47')]);var _0x457480={'where':_0x45d855[_0x6528('0x41')]};return db[_0x6528('0x48')]['count'](_0x457480)['then'](function(_0x30809c){_0x38078d['count']=_0x30809c;if(_0x1cee6e['query'][_0x6528('0x49')]){_0x45d855[_0x6528('0x4a')]=[{'all':!![]}];}return db[_0x6528('0x48')][_0x6528('0x4b')](_0x45d855);})[_0x6528('0x29')](function(_0x2949fc){_0x38078d[_0x6528('0x4c')]=_0x2949fc;return _0x38078d;})[_0x6528('0x29')](respondWithFilteredResult(_0x1cb43a,_0x45d855))[_0x6528('0x4d')](handleError(_0x1cb43a,null));};exports['show']=function(_0x2fbab4,_0x1f9fd5){var _0x4f6c73={'raw':![],'where':{'id':_0x2fbab4[_0x6528('0x4e')]['id']}},_0x452c70={};_0x452c70['model']=_[_0x6528('0x37')](db['CmList'][_0x6528('0x32')]);_0x452c70[_0x6528('0x3a')]=_[_0x6528('0x37')](_0x2fbab4[_0x6528('0x3a')]);_0x452c70[_0x6528('0x38')]=_['intersection'](_0x452c70[_0x6528('0x36')],_0x452c70[_0x6528('0x3a')]);_0x4f6c73['attributes']=_['intersection'](_0x452c70[_0x6528('0x36')],qs[_0x6528('0x3c')](_0x2fbab4[_0x6528('0x3a')]['fields']));_0x4f6c73['attributes']=_0x4f6c73[_0x6528('0x3b')][_0x6528('0x3d')]?_0x4f6c73[_0x6528('0x3b')]:_0x452c70['model'];if(_0x2fbab4[_0x6528('0x3a')][_0x6528('0x49')]){_0x4f6c73[_0x6528('0x4a')]=[{'all':!![]}];}_0x4f6c73=_[_0x6528('0x46')]({},_0x4f6c73,_0x2fbab4[_0x6528('0x47')]);return db[_0x6528('0x48')][_0x6528('0x4f')](_0x4f6c73)[_0x6528('0x29')](handleEntityNotFound(_0x1f9fd5,null))[_0x6528('0x29')](respondWithResult(_0x1f9fd5,null))[_0x6528('0x4d')](handleError(_0x1f9fd5,null));};exports['create']=function(_0x34ba57,_0x5b1cf8){return db[_0x6528('0x48')][_0x6528('0x50')](_0x34ba57[_0x6528('0x51')],{})[_0x6528('0x29')](function(_0x5784e6){var _0x47bdd8=_0x34ba57[_0x6528('0x52')][_0x6528('0x2b')]({'plain':!![]});if(!_0x47bdd8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47bdd8['role']===_0x6528('0x52')){var _0x4a8bd3=_0x5784e6[_0x6528('0x2b')]({'plain':!![]});var _0x287131=_0x6528('0x53');return db[_0x6528('0x54')]['find']({'where':{'name':_0x287131,'userProfileId':_0x47bdd8['userProfileId']},'raw':!![]})[_0x6528('0x29')](function(_0x485073){if(_0x485073&&_0x485073[_0x6528('0x55')]===0x0){return db[_0x6528('0x2c')][_0x6528('0x50')]({'name':_0x4a8bd3[_0x6528('0x45')],'resourceId':_0x4a8bd3['id'],'type':_0x485073[_0x6528('0x45')],'sectionId':_0x485073['id']},{})[_0x6528('0x29')](function(){return _0x5784e6;});}else{return _0x5784e6;}})['catch'](function(_0x25b4bd){logger[_0x6528('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25b4bd);throw _0x25b4bd;});}return _0x5784e6;})[_0x6528('0x29')](respondWithResult(_0x5b1cf8,0xc9))[_0x6528('0x4d')](handleError(_0x5b1cf8,null));};exports['update']=function(_0x46ab85,_0x2b3ac6){if(_0x46ab85[_0x6528('0x51')]['id']){delete _0x46ab85['body']['id'];}return db['CmList'][_0x6528('0x4f')]({'where':{'id':_0x46ab85[_0x6528('0x4e')]['id']}})[_0x6528('0x29')](handleEntityNotFound(_0x2b3ac6,null))['then'](saveUpdates(_0x46ab85[_0x6528('0x51')],null))[_0x6528('0x29')](respondWithResult(_0x2b3ac6,null))[_0x6528('0x4d')](handleError(_0x2b3ac6,null));};exports[_0x6528('0x2a')]=function(_0x4cd491,_0x32082e){return db[_0x6528('0x48')][_0x6528('0x4f')]({'where':{'id':_0x4cd491[_0x6528('0x4e')]['id']}})['then'](handleEntityNotFound(_0x32082e,null))[_0x6528('0x29')](removeEntity(_0x32082e,null))['catch'](handleError(_0x32082e,null));};exports['describe']=function(_0x3d4f72,_0x9363ec){return db[_0x6528('0x48')][_0x6528('0x56')]()['then'](respondWithResult(_0x9363ec,null))[_0x6528('0x4d')](handleError(_0x9363ec,null));};exports['addDisposition']=function(_0xfaddb5,_0x3d5e1c,_0x5df40c){if(_0xfaddb5[_0x6528('0x51')]['id']){delete _0xfaddb5['body']['id'];}return db[_0x6528('0x48')]['find']({'where':{'id':_0xfaddb5[_0x6528('0x4e')]['id']}})[_0x6528('0x29')](handleEntityNotFound(_0x3d5e1c,null))[_0x6528('0x29')](function(_0x225790){if(_0x225790){_0xfaddb5['body']['ListId']=_0x225790['id'];return db[_0x6528('0x57')][_0x6528('0x50')](_0xfaddb5[_0x6528('0x51')]);}})['then'](respondWithResult(_0x3d5e1c,null))[_0x6528('0x4d')](handleError(_0x3d5e1c,null));};exports[_0x6528('0x58')]=function(_0x59378d,_0x51c6b6,_0x4d1dbc){var _0xe53d02={'raw':![],'where':{}};var _0x2240b7={};var _0x13ed3d={'count':0x0,'rows':[]};return db[_0x6528('0x48')]['findOne']({'where':{'id':_0x59378d[_0x6528('0x4e')]['id']}})[_0x6528('0x29')](handleEntityNotFound(_0x51c6b6,null))[_0x6528('0x29')](function(_0x4c14de){if(_0x4c14de){_0x2240b7[_0x6528('0x36')]=_['keys'](db[_0x6528('0x57')][_0x6528('0x32')]);_0x2240b7['query']=_[_0x6528('0x37')](_0x59378d[_0x6528('0x3a')]);_0x2240b7[_0x6528('0x38')]=_[_0x6528('0x39')](_0x2240b7[_0x6528('0x36')],_0x2240b7[_0x6528('0x3a')]);_0xe53d02[_0x6528('0x3b')]=_[_0x6528('0x39')](_0x2240b7[_0x6528('0x36')],qs[_0x6528('0x3c')](_0x59378d[_0x6528('0x3a')]['fields']));_0xe53d02['attributes']=_0xe53d02[_0x6528('0x3b')][_0x6528('0x3d')]?_0xe53d02[_0x6528('0x3b')]:_0x2240b7[_0x6528('0x36')];if(!_0x59378d[_0x6528('0x3a')][_0x6528('0x59')](_0x6528('0x3e'))){_0xe53d02['limit']=qs[_0x6528('0x20')](_0x59378d[_0x6528('0x3a')]['limit']);_0xe53d02['offset']=qs[_0x6528('0x1f')](_0x59378d[_0x6528('0x3a')][_0x6528('0x1f')]);}_0xe53d02['order']=qs[_0x6528('0x40')](_0x59378d[_0x6528('0x3a')][_0x6528('0x40')]);_0xe53d02['where']=qs['filters'](_[_0x6528('0x42')](_0x59378d[_0x6528('0x3a')],_0x2240b7[_0x6528('0x38')]));_0xe53d02[_0x6528('0x41')]['ListId']=_0x4c14de['id'];if(_0x59378d['query'][_0x6528('0x43')]){_0xe53d02[_0x6528('0x41')]=_['merge'](_0xe53d02[_0x6528('0x41')],{'$or':_[_0x6528('0x31')](_0xe53d02[_0x6528('0x3b')],function(_0x3da059){var _0x3517c1={};_0x3517c1[_0x3da059]={'$like':'%'+_0x59378d[_0x6528('0x3a')][_0x6528('0x43')]+'%'};return _0x3517c1;})});}_0xe53d02=_[_0x6528('0x46')]({},_0xe53d02,_0x59378d[_0x6528('0x47')]);return db[_0x6528('0x57')][_0x6528('0x22')]({'where':_0xe53d02['where']})[_0x6528('0x29')](function(_0xfc538b){_0x13ed3d['count']=_0xfc538b;if(_0x59378d['query'][_0x6528('0x49')]){_0xe53d02[_0x6528('0x4a')]=[{'all':!![]}];}return db[_0x6528('0x57')][_0x6528('0x4b')](_0xe53d02);})[_0x6528('0x29')](function(_0x1f9255){_0x13ed3d['rows']=_0x1f9255;return _0x13ed3d;});}})[_0x6528('0x29')](respondWithFilteredResult(_0x51c6b6,_0xe53d02))[_0x6528('0x4d')](handleError(_0x51c6b6,null));};exports[_0x6528('0x5a')]=function(_0x24bed9,_0xd808ee,_0x34a89d){return db['CmList'][_0x6528('0x4f')]({'where':{'id':_0x24bed9['params']['id']}})[_0x6528('0x29')](handleEntityNotFound(_0xd808ee,null))[_0x6528('0x29')](function(_0x398dab){if(_0x398dab){return _0x398dab[_0x6528('0x5a')](_0x24bed9[_0x6528('0x3a')][_0x6528('0x5b')]);}})[_0x6528('0x29')](respondWithStatusCode(_0xd808ee,null))[_0x6528('0x4d')](handleError(_0xd808ee,null));};exports[_0x6528('0x5c')]=function(_0x24e226,_0x3a0f8b,_0x52d2e1){return db[_0x6528('0x48')][_0x6528('0x4f')]({'where':{'id':_0x24e226[_0x6528('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3a0f8b,null))[_0x6528('0x29')](function(_0x4062e8){if(_0x4062e8){var _0x5208eb=[];var _0x28993c={'success':[],'errors':[]};return db[_0x6528('0x5d')][_0x6528('0x56')]()['then'](function(_0x234c7d){if(_0x24e226[_0x6528('0x51')][_0x6528('0x5e')]&&_[_0x6528('0x5f')](_0x24e226[_0x6528('0x51')][_0x6528('0x5e')])){if(_0x24e226[_0x6528('0x51')]['tags'][_0x6528('0x3d')]){_0x24e226[_0x6528('0x51')][_0x6528('0x5e')]=_0x24e226['body'][_0x6528('0x5e')][_0x6528('0x60')](';')+';';}else{_0x24e226['body'][_0x6528('0x5e')]=null;}}else{_0x24e226['body'][_0x6528('0x5e')]=null;}if(_0x24e226['body']&&_['isArray'](_0x24e226[_0x6528('0x51')])){for(var _0x3ec789=0x0;_0x3ec789<_0x24e226[_0x6528('0x51')][_0x6528('0x3d')];_0x3ec789+=0x1){_0x24e226[_0x6528('0x51')][_0x3ec789]['ListId']=_0x24e226[_0x6528('0x4e')]['id'];_0x5208eb[_0x6528('0x61')](_0x24e226['body'][_0x3ec789]);}return BPromise[_0x6528('0x62')](_0x5208eb,function(_0xd17a78){return db[_0x6528('0x5d')]['create'](_[_0x6528('0x63')](_0xd17a78,[_0x6528('0x5b'),'id'])||{},{'fields':_[_0x6528('0x37')](_0x234c7d),'raw':!![]})[_0x6528('0x29')](function(_0x223d06){_0x28993c[_0x6528('0x64')]['push'](_0x223d06['dataValues']);})[_0x6528('0x4d')](function(_0x3f7e4f){_0x28993c['errors'][_0x6528('0x61')]({'data':_0xd17a78,'error':_0x3f7e4f['message']});});})['then'](function(_0x58b6c7){return _0x28993c;})[_0x6528('0x4d')](function(_0x588cfe){return _0x588cfe;});}else{_0x3a0f8b[_0x6528('0x1c')](0x190)[_0x6528('0x1e')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x6528('0x29')](respondWithResult(_0x3a0f8b,null))[_0x6528('0x4d')](handleError(_0x3a0f8b,null));};exports[_0x6528('0x65')]=function(_0x11b4e0,_0x47642b,_0x3448c3){var _0x17d483;return db[_0x6528('0x48')][_0x6528('0x4f')]({'where':{'id':_0x11b4e0[_0x6528('0x4e')]['id']},'include':[{'model':db[_0x6528('0x66')],'as':_0x6528('0x67')}]})['then'](handleEntityNotFound(_0x47642b,null))[_0x6528('0x29')](function(_0x292548){if(_0x292548){_0x17d483=_0x292548;return db[_0x6528('0x5d')][_0x6528('0x32')];}})[_0x6528('0x29')](function(_0x51b653){if(_0x51b653){var _0x41893a={};var _0x5aeb52={};_0x5aeb52[_0x6528('0x36')]=_[_0x6528('0x68')](_[_0x6528('0x37')](_0x51b653),_[_0x6528('0x31')](_0x17d483[_0x6528('0x67')],function(_0x4e3529){return util[_0x6528('0x69')](_0x6528('0x6a'),_0x4e3529['id']);}));_0x5aeb52['query']=_[_0x6528('0x37')](_0x11b4e0[_0x6528('0x3a')]);_0x5aeb52[_0x6528('0x38')]=_[_0x6528('0x39')](_0x5aeb52[_0x6528('0x36')],_0x5aeb52[_0x6528('0x3a')]);_0x41893a[_0x6528('0x3b')]=_['intersection'](_0x5aeb52[_0x6528('0x36')],qs['fields'](_0x11b4e0[_0x6528('0x3a')][_0x6528('0x3c')]));_0x41893a[_0x6528('0x3b')]=_0x41893a[_0x6528('0x3b')][_0x6528('0x3d')]?_0x41893a[_0x6528('0x3b')]:_0x5aeb52[_0x6528('0x36')];if(!_0x11b4e0[_0x6528('0x3a')][_0x6528('0x59')](_0x6528('0x3e'))){_0x41893a['limit']=qs[_0x6528('0x20')](_0x11b4e0['query'][_0x6528('0x20')]);_0x41893a['offset']=qs[_0x6528('0x1f')](_0x11b4e0[_0x6528('0x3a')][_0x6528('0x1f')]);}_0x41893a[_0x6528('0x3f')]=qs[_0x6528('0x40')](_0x11b4e0[_0x6528('0x3a')][_0x6528('0x40')]);_0x41893a[_0x6528('0x41')]=qs['filters'](_[_0x6528('0x42')](_0x11b4e0['query'],_0x5aeb52[_0x6528('0x38')]));_0x41893a['raw']=!![];if(_0x11b4e0[_0x6528('0x3a')][_0x6528('0x43')]){_0x41893a['where']=_[_0x6528('0x46')](_0x41893a[_0x6528('0x41')],{'$or':_[_0x6528('0x31')](_0x41893a[_0x6528('0x3b')],function(_0x40e13e){var _0x515b83={};_0x515b83[_0x40e13e]={'$like':'%'+_0x11b4e0[_0x6528('0x3a')][_0x6528('0x43')]+'%'};return _0x515b83;})});}_0x41893a=_['merge']({},_0x41893a,_0x11b4e0[_0x6528('0x47')]);return _0x17d483['getContacts'](_0x41893a);}})[_0x6528('0x29')](respondWithResult(_0x47642b,null))[_0x6528('0x4d')](handleError(_0x47642b,null));};exports['getContactsCsv']=function(_0x524640,_0x444971,_0x4c122d){var _0x3dae57;return db[_0x6528('0x48')]['find']({'where':{'id':_0x524640[_0x6528('0x4e')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x6528('0x67')}]})[_0x6528('0x29')](handleEntityNotFound(_0x444971,null))[_0x6528('0x29')](function(_0x1b2955){if(_0x1b2955){_0x3dae57=_0x1b2955;return db[_0x6528('0x5d')]['rawAttributes'];}})[_0x6528('0x29')](function(_0x430824){if(_0x430824){var _0x4897cd={};var _0x351e0e={};_0x351e0e[_0x6528('0x36')]=_[_0x6528('0x68')](_[_0x6528('0x37')](_0x430824),_['map'](_0x3dae57[_0x6528('0x67')],function(_0x3e8222){return util[_0x6528('0x69')](_0x6528('0x6a'),_0x3e8222['id']);}));_0x351e0e[_0x6528('0x3a')]=_[_0x6528('0x37')](_0x524640[_0x6528('0x3a')]);_0x351e0e[_0x6528('0x38')]=_[_0x6528('0x39')](_0x351e0e['model'],_0x351e0e[_0x6528('0x3a')]);_0x4897cd[_0x6528('0x3b')]=_[_0x6528('0x39')](_0x351e0e['model'],qs['fields'](_0x524640[_0x6528('0x3a')][_0x6528('0x3c')]));_0x4897cd[_0x6528('0x3b')]=_0x4897cd['attributes'][_0x6528('0x3d')]?_0x4897cd[_0x6528('0x3b')]:_0x351e0e[_0x6528('0x36')];if(!_0x524640[_0x6528('0x3a')][_0x6528('0x59')]('nolimit')){_0x4897cd[_0x6528('0x20')]=qs['limit'](_0x524640[_0x6528('0x3a')][_0x6528('0x20')]);_0x4897cd[_0x6528('0x1f')]=qs[_0x6528('0x1f')](_0x524640[_0x6528('0x3a')][_0x6528('0x1f')]);}_0x4897cd[_0x6528('0x3f')]=qs[_0x6528('0x40')](_0x524640[_0x6528('0x3a')]['sort']);_0x4897cd[_0x6528('0x41')]=qs[_0x6528('0x38')](_[_0x6528('0x42')](_0x524640[_0x6528('0x3a')],_0x351e0e[_0x6528('0x38')]));_0x4897cd[_0x6528('0x6b')]=!![];if(_0x524640[_0x6528('0x3a')]['filter']){_0x4897cd[_0x6528('0x41')]=_['merge'](_0x4897cd['where'],{'$or':_[_0x6528('0x31')](_0x4897cd[_0x6528('0x3b')],function(_0x481553){var _0x5581b6={};_0x5581b6[_0x481553]={'$like':'%'+_0x524640[_0x6528('0x3a')][_0x6528('0x43')]+'%'};return _0x5581b6;})});}_0x4897cd=_[_0x6528('0x46')]({},_0x4897cd,_0x524640[_0x6528('0x47')]);return _0x3dae57[_0x6528('0x65')](_0x4897cd);}})[_0x6528('0x29')](function(_0x578afc){if(!_[_0x6528('0x6c')](_0x578afc)){var _0x3055c8=toCsv(_0x578afc);var _0x36ab86=Date[_0x6528('0x6d')]();fs[_0x6528('0x6e')](util[_0x6528('0x69')](_0x6528('0x6f'),_0x3dae57['id'],_0x36ab86),_0x3055c8);_0x444971['setHeader'](_0x6528('0x70'),_0x6528('0x71')+util[_0x6528('0x69')](_0x6528('0x72'),_0x3dae57['id'],_0x36ab86));_0x444971['setHeader'](_0x6528('0x73'),_0x6528('0x74'));return _0x444971['download'](util[_0x6528('0x69')]('/tmp/list_%d_%s.csv',_0x3dae57['id'],_0x36ab86));}else{return _0x444971[_0x6528('0x1b')](0xcc);}})['catch'](handleError(_0x444971,null));};exports[_0x6528('0x75')]=function(_0x4f5bbe,_0x58c759,_0x46fb44){var _0x257770;delete _0x4f5bbe[_0x6528('0x51')]['id'];return db[_0x6528('0x48')][_0x6528('0x76')]({'where':{'id':_0x4f5bbe['params']['id']}})[_0x6528('0x29')](handleEntityNotFound(_0x58c759,null))[_0x6528('0x29')](function(_0x3abf07){if(_0x3abf07){return db[_0x6528('0x77')][_0x6528('0x78')](function(_0x4a02d0){return db[_0x6528('0x66')][_0x6528('0x50')](_0x4f5bbe[_0x6528('0x51')],{'transaction':_0x4a02d0})[_0x6528('0x29')](function(_0x2dff7a){_0x257770=_0x2dff7a;return _0x3abf07[_0x6528('0x79')](_0x2dff7a,{'transaction':_0x4a02d0});})[_0x6528('0x29')](function(){var _0x4a37fa={'type':db[_0x6528('0x7a')][_0x6528('0x7b')],'transaction':_0x4a02d0};switch(_0x4f5bbe[_0x6528('0x51')][_0x6528('0x34')]){case _0x6528('0x7c'):_0x4a37fa[_0x6528('0x34')]=db['Sequelize'][_0x6528('0x7b')];break;case _0x6528('0x7d'):_0x4a37fa[_0x6528('0x34')]=db[_0x6528('0x7a')][_0x6528('0x7e')];break;case _0x6528('0x7f'):_0x4a37fa['type']=db[_0x6528('0x7a')][_0x6528('0x80')];_0x4a37fa[_0x6528('0x81')]=![];break;default:}return db['sequelize']['queryInterface'][_0x6528('0x82')]('cm_contacts',util[_0x6528('0x69')](_0x6528('0x83'),_0x257770['id']),_0x4a37fa);})[_0x6528('0x29')](function(){return _0x257770;});});}})[_0x6528('0x29')](respondWithResult(_0x58c759,null))[_0x6528('0x4d')](handleError(_0x58c759,null));};exports['getCustomFields']=function(_0x5bf989,_0x3ee6a4,_0x365dd0){var _0x1af560={};var _0x3fc6a7={};var _0x2edd58;var _0x516c36;return db['CmList'][_0x6528('0x76')]({'where':{'id':_0x5bf989[_0x6528('0x4e')]['id']}})[_0x6528('0x29')](handleEntityNotFound(_0x3ee6a4,null))['then'](function(_0x797aec){if(_0x797aec){_0x2edd58=_0x797aec;_0x3fc6a7['model']=_['keys'](db['CmCustomField'][_0x6528('0x32')]);_0x3fc6a7[_0x6528('0x3a')]=_[_0x6528('0x37')](_0x5bf989[_0x6528('0x3a')]);_0x3fc6a7[_0x6528('0x38')]=_[_0x6528('0x39')](_0x3fc6a7['model'],_0x3fc6a7[_0x6528('0x3a')]);_0x1af560[_0x6528('0x3b')]=_[_0x6528('0x39')](_0x3fc6a7['model'],qs[_0x6528('0x3c')](_0x5bf989['query']['fields']));_0x1af560[_0x6528('0x3b')]=_0x1af560[_0x6528('0x3b')][_0x6528('0x3d')]?_0x1af560[_0x6528('0x3b')]:_0x3fc6a7[_0x6528('0x36')];_0x1af560[_0x6528('0x3f')]=qs[_0x6528('0x40')](_0x5bf989[_0x6528('0x3a')]['sort']);_0x1af560[_0x6528('0x41')]=qs[_0x6528('0x38')](_['pick'](_0x5bf989[_0x6528('0x3a')],_0x3fc6a7['filters']));_0x1af560[_0x6528('0x41')]=_['merge'](_0x1af560[_0x6528('0x41')],{'$or':[{'ListId':_0x797aec['id']},{'ListId':null}]});if(_0x5bf989[_0x6528('0x3a')][_0x6528('0x43')]){_0x1af560['where']=_[_0x6528('0x46')](_0x1af560[_0x6528('0x41')],{'$or':_[_0x6528('0x31')](_0x1af560[_0x6528('0x3b')],function(_0x1dc465){var _0x4cd382={};_0x4cd382[_0x1dc465]={'$like':'%'+_0x5bf989[_0x6528('0x3a')]['filter']+'%'};return _0x4cd382;})});}_0x1af560=_[_0x6528('0x46')]({},_0x1af560,_0x5bf989['options']);return db[_0x6528('0x66')][_0x6528('0x84')](_0x1af560);}})[_0x6528('0x29')](respondWithResult(_0x3ee6a4,null))[_0x6528('0x4d')](handleError(_0x3ee6a4,null));};exports[_0x6528('0x85')]=function(_0x4b3487,_0x57dbe6,_0x1a05ce){return db[_0x6528('0x48')][_0x6528('0x4f')]({'where':{'id':_0x4b3487['params']['id']}})[_0x6528('0x29')](handleEntityNotFound(_0x57dbe6,null))[_0x6528('0x29')](function(_0x5c340f){if(_0x5c340f){return _0x5c340f[_0x6528('0x85')](_0x4b3487[_0x6528('0x51')][_0x6528('0x5b')],_[_0x6528('0x63')](_0x4b3487['body'],['ids','id'])||{})[_0x6528('0x86')](function(_0x2db482){for(var _0x42f520=0x0;_0x42f520<_0x4b3487[_0x6528('0x51')][_0x6528('0x5b')][_0x6528('0x3d')];_0x42f520+=0x1){socket[_0x6528('0x87')](_0x6528('0x88'),{'UserId':_0x4b3487[_0x6528('0x51')][_0x6528('0x5b')][_0x42f520],'CmListId':_0x4b3487[_0x6528('0x4e')]['id']});}return _0x2db482;});}})[_0x6528('0x29')](respondWithResult(_0x57dbe6,null))[_0x6528('0x4d')](handleError(_0x57dbe6,null));};exports[_0x6528('0x89')]=function(_0x1e34df,_0x388158,_0x21d3aa){return db[_0x6528('0x48')]['find']({'where':{'id':_0x1e34df['params']['id']}})[_0x6528('0x29')](handleEntityNotFound(_0x388158,null))[_0x6528('0x29')](function(_0x343b42){if(_0x343b42){return _0x343b42[_0x6528('0x89')](_0x1e34df['query'][_0x6528('0x5b')])[_0x6528('0x29')](function(){if(_['isArray'](_0x1e34df[_0x6528('0x3a')][_0x6528('0x5b')])){for(var _0x4a8d92=0x0;_0x4a8d92<_0x1e34df[_0x6528('0x3a')][_0x6528('0x5b')][_0x6528('0x3d')];_0x4a8d92+=0x1){socket[_0x6528('0x87')](_0x6528('0x8a'),{'UserId':Number(_0x1e34df[_0x6528('0x3a')][_0x6528('0x5b')][_0x4a8d92]),'CmListId':Number(_0x1e34df[_0x6528('0x4e')]['id'])});}}else{socket[_0x6528('0x87')](_0x6528('0x8a'),{'UserId':Number(_0x1e34df[_0x6528('0x3a')][_0x6528('0x5b')]),'CmListId':Number(_0x1e34df['params']['id'])});}});}})[_0x6528('0x29')](respondWithStatusCode(_0x388158,null))[_0x6528('0x4d')](handleError(_0x388158,null));};exports['getAgents']=function(_0x1a06c2,_0xa74414,_0x22b7bd){var _0x496f1b={};var _0x3f7c98={};var _0x4976b9;var _0x9b7216;return db[_0x6528('0x48')][_0x6528('0x76')]({'where':{'id':_0x1a06c2[_0x6528('0x4e')]['id']}})[_0x6528('0x29')](handleEntityNotFound(_0xa74414,null))[_0x6528('0x29')](function(_0x34dced){if(_0x34dced){_0x4976b9=_0x34dced;_0x3f7c98['model']=_['keys'](db['User'][_0x6528('0x32')]);_0x3f7c98[_0x6528('0x3a')]=_[_0x6528('0x37')](_0x1a06c2[_0x6528('0x3a')]);_0x3f7c98[_0x6528('0x38')]=_[_0x6528('0x39')](_0x3f7c98[_0x6528('0x36')],_0x3f7c98[_0x6528('0x3a')]);_0x496f1b['attributes']=_[_0x6528('0x39')](_0x3f7c98[_0x6528('0x36')],qs[_0x6528('0x3c')](_0x1a06c2[_0x6528('0x3a')][_0x6528('0x3c')]));_0x496f1b['attributes']=_0x496f1b[_0x6528('0x3b')][_0x6528('0x3d')]?_0x496f1b[_0x6528('0x3b')]:_0x3f7c98[_0x6528('0x36')];_0x496f1b[_0x6528('0x3f')]=qs[_0x6528('0x40')](_0x1a06c2[_0x6528('0x3a')][_0x6528('0x40')]);_0x496f1b['where']=qs[_0x6528('0x38')](_['pick'](_0x1a06c2[_0x6528('0x3a')],_0x3f7c98[_0x6528('0x38')]));if(_0x1a06c2[_0x6528('0x3a')][_0x6528('0x43')]){_0x496f1b['where']=_['merge'](_0x496f1b[_0x6528('0x41')],{'$or':_[_0x6528('0x31')](_0x496f1b[_0x6528('0x3b')],function(_0x3a73a0){var _0x1bcf8b={};_0x1bcf8b[_0x3a73a0]={'$like':'%'+_0x1a06c2[_0x6528('0x3a')]['filter']+'%'};return _0x1bcf8b;})});}_0x496f1b=_[_0x6528('0x46')]({},_0x496f1b,_0x1a06c2[_0x6528('0x47')]);return _0x4976b9['getAgents'](_0x496f1b);}})['then'](function(_0x1785c7){if(_0x1785c7){_0x9b7216=_0x1785c7[_0x6528('0x3d')];if(!_0x1a06c2[_0x6528('0x3a')][_0x6528('0x59')]('nolimit')){_0x496f1b[_0x6528('0x20')]=qs[_0x6528('0x20')](_0x1a06c2['query'][_0x6528('0x20')]);_0x496f1b[_0x6528('0x1f')]=qs[_0x6528('0x1f')](_0x1a06c2[_0x6528('0x3a')]['offset']);}return _0x4976b9['getAgents'](_0x496f1b);}})['then'](function(_0x296327){if(_0x296327){return _0x296327?{'count':_0x9b7216,'rows':_0x296327}:null;}})[_0x6528('0x29')](respondWithResult(_0xa74414,null))['catch'](handleError(_0xa74414,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 94d2c58..0ab8d9f 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 _0x61d4=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x7290bf,_0x10acee){var _0x1027b6=function(_0x4a7324){while(--_0x4a7324){_0x7290bf['push'](_0x7290bf['shift']());}};_0x1027b6(++_0x10acee);}(_0x61d4,0x8f));var _0x461d=function(_0x4bf264,_0x3be730){_0x4bf264=_0x4bf264-0x0;var _0x3c855f=_0x61d4[_0x4bf264];return _0x3c855f;};'use strict';var EventEmitter=require(_0x461d('0x0'));var CmList=require(_0x461d('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x461d('0x2')](0x0);var events={'afterCreate':_0x461d('0x3'),'afterUpdate':_0x461d('0x4'),'afterDestroy':_0x461d('0x5')};function emitEvent(_0x497c10){return function(_0x1a3e68,_0x1fcf4b,_0x218e82){CmListEvents[_0x461d('0x6')](_0x497c10+':'+_0x1a3e68['id'],_0x1a3e68);CmListEvents[_0x461d('0x6')](_0x497c10,_0x1a3e68);_0x218e82(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x461d('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x255d=['update','emit','hasOwnProperty','exports','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x336595,_0x413e3d){var _0x600f95=function(_0x33a9f9){while(--_0x33a9f9){_0x336595['push'](_0x336595['shift']());}};_0x600f95(++_0x413e3d);}(_0x255d,0xbc));var _0xd255=function(_0x22d822,_0x3b4f9f){_0x22d822=_0x22d822-0x0;var _0x4c345f=_0x255d[_0x22d822];return _0x4c345f;};'use strict';var EventEmitter=require('events');var CmList=require(_0xd255('0x0'))['db'][_0xd255('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0xd255('0x2')](0x0);var events={'afterCreate':_0xd255('0x3'),'afterUpdate':_0xd255('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4e8aa9){return function(_0x57c5ce,_0x37c8ef,_0xe6d417){CmListEvents['emit'](_0x4e8aa9+':'+_0x57c5ce['id'],_0x57c5ce);CmListEvents[_0xd255('0x5')](_0x4e8aa9,_0x57c5ce);_0xe6d417(null);};}for(var e in events){if(events[_0xd255('0x6')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0xd255('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 1675165..9909c57 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 _0xe400=['rimraf','../../config/environment','./cmList.attributes','define','CmList','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1dc8fb,_0x36a108){var _0x3a2b2a=function(_0x3647a7){while(--_0x3647a7){_0x1dc8fb['push'](_0x1dc8fb['shift']());}};_0x3a2b2a(++_0x36a108);}(_0xe400,0xa1));var _0x0e40=function(_0x497350,_0xd12725){_0x497350=_0x497350-0x0;var _0x1d36eb=_0xe400[_0x497350];return _0x1d36eb;};'use strict';var _=require(_0x0e40('0x0'));var util=require(_0x0e40('0x1'));var logger=require(_0x0e40('0x2'))(_0x0e40('0x3'));var moment=require('moment');var BPromise=require(_0x0e40('0x4'));var rp=require(_0x0e40('0x5'));var fs=require('fs');var path=require(_0x0e40('0x6'));var rimraf=require(_0x0e40('0x7'));var config=require(_0x0e40('0x8'));var attributes=require(_0x0e40('0x9'));module['exports']=function(_0x23edd7,_0xddfa97){return _0x23edd7[_0x0e40('0xa')](_0x0e40('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ffa=['define','CmList','cm_lists','../../config/logger','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x0ffa,0x81));var _0xa0ff=function(_0x3af9de,_0xd8bc4f){_0x3af9de=_0x3af9de-0x0;var _0x1ed3d6=_0x0ffa[_0x3af9de];return _0x1ed3d6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa0ff('0x0'))('api');var moment=require('moment');var BPromise=require(_0xa0ff('0x1'));var rp=require(_0xa0ff('0x2'));var fs=require('fs');var path=require(_0xa0ff('0x3'));var rimraf=require('rimraf');var config=require(_0xa0ff('0x4'));var attributes=require('./cmList.attributes');module[_0xa0ff('0x5')]=function(_0x1af716,_0x228a92){return _0x1af716[_0xa0ff('0x6')](_0xa0ff('0x7'),attributes,{'tableName':_0xa0ff('0x8'),'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 7aba062..89d8f30 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 _0x81c6=['CmList,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./cmList.socket','request','then'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x81c6,0x1d5));var _0x681c=function(_0x3fb743,_0x2b6886){_0x3fb743=_0x3fb743-0x0;var _0x135901=_0x81c6[_0x3fb743];return _0x135901;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});config[_0x681c('0x8')]=_[_0x681c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x681c('0xa'))(new Redis(config[_0x681c('0x8')]));require(_0x681c('0xb'))['register'](socket);function respondWithRpcPromise(_0x4f0228,_0x3e3770,_0x4ff60b){return new BPromise(function(_0x82b6ad,_0x83927a){return client[_0x681c('0xc')](_0x4f0228,_0x4ff60b)[_0x681c('0xd')](function(_0x48dc05){logger['info'](_0x681c('0xe'),_0x3e3770,_0x681c('0xf'));logger[_0x681c('0x10')]('CmList,\x20%s,\x20%s,\x20%s',_0x3e3770,_0x681c('0xf'),JSON['stringify'](_0x48dc05));if(_0x48dc05[_0x681c('0x11')]){if(_0x48dc05['error'][_0x681c('0x12')]===0x1f4){logger[_0x681c('0x11')](_0x681c('0xe'),_0x3e3770,_0x48dc05[_0x681c('0x11')][_0x681c('0x13')]);return _0x83927a(_0x48dc05[_0x681c('0x11')]['message']);}logger[_0x681c('0x11')](_0x681c('0xe'),_0x3e3770,_0x48dc05[_0x681c('0x11')][_0x681c('0x13')]);return _0x82b6ad(_0x48dc05[_0x681c('0x11')][_0x681c('0x13')]);}else{logger['info'](_0x681c('0xe'),_0x3e3770,_0x681c('0xf'));_0x82b6ad(_0x48dc05[_0x681c('0x14')][_0x681c('0x13')]);}})['catch'](function(_0x22e608){logger[_0x681c('0x11')]('CmList,\x20%s,\x20%s',_0x3e3770,_0x22e608);_0x83927a(_0x22e608);});});} \ No newline at end of file +var _0x86b6=['error','message','CmList,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','info','request\x20sent','debug','stringify'];(function(_0x1f7a00,_0x341591){var _0x4b151c=function(_0x51fceb){while(--_0x51fceb){_0x1f7a00['push'](_0x1f7a00['shift']());}};_0x4b151c(++_0x341591);}(_0x86b6,0x157));var _0x686b=function(_0x11b3f4,_0x371c17){_0x11b3f4=_0x11b3f4-0x0;var _0x47af1d=_0x86b6[_0x11b3f4];return _0x47af1d;};'use strict';var _=require(_0x686b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x686b('0x1'));var rs=require(_0x686b('0x2'));var fs=require('fs');var Redis=require(_0x686b('0x3'));var db=require(_0x686b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x686b('0x5'))(_0x686b('0x6'));var config=require(_0x686b('0x7'));var jayson=require(_0x686b('0x8'));var client=jayson['client'][_0x686b('0x9')]({'port':0x232a});config[_0x686b('0xa')]=_[_0x686b('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x686b('0xc'))(new Redis(config[_0x686b('0xa')]));require(_0x686b('0xd'))[_0x686b('0xe')](socket);function respondWithRpcPromise(_0x3df923,_0x47330f,_0x6602b9){return new BPromise(function(_0x47ab5a,_0x3132ea){return client[_0x686b('0xf')](_0x3df923,_0x6602b9)[_0x686b('0x10')](function(_0x288da3){logger[_0x686b('0x11')]('CmList,\x20%s,\x20%s',_0x47330f,_0x686b('0x12'));logger[_0x686b('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0x47330f,_0x686b('0x12'),JSON[_0x686b('0x14')](_0x288da3));if(_0x288da3['error']){if(_0x288da3[_0x686b('0x15')]['code']===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x47330f,_0x288da3[_0x686b('0x15')][_0x686b('0x16')]);return _0x3132ea(_0x288da3[_0x686b('0x15')][_0x686b('0x16')]);}logger[_0x686b('0x15')]('CmList,\x20%s,\x20%s',_0x47330f,_0x288da3[_0x686b('0x15')][_0x686b('0x16')]);return _0x47ab5a(_0x288da3[_0x686b('0x15')][_0x686b('0x16')]);}else{logger[_0x686b('0x11')](_0x686b('0x17'),_0x47330f,_0x686b('0x12'));_0x47ab5a(_0x288da3[_0x686b('0x18')][_0x686b('0x16')]);}})[_0x686b('0x19')](function(_0x2d1384){logger[_0x686b('0x15')](_0x686b('0x17'),_0x47330f,_0x2d1384);_0x3132ea(_0x2d1384);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 6cab528..87e8bc8 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 _0xfd87=['./cmList.events','save','remove','update','emit','removeListener','length','cmList:'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var CmListEvents=require(_0x7fd8('0x0'));var events=[_0x7fd8('0x1'),_0x7fd8('0x2'),_0x7fd8('0x3')];function createListener(_0x11b128,_0x15d25f){return function(_0x2631d9){_0x15d25f[_0x7fd8('0x4')](_0x11b128,_0x2631d9);};}function removeListener(_0x4429f2,_0x43b442){return function(){CmListEvents[_0x7fd8('0x5')](_0x4429f2,_0x43b442);};}exports['register']=function(_0x1395b6){for(var _0x10a778=0x0,_0x55681d=events[_0x7fd8('0x6')];_0x10a778<_0x55681d;_0x10a778++){var _0x6eaf96=events[_0x10a778];var _0x2e2d74=createListener(_0x7fd8('0x7')+_0x6eaf96,_0x1395b6);CmListEvents['on'](_0x6eaf96,_0x2e2d74);}}; \ No newline at end of file +var _0x975b=['register','cmList:','./cmList.events','save','remove','update','removeListener'];(function(_0x549d0e,_0x2c1a68){var _0x613cfb=function(_0x556070){while(--_0x556070){_0x549d0e['push'](_0x549d0e['shift']());}};_0x613cfb(++_0x2c1a68);}(_0x975b,0x1c9));var _0xb975=function(_0x1d9314,_0x1c27a2){_0x1d9314=_0x1d9314-0x0;var _0xa4b6c4=_0x975b[_0x1d9314];return _0xa4b6c4;};'use strict';var CmListEvents=require(_0xb975('0x0'));var events=[_0xb975('0x1'),_0xb975('0x2'),_0xb975('0x3')];function createListener(_0x2b8e95,_0x152d0d){return function(_0x45fa5f){_0x152d0d['emit'](_0x2b8e95,_0x45fa5f);};}function removeListener(_0xa92c72,_0xfb173){return function(){CmListEvents[_0xb975('0x4')](_0xa92c72,_0xfb173);};}exports[_0xb975('0x5')]=function(_0x599d95){for(var _0x1729fe=0x0,_0x3d84f1=events['length'];_0x1729fe<_0x3d84f1;_0x1729fe++){var _0x4178ee=events[_0x1729fe];var _0x550f78=createListener(_0xb975('0x6')+_0x4178ee,_0x599d95);CmListEvents['on'](_0x4178ee,_0x550f78);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 0d348ab..cd6173d 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 _0x008c=['/:id/users','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','show','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getAgents','post','create','addDisposition','addCustomField','update','/:id/dispositions','removeDispositions','delete'];(function(_0x5f4ce0,_0x45bb6d){var _0x653951=function(_0x429992){while(--_0x429992){_0x5f4ce0['push'](_0x5f4ce0['shift']());}};_0x653951(++_0x45bb6d);}(_0x008c,0x188));var _0xc008=function(_0x250bbc,_0x3297f3){_0x250bbc=_0x250bbc-0x0;var _0x489e34=_0x008c[_0x250bbc];return _0x489e34;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0xa')](_0xc008('0x12'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0xc008('0xa')]('/:id/users',auth[_0xc008('0xb')](),controller[_0xc008('0x13')]);router[_0xc008('0x14')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0x15')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc008('0x16')]);router[_0xc008('0x14')](_0xc008('0xe'),auth[_0xc008('0xb')](),controller['addContacts']);router['post']('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0x17')]);router[_0xc008('0x14')]('/:id/users',auth[_0xc008('0xb')](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xc008('0x19'),auth[_0xc008('0xb')](),controller[_0xc008('0x1a')]);router[_0xc008('0x1b')](_0xc008('0x1c'),auth[_0xc008('0xb')](),controller['removeAgents']);module[_0xc008('0x1d')]=router; \ No newline at end of file +var _0xbd50=['get','/describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','addDisposition','addContacts','addCustomField','addAgents','put','delete','removeDispositions','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index'];(function(_0x2f999a,_0x15fbe0){var _0x102dc9=function(_0x3f7b09){while(--_0x3f7b09){_0x2f999a['push'](_0x2f999a['shift']());}};_0x102dc9(++_0x15fbe0);}(_0xbd50,0x196));var _0x0bd5=function(_0x5e93be,_0xf4e717){_0x5e93be=_0x5e93be-0x0;var _0x44bf05=_0xbd50[_0x5e93be];return _0x44bf05;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var fs_extra=require(_0x0bd5('0x5'));var auth=require(_0x0bd5('0x6'));var interaction=require(_0x0bd5('0x7'));var config=require('../../config/environment');var controller=require('./cmList.controller');router['get']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x9')]);router[_0x0bd5('0xa')](_0x0bd5('0xb'),auth[_0x0bd5('0x8')](),controller['describe']);router['get'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xd')]);router['get'](_0x0bd5('0xe'),auth[_0x0bd5('0x8')](),controller['getDispositions']);router[_0x0bd5('0xa')](_0x0bd5('0xf'),auth['isAuthenticated'](),controller[_0x0bd5('0x10')]);router[_0x0bd5('0xa')](_0x0bd5('0x11'),auth['isAuthenticated'](),controller[_0x0bd5('0x12')]);router[_0x0bd5('0xa')](_0x0bd5('0x13'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x14')]);router[_0x0bd5('0xa')](_0x0bd5('0x15'),auth[_0x0bd5('0x8')](),controller['getAgents']);router[_0x0bd5('0x16')]('/',auth[_0x0bd5('0x8')](),controller['create']);router[_0x0bd5('0x16')](_0x0bd5('0xe'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x17')]);router['post'](_0x0bd5('0xf'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x18')]);router[_0x0bd5('0x16')](_0x0bd5('0x13'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x19')]);router[_0x0bd5('0x16')](_0x0bd5('0x15'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x1a')]);router[_0x0bd5('0x1b')](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x0bd5('0x1c')](_0x0bd5('0xe'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x1d')]);router[_0x0bd5('0x1c')]('/:id/users',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x1e')]);module[_0x0bd5('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 095540f..27dd04d 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(_0x178528,_0x21cb02){var _0x59d37a=function(_0x307118){while(--_0x307118){_0x178528['push'](_0x178528['shift']());}};_0x59d37a(++_0x21cb02);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'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 _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x65b130,_0x51590e){var _0x3d8fce=function(_0x2a19c4){while(--_0x2a19c4){_0x65b130['push'](_0x65b130['shift']());}};_0x3d8fce(++_0x51590e);}(_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')]={'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 diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 5c4f2d6..7bfa241 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 _0x4bc3=['json','apply','reject','destroy','then','sendStatus','stack','name','send','body','Condition','find','catch','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set'];(function(_0x547957,_0x26dbfd){var _0x33ab57=function(_0x2af683){while(--_0x2af683){_0x547957['push'](_0x547957['shift']());}};_0x33ab57(++_0x26dbfd);}(_0x4bc3,0x16e));var _0x34bc=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x4bc3[_0x5a9c0c];return _0x53c77d;};'use strict';var emlformat=require(_0x34bc('0x0'));var rimraf=require(_0x34bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x34bc('0x2'));var rp=require(_0x34bc('0x3'));var moment=require('moment');var BPromise=require(_0x34bc('0x4'));var Mustache=require(_0x34bc('0x5'));var util=require(_0x34bc('0x6'));var path=require(_0x34bc('0x7'));var sox=require(_0x34bc('0x8'));var csv=require(_0x34bc('0x9'));var ejs=require(_0x34bc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34bc('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x34bc('0xc'));var deskjs=require(_0x34bc('0xd'));var toCsv=require(_0x34bc('0x9'));var querystring=require(_0x34bc('0xe'));var Papa=require(_0x34bc('0xf'));var Redis=require(_0x34bc('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x34bc('0x11'));var hardwareService=require(_0x34bc('0x12'));var logger=require(_0x34bc('0x13'))('api');var utils=require(_0x34bc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x34bc('0x15'));var db=require(_0x34bc('0x16'))['db'];function respondWithStatusCode(_0x164fb2,_0x536ebd){_0x536ebd=_0x536ebd||0xcc;return function(_0x3f8852){if(_0x3f8852){return _0x164fb2['sendStatus'](_0x536ebd);}return _0x164fb2[_0x34bc('0x17')](_0x536ebd)[_0x34bc('0x18')]();};}function respondWithResult(_0xc77013,_0x5a22a3){_0x5a22a3=_0x5a22a3||0xc8;return function(_0x4c365a){if(_0x4c365a){return _0xc77013[_0x34bc('0x17')](_0x5a22a3)['json'](_0x4c365a);}};}function respondWithFilteredResult(_0x3e93bf,_0x217605){return function(_0x1da8eb){if(_0x1da8eb){var _0x25da29=typeof _0x217605[_0x34bc('0x19')]===_0x34bc('0x1a')&&typeof _0x217605['limit']==='undefined';var _0x5a5895=_0x1da8eb[_0x34bc('0x1b')];var _0x3eaedf=_0x25da29?0x0:_0x217605[_0x34bc('0x19')];var _0x239e6c=_0x25da29?_0x1da8eb['count']:_0x217605[_0x34bc('0x19')]+_0x217605[_0x34bc('0x1c')];var _0x50106a;if(_0x239e6c>=_0x5a5895){_0x239e6c=_0x5a5895;_0x50106a=0xc8;}else{_0x50106a=0xce;}_0x3e93bf[_0x34bc('0x17')](_0x50106a);return _0x3e93bf[_0x34bc('0x1d')]('Content-Range',_0x3eaedf+'-'+_0x239e6c+'/'+_0x5a5895)[_0x34bc('0x1e')](_0x1da8eb);}return null;};}function patchUpdates(_0x26cdec){return function(_0x2d18ea){try{jsonpatch[_0x34bc('0x1f')](_0x2d18ea,_0x26cdec,!![]);}catch(_0x1f993b){return BPromise[_0x34bc('0x20')](_0x1f993b);}return _0x2d18ea['save']();};}function saveUpdates(_0x40e128,_0x3c9939){return function(_0x38882c){if(_0x38882c){return _0x38882c['update'](_0x40e128)['then'](function(_0x358d51){return _0x358d51;});}return null;};}function removeEntity(_0x1b820a,_0x4263de){return function(_0x410800){if(_0x410800){return _0x410800[_0x34bc('0x21')]()[_0x34bc('0x22')](function(){_0x1b820a[_0x34bc('0x17')](0xcc)[_0x34bc('0x18')]();});}};}function handleEntityNotFound(_0x19472e,_0x25d6fe){return function(_0x2de017){if(!_0x2de017){_0x19472e[_0x34bc('0x23')](0x194);}return _0x2de017;};}function handleError(_0x4fd589,_0x43e527){_0x43e527=_0x43e527||0x1f4;return function(_0x48ec13){logger['error'](_0x48ec13[_0x34bc('0x24')]);if(_0x48ec13['name']){delete _0x48ec13[_0x34bc('0x25')];}_0x4fd589[_0x34bc('0x17')](_0x43e527)[_0x34bc('0x26')](_0x48ec13);};}exports['update']=function(_0x2e6d96,_0x351ed8){if(_0x2e6d96[_0x34bc('0x27')]['id']){delete _0x2e6d96[_0x34bc('0x27')]['id'];}return db[_0x34bc('0x28')][_0x34bc('0x29')]({'where':{'id':_0x2e6d96['params']['id']}})[_0x34bc('0x22')](handleEntityNotFound(_0x351ed8,null))[_0x34bc('0x22')](saveUpdates(_0x2e6d96[_0x34bc('0x27')],null))[_0x34bc('0x22')](respondWithResult(_0x351ed8,null))[_0x34bc('0x2a')](handleError(_0x351ed8,null));};exports[_0x34bc('0x21')]=function(_0x5b37de,_0x155e44){return db['Condition']['find']({'where':{'id':_0x5b37de[_0x34bc('0x2b')]['id']}})['then'](handleEntityNotFound(_0x155e44,null))[_0x34bc('0x22')](removeEntity(_0x155e44,null))[_0x34bc('0x2a')](handleError(_0x155e44,null));}; \ No newline at end of file +var _0x0c02=['params','catch','Condition','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','body','find'];(function(_0x5f30c3,_0x400752){var _0x26e964=function(_0x188d9c){while(--_0x188d9c){_0x5f30c3['push'](_0x5f30c3['shift']());}};_0x26e964(++_0x400752);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20c0('0x0'));var zipdir=require(_0x20c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x20c0('0x2'));var moment=require(_0x20c0('0x3'));var BPromise=require(_0x20c0('0x4'));var Mustache=require(_0x20c0('0x5'));var util=require(_0x20c0('0x6'));var path=require(_0x20c0('0x7'));var sox=require(_0x20c0('0x8'));var csv=require(_0x20c0('0x9'));var ejs=require(_0x20c0('0xa'));var fs=require('fs');var fs_extra=require(_0x20c0('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x20c0('0xc'));var toCsv=require(_0x20c0('0x9'));var querystring=require(_0x20c0('0xd'));var Papa=require(_0x20c0('0xe'));var Redis=require(_0x20c0('0xf'));var authService=require(_0x20c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x20c0('0x11'));var config=require(_0x20c0('0x12'));var licenseUtil=require(_0x20c0('0x13'));var db=require(_0x20c0('0x14'))['db'];function respondWithStatusCode(_0x4ed79e,_0x56fa09){_0x56fa09=_0x56fa09||0xcc;return function(_0x55854e){if(_0x55854e){return _0x4ed79e['sendStatus'](_0x56fa09);}return _0x4ed79e[_0x20c0('0x15')](_0x56fa09)[_0x20c0('0x16')]();};}function respondWithResult(_0x42161f,_0x3b2bba){_0x3b2bba=_0x3b2bba||0xc8;return function(_0x37f4e0){if(_0x37f4e0){return _0x42161f[_0x20c0('0x15')](_0x3b2bba)[_0x20c0('0x17')](_0x37f4e0);}};}function respondWithFilteredResult(_0x105839,_0x280aff){return function(_0x5a5e25){if(_0x5a5e25){var _0xd80b64=typeof _0x280aff[_0x20c0('0x18')]===_0x20c0('0x19')&&typeof _0x280aff[_0x20c0('0x1a')]===_0x20c0('0x19');var _0xeff5b9=_0x5a5e25['count'];var _0x55de3b=_0xd80b64?0x0:_0x280aff['offset'];var _0x10a921=_0xd80b64?_0x5a5e25[_0x20c0('0x1b')]:_0x280aff[_0x20c0('0x18')]+_0x280aff[_0x20c0('0x1a')];var _0x5b3725;if(_0x10a921>=_0xeff5b9){_0x10a921=_0xeff5b9;_0x5b3725=0xc8;}else{_0x5b3725=0xce;}_0x105839[_0x20c0('0x15')](_0x5b3725);return _0x105839[_0x20c0('0x1c')](_0x20c0('0x1d'),_0x55de3b+'-'+_0x10a921+'/'+_0xeff5b9)['json'](_0x5a5e25);}return null;};}function patchUpdates(_0x54bd1e){return function(_0x343db7){try{jsonpatch[_0x20c0('0x1e')](_0x343db7,_0x54bd1e,!![]);}catch(_0x1407d3){return BPromise[_0x20c0('0x1f')](_0x1407d3);}return _0x343db7[_0x20c0('0x20')]();};}function saveUpdates(_0x53d8e8,_0x2213f5){return function(_0x28959a){if(_0x28959a){return _0x28959a[_0x20c0('0x21')](_0x53d8e8)[_0x20c0('0x22')](function(_0x52b8b8){return _0x52b8b8;});}return null;};}function removeEntity(_0xfea1eb,_0x3e545c){return function(_0x2447e6){if(_0x2447e6){return _0x2447e6[_0x20c0('0x23')]()[_0x20c0('0x22')](function(){_0xfea1eb[_0x20c0('0x15')](0xcc)[_0x20c0('0x16')]();});}};}function handleEntityNotFound(_0x55b129,_0x45c08c){return function(_0x595d94){if(!_0x595d94){_0x55b129[_0x20c0('0x24')](0x194);}return _0x595d94;};}function handleError(_0x31565b,_0x11da5a){_0x11da5a=_0x11da5a||0x1f4;return function(_0x14dac3){logger['error'](_0x14dac3['stack']);if(_0x14dac3[_0x20c0('0x25')]){delete _0x14dac3[_0x20c0('0x25')];}_0x31565b[_0x20c0('0x15')](_0x11da5a)['send'](_0x14dac3);};}exports[_0x20c0('0x21')]=function(_0x25592b,_0x1bcfaf){if(_0x25592b[_0x20c0('0x26')]['id']){delete _0x25592b['body']['id'];}return db['Condition'][_0x20c0('0x27')]({'where':{'id':_0x25592b[_0x20c0('0x28')]['id']}})[_0x20c0('0x22')](handleEntityNotFound(_0x1bcfaf,null))[_0x20c0('0x22')](saveUpdates(_0x25592b[_0x20c0('0x26')],null))[_0x20c0('0x22')](respondWithResult(_0x1bcfaf,null))[_0x20c0('0x29')](handleError(_0x1bcfaf,null));};exports[_0x20c0('0x23')]=function(_0x3ac0a4,_0x191ad8){return db[_0x20c0('0x2a')][_0x20c0('0x27')]({'where':{'id':_0x3ac0a4[_0x20c0('0x28')]['id']}})[_0x20c0('0x22')](handleEntityNotFound(_0x191ad8,null))['then'](removeEntity(_0x191ad8,null))[_0x20c0('0x29')](handleError(_0x191ad8,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index b0de172..1c3ebeb 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 _0xc760=['util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define','Condition','lodash'];(function(_0x26297c,_0xb0a30){var _0x5383be=function(_0x514d9e){while(--_0x514d9e){_0x26297c['push'](_0x26297c['shift']());}};_0x5383be(++_0xb0a30);}(_0xc760,0x180));var _0x0c76=function(_0x32d372,_0x2c8772){_0x32d372=_0x32d372-0x0;var _0x491f10=_0xc760[_0x32d372];return _0x491f10;};'use strict';var _=require(_0x0c76('0x0'));var util=require(_0x0c76('0x1'));var logger=require(_0x0c76('0x2'))(_0x0c76('0x3'));var moment=require(_0x0c76('0x4'));var BPromise=require(_0x0c76('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c76('0x6'));var rimraf=require(_0x0c76('0x7'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0x0c76('0x8')]=function(_0x1879fc,_0x1740b9){return _0x1879fc[_0x0c76('0x9')](_0x0c76('0xa'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4e3=['path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x705b7e,_0x409ae1){var _0x479da5=function(_0x136e8b){while(--_0x136e8b){_0x705b7e['push'](_0x705b7e['shift']());}};_0x479da5(++_0x409ae1);}(_0xf4e3,0x1ca));var _0x3f4e=function(_0x485201,_0x3c533a){_0x485201=_0x485201-0x0;var _0x9ca98a=_0xf4e3[_0x485201];return _0x9ca98a;};'use strict';var _=require(_0x3f4e('0x0'));var util=require(_0x3f4e('0x1'));var logger=require(_0x3f4e('0x2'))(_0x3f4e('0x3'));var moment=require(_0x3f4e('0x4'));var BPromise=require(_0x3f4e('0x5'));var rp=require(_0x3f4e('0x6'));var fs=require('fs');var path=require(_0x3f4e('0x7'));var rimraf=require(_0x3f4e('0x8'));var config=require(_0x3f4e('0x9'));var attributes=require(_0x3f4e('0xa'));module[_0x3f4e('0xb')]=function(_0x32cb61,_0x2df5d9){return _0x32cb61[_0x3f4e('0xc')](_0x3f4e('0xd'),attributes,{'tableName':_0x3f4e('0xe'),'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 5db01f7..a6c9b48 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 _0x51d1=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','Condition,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0x42152d,_0x73ce83){var _0x44f7c6=function(_0x2d31cc){while(--_0x2d31cc){_0x42152d['push'](_0x42152d['shift']());}};_0x44f7c6(++_0x73ce83);}(_0x51d1,0x7f));var _0x151d=function(_0x461886,_0x4fc171){_0x461886=_0x461886-0x0;var _0x295e0a=_0x51d1[_0x461886];return _0x295e0a;};'use strict';var _=require(_0x151d('0x0'));var util=require('util');var moment=require(_0x151d('0x1'));var BPromise=require(_0x151d('0x2'));var rs=require(_0x151d('0x3'));var fs=require('fs');var Redis=require(_0x151d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x151d('0x5'))(_0x151d('0x6'));var config=require(_0x151d('0x7'));var jayson=require(_0x151d('0x8'));var client=jayson[_0x151d('0x9')][_0x151d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2459c3,_0x16603f,_0xcd4db6){return new BPromise(function(_0x48a2c2,_0x5510b4){return client[_0x151d('0xb')](_0x2459c3,_0xcd4db6)['then'](function(_0x1f3d25){logger['info']('Condition,\x20%s,\x20%s',_0x16603f,'request\x20sent');logger[_0x151d('0xc')](_0x151d('0xd'),_0x16603f,'request\x20sent',JSON[_0x151d('0xe')](_0x1f3d25));if(_0x1f3d25[_0x151d('0xf')]){if(_0x1f3d25[_0x151d('0xf')]['code']===0x1f4){logger[_0x151d('0xf')](_0x151d('0x10'),_0x16603f,_0x1f3d25[_0x151d('0xf')]['message']);return _0x5510b4(_0x1f3d25[_0x151d('0xf')][_0x151d('0x11')]);}logger['error'](_0x151d('0x10'),_0x16603f,_0x1f3d25[_0x151d('0xf')]['message']);return _0x48a2c2(_0x1f3d25['error']['message']);}else{logger['info'](_0x151d('0x10'),_0x16603f,_0x151d('0x12'));_0x48a2c2(_0x1f3d25[_0x151d('0x13')][_0x151d('0x11')]);}})[_0x151d('0x14')](function(_0x5641a0){logger[_0x151d('0xf')](_0x151d('0x10'),_0x16603f,_0x5641a0);_0x5510b4(_0x5641a0);});});} \ No newline at end of file +var _0x4bb7=['request','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x4bb7,0x114));var _0x74bb=function(_0x54581c,_0x278379){_0x54581c=_0x54581c-0x0;var _0x115c83=_0x4bb7[_0x54581c];return _0x115c83;};'use strict';var _=require(_0x74bb('0x0'));var util=require(_0x74bb('0x1'));var moment=require(_0x74bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x74bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x74bb('0x4'));var logger=require(_0x74bb('0x5'))(_0x74bb('0x6'));var config=require('../../config/environment');var jayson=require(_0x74bb('0x7'));var client=jayson[_0x74bb('0x8')][_0x74bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f77a2,_0x327444,_0x331b8a){return new BPromise(function(_0x35bc67,_0x3f7a78){return client[_0x74bb('0xa')](_0x2f77a2,_0x331b8a)[_0x74bb('0xb')](function(_0x3e383b){logger[_0x74bb('0xc')]('Condition,\x20%s,\x20%s',_0x327444,_0x74bb('0xd'));logger[_0x74bb('0xe')](_0x74bb('0xf'),_0x327444,_0x74bb('0xd'),JSON[_0x74bb('0x10')](_0x3e383b));if(_0x3e383b[_0x74bb('0x11')]){if(_0x3e383b[_0x74bb('0x11')][_0x74bb('0x12')]===0x1f4){logger[_0x74bb('0x11')](_0x74bb('0x13'),_0x327444,_0x3e383b[_0x74bb('0x11')][_0x74bb('0x14')]);return _0x3f7a78(_0x3e383b[_0x74bb('0x11')][_0x74bb('0x14')]);}logger[_0x74bb('0x11')]('Condition,\x20%s,\x20%s',_0x327444,_0x3e383b[_0x74bb('0x11')]['message']);return _0x35bc67(_0x3e383b['error'][_0x74bb('0x14')]);}else{logger[_0x74bb('0xc')](_0x74bb('0x13'),_0x327444,_0x74bb('0xd'));_0x35bc67(_0x3e383b[_0x74bb('0x15')][_0x74bb('0x14')]);}})['catch'](function(_0x5a97d1){logger[_0x74bb('0x11')](_0x74bb('0x13'),_0x327444,_0x5a97d1);_0x3f7a78(_0x5a97d1);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 9da0d70..cf580a5 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','multer','util','path'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0xc')]);router[_0x7995('0xd')]('/:id',auth[_0x7995('0xb')](),controller[_0x7995('0xe')]);module['exports']=router; \ No newline at end of file +var _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','delete','/:id','destroy','multer','util','path','express'];(function(_0x53458f,_0x25da3e){var _0x5c852f=function(_0x5da602){while(--_0x5da602){_0x53458f['push'](_0x53458f['shift']());}};_0x5c852f(++_0x25da3e);}(_0x7a54,0x106));var _0x47a5=function(_0xb5ac99,_0x37b032){_0xb5ac99=_0xb5ac99-0x0;var _0x503536=_0x7a54[_0xb5ac99];return _0x503536;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/:id',auth[_0x47a5('0xa')](),controller['update']);router[_0x47a5('0xb')](_0x47a5('0xc'),auth['isAuthenticated'](),controller[_0x47a5('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index b397a86..f3b3391 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc999=['STRING','name','exports'];(function(_0x456860,_0xae925c){var _0x23667c=function(_0x4b73e6){while(--_0x4b73e6){_0x456860['push'](_0x456860['shift']());}};_0x23667c(++_0xae925c);}(_0xc999,0x176));var _0x9c99=function(_0x5275b8,_0x51e5dd){_0x5275b8=_0x5275b8-0x0;var _0x568a9b=_0xc999[_0x5275b8];return _0x568a9b;};'use strict';var Sequelize=require('sequelize');module[_0x9c99('0x0')]={'name':{'type':Sequelize[_0x9c99('0x1')],'allowNull':![],'unique':_0x9c99('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x94b1=['INTEGER','STRING','exports','name'];(function(_0x5019f5,_0x442d61){var _0x2dbe2d=function(_0x908d18){while(--_0x908d18){_0x5019f5['push'](_0x5019f5['shift']());}};_0x2dbe2d(++_0x442d61);}(_0x94b1,0x102));var _0x194b=function(_0x319c97,_0x28914c){_0x319c97=_0x319c97-0x0;var _0xc91fa8=_0x94b1[_0x319c97];return _0xc91fa8;};'use strict';var Sequelize=require('sequelize');module[_0x194b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x194b('0x1')},'OrderBy':{'type':Sequelize[_0x194b('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x194b('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 53fb98b..32fbffd 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d26=['squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','ContactItemTypes','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','rimraf','fast-json-patch','mustache','util','path','sox','ejs','fs-extra','lodash'];(function(_0x3a9d77,_0xdc466){var _0x130f80=function(_0x740c4a){while(--_0x740c4a){_0x3a9d77['push'](_0x3a9d77['shift']());}};_0x130f80(++_0xdc466);}(_0x4d26,0x13f));var _0x64d2=function(_0x1829b6,_0x577318){_0x1829b6=_0x1829b6-0x0;var _0x246f6d=_0x4d26[_0x1829b6];return _0x246f6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x64d2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x64d2('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x64d2('0x2'));var util=require(_0x64d2('0x3'));var path=require(_0x64d2('0x4'));var sox=require(_0x64d2('0x5'));var csv=require('to-csv');var ejs=require(_0x64d2('0x6'));var fs=require('fs');var fs_extra=require(_0x64d2('0x7'));var _=require(_0x64d2('0x8'));var squel=require(_0x64d2('0x9'));var crypto=require(_0x64d2('0xa'));var jsforce=require(_0x64d2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x64d2('0xc'));var querystring=require(_0x64d2('0xd'));var Papa=require(_0x64d2('0xe'));var Redis=require(_0x64d2('0xf'));var authService=require(_0x64d2('0x10'));var qs=require(_0x64d2('0x11'));var as=require(_0x64d2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x64d2('0x13'))(_0x64d2('0x14'));var utils=require(_0x64d2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x64d2('0x16'));var db=require(_0x64d2('0x17'))['db'];function respondWithStatusCode(_0x28a2b3,_0x535dfb){_0x535dfb=_0x535dfb||0xcc;return function(_0x496db9){if(_0x496db9){return _0x28a2b3['sendStatus'](_0x535dfb);}return _0x28a2b3[_0x64d2('0x18')](_0x535dfb)['end']();};}function respondWithResult(_0x43bd74,_0x39821f){_0x39821f=_0x39821f||0xc8;return function(_0x116776){if(_0x116776){return _0x43bd74[_0x64d2('0x18')](_0x39821f)[_0x64d2('0x19')](_0x116776);}};}function respondWithFilteredResult(_0x1fc219,_0x56f057){return function(_0x4fddf5){if(_0x4fddf5){var _0x360e1d=typeof _0x56f057[_0x64d2('0x1a')]===_0x64d2('0x1b')&&typeof _0x56f057[_0x64d2('0x1c')]===_0x64d2('0x1b');var _0x10188c=_0x4fddf5['count'];var _0x528afb=_0x360e1d?0x0:_0x56f057[_0x64d2('0x1a')];var _0x1795af=_0x360e1d?_0x4fddf5[_0x64d2('0x1d')]:_0x56f057[_0x64d2('0x1a')]+_0x56f057[_0x64d2('0x1c')];var _0x51eee6;if(_0x1795af>=_0x10188c){_0x1795af=_0x10188c;_0x51eee6=0xc8;}else{_0x51eee6=0xce;}_0x1fc219['status'](_0x51eee6);return _0x1fc219[_0x64d2('0x1e')](_0x64d2('0x1f'),_0x528afb+'-'+_0x1795af+'/'+_0x10188c)[_0x64d2('0x19')](_0x4fddf5);}return null;};}function patchUpdates(_0x5a7833){return function(_0x1fb672){try{jsonpatch[_0x64d2('0x20')](_0x1fb672,_0x5a7833,!![]);}catch(_0x2d2e74){return BPromise['reject'](_0x2d2e74);}return _0x1fb672[_0x64d2('0x21')]();};}function saveUpdates(_0x262874,_0x58d5eb){return function(_0x24dbe0){if(_0x24dbe0){return _0x24dbe0[_0x64d2('0x22')](_0x262874)['then'](function(_0x4cbed7){return _0x4cbed7;});}return null;};}function removeEntity(_0x4dcd82,_0x5ddd06){return function(_0x5d3225){if(_0x5d3225){return _0x5d3225['destroy']()[_0x64d2('0x23')](function(){var _0x593f8a=_0x5d3225[_0x64d2('0x24')]({'plain':!![]});var _0xe4ceea=_0x64d2('0x25');return db[_0x64d2('0x26')]['destroy']({'where':{'type':_0xe4ceea,'resourceId':_0x593f8a['id']}})[_0x64d2('0x23')](function(){return _0x5d3225;});})['then'](function(){_0x4dcd82[_0x64d2('0x18')](0xcc)[_0x64d2('0x27')]();});}};}function handleEntityNotFound(_0x5583ea,_0x189e02){return function(_0x29cd17){if(!_0x29cd17){_0x5583ea[_0x64d2('0x28')](0x194);}return _0x29cd17;};}function handleError(_0x229a26,_0x2e4c37){_0x2e4c37=_0x2e4c37||0x1f4;return function(_0x5248e3){logger[_0x64d2('0x29')](_0x5248e3[_0x64d2('0x2a')]);if(_0x5248e3[_0x64d2('0x2b')]){delete _0x5248e3[_0x64d2('0x2b')];}_0x229a26[_0x64d2('0x18')](_0x2e4c37)[_0x64d2('0x2c')](_0x5248e3);};}exports[_0x64d2('0x2d')]=function(_0x4caf5e,_0x455b9f){var _0x32424c={},_0x3f7f91={},_0x21e996={'count':0x0,'rows':[]};var _0x20ca4c=_[_0x64d2('0x2e')](db[_0x64d2('0x2f')][_0x64d2('0x30')],function(_0x7a9d84){return{'name':_0x7a9d84[_0x64d2('0x31')],'type':_0x7a9d84[_0x64d2('0x32')][_0x64d2('0x33')]};});_0x3f7f91[_0x64d2('0x34')]=_[_0x64d2('0x2e')](_0x20ca4c,_0x64d2('0x2b'));_0x3f7f91[_0x64d2('0x35')]=_[_0x64d2('0x36')](_0x4caf5e['query']);_0x3f7f91[_0x64d2('0x37')]=_[_0x64d2('0x38')](_0x3f7f91['model'],_0x3f7f91['query']);_0x32424c[_0x64d2('0x39')]=_['intersection'](_0x3f7f91[_0x64d2('0x34')],qs[_0x64d2('0x3a')](_0x4caf5e[_0x64d2('0x35')][_0x64d2('0x3a')]));_0x32424c['attributes']=_0x32424c['attributes']['length']?_0x32424c[_0x64d2('0x39')]:_0x3f7f91[_0x64d2('0x34')];if(!_0x4caf5e[_0x64d2('0x35')][_0x64d2('0x3b')](_0x64d2('0x3c'))){_0x32424c[_0x64d2('0x1c')]=qs[_0x64d2('0x1c')](_0x4caf5e['query'][_0x64d2('0x1c')]);_0x32424c[_0x64d2('0x1a')]=qs['offset'](_0x4caf5e[_0x64d2('0x35')][_0x64d2('0x1a')]);}_0x32424c['order']=qs[_0x64d2('0x3d')](_0x4caf5e[_0x64d2('0x35')][_0x64d2('0x3d')]);_0x32424c[_0x64d2('0x3e')]=qs[_0x64d2('0x37')](_['pick'](_0x4caf5e[_0x64d2('0x35')],_0x3f7f91[_0x64d2('0x37')]),_0x20ca4c);if(_0x4caf5e[_0x64d2('0x35')][_0x64d2('0x3f')]){_0x32424c[_0x64d2('0x3e')]=_[_0x64d2('0x40')](_0x32424c['where'],{'$or':_[_0x64d2('0x2e')](_0x20ca4c,function(_0x4492f4){if(_0x4492f4[_0x64d2('0x32')]!==_0x64d2('0x41')){var _0x3e23e3={};_0x3e23e3[_0x4492f4[_0x64d2('0x2b')]]={'$like':'%'+_0x4caf5e[_0x64d2('0x35')]['filter']+'%'};return _0x3e23e3;}})});}_0x32424c=_[_0x64d2('0x40')]({},_0x32424c,_0x4caf5e[_0x64d2('0x42')]);var _0x3ddcd4={'where':_0x32424c[_0x64d2('0x3e')]};return db[_0x64d2('0x2f')]['count'](_0x3ddcd4)[_0x64d2('0x23')](function(_0x515f05){_0x21e996[_0x64d2('0x1d')]=_0x515f05;if(_0x4caf5e[_0x64d2('0x35')]['includeAll']){_0x32424c['include']=[{'all':!![]}];}return db[_0x64d2('0x2f')][_0x64d2('0x43')](_0x32424c);})[_0x64d2('0x23')](function(_0x15d1cf){_0x21e996[_0x64d2('0x44')]=_0x15d1cf;return _0x21e996;})[_0x64d2('0x23')](respondWithFilteredResult(_0x455b9f,_0x32424c))[_0x64d2('0x45')](handleError(_0x455b9f,null));};exports[_0x64d2('0x46')]=function(_0x5f23e4,_0x262dfd){var _0x4f2fc6={'raw':!![],'where':{'id':_0x5f23e4[_0x64d2('0x47')]['id']}},_0x37f524={};_0x37f524['model']=_['keys'](db[_0x64d2('0x2f')][_0x64d2('0x30')]);_0x37f524[_0x64d2('0x35')]=_[_0x64d2('0x36')](_0x5f23e4[_0x64d2('0x35')]);_0x37f524[_0x64d2('0x37')]=_['intersection'](_0x37f524[_0x64d2('0x34')],_0x37f524[_0x64d2('0x35')]);_0x4f2fc6[_0x64d2('0x39')]=_[_0x64d2('0x38')](_0x37f524['model'],qs[_0x64d2('0x3a')](_0x5f23e4[_0x64d2('0x35')][_0x64d2('0x3a')]));_0x4f2fc6[_0x64d2('0x39')]=_0x4f2fc6[_0x64d2('0x39')]['length']?_0x4f2fc6[_0x64d2('0x39')]:_0x37f524[_0x64d2('0x34')];if(_0x5f23e4['query'][_0x64d2('0x48')]){_0x4f2fc6[_0x64d2('0x49')]=[{'all':!![]}];}_0x4f2fc6=_['merge']({},_0x4f2fc6,_0x5f23e4[_0x64d2('0x42')]);return db[_0x64d2('0x2f')][_0x64d2('0x4a')](_0x4f2fc6)['then'](handleEntityNotFound(_0x262dfd,null))['then'](respondWithResult(_0x262dfd,null))[_0x64d2('0x45')](handleError(_0x262dfd,null));};exports['create']=function(_0x3ac84f,_0x392d6d){return db['ContactItemType'][_0x64d2('0x4b')](_0x3ac84f[_0x64d2('0x4c')],{})[_0x64d2('0x23')](function(_0x28983e){var _0x11a2fb=_0x3ac84f[_0x64d2('0x4d')][_0x64d2('0x24')]({'plain':!![]});if(!_0x11a2fb)throw new Error(_0x64d2('0x4e'));if(_0x11a2fb['role']==='user'){var _0xc8352d=_0x28983e['get']({'plain':!![]});var _0x4ece7f='ContactItemTypes';return db[_0x64d2('0x4f')][_0x64d2('0x4a')]({'where':{'name':_0x4ece7f,'userProfileId':_0x11a2fb['userProfileId']},'raw':!![]})['then'](function(_0x38459a){if(_0x38459a&&_0x38459a['autoAssociation']===0x0){return db['UserProfileResource'][_0x64d2('0x4b')]({'name':_0xc8352d['name'],'resourceId':_0xc8352d['id'],'type':_0x38459a[_0x64d2('0x2b')],'sectionId':_0x38459a['id']},{})['then'](function(){return _0x28983e;});}else{return _0x28983e;}})[_0x64d2('0x45')](function(_0x4152f7){logger[_0x64d2('0x29')](_0x64d2('0x50'),_0x4152f7);throw _0x4152f7;});}return _0x28983e;})[_0x64d2('0x23')](respondWithResult(_0x392d6d,0xc9))[_0x64d2('0x45')](handleError(_0x392d6d,null));};exports[_0x64d2('0x22')]=function(_0x9a8e9,_0x43cfa2){if(_0x9a8e9[_0x64d2('0x4c')]['id']){delete _0x9a8e9[_0x64d2('0x4c')]['id'];}return db[_0x64d2('0x2f')]['find']({'where':{'id':_0x9a8e9[_0x64d2('0x47')]['id']}})['then'](handleEntityNotFound(_0x43cfa2,null))[_0x64d2('0x23')](saveUpdates(_0x9a8e9['body'],null))[_0x64d2('0x23')](respondWithResult(_0x43cfa2,null))['catch'](handleError(_0x43cfa2,null));};exports[_0x64d2('0x51')]=function(_0xab1d90,_0x146e33){return db['ContactItemType'][_0x64d2('0x4a')]({'where':{'id':_0xab1d90['params']['id']}})[_0x64d2('0x23')](handleEntityNotFound(_0x146e33,null))[_0x64d2('0x23')](removeEntity(_0x146e33,null))['catch'](handleError(_0x146e33,null));}; \ No newline at end of file +var _0x7a7f=['save','update','then','destroy','ContactItemTypes','UserProfileResource','sendStatus','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','catch','show','include','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','limit','undefined','count','status','Content-Range','apply'];(function(_0x4327e4,_0x1e662c){var _0x482b14=function(_0x515bea){while(--_0x515bea){_0x4327e4['push'](_0x4327e4['shift']());}};_0x482b14(++_0x1e662c);}(_0x7a7f,0x139));var _0xf7a7=function(_0x158c04,_0x2443c2){_0x158c04=_0x158c04-0x0;var _0x470fbe=_0x7a7f[_0x158c04];return _0x470fbe;};'use strict';var emlformat=require(_0xf7a7('0x0'));var rimraf=require(_0xf7a7('0x1'));var zipdir=require(_0xf7a7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf7a7('0x3'));var moment=require('moment');var BPromise=require(_0xf7a7('0x4'));var Mustache=require(_0xf7a7('0x5'));var util=require(_0xf7a7('0x6'));var path=require(_0xf7a7('0x7'));var sox=require(_0xf7a7('0x8'));var csv=require(_0xf7a7('0x9'));var ejs=require(_0xf7a7('0xa'));var fs=require('fs');var fs_extra=require(_0xf7a7('0xb'));var _=require(_0xf7a7('0xc'));var squel=require(_0xf7a7('0xd'));var crypto=require(_0xf7a7('0xe'));var jsforce=require(_0xf7a7('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf7a7('0x10'));var Papa=require(_0xf7a7('0x11'));var Redis=require(_0xf7a7('0x12'));var authService=require(_0xf7a7('0x13'));var qs=require(_0xf7a7('0x14'));var as=require(_0xf7a7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf7a7('0x16'));var utils=require(_0xf7a7('0x17'));var config=require(_0xf7a7('0x18'));var licenseUtil=require(_0xf7a7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27c04d,_0x105b5c){_0x105b5c=_0x105b5c||0xcc;return function(_0x868723){if(_0x868723){return _0x27c04d['sendStatus'](_0x105b5c);}return _0x27c04d['status'](_0x105b5c)[_0xf7a7('0x1a')]();};}function respondWithResult(_0x5e43a7,_0x731ebd){_0x731ebd=_0x731ebd||0xc8;return function(_0x4e7a63){if(_0x4e7a63){return _0x5e43a7['status'](_0x731ebd)[_0xf7a7('0x1b')](_0x4e7a63);}};}function respondWithFilteredResult(_0xc1821d,_0x1c5067){return function(_0x56c42f){if(_0x56c42f){var _0x491ca5=typeof _0x1c5067[_0xf7a7('0x1c')]==='undefined'&&typeof _0x1c5067[_0xf7a7('0x1d')]===_0xf7a7('0x1e');var _0x430a68=_0x56c42f[_0xf7a7('0x1f')];var _0x385b70=_0x491ca5?0x0:_0x1c5067[_0xf7a7('0x1c')];var _0x203342=_0x491ca5?_0x56c42f[_0xf7a7('0x1f')]:_0x1c5067[_0xf7a7('0x1c')]+_0x1c5067[_0xf7a7('0x1d')];var _0x25f34d;if(_0x203342>=_0x430a68){_0x203342=_0x430a68;_0x25f34d=0xc8;}else{_0x25f34d=0xce;}_0xc1821d[_0xf7a7('0x20')](_0x25f34d);return _0xc1821d['set'](_0xf7a7('0x21'),_0x385b70+'-'+_0x203342+'/'+_0x430a68)[_0xf7a7('0x1b')](_0x56c42f);}return null;};}function patchUpdates(_0x180697){return function(_0x5e2f6c){try{jsonpatch[_0xf7a7('0x22')](_0x5e2f6c,_0x180697,!![]);}catch(_0xa0037){return BPromise['reject'](_0xa0037);}return _0x5e2f6c[_0xf7a7('0x23')]();};}function saveUpdates(_0x3bc60d,_0x1df40f){return function(_0x4b46d9){if(_0x4b46d9){return _0x4b46d9[_0xf7a7('0x24')](_0x3bc60d)[_0xf7a7('0x25')](function(_0x3f0da2){return _0x3f0da2;});}return null;};}function removeEntity(_0x52541d,_0x1bd94c){return function(_0x1deec4){if(_0x1deec4){return _0x1deec4[_0xf7a7('0x26')]()[_0xf7a7('0x25')](function(){var _0x311fd0=_0x1deec4['get']({'plain':!![]});var _0x54373c=_0xf7a7('0x27');return db[_0xf7a7('0x28')][_0xf7a7('0x26')]({'where':{'type':_0x54373c,'resourceId':_0x311fd0['id']}})[_0xf7a7('0x25')](function(){return _0x1deec4;});})[_0xf7a7('0x25')](function(){_0x52541d[_0xf7a7('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x250b0f,_0x4a1a50){return function(_0x6d4f91){if(!_0x6d4f91){_0x250b0f[_0xf7a7('0x29')](0x194);}return _0x6d4f91;};}function handleError(_0x416cda,_0x28fc3e){_0x28fc3e=_0x28fc3e||0x1f4;return function(_0x3d27a0){logger['error'](_0x3d27a0[_0xf7a7('0x2a')]);if(_0x3d27a0['name']){delete _0x3d27a0[_0xf7a7('0x2b')];}_0x416cda[_0xf7a7('0x20')](_0x28fc3e)[_0xf7a7('0x2c')](_0x3d27a0);};}exports[_0xf7a7('0x2d')]=function(_0x40b365,_0x1a298b){var _0x1c0128={},_0x922dea={},_0x385b5b={'count':0x0,'rows':[]};var _0x11a7d7=_[_0xf7a7('0x2e')](db[_0xf7a7('0x2f')][_0xf7a7('0x30')],function(_0x50c376){return{'name':_0x50c376[_0xf7a7('0x31')],'type':_0x50c376[_0xf7a7('0x32')][_0xf7a7('0x33')]};});_0x922dea[_0xf7a7('0x34')]=_['map'](_0x11a7d7,_0xf7a7('0x2b'));_0x922dea[_0xf7a7('0x35')]=_[_0xf7a7('0x36')](_0x40b365['query']);_0x922dea[_0xf7a7('0x37')]=_[_0xf7a7('0x38')](_0x922dea['model'],_0x922dea[_0xf7a7('0x35')]);_0x1c0128[_0xf7a7('0x39')]=_[_0xf7a7('0x38')](_0x922dea[_0xf7a7('0x34')],qs[_0xf7a7('0x3a')](_0x40b365[_0xf7a7('0x35')][_0xf7a7('0x3a')]));_0x1c0128[_0xf7a7('0x39')]=_0x1c0128['attributes'][_0xf7a7('0x3b')]?_0x1c0128[_0xf7a7('0x39')]:_0x922dea[_0xf7a7('0x34')];if(!_0x40b365[_0xf7a7('0x35')][_0xf7a7('0x3c')](_0xf7a7('0x3d'))){_0x1c0128['limit']=qs[_0xf7a7('0x1d')](_0x40b365[_0xf7a7('0x35')]['limit']);_0x1c0128[_0xf7a7('0x1c')]=qs[_0xf7a7('0x1c')](_0x40b365[_0xf7a7('0x35')][_0xf7a7('0x1c')]);}_0x1c0128[_0xf7a7('0x3e')]=qs[_0xf7a7('0x3f')](_0x40b365[_0xf7a7('0x35')][_0xf7a7('0x3f')]);_0x1c0128[_0xf7a7('0x40')]=qs[_0xf7a7('0x37')](_[_0xf7a7('0x41')](_0x40b365[_0xf7a7('0x35')],_0x922dea['filters']),_0x11a7d7);if(_0x40b365[_0xf7a7('0x35')]['filter']){_0x1c0128[_0xf7a7('0x40')]=_['merge'](_0x1c0128['where'],{'$or':_['map'](_0x11a7d7,function(_0x12364e){if(_0x12364e[_0xf7a7('0x32')]!==_0xf7a7('0x42')){var _0x6c7205={};_0x6c7205[_0x12364e['name']]={'$like':'%'+_0x40b365[_0xf7a7('0x35')][_0xf7a7('0x43')]+'%'};return _0x6c7205;}})});}_0x1c0128=_['merge']({},_0x1c0128,_0x40b365[_0xf7a7('0x44')]);var _0x24c24c={'where':_0x1c0128[_0xf7a7('0x40')]};return db[_0xf7a7('0x2f')][_0xf7a7('0x1f')](_0x24c24c)[_0xf7a7('0x25')](function(_0x978d0a){_0x385b5b['count']=_0x978d0a;if(_0x40b365[_0xf7a7('0x35')][_0xf7a7('0x45')]){_0x1c0128['include']=[{'all':!![]}];}return db['ContactItemType']['findAll'](_0x1c0128);})[_0xf7a7('0x25')](function(_0x2dcbbd){_0x385b5b['rows']=_0x2dcbbd;return _0x385b5b;})[_0xf7a7('0x25')](respondWithFilteredResult(_0x1a298b,_0x1c0128))[_0xf7a7('0x46')](handleError(_0x1a298b,null));};exports[_0xf7a7('0x47')]=function(_0x192612,_0x33134d){var _0x1c6b8b={'raw':!![],'where':{'id':_0x192612['params']['id']}},_0x11fe37={};_0x11fe37[_0xf7a7('0x34')]=_['keys'](db[_0xf7a7('0x2f')][_0xf7a7('0x30')]);_0x11fe37[_0xf7a7('0x35')]=_['keys'](_0x192612[_0xf7a7('0x35')]);_0x11fe37[_0xf7a7('0x37')]=_[_0xf7a7('0x38')](_0x11fe37[_0xf7a7('0x34')],_0x11fe37[_0xf7a7('0x35')]);_0x1c6b8b[_0xf7a7('0x39')]=_[_0xf7a7('0x38')](_0x11fe37[_0xf7a7('0x34')],qs[_0xf7a7('0x3a')](_0x192612[_0xf7a7('0x35')][_0xf7a7('0x3a')]));_0x1c6b8b['attributes']=_0x1c6b8b['attributes']['length']?_0x1c6b8b[_0xf7a7('0x39')]:_0x11fe37[_0xf7a7('0x34')];if(_0x192612[_0xf7a7('0x35')]['includeAll']){_0x1c6b8b[_0xf7a7('0x48')]=[{'all':!![]}];}_0x1c6b8b=_[_0xf7a7('0x49')]({},_0x1c6b8b,_0x192612['options']);return db[_0xf7a7('0x2f')][_0xf7a7('0x4a')](_0x1c6b8b)['then'](handleEntityNotFound(_0x33134d,null))['then'](respondWithResult(_0x33134d,null))[_0xf7a7('0x46')](handleError(_0x33134d,null));};exports[_0xf7a7('0x4b')]=function(_0x49a959,_0x31a50a){return db[_0xf7a7('0x2f')]['create'](_0x49a959[_0xf7a7('0x4c')],{})[_0xf7a7('0x25')](function(_0x4ed60a){var _0x225bc1=_0x49a959[_0xf7a7('0x4d')][_0xf7a7('0x4e')]({'plain':!![]});if(!_0x225bc1)throw new Error(_0xf7a7('0x4f'));if(_0x225bc1[_0xf7a7('0x50')]==='user'){var _0x363a3d=_0x4ed60a[_0xf7a7('0x4e')]({'plain':!![]});var _0x50f259=_0xf7a7('0x27');return db[_0xf7a7('0x51')][_0xf7a7('0x4a')]({'where':{'name':_0x50f259,'userProfileId':_0x225bc1[_0xf7a7('0x52')]},'raw':!![]})[_0xf7a7('0x25')](function(_0x444acd){if(_0x444acd&&_0x444acd[_0xf7a7('0x53')]===0x0){return db[_0xf7a7('0x28')][_0xf7a7('0x4b')]({'name':_0x363a3d[_0xf7a7('0x2b')],'resourceId':_0x363a3d['id'],'type':_0x444acd['name'],'sectionId':_0x444acd['id']},{})[_0xf7a7('0x25')](function(){return _0x4ed60a;});}else{return _0x4ed60a;}})[_0xf7a7('0x46')](function(_0x2f9678){logger[_0xf7a7('0x54')](_0xf7a7('0x55'),_0x2f9678);throw _0x2f9678;});}return _0x4ed60a;})[_0xf7a7('0x25')](respondWithResult(_0x31a50a,0xc9))['catch'](handleError(_0x31a50a,null));};exports[_0xf7a7('0x24')]=function(_0x46a98e,_0x1b0ea7){if(_0x46a98e[_0xf7a7('0x4c')]['id']){delete _0x46a98e['body']['id'];}return db[_0xf7a7('0x2f')][_0xf7a7('0x4a')]({'where':{'id':_0x46a98e[_0xf7a7('0x56')]['id']}})[_0xf7a7('0x25')](handleEntityNotFound(_0x1b0ea7,null))[_0xf7a7('0x25')](saveUpdates(_0x46a98e[_0xf7a7('0x4c')],null))[_0xf7a7('0x25')](respondWithResult(_0x1b0ea7,null))[_0xf7a7('0x46')](handleError(_0x1b0ea7,null));};exports[_0xf7a7('0x26')]=function(_0x24597c,_0x10c0a4){return db[_0xf7a7('0x2f')][_0xf7a7('0x4a')]({'where':{'id':_0x24597c['params']['id']}})[_0xf7a7('0x25')](handleEntityNotFound(_0x10c0a4,null))['then'](removeEntity(_0x10c0a4,null))[_0xf7a7('0x46')](handleError(_0x10c0a4,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index ba56906..cc66b73 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa13d=['lodash','../../config/logger','api','bluebird','path','rimraf','exports','define','ContactItemType','tools_contact_item_types'];(function(_0x4dcecc,_0x3865b9){var _0x2aa658=function(_0x334d85){while(--_0x334d85){_0x4dcecc['push'](_0x4dcecc['shift']());}};_0x2aa658(++_0x3865b9);}(_0xa13d,0x154));var _0xda13=function(_0x3afbb2,_0x38b2fb){_0x3afbb2=_0x3afbb2-0x0;var _0x3c43f8=_0xa13d[_0x3afbb2];return _0x3c43f8;};'use strict';var _=require(_0xda13('0x0'));var util=require('util');var logger=require(_0xda13('0x1'))(_0xda13('0x2'));var moment=require('moment');var BPromise=require(_0xda13('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda13('0x4'));var rimraf=require(_0xda13('0x5'));var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module[_0xda13('0x6')]=function(_0x3d5a0e,_0x4df317){return _0x3d5a0e[_0xda13('0x7')](_0xda13('0x8'),attributes,{'tableName':_0xda13('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x029b=['define','tools_contact_item_types','lodash','util','api','moment','request-promise','path','./contactItemType.attributes','exports'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0x029b,0x66));var _0xb029=function(_0x5bf019,_0x3dd881){_0x5bf019=_0x5bf019-0x0;var _0x5a7e36=_0x029b[_0x5bf019];return _0x5a7e36;};'use strict';var _=require(_0xb029('0x0'));var util=require(_0xb029('0x1'));var logger=require('../../config/logger')(_0xb029('0x2'));var moment=require(_0xb029('0x3'));var BPromise=require('bluebird');var rp=require(_0xb029('0x4'));var fs=require('fs');var path=require(_0xb029('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb029('0x6'));module[_0xb029('0x7')]=function(_0x7836f0,_0x448fc5){return _0x7836f0[_0xb029('0x8')]('ContactItemType',attributes,{'tableName':_0xb029('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index c30d14f..40b6cec 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7fc=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0xb7fc[_0x51e79c];return _0x2467be;};'use strict';var _=require(_0xcb7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcb7f('0x1'));var rs=require(_0xcb7f('0x2'));var fs=require('fs');var Redis=require(_0xcb7f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcb7f('0x4'))(_0xcb7f('0x5'));var config=require(_0xcb7f('0x6'));var jayson=require(_0xcb7f('0x7'));var client=jayson[_0xcb7f('0x8')][_0xcb7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5059ca,_0x226ba8,_0x31de8e){return new BPromise(function(_0x1f8ba3,_0x4dde1f){return client[_0xcb7f('0xa')](_0x5059ca,_0x31de8e)[_0xcb7f('0xb')](function(_0x4d8d72){logger[_0xcb7f('0xc')](_0xcb7f('0xd'),_0x226ba8,'request\x20sent');logger[_0xcb7f('0xe')](_0xcb7f('0xf'),_0x226ba8,_0xcb7f('0x10'),JSON[_0xcb7f('0x11')](_0x4d8d72));if(_0x4d8d72[_0xcb7f('0x12')]){if(_0x4d8d72['error']['code']===0x1f4){logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);return _0x4dde1f(_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);}logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);return _0x1f8ba3(_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);}else{logger[_0xcb7f('0xc')](_0xcb7f('0xd'),_0x226ba8,_0xcb7f('0x10'));_0x1f8ba3(_0x4d8d72[_0xcb7f('0x14')][_0xcb7f('0x13')]);}})[_0xcb7f('0x15')](function(_0x2c2799){logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x2c2799);_0x4dde1f(_0x2c2799);});});} \ No newline at end of file +var _0x2e54=['rpc','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3b2369,_0x4c68b9){var _0x5a1367=function(_0x58ddcf){while(--_0x58ddcf){_0x3b2369['push'](_0x3b2369['shift']());}};_0x5a1367(++_0x4c68b9);}(_0x2e54,0x1dd));var _0x42e5=function(_0x202c1c,_0x387180){_0x202c1c=_0x202c1c-0x0;var _0x39c337=_0x2e54[_0x202c1c];return _0x39c337;};'use strict';var _=require(_0x42e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x42e5('0x1'));var rs=require(_0x42e5('0x2'));var fs=require('fs');var Redis=require(_0x42e5('0x3'));var db=require(_0x42e5('0x4'))['db'];var utils=require(_0x42e5('0x5'));var logger=require(_0x42e5('0x6'))(_0x42e5('0x7'));var config=require('../../config/environment');var jayson=require(_0x42e5('0x8'));var client=jayson[_0x42e5('0x9')][_0x42e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bed10,_0x2af5bb,_0x56be20){return new BPromise(function(_0x335b92,_0x490b99){return client[_0x42e5('0xb')](_0x4bed10,_0x56be20)[_0x42e5('0xc')](function(_0x10ee5a){logger[_0x42e5('0xd')](_0x42e5('0xe'),_0x2af5bb,_0x42e5('0xf'));logger[_0x42e5('0x10')](_0x42e5('0x11'),_0x2af5bb,_0x42e5('0xf'),JSON['stringify'](_0x10ee5a));if(_0x10ee5a[_0x42e5('0x12')]){if(_0x10ee5a[_0x42e5('0x12')]['code']===0x1f4){logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);return _0x490b99(_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);}logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);return _0x335b92(_0x10ee5a['error'][_0x42e5('0x13')]);}else{logger[_0x42e5('0xd')](_0x42e5('0xe'),_0x2af5bb,_0x42e5('0xf'));_0x335b92(_0x10ee5a[_0x42e5('0x14')][_0x42e5('0x13')]);}})[_0x42e5('0x15')](function(_0x3abe3d){logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x3abe3d);_0x490b99(_0x3abe3d);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 6724649..6e0574f 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8185=['./contactItemType.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8185,0xea));var _0x5818=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x8185[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x5818('0x0'));var util=require('util');var path=require(_0x5818('0x1'));var timeout=require('connect-timeout');var express=require(_0x5818('0x2'));var router=express[_0x5818('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5818('0x4'));var interaction=require(_0x5818('0x5'));var config=require('../../config/environment');var controller=require(_0x5818('0x6'));router[_0x5818('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5818('0x8'),auth[_0x5818('0x9')](),controller['show']);router[_0x5818('0xa')]('/',auth[_0x5818('0x9')](),controller[_0x5818('0xb')]);router[_0x5818('0xc')](_0x5818('0x8'),auth[_0x5818('0x9')](),controller[_0x5818('0xd')]);router[_0x5818('0xe')](_0x5818('0x8'),auth[_0x5818('0x9')](),controller[_0x5818('0xf')]);module['exports']=router; \ No newline at end of file +var _0x742b=['index','isAuthenticated','show','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get'];(function(_0x464bf4,_0xad3695){var _0x3bc2ca=function(_0x15f906){while(--_0x15f906){_0x464bf4['push'](_0x464bf4['shift']());}};_0x3bc2ca(++_0xad3695);}(_0x742b,0x13b));var _0xb742=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x742b[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xb742('0x0'));var util=require(_0xb742('0x1'));var path=require(_0xb742('0x2'));var timeout=require(_0xb742('0x3'));var express=require(_0xb742('0x4'));var router=express[_0xb742('0x5')]();var fs_extra=require(_0xb742('0x6'));var auth=require(_0xb742('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./contactItemType.controller');router[_0xb742('0x8')]('/',auth['isAuthenticated'](),controller[_0xb742('0x9')]);router[_0xb742('0x8')]('/:id',auth[_0xb742('0xa')](),controller[_0xb742('0xb')]);router[_0xb742('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb742('0xd')](_0xb742('0xe'),auth[_0xb742('0xa')](),controller[_0xb742('0xf')]);router['delete'](_0xb742('0xe'),auth[_0xb742('0xa')](),controller[_0xb742('0x10')]);module[_0xb742('0x11')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index cfc406e..40c8887 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 _0x1c3b=['sequelize','exports','STRING'];(function(_0x37c4af,_0x30622f){var _0x554849=function(_0x365001){while(--_0x365001){_0x37c4af['push'](_0x37c4af['shift']());}};_0x554849(++_0x30622f);}(_0x1c3b,0xab));var _0xb1c3=function(_0x30fe4f,_0x3249fd){_0x30fe4f=_0x30fe4f-0x0;var _0x5a8d62=_0x1c3b[_0x30fe4f];return _0x5a8d62;};'use strict';var Sequelize=require(_0xb1c3('0x0'));module[_0xb1c3('0x1')]={'name':{'type':Sequelize[_0xb1c3('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7edb=['STRING','name','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7edb,0x158));var _0xb7ed=function(_0xd0d9ab,_0x45da3a){_0xd0d9ab=_0xd0d9ab-0x0;var _0x20795b=_0x7edb[_0xd0d9ab];return _0x20795b;};'use strict';var Sequelize=require('sequelize');module[_0xb7ed('0x0')]={'name':{'type':Sequelize[_0xb7ed('0x1')],'allowNull':![],'unique':_0xb7ed('0x2')},'description':{'type':Sequelize[_0xb7ed('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 384c788..e760ae4 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 _0x3d6b=['attrVoiceQueues','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','findOne','pick','getItems','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','set','apply','update','then','destroy','get','UserProfileResource','error','name','send','index','Dashboard','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','autoAssociation','clone','omit','createdAt','body','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0x3d6b,0x173));var _0xb3d6=function(_0x38c699,_0x56fea7){_0x38c699=_0x38c699-0x0;var _0x3b1ded=_0x3d6b[_0x38c699];return _0x3b1ded;};'use strict';var emlformat=require(_0xb3d6('0x0'));var rimraf=require(_0xb3d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb3d6('0x2'));var rp=require(_0xb3d6('0x3'));var moment=require(_0xb3d6('0x4'));var BPromise=require(_0xb3d6('0x5'));var Mustache=require(_0xb3d6('0x6'));var util=require(_0xb3d6('0x7'));var path=require(_0xb3d6('0x8'));var sox=require(_0xb3d6('0x9'));var csv=require(_0xb3d6('0xa'));var ejs=require(_0xb3d6('0xb'));var fs=require('fs');var fs_extra=require(_0xb3d6('0xc'));var _=require(_0xb3d6('0xd'));var squel=require('squel');var crypto=require(_0xb3d6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb3d6('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb3d6('0x10'));var Redis=require(_0xb3d6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb3d6('0x12'));var as=require(_0xb3d6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb3d6('0x14'));var licenseUtil=require(_0xb3d6('0x15'));var db=require('../../mysqldb')['db'];config[_0xb3d6('0x16')]=_[_0xb3d6('0x17')](config[_0xb3d6('0x16')],{'host':_0xb3d6('0x18'),'port':0x18eb});var socket=require(_0xb3d6('0x19'))(new Redis(config['redis']));require('./dashboard.socket')[_0xb3d6('0x1a')](socket);function respondWithStatusCode(_0x1586b5,_0x7c4ac5){_0x7c4ac5=_0x7c4ac5||0xcc;return function(_0x3b77bd){if(_0x3b77bd){return _0x1586b5[_0xb3d6('0x1b')](_0x7c4ac5);}return _0x1586b5[_0xb3d6('0x1c')](_0x7c4ac5)['end']();};}function respondWithResult(_0x3d58d8,_0x2b760c){_0x2b760c=_0x2b760c||0xc8;return function(_0x221bda){if(_0x221bda){return _0x3d58d8[_0xb3d6('0x1c')](_0x2b760c)[_0xb3d6('0x1d')](_0x221bda);}};}function respondWithFilteredResult(_0x17f151,_0x290a57){return function(_0x4ad45e){if(_0x4ad45e){var _0xd635be=typeof _0x290a57['offset']===_0xb3d6('0x1e')&&typeof _0x290a57[_0xb3d6('0x1f')]==='undefined';var _0x5ca053=_0x4ad45e[_0xb3d6('0x20')];var _0x52aef8=_0xd635be?0x0:_0x290a57[_0xb3d6('0x21')];var _0x45a3e6=_0xd635be?_0x4ad45e['count']:_0x290a57['offset']+_0x290a57[_0xb3d6('0x1f')];var _0x2df1c5;if(_0x45a3e6>=_0x5ca053){_0x45a3e6=_0x5ca053;_0x2df1c5=0xc8;}else{_0x2df1c5=0xce;}_0x17f151[_0xb3d6('0x1c')](_0x2df1c5);return _0x17f151[_0xb3d6('0x22')]('Content-Range',_0x52aef8+'-'+_0x45a3e6+'/'+_0x5ca053)[_0xb3d6('0x1d')](_0x4ad45e);}return null;};}function patchUpdates(_0xa4ed35){return function(_0x1f8431){try{jsonpatch[_0xb3d6('0x23')](_0x1f8431,_0xa4ed35,!![]);}catch(_0x462ef3){return BPromise['reject'](_0x462ef3);}return _0x1f8431['save']();};}function saveUpdates(_0x33f260,_0x37ccd1){return function(_0x2e7b2d){if(_0x2e7b2d){return _0x2e7b2d[_0xb3d6('0x24')](_0x33f260)[_0xb3d6('0x25')](function(_0x226eae){return _0x226eae;});}return null;};}function removeEntity(_0x56dacf,_0x3b209d){return function(_0x4a8440){if(_0x4a8440){return _0x4a8440[_0xb3d6('0x26')]()['then'](function(){var _0x537aac=_0x4a8440[_0xb3d6('0x27')]({'plain':!![]});var _0x4ac2d6='CustomDashboards';return db[_0xb3d6('0x28')]['destroy']({'where':{'type':_0x4ac2d6,'resourceId':_0x537aac['id']}})[_0xb3d6('0x25')](function(){return _0x4a8440;});})[_0xb3d6('0x25')](function(){_0x56dacf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cbf08,_0x14e214){return function(_0x468cfe){if(!_0x468cfe){_0x2cbf08[_0xb3d6('0x1b')](0x194);}return _0x468cfe;};}function handleError(_0x50e69f,_0x2a9dbd){_0x2a9dbd=_0x2a9dbd||0x1f4;return function(_0x571f5d){logger[_0xb3d6('0x29')](_0x571f5d['stack']);if(_0x571f5d[_0xb3d6('0x2a')]){delete _0x571f5d['name'];}_0x50e69f[_0xb3d6('0x1c')](_0x2a9dbd)[_0xb3d6('0x2b')](_0x571f5d);};}exports[_0xb3d6('0x2c')]=function(_0x1dbff5,_0x1271a9){var _0x411207={},_0x483515={},_0x41dd02={'count':0x0,'rows':[]};var _0x10b64e=_['map'](db[_0xb3d6('0x2d')]['rawAttributes'],function(_0x5cd7d6){return{'name':_0x5cd7d6[_0xb3d6('0x2e')],'type':_0x5cd7d6[_0xb3d6('0x2f')]['key']};});_0x483515[_0xb3d6('0x30')]=_[_0xb3d6('0x31')](_0x10b64e,_0xb3d6('0x2a'));_0x483515[_0xb3d6('0x32')]=_[_0xb3d6('0x33')](_0x1dbff5[_0xb3d6('0x32')]);_0x483515[_0xb3d6('0x34')]=_[_0xb3d6('0x35')](_0x483515[_0xb3d6('0x30')],_0x483515['query']);_0x411207[_0xb3d6('0x36')]=_[_0xb3d6('0x35')](_0x483515[_0xb3d6('0x30')],qs[_0xb3d6('0x37')](_0x1dbff5[_0xb3d6('0x32')][_0xb3d6('0x37')]));_0x411207[_0xb3d6('0x36')]=_0x411207[_0xb3d6('0x36')][_0xb3d6('0x38')]?_0x411207['attributes']:_0x483515[_0xb3d6('0x30')];if(!_0x1dbff5['query'][_0xb3d6('0x39')](_0xb3d6('0x3a'))){_0x411207[_0xb3d6('0x1f')]=qs[_0xb3d6('0x1f')](_0x1dbff5[_0xb3d6('0x32')][_0xb3d6('0x1f')]);_0x411207['offset']=qs['offset'](_0x1dbff5[_0xb3d6('0x32')][_0xb3d6('0x21')]);}_0x411207[_0xb3d6('0x3b')]=qs[_0xb3d6('0x3c')](_0x1dbff5[_0xb3d6('0x32')]['sort']);_0x411207[_0xb3d6('0x3d')]=qs[_0xb3d6('0x34')](_['pick'](_0x1dbff5[_0xb3d6('0x32')],_0x483515['filters']),_0x10b64e);if(_0x1dbff5[_0xb3d6('0x32')][_0xb3d6('0x3e')]){_0x411207[_0xb3d6('0x3d')]=_[_0xb3d6('0x3f')](_0x411207[_0xb3d6('0x3d')],{'$or':_[_0xb3d6('0x31')](_0x10b64e,function(_0x3da0c2){if(_0x3da0c2[_0xb3d6('0x2f')]!=='VIRTUAL'){var _0x439d33={};_0x439d33[_0x3da0c2[_0xb3d6('0x2a')]]={'$like':'%'+_0x1dbff5[_0xb3d6('0x32')][_0xb3d6('0x3e')]+'%'};return _0x439d33;}})});}_0x411207=_['merge']({},_0x411207,_0x1dbff5[_0xb3d6('0x40')]);var _0x909c56={'where':_0x411207[_0xb3d6('0x3d')]};return db[_0xb3d6('0x2d')][_0xb3d6('0x20')](_0x909c56)[_0xb3d6('0x25')](function(_0x5ac125){_0x41dd02[_0xb3d6('0x20')]=_0x5ac125;if(_0x1dbff5['query'][_0xb3d6('0x41')]){_0x411207['include']=[{'all':!![]}];}return db[_0xb3d6('0x2d')][_0xb3d6('0x42')](_0x411207);})[_0xb3d6('0x25')](function(_0x3b8d2f){_0x41dd02[_0xb3d6('0x43')]=_0x3b8d2f;return _0x41dd02;})[_0xb3d6('0x25')](respondWithFilteredResult(_0x1271a9,_0x411207))[_0xb3d6('0x44')](handleError(_0x1271a9,null));};exports[_0xb3d6('0x45')]=function(_0xfaec47,_0x525479){var _0x1a9f5c={'raw':![],'where':{'id':_0xfaec47[_0xb3d6('0x46')]['id']}},_0x52b4f0={};_0x52b4f0[_0xb3d6('0x30')]=_[_0xb3d6('0x33')](db['Dashboard'][_0xb3d6('0x47')]);_0x52b4f0['query']=_[_0xb3d6('0x33')](_0xfaec47[_0xb3d6('0x32')]);_0x52b4f0[_0xb3d6('0x34')]=_['intersection'](_0x52b4f0[_0xb3d6('0x30')],_0x52b4f0[_0xb3d6('0x32')]);_0x1a9f5c[_0xb3d6('0x36')]=_[_0xb3d6('0x35')](_0x52b4f0['model'],qs[_0xb3d6('0x37')](_0xfaec47[_0xb3d6('0x32')][_0xb3d6('0x37')]));_0x1a9f5c[_0xb3d6('0x36')]=_0x1a9f5c['attributes'][_0xb3d6('0x38')]?_0x1a9f5c[_0xb3d6('0x36')]:_0x52b4f0[_0xb3d6('0x30')];if(_0xfaec47[_0xb3d6('0x32')][_0xb3d6('0x41')]){_0x1a9f5c[_0xb3d6('0x48')]=[{'all':!![]}];}_0x1a9f5c=_[_0xb3d6('0x3f')]({},_0x1a9f5c,_0xfaec47[_0xb3d6('0x40')]);return db[_0xb3d6('0x2d')][_0xb3d6('0x49')](_0x1a9f5c)['then'](handleEntityNotFound(_0x525479,null))[_0xb3d6('0x25')](respondWithResult(_0x525479,null))[_0xb3d6('0x44')](handleError(_0x525479,null));};exports[_0xb3d6('0x4a')]=function(_0x42933b,_0x4271b3){return db[_0xb3d6('0x2d')][_0xb3d6('0x4a')](_0x42933b['body'],{})[_0xb3d6('0x25')](function(_0x2bc431){var _0x2739f7=_0x42933b[_0xb3d6('0x4b')][_0xb3d6('0x27')]({'plain':!![]});if(!_0x2739f7)throw new Error(_0xb3d6('0x4c'));if(_0x2739f7[_0xb3d6('0x4d')]==='user'){var _0x184093=_0x2bc431[_0xb3d6('0x27')]({'plain':!![]});var _0x31a5d4=_0xb3d6('0x4e');return db[_0xb3d6('0x4f')][_0xb3d6('0x49')]({'where':{'name':_0x31a5d4,'userProfileId':_0x2739f7['userProfileId']},'raw':!![]})[_0xb3d6('0x25')](function(_0x342d9f){if(_0x342d9f&&_0x342d9f[_0xb3d6('0x50')]===0x0){return db[_0xb3d6('0x28')][_0xb3d6('0x4a')]({'name':_0x184093['name'],'resourceId':_0x184093['id'],'type':_0x342d9f['name'],'sectionId':_0x342d9f['id']},{})[_0xb3d6('0x25')](function(){return _0x2bc431;});}else{return _0x2bc431;}})[_0xb3d6('0x44')](function(_0x394ab){logger[_0xb3d6('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x394ab);throw _0x394ab;});}return _0x2bc431;})['then'](respondWithResult(_0x4271b3,0xc9))[_0xb3d6('0x44')](handleError(_0x4271b3,null));};exports[_0xb3d6('0x51')]=function(_0x461bba,_0x161690){var _0x3d7b43={'where':{'id':_0x461bba['params']['id']}},_0x28426b={};_0x28426b[_0xb3d6('0x30')]=_[_0xb3d6('0x33')](db[_0xb3d6('0x2d')]['rawAttributes']);_0x3d7b43['attributes']=_[_0xb3d6('0x35')](_0x28426b['model'],qs['fields'](_0x461bba[_0xb3d6('0x32')][_0xb3d6('0x37')]));_0x3d7b43[_0xb3d6('0x36')]=_0x3d7b43[_0xb3d6('0x36')][_0xb3d6('0x38')]?_0x3d7b43[_0xb3d6('0x36')]:_0x28426b[_0xb3d6('0x30')];if(_0x461bba[_0xb3d6('0x32')]['includeAll']){_0x3d7b43['include']=[{'all':!![]}];}_0x3d7b43=_[_0xb3d6('0x3f')]({},_0x3d7b43,_0x461bba[_0xb3d6('0x40')]);return db[_0xb3d6('0x2d')]['find'](_0x3d7b43)[_0xb3d6('0x25')](handleEntityNotFound(_0x161690,null))['then'](function(_0x2b1085){if(_0x2b1085){var _0x4ea252=_0x2b1085['get']({'plain':!![]});_0x4ea252=qs[_0xb3d6('0x52')](_0x4ea252,['id',_0xb3d6('0x53'),'updatedAt']);_0x461bba[_0xb3d6('0x54')]=_[_0xb3d6('0x52')](_0x461bba[_0xb3d6('0x54')],['id',_0xb3d6('0x53'),_0xb3d6('0x55')]);return db['Dashboard'][_0xb3d6('0x4a')](_[_0xb3d6('0x3f')](_0x4ea252,_0x461bba[_0xb3d6('0x54')]),{'include':_0x461bba[_0xb3d6('0x32')][_0xb3d6('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0x5af67c){var _0x266b8a=_0x461bba[_0xb3d6('0x4b')][_0xb3d6('0x27')]({'plain':!![]});if(!_0x266b8a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x266b8a[_0xb3d6('0x4d')]===_0xb3d6('0x4b')){var _0x5b8230=_0x5af67c[_0xb3d6('0x27')]({'plain':!![]});var _0x4ed2e0=_0xb3d6('0x4e');return db['UserProfileSection'][_0xb3d6('0x49')]({'where':{'name':_0x4ed2e0,'userProfileId':_0x266b8a['userProfileId']},'raw':!![]})[_0xb3d6('0x25')](function(_0x43ffe8){if(_0x43ffe8&&_0x43ffe8[_0xb3d6('0x50')]===0x0){return db['UserProfileResource'][_0xb3d6('0x4a')]({'name':_0x5b8230[_0xb3d6('0x2a')],'resourceId':_0x5b8230['id'],'type':_0x43ffe8[_0xb3d6('0x2a')],'sectionId':_0x43ffe8['id']},{})[_0xb3d6('0x25')](function(){return _0x5af67c;});}else{return _0x5af67c;}})[_0xb3d6('0x44')](function(_0x105888){logger[_0xb3d6('0x29')](_0xb3d6('0x56'),_0x105888);throw _0x105888;});}return _0x5af67c;});}})[_0xb3d6('0x25')](respondWithResult(_0x161690,0xc9))[_0xb3d6('0x44')](handleError(_0x161690,null));};exports['update']=function(_0x3f5471,_0x9dd80d){if(_0x3f5471[_0xb3d6('0x54')]['id']){delete _0x3f5471[_0xb3d6('0x54')]['id'];}return db['Dashboard'][_0xb3d6('0x49')]({'where':{'id':_0x3f5471[_0xb3d6('0x46')]['id']}})[_0xb3d6('0x25')](handleEntityNotFound(_0x9dd80d,null))[_0xb3d6('0x25')](saveUpdates(_0x3f5471[_0xb3d6('0x54')],null))[_0xb3d6('0x25')](respondWithResult(_0x9dd80d,null))['catch'](handleError(_0x9dd80d,null));};exports[_0xb3d6('0x26')]=function(_0x59dba7,_0x1a90a1){return db[_0xb3d6('0x2d')]['find']({'where':{'id':_0x59dba7['params']['id']}})[_0xb3d6('0x25')](handleEntityNotFound(_0x1a90a1,null))[_0xb3d6('0x25')](removeEntity(_0x1a90a1,null))[_0xb3d6('0x44')](handleError(_0x1a90a1,null));};function widgetAttributes(_0x52151d){try{switch(_0x52151d['type']){case _0xb3d6('0x57'):return[{'name':_0xb3d6('0x58'),'value':_0x52151d['attrUrl']||(_0x52151d[_0xb3d6('0x59')]&&_0x52151d['attrs'][0x0]?_0x52151d[_0xb3d6('0x59')][0x0][_0xb3d6('0x5a')]:undefined)||_0xb3d6('0x5b')}];case _0xb3d6('0x5c'):return[{'name':_0xb3d6('0x5d'),'value':_0x52151d[_0xb3d6('0x5d')]||(_0x52151d[_0xb3d6('0x59')]&&_0x52151d[_0xb3d6('0x59')][0x0]?_0x52151d['attrs'][0x0][_0xb3d6('0x5a')]:undefined)||''}];case _0xb3d6('0x5e'):return[{'name':_0xb3d6('0x5f'),'value':_0x52151d['attrHourFormat']||(_0x52151d[_0xb3d6('0x59')]&&_0x52151d['attrs'][0x0]?_0x52151d[_0xb3d6('0x59')][0x0][_0xb3d6('0x5a')]:undefined)||_0xb3d6('0x60')},{'name':'attrTimezone','value':_0x52151d[_0xb3d6('0x61')]||(_0x52151d[_0xb3d6('0x59')]&&_0x52151d[_0xb3d6('0x59')][0x1]?_0x52151d[_0xb3d6('0x59')][0x1][_0xb3d6('0x5a')]:undefined)||_0xb3d6('0x62')},{'name':_0xb3d6('0x63'),'value':_0x52151d['attrFontSize']||(_0x52151d[_0xb3d6('0x59')]&&_0x52151d['attrs'][0x2]?_0x52151d[_0xb3d6('0x59')][0x2][_0xb3d6('0x5a')]:undefined)||0xc}];case'counter':return[{'name':_0xb3d6('0x64'),'value':_0x52151d[_0xb3d6('0x64')]||(_0x52151d['attrs']&&_0x52151d[_0xb3d6('0x59')][0x0]?_0x52151d[_0xb3d6('0x59')][0x0][_0xb3d6('0x5a')]:undefined)||'total'},{'name':_0xb3d6('0x65'),'value':_0x52151d[_0xb3d6('0x65')]||(_0x52151d[_0xb3d6('0x59')]&&_0x52151d[_0xb3d6('0x59')][0x1]?_0x52151d[_0xb3d6('0x59')][0x1][_0xb3d6('0x5a')]:undefined)||[]},{'name':_0xb3d6('0x63'),'value':_0x52151d[_0xb3d6('0x63')]||(_0x52151d[_0xb3d6('0x59')]&&_0x52151d[_0xb3d6('0x59')][0x2]?_0x52151d[_0xb3d6('0x59')][0x2][_0xb3d6('0x5a')]:undefined)||0x14}];case _0xb3d6('0x66'):case'pie-chart':return[{'name':_0xb3d6('0x67'),'value':_0x52151d[_0xb3d6('0x67')]||(_0x52151d['attrs']&&_0x52151d[_0xb3d6('0x59')][0x0]?_0x52151d['attrs'][0x0][_0xb3d6('0x5a')]:undefined)||_0xb3d6('0x68')},{'name':_0xb3d6('0x69'),'value':_0x52151d[_0xb3d6('0x69')]||(_0x52151d['attrs']&&_0x52151d[_0xb3d6('0x59')][0x1]?_0x52151d[_0xb3d6('0x59')][0x1][_0xb3d6('0x5a')]:undefined)||null},{'name':_0xb3d6('0x6a'),'value':_0x52151d['attrSerie3']||(_0x52151d[_0xb3d6('0x59')]&&_0x52151d[_0xb3d6('0x59')][0x2]?_0x52151d['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x52151d['attrVoiceQueues']||(_0x52151d[_0xb3d6('0x59')]&&_0x52151d[_0xb3d6('0x59')][0x3]?_0x52151d['attrs'][0x3]['value']:undefined)||[]}];case _0xb3d6('0x6b'):return[{'name':'attrReport','type':_0x52151d[_0xb3d6('0x6c')]||(_0x52151d['attrs']&&_0x52151d['attrs'][0x0]?_0x52151d[_0xb3d6('0x59')][0x0][_0xb3d6('0x2f')]:undefined)||null,'value':_0x52151d[_0xb3d6('0x6d')]||(_0x52151d[_0xb3d6('0x59')]&&_0x52151d['attrs'][0x0]?_0x52151d[_0xb3d6('0x59')][0x0][_0xb3d6('0x5a')]:undefined)||null},{'name':_0xb3d6('0x6e'),'value':_0x52151d[_0xb3d6('0x6e')]||(_0x52151d[_0xb3d6('0x59')]&&_0x52151d['attrs'][0x1]?_0x52151d[_0xb3d6('0x59')][0x1][_0xb3d6('0x5a')]:undefined)||0x0}];default:return[];}}catch(_0x221c7b){logger[_0xb3d6('0x29')](_0xb3d6('0x6f'),JSON[_0xb3d6('0x70')](_0x221c7b));return[];}}exports[_0xb3d6('0x71')]=function(_0x4f59b6,_0x458de7,_0x1ac7b3){if(_0x4f59b6[_0xb3d6('0x54')]['id']){delete _0x4f59b6['body']['id'];}return db['Dashboard'][_0xb3d6('0x49')]({'where':{'id':_0x4f59b6['params']['id']}})[_0xb3d6('0x25')](handleEntityNotFound(_0x458de7,null))[_0xb3d6('0x25')](function(_0xc34218){if(_0xc34218){_0x4f59b6[_0xb3d6('0x54')]['DashboardId']=_0xc34218['id'];_0x4f59b6[_0xb3d6('0x54')][_0xb3d6('0x59')]=widgetAttributes(_0x4f59b6['body']);return db[_0xb3d6('0x72')][_0xb3d6('0x4a')](_0x4f59b6[_0xb3d6('0x54')]);}})['then'](respondWithResult(_0x458de7,null))[_0xb3d6('0x44')](handleError(_0x458de7,null));};exports['getItems']=function(_0x47caac,_0x563d79,_0x1b5514){var _0x272567={};var _0x508ec1={};var _0x564caf;var _0x4da5bf;return db['Dashboard'][_0xb3d6('0x73')]({'where':{'id':_0x47caac[_0xb3d6('0x46')]['id']}})[_0xb3d6('0x25')](handleEntityNotFound(_0x563d79,null))[_0xb3d6('0x25')](function(_0x5bd03a){if(_0x5bd03a){_0x564caf=_0x5bd03a;_0x508ec1[_0xb3d6('0x30')]=_[_0xb3d6('0x33')](db[_0xb3d6('0x72')][_0xb3d6('0x47')]);_0x508ec1[_0xb3d6('0x32')]=_[_0xb3d6('0x33')](_0x47caac[_0xb3d6('0x32')]);_0x508ec1[_0xb3d6('0x34')]=_[_0xb3d6('0x35')](_0x508ec1[_0xb3d6('0x30')],_0x508ec1['query']);_0x272567[_0xb3d6('0x36')]=_[_0xb3d6('0x35')](_0x508ec1[_0xb3d6('0x30')],qs[_0xb3d6('0x37')](_0x47caac[_0xb3d6('0x32')][_0xb3d6('0x37')]));_0x272567[_0xb3d6('0x36')]=_0x272567['attributes']['length']?_0x272567['attributes']:_0x508ec1[_0xb3d6('0x30')];_0x272567[_0xb3d6('0x3b')]=qs[_0xb3d6('0x3c')](_0x47caac['query'][_0xb3d6('0x3c')]);_0x272567['where']=qs[_0xb3d6('0x34')](_[_0xb3d6('0x74')](_0x47caac[_0xb3d6('0x32')],_0x508ec1[_0xb3d6('0x34')]));if(_0x47caac[_0xb3d6('0x32')]['filter']){_0x272567[_0xb3d6('0x3d')]=_[_0xb3d6('0x3f')](_0x272567[_0xb3d6('0x3d')],{'$or':_[_0xb3d6('0x31')](_0x272567[_0xb3d6('0x36')],function(_0x4c1e72){var _0x219a4c={};_0x219a4c[_0x4c1e72]={'$like':'%'+_0x47caac[_0xb3d6('0x32')]['filter']+'%'};return _0x219a4c;})});}_0x272567=_[_0xb3d6('0x3f')]({},_0x272567,_0x47caac[_0xb3d6('0x40')]);return _0x564caf[_0xb3d6('0x75')](_0x272567);}})[_0xb3d6('0x25')](function(_0x198375){if(_0x198375){_0x4da5bf=_0x198375['length'];if(!_0x47caac['query'][_0xb3d6('0x39')](_0xb3d6('0x3a'))){_0x272567[_0xb3d6('0x1f')]=qs['limit'](_0x47caac[_0xb3d6('0x32')]['limit']);_0x272567['offset']=qs[_0xb3d6('0x21')](_0x47caac[_0xb3d6('0x32')][_0xb3d6('0x21')]);}return _0x564caf[_0xb3d6('0x75')](_0x272567);}})[_0xb3d6('0x25')](function(_0x3a689e){if(_0x3a689e){return _0x3a689e?{'count':_0x4da5bf,'rows':_0x3a689e}:null;}})[_0xb3d6('0x25')](respondWithResult(_0x563d79,null))[_0xb3d6('0x44')](handleError(_0x563d79,null));}; \ No newline at end of file +var _0xc661=['set','Content-Range','apply','reject','save','then','CustomDashboards','UserProfileResource','destroy','sendStatus','error','name','send','index','Dashboard','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','end','offset','undefined','limit','count','status'];(function(_0x1b3f52,_0x4f5b13){var _0x36bf2c=function(_0x2c8426){while(--_0x2c8426){_0x1b3f52['push'](_0x1b3f52['shift']());}};_0x36bf2c(++_0x4f5b13);}(_0xc661,0x1a5));var _0x1c66=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xc661[_0x62c958];return _0x57ec61;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c66('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c66('0x1'));var rp=require(_0x1c66('0x2'));var moment=require(_0x1c66('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1c66('0x4'));var util=require(_0x1c66('0x5'));var path=require(_0x1c66('0x6'));var sox=require(_0x1c66('0x7'));var csv=require('to-csv');var ejs=require(_0x1c66('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c66('0x9'));var squel=require(_0x1c66('0xa'));var crypto=require(_0x1c66('0xb'));var jsforce=require(_0x1c66('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1c66('0xd'));var Papa=require('papaparse');var Redis=require(_0x1c66('0xe'));var authService=require(_0x1c66('0xf'));var qs=require(_0x1c66('0x10'));var as=require(_0x1c66('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1c66('0x12'));var utils=require(_0x1c66('0x13'));var config=require(_0x1c66('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1c66('0x15'))['db'];config[_0x1c66('0x16')]=_[_0x1c66('0x17')](config[_0x1c66('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x1c66('0x18'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x4d1ed4,_0x1a315a){_0x1a315a=_0x1a315a||0xcc;return function(_0x5aa2e8){if(_0x5aa2e8){return _0x4d1ed4['sendStatus'](_0x1a315a);}return _0x4d1ed4['status'](_0x1a315a)[_0x1c66('0x19')]();};}function respondWithResult(_0x54970a,_0x23b761){_0x23b761=_0x23b761||0xc8;return function(_0x2a852f){if(_0x2a852f){return _0x54970a['status'](_0x23b761)['json'](_0x2a852f);}};}function respondWithFilteredResult(_0x29c0cc,_0x11d9c9){return function(_0x370919){if(_0x370919){var _0x171de2=typeof _0x11d9c9[_0x1c66('0x1a')]===_0x1c66('0x1b')&&typeof _0x11d9c9[_0x1c66('0x1c')]===_0x1c66('0x1b');var _0x3692c3=_0x370919[_0x1c66('0x1d')];var _0x46efc4=_0x171de2?0x0:_0x11d9c9['offset'];var _0x1c8e1a=_0x171de2?_0x370919[_0x1c66('0x1d')]:_0x11d9c9[_0x1c66('0x1a')]+_0x11d9c9['limit'];var _0x6e17a0;if(_0x1c8e1a>=_0x3692c3){_0x1c8e1a=_0x3692c3;_0x6e17a0=0xc8;}else{_0x6e17a0=0xce;}_0x29c0cc[_0x1c66('0x1e')](_0x6e17a0);return _0x29c0cc[_0x1c66('0x1f')](_0x1c66('0x20'),_0x46efc4+'-'+_0x1c8e1a+'/'+_0x3692c3)['json'](_0x370919);}return null;};}function patchUpdates(_0x49f292){return function(_0x3ea94e){try{jsonpatch[_0x1c66('0x21')](_0x3ea94e,_0x49f292,!![]);}catch(_0x49ddf8){return BPromise[_0x1c66('0x22')](_0x49ddf8);}return _0x3ea94e[_0x1c66('0x23')]();};}function saveUpdates(_0x547123,_0x57dbf4){return function(_0x48d767){if(_0x48d767){return _0x48d767['update'](_0x547123)[_0x1c66('0x24')](function(_0x1ded22){return _0x1ded22;});}return null;};}function removeEntity(_0x59926f,_0x587782){return function(_0x4e6325){if(_0x4e6325){return _0x4e6325['destroy']()[_0x1c66('0x24')](function(){var _0x40b516=_0x4e6325['get']({'plain':!![]});var _0x7bf486=_0x1c66('0x25');return db[_0x1c66('0x26')][_0x1c66('0x27')]({'where':{'type':_0x7bf486,'resourceId':_0x40b516['id']}})[_0x1c66('0x24')](function(){return _0x4e6325;});})['then'](function(){_0x59926f[_0x1c66('0x1e')](0xcc)[_0x1c66('0x19')]();});}};}function handleEntityNotFound(_0x477811,_0x19a4ce){return function(_0x470d7c){if(!_0x470d7c){_0x477811[_0x1c66('0x28')](0x194);}return _0x470d7c;};}function handleError(_0x5da24b,_0xc0d6f0){_0xc0d6f0=_0xc0d6f0||0x1f4;return function(_0x95327){logger[_0x1c66('0x29')](_0x95327['stack']);if(_0x95327['name']){delete _0x95327[_0x1c66('0x2a')];}_0x5da24b['status'](_0xc0d6f0)[_0x1c66('0x2b')](_0x95327);};}exports[_0x1c66('0x2c')]=function(_0x1a09fa,_0x5e0400){var _0x18aaf9={},_0x4aaf24={},_0x223a7d={'count':0x0,'rows':[]};var _0x387793=_['map'](db[_0x1c66('0x2d')][_0x1c66('0x2e')],function(_0x286518){return{'name':_0x286518[_0x1c66('0x2f')],'type':_0x286518[_0x1c66('0x30')]['key']};});_0x4aaf24['model']=_[_0x1c66('0x31')](_0x387793,_0x1c66('0x2a'));_0x4aaf24[_0x1c66('0x32')]=_[_0x1c66('0x33')](_0x1a09fa[_0x1c66('0x32')]);_0x4aaf24[_0x1c66('0x34')]=_[_0x1c66('0x35')](_0x4aaf24[_0x1c66('0x36')],_0x4aaf24[_0x1c66('0x32')]);_0x18aaf9[_0x1c66('0x37')]=_[_0x1c66('0x35')](_0x4aaf24['model'],qs[_0x1c66('0x38')](_0x1a09fa['query'][_0x1c66('0x38')]));_0x18aaf9['attributes']=_0x18aaf9[_0x1c66('0x37')][_0x1c66('0x39')]?_0x18aaf9[_0x1c66('0x37')]:_0x4aaf24['model'];if(!_0x1a09fa['query']['hasOwnProperty'](_0x1c66('0x3a'))){_0x18aaf9[_0x1c66('0x1c')]=qs['limit'](_0x1a09fa[_0x1c66('0x32')][_0x1c66('0x1c')]);_0x18aaf9[_0x1c66('0x1a')]=qs['offset'](_0x1a09fa[_0x1c66('0x32')][_0x1c66('0x1a')]);}_0x18aaf9[_0x1c66('0x3b')]=qs[_0x1c66('0x3c')](_0x1a09fa[_0x1c66('0x32')]['sort']);_0x18aaf9[_0x1c66('0x3d')]=qs[_0x1c66('0x34')](_[_0x1c66('0x3e')](_0x1a09fa[_0x1c66('0x32')],_0x4aaf24[_0x1c66('0x34')]),_0x387793);if(_0x1a09fa[_0x1c66('0x32')][_0x1c66('0x3f')]){_0x18aaf9['where']=_[_0x1c66('0x40')](_0x18aaf9[_0x1c66('0x3d')],{'$or':_[_0x1c66('0x31')](_0x387793,function(_0x1fe262){if(_0x1fe262[_0x1c66('0x30')]!==_0x1c66('0x41')){var _0x440908={};_0x440908[_0x1fe262['name']]={'$like':'%'+_0x1a09fa[_0x1c66('0x32')]['filter']+'%'};return _0x440908;}})});}_0x18aaf9=_[_0x1c66('0x40')]({},_0x18aaf9,_0x1a09fa[_0x1c66('0x42')]);var _0x2a6983={'where':_0x18aaf9['where']};return db[_0x1c66('0x2d')][_0x1c66('0x1d')](_0x2a6983)[_0x1c66('0x24')](function(_0x54a799){_0x223a7d[_0x1c66('0x1d')]=_0x54a799;if(_0x1a09fa[_0x1c66('0x32')][_0x1c66('0x43')]){_0x18aaf9[_0x1c66('0x44')]=[{'all':!![]}];}return db[_0x1c66('0x2d')]['findAll'](_0x18aaf9);})[_0x1c66('0x24')](function(_0x35b229){_0x223a7d[_0x1c66('0x45')]=_0x35b229;return _0x223a7d;})[_0x1c66('0x24')](respondWithFilteredResult(_0x5e0400,_0x18aaf9))['catch'](handleError(_0x5e0400,null));};exports[_0x1c66('0x46')]=function(_0x3829e6,_0x54d075){var _0x51ce0a={'raw':![],'where':{'id':_0x3829e6[_0x1c66('0x47')]['id']}},_0x27306b={};_0x27306b[_0x1c66('0x36')]=_[_0x1c66('0x33')](db[_0x1c66('0x2d')]['rawAttributes']);_0x27306b[_0x1c66('0x32')]=_['keys'](_0x3829e6[_0x1c66('0x32')]);_0x27306b[_0x1c66('0x34')]=_[_0x1c66('0x35')](_0x27306b[_0x1c66('0x36')],_0x27306b[_0x1c66('0x32')]);_0x51ce0a[_0x1c66('0x37')]=_['intersection'](_0x27306b['model'],qs[_0x1c66('0x38')](_0x3829e6[_0x1c66('0x32')][_0x1c66('0x38')]));_0x51ce0a[_0x1c66('0x37')]=_0x51ce0a[_0x1c66('0x37')][_0x1c66('0x39')]?_0x51ce0a['attributes']:_0x27306b[_0x1c66('0x36')];if(_0x3829e6[_0x1c66('0x32')][_0x1c66('0x43')]){_0x51ce0a[_0x1c66('0x44')]=[{'all':!![]}];}_0x51ce0a=_[_0x1c66('0x40')]({},_0x51ce0a,_0x3829e6[_0x1c66('0x42')]);return db[_0x1c66('0x2d')][_0x1c66('0x48')](_0x51ce0a)['then'](handleEntityNotFound(_0x54d075,null))[_0x1c66('0x24')](respondWithResult(_0x54d075,null))[_0x1c66('0x49')](handleError(_0x54d075,null));};exports[_0x1c66('0x4a')]=function(_0x4bca49,_0x33dcf1){return db['Dashboard'][_0x1c66('0x4a')](_0x4bca49[_0x1c66('0x4b')],{})[_0x1c66('0x24')](function(_0x9769e9){var _0x433ffe=_0x4bca49[_0x1c66('0x4c')]['get']({'plain':!![]});if(!_0x433ffe)throw new Error(_0x1c66('0x4d'));if(_0x433ffe['role']===_0x1c66('0x4c')){var _0x5a439c=_0x9769e9[_0x1c66('0x4e')]({'plain':!![]});var _0x3689b9='CustomDashboards';return db[_0x1c66('0x4f')][_0x1c66('0x48')]({'where':{'name':_0x3689b9,'userProfileId':_0x433ffe[_0x1c66('0x50')]},'raw':!![]})[_0x1c66('0x24')](function(_0x301f7c){if(_0x301f7c&&_0x301f7c[_0x1c66('0x51')]===0x0){return db[_0x1c66('0x26')][_0x1c66('0x4a')]({'name':_0x5a439c[_0x1c66('0x2a')],'resourceId':_0x5a439c['id'],'type':_0x301f7c['name'],'sectionId':_0x301f7c['id']},{})[_0x1c66('0x24')](function(){return _0x9769e9;});}else{return _0x9769e9;}})[_0x1c66('0x49')](function(_0x5d0ca1){logger[_0x1c66('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d0ca1);throw _0x5d0ca1;});}return _0x9769e9;})[_0x1c66('0x24')](respondWithResult(_0x33dcf1,0xc9))[_0x1c66('0x49')](handleError(_0x33dcf1,null));};exports[_0x1c66('0x52')]=function(_0x4b57e,_0x2299b6){var _0x489d99={'where':{'id':_0x4b57e[_0x1c66('0x47')]['id']}},_0x2a26dd={};_0x2a26dd[_0x1c66('0x36')]=_[_0x1c66('0x33')](db[_0x1c66('0x2d')][_0x1c66('0x2e')]);_0x489d99[_0x1c66('0x37')]=_[_0x1c66('0x35')](_0x2a26dd[_0x1c66('0x36')],qs['fields'](_0x4b57e[_0x1c66('0x32')]['fields']));_0x489d99[_0x1c66('0x37')]=_0x489d99[_0x1c66('0x37')][_0x1c66('0x39')]?_0x489d99[_0x1c66('0x37')]:_0x2a26dd['model'];if(_0x4b57e['query']['includeAll']){_0x489d99[_0x1c66('0x44')]=[{'all':!![]}];}_0x489d99=_[_0x1c66('0x40')]({},_0x489d99,_0x4b57e[_0x1c66('0x42')]);return db['Dashboard']['find'](_0x489d99)[_0x1c66('0x24')](handleEntityNotFound(_0x2299b6,null))[_0x1c66('0x24')](function(_0x1ca6f6){if(_0x1ca6f6){var _0x4eb893=_0x1ca6f6[_0x1c66('0x4e')]({'plain':!![]});_0x4eb893=qs[_0x1c66('0x53')](_0x4eb893,['id',_0x1c66('0x54'),'updatedAt']);_0x4b57e[_0x1c66('0x4b')]=_[_0x1c66('0x53')](_0x4b57e['body'],['id',_0x1c66('0x54'),_0x1c66('0x55')]);return db[_0x1c66('0x2d')][_0x1c66('0x4a')](_[_0x1c66('0x40')](_0x4eb893,_0x4b57e['body']),{'include':_0x4b57e[_0x1c66('0x32')][_0x1c66('0x43')]?[{'all':!![]}]:undefined})[_0x1c66('0x24')](function(_0x114bd6){var _0x1f4ad4=_0x4b57e['user'][_0x1c66('0x4e')]({'plain':!![]});if(!_0x1f4ad4)throw new Error(_0x1c66('0x4d'));if(_0x1f4ad4['role']==='user'){var _0x28685e=_0x114bd6[_0x1c66('0x4e')]({'plain':!![]});var _0x45f89b=_0x1c66('0x25');return db[_0x1c66('0x4f')][_0x1c66('0x48')]({'where':{'name':_0x45f89b,'userProfileId':_0x1f4ad4[_0x1c66('0x50')]},'raw':!![]})[_0x1c66('0x24')](function(_0xd05fc){if(_0xd05fc&&_0xd05fc[_0x1c66('0x51')]===0x0){return db['UserProfileResource'][_0x1c66('0x4a')]({'name':_0x28685e[_0x1c66('0x2a')],'resourceId':_0x28685e['id'],'type':_0xd05fc[_0x1c66('0x2a')],'sectionId':_0xd05fc['id']},{})[_0x1c66('0x24')](function(){return _0x114bd6;});}else{return _0x114bd6;}})['catch'](function(_0x521f89){logger[_0x1c66('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x521f89);throw _0x521f89;});}return _0x114bd6;});}})[_0x1c66('0x24')](respondWithResult(_0x2299b6,0xc9))['catch'](handleError(_0x2299b6,null));};exports['update']=function(_0xd8a55f,_0xf5d6ae){if(_0xd8a55f[_0x1c66('0x4b')]['id']){delete _0xd8a55f[_0x1c66('0x4b')]['id'];}return db[_0x1c66('0x2d')][_0x1c66('0x48')]({'where':{'id':_0xd8a55f[_0x1c66('0x47')]['id']}})[_0x1c66('0x24')](handleEntityNotFound(_0xf5d6ae,null))[_0x1c66('0x24')](saveUpdates(_0xd8a55f[_0x1c66('0x4b')],null))['then'](respondWithResult(_0xf5d6ae,null))[_0x1c66('0x49')](handleError(_0xf5d6ae,null));};exports['destroy']=function(_0x161d55,_0x34010c){return db['Dashboard'][_0x1c66('0x48')]({'where':{'id':_0x161d55['params']['id']}})[_0x1c66('0x24')](handleEntityNotFound(_0x34010c,null))['then'](removeEntity(_0x34010c,null))['catch'](handleError(_0x34010c,null));};function widgetAttributes(_0x48a945){try{switch(_0x48a945[_0x1c66('0x30')]){case _0x1c66('0x56'):return[{'name':'attrUrl','value':_0x48a945[_0x1c66('0x57')]||(_0x48a945[_0x1c66('0x58')]&&_0x48a945['attrs'][0x0]?_0x48a945[_0x1c66('0x58')][0x0][_0x1c66('0x59')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x48a945[_0x1c66('0x5a')]||(_0x48a945['attrs']&&_0x48a945['attrs'][0x0]?_0x48a945[_0x1c66('0x58')][0x0][_0x1c66('0x59')]:undefined)||''}];case _0x1c66('0x5b'):return[{'name':'attrHourFormat','value':_0x48a945[_0x1c66('0x5c')]||(_0x48a945['attrs']&&_0x48a945[_0x1c66('0x58')][0x0]?_0x48a945[_0x1c66('0x58')][0x0][_0x1c66('0x59')]:undefined)||'HH:mm:ss'},{'name':_0x1c66('0x5d'),'value':_0x48a945[_0x1c66('0x5d')]||(_0x48a945[_0x1c66('0x58')]&&_0x48a945[_0x1c66('0x58')][0x1]?_0x48a945[_0x1c66('0x58')][0x1][_0x1c66('0x59')]:undefined)||_0x1c66('0x5e')},{'name':'attrFontSize','value':_0x48a945[_0x1c66('0x5f')]||(_0x48a945['attrs']&&_0x48a945[_0x1c66('0x58')][0x2]?_0x48a945[_0x1c66('0x58')][0x2][_0x1c66('0x59')]:undefined)||0xc}];case _0x1c66('0x60'):return[{'name':'attrMetric','value':_0x48a945[_0x1c66('0x61')]||(_0x48a945[_0x1c66('0x58')]&&_0x48a945['attrs'][0x0]?_0x48a945['attrs'][0x0][_0x1c66('0x59')]:undefined)||_0x1c66('0x62')},{'name':_0x1c66('0x63'),'value':_0x48a945['attrVoiceQueues']||(_0x48a945['attrs']&&_0x48a945['attrs'][0x1]?_0x48a945['attrs'][0x1]['value']:undefined)||[]},{'name':_0x1c66('0x5f'),'value':_0x48a945[_0x1c66('0x5f')]||(_0x48a945[_0x1c66('0x58')]&&_0x48a945[_0x1c66('0x58')][0x2]?_0x48a945[_0x1c66('0x58')][0x2][_0x1c66('0x59')]:undefined)||0x14}];case _0x1c66('0x64'):case'pie-chart':return[{'name':_0x1c66('0x65'),'value':_0x48a945[_0x1c66('0x65')]||(_0x48a945[_0x1c66('0x58')]&&_0x48a945['attrs'][0x0]?_0x48a945[_0x1c66('0x58')][0x0]['value']:undefined)||_0x1c66('0x62')},{'name':_0x1c66('0x66'),'value':_0x48a945[_0x1c66('0x66')]||(_0x48a945['attrs']&&_0x48a945[_0x1c66('0x58')][0x1]?_0x48a945['attrs'][0x1][_0x1c66('0x59')]:undefined)||null},{'name':_0x1c66('0x67'),'value':_0x48a945['attrSerie3']||(_0x48a945[_0x1c66('0x58')]&&_0x48a945[_0x1c66('0x58')][0x2]?_0x48a945[_0x1c66('0x58')][0x2][_0x1c66('0x59')]:undefined)||null},{'name':_0x1c66('0x63'),'value':_0x48a945[_0x1c66('0x63')]||(_0x48a945[_0x1c66('0x58')]&&_0x48a945[_0x1c66('0x58')][0x3]?_0x48a945[_0x1c66('0x58')][0x3]['value']:undefined)||[]}];case _0x1c66('0x68'):return[{'name':_0x1c66('0x69'),'type':_0x48a945[_0x1c66('0x6a')]||(_0x48a945['attrs']&&_0x48a945[_0x1c66('0x58')][0x0]?_0x48a945[_0x1c66('0x58')][0x0][_0x1c66('0x30')]:undefined)||null,'value':_0x48a945[_0x1c66('0x69')]||(_0x48a945[_0x1c66('0x58')]&&_0x48a945['attrs'][0x0]?_0x48a945[_0x1c66('0x58')][0x0][_0x1c66('0x59')]:undefined)||null},{'name':_0x1c66('0x6b'),'value':_0x48a945[_0x1c66('0x6b')]||(_0x48a945[_0x1c66('0x58')]&&_0x48a945['attrs'][0x1]?_0x48a945[_0x1c66('0x58')][0x1][_0x1c66('0x59')]:undefined)||0x0}];default:return[];}}catch(_0xabf6db){logger['error']('widgetAttributes:\x20%s',JSON[_0x1c66('0x6c')](_0xabf6db));return[];}}exports[_0x1c66('0x6d')]=function(_0x238080,_0x17f7a5,_0x1495b9){if(_0x238080[_0x1c66('0x4b')]['id']){delete _0x238080[_0x1c66('0x4b')]['id'];}return db[_0x1c66('0x2d')][_0x1c66('0x48')]({'where':{'id':_0x238080[_0x1c66('0x47')]['id']}})[_0x1c66('0x24')](handleEntityNotFound(_0x17f7a5,null))[_0x1c66('0x24')](function(_0x5bdbe8){if(_0x5bdbe8){_0x238080['body'][_0x1c66('0x6e')]=_0x5bdbe8['id'];_0x238080[_0x1c66('0x4b')][_0x1c66('0x58')]=widgetAttributes(_0x238080['body']);return db['DashboardItem'][_0x1c66('0x4a')](_0x238080[_0x1c66('0x4b')]);}})[_0x1c66('0x24')](respondWithResult(_0x17f7a5,null))[_0x1c66('0x49')](handleError(_0x17f7a5,null));};exports['getItems']=function(_0x24aae4,_0x40b642,_0x3f1ff2){var _0x10d101={};var _0x54e5b4={};var _0x3931ae;var _0x27eb9b;return db[_0x1c66('0x2d')]['findOne']({'where':{'id':_0x24aae4[_0x1c66('0x47')]['id']}})[_0x1c66('0x24')](handleEntityNotFound(_0x40b642,null))[_0x1c66('0x24')](function(_0x4ceb8d){if(_0x4ceb8d){_0x3931ae=_0x4ceb8d;_0x54e5b4['model']=_[_0x1c66('0x33')](db[_0x1c66('0x6f')][_0x1c66('0x2e')]);_0x54e5b4[_0x1c66('0x32')]=_[_0x1c66('0x33')](_0x24aae4[_0x1c66('0x32')]);_0x54e5b4[_0x1c66('0x34')]=_['intersection'](_0x54e5b4[_0x1c66('0x36')],_0x54e5b4[_0x1c66('0x32')]);_0x10d101['attributes']=_[_0x1c66('0x35')](_0x54e5b4[_0x1c66('0x36')],qs[_0x1c66('0x38')](_0x24aae4[_0x1c66('0x32')][_0x1c66('0x38')]));_0x10d101[_0x1c66('0x37')]=_0x10d101[_0x1c66('0x37')][_0x1c66('0x39')]?_0x10d101[_0x1c66('0x37')]:_0x54e5b4['model'];_0x10d101[_0x1c66('0x3b')]=qs[_0x1c66('0x3c')](_0x24aae4[_0x1c66('0x32')][_0x1c66('0x3c')]);_0x10d101['where']=qs[_0x1c66('0x34')](_[_0x1c66('0x3e')](_0x24aae4[_0x1c66('0x32')],_0x54e5b4[_0x1c66('0x34')]));if(_0x24aae4[_0x1c66('0x32')][_0x1c66('0x3f')]){_0x10d101[_0x1c66('0x3d')]=_[_0x1c66('0x40')](_0x10d101['where'],{'$or':_[_0x1c66('0x31')](_0x10d101[_0x1c66('0x37')],function(_0x199615){var _0x4afca3={};_0x4afca3[_0x199615]={'$like':'%'+_0x24aae4['query']['filter']+'%'};return _0x4afca3;})});}_0x10d101=_[_0x1c66('0x40')]({},_0x10d101,_0x24aae4[_0x1c66('0x42')]);return _0x3931ae[_0x1c66('0x70')](_0x10d101);}})['then'](function(_0x4fcb21){if(_0x4fcb21){_0x27eb9b=_0x4fcb21[_0x1c66('0x39')];if(!_0x24aae4[_0x1c66('0x32')]['hasOwnProperty'](_0x1c66('0x3a'))){_0x10d101[_0x1c66('0x1c')]=qs[_0x1c66('0x1c')](_0x24aae4[_0x1c66('0x32')][_0x1c66('0x1c')]);_0x10d101[_0x1c66('0x1a')]=qs[_0x1c66('0x1a')](_0x24aae4[_0x1c66('0x32')][_0x1c66('0x1a')]);}return _0x3931ae[_0x1c66('0x70')](_0x10d101);}})[_0x1c66('0x24')](function(_0x5a504b){if(_0x5a504b){return _0x5a504b?{'count':_0x27eb9b,'rows':_0x5a504b}:null;}})[_0x1c66('0x24')](respondWithResult(_0x40b642,null))[_0x1c66('0x49')](handleError(_0x40b642,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 6a4580d..57f225b 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 _0x9cb7=['events','Dashboard','setMaxListeners','update','hasOwnProperty','hook','exports'];(function(_0x97ed31,_0x30c75f){var _0x1d3ded=function(_0x5f0995){while(--_0x5f0995){_0x97ed31['push'](_0x97ed31['shift']());}};_0x1d3ded(++_0x30c75f);}(_0x9cb7,0x1ce));var _0x79cb=function(_0x372d74,_0x45c6ba){_0x372d74=_0x372d74-0x0;var _0x420a49=_0x9cb7[_0x372d74];return _0x420a49;};'use strict';var EventEmitter=require(_0x79cb('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x79cb('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x79cb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x79cb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x158e6d){return function(_0x4a3a8b,_0x4b4632,_0xff9f50){DashboardEvents['emit'](_0x158e6d+':'+_0x4a3a8b['id'],_0x4a3a8b);DashboardEvents['emit'](_0x158e6d,_0x4a3a8b);_0xff9f50(null);};}for(var e in events){if(events[_0x79cb('0x4')](e)){var event=events[e];Dashboard[_0x79cb('0x5')](e,emitEvent(event));}}module[_0x79cb('0x6')]=DashboardEvents; \ No newline at end of file +var _0xac26=['events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x5f2098,_0x47308b){var _0x18af32=function(_0xa53c8e){while(--_0xa53c8e){_0x5f2098['push'](_0x5f2098['shift']());}};_0x18af32(++_0x47308b);}(_0xac26,0x70));var _0x6ac2=function(_0x2b321d,_0x1fcf98){_0x2b321d=_0x2b321d-0x0;var _0x4e530=_0xac26[_0x2b321d];return _0x4e530;};'use strict';var EventEmitter=require(_0x6ac2('0x0'));var Dashboard=require(_0x6ac2('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x6ac2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6ac2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x44a33a){return function(_0x14154f,_0x51cd8d,_0x35a2f9){DashboardEvents[_0x6ac2('0x4')](_0x44a33a+':'+_0x14154f['id'],_0x14154f);DashboardEvents[_0x6ac2('0x4')](_0x44a33a,_0x14154f);_0x35a2f9(null);};}for(var e in events){if(events[_0x6ac2('0x5')](e)){var event=events[e];Dashboard[_0x6ac2('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 2c1d126..ac4489c 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 _0x1621=['path','rimraf','../../config/environment','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1621,0x1f4));var _0x1162=function(_0x1ccb5d,_0x341da9){_0x1ccb5d=_0x1ccb5d-0x0;var _0x1fe071=_0x1621[_0x1ccb5d];return _0x1fe071;};'use strict';var _=require(_0x1162('0x0'));var util=require(_0x1162('0x1'));var logger=require(_0x1162('0x2'))(_0x1162('0x3'));var moment=require(_0x1162('0x4'));var BPromise=require(_0x1162('0x5'));var rp=require(_0x1162('0x6'));var fs=require('fs');var path=require(_0x1162('0x7'));var rimraf=require(_0x1162('0x8'));var config=require(_0x1162('0x9'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x54cafe,_0x13a54c){return _0x54cafe[_0x1162('0xa')](_0x1162('0xb'),attributes,{'tableName':_0x1162('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e86=['../../config/environment','./dashboard.attributes','exports','define','dashboards','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x1ec0eb,_0x43ee23){var _0x46cb5d=function(_0x2d7b84){while(--_0x2d7b84){_0x1ec0eb['push'](_0x1ec0eb['shift']());}};_0x46cb5d(++_0x43ee23);}(_0x1e86,0x94));var _0x61e8=function(_0x5148d5,_0x1a9f22){_0x5148d5=_0x5148d5-0x0;var _0x3a63c9=_0x1e86[_0x5148d5];return _0x3a63c9;};'use strict';var _=require(_0x61e8('0x0'));var util=require(_0x61e8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x61e8('0x2'));var BPromise=require(_0x61e8('0x3'));var rp=require(_0x61e8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61e8('0x5'));var config=require(_0x61e8('0x6'));var attributes=require(_0x61e8('0x7'));module[_0x61e8('0x8')]=function(_0x13f0a8,_0x5315d3){return _0x13f0a8[_0x61e8('0x9')]('Dashboard',attributes,{'tableName':_0x61e8('0xa'),'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 005356b..8e44ed0 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 _0x3811=['code','message','info','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','then','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error'];(function(_0xda616d,_0x39fad5){var _0x2c5c84=function(_0x4d1b3a){while(--_0x4d1b3a){_0xda616d['push'](_0xda616d['shift']());}};_0x2c5c84(++_0x39fad5);}(_0x3811,0x1be));var _0x1381=function(_0x6ac018,_0x36f1e1){_0x6ac018=_0x6ac018-0x0;var _0x1dbb8a=_0x3811[_0x6ac018];return _0x1dbb8a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1381('0x0'));var BPromise=require(_0x1381('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1381('0x2'));var db=require(_0x1381('0x3'))['db'];var utils=require(_0x1381('0x4'));var logger=require(_0x1381('0x5'))(_0x1381('0x6'));var config=require(_0x1381('0x7'));var jayson=require(_0x1381('0x8'));var client=jayson[_0x1381('0x9')][_0x1381('0xa')]({'port':0x232a});config[_0x1381('0xb')]=_[_0x1381('0xc')](config[_0x1381('0xb')],{'host':_0x1381('0xd'),'port':0x18eb});var socket=require(_0x1381('0xe'))(new Redis(config[_0x1381('0xb')]));require(_0x1381('0xf'))[_0x1381('0x10')](socket);function respondWithRpcPromise(_0x29d2d3,_0x57dccb,_0x34f006){return new BPromise(function(_0xc23fa4,_0x4dcac8){return client['request'](_0x29d2d3,_0x34f006)[_0x1381('0x11')](function(_0x4d922b){logger['info'](_0x1381('0x12'),_0x57dccb,_0x1381('0x13'));logger['debug'](_0x1381('0x14'),_0x57dccb,_0x1381('0x13'),JSON['stringify'](_0x4d922b));if(_0x4d922b[_0x1381('0x15')]){if(_0x4d922b[_0x1381('0x15')][_0x1381('0x16')]===0x1f4){logger[_0x1381('0x15')](_0x1381('0x12'),_0x57dccb,_0x4d922b[_0x1381('0x15')]['message']);return _0x4dcac8(_0x4d922b[_0x1381('0x15')][_0x1381('0x17')]);}logger[_0x1381('0x15')](_0x1381('0x12'),_0x57dccb,_0x4d922b['error']['message']);return _0xc23fa4(_0x4d922b[_0x1381('0x15')][_0x1381('0x17')]);}else{logger[_0x1381('0x18')](_0x1381('0x12'),_0x57dccb,'request\x20sent');_0xc23fa4(_0x4d922b[_0x1381('0x19')][_0x1381('0x17')]);}})['catch'](function(_0x3b9872){logger[_0x1381('0x15')]('Dashboard,\x20%s,\x20%s',_0x57dccb,_0x3b9872);_0x4dcac8(_0x3b9872);});});} \ No newline at end of file +var _0x8c62=['result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x8c62,0x66));var _0x28c6=function(_0x20d767,_0x35f167){_0x20d767=_0x20d767-0x0;var _0x564265=_0x8c62[_0x20d767];return _0x564265;};'use strict';var _=require('lodash');var util=require(_0x28c6('0x0'));var moment=require(_0x28c6('0x1'));var BPromise=require(_0x28c6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28c6('0x3'));var db=require(_0x28c6('0x4'))['db'];var utils=require(_0x28c6('0x5'));var logger=require(_0x28c6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x28c6('0x7'));var client=jayson[_0x28c6('0x8')][_0x28c6('0x9')]({'port':0x232a});config[_0x28c6('0xa')]=_['defaults'](config[_0x28c6('0xa')],{'host':_0x28c6('0xb'),'port':0x18eb});var socket=require(_0x28c6('0xc'))(new Redis(config[_0x28c6('0xa')]));require(_0x28c6('0xd'))[_0x28c6('0xe')](socket);function respondWithRpcPromise(_0x330c4d,_0x5c7ecf,_0x4dc6a7){return new BPromise(function(_0x53aa7d,_0x52eda2){return client['request'](_0x330c4d,_0x4dc6a7)['then'](function(_0x223436){logger[_0x28c6('0xf')](_0x28c6('0x10'),_0x5c7ecf,_0x28c6('0x11'));logger[_0x28c6('0x12')](_0x28c6('0x13'),_0x5c7ecf,'request\x20sent',JSON[_0x28c6('0x14')](_0x223436));if(_0x223436[_0x28c6('0x15')]){if(_0x223436[_0x28c6('0x15')]['code']===0x1f4){logger[_0x28c6('0x15')](_0x28c6('0x10'),_0x5c7ecf,_0x223436[_0x28c6('0x15')]['message']);return _0x52eda2(_0x223436[_0x28c6('0x15')]['message']);}logger['error'](_0x28c6('0x10'),_0x5c7ecf,_0x223436[_0x28c6('0x15')][_0x28c6('0x16')]);return _0x53aa7d(_0x223436['error']['message']);}else{logger['info'](_0x28c6('0x10'),_0x5c7ecf,'request\x20sent');_0x53aa7d(_0x223436[_0x28c6('0x17')][_0x28c6('0x16')]);}})[_0x28c6('0x18')](function(_0x3f57c5){logger[_0x28c6('0x15')](_0x28c6('0x10'),_0x5c7ecf,_0x3f57c5);_0x52eda2(_0x3f57c5);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 162fc01..4881726 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 _0x3790=['register','length','update','emit','removeListener'];(function(_0x57ce31,_0x2fbd14){var _0x915ad2=function(_0x473f2e){while(--_0x473f2e){_0x57ce31['push'](_0x57ce31['shift']());}};_0x915ad2(++_0x2fbd14);}(_0x3790,0x197));var _0x0379=function(_0x13b00c,_0x612212){_0x13b00c=_0x13b00c-0x0;var _0x5e86a5=_0x3790[_0x13b00c];return _0x5e86a5;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save','remove',_0x0379('0x0')];function createListener(_0x2d3bc9,_0x34926a){return function(_0x46571e){_0x34926a[_0x0379('0x1')](_0x2d3bc9,_0x46571e);};}function removeListener(_0xa72826,_0x3265a3){return function(){DashboardEvents[_0x0379('0x2')](_0xa72826,_0x3265a3);};}exports[_0x0379('0x3')]=function(_0x34919a){for(var _0x5950ec=0x0,_0x524e93=events[_0x0379('0x4')];_0x5950ec<_0x524e93;_0x5950ec++){var _0x217567=events[_0x5950ec];var _0x106184=createListener('dashboard:'+_0x217567,_0x34919a);DashboardEvents['on'](_0x217567,_0x106184);}}; \ No newline at end of file +var _0x452a=['removeListener','register','length','dashboard:','./dashboard.events','save','update','emit'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0x452a,0x18c));var _0xa452=function(_0x53e3de,_0x13da7b){_0x53e3de=_0x53e3de-0x0;var _0x7b905b=_0x452a[_0x53e3de];return _0x7b905b;};'use strict';var DashboardEvents=require(_0xa452('0x0'));var events=[_0xa452('0x1'),'remove',_0xa452('0x2')];function createListener(_0x310ad7,_0xceccd5){return function(_0x1ead1d){_0xceccd5[_0xa452('0x3')](_0x310ad7,_0x1ead1d);};}function removeListener(_0x4f6375,_0x15fa22){return function(){DashboardEvents[_0xa452('0x4')](_0x4f6375,_0x15fa22);};}exports[_0xa452('0x5')]=function(_0x536c35){for(var _0x56b57c=0x0,_0x276d37=events[_0xa452('0x6')];_0x56b57c<_0x276d37;_0x56b57c++){var _0x35bf1d=events[_0x56b57c];var _0x137c7e=createListener(_0xa452('0x7')+_0x35bf1d,_0x536c35);DashboardEvents['on'](_0x35bf1d,_0x137c7e);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index d79a183..9dce22f 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 _0x70e0=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','isAuthenticated','show','get','/:id/items','getItems','post','/:id/clone','clone','addItem','put','/:id','multer'];(function(_0x1f8eb8,_0xfc4345){var _0x37ca05=function(_0x4595e2){while(--_0x4595e2){_0x1f8eb8['push'](_0x1f8eb8['shift']());}};_0x37ca05(++_0xfc4345);}(_0x70e0,0x17b));var _0x070e=function(_0xf522ba,_0x5c6302){_0xf522ba=_0xf522ba-0x0;var _0x394ec3=_0x70e0[_0xf522ba];return _0x394ec3;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x070e('0xd')](_0x070e('0xe'),auth[_0x070e('0x8')](),controller[_0x070e('0xf')]);router[_0x070e('0xd')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0x12'),auth[_0x070e('0x8')](),controller['update']);router['delete'](_0x070e('0x12'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd0bb=['post','clone','addItem','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create'];(function(_0x179a18,_0x1383b0){var _0x65d02e=function(_0x1eca91){while(--_0x1eca91){_0x179a18['push'](_0x179a18['shift']());}};_0x65d02e(++_0x1383b0);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0xd0bb[_0x5a7e3c];return _0x59252b;};'use strict';var multer=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var path=require(_0xbd0b('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd0b('0x3'));var router=express['Router']();var fs_extra=require(_0xbd0b('0x4'));var auth=require(_0xbd0b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd0b('0x6'));var controller=require('./dashboard.controller');router[_0xbd0b('0x7')]('/',auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x9')]);router[_0xbd0b('0x7')](_0xbd0b('0xa'),auth['isAuthenticated'](),controller[_0xbd0b('0xb')]);router[_0xbd0b('0x7')](_0xbd0b('0xc'),auth[_0xbd0b('0x8')](),controller[_0xbd0b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbd0b('0xe')]);router[_0xbd0b('0xf')]('/:id/clone',auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x10')]);router['post'](_0xbd0b('0xc'),auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x11')]);router[_0xbd0b('0x12')](_0xbd0b('0xa'),auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x13')]);router[_0xbd0b('0x14')](_0xbd0b('0xa'),auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index bb32ed0..851c830 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 _0x4597=['#2196f3','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','setDataValue','attrs','INTEGER','#ffffff'];(function(_0x42de00,_0xecc5db){var _0xcf8dc1=function(_0x5216f6){while(--_0x5216f6){_0x42de00['push'](_0x42de00['shift']());}};_0xcf8dc1(++_0xecc5db);}(_0x4597,0x194));var _0x7459=function(_0x4e5ff7,_0x1c555f){_0x4e5ff7=_0x4e5ff7-0x0;var _0xd3aec=_0x4597[_0x4e5ff7];return _0xd3aec;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x7459('0x0'));var _=require(_0x7459('0x1'));module[_0x7459('0x2')]={'title':{'type':Sequelize[_0x7459('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7459('0x4')](_0x7459('0x5')),'get':function(){try{return JSON[_0x7459('0x6')](this[_0x7459('0x7')]('attrs'));}catch(_0x4b17fd){return[];}},'set':function(_0x3eab8c){try{this['setDataValue']('attrs',JSON['stringify'](_0x3eab8c));}catch(_0x1d9232){this[_0x7459('0x8')](_0x7459('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x7459('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7459('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x7459('0x3')],'allowNull':![],'defaultValue':_0x7459('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x7459('0x3')],'allowNull':![],'defaultValue':_0x7459('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x3120=['stringify','INTEGER','#ffffff','#2196f3','sequelize','lodash','STRING','TEXT','parse','attrs','setDataValue'];(function(_0x17e651,_0x5b9d5a){var _0x48a900=function(_0x2c9a07){while(--_0x2c9a07){_0x17e651['push'](_0x17e651['shift']());}};_0x48a900(++_0x5b9d5a);}(_0x3120,0x101));var _0x0312=function(_0x2340e4,_0x26f13c){_0x2340e4=_0x2340e4-0x0;var _0x16c5d0=_0x3120[_0x2340e4];return _0x16c5d0;};'use strict';var Sequelize=require(_0x0312('0x0'));var squel=require('squel');var _=require(_0x0312('0x1'));module['exports']={'title':{'type':Sequelize[_0x0312('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0312('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x0312('0x3')]('long'),'get':function(){try{return JSON[_0x0312('0x4')](this['getDataValue'](_0x0312('0x5')));}catch(_0x509afd){return[];}},'set':function(_0x29df82){try{this[_0x0312('0x6')](_0x0312('0x5'),JSON[_0x0312('0x7')](_0x29df82));}catch(_0x3f667d){this['setDataValue'](_0x0312('0x5'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x0312('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x0312('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x0312('0x8')]},'col':{'type':Sequelize[_0x0312('0x8')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0312('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x0312('0x2')],'allowNull':![],'defaultValue':_0x0312('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x0312('0x2')]},'titleFontSize':{'type':Sequelize[_0x0312('0x8')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 89bc8f3..ccb0dcd 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 _0x63f9=['attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','save','update','destroy','then','stack','name','send','params','model','keys','query','filters','intersection','fields','attributes','length','include','merge','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart'];(function(_0x364539,_0x951f4a){var _0x21212b=function(_0xcfbb16){while(--_0xcfbb16){_0x364539['push'](_0x364539['shift']());}};_0x21212b(++_0x951f4a);}(_0x63f9,0x117));var _0x963f=function(_0x11ce6d,_0x47d623){_0x11ce6d=_0x11ce6d-0x0;var _0x5f18b1=_0x63f9[_0x11ce6d];return _0x5f18b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x963f('0x0'));var zipdir=require(_0x963f('0x1'));var jsonpatch=require(_0x963f('0x2'));var rp=require(_0x963f('0x3'));var moment=require(_0x963f('0x4'));var BPromise=require(_0x963f('0x5'));var Mustache=require('mustache');var util=require(_0x963f('0x6'));var path=require('path');var sox=require(_0x963f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x963f('0x8'));var squel=require(_0x963f('0x9'));var crypto=require('crypto');var jsforce=require(_0x963f('0xa'));var deskjs=require(_0x963f('0xb'));var toCsv=require(_0x963f('0xc'));var querystring=require(_0x963f('0xd'));var Papa=require(_0x963f('0xe'));var Redis=require('ioredis');var authService=require(_0x963f('0xf'));var qs=require(_0x963f('0x10'));var as=require(_0x963f('0x11'));var hardwareService=require(_0x963f('0x12'));var logger=require(_0x963f('0x13'))(_0x963f('0x14'));var utils=require('../../config/utils');var config=require(_0x963f('0x15'));var licenseUtil=require(_0x963f('0x16'));var db=require(_0x963f('0x17'))['db'];config['redis']=_[_0x963f('0x18')](config[_0x963f('0x19')],{'host':_0x963f('0x1a'),'port':0x18eb});var socket=require(_0x963f('0x1b'))(new Redis(config[_0x963f('0x19')]));require('./dashboardItem.socket')[_0x963f('0x1c')](socket);function respondWithStatusCode(_0x1ef24b,_0x322f51){_0x322f51=_0x322f51||0xcc;return function(_0xefb0ef){if(_0xefb0ef){return _0x1ef24b[_0x963f('0x1d')](_0x322f51);}return _0x1ef24b['status'](_0x322f51)[_0x963f('0x1e')]();};}function respondWithResult(_0x5b36b9,_0xd5a88d){_0xd5a88d=_0xd5a88d||0xc8;return function(_0xcde1ae){if(_0xcde1ae){return _0x5b36b9['status'](_0xd5a88d)[_0x963f('0x1f')](_0xcde1ae);}};}function respondWithFilteredResult(_0x2b568b,_0xf6d5f){return function(_0x1c1ca5){if(_0x1c1ca5){var _0x413e70=typeof _0xf6d5f[_0x963f('0x20')]===_0x963f('0x21')&&typeof _0xf6d5f['limit']===_0x963f('0x21');var _0x443cec=_0x1c1ca5['count'];var _0x129af5=_0x413e70?0x0:_0xf6d5f['offset'];var _0x22d41f=_0x413e70?_0x1c1ca5[_0x963f('0x22')]:_0xf6d5f[_0x963f('0x20')]+_0xf6d5f[_0x963f('0x23')];var _0x1d23d8;if(_0x22d41f>=_0x443cec){_0x22d41f=_0x443cec;_0x1d23d8=0xc8;}else{_0x1d23d8=0xce;}_0x2b568b[_0x963f('0x24')](_0x1d23d8);return _0x2b568b['set'](_0x963f('0x25'),_0x129af5+'-'+_0x22d41f+'/'+_0x443cec)['json'](_0x1c1ca5);}return null;};}function patchUpdates(_0x10c16f){return function(_0x164c08){try{jsonpatch[_0x963f('0x26')](_0x164c08,_0x10c16f,!![]);}catch(_0x4c9541){return BPromise['reject'](_0x4c9541);}return _0x164c08[_0x963f('0x27')]();};}function saveUpdates(_0x38e71f,_0x5de876){return function(_0x32011d){if(_0x32011d){return _0x32011d[_0x963f('0x28')](_0x38e71f)['then'](function(_0x3e698f){return _0x3e698f;});}return null;};}function removeEntity(_0x3d50e2,_0x4be47f){return function(_0x16152f){if(_0x16152f){return _0x16152f[_0x963f('0x29')]()[_0x963f('0x2a')](function(){_0x3d50e2['status'](0xcc)[_0x963f('0x1e')]();});}};}function handleEntityNotFound(_0x1ae792,_0x30f359){return function(_0x4f9f17){if(!_0x4f9f17){_0x1ae792[_0x963f('0x1d')](0x194);}return _0x4f9f17;};}function handleError(_0x1a1fdf,_0xdc0efc){_0xdc0efc=_0xdc0efc||0x1f4;return function(_0xe7dd3d){logger['error'](_0xe7dd3d[_0x963f('0x2b')]);if(_0xe7dd3d[_0x963f('0x2c')]){delete _0xe7dd3d[_0x963f('0x2c')];}_0x1a1fdf[_0x963f('0x24')](_0xdc0efc)[_0x963f('0x2d')](_0xe7dd3d);};}exports['show']=function(_0x26fc01,_0x3ff2dd){var _0x39184c={'raw':![],'where':{'id':_0x26fc01[_0x963f('0x2e')]['id']}},_0x2dc5d6={};_0x2dc5d6[_0x963f('0x2f')]=_[_0x963f('0x30')](db['DashboardItem']['rawAttributes']);_0x2dc5d6[_0x963f('0x31')]=_[_0x963f('0x30')](_0x26fc01[_0x963f('0x31')]);_0x2dc5d6[_0x963f('0x32')]=_[_0x963f('0x33')](_0x2dc5d6['model'],_0x2dc5d6[_0x963f('0x31')]);_0x39184c['attributes']=_[_0x963f('0x33')](_0x2dc5d6['model'],qs[_0x963f('0x34')](_0x26fc01['query'][_0x963f('0x34')]));_0x39184c[_0x963f('0x35')]=_0x39184c['attributes'][_0x963f('0x36')]?_0x39184c[_0x963f('0x35')]:_0x2dc5d6[_0x963f('0x2f')];if(_0x26fc01[_0x963f('0x31')]['includeAll']){_0x39184c[_0x963f('0x37')]=[{'all':!![]}];}_0x39184c=_[_0x963f('0x38')]({},_0x39184c,_0x26fc01[_0x963f('0x39')]);return db[_0x963f('0x3a')][_0x963f('0x3b')](_0x39184c)['then'](handleEntityNotFound(_0x3ff2dd,null))[_0x963f('0x2a')](respondWithResult(_0x3ff2dd,null))[_0x963f('0x3c')](handleError(_0x3ff2dd,null));};exports['destroy']=function(_0x2bea6c,_0x18be60){return db[_0x963f('0x3a')][_0x963f('0x3b')]({'where':{'id':_0x2bea6c['params']['id']}})['then'](handleEntityNotFound(_0x18be60,null))[_0x963f('0x2a')](removeEntity(_0x18be60,null))[_0x963f('0x3c')](handleError(_0x18be60,null));};function widgetAttributes(_0x568efd){try{switch(_0x568efd[_0x963f('0x3d')]){case _0x963f('0x3e'):return[{'name':_0x963f('0x3f'),'value':_0x568efd[_0x963f('0x3f')]||(_0x568efd['attrs']&&_0x568efd['attrs'][0x0]?_0x568efd[_0x963f('0x40')][0x0][_0x963f('0x41')]:undefined)||'https://'}];case _0x963f('0x42'):return[{'name':_0x963f('0x43'),'value':_0x568efd[_0x963f('0x43')]||(_0x568efd[_0x963f('0x40')]&&_0x568efd[_0x963f('0x40')][0x0]?_0x568efd[_0x963f('0x40')][0x0]['value']:undefined)||''}];case _0x963f('0x44'):return[{'name':_0x963f('0x45'),'value':_0x568efd[_0x963f('0x45')]||(_0x568efd['attrs']&&_0x568efd[_0x963f('0x40')][0x0]?_0x568efd[_0x963f('0x40')][0x0]['value']:undefined)||_0x963f('0x46')},{'name':_0x963f('0x47'),'value':_0x568efd[_0x963f('0x47')]||(_0x568efd[_0x963f('0x40')]&&_0x568efd['attrs'][0x1]?_0x568efd[_0x963f('0x40')][0x1]['value']:undefined)||'0.00'},{'name':_0x963f('0x48'),'value':_0x568efd[_0x963f('0x48')]||(_0x568efd['attrs']&&_0x568efd['attrs'][0x2]?_0x568efd['attrs'][0x2][_0x963f('0x41')]:undefined)||0xc}];case _0x963f('0x49'):return[{'name':_0x963f('0x4a'),'value':_0x568efd[_0x963f('0x4a')]||(_0x568efd['attrs']&&_0x568efd[_0x963f('0x40')][0x0]?_0x568efd[_0x963f('0x40')][0x0][_0x963f('0x41')]:undefined)||'total'},{'name':_0x963f('0x4b'),'value':_0x568efd[_0x963f('0x4b')]||(_0x568efd['attrs']&&_0x568efd[_0x963f('0x40')][0x1]?_0x568efd[_0x963f('0x40')][0x1][_0x963f('0x41')]:undefined)||[]},{'name':_0x963f('0x48'),'value':_0x568efd[_0x963f('0x48')]||(_0x568efd[_0x963f('0x40')]&&_0x568efd['attrs'][0x2]?_0x568efd['attrs'][0x2][_0x963f('0x41')]:undefined)||0x14}];case _0x963f('0x4c'):case'pie-chart':return[{'name':_0x963f('0x4d'),'value':_0x568efd['attrSerie1']||(_0x568efd[_0x963f('0x40')]&&_0x568efd['attrs'][0x0]?_0x568efd['attrs'][0x0]['value']:undefined)||_0x963f('0x4e')},{'name':_0x963f('0x4f'),'value':_0x568efd[_0x963f('0x4f')]||(_0x568efd[_0x963f('0x40')]&&_0x568efd[_0x963f('0x40')][0x1]?_0x568efd[_0x963f('0x40')][0x1][_0x963f('0x41')]:undefined)||null},{'name':_0x963f('0x50'),'value':_0x568efd[_0x963f('0x50')]||(_0x568efd[_0x963f('0x40')]&&_0x568efd[_0x963f('0x40')][0x2]?_0x568efd[_0x963f('0x40')][0x2][_0x963f('0x41')]:undefined)||null},{'name':_0x963f('0x4b'),'value':_0x568efd[_0x963f('0x4b')]||(_0x568efd[_0x963f('0x40')]&&_0x568efd['attrs'][0x3]?_0x568efd['attrs'][0x3][_0x963f('0x41')]:undefined)||[]}];case _0x963f('0x51'):return[{'name':_0x963f('0x52'),'type':_0x568efd[_0x963f('0x53')]||(_0x568efd[_0x963f('0x40')]&&_0x568efd[_0x963f('0x40')][0x0]?_0x568efd[_0x963f('0x40')][0x0][_0x963f('0x3d')]:undefined)||null,'value':_0x568efd[_0x963f('0x52')]||(_0x568efd[_0x963f('0x40')]&&_0x568efd[_0x963f('0x40')][0x0]?_0x568efd[_0x963f('0x40')][0x0][_0x963f('0x41')]:undefined)||null},{'name':_0x963f('0x54'),'value':_0x568efd[_0x963f('0x54')]||(_0x568efd[_0x963f('0x40')]&&_0x568efd[_0x963f('0x40')][0x1]?_0x568efd[_0x963f('0x40')][0x1][_0x963f('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x5466c1){logger[_0x963f('0x55')]('widgetAttributes:\x20%s',JSON[_0x963f('0x56')](_0x5466c1));return[];}}exports[_0x963f('0x57')]=function(_0x2cd46b,_0x202997){if(_0x2cd46b[_0x963f('0x58')]){_0x2cd46b['body'][_0x963f('0x40')]=widgetAttributes(_0x2cd46b['body']);}return db[_0x963f('0x3a')][_0x963f('0x57')](_0x2cd46b[_0x963f('0x58')],{})[_0x963f('0x2a')](respondWithResult(_0x202997,0xc9))[_0x963f('0x3c')](handleError(_0x202997,null));};exports[_0x963f('0x28')]=function(_0x50117e,_0x109432){if(_0x50117e[_0x963f('0x58')]['id']){delete _0x50117e[_0x963f('0x58')]['id'];}_0x50117e[_0x963f('0x58')][_0x963f('0x40')]=widgetAttributes(_0x50117e['body']);return db['DashboardItem'][_0x963f('0x3b')]({'where':{'id':_0x50117e[_0x963f('0x2e')]['id']}})[_0x963f('0x2a')](handleEntityNotFound(_0x109432,null))[_0x963f('0x2a')](saveUpdates(_0x50117e[_0x963f('0x58')],null))['then'](respondWithResult(_0x109432,null))[_0x963f('0x3c')](handleError(_0x109432,null));}; \ No newline at end of file +var _0x3472=['socket.io-emitter','./dashboardItem.socket','status','end','json','offset','undefined','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','DashboardItem','catch','find','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x141826,_0x425274){var _0x295c5f=function(_0x55d356){while(--_0x55d356){_0x141826['push'](_0x141826['shift']());}};_0x295c5f(++_0x425274);}(_0x3472,0xf2));var _0x2347=function(_0x5e3ebf,_0x53c12f){_0x5e3ebf=_0x5e3ebf-0x0;var _0x2ad81f=_0x3472[_0x5e3ebf];return _0x2ad81f;};'use strict';var emlformat=require(_0x2347('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2347('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2347('0x2'));var moment=require(_0x2347('0x3'));var BPromise=require(_0x2347('0x4'));var Mustache=require(_0x2347('0x5'));var util=require(_0x2347('0x6'));var path=require(_0x2347('0x7'));var sox=require(_0x2347('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2347('0x9'));var _=require(_0x2347('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2347('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2347('0xc'));var Papa=require(_0x2347('0xd'));var Redis=require(_0x2347('0xe'));var authService=require(_0x2347('0xf'));var qs=require(_0x2347('0x10'));var as=require(_0x2347('0x11'));var hardwareService=require(_0x2347('0x12'));var logger=require('../../config/logger')(_0x2347('0x13'));var utils=require('../../config/utils');var config=require(_0x2347('0x14'));var licenseUtil=require(_0x2347('0x15'));var db=require(_0x2347('0x16'))['db'];config[_0x2347('0x17')]=_[_0x2347('0x18')](config[_0x2347('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x2347('0x19'))(new Redis(config[_0x2347('0x17')]));require(_0x2347('0x1a'))['register'](socket);function respondWithStatusCode(_0x7f5637,_0x3a6e71){_0x3a6e71=_0x3a6e71||0xcc;return function(_0x24dd53){if(_0x24dd53){return _0x7f5637['sendStatus'](_0x3a6e71);}return _0x7f5637[_0x2347('0x1b')](_0x3a6e71)[_0x2347('0x1c')]();};}function respondWithResult(_0xca1d53,_0x34f529){_0x34f529=_0x34f529||0xc8;return function(_0x129dbb){if(_0x129dbb){return _0xca1d53[_0x2347('0x1b')](_0x34f529)[_0x2347('0x1d')](_0x129dbb);}};}function respondWithFilteredResult(_0x22057d,_0x3cdae7){return function(_0x4d9ea7){if(_0x4d9ea7){var _0x234888=typeof _0x3cdae7[_0x2347('0x1e')]===_0x2347('0x1f')&&typeof _0x3cdae7['limit']===_0x2347('0x1f');var _0x3f2a6e=_0x4d9ea7['count'];var _0xe96f28=_0x234888?0x0:_0x3cdae7['offset'];var _0x57f73e=_0x234888?_0x4d9ea7['count']:_0x3cdae7[_0x2347('0x1e')]+_0x3cdae7['limit'];var _0x13c9a8;if(_0x57f73e>=_0x3f2a6e){_0x57f73e=_0x3f2a6e;_0x13c9a8=0xc8;}else{_0x13c9a8=0xce;}_0x22057d[_0x2347('0x1b')](_0x13c9a8);return _0x22057d[_0x2347('0x20')](_0x2347('0x21'),_0xe96f28+'-'+_0x57f73e+'/'+_0x3f2a6e)['json'](_0x4d9ea7);}return null;};}function patchUpdates(_0x55871d){return function(_0x1151af){try{jsonpatch[_0x2347('0x22')](_0x1151af,_0x55871d,!![]);}catch(_0x5356cc){return BPromise[_0x2347('0x23')](_0x5356cc);}return _0x1151af[_0x2347('0x24')]();};}function saveUpdates(_0x402c34,_0x1a9a59){return function(_0x3a84be){if(_0x3a84be){return _0x3a84be[_0x2347('0x25')](_0x402c34)[_0x2347('0x26')](function(_0x496b3f){return _0x496b3f;});}return null;};}function removeEntity(_0x2f67b3,_0x5ad8e1){return function(_0x22dcee){if(_0x22dcee){return _0x22dcee[_0x2347('0x27')]()['then'](function(){_0x2f67b3['status'](0xcc)[_0x2347('0x1c')]();});}};}function handleEntityNotFound(_0x24a37d,_0x33331c){return function(_0x4bc2e5){if(!_0x4bc2e5){_0x24a37d[_0x2347('0x28')](0x194);}return _0x4bc2e5;};}function handleError(_0x1131f1,_0x4bcb33){_0x4bcb33=_0x4bcb33||0x1f4;return function(_0x43250b){logger[_0x2347('0x29')](_0x43250b[_0x2347('0x2a')]);if(_0x43250b['name']){delete _0x43250b['name'];}_0x1131f1[_0x2347('0x1b')](_0x4bcb33)[_0x2347('0x2b')](_0x43250b);};}exports[_0x2347('0x2c')]=function(_0x4fe588,_0x10ebcf){var _0xd7df1a={'raw':![],'where':{'id':_0x4fe588[_0x2347('0x2d')]['id']}},_0x29ae8b={};_0x29ae8b[_0x2347('0x2e')]=_[_0x2347('0x2f')](db['DashboardItem'][_0x2347('0x30')]);_0x29ae8b[_0x2347('0x31')]=_['keys'](_0x4fe588[_0x2347('0x31')]);_0x29ae8b['filters']=_[_0x2347('0x32')](_0x29ae8b[_0x2347('0x2e')],_0x29ae8b[_0x2347('0x31')]);_0xd7df1a[_0x2347('0x33')]=_[_0x2347('0x32')](_0x29ae8b['model'],qs[_0x2347('0x34')](_0x4fe588['query']['fields']));_0xd7df1a[_0x2347('0x33')]=_0xd7df1a[_0x2347('0x33')][_0x2347('0x35')]?_0xd7df1a[_0x2347('0x33')]:_0x29ae8b[_0x2347('0x2e')];if(_0x4fe588[_0x2347('0x31')][_0x2347('0x36')]){_0xd7df1a[_0x2347('0x37')]=[{'all':!![]}];}_0xd7df1a=_[_0x2347('0x38')]({},_0xd7df1a,_0x4fe588[_0x2347('0x39')]);return db[_0x2347('0x3a')]['find'](_0xd7df1a)[_0x2347('0x26')](handleEntityNotFound(_0x10ebcf,null))[_0x2347('0x26')](respondWithResult(_0x10ebcf,null))[_0x2347('0x3b')](handleError(_0x10ebcf,null));};exports[_0x2347('0x27')]=function(_0x4aa8a3,_0x54d3ee){return db[_0x2347('0x3a')][_0x2347('0x3c')]({'where':{'id':_0x4aa8a3[_0x2347('0x2d')]['id']}})[_0x2347('0x26')](handleEntityNotFound(_0x54d3ee,null))[_0x2347('0x26')](removeEntity(_0x54d3ee,null))['catch'](handleError(_0x54d3ee,null));};function widgetAttributes(_0x150704){try{switch(_0x150704[_0x2347('0x3d')]){case _0x2347('0x3e'):return[{'name':_0x2347('0x3f'),'value':_0x150704['attrUrl']||(_0x150704['attrs']&&_0x150704[_0x2347('0x40')][0x0]?_0x150704['attrs'][0x0][_0x2347('0x41')]:undefined)||_0x2347('0x42')}];case _0x2347('0x43'):return[{'name':'attrPath','value':_0x150704[_0x2347('0x44')]||(_0x150704['attrs']&&_0x150704['attrs'][0x0]?_0x150704[_0x2347('0x40')][0x0][_0x2347('0x41')]:undefined)||''}];case _0x2347('0x45'):return[{'name':_0x2347('0x46'),'value':_0x150704['attrHourFormat']||(_0x150704['attrs']&&_0x150704['attrs'][0x0]?_0x150704[_0x2347('0x40')][0x0][_0x2347('0x41')]:undefined)||_0x2347('0x47')},{'name':_0x2347('0x48'),'value':_0x150704[_0x2347('0x48')]||(_0x150704['attrs']&&_0x150704[_0x2347('0x40')][0x1]?_0x150704[_0x2347('0x40')][0x1][_0x2347('0x41')]:undefined)||_0x2347('0x49')},{'name':'attrFontSize','value':_0x150704[_0x2347('0x4a')]||(_0x150704['attrs']&&_0x150704[_0x2347('0x40')][0x2]?_0x150704[_0x2347('0x40')][0x2][_0x2347('0x41')]:undefined)||0xc}];case _0x2347('0x4b'):return[{'name':_0x2347('0x4c'),'value':_0x150704['attrMetric']||(_0x150704[_0x2347('0x40')]&&_0x150704['attrs'][0x0]?_0x150704[_0x2347('0x40')][0x0][_0x2347('0x41')]:undefined)||_0x2347('0x4d')},{'name':_0x2347('0x4e'),'value':_0x150704['attrVoiceQueues']||(_0x150704['attrs']&&_0x150704['attrs'][0x1]?_0x150704[_0x2347('0x40')][0x1][_0x2347('0x41')]:undefined)||[]},{'name':_0x2347('0x4a'),'value':_0x150704['attrFontSize']||(_0x150704[_0x2347('0x40')]&&_0x150704['attrs'][0x2]?_0x150704['attrs'][0x2][_0x2347('0x41')]:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0x150704[_0x2347('0x4f')]||(_0x150704['attrs']&&_0x150704[_0x2347('0x40')][0x0]?_0x150704[_0x2347('0x40')][0x0][_0x2347('0x41')]:undefined)||'total'},{'name':_0x2347('0x50'),'value':_0x150704[_0x2347('0x50')]||(_0x150704[_0x2347('0x40')]&&_0x150704[_0x2347('0x40')][0x1]?_0x150704[_0x2347('0x40')][0x1][_0x2347('0x41')]:undefined)||null},{'name':'attrSerie3','value':_0x150704[_0x2347('0x51')]||(_0x150704['attrs']&&_0x150704[_0x2347('0x40')][0x2]?_0x150704[_0x2347('0x40')][0x2][_0x2347('0x41')]:undefined)||null},{'name':_0x2347('0x4e'),'value':_0x150704[_0x2347('0x4e')]||(_0x150704[_0x2347('0x40')]&&_0x150704[_0x2347('0x40')][0x3]?_0x150704[_0x2347('0x40')][0x3][_0x2347('0x41')]:undefined)||[]}];case _0x2347('0x52'):return[{'name':_0x2347('0x53'),'type':_0x150704[_0x2347('0x54')]||(_0x150704[_0x2347('0x40')]&&_0x150704[_0x2347('0x40')][0x0]?_0x150704[_0x2347('0x40')][0x0][_0x2347('0x3d')]:undefined)||null,'value':_0x150704[_0x2347('0x53')]||(_0x150704[_0x2347('0x40')]&&_0x150704[_0x2347('0x40')][0x0]?_0x150704[_0x2347('0x40')][0x0][_0x2347('0x41')]:undefined)||null},{'name':'attrRefresh','value':_0x150704[_0x2347('0x55')]||(_0x150704['attrs']&&_0x150704[_0x2347('0x40')][0x1]?_0x150704[_0x2347('0x40')][0x1][_0x2347('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x4318c4){logger[_0x2347('0x29')]('widgetAttributes:\x20%s',JSON[_0x2347('0x56')](_0x4318c4));return[];}}exports[_0x2347('0x57')]=function(_0x30c250,_0x6d519a){if(_0x30c250[_0x2347('0x58')]){_0x30c250[_0x2347('0x58')][_0x2347('0x40')]=widgetAttributes(_0x30c250[_0x2347('0x58')]);}return db['DashboardItem'][_0x2347('0x57')](_0x30c250[_0x2347('0x58')],{})[_0x2347('0x26')](respondWithResult(_0x6d519a,0xc9))[_0x2347('0x3b')](handleError(_0x6d519a,null));};exports['update']=function(_0x342ae8,_0x27c83b){if(_0x342ae8[_0x2347('0x58')]['id']){delete _0x342ae8['body']['id'];}_0x342ae8[_0x2347('0x58')]['attrs']=widgetAttributes(_0x342ae8[_0x2347('0x58')]);return db['DashboardItem']['find']({'where':{'id':_0x342ae8[_0x2347('0x2d')]['id']}})[_0x2347('0x26')](handleEntityNotFound(_0x27c83b,null))[_0x2347('0x26')](saveUpdates(_0x342ae8[_0x2347('0x58')],null))[_0x2347('0x26')](respondWithResult(_0x27c83b,null))['catch'](handleError(_0x27c83b,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 112a16e..42b1520 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 _0x40d9=['../../mysqldb','DashboardItem','save','remove','emit','hasOwnProperty','exports'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0x40d9,0xa1));var _0x940d=function(_0x497e48,_0x3bc17a){_0x497e48=_0x497e48-0x0;var _0x30e579=_0x40d9[_0x497e48];return _0x30e579;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x940d('0x0'))['db'][_0x940d('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x940d('0x2'),'afterUpdate':'update','afterDestroy':_0x940d('0x3')};function emitEvent(_0x25fe66){return function(_0x340f2d,_0x1aed09,_0x5963ab){DashboardItemEvents[_0x940d('0x4')](_0x25fe66+':'+_0x340f2d['id'],_0x340f2d);DashboardItemEvents[_0x940d('0x4')](_0x25fe66,_0x340f2d);_0x5963ab(null);};}for(var e in events){if(events[_0x940d('0x5')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x940d('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0x5ec3=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x121919,_0x605f6f){var _0x6fe5bc=function(_0x23b061){while(--_0x23b061){_0x121919['push'](_0x121919['shift']());}};_0x6fe5bc(++_0x605f6f);}(_0x5ec3,0xa1));var _0x35ec=function(_0x337b3b,_0x2ac4b3){_0x337b3b=_0x337b3b-0x0;var _0x486e45=_0x5ec3[_0x337b3b];return _0x486e45;};'use strict';var EventEmitter=require(_0x35ec('0x0'));var DashboardItem=require(_0x35ec('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x35ec('0x2')](0x0);var events={'afterCreate':_0x35ec('0x3'),'afterUpdate':_0x35ec('0x4'),'afterDestroy':_0x35ec('0x5')};function emitEvent(_0x4c712b){return function(_0x3d7560,_0x3310d4,_0x43189c){DashboardItemEvents[_0x35ec('0x6')](_0x4c712b+':'+_0x3d7560['id'],_0x3d7560);DashboardItemEvents[_0x35ec('0x6')](_0x4c712b,_0x3d7560);_0x43189c(null);};}for(var e in events){if(events[_0x35ec('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x35ec('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 3196147..71b2e4a 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 _0x9626=['bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','dashboard_items','../../config/logger','moment'];(function(_0x7e55a4,_0x10ff38){var _0x1e152b=function(_0x58ec93){while(--_0x58ec93){_0x7e55a4['push'](_0x7e55a4['shift']());}};_0x1e152b(++_0x10ff38);}(_0x9626,0x170));var _0x6962=function(_0x3efde5,_0x5eacb8){_0x3efde5=_0x3efde5-0x0;var _0x5a20a6=_0x9626[_0x3efde5];return _0x5a20a6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6962('0x0'))('api');var moment=require(_0x6962('0x1'));var BPromise=require(_0x6962('0x2'));var rp=require(_0x6962('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6962('0x4'));var config=require(_0x6962('0x5'));var attributes=require(_0x6962('0x6'));module[_0x6962('0x7')]=function(_0xa09ed9,_0x3f45ec){return _0xa09ed9[_0x6962('0x8')]('DashboardItem',attributes,{'tableName':_0x6962('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc406=['moment','bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','../../config/logger','api'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xc406,0x135));var _0x6c40=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc406[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6c40('0x0'));var util=require('util');var logger=require(_0x6c40('0x1'))(_0x6c40('0x2'));var moment=require(_0x6c40('0x3'));var BPromise=require(_0x6c40('0x4'));var rp=require(_0x6c40('0x5'));var fs=require('fs');var path=require(_0x6c40('0x6'));var rimraf=require(_0x6c40('0x7'));var config=require('../../config/environment');var attributes=require(_0x6c40('0x8'));module[_0x6c40('0x9')]=function(_0x386b3b,_0x51ff14){return _0x386b3b[_0x6c40('0xa')](_0x6c40('0xb'),attributes,{'tableName':_0x6c40('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 65d5db3..e26cbee 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 _0x2587=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util'];(function(_0x2ba00c,_0x182642){var _0x21712b=function(_0x1bcf8e){while(--_0x1bcf8e){_0x2ba00c['push'](_0x2ba00c['shift']());}};_0x21712b(++_0x182642);}(_0x2587,0x12a));var _0x7258=function(_0x3f6426,_0x12cbf9){_0x3f6426=_0x3f6426-0x0;var _0x25d790=_0x2587[_0x3f6426];return _0x25d790;};'use strict';var _=require(_0x7258('0x0'));var util=require(_0x7258('0x1'));var moment=require(_0x7258('0x2'));var BPromise=require(_0x7258('0x3'));var rs=require(_0x7258('0x4'));var fs=require('fs');var Redis=require(_0x7258('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7258('0x6'));var logger=require('../../config/logger')(_0x7258('0x7'));var config=require(_0x7258('0x8'));var jayson=require(_0x7258('0x9'));var client=jayson[_0x7258('0xa')]['http']({'port':0x232a});config[_0x7258('0xb')]=_[_0x7258('0xc')](config[_0x7258('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7258('0xd'))(new Redis(config[_0x7258('0xb')]));require(_0x7258('0xe'))[_0x7258('0xf')](socket);function respondWithRpcPromise(_0x51c535,_0x296f1f,_0xad064e){return new BPromise(function(_0x4c8895,_0x5c015a){return client['request'](_0x51c535,_0xad064e)['then'](function(_0x471630){logger[_0x7258('0x10')](_0x7258('0x11'),_0x296f1f,'request\x20sent');logger[_0x7258('0x12')](_0x7258('0x13'),_0x296f1f,_0x7258('0x14'),JSON[_0x7258('0x15')](_0x471630));if(_0x471630[_0x7258('0x16')]){if(_0x471630[_0x7258('0x16')]['code']===0x1f4){logger[_0x7258('0x16')](_0x7258('0x11'),_0x296f1f,_0x471630[_0x7258('0x16')][_0x7258('0x17')]);return _0x5c015a(_0x471630[_0x7258('0x16')][_0x7258('0x17')]);}logger[_0x7258('0x16')]('DashboardItem,\x20%s,\x20%s',_0x296f1f,_0x471630[_0x7258('0x16')]['message']);return _0x4c8895(_0x471630[_0x7258('0x16')][_0x7258('0x17')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x296f1f,_0x7258('0x14'));_0x4c8895(_0x471630['result'][_0x7258('0x17')]);}})[_0x7258('0x18')](function(_0x235daf){logger[_0x7258('0x16')](_0x7258('0x11'),_0x296f1f,_0x235daf);_0x5c015a(_0x235daf);});});} \ No newline at end of file +var _0x18ea=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','info','result','message'];(function(_0x13ac69,_0x5d7dda){var _0x82d483=function(_0xac301){while(--_0xac301){_0x13ac69['push'](_0x13ac69['shift']());}};_0x82d483(++_0x5d7dda);}(_0x18ea,0x15d));var _0xa18e=function(_0x3f5e55,_0x32e285){_0x3f5e55=_0x3f5e55-0x0;var _0x1ae471=_0x18ea[_0x3f5e55];return _0x1ae471;};'use strict';var _=require(_0xa18e('0x0'));var util=require(_0xa18e('0x1'));var moment=require(_0xa18e('0x2'));var BPromise=require(_0xa18e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa18e('0x4'));var db=require(_0xa18e('0x5'))['db'];var utils=require(_0xa18e('0x6'));var logger=require(_0xa18e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa18e('0x8'));var client=jayson['client'][_0xa18e('0x9')]({'port':0x232a});config[_0xa18e('0xa')]=_[_0xa18e('0xb')](config[_0xa18e('0xa')],{'host':_0xa18e('0xc'),'port':0x18eb});var socket=require(_0xa18e('0xd'))(new Redis(config[_0xa18e('0xa')]));require(_0xa18e('0xe'))[_0xa18e('0xf')](socket);function respondWithRpcPromise(_0x54a9bb,_0x341194,_0x208898){return new BPromise(function(_0x3ce088,_0x45509d){return client[_0xa18e('0x10')](_0x54a9bb,_0x208898)[_0xa18e('0x11')](function(_0x48f870){logger['info'](_0xa18e('0x12'),_0x341194,_0xa18e('0x13'));logger[_0xa18e('0x14')](_0xa18e('0x15'),_0x341194,_0xa18e('0x13'),JSON[_0xa18e('0x16')](_0x48f870));if(_0x48f870[_0xa18e('0x17')]){if(_0x48f870['error'][_0xa18e('0x18')]===0x1f4){logger[_0xa18e('0x17')](_0xa18e('0x12'),_0x341194,_0x48f870[_0xa18e('0x17')]['message']);return _0x45509d(_0x48f870['error']['message']);}logger[_0xa18e('0x17')](_0xa18e('0x12'),_0x341194,_0x48f870[_0xa18e('0x17')]['message']);return _0x3ce088(_0x48f870[_0xa18e('0x17')]['message']);}else{logger[_0xa18e('0x19')](_0xa18e('0x12'),_0x341194,_0xa18e('0x13'));_0x3ce088(_0x48f870[_0xa18e('0x1a')][_0xa18e('0x1b')]);}})[_0xa18e('0x1c')](function(_0x510b5c){logger[_0xa18e('0x17')](_0xa18e('0x12'),_0x341194,_0x510b5c);_0x45509d(_0x510b5c);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index f5fb1fe..d41aa2f 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 _0xfa72=['removeListener','register','length','./dashboardItem.events','save','update','emit'];(function(_0x52ade0,_0x4e73a3){var _0x3241f1=function(_0x4779e5){while(--_0x4779e5){_0x52ade0['push'](_0x52ade0['shift']());}};_0x3241f1(++_0x4e73a3);}(_0xfa72,0x106));var _0x2fa7=function(_0x8632fe,_0x2bf5f8){_0x8632fe=_0x8632fe-0x0;var _0x57d9f8=_0xfa72[_0x8632fe];return _0x57d9f8;};'use strict';var DashboardItemEvents=require(_0x2fa7('0x0'));var events=[_0x2fa7('0x1'),'remove',_0x2fa7('0x2')];function createListener(_0x9686cf,_0x33b558){return function(_0x572212){_0x33b558[_0x2fa7('0x3')](_0x9686cf,_0x572212);};}function removeListener(_0x1c9981,_0x15241b){return function(){DashboardItemEvents[_0x2fa7('0x4')](_0x1c9981,_0x15241b);};}exports[_0x2fa7('0x5')]=function(_0x1b71ab){for(var _0x5baf15=0x0,_0x260b3e=events[_0x2fa7('0x6')];_0x5baf15<_0x260b3e;_0x5baf15++){var _0x4d7908=events[_0x5baf15];var _0x1e6488=createListener('dashboardItem:'+_0x4d7908,_0x1b71ab);DashboardItemEvents['on'](_0x4d7908,_0x1e6488);}}; \ No newline at end of file +var _0xd5f9=['dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener','length'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xd5f9,0x1f1));var _0x9d5f=function(_0x9f9ed5,_0x56f438){_0x9f9ed5=_0x9f9ed5-0x0;var _0xbc71e3=_0xd5f9[_0x9f9ed5];return _0xbc71e3;};'use strict';var DashboardItemEvents=require(_0x9d5f('0x0'));var events=[_0x9d5f('0x1'),_0x9d5f('0x2'),_0x9d5f('0x3')];function createListener(_0x4ed934,_0x3f3bb1){return function(_0x3e73bf){_0x3f3bb1[_0x9d5f('0x4')](_0x4ed934,_0x3e73bf);};}function removeListener(_0x42d201,_0x216344){return function(){DashboardItemEvents[_0x9d5f('0x5')](_0x42d201,_0x216344);};}exports['register']=function(_0x546c04){for(var _0x58edae=0x0,_0x1dca4b=events[_0x9d5f('0x6')];_0x58edae<_0x1dca4b;_0x58edae++){var _0x4ac60a=events[_0x58edae];var _0x402a35=createListener(_0x9d5f('0x7')+_0x4ac60a,_0x546c04);DashboardItemEvents['on'](_0x4ac60a,_0x402a35);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index b95a830..95c9c67 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 _0x0952=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','create','put','update','exports','multer'];(function(_0x1b1c4f,_0x32eb9c){var _0x3f02c1=function(_0x180c82){while(--_0x180c82){_0x1b1c4f['push'](_0x1b1c4f['shift']());}};_0x3f02c1(++_0x32eb9c);}(_0x0952,0xe0));var _0x2095=function(_0x46c850,_0xc659fc){_0x46c850=_0x46c850-0x0;var _0x17935e=_0x0952[_0x46c850];return _0x17935e;};'use strict';var multer=require(_0x2095('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2095('0x1'));var express=require(_0x2095('0x2'));var router=express[_0x2095('0x3')]();var fs_extra=require(_0x2095('0x4'));var auth=require(_0x2095('0x5'));var interaction=require(_0x2095('0x6'));var config=require(_0x2095('0x7'));var controller=require(_0x2095('0x8'));router['get'](_0x2095('0x9'),auth[_0x2095('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x2095('0xb')]);router[_0x2095('0xc')](_0x2095('0x9'),auth[_0x2095('0xa')](),controller[_0x2095('0xd')]);router['delete']('/:id',auth[_0x2095('0xa')](),controller['destroy']);module[_0x2095('0xe')]=router; \ No newline at end of file +var _0x05cd=['path','connect-timeout','Router','fs-extra','get','/:id','isAuthenticated','show','post','put','update','destroy','exports'];(function(_0x25251f,_0x3daefd){var _0x407213=function(_0x19a5ed){while(--_0x19a5ed){_0x25251f['push'](_0x25251f['shift']());}};_0x407213(++_0x3daefd);}(_0x05cd,0x145));var _0xd05c=function(_0x24a56a,_0x550eb7){_0x24a56a=_0x24a56a-0x0;var _0x4175c0=_0x05cd[_0x24a56a];return _0x4175c0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd05c('0x0'));var timeout=require(_0xd05c('0x1'));var express=require('express');var router=express[_0xd05c('0x2')]();var fs_extra=require(_0xd05c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0xd05c('0x4')](_0xd05c('0x5'),auth[_0xd05c('0x6')](),controller[_0xd05c('0x7')]);router[_0xd05c('0x8')]('/',auth[_0xd05c('0x6')](),controller['create']);router[_0xd05c('0x9')]('/:id',auth[_0xd05c('0x6')](),controller[_0xd05c('0xa')]);router['delete'](_0xd05c('0x5'),auth['isAuthenticated'](),controller[_0xd05c('0xb')]);module[_0xd05c('0xc')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 7c573dc..f33d547 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 _0x6037=['second','STRING','exports','first'];(function(_0x32821f,_0x10124b){var _0x16efef=function(_0x43bc23){while(--_0x43bc23){_0x32821f['push'](_0x32821f['shift']());}};_0x16efef(++_0x10124b);}(_0x6037,0xb6));var _0x7603=function(_0x11f8ea,_0x53ddb8){_0x11f8ea=_0x11f8ea-0x0;var _0x43321e=_0x6037[_0x11f8ea];return _0x43321e;};'use strict';var Sequelize=require('sequelize');module[_0x7603('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x7603('0x1'),_0x7603('0x2'),'third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x7603('0x3')]}}; \ No newline at end of file +var _0x4366=['exports','STRING','ENUM','first','second','sequelize'];(function(_0x90659e,_0x25f1c3){var _0x5c1d0a=function(_0x86f5dd){while(--_0x86f5dd){_0x90659e['push'](_0x90659e['shift']());}};_0x5c1d0a(++_0x25f1c3);}(_0x4366,0xd7));var _0x6436=function(_0x2ad955,_0xeae897){_0x2ad955=_0x2ad955-0x0;var _0x21a6db=_0x4366[_0x2ad955];return _0x21a6db;};'use strict';var Sequelize=require(_0x6436('0x0'));module[_0x6436('0x1')]={'name':{'type':Sequelize[_0x6436('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x6436('0x3')](_0x6436('0x4'),_0x6436('0x5'),'third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x6436('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index fd23645..d02815f 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 _0xfd0f=['type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','Disposition','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','get','Dispositions','UserProfileResource','sendStatus','error','name','index','rawAttributes','fieldName'];(function(_0x3d6721,_0x261121){var _0x1cfd87=function(_0x552fa2){while(--_0x552fa2){_0x3d6721['push'](_0x3d6721['shift']());}};_0x1cfd87(++_0x261121);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x17d7ea,_0x2e0974){_0x17d7ea=_0x17d7ea-0x0;var _0x243d72=_0xfd0f[_0x17d7ea];return _0x243d72;};'use strict';var emlformat=require(_0xffd0('0x0'));var rimraf=require(_0xffd0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffd0('0x2'));var rp=require(_0xffd0('0x3'));var moment=require(_0xffd0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xffd0('0x5'));var util=require('util');var path=require(_0xffd0('0x6'));var sox=require(_0xffd0('0x7'));var csv=require(_0xffd0('0x8'));var ejs=require(_0xffd0('0x9'));var fs=require('fs');var fs_extra=require(_0xffd0('0xa'));var _=require(_0xffd0('0xb'));var squel=require(_0xffd0('0xc'));var crypto=require(_0xffd0('0xd'));var jsforce=require(_0xffd0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xffd0('0x8'));var querystring=require(_0xffd0('0xf'));var Papa=require(_0xffd0('0x10'));var Redis=require(_0xffd0('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xffd0('0x12'));var hardwareService=require(_0xffd0('0x13'));var logger=require(_0xffd0('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xffd0('0x15'));var licenseUtil=require(_0xffd0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa6e1ad,_0xaf12c1){_0xaf12c1=_0xaf12c1||0xcc;return function(_0x2ca16d){if(_0x2ca16d){return _0xa6e1ad['sendStatus'](_0xaf12c1);}return _0xa6e1ad[_0xffd0('0x17')](_0xaf12c1)[_0xffd0('0x18')]();};}function respondWithResult(_0x5be5aa,_0x3cf549){_0x3cf549=_0x3cf549||0xc8;return function(_0x48fc60){if(_0x48fc60){return _0x5be5aa['status'](_0x3cf549)[_0xffd0('0x19')](_0x48fc60);}};}function respondWithFilteredResult(_0x5c799c,_0x321ceb){return function(_0x2e030d){if(_0x2e030d){var _0x15e710=typeof _0x321ceb[_0xffd0('0x1a')]===_0xffd0('0x1b')&&typeof _0x321ceb['limit']==='undefined';var _0x285c52=_0x2e030d[_0xffd0('0x1c')];var _0x2e9463=_0x15e710?0x0:_0x321ceb[_0xffd0('0x1a')];var _0x409b90=_0x15e710?_0x2e030d[_0xffd0('0x1c')]:_0x321ceb[_0xffd0('0x1a')]+_0x321ceb[_0xffd0('0x1d')];var _0x684579;if(_0x409b90>=_0x285c52){_0x409b90=_0x285c52;_0x684579=0xc8;}else{_0x684579=0xce;}_0x5c799c[_0xffd0('0x17')](_0x684579);return _0x5c799c[_0xffd0('0x1e')](_0xffd0('0x1f'),_0x2e9463+'-'+_0x409b90+'/'+_0x285c52)[_0xffd0('0x19')](_0x2e030d);}return null;};}function patchUpdates(_0x19c523){return function(_0x3deed6){try{jsonpatch[_0xffd0('0x20')](_0x3deed6,_0x19c523,!![]);}catch(_0x5219ca){return BPromise['reject'](_0x5219ca);}return _0x3deed6[_0xffd0('0x21')]();};}function saveUpdates(_0x13c117,_0x4fbb72){return function(_0x4f3cb3){if(_0x4f3cb3){return _0x4f3cb3[_0xffd0('0x22')](_0x13c117)['then'](function(_0x10467e){return _0x10467e;});}return null;};}function removeEntity(_0x329864,_0x2c8d64){return function(_0x38f25f){if(_0x38f25f){return _0x38f25f[_0xffd0('0x23')]()[_0xffd0('0x24')](function(){var _0x45edb3=_0x38f25f[_0xffd0('0x25')]({'plain':!![]});var _0x2e3046=_0xffd0('0x26');return db[_0xffd0('0x27')][_0xffd0('0x23')]({'where':{'type':_0x2e3046,'resourceId':_0x45edb3['id']}})[_0xffd0('0x24')](function(){return _0x38f25f;});})['then'](function(){_0x329864['status'](0xcc)[_0xffd0('0x18')]();});}};}function handleEntityNotFound(_0x4928ea,_0x5a7c44){return function(_0x142921){if(!_0x142921){_0x4928ea[_0xffd0('0x28')](0x194);}return _0x142921;};}function handleError(_0x3a28b7,_0xe8a70){_0xe8a70=_0xe8a70||0x1f4;return function(_0x3f5423){logger[_0xffd0('0x29')](_0x3f5423['stack']);if(_0x3f5423[_0xffd0('0x2a')]){delete _0x3f5423['name'];}_0x3a28b7['status'](_0xe8a70)['send'](_0x3f5423);};}exports[_0xffd0('0x2b')]=function(_0x896a70,_0x3b71ac){var _0xdb9da8={},_0x3bb309={},_0x326e8f={'count':0x0,'rows':[]};var _0x5c3be5=_['map'](db['Disposition'][_0xffd0('0x2c')],function(_0x5bb7f1){return{'name':_0x5bb7f1[_0xffd0('0x2d')],'type':_0x5bb7f1[_0xffd0('0x2e')]['key']};});_0x3bb309[_0xffd0('0x2f')]=_['map'](_0x5c3be5,'name');_0x3bb309['query']=_[_0xffd0('0x30')](_0x896a70[_0xffd0('0x31')]);_0x3bb309[_0xffd0('0x32')]=_[_0xffd0('0x33')](_0x3bb309[_0xffd0('0x2f')],_0x3bb309['query']);_0xdb9da8[_0xffd0('0x34')]=_[_0xffd0('0x33')](_0x3bb309['model'],qs[_0xffd0('0x35')](_0x896a70[_0xffd0('0x31')][_0xffd0('0x35')]));_0xdb9da8[_0xffd0('0x34')]=_0xdb9da8[_0xffd0('0x34')][_0xffd0('0x36')]?_0xdb9da8['attributes']:_0x3bb309[_0xffd0('0x2f')];if(!_0x896a70[_0xffd0('0x31')]['hasOwnProperty'](_0xffd0('0x37'))){_0xdb9da8[_0xffd0('0x1d')]=qs['limit'](_0x896a70[_0xffd0('0x31')][_0xffd0('0x1d')]);_0xdb9da8['offset']=qs[_0xffd0('0x1a')](_0x896a70['query'][_0xffd0('0x1a')]);}_0xdb9da8[_0xffd0('0x38')]=qs['sort'](_0x896a70[_0xffd0('0x31')][_0xffd0('0x39')]);_0xdb9da8[_0xffd0('0x3a')]=qs[_0xffd0('0x32')](_[_0xffd0('0x3b')](_0x896a70[_0xffd0('0x31')],_0x3bb309[_0xffd0('0x32')]),_0x5c3be5);if(_0x896a70[_0xffd0('0x31')][_0xffd0('0x3c')]){_0xdb9da8[_0xffd0('0x3a')]=_[_0xffd0('0x3d')](_0xdb9da8[_0xffd0('0x3a')],{'$or':_[_0xffd0('0x3e')](_0x5c3be5,function(_0x2ccb38){if(_0x2ccb38[_0xffd0('0x2e')]!==_0xffd0('0x3f')){var _0x338f04={};_0x338f04[_0x2ccb38['name']]={'$like':'%'+_0x896a70[_0xffd0('0x31')][_0xffd0('0x3c')]+'%'};return _0x338f04;}})});}_0xdb9da8=_[_0xffd0('0x3d')]({},_0xdb9da8,_0x896a70[_0xffd0('0x40')]);var _0x4e06ea={'where':_0xdb9da8['where']};return db[_0xffd0('0x41')][_0xffd0('0x1c')](_0x4e06ea)[_0xffd0('0x24')](function(_0xc0aa){_0x326e8f['count']=_0xc0aa;if(_0x896a70[_0xffd0('0x31')][_0xffd0('0x42')]){_0xdb9da8[_0xffd0('0x43')]=[{'all':!![]}];}return db[_0xffd0('0x41')][_0xffd0('0x44')](_0xdb9da8);})[_0xffd0('0x24')](function(_0x9558c0){_0x326e8f[_0xffd0('0x45')]=_0x9558c0;return _0x326e8f;})[_0xffd0('0x24')](respondWithFilteredResult(_0x3b71ac,_0xdb9da8))[_0xffd0('0x46')](handleError(_0x3b71ac,null));};exports[_0xffd0('0x47')]=function(_0x18ef0b,_0x236c1d){var _0x1f660c={'raw':!![],'where':{'id':_0x18ef0b[_0xffd0('0x48')]['id']}},_0x3a99d5={};_0x3a99d5[_0xffd0('0x2f')]=_[_0xffd0('0x30')](db[_0xffd0('0x41')][_0xffd0('0x2c')]);_0x3a99d5[_0xffd0('0x31')]=_['keys'](_0x18ef0b[_0xffd0('0x31')]);_0x3a99d5[_0xffd0('0x32')]=_[_0xffd0('0x33')](_0x3a99d5[_0xffd0('0x2f')],_0x3a99d5[_0xffd0('0x31')]);_0x1f660c[_0xffd0('0x34')]=_[_0xffd0('0x33')](_0x3a99d5[_0xffd0('0x2f')],qs[_0xffd0('0x35')](_0x18ef0b['query'][_0xffd0('0x35')]));_0x1f660c[_0xffd0('0x34')]=_0x1f660c[_0xffd0('0x34')][_0xffd0('0x36')]?_0x1f660c[_0xffd0('0x34')]:_0x3a99d5['model'];if(_0x18ef0b['query']['includeAll']){_0x1f660c[_0xffd0('0x43')]=[{'all':!![]}];}_0x1f660c=_[_0xffd0('0x3d')]({},_0x1f660c,_0x18ef0b['options']);return db[_0xffd0('0x41')][_0xffd0('0x49')](_0x1f660c)[_0xffd0('0x24')](handleEntityNotFound(_0x236c1d,null))[_0xffd0('0x24')](respondWithResult(_0x236c1d,null))[_0xffd0('0x46')](handleError(_0x236c1d,null));};exports[_0xffd0('0x4a')]=function(_0x3b70a7,_0x2c0ffd){return db[_0xffd0('0x41')][_0xffd0('0x4a')](_0x3b70a7[_0xffd0('0x4b')],{})[_0xffd0('0x24')](function(_0x300a52){var _0x57b453=_0x3b70a7['user'][_0xffd0('0x25')]({'plain':!![]});if(!_0x57b453)throw new Error(_0xffd0('0x4c'));if(_0x57b453[_0xffd0('0x4d')]==='user'){var _0x35b42e=_0x300a52['get']({'plain':!![]});var _0x31c80e=_0xffd0('0x26');return db[_0xffd0('0x4e')][_0xffd0('0x49')]({'where':{'name':_0x31c80e,'userProfileId':_0x57b453['userProfileId']},'raw':!![]})['then'](function(_0x57d072){if(_0x57d072&&_0x57d072[_0xffd0('0x4f')]===0x0){return db[_0xffd0('0x27')][_0xffd0('0x4a')]({'name':_0x35b42e[_0xffd0('0x2a')],'resourceId':_0x35b42e['id'],'type':_0x57d072[_0xffd0('0x2a')],'sectionId':_0x57d072['id']},{})[_0xffd0('0x24')](function(){return _0x300a52;});}else{return _0x300a52;}})[_0xffd0('0x46')](function(_0x4721a6){logger[_0xffd0('0x29')](_0xffd0('0x50'),_0x4721a6);throw _0x4721a6;});}return _0x300a52;})[_0xffd0('0x24')](respondWithResult(_0x2c0ffd,0xc9))[_0xffd0('0x46')](handleError(_0x2c0ffd,null));};exports['update']=function(_0x3ab6dd,_0x1521c9){if(_0x3ab6dd[_0xffd0('0x4b')]['id']){delete _0x3ab6dd[_0xffd0('0x4b')]['id'];}return db[_0xffd0('0x41')][_0xffd0('0x49')]({'where':{'id':_0x3ab6dd[_0xffd0('0x48')]['id']}})['then'](handleEntityNotFound(_0x1521c9,null))[_0xffd0('0x24')](saveUpdates(_0x3ab6dd[_0xffd0('0x4b')],null))[_0xffd0('0x24')](respondWithResult(_0x1521c9,null))[_0xffd0('0x46')](handleError(_0x1521c9,null));};exports['destroy']=function(_0x58acd3,_0x4b863e){return db[_0xffd0('0x41')][_0xffd0('0x49')]({'where':{'id':_0x58acd3[_0xffd0('0x48')]['id']}})[_0xffd0('0x24')](handleEntityNotFound(_0x4b863e,null))[_0xffd0('0x24')](removeEntity(_0x4b863e,null))[_0xffd0('0x46')](handleError(_0x4b863e,null));}; \ No newline at end of file +var _0xf6c1=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','name','send','index','map','Disposition','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x33975c,_0x50d085){var _0x1c15ab=function(_0x54e8bc){while(--_0x54e8bc){_0x33975c['push'](_0x33975c['shift']());}};_0x1c15ab(++_0x50d085);}(_0xf6c1,0x99));var _0x1f6c=function(_0x3815cf,_0x267f39){_0x3815cf=_0x3815cf-0x0;var _0x13e7ac=_0xf6c1[_0x3815cf];return _0x13e7ac;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1f6c('0x0'));var jsonpatch=require(_0x1f6c('0x1'));var rp=require(_0x1f6c('0x2'));var moment=require('moment');var BPromise=require(_0x1f6c('0x3'));var Mustache=require('mustache');var util=require(_0x1f6c('0x4'));var path=require(_0x1f6c('0x5'));var sox=require(_0x1f6c('0x6'));var csv=require(_0x1f6c('0x7'));var ejs=require(_0x1f6c('0x8'));var fs=require('fs');var fs_extra=require(_0x1f6c('0x9'));var _=require('lodash');var squel=require(_0x1f6c('0xa'));var crypto=require(_0x1f6c('0xb'));var jsforce=require(_0x1f6c('0xc'));var deskjs=require(_0x1f6c('0xd'));var toCsv=require(_0x1f6c('0x7'));var querystring=require(_0x1f6c('0xe'));var Papa=require(_0x1f6c('0xf'));var Redis=require(_0x1f6c('0x10'));var authService=require(_0x1f6c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f6c('0x12'))(_0x1f6c('0x13'));var utils=require(_0x1f6c('0x14'));var config=require(_0x1f6c('0x15'));var licenseUtil=require(_0x1f6c('0x16'));var db=require(_0x1f6c('0x17'))['db'];function respondWithStatusCode(_0x507a06,_0x7963a9){_0x7963a9=_0x7963a9||0xcc;return function(_0x1e7060){if(_0x1e7060){return _0x507a06[_0x1f6c('0x18')](_0x7963a9);}return _0x507a06[_0x1f6c('0x19')](_0x7963a9)[_0x1f6c('0x1a')]();};}function respondWithResult(_0x1315b7,_0x31fc67){_0x31fc67=_0x31fc67||0xc8;return function(_0x147c01){if(_0x147c01){return _0x1315b7['status'](_0x31fc67)[_0x1f6c('0x1b')](_0x147c01);}};}function respondWithFilteredResult(_0x302026,_0x26652b){return function(_0x43ce04){if(_0x43ce04){var _0xc8b6f2=typeof _0x26652b[_0x1f6c('0x1c')]==='undefined'&&typeof _0x26652b['limit']===_0x1f6c('0x1d');var _0x30a8dc=_0x43ce04['count'];var _0x2328f2=_0xc8b6f2?0x0:_0x26652b['offset'];var _0x31c887=_0xc8b6f2?_0x43ce04[_0x1f6c('0x1e')]:_0x26652b[_0x1f6c('0x1c')]+_0x26652b[_0x1f6c('0x1f')];var _0xd71b77;if(_0x31c887>=_0x30a8dc){_0x31c887=_0x30a8dc;_0xd71b77=0xc8;}else{_0xd71b77=0xce;}_0x302026[_0x1f6c('0x19')](_0xd71b77);return _0x302026[_0x1f6c('0x20')](_0x1f6c('0x21'),_0x2328f2+'-'+_0x31c887+'/'+_0x30a8dc)[_0x1f6c('0x1b')](_0x43ce04);}return null;};}function patchUpdates(_0x459944){return function(_0x44b1c5){try{jsonpatch[_0x1f6c('0x22')](_0x44b1c5,_0x459944,!![]);}catch(_0x196356){return BPromise[_0x1f6c('0x23')](_0x196356);}return _0x44b1c5[_0x1f6c('0x24')]();};}function saveUpdates(_0x55881f,_0x2644e9){return function(_0x511191){if(_0x511191){return _0x511191[_0x1f6c('0x25')](_0x55881f)[_0x1f6c('0x26')](function(_0x536eb6){return _0x536eb6;});}return null;};}function removeEntity(_0x1aa1f6,_0x4ef92a){return function(_0x32a812){if(_0x32a812){return _0x32a812[_0x1f6c('0x27')]()[_0x1f6c('0x26')](function(){var _0x185eb0=_0x32a812[_0x1f6c('0x28')]({'plain':!![]});var _0x386016=_0x1f6c('0x29');return db[_0x1f6c('0x2a')][_0x1f6c('0x27')]({'where':{'type':_0x386016,'resourceId':_0x185eb0['id']}})[_0x1f6c('0x26')](function(){return _0x32a812;});})['then'](function(){_0x1aa1f6[_0x1f6c('0x19')](0xcc)[_0x1f6c('0x1a')]();});}};}function handleEntityNotFound(_0x2b59b8,_0x5389e5){return function(_0x3374dc){if(!_0x3374dc){_0x2b59b8[_0x1f6c('0x18')](0x194);}return _0x3374dc;};}function handleError(_0x2ce9df,_0x30fdea){_0x30fdea=_0x30fdea||0x1f4;return function(_0xeaeccd){logger[_0x1f6c('0x2b')](_0xeaeccd['stack']);if(_0xeaeccd[_0x1f6c('0x2c')]){delete _0xeaeccd['name'];}_0x2ce9df[_0x1f6c('0x19')](_0x30fdea)[_0x1f6c('0x2d')](_0xeaeccd);};}exports[_0x1f6c('0x2e')]=function(_0x463543,_0xe574ac){var _0x497d8c={},_0x7a927a={},_0x47db8b={'count':0x0,'rows':[]};var _0x4ed20c=_[_0x1f6c('0x2f')](db[_0x1f6c('0x30')][_0x1f6c('0x31')],function(_0x29ad8d){return{'name':_0x29ad8d['fieldName'],'type':_0x29ad8d[_0x1f6c('0x32')][_0x1f6c('0x33')]};});_0x7a927a[_0x1f6c('0x34')]=_[_0x1f6c('0x2f')](_0x4ed20c,_0x1f6c('0x2c'));_0x7a927a['query']=_['keys'](_0x463543[_0x1f6c('0x35')]);_0x7a927a[_0x1f6c('0x36')]=_[_0x1f6c('0x37')](_0x7a927a[_0x1f6c('0x34')],_0x7a927a['query']);_0x497d8c[_0x1f6c('0x38')]=_['intersection'](_0x7a927a['model'],qs[_0x1f6c('0x39')](_0x463543[_0x1f6c('0x35')][_0x1f6c('0x39')]));_0x497d8c[_0x1f6c('0x38')]=_0x497d8c[_0x1f6c('0x38')][_0x1f6c('0x3a')]?_0x497d8c[_0x1f6c('0x38')]:_0x7a927a[_0x1f6c('0x34')];if(!_0x463543[_0x1f6c('0x35')][_0x1f6c('0x3b')](_0x1f6c('0x3c'))){_0x497d8c[_0x1f6c('0x1f')]=qs[_0x1f6c('0x1f')](_0x463543[_0x1f6c('0x35')][_0x1f6c('0x1f')]);_0x497d8c[_0x1f6c('0x1c')]=qs[_0x1f6c('0x1c')](_0x463543['query'][_0x1f6c('0x1c')]);}_0x497d8c[_0x1f6c('0x3d')]=qs[_0x1f6c('0x3e')](_0x463543[_0x1f6c('0x35')][_0x1f6c('0x3e')]);_0x497d8c['where']=qs['filters'](_[_0x1f6c('0x3f')](_0x463543[_0x1f6c('0x35')],_0x7a927a[_0x1f6c('0x36')]),_0x4ed20c);if(_0x463543[_0x1f6c('0x35')][_0x1f6c('0x40')]){_0x497d8c[_0x1f6c('0x41')]=_['merge'](_0x497d8c[_0x1f6c('0x41')],{'$or':_[_0x1f6c('0x2f')](_0x4ed20c,function(_0x23f4bd){if(_0x23f4bd[_0x1f6c('0x32')]!==_0x1f6c('0x42')){var _0x74d4a6={};_0x74d4a6[_0x23f4bd[_0x1f6c('0x2c')]]={'$like':'%'+_0x463543[_0x1f6c('0x35')]['filter']+'%'};return _0x74d4a6;}})});}_0x497d8c=_['merge']({},_0x497d8c,_0x463543[_0x1f6c('0x43')]);var _0x48c2a1={'where':_0x497d8c['where']};return db[_0x1f6c('0x30')][_0x1f6c('0x1e')](_0x48c2a1)[_0x1f6c('0x26')](function(_0x1a2fff){_0x47db8b[_0x1f6c('0x1e')]=_0x1a2fff;if(_0x463543[_0x1f6c('0x35')][_0x1f6c('0x44')]){_0x497d8c[_0x1f6c('0x45')]=[{'all':!![]}];}return db['Disposition'][_0x1f6c('0x46')](_0x497d8c);})['then'](function(_0x4b92ac){_0x47db8b[_0x1f6c('0x47')]=_0x4b92ac;return _0x47db8b;})[_0x1f6c('0x26')](respondWithFilteredResult(_0xe574ac,_0x497d8c))[_0x1f6c('0x48')](handleError(_0xe574ac,null));};exports['show']=function(_0x13034d,_0x4e2cdb){var _0x42ae1d={'raw':!![],'where':{'id':_0x13034d['params']['id']}},_0x2c7f71={};_0x2c7f71[_0x1f6c('0x34')]=_['keys'](db[_0x1f6c('0x30')][_0x1f6c('0x31')]);_0x2c7f71['query']=_[_0x1f6c('0x49')](_0x13034d['query']);_0x2c7f71['filters']=_[_0x1f6c('0x37')](_0x2c7f71['model'],_0x2c7f71[_0x1f6c('0x35')]);_0x42ae1d['attributes']=_[_0x1f6c('0x37')](_0x2c7f71[_0x1f6c('0x34')],qs[_0x1f6c('0x39')](_0x13034d['query'][_0x1f6c('0x39')]));_0x42ae1d[_0x1f6c('0x38')]=_0x42ae1d[_0x1f6c('0x38')]['length']?_0x42ae1d['attributes']:_0x2c7f71['model'];if(_0x13034d['query'][_0x1f6c('0x44')]){_0x42ae1d[_0x1f6c('0x45')]=[{'all':!![]}];}_0x42ae1d=_['merge']({},_0x42ae1d,_0x13034d['options']);return db[_0x1f6c('0x30')][_0x1f6c('0x4a')](_0x42ae1d)[_0x1f6c('0x26')](handleEntityNotFound(_0x4e2cdb,null))[_0x1f6c('0x26')](respondWithResult(_0x4e2cdb,null))[_0x1f6c('0x48')](handleError(_0x4e2cdb,null));};exports[_0x1f6c('0x4b')]=function(_0x508fdb,_0x303c50){return db[_0x1f6c('0x30')]['create'](_0x508fdb[_0x1f6c('0x4c')],{})[_0x1f6c('0x26')](function(_0x4bd86d){var _0x28a02a=_0x508fdb['user'][_0x1f6c('0x28')]({'plain':!![]});if(!_0x28a02a)throw new Error(_0x1f6c('0x4d'));if(_0x28a02a[_0x1f6c('0x4e')]==='user'){var _0xd4d0b1=_0x4bd86d[_0x1f6c('0x28')]({'plain':!![]});var _0x4b4621=_0x1f6c('0x29');return db['UserProfileSection'][_0x1f6c('0x4a')]({'where':{'name':_0x4b4621,'userProfileId':_0x28a02a[_0x1f6c('0x4f')]},'raw':!![]})[_0x1f6c('0x26')](function(_0x48f713){if(_0x48f713&&_0x48f713[_0x1f6c('0x50')]===0x0){return db[_0x1f6c('0x2a')]['create']({'name':_0xd4d0b1[_0x1f6c('0x2c')],'resourceId':_0xd4d0b1['id'],'type':_0x48f713['name'],'sectionId':_0x48f713['id']},{})[_0x1f6c('0x26')](function(){return _0x4bd86d;});}else{return _0x4bd86d;}})[_0x1f6c('0x48')](function(_0xd4d119){logger[_0x1f6c('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd4d119);throw _0xd4d119;});}return _0x4bd86d;})['then'](respondWithResult(_0x303c50,0xc9))['catch'](handleError(_0x303c50,null));};exports[_0x1f6c('0x25')]=function(_0x426761,_0x335974){if(_0x426761[_0x1f6c('0x4c')]['id']){delete _0x426761[_0x1f6c('0x4c')]['id'];}return db[_0x1f6c('0x30')][_0x1f6c('0x4a')]({'where':{'id':_0x426761[_0x1f6c('0x51')]['id']}})[_0x1f6c('0x26')](handleEntityNotFound(_0x335974,null))[_0x1f6c('0x26')](saveUpdates(_0x426761[_0x1f6c('0x4c')],null))[_0x1f6c('0x26')](respondWithResult(_0x335974,null))[_0x1f6c('0x48')](handleError(_0x335974,null));};exports[_0x1f6c('0x27')]=function(_0xc76c51,_0x38a288){return db[_0x1f6c('0x30')][_0x1f6c('0x4a')]({'where':{'id':_0xc76c51[_0x1f6c('0x51')]['id']}})['then'](handleEntityNotFound(_0x38a288,null))[_0x1f6c('0x26')](removeEntity(_0x38a288,null))['catch'](handleError(_0x38a288,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 9359567..ca44913 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 _0xafa5=['define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports'];(function(_0x3f52cb,_0x22ff7d){var _0x1f151a=function(_0x5d4bb8){while(--_0x5d4bb8){_0x3f52cb['push'](_0x3f52cb['shift']());}};_0x1f151a(++_0x22ff7d);}(_0xafa5,0x1af));var _0x5afa=function(_0x5bea60,_0x1c5008){_0x5bea60=_0x5bea60-0x0;var _0x15d89b=_0xafa5[_0x5bea60];return _0x15d89b;};'use strict';var _=require('lodash');var util=require(_0x5afa('0x0'));var logger=require(_0x5afa('0x1'))(_0x5afa('0x2'));var moment=require(_0x5afa('0x3'));var BPromise=require(_0x5afa('0x4'));var rp=require(_0x5afa('0x5'));var fs=require('fs');var path=require(_0x5afa('0x6'));var rimraf=require(_0x5afa('0x7'));var config=require(_0x5afa('0x8'));var attributes=require(_0x5afa('0x9'));module[_0x5afa('0xa')]=function(_0x58998c,_0x166388){return _0x58998c[_0x5afa('0xb')](_0x5afa('0xc'),attributes,{'tableName':_0x5afa('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x5afa('0xe'),'fields':[_0x5afa('0xf'),_0x5afa('0x10')]},{'unique':!![],'name':_0x5afa('0x11'),'fields':[_0x5afa('0xf'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x5afa('0xf'),_0x5afa('0x12')]},{'unique':!![],'name':_0x5afa('0x13'),'fields':[_0x5afa('0xf'),_0x5afa('0x14')]},{'unique':!![],'name':_0x5afa('0x15'),'fields':[_0x5afa('0xf'),_0x5afa('0x16')]},{'unique':!![],'name':'name_openchannel','fields':[_0x5afa('0xf'),_0x5afa('0x17')]},{'unique':!![],'name':_0x5afa('0x18'),'fields':[_0x5afa('0xf'),_0x5afa('0x19')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xef8b=['Disposition','name_voice','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define'];(function(_0x3e05d6,_0x4a1c4d){var _0x18c9c3=function(_0x2d99b3){while(--_0x2d99b3){_0x3e05d6['push'](_0x3e05d6['shift']());}};_0x18c9c3(++_0x4a1c4d);}(_0xef8b,0x192));var _0xbef8=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0xef8b[_0x49d19d];return _0x4ebef1;};'use strict';var _=require('lodash');var util=require(_0xbef8('0x0'));var logger=require(_0xbef8('0x1'))(_0xbef8('0x2'));var moment=require(_0xbef8('0x3'));var BPromise=require(_0xbef8('0x4'));var rp=require(_0xbef8('0x5'));var fs=require('fs');var path=require(_0xbef8('0x6'));var rimraf=require(_0xbef8('0x7'));var config=require(_0xbef8('0x8'));var attributes=require(_0xbef8('0x9'));module[_0xbef8('0xa')]=function(_0x550cb1,_0x1dd4a3){return _0x550cb1[_0xbef8('0xb')](_0xbef8('0xc'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xbef8('0xd'),'fields':[_0xbef8('0xe'),'ListId']},{'unique':!![],'name':'name_chat','fields':['name',_0xbef8('0xf')]},{'unique':!![],'name':_0xbef8('0x10'),'fields':[_0xbef8('0xe'),_0xbef8('0x11')]},{'unique':!![],'name':_0xbef8('0x12'),'fields':[_0xbef8('0xe'),_0xbef8('0x13')]},{'unique':!![],'name':_0xbef8('0x14'),'fields':[_0xbef8('0xe'),'FaxAccountId']},{'unique':!![],'name':_0xbef8('0x15'),'fields':[_0xbef8('0xe'),_0xbef8('0x16')]},{'unique':!![],'name':'name_whatsapp','fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 1c96059..7a2e017 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 _0x7142=['error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','client','http','request','then','Disposition,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x7142,0x181));var _0x2714=function(_0x247b83,_0x166650){_0x247b83=_0x247b83-0x0;var _0x179b6e=_0x7142[_0x247b83];return _0x179b6e;};'use strict';var _=require(_0x2714('0x0'));var util=require(_0x2714('0x1'));var moment=require(_0x2714('0x2'));var BPromise=require(_0x2714('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2714('0x4'));var db=require(_0x2714('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2714('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2714('0x7')][_0x2714('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x588c3b,_0x39b473,_0x5186dd){return new BPromise(function(_0x4a2d11,_0x96a0ae){return client[_0x2714('0x9')](_0x588c3b,_0x5186dd)[_0x2714('0xa')](function(_0x35885a){logger['info'](_0x2714('0xb'),_0x39b473,_0x2714('0xc'));logger['debug']('Disposition,\x20%s,\x20%s,\x20%s',_0x39b473,_0x2714('0xc'),JSON[_0x2714('0xd')](_0x35885a));if(_0x35885a[_0x2714('0xe')]){if(_0x35885a[_0x2714('0xe')][_0x2714('0xf')]===0x1f4){logger[_0x2714('0xe')]('Disposition,\x20%s,\x20%s',_0x39b473,_0x35885a[_0x2714('0xe')][_0x2714('0x10')]);return _0x96a0ae(_0x35885a[_0x2714('0xe')][_0x2714('0x10')]);}logger[_0x2714('0xe')](_0x2714('0xb'),_0x39b473,_0x35885a[_0x2714('0xe')][_0x2714('0x10')]);return _0x4a2d11(_0x35885a[_0x2714('0xe')][_0x2714('0x10')]);}else{logger[_0x2714('0x11')](_0x2714('0xb'),_0x39b473,_0x2714('0xc'));_0x4a2d11(_0x35885a[_0x2714('0x12')][_0x2714('0x10')]);}})['catch'](function(_0x3cc717){logger['error'](_0x2714('0xb'),_0x39b473,_0x3cc717);_0x96a0ae(_0x3cc717);});});} \ No newline at end of file +var _0xbf80=['jayson/promise','client','http','request','Disposition,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2e5a8c,_0x35f4bf){var _0x5816ec=function(_0x27cf55){while(--_0x27cf55){_0x2e5a8c['push'](_0x2e5a8c['shift']());}};_0x5816ec(++_0x35f4bf);}(_0xbf80,0x13d));var _0x0bf8=function(_0x254d9f,_0x54ddb5){_0x254d9f=_0x254d9f-0x0;var _0x1eedb9=_0xbf80[_0x254d9f];return _0x1eedb9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0bf8('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bf8('0x1'));var db=require(_0x0bf8('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bf8('0x3'))(_0x0bf8('0x4'));var config=require(_0x0bf8('0x5'));var jayson=require(_0x0bf8('0x6'));var client=jayson[_0x0bf8('0x7')][_0x0bf8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14f7c4,_0x4261e8,_0x2b1a70){return new BPromise(function(_0x5a54dc,_0xbce7ce){return client[_0x0bf8('0x9')](_0x14f7c4,_0x2b1a70)['then'](function(_0x2a1a15){logger['info'](_0x0bf8('0xa'),_0x4261e8,'request\x20sent');logger['debug']('Disposition,\x20%s,\x20%s,\x20%s',_0x4261e8,_0x0bf8('0xb'),JSON[_0x0bf8('0xc')](_0x2a1a15));if(_0x2a1a15['error']){if(_0x2a1a15[_0x0bf8('0xd')][_0x0bf8('0xe')]===0x1f4){logger[_0x0bf8('0xd')]('Disposition,\x20%s,\x20%s',_0x4261e8,_0x2a1a15['error'][_0x0bf8('0xf')]);return _0xbce7ce(_0x2a1a15[_0x0bf8('0xd')][_0x0bf8('0xf')]);}logger[_0x0bf8('0xd')]('Disposition,\x20%s,\x20%s',_0x4261e8,_0x2a1a15[_0x0bf8('0xd')][_0x0bf8('0xf')]);return _0x5a54dc(_0x2a1a15[_0x0bf8('0xd')][_0x0bf8('0xf')]);}else{logger['info'](_0x0bf8('0xa'),_0x4261e8,_0x0bf8('0xb'));_0x5a54dc(_0x2a1a15[_0x0bf8('0x10')][_0x0bf8('0xf')]);}})['catch'](function(_0x418106){logger['error'](_0x0bf8('0xa'),_0x4261e8,_0x418106);_0xbce7ce(_0x418106);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 509fd77..da33ec8 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 _0x763c=['isAuthenticated','get','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller'];(function(_0x1a8755,_0x2f4259){var _0x4b4599=function(_0xb749e3){while(--_0xb749e3){_0x1a8755['push'](_0x1a8755['shift']());}};_0x4b4599(++_0x2f4259);}(_0x763c,0x172));var _0xc763=function(_0x3ecc36,_0x30e780){_0x3ecc36=_0x3ecc36-0x0;var _0x57816f=_0x763c[_0x3ecc36];return _0x57816f;};'use strict';var multer=require(_0xc763('0x0'));var util=require(_0xc763('0x1'));var path=require(_0xc763('0x2'));var timeout=require(_0xc763('0x3'));var express=require('express');var router=express[_0xc763('0x4')]();var fs_extra=require(_0xc763('0x5'));var auth=require(_0xc763('0x6'));var interaction=require(_0xc763('0x7'));var config=require(_0xc763('0x8'));var controller=require(_0xc763('0x9'));router['get']('/',auth[_0xc763('0xa')](),controller['index']);router[_0xc763('0xb')](_0xc763('0xc'),auth[_0xc763('0xa')](),controller[_0xc763('0xd')]);router[_0xc763('0xe')]('/',auth[_0xc763('0xa')](),controller[_0xc763('0xf')]);router[_0xc763('0x10')](_0xc763('0xc'),auth[_0xc763('0xa')](),controller[_0xc763('0x11')]);router[_0xc763('0x12')]('/:id',auth[_0xc763('0xa')](),controller['destroy']);module[_0xc763('0x13')]=router; \ No newline at end of file +var _0x917d=['exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./disposition.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','destroy'];(function(_0x1dad80,_0x8c40e1){var _0x26fc90=function(_0x388fc6){while(--_0x388fc6){_0x1dad80['push'](_0x1dad80['shift']());}};_0x26fc90(++_0x8c40e1);}(_0x917d,0x1d5));var _0xd917=function(_0x2ff359,_0x173237){_0x2ff359=_0x2ff359-0x0;var _0x15df72=_0x917d[_0x2ff359];return _0x15df72;};'use strict';var multer=require(_0xd917('0x0'));var util=require(_0xd917('0x1'));var path=require('path');var timeout=require(_0xd917('0x2'));var express=require(_0xd917('0x3'));var router=express[_0xd917('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd917('0x5'));var config=require('../../config/environment');var controller=require(_0xd917('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd917('0x7')]);router[_0xd917('0x8')](_0xd917('0x9'),auth[_0xd917('0xa')](),controller[_0xd917('0xb')]);router[_0xd917('0xc')]('/',auth[_0xd917('0xa')](),controller[_0xd917('0xd')]);router[_0xd917('0xe')](_0xd917('0x9'),auth['isAuthenticated'](),controller[_0xd917('0xf')]);router['delete'](_0xd917('0x9'),auth[_0xd917('0xa')](),controller[_0xd917('0x10')]);module[_0xd917('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 594f416..2b09177 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 _0x4777=['BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING','ENUM','yes','localstationid','2400','4800','9600','12000','14400','7200','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x49d610,_0x3b14e2){var _0x4c6a73=function(_0x2f3215){while(--_0x2f3215){_0x49d610['push'](_0x49d610['shift']());}};_0x4c6a73(++_0x3b14e2);}(_0x4777,0xd4));var _0x7477=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x4777[_0x1a8f86];return _0x20d876;};'use strict';var Sequelize=require(_0x7477('0x0'));module['exports']={'name':{'type':Sequelize[_0x7477('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7477('0x1')]},'ecm':{'type':Sequelize[_0x7477('0x2')](_0x7477('0x3'),'no'),'defaultValue':_0x7477('0x3')},'headerinfo':{'type':Sequelize[_0x7477('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x7477('0x1')],'unique':_0x7477('0x4')},'minrate':{'type':Sequelize[_0x7477('0x2')](_0x7477('0x5'),_0x7477('0x6'),'7200',_0x7477('0x7'),_0x7477('0x8'),_0x7477('0x9')),'defaultValue':_0x7477('0x6')},'maxrate':{'type':Sequelize[_0x7477('0x2')](_0x7477('0x5'),'4800',_0x7477('0xa'),_0x7477('0x7'),_0x7477('0x8'),_0x7477('0x9')),'defaultValue':_0x7477('0x9')},'modem':{'type':Sequelize[_0x7477('0x1')],'defaultValue':_0x7477('0xb')},'gateway':{'type':Sequelize[_0x7477('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x7477('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x7477('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x7477('0x2')](_0x7477('0xd'),_0x7477('0xe'),_0x7477('0xf'),_0x7477('0x10')),'defaultValue':_0x7477('0xd')},'key':{'type':Sequelize[_0x7477('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7477('0x11');}},'notificationSound':{'type':Sequelize[_0x7477('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7477('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7477('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7477('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7477('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7477('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7477('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x7477('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x7477('0x12')],'defaultValue':![],'comment':_0x7477('0x14'),'set':function(_0x4e2372){if(!_0x4e2372)this[_0x7477('0x15')]('mandatoryDispositionPauseId',null);this[_0x7477('0x15')](_0x7477('0x16'),_0x4e2372);}}}; \ No newline at end of file +var _0x050b=['2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0x050b,0xb9));var _0xb050=function(_0x5925e8,_0x224c3e){_0x5925e8=_0x5925e8-0x0;var _0x459b02=_0x050b[_0x5925e8];return _0x459b02;};'use strict';var Sequelize=require(_0xb050('0x0'));module[_0xb050('0x1')]={'name':{'type':Sequelize[_0xb050('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb050('0x2')]},'ecm':{'type':Sequelize[_0xb050('0x3')](_0xb050('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xb050('0x2')],'defaultValue':_0xb050('0x5')},'localstationid':{'type':Sequelize[_0xb050('0x2')],'unique':_0xb050('0x6')},'minrate':{'type':Sequelize[_0xb050('0x3')](_0xb050('0x7'),_0xb050('0x8'),_0xb050('0x9'),_0xb050('0xa'),_0xb050('0xb'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0xb050('0x7'),_0xb050('0x8'),'7200',_0xb050('0xa'),'12000',_0xb050('0xc')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xb050('0x2')],'defaultValue':_0xb050('0xd')},'gateway':{'type':Sequelize[_0xb050('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb050('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb050('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xb050('0x3')](_0xb050('0xf'),_0xb050('0x10'),'DADHI',_0xb050('0x11')),'defaultValue':_0xb050('0xf')},'key':{'type':Sequelize[_0xb050('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb050('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb050('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb050('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb050('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb050('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb050('0xe')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb050('0x13')],'defaultValue':![],'comment':_0xb050('0x14'),'set':function(_0x3546d8){if(!_0x3546d8)this[_0xb050('0x15')](_0xb050('0x16'),null);this[_0xb050('0x15')](_0xb050('0x17'),_0x3546d8);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 42719d3..37a5a6f 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 _0x341d=['model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','nolimit','removeAnswers','FaxInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','push','CDR(type)=inbound-fax','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','Set','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','VoiceExtension','updateAccountApplications','tech','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','Contacts','updatedAt','DESC','attachments','join','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','CmContact','List\x20not\x20found','Send\x20Fax\x20failed','user','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','User','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','Pause','map','FaxAccount','fieldName','type','key','query','keys','filters'];(function(_0x2ac32d,_0xd00c08){var _0x200bc5=function(_0x393dd5){while(--_0x393dd5){_0x2ac32d['push'](_0x2ac32d['shift']());}};_0x200bc5(++_0xd00c08);}(_0x341d,0x83));var _0xd341=function(_0x31d1d6,_0x2c9544){_0x31d1d6=_0x31d1d6-0x0;var _0x242bc9=_0x341d[_0x31d1d6];return _0x242bc9;};'use strict';var emlformat=require(_0xd341('0x0'));var rimraf=require(_0xd341('0x1'));var zipdir=require(_0xd341('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd341('0x3'));var moment=require(_0xd341('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd341('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd341('0x6'));var csv=require('to-csv');var ejs=require(_0xd341('0x7'));var fs=require('fs');var fs_extra=require(_0xd341('0x8'));var _=require(_0xd341('0x9'));var squel=require(_0xd341('0xa'));var crypto=require(_0xd341('0xb'));var jsforce=require(_0xd341('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd341('0xd'));var querystring=require(_0xd341('0xe'));var Papa=require('papaparse');var Redis=require(_0xd341('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd341('0x10'));var logger=require(_0xd341('0x11'))(_0xd341('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd341('0x13'));var db=require(_0xd341('0x14'))['db'];config[_0xd341('0x15')]=_[_0xd341('0x16')](config[_0xd341('0x15')],{'host':_0xd341('0x17'),'port':0x18eb});var socket=require(_0xd341('0x18'))(new Redis(config[_0xd341('0x15')]));require(_0xd341('0x19'))[_0xd341('0x1a')](socket);var jayson=require(_0xd341('0x1b'));var client=jayson[_0xd341('0x1c')][_0xd341('0x1d')]({'port':0x232c});var client9002=jayson[_0xd341('0x1c')][_0xd341('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xaa3581,_0xb85bfc,_0x4448f8,_0x3ee18e){return new BPromise(function(_0x4ed527,_0x1ee17e){var _0x3a3ede=_0x3ee18e||client;return _0x3a3ede['request'](_0xaa3581,_0x4448f8)[_0xd341('0x1e')](function(_0x2a22bf){logger['info'](_0xd341('0x1f'),_0xb85bfc,'request\x20sent');logger[_0xd341('0x20')](_0xd341('0x21'),_0xb85bfc,'request\x20sent',JSON[_0xd341('0x22')](_0x2a22bf));if(_0x2a22bf[_0xd341('0x23')]){if(_0x2a22bf[_0xd341('0x23')][_0xd341('0x24')]===0x1f4){logger[_0xd341('0x23')](_0xd341('0x1f'),_0xb85bfc,_0x2a22bf['error'][_0xd341('0x25')]);return _0x1ee17e(_0x2a22bf[_0xd341('0x23')][_0xd341('0x25')]);}logger[_0xd341('0x23')]('FaxAccount,\x20%s,\x20%s',_0xb85bfc,_0x2a22bf[_0xd341('0x23')][_0xd341('0x25')]);return _0x4ed527(_0x2a22bf[_0xd341('0x23')][_0xd341('0x25')]);}else{logger[_0xd341('0x26')](_0xd341('0x1f'),_0xb85bfc,_0xd341('0x27'));_0x4ed527(_0x2a22bf[_0xd341('0x28')][_0xd341('0x25')]);}})[_0xd341('0x29')](function(_0x3ee8ef){logger[_0xd341('0x23')]('FaxAccount,\x20%s,\x20%s',_0xb85bfc,_0x3ee8ef);_0x1ee17e(_0x3ee8ef);});});}function respondWithStatusCode(_0x47b8b3,_0x4df4d3){_0x4df4d3=_0x4df4d3||0xcc;return function(_0x2a4120){if(_0x2a4120){return _0x47b8b3['sendStatus'](_0x4df4d3);}return _0x47b8b3['status'](_0x4df4d3)[_0xd341('0x2a')]();};}function respondWithResult(_0x3092dc,_0x22875b){_0x22875b=_0x22875b||0xc8;return function(_0x1bfdc3){if(_0x1bfdc3){return _0x3092dc[_0xd341('0x2b')](_0x22875b)[_0xd341('0x2c')](_0x1bfdc3);}};}function respondWithFilteredResult(_0x5c956f,_0xf7a42b){return function(_0x164288){if(_0x164288){var _0x4859fa=typeof _0xf7a42b['offset']===_0xd341('0x2d')&&typeof _0xf7a42b[_0xd341('0x2e')]==='undefined';var _0x1e33a1=_0x164288[_0xd341('0x2f')];var _0x16ef31=_0x4859fa?0x0:_0xf7a42b['offset'];var _0x41ea67=_0x4859fa?_0x164288[_0xd341('0x2f')]:_0xf7a42b[_0xd341('0x30')]+_0xf7a42b['limit'];var _0x486471;if(_0x41ea67>=_0x1e33a1){_0x41ea67=_0x1e33a1;_0x486471=0xc8;}else{_0x486471=0xce;}_0x5c956f[_0xd341('0x2b')](_0x486471);return _0x5c956f[_0xd341('0x31')](_0xd341('0x32'),_0x16ef31+'-'+_0x41ea67+'/'+_0x1e33a1)[_0xd341('0x2c')](_0x164288);}return null;};}function patchUpdates(_0x335c45){return function(_0x191272){try{jsonpatch[_0xd341('0x33')](_0x191272,_0x335c45,!![]);}catch(_0x23c763){return BPromise[_0xd341('0x34')](_0x23c763);}return _0x191272[_0xd341('0x35')]();};}function saveUpdates(_0x3e75d7,_0x4f1af6){return function(_0x29af3b){if(_0x29af3b){return _0x29af3b[_0xd341('0x36')](_0x3e75d7)['then'](function(_0x2ba757){return _0x2ba757;});}return null;};}function removeEntity(_0x20f8a0,_0x1bb18e){return function(_0x326a80){if(_0x326a80){return _0x326a80[_0xd341('0x37')]()[_0xd341('0x1e')](function(){var _0x169b40=_0x326a80[_0xd341('0x38')]({'plain':!![]});var _0x32e464='FaxAccounts';return db['UserProfileResource'][_0xd341('0x37')]({'where':{'type':_0x32e464,'resourceId':_0x169b40['id']}})[_0xd341('0x1e')](function(){return _0x326a80;});})[_0xd341('0x1e')](function(){_0x20f8a0[_0xd341('0x2b')](0xcc)[_0xd341('0x2a')]();});}};}function handleEntityNotFound(_0x5bcd6d,_0x207f31){return function(_0x2273ef){if(!_0x2273ef){_0x5bcd6d['sendStatus'](0x194);}return _0x2273ef;};}function handleError(_0x598aa0,_0x30ec19){_0x30ec19=_0x30ec19||0x1f4;return function(_0x5c7e82){logger[_0xd341('0x23')](_0x5c7e82['stack']);if(_0x5c7e82['name']){delete _0x5c7e82['name'];}_0x598aa0['status'](_0x30ec19)['send'](_0x5c7e82);};}exports['index']=function(_0x5a2267,_0x2dfe52){var _0x568189={'include':[{'model':db[_0xd341('0x39')],'as':'mandatoryDispositionPause'}]},_0x556a10={},_0x1c955b={'count':0x0,'rows':[]};var _0x243e79=_[_0xd341('0x3a')](db[_0xd341('0x3b')]['rawAttributes'],function(_0x164531){return{'name':_0x164531[_0xd341('0x3c')],'type':_0x164531[_0xd341('0x3d')][_0xd341('0x3e')]};});_0x556a10['model']=_['map'](_0x243e79,'name');_0x556a10[_0xd341('0x3f')]=_[_0xd341('0x40')](_0x5a2267['query']);_0x556a10[_0xd341('0x41')]=_['intersection'](_0x556a10[_0xd341('0x42')],_0x556a10['query']);_0x568189['attributes']=_[_0xd341('0x43')](_0x556a10[_0xd341('0x42')],qs[_0xd341('0x44')](_0x5a2267['query'][_0xd341('0x44')]));_0x568189['attributes']=_0x568189[_0xd341('0x45')][_0xd341('0x46')]?_0x568189[_0xd341('0x45')]:_0x556a10['model'];if(!_0x5a2267[_0xd341('0x3f')][_0xd341('0x47')]('nolimit')){_0x568189['limit']=qs[_0xd341('0x2e')](_0x5a2267[_0xd341('0x3f')]['limit']);_0x568189[_0xd341('0x30')]=qs[_0xd341('0x30')](_0x5a2267[_0xd341('0x3f')][_0xd341('0x30')]);}_0x568189[_0xd341('0x48')]=qs[_0xd341('0x49')](_0x5a2267['query'][_0xd341('0x49')]);_0x568189[_0xd341('0x4a')]=qs[_0xd341('0x41')](_[_0xd341('0x4b')](_0x5a2267[_0xd341('0x3f')],_0x556a10[_0xd341('0x41')]),_0x243e79);if(_0x5a2267[_0xd341('0x3f')][_0xd341('0x4c')]){_0x568189['where']=_[_0xd341('0x4d')](_0x568189[_0xd341('0x4a')],{'$or':_[_0xd341('0x3a')](_0x243e79,function(_0xc68e0b){if(_0xc68e0b[_0xd341('0x3d')]!==_0xd341('0x4e')){var _0x4b1082={};_0x4b1082[_0xc68e0b[_0xd341('0x4f')]]={'$like':'%'+_0x5a2267[_0xd341('0x3f')][_0xd341('0x4c')]+'%'};return _0x4b1082;}})});}_0x568189=_[_0xd341('0x4d')]({},_0x568189,_0x5a2267[_0xd341('0x50')]);var _0x2e2390={'where':_0x568189[_0xd341('0x4a')]};return db[_0xd341('0x3b')]['count'](_0x2e2390)[_0xd341('0x1e')](function(_0x39a68b){_0x1c955b[_0xd341('0x2f')]=_0x39a68b;if(_0x5a2267[_0xd341('0x3f')][_0xd341('0x51')]){_0x568189['include']=[{'all':!![]}];}return db[_0xd341('0x3b')][_0xd341('0x52')](_0x568189);})[_0xd341('0x1e')](function(_0x2ac07e){_0x1c955b[_0xd341('0x53')]=_0x2ac07e;return _0x1c955b;})[_0xd341('0x1e')](respondWithFilteredResult(_0x2dfe52,_0x568189))[_0xd341('0x29')](handleError(_0x2dfe52,null));};exports[_0xd341('0x54')]=function(_0x2a5d1e,_0x47db69){var _0x4451c7={'raw':![],'where':{'id':_0x2a5d1e[_0xd341('0x55')]['id']},'include':[{'model':db[_0xd341('0x39')],'as':'mandatoryDispositionPause'}]},_0x270fc5={};_0x270fc5['model']=_[_0xd341('0x40')](db[_0xd341('0x3b')][_0xd341('0x56')]);_0x270fc5[_0xd341('0x3f')]=_[_0xd341('0x40')](_0x2a5d1e[_0xd341('0x3f')]);_0x270fc5[_0xd341('0x41')]=_[_0xd341('0x43')](_0x270fc5['model'],_0x270fc5[_0xd341('0x3f')]);_0x4451c7[_0xd341('0x45')]=_[_0xd341('0x43')](_0x270fc5[_0xd341('0x42')],qs[_0xd341('0x44')](_0x2a5d1e[_0xd341('0x3f')][_0xd341('0x44')]));_0x4451c7[_0xd341('0x45')]=_0x4451c7[_0xd341('0x45')]['length']?_0x4451c7['attributes']:_0x270fc5[_0xd341('0x42')];if(_0x2a5d1e[_0xd341('0x3f')][_0xd341('0x51')]){_0x4451c7[_0xd341('0x57')]=[{'all':!![]}];}_0x4451c7=_[_0xd341('0x4d')]({},_0x4451c7,_0x2a5d1e[_0xd341('0x50')]);return db[_0xd341('0x3b')][_0xd341('0x58')](_0x4451c7)[_0xd341('0x1e')](handleEntityNotFound(_0x47db69,null))[_0xd341('0x1e')](respondWithResult(_0x47db69,null))[_0xd341('0x29')](handleError(_0x47db69,null));};exports[_0xd341('0x59')]=function(_0x253959,_0x173d9c){return db[_0xd341('0x3b')][_0xd341('0x59')](_0x253959[_0xd341('0x5a')],{})['then'](function(_0x4e9b79){var _0x10c9ca=_0x253959['user'][_0xd341('0x38')]({'plain':!![]});if(!_0x10c9ca)throw new Error(_0xd341('0x5b'));if(_0x10c9ca[_0xd341('0x5c')]==='user'){var _0x173908=_0x4e9b79[_0xd341('0x38')]({'plain':!![]});var _0x37b81c=_0xd341('0x5d');return db[_0xd341('0x5e')][_0xd341('0x58')]({'where':{'name':_0x37b81c,'userProfileId':_0x10c9ca['userProfileId']},'raw':!![]})[_0xd341('0x1e')](function(_0x3f74f6){if(_0x3f74f6&&_0x3f74f6[_0xd341('0x5f')]===0x0){return db[_0xd341('0x60')][_0xd341('0x59')]({'name':_0x173908[_0xd341('0x4f')],'resourceId':_0x173908['id'],'type':_0x3f74f6[_0xd341('0x4f')],'sectionId':_0x3f74f6['id']},{})[_0xd341('0x1e')](function(){return _0x4e9b79;});}else{return _0x4e9b79;}})[_0xd341('0x29')](function(_0x2649ab){logger[_0xd341('0x23')](_0xd341('0x61'),_0x2649ab);throw _0x2649ab;});}return _0x4e9b79;})[_0xd341('0x1e')](respondWithResult(_0x173d9c,0xc9))['catch'](handleError(_0x173d9c,null));};exports[_0xd341('0x36')]=function(_0x421bc5,_0x1b1109){if(_0x421bc5[_0xd341('0x5a')]['id']){delete _0x421bc5[_0xd341('0x5a')]['id'];}return db[_0xd341('0x3b')][_0xd341('0x58')]({'where':{'id':_0x421bc5['params']['id']},'include':[{'model':db[_0xd341('0x39')],'as':_0xd341('0x62')}]})[_0xd341('0x1e')](handleEntityNotFound(_0x1b1109,null))['then'](saveUpdates(_0x421bc5[_0xd341('0x5a')],null))['then'](respondWithResult(_0x1b1109,null))[_0xd341('0x29')](handleError(_0x1b1109,null));};exports[_0xd341('0x37')]=function(_0x42cd3a,_0x2b08a0){return db[_0xd341('0x3b')][_0xd341('0x58')]({'where':{'id':_0x42cd3a[_0xd341('0x55')]['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x2b08a0,null))[_0xd341('0x1e')](removeEntity(_0x2b08a0,null))['catch'](handleError(_0x2b08a0,null));};exports[_0xd341('0x63')]=function(_0x17f40c,_0x284fba){return db[_0xd341('0x3b')]['describe']()['then'](respondWithResult(_0x284fba,null))[_0xd341('0x29')](handleError(_0x284fba,null));};exports[_0xd341('0x64')]=function(_0x839025,_0x1d461e,_0x12b7fa){if(_0x839025[_0xd341('0x5a')]['id']){delete _0x839025['body']['id'];}return db['FaxAccount'][_0xd341('0x58')]({'where':{'id':_0x839025[_0xd341('0x55')]['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x1d461e,null))['then'](function(_0x3cb4cb){if(_0x3cb4cb){_0x839025[_0xd341('0x5a')][_0xd341('0x65')]=_0x3cb4cb['id'];return db[_0xd341('0x66')][_0xd341('0x59')](_0x839025[_0xd341('0x5a')]);}})[_0xd341('0x1e')](respondWithResult(_0x1d461e,null))[_0xd341('0x29')](handleError(_0x1d461e,null));};exports[_0xd341('0x67')]=function(_0x348905,_0x26f8da,_0x35fe23){var _0x17eb7f={'raw':![],'where':{}};var _0x4bac52={};var _0x4c0aab={'count':0x0,'rows':[]};return db[_0xd341('0x3b')][_0xd341('0x68')]({'where':{'id':_0x348905[_0xd341('0x55')]['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x26f8da,null))[_0xd341('0x1e')](function(_0x134883){if(_0x134883){_0x4bac52[_0xd341('0x42')]=_[_0xd341('0x40')](db[_0xd341('0x66')][_0xd341('0x56')]);_0x4bac52[_0xd341('0x3f')]=_[_0xd341('0x40')](_0x348905[_0xd341('0x3f')]);_0x4bac52['filters']=_[_0xd341('0x43')](_0x4bac52[_0xd341('0x42')],_0x4bac52[_0xd341('0x3f')]);_0x17eb7f['attributes']=_[_0xd341('0x43')](_0x4bac52['model'],qs[_0xd341('0x44')](_0x348905[_0xd341('0x3f')][_0xd341('0x44')]));_0x17eb7f[_0xd341('0x45')]=_0x17eb7f['attributes']['length']?_0x17eb7f[_0xd341('0x45')]:_0x4bac52[_0xd341('0x42')];if(!_0x348905[_0xd341('0x3f')][_0xd341('0x47')]('nolimit')){_0x17eb7f['limit']=qs[_0xd341('0x2e')](_0x348905[_0xd341('0x3f')][_0xd341('0x2e')]);_0x17eb7f[_0xd341('0x30')]=qs['offset'](_0x348905['query']['offset']);}_0x17eb7f[_0xd341('0x48')]=qs[_0xd341('0x49')](_0x348905[_0xd341('0x3f')]['sort']);_0x17eb7f[_0xd341('0x4a')]=qs[_0xd341('0x41')](_[_0xd341('0x4b')](_0x348905[_0xd341('0x3f')],_0x4bac52[_0xd341('0x41')]));_0x17eb7f['where'][_0xd341('0x65')]=_0x134883['id'];if(_0x348905['query'][_0xd341('0x4c')]){_0x17eb7f['where']=_['merge'](_0x17eb7f['where'],{'$or':_[_0xd341('0x3a')](_0x17eb7f['attributes'],function(_0x4a8337){var _0x2b9fc3={};_0x2b9fc3[_0x4a8337]={'$like':'%'+_0x348905[_0xd341('0x3f')][_0xd341('0x4c')]+'%'};return _0x2b9fc3;})});}_0x17eb7f=_[_0xd341('0x4d')]({},_0x17eb7f,_0x348905[_0xd341('0x50')]);return db[_0xd341('0x66')][_0xd341('0x2f')]({'where':_0x17eb7f[_0xd341('0x4a')]})[_0xd341('0x1e')](function(_0x1c4f85){_0x4c0aab[_0xd341('0x2f')]=_0x1c4f85;if(_0x348905[_0xd341('0x3f')][_0xd341('0x51')]){_0x17eb7f[_0xd341('0x57')]=[{'all':!![]}];}return db[_0xd341('0x66')][_0xd341('0x52')](_0x17eb7f);})['then'](function(_0x1f652e){_0x4c0aab[_0xd341('0x53')]=_0x1f652e;return _0x4c0aab;});}})[_0xd341('0x1e')](respondWithFilteredResult(_0x26f8da,_0x17eb7f))[_0xd341('0x29')](handleError(_0x26f8da,null));};exports[_0xd341('0x69')]=function(_0x3bb972,_0x56e4a5,_0x1fd0a2){return db[_0xd341('0x3b')][_0xd341('0x58')]({'where':{'id':_0x3bb972[_0xd341('0x55')]['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x56e4a5,null))[_0xd341('0x1e')](function(_0x22179a){if(_0x22179a){return _0x22179a[_0xd341('0x69')](_0x3bb972[_0xd341('0x3f')][_0xd341('0x6a')]);}})['then'](respondWithStatusCode(_0x56e4a5,null))['catch'](handleError(_0x56e4a5,null));};exports['addAnswer']=function(_0xc6fec9,_0x2357dc,_0x352366){if(_0xc6fec9[_0xd341('0x5a')]['id']){delete _0xc6fec9[_0xd341('0x5a')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0xc6fec9[_0xd341('0x55')]['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x2357dc,null))[_0xd341('0x1e')](function(_0x1ef6d7){if(_0x1ef6d7){_0xc6fec9[_0xd341('0x5a')][_0xd341('0x65')]=_0x1ef6d7['id'];return db[_0xd341('0x6b')]['create'](_0xc6fec9[_0xd341('0x5a')]);}})['then'](respondWithResult(_0x2357dc,null))[_0xd341('0x29')](handleError(_0x2357dc,null));};exports['getAnswers']=function(_0x5ab207,_0x47ae78,_0x14c6d1){var _0x2f768b={'raw':![],'where':{}};var _0x1d6b9b={};var _0x2743b7={'count':0x0,'rows':[]};return db[_0xd341('0x3b')][_0xd341('0x68')]({'where':{'id':_0x5ab207['params']['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x47ae78,null))[_0xd341('0x1e')](function(_0x3d46a3){if(_0x3d46a3){_0x1d6b9b[_0xd341('0x42')]=_[_0xd341('0x40')](db[_0xd341('0x6b')][_0xd341('0x56')]);_0x1d6b9b['query']=_[_0xd341('0x40')](_0x5ab207[_0xd341('0x3f')]);_0x1d6b9b[_0xd341('0x41')]=_[_0xd341('0x43')](_0x1d6b9b[_0xd341('0x42')],_0x1d6b9b[_0xd341('0x3f')]);_0x2f768b[_0xd341('0x45')]=_['intersection'](_0x1d6b9b[_0xd341('0x42')],qs[_0xd341('0x44')](_0x5ab207[_0xd341('0x3f')][_0xd341('0x44')]));_0x2f768b[_0xd341('0x45')]=_0x2f768b[_0xd341('0x45')][_0xd341('0x46')]?_0x2f768b[_0xd341('0x45')]:_0x1d6b9b['model'];if(!_0x5ab207[_0xd341('0x3f')][_0xd341('0x47')](_0xd341('0x6c'))){_0x2f768b[_0xd341('0x2e')]=qs['limit'](_0x5ab207[_0xd341('0x3f')][_0xd341('0x2e')]);_0x2f768b['offset']=qs[_0xd341('0x30')](_0x5ab207['query'][_0xd341('0x30')]);}_0x2f768b[_0xd341('0x48')]=qs[_0xd341('0x49')](_0x5ab207[_0xd341('0x3f')][_0xd341('0x49')]);_0x2f768b['where']=qs['filters'](_[_0xd341('0x4b')](_0x5ab207['query'],_0x1d6b9b['filters']));_0x2f768b[_0xd341('0x4a')]['FaxAccountId']=_0x3d46a3['id'];if(_0x5ab207[_0xd341('0x3f')][_0xd341('0x4c')]){_0x2f768b[_0xd341('0x4a')]=_[_0xd341('0x4d')](_0x2f768b[_0xd341('0x4a')],{'$or':_[_0xd341('0x3a')](_0x2f768b[_0xd341('0x45')],function(_0xa853c0){var _0x5b355c={};_0x5b355c[_0xa853c0]={'$like':'%'+_0x5ab207[_0xd341('0x3f')][_0xd341('0x4c')]+'%'};return _0x5b355c;})});}_0x2f768b=_[_0xd341('0x4d')]({},_0x2f768b,_0x5ab207[_0xd341('0x50')]);return db[_0xd341('0x6b')][_0xd341('0x2f')]({'where':_0x2f768b[_0xd341('0x4a')]})['then'](function(_0x101e9e){_0x2743b7[_0xd341('0x2f')]=_0x101e9e;if(_0x5ab207[_0xd341('0x3f')][_0xd341('0x51')]){_0x2f768b[_0xd341('0x57')]=[{'all':!![]}];}return db[_0xd341('0x6b')][_0xd341('0x52')](_0x2f768b);})[_0xd341('0x1e')](function(_0x119e54){_0x2743b7[_0xd341('0x53')]=_0x119e54;return _0x2743b7;});}})['then'](respondWithFilteredResult(_0x47ae78,_0x2f768b))['catch'](handleError(_0x47ae78,null));};exports[_0xd341('0x6d')]=function(_0x4cbde7,_0xcd7a0,_0x448b68){return db[_0xd341('0x3b')][_0xd341('0x58')]({'where':{'id':_0x4cbde7[_0xd341('0x55')]['id']}})['then'](handleEntityNotFound(_0xcd7a0,null))[_0xd341('0x1e')](function(_0x589999){if(_0x589999){return _0x589999['removeAnswers'](_0x4cbde7[_0xd341('0x3f')]['ids']);}})['then'](respondWithStatusCode(_0xcd7a0,null))['catch'](handleError(_0xcd7a0,null));};exports['addInteraction']=function(_0x5affa9,_0x4d2d8a,_0x5b997c){return db[_0xd341('0x6e')][_0xd341('0x58')]({'where':{'id':_0x5affa9['params']['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x4d2d8a,null))[_0xd341('0x1e')](function(_0x316f94){if(_0x316f94){return _0x316f94['addInteraction'](_0x5affa9[_0xd341('0x5a')][_0xd341('0x6a')],_[_0xd341('0x6f')](_0x5affa9['body'],[_0xd341('0x6a'),'id'])||{});}})[_0xd341('0x1e')](respondWithResult(_0x4d2d8a,null))[_0xd341('0x29')](handleError(_0x4d2d8a,null));};exports['getInteractions']=function(_0x2ebc1a,_0x2428b6,_0x1313f1){var _0x599db8={'raw':![],'where':{}};var _0x54a439={};var _0x5674b5={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd341('0x68')]({'where':{'id':_0x2ebc1a[_0xd341('0x55')]['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x2428b6,null))[_0xd341('0x1e')](function(_0x2008ae){if(_0x2008ae){_0x54a439['model']=_[_0xd341('0x40')](db[_0xd341('0x6e')][_0xd341('0x56')]);_0x54a439[_0xd341('0x3f')]=_[_0xd341('0x40')](_0x2ebc1a[_0xd341('0x3f')]);_0x54a439[_0xd341('0x41')]=_[_0xd341('0x43')](_0x54a439['model'],_0x54a439['query']);_0x599db8[_0xd341('0x45')]=_[_0xd341('0x43')](_0x54a439[_0xd341('0x42')],qs[_0xd341('0x44')](_0x2ebc1a[_0xd341('0x3f')][_0xd341('0x44')]));_0x599db8['attributes']=_0x599db8['attributes']['length']?_0x599db8['attributes']:_0x54a439['model'];if(!_0x2ebc1a['query']['hasOwnProperty'](_0xd341('0x6c'))){_0x599db8['limit']=qs[_0xd341('0x2e')](_0x2ebc1a[_0xd341('0x3f')][_0xd341('0x2e')]);_0x599db8[_0xd341('0x30')]=qs[_0xd341('0x30')](_0x2ebc1a[_0xd341('0x3f')][_0xd341('0x30')]);}_0x599db8[_0xd341('0x48')]=qs[_0xd341('0x49')](_0x2ebc1a['query']['sort']);_0x599db8[_0xd341('0x4a')]=qs[_0xd341('0x41')](_[_0xd341('0x4b')](_0x2ebc1a[_0xd341('0x3f')],_0x54a439[_0xd341('0x41')]));_0x599db8[_0xd341('0x4a')]['FaxAccountId']=_0x2008ae['id'];if(_0x2ebc1a[_0xd341('0x3f')][_0xd341('0x4c')]){_0x599db8[_0xd341('0x4a')]=_[_0xd341('0x4d')](_0x599db8[_0xd341('0x4a')],{'$or':_[_0xd341('0x3a')](_0x599db8[_0xd341('0x45')],function(_0x1932a4){var _0x4dc9e6={};_0x4dc9e6[_0x1932a4]={'$like':'%'+_0x2ebc1a[_0xd341('0x3f')]['filter']+'%'};return _0x4dc9e6;})});}_0x599db8=_['merge']({},_0x599db8,_0x2ebc1a[_0xd341('0x50')]);return db[_0xd341('0x6e')]['count']({'where':_0x599db8[_0xd341('0x4a')]})['then'](function(_0x34f85f){_0x5674b5[_0xd341('0x2f')]=_0x34f85f;if(_0x2ebc1a[_0xd341('0x3f')][_0xd341('0x51')]){_0x599db8[_0xd341('0x57')]=[{'model':db['CmContact'],'as':_0xd341('0x70'),'required':![]},{'model':db['User'],'as':_0xd341('0x71'),'attributes':['name',_0xd341('0x72'),_0xd341('0x73')],'required':![]},{'model':db[_0xd341('0x74')],'as':_0xd341('0x75'),'attributes':['id',_0xd341('0x4f'),_0xd341('0x76')],'where':_0x2ebc1a[_0xd341('0x3f')][_0xd341('0x77')]?{'id':_0x2ebc1a[_0xd341('0x3f')][_0xd341('0x77')]}:undefined,'required':_0x2ebc1a['query'][_0xd341('0x77')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x599db8);})['then'](function(_0x272998){_0x5674b5[_0xd341('0x53')]=_0x272998;return _0x5674b5;});}})['then'](respondWithFilteredResult(_0x2428b6,_0x599db8))['catch'](handleError(_0x2428b6,null));};exports[_0xd341('0x78')]=function(_0x157965,_0x548195,_0x546426){return db[_0xd341('0x3b')][_0xd341('0x68')]({'where':{'id':_0x157965[_0xd341('0x55')]['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x548195,null))['then'](function(_0xa9d753){if(_0xa9d753){return db[_0xd341('0x79')][_0xd341('0x7a')](function(_0x7eda76){return db[_0xd341('0x7b')][_0xd341('0x37')]({'where':{'FaxAccountId':_0x157965['params']['id']},'transaction':_0x7eda76})[_0xd341('0x1e')](function(_0x4b5a78){var _0x3a0ed9=_['map'](_0x157965[_0xd341('0x5a')],function(_0x59fa6b){_0x59fa6b[_0xd341('0x65')]=_0x157965[_0xd341('0x55')]['id'];return _0x59fa6b;});return db['FaxApplication'][_0xd341('0x7c')](_0x3a0ed9,{'transaction':_0x7eda76});});})[_0xd341('0x1e')](function(){return db[_0xd341('0x7b')][_0xd341('0x7d')]({'where':{'FaxAccountId':_0x157965[_0xd341('0x55')]['id']},'order':_0xd341('0x7e')});});}})[_0xd341('0x1e')](respondWithResult(_0x548195,null))['catch'](handleError(_0x548195,null));};exports[_0xd341('0x7f')]=function(_0x1fb6ec,_0x34daa4,_0x2e70d5){var _0x45a1ab={};var _0x4c8bb7={};var _0x5db0b6;var _0x182b31;return db[_0xd341('0x3b')]['findOne']({'where':{'id':_0x1fb6ec[_0xd341('0x55')]['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x34daa4,null))[_0xd341('0x1e')](function(_0x622737){if(_0x622737){_0x5db0b6=_0x622737;_0x4c8bb7[_0xd341('0x42')]=_[_0xd341('0x40')](db[_0xd341('0x7b')][_0xd341('0x56')]);_0x4c8bb7['query']=_[_0xd341('0x40')](_0x1fb6ec[_0xd341('0x3f')]);_0x4c8bb7[_0xd341('0x41')]=_[_0xd341('0x43')](_0x4c8bb7[_0xd341('0x42')],_0x4c8bb7['query']);_0x45a1ab[_0xd341('0x45')]=_[_0xd341('0x43')](_0x4c8bb7[_0xd341('0x42')],qs[_0xd341('0x44')](_0x1fb6ec['query'][_0xd341('0x44')]));_0x45a1ab[_0xd341('0x45')]=_0x45a1ab[_0xd341('0x45')][_0xd341('0x46')]?_0x45a1ab[_0xd341('0x45')]:_0x4c8bb7[_0xd341('0x42')];_0x45a1ab[_0xd341('0x48')]=qs[_0xd341('0x49')](_0x1fb6ec[_0xd341('0x3f')][_0xd341('0x49')]);_0x45a1ab[_0xd341('0x4a')]=qs['filters'](_[_0xd341('0x4b')](_0x1fb6ec[_0xd341('0x3f')],_0x4c8bb7[_0xd341('0x41')]));if(_0x1fb6ec[_0xd341('0x3f')][_0xd341('0x4c')]){_0x45a1ab['where']=_[_0xd341('0x4d')](_0x45a1ab['where'],{'$or':_['map'](_0x45a1ab['attributes'],function(_0x20a3ca){var _0x172cfd={};_0x172cfd[_0x20a3ca]={'$like':'%'+_0x1fb6ec['query']['filter']+'%'};return _0x172cfd;})});}_0x45a1ab=_['merge']({},_0x45a1ab,_0x1fb6ec[_0xd341('0x50')]);return _0x5db0b6[_0xd341('0x7f')](_0x45a1ab);}})[_0xd341('0x1e')](function(_0x1bf676){if(_0x1bf676){_0x182b31=_0x1bf676[_0xd341('0x46')];if(!_0x1fb6ec[_0xd341('0x3f')][_0xd341('0x47')](_0xd341('0x6c'))){_0x45a1ab['limit']=qs[_0xd341('0x2e')](_0x1fb6ec[_0xd341('0x3f')][_0xd341('0x2e')]);_0x45a1ab['offset']=qs[_0xd341('0x30')](_0x1fb6ec[_0xd341('0x3f')][_0xd341('0x30')]);}return _0x5db0b6[_0xd341('0x7f')](_0x45a1ab);}})['then'](function(_0x353cc7){if(_0x353cc7){return _0x353cc7?{'count':_0x182b31,'rows':_0x353cc7}:null;}})[_0xd341('0x1e')](respondWithResult(_0x34daa4,null))['catch'](handleError(_0x34daa4,null));};function Extension(_0x4770e5,_0xcdd9a3,_0x599708,_0x425145){this['context']=_0xd341('0x80');this[_0xd341('0x81')]=_0x4770e5[_0xd341('0x82')];this[_0xd341('0x83')]=_0x425145;this[_0xd341('0x3d')]=_0xd341('0x84');this[_0xd341('0x85')]=_0xd341('0x86');this[_0xd341('0x65')]=_0x4770e5['id'];this[_0xd341('0x7e')]=_0xcdd9a3;this['appdata']=_0x599708;}function createExtensionsReciveFax(_0x42c51f){var _0x77d775=0x1;var _0x196711=[];_0x196711[_0xd341('0x87')](new Extension(_0x42c51f,_0x77d775,'','Answer'));_0x77d775+=0x1;_0x196711[_0xd341('0x87')](new Extension(_0x42c51f,_0x77d775,_0xd341('0x88'),'Set'));_0x77d775+=0x1;for(var _0x31fd3d in _0x42c51f){if(_0x42c51f[_0xd341('0x47')](_0x31fd3d)&&(_0x31fd3d===_0xd341('0x89')||_0x31fd3d===_0xd341('0x82')||_0x31fd3d===_0xd341('0x8a')||_0x31fd3d===_0xd341('0x8b')||_0x31fd3d===_0xd341('0x8c')||_0x31fd3d==='maxrate'||_0x31fd3d===_0xd341('0x8d')||_0x31fd3d===_0xd341('0x8e')||_0x31fd3d===_0xd341('0x8f'))){_0x196711['push'](new Extension(_0x42c51f,_0x77d775,'FAXOPT('+_0x31fd3d+')='+_0x42c51f[_0x31fd3d],_0xd341('0x90')));_0x77d775+=0x1;}}_0x196711[_0xd341('0x87')](new Extension(_0x42c51f,_0x77d775,'6',_0xd341('0x91')));_0x77d775+=0x1;_0x196711[_0xd341('0x87')](new Extension(_0x42c51f,_0x77d775,_0xd341('0x92'),_0xd341('0x93')));_0x77d775=0x0;return _0x196711;}exports[_0xd341('0x94')]=function(_0x4fa738,_0x2ee80d,_0xaf2aa3){var _0x3edb24;return db[_0xd341('0x79')][_0xd341('0x7a')](function(_0x67cac5){return db[_0xd341('0x3b')]['create'](_0x4fa738['body'],{'transaction':_0x67cac5})['then'](function(_0x2e612d){_0x3edb24=_0x2e612d[_0xd341('0x38')]({'plain':!![]});return db[_0xd341('0x95')][_0xd341('0x7c')](createExtensionsReciveFax(_0x3edb24),{'transaction':_0x67cac5});});})[_0xd341('0x1e')](function(){return _0x3edb24;})[_0xd341('0x1e')](respondWithResult(_0x2ee80d,null))[_0xd341('0x29')](handleError(_0x2ee80d,null));};exports[_0xd341('0x96')]=function(_0x1ce876,_0x25549f,_0x49cc78){var _0x1bb72d;return db[_0xd341('0x79')][_0xd341('0x7a')](function(_0x13f229){return db[_0xd341('0x3b')][_0xd341('0x36')](_0x1ce876[_0xd341('0x5a')],{'where':{'id':_0x1ce876[_0xd341('0x5a')]['id']},'transaction':_0x13f229})['then'](function(_0x183c8b){return db[_0xd341('0x95')][_0xd341('0x37')]({'where':{'FaxAccountId':_0x1ce876[_0xd341('0x5a')]['id']},'transaction':_0x13f229})[_0xd341('0x1e')](function(_0x449704){return db[_0xd341('0x95')][_0xd341('0x7c')](createExtensionsReciveFax(_['omit'](_0x1ce876[_0xd341('0x5a')],[_0xd341('0x97'),_0xd341('0x3e'),_0xd341('0x98'),'updatedAt',_0xd341('0x99'),_0xd341('0x9a')])),{'transaction':_0x13f229});});});})['then'](function(){return db['FaxAccount'][_0xd341('0x9b')](_0x1ce876['body']['id']);})['then'](respondWithResult(_0x25549f,null))[_0xd341('0x29')](handleError(_0x25549f,null));};exports[_0xd341('0x9c')]=function(_0x579dcb,_0x2bd5a7,_0x2fed79){var _0x58e633={'raw':!![],'where':{}};var _0x42431f={};var _0x34bc18={'count':0x0,'rows':[]};return db[_0xd341('0x3b')][_0xd341('0x68')]({'where':{'id':_0x579dcb[_0xd341('0x55')]['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x2bd5a7,null))[_0xd341('0x1e')](function(_0xbd3139){if(_0xbd3139){_0x42431f['model']=_[_0xd341('0x40')](db[_0xd341('0x9d')][_0xd341('0x56')]);_0x42431f['query']=_['keys'](_0x579dcb[_0xd341('0x3f')]);_0x42431f[_0xd341('0x41')]=_[_0xd341('0x43')](_0x42431f[_0xd341('0x42')],_0x42431f[_0xd341('0x3f')]);_0x58e633[_0xd341('0x45')]=_[_0xd341('0x43')](_0x42431f[_0xd341('0x42')],qs[_0xd341('0x44')](_0x579dcb['query'][_0xd341('0x44')]));_0x58e633[_0xd341('0x45')]=_0x58e633['attributes'][_0xd341('0x46')]?_0x58e633['attributes']:_0x42431f[_0xd341('0x42')];if(!_0x579dcb[_0xd341('0x3f')][_0xd341('0x47')](_0xd341('0x6c'))){_0x58e633[_0xd341('0x2e')]=qs[_0xd341('0x2e')](_0x579dcb[_0xd341('0x3f')][_0xd341('0x2e')]);_0x58e633[_0xd341('0x30')]=qs[_0xd341('0x30')](_0x579dcb[_0xd341('0x3f')][_0xd341('0x30')]);}_0x58e633[_0xd341('0x48')]=qs['sort'](_0x579dcb[_0xd341('0x3f')][_0xd341('0x49')]);_0x58e633[_0xd341('0x4a')]=qs[_0xd341('0x41')](_['pick'](_0x579dcb[_0xd341('0x3f')],_0x42431f[_0xd341('0x41')]));_0x58e633['where'][_0xd341('0x65')]=_0xbd3139['id'];if(_0x579dcb[_0xd341('0x3f')]['filter']){_0x58e633[_0xd341('0x4a')]=_[_0xd341('0x4d')](_0x58e633[_0xd341('0x4a')],{'$or':_['map'](_0x58e633[_0xd341('0x45')],function(_0x5eb4ce){var _0x329c83={};_0x329c83[_0x5eb4ce]={'$like':'%'+_0x579dcb[_0xd341('0x3f')]['filter']+'%'};return _0x329c83;})});}if(_0x579dcb[_0xd341('0x3f')]['$gte']){var _0xb30715=_0x579dcb[_0xd341('0x3f')][_0xd341('0x9e')][_0xd341('0x9f')](',');var _0x53c398={};_0x53c398[_0xb30715[0x0]]={'$gte':moment(_0xb30715[0x1])[_0xd341('0xa0')](_0xd341('0xa1'))};_0x58e633['where']=_[_0xd341('0x4d')](_0x58e633[_0xd341('0x4a')],_0x53c398);}_0x58e633=_['merge']({},_0x58e633,_0x579dcb[_0xd341('0x50')]);return db['FaxMessage']['count']({'where':_0x58e633[_0xd341('0x4a')]})['then'](function(_0x310c76){_0x34bc18['count']=_0x310c76;if(_0x579dcb['query'][_0xd341('0x51')]){_0x58e633[_0xd341('0x57')]=[{'all':!![]}];}return db['FaxMessage'][_0xd341('0x52')](_0x58e633);})[_0xd341('0x1e')](function(_0x15a6fa){_0x34bc18['rows']=_0x15a6fa;return _0x34bc18;});}})[_0xd341('0x1e')](respondWithFilteredResult(_0x2bd5a7,_0x58e633))[_0xd341('0x29')](handleError(_0x2bd5a7,null));};exports[_0xd341('0xa2')]=function(_0x1865c6,_0x249c3d,_0x3df96a){var _0x480886,_0x18bfc5={},_0x18ad80;if(_0x1865c6[_0xd341('0x5a')]['to']){_0x18ad80=_0x1865c6['body']['to'][0x0];}return db['FaxAccount'][_0xd341('0x58')]({'where':{'id':_0x1865c6['params']['id']},'include':[{'model':db[_0xd341('0xa3')],'as':_0xd341('0xa4'),'include':[{'model':db['CmContact'],'as':_0xd341('0xa5'),'where':{'fax':_0x18ad80},'limit':0x1,'order':[[_0xd341('0xa6'),_0xd341('0xa7')]]}]}]})[_0xd341('0x1e')](handleEntityNotFound(_0x249c3d,null))[_0xd341('0x1e')](function(_0x46ec8b){_0x480886=_0x46ec8b;if(_0x1865c6['body'][_0xd341('0xa8')]&&_0x1865c6[_0xd341('0x5a')]['attachments']['length']){for(var _0x31d5f2=0x0;_0x31d5f2<_0x1865c6[_0xd341('0x5a')]['attachments']['length'];_0x31d5f2+=0x1){_0x1865c6[_0xd341('0x5a')]['attachments'][_0x31d5f2]={'filename':_0x1865c6[_0xd341('0x5a')][_0xd341('0xa8')][_0x31d5f2][_0xd341('0x4f')],'id':_0x1865c6[_0xd341('0x5a')][_0xd341('0xa8')][_0x31d5f2]['id'],'path':path[_0xd341('0xa9')](config['root'],'server/files/attachments',_0x1865c6[_0xd341('0x5a')]['attachments'][_0x31d5f2][_0xd341('0xaa')])};}}return respondWithRpcPromise(_0xd341('0xab'),_0xd341('0xab'),{'FaxAccountId':_[_0xd341('0xac')](_0x1865c6[_0xd341('0x55')]['id'])?undefined:_0x1865c6['params']['id'],'path':_[_0xd341('0xac')](_0x1865c6[_0xd341('0x5a')][_0xd341('0xa8')][0x0][_0xd341('0xad')])?undefined:_0x1865c6[_0xd341('0x5a')][_0xd341('0xa8')][0x0][_0xd341('0xad')],'fax':_[_0xd341('0xac')](_0x1865c6[_0xd341('0x5a')]['to'][0x0])?undefined:_0x1865c6[_0xd341('0x5a')]['to'][0x0]},client9002);})[_0xd341('0x1e')](function(){if(_0x480886){if(_[_0xd341('0xac')](_0x1865c6[_0xd341('0x5a')][_0xd341('0xae')])){_0x1865c6[_0xd341('0x5a')][_0xd341('0xae')]=util[_0xd341('0xa0')](_0xd341('0xaf'),_0x480886[_0xd341('0x4f')],_0x480886[_0xd341('0xb0')]);}if(_0x480886[_0xd341('0xa4')]){if(_0x480886[_0xd341('0xa4')]['Contacts'][_0xd341('0x46')]){return _0x480886[_0xd341('0xa4')][_0xd341('0xa5')][0x0];}else{return db[_0xd341('0xb1')]['create'](_[_0xd341('0x16')](_0x1865c6[_0xd341('0x5a')],{'firstName':_0x1865c6[_0xd341('0x5a')]['to'][0x0],'phone':_0x1865c6[_0xd341('0x5a')]['to'][0x0],'fax':_0x1865c6[_0xd341('0x5a')]['to'][0x0],'ListId':_0x480886[_0xd341('0x9a')]}));}}else{throw new Error(_0xd341('0xb2'));}}else{throw new Error(_0xd341('0xb3'));}})[_0xd341('0x1e')](function(_0x42bb1d){if(_0x42bb1d){return db[_0xd341('0x6e')][_0xd341('0x58')]({'where':{'ContactId':_0x42bb1d['id'],'closed':![],'FaxAccountId':_0x480886['id']}})[_0xd341('0x1e')](function(_0x102dcc){if(_0x102dcc){return[_0x102dcc,![]];}return db['FaxInteraction'][_0xd341('0x59')]({'UserId':_0x1865c6[_0xd341('0xb4')]['id'],'ContactId':_0x42bb1d['id'],'FaxAccountId':_0x480886['id'],'fax':_0x1865c6[_0xd341('0x5a')]['to'][0x0],'firstMsgDirection':_0xd341('0xb5'),'Messages':[_[_0xd341('0x4d')](_0x1865c6[_0xd341('0x5a')],{'read':![],'body':_0x1865c6[_0xd341('0x5a')][_0xd341('0xa8')][0x0][_0xd341('0xb6')],'FaxAccountId':_0x480886['id'],'UserId':_0x1865c6[_0xd341('0xb4')]['id'],'ContactId':_0x42bb1d['id'],'AttachmentId':_0x1865c6[_0xd341('0x5a')][_0xd341('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0xd341('0x9d')],'as':_0xd341('0xb7')}]})[_0xd341('0x1e')](function(_0x1e5c6e){return[_0x1e5c6e,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xd341('0xb8')](function(_0x35bebe,_0x479c69){if(_0x479c69){return _0x35bebe;}return db[_0xd341('0x9d')][_0xd341('0x59')]({'direction':_0xd341('0xb5'),'read':![],'body':_0x1865c6[_0xd341('0x5a')][_0xd341('0xa8')][0x0][_0xd341('0xb6')],'FaxAccountId':_0x480886['id'],'FaxInteractionId':_0x35bebe['id'],'UserId':_0x1865c6['user']['id'],'ContactId':_0x35bebe[_0xd341('0xb9')],'AttachmentId':_0x1865c6[_0xd341('0x5a')]['attachments'][0x0]['id']})[_0xd341('0x1e')](function(_0x192714){_0x35bebe['dataValues'][_0xd341('0xb7')]=[];_0x35bebe[_0xd341('0xba')][_0xd341('0xb7')][_0xd341('0x87')](_0x192714[_0xd341('0xba')]);return _0x35bebe;});})[_0xd341('0x1e')](function(_0x42f97d){respondWithRpcPromise('SendFax',_0xd341('0xbb'),{'FaxAccountId':_[_0xd341('0xac')](_0x1865c6[_0xd341('0x55')]['id'])?undefined:_0x1865c6[_0xd341('0x55')]['id'],'path':_[_0xd341('0xac')](_0x1865c6['body'][_0xd341('0xa8')][0x0][_0xd341('0xad')])?undefined:_0x1865c6[_0xd341('0x5a')][_0xd341('0xa8')][0x0][_0xd341('0xad')],'fax':_[_0xd341('0xac')](_0x1865c6[_0xd341('0x5a')]['to'][0x0])?undefined:_0x1865c6[_0xd341('0x5a')]['to'][0x0],'AttachmentId':_0x1865c6[_0xd341('0x5a')]['attachments'][0x0]['id']},client9002)['then'](function(_0x3ead9d){logger[_0xd341('0x26')](_0xd341('0xbc'),_0x3ead9d);})[_0xd341('0x29')](function(_0x1d4189){logger[_0xd341('0x26')](_0xd341('0xbc'),_0x1d4189);});return _0x42f97d;})[_0xd341('0x1e')](respondWithResult(_0x249c3d,null))[_0xd341('0x29')](handleError(_0x249c3d,null));};exports[_0xd341('0xbd')]=function(_0xfda73c,_0x3727b3,_0x3a766a){return db[_0xd341('0x3b')][_0xd341('0x58')]({'where':{'id':_0xfda73c[_0xd341('0x55')]['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x3727b3,null))['then'](function(_0x7b2629){if(_0x7b2629){return _0x7b2629['addAgents'](_0xfda73c['body']['ids'],_[_0xd341('0x6f')](_0xfda73c[_0xd341('0x5a')],[_0xd341('0x6a'),'id'])||{})[_0xd341('0xb8')](function(_0x50ad2c){for(var _0x40dece=0x0;_0x40dece<_0xfda73c['body'][_0xd341('0x6a')]['length'];_0x40dece+=0x1){socket[_0xd341('0xbe')](_0xd341('0xbf'),{'UserId':_0xfda73c[_0xd341('0x5a')][_0xd341('0x6a')][_0x40dece],'FaxAccountId':_0xfda73c[_0xd341('0x55')]['id']});}return _0x50ad2c;});}})['then'](respondWithResult(_0x3727b3,null))['catch'](handleError(_0x3727b3,null));};exports[_0xd341('0xc0')]=function(_0x2ef847,_0x3f9247,_0x27add4){return db[_0xd341('0x3b')][_0xd341('0x58')]({'where':{'id':_0x2ef847[_0xd341('0x55')]['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x3f9247,null))[_0xd341('0x1e')](function(_0x1765f4){if(_0x1765f4){return _0x1765f4[_0xd341('0xc0')](_0x2ef847[_0xd341('0x3f')][_0xd341('0x6a')])[_0xd341('0x1e')](function(){if(_[_0xd341('0xc1')](_0x2ef847['query'][_0xd341('0x6a')])){for(var _0x37d839=0x0;_0x37d839<_0x2ef847[_0xd341('0x3f')][_0xd341('0x6a')][_0xd341('0x46')];_0x37d839+=0x1){socket[_0xd341('0xbe')](_0xd341('0xc2'),{'UserId':Number(_0x2ef847['query'][_0xd341('0x6a')][_0x37d839]),'FaxAccountId':Number(_0x2ef847[_0xd341('0x55')]['id'])});}}else{socket[_0xd341('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x2ef847[_0xd341('0x3f')][_0xd341('0x6a')]),'FaxAccountId':Number(_0x2ef847[_0xd341('0x55')]['id'])});}});}})[_0xd341('0x1e')](respondWithStatusCode(_0x3f9247,null))['catch'](handleError(_0x3f9247,null));};exports['getAgents']=function(_0x5aa60c,_0x5aa0d7,_0x5410f4){var _0x2d2af7={};var _0x175490={};var _0x57355f;var _0x29a4f3;return db[_0xd341('0x3b')]['findOne']({'where':{'id':_0x5aa60c['params']['id']}})[_0xd341('0x1e')](handleEntityNotFound(_0x5aa0d7,null))[_0xd341('0x1e')](function(_0x581549){if(_0x581549){_0x57355f=_0x581549;_0x175490[_0xd341('0x42')]=_[_0xd341('0x40')](db[_0xd341('0xc3')][_0xd341('0x56')]);_0x175490[_0xd341('0x3f')]=_[_0xd341('0x40')](_0x5aa60c[_0xd341('0x3f')]);_0x175490[_0xd341('0x41')]=_[_0xd341('0x43')](_0x175490[_0xd341('0x42')],_0x175490[_0xd341('0x3f')]);_0x2d2af7[_0xd341('0x45')]=_[_0xd341('0x43')](_0x175490['model'],qs[_0xd341('0x44')](_0x5aa60c[_0xd341('0x3f')][_0xd341('0x44')]));_0x2d2af7[_0xd341('0x45')]=_0x2d2af7[_0xd341('0x45')]['length']?_0x2d2af7[_0xd341('0x45')]:_0x175490[_0xd341('0x42')];_0x2d2af7[_0xd341('0x48')]=qs[_0xd341('0x49')](_0x5aa60c[_0xd341('0x3f')][_0xd341('0x49')]);_0x2d2af7[_0xd341('0x4a')]=qs[_0xd341('0x41')](_[_0xd341('0x4b')](_0x5aa60c[_0xd341('0x3f')],_0x175490[_0xd341('0x41')]));if(_0x5aa60c['query'][_0xd341('0x4c')]){_0x2d2af7[_0xd341('0x4a')]=_[_0xd341('0x4d')](_0x2d2af7['where'],{'$or':_[_0xd341('0x3a')](_0x2d2af7[_0xd341('0x45')],function(_0x5d34d7){var _0x1e09df={};_0x1e09df[_0x5d34d7]={'$like':'%'+_0x5aa60c[_0xd341('0x3f')]['filter']+'%'};return _0x1e09df;})});}_0x2d2af7=_[_0xd341('0x4d')]({},_0x2d2af7,_0x5aa60c[_0xd341('0x50')]);return _0x57355f[_0xd341('0xc4')](_0x2d2af7);}})[_0xd341('0x1e')](function(_0x3d7ac1){if(_0x3d7ac1){_0x29a4f3=_0x3d7ac1[_0xd341('0x46')];if(!_0x5aa60c[_0xd341('0x3f')]['hasOwnProperty'](_0xd341('0x6c'))){_0x2d2af7['limit']=qs[_0xd341('0x2e')](_0x5aa60c['query'][_0xd341('0x2e')]);_0x2d2af7[_0xd341('0x30')]=qs[_0xd341('0x30')](_0x5aa60c[_0xd341('0x3f')][_0xd341('0x30')]);}return _0x57355f[_0xd341('0xc4')](_0x2d2af7);}})[_0xd341('0x1e')](function(_0x30b633){if(_0x30b633){return _0x30b633?{'count':_0x29a4f3,'rows':_0x30b633}:null;}})['then'](respondWithResult(_0x5aa0d7,null))['catch'](handleError(_0x5aa0d7,null));}; \ No newline at end of file +var _0x04be=['mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','pick','removeDispositions','ids','getAnswers','CannedAnswer','addInteraction','omit','getInteractions','findOne','FaxInteraction','CmContact','User','Owner','fullname','internal','Tag','tag','addApplications','sequelize','FaxApplication','getApplications','context','exten','localstationid','app','system','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','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','transaction','bulkCreate','VoiceExtension','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x04be,0x8b));var _0xe04b=function(_0x225fc9,_0x59ac38){_0x225fc9=_0x225fc9-0x0;var _0x127ae1=_0x04be[_0x225fc9];return _0x127ae1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe04b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe04b('0x1'));var rp=require(_0xe04b('0x2'));var moment=require(_0xe04b('0x3'));var BPromise=require(_0xe04b('0x4'));var Mustache=require(_0xe04b('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe04b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe04b('0x7'));var _=require(_0xe04b('0x8'));var squel=require('squel');var crypto=require(_0xe04b('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe04b('0xa'));var toCsv=require(_0xe04b('0xb'));var querystring=require(_0xe04b('0xc'));var Papa=require(_0xe04b('0xd'));var Redis=require(_0xe04b('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe04b('0xf'));var hardwareService=require(_0xe04b('0x10'));var logger=require('../../config/logger')(_0xe04b('0x11'));var utils=require(_0xe04b('0x12'));var config=require(_0xe04b('0x13'));var licenseUtil=require(_0xe04b('0x14'));var db=require(_0xe04b('0x15'))['db'];config[_0xe04b('0x16')]=_['defaults'](config['redis'],{'host':_0xe04b('0x17'),'port':0x18eb});var socket=require(_0xe04b('0x18'))(new Redis(config[_0xe04b('0x16')]));require(_0xe04b('0x19'))[_0xe04b('0x1a')](socket);var jayson=require(_0xe04b('0x1b'));var client=jayson[_0xe04b('0x1c')][_0xe04b('0x1d')]({'port':0x232c});var client9002=jayson[_0xe04b('0x1c')][_0xe04b('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x138e43,_0x1e81f4,_0x125853,_0xe5cdb0){return new BPromise(function(_0x557e01,_0x16b800){var _0x4770df=_0xe5cdb0||client;return _0x4770df['request'](_0x138e43,_0x125853)[_0xe04b('0x1e')](function(_0x5c6d22){logger[_0xe04b('0x1f')](_0xe04b('0x20'),_0x1e81f4,_0xe04b('0x21'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1e81f4,_0xe04b('0x21'),JSON['stringify'](_0x5c6d22));if(_0x5c6d22['error']){if(_0x5c6d22[_0xe04b('0x22')][_0xe04b('0x23')]===0x1f4){logger['error'](_0xe04b('0x20'),_0x1e81f4,_0x5c6d22['error']['message']);return _0x16b800(_0x5c6d22['error'][_0xe04b('0x24')]);}logger['error'](_0xe04b('0x20'),_0x1e81f4,_0x5c6d22[_0xe04b('0x22')][_0xe04b('0x24')]);return _0x557e01(_0x5c6d22[_0xe04b('0x22')]['message']);}else{logger['info'](_0xe04b('0x20'),_0x1e81f4,_0xe04b('0x21'));_0x557e01(_0x5c6d22[_0xe04b('0x25')][_0xe04b('0x24')]);}})[_0xe04b('0x26')](function(_0x40d84a){logger[_0xe04b('0x22')](_0xe04b('0x20'),_0x1e81f4,_0x40d84a);_0x16b800(_0x40d84a);});});}function respondWithStatusCode(_0x2523d0,_0x11b976){_0x11b976=_0x11b976||0xcc;return function(_0x4c9498){if(_0x4c9498){return _0x2523d0[_0xe04b('0x27')](_0x11b976);}return _0x2523d0['status'](_0x11b976)[_0xe04b('0x28')]();};}function respondWithResult(_0x27e64a,_0xeabc35){_0xeabc35=_0xeabc35||0xc8;return function(_0x1a6c6b){if(_0x1a6c6b){return _0x27e64a[_0xe04b('0x29')](_0xeabc35)[_0xe04b('0x2a')](_0x1a6c6b);}};}function respondWithFilteredResult(_0x595eb0,_0x98fd20){return function(_0x3e7b2d){if(_0x3e7b2d){var _0x21c549=typeof _0x98fd20[_0xe04b('0x2b')]===_0xe04b('0x2c')&&typeof _0x98fd20['limit']===_0xe04b('0x2c');var _0x206a21=_0x3e7b2d[_0xe04b('0x2d')];var _0x278110=_0x21c549?0x0:_0x98fd20[_0xe04b('0x2b')];var _0x338356=_0x21c549?_0x3e7b2d[_0xe04b('0x2d')]:_0x98fd20['offset']+_0x98fd20[_0xe04b('0x2e')];var _0x52d224;if(_0x338356>=_0x206a21){_0x338356=_0x206a21;_0x52d224=0xc8;}else{_0x52d224=0xce;}_0x595eb0['status'](_0x52d224);return _0x595eb0[_0xe04b('0x2f')](_0xe04b('0x30'),_0x278110+'-'+_0x338356+'/'+_0x206a21)[_0xe04b('0x2a')](_0x3e7b2d);}return null;};}function patchUpdates(_0x3e606f){return function(_0x3304f9){try{jsonpatch['apply'](_0x3304f9,_0x3e606f,!![]);}catch(_0x5b58a5){return BPromise[_0xe04b('0x31')](_0x5b58a5);}return _0x3304f9['save']();};}function saveUpdates(_0x1c67b6,_0x1eb025){return function(_0x2eb9cd){if(_0x2eb9cd){return _0x2eb9cd[_0xe04b('0x32')](_0x1c67b6)['then'](function(_0xced16){return _0xced16;});}return null;};}function removeEntity(_0x86b93d,_0x385e07){return function(_0x2c9f24){if(_0x2c9f24){return _0x2c9f24[_0xe04b('0x33')]()[_0xe04b('0x1e')](function(){var _0x46d425=_0x2c9f24[_0xe04b('0x34')]({'plain':!![]});var _0x3a1ce2='FaxAccounts';return db[_0xe04b('0x35')]['destroy']({'where':{'type':_0x3a1ce2,'resourceId':_0x46d425['id']}})['then'](function(){return _0x2c9f24;});})[_0xe04b('0x1e')](function(){_0x86b93d[_0xe04b('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x224bc9,_0x151059){return function(_0xf1567c){if(!_0xf1567c){_0x224bc9[_0xe04b('0x27')](0x194);}return _0xf1567c;};}function handleError(_0x789923,_0x35b1ca){_0x35b1ca=_0x35b1ca||0x1f4;return function(_0x38c2b8){logger[_0xe04b('0x22')](_0x38c2b8[_0xe04b('0x36')]);if(_0x38c2b8[_0xe04b('0x37')]){delete _0x38c2b8[_0xe04b('0x37')];}_0x789923[_0xe04b('0x29')](_0x35b1ca)[_0xe04b('0x38')](_0x38c2b8);};}exports[_0xe04b('0x39')]=function(_0x46fa13,_0x301c8a){var _0x725dfe={'include':[{'model':db[_0xe04b('0x3a')],'as':_0xe04b('0x3b')}]},_0x33c012={},_0x39fda7={'count':0x0,'rows':[]};var _0x55770e=_[_0xe04b('0x3c')](db[_0xe04b('0x3d')][_0xe04b('0x3e')],function(_0x5663ea){return{'name':_0x5663ea[_0xe04b('0x3f')],'type':_0x5663ea[_0xe04b('0x40')]['key']};});_0x33c012[_0xe04b('0x41')]=_[_0xe04b('0x3c')](_0x55770e,_0xe04b('0x37'));_0x33c012['query']=_[_0xe04b('0x42')](_0x46fa13[_0xe04b('0x43')]);_0x33c012[_0xe04b('0x44')]=_[_0xe04b('0x45')](_0x33c012[_0xe04b('0x41')],_0x33c012[_0xe04b('0x43')]);_0x725dfe[_0xe04b('0x46')]=_[_0xe04b('0x45')](_0x33c012[_0xe04b('0x41')],qs[_0xe04b('0x47')](_0x46fa13[_0xe04b('0x43')][_0xe04b('0x47')]));_0x725dfe[_0xe04b('0x46')]=_0x725dfe[_0xe04b('0x46')]['length']?_0x725dfe[_0xe04b('0x46')]:_0x33c012[_0xe04b('0x41')];if(!_0x46fa13[_0xe04b('0x43')][_0xe04b('0x48')](_0xe04b('0x49'))){_0x725dfe['limit']=qs[_0xe04b('0x2e')](_0x46fa13[_0xe04b('0x43')]['limit']);_0x725dfe[_0xe04b('0x2b')]=qs[_0xe04b('0x2b')](_0x46fa13[_0xe04b('0x43')][_0xe04b('0x2b')]);}_0x725dfe[_0xe04b('0x4a')]=qs[_0xe04b('0x4b')](_0x46fa13[_0xe04b('0x43')]['sort']);_0x725dfe[_0xe04b('0x4c')]=qs[_0xe04b('0x44')](_['pick'](_0x46fa13[_0xe04b('0x43')],_0x33c012['filters']),_0x55770e);if(_0x46fa13[_0xe04b('0x43')][_0xe04b('0x4d')]){_0x725dfe[_0xe04b('0x4c')]=_[_0xe04b('0x4e')](_0x725dfe[_0xe04b('0x4c')],{'$or':_[_0xe04b('0x3c')](_0x55770e,function(_0x36ad46){if(_0x36ad46[_0xe04b('0x40')]!==_0xe04b('0x4f')){var _0x1b1afd={};_0x1b1afd[_0x36ad46[_0xe04b('0x37')]]={'$like':'%'+_0x46fa13[_0xe04b('0x43')][_0xe04b('0x4d')]+'%'};return _0x1b1afd;}})});}_0x725dfe=_[_0xe04b('0x4e')]({},_0x725dfe,_0x46fa13[_0xe04b('0x50')]);var _0x4e01e4={'where':_0x725dfe[_0xe04b('0x4c')]};return db[_0xe04b('0x3d')]['count'](_0x4e01e4)['then'](function(_0x5655f2){_0x39fda7['count']=_0x5655f2;if(_0x46fa13[_0xe04b('0x43')][_0xe04b('0x51')]){_0x725dfe[_0xe04b('0x52')]=[{'all':!![]}];}return db[_0xe04b('0x3d')][_0xe04b('0x53')](_0x725dfe);})[_0xe04b('0x1e')](function(_0x15753a){_0x39fda7[_0xe04b('0x54')]=_0x15753a;return _0x39fda7;})['then'](respondWithFilteredResult(_0x301c8a,_0x725dfe))[_0xe04b('0x26')](handleError(_0x301c8a,null));};exports[_0xe04b('0x55')]=function(_0x36efdd,_0xe109ca){var _0x2e104f={'raw':![],'where':{'id':_0x36efdd[_0xe04b('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xe04b('0x3b')}]},_0x29d0e9={};_0x29d0e9['model']=_[_0xe04b('0x42')](db[_0xe04b('0x3d')][_0xe04b('0x3e')]);_0x29d0e9[_0xe04b('0x43')]=_[_0xe04b('0x42')](_0x36efdd[_0xe04b('0x43')]);_0x29d0e9['filters']=_[_0xe04b('0x45')](_0x29d0e9['model'],_0x29d0e9[_0xe04b('0x43')]);_0x2e104f['attributes']=_['intersection'](_0x29d0e9[_0xe04b('0x41')],qs[_0xe04b('0x47')](_0x36efdd[_0xe04b('0x43')][_0xe04b('0x47')]));_0x2e104f[_0xe04b('0x46')]=_0x2e104f['attributes'][_0xe04b('0x57')]?_0x2e104f[_0xe04b('0x46')]:_0x29d0e9[_0xe04b('0x41')];if(_0x36efdd['query'][_0xe04b('0x51')]){_0x2e104f[_0xe04b('0x52')]=[{'all':!![]}];}_0x2e104f=_[_0xe04b('0x4e')]({},_0x2e104f,_0x36efdd[_0xe04b('0x50')]);return db[_0xe04b('0x3d')][_0xe04b('0x58')](_0x2e104f)['then'](handleEntityNotFound(_0xe109ca,null))[_0xe04b('0x1e')](respondWithResult(_0xe109ca,null))[_0xe04b('0x26')](handleError(_0xe109ca,null));};exports['create']=function(_0x515bdb,_0x445969){return db[_0xe04b('0x3d')][_0xe04b('0x59')](_0x515bdb[_0xe04b('0x5a')],{})['then'](function(_0xe85a98){var _0x4c8628=_0x515bdb[_0xe04b('0x5b')][_0xe04b('0x34')]({'plain':!![]});if(!_0x4c8628)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c8628[_0xe04b('0x5c')]===_0xe04b('0x5b')){var _0x1d538f=_0xe85a98['get']({'plain':!![]});var _0x2ba1cf='FaxAccounts';return db[_0xe04b('0x5d')][_0xe04b('0x58')]({'where':{'name':_0x2ba1cf,'userProfileId':_0x4c8628[_0xe04b('0x5e')]},'raw':!![]})[_0xe04b('0x1e')](function(_0x378f45){if(_0x378f45&&_0x378f45[_0xe04b('0x5f')]===0x0){return db['UserProfileResource'][_0xe04b('0x59')]({'name':_0x1d538f[_0xe04b('0x37')],'resourceId':_0x1d538f['id'],'type':_0x378f45[_0xe04b('0x37')],'sectionId':_0x378f45['id']},{})[_0xe04b('0x1e')](function(){return _0xe85a98;});}else{return _0xe85a98;}})[_0xe04b('0x26')](function(_0xc2565a){logger[_0xe04b('0x22')](_0xe04b('0x60'),_0xc2565a);throw _0xc2565a;});}return _0xe85a98;})[_0xe04b('0x1e')](respondWithResult(_0x445969,0xc9))[_0xe04b('0x26')](handleError(_0x445969,null));};exports[_0xe04b('0x32')]=function(_0x411b41,_0xd9f6d8){if(_0x411b41['body']['id']){delete _0x411b41[_0xe04b('0x5a')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x411b41['params']['id']},'include':[{'model':db[_0xe04b('0x3a')],'as':_0xe04b('0x3b')}]})[_0xe04b('0x1e')](handleEntityNotFound(_0xd9f6d8,null))['then'](saveUpdates(_0x411b41[_0xe04b('0x5a')],null))[_0xe04b('0x1e')](respondWithResult(_0xd9f6d8,null))[_0xe04b('0x26')](handleError(_0xd9f6d8,null));};exports['destroy']=function(_0x35468b,_0x4cc877){return db[_0xe04b('0x3d')]['find']({'where':{'id':_0x35468b['params']['id']}})[_0xe04b('0x1e')](handleEntityNotFound(_0x4cc877,null))[_0xe04b('0x1e')](removeEntity(_0x4cc877,null))[_0xe04b('0x26')](handleError(_0x4cc877,null));};exports[_0xe04b('0x61')]=function(_0x314eec,_0x55a576){return db[_0xe04b('0x3d')][_0xe04b('0x61')]()['then'](respondWithResult(_0x55a576,null))[_0xe04b('0x26')](handleError(_0x55a576,null));};exports[_0xe04b('0x62')]=function(_0x3307a8,_0x112709,_0x771cc6){if(_0x3307a8[_0xe04b('0x5a')]['id']){delete _0x3307a8[_0xe04b('0x5a')]['id'];}return db[_0xe04b('0x3d')][_0xe04b('0x58')]({'where':{'id':_0x3307a8[_0xe04b('0x56')]['id']}})[_0xe04b('0x1e')](handleEntityNotFound(_0x112709,null))[_0xe04b('0x1e')](function(_0x236478){if(_0x236478){_0x3307a8[_0xe04b('0x5a')][_0xe04b('0x63')]=_0x236478['id'];return db[_0xe04b('0x64')][_0xe04b('0x59')](_0x3307a8[_0xe04b('0x5a')]);}})[_0xe04b('0x1e')](respondWithResult(_0x112709,null))[_0xe04b('0x26')](handleError(_0x112709,null));};exports[_0xe04b('0x65')]=function(_0x5d5f75,_0x139cfb,_0x56d605){var _0x3bdf5d={'raw':![],'where':{}};var _0xd69f31={};var _0x4802be={'count':0x0,'rows':[]};return db[_0xe04b('0x3d')]['findOne']({'where':{'id':_0x5d5f75[_0xe04b('0x56')]['id']}})['then'](handleEntityNotFound(_0x139cfb,null))[_0xe04b('0x1e')](function(_0x43ac9a){if(_0x43ac9a){_0xd69f31[_0xe04b('0x41')]=_[_0xe04b('0x42')](db[_0xe04b('0x64')][_0xe04b('0x3e')]);_0xd69f31[_0xe04b('0x43')]=_[_0xe04b('0x42')](_0x5d5f75[_0xe04b('0x43')]);_0xd69f31[_0xe04b('0x44')]=_[_0xe04b('0x45')](_0xd69f31[_0xe04b('0x41')],_0xd69f31[_0xe04b('0x43')]);_0x3bdf5d[_0xe04b('0x46')]=_['intersection'](_0xd69f31[_0xe04b('0x41')],qs['fields'](_0x5d5f75[_0xe04b('0x43')][_0xe04b('0x47')]));_0x3bdf5d['attributes']=_0x3bdf5d['attributes'][_0xe04b('0x57')]?_0x3bdf5d[_0xe04b('0x46')]:_0xd69f31['model'];if(!_0x5d5f75[_0xe04b('0x43')][_0xe04b('0x48')](_0xe04b('0x49'))){_0x3bdf5d[_0xe04b('0x2e')]=qs[_0xe04b('0x2e')](_0x5d5f75['query'][_0xe04b('0x2e')]);_0x3bdf5d[_0xe04b('0x2b')]=qs[_0xe04b('0x2b')](_0x5d5f75['query'][_0xe04b('0x2b')]);}_0x3bdf5d['order']=qs[_0xe04b('0x4b')](_0x5d5f75[_0xe04b('0x43')][_0xe04b('0x4b')]);_0x3bdf5d[_0xe04b('0x4c')]=qs[_0xe04b('0x44')](_[_0xe04b('0x66')](_0x5d5f75[_0xe04b('0x43')],_0xd69f31[_0xe04b('0x44')]));_0x3bdf5d[_0xe04b('0x4c')][_0xe04b('0x63')]=_0x43ac9a['id'];if(_0x5d5f75['query'][_0xe04b('0x4d')]){_0x3bdf5d['where']=_['merge'](_0x3bdf5d[_0xe04b('0x4c')],{'$or':_[_0xe04b('0x3c')](_0x3bdf5d[_0xe04b('0x46')],function(_0x54a5ff){var _0x10b011={};_0x10b011[_0x54a5ff]={'$like':'%'+_0x5d5f75[_0xe04b('0x43')][_0xe04b('0x4d')]+'%'};return _0x10b011;})});}_0x3bdf5d=_[_0xe04b('0x4e')]({},_0x3bdf5d,_0x5d5f75[_0xe04b('0x50')]);return db[_0xe04b('0x64')]['count']({'where':_0x3bdf5d[_0xe04b('0x4c')]})[_0xe04b('0x1e')](function(_0x11c4d6){_0x4802be[_0xe04b('0x2d')]=_0x11c4d6;if(_0x5d5f75['query'][_0xe04b('0x51')]){_0x3bdf5d[_0xe04b('0x52')]=[{'all':!![]}];}return db[_0xe04b('0x64')][_0xe04b('0x53')](_0x3bdf5d);})[_0xe04b('0x1e')](function(_0x351c67){_0x4802be[_0xe04b('0x54')]=_0x351c67;return _0x4802be;});}})[_0xe04b('0x1e')](respondWithFilteredResult(_0x139cfb,_0x3bdf5d))[_0xe04b('0x26')](handleError(_0x139cfb,null));};exports[_0xe04b('0x67')]=function(_0x48aff5,_0x10c617,_0x586609){return db[_0xe04b('0x3d')]['find']({'where':{'id':_0x48aff5[_0xe04b('0x56')]['id']}})[_0xe04b('0x1e')](handleEntityNotFound(_0x10c617,null))[_0xe04b('0x1e')](function(_0x5636c5){if(_0x5636c5){return _0x5636c5[_0xe04b('0x67')](_0x48aff5['query'][_0xe04b('0x68')]);}})[_0xe04b('0x1e')](respondWithStatusCode(_0x10c617,null))[_0xe04b('0x26')](handleError(_0x10c617,null));};exports['addAnswer']=function(_0x43e3c0,_0x442bf0,_0x32f835){if(_0x43e3c0[_0xe04b('0x5a')]['id']){delete _0x43e3c0[_0xe04b('0x5a')]['id'];}return db[_0xe04b('0x3d')]['find']({'where':{'id':_0x43e3c0[_0xe04b('0x56')]['id']}})[_0xe04b('0x1e')](handleEntityNotFound(_0x442bf0,null))[_0xe04b('0x1e')](function(_0x2ce97e){if(_0x2ce97e){_0x43e3c0['body'][_0xe04b('0x63')]=_0x2ce97e['id'];return db['CannedAnswer'][_0xe04b('0x59')](_0x43e3c0[_0xe04b('0x5a')]);}})['then'](respondWithResult(_0x442bf0,null))[_0xe04b('0x26')](handleError(_0x442bf0,null));};exports[_0xe04b('0x69')]=function(_0x477269,_0x2f8cad,_0x2884fb){var _0x303ac1={'raw':![],'where':{}};var _0x113a3e={};var _0x393eed={'count':0x0,'rows':[]};return db[_0xe04b('0x3d')]['findOne']({'where':{'id':_0x477269[_0xe04b('0x56')]['id']}})['then'](handleEntityNotFound(_0x2f8cad,null))[_0xe04b('0x1e')](function(_0x833954){if(_0x833954){_0x113a3e[_0xe04b('0x41')]=_[_0xe04b('0x42')](db[_0xe04b('0x6a')]['rawAttributes']);_0x113a3e[_0xe04b('0x43')]=_[_0xe04b('0x42')](_0x477269[_0xe04b('0x43')]);_0x113a3e[_0xe04b('0x44')]=_['intersection'](_0x113a3e[_0xe04b('0x41')],_0x113a3e[_0xe04b('0x43')]);_0x303ac1['attributes']=_['intersection'](_0x113a3e['model'],qs[_0xe04b('0x47')](_0x477269[_0xe04b('0x43')][_0xe04b('0x47')]));_0x303ac1['attributes']=_0x303ac1[_0xe04b('0x46')][_0xe04b('0x57')]?_0x303ac1[_0xe04b('0x46')]:_0x113a3e[_0xe04b('0x41')];if(!_0x477269['query'][_0xe04b('0x48')](_0xe04b('0x49'))){_0x303ac1[_0xe04b('0x2e')]=qs[_0xe04b('0x2e')](_0x477269[_0xe04b('0x43')][_0xe04b('0x2e')]);_0x303ac1['offset']=qs[_0xe04b('0x2b')](_0x477269[_0xe04b('0x43')][_0xe04b('0x2b')]);}_0x303ac1[_0xe04b('0x4a')]=qs[_0xe04b('0x4b')](_0x477269[_0xe04b('0x43')][_0xe04b('0x4b')]);_0x303ac1[_0xe04b('0x4c')]=qs[_0xe04b('0x44')](_[_0xe04b('0x66')](_0x477269[_0xe04b('0x43')],_0x113a3e['filters']));_0x303ac1['where'][_0xe04b('0x63')]=_0x833954['id'];if(_0x477269[_0xe04b('0x43')][_0xe04b('0x4d')]){_0x303ac1[_0xe04b('0x4c')]=_['merge'](_0x303ac1[_0xe04b('0x4c')],{'$or':_[_0xe04b('0x3c')](_0x303ac1[_0xe04b('0x46')],function(_0x1e79e5){var _0x4d2927={};_0x4d2927[_0x1e79e5]={'$like':'%'+_0x477269[_0xe04b('0x43')][_0xe04b('0x4d')]+'%'};return _0x4d2927;})});}_0x303ac1=_['merge']({},_0x303ac1,_0x477269[_0xe04b('0x50')]);return db[_0xe04b('0x6a')][_0xe04b('0x2d')]({'where':_0x303ac1[_0xe04b('0x4c')]})[_0xe04b('0x1e')](function(_0x15fb52){_0x393eed[_0xe04b('0x2d')]=_0x15fb52;if(_0x477269[_0xe04b('0x43')]['includeAll']){_0x303ac1['include']=[{'all':!![]}];}return db[_0xe04b('0x6a')][_0xe04b('0x53')](_0x303ac1);})[_0xe04b('0x1e')](function(_0x36e949){_0x393eed[_0xe04b('0x54')]=_0x36e949;return _0x393eed;});}})['then'](respondWithFilteredResult(_0x2f8cad,_0x303ac1))[_0xe04b('0x26')](handleError(_0x2f8cad,null));};exports['removeAnswers']=function(_0x1bb300,_0x36ada3,_0x42493c){return db[_0xe04b('0x3d')][_0xe04b('0x58')]({'where':{'id':_0x1bb300[_0xe04b('0x56')]['id']}})[_0xe04b('0x1e')](handleEntityNotFound(_0x36ada3,null))[_0xe04b('0x1e')](function(_0x50d5e4){if(_0x50d5e4){return _0x50d5e4['removeAnswers'](_0x1bb300[_0xe04b('0x43')][_0xe04b('0x68')]);}})['then'](respondWithStatusCode(_0x36ada3,null))[_0xe04b('0x26')](handleError(_0x36ada3,null));};exports[_0xe04b('0x6b')]=function(_0x2db7f9,_0x343866,_0x37e867){return db['FaxInteraction'][_0xe04b('0x58')]({'where':{'id':_0x2db7f9[_0xe04b('0x56')]['id']}})[_0xe04b('0x1e')](handleEntityNotFound(_0x343866,null))['then'](function(_0x237e30){if(_0x237e30){return _0x237e30[_0xe04b('0x6b')](_0x2db7f9[_0xe04b('0x5a')][_0xe04b('0x68')],_[_0xe04b('0x6c')](_0x2db7f9[_0xe04b('0x5a')],[_0xe04b('0x68'),'id'])||{});}})[_0xe04b('0x1e')](respondWithResult(_0x343866,null))['catch'](handleError(_0x343866,null));};exports[_0xe04b('0x6d')]=function(_0x47c357,_0x287f3d,_0x46fed5){var _0xb50003={'raw':![],'where':{}};var _0x23e640={};var _0x19cffa={'count':0x0,'rows':[]};return db[_0xe04b('0x3d')][_0xe04b('0x6e')]({'where':{'id':_0x47c357[_0xe04b('0x56')]['id']}})[_0xe04b('0x1e')](handleEntityNotFound(_0x287f3d,null))[_0xe04b('0x1e')](function(_0x46957b){if(_0x46957b){_0x23e640[_0xe04b('0x41')]=_[_0xe04b('0x42')](db[_0xe04b('0x6f')][_0xe04b('0x3e')]);_0x23e640[_0xe04b('0x43')]=_[_0xe04b('0x42')](_0x47c357[_0xe04b('0x43')]);_0x23e640[_0xe04b('0x44')]=_[_0xe04b('0x45')](_0x23e640[_0xe04b('0x41')],_0x23e640[_0xe04b('0x43')]);_0xb50003[_0xe04b('0x46')]=_[_0xe04b('0x45')](_0x23e640[_0xe04b('0x41')],qs['fields'](_0x47c357[_0xe04b('0x43')][_0xe04b('0x47')]));_0xb50003[_0xe04b('0x46')]=_0xb50003[_0xe04b('0x46')][_0xe04b('0x57')]?_0xb50003[_0xe04b('0x46')]:_0x23e640[_0xe04b('0x41')];if(!_0x47c357[_0xe04b('0x43')][_0xe04b('0x48')](_0xe04b('0x49'))){_0xb50003[_0xe04b('0x2e')]=qs['limit'](_0x47c357[_0xe04b('0x43')]['limit']);_0xb50003['offset']=qs['offset'](_0x47c357[_0xe04b('0x43')][_0xe04b('0x2b')]);}_0xb50003['order']=qs[_0xe04b('0x4b')](_0x47c357[_0xe04b('0x43')][_0xe04b('0x4b')]);_0xb50003[_0xe04b('0x4c')]=qs[_0xe04b('0x44')](_[_0xe04b('0x66')](_0x47c357['query'],_0x23e640['filters']));_0xb50003[_0xe04b('0x4c')][_0xe04b('0x63')]=_0x46957b['id'];if(_0x47c357[_0xe04b('0x43')][_0xe04b('0x4d')]){_0xb50003[_0xe04b('0x4c')]=_[_0xe04b('0x4e')](_0xb50003[_0xe04b('0x4c')],{'$or':_[_0xe04b('0x3c')](_0xb50003[_0xe04b('0x46')],function(_0x36e75a){var _0x413c9a={};_0x413c9a[_0x36e75a]={'$like':'%'+_0x47c357[_0xe04b('0x43')][_0xe04b('0x4d')]+'%'};return _0x413c9a;})});}_0xb50003=_[_0xe04b('0x4e')]({},_0xb50003,_0x47c357[_0xe04b('0x50')]);return db[_0xe04b('0x6f')][_0xe04b('0x2d')]({'where':_0xb50003['where']})[_0xe04b('0x1e')](function(_0xc5385e){_0x19cffa[_0xe04b('0x2d')]=_0xc5385e;if(_0x47c357['query'][_0xe04b('0x51')]){_0xb50003[_0xe04b('0x52')]=[{'model':db[_0xe04b('0x70')],'as':'Contact','required':![]},{'model':db[_0xe04b('0x71')],'as':_0xe04b('0x72'),'attributes':['name',_0xe04b('0x73'),_0xe04b('0x74')],'required':![]},{'model':db[_0xe04b('0x75')],'as':'Tags','attributes':['id',_0xe04b('0x37'),'color'],'where':_0x47c357['query']['tag']?{'id':_0x47c357[_0xe04b('0x43')][_0xe04b('0x76')]}:undefined,'required':_0x47c357[_0xe04b('0x43')][_0xe04b('0x76')]?!![]:![]}];}return db['FaxInteraction'][_0xe04b('0x53')](_0xb50003);})[_0xe04b('0x1e')](function(_0x2bda61){_0x19cffa[_0xe04b('0x54')]=_0x2bda61;return _0x19cffa;});}})[_0xe04b('0x1e')](respondWithFilteredResult(_0x287f3d,_0xb50003))[_0xe04b('0x26')](handleError(_0x287f3d,null));};exports[_0xe04b('0x77')]=function(_0x3dfa26,_0x5c80f8,_0x275b51){return db['FaxAccount'][_0xe04b('0x6e')]({'where':{'id':_0x3dfa26['params']['id']}})[_0xe04b('0x1e')](handleEntityNotFound(_0x5c80f8,null))['then'](function(_0x3a8f50){if(_0x3a8f50){return db[_0xe04b('0x78')]['transaction'](function(_0x2ee26f){return db[_0xe04b('0x79')][_0xe04b('0x33')]({'where':{'FaxAccountId':_0x3dfa26[_0xe04b('0x56')]['id']},'transaction':_0x2ee26f})[_0xe04b('0x1e')](function(_0x32a210){var _0x5d0296=_[_0xe04b('0x3c')](_0x3dfa26[_0xe04b('0x5a')],function(_0x4aafab){_0x4aafab['FaxAccountId']=_0x3dfa26[_0xe04b('0x56')]['id'];return _0x4aafab;});return db[_0xe04b('0x79')]['bulkCreate'](_0x5d0296,{'transaction':_0x2ee26f});});})[_0xe04b('0x1e')](function(){return db[_0xe04b('0x79')]['findAndCountAll']({'where':{'FaxAccountId':_0x3dfa26['params']['id']},'order':'priority'});});}})[_0xe04b('0x1e')](respondWithResult(_0x5c80f8,null))[_0xe04b('0x26')](handleError(_0x5c80f8,null));};exports[_0xe04b('0x7a')]=function(_0x10f3bb,_0x133c09,_0x466f96){var _0x32d8e6={};var _0x3813f2={};var _0x1a832c;var _0xd30756;return db[_0xe04b('0x3d')][_0xe04b('0x6e')]({'where':{'id':_0x10f3bb[_0xe04b('0x56')]['id']}})[_0xe04b('0x1e')](handleEntityNotFound(_0x133c09,null))['then'](function(_0x382f90){if(_0x382f90){_0x1a832c=_0x382f90;_0x3813f2['model']=_['keys'](db['FaxApplication'][_0xe04b('0x3e')]);_0x3813f2[_0xe04b('0x43')]=_['keys'](_0x10f3bb[_0xe04b('0x43')]);_0x3813f2[_0xe04b('0x44')]=_['intersection'](_0x3813f2['model'],_0x3813f2['query']);_0x32d8e6[_0xe04b('0x46')]=_[_0xe04b('0x45')](_0x3813f2['model'],qs[_0xe04b('0x47')](_0x10f3bb['query'][_0xe04b('0x47')]));_0x32d8e6['attributes']=_0x32d8e6[_0xe04b('0x46')][_0xe04b('0x57')]?_0x32d8e6['attributes']:_0x3813f2[_0xe04b('0x41')];_0x32d8e6[_0xe04b('0x4a')]=qs[_0xe04b('0x4b')](_0x10f3bb[_0xe04b('0x43')][_0xe04b('0x4b')]);_0x32d8e6['where']=qs[_0xe04b('0x44')](_[_0xe04b('0x66')](_0x10f3bb[_0xe04b('0x43')],_0x3813f2[_0xe04b('0x44')]));if(_0x10f3bb[_0xe04b('0x43')][_0xe04b('0x4d')]){_0x32d8e6['where']=_[_0xe04b('0x4e')](_0x32d8e6[_0xe04b('0x4c')],{'$or':_['map'](_0x32d8e6[_0xe04b('0x46')],function(_0x2d3501){var _0x2b504={};_0x2b504[_0x2d3501]={'$like':'%'+_0x10f3bb[_0xe04b('0x43')]['filter']+'%'};return _0x2b504;})});}_0x32d8e6=_[_0xe04b('0x4e')]({},_0x32d8e6,_0x10f3bb[_0xe04b('0x50')]);return _0x1a832c['getApplications'](_0x32d8e6);}})[_0xe04b('0x1e')](function(_0x11d502){if(_0x11d502){_0xd30756=_0x11d502[_0xe04b('0x57')];if(!_0x10f3bb[_0xe04b('0x43')]['hasOwnProperty'](_0xe04b('0x49'))){_0x32d8e6[_0xe04b('0x2e')]=qs['limit'](_0x10f3bb['query']['limit']);_0x32d8e6[_0xe04b('0x2b')]=qs[_0xe04b('0x2b')](_0x10f3bb[_0xe04b('0x43')]['offset']);}return _0x1a832c['getApplications'](_0x32d8e6);}})[_0xe04b('0x1e')](function(_0x3acc50){if(_0x3acc50){return _0x3acc50?{'count':_0xd30756,'rows':_0x3acc50}:null;}})[_0xe04b('0x1e')](respondWithResult(_0x133c09,null))[_0xe04b('0x26')](handleError(_0x133c09,null));};function Extension(_0x2f894e,_0x4698d4,_0x54385a,_0x58a37e){this[_0xe04b('0x7b')]='from-voip-provider';this[_0xe04b('0x7c')]=_0x2f894e[_0xe04b('0x7d')];this[_0xe04b('0x7e')]=_0x58a37e;this[_0xe04b('0x40')]=_0xe04b('0x7f');this[_0xe04b('0x80')]=_0xe04b('0x81');this[_0xe04b('0x63')]=_0x2f894e['id'];this[_0xe04b('0x82')]=_0x4698d4;this[_0xe04b('0x83')]=_0x54385a;}function createExtensionsReciveFax(_0x5bf220){var _0xac6bb2=0x1;var _0x116430=[];_0x116430[_0xe04b('0x84')](new Extension(_0x5bf220,_0xac6bb2,'',_0xe04b('0x85')));_0xac6bb2+=0x1;_0x116430[_0xe04b('0x84')](new Extension(_0x5bf220,_0xac6bb2,_0xe04b('0x86'),_0xe04b('0x87')));_0xac6bb2+=0x1;for(var _0x13baba in _0x5bf220){if(_0x5bf220[_0xe04b('0x48')](_0x13baba)&&(_0x13baba===_0xe04b('0x88')||_0x13baba===_0xe04b('0x7d')||_0x13baba===_0xe04b('0x89')||_0x13baba===_0xe04b('0x8a')||_0x13baba===_0xe04b('0x8b')||_0x13baba===_0xe04b('0x8c')||_0x13baba===_0xe04b('0x8d')||_0x13baba===_0xe04b('0x8e')||_0x13baba===_0xe04b('0x8f'))){_0x116430[_0xe04b('0x84')](new Extension(_0x5bf220,_0xac6bb2,_0xe04b('0x90')+_0x13baba+')='+_0x5bf220[_0x13baba],_0xe04b('0x87')));_0xac6bb2+=0x1;}}_0x116430[_0xe04b('0x84')](new Extension(_0x5bf220,_0xac6bb2,'6',_0xe04b('0x91')));_0xac6bb2+=0x1;_0x116430[_0xe04b('0x84')](new Extension(_0x5bf220,_0xac6bb2,_0xe04b('0x92'),_0xe04b('0x93')));_0xac6bb2=0x0;return _0x116430;}exports[_0xe04b('0x94')]=function(_0xbac1ab,_0x1928fd,_0x480bd1){var _0x10e8bb;return db[_0xe04b('0x78')][_0xe04b('0x95')](function(_0x50b66a){return db[_0xe04b('0x3d')][_0xe04b('0x59')](_0xbac1ab['body'],{'transaction':_0x50b66a})[_0xe04b('0x1e')](function(_0x57450b){_0x10e8bb=_0x57450b[_0xe04b('0x34')]({'plain':!![]});return db['VoiceExtension'][_0xe04b('0x96')](createExtensionsReciveFax(_0x10e8bb),{'transaction':_0x50b66a});});})[_0xe04b('0x1e')](function(){return _0x10e8bb;})[_0xe04b('0x1e')](respondWithResult(_0x1928fd,null))['catch'](handleError(_0x1928fd,null));};exports['updateAccountApplications']=function(_0x5209fe,_0x5715e3,_0x49ea51){var _0x429200;return db[_0xe04b('0x78')][_0xe04b('0x95')](function(_0xa068e3){return db[_0xe04b('0x3d')][_0xe04b('0x32')](_0x5209fe[_0xe04b('0x5a')],{'where':{'id':_0x5209fe[_0xe04b('0x5a')]['id']},'transaction':_0xa068e3})[_0xe04b('0x1e')](function(_0xc3b13b){return db[_0xe04b('0x97')][_0xe04b('0x33')]({'where':{'FaxAccountId':_0x5209fe[_0xe04b('0x5a')]['id']},'transaction':_0xa068e3})[_0xe04b('0x1e')](function(_0x3b5504){return db['VoiceExtension'][_0xe04b('0x96')](createExtensionsReciveFax(_[_0xe04b('0x6c')](_0x5209fe[_0xe04b('0x5a')],[_0xe04b('0x98'),_0xe04b('0x99'),_0xe04b('0x9a'),_0xe04b('0x9b'),_0xe04b('0x9c'),_0xe04b('0x9d')])),{'transaction':_0xa068e3});});});})['then'](function(){return db[_0xe04b('0x3d')][_0xe04b('0x9e')](_0x5209fe[_0xe04b('0x5a')]['id']);})['then'](respondWithResult(_0x5715e3,null))['catch'](handleError(_0x5715e3,null));};exports['getMessages']=function(_0x520d95,_0x140a1,_0x180571){var _0x44a4bd={'raw':!![],'where':{}};var _0x4664de={};var _0x2b2543={'count':0x0,'rows':[]};return db[_0xe04b('0x3d')][_0xe04b('0x6e')]({'where':{'id':_0x520d95[_0xe04b('0x56')]['id']}})[_0xe04b('0x1e')](handleEntityNotFound(_0x140a1,null))[_0xe04b('0x1e')](function(_0x463e6c){if(_0x463e6c){_0x4664de[_0xe04b('0x41')]=_['keys'](db[_0xe04b('0x9f')][_0xe04b('0x3e')]);_0x4664de[_0xe04b('0x43')]=_['keys'](_0x520d95['query']);_0x4664de['filters']=_[_0xe04b('0x45')](_0x4664de[_0xe04b('0x41')],_0x4664de['query']);_0x44a4bd[_0xe04b('0x46')]=_[_0xe04b('0x45')](_0x4664de[_0xe04b('0x41')],qs[_0xe04b('0x47')](_0x520d95['query']['fields']));_0x44a4bd[_0xe04b('0x46')]=_0x44a4bd[_0xe04b('0x46')][_0xe04b('0x57')]?_0x44a4bd[_0xe04b('0x46')]:_0x4664de[_0xe04b('0x41')];if(!_0x520d95[_0xe04b('0x43')][_0xe04b('0x48')](_0xe04b('0x49'))){_0x44a4bd[_0xe04b('0x2e')]=qs[_0xe04b('0x2e')](_0x520d95[_0xe04b('0x43')][_0xe04b('0x2e')]);_0x44a4bd[_0xe04b('0x2b')]=qs[_0xe04b('0x2b')](_0x520d95[_0xe04b('0x43')][_0xe04b('0x2b')]);}_0x44a4bd[_0xe04b('0x4a')]=qs['sort'](_0x520d95[_0xe04b('0x43')][_0xe04b('0x4b')]);_0x44a4bd[_0xe04b('0x4c')]=qs[_0xe04b('0x44')](_[_0xe04b('0x66')](_0x520d95[_0xe04b('0x43')],_0x4664de[_0xe04b('0x44')]));_0x44a4bd[_0xe04b('0x4c')][_0xe04b('0x63')]=_0x463e6c['id'];if(_0x520d95[_0xe04b('0x43')][_0xe04b('0x4d')]){_0x44a4bd[_0xe04b('0x4c')]=_[_0xe04b('0x4e')](_0x44a4bd['where'],{'$or':_[_0xe04b('0x3c')](_0x44a4bd[_0xe04b('0x46')],function(_0x21be95){var _0x44ab20={};_0x44ab20[_0x21be95]={'$like':'%'+_0x520d95[_0xe04b('0x43')][_0xe04b('0x4d')]+'%'};return _0x44ab20;})});}if(_0x520d95[_0xe04b('0x43')][_0xe04b('0xa0')]){var _0x518e06=_0x520d95[_0xe04b('0x43')][_0xe04b('0xa0')][_0xe04b('0xa1')](',');var _0x59ead={};_0x59ead[_0x518e06[0x0]]={'$gte':moment(_0x518e06[0x1])[_0xe04b('0xa2')](_0xe04b('0xa3'))};_0x44a4bd[_0xe04b('0x4c')]=_['merge'](_0x44a4bd[_0xe04b('0x4c')],_0x59ead);}_0x44a4bd=_[_0xe04b('0x4e')]({},_0x44a4bd,_0x520d95[_0xe04b('0x50')]);return db[_0xe04b('0x9f')]['count']({'where':_0x44a4bd[_0xe04b('0x4c')]})[_0xe04b('0x1e')](function(_0x12c3e2){_0x2b2543[_0xe04b('0x2d')]=_0x12c3e2;if(_0x520d95[_0xe04b('0x43')]['includeAll']){_0x44a4bd[_0xe04b('0x52')]=[{'all':!![]}];}return db[_0xe04b('0x9f')][_0xe04b('0x53')](_0x44a4bd);})['then'](function(_0xb51c7f){_0x2b2543[_0xe04b('0x54')]=_0xb51c7f;return _0x2b2543;});}})['then'](respondWithFilteredResult(_0x140a1,_0x44a4bd))[_0xe04b('0x26')](handleError(_0x140a1,null));};exports[_0xe04b('0x38')]=function(_0x25e217,_0x2bed0a,_0x473d10){var _0x17b6be,_0xdedab7={},_0x508de3;if(_0x25e217['body']['to']){_0x508de3=_0x25e217['body']['to'][0x0];}return db[_0xe04b('0x3d')][_0xe04b('0x58')]({'where':{'id':_0x25e217[_0xe04b('0x56')]['id']},'include':[{'model':db[_0xe04b('0xa4')],'as':'List','include':[{'model':db[_0xe04b('0x70')],'as':_0xe04b('0xa5'),'where':{'fax':_0x508de3},'limit':0x1,'order':[['updatedAt',_0xe04b('0xa6')]]}]}]})[_0xe04b('0x1e')](handleEntityNotFound(_0x2bed0a,null))[_0xe04b('0x1e')](function(_0x4ae381){_0x17b6be=_0x4ae381;if(_0x25e217['body'][_0xe04b('0xa7')]&&_0x25e217[_0xe04b('0x5a')][_0xe04b('0xa7')][_0xe04b('0x57')]){for(var _0xbbdd2c=0x0;_0xbbdd2c<_0x25e217[_0xe04b('0x5a')]['attachments'][_0xe04b('0x57')];_0xbbdd2c+=0x1){_0x25e217[_0xe04b('0x5a')][_0xe04b('0xa7')][_0xbbdd2c]={'filename':_0x25e217[_0xe04b('0x5a')][_0xe04b('0xa7')][_0xbbdd2c][_0xe04b('0x37')],'id':_0x25e217[_0xe04b('0x5a')][_0xe04b('0xa7')][_0xbbdd2c]['id'],'path':path[_0xe04b('0xa8')](config[_0xe04b('0xa9')],_0xe04b('0xaa'),_0x25e217[_0xe04b('0x5a')]['attachments'][_0xbbdd2c][_0xe04b('0xab')])};}}return respondWithRpcPromise(_0xe04b('0xac'),_0xe04b('0xac'),{'FaxAccountId':_[_0xe04b('0xad')](_0x25e217[_0xe04b('0x56')]['id'])?undefined:_0x25e217['params']['id'],'path':_['isNil'](_0x25e217[_0xe04b('0x5a')][_0xe04b('0xa7')][0x0][_0xe04b('0xae')])?undefined:_0x25e217[_0xe04b('0x5a')][_0xe04b('0xa7')][0x0][_0xe04b('0xae')],'fax':_[_0xe04b('0xad')](_0x25e217[_0xe04b('0x5a')]['to'][0x0])?undefined:_0x25e217[_0xe04b('0x5a')]['to'][0x0]},client9002);})[_0xe04b('0x1e')](function(){if(_0x17b6be){if(_[_0xe04b('0xad')](_0x25e217[_0xe04b('0x5a')][_0xe04b('0xaf')])){_0x25e217[_0xe04b('0x5a')]['from']=util[_0xe04b('0xa2')](_0xe04b('0xb0'),_0x17b6be[_0xe04b('0x37')],_0x17b6be[_0xe04b('0xb1')]);}if(_0x17b6be[_0xe04b('0xb2')]){if(_0x17b6be[_0xe04b('0xb2')]['Contacts'][_0xe04b('0x57')]){return _0x17b6be['List'][_0xe04b('0xa5')][0x0];}else{return db[_0xe04b('0x70')][_0xe04b('0x59')](_[_0xe04b('0xb3')](_0x25e217['body'],{'firstName':_0x25e217['body']['to'][0x0],'phone':_0x25e217[_0xe04b('0x5a')]['to'][0x0],'fax':_0x25e217[_0xe04b('0x5a')]['to'][0x0],'ListId':_0x17b6be[_0xe04b('0x9d')]}));}}else{throw new Error(_0xe04b('0xb4'));}}else{throw new Error(_0xe04b('0xb5'));}})[_0xe04b('0x1e')](function(_0x453998){if(_0x453998){return db[_0xe04b('0x6f')][_0xe04b('0x58')]({'where':{'ContactId':_0x453998['id'],'closed':![],'FaxAccountId':_0x17b6be['id']}})[_0xe04b('0x1e')](function(_0x3aa653){if(_0x3aa653){return[_0x3aa653,![]];}return db[_0xe04b('0x6f')][_0xe04b('0x59')]({'UserId':_0x25e217[_0xe04b('0x5b')]['id'],'ContactId':_0x453998['id'],'FaxAccountId':_0x17b6be['id'],'fax':_0x25e217['body']['to'][0x0],'firstMsgDirection':_0xe04b('0xb6'),'Messages':[_[_0xe04b('0x4e')](_0x25e217[_0xe04b('0x5a')],{'read':![],'body':_0x25e217['body'][_0xe04b('0xa7')][0x0][_0xe04b('0xb7')],'FaxAccountId':_0x17b6be['id'],'UserId':_0x25e217[_0xe04b('0x5b')]['id'],'ContactId':_0x453998['id'],'AttachmentId':_0x25e217[_0xe04b('0x5a')][_0xe04b('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0xe04b('0x9f')],'as':_0xe04b('0xb8')}]})[_0xe04b('0x1e')](function(_0x28f3b0){return[_0x28f3b0,!![]];});});}else{throw new Error(_0xe04b('0xb9'));}})['spread'](function(_0xd9c2f6,_0x52ee28){if(_0x52ee28){return _0xd9c2f6;}return db[_0xe04b('0x9f')][_0xe04b('0x59')]({'direction':'out','read':![],'body':_0x25e217[_0xe04b('0x5a')][_0xe04b('0xa7')][0x0][_0xe04b('0xb7')],'FaxAccountId':_0x17b6be['id'],'FaxInteractionId':_0xd9c2f6['id'],'UserId':_0x25e217[_0xe04b('0x5b')]['id'],'ContactId':_0xd9c2f6[_0xe04b('0xba')],'AttachmentId':_0x25e217['body'][_0xe04b('0xa7')][0x0]['id']})['then'](function(_0x3f6c33){_0xd9c2f6[_0xe04b('0xbb')][_0xe04b('0xb8')]=[];_0xd9c2f6['dataValues'][_0xe04b('0xb8')][_0xe04b('0x84')](_0x3f6c33['dataValues']);return _0xd9c2f6;});})[_0xe04b('0x1e')](function(_0x372cc0){respondWithRpcPromise(_0xe04b('0xbc'),_0xe04b('0xbc'),{'FaxAccountId':_[_0xe04b('0xad')](_0x25e217[_0xe04b('0x56')]['id'])?undefined:_0x25e217['params']['id'],'path':_[_0xe04b('0xad')](_0x25e217[_0xe04b('0x5a')]['attachments'][0x0]['path'])?undefined:_0x25e217[_0xe04b('0x5a')][_0xe04b('0xa7')][0x0][_0xe04b('0xae')],'fax':_['isNil'](_0x25e217[_0xe04b('0x5a')]['to'][0x0])?undefined:_0x25e217[_0xe04b('0x5a')]['to'][0x0],'AttachmentId':_0x25e217['body'][_0xe04b('0xa7')][0x0]['id']},client9002)['then'](function(_0x2a2a18){logger[_0xe04b('0x1f')](_0xe04b('0xbd'),_0x2a2a18);})[_0xe04b('0x26')](function(_0x38784a){logger['info'](_0xe04b('0xbd'),_0x38784a);});return _0x372cc0;})[_0xe04b('0x1e')](respondWithResult(_0x2bed0a,null))[_0xe04b('0x26')](handleError(_0x2bed0a,null));};exports[_0xe04b('0xbe')]=function(_0x4784b9,_0x2df1b7,_0x458614){return db[_0xe04b('0x3d')][_0xe04b('0x58')]({'where':{'id':_0x4784b9[_0xe04b('0x56')]['id']}})[_0xe04b('0x1e')](handleEntityNotFound(_0x2df1b7,null))['then'](function(_0x3d1561){if(_0x3d1561){return _0x3d1561[_0xe04b('0xbe')](_0x4784b9['body'][_0xe04b('0x68')],_[_0xe04b('0x6c')](_0x4784b9[_0xe04b('0x5a')],[_0xe04b('0x68'),'id'])||{})[_0xe04b('0xbf')](function(_0x54c834){for(var _0x3994aa=0x0;_0x3994aa<_0x4784b9[_0xe04b('0x5a')][_0xe04b('0x68')][_0xe04b('0x57')];_0x3994aa+=0x1){socket[_0xe04b('0xc0')](_0xe04b('0xc1'),{'UserId':_0x4784b9['body'][_0xe04b('0x68')][_0x3994aa],'FaxAccountId':_0x4784b9[_0xe04b('0x56')]['id']});}return _0x54c834;});}})['then'](respondWithResult(_0x2df1b7,null))[_0xe04b('0x26')](handleError(_0x2df1b7,null));};exports[_0xe04b('0xc2')]=function(_0x1d4a7f,_0x1b8282,_0x4c4d16){return db[_0xe04b('0x3d')][_0xe04b('0x58')]({'where':{'id':_0x1d4a7f[_0xe04b('0x56')]['id']}})[_0xe04b('0x1e')](handleEntityNotFound(_0x1b8282,null))[_0xe04b('0x1e')](function(_0x5b1ba7){if(_0x5b1ba7){return _0x5b1ba7['removeAgents'](_0x1d4a7f[_0xe04b('0x43')][_0xe04b('0x68')])[_0xe04b('0x1e')](function(){if(_[_0xe04b('0xc3')](_0x1d4a7f['query'][_0xe04b('0x68')])){for(var _0x21f941=0x0;_0x21f941<_0x1d4a7f[_0xe04b('0x43')][_0xe04b('0x68')]['length'];_0x21f941+=0x1){socket[_0xe04b('0xc0')]('userFaxAccount:remove',{'UserId':Number(_0x1d4a7f['query']['ids'][_0x21f941]),'FaxAccountId':Number(_0x1d4a7f[_0xe04b('0x56')]['id'])});}}else{socket[_0xe04b('0xc0')](_0xe04b('0xc4'),{'UserId':Number(_0x1d4a7f[_0xe04b('0x43')][_0xe04b('0x68')]),'FaxAccountId':Number(_0x1d4a7f[_0xe04b('0x56')]['id'])});}});}})[_0xe04b('0x1e')](respondWithStatusCode(_0x1b8282,null))[_0xe04b('0x26')](handleError(_0x1b8282,null));};exports[_0xe04b('0xc5')]=function(_0x5479db,_0x2f0104,_0x327361){var _0x452ecd={};var _0x23e37d={};var _0x55cc47;var _0x422dc5;return db[_0xe04b('0x3d')][_0xe04b('0x6e')]({'where':{'id':_0x5479db[_0xe04b('0x56')]['id']}})[_0xe04b('0x1e')](handleEntityNotFound(_0x2f0104,null))[_0xe04b('0x1e')](function(_0x2c72fb){if(_0x2c72fb){_0x55cc47=_0x2c72fb;_0x23e37d[_0xe04b('0x41')]=_[_0xe04b('0x42')](db['User'][_0xe04b('0x3e')]);_0x23e37d[_0xe04b('0x43')]=_['keys'](_0x5479db[_0xe04b('0x43')]);_0x23e37d[_0xe04b('0x44')]=_[_0xe04b('0x45')](_0x23e37d[_0xe04b('0x41')],_0x23e37d[_0xe04b('0x43')]);_0x452ecd[_0xe04b('0x46')]=_[_0xe04b('0x45')](_0x23e37d[_0xe04b('0x41')],qs['fields'](_0x5479db[_0xe04b('0x43')][_0xe04b('0x47')]));_0x452ecd['attributes']=_0x452ecd['attributes']['length']?_0x452ecd[_0xe04b('0x46')]:_0x23e37d[_0xe04b('0x41')];_0x452ecd[_0xe04b('0x4a')]=qs[_0xe04b('0x4b')](_0x5479db[_0xe04b('0x43')][_0xe04b('0x4b')]);_0x452ecd[_0xe04b('0x4c')]=qs[_0xe04b('0x44')](_[_0xe04b('0x66')](_0x5479db[_0xe04b('0x43')],_0x23e37d[_0xe04b('0x44')]));if(_0x5479db[_0xe04b('0x43')][_0xe04b('0x4d')]){_0x452ecd[_0xe04b('0x4c')]=_[_0xe04b('0x4e')](_0x452ecd['where'],{'$or':_[_0xe04b('0x3c')](_0x452ecd['attributes'],function(_0x1fd891){var _0x5e57dd={};_0x5e57dd[_0x1fd891]={'$like':'%'+_0x5479db['query'][_0xe04b('0x4d')]+'%'};return _0x5e57dd;})});}_0x452ecd=_['merge']({},_0x452ecd,_0x5479db['options']);return _0x55cc47[_0xe04b('0xc5')](_0x452ecd);}})[_0xe04b('0x1e')](function(_0x16773a){if(_0x16773a){_0x422dc5=_0x16773a['length'];if(!_0x5479db[_0xe04b('0x43')][_0xe04b('0x48')](_0xe04b('0x49'))){_0x452ecd[_0xe04b('0x2e')]=qs['limit'](_0x5479db[_0xe04b('0x43')][_0xe04b('0x2e')]);_0x452ecd[_0xe04b('0x2b')]=qs[_0xe04b('0x2b')](_0x5479db[_0xe04b('0x43')]['offset']);}return _0x55cc47[_0xe04b('0xc5')](_0x452ecd);}})[_0xe04b('0x1e')](function(_0x4cec1a){if(_0x4cec1a){return _0x4cec1a?{'count':_0x422dc5,'rows':_0x4cec1a}:null;}})[_0xe04b('0x1e')](respondWithResult(_0x2f0104,null))[_0xe04b('0x26')](handleError(_0x2f0104,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 7f74b09..30c3f3b 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 _0x6cd7=['exports','events','FaxAccount','setMaxListeners','save','update','remove','emit','hook'];(function(_0x3eb713,_0x437874){var _0x1d7128=function(_0x2b9cea){while(--_0x2b9cea){_0x3eb713['push'](_0x3eb713['shift']());}};_0x1d7128(++_0x437874);}(_0x6cd7,0x1de));var _0x76cd=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x6cd7[_0x2ec461];return _0x28603d;};'use strict';var EventEmitter=require(_0x76cd('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x76cd('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x76cd('0x2')](0x0);var events={'afterCreate':_0x76cd('0x3'),'afterUpdate':_0x76cd('0x4'),'afterDestroy':_0x76cd('0x5')};function emitEvent(_0x13e497){return function(_0x16b7a8,_0x5c29fd,_0x5e0248){FaxAccountEvents[_0x76cd('0x6')](_0x13e497+':'+_0x16b7a8['id'],_0x16b7a8);FaxAccountEvents[_0x76cd('0x6')](_0x13e497,_0x16b7a8);_0x5e0248(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x76cd('0x7')](e,emitEvent(event));}}module[_0x76cd('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xad6b=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1ae48b,_0x14f335){var _0x24a0c6=function(_0x3cf4a0){while(--_0x3cf4a0){_0x1ae48b['push'](_0x1ae48b['shift']());}};_0x24a0c6(++_0x14f335);}(_0xad6b,0x1f0));var _0xbad6=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xad6b[_0x1deb03];return _0x189fe7;};'use strict';var EventEmitter=require(_0xbad6('0x0'));var FaxAccount=require(_0xbad6('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xbad6('0x2')](0x0);var events={'afterCreate':_0xbad6('0x3'),'afterUpdate':_0xbad6('0x4'),'afterDestroy':_0xbad6('0x5')};function emitEvent(_0x26e865){return function(_0x3cb8a9,_0x4d9cd3,_0x133c57){FaxAccountEvents[_0xbad6('0x6')](_0x26e865+':'+_0x3cb8a9['id'],_0x3cb8a9);FaxAccountEvents['emit'](_0x26e865,_0x3cb8a9);_0x133c57(null);};}for(var e in events){if(events[_0xbad6('0x7')](e)){var event=events[e];FaxAccount[_0xbad6('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 28d0561..c233933 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 _0x9c73=['bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount','util','../../config/logger','api','moment'];(function(_0x4de222,_0x22f7ee){var _0x27c851=function(_0x4775da){while(--_0x4775da){_0x4de222['push'](_0x4de222['shift']());}};_0x27c851(++_0x22f7ee);}(_0x9c73,0xa4));var _0x39c7=function(_0x1d1f8c,_0x4c9727){_0x1d1f8c=_0x1d1f8c-0x0;var _0x1d90e2=_0x9c73[_0x1d1f8c];return _0x1d90e2;};'use strict';var _=require('lodash');var util=require(_0x39c7('0x0'));var logger=require(_0x39c7('0x1'))(_0x39c7('0x2'));var moment=require(_0x39c7('0x3'));var BPromise=require(_0x39c7('0x4'));var rp=require(_0x39c7('0x5'));var fs=require('fs');var path=require(_0x39c7('0x6'));var rimraf=require(_0x39c7('0x7'));var config=require('../../config/environment');var attributes=require(_0x39c7('0x8'));module[_0x39c7('0x9')]=function(_0x2029a0,_0x501129){return _0x2029a0[_0x39c7('0xa')](_0x39c7('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x217b=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./faxAccount.attributes','FaxAccount','fax_accounts','lodash'];(function(_0x2c12b7,_0x5508f4){var _0x5f3224=function(_0x3f1a92){while(--_0x3f1a92){_0x2c12b7['push'](_0x2c12b7['shift']());}};_0x5f3224(++_0x5508f4);}(_0x217b,0x11d));var _0xb217=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0x217b[_0x57d13b];return _0x467696;};'use strict';var _=require(_0xb217('0x0'));var util=require(_0xb217('0x1'));var logger=require(_0xb217('0x2'))(_0xb217('0x3'));var moment=require(_0xb217('0x4'));var BPromise=require(_0xb217('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb217('0x6'));var config=require(_0xb217('0x7'));var attributes=require(_0xb217('0x8'));module['exports']=function(_0x3fa8fb,_0x467c7c){return _0x3fa8fb['define'](_0xb217('0x9'),attributes,{'tableName':_0xb217('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 32e09b3..3297adb 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 _0x8318=['keys','createdAt','CompanyId','ListId','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','length','create','fax','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','waitForTheAssignedAgent','startRouting','Start','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','map','include','model','NotifyFaxAccount','body','CmContact','no\x20available\x20attributes','difference','updatedAt'];(function(_0x2b1d7c,_0x409329){var _0x218be9=function(_0x5cb654){while(--_0x5cb654){_0x2b1d7c['push'](_0x2b1d7c['shift']());}};_0x218be9(++_0x409329);}(_0x8318,0xd8));var _0x8831=function(_0x3b6ed3,_0x39f5fb){_0x3b6ed3=_0x3b6ed3-0x0;var _0x44832d=_0x8318[_0x3b6ed3];return _0x44832d;};'use strict';var _=require(_0x8831('0x0'));var util=require(_0x8831('0x1'));var moment=require('moment');var BPromise=require(_0x8831('0x2'));var rs=require(_0x8831('0x3'));var fs=require('fs');var Redis=require(_0x8831('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8831('0x5'));var logger=require(_0x8831('0x6'))(_0x8831('0x7'));var config=require(_0x8831('0x8'));var jayson=require(_0x8831('0x9'));var client=jayson['client'][_0x8831('0xa')]({'port':0x232c});config['redis']=_[_0x8831('0xb')](config['redis'],{'host':_0x8831('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8831('0xd'))[_0x8831('0xe')](socket);function respondWithRpcPromise(_0x1ad7e2,_0x361dc1,_0x24de96){return new BPromise(function(_0x286eaf,_0x40a675){return client[_0x8831('0xf')](_0x1ad7e2,_0x24de96)[_0x8831('0x10')](function(_0x112e59){logger[_0x8831('0x11')](_0x8831('0x12'),_0x361dc1,_0x8831('0x13'));logger[_0x8831('0x14')](_0x8831('0x15'),_0x361dc1,'request\x20sent',JSON[_0x8831('0x16')](_0x112e59));if(_0x112e59[_0x8831('0x17')]){if(_0x112e59[_0x8831('0x17')][_0x8831('0x18')]===0x1f4){logger['error'](_0x8831('0x12'),_0x361dc1,_0x112e59[_0x8831('0x17')][_0x8831('0x19')]);return _0x40a675(_0x112e59[_0x8831('0x17')][_0x8831('0x19')]);}logger[_0x8831('0x17')](_0x8831('0x12'),_0x361dc1,_0x112e59[_0x8831('0x17')][_0x8831('0x19')]);return _0x286eaf(_0x112e59[_0x8831('0x17')][_0x8831('0x19')]);}else{logger[_0x8831('0x11')](_0x8831('0x12'),_0x361dc1,_0x8831('0x13'));_0x286eaf(_0x112e59['result'][_0x8831('0x19')]);}})[_0x8831('0x1a')](function(_0x368909){logger[_0x8831('0x17')](_0x8831('0x12'),_0x361dc1,_0x368909);_0x40a675(_0x368909);});});}exports[_0x8831('0x1b')]=function(_0x2c9521){var _0x1484cd=this;return new Promise(function(_0x1f48e9,_0x46581b){return db[_0x8831('0x1c')][_0x8831('0x1d')]({'raw':_0x2c9521[_0x8831('0x1e')]?_0x2c9521['options'][_0x8831('0x1f')]===undefined?!![]:![]:!![],'where':_0x2c9521[_0x8831('0x1e')]?_0x2c9521[_0x8831('0x1e')]['where']||null:null,'attributes':_0x2c9521['options']?_0x2c9521[_0x8831('0x1e')][_0x8831('0x20')]||null:null,'limit':_0x2c9521[_0x8831('0x1e')]?_0x2c9521[_0x8831('0x1e')]['limit']||null:null,'include':_0x2c9521[_0x8831('0x1e')]?_0x2c9521[_0x8831('0x1e')]['include']?_[_0x8831('0x21')](_0x2c9521[_0x8831('0x1e')]['include'],function(_0x43b0c0){return{'model':db[_0x43b0c0['model']],'as':_0x43b0c0['as'],'attributes':_0x43b0c0[_0x8831('0x20')],'include':_0x43b0c0[_0x8831('0x22')]?_[_0x8831('0x21')](_0x43b0c0[_0x8831('0x22')],function(_0x42ede1){return{'model':db[_0x42ede1[_0x8831('0x23')]],'as':_0x42ede1['as'],'attributes':_0x42ede1[_0x8831('0x20')],'include':_0x42ede1[_0x8831('0x22')]?_['map'](_0x42ede1['include'],function(_0x45b17b){return{'model':db[_0x45b17b[_0x8831('0x23')]],'as':_0x45b17b['as'],'attributes':_0x45b17b[_0x8831('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32ec2d){logger[_0x8831('0x11')]('GetFaxAccount',_0x2c9521);logger[_0x8831('0x14')](_0x8831('0x1b'),_0x2c9521,JSON[_0x8831('0x16')](_0x32ec2d));_0x1f48e9(_0x32ec2d);})[_0x8831('0x1a')](function(_0x3c989d){logger[_0x8831('0x17')](_0x8831('0x1b'),_0x3c989d['message'],_0x2c9521);_0x46581b(_0x1484cd[_0x8831('0x17')](0x1f4,_0x3c989d[_0x8831('0x19')]));});});};exports[_0x8831('0x24')]=function(_0x530004,_0x51e16f,_0x270434){var _0x4f78f6=this;return new Promise(function(_0x1e9e79,_0x3bf755){var _0x476358={'body':_0x530004[_0x8831('0x25')],'channel':'fax'};var _0x1447fa=[];var _0x5b579a=[];var _0x7c96e6={};return db[_0x8831('0x26')]['describe']()[_0x8831('0x10')](function(_0xb3c2b4){if(!_0xb3c2b4){throw new db['Sequelize']['ValidationError'](_0x8831('0x27'));}_0x1447fa=_[_0x8831('0x28')](_['keys'](_0xb3c2b4),['createdAt',_0x8831('0x29')]);_0x5b579a=_['difference'](_[_0x8831('0x2a')](_0xb3c2b4),[_0x8831('0x2b'),'updatedAt',_0x8831('0x2c'),_0x8831('0x2d')]);if(_0x530004[_0x8831('0x25')]['id']){delete _0x530004['body']['id'];}if(_[_0x8831('0x2e')](_0x530004['body'][_0x8831('0x2f')])){throw new db[(_0x8831('0x30'))][(_0x8831('0x31'))](_0x8831('0x32'));}if(_[_0x8831('0x2e')](_0x530004[_0x8831('0x25')][_0x8831('0x25')])||_0x530004[_0x8831('0x25')][_0x8831('0x25')]===''){throw new db[(_0x8831('0x30'))][(_0x8831('0x31'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8831('0x2e')](_0x530004['body']['mapKey'])){throw new db['Sequelize'][(_0x8831('0x31'))](_0x8831('0x33')+_0x5b579a);}if(!_[_0x8831('0x34')](_0x5b579a,_0x530004[_0x8831('0x25')][_0x8831('0x35')])){throw new db[(_0x8831('0x30'))][(_0x8831('0x31'))](_0x8831('0x36')+_0x5b579a);}_0x7c96e6[_0x530004[_0x8831('0x25')][_0x8831('0x35')]]=_0x530004[_0x8831('0x25')]['from'];})[_0x8831('0x10')](function(){return db['FaxAccount'][_0x8831('0x37')]({'where':{'id':_0x530004[_0x8831('0x38')]['id']},'include':[{'model':db[_0x8831('0x39')],'as':_0x8831('0x3a'),'include':[{'model':db['CmContact'],'as':_0x8831('0x3b'),'where':_0x7c96e6,'limit':0x1,'order':[[_0x8831('0x29'),_0x8831('0x3c')]]}]},{'model':db[_0x8831('0x3d')],'as':_0x8831('0x3e')}]});})['then'](function(_0x4ef5a2){if(_0x4ef5a2&&_0x4ef5a2[_0x8831('0x3a')]){var _0x2067dd=_0x4ef5a2[_0x8831('0x3f')]({'plain':!![]});_0x476358[_0x8831('0x38')]=_0x2067dd;_0x476358[_0x8831('0x40')]=_0x2067dd[_0x8831('0x3e')];_0x476358[_0x8831('0x41')]=_0x2067dd[_0x8831('0x3a')];_0x476358[_0x8831('0x40')]=_[_0x8831('0x42')](_0x476358['applications'],[_0x8831('0x43')],['asc']);if(_0x476358[_0x8831('0x38')]['Applications']){delete _0x476358['account'][_0x8831('0x3e')];}if(_0x476358['account']['List']&&_0x476358[_0x8831('0x38')]['List'][_0x8831('0x3b')][_0x8831('0x44')]){return _0x476358[_0x8831('0x38')]['List'][_0x8831('0x3b')][0x0];}var _0x108018=_['defaults'](_0x530004[_0x8831('0x25')],{'firstName':_0x530004[_0x8831('0x25')][_0x8831('0x2f')],'ListId':_0x2067dd['ListId']});_0x108018[_0x530004[_0x8831('0x25')]['mapKey']]=_0x530004[_0x8831('0x25')][_0x8831('0x2f')];return db['CmContact'][_0x8831('0x45')](_0x108018,{'fields':_0x1447fa,'raw':!![]});}})[_0x8831('0x10')](function(_0x338296){_0x476358['contact']=_0x338296;if(_0x338296){var _0x3ad748={'ContactId':_0x338296['id'],'FaxAccountId':_0x530004[_0x8831('0x38')]['id'],'fax':_0x338296[_0x8831('0x46')]};return db['FaxInteraction'][_0x8831('0x37')]({'where':{'ContactId':_0x338296['id'],'closed':![],'FaxAccountId':_0x530004[_0x8831('0x38')]['id']}})[_0x8831('0x10')](function(_0x4df743){if(_0x4df743){return[_0x4df743,![]];}return db[_0x8831('0x47')]['create'](_0x3ad748)[_0x8831('0x10')](function(_0x5ea6ac){return[_0x5ea6ac,!![]];});});}else{throw new Error(_0x8831('0x48'));}})[_0x8831('0x49')](function(_0x3c21c4,_0x778a9a){var _0x2a3418=_0x3c21c4[_0x8831('0x3f')]({'plain':!![]});if(_0x778a9a){if(_0x476358[_0x8831('0x38')][_0x8831('0x4a')]){_0x476358[_0x8831('0x40')][_0x8831('0x4b')]({'id':0x0,'priority':_0x476358[_0x8831('0x40')][_0x8831('0x44')]+0x1,'app':'close','appdata':_0x8831('0x4c'),'interval':_0x8831('0x4d')});}_0x2a3418[_0x8831('0x4e')]=!![];}else{_0x2a3418[_0x8831('0x4e')]=![];}_0x476358[_0x8831('0x4f')]=_0x2a3418;return db[_0x8831('0x50')][_0x8831('0x45')]({'body':_0x530004[_0x8831('0x25')][_0x8831('0x25')],'FaxAccountId':_0x530004[_0x8831('0x38')]['id'],'FaxInteractionId':_0x3c21c4['id'],'direction':'in','ContactId':_0x3c21c4[_0x8831('0x51')],'AttachmentId':_0x530004[_0x8831('0x25')]['AttachmentId']});})[_0x8831('0x10')](function(_0x459c43){_0x476358['message']=_0x459c43;if(_0x476358[_0x8831('0x4f')][_0x8831('0x52')]){return db['User'][_0x8831('0x37')]({'attributes':['id','name'],'where':{'id':_0x476358['interaction'][_0x8831('0x52')]}})['then'](function(_0x1fa034){if(_0x1fa034){_0x476358[_0x8831('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1fa034['name']+','+(_0x476358[_0x8831('0x38')][_0x8831('0x53')]||0xa),'interval':_0x8831('0x4d')});}return respondWithRpcPromise('Start',_0x8831('0x54'),_0x476358);});}return respondWithRpcPromise(_0x8831('0x55'),_0x8831('0x54'),_0x476358);})[_0x8831('0x10')](function(_0x17b415){_0x1e9e79(_0x17b415);})['catch'](function(_0x71e780){_0x3bf755(_0x4f78f6['error'](0x1f4,_0x71e780[_0x8831('0x19')]));});});}; \ No newline at end of file +var _0xcd41=['describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','CmContact','Contacts','DESC','FaxApplication','get','account','orderBy','applications','Applications','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','length','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','FaxAccount','findAll','options','attributes','limit','include','map','model','GetFaxAccount','body','fax'];(function(_0x4a290d,_0x19b70b){var _0x4f7b5b=function(_0x3b994e){while(--_0x3b994e){_0x4a290d['push'](_0x4a290d['shift']());}};_0x4f7b5b(++_0x19b70b);}(_0xcd41,0x142));var _0x1cd4=function(_0x2b93da,_0x1aa1a0){_0x2b93da=_0x2b93da-0x0;var _0x10d473=_0xcd41[_0x2b93da];return _0x10d473;};'use strict';var _=require('lodash');var util=require(_0x1cd4('0x0'));var moment=require(_0x1cd4('0x1'));var BPromise=require(_0x1cd4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cd4('0x3'));var db=require(_0x1cd4('0x4'))['db'];var utils=require(_0x1cd4('0x5'));var logger=require(_0x1cd4('0x6'))(_0x1cd4('0x7'));var config=require(_0x1cd4('0x8'));var jayson=require(_0x1cd4('0x9'));var client=jayson['client'][_0x1cd4('0xa')]({'port':0x232c});config[_0x1cd4('0xb')]=_[_0x1cd4('0xc')](config['redis'],{'host':_0x1cd4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1cd4('0xe'))[_0x1cd4('0xf')](socket);function respondWithRpcPromise(_0x351f36,_0x5e154d,_0x5f14bd){return new BPromise(function(_0x3274ee,_0x375863){return client['request'](_0x351f36,_0x5f14bd)[_0x1cd4('0x10')](function(_0x234d76){logger[_0x1cd4('0x11')](_0x1cd4('0x12'),_0x5e154d,'request\x20sent');logger[_0x1cd4('0x13')](_0x1cd4('0x14'),_0x5e154d,_0x1cd4('0x15'),JSON[_0x1cd4('0x16')](_0x234d76));if(_0x234d76['error']){if(_0x234d76[_0x1cd4('0x17')]['code']===0x1f4){logger[_0x1cd4('0x17')](_0x1cd4('0x12'),_0x5e154d,_0x234d76['error']['message']);return _0x375863(_0x234d76[_0x1cd4('0x17')][_0x1cd4('0x18')]);}logger[_0x1cd4('0x17')](_0x1cd4('0x12'),_0x5e154d,_0x234d76[_0x1cd4('0x17')][_0x1cd4('0x18')]);return _0x3274ee(_0x234d76[_0x1cd4('0x17')]['message']);}else{logger[_0x1cd4('0x11')](_0x1cd4('0x12'),_0x5e154d,'request\x20sent');_0x3274ee(_0x234d76[_0x1cd4('0x19')]['message']);}})[_0x1cd4('0x1a')](function(_0x4432c9){logger[_0x1cd4('0x17')]('FaxAccount,\x20%s,\x20%s',_0x5e154d,_0x4432c9);_0x375863(_0x4432c9);});});}exports['GetFaxAccount']=function(_0x4ebcd3){var _0x4a56ff=this;return new Promise(function(_0x420d43,_0x3a7c2b){return db[_0x1cd4('0x1b')][_0x1cd4('0x1c')]({'raw':_0x4ebcd3[_0x1cd4('0x1d')]?_0x4ebcd3[_0x1cd4('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4ebcd3[_0x1cd4('0x1d')]?_0x4ebcd3[_0x1cd4('0x1d')]['where']||null:null,'attributes':_0x4ebcd3[_0x1cd4('0x1d')]?_0x4ebcd3['options'][_0x1cd4('0x1e')]||null:null,'limit':_0x4ebcd3['options']?_0x4ebcd3[_0x1cd4('0x1d')][_0x1cd4('0x1f')]||null:null,'include':_0x4ebcd3[_0x1cd4('0x1d')]?_0x4ebcd3[_0x1cd4('0x1d')][_0x1cd4('0x20')]?_[_0x1cd4('0x21')](_0x4ebcd3['options'][_0x1cd4('0x20')],function(_0x1f6dce){return{'model':db[_0x1f6dce[_0x1cd4('0x22')]],'as':_0x1f6dce['as'],'attributes':_0x1f6dce[_0x1cd4('0x1e')],'include':_0x1f6dce[_0x1cd4('0x20')]?_['map'](_0x1f6dce[_0x1cd4('0x20')],function(_0xb935b1){return{'model':db[_0xb935b1['model']],'as':_0xb935b1['as'],'attributes':_0xb935b1[_0x1cd4('0x1e')],'include':_0xb935b1[_0x1cd4('0x20')]?_['map'](_0xb935b1['include'],function(_0x508bb2){return{'model':db[_0x508bb2[_0x1cd4('0x22')]],'as':_0x508bb2['as'],'attributes':_0x508bb2[_0x1cd4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1cd4('0x10')](function(_0xce9c08){logger[_0x1cd4('0x11')](_0x1cd4('0x23'),_0x4ebcd3);logger[_0x1cd4('0x13')](_0x1cd4('0x23'),_0x4ebcd3,JSON[_0x1cd4('0x16')](_0xce9c08));_0x420d43(_0xce9c08);})['catch'](function(_0x2f7f7a){logger['error']('GetFaxAccount',_0x2f7f7a[_0x1cd4('0x18')],_0x4ebcd3);_0x3a7c2b(_0x4a56ff[_0x1cd4('0x17')](0x1f4,_0x2f7f7a['message']));});});};exports['NotifyFaxAccount']=function(_0x16d965,_0x1ef1e7,_0x52769b){var _0x54ae18=this;return new Promise(function(_0x472ef9,_0x189eb8){var _0x3235ea={'body':_0x16d965[_0x1cd4('0x24')],'channel':_0x1cd4('0x25')};var _0x4943cc=[];var _0x44274d=[];var _0xf04b36={};return db['CmContact'][_0x1cd4('0x26')]()[_0x1cd4('0x10')](function(_0x1e1879){if(!_0x1e1879){throw new db[(_0x1cd4('0x27'))][(_0x1cd4('0x28'))](_0x1cd4('0x29'));}_0x4943cc=_['difference'](_[_0x1cd4('0x2a')](_0x1e1879),[_0x1cd4('0x2b'),_0x1cd4('0x2c')]);_0x44274d=_[_0x1cd4('0x2d')](_[_0x1cd4('0x2a')](_0x1e1879),[_0x1cd4('0x2b'),_0x1cd4('0x2c'),'CompanyId',_0x1cd4('0x2e')]);if(_0x16d965[_0x1cd4('0x24')]['id']){delete _0x16d965[_0x1cd4('0x24')]['id'];}if(_[_0x1cd4('0x2f')](_0x16d965[_0x1cd4('0x24')][_0x1cd4('0x30')])){throw new db[(_0x1cd4('0x27'))][(_0x1cd4('0x28'))](_0x1cd4('0x31'));}if(_['isNil'](_0x16d965[_0x1cd4('0x24')][_0x1cd4('0x24')])||_0x16d965[_0x1cd4('0x24')][_0x1cd4('0x24')]===''){throw new db[(_0x1cd4('0x27'))][(_0x1cd4('0x28'))](_0x1cd4('0x32'));}if(_['isNil'](_0x16d965[_0x1cd4('0x24')][_0x1cd4('0x33')])){throw new db[(_0x1cd4('0x27'))]['ValidationError'](_0x1cd4('0x34')+_0x44274d);}if(!_[_0x1cd4('0x35')](_0x44274d,_0x16d965[_0x1cd4('0x24')][_0x1cd4('0x33')])){throw new db[(_0x1cd4('0x27'))][(_0x1cd4('0x28'))](_0x1cd4('0x36')+_0x44274d);}_0xf04b36[_0x16d965[_0x1cd4('0x24')][_0x1cd4('0x33')]]=_0x16d965[_0x1cd4('0x24')]['from'];})[_0x1cd4('0x10')](function(){return db['FaxAccount'][_0x1cd4('0x37')]({'where':{'id':_0x16d965['account']['id']},'include':[{'model':db[_0x1cd4('0x38')],'as':_0x1cd4('0x39'),'include':[{'model':db[_0x1cd4('0x3a')],'as':_0x1cd4('0x3b'),'where':_0xf04b36,'limit':0x1,'order':[[_0x1cd4('0x2c'),_0x1cd4('0x3c')]]}]},{'model':db[_0x1cd4('0x3d')],'as':'Applications'}]});})['then'](function(_0x5b08f8){if(_0x5b08f8&&_0x5b08f8[_0x1cd4('0x39')]){var _0x35b7b0=_0x5b08f8[_0x1cd4('0x3e')]({'plain':!![]});_0x3235ea[_0x1cd4('0x3f')]=_0x35b7b0;_0x3235ea['applications']=_0x35b7b0['Applications'];_0x3235ea['list']=_0x35b7b0[_0x1cd4('0x39')];_0x3235ea['applications']=_[_0x1cd4('0x40')](_0x3235ea[_0x1cd4('0x41')],['priority'],['asc']);if(_0x3235ea['account'][_0x1cd4('0x42')]){delete _0x3235ea[_0x1cd4('0x3f')][_0x1cd4('0x42')];}if(_0x3235ea[_0x1cd4('0x3f')]['List']&&_0x3235ea[_0x1cd4('0x3f')][_0x1cd4('0x39')]['Contacts']['length']){return _0x3235ea[_0x1cd4('0x3f')][_0x1cd4('0x39')][_0x1cd4('0x3b')][0x0];}var _0x44a627=_[_0x1cd4('0xc')](_0x16d965[_0x1cd4('0x24')],{'firstName':_0x16d965[_0x1cd4('0x24')][_0x1cd4('0x30')],'ListId':_0x35b7b0['ListId']});_0x44a627[_0x16d965[_0x1cd4('0x24')][_0x1cd4('0x33')]]=_0x16d965[_0x1cd4('0x24')]['from'];return db[_0x1cd4('0x3a')][_0x1cd4('0x43')](_0x44a627,{'fields':_0x4943cc,'raw':!![]});}})['then'](function(_0x5ee751){_0x3235ea[_0x1cd4('0x44')]=_0x5ee751;if(_0x5ee751){var _0x5d33dc={'ContactId':_0x5ee751['id'],'FaxAccountId':_0x16d965['account']['id'],'fax':_0x5ee751[_0x1cd4('0x25')]};return db[_0x1cd4('0x45')]['find']({'where':{'ContactId':_0x5ee751['id'],'closed':![],'FaxAccountId':_0x16d965[_0x1cd4('0x3f')]['id']}})['then'](function(_0x74e626){if(_0x74e626){return[_0x74e626,![]];}return db[_0x1cd4('0x45')][_0x1cd4('0x43')](_0x5d33dc)[_0x1cd4('0x10')](function(_0xddf165){return[_0xddf165,!![]];});});}else{throw new Error(_0x1cd4('0x46'));}})[_0x1cd4('0x47')](function(_0x18ceeb,_0x640ce6){var _0x5b0a91=_0x18ceeb[_0x1cd4('0x3e')]({'plain':!![]});if(_0x640ce6){if(_0x3235ea['account']['autoclose']){_0x3235ea[_0x1cd4('0x41')][_0x1cd4('0x48')]({'id':0x0,'priority':_0x3235ea[_0x1cd4('0x41')][_0x1cd4('0x49')]+0x1,'app':_0x1cd4('0x4a'),'appdata':_0x1cd4('0x4b'),'interval':_0x1cd4('0x4c')});}_0x5b0a91[_0x1cd4('0x4d')]=!![];}else{_0x5b0a91[_0x1cd4('0x4d')]=![];}_0x3235ea['interaction']=_0x5b0a91;return db[_0x1cd4('0x4e')][_0x1cd4('0x43')]({'body':_0x16d965['body'][_0x1cd4('0x24')],'FaxAccountId':_0x16d965[_0x1cd4('0x3f')]['id'],'FaxInteractionId':_0x18ceeb['id'],'direction':'in','ContactId':_0x18ceeb[_0x1cd4('0x4f')],'AttachmentId':_0x16d965['body'][_0x1cd4('0x50')]});})['then'](function(_0x160bc6){_0x3235ea[_0x1cd4('0x18')]=_0x160bc6;if(_0x3235ea[_0x1cd4('0x51')][_0x1cd4('0x52')]){return db[_0x1cd4('0x53')][_0x1cd4('0x37')]({'attributes':['id',_0x1cd4('0x54')],'where':{'id':_0x3235ea[_0x1cd4('0x51')][_0x1cd4('0x52')]}})['then'](function(_0x5af42c){if(_0x5af42c){_0x3235ea['applications'][_0x1cd4('0x55')]({'id':0x0,'priority':0x0,'app':_0x1cd4('0x56'),'appdata':_0x5af42c[_0x1cd4('0x54')]+','+(_0x3235ea[_0x1cd4('0x3f')][_0x1cd4('0x57')]||0xa),'interval':_0x1cd4('0x4c')});}return respondWithRpcPromise(_0x1cd4('0x58'),_0x1cd4('0x59'),_0x3235ea);});}return respondWithRpcPromise('Start','startRouting',_0x3235ea);})[_0x1cd4('0x10')](function(_0x3b6166){_0x472ef9(_0x3b6166);})[_0x1cd4('0x1a')](function(_0x2348f7){_0x189eb8(_0x54ae18[_0x1cd4('0x17')](0x1f4,_0x2348f7[_0x1cd4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 5b2015e..29e7210 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 _0x430c=['register','length','faxAccount:','./faxAccount.events','update','removeListener'];(function(_0x251d59,_0x195b11){var _0x50e7a3=function(_0x434484){while(--_0x434484){_0x251d59['push'](_0x251d59['shift']());}};_0x50e7a3(++_0x195b11);}(_0x430c,0x1a1));var _0xc430=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x430c[_0x1589dd];return _0x1bddd1;};'use strict';var FaxAccountEvents=require(_0xc430('0x0'));var events=['save','remove',_0xc430('0x1')];function createListener(_0xe2d084,_0x1d5b5e){return function(_0x503988){_0x1d5b5e['emit'](_0xe2d084,_0x503988);};}function removeListener(_0x5ccda6,_0x47d8b9){return function(){FaxAccountEvents[_0xc430('0x2')](_0x5ccda6,_0x47d8b9);};}exports[_0xc430('0x3')]=function(_0x50b256){for(var _0x42aa9c=0x0,_0x4de44f=events[_0xc430('0x4')];_0x42aa9c<_0x4de44f;_0x42aa9c++){var _0x2e51c6=events[_0x42aa9c];var _0x814a90=createListener(_0xc430('0x5')+_0x2e51c6,_0x50b256);FaxAccountEvents['on'](_0x2e51c6,_0x814a90);}}; \ No newline at end of file +var _0xffd6=['save','remove','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x23c02b,_0x411b4d){var _0x25efc5=function(_0x50e9e4){while(--_0x50e9e4){_0x23c02b['push'](_0x23c02b['shift']());}};_0x25efc5(++_0x411b4d);}(_0xffd6,0x97));var _0x6ffd=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0xffd6[_0x5b27da];return _0x3254f4;};'use strict';var FaxAccountEvents=require(_0x6ffd('0x0'));var events=[_0x6ffd('0x1'),_0x6ffd('0x2'),'update'];function createListener(_0x589640,_0x305b6b){return function(_0x400c43){_0x305b6b[_0x6ffd('0x3')](_0x589640,_0x400c43);};}function removeListener(_0x560afa,_0x1d12e3){return function(){FaxAccountEvents[_0x6ffd('0x4')](_0x560afa,_0x1d12e3);};}exports[_0x6ffd('0x5')]=function(_0x2949a4){for(var _0x561055=0x0,_0x122b71=events[_0x6ffd('0x6')];_0x561055<_0x122b71;_0x561055++){var _0x2445a0=events[_0x561055];var _0x1fbbe6=createListener(_0x6ffd('0x7')+_0x2445a0,_0x2949a4);FaxAccountEvents['on'](_0x2445a0,_0x1fbbe6);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 80b0680..b2edee7 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 _0x1d66=['delete','destroy','removeDispositions','removeAnswers','multer','util','express','Router','../../components/auth/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/applications','getApplications','getMessages','/:id/users','post','create','addDisposition','addAnswer','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','send','addAgents','put','update'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1d66,0x124));var _0x61d6=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x1d66[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x61d6('0x0'));var util=require(_0x61d6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x61d6('0x2'));var router=express[_0x61d6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x61d6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x61d6('0x5'));var controller=require(_0x61d6('0x6'));router[_0x61d6('0x7')]('/',auth[_0x61d6('0x8')](),controller[_0x61d6('0x9')]);router[_0x61d6('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x61d6('0x7')](_0x61d6('0xa'),auth[_0x61d6('0x8')](),controller['show']);router['get'](_0x61d6('0xb'),auth['isAuthenticated'](),controller[_0x61d6('0xc')]);router[_0x61d6('0x7')](_0x61d6('0xd'),auth[_0x61d6('0x8')](),controller[_0x61d6('0xe')]);router[_0x61d6('0x7')]('/:id/interactions',auth[_0x61d6('0x8')](),controller[_0x61d6('0xf')]);router['get'](_0x61d6('0x10'),auth[_0x61d6('0x8')](),controller[_0x61d6('0x11')]);router[_0x61d6('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x61d6('0x12')]);router[_0x61d6('0x7')](_0x61d6('0x13'),auth[_0x61d6('0x8')](),controller['getAgents']);router[_0x61d6('0x14')]('/',auth[_0x61d6('0x8')](),controller[_0x61d6('0x15')]);router[_0x61d6('0x14')](_0x61d6('0xb'),auth['isAuthenticated'](),controller[_0x61d6('0x16')]);router[_0x61d6('0x14')](_0x61d6('0xd'),auth[_0x61d6('0x8')](),controller[_0x61d6('0x17')]);router[_0x61d6('0x14')]('/:id/interactions',auth[_0x61d6('0x8')](),controller['addInteraction']);router[_0x61d6('0x14')](_0x61d6('0x10'),auth[_0x61d6('0x8')](),controller['addApplications']);router[_0x61d6('0x14')](_0x61d6('0x18'),auth[_0x61d6('0x8')](),controller[_0x61d6('0x19')]);router[_0x61d6('0x14')](_0x61d6('0x1a'),auth[_0x61d6('0x8')](),controller[_0x61d6('0x1b')]);router['post']('/:id/send',auth[_0x61d6('0x8')](),controller[_0x61d6('0x1c')]);router[_0x61d6('0x14')](_0x61d6('0x13'),auth[_0x61d6('0x8')](),controller[_0x61d6('0x1d')]);router[_0x61d6('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x61d6('0x1f')]);router[_0x61d6('0x20')](_0x61d6('0xa'),auth[_0x61d6('0x8')](),controller[_0x61d6('0x21')]);router['delete']('/:id/dispositions',auth[_0x61d6('0x8')](),controller[_0x61d6('0x22')]);router[_0x61d6('0x20')](_0x61d6('0xd'),auth[_0x61d6('0x8')](),controller[_0x61d6('0x23')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x70b3=['/:id/dispositions','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/:id/send','send','addAgents','put','/:id','delete','removeAnswers','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','describe','/:id/canned_answers','getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','create','post'];(function(_0x189dbd,_0x1d3cad){var _0x7861fb=function(_0x1a8738){while(--_0x1a8738){_0x189dbd['push'](_0x189dbd['shift']());}};_0x7861fb(++_0x1d3cad);}(_0x70b3,0x19c));var _0x370b=function(_0x1abf5e,_0x545344){_0x1abf5e=_0x1abf5e-0x0;var _0x489fb3=_0x70b3[_0x1abf5e];return _0x489fb3;};'use strict';var multer=require(_0x370b('0x0'));var util=require(_0x370b('0x1'));var path=require(_0x370b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x370b('0x3')]();var fs_extra=require(_0x370b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x370b('0x5'));var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0x370b('0x6')]('/',auth[_0x370b('0x7')](),controller[_0x370b('0x8')]);router[_0x370b('0x6')]('/describe',auth[_0x370b('0x7')](),controller[_0x370b('0x9')]);router[_0x370b('0x6')]('/:id',auth[_0x370b('0x7')](),controller['show']);router[_0x370b('0x6')]('/:id/dispositions',auth[_0x370b('0x7')](),controller['getDispositions']);router[_0x370b('0x6')](_0x370b('0xa'),auth[_0x370b('0x7')](),controller[_0x370b('0xb')]);router[_0x370b('0x6')](_0x370b('0xc'),auth[_0x370b('0x7')](),controller['getInteractions']);router[_0x370b('0x6')](_0x370b('0xd'),auth[_0x370b('0x7')](),controller[_0x370b('0xe')]);router[_0x370b('0x6')](_0x370b('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0x370b('0x6')](_0x370b('0x10'),auth['isAuthenticated'](),controller[_0x370b('0x11')]);router['post']('/',auth[_0x370b('0x7')](),controller[_0x370b('0x12')]);router[_0x370b('0x13')](_0x370b('0x14'),auth['isAuthenticated'](),controller[_0x370b('0x15')]);router['post'](_0x370b('0xa'),auth[_0x370b('0x7')](),controller[_0x370b('0x16')]);router['post']('/:id/interactions',auth[_0x370b('0x7')](),controller[_0x370b('0x17')]);router[_0x370b('0x13')](_0x370b('0xd'),auth[_0x370b('0x7')](),controller[_0x370b('0x18')]);router[_0x370b('0x13')](_0x370b('0x19'),auth['isAuthenticated'](),controller[_0x370b('0x1a')]);router[_0x370b('0x13')]('/updateaccountapplications',auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x370b('0x13')](_0x370b('0x1b'),auth[_0x370b('0x7')](),controller[_0x370b('0x1c')]);router[_0x370b('0x13')]('/:id/users',auth[_0x370b('0x7')](),controller[_0x370b('0x1d')]);router[_0x370b('0x1e')](_0x370b('0x1f'),auth[_0x370b('0x7')](),controller['update']);router[_0x370b('0x20')]('/:id',auth[_0x370b('0x7')](),controller['destroy']);router[_0x370b('0x20')](_0x370b('0x14'),auth[_0x370b('0x7')](),controller['removeDispositions']);router[_0x370b('0x20')]('/:id/canned_answers',auth[_0x370b('0x7')](),controller[_0x370b('0x21')]);router[_0x370b('0x20')](_0x370b('0x10'),auth[_0x370b('0x7')](),controller[_0x370b('0x22')]);module[_0x370b('0x23')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 233701d..df67c47 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 _0x3166=['TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3166,0xbb));var _0x6316=function(_0x94cbfd,_0xcf3905){_0x94cbfd=_0x94cbfd-0x0;var _0x1fb158=_0x3166[_0x94cbfd];return _0x1fb158;};'use strict';var Sequelize=require('sequelize');module[_0x6316('0x0')]={'priority':{'type':Sequelize[_0x6316('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6316('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6316('0x3')]()},'description':{'type':Sequelize[_0x6316('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6316('0x4')}}; \ No newline at end of file +var _0xd98a=['TEXT','*,*,*,*','sequelize','STRING','noop'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xd98a,0xfc));var _0xad98=function(_0x7206b8,_0x2212ff){_0x7206b8=_0x7206b8-0x0;var _0x46011e=_0xd98a[_0x7206b8];return _0x46011e;};'use strict';var Sequelize=require(_0xad98('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xad98('0x1')],'allowNull':![],'defaultValue':_0xad98('0x2')},'appdata':{'type':Sequelize[_0xad98('0x3')]()},'description':{'type':Sequelize[_0xad98('0x1')]},'interval':{'type':Sequelize[_0xad98('0x1')],'defaultValue':_0xad98('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 9c696c0..61ca7f1 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 _0xe604=['../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','index','map','FaxApplication','rawAttributes','fieldName','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','pick','filter','where','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','eml-format','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x1e7d7e,_0x3fb963){var _0x540baf=function(_0x5c2694){while(--_0x5c2694){_0x1e7d7e['push'](_0x1e7d7e['shift']());}};_0x540baf(++_0x3fb963);}(_0xe604,0x101));var _0x4e60=function(_0x402203,_0x2f64de){_0x402203=_0x402203-0x0;var _0x3e6309=_0xe604[_0x402203];return _0x3e6309;};'use strict';var emlformat=require(_0x4e60('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4e60('0x1'));var BPromise=require(_0x4e60('0x2'));var Mustache=require(_0x4e60('0x3'));var util=require(_0x4e60('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x4e60('0x5'));var ejs=require(_0x4e60('0x6'));var fs=require('fs');var fs_extra=require(_0x4e60('0x7'));var _=require('lodash');var squel=require(_0x4e60('0x8'));var crypto=require(_0x4e60('0x9'));var jsforce=require(_0x4e60('0xa'));var deskjs=require(_0x4e60('0xb'));var toCsv=require(_0x4e60('0x5'));var querystring=require('querystring');var Papa=require(_0x4e60('0xc'));var Redis=require(_0x4e60('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4e60('0xe'));var hardwareService=require(_0x4e60('0xf'));var logger=require(_0x4e60('0x10'))(_0x4e60('0x11'));var utils=require('../../config/utils');var config=require(_0x4e60('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x4e60('0x13'))['db'];function respondWithStatusCode(_0x54a1ac,_0x5672ac){_0x5672ac=_0x5672ac||0xcc;return function(_0x563c42){if(_0x563c42){return _0x54a1ac[_0x4e60('0x14')](_0x5672ac);}return _0x54a1ac['status'](_0x5672ac)[_0x4e60('0x15')]();};}function respondWithResult(_0x5489fc,_0x5787d1){_0x5787d1=_0x5787d1||0xc8;return function(_0x230a72){if(_0x230a72){return _0x5489fc[_0x4e60('0x16')](_0x5787d1)['json'](_0x230a72);}};}function respondWithFilteredResult(_0xd362fb,_0x47fada){return function(_0x5a4552){if(_0x5a4552){var _0x1ca2e5=typeof _0x47fada[_0x4e60('0x17')]==='undefined'&&typeof _0x47fada['limit']===_0x4e60('0x18');var _0xa6ab07=_0x5a4552[_0x4e60('0x19')];var _0x5ef6bd=_0x1ca2e5?0x0:_0x47fada[_0x4e60('0x17')];var _0x486090=_0x1ca2e5?_0x5a4552[_0x4e60('0x19')]:_0x47fada[_0x4e60('0x17')]+_0x47fada[_0x4e60('0x1a')];var _0x1f3669;if(_0x486090>=_0xa6ab07){_0x486090=_0xa6ab07;_0x1f3669=0xc8;}else{_0x1f3669=0xce;}_0xd362fb[_0x4e60('0x16')](_0x1f3669);return _0xd362fb[_0x4e60('0x1b')](_0x4e60('0x1c'),_0x5ef6bd+'-'+_0x486090+'/'+_0xa6ab07)[_0x4e60('0x1d')](_0x5a4552);}return null;};}function patchUpdates(_0x5e5806){return function(_0x6bffe4){try{jsonpatch[_0x4e60('0x1e')](_0x6bffe4,_0x5e5806,!![]);}catch(_0x594a26){return BPromise[_0x4e60('0x1f')](_0x594a26);}return _0x6bffe4[_0x4e60('0x20')]();};}function saveUpdates(_0x3857c3,_0x17423a){return function(_0xf059c9){if(_0xf059c9){return _0xf059c9[_0x4e60('0x21')](_0x3857c3)['then'](function(_0xc12a96){return _0xc12a96;});}return null;};}function removeEntity(_0x14c5ea,_0x217020){return function(_0x37af6e){if(_0x37af6e){return _0x37af6e[_0x4e60('0x22')]()[_0x4e60('0x23')](function(){_0x14c5ea[_0x4e60('0x16')](0xcc)[_0x4e60('0x15')]();});}};}function handleEntityNotFound(_0xc96a2e,_0x3f75a3){return function(_0x4d540e){if(!_0x4d540e){_0xc96a2e['sendStatus'](0x194);}return _0x4d540e;};}function handleError(_0x38bcaa,_0x788fcd){_0x788fcd=_0x788fcd||0x1f4;return function(_0x5d3ada){logger['error'](_0x5d3ada[_0x4e60('0x24')]);if(_0x5d3ada[_0x4e60('0x25')]){delete _0x5d3ada[_0x4e60('0x25')];}_0x38bcaa[_0x4e60('0x16')](_0x788fcd)['send'](_0x5d3ada);};}exports[_0x4e60('0x26')]=function(_0x312ac1,_0x4e145a){var _0x41dcc0={},_0xd11ccd={},_0x49ed0e={'count':0x0,'rows':[]};var _0x18341c=_[_0x4e60('0x27')](db[_0x4e60('0x28')][_0x4e60('0x29')],function(_0x2d121c){return{'name':_0x2d121c[_0x4e60('0x2a')],'type':_0x2d121c['type']['key']};});_0xd11ccd['model']=_[_0x4e60('0x27')](_0x18341c,'name');_0xd11ccd[_0x4e60('0x2b')]=_['keys'](_0x312ac1[_0x4e60('0x2b')]);_0xd11ccd[_0x4e60('0x2c')]=_[_0x4e60('0x2d')](_0xd11ccd['model'],_0xd11ccd[_0x4e60('0x2b')]);_0x41dcc0[_0x4e60('0x2e')]=_['intersection'](_0xd11ccd[_0x4e60('0x2f')],qs[_0x4e60('0x30')](_0x312ac1['query']['fields']));_0x41dcc0['attributes']=_0x41dcc0[_0x4e60('0x2e')]['length']?_0x41dcc0[_0x4e60('0x2e')]:_0xd11ccd[_0x4e60('0x2f')];if(!_0x312ac1[_0x4e60('0x2b')][_0x4e60('0x31')](_0x4e60('0x32'))){_0x41dcc0[_0x4e60('0x1a')]=qs[_0x4e60('0x1a')](_0x312ac1[_0x4e60('0x2b')][_0x4e60('0x1a')]);_0x41dcc0[_0x4e60('0x17')]=qs[_0x4e60('0x17')](_0x312ac1[_0x4e60('0x2b')]['offset']);}_0x41dcc0[_0x4e60('0x33')]=qs['sort'](_0x312ac1['query']['sort']);_0x41dcc0['where']=qs['filters'](_[_0x4e60('0x34')](_0x312ac1['query'],_0xd11ccd[_0x4e60('0x2c')]),_0x18341c);if(_0x312ac1[_0x4e60('0x2b')][_0x4e60('0x35')]){_0x41dcc0[_0x4e60('0x36')]=_[_0x4e60('0x37')](_0x41dcc0[_0x4e60('0x36')],{'$or':_[_0x4e60('0x27')](_0x18341c,function(_0x570d8a){if(_0x570d8a[_0x4e60('0x38')]!==_0x4e60('0x39')){var _0xe341a9={};_0xe341a9[_0x570d8a[_0x4e60('0x25')]]={'$like':'%'+_0x312ac1[_0x4e60('0x2b')][_0x4e60('0x35')]+'%'};return _0xe341a9;}})});}_0x41dcc0=_[_0x4e60('0x37')]({},_0x41dcc0,_0x312ac1['options']);var _0x4a9304={'where':_0x41dcc0['where']};return db[_0x4e60('0x28')][_0x4e60('0x19')](_0x4a9304)[_0x4e60('0x23')](function(_0x35f7ba){_0x49ed0e['count']=_0x35f7ba;if(_0x312ac1['query'][_0x4e60('0x3a')]){_0x41dcc0['include']=[{'all':!![]}];}return db['FaxApplication'][_0x4e60('0x3b')](_0x41dcc0);})[_0x4e60('0x23')](function(_0x17d174){_0x49ed0e[_0x4e60('0x3c')]=_0x17d174;return _0x49ed0e;})[_0x4e60('0x23')](respondWithFilteredResult(_0x4e145a,_0x41dcc0))[_0x4e60('0x3d')](handleError(_0x4e145a,null));};exports[_0x4e60('0x3e')]=function(_0x1c99f4,_0x2e1ce3){var _0x31d460={'raw':!![],'where':{'id':_0x1c99f4[_0x4e60('0x3f')]['id']}},_0x2c881b={};_0x2c881b['model']=_[_0x4e60('0x40')](db[_0x4e60('0x28')][_0x4e60('0x29')]);_0x2c881b[_0x4e60('0x2b')]=_[_0x4e60('0x40')](_0x1c99f4[_0x4e60('0x2b')]);_0x2c881b[_0x4e60('0x2c')]=_[_0x4e60('0x2d')](_0x2c881b[_0x4e60('0x2f')],_0x2c881b[_0x4e60('0x2b')]);_0x31d460[_0x4e60('0x2e')]=_[_0x4e60('0x2d')](_0x2c881b[_0x4e60('0x2f')],qs[_0x4e60('0x30')](_0x1c99f4[_0x4e60('0x2b')][_0x4e60('0x30')]));_0x31d460[_0x4e60('0x2e')]=_0x31d460['attributes']['length']?_0x31d460[_0x4e60('0x2e')]:_0x2c881b[_0x4e60('0x2f')];if(_0x1c99f4['query'][_0x4e60('0x3a')]){_0x31d460[_0x4e60('0x41')]=[{'all':!![]}];}_0x31d460=_['merge']({},_0x31d460,_0x1c99f4['options']);return db[_0x4e60('0x28')][_0x4e60('0x42')](_0x31d460)['then'](handleEntityNotFound(_0x2e1ce3,null))[_0x4e60('0x23')](respondWithResult(_0x2e1ce3,null))[_0x4e60('0x3d')](handleError(_0x2e1ce3,null));};exports[_0x4e60('0x43')]=function(_0x33e2ce,_0x2745b2){return db[_0x4e60('0x28')]['create'](_0x33e2ce['body'],{})['then'](respondWithResult(_0x2745b2,0xc9))[_0x4e60('0x3d')](handleError(_0x2745b2,null));};exports[_0x4e60('0x21')]=function(_0xd53d10,_0x86e0ca){if(_0xd53d10['body']['id']){delete _0xd53d10[_0x4e60('0x44')]['id'];}return db[_0x4e60('0x28')][_0x4e60('0x42')]({'where':{'id':_0xd53d10[_0x4e60('0x3f')]['id']}})['then'](handleEntityNotFound(_0x86e0ca,null))[_0x4e60('0x23')](saveUpdates(_0xd53d10[_0x4e60('0x44')],null))[_0x4e60('0x23')](respondWithResult(_0x86e0ca,null))['catch'](handleError(_0x86e0ca,null));};exports[_0x4e60('0x22')]=function(_0x3090f0,_0x70cd98){return db[_0x4e60('0x28')][_0x4e60('0x42')]({'where':{'id':_0x3090f0[_0x4e60('0x3f')]['id']}})['then'](handleEntityNotFound(_0x70cd98,null))[_0x4e60('0x23')](removeEntity(_0x70cd98,null))[_0x4e60('0x3d')](handleError(_0x70cd98,null));}; \ No newline at end of file +var _0x1215=['keys','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','apply','reject','save','then','destroy','end','error','stack','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params'];(function(_0x580a57,_0xe9121a){var _0x8a8a34=function(_0x45f167){while(--_0x45f167){_0x580a57['push'](_0x580a57['shift']());}};_0x8a8a34(++_0xe9121a);}(_0x1215,0x17d));var _0x5121=function(_0x35be1c,_0x45a7ef){_0x35be1c=_0x35be1c-0x0;var _0x1d99e1=_0x1215[_0x35be1c];return _0x1d99e1;};'use strict';var emlformat=require(_0x5121('0x0'));var rimraf=require(_0x5121('0x1'));var zipdir=require(_0x5121('0x2'));var jsonpatch=require(_0x5121('0x3'));var rp=require(_0x5121('0x4'));var moment=require(_0x5121('0x5'));var BPromise=require(_0x5121('0x6'));var Mustache=require('mustache');var util=require(_0x5121('0x7'));var path=require(_0x5121('0x8'));var sox=require(_0x5121('0x9'));var csv=require(_0x5121('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5121('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5121('0xc'));var jsforce=require(_0x5121('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5121('0xa'));var querystring=require('querystring');var Papa=require(_0x5121('0xe'));var Redis=require(_0x5121('0xf'));var authService=require(_0x5121('0x10'));var qs=require(_0x5121('0x11'));var as=require(_0x5121('0x12'));var hardwareService=require(_0x5121('0x13'));var logger=require(_0x5121('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5121('0x15'));var db=require(_0x5121('0x16'))['db'];function respondWithStatusCode(_0x50089f,_0x4dd7f1){_0x4dd7f1=_0x4dd7f1||0xcc;return function(_0x1ba5c1){if(_0x1ba5c1){return _0x50089f[_0x5121('0x17')](_0x4dd7f1);}return _0x50089f[_0x5121('0x18')](_0x4dd7f1)['end']();};}function respondWithResult(_0x53a507,_0x3ad98d){_0x3ad98d=_0x3ad98d||0xc8;return function(_0x399cf7){if(_0x399cf7){return _0x53a507[_0x5121('0x18')](_0x3ad98d)['json'](_0x399cf7);}};}function respondWithFilteredResult(_0x18d9df,_0x4f8584){return function(_0x49d031){if(_0x49d031){var _0x3ddf03=typeof _0x4f8584['offset']===_0x5121('0x19')&&typeof _0x4f8584[_0x5121('0x1a')]==='undefined';var _0x55524e=_0x49d031['count'];var _0x489a18=_0x3ddf03?0x0:_0x4f8584[_0x5121('0x1b')];var _0x7acd5b=_0x3ddf03?_0x49d031[_0x5121('0x1c')]:_0x4f8584[_0x5121('0x1b')]+_0x4f8584['limit'];var _0x556871;if(_0x7acd5b>=_0x55524e){_0x7acd5b=_0x55524e;_0x556871=0xc8;}else{_0x556871=0xce;}_0x18d9df[_0x5121('0x18')](_0x556871);return _0x18d9df['set']('Content-Range',_0x489a18+'-'+_0x7acd5b+'/'+_0x55524e)['json'](_0x49d031);}return null;};}function patchUpdates(_0x45f349){return function(_0x750281){try{jsonpatch[_0x5121('0x1d')](_0x750281,_0x45f349,!![]);}catch(_0x48414e){return BPromise[_0x5121('0x1e')](_0x48414e);}return _0x750281[_0x5121('0x1f')]();};}function saveUpdates(_0x24e123,_0x5bce43){return function(_0x34f280){if(_0x34f280){return _0x34f280['update'](_0x24e123)[_0x5121('0x20')](function(_0x25636f){return _0x25636f;});}return null;};}function removeEntity(_0x41660e,_0x3abd40){return function(_0x111d41){if(_0x111d41){return _0x111d41[_0x5121('0x21')]()['then'](function(){_0x41660e[_0x5121('0x18')](0xcc)[_0x5121('0x22')]();});}};}function handleEntityNotFound(_0x1f20fa,_0x19865e){return function(_0x56f677){if(!_0x56f677){_0x1f20fa[_0x5121('0x17')](0x194);}return _0x56f677;};}function handleError(_0x29cad2,_0x43b8f5){_0x43b8f5=_0x43b8f5||0x1f4;return function(_0x160207){logger[_0x5121('0x23')](_0x160207[_0x5121('0x24')]);if(_0x160207[_0x5121('0x25')]){delete _0x160207[_0x5121('0x25')];}_0x29cad2[_0x5121('0x18')](_0x43b8f5)[_0x5121('0x26')](_0x160207);};}exports[_0x5121('0x27')]=function(_0x15f920,_0x2f999b){var _0x413815={},_0x2eb108={},_0xb3a076={'count':0x0,'rows':[]};var _0x7888c1=_['map'](db[_0x5121('0x28')][_0x5121('0x29')],function(_0x32cb0b){return{'name':_0x32cb0b[_0x5121('0x2a')],'type':_0x32cb0b[_0x5121('0x2b')][_0x5121('0x2c')]};});_0x2eb108['model']=_[_0x5121('0x2d')](_0x7888c1,_0x5121('0x25'));_0x2eb108[_0x5121('0x2e')]=_['keys'](_0x15f920[_0x5121('0x2e')]);_0x2eb108[_0x5121('0x2f')]=_[_0x5121('0x30')](_0x2eb108['model'],_0x2eb108[_0x5121('0x2e')]);_0x413815['attributes']=_[_0x5121('0x30')](_0x2eb108[_0x5121('0x31')],qs[_0x5121('0x32')](_0x15f920[_0x5121('0x2e')][_0x5121('0x32')]));_0x413815[_0x5121('0x33')]=_0x413815[_0x5121('0x33')][_0x5121('0x34')]?_0x413815[_0x5121('0x33')]:_0x2eb108['model'];if(!_0x15f920['query'][_0x5121('0x35')](_0x5121('0x36'))){_0x413815[_0x5121('0x1a')]=qs[_0x5121('0x1a')](_0x15f920[_0x5121('0x2e')][_0x5121('0x1a')]);_0x413815[_0x5121('0x1b')]=qs[_0x5121('0x1b')](_0x15f920['query']['offset']);}_0x413815[_0x5121('0x37')]=qs[_0x5121('0x38')](_0x15f920[_0x5121('0x2e')][_0x5121('0x38')]);_0x413815['where']=qs[_0x5121('0x2f')](_[_0x5121('0x39')](_0x15f920[_0x5121('0x2e')],_0x2eb108[_0x5121('0x2f')]),_0x7888c1);if(_0x15f920[_0x5121('0x2e')][_0x5121('0x3a')]){_0x413815['where']=_[_0x5121('0x3b')](_0x413815[_0x5121('0x3c')],{'$or':_[_0x5121('0x2d')](_0x7888c1,function(_0x5c5a8a){if(_0x5c5a8a[_0x5121('0x2b')]!==_0x5121('0x3d')){var _0xda05b0={};_0xda05b0[_0x5c5a8a[_0x5121('0x25')]]={'$like':'%'+_0x15f920['query'][_0x5121('0x3a')]+'%'};return _0xda05b0;}})});}_0x413815=_[_0x5121('0x3b')]({},_0x413815,_0x15f920['options']);var _0x34d015={'where':_0x413815[_0x5121('0x3c')]};return db[_0x5121('0x28')][_0x5121('0x1c')](_0x34d015)[_0x5121('0x20')](function(_0x575912){_0xb3a076[_0x5121('0x1c')]=_0x575912;if(_0x15f920[_0x5121('0x2e')][_0x5121('0x3e')]){_0x413815[_0x5121('0x3f')]=[{'all':!![]}];}return db['FaxApplication'][_0x5121('0x40')](_0x413815);})['then'](function(_0x36ca53){_0xb3a076[_0x5121('0x41')]=_0x36ca53;return _0xb3a076;})['then'](respondWithFilteredResult(_0x2f999b,_0x413815))[_0x5121('0x42')](handleError(_0x2f999b,null));};exports[_0x5121('0x43')]=function(_0x5ac04a,_0x347d42){var _0x577c72={'raw':!![],'where':{'id':_0x5ac04a[_0x5121('0x44')]['id']}},_0x5e00ff={};_0x5e00ff[_0x5121('0x31')]=_[_0x5121('0x45')](db[_0x5121('0x28')][_0x5121('0x29')]);_0x5e00ff[_0x5121('0x2e')]=_[_0x5121('0x45')](_0x5ac04a[_0x5121('0x2e')]);_0x5e00ff[_0x5121('0x2f')]=_[_0x5121('0x30')](_0x5e00ff[_0x5121('0x31')],_0x5e00ff[_0x5121('0x2e')]);_0x577c72[_0x5121('0x33')]=_['intersection'](_0x5e00ff[_0x5121('0x31')],qs['fields'](_0x5ac04a[_0x5121('0x2e')][_0x5121('0x32')]));_0x577c72['attributes']=_0x577c72['attributes'][_0x5121('0x34')]?_0x577c72[_0x5121('0x33')]:_0x5e00ff[_0x5121('0x31')];if(_0x5ac04a[_0x5121('0x2e')][_0x5121('0x3e')]){_0x577c72[_0x5121('0x3f')]=[{'all':!![]}];}_0x577c72=_[_0x5121('0x3b')]({},_0x577c72,_0x5ac04a[_0x5121('0x46')]);return db[_0x5121('0x28')][_0x5121('0x47')](_0x577c72)[_0x5121('0x20')](handleEntityNotFound(_0x347d42,null))[_0x5121('0x20')](respondWithResult(_0x347d42,null))[_0x5121('0x42')](handleError(_0x347d42,null));};exports['create']=function(_0x2c2d82,_0x3c91d8){return db['FaxApplication'][_0x5121('0x48')](_0x2c2d82[_0x5121('0x49')],{})[_0x5121('0x20')](respondWithResult(_0x3c91d8,0xc9))[_0x5121('0x42')](handleError(_0x3c91d8,null));};exports[_0x5121('0x4a')]=function(_0xacd4fb,_0x9b0956){if(_0xacd4fb[_0x5121('0x49')]['id']){delete _0xacd4fb[_0x5121('0x49')]['id'];}return db[_0x5121('0x28')][_0x5121('0x47')]({'where':{'id':_0xacd4fb[_0x5121('0x44')]['id']}})['then'](handleEntityNotFound(_0x9b0956,null))[_0x5121('0x20')](saveUpdates(_0xacd4fb[_0x5121('0x49')],null))['then'](respondWithResult(_0x9b0956,null))[_0x5121('0x42')](handleError(_0x9b0956,null));};exports[_0x5121('0x21')]=function(_0x21c6d1,_0x16d151){return db[_0x5121('0x28')][_0x5121('0x47')]({'where':{'id':_0x21c6d1[_0x5121('0x44')]['id']}})[_0x5121('0x20')](handleEntityNotFound(_0x16d151,null))[_0x5121('0x20')](removeEntity(_0x16d151,null))[_0x5121('0x42')](handleError(_0x16d151,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index a7125d4..b77a573 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 _0x26af=['define','FaxApplication','fax_applications','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','path','../../config/environment','./faxApplication.attributes','exports'];(function(_0x5b163b,_0x1aa5b3){var _0x4cd0b4=function(_0x487c01){while(--_0x487c01){_0x5b163b['push'](_0x5b163b['shift']());}};_0x4cd0b4(++_0x1aa5b3);}(_0x26af,0x1f0));var _0xf26a=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0x26af[_0x2df724];return _0x1b2504;};'use strict';var _=require('lodash');var util=require(_0xf26a('0x0'));var logger=require(_0xf26a('0x1'))('api');var moment=require(_0xf26a('0x2'));var BPromise=require('bluebird');var rp=require(_0xf26a('0x3'));var fs=require('fs');var path=require(_0xf26a('0x4'));var rimraf=require('rimraf');var config=require(_0xf26a('0x5'));var attributes=require(_0xf26a('0x6'));module[_0xf26a('0x7')]=function(_0xe7bd88,_0x3358fa){return _0xe7bd88[_0xf26a('0x8')](_0xf26a('0x9'),attributes,{'tableName':_0xf26a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf26a('0xb')});}; \ No newline at end of file +var _0x3e49=['./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x25c326,_0x250137){var _0x762452=function(_0x50ce5e){while(--_0x50ce5e){_0x25c326['push'](_0x25c326['shift']());}};_0x762452(++_0x250137);}(_0x3e49,0x166));var _0x93e4=function(_0x30da4d,_0x54286e){_0x30da4d=_0x30da4d-0x0;var _0xe5269c=_0x3e49[_0x30da4d];return _0xe5269c;};'use strict';var _=require(_0x93e4('0x0'));var util=require('util');var logger=require(_0x93e4('0x1'))(_0x93e4('0x2'));var moment=require('moment');var BPromise=require(_0x93e4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x93e4('0x4'));var rimraf=require(_0x93e4('0x5'));var config=require('../../config/environment');var attributes=require(_0x93e4('0x6'));module[_0x93e4('0x7')]=function(_0x9a1351,_0x4324d6){return _0x9a1351[_0x93e4('0x8')](_0x93e4('0x9'),attributes,{'tableName':_0x93e4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x93e4('0xb'),'collate':_0x93e4('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index f162b04..4f155f5 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 _0xeaee=['raw','where','attributes','limit','then','UpdateFaxApplication','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxApplication','update','body','options'];(function(_0x1fd5eb,_0x235203){var _0x102365=function(_0x54de1f){while(--_0x54de1f){_0x1fd5eb['push'](_0x1fd5eb['shift']());}};_0x102365(++_0x235203);}(_0xeaee,0x138));var _0xeeae=function(_0x2f5d2f,_0x406b24){_0x2f5d2f=_0x2f5d2f-0x0;var _0x10ee86=_0xeaee[_0x2f5d2f];return _0x10ee86;};'use strict';var _=require('lodash');var util=require(_0xeeae('0x0'));var moment=require(_0xeeae('0x1'));var BPromise=require(_0xeeae('0x2'));var rs=require(_0xeeae('0x3'));var fs=require('fs');var Redis=require(_0xeeae('0x4'));var db=require(_0xeeae('0x5'))['db'];var utils=require(_0xeeae('0x6'));var logger=require(_0xeeae('0x7'))(_0xeeae('0x8'));var config=require(_0xeeae('0x9'));var jayson=require(_0xeeae('0xa'));var client=jayson[_0xeeae('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11a962,_0x4ab33a,_0x5318b9){return new BPromise(function(_0x23a804,_0x5c9353){return client[_0xeeae('0xc')](_0x11a962,_0x5318b9)['then'](function(_0x63c50f){logger[_0xeeae('0xd')](_0xeeae('0xe'),_0x4ab33a,_0xeeae('0xf'));logger[_0xeeae('0x10')](_0xeeae('0x11'),_0x4ab33a,'request\x20sent',JSON[_0xeeae('0x12')](_0x63c50f));if(_0x63c50f[_0xeeae('0x13')]){if(_0x63c50f['error'][_0xeeae('0x14')]===0x1f4){logger[_0xeeae('0x13')](_0xeeae('0xe'),_0x4ab33a,_0x63c50f['error']['message']);return _0x5c9353(_0x63c50f['error']['message']);}logger[_0xeeae('0x13')](_0xeeae('0xe'),_0x4ab33a,_0x63c50f[_0xeeae('0x13')]['message']);return _0x23a804(_0x63c50f[_0xeeae('0x13')][_0xeeae('0x15')]);}else{logger[_0xeeae('0xd')](_0xeeae('0xe'),_0x4ab33a,_0xeeae('0xf'));_0x23a804(_0x63c50f[_0xeeae('0x16')][_0xeeae('0x15')]);}})[_0xeeae('0x17')](function(_0x2adbb9){logger[_0xeeae('0x13')](_0xeeae('0xe'),_0x4ab33a,_0x2adbb9);_0x5c9353(_0x2adbb9);});});}exports['UpdateFaxApplication']=function(_0x2b3baa){var _0x3c8b51=this;return new Promise(function(_0x151e75,_0x5e0227){return db[_0xeeae('0x18')][_0xeeae('0x19')](_0x2b3baa[_0xeeae('0x1a')],{'raw':_0x2b3baa[_0xeeae('0x1b')]?_0x2b3baa[_0xeeae('0x1b')][_0xeeae('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b3baa[_0xeeae('0x1b')]?_0x2b3baa[_0xeeae('0x1b')][_0xeeae('0x1d')]||null:null,'attributes':_0x2b3baa[_0xeeae('0x1b')]?_0x2b3baa['options'][_0xeeae('0x1e')]||null:null,'limit':_0x2b3baa['options']?_0x2b3baa[_0xeeae('0x1b')][_0xeeae('0x1f')]||null:null})[_0xeeae('0x20')](function(_0x5b2470){logger[_0xeeae('0xd')](_0xeeae('0x21'),_0x2b3baa);logger['debug'](_0xeeae('0x21'),_0x2b3baa,JSON['stringify'](_0x5b2470));_0x151e75(_0x5b2470);})[_0xeeae('0x17')](function(_0x1a815e){logger[_0xeeae('0x13')](_0xeeae('0x21'),_0x1a815e[_0xeeae('0x15')],_0x2b3baa);_0x5e0227(_0x3c8b51[_0xeeae('0x13')](0x1f4,_0x1a815e['message']));});});}; \ No newline at end of file +var _0xc3a9=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateFaxApplication','FaxApplication','update','body','options','attributes','limit','catch','lodash'];(function(_0x46743b,_0xcb5ed3){var _0x8ab6c0=function(_0x3e89b4){while(--_0x3e89b4){_0x46743b['push'](_0x46743b['shift']());}};_0x8ab6c0(++_0xcb5ed3);}(_0xc3a9,0x104));var _0x9c3a=function(_0x2a0753,_0x169edf){_0x2a0753=_0x2a0753-0x0;var _0xccbbf6=_0xc3a9[_0x2a0753];return _0xccbbf6;};'use strict';var _=require(_0x9c3a('0x0'));var util=require(_0x9c3a('0x1'));var moment=require('moment');var BPromise=require(_0x9c3a('0x2'));var rs=require(_0x9c3a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c3a('0x4'))['db'];var utils=require(_0x9c3a('0x5'));var logger=require(_0x9c3a('0x6'))('rpc');var config=require(_0x9c3a('0x7'));var jayson=require(_0x9c3a('0x8'));var client=jayson[_0x9c3a('0x9')][_0x9c3a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1be9b6,_0x593128,_0x4f153c){return new BPromise(function(_0x3b9997,_0x1fa3d4){return client[_0x9c3a('0xb')](_0x1be9b6,_0x4f153c)['then'](function(_0x19bd80){logger[_0x9c3a('0xc')](_0x9c3a('0xd'),_0x593128,'request\x20sent');logger[_0x9c3a('0xe')](_0x9c3a('0xf'),_0x593128,_0x9c3a('0x10'),JSON[_0x9c3a('0x11')](_0x19bd80));if(_0x19bd80[_0x9c3a('0x12')]){if(_0x19bd80[_0x9c3a('0x12')]['code']===0x1f4){logger[_0x9c3a('0x12')](_0x9c3a('0xd'),_0x593128,_0x19bd80[_0x9c3a('0x12')]['message']);return _0x1fa3d4(_0x19bd80[_0x9c3a('0x12')]['message']);}logger[_0x9c3a('0x12')](_0x9c3a('0xd'),_0x593128,_0x19bd80[_0x9c3a('0x12')][_0x9c3a('0x13')]);return _0x3b9997(_0x19bd80[_0x9c3a('0x12')][_0x9c3a('0x13')]);}else{logger[_0x9c3a('0xc')](_0x9c3a('0xd'),_0x593128,_0x9c3a('0x10'));_0x3b9997(_0x19bd80[_0x9c3a('0x14')]['message']);}})['catch'](function(_0x1879e9){logger[_0x9c3a('0x12')](_0x9c3a('0xd'),_0x593128,_0x1879e9);_0x1fa3d4(_0x1879e9);});});}exports[_0x9c3a('0x15')]=function(_0x1d98be){var _0x1f7ada=this;return new Promise(function(_0x52edee,_0xafe378){return db[_0x9c3a('0x16')][_0x9c3a('0x17')](_0x1d98be[_0x9c3a('0x18')],{'raw':_0x1d98be['options']?_0x1d98be['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d98be[_0x9c3a('0x19')]?_0x1d98be[_0x9c3a('0x19')]['where']||null:null,'attributes':_0x1d98be[_0x9c3a('0x19')]?_0x1d98be['options'][_0x9c3a('0x1a')]||null:null,'limit':_0x1d98be[_0x9c3a('0x19')]?_0x1d98be[_0x9c3a('0x19')][_0x9c3a('0x1b')]||null:null})['then'](function(_0x3b9dba){logger[_0x9c3a('0xc')]('UpdateFaxApplication',_0x1d98be);logger['debug'](_0x9c3a('0x15'),_0x1d98be,JSON[_0x9c3a('0x11')](_0x3b9dba));_0x52edee(_0x3b9dba);})[_0x9c3a('0x1c')](function(_0x58d294){logger[_0x9c3a('0x12')](_0x9c3a('0x15'),_0x58d294[_0x9c3a('0x13')],_0x1d98be);_0xafe378(_0x1f7ada['error'](0x1f4,_0x58d294[_0x9c3a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 36a49f3..cffb3c1 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 _0x705b=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','show','post','isAuthenticated'];(function(_0x3b0c11,_0x488ac1){var _0x32d4f6=function(_0x3a0a4f){while(--_0x3a0a4f){_0x3b0c11['push'](_0x3b0c11['shift']());}};_0x32d4f6(++_0x488ac1);}(_0x705b,0x16d));var _0xb705=function(_0x3a5462,_0x101820){_0x3a5462=_0x3a5462-0x0;var _0x16ea24=_0x705b[_0x3a5462];return _0x16ea24;};'use strict';var multer=require(_0xb705('0x0'));var util=require(_0xb705('0x1'));var path=require(_0xb705('0x2'));var timeout=require(_0xb705('0x3'));var express=require(_0xb705('0x4'));var router=express[_0xb705('0x5')]();var fs_extra=require(_0xb705('0x6'));var auth=require(_0xb705('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb705('0x8'));var controller=require('./faxApplication.controller');router[_0xb705('0x9')]('/',auth['isAuthenticated'](),controller[_0xb705('0xa')]);router[_0xb705('0x9')](_0xb705('0xb'),auth['isAuthenticated'](),controller[_0xb705('0xc')]);router[_0xb705('0xd')]('/',auth[_0xb705('0xe')](),controller['create']);router[_0xb705('0xf')]('/:id',auth[_0xb705('0xe')](),controller[_0xb705('0x10')]);router[_0xb705('0x11')](_0xb705('0xb'),auth['isAuthenticated'](),controller[_0xb705('0x12')]);module[_0xb705('0x13')]=router; \ No newline at end of file +var _0x0cf9=['put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create'];(function(_0xc65834,_0x5df6fb){var _0x5da298=function(_0x30fbc2){while(--_0x30fbc2){_0xc65834['push'](_0xc65834['shift']());}};_0x5da298(++_0x5df6fb);}(_0x0cf9,0x76));var _0x90cf=function(_0x4baac8,_0x5f1dc7){_0x4baac8=_0x4baac8-0x0;var _0x56ebc5=_0x0cf9[_0x4baac8];return _0x56ebc5;};'use strict';var multer=require(_0x90cf('0x0'));var util=require(_0x90cf('0x1'));var path=require('path');var timeout=require(_0x90cf('0x2'));var express=require(_0x90cf('0x3'));var router=express[_0x90cf('0x4')]();var fs_extra=require(_0x90cf('0x5'));var auth=require(_0x90cf('0x6'));var interaction=require(_0x90cf('0x7'));var config=require('../../config/environment');var controller=require('./faxApplication.controller');router[_0x90cf('0x8')]('/',auth[_0x90cf('0x9')](),controller[_0x90cf('0xa')]);router[_0x90cf('0x8')](_0x90cf('0xb'),auth[_0x90cf('0x9')](),controller[_0x90cf('0xc')]);router[_0x90cf('0xd')]('/',auth[_0x90cf('0x9')](),controller[_0x90cf('0xe')]);router[_0x90cf('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x90cf('0x10')]);router[_0x90cf('0x11')](_0x90cf('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x90cf('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 1bff9a2..b9a54f8 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 _0x2263=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x41b666,_0x4c3e13){var _0x48841e=function(_0x3d17e0){while(--_0x3d17e0){_0x41b666['push'](_0x41b666['shift']());}};_0x48841e(++_0x4c3e13);}(_0x2263,0x6e));var _0x3226=function(_0x3ef45e,_0xe84f33){_0x3ef45e=_0x3ef45e-0x0;var _0x69e7c=_0x2263[_0x3ef45e];return _0x69e7c;};'use strict';var Sequelize=require(_0x3226('0x0'));module[_0x3226('0x1')]={'closed':{'type':Sequelize[_0x3226('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3226('0x3')]},'disposition':{'type':Sequelize[_0x3226('0x4')]},'secondDisposition':{'type':Sequelize[_0x3226('0x4')]},'thirdDisposition':{'type':Sequelize[_0x3226('0x4')]},'note':{'type':Sequelize[_0x3226('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x3226('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3226('0x5')]('in',_0x3226('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3226('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3226('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x36bb=['exports','BOOLEAN','STRING','DATE','ENUM','out','sequelize'];(function(_0x5931df,_0x8b8342){var _0x544194=function(_0x141ff0){while(--_0x141ff0){_0x5931df['push'](_0x5931df['shift']());}};_0x544194(++_0x8b8342);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb36b('0x0'));module[_0xb36b('0x1')]={'closed':{'type':Sequelize[_0xb36b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb36b('0x3')]},'secondDisposition':{'type':Sequelize[_0xb36b('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb36b('0x3')]},'note':{'type':Sequelize[_0xb36b('0x3')]},'read1stAt':{'type':Sequelize[_0xb36b('0x4')]},'fax':{'type':Sequelize[_0xb36b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb36b('0x5')]('in',_0xb36b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb36b('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xb36b('0x5')]('in',_0xb36b('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 738be2d..1233e00 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 _0x9800=['existsSync','createReadStream','pipe','resolve','download','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','end','json','offset','undefined','count','limit','status','set','apply','reject','save','then','destroy','sendStatus','error','name','send','map','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','field','from','tools_tags','select','u.id','u.fullname','ui.FaxInteractionId','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','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','value','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','start','Tag','UserId','body','keys','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','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)','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','rawAttributes','includeAll','include','options','create','update','describe','FaxMessage','addMessage','omit','ids','findOne','sort','pick','$gte','format','findAll','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','unix','join','server','root','attachments','transcript-%d-%s.zip','Attachment','createdAt','Messages','mkdirSync','basename'];(function(_0x233e13,_0x2fa2de){var _0x53b1a2=function(_0x10e305){while(--_0x10e305){_0x233e13['push'](_0x233e13['shift']());}};_0x53b1a2(++_0x2fa2de);}(_0x9800,0xe5));var _0x0980=function(_0x1a2dab,_0x32ac42){_0x1a2dab=_0x1a2dab-0x0;var _0x59cced=_0x9800[_0x1a2dab];return _0x59cced;};'use strict';var emlformat=require(_0x0980('0x0'));var rimraf=require(_0x0980('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0980('0x2'));var rp=require(_0x0980('0x3'));var moment=require(_0x0980('0x4'));var BPromise=require(_0x0980('0x5'));var Mustache=require('mustache');var util=require(_0x0980('0x6'));var path=require(_0x0980('0x7'));var sox=require('sox');var csv=require(_0x0980('0x8'));var ejs=require(_0x0980('0x9'));var fs=require('fs');var fs_extra=require(_0x0980('0xa'));var _=require(_0x0980('0xb'));var squel=require(_0x0980('0xc'));var crypto=require(_0x0980('0xd'));var jsforce=require(_0x0980('0xe'));var deskjs=require(_0x0980('0xf'));var toCsv=require(_0x0980('0x8'));var querystring=require(_0x0980('0x10'));var Papa=require(_0x0980('0x11'));var Redis=require(_0x0980('0x12'));var authService=require(_0x0980('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0980('0x14'));var hardwareService=require(_0x0980('0x15'));var logger=require('../../config/logger')(_0x0980('0x16'));var utils=require(_0x0980('0x17'));var config=require(_0x0980('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0980('0x19'))['db'];config['redis']=_[_0x0980('0x1a')](config[_0x0980('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x0980('0x1c'))(new Redis(config[_0x0980('0x1b')]));require(_0x0980('0x1d'))[_0x0980('0x1e')](socket);function respondWithStatusCode(_0x5e7ac2,_0x72baf7){_0x72baf7=_0x72baf7||0xcc;return function(_0x11b022){if(_0x11b022){return _0x5e7ac2['sendStatus'](_0x72baf7);}return _0x5e7ac2['status'](_0x72baf7)[_0x0980('0x1f')]();};}function respondWithResult(_0x35ddbf,_0x5c7607){_0x5c7607=_0x5c7607||0xc8;return function(_0x4ff75f){if(_0x4ff75f){return _0x35ddbf['status'](_0x5c7607)[_0x0980('0x20')](_0x4ff75f);}};}function respondWithFilteredResult(_0x1cad5e,_0x5e5878){return function(_0x55a46b){if(_0x55a46b){var _0x34eb8f=typeof _0x5e5878[_0x0980('0x21')]==='undefined'&&typeof _0x5e5878['limit']===_0x0980('0x22');var _0x289e1a=_0x55a46b[_0x0980('0x23')];var _0x1b9a95=_0x34eb8f?0x0:_0x5e5878['offset'];var _0x11f5dd=_0x34eb8f?_0x55a46b[_0x0980('0x23')]:_0x5e5878[_0x0980('0x21')]+_0x5e5878[_0x0980('0x24')];var _0x218a72;if(_0x11f5dd>=_0x289e1a){_0x11f5dd=_0x289e1a;_0x218a72=0xc8;}else{_0x218a72=0xce;}_0x1cad5e[_0x0980('0x25')](_0x218a72);return _0x1cad5e[_0x0980('0x26')]('Content-Range',_0x1b9a95+'-'+_0x11f5dd+'/'+_0x289e1a)[_0x0980('0x20')](_0x55a46b);}return null;};}function patchUpdates(_0x290c1c){return function(_0x4a3879){try{jsonpatch[_0x0980('0x27')](_0x4a3879,_0x290c1c,!![]);}catch(_0x108280){return BPromise[_0x0980('0x28')](_0x108280);}return _0x4a3879[_0x0980('0x29')]();};}function saveUpdates(_0x101cd2,_0x97e437){return function(_0x2d617c){if(_0x2d617c){return _0x2d617c['update'](_0x101cd2)[_0x0980('0x2a')](function(_0x2e6e24){return _0x2e6e24;});}return null;};}function removeEntity(_0x2c1291,_0x3babd9){return function(_0x237590){if(_0x237590){return _0x237590[_0x0980('0x2b')]()[_0x0980('0x2a')](function(){_0x2c1291[_0x0980('0x25')](0xcc)[_0x0980('0x1f')]();});}};}function handleEntityNotFound(_0x2d6b88,_0x4157d0){return function(_0x27129d){if(!_0x27129d){_0x2d6b88[_0x0980('0x2c')](0x194);}return _0x27129d;};}function handleError(_0x4f1972,_0x7aa4e4){_0x7aa4e4=_0x7aa4e4||0x1f4;return function(_0x24a821){logger[_0x0980('0x2d')](_0x24a821['stack']);if(_0x24a821[_0x0980('0x2e')]){delete _0x24a821[_0x0980('0x2e')];}_0x4f1972[_0x0980('0x25')](_0x7aa4e4)[_0x0980('0x2f')](_0x24a821);};}function getInteractionUsers(_0x4abbdb,_0x582859){return new BPromise(function(_0xb258d8,_0x4d5c7d){try{if(_0x582859[_0x4abbdb['id']]){_0x4abbdb['Users']=_[_0x0980('0x30')](_0x582859[_0x4abbdb['id']],function(_0x53f8a2){return{'id':_0x53f8a2['id'],'fullname':_0x53f8a2['fullname']};});}}catch(_0x51a27b){_0x4d5c7d(_0x51a27b);}_0xb258d8(_0x4abbdb);});}function getInteractionTags(_0x2015da,_0x5dc68b){return new BPromise(function(_0x14979c,_0x5810c7){try{if(_0x2015da[_0x0980('0x31')]){_0x2015da[_0x0980('0x32')]=[];_0x2015da['TagIds'][_0x0980('0x33')](',')[_0x0980('0x34')](function(_0x271908){_0x2015da[_0x0980('0x32')][_0x0980('0x35')](_0x5dc68b[_0x271908]);});}delete _0x2015da['TagIds'];}catch(_0x456c3f){_0x5810c7(_0x456c3f);}_0x14979c(_0x2015da);});}function updateFaxInteraction(_0x296901,_0x5b75cb,_0x195aff){return new BPromise(function(_0x3d4b6f,_0x52b12f){return getInteractionUsers(_0x296901,_0x195aff)[_0x0980('0x2a')](function(_0x2c46cb){return getInteractionTags(_0x2c46cb,_0x5b75cb);})[_0x0980('0x2a')](function(_0x2074ac){_0x3d4b6f(_0x2074ac);})[_0x0980('0x36')](function(_0x3d5a04){_0x52b12f(_0x3d5a04);});});}exports[_0x0980('0x37')]=function(_0x1a1612,_0x3c434f){var _0x233342={},_0x30fc52={},_0xd561fe={'count':0x0,'rows':[]};var _0x50dfea=_[_0x0980('0x30')](db[_0x0980('0x38')]['rawAttributes'],function(_0x2c14bb){return{'name':_0x2c14bb[_0x0980('0x39')],'type':_0x2c14bb[_0x0980('0x3a')]['key']};});_0x30fc52['model']=_['map'](_0x50dfea,_0x0980('0x2e'));_0x30fc52[_0x0980('0x3b')]=_['keys'](_0x1a1612['query']);_0x30fc52[_0x0980('0x3c')]=_[_0x0980('0x3d')](_0x30fc52[_0x0980('0x3e')],_0x30fc52[_0x0980('0x3b')]);_0x233342[_0x0980('0x3f')]=_[_0x0980('0x3d')](_0x30fc52['model'],qs[_0x0980('0x40')](_0x1a1612[_0x0980('0x3b')][_0x0980('0x40')]));_0x233342[_0x0980('0x3f')]=_0x233342[_0x0980('0x3f')]['length']?_0x233342[_0x0980('0x3f')]:_0x30fc52[_0x0980('0x3e')];if(!_0x1a1612['query'][_0x0980('0x41')](_0x0980('0x42'))){_0x233342[_0x0980('0x24')]=qs[_0x0980('0x24')](_0x1a1612['query'][_0x0980('0x24')]);_0x233342[_0x0980('0x21')]=qs[_0x0980('0x21')](_0x1a1612[_0x0980('0x3b')][_0x0980('0x21')]);}_0x233342[_0x0980('0x43')]=qs['sort'](_0x1a1612[_0x0980('0x3b')]['sort']);_0x233342[_0x0980('0x44')]=qs['filters'](_['pick'](_0x1a1612['query'],_0x30fc52['filters']),_0x50dfea);var _0x5b5d9b=[];var _0x2cbae6=squel['select']()[_0x0980('0x45')]('id')[_0x0980('0x45')](_0x0980('0x2e'))[_0x0980('0x45')]('color')[_0x0980('0x46')](_0x0980('0x47'));var _0x243bac=squel[_0x0980('0x48')]()[_0x0980('0x45')](_0x0980('0x49'))[_0x0980('0x45')](_0x0980('0x4a'))['field'](_0x0980('0x4b'))['from']('user_has_fax_interactions','ui')[_0x0980('0x4c')]('users','u',_0x0980('0x4d'));var _0x64e952=squel['select']()[_0x0980('0x46')](_0x0980('0x4e'),'i')[_0x0980('0x4c')](_0x0980('0x4f'),'c',_0x0980('0x50'))[_0x0980('0x4c')](_0x0980('0x51'),'o',_0x0980('0x52'))[_0x0980('0x4c')](_0x0980('0x53'),'a',_0x0980('0x54'))[_0x0980('0x4c')](_0x0980('0x55'),'me',_0x0980('0x56'))['left_join'](_0x0980('0x57'),'it',_0x0980('0x58'))[_0x0980('0x4c')](_0x0980('0x47'),'t',_0x0980('0x59'));var _0x22c14f=squel[_0x0980('0x5a')]();var _0x269eca=[];var _0xd9deb1=squel['expr']();var _0x20e38e;if(_0x1a1612['query'][_0x0980('0x5b')]){_0x20e38e=as[_0x0980('0x5c')](_0x1a1612[_0x0980('0x3b')]['search']);var _0xd021bb=_0x20e38e[_0x0980('0x5d')];for(var _0x144b9c=0x0;_0x144b9c<_0x20e38e[_0x0980('0x5e')][_0x0980('0x5f')];_0x144b9c++){var _0x181432=_0x20e38e[_0x0980('0x5e')][_0x144b9c];var _0x1eadc2='i';var _0x5a0500=_[_0x0980('0x60')](_0x50dfea,[_0x0980('0x2e'),_0x181432[_0x0980('0x45')]]);if(!_0x5a0500){switch(_0x181432[_0x0980('0x45')]){case'unreadMessages':if(_0x181432[_0x0980('0x61')]==0x1){_0x64e952[_0x0980('0x62')]('`'+_0x181432[_0x0980('0x45')]+_0x0980('0x63'));}else{_0x64e952[_0x0980('0x62')]('`'+_0x181432[_0x0980('0x45')]+'`\x20>\x200');}break;case _0x0980('0x64'):if(_0x181432[_0x0980('0x65')]===_0x0980('0x66')){if(_0x181432[_0x0980('0x61')][_0x0980('0x33')]('\x20')['length']>0x1){_0x22c14f[_0xd021bb](_0x0980('0x67'),qs['getFullTextValue'](_0x181432[_0x0980('0x61')]),null);}else{var _0xfc18f3='%'+_0x181432[_0x0980('0x61')]+'%';_0x22c14f[_0xd021bb](_0x0980('0x68'),_0xfc18f3,_0xfc18f3,_0xfc18f3);}}else{_0x5a0500=_[_0x0980('0x60')](_0x50dfea,[_0x0980('0x2e'),_0x0980('0x69')]);_0x181432[_0x0980('0x45')]=_0x0980('0x69');_0x3deaf1=as[_0x0980('0x6a')](_0x1eadc2,_0x5a0500[_0x0980('0x3a')],_0x181432);_0x22c14f[_0xd021bb](_0x3deaf1[_0x0980('0x6b')],_0x3deaf1[_0x0980('0x61')][_0x0980('0x6c')],_0x3deaf1[_0x0980('0x61')][_0x0980('0x1f')]);}break;case _0x0980('0x6d'):var _0x135723=_0x181432[_0x0980('0x61')][_0x0980('0x33')](',')[_0x0980('0x30')](function(_0x344a83){return Number(_0x344a83);});_0x135723[_0x0980('0x34')](function(_0x5ee0e0){_0xd9deb1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5ee0e0+',%');});_0x269eca=_['union'](_0x269eca,_0x135723);break;case'User':if(_0x181432['operator']==='$substring'){_0x22c14f[_0xd021bb]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x181432[_0x0980('0x61')]+'%',null);}else{_0x5a0500=_[_0x0980('0x60')](_0x50dfea,[_0x0980('0x2e'),_0x0980('0x6e')]);_0x181432[_0x0980('0x45')]=_0x0980('0x6e');_0x3deaf1=as[_0x0980('0x6a')](_0x1eadc2,_0x5a0500[_0x0980('0x3a')],_0x181432);_0x22c14f[_0xd021bb](_0x3deaf1['text'],_0x3deaf1[_0x0980('0x61')][_0x0980('0x6c')],_0x3deaf1[_0x0980('0x61')][_0x0980('0x1f')]);}break;case _0x0980('0x6f'):_0x3deaf1=as[_0x0980('0x6a')]('me',null,_0x181432);_0x22c14f[_0xd021bb](_0x3deaf1[_0x0980('0x6b')],_0x3deaf1['value']['start'],_0x3deaf1[_0x0980('0x61')][_0x0980('0x1f')]);break;}}else{var _0x3deaf1=as[_0x0980('0x6a')](_0x1eadc2,_0x5a0500[_0x0980('0x3a')],_0x181432);_0x22c14f[_0xd021bb](_0x3deaf1[_0x0980('0x6b')],_0x3deaf1[_0x0980('0x61')][_0x0980('0x6c')],_0x3deaf1[_0x0980('0x61')][_0x0980('0x1f')]);}}}else{var _0x2535cb=_(_0x1a1612[_0x0980('0x3b')])[_0x0980('0x70')]()['map'](function(_0x26a22c){return _['some'](_0x50dfea,['name',_0x26a22c])?_0x26a22c:undefined;})[_0x0980('0x71')]()[_0x0980('0x61')]();if(!_['isEmpty'](_0x2535cb)){_0x2535cb[_0x0980('0x34')](function(_0x5d9add){if(_0x5d9add===_0x0980('0x72')){_0x64e952[_0x0980('0x44')](_0x0980('0x73'),[][_0x0980('0x74')](_0x1a1612[_0x0980('0x3b')][_0x5d9add]));}else if(_0x5d9add==='createdAt'){var _0xa1228=JSON[_0x0980('0x75')](_0x1a1612[_0x0980('0x3b')][_0x5d9add])['$gte'];var _0x11541f=JSON[_0x0980('0x75')](_0x1a1612[_0x0980('0x3b')][_0x5d9add])[_0x0980('0x76')];_0x64e952[_0x0980('0x44')](_0x0980('0x77'),_0xa1228,_0x11541f);}else{if(_0x1a1612[_0x0980('0x3b')][_0x5d9add]===_0x0980('0x78')){_0x64e952['where']('i.'+_0x5d9add+_0x0980('0x79'));}else{_0x64e952[_0x0980('0x44')]('i.'+_0x5d9add+_0x0980('0x7a'),_0x1a1612[_0x0980('0x3b')][_0x5d9add]);}}});}if(_0x1a1612['query'][_0x0980('0x7b')]){if(_0x1a1612[_0x0980('0x3b')][_0x0980('0x7b')]==0x1){_0x64e952[_0x0980('0x62')](_0x0980('0x7c'));}else{_0x64e952[_0x0980('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x1a1612[_0x0980('0x3b')][_0x0980('0x7d')]){_0x269eca=_[_0x0980('0x7e')](_0x1a1612['query']['tag'])?_0x1a1612[_0x0980('0x3b')][_0x0980('0x7d')]:new Array(_0x1a1612[_0x0980('0x3b')][_0x0980('0x7d')]);_0x269eca['forEach'](function(_0x27ea99){_0xd9deb1['or'](_0x0980('0x7f'),'%,'+_0x27ea99+',%');});}if(_0x1a1612[_0x0980('0x3b')][_0x0980('0x80')]){var _0x512596=_0x1a1612['query'][_0x0980('0x80')][_0x0980('0x81')]('\x5c','\x5c\x5c')[_0x0980('0x81')](/'/g,'\x27\x27');if(qs[_0x0980('0x82')](_0x512596)){_0x22c14f['or']('i.id\x20LIKE\x20?',_0x512596+'%')['or'](_0x0980('0x83'),_0x512596+'%');}_0x22c14f['or'](_0x0980('0x84'),_0x512596+'%');}}_0x64e952[_0x0980('0x44')](_0x22c14f);_0x64e952[_0x0980('0x85')](_0x0980('0x86'));var _0xe35d15={'type':db[_0x0980('0x87')][_0x0980('0x88')][_0x0980('0x89')],'raw':!![]};var _0x2e2b2e=_0x64e952[_0x0980('0x8a')]();_0x2e2b2e[_0x0980('0x45')](_0x0980('0x86'));_0x2e2b2e[_0x0980('0x45')](_0x0980('0x8b'),_0x0980('0x8c'));if(_0x233342[_0x0980('0x43')]){_0x233342[_0x0980('0x43')]['forEach'](function(_0x1937b7){var _0x192e15=_0x1937b7[0x0]===_0x0980('0x8d')?_0x1937b7[0x0]:'i.'+_0x1937b7[0x0];_0x64e952[_0x0980('0x43')](_0x192e15,_0x1937b7[0x1]===_0x0980('0x8e')?![]:!![]);});}if(!_[_0x0980('0x8f')](_0x269eca)){_0x64e952['having'](_0xd9deb1);_0x2e2b2e[_0x0980('0x44')](_0x0980('0x90'),_0x269eca);}BPromise['resolve']()['then'](function(){if(!_0x20e38e){if(_0x1a1612[_0x0980('0x3b')][_0x0980('0x72')])return;_0x2e2b2e[_0x0980('0x44')](_0x0980('0x91'));_0x64e952[_0x0980('0x44')](_0x0980('0x91'));return;}if(_0x1a1612['user'][_0x0980('0x92')]!==_0x0980('0x93'))return;return _0x1a1612[_0x0980('0x94')][_0x0980('0x95')]({'attributes':['id'],'raw':!![]})[_0x0980('0x2a')](function(_0x59d59d){if(_[_0x0980('0x8f')](_0x59d59d)){_0x2e2b2e['where'](_0x0980('0x96'));_0x64e952['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x2e2b2e['where'](_0x0980('0x73'),_[_0x0980('0x30')](_0x59d59d,'id'));_0x64e952[_0x0980('0x44')](_0x0980('0x73'),_[_0x0980('0x30')](_0x59d59d,'id'));}});})['then'](function(){if(_0x1a1612[_0x0980('0x94')][_0x0980('0x92')]===_0x0980('0x93')&&!_0x20e38e&&!_0x1a1612[_0x0980('0x3b')][_0x0980('0x72')])return[];return db[_0x0980('0x97')][_0x0980('0x3b')](_0x2e2b2e[_0x0980('0x98')](),_0xe35d15);})['then'](function(_0x2ad56b){_0xd561fe[_0x0980('0x23')]=_0x2ad56b[_0x0980('0x5f')];if(_0xd561fe[_0x0980('0x23')]===0x0)return[];return db[_0x0980('0x97')][_0x0980('0x3b')](_0x2cbae6[_0x0980('0x98')](),_0xe35d15)[_0x0980('0x2a')](function(_0x4aa279){_0x5b5d9b=_[_0x0980('0x99')](_0x4aa279,'id');_0xe35d15=_[_0x0980('0x9a')](_0xe35d15,{'model':db[_0x0980('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1a1612['query']['fields']){_0x233342['attributes']['forEach'](function(_0x5a8385){_0x64e952[_0x0980('0x45')]('i.'+_0x5a8385);});}else{_0x64e952[_0x0980('0x45')](_0x0980('0x8b'),_0x0980('0x8c'));_0x64e952[_0x0980('0x45')]('a.key',_0x0980('0x9b'));_0x64e952['field'](_0x0980('0x9c'),_0x0980('0x9d'));_0x64e952[_0x0980('0x45')](_0x0980('0x9e'),_0x0980('0x8d'));_0x64e952['field'](_0x0980('0x9f'));_0x64e952['field'](_0x0980('0xa0'),_0x0980('0xa1'));_0x64e952[_0x0980('0x45')](_0x0980('0xa2'),'Contact.lastName');_0x64e952['field'](_0x0980('0xa3'),_0x0980('0xa4'));_0x64e952[_0x0980('0x45')]('c.phone','Contact.phone');_0x64e952['field'](_0x0980('0xa5'),_0x0980('0xa6'));_0x64e952[_0x0980('0x45')](_0x0980('0xa7'),_0x0980('0xa8'));_0x64e952[_0x0980('0x45')]('o.fullname',_0x0980('0xa9'));_0x64e952[_0x0980('0x45')](_0x0980('0xaa'),'Owner.internal');_0x64e952[_0x0980('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0980('0x31'));}if(_0x233342[_0x0980('0x24')])_0x64e952[_0x0980('0x24')](_0x233342[_0x0980('0x24')]);if(_0x233342[_0x0980('0x21')])_0x64e952['offset'](_0x233342[_0x0980('0x21')]);return db[_0x0980('0x97')][_0x0980('0x3b')](_0x64e952[_0x0980('0x98')](),_0xe35d15);})[_0x0980('0x2a')](function(_0x3e4659){if(_0x3e4659['length']>0x0)_0x243bac[_0x0980('0x44')](_0x0980('0xab'),_[_0x0980('0x30')](_0x3e4659,'id'));return db[_0x0980('0x97')][_0x0980('0x3b')](_0x243bac[_0x0980('0x98')](),_0xe35d15)[_0x0980('0x2a')](function(_0x30f64b){var _0x55cb48=_[_0x0980('0xac')](_0x30f64b,_0x0980('0xad'));var _0x1c3579=[];_0x3e4659[_0x0980('0x34')](function(_0x356be6){_0x1c3579[_0x0980('0x35')](updateFaxInteraction(_0x356be6,_0x5b5d9b,_0x55cb48));});return BPromise[_0x0980('0xae')](_0x1c3579);});});})[_0x0980('0x2a')](function(_0x455746){_0xd561fe[_0x0980('0xaf')]=_0x455746;return _0xd561fe;})[_0x0980('0x2a')](respondWithFilteredResult(_0x3c434f,_0x233342))['catch'](handleError(_0x3c434f,null));};exports[_0x0980('0xb0')]=function(_0x56715f,_0x478b1b){var _0x4918fd={'raw':![],'where':{'id':_0x56715f[_0x0980('0xb1')]['id']}},_0x1f9b21={};_0x1f9b21[_0x0980('0x3e')]=_[_0x0980('0x70')](db[_0x0980('0x38')][_0x0980('0xb2')]);_0x1f9b21[_0x0980('0x3b')]=_['keys'](_0x56715f['query']);_0x1f9b21['filters']=_['intersection'](_0x1f9b21['model'],_0x1f9b21['query']);_0x4918fd[_0x0980('0x3f')]=_[_0x0980('0x3d')](_0x1f9b21[_0x0980('0x3e')],qs[_0x0980('0x40')](_0x56715f[_0x0980('0x3b')][_0x0980('0x40')]));_0x4918fd[_0x0980('0x3f')]=_0x4918fd[_0x0980('0x3f')]['length']?_0x4918fd[_0x0980('0x3f')]:_0x1f9b21[_0x0980('0x3e')];if(_0x56715f[_0x0980('0x3b')][_0x0980('0xb3')]){_0x4918fd[_0x0980('0xb4')]=[{'all':!![]}];}_0x4918fd=_['merge']({},_0x4918fd,_0x56715f[_0x0980('0xb5')]);return db['FaxInteraction'][_0x0980('0x60')](_0x4918fd)[_0x0980('0x2a')](handleEntityNotFound(_0x478b1b,null))['then'](respondWithResult(_0x478b1b,null))[_0x0980('0x36')](handleError(_0x478b1b,null));};exports[_0x0980('0xb6')]=function(_0x4134fa,_0x5a9430){return db[_0x0980('0x38')][_0x0980('0xb6')](_0x4134fa[_0x0980('0x6f')],{})[_0x0980('0x2a')](respondWithResult(_0x5a9430,0xc9))['catch'](handleError(_0x5a9430,null));};exports[_0x0980('0xb7')]=function(_0x53aaae,_0x4e86a4){if(_0x53aaae[_0x0980('0x6f')]['id']){delete _0x53aaae[_0x0980('0x6f')]['id'];}return db[_0x0980('0x38')][_0x0980('0x60')]({'where':{'id':_0x53aaae['params']['id']}})[_0x0980('0x2a')](handleEntityNotFound(_0x4e86a4,null))[_0x0980('0x2a')](saveUpdates(_0x53aaae['body'],null))[_0x0980('0x2a')](respondWithResult(_0x4e86a4,null))[_0x0980('0x36')](handleError(_0x4e86a4,null));};exports['destroy']=function(_0x1a1304,_0x509ed2){return db[_0x0980('0x38')]['find']({'where':{'id':_0x1a1304[_0x0980('0xb1')]['id']}})[_0x0980('0x2a')](handleEntityNotFound(_0x509ed2,null))[_0x0980('0x2a')](removeEntity(_0x509ed2,null))[_0x0980('0x36')](handleError(_0x509ed2,null));};exports[_0x0980('0xb8')]=function(_0x1dcd31,_0x5643c3){return db[_0x0980('0x38')]['describe']()[_0x0980('0x2a')](respondWithResult(_0x5643c3,null))[_0x0980('0x36')](handleError(_0x5643c3,null));};exports['addMessage']=function(_0x42e8a1,_0x176f60,_0x1c3afa){return db[_0x0980('0xb9')][_0x0980('0x60')]({'where':{'id':_0x42e8a1[_0x0980('0xb1')]['id']}})[_0x0980('0x2a')](handleEntityNotFound(_0x176f60,null))[_0x0980('0x2a')](function(_0x18fe95){if(_0x18fe95){return _0x18fe95[_0x0980('0xba')](_0x42e8a1['body']['ids'],_[_0x0980('0xbb')](_0x42e8a1[_0x0980('0x6f')],[_0x0980('0xbc'),'id'])||{});}})[_0x0980('0x2a')](respondWithResult(_0x176f60,null))['catch'](handleError(_0x176f60,null));};exports['getMessages']=function(_0x4a4b56,_0x158ad1,_0xa519df){var _0x523f4c={'raw':![],'where':{}};var _0x57e0af={};var _0x85710e={'count':0x0,'rows':[]};return db[_0x0980('0x38')][_0x0980('0xbd')]({'where':{'id':_0x4a4b56[_0x0980('0xb1')]['id']}})['then'](handleEntityNotFound(_0x158ad1,null))['then'](function(_0x144dfd){if(_0x144dfd){_0x57e0af[_0x0980('0x3e')]=_[_0x0980('0x70')](db[_0x0980('0xb9')][_0x0980('0xb2')]);_0x57e0af[_0x0980('0x3b')]=_[_0x0980('0x70')](_0x4a4b56['query']);_0x57e0af[_0x0980('0x3c')]=_[_0x0980('0x3d')](_0x57e0af[_0x0980('0x3e')],_0x57e0af[_0x0980('0x3b')]);_0x523f4c['attributes']=_[_0x0980('0x3d')](_0x57e0af[_0x0980('0x3e')],qs[_0x0980('0x40')](_0x4a4b56[_0x0980('0x3b')]['fields']));_0x523f4c[_0x0980('0x3f')]=_0x523f4c[_0x0980('0x3f')][_0x0980('0x5f')]?_0x523f4c[_0x0980('0x3f')]:_0x57e0af[_0x0980('0x3e')];if(!_0x4a4b56[_0x0980('0x3b')]['hasOwnProperty'](_0x0980('0x42'))){_0x523f4c['limit']=qs[_0x0980('0x24')](_0x4a4b56['query'][_0x0980('0x24')]);_0x523f4c[_0x0980('0x21')]=qs['offset'](_0x4a4b56['query'][_0x0980('0x21')]);}_0x523f4c[_0x0980('0x43')]=qs[_0x0980('0xbe')](_0x4a4b56[_0x0980('0x3b')][_0x0980('0xbe')]);_0x523f4c['where']=qs[_0x0980('0x3c')](_[_0x0980('0xbf')](_0x4a4b56[_0x0980('0x3b')],_0x57e0af[_0x0980('0x3c')]));_0x523f4c[_0x0980('0x44')][_0x0980('0xad')]=_0x144dfd['id'];if(_0x4a4b56[_0x0980('0x3b')]['filter']){_0x523f4c['where']=_['merge'](_0x523f4c[_0x0980('0x44')],{'$or':_[_0x0980('0x30')](_0x523f4c[_0x0980('0x3f')],function(_0x5219aa){var _0x4df6b1={};_0x4df6b1[_0x5219aa]={'$like':'%'+_0x4a4b56[_0x0980('0x3b')][_0x0980('0x80')]+'%'};return _0x4df6b1;})});}if(_0x4a4b56[_0x0980('0x3b')][_0x0980('0xc0')]){var _0x208955=_0x4a4b56[_0x0980('0x3b')]['$gte'][_0x0980('0x33')](',');var _0x229a43={};_0x229a43[_0x208955[0x0]]={'$gte':moment(_0x208955[0x1])[_0x0980('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x523f4c[_0x0980('0x44')]=_[_0x0980('0x9a')](_0x523f4c[_0x0980('0x44')],_0x229a43);}_0x523f4c=_['merge']({},_0x523f4c,_0x4a4b56[_0x0980('0xb5')]);return db[_0x0980('0xb9')][_0x0980('0x23')]({'where':_0x523f4c[_0x0980('0x44')]})[_0x0980('0x2a')](function(_0x58b1d9){_0x85710e[_0x0980('0x23')]=_0x58b1d9;if(_0x4a4b56[_0x0980('0x3b')][_0x0980('0xb3')]){_0x523f4c[_0x0980('0xb4')]=[{'all':!![]}];}return db[_0x0980('0xb9')][_0x0980('0xc2')](_0x523f4c);})[_0x0980('0x2a')](function(_0x524d86){_0x85710e[_0x0980('0xaf')]=_0x524d86;return _0x85710e;});}})[_0x0980('0x2a')](respondWithFilteredResult(_0x158ad1,_0x523f4c))[_0x0980('0x36')](handleError(_0x158ad1,null));};exports[_0x0980('0xc3')]=function(_0x5189f6,_0x339c04,_0x3078b7){return db[_0x0980('0x38')]['find']({'where':{'id':_0x5189f6[_0x0980('0xb1')]['id']}})[_0x0980('0x2a')](handleEntityNotFound(_0x339c04,null))[_0x0980('0x2a')](function(_0x18def3){if(_0x18def3){return _0x18def3[_0x0980('0xc4')](_0x5189f6['body'][_0x0980('0xbc')],_['omit'](_0x5189f6[_0x0980('0x6f')],[_0x0980('0xbc'),'id'])||{})[_0x0980('0xc5')](function(){return db['Tag']['findAll']({'attributes':['id',_0x0980('0x2e'),_0x0980('0xc6')],'where':{'id':_0x5189f6[_0x0980('0x6f')][_0x0980('0xbc')]}});})[_0x0980('0x2a')](function(_0x3d1cdc){socket[_0x0980('0xc7')](_0x0980('0xc8'),{'id':Number(_0x5189f6['params']['id']),'tags':_0x3d1cdc||[]});return{'id':Number(_0x5189f6[_0x0980('0xb1')]['id']),'tags':_0x3d1cdc||[]};});}})[_0x0980('0x2a')](respondWithResult(_0x339c04,null))[_0x0980('0x36')](handleError(_0x339c04,null));};exports[_0x0980('0xc9')]=function(_0x31b20b,_0x4a9dac,_0x8342ca){return db[_0x0980('0x38')][_0x0980('0x60')]({'where':{'id':_0x31b20b['params']['id']}})[_0x0980('0x2a')](handleEntityNotFound(_0x4a9dac,null))[_0x0980('0x2a')](function(_0x2d4f14){if(_0x2d4f14){return _0x2d4f14[_0x0980('0xc9')](_0x31b20b[_0x0980('0x3b')]['ids']);}})[_0x0980('0x2a')](respondWithStatusCode(_0x4a9dac,null))[_0x0980('0x36')](handleError(_0x4a9dac,null));};exports['download']=function(_0xedc00d,_0x330844){var _0x19f6f3=moment()[_0x0980('0xca')]()[_0x0980('0x98')]();var _0xbeefcd=path[_0x0980('0xcb')](config['root'],_0x0980('0xcc'),'files','tmp');var _0x5df483=path[_0x0980('0xcb')](config[_0x0980('0xcd')],_0x0980('0xcc'),'files',_0x0980('0xce'));var _0x431b37=path[_0x0980('0xcb')](_0xbeefcd,_0x19f6f3);var _0x184a99=util[_0x0980('0xc1')](_0x0980('0xcf'),_0xedc00d[_0x0980('0xb1')]['id'],_0x19f6f3);var _0x49b7a7=path[_0x0980('0xcb')](_0xbeefcd,_0x184a99);var _0xb9569f=[];_0xb9569f[_0x0980('0x35')]({'model':db['Attachment'],'as':_0x0980('0xd0'),'raw':!![]});var _0x7abfa1=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x0980('0x6f'),_0x0980('0xd1')],'include':_0xb9569f}];return db[_0x0980('0x38')]['find']({'where':{'id':_0xedc00d[_0x0980('0xb1')]['id']},'include':_0x7abfa1})[_0x0980('0x2a')](handleEntityNotFound(_0x330844,null))[_0x0980('0x2a')](function(_0x2aeafe){if(_0x2aeafe&&_0x2aeafe[_0x0980('0xd2')]){var _0x1b96af=_0x2aeafe['get']({'plain':!![]});fs[_0x0980('0xd3')](_0x431b37);for(var _0x2845fd=0x0;_0x2845fd<_0x1b96af[_0x0980('0xd2')][_0x0980('0x5f')];_0x2845fd++){var _0xb91583=_0x1b96af[_0x0980('0xd2')][_0x2845fd][_0x0980('0xd0')];if(_0xb91583){var _0x202e61=path[_0x0980('0xcb')](_0x5df483,_0xb91583[_0x0980('0xd4')]);if(fs[_0x0980('0xd5')](_0x202e61)){fs[_0x0980('0xd6')](_0x202e61)[_0x0980('0xd7')](fs['createWriteStream'](path[_0x0980('0xcb')](_0x431b37,_0xb91583[_0x0980('0xd4')])));}}}return BPromise[_0x0980('0xd8')]()['then'](function(){return new BPromise(function(_0x500e34,_0x322f8d){zipdir(_0x431b37,{'saveTo':_0x49b7a7},function(_0x4e6fe0,_0x29b794){if(_0x4e6fe0)return _0x322f8d(_0x4e6fe0);return _0x500e34(_0x29b794);});})[_0x0980('0x2a')](function(){return new BPromise(function(_0x6860fd,_0x352ce1){rimraf(_0x431b37,function(_0xc9f8de){if(_0xc9f8de)_0x352ce1(_0xc9f8de);return _0x6860fd();});});})[_0x0980('0x2a')](function(){return _0x330844[_0x0980('0xd9')](_0x49b7a7,_0x184a99,function(_0x6a98c3){if(_0x6a98c3){console[_0x0980('0xda')](_0x0980('0xdb'),_0x6a98c3);}else{fs[_0x0980('0xdc')](_0x49b7a7);}});});});}else{return _0x330844[_0x0980('0x2c')](0xc8);}})[_0x0980('0x36')](handleError(_0x330844,null));}; \ No newline at end of file +var _0x36cb=['QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','params','includeAll','create','describe','addMessage','FaxMessage','ids','hasOwnProperty','nolimit','pick','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','addTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','server','tmp','root','attachments','transcript-%d-%s.zip','Attachment','createdAt','get','mkdirSync','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','sort','where','select','field','color','tools_tags','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\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)','ContactId','text','Tag','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','body','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x36cb,0x123));var _0xb36c=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x36cb[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0xb36c('0x0'));var rimraf=require(_0xb36c('0x1'));var zipdir=require(_0xb36c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb36c('0x3'));var moment=require(_0xb36c('0x4'));var BPromise=require(_0xb36c('0x5'));var Mustache=require(_0xb36c('0x6'));var util=require(_0xb36c('0x7'));var path=require(_0xb36c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb36c('0x9'));var _=require('lodash');var squel=require(_0xb36c('0xa'));var crypto=require(_0xb36c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb36c('0xc'));var querystring=require(_0xb36c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb36c('0xe'));var qs=require(_0xb36c('0xf'));var as=require(_0xb36c('0x10'));var hardwareService=require(_0xb36c('0x11'));var logger=require(_0xb36c('0x12'))(_0xb36c('0x13'));var utils=require(_0xb36c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb36c('0x15'));var db=require(_0xb36c('0x16'))['db'];config[_0xb36c('0x17')]=_[_0xb36c('0x18')](config[_0xb36c('0x17')],{'host':_0xb36c('0x19'),'port':0x18eb});var socket=require(_0xb36c('0x1a'))(new Redis(config[_0xb36c('0x17')]));require(_0xb36c('0x1b'))[_0xb36c('0x1c')](socket);function respondWithStatusCode(_0x5747ba,_0x562e29){_0x562e29=_0x562e29||0xcc;return function(_0x4078de){if(_0x4078de){return _0x5747ba[_0xb36c('0x1d')](_0x562e29);}return _0x5747ba[_0xb36c('0x1e')](_0x562e29)[_0xb36c('0x1f')]();};}function respondWithResult(_0x466c8f,_0x3b8359){_0x3b8359=_0x3b8359||0xc8;return function(_0x5361d2){if(_0x5361d2){return _0x466c8f[_0xb36c('0x1e')](_0x3b8359)[_0xb36c('0x20')](_0x5361d2);}};}function respondWithFilteredResult(_0x556cbc,_0x119d28){return function(_0x43c677){if(_0x43c677){var _0x407105=typeof _0x119d28[_0xb36c('0x21')]==='undefined'&&typeof _0x119d28['limit']===_0xb36c('0x22');var _0x5502dc=_0x43c677[_0xb36c('0x23')];var _0x1a5eae=_0x407105?0x0:_0x119d28[_0xb36c('0x21')];var _0xcecdcf=_0x407105?_0x43c677['count']:_0x119d28[_0xb36c('0x21')]+_0x119d28[_0xb36c('0x24')];var _0x382eab;if(_0xcecdcf>=_0x5502dc){_0xcecdcf=_0x5502dc;_0x382eab=0xc8;}else{_0x382eab=0xce;}_0x556cbc[_0xb36c('0x1e')](_0x382eab);return _0x556cbc[_0xb36c('0x25')]('Content-Range',_0x1a5eae+'-'+_0xcecdcf+'/'+_0x5502dc)['json'](_0x43c677);}return null;};}function patchUpdates(_0x245750){return function(_0x55d1a3){try{jsonpatch[_0xb36c('0x26')](_0x55d1a3,_0x245750,!![]);}catch(_0x615b6f){return BPromise[_0xb36c('0x27')](_0x615b6f);}return _0x55d1a3[_0xb36c('0x28')]();};}function saveUpdates(_0x1b0c3c,_0x1cb93b){return function(_0x3f16ce){if(_0x3f16ce){return _0x3f16ce[_0xb36c('0x29')](_0x1b0c3c)[_0xb36c('0x2a')](function(_0x2835c2){return _0x2835c2;});}return null;};}function removeEntity(_0x22878f,_0xe0b068){return function(_0x3d88ac){if(_0x3d88ac){return _0x3d88ac['destroy']()[_0xb36c('0x2a')](function(){_0x22878f[_0xb36c('0x1e')](0xcc)[_0xb36c('0x1f')]();});}};}function handleEntityNotFound(_0x543af8,_0x1c1f95){return function(_0x25d17c){if(!_0x25d17c){_0x543af8[_0xb36c('0x1d')](0x194);}return _0x25d17c;};}function handleError(_0x15f7ed,_0x4c0008){_0x4c0008=_0x4c0008||0x1f4;return function(_0x2030c9){logger[_0xb36c('0x2b')](_0x2030c9[_0xb36c('0x2c')]);if(_0x2030c9[_0xb36c('0x2d')]){delete _0x2030c9[_0xb36c('0x2d')];}_0x15f7ed[_0xb36c('0x1e')](_0x4c0008)[_0xb36c('0x2e')](_0x2030c9);};}function getInteractionUsers(_0x467a56,_0x54c4f1){return new BPromise(function(_0x1caa41,_0x138e87){try{if(_0x54c4f1[_0x467a56['id']]){_0x467a56[_0xb36c('0x2f')]=_[_0xb36c('0x30')](_0x54c4f1[_0x467a56['id']],function(_0xa4db8c){return{'id':_0xa4db8c['id'],'fullname':_0xa4db8c[_0xb36c('0x31')]};});}}catch(_0x168aad){_0x138e87(_0x168aad);}_0x1caa41(_0x467a56);});}function getInteractionTags(_0x39de54,_0x1a9d45){return new BPromise(function(_0x901e1,_0x61068f){try{if(_0x39de54[_0xb36c('0x32')]){_0x39de54[_0xb36c('0x33')]=[];_0x39de54[_0xb36c('0x32')][_0xb36c('0x34')](',')[_0xb36c('0x35')](function(_0x5ed27a){_0x39de54[_0xb36c('0x33')][_0xb36c('0x36')](_0x1a9d45[_0x5ed27a]);});}delete _0x39de54[_0xb36c('0x32')];}catch(_0x53a53c){_0x61068f(_0x53a53c);}_0x901e1(_0x39de54);});}function updateFaxInteraction(_0x1105e9,_0x280dcd,_0x46c228){return new BPromise(function(_0x127ebc,_0x2db58c){return getInteractionUsers(_0x1105e9,_0x46c228)['then'](function(_0x283671){return getInteractionTags(_0x283671,_0x280dcd);})[_0xb36c('0x2a')](function(_0x1bb175){_0x127ebc(_0x1bb175);})[_0xb36c('0x37')](function(_0x4872ce){_0x2db58c(_0x4872ce);});});}exports[_0xb36c('0x38')]=function(_0x5810ef,_0x21c4c8){var _0x50b971={},_0x546a00={},_0x284541={'count':0x0,'rows':[]};var _0x5aaa89=_[_0xb36c('0x30')](db[_0xb36c('0x39')][_0xb36c('0x3a')],function(_0x448e04){return{'name':_0x448e04[_0xb36c('0x3b')],'type':_0x448e04[_0xb36c('0x3c')][_0xb36c('0x3d')]};});_0x546a00[_0xb36c('0x3e')]=_[_0xb36c('0x30')](_0x5aaa89,_0xb36c('0x2d'));_0x546a00['query']=_[_0xb36c('0x3f')](_0x5810ef[_0xb36c('0x40')]);_0x546a00[_0xb36c('0x41')]=_[_0xb36c('0x42')](_0x546a00['model'],_0x546a00['query']);_0x50b971['attributes']=_[_0xb36c('0x42')](_0x546a00[_0xb36c('0x3e')],qs[_0xb36c('0x43')](_0x5810ef[_0xb36c('0x40')]['fields']));_0x50b971['attributes']=_0x50b971[_0xb36c('0x44')]['length']?_0x50b971[_0xb36c('0x44')]:_0x546a00['model'];if(!_0x5810ef[_0xb36c('0x40')]['hasOwnProperty']('nolimit')){_0x50b971['limit']=qs[_0xb36c('0x24')](_0x5810ef['query']['limit']);_0x50b971[_0xb36c('0x21')]=qs[_0xb36c('0x21')](_0x5810ef['query'][_0xb36c('0x21')]);}_0x50b971['order']=qs['sort'](_0x5810ef[_0xb36c('0x40')][_0xb36c('0x45')]);_0x50b971[_0xb36c('0x46')]=qs[_0xb36c('0x41')](_['pick'](_0x5810ef[_0xb36c('0x40')],_0x546a00[_0xb36c('0x41')]),_0x5aaa89);var _0x526dc1=[];var _0x280066=squel[_0xb36c('0x47')]()[_0xb36c('0x48')]('id')[_0xb36c('0x48')](_0xb36c('0x2d'))[_0xb36c('0x48')](_0xb36c('0x49'))['from'](_0xb36c('0x4a'));var _0x1c859b=squel[_0xb36c('0x47')]()[_0xb36c('0x48')]('u.id')[_0xb36c('0x48')](_0xb36c('0x4b'))['field'](_0xb36c('0x4c'))['from'](_0xb36c('0x4d'),'ui')[_0xb36c('0x4e')](_0xb36c('0x4f'),'u',_0xb36c('0x50'));var _0x5de9cc=squel[_0xb36c('0x47')]()[_0xb36c('0x51')](_0xb36c('0x52'),'i')[_0xb36c('0x4e')]('cm_contacts','c',_0xb36c('0x53'))[_0xb36c('0x4e')](_0xb36c('0x4f'),'o',_0xb36c('0x54'))[_0xb36c('0x4e')]('fax_accounts','a',_0xb36c('0x55'))[_0xb36c('0x4e')](_0xb36c('0x56'),'me',_0xb36c('0x57'))[_0xb36c('0x4e')](_0xb36c('0x58'),'it',_0xb36c('0x59'))[_0xb36c('0x4e')]('tools_tags','t',_0xb36c('0x5a'));var _0x229969=squel[_0xb36c('0x5b')]();var _0x509076=[];var _0x1f3fe6=squel[_0xb36c('0x5b')]();var _0x5b6997;if(_0x5810ef[_0xb36c('0x40')][_0xb36c('0x5c')]){_0x5b6997=as[_0xb36c('0x5d')](_0x5810ef[_0xb36c('0x40')]['search']);var _0x15d1b9=_0x5b6997[_0xb36c('0x5e')];for(var _0xd519b2=0x0;_0xd519b2<_0x5b6997[_0xb36c('0x5f')][_0xb36c('0x60')];_0xd519b2++){var _0x58229b=_0x5b6997[_0xb36c('0x5f')][_0xd519b2];var _0x2f9fac='i';var _0x31df7b=_[_0xb36c('0x61')](_0x5aaa89,[_0xb36c('0x2d'),_0x58229b[_0xb36c('0x48')]]);if(!_0x31df7b){switch(_0x58229b[_0xb36c('0x48')]){case _0xb36c('0x62'):if(_0x58229b[_0xb36c('0x63')]==0x1){_0x5de9cc[_0xb36c('0x64')]('`'+_0x58229b[_0xb36c('0x48')]+_0xb36c('0x65'));}else{_0x5de9cc[_0xb36c('0x64')]('`'+_0x58229b[_0xb36c('0x48')]+_0xb36c('0x66'));}break;case _0xb36c('0x67'):if(_0x58229b['operator']===_0xb36c('0x68')){if(_0x58229b[_0xb36c('0x63')]['split']('\x20')[_0xb36c('0x60')]>0x1){_0x229969[_0x15d1b9](_0xb36c('0x69'),qs['getFullTextValue'](_0x58229b['value']),null);}else{var _0x443b65='%'+_0x58229b[_0xb36c('0x63')]+'%';_0x229969[_0x15d1b9]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x443b65,_0x443b65,_0x443b65);}}else{_0x31df7b=_[_0xb36c('0x61')](_0x5aaa89,[_0xb36c('0x2d'),_0xb36c('0x6a')]);_0x58229b['field']=_0xb36c('0x6a');_0x5263eb=as['buildExpression'](_0x2f9fac,_0x31df7b[_0xb36c('0x3c')],_0x58229b);_0x229969[_0x15d1b9](_0x5263eb[_0xb36c('0x6b')],_0x5263eb[_0xb36c('0x63')]['start'],_0x5263eb[_0xb36c('0x63')]['end']);}break;case _0xb36c('0x6c'):var _0x38b016=_0x58229b[_0xb36c('0x63')][_0xb36c('0x34')](',')['map'](function(_0x4408de){return Number(_0x4408de);});_0x38b016[_0xb36c('0x35')](function(_0x4c20ee){_0x1f3fe6['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4c20ee+',%');});_0x509076=_[_0xb36c('0x6d')](_0x509076,_0x38b016);break;case'User':if(_0x58229b[_0xb36c('0x6e')]===_0xb36c('0x68')){_0x229969[_0x15d1b9](_0xb36c('0x6f'),'%'+_0x58229b['value']+'%',null);}else{_0x31df7b=_[_0xb36c('0x61')](_0x5aaa89,[_0xb36c('0x2d'),_0xb36c('0x70')]);_0x58229b[_0xb36c('0x48')]=_0xb36c('0x70');_0x5263eb=as[_0xb36c('0x71')](_0x2f9fac,_0x31df7b[_0xb36c('0x3c')],_0x58229b);_0x229969[_0x15d1b9](_0x5263eb[_0xb36c('0x6b')],_0x5263eb[_0xb36c('0x63')][_0xb36c('0x72')],_0x5263eb[_0xb36c('0x63')][_0xb36c('0x1f')]);}break;case _0xb36c('0x73'):_0x5263eb=as[_0xb36c('0x71')]('me',null,_0x58229b);_0x229969[_0x15d1b9](_0x5263eb[_0xb36c('0x6b')],_0x5263eb['value'][_0xb36c('0x72')],_0x5263eb[_0xb36c('0x63')]['end']);break;}}else{var _0x5263eb=as[_0xb36c('0x71')](_0x2f9fac,_0x31df7b['type'],_0x58229b);_0x229969[_0x15d1b9](_0x5263eb[_0xb36c('0x6b')],_0x5263eb['value']['start'],_0x5263eb[_0xb36c('0x63')]['end']);}}}else{var _0x1b0426=_(_0x5810ef['query'])[_0xb36c('0x3f')]()['map'](function(_0x2780f5){return _[_0xb36c('0x74')](_0x5aaa89,['name',_0x2780f5])?_0x2780f5:undefined;})['compact']()[_0xb36c('0x63')]();if(!_[_0xb36c('0x75')](_0x1b0426)){_0x1b0426[_0xb36c('0x35')](function(_0x9ff60f){if(_0x9ff60f===_0xb36c('0x76')){_0x5de9cc[_0xb36c('0x46')](_0xb36c('0x77'),[]['concat'](_0x5810ef[_0xb36c('0x40')][_0x9ff60f]));}else if(_0x9ff60f==='createdAt'){var _0x350807=JSON[_0xb36c('0x78')](_0x5810ef[_0xb36c('0x40')][_0x9ff60f])[_0xb36c('0x79')];var _0x541e2f=JSON[_0xb36c('0x78')](_0x5810ef[_0xb36c('0x40')][_0x9ff60f])['$lte'];_0x5de9cc[_0xb36c('0x46')](_0xb36c('0x7a'),_0x350807,_0x541e2f);}else{if(_0x5810ef[_0xb36c('0x40')][_0x9ff60f]===_0xb36c('0x7b')){_0x5de9cc[_0xb36c('0x46')]('i.'+_0x9ff60f+_0xb36c('0x7c'));}else{_0x5de9cc[_0xb36c('0x46')]('i.'+_0x9ff60f+_0xb36c('0x7d'),_0x5810ef[_0xb36c('0x40')][_0x9ff60f]);}}});}if(_0x5810ef[_0xb36c('0x40')][_0xb36c('0x7e')]){if(_0x5810ef[_0xb36c('0x40')]['read']==0x1){_0x5de9cc[_0xb36c('0x64')]('`unreadMessages`\x20=\x200');}else{_0x5de9cc['having']('`unreadMessages`\x20>\x200');}}if(_0x5810ef[_0xb36c('0x40')][_0xb36c('0x7f')]){_0x509076=_[_0xb36c('0x80')](_0x5810ef[_0xb36c('0x40')][_0xb36c('0x7f')])?_0x5810ef[_0xb36c('0x40')][_0xb36c('0x7f')]:new Array(_0x5810ef[_0xb36c('0x40')][_0xb36c('0x7f')]);_0x509076[_0xb36c('0x35')](function(_0x1365aa){_0x1f3fe6['or'](_0xb36c('0x81'),'%,'+_0x1365aa+',%');});}if(_0x5810ef['query'][_0xb36c('0x82')]){var _0x552494=_0x5810ef[_0xb36c('0x40')]['filter']['replace']('\x5c','\x5c\x5c')[_0xb36c('0x83')](/'/g,'\x27\x27');if(qs[_0xb36c('0x84')](_0x552494)){_0x229969['or']('i.id\x20LIKE\x20?',_0x552494+'%')['or'](_0xb36c('0x85'),_0x552494+'%');}_0x229969['or'](_0xb36c('0x86'),_0x552494+'%');}}_0x5de9cc[_0xb36c('0x46')](_0x229969);_0x5de9cc[_0xb36c('0x87')]('i.id');var _0x5db430={'type':db[_0xb36c('0x88')][_0xb36c('0x89')][_0xb36c('0x8a')],'raw':!![]};var _0x44ab38=_0x5de9cc[_0xb36c('0x8b')]();_0x44ab38[_0xb36c('0x48')]('i.id');_0x44ab38['field'](_0xb36c('0x8c'),_0xb36c('0x62'));if(_0x50b971['order']){_0x50b971[_0xb36c('0x8d')][_0xb36c('0x35')](function(_0x45161b){var _0x140bce=_0x45161b[0x0]==='contactName'?_0x45161b[0x0]:'i.'+_0x45161b[0x0];_0x5de9cc[_0xb36c('0x8d')](_0x140bce,_0x45161b[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb36c('0x75')](_0x509076)){_0x5de9cc[_0xb36c('0x64')](_0x1f3fe6);_0x44ab38['where']('t.id\x20IN\x20?',_0x509076);}BPromise[_0xb36c('0x8e')]()[_0xb36c('0x2a')](function(){if(!_0x5b6997){if(_0x5810ef['query']['FaxAccountId'])return;_0x44ab38[_0xb36c('0x46')](_0xb36c('0x8f'));_0x5de9cc['where'](_0xb36c('0x8f'));return;}if(_0x5810ef['user'][_0xb36c('0x90')]!==_0xb36c('0x91'))return;return _0x5810ef[_0xb36c('0x92')][_0xb36c('0x93')]({'attributes':['id'],'raw':!![]})[_0xb36c('0x2a')](function(_0x5818a3){if(_[_0xb36c('0x75')](_0x5818a3)){_0x44ab38[_0xb36c('0x46')](_0xb36c('0x94'));_0x5de9cc[_0xb36c('0x46')](_0xb36c('0x94'));}else{_0x44ab38[_0xb36c('0x46')](_0xb36c('0x77'),_['map'](_0x5818a3,'id'));_0x5de9cc[_0xb36c('0x46')](_0xb36c('0x77'),_[_0xb36c('0x30')](_0x5818a3,'id'));}});})[_0xb36c('0x2a')](function(){if(_0x5810ef[_0xb36c('0x92')][_0xb36c('0x90')]===_0xb36c('0x91')&&!_0x5b6997&&!_0x5810ef['query']['FaxAccountId'])return[];return db[_0xb36c('0x95')][_0xb36c('0x40')](_0x44ab38[_0xb36c('0x96')](),_0x5db430);})[_0xb36c('0x2a')](function(_0x5b8ba0){_0x284541['count']=_0x5b8ba0['length'];if(_0x284541[_0xb36c('0x23')]===0x0)return[];return db[_0xb36c('0x95')]['query'](_0x280066['toString'](),_0x5db430)[_0xb36c('0x2a')](function(_0x35d5b8){_0x526dc1=_[_0xb36c('0x97')](_0x35d5b8,'id');_0x5db430=_[_0xb36c('0x98')](_0x5db430,{'model':db[_0xb36c('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5810ef['query'][_0xb36c('0x43')]){_0x50b971[_0xb36c('0x44')]['forEach'](function(_0x1226a7){_0x5de9cc['field']('i.'+_0x1226a7);});}else{_0x5de9cc[_0xb36c('0x48')](_0xb36c('0x8c'),_0xb36c('0x62'));_0x5de9cc['field']('a.key',_0xb36c('0x99'));_0x5de9cc[_0xb36c('0x48')](_0xb36c('0x9a'),'Account.mandatoryDisposition');_0x5de9cc[_0xb36c('0x48')](_0xb36c('0x9b'),_0xb36c('0x9c'));_0x5de9cc[_0xb36c('0x48')](_0xb36c('0x9d'));_0x5de9cc['field'](_0xb36c('0x9e'),'Contact.firstName');_0x5de9cc[_0xb36c('0x48')](_0xb36c('0x9f'),_0xb36c('0xa0'));_0x5de9cc['field'](_0xb36c('0xa1'),_0xb36c('0xa2'));_0x5de9cc['field']('c.phone','Contact.phone');_0x5de9cc['field']('c.mobile',_0xb36c('0xa3'));_0x5de9cc['field'](_0xb36c('0xa4'),_0xb36c('0xa5'));_0x5de9cc[_0xb36c('0x48')](_0xb36c('0xa6'),'Owner.fullname');_0x5de9cc[_0xb36c('0x48')]('o.internal',_0xb36c('0xa7'));_0x5de9cc[_0xb36c('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xb36c('0x32'));}if(_0x50b971[_0xb36c('0x24')])_0x5de9cc[_0xb36c('0x24')](_0x50b971[_0xb36c('0x24')]);if(_0x50b971[_0xb36c('0x21')])_0x5de9cc[_0xb36c('0x21')](_0x50b971[_0xb36c('0x21')]);return db['sequelize'][_0xb36c('0x40')](_0x5de9cc[_0xb36c('0x96')](),_0x5db430);})[_0xb36c('0x2a')](function(_0x411901){if(_0x411901['length']>0x0)_0x1c859b[_0xb36c('0x46')](_0xb36c('0xa8'),_[_0xb36c('0x30')](_0x411901,'id'));return db[_0xb36c('0x95')][_0xb36c('0x40')](_0x1c859b['toString'](),_0x5db430)[_0xb36c('0x2a')](function(_0x44bda3){var _0x32ef7e=_[_0xb36c('0xa9')](_0x44bda3,_0xb36c('0xaa'));var _0x812fec=[];_0x411901[_0xb36c('0x35')](function(_0x27984d){_0x812fec[_0xb36c('0x36')](updateFaxInteraction(_0x27984d,_0x526dc1,_0x32ef7e));});return BPromise[_0xb36c('0xab')](_0x812fec);});});})[_0xb36c('0x2a')](function(_0x542a3e){_0x284541['rows']=_0x542a3e;return _0x284541;})[_0xb36c('0x2a')](respondWithFilteredResult(_0x21c4c8,_0x50b971))['catch'](handleError(_0x21c4c8,null));};exports['show']=function(_0x55492b,_0x3072e5){var _0x3d2eb1={'raw':![],'where':{'id':_0x55492b[_0xb36c('0xac')]['id']}},_0x385a46={};_0x385a46[_0xb36c('0x3e')]=_[_0xb36c('0x3f')](db[_0xb36c('0x39')]['rawAttributes']);_0x385a46[_0xb36c('0x40')]=_['keys'](_0x55492b[_0xb36c('0x40')]);_0x385a46[_0xb36c('0x41')]=_[_0xb36c('0x42')](_0x385a46['model'],_0x385a46['query']);_0x3d2eb1['attributes']=_[_0xb36c('0x42')](_0x385a46[_0xb36c('0x3e')],qs['fields'](_0x55492b[_0xb36c('0x40')][_0xb36c('0x43')]));_0x3d2eb1[_0xb36c('0x44')]=_0x3d2eb1[_0xb36c('0x44')][_0xb36c('0x60')]?_0x3d2eb1['attributes']:_0x385a46[_0xb36c('0x3e')];if(_0x55492b[_0xb36c('0x40')][_0xb36c('0xad')]){_0x3d2eb1['include']=[{'all':!![]}];}_0x3d2eb1=_[_0xb36c('0x98')]({},_0x3d2eb1,_0x55492b['options']);return db[_0xb36c('0x39')][_0xb36c('0x61')](_0x3d2eb1)[_0xb36c('0x2a')](handleEntityNotFound(_0x3072e5,null))[_0xb36c('0x2a')](respondWithResult(_0x3072e5,null))[_0xb36c('0x37')](handleError(_0x3072e5,null));};exports[_0xb36c('0xae')]=function(_0xdbf7a1,_0x4567f8){return db[_0xb36c('0x39')][_0xb36c('0xae')](_0xdbf7a1['body'],{})[_0xb36c('0x2a')](respondWithResult(_0x4567f8,0xc9))[_0xb36c('0x37')](handleError(_0x4567f8,null));};exports[_0xb36c('0x29')]=function(_0x246a8e,_0x58325b){if(_0x246a8e[_0xb36c('0x73')]['id']){delete _0x246a8e[_0xb36c('0x73')]['id'];}return db[_0xb36c('0x39')][_0xb36c('0x61')]({'where':{'id':_0x246a8e[_0xb36c('0xac')]['id']}})[_0xb36c('0x2a')](handleEntityNotFound(_0x58325b,null))[_0xb36c('0x2a')](saveUpdates(_0x246a8e[_0xb36c('0x73')],null))[_0xb36c('0x2a')](respondWithResult(_0x58325b,null))['catch'](handleError(_0x58325b,null));};exports['destroy']=function(_0x4825bb,_0x1bb200){return db[_0xb36c('0x39')][_0xb36c('0x61')]({'where':{'id':_0x4825bb[_0xb36c('0xac')]['id']}})[_0xb36c('0x2a')](handleEntityNotFound(_0x1bb200,null))[_0xb36c('0x2a')](removeEntity(_0x1bb200,null))[_0xb36c('0x37')](handleError(_0x1bb200,null));};exports['describe']=function(_0x3c2cb4,_0x5248ab){return db[_0xb36c('0x39')][_0xb36c('0xaf')]()[_0xb36c('0x2a')](respondWithResult(_0x5248ab,null))['catch'](handleError(_0x5248ab,null));};exports[_0xb36c('0xb0')]=function(_0x24ed1e,_0x4d04d3,_0x13f689){return db[_0xb36c('0xb1')][_0xb36c('0x61')]({'where':{'id':_0x24ed1e[_0xb36c('0xac')]['id']}})[_0xb36c('0x2a')](handleEntityNotFound(_0x4d04d3,null))['then'](function(_0x388072){if(_0x388072){return _0x388072[_0xb36c('0xb0')](_0x24ed1e[_0xb36c('0x73')][_0xb36c('0xb2')],_['omit'](_0x24ed1e[_0xb36c('0x73')],['ids','id'])||{});}})[_0xb36c('0x2a')](respondWithResult(_0x4d04d3,null))[_0xb36c('0x37')](handleError(_0x4d04d3,null));};exports['getMessages']=function(_0x574a85,_0x744fd5,_0x3fe889){var _0x5016fd={'raw':![],'where':{}};var _0x392f05={};var _0x594c34={'count':0x0,'rows':[]};return db[_0xb36c('0x39')]['findOne']({'where':{'id':_0x574a85['params']['id']}})[_0xb36c('0x2a')](handleEntityNotFound(_0x744fd5,null))[_0xb36c('0x2a')](function(_0x271805){if(_0x271805){_0x392f05[_0xb36c('0x3e')]=_[_0xb36c('0x3f')](db[_0xb36c('0xb1')][_0xb36c('0x3a')]);_0x392f05[_0xb36c('0x40')]=_[_0xb36c('0x3f')](_0x574a85[_0xb36c('0x40')]);_0x392f05[_0xb36c('0x41')]=_['intersection'](_0x392f05['model'],_0x392f05[_0xb36c('0x40')]);_0x5016fd[_0xb36c('0x44')]=_[_0xb36c('0x42')](_0x392f05[_0xb36c('0x3e')],qs['fields'](_0x574a85[_0xb36c('0x40')][_0xb36c('0x43')]));_0x5016fd[_0xb36c('0x44')]=_0x5016fd[_0xb36c('0x44')]['length']?_0x5016fd[_0xb36c('0x44')]:_0x392f05['model'];if(!_0x574a85[_0xb36c('0x40')][_0xb36c('0xb3')](_0xb36c('0xb4'))){_0x5016fd[_0xb36c('0x24')]=qs['limit'](_0x574a85[_0xb36c('0x40')]['limit']);_0x5016fd[_0xb36c('0x21')]=qs[_0xb36c('0x21')](_0x574a85[_0xb36c('0x40')][_0xb36c('0x21')]);}_0x5016fd[_0xb36c('0x8d')]=qs[_0xb36c('0x45')](_0x574a85[_0xb36c('0x40')][_0xb36c('0x45')]);_0x5016fd[_0xb36c('0x46')]=qs[_0xb36c('0x41')](_[_0xb36c('0xb5')](_0x574a85[_0xb36c('0x40')],_0x392f05[_0xb36c('0x41')]));_0x5016fd[_0xb36c('0x46')][_0xb36c('0xaa')]=_0x271805['id'];if(_0x574a85['query']['filter']){_0x5016fd[_0xb36c('0x46')]=_[_0xb36c('0x98')](_0x5016fd[_0xb36c('0x46')],{'$or':_[_0xb36c('0x30')](_0x5016fd[_0xb36c('0x44')],function(_0x60c1f8){var _0x5dbbc0={};_0x5dbbc0[_0x60c1f8]={'$like':'%'+_0x574a85[_0xb36c('0x40')][_0xb36c('0x82')]+'%'};return _0x5dbbc0;})});}if(_0x574a85[_0xb36c('0x40')][_0xb36c('0x79')]){var _0x32f23a=_0x574a85[_0xb36c('0x40')][_0xb36c('0x79')][_0xb36c('0x34')](',');var _0x1d7a95={};_0x1d7a95[_0x32f23a[0x0]]={'$gte':moment(_0x32f23a[0x1])[_0xb36c('0xb6')](_0xb36c('0xb7'))};_0x5016fd[_0xb36c('0x46')]=_[_0xb36c('0x98')](_0x5016fd['where'],_0x1d7a95);}_0x5016fd=_['merge']({},_0x5016fd,_0x574a85['options']);return db[_0xb36c('0xb1')][_0xb36c('0x23')]({'where':_0x5016fd['where']})[_0xb36c('0x2a')](function(_0x33cbd8){_0x594c34[_0xb36c('0x23')]=_0x33cbd8;if(_0x574a85[_0xb36c('0x40')][_0xb36c('0xad')]){_0x5016fd[_0xb36c('0xb8')]=[{'all':!![]}];}return db[_0xb36c('0xb1')][_0xb36c('0xb9')](_0x5016fd);})[_0xb36c('0x2a')](function(_0x2cad66){_0x594c34[_0xb36c('0xba')]=_0x2cad66;return _0x594c34;});}})[_0xb36c('0x2a')](respondWithFilteredResult(_0x744fd5,_0x5016fd))[_0xb36c('0x37')](handleError(_0x744fd5,null));};exports[_0xb36c('0xbb')]=function(_0x5f1b1d,_0x422ee6,_0x2b8cca){return db[_0xb36c('0x39')]['find']({'where':{'id':_0x5f1b1d['params']['id']}})[_0xb36c('0x2a')](handleEntityNotFound(_0x422ee6,null))[_0xb36c('0x2a')](function(_0x12e60c){if(_0x12e60c){return _0x12e60c['setTags'](_0x5f1b1d[_0xb36c('0x73')][_0xb36c('0xb2')],_[_0xb36c('0xbc')](_0x5f1b1d['body'],[_0xb36c('0xb2'),'id'])||{})[_0xb36c('0xbd')](function(){return db[_0xb36c('0x6c')][_0xb36c('0xb9')]({'attributes':['id',_0xb36c('0x2d'),_0xb36c('0x49')],'where':{'id':_0x5f1b1d[_0xb36c('0x73')][_0xb36c('0xb2')]}});})[_0xb36c('0x2a')](function(_0x3314e2){socket[_0xb36c('0xbe')](_0xb36c('0xbf'),{'id':Number(_0x5f1b1d[_0xb36c('0xac')]['id']),'tags':_0x3314e2||[]});return{'id':Number(_0x5f1b1d['params']['id']),'tags':_0x3314e2||[]};});}})[_0xb36c('0x2a')](respondWithResult(_0x422ee6,null))['catch'](handleError(_0x422ee6,null));};exports['removeTags']=function(_0x4d3ac8,_0x45cbb9,_0x28823f){return db[_0xb36c('0x39')][_0xb36c('0x61')]({'where':{'id':_0x4d3ac8[_0xb36c('0xac')]['id']}})[_0xb36c('0x2a')](handleEntityNotFound(_0x45cbb9,null))[_0xb36c('0x2a')](function(_0x1bdf88){if(_0x1bdf88){return _0x1bdf88[_0xb36c('0xc0')](_0x4d3ac8[_0xb36c('0x40')][_0xb36c('0xb2')]);}})[_0xb36c('0x2a')](respondWithStatusCode(_0x45cbb9,null))['catch'](handleError(_0x45cbb9,null));};exports[_0xb36c('0xc1')]=function(_0x160559,_0x8d55c8){var _0x290bff=moment()[_0xb36c('0xc2')]()[_0xb36c('0x96')]();var _0x138fe7=path[_0xb36c('0xc3')](config['root'],_0xb36c('0xc4'),'files',_0xb36c('0xc5'));var _0x2102f5=path[_0xb36c('0xc3')](config[_0xb36c('0xc6')],_0xb36c('0xc4'),'files',_0xb36c('0xc7'));var _0x46b0fc=path['join'](_0x138fe7,_0x290bff);var _0x5b08f3=util[_0xb36c('0xb6')](_0xb36c('0xc8'),_0x160559[_0xb36c('0xac')]['id'],_0x290bff);var _0x358f89=path[_0xb36c('0xc3')](_0x138fe7,_0x5b08f3);var _0x508576=[];_0x508576[_0xb36c('0x36')]({'model':db[_0xb36c('0xc9')],'as':_0xb36c('0xc9'),'raw':!![]});var _0x76332a=[{'model':db[_0xb36c('0xb1')],'as':'Messages','attributes':['id',_0xb36c('0x73'),_0xb36c('0xca')],'include':_0x508576}];return db[_0xb36c('0x39')][_0xb36c('0x61')]({'where':{'id':_0x160559[_0xb36c('0xac')]['id']},'include':_0x76332a})['then'](handleEntityNotFound(_0x8d55c8,null))[_0xb36c('0x2a')](function(_0x51c4e9){if(_0x51c4e9&&_0x51c4e9['Messages']){var _0x170105=_0x51c4e9[_0xb36c('0xcb')]({'plain':!![]});fs[_0xb36c('0xcc')](_0x46b0fc);for(var _0x40f0d5=0x0;_0x40f0d5<_0x170105[_0xb36c('0xcd')][_0xb36c('0x60')];_0x40f0d5++){var _0x21596f=_0x170105[_0xb36c('0xcd')][_0x40f0d5]['Attachment'];if(_0x21596f){var _0x134569=path['join'](_0x2102f5,_0x21596f[_0xb36c('0xce')]);if(fs[_0xb36c('0xcf')](_0x134569)){fs[_0xb36c('0xd0')](_0x134569)[_0xb36c('0xd1')](fs[_0xb36c('0xd2')](path[_0xb36c('0xc3')](_0x46b0fc,_0x21596f[_0xb36c('0xce')])));}}}return BPromise[_0xb36c('0x8e')]()[_0xb36c('0x2a')](function(){return new BPromise(function(_0x553664,_0x3ad2ff){zipdir(_0x46b0fc,{'saveTo':_0x358f89},function(_0x5b92fe,_0x5b23ee){if(_0x5b92fe)return _0x3ad2ff(_0x5b92fe);return _0x553664(_0x5b23ee);});})['then'](function(){return new BPromise(function(_0x73dd42,_0x3967ae){rimraf(_0x46b0fc,function(_0x2d04a2){if(_0x2d04a2)_0x3967ae(_0x2d04a2);return _0x73dd42();});});})['then'](function(){return _0x8d55c8['download'](_0x358f89,_0x5b08f3,function(_0xd15c4b){if(_0xd15c4b){console[_0xb36c('0xd3')](_0xb36c('0xd4'),_0xd15c4b);}else{fs[_0xb36c('0xd5')](_0x358f89);}});});});}else{return _0x8d55c8['sendStatus'](0xc8);}})[_0xb36c('0x37')](handleError(_0x8d55c8,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 02fa7f5..b912e0c 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 _0x7a54=['setDataValue','map','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers'];(function(_0x24122,_0x28a27b){var _0x5b40ad=function(_0x53d34b){while(--_0x53d34b){_0x24122['push'](_0x24122['shift']());}};_0x5b40ad(++_0x28a27b);}(_0x7a54,0x106));var _0x47a5=function(_0x5d84b5,_0x3d3dc9){_0x5d84b5=_0x5d84b5-0x0;var _0x25a6da=_0x7a54[_0x5d84b5];return _0x25a6da;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var FaxInteraction=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x47a5('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x47a5('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x47a5('0x5'),'afterDestroy':_0x47a5('0x6')};function emitEvent(_0x2a1a7e){return function(_0x3717e1,_0xfdf934,_0x545a97){_0x3717e1[_0x47a5('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x343372){_0x3717e1[_0x47a5('0x8')]('Users',_0x343372[_0x47a5('0x9')](function(_0x5077f3){return{'id':_0x5077f3['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x3717e1['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a0e98){_0x3717e1[_0x47a5('0x8')]('unreadMessages',_0x2a0e98[_0x47a5('0xa')]);FaxInteractionEvents['emit'](_0x2a1a7e+':'+_0x3717e1['id'],_0x3717e1);FaxInteractionEvents['emit'](_0x2a1a7e,_0x3717e1);_0x545a97(null);})[_0x47a5('0xb')](_0x545a97(null));};}for(var e in events){if(events[_0x47a5('0xc')](e)){var event=events[e];FaxInteraction[_0x47a5('0xd')](e,emitEvent(event));}}module[_0x47a5('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(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2ef3,0xba));var _0x32ef=function(_0x12f7fc,_0x4a036b){_0x12f7fc=_0x12f7fc-0x0;var _0xa92018=_0x2ef3[_0x12f7fc];return _0xa92018;};'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 6ac18db..cc8f315 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 _0x26ee=['define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','exports'];(function(_0x26cefd,_0x53e737){var _0x2b1b1c=function(_0x399906){while(--_0x399906){_0x26cefd['push'](_0x26cefd['shift']());}};_0x2b1b1c(++_0x53e737);}(_0x26ee,0x19f));var _0xe26e=function(_0x293fab,_0x58f6aa){_0x293fab=_0x293fab-0x0;var _0x40513b=_0x26ee[_0x293fab];return _0x40513b;};'use strict';var _=require(_0xe26e('0x0'));var util=require(_0xe26e('0x1'));var logger=require(_0xe26e('0x2'))(_0xe26e('0x3'));var moment=require('moment');var BPromise=require(_0xe26e('0x4'));var rp=require(_0xe26e('0x5'));var fs=require('fs');var path=require(_0xe26e('0x6'));var rimraf=require('rimraf');var config=require(_0xe26e('0x7'));var attributes=require(_0xe26e('0x8'));module[_0xe26e('0x9')]=function(_0x49d4f6,_0x131d1a){return _0x49d4f6[_0xe26e('0xa')](_0xe26e('0xb'),attributes,{'tableName':_0xe26e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b648,_0x566a8d,_0x78bb44){if(_0x4b648[_0xe26e('0xd')]('closed')){_0x4b648[_0xe26e('0xe')]=moment()[_0xe26e('0xf')](_0xe26e('0x10'));}_0x78bb44(null,_0x4b648);}}});}; \ No newline at end of file +var _0x6b37=['bluebird','path','rimraf','../../config/environment','exports','define','FaxInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0xc2d7e3,_0x574c35){var _0x489bbf=function(_0x20e236){while(--_0x20e236){_0xc2d7e3['push'](_0xc2d7e3['shift']());}};_0x489bbf(++_0x574c35);}(_0x6b37,0x137));var _0x76b3=function(_0x3f53fc,_0x2c4f7f){_0x3f53fc=_0x3f53fc-0x0;var _0x3b6f27=_0x6b37[_0x3f53fc];return _0x3b6f27;};'use strict';var _=require(_0x76b3('0x0'));var util=require(_0x76b3('0x1'));var logger=require(_0x76b3('0x2'))(_0x76b3('0x3'));var moment=require('moment');var BPromise=require(_0x76b3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76b3('0x5'));var rimraf=require(_0x76b3('0x6'));var config=require(_0x76b3('0x7'));var attributes=require('./faxInteraction.attributes');module[_0x76b3('0x8')]=function(_0x978676,_0x1a3d39){return _0x978676[_0x76b3('0x9')](_0x76b3('0xa'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21c689,_0xb7c660,_0x2a1ebf){if(_0x21c689[_0x76b3('0xb')](_0x76b3('0xc'))){_0x21c689['closedAt']=moment()[_0x76b3('0xd')](_0x76b3('0xe'));}_0x2a1ebf(null,_0x21c689);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index b0fa565..ef228db 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 _0x7edd=['AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','UpdateFaxInteraction','FaxInteraction','update','body','options','attributes','limit','catch','AddTagsToFaxInteraction','find','where','addTags','ids','spread'];(function(_0x5e6c64,_0x2a876b){var _0x33f722=function(_0x3637e5){while(--_0x3637e5){_0x5e6c64['push'](_0x5e6c64['shift']());}};_0x33f722(++_0x2a876b);}(_0x7edd,0xa9));var _0xd7ed=function(_0x287b2b,_0x3cbb34){_0x287b2b=_0x287b2b-0x0;var _0xc9b2c4=_0x7edd[_0x287b2b];return _0xc9b2c4;};'use strict';var _=require(_0xd7ed('0x0'));var util=require(_0xd7ed('0x1'));var moment=require(_0xd7ed('0x2'));var BPromise=require(_0xd7ed('0x3'));var rs=require(_0xd7ed('0x4'));var fs=require('fs');var Redis=require(_0xd7ed('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd7ed('0x6'));var logger=require('../../config/logger')(_0xd7ed('0x7'));var config=require('../../config/environment');var jayson=require(_0xd7ed('0x8'));var client=jayson[_0xd7ed('0x9')]['http']({'port':0x232a});config[_0xd7ed('0xa')]=_[_0xd7ed('0xb')](config['redis'],{'host':_0xd7ed('0xc'),'port':0x18eb});var socket=require(_0xd7ed('0xd'))(new Redis(config['redis']));require(_0xd7ed('0xe'))[_0xd7ed('0xf')](socket);function respondWithRpcPromise(_0x425ce0,_0x14dbc4,_0x1f0b08){return new BPromise(function(_0x4fca1b,_0x20c8ba){return client['request'](_0x425ce0,_0x1f0b08)[_0xd7ed('0x10')](function(_0x5e15e8){logger['info'](_0xd7ed('0x11'),_0x14dbc4,'request\x20sent');logger[_0xd7ed('0x12')](_0xd7ed('0x13'),_0x14dbc4,_0xd7ed('0x14'),JSON[_0xd7ed('0x15')](_0x5e15e8));if(_0x5e15e8['error']){if(_0x5e15e8[_0xd7ed('0x16')][_0xd7ed('0x17')]===0x1f4){logger[_0xd7ed('0x16')](_0xd7ed('0x11'),_0x14dbc4,_0x5e15e8[_0xd7ed('0x16')][_0xd7ed('0x18')]);return _0x20c8ba(_0x5e15e8['error']['message']);}logger[_0xd7ed('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x14dbc4,_0x5e15e8[_0xd7ed('0x16')][_0xd7ed('0x18')]);return _0x4fca1b(_0x5e15e8[_0xd7ed('0x16')]['message']);}else{logger[_0xd7ed('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x14dbc4,_0xd7ed('0x14'));_0x4fca1b(_0x5e15e8[_0xd7ed('0x1a')][_0xd7ed('0x18')]);}})['catch'](function(_0x2f7a93){logger[_0xd7ed('0x16')](_0xd7ed('0x11'),_0x14dbc4,_0x2f7a93);_0x20c8ba(_0x2f7a93);});});}exports[_0xd7ed('0x1b')]=function(_0x3c34c3){var _0x5c2ca4=this;return new Promise(function(_0xa55749,_0xa97adc){return db[_0xd7ed('0x1c')][_0xd7ed('0x1d')](_0x3c34c3[_0xd7ed('0x1e')],{'raw':_0x3c34c3['options']?_0x3c34c3[_0xd7ed('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c34c3['options']?_0x3c34c3['options']['where']||null:null,'attributes':_0x3c34c3[_0xd7ed('0x1f')]?_0x3c34c3[_0xd7ed('0x1f')][_0xd7ed('0x20')]||null:null,'limit':_0x3c34c3[_0xd7ed('0x1f')]?_0x3c34c3[_0xd7ed('0x1f')][_0xd7ed('0x21')]||null:null})['then'](function(_0x58822f){logger[_0xd7ed('0x19')](_0xd7ed('0x1b'),_0x3c34c3);logger[_0xd7ed('0x12')](_0xd7ed('0x1b'),_0x3c34c3,JSON['stringify'](_0x58822f));_0xa55749(_0x58822f);})[_0xd7ed('0x22')](function(_0xa3a14b){logger['error'](_0xd7ed('0x1b'),_0xa3a14b['message'],_0x3c34c3);_0xa97adc(_0x5c2ca4['error'](0x1f4,_0xa3a14b[_0xd7ed('0x18')]));});});};exports[_0xd7ed('0x23')]=function(_0x2cb511){return new Promise(function(_0x106609,_0x467d27){return db[_0xd7ed('0x1c')][_0xd7ed('0x24')]({'where':_0x2cb511[_0xd7ed('0x1f')]?_0x2cb511[_0xd7ed('0x1f')][_0xd7ed('0x25')]||null:null})['then'](function(_0xfb5c8c){if(_0xfb5c8c){return _0xfb5c8c[_0xd7ed('0x26')](_0x2cb511['body'][_0xd7ed('0x27')],_['omit'](_0x2cb511[_0xd7ed('0x1e')],[_0xd7ed('0x27'),'id'])||{});}})[_0xd7ed('0x28')](function(_0x28e33a){logger['info'](_0xd7ed('0x29'),_0x2cb511);logger[_0xd7ed('0x12')]('AddTags',_0x2cb511,JSON['stringify'](_0x28e33a));_0x106609(_0x28e33a);})['catch'](function(_0x4ea497){logger[_0xd7ed('0x16')](_0xd7ed('0x29'),_0x4ea497[_0xd7ed('0x18')],_0x2cb511);_0x467d27(_this[_0xd7ed('0x16')](0x1f4,_0x4ea497[_0xd7ed('0x18')]));});});}; \ No newline at end of file +var _0x8d90=['stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug'];(function(_0x391364,_0x40cf10){var _0x4a261b=function(_0x1c3271){while(--_0x1c3271){_0x391364['push'](_0x391364['shift']());}};_0x4a261b(++_0x40cf10);}(_0x8d90,0xbc));var _0x08d9=function(_0x3ed105,_0x233827){_0x3ed105=_0x3ed105-0x0;var _0x3b9631=_0x8d90[_0x3ed105];return _0x3b9631;};'use strict';var _=require(_0x08d9('0x0'));var util=require(_0x08d9('0x1'));var moment=require(_0x08d9('0x2'));var BPromise=require(_0x08d9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x08d9('0x4'));var db=require(_0x08d9('0x5'))['db'];var utils=require(_0x08d9('0x6'));var logger=require(_0x08d9('0x7'))(_0x08d9('0x8'));var config=require(_0x08d9('0x9'));var jayson=require(_0x08d9('0xa'));var client=jayson['client'][_0x08d9('0xb')]({'port':0x232a});config[_0x08d9('0xc')]=_[_0x08d9('0xd')](config['redis'],{'host':_0x08d9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x08d9('0xc')]));require(_0x08d9('0xf'))[_0x08d9('0x10')](socket);function respondWithRpcPromise(_0x3762c7,_0x2fb0da,_0x5cc1e9){return new BPromise(function(_0x38e55b,_0x41ab63){return client[_0x08d9('0x11')](_0x3762c7,_0x5cc1e9)[_0x08d9('0x12')](function(_0x3e39c2){logger[_0x08d9('0x13')](_0x08d9('0x14'),_0x2fb0da,'request\x20sent');logger[_0x08d9('0x15')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x2fb0da,'request\x20sent',JSON[_0x08d9('0x16')](_0x3e39c2));if(_0x3e39c2['error']){if(_0x3e39c2[_0x08d9('0x17')][_0x08d9('0x18')]===0x1f4){logger[_0x08d9('0x17')](_0x08d9('0x14'),_0x2fb0da,_0x3e39c2[_0x08d9('0x17')][_0x08d9('0x19')]);return _0x41ab63(_0x3e39c2[_0x08d9('0x17')][_0x08d9('0x19')]);}logger[_0x08d9('0x17')](_0x08d9('0x14'),_0x2fb0da,_0x3e39c2[_0x08d9('0x17')]['message']);return _0x38e55b(_0x3e39c2[_0x08d9('0x17')][_0x08d9('0x19')]);}else{logger[_0x08d9('0x13')](_0x08d9('0x14'),_0x2fb0da,'request\x20sent');_0x38e55b(_0x3e39c2[_0x08d9('0x1a')][_0x08d9('0x19')]);}})[_0x08d9('0x1b')](function(_0x4b04ef){logger[_0x08d9('0x17')](_0x08d9('0x14'),_0x2fb0da,_0x4b04ef);_0x41ab63(_0x4b04ef);});});}exports[_0x08d9('0x1c')]=function(_0x5c4e5b){var _0x4c748d=this;return new Promise(function(_0x1ac7d1,_0x1a6a1f){return db[_0x08d9('0x1d')][_0x08d9('0x1e')](_0x5c4e5b['body'],{'raw':_0x5c4e5b[_0x08d9('0x1f')]?_0x5c4e5b['options'][_0x08d9('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c4e5b[_0x08d9('0x1f')]?_0x5c4e5b[_0x08d9('0x1f')][_0x08d9('0x21')]||null:null,'attributes':_0x5c4e5b[_0x08d9('0x1f')]?_0x5c4e5b['options'][_0x08d9('0x22')]||null:null,'limit':_0x5c4e5b[_0x08d9('0x1f')]?_0x5c4e5b[_0x08d9('0x1f')]['limit']||null:null})['then'](function(_0x245f17){logger[_0x08d9('0x13')](_0x08d9('0x1c'),_0x5c4e5b);logger['debug']('UpdateFaxInteraction',_0x5c4e5b,JSON[_0x08d9('0x16')](_0x245f17));_0x1ac7d1(_0x245f17);})[_0x08d9('0x1b')](function(_0xc8cce4){logger[_0x08d9('0x17')](_0x08d9('0x1c'),_0xc8cce4[_0x08d9('0x19')],_0x5c4e5b);_0x1a6a1f(_0x4c748d[_0x08d9('0x17')](0x1f4,_0xc8cce4['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x21a758){return new Promise(function(_0x4b43c2,_0x139b72){return db[_0x08d9('0x1d')][_0x08d9('0x23')]({'where':_0x21a758[_0x08d9('0x1f')]?_0x21a758[_0x08d9('0x1f')]['where']||null:null})[_0x08d9('0x12')](function(_0x5e628b){if(_0x5e628b){return _0x5e628b[_0x08d9('0x24')](_0x21a758[_0x08d9('0x25')][_0x08d9('0x26')],_[_0x08d9('0x27')](_0x21a758['body'],[_0x08d9('0x26'),'id'])||{});}})[_0x08d9('0x28')](function(_0x477161){logger['info']('AddTags',_0x21a758);logger[_0x08d9('0x15')]('AddTags',_0x21a758,JSON[_0x08d9('0x16')](_0x477161));_0x4b43c2(_0x477161);})[_0x08d9('0x1b')](function(_0x333e35){logger[_0x08d9('0x17')](_0x08d9('0x29'),_0x333e35[_0x08d9('0x19')],_0x21a758);_0x139b72(_this['error'](0x1f4,_0x333e35[_0x08d9('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index a124f50..1003400 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 _0x4a4c=['save','update','removeListener','./faxInteraction.events'];(function(_0x36ce8d,_0x24e4ea){var _0x3c1e57=function(_0x433926){while(--_0x433926){_0x36ce8d['push'](_0x36ce8d['shift']());}};_0x3c1e57(++_0x24e4ea);}(_0x4a4c,0x187));var _0xc4a4=function(_0x2c768d,_0x5b3efb){_0x2c768d=_0x2c768d-0x0;var _0x2e0941=_0x4a4c[_0x2c768d];return _0x2e0941;};'use strict';var FaxInteractionEvents=require(_0xc4a4('0x0'));var events=[_0xc4a4('0x1'),'remove',_0xc4a4('0x2')];function createListener(_0x23023a,_0x50dcf4){return function(_0x33256e){_0x50dcf4['emit'](_0x23023a,_0x33256e);};}function removeListener(_0x36ef03,_0x53227d){return function(){FaxInteractionEvents[_0xc4a4('0x3')](_0x36ef03,_0x53227d);};}exports['register']=function(_0x21a65d){for(var _0x3b3325=0x0,_0x3c5866=events['length'];_0x3b3325<_0x3c5866;_0x3b3325++){var _0x58053c=events[_0x3b3325];var _0x53f323=createListener('faxInteraction:'+_0x58053c,_0x21a65d);FaxInteractionEvents['on'](_0x58053c,_0x53f323);}}; \ No newline at end of file +var _0x9541=['save','remove','update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x4777cf,_0x2b2f23){var _0x3fdb90=function(_0x19fc1a){while(--_0x19fc1a){_0x4777cf['push'](_0x4777cf['shift']());}};_0x3fdb90(++_0x2b2f23);}(_0x9541,0x8f));var _0x1954=function(_0x14f9de,_0x19e5a0){_0x14f9de=_0x14f9de-0x0;var _0x3beaa9=_0x9541[_0x14f9de];return _0x3beaa9;};'use strict';var FaxInteractionEvents=require(_0x1954('0x0'));var events=[_0x1954('0x1'),_0x1954('0x2'),_0x1954('0x3')];function createListener(_0x366549,_0x51ed0b){return function(_0x50c440){_0x51ed0b[_0x1954('0x4')](_0x366549,_0x50c440);};}function removeListener(_0x1e4814,_0x2e0c68){return function(){FaxInteractionEvents[_0x1954('0x5')](_0x1e4814,_0x2e0c68);};}exports[_0x1954('0x6')]=function(_0x55ab4d){for(var _0x3d258d=0x0,_0x5748dd=events[_0x1954('0x7')];_0x3d258d<_0x5748dd;_0x3d258d++){var _0x1e34fc=events[_0x3d258d];var _0xdefb0=createListener(_0x1954('0x8')+_0x1e34fc,_0x55ab4d);FaxInteractionEvents['on'](_0x1e34fc,_0xdefb0);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index c3a913b..81d1063 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 _0x83ea=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','addTags','put','fax','update','delete','destroy','removeTags','exports'];(function(_0x3ebeb1,_0x42622e){var _0x1bb2b1=function(_0x25ef3f){while(--_0x25ef3f){_0x3ebeb1['push'](_0x3ebeb1['shift']());}};_0x1bb2b1(++_0x42622e);}(_0x83ea,0x80));var _0xa83e=function(_0x2a3b6e,_0x191964){_0x2a3b6e=_0x2a3b6e-0x0;var _0x70c2b5=_0x83ea[_0x2a3b6e];return _0x70c2b5;};'use strict';var multer=require(_0xa83e('0x0'));var util=require(_0xa83e('0x1'));var path=require('path');var timeout=require(_0xa83e('0x2'));var express=require(_0xa83e('0x3'));var router=express[_0xa83e('0x4')]();var fs_extra=require(_0xa83e('0x5'));var auth=require(_0xa83e('0x6'));var interaction=require(_0xa83e('0x7'));var config=require(_0xa83e('0x8'));var controller=require('./faxInteraction.controller');router['get']('/',auth[_0xa83e('0x9')](),controller[_0xa83e('0xa')]);router[_0xa83e('0xb')](_0xa83e('0xc'),auth[_0xa83e('0x9')](),controller['describe']);router[_0xa83e('0xb')](_0xa83e('0xd'),auth[_0xa83e('0x9')](),controller[_0xa83e('0xe')]);router[_0xa83e('0xb')](_0xa83e('0xf'),auth[_0xa83e('0x9')](),controller[_0xa83e('0x10')]);router[_0xa83e('0xb')](_0xa83e('0x11'),auth[_0xa83e('0x9')](),controller[_0xa83e('0x12')]);router[_0xa83e('0x13')]('/',auth[_0xa83e('0x9')](),controller[_0xa83e('0x14')]);router[_0xa83e('0x13')](_0xa83e('0xf'),auth[_0xa83e('0x9')](),controller[_0xa83e('0x15')]);router[_0xa83e('0x13')](_0xa83e('0x16'),auth[_0xa83e('0x9')](),interaction[_0xa83e('0x17')]('fax','faxinteraction:addtags'),controller[_0xa83e('0x18')]);router[_0xa83e('0x19')]('/:id',auth[_0xa83e('0x9')](),interaction[_0xa83e('0x17')](_0xa83e('0x1a'),'faxinteraction:update'),controller[_0xa83e('0x1b')]);router[_0xa83e('0x1c')](_0xa83e('0xd'),auth[_0xa83e('0x9')](),interaction[_0xa83e('0x17')](_0xa83e('0x1a'),'faxinteraction:destroy'),controller[_0xa83e('0x1d')]);router['delete'](_0xa83e('0x16'),auth[_0xa83e('0x9')](),controller[_0xa83e('0x1e')]);module[_0xa83e('0x1f')]=router; \ No newline at end of file +var _0x21ed=['delete','faxinteraction:destroy','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','addTags','fax','faxinteraction:update','update'];(function(_0x1a3b1f,_0x5adda9){var _0x451118=function(_0x1556b4){while(--_0x1556b4){_0x1a3b1f['push'](_0x1a3b1f['shift']());}};_0x451118(++_0x5adda9);}(_0x21ed,0x1c3));var _0xd21e=function(_0x55eec9,_0x42e46a){_0x55eec9=_0x55eec9-0x0;var _0x536ec8=_0x21ed[_0x55eec9];return _0x536ec8;};'use strict';var multer=require(_0xd21e('0x0'));var util=require('util');var path=require(_0xd21e('0x1'));var timeout=require(_0xd21e('0x2'));var express=require(_0xd21e('0x3'));var router=express[_0xd21e('0x4')]();var fs_extra=require(_0xd21e('0x5'));var auth=require(_0xd21e('0x6'));var interaction=require(_0xd21e('0x7'));var config=require(_0xd21e('0x8'));var controller=require(_0xd21e('0x9'));router[_0xd21e('0xa')]('/',auth[_0xd21e('0xb')](),controller[_0xd21e('0xc')]);router[_0xd21e('0xa')](_0xd21e('0xd'),auth['isAuthenticated'](),controller[_0xd21e('0xe')]);router[_0xd21e('0xa')](_0xd21e('0xf'),auth[_0xd21e('0xb')](),controller[_0xd21e('0x10')]);router[_0xd21e('0xa')](_0xd21e('0x11'),auth['isAuthenticated'](),controller[_0xd21e('0x12')]);router[_0xd21e('0xa')](_0xd21e('0x13'),auth[_0xd21e('0xb')](),controller[_0xd21e('0x14')]);router[_0xd21e('0x15')]('/',auth[_0xd21e('0xb')](),controller['create']);router[_0xd21e('0x15')](_0xd21e('0x11'),auth[_0xd21e('0xb')](),controller[_0xd21e('0x16')]);router['post'](_0xd21e('0x17'),auth[_0xd21e('0xb')](),interaction[_0xd21e('0x18')]('fax','faxinteraction:addtags'),controller[_0xd21e('0x19')]);router['put'](_0xd21e('0xf'),auth[_0xd21e('0xb')](),interaction[_0xd21e('0x18')](_0xd21e('0x1a'),_0xd21e('0x1b')),controller[_0xd21e('0x1c')]);router[_0xd21e('0x1d')]('/:id',auth['isAuthenticated'](),interaction[_0xd21e('0x18')](_0xd21e('0x1a'),_0xd21e('0x1e')),controller['destroy']);router[_0xd21e('0x1d')](_0xd21e('0x17'),auth['isAuthenticated'](),controller[_0xd21e('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 0af2516..5998e20 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 _0xba79=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x282c6e,_0x4bf2ca){var _0x26545f=function(_0x1d5db3){while(--_0x1d5db3){_0x282c6e['push'](_0x282c6e['shift']());}};_0x26545f(++_0x4bf2ca);}(_0xba79,0x157));var _0x9ba7=function(_0x14eb24,_0x592e97){_0x14eb24=_0x14eb24-0x0;var _0x30aa1e=_0xba79[_0x14eb24];return _0x30aa1e;};'use strict';var Sequelize=require(_0x9ba7('0x0'));module[_0x9ba7('0x1')]={'body':{'type':Sequelize['TEXT'](_0x9ba7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9ba7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9ba7('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x9ba7('0x5')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x6264=['out','TEXT','DATE','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x231c5f,_0x10f3a5){var _0xd762ee=function(_0x5918de){while(--_0x5918de){_0x231c5f['push'](_0x231c5f['shift']());}};_0xd762ee(++_0x10f3a5);}(_0x6264,0x83));var _0x4626=function(_0x4f832f,_0x9a0d4){_0x4f832f=_0x4f832f-0x0;var _0x37ca5a=_0x6264[_0x4f832f];return _0x37ca5a;};'use strict';var Sequelize=require(_0x4626('0x0'));module[_0x4626('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4626('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4626('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4626('0x4')]('in',_0x4626('0x5')),'defaultValue':_0x4626('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x4626('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0x4626('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 6515ec2..8884b20 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 _0xe415=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','options','find','body','fax-interactions','accept','fax','read','readAt','format','UserId','user','agent','CmContact','Contact','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','describe','startsWith','cf_','ContactId','Sequelize','SELECT','contact','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./faxMessage.socket','jayson/promise','http','client','request','then','info','request\x20sent','debug','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','json','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length'];(function(_0x3524cc,_0x527021){var _0x51a394=function(_0x1bbec3){while(--_0x1bbec3){_0x3524cc['push'](_0x3524cc['shift']());}};_0x51a394(++_0x527021);}(_0xe415,0xd6));var _0x5e41=function(_0x136f1c,_0x5dcf3e){_0x136f1c=_0x136f1c-0x0;var _0xc14723=_0xe415[_0x136f1c];return _0xc14723;};'use strict';var emlformat=require(_0x5e41('0x0'));var rimraf=require(_0x5e41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e41('0x2'));var rp=require(_0x5e41('0x3'));var moment=require(_0x5e41('0x4'));var BPromise=require(_0x5e41('0x5'));var Mustache=require(_0x5e41('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5e41('0x7'));var csv=require(_0x5e41('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e41('0x9'));var _=require(_0x5e41('0xa'));var squel=require(_0x5e41('0xb'));var crypto=require(_0x5e41('0xc'));var jsforce=require(_0x5e41('0xd'));var deskjs=require(_0x5e41('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5e41('0xf'));var Papa=require(_0x5e41('0x10'));var Redis=require(_0x5e41('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5e41('0x12'));var as=require(_0x5e41('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e41('0x14'))(_0x5e41('0x15'));var utils=require(_0x5e41('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5e41('0x17'));var db=require('../../mysqldb')['db'];config[_0x5e41('0x18')]=_[_0x5e41('0x19')](config['redis'],{'host':_0x5e41('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e41('0x18')]));require(_0x5e41('0x1b'))['register'](socket);var jayson=require(_0x5e41('0x1c'));var client=jayson['client'][_0x5e41('0x1d')]({'port':0x232c});var client9002=jayson[_0x5e41('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe95204,_0x5c469e,_0x420d2e,_0x125206){return new BPromise(function(_0x49f2f9,_0x16d8c7){var _0x1f07f1=_0x125206||client;return _0x1f07f1[_0x5e41('0x1f')](_0xe95204,_0x420d2e)[_0x5e41('0x20')](function(_0x3a1145){logger[_0x5e41('0x21')]('FaxMessage,\x20%s,\x20%s',_0x5c469e,_0x5e41('0x22'));logger[_0x5e41('0x23')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5c469e,_0x5e41('0x22'),JSON[_0x5e41('0x24')](_0x3a1145));if(_0x3a1145[_0x5e41('0x25')]){if(_0x3a1145[_0x5e41('0x25')]['code']===0x1f4){logger['error'](_0x5e41('0x26'),_0x5c469e,_0x3a1145[_0x5e41('0x25')][_0x5e41('0x27')]);return _0x16d8c7(_0x3a1145[_0x5e41('0x25')][_0x5e41('0x27')]);}logger[_0x5e41('0x25')]('FaxMessage,\x20%s,\x20%s',_0x5c469e,_0x3a1145['error'][_0x5e41('0x27')]);return _0x49f2f9(_0x3a1145[_0x5e41('0x25')]['message']);}else{logger[_0x5e41('0x21')](_0x5e41('0x26'),_0x5c469e,_0x5e41('0x22'));_0x49f2f9(_0x3a1145[_0x5e41('0x28')][_0x5e41('0x27')]);}})[_0x5e41('0x29')](function(_0x4fbfb5){logger[_0x5e41('0x25')](_0x5e41('0x26'),_0x5c469e,_0x4fbfb5);_0x16d8c7(_0x4fbfb5);});});}function respondWithStatusCode(_0x179498,_0x52a206){_0x52a206=_0x52a206||0xcc;return function(_0x3a4618){if(_0x3a4618){return _0x179498[_0x5e41('0x2a')](_0x52a206);}return _0x179498[_0x5e41('0x2b')](_0x52a206)[_0x5e41('0x2c')]();};}function respondWithResult(_0x44b1bc,_0x302c6a){_0x302c6a=_0x302c6a||0xc8;return function(_0xadc19d){if(_0xadc19d){return _0x44b1bc[_0x5e41('0x2b')](_0x302c6a)['json'](_0xadc19d);}};}function respondWithFilteredResult(_0x185f47,_0x216a9b){return function(_0x14d1bb){if(_0x14d1bb){var _0x4ed372=typeof _0x216a9b[_0x5e41('0x2d')]===_0x5e41('0x2e')&&typeof _0x216a9b[_0x5e41('0x2f')]===_0x5e41('0x2e');var _0x284075=_0x14d1bb['count'];var _0x32e02d=_0x4ed372?0x0:_0x216a9b[_0x5e41('0x2d')];var _0x1419ef=_0x4ed372?_0x14d1bb[_0x5e41('0x30')]:_0x216a9b[_0x5e41('0x2d')]+_0x216a9b[_0x5e41('0x2f')];var _0x17eb90;if(_0x1419ef>=_0x284075){_0x1419ef=_0x284075;_0x17eb90=0xc8;}else{_0x17eb90=0xce;}_0x185f47[_0x5e41('0x2b')](_0x17eb90);return _0x185f47['set']('Content-Range',_0x32e02d+'-'+_0x1419ef+'/'+_0x284075)[_0x5e41('0x31')](_0x14d1bb);}return null;};}function patchUpdates(_0x2e3744){return function(_0x4e37f2){try{jsonpatch['apply'](_0x4e37f2,_0x2e3744,!![]);}catch(_0x31e7c7){return BPromise[_0x5e41('0x32')](_0x31e7c7);}return _0x4e37f2[_0x5e41('0x33')]();};}function saveUpdates(_0x5c1848,_0xa5607f){return function(_0x1ec958){if(_0x1ec958){return _0x1ec958[_0x5e41('0x34')](_0x5c1848)[_0x5e41('0x20')](function(_0x202d4e){return _0x202d4e;});}return null;};}function removeEntity(_0x1206b4,_0x3aa481){return function(_0x3f1567){if(_0x3f1567){return _0x3f1567[_0x5e41('0x35')]()[_0x5e41('0x20')](function(){_0x1206b4[_0x5e41('0x2b')](0xcc)[_0x5e41('0x2c')]();});}};}function handleEntityNotFound(_0x9333a9,_0x910904){return function(_0x4d054e){if(!_0x4d054e){_0x9333a9[_0x5e41('0x2a')](0x194);}return _0x4d054e;};}function handleError(_0x20f307,_0x1b9bcd){_0x1b9bcd=_0x1b9bcd||0x1f4;return function(_0x321be3){logger[_0x5e41('0x25')](_0x321be3[_0x5e41('0x36')]);if(_0x321be3[_0x5e41('0x37')]){delete _0x321be3[_0x5e41('0x37')];}_0x20f307['status'](_0x1b9bcd)[_0x5e41('0x38')](_0x321be3);};}exports[_0x5e41('0x39')]=function(_0x5c8d76,_0x3e708f){var _0x17b077={},_0x571783={},_0x4ed7ac={'count':0x0,'rows':[]};var _0x30ccaa=_[_0x5e41('0x3a')](db[_0x5e41('0x3b')][_0x5e41('0x3c')],function(_0x44ba44){return{'name':_0x44ba44[_0x5e41('0x3d')],'type':_0x44ba44[_0x5e41('0x3e')][_0x5e41('0x3f')]};});_0x571783['model']=_['map'](_0x30ccaa,_0x5e41('0x37'));_0x571783['query']=_[_0x5e41('0x40')](_0x5c8d76['query']);_0x571783[_0x5e41('0x41')]=_[_0x5e41('0x42')](_0x571783[_0x5e41('0x43')],_0x571783[_0x5e41('0x44')]);_0x17b077[_0x5e41('0x45')]=_[_0x5e41('0x42')](_0x571783[_0x5e41('0x43')],qs[_0x5e41('0x46')](_0x5c8d76[_0x5e41('0x44')][_0x5e41('0x46')]));_0x17b077[_0x5e41('0x45')]=_0x17b077['attributes'][_0x5e41('0x47')]?_0x17b077['attributes']:_0x571783[_0x5e41('0x43')];if(!_0x5c8d76[_0x5e41('0x44')][_0x5e41('0x48')](_0x5e41('0x49'))){_0x17b077[_0x5e41('0x2f')]=qs[_0x5e41('0x2f')](_0x5c8d76['query']['limit']);_0x17b077[_0x5e41('0x2d')]=qs[_0x5e41('0x2d')](_0x5c8d76[_0x5e41('0x44')][_0x5e41('0x2d')]);}_0x17b077['order']=qs[_0x5e41('0x4a')](_0x5c8d76['query'][_0x5e41('0x4a')]);_0x17b077[_0x5e41('0x4b')]=qs[_0x5e41('0x41')](_[_0x5e41('0x4c')](_0x5c8d76[_0x5e41('0x44')],_0x571783[_0x5e41('0x41')]),_0x30ccaa);if(_0x5c8d76[_0x5e41('0x44')][_0x5e41('0x4d')]){_0x17b077['where']=_['merge'](_0x17b077[_0x5e41('0x4b')],{'$or':_[_0x5e41('0x3a')](_0x30ccaa,function(_0x90de62){if(_0x90de62[_0x5e41('0x3e')]!=='VIRTUAL'){var _0x1530ce={};_0x1530ce[_0x90de62[_0x5e41('0x37')]]={'$like':'%'+_0x5c8d76[_0x5e41('0x44')][_0x5e41('0x4d')]+'%'};return _0x1530ce;}})});}_0x17b077=_[_0x5e41('0x4e')]({},_0x17b077,_0x5c8d76['options']);var _0x3b74ed={'where':_0x17b077[_0x5e41('0x4b')]};return db[_0x5e41('0x3b')][_0x5e41('0x30')](_0x3b74ed)[_0x5e41('0x20')](function(_0x4496ed){_0x4ed7ac[_0x5e41('0x30')]=_0x4496ed;if(_0x5c8d76[_0x5e41('0x44')][_0x5e41('0x4f')]){_0x17b077[_0x5e41('0x50')]=[{'all':!![]}];}return db[_0x5e41('0x3b')][_0x5e41('0x51')](_0x17b077);})['then'](function(_0x18f49f){_0x4ed7ac[_0x5e41('0x52')]=_0x18f49f;return _0x4ed7ac;})[_0x5e41('0x20')](respondWithFilteredResult(_0x3e708f,_0x17b077))['catch'](handleError(_0x3e708f,null));};exports[_0x5e41('0x53')]=function(_0x4c16a9,_0x21caac){var _0x19b853={'raw':!![],'where':{'id':_0x4c16a9[_0x5e41('0x54')]['id']}},_0x2a5735={};_0x2a5735['model']=_[_0x5e41('0x40')](db[_0x5e41('0x3b')][_0x5e41('0x3c')]);_0x2a5735['query']=_[_0x5e41('0x40')](_0x4c16a9[_0x5e41('0x44')]);_0x2a5735['filters']=_[_0x5e41('0x42')](_0x2a5735[_0x5e41('0x43')],_0x2a5735[_0x5e41('0x44')]);_0x19b853[_0x5e41('0x45')]=_[_0x5e41('0x42')](_0x2a5735['model'],qs[_0x5e41('0x46')](_0x4c16a9['query']['fields']));_0x19b853[_0x5e41('0x45')]=_0x19b853[_0x5e41('0x45')][_0x5e41('0x47')]?_0x19b853[_0x5e41('0x45')]:_0x2a5735[_0x5e41('0x43')];if(_0x4c16a9[_0x5e41('0x44')][_0x5e41('0x4f')]){_0x19b853['include']=[{'all':!![]}];}_0x19b853=_[_0x5e41('0x4e')]({},_0x19b853,_0x4c16a9[_0x5e41('0x55')]);return db[_0x5e41('0x3b')][_0x5e41('0x56')](_0x19b853)[_0x5e41('0x20')](handleEntityNotFound(_0x21caac,null))['then'](respondWithResult(_0x21caac,null))[_0x5e41('0x29')](handleError(_0x21caac,null));};exports['update']=function(_0x297c34,_0x12a140){if(_0x297c34['body']['id']){delete _0x297c34[_0x5e41('0x57')]['id'];}return db[_0x5e41('0x3b')]['find']({'where':{'id':_0x297c34[_0x5e41('0x54')]['id']}})[_0x5e41('0x20')](handleEntityNotFound(_0x12a140,null))[_0x5e41('0x20')](saveUpdates(_0x297c34['body'],null))[_0x5e41('0x20')](respondWithResult(_0x12a140,null))[_0x5e41('0x29')](handleError(_0x12a140,null));};exports[_0x5e41('0x35')]=function(_0x15eb26,_0x3f9bc9){return db[_0x5e41('0x3b')][_0x5e41('0x56')]({'where':{'id':_0x15eb26[_0x5e41('0x54')]['id']}})[_0x5e41('0x20')](handleEntityNotFound(_0x3f9bc9,null))['then'](removeEntity(_0x3f9bc9,null))[_0x5e41('0x29')](handleError(_0x3f9bc9,null));};exports['describe']=function(_0x15e13d,_0x49644c){return db['FaxMessage']['describe']()[_0x5e41('0x20')](respondWithResult(_0x49644c,null))[_0x5e41('0x29')](handleError(_0x49644c,null));};var interaction_log=require(_0x5e41('0x14'))(_0x5e41('0x58'));exports[_0x5e41('0x59')]=function(_0x557db7,_0x4c30ac,_0x8cd7ae){var _0x10b0b0={'agent':{},'channel':_0x5e41('0x5a')};if(_0x557db7[_0x5e41('0x57')]['id']){delete _0x557db7[_0x5e41('0x57')]['id'];}_0x557db7[_0x5e41('0x57')][_0x5e41('0x5b')]=!![];_0x557db7[_0x5e41('0x57')][_0x5e41('0x5c')]=moment()[_0x5e41('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x557db7['body'][_0x5e41('0x5e')]=_0x557db7[_0x5e41('0x57')][_0x5e41('0x5e')]||_0x557db7[_0x5e41('0x5f')]['id'];_0x10b0b0[_0x5e41('0x60')]['id']=_0x557db7['body'][_0x5e41('0x5e')];return db['FaxMessage'][_0x5e41('0x56')]({'where':{'id':_0x557db7['params']['id'],'UserId':null},'include':[{'model':db[_0x5e41('0x61')],'as':_0x5e41('0x62')}]})[_0x5e41('0x20')](handleEntityNotFound(_0x4c30ac,null))[_0x5e41('0x20')](saveUpdates(_0x557db7[_0x5e41('0x57')],null))[_0x5e41('0x20')](function(_0x341a94){if(_0x341a94){_0x10b0b0['message']=_0x341a94[_0x5e41('0x63')]({'plain':!![]});return db[_0x5e41('0x64')][_0x5e41('0x56')]({'where':{'id':_0x341a94[_0x5e41('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x4c30ac,null))[_0x5e41('0x20')](function(_0x3d5de4){if(_0x3d5de4){return _0x3d5de4[_0x5e41('0x34')]({'UserId':_0x557db7[_0x5e41('0x57')][_0x5e41('0x5e')],'read1stAt':_[_0x5e41('0x66')](_0x3d5de4[_0x5e41('0x67')])?moment()[_0x5e41('0x5d')](_0x5e41('0x68')):undefined});}return null;})['then'](function(_0x105201){if(_0x105201){_0x10b0b0['interaction']=_0x105201['get']({'plain':!![]});interaction_log[_0x5e41('0x21')](_0x5e41('0x69'),_0x557db7[_0x5e41('0x5f')]['id'],_0x557db7[_0x5e41('0x5f')][_0x5e41('0x37')],_0x557db7['user'][_0x5e41('0x6a')],_0x10b0b0[_0x5e41('0x6b')]['id'],_0x557db7[_0x5e41('0x57')]?JSON['stringify'](_0x557db7['body']):_0x5e41('0x6c'));return respondWithRpcPromise(_0x5e41('0x6d'),'acceptMessage',_0x10b0b0);}return null;})[_0x5e41('0x20')](function(_0x3bbad4){return db['CmContact'][_0x5e41('0x6e')]()[_0x5e41('0x20')](function(_0x5d819b){var _0x10c973=[];for(var _0x1a2d82=0x0;_0x1a2d82=_0x49494a){_0x443a91=_0x49494a;_0x150501=0xc8;}else{_0x150501=0xce;}_0x8ecac1['status'](_0x150501);return _0x8ecac1[_0x8f27('0x35')](_0x8f27('0x36'),_0x3484cf+'-'+_0x443a91+'/'+_0x49494a)[_0x8f27('0x30')](_0x2b5b23);}return null;};}function patchUpdates(_0x821a90){return function(_0x454a8e){try{jsonpatch[_0x8f27('0x37')](_0x454a8e,_0x821a90,!![]);}catch(_0x23b087){return BPromise['reject'](_0x23b087);}return _0x454a8e[_0x8f27('0x38')]();};}function saveUpdates(_0x5c44ee,_0x59554f){return function(_0x371afb){if(_0x371afb){return _0x371afb['update'](_0x5c44ee)['then'](function(_0x361fbc){return _0x361fbc;});}return null;};}function removeEntity(_0x54ecb0,_0x2c868f){return function(_0x41e9f3){if(_0x41e9f3){return _0x41e9f3[_0x8f27('0x39')]()['then'](function(){_0x54ecb0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fea8e,_0xfce48a){return function(_0xa40d5a){if(!_0xa40d5a){_0x4fea8e['sendStatus'](0x194);}return _0xa40d5a;};}function handleError(_0x3737b0,_0xb3162d){_0xb3162d=_0xb3162d||0x1f4;return function(_0x400066){logger[_0x8f27('0x28')](_0x400066[_0x8f27('0x3a')]);if(_0x400066['name']){delete _0x400066[_0x8f27('0x3b')];}_0x3737b0[_0x8f27('0x3c')](_0xb3162d)['send'](_0x400066);};}exports['index']=function(_0x475f28,_0x5d7ecf){var _0x5d6a5f={},_0x1de6b8={},_0x29f5ab={'count':0x0,'rows':[]};var _0xf31391=_[_0x8f27('0x3d')](db[_0x8f27('0x3e')][_0x8f27('0x3f')],function(_0x1165e8){return{'name':_0x1165e8['fieldName'],'type':_0x1165e8['type'][_0x8f27('0x40')]};});_0x1de6b8['model']=_[_0x8f27('0x3d')](_0xf31391,_0x8f27('0x3b'));_0x1de6b8[_0x8f27('0x41')]=_[_0x8f27('0x42')](_0x475f28[_0x8f27('0x41')]);_0x1de6b8[_0x8f27('0x43')]=_[_0x8f27('0x44')](_0x1de6b8['model'],_0x1de6b8[_0x8f27('0x41')]);_0x5d6a5f['attributes']=_[_0x8f27('0x44')](_0x1de6b8[_0x8f27('0x45')],qs['fields'](_0x475f28[_0x8f27('0x41')][_0x8f27('0x46')]));_0x5d6a5f[_0x8f27('0x47')]=_0x5d6a5f[_0x8f27('0x47')][_0x8f27('0x48')]?_0x5d6a5f[_0x8f27('0x47')]:_0x1de6b8[_0x8f27('0x45')];if(!_0x475f28[_0x8f27('0x41')][_0x8f27('0x49')](_0x8f27('0x4a'))){_0x5d6a5f[_0x8f27('0x34')]=qs[_0x8f27('0x34')](_0x475f28['query'][_0x8f27('0x34')]);_0x5d6a5f[_0x8f27('0x33')]=qs[_0x8f27('0x33')](_0x475f28['query']['offset']);}_0x5d6a5f[_0x8f27('0x4b')]=qs[_0x8f27('0x4c')](_0x475f28['query'][_0x8f27('0x4c')]);_0x5d6a5f[_0x8f27('0x4d')]=qs['filters'](_[_0x8f27('0x4e')](_0x475f28[_0x8f27('0x41')],_0x1de6b8[_0x8f27('0x43')]),_0xf31391);if(_0x475f28[_0x8f27('0x41')][_0x8f27('0x4f')]){_0x5d6a5f[_0x8f27('0x4d')]=_[_0x8f27('0x50')](_0x5d6a5f[_0x8f27('0x4d')],{'$or':_[_0x8f27('0x3d')](_0xf31391,function(_0x7774ca){if(_0x7774ca['type']!==_0x8f27('0x51')){var _0x271c3e={};_0x271c3e[_0x7774ca[_0x8f27('0x3b')]]={'$like':'%'+_0x475f28[_0x8f27('0x41')][_0x8f27('0x4f')]+'%'};return _0x271c3e;}})});}_0x5d6a5f=_[_0x8f27('0x50')]({},_0x5d6a5f,_0x475f28[_0x8f27('0x52')]);var _0x3e78d6={'where':_0x5d6a5f[_0x8f27('0x4d')]};return db[_0x8f27('0x3e')][_0x8f27('0x32')](_0x3e78d6)[_0x8f27('0x24')](function(_0x140a05){_0x29f5ab['count']=_0x140a05;if(_0x475f28[_0x8f27('0x41')]['includeAll']){_0x5d6a5f[_0x8f27('0x53')]=[{'all':!![]}];}return db[_0x8f27('0x3e')][_0x8f27('0x54')](_0x5d6a5f);})[_0x8f27('0x24')](function(_0x4595ff){_0x29f5ab[_0x8f27('0x55')]=_0x4595ff;return _0x29f5ab;})[_0x8f27('0x24')](respondWithFilteredResult(_0x5d7ecf,_0x5d6a5f))[_0x8f27('0x2d')](handleError(_0x5d7ecf,null));};exports[_0x8f27('0x56')]=function(_0x379afd,_0x416b76){var _0xe489e1={'raw':!![],'where':{'id':_0x379afd[_0x8f27('0x57')]['id']}},_0x543973={};_0x543973[_0x8f27('0x45')]=_[_0x8f27('0x42')](db['FaxMessage'][_0x8f27('0x3f')]);_0x543973['query']=_[_0x8f27('0x42')](_0x379afd['query']);_0x543973[_0x8f27('0x43')]=_[_0x8f27('0x44')](_0x543973[_0x8f27('0x45')],_0x543973['query']);_0xe489e1[_0x8f27('0x47')]=_[_0x8f27('0x44')](_0x543973[_0x8f27('0x45')],qs[_0x8f27('0x46')](_0x379afd[_0x8f27('0x41')][_0x8f27('0x46')]));_0xe489e1[_0x8f27('0x47')]=_0xe489e1[_0x8f27('0x47')][_0x8f27('0x48')]?_0xe489e1[_0x8f27('0x47')]:_0x543973[_0x8f27('0x45')];if(_0x379afd[_0x8f27('0x41')][_0x8f27('0x58')]){_0xe489e1[_0x8f27('0x53')]=[{'all':!![]}];}_0xe489e1=_[_0x8f27('0x50')]({},_0xe489e1,_0x379afd[_0x8f27('0x52')]);return db[_0x8f27('0x3e')][_0x8f27('0x59')](_0xe489e1)['then'](handleEntityNotFound(_0x416b76,null))[_0x8f27('0x24')](respondWithResult(_0x416b76,null))[_0x8f27('0x2d')](handleError(_0x416b76,null));};exports[_0x8f27('0x5a')]=function(_0x18b5f4,_0x2cc840){if(_0x18b5f4[_0x8f27('0x5b')]['id']){delete _0x18b5f4[_0x8f27('0x5b')]['id'];}return db[_0x8f27('0x3e')][_0x8f27('0x59')]({'where':{'id':_0x18b5f4[_0x8f27('0x57')]['id']}})[_0x8f27('0x24')](handleEntityNotFound(_0x2cc840,null))[_0x8f27('0x24')](saveUpdates(_0x18b5f4[_0x8f27('0x5b')],null))[_0x8f27('0x24')](respondWithResult(_0x2cc840,null))['catch'](handleError(_0x2cc840,null));};exports['destroy']=function(_0x3b01b5,_0x3dc54e){return db[_0x8f27('0x3e')]['find']({'where':{'id':_0x3b01b5[_0x8f27('0x57')]['id']}})[_0x8f27('0x24')](handleEntityNotFound(_0x3dc54e,null))[_0x8f27('0x24')](removeEntity(_0x3dc54e,null))[_0x8f27('0x2d')](handleError(_0x3dc54e,null));};exports['describe']=function(_0x4fff1c,_0x256c41){return db['FaxMessage'][_0x8f27('0x5c')]()[_0x8f27('0x24')](respondWithResult(_0x256c41,null))[_0x8f27('0x2d')](handleError(_0x256c41,null));};var interaction_log=require(_0x8f27('0x17'))(_0x8f27('0x5d'));exports[_0x8f27('0x5e')]=function(_0x3411db,_0x4d8ab2,_0x4bd506){var _0x14a52b={'agent':{},'channel':_0x8f27('0x5f')};if(_0x3411db[_0x8f27('0x5b')]['id']){delete _0x3411db[_0x8f27('0x5b')]['id'];}_0x3411db[_0x8f27('0x5b')][_0x8f27('0x60')]=!![];_0x3411db[_0x8f27('0x5b')][_0x8f27('0x61')]=moment()[_0x8f27('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x3411db['body'][_0x8f27('0x63')]=_0x3411db[_0x8f27('0x5b')]['UserId']||_0x3411db[_0x8f27('0x64')]['id'];_0x14a52b[_0x8f27('0x65')]['id']=_0x3411db[_0x8f27('0x5b')][_0x8f27('0x63')];return db['FaxMessage']['find']({'where':{'id':_0x3411db[_0x8f27('0x57')]['id'],'UserId':null},'include':[{'model':db[_0x8f27('0x66')],'as':_0x8f27('0x67')}]})[_0x8f27('0x24')](handleEntityNotFound(_0x4d8ab2,null))[_0x8f27('0x24')](saveUpdates(_0x3411db[_0x8f27('0x5b')],null))[_0x8f27('0x24')](function(_0x39b7b8){if(_0x39b7b8){_0x14a52b[_0x8f27('0x2a')]=_0x39b7b8[_0x8f27('0x68')]({'plain':!![]});return db['FaxInteraction'][_0x8f27('0x59')]({'where':{'id':_0x39b7b8[_0x8f27('0x69')]}});}return null;})[_0x8f27('0x24')](handleEntityNotFound(_0x4d8ab2,null))[_0x8f27('0x24')](function(_0x4ce3ce){if(_0x4ce3ce){return _0x4ce3ce[_0x8f27('0x5a')]({'UserId':_0x3411db[_0x8f27('0x5b')]['UserId'],'read1stAt':_['isNil'](_0x4ce3ce[_0x8f27('0x6a')])?moment()[_0x8f27('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x8f27('0x24')](function(_0x5c80a9){if(_0x5c80a9){_0x14a52b[_0x8f27('0x6b')]=_0x5c80a9[_0x8f27('0x68')]({'plain':!![]});interaction_log[_0x8f27('0x2b')](_0x8f27('0x6c'),_0x3411db['user']['id'],_0x3411db['user'][_0x8f27('0x3b')],_0x3411db[_0x8f27('0x64')][_0x8f27('0x6d')],_0x14a52b['interaction']['id'],_0x3411db[_0x8f27('0x5b')]?JSON[_0x8f27('0x27')](_0x3411db[_0x8f27('0x5b')]):'null');return respondWithRpcPromise(_0x8f27('0x6e'),_0x8f27('0x6f'),_0x14a52b);}return null;})[_0x8f27('0x24')](function(_0x18eddc){return db['CmContact']['describe']()[_0x8f27('0x24')](function(_0x444b08){var _0x510d39=[];for(var _0x58c333=0x0;_0x58c333=_0x5df57e){_0xfcfd91=_0x5df57e;_0x1aa801=0xc8;}else{_0x1aa801=0xce;}_0x241ec7['status'](_0x1aa801);return _0x241ec7[_0x7d94('0x25')](_0x7d94('0x26'),_0xea5bee+'-'+_0xfcfd91+'/'+_0x5df57e)[_0x7d94('0x20')](_0x214d17);}return null;};}function patchUpdates(_0x5045c3){return function(_0x4771b8){try{jsonpatch[_0x7d94('0x27')](_0x4771b8,_0x5045c3,!![]);}catch(_0x200e42){return BPromise['reject'](_0x200e42);}return _0x4771b8[_0x7d94('0x28')]();};}function saveUpdates(_0x1d2a95,_0x36aec8){return function(_0x39f6e1){if(_0x39f6e1){return _0x39f6e1[_0x7d94('0x29')](_0x1d2a95)[_0x7d94('0x2a')](function(_0x23b1bd){return _0x23b1bd;});}return null;};}function removeEntity(_0x69e9d8,_0x488c2e){return function(_0x266681){if(_0x266681){return _0x266681[_0x7d94('0x2b')]()[_0x7d94('0x2a')](function(){var _0xc0a980=_0x266681[_0x7d94('0x2c')]({'plain':!![]});var _0x3c2fcb=_0x7d94('0x2d');return db[_0x7d94('0x2e')]['destroy']({'where':{'type':_0x3c2fcb,'resourceId':_0xc0a980['id']}})[_0x7d94('0x2a')](function(){return _0x266681;});})[_0x7d94('0x2a')](function(){_0x69e9d8[_0x7d94('0x1e')](0xcc)[_0x7d94('0x1f')]();});}};}function handleEntityNotFound(_0x586b7f,_0x324478){return function(_0x26df2c){if(!_0x26df2c){_0x586b7f[_0x7d94('0x1d')](0x194);}return _0x26df2c;};}function handleError(_0x2b2c58,_0x4b7c48){_0x4b7c48=_0x4b7c48||0x1f4;return function(_0x5eeb23){logger['error'](_0x5eeb23[_0x7d94('0x2f')]);if(_0x5eeb23[_0x7d94('0x30')]){delete _0x5eeb23[_0x7d94('0x30')];}_0x2b2c58[_0x7d94('0x1e')](_0x4b7c48)[_0x7d94('0x31')](_0x5eeb23);};}exports['index']=function(_0x5812e3,_0x1b0bf0){var _0x17564f={},_0x5ed067={},_0x2d399c={'count':0x0,'rows':[]};var _0xd013c5=_['map'](db[_0x7d94('0x32')][_0x7d94('0x33')],function(_0x115834){return{'name':_0x115834[_0x7d94('0x34')],'type':_0x115834['type'][_0x7d94('0x35')]};});_0x5ed067[_0x7d94('0x36')]=_[_0x7d94('0x37')](_0xd013c5,_0x7d94('0x30'));_0x5ed067[_0x7d94('0x38')]=_[_0x7d94('0x39')](_0x5812e3[_0x7d94('0x38')]);_0x5ed067[_0x7d94('0x3a')]=_['intersection'](_0x5ed067['model'],_0x5ed067[_0x7d94('0x38')]);_0x17564f[_0x7d94('0x3b')]=_[_0x7d94('0x3c')](_0x5ed067[_0x7d94('0x36')],qs[_0x7d94('0x3d')](_0x5812e3[_0x7d94('0x38')][_0x7d94('0x3d')]));_0x17564f[_0x7d94('0x3b')]=_0x17564f[_0x7d94('0x3b')][_0x7d94('0x3e')]?_0x17564f[_0x7d94('0x3b')]:_0x5ed067[_0x7d94('0x36')];if(!_0x5812e3[_0x7d94('0x38')]['hasOwnProperty'](_0x7d94('0x3f'))){_0x17564f[_0x7d94('0x23')]=qs[_0x7d94('0x23')](_0x5812e3['query'][_0x7d94('0x23')]);_0x17564f[_0x7d94('0x21')]=qs['offset'](_0x5812e3[_0x7d94('0x38')][_0x7d94('0x21')]);}_0x17564f[_0x7d94('0x40')]=qs['sort'](_0x5812e3[_0x7d94('0x38')][_0x7d94('0x41')]);_0x17564f[_0x7d94('0x42')]=qs['filters'](_[_0x7d94('0x43')](_0x5812e3[_0x7d94('0x38')],_0x5ed067[_0x7d94('0x3a')]),_0xd013c5);if(_0x5812e3[_0x7d94('0x38')][_0x7d94('0x44')]){_0x17564f[_0x7d94('0x42')]=_[_0x7d94('0x45')](_0x17564f[_0x7d94('0x42')],{'$or':_[_0x7d94('0x37')](_0xd013c5,function(_0x501f25){if(_0x501f25[_0x7d94('0x46')]!==_0x7d94('0x47')){var _0x40b7d5={};_0x40b7d5[_0x501f25['name']]={'$like':'%'+_0x5812e3[_0x7d94('0x38')][_0x7d94('0x44')]+'%'};return _0x40b7d5;}})});}_0x17564f=_[_0x7d94('0x45')]({},_0x17564f,_0x5812e3[_0x7d94('0x48')]);var _0x297ea5={'where':_0x17564f[_0x7d94('0x42')]};return db[_0x7d94('0x32')][_0x7d94('0x24')](_0x297ea5)['then'](function(_0x57dac2){_0x2d399c[_0x7d94('0x24')]=_0x57dac2;if(_0x5812e3[_0x7d94('0x38')][_0x7d94('0x49')]){_0x17564f[_0x7d94('0x4a')]=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x17564f);})[_0x7d94('0x2a')](function(_0x2a03cf){_0x2d399c['rows']=_0x2a03cf;return _0x2d399c;})[_0x7d94('0x2a')](respondWithFilteredResult(_0x1b0bf0,_0x17564f))[_0x7d94('0x4b')](handleError(_0x1b0bf0,null));};exports[_0x7d94('0x4c')]=function(_0x55caa8,_0x32d605){var _0x5df18f={'raw':!![],'where':{'id':_0x55caa8[_0x7d94('0x4d')]['id']}},_0x4ea2ec={};_0x4ea2ec[_0x7d94('0x36')]=_[_0x7d94('0x39')](db['FaxQueue'][_0x7d94('0x33')]);_0x4ea2ec[_0x7d94('0x38')]=_[_0x7d94('0x39')](_0x55caa8['query']);_0x4ea2ec['filters']=_[_0x7d94('0x3c')](_0x4ea2ec['model'],_0x4ea2ec[_0x7d94('0x38')]);_0x5df18f[_0x7d94('0x3b')]=_[_0x7d94('0x3c')](_0x4ea2ec[_0x7d94('0x36')],qs[_0x7d94('0x3d')](_0x55caa8[_0x7d94('0x38')][_0x7d94('0x3d')]));_0x5df18f[_0x7d94('0x3b')]=_0x5df18f[_0x7d94('0x3b')][_0x7d94('0x3e')]?_0x5df18f[_0x7d94('0x3b')]:_0x4ea2ec[_0x7d94('0x36')];if(_0x55caa8[_0x7d94('0x38')][_0x7d94('0x49')]){_0x5df18f[_0x7d94('0x4a')]=[{'all':!![]}];}_0x5df18f=_[_0x7d94('0x45')]({},_0x5df18f,_0x55caa8['options']);return db['FaxQueue'][_0x7d94('0x4e')](_0x5df18f)['then'](handleEntityNotFound(_0x32d605,null))[_0x7d94('0x2a')](respondWithResult(_0x32d605,null))['catch'](handleError(_0x32d605,null));};exports[_0x7d94('0x4f')]=function(_0x23d593,_0x3b75a7){return db['FaxQueue'][_0x7d94('0x4f')](_0x23d593['body'],{})['then'](function(_0x58464c){var _0x7a4bf7=_0x23d593[_0x7d94('0x50')]['get']({'plain':!![]});if(!_0x7a4bf7)throw new Error(_0x7d94('0x51'));if(_0x7a4bf7[_0x7d94('0x52')]===_0x7d94('0x50')){var _0x3b5989=_0x58464c[_0x7d94('0x2c')]({'plain':!![]});var _0x39cd1b=_0x7d94('0x2d');return db[_0x7d94('0x53')]['find']({'where':{'name':_0x39cd1b,'userProfileId':_0x7a4bf7['userProfileId']},'raw':!![]})['then'](function(_0x116b2a){if(_0x116b2a&&_0x116b2a['autoAssociation']===0x0){return db[_0x7d94('0x2e')][_0x7d94('0x4f')]({'name':_0x3b5989[_0x7d94('0x30')],'resourceId':_0x3b5989['id'],'type':_0x116b2a[_0x7d94('0x30')],'sectionId':_0x116b2a['id']},{})[_0x7d94('0x2a')](function(){return _0x58464c;});}else{return _0x58464c;}})[_0x7d94('0x4b')](function(_0x1040d7){logger[_0x7d94('0x54')](_0x7d94('0x55'),_0x1040d7);throw _0x1040d7;});}return _0x58464c;})[_0x7d94('0x2a')](respondWithResult(_0x3b75a7,0xc9))['catch'](handleError(_0x3b75a7,null));};exports[_0x7d94('0x29')]=function(_0x17e7b1,_0x1b4f9d){if(_0x17e7b1[_0x7d94('0x56')]['id']){delete _0x17e7b1['body']['id'];}return db[_0x7d94('0x32')][_0x7d94('0x4e')]({'where':{'id':_0x17e7b1['params']['id']}})[_0x7d94('0x2a')](handleEntityNotFound(_0x1b4f9d,null))['then'](saveUpdates(_0x17e7b1[_0x7d94('0x56')],null))[_0x7d94('0x2a')](respondWithResult(_0x1b4f9d,null))['catch'](handleError(_0x1b4f9d,null));};exports['destroy']=function(_0x2dacb3,_0x2201d7){return db[_0x7d94('0x32')][_0x7d94('0x4e')]({'where':{'id':_0x2dacb3[_0x7d94('0x4d')]['id']}})[_0x7d94('0x2a')](handleEntityNotFound(_0x2201d7,null))[_0x7d94('0x2a')](removeEntity(_0x2201d7,null))[_0x7d94('0x4b')](handleError(_0x2201d7,null));};exports[_0x7d94('0x57')]=function(_0x2f058c,_0x366f2a){return db[_0x7d94('0x32')][_0x7d94('0x57')]()['then'](respondWithResult(_0x366f2a,null))['catch'](handleError(_0x366f2a,null));};exports[_0x7d94('0x58')]=function(_0x5c1c77,_0x1c2fb1,_0x4e07ce){var _0x5530b4={'raw':!![],'where':{}},_0x2c617b={},_0x25c2a4;return db[_0x7d94('0x32')][_0x7d94('0x59')]({'where':{'id':_0x5c1c77[_0x7d94('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1c2fb1,null))[_0x7d94('0x2a')](function(_0x2af83d){if(_0x2af83d){_0x25c2a4=_0x2af83d[_0x7d94('0x2c')]({'plain':!![]});_0x2c617b[_0x7d94('0x36')]=_[_0x7d94('0x39')](db[_0x7d94('0x5a')][_0x7d94('0x33')]);_0x2c617b[_0x7d94('0x38')]=_[_0x7d94('0x39')](_0x5c1c77[_0x7d94('0x38')]);_0x2c617b[_0x7d94('0x3a')]=_['intersection'](_0x2c617b[_0x7d94('0x36')],_0x2c617b[_0x7d94('0x38')]);_0x5530b4[_0x7d94('0x3b')]=_[_0x7d94('0x3c')](_0x2c617b['model'],qs['fields'](_0x5c1c77['query'][_0x7d94('0x3d')]));_0x5530b4[_0x7d94('0x3b')]=_0x5530b4[_0x7d94('0x3b')][_0x7d94('0x3e')]?_0x5530b4['attributes']:_0x2c617b['model'];if(!_0x5c1c77[_0x7d94('0x38')][_0x7d94('0x5b')](_0x7d94('0x3f'))){_0x5530b4[_0x7d94('0x23')]=qs['limit'](_0x5c1c77['query']['limit']);_0x5530b4[_0x7d94('0x21')]=qs['offset'](_0x5c1c77[_0x7d94('0x38')][_0x7d94('0x21')]);}_0x5530b4[_0x7d94('0x40')]=qs[_0x7d94('0x41')](_0x5c1c77[_0x7d94('0x38')][_0x7d94('0x41')]);_0x5530b4[_0x7d94('0x42')]=qs[_0x7d94('0x3a')](_[_0x7d94('0x43')](_0x5c1c77['query'],_0x2c617b[_0x7d94('0x3a')]));_0x5530b4['where'][_0x7d94('0x5c')]=_0x2af83d['id'];if(_0x5c1c77[_0x7d94('0x38')][_0x7d94('0x44')]){_0x5530b4[_0x7d94('0x42')]=_[_0x7d94('0x45')](_0x5530b4[_0x7d94('0x42')],{'$or':_[_0x7d94('0x37')](_0x5530b4[_0x7d94('0x3b')],function(_0x4ea4b2){var _0x53d84d={};_0x53d84d[_0x4ea4b2]={'$like':'%'+_0x5c1c77['query'][_0x7d94('0x44')]+'%'};return _0x53d84d;})});}_0x5530b4=_[_0x7d94('0x45')]({},_0x5530b4,_0x5c1c77[_0x7d94('0x48')]);return db[_0x7d94('0x5a')][_0x7d94('0x5d')](_0x5530b4);}})['then'](function(_0x3a5227){if(_0x3a5227){return db[_0x7d94('0x5e')][_0x7d94('0x5f')]({'where':{'id':_[_0x7d94('0x37')](_0x3a5227,_0x7d94('0x60')),'role':_0x7d94('0x61')},'attributes':['id',_0x7d94('0x30'),_0x7d94('0x62'),'updatedAt','createdAt']});}})['then'](function(_0x1e14e9){if(_0x1e14e9){return{'count':_0x1e14e9[_0x7d94('0x24')],'rows':_[_0x7d94('0x37')](_0x1e14e9[_0x7d94('0x63')],function(_0x480ad6){return{'membername':_0x480ad6[_0x7d94('0x30')],'UserId':_0x480ad6['id'],'queue_name':_0x25c2a4[_0x7d94('0x30')],'FaxQueueId':_0x25c2a4['id'],'interface':util[_0x7d94('0x64')]('%s/%s',_0x7d94('0x65'),_0x480ad6[_0x7d94('0x30')]),'penalty':0x0,'paused':_0x480ad6[_0x7d94('0x62')],'createdAt':_0x480ad6[_0x7d94('0x66')],'updatedAt':_0x480ad6[_0x7d94('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1c2fb1,_0x5530b4))[_0x7d94('0x4b')](handleError(_0x1c2fb1,null));};exports[_0x7d94('0x68')]=function(_0x4f1b52,_0x1f4f76,_0x13ca7b){var _0x181547={};var _0x594630={};var _0x1d99d7;var _0x173147;return db[_0x7d94('0x32')]['findOne']({'where':{'id':_0x4f1b52['params']['id']}})['then'](handleEntityNotFound(_0x1f4f76,null))[_0x7d94('0x2a')](function(_0x4d6e5b){if(_0x4d6e5b){_0x1d99d7=_0x4d6e5b;_0x594630['model']=_['keys'](db[_0x7d94('0x69')]['rawAttributes']);_0x594630[_0x7d94('0x38')]=_[_0x7d94('0x39')](_0x4f1b52['query']);_0x594630[_0x7d94('0x3a')]=_[_0x7d94('0x3c')](_0x594630[_0x7d94('0x36')],_0x594630[_0x7d94('0x38')]);_0x181547[_0x7d94('0x3b')]=_['intersection'](_0x594630[_0x7d94('0x36')],qs[_0x7d94('0x3d')](_0x4f1b52[_0x7d94('0x38')]['fields']));_0x181547[_0x7d94('0x3b')]=_0x181547[_0x7d94('0x3b')]['length']?_0x181547[_0x7d94('0x3b')]:_0x594630[_0x7d94('0x36')];_0x181547[_0x7d94('0x40')]=qs[_0x7d94('0x41')](_0x4f1b52['query'][_0x7d94('0x41')]);_0x181547[_0x7d94('0x42')]=qs[_0x7d94('0x3a')](_[_0x7d94('0x43')](_0x4f1b52[_0x7d94('0x38')],_0x594630[_0x7d94('0x3a')]));if(_0x4f1b52[_0x7d94('0x38')]['filter']){_0x181547[_0x7d94('0x42')]=_[_0x7d94('0x45')](_0x181547['where'],{'$or':_[_0x7d94('0x37')](_0x181547['attributes'],function(_0x2f3e6b){var _0x4ca8fb={};_0x4ca8fb[_0x2f3e6b]={'$like':'%'+_0x4f1b52[_0x7d94('0x38')][_0x7d94('0x44')]+'%'};return _0x4ca8fb;})});}_0x181547=_[_0x7d94('0x45')]({},_0x181547,_0x4f1b52[_0x7d94('0x48')]);return _0x1d99d7['getTeams'](_0x181547);}})[_0x7d94('0x2a')](function(_0x31a1ce){if(_0x31a1ce){_0x173147=_0x31a1ce[_0x7d94('0x3e')];if(!_0x4f1b52[_0x7d94('0x38')][_0x7d94('0x5b')](_0x7d94('0x3f'))){_0x181547[_0x7d94('0x23')]=qs[_0x7d94('0x23')](_0x4f1b52[_0x7d94('0x38')]['limit']);_0x181547[_0x7d94('0x21')]=qs['offset'](_0x4f1b52[_0x7d94('0x38')]['offset']);}return _0x1d99d7[_0x7d94('0x68')](_0x181547);}})['then'](function(_0x3899e8){if(_0x3899e8){return _0x3899e8?{'count':_0x173147,'rows':_0x3899e8}:null;}})['then'](respondWithResult(_0x1f4f76,null))[_0x7d94('0x4b')](handleError(_0x1f4f76,null));};exports[_0x7d94('0x6a')]=function(_0x345972,_0x94258f,_0x4d1202){var _0x2c2cfd=_0x345972[_0x7d94('0x56')][_0x7d94('0x6b')];return db['Team'][_0x7d94('0x5d')]({'where':{'id':_0x2c2cfd},'attributes':['id'],'include':[{'model':db[_0x7d94('0x5e')],'as':_0x7d94('0x6c'),'attributes':['id',_0x7d94('0x30'),'online',_0x7d94('0x6d'),_0x7d94('0x6e')],'raw':!![]}]})[_0x7d94('0x2a')](function(_0x703ed){if(_0x703ed){var _0x49c10d=_[_0x7d94('0x6f')](_0x703ed,function(_0x2637aa){var _0x35f561=_0x2637aa[_0x7d94('0x2c')]({'plain':!![]});return _0x35f561[_0x7d94('0x6c')];});return db[_0x7d94('0x32')][_0x7d94('0x4e')]({'where':{'id':_0x345972['params']['id']}})[_0x7d94('0x2a')](function(_0xc6f275){return db[_0x7d94('0x70')][_0x7d94('0x71')](function(_0x560adc){return _0xc6f275[_0x7d94('0x6a')](_0x2c2cfd,{'transaction':_0x560adc})['then'](function(){return BPromise[_0x7d94('0x72')](_0x49c10d,function(_0x52511b){return db[_0x7d94('0x5a')][_0x7d94('0x73')]({'where':{'UserId':_0x52511b['id'],'FaxQueueId':_0x345972['params']['id']},'transaction':_0x560adc});});})[_0x7d94('0x2a')](function(){_0x49c10d[_0x7d94('0x74')](function(_0x105f90){socket['emit'](_0x7d94('0x75'),{'UserId':_0x105f90['id'],'FaxQueueId':_0xc6f275['id']});});});});});}})[_0x7d94('0x2a')](respondWithStatusCode(_0x94258f,null))[_0x7d94('0x4b')](handleError(_0x94258f,null));};exports[_0x7d94('0x76')]=function(_0x3270be,_0x5b90f6,_0x468bf8){return db[_0x7d94('0x69')][_0x7d94('0x5d')]({'where':{'id':_0x3270be[_0x7d94('0x38')][_0x7d94('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x7d94('0x5e')],'as':_0x7d94('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x7d94('0x2a')](handleEntityNotFound(_0x5b90f6,null))[_0x7d94('0x2a')](function(_0x4e1a24){var _0x24569f=_['map'](_0x4e1a24,'id');var _0x2afc5a=[];var _0x46cb73=[];var _0x2072ef=squel['select']();_0x2072ef[_0x7d94('0x77')](_0x7d94('0x78'))['from'](_0x7d94('0x79'),'tq')['join'](_0x7d94('0x7a'),'ut',_0x7d94('0x7b'))[_0x7d94('0x42')](_0x7d94('0x7c'),_0x3270be['params']['id']);for(var _0x57ddd9=0x0;_0x57ddd9<_0x4e1a24[_0x7d94('0x3e')];_0x57ddd9+=0x1){let _0x210a06=_0x4e1a24[_0x57ddd9];for(var _0x1ab28e=0x0;_0x1ab28e<_0x210a06[_0x7d94('0x6c')][_0x7d94('0x3e')];_0x1ab28e+=0x1){let _0x52cd22=_0x210a06[_0x7d94('0x6c')][_0x1ab28e];var _0x31847b=_0x2072ef['clone']();_0x31847b[_0x7d94('0x42')]('ut.UserId\x20=\x20?',_0x52cd22['id']);_0x46cb73[_0x7d94('0x7d')](db[_0x7d94('0x70')]['query'](_0x31847b['toString'](),{'type':db[_0x7d94('0x70')][_0x7d94('0x7e')][_0x7d94('0x7f')]})[_0x7d94('0x2a')](function(_0x36c489){if(_0x36c489['length']===0x1){return _0x52cd22['id'];}else{var _0x13a293=_[_0x7d94('0x80')](_[_0x7d94('0x37')](_0x36c489,_0x7d94('0x81')),function(_0x5124a5){return _['includes'](_0x24569f,_0x5124a5);});if(_0x13a293){return _0x52cd22['id'];}}}));}}return BPromise['all'](_0x46cb73)[_0x7d94('0x2a')](function(_0x499da1){_0x2afc5a=_(_0x2afc5a)[_0x7d94('0x82')](_0x499da1)['compact']()[_0x7d94('0x83')]();return db[_0x7d94('0x32')][_0x7d94('0x4e')]({'where':{'id':_0x3270be[_0x7d94('0x4d')]['id']}})[_0x7d94('0x2a')](function(_0x4b348c){return db['sequelize'][_0x7d94('0x71')](function(_0x35502a){return _0x4b348c['removeTeams'](_0x3270be['query'][_0x7d94('0x6b')],{'transaction':_0x35502a})[_0x7d94('0x2a')](function(){if(!_[_0x7d94('0x84')](_0x2afc5a)){return _0x4b348c['removeAgents'](_0x2afc5a,{'transaction':_0x35502a});}})[_0x7d94('0x2a')](function(){_0x2afc5a[_0x7d94('0x74')](function(_0x1175e2){socket['emit'](_0x7d94('0x85'),{'UserId':_0x1175e2,'FaxQueueId':_0x4b348c['id']});});});});});});})[_0x7d94('0x2a')](respondWithStatusCode(_0x5b90f6,null))[_0x7d94('0x4b')](handleError(_0x5b90f6,null));};exports[_0x7d94('0x86')]=function(_0x2f9efc,_0x17fdf8,_0x15cf9d){return db[_0x7d94('0x32')][_0x7d94('0x4e')]({'where':{'id':_0x2f9efc[_0x7d94('0x4d')]['id']}})[_0x7d94('0x2a')](handleEntityNotFound(_0x17fdf8,null))[_0x7d94('0x2a')](function(_0x36c007){if(_0x36c007){return _0x36c007[_0x7d94('0x86')](_0x2f9efc[_0x7d94('0x56')][_0x7d94('0x6b')],_[_0x7d94('0x87')](_0x2f9efc[_0x7d94('0x56')],['ids','id'])||{})[_0x7d94('0x88')](function(_0xd6fd4){for(var _0x16f4e7=0x0;_0x16f4e7<_0x2f9efc[_0x7d94('0x56')][_0x7d94('0x6b')][_0x7d94('0x3e')];_0x16f4e7+=0x1){socket[_0x7d94('0x89')](_0x7d94('0x75'),{'UserId':_0x2f9efc['body']['ids'][_0x16f4e7],'FaxQueueId':_0x2f9efc[_0x7d94('0x4d')]['id']});}return _0xd6fd4;});}})[_0x7d94('0x2a')](respondWithResult(_0x17fdf8,null))['catch'](handleError(_0x17fdf8,null));};exports[_0x7d94('0x8a')]=function(_0x18514e,_0x66f88a,_0x114905){return db[_0x7d94('0x32')]['find']({'where':{'id':_0x18514e[_0x7d94('0x4d')]['id']}})['then'](handleEntityNotFound(_0x66f88a,null))[_0x7d94('0x2a')](function(_0x59772f){if(_0x59772f){return _0x59772f['removeAgents'](_0x18514e['query'][_0x7d94('0x6b')])[_0x7d94('0x2a')](function(){if(_[_0x7d94('0x8b')](_0x18514e[_0x7d94('0x38')]['ids'])){for(var _0x29d66c=0x0;_0x29d66c<_0x18514e[_0x7d94('0x38')][_0x7d94('0x6b')][_0x7d94('0x3e')];_0x29d66c+=0x1){socket[_0x7d94('0x89')](_0x7d94('0x85'),{'UserId':Number(_0x18514e[_0x7d94('0x38')][_0x7d94('0x6b')][_0x29d66c]),'FaxQueueId':Number(_0x18514e['params']['id'])});}}else{socket[_0x7d94('0x89')]('userFaxQueue:remove',{'UserId':Number(_0x18514e['query'][_0x7d94('0x6b')]),'FaxQueueId':Number(_0x18514e[_0x7d94('0x4d')]['id'])});}});}})[_0x7d94('0x2a')](respondWithStatusCode(_0x66f88a,null))[_0x7d94('0x4b')](handleError(_0x66f88a,null));};exports['getAgents']=function(_0x55a0d5,_0x495ae8,_0x44fd73){var _0x23f33b={};var _0x3f174f={};var _0x367039;var _0x507689;return db[_0x7d94('0x32')][_0x7d94('0x59')]({'where':{'id':_0x55a0d5[_0x7d94('0x4d')]['id']}})[_0x7d94('0x2a')](handleEntityNotFound(_0x495ae8,null))[_0x7d94('0x2a')](function(_0x376f97){if(_0x376f97){_0x367039=_0x376f97;_0x3f174f[_0x7d94('0x36')]=_['keys'](db[_0x7d94('0x5e')][_0x7d94('0x33')]);_0x3f174f['query']=_[_0x7d94('0x39')](_0x55a0d5[_0x7d94('0x38')]);_0x3f174f[_0x7d94('0x3a')]=_[_0x7d94('0x3c')](_0x3f174f[_0x7d94('0x36')],_0x3f174f['query']);_0x23f33b[_0x7d94('0x3b')]=_[_0x7d94('0x3c')](_0x3f174f[_0x7d94('0x36')],qs[_0x7d94('0x3d')](_0x55a0d5['query'][_0x7d94('0x3d')]));_0x23f33b[_0x7d94('0x3b')]=_0x23f33b[_0x7d94('0x3b')]['length']?_0x23f33b['attributes']:_0x3f174f[_0x7d94('0x36')];_0x23f33b[_0x7d94('0x40')]=qs[_0x7d94('0x41')](_0x55a0d5[_0x7d94('0x38')][_0x7d94('0x41')]);_0x23f33b[_0x7d94('0x42')]=qs[_0x7d94('0x3a')](_[_0x7d94('0x43')](_0x55a0d5[_0x7d94('0x38')],_0x3f174f['filters']));if(_0x55a0d5[_0x7d94('0x38')]['filter']){_0x23f33b[_0x7d94('0x42')]=_['merge'](_0x23f33b[_0x7d94('0x42')],{'$or':_[_0x7d94('0x37')](_0x23f33b[_0x7d94('0x3b')],function(_0xb7df24){var _0x3d5789={};_0x3d5789[_0xb7df24]={'$like':'%'+_0x55a0d5['query'][_0x7d94('0x44')]+'%'};return _0x3d5789;})});}_0x23f33b=_[_0x7d94('0x45')]({},_0x23f33b,_0x55a0d5['options']);return _0x367039['getAgents'](_0x23f33b);}})[_0x7d94('0x2a')](function(_0xe8fc47){if(_0xe8fc47){_0x507689=_0xe8fc47['length'];if(!_0x55a0d5[_0x7d94('0x38')][_0x7d94('0x5b')](_0x7d94('0x3f'))){_0x23f33b['limit']=qs[_0x7d94('0x23')](_0x55a0d5[_0x7d94('0x38')][_0x7d94('0x23')]);_0x23f33b[_0x7d94('0x21')]=qs[_0x7d94('0x21')](_0x55a0d5['query']['offset']);}return _0x367039[_0x7d94('0x8c')](_0x23f33b);}})['then'](function(_0x18642f){if(_0x18642f){return _0x18642f?{'count':_0x507689,'rows':_0x18642f}:null;}})['then'](respondWithResult(_0x495ae8,null))[_0x7d94('0x4b')](handleError(_0x495ae8,null));}; \ No newline at end of file +var _0x2502=['findOne','UserFaxQueue','FaxQueueId','updatedAt','createdAt','rows','format','%s/%s','SIP','faxPause','getTeams','Team','hasOwnProperty','addTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize','each','forEach','emit','userFaxQueue:save','removeTeams','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','union','value','addAgents','spread','removeAgents','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','sendStatus','error','stack','name','index','map','FaxQueue','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','catch','params','rawAttributes','options','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe'];(function(_0xbf09ab,_0x251a19){var _0x2a9aef=function(_0x22d793){while(--_0x22d793){_0xbf09ab['push'](_0xbf09ab['shift']());}};_0x2a9aef(++_0x251a19);}(_0x2502,0x141));var _0x2250=function(_0x3bb830,_0xa498c1){_0x3bb830=_0x3bb830-0x0;var _0x309778=_0x2502[_0x3bb830];return _0x309778;};'use strict';var emlformat=require(_0x2250('0x0'));var rimraf=require(_0x2250('0x1'));var zipdir=require(_0x2250('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2250('0x3'));var moment=require(_0x2250('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2250('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2250('0x6'));var fs=require('fs');var fs_extra=require(_0x2250('0x7'));var _=require(_0x2250('0x8'));var squel=require('squel');var crypto=require(_0x2250('0x9'));var jsforce=require(_0x2250('0xa'));var deskjs=require(_0x2250('0xb'));var toCsv=require(_0x2250('0xc'));var querystring=require(_0x2250('0xd'));var Papa=require('papaparse');var Redis=require(_0x2250('0xe'));var authService=require(_0x2250('0xf'));var qs=require(_0x2250('0x10'));var as=require(_0x2250('0x11'));var hardwareService=require(_0x2250('0x12'));var logger=require(_0x2250('0x13'))(_0x2250('0x14'));var utils=require(_0x2250('0x15'));var config=require(_0x2250('0x16'));var licenseUtil=require(_0x2250('0x17'));var db=require('../../mysqldb')['db'];config[_0x2250('0x18')]=_[_0x2250('0x19')](config[_0x2250('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x2250('0x1a'))(new Redis(config[_0x2250('0x18')]));require('./faxQueue.socket')[_0x2250('0x1b')](socket);function respondWithStatusCode(_0xd19360,_0x4b9ed1){_0x4b9ed1=_0x4b9ed1||0xcc;return function(_0x352d3b){if(_0x352d3b){return _0xd19360['sendStatus'](_0x4b9ed1);}return _0xd19360[_0x2250('0x1c')](_0x4b9ed1)[_0x2250('0x1d')]();};}function respondWithResult(_0x1ddf00,_0x4e73c5){_0x4e73c5=_0x4e73c5||0xc8;return function(_0x2bd47c){if(_0x2bd47c){return _0x1ddf00[_0x2250('0x1c')](_0x4e73c5)[_0x2250('0x1e')](_0x2bd47c);}};}function respondWithFilteredResult(_0x34cf20,_0xe48f4e){return function(_0x48aa3c){if(_0x48aa3c){var _0x2d733c=typeof _0xe48f4e[_0x2250('0x1f')]==='undefined'&&typeof _0xe48f4e['limit']===_0x2250('0x20');var _0x220a63=_0x48aa3c[_0x2250('0x21')];var _0x58245a=_0x2d733c?0x0:_0xe48f4e[_0x2250('0x1f')];var _0x3103fe=_0x2d733c?_0x48aa3c[_0x2250('0x21')]:_0xe48f4e[_0x2250('0x1f')]+_0xe48f4e['limit'];var _0x6ee0b1;if(_0x3103fe>=_0x220a63){_0x3103fe=_0x220a63;_0x6ee0b1=0xc8;}else{_0x6ee0b1=0xce;}_0x34cf20[_0x2250('0x1c')](_0x6ee0b1);return _0x34cf20[_0x2250('0x22')](_0x2250('0x23'),_0x58245a+'-'+_0x3103fe+'/'+_0x220a63)['json'](_0x48aa3c);}return null;};}function patchUpdates(_0x4aef9f){return function(_0x4c96be){try{jsonpatch[_0x2250('0x24')](_0x4c96be,_0x4aef9f,!![]);}catch(_0x54fef6){return BPromise[_0x2250('0x25')](_0x54fef6);}return _0x4c96be[_0x2250('0x26')]();};}function saveUpdates(_0x4238e9,_0x31c08b){return function(_0x56f9f1){if(_0x56f9f1){return _0x56f9f1[_0x2250('0x27')](_0x4238e9)[_0x2250('0x28')](function(_0x29cd38){return _0x29cd38;});}return null;};}function removeEntity(_0x52d1dd,_0x298bc1){return function(_0x2e2c14){if(_0x2e2c14){return _0x2e2c14[_0x2250('0x29')]()['then'](function(){var _0x20de71=_0x2e2c14[_0x2250('0x2a')]({'plain':!![]});var _0x12a9a4=_0x2250('0x2b');return db['UserProfileResource'][_0x2250('0x29')]({'where':{'type':_0x12a9a4,'resourceId':_0x20de71['id']}})[_0x2250('0x28')](function(){return _0x2e2c14;});})[_0x2250('0x28')](function(){_0x52d1dd[_0x2250('0x1c')](0xcc)[_0x2250('0x1d')]();});}};}function handleEntityNotFound(_0x279edc,_0x1bd31d){return function(_0x32c091){if(!_0x32c091){_0x279edc[_0x2250('0x2c')](0x194);}return _0x32c091;};}function handleError(_0x20cbe2,_0x4f90e7){_0x4f90e7=_0x4f90e7||0x1f4;return function(_0x388786){logger[_0x2250('0x2d')](_0x388786[_0x2250('0x2e')]);if(_0x388786[_0x2250('0x2f')]){delete _0x388786['name'];}_0x20cbe2[_0x2250('0x1c')](_0x4f90e7)['send'](_0x388786);};}exports[_0x2250('0x30')]=function(_0x405e1a,_0x593f9f){var _0x3fc7f1={},_0x51daa3={},_0x158835={'count':0x0,'rows':[]};var _0x458cb5=_[_0x2250('0x31')](db[_0x2250('0x32')]['rawAttributes'],function(_0x5bec11){return{'name':_0x5bec11['fieldName'],'type':_0x5bec11[_0x2250('0x33')][_0x2250('0x34')]};});_0x51daa3['model']=_[_0x2250('0x31')](_0x458cb5,'name');_0x51daa3[_0x2250('0x35')]=_[_0x2250('0x36')](_0x405e1a['query']);_0x51daa3[_0x2250('0x37')]=_['intersection'](_0x51daa3[_0x2250('0x38')],_0x51daa3['query']);_0x3fc7f1[_0x2250('0x39')]=_[_0x2250('0x3a')](_0x51daa3[_0x2250('0x38')],qs[_0x2250('0x3b')](_0x405e1a['query'][_0x2250('0x3b')]));_0x3fc7f1[_0x2250('0x39')]=_0x3fc7f1['attributes'][_0x2250('0x3c')]?_0x3fc7f1[_0x2250('0x39')]:_0x51daa3['model'];if(!_0x405e1a[_0x2250('0x35')]['hasOwnProperty'](_0x2250('0x3d'))){_0x3fc7f1[_0x2250('0x3e')]=qs['limit'](_0x405e1a[_0x2250('0x35')][_0x2250('0x3e')]);_0x3fc7f1[_0x2250('0x1f')]=qs[_0x2250('0x1f')](_0x405e1a[_0x2250('0x35')][_0x2250('0x1f')]);}_0x3fc7f1[_0x2250('0x3f')]=qs[_0x2250('0x40')](_0x405e1a[_0x2250('0x35')]['sort']);_0x3fc7f1['where']=qs[_0x2250('0x37')](_[_0x2250('0x41')](_0x405e1a[_0x2250('0x35')],_0x51daa3['filters']),_0x458cb5);if(_0x405e1a[_0x2250('0x35')][_0x2250('0x42')]){_0x3fc7f1[_0x2250('0x43')]=_['merge'](_0x3fc7f1[_0x2250('0x43')],{'$or':_[_0x2250('0x31')](_0x458cb5,function(_0x2053b7){if(_0x2053b7[_0x2250('0x33')]!==_0x2250('0x44')){var _0x542a80={};_0x542a80[_0x2053b7['name']]={'$like':'%'+_0x405e1a[_0x2250('0x35')]['filter']+'%'};return _0x542a80;}})});}_0x3fc7f1=_[_0x2250('0x45')]({},_0x3fc7f1,_0x405e1a['options']);var _0x273c52={'where':_0x3fc7f1['where']};return db[_0x2250('0x32')][_0x2250('0x21')](_0x273c52)[_0x2250('0x28')](function(_0x1b9fbb){_0x158835[_0x2250('0x21')]=_0x1b9fbb;if(_0x405e1a[_0x2250('0x35')][_0x2250('0x46')]){_0x3fc7f1[_0x2250('0x47')]=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x3fc7f1);})[_0x2250('0x28')](function(_0x7aaf98){_0x158835['rows']=_0x7aaf98;return _0x158835;})['then'](respondWithFilteredResult(_0x593f9f,_0x3fc7f1))[_0x2250('0x48')](handleError(_0x593f9f,null));};exports['show']=function(_0x2fb66e,_0x3dabf1){var _0x5886ed={'raw':!![],'where':{'id':_0x2fb66e[_0x2250('0x49')]['id']}},_0x4ebeb0={};_0x4ebeb0[_0x2250('0x38')]=_[_0x2250('0x36')](db[_0x2250('0x32')][_0x2250('0x4a')]);_0x4ebeb0[_0x2250('0x35')]=_[_0x2250('0x36')](_0x2fb66e['query']);_0x4ebeb0[_0x2250('0x37')]=_[_0x2250('0x3a')](_0x4ebeb0[_0x2250('0x38')],_0x4ebeb0[_0x2250('0x35')]);_0x5886ed[_0x2250('0x39')]=_[_0x2250('0x3a')](_0x4ebeb0['model'],qs['fields'](_0x2fb66e['query'][_0x2250('0x3b')]));_0x5886ed['attributes']=_0x5886ed['attributes'][_0x2250('0x3c')]?_0x5886ed['attributes']:_0x4ebeb0['model'];if(_0x2fb66e['query'][_0x2250('0x46')]){_0x5886ed[_0x2250('0x47')]=[{'all':!![]}];}_0x5886ed=_['merge']({},_0x5886ed,_0x2fb66e[_0x2250('0x4b')]);return db[_0x2250('0x32')][_0x2250('0x4c')](_0x5886ed)['then'](handleEntityNotFound(_0x3dabf1,null))[_0x2250('0x28')](respondWithResult(_0x3dabf1,null))['catch'](handleError(_0x3dabf1,null));};exports['create']=function(_0x415416,_0x569408){return db[_0x2250('0x32')][_0x2250('0x4d')](_0x415416['body'],{})[_0x2250('0x28')](function(_0x19fcb9){var _0x382885=_0x415416[_0x2250('0x4e')][_0x2250('0x2a')]({'plain':!![]});if(!_0x382885)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x382885[_0x2250('0x4f')]===_0x2250('0x4e')){var _0x5e2688=_0x19fcb9[_0x2250('0x2a')]({'plain':!![]});var _0x45d619=_0x2250('0x2b');return db[_0x2250('0x50')][_0x2250('0x4c')]({'where':{'name':_0x45d619,'userProfileId':_0x382885[_0x2250('0x51')]},'raw':!![]})[_0x2250('0x28')](function(_0x2ad8a5){if(_0x2ad8a5&&_0x2ad8a5[_0x2250('0x52')]===0x0){return db[_0x2250('0x53')][_0x2250('0x4d')]({'name':_0x5e2688[_0x2250('0x2f')],'resourceId':_0x5e2688['id'],'type':_0x2ad8a5['name'],'sectionId':_0x2ad8a5['id']},{})[_0x2250('0x28')](function(){return _0x19fcb9;});}else{return _0x19fcb9;}})[_0x2250('0x48')](function(_0x5e050a){logger[_0x2250('0x2d')](_0x2250('0x54'),_0x5e050a);throw _0x5e050a;});}return _0x19fcb9;})['then'](respondWithResult(_0x569408,0xc9))['catch'](handleError(_0x569408,null));};exports['update']=function(_0x1dba05,_0x420e3f){if(_0x1dba05[_0x2250('0x55')]['id']){delete _0x1dba05['body']['id'];}return db['FaxQueue'][_0x2250('0x4c')]({'where':{'id':_0x1dba05[_0x2250('0x49')]['id']}})[_0x2250('0x28')](handleEntityNotFound(_0x420e3f,null))[_0x2250('0x28')](saveUpdates(_0x1dba05[_0x2250('0x55')],null))[_0x2250('0x28')](respondWithResult(_0x420e3f,null))[_0x2250('0x48')](handleError(_0x420e3f,null));};exports['destroy']=function(_0xbca4b9,_0x1620ae){return db[_0x2250('0x32')][_0x2250('0x4c')]({'where':{'id':_0xbca4b9[_0x2250('0x49')]['id']}})[_0x2250('0x28')](handleEntityNotFound(_0x1620ae,null))[_0x2250('0x28')](removeEntity(_0x1620ae,null))[_0x2250('0x48')](handleError(_0x1620ae,null));};exports[_0x2250('0x56')]=function(_0x500447,_0x374a46){return db[_0x2250('0x32')][_0x2250('0x56')]()[_0x2250('0x28')](respondWithResult(_0x374a46,null))['catch'](handleError(_0x374a46,null));};exports['getMembers']=function(_0x40d51a,_0x2068a4,_0x57679e){var _0x4b3c57={'raw':!![],'where':{}},_0x23f2ca={},_0x48db19;return db['FaxQueue'][_0x2250('0x57')]({'where':{'id':_0x40d51a[_0x2250('0x49')]['id']}})[_0x2250('0x28')](handleEntityNotFound(_0x2068a4,null))[_0x2250('0x28')](function(_0xe15c92){if(_0xe15c92){_0x48db19=_0xe15c92['get']({'plain':!![]});_0x23f2ca[_0x2250('0x38')]=_[_0x2250('0x36')](db[_0x2250('0x58')][_0x2250('0x4a')]);_0x23f2ca['query']=_['keys'](_0x40d51a[_0x2250('0x35')]);_0x23f2ca[_0x2250('0x37')]=_[_0x2250('0x3a')](_0x23f2ca[_0x2250('0x38')],_0x23f2ca['query']);_0x4b3c57['attributes']=_[_0x2250('0x3a')](_0x23f2ca[_0x2250('0x38')],qs[_0x2250('0x3b')](_0x40d51a['query'][_0x2250('0x3b')]));_0x4b3c57[_0x2250('0x39')]=_0x4b3c57[_0x2250('0x39')][_0x2250('0x3c')]?_0x4b3c57[_0x2250('0x39')]:_0x23f2ca['model'];if(!_0x40d51a['query']['hasOwnProperty'](_0x2250('0x3d'))){_0x4b3c57[_0x2250('0x3e')]=qs[_0x2250('0x3e')](_0x40d51a[_0x2250('0x35')][_0x2250('0x3e')]);_0x4b3c57[_0x2250('0x1f')]=qs['offset'](_0x40d51a[_0x2250('0x35')][_0x2250('0x1f')]);}_0x4b3c57[_0x2250('0x3f')]=qs[_0x2250('0x40')](_0x40d51a[_0x2250('0x35')][_0x2250('0x40')]);_0x4b3c57[_0x2250('0x43')]=qs[_0x2250('0x37')](_[_0x2250('0x41')](_0x40d51a[_0x2250('0x35')],_0x23f2ca[_0x2250('0x37')]));_0x4b3c57[_0x2250('0x43')][_0x2250('0x59')]=_0xe15c92['id'];if(_0x40d51a['query'][_0x2250('0x42')]){_0x4b3c57[_0x2250('0x43')]=_['merge'](_0x4b3c57['where'],{'$or':_[_0x2250('0x31')](_0x4b3c57[_0x2250('0x39')],function(_0x4b027a){var _0x51c87d={};_0x51c87d[_0x4b027a]={'$like':'%'+_0x40d51a[_0x2250('0x35')][_0x2250('0x42')]+'%'};return _0x51c87d;})});}_0x4b3c57=_['merge']({},_0x4b3c57,_0x40d51a['options']);return db[_0x2250('0x58')]['findAll'](_0x4b3c57);}})[_0x2250('0x28')](function(_0xc3d4a3){if(_0xc3d4a3){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0xc3d4a3,'UserId'),'role':'agent'},'attributes':['id',_0x2250('0x2f'),'faxPause',_0x2250('0x5a'),_0x2250('0x5b')]});}})[_0x2250('0x28')](function(_0x2c19a2){if(_0x2c19a2){return{'count':_0x2c19a2[_0x2250('0x21')],'rows':_[_0x2250('0x31')](_0x2c19a2[_0x2250('0x5c')],function(_0xafe5f3){return{'membername':_0xafe5f3[_0x2250('0x2f')],'UserId':_0xafe5f3['id'],'queue_name':_0x48db19[_0x2250('0x2f')],'FaxQueueId':_0x48db19['id'],'interface':util[_0x2250('0x5d')](_0x2250('0x5e'),_0x2250('0x5f'),_0xafe5f3[_0x2250('0x2f')]),'penalty':0x0,'paused':_0xafe5f3[_0x2250('0x60')],'createdAt':_0xafe5f3[_0x2250('0x5b')],'updatedAt':_0xafe5f3[_0x2250('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2250('0x28')](respondWithFilteredResult(_0x2068a4,_0x4b3c57))[_0x2250('0x48')](handleError(_0x2068a4,null));};exports[_0x2250('0x61')]=function(_0x22729c,_0x1454f0,_0x292b74){var _0x147f3e={};var _0x46ff3d={};var _0x105bfe;var _0x5859bc;return db[_0x2250('0x32')][_0x2250('0x57')]({'where':{'id':_0x22729c[_0x2250('0x49')]['id']}})['then'](handleEntityNotFound(_0x1454f0,null))[_0x2250('0x28')](function(_0x4c3442){if(_0x4c3442){_0x105bfe=_0x4c3442;_0x46ff3d['model']=_[_0x2250('0x36')](db[_0x2250('0x62')][_0x2250('0x4a')]);_0x46ff3d[_0x2250('0x35')]=_[_0x2250('0x36')](_0x22729c[_0x2250('0x35')]);_0x46ff3d[_0x2250('0x37')]=_['intersection'](_0x46ff3d[_0x2250('0x38')],_0x46ff3d['query']);_0x147f3e[_0x2250('0x39')]=_[_0x2250('0x3a')](_0x46ff3d[_0x2250('0x38')],qs['fields'](_0x22729c['query']['fields']));_0x147f3e[_0x2250('0x39')]=_0x147f3e[_0x2250('0x39')][_0x2250('0x3c')]?_0x147f3e['attributes']:_0x46ff3d[_0x2250('0x38')];_0x147f3e[_0x2250('0x3f')]=qs[_0x2250('0x40')](_0x22729c[_0x2250('0x35')]['sort']);_0x147f3e[_0x2250('0x43')]=qs['filters'](_['pick'](_0x22729c[_0x2250('0x35')],_0x46ff3d[_0x2250('0x37')]));if(_0x22729c['query'][_0x2250('0x42')]){_0x147f3e['where']=_[_0x2250('0x45')](_0x147f3e['where'],{'$or':_[_0x2250('0x31')](_0x147f3e[_0x2250('0x39')],function(_0x281870){var _0x60424d={};_0x60424d[_0x281870]={'$like':'%'+_0x22729c[_0x2250('0x35')][_0x2250('0x42')]+'%'};return _0x60424d;})});}_0x147f3e=_['merge']({},_0x147f3e,_0x22729c[_0x2250('0x4b')]);return _0x105bfe['getTeams'](_0x147f3e);}})[_0x2250('0x28')](function(_0xfe2563){if(_0xfe2563){_0x5859bc=_0xfe2563[_0x2250('0x3c')];if(!_0x22729c['query'][_0x2250('0x63')](_0x2250('0x3d'))){_0x147f3e['limit']=qs[_0x2250('0x3e')](_0x22729c['query'][_0x2250('0x3e')]);_0x147f3e[_0x2250('0x1f')]=qs[_0x2250('0x1f')](_0x22729c[_0x2250('0x35')][_0x2250('0x1f')]);}return _0x105bfe[_0x2250('0x61')](_0x147f3e);}})[_0x2250('0x28')](function(_0x19f85b){if(_0x19f85b){return _0x19f85b?{'count':_0x5859bc,'rows':_0x19f85b}:null;}})[_0x2250('0x28')](respondWithResult(_0x1454f0,null))[_0x2250('0x48')](handleError(_0x1454f0,null));};exports[_0x2250('0x64')]=function(_0x42dcc7,_0x2f3166,_0x2cd5ce){var _0x1a2f81=_0x42dcc7[_0x2250('0x55')][_0x2250('0x65')];return db[_0x2250('0x62')][_0x2250('0x66')]({'where':{'id':_0x1a2f81},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2250('0x67'),'attributes':['id',_0x2250('0x2f'),_0x2250('0x68'),_0x2250('0x69'),_0x2250('0x6a')],'raw':!![]}]})['then'](function(_0x664334){if(_0x664334){var _0x14a564=_[_0x2250('0x6b')](_0x664334,function(_0x37c0fd){var _0x242655=_0x37c0fd[_0x2250('0x2a')]({'plain':!![]});return _0x242655['Agents'];});return db[_0x2250('0x32')][_0x2250('0x4c')]({'where':{'id':_0x42dcc7[_0x2250('0x49')]['id']}})[_0x2250('0x28')](function(_0x4cba22){return db[_0x2250('0x6c')]['transaction'](function(_0x4ac947){return _0x4cba22[_0x2250('0x64')](_0x1a2f81,{'transaction':_0x4ac947})[_0x2250('0x28')](function(){return BPromise[_0x2250('0x6d')](_0x14a564,function(_0x58fba2){return db[_0x2250('0x58')]['findOrCreate']({'where':{'UserId':_0x58fba2['id'],'FaxQueueId':_0x42dcc7['params']['id']},'transaction':_0x4ac947});});})['then'](function(){_0x14a564[_0x2250('0x6e')](function(_0x4cbf80){socket[_0x2250('0x6f')](_0x2250('0x70'),{'UserId':_0x4cbf80['id'],'FaxQueueId':_0x4cba22['id']});});});});});}})[_0x2250('0x28')](respondWithStatusCode(_0x2f3166,null))[_0x2250('0x48')](handleError(_0x2f3166,null));};exports[_0x2250('0x71')]=function(_0x564d00,_0x1be96e,_0x4468c4){return db['Team'][_0x2250('0x66')]({'where':{'id':_0x564d00[_0x2250('0x35')][_0x2250('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1be96e,null))[_0x2250('0x28')](function(_0x38c190){var _0x438246=_[_0x2250('0x31')](_0x38c190,'id');var _0x2cec42=[];var _0x75881a=[];var _0x23f572=squel['select']();_0x23f572[_0x2250('0x72')](_0x2250('0x73'))[_0x2250('0x74')](_0x2250('0x75'),'tq')['join'](_0x2250('0x76'),'ut',_0x2250('0x77'))[_0x2250('0x43')](_0x2250('0x78'),_0x564d00[_0x2250('0x49')]['id']);for(var _0x21d3b2=0x0;_0x21d3b2<_0x38c190['length'];_0x21d3b2+=0x1){let _0x3fb3dc=_0x38c190[_0x21d3b2];for(var _0x3b87fc=0x0;_0x3b87fc<_0x3fb3dc[_0x2250('0x67')][_0x2250('0x3c')];_0x3b87fc+=0x1){let _0x27fd18=_0x3fb3dc[_0x2250('0x67')][_0x3b87fc];var _0x3c967e=_0x23f572[_0x2250('0x79')]();_0x3c967e[_0x2250('0x43')](_0x2250('0x7a'),_0x27fd18['id']);_0x75881a['push'](db[_0x2250('0x6c')][_0x2250('0x35')](_0x3c967e[_0x2250('0x7b')](),{'type':db[_0x2250('0x6c')][_0x2250('0x7c')]['SELECT']})[_0x2250('0x28')](function(_0xafb74d){if(_0xafb74d[_0x2250('0x3c')]===0x1){return _0x27fd18['id'];}else{var _0x13bc50=_[_0x2250('0x7d')](_[_0x2250('0x31')](_0xafb74d,_0x2250('0x7e')),function(_0xdacc03){return _['includes'](_0x438246,_0xdacc03);});if(_0x13bc50){return _0x27fd18['id'];}}}));}}return BPromise[_0x2250('0x7f')](_0x75881a)[_0x2250('0x28')](function(_0x3256f5){_0x2cec42=_(_0x2cec42)[_0x2250('0x80')](_0x3256f5)['compact']()[_0x2250('0x81')]();return db['FaxQueue'][_0x2250('0x4c')]({'where':{'id':_0x564d00[_0x2250('0x49')]['id']}})[_0x2250('0x28')](function(_0x1cca76){return db[_0x2250('0x6c')]['transaction'](function(_0x2d6834){return _0x1cca76['removeTeams'](_0x564d00[_0x2250('0x35')][_0x2250('0x65')],{'transaction':_0x2d6834})[_0x2250('0x28')](function(){if(!_['isEmpty'](_0x2cec42)){return _0x1cca76['removeAgents'](_0x2cec42,{'transaction':_0x2d6834});}})[_0x2250('0x28')](function(){_0x2cec42[_0x2250('0x6e')](function(_0x43a78c){socket[_0x2250('0x6f')]('userFaxQueue:remove',{'UserId':_0x43a78c,'FaxQueueId':_0x1cca76['id']});});});});});});})[_0x2250('0x28')](respondWithStatusCode(_0x1be96e,null))['catch'](handleError(_0x1be96e,null));};exports['addAgents']=function(_0xd144e5,_0x3b3b87,_0x25fd34){return db[_0x2250('0x32')]['find']({'where':{'id':_0xd144e5[_0x2250('0x49')]['id']}})['then'](handleEntityNotFound(_0x3b3b87,null))[_0x2250('0x28')](function(_0x47e4be){if(_0x47e4be){return _0x47e4be[_0x2250('0x82')](_0xd144e5[_0x2250('0x55')][_0x2250('0x65')],_['omit'](_0xd144e5[_0x2250('0x55')],[_0x2250('0x65'),'id'])||{})[_0x2250('0x83')](function(_0x39d032){for(var _0x520163=0x0;_0x520163<_0xd144e5[_0x2250('0x55')]['ids']['length'];_0x520163+=0x1){socket[_0x2250('0x6f')](_0x2250('0x70'),{'UserId':_0xd144e5['body'][_0x2250('0x65')][_0x520163],'FaxQueueId':_0xd144e5[_0x2250('0x49')]['id']});}return _0x39d032;});}})[_0x2250('0x28')](respondWithResult(_0x3b3b87,null))[_0x2250('0x48')](handleError(_0x3b3b87,null));};exports[_0x2250('0x84')]=function(_0x442600,_0x198fef,_0x303bef){return db[_0x2250('0x32')][_0x2250('0x4c')]({'where':{'id':_0x442600[_0x2250('0x49')]['id']}})[_0x2250('0x28')](handleEntityNotFound(_0x198fef,null))[_0x2250('0x28')](function(_0x28e087){if(_0x28e087){return _0x28e087['removeAgents'](_0x442600[_0x2250('0x35')][_0x2250('0x65')])['then'](function(){if(_[_0x2250('0x85')](_0x442600[_0x2250('0x35')][_0x2250('0x65')])){for(var _0x2fa558=0x0;_0x2fa558<_0x442600[_0x2250('0x35')]['ids'][_0x2250('0x3c')];_0x2fa558+=0x1){socket[_0x2250('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0x442600['query'][_0x2250('0x65')][_0x2fa558]),'FaxQueueId':Number(_0x442600[_0x2250('0x49')]['id'])});}}else{socket[_0x2250('0x6f')](_0x2250('0x86'),{'UserId':Number(_0x442600[_0x2250('0x35')][_0x2250('0x65')]),'FaxQueueId':Number(_0x442600[_0x2250('0x49')]['id'])});}});}})[_0x2250('0x28')](respondWithStatusCode(_0x198fef,null))['catch'](handleError(_0x198fef,null));};exports[_0x2250('0x87')]=function(_0x22e471,_0x42cf47,_0x2a741a){var _0x3bbc30={};var _0x3018c9={};var _0x1e49bd;var _0x2746b0;return db[_0x2250('0x32')][_0x2250('0x57')]({'where':{'id':_0x22e471[_0x2250('0x49')]['id']}})[_0x2250('0x28')](handleEntityNotFound(_0x42cf47,null))[_0x2250('0x28')](function(_0x197262){if(_0x197262){_0x1e49bd=_0x197262;_0x3018c9[_0x2250('0x38')]=_[_0x2250('0x36')](db['User'][_0x2250('0x4a')]);_0x3018c9[_0x2250('0x35')]=_[_0x2250('0x36')](_0x22e471['query']);_0x3018c9[_0x2250('0x37')]=_[_0x2250('0x3a')](_0x3018c9[_0x2250('0x38')],_0x3018c9['query']);_0x3bbc30[_0x2250('0x39')]=_[_0x2250('0x3a')](_0x3018c9[_0x2250('0x38')],qs['fields'](_0x22e471[_0x2250('0x35')]['fields']));_0x3bbc30['attributes']=_0x3bbc30[_0x2250('0x39')][_0x2250('0x3c')]?_0x3bbc30[_0x2250('0x39')]:_0x3018c9['model'];_0x3bbc30[_0x2250('0x3f')]=qs[_0x2250('0x40')](_0x22e471[_0x2250('0x35')][_0x2250('0x40')]);_0x3bbc30[_0x2250('0x43')]=qs[_0x2250('0x37')](_[_0x2250('0x41')](_0x22e471[_0x2250('0x35')],_0x3018c9['filters']));if(_0x22e471[_0x2250('0x35')][_0x2250('0x42')]){_0x3bbc30[_0x2250('0x43')]=_[_0x2250('0x45')](_0x3bbc30['where'],{'$or':_[_0x2250('0x31')](_0x3bbc30['attributes'],function(_0x40e029){var _0x11152c={};_0x11152c[_0x40e029]={'$like':'%'+_0x22e471[_0x2250('0x35')][_0x2250('0x42')]+'%'};return _0x11152c;})});}_0x3bbc30=_[_0x2250('0x45')]({},_0x3bbc30,_0x22e471[_0x2250('0x4b')]);return _0x1e49bd[_0x2250('0x87')](_0x3bbc30);}})['then'](function(_0xbe265c){if(_0xbe265c){_0x2746b0=_0xbe265c[_0x2250('0x3c')];if(!_0x22e471[_0x2250('0x35')][_0x2250('0x63')]('nolimit')){_0x3bbc30[_0x2250('0x3e')]=qs[_0x2250('0x3e')](_0x22e471['query'][_0x2250('0x3e')]);_0x3bbc30[_0x2250('0x1f')]=qs[_0x2250('0x1f')](_0x22e471[_0x2250('0x35')][_0x2250('0x1f')]);}return _0x1e49bd[_0x2250('0x87')](_0x3bbc30);}})['then'](function(_0x3e9128){if(_0x3e9128){return _0x3e9128?{'count':_0x2746b0,'rows':_0x3e9128}:null;}})[_0x2250('0x28')](respondWithResult(_0x42cf47,null))['catch'](handleError(_0x42cf47,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 736136a..bb4c488 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 _0xeb15=['../../mysqldb','FaxQueue','setMaxListeners','save','update','emit','hasOwnProperty','exports','events'];(function(_0x277289,_0x41f961){var _0x5d7735=function(_0x28926d){while(--_0x28926d){_0x277289['push'](_0x277289['shift']());}};_0x5d7735(++_0x41f961);}(_0xeb15,0x1ca));var _0x5eb1=function(_0x2a403a,_0x4ec334){_0x2a403a=_0x2a403a-0x0;var _0x3a0f0d=_0xeb15[_0x2a403a];return _0x3a0f0d;};'use strict';var EventEmitter=require(_0x5eb1('0x0'));var FaxQueue=require(_0x5eb1('0x1'))['db'][_0x5eb1('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5eb1('0x3')](0x0);var events={'afterCreate':_0x5eb1('0x4'),'afterUpdate':_0x5eb1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5603dc){return function(_0x3bc378,_0x40f47c,_0x381eb4){FaxQueueEvents[_0x5eb1('0x6')](_0x5603dc+':'+_0x3bc378['id'],_0x3bc378);FaxQueueEvents[_0x5eb1('0x6')](_0x5603dc,_0x3bc378);_0x381eb4(null);};}for(var e in events){if(events[_0x5eb1('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x5eb1('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0xbd4b=['save','update','emit','hasOwnProperty','hook','exports','events','FaxQueue','setMaxListeners'];(function(_0x327e47,_0x1f69a3){var _0xd2b5cd=function(_0x53feec){while(--_0x53feec){_0x327e47['push'](_0x327e47['shift']());}};_0xd2b5cd(++_0x1f69a3);}(_0xbd4b,0xcc));var _0xbbd4=function(_0x3904e5,_0x5c5eb5){_0x3904e5=_0x3904e5-0x0;var _0x38caee=_0xbd4b[_0x3904e5];return _0x38caee;};'use strict';var EventEmitter=require(_0xbbd4('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xbbd4('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xbbd4('0x2')](0x0);var events={'afterCreate':_0xbbd4('0x3'),'afterUpdate':_0xbbd4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f553d){return function(_0x42de66,_0x28ffce,_0x47f167){FaxQueueEvents[_0xbbd4('0x5')](_0x2f553d+':'+_0x42de66['id'],_0x42de66);FaxQueueEvents[_0xbbd4('0x5')](_0x2f553d,_0x42de66);_0x47f167(null);};}for(var e in events){if(events[_0xbbd4('0x6')](e)){var event=events[e];FaxQueue[_0xbbd4('0x7')](e,emitEvent(event));}}module[_0xbbd4('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index a77c989..3435811 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 _0x5b6b=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','../../config/logger','bluebird','request-promise'];(function(_0x1b9d9f,_0x4162a7){var _0x3ad4e6=function(_0x1af759){while(--_0x1af759){_0x1b9d9f['push'](_0x1b9d9f['shift']());}};_0x3ad4e6(++_0x4162a7);}(_0x5b6b,0x17d));var _0xb5b6=function(_0x987255,_0x5c6354){_0x987255=_0x987255-0x0;var _0x1ed652=_0x5b6b[_0x987255];return _0x1ed652;};'use strict';var _=require(_0xb5b6('0x0'));var util=require('util');var logger=require(_0xb5b6('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb5b6('0x2'));var rp=require(_0xb5b6('0x3'));var fs=require('fs');var path=require(_0xb5b6('0x4'));var rimraf=require(_0xb5b6('0x5'));var config=require(_0xb5b6('0x6'));var attributes=require(_0xb5b6('0x7'));module[_0xb5b6('0x8')]=function(_0x5b3e73,_0x123ba3){return _0x5b3e73[_0xb5b6('0x9')]('FaxQueue',attributes,{'tableName':_0xb5b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83b1=['request-promise','path','rimraf','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment'];(function(_0x582818,_0x1ea6ee){var _0xdedbe5=function(_0x4bbe6a){while(--_0x4bbe6a){_0x582818['push'](_0x582818['shift']());}};_0xdedbe5(++_0x1ea6ee);}(_0x83b1,0xaf));var _0x183b=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x83b1[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x183b('0x0'));var util=require(_0x183b('0x1'));var logger=require(_0x183b('0x2'))(_0x183b('0x3'));var moment=require(_0x183b('0x4'));var BPromise=require('bluebird');var rp=require(_0x183b('0x5'));var fs=require('fs');var path=require(_0x183b('0x6'));var rimraf=require(_0x183b('0x7'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0x183b('0x8')]=function(_0x379e74,_0x47e576){return _0x379e74[_0x183b('0x9')](_0x183b('0xa'),attributes,{'tableName':_0x183b('0xb'),'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 2fbc61c..4432238 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 _0xad67=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FaxQueue','options','raw','where','limit','map','include','model','attributes','GetFaxQueue','debug','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring'];(function(_0x258570,_0x2f30ef){var _0x483bc3=function(_0x4a1a7b){while(--_0x4a1a7b){_0x258570['push'](_0x258570['shift']());}};_0x483bc3(++_0x2f30ef);}(_0xad67,0x73));var _0x7ad6=function(_0x5f55b5,_0x372ef9){_0x5f55b5=_0x5f55b5-0x0;var _0x489ba1=_0xad67[_0x5f55b5];return _0x489ba1;};'use strict';var _=require(_0x7ad6('0x0'));var util=require(_0x7ad6('0x1'));var moment=require(_0x7ad6('0x2'));var BPromise=require(_0x7ad6('0x3'));var rs=require(_0x7ad6('0x4'));var fs=require('fs');var Redis=require(_0x7ad6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7ad6('0x6'))(_0x7ad6('0x7'));var config=require(_0x7ad6('0x8'));var jayson=require(_0x7ad6('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x7ad6('0xa')]=_[_0x7ad6('0xb')](config[_0x7ad6('0xa')],{'host':_0x7ad6('0xc'),'port':0x18eb});var socket=require(_0x7ad6('0xd'))(new Redis(config['redis']));require(_0x7ad6('0xe'))[_0x7ad6('0xf')](socket);function respondWithRpcPromise(_0x16d8d2,_0x5d92d0,_0x345b12){return new BPromise(function(_0x2a0ac1,_0x52537f){return client[_0x7ad6('0x10')](_0x16d8d2,_0x345b12)[_0x7ad6('0x11')](function(_0x590415){logger[_0x7ad6('0x12')](_0x7ad6('0x13'),_0x5d92d0,_0x7ad6('0x14'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x5d92d0,'request\x20sent',JSON[_0x7ad6('0x15')](_0x590415));if(_0x590415[_0x7ad6('0x16')]){if(_0x590415['error'][_0x7ad6('0x17')]===0x1f4){logger[_0x7ad6('0x16')]('FaxQueue,\x20%s,\x20%s',_0x5d92d0,_0x590415[_0x7ad6('0x16')]['message']);return _0x52537f(_0x590415[_0x7ad6('0x16')]['message']);}logger[_0x7ad6('0x16')](_0x7ad6('0x13'),_0x5d92d0,_0x590415[_0x7ad6('0x16')][_0x7ad6('0x18')]);return _0x2a0ac1(_0x590415[_0x7ad6('0x16')][_0x7ad6('0x18')]);}else{logger[_0x7ad6('0x12')]('FaxQueue,\x20%s,\x20%s',_0x5d92d0,'request\x20sent');_0x2a0ac1(_0x590415[_0x7ad6('0x19')]['message']);}})[_0x7ad6('0x1a')](function(_0x2ab540){logger['error'](_0x7ad6('0x13'),_0x5d92d0,_0x2ab540);_0x52537f(_0x2ab540);});});}exports['GetFaxQueue']=function(_0x1199cf){var _0x51d7b5=this;return new Promise(function(_0x14302e,_0x41066f){return db[_0x7ad6('0x1b')]['findAll']({'raw':_0x1199cf[_0x7ad6('0x1c')]?_0x1199cf[_0x7ad6('0x1c')][_0x7ad6('0x1d')]===undefined?!![]:![]:!![],'where':_0x1199cf[_0x7ad6('0x1c')]?_0x1199cf[_0x7ad6('0x1c')][_0x7ad6('0x1e')]||null:null,'attributes':_0x1199cf[_0x7ad6('0x1c')]?_0x1199cf[_0x7ad6('0x1c')]['attributes']||null:null,'limit':_0x1199cf[_0x7ad6('0x1c')]?_0x1199cf[_0x7ad6('0x1c')][_0x7ad6('0x1f')]||null:null,'include':_0x1199cf[_0x7ad6('0x1c')]?_0x1199cf['options']['include']?_[_0x7ad6('0x20')](_0x1199cf[_0x7ad6('0x1c')][_0x7ad6('0x21')],function(_0x12d394){return{'model':db[_0x12d394[_0x7ad6('0x22')]],'as':_0x12d394['as'],'attributes':_0x12d394[_0x7ad6('0x23')],'include':_0x12d394['include']?_['map'](_0x12d394[_0x7ad6('0x21')],function(_0x10b805){return{'model':db[_0x10b805[_0x7ad6('0x22')]],'as':_0x10b805['as'],'attributes':_0x10b805[_0x7ad6('0x23')],'include':_0x10b805[_0x7ad6('0x21')]?_[_0x7ad6('0x20')](_0x10b805['include'],function(_0x57dfac){return{'model':db[_0x57dfac['model']],'as':_0x57dfac['as'],'attributes':_0x57dfac[_0x7ad6('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7ad6('0x11')](function(_0x2d5eaa){logger[_0x7ad6('0x12')](_0x7ad6('0x24'),_0x1199cf);logger[_0x7ad6('0x25')](_0x7ad6('0x24'),_0x1199cf,JSON['stringify'](_0x2d5eaa));_0x14302e(_0x2d5eaa);})[_0x7ad6('0x1a')](function(_0x2a8595){logger['error'](_0x7ad6('0x24'),_0x2a8595[_0x7ad6('0x18')],_0x1199cf);_0x41066f(_0x51d7b5[_0x7ad6('0x16')](0x1f4,_0x2a8595[_0x7ad6('0x18')]));});});};exports[_0x7ad6('0x26')]=function(_0x33a789){var _0x4aaa94=this;return new Promise(function(_0xf9f7ae,_0x1fab48){return db[_0x7ad6('0x1b')][_0x7ad6('0x27')]({'raw':_0x33a789['options']?_0x33a789[_0x7ad6('0x1c')][_0x7ad6('0x1d')]===undefined?!![]:![]:!![],'where':_0x33a789[_0x7ad6('0x1c')]?_0x33a789[_0x7ad6('0x1c')]['where']||null:null,'attributes':_0x33a789[_0x7ad6('0x1c')]?_0x33a789['options'][_0x7ad6('0x23')]||null:null,'include':_0x33a789['options']?_0x33a789[_0x7ad6('0x1c')]['include']?_[_0x7ad6('0x20')](_0x33a789['options'][_0x7ad6('0x21')],function(_0xaaebe8){return{'model':db[_0xaaebe8['model']],'as':_0xaaebe8['as'],'attributes':_0xaaebe8[_0x7ad6('0x23')],'include':_0xaaebe8[_0x7ad6('0x21')]?_[_0x7ad6('0x20')](_0xaaebe8[_0x7ad6('0x21')],function(_0x283913){return{'model':db[_0x283913[_0x7ad6('0x22')]],'as':_0x283913['as'],'attributes':_0x283913[_0x7ad6('0x23')],'include':_0x283913[_0x7ad6('0x21')]?_[_0x7ad6('0x20')](_0x283913[_0x7ad6('0x21')],function(_0xa1948d){return{'model':db[_0xa1948d[_0x7ad6('0x22')]],'as':_0xa1948d['as'],'attributes':_0xa1948d[_0x7ad6('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7ad6('0x11')](function(_0x255475){logger[_0x7ad6('0x12')](_0x7ad6('0x26'),_0x33a789);logger['debug']('ShowFaxQueue',_0x33a789,JSON[_0x7ad6('0x15')](_0x255475));_0xf9f7ae(_0x255475);})['catch'](function(_0x5e70df){logger[_0x7ad6('0x16')](_0x7ad6('0x26'),_0x5e70df[_0x7ad6('0x18')],_0x33a789);_0x1fab48(_0x4aaa94[_0x7ad6('0x16')](0x1f4,_0x5e70df[_0x7ad6('0x18')]));});});}; \ No newline at end of file +var _0xb24d=['redis','localhost','register','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','include','map','model','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xb24d,0x1b5));var _0xdb24=function(_0x395715,_0x2247b1){_0x395715=_0x395715-0x0;var _0x157a79=_0xb24d[_0x395715];return _0x157a79;};'use strict';var _=require(_0xdb24('0x0'));var util=require(_0xdb24('0x1'));var moment=require(_0xdb24('0x2'));var BPromise=require(_0xdb24('0x3'));var rs=require(_0xdb24('0x4'));var fs=require('fs');var Redis=require(_0xdb24('0x5'));var db=require(_0xdb24('0x6'))['db'];var utils=require(_0xdb24('0x7'));var logger=require(_0xdb24('0x8'))('rpc');var config=require(_0xdb24('0x9'));var jayson=require(_0xdb24('0xa'));var client=jayson[_0xdb24('0xb')][_0xdb24('0xc')]({'port':0x232a});config['redis']=_[_0xdb24('0xd')](config[_0xdb24('0xe')],{'host':_0xdb24('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdb24('0xe')]));require('./faxQueue.socket')[_0xdb24('0x10')](socket);function respondWithRpcPromise(_0x81d957,_0x5822d1,_0x4065db){return new BPromise(function(_0x195a1f,_0x157541){return client[_0xdb24('0x11')](_0x81d957,_0x4065db)[_0xdb24('0x12')](function(_0x273c93){logger[_0xdb24('0x13')]('FaxQueue,\x20%s,\x20%s',_0x5822d1,_0xdb24('0x14'));logger[_0xdb24('0x15')](_0xdb24('0x16'),_0x5822d1,_0xdb24('0x14'),JSON[_0xdb24('0x17')](_0x273c93));if(_0x273c93[_0xdb24('0x18')]){if(_0x273c93[_0xdb24('0x18')][_0xdb24('0x19')]===0x1f4){logger['error'](_0xdb24('0x1a'),_0x5822d1,_0x273c93[_0xdb24('0x18')][_0xdb24('0x1b')]);return _0x157541(_0x273c93[_0xdb24('0x18')][_0xdb24('0x1b')]);}logger[_0xdb24('0x18')](_0xdb24('0x1a'),_0x5822d1,_0x273c93[_0xdb24('0x18')][_0xdb24('0x1b')]);return _0x195a1f(_0x273c93[_0xdb24('0x18')][_0xdb24('0x1b')]);}else{logger[_0xdb24('0x13')](_0xdb24('0x1a'),_0x5822d1,'request\x20sent');_0x195a1f(_0x273c93[_0xdb24('0x1c')][_0xdb24('0x1b')]);}})[_0xdb24('0x1d')](function(_0x393e5d){logger['error'](_0xdb24('0x1a'),_0x5822d1,_0x393e5d);_0x157541(_0x393e5d);});});}exports[_0xdb24('0x1e')]=function(_0x41ba4d){var _0x35d9b6=this;return new Promise(function(_0x37385f,_0x5f4a23){return db[_0xdb24('0x1f')][_0xdb24('0x20')]({'raw':_0x41ba4d[_0xdb24('0x21')]?_0x41ba4d[_0xdb24('0x21')][_0xdb24('0x22')]===undefined?!![]:![]:!![],'where':_0x41ba4d[_0xdb24('0x21')]?_0x41ba4d[_0xdb24('0x21')][_0xdb24('0x23')]||null:null,'attributes':_0x41ba4d[_0xdb24('0x21')]?_0x41ba4d['options'][_0xdb24('0x24')]||null:null,'limit':_0x41ba4d[_0xdb24('0x21')]?_0x41ba4d[_0xdb24('0x21')]['limit']||null:null,'include':_0x41ba4d[_0xdb24('0x21')]?_0x41ba4d['options'][_0xdb24('0x25')]?_['map'](_0x41ba4d[_0xdb24('0x21')]['include'],function(_0x2d43cd){return{'model':db[_0x2d43cd['model']],'as':_0x2d43cd['as'],'attributes':_0x2d43cd[_0xdb24('0x24')],'include':_0x2d43cd[_0xdb24('0x25')]?_[_0xdb24('0x26')](_0x2d43cd[_0xdb24('0x25')],function(_0x24c58c){return{'model':db[_0x24c58c[_0xdb24('0x27')]],'as':_0x24c58c['as'],'attributes':_0x24c58c['attributes'],'include':_0x24c58c['include']?_['map'](_0x24c58c[_0xdb24('0x25')],function(_0x36f02a){return{'model':db[_0x36f02a[_0xdb24('0x27')]],'as':_0x36f02a['as'],'attributes':_0x36f02a['attributes']};}):[]};}):[]};}):[]:[]})[_0xdb24('0x12')](function(_0x5d25c9){logger[_0xdb24('0x13')](_0xdb24('0x1e'),_0x41ba4d);logger['debug'](_0xdb24('0x1e'),_0x41ba4d,JSON[_0xdb24('0x17')](_0x5d25c9));_0x37385f(_0x5d25c9);})['catch'](function(_0x343a54){logger['error'](_0xdb24('0x1e'),_0x343a54[_0xdb24('0x1b')],_0x41ba4d);_0x5f4a23(_0x35d9b6['error'](0x1f4,_0x343a54[_0xdb24('0x1b')]));});});};exports[_0xdb24('0x28')]=function(_0x810455){var _0x3408f9=this;return new Promise(function(_0x1bd4b6,_0x31f156){return db['FaxQueue']['find']({'raw':_0x810455[_0xdb24('0x21')]?_0x810455[_0xdb24('0x21')][_0xdb24('0x22')]===undefined?!![]:![]:!![],'where':_0x810455[_0xdb24('0x21')]?_0x810455[_0xdb24('0x21')]['where']||null:null,'attributes':_0x810455[_0xdb24('0x21')]?_0x810455[_0xdb24('0x21')][_0xdb24('0x24')]||null:null,'include':_0x810455[_0xdb24('0x21')]?_0x810455[_0xdb24('0x21')][_0xdb24('0x25')]?_[_0xdb24('0x26')](_0x810455[_0xdb24('0x21')][_0xdb24('0x25')],function(_0x4a3d17){return{'model':db[_0x4a3d17[_0xdb24('0x27')]],'as':_0x4a3d17['as'],'attributes':_0x4a3d17['attributes'],'include':_0x4a3d17['include']?_[_0xdb24('0x26')](_0x4a3d17[_0xdb24('0x25')],function(_0x3a2686){return{'model':db[_0x3a2686[_0xdb24('0x27')]],'as':_0x3a2686['as'],'attributes':_0x3a2686['attributes'],'include':_0x3a2686['include']?_[_0xdb24('0x26')](_0x3a2686[_0xdb24('0x25')],function(_0x132dfd){return{'model':db[_0x132dfd[_0xdb24('0x27')]],'as':_0x132dfd['as'],'attributes':_0x132dfd[_0xdb24('0x24')]};}):[]};}):[]};}):[]:[]})[_0xdb24('0x12')](function(_0x2c0f29){logger[_0xdb24('0x13')]('ShowFaxQueue',_0x810455);logger[_0xdb24('0x15')](_0xdb24('0x28'),_0x810455,JSON[_0xdb24('0x17')](_0x2c0f29));_0x1bd4b6(_0x2c0f29);})[_0xdb24('0x1d')](function(_0x48cf70){logger['error'](_0xdb24('0x28'),_0x48cf70['message'],_0x810455);_0x31f156(_0x3408f9[_0xdb24('0x18')](0x1f4,_0x48cf70[_0xdb24('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 0c5c2d2..0f293ac 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 _0x2b59=['register','length','./faxQueue.events','save','remove','emit','removeListener'];(function(_0x65056f,_0x288376){var _0x3ed4bf=function(_0x3b3928){while(--_0x3b3928){_0x65056f['push'](_0x65056f['shift']());}};_0x3ed4bf(++_0x288376);}(_0x2b59,0x1d0));var _0x92b5=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2b59[_0x3ab51d];return _0x29a04e;};'use strict';var FaxQueueEvents=require(_0x92b5('0x0'));var events=[_0x92b5('0x1'),_0x92b5('0x2'),'update'];function createListener(_0x209602,_0xe40ee1){return function(_0x8828b2){_0xe40ee1[_0x92b5('0x3')](_0x209602,_0x8828b2);};}function removeListener(_0x287736,_0x117830){return function(){FaxQueueEvents[_0x92b5('0x4')](_0x287736,_0x117830);};}exports[_0x92b5('0x5')]=function(_0x18f33a){for(var _0x18b7f7=0x0,_0x50d588=events[_0x92b5('0x6')];_0x18b7f7<_0x50d588;_0x18b7f7++){var _0x9c41c4=events[_0x18b7f7];var _0x1d9af2=createListener('faxQueue:'+_0x9c41c4,_0x18f33a);FaxQueueEvents['on'](_0x9c41c4,_0x1d9af2);}}; \ No newline at end of file +var _0xae00=['save','update','removeListener','faxQueue:','./faxQueue.events'];(function(_0x94bcfd,_0x158819){var _0x362808=function(_0x527fd7){while(--_0x527fd7){_0x94bcfd['push'](_0x94bcfd['shift']());}};_0x362808(++_0x158819);}(_0xae00,0x1bc));var _0x0ae0=function(_0x4737a0,_0x36520e){_0x4737a0=_0x4737a0-0x0;var _0x4d558b=_0xae00[_0x4737a0];return _0x4d558b;};'use strict';var FaxQueueEvents=require(_0x0ae0('0x0'));var events=[_0x0ae0('0x1'),'remove',_0x0ae0('0x2')];function createListener(_0xa90493,_0x4b493f){return function(_0x3fba84){_0x4b493f['emit'](_0xa90493,_0x3fba84);};}function removeListener(_0x55f866,_0x57bc84){return function(){FaxQueueEvents[_0x0ae0('0x3')](_0x55f866,_0x57bc84);};}exports['register']=function(_0x48ca98){for(var _0xfd84ec=0x0,_0x5122d5=events['length'];_0xfd84ec<_0x5122d5;_0xfd84ec++){var _0x3c2fde=events[_0xfd84ec];var _0x38b448=createListener(_0x0ae0('0x4')+_0x3c2fde,_0x48ca98);FaxQueueEvents['on'](_0x3c2fde,_0x38b448);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 8bd9b7b..bfeb0f9 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 _0x97c4=['isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','post','create','addTeams','/:id/users','addAgents','put','update','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get'];(function(_0x299ac8,_0x1ae81d){var _0xd36727=function(_0x4b7d46){while(--_0x4b7d46){_0x299ac8['push'](_0x299ac8['shift']());}};_0xd36727(++_0x1ae81d);}(_0x97c4,0x6e));var _0x497c=function(_0x6888b8,_0x24e37b){_0x6888b8=_0x6888b8-0x0;var _0x51d86d=_0x97c4[_0x6888b8];return _0x51d86d;};'use strict';var multer=require(_0x497c('0x0'));var util=require(_0x497c('0x1'));var path=require(_0x497c('0x2'));var timeout=require('connect-timeout');var express=require(_0x497c('0x3'));var router=express[_0x497c('0x4')]();var fs_extra=require(_0x497c('0x5'));var auth=require(_0x497c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x497c('0x7'));var controller=require(_0x497c('0x8'));router[_0x497c('0x9')]('/',auth[_0x497c('0xa')](),controller[_0x497c('0xb')]);router[_0x497c('0x9')](_0x497c('0xc'),auth[_0x497c('0xa')](),controller[_0x497c('0xd')]);router[_0x497c('0x9')](_0x497c('0xe'),auth[_0x497c('0xa')](),controller[_0x497c('0xf')]);router['get'](_0x497c('0x10'),auth['isAuthenticated'](),controller[_0x497c('0x11')]);router['get'](_0x497c('0x12'),auth[_0x497c('0xa')](),controller['getTeams']);router[_0x497c('0x9')]('/:id/users',auth[_0x497c('0xa')](),controller['getAgents']);router[_0x497c('0x13')]('/',auth['isAuthenticated'](),controller[_0x497c('0x14')]);router[_0x497c('0x13')]('/:id/teams',auth[_0x497c('0xa')](),controller[_0x497c('0x15')]);router[_0x497c('0x13')](_0x497c('0x16'),auth[_0x497c('0xa')](),controller[_0x497c('0x17')]);router[_0x497c('0x18')](_0x497c('0xe'),auth['isAuthenticated'](),controller[_0x497c('0x19')]);router['delete'](_0x497c('0xe'),auth[_0x497c('0xa')](),controller[_0x497c('0x1a')]);router['delete'](_0x497c('0x12'),auth[_0x497c('0xa')](),controller[_0x497c('0x1b')]);router['delete'](_0x497c('0x16'),auth[_0x497c('0xa')](),controller[_0x497c('0x1c')]);module[_0x497c('0x1d')]=router; \ No newline at end of file +var _0xc024=['create','post','addTeams','addAgents','put','update','delete','removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x18de49,_0x595ade){var _0x1ff164=function(_0x250933){while(--_0x250933){_0x18de49['push'](_0x18de49['shift']());}};_0x1ff164(++_0x595ade);}(_0xc024,0x105));var _0x4c02=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xc024[_0x481bf7];return _0x461787;};'use strict';var multer=require('multer');var util=require(_0x4c02('0x0'));var path=require(_0x4c02('0x1'));var timeout=require(_0x4c02('0x2'));var express=require(_0x4c02('0x3'));var router=express[_0x4c02('0x4')]();var fs_extra=require(_0x4c02('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4c02('0x6'));router[_0x4c02('0x7')]('/',auth[_0x4c02('0x8')](),controller['index']);router[_0x4c02('0x7')](_0x4c02('0x9'),auth[_0x4c02('0x8')](),controller[_0x4c02('0xa')]);router[_0x4c02('0x7')](_0x4c02('0xb'),auth['isAuthenticated'](),controller[_0x4c02('0xc')]);router[_0x4c02('0x7')](_0x4c02('0xd'),auth[_0x4c02('0x8')](),controller[_0x4c02('0xe')]);router[_0x4c02('0x7')](_0x4c02('0xf'),auth[_0x4c02('0x8')](),controller[_0x4c02('0x10')]);router['get'](_0x4c02('0x11'),auth[_0x4c02('0x8')](),controller[_0x4c02('0x12')]);router['post']('/',auth[_0x4c02('0x8')](),controller[_0x4c02('0x13')]);router[_0x4c02('0x14')](_0x4c02('0xf'),auth[_0x4c02('0x8')](),controller[_0x4c02('0x15')]);router[_0x4c02('0x14')](_0x4c02('0x11'),auth[_0x4c02('0x8')](),controller[_0x4c02('0x16')]);router[_0x4c02('0x17')](_0x4c02('0xb'),auth[_0x4c02('0x8')](),controller[_0x4c02('0x18')]);router[_0x4c02('0x19')](_0x4c02('0xb'),auth[_0x4c02('0x8')](),controller['destroy']);router[_0x4c02('0x19')](_0x4c02('0xf'),auth[_0x4c02('0x8')](),controller[_0x4c02('0x1a')]);router[_0x4c02('0x19')](_0x4c02('0x11'),auth[_0x4c02('0x8')](),controller['removeAgents']);module[_0x4c02('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 8ca0274..6c56faa 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 _0xc216=['DATE','moment','sequelize','exports','STRING'];(function(_0x4491dd,_0x21d8aa){var _0x15abe3=function(_0x41245f){while(--_0x41245f){_0x4491dd['push'](_0x4491dd['shift']());}};_0x15abe3(++_0x21d8aa);}(_0xc216,0x1b9));var _0x6c21=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0xc216[_0x43d16c];return _0x208cce;};'use strict';var moment=require(_0x6c21('0x0'));var Sequelize=require(_0x6c21('0x1'));module[_0x6c21('0x2')]={'uniqueid':{'type':Sequelize[_0x6c21('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x6c21('0x3')]},'joinAt':{'type':Sequelize[_0x6c21('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x6c21('0x4')]},'exitAt':{'type':Sequelize[_0x6c21('0x4')]},'reason':{'type':Sequelize[_0x6c21('0x3')]}}; \ No newline at end of file +var _0x2ecd=['exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2ecd,0xb7));var _0xd2ec=function(_0x457a44,_0x3c9d86){_0x457a44=_0x457a44-0x0;var _0x1fc1d7=_0x2ecd[_0x457a44];return _0x1fc1d7;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xd2ec('0x0')]={'uniqueid':{'type':Sequelize[_0xd2ec('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xd2ec('0x1')]},'joinAt':{'type':Sequelize[_0xd2ec('0x2')]},'leaveAt':{'type':Sequelize[_0xd2ec('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd2ec('0x2')]},'reason':{'type':Sequelize[_0xd2ec('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index a8a9d03..a7ad959 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 _0x9a8a=['squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FaxQueueReport','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x28ec94,_0x7cb244){var _0x3bbb8e=function(_0x5288be){while(--_0x5288be){_0x28ec94['push'](_0x28ec94['shift']());}};_0x3bbb8e(++_0x7cb244);}(_0x9a8a,0x1d9));var _0xa9a8=function(_0x160b10,_0x36c9e3){_0x160b10=_0x160b10-0x0;var _0x5793af=_0x9a8a[_0x160b10];return _0x5793af;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa9a8('0x0'));var zipdir=require(_0xa9a8('0x1'));var jsonpatch=require(_0xa9a8('0x2'));var rp=require('request-promise');var moment=require(_0xa9a8('0x3'));var BPromise=require(_0xa9a8('0x4'));var Mustache=require(_0xa9a8('0x5'));var util=require(_0xa9a8('0x6'));var path=require(_0xa9a8('0x7'));var sox=require(_0xa9a8('0x8'));var csv=require(_0xa9a8('0x9'));var ejs=require(_0xa9a8('0xa'));var fs=require('fs');var fs_extra=require(_0xa9a8('0xb'));var _=require(_0xa9a8('0xc'));var squel=require(_0xa9a8('0xd'));var crypto=require(_0xa9a8('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa9a8('0xf'));var Papa=require(_0xa9a8('0x10'));var Redis=require(_0xa9a8('0x11'));var authService=require(_0xa9a8('0x12'));var qs=require(_0xa9a8('0x13'));var as=require(_0xa9a8('0x14'));var hardwareService=require(_0xa9a8('0x15'));var logger=require(_0xa9a8('0x16'))(_0xa9a8('0x17'));var utils=require(_0xa9a8('0x18'));var config=require(_0xa9a8('0x19'));var licenseUtil=require(_0xa9a8('0x1a'));var db=require(_0xa9a8('0x1b'))['db'];function respondWithStatusCode(_0x427452,_0xdfa7aa){_0xdfa7aa=_0xdfa7aa||0xcc;return function(_0xaff158){if(_0xaff158){return _0x427452[_0xa9a8('0x1c')](_0xdfa7aa);}return _0x427452['status'](_0xdfa7aa)[_0xa9a8('0x1d')]();};}function respondWithResult(_0x25c69f,_0x1af85d){_0x1af85d=_0x1af85d||0xc8;return function(_0x153a5d){if(_0x153a5d){return _0x25c69f[_0xa9a8('0x1e')](_0x1af85d)[_0xa9a8('0x1f')](_0x153a5d);}};}function respondWithFilteredResult(_0x2390c7,_0x233b36){return function(_0x4304f3){if(_0x4304f3){var _0x5dcfdf=typeof _0x233b36[_0xa9a8('0x20')]===_0xa9a8('0x21')&&typeof _0x233b36[_0xa9a8('0x22')]===_0xa9a8('0x21');var _0x8d173e=_0x4304f3['count'];var _0x4ba0bc=_0x5dcfdf?0x0:_0x233b36[_0xa9a8('0x20')];var _0x4dd1a4=_0x5dcfdf?_0x4304f3[_0xa9a8('0x23')]:_0x233b36[_0xa9a8('0x20')]+_0x233b36[_0xa9a8('0x22')];var _0x233a63;if(_0x4dd1a4>=_0x8d173e){_0x4dd1a4=_0x8d173e;_0x233a63=0xc8;}else{_0x233a63=0xce;}_0x2390c7['status'](_0x233a63);return _0x2390c7[_0xa9a8('0x24')](_0xa9a8('0x25'),_0x4ba0bc+'-'+_0x4dd1a4+'/'+_0x8d173e)['json'](_0x4304f3);}return null;};}function patchUpdates(_0x276db4){return function(_0x501f47){try{jsonpatch[_0xa9a8('0x26')](_0x501f47,_0x276db4,!![]);}catch(_0x15770c){return BPromise[_0xa9a8('0x27')](_0x15770c);}return _0x501f47[_0xa9a8('0x28')]();};}function saveUpdates(_0x270aeb,_0x40ffa2){return function(_0x5d53f0){if(_0x5d53f0){return _0x5d53f0[_0xa9a8('0x29')](_0x270aeb)['then'](function(_0x3f5ce1){return _0x3f5ce1;});}return null;};}function removeEntity(_0x1c865d,_0x4441be){return function(_0x90e240){if(_0x90e240){return _0x90e240[_0xa9a8('0x2a')]()[_0xa9a8('0x2b')](function(){_0x1c865d[_0xa9a8('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cd4ce,_0x4e9f77){return function(_0xd4b0ca){if(!_0xd4b0ca){_0x3cd4ce[_0xa9a8('0x1c')](0x194);}return _0xd4b0ca;};}function handleError(_0x53e3fb,_0x5d0a9e){_0x5d0a9e=_0x5d0a9e||0x1f4;return function(_0x2e6a9e){logger['error'](_0x2e6a9e[_0xa9a8('0x2c')]);if(_0x2e6a9e[_0xa9a8('0x2d')]){delete _0x2e6a9e['name'];}_0x53e3fb[_0xa9a8('0x1e')](_0x5d0a9e)[_0xa9a8('0x2e')](_0x2e6a9e);};}exports[_0xa9a8('0x2f')]=function(_0x1c9e0c,_0x215299){var _0x394561={},_0x1293d7={},_0x388396={'count':0x0,'rows':[]};var _0x50b1be=_['map'](db['FaxQueueReport'][_0xa9a8('0x30')],function(_0x32462f){return{'name':_0x32462f[_0xa9a8('0x31')],'type':_0x32462f[_0xa9a8('0x32')][_0xa9a8('0x33')]};});_0x1293d7[_0xa9a8('0x34')]=_[_0xa9a8('0x35')](_0x50b1be,_0xa9a8('0x2d'));_0x1293d7['query']=_[_0xa9a8('0x36')](_0x1c9e0c['query']);_0x1293d7['filters']=_[_0xa9a8('0x37')](_0x1293d7[_0xa9a8('0x34')],_0x1293d7[_0xa9a8('0x38')]);_0x394561['attributes']=_[_0xa9a8('0x37')](_0x1293d7['model'],qs[_0xa9a8('0x39')](_0x1c9e0c[_0xa9a8('0x38')][_0xa9a8('0x39')]));_0x394561['attributes']=_0x394561[_0xa9a8('0x3a')][_0xa9a8('0x3b')]?_0x394561['attributes']:_0x1293d7[_0xa9a8('0x34')];if(!_0x1c9e0c['query']['hasOwnProperty'](_0xa9a8('0x3c'))){_0x394561[_0xa9a8('0x22')]=qs[_0xa9a8('0x22')](_0x1c9e0c[_0xa9a8('0x38')][_0xa9a8('0x22')]);_0x394561[_0xa9a8('0x20')]=qs[_0xa9a8('0x20')](_0x1c9e0c[_0xa9a8('0x38')]['offset']);}_0x394561[_0xa9a8('0x3d')]=qs[_0xa9a8('0x3e')](_0x1c9e0c[_0xa9a8('0x38')]['sort']);_0x394561[_0xa9a8('0x3f')]=qs[_0xa9a8('0x40')](_[_0xa9a8('0x41')](_0x1c9e0c[_0xa9a8('0x38')],_0x1293d7['filters']),_0x50b1be);if(_0x1c9e0c['query'][_0xa9a8('0x42')]){_0x394561[_0xa9a8('0x3f')]=_[_0xa9a8('0x43')](_0x394561[_0xa9a8('0x3f')],{'$or':_[_0xa9a8('0x35')](_0x50b1be,function(_0x416f94){if(_0x416f94[_0xa9a8('0x32')]!==_0xa9a8('0x44')){var _0x2afb99={};_0x2afb99[_0x416f94[_0xa9a8('0x2d')]]={'$like':'%'+_0x1c9e0c[_0xa9a8('0x38')][_0xa9a8('0x42')]+'%'};return _0x2afb99;}})});}_0x394561=_[_0xa9a8('0x43')]({},_0x394561,_0x1c9e0c[_0xa9a8('0x45')]);var _0x530f21={'where':_0x394561[_0xa9a8('0x3f')]};return db[_0xa9a8('0x46')][_0xa9a8('0x23')](_0x530f21)[_0xa9a8('0x2b')](function(_0x4be6b9){_0x388396[_0xa9a8('0x23')]=_0x4be6b9;if(_0x1c9e0c[_0xa9a8('0x38')]['includeAll']){_0x394561[_0xa9a8('0x47')]=[{'all':!![]}];}return db[_0xa9a8('0x46')][_0xa9a8('0x48')](_0x394561);})[_0xa9a8('0x2b')](function(_0x5704d1){_0x388396[_0xa9a8('0x49')]=_0x5704d1;return _0x388396;})[_0xa9a8('0x2b')](respondWithFilteredResult(_0x215299,_0x394561))[_0xa9a8('0x4a')](handleError(_0x215299,null));};exports[_0xa9a8('0x4b')]=function(_0x4a9e41,_0x1e2b45){var _0x17e378={'raw':!![],'where':{'id':_0x4a9e41[_0xa9a8('0x4c')]['id']}},_0x99f09f={};_0x99f09f[_0xa9a8('0x34')]=_[_0xa9a8('0x36')](db[_0xa9a8('0x46')]['rawAttributes']);_0x99f09f[_0xa9a8('0x38')]=_[_0xa9a8('0x36')](_0x4a9e41['query']);_0x99f09f[_0xa9a8('0x40')]=_[_0xa9a8('0x37')](_0x99f09f[_0xa9a8('0x34')],_0x99f09f[_0xa9a8('0x38')]);_0x17e378['attributes']=_[_0xa9a8('0x37')](_0x99f09f['model'],qs[_0xa9a8('0x39')](_0x4a9e41[_0xa9a8('0x38')][_0xa9a8('0x39')]));_0x17e378['attributes']=_0x17e378[_0xa9a8('0x3a')][_0xa9a8('0x3b')]?_0x17e378['attributes']:_0x99f09f[_0xa9a8('0x34')];if(_0x4a9e41[_0xa9a8('0x38')]['includeAll']){_0x17e378[_0xa9a8('0x47')]=[{'all':!![]}];}_0x17e378=_[_0xa9a8('0x43')]({},_0x17e378,_0x4a9e41[_0xa9a8('0x45')]);return db[_0xa9a8('0x46')][_0xa9a8('0x4d')](_0x17e378)['then'](handleEntityNotFound(_0x1e2b45,null))[_0xa9a8('0x2b')](respondWithResult(_0x1e2b45,null))[_0xa9a8('0x4a')](handleError(_0x1e2b45,null));};exports[_0xa9a8('0x4e')]=function(_0x2681c5,_0x1f3329){return db[_0xa9a8('0x46')]['create'](_0x2681c5[_0xa9a8('0x4f')],{})[_0xa9a8('0x2b')](respondWithResult(_0x1f3329,0xc9))[_0xa9a8('0x4a')](handleError(_0x1f3329,null));};exports[_0xa9a8('0x29')]=function(_0x5c1f9b,_0x2b1ed0){if(_0x5c1f9b[_0xa9a8('0x4f')]['id']){delete _0x5c1f9b[_0xa9a8('0x4f')]['id'];}return db[_0xa9a8('0x46')][_0xa9a8('0x4d')]({'where':{'id':_0x5c1f9b[_0xa9a8('0x4c')]['id']}})[_0xa9a8('0x2b')](handleEntityNotFound(_0x2b1ed0,null))['then'](saveUpdates(_0x5c1f9b[_0xa9a8('0x4f')],null))[_0xa9a8('0x2b')](respondWithResult(_0x2b1ed0,null))[_0xa9a8('0x4a')](handleError(_0x2b1ed0,null));};exports[_0xa9a8('0x2a')]=function(_0x20562a,_0x1869ab){return db['FaxQueueReport'][_0xa9a8('0x4d')]({'where':{'id':_0x20562a[_0xa9a8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1869ab,null))[_0xa9a8('0x2b')](removeEntity(_0x1869ab,null))[_0xa9a8('0x4a')](handleError(_0x1869ab,null));};exports[_0xa9a8('0x50')]=function(_0x5696c5,_0xe26d6){return db[_0xa9a8('0x46')][_0xa9a8('0x50')]()[_0xa9a8('0x2b')](respondWithResult(_0xe26d6,null))['catch'](handleError(_0xe26d6,null));}; \ No newline at end of file +var _0x451e=['error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy'];(function(_0x317e30,_0x32ad66){var _0x203788=function(_0x264d38){while(--_0x264d38){_0x317e30['push'](_0x317e30['shift']());}};_0x203788(++_0x32ad66);}(_0x451e,0x164));var _0xe451=function(_0xdb0044,_0x40bd8e){_0xdb0044=_0xdb0044-0x0;var _0x30fc0d=_0x451e[_0xdb0044];return _0x30fc0d;};'use strict';var emlformat=require(_0xe451('0x0'));var rimraf=require(_0xe451('0x1'));var zipdir=require(_0xe451('0x2'));var jsonpatch=require(_0xe451('0x3'));var rp=require(_0xe451('0x4'));var moment=require(_0xe451('0x5'));var BPromise=require(_0xe451('0x6'));var Mustache=require(_0xe451('0x7'));var util=require(_0xe451('0x8'));var path=require('path');var sox=require(_0xe451('0x9'));var csv=require('to-csv');var ejs=require(_0xe451('0xa'));var fs=require('fs');var fs_extra=require(_0xe451('0xb'));var _=require(_0xe451('0xc'));var squel=require(_0xe451('0xd'));var crypto=require(_0xe451('0xe'));var jsforce=require(_0xe451('0xf'));var deskjs=require(_0xe451('0x10'));var toCsv=require(_0xe451('0x11'));var querystring=require(_0xe451('0x12'));var Papa=require(_0xe451('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe451('0x14'));var logger=require(_0xe451('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe451('0x16'));var db=require(_0xe451('0x17'))['db'];function respondWithStatusCode(_0x59d77c,_0x3e6f55){_0x3e6f55=_0x3e6f55||0xcc;return function(_0xf20798){if(_0xf20798){return _0x59d77c[_0xe451('0x18')](_0x3e6f55);}return _0x59d77c[_0xe451('0x19')](_0x3e6f55)[_0xe451('0x1a')]();};}function respondWithResult(_0x1700a2,_0x665bec){_0x665bec=_0x665bec||0xc8;return function(_0x3cbf5b){if(_0x3cbf5b){return _0x1700a2[_0xe451('0x19')](_0x665bec)[_0xe451('0x1b')](_0x3cbf5b);}};}function respondWithFilteredResult(_0x263373,_0x236725){return function(_0x217d70){if(_0x217d70){var _0x42577e=typeof _0x236725[_0xe451('0x1c')]===_0xe451('0x1d')&&typeof _0x236725[_0xe451('0x1e')]==='undefined';var _0x5f4dc6=_0x217d70['count'];var _0x26d8a9=_0x42577e?0x0:_0x236725[_0xe451('0x1c')];var _0x27300b=_0x42577e?_0x217d70[_0xe451('0x1f')]:_0x236725[_0xe451('0x1c')]+_0x236725['limit'];var _0x1b6ae0;if(_0x27300b>=_0x5f4dc6){_0x27300b=_0x5f4dc6;_0x1b6ae0=0xc8;}else{_0x1b6ae0=0xce;}_0x263373[_0xe451('0x19')](_0x1b6ae0);return _0x263373[_0xe451('0x20')](_0xe451('0x21'),_0x26d8a9+'-'+_0x27300b+'/'+_0x5f4dc6)[_0xe451('0x1b')](_0x217d70);}return null;};}function patchUpdates(_0x1d91c1){return function(_0x51f58f){try{jsonpatch[_0xe451('0x22')](_0x51f58f,_0x1d91c1,!![]);}catch(_0x426a49){return BPromise['reject'](_0x426a49);}return _0x51f58f[_0xe451('0x23')]();};}function saveUpdates(_0xe0efaf,_0x4910b4){return function(_0x16255a){if(_0x16255a){return _0x16255a[_0xe451('0x24')](_0xe0efaf)[_0xe451('0x25')](function(_0x4f2543){return _0x4f2543;});}return null;};}function removeEntity(_0x10c255,_0x54a3e7){return function(_0x4cc32e){if(_0x4cc32e){return _0x4cc32e[_0xe451('0x26')]()[_0xe451('0x25')](function(){_0x10c255[_0xe451('0x19')](0xcc)[_0xe451('0x1a')]();});}};}function handleEntityNotFound(_0x962d22,_0x5e1f5b){return function(_0x12e34d){if(!_0x12e34d){_0x962d22[_0xe451('0x18')](0x194);}return _0x12e34d;};}function handleError(_0xa5dec3,_0x5e43b3){_0x5e43b3=_0x5e43b3||0x1f4;return function(_0x255947){logger[_0xe451('0x27')](_0x255947[_0xe451('0x28')]);if(_0x255947[_0xe451('0x29')]){delete _0x255947['name'];}_0xa5dec3[_0xe451('0x19')](_0x5e43b3)[_0xe451('0x2a')](_0x255947);};}exports[_0xe451('0x2b')]=function(_0x201991,_0x50012d){var _0x4bd8c8={},_0x2ede05={},_0x446f29={'count':0x0,'rows':[]};var _0x3acab5=_[_0xe451('0x2c')](db[_0xe451('0x2d')][_0xe451('0x2e')],function(_0x52125c){return{'name':_0x52125c[_0xe451('0x2f')],'type':_0x52125c[_0xe451('0x30')][_0xe451('0x31')]};});_0x2ede05[_0xe451('0x32')]=_[_0xe451('0x2c')](_0x3acab5,_0xe451('0x29'));_0x2ede05['query']=_[_0xe451('0x33')](_0x201991[_0xe451('0x34')]);_0x2ede05[_0xe451('0x35')]=_[_0xe451('0x36')](_0x2ede05[_0xe451('0x32')],_0x2ede05[_0xe451('0x34')]);_0x4bd8c8['attributes']=_[_0xe451('0x36')](_0x2ede05[_0xe451('0x32')],qs[_0xe451('0x37')](_0x201991[_0xe451('0x34')]['fields']));_0x4bd8c8[_0xe451('0x38')]=_0x4bd8c8[_0xe451('0x38')][_0xe451('0x39')]?_0x4bd8c8[_0xe451('0x38')]:_0x2ede05[_0xe451('0x32')];if(!_0x201991[_0xe451('0x34')][_0xe451('0x3a')](_0xe451('0x3b'))){_0x4bd8c8[_0xe451('0x1e')]=qs[_0xe451('0x1e')](_0x201991['query'][_0xe451('0x1e')]);_0x4bd8c8[_0xe451('0x1c')]=qs['offset'](_0x201991[_0xe451('0x34')][_0xe451('0x1c')]);}_0x4bd8c8[_0xe451('0x3c')]=qs[_0xe451('0x3d')](_0x201991[_0xe451('0x34')][_0xe451('0x3d')]);_0x4bd8c8[_0xe451('0x3e')]=qs[_0xe451('0x35')](_[_0xe451('0x3f')](_0x201991[_0xe451('0x34')],_0x2ede05['filters']),_0x3acab5);if(_0x201991[_0xe451('0x34')][_0xe451('0x40')]){_0x4bd8c8[_0xe451('0x3e')]=_[_0xe451('0x41')](_0x4bd8c8[_0xe451('0x3e')],{'$or':_['map'](_0x3acab5,function(_0x1cb827){if(_0x1cb827[_0xe451('0x30')]!==_0xe451('0x42')){var _0x9e7e88={};_0x9e7e88[_0x1cb827[_0xe451('0x29')]]={'$like':'%'+_0x201991[_0xe451('0x34')][_0xe451('0x40')]+'%'};return _0x9e7e88;}})});}_0x4bd8c8=_[_0xe451('0x41')]({},_0x4bd8c8,_0x201991[_0xe451('0x43')]);var _0x515c95={'where':_0x4bd8c8[_0xe451('0x3e')]};return db[_0xe451('0x2d')][_0xe451('0x1f')](_0x515c95)['then'](function(_0x3b3ac7){_0x446f29[_0xe451('0x1f')]=_0x3b3ac7;if(_0x201991[_0xe451('0x34')][_0xe451('0x44')]){_0x4bd8c8[_0xe451('0x45')]=[{'all':!![]}];}return db[_0xe451('0x2d')][_0xe451('0x46')](_0x4bd8c8);})[_0xe451('0x25')](function(_0x564d75){_0x446f29[_0xe451('0x47')]=_0x564d75;return _0x446f29;})['then'](respondWithFilteredResult(_0x50012d,_0x4bd8c8))[_0xe451('0x48')](handleError(_0x50012d,null));};exports[_0xe451('0x49')]=function(_0x329e30,_0x5c7ca2){var _0x302e67={'raw':!![],'where':{'id':_0x329e30[_0xe451('0x4a')]['id']}},_0x4bd48c={};_0x4bd48c['model']=_[_0xe451('0x33')](db[_0xe451('0x2d')][_0xe451('0x2e')]);_0x4bd48c[_0xe451('0x34')]=_[_0xe451('0x33')](_0x329e30[_0xe451('0x34')]);_0x4bd48c['filters']=_[_0xe451('0x36')](_0x4bd48c[_0xe451('0x32')],_0x4bd48c[_0xe451('0x34')]);_0x302e67['attributes']=_[_0xe451('0x36')](_0x4bd48c[_0xe451('0x32')],qs[_0xe451('0x37')](_0x329e30[_0xe451('0x34')][_0xe451('0x37')]));_0x302e67['attributes']=_0x302e67[_0xe451('0x38')][_0xe451('0x39')]?_0x302e67[_0xe451('0x38')]:_0x4bd48c[_0xe451('0x32')];if(_0x329e30[_0xe451('0x34')][_0xe451('0x44')]){_0x302e67[_0xe451('0x45')]=[{'all':!![]}];}_0x302e67=_[_0xe451('0x41')]({},_0x302e67,_0x329e30[_0xe451('0x43')]);return db['FaxQueueReport']['find'](_0x302e67)['then'](handleEntityNotFound(_0x5c7ca2,null))[_0xe451('0x25')](respondWithResult(_0x5c7ca2,null))[_0xe451('0x48')](handleError(_0x5c7ca2,null));};exports[_0xe451('0x4b')]=function(_0x18fbc3,_0x36cfd6){return db[_0xe451('0x2d')][_0xe451('0x4b')](_0x18fbc3[_0xe451('0x4c')],{})[_0xe451('0x25')](respondWithResult(_0x36cfd6,0xc9))['catch'](handleError(_0x36cfd6,null));};exports[_0xe451('0x24')]=function(_0x5824bf,_0x368913){if(_0x5824bf[_0xe451('0x4c')]['id']){delete _0x5824bf['body']['id'];}return db['FaxQueueReport'][_0xe451('0x4d')]({'where':{'id':_0x5824bf[_0xe451('0x4a')]['id']}})[_0xe451('0x25')](handleEntityNotFound(_0x368913,null))['then'](saveUpdates(_0x5824bf[_0xe451('0x4c')],null))[_0xe451('0x25')](respondWithResult(_0x368913,null))[_0xe451('0x48')](handleError(_0x368913,null));};exports[_0xe451('0x26')]=function(_0x1d7321,_0x363f55){return db['FaxQueueReport'][_0xe451('0x4d')]({'where':{'id':_0x1d7321[_0xe451('0x4a')]['id']}})[_0xe451('0x25')](handleEntityNotFound(_0x363f55,null))[_0xe451('0x25')](removeEntity(_0x363f55,null))['catch'](handleError(_0x363f55,null));};exports[_0xe451('0x4e')]=function(_0x27208d,_0x48e808){return db[_0xe451('0x2d')]['describe']()[_0xe451('0x25')](respondWithResult(_0x48e808,null))[_0xe451('0x48')](handleError(_0x48e808,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 728d6ac..0110753 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 _0x9f96=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_fax_queue','uniqueid'];(function(_0x42c576,_0x2b93de){var _0x4cb4e5=function(_0x4a2f71){while(--_0x4a2f71){_0x42c576['push'](_0x42c576['shift']());}};_0x4cb4e5(++_0x2b93de);}(_0x9f96,0x1ce));var _0x69f9=function(_0x5e4a3f,_0x2a56d1){_0x5e4a3f=_0x5e4a3f-0x0;var _0x4d6b61=_0x9f96[_0x5e4a3f];return _0x4d6b61;};'use strict';var _=require(_0x69f9('0x0'));var util=require(_0x69f9('0x1'));var logger=require(_0x69f9('0x2'))(_0x69f9('0x3'));var moment=require(_0x69f9('0x4'));var BPromise=require(_0x69f9('0x5'));var rp=require(_0x69f9('0x6'));var fs=require('fs');var path=require(_0x69f9('0x7'));var rimraf=require(_0x69f9('0x8'));var config=require(_0x69f9('0x9'));var attributes=require('./faxQueueReport.attributes');module[_0x69f9('0xa')]=function(_0x3c3178,_0x73f9d0){return _0x3c3178[_0x69f9('0xb')]('FaxQueueReport',attributes,{'tableName':_0x69f9('0xc'),'paranoid':![],'indexes':[{'name':_0x69f9('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9376=['report_fax_queue','uniqueid','lodash','../../config/logger','request-promise','path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9376,0x156));var _0x6937=function(_0x505766,_0x4d4a04){_0x505766=_0x505766-0x0;var _0x429123=_0x9376[_0x505766];return _0x429123;};'use strict';var _=require(_0x6937('0x0'));var util=require('util');var logger=require(_0x6937('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6937('0x2'));var fs=require('fs');var path=require(_0x6937('0x3'));var rimraf=require('rimraf');var config=require(_0x6937('0x4'));var attributes=require(_0x6937('0x5'));module['exports']=function(_0x1c581d,_0x45c627){return _0x1c581d[_0x6937('0x6')](_0x6937('0x7'),attributes,{'tableName':_0x6937('0x8'),'paranoid':![],'indexes':[{'name':_0x6937('0x9'),'fields':[_0x6937('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 7cb0290..ec480a1 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 _0xf0ee=['FaxQueueReport','body','options','stringify','UpdateFaxQueueReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateFaxQueueReport'];(function(_0x24fc8a,_0x14c1fb){var _0x58b1b8=function(_0x4df32b){while(--_0x4df32b){_0x24fc8a['push'](_0x24fc8a['shift']());}};_0x58b1b8(++_0x14c1fb);}(_0xf0ee,0x180));var _0xef0e=function(_0x22a9fa,_0x292f7c){_0x22a9fa=_0x22a9fa-0x0;var _0x379451=_0xf0ee[_0x22a9fa];return _0x379451;};'use strict';var _=require(_0xef0e('0x0'));var util=require(_0xef0e('0x1'));var moment=require(_0xef0e('0x2'));var BPromise=require(_0xef0e('0x3'));var rs=require(_0xef0e('0x4'));var fs=require('fs');var Redis=require(_0xef0e('0x5'));var db=require(_0xef0e('0x6'))['db'];var utils=require(_0xef0e('0x7'));var logger=require(_0xef0e('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xef0e('0x9'));var client=jayson['client'][_0xef0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2140cd,_0x583da8,_0x495f3e){return new BPromise(function(_0x1db346,_0x4b10bd){return client[_0xef0e('0xb')](_0x2140cd,_0x495f3e)[_0xef0e('0xc')](function(_0x18b51a){logger['info'](_0xef0e('0xd'),_0x583da8,_0xef0e('0xe'));logger[_0xef0e('0xf')](_0xef0e('0x10'),_0x583da8,'request\x20sent',JSON['stringify'](_0x18b51a));if(_0x18b51a['error']){if(_0x18b51a[_0xef0e('0x11')][_0xef0e('0x12')]===0x1f4){logger[_0xef0e('0x11')](_0xef0e('0xd'),_0x583da8,_0x18b51a[_0xef0e('0x11')]['message']);return _0x4b10bd(_0x18b51a[_0xef0e('0x11')][_0xef0e('0x13')]);}logger[_0xef0e('0x11')](_0xef0e('0xd'),_0x583da8,_0x18b51a['error'][_0xef0e('0x13')]);return _0x1db346(_0x18b51a['error'][_0xef0e('0x13')]);}else{logger[_0xef0e('0x14')](_0xef0e('0xd'),_0x583da8,'request\x20sent');_0x1db346(_0x18b51a[_0xef0e('0x15')][_0xef0e('0x13')]);}})[_0xef0e('0x16')](function(_0x5afd52){logger[_0xef0e('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x583da8,_0x5afd52);_0x4b10bd(_0x5afd52);});});}exports[_0xef0e('0x17')]=function(_0x53c408){var _0x46f285=this;return new Promise(function(_0x59874f,_0x34b9cd){return db[_0xef0e('0x18')]['create'](_0x53c408[_0xef0e('0x19')],{'raw':_0x53c408['options']?_0x53c408[_0xef0e('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xef0e('0xc')](function(_0x46af7b){logger[_0xef0e('0x14')](_0xef0e('0x17'),_0x53c408);logger['debug'](_0xef0e('0x17'),_0x53c408,JSON[_0xef0e('0x1b')](_0x46af7b));_0x59874f(_0x46af7b);})['catch'](function(_0x1e580c){logger['error']('CreateFaxQueueReport',_0x1e580c[_0xef0e('0x13')],_0x53c408);_0x34b9cd(_0x46f285[_0xef0e('0x11')](0x1f4,_0x1e580c['message']));});});};exports[_0xef0e('0x1c')]=function(_0x2c768f){var _0x55f5e8=this;return new Promise(function(_0x45260f,_0x1c690f){return db[_0xef0e('0x18')][_0xef0e('0x1d')](_0x2c768f[_0xef0e('0x19')],{'raw':_0x2c768f[_0xef0e('0x1a')]?_0x2c768f[_0xef0e('0x1a')][_0xef0e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c768f[_0xef0e('0x1a')]?_0x2c768f[_0xef0e('0x1a')][_0xef0e('0x1f')]||null:null,'attributes':_0x2c768f['options']?_0x2c768f['options'][_0xef0e('0x20')]||null:null,'limit':_0x2c768f[_0xef0e('0x1a')]?_0x2c768f['options'][_0xef0e('0x21')]||null:null})[_0xef0e('0xc')](function(_0x2b6f29){logger[_0xef0e('0x14')](_0xef0e('0x1c'),_0x2c768f);logger[_0xef0e('0xf')](_0xef0e('0x1c'),_0x2c768f,JSON[_0xef0e('0x1b')](_0x2b6f29));_0x45260f(_0x2b6f29);})[_0xef0e('0x16')](function(_0x59ea71){logger['error']('UpdateFaxQueueReport',_0x59ea71['message'],_0x2c768f);_0x1c690f(_0x55f5e8['error'](0x1f4,_0x59ea71['message']));});});}; \ No newline at end of file +var _0x8fa4=['stringify','UpdateFaxQueueReport','FaxQueueReport','update','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','message','catch','CreateFaxQueueReport','body','raw'];(function(_0x9437f0,_0x19126d){var _0x52a399=function(_0x1c36fe){while(--_0x1c36fe){_0x9437f0['push'](_0x9437f0['shift']());}};_0x52a399(++_0x19126d);}(_0x8fa4,0x1e8));var _0x48fa=function(_0x139db2,_0x4cb3d8){_0x139db2=_0x139db2-0x0;var _0x552baf=_0x8fa4[_0x139db2];return _0x552baf;};'use strict';var _=require(_0x48fa('0x0'));var util=require(_0x48fa('0x1'));var moment=require(_0x48fa('0x2'));var BPromise=require(_0x48fa('0x3'));var rs=require(_0x48fa('0x4'));var fs=require('fs');var Redis=require(_0x48fa('0x5'));var db=require(_0x48fa('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x48fa('0x7'))('rpc');var config=require(_0x48fa('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x48fa('0x9')][_0x48fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27e472,_0x257bd8,_0x3df866){return new BPromise(function(_0x103748,_0x532572){return client[_0x48fa('0xb')](_0x27e472,_0x3df866)[_0x48fa('0xc')](function(_0x3933f9){logger[_0x48fa('0xd')](_0x48fa('0xe'),_0x257bd8,_0x48fa('0xf'));logger[_0x48fa('0x10')](_0x48fa('0x11'),_0x257bd8,_0x48fa('0xf'),JSON['stringify'](_0x3933f9));if(_0x3933f9[_0x48fa('0x12')]){if(_0x3933f9[_0x48fa('0x12')]['code']===0x1f4){logger['error'](_0x48fa('0xe'),_0x257bd8,_0x3933f9[_0x48fa('0x12')][_0x48fa('0x13')]);return _0x532572(_0x3933f9[_0x48fa('0x12')]['message']);}logger[_0x48fa('0x12')](_0x48fa('0xe'),_0x257bd8,_0x3933f9[_0x48fa('0x12')][_0x48fa('0x13')]);return _0x103748(_0x3933f9[_0x48fa('0x12')]['message']);}else{logger[_0x48fa('0xd')](_0x48fa('0xe'),_0x257bd8,'request\x20sent');_0x103748(_0x3933f9['result'][_0x48fa('0x13')]);}})[_0x48fa('0x14')](function(_0x31c18a){logger[_0x48fa('0x12')](_0x48fa('0xe'),_0x257bd8,_0x31c18a);_0x532572(_0x31c18a);});});}exports[_0x48fa('0x15')]=function(_0x3a146f){var _0x22b8ca=this;return new Promise(function(_0x5e04c3,_0x2f598d){return db['FaxQueueReport']['create'](_0x3a146f[_0x48fa('0x16')],{'raw':_0x3a146f['options']?_0x3a146f['options'][_0x48fa('0x17')]===undefined?!![]:![]:!![]})[_0x48fa('0xc')](function(_0x65a541){logger['info'](_0x48fa('0x15'),_0x3a146f);logger['debug']('CreateFaxQueueReport',_0x3a146f,JSON[_0x48fa('0x18')](_0x65a541));_0x5e04c3(_0x65a541);})[_0x48fa('0x14')](function(_0x36c943){logger[_0x48fa('0x12')]('CreateFaxQueueReport',_0x36c943[_0x48fa('0x13')],_0x3a146f);_0x2f598d(_0x22b8ca[_0x48fa('0x12')](0x1f4,_0x36c943[_0x48fa('0x13')]));});});};exports[_0x48fa('0x19')]=function(_0xa8e255){var _0x5a8e4d=this;return new Promise(function(_0x98a7f5,_0x49bc16){return db[_0x48fa('0x1a')][_0x48fa('0x1b')](_0xa8e255[_0x48fa('0x16')],{'raw':_0xa8e255[_0x48fa('0x1c')]?_0xa8e255[_0x48fa('0x1c')][_0x48fa('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa8e255['options']?_0xa8e255[_0x48fa('0x1c')][_0x48fa('0x1d')]||null:null,'attributes':_0xa8e255[_0x48fa('0x1c')]?_0xa8e255[_0x48fa('0x1c')][_0x48fa('0x1e')]||null:null,'limit':_0xa8e255[_0x48fa('0x1c')]?_0xa8e255[_0x48fa('0x1c')][_0x48fa('0x1f')]||null:null})[_0x48fa('0xc')](function(_0x4bce32){logger[_0x48fa('0xd')](_0x48fa('0x19'),_0xa8e255);logger['debug'](_0x48fa('0x19'),_0xa8e255,JSON['stringify'](_0x4bce32));_0x98a7f5(_0x4bce32);})['catch'](function(_0xd80207){logger['error'](_0x48fa('0x19'),_0xd80207[_0x48fa('0x13')],_0xa8e255);_0x49bc16(_0x5a8e4d['error'](0x1f4,_0xd80207['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 7591ffb..d8d9ee4 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 _0x3d69=['put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x16acc0,_0x5dda04){var _0x54ec89=function(_0x141441){while(--_0x141441){_0x16acc0['push'](_0x16acc0['shift']());}};_0x54ec89(++_0x5dda04);}(_0x3d69,0x143));var _0x93d6=function(_0x2d49b7,_0x1b6f15){_0x2d49b7=_0x2d49b7-0x0;var _0x129fb7=_0x3d69[_0x2d49b7];return _0x129fb7;};'use strict';var multer=require(_0x93d6('0x0'));var util=require(_0x93d6('0x1'));var path=require(_0x93d6('0x2'));var timeout=require(_0x93d6('0x3'));var express=require(_0x93d6('0x4'));var router=express[_0x93d6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x93d6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x93d6('0x7'));var controller=require(_0x93d6('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x93d6('0x9')](_0x93d6('0xa'),auth[_0x93d6('0xb')](),controller[_0x93d6('0xc')]);router['get'](_0x93d6('0xd'),auth[_0x93d6('0xb')](),controller[_0x93d6('0xe')]);router[_0x93d6('0xf')]('/',auth[_0x93d6('0xb')](),controller[_0x93d6('0x10')]);router[_0x93d6('0x11')](_0x93d6('0xd'),auth[_0x93d6('0xb')](),controller['update']);router[_0x93d6('0x12')](_0x93d6('0xd'),auth[_0x93d6('0xb')](),controller[_0x93d6('0x13')]);module['exports']=router; \ No newline at end of file +var _0xef74=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','create','delete','destroy'];(function(_0x469965,_0x4d5691){var _0x3b8729=function(_0x5a823e){while(--_0x5a823e){_0x469965['push'](_0x469965['shift']());}};_0x3b8729(++_0x4d5691);}(_0xef74,0x1b6));var _0x4ef7=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xef74[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x4ef7('0x0'));var util=require(_0x4ef7('0x1'));var path=require(_0x4ef7('0x2'));var timeout=require(_0x4ef7('0x3'));var express=require('express');var router=express[_0x4ef7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4ef7('0x5'));var interaction=require(_0x4ef7('0x6'));var config=require(_0x4ef7('0x7'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x4ef7('0x8')](),controller[_0x4ef7('0x9')]);router[_0x4ef7('0xa')](_0x4ef7('0xb'),auth[_0x4ef7('0x8')](),controller[_0x4ef7('0xc')]);router[_0x4ef7('0xa')](_0x4ef7('0xd'),auth['isAuthenticated'](),controller[_0x4ef7('0xe')]);router['post']('/',auth[_0x4ef7('0x8')](),controller[_0x4ef7('0xf')]);router['put'](_0x4ef7('0xd'),auth[_0x4ef7('0x8')](),controller['update']);router[_0x4ef7('0x10')](_0x4ef7('0xd'),auth[_0x4ef7('0x8')](),controller[_0x4ef7('0x11')]);module[_0x4ef7('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 2a5abc1..e600309 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 _0x45c4=['account','agent','queue','DATE','moment','STRING','ENUM'];(function(_0x399e8e,_0x303361){var _0x38ae1b=function(_0x5a205c){while(--_0x5a205c){_0x399e8e['push'](_0x399e8e['shift']());}};_0x38ae1b(++_0x303361);}(_0x45c4,0x17e));var _0x445c=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x45c4[_0x2c7618];return _0x5ce3f0;};'use strict';var moment=require(_0x445c('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x445c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x445c('0x2')](_0x445c('0x3'),_0x445c('0x4'),'queue'),'allowNull':![],'defaultValue':_0x445c('0x5')},'transferredAt':{'type':Sequelize[_0x445c('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x0c99=['queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0x0c99,0x8f));var _0x90c9=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x0c99[_0x3c8e9a];return _0x2d4c57;};'use strict';var moment=require(_0x90c9('0x0'));var Sequelize=require(_0x90c9('0x1'));module[_0x90c9('0x2')]={'uniqueid':{'type':Sequelize[_0x90c9('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x90c9('0x4')](_0x90c9('0x5'),_0x90c9('0x6'),_0x90c9('0x7')),'allowNull':![],'defaultValue':_0x90c9('0x7')},'transferredAt':{'type':Sequelize[_0x90c9('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x90c9('0x9')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 559cb21..afdc69e 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 _0xd4d6=['apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FaxTransferReport','fieldName','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x368eb1,_0x11343a){var _0xbf8b62=function(_0xa3d625){while(--_0xa3d625){_0x368eb1['push'](_0x368eb1['shift']());}};_0xbf8b62(++_0x11343a);}(_0xd4d6,0x78));var _0x6d4d=function(_0x54e489,_0xfcb075){_0x54e489=_0x54e489-0x0;var _0xd07b8c=_0xd4d6[_0x54e489];return _0xd07b8c;};'use strict';var emlformat=require(_0x6d4d('0x0'));var rimraf=require(_0x6d4d('0x1'));var zipdir=require(_0x6d4d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d4d('0x3'));var moment=require('moment');var BPromise=require(_0x6d4d('0x4'));var Mustache=require(_0x6d4d('0x5'));var util=require(_0x6d4d('0x6'));var path=require(_0x6d4d('0x7'));var sox=require('sox');var csv=require(_0x6d4d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d4d('0x9'));var _=require(_0x6d4d('0xa'));var squel=require('squel');var crypto=require(_0x6d4d('0xb'));var jsforce=require(_0x6d4d('0xc'));var deskjs=require(_0x6d4d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6d4d('0xe'));var Papa=require('papaparse');var Redis=require(_0x6d4d('0xf'));var authService=require(_0x6d4d('0x10'));var qs=require(_0x6d4d('0x11'));var as=require(_0x6d4d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d4d('0x13'))(_0x6d4d('0x14'));var utils=require('../../config/utils');var config=require(_0x6d4d('0x15'));var licenseUtil=require(_0x6d4d('0x16'));var db=require(_0x6d4d('0x17'))['db'];function respondWithStatusCode(_0x339374,_0x2beacf){_0x2beacf=_0x2beacf||0xcc;return function(_0x2a15ef){if(_0x2a15ef){return _0x339374[_0x6d4d('0x18')](_0x2beacf);}return _0x339374[_0x6d4d('0x19')](_0x2beacf)['end']();};}function respondWithResult(_0x12de31,_0x56c972){_0x56c972=_0x56c972||0xc8;return function(_0x117baa){if(_0x117baa){return _0x12de31[_0x6d4d('0x19')](_0x56c972)[_0x6d4d('0x1a')](_0x117baa);}};}function respondWithFilteredResult(_0x272a54,_0x1454d4){return function(_0xfd877a){if(_0xfd877a){var _0x5cc8c5=typeof _0x1454d4[_0x6d4d('0x1b')]===_0x6d4d('0x1c')&&typeof _0x1454d4[_0x6d4d('0x1d')]==='undefined';var _0x4c42c2=_0xfd877a[_0x6d4d('0x1e')];var _0x4d2f21=_0x5cc8c5?0x0:_0x1454d4[_0x6d4d('0x1b')];var _0x50fa0f=_0x5cc8c5?_0xfd877a[_0x6d4d('0x1e')]:_0x1454d4['offset']+_0x1454d4[_0x6d4d('0x1d')];var _0x3a7877;if(_0x50fa0f>=_0x4c42c2){_0x50fa0f=_0x4c42c2;_0x3a7877=0xc8;}else{_0x3a7877=0xce;}_0x272a54[_0x6d4d('0x19')](_0x3a7877);return _0x272a54[_0x6d4d('0x1f')]('Content-Range',_0x4d2f21+'-'+_0x50fa0f+'/'+_0x4c42c2)[_0x6d4d('0x1a')](_0xfd877a);}return null;};}function patchUpdates(_0x1cba50){return function(_0x5ab093){try{jsonpatch[_0x6d4d('0x20')](_0x5ab093,_0x1cba50,!![]);}catch(_0x5c97bd){return BPromise[_0x6d4d('0x21')](_0x5c97bd);}return _0x5ab093[_0x6d4d('0x22')]();};}function saveUpdates(_0x41483f,_0x1a6ac6){return function(_0x452345){if(_0x452345){return _0x452345[_0x6d4d('0x23')](_0x41483f)[_0x6d4d('0x24')](function(_0x20e1b9){return _0x20e1b9;});}return null;};}function removeEntity(_0x26d50f,_0x330c2e){return function(_0x7491fd){if(_0x7491fd){return _0x7491fd[_0x6d4d('0x25')]()[_0x6d4d('0x24')](function(){_0x26d50f[_0x6d4d('0x19')](0xcc)[_0x6d4d('0x26')]();});}};}function handleEntityNotFound(_0x445b21,_0x4a50cf){return function(_0x1ae018){if(!_0x1ae018){_0x445b21[_0x6d4d('0x18')](0x194);}return _0x1ae018;};}function handleError(_0xbb2616,_0x83c880){_0x83c880=_0x83c880||0x1f4;return function(_0x4ed74f){logger[_0x6d4d('0x27')](_0x4ed74f[_0x6d4d('0x28')]);if(_0x4ed74f[_0x6d4d('0x29')]){delete _0x4ed74f[_0x6d4d('0x29')];}_0xbb2616[_0x6d4d('0x19')](_0x83c880)[_0x6d4d('0x2a')](_0x4ed74f);};}exports[_0x6d4d('0x2b')]=function(_0x3bfd6e,_0x1f0e2f){var _0x7f698e={},_0x4b741a={},_0x2045ce={'count':0x0,'rows':[]};var _0x499b6c=_[_0x6d4d('0x2c')](db[_0x6d4d('0x2d')]['rawAttributes'],function(_0x385e1b){return{'name':_0x385e1b[_0x6d4d('0x2e')],'type':_0x385e1b['type']['key']};});_0x4b741a['model']=_['map'](_0x499b6c,_0x6d4d('0x29'));_0x4b741a[_0x6d4d('0x2f')]=_['keys'](_0x3bfd6e['query']);_0x4b741a[_0x6d4d('0x30')]=_[_0x6d4d('0x31')](_0x4b741a['model'],_0x4b741a[_0x6d4d('0x2f')]);_0x7f698e[_0x6d4d('0x32')]=_[_0x6d4d('0x31')](_0x4b741a[_0x6d4d('0x33')],qs['fields'](_0x3bfd6e[_0x6d4d('0x2f')][_0x6d4d('0x34')]));_0x7f698e['attributes']=_0x7f698e[_0x6d4d('0x32')]['length']?_0x7f698e[_0x6d4d('0x32')]:_0x4b741a[_0x6d4d('0x33')];if(!_0x3bfd6e[_0x6d4d('0x2f')][_0x6d4d('0x35')](_0x6d4d('0x36'))){_0x7f698e[_0x6d4d('0x1d')]=qs[_0x6d4d('0x1d')](_0x3bfd6e[_0x6d4d('0x2f')][_0x6d4d('0x1d')]);_0x7f698e['offset']=qs[_0x6d4d('0x1b')](_0x3bfd6e[_0x6d4d('0x2f')][_0x6d4d('0x1b')]);}_0x7f698e[_0x6d4d('0x37')]=qs[_0x6d4d('0x38')](_0x3bfd6e['query'][_0x6d4d('0x38')]);_0x7f698e[_0x6d4d('0x39')]=qs[_0x6d4d('0x30')](_[_0x6d4d('0x3a')](_0x3bfd6e['query'],_0x4b741a[_0x6d4d('0x30')]),_0x499b6c);if(_0x3bfd6e[_0x6d4d('0x2f')][_0x6d4d('0x3b')]){_0x7f698e['where']=_[_0x6d4d('0x3c')](_0x7f698e['where'],{'$or':_[_0x6d4d('0x2c')](_0x499b6c,function(_0x285901){if(_0x285901[_0x6d4d('0x3d')]!==_0x6d4d('0x3e')){var _0x31e97e={};_0x31e97e[_0x285901['name']]={'$like':'%'+_0x3bfd6e[_0x6d4d('0x2f')][_0x6d4d('0x3b')]+'%'};return _0x31e97e;}})});}_0x7f698e=_[_0x6d4d('0x3c')]({},_0x7f698e,_0x3bfd6e[_0x6d4d('0x3f')]);var _0x8fcb7e={'where':_0x7f698e[_0x6d4d('0x39')]};return db['FaxTransferReport'][_0x6d4d('0x1e')](_0x8fcb7e)[_0x6d4d('0x24')](function(_0xa334e){_0x2045ce[_0x6d4d('0x1e')]=_0xa334e;if(_0x3bfd6e[_0x6d4d('0x2f')]['includeAll']){_0x7f698e[_0x6d4d('0x40')]=[{'all':!![]}];}return db[_0x6d4d('0x2d')]['findAll'](_0x7f698e);})[_0x6d4d('0x24')](function(_0x7afc50){_0x2045ce[_0x6d4d('0x41')]=_0x7afc50;return _0x2045ce;})[_0x6d4d('0x24')](respondWithFilteredResult(_0x1f0e2f,_0x7f698e))[_0x6d4d('0x42')](handleError(_0x1f0e2f,null));};exports[_0x6d4d('0x43')]=function(_0x253499,_0x2bac32){var _0x3a1c09={'raw':!![],'where':{'id':_0x253499[_0x6d4d('0x44')]['id']}},_0x57cb44={};_0x57cb44[_0x6d4d('0x33')]=_['keys'](db['FaxTransferReport'][_0x6d4d('0x45')]);_0x57cb44[_0x6d4d('0x2f')]=_[_0x6d4d('0x46')](_0x253499[_0x6d4d('0x2f')]);_0x57cb44['filters']=_[_0x6d4d('0x31')](_0x57cb44['model'],_0x57cb44[_0x6d4d('0x2f')]);_0x3a1c09[_0x6d4d('0x32')]=_[_0x6d4d('0x31')](_0x57cb44[_0x6d4d('0x33')],qs['fields'](_0x253499[_0x6d4d('0x2f')][_0x6d4d('0x34')]));_0x3a1c09['attributes']=_0x3a1c09[_0x6d4d('0x32')][_0x6d4d('0x47')]?_0x3a1c09[_0x6d4d('0x32')]:_0x57cb44[_0x6d4d('0x33')];if(_0x253499[_0x6d4d('0x2f')]['includeAll']){_0x3a1c09[_0x6d4d('0x40')]=[{'all':!![]}];}_0x3a1c09=_['merge']({},_0x3a1c09,_0x253499[_0x6d4d('0x3f')]);return db[_0x6d4d('0x2d')][_0x6d4d('0x48')](_0x3a1c09)[_0x6d4d('0x24')](handleEntityNotFound(_0x2bac32,null))[_0x6d4d('0x24')](respondWithResult(_0x2bac32,null))['catch'](handleError(_0x2bac32,null));};exports[_0x6d4d('0x49')]=function(_0x16ec3d,_0x401fc){return db[_0x6d4d('0x2d')][_0x6d4d('0x49')](_0x16ec3d[_0x6d4d('0x4a')],{})['then'](respondWithResult(_0x401fc,0xc9))[_0x6d4d('0x42')](handleError(_0x401fc,null));};exports[_0x6d4d('0x23')]=function(_0x520a28,_0x2439e0){if(_0x520a28[_0x6d4d('0x4a')]['id']){delete _0x520a28[_0x6d4d('0x4a')]['id'];}return db[_0x6d4d('0x2d')][_0x6d4d('0x48')]({'where':{'id':_0x520a28['params']['id']}})[_0x6d4d('0x24')](handleEntityNotFound(_0x2439e0,null))[_0x6d4d('0x24')](saveUpdates(_0x520a28['body'],null))[_0x6d4d('0x24')](respondWithResult(_0x2439e0,null))[_0x6d4d('0x42')](handleError(_0x2439e0,null));};exports['destroy']=function(_0x8a95a1,_0x19144d){return db[_0x6d4d('0x2d')][_0x6d4d('0x48')]({'where':{'id':_0x8a95a1[_0x6d4d('0x44')]['id']}})['then'](handleEntityNotFound(_0x19144d,null))[_0x6d4d('0x24')](removeEntity(_0x19144d,null))[_0x6d4d('0x42')](handleError(_0x19144d,null));};exports[_0x6d4d('0x4b')]=function(_0x4e4793,_0x22e73b){return db[_0x6d4d('0x2d')][_0x6d4d('0x4b')]()[_0x6d4d('0x24')](respondWithResult(_0x22e73b,null))[_0x6d4d('0x42')](handleError(_0x22e73b,null));}; \ No newline at end of file +var _0x1736=['path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxTransferReport','includeAll','include','findAll','rows','show','keys','find','catch','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x4f8d61,_0x29eff0){var _0x3bc078=function(_0x4c7203){while(--_0x4c7203){_0x4f8d61['push'](_0x4f8d61['shift']());}};_0x3bc078(++_0x29eff0);}(_0x1736,0x98));var _0x6173=function(_0x1277e1,_0x133847){_0x1277e1=_0x1277e1-0x0;var _0x4e6c29=_0x1736[_0x1277e1];return _0x4e6c29;};'use strict';var emlformat=require(_0x6173('0x0'));var rimraf=require(_0x6173('0x1'));var zipdir=require(_0x6173('0x2'));var jsonpatch=require(_0x6173('0x3'));var rp=require(_0x6173('0x4'));var moment=require(_0x6173('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6173('0x6'));var util=require(_0x6173('0x7'));var path=require(_0x6173('0x8'));var sox=require(_0x6173('0x9'));var csv=require(_0x6173('0xa'));var ejs=require(_0x6173('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6173('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6173('0xd'));var deskjs=require(_0x6173('0xe'));var toCsv=require(_0x6173('0xa'));var querystring=require(_0x6173('0xf'));var Papa=require(_0x6173('0x10'));var Redis=require(_0x6173('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6173('0x12'));var as=require(_0x6173('0x13'));var hardwareService=require(_0x6173('0x14'));var logger=require(_0x6173('0x15'))(_0x6173('0x16'));var utils=require(_0x6173('0x17'));var config=require(_0x6173('0x18'));var licenseUtil=require(_0x6173('0x19'));var db=require(_0x6173('0x1a'))['db'];function respondWithStatusCode(_0x258d57,_0x4a413c){_0x4a413c=_0x4a413c||0xcc;return function(_0x3639ea){if(_0x3639ea){return _0x258d57[_0x6173('0x1b')](_0x4a413c);}return _0x258d57['status'](_0x4a413c)[_0x6173('0x1c')]();};}function respondWithResult(_0x5ec2fe,_0x5ad869){_0x5ad869=_0x5ad869||0xc8;return function(_0x5caa38){if(_0x5caa38){return _0x5ec2fe[_0x6173('0x1d')](_0x5ad869)[_0x6173('0x1e')](_0x5caa38);}};}function respondWithFilteredResult(_0x40b9a9,_0x10d8fb){return function(_0x6d6e8f){if(_0x6d6e8f){var _0xbdf79d=typeof _0x10d8fb[_0x6173('0x1f')]==='undefined'&&typeof _0x10d8fb[_0x6173('0x20')]===_0x6173('0x21');var _0x431ed2=_0x6d6e8f[_0x6173('0x22')];var _0x5d5a55=_0xbdf79d?0x0:_0x10d8fb[_0x6173('0x1f')];var _0x50ed69=_0xbdf79d?_0x6d6e8f['count']:_0x10d8fb[_0x6173('0x1f')]+_0x10d8fb['limit'];var _0x574843;if(_0x50ed69>=_0x431ed2){_0x50ed69=_0x431ed2;_0x574843=0xc8;}else{_0x574843=0xce;}_0x40b9a9[_0x6173('0x1d')](_0x574843);return _0x40b9a9[_0x6173('0x23')](_0x6173('0x24'),_0x5d5a55+'-'+_0x50ed69+'/'+_0x431ed2)[_0x6173('0x1e')](_0x6d6e8f);}return null;};}function patchUpdates(_0x590928){return function(_0x3d7776){try{jsonpatch[_0x6173('0x25')](_0x3d7776,_0x590928,!![]);}catch(_0x585495){return BPromise[_0x6173('0x26')](_0x585495);}return _0x3d7776[_0x6173('0x27')]();};}function saveUpdates(_0x4194f5,_0x3ce4ee){return function(_0x33b021){if(_0x33b021){return _0x33b021[_0x6173('0x28')](_0x4194f5)[_0x6173('0x29')](function(_0x5dddbb){return _0x5dddbb;});}return null;};}function removeEntity(_0x1272e3,_0x3bd53c){return function(_0x1e0845){if(_0x1e0845){return _0x1e0845['destroy']()[_0x6173('0x29')](function(){_0x1272e3[_0x6173('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30589c,_0x4914f6){return function(_0x117fb6){if(!_0x117fb6){_0x30589c[_0x6173('0x1b')](0x194);}return _0x117fb6;};}function handleError(_0x5c7051,_0x5288be){_0x5288be=_0x5288be||0x1f4;return function(_0x43a416){logger[_0x6173('0x2a')](_0x43a416[_0x6173('0x2b')]);if(_0x43a416['name']){delete _0x43a416[_0x6173('0x2c')];}_0x5c7051[_0x6173('0x1d')](_0x5288be)[_0x6173('0x2d')](_0x43a416);};}exports['index']=function(_0x1fa6ca,_0x43fa66){var _0x2b63a3={},_0x18c25c={},_0x3c7157={'count':0x0,'rows':[]};var _0x105839=_['map'](db['FaxTransferReport'][_0x6173('0x2e')],function(_0x1b5590){return{'name':_0x1b5590[_0x6173('0x2f')],'type':_0x1b5590[_0x6173('0x30')][_0x6173('0x31')]};});_0x18c25c[_0x6173('0x32')]=_[_0x6173('0x33')](_0x105839,_0x6173('0x2c'));_0x18c25c['query']=_['keys'](_0x1fa6ca['query']);_0x18c25c[_0x6173('0x34')]=_[_0x6173('0x35')](_0x18c25c[_0x6173('0x32')],_0x18c25c[_0x6173('0x36')]);_0x2b63a3[_0x6173('0x37')]=_[_0x6173('0x35')](_0x18c25c[_0x6173('0x32')],qs['fields'](_0x1fa6ca['query']['fields']));_0x2b63a3[_0x6173('0x37')]=_0x2b63a3[_0x6173('0x37')][_0x6173('0x38')]?_0x2b63a3[_0x6173('0x37')]:_0x18c25c['model'];if(!_0x1fa6ca[_0x6173('0x36')]['hasOwnProperty'](_0x6173('0x39'))){_0x2b63a3[_0x6173('0x20')]=qs[_0x6173('0x20')](_0x1fa6ca[_0x6173('0x36')][_0x6173('0x20')]);_0x2b63a3[_0x6173('0x1f')]=qs[_0x6173('0x1f')](_0x1fa6ca['query'][_0x6173('0x1f')]);}_0x2b63a3[_0x6173('0x3a')]=qs['sort'](_0x1fa6ca[_0x6173('0x36')][_0x6173('0x3b')]);_0x2b63a3[_0x6173('0x3c')]=qs[_0x6173('0x34')](_[_0x6173('0x3d')](_0x1fa6ca[_0x6173('0x36')],_0x18c25c[_0x6173('0x34')]),_0x105839);if(_0x1fa6ca[_0x6173('0x36')][_0x6173('0x3e')]){_0x2b63a3['where']=_[_0x6173('0x3f')](_0x2b63a3[_0x6173('0x3c')],{'$or':_[_0x6173('0x33')](_0x105839,function(_0x348d81){if(_0x348d81[_0x6173('0x30')]!==_0x6173('0x40')){var _0x142660={};_0x142660[_0x348d81[_0x6173('0x2c')]]={'$like':'%'+_0x1fa6ca[_0x6173('0x36')][_0x6173('0x3e')]+'%'};return _0x142660;}})});}_0x2b63a3=_['merge']({},_0x2b63a3,_0x1fa6ca[_0x6173('0x41')]);var _0x39c4e2={'where':_0x2b63a3[_0x6173('0x3c')]};return db[_0x6173('0x42')][_0x6173('0x22')](_0x39c4e2)['then'](function(_0x4b8709){_0x3c7157[_0x6173('0x22')]=_0x4b8709;if(_0x1fa6ca[_0x6173('0x36')][_0x6173('0x43')]){_0x2b63a3[_0x6173('0x44')]=[{'all':!![]}];}return db[_0x6173('0x42')][_0x6173('0x45')](_0x2b63a3);})['then'](function(_0x376e0a){_0x3c7157[_0x6173('0x46')]=_0x376e0a;return _0x3c7157;})[_0x6173('0x29')](respondWithFilteredResult(_0x43fa66,_0x2b63a3))['catch'](handleError(_0x43fa66,null));};exports[_0x6173('0x47')]=function(_0x39d869,_0x4f4de7){var _0x339adc={'raw':!![],'where':{'id':_0x39d869['params']['id']}},_0x3f9833={};_0x3f9833['model']=_[_0x6173('0x48')](db[_0x6173('0x42')][_0x6173('0x2e')]);_0x3f9833[_0x6173('0x36')]=_[_0x6173('0x48')](_0x39d869[_0x6173('0x36')]);_0x3f9833[_0x6173('0x34')]=_[_0x6173('0x35')](_0x3f9833[_0x6173('0x32')],_0x3f9833[_0x6173('0x36')]);_0x339adc['attributes']=_[_0x6173('0x35')](_0x3f9833[_0x6173('0x32')],qs['fields'](_0x39d869[_0x6173('0x36')]['fields']));_0x339adc[_0x6173('0x37')]=_0x339adc[_0x6173('0x37')]['length']?_0x339adc[_0x6173('0x37')]:_0x3f9833[_0x6173('0x32')];if(_0x39d869[_0x6173('0x36')]['includeAll']){_0x339adc[_0x6173('0x44')]=[{'all':!![]}];}_0x339adc=_[_0x6173('0x3f')]({},_0x339adc,_0x39d869[_0x6173('0x41')]);return db['FaxTransferReport'][_0x6173('0x49')](_0x339adc)[_0x6173('0x29')](handleEntityNotFound(_0x4f4de7,null))['then'](respondWithResult(_0x4f4de7,null))[_0x6173('0x4a')](handleError(_0x4f4de7,null));};exports[_0x6173('0x4b')]=function(_0x307c34,_0x3da157){return db[_0x6173('0x42')][_0x6173('0x4b')](_0x307c34[_0x6173('0x4c')],{})[_0x6173('0x29')](respondWithResult(_0x3da157,0xc9))[_0x6173('0x4a')](handleError(_0x3da157,null));};exports[_0x6173('0x28')]=function(_0x1ac758,_0x3a5549){if(_0x1ac758[_0x6173('0x4c')]['id']){delete _0x1ac758[_0x6173('0x4c')]['id'];}return db[_0x6173('0x42')][_0x6173('0x49')]({'where':{'id':_0x1ac758[_0x6173('0x4d')]['id']}})[_0x6173('0x29')](handleEntityNotFound(_0x3a5549,null))[_0x6173('0x29')](saveUpdates(_0x1ac758['body'],null))[_0x6173('0x29')](respondWithResult(_0x3a5549,null))['catch'](handleError(_0x3a5549,null));};exports[_0x6173('0x4e')]=function(_0x31f66d,_0x43e730){return db[_0x6173('0x42')][_0x6173('0x49')]({'where':{'id':_0x31f66d[_0x6173('0x4d')]['id']}})[_0x6173('0x29')](handleEntityNotFound(_0x43e730,null))['then'](removeEntity(_0x43e730,null))['catch'](handleError(_0x43e730,null));};exports[_0x6173('0x4f')]=function(_0xb6a22,_0x581173){return db['FaxTransferReport'][_0x6173('0x4f')]()[_0x6173('0x29')](respondWithResult(_0x581173,null))[_0x6173('0x4a')](handleError(_0x581173,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 5d48900..72a21d2 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 _0x9c8c=['define','report_fax_transfer','uniqueid','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x9c8c,0x1b1));var _0xc9c8=function(_0x44a647,_0x37db85){_0x44a647=_0x44a647-0x0;var _0x610306=_0x9c8c[_0x44a647];return _0x610306;};'use strict';var _=require(_0xc9c8('0x0'));var util=require('util');var logger=require(_0xc9c8('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc9c8('0x2'));var fs=require('fs');var path=require(_0xc9c8('0x3'));var rimraf=require(_0xc9c8('0x4'));var config=require(_0xc9c8('0x5'));var attributes=require(_0xc9c8('0x6'));module['exports']=function(_0xf86118,_0x294dfb){return _0xf86118[_0xc9c8('0x7')]('FaxTransferReport',attributes,{'tableName':_0xc9c8('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc9c8('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x099e=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x099e,0x129));var _0xe099=function(_0x5d2637,_0x10eccc){_0x5d2637=_0x5d2637-0x0;var _0x33af90=_0x099e[_0x5d2637];return _0x33af90;};'use strict';var _=require(_0xe099('0x0'));var util=require(_0xe099('0x1'));var logger=require(_0xe099('0x2'))(_0xe099('0x3'));var moment=require(_0xe099('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe099('0x5'));var rimraf=require(_0xe099('0x6'));var config=require(_0xe099('0x7'));var attributes=require(_0xe099('0x8'));module[_0xe099('0x9')]=function(_0x137d3e,_0x4f82c7){return _0x137d3e[_0xe099('0xa')](_0xe099('0xb'),attributes,{'tableName':_0xe099('0xc'),'paranoid':![],'indexes':[{'name':_0xe099('0xd'),'fields':[_0xe099('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 90a9cd5..839a0c1 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 _0x5f00=['stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x446c5b,_0x232230){var _0x3d07db=function(_0x28834b){while(--_0x28834b){_0x446c5b['push'](_0x446c5b['shift']());}};_0x3d07db(++_0x232230);}(_0x5f00,0x123));var _0x05f0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f00[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x05f0('0x0'));var util=require(_0x05f0('0x1'));var moment=require(_0x05f0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05f0('0x3'));var db=require(_0x05f0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x05f0('0x5'))('rpc');var config=require(_0x05f0('0x6'));var jayson=require(_0x05f0('0x7'));var client=jayson[_0x05f0('0x8')][_0x05f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3121f2,_0x5d31eb,_0x235570){return new BPromise(function(_0x2a45b5,_0x11c2a5){return client[_0x05f0('0xa')](_0x3121f2,_0x235570)[_0x05f0('0xb')](function(_0x5877d2){logger[_0x05f0('0xc')](_0x05f0('0xd'),_0x5d31eb,'request\x20sent');logger[_0x05f0('0xe')](_0x05f0('0xf'),_0x5d31eb,_0x05f0('0x10'),JSON[_0x05f0('0x11')](_0x5877d2));if(_0x5877d2['error']){if(_0x5877d2[_0x05f0('0x12')][_0x05f0('0x13')]===0x1f4){logger[_0x05f0('0x12')](_0x05f0('0xd'),_0x5d31eb,_0x5877d2[_0x05f0('0x12')][_0x05f0('0x14')]);return _0x11c2a5(_0x5877d2['error'][_0x05f0('0x14')]);}logger['error'](_0x05f0('0xd'),_0x5d31eb,_0x5877d2['error'][_0x05f0('0x14')]);return _0x2a45b5(_0x5877d2[_0x05f0('0x12')][_0x05f0('0x14')]);}else{logger['info'](_0x05f0('0xd'),_0x5d31eb,'request\x20sent');_0x2a45b5(_0x5877d2['result']['message']);}})[_0x05f0('0x15')](function(_0x3e2cfe){logger[_0x05f0('0x12')](_0x05f0('0xd'),_0x5d31eb,_0x3e2cfe);_0x11c2a5(_0x3e2cfe);});});} \ No newline at end of file +var _0xa2bb=['../../config/environment','jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14e947,_0x1d07c6){var _0x4fbe18=function(_0x11d0e7){while(--_0x11d0e7){_0x14e947['push'](_0x14e947['shift']());}};_0x4fbe18(++_0x1d07c6);}(_0xa2bb,0xdd));var _0xba2b=function(_0x586365,_0x3e2047){_0x586365=_0x586365-0x0;var _0x11c068=_0xa2bb[_0x586365];return _0x11c068;};'use strict';var _=require(_0xba2b('0x0'));var util=require('util');var moment=require(_0xba2b('0x1'));var BPromise=require(_0xba2b('0x2'));var rs=require(_0xba2b('0x3'));var fs=require('fs');var Redis=require(_0xba2b('0x4'));var db=require(_0xba2b('0x5'))['db'];var utils=require(_0xba2b('0x6'));var logger=require(_0xba2b('0x7'))(_0xba2b('0x8'));var config=require(_0xba2b('0x9'));var jayson=require(_0xba2b('0xa'));var client=jayson[_0xba2b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f0e4e,_0x46ef37,_0x1d58a0){return new BPromise(function(_0x438a99,_0x23da2a){return client[_0xba2b('0xc')](_0x5f0e4e,_0x1d58a0)[_0xba2b('0xd')](function(_0x47c755){logger[_0xba2b('0xe')](_0xba2b('0xf'),_0x46ef37,_0xba2b('0x10'));logger[_0xba2b('0x11')](_0xba2b('0x12'),_0x46ef37,_0xba2b('0x10'),JSON[_0xba2b('0x13')](_0x47c755));if(_0x47c755[_0xba2b('0x14')]){if(_0x47c755[_0xba2b('0x14')]['code']===0x1f4){logger[_0xba2b('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x46ef37,_0x47c755[_0xba2b('0x14')][_0xba2b('0x15')]);return _0x23da2a(_0x47c755['error'][_0xba2b('0x15')]);}logger[_0xba2b('0x14')](_0xba2b('0xf'),_0x46ef37,_0x47c755['error'][_0xba2b('0x15')]);return _0x438a99(_0x47c755[_0xba2b('0x14')]['message']);}else{logger[_0xba2b('0xe')](_0xba2b('0xf'),_0x46ef37,_0xba2b('0x10'));_0x438a99(_0x47c755['result'][_0xba2b('0x15')]);}})[_0xba2b('0x16')](function(_0x2c8cd9){logger[_0xba2b('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x46ef37,_0x2c8cd9);_0x23da2a(_0x2c8cd9);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 347bb84..e73871a 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 _0xebca=['post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./faxTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x13bc40,_0x3c6a05){var _0x587e27=function(_0x5811d2){while(--_0x5811d2){_0x13bc40['push'](_0x13bc40['shift']());}};_0x587e27(++_0x3c6a05);}(_0xebca,0x1f4));var _0xaebc=function(_0x250514,_0x389eda){_0x250514=_0x250514-0x0;var _0x59c25b=_0xebca[_0x250514];return _0x59c25b;};'use strict';var multer=require(_0xaebc('0x0'));var util=require(_0xaebc('0x1'));var path=require('path');var timeout=require(_0xaebc('0x2'));var express=require('express');var router=express[_0xaebc('0x3')]();var fs_extra=require(_0xaebc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xaebc('0x5'));var config=require('../../config/environment');var controller=require(_0xaebc('0x6'));router['get']('/',auth[_0xaebc('0x7')](),controller['index']);router[_0xaebc('0x8')](_0xaebc('0x9'),auth['isAuthenticated'](),controller[_0xaebc('0xa')]);router[_0xaebc('0x8')](_0xaebc('0xb'),auth[_0xaebc('0x7')](),controller[_0xaebc('0xc')]);router[_0xaebc('0xd')]('/',auth[_0xaebc('0x7')](),controller[_0xaebc('0xe')]);router['put'](_0xaebc('0xb'),auth[_0xaebc('0x7')](),controller[_0xaebc('0xf')]);router[_0xaebc('0x10')](_0xaebc('0xb'),auth['isAuthenticated'](),controller[_0xaebc('0x11')]);module[_0xaebc('0x12')]=router; \ No newline at end of file +var _0x87c6=['../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','put','update','/:id','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5bbb64,_0xf56e3c){var _0x309aca=function(_0x3ba67e){while(--_0x3ba67e){_0x5bbb64['push'](_0x5bbb64['shift']());}};_0x309aca(++_0xf56e3c);}(_0x87c6,0x12c));var _0x687c=function(_0x229e95,_0x2ed8a4){_0x229e95=_0x229e95-0x0;var _0x2e61b0=_0x87c6[_0x229e95];return _0x2e61b0;};'use strict';var multer=require(_0x687c('0x0'));var util=require('util');var path=require(_0x687c('0x1'));var timeout=require(_0x687c('0x2'));var express=require(_0x687c('0x3'));var router=express[_0x687c('0x4')]();var fs_extra=require(_0x687c('0x5'));var auth=require(_0x687c('0x6'));var interaction=require(_0x687c('0x7'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0x687c('0x8')]('/',auth['isAuthenticated'](),controller[_0x687c('0x9')]);router[_0x687c('0x8')](_0x687c('0xa'),auth[_0x687c('0xb')](),controller[_0x687c('0xc')]);router[_0x687c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x687c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x687c('0xe')]('/:id',auth[_0x687c('0xb')](),controller[_0x687c('0xf')]);router['delete'](_0x687c('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x687c('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 8995476..f6be240 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 _0x3743=['delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put'];(function(_0x58bd44,_0x2a26cd){var _0x561dff=function(_0x45ddc8){while(--_0x45ddc8){_0x58bd44['push'](_0x58bd44['shift']());}};_0x561dff(++_0x2a26cd);}(_0x3743,0x14b));var _0x3374=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0x3743[_0x190ff6];return _0x5356d2;};'use strict';var multer=require('multer');var util=require(_0x3374('0x0'));var path=require(_0x3374('0x1'));var timeout=require(_0x3374('0x2'));var express=require(_0x3374('0x3'));var router=express[_0x3374('0x4')]();var fs_extra=require(_0x3374('0x5'));var auth=require(_0x3374('0x6'));var interaction=require(_0x3374('0x7'));var config=require(_0x3374('0x8'));var controller=require(_0x3374('0x9'));router[_0x3374('0xa')]('/',auth['isAuthenticated'](),controller[_0x3374('0xb')]);router[_0x3374('0xa')](_0x3374('0xc'),auth[_0x3374('0xd')](),controller['show']);router[_0x3374('0xa')]('/:id/configurations',auth[_0x3374('0xd')](),controller[_0x3374('0xe')]);router[_0x3374('0xa')](_0x3374('0xf'),auth['isAuthenticated'](),controller[_0x3374('0x10')]);router[_0x3374('0x11')]('/',auth[_0x3374('0xd')](),controller[_0x3374('0x12')]);router[_0x3374('0x11')](_0x3374('0x13'),auth[_0x3374('0xd')](),controller['addConfiguration']);router[_0x3374('0x14')](_0x3374('0xc'),auth[_0x3374('0xd')](),controller['update']);router[_0x3374('0x15')](_0x3374('0xc'),auth[_0x3374('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb155=['addConfiguration','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post'];(function(_0x142c2b,_0x2a8bb0){var _0x42388e=function(_0x502505){while(--_0x502505){_0x142c2b['push'](_0x142c2b['shift']());}};_0x42388e(++_0x2a8bb0);}(_0xb155,0x1f4));var _0x5b15=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0xb155[_0x39ffd1];return _0x31267e;};'use strict';var multer=require(_0x5b15('0x0'));var util=require(_0x5b15('0x1'));var path=require('path');var timeout=require(_0x5b15('0x2'));var express=require(_0x5b15('0x3'));var router=express[_0x5b15('0x4')]();var fs_extra=require(_0x5b15('0x5'));var auth=require(_0x5b15('0x6'));var interaction=require(_0x5b15('0x7'));var config=require(_0x5b15('0x8'));var controller=require(_0x5b15('0x9'));router['get']('/',auth[_0x5b15('0xa')](),controller[_0x5b15('0xb')]);router['get']('/:id',auth[_0x5b15('0xa')](),controller[_0x5b15('0xc')]);router[_0x5b15('0xd')](_0x5b15('0xe'),auth['isAuthenticated'](),controller[_0x5b15('0xf')]);router['get'](_0x5b15('0x10'),auth[_0x5b15('0xa')](),controller[_0x5b15('0x11')]);router['post']('/',auth[_0x5b15('0xa')](),controller[_0x5b15('0x12')]);router[_0x5b15('0x13')](_0x5b15('0xe'),auth[_0x5b15('0xa')](),controller[_0x5b15('0x14')]);router[_0x5b15('0x15')](_0x5b15('0x16'),auth[_0x5b15('0xa')](),controller[_0x5b15('0x17')]);router[_0x5b15('0x18')](_0x5b15('0x16'),auth[_0x5b15('0xa')](),controller[_0x5b15('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 89f118a..340526b 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 _0x7292=['exports','STRING','ENUM','basic','integrationTab','sequelize'];(function(_0x447746,_0x561230){var _0x1cc244=function(_0x50cce9){while(--_0x50cce9){_0x447746['push'](_0x447746['shift']());}};_0x1cc244(++_0x561230);}(_0x7292,0x107));var _0x2729=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x7292[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0x2729('0x0'));module[_0x2729('0x1')]={'name':{'type':Sequelize[_0x2729('0x2')]},'description':{'type':Sequelize[_0x2729('0x2')]},'username':{'type':Sequelize[_0x2729('0x2')]},'remoteUri':{'type':Sequelize[_0x2729('0x2')]},'authType':{'type':Sequelize[_0x2729('0x3')]('basic'),'defaultValue':_0x2729('0x4')},'password':{'type':Sequelize[_0x2729('0x2')]},'consumerKey':{'type':Sequelize[_0x2729('0x2')]},'consumerSecret':{'type':Sequelize[_0x2729('0x2')]},'token':{'type':Sequelize[_0x2729('0x2')]},'tokenSecret':{'type':Sequelize[_0x2729('0x2')]},'serverUrl':{'type':Sequelize[_0x2729('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2729('0x3')](_0x2729('0x5'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xdfb1=['sequelize','exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x3f3b4c,_0x81d0f){var _0x25b938=function(_0x68eea2){while(--_0x68eea2){_0x3f3b4c['push'](_0x3f3b4c['shift']());}};_0x25b938(++_0x81d0f);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x44bb1c,_0x5f10b9){_0x44bb1c=_0x44bb1c-0x0;var _0x49ffe4=_0xdfb1[_0x44bb1c];return _0x49ffe4;};'use strict';var Sequelize=require(_0x1dfb('0x0'));module[_0x1dfb('0x1')]={'name':{'type':Sequelize[_0x1dfb('0x2')]},'description':{'type':Sequelize[_0x1dfb('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1dfb('0x2')]},'authType':{'type':Sequelize[_0x1dfb('0x3')](_0x1dfb('0x4')),'defaultValue':_0x1dfb('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x1dfb('0x2')]},'tokenSecret':{'type':Sequelize[_0x1dfb('0x2')]},'serverUrl':{'type':Sequelize[_0x1dfb('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1dfb('0x5'),_0x1dfb('0x6')),'defaultValue':_0x1dfb('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index aa4103d..c9b4dd2 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 _0x3423=['%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','password','toString','base64','concat','_embedded','entries','active','test','statusCode','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','jayson/promise','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','name','send','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','keys','options','create','body','find','getConfigurations','findOne','DeskConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','remoteUri','username','token','tokenSecret','substring','GET','format'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x3423,0x1f0));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3342('0x0'));var rimraf=require(_0x3342('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3342('0x2'));var rp=require(_0x3342('0x3'));var moment=require(_0x3342('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3342('0x5'));var util=require(_0x3342('0x6'));var path=require(_0x3342('0x7'));var sox=require('sox');var csv=require(_0x3342('0x8'));var ejs=require(_0x3342('0x9'));var fs=require('fs');var fs_extra=require(_0x3342('0xa'));var _=require(_0x3342('0xb'));var squel=require(_0x3342('0xc'));var crypto=require(_0x3342('0xd'));var jsforce=require(_0x3342('0xe'));var deskjs=require(_0x3342('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3342('0x10'));var Papa=require(_0x3342('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3342('0x12'));var as=require(_0x3342('0x13'));var hardwareService=require(_0x3342('0x14'));var logger=require('../../config/logger')(_0x3342('0x15'));var utils=require('../../config/utils');var config=require(_0x3342('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x3342('0x17'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x124745,_0x27e6b1,_0x2dd9d0,_0x24e1ea){return new BPromise(function(_0x10be5d,_0x5705f3){var _0x239468=_0x24e1ea||client;return _0x239468[_0x3342('0x18')](_0x124745,_0x2dd9d0)[_0x3342('0x19')](function(_0xb1428f){logger[_0x3342('0x1a')](_0x3342('0x1b'),_0x27e6b1,'request\x20sent');logger[_0x3342('0x1c')](_0x3342('0x1d'),_0x27e6b1,_0x3342('0x1e'),JSON[_0x3342('0x1f')](_0xb1428f));if(_0xb1428f['error']){if(_0xb1428f[_0x3342('0x20')][_0x3342('0x21')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x27e6b1,_0xb1428f[_0x3342('0x20')][_0x3342('0x22')]);return _0x5705f3(_0xb1428f[_0x3342('0x20')]['message']);}logger[_0x3342('0x20')](_0x3342('0x1b'),_0x27e6b1,_0xb1428f[_0x3342('0x20')][_0x3342('0x22')]);return _0x10be5d(_0xb1428f['error'][_0x3342('0x22')]);}else{logger[_0x3342('0x1a')](_0x3342('0x1b'),_0x27e6b1,_0x3342('0x1e'));_0x10be5d(_0xb1428f[_0x3342('0x23')]['message']);}})[_0x3342('0x24')](function(_0x2a4273){logger['error'](_0x3342('0x1b'),_0x27e6b1,_0x2a4273);_0x5705f3(_0x2a4273);});});}function respondWithStatusCode(_0x58d2a0,_0x1b8298){_0x1b8298=_0x1b8298||0xcc;return function(_0x5172f9){if(_0x5172f9){return _0x58d2a0[_0x3342('0x25')](_0x1b8298);}return _0x58d2a0[_0x3342('0x26')](_0x1b8298)[_0x3342('0x27')]();};}function respondWithResult(_0x3cf3fb,_0x5c310a){_0x5c310a=_0x5c310a||0xc8;return function(_0x4f52e1){if(_0x4f52e1){return _0x3cf3fb[_0x3342('0x26')](_0x5c310a)[_0x3342('0x28')](_0x4f52e1);}};}function respondWithFilteredResult(_0x4d156d,_0xcbc395){return function(_0x510f65){if(_0x510f65){var _0xf7a119=typeof _0xcbc395[_0x3342('0x29')]===_0x3342('0x2a')&&typeof _0xcbc395[_0x3342('0x2b')]===_0x3342('0x2a');var _0x3d3317=_0x510f65[_0x3342('0x2c')];var _0x4602f6=_0xf7a119?0x0:_0xcbc395['offset'];var _0x248ff7=_0xf7a119?_0x510f65[_0x3342('0x2c')]:_0xcbc395[_0x3342('0x29')]+_0xcbc395[_0x3342('0x2b')];var _0x50e869;if(_0x248ff7>=_0x3d3317){_0x248ff7=_0x3d3317;_0x50e869=0xc8;}else{_0x50e869=0xce;}_0x4d156d[_0x3342('0x26')](_0x50e869);return _0x4d156d[_0x3342('0x2d')](_0x3342('0x2e'),_0x4602f6+'-'+_0x248ff7+'/'+_0x3d3317)[_0x3342('0x28')](_0x510f65);}return null;};}function patchUpdates(_0x2e2701){return function(_0x41f562){try{jsonpatch['apply'](_0x41f562,_0x2e2701,!![]);}catch(_0x47f31b){return BPromise[_0x3342('0x2f')](_0x47f31b);}return _0x41f562['save']();};}function saveUpdates(_0x4ddfba,_0x5a9fce){return function(_0x53aecd){if(_0x53aecd){return _0x53aecd[_0x3342('0x30')](_0x4ddfba)[_0x3342('0x19')](function(_0x5e3a37){return _0x5e3a37;});}return null;};}function removeEntity(_0x660db1,_0x14ca8e){return function(_0x3adf77){if(_0x3adf77){return _0x3adf77[_0x3342('0x31')]()[_0x3342('0x19')](function(){_0x660db1[_0x3342('0x26')](0xcc)[_0x3342('0x27')]();});}};}function handleEntityNotFound(_0x5b4d0e,_0x278231){return function(_0x2ff98b){if(!_0x2ff98b){_0x5b4d0e[_0x3342('0x25')](0x194);}return _0x2ff98b;};}function handleError(_0x3e8e13,_0x2fd1d8){_0x2fd1d8=_0x2fd1d8||0x1f4;return function(_0x100b0c){logger[_0x3342('0x20')](_0x100b0c[_0x3342('0x32')]);if(_0x100b0c[_0x3342('0x33')]){delete _0x100b0c[_0x3342('0x33')];}_0x3e8e13['status'](_0x2fd1d8)[_0x3342('0x34')](_0x100b0c);};}exports[_0x3342('0x35')]=function(_0x45078a,_0x88ddfb){var _0xf3bfe3={},_0x1a78be={},_0xeb3301={'count':0x0,'rows':[]};var _0x5d9b53=_['map'](db[_0x3342('0x36')][_0x3342('0x37')],function(_0x27e573){return{'name':_0x27e573[_0x3342('0x38')],'type':_0x27e573[_0x3342('0x39')][_0x3342('0x3a')]};});_0x1a78be[_0x3342('0x3b')]=_[_0x3342('0x3c')](_0x5d9b53,'name');_0x1a78be['query']=_['keys'](_0x45078a[_0x3342('0x3d')]);_0x1a78be[_0x3342('0x3e')]=_[_0x3342('0x3f')](_0x1a78be[_0x3342('0x3b')],_0x1a78be['query']);_0xf3bfe3[_0x3342('0x40')]=_[_0x3342('0x3f')](_0x1a78be['model'],qs[_0x3342('0x41')](_0x45078a['query']['fields']));_0xf3bfe3['attributes']=_0xf3bfe3[_0x3342('0x40')][_0x3342('0x42')]?_0xf3bfe3['attributes']:_0x1a78be[_0x3342('0x3b')];if(!_0x45078a[_0x3342('0x3d')]['hasOwnProperty'](_0x3342('0x43'))){_0xf3bfe3[_0x3342('0x2b')]=qs[_0x3342('0x2b')](_0x45078a['query'][_0x3342('0x2b')]);_0xf3bfe3[_0x3342('0x29')]=qs[_0x3342('0x29')](_0x45078a['query'][_0x3342('0x29')]);}_0xf3bfe3[_0x3342('0x44')]=qs[_0x3342('0x45')](_0x45078a[_0x3342('0x3d')][_0x3342('0x45')]);_0xf3bfe3[_0x3342('0x46')]=qs[_0x3342('0x3e')](_[_0x3342('0x47')](_0x45078a[_0x3342('0x3d')],_0x1a78be[_0x3342('0x3e')]),_0x5d9b53);if(_0x45078a[_0x3342('0x3d')][_0x3342('0x48')]){_0xf3bfe3[_0x3342('0x46')]=_[_0x3342('0x49')](_0xf3bfe3['where'],{'$or':_['map'](_0x5d9b53,function(_0x4b2f99){if(_0x4b2f99[_0x3342('0x39')]!=='VIRTUAL'){var _0x5a8bca={};_0x5a8bca[_0x4b2f99[_0x3342('0x33')]]={'$like':'%'+_0x45078a[_0x3342('0x3d')][_0x3342('0x48')]+'%'};return _0x5a8bca;}})});}_0xf3bfe3=_[_0x3342('0x49')]({},_0xf3bfe3,_0x45078a['options']);var _0x156eb1={'where':_0xf3bfe3['where']};return db['DeskAccount'][_0x3342('0x2c')](_0x156eb1)[_0x3342('0x19')](function(_0x1dbed9){_0xeb3301[_0x3342('0x2c')]=_0x1dbed9;if(_0x45078a[_0x3342('0x3d')][_0x3342('0x4a')]){_0xf3bfe3[_0x3342('0x4b')]=[{'all':!![]}];}return db[_0x3342('0x36')][_0x3342('0x4c')](_0xf3bfe3);})[_0x3342('0x19')](function(_0x229587){_0xeb3301[_0x3342('0x4d')]=_0x229587;return _0xeb3301;})[_0x3342('0x19')](respondWithFilteredResult(_0x88ddfb,_0xf3bfe3))[_0x3342('0x24')](handleError(_0x88ddfb,null));};exports[_0x3342('0x4e')]=function(_0x3988f5,_0x525d95){var _0x5cb788={'raw':![],'where':{'id':_0x3988f5[_0x3342('0x4f')]['id']}},_0x22a51f={};_0x22a51f['model']=_[_0x3342('0x50')](db[_0x3342('0x36')][_0x3342('0x37')]);_0x22a51f['query']=_[_0x3342('0x50')](_0x3988f5[_0x3342('0x3d')]);_0x22a51f[_0x3342('0x3e')]=_[_0x3342('0x3f')](_0x22a51f[_0x3342('0x3b')],_0x22a51f[_0x3342('0x3d')]);_0x5cb788[_0x3342('0x40')]=_[_0x3342('0x3f')](_0x22a51f[_0x3342('0x3b')],qs[_0x3342('0x41')](_0x3988f5[_0x3342('0x3d')][_0x3342('0x41')]));_0x5cb788[_0x3342('0x40')]=_0x5cb788['attributes'][_0x3342('0x42')]?_0x5cb788[_0x3342('0x40')]:_0x22a51f['model'];if(_0x3988f5[_0x3342('0x3d')][_0x3342('0x4a')]){_0x5cb788[_0x3342('0x4b')]=[{'all':!![]}];}_0x5cb788=_[_0x3342('0x49')]({},_0x5cb788,_0x3988f5[_0x3342('0x51')]);return db[_0x3342('0x36')]['find'](_0x5cb788)[_0x3342('0x19')](handleEntityNotFound(_0x525d95,null))[_0x3342('0x19')](respondWithResult(_0x525d95,null))[_0x3342('0x24')](handleError(_0x525d95,null));};exports[_0x3342('0x52')]=function(_0x3a53fc,_0x2e1c59){return db[_0x3342('0x36')][_0x3342('0x52')](_0x3a53fc[_0x3342('0x53')],{})[_0x3342('0x19')](respondWithResult(_0x2e1c59,0xc9))[_0x3342('0x24')](handleError(_0x2e1c59,null));};exports[_0x3342('0x30')]=function(_0x21e962,_0x4e80b6){if(_0x21e962[_0x3342('0x53')]['id']){delete _0x21e962['body']['id'];}return db[_0x3342('0x36')][_0x3342('0x54')]({'where':{'id':_0x21e962['params']['id']}})[_0x3342('0x19')](handleEntityNotFound(_0x4e80b6,null))[_0x3342('0x19')](saveUpdates(_0x21e962['body'],null))[_0x3342('0x19')](respondWithResult(_0x4e80b6,null))[_0x3342('0x24')](handleError(_0x4e80b6,null));};exports[_0x3342('0x31')]=function(_0x2da140,_0x54e703){return db[_0x3342('0x36')][_0x3342('0x54')]({'where':{'id':_0x2da140[_0x3342('0x4f')]['id']}})[_0x3342('0x19')](handleEntityNotFound(_0x54e703,null))[_0x3342('0x19')](removeEntity(_0x54e703,null))[_0x3342('0x24')](handleError(_0x54e703,null));};exports[_0x3342('0x55')]=function(_0x3d4f61,_0xe822fc,_0x521e3b){var _0x367d99={};var _0x5576e2={};var _0x2d56c2;var _0x255f5f;return db[_0x3342('0x36')][_0x3342('0x56')]({'where':{'id':_0x3d4f61[_0x3342('0x4f')]['id']}})['then'](handleEntityNotFound(_0xe822fc,null))[_0x3342('0x19')](function(_0x2fedf5){if(_0x2fedf5){_0x2d56c2=_0x2fedf5;_0x5576e2['model']=_[_0x3342('0x50')](db[_0x3342('0x57')]['rawAttributes']);_0x5576e2[_0x3342('0x3d')]=_[_0x3342('0x50')](_0x3d4f61[_0x3342('0x3d')]);_0x5576e2[_0x3342('0x3e')]=_[_0x3342('0x3f')](_0x5576e2['model'],_0x5576e2['query']);_0x367d99[_0x3342('0x40')]=_[_0x3342('0x3f')](_0x5576e2['model'],qs['fields'](_0x3d4f61[_0x3342('0x3d')][_0x3342('0x41')]));_0x367d99[_0x3342('0x40')]=_0x367d99[_0x3342('0x40')][_0x3342('0x42')]?_0x367d99[_0x3342('0x40')]:_0x5576e2['model'];_0x367d99[_0x3342('0x44')]=qs[_0x3342('0x45')](_0x3d4f61[_0x3342('0x3d')][_0x3342('0x45')]);_0x367d99['where']=qs[_0x3342('0x3e')](_['pick'](_0x3d4f61[_0x3342('0x3d')],_0x5576e2[_0x3342('0x3e')]));if(_0x3d4f61[_0x3342('0x3d')][_0x3342('0x48')]){_0x367d99[_0x3342('0x46')]=_['merge'](_0x367d99[_0x3342('0x46')],{'$or':_[_0x3342('0x3c')](_0x367d99[_0x3342('0x40')],function(_0x244ea5){var _0x44ac5b={};_0x44ac5b[_0x244ea5]={'$like':'%'+_0x3d4f61[_0x3342('0x3d')][_0x3342('0x48')]+'%'};return _0x44ac5b;})});}_0x367d99=_['merge']({},_0x367d99,_0x3d4f61[_0x3342('0x51')]);return _0x2d56c2[_0x3342('0x55')](_0x367d99);}})[_0x3342('0x19')](function(_0x273683){if(_0x273683){_0x255f5f=_0x273683[_0x3342('0x42')];if(!_0x3d4f61[_0x3342('0x3d')]['hasOwnProperty'](_0x3342('0x43'))){_0x367d99[_0x3342('0x2b')]=qs[_0x3342('0x2b')](_0x3d4f61['query']['limit']);_0x367d99['offset']=qs['offset'](_0x3d4f61[_0x3342('0x3d')][_0x3342('0x29')]);}return _0x2d56c2[_0x3342('0x55')](_0x367d99);}})[_0x3342('0x19')](function(_0x24473e){if(_0x24473e){return _0x24473e?{'count':_0x255f5f,'rows':_0x24473e}:null;}})[_0x3342('0x19')](respondWithResult(_0xe822fc,null))[_0x3342('0x24')](handleError(_0xe822fc,null));};exports['addConfiguration']=function(_0x2ef20a,_0x1f36ae,_0x3f49d6){if(_0x2ef20a[_0x3342('0x53')]['id']){delete _0x2ef20a[_0x3342('0x53')]['id'];}return db[_0x3342('0x36')][_0x3342('0x56')]({'where':{'id':_0x2ef20a[_0x3342('0x4f')]['id']}})[_0x3342('0x19')](handleEntityNotFound(_0x1f36ae,null))[_0x3342('0x19')](function(_0x443814){if(_0x443814){_0x2ef20a[_0x3342('0x53')][_0x3342('0x58')]=_0x443814['id'];_0x2ef20a[_0x3342('0x53')][_0x3342('0x59')]=integrations[_0x3342('0x5a')](_0x2ef20a['body']['channel'],_0x2ef20a[_0x3342('0x53')][_0x3342('0x39')]);_0x2ef20a['body'][_0x3342('0x5b')]=integrations[_0x3342('0x5c')](_0x2ef20a[_0x3342('0x53')][_0x3342('0x5d')],_0x2ef20a[_0x3342('0x53')][_0x3342('0x39')]);return db['DeskConfiguration']['create'](_0x2ef20a['body'],{'include':[{'model':db[_0x3342('0x5e')],'as':'Subjects'},{'model':db[_0x3342('0x5e')],'as':_0x3342('0x5b')}]});}return null;})[_0x3342('0x19')](respondWithResult(_0x1f36ae,null))['catch'](handleError(_0x1f36ae,null));};exports[_0x3342('0x5f')]=function(_0x3aae5f,_0x4453c7,_0x2531c4){var _0x4b0ab1=[{'name':_0x3342('0x60'),'label':_0x3342('0x60'),'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 _0x560246='';return db['DeskAccount'][_0x3342('0x56')]({'where':{'id':_0x3aae5f[_0x3342('0x4f')]['id']},'attributes':['id',_0x3342('0x61'),'authType',_0x3342('0x62'),'password','consumerKey','consumerSecret',_0x3342('0x63'),_0x3342('0x64')]})[_0x3342('0x19')](handleEntityNotFound(_0x4453c7,null))[_0x3342('0x19')](function(_0x7a68cd){if(_0x7a68cd){_0x560246=_0x7a68cd[_0x3342('0x61')];var _0x1cf87f=_0x560246['slice'](-0x1);if(_0x1cf87f==='/'){_0x560246=_0x560246[_0x3342('0x65')](0x0,_0x560246['lastIndexOf'](_0x1cf87f));}var _0x4c1352={'method':_0x3342('0x66'),'uri':util[_0x3342('0x67')](_0x3342('0x68'),_0x560246),'headers':{'Content-Type':_0x3342('0x69'),'Accept':'application/json'},'json':!![]};if(_0x7a68cd['authType']===_0x3342('0x6a')){_0x4c1352[_0x3342('0x6b')]['Authorization']=util['format'](_0x3342('0x6c'),new Buffer(util[_0x3342('0x67')](_0x3342('0x6d'),_0x7a68cd[_0x3342('0x62')],_0x7a68cd[_0x3342('0x6e')]))[_0x3342('0x6f')](_0x3342('0x70')));}return rp(_0x4c1352)['then'](function(_0x31dc55){return _0x4b0ab1[_0x3342('0x71')](_[_0x3342('0x3c')](_0x31dc55[_0x3342('0x72')][_0x3342('0x73')],function(_0x4cf398){return{'id':_0x4cf398[_0x3342('0x33')],'name':_0x4cf398['name'],'type':_0x4cf398[_0x3342('0x39')],'active':_0x4cf398[_0x3342('0x74')],'label':_0x4cf398['label'],'custom':!![]};}));});}})[_0x3342('0x19')](function(_0x308cf9){return{'count':_0x308cf9[_0x3342('0x42')],'rows':_0x308cf9};})[_0x3342('0x19')](respondWithResult(_0x4453c7,null))[_0x3342('0x24')](function(_0x4fd99){var _0x215964=_0x3aae5f[_0x3342('0x3d')][_0x3342('0x75')]?0x1f4:_0x4fd99[_0x3342('0x76')]||0x1f4;logger[_0x3342('0x20')]('getFields,\x20%s,\x20%s,\x20%s',_0x3342('0x5f'),_0x215964,JSON['stringify'](_0x4fd99));delete _0x4fd99['name'];if(_0x215964===0x191){_0x215964=0x190;}_0x4453c7[_0x3342('0x26')](_0x215964)[_0x3342('0x34')](_0x3aae5f[_0x3342('0x3d')][_0x3342('0x75')]?{'message':_0x3342('0x77'),'statusCode':_0x4fd99[_0x3342('0x76')]}:_0x4fd99);});}; \ No newline at end of file +var _0xf2cf=['moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','then','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','info','result','sendStatus','end','json','offset','limit','undefined','status','set','Content-Range','reject','save','update','destroy','name','send','index','map','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','options','DeskAccount','count','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','DeskConfiguration','filter','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','password','consumerKey','tokenSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','authType','Authorization','Basic\x20%s','%s:%s','username','toString','_embedded','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch'];(function(_0xf5aed3,_0x5ef3f4){var _0x585202=function(_0x95a0c8){while(--_0x95a0c8){_0xf5aed3['push'](_0xf5aed3['shift']());}};_0x585202(++_0x5ef3f4);}(_0xf2cf,0xf5));var _0xff2c=function(_0x1f7d2f,_0x51cb86){_0x1f7d2f=_0x1f7d2f-0x0;var _0x326c52=_0xf2cf[_0x1f7d2f];return _0x326c52;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff2c('0x0'));var zipdir=require(_0xff2c('0x1'));var jsonpatch=require(_0xff2c('0x2'));var rp=require('request-promise');var moment=require(_0xff2c('0x3'));var BPromise=require(_0xff2c('0x4'));var Mustache=require(_0xff2c('0x5'));var util=require(_0xff2c('0x6'));var path=require(_0xff2c('0x7'));var sox=require(_0xff2c('0x8'));var csv=require('to-csv');var ejs=require(_0xff2c('0x9'));var fs=require('fs');var fs_extra=require(_0xff2c('0xa'));var _=require('lodash');var squel=require(_0xff2c('0xb'));var crypto=require(_0xff2c('0xc'));var jsforce=require(_0xff2c('0xd'));var deskjs=require(_0xff2c('0xe'));var toCsv=require(_0xff2c('0xf'));var querystring=require(_0xff2c('0x10'));var Papa=require(_0xff2c('0x11'));var Redis=require('ioredis');var authService=require(_0xff2c('0x12'));var qs=require(_0xff2c('0x13'));var as=require(_0xff2c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff2c('0x15'))(_0xff2c('0x16'));var utils=require(_0xff2c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xff2c('0x18'))['db'];var integrations=require(_0xff2c('0x19'));var jayson=require('jayson/promise');var client=jayson[_0xff2c('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53c0e1,_0x8f8578,_0x2d3ee6,_0x1f229b){return new BPromise(function(_0x4778db,_0x4fc59b){var _0x2b1f8e=_0x1f229b||client;return _0x2b1f8e['request'](_0x53c0e1,_0x2d3ee6)[_0xff2c('0x1b')](function(_0x2eb087){logger['info']('DeskAccount,\x20%s,\x20%s',_0x8f8578,'request\x20sent');logger[_0xff2c('0x1c')](_0xff2c('0x1d'),_0x8f8578,_0xff2c('0x1e'),JSON[_0xff2c('0x1f')](_0x2eb087));if(_0x2eb087[_0xff2c('0x20')]){if(_0x2eb087[_0xff2c('0x20')][_0xff2c('0x21')]===0x1f4){logger[_0xff2c('0x20')](_0xff2c('0x22'),_0x8f8578,_0x2eb087[_0xff2c('0x20')][_0xff2c('0x23')]);return _0x4fc59b(_0x2eb087[_0xff2c('0x20')][_0xff2c('0x23')]);}logger[_0xff2c('0x20')](_0xff2c('0x22'),_0x8f8578,_0x2eb087[_0xff2c('0x20')][_0xff2c('0x23')]);return _0x4778db(_0x2eb087[_0xff2c('0x20')][_0xff2c('0x23')]);}else{logger[_0xff2c('0x24')](_0xff2c('0x22'),_0x8f8578,_0xff2c('0x1e'));_0x4778db(_0x2eb087[_0xff2c('0x25')][_0xff2c('0x23')]);}})['catch'](function(_0x1de9de){logger[_0xff2c('0x20')](_0xff2c('0x22'),_0x8f8578,_0x1de9de);_0x4fc59b(_0x1de9de);});});}function respondWithStatusCode(_0x137b2d,_0x235783){_0x235783=_0x235783||0xcc;return function(_0xc61299){if(_0xc61299){return _0x137b2d[_0xff2c('0x26')](_0x235783);}return _0x137b2d['status'](_0x235783)[_0xff2c('0x27')]();};}function respondWithResult(_0x29848e,_0x360ac2){_0x360ac2=_0x360ac2||0xc8;return function(_0x35f52e){if(_0x35f52e){return _0x29848e['status'](_0x360ac2)[_0xff2c('0x28')](_0x35f52e);}};}function respondWithFilteredResult(_0x11e132,_0x3fd743){return function(_0x46f7b3){if(_0x46f7b3){var _0x2eee77=typeof _0x3fd743[_0xff2c('0x29')]==='undefined'&&typeof _0x3fd743[_0xff2c('0x2a')]===_0xff2c('0x2b');var _0x4103f0=_0x46f7b3['count'];var _0x59088e=_0x2eee77?0x0:_0x3fd743[_0xff2c('0x29')];var _0x2205f3=_0x2eee77?_0x46f7b3['count']:_0x3fd743[_0xff2c('0x29')]+_0x3fd743['limit'];var _0x5ba347;if(_0x2205f3>=_0x4103f0){_0x2205f3=_0x4103f0;_0x5ba347=0xc8;}else{_0x5ba347=0xce;}_0x11e132[_0xff2c('0x2c')](_0x5ba347);return _0x11e132[_0xff2c('0x2d')](_0xff2c('0x2e'),_0x59088e+'-'+_0x2205f3+'/'+_0x4103f0)[_0xff2c('0x28')](_0x46f7b3);}return null;};}function patchUpdates(_0x1c95ad){return function(_0x39297f){try{jsonpatch['apply'](_0x39297f,_0x1c95ad,!![]);}catch(_0x311136){return BPromise[_0xff2c('0x2f')](_0x311136);}return _0x39297f[_0xff2c('0x30')]();};}function saveUpdates(_0x56361f,_0x1f6750){return function(_0x4e0278){if(_0x4e0278){return _0x4e0278[_0xff2c('0x31')](_0x56361f)[_0xff2c('0x1b')](function(_0x541045){return _0x541045;});}return null;};}function removeEntity(_0x4c4080,_0x59bb0a){return function(_0x558c25){if(_0x558c25){return _0x558c25[_0xff2c('0x32')]()[_0xff2c('0x1b')](function(){_0x4c4080[_0xff2c('0x2c')](0xcc)[_0xff2c('0x27')]();});}};}function handleEntityNotFound(_0x1d6827,_0x29c4bb){return function(_0x19dd26){if(!_0x19dd26){_0x1d6827[_0xff2c('0x26')](0x194);}return _0x19dd26;};}function handleError(_0x5e676c,_0x4733f0){_0x4733f0=_0x4733f0||0x1f4;return function(_0x17027a){logger[_0xff2c('0x20')](_0x17027a['stack']);if(_0x17027a[_0xff2c('0x33')]){delete _0x17027a[_0xff2c('0x33')];}_0x5e676c[_0xff2c('0x2c')](_0x4733f0)[_0xff2c('0x34')](_0x17027a);};}exports[_0xff2c('0x35')]=function(_0x3f460c,_0xbd1d7f){var _0xcf181b={},_0x28b70c={},_0x4e6da7={'count':0x0,'rows':[]};var _0x54755e=_[_0xff2c('0x36')](db['DeskAccount'][_0xff2c('0x37')],function(_0x3ca73c){return{'name':_0x3ca73c[_0xff2c('0x38')],'type':_0x3ca73c['type'][_0xff2c('0x39')]};});_0x28b70c['model']=_['map'](_0x54755e,_0xff2c('0x33'));_0x28b70c['query']=_[_0xff2c('0x3a')](_0x3f460c[_0xff2c('0x3b')]);_0x28b70c['filters']=_[_0xff2c('0x3c')](_0x28b70c[_0xff2c('0x3d')],_0x28b70c[_0xff2c('0x3b')]);_0xcf181b[_0xff2c('0x3e')]=_[_0xff2c('0x3c')](_0x28b70c[_0xff2c('0x3d')],qs[_0xff2c('0x3f')](_0x3f460c[_0xff2c('0x3b')][_0xff2c('0x3f')]));_0xcf181b[_0xff2c('0x3e')]=_0xcf181b[_0xff2c('0x3e')][_0xff2c('0x40')]?_0xcf181b[_0xff2c('0x3e')]:_0x28b70c[_0xff2c('0x3d')];if(!_0x3f460c[_0xff2c('0x3b')][_0xff2c('0x41')](_0xff2c('0x42'))){_0xcf181b[_0xff2c('0x2a')]=qs['limit'](_0x3f460c['query'][_0xff2c('0x2a')]);_0xcf181b[_0xff2c('0x29')]=qs[_0xff2c('0x29')](_0x3f460c['query'][_0xff2c('0x29')]);}_0xcf181b[_0xff2c('0x43')]=qs['sort'](_0x3f460c[_0xff2c('0x3b')][_0xff2c('0x44')]);_0xcf181b['where']=qs[_0xff2c('0x45')](_[_0xff2c('0x46')](_0x3f460c[_0xff2c('0x3b')],_0x28b70c[_0xff2c('0x45')]),_0x54755e);if(_0x3f460c[_0xff2c('0x3b')]['filter']){_0xcf181b[_0xff2c('0x47')]=_[_0xff2c('0x48')](_0xcf181b['where'],{'$or':_['map'](_0x54755e,function(_0x31d5cf){if(_0x31d5cf['type']!==_0xff2c('0x49')){var _0x3c9fca={};_0x3c9fca[_0x31d5cf[_0xff2c('0x33')]]={'$like':'%'+_0x3f460c['query']['filter']+'%'};return _0x3c9fca;}})});}_0xcf181b=_[_0xff2c('0x48')]({},_0xcf181b,_0x3f460c[_0xff2c('0x4a')]);var _0x3028bb={'where':_0xcf181b['where']};return db[_0xff2c('0x4b')]['count'](_0x3028bb)[_0xff2c('0x1b')](function(_0x5cb7e6){_0x4e6da7[_0xff2c('0x4c')]=_0x5cb7e6;if(_0x3f460c[_0xff2c('0x3b')][_0xff2c('0x4d')]){_0xcf181b[_0xff2c('0x4e')]=[{'all':!![]}];}return db[_0xff2c('0x4b')][_0xff2c('0x4f')](_0xcf181b);})[_0xff2c('0x1b')](function(_0x2d7377){_0x4e6da7[_0xff2c('0x50')]=_0x2d7377;return _0x4e6da7;})[_0xff2c('0x1b')](respondWithFilteredResult(_0xbd1d7f,_0xcf181b))[_0xff2c('0x51')](handleError(_0xbd1d7f,null));};exports['show']=function(_0x5d5dca,_0x19fad3){var _0x1e1c17={'raw':![],'where':{'id':_0x5d5dca[_0xff2c('0x52')]['id']}},_0x2be4f0={};_0x2be4f0['model']=_[_0xff2c('0x3a')](db[_0xff2c('0x4b')]['rawAttributes']);_0x2be4f0[_0xff2c('0x3b')]=_[_0xff2c('0x3a')](_0x5d5dca['query']);_0x2be4f0[_0xff2c('0x45')]=_[_0xff2c('0x3c')](_0x2be4f0['model'],_0x2be4f0['query']);_0x1e1c17['attributes']=_[_0xff2c('0x3c')](_0x2be4f0[_0xff2c('0x3d')],qs['fields'](_0x5d5dca[_0xff2c('0x3b')][_0xff2c('0x3f')]));_0x1e1c17[_0xff2c('0x3e')]=_0x1e1c17[_0xff2c('0x3e')]['length']?_0x1e1c17['attributes']:_0x2be4f0[_0xff2c('0x3d')];if(_0x5d5dca[_0xff2c('0x3b')]['includeAll']){_0x1e1c17[_0xff2c('0x4e')]=[{'all':!![]}];}_0x1e1c17=_[_0xff2c('0x48')]({},_0x1e1c17,_0x5d5dca[_0xff2c('0x4a')]);return db[_0xff2c('0x4b')][_0xff2c('0x53')](_0x1e1c17)[_0xff2c('0x1b')](handleEntityNotFound(_0x19fad3,null))['then'](respondWithResult(_0x19fad3,null))[_0xff2c('0x51')](handleError(_0x19fad3,null));};exports[_0xff2c('0x54')]=function(_0x57aa63,_0x4d2481){return db['DeskAccount'][_0xff2c('0x54')](_0x57aa63['body'],{})[_0xff2c('0x1b')](respondWithResult(_0x4d2481,0xc9))[_0xff2c('0x51')](handleError(_0x4d2481,null));};exports[_0xff2c('0x31')]=function(_0x4d8976,_0x3fa0f8){if(_0x4d8976[_0xff2c('0x55')]['id']){delete _0x4d8976[_0xff2c('0x55')]['id'];}return db[_0xff2c('0x4b')][_0xff2c('0x53')]({'where':{'id':_0x4d8976[_0xff2c('0x52')]['id']}})[_0xff2c('0x1b')](handleEntityNotFound(_0x3fa0f8,null))['then'](saveUpdates(_0x4d8976['body'],null))['then'](respondWithResult(_0x3fa0f8,null))['catch'](handleError(_0x3fa0f8,null));};exports[_0xff2c('0x32')]=function(_0x310395,_0x32dbad){return db[_0xff2c('0x4b')][_0xff2c('0x53')]({'where':{'id':_0x310395[_0xff2c('0x52')]['id']}})[_0xff2c('0x1b')](handleEntityNotFound(_0x32dbad,null))['then'](removeEntity(_0x32dbad,null))[_0xff2c('0x51')](handleError(_0x32dbad,null));};exports[_0xff2c('0x56')]=function(_0xabea8,_0x53e836,_0x40e90c){var _0x2bbb14={};var _0x37ad80={};var _0x5b11dc;var _0x14c41b;return db[_0xff2c('0x4b')][_0xff2c('0x57')]({'where':{'id':_0xabea8[_0xff2c('0x52')]['id']}})[_0xff2c('0x1b')](handleEntityNotFound(_0x53e836,null))[_0xff2c('0x1b')](function(_0x19c93a){if(_0x19c93a){_0x5b11dc=_0x19c93a;_0x37ad80[_0xff2c('0x3d')]=_['keys'](db[_0xff2c('0x58')][_0xff2c('0x37')]);_0x37ad80['query']=_[_0xff2c('0x3a')](_0xabea8[_0xff2c('0x3b')]);_0x37ad80[_0xff2c('0x45')]=_[_0xff2c('0x3c')](_0x37ad80[_0xff2c('0x3d')],_0x37ad80['query']);_0x2bbb14[_0xff2c('0x3e')]=_['intersection'](_0x37ad80[_0xff2c('0x3d')],qs[_0xff2c('0x3f')](_0xabea8[_0xff2c('0x3b')][_0xff2c('0x3f')]));_0x2bbb14['attributes']=_0x2bbb14['attributes'][_0xff2c('0x40')]?_0x2bbb14['attributes']:_0x37ad80['model'];_0x2bbb14[_0xff2c('0x43')]=qs[_0xff2c('0x44')](_0xabea8['query']['sort']);_0x2bbb14[_0xff2c('0x47')]=qs[_0xff2c('0x45')](_['pick'](_0xabea8[_0xff2c('0x3b')],_0x37ad80[_0xff2c('0x45')]));if(_0xabea8[_0xff2c('0x3b')][_0xff2c('0x59')]){_0x2bbb14[_0xff2c('0x47')]=_['merge'](_0x2bbb14[_0xff2c('0x47')],{'$or':_[_0xff2c('0x36')](_0x2bbb14[_0xff2c('0x3e')],function(_0x388e8b){var _0x3697d3={};_0x3697d3[_0x388e8b]={'$like':'%'+_0xabea8[_0xff2c('0x3b')][_0xff2c('0x59')]+'%'};return _0x3697d3;})});}_0x2bbb14=_['merge']({},_0x2bbb14,_0xabea8[_0xff2c('0x4a')]);return _0x5b11dc['getConfigurations'](_0x2bbb14);}})['then'](function(_0x324949){if(_0x324949){_0x14c41b=_0x324949['length'];if(!_0xabea8['query'][_0xff2c('0x41')](_0xff2c('0x42'))){_0x2bbb14[_0xff2c('0x2a')]=qs[_0xff2c('0x2a')](_0xabea8[_0xff2c('0x3b')][_0xff2c('0x2a')]);_0x2bbb14[_0xff2c('0x29')]=qs[_0xff2c('0x29')](_0xabea8[_0xff2c('0x3b')][_0xff2c('0x29')]);}return _0x5b11dc[_0xff2c('0x56')](_0x2bbb14);}})[_0xff2c('0x1b')](function(_0x31b160){if(_0x31b160){return _0x31b160?{'count':_0x14c41b,'rows':_0x31b160}:null;}})[_0xff2c('0x1b')](respondWithResult(_0x53e836,null))[_0xff2c('0x51')](handleError(_0x53e836,null));};exports[_0xff2c('0x5a')]=function(_0x4040c4,_0x4c3719,_0x4ebe57){if(_0x4040c4[_0xff2c('0x55')]['id']){delete _0x4040c4[_0xff2c('0x55')]['id'];}return db[_0xff2c('0x4b')][_0xff2c('0x57')]({'where':{'id':_0x4040c4[_0xff2c('0x52')]['id']}})['then'](handleEntityNotFound(_0x4c3719,null))['then'](function(_0x1a77c4){if(_0x1a77c4){_0x4040c4[_0xff2c('0x55')][_0xff2c('0x5b')]=_0x1a77c4['id'];_0x4040c4[_0xff2c('0x55')][_0xff2c('0x5c')]=integrations[_0xff2c('0x5d')](_0x4040c4[_0xff2c('0x55')][_0xff2c('0x5e')],_0x4040c4[_0xff2c('0x55')][_0xff2c('0x5f')]);_0x4040c4[_0xff2c('0x55')][_0xff2c('0x60')]=integrations[_0xff2c('0x61')](_0x4040c4[_0xff2c('0x55')][_0xff2c('0x5e')],_0x4040c4[_0xff2c('0x55')][_0xff2c('0x5f')]);return db[_0xff2c('0x58')][_0xff2c('0x54')](_0x4040c4['body'],{'include':[{'model':db[_0xff2c('0x62')],'as':_0xff2c('0x5c')},{'model':db[_0xff2c('0x62')],'as':_0xff2c('0x60')}]});}return null;})[_0xff2c('0x1b')](respondWithResult(_0x4c3719,null))['catch'](handleError(_0x4c3719,null));};exports[_0xff2c('0x63')]=function(_0x4e9351,_0x3a8d05,_0x5a6f97){var _0x17e28b=[{'name':_0xff2c('0x64'),'label':_0xff2c('0x64'),'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 _0x18aad0='';return db[_0xff2c('0x4b')][_0xff2c('0x57')]({'where':{'id':_0x4e9351[_0xff2c('0x52')]['id']},'attributes':['id',_0xff2c('0x65'),'authType','username',_0xff2c('0x66'),_0xff2c('0x67'),'consumerSecret','token',_0xff2c('0x68')]})[_0xff2c('0x1b')](handleEntityNotFound(_0x3a8d05,null))['then'](function(_0x358ea5){if(_0x358ea5){_0x18aad0=_0x358ea5[_0xff2c('0x65')];var _0x509782=_0x18aad0[_0xff2c('0x69')](-0x1);if(_0x509782==='/'){_0x18aad0=_0x18aad0[_0xff2c('0x6a')](0x0,_0x18aad0[_0xff2c('0x6b')](_0x509782));}var _0x381fe0={'method':'GET','uri':util[_0xff2c('0x6c')](_0xff2c('0x6d'),_0x18aad0),'headers':{'Content-Type':_0xff2c('0x6e'),'Accept':_0xff2c('0x6e')},'json':!![]};if(_0x358ea5[_0xff2c('0x6f')]==='basic'){_0x381fe0['headers'][_0xff2c('0x70')]=util[_0xff2c('0x6c')](_0xff2c('0x71'),new Buffer(util['format'](_0xff2c('0x72'),_0x358ea5[_0xff2c('0x73')],_0x358ea5[_0xff2c('0x66')]))[_0xff2c('0x74')]('base64'));}return rp(_0x381fe0)['then'](function(_0x3f644e){return _0x17e28b['concat'](_[_0xff2c('0x36')](_0x3f644e[_0xff2c('0x75')]['entries'],function(_0x2a5192){return{'id':_0x2a5192[_0xff2c('0x33')],'name':_0x2a5192[_0xff2c('0x33')],'type':_0x2a5192['type'],'active':_0x2a5192[_0xff2c('0x76')],'label':_0x2a5192[_0xff2c('0x77')],'custom':!![]};}));});}})['then'](function(_0x308cfd){return{'count':_0x308cfd['length'],'rows':_0x308cfd};})[_0xff2c('0x1b')](respondWithResult(_0x3a8d05,null))[_0xff2c('0x51')](function(_0x2caa63){var _0x4fa5ea=_0x4e9351[_0xff2c('0x3b')][_0xff2c('0x78')]?0x1f4:_0x2caa63[_0xff2c('0x79')]||0x1f4;logger[_0xff2c('0x20')](_0xff2c('0x7a'),_0xff2c('0x63'),_0x4fa5ea,JSON[_0xff2c('0x1f')](_0x2caa63));delete _0x2caa63['name'];if(_0x4fa5ea===0x191){_0x4fa5ea=0x190;}_0x3a8d05[_0xff2c('0x2c')](_0x4fa5ea)[_0xff2c('0x34')](_0x4e9351[_0xff2c('0x3b')]['test']?{'message':_0xff2c('0x7b'),'statusCode':_0x2caa63[_0xff2c('0x79')]}:_0x2caa63);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 5936f7c..0f9939c 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 _0x87bb=['define','DeskAccount','int_desk_accounts','lodash','moment','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x87bb,0xc3));var _0xb87b=function(_0x29d663,_0x445803){_0x29d663=_0x29d663-0x0;var _0x2b294d=_0x87bb[_0x29d663];return _0x2b294d;};'use strict';var _=require(_0xb87b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb87b('0x1'));var BPromise=require(_0xb87b('0x2'));var rp=require(_0xb87b('0x3'));var fs=require('fs');var path=require(_0xb87b('0x4'));var rimraf=require(_0xb87b('0x5'));var config=require('../../config/environment');var attributes=require(_0xb87b('0x6'));var integrations=require(_0xb87b('0x7'));module[_0xb87b('0x8')]=function(_0x521d83,_0x4835fa){return _0x521d83[_0xb87b('0x9')](_0xb87b('0xa'),attributes,{'tableName':_0xb87b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc99b=['util','../../config/logger','api','moment','bluebird','request-promise','path','./intDeskAccount.attributes','define','DeskAccount','int_desk_accounts'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc99b,0x11e));var _0xbc99=function(_0x441964,_0x3070ae){_0x441964=_0x441964-0x0;var _0x4211f0=_0xc99b[_0x441964];return _0x4211f0;};'use strict';var _=require('lodash');var util=require(_0xbc99('0x0'));var logger=require(_0xbc99('0x1'))(_0xbc99('0x2'));var moment=require(_0xbc99('0x3'));var BPromise=require(_0xbc99('0x4'));var rp=require(_0xbc99('0x5'));var fs=require('fs');var path=require(_0xbc99('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbc99('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5ebb60,_0x26a3db){return _0x5ebb60[_0xbc99('0x8')](_0xbc99('0x9'),attributes,{'tableName':_0xbc99('0xa'),'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 5b558fb..9d313f3 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 _0xff27=['include','model','then','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','DeskAccount,\x20%s,\x20%s','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','map'];(function(_0x3ae3d7,_0x3b31de){var _0x3218ca=function(_0x54b500){while(--_0x54b500){_0x3ae3d7['push'](_0x3ae3d7['shift']());}};_0x3218ca(++_0x3b31de);}(_0xff27,0x115));var _0x7ff2=function(_0x25d4ee,_0xc95872){_0x25d4ee=_0x25d4ee-0x0;var _0x214a35=_0xff27[_0x25d4ee];return _0x214a35;};'use strict';var _=require(_0x7ff2('0x0'));var util=require(_0x7ff2('0x1'));var moment=require(_0x7ff2('0x2'));var BPromise=require(_0x7ff2('0x3'));var rs=require(_0x7ff2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7ff2('0x5'));var logger=require('../../config/logger')(_0x7ff2('0x6'));var config=require('../../config/environment');var jayson=require(_0x7ff2('0x7'));var client=jayson[_0x7ff2('0x8')][_0x7ff2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cfa98,_0x55d99f,_0x56a6a8){return new BPromise(function(_0x4b67b0,_0x55a922){return client['request'](_0x3cfa98,_0x56a6a8)['then'](function(_0x258dd0){logger[_0x7ff2('0xa')]('DeskAccount,\x20%s,\x20%s',_0x55d99f,_0x7ff2('0xb'));logger[_0x7ff2('0xc')](_0x7ff2('0xd'),_0x55d99f,_0x7ff2('0xb'),JSON[_0x7ff2('0xe')](_0x258dd0));if(_0x258dd0['error']){if(_0x258dd0[_0x7ff2('0xf')]['code']===0x1f4){logger[_0x7ff2('0xf')]('DeskAccount,\x20%s,\x20%s',_0x55d99f,_0x258dd0[_0x7ff2('0xf')][_0x7ff2('0x10')]);return _0x55a922(_0x258dd0[_0x7ff2('0xf')][_0x7ff2('0x10')]);}logger[_0x7ff2('0xf')](_0x7ff2('0x11'),_0x55d99f,_0x258dd0[_0x7ff2('0xf')][_0x7ff2('0x10')]);return _0x4b67b0(_0x258dd0[_0x7ff2('0xf')][_0x7ff2('0x10')]);}else{logger[_0x7ff2('0xa')](_0x7ff2('0x11'),_0x55d99f,_0x7ff2('0xb'));_0x4b67b0(_0x258dd0[_0x7ff2('0x12')][_0x7ff2('0x10')]);}})[_0x7ff2('0x13')](function(_0x233c99){logger[_0x7ff2('0xf')](_0x7ff2('0x11'),_0x55d99f,_0x233c99);_0x55a922(_0x233c99);});});}exports[_0x7ff2('0x14')]=function(_0x408288){var _0x5db666=this;return new Promise(function(_0x5ec586,_0x53b256){return db[_0x7ff2('0x15')][_0x7ff2('0x16')]({'raw':_0x408288[_0x7ff2('0x17')]?_0x408288[_0x7ff2('0x17')][_0x7ff2('0x18')]===undefined?!![]:![]:!![],'where':_0x408288[_0x7ff2('0x17')]?_0x408288[_0x7ff2('0x17')][_0x7ff2('0x19')]||null:null,'attributes':_0x408288[_0x7ff2('0x17')]?_0x408288[_0x7ff2('0x17')][_0x7ff2('0x1a')]||null:null,'limit':_0x408288[_0x7ff2('0x17')]?_0x408288['options'][_0x7ff2('0x1b')]||null:null,'include':_0x408288['options']?_0x408288[_0x7ff2('0x17')]['include']?_[_0x7ff2('0x1c')](_0x408288[_0x7ff2('0x17')][_0x7ff2('0x1d')],function(_0x109fd0){return{'model':db[_0x109fd0[_0x7ff2('0x1e')]],'as':_0x109fd0['as'],'attributes':_0x109fd0[_0x7ff2('0x1a')],'include':_0x109fd0[_0x7ff2('0x1d')]?_[_0x7ff2('0x1c')](_0x109fd0[_0x7ff2('0x1d')],function(_0x319d1b){return{'model':db[_0x319d1b[_0x7ff2('0x1e')]],'as':_0x319d1b['as'],'attributes':_0x319d1b['attributes'],'include':_0x319d1b[_0x7ff2('0x1d')]?_[_0x7ff2('0x1c')](_0x319d1b[_0x7ff2('0x1d')],function(_0x8651c){return{'model':db[_0x8651c[_0x7ff2('0x1e')]],'as':_0x8651c['as'],'attributes':_0x8651c[_0x7ff2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7ff2('0x1f')](function(_0x1a8423){logger[_0x7ff2('0xa')](_0x7ff2('0x14'),_0x408288);logger[_0x7ff2('0xc')](_0x7ff2('0x14'),_0x408288,JSON[_0x7ff2('0xe')](_0x1a8423));_0x5ec586(_0x1a8423);})[_0x7ff2('0x13')](function(_0x17b4ed){logger[_0x7ff2('0xf')](_0x7ff2('0x14'),_0x17b4ed[_0x7ff2('0x10')],_0x408288);_0x53b256(_0x5db666[_0x7ff2('0xf')](0x1f4,_0x17b4ed['message']));});});};exports[_0x7ff2('0x20')]=function(_0xa24b65){var _0x83ea2f=this;return new Promise(function(_0x3b01ed,_0x391ed8){return db[_0x7ff2('0x15')][_0x7ff2('0x21')]({'raw':_0xa24b65[_0x7ff2('0x17')]?_0xa24b65[_0x7ff2('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xa24b65['options']?_0xa24b65['options']['where']||null:null,'attributes':_0xa24b65[_0x7ff2('0x17')]?_0xa24b65[_0x7ff2('0x17')][_0x7ff2('0x1a')]||null:null,'include':_0xa24b65[_0x7ff2('0x17')]?_0xa24b65[_0x7ff2('0x17')][_0x7ff2('0x1d')]?_[_0x7ff2('0x1c')](_0xa24b65[_0x7ff2('0x17')][_0x7ff2('0x1d')],function(_0x1c2ebe){return{'model':db[_0x1c2ebe[_0x7ff2('0x1e')]],'as':_0x1c2ebe['as'],'attributes':_0x1c2ebe[_0x7ff2('0x1a')],'include':_0x1c2ebe['include']?_[_0x7ff2('0x1c')](_0x1c2ebe[_0x7ff2('0x1d')],function(_0x2e6b75){return{'model':db[_0x2e6b75['model']],'as':_0x2e6b75['as'],'attributes':_0x2e6b75[_0x7ff2('0x1a')],'include':_0x2e6b75['include']?_['map'](_0x2e6b75[_0x7ff2('0x1d')],function(_0x546d4c){return{'model':db[_0x546d4c[_0x7ff2('0x1e')]],'as':_0x546d4c['as'],'attributes':_0x546d4c[_0x7ff2('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b3584){logger[_0x7ff2('0xa')](_0x7ff2('0x20'),_0xa24b65);logger['debug'](_0x7ff2('0x20'),_0xa24b65,JSON[_0x7ff2('0xe')](_0x1b3584));_0x3b01ed(_0x1b3584);})[_0x7ff2('0x13')](function(_0xf14e1a){logger[_0x7ff2('0xf')](_0x7ff2('0x20'),_0xf14e1a['message'],_0xa24b65);_0x391ed8(_0x83ea2f[_0x7ff2('0xf')](0x1f4,_0xf14e1a[_0x7ff2('0x10')]));});});}; \ No newline at end of file +var _0x5502=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','model','include','map','GetDeskAccount','ShowDeskAccount','DeskAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3ca684,_0x14b082){var _0x271f0c=function(_0x344718){while(--_0x344718){_0x3ca684['push'](_0x3ca684['shift']());}};_0x271f0c(++_0x14b082);}(_0x5502,0xef));var _0x2550=function(_0x1ea321,_0x4b76e7){_0x1ea321=_0x1ea321-0x0;var _0x5de358=_0x5502[_0x1ea321];return _0x5de358;};'use strict';var _=require(_0x2550('0x0'));var util=require(_0x2550('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2550('0x2'));var fs=require('fs');var Redis=require(_0x2550('0x3'));var db=require(_0x2550('0x4'))['db'];var utils=require(_0x2550('0x5'));var logger=require(_0x2550('0x6'))(_0x2550('0x7'));var config=require(_0x2550('0x8'));var jayson=require(_0x2550('0x9'));var client=jayson[_0x2550('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3667be,_0x1574a0,_0x503c3d){return new BPromise(function(_0x454989,_0x2ddec4){return client[_0x2550('0xb')](_0x3667be,_0x503c3d)[_0x2550('0xc')](function(_0x3755e5){logger[_0x2550('0xd')](_0x2550('0xe'),_0x1574a0,_0x2550('0xf'));logger[_0x2550('0x10')](_0x2550('0x11'),_0x1574a0,_0x2550('0xf'),JSON[_0x2550('0x12')](_0x3755e5));if(_0x3755e5[_0x2550('0x13')]){if(_0x3755e5[_0x2550('0x13')][_0x2550('0x14')]===0x1f4){logger[_0x2550('0x13')](_0x2550('0xe'),_0x1574a0,_0x3755e5['error'][_0x2550('0x15')]);return _0x2ddec4(_0x3755e5[_0x2550('0x13')][_0x2550('0x15')]);}logger[_0x2550('0x13')](_0x2550('0xe'),_0x1574a0,_0x3755e5['error'][_0x2550('0x15')]);return _0x454989(_0x3755e5[_0x2550('0x13')][_0x2550('0x15')]);}else{logger[_0x2550('0xd')](_0x2550('0xe'),_0x1574a0,_0x2550('0xf'));_0x454989(_0x3755e5[_0x2550('0x16')][_0x2550('0x15')]);}})[_0x2550('0x17')](function(_0x2a4414){logger[_0x2550('0x13')](_0x2550('0xe'),_0x1574a0,_0x2a4414);_0x2ddec4(_0x2a4414);});});}exports['GetDeskAccount']=function(_0x3be8a9){var _0x8aa15e=this;return new Promise(function(_0xf2583b,_0xcabb65){return db['DeskAccount']['findAll']({'raw':_0x3be8a9[_0x2550('0x18')]?_0x3be8a9[_0x2550('0x18')][_0x2550('0x19')]===undefined?!![]:![]:!![],'where':_0x3be8a9['options']?_0x3be8a9[_0x2550('0x18')][_0x2550('0x1a')]||null:null,'attributes':_0x3be8a9['options']?_0x3be8a9[_0x2550('0x18')][_0x2550('0x1b')]||null:null,'limit':_0x3be8a9[_0x2550('0x18')]?_0x3be8a9[_0x2550('0x18')][_0x2550('0x1c')]||null:null,'include':_0x3be8a9[_0x2550('0x18')]?_0x3be8a9[_0x2550('0x18')]['include']?_['map'](_0x3be8a9[_0x2550('0x18')]['include'],function(_0x23b5df){return{'model':db[_0x23b5df[_0x2550('0x1d')]],'as':_0x23b5df['as'],'attributes':_0x23b5df[_0x2550('0x1b')],'include':_0x23b5df[_0x2550('0x1e')]?_[_0x2550('0x1f')](_0x23b5df['include'],function(_0x299b26){return{'model':db[_0x299b26['model']],'as':_0x299b26['as'],'attributes':_0x299b26[_0x2550('0x1b')],'include':_0x299b26[_0x2550('0x1e')]?_[_0x2550('0x1f')](_0x299b26[_0x2550('0x1e')],function(_0x88a873){return{'model':db[_0x88a873['model']],'as':_0x88a873['as'],'attributes':_0x88a873['attributes']};}):[]};}):[]};}):[]:[]})[_0x2550('0xc')](function(_0x49777d){logger[_0x2550('0xd')](_0x2550('0x20'),_0x3be8a9);logger['debug'](_0x2550('0x20'),_0x3be8a9,JSON['stringify'](_0x49777d));_0xf2583b(_0x49777d);})['catch'](function(_0x30cb3d){logger[_0x2550('0x13')](_0x2550('0x20'),_0x30cb3d[_0x2550('0x15')],_0x3be8a9);_0xcabb65(_0x8aa15e[_0x2550('0x13')](0x1f4,_0x30cb3d[_0x2550('0x15')]));});});};exports[_0x2550('0x21')]=function(_0x3ca513){var _0x56f635=this;return new Promise(function(_0x5b64dc,_0x29e42a){return db[_0x2550('0x22')]['find']({'raw':_0x3ca513[_0x2550('0x18')]?_0x3ca513[_0x2550('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3ca513[_0x2550('0x18')]?_0x3ca513[_0x2550('0x18')]['where']||null:null,'attributes':_0x3ca513[_0x2550('0x18')]?_0x3ca513[_0x2550('0x18')][_0x2550('0x1b')]||null:null,'include':_0x3ca513[_0x2550('0x18')]?_0x3ca513[_0x2550('0x18')][_0x2550('0x1e')]?_[_0x2550('0x1f')](_0x3ca513['options'][_0x2550('0x1e')],function(_0x51d428){return{'model':db[_0x51d428['model']],'as':_0x51d428['as'],'attributes':_0x51d428[_0x2550('0x1b')],'include':_0x51d428[_0x2550('0x1e')]?_['map'](_0x51d428[_0x2550('0x1e')],function(_0x137ed8){return{'model':db[_0x137ed8[_0x2550('0x1d')]],'as':_0x137ed8['as'],'attributes':_0x137ed8[_0x2550('0x1b')],'include':_0x137ed8['include']?_[_0x2550('0x1f')](_0x137ed8[_0x2550('0x1e')],function(_0x48ab5a){return{'model':db[_0x48ab5a['model']],'as':_0x48ab5a['as'],'attributes':_0x48ab5a['attributes']};}):[]};}):[]};}):[]:[]})[_0x2550('0xc')](function(_0x16dd58){logger[_0x2550('0xd')](_0x2550('0x21'),_0x3ca513);logger['debug'](_0x2550('0x21'),_0x3ca513,JSON['stringify'](_0x16dd58));_0x5b64dc(_0x16dd58);})[_0x2550('0x17')](function(_0x4836c1){logger[_0x2550('0x13')](_0x2550('0x21'),_0x4836c1[_0x2550('0x15')],_0x3ca513);_0x29e42a(_0x56f635[_0x2550('0x13')](0x1f4,_0x4836c1[_0x2550('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 098caf2..1a1aa94 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 _0xfb6f=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getTags','post','create','setTags','update','delete'];(function(_0x5fd57,_0x162af9){var _0x1d19aa=function(_0x4a1f66){while(--_0x4a1f66){_0x5fd57['push'](_0x5fd57['shift']());}};_0x1d19aa(++_0x162af9);}(_0xfb6f,0x188));var _0xffb6=function(_0x3dbe8e,_0x2b98bd){_0x3dbe8e=_0x3dbe8e-0x0;var _0x3f124f=_0xfb6f[_0x3dbe8e];return _0x3f124f;};'use strict';var multer=require(_0xffb6('0x0'));var util=require(_0xffb6('0x1'));var path=require('path');var timeout=require(_0xffb6('0x2'));var express=require(_0xffb6('0x3'));var router=express['Router']();var fs_extra=require(_0xffb6('0x4'));var auth=require(_0xffb6('0x5'));var interaction=require(_0xffb6('0x6'));var config=require('../../config/environment');var controller=require(_0xffb6('0x7'));router[_0xffb6('0x8')]('/',auth[_0xffb6('0x9')](),controller[_0xffb6('0xa')]);router[_0xffb6('0x8')](_0xffb6('0xb'),auth[_0xffb6('0x9')](),controller[_0xffb6('0xc')]);router[_0xffb6('0x8')](_0xffb6('0xd'),auth['isAuthenticated'](),controller[_0xffb6('0xe')]);router[_0xffb6('0x8')](_0xffb6('0xf'),auth[_0xffb6('0x9')](),controller[_0xffb6('0x10')]);router[_0xffb6('0x8')](_0xffb6('0x11'),auth[_0xffb6('0x9')](),controller['getDescriptions']);router[_0xffb6('0x8')]('/:id/tags',auth[_0xffb6('0x9')](),controller[_0xffb6('0x12')]);router[_0xffb6('0x13')]('/',auth['isAuthenticated'](),controller[_0xffb6('0x14')]);router['post']('/:id/tags',auth[_0xffb6('0x9')](),controller[_0xffb6('0x15')]);router['put'](_0xffb6('0xb'),auth[_0xffb6('0x9')](),controller[_0xffb6('0x16')]);router[_0xffb6('0x17')](_0xffb6('0xb'),auth[_0xffb6('0x9')](),controller[_0xffb6('0x18')]);module[_0xffb6('0x19')]=router; \ No newline at end of file +var _0x5725=['create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post'];(function(_0x446b27,_0x4fa8e0){var _0x5382ba=function(_0xc29ff0){while(--_0xc29ff0){_0x446b27['push'](_0x446b27['shift']());}};_0x5382ba(++_0x4fa8e0);}(_0x5725,0x15e));var _0x5572=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5725[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require('multer');var util=require(_0x5572('0x0'));var path=require(_0x5572('0x1'));var timeout=require('connect-timeout');var express=require(_0x5572('0x2'));var router=express[_0x5572('0x3')]();var fs_extra=require(_0x5572('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5572('0x5'));var config=require(_0x5572('0x6'));var controller=require('./intDeskConfiguration.controller');router[_0x5572('0x7')]('/',auth[_0x5572('0x8')](),controller[_0x5572('0x9')]);router[_0x5572('0x7')](_0x5572('0xa'),auth[_0x5572('0x8')](),controller['show']);router['get'](_0x5572('0xb'),auth['isAuthenticated'](),controller[_0x5572('0xc')]);router['get']('/:id/subjects',auth[_0x5572('0x8')](),controller[_0x5572('0xd')]);router[_0x5572('0x7')](_0x5572('0xe'),auth[_0x5572('0x8')](),controller[_0x5572('0xf')]);router[_0x5572('0x7')](_0x5572('0x10'),auth[_0x5572('0x8')](),controller['getTags']);router[_0x5572('0x11')]('/',auth[_0x5572('0x8')](),controller[_0x5572('0x12')]);router[_0x5572('0x11')](_0x5572('0x10'),auth['isAuthenticated'](),controller['setTags']);router[_0x5572('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5572('0x14')]);router[_0x5572('0x15')](_0x5572('0xa'),auth[_0x5572('0x8')](),controller[_0x5572('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index cc906a0..3b26bd6 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 _0x17f7=['exports','STRING','sequelize'];(function(_0x42e87e,_0x48a789){var _0x4931a4=function(_0x478895){while(--_0x478895){_0x42e87e['push'](_0x42e87e['shift']());}};_0x4931a4(++_0x48a789);}(_0x17f7,0xd4));var _0x717f=function(_0x51af6b,_0x217b57){_0x51af6b=_0x51af6b-0x0;var _0x38530c=_0x17f7[_0x51af6b];return _0x38530c;};'use strict';var Sequelize=require(_0x717f('0x0'));module[_0x717f('0x1')]={'name':{'type':Sequelize[_0x717f('0x2')]},'description':{'type':Sequelize[_0x717f('0x2')]}}; \ No newline at end of file +var _0xd331=['exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd331,0x14c));var _0x1d33=function(_0xa95cc9,_0x2f278d){_0xa95cc9=_0xa95cc9-0x0;var _0x5a078f=_0xd331[_0xa95cc9];return _0x5a078f;};'use strict';var Sequelize=require('sequelize');module[_0x1d33('0x0')]={'name':{'type':Sequelize[_0x1d33('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index c810841..33396f8 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 _0x4024=['set','Content-Range','apply','reject','save','destroy','end','stack','name','send','index','map','DeskConfiguration','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','show','params','rawAttributes','find','create','body','getFields','findOne','DeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','undefined','limit','count','offset'];(function(_0x4b5e77,_0x1898e7){var _0x301f24=function(_0x2593e1){while(--_0x2593e1){_0x4b5e77['push'](_0x4b5e77['shift']());}};_0x301f24(++_0x1898e7);}(_0x4024,0x89));var _0x4402=function(_0x313533,_0x517477){_0x313533=_0x313533-0x0;var _0x1a99e3=_0x4024[_0x313533];return _0x1a99e3;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];var jayson=require(_0x4402('0x13'));var client=jayson['client'][_0x4402('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x34d952,_0x42f1b0,_0x19d2f4,_0x248ad9){return new BPromise(function(_0x31710c,_0x18c7a8){var _0x3c7dd2=_0x248ad9||client;return _0x3c7dd2[_0x4402('0x15')](_0x34d952,_0x19d2f4)[_0x4402('0x16')](function(_0x375166){logger[_0x4402('0x17')](_0x4402('0x18'),_0x42f1b0,_0x4402('0x19'));logger[_0x4402('0x1a')](_0x4402('0x1b'),_0x42f1b0,_0x4402('0x19'),JSON[_0x4402('0x1c')](_0x375166));if(_0x375166[_0x4402('0x1d')]){if(_0x375166[_0x4402('0x1d')]['code']===0x1f4){logger['error'](_0x4402('0x18'),_0x42f1b0,_0x375166[_0x4402('0x1d')]['message']);return _0x18c7a8(_0x375166[_0x4402('0x1d')][_0x4402('0x1e')]);}logger['error'](_0x4402('0x18'),_0x42f1b0,_0x375166['error']['message']);return _0x31710c(_0x375166[_0x4402('0x1d')][_0x4402('0x1e')]);}else{logger[_0x4402('0x17')]('DeskConfiguration,\x20%s,\x20%s',_0x42f1b0,_0x4402('0x19'));_0x31710c(_0x375166['result']['message']);}})[_0x4402('0x1f')](function(_0x275c70){logger[_0x4402('0x1d')](_0x4402('0x18'),_0x42f1b0,_0x275c70);_0x18c7a8(_0x275c70);});});}function respondWithStatusCode(_0x258d10,_0x2e6fee){_0x2e6fee=_0x2e6fee||0xcc;return function(_0x289a3e){if(_0x289a3e){return _0x258d10[_0x4402('0x20')](_0x2e6fee);}return _0x258d10[_0x4402('0x21')](_0x2e6fee)['end']();};}function respondWithResult(_0x1409a9,_0x4e1c04){_0x4e1c04=_0x4e1c04||0xc8;return function(_0x3733cd){if(_0x3733cd){return _0x1409a9[_0x4402('0x21')](_0x4e1c04)[_0x4402('0x22')](_0x3733cd);}};}function respondWithFilteredResult(_0x211424,_0x5a43d0){return function(_0x15c19f){if(_0x15c19f){var _0x4e9cb5=typeof _0x5a43d0['offset']===_0x4402('0x23')&&typeof _0x5a43d0[_0x4402('0x24')]===_0x4402('0x23');var _0xabf61b=_0x15c19f[_0x4402('0x25')];var _0x514e41=_0x4e9cb5?0x0:_0x5a43d0[_0x4402('0x26')];var _0x52e625=_0x4e9cb5?_0x15c19f[_0x4402('0x25')]:_0x5a43d0[_0x4402('0x26')]+_0x5a43d0[_0x4402('0x24')];var _0x48d20d;if(_0x52e625>=_0xabf61b){_0x52e625=_0xabf61b;_0x48d20d=0xc8;}else{_0x48d20d=0xce;}_0x211424[_0x4402('0x21')](_0x48d20d);return _0x211424[_0x4402('0x27')](_0x4402('0x28'),_0x514e41+'-'+_0x52e625+'/'+_0xabf61b)[_0x4402('0x22')](_0x15c19f);}return null;};}function patchUpdates(_0x2526d1){return function(_0x605702){try{jsonpatch[_0x4402('0x29')](_0x605702,_0x2526d1,!![]);}catch(_0x435cfe){return BPromise[_0x4402('0x2a')](_0x435cfe);}return _0x605702[_0x4402('0x2b')]();};}function saveUpdates(_0xcea26b,_0x50748c){return function(_0x39f3fc){if(_0x39f3fc){return _0x39f3fc['update'](_0xcea26b)[_0x4402('0x16')](function(_0x554096){return _0x554096;});}return null;};}function removeEntity(_0x2dea0f,_0x3c7c65){return function(_0x145003){if(_0x145003){return _0x145003[_0x4402('0x2c')]()[_0x4402('0x16')](function(){_0x2dea0f['status'](0xcc)[_0x4402('0x2d')]();});}};}function handleEntityNotFound(_0x3fa7ae,_0x169340){return function(_0x566782){if(!_0x566782){_0x3fa7ae[_0x4402('0x20')](0x194);}return _0x566782;};}function handleError(_0x3383e3,_0x535e1d){_0x535e1d=_0x535e1d||0x1f4;return function(_0x2db1fe){logger[_0x4402('0x1d')](_0x2db1fe[_0x4402('0x2e')]);if(_0x2db1fe[_0x4402('0x2f')]){delete _0x2db1fe[_0x4402('0x2f')];}_0x3383e3[_0x4402('0x21')](_0x535e1d)[_0x4402('0x30')](_0x2db1fe);};}exports[_0x4402('0x31')]=function(_0xd66864,_0x5c819a){var _0x2995b6={},_0x28fee8={},_0x2a1657={'count':0x0,'rows':[]};var _0x566a80=_[_0x4402('0x32')](db[_0x4402('0x33')]['rawAttributes'],function(_0x52f75f){return{'name':_0x52f75f[_0x4402('0x34')],'type':_0x52f75f[_0x4402('0x35')][_0x4402('0x36')]};});_0x28fee8[_0x4402('0x37')]=_['map'](_0x566a80,'name');_0x28fee8['query']=_[_0x4402('0x38')](_0xd66864[_0x4402('0x39')]);_0x28fee8[_0x4402('0x3a')]=_[_0x4402('0x3b')](_0x28fee8['model'],_0x28fee8[_0x4402('0x39')]);_0x2995b6[_0x4402('0x3c')]=_[_0x4402('0x3b')](_0x28fee8['model'],qs[_0x4402('0x3d')](_0xd66864['query'][_0x4402('0x3d')]));_0x2995b6[_0x4402('0x3c')]=_0x2995b6['attributes'][_0x4402('0x3e')]?_0x2995b6['attributes']:_0x28fee8[_0x4402('0x37')];if(!_0xd66864[_0x4402('0x39')]['hasOwnProperty'](_0x4402('0x3f'))){_0x2995b6[_0x4402('0x24')]=qs[_0x4402('0x24')](_0xd66864[_0x4402('0x39')]['limit']);_0x2995b6['offset']=qs[_0x4402('0x26')](_0xd66864['query'][_0x4402('0x26')]);}_0x2995b6[_0x4402('0x40')]=qs[_0x4402('0x41')](_0xd66864[_0x4402('0x39')][_0x4402('0x41')]);_0x2995b6[_0x4402('0x42')]=qs[_0x4402('0x3a')](_[_0x4402('0x43')](_0xd66864[_0x4402('0x39')],_0x28fee8[_0x4402('0x3a')]),_0x566a80);if(_0xd66864['query'][_0x4402('0x44')]){_0x2995b6[_0x4402('0x42')]=_['merge'](_0x2995b6[_0x4402('0x42')],{'$or':_[_0x4402('0x32')](_0x566a80,function(_0x50552a){if(_0x50552a[_0x4402('0x35')]!==_0x4402('0x45')){var _0x1822c8={};_0x1822c8[_0x50552a[_0x4402('0x2f')]]={'$like':'%'+_0xd66864[_0x4402('0x39')]['filter']+'%'};return _0x1822c8;}})});}_0x2995b6=_[_0x4402('0x46')]({},_0x2995b6,_0xd66864[_0x4402('0x47')]);var _0x21d34f={'where':_0x2995b6[_0x4402('0x42')]};return db[_0x4402('0x33')][_0x4402('0x25')](_0x21d34f)[_0x4402('0x16')](function(_0x136c9c){_0x2a1657[_0x4402('0x25')]=_0x136c9c;if(_0xd66864[_0x4402('0x39')][_0x4402('0x48')]){_0x2995b6['include']=[{'all':!![]}];}return db[_0x4402('0x33')]['findAll'](_0x2995b6);})[_0x4402('0x16')](function(_0x34ce00){_0x2a1657['rows']=_0x34ce00;return _0x2a1657;})[_0x4402('0x16')](respondWithFilteredResult(_0x5c819a,_0x2995b6))[_0x4402('0x1f')](handleError(_0x5c819a,null));};exports[_0x4402('0x49')]=function(_0x21aa2d,_0x4436b2){var _0x2503eb={'raw':![],'where':{'id':_0x21aa2d[_0x4402('0x4a')]['id']}},_0x5b094b={};_0x5b094b[_0x4402('0x37')]=_[_0x4402('0x38')](db[_0x4402('0x33')][_0x4402('0x4b')]);_0x5b094b[_0x4402('0x39')]=_[_0x4402('0x38')](_0x21aa2d[_0x4402('0x39')]);_0x5b094b[_0x4402('0x3a')]=_['intersection'](_0x5b094b['model'],_0x5b094b['query']);_0x2503eb['attributes']=_[_0x4402('0x3b')](_0x5b094b[_0x4402('0x37')],qs[_0x4402('0x3d')](_0x21aa2d[_0x4402('0x39')]['fields']));_0x2503eb[_0x4402('0x3c')]=_0x2503eb[_0x4402('0x3c')][_0x4402('0x3e')]?_0x2503eb[_0x4402('0x3c')]:_0x5b094b[_0x4402('0x37')];if(_0x21aa2d[_0x4402('0x39')][_0x4402('0x48')]){_0x2503eb['include']=[{'all':!![]}];}_0x2503eb=_[_0x4402('0x46')]({},_0x2503eb,_0x21aa2d[_0x4402('0x47')]);return db[_0x4402('0x33')][_0x4402('0x4c')](_0x2503eb)[_0x4402('0x16')](handleEntityNotFound(_0x4436b2,null))[_0x4402('0x16')](respondWithResult(_0x4436b2,null))['catch'](handleError(_0x4436b2,null));};exports[_0x4402('0x4d')]=function(_0x642ab4,_0x3f45c3){return db[_0x4402('0x33')][_0x4402('0x4d')](_0x642ab4[_0x4402('0x4e')],{})[_0x4402('0x16')](respondWithResult(_0x3f45c3,0xc9))['catch'](handleError(_0x3f45c3,null));};exports['update']=function(_0x1a94f5,_0xb82409){if(_0x1a94f5[_0x4402('0x4e')]['id']){delete _0x1a94f5['body']['id'];}return db['DeskConfiguration'][_0x4402('0x4c')]({'where':{'id':_0x1a94f5[_0x4402('0x4a')]['id']}})[_0x4402('0x16')](handleEntityNotFound(_0xb82409,null))[_0x4402('0x16')](saveUpdates(_0x1a94f5[_0x4402('0x4e')],null))[_0x4402('0x16')](respondWithResult(_0xb82409,null))[_0x4402('0x1f')](handleError(_0xb82409,null));};exports[_0x4402('0x2c')]=function(_0x394ac9,_0x3f2599){return db[_0x4402('0x33')][_0x4402('0x4c')]({'where':{'id':_0x394ac9[_0x4402('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f2599,null))[_0x4402('0x16')](removeEntity(_0x3f2599,null))['catch'](handleError(_0x3f2599,null));};exports[_0x4402('0x4f')]=function(_0x55922e,_0x3fb9f0,_0x1e5891){var _0x1e4f1a={};var _0x31e36c={};var _0x1f298c;var _0x3cff5b;return db['DeskConfiguration'][_0x4402('0x50')]({'where':{'id':_0x55922e[_0x4402('0x4a')]['id']}})[_0x4402('0x16')](handleEntityNotFound(_0x3fb9f0,null))[_0x4402('0x16')](function(_0xb341ab){if(_0xb341ab){_0x1f298c=_0xb341ab;_0x31e36c['model']=_[_0x4402('0x38')](db[_0x4402('0x51')][_0x4402('0x4b')]);_0x31e36c[_0x4402('0x39')]=_[_0x4402('0x38')](_0x55922e[_0x4402('0x39')]);_0x31e36c[_0x4402('0x3a')]=_[_0x4402('0x3b')](_0x31e36c['model'],_0x31e36c[_0x4402('0x39')]);_0x1e4f1a[_0x4402('0x3c')]=_['intersection'](_0x31e36c[_0x4402('0x37')],qs[_0x4402('0x3d')](_0x55922e['query']['fields']));_0x1e4f1a[_0x4402('0x3c')]=_0x1e4f1a[_0x4402('0x3c')][_0x4402('0x3e')]?_0x1e4f1a['attributes']:_0x31e36c[_0x4402('0x37')];_0x1e4f1a[_0x4402('0x40')]=qs[_0x4402('0x41')](_0x55922e['query'][_0x4402('0x41')]);_0x1e4f1a[_0x4402('0x42')]=qs[_0x4402('0x3a')](_['pick'](_0x55922e[_0x4402('0x39')],_0x31e36c[_0x4402('0x3a')]));if(_0x55922e['query']['filter']){_0x1e4f1a[_0x4402('0x42')]=_['merge'](_0x1e4f1a[_0x4402('0x42')],{'$or':_[_0x4402('0x32')](_0x1e4f1a['attributes'],function(_0x4803b6){var _0x432c2e={};_0x432c2e[_0x4803b6]={'$like':'%'+_0x55922e[_0x4402('0x39')][_0x4402('0x44')]+'%'};return _0x432c2e;})});}_0x1e4f1a=_[_0x4402('0x46')]({},_0x1e4f1a,_0x55922e['options']);return _0x1f298c[_0x4402('0x4f')](_0x1e4f1a);}})[_0x4402('0x16')](function(_0x22ed41){if(_0x22ed41){_0x3cff5b=_0x22ed41[_0x4402('0x3e')];if(!_0x55922e[_0x4402('0x39')][_0x4402('0x52')](_0x4402('0x3f'))){_0x1e4f1a['limit']=qs[_0x4402('0x24')](_0x55922e[_0x4402('0x39')]['limit']);_0x1e4f1a['offset']=qs[_0x4402('0x26')](_0x55922e['query'][_0x4402('0x26')]);}return _0x1f298c['getFields'](_0x1e4f1a);}})[_0x4402('0x16')](function(_0x10b89a){if(_0x10b89a){return _0x10b89a?{'count':_0x3cff5b,'rows':_0x10b89a}:null;}})[_0x4402('0x16')](respondWithResult(_0x3fb9f0,null))[_0x4402('0x1f')](handleError(_0x3fb9f0,null));};exports[_0x4402('0x53')]=function(_0x1c1857,_0x436a74,_0x2bd8a3){var _0x187fec={};var _0x88864={};var _0x41534c;var _0xfd35f7;return db[_0x4402('0x33')][_0x4402('0x50')]({'where':{'id':_0x1c1857[_0x4402('0x4a')]['id']}})[_0x4402('0x16')](handleEntityNotFound(_0x436a74,null))['then'](function(_0x2ce936){if(_0x2ce936){_0x41534c=_0x2ce936;_0x88864[_0x4402('0x37')]=_[_0x4402('0x38')](db['DeskField'][_0x4402('0x4b')]);_0x88864['query']=_[_0x4402('0x38')](_0x1c1857[_0x4402('0x39')]);_0x88864[_0x4402('0x3a')]=_[_0x4402('0x3b')](_0x88864['model'],_0x88864[_0x4402('0x39')]);_0x187fec['attributes']=_[_0x4402('0x3b')](_0x88864[_0x4402('0x37')],qs[_0x4402('0x3d')](_0x1c1857['query'][_0x4402('0x3d')]));_0x187fec['attributes']=_0x187fec[_0x4402('0x3c')][_0x4402('0x3e')]?_0x187fec[_0x4402('0x3c')]:_0x88864[_0x4402('0x37')];_0x187fec[_0x4402('0x40')]=qs[_0x4402('0x41')](_0x1c1857[_0x4402('0x39')][_0x4402('0x41')]);_0x187fec[_0x4402('0x42')]=qs['filters'](_[_0x4402('0x43')](_0x1c1857[_0x4402('0x39')],_0x88864[_0x4402('0x3a')]));if(_0x1c1857[_0x4402('0x39')][_0x4402('0x44')]){_0x187fec[_0x4402('0x42')]=_[_0x4402('0x46')](_0x187fec[_0x4402('0x42')],{'$or':_[_0x4402('0x32')](_0x187fec['attributes'],function(_0x291015){var _0x2a6dc1={};_0x2a6dc1[_0x291015]={'$like':'%'+_0x1c1857[_0x4402('0x39')]['filter']+'%'};return _0x2a6dc1;})});}_0x187fec=_[_0x4402('0x46')]({},_0x187fec,_0x1c1857['options']);return _0x41534c[_0x4402('0x53')](_0x187fec);}})['then'](function(_0xc1d540){if(_0xc1d540){_0xfd35f7=_0xc1d540[_0x4402('0x3e')];if(!_0x1c1857['query'][_0x4402('0x52')]('nolimit')){_0x187fec[_0x4402('0x24')]=qs[_0x4402('0x24')](_0x1c1857['query'][_0x4402('0x24')]);_0x187fec[_0x4402('0x26')]=qs['offset'](_0x1c1857[_0x4402('0x39')][_0x4402('0x26')]);}return _0x41534c['getSubjects'](_0x187fec);}})[_0x4402('0x16')](function(_0x391867){if(_0x391867){return _0x391867?{'count':_0xfd35f7,'rows':_0x391867}:null;}})[_0x4402('0x16')](respondWithResult(_0x436a74,null))[_0x4402('0x1f')](handleError(_0x436a74,null));};exports[_0x4402('0x54')]=function(_0x17b133,_0x7f28d3,_0x370493){var _0x3da0b9={};var _0x476ae3={};var _0xac63f6;var _0xaa8da3;return db[_0x4402('0x33')][_0x4402('0x50')]({'where':{'id':_0x17b133['params']['id']}})[_0x4402('0x16')](handleEntityNotFound(_0x7f28d3,null))[_0x4402('0x16')](function(_0x4b9ac8){if(_0x4b9ac8){_0xac63f6=_0x4b9ac8;_0x476ae3[_0x4402('0x37')]=_['keys'](db[_0x4402('0x51')][_0x4402('0x4b')]);_0x476ae3[_0x4402('0x39')]=_['keys'](_0x17b133[_0x4402('0x39')]);_0x476ae3[_0x4402('0x3a')]=_[_0x4402('0x3b')](_0x476ae3['model'],_0x476ae3[_0x4402('0x39')]);_0x3da0b9[_0x4402('0x3c')]=_[_0x4402('0x3b')](_0x476ae3[_0x4402('0x37')],qs['fields'](_0x17b133[_0x4402('0x39')][_0x4402('0x3d')]));_0x3da0b9[_0x4402('0x3c')]=_0x3da0b9[_0x4402('0x3c')][_0x4402('0x3e')]?_0x3da0b9[_0x4402('0x3c')]:_0x476ae3[_0x4402('0x37')];_0x3da0b9[_0x4402('0x40')]=qs[_0x4402('0x41')](_0x17b133[_0x4402('0x39')][_0x4402('0x41')]);_0x3da0b9[_0x4402('0x42')]=qs[_0x4402('0x3a')](_['pick'](_0x17b133[_0x4402('0x39')],_0x476ae3[_0x4402('0x3a')]));if(_0x17b133[_0x4402('0x39')][_0x4402('0x44')]){_0x3da0b9['where']=_['merge'](_0x3da0b9[_0x4402('0x42')],{'$or':_[_0x4402('0x32')](_0x3da0b9[_0x4402('0x3c')],function(_0x2c09ab){var _0x4bdb42={};_0x4bdb42[_0x2c09ab]={'$like':'%'+_0x17b133[_0x4402('0x39')][_0x4402('0x44')]+'%'};return _0x4bdb42;})});}_0x3da0b9=_['merge']({},_0x3da0b9,_0x17b133[_0x4402('0x47')]);return _0xac63f6[_0x4402('0x54')](_0x3da0b9);}})[_0x4402('0x16')](function(_0x1271eb){if(_0x1271eb){_0xaa8da3=_0x1271eb[_0x4402('0x3e')];if(!_0x17b133['query'][_0x4402('0x52')](_0x4402('0x3f'))){_0x3da0b9[_0x4402('0x24')]=qs[_0x4402('0x24')](_0x17b133[_0x4402('0x39')][_0x4402('0x24')]);_0x3da0b9[_0x4402('0x26')]=qs['offset'](_0x17b133[_0x4402('0x39')][_0x4402('0x26')]);}return _0xac63f6[_0x4402('0x54')](_0x3da0b9);}})[_0x4402('0x16')](function(_0x2ea904){if(_0x2ea904){return _0x2ea904?{'count':_0xaa8da3,'rows':_0x2ea904}:null;}})['then'](respondWithResult(_0x7f28d3,null))[_0x4402('0x1f')](handleError(_0x7f28d3,null));};exports[_0x4402('0x55')]=function(_0x572e21,_0x2325c7,_0x4c994a){var _0x5bf78a={};var _0x364a26={};var _0x505a13;var _0x32be98;return db['DeskConfiguration']['findOne']({'where':{'id':_0x572e21[_0x4402('0x4a')]['id']}})[_0x4402('0x16')](handleEntityNotFound(_0x2325c7,null))[_0x4402('0x16')](function(_0x1f1222){if(_0x1f1222){_0x505a13=_0x1f1222;_0x364a26[_0x4402('0x37')]=_[_0x4402('0x38')](db['Tag'][_0x4402('0x4b')]);_0x364a26[_0x4402('0x39')]=_['keys'](_0x572e21[_0x4402('0x39')]);_0x364a26['filters']=_['intersection'](_0x364a26[_0x4402('0x37')],_0x364a26['query']);_0x5bf78a[_0x4402('0x3c')]=_[_0x4402('0x3b')](_0x364a26[_0x4402('0x37')],qs[_0x4402('0x3d')](_0x572e21[_0x4402('0x39')]['fields']));_0x5bf78a['attributes']=_0x5bf78a[_0x4402('0x3c')][_0x4402('0x3e')]?_0x5bf78a['attributes']:_0x364a26[_0x4402('0x37')];_0x5bf78a[_0x4402('0x40')]=qs[_0x4402('0x41')](_0x572e21[_0x4402('0x39')][_0x4402('0x41')]);_0x5bf78a[_0x4402('0x42')]=qs['filters'](_['pick'](_0x572e21[_0x4402('0x39')],_0x364a26[_0x4402('0x3a')]));if(_0x572e21[_0x4402('0x39')][_0x4402('0x44')]){_0x5bf78a[_0x4402('0x42')]=_[_0x4402('0x46')](_0x5bf78a['where'],{'$or':_[_0x4402('0x32')](_0x5bf78a[_0x4402('0x3c')],function(_0xe21a69){var _0x7fd131={};_0x7fd131[_0xe21a69]={'$like':'%'+_0x572e21[_0x4402('0x39')]['filter']+'%'};return _0x7fd131;})});}_0x5bf78a=_[_0x4402('0x46')]({},_0x5bf78a,_0x572e21[_0x4402('0x47')]);return _0x505a13[_0x4402('0x55')](_0x5bf78a);}})[_0x4402('0x16')](function(_0x3b89e8){if(_0x3b89e8){_0x32be98=_0x3b89e8[_0x4402('0x3e')];if(!_0x572e21['query']['hasOwnProperty'](_0x4402('0x3f'))){_0x5bf78a['limit']=qs[_0x4402('0x24')](_0x572e21[_0x4402('0x39')][_0x4402('0x24')]);_0x5bf78a[_0x4402('0x26')]=qs[_0x4402('0x26')](_0x572e21[_0x4402('0x39')][_0x4402('0x26')]);}return _0x505a13[_0x4402('0x55')](_0x5bf78a);}})[_0x4402('0x16')](function(_0x23306f){if(_0x23306f){return _0x23306f?{'count':_0x32be98,'rows':_0x23306f}:null;}})[_0x4402('0x16')](respondWithResult(_0x2325c7,null))[_0x4402('0x1f')](handleError(_0x2325c7,null));};exports[_0x4402('0x56')]=function(_0x372c6e,_0x127d5e,_0x1ba5a1){if(_0x372c6e[_0x4402('0x4e')]['id']){delete _0x372c6e[_0x4402('0x4e')]['id'];}return db[_0x4402('0x33')][_0x4402('0x50')]({'where':{'id':_0x372c6e[_0x4402('0x4a')]['id']}})[_0x4402('0x16')](handleEntityNotFound(_0x127d5e,null))[_0x4402('0x16')](function(_0x47a76a){if(_0x47a76a){return _0x47a76a[_0x4402('0x56')](_0x372c6e[_0x4402('0x4e')][_0x4402('0x57')]||[]);}return null;})[_0x4402('0x16')](respondWithResult(_0x127d5e,null))[_0x4402('0x1f')](handleError(_0x127d5e,null));}; \ No newline at end of file +var _0x3c81=['request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','json','limit','undefined','offset','count','status','Content-Range','apply','save','update','then','destroy','end','stack','name','send','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','DeskConfiguration','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','catch','params','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','info','DeskConfiguration,\x20%s,\x20%s'];(function(_0x14716e,_0xa451){var _0x5df3a9=function(_0xff12f9){while(--_0xff12f9){_0x14716e['push'](_0x14716e['shift']());}};_0x5df3a9(++_0xa451);}(_0x3c81,0x102));var _0x13c8=function(_0x2e2c5f,_0x16f3b8){_0x2e2c5f=_0x2e2c5f-0x0;var _0x5a5001=_0x3c81[_0x2e2c5f];return _0x5a5001;};'use strict';var emlformat=require(_0x13c8('0x0'));var rimraf=require(_0x13c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13c8('0x2'));var rp=require(_0x13c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x13c8('0x4'));var sox=require(_0x13c8('0x5'));var csv=require(_0x13c8('0x6'));var ejs=require(_0x13c8('0x7'));var fs=require('fs');var fs_extra=require(_0x13c8('0x8'));var _=require(_0x13c8('0x9'));var squel=require(_0x13c8('0xa'));var crypto=require('crypto');var jsforce=require(_0x13c8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x13c8('0x6'));var querystring=require(_0x13c8('0xc'));var Papa=require(_0x13c8('0xd'));var Redis=require(_0x13c8('0xe'));var authService=require(_0x13c8('0xf'));var qs=require(_0x13c8('0x10'));var as=require(_0x13c8('0x11'));var hardwareService=require(_0x13c8('0x12'));var logger=require(_0x13c8('0x13'))(_0x13c8('0x14'));var utils=require(_0x13c8('0x15'));var config=require(_0x13c8('0x16'));var licenseUtil=require(_0x13c8('0x17'));var db=require(_0x13c8('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x13c8('0x19')][_0x13c8('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2304b5,_0x1f9b6f,_0x4a077c,_0x42955d){return new BPromise(function(_0x515681,_0x4d7a88){var _0x589636=_0x42955d||client;return _0x589636[_0x13c8('0x1b')](_0x2304b5,_0x4a077c)['then'](function(_0x337397){logger[_0x13c8('0x1c')](_0x13c8('0x1d'),_0x1f9b6f,_0x13c8('0x1e'));logger['debug'](_0x13c8('0x1f'),_0x1f9b6f,_0x13c8('0x1e'),JSON[_0x13c8('0x20')](_0x337397));if(_0x337397[_0x13c8('0x21')]){if(_0x337397[_0x13c8('0x21')][_0x13c8('0x22')]===0x1f4){logger[_0x13c8('0x21')](_0x13c8('0x1d'),_0x1f9b6f,_0x337397[_0x13c8('0x21')][_0x13c8('0x23')]);return _0x4d7a88(_0x337397[_0x13c8('0x21')]['message']);}logger[_0x13c8('0x21')](_0x13c8('0x1d'),_0x1f9b6f,_0x337397[_0x13c8('0x21')][_0x13c8('0x23')]);return _0x515681(_0x337397['error'][_0x13c8('0x23')]);}else{logger[_0x13c8('0x1c')](_0x13c8('0x1d'),_0x1f9b6f,_0x13c8('0x1e'));_0x515681(_0x337397[_0x13c8('0x24')][_0x13c8('0x23')]);}})['catch'](function(_0x28f99c){logger[_0x13c8('0x21')](_0x13c8('0x1d'),_0x1f9b6f,_0x28f99c);_0x4d7a88(_0x28f99c);});});}function respondWithStatusCode(_0xcf41d2,_0x577df6){_0x577df6=_0x577df6||0xcc;return function(_0x1770e5){if(_0x1770e5){return _0xcf41d2[_0x13c8('0x25')](_0x577df6);}return _0xcf41d2['status'](_0x577df6)['end']();};}function respondWithResult(_0x3b4fd8,_0x4aff35){_0x4aff35=_0x4aff35||0xc8;return function(_0x47e8ae){if(_0x47e8ae){return _0x3b4fd8['status'](_0x4aff35)[_0x13c8('0x26')](_0x47e8ae);}};}function respondWithFilteredResult(_0xc7f1b6,_0x53ada9){return function(_0x4df077){if(_0x4df077){var _0x196983=typeof _0x53ada9['offset']==='undefined'&&typeof _0x53ada9[_0x13c8('0x27')]===_0x13c8('0x28');var _0x34fdbe=_0x4df077['count'];var _0x5ef2f7=_0x196983?0x0:_0x53ada9[_0x13c8('0x29')];var _0x1071a0=_0x196983?_0x4df077[_0x13c8('0x2a')]:_0x53ada9[_0x13c8('0x29')]+_0x53ada9[_0x13c8('0x27')];var _0x220d40;if(_0x1071a0>=_0x34fdbe){_0x1071a0=_0x34fdbe;_0x220d40=0xc8;}else{_0x220d40=0xce;}_0xc7f1b6[_0x13c8('0x2b')](_0x220d40);return _0xc7f1b6['set'](_0x13c8('0x2c'),_0x5ef2f7+'-'+_0x1071a0+'/'+_0x34fdbe)[_0x13c8('0x26')](_0x4df077);}return null;};}function patchUpdates(_0x5a5911){return function(_0x5c85e4){try{jsonpatch[_0x13c8('0x2d')](_0x5c85e4,_0x5a5911,!![]);}catch(_0xc7225a){return BPromise['reject'](_0xc7225a);}return _0x5c85e4[_0x13c8('0x2e')]();};}function saveUpdates(_0x355ddc,_0x47e0f8){return function(_0x21224a){if(_0x21224a){return _0x21224a[_0x13c8('0x2f')](_0x355ddc)[_0x13c8('0x30')](function(_0x26a93b){return _0x26a93b;});}return null;};}function removeEntity(_0x207dc2,_0x2f600d){return function(_0x1a9298){if(_0x1a9298){return _0x1a9298[_0x13c8('0x31')]()['then'](function(){_0x207dc2['status'](0xcc)[_0x13c8('0x32')]();});}};}function handleEntityNotFound(_0x37eaec,_0x517d01){return function(_0x30d328){if(!_0x30d328){_0x37eaec['sendStatus'](0x194);}return _0x30d328;};}function handleError(_0x1fdf7d,_0x541784){_0x541784=_0x541784||0x1f4;return function(_0x202918){logger[_0x13c8('0x21')](_0x202918[_0x13c8('0x33')]);if(_0x202918[_0x13c8('0x34')]){delete _0x202918[_0x13c8('0x34')];}_0x1fdf7d[_0x13c8('0x2b')](_0x541784)[_0x13c8('0x35')](_0x202918);};}exports['index']=function(_0x388df4,_0x4f7a97){var _0x4fcec3={},_0x362b9c={},_0x8ae2e5={'count':0x0,'rows':[]};var _0x2bfbf4=_['map'](db['DeskConfiguration']['rawAttributes'],function(_0x2776c0){return{'name':_0x2776c0[_0x13c8('0x36')],'type':_0x2776c0[_0x13c8('0x37')][_0x13c8('0x38')]};});_0x362b9c[_0x13c8('0x39')]=_[_0x13c8('0x3a')](_0x2bfbf4,_0x13c8('0x34'));_0x362b9c[_0x13c8('0x3b')]=_[_0x13c8('0x3c')](_0x388df4['query']);_0x362b9c['filters']=_[_0x13c8('0x3d')](_0x362b9c[_0x13c8('0x39')],_0x362b9c[_0x13c8('0x3b')]);_0x4fcec3[_0x13c8('0x3e')]=_['intersection'](_0x362b9c[_0x13c8('0x39')],qs['fields'](_0x388df4[_0x13c8('0x3b')][_0x13c8('0x3f')]));_0x4fcec3[_0x13c8('0x3e')]=_0x4fcec3[_0x13c8('0x3e')][_0x13c8('0x40')]?_0x4fcec3[_0x13c8('0x3e')]:_0x362b9c[_0x13c8('0x39')];if(!_0x388df4[_0x13c8('0x3b')][_0x13c8('0x41')](_0x13c8('0x42'))){_0x4fcec3[_0x13c8('0x27')]=qs[_0x13c8('0x27')](_0x388df4[_0x13c8('0x3b')][_0x13c8('0x27')]);_0x4fcec3[_0x13c8('0x29')]=qs[_0x13c8('0x29')](_0x388df4[_0x13c8('0x3b')][_0x13c8('0x29')]);}_0x4fcec3[_0x13c8('0x43')]=qs[_0x13c8('0x44')](_0x388df4[_0x13c8('0x3b')][_0x13c8('0x44')]);_0x4fcec3[_0x13c8('0x45')]=qs[_0x13c8('0x46')](_[_0x13c8('0x47')](_0x388df4['query'],_0x362b9c[_0x13c8('0x46')]),_0x2bfbf4);if(_0x388df4[_0x13c8('0x3b')][_0x13c8('0x48')]){_0x4fcec3[_0x13c8('0x45')]=_[_0x13c8('0x49')](_0x4fcec3['where'],{'$or':_['map'](_0x2bfbf4,function(_0x25606f){if(_0x25606f[_0x13c8('0x37')]!==_0x13c8('0x4a')){var _0x47d41f={};_0x47d41f[_0x25606f['name']]={'$like':'%'+_0x388df4['query'][_0x13c8('0x48')]+'%'};return _0x47d41f;}})});}_0x4fcec3=_['merge']({},_0x4fcec3,_0x388df4[_0x13c8('0x4b')]);var _0x4e3bb7={'where':_0x4fcec3[_0x13c8('0x45')]};return db[_0x13c8('0x4c')][_0x13c8('0x2a')](_0x4e3bb7)[_0x13c8('0x30')](function(_0x3fcc4d){_0x8ae2e5[_0x13c8('0x2a')]=_0x3fcc4d;if(_0x388df4['query'][_0x13c8('0x4d')]){_0x4fcec3[_0x13c8('0x4e')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x13c8('0x4f')](_0x4fcec3);})[_0x13c8('0x30')](function(_0x2e925f){_0x8ae2e5[_0x13c8('0x50')]=_0x2e925f;return _0x8ae2e5;})[_0x13c8('0x30')](respondWithFilteredResult(_0x4f7a97,_0x4fcec3))['catch'](handleError(_0x4f7a97,null));};exports[_0x13c8('0x51')]=function(_0x32914b,_0x2e94ae){var _0x38418b={'raw':![],'where':{'id':_0x32914b['params']['id']}},_0x185d18={};_0x185d18[_0x13c8('0x39')]=_[_0x13c8('0x3c')](db[_0x13c8('0x4c')][_0x13c8('0x52')]);_0x185d18[_0x13c8('0x3b')]=_[_0x13c8('0x3c')](_0x32914b[_0x13c8('0x3b')]);_0x185d18[_0x13c8('0x46')]=_[_0x13c8('0x3d')](_0x185d18[_0x13c8('0x39')],_0x185d18[_0x13c8('0x3b')]);_0x38418b['attributes']=_[_0x13c8('0x3d')](_0x185d18[_0x13c8('0x39')],qs[_0x13c8('0x3f')](_0x32914b[_0x13c8('0x3b')][_0x13c8('0x3f')]));_0x38418b[_0x13c8('0x3e')]=_0x38418b['attributes'][_0x13c8('0x40')]?_0x38418b[_0x13c8('0x3e')]:_0x185d18[_0x13c8('0x39')];if(_0x32914b['query']['includeAll']){_0x38418b[_0x13c8('0x4e')]=[{'all':!![]}];}_0x38418b=_[_0x13c8('0x49')]({},_0x38418b,_0x32914b['options']);return db[_0x13c8('0x4c')][_0x13c8('0x53')](_0x38418b)['then'](handleEntityNotFound(_0x2e94ae,null))[_0x13c8('0x30')](respondWithResult(_0x2e94ae,null))['catch'](handleError(_0x2e94ae,null));};exports[_0x13c8('0x54')]=function(_0x1f67bd,_0x10c72f){return db['DeskConfiguration'][_0x13c8('0x54')](_0x1f67bd[_0x13c8('0x55')],{})['then'](respondWithResult(_0x10c72f,0xc9))[_0x13c8('0x56')](handleError(_0x10c72f,null));};exports['update']=function(_0x95289e,_0x5eda4c){if(_0x95289e[_0x13c8('0x55')]['id']){delete _0x95289e[_0x13c8('0x55')]['id'];}return db[_0x13c8('0x4c')]['find']({'where':{'id':_0x95289e[_0x13c8('0x57')]['id']}})['then'](handleEntityNotFound(_0x5eda4c,null))['then'](saveUpdates(_0x95289e['body'],null))['then'](respondWithResult(_0x5eda4c,null))['catch'](handleError(_0x5eda4c,null));};exports[_0x13c8('0x31')]=function(_0x46074c,_0x1515a5){return db[_0x13c8('0x4c')][_0x13c8('0x53')]({'where':{'id':_0x46074c[_0x13c8('0x57')]['id']}})[_0x13c8('0x30')](handleEntityNotFound(_0x1515a5,null))['then'](removeEntity(_0x1515a5,null))['catch'](handleError(_0x1515a5,null));};exports[_0x13c8('0x58')]=function(_0x30e3e4,_0x27760b,_0x11b3ba){var _0x1a346a={};var _0x1ceea5={};var _0x4678a0;var _0x1053a4;return db['DeskConfiguration'][_0x13c8('0x59')]({'where':{'id':_0x30e3e4[_0x13c8('0x57')]['id']}})['then'](handleEntityNotFound(_0x27760b,null))[_0x13c8('0x30')](function(_0x2ebbcd){if(_0x2ebbcd){_0x4678a0=_0x2ebbcd;_0x1ceea5[_0x13c8('0x39')]=_[_0x13c8('0x3c')](db[_0x13c8('0x5a')][_0x13c8('0x52')]);_0x1ceea5[_0x13c8('0x3b')]=_[_0x13c8('0x3c')](_0x30e3e4[_0x13c8('0x3b')]);_0x1ceea5[_0x13c8('0x46')]=_[_0x13c8('0x3d')](_0x1ceea5[_0x13c8('0x39')],_0x1ceea5[_0x13c8('0x3b')]);_0x1a346a[_0x13c8('0x3e')]=_[_0x13c8('0x3d')](_0x1ceea5[_0x13c8('0x39')],qs['fields'](_0x30e3e4[_0x13c8('0x3b')]['fields']));_0x1a346a[_0x13c8('0x3e')]=_0x1a346a[_0x13c8('0x3e')]['length']?_0x1a346a[_0x13c8('0x3e')]:_0x1ceea5[_0x13c8('0x39')];_0x1a346a['order']=qs[_0x13c8('0x44')](_0x30e3e4[_0x13c8('0x3b')][_0x13c8('0x44')]);_0x1a346a[_0x13c8('0x45')]=qs[_0x13c8('0x46')](_[_0x13c8('0x47')](_0x30e3e4[_0x13c8('0x3b')],_0x1ceea5[_0x13c8('0x46')]));if(_0x30e3e4[_0x13c8('0x3b')][_0x13c8('0x48')]){_0x1a346a[_0x13c8('0x45')]=_['merge'](_0x1a346a[_0x13c8('0x45')],{'$or':_[_0x13c8('0x3a')](_0x1a346a[_0x13c8('0x3e')],function(_0x2445c1){var _0x372ae4={};_0x372ae4[_0x2445c1]={'$like':'%'+_0x30e3e4[_0x13c8('0x3b')]['filter']+'%'};return _0x372ae4;})});}_0x1a346a=_[_0x13c8('0x49')]({},_0x1a346a,_0x30e3e4[_0x13c8('0x4b')]);return _0x4678a0[_0x13c8('0x58')](_0x1a346a);}})['then'](function(_0x54241e){if(_0x54241e){_0x1053a4=_0x54241e[_0x13c8('0x40')];if(!_0x30e3e4[_0x13c8('0x3b')][_0x13c8('0x41')](_0x13c8('0x42'))){_0x1a346a[_0x13c8('0x27')]=qs['limit'](_0x30e3e4[_0x13c8('0x3b')][_0x13c8('0x27')]);_0x1a346a[_0x13c8('0x29')]=qs[_0x13c8('0x29')](_0x30e3e4['query'][_0x13c8('0x29')]);}return _0x4678a0[_0x13c8('0x58')](_0x1a346a);}})[_0x13c8('0x30')](function(_0x308482){if(_0x308482){return _0x308482?{'count':_0x1053a4,'rows':_0x308482}:null;}})[_0x13c8('0x30')](respondWithResult(_0x27760b,null))[_0x13c8('0x56')](handleError(_0x27760b,null));};exports[_0x13c8('0x5b')]=function(_0x4b3579,_0x45f0ba,_0x40ff05){var _0x399ea3={};var _0x55926a={};var _0x1fc721;var _0x34cf4a;return db['DeskConfiguration']['findOne']({'where':{'id':_0x4b3579[_0x13c8('0x57')]['id']}})['then'](handleEntityNotFound(_0x45f0ba,null))[_0x13c8('0x30')](function(_0x47f5ff){if(_0x47f5ff){_0x1fc721=_0x47f5ff;_0x55926a[_0x13c8('0x39')]=_[_0x13c8('0x3c')](db[_0x13c8('0x5a')][_0x13c8('0x52')]);_0x55926a[_0x13c8('0x3b')]=_['keys'](_0x4b3579[_0x13c8('0x3b')]);_0x55926a[_0x13c8('0x46')]=_['intersection'](_0x55926a[_0x13c8('0x39')],_0x55926a[_0x13c8('0x3b')]);_0x399ea3[_0x13c8('0x3e')]=_[_0x13c8('0x3d')](_0x55926a[_0x13c8('0x39')],qs[_0x13c8('0x3f')](_0x4b3579[_0x13c8('0x3b')][_0x13c8('0x3f')]));_0x399ea3[_0x13c8('0x3e')]=_0x399ea3[_0x13c8('0x3e')]['length']?_0x399ea3[_0x13c8('0x3e')]:_0x55926a[_0x13c8('0x39')];_0x399ea3['order']=qs['sort'](_0x4b3579[_0x13c8('0x3b')][_0x13c8('0x44')]);_0x399ea3[_0x13c8('0x45')]=qs[_0x13c8('0x46')](_[_0x13c8('0x47')](_0x4b3579[_0x13c8('0x3b')],_0x55926a['filters']));if(_0x4b3579[_0x13c8('0x3b')][_0x13c8('0x48')]){_0x399ea3[_0x13c8('0x45')]=_[_0x13c8('0x49')](_0x399ea3[_0x13c8('0x45')],{'$or':_['map'](_0x399ea3[_0x13c8('0x3e')],function(_0x13b97d){var _0x564cc9={};_0x564cc9[_0x13b97d]={'$like':'%'+_0x4b3579[_0x13c8('0x3b')][_0x13c8('0x48')]+'%'};return _0x564cc9;})});}_0x399ea3=_['merge']({},_0x399ea3,_0x4b3579[_0x13c8('0x4b')]);return _0x1fc721['getSubjects'](_0x399ea3);}})[_0x13c8('0x30')](function(_0x5a4e0a){if(_0x5a4e0a){_0x34cf4a=_0x5a4e0a[_0x13c8('0x40')];if(!_0x4b3579[_0x13c8('0x3b')][_0x13c8('0x41')]('nolimit')){_0x399ea3[_0x13c8('0x27')]=qs['limit'](_0x4b3579['query'][_0x13c8('0x27')]);_0x399ea3[_0x13c8('0x29')]=qs[_0x13c8('0x29')](_0x4b3579[_0x13c8('0x3b')]['offset']);}return _0x1fc721['getSubjects'](_0x399ea3);}})[_0x13c8('0x30')](function(_0x55727a){if(_0x55727a){return _0x55727a?{'count':_0x34cf4a,'rows':_0x55727a}:null;}})['then'](respondWithResult(_0x45f0ba,null))[_0x13c8('0x56')](handleError(_0x45f0ba,null));};exports[_0x13c8('0x5c')]=function(_0x316b20,_0x36000c,_0x523eef){var _0x16386c={};var _0x48cb34={};var _0x5ecd3c;var _0x14cfac;return db[_0x13c8('0x4c')][_0x13c8('0x59')]({'where':{'id':_0x316b20[_0x13c8('0x57')]['id']}})[_0x13c8('0x30')](handleEntityNotFound(_0x36000c,null))['then'](function(_0x23766e){if(_0x23766e){_0x5ecd3c=_0x23766e;_0x48cb34['model']=_[_0x13c8('0x3c')](db['DeskField']['rawAttributes']);_0x48cb34[_0x13c8('0x3b')]=_['keys'](_0x316b20[_0x13c8('0x3b')]);_0x48cb34[_0x13c8('0x46')]=_['intersection'](_0x48cb34[_0x13c8('0x39')],_0x48cb34[_0x13c8('0x3b')]);_0x16386c[_0x13c8('0x3e')]=_[_0x13c8('0x3d')](_0x48cb34[_0x13c8('0x39')],qs['fields'](_0x316b20[_0x13c8('0x3b')][_0x13c8('0x3f')]));_0x16386c[_0x13c8('0x3e')]=_0x16386c[_0x13c8('0x3e')][_0x13c8('0x40')]?_0x16386c['attributes']:_0x48cb34['model'];_0x16386c[_0x13c8('0x43')]=qs[_0x13c8('0x44')](_0x316b20[_0x13c8('0x3b')][_0x13c8('0x44')]);_0x16386c[_0x13c8('0x45')]=qs[_0x13c8('0x46')](_[_0x13c8('0x47')](_0x316b20[_0x13c8('0x3b')],_0x48cb34[_0x13c8('0x46')]));if(_0x316b20[_0x13c8('0x3b')]['filter']){_0x16386c['where']=_[_0x13c8('0x49')](_0x16386c[_0x13c8('0x45')],{'$or':_['map'](_0x16386c[_0x13c8('0x3e')],function(_0x462db2){var _0x1c6fcd={};_0x1c6fcd[_0x462db2]={'$like':'%'+_0x316b20[_0x13c8('0x3b')]['filter']+'%'};return _0x1c6fcd;})});}_0x16386c=_[_0x13c8('0x49')]({},_0x16386c,_0x316b20[_0x13c8('0x4b')]);return _0x5ecd3c[_0x13c8('0x5c')](_0x16386c);}})['then'](function(_0x2959c5){if(_0x2959c5){_0x14cfac=_0x2959c5[_0x13c8('0x40')];if(!_0x316b20[_0x13c8('0x3b')]['hasOwnProperty'](_0x13c8('0x42'))){_0x16386c[_0x13c8('0x27')]=qs[_0x13c8('0x27')](_0x316b20[_0x13c8('0x3b')][_0x13c8('0x27')]);_0x16386c[_0x13c8('0x29')]=qs['offset'](_0x316b20['query']['offset']);}return _0x5ecd3c['getDescriptions'](_0x16386c);}})[_0x13c8('0x30')](function(_0x174b63){if(_0x174b63){return _0x174b63?{'count':_0x14cfac,'rows':_0x174b63}:null;}})[_0x13c8('0x30')](respondWithResult(_0x36000c,null))[_0x13c8('0x56')](handleError(_0x36000c,null));};exports[_0x13c8('0x5d')]=function(_0x3c9355,_0x1b9c6f,_0x126fa4){var _0x2180a9={};var _0x87dc49={};var _0x350465;var _0x4b4691;return db['DeskConfiguration'][_0x13c8('0x59')]({'where':{'id':_0x3c9355[_0x13c8('0x57')]['id']}})[_0x13c8('0x30')](handleEntityNotFound(_0x1b9c6f,null))[_0x13c8('0x30')](function(_0x4d1f5b){if(_0x4d1f5b){_0x350465=_0x4d1f5b;_0x87dc49[_0x13c8('0x39')]=_[_0x13c8('0x3c')](db[_0x13c8('0x5e')]['rawAttributes']);_0x87dc49['query']=_['keys'](_0x3c9355[_0x13c8('0x3b')]);_0x87dc49[_0x13c8('0x46')]=_[_0x13c8('0x3d')](_0x87dc49[_0x13c8('0x39')],_0x87dc49[_0x13c8('0x3b')]);_0x2180a9[_0x13c8('0x3e')]=_[_0x13c8('0x3d')](_0x87dc49[_0x13c8('0x39')],qs['fields'](_0x3c9355[_0x13c8('0x3b')]['fields']));_0x2180a9['attributes']=_0x2180a9[_0x13c8('0x3e')][_0x13c8('0x40')]?_0x2180a9[_0x13c8('0x3e')]:_0x87dc49[_0x13c8('0x39')];_0x2180a9['order']=qs[_0x13c8('0x44')](_0x3c9355['query'][_0x13c8('0x44')]);_0x2180a9[_0x13c8('0x45')]=qs[_0x13c8('0x46')](_[_0x13c8('0x47')](_0x3c9355['query'],_0x87dc49[_0x13c8('0x46')]));if(_0x3c9355['query'][_0x13c8('0x48')]){_0x2180a9[_0x13c8('0x45')]=_['merge'](_0x2180a9['where'],{'$or':_['map'](_0x2180a9[_0x13c8('0x3e')],function(_0x1cda57){var _0x5048e4={};_0x5048e4[_0x1cda57]={'$like':'%'+_0x3c9355[_0x13c8('0x3b')][_0x13c8('0x48')]+'%'};return _0x5048e4;})});}_0x2180a9=_[_0x13c8('0x49')]({},_0x2180a9,_0x3c9355['options']);return _0x350465[_0x13c8('0x5d')](_0x2180a9);}})['then'](function(_0x4dc047){if(_0x4dc047){_0x4b4691=_0x4dc047['length'];if(!_0x3c9355[_0x13c8('0x3b')][_0x13c8('0x41')](_0x13c8('0x42'))){_0x2180a9[_0x13c8('0x27')]=qs[_0x13c8('0x27')](_0x3c9355[_0x13c8('0x3b')]['limit']);_0x2180a9[_0x13c8('0x29')]=qs['offset'](_0x3c9355['query'][_0x13c8('0x29')]);}return _0x350465['getTags'](_0x2180a9);}})[_0x13c8('0x30')](function(_0x3a701b){if(_0x3a701b){return _0x3a701b?{'count':_0x4b4691,'rows':_0x3a701b}:null;}})['then'](respondWithResult(_0x1b9c6f,null))[_0x13c8('0x56')](handleError(_0x1b9c6f,null));};exports[_0x13c8('0x5f')]=function(_0x2d0e63,_0x49cb2a,_0x4208a0){if(_0x2d0e63['body']['id']){delete _0x2d0e63[_0x13c8('0x55')]['id'];}return db[_0x13c8('0x4c')]['findOne']({'where':{'id':_0x2d0e63[_0x13c8('0x57')]['id']}})['then'](handleEntityNotFound(_0x49cb2a,null))['then'](function(_0x167979){if(_0x167979){return _0x167979[_0x13c8('0x5f')](_0x2d0e63[_0x13c8('0x55')]['ids']||[]);}return null;})[_0x13c8('0x30')](respondWithResult(_0x49cb2a,null))[_0x13c8('0x56')](handleError(_0x49cb2a,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 0ba3fb1..f1bd47a 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 _0xb6ab=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0xb6ab,0x1dc));var _0xbb6a=function(_0x4d275d,_0x530222){_0x4d275d=_0x4d275d-0x0;var _0x41d6a8=_0xb6ab[_0x4d275d];return _0x41d6a8;};'use strict';var _=require(_0xbb6a('0x0'));var util=require(_0xbb6a('0x1'));var logger=require(_0xbb6a('0x2'))(_0xbb6a('0x3'));var moment=require(_0xbb6a('0x4'));var BPromise=require(_0xbb6a('0x5'));var rp=require(_0xbb6a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb6a('0x7'));var config=require(_0xbb6a('0x8'));var attributes=require(_0xbb6a('0x9'));module[_0xbb6a('0xa')]=function(_0xf1431f,_0x964353){return _0xf1431f[_0xbb6a('0xb')](_0xbb6a('0xc'),attributes,{'tableName':_0xbb6a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4f6=['request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','DeskConfiguration','lodash','api','moment','bluebird'];(function(_0x24d750,_0xfe2c96){var _0x187bc2=function(_0x312268){while(--_0x312268){_0x24d750['push'](_0x24d750['shift']());}};_0x187bc2(++_0xfe2c96);}(_0xd4f6,0x128));var _0x6d4f=function(_0x553502,_0x4d2c0c){_0x553502=_0x553502-0x0;var _0x246c37=_0xd4f6[_0x553502];return _0x246c37;};'use strict';var _=require(_0x6d4f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6d4f('0x1'));var moment=require(_0x6d4f('0x2'));var BPromise=require(_0x6d4f('0x3'));var rp=require(_0x6d4f('0x4'));var fs=require('fs');var path=require(_0x6d4f('0x5'));var rimraf=require(_0x6d4f('0x6'));var config=require(_0x6d4f('0x7'));var attributes=require(_0x6d4f('0x8'));module['exports']=function(_0x1b9fef,_0x46051b){return _0x1b9fef['define'](_0x6d4f('0x9'),attributes,{'tableName':'int_desk_configurations','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 a71c296..ec7df33 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 _0x028d=['result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x25d573,_0x2f606a){var _0x341a2a=function(_0x1398cd){while(--_0x1398cd){_0x25d573['push'](_0x25d573['shift']());}};_0x341a2a(++_0x2f606a);}(_0x028d,0xff));var _0xd028=function(_0x3be3ad,_0x17c9de){_0x3be3ad=_0x3be3ad-0x0;var _0x7b29c4=_0x028d[_0x3be3ad];return _0x7b29c4;};'use strict';var _=require('lodash');var util=require(_0xd028('0x0'));var moment=require(_0xd028('0x1'));var BPromise=require('bluebird');var rs=require(_0xd028('0x2'));var fs=require('fs');var Redis=require(_0xd028('0x3'));var db=require(_0xd028('0x4'))['db'];var utils=require(_0xd028('0x5'));var logger=require(_0xd028('0x6'))(_0xd028('0x7'));var config=require('../../config/environment');var jayson=require(_0xd028('0x8'));var client=jayson[_0xd028('0x9')][_0xd028('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35b879,_0x110b50,_0xb35f34){return new BPromise(function(_0xab6e68,_0x487e07){return client[_0xd028('0xb')](_0x35b879,_0xb35f34)[_0xd028('0xc')](function(_0xb9d983){logger[_0xd028('0xd')](_0xd028('0xe'),_0x110b50,_0xd028('0xf'));logger['debug'](_0xd028('0x10'),_0x110b50,_0xd028('0xf'),JSON[_0xd028('0x11')](_0xb9d983));if(_0xb9d983[_0xd028('0x12')]){if(_0xb9d983[_0xd028('0x12')][_0xd028('0x13')]===0x1f4){logger['error'](_0xd028('0xe'),_0x110b50,_0xb9d983[_0xd028('0x12')]['message']);return _0x487e07(_0xb9d983[_0xd028('0x12')][_0xd028('0x14')]);}logger[_0xd028('0x12')](_0xd028('0xe'),_0x110b50,_0xb9d983[_0xd028('0x12')][_0xd028('0x14')]);return _0xab6e68(_0xb9d983[_0xd028('0x12')][_0xd028('0x14')]);}else{logger[_0xd028('0xd')](_0xd028('0xe'),_0x110b50,_0xd028('0xf'));_0xab6e68(_0xb9d983[_0xd028('0x15')]['message']);}})[_0xd028('0x16')](function(_0x5a6670){logger[_0xd028('0x12')](_0xd028('0xe'),_0x110b50,_0x5a6670);_0x487e07(_0x5a6670);});});} \ No newline at end of file +var _0xc5ba=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x10224e,_0x46a037){var _0x57e372=function(_0x5b19bd){while(--_0x5b19bd){_0x10224e['push'](_0x10224e['shift']());}};_0x57e372(++_0x46a037);}(_0xc5ba,0xb9));var _0xac5b=function(_0x35e75a,_0x5ed225){_0x35e75a=_0x35e75a-0x0;var _0xb23c7f=_0xc5ba[_0x35e75a];return _0xb23c7f;};'use strict';var _=require(_0xac5b('0x0'));var util=require(_0xac5b('0x1'));var moment=require(_0xac5b('0x2'));var BPromise=require(_0xac5b('0x3'));var rs=require(_0xac5b('0x4'));var fs=require('fs');var Redis=require(_0xac5b('0x5'));var db=require(_0xac5b('0x6'))['db'];var utils=require(_0xac5b('0x7'));var logger=require(_0xac5b('0x8'))(_0xac5b('0x9'));var config=require(_0xac5b('0xa'));var jayson=require(_0xac5b('0xb'));var client=jayson[_0xac5b('0xc')][_0xac5b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x38602a,_0xc09fbc,_0xc193a7){return new BPromise(function(_0x4a7fc7,_0x525e20){return client[_0xac5b('0xe')](_0x38602a,_0xc193a7)['then'](function(_0x3c5bd3){logger[_0xac5b('0xf')](_0xac5b('0x10'),_0xc09fbc,_0xac5b('0x11'));logger[_0xac5b('0x12')](_0xac5b('0x13'),_0xc09fbc,_0xac5b('0x11'),JSON[_0xac5b('0x14')](_0x3c5bd3));if(_0x3c5bd3[_0xac5b('0x15')]){if(_0x3c5bd3['error'][_0xac5b('0x16')]===0x1f4){logger[_0xac5b('0x15')](_0xac5b('0x10'),_0xc09fbc,_0x3c5bd3[_0xac5b('0x15')][_0xac5b('0x17')]);return _0x525e20(_0x3c5bd3[_0xac5b('0x15')][_0xac5b('0x17')]);}logger[_0xac5b('0x15')](_0xac5b('0x10'),_0xc09fbc,_0x3c5bd3[_0xac5b('0x15')][_0xac5b('0x17')]);return _0x4a7fc7(_0x3c5bd3[_0xac5b('0x15')]['message']);}else{logger[_0xac5b('0xf')](_0xac5b('0x10'),_0xc09fbc,_0xac5b('0x11'));_0x4a7fc7(_0x3c5bd3[_0xac5b('0x18')][_0xac5b('0x17')]);}})[_0xac5b('0x19')](function(_0x363de5){logger[_0xac5b('0x15')](_0xac5b('0x10'),_0xc09fbc,_0x363de5);_0x525e20(_0x363de5);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 5f47882..9c21d6f 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 _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x7a54,0x106));var _0x47a5=function(_0x67060,_0x5c1b4a){_0x67060=_0x67060-0x0;var _0x5d9503=_0x7a54[_0x67060];return _0x5d9503;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x393f4f,_0x2f1baa){_0x393f4f=_0x393f4f-0x0;var _0x4c4df6=_0x7a54[_0x393f4f];return _0x4c4df6;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 6042f8b..58042d5 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 _0xb23d=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x4b05e3,_0x54ca9c){var _0x411224=function(_0x5b2644){while(--_0x5b2644){_0x4b05e3['push'](_0x4b05e3['shift']());}};_0x411224(++_0x54ca9c);}(_0xb23d,0x6a));var _0xdb23=function(_0x198446,_0x119c8f){_0x198446=_0x198446-0x0;var _0x38d7b7=_0xb23d[_0x198446];return _0x38d7b7;};'use strict';var Sequelize=require(_0xdb23('0x0'));module[_0xdb23('0x1')]={'type':{'type':Sequelize[_0xdb23('0x2')](_0xdb23('0x3'),_0xdb23('0x4'),_0xdb23('0x5'),'keyValue',_0xdb23('0x6')),'defaultValue':_0xdb23('0x3')},'content':{'type':Sequelize[_0xdb23('0x7')]},'key':{'type':Sequelize[_0xdb23('0x7')]},'keyType':{'type':Sequelize[_0xdb23('0x2')](_0xdb23('0x3'),_0xdb23('0x4'),_0xdb23('0x5'))},'keyContent':{'type':Sequelize[_0xdb23('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdb23('0x7')]}}; \ No newline at end of file +var _0x0ecd=['STRING','variable','BOOLEAN','sequelize','ENUM','string','customVariable','keyValue','picklist'];(function(_0x1e944e,_0x5303ed){var _0x80fb9c=function(_0x3dd512){while(--_0x3dd512){_0x1e944e['push'](_0x1e944e['shift']());}};_0x80fb9c(++_0x5303ed);}(_0x0ecd,0xa5));var _0xd0ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ecd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd0ec('0x0'));module['exports']={'type':{'type':Sequelize[_0xd0ec('0x1')](_0xd0ec('0x2'),'variable',_0xd0ec('0x3'),_0xd0ec('0x4'),_0xd0ec('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd0ec('0x6')]},'key':{'type':Sequelize[_0xd0ec('0x6')]},'keyType':{'type':Sequelize[_0xd0ec('0x1')](_0xd0ec('0x2'),_0xd0ec('0x7'),_0xd0ec('0x3'))},'keyContent':{'type':Sequelize[_0xd0ec('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd0ec('0x6')]},'customField':{'type':Sequelize[_0xd0ec('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd0ec('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 5ad5542..5d97512 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 _0x282b=['type','key','query','keys','intersection','attributes','model','fields','hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','options','DeskField','includeAll','include','findAll','rows','catch','show','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','error','name','send','map','rawAttributes','fieldName'];(function(_0x225843,_0x1ea62f){var _0x2684a8=function(_0x43c540){while(--_0x43c540){_0x225843['push'](_0x225843['shift']());}};_0x2684a8(++_0x1ea62f);}(_0x282b,0xec));var _0xb282=function(_0x699bff,_0x70a37d){_0x699bff=_0x699bff-0x0;var _0x36caf6=_0x282b[_0x699bff];return _0x36caf6;};'use strict';var emlformat=require(_0xb282('0x0'));var rimraf=require(_0xb282('0x1'));var zipdir=require(_0xb282('0x2'));var jsonpatch=require(_0xb282('0x3'));var rp=require(_0xb282('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb282('0x5'));var util=require('util');var path=require(_0xb282('0x6'));var sox=require(_0xb282('0x7'));var csv=require(_0xb282('0x8'));var ejs=require(_0xb282('0x9'));var fs=require('fs');var fs_extra=require(_0xb282('0xa'));var _=require(_0xb282('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb282('0xc'));var deskjs=require(_0xb282('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb282('0xe'));var Papa=require(_0xb282('0xf'));var Redis=require(_0xb282('0x10'));var authService=require(_0xb282('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb282('0x12'));var logger=require(_0xb282('0x13'))(_0xb282('0x14'));var utils=require(_0xb282('0x15'));var config=require(_0xb282('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x338bdb,_0xc08746){_0xc08746=_0xc08746||0xcc;return function(_0x40d7b8){if(_0x40d7b8){return _0x338bdb[_0xb282('0x17')](_0xc08746);}return _0x338bdb[_0xb282('0x18')](_0xc08746)['end']();};}function respondWithResult(_0x34c595,_0x5adf7f){_0x5adf7f=_0x5adf7f||0xc8;return function(_0xe1d53){if(_0xe1d53){return _0x34c595[_0xb282('0x18')](_0x5adf7f)['json'](_0xe1d53);}};}function respondWithFilteredResult(_0x525cfa,_0x5bc7c3){return function(_0x13cea1){if(_0x13cea1){var _0x350676=typeof _0x5bc7c3[_0xb282('0x19')]===_0xb282('0x1a')&&typeof _0x5bc7c3[_0xb282('0x1b')]==='undefined';var _0x191a31=_0x13cea1[_0xb282('0x1c')];var _0xca5f12=_0x350676?0x0:_0x5bc7c3[_0xb282('0x19')];var _0x3f8a3f=_0x350676?_0x13cea1['count']:_0x5bc7c3['offset']+_0x5bc7c3[_0xb282('0x1b')];var _0x2cdeb1;if(_0x3f8a3f>=_0x191a31){_0x3f8a3f=_0x191a31;_0x2cdeb1=0xc8;}else{_0x2cdeb1=0xce;}_0x525cfa['status'](_0x2cdeb1);return _0x525cfa[_0xb282('0x1d')](_0xb282('0x1e'),_0xca5f12+'-'+_0x3f8a3f+'/'+_0x191a31)[_0xb282('0x1f')](_0x13cea1);}return null;};}function patchUpdates(_0x438dbe){return function(_0x1c3084){try{jsonpatch['apply'](_0x1c3084,_0x438dbe,!![]);}catch(_0x1de407){return BPromise[_0xb282('0x20')](_0x1de407);}return _0x1c3084[_0xb282('0x21')]();};}function saveUpdates(_0x4b79d7,_0x437d66){return function(_0x2a7ef8){if(_0x2a7ef8){return _0x2a7ef8[_0xb282('0x22')](_0x4b79d7)[_0xb282('0x23')](function(_0x680095){return _0x680095;});}return null;};}function removeEntity(_0x56645f,_0x4d624f){return function(_0x360f15){if(_0x360f15){return _0x360f15[_0xb282('0x24')]()['then'](function(){_0x56645f['status'](0xcc)[_0xb282('0x25')]();});}};}function handleEntityNotFound(_0x114f77,_0x3451e5){return function(_0x3c4018){if(!_0x3c4018){_0x114f77[_0xb282('0x17')](0x194);}return _0x3c4018;};}function handleError(_0x2b1303,_0x5b1d3d){_0x5b1d3d=_0x5b1d3d||0x1f4;return function(_0xa0d7fb){logger[_0xb282('0x26')](_0xa0d7fb['stack']);if(_0xa0d7fb[_0xb282('0x27')]){delete _0xa0d7fb[_0xb282('0x27')];}_0x2b1303[_0xb282('0x18')](_0x5b1d3d)[_0xb282('0x28')](_0xa0d7fb);};}exports['index']=function(_0x1520b1,_0x1fb89f){var _0xe337b8={},_0x433ad5={},_0x4cee93={'count':0x0,'rows':[]};var _0xfddd2e=_[_0xb282('0x29')](db['DeskField'][_0xb282('0x2a')],function(_0x1e2861){return{'name':_0x1e2861[_0xb282('0x2b')],'type':_0x1e2861[_0xb282('0x2c')][_0xb282('0x2d')]};});_0x433ad5['model']=_[_0xb282('0x29')](_0xfddd2e,'name');_0x433ad5[_0xb282('0x2e')]=_[_0xb282('0x2f')](_0x1520b1[_0xb282('0x2e')]);_0x433ad5['filters']=_[_0xb282('0x30')](_0x433ad5['model'],_0x433ad5[_0xb282('0x2e')]);_0xe337b8[_0xb282('0x31')]=_[_0xb282('0x30')](_0x433ad5[_0xb282('0x32')],qs[_0xb282('0x33')](_0x1520b1[_0xb282('0x2e')]['fields']));_0xe337b8[_0xb282('0x31')]=_0xe337b8[_0xb282('0x31')]['length']?_0xe337b8['attributes']:_0x433ad5[_0xb282('0x32')];if(!_0x1520b1[_0xb282('0x2e')][_0xb282('0x34')]('nolimit')){_0xe337b8['limit']=qs['limit'](_0x1520b1[_0xb282('0x2e')][_0xb282('0x1b')]);_0xe337b8[_0xb282('0x19')]=qs[_0xb282('0x19')](_0x1520b1[_0xb282('0x2e')][_0xb282('0x19')]);}_0xe337b8[_0xb282('0x35')]=qs['sort'](_0x1520b1[_0xb282('0x2e')]['sort']);_0xe337b8[_0xb282('0x36')]=qs[_0xb282('0x37')](_[_0xb282('0x38')](_0x1520b1['query'],_0x433ad5[_0xb282('0x37')]),_0xfddd2e);if(_0x1520b1['query'][_0xb282('0x39')]){_0xe337b8[_0xb282('0x36')]=_[_0xb282('0x3a')](_0xe337b8[_0xb282('0x36')],{'$or':_['map'](_0xfddd2e,function(_0x5c86bb){if(_0x5c86bb[_0xb282('0x2c')]!==_0xb282('0x3b')){var _0x3791fd={};_0x3791fd[_0x5c86bb[_0xb282('0x27')]]={'$like':'%'+_0x1520b1['query'][_0xb282('0x39')]+'%'};return _0x3791fd;}})});}_0xe337b8=_['merge']({},_0xe337b8,_0x1520b1[_0xb282('0x3c')]);var _0x1a1b50={'where':_0xe337b8['where']};return db[_0xb282('0x3d')][_0xb282('0x1c')](_0x1a1b50)[_0xb282('0x23')](function(_0x2c988a){_0x4cee93[_0xb282('0x1c')]=_0x2c988a;if(_0x1520b1[_0xb282('0x2e')][_0xb282('0x3e')]){_0xe337b8[_0xb282('0x3f')]=[{'all':!![]}];}return db[_0xb282('0x3d')][_0xb282('0x40')](_0xe337b8);})[_0xb282('0x23')](function(_0x91fe43){_0x4cee93[_0xb282('0x41')]=_0x91fe43;return _0x4cee93;})[_0xb282('0x23')](respondWithFilteredResult(_0x1fb89f,_0xe337b8))[_0xb282('0x42')](handleError(_0x1fb89f,null));};exports[_0xb282('0x43')]=function(_0x2416a4,_0x7332d2){var _0x573da7={'raw':!![],'where':{'id':_0x2416a4['params']['id']}},_0x310ad1={};_0x310ad1[_0xb282('0x32')]=_[_0xb282('0x2f')](db[_0xb282('0x3d')][_0xb282('0x2a')]);_0x310ad1[_0xb282('0x2e')]=_[_0xb282('0x2f')](_0x2416a4['query']);_0x310ad1['filters']=_[_0xb282('0x30')](_0x310ad1['model'],_0x310ad1[_0xb282('0x2e')]);_0x573da7[_0xb282('0x31')]=_['intersection'](_0x310ad1[_0xb282('0x32')],qs[_0xb282('0x33')](_0x2416a4[_0xb282('0x2e')]['fields']));_0x573da7['attributes']=_0x573da7[_0xb282('0x31')]['length']?_0x573da7[_0xb282('0x31')]:_0x310ad1[_0xb282('0x32')];if(_0x2416a4[_0xb282('0x2e')][_0xb282('0x3e')]){_0x573da7[_0xb282('0x3f')]=[{'all':!![]}];}_0x573da7=_[_0xb282('0x3a')]({},_0x573da7,_0x2416a4['options']);return db[_0xb282('0x3d')][_0xb282('0x44')](_0x573da7)[_0xb282('0x23')](handleEntityNotFound(_0x7332d2,null))['then'](respondWithResult(_0x7332d2,null))[_0xb282('0x42')](handleError(_0x7332d2,null));};exports['create']=function(_0x32fc1d,_0x4b0822){return db[_0xb282('0x3d')]['create'](_0x32fc1d['body'],{})['then'](respondWithResult(_0x4b0822,0xc9))[_0xb282('0x42')](handleError(_0x4b0822,null));};exports[_0xb282('0x22')]=function(_0x42d99f,_0x7a5aa4){if(_0x42d99f['body']['id']){delete _0x42d99f['body']['id'];}return db['DeskField'][_0xb282('0x44')]({'where':{'id':_0x42d99f[_0xb282('0x45')]['id']}})[_0xb282('0x23')](handleEntityNotFound(_0x7a5aa4,null))[_0xb282('0x23')](saveUpdates(_0x42d99f['body'],null))[_0xb282('0x23')](respondWithResult(_0x7a5aa4,null))[_0xb282('0x42')](handleError(_0x7a5aa4,null));};exports['destroy']=function(_0x33bded,_0x9f4d79){return db[_0xb282('0x3d')][_0xb282('0x44')]({'where':{'id':_0x33bded[_0xb282('0x45')]['id']}})['then'](handleEntityNotFound(_0x9f4d79,null))[_0xb282('0x23')](removeEntity(_0x9f4d79,null))[_0xb282('0x42')](handleError(_0x9f4d79,null));}; \ No newline at end of file +var _0x5ec6=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','DeskField','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service'];(function(_0x5e19ce,_0xf69afe){var _0x4b8eb8=function(_0x151c8c){while(--_0x151c8c){_0x5e19ce['push'](_0x5e19ce['shift']());}};_0x4b8eb8(++_0xf69afe);}(_0x5ec6,0x7f));var _0x65ec=function(_0x5150d1,_0x407f6f){_0x5150d1=_0x5150d1-0x0;var _0x5bdf68=_0x5ec6[_0x5150d1];return _0x5bdf68;};'use strict';var emlformat=require(_0x65ec('0x0'));var rimraf=require(_0x65ec('0x1'));var zipdir=require(_0x65ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65ec('0x3'));var moment=require('moment');var BPromise=require(_0x65ec('0x4'));var Mustache=require('mustache');var util=require(_0x65ec('0x5'));var path=require('path');var sox=require(_0x65ec('0x6'));var csv=require('to-csv');var ejs=require(_0x65ec('0x7'));var fs=require('fs');var fs_extra=require(_0x65ec('0x8'));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('0xc'));var querystring=require(_0x65ec('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xf'));var hardwareService=require(_0x65ec('0x10'));var logger=require('../../config/logger')(_0x65ec('0x11'));var utils=require(_0x65ec('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x65ec('0x13'));var db=require(_0x65ec('0x14'))['db'];function respondWithStatusCode(_0x53d62b,_0x3e52c8){_0x3e52c8=_0x3e52c8||0xcc;return function(_0x2af7d6){if(_0x2af7d6){return _0x53d62b[_0x65ec('0x15')](_0x3e52c8);}return _0x53d62b[_0x65ec('0x16')](_0x3e52c8)[_0x65ec('0x17')]();};}function respondWithResult(_0x434e20,_0x344724){_0x344724=_0x344724||0xc8;return function(_0x3edbfd){if(_0x3edbfd){return _0x434e20['status'](_0x344724)[_0x65ec('0x18')](_0x3edbfd);}};}function respondWithFilteredResult(_0x3ed6f7,_0x35d06b){return function(_0x4bbe88){if(_0x4bbe88){var _0x5a0442=typeof _0x35d06b[_0x65ec('0x19')]===_0x65ec('0x1a')&&typeof _0x35d06b[_0x65ec('0x1b')]==='undefined';var _0x25dae7=_0x4bbe88[_0x65ec('0x1c')];var _0x1254f8=_0x5a0442?0x0:_0x35d06b[_0x65ec('0x19')];var _0x29ebc4=_0x5a0442?_0x4bbe88[_0x65ec('0x1c')]:_0x35d06b[_0x65ec('0x19')]+_0x35d06b[_0x65ec('0x1b')];var _0x2127e2;if(_0x29ebc4>=_0x25dae7){_0x29ebc4=_0x25dae7;_0x2127e2=0xc8;}else{_0x2127e2=0xce;}_0x3ed6f7[_0x65ec('0x16')](_0x2127e2);return _0x3ed6f7[_0x65ec('0x1d')](_0x65ec('0x1e'),_0x1254f8+'-'+_0x29ebc4+'/'+_0x25dae7)[_0x65ec('0x18')](_0x4bbe88);}return null;};}function patchUpdates(_0x1467ac){return function(_0x3804a4){try{jsonpatch[_0x65ec('0x1f')](_0x3804a4,_0x1467ac,!![]);}catch(_0x15d4eb){return BPromise[_0x65ec('0x20')](_0x15d4eb);}return _0x3804a4[_0x65ec('0x21')]();};}function saveUpdates(_0x4ff93c,_0x170703){return function(_0x297fba){if(_0x297fba){return _0x297fba[_0x65ec('0x22')](_0x4ff93c)[_0x65ec('0x23')](function(_0x1d60fb){return _0x1d60fb;});}return null;};}function removeEntity(_0x163e55,_0x47288d){return function(_0x58239f){if(_0x58239f){return _0x58239f[_0x65ec('0x24')]()[_0x65ec('0x23')](function(){_0x163e55[_0x65ec('0x16')](0xcc)[_0x65ec('0x17')]();});}};}function handleEntityNotFound(_0x288e66,_0x156793){return function(_0x21426b){if(!_0x21426b){_0x288e66[_0x65ec('0x15')](0x194);}return _0x21426b;};}function handleError(_0x297e09,_0x4c846b){_0x4c846b=_0x4c846b||0x1f4;return function(_0x10baef){logger[_0x65ec('0x25')](_0x10baef[_0x65ec('0x26')]);if(_0x10baef[_0x65ec('0x27')]){delete _0x10baef['name'];}_0x297e09[_0x65ec('0x16')](_0x4c846b)['send'](_0x10baef);};}exports[_0x65ec('0x28')]=function(_0x1ada47,_0x1d0b5c){var _0x30366c={},_0x14431d={},_0x46d4c1={'count':0x0,'rows':[]};var _0x46bf66=_[_0x65ec('0x29')](db[_0x65ec('0x2a')][_0x65ec('0x2b')],function(_0x3c97e2){return{'name':_0x3c97e2['fieldName'],'type':_0x3c97e2['type'][_0x65ec('0x2c')]};});_0x14431d['model']=_[_0x65ec('0x29')](_0x46bf66,_0x65ec('0x27'));_0x14431d['query']=_[_0x65ec('0x2d')](_0x1ada47[_0x65ec('0x2e')]);_0x14431d[_0x65ec('0x2f')]=_[_0x65ec('0x30')](_0x14431d['model'],_0x14431d[_0x65ec('0x2e')]);_0x30366c[_0x65ec('0x31')]=_[_0x65ec('0x30')](_0x14431d[_0x65ec('0x32')],qs[_0x65ec('0x33')](_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x30366c[_0x65ec('0x31')]=_0x30366c[_0x65ec('0x31')][_0x65ec('0x34')]?_0x30366c['attributes']:_0x14431d[_0x65ec('0x32')];if(!_0x1ada47[_0x65ec('0x2e')]['hasOwnProperty'](_0x65ec('0x35'))){_0x30366c[_0x65ec('0x1b')]=qs[_0x65ec('0x1b')](_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x1b')]);_0x30366c[_0x65ec('0x19')]=qs[_0x65ec('0x19')](_0x1ada47['query'][_0x65ec('0x19')]);}_0x30366c[_0x65ec('0x36')]=qs[_0x65ec('0x37')](_0x1ada47[_0x65ec('0x2e')]['sort']);_0x30366c[_0x65ec('0x38')]=qs[_0x65ec('0x2f')](_[_0x65ec('0x39')](_0x1ada47[_0x65ec('0x2e')],_0x14431d['filters']),_0x46bf66);if(_0x1ada47['query'][_0x65ec('0x3a')]){_0x30366c['where']=_[_0x65ec('0x3b')](_0x30366c[_0x65ec('0x38')],{'$or':_['map'](_0x46bf66,function(_0x16ef59){if(_0x16ef59[_0x65ec('0x3c')]!==_0x65ec('0x3d')){var _0x5357bf={};_0x5357bf[_0x16ef59[_0x65ec('0x27')]]={'$like':'%'+_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x3a')]+'%'};return _0x5357bf;}})});}_0x30366c=_[_0x65ec('0x3b')]({},_0x30366c,_0x1ada47[_0x65ec('0x3e')]);var _0x2ce56f={'where':_0x30366c[_0x65ec('0x38')]};return db['DeskField'][_0x65ec('0x1c')](_0x2ce56f)['then'](function(_0x2654b2){_0x46d4c1[_0x65ec('0x1c')]=_0x2654b2;if(_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x3f')]){_0x30366c[_0x65ec('0x40')]=[{'all':!![]}];}return db[_0x65ec('0x2a')]['findAll'](_0x30366c);})[_0x65ec('0x23')](function(_0x4ba7df){_0x46d4c1['rows']=_0x4ba7df;return _0x46d4c1;})[_0x65ec('0x23')](respondWithFilteredResult(_0x1d0b5c,_0x30366c))[_0x65ec('0x41')](handleError(_0x1d0b5c,null));};exports[_0x65ec('0x42')]=function(_0x143a11,_0x1d475e){var _0x524235={'raw':!![],'where':{'id':_0x143a11[_0x65ec('0x43')]['id']}},_0x4843ca={};_0x4843ca[_0x65ec('0x32')]=_[_0x65ec('0x2d')](db[_0x65ec('0x2a')][_0x65ec('0x2b')]);_0x4843ca['query']=_['keys'](_0x143a11[_0x65ec('0x2e')]);_0x4843ca[_0x65ec('0x2f')]=_[_0x65ec('0x30')](_0x4843ca[_0x65ec('0x32')],_0x4843ca[_0x65ec('0x2e')]);_0x524235[_0x65ec('0x31')]=_[_0x65ec('0x30')](_0x4843ca['model'],qs[_0x65ec('0x33')](_0x143a11[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x524235['attributes']=_0x524235[_0x65ec('0x31')][_0x65ec('0x34')]?_0x524235['attributes']:_0x4843ca[_0x65ec('0x32')];if(_0x143a11[_0x65ec('0x2e')][_0x65ec('0x3f')]){_0x524235[_0x65ec('0x40')]=[{'all':!![]}];}_0x524235=_[_0x65ec('0x3b')]({},_0x524235,_0x143a11['options']);return db[_0x65ec('0x2a')][_0x65ec('0x44')](_0x524235)[_0x65ec('0x23')](handleEntityNotFound(_0x1d475e,null))[_0x65ec('0x23')](respondWithResult(_0x1d475e,null))['catch'](handleError(_0x1d475e,null));};exports[_0x65ec('0x45')]=function(_0x509c28,_0x1ed0f9){return db[_0x65ec('0x2a')][_0x65ec('0x45')](_0x509c28['body'],{})['then'](respondWithResult(_0x1ed0f9,0xc9))[_0x65ec('0x41')](handleError(_0x1ed0f9,null));};exports[_0x65ec('0x22')]=function(_0xf5419,_0x2111af){if(_0xf5419[_0x65ec('0x46')]['id']){delete _0xf5419[_0x65ec('0x46')]['id'];}return db[_0x65ec('0x2a')][_0x65ec('0x44')]({'where':{'id':_0xf5419[_0x65ec('0x43')]['id']}})[_0x65ec('0x23')](handleEntityNotFound(_0x2111af,null))[_0x65ec('0x23')](saveUpdates(_0xf5419[_0x65ec('0x46')],null))[_0x65ec('0x23')](respondWithResult(_0x2111af,null))[_0x65ec('0x41')](handleError(_0x2111af,null));};exports[_0x65ec('0x24')]=function(_0x14eaef,_0x22c28c){return db['DeskField'][_0x65ec('0x44')]({'where':{'id':_0x14eaef[_0x65ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x22c28c,null))[_0x65ec('0x23')](removeEntity(_0x22c28c,null))[_0x65ec('0x41')](handleError(_0x22c28c,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 9287bb9..904ab4f 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 _0xef88=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','desk_unique_index','idField','FieldId','lodash'];(function(_0x48e2dd,_0x4e0336){var _0x37460b=function(_0x5580c6){while(--_0x5580c6){_0x48e2dd['push'](_0x48e2dd['shift']());}};_0x37460b(++_0x4e0336);}(_0xef88,0x1a8));var _0x8ef8=function(_0x193266,_0x37c379){_0x193266=_0x193266-0x0;var _0x2a9bde=_0xef88[_0x193266];return _0x2a9bde;};'use strict';var _=require(_0x8ef8('0x0'));var util=require(_0x8ef8('0x1'));var logger=require(_0x8ef8('0x2'))(_0x8ef8('0x3'));var moment=require(_0x8ef8('0x4'));var BPromise=require(_0x8ef8('0x5'));var rp=require(_0x8ef8('0x6'));var fs=require('fs');var path=require(_0x8ef8('0x7'));var rimraf=require(_0x8ef8('0x8'));var config=require(_0x8ef8('0x9'));var attributes=require(_0x8ef8('0xa'));module[_0x8ef8('0xb')]=function(_0x9089e6,_0x402b41){return _0x9089e6[_0x8ef8('0xc')](_0x8ef8('0xd'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x8ef8('0xe'),'fields':[_0x8ef8('0xf'),_0x8ef8('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe277=['idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields'];(function(_0xae8fa0,_0xfc4874){var _0x4de436=function(_0x815c4){while(--_0x815c4){_0xae8fa0['push'](_0xae8fa0['shift']());}};_0x4de436(++_0xfc4874);}(_0xe277,0x14c));var _0x7e27=function(_0x402dd7,_0x32164c){_0x402dd7=_0x402dd7-0x0;var _0x5d14ba=_0xe277[_0x402dd7];return _0x5d14ba;};'use strict';var _=require(_0x7e27('0x0'));var util=require(_0x7e27('0x1'));var logger=require(_0x7e27('0x2'))(_0x7e27('0x3'));var moment=require('moment');var BPromise=require(_0x7e27('0x4'));var rp=require(_0x7e27('0x5'));var fs=require('fs');var path=require(_0x7e27('0x6'));var rimraf=require(_0x7e27('0x7'));var config=require(_0x7e27('0x8'));var attributes=require(_0x7e27('0x9'));module[_0x7e27('0xa')]=function(_0x289363,_0x34bd93){return _0x289363[_0x7e27('0xb')]('DeskField',attributes,{'tableName':_0x7e27('0xc'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x7e27('0xd'),_0x7e27('0xe')],'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 e97b5ab..a4d86d8 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 _0xeba8=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x10a4df,_0x526a9f){var _0x4612c9=function(_0x2b92ee){while(--_0x2b92ee){_0x10a4df['push'](_0x10a4df['shift']());}};_0x4612c9(++_0x526a9f);}(_0xeba8,0xe6));var _0x8eba=function(_0x5f25b3,_0x35481a){_0x5f25b3=_0x5f25b3-0x0;var _0x4ab9bf=_0xeba8[_0x5f25b3];return _0x4ab9bf;};'use strict';var _=require(_0x8eba('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8eba('0x1'));var fs=require('fs');var Redis=require(_0x8eba('0x2'));var db=require(_0x8eba('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8eba('0x4'))(_0x8eba('0x5'));var config=require(_0x8eba('0x6'));var jayson=require(_0x8eba('0x7'));var client=jayson[_0x8eba('0x8')][_0x8eba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22d246,_0x5eb0ff,_0x1beb63){return new BPromise(function(_0x302c08,_0x2c03b4){return client[_0x8eba('0xa')](_0x22d246,_0x1beb63)[_0x8eba('0xb')](function(_0x1902d8){logger[_0x8eba('0xc')](_0x8eba('0xd'),_0x5eb0ff,_0x8eba('0xe'));logger[_0x8eba('0xf')](_0x8eba('0x10'),_0x5eb0ff,_0x8eba('0xe'),JSON[_0x8eba('0x11')](_0x1902d8));if(_0x1902d8[_0x8eba('0x12')]){if(_0x1902d8[_0x8eba('0x12')]['code']===0x1f4){logger[_0x8eba('0x12')](_0x8eba('0xd'),_0x5eb0ff,_0x1902d8[_0x8eba('0x12')][_0x8eba('0x13')]);return _0x2c03b4(_0x1902d8[_0x8eba('0x12')][_0x8eba('0x13')]);}logger[_0x8eba('0x12')](_0x8eba('0xd'),_0x5eb0ff,_0x1902d8[_0x8eba('0x12')][_0x8eba('0x13')]);return _0x302c08(_0x1902d8[_0x8eba('0x12')][_0x8eba('0x13')]);}else{logger['info'](_0x8eba('0xd'),_0x5eb0ff,_0x8eba('0xe'));_0x302c08(_0x1902d8[_0x8eba('0x14')][_0x8eba('0x13')]);}})['catch'](function(_0x2453bf){logger[_0x8eba('0x12')](_0x8eba('0xd'),_0x5eb0ff,_0x2453bf);_0x2c03b4(_0x2453bf);});});} \ No newline at end of file +var _0x3a9c=['../../config/logger','../../config/environment','client','http','request','then','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x11e9f9,_0x3cd4e2){var _0x14d5c1=function(_0x3e3551){while(--_0x3e3551){_0x11e9f9['push'](_0x11e9f9['shift']());}};_0x14d5c1(++_0x3cd4e2);}(_0x3a9c,0x19e));var _0xc3a9=function(_0x3eeafe,_0x2e0480){_0x3eeafe=_0x3eeafe-0x0;var _0x4f32ab=_0x3a9c[_0x3eeafe];return _0x4f32ab;};'use strict';var _=require(_0xc3a9('0x0'));var util=require('util');var moment=require(_0xc3a9('0x1'));var BPromise=require(_0xc3a9('0x2'));var rs=require(_0xc3a9('0x3'));var fs=require('fs');var Redis=require(_0xc3a9('0x4'));var db=require(_0xc3a9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3a9('0x6'))('rpc');var config=require(_0xc3a9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc3a9('0x8')][_0xc3a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43bd8e,_0x2233b9,_0xc0c167){return new BPromise(function(_0x1f6d13,_0x468574){return client[_0xc3a9('0xa')](_0x43bd8e,_0xc0c167)[_0xc3a9('0xb')](function(_0x228595){logger['info'](_0xc3a9('0xc'),_0x2233b9,'request\x20sent');logger[_0xc3a9('0xd')](_0xc3a9('0xe'),_0x2233b9,'request\x20sent',JSON['stringify'](_0x228595));if(_0x228595['error']){if(_0x228595[_0xc3a9('0xf')][_0xc3a9('0x10')]===0x1f4){logger[_0xc3a9('0xf')](_0xc3a9('0xc'),_0x2233b9,_0x228595[_0xc3a9('0xf')][_0xc3a9('0x11')]);return _0x468574(_0x228595[_0xc3a9('0xf')][_0xc3a9('0x11')]);}logger['error'](_0xc3a9('0xc'),_0x2233b9,_0x228595[_0xc3a9('0xf')][_0xc3a9('0x11')]);return _0x1f6d13(_0x228595[_0xc3a9('0xf')][_0xc3a9('0x11')]);}else{logger['info'](_0xc3a9('0xc'),_0x2233b9,_0xc3a9('0x12'));_0x1f6d13(_0x228595['result'][_0xc3a9('0x11')]);}})[_0xc3a9('0x13')](function(_0x5e7101){logger['error']('DeskField,\x20%s,\x20%s',_0x2233b9,_0x5e7101);_0x468574(_0x5e7101);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 1faee5a..4a5a26a 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 _0x40b0=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','isAuthenticated','index','get','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy'];(function(_0x346165,_0x243d24){var _0x2cdc36=function(_0x4f9b29){while(--_0x4f9b29){_0x346165['push'](_0x346165['shift']());}};_0x2cdc36(++_0x243d24);}(_0x40b0,0xa9));var _0x040b=function(_0x289a67,_0x1e5a3c){_0x289a67=_0x289a67-0x0;var _0x572b49=_0x40b0[_0x289a67];return _0x572b49;};'use strict';var multer=require(_0x040b('0x0'));var util=require(_0x040b('0x1'));var path=require(_0x040b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x040b('0x3')]();var fs_extra=require(_0x040b('0x4'));var auth=require(_0x040b('0x5'));var interaction=require(_0x040b('0x6'));var config=require('../../config/environment');var controller=require(_0x040b('0x7'));router['get']('/',auth[_0x040b('0x8')](),controller[_0x040b('0x9')]);router[_0x040b('0xa')]('/:id',auth[_0x040b('0x8')](),controller[_0x040b('0xb')]);router[_0x040b('0xa')]('/:id/configurations',auth[_0x040b('0x8')](),controller[_0x040b('0xc')]);router['get'](_0x040b('0xd'),auth[_0x040b('0x8')](),controller['getFields']);router[_0x040b('0xe')]('/',auth['isAuthenticated'](),controller[_0x040b('0xf')]);router['post'](_0x040b('0x10'),auth['isAuthenticated'](),controller[_0x040b('0x11')]);router[_0x040b('0x12')](_0x040b('0x13'),auth[_0x040b('0x8')](),controller[_0x040b('0x14')]);router[_0x040b('0x15')](_0x040b('0x13'),auth['isAuthenticated'](),controller[_0x040b('0x16')]);module[_0x040b('0x17')]=router; \ No newline at end of file +var _0x3f08=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x503768,_0x79abd4){var _0x172d44=function(_0x2aedb7){while(--_0x2aedb7){_0x503768['push'](_0x503768['shift']());}};_0x172d44(++_0x79abd4);}(_0x3f08,0x19e));var _0x83f0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3f08[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x83f0('0x0'));var util=require('util');var path=require(_0x83f0('0x1'));var timeout=require(_0x83f0('0x2'));var express=require(_0x83f0('0x3'));var router=express[_0x83f0('0x4')]();var fs_extra=require(_0x83f0('0x5'));var auth=require(_0x83f0('0x6'));var interaction=require(_0x83f0('0x7'));var config=require('../../config/environment');var controller=require(_0x83f0('0x8'));router[_0x83f0('0x9')]('/',auth[_0x83f0('0xa')](),controller[_0x83f0('0xb')]);router[_0x83f0('0x9')](_0x83f0('0xc'),auth[_0x83f0('0xa')](),controller[_0x83f0('0xd')]);router[_0x83f0('0x9')](_0x83f0('0xe'),auth[_0x83f0('0xa')](),controller[_0x83f0('0xf')]);router[_0x83f0('0x9')](_0x83f0('0x10'),auth[_0x83f0('0xa')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x83f0('0x11')](_0x83f0('0xe'),auth[_0x83f0('0xa')](),controller['addConfiguration']);router[_0x83f0('0x12')](_0x83f0('0xc'),auth[_0x83f0('0xa')](),controller['update']);router[_0x83f0('0x13')]('/:id',auth[_0x83f0('0xa')](),controller[_0x83f0('0x14')]);module[_0x83f0('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 31af3ca..06f898e 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 _0x3f6c=['STRING','sequelize','exports'];(function(_0x4494bd,_0x5d4c66){var _0x49ede9=function(_0x360670){while(--_0x360670){_0x4494bd['push'](_0x4494bd['shift']());}};_0x49ede9(++_0x5d4c66);}(_0x3f6c,0x133));var _0xc3f6=function(_0x126e4b,_0x2e18ac){_0x126e4b=_0x126e4b-0x0;var _0x179cb3=_0x3f6c[_0x126e4b];return _0x179cb3;};'use strict';var Sequelize=require(_0xc3f6('0x0'));module[_0xc3f6('0x1')]={'name':{'type':Sequelize[_0xc3f6('0x2')]},'username':{'type':Sequelize[_0xc3f6('0x2')]},'password':{'type':Sequelize[_0xc3f6('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xc3f6('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc3f6('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xc3f6('0x2')]}}; \ No newline at end of file +var _0x9a7e=['STRING'];(function(_0x1b4878,_0x4bd5e8){var _0x1829dc=function(_0x58400d){while(--_0x58400d){_0x1b4878['push'](_0x1b4878['shift']());}};_0x1829dc(++_0x4bd5e8);}(_0x9a7e,0x182));var _0xe9a7=function(_0x51d9b5,_0x58d302){_0x51d9b5=_0x51d9b5-0x0;var _0x5159fc=_0x9a7e[_0x51d9b5];return _0x5159fc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe9a7('0x0')]},'username':{'type':Sequelize[_0xe9a7('0x0')]},'password':{'type':Sequelize[_0xe9a7('0x0')]},'remoteUri':{'type':Sequelize[_0xe9a7('0x0')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe9a7('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 5ea738f..d00652a 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 _0x9a64=['show','params','intersection','fields','includeAll','find','create','update','body','destroy','findOne','Dynamics365Configuration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','incident','Incident','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyname','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','importsequencenumber','influencescore','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','remoteUri','tenantId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','concat','stack','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','false','LogicalName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','name','send','map','Dynamics365Account','rawAttributes','fieldName','key','model','keys','query','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows'];(function(_0x2431fe,_0x140c07){var _0x3de86d=function(_0x3d0dd8){while(--_0x3d0dd8){_0x2431fe['push'](_0x2431fe['shift']());}};_0x3de86d(++_0x140c07);}(_0x9a64,0x8c));var _0x49a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a64[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x49a6('0x0'));var rimraf=require(_0x49a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x49a6('0x2'));var rp=require('request-promise');var moment=require(_0x49a6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x49a6('0x4'));var util=require(_0x49a6('0x5'));var path=require(_0x49a6('0x6'));var sox=require('sox');var csv=require(_0x49a6('0x7'));var ejs=require(_0x49a6('0x8'));var fs=require('fs');var fs_extra=require(_0x49a6('0x9'));var _=require(_0x49a6('0xa'));var squel=require('squel');var crypto=require(_0x49a6('0xb'));var jsforce=require(_0x49a6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x49a6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x49a6('0xe'));var qs=require(_0x49a6('0xf'));var as=require(_0x49a6('0x10'));var hardwareService=require(_0x49a6('0x11'));var logger=require(_0x49a6('0x12'))(_0x49a6('0x13'));var utils=require(_0x49a6('0x14'));var config=require(_0x49a6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x49a6('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x49a6('0x17'));var client=jayson[_0x49a6('0x18')][_0x49a6('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x56bd3c,_0x1bd130,_0x36fe01,_0x3d9b3c){return new BPromise(function(_0x138800,_0x3be880){var _0x35f62c=_0x3d9b3c||client;return _0x35f62c[_0x49a6('0x1a')](_0x56bd3c,_0x36fe01)[_0x49a6('0x1b')](function(_0x2ccfc9){logger[_0x49a6('0x1c')](_0x49a6('0x1d'),_0x1bd130,_0x49a6('0x1e'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1bd130,_0x49a6('0x1e'),JSON['stringify'](_0x2ccfc9));if(_0x2ccfc9[_0x49a6('0x1f')]){if(_0x2ccfc9['error'][_0x49a6('0x20')]===0x1f4){logger[_0x49a6('0x1f')](_0x49a6('0x1d'),_0x1bd130,_0x2ccfc9[_0x49a6('0x1f')][_0x49a6('0x21')]);return _0x3be880(_0x2ccfc9[_0x49a6('0x1f')]['message']);}logger[_0x49a6('0x1f')](_0x49a6('0x1d'),_0x1bd130,_0x2ccfc9[_0x49a6('0x1f')][_0x49a6('0x21')]);return _0x138800(_0x2ccfc9['error'][_0x49a6('0x21')]);}else{logger[_0x49a6('0x1c')]('Dynamics365Account,\x20%s,\x20%s',_0x1bd130,_0x49a6('0x1e'));_0x138800(_0x2ccfc9[_0x49a6('0x22')][_0x49a6('0x21')]);}})[_0x49a6('0x23')](function(_0x39808a){logger[_0x49a6('0x1f')](_0x49a6('0x1d'),_0x1bd130,_0x39808a);_0x3be880(_0x39808a);});});}function respondWithStatusCode(_0x535e76,_0x38c39b){_0x38c39b=_0x38c39b||0xcc;return function(_0x16b93f){if(_0x16b93f){return _0x535e76[_0x49a6('0x24')](_0x38c39b);}return _0x535e76[_0x49a6('0x25')](_0x38c39b)[_0x49a6('0x26')]();};}function respondWithResult(_0x415384,_0x51d2fe){_0x51d2fe=_0x51d2fe||0xc8;return function(_0x572b31){if(_0x572b31){return _0x415384[_0x49a6('0x25')](_0x51d2fe)[_0x49a6('0x27')](_0x572b31);}};}function respondWithFilteredResult(_0x372cbd,_0x213d48){return function(_0x3cbae1){if(_0x3cbae1){var _0x107a28=typeof _0x213d48[_0x49a6('0x28')]===_0x49a6('0x29')&&typeof _0x213d48['limit']==='undefined';var _0x3768bc=_0x3cbae1[_0x49a6('0x2a')];var _0x8e7a65=_0x107a28?0x0:_0x213d48[_0x49a6('0x28')];var _0x4ff3b8=_0x107a28?_0x3cbae1[_0x49a6('0x2a')]:_0x213d48[_0x49a6('0x28')]+_0x213d48[_0x49a6('0x2b')];var _0x526f74;if(_0x4ff3b8>=_0x3768bc){_0x4ff3b8=_0x3768bc;_0x526f74=0xc8;}else{_0x526f74=0xce;}_0x372cbd[_0x49a6('0x25')](_0x526f74);return _0x372cbd[_0x49a6('0x2c')](_0x49a6('0x2d'),_0x8e7a65+'-'+_0x4ff3b8+'/'+_0x3768bc)['json'](_0x3cbae1);}return null;};}function patchUpdates(_0x33e967){return function(_0x129562){try{jsonpatch['apply'](_0x129562,_0x33e967,!![]);}catch(_0x537cef){return BPromise[_0x49a6('0x2e')](_0x537cef);}return _0x129562['save']();};}function saveUpdates(_0x31c2e9,_0x48a441){return function(_0xa3743d){if(_0xa3743d){return _0xa3743d['update'](_0x31c2e9)[_0x49a6('0x1b')](function(_0x4565b0){return _0x4565b0;});}return null;};}function removeEntity(_0xaf7972,_0x1317ee){return function(_0x21e898){if(_0x21e898){return _0x21e898['destroy']()[_0x49a6('0x1b')](function(){_0xaf7972[_0x49a6('0x25')](0xcc)[_0x49a6('0x26')]();});}};}function handleEntityNotFound(_0x19f520,_0x2aefc8){return function(_0x41dfe4){if(!_0x41dfe4){_0x19f520[_0x49a6('0x24')](0x194);}return _0x41dfe4;};}function handleError(_0x236933,_0x164a42){_0x164a42=_0x164a42||0x1f4;return function(_0x39048c){logger[_0x49a6('0x1f')](_0x39048c['stack']);if(_0x39048c[_0x49a6('0x2f')]){delete _0x39048c[_0x49a6('0x2f')];}_0x236933[_0x49a6('0x25')](_0x164a42)[_0x49a6('0x30')](_0x39048c);};}exports['index']=function(_0xdd8c1a,_0x2d0d42){var _0x10b0e5={},_0x2314ea={},_0x24c92f={'count':0x0,'rows':[]};var _0x5af76e=_[_0x49a6('0x31')](db[_0x49a6('0x32')][_0x49a6('0x33')],function(_0x57d99f){return{'name':_0x57d99f[_0x49a6('0x34')],'type':_0x57d99f['type'][_0x49a6('0x35')]};});_0x2314ea[_0x49a6('0x36')]=_[_0x49a6('0x31')](_0x5af76e,_0x49a6('0x2f'));_0x2314ea['query']=_[_0x49a6('0x37')](_0xdd8c1a[_0x49a6('0x38')]);_0x2314ea[_0x49a6('0x39')]=_['intersection'](_0x2314ea[_0x49a6('0x36')],_0x2314ea[_0x49a6('0x38')]);_0x10b0e5[_0x49a6('0x3a')]=_['intersection'](_0x2314ea[_0x49a6('0x36')],qs['fields'](_0xdd8c1a[_0x49a6('0x38')]['fields']));_0x10b0e5['attributes']=_0x10b0e5[_0x49a6('0x3a')][_0x49a6('0x3b')]?_0x10b0e5[_0x49a6('0x3a')]:_0x2314ea[_0x49a6('0x36')];if(!_0xdd8c1a[_0x49a6('0x38')][_0x49a6('0x3c')](_0x49a6('0x3d'))){_0x10b0e5[_0x49a6('0x2b')]=qs[_0x49a6('0x2b')](_0xdd8c1a[_0x49a6('0x38')][_0x49a6('0x2b')]);_0x10b0e5[_0x49a6('0x28')]=qs[_0x49a6('0x28')](_0xdd8c1a[_0x49a6('0x38')][_0x49a6('0x28')]);}_0x10b0e5[_0x49a6('0x3e')]=qs[_0x49a6('0x3f')](_0xdd8c1a[_0x49a6('0x38')][_0x49a6('0x3f')]);_0x10b0e5[_0x49a6('0x40')]=qs[_0x49a6('0x39')](_[_0x49a6('0x41')](_0xdd8c1a[_0x49a6('0x38')],_0x2314ea[_0x49a6('0x39')]),_0x5af76e);if(_0xdd8c1a[_0x49a6('0x38')][_0x49a6('0x42')]){_0x10b0e5[_0x49a6('0x40')]=_[_0x49a6('0x43')](_0x10b0e5['where'],{'$or':_[_0x49a6('0x31')](_0x5af76e,function(_0x769dca){if(_0x769dca[_0x49a6('0x44')]!==_0x49a6('0x45')){var _0x157f23={};_0x157f23[_0x769dca[_0x49a6('0x2f')]]={'$like':'%'+_0xdd8c1a[_0x49a6('0x38')][_0x49a6('0x42')]+'%'};return _0x157f23;}})});}_0x10b0e5=_['merge']({},_0x10b0e5,_0xdd8c1a[_0x49a6('0x46')]);var _0x2f01c5={'where':_0x10b0e5[_0x49a6('0x40')]};return db[_0x49a6('0x32')][_0x49a6('0x2a')](_0x2f01c5)[_0x49a6('0x1b')](function(_0x3ed82d){_0x24c92f[_0x49a6('0x2a')]=_0x3ed82d;if(_0xdd8c1a[_0x49a6('0x38')]['includeAll']){_0x10b0e5[_0x49a6('0x47')]=[{'all':!![]}];}return db[_0x49a6('0x32')][_0x49a6('0x48')](_0x10b0e5);})['then'](function(_0x44d211){_0x24c92f[_0x49a6('0x49')]=_0x44d211;return _0x24c92f;})[_0x49a6('0x1b')](respondWithFilteredResult(_0x2d0d42,_0x10b0e5))[_0x49a6('0x23')](handleError(_0x2d0d42,null));};exports[_0x49a6('0x4a')]=function(_0x36dc7b,_0x4654e9){var _0x4042de={'raw':![],'where':{'id':_0x36dc7b[_0x49a6('0x4b')]['id']}},_0x19928e={};_0x19928e['model']=_['keys'](db[_0x49a6('0x32')]['rawAttributes']);_0x19928e[_0x49a6('0x38')]=_[_0x49a6('0x37')](_0x36dc7b[_0x49a6('0x38')]);_0x19928e[_0x49a6('0x39')]=_[_0x49a6('0x4c')](_0x19928e[_0x49a6('0x36')],_0x19928e['query']);_0x4042de[_0x49a6('0x3a')]=_['intersection'](_0x19928e[_0x49a6('0x36')],qs[_0x49a6('0x4d')](_0x36dc7b[_0x49a6('0x38')]['fields']));_0x4042de['attributes']=_0x4042de[_0x49a6('0x3a')][_0x49a6('0x3b')]?_0x4042de['attributes']:_0x19928e[_0x49a6('0x36')];if(_0x36dc7b[_0x49a6('0x38')][_0x49a6('0x4e')]){_0x4042de[_0x49a6('0x47')]=[{'all':!![]}];}_0x4042de=_['merge']({},_0x4042de,_0x36dc7b[_0x49a6('0x46')]);return db['Dynamics365Account'][_0x49a6('0x4f')](_0x4042de)[_0x49a6('0x1b')](handleEntityNotFound(_0x4654e9,null))[_0x49a6('0x1b')](respondWithResult(_0x4654e9,null))['catch'](handleError(_0x4654e9,null));};exports[_0x49a6('0x50')]=function(_0x3be2f0,_0x1e533b){return db[_0x49a6('0x32')][_0x49a6('0x50')](_0x3be2f0['body'],{})[_0x49a6('0x1b')](respondWithResult(_0x1e533b,0xc9))[_0x49a6('0x23')](handleError(_0x1e533b,null));};exports[_0x49a6('0x51')]=function(_0x12ad27,_0x3d8292){if(_0x12ad27['body']['id']){delete _0x12ad27[_0x49a6('0x52')]['id'];}return db['Dynamics365Account'][_0x49a6('0x4f')]({'where':{'id':_0x12ad27['params']['id']}})['then'](handleEntityNotFound(_0x3d8292,null))[_0x49a6('0x1b')](saveUpdates(_0x12ad27[_0x49a6('0x52')],null))[_0x49a6('0x1b')](respondWithResult(_0x3d8292,null))[_0x49a6('0x23')](handleError(_0x3d8292,null));};exports[_0x49a6('0x53')]=function(_0x3283b8,_0x2f54ec){return db[_0x49a6('0x32')]['find']({'where':{'id':_0x3283b8['params']['id']}})[_0x49a6('0x1b')](handleEntityNotFound(_0x2f54ec,null))['then'](removeEntity(_0x2f54ec,null))[_0x49a6('0x23')](handleError(_0x2f54ec,null));};exports['getConfigurations']=function(_0x4d364e,_0x344517,_0x285187){var _0x355c8f={};var _0x59200b={};var _0x1ea1e2;var _0x186f16;return db[_0x49a6('0x32')][_0x49a6('0x54')]({'where':{'id':_0x4d364e[_0x49a6('0x4b')]['id']}})[_0x49a6('0x1b')](handleEntityNotFound(_0x344517,null))['then'](function(_0x91cf5b){if(_0x91cf5b){_0x1ea1e2=_0x91cf5b;_0x59200b[_0x49a6('0x36')]=_[_0x49a6('0x37')](db[_0x49a6('0x55')][_0x49a6('0x33')]);_0x59200b[_0x49a6('0x38')]=_[_0x49a6('0x37')](_0x4d364e[_0x49a6('0x38')]);_0x59200b[_0x49a6('0x39')]=_[_0x49a6('0x4c')](_0x59200b[_0x49a6('0x36')],_0x59200b[_0x49a6('0x38')]);_0x355c8f[_0x49a6('0x3a')]=_['intersection'](_0x59200b[_0x49a6('0x36')],qs[_0x49a6('0x4d')](_0x4d364e[_0x49a6('0x38')][_0x49a6('0x4d')]));_0x355c8f[_0x49a6('0x3a')]=_0x355c8f[_0x49a6('0x3a')][_0x49a6('0x3b')]?_0x355c8f['attributes']:_0x59200b['model'];_0x355c8f['order']=qs[_0x49a6('0x3f')](_0x4d364e[_0x49a6('0x38')][_0x49a6('0x3f')]);_0x355c8f[_0x49a6('0x40')]=qs[_0x49a6('0x39')](_[_0x49a6('0x41')](_0x4d364e[_0x49a6('0x38')],_0x59200b['filters']));if(_0x4d364e[_0x49a6('0x38')]['filter']){_0x355c8f['where']=_['merge'](_0x355c8f[_0x49a6('0x40')],{'$or':_[_0x49a6('0x31')](_0x355c8f[_0x49a6('0x3a')],function(_0x235fa8){var _0x3c1b5b={};_0x3c1b5b[_0x235fa8]={'$like':'%'+_0x4d364e[_0x49a6('0x38')][_0x49a6('0x42')]+'%'};return _0x3c1b5b;})});}_0x355c8f=_['merge']({},_0x355c8f,_0x4d364e[_0x49a6('0x46')]);return _0x1ea1e2[_0x49a6('0x56')](_0x355c8f);}})[_0x49a6('0x1b')](function(_0x217741){if(_0x217741){_0x186f16=_0x217741[_0x49a6('0x3b')];if(!_0x4d364e[_0x49a6('0x38')][_0x49a6('0x3c')](_0x49a6('0x3d'))){_0x355c8f[_0x49a6('0x2b')]=qs[_0x49a6('0x2b')](_0x4d364e['query'][_0x49a6('0x2b')]);_0x355c8f[_0x49a6('0x28')]=qs[_0x49a6('0x28')](_0x4d364e[_0x49a6('0x38')]['offset']);}return _0x1ea1e2[_0x49a6('0x56')](_0x355c8f);}})[_0x49a6('0x1b')](function(_0x57d91f){if(_0x57d91f){return _0x57d91f?{'count':_0x186f16,'rows':_0x57d91f}:null;}})['then'](respondWithResult(_0x344517,null))[_0x49a6('0x23')](handleError(_0x344517,null));};exports[_0x49a6('0x57')]=function(_0x41eba4,_0x26df58,_0x367545){if(_0x41eba4[_0x49a6('0x52')]['id']){delete _0x41eba4[_0x49a6('0x52')]['id'];}return db[_0x49a6('0x32')]['findOne']({'where':{'id':_0x41eba4[_0x49a6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x26df58,null))[_0x49a6('0x1b')](function(_0x3d4f98){if(_0x3d4f98){_0x41eba4[_0x49a6('0x52')][_0x49a6('0x58')]=_0x3d4f98['id'];_0x41eba4[_0x49a6('0x52')][_0x49a6('0x59')]=integrations[_0x49a6('0x5a')](_0x41eba4[_0x49a6('0x52')]['channel'],_0x41eba4[_0x49a6('0x52')][_0x49a6('0x44')]);_0x41eba4['body'][_0x49a6('0x5b')]=integrations[_0x49a6('0x5c')](_0x41eba4['body'][_0x49a6('0x5d')],_0x41eba4[_0x49a6('0x52')][_0x49a6('0x44')]);return db['Dynamics365Configuration'][_0x49a6('0x50')](_0x41eba4['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x49a6('0x59')},{'model':db[_0x49a6('0x5e')],'as':_0x49a6('0x5b')}]});}return null;})[_0x49a6('0x1b')](respondWithResult(_0x26df58,null))[_0x49a6('0x23')](handleError(_0x26df58,null));};exports['getFields']=function(_0x4b2362,_0x1334b6,_0x46fe35){var _0x4b1b2d=_0x4b2362[_0x49a6('0x38')]['ticketType'];var _0x5c851f=_0x4b1b2d===_0x49a6('0x5f')?_0x49a6('0x60'):'PhoneCall';var _0x4a41b6='';var _0x597e19='';var _0x43550c='';var _0x509932='';var _0x44d62c='';var _0x1860f9='';var _0x4f0d3d='';var _0x264954='';var _0x59dce9=[_0x49a6('0x61'),_0x49a6('0x62'),'customerid',_0x49a6('0x63'),_0x49a6('0x64'),_0x49a6('0x65'),_0x49a6('0x66'),_0x49a6('0x67'),_0x49a6('0x68'),'phonecall_activity_parties'];var _0x981e21=[_0x49a6('0x69'),_0x49a6('0x6a'),_0x49a6('0x6b'),_0x49a6('0x6c'),_0x49a6('0x6d'),_0x49a6('0x6e'),'contractdetailidname',_0x49a6('0x6f'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0x49a6('0x70'),'createdbyyominame',_0x49a6('0x71'),'createdonbehalfbyname',_0x49a6('0x72'),_0x49a6('0x73'),_0x49a6('0x74'),_0x49a6('0x75'),_0x49a6('0x76'),_0x49a6('0x77'),'entityimage_timestamp',_0x49a6('0x78'),_0x49a6('0x79'),'exchangerate','firstresponsebykpiidname','followupby',_0x49a6('0x7a'),_0x49a6('0x7b'),'kbarticleidname','lastonholdtime',_0x49a6('0x7c'),_0x49a6('0x7d'),'modifiedbyexternalpartyyominame',_0x49a6('0x7e'),_0x49a6('0x7f'),'modifiedon',_0x49a6('0x80'),_0x49a6('0x81'),_0x49a6('0x82'),_0x49a6('0x83'),_0x49a6('0x84'),'onholdtime',_0x49a6('0x85'),_0x49a6('0x86'),_0x49a6('0x87'),_0x49a6('0x88'),'parentcaseidname',_0x49a6('0x89'),_0x49a6('0x8a'),_0x49a6('0x8b'),_0x49a6('0x8c'),_0x49a6('0x8d'),_0x49a6('0x8e'),'resolvebykpiidname',_0x49a6('0x8f'),_0x49a6('0x90'),_0x49a6('0x91'),'sentimentvalue',_0x49a6('0x92'),_0x49a6('0x93'),_0x49a6('0x94'),'statecode',_0x49a6('0x95'),_0x49a6('0x96'),_0x49a6('0x97'),_0x49a6('0x98'),_0x49a6('0x99'),_0x49a6('0x9a'),_0x49a6('0x9b'),_0x49a6('0x9c')];var _0x5193bf=_0x59dce9['concat'](_0x981e21);return db[_0x49a6('0x32')][_0x49a6('0x54')]({'where':{'id':_0x4b2362[_0x49a6('0x4b')]['id']},'attributes':['id',_0x49a6('0x9d'),'password',_0x49a6('0x9e'),_0x49a6('0x9f'),'clientId',_0x49a6('0xa0')]})[_0x49a6('0x1b')](handleEntityNotFound(_0x1334b6,null))[_0x49a6('0x1b')](function(_0x13d614){if(_0x13d614){_0x264954=_0x13d614[_0x49a6('0x9e')];var _0x19d7fc=_0x264954[_0x49a6('0xa1')](-0x1);if(_0x19d7fc==='/'){_0x264954=_0x264954[_0x49a6('0xa2')](0x0,_0x264954[_0x49a6('0xa3')](_0x19d7fc));}_0x4f0d3d=util[_0x49a6('0xa4')](_0x49a6('0xa5'),_0x264954);var _0x1c94ed={'method':_0x49a6('0xa6'),'uri':_0x49a6('0xa7')+_0x13d614[_0x49a6('0x9f')]+_0x49a6('0xa8'),'form':{'client_id':_0x13d614[_0x49a6('0xa9')],'resource':_0x264954,'username':_0x13d614[_0x49a6('0x9d')],'password':_0x13d614['password'],'grant_type':_0x49a6('0xaa'),'client_secret':_0x13d614[_0x49a6('0xa0')]},'json':!![]};return rp(_0x1c94ed);}})[_0x49a6('0x1b')](function(_0x2bb897){_0x1860f9=_0x2bb897[_0x49a6('0xab')];var _0x3694a3={'method':_0x49a6('0xac'),'uri':encodeURI(_0x4f0d3d+_0x49a6('0xad')+_0x5c851f+'\x27'),'headers':{'Authorization':_0x49a6('0xae')+_0x1860f9,'If-None-Match':null,'OData-Version':_0x49a6('0xaf')},'json':!![]};return rp(_0x3694a3);})[_0x49a6('0x1b')](function(_0x3ce731){var _0x262483=_0x3ce731['value'][0x0];var _0x1238d6=_0x262483['MetadataId'];var _0x26ac72={'method':_0x49a6('0xac'),'uri':_0x4f0d3d+_0x49a6('0xb0')+_0x1238d6+_0x49a6('0xb1'),'headers':{'Authorization':'Bearer\x20'+_0x1860f9,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x26ac72);})[_0x49a6('0x1b')](function(_0xc7faec){_0x4a41b6=_0xc7faec;_0x597e19=_0x4a41b6[_0x49a6('0xb2')];_0x597e19=_[_0x49a6('0xb3')](_0x597e19,function(_0x507d50){return!_0x5193bf[_0x49a6('0xb4')](_0x507d50['LogicalName']);});var _0x206cdc=[];var _0x587c78=[];_0x597e19[_0x49a6('0xb5')](function(_0x32bc64){if(_0x32bc64[_0x49a6('0xb6')]){var _0xeda294=_0x32bc64[_0x49a6('0xb6')][_0x49a6('0xa2')](_0x32bc64[_0x49a6('0xb6')][_0x49a6('0xa3')]('.')+0x1);if(_0xeda294===_0x49a6('0xb7')){_0x206cdc[_0x49a6('0xb8')](getSelectList(_0x4f0d3d,_0x4b1b2d,_0x587c78,_0x4a41b6[_0x49a6('0xb9')],_0x32bc64['MetadataId'],_0x1860f9));}}});return Promise[_0x49a6('0xba')](_0x206cdc);})[_0x49a6('0x1b')](function(_0x14b87f){_0x43550c=_0x14b87f[0x0];var _0x247b2d=[];var _0xb0487c=[];_0x597e19[_0x49a6('0xb5')](function(_0x33bfe0){if(!_['isNil'](_0x33bfe0[_0x49a6('0xb6')])){var _0x3f2aa3=_0x33bfe0[_0x49a6('0xb6')][_0x49a6('0xa2')](_0x33bfe0[_0x49a6('0xb6')]['lastIndexOf']('.')+0x1);if(_0x3f2aa3==='BooleanAttributeMetadata'){_0x247b2d['push'](getBooleanList(_0x4f0d3d,_0x4b1b2d,_0xb0487c,_0x4a41b6['MetadataId'],_0x33bfe0[_0x49a6('0xb9')],_0x1860f9));}}});return Promise['all'](_0x247b2d);})[_0x49a6('0x1b')](function(_0x39fea6){_0x509932=_0x39fea6[0x0];var _0x258e01=[];var _0x809aca=[];_0x597e19[_0x49a6('0xb5')](function(_0x4b79cc){if(_0x4b79cc['@odata.type']){var _0x525f82=_0x4b79cc[_0x49a6('0xb6')]['substring'](_0x4b79cc[_0x49a6('0xb6')][_0x49a6('0xa3')]('.')+0x1);if(_0x525f82===_0x49a6('0xbb')||_0x525f82===_0x49a6('0xbc')||_0x525f82===_0x49a6('0xbd')||_0x525f82===_0x49a6('0xbe')||_0x525f82===_0x49a6('0xbf')||_0x525f82===_0x49a6('0xc0')||_0x525f82==='StatusAttributeMetadata'||_0x525f82===_0x49a6('0xc1')||_0x525f82==='StateAttributeMetadata'||_0x525f82===_0x49a6('0xc2')){_0x258e01[_0x49a6('0xb8')](getInputList(_0x4f0d3d,_0x4b1b2d,_0x525f82,_0x809aca,_0x4a41b6[_0x49a6('0xb9')],_0x4b79cc[_0x49a6('0xb9')],_0x1860f9));}}});return Promise['all'](_0x258e01);})['then'](function(_0x3b5f65){_0x44d62c=_0x3b5f65[0x0];var _0x5ded21=_0x43550c[_0x49a6('0xc3')](_0x509932)['concat'](_0x44d62c);var _0x18aeec={'count':_0x5ded21[_0x49a6('0x3b')],'rows':_0x5ded21};return _0x18aeec;})[_0x49a6('0x1b')](respondWithResult(_0x1334b6,null))[_0x49a6('0x23')](function(_0x3ebbb1){var _0x51c61d=_0x4b2362[_0x49a6('0x38')]['test']?0x1f4:_0x3ebbb1['statusCode']||0x1f4;logger[_0x49a6('0x1f')](_0x3ebbb1[_0x49a6('0xc4')]);delete _0x3ebbb1[_0x49a6('0x2f')];if(_0x51c61d===0x191){_0x51c61d=0x190;}_0x1334b6['status'](_0x51c61d)[_0x49a6('0x30')](_0x4b2362[_0x49a6('0x38')]['test']?{'message':_0x49a6('0xc5'),'statusCode':_0x3ebbb1[_0x49a6('0xc6')]}:_0x3ebbb1);});};function getSelectList(_0x4274da,_0x58bdfb,_0x22d62c,_0x61d1b1,_0x259db6,_0x5d1a23){var _0x4a6bd6={'method':_0x49a6('0xac'),'uri':_0x4274da+_0x49a6('0xb0')+_0x61d1b1+_0x49a6('0xc7')+_0x259db6+_0x49a6('0xc8')+_0x49a6('0xc9'),'headers':{'Authorization':_0x49a6('0xae')+_0x5d1a23,'If-None-Match':null,'OData-Version':_0x49a6('0xaf')},'json':!![]};return rp(_0x4a6bd6)[_0x49a6('0x1b')](function(_0x1d5925){var _0x90a919=[];var _0x30701a=_0x1d5925['OptionSet'][_0x49a6('0xca')];_0x30701a['forEach'](function(_0x3d431f){_0x90a919[_0x49a6('0xb8')]({'name':_0x3d431f[_0x49a6('0xcb')][_0x49a6('0xcc')][_0x49a6('0xcb')],'value':String(_0x3d431f[_0x49a6('0xcd')])});});var _0x1a082a={'id':_0x58bdfb+'_'+_0x1d5925['LogicalName'],'name':_0x1d5925[_0x49a6('0xce')][_0x49a6('0xcc')]['Label'],'custom':![],'options':_0x90a919};_0x22d62c[_0x49a6('0xb8')](_0x1a082a);return _0x22d62c;});}function getBooleanList(_0x1ae642,_0x20fa41,_0x5ad754,_0x56d494,_0x4e5335,_0x4717cf){var _0x3db3eb={'method':'GET','uri':_0x1ae642+'EntityDefinitions('+_0x56d494+')/Attributes('+_0x4e5335+_0x49a6('0xcf'),'headers':{'Authorization':_0x49a6('0xae')+_0x4717cf,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3db3eb)[_0x49a6('0x1b')](function(_0x161128){var _0x151f2d=[];_0x151f2d['push']({'name':_0x161128[_0x49a6('0xd0')][_0x49a6('0xd1')][_0x49a6('0xcb')][_0x49a6('0xcc')][_0x49a6('0xcb')],'value':'true'},{'name':_0x161128[_0x49a6('0xd0')]['FalseOption']['Label'][_0x49a6('0xcc')]['Label'],'value':_0x49a6('0xd2')});var _0x3195d0={'id':_0x20fa41+'_'+_0x161128[_0x49a6('0xd3')],'name':_0x161128[_0x49a6('0xce')][_0x49a6('0xcc')][_0x49a6('0xcb')],'custom':![],'options':_0x151f2d};_0x5ad754[_0x49a6('0xb8')](_0x3195d0);return _0x5ad754;});}function getInputList(_0x3ce5ba,_0x899e5,_0x8172e1,_0x1d8bd2,_0x303b88,_0x561513,_0x28bcf3){var _0x208f08={'method':'GET','uri':_0x3ce5ba+_0x49a6('0xb0')+_0x303b88+_0x49a6('0xc7')+_0x561513+_0x49a6('0xd4')+_0x8172e1+_0x49a6('0xd5'),'headers':{'Authorization':_0x49a6('0xae')+_0x28bcf3,'If-None-Match':null,'OData-Version':_0x49a6('0xaf')},'json':!![]};return rp(_0x208f08)[_0x49a6('0x1b')](function(_0x3df95f){var _0x2dbd68={'id':_0x899e5+'_'+_0x3df95f[_0x49a6('0xd3')],'name':_0x3df95f['DisplayName'][_0x49a6('0xcc')]?_0x3df95f[_0x49a6('0xce')][_0x49a6('0xcc')][_0x49a6('0xcb')]:_0x3df95f[_0x49a6('0xd3')],'custom':![],'options':[]};_0x1d8bd2[_0x49a6('0xb8')](_0x2dbd68);return _0x1d8bd2;});} \ No newline at end of file +var _0x7f98=['phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','substring','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','password','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','forEach','@odata.type','lastIndexOf','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName','TrueOption','true','FalseOption','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','then','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','stack','name','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','fields','includeAll','options','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','title','customerid','ownerid','caseorigincode','subject'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7f98,0x78));var _0x87f9=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x7f98[_0x4b2436];return _0x4f5ab2;};'use strict';var emlformat=require(_0x87f9('0x0'));var rimraf=require(_0x87f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x87f9('0x2'));var rp=require('request-promise');var moment=require(_0x87f9('0x3'));var BPromise=require(_0x87f9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x87f9('0x5'));var sox=require(_0x87f9('0x6'));var csv=require(_0x87f9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x87f9('0x8'));var _=require(_0x87f9('0x9'));var squel=require(_0x87f9('0xa'));var crypto=require(_0x87f9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x87f9('0xc'));var toCsv=require(_0x87f9('0x7'));var querystring=require(_0x87f9('0xd'));var Papa=require(_0x87f9('0xe'));var Redis=require(_0x87f9('0xf'));var authService=require(_0x87f9('0x10'));var qs=require(_0x87f9('0x11'));var as=require(_0x87f9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x87f9('0x13'));var utils=require(_0x87f9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x87f9('0x15'));var db=require(_0x87f9('0x16'))['db'];var integrations=require(_0x87f9('0x17'));var jayson=require(_0x87f9('0x18'));var client=jayson['client'][_0x87f9('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2a183b,_0x36585a,_0x5ae7c4,_0x55ce9f){return new BPromise(function(_0x5dbdb3,_0x129aad){var _0x34510b=_0x55ce9f||client;return _0x34510b['request'](_0x2a183b,_0x5ae7c4)[_0x87f9('0x1a')](function(_0x14f2f0){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x36585a,_0x87f9('0x1b'));logger[_0x87f9('0x1c')](_0x87f9('0x1d'),_0x36585a,'request\x20sent',JSON[_0x87f9('0x1e')](_0x14f2f0));if(_0x14f2f0[_0x87f9('0x1f')]){if(_0x14f2f0['error'][_0x87f9('0x20')]===0x1f4){logger[_0x87f9('0x1f')](_0x87f9('0x21'),_0x36585a,_0x14f2f0[_0x87f9('0x1f')]['message']);return _0x129aad(_0x14f2f0[_0x87f9('0x1f')][_0x87f9('0x22')]);}logger[_0x87f9('0x1f')](_0x87f9('0x21'),_0x36585a,_0x14f2f0[_0x87f9('0x1f')][_0x87f9('0x22')]);return _0x5dbdb3(_0x14f2f0[_0x87f9('0x1f')]['message']);}else{logger['info'](_0x87f9('0x21'),_0x36585a,_0x87f9('0x1b'));_0x5dbdb3(_0x14f2f0[_0x87f9('0x23')][_0x87f9('0x22')]);}})[_0x87f9('0x24')](function(_0x4105f6){logger['error'](_0x87f9('0x21'),_0x36585a,_0x4105f6);_0x129aad(_0x4105f6);});});}function respondWithStatusCode(_0x368ac5,_0x25f737){_0x25f737=_0x25f737||0xcc;return function(_0x2bde82){if(_0x2bde82){return _0x368ac5[_0x87f9('0x25')](_0x25f737);}return _0x368ac5[_0x87f9('0x26')](_0x25f737)['end']();};}function respondWithResult(_0x52242a,_0x3d8b47){_0x3d8b47=_0x3d8b47||0xc8;return function(_0x464a01){if(_0x464a01){return _0x52242a[_0x87f9('0x26')](_0x3d8b47)[_0x87f9('0x27')](_0x464a01);}};}function respondWithFilteredResult(_0x59eddb,_0x18de3c){return function(_0x1747b0){if(_0x1747b0){var _0x8733b7=typeof _0x18de3c[_0x87f9('0x28')]===_0x87f9('0x29')&&typeof _0x18de3c[_0x87f9('0x2a')]==='undefined';var _0x3b2388=_0x1747b0[_0x87f9('0x2b')];var _0x1af065=_0x8733b7?0x0:_0x18de3c[_0x87f9('0x28')];var _0x59774b=_0x8733b7?_0x1747b0[_0x87f9('0x2b')]:_0x18de3c['offset']+_0x18de3c['limit'];var _0x3e9b24;if(_0x59774b>=_0x3b2388){_0x59774b=_0x3b2388;_0x3e9b24=0xc8;}else{_0x3e9b24=0xce;}_0x59eddb[_0x87f9('0x26')](_0x3e9b24);return _0x59eddb['set']('Content-Range',_0x1af065+'-'+_0x59774b+'/'+_0x3b2388)[_0x87f9('0x27')](_0x1747b0);}return null;};}function patchUpdates(_0xe8655c){return function(_0x28ef59){try{jsonpatch[_0x87f9('0x2c')](_0x28ef59,_0xe8655c,!![]);}catch(_0x53d735){return BPromise[_0x87f9('0x2d')](_0x53d735);}return _0x28ef59[_0x87f9('0x2e')]();};}function saveUpdates(_0x172ab8,_0x392588){return function(_0x2f9efb){if(_0x2f9efb){return _0x2f9efb[_0x87f9('0x2f')](_0x172ab8)[_0x87f9('0x1a')](function(_0x38c1aa){return _0x38c1aa;});}return null;};}function removeEntity(_0x382421,_0x4fdb4d){return function(_0x5684e0){if(_0x5684e0){return _0x5684e0[_0x87f9('0x30')]()[_0x87f9('0x1a')](function(){_0x382421['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e9888,_0x31832b){return function(_0x3d0f59){if(!_0x3d0f59){_0x2e9888[_0x87f9('0x25')](0x194);}return _0x3d0f59;};}function handleError(_0x7e72a7,_0x44fa5e){_0x44fa5e=_0x44fa5e||0x1f4;return function(_0x13fd4a){logger[_0x87f9('0x1f')](_0x13fd4a[_0x87f9('0x31')]);if(_0x13fd4a[_0x87f9('0x32')]){delete _0x13fd4a['name'];}_0x7e72a7[_0x87f9('0x26')](_0x44fa5e)['send'](_0x13fd4a);};}exports[_0x87f9('0x33')]=function(_0x7234f9,_0x4245e5){var _0x5ea1f6={},_0x565c62={},_0x49cef4={'count':0x0,'rows':[]};var _0x1f8ad9=_[_0x87f9('0x34')](db[_0x87f9('0x35')][_0x87f9('0x36')],function(_0x4207e9){return{'name':_0x4207e9[_0x87f9('0x37')],'type':_0x4207e9[_0x87f9('0x38')][_0x87f9('0x39')]};});_0x565c62[_0x87f9('0x3a')]=_[_0x87f9('0x34')](_0x1f8ad9,_0x87f9('0x32'));_0x565c62[_0x87f9('0x3b')]=_[_0x87f9('0x3c')](_0x7234f9[_0x87f9('0x3b')]);_0x565c62[_0x87f9('0x3d')]=_[_0x87f9('0x3e')](_0x565c62[_0x87f9('0x3a')],_0x565c62[_0x87f9('0x3b')]);_0x5ea1f6['attributes']=_[_0x87f9('0x3e')](_0x565c62[_0x87f9('0x3a')],qs['fields'](_0x7234f9['query']['fields']));_0x5ea1f6[_0x87f9('0x3f')]=_0x5ea1f6['attributes'][_0x87f9('0x40')]?_0x5ea1f6[_0x87f9('0x3f')]:_0x565c62[_0x87f9('0x3a')];if(!_0x7234f9[_0x87f9('0x3b')][_0x87f9('0x41')]('nolimit')){_0x5ea1f6['limit']=qs[_0x87f9('0x2a')](_0x7234f9['query']['limit']);_0x5ea1f6['offset']=qs[_0x87f9('0x28')](_0x7234f9[_0x87f9('0x3b')][_0x87f9('0x28')]);}_0x5ea1f6[_0x87f9('0x42')]=qs['sort'](_0x7234f9[_0x87f9('0x3b')][_0x87f9('0x43')]);_0x5ea1f6[_0x87f9('0x44')]=qs[_0x87f9('0x3d')](_[_0x87f9('0x45')](_0x7234f9[_0x87f9('0x3b')],_0x565c62[_0x87f9('0x3d')]),_0x1f8ad9);if(_0x7234f9['query'][_0x87f9('0x46')]){_0x5ea1f6[_0x87f9('0x44')]=_[_0x87f9('0x47')](_0x5ea1f6[_0x87f9('0x44')],{'$or':_['map'](_0x1f8ad9,function(_0x31d9ce){if(_0x31d9ce[_0x87f9('0x38')]!==_0x87f9('0x48')){var _0x4fd0f8={};_0x4fd0f8[_0x31d9ce['name']]={'$like':'%'+_0x7234f9[_0x87f9('0x3b')][_0x87f9('0x46')]+'%'};return _0x4fd0f8;}})});}_0x5ea1f6=_[_0x87f9('0x47')]({},_0x5ea1f6,_0x7234f9['options']);var _0x41620e={'where':_0x5ea1f6[_0x87f9('0x44')]};return db['Dynamics365Account']['count'](_0x41620e)['then'](function(_0x53af7f){_0x49cef4[_0x87f9('0x2b')]=_0x53af7f;if(_0x7234f9[_0x87f9('0x3b')]['includeAll']){_0x5ea1f6[_0x87f9('0x49')]=[{'all':!![]}];}return db[_0x87f9('0x35')][_0x87f9('0x4a')](_0x5ea1f6);})['then'](function(_0x1fffa3){_0x49cef4[_0x87f9('0x4b')]=_0x1fffa3;return _0x49cef4;})[_0x87f9('0x1a')](respondWithFilteredResult(_0x4245e5,_0x5ea1f6))['catch'](handleError(_0x4245e5,null));};exports[_0x87f9('0x4c')]=function(_0x441a85,_0x29f4c8){var _0x32847b={'raw':![],'where':{'id':_0x441a85['params']['id']}},_0xaf6b50={};_0xaf6b50[_0x87f9('0x3a')]=_[_0x87f9('0x3c')](db[_0x87f9('0x35')][_0x87f9('0x36')]);_0xaf6b50[_0x87f9('0x3b')]=_[_0x87f9('0x3c')](_0x441a85[_0x87f9('0x3b')]);_0xaf6b50[_0x87f9('0x3d')]=_[_0x87f9('0x3e')](_0xaf6b50['model'],_0xaf6b50[_0x87f9('0x3b')]);_0x32847b[_0x87f9('0x3f')]=_[_0x87f9('0x3e')](_0xaf6b50[_0x87f9('0x3a')],qs[_0x87f9('0x4d')](_0x441a85[_0x87f9('0x3b')][_0x87f9('0x4d')]));_0x32847b[_0x87f9('0x3f')]=_0x32847b['attributes'][_0x87f9('0x40')]?_0x32847b[_0x87f9('0x3f')]:_0xaf6b50['model'];if(_0x441a85[_0x87f9('0x3b')][_0x87f9('0x4e')]){_0x32847b[_0x87f9('0x49')]=[{'all':!![]}];}_0x32847b=_[_0x87f9('0x47')]({},_0x32847b,_0x441a85[_0x87f9('0x4f')]);return db['Dynamics365Account'][_0x87f9('0x50')](_0x32847b)[_0x87f9('0x1a')](handleEntityNotFound(_0x29f4c8,null))[_0x87f9('0x1a')](respondWithResult(_0x29f4c8,null))[_0x87f9('0x24')](handleError(_0x29f4c8,null));};exports[_0x87f9('0x51')]=function(_0x12d857,_0x5c02cc){return db[_0x87f9('0x35')][_0x87f9('0x51')](_0x12d857[_0x87f9('0x52')],{})[_0x87f9('0x1a')](respondWithResult(_0x5c02cc,0xc9))[_0x87f9('0x24')](handleError(_0x5c02cc,null));};exports['update']=function(_0x120fc6,_0xc30875){if(_0x120fc6['body']['id']){delete _0x120fc6[_0x87f9('0x52')]['id'];}return db[_0x87f9('0x35')]['find']({'where':{'id':_0x120fc6[_0x87f9('0x53')]['id']}})[_0x87f9('0x1a')](handleEntityNotFound(_0xc30875,null))[_0x87f9('0x1a')](saveUpdates(_0x120fc6[_0x87f9('0x52')],null))[_0x87f9('0x1a')](respondWithResult(_0xc30875,null))[_0x87f9('0x24')](handleError(_0xc30875,null));};exports[_0x87f9('0x30')]=function(_0x47592b,_0x23a0bc){return db[_0x87f9('0x35')][_0x87f9('0x50')]({'where':{'id':_0x47592b[_0x87f9('0x53')]['id']}})['then'](handleEntityNotFound(_0x23a0bc,null))['then'](removeEntity(_0x23a0bc,null))[_0x87f9('0x24')](handleError(_0x23a0bc,null));};exports[_0x87f9('0x54')]=function(_0x520780,_0x4f5780,_0x5238fb){var _0x2d9f73={};var _0x56ff65={};var _0x5a48ef;var _0x54a994;return db[_0x87f9('0x35')][_0x87f9('0x55')]({'where':{'id':_0x520780['params']['id']}})[_0x87f9('0x1a')](handleEntityNotFound(_0x4f5780,null))[_0x87f9('0x1a')](function(_0x1cf3b7){if(_0x1cf3b7){_0x5a48ef=_0x1cf3b7;_0x56ff65[_0x87f9('0x3a')]=_[_0x87f9('0x3c')](db[_0x87f9('0x56')][_0x87f9('0x36')]);_0x56ff65['query']=_['keys'](_0x520780['query']);_0x56ff65[_0x87f9('0x3d')]=_[_0x87f9('0x3e')](_0x56ff65['model'],_0x56ff65[_0x87f9('0x3b')]);_0x2d9f73[_0x87f9('0x3f')]=_[_0x87f9('0x3e')](_0x56ff65[_0x87f9('0x3a')],qs[_0x87f9('0x4d')](_0x520780[_0x87f9('0x3b')][_0x87f9('0x4d')]));_0x2d9f73['attributes']=_0x2d9f73[_0x87f9('0x3f')][_0x87f9('0x40')]?_0x2d9f73[_0x87f9('0x3f')]:_0x56ff65[_0x87f9('0x3a')];_0x2d9f73['order']=qs[_0x87f9('0x43')](_0x520780[_0x87f9('0x3b')]['sort']);_0x2d9f73[_0x87f9('0x44')]=qs[_0x87f9('0x3d')](_[_0x87f9('0x45')](_0x520780['query'],_0x56ff65[_0x87f9('0x3d')]));if(_0x520780[_0x87f9('0x3b')][_0x87f9('0x46')]){_0x2d9f73[_0x87f9('0x44')]=_[_0x87f9('0x47')](_0x2d9f73[_0x87f9('0x44')],{'$or':_[_0x87f9('0x34')](_0x2d9f73[_0x87f9('0x3f')],function(_0x3222d5){var _0x3be9c3={};_0x3be9c3[_0x3222d5]={'$like':'%'+_0x520780[_0x87f9('0x3b')][_0x87f9('0x46')]+'%'};return _0x3be9c3;})});}_0x2d9f73=_[_0x87f9('0x47')]({},_0x2d9f73,_0x520780[_0x87f9('0x4f')]);return _0x5a48ef[_0x87f9('0x54')](_0x2d9f73);}})[_0x87f9('0x1a')](function(_0x3fc800){if(_0x3fc800){_0x54a994=_0x3fc800[_0x87f9('0x40')];if(!_0x520780[_0x87f9('0x3b')][_0x87f9('0x41')](_0x87f9('0x57'))){_0x2d9f73[_0x87f9('0x2a')]=qs[_0x87f9('0x2a')](_0x520780[_0x87f9('0x3b')][_0x87f9('0x2a')]);_0x2d9f73[_0x87f9('0x28')]=qs[_0x87f9('0x28')](_0x520780['query']['offset']);}return _0x5a48ef[_0x87f9('0x54')](_0x2d9f73);}})[_0x87f9('0x1a')](function(_0xd16103){if(_0xd16103){return _0xd16103?{'count':_0x54a994,'rows':_0xd16103}:null;}})[_0x87f9('0x1a')](respondWithResult(_0x4f5780,null))['catch'](handleError(_0x4f5780,null));};exports['addConfiguration']=function(_0x9167b8,_0x1b2a36,_0x630fb){if(_0x9167b8[_0x87f9('0x52')]['id']){delete _0x9167b8[_0x87f9('0x52')]['id'];}return db[_0x87f9('0x35')][_0x87f9('0x55')]({'where':{'id':_0x9167b8[_0x87f9('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b2a36,null))['then'](function(_0x37a996){if(_0x37a996){_0x9167b8[_0x87f9('0x52')][_0x87f9('0x58')]=_0x37a996['id'];_0x9167b8[_0x87f9('0x52')][_0x87f9('0x59')]=integrations[_0x87f9('0x5a')](_0x9167b8['body'][_0x87f9('0x5b')],_0x9167b8['body'][_0x87f9('0x38')]);_0x9167b8[_0x87f9('0x52')][_0x87f9('0x5c')]=integrations[_0x87f9('0x5d')](_0x9167b8[_0x87f9('0x52')]['channel'],_0x9167b8[_0x87f9('0x52')][_0x87f9('0x38')]);return db[_0x87f9('0x56')][_0x87f9('0x51')](_0x9167b8[_0x87f9('0x52')],{'include':[{'model':db[_0x87f9('0x5e')],'as':_0x87f9('0x59')},{'model':db[_0x87f9('0x5e')],'as':_0x87f9('0x5c')}]});}return null;})['then'](respondWithResult(_0x1b2a36,null))['catch'](handleError(_0x1b2a36,null));};exports[_0x87f9('0x5f')]=function(_0x14bf17,_0x1c569a,_0x367dcd){var _0x345362=_0x14bf17[_0x87f9('0x3b')][_0x87f9('0x60')];var _0x56b163=_0x345362===_0x87f9('0x61')?'Incident':'PhoneCall';var _0x21ba5f='';var _0x2bb796='';var _0xc76d5a='';var _0x45490d='';var _0x775cb3='';var _0x3f5614='';var _0x55b04e='';var _0x5664e2='';var _0x3e0912=[_0x87f9('0x62'),'description',_0x87f9('0x63'),_0x87f9('0x64'),_0x87f9('0x65'),_0x87f9('0x66'),_0x87f9('0x67'),_0x87f9('0x68'),_0x87f9('0x69'),_0x87f9('0x6a')];var _0x148241=['accountidname',_0x87f9('0x6b'),_0x87f9('0x6c'),_0x87f9('0x6d'),'contactidname',_0x87f9('0x6e'),_0x87f9('0x6f'),_0x87f9('0x70'),'createdbyexternalpartyname',_0x87f9('0x71'),_0x87f9('0x72'),_0x87f9('0x73'),_0x87f9('0x74'),_0x87f9('0x75'),_0x87f9('0x76'),'customeridname',_0x87f9('0x77'),_0x87f9('0x78'),_0x87f9('0x79'),_0x87f9('0x7a'),_0x87f9('0x7b'),_0x87f9('0x7c'),_0x87f9('0x7d'),'exchangerate',_0x87f9('0x7e'),_0x87f9('0x7f'),'importsequencenumber',_0x87f9('0x80'),'kbarticleidname',_0x87f9('0x81'),_0x87f9('0x82'),_0x87f9('0x83'),_0x87f9('0x84'),_0x87f9('0x85'),_0x87f9('0x86'),_0x87f9('0x87'),_0x87f9('0x88'),_0x87f9('0x89'),_0x87f9('0x8a'),_0x87f9('0x8b'),_0x87f9('0x8c'),_0x87f9('0x8d'),_0x87f9('0x8e'),_0x87f9('0x8f'),'owneridtype',_0x87f9('0x90'),_0x87f9('0x91'),_0x87f9('0x92'),'primarycontactidyominame','prioritycodename',_0x87f9('0x93'),_0x87f9('0x94'),_0x87f9('0x95'),_0x87f9('0x96'),_0x87f9('0x97'),_0x87f9('0x98'),_0x87f9('0x99'),_0x87f9('0x9a'),_0x87f9('0x9b'),'slaname',_0x87f9('0x9c'),_0x87f9('0x9d'),_0x87f9('0x9e'),_0x87f9('0x9f'),_0x87f9('0xa0'),_0x87f9('0xa1'),_0x87f9('0xa2'),_0x87f9('0xa3'),'utcconversiontimezonecode',_0x87f9('0xa4')];var _0x3a43ea=_0x3e0912[_0x87f9('0xa5')](_0x148241);return db[_0x87f9('0x35')][_0x87f9('0x55')]({'where':{'id':_0x14bf17[_0x87f9('0x53')]['id']},'attributes':['id',_0x87f9('0xa6'),'password',_0x87f9('0xa7'),_0x87f9('0xa8'),_0x87f9('0xa9'),_0x87f9('0xaa')]})[_0x87f9('0x1a')](handleEntityNotFound(_0x1c569a,null))[_0x87f9('0x1a')](function(_0x4be695){if(_0x4be695){_0x5664e2=_0x4be695[_0x87f9('0xa7')];var _0x1e38ee=_0x5664e2['slice'](-0x1);if(_0x1e38ee==='/'){_0x5664e2=_0x5664e2[_0x87f9('0xab')](0x0,_0x5664e2['lastIndexOf'](_0x1e38ee));}_0x55b04e=util[_0x87f9('0xac')](_0x87f9('0xad'),_0x5664e2);var _0x1a6022={'method':_0x87f9('0xae'),'uri':_0x87f9('0xaf')+_0x4be695['tenantId']+_0x87f9('0xb0'),'form':{'client_id':_0x4be695[_0x87f9('0xa9')],'resource':_0x5664e2,'username':_0x4be695[_0x87f9('0xa6')],'password':_0x4be695[_0x87f9('0xb1')],'grant_type':_0x87f9('0xb1'),'client_secret':_0x4be695[_0x87f9('0xaa')]},'json':!![]};return rp(_0x1a6022);}})['then'](function(_0x380e24){_0x3f5614=_0x380e24[_0x87f9('0xb2')];var _0x14a30b={'method':'GET','uri':encodeURI(_0x55b04e+_0x87f9('0xb3')+_0x56b163+'\x27'),'headers':{'Authorization':_0x87f9('0xb4')+_0x3f5614,'If-None-Match':null,'OData-Version':_0x87f9('0xb5')},'json':!![]};return rp(_0x14a30b);})[_0x87f9('0x1a')](function(_0x4e552e){var _0x5c1978=_0x4e552e[_0x87f9('0xb6')][0x0];var _0x31a18a=_0x5c1978[_0x87f9('0xb7')];var _0x3dc5f9={'method':_0x87f9('0xb8'),'uri':_0x55b04e+_0x87f9('0xb9')+_0x31a18a+_0x87f9('0xba'),'headers':{'Authorization':_0x87f9('0xb4')+_0x3f5614,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3dc5f9);})['then'](function(_0x2b0c43){_0x21ba5f=_0x2b0c43;_0x2bb796=_0x21ba5f['Attributes'];_0x2bb796=_[_0x87f9('0xbb')](_0x2bb796,function(_0x5ce1e4){return!_0x3a43ea[_0x87f9('0xbc')](_0x5ce1e4['LogicalName']);});var _0x2749f8=[];var _0x25cf91=[];_0x2bb796[_0x87f9('0xbd')](function(_0x510687){if(_0x510687[_0x87f9('0xbe')]){var _0x142e94=_0x510687[_0x87f9('0xbe')][_0x87f9('0xab')](_0x510687['@odata.type'][_0x87f9('0xbf')]('.')+0x1);if(_0x142e94==='PicklistAttributeMetadata'){_0x2749f8[_0x87f9('0xc0')](getSelectList(_0x55b04e,_0x345362,_0x25cf91,_0x21ba5f[_0x87f9('0xb7')],_0x510687[_0x87f9('0xb7')],_0x3f5614));}}});return Promise[_0x87f9('0xc1')](_0x2749f8);})[_0x87f9('0x1a')](function(_0x54a269){_0xc76d5a=_0x54a269[0x0];var _0x15b34d=[];var _0x12e320=[];_0x2bb796['forEach'](function(_0x1e79b6){if(!_[_0x87f9('0xc2')](_0x1e79b6['@odata.type'])){var _0x27510f=_0x1e79b6[_0x87f9('0xbe')]['substring'](_0x1e79b6[_0x87f9('0xbe')][_0x87f9('0xbf')]('.')+0x1);if(_0x27510f===_0x87f9('0xc3')){_0x15b34d[_0x87f9('0xc0')](getBooleanList(_0x55b04e,_0x345362,_0x12e320,_0x21ba5f[_0x87f9('0xb7')],_0x1e79b6[_0x87f9('0xb7')],_0x3f5614));}}});return Promise[_0x87f9('0xc1')](_0x15b34d);})['then'](function(_0x15d0a2){_0x45490d=_0x15d0a2[0x0];var _0x58bb05=[];var _0x1ab4d7=[];_0x2bb796[_0x87f9('0xbd')](function(_0x467099){if(_0x467099[_0x87f9('0xbe')]){var _0x50bd11=_0x467099['@odata.type'][_0x87f9('0xab')](_0x467099[_0x87f9('0xbe')][_0x87f9('0xbf')]('.')+0x1);if(_0x50bd11===_0x87f9('0xc4')||_0x50bd11===_0x87f9('0xc5')||_0x50bd11===_0x87f9('0xc6')||_0x50bd11===_0x87f9('0xc7')||_0x50bd11===_0x87f9('0xc8')||_0x50bd11===_0x87f9('0xc9')||_0x50bd11===_0x87f9('0xca')||_0x50bd11===_0x87f9('0xcb')||_0x50bd11===_0x87f9('0xcc')||_0x50bd11===_0x87f9('0xcd')){_0x58bb05[_0x87f9('0xc0')](getInputList(_0x55b04e,_0x345362,_0x50bd11,_0x1ab4d7,_0x21ba5f['MetadataId'],_0x467099[_0x87f9('0xb7')],_0x3f5614));}}});return Promise[_0x87f9('0xc1')](_0x58bb05);})[_0x87f9('0x1a')](function(_0x1c6032){_0x775cb3=_0x1c6032[0x0];var _0x39a400=_0xc76d5a[_0x87f9('0xa5')](_0x45490d)[_0x87f9('0xa5')](_0x775cb3);var _0x4b9519={'count':_0x39a400[_0x87f9('0x40')],'rows':_0x39a400};return _0x4b9519;})[_0x87f9('0x1a')](respondWithResult(_0x1c569a,null))[_0x87f9('0x24')](function(_0x245f2d){var _0x3839ba=_0x14bf17['query'][_0x87f9('0xce')]?0x1f4:_0x245f2d['statusCode']||0x1f4;logger['error'](_0x245f2d[_0x87f9('0x31')]);delete _0x245f2d[_0x87f9('0x32')];if(_0x3839ba===0x191){_0x3839ba=0x190;}_0x1c569a[_0x87f9('0x26')](_0x3839ba)['send'](_0x14bf17[_0x87f9('0x3b')][_0x87f9('0xce')]?{'message':_0x87f9('0xcf'),'statusCode':_0x245f2d[_0x87f9('0xd0')]}:_0x245f2d);});};function getSelectList(_0x5aa65c,_0x349a7d,_0x17fbaa,_0xf2fe41,_0x42203a,_0x1c8bf9){var _0x309eb5={'method':'GET','uri':_0x5aa65c+'EntityDefinitions('+_0xf2fe41+_0x87f9('0xd1')+_0x42203a+_0x87f9('0xd2')+_0x87f9('0xd3'),'headers':{'Authorization':_0x87f9('0xb4')+_0x1c8bf9,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x309eb5)[_0x87f9('0x1a')](function(_0x3e3a67){var _0x2870e6=[];var _0x147927=_0x3e3a67[_0x87f9('0xd4')][_0x87f9('0xd5')];_0x147927[_0x87f9('0xbd')](function(_0x57d15a){_0x2870e6['push']({'name':_0x57d15a[_0x87f9('0xd6')][_0x87f9('0xd7')][_0x87f9('0xd6')],'value':String(_0x57d15a[_0x87f9('0xd8')])});});var _0x110238={'id':_0x349a7d+'_'+_0x3e3a67[_0x87f9('0xd9')],'name':_0x3e3a67[_0x87f9('0xda')][_0x87f9('0xd7')][_0x87f9('0xd6')],'custom':![],'options':_0x2870e6};_0x17fbaa['push'](_0x110238);return _0x17fbaa;});}function getBooleanList(_0x239cb4,_0x5ba0e9,_0x2de950,_0x4f1743,_0x171313,_0x5823c5){var _0x3b6430={'method':_0x87f9('0xb8'),'uri':_0x239cb4+_0x87f9('0xb9')+_0x4f1743+_0x87f9('0xd1')+_0x171313+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x87f9('0xb4')+_0x5823c5,'If-None-Match':null,'OData-Version':_0x87f9('0xb5')},'json':!![]};return rp(_0x3b6430)[_0x87f9('0x1a')](function(_0x246580){var _0xb08912=[];_0xb08912['push']({'name':_0x246580['OptionSet'][_0x87f9('0xdb')][_0x87f9('0xd6')]['UserLocalizedLabel'][_0x87f9('0xd6')],'value':_0x87f9('0xdc')},{'name':_0x246580[_0x87f9('0xd4')][_0x87f9('0xdd')][_0x87f9('0xd6')][_0x87f9('0xd7')][_0x87f9('0xd6')],'value':'false'});var _0xd7f11f={'id':_0x5ba0e9+'_'+_0x246580[_0x87f9('0xd9')],'name':_0x246580[_0x87f9('0xda')][_0x87f9('0xd7')][_0x87f9('0xd6')],'custom':![],'options':_0xb08912};_0x2de950[_0x87f9('0xc0')](_0xd7f11f);return _0x2de950;});}function getInputList(_0xc43bd6,_0xa466c2,_0x5e7b31,_0x48fd42,_0x2c1306,_0x5e1a0d,_0x2e34e4){var _0x6e2a9={'method':_0x87f9('0xb8'),'uri':_0xc43bd6+_0x87f9('0xb9')+_0x2c1306+')/Attributes('+_0x5e1a0d+')/Microsoft.Dynamics.CRM.'+_0x5e7b31+_0x87f9('0xde'),'headers':{'Authorization':_0x87f9('0xb4')+_0x2e34e4,'If-None-Match':null,'OData-Version':_0x87f9('0xb5')},'json':!![]};return rp(_0x6e2a9)[_0x87f9('0x1a')](function(_0x2c5923){var _0x540578={'id':_0xa466c2+'_'+_0x2c5923[_0x87f9('0xd9')],'name':_0x2c5923[_0x87f9('0xda')][_0x87f9('0xd7')]?_0x2c5923['DisplayName'][_0x87f9('0xd7')][_0x87f9('0xd6')]:_0x2c5923[_0x87f9('0xd9')],'custom':![],'options':[]};_0x48fd42[_0x87f9('0xc0')](_0x540578);return _0x48fd42;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 5e36443..98577d1 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 _0xbd37=['../../config/environment','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util','api','moment','bluebird','rimraf'];(function(_0x51674a,_0x77ccff){var _0x13fca6=function(_0x3d6c27){while(--_0x3d6c27){_0x51674a['push'](_0x51674a['shift']());}};_0x13fca6(++_0x77ccff);}(_0xbd37,0x1de));var _0x7bd3=function(_0x2c508c,_0x2a365b){_0x2c508c=_0x2c508c-0x0;var _0x5af45a=_0xbd37[_0x2c508c];return _0x5af45a;};'use strict';var _=require(_0x7bd3('0x0'));var util=require(_0x7bd3('0x1'));var logger=require('../../config/logger')(_0x7bd3('0x2'));var moment=require(_0x7bd3('0x3'));var BPromise=require(_0x7bd3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7bd3('0x5'));var config=require(_0x7bd3('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x7bd3('0x7')]=function(_0x218c6a,_0x390473){return _0x218c6a[_0x7bd3('0x8')](_0x7bd3('0x9'),attributes,{'tableName':_0x7bd3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93ae=['moment','bluebird','path','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger','api'];(function(_0x236029,_0x5d4c17){var _0x350df5=function(_0x551862){while(--_0x551862){_0x236029['push'](_0x236029['shift']());}};_0x350df5(++_0x5d4c17);}(_0x93ae,0x10f));var _0xe93a=function(_0x4e726a,_0x56f117){_0x4e726a=_0x4e726a-0x0;var _0x312e41=_0x93ae[_0x4e726a];return _0x312e41;};'use strict';var _=require(_0xe93a('0x0'));var util=require(_0xe93a('0x1'));var logger=require(_0xe93a('0x2'))(_0xe93a('0x3'));var moment=require(_0xe93a('0x4'));var BPromise=require(_0xe93a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe93a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe93a('0x7'));var integrations=require(_0xe93a('0x8'));module['exports']=function(_0x27b3d8,_0x597dd4){return _0x27b3d8['define'](_0xe93a('0x9'),attributes,{'tableName':_0xe93a('0xa'),'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 39d546b..9ffeb1c 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 _0x8ac9=['GetDynamics365Account','findAll','options','raw','where','attributes','limit','map','model','include','ShowDynamics365Account','Dynamics365Account','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','catch'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0x8ac9,0x199));var _0x98ac=function(_0x211a7b,_0x429abf){_0x211a7b=_0x211a7b-0x0;var _0x24ed23=_0x8ac9[_0x211a7b];return _0x24ed23;};'use strict';var _=require(_0x98ac('0x0'));var util=require(_0x98ac('0x1'));var moment=require(_0x98ac('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98ac('0x3'));var db=require(_0x98ac('0x4'))['db'];var utils=require(_0x98ac('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x98ac('0x6'));var jayson=require(_0x98ac('0x7'));var client=jayson[_0x98ac('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x556d23,_0x3b3780,_0x1702d6){return new BPromise(function(_0x3e025e,_0x146dc1){return client[_0x98ac('0x9')](_0x556d23,_0x1702d6)[_0x98ac('0xa')](function(_0x5bb362){logger[_0x98ac('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x3b3780,_0x98ac('0xc'));logger[_0x98ac('0xd')](_0x98ac('0xe'),_0x3b3780,_0x98ac('0xc'),JSON[_0x98ac('0xf')](_0x5bb362));if(_0x5bb362[_0x98ac('0x10')]){if(_0x5bb362[_0x98ac('0x10')]['code']===0x1f4){logger['error'](_0x98ac('0x11'),_0x3b3780,_0x5bb362[_0x98ac('0x10')][_0x98ac('0x12')]);return _0x146dc1(_0x5bb362[_0x98ac('0x10')]['message']);}logger[_0x98ac('0x10')](_0x98ac('0x11'),_0x3b3780,_0x5bb362[_0x98ac('0x10')]['message']);return _0x3e025e(_0x5bb362['error'][_0x98ac('0x12')]);}else{logger[_0x98ac('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x3b3780,'request\x20sent');_0x3e025e(_0x5bb362['result'][_0x98ac('0x12')]);}})[_0x98ac('0x13')](function(_0x5634c4){logger[_0x98ac('0x10')](_0x98ac('0x11'),_0x3b3780,_0x5634c4);_0x146dc1(_0x5634c4);});});}exports[_0x98ac('0x14')]=function(_0x4b907e){var _0x4715c9=this;return new Promise(function(_0x42f64e,_0x225024){return db['Dynamics365Account'][_0x98ac('0x15')]({'raw':_0x4b907e[_0x98ac('0x16')]?_0x4b907e[_0x98ac('0x16')][_0x98ac('0x17')]===undefined?!![]:![]:!![],'where':_0x4b907e['options']?_0x4b907e['options'][_0x98ac('0x18')]||null:null,'attributes':_0x4b907e[_0x98ac('0x16')]?_0x4b907e[_0x98ac('0x16')][_0x98ac('0x19')]||null:null,'limit':_0x4b907e[_0x98ac('0x16')]?_0x4b907e[_0x98ac('0x16')][_0x98ac('0x1a')]||null:null,'include':_0x4b907e[_0x98ac('0x16')]?_0x4b907e[_0x98ac('0x16')]['include']?_[_0x98ac('0x1b')](_0x4b907e[_0x98ac('0x16')]['include'],function(_0x92f4bc){return{'model':db[_0x92f4bc[_0x98ac('0x1c')]],'as':_0x92f4bc['as'],'attributes':_0x92f4bc['attributes'],'include':_0x92f4bc[_0x98ac('0x1d')]?_[_0x98ac('0x1b')](_0x92f4bc[_0x98ac('0x1d')],function(_0x5887ee){return{'model':db[_0x5887ee[_0x98ac('0x1c')]],'as':_0x5887ee['as'],'attributes':_0x5887ee[_0x98ac('0x19')],'include':_0x5887ee[_0x98ac('0x1d')]?_[_0x98ac('0x1b')](_0x5887ee[_0x98ac('0x1d')],function(_0x293c63){return{'model':db[_0x293c63[_0x98ac('0x1c')]],'as':_0x293c63['as'],'attributes':_0x293c63[_0x98ac('0x19')]};}):[]};}):[]};}):[]:[]})[_0x98ac('0xa')](function(_0x1caa3f){logger['info'](_0x98ac('0x14'),_0x4b907e);logger[_0x98ac('0xd')](_0x98ac('0x14'),_0x4b907e,JSON[_0x98ac('0xf')](_0x1caa3f));_0x42f64e(_0x1caa3f);})[_0x98ac('0x13')](function(_0x4305f3){logger[_0x98ac('0x10')]('GetDynamics365Account',_0x4305f3['message'],_0x4b907e);_0x225024(_0x4715c9[_0x98ac('0x10')](0x1f4,_0x4305f3[_0x98ac('0x12')]));});});};exports[_0x98ac('0x1e')]=function(_0x45c5cb){var _0x2c57b1=this;return new Promise(function(_0x19f4f9,_0x67ca39){return db[_0x98ac('0x1f')][_0x98ac('0x20')]({'raw':_0x45c5cb[_0x98ac('0x16')]?_0x45c5cb['options']['raw']===undefined?!![]:![]:!![],'where':_0x45c5cb[_0x98ac('0x16')]?_0x45c5cb['options'][_0x98ac('0x18')]||null:null,'attributes':_0x45c5cb['options']?_0x45c5cb[_0x98ac('0x16')][_0x98ac('0x19')]||null:null,'include':_0x45c5cb['options']?_0x45c5cb[_0x98ac('0x16')]['include']?_[_0x98ac('0x1b')](_0x45c5cb[_0x98ac('0x16')][_0x98ac('0x1d')],function(_0xcf88da){return{'model':db[_0xcf88da[_0x98ac('0x1c')]],'as':_0xcf88da['as'],'attributes':_0xcf88da[_0x98ac('0x19')],'include':_0xcf88da[_0x98ac('0x1d')]?_[_0x98ac('0x1b')](_0xcf88da['include'],function(_0xe9c537){return{'model':db[_0xe9c537[_0x98ac('0x1c')]],'as':_0xe9c537['as'],'attributes':_0xe9c537[_0x98ac('0x19')],'include':_0xe9c537[_0x98ac('0x1d')]?_[_0x98ac('0x1b')](_0xe9c537[_0x98ac('0x1d')],function(_0x37b0ad){return{'model':db[_0x37b0ad[_0x98ac('0x1c')]],'as':_0x37b0ad['as'],'attributes':_0x37b0ad[_0x98ac('0x19')]};}):[]};}):[]};}):[]:[]})[_0x98ac('0xa')](function(_0x24e4ad){logger[_0x98ac('0xb')](_0x98ac('0x1e'),_0x45c5cb);logger[_0x98ac('0xd')](_0x98ac('0x1e'),_0x45c5cb,JSON['stringify'](_0x24e4ad));_0x19f4f9(_0x24e4ad);})[_0x98ac('0x13')](function(_0x290288){logger[_0x98ac('0x10')](_0x98ac('0x1e'),_0x290288[_0x98ac('0x12')],_0x45c5cb);_0x67ca39(_0x2c57b1[_0x98ac('0x10')](0x1f4,_0x290288[_0x98ac('0x12')]));});});}; \ No newline at end of file +var _0x2706=['options','raw','where','attributes','limit','include','map','model','catch','ShowDynamics365Account','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','GetDynamics365Account','Dynamics365Account','findAll'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x2706,0x107));var _0x6270=function(_0x33fe27,_0x302350){_0x33fe27=_0x33fe27-0x0;var _0x38b47a=_0x2706[_0x33fe27];return _0x38b47a;};'use strict';var _=require('lodash');var util=require(_0x6270('0x0'));var moment=require(_0x6270('0x1'));var BPromise=require(_0x6270('0x2'));var rs=require(_0x6270('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6270('0x4'))['db'];var utils=require(_0x6270('0x5'));var logger=require(_0x6270('0x6'))(_0x6270('0x7'));var config=require(_0x6270('0x8'));var jayson=require(_0x6270('0x9'));var client=jayson[_0x6270('0xa')][_0x6270('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fac3f,_0x4f700e,_0x2e6a1b){return new BPromise(function(_0x585bc1,_0x35a6e3){return client[_0x6270('0xc')](_0x4fac3f,_0x2e6a1b)[_0x6270('0xd')](function(_0xea69a0){logger[_0x6270('0xe')](_0x6270('0xf'),_0x4f700e,'request\x20sent');logger[_0x6270('0x10')](_0x6270('0x11'),_0x4f700e,_0x6270('0x12'),JSON[_0x6270('0x13')](_0xea69a0));if(_0xea69a0[_0x6270('0x14')]){if(_0xea69a0['error']['code']===0x1f4){logger[_0x6270('0x14')](_0x6270('0xf'),_0x4f700e,_0xea69a0['error']['message']);return _0x35a6e3(_0xea69a0['error'][_0x6270('0x15')]);}logger['error'](_0x6270('0xf'),_0x4f700e,_0xea69a0['error']['message']);return _0x585bc1(_0xea69a0['error'][_0x6270('0x15')]);}else{logger[_0x6270('0xe')](_0x6270('0xf'),_0x4f700e,'request\x20sent');_0x585bc1(_0xea69a0['result'][_0x6270('0x15')]);}})['catch'](function(_0x26ceb9){logger[_0x6270('0x14')](_0x6270('0xf'),_0x4f700e,_0x26ceb9);_0x35a6e3(_0x26ceb9);});});}exports[_0x6270('0x16')]=function(_0x2c87c9){var _0x5f1eb4=this;return new Promise(function(_0x3ba0f4,_0x4daec2){return db[_0x6270('0x17')][_0x6270('0x18')]({'raw':_0x2c87c9[_0x6270('0x19')]?_0x2c87c9[_0x6270('0x19')][_0x6270('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c87c9[_0x6270('0x19')]?_0x2c87c9[_0x6270('0x19')][_0x6270('0x1b')]||null:null,'attributes':_0x2c87c9[_0x6270('0x19')]?_0x2c87c9[_0x6270('0x19')][_0x6270('0x1c')]||null:null,'limit':_0x2c87c9[_0x6270('0x19')]?_0x2c87c9['options'][_0x6270('0x1d')]||null:null,'include':_0x2c87c9[_0x6270('0x19')]?_0x2c87c9[_0x6270('0x19')][_0x6270('0x1e')]?_[_0x6270('0x1f')](_0x2c87c9[_0x6270('0x19')][_0x6270('0x1e')],function(_0x564398){return{'model':db[_0x564398[_0x6270('0x20')]],'as':_0x564398['as'],'attributes':_0x564398[_0x6270('0x1c')],'include':_0x564398[_0x6270('0x1e')]?_['map'](_0x564398[_0x6270('0x1e')],function(_0x4099d6){return{'model':db[_0x4099d6[_0x6270('0x20')]],'as':_0x4099d6['as'],'attributes':_0x4099d6[_0x6270('0x1c')],'include':_0x4099d6[_0x6270('0x1e')]?_[_0x6270('0x1f')](_0x4099d6['include'],function(_0x3bd0f9){return{'model':db[_0x3bd0f9[_0x6270('0x20')]],'as':_0x3bd0f9['as'],'attributes':_0x3bd0f9[_0x6270('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6270('0xd')](function(_0x1d1450){logger['info']('GetDynamics365Account',_0x2c87c9);logger[_0x6270('0x10')]('GetDynamics365Account',_0x2c87c9,JSON[_0x6270('0x13')](_0x1d1450));_0x3ba0f4(_0x1d1450);})[_0x6270('0x21')](function(_0x5b027b){logger['error'](_0x6270('0x16'),_0x5b027b['message'],_0x2c87c9);_0x4daec2(_0x5f1eb4[_0x6270('0x14')](0x1f4,_0x5b027b[_0x6270('0x15')]));});});};exports[_0x6270('0x22')]=function(_0x24c63f){var _0x2a0164=this;return new Promise(function(_0x51a8eb,_0x289493){return db[_0x6270('0x17')][_0x6270('0x23')]({'raw':_0x24c63f[_0x6270('0x19')]?_0x24c63f[_0x6270('0x19')][_0x6270('0x1a')]===undefined?!![]:![]:!![],'where':_0x24c63f[_0x6270('0x19')]?_0x24c63f[_0x6270('0x19')][_0x6270('0x1b')]||null:null,'attributes':_0x24c63f['options']?_0x24c63f[_0x6270('0x19')][_0x6270('0x1c')]||null:null,'include':_0x24c63f['options']?_0x24c63f[_0x6270('0x19')]['include']?_[_0x6270('0x1f')](_0x24c63f[_0x6270('0x19')][_0x6270('0x1e')],function(_0x3796c3){return{'model':db[_0x3796c3[_0x6270('0x20')]],'as':_0x3796c3['as'],'attributes':_0x3796c3[_0x6270('0x1c')],'include':_0x3796c3[_0x6270('0x1e')]?_[_0x6270('0x1f')](_0x3796c3['include'],function(_0x57394e){return{'model':db[_0x57394e[_0x6270('0x20')]],'as':_0x57394e['as'],'attributes':_0x57394e[_0x6270('0x1c')],'include':_0x57394e[_0x6270('0x1e')]?_[_0x6270('0x1f')](_0x57394e[_0x6270('0x1e')],function(_0x562bf9){return{'model':db[_0x562bf9[_0x6270('0x20')]],'as':_0x562bf9['as'],'attributes':_0x562bf9[_0x6270('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6270('0xd')](function(_0x5967bd){logger['info']('ShowDynamics365Account',_0x24c63f);logger[_0x6270('0x10')](_0x6270('0x22'),_0x24c63f,JSON[_0x6270('0x13')](_0x5967bd));_0x51a8eb(_0x5967bd);})['catch'](function(_0x34200a){logger[_0x6270('0x14')]('ShowDynamics365Account',_0x34200a[_0x6270('0x15')],_0x24c63f);_0x289493(_0x2a0164[_0x6270('0x14')](0x1f4,_0x34200a['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 77ce2f1..7acfd34 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 _0xc583=['getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','show','/:id/fields'];(function(_0x1451ac,_0x57506d){var _0x56b918=function(_0x149d4c){while(--_0x149d4c){_0x1451ac['push'](_0x1451ac['shift']());}};_0x56b918(++_0x57506d);}(_0xc583,0x140));var _0x3c58=function(_0xe9ff89,_0x1f7a2e){_0xe9ff89=_0xe9ff89-0x0;var _0x3f2f9c=_0xc583[_0xe9ff89];return _0x3f2f9c;};'use strict';var multer=require(_0x3c58('0x0'));var util=require(_0x3c58('0x1'));var path=require(_0x3c58('0x2'));var timeout=require(_0x3c58('0x3'));var express=require(_0x3c58('0x4'));var router=express[_0x3c58('0x5')]();var fs_extra=require(_0x3c58('0x6'));var auth=require(_0x3c58('0x7'));var interaction=require(_0x3c58('0x8'));var config=require(_0x3c58('0x9'));var controller=require(_0x3c58('0xa'));router['get']('/',auth[_0x3c58('0xb')](),controller[_0x3c58('0xc')]);router[_0x3c58('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3c58('0xe')]);router[_0x3c58('0xd')](_0x3c58('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x3c58('0xd')]('/:id/subjects',auth[_0x3c58('0xb')](),controller[_0x3c58('0x10')]);router[_0x3c58('0xd')](_0x3c58('0x11'),auth[_0x3c58('0xb')](),controller[_0x3c58('0x12')]);router[_0x3c58('0x13')]('/',auth[_0x3c58('0xb')](),controller[_0x3c58('0x14')]);router[_0x3c58('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x3c58('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3c58('0x17')]);module['exports']=router; \ No newline at end of file +var _0x14ed=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x14ed,0x155));var _0xd14e=function(_0x553faf,_0x44ed98){_0x553faf=_0x553faf-0x0;var _0x2dafaa=_0x14ed[_0x553faf];return _0x2dafaa;};'use strict';var multer=require(_0xd14e('0x0'));var util=require(_0xd14e('0x1'));var path=require(_0xd14e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd14e('0x3')]();var fs_extra=require(_0xd14e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd14e('0x5'));var config=require(_0xd14e('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0xd14e('0x7')]('/',auth[_0xd14e('0x8')](),controller[_0xd14e('0x9')]);router[_0xd14e('0x7')]('/:id',auth[_0xd14e('0x8')](),controller[_0xd14e('0xa')]);router[_0xd14e('0x7')]('/:id/fields',auth[_0xd14e('0x8')](),controller['getFields']);router['get'](_0xd14e('0xb'),auth[_0xd14e('0x8')](),controller[_0xd14e('0xc')]);router[_0xd14e('0x7')](_0xd14e('0xd'),auth[_0xd14e('0x8')](),controller[_0xd14e('0xe')]);router[_0xd14e('0xf')]('/',auth['isAuthenticated'](),controller[_0xd14e('0x10')]);router[_0xd14e('0x11')](_0xd14e('0x12'),auth[_0xd14e('0x8')](),controller[_0xd14e('0x13')]);router['delete'](_0xd14e('0x12'),auth[_0xd14e('0x8')](),controller[_0xd14e('0x14')]);module[_0xd14e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 2788c5b..c1bdbaa 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 _0x060c=['sequelize','exports','STRING','ENUM','incident','phonecall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x060c,0x84));var _0xc060=function(_0x13dc7f,_0x57ca98){_0x13dc7f=_0x13dc7f-0x0;var _0x26f6ae=_0x060c[_0x13dc7f];return _0x26f6ae;};'use strict';var Sequelize=require(_0xc060('0x0'));module[_0xc060('0x1')]={'name':{'type':Sequelize[_0xc060('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xc060('0x3')](_0xc060('0x4'),_0xc060('0x5')),'defaultValue':_0xc060('0x4')}}; \ No newline at end of file +var _0x3972=['phonecall','sequelize','exports','STRING','ENUM','incident'];(function(_0x461739,_0x19e3ab){var _0xab4001=function(_0x51f7f1){while(--_0x51f7f1){_0x461739['push'](_0x461739['shift']());}};_0xab4001(++_0x19e3ab);}(_0x3972,0x1cf));var _0x2397=function(_0x35d24a,_0x4812f7){_0x35d24a=_0x35d24a-0x0;var _0x31b2e0=_0x3972[_0x35d24a];return _0x31b2e0;};'use strict';var Sequelize=require(_0x2397('0x0'));module[_0x2397('0x1')]={'name':{'type':Sequelize[_0x2397('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x2397('0x3')](_0x2397('0x4'),_0x2397('0x5')),'defaultValue':'incident'}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 2c8e585..ee12ec8 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 _0xb32f=['show','params','keys','includeAll','merge','find','create','body','Dynamics365Field','getFields','getSubjects','findOne','pick','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','Dynamics365Configuration','include','rows'];(function(_0x3a4d84,_0x28376c){var _0x58d3f4=function(_0xbf2d90){while(--_0xbf2d90){_0x3a4d84['push'](_0x3a4d84['shift']());}};_0x58d3f4(++_0x28376c);}(_0xb32f,0x119));var _0xfb32=function(_0x3dee66,_0x27faa3){_0x3dee66=_0x3dee66-0x0;var _0x4063dc=_0xb32f[_0x3dee66];return _0x4063dc;};'use strict';var emlformat=require(_0xfb32('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfb32('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb32('0x2'));var moment=require(_0xfb32('0x3'));var BPromise=require(_0xfb32('0x4'));var Mustache=require('mustache');var util=require(_0xfb32('0x5'));var path=require(_0xfb32('0x6'));var sox=require(_0xfb32('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb32('0x8'));var _=require('lodash');var squel=require(_0xfb32('0x9'));var crypto=require(_0xfb32('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfb32('0xb'));var querystring=require('querystring');var Papa=require(_0xfb32('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfb32('0xd'));var as=require(_0xfb32('0xe'));var hardwareService=require(_0xfb32('0xf'));var logger=require(_0xfb32('0x10'))(_0xfb32('0x11'));var utils=require(_0xfb32('0x12'));var config=require(_0xfb32('0x13'));var licenseUtil=require(_0xfb32('0x14'));var db=require(_0xfb32('0x15'))['db'];var jayson=require(_0xfb32('0x16'));var client=jayson[_0xfb32('0x17')][_0xfb32('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3965ea,_0xe90e61,_0x1b4839,_0x3debf9){return new BPromise(function(_0x59dd3c,_0x584fd5){var _0xf0cb33=_0x3debf9||client;return _0xf0cb33['request'](_0x3965ea,_0x1b4839)['then'](function(_0x2cfc3d){logger[_0xfb32('0x19')](_0xfb32('0x1a'),_0xe90e61,_0xfb32('0x1b'));logger['debug'](_0xfb32('0x1c'),_0xe90e61,_0xfb32('0x1b'),JSON[_0xfb32('0x1d')](_0x2cfc3d));if(_0x2cfc3d[_0xfb32('0x1e')]){if(_0x2cfc3d['error']['code']===0x1f4){logger[_0xfb32('0x1e')](_0xfb32('0x1a'),_0xe90e61,_0x2cfc3d[_0xfb32('0x1e')]['message']);return _0x584fd5(_0x2cfc3d[_0xfb32('0x1e')][_0xfb32('0x1f')]);}logger[_0xfb32('0x1e')]('Dynamics365Configuration,\x20%s,\x20%s',_0xe90e61,_0x2cfc3d[_0xfb32('0x1e')]['message']);return _0x59dd3c(_0x2cfc3d[_0xfb32('0x1e')][_0xfb32('0x1f')]);}else{logger['info'](_0xfb32('0x1a'),_0xe90e61,_0xfb32('0x1b'));_0x59dd3c(_0x2cfc3d['result'][_0xfb32('0x1f')]);}})[_0xfb32('0x20')](function(_0x4b235c){logger['error'](_0xfb32('0x1a'),_0xe90e61,_0x4b235c);_0x584fd5(_0x4b235c);});});}function respondWithStatusCode(_0x46934f,_0x104e71){_0x104e71=_0x104e71||0xcc;return function(_0x3ee69e){if(_0x3ee69e){return _0x46934f[_0xfb32('0x21')](_0x104e71);}return _0x46934f[_0xfb32('0x22')](_0x104e71)[_0xfb32('0x23')]();};}function respondWithResult(_0x4ffe40,_0x350999){_0x350999=_0x350999||0xc8;return function(_0x215c57){if(_0x215c57){return _0x4ffe40[_0xfb32('0x22')](_0x350999)[_0xfb32('0x24')](_0x215c57);}};}function respondWithFilteredResult(_0x2a01ee,_0x5a7efb){return function(_0x58c76c){if(_0x58c76c){var _0x34c494=typeof _0x5a7efb[_0xfb32('0x25')]==='undefined'&&typeof _0x5a7efb[_0xfb32('0x26')]===_0xfb32('0x27');var _0x174e40=_0x58c76c[_0xfb32('0x28')];var _0x3729fa=_0x34c494?0x0:_0x5a7efb[_0xfb32('0x25')];var _0x2a015d=_0x34c494?_0x58c76c['count']:_0x5a7efb['offset']+_0x5a7efb[_0xfb32('0x26')];var _0x14325c;if(_0x2a015d>=_0x174e40){_0x2a015d=_0x174e40;_0x14325c=0xc8;}else{_0x14325c=0xce;}_0x2a01ee[_0xfb32('0x22')](_0x14325c);return _0x2a01ee[_0xfb32('0x29')](_0xfb32('0x2a'),_0x3729fa+'-'+_0x2a015d+'/'+_0x174e40)[_0xfb32('0x24')](_0x58c76c);}return null;};}function patchUpdates(_0x6460f6){return function(_0x52b434){try{jsonpatch[_0xfb32('0x2b')](_0x52b434,_0x6460f6,!![]);}catch(_0x7a58ae){return BPromise[_0xfb32('0x2c')](_0x7a58ae);}return _0x52b434['save']();};}function saveUpdates(_0x2fd7fa,_0x1c322a){return function(_0x481ae6){if(_0x481ae6){return _0x481ae6[_0xfb32('0x2d')](_0x2fd7fa)[_0xfb32('0x2e')](function(_0x5c69f5){return _0x5c69f5;});}return null;};}function removeEntity(_0x94aa25,_0x55b5cd){return function(_0x188750){if(_0x188750){return _0x188750[_0xfb32('0x2f')]()[_0xfb32('0x2e')](function(){_0x94aa25[_0xfb32('0x22')](0xcc)[_0xfb32('0x23')]();});}};}function handleEntityNotFound(_0x18ff43,_0x3c2e1d){return function(_0x2adcbb){if(!_0x2adcbb){_0x18ff43[_0xfb32('0x21')](0x194);}return _0x2adcbb;};}function handleError(_0x5c765c,_0x91e3b5){_0x91e3b5=_0x91e3b5||0x1f4;return function(_0x3f9071){logger[_0xfb32('0x1e')](_0x3f9071[_0xfb32('0x30')]);if(_0x3f9071['name']){delete _0x3f9071[_0xfb32('0x31')];}_0x5c765c[_0xfb32('0x22')](_0x91e3b5)[_0xfb32('0x32')](_0x3f9071);};}exports[_0xfb32('0x33')]=function(_0xd24fd2,_0x2adc2a){var _0x593248={},_0x52bc41={},_0x1ce665={'count':0x0,'rows':[]};var _0x20046a=_['map'](db['Dynamics365Configuration'][_0xfb32('0x34')],function(_0x57958b){return{'name':_0x57958b[_0xfb32('0x35')],'type':_0x57958b[_0xfb32('0x36')][_0xfb32('0x37')]};});_0x52bc41[_0xfb32('0x38')]=_[_0xfb32('0x39')](_0x20046a,_0xfb32('0x31'));_0x52bc41[_0xfb32('0x3a')]=_['keys'](_0xd24fd2[_0xfb32('0x3a')]);_0x52bc41[_0xfb32('0x3b')]=_[_0xfb32('0x3c')](_0x52bc41['model'],_0x52bc41[_0xfb32('0x3a')]);_0x593248[_0xfb32('0x3d')]=_['intersection'](_0x52bc41[_0xfb32('0x38')],qs['fields'](_0xd24fd2[_0xfb32('0x3a')][_0xfb32('0x3e')]));_0x593248[_0xfb32('0x3d')]=_0x593248[_0xfb32('0x3d')][_0xfb32('0x3f')]?_0x593248[_0xfb32('0x3d')]:_0x52bc41['model'];if(!_0xd24fd2['query'][_0xfb32('0x40')](_0xfb32('0x41'))){_0x593248['limit']=qs[_0xfb32('0x26')](_0xd24fd2[_0xfb32('0x3a')][_0xfb32('0x26')]);_0x593248[_0xfb32('0x25')]=qs[_0xfb32('0x25')](_0xd24fd2['query'][_0xfb32('0x25')]);}_0x593248[_0xfb32('0x42')]=qs[_0xfb32('0x43')](_0xd24fd2[_0xfb32('0x3a')][_0xfb32('0x43')]);_0x593248[_0xfb32('0x44')]=qs[_0xfb32('0x3b')](_['pick'](_0xd24fd2[_0xfb32('0x3a')],_0x52bc41[_0xfb32('0x3b')]),_0x20046a);if(_0xd24fd2['query'][_0xfb32('0x45')]){_0x593248['where']=_['merge'](_0x593248[_0xfb32('0x44')],{'$or':_[_0xfb32('0x39')](_0x20046a,function(_0x44e5cf){if(_0x44e5cf[_0xfb32('0x36')]!==_0xfb32('0x46')){var _0x338ea3={};_0x338ea3[_0x44e5cf[_0xfb32('0x31')]]={'$like':'%'+_0xd24fd2['query'][_0xfb32('0x45')]+'%'};return _0x338ea3;}})});}_0x593248=_['merge']({},_0x593248,_0xd24fd2[_0xfb32('0x47')]);var _0x243028={'where':_0x593248[_0xfb32('0x44')]};return db[_0xfb32('0x48')][_0xfb32('0x28')](_0x243028)[_0xfb32('0x2e')](function(_0x42b4c8){_0x1ce665[_0xfb32('0x28')]=_0x42b4c8;if(_0xd24fd2[_0xfb32('0x3a')]['includeAll']){_0x593248[_0xfb32('0x49')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x593248);})[_0xfb32('0x2e')](function(_0x543ddc){_0x1ce665[_0xfb32('0x4a')]=_0x543ddc;return _0x1ce665;})[_0xfb32('0x2e')](respondWithFilteredResult(_0x2adc2a,_0x593248))[_0xfb32('0x20')](handleError(_0x2adc2a,null));};exports[_0xfb32('0x4b')]=function(_0x347919,_0x46dc0b){var _0x262756={'raw':![],'where':{'id':_0x347919[_0xfb32('0x4c')]['id']}},_0x4adaad={};_0x4adaad['model']=_[_0xfb32('0x4d')](db[_0xfb32('0x48')][_0xfb32('0x34')]);_0x4adaad[_0xfb32('0x3a')]=_['keys'](_0x347919[_0xfb32('0x3a')]);_0x4adaad['filters']=_[_0xfb32('0x3c')](_0x4adaad[_0xfb32('0x38')],_0x4adaad[_0xfb32('0x3a')]);_0x262756['attributes']=_[_0xfb32('0x3c')](_0x4adaad[_0xfb32('0x38')],qs[_0xfb32('0x3e')](_0x347919['query'][_0xfb32('0x3e')]));_0x262756[_0xfb32('0x3d')]=_0x262756[_0xfb32('0x3d')][_0xfb32('0x3f')]?_0x262756[_0xfb32('0x3d')]:_0x4adaad[_0xfb32('0x38')];if(_0x347919[_0xfb32('0x3a')][_0xfb32('0x4e')]){_0x262756[_0xfb32('0x49')]=[{'all':!![]}];}_0x262756=_[_0xfb32('0x4f')]({},_0x262756,_0x347919['options']);return db[_0xfb32('0x48')][_0xfb32('0x50')](_0x262756)[_0xfb32('0x2e')](handleEntityNotFound(_0x46dc0b,null))['then'](respondWithResult(_0x46dc0b,null))[_0xfb32('0x20')](handleError(_0x46dc0b,null));};exports[_0xfb32('0x51')]=function(_0x44c43f,_0x18f2ee){return db['Dynamics365Configuration']['create'](_0x44c43f[_0xfb32('0x52')],{})[_0xfb32('0x2e')](respondWithResult(_0x18f2ee,0xc9))[_0xfb32('0x20')](handleError(_0x18f2ee,null));};exports[_0xfb32('0x2d')]=function(_0x236cca,_0x42413f){if(_0x236cca[_0xfb32('0x52')]['id']){delete _0x236cca[_0xfb32('0x52')]['id'];}return db[_0xfb32('0x48')][_0xfb32('0x50')]({'where':{'id':_0x236cca[_0xfb32('0x4c')]['id']}})[_0xfb32('0x2e')](handleEntityNotFound(_0x42413f,null))[_0xfb32('0x2e')](saveUpdates(_0x236cca[_0xfb32('0x52')],null))[_0xfb32('0x2e')](respondWithResult(_0x42413f,null))[_0xfb32('0x20')](handleError(_0x42413f,null));};exports[_0xfb32('0x2f')]=function(_0x43aa4a,_0x5b8228){return db[_0xfb32('0x48')][_0xfb32('0x50')]({'where':{'id':_0x43aa4a[_0xfb32('0x4c')]['id']}})[_0xfb32('0x2e')](handleEntityNotFound(_0x5b8228,null))[_0xfb32('0x2e')](removeEntity(_0x5b8228,null))[_0xfb32('0x20')](handleError(_0x5b8228,null));};exports['getFields']=function(_0x330d5a,_0x4b5428,_0x51a9ac){var _0x31da5e={};var _0x69b2ff={};var _0x2e7fac;var _0x37ad11;return db[_0xfb32('0x48')]['findOne']({'where':{'id':_0x330d5a[_0xfb32('0x4c')]['id']}})[_0xfb32('0x2e')](handleEntityNotFound(_0x4b5428,null))[_0xfb32('0x2e')](function(_0x33d298){if(_0x33d298){_0x2e7fac=_0x33d298;_0x69b2ff[_0xfb32('0x38')]=_[_0xfb32('0x4d')](db[_0xfb32('0x53')][_0xfb32('0x34')]);_0x69b2ff[_0xfb32('0x3a')]=_[_0xfb32('0x4d')](_0x330d5a['query']);_0x69b2ff['filters']=_['intersection'](_0x69b2ff[_0xfb32('0x38')],_0x69b2ff[_0xfb32('0x3a')]);_0x31da5e[_0xfb32('0x3d')]=_[_0xfb32('0x3c')](_0x69b2ff[_0xfb32('0x38')],qs[_0xfb32('0x3e')](_0x330d5a[_0xfb32('0x3a')][_0xfb32('0x3e')]));_0x31da5e['attributes']=_0x31da5e[_0xfb32('0x3d')][_0xfb32('0x3f')]?_0x31da5e[_0xfb32('0x3d')]:_0x69b2ff[_0xfb32('0x38')];_0x31da5e[_0xfb32('0x42')]=qs['sort'](_0x330d5a[_0xfb32('0x3a')][_0xfb32('0x43')]);_0x31da5e[_0xfb32('0x44')]=qs[_0xfb32('0x3b')](_['pick'](_0x330d5a['query'],_0x69b2ff['filters']));if(_0x330d5a[_0xfb32('0x3a')]['filter']){_0x31da5e[_0xfb32('0x44')]=_['merge'](_0x31da5e['where'],{'$or':_[_0xfb32('0x39')](_0x31da5e[_0xfb32('0x3d')],function(_0x40a9a9){var _0x35d15e={};_0x35d15e[_0x40a9a9]={'$like':'%'+_0x330d5a[_0xfb32('0x3a')][_0xfb32('0x45')]+'%'};return _0x35d15e;})});}_0x31da5e=_['merge']({},_0x31da5e,_0x330d5a['options']);return _0x2e7fac['getFields'](_0x31da5e);}})[_0xfb32('0x2e')](function(_0xb9ed59){if(_0xb9ed59){_0x37ad11=_0xb9ed59[_0xfb32('0x3f')];if(!_0x330d5a['query'][_0xfb32('0x40')]('nolimit')){_0x31da5e[_0xfb32('0x26')]=qs[_0xfb32('0x26')](_0x330d5a['query']['limit']);_0x31da5e[_0xfb32('0x25')]=qs[_0xfb32('0x25')](_0x330d5a[_0xfb32('0x3a')][_0xfb32('0x25')]);}return _0x2e7fac[_0xfb32('0x54')](_0x31da5e);}})[_0xfb32('0x2e')](function(_0x46145c){if(_0x46145c){return _0x46145c?{'count':_0x37ad11,'rows':_0x46145c}:null;}})['then'](respondWithResult(_0x4b5428,null))[_0xfb32('0x20')](handleError(_0x4b5428,null));};exports[_0xfb32('0x55')]=function(_0x49d40d,_0xe9ac4a,_0x11ba52){var _0x4c07d1={};var _0xf72e60={};var _0x21f95e;var _0x5d58f5;return db[_0xfb32('0x48')][_0xfb32('0x56')]({'where':{'id':_0x49d40d['params']['id']}})[_0xfb32('0x2e')](handleEntityNotFound(_0xe9ac4a,null))[_0xfb32('0x2e')](function(_0x186239){if(_0x186239){_0x21f95e=_0x186239;_0xf72e60[_0xfb32('0x38')]=_[_0xfb32('0x4d')](db[_0xfb32('0x53')][_0xfb32('0x34')]);_0xf72e60[_0xfb32('0x3a')]=_['keys'](_0x49d40d['query']);_0xf72e60[_0xfb32('0x3b')]=_[_0xfb32('0x3c')](_0xf72e60[_0xfb32('0x38')],_0xf72e60['query']);_0x4c07d1[_0xfb32('0x3d')]=_[_0xfb32('0x3c')](_0xf72e60[_0xfb32('0x38')],qs[_0xfb32('0x3e')](_0x49d40d[_0xfb32('0x3a')][_0xfb32('0x3e')]));_0x4c07d1[_0xfb32('0x3d')]=_0x4c07d1[_0xfb32('0x3d')][_0xfb32('0x3f')]?_0x4c07d1[_0xfb32('0x3d')]:_0xf72e60['model'];_0x4c07d1['order']=qs[_0xfb32('0x43')](_0x49d40d[_0xfb32('0x3a')]['sort']);_0x4c07d1[_0xfb32('0x44')]=qs[_0xfb32('0x3b')](_[_0xfb32('0x57')](_0x49d40d[_0xfb32('0x3a')],_0xf72e60[_0xfb32('0x3b')]));if(_0x49d40d[_0xfb32('0x3a')]['filter']){_0x4c07d1[_0xfb32('0x44')]=_[_0xfb32('0x4f')](_0x4c07d1[_0xfb32('0x44')],{'$or':_[_0xfb32('0x39')](_0x4c07d1[_0xfb32('0x3d')],function(_0x11b47f){var _0xce4eb6={};_0xce4eb6[_0x11b47f]={'$like':'%'+_0x49d40d[_0xfb32('0x3a')]['filter']+'%'};return _0xce4eb6;})});}_0x4c07d1=_[_0xfb32('0x4f')]({},_0x4c07d1,_0x49d40d[_0xfb32('0x47')]);return _0x21f95e['getSubjects'](_0x4c07d1);}})[_0xfb32('0x2e')](function(_0x30751e){if(_0x30751e){_0x5d58f5=_0x30751e[_0xfb32('0x3f')];if(!_0x49d40d[_0xfb32('0x3a')][_0xfb32('0x40')](_0xfb32('0x41'))){_0x4c07d1[_0xfb32('0x26')]=qs[_0xfb32('0x26')](_0x49d40d[_0xfb32('0x3a')][_0xfb32('0x26')]);_0x4c07d1['offset']=qs['offset'](_0x49d40d[_0xfb32('0x3a')][_0xfb32('0x25')]);}return _0x21f95e[_0xfb32('0x55')](_0x4c07d1);}})[_0xfb32('0x2e')](function(_0x1b5450){if(_0x1b5450){return _0x1b5450?{'count':_0x5d58f5,'rows':_0x1b5450}:null;}})[_0xfb32('0x2e')](respondWithResult(_0xe9ac4a,null))[_0xfb32('0x20')](handleError(_0xe9ac4a,null));};exports[_0xfb32('0x58')]=function(_0x51e8b2,_0x4563ae,_0x1c5992){var _0x1fdc45={};var _0x3aa21d={};var _0x56e45d;var _0x33caf3;return db['Dynamics365Configuration'][_0xfb32('0x56')]({'where':{'id':_0x51e8b2[_0xfb32('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4563ae,null))['then'](function(_0x126acd){if(_0x126acd){_0x56e45d=_0x126acd;_0x3aa21d[_0xfb32('0x38')]=_[_0xfb32('0x4d')](db[_0xfb32('0x53')]['rawAttributes']);_0x3aa21d['query']=_[_0xfb32('0x4d')](_0x51e8b2[_0xfb32('0x3a')]);_0x3aa21d[_0xfb32('0x3b')]=_[_0xfb32('0x3c')](_0x3aa21d[_0xfb32('0x38')],_0x3aa21d['query']);_0x1fdc45[_0xfb32('0x3d')]=_[_0xfb32('0x3c')](_0x3aa21d[_0xfb32('0x38')],qs[_0xfb32('0x3e')](_0x51e8b2['query']['fields']));_0x1fdc45[_0xfb32('0x3d')]=_0x1fdc45['attributes']['length']?_0x1fdc45[_0xfb32('0x3d')]:_0x3aa21d[_0xfb32('0x38')];_0x1fdc45[_0xfb32('0x42')]=qs[_0xfb32('0x43')](_0x51e8b2['query'][_0xfb32('0x43')]);_0x1fdc45[_0xfb32('0x44')]=qs['filters'](_['pick'](_0x51e8b2[_0xfb32('0x3a')],_0x3aa21d[_0xfb32('0x3b')]));if(_0x51e8b2['query'][_0xfb32('0x45')]){_0x1fdc45[_0xfb32('0x44')]=_[_0xfb32('0x4f')](_0x1fdc45[_0xfb32('0x44')],{'$or':_[_0xfb32('0x39')](_0x1fdc45[_0xfb32('0x3d')],function(_0x2128a5){var _0x2dd17d={};_0x2dd17d[_0x2128a5]={'$like':'%'+_0x51e8b2[_0xfb32('0x3a')]['filter']+'%'};return _0x2dd17d;})});}_0x1fdc45=_[_0xfb32('0x4f')]({},_0x1fdc45,_0x51e8b2[_0xfb32('0x47')]);return _0x56e45d[_0xfb32('0x58')](_0x1fdc45);}})[_0xfb32('0x2e')](function(_0x170070){if(_0x170070){_0x33caf3=_0x170070['length'];if(!_0x51e8b2['query']['hasOwnProperty'](_0xfb32('0x41'))){_0x1fdc45[_0xfb32('0x26')]=qs[_0xfb32('0x26')](_0x51e8b2[_0xfb32('0x3a')]['limit']);_0x1fdc45[_0xfb32('0x25')]=qs[_0xfb32('0x25')](_0x51e8b2[_0xfb32('0x3a')][_0xfb32('0x25')]);}return _0x56e45d['getDescriptions'](_0x1fdc45);}})[_0xfb32('0x2e')](function(_0x125dbd){if(_0x125dbd){return _0x125dbd?{'count':_0x33caf3,'rows':_0x125dbd}:null;}})[_0xfb32('0x2e')](respondWithResult(_0x4563ae,null))[_0xfb32('0x20')](handleError(_0x4563ae,null));}; \ No newline at end of file +var _0xa902=['apply','reject','update','end','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','length','find','create','body','params','destroy','findOne','order','getFields','getSubjects','keys','Dynamics365Field','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0xe5d54f,_0x143d93){var _0x2a74bf=function(_0x3e56cb){while(--_0x3e56cb){_0xe5d54f['push'](_0xe5d54f['shift']());}};_0x2a74bf(++_0x143d93);}(_0xa902,0x19d));var _0x2a90=function(_0x1693c5,_0x42d910){_0x1693c5=_0x1693c5-0x0;var _0x40b6d6=_0xa902[_0x1693c5];return _0x40b6d6;};'use strict';var emlformat=require(_0x2a90('0x0'));var rimraf=require(_0x2a90('0x1'));var zipdir=require(_0x2a90('0x2'));var jsonpatch=require(_0x2a90('0x3'));var rp=require(_0x2a90('0x4'));var moment=require('moment');var BPromise=require(_0x2a90('0x5'));var Mustache=require('mustache');var util=require(_0x2a90('0x6'));var path=require('path');var sox=require(_0x2a90('0x7'));var csv=require(_0x2a90('0x8'));var ejs=require(_0x2a90('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2a90('0xa'));var squel=require(_0x2a90('0xb'));var crypto=require('crypto');var jsforce=require(_0x2a90('0xc'));var deskjs=require(_0x2a90('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2a90('0xe'));var Papa=require(_0x2a90('0xf'));var Redis=require(_0x2a90('0x10'));var authService=require(_0x2a90('0x11'));var qs=require(_0x2a90('0x12'));var as=require(_0x2a90('0x13'));var hardwareService=require(_0x2a90('0x14'));var logger=require(_0x2a90('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2a90('0x16'));var db=require(_0x2a90('0x17'))['db'];var jayson=require(_0x2a90('0x18'));var client=jayson[_0x2a90('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4db44c,_0x916852,_0x36883d,_0xb4ca0b){return new BPromise(function(_0x5892c5,_0x2e27f1){var _0x2c0076=_0xb4ca0b||client;return _0x2c0076[_0x2a90('0x1a')](_0x4db44c,_0x36883d)[_0x2a90('0x1b')](function(_0x3ba97f){logger[_0x2a90('0x1c')](_0x2a90('0x1d'),_0x916852,'request\x20sent');logger[_0x2a90('0x1e')](_0x2a90('0x1f'),_0x916852,_0x2a90('0x20'),JSON['stringify'](_0x3ba97f));if(_0x3ba97f[_0x2a90('0x21')]){if(_0x3ba97f[_0x2a90('0x21')][_0x2a90('0x22')]===0x1f4){logger[_0x2a90('0x21')](_0x2a90('0x1d'),_0x916852,_0x3ba97f['error']['message']);return _0x2e27f1(_0x3ba97f['error'][_0x2a90('0x23')]);}logger[_0x2a90('0x21')]('Dynamics365Configuration,\x20%s,\x20%s',_0x916852,_0x3ba97f[_0x2a90('0x21')]['message']);return _0x5892c5(_0x3ba97f[_0x2a90('0x21')][_0x2a90('0x23')]);}else{logger[_0x2a90('0x1c')](_0x2a90('0x1d'),_0x916852,'request\x20sent');_0x5892c5(_0x3ba97f[_0x2a90('0x24')][_0x2a90('0x23')]);}})[_0x2a90('0x25')](function(_0x76ea7d){logger['error'](_0x2a90('0x1d'),_0x916852,_0x76ea7d);_0x2e27f1(_0x76ea7d);});});}function respondWithStatusCode(_0x1f88ca,_0x52423a){_0x52423a=_0x52423a||0xcc;return function(_0x59c090){if(_0x59c090){return _0x1f88ca[_0x2a90('0x26')](_0x52423a);}return _0x1f88ca[_0x2a90('0x27')](_0x52423a)['end']();};}function respondWithResult(_0x37f12,_0x1ea94e){_0x1ea94e=_0x1ea94e||0xc8;return function(_0x366fc4){if(_0x366fc4){return _0x37f12[_0x2a90('0x27')](_0x1ea94e)[_0x2a90('0x28')](_0x366fc4);}};}function respondWithFilteredResult(_0x21454c,_0x11d385){return function(_0x54cc00){if(_0x54cc00){var _0x45e532=typeof _0x11d385[_0x2a90('0x29')]===_0x2a90('0x2a')&&typeof _0x11d385[_0x2a90('0x2b')]===_0x2a90('0x2a');var _0x2911b7=_0x54cc00[_0x2a90('0x2c')];var _0x5f5478=_0x45e532?0x0:_0x11d385[_0x2a90('0x29')];var _0x1b85a8=_0x45e532?_0x54cc00[_0x2a90('0x2c')]:_0x11d385['offset']+_0x11d385[_0x2a90('0x2b')];var _0x3a8d34;if(_0x1b85a8>=_0x2911b7){_0x1b85a8=_0x2911b7;_0x3a8d34=0xc8;}else{_0x3a8d34=0xce;}_0x21454c[_0x2a90('0x27')](_0x3a8d34);return _0x21454c[_0x2a90('0x2d')](_0x2a90('0x2e'),_0x5f5478+'-'+_0x1b85a8+'/'+_0x2911b7)[_0x2a90('0x28')](_0x54cc00);}return null;};}function patchUpdates(_0x476a6c){return function(_0x1f4bf3){try{jsonpatch[_0x2a90('0x2f')](_0x1f4bf3,_0x476a6c,!![]);}catch(_0x30a69c){return BPromise[_0x2a90('0x30')](_0x30a69c);}return _0x1f4bf3['save']();};}function saveUpdates(_0x3eeb44,_0xb6f7c9){return function(_0xfe7a6e){if(_0xfe7a6e){return _0xfe7a6e[_0x2a90('0x31')](_0x3eeb44)[_0x2a90('0x1b')](function(_0x239a81){return _0x239a81;});}return null;};}function removeEntity(_0x5742f6,_0x3463cf){return function(_0x5ae4b7){if(_0x5ae4b7){return _0x5ae4b7['destroy']()[_0x2a90('0x1b')](function(){_0x5742f6[_0x2a90('0x27')](0xcc)[_0x2a90('0x32')]();});}};}function handleEntityNotFound(_0x25567f,_0x5f1164){return function(_0x261af7){if(!_0x261af7){_0x25567f[_0x2a90('0x26')](0x194);}return _0x261af7;};}function handleError(_0x54d04e,_0x41a765){_0x41a765=_0x41a765||0x1f4;return function(_0xa8feb5){logger[_0x2a90('0x21')](_0xa8feb5['stack']);if(_0xa8feb5[_0x2a90('0x33')]){delete _0xa8feb5[_0x2a90('0x33')];}_0x54d04e[_0x2a90('0x27')](_0x41a765)[_0x2a90('0x34')](_0xa8feb5);};}exports[_0x2a90('0x35')]=function(_0x2d79dd,_0x220465){var _0x5a727a={},_0x364f61={},_0x32551e={'count':0x0,'rows':[]};var _0x99d5ba=_[_0x2a90('0x36')](db[_0x2a90('0x37')][_0x2a90('0x38')],function(_0x50c990){return{'name':_0x50c990[_0x2a90('0x39')],'type':_0x50c990[_0x2a90('0x3a')][_0x2a90('0x3b')]};});_0x364f61[_0x2a90('0x3c')]=_[_0x2a90('0x36')](_0x99d5ba,'name');_0x364f61['query']=_['keys'](_0x2d79dd[_0x2a90('0x3d')]);_0x364f61[_0x2a90('0x3e')]=_[_0x2a90('0x3f')](_0x364f61[_0x2a90('0x3c')],_0x364f61[_0x2a90('0x3d')]);_0x5a727a[_0x2a90('0x40')]=_[_0x2a90('0x3f')](_0x364f61['model'],qs[_0x2a90('0x41')](_0x2d79dd[_0x2a90('0x3d')][_0x2a90('0x41')]));_0x5a727a[_0x2a90('0x40')]=_0x5a727a[_0x2a90('0x40')]['length']?_0x5a727a['attributes']:_0x364f61['model'];if(!_0x2d79dd[_0x2a90('0x3d')][_0x2a90('0x42')](_0x2a90('0x43'))){_0x5a727a[_0x2a90('0x2b')]=qs['limit'](_0x2d79dd[_0x2a90('0x3d')][_0x2a90('0x2b')]);_0x5a727a['offset']=qs[_0x2a90('0x29')](_0x2d79dd[_0x2a90('0x3d')][_0x2a90('0x29')]);}_0x5a727a['order']=qs[_0x2a90('0x44')](_0x2d79dd[_0x2a90('0x3d')][_0x2a90('0x44')]);_0x5a727a[_0x2a90('0x45')]=qs['filters'](_[_0x2a90('0x46')](_0x2d79dd[_0x2a90('0x3d')],_0x364f61[_0x2a90('0x3e')]),_0x99d5ba);if(_0x2d79dd['query']['filter']){_0x5a727a[_0x2a90('0x45')]=_[_0x2a90('0x47')](_0x5a727a['where'],{'$or':_['map'](_0x99d5ba,function(_0x3d8d7f){if(_0x3d8d7f[_0x2a90('0x3a')]!==_0x2a90('0x48')){var _0x42c6de={};_0x42c6de[_0x3d8d7f[_0x2a90('0x33')]]={'$like':'%'+_0x2d79dd[_0x2a90('0x3d')][_0x2a90('0x49')]+'%'};return _0x42c6de;}})});}_0x5a727a=_['merge']({},_0x5a727a,_0x2d79dd[_0x2a90('0x4a')]);var _0x2233cd={'where':_0x5a727a[_0x2a90('0x45')]};return db[_0x2a90('0x37')][_0x2a90('0x2c')](_0x2233cd)['then'](function(_0x45fd4a){_0x32551e[_0x2a90('0x2c')]=_0x45fd4a;if(_0x2d79dd['query'][_0x2a90('0x4b')]){_0x5a727a[_0x2a90('0x4c')]=[{'all':!![]}];}return db[_0x2a90('0x37')][_0x2a90('0x4d')](_0x5a727a);})[_0x2a90('0x1b')](function(_0x461404){_0x32551e[_0x2a90('0x4e')]=_0x461404;return _0x32551e;})[_0x2a90('0x1b')](respondWithFilteredResult(_0x220465,_0x5a727a))[_0x2a90('0x25')](handleError(_0x220465,null));};exports['show']=function(_0x47a5f1,_0x5bd310){var _0x327708={'raw':![],'where':{'id':_0x47a5f1['params']['id']}},_0x5f5a61={};_0x5f5a61[_0x2a90('0x3c')]=_['keys'](db['Dynamics365Configuration']['rawAttributes']);_0x5f5a61[_0x2a90('0x3d')]=_['keys'](_0x47a5f1['query']);_0x5f5a61[_0x2a90('0x3e')]=_[_0x2a90('0x3f')](_0x5f5a61['model'],_0x5f5a61[_0x2a90('0x3d')]);_0x327708[_0x2a90('0x40')]=_['intersection'](_0x5f5a61[_0x2a90('0x3c')],qs['fields'](_0x47a5f1[_0x2a90('0x3d')][_0x2a90('0x41')]));_0x327708['attributes']=_0x327708[_0x2a90('0x40')][_0x2a90('0x4f')]?_0x327708[_0x2a90('0x40')]:_0x5f5a61['model'];if(_0x47a5f1[_0x2a90('0x3d')][_0x2a90('0x4b')]){_0x327708[_0x2a90('0x4c')]=[{'all':!![]}];}_0x327708=_[_0x2a90('0x47')]({},_0x327708,_0x47a5f1[_0x2a90('0x4a')]);return db[_0x2a90('0x37')][_0x2a90('0x50')](_0x327708)[_0x2a90('0x1b')](handleEntityNotFound(_0x5bd310,null))['then'](respondWithResult(_0x5bd310,null))[_0x2a90('0x25')](handleError(_0x5bd310,null));};exports['create']=function(_0x80b810,_0x46984f){return db[_0x2a90('0x37')][_0x2a90('0x51')](_0x80b810[_0x2a90('0x52')],{})[_0x2a90('0x1b')](respondWithResult(_0x46984f,0xc9))['catch'](handleError(_0x46984f,null));};exports[_0x2a90('0x31')]=function(_0x4005b9,_0x3c8b5f){if(_0x4005b9[_0x2a90('0x52')]['id']){delete _0x4005b9[_0x2a90('0x52')]['id'];}return db[_0x2a90('0x37')]['find']({'where':{'id':_0x4005b9[_0x2a90('0x53')]['id']}})[_0x2a90('0x1b')](handleEntityNotFound(_0x3c8b5f,null))[_0x2a90('0x1b')](saveUpdates(_0x4005b9[_0x2a90('0x52')],null))[_0x2a90('0x1b')](respondWithResult(_0x3c8b5f,null))['catch'](handleError(_0x3c8b5f,null));};exports[_0x2a90('0x54')]=function(_0x2a6a22,_0x30ed1d){return db[_0x2a90('0x37')][_0x2a90('0x50')]({'where':{'id':_0x2a6a22[_0x2a90('0x53')]['id']}})['then'](handleEntityNotFound(_0x30ed1d,null))['then'](removeEntity(_0x30ed1d,null))[_0x2a90('0x25')](handleError(_0x30ed1d,null));};exports['getFields']=function(_0x4a7159,_0x4c859a,_0xa12dbe){var _0x45a6e0={};var _0x48cc2b={};var _0x1d6c34;var _0x411ab3;return db['Dynamics365Configuration'][_0x2a90('0x55')]({'where':{'id':_0x4a7159['params']['id']}})[_0x2a90('0x1b')](handleEntityNotFound(_0x4c859a,null))['then'](function(_0x15cf89){if(_0x15cf89){_0x1d6c34=_0x15cf89;_0x48cc2b[_0x2a90('0x3c')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x48cc2b[_0x2a90('0x3d')]=_['keys'](_0x4a7159[_0x2a90('0x3d')]);_0x48cc2b[_0x2a90('0x3e')]=_['intersection'](_0x48cc2b[_0x2a90('0x3c')],_0x48cc2b[_0x2a90('0x3d')]);_0x45a6e0[_0x2a90('0x40')]=_[_0x2a90('0x3f')](_0x48cc2b['model'],qs['fields'](_0x4a7159[_0x2a90('0x3d')]['fields']));_0x45a6e0[_0x2a90('0x40')]=_0x45a6e0[_0x2a90('0x40')][_0x2a90('0x4f')]?_0x45a6e0[_0x2a90('0x40')]:_0x48cc2b['model'];_0x45a6e0[_0x2a90('0x56')]=qs['sort'](_0x4a7159[_0x2a90('0x3d')][_0x2a90('0x44')]);_0x45a6e0['where']=qs[_0x2a90('0x3e')](_[_0x2a90('0x46')](_0x4a7159['query'],_0x48cc2b[_0x2a90('0x3e')]));if(_0x4a7159[_0x2a90('0x3d')][_0x2a90('0x49')]){_0x45a6e0[_0x2a90('0x45')]=_['merge'](_0x45a6e0[_0x2a90('0x45')],{'$or':_[_0x2a90('0x36')](_0x45a6e0['attributes'],function(_0x5cfb4b){var _0x28904d={};_0x28904d[_0x5cfb4b]={'$like':'%'+_0x4a7159[_0x2a90('0x3d')][_0x2a90('0x49')]+'%'};return _0x28904d;})});}_0x45a6e0=_[_0x2a90('0x47')]({},_0x45a6e0,_0x4a7159[_0x2a90('0x4a')]);return _0x1d6c34[_0x2a90('0x57')](_0x45a6e0);}})[_0x2a90('0x1b')](function(_0x1d6066){if(_0x1d6066){_0x411ab3=_0x1d6066[_0x2a90('0x4f')];if(!_0x4a7159['query'][_0x2a90('0x42')]('nolimit')){_0x45a6e0[_0x2a90('0x2b')]=qs[_0x2a90('0x2b')](_0x4a7159[_0x2a90('0x3d')][_0x2a90('0x2b')]);_0x45a6e0[_0x2a90('0x29')]=qs[_0x2a90('0x29')](_0x4a7159[_0x2a90('0x3d')][_0x2a90('0x29')]);}return _0x1d6c34[_0x2a90('0x57')](_0x45a6e0);}})[_0x2a90('0x1b')](function(_0x436b1e){if(_0x436b1e){return _0x436b1e?{'count':_0x411ab3,'rows':_0x436b1e}:null;}})[_0x2a90('0x1b')](respondWithResult(_0x4c859a,null))[_0x2a90('0x25')](handleError(_0x4c859a,null));};exports[_0x2a90('0x58')]=function(_0x29e424,_0x787128,_0x1f2c89){var _0x3341a4={};var _0x4af3fa={};var _0x1912a0;var _0x2434d1;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x29e424[_0x2a90('0x53')]['id']}})[_0x2a90('0x1b')](handleEntityNotFound(_0x787128,null))[_0x2a90('0x1b')](function(_0x5bc4d4){if(_0x5bc4d4){_0x1912a0=_0x5bc4d4;_0x4af3fa[_0x2a90('0x3c')]=_[_0x2a90('0x59')](db[_0x2a90('0x5a')][_0x2a90('0x38')]);_0x4af3fa[_0x2a90('0x3d')]=_[_0x2a90('0x59')](_0x29e424[_0x2a90('0x3d')]);_0x4af3fa[_0x2a90('0x3e')]=_[_0x2a90('0x3f')](_0x4af3fa[_0x2a90('0x3c')],_0x4af3fa[_0x2a90('0x3d')]);_0x3341a4['attributes']=_[_0x2a90('0x3f')](_0x4af3fa[_0x2a90('0x3c')],qs['fields'](_0x29e424[_0x2a90('0x3d')][_0x2a90('0x41')]));_0x3341a4['attributes']=_0x3341a4['attributes']['length']?_0x3341a4[_0x2a90('0x40')]:_0x4af3fa['model'];_0x3341a4[_0x2a90('0x56')]=qs['sort'](_0x29e424[_0x2a90('0x3d')][_0x2a90('0x44')]);_0x3341a4[_0x2a90('0x45')]=qs[_0x2a90('0x3e')](_[_0x2a90('0x46')](_0x29e424['query'],_0x4af3fa[_0x2a90('0x3e')]));if(_0x29e424[_0x2a90('0x3d')]['filter']){_0x3341a4[_0x2a90('0x45')]=_['merge'](_0x3341a4[_0x2a90('0x45')],{'$or':_['map'](_0x3341a4[_0x2a90('0x40')],function(_0x2aed89){var _0x384dbe={};_0x384dbe[_0x2aed89]={'$like':'%'+_0x29e424[_0x2a90('0x3d')][_0x2a90('0x49')]+'%'};return _0x384dbe;})});}_0x3341a4=_[_0x2a90('0x47')]({},_0x3341a4,_0x29e424[_0x2a90('0x4a')]);return _0x1912a0[_0x2a90('0x58')](_0x3341a4);}})[_0x2a90('0x1b')](function(_0x2ade50){if(_0x2ade50){_0x2434d1=_0x2ade50[_0x2a90('0x4f')];if(!_0x29e424[_0x2a90('0x3d')]['hasOwnProperty'](_0x2a90('0x43'))){_0x3341a4[_0x2a90('0x2b')]=qs[_0x2a90('0x2b')](_0x29e424[_0x2a90('0x3d')][_0x2a90('0x2b')]);_0x3341a4[_0x2a90('0x29')]=qs['offset'](_0x29e424[_0x2a90('0x3d')]['offset']);}return _0x1912a0['getSubjects'](_0x3341a4);}})[_0x2a90('0x1b')](function(_0x2976d7){if(_0x2976d7){return _0x2976d7?{'count':_0x2434d1,'rows':_0x2976d7}:null;}})[_0x2a90('0x1b')](respondWithResult(_0x787128,null))[_0x2a90('0x25')](handleError(_0x787128,null));};exports['getDescriptions']=function(_0x315878,_0x5b2dfd,_0x5c031b){var _0x5a67ff={};var _0x2edddd={};var _0x148553;var _0x4ccbc9;return db['Dynamics365Configuration'][_0x2a90('0x55')]({'where':{'id':_0x315878['params']['id']}})[_0x2a90('0x1b')](handleEntityNotFound(_0x5b2dfd,null))['then'](function(_0x498857){if(_0x498857){_0x148553=_0x498857;_0x2edddd[_0x2a90('0x3c')]=_[_0x2a90('0x59')](db[_0x2a90('0x5a')][_0x2a90('0x38')]);_0x2edddd[_0x2a90('0x3d')]=_['keys'](_0x315878[_0x2a90('0x3d')]);_0x2edddd['filters']=_['intersection'](_0x2edddd[_0x2a90('0x3c')],_0x2edddd[_0x2a90('0x3d')]);_0x5a67ff['attributes']=_[_0x2a90('0x3f')](_0x2edddd[_0x2a90('0x3c')],qs['fields'](_0x315878[_0x2a90('0x3d')][_0x2a90('0x41')]));_0x5a67ff[_0x2a90('0x40')]=_0x5a67ff[_0x2a90('0x40')][_0x2a90('0x4f')]?_0x5a67ff[_0x2a90('0x40')]:_0x2edddd[_0x2a90('0x3c')];_0x5a67ff['order']=qs[_0x2a90('0x44')](_0x315878[_0x2a90('0x3d')][_0x2a90('0x44')]);_0x5a67ff[_0x2a90('0x45')]=qs[_0x2a90('0x3e')](_[_0x2a90('0x46')](_0x315878['query'],_0x2edddd[_0x2a90('0x3e')]));if(_0x315878[_0x2a90('0x3d')]['filter']){_0x5a67ff[_0x2a90('0x45')]=_[_0x2a90('0x47')](_0x5a67ff[_0x2a90('0x45')],{'$or':_[_0x2a90('0x36')](_0x5a67ff['attributes'],function(_0x4fa9d3){var _0x421e80={};_0x421e80[_0x4fa9d3]={'$like':'%'+_0x315878['query'][_0x2a90('0x49')]+'%'};return _0x421e80;})});}_0x5a67ff=_[_0x2a90('0x47')]({},_0x5a67ff,_0x315878[_0x2a90('0x4a')]);return _0x148553[_0x2a90('0x5b')](_0x5a67ff);}})[_0x2a90('0x1b')](function(_0x2e3311){if(_0x2e3311){_0x4ccbc9=_0x2e3311[_0x2a90('0x4f')];if(!_0x315878['query']['hasOwnProperty'](_0x2a90('0x43'))){_0x5a67ff[_0x2a90('0x2b')]=qs[_0x2a90('0x2b')](_0x315878['query']['limit']);_0x5a67ff[_0x2a90('0x29')]=qs[_0x2a90('0x29')](_0x315878[_0x2a90('0x3d')][_0x2a90('0x29')]);}return _0x148553[_0x2a90('0x5b')](_0x5a67ff);}})[_0x2a90('0x1b')](function(_0x588952){if(_0x588952){return _0x588952?{'count':_0x4ccbc9,'rows':_0x588952}:null;}})['then'](respondWithResult(_0x5b2dfd,null))['catch'](handleError(_0x5b2dfd,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index e05c4c7..dc6c5a9 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 _0xacca=['api','moment','bluebird','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','lodash','util','../../config/logger'];(function(_0x545eb3,_0x2d590c){var _0x24beed=function(_0x4fe828){while(--_0x4fe828){_0x545eb3['push'](_0x545eb3['shift']());}};_0x24beed(++_0x2d590c);}(_0xacca,0xed));var _0xaacc=function(_0x42b91d,_0x23b924){_0x42b91d=_0x42b91d-0x0;var _0x59fdae=_0xacca[_0x42b91d];return _0x59fdae;};'use strict';var _=require(_0xaacc('0x0'));var util=require(_0xaacc('0x1'));var logger=require(_0xaacc('0x2'))(_0xaacc('0x3'));var moment=require(_0xaacc('0x4'));var BPromise=require(_0xaacc('0x5'));var rp=require(_0xaacc('0x6'));var fs=require('fs');var path=require(_0xaacc('0x7'));var rimraf=require('rimraf');var config=require(_0xaacc('0x8'));var attributes=require(_0xaacc('0x9'));module[_0xaacc('0xa')]=function(_0x1fcbf2,_0x1faccb){return _0x1fcbf2['define'](_0xaacc('0xb'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa5b=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xaa5b,0x16e));var _0xbaa5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa5b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbaa5('0x0'));var util=require(_0xbaa5('0x1'));var logger=require(_0xbaa5('0x2'))(_0xbaa5('0x3'));var moment=require(_0xbaa5('0x4'));var BPromise=require(_0xbaa5('0x5'));var rp=require(_0xbaa5('0x6'));var fs=require('fs');var path=require(_0xbaa5('0x7'));var rimraf=require(_0xbaa5('0x8'));var config=require('../../config/environment');var attributes=require(_0xbaa5('0x9'));module[_0xbaa5('0xa')]=function(_0x1b7df4,_0xab8e14){return _0x1b7df4[_0xbaa5('0xb')](_0xbaa5('0xc'),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 de58a52..a4260aa 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 _0x9f3c=['error','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x2bda0a,_0x280e93){var _0x161bb0=function(_0x41ee00){while(--_0x41ee00){_0x2bda0a['push'](_0x2bda0a['shift']());}};_0x161bb0(++_0x280e93);}(_0x9f3c,0xc1));var _0xc9f3=function(_0x2cd2d5,_0x1b24bc){_0x2cd2d5=_0x2cd2d5-0x0;var _0x138207=_0x9f3c[_0x2cd2d5];return _0x138207;};'use strict';var _=require(_0xc9f3('0x0'));var util=require(_0xc9f3('0x1'));var moment=require(_0xc9f3('0x2'));var BPromise=require(_0xc9f3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9f3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc9f3('0x5'))('rpc');var config=require(_0xc9f3('0x6'));var jayson=require(_0xc9f3('0x7'));var client=jayson[_0xc9f3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34e9e2,_0x33ac02,_0x201cf2){return new BPromise(function(_0x4c6846,_0x6d4c32){return client[_0xc9f3('0x9')](_0x34e9e2,_0x201cf2)[_0xc9f3('0xa')](function(_0x48f15f){logger[_0xc9f3('0xb')](_0xc9f3('0xc'),_0x33ac02,'request\x20sent');logger[_0xc9f3('0xd')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x33ac02,_0xc9f3('0xe'),JSON[_0xc9f3('0xf')](_0x48f15f));if(_0x48f15f[_0xc9f3('0x10')]){if(_0x48f15f[_0xc9f3('0x10')]['code']===0x1f4){logger[_0xc9f3('0x10')](_0xc9f3('0xc'),_0x33ac02,_0x48f15f[_0xc9f3('0x10')][_0xc9f3('0x11')]);return _0x6d4c32(_0x48f15f[_0xc9f3('0x10')][_0xc9f3('0x11')]);}logger[_0xc9f3('0x10')](_0xc9f3('0xc'),_0x33ac02,_0x48f15f[_0xc9f3('0x10')][_0xc9f3('0x11')]);return _0x4c6846(_0x48f15f['error'][_0xc9f3('0x11')]);}else{logger['info'](_0xc9f3('0xc'),_0x33ac02,_0xc9f3('0xe'));_0x4c6846(_0x48f15f['result'][_0xc9f3('0x11')]);}})[_0xc9f3('0x12')](function(_0x20c59a){logger['error'](_0xc9f3('0xc'),_0x33ac02,_0x20c59a);_0x6d4c32(_0x20c59a);});});} \ No newline at end of file +var _0x2bf2=['../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','bluebird','randomstring','../../mysqldb','rpc'];(function(_0xb905fe,_0x123c76){var _0x497fb4=function(_0x48c368){while(--_0x48c368){_0xb905fe['push'](_0xb905fe['shift']());}};_0x497fb4(++_0x123c76);}(_0x2bf2,0x1e2));var _0x22bf=function(_0x4ff78a,_0x15a6cd){_0x4ff78a=_0x4ff78a-0x0;var _0x3efdaf=_0x2bf2[_0x4ff78a];return _0x3efdaf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x22bf('0x0'));var rs=require(_0x22bf('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22bf('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x22bf('0x3'));var config=require(_0x22bf('0x4'));var jayson=require(_0x22bf('0x5'));var client=jayson[_0x22bf('0x6')][_0x22bf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3f8516,_0x536915,_0x5f00ab){return new BPromise(function(_0x2ce679,_0x3ef909){return client['request'](_0x3f8516,_0x5f00ab)[_0x22bf('0x8')](function(_0x45333b){logger[_0x22bf('0x9')](_0x22bf('0xa'),_0x536915,_0x22bf('0xb'));logger[_0x22bf('0xc')](_0x22bf('0xd'),_0x536915,_0x22bf('0xb'),JSON[_0x22bf('0xe')](_0x45333b));if(_0x45333b[_0x22bf('0xf')]){if(_0x45333b[_0x22bf('0xf')]['code']===0x1f4){logger[_0x22bf('0xf')](_0x22bf('0xa'),_0x536915,_0x45333b[_0x22bf('0xf')][_0x22bf('0x10')]);return _0x3ef909(_0x45333b[_0x22bf('0xf')][_0x22bf('0x10')]);}logger[_0x22bf('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x536915,_0x45333b['error']['message']);return _0x2ce679(_0x45333b[_0x22bf('0xf')][_0x22bf('0x10')]);}else{logger[_0x22bf('0x9')](_0x22bf('0xa'),_0x536915,_0x22bf('0xb'));_0x2ce679(_0x45333b[_0x22bf('0x11')][_0x22bf('0x10')]);}})['catch'](function(_0x2c5097){logger[_0x22bf('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x536915,_0x2c5097);_0x3ef909(_0x2c5097);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 2d88255..550b3e8 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 _0x159b=['create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post'];(function(_0x2677d7,_0x53fb6b){var _0x4d4017=function(_0x12621b){while(--_0x12621b){_0x2677d7['push'](_0x2677d7['shift']());}};_0x4d4017(++_0x53fb6b);}(_0x159b,0x181));var _0xb159=function(_0x434af7,_0x1b0154){_0x434af7=_0x434af7-0x0;var _0x42035f=_0x159b[_0x434af7];return _0x42035f;};'use strict';var multer=require(_0xb159('0x0'));var util=require(_0xb159('0x1'));var path=require(_0xb159('0x2'));var timeout=require(_0xb159('0x3'));var express=require(_0xb159('0x4'));var router=express[_0xb159('0x5')]();var fs_extra=require(_0xb159('0x6'));var auth=require(_0xb159('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb159('0x8'));var controller=require(_0xb159('0x9'));router[_0xb159('0xa')]('/',auth[_0xb159('0xb')](),controller['index']);router[_0xb159('0xa')](_0xb159('0xc'),auth[_0xb159('0xb')](),controller[_0xb159('0xd')]);router[_0xb159('0xe')]('/',auth[_0xb159('0xb')](),controller[_0xb159('0xf')]);router[_0xb159('0x10')](_0xb159('0xc'),auth[_0xb159('0xb')](),controller[_0xb159('0x11')]);router[_0xb159('0x12')](_0xb159('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xb159('0x13')]=router; \ No newline at end of file +var _0xc874=['put','update','delete','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show'];(function(_0x259341,_0x1cc3a2){var _0x54b951=function(_0x571847){while(--_0x571847){_0x259341['push'](_0x259341['shift']());}};_0x54b951(++_0x1cc3a2);}(_0xc874,0x154));var _0x4c87=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xc874[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0x4c87('0x0'));var util=require('util');var path=require(_0x4c87('0x1'));var timeout=require(_0x4c87('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4c87('0x3'));var auth=require(_0x4c87('0x4'));var interaction=require(_0x4c87('0x5'));var config=require('../../config/environment');var controller=require(_0x4c87('0x6'));router[_0x4c87('0x7')]('/',auth['isAuthenticated'](),controller[_0x4c87('0x8')]);router[_0x4c87('0x7')](_0x4c87('0x9'),auth[_0x4c87('0xa')](),controller[_0x4c87('0xb')]);router['post']('/',auth[_0x4c87('0xa')](),controller['create']);router[_0x4c87('0xc')](_0x4c87('0x9'),auth[_0x4c87('0xa')](),controller[_0x4c87('0xd')]);router[_0x4c87('0xe')]('/:id',auth[_0x4c87('0xa')](),controller[_0x4c87('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 5e4046a..ee1cfc3 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 _0x8ef6=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0x8ef6,0xf2));var _0x68ef=function(_0x15e1fd,_0x17d7f4){_0x15e1fd=_0x15e1fd-0x0;var _0xb808ae=_0x8ef6[_0x15e1fd];return _0xb808ae;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'type':{'type':Sequelize[_0x68ef('0x2')](_0x68ef('0x3'),_0x68ef('0x4'),_0x68ef('0x5'),_0x68ef('0x6'),'picklist'),'defaultValue':_0x68ef('0x3')},'content':{'type':Sequelize[_0x68ef('0x7')]},'key':{'type':Sequelize[_0x68ef('0x7')]},'keyType':{'type':Sequelize[_0x68ef('0x2')]('string','variable',_0x68ef('0x5'))},'keyContent':{'type':Sequelize[_0x68ef('0x7')]},'idField':{'type':Sequelize[_0x68ef('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x68ef('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x68ef('0x7')]}}; \ No newline at end of file +var _0x6f47=['ENUM','variable','keyValue','string','STRING','customVariable','BOOLEAN','exports'];(function(_0x1e8eb4,_0x53a726){var _0x3e3e6e=function(_0x29dbf3){while(--_0x29dbf3){_0x1e8eb4['push'](_0x1e8eb4['shift']());}};_0x3e3e6e(++_0x53a726);}(_0x6f47,0xc7));var _0x76f4=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x6f47[_0x38a7ac];return _0x53061a;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'type':{'type':Sequelize[_0x76f4('0x1')]('string',_0x76f4('0x2'),'customVariable',_0x76f4('0x3'),'picklist'),'defaultValue':_0x76f4('0x4')},'content':{'type':Sequelize[_0x76f4('0x5')]},'key':{'type':Sequelize[_0x76f4('0x5')]},'keyType':{'type':Sequelize[_0x76f4('0x1')]('string',_0x76f4('0x2'),_0x76f4('0x6'))},'keyContent':{'type':Sequelize[_0x76f4('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x76f4('0x5')]},'customField':{'type':Sequelize[_0x76f4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x76f4('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 5196a84..33aa398 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 _0x2f1e=['util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','Dynamics365Field','findAll','show','catch','create','body','update','params','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x31c218,_0x5209c3){var _0x4b6c8a=function(_0x150fc9){while(--_0x150fc9){_0x31c218['push'](_0x31c218['shift']());}};_0x4b6c8a(++_0x5209c3);}(_0x2f1e,0x1c7));var _0xe2f1=function(_0x32eb8b,_0x5ac0b5){_0x32eb8b=_0x32eb8b-0x0;var _0x5bc68b=_0x2f1e[_0x32eb8b];return _0x5bc68b;};'use strict';var emlformat=require(_0xe2f1('0x0'));var rimraf=require(_0xe2f1('0x1'));var zipdir=require(_0xe2f1('0x2'));var jsonpatch=require(_0xe2f1('0x3'));var rp=require(_0xe2f1('0x4'));var moment=require(_0xe2f1('0x5'));var BPromise=require(_0xe2f1('0x6'));var Mustache=require('mustache');var util=require(_0xe2f1('0x7'));var path=require('path');var sox=require(_0xe2f1('0x8'));var csv=require(_0xe2f1('0x9'));var ejs=require(_0xe2f1('0xa'));var fs=require('fs');var fs_extra=require(_0xe2f1('0xb'));var _=require('lodash');var squel=require(_0xe2f1('0xc'));var crypto=require(_0xe2f1('0xd'));var jsforce=require(_0xe2f1('0xe'));var deskjs=require(_0xe2f1('0xf'));var toCsv=require(_0xe2f1('0x9'));var querystring=require('querystring');var Papa=require(_0xe2f1('0x10'));var Redis=require(_0xe2f1('0x11'));var authService=require(_0xe2f1('0x12'));var qs=require(_0xe2f1('0x13'));var as=require(_0xe2f1('0x14'));var hardwareService=require(_0xe2f1('0x15'));var logger=require(_0xe2f1('0x16'))(_0xe2f1('0x17'));var utils=require(_0xe2f1('0x18'));var config=require(_0xe2f1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2f1('0x1a'))['db'];function respondWithStatusCode(_0xd482c4,_0x3b12f8){_0x3b12f8=_0x3b12f8||0xcc;return function(_0x207616){if(_0x207616){return _0xd482c4[_0xe2f1('0x1b')](_0x3b12f8);}return _0xd482c4[_0xe2f1('0x1c')](_0x3b12f8)[_0xe2f1('0x1d')]();};}function respondWithResult(_0x54cefd,_0x4ad4cd){_0x4ad4cd=_0x4ad4cd||0xc8;return function(_0x5362de){if(_0x5362de){return _0x54cefd[_0xe2f1('0x1c')](_0x4ad4cd)['json'](_0x5362de);}};}function respondWithFilteredResult(_0x13ca8b,_0x5c7d17){return function(_0x3eb2c1){if(_0x3eb2c1){var _0xca0272=typeof _0x5c7d17[_0xe2f1('0x1e')]===_0xe2f1('0x1f')&&typeof _0x5c7d17[_0xe2f1('0x20')]==='undefined';var _0x3f0428=_0x3eb2c1[_0xe2f1('0x21')];var _0x5b70a7=_0xca0272?0x0:_0x5c7d17[_0xe2f1('0x1e')];var _0x1a1957=_0xca0272?_0x3eb2c1[_0xe2f1('0x21')]:_0x5c7d17[_0xe2f1('0x1e')]+_0x5c7d17[_0xe2f1('0x20')];var _0x3ca349;if(_0x1a1957>=_0x3f0428){_0x1a1957=_0x3f0428;_0x3ca349=0xc8;}else{_0x3ca349=0xce;}_0x13ca8b[_0xe2f1('0x1c')](_0x3ca349);return _0x13ca8b[_0xe2f1('0x22')](_0xe2f1('0x23'),_0x5b70a7+'-'+_0x1a1957+'/'+_0x3f0428)['json'](_0x3eb2c1);}return null;};}function patchUpdates(_0xe9eeb7){return function(_0x120b1b){try{jsonpatch[_0xe2f1('0x24')](_0x120b1b,_0xe9eeb7,!![]);}catch(_0x4a0b3a){return BPromise[_0xe2f1('0x25')](_0x4a0b3a);}return _0x120b1b[_0xe2f1('0x26')]();};}function saveUpdates(_0x5299f9,_0x5fb9b8){return function(_0x1c2c3f){if(_0x1c2c3f){return _0x1c2c3f['update'](_0x5299f9)[_0xe2f1('0x27')](function(_0x111522){return _0x111522;});}return null;};}function removeEntity(_0xd1b0fe,_0x34480b){return function(_0xc6c998){if(_0xc6c998){return _0xc6c998[_0xe2f1('0x28')]()[_0xe2f1('0x27')](function(){_0xd1b0fe['status'](0xcc)[_0xe2f1('0x1d')]();});}};}function handleEntityNotFound(_0x221c60,_0x3f6ec9){return function(_0x5c91fc){if(!_0x5c91fc){_0x221c60[_0xe2f1('0x1b')](0x194);}return _0x5c91fc;};}function handleError(_0xeef8d2,_0x2ed8c2){_0x2ed8c2=_0x2ed8c2||0x1f4;return function(_0x45825d){logger['error'](_0x45825d[_0xe2f1('0x29')]);if(_0x45825d['name']){delete _0x45825d[_0xe2f1('0x2a')];}_0xeef8d2[_0xe2f1('0x1c')](_0x2ed8c2)[_0xe2f1('0x2b')](_0x45825d);};}exports[_0xe2f1('0x2c')]=function(_0xde3c4d,_0x3afa53){var _0x442827={},_0x4761d5={},_0x4d38d6={'count':0x0,'rows':[]};var _0xf9f453=_[_0xe2f1('0x2d')](db['Dynamics365Field'][_0xe2f1('0x2e')],function(_0x40e796){return{'name':_0x40e796[_0xe2f1('0x2f')],'type':_0x40e796[_0xe2f1('0x30')][_0xe2f1('0x31')]};});_0x4761d5[_0xe2f1('0x32')]=_[_0xe2f1('0x2d')](_0xf9f453,_0xe2f1('0x2a'));_0x4761d5['query']=_[_0xe2f1('0x33')](_0xde3c4d[_0xe2f1('0x34')]);_0x4761d5[_0xe2f1('0x35')]=_['intersection'](_0x4761d5[_0xe2f1('0x32')],_0x4761d5['query']);_0x442827['attributes']=_[_0xe2f1('0x36')](_0x4761d5[_0xe2f1('0x32')],qs['fields'](_0xde3c4d['query'][_0xe2f1('0x37')]));_0x442827['attributes']=_0x442827[_0xe2f1('0x38')][_0xe2f1('0x39')]?_0x442827[_0xe2f1('0x38')]:_0x4761d5[_0xe2f1('0x32')];if(!_0xde3c4d[_0xe2f1('0x34')][_0xe2f1('0x3a')]('nolimit')){_0x442827[_0xe2f1('0x20')]=qs[_0xe2f1('0x20')](_0xde3c4d['query'][_0xe2f1('0x20')]);_0x442827['offset']=qs['offset'](_0xde3c4d[_0xe2f1('0x34')][_0xe2f1('0x1e')]);}_0x442827[_0xe2f1('0x3b')]=qs['sort'](_0xde3c4d['query'][_0xe2f1('0x3c')]);_0x442827[_0xe2f1('0x3d')]=qs[_0xe2f1('0x35')](_[_0xe2f1('0x3e')](_0xde3c4d['query'],_0x4761d5[_0xe2f1('0x35')]),_0xf9f453);if(_0xde3c4d[_0xe2f1('0x34')][_0xe2f1('0x3f')]){_0x442827[_0xe2f1('0x3d')]=_[_0xe2f1('0x40')](_0x442827[_0xe2f1('0x3d')],{'$or':_[_0xe2f1('0x2d')](_0xf9f453,function(_0x3316ff){if(_0x3316ff[_0xe2f1('0x30')]!=='VIRTUAL'){var _0x48934f={};_0x48934f[_0x3316ff[_0xe2f1('0x2a')]]={'$like':'%'+_0xde3c4d[_0xe2f1('0x34')][_0xe2f1('0x3f')]+'%'};return _0x48934f;}})});}_0x442827=_[_0xe2f1('0x40')]({},_0x442827,_0xde3c4d[_0xe2f1('0x41')]);var _0x5e8bfa={'where':_0x442827[_0xe2f1('0x3d')]};return db['Dynamics365Field'][_0xe2f1('0x21')](_0x5e8bfa)[_0xe2f1('0x27')](function(_0x4f1a8d){_0x4d38d6['count']=_0x4f1a8d;if(_0xde3c4d[_0xe2f1('0x34')][_0xe2f1('0x42')]){_0x442827[_0xe2f1('0x43')]=[{'all':!![]}];}return db[_0xe2f1('0x44')][_0xe2f1('0x45')](_0x442827);})[_0xe2f1('0x27')](function(_0x264c82){_0x4d38d6['rows']=_0x264c82;return _0x4d38d6;})[_0xe2f1('0x27')](respondWithFilteredResult(_0x3afa53,_0x442827))['catch'](handleError(_0x3afa53,null));};exports[_0xe2f1('0x46')]=function(_0x40754f,_0x4ac647){var _0x1a20d8={'raw':!![],'where':{'id':_0x40754f['params']['id']}},_0x3cd962={};_0x3cd962[_0xe2f1('0x32')]=_['keys'](db[_0xe2f1('0x44')][_0xe2f1('0x2e')]);_0x3cd962['query']=_[_0xe2f1('0x33')](_0x40754f[_0xe2f1('0x34')]);_0x3cd962[_0xe2f1('0x35')]=_[_0xe2f1('0x36')](_0x3cd962[_0xe2f1('0x32')],_0x3cd962[_0xe2f1('0x34')]);_0x1a20d8[_0xe2f1('0x38')]=_['intersection'](_0x3cd962['model'],qs[_0xe2f1('0x37')](_0x40754f['query']['fields']));_0x1a20d8['attributes']=_0x1a20d8['attributes'][_0xe2f1('0x39')]?_0x1a20d8[_0xe2f1('0x38')]:_0x3cd962[_0xe2f1('0x32')];if(_0x40754f[_0xe2f1('0x34')][_0xe2f1('0x42')]){_0x1a20d8[_0xe2f1('0x43')]=[{'all':!![]}];}_0x1a20d8=_[_0xe2f1('0x40')]({},_0x1a20d8,_0x40754f[_0xe2f1('0x41')]);return db['Dynamics365Field']['find'](_0x1a20d8)[_0xe2f1('0x27')](handleEntityNotFound(_0x4ac647,null))[_0xe2f1('0x27')](respondWithResult(_0x4ac647,null))[_0xe2f1('0x47')](handleError(_0x4ac647,null));};exports[_0xe2f1('0x48')]=function(_0x11e537,_0x12b16e){return db['Dynamics365Field'][_0xe2f1('0x48')](_0x11e537[_0xe2f1('0x49')],{})[_0xe2f1('0x27')](respondWithResult(_0x12b16e,0xc9))[_0xe2f1('0x47')](handleError(_0x12b16e,null));};exports[_0xe2f1('0x4a')]=function(_0x3336c4,_0x4ee1ae){if(_0x3336c4[_0xe2f1('0x49')]['id']){delete _0x3336c4[_0xe2f1('0x49')]['id'];}return db[_0xe2f1('0x44')]['find']({'where':{'id':_0x3336c4[_0xe2f1('0x4b')]['id']}})[_0xe2f1('0x27')](handleEntityNotFound(_0x4ee1ae,null))['then'](saveUpdates(_0x3336c4['body'],null))[_0xe2f1('0x27')](respondWithResult(_0x4ee1ae,null))[_0xe2f1('0x47')](handleError(_0x4ee1ae,null));};exports[_0xe2f1('0x28')]=function(_0x499419,_0x591404){return db[_0xe2f1('0x44')][_0xe2f1('0x4c')]({'where':{'id':_0x499419['params']['id']}})['then'](handleEntityNotFound(_0x591404,null))['then'](removeEntity(_0x591404,null))[_0xe2f1('0x47')](handleError(_0x591404,null));}; \ No newline at end of file +var _0x335a=['VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','then','destroy','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','model','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x335a,0x1e1));var _0xa335=function(_0x370998,_0x2d271d){_0x370998=_0x370998-0x0;var _0x1864ea=_0x335a[_0x370998];return _0x1864ea;};'use strict';var emlformat=require(_0xa335('0x0'));var rimraf=require(_0xa335('0x1'));var zipdir=require(_0xa335('0x2'));var jsonpatch=require(_0xa335('0x3'));var rp=require(_0xa335('0x4'));var moment=require('moment');var BPromise=require(_0xa335('0x5'));var Mustache=require(_0xa335('0x6'));var util=require(_0xa335('0x7'));var path=require(_0xa335('0x8'));var sox=require(_0xa335('0x9'));var csv=require(_0xa335('0xa'));var ejs=require(_0xa335('0xb'));var fs=require('fs');var fs_extra=require(_0xa335('0xc'));var _=require(_0xa335('0xd'));var squel=require(_0xa335('0xe'));var crypto=require(_0xa335('0xf'));var jsforce=require(_0xa335('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa335('0xa'));var querystring=require(_0xa335('0x11'));var Papa=require(_0xa335('0x12'));var Redis=require(_0xa335('0x13'));var authService=require(_0xa335('0x14'));var qs=require(_0xa335('0x15'));var as=require(_0xa335('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa335('0x17'))(_0xa335('0x18'));var utils=require(_0xa335('0x19'));var config=require(_0xa335('0x1a'));var licenseUtil=require(_0xa335('0x1b'));var db=require(_0xa335('0x1c'))['db'];function respondWithStatusCode(_0x11cec5,_0x318413){_0x318413=_0x318413||0xcc;return function(_0x2db0cf){if(_0x2db0cf){return _0x11cec5[_0xa335('0x1d')](_0x318413);}return _0x11cec5[_0xa335('0x1e')](_0x318413)[_0xa335('0x1f')]();};}function respondWithResult(_0x4cab82,_0x1fdfc0){_0x1fdfc0=_0x1fdfc0||0xc8;return function(_0x24446b){if(_0x24446b){return _0x4cab82[_0xa335('0x1e')](_0x1fdfc0)[_0xa335('0x20')](_0x24446b);}};}function respondWithFilteredResult(_0x484ca6,_0x5be433){return function(_0x1a6da2){if(_0x1a6da2){var _0x57fd27=typeof _0x5be433[_0xa335('0x21')]===_0xa335('0x22')&&typeof _0x5be433['limit']===_0xa335('0x22');var _0x246fa3=_0x1a6da2[_0xa335('0x23')];var _0x176f5e=_0x57fd27?0x0:_0x5be433[_0xa335('0x21')];var _0x8cd019=_0x57fd27?_0x1a6da2[_0xa335('0x23')]:_0x5be433[_0xa335('0x21')]+_0x5be433['limit'];var _0x131468;if(_0x8cd019>=_0x246fa3){_0x8cd019=_0x246fa3;_0x131468=0xc8;}else{_0x131468=0xce;}_0x484ca6[_0xa335('0x1e')](_0x131468);return _0x484ca6[_0xa335('0x24')]('Content-Range',_0x176f5e+'-'+_0x8cd019+'/'+_0x246fa3)[_0xa335('0x20')](_0x1a6da2);}return null;};}function patchUpdates(_0x4e96ce){return function(_0x10e00a){try{jsonpatch['apply'](_0x10e00a,_0x4e96ce,!![]);}catch(_0x3cd05b){return BPromise[_0xa335('0x25')](_0x3cd05b);}return _0x10e00a[_0xa335('0x26')]();};}function saveUpdates(_0x533781,_0x28c4ab){return function(_0x15c0ca){if(_0x15c0ca){return _0x15c0ca['update'](_0x533781)[_0xa335('0x27')](function(_0x4eeeeb){return _0x4eeeeb;});}return null;};}function removeEntity(_0x3156ae,_0xc823){return function(_0x2d9941){if(_0x2d9941){return _0x2d9941[_0xa335('0x28')]()['then'](function(){_0x3156ae[_0xa335('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44bc22,_0x453afb){return function(_0x38f6c8){if(!_0x38f6c8){_0x44bc22[_0xa335('0x1d')](0x194);}return _0x38f6c8;};}function handleError(_0x8c34fb,_0x554191){_0x554191=_0x554191||0x1f4;return function(_0x41e2af){logger['error'](_0x41e2af[_0xa335('0x29')]);if(_0x41e2af[_0xa335('0x2a')]){delete _0x41e2af[_0xa335('0x2a')];}_0x8c34fb[_0xa335('0x1e')](_0x554191)[_0xa335('0x2b')](_0x41e2af);};}exports[_0xa335('0x2c')]=function(_0x3f0127,_0x2fe7be){var _0x18f87e={},_0x928e06={},_0x2dd75e={'count':0x0,'rows':[]};var _0x4ca81b=_['map'](db['Dynamics365Field'][_0xa335('0x2d')],function(_0x592039){return{'name':_0x592039['fieldName'],'type':_0x592039[_0xa335('0x2e')][_0xa335('0x2f')]};});_0x928e06['model']=_[_0xa335('0x30')](_0x4ca81b,_0xa335('0x2a'));_0x928e06[_0xa335('0x31')]=_[_0xa335('0x32')](_0x3f0127[_0xa335('0x31')]);_0x928e06['filters']=_[_0xa335('0x33')](_0x928e06['model'],_0x928e06[_0xa335('0x31')]);_0x18f87e[_0xa335('0x34')]=_[_0xa335('0x33')](_0x928e06['model'],qs['fields'](_0x3f0127[_0xa335('0x31')][_0xa335('0x35')]));_0x18f87e[_0xa335('0x34')]=_0x18f87e['attributes']['length']?_0x18f87e[_0xa335('0x34')]:_0x928e06[_0xa335('0x36')];if(!_0x3f0127['query'][_0xa335('0x37')](_0xa335('0x38'))){_0x18f87e[_0xa335('0x39')]=qs[_0xa335('0x39')](_0x3f0127[_0xa335('0x31')][_0xa335('0x39')]);_0x18f87e[_0xa335('0x21')]=qs['offset'](_0x3f0127['query'][_0xa335('0x21')]);}_0x18f87e[_0xa335('0x3a')]=qs[_0xa335('0x3b')](_0x3f0127[_0xa335('0x31')][_0xa335('0x3b')]);_0x18f87e['where']=qs[_0xa335('0x3c')](_[_0xa335('0x3d')](_0x3f0127[_0xa335('0x31')],_0x928e06[_0xa335('0x3c')]),_0x4ca81b);if(_0x3f0127[_0xa335('0x31')][_0xa335('0x3e')]){_0x18f87e[_0xa335('0x3f')]=_[_0xa335('0x40')](_0x18f87e['where'],{'$or':_['map'](_0x4ca81b,function(_0x21c8b4){if(_0x21c8b4[_0xa335('0x2e')]!==_0xa335('0x41')){var _0x3cd8b4={};_0x3cd8b4[_0x21c8b4[_0xa335('0x2a')]]={'$like':'%'+_0x3f0127[_0xa335('0x31')][_0xa335('0x3e')]+'%'};return _0x3cd8b4;}})});}_0x18f87e=_[_0xa335('0x40')]({},_0x18f87e,_0x3f0127[_0xa335('0x42')]);var _0x4e7227={'where':_0x18f87e['where']};return db[_0xa335('0x43')][_0xa335('0x23')](_0x4e7227)['then'](function(_0x3c4ba9){_0x2dd75e[_0xa335('0x23')]=_0x3c4ba9;if(_0x3f0127[_0xa335('0x31')][_0xa335('0x44')]){_0x18f87e[_0xa335('0x45')]=[{'all':!![]}];}return db[_0xa335('0x43')][_0xa335('0x46')](_0x18f87e);})['then'](function(_0x4370f2){_0x2dd75e[_0xa335('0x47')]=_0x4370f2;return _0x2dd75e;})[_0xa335('0x27')](respondWithFilteredResult(_0x2fe7be,_0x18f87e))[_0xa335('0x48')](handleError(_0x2fe7be,null));};exports[_0xa335('0x49')]=function(_0x4044e6,_0x2644f9){var _0x1268d8={'raw':!![],'where':{'id':_0x4044e6['params']['id']}},_0x3293f={};_0x3293f[_0xa335('0x36')]=_[_0xa335('0x32')](db[_0xa335('0x43')][_0xa335('0x2d')]);_0x3293f[_0xa335('0x31')]=_[_0xa335('0x32')](_0x4044e6['query']);_0x3293f[_0xa335('0x3c')]=_[_0xa335('0x33')](_0x3293f[_0xa335('0x36')],_0x3293f[_0xa335('0x31')]);_0x1268d8['attributes']=_['intersection'](_0x3293f['model'],qs[_0xa335('0x35')](_0x4044e6[_0xa335('0x31')]['fields']));_0x1268d8[_0xa335('0x34')]=_0x1268d8[_0xa335('0x34')]['length']?_0x1268d8[_0xa335('0x34')]:_0x3293f[_0xa335('0x36')];if(_0x4044e6[_0xa335('0x31')][_0xa335('0x44')]){_0x1268d8[_0xa335('0x45')]=[{'all':!![]}];}_0x1268d8=_[_0xa335('0x40')]({},_0x1268d8,_0x4044e6[_0xa335('0x42')]);return db['Dynamics365Field']['find'](_0x1268d8)[_0xa335('0x27')](handleEntityNotFound(_0x2644f9,null))[_0xa335('0x27')](respondWithResult(_0x2644f9,null))[_0xa335('0x48')](handleError(_0x2644f9,null));};exports[_0xa335('0x4a')]=function(_0x51e48d,_0x4ea07b){return db['Dynamics365Field'][_0xa335('0x4a')](_0x51e48d[_0xa335('0x4b')],{})[_0xa335('0x27')](respondWithResult(_0x4ea07b,0xc9))[_0xa335('0x48')](handleError(_0x4ea07b,null));};exports[_0xa335('0x4c')]=function(_0xabd2a1,_0xdf4d8b){if(_0xabd2a1[_0xa335('0x4b')]['id']){delete _0xabd2a1[_0xa335('0x4b')]['id'];}return db[_0xa335('0x43')]['find']({'where':{'id':_0xabd2a1['params']['id']}})[_0xa335('0x27')](handleEntityNotFound(_0xdf4d8b,null))['then'](saveUpdates(_0xabd2a1[_0xa335('0x4b')],null))[_0xa335('0x27')](respondWithResult(_0xdf4d8b,null))[_0xa335('0x48')](handleError(_0xdf4d8b,null));};exports[_0xa335('0x28')]=function(_0x46f39c,_0x1d5835){return db[_0xa335('0x43')]['find']({'where':{'id':_0x46f39c[_0xa335('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1d5835,null))[_0xa335('0x27')](removeEntity(_0x1d5835,null))[_0xa335('0x48')](handleError(_0x1d5835,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index c63573c..20bd1d6 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 _0x4b24=['int_dynamics365_fields','idField','FieldId','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field'];(function(_0x4216ba,_0x5739c5){var _0x2592ca=function(_0x58ecea){while(--_0x58ecea){_0x4216ba['push'](_0x4216ba['shift']());}};_0x2592ca(++_0x5739c5);}(_0x4b24,0x12e));var _0x44b2=function(_0x5262f6,_0x28ae52){_0x5262f6=_0x5262f6-0x0;var _0x1aebe2=_0x4b24[_0x5262f6];return _0x1aebe2;};'use strict';var _=require('lodash');var util=require(_0x44b2('0x0'));var logger=require(_0x44b2('0x1'))('api');var moment=require(_0x44b2('0x2'));var BPromise=require(_0x44b2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b2('0x4'));var rimraf=require(_0x44b2('0x5'));var config=require(_0x44b2('0x6'));var attributes=require(_0x44b2('0x7'));module['exports']=function(_0x2e1c3f,_0x1462c7){return _0x2e1c3f[_0x44b2('0x8')](_0x44b2('0x9'),attributes,{'tableName':_0x44b2('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x44b2('0xb'),_0x44b2('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d33=['dynamics365_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','path','rimraf','define','int_dynamics365_fields'];(function(_0x30105f,_0xf51ccd){var _0x17759e=function(_0x5d785d){while(--_0x5d785d){_0x30105f['push'](_0x30105f['shift']());}};_0x17759e(++_0xf51ccd);}(_0x6d33,0x1e3));var _0x36d3=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0x6d33[_0x4ab3fb];return _0x34fe1e;};'use strict';var _=require(_0x36d3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x36d3('0x1'));var moment=require(_0x36d3('0x2'));var BPromise=require(_0x36d3('0x3'));var rp=require(_0x36d3('0x4'));var fs=require('fs');var path=require(_0x36d3('0x5'));var rimraf=require(_0x36d3('0x6'));var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x321503,_0x5b5a3b){return _0x321503[_0x36d3('0x7')]('Dynamics365Field',attributes,{'tableName':_0x36d3('0x8'),'paranoid':![],'indexes':[{'name':_0x36d3('0x9'),'fields':[_0x36d3('0xa'),_0x36d3('0xb')],'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 4a18fc8..86f131a 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 _0x2581=['request','then','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','Dynamics365Field,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3f7dad,_0x32d464){var _0x862fc7=function(_0x4d76a2){while(--_0x4d76a2){_0x3f7dad['push'](_0x3f7dad['shift']());}};_0x862fc7(++_0x32d464);}(_0x2581,0xcb));var _0x1258=function(_0x1c26de,_0x5c69a3){_0x1c26de=_0x1c26de-0x0;var _0x33c1dd=_0x2581[_0x1c26de];return _0x33c1dd;};'use strict';var _=require(_0x1258('0x0'));var util=require(_0x1258('0x1'));var moment=require(_0x1258('0x2'));var BPromise=require(_0x1258('0x3'));var rs=require(_0x1258('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1258('0x5'))['db'];var utils=require(_0x1258('0x6'));var logger=require(_0x1258('0x7'))(_0x1258('0x8'));var config=require(_0x1258('0x9'));var jayson=require(_0x1258('0xa'));var client=jayson[_0x1258('0xb')][_0x1258('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x582ed7,_0x3e1044,_0x21cd98){return new BPromise(function(_0x468494,_0x18bbac){return client[_0x1258('0xd')](_0x582ed7,_0x21cd98)[_0x1258('0xe')](function(_0x429efc){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x3e1044,_0x1258('0xf'));logger[_0x1258('0x10')](_0x1258('0x11'),_0x3e1044,_0x1258('0xf'),JSON['stringify'](_0x429efc));if(_0x429efc[_0x1258('0x12')]){if(_0x429efc[_0x1258('0x12')][_0x1258('0x13')]===0x1f4){logger[_0x1258('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x3e1044,_0x429efc[_0x1258('0x12')][_0x1258('0x14')]);return _0x18bbac(_0x429efc[_0x1258('0x12')][_0x1258('0x14')]);}logger[_0x1258('0x12')](_0x1258('0x15'),_0x3e1044,_0x429efc[_0x1258('0x12')]['message']);return _0x468494(_0x429efc[_0x1258('0x12')]['message']);}else{logger[_0x1258('0x16')](_0x1258('0x15'),_0x3e1044,_0x1258('0xf'));_0x468494(_0x429efc[_0x1258('0x17')][_0x1258('0x14')]);}})['catch'](function(_0x1645a6){logger[_0x1258('0x12')](_0x1258('0x15'),_0x3e1044,_0x1645a6);_0x18bbac(_0x1645a6);});});} \ No newline at end of file +var _0x2eb2=['request','then','info','request\x20sent','error','Dynamics365Field,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x401822,_0x49b445){var _0x573996=function(_0x119519){while(--_0x119519){_0x401822['push'](_0x401822['shift']());}};_0x573996(++_0x49b445);}(_0x2eb2,0x19f));var _0x22eb=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x2eb2[_0x491a7f];return _0x3d8f44;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var moment=require(_0x22eb('0x1'));var BPromise=require(_0x22eb('0x2'));var rs=require(_0x22eb('0x3'));var fs=require('fs');var Redis=require(_0x22eb('0x4'));var db=require(_0x22eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x22eb('0x7'));var client=jayson[_0x22eb('0x8')][_0x22eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a9850,_0x4539d0,_0x396806){return new BPromise(function(_0x33ddef,_0x3375d6){return client[_0x22eb('0xa')](_0x2a9850,_0x396806)[_0x22eb('0xb')](function(_0xb9c8a4){logger[_0x22eb('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'),JSON['stringify'](_0xb9c8a4));if(_0xb9c8a4[_0x22eb('0xe')]){if(_0xb9c8a4[_0x22eb('0xe')]['code']===0x1f4){logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);return _0x3375d6(_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);}logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4['error'][_0x22eb('0x10')]);return _0x33ddef(_0xb9c8a4['error'][_0x22eb('0x10')]);}else{logger[_0x22eb('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x4539d0,'request\x20sent');_0x33ddef(_0xb9c8a4['result'][_0x22eb('0x10')]);}})['catch'](function(_0x50176d){logger[_0x22eb('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x4539d0,_0x50176d);_0x3375d6(_0x50176d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 63942f7..37439c2 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 _0x83af=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x43aafc,_0x310e66){var _0x489eb3=function(_0x33d34f){while(--_0x33d34f){_0x43aafc['push'](_0x43aafc['shift']());}};_0x489eb3(++_0x310e66);}(_0x83af,0x1d1));var _0xf83a=function(_0x596e98,_0xc326c9){_0x596e98=_0x596e98-0x0;var _0x1c09ac=_0x83af[_0x596e98];return _0x1c09ac;};'use strict';var multer=require('multer');var util=require(_0xf83a('0x0'));var path=require(_0xf83a('0x1'));var timeout=require(_0xf83a('0x2'));var express=require(_0xf83a('0x3'));var router=express[_0xf83a('0x4')]();var fs_extra=require(_0xf83a('0x5'));var auth=require(_0xf83a('0x6'));var interaction=require(_0xf83a('0x7'));var config=require(_0xf83a('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0xf83a('0x9')]('/',auth[_0xf83a('0xa')](),controller[_0xf83a('0xb')]);router['get']('/:id',auth[_0xf83a('0xa')](),controller[_0xf83a('0xc')]);router[_0xf83a('0x9')](_0xf83a('0xd'),auth[_0xf83a('0xa')](),controller[_0xf83a('0xe')]);router[_0xf83a('0x9')](_0xf83a('0xf'),auth['isAuthenticated'](),controller[_0xf83a('0x10')]);router[_0xf83a('0x11')]('/',auth[_0xf83a('0xa')](),controller[_0xf83a('0x12')]);router[_0xf83a('0x11')]('/:id/configurations',auth[_0xf83a('0xa')](),controller[_0xf83a('0x13')]);router[_0xf83a('0x14')](_0xf83a('0x15'),auth[_0xf83a('0xa')](),controller[_0xf83a('0x16')]);router[_0xf83a('0x17')](_0xf83a('0x15'),auth['isAuthenticated'](),controller[_0xf83a('0x18')]);module[_0xf83a('0x19')]=router; \ No newline at end of file +var _0xd792=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports'];(function(_0x36c30a,_0x2af1df){var _0x1f12cf=function(_0x3f2054){while(--_0x3f2054){_0x36c30a['push'](_0x36c30a['shift']());}};_0x1f12cf(++_0x2af1df);}(_0xd792,0x78));var _0x2d79=function(_0x5886db,_0x4d30d4){_0x5886db=_0x5886db-0x0;var _0x537a05=_0xd792[_0x5886db];return _0x537a05;};'use strict';var multer=require(_0x2d79('0x0'));var util=require(_0x2d79('0x1'));var path=require(_0x2d79('0x2'));var timeout=require(_0x2d79('0x3'));var express=require(_0x2d79('0x4'));var router=express['Router']();var fs_extra=require(_0x2d79('0x5'));var auth=require(_0x2d79('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2d79('0x7'));var controller=require(_0x2d79('0x8'));router[_0x2d79('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2d79('0x9')](_0x2d79('0xa'),auth[_0x2d79('0xb')](),controller[_0x2d79('0xc')]);router[_0x2d79('0x9')](_0x2d79('0xd'),auth[_0x2d79('0xb')](),controller[_0x2d79('0xe')]);router['get'](_0x2d79('0xf'),auth[_0x2d79('0xb')](),controller[_0x2d79('0x10')]);router[_0x2d79('0x11')]('/',auth[_0x2d79('0xb')](),controller[_0x2d79('0x12')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x2d79('0x13')]('/:id',auth[_0x2d79('0xb')](),controller[_0x2d79('0x14')]);router[_0x2d79('0x15')](_0x2d79('0xa'),auth['isAuthenticated'](),controller[_0x2d79('0x16')]);module[_0x2d79('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 302bf42..332d20b 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 _0x84d1=['STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84d1,0x1c2));var _0x184d=function(_0x4711fc,_0x31742c){_0x4711fc=_0x4711fc-0x0;var _0x4c1eaf=_0x84d1[_0x4711fc];return _0x4c1eaf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x184d('0x0')]},'username':{'type':Sequelize[_0x184d('0x0')],'unique':_0x184d('0x1')},'apiKey':{'type':Sequelize[_0x184d('0x0')]},'remoteUri':{'type':Sequelize[_0x184d('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x184d('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0xc83d=['STRING','username','remoteUri','sequelize'];(function(_0x2ddfd9,_0x5877d0){var _0x2668f0=function(_0x70ad6f){while(--_0x70ad6f){_0x2ddfd9['push'](_0x2ddfd9['shift']());}};_0x2668f0(++_0x5877d0);}(_0xc83d,0x16f));var _0xdc83=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc83d[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xdc83('0x0'));module['exports']={'name':{'type':Sequelize[_0xdc83('0x1')]},'description':{'type':Sequelize[_0xdc83('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xdc83('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xdc83('0x1')],'unique':_0xdc83('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 8be2b36..7a954d9 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 _0xa8bb=['request-promise','bluebird','util','sox','ejs','fs-extra','squel','jsforce','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','end','json','offset','undefined','limit','count','status','set','apply','reject','save','sendStatus','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','type','merge','options','include','findAll','show','params','create','body','find','destroy','findOne','FreshdeskConfiguration','sort','getConfigurations','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','Subjects','getFields','apiKey','remoteUri','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','base64','requester','priority','group','company','remove','includes','default','custom_text','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch'];(function(_0x479341,_0x91784){var _0x42e88d=function(_0x43e2bd){while(--_0x43e2bd){_0x479341['push'](_0x479341['shift']());}};_0x42e88d(++_0x91784);}(_0xa8bb,0x1d1));var _0xba8b=function(_0x2bf0a5,_0x5a96bb){_0x2bf0a5=_0x2bf0a5-0x0;var _0x5996ef=_0xa8bb[_0x2bf0a5];return _0x5996ef;};'use strict';var emlformat=require(_0xba8b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba8b('0x1'));var jsonpatch=require(_0xba8b('0x2'));var rp=require(_0xba8b('0x3'));var moment=require('moment');var BPromise=require(_0xba8b('0x4'));var Mustache=require('mustache');var util=require(_0xba8b('0x5'));var path=require('path');var sox=require(_0xba8b('0x6'));var csv=require('to-csv');var ejs=require(_0xba8b('0x7'));var fs=require('fs');var fs_extra=require(_0xba8b('0x8'));var _=require('lodash');var squel=require(_0xba8b('0x9'));var crypto=require('crypto');var jsforce=require(_0xba8b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xba8b('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xba8b('0xc'));var authService=require(_0xba8b('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba8b('0xe'));var logger=require(_0xba8b('0xf'))(_0xba8b('0x10'));var utils=require(_0xba8b('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xba8b('0x12'));var db=require(_0xba8b('0x13'))['db'];var integrations=require(_0xba8b('0x14'));var jayson=require(_0xba8b('0x15'));var client=jayson[_0xba8b('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bf14e,_0x4c89d3,_0x138243,_0x2fba97){return new BPromise(function(_0x141a59,_0x38b667){var _0x2fc1cc=_0x2fba97||client;return _0x2fc1cc[_0xba8b('0x17')](_0x2bf14e,_0x138243)[_0xba8b('0x18')](function(_0x310434){logger['info'](_0xba8b('0x19'),_0x4c89d3,_0xba8b('0x1a'));logger[_0xba8b('0x1b')](_0xba8b('0x1c'),_0x4c89d3,'request\x20sent',JSON[_0xba8b('0x1d')](_0x310434));if(_0x310434['error']){if(_0x310434[_0xba8b('0x1e')][_0xba8b('0x1f')]===0x1f4){logger[_0xba8b('0x1e')](_0xba8b('0x19'),_0x4c89d3,_0x310434[_0xba8b('0x1e')]['message']);return _0x38b667(_0x310434['error'][_0xba8b('0x20')]);}logger['error'](_0xba8b('0x19'),_0x4c89d3,_0x310434[_0xba8b('0x1e')][_0xba8b('0x20')]);return _0x141a59(_0x310434[_0xba8b('0x1e')][_0xba8b('0x20')]);}else{logger[_0xba8b('0x21')](_0xba8b('0x19'),_0x4c89d3,'request\x20sent');_0x141a59(_0x310434[_0xba8b('0x22')][_0xba8b('0x20')]);}})[_0xba8b('0x23')](function(_0x5a277a){logger[_0xba8b('0x1e')](_0xba8b('0x19'),_0x4c89d3,_0x5a277a);_0x38b667(_0x5a277a);});});}function respondWithStatusCode(_0x25f96b,_0x865f29){_0x865f29=_0x865f29||0xcc;return function(_0x1a09d2){if(_0x1a09d2){return _0x25f96b['sendStatus'](_0x865f29);}return _0x25f96b['status'](_0x865f29)[_0xba8b('0x24')]();};}function respondWithResult(_0x533971,_0x1b8d68){_0x1b8d68=_0x1b8d68||0xc8;return function(_0x32fe43){if(_0x32fe43){return _0x533971['status'](_0x1b8d68)[_0xba8b('0x25')](_0x32fe43);}};}function respondWithFilteredResult(_0x39d94c,_0x176ca3){return function(_0x20b4d5){if(_0x20b4d5){var _0x20cc03=typeof _0x176ca3[_0xba8b('0x26')]===_0xba8b('0x27')&&typeof _0x176ca3[_0xba8b('0x28')]===_0xba8b('0x27');var _0x1be00f=_0x20b4d5[_0xba8b('0x29')];var _0x433299=_0x20cc03?0x0:_0x176ca3['offset'];var _0x323844=_0x20cc03?_0x20b4d5['count']:_0x176ca3[_0xba8b('0x26')]+_0x176ca3[_0xba8b('0x28')];var _0x33b10b;if(_0x323844>=_0x1be00f){_0x323844=_0x1be00f;_0x33b10b=0xc8;}else{_0x33b10b=0xce;}_0x39d94c[_0xba8b('0x2a')](_0x33b10b);return _0x39d94c[_0xba8b('0x2b')]('Content-Range',_0x433299+'-'+_0x323844+'/'+_0x1be00f)[_0xba8b('0x25')](_0x20b4d5);}return null;};}function patchUpdates(_0x52d577){return function(_0xc1e32f){try{jsonpatch[_0xba8b('0x2c')](_0xc1e32f,_0x52d577,!![]);}catch(_0x176928){return BPromise[_0xba8b('0x2d')](_0x176928);}return _0xc1e32f[_0xba8b('0x2e')]();};}function saveUpdates(_0x35ca5e,_0xbb550f){return function(_0x3e4326){if(_0x3e4326){return _0x3e4326['update'](_0x35ca5e)['then'](function(_0xac12cc){return _0xac12cc;});}return null;};}function removeEntity(_0x585110,_0x8c490e){return function(_0x56c159){if(_0x56c159){return _0x56c159['destroy']()[_0xba8b('0x18')](function(){_0x585110['status'](0xcc)[_0xba8b('0x24')]();});}};}function handleEntityNotFound(_0x454dea,_0x12d5fa){return function(_0x21b471){if(!_0x21b471){_0x454dea[_0xba8b('0x2f')](0x194);}return _0x21b471;};}function handleError(_0x4e7b95,_0x1b27f5){_0x1b27f5=_0x1b27f5||0x1f4;return function(_0x409b9a){logger[_0xba8b('0x1e')](_0x409b9a[_0xba8b('0x30')]);if(_0x409b9a[_0xba8b('0x31')]){delete _0x409b9a['name'];}_0x4e7b95[_0xba8b('0x2a')](_0x1b27f5)[_0xba8b('0x32')](_0x409b9a);};}exports[_0xba8b('0x33')]=function(_0x43b6a7,_0x39ddc0){var _0x358f55={},_0x415102={},_0x3062f5={'count':0x0,'rows':[]};var _0x397104=_[_0xba8b('0x34')](db[_0xba8b('0x35')][_0xba8b('0x36')],function(_0x1909eb){return{'name':_0x1909eb[_0xba8b('0x37')],'type':_0x1909eb['type'][_0xba8b('0x38')]};});_0x415102['model']=_[_0xba8b('0x34')](_0x397104,_0xba8b('0x31'));_0x415102[_0xba8b('0x39')]=_[_0xba8b('0x3a')](_0x43b6a7['query']);_0x415102[_0xba8b('0x3b')]=_[_0xba8b('0x3c')](_0x415102[_0xba8b('0x3d')],_0x415102[_0xba8b('0x39')]);_0x358f55[_0xba8b('0x3e')]=_[_0xba8b('0x3c')](_0x415102['model'],qs[_0xba8b('0x3f')](_0x43b6a7[_0xba8b('0x39')]['fields']));_0x358f55[_0xba8b('0x3e')]=_0x358f55['attributes'][_0xba8b('0x40')]?_0x358f55[_0xba8b('0x3e')]:_0x415102[_0xba8b('0x3d')];if(!_0x43b6a7[_0xba8b('0x39')][_0xba8b('0x41')](_0xba8b('0x42'))){_0x358f55[_0xba8b('0x28')]=qs[_0xba8b('0x28')](_0x43b6a7['query'][_0xba8b('0x28')]);_0x358f55[_0xba8b('0x26')]=qs[_0xba8b('0x26')](_0x43b6a7[_0xba8b('0x39')][_0xba8b('0x26')]);}_0x358f55[_0xba8b('0x43')]=qs['sort'](_0x43b6a7['query']['sort']);_0x358f55[_0xba8b('0x44')]=qs['filters'](_[_0xba8b('0x45')](_0x43b6a7[_0xba8b('0x39')],_0x415102['filters']),_0x397104);if(_0x43b6a7[_0xba8b('0x39')][_0xba8b('0x46')]){_0x358f55[_0xba8b('0x44')]=_['merge'](_0x358f55[_0xba8b('0x44')],{'$or':_[_0xba8b('0x34')](_0x397104,function(_0x59aff1){if(_0x59aff1[_0xba8b('0x47')]!=='VIRTUAL'){var _0x20d64f={};_0x20d64f[_0x59aff1['name']]={'$like':'%'+_0x43b6a7[_0xba8b('0x39')][_0xba8b('0x46')]+'%'};return _0x20d64f;}})});}_0x358f55=_[_0xba8b('0x48')]({},_0x358f55,_0x43b6a7[_0xba8b('0x49')]);var _0x20c19e={'where':_0x358f55['where']};return db['FreshdeskAccount']['count'](_0x20c19e)[_0xba8b('0x18')](function(_0x302b7c){_0x3062f5[_0xba8b('0x29')]=_0x302b7c;if(_0x43b6a7[_0xba8b('0x39')]['includeAll']){_0x358f55[_0xba8b('0x4a')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xba8b('0x4b')](_0x358f55);})[_0xba8b('0x18')](function(_0xeea28a){_0x3062f5['rows']=_0xeea28a;return _0x3062f5;})[_0xba8b('0x18')](respondWithFilteredResult(_0x39ddc0,_0x358f55))[_0xba8b('0x23')](handleError(_0x39ddc0,null));};exports[_0xba8b('0x4c')]=function(_0x3edee,_0x5ab0da){var _0x4e366a={'raw':![],'where':{'id':_0x3edee[_0xba8b('0x4d')]['id']}},_0x314f93={};_0x314f93[_0xba8b('0x3d')]=_[_0xba8b('0x3a')](db[_0xba8b('0x35')][_0xba8b('0x36')]);_0x314f93['query']=_[_0xba8b('0x3a')](_0x3edee[_0xba8b('0x39')]);_0x314f93[_0xba8b('0x3b')]=_[_0xba8b('0x3c')](_0x314f93['model'],_0x314f93[_0xba8b('0x39')]);_0x4e366a['attributes']=_[_0xba8b('0x3c')](_0x314f93[_0xba8b('0x3d')],qs[_0xba8b('0x3f')](_0x3edee[_0xba8b('0x39')]['fields']));_0x4e366a[_0xba8b('0x3e')]=_0x4e366a[_0xba8b('0x3e')][_0xba8b('0x40')]?_0x4e366a[_0xba8b('0x3e')]:_0x314f93[_0xba8b('0x3d')];if(_0x3edee[_0xba8b('0x39')]['includeAll']){_0x4e366a[_0xba8b('0x4a')]=[{'all':!![]}];}_0x4e366a=_[_0xba8b('0x48')]({},_0x4e366a,_0x3edee[_0xba8b('0x49')]);return db[_0xba8b('0x35')]['find'](_0x4e366a)['then'](handleEntityNotFound(_0x5ab0da,null))['then'](respondWithResult(_0x5ab0da,null))[_0xba8b('0x23')](handleError(_0x5ab0da,null));};exports[_0xba8b('0x4e')]=function(_0x58559e,_0x79bcc9){return db[_0xba8b('0x35')][_0xba8b('0x4e')](_0x58559e[_0xba8b('0x4f')],{})[_0xba8b('0x18')](respondWithResult(_0x79bcc9,0xc9))[_0xba8b('0x23')](handleError(_0x79bcc9,null));};exports['update']=function(_0x284927,_0x5eb1a2){if(_0x284927[_0xba8b('0x4f')]['id']){delete _0x284927[_0xba8b('0x4f')]['id'];}return db['FreshdeskAccount'][_0xba8b('0x50')]({'where':{'id':_0x284927[_0xba8b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5eb1a2,null))['then'](saveUpdates(_0x284927[_0xba8b('0x4f')],null))[_0xba8b('0x18')](respondWithResult(_0x5eb1a2,null))['catch'](handleError(_0x5eb1a2,null));};exports[_0xba8b('0x51')]=function(_0x244da2,_0x5b9fe0){return db[_0xba8b('0x35')][_0xba8b('0x50')]({'where':{'id':_0x244da2['params']['id']}})['then'](handleEntityNotFound(_0x5b9fe0,null))[_0xba8b('0x18')](removeEntity(_0x5b9fe0,null))[_0xba8b('0x23')](handleError(_0x5b9fe0,null));};exports['getConfigurations']=function(_0x2ba01e,_0x1f3fd2,_0x27b79c){var _0x26323f={};var _0x5e7755={};var _0x262c73;var _0x3532fa;return db['FreshdeskAccount'][_0xba8b('0x52')]({'where':{'id':_0x2ba01e[_0xba8b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1f3fd2,null))[_0xba8b('0x18')](function(_0x7cbf3e){if(_0x7cbf3e){_0x262c73=_0x7cbf3e;_0x5e7755[_0xba8b('0x3d')]=_[_0xba8b('0x3a')](db[_0xba8b('0x53')][_0xba8b('0x36')]);_0x5e7755[_0xba8b('0x39')]=_[_0xba8b('0x3a')](_0x2ba01e[_0xba8b('0x39')]);_0x5e7755[_0xba8b('0x3b')]=_[_0xba8b('0x3c')](_0x5e7755[_0xba8b('0x3d')],_0x5e7755[_0xba8b('0x39')]);_0x26323f[_0xba8b('0x3e')]=_[_0xba8b('0x3c')](_0x5e7755[_0xba8b('0x3d')],qs[_0xba8b('0x3f')](_0x2ba01e['query']['fields']));_0x26323f[_0xba8b('0x3e')]=_0x26323f['attributes'][_0xba8b('0x40')]?_0x26323f[_0xba8b('0x3e')]:_0x5e7755[_0xba8b('0x3d')];_0x26323f[_0xba8b('0x43')]=qs[_0xba8b('0x54')](_0x2ba01e[_0xba8b('0x39')][_0xba8b('0x54')]);_0x26323f['where']=qs[_0xba8b('0x3b')](_[_0xba8b('0x45')](_0x2ba01e[_0xba8b('0x39')],_0x5e7755[_0xba8b('0x3b')]));if(_0x2ba01e[_0xba8b('0x39')]['filter']){_0x26323f[_0xba8b('0x44')]=_['merge'](_0x26323f[_0xba8b('0x44')],{'$or':_[_0xba8b('0x34')](_0x26323f[_0xba8b('0x3e')],function(_0x4cfff8){var _0x25cdda={};_0x25cdda[_0x4cfff8]={'$like':'%'+_0x2ba01e['query'][_0xba8b('0x46')]+'%'};return _0x25cdda;})});}_0x26323f=_[_0xba8b('0x48')]({},_0x26323f,_0x2ba01e[_0xba8b('0x49')]);return _0x262c73[_0xba8b('0x55')](_0x26323f);}})[_0xba8b('0x18')](function(_0x2fb30c){if(_0x2fb30c){_0x3532fa=_0x2fb30c['length'];if(!_0x2ba01e[_0xba8b('0x39')][_0xba8b('0x41')]('nolimit')){_0x26323f[_0xba8b('0x28')]=qs[_0xba8b('0x28')](_0x2ba01e[_0xba8b('0x39')][_0xba8b('0x28')]);_0x26323f[_0xba8b('0x26')]=qs[_0xba8b('0x26')](_0x2ba01e[_0xba8b('0x39')][_0xba8b('0x26')]);}return _0x262c73['getConfigurations'](_0x26323f);}})[_0xba8b('0x18')](function(_0x51eeca){if(_0x51eeca){return _0x51eeca?{'count':_0x3532fa,'rows':_0x51eeca}:null;}})[_0xba8b('0x18')](respondWithResult(_0x1f3fd2,null))[_0xba8b('0x23')](handleError(_0x1f3fd2,null));};exports[_0xba8b('0x56')]=function(_0x19da8e,_0x4f6de4,_0x4d65cf){if(_0x19da8e[_0xba8b('0x4f')]['id']){delete _0x19da8e[_0xba8b('0x4f')]['id'];}return db[_0xba8b('0x35')][_0xba8b('0x52')]({'where':{'id':_0x19da8e[_0xba8b('0x4d')]['id']}})[_0xba8b('0x18')](handleEntityNotFound(_0x4f6de4,null))[_0xba8b('0x18')](function(_0x385a89){if(_0x385a89){_0x19da8e[_0xba8b('0x4f')][_0xba8b('0x57')]=_0x385a89['id'];_0x19da8e['body']['Subjects']=integrations[_0xba8b('0x58')](_0x19da8e[_0xba8b('0x4f')]['channel'],_0x19da8e[_0xba8b('0x4f')][_0xba8b('0x47')]);_0x19da8e[_0xba8b('0x4f')][_0xba8b('0x59')]=integrations[_0xba8b('0x5a')](_0x19da8e['body'][_0xba8b('0x5b')],_0x19da8e[_0xba8b('0x4f')][_0xba8b('0x47')]);return db[_0xba8b('0x53')]['create'](_0x19da8e[_0xba8b('0x4f')],{'include':[{'model':db[_0xba8b('0x5c')],'as':_0xba8b('0x5d')},{'model':db[_0xba8b('0x5c')],'as':_0xba8b('0x59')}]});}return null;})[_0xba8b('0x18')](respondWithResult(_0x4f6de4,null))[_0xba8b('0x23')](handleError(_0x4f6de4,null));};exports[_0xba8b('0x5e')]=function(_0x5241c9,_0x43a535,_0x106952){var _0x5f352e='';return db[_0xba8b('0x35')][_0xba8b('0x52')]({'where':{'id':_0x5241c9[_0xba8b('0x4d')]['id']},'attributes':['id','remoteUri',_0xba8b('0x5f')]})['then'](handleEntityNotFound(_0x43a535,null))[_0xba8b('0x18')](function(_0x490761){if(_0x490761){_0x5f352e=_0x490761[_0xba8b('0x60')];var _0x242f74=_0x5f352e['slice'](-0x1);if(_0x242f74==='/'){_0x5f352e=_0x5f352e[_0xba8b('0x61')](0x0,_0x5f352e[_0xba8b('0x62')](_0x242f74));}return rp({'method':_0xba8b('0x63'),'uri':util[_0xba8b('0x64')](_0xba8b('0x65'),_0x5f352e,_0xba8b('0x66')),'headers':{'Authorization':util[_0xba8b('0x64')]('Basic\x20%s',new Buffer(util[_0xba8b('0x64')](_0xba8b('0x67'),_0x490761['apiKey']))['toString'](_0xba8b('0x68')))},'json':!![]});}})[_0xba8b('0x18')](function(_0xcd79cd){if(_0xcd79cd){var _0x367cc3=[_0xba8b('0x69'),'subject','agent','description','status',_0xba8b('0x6a'),_0xba8b('0x6b'),'source','ticket_type',_0xba8b('0x6b'),_0xba8b('0x6c')];_[_0xba8b('0x6d')](_0xcd79cd,function(_0x5e9db4){return _0x367cc3[_0xba8b('0x6e')](_0x5e9db4[_0xba8b('0x31')])||!_0x5e9db4[_0xba8b('0x6f')]&&_0x5e9db4[_0xba8b('0x47')]!==_0xba8b('0x70')&&_0x5e9db4[_0xba8b('0x47')]!=='custom_dropdown';});return{'count':_0xcd79cd[_0xba8b('0x40')],'rows':_[_0xba8b('0x34')](_0xcd79cd,function(_0x3e1825){return{'id':_0x3e1825[_0xba8b('0x31')],'name':_0x3e1825['label'],'custom':!_0x3e1825[_0xba8b('0x6f')],'options':_0x3e1825[_0xba8b('0x71')]?_[_0xba8b('0x34')](_0x3e1825[_0xba8b('0x71')],function(_0x4cb277){return{'name':_['capitalize'](_0x4cb277),'value':_0x4cb277};}):[]};})};}})['then'](respondWithResult(_0x43a535,null))[_0xba8b('0x23')](function(_0x127fd7){var _0x875ee=_0x5241c9['query'][_0xba8b('0x72')]?0x1f4:_0x127fd7[_0xba8b('0x73')]||0x1f4;logger[_0xba8b('0x1e')](_0xba8b('0x74'),_0xba8b('0x5e'),_0x875ee,JSON[_0xba8b('0x1d')](_0x127fd7));delete _0x127fd7['name'];if(_0x875ee===0x191){_0x875ee=0x190;}_0x43a535[_0xba8b('0x2a')](_0x875ee)[_0xba8b('0x32')](_0x5241c9[_0xba8b('0x39')][_0xba8b('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x127fd7['statusCode']}:_0x127fd7);});}; \ No newline at end of file +var _0x0c02=['http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','limit','count','set','apply','reject','save','update','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','FreshdeskAccount','includeAll','rows','catch','show','params','include','find','create','body','getConfigurations','FreshdeskConfiguration','merge','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','apiKey','remoteUri','slice','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','company','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../components/integrations/configuration','client'];(function(_0xb042e4,_0x5d402e){var _0xfcb441=function(_0x55a578){while(--_0x55a578){_0xb042e4['push'](_0xb042e4['shift']());}};_0xfcb441(++_0x5d402e);}(_0x0c02,0xdc));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x20c0('0x0'));var rimraf=require(_0x20c0('0x1'));var zipdir=require(_0x20c0('0x2'));var jsonpatch=require(_0x20c0('0x3'));var rp=require(_0x20c0('0x4'));var moment=require(_0x20c0('0x5'));var BPromise=require(_0x20c0('0x6'));var Mustache=require(_0x20c0('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x20c0('0x8'));var _=require(_0x20c0('0x9'));var squel=require(_0x20c0('0xa'));var crypto=require(_0x20c0('0xb'));var jsforce=require(_0x20c0('0xc'));var deskjs=require(_0x20c0('0xd'));var toCsv=require(_0x20c0('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x20c0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x20c0('0x10'));var as=require(_0x20c0('0x11'));var hardwareService=require(_0x20c0('0x12'));var logger=require(_0x20c0('0x13'))(_0x20c0('0x14'));var utils=require(_0x20c0('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x20c0('0x16'));var jayson=require('jayson/promise');var client=jayson[_0x20c0('0x17')][_0x20c0('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x25ec8d,_0x2bd9ea,_0x1ec5d0,_0x1c3593){return new BPromise(function(_0x173a4e,_0x2ef228){var _0x2090a2=_0x1c3593||client;return _0x2090a2[_0x20c0('0x19')](_0x25ec8d,_0x1ec5d0)[_0x20c0('0x1a')](function(_0xbe35bd){logger[_0x20c0('0x1b')](_0x20c0('0x1c'),_0x2bd9ea,_0x20c0('0x1d'));logger[_0x20c0('0x1e')](_0x20c0('0x1f'),_0x2bd9ea,_0x20c0('0x1d'),JSON[_0x20c0('0x20')](_0xbe35bd));if(_0xbe35bd[_0x20c0('0x21')]){if(_0xbe35bd['error'][_0x20c0('0x22')]===0x1f4){logger[_0x20c0('0x21')](_0x20c0('0x1c'),_0x2bd9ea,_0xbe35bd[_0x20c0('0x21')][_0x20c0('0x23')]);return _0x2ef228(_0xbe35bd[_0x20c0('0x21')][_0x20c0('0x23')]);}logger[_0x20c0('0x21')](_0x20c0('0x1c'),_0x2bd9ea,_0xbe35bd[_0x20c0('0x21')][_0x20c0('0x23')]);return _0x173a4e(_0xbe35bd[_0x20c0('0x21')][_0x20c0('0x23')]);}else{logger[_0x20c0('0x1b')]('FreshdeskAccount,\x20%s,\x20%s',_0x2bd9ea,_0x20c0('0x1d'));_0x173a4e(_0xbe35bd[_0x20c0('0x24')]['message']);}})['catch'](function(_0x8102df){logger[_0x20c0('0x21')](_0x20c0('0x1c'),_0x2bd9ea,_0x8102df);_0x2ef228(_0x8102df);});});}function respondWithStatusCode(_0x8d32a,_0x3c4e75){_0x3c4e75=_0x3c4e75||0xcc;return function(_0x2b4b84){if(_0x2b4b84){return _0x8d32a['sendStatus'](_0x3c4e75);}return _0x8d32a[_0x20c0('0x25')](_0x3c4e75)['end']();};}function respondWithResult(_0x479b07,_0x54532e){_0x54532e=_0x54532e||0xc8;return function(_0x426f13){if(_0x426f13){return _0x479b07['status'](_0x54532e)[_0x20c0('0x26')](_0x426f13);}};}function respondWithFilteredResult(_0x5b1097,_0x2856ea){return function(_0x3d1be2){if(_0x3d1be2){var _0x4e6ac6=typeof _0x2856ea[_0x20c0('0x27')]==='undefined'&&typeof _0x2856ea[_0x20c0('0x28')]==='undefined';var _0x42d2cb=_0x3d1be2['count'];var _0x1de016=_0x4e6ac6?0x0:_0x2856ea[_0x20c0('0x27')];var _0x3fa50e=_0x4e6ac6?_0x3d1be2[_0x20c0('0x29')]:_0x2856ea[_0x20c0('0x27')]+_0x2856ea['limit'];var _0x4c29d0;if(_0x3fa50e>=_0x42d2cb){_0x3fa50e=_0x42d2cb;_0x4c29d0=0xc8;}else{_0x4c29d0=0xce;}_0x5b1097[_0x20c0('0x25')](_0x4c29d0);return _0x5b1097[_0x20c0('0x2a')]('Content-Range',_0x1de016+'-'+_0x3fa50e+'/'+_0x42d2cb)[_0x20c0('0x26')](_0x3d1be2);}return null;};}function patchUpdates(_0x364bf8){return function(_0x9bc84b){try{jsonpatch[_0x20c0('0x2b')](_0x9bc84b,_0x364bf8,!![]);}catch(_0x127a62){return BPromise[_0x20c0('0x2c')](_0x127a62);}return _0x9bc84b[_0x20c0('0x2d')]();};}function saveUpdates(_0x15b524,_0x49f43f){return function(_0x58d9b5){if(_0x58d9b5){return _0x58d9b5[_0x20c0('0x2e')](_0x15b524)['then'](function(_0x5b0e65){return _0x5b0e65;});}return null;};}function removeEntity(_0x1f3411,_0x446724){return function(_0x26640d){if(_0x26640d){return _0x26640d['destroy']()[_0x20c0('0x1a')](function(){_0x1f3411['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x293465,_0x453266){return function(_0x5afa14){if(!_0x5afa14){_0x293465['sendStatus'](0x194);}return _0x5afa14;};}function handleError(_0x2354bd,_0x3f8099){_0x3f8099=_0x3f8099||0x1f4;return function(_0x37aa17){logger[_0x20c0('0x21')](_0x37aa17['stack']);if(_0x37aa17[_0x20c0('0x2f')]){delete _0x37aa17['name'];}_0x2354bd[_0x20c0('0x25')](_0x3f8099)['send'](_0x37aa17);};}exports[_0x20c0('0x30')]=function(_0x326bdf,_0x52a516){var _0x1ae004={},_0x1bd343={},_0x399670={'count':0x0,'rows':[]};var _0x5c16ec=_['map'](db['FreshdeskAccount'][_0x20c0('0x31')],function(_0xcf08c1){return{'name':_0xcf08c1[_0x20c0('0x32')],'type':_0xcf08c1[_0x20c0('0x33')][_0x20c0('0x34')]};});_0x1bd343[_0x20c0('0x35')]=_[_0x20c0('0x36')](_0x5c16ec,'name');_0x1bd343[_0x20c0('0x37')]=_[_0x20c0('0x38')](_0x326bdf[_0x20c0('0x37')]);_0x1bd343[_0x20c0('0x39')]=_['intersection'](_0x1bd343[_0x20c0('0x35')],_0x1bd343[_0x20c0('0x37')]);_0x1ae004[_0x20c0('0x3a')]=_[_0x20c0('0x3b')](_0x1bd343[_0x20c0('0x35')],qs[_0x20c0('0x3c')](_0x326bdf[_0x20c0('0x37')]['fields']));_0x1ae004[_0x20c0('0x3a')]=_0x1ae004[_0x20c0('0x3a')][_0x20c0('0x3d')]?_0x1ae004['attributes']:_0x1bd343[_0x20c0('0x35')];if(!_0x326bdf[_0x20c0('0x37')][_0x20c0('0x3e')]('nolimit')){_0x1ae004['limit']=qs[_0x20c0('0x28')](_0x326bdf[_0x20c0('0x37')]['limit']);_0x1ae004[_0x20c0('0x27')]=qs[_0x20c0('0x27')](_0x326bdf['query']['offset']);}_0x1ae004[_0x20c0('0x3f')]=qs[_0x20c0('0x40')](_0x326bdf[_0x20c0('0x37')][_0x20c0('0x40')]);_0x1ae004[_0x20c0('0x41')]=qs[_0x20c0('0x39')](_[_0x20c0('0x42')](_0x326bdf[_0x20c0('0x37')],_0x1bd343[_0x20c0('0x39')]),_0x5c16ec);if(_0x326bdf['query'][_0x20c0('0x43')]){_0x1ae004[_0x20c0('0x41')]=_['merge'](_0x1ae004[_0x20c0('0x41')],{'$or':_['map'](_0x5c16ec,function(_0x9544f5){if(_0x9544f5[_0x20c0('0x33')]!==_0x20c0('0x44')){var _0x2a1dd5={};_0x2a1dd5[_0x9544f5[_0x20c0('0x2f')]]={'$like':'%'+_0x326bdf[_0x20c0('0x37')]['filter']+'%'};return _0x2a1dd5;}})});}_0x1ae004=_['merge']({},_0x1ae004,_0x326bdf[_0x20c0('0x45')]);var _0x59934a={'where':_0x1ae004['where']};return db[_0x20c0('0x46')]['count'](_0x59934a)[_0x20c0('0x1a')](function(_0xf29d8f){_0x399670[_0x20c0('0x29')]=_0xf29d8f;if(_0x326bdf['query'][_0x20c0('0x47')]){_0x1ae004['include']=[{'all':!![]}];}return db[_0x20c0('0x46')]['findAll'](_0x1ae004);})[_0x20c0('0x1a')](function(_0x54a4cb){_0x399670[_0x20c0('0x48')]=_0x54a4cb;return _0x399670;})[_0x20c0('0x1a')](respondWithFilteredResult(_0x52a516,_0x1ae004))[_0x20c0('0x49')](handleError(_0x52a516,null));};exports[_0x20c0('0x4a')]=function(_0x3318cd,_0x2ed42a){var _0x1f0822={'raw':![],'where':{'id':_0x3318cd[_0x20c0('0x4b')]['id']}},_0x3fb49c={};_0x3fb49c[_0x20c0('0x35')]=_[_0x20c0('0x38')](db['FreshdeskAccount'][_0x20c0('0x31')]);_0x3fb49c[_0x20c0('0x37')]=_['keys'](_0x3318cd[_0x20c0('0x37')]);_0x3fb49c[_0x20c0('0x39')]=_[_0x20c0('0x3b')](_0x3fb49c[_0x20c0('0x35')],_0x3fb49c['query']);_0x1f0822[_0x20c0('0x3a')]=_['intersection'](_0x3fb49c[_0x20c0('0x35')],qs['fields'](_0x3318cd[_0x20c0('0x37')][_0x20c0('0x3c')]));_0x1f0822[_0x20c0('0x3a')]=_0x1f0822['attributes'][_0x20c0('0x3d')]?_0x1f0822['attributes']:_0x3fb49c[_0x20c0('0x35')];if(_0x3318cd[_0x20c0('0x37')]['includeAll']){_0x1f0822[_0x20c0('0x4c')]=[{'all':!![]}];}_0x1f0822=_['merge']({},_0x1f0822,_0x3318cd[_0x20c0('0x45')]);return db[_0x20c0('0x46')][_0x20c0('0x4d')](_0x1f0822)[_0x20c0('0x1a')](handleEntityNotFound(_0x2ed42a,null))[_0x20c0('0x1a')](respondWithResult(_0x2ed42a,null))[_0x20c0('0x49')](handleError(_0x2ed42a,null));};exports[_0x20c0('0x4e')]=function(_0x286fc5,_0x923e96){return db[_0x20c0('0x46')][_0x20c0('0x4e')](_0x286fc5['body'],{})[_0x20c0('0x1a')](respondWithResult(_0x923e96,0xc9))[_0x20c0('0x49')](handleError(_0x923e96,null));};exports[_0x20c0('0x2e')]=function(_0x4e45b2,_0x14707f){if(_0x4e45b2['body']['id']){delete _0x4e45b2['body']['id'];}return db['FreshdeskAccount'][_0x20c0('0x4d')]({'where':{'id':_0x4e45b2[_0x20c0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x14707f,null))['then'](saveUpdates(_0x4e45b2[_0x20c0('0x4f')],null))[_0x20c0('0x1a')](respondWithResult(_0x14707f,null))['catch'](handleError(_0x14707f,null));};exports['destroy']=function(_0x2127a8,_0x1f9d04){return db[_0x20c0('0x46')]['find']({'where':{'id':_0x2127a8[_0x20c0('0x4b')]['id']}})[_0x20c0('0x1a')](handleEntityNotFound(_0x1f9d04,null))[_0x20c0('0x1a')](removeEntity(_0x1f9d04,null))[_0x20c0('0x49')](handleError(_0x1f9d04,null));};exports[_0x20c0('0x50')]=function(_0x5743fc,_0x40416d,_0x20e57c){var _0x4a1bd5={};var _0x3af9de={};var _0xf93d68;var _0x1b01f3;return db[_0x20c0('0x46')]['findOne']({'where':{'id':_0x5743fc['params']['id']}})[_0x20c0('0x1a')](handleEntityNotFound(_0x40416d,null))['then'](function(_0x57ba77){if(_0x57ba77){_0xf93d68=_0x57ba77;_0x3af9de[_0x20c0('0x35')]=_['keys'](db[_0x20c0('0x51')][_0x20c0('0x31')]);_0x3af9de[_0x20c0('0x37')]=_[_0x20c0('0x38')](_0x5743fc['query']);_0x3af9de[_0x20c0('0x39')]=_[_0x20c0('0x3b')](_0x3af9de[_0x20c0('0x35')],_0x3af9de[_0x20c0('0x37')]);_0x4a1bd5['attributes']=_[_0x20c0('0x3b')](_0x3af9de['model'],qs[_0x20c0('0x3c')](_0x5743fc[_0x20c0('0x37')][_0x20c0('0x3c')]));_0x4a1bd5[_0x20c0('0x3a')]=_0x4a1bd5['attributes'][_0x20c0('0x3d')]?_0x4a1bd5[_0x20c0('0x3a')]:_0x3af9de[_0x20c0('0x35')];_0x4a1bd5[_0x20c0('0x3f')]=qs[_0x20c0('0x40')](_0x5743fc[_0x20c0('0x37')]['sort']);_0x4a1bd5[_0x20c0('0x41')]=qs[_0x20c0('0x39')](_[_0x20c0('0x42')](_0x5743fc[_0x20c0('0x37')],_0x3af9de[_0x20c0('0x39')]));if(_0x5743fc[_0x20c0('0x37')]['filter']){_0x4a1bd5[_0x20c0('0x41')]=_[_0x20c0('0x52')](_0x4a1bd5[_0x20c0('0x41')],{'$or':_['map'](_0x4a1bd5[_0x20c0('0x3a')],function(_0x527dba){var _0x5bb9a9={};_0x5bb9a9[_0x527dba]={'$like':'%'+_0x5743fc[_0x20c0('0x37')][_0x20c0('0x43')]+'%'};return _0x5bb9a9;})});}_0x4a1bd5=_['merge']({},_0x4a1bd5,_0x5743fc[_0x20c0('0x45')]);return _0xf93d68[_0x20c0('0x50')](_0x4a1bd5);}})[_0x20c0('0x1a')](function(_0x3ed2ee){if(_0x3ed2ee){_0x1b01f3=_0x3ed2ee[_0x20c0('0x3d')];if(!_0x5743fc[_0x20c0('0x37')][_0x20c0('0x3e')](_0x20c0('0x53'))){_0x4a1bd5['limit']=qs['limit'](_0x5743fc[_0x20c0('0x37')]['limit']);_0x4a1bd5[_0x20c0('0x27')]=qs['offset'](_0x5743fc[_0x20c0('0x37')][_0x20c0('0x27')]);}return _0xf93d68[_0x20c0('0x50')](_0x4a1bd5);}})[_0x20c0('0x1a')](function(_0x3f9757){if(_0x3f9757){return _0x3f9757?{'count':_0x1b01f3,'rows':_0x3f9757}:null;}})['then'](respondWithResult(_0x40416d,null))['catch'](handleError(_0x40416d,null));};exports[_0x20c0('0x54')]=function(_0x144720,_0x21f7fe,_0x4b6b5c){if(_0x144720['body']['id']){delete _0x144720[_0x20c0('0x4f')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x144720[_0x20c0('0x4b')]['id']}})[_0x20c0('0x1a')](handleEntityNotFound(_0x21f7fe,null))[_0x20c0('0x1a')](function(_0x30a7d7){if(_0x30a7d7){_0x144720[_0x20c0('0x4f')][_0x20c0('0x55')]=_0x30a7d7['id'];_0x144720['body'][_0x20c0('0x56')]=integrations['getSubjects'](_0x144720['body'][_0x20c0('0x57')],_0x144720['body'][_0x20c0('0x33')]);_0x144720[_0x20c0('0x4f')][_0x20c0('0x58')]=integrations[_0x20c0('0x59')](_0x144720['body'][_0x20c0('0x57')],_0x144720[_0x20c0('0x4f')][_0x20c0('0x33')]);return db[_0x20c0('0x51')][_0x20c0('0x4e')](_0x144720['body'],{'include':[{'model':db[_0x20c0('0x5a')],'as':_0x20c0('0x56')},{'model':db[_0x20c0('0x5a')],'as':_0x20c0('0x58')}]});}return null;})[_0x20c0('0x1a')](respondWithResult(_0x21f7fe,null))[_0x20c0('0x49')](handleError(_0x21f7fe,null));};exports['getFields']=function(_0x2fa300,_0x4e224f,_0x4b31b9){var _0x1fd5ce='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x2fa300[_0x20c0('0x4b')]['id']},'attributes':['id','remoteUri',_0x20c0('0x5b')]})[_0x20c0('0x1a')](handleEntityNotFound(_0x4e224f,null))[_0x20c0('0x1a')](function(_0x41e66b){if(_0x41e66b){_0x1fd5ce=_0x41e66b[_0x20c0('0x5c')];var _0x8490d6=_0x1fd5ce[_0x20c0('0x5d')](-0x1);if(_0x8490d6==='/'){_0x1fd5ce=_0x1fd5ce['substring'](0x0,_0x1fd5ce['lastIndexOf'](_0x8490d6));}return rp({'method':_0x20c0('0x5e'),'uri':util[_0x20c0('0x5f')](_0x20c0('0x60'),_0x1fd5ce,_0x20c0('0x61')),'headers':{'Authorization':util[_0x20c0('0x5f')](_0x20c0('0x62'),new Buffer(util['format'](_0x20c0('0x63'),_0x41e66b[_0x20c0('0x5b')]))[_0x20c0('0x64')](_0x20c0('0x65')))},'json':!![]});}})[_0x20c0('0x1a')](function(_0x3ca100){if(_0x3ca100){var _0x424064=[_0x20c0('0x66'),_0x20c0('0x67'),_0x20c0('0x68'),_0x20c0('0x69'),_0x20c0('0x25'),_0x20c0('0x6a'),'group','source','ticket_type',_0x20c0('0x6b'),_0x20c0('0x6c')];_['remove'](_0x3ca100,function(_0x2d4cc1){return _0x424064[_0x20c0('0x6d')](_0x2d4cc1[_0x20c0('0x2f')])||!_0x2d4cc1[_0x20c0('0x6e')]&&_0x2d4cc1[_0x20c0('0x33')]!==_0x20c0('0x6f')&&_0x2d4cc1[_0x20c0('0x33')]!==_0x20c0('0x70');});return{'count':_0x3ca100[_0x20c0('0x3d')],'rows':_['map'](_0x3ca100,function(_0x25d52d){return{'id':_0x25d52d[_0x20c0('0x2f')],'name':_0x25d52d[_0x20c0('0x71')],'custom':!_0x25d52d[_0x20c0('0x6e')],'options':_0x25d52d[_0x20c0('0x72')]?_[_0x20c0('0x36')](_0x25d52d[_0x20c0('0x72')],function(_0x24fb84){return{'name':_[_0x20c0('0x73')](_0x24fb84),'value':_0x24fb84};}):[]};})};}})[_0x20c0('0x1a')](respondWithResult(_0x4e224f,null))[_0x20c0('0x49')](function(_0x78095){var _0x104e59=_0x2fa300[_0x20c0('0x37')][_0x20c0('0x74')]?0x1f4:_0x78095['statusCode']||0x1f4;logger['error'](_0x20c0('0x75'),_0x20c0('0x76'),_0x104e59,JSON[_0x20c0('0x20')](_0x78095));delete _0x78095[_0x20c0('0x2f')];if(_0x104e59===0x191){_0x104e59=0x190;}_0x4e224f[_0x20c0('0x25')](_0x104e59)[_0x20c0('0x77')](_0x2fa300['query'][_0x20c0('0x74')]?{'message':_0x20c0('0x78'),'statusCode':_0x78095[_0x20c0('0x79')]}:_0x78095);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index ab706e0..f8950ab 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 _0x17aa=['path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','../../config/logger','api','request-promise'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x17aa,0x1b9));var _0xa17a=function(_0xfda3ea,_0x242ea1){_0xfda3ea=_0xfda3ea-0x0;var _0x524531=_0x17aa[_0xfda3ea];return _0x524531;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa17a('0x0'))(_0xa17a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa17a('0x2'));var fs=require('fs');var path=require(_0xa17a('0x3'));var rimraf=require(_0xa17a('0x4'));var config=require(_0xa17a('0x5'));var attributes=require(_0xa17a('0x6'));var integrations=require(_0xa17a('0x7'));module[_0xa17a('0x8')]=function(_0x118006,_0x22092b){return _0x118006[_0xa17a('0x9')](_0xa17a('0xa'),attributes,{'tableName':_0xa17a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfb1=['../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x6f6e1f,_0x109b4e){var _0x5357f9=function(_0x553d07){while(--_0x553d07){_0x6f6e1f['push'](_0x6f6e1f['shift']());}};_0x5357f9(++_0x109b4e);}(_0xbfb1,0x17a));var _0x1bfb=function(_0x354151,_0x3f2fe1){_0x354151=_0x354151-0x0;var _0x2ecc93=_0xbfb1[_0x354151];return _0x2ecc93;};'use strict';var _=require(_0x1bfb('0x0'));var util=require('util');var logger=require(_0x1bfb('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1bfb('0x2'));var rp=require(_0x1bfb('0x3'));var fs=require('fs');var path=require(_0x1bfb('0x4'));var rimraf=require('rimraf');var config=require(_0x1bfb('0x5'));var attributes=require(_0x1bfb('0x6'));var integrations=require(_0x1bfb('0x7'));module[_0x1bfb('0x8')]=function(_0x382362,_0x1146bf){return _0x382362[_0x1bfb('0x9')]('FreshdeskAccount',attributes,{'tableName':_0x1bfb('0xa'),'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 4210fe7..8476822 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 _0xd44a=['options','raw','attributes','include','model','map','GetFreshdeskAccount','debug','catch','ShowFreshdeskAccount','find','where','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','FreshdeskAccount','findAll'];(function(_0x177cc9,_0x3f6fdd){var _0x2fe577=function(_0xa98e83){while(--_0xa98e83){_0x177cc9['push'](_0x177cc9['shift']());}};_0x2fe577(++_0x3f6fdd);}(_0xd44a,0x136));var _0xad44=function(_0x4cb5c6,_0x6d9d98){_0x4cb5c6=_0x4cb5c6-0x0;var _0x4ad65a=_0xd44a[_0x4cb5c6];return _0x4ad65a;};'use strict';var _=require(_0xad44('0x0'));var util=require('util');var moment=require(_0xad44('0x1'));var BPromise=require(_0xad44('0x2'));var rs=require(_0xad44('0x3'));var fs=require('fs');var Redis=require(_0xad44('0x4'));var db=require(_0xad44('0x5'))['db'];var utils=require(_0xad44('0x6'));var logger=require(_0xad44('0x7'))(_0xad44('0x8'));var config=require(_0xad44('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xad44('0xa')][_0xad44('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53c43,_0x3a4203,_0x32378a){return new BPromise(function(_0x13bdae,_0x301726){return client['request'](_0x53c43,_0x32378a)['then'](function(_0x565451){logger[_0xad44('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x3a4203,'request\x20sent');logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x3a4203,'request\x20sent',JSON[_0xad44('0xd')](_0x565451));if(_0x565451[_0xad44('0xe')]){if(_0x565451[_0xad44('0xe')][_0xad44('0xf')]===0x1f4){logger[_0xad44('0xe')](_0xad44('0x10'),_0x3a4203,_0x565451[_0xad44('0xe')][_0xad44('0x11')]);return _0x301726(_0x565451[_0xad44('0xe')]['message']);}logger[_0xad44('0xe')](_0xad44('0x10'),_0x3a4203,_0x565451[_0xad44('0xe')][_0xad44('0x11')]);return _0x13bdae(_0x565451['error'][_0xad44('0x11')]);}else{logger['info'](_0xad44('0x10'),_0x3a4203,'request\x20sent');_0x13bdae(_0x565451['result'][_0xad44('0x11')]);}})['catch'](function(_0x2eed72){logger[_0xad44('0xe')](_0xad44('0x10'),_0x3a4203,_0x2eed72);_0x301726(_0x2eed72);});});}exports['GetFreshdeskAccount']=function(_0x18cb5a){var _0x2014da=this;return new Promise(function(_0x15c401,_0x991209){return db[_0xad44('0x12')][_0xad44('0x13')]({'raw':_0x18cb5a[_0xad44('0x14')]?_0x18cb5a[_0xad44('0x14')][_0xad44('0x15')]===undefined?!![]:![]:!![],'where':_0x18cb5a[_0xad44('0x14')]?_0x18cb5a[_0xad44('0x14')]['where']||null:null,'attributes':_0x18cb5a[_0xad44('0x14')]?_0x18cb5a[_0xad44('0x14')][_0xad44('0x16')]||null:null,'limit':_0x18cb5a[_0xad44('0x14')]?_0x18cb5a[_0xad44('0x14')]['limit']||null:null,'include':_0x18cb5a[_0xad44('0x14')]?_0x18cb5a[_0xad44('0x14')][_0xad44('0x17')]?_['map'](_0x18cb5a[_0xad44('0x14')][_0xad44('0x17')],function(_0x293fcd){return{'model':db[_0x293fcd[_0xad44('0x18')]],'as':_0x293fcd['as'],'attributes':_0x293fcd['attributes'],'include':_0x293fcd[_0xad44('0x17')]?_[_0xad44('0x19')](_0x293fcd[_0xad44('0x17')],function(_0x1a9bab){return{'model':db[_0x1a9bab[_0xad44('0x18')]],'as':_0x1a9bab['as'],'attributes':_0x1a9bab[_0xad44('0x16')],'include':_0x1a9bab[_0xad44('0x17')]?_[_0xad44('0x19')](_0x1a9bab[_0xad44('0x17')],function(_0x440611){return{'model':db[_0x440611[_0xad44('0x18')]],'as':_0x440611['as'],'attributes':_0x440611[_0xad44('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23d917){logger['info'](_0xad44('0x1a'),_0x18cb5a);logger[_0xad44('0x1b')](_0xad44('0x1a'),_0x18cb5a,JSON[_0xad44('0xd')](_0x23d917));_0x15c401(_0x23d917);})[_0xad44('0x1c')](function(_0x40450c){logger[_0xad44('0xe')](_0xad44('0x1a'),_0x40450c[_0xad44('0x11')],_0x18cb5a);_0x991209(_0x2014da['error'](0x1f4,_0x40450c[_0xad44('0x11')]));});});};exports[_0xad44('0x1d')]=function(_0x29faaf){var _0x21447c=this;return new Promise(function(_0xbef550,_0x445220){return db[_0xad44('0x12')][_0xad44('0x1e')]({'raw':_0x29faaf['options']?_0x29faaf['options'][_0xad44('0x15')]===undefined?!![]:![]:!![],'where':_0x29faaf[_0xad44('0x14')]?_0x29faaf['options'][_0xad44('0x1f')]||null:null,'attributes':_0x29faaf['options']?_0x29faaf[_0xad44('0x14')][_0xad44('0x16')]||null:null,'include':_0x29faaf['options']?_0x29faaf[_0xad44('0x14')][_0xad44('0x17')]?_[_0xad44('0x19')](_0x29faaf['options'][_0xad44('0x17')],function(_0x10f53c){return{'model':db[_0x10f53c[_0xad44('0x18')]],'as':_0x10f53c['as'],'attributes':_0x10f53c['attributes'],'include':_0x10f53c[_0xad44('0x17')]?_[_0xad44('0x19')](_0x10f53c[_0xad44('0x17')],function(_0x2abf18){return{'model':db[_0x2abf18[_0xad44('0x18')]],'as':_0x2abf18['as'],'attributes':_0x2abf18[_0xad44('0x16')],'include':_0x2abf18[_0xad44('0x17')]?_['map'](_0x2abf18[_0xad44('0x17')],function(_0x2c8dd9){return{'model':db[_0x2c8dd9[_0xad44('0x18')]],'as':_0x2c8dd9['as'],'attributes':_0x2c8dd9[_0xad44('0x16')]};}):[]};}):[]};}):[]:[]})[_0xad44('0x20')](function(_0x40b98b){logger[_0xad44('0xc')](_0xad44('0x1d'),_0x29faaf);logger['debug'](_0xad44('0x1d'),_0x29faaf,JSON[_0xad44('0xd')](_0x40b98b));_0xbef550(_0x40b98b);})[_0xad44('0x1c')](function(_0x460292){logger[_0xad44('0xe')](_0xad44('0x1d'),_0x460292['message'],_0x29faaf);_0x445220(_0x21447c[_0xad44('0xe')](0x1f4,_0x460292[_0xad44('0x11')]));});});}; \ No newline at end of file +var _0x9f47=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','limit','include','model','map','stringify','ShowFreshdeskAccount','find','then','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2d0531,_0x1f493d){var _0x2b2c85=function(_0x3cac9d){while(--_0x3cac9d){_0x2d0531['push'](_0x2d0531['shift']());}};_0x2b2c85(++_0x1f493d);}(_0x9f47,0xaf));var _0x79f4=function(_0x373e3b,_0x5f5440){_0x373e3b=_0x373e3b-0x0;var _0x526f13=_0x9f47[_0x373e3b];return _0x526f13;};'use strict';var _=require(_0x79f4('0x0'));var util=require('util');var moment=require(_0x79f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x79f4('0x2'));var fs=require('fs');var Redis=require(_0x79f4('0x3'));var db=require(_0x79f4('0x4'))['db'];var utils=require(_0x79f4('0x5'));var logger=require(_0x79f4('0x6'))(_0x79f4('0x7'));var config=require(_0x79f4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x79f4('0x9')][_0x79f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aec12,_0x4334fc,_0x359b6c){return new BPromise(function(_0x1831d4,_0x39adef){return client[_0x79f4('0xb')](_0x4aec12,_0x359b6c)['then'](function(_0xc9d1c9){logger[_0x79f4('0xc')](_0x79f4('0xd'),_0x4334fc,'request\x20sent');logger[_0x79f4('0xe')](_0x79f4('0xf'),_0x4334fc,_0x79f4('0x10'),JSON['stringify'](_0xc9d1c9));if(_0xc9d1c9[_0x79f4('0x11')]){if(_0xc9d1c9[_0x79f4('0x11')][_0x79f4('0x12')]===0x1f4){logger[_0x79f4('0x11')](_0x79f4('0xd'),_0x4334fc,_0xc9d1c9[_0x79f4('0x11')][_0x79f4('0x13')]);return _0x39adef(_0xc9d1c9[_0x79f4('0x11')]['message']);}logger[_0x79f4('0x11')](_0x79f4('0xd'),_0x4334fc,_0xc9d1c9['error'][_0x79f4('0x13')]);return _0x1831d4(_0xc9d1c9[_0x79f4('0x11')][_0x79f4('0x13')]);}else{logger[_0x79f4('0xc')](_0x79f4('0xd'),_0x4334fc,'request\x20sent');_0x1831d4(_0xc9d1c9[_0x79f4('0x14')][_0x79f4('0x13')]);}})[_0x79f4('0x15')](function(_0x3357b1){logger['error'](_0x79f4('0xd'),_0x4334fc,_0x3357b1);_0x39adef(_0x3357b1);});});}exports[_0x79f4('0x16')]=function(_0x27362d){var _0x2d64c9=this;return new Promise(function(_0x184add,_0x25696c){return db[_0x79f4('0x17')][_0x79f4('0x18')]({'raw':_0x27362d[_0x79f4('0x19')]?_0x27362d[_0x79f4('0x19')][_0x79f4('0x1a')]===undefined?!![]:![]:!![],'where':_0x27362d[_0x79f4('0x19')]?_0x27362d[_0x79f4('0x19')]['where']||null:null,'attributes':_0x27362d['options']?_0x27362d['options'][_0x79f4('0x1b')]||null:null,'limit':_0x27362d[_0x79f4('0x19')]?_0x27362d[_0x79f4('0x19')][_0x79f4('0x1c')]||null:null,'include':_0x27362d[_0x79f4('0x19')]?_0x27362d['options'][_0x79f4('0x1d')]?_['map'](_0x27362d[_0x79f4('0x19')][_0x79f4('0x1d')],function(_0x42b218){return{'model':db[_0x42b218[_0x79f4('0x1e')]],'as':_0x42b218['as'],'attributes':_0x42b218[_0x79f4('0x1b')],'include':_0x42b218[_0x79f4('0x1d')]?_[_0x79f4('0x1f')](_0x42b218[_0x79f4('0x1d')],function(_0x14517f){return{'model':db[_0x14517f['model']],'as':_0x14517f['as'],'attributes':_0x14517f[_0x79f4('0x1b')],'include':_0x14517f[_0x79f4('0x1d')]?_[_0x79f4('0x1f')](_0x14517f['include'],function(_0x517251){return{'model':db[_0x517251['model']],'as':_0x517251['as'],'attributes':_0x517251[_0x79f4('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x146d62){logger[_0x79f4('0xc')](_0x79f4('0x16'),_0x27362d);logger[_0x79f4('0xe')](_0x79f4('0x16'),_0x27362d,JSON[_0x79f4('0x20')](_0x146d62));_0x184add(_0x146d62);})['catch'](function(_0x200ca9){logger[_0x79f4('0x11')](_0x79f4('0x16'),_0x200ca9['message'],_0x27362d);_0x25696c(_0x2d64c9['error'](0x1f4,_0x200ca9[_0x79f4('0x13')]));});});};exports[_0x79f4('0x21')]=function(_0x793fdc){var _0x324b57=this;return new Promise(function(_0x5185c3,_0x2ea5cf){return db[_0x79f4('0x17')][_0x79f4('0x22')]({'raw':_0x793fdc[_0x79f4('0x19')]?_0x793fdc[_0x79f4('0x19')][_0x79f4('0x1a')]===undefined?!![]:![]:!![],'where':_0x793fdc[_0x79f4('0x19')]?_0x793fdc['options']['where']||null:null,'attributes':_0x793fdc[_0x79f4('0x19')]?_0x793fdc[_0x79f4('0x19')][_0x79f4('0x1b')]||null:null,'include':_0x793fdc[_0x79f4('0x19')]?_0x793fdc['options'][_0x79f4('0x1d')]?_['map'](_0x793fdc[_0x79f4('0x19')]['include'],function(_0x53c52a){return{'model':db[_0x53c52a['model']],'as':_0x53c52a['as'],'attributes':_0x53c52a[_0x79f4('0x1b')],'include':_0x53c52a[_0x79f4('0x1d')]?_['map'](_0x53c52a['include'],function(_0x5ab3db){return{'model':db[_0x5ab3db[_0x79f4('0x1e')]],'as':_0x5ab3db['as'],'attributes':_0x5ab3db[_0x79f4('0x1b')],'include':_0x5ab3db[_0x79f4('0x1d')]?_[_0x79f4('0x1f')](_0x5ab3db[_0x79f4('0x1d')],function(_0x4c5877){return{'model':db[_0x4c5877[_0x79f4('0x1e')]],'as':_0x4c5877['as'],'attributes':_0x4c5877[_0x79f4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x79f4('0x23')](function(_0x5e4cfc){logger[_0x79f4('0xc')]('ShowFreshdeskAccount',_0x793fdc);logger[_0x79f4('0xe')](_0x79f4('0x21'),_0x793fdc,JSON[_0x79f4('0x20')](_0x5e4cfc));_0x5185c3(_0x5e4cfc);})[_0x79f4('0x15')](function(_0x39c00b){logger[_0x79f4('0x11')](_0x79f4('0x21'),_0x39c00b[_0x79f4('0x13')],_0x793fdc);_0x2ea5cf(_0x324b57[_0x79f4('0x11')](0x1f4,_0x39c00b[_0x79f4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 5055d4e..253d74e 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 _0xebb2=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','delete','destroy','exports'];(function(_0x4ae660,_0x150d3a){var _0x2e59bd=function(_0x378228){while(--_0x378228){_0x4ae660['push'](_0x4ae660['shift']());}};_0x2e59bd(++_0x150d3a);}(_0xebb2,0x145));var _0x2ebb=function(_0x39417f,_0x2ac630){_0x39417f=_0x39417f-0x0;var _0x52ec97=_0xebb2[_0x39417f];return _0x52ec97;};'use strict';var multer=require(_0x2ebb('0x0'));var util=require('util');var path=require(_0x2ebb('0x1'));var timeout=require(_0x2ebb('0x2'));var express=require(_0x2ebb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2ebb('0x4'));var interaction=require(_0x2ebb('0x5'));var config=require(_0x2ebb('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x2ebb('0x7')]('/',auth[_0x2ebb('0x8')](),controller['index']);router[_0x2ebb('0x7')](_0x2ebb('0x9'),auth[_0x2ebb('0x8')](),controller[_0x2ebb('0xa')]);router[_0x2ebb('0x7')](_0x2ebb('0xb'),auth[_0x2ebb('0x8')](),controller[_0x2ebb('0xc')]);router[_0x2ebb('0x7')](_0x2ebb('0xd'),auth[_0x2ebb('0x8')](),controller[_0x2ebb('0xe')]);router[_0x2ebb('0x7')](_0x2ebb('0xf'),auth['isAuthenticated'](),controller[_0x2ebb('0x10')]);router['get'](_0x2ebb('0x11'),auth['isAuthenticated'](),controller['getTags']);router[_0x2ebb('0x12')]('/',auth[_0x2ebb('0x8')](),controller[_0x2ebb('0x13')]);router[_0x2ebb('0x12')](_0x2ebb('0x11'),auth['isAuthenticated'](),controller['setTags']);router[_0x2ebb('0x14')](_0x2ebb('0x9'),auth[_0x2ebb('0x8')](),controller[_0x2ebb('0x15')]);router[_0x2ebb('0x16')](_0x2ebb('0x9'),auth['isAuthenticated'](),controller[_0x2ebb('0x17')]);module[_0x2ebb('0x18')]=router; \ No newline at end of file +var _0x7ff7=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags'];(function(_0x358000,_0x4efb0e){var _0x53d1c0=function(_0x3690d8){while(--_0x3690d8){_0x358000['push'](_0x358000['shift']());}};_0x53d1c0(++_0x4efb0e);}(_0x7ff7,0xc2));var _0x77ff=function(_0x1db678,_0x2965a0){_0x1db678=_0x1db678-0x0;var _0x5bd949=_0x7ff7[_0x1db678];return _0x5bd949;};'use strict';var multer=require(_0x77ff('0x0'));var util=require(_0x77ff('0x1'));var path=require(_0x77ff('0x2'));var timeout=require(_0x77ff('0x3'));var express=require(_0x77ff('0x4'));var router=express['Router']();var fs_extra=require(_0x77ff('0x5'));var auth=require(_0x77ff('0x6'));var interaction=require(_0x77ff('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0x77ff('0x8')]('/',auth[_0x77ff('0x9')](),controller[_0x77ff('0xa')]);router[_0x77ff('0x8')](_0x77ff('0xb'),auth[_0x77ff('0x9')](),controller['show']);router[_0x77ff('0x8')](_0x77ff('0xc'),auth['isAuthenticated'](),controller[_0x77ff('0xd')]);router[_0x77ff('0x8')]('/:id/subjects',auth[_0x77ff('0x9')](),controller[_0x77ff('0xe')]);router[_0x77ff('0x8')](_0x77ff('0xf'),auth[_0x77ff('0x9')](),controller[_0x77ff('0x10')]);router[_0x77ff('0x8')](_0x77ff('0x11'),auth['isAuthenticated'](),controller[_0x77ff('0x12')]);router[_0x77ff('0x13')]('/',auth[_0x77ff('0x9')](),controller[_0x77ff('0x14')]);router[_0x77ff('0x13')]('/:id/tags',auth['isAuthenticated'](),controller[_0x77ff('0x15')]);router[_0x77ff('0x16')](_0x77ff('0xb'),auth[_0x77ff('0x9')](),controller[_0x77ff('0x17')]);router[_0x77ff('0x18')]('/:id',auth[_0x77ff('0x9')](),controller[_0x77ff('0x19')]);module[_0x77ff('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index a688135..3d3d32d 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xee95=['sequelize','exports','STRING'];(function(_0x56dd47,_0x82906){var _0x263c39=function(_0x58ee6a){while(--_0x58ee6a){_0x56dd47['push'](_0x56dd47['shift']());}};_0x263c39(++_0x82906);}(_0xee95,0x1f2));var _0x5ee9=function(_0xbd383d,_0x295862){_0xbd383d=_0xbd383d-0x0;var _0x4a128f=_0xee95[_0xbd383d];return _0x4a128f;};'use strict';var Sequelize=require(_0x5ee9('0x0'));module[_0x5ee9('0x1')]={'name':{'type':Sequelize[_0x5ee9('0x2')]},'description':{'type':Sequelize[_0x5ee9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 19c400d..da71a55 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 _0x6845=['json','save','send','index','map','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','FreshdeskConfiguration','include','findAll','rawAttributes','includeAll','find','create','body','update','getFields','findOne','params','FreshdeskField','order','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','jayson/promise','http','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','offset','undefined','limit','count'];(function(_0xe67d1c,_0x1b21d1){var _0x11673c=function(_0x119660){while(--_0x119660){_0xe67d1c['push'](_0xe67d1c['shift']());}};_0x11673c(++_0x1b21d1);}(_0x6845,0x1ef));var _0x5684=function(_0xc9155c,_0x53f2ad){_0xc9155c=_0xc9155c-0x0;var _0x5cb3e6=_0x6845[_0xc9155c];return _0x5cb3e6;};'use strict';var emlformat=require(_0x5684('0x0'));var rimraf=require(_0x5684('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5684('0x2'));var moment=require(_0x5684('0x3'));var BPromise=require(_0x5684('0x4'));var Mustache=require(_0x5684('0x5'));var util=require(_0x5684('0x6'));var path=require(_0x5684('0x7'));var sox=require('sox');var csv=require(_0x5684('0x8'));var ejs=require(_0x5684('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5684('0xa'));var squel=require('squel');var crypto=require(_0x5684('0xb'));var jsforce=require(_0x5684('0xc'));var deskjs=require(_0x5684('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5684('0xe'));var Papa=require(_0x5684('0xf'));var Redis=require(_0x5684('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5684('0x11'));var hardwareService=require(_0x5684('0x12'));var logger=require(_0x5684('0x13'))(_0x5684('0x14'));var utils=require(_0x5684('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5684('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5684('0x17'));var client=jayson['client'][_0x5684('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x392d42,_0x491b84,_0x20fa02,_0x13eded){return new BPromise(function(_0x109d75,_0x177809){var _0x5a14ce=_0x13eded||client;return _0x5a14ce[_0x5684('0x19')](_0x392d42,_0x20fa02)[_0x5684('0x1a')](function(_0x4fee39){logger[_0x5684('0x1b')](_0x5684('0x1c'),_0x491b84,_0x5684('0x1d'));logger[_0x5684('0x1e')](_0x5684('0x1f'),_0x491b84,_0x5684('0x1d'),JSON[_0x5684('0x20')](_0x4fee39));if(_0x4fee39[_0x5684('0x21')]){if(_0x4fee39[_0x5684('0x21')][_0x5684('0x22')]===0x1f4){logger[_0x5684('0x21')](_0x5684('0x1c'),_0x491b84,_0x4fee39['error'][_0x5684('0x23')]);return _0x177809(_0x4fee39[_0x5684('0x21')][_0x5684('0x23')]);}logger['error'](_0x5684('0x1c'),_0x491b84,_0x4fee39['error'][_0x5684('0x23')]);return _0x109d75(_0x4fee39[_0x5684('0x21')]['message']);}else{logger['info'](_0x5684('0x1c'),_0x491b84,_0x5684('0x1d'));_0x109d75(_0x4fee39[_0x5684('0x24')][_0x5684('0x23')]);}})[_0x5684('0x25')](function(_0x31a5dd){logger[_0x5684('0x21')](_0x5684('0x1c'),_0x491b84,_0x31a5dd);_0x177809(_0x31a5dd);});});}function respondWithStatusCode(_0x37c612,_0x2d04d7){_0x2d04d7=_0x2d04d7||0xcc;return function(_0x38ac3f){if(_0x38ac3f){return _0x37c612[_0x5684('0x26')](_0x2d04d7);}return _0x37c612[_0x5684('0x27')](_0x2d04d7)[_0x5684('0x28')]();};}function respondWithResult(_0xf2fb4,_0x4c5015){_0x4c5015=_0x4c5015||0xc8;return function(_0x345293){if(_0x345293){return _0xf2fb4[_0x5684('0x27')](_0x4c5015)['json'](_0x345293);}};}function respondWithFilteredResult(_0x2a7c3e,_0x10bc7c){return function(_0x88a914){if(_0x88a914){var _0xd65ab7=typeof _0x10bc7c[_0x5684('0x29')]===_0x5684('0x2a')&&typeof _0x10bc7c[_0x5684('0x2b')]===_0x5684('0x2a');var _0x15c003=_0x88a914[_0x5684('0x2c')];var _0x4809cc=_0xd65ab7?0x0:_0x10bc7c['offset'];var _0x21fe39=_0xd65ab7?_0x88a914['count']:_0x10bc7c['offset']+_0x10bc7c[_0x5684('0x2b')];var _0x4cbf75;if(_0x21fe39>=_0x15c003){_0x21fe39=_0x15c003;_0x4cbf75=0xc8;}else{_0x4cbf75=0xce;}_0x2a7c3e['status'](_0x4cbf75);return _0x2a7c3e['set']('Content-Range',_0x4809cc+'-'+_0x21fe39+'/'+_0x15c003)[_0x5684('0x2d')](_0x88a914);}return null;};}function patchUpdates(_0x491394){return function(_0x4d0163){try{jsonpatch['apply'](_0x4d0163,_0x491394,!![]);}catch(_0x4d4e93){return BPromise['reject'](_0x4d4e93);}return _0x4d0163[_0x5684('0x2e')]();};}function saveUpdates(_0x486200,_0x2e8b1f){return function(_0x58142d){if(_0x58142d){return _0x58142d['update'](_0x486200)[_0x5684('0x1a')](function(_0x1ee20d){return _0x1ee20d;});}return null;};}function removeEntity(_0x1e2176,_0x18824f){return function(_0x2005cd){if(_0x2005cd){return _0x2005cd['destroy']()[_0x5684('0x1a')](function(){_0x1e2176[_0x5684('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10fc23,_0x565b00){return function(_0xb7a8a5){if(!_0xb7a8a5){_0x10fc23[_0x5684('0x26')](0x194);}return _0xb7a8a5;};}function handleError(_0x5279b9,_0x491b09){_0x491b09=_0x491b09||0x1f4;return function(_0x45b7c3){logger['error'](_0x45b7c3['stack']);if(_0x45b7c3['name']){delete _0x45b7c3['name'];}_0x5279b9[_0x5684('0x27')](_0x491b09)[_0x5684('0x2f')](_0x45b7c3);};}exports[_0x5684('0x30')]=function(_0x3c201b,_0x4e2fdb){var _0x8d953c={},_0x21b76f={},_0x1a7630={'count':0x0,'rows':[]};var _0x238b70=_[_0x5684('0x31')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x5d5d33){return{'name':_0x5d5d33[_0x5684('0x32')],'type':_0x5d5d33[_0x5684('0x33')]['key']};});_0x21b76f['model']=_['map'](_0x238b70,_0x5684('0x34'));_0x21b76f[_0x5684('0x35')]=_[_0x5684('0x36')](_0x3c201b[_0x5684('0x35')]);_0x21b76f[_0x5684('0x37')]=_[_0x5684('0x38')](_0x21b76f[_0x5684('0x39')],_0x21b76f[_0x5684('0x35')]);_0x8d953c[_0x5684('0x3a')]=_[_0x5684('0x38')](_0x21b76f['model'],qs[_0x5684('0x3b')](_0x3c201b['query'][_0x5684('0x3b')]));_0x8d953c['attributes']=_0x8d953c['attributes'][_0x5684('0x3c')]?_0x8d953c[_0x5684('0x3a')]:_0x21b76f['model'];if(!_0x3c201b[_0x5684('0x35')][_0x5684('0x3d')](_0x5684('0x3e'))){_0x8d953c['limit']=qs[_0x5684('0x2b')](_0x3c201b[_0x5684('0x35')]['limit']);_0x8d953c[_0x5684('0x29')]=qs[_0x5684('0x29')](_0x3c201b[_0x5684('0x35')]['offset']);}_0x8d953c['order']=qs[_0x5684('0x3f')](_0x3c201b['query'][_0x5684('0x3f')]);_0x8d953c[_0x5684('0x40')]=qs[_0x5684('0x37')](_['pick'](_0x3c201b[_0x5684('0x35')],_0x21b76f[_0x5684('0x37')]),_0x238b70);if(_0x3c201b[_0x5684('0x35')][_0x5684('0x41')]){_0x8d953c[_0x5684('0x40')]=_[_0x5684('0x42')](_0x8d953c[_0x5684('0x40')],{'$or':_['map'](_0x238b70,function(_0x1bbe0f){if(_0x1bbe0f[_0x5684('0x33')]!==_0x5684('0x43')){var _0x253205={};_0x253205[_0x1bbe0f[_0x5684('0x34')]]={'$like':'%'+_0x3c201b['query'][_0x5684('0x41')]+'%'};return _0x253205;}})});}_0x8d953c=_[_0x5684('0x42')]({},_0x8d953c,_0x3c201b[_0x5684('0x44')]);var _0x20ff62={'where':_0x8d953c[_0x5684('0x40')]};return db[_0x5684('0x45')][_0x5684('0x2c')](_0x20ff62)[_0x5684('0x1a')](function(_0x2ddc45){_0x1a7630['count']=_0x2ddc45;if(_0x3c201b[_0x5684('0x35')]['includeAll']){_0x8d953c[_0x5684('0x46')]=[{'all':!![]}];}return db[_0x5684('0x45')][_0x5684('0x47')](_0x8d953c);})[_0x5684('0x1a')](function(_0x9671ba){_0x1a7630['rows']=_0x9671ba;return _0x1a7630;})[_0x5684('0x1a')](respondWithFilteredResult(_0x4e2fdb,_0x8d953c))[_0x5684('0x25')](handleError(_0x4e2fdb,null));};exports['show']=function(_0x5be039,_0x256ba8){var _0x32df64={'raw':![],'where':{'id':_0x5be039['params']['id']}},_0x4d784e={};_0x4d784e['model']=_[_0x5684('0x36')](db[_0x5684('0x45')][_0x5684('0x48')]);_0x4d784e['query']=_[_0x5684('0x36')](_0x5be039[_0x5684('0x35')]);_0x4d784e[_0x5684('0x37')]=_[_0x5684('0x38')](_0x4d784e[_0x5684('0x39')],_0x4d784e[_0x5684('0x35')]);_0x32df64[_0x5684('0x3a')]=_['intersection'](_0x4d784e[_0x5684('0x39')],qs['fields'](_0x5be039[_0x5684('0x35')]['fields']));_0x32df64[_0x5684('0x3a')]=_0x32df64[_0x5684('0x3a')][_0x5684('0x3c')]?_0x32df64[_0x5684('0x3a')]:_0x4d784e[_0x5684('0x39')];if(_0x5be039[_0x5684('0x35')][_0x5684('0x49')]){_0x32df64[_0x5684('0x46')]=[{'all':!![]}];}_0x32df64=_[_0x5684('0x42')]({},_0x32df64,_0x5be039[_0x5684('0x44')]);return db[_0x5684('0x45')][_0x5684('0x4a')](_0x32df64)[_0x5684('0x1a')](handleEntityNotFound(_0x256ba8,null))[_0x5684('0x1a')](respondWithResult(_0x256ba8,null))[_0x5684('0x25')](handleError(_0x256ba8,null));};exports[_0x5684('0x4b')]=function(_0x228748,_0x581074){return db['FreshdeskConfiguration']['create'](_0x228748[_0x5684('0x4c')],{})[_0x5684('0x1a')](respondWithResult(_0x581074,0xc9))[_0x5684('0x25')](handleError(_0x581074,null));};exports[_0x5684('0x4d')]=function(_0x1e644b,_0x48fae0){if(_0x1e644b[_0x5684('0x4c')]['id']){delete _0x1e644b[_0x5684('0x4c')]['id'];}return db['FreshdeskConfiguration'][_0x5684('0x4a')]({'where':{'id':_0x1e644b['params']['id']}})['then'](handleEntityNotFound(_0x48fae0,null))[_0x5684('0x1a')](saveUpdates(_0x1e644b['body'],null))[_0x5684('0x1a')](respondWithResult(_0x48fae0,null))[_0x5684('0x25')](handleError(_0x48fae0,null));};exports['destroy']=function(_0xc03660,_0x3bf169){return db['FreshdeskConfiguration'][_0x5684('0x4a')]({'where':{'id':_0xc03660['params']['id']}})['then'](handleEntityNotFound(_0x3bf169,null))[_0x5684('0x1a')](removeEntity(_0x3bf169,null))[_0x5684('0x25')](handleError(_0x3bf169,null));};exports[_0x5684('0x4e')]=function(_0x353f6d,_0x1b11a9,_0x27d86f){var _0x5195e3={};var _0x3c861e={};var _0x1a7c14;var _0x2d918;return db[_0x5684('0x45')][_0x5684('0x4f')]({'where':{'id':_0x353f6d[_0x5684('0x50')]['id']}})[_0x5684('0x1a')](handleEntityNotFound(_0x1b11a9,null))[_0x5684('0x1a')](function(_0x548aec){if(_0x548aec){_0x1a7c14=_0x548aec;_0x3c861e['model']=_['keys'](db[_0x5684('0x51')]['rawAttributes']);_0x3c861e[_0x5684('0x35')]=_['keys'](_0x353f6d[_0x5684('0x35')]);_0x3c861e[_0x5684('0x37')]=_[_0x5684('0x38')](_0x3c861e[_0x5684('0x39')],_0x3c861e[_0x5684('0x35')]);_0x5195e3[_0x5684('0x3a')]=_['intersection'](_0x3c861e[_0x5684('0x39')],qs[_0x5684('0x3b')](_0x353f6d['query']['fields']));_0x5195e3['attributes']=_0x5195e3[_0x5684('0x3a')]['length']?_0x5195e3[_0x5684('0x3a')]:_0x3c861e['model'];_0x5195e3[_0x5684('0x52')]=qs[_0x5684('0x3f')](_0x353f6d['query']['sort']);_0x5195e3[_0x5684('0x40')]=qs[_0x5684('0x37')](_[_0x5684('0x53')](_0x353f6d[_0x5684('0x35')],_0x3c861e['filters']));if(_0x353f6d[_0x5684('0x35')][_0x5684('0x41')]){_0x5195e3[_0x5684('0x40')]=_[_0x5684('0x42')](_0x5195e3[_0x5684('0x40')],{'$or':_[_0x5684('0x31')](_0x5195e3[_0x5684('0x3a')],function(_0x58fbb9){var _0x17f82f={};_0x17f82f[_0x58fbb9]={'$like':'%'+_0x353f6d[_0x5684('0x35')][_0x5684('0x41')]+'%'};return _0x17f82f;})});}_0x5195e3=_[_0x5684('0x42')]({},_0x5195e3,_0x353f6d[_0x5684('0x44')]);return _0x1a7c14[_0x5684('0x4e')](_0x5195e3);}})['then'](function(_0x2858ee){if(_0x2858ee){_0x2d918=_0x2858ee['length'];if(!_0x353f6d[_0x5684('0x35')][_0x5684('0x3d')](_0x5684('0x3e'))){_0x5195e3[_0x5684('0x2b')]=qs[_0x5684('0x2b')](_0x353f6d[_0x5684('0x35')][_0x5684('0x2b')]);_0x5195e3[_0x5684('0x29')]=qs[_0x5684('0x29')](_0x353f6d[_0x5684('0x35')][_0x5684('0x29')]);}return _0x1a7c14[_0x5684('0x4e')](_0x5195e3);}})['then'](function(_0x45ebfc){if(_0x45ebfc){return _0x45ebfc?{'count':_0x2d918,'rows':_0x45ebfc}:null;}})[_0x5684('0x1a')](respondWithResult(_0x1b11a9,null))['catch'](handleError(_0x1b11a9,null));};exports[_0x5684('0x54')]=function(_0x46784b,_0x306460,_0xa672fc){var _0x1b0b4e={};var _0x5ea240={};var _0xdf54dc;var _0x48a9ad;return db[_0x5684('0x45')][_0x5684('0x4f')]({'where':{'id':_0x46784b[_0x5684('0x50')]['id']}})[_0x5684('0x1a')](handleEntityNotFound(_0x306460,null))[_0x5684('0x1a')](function(_0x5ac3c3){if(_0x5ac3c3){_0xdf54dc=_0x5ac3c3;_0x5ea240['model']=_['keys'](db[_0x5684('0x51')][_0x5684('0x48')]);_0x5ea240[_0x5684('0x35')]=_[_0x5684('0x36')](_0x46784b[_0x5684('0x35')]);_0x5ea240[_0x5684('0x37')]=_[_0x5684('0x38')](_0x5ea240['model'],_0x5ea240[_0x5684('0x35')]);_0x1b0b4e[_0x5684('0x3a')]=_[_0x5684('0x38')](_0x5ea240['model'],qs[_0x5684('0x3b')](_0x46784b[_0x5684('0x35')][_0x5684('0x3b')]));_0x1b0b4e[_0x5684('0x3a')]=_0x1b0b4e['attributes'][_0x5684('0x3c')]?_0x1b0b4e[_0x5684('0x3a')]:_0x5ea240[_0x5684('0x39')];_0x1b0b4e['order']=qs[_0x5684('0x3f')](_0x46784b[_0x5684('0x35')][_0x5684('0x3f')]);_0x1b0b4e['where']=qs[_0x5684('0x37')](_[_0x5684('0x53')](_0x46784b[_0x5684('0x35')],_0x5ea240[_0x5684('0x37')]));if(_0x46784b[_0x5684('0x35')][_0x5684('0x41')]){_0x1b0b4e[_0x5684('0x40')]=_[_0x5684('0x42')](_0x1b0b4e[_0x5684('0x40')],{'$or':_[_0x5684('0x31')](_0x1b0b4e['attributes'],function(_0x3b6964){var _0x18b39b={};_0x18b39b[_0x3b6964]={'$like':'%'+_0x46784b[_0x5684('0x35')]['filter']+'%'};return _0x18b39b;})});}_0x1b0b4e=_[_0x5684('0x42')]({},_0x1b0b4e,_0x46784b[_0x5684('0x44')]);return _0xdf54dc[_0x5684('0x54')](_0x1b0b4e);}})[_0x5684('0x1a')](function(_0x28ffc4){if(_0x28ffc4){_0x48a9ad=_0x28ffc4[_0x5684('0x3c')];if(!_0x46784b[_0x5684('0x35')][_0x5684('0x3d')](_0x5684('0x3e'))){_0x1b0b4e[_0x5684('0x2b')]=qs[_0x5684('0x2b')](_0x46784b[_0x5684('0x35')][_0x5684('0x2b')]);_0x1b0b4e[_0x5684('0x29')]=qs[_0x5684('0x29')](_0x46784b[_0x5684('0x35')][_0x5684('0x29')]);}return _0xdf54dc[_0x5684('0x54')](_0x1b0b4e);}})[_0x5684('0x1a')](function(_0x1a61a0){if(_0x1a61a0){return _0x1a61a0?{'count':_0x48a9ad,'rows':_0x1a61a0}:null;}})[_0x5684('0x1a')](respondWithResult(_0x306460,null))[_0x5684('0x25')](handleError(_0x306460,null));};exports[_0x5684('0x55')]=function(_0x4c2bdc,_0x3e86e3,_0x16da95){var _0xf7e1e7={};var _0x1a90e9={};var _0x5e449d;var _0x5ca262;return db['FreshdeskConfiguration'][_0x5684('0x4f')]({'where':{'id':_0x4c2bdc[_0x5684('0x50')]['id']}})[_0x5684('0x1a')](handleEntityNotFound(_0x3e86e3,null))[_0x5684('0x1a')](function(_0x4fc092){if(_0x4fc092){_0x5e449d=_0x4fc092;_0x1a90e9[_0x5684('0x39')]=_[_0x5684('0x36')](db[_0x5684('0x51')]['rawAttributes']);_0x1a90e9[_0x5684('0x35')]=_[_0x5684('0x36')](_0x4c2bdc[_0x5684('0x35')]);_0x1a90e9[_0x5684('0x37')]=_[_0x5684('0x38')](_0x1a90e9['model'],_0x1a90e9[_0x5684('0x35')]);_0xf7e1e7['attributes']=_[_0x5684('0x38')](_0x1a90e9[_0x5684('0x39')],qs[_0x5684('0x3b')](_0x4c2bdc[_0x5684('0x35')][_0x5684('0x3b')]));_0xf7e1e7[_0x5684('0x3a')]=_0xf7e1e7[_0x5684('0x3a')]['length']?_0xf7e1e7[_0x5684('0x3a')]:_0x1a90e9[_0x5684('0x39')];_0xf7e1e7['order']=qs['sort'](_0x4c2bdc[_0x5684('0x35')]['sort']);_0xf7e1e7[_0x5684('0x40')]=qs[_0x5684('0x37')](_[_0x5684('0x53')](_0x4c2bdc[_0x5684('0x35')],_0x1a90e9[_0x5684('0x37')]));if(_0x4c2bdc[_0x5684('0x35')]['filter']){_0xf7e1e7[_0x5684('0x40')]=_[_0x5684('0x42')](_0xf7e1e7[_0x5684('0x40')],{'$or':_[_0x5684('0x31')](_0xf7e1e7['attributes'],function(_0x5a0005){var _0x306d69={};_0x306d69[_0x5a0005]={'$like':'%'+_0x4c2bdc[_0x5684('0x35')][_0x5684('0x41')]+'%'};return _0x306d69;})});}_0xf7e1e7=_['merge']({},_0xf7e1e7,_0x4c2bdc[_0x5684('0x44')]);return _0x5e449d['getDescriptions'](_0xf7e1e7);}})[_0x5684('0x1a')](function(_0x37519b){if(_0x37519b){_0x5ca262=_0x37519b['length'];if(!_0x4c2bdc[_0x5684('0x35')][_0x5684('0x3d')](_0x5684('0x3e'))){_0xf7e1e7['limit']=qs[_0x5684('0x2b')](_0x4c2bdc[_0x5684('0x35')][_0x5684('0x2b')]);_0xf7e1e7[_0x5684('0x29')]=qs[_0x5684('0x29')](_0x4c2bdc['query']['offset']);}return _0x5e449d[_0x5684('0x55')](_0xf7e1e7);}})[_0x5684('0x1a')](function(_0x398b56){if(_0x398b56){return _0x398b56?{'count':_0x5ca262,'rows':_0x398b56}:null;}})[_0x5684('0x1a')](respondWithResult(_0x3e86e3,null))[_0x5684('0x25')](handleError(_0x3e86e3,null));};exports[_0x5684('0x56')]=function(_0x2899c0,_0x41d7b3,_0x388c0e){var _0x139fc6={};var _0x8bf316={};var _0x354578;var _0x23fab2;return db[_0x5684('0x45')][_0x5684('0x4f')]({'where':{'id':_0x2899c0[_0x5684('0x50')]['id']}})['then'](handleEntityNotFound(_0x41d7b3,null))['then'](function(_0x3d4374){if(_0x3d4374){_0x354578=_0x3d4374;_0x8bf316[_0x5684('0x39')]=_[_0x5684('0x36')](db[_0x5684('0x57')][_0x5684('0x48')]);_0x8bf316[_0x5684('0x35')]=_[_0x5684('0x36')](_0x2899c0[_0x5684('0x35')]);_0x8bf316[_0x5684('0x37')]=_['intersection'](_0x8bf316[_0x5684('0x39')],_0x8bf316['query']);_0x139fc6['attributes']=_['intersection'](_0x8bf316[_0x5684('0x39')],qs[_0x5684('0x3b')](_0x2899c0[_0x5684('0x35')][_0x5684('0x3b')]));_0x139fc6[_0x5684('0x3a')]=_0x139fc6[_0x5684('0x3a')][_0x5684('0x3c')]?_0x139fc6[_0x5684('0x3a')]:_0x8bf316[_0x5684('0x39')];_0x139fc6[_0x5684('0x52')]=qs[_0x5684('0x3f')](_0x2899c0[_0x5684('0x35')][_0x5684('0x3f')]);_0x139fc6['where']=qs[_0x5684('0x37')](_['pick'](_0x2899c0[_0x5684('0x35')],_0x8bf316[_0x5684('0x37')]));if(_0x2899c0[_0x5684('0x35')][_0x5684('0x41')]){_0x139fc6[_0x5684('0x40')]=_[_0x5684('0x42')](_0x139fc6[_0x5684('0x40')],{'$or':_[_0x5684('0x31')](_0x139fc6['attributes'],function(_0x491d62){var _0x31969f={};_0x31969f[_0x491d62]={'$like':'%'+_0x2899c0[_0x5684('0x35')][_0x5684('0x41')]+'%'};return _0x31969f;})});}_0x139fc6=_[_0x5684('0x42')]({},_0x139fc6,_0x2899c0[_0x5684('0x44')]);return _0x354578[_0x5684('0x56')](_0x139fc6);}})[_0x5684('0x1a')](function(_0x49a47a){if(_0x49a47a){_0x23fab2=_0x49a47a[_0x5684('0x3c')];if(!_0x2899c0['query'][_0x5684('0x3d')](_0x5684('0x3e'))){_0x139fc6[_0x5684('0x2b')]=qs[_0x5684('0x2b')](_0x2899c0['query'][_0x5684('0x2b')]);_0x139fc6[_0x5684('0x29')]=qs[_0x5684('0x29')](_0x2899c0[_0x5684('0x35')][_0x5684('0x29')]);}return _0x354578[_0x5684('0x56')](_0x139fc6);}})[_0x5684('0x1a')](function(_0x2d6ded){if(_0x2d6ded){return _0x2d6ded?{'count':_0x23fab2,'rows':_0x2d6ded}:null;}})['then'](respondWithResult(_0x41d7b3,null))[_0x5684('0x25')](handleError(_0x41d7b3,null));};exports[_0x5684('0x58')]=function(_0x31725d,_0x18e7b5,_0x345db5){if(_0x31725d[_0x5684('0x4c')]['id']){delete _0x31725d[_0x5684('0x4c')]['id'];}return db['FreshdeskConfiguration'][_0x5684('0x4f')]({'where':{'id':_0x31725d['params']['id']}})['then'](handleEntityNotFound(_0x18e7b5,null))[_0x5684('0x1a')](function(_0x38a04f){if(_0x38a04f){return _0x38a04f[_0x5684('0x58')](_0x31725d[_0x5684('0x4c')][_0x5684('0x59')]||[]);}return null;})[_0x5684('0x1a')](respondWithResult(_0x18e7b5,null))[_0x5684('0x25')](handleError(_0x18e7b5,null));}; \ No newline at end of file +var _0x2333=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','stack','name','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','find','destroy','findOne','FreshdeskField','pick','getFields','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x2333,0x11a));var _0x3233=function(_0x22eefa,_0x2d70d4){_0x22eefa=_0x22eefa-0x0;var _0x3ca564=_0x2333[_0x22eefa];return _0x3ca564;};'use strict';var emlformat=require(_0x3233('0x0'));var rimraf=require(_0x3233('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3233('0x2'));var moment=require(_0x3233('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3233('0x4'));var util=require(_0x3233('0x5'));var path=require(_0x3233('0x6'));var sox=require(_0x3233('0x7'));var csv=require(_0x3233('0x8'));var ejs=require(_0x3233('0x9'));var fs=require('fs');var fs_extra=require(_0x3233('0xa'));var _=require(_0x3233('0xb'));var squel=require(_0x3233('0xc'));var crypto=require(_0x3233('0xd'));var jsforce=require(_0x3233('0xe'));var deskjs=require(_0x3233('0xf'));var toCsv=require(_0x3233('0x8'));var querystring=require(_0x3233('0x10'));var Papa=require(_0x3233('0x11'));var Redis=require(_0x3233('0x12'));var authService=require(_0x3233('0x13'));var qs=require(_0x3233('0x14'));var as=require(_0x3233('0x15'));var hardwareService=require(_0x3233('0x16'));var logger=require(_0x3233('0x17'))('api');var utils=require(_0x3233('0x18'));var config=require(_0x3233('0x19'));var licenseUtil=require(_0x3233('0x1a'));var db=require(_0x3233('0x1b'))['db'];var jayson=require(_0x3233('0x1c'));var client=jayson[_0x3233('0x1d')][_0x3233('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x17ab5f,_0x35d954,_0x37ce62,_0x428b44){return new BPromise(function(_0x27e9fd,_0x7f5e07){var _0x562756=_0x428b44||client;return _0x562756['request'](_0x17ab5f,_0x37ce62)[_0x3233('0x1f')](function(_0x26a41e){logger[_0x3233('0x20')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x35d954,_0x3233('0x21'));logger[_0x3233('0x22')](_0x3233('0x23'),_0x35d954,'request\x20sent',JSON[_0x3233('0x24')](_0x26a41e));if(_0x26a41e[_0x3233('0x25')]){if(_0x26a41e['error'][_0x3233('0x26')]===0x1f4){logger['error'](_0x3233('0x27'),_0x35d954,_0x26a41e['error']['message']);return _0x7f5e07(_0x26a41e['error'][_0x3233('0x28')]);}logger['error'](_0x3233('0x27'),_0x35d954,_0x26a41e['error'][_0x3233('0x28')]);return _0x27e9fd(_0x26a41e[_0x3233('0x25')][_0x3233('0x28')]);}else{logger[_0x3233('0x20')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x35d954,_0x3233('0x21'));_0x27e9fd(_0x26a41e[_0x3233('0x29')][_0x3233('0x28')]);}})['catch'](function(_0x290d77){logger['error'](_0x3233('0x27'),_0x35d954,_0x290d77);_0x7f5e07(_0x290d77);});});}function respondWithStatusCode(_0xa73f3e,_0x43227e){_0x43227e=_0x43227e||0xcc;return function(_0x4c3875){if(_0x4c3875){return _0xa73f3e[_0x3233('0x2a')](_0x43227e);}return _0xa73f3e['status'](_0x43227e)[_0x3233('0x2b')]();};}function respondWithResult(_0xf32321,_0x56f216){_0x56f216=_0x56f216||0xc8;return function(_0x3351d3){if(_0x3351d3){return _0xf32321['status'](_0x56f216)['json'](_0x3351d3);}};}function respondWithFilteredResult(_0x430e8e,_0x39a345){return function(_0x5d8e63){if(_0x5d8e63){var _0x276b6=typeof _0x39a345[_0x3233('0x2c')]===_0x3233('0x2d')&&typeof _0x39a345[_0x3233('0x2e')]===_0x3233('0x2d');var _0x5549d5=_0x5d8e63[_0x3233('0x2f')];var _0xd4171b=_0x276b6?0x0:_0x39a345[_0x3233('0x2c')];var _0xc87d63=_0x276b6?_0x5d8e63[_0x3233('0x2f')]:_0x39a345[_0x3233('0x2c')]+_0x39a345[_0x3233('0x2e')];var _0x3074d7;if(_0xc87d63>=_0x5549d5){_0xc87d63=_0x5549d5;_0x3074d7=0xc8;}else{_0x3074d7=0xce;}_0x430e8e[_0x3233('0x30')](_0x3074d7);return _0x430e8e['set'](_0x3233('0x31'),_0xd4171b+'-'+_0xc87d63+'/'+_0x5549d5)[_0x3233('0x32')](_0x5d8e63);}return null;};}function patchUpdates(_0x559515){return function(_0x2c55f7){try{jsonpatch[_0x3233('0x33')](_0x2c55f7,_0x559515,!![]);}catch(_0x53b6fe){return BPromise[_0x3233('0x34')](_0x53b6fe);}return _0x2c55f7[_0x3233('0x35')]();};}function saveUpdates(_0x54947b,_0x25abd1){return function(_0xfb5932){if(_0xfb5932){return _0xfb5932['update'](_0x54947b)[_0x3233('0x1f')](function(_0x3883bd){return _0x3883bd;});}return null;};}function removeEntity(_0x5412f1,_0x4ef94a){return function(_0x41826f){if(_0x41826f){return _0x41826f['destroy']()[_0x3233('0x1f')](function(){_0x5412f1[_0x3233('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21a4e6,_0x861264){return function(_0x36eab7){if(!_0x36eab7){_0x21a4e6[_0x3233('0x2a')](0x194);}return _0x36eab7;};}function handleError(_0xa35766,_0x127f67){_0x127f67=_0x127f67||0x1f4;return function(_0x56a79a){logger['error'](_0x56a79a[_0x3233('0x36')]);if(_0x56a79a[_0x3233('0x37')]){delete _0x56a79a['name'];}_0xa35766[_0x3233('0x30')](_0x127f67)['send'](_0x56a79a);};}exports[_0x3233('0x38')]=function(_0x15bdeb,_0x470d2e){var _0x5f4be0={},_0xd30b2b={},_0xe97e1b={'count':0x0,'rows':[]};var _0x21e7f8=_['map'](db[_0x3233('0x39')][_0x3233('0x3a')],function(_0x392e18){return{'name':_0x392e18[_0x3233('0x3b')],'type':_0x392e18[_0x3233('0x3c')][_0x3233('0x3d')]};});_0xd30b2b[_0x3233('0x3e')]=_[_0x3233('0x3f')](_0x21e7f8,'name');_0xd30b2b[_0x3233('0x40')]=_[_0x3233('0x41')](_0x15bdeb['query']);_0xd30b2b[_0x3233('0x42')]=_['intersection'](_0xd30b2b[_0x3233('0x3e')],_0xd30b2b['query']);_0x5f4be0[_0x3233('0x43')]=_[_0x3233('0x44')](_0xd30b2b[_0x3233('0x3e')],qs[_0x3233('0x45')](_0x15bdeb[_0x3233('0x40')]['fields']));_0x5f4be0['attributes']=_0x5f4be0[_0x3233('0x43')]['length']?_0x5f4be0[_0x3233('0x43')]:_0xd30b2b[_0x3233('0x3e')];if(!_0x15bdeb[_0x3233('0x40')][_0x3233('0x46')](_0x3233('0x47'))){_0x5f4be0[_0x3233('0x2e')]=qs['limit'](_0x15bdeb[_0x3233('0x40')][_0x3233('0x2e')]);_0x5f4be0[_0x3233('0x2c')]=qs['offset'](_0x15bdeb['query']['offset']);}_0x5f4be0[_0x3233('0x48')]=qs[_0x3233('0x49')](_0x15bdeb[_0x3233('0x40')][_0x3233('0x49')]);_0x5f4be0['where']=qs[_0x3233('0x42')](_['pick'](_0x15bdeb[_0x3233('0x40')],_0xd30b2b[_0x3233('0x42')]),_0x21e7f8);if(_0x15bdeb['query'][_0x3233('0x4a')]){_0x5f4be0[_0x3233('0x4b')]=_[_0x3233('0x4c')](_0x5f4be0[_0x3233('0x4b')],{'$or':_[_0x3233('0x3f')](_0x21e7f8,function(_0x18d8ab){if(_0x18d8ab[_0x3233('0x3c')]!==_0x3233('0x4d')){var _0x3cefd2={};_0x3cefd2[_0x18d8ab['name']]={'$like':'%'+_0x15bdeb[_0x3233('0x40')][_0x3233('0x4a')]+'%'};return _0x3cefd2;}})});}_0x5f4be0=_[_0x3233('0x4c')]({},_0x5f4be0,_0x15bdeb[_0x3233('0x4e')]);var _0x16190b={'where':_0x5f4be0[_0x3233('0x4b')]};return db[_0x3233('0x39')][_0x3233('0x2f')](_0x16190b)[_0x3233('0x1f')](function(_0x4ecd59){_0xe97e1b[_0x3233('0x2f')]=_0x4ecd59;if(_0x15bdeb[_0x3233('0x40')][_0x3233('0x4f')]){_0x5f4be0['include']=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x3233('0x50')](_0x5f4be0);})[_0x3233('0x1f')](function(_0x34f30d){_0xe97e1b[_0x3233('0x51')]=_0x34f30d;return _0xe97e1b;})[_0x3233('0x1f')](respondWithFilteredResult(_0x470d2e,_0x5f4be0))[_0x3233('0x52')](handleError(_0x470d2e,null));};exports[_0x3233('0x53')]=function(_0xf5467e,_0x1477f5){var _0x59deb1={'raw':![],'where':{'id':_0xf5467e[_0x3233('0x54')]['id']}},_0x4aa692={};_0x4aa692['model']=_[_0x3233('0x41')](db[_0x3233('0x39')][_0x3233('0x3a')]);_0x4aa692['query']=_[_0x3233('0x41')](_0xf5467e[_0x3233('0x40')]);_0x4aa692[_0x3233('0x42')]=_[_0x3233('0x44')](_0x4aa692['model'],_0x4aa692[_0x3233('0x40')]);_0x59deb1[_0x3233('0x43')]=_[_0x3233('0x44')](_0x4aa692[_0x3233('0x3e')],qs['fields'](_0xf5467e['query'][_0x3233('0x45')]));_0x59deb1[_0x3233('0x43')]=_0x59deb1[_0x3233('0x43')][_0x3233('0x55')]?_0x59deb1['attributes']:_0x4aa692[_0x3233('0x3e')];if(_0xf5467e['query'][_0x3233('0x4f')]){_0x59deb1[_0x3233('0x56')]=[{'all':!![]}];}_0x59deb1=_[_0x3233('0x4c')]({},_0x59deb1,_0xf5467e[_0x3233('0x4e')]);return db[_0x3233('0x39')]['find'](_0x59deb1)[_0x3233('0x1f')](handleEntityNotFound(_0x1477f5,null))[_0x3233('0x1f')](respondWithResult(_0x1477f5,null))['catch'](handleError(_0x1477f5,null));};exports[_0x3233('0x57')]=function(_0xd061d7,_0x1f965f){return db['FreshdeskConfiguration']['create'](_0xd061d7[_0x3233('0x58')],{})['then'](respondWithResult(_0x1f965f,0xc9))[_0x3233('0x52')](handleError(_0x1f965f,null));};exports['update']=function(_0x5b8d84,_0x1d7a7c){if(_0x5b8d84['body']['id']){delete _0x5b8d84['body']['id'];}return db['FreshdeskConfiguration'][_0x3233('0x59')]({'where':{'id':_0x5b8d84[_0x3233('0x54')]['id']}})[_0x3233('0x1f')](handleEntityNotFound(_0x1d7a7c,null))[_0x3233('0x1f')](saveUpdates(_0x5b8d84[_0x3233('0x58')],null))['then'](respondWithResult(_0x1d7a7c,null))[_0x3233('0x52')](handleError(_0x1d7a7c,null));};exports[_0x3233('0x5a')]=function(_0x463202,_0x571e1a){return db[_0x3233('0x39')][_0x3233('0x59')]({'where':{'id':_0x463202[_0x3233('0x54')]['id']}})[_0x3233('0x1f')](handleEntityNotFound(_0x571e1a,null))['then'](removeEntity(_0x571e1a,null))[_0x3233('0x52')](handleError(_0x571e1a,null));};exports['getFields']=function(_0x4235f7,_0x248105,_0x332920){var _0x2e2074={};var _0x531d97={};var _0x1dd34d;var _0x33c791;return db[_0x3233('0x39')][_0x3233('0x5b')]({'where':{'id':_0x4235f7[_0x3233('0x54')]['id']}})[_0x3233('0x1f')](handleEntityNotFound(_0x248105,null))[_0x3233('0x1f')](function(_0x4f63c5){if(_0x4f63c5){_0x1dd34d=_0x4f63c5;_0x531d97[_0x3233('0x3e')]=_[_0x3233('0x41')](db[_0x3233('0x5c')][_0x3233('0x3a')]);_0x531d97[_0x3233('0x40')]=_[_0x3233('0x41')](_0x4235f7[_0x3233('0x40')]);_0x531d97[_0x3233('0x42')]=_['intersection'](_0x531d97[_0x3233('0x3e')],_0x531d97['query']);_0x2e2074[_0x3233('0x43')]=_[_0x3233('0x44')](_0x531d97[_0x3233('0x3e')],qs[_0x3233('0x45')](_0x4235f7[_0x3233('0x40')][_0x3233('0x45')]));_0x2e2074[_0x3233('0x43')]=_0x2e2074[_0x3233('0x43')]['length']?_0x2e2074[_0x3233('0x43')]:_0x531d97[_0x3233('0x3e')];_0x2e2074['order']=qs[_0x3233('0x49')](_0x4235f7['query'][_0x3233('0x49')]);_0x2e2074[_0x3233('0x4b')]=qs[_0x3233('0x42')](_[_0x3233('0x5d')](_0x4235f7['query'],_0x531d97[_0x3233('0x42')]));if(_0x4235f7[_0x3233('0x40')][_0x3233('0x4a')]){_0x2e2074['where']=_[_0x3233('0x4c')](_0x2e2074[_0x3233('0x4b')],{'$or':_[_0x3233('0x3f')](_0x2e2074['attributes'],function(_0x36eeee){var _0x136dc5={};_0x136dc5[_0x36eeee]={'$like':'%'+_0x4235f7[_0x3233('0x40')][_0x3233('0x4a')]+'%'};return _0x136dc5;})});}_0x2e2074=_[_0x3233('0x4c')]({},_0x2e2074,_0x4235f7[_0x3233('0x4e')]);return _0x1dd34d[_0x3233('0x5e')](_0x2e2074);}})[_0x3233('0x1f')](function(_0x4b450e){if(_0x4b450e){_0x33c791=_0x4b450e[_0x3233('0x55')];if(!_0x4235f7[_0x3233('0x40')][_0x3233('0x46')](_0x3233('0x47'))){_0x2e2074[_0x3233('0x2e')]=qs['limit'](_0x4235f7[_0x3233('0x40')][_0x3233('0x2e')]);_0x2e2074[_0x3233('0x2c')]=qs[_0x3233('0x2c')](_0x4235f7[_0x3233('0x40')][_0x3233('0x2c')]);}return _0x1dd34d['getFields'](_0x2e2074);}})['then'](function(_0x319bcd){if(_0x319bcd){return _0x319bcd?{'count':_0x33c791,'rows':_0x319bcd}:null;}})[_0x3233('0x1f')](respondWithResult(_0x248105,null))[_0x3233('0x52')](handleError(_0x248105,null));};exports['getSubjects']=function(_0x514c5f,_0x54fe01,_0x1cdbc9){var _0x498b2f={};var _0x538f8a={};var _0x59fc78;var _0x2b4350;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x514c5f[_0x3233('0x54')]['id']}})[_0x3233('0x1f')](handleEntityNotFound(_0x54fe01,null))[_0x3233('0x1f')](function(_0x3427b8){if(_0x3427b8){_0x59fc78=_0x3427b8;_0x538f8a[_0x3233('0x3e')]=_[_0x3233('0x41')](db[_0x3233('0x5c')][_0x3233('0x3a')]);_0x538f8a['query']=_[_0x3233('0x41')](_0x514c5f[_0x3233('0x40')]);_0x538f8a[_0x3233('0x42')]=_['intersection'](_0x538f8a[_0x3233('0x3e')],_0x538f8a[_0x3233('0x40')]);_0x498b2f[_0x3233('0x43')]=_[_0x3233('0x44')](_0x538f8a['model'],qs['fields'](_0x514c5f[_0x3233('0x40')][_0x3233('0x45')]));_0x498b2f[_0x3233('0x43')]=_0x498b2f['attributes'][_0x3233('0x55')]?_0x498b2f[_0x3233('0x43')]:_0x538f8a[_0x3233('0x3e')];_0x498b2f[_0x3233('0x48')]=qs[_0x3233('0x49')](_0x514c5f[_0x3233('0x40')][_0x3233('0x49')]);_0x498b2f['where']=qs[_0x3233('0x42')](_[_0x3233('0x5d')](_0x514c5f[_0x3233('0x40')],_0x538f8a[_0x3233('0x42')]));if(_0x514c5f[_0x3233('0x40')][_0x3233('0x4a')]){_0x498b2f[_0x3233('0x4b')]=_[_0x3233('0x4c')](_0x498b2f[_0x3233('0x4b')],{'$or':_['map'](_0x498b2f[_0x3233('0x43')],function(_0x4171c8){var _0x2f8869={};_0x2f8869[_0x4171c8]={'$like':'%'+_0x514c5f[_0x3233('0x40')][_0x3233('0x4a')]+'%'};return _0x2f8869;})});}_0x498b2f=_[_0x3233('0x4c')]({},_0x498b2f,_0x514c5f[_0x3233('0x4e')]);return _0x59fc78['getSubjects'](_0x498b2f);}})['then'](function(_0x551f33){if(_0x551f33){_0x2b4350=_0x551f33[_0x3233('0x55')];if(!_0x514c5f[_0x3233('0x40')][_0x3233('0x46')](_0x3233('0x47'))){_0x498b2f[_0x3233('0x2e')]=qs[_0x3233('0x2e')](_0x514c5f['query'][_0x3233('0x2e')]);_0x498b2f[_0x3233('0x2c')]=qs['offset'](_0x514c5f[_0x3233('0x40')][_0x3233('0x2c')]);}return _0x59fc78[_0x3233('0x5f')](_0x498b2f);}})['then'](function(_0x33b902){if(_0x33b902){return _0x33b902?{'count':_0x2b4350,'rows':_0x33b902}:null;}})[_0x3233('0x1f')](respondWithResult(_0x54fe01,null))[_0x3233('0x52')](handleError(_0x54fe01,null));};exports[_0x3233('0x60')]=function(_0x26d165,_0x3da0a7,_0x252ac7){var _0x67148c={};var _0x1e01ee={};var _0xfb456c;var _0x26a8b3;return db[_0x3233('0x39')][_0x3233('0x5b')]({'where':{'id':_0x26d165[_0x3233('0x54')]['id']}})[_0x3233('0x1f')](handleEntityNotFound(_0x3da0a7,null))[_0x3233('0x1f')](function(_0x218659){if(_0x218659){_0xfb456c=_0x218659;_0x1e01ee['model']=_['keys'](db[_0x3233('0x5c')][_0x3233('0x3a')]);_0x1e01ee[_0x3233('0x40')]=_['keys'](_0x26d165[_0x3233('0x40')]);_0x1e01ee[_0x3233('0x42')]=_['intersection'](_0x1e01ee[_0x3233('0x3e')],_0x1e01ee[_0x3233('0x40')]);_0x67148c[_0x3233('0x43')]=_[_0x3233('0x44')](_0x1e01ee[_0x3233('0x3e')],qs['fields'](_0x26d165[_0x3233('0x40')][_0x3233('0x45')]));_0x67148c['attributes']=_0x67148c[_0x3233('0x43')][_0x3233('0x55')]?_0x67148c[_0x3233('0x43')]:_0x1e01ee[_0x3233('0x3e')];_0x67148c['order']=qs[_0x3233('0x49')](_0x26d165[_0x3233('0x40')][_0x3233('0x49')]);_0x67148c[_0x3233('0x4b')]=qs[_0x3233('0x42')](_[_0x3233('0x5d')](_0x26d165[_0x3233('0x40')],_0x1e01ee[_0x3233('0x42')]));if(_0x26d165[_0x3233('0x40')][_0x3233('0x4a')]){_0x67148c[_0x3233('0x4b')]=_['merge'](_0x67148c[_0x3233('0x4b')],{'$or':_['map'](_0x67148c['attributes'],function(_0x5a42a7){var _0x5ae47d={};_0x5ae47d[_0x5a42a7]={'$like':'%'+_0x26d165[_0x3233('0x40')][_0x3233('0x4a')]+'%'};return _0x5ae47d;})});}_0x67148c=_[_0x3233('0x4c')]({},_0x67148c,_0x26d165[_0x3233('0x4e')]);return _0xfb456c[_0x3233('0x60')](_0x67148c);}})[_0x3233('0x1f')](function(_0x32a6a3){if(_0x32a6a3){_0x26a8b3=_0x32a6a3['length'];if(!_0x26d165[_0x3233('0x40')][_0x3233('0x46')](_0x3233('0x47'))){_0x67148c[_0x3233('0x2e')]=qs[_0x3233('0x2e')](_0x26d165[_0x3233('0x40')][_0x3233('0x2e')]);_0x67148c['offset']=qs[_0x3233('0x2c')](_0x26d165[_0x3233('0x40')][_0x3233('0x2c')]);}return _0xfb456c['getDescriptions'](_0x67148c);}})['then'](function(_0x2b7be5){if(_0x2b7be5){return _0x2b7be5?{'count':_0x26a8b3,'rows':_0x2b7be5}:null;}})['then'](respondWithResult(_0x3da0a7,null))[_0x3233('0x52')](handleError(_0x3da0a7,null));};exports[_0x3233('0x61')]=function(_0x6f016c,_0x436485,_0x19400e){var _0x4032d2={};var _0x53af87={};var _0x2b311e;var _0x2df1d3;return db['FreshdeskConfiguration'][_0x3233('0x5b')]({'where':{'id':_0x6f016c['params']['id']}})[_0x3233('0x1f')](handleEntityNotFound(_0x436485,null))[_0x3233('0x1f')](function(_0x3cb2f5){if(_0x3cb2f5){_0x2b311e=_0x3cb2f5;_0x53af87[_0x3233('0x3e')]=_[_0x3233('0x41')](db['Tag']['rawAttributes']);_0x53af87['query']=_[_0x3233('0x41')](_0x6f016c[_0x3233('0x40')]);_0x53af87[_0x3233('0x42')]=_[_0x3233('0x44')](_0x53af87[_0x3233('0x3e')],_0x53af87['query']);_0x4032d2['attributes']=_[_0x3233('0x44')](_0x53af87[_0x3233('0x3e')],qs['fields'](_0x6f016c[_0x3233('0x40')]['fields']));_0x4032d2[_0x3233('0x43')]=_0x4032d2[_0x3233('0x43')][_0x3233('0x55')]?_0x4032d2['attributes']:_0x53af87['model'];_0x4032d2[_0x3233('0x48')]=qs[_0x3233('0x49')](_0x6f016c['query'][_0x3233('0x49')]);_0x4032d2['where']=qs[_0x3233('0x42')](_[_0x3233('0x5d')](_0x6f016c[_0x3233('0x40')],_0x53af87[_0x3233('0x42')]));if(_0x6f016c['query'][_0x3233('0x4a')]){_0x4032d2[_0x3233('0x4b')]=_['merge'](_0x4032d2['where'],{'$or':_[_0x3233('0x3f')](_0x4032d2[_0x3233('0x43')],function(_0x1328c5){var _0x3d6323={};_0x3d6323[_0x1328c5]={'$like':'%'+_0x6f016c[_0x3233('0x40')][_0x3233('0x4a')]+'%'};return _0x3d6323;})});}_0x4032d2=_[_0x3233('0x4c')]({},_0x4032d2,_0x6f016c[_0x3233('0x4e')]);return _0x2b311e[_0x3233('0x61')](_0x4032d2);}})[_0x3233('0x1f')](function(_0x5e450e){if(_0x5e450e){_0x2df1d3=_0x5e450e[_0x3233('0x55')];if(!_0x6f016c[_0x3233('0x40')]['hasOwnProperty'](_0x3233('0x47'))){_0x4032d2[_0x3233('0x2e')]=qs[_0x3233('0x2e')](_0x6f016c['query'][_0x3233('0x2e')]);_0x4032d2['offset']=qs['offset'](_0x6f016c['query'][_0x3233('0x2c')]);}return _0x2b311e['getTags'](_0x4032d2);}})[_0x3233('0x1f')](function(_0x53139a){if(_0x53139a){return _0x53139a?{'count':_0x2df1d3,'rows':_0x53139a}:null;}})[_0x3233('0x1f')](respondWithResult(_0x436485,null))['catch'](handleError(_0x436485,null));};exports['setTags']=function(_0x3187ec,_0x42f80d,_0x508f64){if(_0x3187ec[_0x3233('0x58')]['id']){delete _0x3187ec[_0x3233('0x58')]['id'];}return db[_0x3233('0x39')][_0x3233('0x5b')]({'where':{'id':_0x3187ec[_0x3233('0x54')]['id']}})[_0x3233('0x1f')](handleEntityNotFound(_0x42f80d,null))[_0x3233('0x1f')](function(_0x5b1415){if(_0x5b1415){return _0x5b1415[_0x3233('0x62')](_0x3187ec['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x42f80d,null))['catch'](handleError(_0x42f80d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 47425bc..3e5877b 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 _0x0409=['../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','bluebird','path'];(function(_0xc7e8c,_0x1a2912){var _0x3d97e3=function(_0x137d05){while(--_0x137d05){_0xc7e8c['push'](_0xc7e8c['shift']());}};_0x3d97e3(++_0x1a2912);}(_0x0409,0x195));var _0x9040=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x0409[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x9040('0x0'));var util=require(_0x9040('0x1'));var logger=require(_0x9040('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9040('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9040('0x4'));var rimraf=require('rimraf');var config=require(_0x9040('0x5'));var attributes=require(_0x9040('0x6'));module['exports']=function(_0xc597a7,_0x37efe2){return _0xc597a7[_0x9040('0x7')](_0x9040('0x8'),attributes,{'tableName':_0x9040('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74d4=['./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment'];(function(_0x307174,_0x538975){var _0x511d0f=function(_0x291897){while(--_0x291897){_0x307174['push'](_0x307174['shift']());}};_0x511d0f(++_0x538975);}(_0x74d4,0x71));var _0x474d=function(_0x24b3c3,_0x46b45d){_0x24b3c3=_0x24b3c3-0x0;var _0x2e856b=_0x74d4[_0x24b3c3];return _0x2e856b;};'use strict';var _=require(_0x474d('0x0'));var util=require(_0x474d('0x1'));var logger=require(_0x474d('0x2'))(_0x474d('0x3'));var moment=require('moment');var BPromise=require(_0x474d('0x4'));var rp=require(_0x474d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x474d('0x6'));var attributes=require(_0x474d('0x7'));module[_0x474d('0x8')]=function(_0x29d104,_0x42110e){return _0x29d104['define'](_0x474d('0x9'),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 9f9d810..0eae6aa 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 _0xad0e=['../../config/logger','jayson/promise','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x17b23c,_0x423472){var _0x3af1b4=function(_0x34e307){while(--_0x34e307){_0x17b23c['push'](_0x17b23c['shift']());}};_0x3af1b4(++_0x423472);}(_0xad0e,0x1da));var _0xead0=function(_0x23ad74,_0x4bd754){_0x23ad74=_0x23ad74-0x0;var _0x43d709=_0xad0e[_0x23ad74];return _0x43d709;};'use strict';var _=require(_0xead0('0x0'));var util=require('util');var moment=require(_0xead0('0x1'));var BPromise=require('bluebird');var rs=require(_0xead0('0x2'));var fs=require('fs');var Redis=require(_0xead0('0x3'));var db=require(_0xead0('0x4'))['db'];var utils=require(_0xead0('0x5'));var logger=require(_0xead0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xead0('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x161ca9,_0x6b5d10,_0x7b38e6){return new BPromise(function(_0x8ff94c,_0xaf13fc){return client['request'](_0x161ca9,_0x7b38e6)[_0xead0('0x8')](function(_0xdded63){logger[_0xead0('0x9')](_0xead0('0xa'),_0x6b5d10,_0xead0('0xb'));logger[_0xead0('0xc')](_0xead0('0xd'),_0x6b5d10,_0xead0('0xb'),JSON[_0xead0('0xe')](_0xdded63));if(_0xdded63[_0xead0('0xf')]){if(_0xdded63[_0xead0('0xf')][_0xead0('0x10')]===0x1f4){logger[_0xead0('0xf')](_0xead0('0xa'),_0x6b5d10,_0xdded63['error']['message']);return _0xaf13fc(_0xdded63[_0xead0('0xf')][_0xead0('0x11')]);}logger[_0xead0('0xf')](_0xead0('0xa'),_0x6b5d10,_0xdded63[_0xead0('0xf')][_0xead0('0x11')]);return _0x8ff94c(_0xdded63[_0xead0('0xf')][_0xead0('0x11')]);}else{logger[_0xead0('0x9')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x6b5d10,_0xead0('0xb'));_0x8ff94c(_0xdded63[_0xead0('0x12')][_0xead0('0x11')]);}})[_0xead0('0x13')](function(_0x3ddb55){logger[_0xead0('0xf')](_0xead0('0xa'),_0x6b5d10,_0x3ddb55);_0xaf13fc(_0x3ddb55);});});} \ No newline at end of file +var _0x074b=['message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x575c52,_0x576dab){var _0x5b497b=function(_0x233e1a){while(--_0x233e1a){_0x575c52['push'](_0x575c52['shift']());}};_0x5b497b(++_0x576dab);}(_0x074b,0x1ca));var _0xb074=function(_0x423fda,_0x2afb5f){_0x423fda=_0x423fda-0x0;var _0xc49ca6=_0x074b[_0x423fda];return _0xc49ca6;};'use strict';var _=require(_0xb074('0x0'));var util=require(_0xb074('0x1'));var moment=require(_0xb074('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb074('0x3'));var db=require(_0xb074('0x4'))['db'];var utils=require(_0xb074('0x5'));var logger=require('../../config/logger')(_0xb074('0x6'));var config=require(_0xb074('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb074('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x192d86,_0x2edc6d,_0x270cfe){return new BPromise(function(_0x38b0d2,_0x530be5){return client[_0xb074('0x9')](_0x192d86,_0x270cfe)[_0xb074('0xa')](function(_0x26520b){logger[_0xb074('0xb')](_0xb074('0xc'),_0x2edc6d,'request\x20sent');logger['debug'](_0xb074('0xd'),_0x2edc6d,_0xb074('0xe'),JSON[_0xb074('0xf')](_0x26520b));if(_0x26520b[_0xb074('0x10')]){if(_0x26520b[_0xb074('0x10')]['code']===0x1f4){logger['error'](_0xb074('0xc'),_0x2edc6d,_0x26520b[_0xb074('0x10')][_0xb074('0x11')]);return _0x530be5(_0x26520b[_0xb074('0x10')][_0xb074('0x11')]);}logger[_0xb074('0x10')](_0xb074('0xc'),_0x2edc6d,_0x26520b[_0xb074('0x10')][_0xb074('0x11')]);return _0x38b0d2(_0x26520b[_0xb074('0x10')][_0xb074('0x11')]);}else{logger['info'](_0xb074('0xc'),_0x2edc6d,_0xb074('0xe'));_0x38b0d2(_0x26520b['result'][_0xb074('0x11')]);}})[_0xb074('0x12')](function(_0xf07f0b){logger[_0xb074('0x10')](_0xb074('0xc'),_0x2edc6d,_0xf07f0b);_0x530be5(_0xf07f0b);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 0bed5c8..a00cd30 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 _0x8962=['/:id','update','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','show','post','create'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0x8962,0x1a7));var _0x2896=function(_0x3f6e31,_0x120798){_0x3f6e31=_0x3f6e31-0x0;var _0x3de77a=_0x8962[_0x3f6e31];return _0x3de77a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2896('0x0'));var express=require('express');var router=express[_0x2896('0x1')]();var fs_extra=require(_0x2896('0x2'));var auth=require(_0x2896('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2896('0x4'));var controller=require(_0x2896('0x5'));router['get']('/',auth[_0x2896('0x6')](),controller[_0x2896('0x7')]);router['get']('/:id',auth[_0x2896('0x6')](),controller[_0x2896('0x8')]);router[_0x2896('0x9')]('/',auth[_0x2896('0x6')](),controller[_0x2896('0xa')]);router['put'](_0x2896('0xb'),auth[_0x2896('0x6')](),controller[_0x2896('0xc')]);router['delete'](_0x2896('0xb'),auth[_0x2896('0x6')](),controller[_0x2896('0xd')]);module['exports']=router; \ No newline at end of file +var _0x31cb=['update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x1883bb,_0x825ea5){var _0x12631d=function(_0x51ca07){while(--_0x51ca07){_0x1883bb['push'](_0x1883bb['shift']());}};_0x12631d(++_0x825ea5);}(_0x31cb,0x1d7));var _0xb31c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x31cb[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xb31c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb31c('0x1'));var express=require(_0xb31c('0x2'));var router=express[_0xb31c('0x3')]();var fs_extra=require(_0xb31c('0x4'));var auth=require(_0xb31c('0x5'));var interaction=require(_0xb31c('0x6'));var config=require(_0xb31c('0x7'));var controller=require('./intFreshdeskField.controller');router[_0xb31c('0x8')]('/',auth[_0xb31c('0x9')](),controller[_0xb31c('0xa')]);router[_0xb31c('0x8')](_0xb31c('0xb'),auth[_0xb31c('0x9')](),controller[_0xb31c('0xc')]);router[_0xb31c('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb31c('0xe')](_0xb31c('0xb'),auth['isAuthenticated'](),controller[_0xb31c('0xf')]);router[_0xb31c('0x10')](_0xb31c('0xb'),auth[_0xb31c('0x9')](),controller[_0xb31c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 5628c12..8eabc24 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 _0x5712=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x5a3e9d,_0x419dba){var _0x37a34d=function(_0x59f8e2){while(--_0x59f8e2){_0x5a3e9d['push'](_0x5a3e9d['shift']());}};_0x37a34d(++_0x419dba);}(_0x5712,0x140));var _0x2571=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5712[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x2571('0x0'));module[_0x2571('0x1')]={'type':{'type':Sequelize[_0x2571('0x2')](_0x2571('0x3'),_0x2571('0x4'),_0x2571('0x5'),_0x2571('0x6'),_0x2571('0x7')),'defaultValue':_0x2571('0x3')},'content':{'type':Sequelize[_0x2571('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x2571('0x3'),'variable',_0x2571('0x5'))},'keyContent':{'type':Sequelize[_0x2571('0x8')]},'idField':{'type':Sequelize[_0x2571('0x8')]},'nameField':{'type':Sequelize[_0x2571('0x8')]},'customField':{'type':Sequelize[_0x2571('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2571('0x8')]}}; \ No newline at end of file +var _0xad8a=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x75045b,_0x14edb4){var _0x10acc5=function(_0x1edca4){while(--_0x1edca4){_0x75045b['push'](_0x75045b['shift']());}};_0x10acc5(++_0x14edb4);}(_0xad8a,0xb0));var _0xaad8=function(_0x3f45f3,_0x4e4e79){_0x3f45f3=_0x3f45f3-0x0;var _0x3ef549=_0xad8a[_0x3f45f3];return _0x3ef549;};'use strict';var Sequelize=require(_0xaad8('0x0'));module[_0xaad8('0x1')]={'type':{'type':Sequelize[_0xaad8('0x2')](_0xaad8('0x3'),_0xaad8('0x4'),'customVariable',_0xaad8('0x5'),_0xaad8('0x6')),'defaultValue':_0xaad8('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xaad8('0x7')]},'keyType':{'type':Sequelize[_0xaad8('0x2')](_0xaad8('0x3'),_0xaad8('0x4'),_0xaad8('0x8'))},'keyContent':{'type':Sequelize[_0xaad8('0x7')]},'idField':{'type':Sequelize[_0xaad8('0x7')]},'nameField':{'type':Sequelize[_0xaad8('0x7')]},'customField':{'type':Sequelize[_0xaad8('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaad8('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 271dca7..6018d62 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 _0x7cb2=['ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x485a73,_0x318bc9){var _0xf21947=function(_0x527fdf){while(--_0x527fdf){_0x485a73['push'](_0x485a73['shift']());}};_0xf21947(++_0x318bc9);}(_0x7cb2,0x178));var _0x27cb=function(_0x4102a0,_0x215450){_0x4102a0=_0x4102a0-0x0;var _0x2be13f=_0x7cb2[_0x4102a0];return _0x2be13f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27cb('0x0'));var zipdir=require(_0x27cb('0x1'));var jsonpatch=require(_0x27cb('0x2'));var rp=require(_0x27cb('0x3'));var moment=require(_0x27cb('0x4'));var BPromise=require(_0x27cb('0x5'));var Mustache=require('mustache');var util=require(_0x27cb('0x6'));var path=require(_0x27cb('0x7'));var sox=require(_0x27cb('0x8'));var csv=require('to-csv');var ejs=require(_0x27cb('0x9'));var fs=require('fs');var fs_extra=require(_0x27cb('0xa'));var _=require(_0x27cb('0xb'));var squel=require(_0x27cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x27cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x27cb('0xe'));var querystring=require(_0x27cb('0xf'));var Papa=require('papaparse');var Redis=require(_0x27cb('0x10'));var authService=require(_0x27cb('0x11'));var qs=require(_0x27cb('0x12'));var as=require(_0x27cb('0x13'));var hardwareService=require(_0x27cb('0x14'));var logger=require(_0x27cb('0x15'))(_0x27cb('0x16'));var utils=require(_0x27cb('0x17'));var config=require(_0x27cb('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x272e27,_0x7a028d){_0x7a028d=_0x7a028d||0xcc;return function(_0x21d138){if(_0x21d138){return _0x272e27[_0x27cb('0x19')](_0x7a028d);}return _0x272e27[_0x27cb('0x1a')](_0x7a028d)[_0x27cb('0x1b')]();};}function respondWithResult(_0x584d00,_0x41e29b){_0x41e29b=_0x41e29b||0xc8;return function(_0x4a6268){if(_0x4a6268){return _0x584d00[_0x27cb('0x1a')](_0x41e29b)[_0x27cb('0x1c')](_0x4a6268);}};}function respondWithFilteredResult(_0x3bec47,_0x3eced4){return function(_0x1cdb1e){if(_0x1cdb1e){var _0x266be5=typeof _0x3eced4[_0x27cb('0x1d')]===_0x27cb('0x1e')&&typeof _0x3eced4[_0x27cb('0x1f')]==='undefined';var _0x17f97b=_0x1cdb1e[_0x27cb('0x20')];var _0x5d4279=_0x266be5?0x0:_0x3eced4['offset'];var _0x3ddd16=_0x266be5?_0x1cdb1e[_0x27cb('0x20')]:_0x3eced4['offset']+_0x3eced4['limit'];var _0x327c96;if(_0x3ddd16>=_0x17f97b){_0x3ddd16=_0x17f97b;_0x327c96=0xc8;}else{_0x327c96=0xce;}_0x3bec47[_0x27cb('0x1a')](_0x327c96);return _0x3bec47[_0x27cb('0x21')](_0x27cb('0x22'),_0x5d4279+'-'+_0x3ddd16+'/'+_0x17f97b)[_0x27cb('0x1c')](_0x1cdb1e);}return null;};}function patchUpdates(_0x5313d3){return function(_0x5e9da5){try{jsonpatch[_0x27cb('0x23')](_0x5e9da5,_0x5313d3,!![]);}catch(_0x5c9bd4){return BPromise[_0x27cb('0x24')](_0x5c9bd4);}return _0x5e9da5[_0x27cb('0x25')]();};}function saveUpdates(_0x4f892c,_0x4bd396){return function(_0xb6d193){if(_0xb6d193){return _0xb6d193[_0x27cb('0x26')](_0x4f892c)[_0x27cb('0x27')](function(_0x36527f){return _0x36527f;});}return null;};}function removeEntity(_0x4dee29,_0x564ae5){return function(_0x3777f1){if(_0x3777f1){return _0x3777f1[_0x27cb('0x28')]()['then'](function(){_0x4dee29[_0x27cb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x513eba,_0x32c5a8){return function(_0x3ae4ee){if(!_0x3ae4ee){_0x513eba[_0x27cb('0x19')](0x194);}return _0x3ae4ee;};}function handleError(_0x560f0f,_0x324353){_0x324353=_0x324353||0x1f4;return function(_0x5ab569){logger[_0x27cb('0x29')](_0x5ab569[_0x27cb('0x2a')]);if(_0x5ab569[_0x27cb('0x2b')]){delete _0x5ab569[_0x27cb('0x2b')];}_0x560f0f[_0x27cb('0x1a')](_0x324353)[_0x27cb('0x2c')](_0x5ab569);};}exports[_0x27cb('0x2d')]=function(_0x5a9ffd,_0x594ff9){var _0x285bcd={},_0x56080c={},_0xa98b5={'count':0x0,'rows':[]};var _0x40aaee=_[_0x27cb('0x2e')](db[_0x27cb('0x2f')]['rawAttributes'],function(_0x1904a6){return{'name':_0x1904a6[_0x27cb('0x30')],'type':_0x1904a6[_0x27cb('0x31')][_0x27cb('0x32')]};});_0x56080c[_0x27cb('0x33')]=_[_0x27cb('0x2e')](_0x40aaee,_0x27cb('0x2b'));_0x56080c[_0x27cb('0x34')]=_['keys'](_0x5a9ffd[_0x27cb('0x34')]);_0x56080c[_0x27cb('0x35')]=_[_0x27cb('0x36')](_0x56080c[_0x27cb('0x33')],_0x56080c[_0x27cb('0x34')]);_0x285bcd['attributes']=_[_0x27cb('0x36')](_0x56080c['model'],qs['fields'](_0x5a9ffd[_0x27cb('0x34')][_0x27cb('0x37')]));_0x285bcd[_0x27cb('0x38')]=_0x285bcd['attributes'][_0x27cb('0x39')]?_0x285bcd[_0x27cb('0x38')]:_0x56080c[_0x27cb('0x33')];if(!_0x5a9ffd[_0x27cb('0x34')][_0x27cb('0x3a')](_0x27cb('0x3b'))){_0x285bcd[_0x27cb('0x1f')]=qs[_0x27cb('0x1f')](_0x5a9ffd[_0x27cb('0x34')][_0x27cb('0x1f')]);_0x285bcd[_0x27cb('0x1d')]=qs[_0x27cb('0x1d')](_0x5a9ffd[_0x27cb('0x34')][_0x27cb('0x1d')]);}_0x285bcd['order']=qs[_0x27cb('0x3c')](_0x5a9ffd[_0x27cb('0x34')][_0x27cb('0x3c')]);_0x285bcd['where']=qs[_0x27cb('0x35')](_['pick'](_0x5a9ffd[_0x27cb('0x34')],_0x56080c['filters']),_0x40aaee);if(_0x5a9ffd['query']['filter']){_0x285bcd[_0x27cb('0x3d')]=_[_0x27cb('0x3e')](_0x285bcd['where'],{'$or':_[_0x27cb('0x2e')](_0x40aaee,function(_0x138b39){if(_0x138b39[_0x27cb('0x31')]!==_0x27cb('0x3f')){var _0x3f41ac={};_0x3f41ac[_0x138b39['name']]={'$like':'%'+_0x5a9ffd[_0x27cb('0x34')][_0x27cb('0x40')]+'%'};return _0x3f41ac;}})});}_0x285bcd=_[_0x27cb('0x3e')]({},_0x285bcd,_0x5a9ffd['options']);var _0x39cc23={'where':_0x285bcd['where']};return db[_0x27cb('0x2f')]['count'](_0x39cc23)['then'](function(_0x8fc474){_0xa98b5['count']=_0x8fc474;if(_0x5a9ffd[_0x27cb('0x34')]['includeAll']){_0x285bcd[_0x27cb('0x41')]=[{'all':!![]}];}return db['FreshdeskField'][_0x27cb('0x42')](_0x285bcd);})['then'](function(_0x5b1fad){_0xa98b5[_0x27cb('0x43')]=_0x5b1fad;return _0xa98b5;})[_0x27cb('0x27')](respondWithFilteredResult(_0x594ff9,_0x285bcd))[_0x27cb('0x44')](handleError(_0x594ff9,null));};exports['show']=function(_0x22416f,_0x1c34b2){var _0x5b564e={'raw':!![],'where':{'id':_0x22416f[_0x27cb('0x45')]['id']}},_0x358785={};_0x358785['model']=_[_0x27cb('0x46')](db[_0x27cb('0x2f')][_0x27cb('0x47')]);_0x358785['query']=_[_0x27cb('0x46')](_0x22416f[_0x27cb('0x34')]);_0x358785[_0x27cb('0x35')]=_['intersection'](_0x358785[_0x27cb('0x33')],_0x358785[_0x27cb('0x34')]);_0x5b564e[_0x27cb('0x38')]=_['intersection'](_0x358785[_0x27cb('0x33')],qs['fields'](_0x22416f[_0x27cb('0x34')][_0x27cb('0x37')]));_0x5b564e[_0x27cb('0x38')]=_0x5b564e[_0x27cb('0x38')][_0x27cb('0x39')]?_0x5b564e[_0x27cb('0x38')]:_0x358785[_0x27cb('0x33')];if(_0x22416f[_0x27cb('0x34')][_0x27cb('0x48')]){_0x5b564e[_0x27cb('0x41')]=[{'all':!![]}];}_0x5b564e=_['merge']({},_0x5b564e,_0x22416f[_0x27cb('0x49')]);return db[_0x27cb('0x2f')][_0x27cb('0x4a')](_0x5b564e)[_0x27cb('0x27')](handleEntityNotFound(_0x1c34b2,null))['then'](respondWithResult(_0x1c34b2,null))[_0x27cb('0x44')](handleError(_0x1c34b2,null));};exports['create']=function(_0x2e9777,_0x1ef91d){return db['FreshdeskField'][_0x27cb('0x4b')](_0x2e9777[_0x27cb('0x4c')],{})[_0x27cb('0x27')](respondWithResult(_0x1ef91d,0xc9))[_0x27cb('0x44')](handleError(_0x1ef91d,null));};exports[_0x27cb('0x26')]=function(_0x3fceb9,_0x178873){if(_0x3fceb9['body']['id']){delete _0x3fceb9[_0x27cb('0x4c')]['id'];}return db[_0x27cb('0x2f')]['find']({'where':{'id':_0x3fceb9[_0x27cb('0x45')]['id']}})[_0x27cb('0x27')](handleEntityNotFound(_0x178873,null))[_0x27cb('0x27')](saveUpdates(_0x3fceb9[_0x27cb('0x4c')],null))['then'](respondWithResult(_0x178873,null))['catch'](handleError(_0x178873,null));};exports['destroy']=function(_0x4d7db8,_0x1b83d1){return db[_0x27cb('0x2f')]['find']({'where':{'id':_0x4d7db8[_0x27cb('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b83d1,null))['then'](removeEntity(_0x1b83d1,null))[_0x27cb('0x44')](handleError(_0x1b83d1,null));}; \ No newline at end of file +var _0x634a=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x634a,0x17f));var _0xa634=function(_0x155ec4,_0x41e306){_0x155ec4=_0x155ec4-0x0;var _0x41070c=_0x634a[_0x155ec4];return _0x41070c;};'use strict';var emlformat=require(_0xa634('0x0'));var rimraf=require(_0xa634('0x1'));var zipdir=require(_0xa634('0x2'));var jsonpatch=require(_0xa634('0x3'));var rp=require(_0xa634('0x4'));var moment=require(_0xa634('0x5'));var BPromise=require(_0xa634('0x6'));var Mustache=require(_0xa634('0x7'));var util=require(_0xa634('0x8'));var path=require(_0xa634('0x9'));var sox=require(_0xa634('0xa'));var csv=require(_0xa634('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa634('0xc'));var _=require(_0xa634('0xd'));var squel=require(_0xa634('0xe'));var crypto=require('crypto');var jsforce=require(_0xa634('0xf'));var deskjs=require(_0xa634('0x10'));var toCsv=require(_0xa634('0xb'));var querystring=require(_0xa634('0x11'));var Papa=require(_0xa634('0x12'));var Redis=require(_0xa634('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa634('0x14'));var as=require(_0xa634('0x15'));var hardwareService=require(_0xa634('0x16'));var logger=require(_0xa634('0x17'))('api');var utils=require(_0xa634('0x18'));var config=require(_0xa634('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa634('0x1a'))['db'];function respondWithStatusCode(_0x1ae0b6,_0x36421c){_0x36421c=_0x36421c||0xcc;return function(_0x4a9f92){if(_0x4a9f92){return _0x1ae0b6[_0xa634('0x1b')](_0x36421c);}return _0x1ae0b6[_0xa634('0x1c')](_0x36421c)[_0xa634('0x1d')]();};}function respondWithResult(_0x58beb8,_0x9c54fd){_0x9c54fd=_0x9c54fd||0xc8;return function(_0x49c986){if(_0x49c986){return _0x58beb8[_0xa634('0x1c')](_0x9c54fd)['json'](_0x49c986);}};}function respondWithFilteredResult(_0x247e85,_0x51a5e3){return function(_0x2638e1){if(_0x2638e1){var _0x284ebe=typeof _0x51a5e3[_0xa634('0x1e')]===_0xa634('0x1f')&&typeof _0x51a5e3['limit']===_0xa634('0x1f');var _0x16983c=_0x2638e1['count'];var _0x13b4ee=_0x284ebe?0x0:_0x51a5e3['offset'];var _0x534183=_0x284ebe?_0x2638e1['count']:_0x51a5e3[_0xa634('0x1e')]+_0x51a5e3[_0xa634('0x20')];var _0x5e0b58;if(_0x534183>=_0x16983c){_0x534183=_0x16983c;_0x5e0b58=0xc8;}else{_0x5e0b58=0xce;}_0x247e85[_0xa634('0x1c')](_0x5e0b58);return _0x247e85[_0xa634('0x21')](_0xa634('0x22'),_0x13b4ee+'-'+_0x534183+'/'+_0x16983c)[_0xa634('0x23')](_0x2638e1);}return null;};}function patchUpdates(_0x119f6b){return function(_0x29b81a){try{jsonpatch[_0xa634('0x24')](_0x29b81a,_0x119f6b,!![]);}catch(_0x4b3f86){return BPromise['reject'](_0x4b3f86);}return _0x29b81a[_0xa634('0x25')]();};}function saveUpdates(_0x3b08e3,_0x39d52a){return function(_0x2c90ea){if(_0x2c90ea){return _0x2c90ea[_0xa634('0x26')](_0x3b08e3)[_0xa634('0x27')](function(_0x58c772){return _0x58c772;});}return null;};}function removeEntity(_0x25d89,_0x820ea0){return function(_0x476418){if(_0x476418){return _0x476418[_0xa634('0x28')]()[_0xa634('0x27')](function(){_0x25d89[_0xa634('0x1c')](0xcc)[_0xa634('0x1d')]();});}};}function handleEntityNotFound(_0x440bae,_0x536b69){return function(_0x23a976){if(!_0x23a976){_0x440bae['sendStatus'](0x194);}return _0x23a976;};}function handleError(_0x493b4a,_0x5c4f2a){_0x5c4f2a=_0x5c4f2a||0x1f4;return function(_0x37a04c){logger['error'](_0x37a04c[_0xa634('0x29')]);if(_0x37a04c['name']){delete _0x37a04c[_0xa634('0x2a')];}_0x493b4a[_0xa634('0x1c')](_0x5c4f2a)[_0xa634('0x2b')](_0x37a04c);};}exports[_0xa634('0x2c')]=function(_0x53a6ac,_0x289dc8){var _0x7c6195={},_0x1f773e={},_0x131fef={'count':0x0,'rows':[]};var _0x374518=_[_0xa634('0x2d')](db[_0xa634('0x2e')][_0xa634('0x2f')],function(_0x387fab){return{'name':_0x387fab[_0xa634('0x30')],'type':_0x387fab['type'][_0xa634('0x31')]};});_0x1f773e[_0xa634('0x32')]=_[_0xa634('0x2d')](_0x374518,_0xa634('0x2a'));_0x1f773e[_0xa634('0x33')]=_['keys'](_0x53a6ac['query']);_0x1f773e[_0xa634('0x34')]=_[_0xa634('0x35')](_0x1f773e['model'],_0x1f773e[_0xa634('0x33')]);_0x7c6195[_0xa634('0x36')]=_['intersection'](_0x1f773e[_0xa634('0x32')],qs['fields'](_0x53a6ac[_0xa634('0x33')][_0xa634('0x37')]));_0x7c6195[_0xa634('0x36')]=_0x7c6195['attributes'][_0xa634('0x38')]?_0x7c6195['attributes']:_0x1f773e['model'];if(!_0x53a6ac['query'][_0xa634('0x39')]('nolimit')){_0x7c6195[_0xa634('0x20')]=qs['limit'](_0x53a6ac['query'][_0xa634('0x20')]);_0x7c6195[_0xa634('0x1e')]=qs[_0xa634('0x1e')](_0x53a6ac[_0xa634('0x33')][_0xa634('0x1e')]);}_0x7c6195[_0xa634('0x3a')]=qs['sort'](_0x53a6ac[_0xa634('0x33')][_0xa634('0x3b')]);_0x7c6195[_0xa634('0x3c')]=qs[_0xa634('0x34')](_[_0xa634('0x3d')](_0x53a6ac[_0xa634('0x33')],_0x1f773e[_0xa634('0x34')]),_0x374518);if(_0x53a6ac[_0xa634('0x33')][_0xa634('0x3e')]){_0x7c6195[_0xa634('0x3c')]=_['merge'](_0x7c6195['where'],{'$or':_[_0xa634('0x2d')](_0x374518,function(_0x4173ed){if(_0x4173ed[_0xa634('0x3f')]!==_0xa634('0x40')){var _0x5e7909={};_0x5e7909[_0x4173ed['name']]={'$like':'%'+_0x53a6ac[_0xa634('0x33')][_0xa634('0x3e')]+'%'};return _0x5e7909;}})});}_0x7c6195=_[_0xa634('0x41')]({},_0x7c6195,_0x53a6ac[_0xa634('0x42')]);var _0x3d1fc0={'where':_0x7c6195['where']};return db[_0xa634('0x2e')][_0xa634('0x43')](_0x3d1fc0)[_0xa634('0x27')](function(_0x2425eb){_0x131fef[_0xa634('0x43')]=_0x2425eb;if(_0x53a6ac[_0xa634('0x33')][_0xa634('0x44')]){_0x7c6195[_0xa634('0x45')]=[{'all':!![]}];}return db[_0xa634('0x2e')][_0xa634('0x46')](_0x7c6195);})[_0xa634('0x27')](function(_0x3adb18){_0x131fef[_0xa634('0x47')]=_0x3adb18;return _0x131fef;})['then'](respondWithFilteredResult(_0x289dc8,_0x7c6195))['catch'](handleError(_0x289dc8,null));};exports[_0xa634('0x48')]=function(_0x38dc7b,_0x36032f){var _0x119d66={'raw':!![],'where':{'id':_0x38dc7b[_0xa634('0x49')]['id']}},_0x1d7771={};_0x1d7771['model']=_[_0xa634('0x4a')](db[_0xa634('0x2e')][_0xa634('0x2f')]);_0x1d7771[_0xa634('0x33')]=_['keys'](_0x38dc7b['query']);_0x1d7771[_0xa634('0x34')]=_[_0xa634('0x35')](_0x1d7771[_0xa634('0x32')],_0x1d7771[_0xa634('0x33')]);_0x119d66[_0xa634('0x36')]=_[_0xa634('0x35')](_0x1d7771[_0xa634('0x32')],qs['fields'](_0x38dc7b[_0xa634('0x33')]['fields']));_0x119d66['attributes']=_0x119d66[_0xa634('0x36')][_0xa634('0x38')]?_0x119d66[_0xa634('0x36')]:_0x1d7771[_0xa634('0x32')];if(_0x38dc7b[_0xa634('0x33')]['includeAll']){_0x119d66['include']=[{'all':!![]}];}_0x119d66=_[_0xa634('0x41')]({},_0x119d66,_0x38dc7b[_0xa634('0x42')]);return db[_0xa634('0x2e')][_0xa634('0x4b')](_0x119d66)[_0xa634('0x27')](handleEntityNotFound(_0x36032f,null))[_0xa634('0x27')](respondWithResult(_0x36032f,null))[_0xa634('0x4c')](handleError(_0x36032f,null));};exports[_0xa634('0x4d')]=function(_0x117779,_0x35085c){return db[_0xa634('0x2e')][_0xa634('0x4d')](_0x117779['body'],{})[_0xa634('0x27')](respondWithResult(_0x35085c,0xc9))[_0xa634('0x4c')](handleError(_0x35085c,null));};exports[_0xa634('0x26')]=function(_0x3080c1,_0x15b351){if(_0x3080c1[_0xa634('0x4e')]['id']){delete _0x3080c1[_0xa634('0x4e')]['id'];}return db[_0xa634('0x2e')][_0xa634('0x4b')]({'where':{'id':_0x3080c1[_0xa634('0x49')]['id']}})[_0xa634('0x27')](handleEntityNotFound(_0x15b351,null))[_0xa634('0x27')](saveUpdates(_0x3080c1[_0xa634('0x4e')],null))[_0xa634('0x27')](respondWithResult(_0x15b351,null))['catch'](handleError(_0x15b351,null));};exports[_0xa634('0x28')]=function(_0x1e1fc5,_0x58deeb){return db[_0xa634('0x2e')][_0xa634('0x4b')]({'where':{'id':_0x1e1fc5[_0xa634('0x49')]['id']}})[_0xa634('0x27')](handleEntityNotFound(_0x58deeb,null))[_0xa634('0x27')](removeEntity(_0x58deeb,null))[_0xa634('0x4c')](handleError(_0x58deeb,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index bf747a6..2837004 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 _0xe27c=['lodash','../../config/logger','moment','request-promise','rimraf','exports','FreshdeskField','FieldId'];(function(_0x12f53f,_0x1c8f6d){var _0x710bd6=function(_0x4c35c3){while(--_0x4c35c3){_0x12f53f['push'](_0x12f53f['shift']());}};_0x710bd6(++_0x1c8f6d);}(_0xe27c,0x138));var _0xce27=function(_0x4a8512,_0x4594c2){_0x4a8512=_0x4a8512-0x0;var _0x21d5a6=_0xe27c[_0x4a8512];return _0x21d5a6;};'use strict';var _=require(_0xce27('0x0'));var util=require('util');var logger=require(_0xce27('0x1'))('api');var moment=require(_0xce27('0x2'));var BPromise=require('bluebird');var rp=require(_0xce27('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce27('0x4'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0xce27('0x5')]=function(_0x5b47ab,_0x4cdfd9){return _0x5b47ab['define'](_0xce27('0x6'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0xce27('0x7')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7976=['define','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','api','moment','bluebird','request-promise','path','./intFreshdeskField.attributes'];(function(_0x190c49,_0x103457){var _0x475b9a=function(_0x44f13c){while(--_0x44f13c){_0x190c49['push'](_0x190c49['shift']());}};_0x475b9a(++_0x103457);}(_0x7976,0x130));var _0x6797=function(_0x4c4042,_0x1ea485){_0x4c4042=_0x4c4042-0x0;var _0xbd10dc=_0x7976[_0x4c4042];return _0xbd10dc;};'use strict';var _=require(_0x6797('0x0'));var util=require(_0x6797('0x1'));var logger=require('../../config/logger')(_0x6797('0x2'));var moment=require(_0x6797('0x3'));var BPromise=require(_0x6797('0x4'));var rp=require(_0x6797('0x5'));var fs=require('fs');var path=require(_0x6797('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6797('0x7'));module['exports']=function(_0x37929e,_0x29c364){return _0x37929e[_0x6797('0x8')]('FreshdeskField',attributes,{'tableName':_0x6797('0x9'),'paranoid':![],'indexes':[{'name':_0x6797('0xa'),'fields':['idField',_0x6797('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index f8963aa..1a3b1f1 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 _0x7a54=['info','FreshdeskField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x349339,_0x32392e){_0x349339=_0x349339-0x0;var _0x5356ec=_0x7a54[_0x349339];return _0x5356ec;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _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(_0x58353a,_0x122d0a){var _0x211712=function(_0x1fa816){while(--_0x1fa816){_0x58353a['push'](_0x58353a['shift']());}};_0x211712(++_0x122d0a);}(_0xb10b,0x12a));var _0xbb10=function(_0x5013f2,_0x3d896b){_0x5013f2=_0x5013f2-0x0;var _0x166b9f=_0xb10b[_0x5013f2];return _0x166b9f;};'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 74d85d3..89830f2 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 _0x7908=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','post','create'];(function(_0x3494d5,_0x240e41){var _0x3c9ba8=function(_0x595aee){while(--_0x595aee){_0x3494d5['push'](_0x3494d5['shift']());}};_0x3c9ba8(++_0x240e41);}(_0x7908,0x138));var _0x8790=function(_0x2f10f6,_0xc9c8e6){_0x2f10f6=_0x2f10f6-0x0;var _0x175576=_0x7908[_0x2f10f6];return _0x175576;};'use strict';var multer=require(_0x8790('0x0'));var util=require(_0x8790('0x1'));var path=require(_0x8790('0x2'));var timeout=require(_0x8790('0x3'));var express=require('express');var router=express[_0x8790('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8790('0x5'));var interaction=require(_0x8790('0x6'));var config=require(_0x8790('0x7'));var controller=require(_0x8790('0x8'));router[_0x8790('0x9')]('/',auth[_0x8790('0xa')](),controller[_0x8790('0xb')]);router[_0x8790('0x9')](_0x8790('0xc'),auth[_0x8790('0xa')](),controller[_0x8790('0xd')]);router[_0x8790('0x9')](_0x8790('0xe'),auth[_0x8790('0xa')](),controller[_0x8790('0xf')]);router['get']('/:id/fields',auth[_0x8790('0xa')](),controller['getFields']);router[_0x8790('0x10')]('/',auth[_0x8790('0xa')](),controller[_0x8790('0x11')]);router['post'](_0x8790('0xe'),auth[_0x8790('0xa')](),controller['addConfiguration']);router['put']('/:id',auth[_0x8790('0xa')](),controller[_0x8790('0x12')]);router[_0x8790('0x13')](_0x8790('0xc'),auth[_0x8790('0xa')](),controller[_0x8790('0x14')]);module[_0x8790('0x15')]=router; \ No newline at end of file +var _0xffaa=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xffaa,0xe1));var _0xaffa=function(_0x6b0034,_0x5af041){_0x6b0034=_0x6b0034-0x0;var _0x5eda66=_0xffaa[_0x6b0034];return _0x5eda66;};'use strict';var multer=require('multer');var util=require(_0xaffa('0x0'));var path=require(_0xaffa('0x1'));var timeout=require(_0xaffa('0x2'));var express=require(_0xaffa('0x3'));var router=express[_0xaffa('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaffa('0x5'));var controller=require('./intFreshsalesAccount.controller');router[_0xaffa('0x6')]('/',auth[_0xaffa('0x7')](),controller[_0xaffa('0x8')]);router['get'](_0xaffa('0x9'),auth['isAuthenticated'](),controller[_0xaffa('0xa')]);router[_0xaffa('0x6')](_0xaffa('0xb'),auth[_0xaffa('0x7')](),controller[_0xaffa('0xc')]);router['get']('/:id/fields',auth[_0xaffa('0x7')](),controller[_0xaffa('0xd')]);router['post']('/',auth[_0xaffa('0x7')](),controller[_0xaffa('0xe')]);router[_0xaffa('0xf')]('/:id/configurations',auth[_0xaffa('0x7')](),controller[_0xaffa('0x10')]);router[_0xaffa('0x11')]('/:id',auth[_0xaffa('0x7')](),controller['update']);router[_0xaffa('0x12')](_0xaffa('0x9'),auth['isAuthenticated'](),controller[_0xaffa('0x13')]);module[_0xaffa('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index fd036ac..261f0d7 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 _0xdb1d=['exports','STRING','remoteUri','sequelize'];(function(_0x41a25e,_0x3bc4e3){var _0x1a3383=function(_0x322a0c){while(--_0x322a0c){_0x41a25e['push'](_0x41a25e['shift']());}};_0x1a3383(++_0x3bc4e3);}(_0xdb1d,0x183));var _0xddb1=function(_0x4044bd,_0x390ebf){_0x4044bd=_0x4044bd-0x0;var _0x46f00f=_0xdb1d[_0x4044bd];return _0x46f00f;};'use strict';var Sequelize=require(_0xddb1('0x0'));module[_0xddb1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xddb1('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xddb1('0x2')]},'remoteUri':{'type':Sequelize[_0xddb1('0x2')],'unique':_0xddb1('0x3')},'serverUrl':{'type':Sequelize[_0xddb1('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc98a=['sequelize','exports','STRING','username'];(function(_0xfdb14f,_0x49d076){var _0x37daa7=function(_0xcb88e9){while(--_0xcb88e9){_0xfdb14f['push'](_0xfdb14f['shift']());}};_0x37daa7(++_0x49d076);}(_0xc98a,0x1a8));var _0xac98=function(_0x28e3e7,_0x9a1649){_0x28e3e7=_0x28e3e7-0x0;var _0x44d59d=_0xc98a[_0x28e3e7];return _0x44d59d;};'use strict';var Sequelize=require(_0xac98('0x0'));module[_0xac98('0x1')]={'name':{'type':Sequelize[_0xac98('0x2')]},'description':{'type':Sequelize[_0xac98('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xac98('0x3')},'apiKey':{'type':Sequelize[_0xac98('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xac98('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index aec316f..81c2cec 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 _0xe7de=['update','getConfigurations','where','hasOwnProperty','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','getFields','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','apiKey','users','email','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','name','send','index','map','FreshsalesAccount','rawAttributes','type','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','pick','filter','merge','options','include','findAll','rows','show','params','intersection','find','create','body'];(function(_0x26b0ae,_0x37ec6a){var _0x28a55b=function(_0xcbfe02){while(--_0xcbfe02){_0x26b0ae['push'](_0x26b0ae['shift']());}};_0x28a55b(++_0x37ec6a);}(_0xe7de,0x165));var _0xee7d=function(_0x4ad48a,_0x309ddd){_0x4ad48a=_0x4ad48a-0x0;var _0xb011e5=_0xe7de[_0x4ad48a];return _0xb011e5;};'use strict';var emlformat=require(_0xee7d('0x0'));var rimraf=require(_0xee7d('0x1'));var zipdir=require(_0xee7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xee7d('0x3'));var BPromise=require(_0xee7d('0x4'));var Mustache=require(_0xee7d('0x5'));var util=require(_0xee7d('0x6'));var path=require(_0xee7d('0x7'));var sox=require(_0xee7d('0x8'));var csv=require(_0xee7d('0x9'));var ejs=require(_0xee7d('0xa'));var fs=require('fs');var fs_extra=require(_0xee7d('0xb'));var _=require(_0xee7d('0xc'));var squel=require(_0xee7d('0xd'));var crypto=require(_0xee7d('0xe'));var jsforce=require(_0xee7d('0xf'));var deskjs=require(_0xee7d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xee7d('0x11'));var Papa=require(_0xee7d('0x12'));var Redis=require(_0xee7d('0x13'));var authService=require(_0xee7d('0x14'));var qs=require(_0xee7d('0x15'));var as=require(_0xee7d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee7d('0x17'))('api');var utils=require(_0xee7d('0x18'));var config=require(_0xee7d('0x19'));var licenseUtil=require(_0xee7d('0x1a'));var db=require(_0xee7d('0x1b'))['db'];var integrations=require(_0xee7d('0x1c'));var jayson=require(_0xee7d('0x1d'));var client=jayson[_0xee7d('0x1e')][_0xee7d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x733352,_0x3a3ddd,_0x41ca24,_0x47eb16){return new BPromise(function(_0x4bfdab,_0x2f1184){var _0x1e9ea0=_0x47eb16||client;return _0x1e9ea0[_0xee7d('0x20')](_0x733352,_0x41ca24)[_0xee7d('0x21')](function(_0x1a2976){logger[_0xee7d('0x22')]('FreshsalesAccount,\x20%s,\x20%s',_0x3a3ddd,_0xee7d('0x23'));logger[_0xee7d('0x24')](_0xee7d('0x25'),_0x3a3ddd,_0xee7d('0x23'),JSON[_0xee7d('0x26')](_0x1a2976));if(_0x1a2976[_0xee7d('0x27')]){if(_0x1a2976['error'][_0xee7d('0x28')]===0x1f4){logger[_0xee7d('0x27')](_0xee7d('0x29'),_0x3a3ddd,_0x1a2976['error'][_0xee7d('0x2a')]);return _0x2f1184(_0x1a2976['error'][_0xee7d('0x2a')]);}logger[_0xee7d('0x27')](_0xee7d('0x29'),_0x3a3ddd,_0x1a2976['error'][_0xee7d('0x2a')]);return _0x4bfdab(_0x1a2976['error'][_0xee7d('0x2a')]);}else{logger[_0xee7d('0x22')](_0xee7d('0x29'),_0x3a3ddd,_0xee7d('0x23'));_0x4bfdab(_0x1a2976['result'][_0xee7d('0x2a')]);}})[_0xee7d('0x2b')](function(_0x222ffc){logger[_0xee7d('0x27')](_0xee7d('0x29'),_0x3a3ddd,_0x222ffc);_0x2f1184(_0x222ffc);});});}function respondWithStatusCode(_0x4d0efb,_0x172850){_0x172850=_0x172850||0xcc;return function(_0x34af16){if(_0x34af16){return _0x4d0efb[_0xee7d('0x2c')](_0x172850);}return _0x4d0efb['status'](_0x172850)[_0xee7d('0x2d')]();};}function respondWithResult(_0x293382,_0x379de9){_0x379de9=_0x379de9||0xc8;return function(_0x576d56){if(_0x576d56){return _0x293382[_0xee7d('0x2e')](_0x379de9)[_0xee7d('0x2f')](_0x576d56);}};}function respondWithFilteredResult(_0x4532cb,_0x2b9482){return function(_0x2e2264){if(_0x2e2264){var _0x1b4492=typeof _0x2b9482[_0xee7d('0x30')]===_0xee7d('0x31')&&typeof _0x2b9482[_0xee7d('0x32')]==='undefined';var _0x440bc4=_0x2e2264['count'];var _0x5ca947=_0x1b4492?0x0:_0x2b9482[_0xee7d('0x30')];var _0x4d4ff0=_0x1b4492?_0x2e2264[_0xee7d('0x33')]:_0x2b9482[_0xee7d('0x30')]+_0x2b9482['limit'];var _0x6b6174;if(_0x4d4ff0>=_0x440bc4){_0x4d4ff0=_0x440bc4;_0x6b6174=0xc8;}else{_0x6b6174=0xce;}_0x4532cb[_0xee7d('0x2e')](_0x6b6174);return _0x4532cb[_0xee7d('0x34')](_0xee7d('0x35'),_0x5ca947+'-'+_0x4d4ff0+'/'+_0x440bc4)[_0xee7d('0x2f')](_0x2e2264);}return null;};}function patchUpdates(_0x4c7401){return function(_0x382630){try{jsonpatch[_0xee7d('0x36')](_0x382630,_0x4c7401,!![]);}catch(_0x2b37f4){return BPromise[_0xee7d('0x37')](_0x2b37f4);}return _0x382630[_0xee7d('0x38')]();};}function saveUpdates(_0x6405b4,_0x14d60c){return function(_0x2d3700){if(_0x2d3700){return _0x2d3700['update'](_0x6405b4)[_0xee7d('0x21')](function(_0x3ad5c6){return _0x3ad5c6;});}return null;};}function removeEntity(_0xccf52c,_0x58fe68){return function(_0x2dab1e){if(_0x2dab1e){return _0x2dab1e['destroy']()[_0xee7d('0x21')](function(){_0xccf52c[_0xee7d('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a6d69,_0xbc7eb1){return function(_0x5371b7){if(!_0x5371b7){_0x5a6d69[_0xee7d('0x2c')](0x194);}return _0x5371b7;};}function handleError(_0x2564a8,_0xd31202){_0xd31202=_0xd31202||0x1f4;return function(_0x25f960){logger[_0xee7d('0x27')](_0x25f960['stack']);if(_0x25f960['name']){delete _0x25f960[_0xee7d('0x39')];}_0x2564a8['status'](_0xd31202)[_0xee7d('0x3a')](_0x25f960);};}exports[_0xee7d('0x3b')]=function(_0x29268e,_0x1decf2){var _0xf7ed45={},_0x36a554={},_0xa190f1={'count':0x0,'rows':[]};var _0x3d0f1f=_[_0xee7d('0x3c')](db[_0xee7d('0x3d')][_0xee7d('0x3e')],function(_0x4095f7){return{'name':_0x4095f7['fieldName'],'type':_0x4095f7[_0xee7d('0x3f')]['key']};});_0x36a554[_0xee7d('0x40')]=_[_0xee7d('0x3c')](_0x3d0f1f,_0xee7d('0x39'));_0x36a554['query']=_[_0xee7d('0x41')](_0x29268e[_0xee7d('0x42')]);_0x36a554[_0xee7d('0x43')]=_['intersection'](_0x36a554[_0xee7d('0x40')],_0x36a554['query']);_0xf7ed45[_0xee7d('0x44')]=_['intersection'](_0x36a554['model'],qs[_0xee7d('0x45')](_0x29268e[_0xee7d('0x42')][_0xee7d('0x45')]));_0xf7ed45[_0xee7d('0x44')]=_0xf7ed45['attributes'][_0xee7d('0x46')]?_0xf7ed45['attributes']:_0x36a554['model'];if(!_0x29268e[_0xee7d('0x42')]['hasOwnProperty'](_0xee7d('0x47'))){_0xf7ed45['limit']=qs[_0xee7d('0x32')](_0x29268e[_0xee7d('0x42')][_0xee7d('0x32')]);_0xf7ed45[_0xee7d('0x30')]=qs['offset'](_0x29268e[_0xee7d('0x42')][_0xee7d('0x30')]);}_0xf7ed45[_0xee7d('0x48')]=qs[_0xee7d('0x49')](_0x29268e[_0xee7d('0x42')][_0xee7d('0x49')]);_0xf7ed45['where']=qs[_0xee7d('0x43')](_[_0xee7d('0x4a')](_0x29268e[_0xee7d('0x42')],_0x36a554[_0xee7d('0x43')]),_0x3d0f1f);if(_0x29268e['query'][_0xee7d('0x4b')]){_0xf7ed45['where']=_[_0xee7d('0x4c')](_0xf7ed45['where'],{'$or':_[_0xee7d('0x3c')](_0x3d0f1f,function(_0x8da1bb){if(_0x8da1bb[_0xee7d('0x3f')]!=='VIRTUAL'){var _0x39a069={};_0x39a069[_0x8da1bb['name']]={'$like':'%'+_0x29268e[_0xee7d('0x42')]['filter']+'%'};return _0x39a069;}})});}_0xf7ed45=_[_0xee7d('0x4c')]({},_0xf7ed45,_0x29268e[_0xee7d('0x4d')]);var _0x7b6d8d={'where':_0xf7ed45['where']};return db[_0xee7d('0x3d')][_0xee7d('0x33')](_0x7b6d8d)['then'](function(_0x5895a6){_0xa190f1[_0xee7d('0x33')]=_0x5895a6;if(_0x29268e[_0xee7d('0x42')]['includeAll']){_0xf7ed45[_0xee7d('0x4e')]=[{'all':!![]}];}return db[_0xee7d('0x3d')][_0xee7d('0x4f')](_0xf7ed45);})['then'](function(_0x58cbfe){_0xa190f1[_0xee7d('0x50')]=_0x58cbfe;return _0xa190f1;})[_0xee7d('0x21')](respondWithFilteredResult(_0x1decf2,_0xf7ed45))[_0xee7d('0x2b')](handleError(_0x1decf2,null));};exports[_0xee7d('0x51')]=function(_0x1920bb,_0xd13c3a){var _0x486cfc={'raw':![],'where':{'id':_0x1920bb[_0xee7d('0x52')]['id']}},_0x2306e9={};_0x2306e9[_0xee7d('0x40')]=_[_0xee7d('0x41')](db[_0xee7d('0x3d')][_0xee7d('0x3e')]);_0x2306e9[_0xee7d('0x42')]=_[_0xee7d('0x41')](_0x1920bb[_0xee7d('0x42')]);_0x2306e9[_0xee7d('0x43')]=_['intersection'](_0x2306e9['model'],_0x2306e9[_0xee7d('0x42')]);_0x486cfc[_0xee7d('0x44')]=_[_0xee7d('0x53')](_0x2306e9[_0xee7d('0x40')],qs[_0xee7d('0x45')](_0x1920bb[_0xee7d('0x42')][_0xee7d('0x45')]));_0x486cfc['attributes']=_0x486cfc[_0xee7d('0x44')]['length']?_0x486cfc[_0xee7d('0x44')]:_0x2306e9[_0xee7d('0x40')];if(_0x1920bb['query']['includeAll']){_0x486cfc['include']=[{'all':!![]}];}_0x486cfc=_[_0xee7d('0x4c')]({},_0x486cfc,_0x1920bb[_0xee7d('0x4d')]);return db[_0xee7d('0x3d')][_0xee7d('0x54')](_0x486cfc)[_0xee7d('0x21')](handleEntityNotFound(_0xd13c3a,null))['then'](respondWithResult(_0xd13c3a,null))[_0xee7d('0x2b')](handleError(_0xd13c3a,null));};exports[_0xee7d('0x55')]=function(_0x1dd159,_0x244db8){return db[_0xee7d('0x3d')][_0xee7d('0x55')](_0x1dd159[_0xee7d('0x56')],{})[_0xee7d('0x21')](respondWithResult(_0x244db8,0xc9))['catch'](handleError(_0x244db8,null));};exports[_0xee7d('0x57')]=function(_0x36881b,_0x1bc239){if(_0x36881b[_0xee7d('0x56')]['id']){delete _0x36881b[_0xee7d('0x56')]['id'];}return db['FreshsalesAccount'][_0xee7d('0x54')]({'where':{'id':_0x36881b['params']['id']}})['then'](handleEntityNotFound(_0x1bc239,null))[_0xee7d('0x21')](saveUpdates(_0x36881b['body'],null))[_0xee7d('0x21')](respondWithResult(_0x1bc239,null))[_0xee7d('0x2b')](handleError(_0x1bc239,null));};exports['destroy']=function(_0x526c95,_0x5b2695){return db[_0xee7d('0x3d')][_0xee7d('0x54')]({'where':{'id':_0x526c95[_0xee7d('0x52')]['id']}})[_0xee7d('0x21')](handleEntityNotFound(_0x5b2695,null))[_0xee7d('0x21')](removeEntity(_0x5b2695,null))['catch'](handleError(_0x5b2695,null));};exports[_0xee7d('0x58')]=function(_0x256b46,_0x384de4,_0x434ddb){var _0x1cdc47={};var _0x35d1a8={};var _0x4e349e;var _0x52c8f1;return db[_0xee7d('0x3d')]['findOne']({'where':{'id':_0x256b46[_0xee7d('0x52')]['id']}})[_0xee7d('0x21')](handleEntityNotFound(_0x384de4,null))[_0xee7d('0x21')](function(_0xa92874){if(_0xa92874){_0x4e349e=_0xa92874;_0x35d1a8['model']=_['keys'](db['FreshsalesConfiguration'][_0xee7d('0x3e')]);_0x35d1a8[_0xee7d('0x42')]=_[_0xee7d('0x41')](_0x256b46[_0xee7d('0x42')]);_0x35d1a8['filters']=_[_0xee7d('0x53')](_0x35d1a8['model'],_0x35d1a8[_0xee7d('0x42')]);_0x1cdc47[_0xee7d('0x44')]=_[_0xee7d('0x53')](_0x35d1a8[_0xee7d('0x40')],qs[_0xee7d('0x45')](_0x256b46[_0xee7d('0x42')][_0xee7d('0x45')]));_0x1cdc47[_0xee7d('0x44')]=_0x1cdc47[_0xee7d('0x44')][_0xee7d('0x46')]?_0x1cdc47[_0xee7d('0x44')]:_0x35d1a8[_0xee7d('0x40')];_0x1cdc47['order']=qs[_0xee7d('0x49')](_0x256b46[_0xee7d('0x42')][_0xee7d('0x49')]);_0x1cdc47[_0xee7d('0x59')]=qs[_0xee7d('0x43')](_[_0xee7d('0x4a')](_0x256b46[_0xee7d('0x42')],_0x35d1a8['filters']));if(_0x256b46[_0xee7d('0x42')][_0xee7d('0x4b')]){_0x1cdc47['where']=_[_0xee7d('0x4c')](_0x1cdc47[_0xee7d('0x59')],{'$or':_[_0xee7d('0x3c')](_0x1cdc47[_0xee7d('0x44')],function(_0xfc5f96){var _0x37197f={};_0x37197f[_0xfc5f96]={'$like':'%'+_0x256b46[_0xee7d('0x42')][_0xee7d('0x4b')]+'%'};return _0x37197f;})});}_0x1cdc47=_['merge']({},_0x1cdc47,_0x256b46['options']);return _0x4e349e[_0xee7d('0x58')](_0x1cdc47);}})[_0xee7d('0x21')](function(_0x19b8b8){if(_0x19b8b8){_0x52c8f1=_0x19b8b8[_0xee7d('0x46')];if(!_0x256b46[_0xee7d('0x42')][_0xee7d('0x5a')]('nolimit')){_0x1cdc47[_0xee7d('0x32')]=qs[_0xee7d('0x32')](_0x256b46[_0xee7d('0x42')][_0xee7d('0x32')]);_0x1cdc47['offset']=qs['offset'](_0x256b46[_0xee7d('0x42')][_0xee7d('0x30')]);}return _0x4e349e[_0xee7d('0x58')](_0x1cdc47);}})[_0xee7d('0x21')](function(_0x4c2390){if(_0x4c2390){return _0x4c2390?{'count':_0x52c8f1,'rows':_0x4c2390}:null;}})['then'](respondWithResult(_0x384de4,null))[_0xee7d('0x2b')](handleError(_0x384de4,null));};exports['addConfiguration']=function(_0x28c0b7,_0x3d81a7,_0x5ba075){if(_0x28c0b7[_0xee7d('0x56')]['id']){delete _0x28c0b7[_0xee7d('0x56')]['id'];}return db[_0xee7d('0x3d')][_0xee7d('0x5b')]({'where':{'id':_0x28c0b7[_0xee7d('0x52')]['id']}})[_0xee7d('0x21')](handleEntityNotFound(_0x3d81a7,null))[_0xee7d('0x21')](function(_0x585d7b){if(_0x585d7b){_0x28c0b7[_0xee7d('0x56')][_0xee7d('0x5c')]=_0x585d7b['id'];_0x28c0b7['body'][_0xee7d('0x5d')]=integrations['getSubjects'](_0x28c0b7['body']['channel'],_0x28c0b7['body'][_0xee7d('0x3f')]);_0x28c0b7[_0xee7d('0x56')][_0xee7d('0x5e')]=integrations[_0xee7d('0x5f')](_0x28c0b7[_0xee7d('0x56')][_0xee7d('0x60')],_0x28c0b7[_0xee7d('0x56')][_0xee7d('0x3f')]);return db['FreshsalesConfiguration']['create'](_0x28c0b7['body'],{'include':[{'model':db['FreshsalesField'],'as':_0xee7d('0x5d')},{'model':db['FreshsalesField'],'as':_0xee7d('0x5e')}]});}return null;})[_0xee7d('0x21')](respondWithResult(_0x3d81a7,null))['catch'](handleError(_0x3d81a7,null));};exports[_0xee7d('0x61')]=function(_0xd828cc,_0x33b598,_0x3d520a){var _0x382263='';var _0x293bd2='';return db['FreshsalesAccount'][_0xee7d('0x5b')]({'where':{'id':_0xd828cc[_0xee7d('0x52')]['id']},'attributes':['id','username',_0xee7d('0x62'),'apiKey']})[_0xee7d('0x21')](handleEntityNotFound(_0x33b598,null))[_0xee7d('0x21')](function(_0xd9ae4d){if(_0xd9ae4d){_0x293bd2=_0xd9ae4d['username'];_0x382263=_0xd9ae4d['remoteUri'];var _0x25ccab=_0xd9ae4d[_0xee7d('0x62')][_0xee7d('0x63')](-0x1);if(_0x25ccab==='/'){_0x382263=_0x382263[_0xee7d('0x64')](0x0,_0x382263[_0xee7d('0x65')](_0x25ccab));}return rp({'method':_0xee7d('0x66'),'uri':util[_0xee7d('0x67')](_0xee7d('0x68'),_0x382263,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0xd9ae4d[_0xee7d('0x69')]},'json':!![]});}})[_0xee7d('0x21')](function(_0x1fc49f){if(_0x1fc49f){var _0x1c6269=_0x1fc49f[_0xee7d('0x6a')];var _0x47806f=![];var _0x184384=null;for(_0x184384=0x0;_0x184384<_0x1c6269[_0xee7d('0x46')];_0x184384++){if(_0x1c6269[_0x184384][_0xee7d('0x6b')]===_0x293bd2){_0x47806f=!![];}}if(_0x47806f){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x33b598,null))[_0xee7d('0x2b')](function(_0x6c2149){var _0x1b6ac8=_0xd828cc[_0xee7d('0x42')][_0xee7d('0x6c')]?0x1f4:_0x6c2149[_0xee7d('0x6d')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xee7d('0x61'),_0x1b6ac8,JSON[_0xee7d('0x26')](_0x6c2149));delete _0x6c2149[_0xee7d('0x39')];if(_0x1b6ac8===0x191){_0x1b6ac8=0x190;}_0x33b598[_0xee7d('0x2e')](_0x1b6ac8)['send'](_0xd828cc[_0xee7d('0x42')][_0xee7d('0x6c')]?{'message':_0xee7d('0x6e'),'statusCode':_0x6c2149[_0xee7d('0x6d')]}:_0x6c2149);});}; \ No newline at end of file +var _0xd45e=['where','merge','VIRTUAL','include','rows','params','fields','includeAll','options','catch','body','find','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','create','FreshsalesField','getFields','apiKey','username','remoteUri','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','status','sendStatus','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter'];(function(_0x1f2f37,_0x1e8c70){var _0x508364=function(_0x3e49e2){while(--_0x3e49e2){_0x1f2f37['push'](_0x1f2f37['shift']());}};_0x508364(++_0x1e8c70);}(_0xd45e,0x182));var _0xed45=function(_0x57bea8,_0x4bd16c){_0x57bea8=_0x57bea8-0x0;var _0x103037=_0xd45e[_0x57bea8];return _0x103037;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed45('0x0'));var zipdir=require(_0xed45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed45('0x2'));var moment=require('moment');var BPromise=require(_0xed45('0x3'));var Mustache=require(_0xed45('0x4'));var util=require(_0xed45('0x5'));var path=require('path');var sox=require(_0xed45('0x6'));var csv=require(_0xed45('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed45('0x8'));var squel=require(_0xed45('0x9'));var crypto=require('crypto');var jsforce=require(_0xed45('0xa'));var deskjs=require(_0xed45('0xb'));var toCsv=require(_0xed45('0x7'));var querystring=require(_0xed45('0xc'));var Papa=require(_0xed45('0xd'));var Redis=require(_0xed45('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xed45('0xf'));var as=require(_0xed45('0x10'));var hardwareService=require(_0xed45('0x11'));var logger=require(_0xed45('0x12'))(_0xed45('0x13'));var utils=require(_0xed45('0x14'));var config=require(_0xed45('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xed45('0x16'))['db'];var integrations=require(_0xed45('0x17'));var jayson=require(_0xed45('0x18'));var client=jayson[_0xed45('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f35ef,_0x5e7767,_0xba7783,_0x2156a8){return new BPromise(function(_0xd6dcbb,_0x112873){var _0x531e22=_0x2156a8||client;return _0x531e22[_0xed45('0x1a')](_0x3f35ef,_0xba7783)[_0xed45('0x1b')](function(_0xcd3247){logger['info'](_0xed45('0x1c'),_0x5e7767,'request\x20sent');logger[_0xed45('0x1d')](_0xed45('0x1e'),_0x5e7767,_0xed45('0x1f'),JSON[_0xed45('0x20')](_0xcd3247));if(_0xcd3247['error']){if(_0xcd3247[_0xed45('0x21')]['code']===0x1f4){logger['error'](_0xed45('0x1c'),_0x5e7767,_0xcd3247[_0xed45('0x21')][_0xed45('0x22')]);return _0x112873(_0xcd3247['error']['message']);}logger[_0xed45('0x21')](_0xed45('0x1c'),_0x5e7767,_0xcd3247['error']['message']);return _0xd6dcbb(_0xcd3247[_0xed45('0x21')][_0xed45('0x22')]);}else{logger[_0xed45('0x23')](_0xed45('0x1c'),_0x5e7767,_0xed45('0x1f'));_0xd6dcbb(_0xcd3247[_0xed45('0x24')]['message']);}})['catch'](function(_0x57c103){logger['error'](_0xed45('0x1c'),_0x5e7767,_0x57c103);_0x112873(_0x57c103);});});}function respondWithStatusCode(_0x4238c1,_0x430001){_0x430001=_0x430001||0xcc;return function(_0x1e3180){if(_0x1e3180){return _0x4238c1['sendStatus'](_0x430001);}return _0x4238c1['status'](_0x430001)[_0xed45('0x25')]();};}function respondWithResult(_0x11d537,_0x19eb86){_0x19eb86=_0x19eb86||0xc8;return function(_0x55290d){if(_0x55290d){return _0x11d537['status'](_0x19eb86)[_0xed45('0x26')](_0x55290d);}};}function respondWithFilteredResult(_0x59bfc1,_0x5079a4){return function(_0x5ed657){if(_0x5ed657){var _0xc7dc3f=typeof _0x5079a4['offset']===_0xed45('0x27')&&typeof _0x5079a4[_0xed45('0x28')]===_0xed45('0x27');var _0x427dec=_0x5ed657[_0xed45('0x29')];var _0x400e2d=_0xc7dc3f?0x0:_0x5079a4[_0xed45('0x2a')];var _0x525ebd=_0xc7dc3f?_0x5ed657[_0xed45('0x29')]:_0x5079a4[_0xed45('0x2a')]+_0x5079a4['limit'];var _0x2023e4;if(_0x525ebd>=_0x427dec){_0x525ebd=_0x427dec;_0x2023e4=0xc8;}else{_0x2023e4=0xce;}_0x59bfc1['status'](_0x2023e4);return _0x59bfc1['set'](_0xed45('0x2b'),_0x400e2d+'-'+_0x525ebd+'/'+_0x427dec)[_0xed45('0x26')](_0x5ed657);}return null;};}function patchUpdates(_0x19defe){return function(_0x1ae992){try{jsonpatch[_0xed45('0x2c')](_0x1ae992,_0x19defe,!![]);}catch(_0x4baa1f){return BPromise[_0xed45('0x2d')](_0x4baa1f);}return _0x1ae992[_0xed45('0x2e')]();};}function saveUpdates(_0x581b0d,_0xc1e44f){return function(_0x16a8d4){if(_0x16a8d4){return _0x16a8d4[_0xed45('0x2f')](_0x581b0d)[_0xed45('0x1b')](function(_0x341ade){return _0x341ade;});}return null;};}function removeEntity(_0x1deb41,_0x2844f6){return function(_0x56ef27){if(_0x56ef27){return _0x56ef27[_0xed45('0x30')]()[_0xed45('0x1b')](function(){_0x1deb41[_0xed45('0x31')](0xcc)[_0xed45('0x25')]();});}};}function handleEntityNotFound(_0x31c7c8,_0x5466b7){return function(_0x37e145){if(!_0x37e145){_0x31c7c8[_0xed45('0x32')](0x194);}return _0x37e145;};}function handleError(_0x313102,_0x142caf){_0x142caf=_0x142caf||0x1f4;return function(_0x4a7a24){logger[_0xed45('0x21')](_0x4a7a24[_0xed45('0x33')]);if(_0x4a7a24[_0xed45('0x34')]){delete _0x4a7a24['name'];}_0x313102[_0xed45('0x31')](_0x142caf)[_0xed45('0x35')](_0x4a7a24);};}exports[_0xed45('0x36')]=function(_0x5144cc,_0x44d345){var _0x19117d={},_0x347ccf={},_0x17b54f={'count':0x0,'rows':[]};var _0x369b2c=_[_0xed45('0x37')](db[_0xed45('0x38')][_0xed45('0x39')],function(_0x5c9e7c){return{'name':_0x5c9e7c[_0xed45('0x3a')],'type':_0x5c9e7c[_0xed45('0x3b')][_0xed45('0x3c')]};});_0x347ccf[_0xed45('0x3d')]=_['map'](_0x369b2c,_0xed45('0x34'));_0x347ccf[_0xed45('0x3e')]=_[_0xed45('0x3f')](_0x5144cc[_0xed45('0x3e')]);_0x347ccf['filters']=_[_0xed45('0x40')](_0x347ccf[_0xed45('0x3d')],_0x347ccf[_0xed45('0x3e')]);_0x19117d[_0xed45('0x41')]=_[_0xed45('0x40')](_0x347ccf['model'],qs['fields'](_0x5144cc['query']['fields']));_0x19117d[_0xed45('0x41')]=_0x19117d[_0xed45('0x41')][_0xed45('0x42')]?_0x19117d[_0xed45('0x41')]:_0x347ccf[_0xed45('0x3d')];if(!_0x5144cc[_0xed45('0x3e')][_0xed45('0x43')](_0xed45('0x44'))){_0x19117d[_0xed45('0x28')]=qs['limit'](_0x5144cc[_0xed45('0x3e')][_0xed45('0x28')]);_0x19117d['offset']=qs['offset'](_0x5144cc[_0xed45('0x3e')]['offset']);}_0x19117d[_0xed45('0x45')]=qs[_0xed45('0x46')](_0x5144cc[_0xed45('0x3e')][_0xed45('0x46')]);_0x19117d['where']=qs[_0xed45('0x47')](_[_0xed45('0x48')](_0x5144cc[_0xed45('0x3e')],_0x347ccf['filters']),_0x369b2c);if(_0x5144cc[_0xed45('0x3e')][_0xed45('0x49')]){_0x19117d[_0xed45('0x4a')]=_[_0xed45('0x4b')](_0x19117d[_0xed45('0x4a')],{'$or':_['map'](_0x369b2c,function(_0x484cb6){if(_0x484cb6['type']!==_0xed45('0x4c')){var _0x7d4d3e={};_0x7d4d3e[_0x484cb6['name']]={'$like':'%'+_0x5144cc[_0xed45('0x3e')][_0xed45('0x49')]+'%'};return _0x7d4d3e;}})});}_0x19117d=_[_0xed45('0x4b')]({},_0x19117d,_0x5144cc['options']);var _0x3b5dc3={'where':_0x19117d[_0xed45('0x4a')]};return db[_0xed45('0x38')][_0xed45('0x29')](_0x3b5dc3)[_0xed45('0x1b')](function(_0x10598c){_0x17b54f['count']=_0x10598c;if(_0x5144cc['query']['includeAll']){_0x19117d[_0xed45('0x4d')]=[{'all':!![]}];}return db[_0xed45('0x38')]['findAll'](_0x19117d);})['then'](function(_0x457ea6){_0x17b54f[_0xed45('0x4e')]=_0x457ea6;return _0x17b54f;})['then'](respondWithFilteredResult(_0x44d345,_0x19117d))['catch'](handleError(_0x44d345,null));};exports['show']=function(_0x4e4f4b,_0x3eeefa){var _0x18bf02={'raw':![],'where':{'id':_0x4e4f4b[_0xed45('0x4f')]['id']}},_0x335a9f={};_0x335a9f[_0xed45('0x3d')]=_['keys'](db[_0xed45('0x38')][_0xed45('0x39')]);_0x335a9f['query']=_[_0xed45('0x3f')](_0x4e4f4b[_0xed45('0x3e')]);_0x335a9f[_0xed45('0x47')]=_['intersection'](_0x335a9f[_0xed45('0x3d')],_0x335a9f[_0xed45('0x3e')]);_0x18bf02[_0xed45('0x41')]=_[_0xed45('0x40')](_0x335a9f['model'],qs[_0xed45('0x50')](_0x4e4f4b[_0xed45('0x3e')][_0xed45('0x50')]));_0x18bf02[_0xed45('0x41')]=_0x18bf02[_0xed45('0x41')][_0xed45('0x42')]?_0x18bf02['attributes']:_0x335a9f[_0xed45('0x3d')];if(_0x4e4f4b[_0xed45('0x3e')][_0xed45('0x51')]){_0x18bf02[_0xed45('0x4d')]=[{'all':!![]}];}_0x18bf02=_[_0xed45('0x4b')]({},_0x18bf02,_0x4e4f4b[_0xed45('0x52')]);return db[_0xed45('0x38')]['find'](_0x18bf02)['then'](handleEntityNotFound(_0x3eeefa,null))[_0xed45('0x1b')](respondWithResult(_0x3eeefa,null))[_0xed45('0x53')](handleError(_0x3eeefa,null));};exports['create']=function(_0x40565f,_0x18e206){return db[_0xed45('0x38')]['create'](_0x40565f['body'],{})['then'](respondWithResult(_0x18e206,0xc9))['catch'](handleError(_0x18e206,null));};exports[_0xed45('0x2f')]=function(_0x53baf9,_0x433110){if(_0x53baf9['body']['id']){delete _0x53baf9[_0xed45('0x54')]['id'];}return db[_0xed45('0x38')][_0xed45('0x55')]({'where':{'id':_0x53baf9[_0xed45('0x4f')]['id']}})[_0xed45('0x1b')](handleEntityNotFound(_0x433110,null))['then'](saveUpdates(_0x53baf9[_0xed45('0x54')],null))[_0xed45('0x1b')](respondWithResult(_0x433110,null))[_0xed45('0x53')](handleError(_0x433110,null));};exports[_0xed45('0x30')]=function(_0x12709e,_0x5be251){return db[_0xed45('0x38')]['find']({'where':{'id':_0x12709e['params']['id']}})['then'](handleEntityNotFound(_0x5be251,null))[_0xed45('0x1b')](removeEntity(_0x5be251,null))[_0xed45('0x53')](handleError(_0x5be251,null));};exports['getConfigurations']=function(_0x5be12e,_0x1d5e42,_0x3a912b){var _0x4f3a76={};var _0x5f03cf={};var _0x14303f;var _0x57a0c6;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x5be12e[_0xed45('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1d5e42,null))[_0xed45('0x1b')](function(_0x27dbe5){if(_0x27dbe5){_0x14303f=_0x27dbe5;_0x5f03cf[_0xed45('0x3d')]=_[_0xed45('0x3f')](db['FreshsalesConfiguration'][_0xed45('0x39')]);_0x5f03cf[_0xed45('0x3e')]=_[_0xed45('0x3f')](_0x5be12e[_0xed45('0x3e')]);_0x5f03cf[_0xed45('0x47')]=_[_0xed45('0x40')](_0x5f03cf[_0xed45('0x3d')],_0x5f03cf[_0xed45('0x3e')]);_0x4f3a76[_0xed45('0x41')]=_[_0xed45('0x40')](_0x5f03cf[_0xed45('0x3d')],qs['fields'](_0x5be12e[_0xed45('0x3e')][_0xed45('0x50')]));_0x4f3a76['attributes']=_0x4f3a76[_0xed45('0x41')][_0xed45('0x42')]?_0x4f3a76[_0xed45('0x41')]:_0x5f03cf[_0xed45('0x3d')];_0x4f3a76[_0xed45('0x45')]=qs[_0xed45('0x46')](_0x5be12e['query'][_0xed45('0x46')]);_0x4f3a76['where']=qs[_0xed45('0x47')](_[_0xed45('0x48')](_0x5be12e[_0xed45('0x3e')],_0x5f03cf[_0xed45('0x47')]));if(_0x5be12e[_0xed45('0x3e')]['filter']){_0x4f3a76['where']=_[_0xed45('0x4b')](_0x4f3a76['where'],{'$or':_['map'](_0x4f3a76[_0xed45('0x41')],function(_0x4fbb8e){var _0x1fcc9e={};_0x1fcc9e[_0x4fbb8e]={'$like':'%'+_0x5be12e[_0xed45('0x3e')][_0xed45('0x49')]+'%'};return _0x1fcc9e;})});}_0x4f3a76=_[_0xed45('0x4b')]({},_0x4f3a76,_0x5be12e['options']);return _0x14303f[_0xed45('0x56')](_0x4f3a76);}})['then'](function(_0x146bd1){if(_0x146bd1){_0x57a0c6=_0x146bd1[_0xed45('0x42')];if(!_0x5be12e[_0xed45('0x3e')][_0xed45('0x43')]('nolimit')){_0x4f3a76[_0xed45('0x28')]=qs['limit'](_0x5be12e[_0xed45('0x3e')]['limit']);_0x4f3a76['offset']=qs['offset'](_0x5be12e[_0xed45('0x3e')][_0xed45('0x2a')]);}return _0x14303f[_0xed45('0x56')](_0x4f3a76);}})[_0xed45('0x1b')](function(_0x3c8cc7){if(_0x3c8cc7){return _0x3c8cc7?{'count':_0x57a0c6,'rows':_0x3c8cc7}:null;}})[_0xed45('0x1b')](respondWithResult(_0x1d5e42,null))[_0xed45('0x53')](handleError(_0x1d5e42,null));};exports[_0xed45('0x57')]=function(_0x1cccc5,_0x7c89b6,_0x3e25b6){if(_0x1cccc5[_0xed45('0x54')]['id']){delete _0x1cccc5[_0xed45('0x54')]['id'];}return db[_0xed45('0x38')][_0xed45('0x58')]({'where':{'id':_0x1cccc5[_0xed45('0x4f')]['id']}})[_0xed45('0x1b')](handleEntityNotFound(_0x7c89b6,null))[_0xed45('0x1b')](function(_0x89d3b3){if(_0x89d3b3){_0x1cccc5[_0xed45('0x54')][_0xed45('0x59')]=_0x89d3b3['id'];_0x1cccc5[_0xed45('0x54')]['Subjects']=integrations[_0xed45('0x5a')](_0x1cccc5['body'][_0xed45('0x5b')],_0x1cccc5[_0xed45('0x54')][_0xed45('0x3b')]);_0x1cccc5[_0xed45('0x54')][_0xed45('0x5c')]=integrations[_0xed45('0x5d')](_0x1cccc5[_0xed45('0x54')][_0xed45('0x5b')],_0x1cccc5[_0xed45('0x54')][_0xed45('0x3b')]);return db[_0xed45('0x5e')][_0xed45('0x5f')](_0x1cccc5[_0xed45('0x54')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0xed45('0x60')],'as':'Descriptions'}]});}return null;})[_0xed45('0x1b')](respondWithResult(_0x7c89b6,null))[_0xed45('0x53')](handleError(_0x7c89b6,null));};exports[_0xed45('0x61')]=function(_0x5c9e24,_0x3b4c3f,_0x4217c4){var _0x149da8='';var _0x380da7='';return db[_0xed45('0x38')][_0xed45('0x58')]({'where':{'id':_0x5c9e24[_0xed45('0x4f')]['id']},'attributes':['id','username','remoteUri',_0xed45('0x62')]})[_0xed45('0x1b')](handleEntityNotFound(_0x3b4c3f,null))[_0xed45('0x1b')](function(_0x3033a1){if(_0x3033a1){_0x380da7=_0x3033a1[_0xed45('0x63')];_0x149da8=_0x3033a1[_0xed45('0x64')];var _0x5efb61=_0x3033a1['remoteUri'][_0xed45('0x65')](-0x1);if(_0x5efb61==='/'){_0x149da8=_0x149da8['substring'](0x0,_0x149da8[_0xed45('0x66')](_0x5efb61));}return rp({'method':_0xed45('0x67'),'uri':util[_0xed45('0x68')](_0xed45('0x69'),_0x149da8,_0xed45('0x6a')),'headers':{'Authorization':_0xed45('0x6b')+_0x3033a1[_0xed45('0x62')]},'json':!![]});}})[_0xed45('0x1b')](function(_0x36c151){if(_0x36c151){var _0x19c132=_0x36c151[_0xed45('0x6c')];var _0x312693=![];var _0x10b710=null;for(_0x10b710=0x0;_0x10b710<_0x19c132[_0xed45('0x42')];_0x10b710++){if(_0x19c132[_0x10b710][_0xed45('0x6d')]===_0x380da7){_0x312693=!![];}}if(_0x312693){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xed45('0x6e')});}}})[_0xed45('0x1b')](respondWithResult(_0x3b4c3f,null))[_0xed45('0x53')](function(_0x1c8550){var _0x4c1af3=_0x5c9e24[_0xed45('0x3e')][_0xed45('0x6f')]?0x1f4:_0x1c8550[_0xed45('0x70')]||0x1f4;logger['error'](_0xed45('0x71'),_0xed45('0x61'),_0x4c1af3,JSON['stringify'](_0x1c8550));delete _0x1c8550['name'];if(_0x4c1af3===0x191){_0x4c1af3=0x190;}_0x3b4c3f[_0xed45('0x31')](_0x4c1af3)['send'](_0x5c9e24['query'][_0xed45('0x6f')]?{'message':_0xed45('0x72'),'statusCode':_0x1c8550['statusCode']}:_0x1c8550);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index ea314ee..6c09e97 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 _0x9a28=['util','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','exports','define','int_freshsales_accounts','lodash'];(function(_0x3245dc,_0x40a4c8){var _0x34c6b3=function(_0x42dd1a){while(--_0x42dd1a){_0x3245dc['push'](_0x3245dc['shift']());}};_0x34c6b3(++_0x40a4c8);}(_0x9a28,0x16a));var _0x89a2=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x9a28[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x89a2('0x0'));var util=require(_0x89a2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x89a2('0x2'));var BPromise=require(_0x89a2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89a2('0x4'));var rimraf=require(_0x89a2('0x5'));var config=require(_0x89a2('0x6'));var attributes=require(_0x89a2('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x89a2('0x8')]=function(_0x558aae,_0x53c88c){return _0x558aae[_0x89a2('0x9')]('FreshsalesAccount',attributes,{'tableName':_0x89a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac8e=['api','moment','bluebird','path','../../config/environment','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger'];(function(_0x5d3a6a,_0x11c93a){var _0x35980b=function(_0x554419){while(--_0x554419){_0x5d3a6a['push'](_0x5d3a6a['shift']());}};_0x35980b(++_0x11c93a);}(_0xac8e,0x19f));var _0xeac8=function(_0x104aea,_0x2a8556){_0x104aea=_0x104aea-0x0;var _0x52714c=_0xac8e[_0x104aea];return _0x52714c;};'use strict';var _=require(_0xeac8('0x0'));var util=require(_0xeac8('0x1'));var logger=require(_0xeac8('0x2'))(_0xeac8('0x3'));var moment=require(_0xeac8('0x4'));var BPromise=require(_0xeac8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeac8('0x6'));var rimraf=require('rimraf');var config=require(_0xeac8('0x7'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xeac8('0x8')]=function(_0x3120df,_0x840395){return _0x3120df['define'](_0xeac8('0x9'),attributes,{'tableName':_0xeac8('0xa'),'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 50ed772..f382f2e 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 _0x9f0e=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','limit','include','map','model','attributes','ShowFreshsalesAccount','find','where','lodash','util'];(function(_0x301910,_0xbf20f){var _0x543a81=function(_0x9ea910){while(--_0x9ea910){_0x301910['push'](_0x301910['shift']());}};_0x543a81(++_0xbf20f);}(_0x9f0e,0x116));var _0xe9f0=function(_0x4ac765,_0x46f863){_0x4ac765=_0x4ac765-0x0;var _0x5dadd1=_0x9f0e[_0x4ac765];return _0x5dadd1;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});}exports[_0xe9f0('0x16')]=function(_0x2ab12b){var _0x3da237=this;return new Promise(function(_0x59bf5a,_0x15a33b){return db[_0xe9f0('0x17')][_0xe9f0('0x18')]({'raw':_0x2ab12b['options']?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')]['where']||null:null,'attributes':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')]['attributes']||null:null,'limit':_0x2ab12b['options']?_0x2ab12b['options'][_0xe9f0('0x1b')]||null:null,'include':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1c')]?_[_0xe9f0('0x1d')](_0x2ab12b['options'][_0xe9f0('0x1c')],function(_0x38b7ee){return{'model':db[_0x38b7ee[_0xe9f0('0x1e')]],'as':_0x38b7ee['as'],'attributes':_0x38b7ee[_0xe9f0('0x1f')],'include':_0x38b7ee[_0xe9f0('0x1c')]?_[_0xe9f0('0x1d')](_0x38b7ee[_0xe9f0('0x1c')],function(_0x1321bb){return{'model':db[_0x1321bb[_0xe9f0('0x1e')]],'as':_0x1321bb['as'],'attributes':_0x1321bb[_0xe9f0('0x1f')],'include':_0x1321bb['include']?_[_0xe9f0('0x1d')](_0x1321bb[_0xe9f0('0x1c')],function(_0x2ddfba){return{'model':db[_0x2ddfba[_0xe9f0('0x1e')]],'as':_0x2ddfba['as'],'attributes':_0x2ddfba['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9f0('0xb')](function(_0x2613fd){logger[_0xe9f0('0xc')](_0xe9f0('0x16'),_0x2ab12b);logger[_0xe9f0('0xf')]('GetFreshsalesAccount',_0x2ab12b,JSON[_0xe9f0('0x11')](_0x2613fd));_0x59bf5a(_0x2613fd);})[_0xe9f0('0x15')](function(_0x44fb5b){logger[_0xe9f0('0x12')](_0xe9f0('0x16'),_0x44fb5b[_0xe9f0('0x13')],_0x2ab12b);_0x15a33b(_0x3da237[_0xe9f0('0x12')](0x1f4,_0x44fb5b[_0xe9f0('0x13')]));});});};exports[_0xe9f0('0x20')]=function(_0x3dbe49){var _0x22806c=this;return new Promise(function(_0x617ad3,_0x445ad0){return db[_0xe9f0('0x17')][_0xe9f0('0x21')]({'raw':_0x3dbe49[_0xe9f0('0x19')]?_0x3dbe49[_0xe9f0('0x19')][_0xe9f0('0x1a')]===undefined?!![]:![]:!![],'where':_0x3dbe49[_0xe9f0('0x19')]?_0x3dbe49[_0xe9f0('0x19')][_0xe9f0('0x22')]||null:null,'attributes':_0x3dbe49[_0xe9f0('0x19')]?_0x3dbe49[_0xe9f0('0x19')][_0xe9f0('0x1f')]||null:null,'include':_0x3dbe49['options']?_0x3dbe49['options']['include']?_[_0xe9f0('0x1d')](_0x3dbe49['options'][_0xe9f0('0x1c')],function(_0xc5fa13){return{'model':db[_0xc5fa13['model']],'as':_0xc5fa13['as'],'attributes':_0xc5fa13[_0xe9f0('0x1f')],'include':_0xc5fa13['include']?_['map'](_0xc5fa13['include'],function(_0x165440){return{'model':db[_0x165440[_0xe9f0('0x1e')]],'as':_0x165440['as'],'attributes':_0x165440['attributes'],'include':_0x165440[_0xe9f0('0x1c')]?_[_0xe9f0('0x1d')](_0x165440[_0xe9f0('0x1c')],function(_0x4d4186){return{'model':db[_0x4d4186['model']],'as':_0x4d4186['as'],'attributes':_0x4d4186[_0xe9f0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe9f0('0xb')](function(_0x1917c8){logger['info'](_0xe9f0('0x20'),_0x3dbe49);logger[_0xe9f0('0xf')](_0xe9f0('0x20'),_0x3dbe49,JSON[_0xe9f0('0x11')](_0x1917c8));_0x617ad3(_0x1917c8);})[_0xe9f0('0x15')](function(_0x552ec2){logger[_0xe9f0('0x12')](_0xe9f0('0x20'),_0x552ec2[_0xe9f0('0x13')],_0x3dbe49);_0x445ad0(_0x22806c['error'](0x1f4,_0x552ec2[_0xe9f0('0x13')]));});});}; \ No newline at end of file +var _0x01a6=['attributes','then','find','ShowFreshsalesAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','include','map','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01a6,0x162));var _0x601a=function(_0x566715,_0x46112b){_0x566715=_0x566715-0x0;var _0x58892f=_0x01a6[_0x566715];return _0x58892f;};'use strict';var _=require(_0x601a('0x0'));var util=require('util');var moment=require(_0x601a('0x1'));var BPromise=require(_0x601a('0x2'));var rs=require(_0x601a('0x3'));var fs=require('fs');var Redis=require(_0x601a('0x4'));var db=require(_0x601a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x601a('0x6'))('rpc');var config=require(_0x601a('0x7'));var jayson=require(_0x601a('0x8'));var client=jayson[_0x601a('0x9')][_0x601a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x272297,_0x5d94b5,_0x4ec3fe){return new BPromise(function(_0x208472,_0x1b6bf7){return client[_0x601a('0xb')](_0x272297,_0x4ec3fe)['then'](function(_0x6c5aab){logger[_0x601a('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x5d94b5,_0x601a('0xd'));logger[_0x601a('0xe')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x5d94b5,_0x601a('0xd'),JSON[_0x601a('0xf')](_0x6c5aab));if(_0x6c5aab[_0x601a('0x10')]){if(_0x6c5aab[_0x601a('0x10')][_0x601a('0x11')]===0x1f4){logger[_0x601a('0x10')](_0x601a('0x12'),_0x5d94b5,_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);return _0x1b6bf7(_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);}logger['error'](_0x601a('0x12'),_0x5d94b5,_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);return _0x208472(_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);}else{logger[_0x601a('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x5d94b5,_0x601a('0xd'));_0x208472(_0x6c5aab[_0x601a('0x14')][_0x601a('0x13')]);}})[_0x601a('0x15')](function(_0x4e1ebf){logger[_0x601a('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x5d94b5,_0x4e1ebf);_0x1b6bf7(_0x4e1ebf);});});}exports[_0x601a('0x16')]=function(_0x1d3839){var _0x359554=this;return new Promise(function(_0x3411c3,_0x117870){return db[_0x601a('0x17')][_0x601a('0x18')]({'raw':_0x1d3839['options']?_0x1d3839[_0x601a('0x19')][_0x601a('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d3839[_0x601a('0x19')]?_0x1d3839[_0x601a('0x19')][_0x601a('0x1b')]||null:null,'attributes':_0x1d3839[_0x601a('0x19')]?_0x1d3839[_0x601a('0x19')]['attributes']||null:null,'limit':_0x1d3839[_0x601a('0x19')]?_0x1d3839['options']['limit']||null:null,'include':_0x1d3839[_0x601a('0x19')]?_0x1d3839[_0x601a('0x19')][_0x601a('0x1c')]?_[_0x601a('0x1d')](_0x1d3839['options'][_0x601a('0x1c')],function(_0x5be894){return{'model':db[_0x5be894['model']],'as':_0x5be894['as'],'attributes':_0x5be894['attributes'],'include':_0x5be894['include']?_['map'](_0x5be894[_0x601a('0x1c')],function(_0x599d71){return{'model':db[_0x599d71[_0x601a('0x1e')]],'as':_0x599d71['as'],'attributes':_0x599d71[_0x601a('0x1f')],'include':_0x599d71[_0x601a('0x1c')]?_[_0x601a('0x1d')](_0x599d71['include'],function(_0x336e88){return{'model':db[_0x336e88[_0x601a('0x1e')]],'as':_0x336e88['as'],'attributes':_0x336e88['attributes']};}):[]};}):[]};}):[]:[]})[_0x601a('0x20')](function(_0x335581){logger[_0x601a('0xc')](_0x601a('0x16'),_0x1d3839);logger[_0x601a('0xe')]('GetFreshsalesAccount',_0x1d3839,JSON[_0x601a('0xf')](_0x335581));_0x3411c3(_0x335581);})[_0x601a('0x15')](function(_0x9e08f4){logger[_0x601a('0x10')](_0x601a('0x16'),_0x9e08f4['message'],_0x1d3839);_0x117870(_0x359554[_0x601a('0x10')](0x1f4,_0x9e08f4[_0x601a('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0x44d27f){var _0x342bc0=this;return new Promise(function(_0x2c764a,_0x508ddc){return db['FreshsalesAccount'][_0x601a('0x21')]({'raw':_0x44d27f[_0x601a('0x19')]?_0x44d27f[_0x601a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x44d27f[_0x601a('0x19')]?_0x44d27f['options'][_0x601a('0x1b')]||null:null,'attributes':_0x44d27f[_0x601a('0x19')]?_0x44d27f[_0x601a('0x19')][_0x601a('0x1f')]||null:null,'include':_0x44d27f[_0x601a('0x19')]?_0x44d27f[_0x601a('0x19')][_0x601a('0x1c')]?_[_0x601a('0x1d')](_0x44d27f[_0x601a('0x19')][_0x601a('0x1c')],function(_0x3b86b5){return{'model':db[_0x3b86b5[_0x601a('0x1e')]],'as':_0x3b86b5['as'],'attributes':_0x3b86b5[_0x601a('0x1f')],'include':_0x3b86b5[_0x601a('0x1c')]?_['map'](_0x3b86b5[_0x601a('0x1c')],function(_0x56a1bc){return{'model':db[_0x56a1bc[_0x601a('0x1e')]],'as':_0x56a1bc['as'],'attributes':_0x56a1bc[_0x601a('0x1f')],'include':_0x56a1bc[_0x601a('0x1c')]?_[_0x601a('0x1d')](_0x56a1bc[_0x601a('0x1c')],function(_0x28be2b){return{'model':db[_0x28be2b[_0x601a('0x1e')]],'as':_0x28be2b['as'],'attributes':_0x28be2b['attributes']};}):[]};}):[]};}):[]:[]})[_0x601a('0x20')](function(_0x2f94a7){logger[_0x601a('0xc')](_0x601a('0x22'),_0x44d27f);logger[_0x601a('0xe')](_0x601a('0x22'),_0x44d27f,JSON['stringify'](_0x2f94a7));_0x2c764a(_0x2f94a7);})[_0x601a('0x15')](function(_0x1aaaa0){logger[_0x601a('0x10')](_0x601a('0x22'),_0x1aaaa0[_0x601a('0x13')],_0x44d27f);_0x508ddc(_0x342bc0[_0x601a('0x10')](0x1f4,_0x1aaaa0[_0x601a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 6f26113..447bb50 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 _0xe9c3=['get','index','/:id','isAuthenticated','show','getSubjects','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller'];(function(_0x396f22,_0x4d87a8){var _0x7aeaa6=function(_0x430844){while(--_0x430844){_0x396f22['push'](_0x396f22['shift']());}};_0x7aeaa6(++_0x4d87a8);}(_0xe9c3,0x122));var _0x3e9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9c3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3e9c('0x0'));var util=require(_0x3e9c('0x1'));var path=require(_0x3e9c('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e9c('0x3'));var router=express[_0x3e9c('0x4')]();var fs_extra=require(_0x3e9c('0x5'));var auth=require(_0x3e9c('0x6'));var interaction=require(_0x3e9c('0x7'));var config=require(_0x3e9c('0x8'));var controller=require(_0x3e9c('0x9'));router[_0x3e9c('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e9c('0xb')]);router['get'](_0x3e9c('0xc'),auth[_0x3e9c('0xd')](),controller[_0x3e9c('0xe')]);router[_0x3e9c('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x3e9c('0xf')]);router[_0x3e9c('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x3e9c('0xa')](_0x3e9c('0x10'),auth[_0x3e9c('0xd')](),controller[_0x3e9c('0x11')]);router[_0x3e9c('0x12')]('/',auth[_0x3e9c('0xd')](),controller[_0x3e9c('0x13')]);router[_0x3e9c('0x14')]('/:id',auth[_0x3e9c('0xd')](),controller[_0x3e9c('0x15')]);router[_0x3e9c('0x16')](_0x3e9c('0xc'),auth[_0x3e9c('0xd')](),controller[_0x3e9c('0x17')]);module[_0x3e9c('0x18')]=router; \ No newline at end of file +var _0x3d38=['get','/:id/descriptions','/:id/fields','create','put','update','delete','destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','/:id','show','getSubjects'];(function(_0x3d450e,_0x515178){var _0x1f3f15=function(_0x585b8a){while(--_0x585b8a){_0x3d450e['push'](_0x3d450e['shift']());}};_0x1f3f15(++_0x515178);}(_0x3d38,0x1d7));var _0x83d3=function(_0x1aec28,_0x556b6f){_0x1aec28=_0x1aec28-0x0;var _0x2398c7=_0x3d38[_0x1aec28];return _0x2398c7;};'use strict';var multer=require('multer');var util=require(_0x83d3('0x0'));var path=require('path');var timeout=require(_0x83d3('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x83d3('0x2'));var auth=require(_0x83d3('0x3'));var interaction=require(_0x83d3('0x4'));var config=require(_0x83d3('0x5'));var controller=require(_0x83d3('0x6'));router['get']('/',auth[_0x83d3('0x7')](),controller[_0x83d3('0x8')]);router['get'](_0x83d3('0x9'),auth[_0x83d3('0x7')](),controller[_0x83d3('0xa')]);router['get']('/:id/subjects',auth[_0x83d3('0x7')](),controller[_0x83d3('0xb')]);router[_0x83d3('0xc')](_0x83d3('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x83d3('0xc')](_0x83d3('0xe'),auth[_0x83d3('0x7')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x83d3('0xf')]);router[_0x83d3('0x10')](_0x83d3('0x9'),auth['isAuthenticated'](),controller[_0x83d3('0x11')]);router[_0x83d3('0x12')](_0x83d3('0x9'),auth[_0x83d3('0x7')](),controller[_0x83d3('0x13')]);module[_0x83d3('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index db48911..51146ba 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 _0xf891=['STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf891,0xbe));var _0x1f89=function(_0x2383f4,_0x29526e){_0x2383f4=_0x2383f4-0x0;var _0x3429d4=_0xf891[_0x2383f4];return _0x3429d4;};'use strict';var Sequelize=require(_0x1f89('0x0'));module[_0x1f89('0x1')]={'name':{'type':Sequelize[_0x1f89('0x2')]},'description':{'type':Sequelize[_0x1f89('0x2')]}}; \ No newline at end of file +var _0x03c7=['exports','STRING'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x03c7,0x1be));var _0x703c=function(_0x54e124,_0x242d6a){_0x54e124=_0x54e124-0x0;var _0x488726=_0x03c7[_0x54e124];return _0x488726;};'use strict';var Sequelize=require('sequelize');module[_0x703c('0x0')]={'name':{'type':Sequelize[_0x703c('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 d897785..1efa62a 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 _0xd983=['filters','query','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','FreshsalesConfiguration','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','destroy','getSubjects','order','getDescriptions','findOne','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','stack','name','send','index','rawAttributes','type','model','map','keys'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd983,0x7d));var _0x3d98=function(_0x42c380,_0x35c686){_0x42c380=_0x42c380-0x0;var _0x4697d6=_0xd983[_0x42c380];return _0x4697d6;};'use strict';var emlformat=require(_0x3d98('0x0'));var rimraf=require(_0x3d98('0x1'));var zipdir=require(_0x3d98('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3d98('0x3'));var moment=require(_0x3d98('0x4'));var BPromise=require(_0x3d98('0x5'));var Mustache=require(_0x3d98('0x6'));var util=require(_0x3d98('0x7'));var path=require(_0x3d98('0x8'));var sox=require(_0x3d98('0x9'));var csv=require(_0x3d98('0xa'));var ejs=require(_0x3d98('0xb'));var fs=require('fs');var fs_extra=require(_0x3d98('0xc'));var _=require(_0x3d98('0xd'));var squel=require(_0x3d98('0xe'));var crypto=require(_0x3d98('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x3d98('0x10'));var toCsv=require(_0x3d98('0xa'));var querystring=require('querystring');var Papa=require(_0x3d98('0x11'));var Redis=require(_0x3d98('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3d98('0x13'));var as=require(_0x3d98('0x14'));var hardwareService=require(_0x3d98('0x15'));var logger=require(_0x3d98('0x16'))(_0x3d98('0x17'));var utils=require(_0x3d98('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3d98('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0x3d98('0x1a'));var client=jayson[_0x3d98('0x1b')][_0x3d98('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xcf4025,_0x5a4e7f,_0xd33fd4,_0x478da8){return new BPromise(function(_0xc92387,_0x5bc61f){var _0x3b2387=_0x478da8||client;return _0x3b2387[_0x3d98('0x1d')](_0xcf4025,_0xd33fd4)[_0x3d98('0x1e')](function(_0xd9bea7){logger[_0x3d98('0x1f')](_0x3d98('0x20'),_0x5a4e7f,'request\x20sent');logger[_0x3d98('0x21')](_0x3d98('0x22'),_0x5a4e7f,_0x3d98('0x23'),JSON['stringify'](_0xd9bea7));if(_0xd9bea7[_0x3d98('0x24')]){if(_0xd9bea7[_0x3d98('0x24')]['code']===0x1f4){logger['error'](_0x3d98('0x20'),_0x5a4e7f,_0xd9bea7['error'][_0x3d98('0x25')]);return _0x5bc61f(_0xd9bea7[_0x3d98('0x24')][_0x3d98('0x25')]);}logger[_0x3d98('0x24')](_0x3d98('0x20'),_0x5a4e7f,_0xd9bea7['error'][_0x3d98('0x25')]);return _0xc92387(_0xd9bea7[_0x3d98('0x24')][_0x3d98('0x25')]);}else{logger['info'](_0x3d98('0x20'),_0x5a4e7f,'request\x20sent');_0xc92387(_0xd9bea7[_0x3d98('0x26')][_0x3d98('0x25')]);}})['catch'](function(_0x151cee){logger[_0x3d98('0x24')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5a4e7f,_0x151cee);_0x5bc61f(_0x151cee);});});}function respondWithStatusCode(_0x84fc59,_0xa8f877){_0xa8f877=_0xa8f877||0xcc;return function(_0x4aad7b){if(_0x4aad7b){return _0x84fc59[_0x3d98('0x27')](_0xa8f877);}return _0x84fc59['status'](_0xa8f877)[_0x3d98('0x28')]();};}function respondWithResult(_0x924260,_0x20d22f){_0x20d22f=_0x20d22f||0xc8;return function(_0x47a3fa){if(_0x47a3fa){return _0x924260[_0x3d98('0x29')](_0x20d22f)[_0x3d98('0x2a')](_0x47a3fa);}};}function respondWithFilteredResult(_0x221031,_0x1ad9b1){return function(_0x2907de){if(_0x2907de){var _0x3dcc24=typeof _0x1ad9b1['offset']===_0x3d98('0x2b')&&typeof _0x1ad9b1[_0x3d98('0x2c')]===_0x3d98('0x2b');var _0x32ac39=_0x2907de[_0x3d98('0x2d')];var _0x40ba72=_0x3dcc24?0x0:_0x1ad9b1[_0x3d98('0x2e')];var _0x22e9b6=_0x3dcc24?_0x2907de[_0x3d98('0x2d')]:_0x1ad9b1[_0x3d98('0x2e')]+_0x1ad9b1[_0x3d98('0x2c')];var _0x272435;if(_0x22e9b6>=_0x32ac39){_0x22e9b6=_0x32ac39;_0x272435=0xc8;}else{_0x272435=0xce;}_0x221031[_0x3d98('0x29')](_0x272435);return _0x221031[_0x3d98('0x2f')]('Content-Range',_0x40ba72+'-'+_0x22e9b6+'/'+_0x32ac39)[_0x3d98('0x2a')](_0x2907de);}return null;};}function patchUpdates(_0x5f1a17){return function(_0x3b2666){try{jsonpatch[_0x3d98('0x30')](_0x3b2666,_0x5f1a17,!![]);}catch(_0xcec8df){return BPromise[_0x3d98('0x31')](_0xcec8df);}return _0x3b2666[_0x3d98('0x32')]();};}function saveUpdates(_0x381101,_0xf16ee5){return function(_0x38559b){if(_0x38559b){return _0x38559b[_0x3d98('0x33')](_0x381101)[_0x3d98('0x1e')](function(_0x3099bf){return _0x3099bf;});}return null;};}function removeEntity(_0x314e2c,_0x48f9bd){return function(_0x338101){if(_0x338101){return _0x338101['destroy']()[_0x3d98('0x1e')](function(){_0x314e2c['status'](0xcc)[_0x3d98('0x28')]();});}};}function handleEntityNotFound(_0x2cec73,_0xbbc965){return function(_0x417bc7){if(!_0x417bc7){_0x2cec73[_0x3d98('0x27')](0x194);}return _0x417bc7;};}function handleError(_0x1389cb,_0x21e7d6){_0x21e7d6=_0x21e7d6||0x1f4;return function(_0x5cb4be){logger[_0x3d98('0x24')](_0x5cb4be[_0x3d98('0x34')]);if(_0x5cb4be[_0x3d98('0x35')]){delete _0x5cb4be['name'];}_0x1389cb[_0x3d98('0x29')](_0x21e7d6)[_0x3d98('0x36')](_0x5cb4be);};}exports[_0x3d98('0x37')]=function(_0x29b8ae,_0x382ea5){var _0x311799={},_0x34807f={},_0x2bf346={'count':0x0,'rows':[]};var _0x2c5af0=_['map'](db['FreshsalesConfiguration'][_0x3d98('0x38')],function(_0x2e9e0d){return{'name':_0x2e9e0d['fieldName'],'type':_0x2e9e0d[_0x3d98('0x39')]['key']};});_0x34807f[_0x3d98('0x3a')]=_[_0x3d98('0x3b')](_0x2c5af0,_0x3d98('0x35'));_0x34807f['query']=_[_0x3d98('0x3c')](_0x29b8ae['query']);_0x34807f[_0x3d98('0x3d')]=_['intersection'](_0x34807f[_0x3d98('0x3a')],_0x34807f[_0x3d98('0x3e')]);_0x311799['attributes']=_['intersection'](_0x34807f[_0x3d98('0x3a')],qs[_0x3d98('0x3f')](_0x29b8ae[_0x3d98('0x3e')][_0x3d98('0x3f')]));_0x311799[_0x3d98('0x40')]=_0x311799[_0x3d98('0x40')][_0x3d98('0x41')]?_0x311799[_0x3d98('0x40')]:_0x34807f[_0x3d98('0x3a')];if(!_0x29b8ae[_0x3d98('0x3e')][_0x3d98('0x42')](_0x3d98('0x43'))){_0x311799['limit']=qs['limit'](_0x29b8ae['query']['limit']);_0x311799['offset']=qs[_0x3d98('0x2e')](_0x29b8ae[_0x3d98('0x3e')][_0x3d98('0x2e')]);}_0x311799['order']=qs[_0x3d98('0x44')](_0x29b8ae[_0x3d98('0x3e')][_0x3d98('0x44')]);_0x311799['where']=qs[_0x3d98('0x3d')](_[_0x3d98('0x45')](_0x29b8ae['query'],_0x34807f['filters']),_0x2c5af0);if(_0x29b8ae[_0x3d98('0x3e')][_0x3d98('0x46')]){_0x311799[_0x3d98('0x47')]=_['merge'](_0x311799['where'],{'$or':_[_0x3d98('0x3b')](_0x2c5af0,function(_0x37e613){if(_0x37e613[_0x3d98('0x39')]!==_0x3d98('0x48')){var _0x453932={};_0x453932[_0x37e613[_0x3d98('0x35')]]={'$like':'%'+_0x29b8ae[_0x3d98('0x3e')][_0x3d98('0x46')]+'%'};return _0x453932;}})});}_0x311799=_[_0x3d98('0x49')]({},_0x311799,_0x29b8ae[_0x3d98('0x4a')]);var _0x2d8be1={'where':_0x311799['where']};return db[_0x3d98('0x4b')]['count'](_0x2d8be1)[_0x3d98('0x1e')](function(_0x52c811){_0x2bf346[_0x3d98('0x2d')]=_0x52c811;if(_0x29b8ae[_0x3d98('0x3e')]['includeAll']){_0x311799[_0x3d98('0x4c')]=[{'all':!![]}];}return db[_0x3d98('0x4b')][_0x3d98('0x4d')](_0x311799);})[_0x3d98('0x1e')](function(_0x1ac29a){_0x2bf346[_0x3d98('0x4e')]=_0x1ac29a;return _0x2bf346;})['then'](respondWithFilteredResult(_0x382ea5,_0x311799))[_0x3d98('0x4f')](handleError(_0x382ea5,null));};exports[_0x3d98('0x50')]=function(_0x580c57,_0x3cb3e2){var _0x59e851={'raw':![],'where':{'id':_0x580c57[_0x3d98('0x51')]['id']}},_0x4be629={};_0x4be629[_0x3d98('0x3a')]=_['keys'](db[_0x3d98('0x4b')][_0x3d98('0x38')]);_0x4be629[_0x3d98('0x3e')]=_[_0x3d98('0x3c')](_0x580c57[_0x3d98('0x3e')]);_0x4be629['filters']=_[_0x3d98('0x52')](_0x4be629[_0x3d98('0x3a')],_0x4be629[_0x3d98('0x3e')]);_0x59e851[_0x3d98('0x40')]=_[_0x3d98('0x52')](_0x4be629['model'],qs[_0x3d98('0x3f')](_0x580c57[_0x3d98('0x3e')]['fields']));_0x59e851[_0x3d98('0x40')]=_0x59e851[_0x3d98('0x40')]['length']?_0x59e851[_0x3d98('0x40')]:_0x4be629[_0x3d98('0x3a')];if(_0x580c57[_0x3d98('0x3e')][_0x3d98('0x53')]){_0x59e851[_0x3d98('0x4c')]=[{'all':!![]}];}_0x59e851=_[_0x3d98('0x49')]({},_0x59e851,_0x580c57[_0x3d98('0x4a')]);return db[_0x3d98('0x4b')][_0x3d98('0x54')](_0x59e851)[_0x3d98('0x1e')](handleEntityNotFound(_0x3cb3e2,null))[_0x3d98('0x1e')](respondWithResult(_0x3cb3e2,null))[_0x3d98('0x4f')](handleError(_0x3cb3e2,null));};exports[_0x3d98('0x55')]=function(_0x12dae4,_0x58ca53){return db[_0x3d98('0x4b')][_0x3d98('0x55')](_0x12dae4[_0x3d98('0x56')],{})[_0x3d98('0x1e')](respondWithResult(_0x58ca53,0xc9))[_0x3d98('0x4f')](handleError(_0x58ca53,null));};exports[_0x3d98('0x33')]=function(_0x3830c3,_0x47eb4f){if(_0x3830c3[_0x3d98('0x56')]['id']){delete _0x3830c3['body']['id'];}return db[_0x3d98('0x4b')][_0x3d98('0x54')]({'where':{'id':_0x3830c3[_0x3d98('0x51')]['id']}})[_0x3d98('0x1e')](handleEntityNotFound(_0x47eb4f,null))['then'](saveUpdates(_0x3830c3['body'],null))[_0x3d98('0x1e')](respondWithResult(_0x47eb4f,null))[_0x3d98('0x4f')](handleError(_0x47eb4f,null));};exports[_0x3d98('0x57')]=function(_0x9de961,_0x125017){return db[_0x3d98('0x4b')][_0x3d98('0x54')]({'where':{'id':_0x9de961[_0x3d98('0x51')]['id']}})['then'](handleEntityNotFound(_0x125017,null))[_0x3d98('0x1e')](removeEntity(_0x125017,null))[_0x3d98('0x4f')](handleError(_0x125017,null));};exports[_0x3d98('0x58')]=function(_0x374530,_0x48017f,_0xa8d53a){var _0x44823b={};var _0x1e15c4={};var _0x4c4d0e;var _0x19e66d;return db[_0x3d98('0x4b')]['findOne']({'where':{'id':_0x374530[_0x3d98('0x51')]['id']}})[_0x3d98('0x1e')](handleEntityNotFound(_0x48017f,null))[_0x3d98('0x1e')](function(_0x2c3bee){if(_0x2c3bee){_0x4c4d0e=_0x2c3bee;_0x1e15c4[_0x3d98('0x3a')]=_['keys'](db['FreshsalesField'][_0x3d98('0x38')]);_0x1e15c4['query']=_[_0x3d98('0x3c')](_0x374530[_0x3d98('0x3e')]);_0x1e15c4['filters']=_[_0x3d98('0x52')](_0x1e15c4[_0x3d98('0x3a')],_0x1e15c4['query']);_0x44823b['attributes']=_[_0x3d98('0x52')](_0x1e15c4[_0x3d98('0x3a')],qs[_0x3d98('0x3f')](_0x374530[_0x3d98('0x3e')][_0x3d98('0x3f')]));_0x44823b['attributes']=_0x44823b[_0x3d98('0x40')][_0x3d98('0x41')]?_0x44823b['attributes']:_0x1e15c4[_0x3d98('0x3a')];_0x44823b[_0x3d98('0x59')]=qs[_0x3d98('0x44')](_0x374530[_0x3d98('0x3e')][_0x3d98('0x44')]);_0x44823b[_0x3d98('0x47')]=qs[_0x3d98('0x3d')](_['pick'](_0x374530[_0x3d98('0x3e')],_0x1e15c4[_0x3d98('0x3d')]));if(_0x374530['query'][_0x3d98('0x46')]){_0x44823b[_0x3d98('0x47')]=_[_0x3d98('0x49')](_0x44823b[_0x3d98('0x47')],{'$or':_['map'](_0x44823b[_0x3d98('0x40')],function(_0x2aaa12){var _0x2b9207={};_0x2b9207[_0x2aaa12]={'$like':'%'+_0x374530[_0x3d98('0x3e')][_0x3d98('0x46')]+'%'};return _0x2b9207;})});}_0x44823b=_['merge']({},_0x44823b,_0x374530[_0x3d98('0x4a')]);return _0x4c4d0e[_0x3d98('0x58')](_0x44823b);}})[_0x3d98('0x1e')](function(_0x262903){if(_0x262903){_0x19e66d=_0x262903[_0x3d98('0x41')];if(!_0x374530[_0x3d98('0x3e')][_0x3d98('0x42')](_0x3d98('0x43'))){_0x44823b[_0x3d98('0x2c')]=qs['limit'](_0x374530['query']['limit']);_0x44823b[_0x3d98('0x2e')]=qs[_0x3d98('0x2e')](_0x374530['query'][_0x3d98('0x2e')]);}return _0x4c4d0e[_0x3d98('0x58')](_0x44823b);}})['then'](function(_0x4b3d9a){if(_0x4b3d9a){return _0x4b3d9a?{'count':_0x19e66d,'rows':_0x4b3d9a}:null;}})[_0x3d98('0x1e')](respondWithResult(_0x48017f,null))[_0x3d98('0x4f')](handleError(_0x48017f,null));};exports[_0x3d98('0x5a')]=function(_0xecc987,_0x12953e,_0x5b5bf0){var _0x355274={};var _0x2481a1={};var _0x1d8be9;var _0xd8cc0b;return db[_0x3d98('0x4b')][_0x3d98('0x5b')]({'where':{'id':_0xecc987[_0x3d98('0x51')]['id']}})[_0x3d98('0x1e')](handleEntityNotFound(_0x12953e,null))[_0x3d98('0x1e')](function(_0x484450){if(_0x484450){_0x1d8be9=_0x484450;_0x2481a1[_0x3d98('0x3a')]=_['keys'](db['FreshsalesField'][_0x3d98('0x38')]);_0x2481a1[_0x3d98('0x3e')]=_[_0x3d98('0x3c')](_0xecc987[_0x3d98('0x3e')]);_0x2481a1['filters']=_[_0x3d98('0x52')](_0x2481a1['model'],_0x2481a1[_0x3d98('0x3e')]);_0x355274[_0x3d98('0x40')]=_[_0x3d98('0x52')](_0x2481a1[_0x3d98('0x3a')],qs[_0x3d98('0x3f')](_0xecc987[_0x3d98('0x3e')][_0x3d98('0x3f')]));_0x355274[_0x3d98('0x40')]=_0x355274[_0x3d98('0x40')][_0x3d98('0x41')]?_0x355274[_0x3d98('0x40')]:_0x2481a1[_0x3d98('0x3a')];_0x355274[_0x3d98('0x59')]=qs['sort'](_0xecc987[_0x3d98('0x3e')][_0x3d98('0x44')]);_0x355274[_0x3d98('0x47')]=qs['filters'](_['pick'](_0xecc987[_0x3d98('0x3e')],_0x2481a1[_0x3d98('0x3d')]));if(_0xecc987['query'][_0x3d98('0x46')]){_0x355274[_0x3d98('0x47')]=_[_0x3d98('0x49')](_0x355274['where'],{'$or':_[_0x3d98('0x3b')](_0x355274[_0x3d98('0x40')],function(_0x311a04){var _0xfb1df3={};_0xfb1df3[_0x311a04]={'$like':'%'+_0xecc987[_0x3d98('0x3e')]['filter']+'%'};return _0xfb1df3;})});}_0x355274=_[_0x3d98('0x49')]({},_0x355274,_0xecc987[_0x3d98('0x4a')]);return _0x1d8be9[_0x3d98('0x5a')](_0x355274);}})['then'](function(_0x4fb836){if(_0x4fb836){_0xd8cc0b=_0x4fb836[_0x3d98('0x41')];if(!_0xecc987[_0x3d98('0x3e')]['hasOwnProperty'](_0x3d98('0x43'))){_0x355274['limit']=qs[_0x3d98('0x2c')](_0xecc987[_0x3d98('0x3e')][_0x3d98('0x2c')]);_0x355274[_0x3d98('0x2e')]=qs[_0x3d98('0x2e')](_0xecc987['query']['offset']);}return _0x1d8be9[_0x3d98('0x5a')](_0x355274);}})[_0x3d98('0x1e')](function(_0x4c29a2){if(_0x4c29a2){return _0x4c29a2?{'count':_0xd8cc0b,'rows':_0x4c29a2}:null;}})[_0x3d98('0x1e')](respondWithResult(_0x12953e,null))[_0x3d98('0x4f')](handleError(_0x12953e,null));};exports['getFields']=function(_0x2d7275,_0x223587,_0x23ed59){var _0x183a75={};var _0x45c7fc={};var _0x4928d1;var _0x2357b3;return db[_0x3d98('0x4b')][_0x3d98('0x5b')]({'where':{'id':_0x2d7275[_0x3d98('0x51')]['id']}})[_0x3d98('0x1e')](handleEntityNotFound(_0x223587,null))[_0x3d98('0x1e')](function(_0x29b159){if(_0x29b159){_0x4928d1=_0x29b159;_0x45c7fc[_0x3d98('0x3a')]=_[_0x3d98('0x3c')](db['FreshsalesField'][_0x3d98('0x38')]);_0x45c7fc[_0x3d98('0x3e')]=_[_0x3d98('0x3c')](_0x2d7275[_0x3d98('0x3e')]);_0x45c7fc['filters']=_[_0x3d98('0x52')](_0x45c7fc[_0x3d98('0x3a')],_0x45c7fc[_0x3d98('0x3e')]);_0x183a75[_0x3d98('0x40')]=_['intersection'](_0x45c7fc[_0x3d98('0x3a')],qs[_0x3d98('0x3f')](_0x2d7275[_0x3d98('0x3e')][_0x3d98('0x3f')]));_0x183a75['attributes']=_0x183a75['attributes'][_0x3d98('0x41')]?_0x183a75['attributes']:_0x45c7fc['model'];_0x183a75[_0x3d98('0x59')]=qs[_0x3d98('0x44')](_0x2d7275[_0x3d98('0x3e')]['sort']);_0x183a75[_0x3d98('0x47')]=qs[_0x3d98('0x3d')](_['pick'](_0x2d7275['query'],_0x45c7fc[_0x3d98('0x3d')]));if(_0x2d7275[_0x3d98('0x3e')][_0x3d98('0x46')]){_0x183a75[_0x3d98('0x47')]=_[_0x3d98('0x49')](_0x183a75[_0x3d98('0x47')],{'$or':_[_0x3d98('0x3b')](_0x183a75[_0x3d98('0x40')],function(_0x41e30b){var _0x4fef51={};_0x4fef51[_0x41e30b]={'$like':'%'+_0x2d7275['query']['filter']+'%'};return _0x4fef51;})});}_0x183a75=_[_0x3d98('0x49')]({},_0x183a75,_0x2d7275[_0x3d98('0x4a')]);return _0x4928d1[_0x3d98('0x5c')](_0x183a75);}})[_0x3d98('0x1e')](function(_0x373811){if(_0x373811){_0x2357b3=_0x373811['length'];if(!_0x2d7275[_0x3d98('0x3e')][_0x3d98('0x42')](_0x3d98('0x43'))){_0x183a75[_0x3d98('0x2c')]=qs[_0x3d98('0x2c')](_0x2d7275[_0x3d98('0x3e')][_0x3d98('0x2c')]);_0x183a75[_0x3d98('0x2e')]=qs[_0x3d98('0x2e')](_0x2d7275[_0x3d98('0x3e')]['offset']);}return _0x4928d1['getFields'](_0x183a75);}})[_0x3d98('0x1e')](function(_0x56fa9b){if(_0x56fa9b){return _0x56fa9b?{'count':_0x2357b3,'rows':_0x56fa9b}:null;}})['then'](respondWithResult(_0x223587,null))[_0x3d98('0x4f')](handleError(_0x223587,null));}; \ No newline at end of file +var _0xc9b0=['name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','FreshsalesConfiguration','includeAll','include','findAll','show','params','find','create','body','destroy','findOne','FreshsalesField','getSubjects','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','client','http','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x670b87,_0x4863be){var _0x20d7fb=function(_0x28fa42){while(--_0x28fa42){_0x670b87['push'](_0x670b87['shift']());}};_0x20d7fb(++_0x4863be);}(_0xc9b0,0x143));var _0x0c9b=function(_0x4daa40,_0x1cb2a7){_0x4daa40=_0x4daa40-0x0;var _0x4e836c=_0xc9b0[_0x4daa40];return _0x4e836c;};'use strict';var emlformat=require(_0x0c9b('0x0'));var rimraf=require(_0x0c9b('0x1'));var zipdir=require(_0x0c9b('0x2'));var jsonpatch=require(_0x0c9b('0x3'));var rp=require(_0x0c9b('0x4'));var moment=require(_0x0c9b('0x5'));var BPromise=require(_0x0c9b('0x6'));var Mustache=require(_0x0c9b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0c9b('0x8'));var csv=require(_0x0c9b('0x9'));var ejs=require(_0x0c9b('0xa'));var fs=require('fs');var fs_extra=require(_0x0c9b('0xb'));var _=require(_0x0c9b('0xc'));var squel=require(_0x0c9b('0xd'));var crypto=require(_0x0c9b('0xe'));var jsforce=require(_0x0c9b('0xf'));var deskjs=require(_0x0c9b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0c9b('0x11'));var authService=require(_0x0c9b('0x12'));var qs=require(_0x0c9b('0x13'));var as=require(_0x0c9b('0x14'));var hardwareService=require(_0x0c9b('0x15'));var logger=require(_0x0c9b('0x16'))('api');var utils=require(_0x0c9b('0x17'));var config=require(_0x0c9b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c9b('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x0c9b('0x1a')][_0x0c9b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2d97b8,_0xec0b75,_0x2fc28f,_0x2bc058){return new BPromise(function(_0x291aeb,_0x41603d){var _0x40d68f=_0x2bc058||client;return _0x40d68f[_0x0c9b('0x1c')](_0x2d97b8,_0x2fc28f)['then'](function(_0x5967a6){logger['info'](_0x0c9b('0x1d'),_0xec0b75,_0x0c9b('0x1e'));logger['debug'](_0x0c9b('0x1f'),_0xec0b75,_0x0c9b('0x1e'),JSON[_0x0c9b('0x20')](_0x5967a6));if(_0x5967a6[_0x0c9b('0x21')]){if(_0x5967a6[_0x0c9b('0x21')][_0x0c9b('0x22')]===0x1f4){logger[_0x0c9b('0x21')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xec0b75,_0x5967a6['error'][_0x0c9b('0x23')]);return _0x41603d(_0x5967a6['error'][_0x0c9b('0x23')]);}logger[_0x0c9b('0x21')](_0x0c9b('0x1d'),_0xec0b75,_0x5967a6[_0x0c9b('0x21')][_0x0c9b('0x23')]);return _0x291aeb(_0x5967a6[_0x0c9b('0x21')][_0x0c9b('0x23')]);}else{logger[_0x0c9b('0x24')](_0x0c9b('0x1d'),_0xec0b75,_0x0c9b('0x1e'));_0x291aeb(_0x5967a6['result'][_0x0c9b('0x23')]);}})[_0x0c9b('0x25')](function(_0x3f499a){logger['error'](_0x0c9b('0x1d'),_0xec0b75,_0x3f499a);_0x41603d(_0x3f499a);});});}function respondWithStatusCode(_0x37ee51,_0x2409c6){_0x2409c6=_0x2409c6||0xcc;return function(_0x5c83c8){if(_0x5c83c8){return _0x37ee51[_0x0c9b('0x26')](_0x2409c6);}return _0x37ee51['status'](_0x2409c6)[_0x0c9b('0x27')]();};}function respondWithResult(_0x246738,_0x2d1ce5){_0x2d1ce5=_0x2d1ce5||0xc8;return function(_0x1824d2){if(_0x1824d2){return _0x246738[_0x0c9b('0x28')](_0x2d1ce5)[_0x0c9b('0x29')](_0x1824d2);}};}function respondWithFilteredResult(_0x29e457,_0x21748a){return function(_0x476c59){if(_0x476c59){var _0x243fec=typeof _0x21748a[_0x0c9b('0x2a')]==='undefined'&&typeof _0x21748a['limit']===_0x0c9b('0x2b');var _0x29f1bb=_0x476c59[_0x0c9b('0x2c')];var _0x2c9f63=_0x243fec?0x0:_0x21748a['offset'];var _0x361d03=_0x243fec?_0x476c59[_0x0c9b('0x2c')]:_0x21748a['offset']+_0x21748a[_0x0c9b('0x2d')];var _0x3498e6;if(_0x361d03>=_0x29f1bb){_0x361d03=_0x29f1bb;_0x3498e6=0xc8;}else{_0x3498e6=0xce;}_0x29e457[_0x0c9b('0x28')](_0x3498e6);return _0x29e457[_0x0c9b('0x2e')](_0x0c9b('0x2f'),_0x2c9f63+'-'+_0x361d03+'/'+_0x29f1bb)[_0x0c9b('0x29')](_0x476c59);}return null;};}function patchUpdates(_0x523fad){return function(_0x2eeea7){try{jsonpatch[_0x0c9b('0x30')](_0x2eeea7,_0x523fad,!![]);}catch(_0x4b3f6d){return BPromise[_0x0c9b('0x31')](_0x4b3f6d);}return _0x2eeea7[_0x0c9b('0x32')]();};}function saveUpdates(_0x45aa93,_0x174448){return function(_0x233d4b){if(_0x233d4b){return _0x233d4b[_0x0c9b('0x33')](_0x45aa93)[_0x0c9b('0x34')](function(_0x31397b){return _0x31397b;});}return null;};}function removeEntity(_0x16fd5e,_0x46c27d){return function(_0x57a0ad){if(_0x57a0ad){return _0x57a0ad['destroy']()['then'](function(){_0x16fd5e[_0x0c9b('0x28')](0xcc)[_0x0c9b('0x27')]();});}};}function handleEntityNotFound(_0x16fb5e,_0x1237d5){return function(_0x3655be){if(!_0x3655be){_0x16fb5e[_0x0c9b('0x26')](0x194);}return _0x3655be;};}function handleError(_0x2da701,_0x265fae){_0x265fae=_0x265fae||0x1f4;return function(_0x414fda){logger[_0x0c9b('0x21')](_0x414fda['stack']);if(_0x414fda[_0x0c9b('0x35')]){delete _0x414fda['name'];}_0x2da701[_0x0c9b('0x28')](_0x265fae)[_0x0c9b('0x36')](_0x414fda);};}exports[_0x0c9b('0x37')]=function(_0x7e5856,_0xa07a10){var _0x5b300a={},_0x430db5={},_0x50dae4={'count':0x0,'rows':[]};var _0x58cef3=_[_0x0c9b('0x38')](db['FreshsalesConfiguration'][_0x0c9b('0x39')],function(_0x1a6731){return{'name':_0x1a6731[_0x0c9b('0x3a')],'type':_0x1a6731[_0x0c9b('0x3b')][_0x0c9b('0x3c')]};});_0x430db5[_0x0c9b('0x3d')]=_[_0x0c9b('0x38')](_0x58cef3,_0x0c9b('0x35'));_0x430db5[_0x0c9b('0x3e')]=_[_0x0c9b('0x3f')](_0x7e5856[_0x0c9b('0x3e')]);_0x430db5[_0x0c9b('0x40')]=_['intersection'](_0x430db5[_0x0c9b('0x3d')],_0x430db5[_0x0c9b('0x3e')]);_0x5b300a[_0x0c9b('0x41')]=_[_0x0c9b('0x42')](_0x430db5[_0x0c9b('0x3d')],qs['fields'](_0x7e5856[_0x0c9b('0x3e')][_0x0c9b('0x43')]));_0x5b300a[_0x0c9b('0x41')]=_0x5b300a[_0x0c9b('0x41')][_0x0c9b('0x44')]?_0x5b300a[_0x0c9b('0x41')]:_0x430db5[_0x0c9b('0x3d')];if(!_0x7e5856[_0x0c9b('0x3e')]['hasOwnProperty'](_0x0c9b('0x45'))){_0x5b300a['limit']=qs[_0x0c9b('0x2d')](_0x7e5856[_0x0c9b('0x3e')][_0x0c9b('0x2d')]);_0x5b300a[_0x0c9b('0x2a')]=qs[_0x0c9b('0x2a')](_0x7e5856['query'][_0x0c9b('0x2a')]);}_0x5b300a[_0x0c9b('0x46')]=qs[_0x0c9b('0x47')](_0x7e5856[_0x0c9b('0x3e')][_0x0c9b('0x47')]);_0x5b300a[_0x0c9b('0x48')]=qs[_0x0c9b('0x40')](_[_0x0c9b('0x49')](_0x7e5856['query'],_0x430db5[_0x0c9b('0x40')]),_0x58cef3);if(_0x7e5856[_0x0c9b('0x3e')][_0x0c9b('0x4a')]){_0x5b300a[_0x0c9b('0x48')]=_['merge'](_0x5b300a[_0x0c9b('0x48')],{'$or':_['map'](_0x58cef3,function(_0x3ef9f3){if(_0x3ef9f3[_0x0c9b('0x3b')]!==_0x0c9b('0x4b')){var _0x54bbfc={};_0x54bbfc[_0x3ef9f3[_0x0c9b('0x35')]]={'$like':'%'+_0x7e5856['query']['filter']+'%'};return _0x54bbfc;}})});}_0x5b300a=_[_0x0c9b('0x4c')]({},_0x5b300a,_0x7e5856[_0x0c9b('0x4d')]);var _0x2d8ddd={'where':_0x5b300a[_0x0c9b('0x48')]};return db[_0x0c9b('0x4e')][_0x0c9b('0x2c')](_0x2d8ddd)['then'](function(_0x5307fa){_0x50dae4[_0x0c9b('0x2c')]=_0x5307fa;if(_0x7e5856[_0x0c9b('0x3e')][_0x0c9b('0x4f')]){_0x5b300a[_0x0c9b('0x50')]=[{'all':!![]}];}return db[_0x0c9b('0x4e')][_0x0c9b('0x51')](_0x5b300a);})[_0x0c9b('0x34')](function(_0x2861f9){_0x50dae4['rows']=_0x2861f9;return _0x50dae4;})['then'](respondWithFilteredResult(_0xa07a10,_0x5b300a))[_0x0c9b('0x25')](handleError(_0xa07a10,null));};exports[_0x0c9b('0x52')]=function(_0x593849,_0x120b28){var _0x55e94d={'raw':![],'where':{'id':_0x593849[_0x0c9b('0x53')]['id']}},_0x52f612={};_0x52f612[_0x0c9b('0x3d')]=_[_0x0c9b('0x3f')](db[_0x0c9b('0x4e')][_0x0c9b('0x39')]);_0x52f612[_0x0c9b('0x3e')]=_[_0x0c9b('0x3f')](_0x593849['query']);_0x52f612['filters']=_[_0x0c9b('0x42')](_0x52f612['model'],_0x52f612[_0x0c9b('0x3e')]);_0x55e94d[_0x0c9b('0x41')]=_['intersection'](_0x52f612['model'],qs['fields'](_0x593849[_0x0c9b('0x3e')][_0x0c9b('0x43')]));_0x55e94d[_0x0c9b('0x41')]=_0x55e94d['attributes'][_0x0c9b('0x44')]?_0x55e94d['attributes']:_0x52f612[_0x0c9b('0x3d')];if(_0x593849[_0x0c9b('0x3e')][_0x0c9b('0x4f')]){_0x55e94d[_0x0c9b('0x50')]=[{'all':!![]}];}_0x55e94d=_['merge']({},_0x55e94d,_0x593849['options']);return db[_0x0c9b('0x4e')][_0x0c9b('0x54')](_0x55e94d)[_0x0c9b('0x34')](handleEntityNotFound(_0x120b28,null))[_0x0c9b('0x34')](respondWithResult(_0x120b28,null))['catch'](handleError(_0x120b28,null));};exports[_0x0c9b('0x55')]=function(_0x5d7f6a,_0x255ef0){return db[_0x0c9b('0x4e')][_0x0c9b('0x55')](_0x5d7f6a[_0x0c9b('0x56')],{})[_0x0c9b('0x34')](respondWithResult(_0x255ef0,0xc9))['catch'](handleError(_0x255ef0,null));};exports['update']=function(_0x4191b8,_0x7df4c0){if(_0x4191b8[_0x0c9b('0x56')]['id']){delete _0x4191b8[_0x0c9b('0x56')]['id'];}return db['FreshsalesConfiguration'][_0x0c9b('0x54')]({'where':{'id':_0x4191b8['params']['id']}})[_0x0c9b('0x34')](handleEntityNotFound(_0x7df4c0,null))[_0x0c9b('0x34')](saveUpdates(_0x4191b8['body'],null))[_0x0c9b('0x34')](respondWithResult(_0x7df4c0,null))['catch'](handleError(_0x7df4c0,null));};exports[_0x0c9b('0x57')]=function(_0x485996,_0xa7e293){return db[_0x0c9b('0x4e')][_0x0c9b('0x54')]({'where':{'id':_0x485996[_0x0c9b('0x53')]['id']}})[_0x0c9b('0x34')](handleEntityNotFound(_0xa7e293,null))[_0x0c9b('0x34')](removeEntity(_0xa7e293,null))['catch'](handleError(_0xa7e293,null));};exports['getSubjects']=function(_0x522312,_0x44b7f1,_0x47b62f){var _0x1262ca={};var _0x12ea68={};var _0x2c10bd;var _0x31926c;return db['FreshsalesConfiguration'][_0x0c9b('0x58')]({'where':{'id':_0x522312[_0x0c9b('0x53')]['id']}})[_0x0c9b('0x34')](handleEntityNotFound(_0x44b7f1,null))[_0x0c9b('0x34')](function(_0x2bb6ca){if(_0x2bb6ca){_0x2c10bd=_0x2bb6ca;_0x12ea68[_0x0c9b('0x3d')]=_[_0x0c9b('0x3f')](db[_0x0c9b('0x59')][_0x0c9b('0x39')]);_0x12ea68[_0x0c9b('0x3e')]=_[_0x0c9b('0x3f')](_0x522312[_0x0c9b('0x3e')]);_0x12ea68[_0x0c9b('0x40')]=_[_0x0c9b('0x42')](_0x12ea68[_0x0c9b('0x3d')],_0x12ea68['query']);_0x1262ca['attributes']=_['intersection'](_0x12ea68['model'],qs[_0x0c9b('0x43')](_0x522312['query'][_0x0c9b('0x43')]));_0x1262ca[_0x0c9b('0x41')]=_0x1262ca[_0x0c9b('0x41')][_0x0c9b('0x44')]?_0x1262ca[_0x0c9b('0x41')]:_0x12ea68[_0x0c9b('0x3d')];_0x1262ca[_0x0c9b('0x46')]=qs[_0x0c9b('0x47')](_0x522312[_0x0c9b('0x3e')][_0x0c9b('0x47')]);_0x1262ca[_0x0c9b('0x48')]=qs[_0x0c9b('0x40')](_[_0x0c9b('0x49')](_0x522312['query'],_0x12ea68['filters']));if(_0x522312[_0x0c9b('0x3e')][_0x0c9b('0x4a')]){_0x1262ca[_0x0c9b('0x48')]=_[_0x0c9b('0x4c')](_0x1262ca[_0x0c9b('0x48')],{'$or':_[_0x0c9b('0x38')](_0x1262ca[_0x0c9b('0x41')],function(_0x21aca3){var _0x30f4d7={};_0x30f4d7[_0x21aca3]={'$like':'%'+_0x522312[_0x0c9b('0x3e')][_0x0c9b('0x4a')]+'%'};return _0x30f4d7;})});}_0x1262ca=_[_0x0c9b('0x4c')]({},_0x1262ca,_0x522312[_0x0c9b('0x4d')]);return _0x2c10bd[_0x0c9b('0x5a')](_0x1262ca);}})[_0x0c9b('0x34')](function(_0x4ff3e5){if(_0x4ff3e5){_0x31926c=_0x4ff3e5['length'];if(!_0x522312[_0x0c9b('0x3e')][_0x0c9b('0x5b')]('nolimit')){_0x1262ca[_0x0c9b('0x2d')]=qs[_0x0c9b('0x2d')](_0x522312[_0x0c9b('0x3e')][_0x0c9b('0x2d')]);_0x1262ca[_0x0c9b('0x2a')]=qs[_0x0c9b('0x2a')](_0x522312[_0x0c9b('0x3e')][_0x0c9b('0x2a')]);}return _0x2c10bd[_0x0c9b('0x5a')](_0x1262ca);}})[_0x0c9b('0x34')](function(_0x3ad93f){if(_0x3ad93f){return _0x3ad93f?{'count':_0x31926c,'rows':_0x3ad93f}:null;}})[_0x0c9b('0x34')](respondWithResult(_0x44b7f1,null))[_0x0c9b('0x25')](handleError(_0x44b7f1,null));};exports[_0x0c9b('0x5c')]=function(_0xdf6278,_0x3f779a,_0x378c03){var _0x32fbf2={};var _0x428850={};var _0x508d00;var _0x27b0b5;return db['FreshsalesConfiguration'][_0x0c9b('0x58')]({'where':{'id':_0xdf6278[_0x0c9b('0x53')]['id']}})['then'](handleEntityNotFound(_0x3f779a,null))[_0x0c9b('0x34')](function(_0x4159b8){if(_0x4159b8){_0x508d00=_0x4159b8;_0x428850[_0x0c9b('0x3d')]=_[_0x0c9b('0x3f')](db['FreshsalesField'][_0x0c9b('0x39')]);_0x428850['query']=_[_0x0c9b('0x3f')](_0xdf6278[_0x0c9b('0x3e')]);_0x428850[_0x0c9b('0x40')]=_['intersection'](_0x428850[_0x0c9b('0x3d')],_0x428850['query']);_0x32fbf2[_0x0c9b('0x41')]=_[_0x0c9b('0x42')](_0x428850[_0x0c9b('0x3d')],qs['fields'](_0xdf6278[_0x0c9b('0x3e')][_0x0c9b('0x43')]));_0x32fbf2[_0x0c9b('0x41')]=_0x32fbf2[_0x0c9b('0x41')][_0x0c9b('0x44')]?_0x32fbf2[_0x0c9b('0x41')]:_0x428850[_0x0c9b('0x3d')];_0x32fbf2[_0x0c9b('0x46')]=qs['sort'](_0xdf6278[_0x0c9b('0x3e')]['sort']);_0x32fbf2[_0x0c9b('0x48')]=qs[_0x0c9b('0x40')](_[_0x0c9b('0x49')](_0xdf6278[_0x0c9b('0x3e')],_0x428850['filters']));if(_0xdf6278[_0x0c9b('0x3e')][_0x0c9b('0x4a')]){_0x32fbf2[_0x0c9b('0x48')]=_[_0x0c9b('0x4c')](_0x32fbf2[_0x0c9b('0x48')],{'$or':_[_0x0c9b('0x38')](_0x32fbf2[_0x0c9b('0x41')],function(_0x3e96cb){var _0xc3a912={};_0xc3a912[_0x3e96cb]={'$like':'%'+_0xdf6278[_0x0c9b('0x3e')][_0x0c9b('0x4a')]+'%'};return _0xc3a912;})});}_0x32fbf2=_[_0x0c9b('0x4c')]({},_0x32fbf2,_0xdf6278['options']);return _0x508d00[_0x0c9b('0x5c')](_0x32fbf2);}})[_0x0c9b('0x34')](function(_0x1dc216){if(_0x1dc216){_0x27b0b5=_0x1dc216[_0x0c9b('0x44')];if(!_0xdf6278[_0x0c9b('0x3e')][_0x0c9b('0x5b')](_0x0c9b('0x45'))){_0x32fbf2[_0x0c9b('0x2d')]=qs['limit'](_0xdf6278['query']['limit']);_0x32fbf2[_0x0c9b('0x2a')]=qs['offset'](_0xdf6278[_0x0c9b('0x3e')]['offset']);}return _0x508d00['getDescriptions'](_0x32fbf2);}})['then'](function(_0x1976e6){if(_0x1976e6){return _0x1976e6?{'count':_0x27b0b5,'rows':_0x1976e6}:null;}})[_0x0c9b('0x34')](respondWithResult(_0x3f779a,null))[_0x0c9b('0x25')](handleError(_0x3f779a,null));};exports[_0x0c9b('0x5d')]=function(_0x631dec,_0x7130e9,_0x210e82){var _0x36557f={};var _0x30e4f2={};var _0x2fc339;var _0x4b2ecf;return db[_0x0c9b('0x4e')]['findOne']({'where':{'id':_0x631dec[_0x0c9b('0x53')]['id']}})[_0x0c9b('0x34')](handleEntityNotFound(_0x7130e9,null))[_0x0c9b('0x34')](function(_0x2940cf){if(_0x2940cf){_0x2fc339=_0x2940cf;_0x30e4f2[_0x0c9b('0x3d')]=_[_0x0c9b('0x3f')](db[_0x0c9b('0x59')][_0x0c9b('0x39')]);_0x30e4f2['query']=_[_0x0c9b('0x3f')](_0x631dec[_0x0c9b('0x3e')]);_0x30e4f2[_0x0c9b('0x40')]=_[_0x0c9b('0x42')](_0x30e4f2['model'],_0x30e4f2['query']);_0x36557f[_0x0c9b('0x41')]=_[_0x0c9b('0x42')](_0x30e4f2[_0x0c9b('0x3d')],qs[_0x0c9b('0x43')](_0x631dec[_0x0c9b('0x3e')]['fields']));_0x36557f[_0x0c9b('0x41')]=_0x36557f[_0x0c9b('0x41')][_0x0c9b('0x44')]?_0x36557f[_0x0c9b('0x41')]:_0x30e4f2[_0x0c9b('0x3d')];_0x36557f[_0x0c9b('0x46')]=qs[_0x0c9b('0x47')](_0x631dec[_0x0c9b('0x3e')][_0x0c9b('0x47')]);_0x36557f['where']=qs[_0x0c9b('0x40')](_[_0x0c9b('0x49')](_0x631dec['query'],_0x30e4f2['filters']));if(_0x631dec['query'][_0x0c9b('0x4a')]){_0x36557f[_0x0c9b('0x48')]=_[_0x0c9b('0x4c')](_0x36557f[_0x0c9b('0x48')],{'$or':_[_0x0c9b('0x38')](_0x36557f[_0x0c9b('0x41')],function(_0x49a481){var _0x5c4a3f={};_0x5c4a3f[_0x49a481]={'$like':'%'+_0x631dec[_0x0c9b('0x3e')][_0x0c9b('0x4a')]+'%'};return _0x5c4a3f;})});}_0x36557f=_[_0x0c9b('0x4c')]({},_0x36557f,_0x631dec['options']);return _0x2fc339[_0x0c9b('0x5d')](_0x36557f);}})['then'](function(_0x145388){if(_0x145388){_0x4b2ecf=_0x145388[_0x0c9b('0x44')];if(!_0x631dec[_0x0c9b('0x3e')]['hasOwnProperty']('nolimit')){_0x36557f[_0x0c9b('0x2d')]=qs[_0x0c9b('0x2d')](_0x631dec['query']['limit']);_0x36557f[_0x0c9b('0x2a')]=qs['offset'](_0x631dec['query'][_0x0c9b('0x2a')]);}return _0x2fc339['getFields'](_0x36557f);}})[_0x0c9b('0x34')](function(_0x2e28e2){if(_0x2e28e2){return _0x2e28e2?{'count':_0x4b2ecf,'rows':_0x2e28e2}:null;}})['then'](respondWithResult(_0x7130e9,null))[_0x0c9b('0x25')](handleError(_0x7130e9,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index afd0c7f..7b21a02 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 _0xc2e8=['lodash','util','moment','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0xc2e8,0x70));var _0x8c2e=function(_0x1f0694,_0x2e2abd){_0x1f0694=_0x1f0694-0x0;var _0x42d3bd=_0xc2e8[_0x1f0694];return _0x42d3bd;};'use strict';var _=require(_0x8c2e('0x0'));var util=require(_0x8c2e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8c2e('0x2'));var BPromise=require('bluebird');var rp=require(_0x8c2e('0x3'));var fs=require('fs');var path=require(_0x8c2e('0x4'));var rimraf=require(_0x8c2e('0x5'));var config=require('../../config/environment');var attributes=require(_0x8c2e('0x6'));module[_0x8c2e('0x7')]=function(_0x2b784d,_0x4d1434){return _0x2b784d['define']('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ec6=['int_freshsales_configurations','lodash','util','../../config/logger','moment','request-promise','rimraf','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration'];(function(_0x56aab0,_0x4afd25){var _0xa15bf4=function(_0x499049){while(--_0x499049){_0x56aab0['push'](_0x56aab0['shift']());}};_0xa15bf4(++_0x4afd25);}(_0x5ec6,0x7f));var _0x65ec=function(_0x550dd7,_0xe70d73){_0x550dd7=_0x550dd7-0x0;var _0x8044e5=_0x5ec6[_0x550dd7];return _0x8044e5;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var logger=require(_0x65ec('0x2'))('api');var moment=require(_0x65ec('0x3'));var BPromise=require('bluebird');var rp=require(_0x65ec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x65ec('0x5'));var config=require('../../config/environment');var attributes=require(_0x65ec('0x6'));module['exports']=function(_0x2fc973,_0xbb2e56){return _0x2fc973['define'](_0x65ec('0x7'),attributes,{'tableName':_0x65ec('0x8'),'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 faeaf54..ebf7e8a 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 _0x757a=['request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x490414,_0xe5877b){var _0x42273e=function(_0x267b58){while(--_0x267b58){_0x490414['push'](_0x490414['shift']());}};_0x42273e(++_0xe5877b);}(_0x757a,0xde));var _0xa757=function(_0x16d689,_0x105c9d){_0x16d689=_0x16d689-0x0;var _0x3e861f=_0x757a[_0x16d689];return _0x3e861f;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});} \ No newline at end of file +var _0xe87e=['code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0xd5fd5c,_0x3e2a66){var _0x3b0663=function(_0x40643b){while(--_0x40643b){_0xd5fd5c['push'](_0xd5fd5c['shift']());}};_0x3b0663(++_0x3e2a66);}(_0xe87e,0x17d));var _0xee87=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xe87e[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0xee87('0x0'));var util=require(_0xee87('0x1'));var moment=require(_0xee87('0x2'));var BPromise=require(_0xee87('0x3'));var rs=require(_0xee87('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee87('0x5'))['db'];var utils=require(_0xee87('0x6'));var logger=require(_0xee87('0x7'))(_0xee87('0x8'));var config=require(_0xee87('0x9'));var jayson=require(_0xee87('0xa'));var client=jayson[_0xee87('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x589c36,_0x2bde4c,_0x2ee165){return new BPromise(function(_0x2fda67,_0x71d659){return client[_0xee87('0xc')](_0x589c36,_0x2ee165)['then'](function(_0x2ed8e9){logger[_0xee87('0xd')](_0xee87('0xe'),_0x2bde4c,_0xee87('0xf'));logger['debug'](_0xee87('0x10'),_0x2bde4c,_0xee87('0xf'),JSON['stringify'](_0x2ed8e9));if(_0x2ed8e9[_0xee87('0x11')]){if(_0x2ed8e9[_0xee87('0x11')][_0xee87('0x12')]===0x1f4){logger[_0xee87('0x11')](_0xee87('0xe'),_0x2bde4c,_0x2ed8e9[_0xee87('0x11')][_0xee87('0x13')]);return _0x71d659(_0x2ed8e9[_0xee87('0x11')]['message']);}logger[_0xee87('0x11')](_0xee87('0xe'),_0x2bde4c,_0x2ed8e9['error']['message']);return _0x2fda67(_0x2ed8e9[_0xee87('0x11')][_0xee87('0x13')]);}else{logger['info'](_0xee87('0xe'),_0x2bde4c,_0xee87('0xf'));_0x2fda67(_0x2ed8e9[_0xee87('0x14')][_0xee87('0x13')]);}})['catch'](function(_0x290968){logger['error'](_0xee87('0xe'),_0x2bde4c,_0x290968);_0x71d659(_0x290968);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 3493101..0d6df18 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 _0x1be1=['fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','show','post','create','/:id','delete','destroy','path','connect-timeout','Router'];(function(_0x110c61,_0x4da2e4){var _0x690e16=function(_0x335acd){while(--_0x335acd){_0x110c61['push'](_0x110c61['shift']());}};_0x690e16(++_0x4da2e4);}(_0x1be1,0x192));var _0x11be=function(_0x17f346,_0x1a8787){_0x17f346=_0x17f346-0x0;var _0x4288d9=_0x1be1[_0x17f346];return _0x4288d9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/:id',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0xa')]('/',auth[_0x11be('0x8')](),controller[_0x11be('0xb')]);router['put'](_0x11be('0xc'),auth[_0x11be('0x8')](),controller['update']);router[_0x11be('0xd')](_0x11be('0xc'),auth[_0x11be('0x8')](),controller[_0x11be('0xe')]);module['exports']=router; \ No newline at end of file +var _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xc0bbc3,_0x3702df){var _0x4fa138=function(_0x41b58a){while(--_0x41b58a){_0xc0bbc3['push'](_0xc0bbc3['shift']());}};_0x4fa138(++_0x3702df);}(_0xac4a,0x13f));var _0xaac4=function(_0x42dcc7,_0x3f8474){_0x42dcc7=_0x42dcc7-0x0;var _0x27efc9=_0xac4a[_0x42dcc7];return _0x27efc9;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index f01257f..270ec15 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 _0xd67b=['STRING','ENUM','BOOLEAN','exports','string','variable','customVariable','picklist'];(function(_0x17ead5,_0x46a287){var _0x4c4441=function(_0x3d978c){while(--_0x3d978c){_0x17ead5['push'](_0x17ead5['shift']());}};_0x4c4441(++_0x46a287);}(_0xd67b,0x133));var _0xbd67=function(_0x536d84,_0x5591af){_0x536d84=_0x536d84-0x0;var _0x2de977=_0xd67b[_0x536d84];return _0x2de977;};'use strict';var Sequelize=require('sequelize');module[_0xbd67('0x0')]={'type':{'type':Sequelize['ENUM'](_0xbd67('0x1'),_0xbd67('0x2'),_0xbd67('0x3'),'keyValue',_0xbd67('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbd67('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbd67('0x6')](_0xbd67('0x1'),_0xbd67('0x2'),_0xbd67('0x3'))},'keyContent':{'type':Sequelize[_0xbd67('0x5')]},'idField':{'type':Sequelize[_0xbd67('0x5')]},'nameField':{'type':Sequelize[_0xbd67('0x5')]},'customField':{'type':Sequelize[_0xbd67('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd67('0x5')]}}; \ No newline at end of file +var _0xdc97=['picklist','STRING','string','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x4998bd,_0x505b2a){var _0x3f8ce4=function(_0x9930ea){while(--_0x9930ea){_0x4998bd['push'](_0x4998bd['shift']());}};_0x3f8ce4(++_0x505b2a);}(_0xdc97,0x13b));var _0x7dc9=function(_0x4f0666,_0x38c2ec){_0x4f0666=_0x4f0666-0x0;var _0x3bbd03=_0xdc97[_0x4f0666];return _0x3bbd03;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'type':{'type':Sequelize[_0x7dc9('0x2')]('string',_0x7dc9('0x3'),'customVariable',_0x7dc9('0x4'),_0x7dc9('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7dc9('0x6')]},'key':{'type':Sequelize[_0x7dc9('0x6')]},'keyType':{'type':Sequelize[_0x7dc9('0x2')](_0x7dc9('0x7'),'variable',_0x7dc9('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7dc9('0x6')]},'customField':{'type':Sequelize[_0x7dc9('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7dc9('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index f97e9de..d2bf208 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 _0xf4a1=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','name','map','FreshsalesField','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','length','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x4b7c0b,_0x3f1145){var _0x4236b4=function(_0x54af6a){while(--_0x54af6a){_0x4b7c0b['push'](_0x4b7c0b['shift']());}};_0x4236b4(++_0x3f1145);}(_0xf4a1,0x1af));var _0x1f4a=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0xf4a1[_0x5d8018];return _0x151ac4;};'use strict';var emlformat=require(_0x1f4a('0x0'));var rimraf=require(_0x1f4a('0x1'));var zipdir=require(_0x1f4a('0x2'));var jsonpatch=require(_0x1f4a('0x3'));var rp=require(_0x1f4a('0x4'));var moment=require(_0x1f4a('0x5'));var BPromise=require(_0x1f4a('0x6'));var Mustache=require(_0x1f4a('0x7'));var util=require(_0x1f4a('0x8'));var path=require(_0x1f4a('0x9'));var sox=require(_0x1f4a('0xa'));var csv=require(_0x1f4a('0xb'));var ejs=require(_0x1f4a('0xc'));var fs=require('fs');var fs_extra=require(_0x1f4a('0xd'));var _=require(_0x1f4a('0xe'));var squel=require(_0x1f4a('0xf'));var crypto=require('crypto');var jsforce=require(_0x1f4a('0x10'));var deskjs=require(_0x1f4a('0x11'));var toCsv=require(_0x1f4a('0xb'));var querystring=require(_0x1f4a('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1f4a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f4a('0x14'));var logger=require(_0x1f4a('0x15'))(_0x1f4a('0x16'));var utils=require(_0x1f4a('0x17'));var config=require(_0x1f4a('0x18'));var licenseUtil=require(_0x1f4a('0x19'));var db=require(_0x1f4a('0x1a'))['db'];function respondWithStatusCode(_0x14a83b,_0x41f31e){_0x41f31e=_0x41f31e||0xcc;return function(_0x10600b){if(_0x10600b){return _0x14a83b[_0x1f4a('0x1b')](_0x41f31e);}return _0x14a83b[_0x1f4a('0x1c')](_0x41f31e)['end']();};}function respondWithResult(_0x376ec3,_0x3d9ac4){_0x3d9ac4=_0x3d9ac4||0xc8;return function(_0x54220b){if(_0x54220b){return _0x376ec3[_0x1f4a('0x1c')](_0x3d9ac4)[_0x1f4a('0x1d')](_0x54220b);}};}function respondWithFilteredResult(_0x23e778,_0x4da9ca){return function(_0x5eba80){if(_0x5eba80){var _0x48df80=typeof _0x4da9ca[_0x1f4a('0x1e')]===_0x1f4a('0x1f')&&typeof _0x4da9ca[_0x1f4a('0x20')]==='undefined';var _0x35b26a=_0x5eba80[_0x1f4a('0x21')];var _0x75c95f=_0x48df80?0x0:_0x4da9ca[_0x1f4a('0x1e')];var _0x12066e=_0x48df80?_0x5eba80[_0x1f4a('0x21')]:_0x4da9ca[_0x1f4a('0x1e')]+_0x4da9ca['limit'];var _0x714843;if(_0x12066e>=_0x35b26a){_0x12066e=_0x35b26a;_0x714843=0xc8;}else{_0x714843=0xce;}_0x23e778['status'](_0x714843);return _0x23e778[_0x1f4a('0x22')]('Content-Range',_0x75c95f+'-'+_0x12066e+'/'+_0x35b26a)[_0x1f4a('0x1d')](_0x5eba80);}return null;};}function patchUpdates(_0x2af5fe){return function(_0x339263){try{jsonpatch[_0x1f4a('0x23')](_0x339263,_0x2af5fe,!![]);}catch(_0x197061){return BPromise[_0x1f4a('0x24')](_0x197061);}return _0x339263[_0x1f4a('0x25')]();};}function saveUpdates(_0x4e7e10,_0x49a1b5){return function(_0xcb350d){if(_0xcb350d){return _0xcb350d['update'](_0x4e7e10)[_0x1f4a('0x26')](function(_0x7308c5){return _0x7308c5;});}return null;};}function removeEntity(_0x45b565,_0x8b6e2){return function(_0x4fbc12){if(_0x4fbc12){return _0x4fbc12[_0x1f4a('0x27')]()['then'](function(){_0x45b565['status'](0xcc)[_0x1f4a('0x28')]();});}};}function handleEntityNotFound(_0x116490,_0x71e7d){return function(_0x48c93c){if(!_0x48c93c){_0x116490[_0x1f4a('0x1b')](0x194);}return _0x48c93c;};}function handleError(_0x47e07c,_0x538ac6){_0x538ac6=_0x538ac6||0x1f4;return function(_0x4f6015){logger[_0x1f4a('0x29')](_0x4f6015['stack']);if(_0x4f6015['name']){delete _0x4f6015[_0x1f4a('0x2a')];}_0x47e07c[_0x1f4a('0x1c')](_0x538ac6)['send'](_0x4f6015);};}exports['index']=function(_0xa4db28,_0x345ca6){var _0x256392={},_0x399dec={},_0x309381={'count':0x0,'rows':[]};var _0x489a96=_[_0x1f4a('0x2b')](db[_0x1f4a('0x2c')][_0x1f4a('0x2d')],function(_0x4dcdea){return{'name':_0x4dcdea[_0x1f4a('0x2e')],'type':_0x4dcdea[_0x1f4a('0x2f')]['key']};});_0x399dec[_0x1f4a('0x30')]=_[_0x1f4a('0x2b')](_0x489a96,_0x1f4a('0x2a'));_0x399dec['query']=_[_0x1f4a('0x31')](_0xa4db28[_0x1f4a('0x32')]);_0x399dec[_0x1f4a('0x33')]=_[_0x1f4a('0x34')](_0x399dec[_0x1f4a('0x30')],_0x399dec['query']);_0x256392[_0x1f4a('0x35')]=_['intersection'](_0x399dec['model'],qs[_0x1f4a('0x36')](_0xa4db28[_0x1f4a('0x32')][_0x1f4a('0x36')]));_0x256392[_0x1f4a('0x35')]=_0x256392[_0x1f4a('0x35')]['length']?_0x256392[_0x1f4a('0x35')]:_0x399dec[_0x1f4a('0x30')];if(!_0xa4db28['query']['hasOwnProperty'](_0x1f4a('0x37'))){_0x256392[_0x1f4a('0x20')]=qs[_0x1f4a('0x20')](_0xa4db28[_0x1f4a('0x32')][_0x1f4a('0x20')]);_0x256392['offset']=qs[_0x1f4a('0x1e')](_0xa4db28[_0x1f4a('0x32')][_0x1f4a('0x1e')]);}_0x256392[_0x1f4a('0x38')]=qs[_0x1f4a('0x39')](_0xa4db28[_0x1f4a('0x32')][_0x1f4a('0x39')]);_0x256392[_0x1f4a('0x3a')]=qs['filters'](_[_0x1f4a('0x3b')](_0xa4db28[_0x1f4a('0x32')],_0x399dec[_0x1f4a('0x33')]),_0x489a96);if(_0xa4db28[_0x1f4a('0x32')][_0x1f4a('0x3c')]){_0x256392[_0x1f4a('0x3a')]=_['merge'](_0x256392[_0x1f4a('0x3a')],{'$or':_[_0x1f4a('0x2b')](_0x489a96,function(_0x4a93c3){if(_0x4a93c3[_0x1f4a('0x2f')]!==_0x1f4a('0x3d')){var _0x18fb08={};_0x18fb08[_0x4a93c3['name']]={'$like':'%'+_0xa4db28[_0x1f4a('0x32')][_0x1f4a('0x3c')]+'%'};return _0x18fb08;}})});}_0x256392=_[_0x1f4a('0x3e')]({},_0x256392,_0xa4db28['options']);var _0xce7e38={'where':_0x256392[_0x1f4a('0x3a')]};return db['FreshsalesField'][_0x1f4a('0x21')](_0xce7e38)['then'](function(_0x4058eb){_0x309381['count']=_0x4058eb;if(_0xa4db28[_0x1f4a('0x32')][_0x1f4a('0x3f')]){_0x256392[_0x1f4a('0x40')]=[{'all':!![]}];}return db[_0x1f4a('0x2c')][_0x1f4a('0x41')](_0x256392);})[_0x1f4a('0x26')](function(_0x261c65){_0x309381[_0x1f4a('0x42')]=_0x261c65;return _0x309381;})['then'](respondWithFilteredResult(_0x345ca6,_0x256392))['catch'](handleError(_0x345ca6,null));};exports[_0x1f4a('0x43')]=function(_0x46a59e,_0x4b793e){var _0x3327d0={'raw':!![],'where':{'id':_0x46a59e['params']['id']}},_0x16228b={};_0x16228b[_0x1f4a('0x30')]=_[_0x1f4a('0x31')](db['FreshsalesField'][_0x1f4a('0x2d')]);_0x16228b[_0x1f4a('0x32')]=_[_0x1f4a('0x31')](_0x46a59e['query']);_0x16228b[_0x1f4a('0x33')]=_[_0x1f4a('0x34')](_0x16228b[_0x1f4a('0x30')],_0x16228b[_0x1f4a('0x32')]);_0x3327d0[_0x1f4a('0x35')]=_[_0x1f4a('0x34')](_0x16228b[_0x1f4a('0x30')],qs[_0x1f4a('0x36')](_0x46a59e['query']['fields']));_0x3327d0[_0x1f4a('0x35')]=_0x3327d0[_0x1f4a('0x35')][_0x1f4a('0x44')]?_0x3327d0['attributes']:_0x16228b[_0x1f4a('0x30')];if(_0x46a59e[_0x1f4a('0x32')][_0x1f4a('0x3f')]){_0x3327d0['include']=[{'all':!![]}];}_0x3327d0=_['merge']({},_0x3327d0,_0x46a59e[_0x1f4a('0x45')]);return db['FreshsalesField'][_0x1f4a('0x46')](_0x3327d0)[_0x1f4a('0x26')](handleEntityNotFound(_0x4b793e,null))[_0x1f4a('0x26')](respondWithResult(_0x4b793e,null))[_0x1f4a('0x47')](handleError(_0x4b793e,null));};exports['create']=function(_0x2b07b4,_0x2286f0){return db['FreshsalesField']['create'](_0x2b07b4['body'],{})[_0x1f4a('0x26')](respondWithResult(_0x2286f0,0xc9))[_0x1f4a('0x47')](handleError(_0x2286f0,null));};exports['update']=function(_0x49e0df,_0x1a8782){if(_0x49e0df[_0x1f4a('0x48')]['id']){delete _0x49e0df[_0x1f4a('0x48')]['id'];}return db[_0x1f4a('0x2c')][_0x1f4a('0x46')]({'where':{'id':_0x49e0df['params']['id']}})[_0x1f4a('0x26')](handleEntityNotFound(_0x1a8782,null))[_0x1f4a('0x26')](saveUpdates(_0x49e0df[_0x1f4a('0x48')],null))[_0x1f4a('0x26')](respondWithResult(_0x1a8782,null))['catch'](handleError(_0x1a8782,null));};exports[_0x1f4a('0x27')]=function(_0x759bb9,_0x5216f9){return db[_0x1f4a('0x2c')][_0x1f4a('0x46')]({'where':{'id':_0x759bb9['params']['id']}})['then'](handleEntityNotFound(_0x5216f9,null))[_0x1f4a('0x26')](removeEntity(_0x5216f9,null))['catch'](handleError(_0x5216f9,null));}; \ No newline at end of file +var _0xad15=['FreshsalesField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map'];(function(_0x4c5034,_0x264da9){var _0x139f2f=function(_0x5544d7){while(--_0x5544d7){_0x4c5034['push'](_0x4c5034['shift']());}};_0x139f2f(++_0x264da9);}(_0xad15,0x1ca));var _0x5ad1=function(_0x3d71ba,_0x49a38b){_0x3d71ba=_0x3d71ba-0x0;var _0x5e0ed0=_0xad15[_0x3d71ba];return _0x5e0ed0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ad1('0x0'));var zipdir=require(_0x5ad1('0x1'));var jsonpatch=require(_0x5ad1('0x2'));var rp=require(_0x5ad1('0x3'));var moment=require('moment');var BPromise=require(_0x5ad1('0x4'));var Mustache=require('mustache');var util=require(_0x5ad1('0x5'));var path=require(_0x5ad1('0x6'));var sox=require(_0x5ad1('0x7'));var csv=require(_0x5ad1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ad1('0x9'));var _=require(_0x5ad1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5ad1('0xb'));var toCsv=require(_0x5ad1('0x8'));var querystring=require(_0x5ad1('0xc'));var Papa=require('papaparse');var Redis=require(_0x5ad1('0xd'));var authService=require(_0x5ad1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5ad1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ad1('0x10'))(_0x5ad1('0x11'));var utils=require(_0x5ad1('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5ad1('0x13'));var db=require(_0x5ad1('0x14'))['db'];function respondWithStatusCode(_0x3d34a8,_0x542170){_0x542170=_0x542170||0xcc;return function(_0x43c07e){if(_0x43c07e){return _0x3d34a8['sendStatus'](_0x542170);}return _0x3d34a8['status'](_0x542170)[_0x5ad1('0x15')]();};}function respondWithResult(_0x4d50b2,_0x235845){_0x235845=_0x235845||0xc8;return function(_0x31dde0){if(_0x31dde0){return _0x4d50b2[_0x5ad1('0x16')](_0x235845)[_0x5ad1('0x17')](_0x31dde0);}};}function respondWithFilteredResult(_0x28ab7b,_0x3baeec){return function(_0xb4272f){if(_0xb4272f){var _0x3d7eaa=typeof _0x3baeec[_0x5ad1('0x18')]==='undefined'&&typeof _0x3baeec[_0x5ad1('0x19')]==='undefined';var _0x1e7972=_0xb4272f[_0x5ad1('0x1a')];var _0x2cc940=_0x3d7eaa?0x0:_0x3baeec[_0x5ad1('0x18')];var _0x9d84a8=_0x3d7eaa?_0xb4272f[_0x5ad1('0x1a')]:_0x3baeec['offset']+_0x3baeec['limit'];var _0xbc7807;if(_0x9d84a8>=_0x1e7972){_0x9d84a8=_0x1e7972;_0xbc7807=0xc8;}else{_0xbc7807=0xce;}_0x28ab7b[_0x5ad1('0x16')](_0xbc7807);return _0x28ab7b['set']('Content-Range',_0x2cc940+'-'+_0x9d84a8+'/'+_0x1e7972)['json'](_0xb4272f);}return null;};}function patchUpdates(_0xc4ad5b){return function(_0x371ed1){try{jsonpatch[_0x5ad1('0x1b')](_0x371ed1,_0xc4ad5b,!![]);}catch(_0x54e8ff){return BPromise[_0x5ad1('0x1c')](_0x54e8ff);}return _0x371ed1[_0x5ad1('0x1d')]();};}function saveUpdates(_0x496263,_0xe045af){return function(_0x5ba348){if(_0x5ba348){return _0x5ba348[_0x5ad1('0x1e')](_0x496263)[_0x5ad1('0x1f')](function(_0x577530){return _0x577530;});}return null;};}function removeEntity(_0x2df109,_0x1db620){return function(_0xe9ffe6){if(_0xe9ffe6){return _0xe9ffe6[_0x5ad1('0x20')]()['then'](function(){_0x2df109[_0x5ad1('0x16')](0xcc)[_0x5ad1('0x15')]();});}};}function handleEntityNotFound(_0x28be24,_0x4cd238){return function(_0x5ebaec){if(!_0x5ebaec){_0x28be24[_0x5ad1('0x21')](0x194);}return _0x5ebaec;};}function handleError(_0x4e9ab3,_0x5b0d98){_0x5b0d98=_0x5b0d98||0x1f4;return function(_0x3e0db2){logger[_0x5ad1('0x22')](_0x3e0db2[_0x5ad1('0x23')]);if(_0x3e0db2[_0x5ad1('0x24')]){delete _0x3e0db2[_0x5ad1('0x24')];}_0x4e9ab3[_0x5ad1('0x16')](_0x5b0d98)['send'](_0x3e0db2);};}exports[_0x5ad1('0x25')]=function(_0x399507,_0x55d85c){var _0x513739={},_0x5a3fe1={},_0x20bb18={'count':0x0,'rows':[]};var _0xabc541=_[_0x5ad1('0x26')](db[_0x5ad1('0x27')][_0x5ad1('0x28')],function(_0x5ed37e){return{'name':_0x5ed37e[_0x5ad1('0x29')],'type':_0x5ed37e['type'][_0x5ad1('0x2a')]};});_0x5a3fe1[_0x5ad1('0x2b')]=_[_0x5ad1('0x26')](_0xabc541,_0x5ad1('0x24'));_0x5a3fe1[_0x5ad1('0x2c')]=_[_0x5ad1('0x2d')](_0x399507['query']);_0x5a3fe1[_0x5ad1('0x2e')]=_[_0x5ad1('0x2f')](_0x5a3fe1['model'],_0x5a3fe1['query']);_0x513739[_0x5ad1('0x30')]=_[_0x5ad1('0x2f')](_0x5a3fe1[_0x5ad1('0x2b')],qs[_0x5ad1('0x31')](_0x399507[_0x5ad1('0x2c')][_0x5ad1('0x31')]));_0x513739[_0x5ad1('0x30')]=_0x513739[_0x5ad1('0x30')][_0x5ad1('0x32')]?_0x513739[_0x5ad1('0x30')]:_0x5a3fe1[_0x5ad1('0x2b')];if(!_0x399507[_0x5ad1('0x2c')][_0x5ad1('0x33')](_0x5ad1('0x34'))){_0x513739['limit']=qs[_0x5ad1('0x19')](_0x399507[_0x5ad1('0x2c')][_0x5ad1('0x19')]);_0x513739[_0x5ad1('0x18')]=qs[_0x5ad1('0x18')](_0x399507[_0x5ad1('0x2c')][_0x5ad1('0x18')]);}_0x513739[_0x5ad1('0x35')]=qs[_0x5ad1('0x36')](_0x399507[_0x5ad1('0x2c')][_0x5ad1('0x36')]);_0x513739['where']=qs[_0x5ad1('0x2e')](_[_0x5ad1('0x37')](_0x399507[_0x5ad1('0x2c')],_0x5a3fe1[_0x5ad1('0x2e')]),_0xabc541);if(_0x399507['query'][_0x5ad1('0x38')]){_0x513739[_0x5ad1('0x39')]=_[_0x5ad1('0x3a')](_0x513739[_0x5ad1('0x39')],{'$or':_['map'](_0xabc541,function(_0x5c1351){if(_0x5c1351[_0x5ad1('0x3b')]!==_0x5ad1('0x3c')){var _0x181f08={};_0x181f08[_0x5c1351[_0x5ad1('0x24')]]={'$like':'%'+_0x399507[_0x5ad1('0x2c')][_0x5ad1('0x38')]+'%'};return _0x181f08;}})});}_0x513739=_[_0x5ad1('0x3a')]({},_0x513739,_0x399507[_0x5ad1('0x3d')]);var _0x3f95a1={'where':_0x513739[_0x5ad1('0x39')]};return db['FreshsalesField'][_0x5ad1('0x1a')](_0x3f95a1)[_0x5ad1('0x1f')](function(_0x63cf37){_0x20bb18[_0x5ad1('0x1a')]=_0x63cf37;if(_0x399507[_0x5ad1('0x2c')][_0x5ad1('0x3e')]){_0x513739[_0x5ad1('0x3f')]=[{'all':!![]}];}return db[_0x5ad1('0x27')][_0x5ad1('0x40')](_0x513739);})[_0x5ad1('0x1f')](function(_0x31b113){_0x20bb18[_0x5ad1('0x41')]=_0x31b113;return _0x20bb18;})[_0x5ad1('0x1f')](respondWithFilteredResult(_0x55d85c,_0x513739))[_0x5ad1('0x42')](handleError(_0x55d85c,null));};exports['show']=function(_0x4c7274,_0x344d12){var _0x7ff954={'raw':!![],'where':{'id':_0x4c7274['params']['id']}},_0x3fa377={};_0x3fa377[_0x5ad1('0x2b')]=_[_0x5ad1('0x2d')](db[_0x5ad1('0x27')][_0x5ad1('0x28')]);_0x3fa377[_0x5ad1('0x2c')]=_['keys'](_0x4c7274[_0x5ad1('0x2c')]);_0x3fa377[_0x5ad1('0x2e')]=_[_0x5ad1('0x2f')](_0x3fa377[_0x5ad1('0x2b')],_0x3fa377['query']);_0x7ff954['attributes']=_['intersection'](_0x3fa377[_0x5ad1('0x2b')],qs['fields'](_0x4c7274[_0x5ad1('0x2c')][_0x5ad1('0x31')]));_0x7ff954[_0x5ad1('0x30')]=_0x7ff954[_0x5ad1('0x30')][_0x5ad1('0x32')]?_0x7ff954['attributes']:_0x3fa377[_0x5ad1('0x2b')];if(_0x4c7274['query']['includeAll']){_0x7ff954[_0x5ad1('0x3f')]=[{'all':!![]}];}_0x7ff954=_[_0x5ad1('0x3a')]({},_0x7ff954,_0x4c7274[_0x5ad1('0x3d')]);return db[_0x5ad1('0x27')][_0x5ad1('0x43')](_0x7ff954)[_0x5ad1('0x1f')](handleEntityNotFound(_0x344d12,null))[_0x5ad1('0x1f')](respondWithResult(_0x344d12,null))[_0x5ad1('0x42')](handleError(_0x344d12,null));};exports[_0x5ad1('0x44')]=function(_0x189b38,_0x46e9f3){return db[_0x5ad1('0x27')][_0x5ad1('0x44')](_0x189b38[_0x5ad1('0x45')],{})[_0x5ad1('0x1f')](respondWithResult(_0x46e9f3,0xc9))[_0x5ad1('0x42')](handleError(_0x46e9f3,null));};exports[_0x5ad1('0x1e')]=function(_0x335cc3,_0x1578ea){if(_0x335cc3[_0x5ad1('0x45')]['id']){delete _0x335cc3['body']['id'];}return db[_0x5ad1('0x27')][_0x5ad1('0x43')]({'where':{'id':_0x335cc3[_0x5ad1('0x46')]['id']}})['then'](handleEntityNotFound(_0x1578ea,null))[_0x5ad1('0x1f')](saveUpdates(_0x335cc3[_0x5ad1('0x45')],null))[_0x5ad1('0x1f')](respondWithResult(_0x1578ea,null))[_0x5ad1('0x42')](handleError(_0x1578ea,null));};exports[_0x5ad1('0x20')]=function(_0x1c628d,_0x54a9d9){return db[_0x5ad1('0x27')][_0x5ad1('0x43')]({'where':{'id':_0x1c628d[_0x5ad1('0x46')]['id']}})[_0x5ad1('0x1f')](handleEntityNotFound(_0x54a9d9,null))[_0x5ad1('0x1f')](removeEntity(_0x54a9d9,null))[_0x5ad1('0x42')](handleError(_0x54a9d9,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 9cb81e4..90874eb 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 _0xe72e=['define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xe72e,0x119));var _0xee72=function(_0x143cd5,_0x46be90){_0x143cd5=_0x143cd5-0x0;var _0x41f15f=_0xe72e[_0x143cd5];return _0x41f15f;};'use strict';var _=require(_0xee72('0x0'));var util=require(_0xee72('0x1'));var logger=require(_0xee72('0x2'))(_0xee72('0x3'));var moment=require(_0xee72('0x4'));var BPromise=require(_0xee72('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xee72('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0xf8fe3b,_0x1a0d8e){return _0xf8fe3b[_0xee72('0x7')](_0xee72('0x8'),attributes,{'tableName':_0xee72('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xee72('0xa'),_0xee72('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c2e=['./intFreshsalesField.attributes','define','FreshsalesField','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1c2e,0x186));var _0xe1c2=function(_0x3d7978,_0x59f051){_0x3d7978=_0x3d7978-0x0;var _0x33dd50=_0x1c2e[_0x3d7978];return _0x33dd50;};'use strict';var _=require('lodash');var util=require(_0xe1c2('0x0'));var logger=require(_0xe1c2('0x1'))('api');var moment=require(_0xe1c2('0x2'));var BPromise=require(_0xe1c2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1c2('0x4'));var rimraf=require('rimraf');var config=require(_0xe1c2('0x5'));var attributes=require(_0xe1c2('0x6'));module['exports']=function(_0x564500,_0x1cf122){return _0x564500[_0xe1c2('0x7')](_0xe1c2('0x8'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField','FieldId'],'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 247c080..780c0d1 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 _0xaac2=['stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaac2,0x1eb));var _0x2aac=function(_0x3233c9,_0x2b1b66){_0x3233c9=_0x3233c9-0x0;var _0x4dbd10=_0xaac2[_0x3233c9];return _0x4dbd10;};'use strict';var _=require(_0x2aac('0x0'));var util=require('util');var moment=require(_0x2aac('0x1'));var BPromise=require(_0x2aac('0x2'));var rs=require(_0x2aac('0x3'));var fs=require('fs');var Redis=require(_0x2aac('0x4'));var db=require(_0x2aac('0x5'))['db'];var utils=require(_0x2aac('0x6'));var logger=require(_0x2aac('0x7'))(_0x2aac('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2aac('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53e009,_0x479797,_0x10e0b3){return new BPromise(function(_0x4c999d,_0x1ec4f2){return client[_0x2aac('0xa')](_0x53e009,_0x10e0b3)[_0x2aac('0xb')](function(_0x3c3a7e){logger['info'](_0x2aac('0xc'),_0x479797,_0x2aac('0xd'));logger['debug'](_0x2aac('0xe'),_0x479797,_0x2aac('0xd'),JSON[_0x2aac('0xf')](_0x3c3a7e));if(_0x3c3a7e[_0x2aac('0x10')]){if(_0x3c3a7e[_0x2aac('0x10')][_0x2aac('0x11')]===0x1f4){logger[_0x2aac('0x10')](_0x2aac('0xc'),_0x479797,_0x3c3a7e['error'][_0x2aac('0x12')]);return _0x1ec4f2(_0x3c3a7e['error'][_0x2aac('0x12')]);}logger[_0x2aac('0x10')](_0x2aac('0xc'),_0x479797,_0x3c3a7e['error'][_0x2aac('0x12')]);return _0x4c999d(_0x3c3a7e[_0x2aac('0x10')][_0x2aac('0x12')]);}else{logger[_0x2aac('0x13')](_0x2aac('0xc'),_0x479797,_0x2aac('0xd'));_0x4c999d(_0x3c3a7e[_0x2aac('0x14')]['message']);}})[_0x2aac('0x15')](function(_0x35b326){logger[_0x2aac('0x10')](_0x2aac('0xc'),_0x479797,_0x35b326);_0x1ec4f2(_0x35b326);});});} \ No newline at end of file +var _0x1d89=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5eb545,_0x2b0213){var _0x566aa3=function(_0x296898){while(--_0x296898){_0x5eb545['push'](_0x5eb545['shift']());}};_0x566aa3(++_0x2b0213);}(_0x1d89,0x179));var _0x91d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d89[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x91d8('0x0'));var util=require(_0x91d8('0x1'));var moment=require(_0x91d8('0x2'));var BPromise=require(_0x91d8('0x3'));var rs=require(_0x91d8('0x4'));var fs=require('fs');var Redis=require(_0x91d8('0x5'));var db=require(_0x91d8('0x6'))['db'];var utils=require(_0x91d8('0x7'));var logger=require('../../config/logger')(_0x91d8('0x8'));var config=require(_0x91d8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x91d8('0xa')][_0x91d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5079f1,_0x2e8b3a,_0xaa684d){return new BPromise(function(_0x3cb587,_0x169136){return client[_0x91d8('0xc')](_0x5079f1,_0xaa684d)[_0x91d8('0xd')](function(_0x43ee7d){logger[_0x91d8('0xe')](_0x91d8('0xf'),_0x2e8b3a,_0x91d8('0x10'));logger[_0x91d8('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2e8b3a,_0x91d8('0x10'),JSON[_0x91d8('0x12')](_0x43ee7d));if(_0x43ee7d[_0x91d8('0x13')]){if(_0x43ee7d[_0x91d8('0x13')][_0x91d8('0x14')]===0x1f4){logger[_0x91d8('0x13')](_0x91d8('0xf'),_0x2e8b3a,_0x43ee7d[_0x91d8('0x13')][_0x91d8('0x15')]);return _0x169136(_0x43ee7d['error'][_0x91d8('0x15')]);}logger[_0x91d8('0x13')](_0x91d8('0xf'),_0x2e8b3a,_0x43ee7d['error'][_0x91d8('0x15')]);return _0x3cb587(_0x43ee7d[_0x91d8('0x13')][_0x91d8('0x15')]);}else{logger[_0x91d8('0xe')](_0x91d8('0xf'),_0x2e8b3a,_0x91d8('0x10'));_0x3cb587(_0x43ee7d[_0x91d8('0x16')]['message']);}})[_0x91d8('0x17')](function(_0x464171){logger[_0x91d8('0x13')](_0x91d8('0xf'),_0x2e8b3a,_0x464171);_0x169136(_0x464171);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 80b7a73..a5feb02 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 _0xbab5=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xbab5,0x138));var _0x5bab=function(_0x25bfce,_0x288e69){_0x25bfce=_0x25bfce-0x0;var _0x2ab6eb=_0xbab5[_0x25bfce];return _0x2ab6eb;};'use strict';var multer=require(_0x5bab('0x0'));var util=require(_0x5bab('0x1'));var path=require('path');var timeout=require(_0x5bab('0x2'));var express=require(_0x5bab('0x3'));var router=express[_0x5bab('0x4')]();var fs_extra=require(_0x5bab('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5bab('0x6'));var config=require('../../config/environment');var controller=require(_0x5bab('0x7'));router[_0x5bab('0x8')]('/',auth[_0x5bab('0x9')](),controller[_0x5bab('0xa')]);router[_0x5bab('0x8')](_0x5bab('0xb'),auth[_0x5bab('0x9')](),controller['show']);router[_0x5bab('0x8')](_0x5bab('0xc'),auth[_0x5bab('0x9')](),controller[_0x5bab('0xd')]);router[_0x5bab('0x8')](_0x5bab('0xe'),auth['isAuthenticated'](),controller[_0x5bab('0xf')]);router[_0x5bab('0x10')]('/',auth[_0x5bab('0x9')](),controller['create']);router[_0x5bab('0x10')](_0x5bab('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x5bab('0x11')](_0x5bab('0xb'),auth[_0x5bab('0x9')](),controller[_0x5bab('0x12')]);router[_0x5bab('0x13')](_0x5bab('0xb'),auth['isAuthenticated'](),controller[_0x5bab('0x14')]);module[_0x5bab('0x15')]=router; \ No newline at end of file +var _0x63a2=['isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x63a2,0x14d));var _0x263a=function(_0x3802cd,_0x15acd9){_0x3802cd=_0x3802cd-0x0;var _0x21dd68=_0x63a2[_0x3802cd];return _0x21dd68;};'use strict';var multer=require(_0x263a('0x0'));var util=require(_0x263a('0x1'));var path=require(_0x263a('0x2'));var timeout=require(_0x263a('0x3'));var express=require('express');var router=express[_0x263a('0x4')]();var fs_extra=require(_0x263a('0x5'));var auth=require(_0x263a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x263a('0x7'));var controller=require(_0x263a('0x8'));router[_0x263a('0x9')]('/',auth['isAuthenticated'](),controller[_0x263a('0xa')]);router['get'](_0x263a('0xb'),auth[_0x263a('0xc')](),controller[_0x263a('0xd')]);router[_0x263a('0x9')](_0x263a('0xe'),auth[_0x263a('0xc')](),controller[_0x263a('0xf')]);router[_0x263a('0x9')](_0x263a('0x10'),auth[_0x263a('0xc')](),controller[_0x263a('0x11')]);router[_0x263a('0x12')]('/',auth[_0x263a('0xc')](),controller[_0x263a('0x13')]);router[_0x263a('0x12')](_0x263a('0xe'),auth[_0x263a('0xc')](),controller['addConfiguration']);router[_0x263a('0x14')](_0x263a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x263a('0x15')](_0x263a('0xb'),auth[_0x263a('0xc')](),controller['destroy']);module[_0x263a('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 79c68e0..0d23f2f 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 _0xd9c4=['ENUM','integrationTab','sequelize','exports','STRING','username'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd9c4,0x176));var _0x4d9c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd9c4[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x4d9c('0x0'));module[_0x4d9c('0x1')]={'name':{'type':Sequelize[_0x4d9c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d9c('0x2')],'unique':_0x4d9c('0x3')},'remoteUri':{'type':Sequelize[_0x4d9c('0x2')]},'password':{'type':Sequelize[_0x4d9c('0x2')]},'clientId':{'type':Sequelize[_0x4d9c('0x2')]},'clientSecret':{'type':Sequelize[_0x4d9c('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x4d9c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4d9c('0x4')](_0x4d9c('0x5'),'newTab'),'defaultValue':_0x4d9c('0x5')}}; \ No newline at end of file +var _0x79d4=['ENUM','newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x4e6975,_0x124473){var _0xea3fbf=function(_0x418860){while(--_0x418860){_0x4e6975['push'](_0x4e6975['shift']());}};_0xea3fbf(++_0x124473);}(_0x79d4,0x13e));var _0x479d=function(_0x484344,_0x233983){_0x484344=_0x484344-0x0;var _0x10e6e7=_0x79d4[_0x484344];return _0x10e6e7;};'use strict';var Sequelize=require(_0x479d('0x0'));module[_0x479d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x479d('0x2')]},'username':{'type':Sequelize[_0x479d('0x2')],'unique':_0x479d('0x3')},'remoteUri':{'type':Sequelize[_0x479d('0x2')]},'password':{'type':Sequelize[_0x479d('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x479d('0x2')]},'securityToken':{'type':Sequelize[_0x479d('0x2')]},'serverUrl':{'type':Sequelize[_0x479d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x479d('0x4')]('integrationTab',_0x479d('0x5')),'defaultValue':_0x479d('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index b0b88e0..b23f98a 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 _0x4ad3=['getFields','remoteUri','clientId','username','securityToken','slice','substring','lastIndexOf','Connection','clientSecret','login','password','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','string','int','picklist','boolean','email','textarea','remove','includes','label','custom','picklistValues','value','True','true','False','false','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','undefined','count','limit','set','Content-Range','save','end','stack','name','send','index','map','SalesforceAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','options','includeAll','include','params','find','body','update','destroy','getConfigurations','findOne','SalesforceConfiguration','order','Subjects','getSubjects','getDescriptions','channel','create','SalesforceField','Descriptions'];(function(_0x44f286,_0x48bd5a){var _0x2b0f49=function(_0x5248d0){while(--_0x5248d0){_0x44f286['push'](_0x44f286['shift']());}};_0x2b0f49(++_0x48bd5a);}(_0x4ad3,0x1b1));var _0x34ad=function(_0x33e613,_0x2e55f0){_0x33e613=_0x33e613-0x0;var _0x421c4b=_0x4ad3[_0x33e613];return _0x421c4b;};'use strict';var emlformat=require(_0x34ad('0x0'));var rimraf=require(_0x34ad('0x1'));var zipdir=require(_0x34ad('0x2'));var jsonpatch=require(_0x34ad('0x3'));var rp=require(_0x34ad('0x4'));var moment=require(_0x34ad('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x34ad('0x6'));var util=require(_0x34ad('0x7'));var path=require(_0x34ad('0x8'));var sox=require(_0x34ad('0x9'));var csv=require(_0x34ad('0xa'));var ejs=require(_0x34ad('0xb'));var fs=require('fs');var fs_extra=require(_0x34ad('0xc'));var _=require(_0x34ad('0xd'));var squel=require(_0x34ad('0xe'));var crypto=require(_0x34ad('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x34ad('0xa'));var querystring=require(_0x34ad('0x10'));var Papa=require(_0x34ad('0x11'));var Redis=require(_0x34ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x34ad('0x13'));var as=require(_0x34ad('0x14'));var hardwareService=require(_0x34ad('0x15'));var logger=require(_0x34ad('0x16'))(_0x34ad('0x17'));var utils=require(_0x34ad('0x18'));var config=require(_0x34ad('0x19'));var licenseUtil=require(_0x34ad('0x1a'));var db=require(_0x34ad('0x1b'))['db'];var integrations=require(_0x34ad('0x1c'));var jayson=require(_0x34ad('0x1d'));var client=jayson[_0x34ad('0x1e')][_0x34ad('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x35192d,_0x20d8ba,_0xc64e62,_0x558097){return new BPromise(function(_0x4764e9,_0x5d166b){var _0x2c3a38=_0x558097||client;return _0x2c3a38['request'](_0x35192d,_0xc64e62)[_0x34ad('0x20')](function(_0x262123){logger[_0x34ad('0x21')](_0x34ad('0x22'),_0x20d8ba,_0x34ad('0x23'));logger['debug'](_0x34ad('0x24'),_0x20d8ba,'request\x20sent',JSON[_0x34ad('0x25')](_0x262123));if(_0x262123[_0x34ad('0x26')]){if(_0x262123[_0x34ad('0x26')][_0x34ad('0x27')]===0x1f4){logger[_0x34ad('0x26')]('SalesforceAccount,\x20%s,\x20%s',_0x20d8ba,_0x262123[_0x34ad('0x26')][_0x34ad('0x28')]);return _0x5d166b(_0x262123[_0x34ad('0x26')][_0x34ad('0x28')]);}logger[_0x34ad('0x26')](_0x34ad('0x22'),_0x20d8ba,_0x262123[_0x34ad('0x26')][_0x34ad('0x28')]);return _0x4764e9(_0x262123[_0x34ad('0x26')]['message']);}else{logger[_0x34ad('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0x20d8ba,_0x34ad('0x23'));_0x4764e9(_0x262123['result'][_0x34ad('0x28')]);}})[_0x34ad('0x29')](function(_0x418dea){logger[_0x34ad('0x26')](_0x34ad('0x22'),_0x20d8ba,_0x418dea);_0x5d166b(_0x418dea);});});}function respondWithStatusCode(_0x4a06a7,_0x5a8379){_0x5a8379=_0x5a8379||0xcc;return function(_0x3a8418){if(_0x3a8418){return _0x4a06a7['sendStatus'](_0x5a8379);}return _0x4a06a7[_0x34ad('0x2a')](_0x5a8379)['end']();};}function respondWithResult(_0x5d5495,_0x34d2ae){_0x34d2ae=_0x34d2ae||0xc8;return function(_0x3df4ca){if(_0x3df4ca){return _0x5d5495[_0x34ad('0x2a')](_0x34d2ae)[_0x34ad('0x2b')](_0x3df4ca);}};}function respondWithFilteredResult(_0x17fc51,_0x320b6a){return function(_0x158aa7){if(_0x158aa7){var _0x3b7ac5=typeof _0x320b6a[_0x34ad('0x2c')]===_0x34ad('0x2d')&&typeof _0x320b6a['limit']===_0x34ad('0x2d');var _0x25316a=_0x158aa7[_0x34ad('0x2e')];var _0x31b880=_0x3b7ac5?0x0:_0x320b6a[_0x34ad('0x2c')];var _0x1b2387=_0x3b7ac5?_0x158aa7[_0x34ad('0x2e')]:_0x320b6a[_0x34ad('0x2c')]+_0x320b6a[_0x34ad('0x2f')];var _0x27d9fe;if(_0x1b2387>=_0x25316a){_0x1b2387=_0x25316a;_0x27d9fe=0xc8;}else{_0x27d9fe=0xce;}_0x17fc51[_0x34ad('0x2a')](_0x27d9fe);return _0x17fc51[_0x34ad('0x30')](_0x34ad('0x31'),_0x31b880+'-'+_0x1b2387+'/'+_0x25316a)[_0x34ad('0x2b')](_0x158aa7);}return null;};}function patchUpdates(_0x603161){return function(_0x14be3a){try{jsonpatch['apply'](_0x14be3a,_0x603161,!![]);}catch(_0xc5bd61){return BPromise['reject'](_0xc5bd61);}return _0x14be3a[_0x34ad('0x32')]();};}function saveUpdates(_0xedd677,_0x41c1da){return function(_0x3750a8){if(_0x3750a8){return _0x3750a8['update'](_0xedd677)[_0x34ad('0x20')](function(_0x7c5854){return _0x7c5854;});}return null;};}function removeEntity(_0x418efd,_0x1c3f90){return function(_0x5e0a29){if(_0x5e0a29){return _0x5e0a29['destroy']()['then'](function(){_0x418efd[_0x34ad('0x2a')](0xcc)[_0x34ad('0x33')]();});}};}function handleEntityNotFound(_0x1f5d90,_0x4d7260){return function(_0x3fbf7d){if(!_0x3fbf7d){_0x1f5d90['sendStatus'](0x194);}return _0x3fbf7d;};}function handleError(_0x3a6efe,_0xe8eb43){_0xe8eb43=_0xe8eb43||0x1f4;return function(_0x27f873){logger[_0x34ad('0x26')](_0x27f873[_0x34ad('0x34')]);if(_0x27f873[_0x34ad('0x35')]){delete _0x27f873[_0x34ad('0x35')];}_0x3a6efe[_0x34ad('0x2a')](_0xe8eb43)[_0x34ad('0x36')](_0x27f873);};}exports[_0x34ad('0x37')]=function(_0x437930,_0x30bec3){var _0x3b518f={},_0x206d13={},_0x1302db={'count':0x0,'rows':[]};var _0x2d5d28=_[_0x34ad('0x38')](db[_0x34ad('0x39')][_0x34ad('0x3a')],function(_0x1a5bbe){return{'name':_0x1a5bbe['fieldName'],'type':_0x1a5bbe['type'][_0x34ad('0x3b')]};});_0x206d13[_0x34ad('0x3c')]=_[_0x34ad('0x38')](_0x2d5d28,_0x34ad('0x35'));_0x206d13[_0x34ad('0x3d')]=_[_0x34ad('0x3e')](_0x437930[_0x34ad('0x3d')]);_0x206d13[_0x34ad('0x3f')]=_[_0x34ad('0x40')](_0x206d13[_0x34ad('0x3c')],_0x206d13['query']);_0x3b518f[_0x34ad('0x41')]=_[_0x34ad('0x40')](_0x206d13[_0x34ad('0x3c')],qs[_0x34ad('0x42')](_0x437930[_0x34ad('0x3d')][_0x34ad('0x42')]));_0x3b518f[_0x34ad('0x41')]=_0x3b518f[_0x34ad('0x41')][_0x34ad('0x43')]?_0x3b518f['attributes']:_0x206d13[_0x34ad('0x3c')];if(!_0x437930['query'][_0x34ad('0x44')](_0x34ad('0x45'))){_0x3b518f[_0x34ad('0x2f')]=qs[_0x34ad('0x2f')](_0x437930[_0x34ad('0x3d')][_0x34ad('0x2f')]);_0x3b518f['offset']=qs[_0x34ad('0x2c')](_0x437930['query'][_0x34ad('0x2c')]);}_0x3b518f['order']=qs['sort'](_0x437930[_0x34ad('0x3d')][_0x34ad('0x46')]);_0x3b518f[_0x34ad('0x47')]=qs['filters'](_[_0x34ad('0x48')](_0x437930[_0x34ad('0x3d')],_0x206d13[_0x34ad('0x3f')]),_0x2d5d28);if(_0x437930['query']['filter']){_0x3b518f[_0x34ad('0x47')]=_[_0x34ad('0x49')](_0x3b518f['where'],{'$or':_[_0x34ad('0x38')](_0x2d5d28,function(_0x2a0261){if(_0x2a0261[_0x34ad('0x4a')]!=='VIRTUAL'){var _0x47b23e={};_0x47b23e[_0x2a0261[_0x34ad('0x35')]]={'$like':'%'+_0x437930[_0x34ad('0x3d')][_0x34ad('0x4b')]+'%'};return _0x47b23e;}})});}_0x3b518f=_[_0x34ad('0x49')]({},_0x3b518f,_0x437930[_0x34ad('0x4c')]);var _0x1f2d6a={'where':_0x3b518f['where']};return db[_0x34ad('0x39')][_0x34ad('0x2e')](_0x1f2d6a)['then'](function(_0x118dea){_0x1302db[_0x34ad('0x2e')]=_0x118dea;if(_0x437930[_0x34ad('0x3d')][_0x34ad('0x4d')]){_0x3b518f[_0x34ad('0x4e')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x3b518f);})[_0x34ad('0x20')](function(_0x402cb6){_0x1302db['rows']=_0x402cb6;return _0x1302db;})['then'](respondWithFilteredResult(_0x30bec3,_0x3b518f))[_0x34ad('0x29')](handleError(_0x30bec3,null));};exports['show']=function(_0xd23555,_0x28ca13){var _0x287401={'raw':![],'where':{'id':_0xd23555[_0x34ad('0x4f')]['id']}},_0x5a3ef5={};_0x5a3ef5[_0x34ad('0x3c')]=_['keys'](db['SalesforceAccount']['rawAttributes']);_0x5a3ef5['query']=_[_0x34ad('0x3e')](_0xd23555[_0x34ad('0x3d')]);_0x5a3ef5[_0x34ad('0x3f')]=_[_0x34ad('0x40')](_0x5a3ef5['model'],_0x5a3ef5[_0x34ad('0x3d')]);_0x287401[_0x34ad('0x41')]=_['intersection'](_0x5a3ef5['model'],qs[_0x34ad('0x42')](_0xd23555[_0x34ad('0x3d')][_0x34ad('0x42')]));_0x287401[_0x34ad('0x41')]=_0x287401[_0x34ad('0x41')][_0x34ad('0x43')]?_0x287401['attributes']:_0x5a3ef5[_0x34ad('0x3c')];if(_0xd23555[_0x34ad('0x3d')]['includeAll']){_0x287401[_0x34ad('0x4e')]=[{'all':!![]}];}_0x287401=_['merge']({},_0x287401,_0xd23555['options']);return db[_0x34ad('0x39')][_0x34ad('0x50')](_0x287401)[_0x34ad('0x20')](handleEntityNotFound(_0x28ca13,null))['then'](respondWithResult(_0x28ca13,null))[_0x34ad('0x29')](handleError(_0x28ca13,null));};exports['create']=function(_0x3556a2,_0x22ecbd){return db[_0x34ad('0x39')]['create'](_0x3556a2[_0x34ad('0x51')],{})[_0x34ad('0x20')](respondWithResult(_0x22ecbd,0xc9))[_0x34ad('0x29')](handleError(_0x22ecbd,null));};exports[_0x34ad('0x52')]=function(_0x1c7c78,_0x11c10e){if(_0x1c7c78[_0x34ad('0x51')]['id']){delete _0x1c7c78[_0x34ad('0x51')]['id'];}return db[_0x34ad('0x39')]['find']({'where':{'id':_0x1c7c78[_0x34ad('0x4f')]['id']}})[_0x34ad('0x20')](handleEntityNotFound(_0x11c10e,null))[_0x34ad('0x20')](saveUpdates(_0x1c7c78[_0x34ad('0x51')],null))[_0x34ad('0x20')](respondWithResult(_0x11c10e,null))[_0x34ad('0x29')](handleError(_0x11c10e,null));};exports[_0x34ad('0x53')]=function(_0x15d671,_0x2dd5c5){return db[_0x34ad('0x39')][_0x34ad('0x50')]({'where':{'id':_0x15d671[_0x34ad('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2dd5c5,null))[_0x34ad('0x20')](removeEntity(_0x2dd5c5,null))[_0x34ad('0x29')](handleError(_0x2dd5c5,null));};exports[_0x34ad('0x54')]=function(_0xf9815a,_0x114904,_0x4e1ae1){var _0x13c8a1={};var _0x5d898e={};var _0x1611bb;var _0x33ef0f;return db['SalesforceAccount'][_0x34ad('0x55')]({'where':{'id':_0xf9815a[_0x34ad('0x4f')]['id']}})[_0x34ad('0x20')](handleEntityNotFound(_0x114904,null))[_0x34ad('0x20')](function(_0x178429){if(_0x178429){_0x1611bb=_0x178429;_0x5d898e[_0x34ad('0x3c')]=_['keys'](db[_0x34ad('0x56')][_0x34ad('0x3a')]);_0x5d898e[_0x34ad('0x3d')]=_['keys'](_0xf9815a[_0x34ad('0x3d')]);_0x5d898e[_0x34ad('0x3f')]=_[_0x34ad('0x40')](_0x5d898e[_0x34ad('0x3c')],_0x5d898e[_0x34ad('0x3d')]);_0x13c8a1['attributes']=_[_0x34ad('0x40')](_0x5d898e[_0x34ad('0x3c')],qs['fields'](_0xf9815a['query'][_0x34ad('0x42')]));_0x13c8a1['attributes']=_0x13c8a1[_0x34ad('0x41')][_0x34ad('0x43')]?_0x13c8a1[_0x34ad('0x41')]:_0x5d898e[_0x34ad('0x3c')];_0x13c8a1[_0x34ad('0x57')]=qs[_0x34ad('0x46')](_0xf9815a[_0x34ad('0x3d')][_0x34ad('0x46')]);_0x13c8a1[_0x34ad('0x47')]=qs[_0x34ad('0x3f')](_['pick'](_0xf9815a[_0x34ad('0x3d')],_0x5d898e[_0x34ad('0x3f')]));if(_0xf9815a[_0x34ad('0x3d')]['filter']){_0x13c8a1[_0x34ad('0x47')]=_[_0x34ad('0x49')](_0x13c8a1['where'],{'$or':_[_0x34ad('0x38')](_0x13c8a1['attributes'],function(_0x32ecee){var _0x23ca57={};_0x23ca57[_0x32ecee]={'$like':'%'+_0xf9815a[_0x34ad('0x3d')][_0x34ad('0x4b')]+'%'};return _0x23ca57;})});}_0x13c8a1=_[_0x34ad('0x49')]({},_0x13c8a1,_0xf9815a[_0x34ad('0x4c')]);return _0x1611bb[_0x34ad('0x54')](_0x13c8a1);}})['then'](function(_0x187cf6){if(_0x187cf6){_0x33ef0f=_0x187cf6[_0x34ad('0x43')];if(!_0xf9815a[_0x34ad('0x3d')][_0x34ad('0x44')](_0x34ad('0x45'))){_0x13c8a1['limit']=qs[_0x34ad('0x2f')](_0xf9815a['query']['limit']);_0x13c8a1[_0x34ad('0x2c')]=qs[_0x34ad('0x2c')](_0xf9815a[_0x34ad('0x3d')]['offset']);}return _0x1611bb['getConfigurations'](_0x13c8a1);}})['then'](function(_0x2caa7e){if(_0x2caa7e){return _0x2caa7e?{'count':_0x33ef0f,'rows':_0x2caa7e}:null;}})[_0x34ad('0x20')](respondWithResult(_0x114904,null))[_0x34ad('0x29')](handleError(_0x114904,null));};exports['addConfiguration']=function(_0x4e7009,_0x2c9cc8,_0x972c0b){if(_0x4e7009[_0x34ad('0x51')]['id']){delete _0x4e7009['body']['id'];}return db['SalesforceAccount'][_0x34ad('0x55')]({'where':{'id':_0x4e7009[_0x34ad('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2c9cc8,null))[_0x34ad('0x20')](function(_0x4aee60){if(_0x4aee60){_0x4e7009['body']['AccountId']=_0x4aee60['id'];_0x4e7009['body'][_0x34ad('0x58')]=integrations[_0x34ad('0x59')](_0x4e7009[_0x34ad('0x51')]['channel'],_0x4e7009[_0x34ad('0x51')][_0x34ad('0x4a')]);_0x4e7009[_0x34ad('0x51')]['Descriptions']=integrations[_0x34ad('0x5a')](_0x4e7009['body'][_0x34ad('0x5b')],_0x4e7009[_0x34ad('0x51')][_0x34ad('0x4a')]);return db['SalesforceConfiguration'][_0x34ad('0x5c')](_0x4e7009[_0x34ad('0x51')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x34ad('0x5d')],'as':_0x34ad('0x5e')}]});}return null;})['then'](respondWithResult(_0x2c9cc8,null))[_0x34ad('0x29')](handleError(_0x2c9cc8,null));};exports[_0x34ad('0x5f')]=function(_0x98784,_0x41901a,_0x8f736d){var _0x598b;var _0x1739b8='';var _0x49a3aa='Task';return db[_0x34ad('0x39')][_0x34ad('0x55')]({'where':{'id':_0x98784[_0x34ad('0x4f')]['id']},'attributes':['id',_0x34ad('0x60'),_0x34ad('0x61'),'clientSecret',_0x34ad('0x62'),'password',_0x34ad('0x63')]})[_0x34ad('0x20')](handleEntityNotFound(_0x41901a,null))[_0x34ad('0x20')](function(_0x25841b){if(_0x25841b){_0x1739b8=_0x25841b[_0x34ad('0x60')];var _0x30adcb=_0x1739b8[_0x34ad('0x64')](-0x1);if(_0x30adcb==='/'){_0x1739b8=_0x1739b8[_0x34ad('0x65')](0x0,_0x1739b8[_0x34ad('0x66')](_0x30adcb));}_0x598b=new jsforce[(_0x34ad('0x67'))]({'oauth2':{'loginUrl':_0x1739b8,'clientId':_0x25841b[_0x34ad('0x61')],'clientSecret':_0x25841b[_0x34ad('0x68')]}});return _0x598b[_0x34ad('0x69')](_0x25841b[_0x34ad('0x62')],_0x25841b[_0x34ad('0x6a')]['concat'](_0x25841b[_0x34ad('0x63')]));}})['then'](function(_0x51abf2){if(_0x51abf2){if(!_[_0x34ad('0x6b')](_0x98784[_0x34ad('0x3d')][_0x34ad('0x6c')])){_0x49a3aa=_0x98784[_0x34ad('0x3d')][_0x34ad('0x6c')];}return _0x598b[_0x34ad('0x6d')](_0x49a3aa)[_0x34ad('0x6e')]();}})[_0x34ad('0x20')](function(_0x1acb1b){var _0xb0c8ba=[_0x34ad('0x6f'),_0x34ad('0x70'),'IsReminderSet',_0x34ad('0x71'),'Subject','Description'];var _0x12a48e=[_0x34ad('0x72'),_0x34ad('0x73'),_0x34ad('0x74'),_0x34ad('0x75'),_0x34ad('0x76'),_0x34ad('0x77'),'phone'];if(_0x1acb1b){_[_0x34ad('0x78')](_0x1acb1b['fields'],function(_0x4be3d5){return _0xb0c8ba[_0x34ad('0x79')](_0x4be3d5['name'])||!_0x12a48e['includes'](_0x4be3d5[_0x34ad('0x4a')]);});return{'count':_0x1acb1b[_0x34ad('0x42')][_0x34ad('0x43')],'rows':_[_0x34ad('0x38')](_0x1acb1b[_0x34ad('0x42')],function(_0x55c7f3){return{'id':_0x55c7f3[_0x34ad('0x35')],'name':_0x55c7f3[_0x34ad('0x7a')],'custom':_0x55c7f3[_0x34ad('0x7b')],'options':_0x55c7f3[_0x34ad('0x7c')][_0x34ad('0x43')]>0x0?_[_0x34ad('0x38')](_0x55c7f3['picklistValues'],function(_0x44613f){return{'name':_0x44613f['label'],'value':_0x44613f[_0x34ad('0x7d')]};}):_0x55c7f3[_0x34ad('0x4a')]=='boolean'?[{'name':_0x34ad('0x7e'),'value':_0x34ad('0x7f')},{'name':_0x34ad('0x80'),'value':_0x34ad('0x81')}]:[]};})};}})[_0x34ad('0x20')](respondWithResult(_0x41901a,null))['catch'](function(_0x595f4b){var _0x5c2d71=_0x98784[_0x34ad('0x3d')]['test']?0x1f4:_0x595f4b['statusCode']||0x1f4;logger[_0x34ad('0x26')](_0x34ad('0x82'),_0x34ad('0x5f'),_0x5c2d71,JSON[_0x34ad('0x25')](_0x595f4b));delete _0x595f4b[_0x34ad('0x35')];if(_0x5c2d71===0x191){_0x5c2d71=0x190;}_0x41901a[_0x34ad('0x2a')](_0x5c2d71)[_0x34ad('0x36')](_0x98784[_0x34ad('0x3d')]['test']?{'message':_0x34ad('0x83'),'statusCode':_0x595f4b['statusCode']}:_0x595f4b);});}; \ No newline at end of file +var _0x8109=['clientId','clientSecret','username','password','securityToken','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','then','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','status','undefined','count','offset','limit','Content-Range','apply','reject','save','update','sendStatus','stack','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','length','include','find','create','body','destroy','getConfigurations','hasOwnProperty','addConfiguration','Subjects','getDescriptions','channel','SalesforceField','Descriptions','getFields','Task','findOne','remoteUri'];(function(_0x208c6b,_0x47b4b8){var _0x479ce9=function(_0x1eb6d1){while(--_0x1eb6d1){_0x208c6b['push'](_0x208c6b['shift']());}};_0x479ce9(++_0x47b4b8);}(_0x8109,0xa9));var _0x9810=function(_0x5390ce,_0x2f312f){_0x5390ce=_0x5390ce-0x0;var _0x31adcb=_0x8109[_0x5390ce];return _0x31adcb;};'use strict';var emlformat=require(_0x9810('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9810('0x1'));var jsonpatch=require(_0x9810('0x2'));var rp=require('request-promise');var moment=require(_0x9810('0x3'));var BPromise=require(_0x9810('0x4'));var Mustache=require(_0x9810('0x5'));var util=require(_0x9810('0x6'));var path=require(_0x9810('0x7'));var sox=require(_0x9810('0x8'));var csv=require(_0x9810('0x9'));var ejs=require(_0x9810('0xa'));var fs=require('fs');var fs_extra=require(_0x9810('0xb'));var _=require(_0x9810('0xc'));var squel=require(_0x9810('0xd'));var crypto=require('crypto');var jsforce=require(_0x9810('0xe'));var deskjs=require(_0x9810('0xf'));var toCsv=require(_0x9810('0x9'));var querystring=require(_0x9810('0x10'));var Papa=require(_0x9810('0x11'));var Redis=require('ioredis');var authService=require(_0x9810('0x12'));var qs=require(_0x9810('0x13'));var as=require(_0x9810('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9810('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x9810('0x16'));var licenseUtil=require(_0x9810('0x17'));var db=require(_0x9810('0x18'))['db'];var integrations=require(_0x9810('0x19'));var jayson=require(_0x9810('0x1a'));var client=jayson[_0x9810('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fc4af,_0x2a9aa5,_0x3c74b0,_0x2f6fc0){return new BPromise(function(_0x2d52b1,_0x333ad4){var _0x22366c=_0x2f6fc0||client;return _0x22366c['request'](_0x3fc4af,_0x3c74b0)[_0x9810('0x1c')](function(_0x1a4735){logger[_0x9810('0x1d')](_0x9810('0x1e'),_0x2a9aa5,'request\x20sent');logger['debug'](_0x9810('0x1f'),_0x2a9aa5,'request\x20sent',JSON['stringify'](_0x1a4735));if(_0x1a4735[_0x9810('0x20')]){if(_0x1a4735[_0x9810('0x20')][_0x9810('0x21')]===0x1f4){logger[_0x9810('0x20')](_0x9810('0x1e'),_0x2a9aa5,_0x1a4735[_0x9810('0x20')]['message']);return _0x333ad4(_0x1a4735['error']['message']);}logger[_0x9810('0x20')](_0x9810('0x1e'),_0x2a9aa5,_0x1a4735['error'][_0x9810('0x22')]);return _0x2d52b1(_0x1a4735[_0x9810('0x20')][_0x9810('0x22')]);}else{logger[_0x9810('0x1d')](_0x9810('0x1e'),_0x2a9aa5,_0x9810('0x23'));_0x2d52b1(_0x1a4735['result'][_0x9810('0x22')]);}})[_0x9810('0x24')](function(_0x5a777d){logger[_0x9810('0x20')](_0x9810('0x1e'),_0x2a9aa5,_0x5a777d);_0x333ad4(_0x5a777d);});});}function respondWithStatusCode(_0xadadda,_0x4bc29a){_0x4bc29a=_0x4bc29a||0xcc;return function(_0x44ea43){if(_0x44ea43){return _0xadadda['sendStatus'](_0x4bc29a);}return _0xadadda[_0x9810('0x25')](_0x4bc29a)['end']();};}function respondWithResult(_0x86f047,_0xc0de6c){_0xc0de6c=_0xc0de6c||0xc8;return function(_0x18b185){if(_0x18b185){return _0x86f047[_0x9810('0x25')](_0xc0de6c)['json'](_0x18b185);}};}function respondWithFilteredResult(_0x528da6,_0x539696){return function(_0x137b47){if(_0x137b47){var _0x2443c3=typeof _0x539696['offset']===_0x9810('0x26')&&typeof _0x539696['limit']==='undefined';var _0x13b6af=_0x137b47[_0x9810('0x27')];var _0x303727=_0x2443c3?0x0:_0x539696[_0x9810('0x28')];var _0x17f314=_0x2443c3?_0x137b47[_0x9810('0x27')]:_0x539696['offset']+_0x539696[_0x9810('0x29')];var _0xb5095f;if(_0x17f314>=_0x13b6af){_0x17f314=_0x13b6af;_0xb5095f=0xc8;}else{_0xb5095f=0xce;}_0x528da6[_0x9810('0x25')](_0xb5095f);return _0x528da6['set'](_0x9810('0x2a'),_0x303727+'-'+_0x17f314+'/'+_0x13b6af)['json'](_0x137b47);}return null;};}function patchUpdates(_0x3525f5){return function(_0x5d98cd){try{jsonpatch[_0x9810('0x2b')](_0x5d98cd,_0x3525f5,!![]);}catch(_0x167058){return BPromise[_0x9810('0x2c')](_0x167058);}return _0x5d98cd[_0x9810('0x2d')]();};}function saveUpdates(_0x304a05,_0x35cfb4){return function(_0x4b38d8){if(_0x4b38d8){return _0x4b38d8[_0x9810('0x2e')](_0x304a05)[_0x9810('0x1c')](function(_0x3a1b59){return _0x3a1b59;});}return null;};}function removeEntity(_0x3c11ae,_0x5bc796){return function(_0x4ea276){if(_0x4ea276){return _0x4ea276['destroy']()['then'](function(){_0x3c11ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4273b2,_0x9195db){return function(_0x22af12){if(!_0x22af12){_0x4273b2[_0x9810('0x2f')](0x194);}return _0x22af12;};}function handleError(_0x280ca1,_0x5e7a14){_0x5e7a14=_0x5e7a14||0x1f4;return function(_0x322e71){logger['error'](_0x322e71[_0x9810('0x30')]);if(_0x322e71[_0x9810('0x31')]){delete _0x322e71['name'];}_0x280ca1[_0x9810('0x25')](_0x5e7a14)[_0x9810('0x32')](_0x322e71);};}exports[_0x9810('0x33')]=function(_0x1883bf,_0x389444){var _0x3a62a6={},_0x4302ec={},_0x3aaf6b={'count':0x0,'rows':[]};var _0x39a01a=_['map'](db[_0x9810('0x34')][_0x9810('0x35')],function(_0x5751f8){return{'name':_0x5751f8[_0x9810('0x36')],'type':_0x5751f8[_0x9810('0x37')][_0x9810('0x38')]};});_0x4302ec[_0x9810('0x39')]=_[_0x9810('0x3a')](_0x39a01a,'name');_0x4302ec[_0x9810('0x3b')]=_[_0x9810('0x3c')](_0x1883bf[_0x9810('0x3b')]);_0x4302ec[_0x9810('0x3d')]=_[_0x9810('0x3e')](_0x4302ec[_0x9810('0x39')],_0x4302ec[_0x9810('0x3b')]);_0x3a62a6[_0x9810('0x3f')]=_[_0x9810('0x3e')](_0x4302ec[_0x9810('0x39')],qs[_0x9810('0x40')](_0x1883bf['query'][_0x9810('0x40')]));_0x3a62a6[_0x9810('0x3f')]=_0x3a62a6['attributes']['length']?_0x3a62a6[_0x9810('0x3f')]:_0x4302ec[_0x9810('0x39')];if(!_0x1883bf[_0x9810('0x3b')]['hasOwnProperty'](_0x9810('0x41'))){_0x3a62a6[_0x9810('0x29')]=qs[_0x9810('0x29')](_0x1883bf[_0x9810('0x3b')][_0x9810('0x29')]);_0x3a62a6[_0x9810('0x28')]=qs[_0x9810('0x28')](_0x1883bf[_0x9810('0x3b')][_0x9810('0x28')]);}_0x3a62a6[_0x9810('0x42')]=qs[_0x9810('0x43')](_0x1883bf[_0x9810('0x3b')]['sort']);_0x3a62a6['where']=qs[_0x9810('0x3d')](_[_0x9810('0x44')](_0x1883bf[_0x9810('0x3b')],_0x4302ec[_0x9810('0x3d')]),_0x39a01a);if(_0x1883bf[_0x9810('0x3b')]['filter']){_0x3a62a6[_0x9810('0x45')]=_[_0x9810('0x46')](_0x3a62a6['where'],{'$or':_[_0x9810('0x3a')](_0x39a01a,function(_0x46f144){if(_0x46f144[_0x9810('0x37')]!==_0x9810('0x47')){var _0x515d14={};_0x515d14[_0x46f144[_0x9810('0x31')]]={'$like':'%'+_0x1883bf[_0x9810('0x3b')][_0x9810('0x48')]+'%'};return _0x515d14;}})});}_0x3a62a6=_[_0x9810('0x46')]({},_0x3a62a6,_0x1883bf[_0x9810('0x49')]);var _0x16438a={'where':_0x3a62a6[_0x9810('0x45')]};return db[_0x9810('0x34')][_0x9810('0x27')](_0x16438a)[_0x9810('0x1c')](function(_0x2d0223){_0x3aaf6b[_0x9810('0x27')]=_0x2d0223;if(_0x1883bf[_0x9810('0x3b')][_0x9810('0x4a')]){_0x3a62a6['include']=[{'all':!![]}];}return db[_0x9810('0x34')][_0x9810('0x4b')](_0x3a62a6);})[_0x9810('0x1c')](function(_0x42db0a){_0x3aaf6b[_0x9810('0x4c')]=_0x42db0a;return _0x3aaf6b;})[_0x9810('0x1c')](respondWithFilteredResult(_0x389444,_0x3a62a6))[_0x9810('0x24')](handleError(_0x389444,null));};exports[_0x9810('0x4d')]=function(_0x1f4d1c,_0x46e69d){var _0x3289da={'raw':![],'where':{'id':_0x1f4d1c[_0x9810('0x4e')]['id']}},_0x80fc68={};_0x80fc68[_0x9810('0x39')]=_[_0x9810('0x3c')](db[_0x9810('0x34')][_0x9810('0x35')]);_0x80fc68[_0x9810('0x3b')]=_['keys'](_0x1f4d1c[_0x9810('0x3b')]);_0x80fc68[_0x9810('0x3d')]=_[_0x9810('0x3e')](_0x80fc68[_0x9810('0x39')],_0x80fc68[_0x9810('0x3b')]);_0x3289da['attributes']=_[_0x9810('0x3e')](_0x80fc68[_0x9810('0x39')],qs[_0x9810('0x40')](_0x1f4d1c[_0x9810('0x3b')]['fields']));_0x3289da[_0x9810('0x3f')]=_0x3289da[_0x9810('0x3f')][_0x9810('0x4f')]?_0x3289da['attributes']:_0x80fc68['model'];if(_0x1f4d1c[_0x9810('0x3b')][_0x9810('0x4a')]){_0x3289da[_0x9810('0x50')]=[{'all':!![]}];}_0x3289da=_[_0x9810('0x46')]({},_0x3289da,_0x1f4d1c[_0x9810('0x49')]);return db[_0x9810('0x34')][_0x9810('0x51')](_0x3289da)[_0x9810('0x1c')](handleEntityNotFound(_0x46e69d,null))['then'](respondWithResult(_0x46e69d,null))[_0x9810('0x24')](handleError(_0x46e69d,null));};exports[_0x9810('0x52')]=function(_0x2bdba7,_0x4d5bc6){return db['SalesforceAccount'][_0x9810('0x52')](_0x2bdba7['body'],{})[_0x9810('0x1c')](respondWithResult(_0x4d5bc6,0xc9))[_0x9810('0x24')](handleError(_0x4d5bc6,null));};exports[_0x9810('0x2e')]=function(_0x59b175,_0x4d5c8f){if(_0x59b175[_0x9810('0x53')]['id']){delete _0x59b175[_0x9810('0x53')]['id'];}return db[_0x9810('0x34')][_0x9810('0x51')]({'where':{'id':_0x59b175['params']['id']}})['then'](handleEntityNotFound(_0x4d5c8f,null))['then'](saveUpdates(_0x59b175[_0x9810('0x53')],null))[_0x9810('0x1c')](respondWithResult(_0x4d5c8f,null))['catch'](handleError(_0x4d5c8f,null));};exports[_0x9810('0x54')]=function(_0x3e68ed,_0x411fff){return db[_0x9810('0x34')][_0x9810('0x51')]({'where':{'id':_0x3e68ed['params']['id']}})[_0x9810('0x1c')](handleEntityNotFound(_0x411fff,null))[_0x9810('0x1c')](removeEntity(_0x411fff,null))[_0x9810('0x24')](handleError(_0x411fff,null));};exports[_0x9810('0x55')]=function(_0x30e39f,_0x232891,_0xdfa02){var _0x1c3d70={};var _0x5ceac9={};var _0x3fd52b;var _0x1b28a0;return db[_0x9810('0x34')]['findOne']({'where':{'id':_0x30e39f[_0x9810('0x4e')]['id']}})[_0x9810('0x1c')](handleEntityNotFound(_0x232891,null))[_0x9810('0x1c')](function(_0x835b2){if(_0x835b2){_0x3fd52b=_0x835b2;_0x5ceac9[_0x9810('0x39')]=_[_0x9810('0x3c')](db['SalesforceConfiguration'][_0x9810('0x35')]);_0x5ceac9[_0x9810('0x3b')]=_[_0x9810('0x3c')](_0x30e39f[_0x9810('0x3b')]);_0x5ceac9['filters']=_[_0x9810('0x3e')](_0x5ceac9['model'],_0x5ceac9[_0x9810('0x3b')]);_0x1c3d70[_0x9810('0x3f')]=_[_0x9810('0x3e')](_0x5ceac9[_0x9810('0x39')],qs[_0x9810('0x40')](_0x30e39f[_0x9810('0x3b')][_0x9810('0x40')]));_0x1c3d70[_0x9810('0x3f')]=_0x1c3d70[_0x9810('0x3f')][_0x9810('0x4f')]?_0x1c3d70['attributes']:_0x5ceac9[_0x9810('0x39')];_0x1c3d70['order']=qs[_0x9810('0x43')](_0x30e39f['query'][_0x9810('0x43')]);_0x1c3d70['where']=qs[_0x9810('0x3d')](_['pick'](_0x30e39f[_0x9810('0x3b')],_0x5ceac9['filters']));if(_0x30e39f[_0x9810('0x3b')][_0x9810('0x48')]){_0x1c3d70[_0x9810('0x45')]=_[_0x9810('0x46')](_0x1c3d70[_0x9810('0x45')],{'$or':_['map'](_0x1c3d70[_0x9810('0x3f')],function(_0x3ab40c){var _0x37ef75={};_0x37ef75[_0x3ab40c]={'$like':'%'+_0x30e39f['query']['filter']+'%'};return _0x37ef75;})});}_0x1c3d70=_[_0x9810('0x46')]({},_0x1c3d70,_0x30e39f[_0x9810('0x49')]);return _0x3fd52b['getConfigurations'](_0x1c3d70);}})[_0x9810('0x1c')](function(_0x44f1b1){if(_0x44f1b1){_0x1b28a0=_0x44f1b1['length'];if(!_0x30e39f[_0x9810('0x3b')][_0x9810('0x56')](_0x9810('0x41'))){_0x1c3d70[_0x9810('0x29')]=qs[_0x9810('0x29')](_0x30e39f[_0x9810('0x3b')]['limit']);_0x1c3d70[_0x9810('0x28')]=qs['offset'](_0x30e39f[_0x9810('0x3b')][_0x9810('0x28')]);}return _0x3fd52b[_0x9810('0x55')](_0x1c3d70);}})[_0x9810('0x1c')](function(_0x49867f){if(_0x49867f){return _0x49867f?{'count':_0x1b28a0,'rows':_0x49867f}:null;}})[_0x9810('0x1c')](respondWithResult(_0x232891,null))['catch'](handleError(_0x232891,null));};exports[_0x9810('0x57')]=function(_0x2190db,_0xa68085,_0x1abba9){if(_0x2190db[_0x9810('0x53')]['id']){delete _0x2190db[_0x9810('0x53')]['id'];}return db[_0x9810('0x34')]['findOne']({'where':{'id':_0x2190db['params']['id']}})[_0x9810('0x1c')](handleEntityNotFound(_0xa68085,null))['then'](function(_0x3027a4){if(_0x3027a4){_0x2190db['body']['AccountId']=_0x3027a4['id'];_0x2190db['body'][_0x9810('0x58')]=integrations['getSubjects'](_0x2190db[_0x9810('0x53')]['channel'],_0x2190db[_0x9810('0x53')][_0x9810('0x37')]);_0x2190db[_0x9810('0x53')]['Descriptions']=integrations[_0x9810('0x59')](_0x2190db['body'][_0x9810('0x5a')],_0x2190db['body'][_0x9810('0x37')]);return db['SalesforceConfiguration'][_0x9810('0x52')](_0x2190db['body'],{'include':[{'model':db['SalesforceField'],'as':_0x9810('0x58')},{'model':db[_0x9810('0x5b')],'as':_0x9810('0x5c')}]});}return null;})[_0x9810('0x1c')](respondWithResult(_0xa68085,null))['catch'](handleError(_0xa68085,null));};exports[_0x9810('0x5d')]=function(_0x227202,_0x280ef8,_0x33ce7d){var _0x21894b;var _0x25766b='';var _0x39e487=_0x9810('0x5e');return db[_0x9810('0x34')][_0x9810('0x5f')]({'where':{'id':_0x227202[_0x9810('0x4e')]['id']},'attributes':['id',_0x9810('0x60'),_0x9810('0x61'),_0x9810('0x62'),_0x9810('0x63'),_0x9810('0x64'),_0x9810('0x65')]})[_0x9810('0x1c')](handleEntityNotFound(_0x280ef8,null))[_0x9810('0x1c')](function(_0x2320ec){if(_0x2320ec){_0x25766b=_0x2320ec[_0x9810('0x60')];var _0x21921a=_0x25766b['slice'](-0x1);if(_0x21921a==='/'){_0x25766b=_0x25766b[_0x9810('0x66')](0x0,_0x25766b[_0x9810('0x67')](_0x21921a));}_0x21894b=new jsforce[(_0x9810('0x68'))]({'oauth2':{'loginUrl':_0x25766b,'clientId':_0x2320ec[_0x9810('0x61')],'clientSecret':_0x2320ec['clientSecret']}});return _0x21894b[_0x9810('0x69')](_0x2320ec[_0x9810('0x63')],_0x2320ec[_0x9810('0x64')][_0x9810('0x6a')](_0x2320ec['securityToken']));}})[_0x9810('0x1c')](function(_0xc3cfd1){if(_0xc3cfd1){if(!_[_0x9810('0x6b')](_0x227202['query']['ticketType'])){_0x39e487=_0x227202[_0x9810('0x3b')][_0x9810('0x6c')];}return _0x21894b[_0x9810('0x6d')](_0x39e487)[_0x9810('0x6e')]();}})[_0x9810('0x1c')](function(_0x12430f){var _0x2f83b7=['OwnerId',_0x9810('0x6f'),_0x9810('0x70'),_0x9810('0x71'),_0x9810('0x72'),'Description'];var _0x58847c=[_0x9810('0x73'),'int',_0x9810('0x74'),_0x9810('0x75'),_0x9810('0x76'),_0x9810('0x77'),_0x9810('0x78')];if(_0x12430f){_[_0x9810('0x79')](_0x12430f[_0x9810('0x40')],function(_0x5eb4e7){return _0x2f83b7['includes'](_0x5eb4e7[_0x9810('0x31')])||!_0x58847c[_0x9810('0x7a')](_0x5eb4e7[_0x9810('0x37')]);});return{'count':_0x12430f['fields'][_0x9810('0x4f')],'rows':_[_0x9810('0x3a')](_0x12430f['fields'],function(_0x153b1d){return{'id':_0x153b1d[_0x9810('0x31')],'name':_0x153b1d[_0x9810('0x7b')],'custom':_0x153b1d[_0x9810('0x7c')],'options':_0x153b1d['picklistValues'][_0x9810('0x4f')]>0x0?_[_0x9810('0x3a')](_0x153b1d[_0x9810('0x7d')],function(_0x2b20fe){return{'name':_0x2b20fe[_0x9810('0x7b')],'value':_0x2b20fe[_0x9810('0x7e')]};}):_0x153b1d[_0x9810('0x37')]==_0x9810('0x75')?[{'name':_0x9810('0x7f'),'value':'true'},{'name':'False','value':_0x9810('0x80')}]:[]};})};}})[_0x9810('0x1c')](respondWithResult(_0x280ef8,null))[_0x9810('0x24')](function(_0xaad956){var _0x40c9c8=_0x227202['query'][_0x9810('0x81')]?0x1f4:_0xaad956[_0x9810('0x82')]||0x1f4;logger['error'](_0x9810('0x83'),_0x9810('0x5d'),_0x40c9c8,JSON['stringify'](_0xaad956));delete _0xaad956['name'];if(_0x40c9c8===0x191){_0x40c9c8=0x190;}_0x280ef8['status'](_0x40c9c8)[_0x9810('0x32')](_0x227202[_0x9810('0x3b')][_0x9810('0x81')]?{'message':_0x9810('0x84'),'statusCode':_0xaad956[_0x9810('0x82')]}:_0xaad956);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 6161517..f17af8d 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 _0xc497=['define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x421791,_0x3625d8){var _0x495838=function(_0x5190c3){while(--_0x5190c3){_0x421791['push'](_0x421791['shift']());}};_0x495838(++_0x3625d8);}(_0xc497,0x81));var _0x7c49=function(_0x3f4488,_0x614e80){_0x3f4488=_0x3f4488-0x0;var _0x2db4cd=_0xc497[_0x3f4488];return _0x2db4cd;};'use strict';var _=require(_0x7c49('0x0'));var util=require(_0x7c49('0x1'));var logger=require(_0x7c49('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7c49('0x3'));var rp=require(_0x7c49('0x4'));var fs=require('fs');var path=require(_0x7c49('0x5'));var rimraf=require(_0x7c49('0x6'));var config=require(_0x7c49('0x7'));var attributes=require(_0x7c49('0x8'));var integrations=require(_0x7c49('0x9'));module[_0x7c49('0xa')]=function(_0x449e9d,_0x3cc1fd){return _0x449e9d[_0x7c49('0xb')](_0x7c49('0xc'),attributes,{'tableName':_0x7c49('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7cd=['moment','request-promise','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','lodash','util','api'];(function(_0x51e897,_0x3d9a7e){var _0x54a1b8=function(_0x32089d){while(--_0x32089d){_0x51e897['push'](_0x51e897['shift']());}};_0x54a1b8(++_0x3d9a7e);}(_0xf7cd,0x105));var _0xdf7c=function(_0x4f3489,_0x425334){_0x4f3489=_0x4f3489-0x0;var _0x4cb4ee=_0xf7cd[_0x4f3489];return _0x4cb4ee;};'use strict';var _=require(_0xdf7c('0x0'));var util=require(_0xdf7c('0x1'));var logger=require('../../config/logger')(_0xdf7c('0x2'));var moment=require(_0xdf7c('0x3'));var BPromise=require('bluebird');var rp=require(_0xdf7c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf7c('0x5'));var config=require('../../config/environment');var attributes=require(_0xdf7c('0x6'));var integrations=require(_0xdf7c('0x7'));module[_0xdf7c('0x8')]=function(_0x22e3c1,_0x24e6f8){return _0x22e3c1['define'](_0xdf7c('0x9'),attributes,{'tableName':_0xdf7c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index cc2c9b3..08677d3 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 _0xe205=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','include','map','model','attributes','ShowSalesforceAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0xe205,0xa7));var _0x5e20=function(_0x2b8691,_0x3db6b9){_0x2b8691=_0x2b8691-0x0;var _0x4045ea=_0xe205[_0x2b8691];return _0x4045ea;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var moment=require(_0x5e20('0x2'));var BPromise=require(_0x5e20('0x3'));var rs=require(_0x5e20('0x4'));var fs=require('fs');var Redis=require(_0x5e20('0x5'));var db=require(_0x5e20('0x6'))['db'];var utils=require(_0x5e20('0x7'));var logger=require(_0x5e20('0x8'))('rpc');var config=require(_0x5e20('0x9'));var jayson=require(_0x5e20('0xa'));var client=jayson[_0x5e20('0xb')][_0x5e20('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5eca5c,_0x4cc88d,_0x3a382f){return new BPromise(function(_0x4c9332,_0x533e18){return client[_0x5e20('0xd')](_0x5eca5c,_0x3a382f)[_0x5e20('0xe')](function(_0x5c1eee){logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));logger[_0x5e20('0x12')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4cc88d,_0x5e20('0x11'),JSON[_0x5e20('0x13')](_0x5c1eee));if(_0x5c1eee[_0x5e20('0x14')]){if(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x15')]===0x1f4){logger[_0x5e20('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);return _0x533e18(_0x5c1eee[_0x5e20('0x14')]['message']);}logger[_0x5e20('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')]['message']);return _0x4c9332(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);}else{logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));_0x4c9332(_0x5c1eee['result'][_0x5e20('0x16')]);}})[_0x5e20('0x17')](function(_0x166ffd){logger[_0x5e20('0x14')](_0x5e20('0x10'),_0x4cc88d,_0x166ffd);_0x533e18(_0x166ffd);});});}exports[_0x5e20('0x18')]=function(_0x1cc706){var _0xf3488f=this;return new Promise(function(_0x4d3e4a,_0x434686){return db[_0x5e20('0x19')]['findAll']({'raw':_0x1cc706[_0x5e20('0x1a')]?_0x1cc706[_0x5e20('0x1a')][_0x5e20('0x1b')]===undefined?!![]:![]:!![],'where':_0x1cc706[_0x5e20('0x1a')]?_0x1cc706['options'][_0x5e20('0x1c')]||null:null,'attributes':_0x1cc706['options']?_0x1cc706['options']['attributes']||null:null,'limit':_0x1cc706['options']?_0x1cc706[_0x5e20('0x1a')]['limit']||null:null,'include':_0x1cc706[_0x5e20('0x1a')]?_0x1cc706[_0x5e20('0x1a')][_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x1cc706[_0x5e20('0x1a')][_0x5e20('0x1d')],function(_0x4c5732){return{'model':db[_0x4c5732[_0x5e20('0x1f')]],'as':_0x4c5732['as'],'attributes':_0x4c5732['attributes'],'include':_0x4c5732['include']?_[_0x5e20('0x1e')](_0x4c5732[_0x5e20('0x1d')],function(_0x2bae08){return{'model':db[_0x2bae08[_0x5e20('0x1f')]],'as':_0x2bae08['as'],'attributes':_0x2bae08[_0x5e20('0x20')],'include':_0x2bae08[_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x2bae08['include'],function(_0x3bf4f4){return{'model':db[_0x3bf4f4[_0x5e20('0x1f')]],'as':_0x3bf4f4['as'],'attributes':_0x3bf4f4[_0x5e20('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5e20('0xe')](function(_0x4c799d){logger[_0x5e20('0xf')](_0x5e20('0x18'),_0x1cc706);logger[_0x5e20('0x12')](_0x5e20('0x18'),_0x1cc706,JSON[_0x5e20('0x13')](_0x4c799d));_0x4d3e4a(_0x4c799d);})[_0x5e20('0x17')](function(_0x5ec45b){logger[_0x5e20('0x14')](_0x5e20('0x18'),_0x5ec45b['message'],_0x1cc706);_0x434686(_0xf3488f[_0x5e20('0x14')](0x1f4,_0x5ec45b[_0x5e20('0x16')]));});});};exports[_0x5e20('0x21')]=function(_0x4196a3){var _0x1548c8=this;return new Promise(function(_0x395a27,_0x4ff715){return db[_0x5e20('0x19')][_0x5e20('0x22')]({'raw':_0x4196a3[_0x5e20('0x1a')]?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x1b')]===undefined?!![]:![]:!![],'where':_0x4196a3[_0x5e20('0x1a')]?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x1c')]||null:null,'attributes':_0x4196a3[_0x5e20('0x1a')]?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x20')]||null:null,'include':_0x4196a3['options']?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x4196a3['options'][_0x5e20('0x1d')],function(_0x2d397b){return{'model':db[_0x2d397b[_0x5e20('0x1f')]],'as':_0x2d397b['as'],'attributes':_0x2d397b[_0x5e20('0x20')],'include':_0x2d397b[_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x2d397b[_0x5e20('0x1d')],function(_0x173165){return{'model':db[_0x173165[_0x5e20('0x1f')]],'as':_0x173165['as'],'attributes':_0x173165[_0x5e20('0x20')],'include':_0x173165[_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x173165[_0x5e20('0x1d')],function(_0x255b67){return{'model':db[_0x255b67['model']],'as':_0x255b67['as'],'attributes':_0x255b67[_0x5e20('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x549f01){logger[_0x5e20('0xf')](_0x5e20('0x21'),_0x4196a3);logger['debug'](_0x5e20('0x21'),_0x4196a3,JSON[_0x5e20('0x13')](_0x549f01));_0x395a27(_0x549f01);})['catch'](function(_0x3f3908){logger[_0x5e20('0x14')](_0x5e20('0x21'),_0x3f3908[_0x5e20('0x16')],_0x4196a3);_0x4ff715(_0x1548c8[_0x5e20('0x14')](0x1f4,_0x3f3908[_0x5e20('0x16')]));});});}; \ No newline at end of file +var _0xb903=['info','result','findAll','options','raw','where','attributes','limit','map','include','model','then','GetSalesforceAccount','debug','stringify','ShowSalesforceAccount','SalesforceAccount','find','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','SalesforceAccount,\x20%s,\x20%s','message'];(function(_0x310a54,_0x212d9a){var _0x4e4caa=function(_0x6baec9){while(--_0x6baec9){_0x310a54['push'](_0x310a54['shift']());}};_0x4e4caa(++_0x212d9a);}(_0xb903,0x185));var _0x3b90=function(_0x10f2da,_0x485f2c){_0x10f2da=_0x10f2da-0x0;var _0x6267ed=_0xb903[_0x10f2da];return _0x6267ed;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});}exports['GetSalesforceAccount']=function(_0x269488){var _0x3cf281=this;return new Promise(function(_0x11ad7d,_0x131f3f){return db['SalesforceAccount'][_0x3b90('0x14')]({'raw':_0x269488['options']?_0x269488[_0x3b90('0x15')][_0x3b90('0x16')]===undefined?!![]:![]:!![],'where':_0x269488['options']?_0x269488[_0x3b90('0x15')][_0x3b90('0x17')]||null:null,'attributes':_0x269488[_0x3b90('0x15')]?_0x269488[_0x3b90('0x15')][_0x3b90('0x18')]||null:null,'limit':_0x269488[_0x3b90('0x15')]?_0x269488[_0x3b90('0x15')][_0x3b90('0x19')]||null:null,'include':_0x269488[_0x3b90('0x15')]?_0x269488[_0x3b90('0x15')]['include']?_[_0x3b90('0x1a')](_0x269488[_0x3b90('0x15')][_0x3b90('0x1b')],function(_0x7faee){return{'model':db[_0x7faee[_0x3b90('0x1c')]],'as':_0x7faee['as'],'attributes':_0x7faee[_0x3b90('0x18')],'include':_0x7faee['include']?_['map'](_0x7faee[_0x3b90('0x1b')],function(_0x29d472){return{'model':db[_0x29d472[_0x3b90('0x1c')]],'as':_0x29d472['as'],'attributes':_0x29d472[_0x3b90('0x18')],'include':_0x29d472['include']?_[_0x3b90('0x1a')](_0x29d472[_0x3b90('0x1b')],function(_0x1787d1){return{'model':db[_0x1787d1['model']],'as':_0x1787d1['as'],'attributes':_0x1787d1[_0x3b90('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3b90('0x1d')](function(_0x17ec7f){logger[_0x3b90('0x12')](_0x3b90('0x1e'),_0x269488);logger[_0x3b90('0x1f')]('GetSalesforceAccount',_0x269488,JSON[_0x3b90('0x20')](_0x17ec7f));_0x11ad7d(_0x17ec7f);})['catch'](function(_0xaf453c){logger[_0x3b90('0xf')](_0x3b90('0x1e'),_0xaf453c[_0x3b90('0x11')],_0x269488);_0x131f3f(_0x3cf281[_0x3b90('0xf')](0x1f4,_0xaf453c[_0x3b90('0x11')]));});});};exports[_0x3b90('0x21')]=function(_0x2430ec){var _0x500ceb=this;return new Promise(function(_0x4d1f31,_0x43bd4f){return db[_0x3b90('0x22')][_0x3b90('0x23')]({'raw':_0x2430ec[_0x3b90('0x15')]?_0x2430ec['options']['raw']===undefined?!![]:![]:!![],'where':_0x2430ec[_0x3b90('0x15')]?_0x2430ec[_0x3b90('0x15')][_0x3b90('0x17')]||null:null,'attributes':_0x2430ec['options']?_0x2430ec[_0x3b90('0x15')]['attributes']||null:null,'include':_0x2430ec['options']?_0x2430ec[_0x3b90('0x15')][_0x3b90('0x1b')]?_['map'](_0x2430ec[_0x3b90('0x15')][_0x3b90('0x1b')],function(_0x3e30b8){return{'model':db[_0x3e30b8['model']],'as':_0x3e30b8['as'],'attributes':_0x3e30b8['attributes'],'include':_0x3e30b8[_0x3b90('0x1b')]?_[_0x3b90('0x1a')](_0x3e30b8[_0x3b90('0x1b')],function(_0x401dc5){return{'model':db[_0x401dc5['model']],'as':_0x401dc5['as'],'attributes':_0x401dc5['attributes'],'include':_0x401dc5[_0x3b90('0x1b')]?_[_0x3b90('0x1a')](_0x401dc5['include'],function(_0x57946d){return{'model':db[_0x57946d[_0x3b90('0x1c')]],'as':_0x57946d['as'],'attributes':_0x57946d[_0x3b90('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3b90('0x1d')](function(_0x298df6){logger['info'](_0x3b90('0x21'),_0x2430ec);logger['debug'](_0x3b90('0x21'),_0x2430ec,JSON[_0x3b90('0x20')](_0x298df6));_0x4d1f31(_0x298df6);})[_0x3b90('0x24')](function(_0x20abf8){logger[_0x3b90('0xf')](_0x3b90('0x21'),_0x20abf8[_0x3b90('0x11')],_0x2430ec);_0x43bd4f(_0x500ceb['error'](0x1f4,_0x20abf8[_0x3b90('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 6334c33..6d5a522 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 _0x1ef0=['isAuthenticated','index','get','/:id','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller'];(function(_0x41cb6f,_0x236dba){var _0x540bde=function(_0x1ad6c8){while(--_0x1ad6c8){_0x41cb6f['push'](_0x41cb6f['shift']());}};_0x540bde(++_0x236dba);}(_0x1ef0,0x138));var _0x01ef=function(_0x2204ef,_0x10b4eb){_0x2204ef=_0x2204ef-0x0;var _0x4ac9f2=_0x1ef0[_0x2204ef];return _0x4ac9f2;};'use strict';var multer=require(_0x01ef('0x0'));var util=require(_0x01ef('0x1'));var path=require(_0x01ef('0x2'));var timeout=require(_0x01ef('0x3'));var express=require('express');var router=express[_0x01ef('0x4')]();var fs_extra=require(_0x01ef('0x5'));var auth=require(_0x01ef('0x6'));var interaction=require(_0x01ef('0x7'));var config=require(_0x01ef('0x8'));var controller=require(_0x01ef('0x9'));router['get']('/',auth[_0x01ef('0xa')](),controller[_0x01ef('0xb')]);router[_0x01ef('0xc')](_0x01ef('0xd'),auth[_0x01ef('0xa')](),controller['show']);router[_0x01ef('0xc')](_0x01ef('0xe'),auth[_0x01ef('0xa')](),controller['getFields']);router[_0x01ef('0xc')](_0x01ef('0xf'),auth[_0x01ef('0xa')](),controller[_0x01ef('0x10')]);router[_0x01ef('0xc')]('/:id/descriptions',auth[_0x01ef('0xa')](),controller[_0x01ef('0x11')]);router[_0x01ef('0x12')]('/',auth[_0x01ef('0xa')](),controller[_0x01ef('0x13')]);router[_0x01ef('0x14')](_0x01ef('0xd'),auth[_0x01ef('0xa')](),controller['update']);router[_0x01ef('0x15')](_0x01ef('0xd'),auth[_0x01ef('0xa')](),controller[_0x01ef('0x16')]);module['exports']=router; \ No newline at end of file +var _0x6355=['update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put'];(function(_0x52318f,_0x185680){var _0x30ede9=function(_0x3dfe04){while(--_0x3dfe04){_0x52318f['push'](_0x52318f['shift']());}};_0x30ede9(++_0x185680);}(_0x6355,0x153));var _0x5635=function(_0x229ad1,_0x3183c2){_0x229ad1=_0x229ad1-0x0;var _0x36ab81=_0x6355[_0x229ad1];return _0x36ab81;};'use strict';var multer=require(_0x5635('0x0'));var util=require(_0x5635('0x1'));var path=require('path');var timeout=require(_0x5635('0x2'));var express=require('express');var router=express[_0x5635('0x3')]();var fs_extra=require(_0x5635('0x4'));var auth=require(_0x5635('0x5'));var interaction=require(_0x5635('0x6'));var config=require(_0x5635('0x7'));var controller=require(_0x5635('0x8'));router['get']('/',auth[_0x5635('0x9')](),controller[_0x5635('0xa')]);router[_0x5635('0xb')](_0x5635('0xc'),auth[_0x5635('0x9')](),controller[_0x5635('0xd')]);router[_0x5635('0xb')](_0x5635('0xe'),auth[_0x5635('0x9')](),controller[_0x5635('0xf')]);router[_0x5635('0xb')](_0x5635('0x10'),auth[_0x5635('0x9')](),controller[_0x5635('0x11')]);router['get'](_0x5635('0x12'),auth[_0x5635('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0x5635('0x9')](),controller[_0x5635('0x13')]);router[_0x5635('0x14')](_0x5635('0xc'),auth[_0x5635('0x9')](),controller[_0x5635('0x15')]);router[_0x5635('0x16')]('/:id',auth[_0x5635('0x9')](),controller[_0x5635('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 4f8ab72..b4ceea9 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 _0x62d2=['exports','STRING','ENUM','Task','lead','account_contact_lead','account','contact_lead','sequelize'];(function(_0x1f10ff,_0x4d8a07){var _0x401eec=function(_0x3f9312){while(--_0x3f9312){_0x1f10ff['push'](_0x1f10ff['shift']());}};_0x401eec(++_0x4d8a07);}(_0x62d2,0xce));var _0x262d=function(_0x49fa98,_0x11accf){_0x49fa98=_0x49fa98-0x0;var _0x1698f1=_0x62d2[_0x49fa98];return _0x1698f1;};'use strict';var Sequelize=require(_0x262d('0x0'));module[_0x262d('0x1')]={'name':{'type':Sequelize[_0x262d('0x2')]},'description':{'type':Sequelize[_0x262d('0x2')]},'ticketType':{'type':Sequelize[_0x262d('0x3')](_0x262d('0x4'),'Case'),'defaultValue':_0x262d('0x4')},'moduleSearch':{'type':Sequelize[_0x262d('0x3')]('contact_lead','contact',_0x262d('0x5'),_0x262d('0x6'),_0x262d('0x7')),'defaultValue':_0x262d('0x8')},'moduleCreate':{'type':Sequelize[_0x262d('0x3')]('nothing','contact','lead',_0x262d('0x7')),'defaultValue':_0x262d('0x5')},'leadId':{'type':Sequelize[_0x262d('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x262d('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x262d('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9a02=['Task','Case','contact_lead','account_contact_lead','account','contact','lead','sequelize','exports','STRING','ENUM'];(function(_0x24189f,_0x193d3d){var _0xd85189=function(_0x1961a0){while(--_0x1961a0){_0x24189f['push'](_0x24189f['shift']());}};_0xd85189(++_0x193d3d);}(_0x9a02,0x15c));var _0x29a0=function(_0x2c911a,_0x433c80){_0x2c911a=_0x2c911a-0x0;var _0x4df395=_0x9a02[_0x2c911a];return _0x4df395;};'use strict';var Sequelize=require(_0x29a0('0x0'));module[_0x29a0('0x1')]={'name':{'type':Sequelize[_0x29a0('0x2')]},'description':{'type':Sequelize[_0x29a0('0x2')]},'ticketType':{'type':Sequelize[_0x29a0('0x3')](_0x29a0('0x4'),_0x29a0('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x29a0('0x6'),'contact','lead',_0x29a0('0x7'),_0x29a0('0x8')),'defaultValue':_0x29a0('0x6')},'moduleCreate':{'type':Sequelize[_0x29a0('0x3')]('nothing',_0x29a0('0x9'),'lead',_0x29a0('0x8')),'defaultValue':_0x29a0('0xa')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x29a0('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 746fe90..fdf9588 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 _0x980b=['client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','save','update','stack','name','send','map','SalesforceConfiguration','rawAttributes','key','model','query','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','type','VIRTUAL','include','findAll','catch','show','params','keys','length','includeAll','create','body','find','findOne','merge','options','nolimit','getFields','getSubjects','SalesforceField','getDescriptions','zip-dir','fast-json-patch','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise'];(function(_0x4c7425,_0x304790){var _0x564a6e=function(_0x1f94fe){while(--_0x1f94fe){_0x4c7425['push'](_0x4c7425['shift']());}};_0x564a6e(++_0x304790);}(_0x980b,0x143));var _0xb980=function(_0x27ba9b,_0x570bb6){_0x27ba9b=_0x27ba9b-0x0;var _0x32b62c=_0x980b[_0x27ba9b];return _0x32b62c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb980('0x0'));var jsonpatch=require(_0xb980('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb980('0x2'));var util=require(_0xb980('0x3'));var path=require(_0xb980('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb980('0x5'));var squel=require(_0xb980('0x6'));var crypto=require(_0xb980('0x7'));var jsforce=require(_0xb980('0x8'));var deskjs=require(_0xb980('0x9'));var toCsv=require(_0xb980('0xa'));var querystring=require(_0xb980('0xb'));var Papa=require(_0xb980('0xc'));var Redis=require(_0xb980('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xb980('0xe'));var as=require(_0xb980('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb980('0x10'));var config=require(_0xb980('0x11'));var licenseUtil=require(_0xb980('0x12'));var db=require(_0xb980('0x13'))['db'];var jayson=require(_0xb980('0x14'));var client=jayson[_0xb980('0x15')][_0xb980('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x5143f7,_0x1212b3,_0x39db2e,_0x5f01d4){return new BPromise(function(_0x4bf8d3,_0x2a19fa){var _0x3b8148=_0x5f01d4||client;return _0x3b8148[_0xb980('0x17')](_0x5143f7,_0x39db2e)[_0xb980('0x18')](function(_0xe1ef5f){logger[_0xb980('0x19')](_0xb980('0x1a'),_0x1212b3,'request\x20sent');logger[_0xb980('0x1b')](_0xb980('0x1c'),_0x1212b3,_0xb980('0x1d'),JSON[_0xb980('0x1e')](_0xe1ef5f));if(_0xe1ef5f[_0xb980('0x1f')]){if(_0xe1ef5f['error'][_0xb980('0x20')]===0x1f4){logger['error'](_0xb980('0x1a'),_0x1212b3,_0xe1ef5f[_0xb980('0x1f')][_0xb980('0x21')]);return _0x2a19fa(_0xe1ef5f[_0xb980('0x1f')][_0xb980('0x21')]);}logger[_0xb980('0x1f')](_0xb980('0x1a'),_0x1212b3,_0xe1ef5f[_0xb980('0x1f')][_0xb980('0x21')]);return _0x4bf8d3(_0xe1ef5f['error']['message']);}else{logger[_0xb980('0x19')](_0xb980('0x1a'),_0x1212b3,_0xb980('0x1d'));_0x4bf8d3(_0xe1ef5f['result']['message']);}})['catch'](function(_0x4cb6b0){logger[_0xb980('0x1f')](_0xb980('0x1a'),_0x1212b3,_0x4cb6b0);_0x2a19fa(_0x4cb6b0);});});}function respondWithStatusCode(_0x8c2ea9,_0x3ab640){_0x3ab640=_0x3ab640||0xcc;return function(_0x36ed5b){if(_0x36ed5b){return _0x8c2ea9[_0xb980('0x22')](_0x3ab640);}return _0x8c2ea9[_0xb980('0x23')](_0x3ab640)[_0xb980('0x24')]();};}function respondWithResult(_0x5fe7cf,_0x1cf06f){_0x1cf06f=_0x1cf06f||0xc8;return function(_0x21bd7d){if(_0x21bd7d){return _0x5fe7cf[_0xb980('0x23')](_0x1cf06f)[_0xb980('0x25')](_0x21bd7d);}};}function respondWithFilteredResult(_0x32c7d9,_0x56231f){return function(_0x456e8f){if(_0x456e8f){var _0x4af495=typeof _0x56231f[_0xb980('0x26')]===_0xb980('0x27')&&typeof _0x56231f['limit']===_0xb980('0x27');var _0x133942=_0x456e8f[_0xb980('0x28')];var _0x381911=_0x4af495?0x0:_0x56231f[_0xb980('0x26')];var _0xe8f648=_0x4af495?_0x456e8f['count']:_0x56231f[_0xb980('0x26')]+_0x56231f['limit'];var _0x65be6;if(_0xe8f648>=_0x133942){_0xe8f648=_0x133942;_0x65be6=0xc8;}else{_0x65be6=0xce;}_0x32c7d9[_0xb980('0x23')](_0x65be6);return _0x32c7d9[_0xb980('0x29')](_0xb980('0x2a'),_0x381911+'-'+_0xe8f648+'/'+_0x133942)['json'](_0x456e8f);}return null;};}function patchUpdates(_0x618b58){return function(_0x1b34f4){try{jsonpatch['apply'](_0x1b34f4,_0x618b58,!![]);}catch(_0x167ad2){return BPromise['reject'](_0x167ad2);}return _0x1b34f4[_0xb980('0x2b')]();};}function saveUpdates(_0x5ccfc4,_0x4cccc5){return function(_0x4bbdc0){if(_0x4bbdc0){return _0x4bbdc0[_0xb980('0x2c')](_0x5ccfc4)[_0xb980('0x18')](function(_0x481062){return _0x481062;});}return null;};}function removeEntity(_0x1d9755,_0x268f45){return function(_0x18d42c){if(_0x18d42c){return _0x18d42c['destroy']()[_0xb980('0x18')](function(){_0x1d9755[_0xb980('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa9d74c,_0x17ceec){return function(_0x4b9c82){if(!_0x4b9c82){_0xa9d74c[_0xb980('0x22')](0x194);}return _0x4b9c82;};}function handleError(_0x367545,_0x520c7f){_0x520c7f=_0x520c7f||0x1f4;return function(_0x19cd95){logger[_0xb980('0x1f')](_0x19cd95[_0xb980('0x2d')]);if(_0x19cd95[_0xb980('0x2e')]){delete _0x19cd95[_0xb980('0x2e')];}_0x367545[_0xb980('0x23')](_0x520c7f)[_0xb980('0x2f')](_0x19cd95);};}exports['index']=function(_0x49b0ac,_0xb8e918){var _0x2b81e6={},_0x12f9be={},_0x4aa985={'count':0x0,'rows':[]};var _0x235492=_[_0xb980('0x30')](db[_0xb980('0x31')][_0xb980('0x32')],function(_0x2e1b26){return{'name':_0x2e1b26['fieldName'],'type':_0x2e1b26['type'][_0xb980('0x33')]};});_0x12f9be[_0xb980('0x34')]=_[_0xb980('0x30')](_0x235492,'name');_0x12f9be[_0xb980('0x35')]=_['keys'](_0x49b0ac[_0xb980('0x35')]);_0x12f9be['filters']=_[_0xb980('0x36')](_0x12f9be['model'],_0x12f9be[_0xb980('0x35')]);_0x2b81e6[_0xb980('0x37')]=_['intersection'](_0x12f9be['model'],qs[_0xb980('0x38')](_0x49b0ac[_0xb980('0x35')][_0xb980('0x38')]));_0x2b81e6[_0xb980('0x37')]=_0x2b81e6[_0xb980('0x37')]['length']?_0x2b81e6[_0xb980('0x37')]:_0x12f9be[_0xb980('0x34')];if(!_0x49b0ac[_0xb980('0x35')][_0xb980('0x39')]('nolimit')){_0x2b81e6[_0xb980('0x3a')]=qs[_0xb980('0x3a')](_0x49b0ac[_0xb980('0x35')][_0xb980('0x3a')]);_0x2b81e6['offset']=qs[_0xb980('0x26')](_0x49b0ac[_0xb980('0x35')]['offset']);}_0x2b81e6[_0xb980('0x3b')]=qs[_0xb980('0x3c')](_0x49b0ac['query'][_0xb980('0x3c')]);_0x2b81e6[_0xb980('0x3d')]=qs[_0xb980('0x3e')](_[_0xb980('0x3f')](_0x49b0ac['query'],_0x12f9be[_0xb980('0x3e')]),_0x235492);if(_0x49b0ac[_0xb980('0x35')][_0xb980('0x40')]){_0x2b81e6[_0xb980('0x3d')]=_['merge'](_0x2b81e6[_0xb980('0x3d')],{'$or':_[_0xb980('0x30')](_0x235492,function(_0x3685d5){if(_0x3685d5[_0xb980('0x41')]!==_0xb980('0x42')){var _0xb8c9={};_0xb8c9[_0x3685d5[_0xb980('0x2e')]]={'$like':'%'+_0x49b0ac[_0xb980('0x35')][_0xb980('0x40')]+'%'};return _0xb8c9;}})});}_0x2b81e6=_['merge']({},_0x2b81e6,_0x49b0ac['options']);var _0x2a6b0f={'where':_0x2b81e6[_0xb980('0x3d')]};return db['SalesforceConfiguration'][_0xb980('0x28')](_0x2a6b0f)[_0xb980('0x18')](function(_0x4c833a){_0x4aa985[_0xb980('0x28')]=_0x4c833a;if(_0x49b0ac[_0xb980('0x35')]['includeAll']){_0x2b81e6[_0xb980('0x43')]=[{'all':!![]}];}return db[_0xb980('0x31')][_0xb980('0x44')](_0x2b81e6);})[_0xb980('0x18')](function(_0x430995){_0x4aa985['rows']=_0x430995;return _0x4aa985;})[_0xb980('0x18')](respondWithFilteredResult(_0xb8e918,_0x2b81e6))[_0xb980('0x45')](handleError(_0xb8e918,null));};exports[_0xb980('0x46')]=function(_0xd10654,_0xca3621){var _0x453150={'raw':![],'where':{'id':_0xd10654[_0xb980('0x47')]['id']}},_0x3fdd7c={};_0x3fdd7c['model']=_['keys'](db['SalesforceConfiguration'][_0xb980('0x32')]);_0x3fdd7c[_0xb980('0x35')]=_[_0xb980('0x48')](_0xd10654[_0xb980('0x35')]);_0x3fdd7c[_0xb980('0x3e')]=_[_0xb980('0x36')](_0x3fdd7c[_0xb980('0x34')],_0x3fdd7c['query']);_0x453150[_0xb980('0x37')]=_[_0xb980('0x36')](_0x3fdd7c[_0xb980('0x34')],qs[_0xb980('0x38')](_0xd10654[_0xb980('0x35')][_0xb980('0x38')]));_0x453150[_0xb980('0x37')]=_0x453150['attributes'][_0xb980('0x49')]?_0x453150[_0xb980('0x37')]:_0x3fdd7c[_0xb980('0x34')];if(_0xd10654[_0xb980('0x35')][_0xb980('0x4a')]){_0x453150[_0xb980('0x43')]=[{'all':!![]}];}_0x453150=_['merge']({},_0x453150,_0xd10654['options']);return db[_0xb980('0x31')]['find'](_0x453150)[_0xb980('0x18')](handleEntityNotFound(_0xca3621,null))[_0xb980('0x18')](respondWithResult(_0xca3621,null))[_0xb980('0x45')](handleError(_0xca3621,null));};exports[_0xb980('0x4b')]=function(_0x2ecddc,_0x232e10){return db[_0xb980('0x31')][_0xb980('0x4b')](_0x2ecddc[_0xb980('0x4c')],{})['then'](respondWithResult(_0x232e10,0xc9))[_0xb980('0x45')](handleError(_0x232e10,null));};exports[_0xb980('0x2c')]=function(_0x2ea908,_0xe0e16c){if(_0x2ea908[_0xb980('0x4c')]['id']){delete _0x2ea908[_0xb980('0x4c')]['id'];}return db[_0xb980('0x31')][_0xb980('0x4d')]({'where':{'id':_0x2ea908['params']['id']}})[_0xb980('0x18')](handleEntityNotFound(_0xe0e16c,null))[_0xb980('0x18')](saveUpdates(_0x2ea908[_0xb980('0x4c')],null))[_0xb980('0x18')](respondWithResult(_0xe0e16c,null))['catch'](handleError(_0xe0e16c,null));};exports['destroy']=function(_0x3b4336,_0x2aff3a){return db[_0xb980('0x31')][_0xb980('0x4d')]({'where':{'id':_0x3b4336['params']['id']}})[_0xb980('0x18')](handleEntityNotFound(_0x2aff3a,null))[_0xb980('0x18')](removeEntity(_0x2aff3a,null))['catch'](handleError(_0x2aff3a,null));};exports['getFields']=function(_0x413bdd,_0x51c2a4,_0x50ef94){var _0x29a9b3={};var _0x286bec={};var _0x1639bf;var _0x1c11b2;return db[_0xb980('0x31')][_0xb980('0x4e')]({'where':{'id':_0x413bdd[_0xb980('0x47')]['id']}})['then'](handleEntityNotFound(_0x51c2a4,null))['then'](function(_0x163dae){if(_0x163dae){_0x1639bf=_0x163dae;_0x286bec[_0xb980('0x34')]=_[_0xb980('0x48')](db['SalesforceField'][_0xb980('0x32')]);_0x286bec[_0xb980('0x35')]=_['keys'](_0x413bdd[_0xb980('0x35')]);_0x286bec[_0xb980('0x3e')]=_['intersection'](_0x286bec[_0xb980('0x34')],_0x286bec[_0xb980('0x35')]);_0x29a9b3[_0xb980('0x37')]=_[_0xb980('0x36')](_0x286bec[_0xb980('0x34')],qs[_0xb980('0x38')](_0x413bdd['query'][_0xb980('0x38')]));_0x29a9b3[_0xb980('0x37')]=_0x29a9b3[_0xb980('0x37')][_0xb980('0x49')]?_0x29a9b3['attributes']:_0x286bec[_0xb980('0x34')];_0x29a9b3[_0xb980('0x3b')]=qs[_0xb980('0x3c')](_0x413bdd['query']['sort']);_0x29a9b3[_0xb980('0x3d')]=qs[_0xb980('0x3e')](_['pick'](_0x413bdd[_0xb980('0x35')],_0x286bec[_0xb980('0x3e')]));if(_0x413bdd['query'][_0xb980('0x40')]){_0x29a9b3[_0xb980('0x3d')]=_['merge'](_0x29a9b3[_0xb980('0x3d')],{'$or':_[_0xb980('0x30')](_0x29a9b3[_0xb980('0x37')],function(_0x12633f){var _0x34ddff={};_0x34ddff[_0x12633f]={'$like':'%'+_0x413bdd[_0xb980('0x35')][_0xb980('0x40')]+'%'};return _0x34ddff;})});}_0x29a9b3=_[_0xb980('0x4f')]({},_0x29a9b3,_0x413bdd[_0xb980('0x50')]);return _0x1639bf['getFields'](_0x29a9b3);}})[_0xb980('0x18')](function(_0x343bdd){if(_0x343bdd){_0x1c11b2=_0x343bdd[_0xb980('0x49')];if(!_0x413bdd[_0xb980('0x35')][_0xb980('0x39')](_0xb980('0x51'))){_0x29a9b3[_0xb980('0x3a')]=qs[_0xb980('0x3a')](_0x413bdd[_0xb980('0x35')]['limit']);_0x29a9b3[_0xb980('0x26')]=qs[_0xb980('0x26')](_0x413bdd['query'][_0xb980('0x26')]);}return _0x1639bf[_0xb980('0x52')](_0x29a9b3);}})[_0xb980('0x18')](function(_0x2de4a8){if(_0x2de4a8){return _0x2de4a8?{'count':_0x1c11b2,'rows':_0x2de4a8}:null;}})[_0xb980('0x18')](respondWithResult(_0x51c2a4,null))[_0xb980('0x45')](handleError(_0x51c2a4,null));};exports[_0xb980('0x53')]=function(_0x10ad8f,_0x498e51,_0x407b77){var _0x1d521c={};var _0x2d080f={};var _0x2f981a;var _0x357d91;return db[_0xb980('0x31')][_0xb980('0x4e')]({'where':{'id':_0x10ad8f[_0xb980('0x47')]['id']}})[_0xb980('0x18')](handleEntityNotFound(_0x498e51,null))[_0xb980('0x18')](function(_0x7506be){if(_0x7506be){_0x2f981a=_0x7506be;_0x2d080f[_0xb980('0x34')]=_[_0xb980('0x48')](db[_0xb980('0x54')]['rawAttributes']);_0x2d080f[_0xb980('0x35')]=_['keys'](_0x10ad8f[_0xb980('0x35')]);_0x2d080f[_0xb980('0x3e')]=_[_0xb980('0x36')](_0x2d080f[_0xb980('0x34')],_0x2d080f['query']);_0x1d521c[_0xb980('0x37')]=_[_0xb980('0x36')](_0x2d080f[_0xb980('0x34')],qs[_0xb980('0x38')](_0x10ad8f[_0xb980('0x35')][_0xb980('0x38')]));_0x1d521c[_0xb980('0x37')]=_0x1d521c['attributes']['length']?_0x1d521c[_0xb980('0x37')]:_0x2d080f['model'];_0x1d521c[_0xb980('0x3b')]=qs['sort'](_0x10ad8f[_0xb980('0x35')]['sort']);_0x1d521c[_0xb980('0x3d')]=qs[_0xb980('0x3e')](_[_0xb980('0x3f')](_0x10ad8f[_0xb980('0x35')],_0x2d080f[_0xb980('0x3e')]));if(_0x10ad8f[_0xb980('0x35')]['filter']){_0x1d521c['where']=_['merge'](_0x1d521c[_0xb980('0x3d')],{'$or':_['map'](_0x1d521c[_0xb980('0x37')],function(_0x3c51b5){var _0x317c7b={};_0x317c7b[_0x3c51b5]={'$like':'%'+_0x10ad8f['query']['filter']+'%'};return _0x317c7b;})});}_0x1d521c=_[_0xb980('0x4f')]({},_0x1d521c,_0x10ad8f['options']);return _0x2f981a[_0xb980('0x53')](_0x1d521c);}})[_0xb980('0x18')](function(_0x11e865){if(_0x11e865){_0x357d91=_0x11e865[_0xb980('0x49')];if(!_0x10ad8f['query'][_0xb980('0x39')](_0xb980('0x51'))){_0x1d521c[_0xb980('0x3a')]=qs[_0xb980('0x3a')](_0x10ad8f[_0xb980('0x35')][_0xb980('0x3a')]);_0x1d521c[_0xb980('0x26')]=qs[_0xb980('0x26')](_0x10ad8f['query'][_0xb980('0x26')]);}return _0x2f981a[_0xb980('0x53')](_0x1d521c);}})[_0xb980('0x18')](function(_0x6d778e){if(_0x6d778e){return _0x6d778e?{'count':_0x357d91,'rows':_0x6d778e}:null;}})['then'](respondWithResult(_0x498e51,null))[_0xb980('0x45')](handleError(_0x498e51,null));};exports['getDescriptions']=function(_0x2f301e,_0x4c64f2,_0x1e79b8){var _0x55c642={};var _0x342792={};var _0x542f63;var _0x5ec0c6;return db[_0xb980('0x31')]['findOne']({'where':{'id':_0x2f301e[_0xb980('0x47')]['id']}})[_0xb980('0x18')](handleEntityNotFound(_0x4c64f2,null))[_0xb980('0x18')](function(_0x1105f4){if(_0x1105f4){_0x542f63=_0x1105f4;_0x342792[_0xb980('0x34')]=_[_0xb980('0x48')](db[_0xb980('0x54')][_0xb980('0x32')]);_0x342792[_0xb980('0x35')]=_[_0xb980('0x48')](_0x2f301e['query']);_0x342792[_0xb980('0x3e')]=_['intersection'](_0x342792[_0xb980('0x34')],_0x342792['query']);_0x55c642[_0xb980('0x37')]=_[_0xb980('0x36')](_0x342792[_0xb980('0x34')],qs[_0xb980('0x38')](_0x2f301e[_0xb980('0x35')][_0xb980('0x38')]));_0x55c642[_0xb980('0x37')]=_0x55c642['attributes'][_0xb980('0x49')]?_0x55c642['attributes']:_0x342792[_0xb980('0x34')];_0x55c642[_0xb980('0x3b')]=qs[_0xb980('0x3c')](_0x2f301e[_0xb980('0x35')]['sort']);_0x55c642[_0xb980('0x3d')]=qs[_0xb980('0x3e')](_[_0xb980('0x3f')](_0x2f301e[_0xb980('0x35')],_0x342792[_0xb980('0x3e')]));if(_0x2f301e['query'][_0xb980('0x40')]){_0x55c642[_0xb980('0x3d')]=_['merge'](_0x55c642['where'],{'$or':_[_0xb980('0x30')](_0x55c642[_0xb980('0x37')],function(_0x1fe324){var _0x206234={};_0x206234[_0x1fe324]={'$like':'%'+_0x2f301e[_0xb980('0x35')][_0xb980('0x40')]+'%'};return _0x206234;})});}_0x55c642=_[_0xb980('0x4f')]({},_0x55c642,_0x2f301e['options']);return _0x542f63[_0xb980('0x55')](_0x55c642);}})[_0xb980('0x18')](function(_0x521e23){if(_0x521e23){_0x5ec0c6=_0x521e23['length'];if(!_0x2f301e['query'][_0xb980('0x39')]('nolimit')){_0x55c642[_0xb980('0x3a')]=qs[_0xb980('0x3a')](_0x2f301e['query'][_0xb980('0x3a')]);_0x55c642[_0xb980('0x26')]=qs[_0xb980('0x26')](_0x2f301e[_0xb980('0x35')][_0xb980('0x26')]);}return _0x542f63[_0xb980('0x55')](_0x55c642);}})[_0xb980('0x18')](function(_0x514d3e){if(_0x514d3e){return _0x514d3e?{'count':_0x5ec0c6,'rows':_0x514d3e}:null;}})[_0xb980('0x18')](respondWithResult(_0x4c64f2,null))[_0xb980('0x45')](handleError(_0x4c64f2,null));}; \ No newline at end of file +var _0x9d4a=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','type','VIRTUAL','count','include','SalesforceConfiguration','findAll','rows','show','params','create','body','update','find','getFields','findOne','SalesforceField','sort','pick','options','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','set','Content-Range','apply','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x9d4a,0x7e));var _0xa9d4=function(_0x3846d8,_0x2c622b){_0x3846d8=_0x3846d8-0x0;var _0x277c07=_0x9d4a[_0x3846d8];return _0x277c07;};'use strict';var emlformat=require(_0xa9d4('0x0'));var rimraf=require(_0xa9d4('0x1'));var zipdir=require(_0xa9d4('0x2'));var jsonpatch=require(_0xa9d4('0x3'));var rp=require(_0xa9d4('0x4'));var moment=require(_0xa9d4('0x5'));var BPromise=require(_0xa9d4('0x6'));var Mustache=require(_0xa9d4('0x7'));var util=require(_0xa9d4('0x8'));var path=require(_0xa9d4('0x9'));var sox=require(_0xa9d4('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9d4('0xb'));var _=require(_0xa9d4('0xc'));var squel=require(_0xa9d4('0xd'));var crypto=require(_0xa9d4('0xe'));var jsforce=require(_0xa9d4('0xf'));var deskjs=require(_0xa9d4('0x10'));var toCsv=require(_0xa9d4('0x11'));var querystring=require(_0xa9d4('0x12'));var Papa=require(_0xa9d4('0x13'));var Redis=require(_0xa9d4('0x14'));var authService=require(_0xa9d4('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xa9d4('0x16'));var hardwareService=require(_0xa9d4('0x17'));var logger=require(_0xa9d4('0x18'))('api');var utils=require('../../config/utils');var config=require(_0xa9d4('0x19'));var licenseUtil=require(_0xa9d4('0x1a'));var db=require(_0xa9d4('0x1b'))['db'];var jayson=require(_0xa9d4('0x1c'));var client=jayson[_0xa9d4('0x1d')][_0xa9d4('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x106596,_0x5b09ca,_0x42f3ed,_0x564ae9){return new BPromise(function(_0x43151c,_0x40228f){var _0x48c0a0=_0x564ae9||client;return _0x48c0a0['request'](_0x106596,_0x42f3ed)[_0xa9d4('0x1f')](function(_0x56c2b3){logger[_0xa9d4('0x20')](_0xa9d4('0x21'),_0x5b09ca,_0xa9d4('0x22'));logger[_0xa9d4('0x23')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x5b09ca,'request\x20sent',JSON[_0xa9d4('0x24')](_0x56c2b3));if(_0x56c2b3['error']){if(_0x56c2b3[_0xa9d4('0x25')][_0xa9d4('0x26')]===0x1f4){logger['error'](_0xa9d4('0x21'),_0x5b09ca,_0x56c2b3[_0xa9d4('0x25')][_0xa9d4('0x27')]);return _0x40228f(_0x56c2b3[_0xa9d4('0x25')][_0xa9d4('0x27')]);}logger[_0xa9d4('0x25')](_0xa9d4('0x21'),_0x5b09ca,_0x56c2b3[_0xa9d4('0x25')][_0xa9d4('0x27')]);return _0x43151c(_0x56c2b3[_0xa9d4('0x25')][_0xa9d4('0x27')]);}else{logger[_0xa9d4('0x20')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5b09ca,_0xa9d4('0x22'));_0x43151c(_0x56c2b3['result']['message']);}})[_0xa9d4('0x28')](function(_0x4d6b18){logger[_0xa9d4('0x25')](_0xa9d4('0x21'),_0x5b09ca,_0x4d6b18);_0x40228f(_0x4d6b18);});});}function respondWithStatusCode(_0x55be7e,_0x36c450){_0x36c450=_0x36c450||0xcc;return function(_0x31eb3f){if(_0x31eb3f){return _0x55be7e['sendStatus'](_0x36c450);}return _0x55be7e[_0xa9d4('0x29')](_0x36c450)[_0xa9d4('0x2a')]();};}function respondWithResult(_0x381a8a,_0x444fc7){_0x444fc7=_0x444fc7||0xc8;return function(_0x5a8ad3){if(_0x5a8ad3){return _0x381a8a[_0xa9d4('0x29')](_0x444fc7)[_0xa9d4('0x2b')](_0x5a8ad3);}};}function respondWithFilteredResult(_0x36ffe7,_0x34f098){return function(_0xf3fc14){if(_0xf3fc14){var _0x1fedb7=typeof _0x34f098[_0xa9d4('0x2c')]===_0xa9d4('0x2d')&&typeof _0x34f098['limit']===_0xa9d4('0x2d');var _0x123583=_0xf3fc14['count'];var _0x8c4bc2=_0x1fedb7?0x0:_0x34f098[_0xa9d4('0x2c')];var _0xd25ae7=_0x1fedb7?_0xf3fc14['count']:_0x34f098['offset']+_0x34f098[_0xa9d4('0x2e')];var _0x1c83a3;if(_0xd25ae7>=_0x123583){_0xd25ae7=_0x123583;_0x1c83a3=0xc8;}else{_0x1c83a3=0xce;}_0x36ffe7[_0xa9d4('0x29')](_0x1c83a3);return _0x36ffe7[_0xa9d4('0x2f')](_0xa9d4('0x30'),_0x8c4bc2+'-'+_0xd25ae7+'/'+_0x123583)[_0xa9d4('0x2b')](_0xf3fc14);}return null;};}function patchUpdates(_0x4a2528){return function(_0x5022f8){try{jsonpatch[_0xa9d4('0x31')](_0x5022f8,_0x4a2528,!![]);}catch(_0xd032e5){return BPromise['reject'](_0xd032e5);}return _0x5022f8['save']();};}function saveUpdates(_0x12a11a,_0x746632){return function(_0x211358){if(_0x211358){return _0x211358['update'](_0x12a11a)[_0xa9d4('0x1f')](function(_0x3641d9){return _0x3641d9;});}return null;};}function removeEntity(_0x24538c,_0x1e2bd3){return function(_0x1911dd){if(_0x1911dd){return _0x1911dd[_0xa9d4('0x32')]()[_0xa9d4('0x1f')](function(){_0x24538c[_0xa9d4('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b5c3c,_0x384a06){return function(_0x5c3179){if(!_0x5c3179){_0x1b5c3c[_0xa9d4('0x33')](0x194);}return _0x5c3179;};}function handleError(_0x409090,_0x2aad09){_0x2aad09=_0x2aad09||0x1f4;return function(_0x3eb86d){logger['error'](_0x3eb86d[_0xa9d4('0x34')]);if(_0x3eb86d[_0xa9d4('0x35')]){delete _0x3eb86d['name'];}_0x409090[_0xa9d4('0x29')](_0x2aad09)[_0xa9d4('0x36')](_0x3eb86d);};}exports['index']=function(_0xea7b4e,_0x3f5a94){var _0x534c72={},_0x365ef6={},_0x1de7a4={'count':0x0,'rows':[]};var _0x122bc0=_[_0xa9d4('0x37')](db['SalesforceConfiguration'][_0xa9d4('0x38')],function(_0xd91c2a){return{'name':_0xd91c2a[_0xa9d4('0x39')],'type':_0xd91c2a['type'][_0xa9d4('0x3a')]};});_0x365ef6['model']=_['map'](_0x122bc0,_0xa9d4('0x35'));_0x365ef6[_0xa9d4('0x3b')]=_[_0xa9d4('0x3c')](_0xea7b4e[_0xa9d4('0x3b')]);_0x365ef6[_0xa9d4('0x3d')]=_[_0xa9d4('0x3e')](_0x365ef6[_0xa9d4('0x3f')],_0x365ef6[_0xa9d4('0x3b')]);_0x534c72[_0xa9d4('0x40')]=_[_0xa9d4('0x3e')](_0x365ef6[_0xa9d4('0x3f')],qs['fields'](_0xea7b4e[_0xa9d4('0x3b')][_0xa9d4('0x41')]));_0x534c72['attributes']=_0x534c72[_0xa9d4('0x40')][_0xa9d4('0x42')]?_0x534c72[_0xa9d4('0x40')]:_0x365ef6['model'];if(!_0xea7b4e['query'][_0xa9d4('0x43')](_0xa9d4('0x44'))){_0x534c72[_0xa9d4('0x2e')]=qs[_0xa9d4('0x2e')](_0xea7b4e[_0xa9d4('0x3b')][_0xa9d4('0x2e')]);_0x534c72['offset']=qs[_0xa9d4('0x2c')](_0xea7b4e[_0xa9d4('0x3b')]['offset']);}_0x534c72[_0xa9d4('0x45')]=qs['sort'](_0xea7b4e[_0xa9d4('0x3b')]['sort']);_0x534c72[_0xa9d4('0x46')]=qs['filters'](_['pick'](_0xea7b4e[_0xa9d4('0x3b')],_0x365ef6[_0xa9d4('0x3d')]),_0x122bc0);if(_0xea7b4e[_0xa9d4('0x3b')][_0xa9d4('0x47')]){_0x534c72[_0xa9d4('0x46')]=_[_0xa9d4('0x48')](_0x534c72[_0xa9d4('0x46')],{'$or':_['map'](_0x122bc0,function(_0x3be87b){if(_0x3be87b[_0xa9d4('0x49')]!==_0xa9d4('0x4a')){var _0x45a695={};_0x45a695[_0x3be87b[_0xa9d4('0x35')]]={'$like':'%'+_0xea7b4e[_0xa9d4('0x3b')][_0xa9d4('0x47')]+'%'};return _0x45a695;}})});}_0x534c72=_['merge']({},_0x534c72,_0xea7b4e['options']);var _0x5b7999={'where':_0x534c72[_0xa9d4('0x46')]};return db['SalesforceConfiguration']['count'](_0x5b7999)[_0xa9d4('0x1f')](function(_0x11b518){_0x1de7a4[_0xa9d4('0x4b')]=_0x11b518;if(_0xea7b4e[_0xa9d4('0x3b')]['includeAll']){_0x534c72[_0xa9d4('0x4c')]=[{'all':!![]}];}return db[_0xa9d4('0x4d')][_0xa9d4('0x4e')](_0x534c72);})[_0xa9d4('0x1f')](function(_0x511ea8){_0x1de7a4[_0xa9d4('0x4f')]=_0x511ea8;return _0x1de7a4;})[_0xa9d4('0x1f')](respondWithFilteredResult(_0x3f5a94,_0x534c72))[_0xa9d4('0x28')](handleError(_0x3f5a94,null));};exports[_0xa9d4('0x50')]=function(_0xbf9fde,_0x4f364c){var _0x3d88fd={'raw':![],'where':{'id':_0xbf9fde[_0xa9d4('0x51')]['id']}},_0x24513e={};_0x24513e[_0xa9d4('0x3f')]=_['keys'](db[_0xa9d4('0x4d')]['rawAttributes']);_0x24513e['query']=_[_0xa9d4('0x3c')](_0xbf9fde[_0xa9d4('0x3b')]);_0x24513e[_0xa9d4('0x3d')]=_[_0xa9d4('0x3e')](_0x24513e[_0xa9d4('0x3f')],_0x24513e[_0xa9d4('0x3b')]);_0x3d88fd['attributes']=_[_0xa9d4('0x3e')](_0x24513e['model'],qs['fields'](_0xbf9fde[_0xa9d4('0x3b')][_0xa9d4('0x41')]));_0x3d88fd[_0xa9d4('0x40')]=_0x3d88fd[_0xa9d4('0x40')][_0xa9d4('0x42')]?_0x3d88fd[_0xa9d4('0x40')]:_0x24513e[_0xa9d4('0x3f')];if(_0xbf9fde['query']['includeAll']){_0x3d88fd[_0xa9d4('0x4c')]=[{'all':!![]}];}_0x3d88fd=_[_0xa9d4('0x48')]({},_0x3d88fd,_0xbf9fde['options']);return db[_0xa9d4('0x4d')]['find'](_0x3d88fd)[_0xa9d4('0x1f')](handleEntityNotFound(_0x4f364c,null))[_0xa9d4('0x1f')](respondWithResult(_0x4f364c,null))[_0xa9d4('0x28')](handleError(_0x4f364c,null));};exports[_0xa9d4('0x52')]=function(_0x19171b,_0x329f54){return db[_0xa9d4('0x4d')]['create'](_0x19171b[_0xa9d4('0x53')],{})[_0xa9d4('0x1f')](respondWithResult(_0x329f54,0xc9))[_0xa9d4('0x28')](handleError(_0x329f54,null));};exports[_0xa9d4('0x54')]=function(_0x14c2c2,_0x4317f3){if(_0x14c2c2['body']['id']){delete _0x14c2c2[_0xa9d4('0x53')]['id'];}return db[_0xa9d4('0x4d')][_0xa9d4('0x55')]({'where':{'id':_0x14c2c2['params']['id']}})[_0xa9d4('0x1f')](handleEntityNotFound(_0x4317f3,null))[_0xa9d4('0x1f')](saveUpdates(_0x14c2c2[_0xa9d4('0x53')],null))[_0xa9d4('0x1f')](respondWithResult(_0x4317f3,null))[_0xa9d4('0x28')](handleError(_0x4317f3,null));};exports[_0xa9d4('0x32')]=function(_0x556338,_0x6f6621){return db[_0xa9d4('0x4d')][_0xa9d4('0x55')]({'where':{'id':_0x556338[_0xa9d4('0x51')]['id']}})['then'](handleEntityNotFound(_0x6f6621,null))['then'](removeEntity(_0x6f6621,null))['catch'](handleError(_0x6f6621,null));};exports[_0xa9d4('0x56')]=function(_0x394f2b,_0x5c37d3,_0xcfc670){var _0x5e3a81={};var _0x2045ac={};var _0x4d309a;var _0x546201;return db[_0xa9d4('0x4d')][_0xa9d4('0x57')]({'where':{'id':_0x394f2b['params']['id']}})[_0xa9d4('0x1f')](handleEntityNotFound(_0x5c37d3,null))['then'](function(_0x3d7d00){if(_0x3d7d00){_0x4d309a=_0x3d7d00;_0x2045ac['model']=_[_0xa9d4('0x3c')](db[_0xa9d4('0x58')][_0xa9d4('0x38')]);_0x2045ac['query']=_[_0xa9d4('0x3c')](_0x394f2b[_0xa9d4('0x3b')]);_0x2045ac[_0xa9d4('0x3d')]=_[_0xa9d4('0x3e')](_0x2045ac[_0xa9d4('0x3f')],_0x2045ac[_0xa9d4('0x3b')]);_0x5e3a81[_0xa9d4('0x40')]=_[_0xa9d4('0x3e')](_0x2045ac[_0xa9d4('0x3f')],qs[_0xa9d4('0x41')](_0x394f2b[_0xa9d4('0x3b')]['fields']));_0x5e3a81[_0xa9d4('0x40')]=_0x5e3a81[_0xa9d4('0x40')][_0xa9d4('0x42')]?_0x5e3a81[_0xa9d4('0x40')]:_0x2045ac['model'];_0x5e3a81[_0xa9d4('0x45')]=qs[_0xa9d4('0x59')](_0x394f2b['query'][_0xa9d4('0x59')]);_0x5e3a81[_0xa9d4('0x46')]=qs[_0xa9d4('0x3d')](_[_0xa9d4('0x5a')](_0x394f2b[_0xa9d4('0x3b')],_0x2045ac[_0xa9d4('0x3d')]));if(_0x394f2b['query'][_0xa9d4('0x47')]){_0x5e3a81[_0xa9d4('0x46')]=_[_0xa9d4('0x48')](_0x5e3a81['where'],{'$or':_[_0xa9d4('0x37')](_0x5e3a81[_0xa9d4('0x40')],function(_0x236c00){var _0x16ec8d={};_0x16ec8d[_0x236c00]={'$like':'%'+_0x394f2b['query']['filter']+'%'};return _0x16ec8d;})});}_0x5e3a81=_['merge']({},_0x5e3a81,_0x394f2b[_0xa9d4('0x5b')]);return _0x4d309a[_0xa9d4('0x56')](_0x5e3a81);}})[_0xa9d4('0x1f')](function(_0x28af65){if(_0x28af65){_0x546201=_0x28af65[_0xa9d4('0x42')];if(!_0x394f2b[_0xa9d4('0x3b')][_0xa9d4('0x43')](_0xa9d4('0x44'))){_0x5e3a81[_0xa9d4('0x2e')]=qs[_0xa9d4('0x2e')](_0x394f2b[_0xa9d4('0x3b')][_0xa9d4('0x2e')]);_0x5e3a81[_0xa9d4('0x2c')]=qs[_0xa9d4('0x2c')](_0x394f2b[_0xa9d4('0x3b')]['offset']);}return _0x4d309a[_0xa9d4('0x56')](_0x5e3a81);}})['then'](function(_0x187686){if(_0x187686){return _0x187686?{'count':_0x546201,'rows':_0x187686}:null;}})['then'](respondWithResult(_0x5c37d3,null))[_0xa9d4('0x28')](handleError(_0x5c37d3,null));};exports['getSubjects']=function(_0x25cd64,_0x30b7d4,_0xb715f8){var _0x525a5d={};var _0x234f99={};var _0x1bf98e;var _0x2ae5d2;return db[_0xa9d4('0x4d')][_0xa9d4('0x57')]({'where':{'id':_0x25cd64[_0xa9d4('0x51')]['id']}})[_0xa9d4('0x1f')](handleEntityNotFound(_0x30b7d4,null))[_0xa9d4('0x1f')](function(_0x5c7e2b){if(_0x5c7e2b){_0x1bf98e=_0x5c7e2b;_0x234f99[_0xa9d4('0x3f')]=_[_0xa9d4('0x3c')](db[_0xa9d4('0x58')][_0xa9d4('0x38')]);_0x234f99[_0xa9d4('0x3b')]=_[_0xa9d4('0x3c')](_0x25cd64[_0xa9d4('0x3b')]);_0x234f99[_0xa9d4('0x3d')]=_[_0xa9d4('0x3e')](_0x234f99[_0xa9d4('0x3f')],_0x234f99[_0xa9d4('0x3b')]);_0x525a5d[_0xa9d4('0x40')]=_['intersection'](_0x234f99[_0xa9d4('0x3f')],qs[_0xa9d4('0x41')](_0x25cd64[_0xa9d4('0x3b')][_0xa9d4('0x41')]));_0x525a5d['attributes']=_0x525a5d['attributes']['length']?_0x525a5d[_0xa9d4('0x40')]:_0x234f99[_0xa9d4('0x3f')];_0x525a5d[_0xa9d4('0x45')]=qs[_0xa9d4('0x59')](_0x25cd64[_0xa9d4('0x3b')][_0xa9d4('0x59')]);_0x525a5d['where']=qs[_0xa9d4('0x3d')](_[_0xa9d4('0x5a')](_0x25cd64[_0xa9d4('0x3b')],_0x234f99[_0xa9d4('0x3d')]));if(_0x25cd64[_0xa9d4('0x3b')][_0xa9d4('0x47')]){_0x525a5d[_0xa9d4('0x46')]=_['merge'](_0x525a5d[_0xa9d4('0x46')],{'$or':_['map'](_0x525a5d[_0xa9d4('0x40')],function(_0x251dc0){var _0x5365b9={};_0x5365b9[_0x251dc0]={'$like':'%'+_0x25cd64[_0xa9d4('0x3b')][_0xa9d4('0x47')]+'%'};return _0x5365b9;})});}_0x525a5d=_['merge']({},_0x525a5d,_0x25cd64['options']);return _0x1bf98e['getSubjects'](_0x525a5d);}})['then'](function(_0x2bfbe9){if(_0x2bfbe9){_0x2ae5d2=_0x2bfbe9[_0xa9d4('0x42')];if(!_0x25cd64[_0xa9d4('0x3b')]['hasOwnProperty'](_0xa9d4('0x44'))){_0x525a5d['limit']=qs[_0xa9d4('0x2e')](_0x25cd64[_0xa9d4('0x3b')][_0xa9d4('0x2e')]);_0x525a5d['offset']=qs[_0xa9d4('0x2c')](_0x25cd64[_0xa9d4('0x3b')][_0xa9d4('0x2c')]);}return _0x1bf98e[_0xa9d4('0x5c')](_0x525a5d);}})[_0xa9d4('0x1f')](function(_0x4dc57c){if(_0x4dc57c){return _0x4dc57c?{'count':_0x2ae5d2,'rows':_0x4dc57c}:null;}})[_0xa9d4('0x1f')](respondWithResult(_0x30b7d4,null))[_0xa9d4('0x28')](handleError(_0x30b7d4,null));};exports[_0xa9d4('0x5d')]=function(_0x15edaf,_0x32712e,_0x25b404){var _0x370cdb={};var _0x372bf6={};var _0x463e6d;var _0x284575;return db[_0xa9d4('0x4d')]['findOne']({'where':{'id':_0x15edaf[_0xa9d4('0x51')]['id']}})[_0xa9d4('0x1f')](handleEntityNotFound(_0x32712e,null))[_0xa9d4('0x1f')](function(_0x27d5e0){if(_0x27d5e0){_0x463e6d=_0x27d5e0;_0x372bf6[_0xa9d4('0x3f')]=_['keys'](db[_0xa9d4('0x58')][_0xa9d4('0x38')]);_0x372bf6[_0xa9d4('0x3b')]=_[_0xa9d4('0x3c')](_0x15edaf[_0xa9d4('0x3b')]);_0x372bf6[_0xa9d4('0x3d')]=_[_0xa9d4('0x3e')](_0x372bf6[_0xa9d4('0x3f')],_0x372bf6[_0xa9d4('0x3b')]);_0x370cdb[_0xa9d4('0x40')]=_['intersection'](_0x372bf6[_0xa9d4('0x3f')],qs['fields'](_0x15edaf[_0xa9d4('0x3b')]['fields']));_0x370cdb[_0xa9d4('0x40')]=_0x370cdb['attributes'][_0xa9d4('0x42')]?_0x370cdb[_0xa9d4('0x40')]:_0x372bf6[_0xa9d4('0x3f')];_0x370cdb[_0xa9d4('0x45')]=qs[_0xa9d4('0x59')](_0x15edaf[_0xa9d4('0x3b')][_0xa9d4('0x59')]);_0x370cdb[_0xa9d4('0x46')]=qs[_0xa9d4('0x3d')](_['pick'](_0x15edaf['query'],_0x372bf6[_0xa9d4('0x3d')]));if(_0x15edaf[_0xa9d4('0x3b')][_0xa9d4('0x47')]){_0x370cdb[_0xa9d4('0x46')]=_[_0xa9d4('0x48')](_0x370cdb[_0xa9d4('0x46')],{'$or':_['map'](_0x370cdb['attributes'],function(_0x504681){var _0x1fccc6={};_0x1fccc6[_0x504681]={'$like':'%'+_0x15edaf[_0xa9d4('0x3b')][_0xa9d4('0x47')]+'%'};return _0x1fccc6;})});}_0x370cdb=_[_0xa9d4('0x48')]({},_0x370cdb,_0x15edaf[_0xa9d4('0x5b')]);return _0x463e6d[_0xa9d4('0x5d')](_0x370cdb);}})['then'](function(_0x5d89d6){if(_0x5d89d6){_0x284575=_0x5d89d6[_0xa9d4('0x42')];if(!_0x15edaf[_0xa9d4('0x3b')][_0xa9d4('0x43')](_0xa9d4('0x44'))){_0x370cdb['limit']=qs[_0xa9d4('0x2e')](_0x15edaf[_0xa9d4('0x3b')][_0xa9d4('0x2e')]);_0x370cdb[_0xa9d4('0x2c')]=qs[_0xa9d4('0x2c')](_0x15edaf[_0xa9d4('0x3b')]['offset']);}return _0x463e6d[_0xa9d4('0x5d')](_0x370cdb);}})[_0xa9d4('0x1f')](function(_0x591869){if(_0x591869){return _0x591869?{'count':_0x284575,'rows':_0x591869}:null;}})[_0xa9d4('0x1f')](respondWithResult(_0x32712e,null))['catch'](handleError(_0x32712e,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 0367d26..ebd7b0e 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 _0x2608=['rimraf','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2608,0x65));var _0x8260=function(_0xda023d,_0x2a8199){_0xda023d=_0xda023d-0x0;var _0x43855d=_0x2608[_0xda023d];return _0x43855d;};'use strict';var _=require(_0x8260('0x0'));var util=require(_0x8260('0x1'));var logger=require('../../config/logger')(_0x8260('0x2'));var moment=require(_0x8260('0x3'));var BPromise=require(_0x8260('0x4'));var rp=require(_0x8260('0x5'));var fs=require('fs');var path=require(_0x8260('0x6'));var rimraf=require(_0x8260('0x7'));var config=require('../../config/environment');var attributes=require(_0x8260('0x8'));module[_0x8260('0x9')]=function(_0x173ee9,_0x3c316d){return _0x173ee9[_0x8260('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0x8260('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d07=['./intSalesforceConfiguration.attributes','exports','define','lodash','api','moment','request-promise','rimraf','../../config/environment'];(function(_0xe298d1,_0x4c10db){var _0xd0825=function(_0x3b6c6f){while(--_0x3b6c6f){_0xe298d1['push'](_0xe298d1['shift']());}};_0xd0825(++_0x4c10db);}(_0x7d07,0xdb));var _0x77d0=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0x7d07[_0x22431e];return _0xd978e9;};'use strict';var _=require(_0x77d0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x77d0('0x1'));var moment=require(_0x77d0('0x2'));var BPromise=require('bluebird');var rp=require(_0x77d0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77d0('0x4'));var config=require(_0x77d0('0x5'));var attributes=require(_0x77d0('0x6'));module[_0x77d0('0x7')]=function(_0x5e8aa2,_0xa669b1){return _0x5e8aa2[_0x77d0('0x8')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index f7cddb5..c7380cb 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 _0xd443=['debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x1ef560,_0x281094){var _0xdccd1=function(_0x4f7fba){while(--_0x4f7fba){_0x1ef560['push'](_0x1ef560['shift']());}};_0xdccd1(++_0x281094);}(_0xd443,0x8b));var _0x3d44=function(_0x5cc806,_0x513bbe){_0x5cc806=_0x5cc806-0x0;var _0x46290a=_0xd443[_0x5cc806];return _0x46290a;};'use strict';var _=require(_0x3d44('0x0'));var util=require(_0x3d44('0x1'));var moment=require(_0x3d44('0x2'));var BPromise=require(_0x3d44('0x3'));var rs=require(_0x3d44('0x4'));var fs=require('fs');var Redis=require(_0x3d44('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d44('0x6'));var logger=require(_0x3d44('0x7'))(_0x3d44('0x8'));var config=require(_0x3d44('0x9'));var jayson=require(_0x3d44('0xa'));var client=jayson[_0x3d44('0xb')][_0x3d44('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e90b2,_0x540176,_0x36895a){return new BPromise(function(_0x4f2070,_0x4bc9cf){return client[_0x3d44('0xd')](_0x5e90b2,_0x36895a)[_0x3d44('0xe')](function(_0x2d7eff){logger[_0x3d44('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x540176,_0x3d44('0x10'));logger[_0x3d44('0x11')](_0x3d44('0x12'),_0x540176,'request\x20sent',JSON[_0x3d44('0x13')](_0x2d7eff));if(_0x2d7eff[_0x3d44('0x14')]){if(_0x2d7eff[_0x3d44('0x14')][_0x3d44('0x15')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x540176,_0x2d7eff[_0x3d44('0x14')][_0x3d44('0x16')]);return _0x4bc9cf(_0x2d7eff['error'][_0x3d44('0x16')]);}logger['error'](_0x3d44('0x17'),_0x540176,_0x2d7eff[_0x3d44('0x14')][_0x3d44('0x16')]);return _0x4f2070(_0x2d7eff['error'][_0x3d44('0x16')]);}else{logger[_0x3d44('0xf')](_0x3d44('0x17'),_0x540176,_0x3d44('0x10'));_0x4f2070(_0x2d7eff[_0x3d44('0x18')][_0x3d44('0x16')]);}})[_0x3d44('0x19')](function(_0x4670cd){logger['error'](_0x3d44('0x17'),_0x540176,_0x4670cd);_0x4bc9cf(_0x4670cd);});});} \ No newline at end of file +var _0xe00f=['lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result'];(function(_0xf333d2,_0x44d7f8){var _0x39fadb=function(_0x42d01a){while(--_0x42d01a){_0xf333d2['push'](_0xf333d2['shift']());}};_0x39fadb(++_0x44d7f8);}(_0xe00f,0x168));var _0xfe00=function(_0x2b6600,_0x24c497){_0x2b6600=_0x2b6600-0x0;var _0x912ee2=_0xe00f[_0x2b6600];return _0x912ee2;};'use strict';var _=require(_0xfe00('0x0'));var util=require(_0xfe00('0x1'));var moment=require('moment');var BPromise=require(_0xfe00('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe00('0x3'))['db'];var utils=require(_0xfe00('0x4'));var logger=require(_0xfe00('0x5'))('rpc');var config=require(_0xfe00('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfe00('0x7')][_0xfe00('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbfed53,_0x1cadaa,_0x3c16dc){return new BPromise(function(_0x1a6c66,_0x375ec4){return client[_0xfe00('0x9')](_0xbfed53,_0x3c16dc)[_0xfe00('0xa')](function(_0x1de53b){logger['info'](_0xfe00('0xb'),_0x1cadaa,_0xfe00('0xc'));logger[_0xfe00('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x1cadaa,'request\x20sent',JSON['stringify'](_0x1de53b));if(_0x1de53b[_0xfe00('0xe')]){if(_0x1de53b[_0xfe00('0xe')]['code']===0x1f4){logger[_0xfe00('0xe')](_0xfe00('0xb'),_0x1cadaa,_0x1de53b[_0xfe00('0xe')][_0xfe00('0xf')]);return _0x375ec4(_0x1de53b[_0xfe00('0xe')]['message']);}logger[_0xfe00('0xe')](_0xfe00('0xb'),_0x1cadaa,_0x1de53b[_0xfe00('0xe')][_0xfe00('0xf')]);return _0x1a6c66(_0x1de53b[_0xfe00('0xe')][_0xfe00('0xf')]);}else{logger[_0xfe00('0x10')](_0xfe00('0xb'),_0x1cadaa,_0xfe00('0xc'));_0x1a6c66(_0x1de53b[_0xfe00('0x11')][_0xfe00('0xf')]);}})['catch'](function(_0x8fc696){logger[_0xfe00('0xe')](_0xfe00('0xb'),_0x1cadaa,_0x8fc696);_0x375ec4(_0x8fc696);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 59e1681..8b79dc2 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 _0xcac2=['get','isAuthenticated','index','/:id','put','delete','destroy','multer','util','path','express','Router','./intSalesforceField.controller'];(function(_0x4e68be,_0x57ec0e){var _0x234853=function(_0x449642){while(--_0x449642){_0x4e68be['push'](_0x4e68be['shift']());}};_0x234853(++_0x57ec0e);}(_0xcac2,0x1e8));var _0x2cac=function(_0x1ee70a,_0x34f506){_0x1ee70a=_0x1ee70a-0x0;var _0x1256cf=_0xcac2[_0x1ee70a];return _0x1256cf;};'use strict';var multer=require(_0x2cac('0x0'));var util=require(_0x2cac('0x1'));var path=require(_0x2cac('0x2'));var timeout=require('connect-timeout');var express=require(_0x2cac('0x3'));var router=express[_0x2cac('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2cac('0x5'));router[_0x2cac('0x6')]('/',auth[_0x2cac('0x7')](),controller[_0x2cac('0x8')]);router[_0x2cac('0x6')](_0x2cac('0x9'),auth[_0x2cac('0x7')](),controller['show']);router['post']('/',auth[_0x2cac('0x7')](),controller['create']);router[_0x2cac('0xa')](_0x2cac('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x2cac('0xb')](_0x2cac('0x9'),auth['isAuthenticated'](),controller[_0x2cac('0xc')]);module['exports']=router; \ No newline at end of file +var _0xf7d9=['delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x14b195,_0x460868){var _0x42f003=function(_0x266e88){while(--_0x266e88){_0x14b195['push'](_0x14b195['shift']());}};_0x42f003(++_0x460868);}(_0xf7d9,0x122));var _0x9f7d=function(_0x403af9,_0x11d485){_0x403af9=_0x403af9-0x0;var _0x27e253=_0xf7d9[_0x403af9];return _0x27e253;};'use strict';var multer=require(_0x9f7d('0x0'));var util=require(_0x9f7d('0x1'));var path=require(_0x9f7d('0x2'));var timeout=require(_0x9f7d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9f7d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9f7d('0x5'));var config=require(_0x9f7d('0x6'));var controller=require(_0x9f7d('0x7'));router[_0x9f7d('0x8')]('/',auth[_0x9f7d('0x9')](),controller['index']);router['get'](_0x9f7d('0xa'),auth[_0x9f7d('0x9')](),controller[_0x9f7d('0xb')]);router[_0x9f7d('0xc')]('/',auth[_0x9f7d('0x9')](),controller[_0x9f7d('0xd')]);router['put'](_0x9f7d('0xa'),auth[_0x9f7d('0x9')](),controller['update']);router[_0x9f7d('0xe')](_0x9f7d('0xa'),auth[_0x9f7d('0x9')](),controller['destroy']);module[_0x9f7d('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 6e37716..31e388e 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 _0x70e0=['picklist','string','STRING','sequelize','exports','ENUM','customVariable','keyValue'];(function(_0x353cb5,_0x5982a9){var _0x10840a=function(_0x16adb1){while(--_0x16adb1){_0x353cb5['push'](_0x353cb5['shift']());}};_0x10840a(++_0x5982a9);}(_0x70e0,0x17b));var _0x070e=function(_0x145ac7,_0x34f629){_0x145ac7=_0x145ac7-0x0;var _0xdd8ab3=_0x70e0[_0x145ac7];return _0xdd8ab3;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'type':{'type':Sequelize[_0x070e('0x2')]('string','variable',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'defaultValue':_0x070e('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x070e('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x070e('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x070e('0x7')]},'variableName':{'type':Sequelize[_0x070e('0x7')]}}; \ No newline at end of file +var _0xcb91=['string','variable','customVariable','picklist','STRING','ENUM'];(function(_0x5322c3,_0x307e98){var _0x4f0c61=function(_0x1e521f){while(--_0x1e521f){_0x5322c3['push'](_0x5322c3['shift']());}};_0x4f0c61(++_0x307e98);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0xcb91[_0xdd2bfa];return _0x55397e;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1cb9('0x0')](_0x1cb9('0x1'),_0x1cb9('0x2'),_0x1cb9('0x3'),'keyValue',_0x1cb9('0x4')),'defaultValue':_0x1cb9('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1cb9('0x5')]},'keyType':{'type':Sequelize[_0x1cb9('0x0')]('string',_0x1cb9('0x2'),_0x1cb9('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1cb9('0x5')]},'variableName':{'type':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 059bb0c..cfbbfd4 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 _0xb586=['model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','show','params','intersection','options','catch','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','keys','query','filters'];(function(_0x114d60,_0x462104){var _0x331ed5=function(_0x477082){while(--_0x477082){_0x114d60['push'](_0x114d60['shift']());}};_0x331ed5(++_0x462104);}(_0xb586,0x10c));var _0x6b58=function(_0x58de4a,_0x564dbc){_0x58de4a=_0x58de4a-0x0;var _0x178820=_0xb586[_0x58de4a];return _0x178820;};'use strict';var emlformat=require(_0x6b58('0x0'));var rimraf=require(_0x6b58('0x1'));var zipdir=require(_0x6b58('0x2'));var jsonpatch=require(_0x6b58('0x3'));var rp=require(_0x6b58('0x4'));var moment=require(_0x6b58('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6b58('0x6'));var util=require(_0x6b58('0x7'));var path=require(_0x6b58('0x8'));var sox=require(_0x6b58('0x9'));var csv=require(_0x6b58('0xa'));var ejs=require(_0x6b58('0xb'));var fs=require('fs');var fs_extra=require(_0x6b58('0xc'));var _=require(_0x6b58('0xd'));var squel=require(_0x6b58('0xe'));var crypto=require(_0x6b58('0xf'));var jsforce=require(_0x6b58('0x10'));var deskjs=require(_0x6b58('0x11'));var toCsv=require(_0x6b58('0xa'));var querystring=require(_0x6b58('0x12'));var Papa=require(_0x6b58('0x13'));var Redis=require(_0x6b58('0x14'));var authService=require(_0x6b58('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b58('0x16'));var logger=require(_0x6b58('0x17'))(_0x6b58('0x18'));var utils=require(_0x6b58('0x19'));var config=require(_0x6b58('0x1a'));var licenseUtil=require(_0x6b58('0x1b'));var db=require(_0x6b58('0x1c'))['db'];function respondWithStatusCode(_0x169ed8,_0x1a57a2){_0x1a57a2=_0x1a57a2||0xcc;return function(_0x2bcbaf){if(_0x2bcbaf){return _0x169ed8[_0x6b58('0x1d')](_0x1a57a2);}return _0x169ed8[_0x6b58('0x1e')](_0x1a57a2)[_0x6b58('0x1f')]();};}function respondWithResult(_0x444e98,_0x1a1f75){_0x1a1f75=_0x1a1f75||0xc8;return function(_0x32d10e){if(_0x32d10e){return _0x444e98[_0x6b58('0x1e')](_0x1a1f75)['json'](_0x32d10e);}};}function respondWithFilteredResult(_0x2fb620,_0xe4b29e){return function(_0x4dc4d6){if(_0x4dc4d6){var _0x4bf4b1=typeof _0xe4b29e[_0x6b58('0x20')]===_0x6b58('0x21')&&typeof _0xe4b29e[_0x6b58('0x22')]==='undefined';var _0x4bfb8c=_0x4dc4d6['count'];var _0x4e32d0=_0x4bf4b1?0x0:_0xe4b29e[_0x6b58('0x20')];var _0x109f70=_0x4bf4b1?_0x4dc4d6['count']:_0xe4b29e[_0x6b58('0x20')]+_0xe4b29e['limit'];var _0x38f81c;if(_0x109f70>=_0x4bfb8c){_0x109f70=_0x4bfb8c;_0x38f81c=0xc8;}else{_0x38f81c=0xce;}_0x2fb620[_0x6b58('0x1e')](_0x38f81c);return _0x2fb620['set'](_0x6b58('0x23'),_0x4e32d0+'-'+_0x109f70+'/'+_0x4bfb8c)[_0x6b58('0x24')](_0x4dc4d6);}return null;};}function patchUpdates(_0x4e943b){return function(_0x4c9a7f){try{jsonpatch[_0x6b58('0x25')](_0x4c9a7f,_0x4e943b,!![]);}catch(_0x1c6de8){return BPromise[_0x6b58('0x26')](_0x1c6de8);}return _0x4c9a7f[_0x6b58('0x27')]();};}function saveUpdates(_0x141783,_0x922fa3){return function(_0x1f39cf){if(_0x1f39cf){return _0x1f39cf['update'](_0x141783)[_0x6b58('0x28')](function(_0xb761c8){return _0xb761c8;});}return null;};}function removeEntity(_0x461bf3,_0x1f0214){return function(_0x4e1c74){if(_0x4e1c74){return _0x4e1c74[_0x6b58('0x29')]()[_0x6b58('0x28')](function(){_0x461bf3[_0x6b58('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x74da0a,_0x61b473){return function(_0x275d70){if(!_0x275d70){_0x74da0a[_0x6b58('0x1d')](0x194);}return _0x275d70;};}function handleError(_0x3f8614,_0xdc2216){_0xdc2216=_0xdc2216||0x1f4;return function(_0x9c2b40){logger[_0x6b58('0x2a')](_0x9c2b40[_0x6b58('0x2b')]);if(_0x9c2b40[_0x6b58('0x2c')]){delete _0x9c2b40[_0x6b58('0x2c')];}_0x3f8614[_0x6b58('0x1e')](_0xdc2216)[_0x6b58('0x2d')](_0x9c2b40);};}exports[_0x6b58('0x2e')]=function(_0x39ec00,_0x41204c){var _0x4a508c={},_0x1de712={},_0xabf9eb={'count':0x0,'rows':[]};var _0x2bea0b=_[_0x6b58('0x2f')](db[_0x6b58('0x30')][_0x6b58('0x31')],function(_0x5138cc){return{'name':_0x5138cc[_0x6b58('0x32')],'type':_0x5138cc[_0x6b58('0x33')][_0x6b58('0x34')]};});_0x1de712['model']=_[_0x6b58('0x2f')](_0x2bea0b,_0x6b58('0x2c'));_0x1de712['query']=_[_0x6b58('0x35')](_0x39ec00[_0x6b58('0x36')]);_0x1de712[_0x6b58('0x37')]=_['intersection'](_0x1de712[_0x6b58('0x38')],_0x1de712[_0x6b58('0x36')]);_0x4a508c['attributes']=_['intersection'](_0x1de712[_0x6b58('0x38')],qs[_0x6b58('0x39')](_0x39ec00[_0x6b58('0x36')][_0x6b58('0x39')]));_0x4a508c[_0x6b58('0x3a')]=_0x4a508c[_0x6b58('0x3a')][_0x6b58('0x3b')]?_0x4a508c[_0x6b58('0x3a')]:_0x1de712[_0x6b58('0x38')];if(!_0x39ec00[_0x6b58('0x36')][_0x6b58('0x3c')](_0x6b58('0x3d'))){_0x4a508c[_0x6b58('0x22')]=qs[_0x6b58('0x22')](_0x39ec00[_0x6b58('0x36')][_0x6b58('0x22')]);_0x4a508c[_0x6b58('0x20')]=qs[_0x6b58('0x20')](_0x39ec00[_0x6b58('0x36')][_0x6b58('0x20')]);}_0x4a508c['order']=qs[_0x6b58('0x3e')](_0x39ec00['query'][_0x6b58('0x3e')]);_0x4a508c[_0x6b58('0x3f')]=qs[_0x6b58('0x37')](_[_0x6b58('0x40')](_0x39ec00[_0x6b58('0x36')],_0x1de712[_0x6b58('0x37')]),_0x2bea0b);if(_0x39ec00[_0x6b58('0x36')][_0x6b58('0x41')]){_0x4a508c[_0x6b58('0x3f')]=_[_0x6b58('0x42')](_0x4a508c['where'],{'$or':_['map'](_0x2bea0b,function(_0x28e85c){if(_0x28e85c['type']!==_0x6b58('0x43')){var _0x5a2588={};_0x5a2588[_0x28e85c[_0x6b58('0x2c')]]={'$like':'%'+_0x39ec00[_0x6b58('0x36')]['filter']+'%'};return _0x5a2588;}})});}_0x4a508c=_[_0x6b58('0x42')]({},_0x4a508c,_0x39ec00['options']);var _0x5dab07={'where':_0x4a508c['where']};return db[_0x6b58('0x30')][_0x6b58('0x44')](_0x5dab07)['then'](function(_0x25ff17){_0xabf9eb['count']=_0x25ff17;if(_0x39ec00['query'][_0x6b58('0x45')]){_0x4a508c[_0x6b58('0x46')]=[{'all':!![]}];}return db[_0x6b58('0x30')]['findAll'](_0x4a508c);})[_0x6b58('0x28')](function(_0x12932e){_0xabf9eb[_0x6b58('0x47')]=_0x12932e;return _0xabf9eb;})[_0x6b58('0x28')](respondWithFilteredResult(_0x41204c,_0x4a508c))['catch'](handleError(_0x41204c,null));};exports[_0x6b58('0x48')]=function(_0x4a9f35,_0x2e9139){var _0x2f63f3={'raw':!![],'where':{'id':_0x4a9f35[_0x6b58('0x49')]['id']}},_0x30616a={};_0x30616a[_0x6b58('0x38')]=_['keys'](db['SalesforceField'][_0x6b58('0x31')]);_0x30616a[_0x6b58('0x36')]=_[_0x6b58('0x35')](_0x4a9f35[_0x6b58('0x36')]);_0x30616a[_0x6b58('0x37')]=_[_0x6b58('0x4a')](_0x30616a['model'],_0x30616a[_0x6b58('0x36')]);_0x2f63f3[_0x6b58('0x3a')]=_['intersection'](_0x30616a[_0x6b58('0x38')],qs[_0x6b58('0x39')](_0x4a9f35[_0x6b58('0x36')][_0x6b58('0x39')]));_0x2f63f3[_0x6b58('0x3a')]=_0x2f63f3[_0x6b58('0x3a')][_0x6b58('0x3b')]?_0x2f63f3[_0x6b58('0x3a')]:_0x30616a['model'];if(_0x4a9f35[_0x6b58('0x36')][_0x6b58('0x45')]){_0x2f63f3['include']=[{'all':!![]}];}_0x2f63f3=_[_0x6b58('0x42')]({},_0x2f63f3,_0x4a9f35[_0x6b58('0x4b')]);return db[_0x6b58('0x30')]['find'](_0x2f63f3)[_0x6b58('0x28')](handleEntityNotFound(_0x2e9139,null))[_0x6b58('0x28')](respondWithResult(_0x2e9139,null))[_0x6b58('0x4c')](handleError(_0x2e9139,null));};exports[_0x6b58('0x4d')]=function(_0x536e28,_0x43b899){return db[_0x6b58('0x30')][_0x6b58('0x4d')](_0x536e28[_0x6b58('0x4e')],{})[_0x6b58('0x28')](respondWithResult(_0x43b899,0xc9))[_0x6b58('0x4c')](handleError(_0x43b899,null));};exports[_0x6b58('0x4f')]=function(_0x1e60f2,_0x1aa238){if(_0x1e60f2[_0x6b58('0x4e')]['id']){delete _0x1e60f2[_0x6b58('0x4e')]['id'];}return db[_0x6b58('0x30')][_0x6b58('0x50')]({'where':{'id':_0x1e60f2[_0x6b58('0x49')]['id']}})[_0x6b58('0x28')](handleEntityNotFound(_0x1aa238,null))[_0x6b58('0x28')](saveUpdates(_0x1e60f2[_0x6b58('0x4e')],null))['then'](respondWithResult(_0x1aa238,null))[_0x6b58('0x4c')](handleError(_0x1aa238,null));};exports[_0x6b58('0x29')]=function(_0x426215,_0x51c52a){return db[_0x6b58('0x30')][_0x6b58('0x50')]({'where':{'id':_0x426215[_0x6b58('0x49')]['id']}})[_0x6b58('0x28')](handleEntityNotFound(_0x51c52a,null))[_0x6b58('0x28')](removeEntity(_0x51c52a,null))[_0x6b58('0x4c')](handleError(_0x51c52a,null));}; \ No newline at end of file +var _0xc231=['path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','save','update','then','sendStatus','error','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xc231,0x15c));var _0x1c23=function(_0x263a15,_0x5d1067){_0x263a15=_0x263a15-0x0;var _0x3c6620=_0xc231[_0x263a15];return _0x3c6620;};'use strict';var emlformat=require(_0x1c23('0x0'));var rimraf=require(_0x1c23('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c23('0x2'));var rp=require(_0x1c23('0x3'));var moment=require(_0x1c23('0x4'));var BPromise=require(_0x1c23('0x5'));var Mustache=require('mustache');var util=require(_0x1c23('0x6'));var path=require(_0x1c23('0x7'));var sox=require(_0x1c23('0x8'));var csv=require(_0x1c23('0x9'));var ejs=require(_0x1c23('0xa'));var fs=require('fs');var fs_extra=require(_0x1c23('0xb'));var _=require(_0x1c23('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1c23('0xd'));var deskjs=require(_0x1c23('0xe'));var toCsv=require(_0x1c23('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1c23('0xf'));var authService=require(_0x1c23('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1c23('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1c23('0x12'));var utils=require(_0x1c23('0x13'));var config=require(_0x1c23('0x14'));var licenseUtil=require(_0x1c23('0x15'));var db=require(_0x1c23('0x16'))['db'];function respondWithStatusCode(_0x574275,_0x3c0444){_0x3c0444=_0x3c0444||0xcc;return function(_0x2d63c2){if(_0x2d63c2){return _0x574275['sendStatus'](_0x3c0444);}return _0x574275['status'](_0x3c0444)[_0x1c23('0x17')]();};}function respondWithResult(_0xfd2e91,_0x1f748f){_0x1f748f=_0x1f748f||0xc8;return function(_0xb94188){if(_0xb94188){return _0xfd2e91[_0x1c23('0x18')](_0x1f748f)[_0x1c23('0x19')](_0xb94188);}};}function respondWithFilteredResult(_0x102150,_0x1959c8){return function(_0x562f01){if(_0x562f01){var _0x2dfa45=typeof _0x1959c8[_0x1c23('0x1a')]==='undefined'&&typeof _0x1959c8[_0x1c23('0x1b')]===_0x1c23('0x1c');var _0x242296=_0x562f01['count'];var _0x191ba3=_0x2dfa45?0x0:_0x1959c8[_0x1c23('0x1a')];var _0x16cee5=_0x2dfa45?_0x562f01[_0x1c23('0x1d')]:_0x1959c8[_0x1c23('0x1a')]+_0x1959c8[_0x1c23('0x1b')];var _0x32c233;if(_0x16cee5>=_0x242296){_0x16cee5=_0x242296;_0x32c233=0xc8;}else{_0x32c233=0xce;}_0x102150[_0x1c23('0x18')](_0x32c233);return _0x102150[_0x1c23('0x1e')](_0x1c23('0x1f'),_0x191ba3+'-'+_0x16cee5+'/'+_0x242296)['json'](_0x562f01);}return null;};}function patchUpdates(_0x46fff4){return function(_0x79933d){try{jsonpatch['apply'](_0x79933d,_0x46fff4,!![]);}catch(_0x56ea4e){return BPromise['reject'](_0x56ea4e);}return _0x79933d[_0x1c23('0x20')]();};}function saveUpdates(_0x1f2f97,_0x613a6c){return function(_0x1c5b1a){if(_0x1c5b1a){return _0x1c5b1a[_0x1c23('0x21')](_0x1f2f97)[_0x1c23('0x22')](function(_0x3d729b){return _0x3d729b;});}return null;};}function removeEntity(_0x562ad9,_0x31b91b){return function(_0x494a9c){if(_0x494a9c){return _0x494a9c['destroy']()[_0x1c23('0x22')](function(){_0x562ad9[_0x1c23('0x18')](0xcc)[_0x1c23('0x17')]();});}};}function handleEntityNotFound(_0x5cd68c,_0x1a1763){return function(_0x162c58){if(!_0x162c58){_0x5cd68c[_0x1c23('0x23')](0x194);}return _0x162c58;};}function handleError(_0x171f64,_0x1da5b3){_0x1da5b3=_0x1da5b3||0x1f4;return function(_0x4dfe1f){logger[_0x1c23('0x24')](_0x4dfe1f['stack']);if(_0x4dfe1f['name']){delete _0x4dfe1f[_0x1c23('0x25')];}_0x171f64[_0x1c23('0x18')](_0x1da5b3)[_0x1c23('0x26')](_0x4dfe1f);};}exports[_0x1c23('0x27')]=function(_0x5c0394,_0xa9c7be){var _0x303971={},_0x57c965={},_0xf2c89b={'count':0x0,'rows':[]};var _0x298763=_[_0x1c23('0x28')](db[_0x1c23('0x29')][_0x1c23('0x2a')],function(_0x2ccdc8){return{'name':_0x2ccdc8[_0x1c23('0x2b')],'type':_0x2ccdc8[_0x1c23('0x2c')][_0x1c23('0x2d')]};});_0x57c965[_0x1c23('0x2e')]=_[_0x1c23('0x28')](_0x298763,_0x1c23('0x25'));_0x57c965['query']=_[_0x1c23('0x2f')](_0x5c0394[_0x1c23('0x30')]);_0x57c965[_0x1c23('0x31')]=_[_0x1c23('0x32')](_0x57c965[_0x1c23('0x2e')],_0x57c965['query']);_0x303971[_0x1c23('0x33')]=_[_0x1c23('0x32')](_0x57c965[_0x1c23('0x2e')],qs[_0x1c23('0x34')](_0x5c0394['query'][_0x1c23('0x34')]));_0x303971[_0x1c23('0x33')]=_0x303971[_0x1c23('0x33')][_0x1c23('0x35')]?_0x303971[_0x1c23('0x33')]:_0x57c965[_0x1c23('0x2e')];if(!_0x5c0394[_0x1c23('0x30')][_0x1c23('0x36')]('nolimit')){_0x303971[_0x1c23('0x1b')]=qs['limit'](_0x5c0394[_0x1c23('0x30')][_0x1c23('0x1b')]);_0x303971[_0x1c23('0x1a')]=qs[_0x1c23('0x1a')](_0x5c0394[_0x1c23('0x30')][_0x1c23('0x1a')]);}_0x303971[_0x1c23('0x37')]=qs[_0x1c23('0x38')](_0x5c0394['query']['sort']);_0x303971[_0x1c23('0x39')]=qs[_0x1c23('0x31')](_['pick'](_0x5c0394[_0x1c23('0x30')],_0x57c965[_0x1c23('0x31')]),_0x298763);if(_0x5c0394[_0x1c23('0x30')]['filter']){_0x303971[_0x1c23('0x39')]=_['merge'](_0x303971[_0x1c23('0x39')],{'$or':_['map'](_0x298763,function(_0x19e0d0){if(_0x19e0d0[_0x1c23('0x2c')]!==_0x1c23('0x3a')){var _0x405101={};_0x405101[_0x19e0d0[_0x1c23('0x25')]]={'$like':'%'+_0x5c0394['query']['filter']+'%'};return _0x405101;}})});}_0x303971=_[_0x1c23('0x3b')]({},_0x303971,_0x5c0394[_0x1c23('0x3c')]);var _0x29f997={'where':_0x303971['where']};return db['SalesforceField'][_0x1c23('0x1d')](_0x29f997)['then'](function(_0x50df62){_0xf2c89b['count']=_0x50df62;if(_0x5c0394[_0x1c23('0x30')][_0x1c23('0x3d')]){_0x303971[_0x1c23('0x3e')]=[{'all':!![]}];}return db[_0x1c23('0x29')][_0x1c23('0x3f')](_0x303971);})['then'](function(_0x4fe488){_0xf2c89b['rows']=_0x4fe488;return _0xf2c89b;})[_0x1c23('0x22')](respondWithFilteredResult(_0xa9c7be,_0x303971))[_0x1c23('0x40')](handleError(_0xa9c7be,null));};exports[_0x1c23('0x41')]=function(_0x1cd933,_0x584fb2){var _0x5d4e98={'raw':!![],'where':{'id':_0x1cd933[_0x1c23('0x42')]['id']}},_0x4b88a1={};_0x4b88a1[_0x1c23('0x2e')]=_[_0x1c23('0x2f')](db[_0x1c23('0x29')][_0x1c23('0x2a')]);_0x4b88a1[_0x1c23('0x30')]=_['keys'](_0x1cd933[_0x1c23('0x30')]);_0x4b88a1[_0x1c23('0x31')]=_[_0x1c23('0x32')](_0x4b88a1[_0x1c23('0x2e')],_0x4b88a1[_0x1c23('0x30')]);_0x5d4e98[_0x1c23('0x33')]=_[_0x1c23('0x32')](_0x4b88a1['model'],qs[_0x1c23('0x34')](_0x1cd933[_0x1c23('0x30')][_0x1c23('0x34')]));_0x5d4e98[_0x1c23('0x33')]=_0x5d4e98['attributes'][_0x1c23('0x35')]?_0x5d4e98[_0x1c23('0x33')]:_0x4b88a1['model'];if(_0x1cd933[_0x1c23('0x30')][_0x1c23('0x3d')]){_0x5d4e98['include']=[{'all':!![]}];}_0x5d4e98=_[_0x1c23('0x3b')]({},_0x5d4e98,_0x1cd933[_0x1c23('0x3c')]);return db[_0x1c23('0x29')][_0x1c23('0x43')](_0x5d4e98)[_0x1c23('0x22')](handleEntityNotFound(_0x584fb2,null))['then'](respondWithResult(_0x584fb2,null))['catch'](handleError(_0x584fb2,null));};exports[_0x1c23('0x44')]=function(_0x220018,_0x2dd292){return db[_0x1c23('0x29')][_0x1c23('0x44')](_0x220018[_0x1c23('0x45')],{})[_0x1c23('0x22')](respondWithResult(_0x2dd292,0xc9))[_0x1c23('0x40')](handleError(_0x2dd292,null));};exports[_0x1c23('0x21')]=function(_0x210472,_0x3cdd04){if(_0x210472[_0x1c23('0x45')]['id']){delete _0x210472[_0x1c23('0x45')]['id'];}return db[_0x1c23('0x29')][_0x1c23('0x43')]({'where':{'id':_0x210472[_0x1c23('0x42')]['id']}})[_0x1c23('0x22')](handleEntityNotFound(_0x3cdd04,null))[_0x1c23('0x22')](saveUpdates(_0x210472[_0x1c23('0x45')],null))[_0x1c23('0x22')](respondWithResult(_0x3cdd04,null))['catch'](handleError(_0x3cdd04,null));};exports[_0x1c23('0x46')]=function(_0x4649f9,_0x56dd29){return db[_0x1c23('0x29')][_0x1c23('0x43')]({'where':{'id':_0x4649f9[_0x1c23('0x42')]['id']}})[_0x1c23('0x22')](handleEntityNotFound(_0x56dd29,null))[_0x1c23('0x22')](removeEntity(_0x56dd29,null))['catch'](handleError(_0x56dd29,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index fd996ae..8f2ae31 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 _0x9bc7=['request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x51e2bd,_0x351253){var _0x4f0b14=function(_0x52abb9){while(--_0x52abb9){_0x51e2bd['push'](_0x51e2bd['shift']());}};_0x4f0b14(++_0x351253);}(_0x9bc7,0xda));var _0x79bc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9bc7[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x79bc('0x0'));var util=require(_0x79bc('0x1'));var logger=require(_0x79bc('0x2'))(_0x79bc('0x3'));var moment=require(_0x79bc('0x4'));var BPromise=require(_0x79bc('0x5'));var rp=require(_0x79bc('0x6'));var fs=require('fs');var path=require(_0x79bc('0x7'));var rimraf=require(_0x79bc('0x8'));var config=require(_0x79bc('0x9'));var attributes=require(_0x79bc('0xa'));module[_0x79bc('0xb')]=function(_0x45a333,_0x3795da){return _0x45a333[_0x79bc('0xc')](_0x79bc('0xd'),attributes,{'tableName':_0x79bc('0xe'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x79bc('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x35d0=['path','rimraf','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise'];(function(_0x316c00,_0x1cca31){var _0x8d4b88=function(_0x571912){while(--_0x571912){_0x316c00['push'](_0x316c00['shift']());}};_0x8d4b88(++_0x1cca31);}(_0x35d0,0xf9));var _0x035d=function(_0x3e478c,_0x152670){_0x3e478c=_0x3e478c-0x0;var _0x29ef89=_0x35d0[_0x3e478c];return _0x29ef89;};'use strict';var _=require(_0x035d('0x0'));var util=require(_0x035d('0x1'));var logger=require('../../config/logger')(_0x035d('0x2'));var moment=require(_0x035d('0x3'));var BPromise=require(_0x035d('0x4'));var rp=require(_0x035d('0x5'));var fs=require('fs');var path=require(_0x035d('0x6'));var rimraf=require(_0x035d('0x7'));var config=require('../../config/environment');var attributes=require(_0x035d('0x8'));module[_0x035d('0x9')]=function(_0x3e6d36,_0x3f5f0d){return _0x3e6d36['define'](_0x035d('0xa'),attributes,{'tableName':_0x035d('0xb'),'paranoid':![],'indexes':[{'name':_0x035d('0xc'),'fields':[_0x035d('0xd'),_0x035d('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index c4b5a2d..68c3472 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 _0xb7e7=['SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\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(_0x25bfee,_0x1a764d){var _0x2df7e4=function(_0x34d0e2){while(--_0x34d0e2){_0x25bfee['push'](_0x25bfee['shift']());}};_0x2df7e4(++_0x1a764d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'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')]('SalesforceField,\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 _0x9ffd=['SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SalesforceField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x3a0e08,_0x20a614){var _0xee94d3=function(_0x47d7eb){while(--_0x47d7eb){_0x3a0e08['push'](_0x3a0e08['shift']());}};_0xee94d3(++_0x20a614);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2b9848,_0x26ae6e){_0x2b9848=_0x2b9848-0x0;var _0x25f49f=_0x9ffd[_0x2b9848];return _0x25f49f;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('SalesforceField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('SalesforceField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('SalesforceField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index c7244b5..020b503 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 _0x93e9=['post','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x34843c,_0x14f6d3){var _0x256767=function(_0x2c814e){while(--_0x2c814e){_0x34843c['push'](_0x34843c['shift']());}};_0x256767(++_0x14f6d3);}(_0x93e9,0xcc));var _0x993e=function(_0x11f46e,_0x5b89cb){_0x11f46e=_0x11f46e-0x0;var _0x21f0fe=_0x93e9[_0x11f46e];return _0x21f0fe;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var fs_extra=require(_0x993e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x993e('0x7'));var controller=require(_0x993e('0x8'));router[_0x993e('0x9')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0xb')]);router[_0x993e('0x9')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller['show']);router[_0x993e('0x9')](_0x993e('0xd'),auth[_0x993e('0xa')](),controller[_0x993e('0xe')]);router[_0x993e('0x9')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller['getFields']);router[_0x993e('0x10')]('/',auth[_0x993e('0xa')](),controller['create']);router['post'](_0x993e('0xd'),auth['isAuthenticated'](),controller[_0x993e('0x11')]);router['put']('/:id',auth[_0x993e('0xa')](),controller[_0x993e('0x12')]);router[_0x993e('0x13')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller[_0x993e('0x14')]);module[_0x993e('0x15')]=router; \ No newline at end of file +var _0x955f=['/:id/fields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations'];(function(_0x36bab3,_0x19ce33){var _0x2d3989=function(_0x2a4f60){while(--_0x2a4f60){_0x36bab3['push'](_0x36bab3['shift']());}};_0x2d3989(++_0x19ce33);}(_0x955f,0x1eb));var _0xf955=function(_0x9dd588,_0x1a0e00){_0x9dd588=_0x9dd588-0x0;var _0x110e27=_0x955f[_0x9dd588];return _0x110e27;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./intServicenowAccount.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['show']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0x7')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller['getFields']);router[_0xf955('0xe')]('/',auth['isAuthenticated'](),controller[_0xf955('0xf')]);router[_0xf955('0xe')](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x10')]);router['put'](_0xf955('0xa'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);router[_0xf955('0x12')](_0xf955('0xa'),auth[_0xf955('0x8')](),controller[_0xf955('0x13')]);module[_0xf955('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 35266a9..08ead4f 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 _0x337d=['STRING'];(function(_0x28f117,_0x846dc1){var _0x5797a0=function(_0x1f37d7){while(--_0x1f37d7){_0x28f117['push'](_0x28f117['shift']());}};_0x5797a0(++_0x846dc1);}(_0x337d,0xd4));var _0xd337=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x337d[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd337('0x0')],'unique':'username'},'password':{'type':Sequelize[_0xd337('0x0')]},'email':{'type':Sequelize[_0xd337('0x0')]},'remoteUri':{'type':Sequelize[_0xd337('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xa943=['STRING','sequelize','exports'];(function(_0x2f3750,_0x328bc8){var _0x48c81f=function(_0x3ad9db){while(--_0x3ad9db){_0x2f3750['push'](_0x2f3750['shift']());}};_0x48c81f(++_0x328bc8);}(_0xa943,0x16f));var _0x3a94=function(_0x1b282e,_0x2da5c5){_0x1b282e=_0x1b282e-0x0;var _0x292eb3=_0xa943[_0x1b282e];return _0x292eb3;};'use strict';var Sequelize=require(_0x3a94('0x0'));module[_0x3a94('0x1')]={'name':{'type':Sequelize[_0x3a94('0x2')]},'description':{'type':Sequelize[_0x3a94('0x2')]},'username':{'type':Sequelize[_0x3a94('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x3a94('0x2')]},'email':{'type':Sequelize[_0x3a94('0x2')]},'remoteUri':{'type':Sequelize[_0x3a94('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 3992539..57392be 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 _0xf5b1=['assign','includes','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','label','ServiceNow\x20error:\x20','test','statusCode','stack','Wrong\x20credentials','boolean','True','true','False','false','inactive','value','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','update','destroy','name','send','index','rawAttributes','type','key','model','map','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','query','order','sort','pick','merge','where','VIRTUAL','filter','options','ServicenowAccount','includeAll','include','findAll','catch','show','params','fields','create','body','find','getConfigurations','findOne','AccountId','Subjects','channel','Descriptions','ServicenowField','hold_reason','knowledge','subcategory','close_code','notify','severity','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','delivery_plan','impact','active','work_notes_list','business_service','rfc','time_worked','expected_start','business_duration','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','work_start','additional_assignee_list','calendar_duration','sys_class_name','closed_by','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','activity_due','assigned_to','comments','approval','sys_mod_count','reopen_count','sys_tags','escalation','location','category','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects'];(function(_0x3b75ec,_0x1643c1){var _0x39f781=function(_0x1eadc0){while(--_0x1eadc0){_0x3b75ec['push'](_0x3b75ec['shift']());}};_0x39f781(++_0x1643c1);}(_0xf5b1,0xd4));var _0x1f5b=function(_0x3bb4d5,_0x3172a6){_0x3bb4d5=_0x3bb4d5-0x0;var _0x366c9b=_0xf5b1[_0x3bb4d5];return _0x366c9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f5b('0x0'));var zipdir=require(_0x1f5b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f5b('0x2'));var moment=require(_0x1f5b('0x3'));var BPromise=require(_0x1f5b('0x4'));var Mustache=require(_0x1f5b('0x5'));var util=require(_0x1f5b('0x6'));var path=require(_0x1f5b('0x7'));var sox=require('sox');var csv=require(_0x1f5b('0x8'));var ejs=require(_0x1f5b('0x9'));var fs=require('fs');var fs_extra=require(_0x1f5b('0xa'));var _=require(_0x1f5b('0xb'));var squel=require('squel');var crypto=require(_0x1f5b('0xc'));var jsforce=require(_0x1f5b('0xd'));var deskjs=require(_0x1f5b('0xe'));var toCsv=require(_0x1f5b('0x8'));var querystring=require(_0x1f5b('0xf'));var Papa=require(_0x1f5b('0x10'));var Redis=require(_0x1f5b('0x11'));var authService=require(_0x1f5b('0x12'));var qs=require(_0x1f5b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f5b('0x14'));var logger=require(_0x1f5b('0x15'))(_0x1f5b('0x16'));var utils=require(_0x1f5b('0x17'));var config=require(_0x1f5b('0x18'));var licenseUtil=require(_0x1f5b('0x19'));var db=require(_0x1f5b('0x1a'))['db'];var integrations=require(_0x1f5b('0x1b'));var jayson=require(_0x1f5b('0x1c'));var client=jayson[_0x1f5b('0x1d')][_0x1f5b('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1d711d,_0x1d58bf,_0x10a272,_0x215aa4){return new BPromise(function(_0x964313,_0x3b87b4){var _0x2098c5=_0x215aa4||client;return _0x2098c5['request'](_0x1d711d,_0x10a272)[_0x1f5b('0x1f')](function(_0x35d922){logger[_0x1f5b('0x20')](_0x1f5b('0x21'),_0x1d58bf,_0x1f5b('0x22'));logger[_0x1f5b('0x23')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1d58bf,_0x1f5b('0x22'),JSON[_0x1f5b('0x24')](_0x35d922));if(_0x35d922[_0x1f5b('0x25')]){if(_0x35d922[_0x1f5b('0x25')][_0x1f5b('0x26')]===0x1f4){logger[_0x1f5b('0x25')](_0x1f5b('0x21'),_0x1d58bf,_0x35d922['error'][_0x1f5b('0x27')]);return _0x3b87b4(_0x35d922[_0x1f5b('0x25')]['message']);}logger[_0x1f5b('0x25')](_0x1f5b('0x21'),_0x1d58bf,_0x35d922[_0x1f5b('0x25')][_0x1f5b('0x27')]);return _0x964313(_0x35d922[_0x1f5b('0x25')][_0x1f5b('0x27')]);}else{logger['info'](_0x1f5b('0x21'),_0x1d58bf,_0x1f5b('0x22'));_0x964313(_0x35d922['result'][_0x1f5b('0x27')]);}})['catch'](function(_0xe9f2e){logger[_0x1f5b('0x25')](_0x1f5b('0x21'),_0x1d58bf,_0xe9f2e);_0x3b87b4(_0xe9f2e);});});}function respondWithStatusCode(_0x1f9e8c,_0x5403da){_0x5403da=_0x5403da||0xcc;return function(_0x30153c){if(_0x30153c){return _0x1f9e8c['sendStatus'](_0x5403da);}return _0x1f9e8c[_0x1f5b('0x28')](_0x5403da)[_0x1f5b('0x29')]();};}function respondWithResult(_0xd30b10,_0x30a105){_0x30a105=_0x30a105||0xc8;return function(_0x22668b){if(_0x22668b){return _0xd30b10[_0x1f5b('0x28')](_0x30a105)['json'](_0x22668b);}};}function respondWithFilteredResult(_0x9bd2c9,_0x57ed3f){return function(_0x7abbe1){if(_0x7abbe1){var _0x59dfa9=typeof _0x57ed3f[_0x1f5b('0x2a')]==='undefined'&&typeof _0x57ed3f[_0x1f5b('0x2b')]===_0x1f5b('0x2c');var _0x220251=_0x7abbe1[_0x1f5b('0x2d')];var _0x3d0d93=_0x59dfa9?0x0:_0x57ed3f['offset'];var _0x434ed0=_0x59dfa9?_0x7abbe1[_0x1f5b('0x2d')]:_0x57ed3f[_0x1f5b('0x2a')]+_0x57ed3f[_0x1f5b('0x2b')];var _0x43ace3;if(_0x434ed0>=_0x220251){_0x434ed0=_0x220251;_0x43ace3=0xc8;}else{_0x43ace3=0xce;}_0x9bd2c9[_0x1f5b('0x28')](_0x43ace3);return _0x9bd2c9[_0x1f5b('0x2e')](_0x1f5b('0x2f'),_0x3d0d93+'-'+_0x434ed0+'/'+_0x220251)[_0x1f5b('0x30')](_0x7abbe1);}return null;};}function patchUpdates(_0x3bf183){return function(_0x26fbdb){try{jsonpatch[_0x1f5b('0x31')](_0x26fbdb,_0x3bf183,!![]);}catch(_0x9a11d0){return BPromise['reject'](_0x9a11d0);}return _0x26fbdb['save']();};}function saveUpdates(_0x4c220e,_0x5970f8){return function(_0x4f2ff1){if(_0x4f2ff1){return _0x4f2ff1[_0x1f5b('0x32')](_0x4c220e)['then'](function(_0x2b8bbb){return _0x2b8bbb;});}return null;};}function removeEntity(_0x375022,_0x4c4959){return function(_0x43603c){if(_0x43603c){return _0x43603c[_0x1f5b('0x33')]()[_0x1f5b('0x1f')](function(){_0x375022[_0x1f5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ac74e,_0x1f1800){return function(_0x4ec4cd){if(!_0x4ec4cd){_0x3ac74e['sendStatus'](0x194);}return _0x4ec4cd;};}function handleError(_0x3b8350,_0x38a1be){_0x38a1be=_0x38a1be||0x1f4;return function(_0x2f6a2a){logger[_0x1f5b('0x25')](_0x2f6a2a['stack']);if(_0x2f6a2a[_0x1f5b('0x34')]){delete _0x2f6a2a[_0x1f5b('0x34')];}_0x3b8350[_0x1f5b('0x28')](_0x38a1be)[_0x1f5b('0x35')](_0x2f6a2a);};}exports[_0x1f5b('0x36')]=function(_0x522827,_0x656b0a){var _0x4a7081={},_0x454b53={},_0x5e45d6={'count':0x0,'rows':[]};var _0x34b8aa=_['map'](db['ServicenowAccount'][_0x1f5b('0x37')],function(_0x505ed8){return{'name':_0x505ed8['fieldName'],'type':_0x505ed8[_0x1f5b('0x38')][_0x1f5b('0x39')]};});_0x454b53[_0x1f5b('0x3a')]=_[_0x1f5b('0x3b')](_0x34b8aa,_0x1f5b('0x34'));_0x454b53['query']=_[_0x1f5b('0x3c')](_0x522827['query']);_0x454b53[_0x1f5b('0x3d')]=_[_0x1f5b('0x3e')](_0x454b53['model'],_0x454b53['query']);_0x4a7081[_0x1f5b('0x3f')]=_['intersection'](_0x454b53['model'],qs['fields'](_0x522827['query']['fields']));_0x4a7081[_0x1f5b('0x3f')]=_0x4a7081[_0x1f5b('0x3f')][_0x1f5b('0x40')]?_0x4a7081['attributes']:_0x454b53[_0x1f5b('0x3a')];if(!_0x522827['query'][_0x1f5b('0x41')](_0x1f5b('0x42'))){_0x4a7081[_0x1f5b('0x2b')]=qs[_0x1f5b('0x2b')](_0x522827[_0x1f5b('0x43')][_0x1f5b('0x2b')]);_0x4a7081[_0x1f5b('0x2a')]=qs['offset'](_0x522827[_0x1f5b('0x43')]['offset']);}_0x4a7081[_0x1f5b('0x44')]=qs['sort'](_0x522827[_0x1f5b('0x43')][_0x1f5b('0x45')]);_0x4a7081['where']=qs['filters'](_[_0x1f5b('0x46')](_0x522827[_0x1f5b('0x43')],_0x454b53['filters']),_0x34b8aa);if(_0x522827['query']['filter']){_0x4a7081['where']=_[_0x1f5b('0x47')](_0x4a7081[_0x1f5b('0x48')],{'$or':_['map'](_0x34b8aa,function(_0x3c1d1c){if(_0x3c1d1c[_0x1f5b('0x38')]!==_0x1f5b('0x49')){var _0x40f068={};_0x40f068[_0x3c1d1c[_0x1f5b('0x34')]]={'$like':'%'+_0x522827[_0x1f5b('0x43')][_0x1f5b('0x4a')]+'%'};return _0x40f068;}})});}_0x4a7081=_[_0x1f5b('0x47')]({},_0x4a7081,_0x522827[_0x1f5b('0x4b')]);var _0x58e106={'where':_0x4a7081[_0x1f5b('0x48')]};return db[_0x1f5b('0x4c')][_0x1f5b('0x2d')](_0x58e106)[_0x1f5b('0x1f')](function(_0x55ee27){_0x5e45d6[_0x1f5b('0x2d')]=_0x55ee27;if(_0x522827['query'][_0x1f5b('0x4d')]){_0x4a7081[_0x1f5b('0x4e')]=[{'all':!![]}];}return db[_0x1f5b('0x4c')][_0x1f5b('0x4f')](_0x4a7081);})[_0x1f5b('0x1f')](function(_0x46f4d3){_0x5e45d6['rows']=_0x46f4d3;return _0x5e45d6;})[_0x1f5b('0x1f')](respondWithFilteredResult(_0x656b0a,_0x4a7081))[_0x1f5b('0x50')](handleError(_0x656b0a,null));};exports[_0x1f5b('0x51')]=function(_0x1ff2f3,_0x1022db){var _0x257df1={'raw':![],'where':{'id':_0x1ff2f3[_0x1f5b('0x52')]['id']}},_0x6ebba2={};_0x6ebba2[_0x1f5b('0x3a')]=_['keys'](db[_0x1f5b('0x4c')]['rawAttributes']);_0x6ebba2[_0x1f5b('0x43')]=_['keys'](_0x1ff2f3[_0x1f5b('0x43')]);_0x6ebba2['filters']=_[_0x1f5b('0x3e')](_0x6ebba2['model'],_0x6ebba2[_0x1f5b('0x43')]);_0x257df1[_0x1f5b('0x3f')]=_[_0x1f5b('0x3e')](_0x6ebba2[_0x1f5b('0x3a')],qs[_0x1f5b('0x53')](_0x1ff2f3[_0x1f5b('0x43')][_0x1f5b('0x53')]));_0x257df1['attributes']=_0x257df1['attributes'][_0x1f5b('0x40')]?_0x257df1['attributes']:_0x6ebba2[_0x1f5b('0x3a')];if(_0x1ff2f3['query']['includeAll']){_0x257df1[_0x1f5b('0x4e')]=[{'all':!![]}];}_0x257df1=_[_0x1f5b('0x47')]({},_0x257df1,_0x1ff2f3[_0x1f5b('0x4b')]);return db[_0x1f5b('0x4c')]['find'](_0x257df1)[_0x1f5b('0x1f')](handleEntityNotFound(_0x1022db,null))['then'](respondWithResult(_0x1022db,null))[_0x1f5b('0x50')](handleError(_0x1022db,null));};exports[_0x1f5b('0x54')]=function(_0x1050f7,_0x360d48){return db[_0x1f5b('0x4c')][_0x1f5b('0x54')](_0x1050f7[_0x1f5b('0x55')],{})[_0x1f5b('0x1f')](respondWithResult(_0x360d48,0xc9))[_0x1f5b('0x50')](handleError(_0x360d48,null));};exports[_0x1f5b('0x32')]=function(_0x131837,_0x3441e6){if(_0x131837[_0x1f5b('0x55')]['id']){delete _0x131837['body']['id'];}return db[_0x1f5b('0x4c')][_0x1f5b('0x56')]({'where':{'id':_0x131837[_0x1f5b('0x52')]['id']}})['then'](handleEntityNotFound(_0x3441e6,null))[_0x1f5b('0x1f')](saveUpdates(_0x131837[_0x1f5b('0x55')],null))['then'](respondWithResult(_0x3441e6,null))[_0x1f5b('0x50')](handleError(_0x3441e6,null));};exports[_0x1f5b('0x33')]=function(_0x552a0e,_0x1c094d){return db[_0x1f5b('0x4c')][_0x1f5b('0x56')]({'where':{'id':_0x552a0e['params']['id']}})[_0x1f5b('0x1f')](handleEntityNotFound(_0x1c094d,null))[_0x1f5b('0x1f')](removeEntity(_0x1c094d,null))['catch'](handleError(_0x1c094d,null));};exports[_0x1f5b('0x57')]=function(_0x470bb0,_0x249467,_0x1a52b9){var _0x44d726={};var _0x4915bb={};var _0x24285b;var _0x51c1d1;return db[_0x1f5b('0x4c')][_0x1f5b('0x58')]({'where':{'id':_0x470bb0[_0x1f5b('0x52')]['id']}})[_0x1f5b('0x1f')](handleEntityNotFound(_0x249467,null))[_0x1f5b('0x1f')](function(_0x9b849c){if(_0x9b849c){_0x24285b=_0x9b849c;_0x4915bb['model']=_[_0x1f5b('0x3c')](db['ServicenowConfiguration'][_0x1f5b('0x37')]);_0x4915bb['query']=_['keys'](_0x470bb0[_0x1f5b('0x43')]);_0x4915bb[_0x1f5b('0x3d')]=_[_0x1f5b('0x3e')](_0x4915bb[_0x1f5b('0x3a')],_0x4915bb[_0x1f5b('0x43')]);_0x44d726[_0x1f5b('0x3f')]=_[_0x1f5b('0x3e')](_0x4915bb[_0x1f5b('0x3a')],qs[_0x1f5b('0x53')](_0x470bb0[_0x1f5b('0x43')][_0x1f5b('0x53')]));_0x44d726[_0x1f5b('0x3f')]=_0x44d726[_0x1f5b('0x3f')][_0x1f5b('0x40')]?_0x44d726[_0x1f5b('0x3f')]:_0x4915bb[_0x1f5b('0x3a')];_0x44d726[_0x1f5b('0x44')]=qs[_0x1f5b('0x45')](_0x470bb0[_0x1f5b('0x43')][_0x1f5b('0x45')]);_0x44d726[_0x1f5b('0x48')]=qs['filters'](_[_0x1f5b('0x46')](_0x470bb0['query'],_0x4915bb[_0x1f5b('0x3d')]));if(_0x470bb0[_0x1f5b('0x43')][_0x1f5b('0x4a')]){_0x44d726['where']=_['merge'](_0x44d726[_0x1f5b('0x48')],{'$or':_[_0x1f5b('0x3b')](_0x44d726['attributes'],function(_0x19f8fc){var _0x183ff7={};_0x183ff7[_0x19f8fc]={'$like':'%'+_0x470bb0[_0x1f5b('0x43')][_0x1f5b('0x4a')]+'%'};return _0x183ff7;})});}_0x44d726=_[_0x1f5b('0x47')]({},_0x44d726,_0x470bb0[_0x1f5b('0x4b')]);return _0x24285b[_0x1f5b('0x57')](_0x44d726);}})[_0x1f5b('0x1f')](function(_0x368c81){if(_0x368c81){_0x51c1d1=_0x368c81[_0x1f5b('0x40')];if(!_0x470bb0[_0x1f5b('0x43')]['hasOwnProperty']('nolimit')){_0x44d726[_0x1f5b('0x2b')]=qs['limit'](_0x470bb0[_0x1f5b('0x43')][_0x1f5b('0x2b')]);_0x44d726[_0x1f5b('0x2a')]=qs['offset'](_0x470bb0['query'][_0x1f5b('0x2a')]);}return _0x24285b['getConfigurations'](_0x44d726);}})['then'](function(_0x425ed4){if(_0x425ed4){return _0x425ed4?{'count':_0x51c1d1,'rows':_0x425ed4}:null;}})[_0x1f5b('0x1f')](respondWithResult(_0x249467,null))[_0x1f5b('0x50')](handleError(_0x249467,null));};exports['addConfiguration']=function(_0x353365,_0x503b11,_0x4b4fb1){if(_0x353365[_0x1f5b('0x55')]['id']){delete _0x353365[_0x1f5b('0x55')]['id'];}return db[_0x1f5b('0x4c')][_0x1f5b('0x58')]({'where':{'id':_0x353365[_0x1f5b('0x52')]['id']}})[_0x1f5b('0x1f')](handleEntityNotFound(_0x503b11,null))[_0x1f5b('0x1f')](function(_0x8f5851){if(_0x8f5851){_0x353365[_0x1f5b('0x55')][_0x1f5b('0x59')]=_0x8f5851['id'];_0x353365[_0x1f5b('0x55')][_0x1f5b('0x5a')]=integrations['getSubjects'](_0x353365['body'][_0x1f5b('0x5b')],_0x353365['body'][_0x1f5b('0x38')]);_0x353365[_0x1f5b('0x55')][_0x1f5b('0x5c')]=integrations['getDescriptions'](_0x353365['body'][_0x1f5b('0x5b')],_0x353365['body'][_0x1f5b('0x38')]);return db['ServicenowConfiguration']['create'](_0x353365[_0x1f5b('0x55')],{'include':[{'model':db['ServicenowField'],'as':_0x1f5b('0x5a')},{'model':db[_0x1f5b('0x5d')],'as':_0x1f5b('0x5c')}]});}return null;})[_0x1f5b('0x1f')](respondWithResult(_0x503b11,null))[_0x1f5b('0x50')](handleError(_0x503b11,null));};exports['getFields']=function(_0x53d12f,_0x318c11,_0xfa796a){var _0x2ae580=['made_sla',_0x1f5b('0x5e'),_0x1f5b('0x5f'),_0x1f5b('0x60'),_0x1f5b('0x61'),_0x1f5b('0x62'),'incident_state',_0x1f5b('0x63'),'category'];var _0x4ce8b7=[_0x1f5b('0x64'),'made_sla',_0x1f5b('0x65'),_0x1f5b('0x66'),_0x1f5b('0x67'),_0x1f5b('0x68'),_0x1f5b('0x69'),_0x1f5b('0x5e'),_0x1f5b('0x6a'),_0x1f5b('0x6b'),_0x1f5b('0x6c'),_0x1f5b('0x6d'),_0x1f5b('0x6e'),_0x1f5b('0x6f'),_0x1f5b('0x70'),_0x1f5b('0x71'),_0x1f5b('0x72'),_0x1f5b('0x73'),_0x1f5b('0x5f'),_0x1f5b('0x44'),'calendar_stc','closed_at','cmdb_ci',_0x1f5b('0x74'),_0x1f5b('0x75'),_0x1f5b('0x76'),_0x1f5b('0x77'),_0x1f5b('0x78'),'priority','sys_domain_path',_0x1f5b('0x79'),_0x1f5b('0x7a'),_0x1f5b('0x7b'),'opened_at',_0x1f5b('0x7c'),'group_list',_0x1f5b('0x7d'),_0x1f5b('0x7e'),_0x1f5b('0x7f'),_0x1f5b('0x80'),'approval_set','subcategory',_0x1f5b('0x81'),_0x1f5b('0x82'),_0x1f5b('0x61'),_0x1f5b('0x83'),'delivery_task',_0x1f5b('0x84'),'assignment_group','business_stc',_0x1f5b('0x85'),'description',_0x1f5b('0x86'),_0x1f5b('0x62'),_0x1f5b('0x87'),'close_notes',_0x1f5b('0x88'),'follow_up',_0x1f5b('0x89'),_0x1f5b('0x8a'),_0x1f5b('0x8b'),_0x1f5b('0x8c'),_0x1f5b('0x8d'),_0x1f5b('0x8e'),_0x1f5b('0x8f'),_0x1f5b('0x90'),'reassignment_count',_0x1f5b('0x91'),_0x1f5b('0x92'),_0x1f5b('0x63'),_0x1f5b('0x93'),'sla_due',_0x1f5b('0x94'),'comments_and_work_notes','due_date',_0x1f5b('0x95'),_0x1f5b('0x96'),_0x1f5b('0x97'),_0x1f5b('0x98'),'upon_approval','correlation_id',_0x1f5b('0x99'),_0x1f5b('0x9a')];var _0x289426='';var _0xe1ccaf='';var _0xd81271=[];var _0x7dc3a4='';var _0x267b42='';var _0x12a613=[];var _0x43058c='';var _0x2c640b='';var _0x33f52e={};var _0x2d5083='';return db[_0x1f5b('0x4c')][_0x1f5b('0x58')]({'where':{'id':_0x53d12f[_0x1f5b('0x52')]['id']},'attributes':['id',_0x1f5b('0x9b'),_0x1f5b('0x9c'),_0x1f5b('0x9d'),_0x1f5b('0x9e'),_0x1f5b('0x9f')]})[_0x1f5b('0x1f')](handleEntityNotFound(_0x318c11,null))[_0x1f5b('0x1f')](function(_0x2c8947){if(_0x2c8947){_0x2d5083=_0x2c8947[_0x1f5b('0x9e')];var _0x303d29=_0x2d5083[_0x1f5b('0xa0')](-0x1);if(_0x303d29==='/'){_0x2d5083=_0x2d5083[_0x1f5b('0xa1')](0x0,_0x2d5083[_0x1f5b('0xa2')](_0x303d29));}_0x2c640b=util[_0x1f5b('0xa3')]('%s/api/now/doc/table/schema/',_0x2d5083);_0x43058c=util['format'](_0x1f5b('0xa4'),_0x2d5083);_0x33f52e={'user':_0x2c8947[_0x1f5b('0x9b')],'pass':_0x2c8947[_0x1f5b('0x9c')]};var _0x3f518d={'method':_0x1f5b('0xa5'),'uri':_0x2c640b+_0x1f5b('0xa6'),'auth':_0x33f52e,'json':!![]};return rp(_0x3f518d);}})[_0x1f5b('0x1f')](function(_0x5bd9dd){if(_0x5bd9dd[_0x1f5b('0xa7')][_0x1f5b('0x40')]>0x0){_0x289426=_0x5bd9dd[_0x1f5b('0xa7')];}console[_0x1f5b('0xa8')](_0x1f5b('0xa9'),_0x289426);_0x12a613=[];_0xe1ccaf=Object[_0x1f5b('0xaa')]([],_0x289426);_['remove'](_0xe1ccaf,function(_0x8fd270){return!_0x2ae580[_0x1f5b('0xab')](_0x8fd270[_0x1f5b('0x34')]);});_0xe1ccaf['forEach'](function(_0x47300b){var _0x514f14=createFieldObject(_0x43058c,_0x33f52e,_0x47300b[_0x1f5b('0xac')],_0x47300b['name'],_0x47300b['label'],![]);_0x12a613[_0x1f5b('0xad')](_0x514f14);});return Promise[_0x1f5b('0xae')](_0x12a613);})[_0x1f5b('0x1f')](function(_0x304383){_0xd81271=_0x304383;_0x7dc3a4=Object[_0x1f5b('0xaa')]([],_0x289426);console['log'](_0x1f5b('0xaf'),_0x289426);_['remove'](_0x7dc3a4,function(_0x380b30){return _0x4ce8b7['includes'](_0x380b30['name']);});console[_0x1f5b('0xa8')](_0x1f5b('0xb0'),_0x7dc3a4);_0x12a613=[];_0x7dc3a4[_0x1f5b('0xb1')](function(_0x30ef37){var _0x38fdc0=createFieldObject(_0x43058c,_0x33f52e,_0x30ef37[_0x1f5b('0xac')],_0x30ef37[_0x1f5b('0x34')],_0x30ef37[_0x1f5b('0xb2')],!![]);_0x12a613['push'](_0x38fdc0);});return Promise['all'](_0x12a613);})['then'](function(_0x39cc18){_0x267b42=_0x39cc18;var _0x4404f9=_0xd81271['concat'](_0x267b42);return{'count':_0x4404f9[_0x1f5b('0x40')],'rows':_0x4404f9};})[_0x1f5b('0x1f')](respondWithResult(_0x318c11,null))[_0x1f5b('0x50')](function(_0x4a99b8){console['log'](_0x1f5b('0xb3')+_0x4a99b8);var _0x3caeea=_0x53d12f['query'][_0x1f5b('0xb4')]?0x1f4:_0x4a99b8[_0x1f5b('0xb5')]||0x1f4;logger[_0x1f5b('0x25')](_0x4a99b8[_0x1f5b('0xb6')]);delete _0x4a99b8['name'];if(_0x3caeea===0x191){_0x3caeea=0x190;}_0x318c11[_0x1f5b('0x28')](_0x3caeea)[_0x1f5b('0x35')](_0x53d12f[_0x1f5b('0x43')][_0x1f5b('0xb4')]?{'message':_0x1f5b('0xb7'),'statusCode':_0x4a99b8[_0x1f5b('0xb5')]}:_0x4a99b8);});};function createFieldObject(_0x5bb791,_0x55896e,_0xa50288,_0x3fb9c0,_0x1f9293,_0x1ca9f7){return new Promise(function(_0x5c6c3d,_0x5421bf){var _0x5e94dd={'id':_0x3fb9c0,'name':_0x1f9293,'custom':_0x1ca9f7};if(_0xa50288===_0x1f5b('0xb8')){_0x5e94dd[_0x1f5b('0x4b')]=[{'name':_0x1f5b('0xb9'),'value':_0x1f5b('0xba')},{'name':_0x1f5b('0xbb'),'value':_0x1f5b('0xbc')}];_0x5c6c3d(_0x5e94dd);}else{var _0x12752b={'method':_0x1f5b('0xa5'),'uri':_0x5bb791+'sys_choice?sysparm_query=name=incident^element='+_0x3fb9c0,'auth':_0x55896e,'json':!![]};return rp(_0x12752b)[_0x1f5b('0x1f')](function(_0x5db066){var _0x203d40=[];if(_0x5db066[_0x1f5b('0xa7')][_0x1f5b('0x40')]>0x0){_0x5db066[_0x1f5b('0xa7')]['forEach'](function(_0x5c0d78){if(_0x5c0d78[_0x1f5b('0xbd')]===_0x1f5b('0xbc')){var _0x55fdbc={'name':_0x5c0d78[_0x1f5b('0xb2')],'value':_0x5c0d78[_0x1f5b('0xbe')]};_0x203d40[_0x1f5b('0xad')](_0x55fdbc);}});}_0x5e94dd[_0x1f5b('0x4b')]=_0x203d40;if(_0x5e94dd[_0x1f5b('0x4b')][_0x1f5b('0x40')]>0x0){_0x5c6c3d(_0x5e94dd);}else{if(_0x1ca9f7==![]){_0x5c6c3d();}else{_0x5c6c3d(_0x5e94dd);}}});}});} \ No newline at end of file +var _0xc910=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','show','keys','rawAttributes','includeAll','find','catch','create','body','update','params','destroy','findOne','getConfigurations','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','priority','time_worked','opened_at','business_duration','group_list','work_end','resolved_at','work_notes','correlation_display','delivery_task','work_start','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','activity_due','assigned_to','severity','comments','sla_due','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','upon_approval','location','username','password','email','serverUrl','remoteUri','slice','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','includes','forEach','push','all','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','label','concat','test','Wrong\x20credentials','statusCode','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','ejs','fs-extra','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/license/util','../../components/integrations/configuration','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','stack','name','index','map','ServicenowAccount','fieldName','type'];(function(_0x14c8ee,_0x34d4fb){var _0x51acc2=function(_0x4c1277){while(--_0x4c1277){_0x14c8ee['push'](_0x14c8ee['shift']());}};_0x51acc2(++_0x34d4fb);}(_0xc910,0x148));var _0x0c91=function(_0x2d64d0,_0x2c910f){_0x2d64d0=_0x2d64d0-0x0;var _0x4258ae=_0xc910[_0x2d64d0];return _0x4258ae;};'use strict';var emlformat=require(_0x0c91('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c91('0x1'));var jsonpatch=require(_0x0c91('0x2'));var rp=require('request-promise');var moment=require(_0x0c91('0x3'));var BPromise=require(_0x0c91('0x4'));var Mustache=require('mustache');var util=require(_0x0c91('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0c91('0x6'));var fs=require('fs');var fs_extra=require(_0x0c91('0x7'));var _=require('lodash');var squel=require(_0x0c91('0x8'));var crypto=require(_0x0c91('0x9'));var jsforce=require(_0x0c91('0xa'));var deskjs=require(_0x0c91('0xb'));var toCsv=require(_0x0c91('0xc'));var querystring=require(_0x0c91('0xd'));var Papa=require(_0x0c91('0xe'));var Redis=require('ioredis');var authService=require(_0x0c91('0xf'));var qs=require(_0x0c91('0x10'));var as=require(_0x0c91('0x11'));var hardwareService=require(_0x0c91('0x12'));var logger=require(_0x0c91('0x13'))(_0x0c91('0x14'));var utils=require(_0x0c91('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0c91('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0c91('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x0c91('0x18')][_0x0c91('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x5ab1c3,_0x13c491,_0x53fd3f,_0x168f9a){return new BPromise(function(_0x54a70f,_0x4b325b){var _0x4b5342=_0x168f9a||client;return _0x4b5342[_0x0c91('0x1a')](_0x5ab1c3,_0x53fd3f)['then'](function(_0xead21){logger[_0x0c91('0x1b')](_0x0c91('0x1c'),_0x13c491,_0x0c91('0x1d'));logger[_0x0c91('0x1e')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x13c491,'request\x20sent',JSON[_0x0c91('0x1f')](_0xead21));if(_0xead21['error']){if(_0xead21[_0x0c91('0x20')][_0x0c91('0x21')]===0x1f4){logger['error'](_0x0c91('0x1c'),_0x13c491,_0xead21['error']['message']);return _0x4b325b(_0xead21[_0x0c91('0x20')]['message']);}logger[_0x0c91('0x20')]('ServicenowAccount,\x20%s,\x20%s',_0x13c491,_0xead21['error'][_0x0c91('0x22')]);return _0x54a70f(_0xead21[_0x0c91('0x20')][_0x0c91('0x22')]);}else{logger['info'](_0x0c91('0x1c'),_0x13c491,_0x0c91('0x1d'));_0x54a70f(_0xead21[_0x0c91('0x23')][_0x0c91('0x22')]);}})['catch'](function(_0xcbf81a){logger[_0x0c91('0x20')](_0x0c91('0x1c'),_0x13c491,_0xcbf81a);_0x4b325b(_0xcbf81a);});});}function respondWithStatusCode(_0xbf98af,_0x2677f8){_0x2677f8=_0x2677f8||0xcc;return function(_0x2d5b5f){if(_0x2d5b5f){return _0xbf98af[_0x0c91('0x24')](_0x2677f8);}return _0xbf98af[_0x0c91('0x25')](_0x2677f8)[_0x0c91('0x26')]();};}function respondWithResult(_0x384153,_0x77fe5c){_0x77fe5c=_0x77fe5c||0xc8;return function(_0x373213){if(_0x373213){return _0x384153[_0x0c91('0x25')](_0x77fe5c)[_0x0c91('0x27')](_0x373213);}};}function respondWithFilteredResult(_0x1db5af,_0xc75c1f){return function(_0xfa87ce){if(_0xfa87ce){var _0x4ca9e8=typeof _0xc75c1f[_0x0c91('0x28')]===_0x0c91('0x29')&&typeof _0xc75c1f[_0x0c91('0x2a')]===_0x0c91('0x29');var _0x5ad62e=_0xfa87ce[_0x0c91('0x2b')];var _0x170837=_0x4ca9e8?0x0:_0xc75c1f[_0x0c91('0x28')];var _0x4f8b7d=_0x4ca9e8?_0xfa87ce[_0x0c91('0x2b')]:_0xc75c1f['offset']+_0xc75c1f[_0x0c91('0x2a')];var _0x2e4537;if(_0x4f8b7d>=_0x5ad62e){_0x4f8b7d=_0x5ad62e;_0x2e4537=0xc8;}else{_0x2e4537=0xce;}_0x1db5af['status'](_0x2e4537);return _0x1db5af['set'](_0x0c91('0x2c'),_0x170837+'-'+_0x4f8b7d+'/'+_0x5ad62e)[_0x0c91('0x27')](_0xfa87ce);}return null;};}function patchUpdates(_0x41e8ad){return function(_0x460ff2){try{jsonpatch[_0x0c91('0x2d')](_0x460ff2,_0x41e8ad,!![]);}catch(_0xab6dd1){return BPromise[_0x0c91('0x2e')](_0xab6dd1);}return _0x460ff2[_0x0c91('0x2f')]();};}function saveUpdates(_0x5719fc,_0x1048a7){return function(_0x5b8e1f){if(_0x5b8e1f){return _0x5b8e1f['update'](_0x5719fc)[_0x0c91('0x30')](function(_0x1d3e35){return _0x1d3e35;});}return null;};}function removeEntity(_0x20bd8f,_0x310f13){return function(_0x55a551){if(_0x55a551){return _0x55a551['destroy']()[_0x0c91('0x30')](function(){_0x20bd8f[_0x0c91('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dc2be,_0x280188){return function(_0x581e12){if(!_0x581e12){_0x1dc2be[_0x0c91('0x24')](0x194);}return _0x581e12;};}function handleError(_0x1a5138,_0x2b6486){_0x2b6486=_0x2b6486||0x1f4;return function(_0x959f3c){logger['error'](_0x959f3c[_0x0c91('0x31')]);if(_0x959f3c[_0x0c91('0x32')]){delete _0x959f3c[_0x0c91('0x32')];}_0x1a5138[_0x0c91('0x25')](_0x2b6486)['send'](_0x959f3c);};}exports[_0x0c91('0x33')]=function(_0x1e299c,_0x4a8d19){var _0xfa8bc5={},_0x596531={},_0x4f1071={'count':0x0,'rows':[]};var _0x5c5272=_[_0x0c91('0x34')](db[_0x0c91('0x35')]['rawAttributes'],function(_0x4591c8){return{'name':_0x4591c8[_0x0c91('0x36')],'type':_0x4591c8[_0x0c91('0x37')][_0x0c91('0x38')]};});_0x596531[_0x0c91('0x39')]=_[_0x0c91('0x34')](_0x5c5272,_0x0c91('0x32'));_0x596531[_0x0c91('0x3a')]=_['keys'](_0x1e299c[_0x0c91('0x3a')]);_0x596531[_0x0c91('0x3b')]=_[_0x0c91('0x3c')](_0x596531[_0x0c91('0x39')],_0x596531[_0x0c91('0x3a')]);_0xfa8bc5[_0x0c91('0x3d')]=_[_0x0c91('0x3c')](_0x596531[_0x0c91('0x39')],qs[_0x0c91('0x3e')](_0x1e299c[_0x0c91('0x3a')][_0x0c91('0x3e')]));_0xfa8bc5[_0x0c91('0x3d')]=_0xfa8bc5[_0x0c91('0x3d')][_0x0c91('0x3f')]?_0xfa8bc5[_0x0c91('0x3d')]:_0x596531['model'];if(!_0x1e299c['query'][_0x0c91('0x40')](_0x0c91('0x41'))){_0xfa8bc5['limit']=qs[_0x0c91('0x2a')](_0x1e299c['query'][_0x0c91('0x2a')]);_0xfa8bc5[_0x0c91('0x28')]=qs[_0x0c91('0x28')](_0x1e299c[_0x0c91('0x3a')]['offset']);}_0xfa8bc5[_0x0c91('0x42')]=qs[_0x0c91('0x43')](_0x1e299c[_0x0c91('0x3a')]['sort']);_0xfa8bc5[_0x0c91('0x44')]=qs[_0x0c91('0x3b')](_[_0x0c91('0x45')](_0x1e299c[_0x0c91('0x3a')],_0x596531[_0x0c91('0x3b')]),_0x5c5272);if(_0x1e299c[_0x0c91('0x3a')]['filter']){_0xfa8bc5[_0x0c91('0x44')]=_[_0x0c91('0x46')](_0xfa8bc5[_0x0c91('0x44')],{'$or':_[_0x0c91('0x34')](_0x5c5272,function(_0x46e5f7){if(_0x46e5f7[_0x0c91('0x37')]!==_0x0c91('0x47')){var _0x39222d={};_0x39222d[_0x46e5f7[_0x0c91('0x32')]]={'$like':'%'+_0x1e299c['query'][_0x0c91('0x48')]+'%'};return _0x39222d;}})});}_0xfa8bc5=_['merge']({},_0xfa8bc5,_0x1e299c[_0x0c91('0x49')]);var _0x3a3983={'where':_0xfa8bc5[_0x0c91('0x44')]};return db['ServicenowAccount'][_0x0c91('0x2b')](_0x3a3983)[_0x0c91('0x30')](function(_0x275997){_0x4f1071[_0x0c91('0x2b')]=_0x275997;if(_0x1e299c[_0x0c91('0x3a')]['includeAll']){_0xfa8bc5[_0x0c91('0x4a')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x0c91('0x4b')](_0xfa8bc5);})[_0x0c91('0x30')](function(_0x3e2ec2){_0x4f1071['rows']=_0x3e2ec2;return _0x4f1071;})[_0x0c91('0x30')](respondWithFilteredResult(_0x4a8d19,_0xfa8bc5))['catch'](handleError(_0x4a8d19,null));};exports[_0x0c91('0x4c')]=function(_0x5ba5c0,_0x479287){var _0x382f15={'raw':![],'where':{'id':_0x5ba5c0['params']['id']}},_0x360201={};_0x360201[_0x0c91('0x39')]=_[_0x0c91('0x4d')](db['ServicenowAccount'][_0x0c91('0x4e')]);_0x360201[_0x0c91('0x3a')]=_[_0x0c91('0x4d')](_0x5ba5c0[_0x0c91('0x3a')]);_0x360201[_0x0c91('0x3b')]=_['intersection'](_0x360201[_0x0c91('0x39')],_0x360201[_0x0c91('0x3a')]);_0x382f15[_0x0c91('0x3d')]=_[_0x0c91('0x3c')](_0x360201[_0x0c91('0x39')],qs['fields'](_0x5ba5c0[_0x0c91('0x3a')][_0x0c91('0x3e')]));_0x382f15['attributes']=_0x382f15['attributes'][_0x0c91('0x3f')]?_0x382f15[_0x0c91('0x3d')]:_0x360201[_0x0c91('0x39')];if(_0x5ba5c0['query'][_0x0c91('0x4f')]){_0x382f15[_0x0c91('0x4a')]=[{'all':!![]}];}_0x382f15=_[_0x0c91('0x46')]({},_0x382f15,_0x5ba5c0['options']);return db[_0x0c91('0x35')][_0x0c91('0x50')](_0x382f15)[_0x0c91('0x30')](handleEntityNotFound(_0x479287,null))[_0x0c91('0x30')](respondWithResult(_0x479287,null))[_0x0c91('0x51')](handleError(_0x479287,null));};exports[_0x0c91('0x52')]=function(_0x5263f3,_0x516a30){return db[_0x0c91('0x35')][_0x0c91('0x52')](_0x5263f3[_0x0c91('0x53')],{})[_0x0c91('0x30')](respondWithResult(_0x516a30,0xc9))[_0x0c91('0x51')](handleError(_0x516a30,null));};exports[_0x0c91('0x54')]=function(_0x3a02da,_0x4b5adc){if(_0x3a02da[_0x0c91('0x53')]['id']){delete _0x3a02da['body']['id'];}return db[_0x0c91('0x35')][_0x0c91('0x50')]({'where':{'id':_0x3a02da[_0x0c91('0x55')]['id']}})[_0x0c91('0x30')](handleEntityNotFound(_0x4b5adc,null))[_0x0c91('0x30')](saveUpdates(_0x3a02da[_0x0c91('0x53')],null))['then'](respondWithResult(_0x4b5adc,null))[_0x0c91('0x51')](handleError(_0x4b5adc,null));};exports[_0x0c91('0x56')]=function(_0x1b14d5,_0x44cbf0){return db[_0x0c91('0x35')]['find']({'where':{'id':_0x1b14d5['params']['id']}})[_0x0c91('0x30')](handleEntityNotFound(_0x44cbf0,null))[_0x0c91('0x30')](removeEntity(_0x44cbf0,null))[_0x0c91('0x51')](handleError(_0x44cbf0,null));};exports['getConfigurations']=function(_0x301be9,_0x1c7722,_0x14d869){var _0x49cff4={};var _0x1e684b={};var _0x1a8f49;var _0x1d3945;return db['ServicenowAccount'][_0x0c91('0x57')]({'where':{'id':_0x301be9[_0x0c91('0x55')]['id']}})[_0x0c91('0x30')](handleEntityNotFound(_0x1c7722,null))['then'](function(_0x33c19a){if(_0x33c19a){_0x1a8f49=_0x33c19a;_0x1e684b[_0x0c91('0x39')]=_['keys'](db['ServicenowConfiguration'][_0x0c91('0x4e')]);_0x1e684b[_0x0c91('0x3a')]=_[_0x0c91('0x4d')](_0x301be9[_0x0c91('0x3a')]);_0x1e684b[_0x0c91('0x3b')]=_[_0x0c91('0x3c')](_0x1e684b[_0x0c91('0x39')],_0x1e684b['query']);_0x49cff4['attributes']=_[_0x0c91('0x3c')](_0x1e684b[_0x0c91('0x39')],qs[_0x0c91('0x3e')](_0x301be9[_0x0c91('0x3a')][_0x0c91('0x3e')]));_0x49cff4[_0x0c91('0x3d')]=_0x49cff4[_0x0c91('0x3d')][_0x0c91('0x3f')]?_0x49cff4['attributes']:_0x1e684b['model'];_0x49cff4[_0x0c91('0x42')]=qs[_0x0c91('0x43')](_0x301be9[_0x0c91('0x3a')][_0x0c91('0x43')]);_0x49cff4[_0x0c91('0x44')]=qs[_0x0c91('0x3b')](_[_0x0c91('0x45')](_0x301be9[_0x0c91('0x3a')],_0x1e684b[_0x0c91('0x3b')]));if(_0x301be9[_0x0c91('0x3a')][_0x0c91('0x48')]){_0x49cff4[_0x0c91('0x44')]=_[_0x0c91('0x46')](_0x49cff4[_0x0c91('0x44')],{'$or':_[_0x0c91('0x34')](_0x49cff4[_0x0c91('0x3d')],function(_0x472262){var _0x3b2ff7={};_0x3b2ff7[_0x472262]={'$like':'%'+_0x301be9[_0x0c91('0x3a')]['filter']+'%'};return _0x3b2ff7;})});}_0x49cff4=_[_0x0c91('0x46')]({},_0x49cff4,_0x301be9['options']);return _0x1a8f49[_0x0c91('0x58')](_0x49cff4);}})[_0x0c91('0x30')](function(_0x5448b1){if(_0x5448b1){_0x1d3945=_0x5448b1[_0x0c91('0x3f')];if(!_0x301be9[_0x0c91('0x3a')][_0x0c91('0x40')](_0x0c91('0x41'))){_0x49cff4[_0x0c91('0x2a')]=qs[_0x0c91('0x2a')](_0x301be9[_0x0c91('0x3a')]['limit']);_0x49cff4[_0x0c91('0x28')]=qs[_0x0c91('0x28')](_0x301be9['query'][_0x0c91('0x28')]);}return _0x1a8f49['getConfigurations'](_0x49cff4);}})['then'](function(_0x19804c){if(_0x19804c){return _0x19804c?{'count':_0x1d3945,'rows':_0x19804c}:null;}})[_0x0c91('0x30')](respondWithResult(_0x1c7722,null))[_0x0c91('0x51')](handleError(_0x1c7722,null));};exports[_0x0c91('0x59')]=function(_0x46150e,_0x2fd3d9,_0x3012f9){if(_0x46150e[_0x0c91('0x53')]['id']){delete _0x46150e[_0x0c91('0x53')]['id'];}return db['ServicenowAccount'][_0x0c91('0x57')]({'where':{'id':_0x46150e[_0x0c91('0x55')]['id']}})['then'](handleEntityNotFound(_0x2fd3d9,null))[_0x0c91('0x30')](function(_0x5ebd50){if(_0x5ebd50){_0x46150e[_0x0c91('0x53')]['AccountId']=_0x5ebd50['id'];_0x46150e[_0x0c91('0x53')]['Subjects']=integrations[_0x0c91('0x5a')](_0x46150e[_0x0c91('0x53')][_0x0c91('0x5b')],_0x46150e[_0x0c91('0x53')]['type']);_0x46150e[_0x0c91('0x53')][_0x0c91('0x5c')]=integrations[_0x0c91('0x5d')](_0x46150e[_0x0c91('0x53')]['channel'],_0x46150e['body'][_0x0c91('0x37')]);return db[_0x0c91('0x5e')][_0x0c91('0x52')](_0x46150e['body'],{'include':[{'model':db[_0x0c91('0x5f')],'as':'Subjects'},{'model':db[_0x0c91('0x5f')],'as':_0x0c91('0x5c')}]});}return null;})['then'](respondWithResult(_0x2fd3d9,null))['catch'](handleError(_0x2fd3d9,null));};exports[_0x0c91('0x60')]=function(_0x3816ea,_0x528d8e,_0xa495e8){var _0x1738b6=[_0x0c91('0x61'),_0x0c91('0x62'),_0x0c91('0x63'),_0x0c91('0x64'),_0x0c91('0x65'),_0x0c91('0x66'),_0x0c91('0x67'),'severity',_0x0c91('0x68')];var _0xb0e2e2=[_0x0c91('0x69'),'made_sla',_0x0c91('0x6a'),_0x0c91('0x6b'),_0x0c91('0x6c'),_0x0c91('0x6d'),_0x0c91('0x6e'),'hold_reason','approval_history',_0x0c91('0x6f'),_0x0c91('0x70'),_0x0c91('0x71'),'opened_by',_0x0c91('0x72'),_0x0c91('0x73'),_0x0c91('0x74'),_0x0c91('0x75'),'sys_created_by',_0x0c91('0x63'),_0x0c91('0x42'),_0x0c91('0x76'),_0x0c91('0x77'),_0x0c91('0x78'),_0x0c91('0x79'),_0x0c91('0x7a'),'active',_0x0c91('0x7b'),'business_service',_0x0c91('0x7c'),'sys_domain_path','rfc',_0x0c91('0x7d'),'expected_start',_0x0c91('0x7e'),_0x0c91('0x7f'),_0x0c91('0x80'),_0x0c91('0x81'),'reopened_time',_0x0c91('0x82'),'caller_id','approval_set',_0x0c91('0x64'),_0x0c91('0x83'),'short_description',_0x0c91('0x65'),_0x0c91('0x84'),_0x0c91('0x85'),_0x0c91('0x86'),'assignment_group','business_stc','additional_assignee_list',_0x0c91('0x87'),_0x0c91('0x88'),'notify',_0x0c91('0x89'),_0x0c91('0x8a'),_0x0c91('0x8b'),_0x0c91('0x8c'),_0x0c91('0x8d'),_0x0c91('0x8e'),_0x0c91('0x8f'),_0x0c91('0x90'),'incident_state',_0x0c91('0x91'),_0x0c91('0x92'),'company','reassignment_count',_0x0c91('0x93'),_0x0c91('0x94'),_0x0c91('0x95'),_0x0c91('0x96'),_0x0c91('0x97'),'approval',_0x0c91('0x98'),_0x0c91('0x99'),'sys_mod_count',_0x0c91('0x9a'),_0x0c91('0x9b'),_0x0c91('0x9c'),_0x0c91('0x9d'),'correlation_id',_0x0c91('0x9e'),'category'];var _0xccce78='';var _0x24cb50='';var _0x242ae9=[];var _0x28b2b7='';var _0x5b20a1='';var _0x217766=[];var _0x298221='';var _0xdbee6='';var _0x521c45={};var _0x45bcbe='';return db[_0x0c91('0x35')][_0x0c91('0x57')]({'where':{'id':_0x3816ea['params']['id']},'attributes':['id',_0x0c91('0x9f'),_0x0c91('0xa0'),_0x0c91('0xa1'),'remoteUri',_0x0c91('0xa2')]})[_0x0c91('0x30')](handleEntityNotFound(_0x528d8e,null))[_0x0c91('0x30')](function(_0x188fff){if(_0x188fff){_0x45bcbe=_0x188fff[_0x0c91('0xa3')];var _0x44087f=_0x45bcbe[_0x0c91('0xa4')](-0x1);if(_0x44087f==='/'){_0x45bcbe=_0x45bcbe['substring'](0x0,_0x45bcbe['lastIndexOf'](_0x44087f));}_0xdbee6=util[_0x0c91('0xa5')](_0x0c91('0xa6'),_0x45bcbe);_0x298221=util['format'](_0x0c91('0xa7'),_0x45bcbe);_0x521c45={'user':_0x188fff[_0x0c91('0x9f')],'pass':_0x188fff[_0x0c91('0xa0')]};var _0xf23b7b={'method':_0x0c91('0xa8'),'uri':_0xdbee6+_0x0c91('0xa9'),'auth':_0x521c45,'json':!![]};return rp(_0xf23b7b);}})[_0x0c91('0x30')](function(_0x216f15){if(_0x216f15[_0x0c91('0x23')][_0x0c91('0x3f')]>0x0){_0xccce78=_0x216f15[_0x0c91('0x23')];}console[_0x0c91('0xaa')](_0x0c91('0xab'),_0xccce78);_0x217766=[];_0x24cb50=Object[_0x0c91('0xac')]([],_0xccce78);_['remove'](_0x24cb50,function(_0x51607c){return!_0x1738b6[_0x0c91('0xad')](_0x51607c[_0x0c91('0x32')]);});_0x24cb50[_0x0c91('0xae')](function(_0xbe4527){var _0x2ebf87=createFieldObject(_0x298221,_0x521c45,_0xbe4527['internalType'],_0xbe4527['name'],_0xbe4527['label'],![]);_0x217766[_0x0c91('0xaf')](_0x2ebf87);});return Promise[_0x0c91('0xb0')](_0x217766);})[_0x0c91('0x30')](function(_0xdf894){_0x242ae9=_0xdf894;_0x28b2b7=Object['assign']([],_0xccce78);console[_0x0c91('0xaa')]('TCL:\x20_object',_0xccce78);_['remove'](_0x28b2b7,function(_0x3e9b82){return _0xb0e2e2[_0x0c91('0xad')](_0x3e9b82['name']);});console[_0x0c91('0xaa')](_0x0c91('0xb1'),_0x28b2b7);_0x217766=[];_0x28b2b7[_0x0c91('0xae')](function(_0x5678de){var _0xdc5676=createFieldObject(_0x298221,_0x521c45,_0x5678de[_0x0c91('0xb2')],_0x5678de['name'],_0x5678de[_0x0c91('0xb3')],!![]);_0x217766['push'](_0xdc5676);});return Promise[_0x0c91('0xb0')](_0x217766);})[_0x0c91('0x30')](function(_0x4b763e){_0x5b20a1=_0x4b763e;var _0x213bb4=_0x242ae9[_0x0c91('0xb4')](_0x5b20a1);return{'count':_0x213bb4[_0x0c91('0x3f')],'rows':_0x213bb4};})[_0x0c91('0x30')](respondWithResult(_0x528d8e,null))[_0x0c91('0x51')](function(_0x5f4d0a){console['log']('ServiceNow\x20error:\x20'+_0x5f4d0a);var _0xafab28=_0x3816ea['query'][_0x0c91('0xb5')]?0x1f4:_0x5f4d0a['statusCode']||0x1f4;logger['error'](_0x5f4d0a[_0x0c91('0x31')]);delete _0x5f4d0a['name'];if(_0xafab28===0x191){_0xafab28=0x190;}_0x528d8e['status'](_0xafab28)['send'](_0x3816ea[_0x0c91('0x3a')]['test']?{'message':_0x0c91('0xb6'),'statusCode':_0x5f4d0a[_0x0c91('0xb7')]}:_0x5f4d0a);});};function createFieldObject(_0x38c5d5,_0x3bfefc,_0x4d2b0b,_0x184ab1,_0xe6ac90,_0x5eab07){return new Promise(function(_0x21e113,_0x20d407){var _0xe48fc2={'id':_0x184ab1,'name':_0xe6ac90,'custom':_0x5eab07};if(_0x4d2b0b===_0x0c91('0xb8')){_0xe48fc2[_0x0c91('0x49')]=[{'name':_0x0c91('0xb9'),'value':_0x0c91('0xba')},{'name':_0x0c91('0xbb'),'value':'false'}];_0x21e113(_0xe48fc2);}else{var _0x380ae8={'method':_0x0c91('0xa8'),'uri':_0x38c5d5+_0x0c91('0xbc')+_0x184ab1,'auth':_0x3bfefc,'json':!![]};return rp(_0x380ae8)[_0x0c91('0x30')](function(_0x1bc155){var _0x531dbb=[];if(_0x1bc155[_0x0c91('0x23')][_0x0c91('0x3f')]>0x0){_0x1bc155['result'][_0x0c91('0xae')](function(_0x2b8652){if(_0x2b8652[_0x0c91('0xbd')]===_0x0c91('0xbe')){var _0x5a154c={'name':_0x2b8652['label'],'value':_0x2b8652[_0x0c91('0xbf')]};_0x531dbb[_0x0c91('0xaf')](_0x5a154c);}});}_0xe48fc2[_0x0c91('0x49')]=_0x531dbb;if(_0xe48fc2[_0x0c91('0x49')][_0x0c91('0x3f')]>0x0){_0x21e113(_0xe48fc2);}else{if(_0x5eab07==![]){_0x21e113();}else{_0x21e113(_0xe48fc2);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 10ccb13..73c451a 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 _0x56a4=['moment','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','ServicenowAccount','int_servicenow_accounts','lodash','util','api'];(function(_0x87ffa9,_0x2c55b4){var _0x53b4b3=function(_0x1904a2){while(--_0x1904a2){_0x87ffa9['push'](_0x87ffa9['shift']());}};_0x53b4b3(++_0x2c55b4);}(_0x56a4,0x11b));var _0x456a=function(_0x1f9179,_0x598964){_0x1f9179=_0x1f9179-0x0;var _0x2974c9=_0x56a4[_0x1f9179];return _0x2974c9;};'use strict';var _=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var logger=require('../../config/logger')(_0x456a('0x2'));var moment=require(_0x456a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x456a('0x4'));var rimraf=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var attributes=require(_0x456a('0x7'));var integrations=require(_0x456a('0x8'));module['exports']=function(_0x3b0145,_0x52b38d){return _0x3b0145['define'](_0x456a('0x9'),attributes,{'tableName':_0x456a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae24=['../../config/logger','moment','bluebird','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','lodash'];(function(_0x194a4,_0xd80598){var _0x49085f=function(_0x823fb1){while(--_0x823fb1){_0x194a4['push'](_0x194a4['shift']());}};_0x49085f(++_0xd80598);}(_0xae24,0x182));var _0x4ae2=function(_0x490791,_0x1efd2b){_0x490791=_0x490791-0x0;var _0x3b2d4e=_0xae24[_0x490791];return _0x3b2d4e;};'use strict';var _=require(_0x4ae2('0x0'));var util=require('util');var logger=require(_0x4ae2('0x1'))('api');var moment=require(_0x4ae2('0x2'));var BPromise=require(_0x4ae2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ae2('0x4'));var config=require('../../config/environment');var attributes=require(_0x4ae2('0x5'));var integrations=require(_0x4ae2('0x6'));module[_0x4ae2('0x7')]=function(_0x3e6055,_0x428054){return _0x3e6055[_0x4ae2('0x8')]('ServicenowAccount',attributes,{'tableName':'int_servicenow_accounts','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 840c1c6..2185115 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 _0x919d=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','stringify','error','ServicenowAccount,\x20%s,\x20%s','message','result','ServicenowAccount','findAll','options','raw','limit','include','map','model','attributes','then','GetServicenowAccount','debug','catch','ShowServicenowAccount','find','ioredis','../../mysqldb'];(function(_0x246434,_0x54d9fd){var _0x2791e0=function(_0x3f6328){while(--_0x3f6328){_0x246434['push'](_0x246434['shift']());}};_0x2791e0(++_0x54d9fd);}(_0x919d,0x76));var _0xd919=function(_0x5c0b9c,_0x3718ab){_0x5c0b9c=_0x5c0b9c-0x0;var _0x439fd1=_0x919d[_0x5c0b9c];return _0x439fd1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd919('0x0'));var db=require(_0xd919('0x1'))['db'];var utils=require(_0xd919('0x2'));var logger=require('../../config/logger')(_0xd919('0x3'));var config=require(_0xd919('0x4'));var jayson=require(_0xd919('0x5'));var client=jayson['client'][_0xd919('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2ec7ee,_0xd4e853,_0x12fbc5){return new BPromise(function(_0x50dab8,_0x126de8){return client[_0xd919('0x7')](_0x2ec7ee,_0x12fbc5)['then'](function(_0x4159eb){logger[_0xd919('0x8')]('ServicenowAccount,\x20%s,\x20%s',_0xd4e853,_0xd919('0x9'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xd4e853,_0xd919('0x9'),JSON[_0xd919('0xa')](_0x4159eb));if(_0x4159eb[_0xd919('0xb')]){if(_0x4159eb[_0xd919('0xb')]['code']===0x1f4){logger[_0xd919('0xb')](_0xd919('0xc'),_0xd4e853,_0x4159eb[_0xd919('0xb')]['message']);return _0x126de8(_0x4159eb[_0xd919('0xb')][_0xd919('0xd')]);}logger[_0xd919('0xb')](_0xd919('0xc'),_0xd4e853,_0x4159eb[_0xd919('0xb')][_0xd919('0xd')]);return _0x50dab8(_0x4159eb[_0xd919('0xb')][_0xd919('0xd')]);}else{logger['info'](_0xd919('0xc'),_0xd4e853,_0xd919('0x9'));_0x50dab8(_0x4159eb[_0xd919('0xe')][_0xd919('0xd')]);}})['catch'](function(_0xaeddb5){logger[_0xd919('0xb')]('ServicenowAccount,\x20%s,\x20%s',_0xd4e853,_0xaeddb5);_0x126de8(_0xaeddb5);});});}exports['GetServicenowAccount']=function(_0x46aea6){var _0x3ce6c1=this;return new Promise(function(_0x2edd3b,_0x4e404b){return db[_0xd919('0xf')][_0xd919('0x10')]({'raw':_0x46aea6[_0xd919('0x11')]?_0x46aea6[_0xd919('0x11')][_0xd919('0x12')]===undefined?!![]:![]:!![],'where':_0x46aea6[_0xd919('0x11')]?_0x46aea6[_0xd919('0x11')]['where']||null:null,'attributes':_0x46aea6[_0xd919('0x11')]?_0x46aea6['options']['attributes']||null:null,'limit':_0x46aea6[_0xd919('0x11')]?_0x46aea6[_0xd919('0x11')][_0xd919('0x13')]||null:null,'include':_0x46aea6[_0xd919('0x11')]?_0x46aea6[_0xd919('0x11')][_0xd919('0x14')]?_[_0xd919('0x15')](_0x46aea6[_0xd919('0x11')][_0xd919('0x14')],function(_0x236c23){return{'model':db[_0x236c23[_0xd919('0x16')]],'as':_0x236c23['as'],'attributes':_0x236c23[_0xd919('0x17')],'include':_0x236c23[_0xd919('0x14')]?_[_0xd919('0x15')](_0x236c23[_0xd919('0x14')],function(_0x50e837){return{'model':db[_0x50e837[_0xd919('0x16')]],'as':_0x50e837['as'],'attributes':_0x50e837[_0xd919('0x17')],'include':_0x50e837[_0xd919('0x14')]?_[_0xd919('0x15')](_0x50e837[_0xd919('0x14')],function(_0x349ffe){return{'model':db[_0x349ffe['model']],'as':_0x349ffe['as'],'attributes':_0x349ffe[_0xd919('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd919('0x18')](function(_0x5f0d38){logger['info'](_0xd919('0x19'),_0x46aea6);logger[_0xd919('0x1a')](_0xd919('0x19'),_0x46aea6,JSON['stringify'](_0x5f0d38));_0x2edd3b(_0x5f0d38);})[_0xd919('0x1b')](function(_0x222271){logger[_0xd919('0xb')](_0xd919('0x19'),_0x222271[_0xd919('0xd')],_0x46aea6);_0x4e404b(_0x3ce6c1[_0xd919('0xb')](0x1f4,_0x222271['message']));});});};exports[_0xd919('0x1c')]=function(_0x2b2ccf){var _0x19c0b4=this;return new Promise(function(_0x4ca43f,_0x4655b7){return db[_0xd919('0xf')][_0xd919('0x1d')]({'raw':_0x2b2ccf[_0xd919('0x11')]?_0x2b2ccf['options'][_0xd919('0x12')]===undefined?!![]:![]:!![],'where':_0x2b2ccf[_0xd919('0x11')]?_0x2b2ccf['options']['where']||null:null,'attributes':_0x2b2ccf[_0xd919('0x11')]?_0x2b2ccf['options'][_0xd919('0x17')]||null:null,'include':_0x2b2ccf[_0xd919('0x11')]?_0x2b2ccf[_0xd919('0x11')][_0xd919('0x14')]?_[_0xd919('0x15')](_0x2b2ccf[_0xd919('0x11')]['include'],function(_0x207879){return{'model':db[_0x207879[_0xd919('0x16')]],'as':_0x207879['as'],'attributes':_0x207879[_0xd919('0x17')],'include':_0x207879['include']?_[_0xd919('0x15')](_0x207879[_0xd919('0x14')],function(_0x4304a9){return{'model':db[_0x4304a9[_0xd919('0x16')]],'as':_0x4304a9['as'],'attributes':_0x4304a9[_0xd919('0x17')],'include':_0x4304a9[_0xd919('0x14')]?_[_0xd919('0x15')](_0x4304a9[_0xd919('0x14')],function(_0x155821){return{'model':db[_0x155821[_0xd919('0x16')]],'as':_0x155821['as'],'attributes':_0x155821[_0xd919('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd919('0x18')](function(_0x526c6b){logger[_0xd919('0x8')]('ShowServicenowAccount',_0x2b2ccf);logger['debug'](_0xd919('0x1c'),_0x2b2ccf,JSON[_0xd919('0xa')](_0x526c6b));_0x4ca43f(_0x526c6b);})[_0xd919('0x1b')](function(_0xa38a9){logger['error']('ShowServicenowAccount',_0xa38a9['message'],_0x2b2ccf);_0x4655b7(_0x19c0b4[_0xd919('0xb')](0x1f4,_0xa38a9[_0xd919('0xd')]));});});}; \ No newline at end of file +var _0x8464=['options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','find','ShowServicenowAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ServicenowAccount','findAll'];(function(_0x1a186b,_0x5f09a6){var _0x5de2e9=function(_0x5a21de){while(--_0x5a21de){_0x1a186b['push'](_0x1a186b['shift']());}};_0x5de2e9(++_0x5f09a6);}(_0x8464,0x1c5));var _0x4846=function(_0x59033f,_0x2cf207){_0x59033f=_0x59033f-0x0;var _0x4a4ecb=_0x8464[_0x59033f];return _0x4a4ecb;};'use strict';var _=require(_0x4846('0x0'));var util=require(_0x4846('0x1'));var moment=require('moment');var BPromise=require(_0x4846('0x2'));var rs=require(_0x4846('0x3'));var fs=require('fs');var Redis=require(_0x4846('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4846('0x5'));var logger=require(_0x4846('0x6'))(_0x4846('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4846('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3eedea,_0x49ca8f,_0x5e4f70){return new BPromise(function(_0x5c000d,_0x580cf1){return client[_0x4846('0x9')](_0x3eedea,_0x5e4f70)[_0x4846('0xa')](function(_0x5a12ec){logger[_0x4846('0xb')](_0x4846('0xc'),_0x49ca8f,_0x4846('0xd'));logger[_0x4846('0xe')](_0x4846('0xf'),_0x49ca8f,_0x4846('0xd'),JSON[_0x4846('0x10')](_0x5a12ec));if(_0x5a12ec[_0x4846('0x11')]){if(_0x5a12ec['error']['code']===0x1f4){logger['error'](_0x4846('0xc'),_0x49ca8f,_0x5a12ec[_0x4846('0x11')]['message']);return _0x580cf1(_0x5a12ec[_0x4846('0x11')][_0x4846('0x12')]);}logger[_0x4846('0x11')](_0x4846('0xc'),_0x49ca8f,_0x5a12ec[_0x4846('0x11')][_0x4846('0x12')]);return _0x5c000d(_0x5a12ec['error'][_0x4846('0x12')]);}else{logger[_0x4846('0xb')](_0x4846('0xc'),_0x49ca8f,_0x4846('0xd'));_0x5c000d(_0x5a12ec[_0x4846('0x13')]['message']);}})[_0x4846('0x14')](function(_0x112c04){logger[_0x4846('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x49ca8f,_0x112c04);_0x580cf1(_0x112c04);});});}exports['GetServicenowAccount']=function(_0x46165f){var _0x59dd2b=this;return new Promise(function(_0x27c6e9,_0x33d7e7){return db[_0x4846('0x15')][_0x4846('0x16')]({'raw':_0x46165f[_0x4846('0x17')]?_0x46165f[_0x4846('0x17')][_0x4846('0x18')]===undefined?!![]:![]:!![],'where':_0x46165f[_0x4846('0x17')]?_0x46165f['options'][_0x4846('0x19')]||null:null,'attributes':_0x46165f[_0x4846('0x17')]?_0x46165f['options'][_0x4846('0x1a')]||null:null,'limit':_0x46165f[_0x4846('0x17')]?_0x46165f['options'][_0x4846('0x1b')]||null:null,'include':_0x46165f[_0x4846('0x17')]?_0x46165f['options'][_0x4846('0x1c')]?_[_0x4846('0x1d')](_0x46165f[_0x4846('0x17')][_0x4846('0x1c')],function(_0x1a8eef){return{'model':db[_0x1a8eef['model']],'as':_0x1a8eef['as'],'attributes':_0x1a8eef[_0x4846('0x1a')],'include':_0x1a8eef[_0x4846('0x1c')]?_['map'](_0x1a8eef[_0x4846('0x1c')],function(_0x259ca0){return{'model':db[_0x259ca0[_0x4846('0x1e')]],'as':_0x259ca0['as'],'attributes':_0x259ca0[_0x4846('0x1a')],'include':_0x259ca0['include']?_[_0x4846('0x1d')](_0x259ca0[_0x4846('0x1c')],function(_0x43d8ef){return{'model':db[_0x43d8ef['model']],'as':_0x43d8ef['as'],'attributes':_0x43d8ef[_0x4846('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4846('0xa')](function(_0x1a8997){logger[_0x4846('0xb')](_0x4846('0x1f'),_0x46165f);logger[_0x4846('0xe')](_0x4846('0x1f'),_0x46165f,JSON['stringify'](_0x1a8997));_0x27c6e9(_0x1a8997);})[_0x4846('0x14')](function(_0xd01466){logger[_0x4846('0x11')](_0x4846('0x1f'),_0xd01466[_0x4846('0x12')],_0x46165f);_0x33d7e7(_0x59dd2b[_0x4846('0x11')](0x1f4,_0xd01466[_0x4846('0x12')]));});});};exports['ShowServicenowAccount']=function(_0x368bc1){var _0x20e608=this;return new Promise(function(_0x415f48,_0x389802){return db[_0x4846('0x15')][_0x4846('0x20')]({'raw':_0x368bc1[_0x4846('0x17')]?_0x368bc1[_0x4846('0x17')][_0x4846('0x18')]===undefined?!![]:![]:!![],'where':_0x368bc1[_0x4846('0x17')]?_0x368bc1['options'][_0x4846('0x19')]||null:null,'attributes':_0x368bc1[_0x4846('0x17')]?_0x368bc1[_0x4846('0x17')][_0x4846('0x1a')]||null:null,'include':_0x368bc1[_0x4846('0x17')]?_0x368bc1[_0x4846('0x17')]['include']?_['map'](_0x368bc1[_0x4846('0x17')][_0x4846('0x1c')],function(_0x3f7a73){return{'model':db[_0x3f7a73[_0x4846('0x1e')]],'as':_0x3f7a73['as'],'attributes':_0x3f7a73[_0x4846('0x1a')],'include':_0x3f7a73[_0x4846('0x1c')]?_['map'](_0x3f7a73[_0x4846('0x1c')],function(_0xd0e50d){return{'model':db[_0xd0e50d[_0x4846('0x1e')]],'as':_0xd0e50d['as'],'attributes':_0xd0e50d[_0x4846('0x1a')],'include':_0xd0e50d['include']?_[_0x4846('0x1d')](_0xd0e50d[_0x4846('0x1c')],function(_0x1bb356){return{'model':db[_0x1bb356[_0x4846('0x1e')]],'as':_0x1bb356['as'],'attributes':_0x1bb356[_0x4846('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4846('0xa')](function(_0x2a5928){logger[_0x4846('0xb')](_0x4846('0x21'),_0x368bc1);logger[_0x4846('0xe')](_0x4846('0x21'),_0x368bc1,JSON[_0x4846('0x10')](_0x2a5928));_0x415f48(_0x2a5928);})[_0x4846('0x14')](function(_0x2ac682){logger['error'](_0x4846('0x21'),_0x2ac682[_0x4846('0x12')],_0x368bc1);_0x389802(_0x20e608[_0x4846('0x11')](0x1f4,_0x2ac682[_0x4846('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 266c1c6..e0ec9d8 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 _0xcb26=['index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','getDescriptions','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get'];(function(_0x299089,_0x3cff81){var _0x11c91f=function(_0x3e135b){while(--_0x3e135b){_0x299089['push'](_0x299089['shift']());}};_0x11c91f(++_0x3cff81);}(_0xcb26,0x6c));var _0x6cb2=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xcb26[_0x36ed3c];return _0x52a2e0;};'use strict';var multer=require(_0x6cb2('0x0'));var util=require(_0x6cb2('0x1'));var path=require(_0x6cb2('0x2'));var timeout=require(_0x6cb2('0x3'));var express=require(_0x6cb2('0x4'));var router=express[_0x6cb2('0x5')]();var fs_extra=require(_0x6cb2('0x6'));var auth=require(_0x6cb2('0x7'));var interaction=require(_0x6cb2('0x8'));var config=require(_0x6cb2('0x9'));var controller=require(_0x6cb2('0xa'));router[_0x6cb2('0xb')]('/',auth['isAuthenticated'](),controller[_0x6cb2('0xc')]);router[_0x6cb2('0xb')](_0x6cb2('0xd'),auth[_0x6cb2('0xe')](),controller['show']);router[_0x6cb2('0xb')](_0x6cb2('0xf'),auth[_0x6cb2('0xe')](),controller[_0x6cb2('0x10')]);router[_0x6cb2('0xb')]('/:id/subjects',auth[_0x6cb2('0xe')](),controller[_0x6cb2('0x11')]);router['get']('/:id/descriptions',auth[_0x6cb2('0xe')](),controller[_0x6cb2('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6cb2('0x13')]);router[_0x6cb2('0x14')](_0x6cb2('0xd'),auth[_0x6cb2('0xe')](),controller[_0x6cb2('0x15')]);router[_0x6cb2('0x16')](_0x6cb2('0xd'),auth[_0x6cb2('0xe')](),controller['destroy']);module[_0x6cb2('0x17')]=router; \ No newline at end of file +var _0x850b=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','delete','/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x850b,0x114));var _0xb850=function(_0x3e3e5b,_0x194e02){_0x3e3e5b=_0x3e3e5b-0x0;var _0x40a067=_0x850b[_0x3e3e5b];return _0x40a067;};'use strict';var multer=require(_0xb850('0x0'));var util=require(_0xb850('0x1'));var path=require(_0xb850('0x2'));var timeout=require('connect-timeout');var express=require(_0xb850('0x3'));var router=express['Router']();var fs_extra=require(_0xb850('0x4'));var auth=require(_0xb850('0x5'));var interaction=require(_0xb850('0x6'));var config=require(_0xb850('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0xb850('0x8')]('/',auth[_0xb850('0x9')](),controller[_0xb850('0xa')]);router[_0xb850('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb850('0xb')]);router[_0xb850('0x8')](_0xb850('0xc'),auth[_0xb850('0x9')](),controller[_0xb850('0xd')]);router[_0xb850('0x8')](_0xb850('0xe'),auth[_0xb850('0x9')](),controller[_0xb850('0xf')]);router[_0xb850('0x8')](_0xb850('0x10'),auth['isAuthenticated'](),controller[_0xb850('0x11')]);router[_0xb850('0x12')]('/',auth[_0xb850('0x9')](),controller['create']);router['put']('/:id',auth[_0xb850('0x9')](),controller[_0xb850('0x13')]);router[_0xb850('0x14')](_0xb850('0x15'),auth[_0xb850('0x9')](),controller[_0xb850('0x16')]);module[_0xb850('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index b2a4e14..24d183d 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 _0x731a=['exports','STRING','sequelize'];(function(_0x17cda4,_0x359ee4){var _0x156340=function(_0x3c22f9){while(--_0x3c22f9){_0x17cda4['push'](_0x17cda4['shift']());}};_0x156340(++_0x359ee4);}(_0x731a,0xa4));var _0xa731=function(_0x2694f6,_0x31b042){_0x2694f6=_0x2694f6-0x0;var _0x13ab43=_0x731a[_0x2694f6];return _0x13ab43;};'use strict';var Sequelize=require(_0xa731('0x0'));module[_0xa731('0x1')]={'name':{'type':Sequelize[_0xa731('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5604=['STRING','exports'];(function(_0x57a53b,_0x11494e){var _0x29e81c=function(_0x24c522){while(--_0x24c522){_0x57a53b['push'](_0x57a53b['shift']());}};_0x29e81c(++_0x11494e);}(_0x5604,0x1a7));var _0x4560=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x5604[_0x65c50e];return _0x4573e7;};'use strict';var Sequelize=require('sequelize');module[_0x4560('0x0')]={'name':{'type':Sequelize[_0x4560('0x1')]},'description':{'type':Sequelize[_0x4560('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 2de6e73..38a0aa6 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 _0xa772=['type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','body','update','findOne','getFields','nolimit','getSubjects','ServicenowField','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','json','limit','undefined','offset','count','status','set','reject','save','destroy','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName'];(function(_0x39eecd,_0x4dccf4){var _0x15af88=function(_0x4a7e87){while(--_0x4a7e87){_0x39eecd['push'](_0x39eecd['shift']());}};_0x15af88(++_0x4dccf4);}(_0xa772,0xd6));var _0x2a77=function(_0x273305,_0x57815f){_0x273305=_0x273305-0x0;var _0x12cf22=_0xa772[_0x273305];return _0x12cf22;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2a77('0x0'));var jsonpatch=require(_0x2a77('0x1'));var rp=require(_0x2a77('0x2'));var moment=require(_0x2a77('0x3'));var BPromise=require(_0x2a77('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a77('0x5'));var sox=require(_0x2a77('0x6'));var csv=require(_0x2a77('0x7'));var ejs=require(_0x2a77('0x8'));var fs=require('fs');var fs_extra=require(_0x2a77('0x9'));var _=require(_0x2a77('0xa'));var squel=require(_0x2a77('0xb'));var crypto=require(_0x2a77('0xc'));var jsforce=require(_0x2a77('0xd'));var deskjs=require(_0x2a77('0xe'));var toCsv=require(_0x2a77('0x7'));var querystring=require(_0x2a77('0xf'));var Papa=require(_0x2a77('0x10'));var Redis=require(_0x2a77('0x11'));var authService=require(_0x2a77('0x12'));var qs=require(_0x2a77('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a77('0x14'))(_0x2a77('0x15'));var utils=require(_0x2a77('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2a77('0x17'));var db=require(_0x2a77('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2a77('0x19')][_0x2a77('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x449c13,_0x32edec,_0x58f0dd,_0x46a3a7){return new BPromise(function(_0x225023,_0x453ea8){var _0x2990e3=_0x46a3a7||client;return _0x2990e3[_0x2a77('0x1b')](_0x449c13,_0x58f0dd)[_0x2a77('0x1c')](function(_0x127795){logger[_0x2a77('0x1d')](_0x2a77('0x1e'),_0x32edec,_0x2a77('0x1f'));logger[_0x2a77('0x20')](_0x2a77('0x21'),_0x32edec,_0x2a77('0x1f'),JSON[_0x2a77('0x22')](_0x127795));if(_0x127795[_0x2a77('0x23')]){if(_0x127795[_0x2a77('0x23')]['code']===0x1f4){logger['error'](_0x2a77('0x1e'),_0x32edec,_0x127795[_0x2a77('0x23')][_0x2a77('0x24')]);return _0x453ea8(_0x127795[_0x2a77('0x23')]['message']);}logger[_0x2a77('0x23')](_0x2a77('0x1e'),_0x32edec,_0x127795[_0x2a77('0x23')][_0x2a77('0x24')]);return _0x225023(_0x127795[_0x2a77('0x23')]['message']);}else{logger[_0x2a77('0x1d')](_0x2a77('0x1e'),_0x32edec,_0x2a77('0x1f'));_0x225023(_0x127795[_0x2a77('0x25')][_0x2a77('0x24')]);}})[_0x2a77('0x26')](function(_0x1ef3eb){logger[_0x2a77('0x23')](_0x2a77('0x1e'),_0x32edec,_0x1ef3eb);_0x453ea8(_0x1ef3eb);});});}function respondWithStatusCode(_0x4f3732,_0x4d57a0){_0x4d57a0=_0x4d57a0||0xcc;return function(_0x235396){if(_0x235396){return _0x4f3732[_0x2a77('0x27')](_0x4d57a0);}return _0x4f3732['status'](_0x4d57a0)[_0x2a77('0x28')]();};}function respondWithResult(_0x9b96a3,_0x50ba20){_0x50ba20=_0x50ba20||0xc8;return function(_0x3e346b){if(_0x3e346b){return _0x9b96a3['status'](_0x50ba20)[_0x2a77('0x29')](_0x3e346b);}};}function respondWithFilteredResult(_0xa70772,_0x403791){return function(_0x4b7102){if(_0x4b7102){var _0x519ce7=typeof _0x403791['offset']==='undefined'&&typeof _0x403791[_0x2a77('0x2a')]===_0x2a77('0x2b');var _0x24e456=_0x4b7102['count'];var _0x100c7c=_0x519ce7?0x0:_0x403791[_0x2a77('0x2c')];var _0x257a56=_0x519ce7?_0x4b7102[_0x2a77('0x2d')]:_0x403791[_0x2a77('0x2c')]+_0x403791[_0x2a77('0x2a')];var _0x53f91a;if(_0x257a56>=_0x24e456){_0x257a56=_0x24e456;_0x53f91a=0xc8;}else{_0x53f91a=0xce;}_0xa70772[_0x2a77('0x2e')](_0x53f91a);return _0xa70772[_0x2a77('0x2f')]('Content-Range',_0x100c7c+'-'+_0x257a56+'/'+_0x24e456)[_0x2a77('0x29')](_0x4b7102);}return null;};}function patchUpdates(_0x26c1be){return function(_0x5cc2bc){try{jsonpatch['apply'](_0x5cc2bc,_0x26c1be,!![]);}catch(_0x4726eb){return BPromise[_0x2a77('0x30')](_0x4726eb);}return _0x5cc2bc[_0x2a77('0x31')]();};}function saveUpdates(_0x364a4e,_0x380832){return function(_0x238045){if(_0x238045){return _0x238045['update'](_0x364a4e)[_0x2a77('0x1c')](function(_0x44b32f){return _0x44b32f;});}return null;};}function removeEntity(_0x457267,_0xe40b8d){return function(_0x322c10){if(_0x322c10){return _0x322c10[_0x2a77('0x32')]()[_0x2a77('0x1c')](function(){_0x457267[_0x2a77('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30592f,_0xd7bcff){return function(_0x127e40){if(!_0x127e40){_0x30592f[_0x2a77('0x27')](0x194);}return _0x127e40;};}function handleError(_0x2dfc4e,_0x22e22a){_0x22e22a=_0x22e22a||0x1f4;return function(_0x59addb){logger['error'](_0x59addb[_0x2a77('0x33')]);if(_0x59addb[_0x2a77('0x34')]){delete _0x59addb[_0x2a77('0x34')];}_0x2dfc4e[_0x2a77('0x2e')](_0x22e22a)[_0x2a77('0x35')](_0x59addb);};}exports[_0x2a77('0x36')]=function(_0x562241,_0x447618){var _0x40764b={},_0x474560={},_0x378fc8={'count':0x0,'rows':[]};var _0x58a47f=_[_0x2a77('0x37')](db[_0x2a77('0x38')][_0x2a77('0x39')],function(_0x30ed7d){return{'name':_0x30ed7d[_0x2a77('0x3a')],'type':_0x30ed7d[_0x2a77('0x3b')]['key']};});_0x474560[_0x2a77('0x3c')]=_[_0x2a77('0x37')](_0x58a47f,'name');_0x474560['query']=_[_0x2a77('0x3d')](_0x562241[_0x2a77('0x3e')]);_0x474560[_0x2a77('0x3f')]=_[_0x2a77('0x40')](_0x474560[_0x2a77('0x3c')],_0x474560['query']);_0x40764b[_0x2a77('0x41')]=_[_0x2a77('0x40')](_0x474560[_0x2a77('0x3c')],qs[_0x2a77('0x42')](_0x562241[_0x2a77('0x3e')][_0x2a77('0x42')]));_0x40764b[_0x2a77('0x41')]=_0x40764b[_0x2a77('0x41')][_0x2a77('0x43')]?_0x40764b[_0x2a77('0x41')]:_0x474560[_0x2a77('0x3c')];if(!_0x562241[_0x2a77('0x3e')][_0x2a77('0x44')]('nolimit')){_0x40764b['limit']=qs[_0x2a77('0x2a')](_0x562241['query'][_0x2a77('0x2a')]);_0x40764b[_0x2a77('0x2c')]=qs[_0x2a77('0x2c')](_0x562241['query'][_0x2a77('0x2c')]);}_0x40764b[_0x2a77('0x45')]=qs['sort'](_0x562241[_0x2a77('0x3e')][_0x2a77('0x46')]);_0x40764b[_0x2a77('0x47')]=qs[_0x2a77('0x3f')](_[_0x2a77('0x48')](_0x562241[_0x2a77('0x3e')],_0x474560[_0x2a77('0x3f')]),_0x58a47f);if(_0x562241[_0x2a77('0x3e')][_0x2a77('0x49')]){_0x40764b[_0x2a77('0x47')]=_[_0x2a77('0x4a')](_0x40764b[_0x2a77('0x47')],{'$or':_[_0x2a77('0x37')](_0x58a47f,function(_0x3cf04c){if(_0x3cf04c[_0x2a77('0x3b')]!=='VIRTUAL'){var _0x2ac14c={};_0x2ac14c[_0x3cf04c[_0x2a77('0x34')]]={'$like':'%'+_0x562241['query']['filter']+'%'};return _0x2ac14c;}})});}_0x40764b=_['merge']({},_0x40764b,_0x562241[_0x2a77('0x4b')]);var _0x5b598b={'where':_0x40764b[_0x2a77('0x47')]};return db[_0x2a77('0x38')]['count'](_0x5b598b)['then'](function(_0x5ab00b){_0x378fc8[_0x2a77('0x2d')]=_0x5ab00b;if(_0x562241[_0x2a77('0x3e')][_0x2a77('0x4c')]){_0x40764b[_0x2a77('0x4d')]=[{'all':!![]}];}return db[_0x2a77('0x38')][_0x2a77('0x4e')](_0x40764b);})[_0x2a77('0x1c')](function(_0x5aea63){_0x378fc8[_0x2a77('0x4f')]=_0x5aea63;return _0x378fc8;})[_0x2a77('0x1c')](respondWithFilteredResult(_0x447618,_0x40764b))[_0x2a77('0x26')](handleError(_0x447618,null));};exports[_0x2a77('0x50')]=function(_0x532306,_0x2bd315){var _0x1bb624={'raw':![],'where':{'id':_0x532306[_0x2a77('0x51')]['id']}},_0x11d63b={};_0x11d63b[_0x2a77('0x3c')]=_[_0x2a77('0x3d')](db['ServicenowConfiguration'][_0x2a77('0x39')]);_0x11d63b[_0x2a77('0x3e')]=_['keys'](_0x532306['query']);_0x11d63b['filters']=_[_0x2a77('0x40')](_0x11d63b['model'],_0x11d63b[_0x2a77('0x3e')]);_0x1bb624[_0x2a77('0x41')]=_[_0x2a77('0x40')](_0x11d63b[_0x2a77('0x3c')],qs['fields'](_0x532306[_0x2a77('0x3e')][_0x2a77('0x42')]));_0x1bb624[_0x2a77('0x41')]=_0x1bb624[_0x2a77('0x41')][_0x2a77('0x43')]?_0x1bb624[_0x2a77('0x41')]:_0x11d63b[_0x2a77('0x3c')];if(_0x532306[_0x2a77('0x3e')][_0x2a77('0x4c')]){_0x1bb624['include']=[{'all':!![]}];}_0x1bb624=_[_0x2a77('0x4a')]({},_0x1bb624,_0x532306[_0x2a77('0x4b')]);return db[_0x2a77('0x38')][_0x2a77('0x52')](_0x1bb624)[_0x2a77('0x1c')](handleEntityNotFound(_0x2bd315,null))['then'](respondWithResult(_0x2bd315,null))['catch'](handleError(_0x2bd315,null));};exports['create']=function(_0x2a10b3,_0xb93b3){return db[_0x2a77('0x38')]['create'](_0x2a10b3[_0x2a77('0x53')],{})[_0x2a77('0x1c')](respondWithResult(_0xb93b3,0xc9))['catch'](handleError(_0xb93b3,null));};exports[_0x2a77('0x54')]=function(_0x39407e,_0x24b471){if(_0x39407e[_0x2a77('0x53')]['id']){delete _0x39407e[_0x2a77('0x53')]['id'];}return db[_0x2a77('0x38')]['find']({'where':{'id':_0x39407e[_0x2a77('0x51')]['id']}})[_0x2a77('0x1c')](handleEntityNotFound(_0x24b471,null))[_0x2a77('0x1c')](saveUpdates(_0x39407e[_0x2a77('0x53')],null))[_0x2a77('0x1c')](respondWithResult(_0x24b471,null))[_0x2a77('0x26')](handleError(_0x24b471,null));};exports['destroy']=function(_0x19c229,_0x4ac3a3){return db[_0x2a77('0x38')][_0x2a77('0x52')]({'where':{'id':_0x19c229[_0x2a77('0x51')]['id']}})[_0x2a77('0x1c')](handleEntityNotFound(_0x4ac3a3,null))[_0x2a77('0x1c')](removeEntity(_0x4ac3a3,null))[_0x2a77('0x26')](handleError(_0x4ac3a3,null));};exports['getFields']=function(_0x5e2388,_0x454864,_0x1d71e9){var _0x581fc7={};var _0x2f7ba0={};var _0x5535b8;var _0x2ebdff;return db[_0x2a77('0x38')][_0x2a77('0x55')]({'where':{'id':_0x5e2388[_0x2a77('0x51')]['id']}})[_0x2a77('0x1c')](handleEntityNotFound(_0x454864,null))['then'](function(_0x2c99b5){if(_0x2c99b5){_0x5535b8=_0x2c99b5;_0x2f7ba0['model']=_[_0x2a77('0x3d')](db['ServicenowField'][_0x2a77('0x39')]);_0x2f7ba0[_0x2a77('0x3e')]=_[_0x2a77('0x3d')](_0x5e2388[_0x2a77('0x3e')]);_0x2f7ba0[_0x2a77('0x3f')]=_['intersection'](_0x2f7ba0[_0x2a77('0x3c')],_0x2f7ba0['query']);_0x581fc7['attributes']=_[_0x2a77('0x40')](_0x2f7ba0['model'],qs[_0x2a77('0x42')](_0x5e2388[_0x2a77('0x3e')][_0x2a77('0x42')]));_0x581fc7[_0x2a77('0x41')]=_0x581fc7[_0x2a77('0x41')][_0x2a77('0x43')]?_0x581fc7[_0x2a77('0x41')]:_0x2f7ba0[_0x2a77('0x3c')];_0x581fc7['order']=qs[_0x2a77('0x46')](_0x5e2388['query'][_0x2a77('0x46')]);_0x581fc7[_0x2a77('0x47')]=qs[_0x2a77('0x3f')](_[_0x2a77('0x48')](_0x5e2388[_0x2a77('0x3e')],_0x2f7ba0[_0x2a77('0x3f')]));if(_0x5e2388[_0x2a77('0x3e')][_0x2a77('0x49')]){_0x581fc7[_0x2a77('0x47')]=_[_0x2a77('0x4a')](_0x581fc7[_0x2a77('0x47')],{'$or':_[_0x2a77('0x37')](_0x581fc7['attributes'],function(_0xf0eed2){var _0x4229e6={};_0x4229e6[_0xf0eed2]={'$like':'%'+_0x5e2388[_0x2a77('0x3e')][_0x2a77('0x49')]+'%'};return _0x4229e6;})});}_0x581fc7=_[_0x2a77('0x4a')]({},_0x581fc7,_0x5e2388[_0x2a77('0x4b')]);return _0x5535b8[_0x2a77('0x56')](_0x581fc7);}})[_0x2a77('0x1c')](function(_0x29b7d5){if(_0x29b7d5){_0x2ebdff=_0x29b7d5[_0x2a77('0x43')];if(!_0x5e2388[_0x2a77('0x3e')][_0x2a77('0x44')](_0x2a77('0x57'))){_0x581fc7[_0x2a77('0x2a')]=qs[_0x2a77('0x2a')](_0x5e2388[_0x2a77('0x3e')][_0x2a77('0x2a')]);_0x581fc7[_0x2a77('0x2c')]=qs[_0x2a77('0x2c')](_0x5e2388['query'][_0x2a77('0x2c')]);}return _0x5535b8[_0x2a77('0x56')](_0x581fc7);}})[_0x2a77('0x1c')](function(_0x246f98){if(_0x246f98){return _0x246f98?{'count':_0x2ebdff,'rows':_0x246f98}:null;}})['then'](respondWithResult(_0x454864,null))[_0x2a77('0x26')](handleError(_0x454864,null));};exports[_0x2a77('0x58')]=function(_0x331393,_0x17fb06,_0x150fc2){var _0x499149={};var _0x5172bc={};var _0x349f7a;var _0x4ef82c;return db[_0x2a77('0x38')][_0x2a77('0x55')]({'where':{'id':_0x331393['params']['id']}})['then'](handleEntityNotFound(_0x17fb06,null))[_0x2a77('0x1c')](function(_0x461e69){if(_0x461e69){_0x349f7a=_0x461e69;_0x5172bc[_0x2a77('0x3c')]=_['keys'](db[_0x2a77('0x59')]['rawAttributes']);_0x5172bc['query']=_[_0x2a77('0x3d')](_0x331393[_0x2a77('0x3e')]);_0x5172bc[_0x2a77('0x3f')]=_[_0x2a77('0x40')](_0x5172bc[_0x2a77('0x3c')],_0x5172bc[_0x2a77('0x3e')]);_0x499149[_0x2a77('0x41')]=_[_0x2a77('0x40')](_0x5172bc[_0x2a77('0x3c')],qs[_0x2a77('0x42')](_0x331393[_0x2a77('0x3e')]['fields']));_0x499149[_0x2a77('0x41')]=_0x499149['attributes'][_0x2a77('0x43')]?_0x499149[_0x2a77('0x41')]:_0x5172bc[_0x2a77('0x3c')];_0x499149['order']=qs[_0x2a77('0x46')](_0x331393[_0x2a77('0x3e')]['sort']);_0x499149[_0x2a77('0x47')]=qs[_0x2a77('0x3f')](_['pick'](_0x331393['query'],_0x5172bc['filters']));if(_0x331393[_0x2a77('0x3e')][_0x2a77('0x49')]){_0x499149['where']=_[_0x2a77('0x4a')](_0x499149[_0x2a77('0x47')],{'$or':_[_0x2a77('0x37')](_0x499149['attributes'],function(_0x4eba27){var _0x16cd75={};_0x16cd75[_0x4eba27]={'$like':'%'+_0x331393[_0x2a77('0x3e')][_0x2a77('0x49')]+'%'};return _0x16cd75;})});}_0x499149=_[_0x2a77('0x4a')]({},_0x499149,_0x331393[_0x2a77('0x4b')]);return _0x349f7a[_0x2a77('0x58')](_0x499149);}})[_0x2a77('0x1c')](function(_0x196b73){if(_0x196b73){_0x4ef82c=_0x196b73[_0x2a77('0x43')];if(!_0x331393[_0x2a77('0x3e')][_0x2a77('0x44')](_0x2a77('0x57'))){_0x499149[_0x2a77('0x2a')]=qs[_0x2a77('0x2a')](_0x331393[_0x2a77('0x3e')][_0x2a77('0x2a')]);_0x499149[_0x2a77('0x2c')]=qs[_0x2a77('0x2c')](_0x331393[_0x2a77('0x3e')][_0x2a77('0x2c')]);}return _0x349f7a[_0x2a77('0x58')](_0x499149);}})[_0x2a77('0x1c')](function(_0x20bd00){if(_0x20bd00){return _0x20bd00?{'count':_0x4ef82c,'rows':_0x20bd00}:null;}})['then'](respondWithResult(_0x17fb06,null))['catch'](handleError(_0x17fb06,null));};exports[_0x2a77('0x5a')]=function(_0x20a9c7,_0x5230b0,_0x12b686){var _0x415b43={};var _0x42a35f={};var _0x34a4be;var _0x4997ca;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x20a9c7['params']['id']}})['then'](handleEntityNotFound(_0x5230b0,null))[_0x2a77('0x1c')](function(_0x3de262){if(_0x3de262){_0x34a4be=_0x3de262;_0x42a35f[_0x2a77('0x3c')]=_[_0x2a77('0x3d')](db[_0x2a77('0x59')]['rawAttributes']);_0x42a35f[_0x2a77('0x3e')]=_['keys'](_0x20a9c7[_0x2a77('0x3e')]);_0x42a35f[_0x2a77('0x3f')]=_[_0x2a77('0x40')](_0x42a35f['model'],_0x42a35f[_0x2a77('0x3e')]);_0x415b43[_0x2a77('0x41')]=_['intersection'](_0x42a35f['model'],qs[_0x2a77('0x42')](_0x20a9c7[_0x2a77('0x3e')][_0x2a77('0x42')]));_0x415b43[_0x2a77('0x41')]=_0x415b43[_0x2a77('0x41')][_0x2a77('0x43')]?_0x415b43[_0x2a77('0x41')]:_0x42a35f[_0x2a77('0x3c')];_0x415b43[_0x2a77('0x45')]=qs[_0x2a77('0x46')](_0x20a9c7[_0x2a77('0x3e')][_0x2a77('0x46')]);_0x415b43['where']=qs['filters'](_[_0x2a77('0x48')](_0x20a9c7[_0x2a77('0x3e')],_0x42a35f[_0x2a77('0x3f')]));if(_0x20a9c7[_0x2a77('0x3e')][_0x2a77('0x49')]){_0x415b43[_0x2a77('0x47')]=_['merge'](_0x415b43[_0x2a77('0x47')],{'$or':_['map'](_0x415b43[_0x2a77('0x41')],function(_0x45029a){var _0x562ae0={};_0x562ae0[_0x45029a]={'$like':'%'+_0x20a9c7['query'][_0x2a77('0x49')]+'%'};return _0x562ae0;})});}_0x415b43=_[_0x2a77('0x4a')]({},_0x415b43,_0x20a9c7[_0x2a77('0x4b')]);return _0x34a4be['getDescriptions'](_0x415b43);}})['then'](function(_0x2e29d1){if(_0x2e29d1){_0x4997ca=_0x2e29d1['length'];if(!_0x20a9c7['query'][_0x2a77('0x44')](_0x2a77('0x57'))){_0x415b43[_0x2a77('0x2a')]=qs['limit'](_0x20a9c7[_0x2a77('0x3e')][_0x2a77('0x2a')]);_0x415b43['offset']=qs[_0x2a77('0x2c')](_0x20a9c7['query'][_0x2a77('0x2c')]);}return _0x34a4be[_0x2a77('0x5a')](_0x415b43);}})[_0x2a77('0x1c')](function(_0x419d31){if(_0x419d31){return _0x419d31?{'count':_0x4997ca,'rows':_0x419d31}:null;}})[_0x2a77('0x1c')](respondWithResult(_0x5230b0,null))[_0x2a77('0x26')](handleError(_0x5230b0,null));}; \ No newline at end of file +var _0x0323=['body','findOne','ServicenowField','filter','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','options','ServicenowConfiguration','include','findAll','rows','show','params','keys','rawAttributes','includeAll','merge','find','catch','create'];(function(_0x37da98,_0x240110){var _0x5c1326=function(_0x5b8165){while(--_0x5b8165){_0x37da98['push'](_0x37da98['shift']());}};_0x5c1326(++_0x240110);}(_0x0323,0x124));var _0x3032=function(_0x28db37,_0x539b92){_0x28db37=_0x28db37-0x0;var _0x562a4d=_0x0323[_0x28db37];return _0x562a4d;};'use strict';var emlformat=require(_0x3032('0x0'));var rimraf=require(_0x3032('0x1'));var zipdir=require(_0x3032('0x2'));var jsonpatch=require(_0x3032('0x3'));var rp=require(_0x3032('0x4'));var moment=require(_0x3032('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3032('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3032('0x7'));var csv=require(_0x3032('0x8'));var ejs=require(_0x3032('0x9'));var fs=require('fs');var fs_extra=require(_0x3032('0xa'));var _=require(_0x3032('0xb'));var squel=require(_0x3032('0xc'));var crypto=require(_0x3032('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3032('0xe'));var toCsv=require(_0x3032('0x8'));var querystring=require(_0x3032('0xf'));var Papa=require('papaparse');var Redis=require(_0x3032('0x10'));var authService=require(_0x3032('0x11'));var qs=require(_0x3032('0x12'));var as=require(_0x3032('0x13'));var hardwareService=require(_0x3032('0x14'));var logger=require(_0x3032('0x15'))(_0x3032('0x16'));var utils=require(_0x3032('0x17'));var config=require(_0x3032('0x18'));var licenseUtil=require(_0x3032('0x19'));var db=require(_0x3032('0x1a'))['db'];var jayson=require(_0x3032('0x1b'));var client=jayson['client'][_0x3032('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1311c0,_0x3f0883,_0x4d0e24,_0x588a0c){return new BPromise(function(_0x4e9969,_0x28dcac){var _0x48b6d3=_0x588a0c||client;return _0x48b6d3['request'](_0x1311c0,_0x4d0e24)[_0x3032('0x1d')](function(_0x434ef7){logger[_0x3032('0x1e')](_0x3032('0x1f'),_0x3f0883,'request\x20sent');logger[_0x3032('0x20')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x3f0883,_0x3032('0x21'),JSON[_0x3032('0x22')](_0x434ef7));if(_0x434ef7['error']){if(_0x434ef7[_0x3032('0x23')][_0x3032('0x24')]===0x1f4){logger[_0x3032('0x23')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3f0883,_0x434ef7[_0x3032('0x23')][_0x3032('0x25')]);return _0x28dcac(_0x434ef7['error'][_0x3032('0x25')]);}logger[_0x3032('0x23')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3f0883,_0x434ef7[_0x3032('0x23')]['message']);return _0x4e9969(_0x434ef7[_0x3032('0x23')][_0x3032('0x25')]);}else{logger[_0x3032('0x1e')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3f0883,_0x3032('0x21'));_0x4e9969(_0x434ef7[_0x3032('0x26')]['message']);}})['catch'](function(_0x3d71b1){logger[_0x3032('0x23')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3f0883,_0x3d71b1);_0x28dcac(_0x3d71b1);});});}function respondWithStatusCode(_0x4bef6d,_0x51813c){_0x51813c=_0x51813c||0xcc;return function(_0x545793){if(_0x545793){return _0x4bef6d[_0x3032('0x27')](_0x51813c);}return _0x4bef6d[_0x3032('0x28')](_0x51813c)[_0x3032('0x29')]();};}function respondWithResult(_0x4524a0,_0x2de8a9){_0x2de8a9=_0x2de8a9||0xc8;return function(_0x2ef721){if(_0x2ef721){return _0x4524a0[_0x3032('0x28')](_0x2de8a9)[_0x3032('0x2a')](_0x2ef721);}};}function respondWithFilteredResult(_0x575d69,_0x36e484){return function(_0x1edd13){if(_0x1edd13){var _0x5506d5=typeof _0x36e484[_0x3032('0x2b')]===_0x3032('0x2c')&&typeof _0x36e484[_0x3032('0x2d')]===_0x3032('0x2c');var _0x2643dc=_0x1edd13['count'];var _0x4a627a=_0x5506d5?0x0:_0x36e484['offset'];var _0x13ec47=_0x5506d5?_0x1edd13[_0x3032('0x2e')]:_0x36e484[_0x3032('0x2b')]+_0x36e484[_0x3032('0x2d')];var _0x42f2a5;if(_0x13ec47>=_0x2643dc){_0x13ec47=_0x2643dc;_0x42f2a5=0xc8;}else{_0x42f2a5=0xce;}_0x575d69[_0x3032('0x28')](_0x42f2a5);return _0x575d69[_0x3032('0x2f')](_0x3032('0x30'),_0x4a627a+'-'+_0x13ec47+'/'+_0x2643dc)['json'](_0x1edd13);}return null;};}function patchUpdates(_0x1f1b79){return function(_0x272a44){try{jsonpatch[_0x3032('0x31')](_0x272a44,_0x1f1b79,!![]);}catch(_0x1ea88d){return BPromise['reject'](_0x1ea88d);}return _0x272a44['save']();};}function saveUpdates(_0x3dcc15,_0x52d00c){return function(_0xb3218c){if(_0xb3218c){return _0xb3218c[_0x3032('0x32')](_0x3dcc15)['then'](function(_0x21d8c1){return _0x21d8c1;});}return null;};}function removeEntity(_0x25b568,_0x3a9db1){return function(_0x25abcc){if(_0x25abcc){return _0x25abcc[_0x3032('0x33')]()[_0x3032('0x1d')](function(){_0x25b568[_0x3032('0x28')](0xcc)[_0x3032('0x29')]();});}};}function handleEntityNotFound(_0x2c4baf,_0x446eb2){return function(_0x4659fd){if(!_0x4659fd){_0x2c4baf[_0x3032('0x27')](0x194);}return _0x4659fd;};}function handleError(_0x24f0ee,_0x2fd92f){_0x2fd92f=_0x2fd92f||0x1f4;return function(_0x542b63){logger['error'](_0x542b63[_0x3032('0x34')]);if(_0x542b63[_0x3032('0x35')]){delete _0x542b63[_0x3032('0x35')];}_0x24f0ee[_0x3032('0x28')](_0x2fd92f)[_0x3032('0x36')](_0x542b63);};}exports[_0x3032('0x37')]=function(_0x36c77a,_0x40d093){var _0x3c5808={},_0xf14b29={},_0x584a3c={'count':0x0,'rows':[]};var _0x1a9a0a=_[_0x3032('0x38')](db['ServicenowConfiguration']['rawAttributes'],function(_0x1504fb){return{'name':_0x1504fb[_0x3032('0x39')],'type':_0x1504fb[_0x3032('0x3a')][_0x3032('0x3b')]};});_0xf14b29[_0x3032('0x3c')]=_[_0x3032('0x38')](_0x1a9a0a,'name');_0xf14b29[_0x3032('0x3d')]=_['keys'](_0x36c77a[_0x3032('0x3d')]);_0xf14b29[_0x3032('0x3e')]=_[_0x3032('0x3f')](_0xf14b29[_0x3032('0x3c')],_0xf14b29[_0x3032('0x3d')]);_0x3c5808[_0x3032('0x40')]=_[_0x3032('0x3f')](_0xf14b29[_0x3032('0x3c')],qs[_0x3032('0x41')](_0x36c77a['query'][_0x3032('0x41')]));_0x3c5808['attributes']=_0x3c5808[_0x3032('0x40')][_0x3032('0x42')]?_0x3c5808[_0x3032('0x40')]:_0xf14b29[_0x3032('0x3c')];if(!_0x36c77a['query'][_0x3032('0x43')](_0x3032('0x44'))){_0x3c5808[_0x3032('0x2d')]=qs[_0x3032('0x2d')](_0x36c77a[_0x3032('0x3d')][_0x3032('0x2d')]);_0x3c5808[_0x3032('0x2b')]=qs[_0x3032('0x2b')](_0x36c77a[_0x3032('0x3d')][_0x3032('0x2b')]);}_0x3c5808[_0x3032('0x45')]=qs[_0x3032('0x46')](_0x36c77a[_0x3032('0x3d')]['sort']);_0x3c5808['where']=qs[_0x3032('0x3e')](_[_0x3032('0x47')](_0x36c77a[_0x3032('0x3d')],_0xf14b29[_0x3032('0x3e')]),_0x1a9a0a);if(_0x36c77a[_0x3032('0x3d')]['filter']){_0x3c5808[_0x3032('0x48')]=_['merge'](_0x3c5808[_0x3032('0x48')],{'$or':_[_0x3032('0x38')](_0x1a9a0a,function(_0x343b62){if(_0x343b62[_0x3032('0x3a')]!==_0x3032('0x49')){var _0x5ba516={};_0x5ba516[_0x343b62[_0x3032('0x35')]]={'$like':'%'+_0x36c77a['query']['filter']+'%'};return _0x5ba516;}})});}_0x3c5808=_['merge']({},_0x3c5808,_0x36c77a[_0x3032('0x4a')]);var _0x184cbd={'where':_0x3c5808[_0x3032('0x48')]};return db[_0x3032('0x4b')][_0x3032('0x2e')](_0x184cbd)['then'](function(_0x48e382){_0x584a3c[_0x3032('0x2e')]=_0x48e382;if(_0x36c77a[_0x3032('0x3d')]['includeAll']){_0x3c5808[_0x3032('0x4c')]=[{'all':!![]}];}return db[_0x3032('0x4b')][_0x3032('0x4d')](_0x3c5808);})[_0x3032('0x1d')](function(_0x177d19){_0x584a3c[_0x3032('0x4e')]=_0x177d19;return _0x584a3c;})['then'](respondWithFilteredResult(_0x40d093,_0x3c5808))['catch'](handleError(_0x40d093,null));};exports[_0x3032('0x4f')]=function(_0x376aea,_0x5b9810){var _0x219861={'raw':![],'where':{'id':_0x376aea[_0x3032('0x50')]['id']}},_0x109ebb={};_0x109ebb[_0x3032('0x3c')]=_[_0x3032('0x51')](db['ServicenowConfiguration'][_0x3032('0x52')]);_0x109ebb[_0x3032('0x3d')]=_[_0x3032('0x51')](_0x376aea['query']);_0x109ebb[_0x3032('0x3e')]=_['intersection'](_0x109ebb[_0x3032('0x3c')],_0x109ebb[_0x3032('0x3d')]);_0x219861['attributes']=_[_0x3032('0x3f')](_0x109ebb['model'],qs[_0x3032('0x41')](_0x376aea[_0x3032('0x3d')]['fields']));_0x219861[_0x3032('0x40')]=_0x219861[_0x3032('0x40')][_0x3032('0x42')]?_0x219861['attributes']:_0x109ebb[_0x3032('0x3c')];if(_0x376aea[_0x3032('0x3d')][_0x3032('0x53')]){_0x219861[_0x3032('0x4c')]=[{'all':!![]}];}_0x219861=_[_0x3032('0x54')]({},_0x219861,_0x376aea['options']);return db[_0x3032('0x4b')][_0x3032('0x55')](_0x219861)[_0x3032('0x1d')](handleEntityNotFound(_0x5b9810,null))['then'](respondWithResult(_0x5b9810,null))[_0x3032('0x56')](handleError(_0x5b9810,null));};exports['create']=function(_0x3f7c22,_0x1f0522){return db[_0x3032('0x4b')][_0x3032('0x57')](_0x3f7c22['body'],{})[_0x3032('0x1d')](respondWithResult(_0x1f0522,0xc9))[_0x3032('0x56')](handleError(_0x1f0522,null));};exports[_0x3032('0x32')]=function(_0x2ee70a,_0x2c570d){if(_0x2ee70a[_0x3032('0x58')]['id']){delete _0x2ee70a['body']['id'];}return db['ServicenowConfiguration'][_0x3032('0x55')]({'where':{'id':_0x2ee70a['params']['id']}})[_0x3032('0x1d')](handleEntityNotFound(_0x2c570d,null))[_0x3032('0x1d')](saveUpdates(_0x2ee70a[_0x3032('0x58')],null))[_0x3032('0x1d')](respondWithResult(_0x2c570d,null))[_0x3032('0x56')](handleError(_0x2c570d,null));};exports[_0x3032('0x33')]=function(_0x592f7b,_0x403696){return db[_0x3032('0x4b')][_0x3032('0x55')]({'where':{'id':_0x592f7b['params']['id']}})[_0x3032('0x1d')](handleEntityNotFound(_0x403696,null))[_0x3032('0x1d')](removeEntity(_0x403696,null))[_0x3032('0x56')](handleError(_0x403696,null));};exports['getFields']=function(_0x110079,_0x281f4d,_0xd25aa){var _0x1956a0={};var _0x221f08={};var _0x3dcfd6;var _0xb5e94;return db['ServicenowConfiguration'][_0x3032('0x59')]({'where':{'id':_0x110079[_0x3032('0x50')]['id']}})['then'](handleEntityNotFound(_0x281f4d,null))['then'](function(_0xcc041b){if(_0xcc041b){_0x3dcfd6=_0xcc041b;_0x221f08['model']=_[_0x3032('0x51')](db[_0x3032('0x5a')]['rawAttributes']);_0x221f08[_0x3032('0x3d')]=_[_0x3032('0x51')](_0x110079[_0x3032('0x3d')]);_0x221f08[_0x3032('0x3e')]=_[_0x3032('0x3f')](_0x221f08[_0x3032('0x3c')],_0x221f08[_0x3032('0x3d')]);_0x1956a0[_0x3032('0x40')]=_['intersection'](_0x221f08[_0x3032('0x3c')],qs[_0x3032('0x41')](_0x110079[_0x3032('0x3d')][_0x3032('0x41')]));_0x1956a0[_0x3032('0x40')]=_0x1956a0['attributes'][_0x3032('0x42')]?_0x1956a0[_0x3032('0x40')]:_0x221f08['model'];_0x1956a0[_0x3032('0x45')]=qs['sort'](_0x110079['query'][_0x3032('0x46')]);_0x1956a0['where']=qs[_0x3032('0x3e')](_[_0x3032('0x47')](_0x110079[_0x3032('0x3d')],_0x221f08['filters']));if(_0x110079[_0x3032('0x3d')][_0x3032('0x5b')]){_0x1956a0[_0x3032('0x48')]=_['merge'](_0x1956a0[_0x3032('0x48')],{'$or':_[_0x3032('0x38')](_0x1956a0[_0x3032('0x40')],function(_0x42dbb6){var _0x46c137={};_0x46c137[_0x42dbb6]={'$like':'%'+_0x110079[_0x3032('0x3d')]['filter']+'%'};return _0x46c137;})});}_0x1956a0=_['merge']({},_0x1956a0,_0x110079[_0x3032('0x4a')]);return _0x3dcfd6['getFields'](_0x1956a0);}})['then'](function(_0x20c89a){if(_0x20c89a){_0xb5e94=_0x20c89a[_0x3032('0x42')];if(!_0x110079[_0x3032('0x3d')]['hasOwnProperty'](_0x3032('0x44'))){_0x1956a0[_0x3032('0x2d')]=qs['limit'](_0x110079['query'][_0x3032('0x2d')]);_0x1956a0[_0x3032('0x2b')]=qs['offset'](_0x110079['query'][_0x3032('0x2b')]);}return _0x3dcfd6[_0x3032('0x5c')](_0x1956a0);}})[_0x3032('0x1d')](function(_0x5338bd){if(_0x5338bd){return _0x5338bd?{'count':_0xb5e94,'rows':_0x5338bd}:null;}})[_0x3032('0x1d')](respondWithResult(_0x281f4d,null))[_0x3032('0x56')](handleError(_0x281f4d,null));};exports[_0x3032('0x5d')]=function(_0x5ef0c4,_0xba1dae,_0x448174){var _0x2d6361={};var _0x14c03e={};var _0x17f1a1;var _0x3546ec;return db[_0x3032('0x4b')][_0x3032('0x59')]({'where':{'id':_0x5ef0c4[_0x3032('0x50')]['id']}})['then'](handleEntityNotFound(_0xba1dae,null))['then'](function(_0x3262ef){if(_0x3262ef){_0x17f1a1=_0x3262ef;_0x14c03e['model']=_[_0x3032('0x51')](db[_0x3032('0x5a')][_0x3032('0x52')]);_0x14c03e[_0x3032('0x3d')]=_[_0x3032('0x51')](_0x5ef0c4[_0x3032('0x3d')]);_0x14c03e[_0x3032('0x3e')]=_[_0x3032('0x3f')](_0x14c03e['model'],_0x14c03e[_0x3032('0x3d')]);_0x2d6361['attributes']=_[_0x3032('0x3f')](_0x14c03e[_0x3032('0x3c')],qs[_0x3032('0x41')](_0x5ef0c4[_0x3032('0x3d')][_0x3032('0x41')]));_0x2d6361['attributes']=_0x2d6361['attributes'][_0x3032('0x42')]?_0x2d6361['attributes']:_0x14c03e[_0x3032('0x3c')];_0x2d6361[_0x3032('0x45')]=qs[_0x3032('0x46')](_0x5ef0c4[_0x3032('0x3d')]['sort']);_0x2d6361[_0x3032('0x48')]=qs[_0x3032('0x3e')](_[_0x3032('0x47')](_0x5ef0c4[_0x3032('0x3d')],_0x14c03e[_0x3032('0x3e')]));if(_0x5ef0c4['query'][_0x3032('0x5b')]){_0x2d6361[_0x3032('0x48')]=_[_0x3032('0x54')](_0x2d6361[_0x3032('0x48')],{'$or':_['map'](_0x2d6361[_0x3032('0x40')],function(_0x19a233){var _0x4c8937={};_0x4c8937[_0x19a233]={'$like':'%'+_0x5ef0c4['query'][_0x3032('0x5b')]+'%'};return _0x4c8937;})});}_0x2d6361=_[_0x3032('0x54')]({},_0x2d6361,_0x5ef0c4['options']);return _0x17f1a1[_0x3032('0x5d')](_0x2d6361);}})[_0x3032('0x1d')](function(_0x49e11a){if(_0x49e11a){_0x3546ec=_0x49e11a[_0x3032('0x42')];if(!_0x5ef0c4[_0x3032('0x3d')][_0x3032('0x43')](_0x3032('0x44'))){_0x2d6361['limit']=qs[_0x3032('0x2d')](_0x5ef0c4['query']['limit']);_0x2d6361[_0x3032('0x2b')]=qs['offset'](_0x5ef0c4['query'][_0x3032('0x2b')]);}return _0x17f1a1[_0x3032('0x5d')](_0x2d6361);}})[_0x3032('0x1d')](function(_0x12168b){if(_0x12168b){return _0x12168b?{'count':_0x3546ec,'rows':_0x12168b}:null;}})[_0x3032('0x1d')](respondWithResult(_0xba1dae,null))[_0x3032('0x56')](handleError(_0xba1dae,null));};exports[_0x3032('0x5e')]=function(_0x2d3442,_0xe83931,_0x298539){var _0x59433c={};var _0x3c9430={};var _0x4f3f7e;var _0x103649;return db[_0x3032('0x4b')][_0x3032('0x59')]({'where':{'id':_0x2d3442['params']['id']}})[_0x3032('0x1d')](handleEntityNotFound(_0xe83931,null))[_0x3032('0x1d')](function(_0x16ecb){if(_0x16ecb){_0x4f3f7e=_0x16ecb;_0x3c9430[_0x3032('0x3c')]=_['keys'](db[_0x3032('0x5a')][_0x3032('0x52')]);_0x3c9430[_0x3032('0x3d')]=_['keys'](_0x2d3442[_0x3032('0x3d')]);_0x3c9430[_0x3032('0x3e')]=_['intersection'](_0x3c9430[_0x3032('0x3c')],_0x3c9430[_0x3032('0x3d')]);_0x59433c[_0x3032('0x40')]=_['intersection'](_0x3c9430[_0x3032('0x3c')],qs[_0x3032('0x41')](_0x2d3442[_0x3032('0x3d')][_0x3032('0x41')]));_0x59433c[_0x3032('0x40')]=_0x59433c[_0x3032('0x40')][_0x3032('0x42')]?_0x59433c[_0x3032('0x40')]:_0x3c9430[_0x3032('0x3c')];_0x59433c[_0x3032('0x45')]=qs['sort'](_0x2d3442[_0x3032('0x3d')]['sort']);_0x59433c['where']=qs['filters'](_[_0x3032('0x47')](_0x2d3442[_0x3032('0x3d')],_0x3c9430[_0x3032('0x3e')]));if(_0x2d3442[_0x3032('0x3d')][_0x3032('0x5b')]){_0x59433c[_0x3032('0x48')]=_[_0x3032('0x54')](_0x59433c[_0x3032('0x48')],{'$or':_[_0x3032('0x38')](_0x59433c[_0x3032('0x40')],function(_0x19a2be){var _0x2aa4df={};_0x2aa4df[_0x19a2be]={'$like':'%'+_0x2d3442[_0x3032('0x3d')][_0x3032('0x5b')]+'%'};return _0x2aa4df;})});}_0x59433c=_[_0x3032('0x54')]({},_0x59433c,_0x2d3442[_0x3032('0x4a')]);return _0x4f3f7e[_0x3032('0x5e')](_0x59433c);}})['then'](function(_0x13f866){if(_0x13f866){_0x103649=_0x13f866['length'];if(!_0x2d3442[_0x3032('0x3d')][_0x3032('0x43')](_0x3032('0x44'))){_0x59433c[_0x3032('0x2d')]=qs[_0x3032('0x2d')](_0x2d3442['query'][_0x3032('0x2d')]);_0x59433c[_0x3032('0x2b')]=qs['offset'](_0x2d3442[_0x3032('0x3d')]['offset']);}return _0x4f3f7e[_0x3032('0x5e')](_0x59433c);}})[_0x3032('0x1d')](function(_0x3f4613){if(_0x3f4613){return _0x3f4613?{'count':_0x103649,'rows':_0x3f4613}:null;}})[_0x3032('0x1d')](respondWithResult(_0xe83931,null))[_0x3032('0x56')](handleError(_0xe83931,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 709251a..07b6b19 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 _0x3193=['define','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3193,0xbf));var _0x3319=function(_0x2b5e53,_0x37bb2d){_0x2b5e53=_0x2b5e53-0x0;var _0x10ed26=_0x3193[_0x2b5e53];return _0x10ed26;};'use strict';var _=require('lodash');var util=require(_0x3319('0x0'));var logger=require(_0x3319('0x1'))(_0x3319('0x2'));var moment=require(_0x3319('0x3'));var BPromise=require(_0x3319('0x4'));var rp=require(_0x3319('0x5'));var fs=require('fs');var path=require(_0x3319('0x6'));var rimraf=require(_0x3319('0x7'));var config=require(_0x3319('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x20f15c,_0x51af56){return _0x20f15c[_0x3319('0x9')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x778d=['./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x778d,0x1c8));var _0xd778=function(_0x57d6e7,_0x209339){_0x57d6e7=_0x57d6e7-0x0;var _0x33a428=_0x778d[_0x57d6e7];return _0x33a428;};'use strict';var _=require(_0xd778('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd778('0x1'));var rp=require(_0xd778('0x2'));var fs=require('fs');var path=require(_0xd778('0x3'));var rimraf=require(_0xd778('0x4'));var config=require(_0xd778('0x5'));var attributes=require(_0xd778('0x6'));module[_0xd778('0x7')]=function(_0x825a24,_0x29027b){return _0x825a24[_0xd778('0x8')](_0xd778('0x9'),attributes,{'tableName':_0xd778('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 230bba2..db3a23d 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 _0x3aa7=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x3d504a,_0x2f8a7b){var _0x1e9253=function(_0x4c7183){while(--_0x4c7183){_0x3d504a['push'](_0x3d504a['shift']());}};_0x1e9253(++_0x2f8a7b);}(_0x3aa7,0x1c4));var _0x73aa=function(_0x334aaa,_0x450d50){_0x334aaa=_0x334aaa-0x0;var _0x366047=_0x3aa7[_0x334aaa];return _0x366047;};'use strict';var _=require(_0x73aa('0x0'));var util=require(_0x73aa('0x1'));var moment=require(_0x73aa('0x2'));var BPromise=require(_0x73aa('0x3'));var rs=require(_0x73aa('0x4'));var fs=require('fs');var Redis=require(_0x73aa('0x5'));var db=require(_0x73aa('0x6'))['db'];var utils=require(_0x73aa('0x7'));var logger=require(_0x73aa('0x8'))(_0x73aa('0x9'));var config=require(_0x73aa('0xa'));var jayson=require(_0x73aa('0xb'));var client=jayson[_0x73aa('0xc')][_0x73aa('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x51bbaf,_0x4a840a,_0x3655df){return new BPromise(function(_0x2d59b1,_0x2272ad){return client[_0x73aa('0xe')](_0x51bbaf,_0x3655df)[_0x73aa('0xf')](function(_0x13e623){logger[_0x73aa('0x10')](_0x73aa('0x11'),_0x4a840a,_0x73aa('0x12'));logger[_0x73aa('0x13')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x4a840a,'request\x20sent',JSON['stringify'](_0x13e623));if(_0x13e623[_0x73aa('0x14')]){if(_0x13e623[_0x73aa('0x14')][_0x73aa('0x15')]===0x1f4){logger[_0x73aa('0x14')](_0x73aa('0x11'),_0x4a840a,_0x13e623[_0x73aa('0x14')]['message']);return _0x2272ad(_0x13e623[_0x73aa('0x14')][_0x73aa('0x16')]);}logger[_0x73aa('0x14')](_0x73aa('0x11'),_0x4a840a,_0x13e623[_0x73aa('0x14')][_0x73aa('0x16')]);return _0x2d59b1(_0x13e623[_0x73aa('0x14')]['message']);}else{logger[_0x73aa('0x10')](_0x73aa('0x11'),_0x4a840a,'request\x20sent');_0x2d59b1(_0x13e623[_0x73aa('0x17')]['message']);}})[_0x73aa('0x18')](function(_0x3763a1){logger[_0x73aa('0x14')](_0x73aa('0x11'),_0x4a840a,_0x3763a1);_0x2272ad(_0x3763a1);});});} \ No newline at end of file +var _0xcde8=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowConfiguration,\x20%s,\x20%s','info','result','catch','util','moment','bluebird'];(function(_0x48f287,_0x285c89){var _0x3b9800=function(_0x14027a){while(--_0x14027a){_0x48f287['push'](_0x48f287['shift']());}};_0x3b9800(++_0x285c89);}(_0xcde8,0xcc));var _0x8cde=function(_0x3f7e26,_0x5cb782){_0x3f7e26=_0x3f7e26-0x0;var _0x5858f9=_0xcde8[_0x3f7e26];return _0x5858f9;};'use strict';var _=require('lodash');var util=require(_0x8cde('0x0'));var moment=require(_0x8cde('0x1'));var BPromise=require(_0x8cde('0x2'));var rs=require(_0x8cde('0x3'));var fs=require('fs');var Redis=require(_0x8cde('0x4'));var db=require(_0x8cde('0x5'))['db'];var utils=require(_0x8cde('0x6'));var logger=require('../../config/logger')(_0x8cde('0x7'));var config=require(_0x8cde('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8cde('0x9')][_0x8cde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e9db1,_0x4381bc,_0x41ebe0){return new BPromise(function(_0x30b32b,_0x53905b){return client[_0x8cde('0xb')](_0x3e9db1,_0x41ebe0)[_0x8cde('0xc')](function(_0x7d60e5){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x4381bc,'request\x20sent');logger['debug'](_0x8cde('0xd'),_0x4381bc,_0x8cde('0xe'),JSON[_0x8cde('0xf')](_0x7d60e5));if(_0x7d60e5['error']){if(_0x7d60e5[_0x8cde('0x10')][_0x8cde('0x11')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x4381bc,_0x7d60e5[_0x8cde('0x10')][_0x8cde('0x12')]);return _0x53905b(_0x7d60e5[_0x8cde('0x10')]['message']);}logger[_0x8cde('0x10')](_0x8cde('0x13'),_0x4381bc,_0x7d60e5[_0x8cde('0x10')][_0x8cde('0x12')]);return _0x30b32b(_0x7d60e5[_0x8cde('0x10')]['message']);}else{logger[_0x8cde('0x14')](_0x8cde('0x13'),_0x4381bc,'request\x20sent');_0x30b32b(_0x7d60e5[_0x8cde('0x15')][_0x8cde('0x12')]);}})[_0x8cde('0x16')](function(_0x1ab5ac){logger[_0x8cde('0x10')](_0x8cde('0x13'),_0x4381bc,_0x1ab5ac);_0x53905b(_0x1ab5ac);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 643c998..a526f91 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 _0xd2d4=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','../../components/interaction/service','./intServicenowField.controller','get','index','/:id'];(function(_0x311e77,_0x49a459){var _0x559c54=function(_0x283a97){while(--_0x283a97){_0x311e77['push'](_0x311e77['shift']());}};_0x559c54(++_0x49a459);}(_0xd2d4,0x6f));var _0x4d2d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd2d4[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4d2d('0x0'));var util=require(_0x4d2d('0x1'));var path=require('path');var timeout=require(_0x4d2d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4d2d('0x3'));var config=require('../../config/environment');var controller=require(_0x4d2d('0x4'));router[_0x4d2d('0x5')]('/',auth['isAuthenticated'](),controller[_0x4d2d('0x6')]);router[_0x4d2d('0x5')](_0x4d2d('0x7'),auth[_0x4d2d('0x8')](),controller[_0x4d2d('0x9')]);router[_0x4d2d('0xa')]('/',auth[_0x4d2d('0x8')](),controller[_0x4d2d('0xb')]);router[_0x4d2d('0xc')](_0x4d2d('0x7'),auth[_0x4d2d('0x8')](),controller[_0x4d2d('0xd')]);router[_0x4d2d('0xe')](_0x4d2d('0x7'),auth['isAuthenticated'](),controller[_0x4d2d('0xf')]);module[_0x4d2d('0x10')]=router; \ No newline at end of file +var _0xa5e8=['create','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','post'];(function(_0x946f86,_0x7e0b8e){var _0x21a573=function(_0x5151dc){while(--_0x5151dc){_0x946f86['push'](_0x946f86['shift']());}};_0x21a573(++_0x7e0b8e);}(_0xa5e8,0xf4));var _0x8a5e=function(_0xed7f7e,_0x5e1640){_0xed7f7e=_0xed7f7e-0x0;var _0x391ced=_0xa5e8[_0xed7f7e];return _0x391ced;};'use strict';var multer=require(_0x8a5e('0x0'));var util=require('util');var path=require(_0x8a5e('0x1'));var timeout=require(_0x8a5e('0x2'));var express=require(_0x8a5e('0x3'));var router=express['Router']();var fs_extra=require(_0x8a5e('0x4'));var auth=require(_0x8a5e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8a5e('0x6'));var controller=require('./intServicenowField.controller');router[_0x8a5e('0x7')]('/',auth[_0x8a5e('0x8')](),controller['index']);router['get'](_0x8a5e('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8a5e('0xa')]('/',auth[_0x8a5e('0x8')](),controller[_0x8a5e('0xb')]);router['put']('/:id',auth[_0x8a5e('0x8')](),controller[_0x8a5e('0xc')]);router[_0x8a5e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x8a5e('0xe')]);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 6fb7e06..178c2b5 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 _0xc4aa=['ENUM','string','variable','customVariable','STRING','sequelize','exports'];(function(_0x35a0e2,_0x302ad1){var _0x31ea9a=function(_0x356d7d){while(--_0x356d7d){_0x35a0e2['push'](_0x35a0e2['shift']());}};_0x31ea9a(++_0x302ad1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc4aa[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'type':{'type':Sequelize[_0xac4a('0x2')](_0xac4a('0x3'),_0xac4a('0x4'),_0xac4a('0x5'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xac4a('0x6')]},'key':{'type':Sequelize[_0xac4a('0x6')]},'keyType':{'type':Sequelize[_0xac4a('0x2')](_0xac4a('0x3'),_0xac4a('0x4'),_0xac4a('0x5'))},'keyContent':{'type':Sequelize[_0xac4a('0x6')]},'idField':{'type':Sequelize[_0xac4a('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xac4a('0x6')]}}; \ No newline at end of file +var _0xeda8=['sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x1514e6,_0xce6f04){var _0x2daa08=function(_0x60eca){while(--_0x60eca){_0x1514e6['push'](_0x1514e6['shift']());}};_0x2daa08(++_0xce6f04);}(_0xeda8,0x104));var _0x8eda=function(_0x295f94,_0x33e330){_0x295f94=_0x295f94-0x0;var _0xda88ae=_0xeda8[_0x295f94];return _0xda88ae;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'type':{'type':Sequelize['ENUM'](_0x8eda('0x2'),_0x8eda('0x3'),_0x8eda('0x4'),_0x8eda('0x5'),_0x8eda('0x6')),'defaultValue':_0x8eda('0x2')},'content':{'type':Sequelize[_0x8eda('0x7')]},'key':{'type':Sequelize[_0x8eda('0x7')]},'keyType':{'type':Sequelize[_0x8eda('0x8')](_0x8eda('0x2'),_0x8eda('0x3'),_0x8eda('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8eda('0x7')]},'nameField':{'type':Sequelize[_0x8eda('0x7')]},'customField':{'type':Sequelize[_0x8eda('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8eda('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 45d0521..d9ccda4 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 _0x1d71=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','apply','save','update','then','destroy','end','name','send','index','ServicenowField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','merge','create','body','find','params','rimraf','request-promise','moment','mustache','util','path','sox'];(function(_0x45afc4,_0xeaa0e3){var _0x43e32b=function(_0x4fa1b0){while(--_0x4fa1b0){_0x45afc4['push'](_0x45afc4['shift']());}};_0x43e32b(++_0xeaa0e3);}(_0x1d71,0x1af));var _0x11d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d71[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x11d7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x11d7('0x1'));var moment=require(_0x11d7('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x11d7('0x3'));var util=require(_0x11d7('0x4'));var path=require(_0x11d7('0x5'));var sox=require(_0x11d7('0x6'));var csv=require(_0x11d7('0x7'));var ejs=require(_0x11d7('0x8'));var fs=require('fs');var fs_extra=require(_0x11d7('0x9'));var _=require(_0x11d7('0xa'));var squel=require(_0x11d7('0xb'));var crypto=require(_0x11d7('0xc'));var jsforce=require(_0x11d7('0xd'));var deskjs=require(_0x11d7('0xe'));var toCsv=require(_0x11d7('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x11d7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x11d7('0x10'));var as=require(_0x11d7('0x11'));var hardwareService=require(_0x11d7('0x12'));var logger=require(_0x11d7('0x13'))(_0x11d7('0x14'));var utils=require('../../config/utils');var config=require(_0x11d7('0x15'));var licenseUtil=require(_0x11d7('0x16'));var db=require(_0x11d7('0x17'))['db'];function respondWithStatusCode(_0x3815a1,_0x31da4a){_0x31da4a=_0x31da4a||0xcc;return function(_0x350013){if(_0x350013){return _0x3815a1[_0x11d7('0x18')](_0x31da4a);}return _0x3815a1[_0x11d7('0x19')](_0x31da4a)['end']();};}function respondWithResult(_0x2c9027,_0x209553){_0x209553=_0x209553||0xc8;return function(_0x4a1cb1){if(_0x4a1cb1){return _0x2c9027[_0x11d7('0x19')](_0x209553)[_0x11d7('0x1a')](_0x4a1cb1);}};}function respondWithFilteredResult(_0x53c676,_0x23a933){return function(_0x14feb0){if(_0x14feb0){var _0x2c5c5f=typeof _0x23a933['offset']===_0x11d7('0x1b')&&typeof _0x23a933[_0x11d7('0x1c')]===_0x11d7('0x1b');var _0x1e7ad5=_0x14feb0[_0x11d7('0x1d')];var _0x354145=_0x2c5c5f?0x0:_0x23a933['offset'];var _0x3b8817=_0x2c5c5f?_0x14feb0[_0x11d7('0x1d')]:_0x23a933[_0x11d7('0x1e')]+_0x23a933[_0x11d7('0x1c')];var _0x45652e;if(_0x3b8817>=_0x1e7ad5){_0x3b8817=_0x1e7ad5;_0x45652e=0xc8;}else{_0x45652e=0xce;}_0x53c676[_0x11d7('0x19')](_0x45652e);return _0x53c676['set']('Content-Range',_0x354145+'-'+_0x3b8817+'/'+_0x1e7ad5)[_0x11d7('0x1a')](_0x14feb0);}return null;};}function patchUpdates(_0x4f5476){return function(_0x482c6d){try{jsonpatch[_0x11d7('0x1f')](_0x482c6d,_0x4f5476,!![]);}catch(_0x5ca8cf){return BPromise['reject'](_0x5ca8cf);}return _0x482c6d[_0x11d7('0x20')]();};}function saveUpdates(_0x12cc0a,_0x3c0746){return function(_0x4a1d1d){if(_0x4a1d1d){return _0x4a1d1d[_0x11d7('0x21')](_0x12cc0a)[_0x11d7('0x22')](function(_0x3572c7){return _0x3572c7;});}return null;};}function removeEntity(_0x229caf,_0x41f123){return function(_0x57a881){if(_0x57a881){return _0x57a881[_0x11d7('0x23')]()[_0x11d7('0x22')](function(){_0x229caf[_0x11d7('0x19')](0xcc)[_0x11d7('0x24')]();});}};}function handleEntityNotFound(_0x46880a,_0x1702fb){return function(_0x3b639c){if(!_0x3b639c){_0x46880a[_0x11d7('0x18')](0x194);}return _0x3b639c;};}function handleError(_0x5696ec,_0x1de10e){_0x1de10e=_0x1de10e||0x1f4;return function(_0x2e8953){logger['error'](_0x2e8953['stack']);if(_0x2e8953['name']){delete _0x2e8953[_0x11d7('0x25')];}_0x5696ec[_0x11d7('0x19')](_0x1de10e)[_0x11d7('0x26')](_0x2e8953);};}exports[_0x11d7('0x27')]=function(_0x3b4fca,_0x22f325){var _0xfbd6b1={},_0x31867f={},_0x1ea99c={'count':0x0,'rows':[]};var _0x3a0f08=_['map'](db[_0x11d7('0x28')][_0x11d7('0x29')],function(_0x3b6240){return{'name':_0x3b6240[_0x11d7('0x2a')],'type':_0x3b6240[_0x11d7('0x2b')][_0x11d7('0x2c')]};});_0x31867f[_0x11d7('0x2d')]=_[_0x11d7('0x2e')](_0x3a0f08,_0x11d7('0x25'));_0x31867f[_0x11d7('0x2f')]=_[_0x11d7('0x30')](_0x3b4fca[_0x11d7('0x2f')]);_0x31867f[_0x11d7('0x31')]=_[_0x11d7('0x32')](_0x31867f[_0x11d7('0x2d')],_0x31867f[_0x11d7('0x2f')]);_0xfbd6b1['attributes']=_[_0x11d7('0x32')](_0x31867f[_0x11d7('0x2d')],qs[_0x11d7('0x33')](_0x3b4fca[_0x11d7('0x2f')][_0x11d7('0x33')]));_0xfbd6b1['attributes']=_0xfbd6b1['attributes'][_0x11d7('0x34')]?_0xfbd6b1[_0x11d7('0x35')]:_0x31867f[_0x11d7('0x2d')];if(!_0x3b4fca[_0x11d7('0x2f')][_0x11d7('0x36')]('nolimit')){_0xfbd6b1[_0x11d7('0x1c')]=qs[_0x11d7('0x1c')](_0x3b4fca[_0x11d7('0x2f')][_0x11d7('0x1c')]);_0xfbd6b1[_0x11d7('0x1e')]=qs[_0x11d7('0x1e')](_0x3b4fca[_0x11d7('0x2f')]['offset']);}_0xfbd6b1[_0x11d7('0x37')]=qs['sort'](_0x3b4fca['query'][_0x11d7('0x38')]);_0xfbd6b1[_0x11d7('0x39')]=qs[_0x11d7('0x31')](_[_0x11d7('0x3a')](_0x3b4fca[_0x11d7('0x2f')],_0x31867f[_0x11d7('0x31')]),_0x3a0f08);if(_0x3b4fca[_0x11d7('0x2f')][_0x11d7('0x3b')]){_0xfbd6b1['where']=_['merge'](_0xfbd6b1[_0x11d7('0x39')],{'$or':_[_0x11d7('0x2e')](_0x3a0f08,function(_0x509916){if(_0x509916[_0x11d7('0x2b')]!==_0x11d7('0x3c')){var _0xba3e98={};_0xba3e98[_0x509916['name']]={'$like':'%'+_0x3b4fca[_0x11d7('0x2f')][_0x11d7('0x3b')]+'%'};return _0xba3e98;}})});}_0xfbd6b1=_['merge']({},_0xfbd6b1,_0x3b4fca[_0x11d7('0x3d')]);var _0x5c5ae1={'where':_0xfbd6b1[_0x11d7('0x39')]};return db[_0x11d7('0x28')][_0x11d7('0x1d')](_0x5c5ae1)[_0x11d7('0x22')](function(_0x4b967b){_0x1ea99c[_0x11d7('0x1d')]=_0x4b967b;if(_0x3b4fca[_0x11d7('0x2f')]['includeAll']){_0xfbd6b1[_0x11d7('0x3e')]=[{'all':!![]}];}return db['ServicenowField'][_0x11d7('0x3f')](_0xfbd6b1);})[_0x11d7('0x22')](function(_0x3e0da5){_0x1ea99c[_0x11d7('0x40')]=_0x3e0da5;return _0x1ea99c;})[_0x11d7('0x22')](respondWithFilteredResult(_0x22f325,_0xfbd6b1))[_0x11d7('0x41')](handleError(_0x22f325,null));};exports[_0x11d7('0x42')]=function(_0x5134e0,_0x4d64f8){var _0x29ee88={'raw':!![],'where':{'id':_0x5134e0['params']['id']}},_0x5c5cad={};_0x5c5cad[_0x11d7('0x2d')]=_['keys'](db[_0x11d7('0x28')][_0x11d7('0x29')]);_0x5c5cad[_0x11d7('0x2f')]=_[_0x11d7('0x30')](_0x5134e0[_0x11d7('0x2f')]);_0x5c5cad[_0x11d7('0x31')]=_[_0x11d7('0x32')](_0x5c5cad[_0x11d7('0x2d')],_0x5c5cad[_0x11d7('0x2f')]);_0x29ee88[_0x11d7('0x35')]=_[_0x11d7('0x32')](_0x5c5cad[_0x11d7('0x2d')],qs[_0x11d7('0x33')](_0x5134e0[_0x11d7('0x2f')][_0x11d7('0x33')]));_0x29ee88[_0x11d7('0x35')]=_0x29ee88['attributes'][_0x11d7('0x34')]?_0x29ee88['attributes']:_0x5c5cad[_0x11d7('0x2d')];if(_0x5134e0[_0x11d7('0x2f')][_0x11d7('0x43')]){_0x29ee88['include']=[{'all':!![]}];}_0x29ee88=_[_0x11d7('0x44')]({},_0x29ee88,_0x5134e0[_0x11d7('0x3d')]);return db[_0x11d7('0x28')]['find'](_0x29ee88)[_0x11d7('0x22')](handleEntityNotFound(_0x4d64f8,null))[_0x11d7('0x22')](respondWithResult(_0x4d64f8,null))[_0x11d7('0x41')](handleError(_0x4d64f8,null));};exports['create']=function(_0x1c811f,_0x180312){return db[_0x11d7('0x28')][_0x11d7('0x45')](_0x1c811f[_0x11d7('0x46')],{})[_0x11d7('0x22')](respondWithResult(_0x180312,0xc9))[_0x11d7('0x41')](handleError(_0x180312,null));};exports[_0x11d7('0x21')]=function(_0x5b185e,_0x592f23){if(_0x5b185e[_0x11d7('0x46')]['id']){delete _0x5b185e[_0x11d7('0x46')]['id'];}return db[_0x11d7('0x28')][_0x11d7('0x47')]({'where':{'id':_0x5b185e[_0x11d7('0x48')]['id']}})[_0x11d7('0x22')](handleEntityNotFound(_0x592f23,null))[_0x11d7('0x22')](saveUpdates(_0x5b185e[_0x11d7('0x46')],null))[_0x11d7('0x22')](respondWithResult(_0x592f23,null))[_0x11d7('0x41')](handleError(_0x592f23,null));};exports[_0x11d7('0x23')]=function(_0x389ba4,_0x22d4d9){return db['ServicenowField'][_0x11d7('0x47')]({'where':{'id':_0x389ba4[_0x11d7('0x48')]['id']}})[_0x11d7('0x22')](handleEntityNotFound(_0x22d4d9,null))[_0x11d7('0x22')](removeEntity(_0x22d4d9,null))['catch'](handleError(_0x22d4d9,null));}; \ No newline at end of file +var _0x3ce5=['params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','count','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','nolimit','order','sort','filter','merge','where','options','ServicenowField','include','rows','catch','show','keys','fields','includeAll','create','body'];(function(_0x3a7e09,_0x27e35d){var _0x3f00b4=function(_0x25102f){while(--_0x25102f){_0x3a7e09['push'](_0x3a7e09['shift']());}};_0x3f00b4(++_0x27e35d);}(_0x3ce5,0xdc));var _0x53ce=function(_0x3a57e9,_0x2e2982){_0x3a57e9=_0x3a57e9-0x0;var _0x449bdb=_0x3ce5[_0x3a57e9];return _0x449bdb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x53ce('0x0'));var zipdir=require(_0x53ce('0x1'));var jsonpatch=require(_0x53ce('0x2'));var rp=require('request-promise');var moment=require(_0x53ce('0x3'));var BPromise=require(_0x53ce('0x4'));var Mustache=require(_0x53ce('0x5'));var util=require(_0x53ce('0x6'));var path=require(_0x53ce('0x7'));var sox=require(_0x53ce('0x8'));var csv=require(_0x53ce('0x9'));var ejs=require(_0x53ce('0xa'));var fs=require('fs');var fs_extra=require(_0x53ce('0xb'));var _=require(_0x53ce('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x53ce('0xd'));var deskjs=require(_0x53ce('0xe'));var toCsv=require(_0x53ce('0x9'));var querystring=require(_0x53ce('0xf'));var Papa=require(_0x53ce('0x10'));var Redis=require('ioredis');var authService=require(_0x53ce('0x11'));var qs=require(_0x53ce('0x12'));var as=require(_0x53ce('0x13'));var hardwareService=require(_0x53ce('0x14'));var logger=require(_0x53ce('0x15'))(_0x53ce('0x16'));var utils=require(_0x53ce('0x17'));var config=require(_0x53ce('0x18'));var licenseUtil=require(_0x53ce('0x19'));var db=require(_0x53ce('0x1a'))['db'];function respondWithStatusCode(_0x2daad1,_0x18b0a2){_0x18b0a2=_0x18b0a2||0xcc;return function(_0xe697e){if(_0xe697e){return _0x2daad1[_0x53ce('0x1b')](_0x18b0a2);}return _0x2daad1['status'](_0x18b0a2)[_0x53ce('0x1c')]();};}function respondWithResult(_0x5cc284,_0x1c364d){_0x1c364d=_0x1c364d||0xc8;return function(_0x1b4c6d){if(_0x1b4c6d){return _0x5cc284[_0x53ce('0x1d')](_0x1c364d)['json'](_0x1b4c6d);}};}function respondWithFilteredResult(_0x415bce,_0x174411){return function(_0x44ce0a){if(_0x44ce0a){var _0x5f27c4=typeof _0x174411[_0x53ce('0x1e')]==='undefined'&&typeof _0x174411['limit']==='undefined';var _0x3c6fff=_0x44ce0a[_0x53ce('0x1f')];var _0x295788=_0x5f27c4?0x0:_0x174411['offset'];var _0x26f4b9=_0x5f27c4?_0x44ce0a['count']:_0x174411[_0x53ce('0x1e')]+_0x174411[_0x53ce('0x20')];var _0x539e12;if(_0x26f4b9>=_0x3c6fff){_0x26f4b9=_0x3c6fff;_0x539e12=0xc8;}else{_0x539e12=0xce;}_0x415bce[_0x53ce('0x1d')](_0x539e12);return _0x415bce[_0x53ce('0x21')]('Content-Range',_0x295788+'-'+_0x26f4b9+'/'+_0x3c6fff)[_0x53ce('0x22')](_0x44ce0a);}return null;};}function patchUpdates(_0x270735){return function(_0x4d031e){try{jsonpatch[_0x53ce('0x23')](_0x4d031e,_0x270735,!![]);}catch(_0x397839){return BPromise[_0x53ce('0x24')](_0x397839);}return _0x4d031e['save']();};}function saveUpdates(_0x610648,_0xaf9804){return function(_0x1179b1){if(_0x1179b1){return _0x1179b1[_0x53ce('0x25')](_0x610648)['then'](function(_0x127de3){return _0x127de3;});}return null;};}function removeEntity(_0x88831e,_0xe9b9fe){return function(_0x320e6){if(_0x320e6){return _0x320e6[_0x53ce('0x26')]()[_0x53ce('0x27')](function(){_0x88831e[_0x53ce('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f8525,_0x409507){return function(_0x2286b8){if(!_0x2286b8){_0x3f8525[_0x53ce('0x1b')](0x194);}return _0x2286b8;};}function handleError(_0x140ea4,_0x2b82be){_0x2b82be=_0x2b82be||0x1f4;return function(_0x528be1){logger[_0x53ce('0x28')](_0x528be1[_0x53ce('0x29')]);if(_0x528be1[_0x53ce('0x2a')]){delete _0x528be1[_0x53ce('0x2a')];}_0x140ea4['status'](_0x2b82be)[_0x53ce('0x2b')](_0x528be1);};}exports[_0x53ce('0x2c')]=function(_0x3215d6,_0x22d0ea){var _0x20a3d2={},_0xe773f7={},_0x207874={'count':0x0,'rows':[]};var _0x185f75=_['map'](db['ServicenowField'][_0x53ce('0x2d')],function(_0x4160a){return{'name':_0x4160a[_0x53ce('0x2e')],'type':_0x4160a[_0x53ce('0x2f')][_0x53ce('0x30')]};});_0xe773f7[_0x53ce('0x31')]=_[_0x53ce('0x32')](_0x185f75,'name');_0xe773f7[_0x53ce('0x33')]=_['keys'](_0x3215d6[_0x53ce('0x33')]);_0xe773f7[_0x53ce('0x34')]=_[_0x53ce('0x35')](_0xe773f7[_0x53ce('0x31')],_0xe773f7['query']);_0x20a3d2[_0x53ce('0x36')]=_[_0x53ce('0x35')](_0xe773f7[_0x53ce('0x31')],qs['fields'](_0x3215d6[_0x53ce('0x33')]['fields']));_0x20a3d2[_0x53ce('0x36')]=_0x20a3d2[_0x53ce('0x36')]['length']?_0x20a3d2[_0x53ce('0x36')]:_0xe773f7[_0x53ce('0x31')];if(!_0x3215d6[_0x53ce('0x33')]['hasOwnProperty'](_0x53ce('0x37'))){_0x20a3d2['limit']=qs[_0x53ce('0x20')](_0x3215d6[_0x53ce('0x33')][_0x53ce('0x20')]);_0x20a3d2[_0x53ce('0x1e')]=qs[_0x53ce('0x1e')](_0x3215d6[_0x53ce('0x33')][_0x53ce('0x1e')]);}_0x20a3d2[_0x53ce('0x38')]=qs[_0x53ce('0x39')](_0x3215d6[_0x53ce('0x33')][_0x53ce('0x39')]);_0x20a3d2['where']=qs[_0x53ce('0x34')](_['pick'](_0x3215d6[_0x53ce('0x33')],_0xe773f7[_0x53ce('0x34')]),_0x185f75);if(_0x3215d6['query'][_0x53ce('0x3a')]){_0x20a3d2['where']=_[_0x53ce('0x3b')](_0x20a3d2[_0x53ce('0x3c')],{'$or':_[_0x53ce('0x32')](_0x185f75,function(_0x30b5c9){if(_0x30b5c9[_0x53ce('0x2f')]!=='VIRTUAL'){var _0x16b19e={};_0x16b19e[_0x30b5c9[_0x53ce('0x2a')]]={'$like':'%'+_0x3215d6[_0x53ce('0x33')]['filter']+'%'};return _0x16b19e;}})});}_0x20a3d2=_[_0x53ce('0x3b')]({},_0x20a3d2,_0x3215d6[_0x53ce('0x3d')]);var _0xce75aa={'where':_0x20a3d2[_0x53ce('0x3c')]};return db[_0x53ce('0x3e')][_0x53ce('0x1f')](_0xce75aa)[_0x53ce('0x27')](function(_0x1b4211){_0x207874[_0x53ce('0x1f')]=_0x1b4211;if(_0x3215d6['query']['includeAll']){_0x20a3d2[_0x53ce('0x3f')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x20a3d2);})[_0x53ce('0x27')](function(_0xeba4e1){_0x207874[_0x53ce('0x40')]=_0xeba4e1;return _0x207874;})[_0x53ce('0x27')](respondWithFilteredResult(_0x22d0ea,_0x20a3d2))[_0x53ce('0x41')](handleError(_0x22d0ea,null));};exports[_0x53ce('0x42')]=function(_0x3f730d,_0x4b9c84){var _0x429457={'raw':!![],'where':{'id':_0x3f730d['params']['id']}},_0x20e298={};_0x20e298[_0x53ce('0x31')]=_[_0x53ce('0x43')](db[_0x53ce('0x3e')][_0x53ce('0x2d')]);_0x20e298[_0x53ce('0x33')]=_[_0x53ce('0x43')](_0x3f730d[_0x53ce('0x33')]);_0x20e298['filters']=_[_0x53ce('0x35')](_0x20e298[_0x53ce('0x31')],_0x20e298[_0x53ce('0x33')]);_0x429457[_0x53ce('0x36')]=_[_0x53ce('0x35')](_0x20e298[_0x53ce('0x31')],qs[_0x53ce('0x44')](_0x3f730d[_0x53ce('0x33')][_0x53ce('0x44')]));_0x429457['attributes']=_0x429457[_0x53ce('0x36')]['length']?_0x429457['attributes']:_0x20e298[_0x53ce('0x31')];if(_0x3f730d[_0x53ce('0x33')][_0x53ce('0x45')]){_0x429457['include']=[{'all':!![]}];}_0x429457=_[_0x53ce('0x3b')]({},_0x429457,_0x3f730d[_0x53ce('0x3d')]);return db[_0x53ce('0x3e')]['find'](_0x429457)[_0x53ce('0x27')](handleEntityNotFound(_0x4b9c84,null))['then'](respondWithResult(_0x4b9c84,null))[_0x53ce('0x41')](handleError(_0x4b9c84,null));};exports[_0x53ce('0x46')]=function(_0x589e30,_0x32a96c){return db[_0x53ce('0x3e')][_0x53ce('0x46')](_0x589e30['body'],{})['then'](respondWithResult(_0x32a96c,0xc9))[_0x53ce('0x41')](handleError(_0x32a96c,null));};exports[_0x53ce('0x25')]=function(_0x20e051,_0x4ff378){if(_0x20e051[_0x53ce('0x47')]['id']){delete _0x20e051[_0x53ce('0x47')]['id'];}return db[_0x53ce('0x3e')]['find']({'where':{'id':_0x20e051[_0x53ce('0x48')]['id']}})[_0x53ce('0x27')](handleEntityNotFound(_0x4ff378,null))[_0x53ce('0x27')](saveUpdates(_0x20e051['body'],null))[_0x53ce('0x27')](respondWithResult(_0x4ff378,null))[_0x53ce('0x41')](handleError(_0x4ff378,null));};exports[_0x53ce('0x26')]=function(_0x2951ca,_0x24023c){return db[_0x53ce('0x3e')]['find']({'where':{'id':_0x2951ca['params']['id']}})[_0x53ce('0x27')](handleEntityNotFound(_0x24023c,null))[_0x53ce('0x27')](removeEntity(_0x24023c,null))['catch'](handleError(_0x24023c,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 491cff7..87634d0 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 _0xa488=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x464fb0,_0x38d987){var _0x4f94ad=function(_0x22d1f1){while(--_0x22d1f1){_0x464fb0['push'](_0x464fb0['shift']());}};_0x4f94ad(++_0x38d987);}(_0xa488,0x6a));var _0x8a48=function(_0x65eae,_0x32dc5f){_0x65eae=_0x65eae-0x0;var _0x18e82b=_0xa488[_0x65eae];return _0x18e82b;};'use strict';var _=require(_0x8a48('0x0'));var util=require(_0x8a48('0x1'));var logger=require(_0x8a48('0x2'))(_0x8a48('0x3'));var moment=require(_0x8a48('0x4'));var BPromise=require(_0x8a48('0x5'));var rp=require(_0x8a48('0x6'));var fs=require('fs');var path=require(_0x8a48('0x7'));var rimraf=require(_0x8a48('0x8'));var config=require(_0x8a48('0x9'));var attributes=require(_0x8a48('0xa'));module['exports']=function(_0x4af466,_0x59a9e3){return _0x4af466['define'](_0x8a48('0xb'),attributes,{'tableName':_0x8a48('0xc'),'paranoid':![],'indexes':[{'name':_0x8a48('0xd'),'fields':['idField',_0x8a48('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d15=['FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','idField'];(function(_0x27a948,_0x4e5fa0){var _0x593311=function(_0x5b344f){while(--_0x5b344f){_0x27a948['push'](_0x27a948['shift']());}};_0x593311(++_0x4e5fa0);}(_0x7d15,0xa6));var _0x57d1=function(_0x7441e7,_0x22245b){_0x7441e7=_0x7441e7-0x0;var _0x5d13ad=_0x7d15[_0x7441e7];return _0x5d13ad;};'use strict';var _=require(_0x57d1('0x0'));var util=require(_0x57d1('0x1'));var logger=require('../../config/logger')(_0x57d1('0x2'));var moment=require(_0x57d1('0x3'));var BPromise=require(_0x57d1('0x4'));var rp=require(_0x57d1('0x5'));var fs=require('fs');var path=require(_0x57d1('0x6'));var rimraf=require(_0x57d1('0x7'));var config=require(_0x57d1('0x8'));var attributes=require(_0x57d1('0x9'));module[_0x57d1('0xa')]=function(_0x5a8a36,_0x4ce748){return _0x5a8a36[_0x57d1('0xb')](_0x57d1('0xc'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x57d1('0xd'),_0x57d1('0xe')],'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 ded122a..32cd6cf 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 _0x6316=['ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent'];(function(_0x209ad7,_0x4ca1d7){var _0x4e9cbb=function(_0x262934){while(--_0x262934){_0x209ad7['push'](_0x209ad7['shift']());}};_0x4e9cbb(++_0x4ca1d7);}(_0x6316,0x1e7));var _0x6631=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6316[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x6631('0x0'));var moment=require('moment');var BPromise=require(_0x6631('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6631('0x2'));var db=require(_0x6631('0x3'))['db'];var utils=require(_0x6631('0x4'));var logger=require('../../config/logger')(_0x6631('0x5'));var config=require('../../config/environment');var jayson=require(_0x6631('0x6'));var client=jayson['client'][_0x6631('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x424f87,_0x1b7f43,_0x23532b){return new BPromise(function(_0x26f14c,_0x1a4fb4){return client[_0x6631('0x8')](_0x424f87,_0x23532b)[_0x6631('0x9')](function(_0x563afd){logger[_0x6631('0xa')](_0x6631('0xb'),_0x1b7f43,_0x6631('0xc'));logger['debug'](_0x6631('0xd'),_0x1b7f43,_0x6631('0xc'),JSON[_0x6631('0xe')](_0x563afd));if(_0x563afd['error']){if(_0x563afd[_0x6631('0xf')][_0x6631('0x10')]===0x1f4){logger[_0x6631('0xf')](_0x6631('0xb'),_0x1b7f43,_0x563afd[_0x6631('0xf')][_0x6631('0x11')]);return _0x1a4fb4(_0x563afd[_0x6631('0xf')][_0x6631('0x11')]);}logger[_0x6631('0xf')](_0x6631('0xb'),_0x1b7f43,_0x563afd[_0x6631('0xf')][_0x6631('0x11')]);return _0x26f14c(_0x563afd[_0x6631('0xf')][_0x6631('0x11')]);}else{logger[_0x6631('0xa')](_0x6631('0xb'),_0x1b7f43,_0x6631('0xc'));_0x26f14c(_0x563afd[_0x6631('0x12')][_0x6631('0x11')]);}})[_0x6631('0x13')](function(_0x543b28){logger[_0x6631('0xf')]('ServicenowField,\x20%s,\x20%s',_0x1b7f43,_0x543b28);_0x1a4fb4(_0x543b28);});});} \ No newline at end of file +var _0xd0cc=['info','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then'];(function(_0x5b4998,_0x5dd132){var _0x25e0c0=function(_0x42ec5e){while(--_0x42ec5e){_0x5b4998['push'](_0x5b4998['shift']());}};_0x25e0c0(++_0x5dd132);}(_0xd0cc,0xa1));var _0xcd0c=function(_0x591578,_0x589ca5){_0x591578=_0x591578-0x0;var _0x343807=_0xd0cc[_0x591578];return _0x343807;};'use strict';var _=require(_0xcd0c('0x0'));var util=require(_0xcd0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd0c('0x2'));var fs=require('fs');var Redis=require(_0xcd0c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd0c('0x4'));var logger=require(_0xcd0c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcd0c('0x6'));var client=jayson[_0xcd0c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9d078b,_0x35fced,_0x2c4095){return new BPromise(function(_0x2ff959,_0x4c26be){return client[_0xcd0c('0x8')](_0x9d078b,_0x2c4095)[_0xcd0c('0x9')](function(_0x47408a){logger[_0xcd0c('0xa')](_0xcd0c('0xb'),_0x35fced,_0xcd0c('0xc'));logger['debug'](_0xcd0c('0xd'),_0x35fced,_0xcd0c('0xc'),JSON[_0xcd0c('0xe')](_0x47408a));if(_0x47408a[_0xcd0c('0xf')]){if(_0x47408a[_0xcd0c('0xf')]['code']===0x1f4){logger[_0xcd0c('0xf')](_0xcd0c('0xb'),_0x35fced,_0x47408a[_0xcd0c('0xf')][_0xcd0c('0x10')]);return _0x4c26be(_0x47408a[_0xcd0c('0xf')][_0xcd0c('0x10')]);}logger[_0xcd0c('0xf')]('ServicenowField,\x20%s,\x20%s',_0x35fced,_0x47408a[_0xcd0c('0xf')][_0xcd0c('0x10')]);return _0x2ff959(_0x47408a[_0xcd0c('0xf')][_0xcd0c('0x10')]);}else{logger['info'](_0xcd0c('0xb'),_0x35fced,_0xcd0c('0xc'));_0x2ff959(_0x47408a[_0xcd0c('0x11')][_0xcd0c('0x10')]);}})[_0xcd0c('0x12')](function(_0x240ff2){logger[_0xcd0c('0xf')]('ServicenowField,\x20%s,\x20%s',_0x35fced,_0x240ff2);_0x4c26be(_0x240ff2);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 04b3356..73262f9 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 _0x09ae=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index'];(function(_0x34cd54,_0x428351){var _0x1bb079=function(_0x333851){while(--_0x333851){_0x34cd54['push'](_0x34cd54['shift']());}};_0x1bb079(++_0x428351);}(_0x09ae,0x89));var _0xe09a=function(_0x42b848,_0x105663){_0x42b848=_0x42b848-0x0;var _0x39bb89=_0x09ae[_0x42b848];return _0x39bb89;};'use strict';var multer=require(_0xe09a('0x0'));var util=require(_0xe09a('0x1'));var path=require(_0xe09a('0x2'));var timeout=require(_0xe09a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe09a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe09a('0x5'));var controller=require(_0xe09a('0x6'));router[_0xe09a('0x7')]('/',auth[_0xe09a('0x8')](),controller[_0xe09a('0x9')]);router[_0xe09a('0x7')](_0xe09a('0xa'),auth[_0xe09a('0x8')](),controller[_0xe09a('0xb')]);router['get'](_0xe09a('0xc'),auth[_0xe09a('0x8')](),controller[_0xe09a('0xd')]);router[_0xe09a('0x7')](_0xe09a('0xe'),auth[_0xe09a('0x8')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0xe09a('0xf')]);router[_0xe09a('0x10')](_0xe09a('0xc'),auth[_0xe09a('0x8')](),controller[_0xe09a('0x11')]);router['put'](_0xe09a('0xa'),auth[_0xe09a('0x8')](),controller['update']);router[_0xe09a('0x12')](_0xe09a('0xa'),auth[_0xe09a('0x8')](),controller[_0xe09a('0x13')]);module[_0xe09a('0x14')]=router; \ No newline at end of file +var _0x1b37=['/:id','destroy','exports','multer','util','fs-extra','../../components/auth/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete'];(function(_0x54bef0,_0x21348d){var _0x243932=function(_0x3281ad){while(--_0x3281ad){_0x54bef0['push'](_0x54bef0['shift']());}};_0x243932(++_0x21348d);}(_0x1b37,0x1cf));var _0x71b3=function(_0x12003a,_0x563c09){_0x12003a=_0x12003a-0x0;var _0x3400c4=_0x1b37[_0x12003a];return _0x3400c4;};'use strict';var multer=require(_0x71b3('0x0'));var util=require(_0x71b3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x71b3('0x2'));var auth=require(_0x71b3('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x71b3('0x4'));router[_0x71b3('0x5')]('/',auth[_0x71b3('0x6')](),controller[_0x71b3('0x7')]);router['get']('/:id',auth[_0x71b3('0x6')](),controller[_0x71b3('0x8')]);router['get'](_0x71b3('0x9'),auth[_0x71b3('0x6')](),controller[_0x71b3('0xa')]);router['get'](_0x71b3('0xb'),auth['isAuthenticated'](),controller[_0x71b3('0xc')]);router[_0x71b3('0xd')]('/',auth[_0x71b3('0x6')](),controller['create']);router[_0x71b3('0xd')](_0x71b3('0x9'),auth[_0x71b3('0x6')](),controller[_0x71b3('0xe')]);router[_0x71b3('0xf')]('/:id',auth[_0x71b3('0x6')](),controller['update']);router[_0x71b3('0x10')](_0x71b3('0x11'),auth[_0x71b3('0x6')](),controller[_0x71b3('0x12')]);module[_0x71b3('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 96ae765..338acb0 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 _0x889c=['sequelize','exports','STRING'];(function(_0x5050fc,_0x166a92){var _0x57fc2b=function(_0x4b617b){while(--_0x4b617b){_0x5050fc['push'](_0x5050fc['shift']());}};_0x57fc2b(++_0x166a92);}(_0x889c,0x150));var _0xc889=function(_0x4c666f,_0x39fbdb){_0x4c666f=_0x4c666f-0x0;var _0x565d46=_0x889c[_0x4c666f];return _0x565d46;};'use strict';var Sequelize=require(_0xc889('0x0'));module[_0xc889('0x1')]={'name':{'type':Sequelize[_0xc889('0x2')]},'description':{'type':Sequelize[_0xc889('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xc889('0x2')]},'remoteUri':{'type':Sequelize[_0xc889('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xc889('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0e63=['STRING','username','sequelize'];(function(_0x370fb3,_0xe54247){var _0x17bec3=function(_0x8befcd){while(--_0x8befcd){_0x370fb3['push'](_0x370fb3['shift']());}};_0x17bec3(++_0xe54247);}(_0x0e63,0xb6));var _0x30e6=function(_0x46a82b,_0x372b54){_0x46a82b=_0x46a82b-0x0;var _0x68abdb=_0x0e63[_0x46a82b];return _0x68abdb;};'use strict';var Sequelize=require(_0x30e6('0x0'));module['exports']={'name':{'type':Sequelize[_0x30e6('0x1')]},'description':{'type':Sequelize[_0x30e6('0x1')]},'username':{'type':Sequelize[_0x30e6('0x1')],'unique':_0x30e6('0x2')},'password':{'type':Sequelize[_0x30e6('0x1')]},'remoteUri':{'type':Sequelize[_0x30e6('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x30e6('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 33eeaa5..395c350 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 _0xff96=['create','body','destroy','options','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','POST','format','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','%s%s','/service/v4_1/rest.php','Calls','values','remove','includes','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','send','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','SugarcrmAccount','includeAll','findAll','rows','show','params','include','find'];(function(_0x3b447c,_0x2d3820){var _0x4caf28=function(_0x3f49ee){while(--_0x3f49ee){_0x3b447c['push'](_0x3b447c['shift']());}};_0x4caf28(++_0x2d3820);}(_0xff96,0x1bc));var _0x6ff9=function(_0x19c64a,_0x5de14e){_0x19c64a=_0x19c64a-0x0;var _0x1b1a06=_0xff96[_0x19c64a];return _0x1b1a06;};'use strict';var emlformat=require(_0x6ff9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6ff9('0x1'));var jsonpatch=require(_0x6ff9('0x2'));var rp=require('request-promise');var moment=require(_0x6ff9('0x3'));var BPromise=require(_0x6ff9('0x4'));var Mustache=require(_0x6ff9('0x5'));var util=require(_0x6ff9('0x6'));var path=require(_0x6ff9('0x7'));var sox=require('sox');var csv=require(_0x6ff9('0x8'));var ejs=require(_0x6ff9('0x9'));var fs=require('fs');var fs_extra=require(_0x6ff9('0xa'));var _=require(_0x6ff9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6ff9('0xc'));var deskjs=require(_0x6ff9('0xd'));var toCsv=require(_0x6ff9('0x8'));var querystring=require(_0x6ff9('0xe'));var Papa=require(_0x6ff9('0xf'));var Redis=require(_0x6ff9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6ff9('0x11'));var as=require(_0x6ff9('0x12'));var hardwareService=require(_0x6ff9('0x13'));var logger=require(_0x6ff9('0x14'))(_0x6ff9('0x15'));var utils=require('../../config/utils');var config=require(_0x6ff9('0x16'));var licenseUtil=require(_0x6ff9('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6ff9('0x18'));var jayson=require(_0x6ff9('0x19'));var client=jayson[_0x6ff9('0x1a')][_0x6ff9('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2dfc2a,_0x451cf4,_0x19ae5e,_0x3c8f4b){return new BPromise(function(_0x1eb440,_0x5ed082){var _0x2fb7b0=_0x3c8f4b||client;return _0x2fb7b0['request'](_0x2dfc2a,_0x19ae5e)[_0x6ff9('0x1c')](function(_0xea79dd){logger[_0x6ff9('0x1d')](_0x6ff9('0x1e'),_0x451cf4,'request\x20sent');logger[_0x6ff9('0x1f')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x451cf4,_0x6ff9('0x20'),JSON[_0x6ff9('0x21')](_0xea79dd));if(_0xea79dd[_0x6ff9('0x22')]){if(_0xea79dd['error'][_0x6ff9('0x23')]===0x1f4){logger['error'](_0x6ff9('0x1e'),_0x451cf4,_0xea79dd[_0x6ff9('0x22')][_0x6ff9('0x24')]);return _0x5ed082(_0xea79dd[_0x6ff9('0x22')]['message']);}logger['error'](_0x6ff9('0x1e'),_0x451cf4,_0xea79dd[_0x6ff9('0x22')][_0x6ff9('0x24')]);return _0x1eb440(_0xea79dd[_0x6ff9('0x22')][_0x6ff9('0x24')]);}else{logger['info'](_0x6ff9('0x1e'),_0x451cf4,_0x6ff9('0x20'));_0x1eb440(_0xea79dd[_0x6ff9('0x25')][_0x6ff9('0x24')]);}})[_0x6ff9('0x26')](function(_0x3f038a){logger[_0x6ff9('0x22')](_0x6ff9('0x1e'),_0x451cf4,_0x3f038a);_0x5ed082(_0x3f038a);});});}function respondWithStatusCode(_0x1ed5cf,_0xbc3480){_0xbc3480=_0xbc3480||0xcc;return function(_0x507e9b){if(_0x507e9b){return _0x1ed5cf['sendStatus'](_0xbc3480);}return _0x1ed5cf['status'](_0xbc3480)[_0x6ff9('0x27')]();};}function respondWithResult(_0x1fa3c7,_0x358e7e){_0x358e7e=_0x358e7e||0xc8;return function(_0x1dc95c){if(_0x1dc95c){return _0x1fa3c7[_0x6ff9('0x28')](_0x358e7e)[_0x6ff9('0x29')](_0x1dc95c);}};}function respondWithFilteredResult(_0x5c269c,_0x2a3b04){return function(_0x20802b){if(_0x20802b){var _0x4fe9d6=typeof _0x2a3b04[_0x6ff9('0x2a')]==='undefined'&&typeof _0x2a3b04['limit']===_0x6ff9('0x2b');var _0x16d93a=_0x20802b['count'];var _0x42e2d4=_0x4fe9d6?0x0:_0x2a3b04[_0x6ff9('0x2a')];var _0x30da46=_0x4fe9d6?_0x20802b[_0x6ff9('0x2c')]:_0x2a3b04[_0x6ff9('0x2a')]+_0x2a3b04['limit'];var _0x698714;if(_0x30da46>=_0x16d93a){_0x30da46=_0x16d93a;_0x698714=0xc8;}else{_0x698714=0xce;}_0x5c269c[_0x6ff9('0x28')](_0x698714);return _0x5c269c[_0x6ff9('0x2d')](_0x6ff9('0x2e'),_0x42e2d4+'-'+_0x30da46+'/'+_0x16d93a)[_0x6ff9('0x29')](_0x20802b);}return null;};}function patchUpdates(_0x97ffe4){return function(_0xff9b3b){try{jsonpatch['apply'](_0xff9b3b,_0x97ffe4,!![]);}catch(_0x5bc447){return BPromise[_0x6ff9('0x2f')](_0x5bc447);}return _0xff9b3b[_0x6ff9('0x30')]();};}function saveUpdates(_0x3984bb,_0x1ccebe){return function(_0x41581e){if(_0x41581e){return _0x41581e[_0x6ff9('0x31')](_0x3984bb)['then'](function(_0x22a65d){return _0x22a65d;});}return null;};}function removeEntity(_0x296ad1,_0x4ab4c9){return function(_0x5edffb){if(_0x5edffb){return _0x5edffb['destroy']()[_0x6ff9('0x1c')](function(){_0x296ad1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x127abb,_0x254a78){return function(_0x4410e8){if(!_0x4410e8){_0x127abb[_0x6ff9('0x32')](0x194);}return _0x4410e8;};}function handleError(_0x82f923,_0x26a9c0){_0x26a9c0=_0x26a9c0||0x1f4;return function(_0x1b7438){logger[_0x6ff9('0x22')](_0x1b7438[_0x6ff9('0x33')]);if(_0x1b7438[_0x6ff9('0x34')]){delete _0x1b7438[_0x6ff9('0x34')];}_0x82f923[_0x6ff9('0x28')](_0x26a9c0)['send'](_0x1b7438);};}exports[_0x6ff9('0x35')]=function(_0xb0bad1,_0x1b10c6){var _0x3e7f0e={},_0x51a22a={},_0x1dd68d={'count':0x0,'rows':[]};var _0xde9020=_[_0x6ff9('0x36')](db['SugarcrmAccount'][_0x6ff9('0x37')],function(_0x1d6512){return{'name':_0x1d6512[_0x6ff9('0x38')],'type':_0x1d6512[_0x6ff9('0x39')][_0x6ff9('0x3a')]};});_0x51a22a[_0x6ff9('0x3b')]=_[_0x6ff9('0x36')](_0xde9020,_0x6ff9('0x34'));_0x51a22a[_0x6ff9('0x3c')]=_[_0x6ff9('0x3d')](_0xb0bad1[_0x6ff9('0x3c')]);_0x51a22a[_0x6ff9('0x3e')]=_[_0x6ff9('0x3f')](_0x51a22a[_0x6ff9('0x3b')],_0x51a22a[_0x6ff9('0x3c')]);_0x3e7f0e[_0x6ff9('0x40')]=_['intersection'](_0x51a22a['model'],qs[_0x6ff9('0x41')](_0xb0bad1[_0x6ff9('0x3c')][_0x6ff9('0x41')]));_0x3e7f0e[_0x6ff9('0x40')]=_0x3e7f0e[_0x6ff9('0x40')][_0x6ff9('0x42')]?_0x3e7f0e[_0x6ff9('0x40')]:_0x51a22a[_0x6ff9('0x3b')];if(!_0xb0bad1[_0x6ff9('0x3c')]['hasOwnProperty'](_0x6ff9('0x43'))){_0x3e7f0e[_0x6ff9('0x44')]=qs['limit'](_0xb0bad1['query']['limit']);_0x3e7f0e[_0x6ff9('0x2a')]=qs[_0x6ff9('0x2a')](_0xb0bad1[_0x6ff9('0x3c')][_0x6ff9('0x2a')]);}_0x3e7f0e[_0x6ff9('0x45')]=qs[_0x6ff9('0x46')](_0xb0bad1[_0x6ff9('0x3c')]['sort']);_0x3e7f0e[_0x6ff9('0x47')]=qs[_0x6ff9('0x3e')](_[_0x6ff9('0x48')](_0xb0bad1[_0x6ff9('0x3c')],_0x51a22a[_0x6ff9('0x3e')]),_0xde9020);if(_0xb0bad1['query'][_0x6ff9('0x49')]){_0x3e7f0e[_0x6ff9('0x47')]=_[_0x6ff9('0x4a')](_0x3e7f0e['where'],{'$or':_[_0x6ff9('0x36')](_0xde9020,function(_0x4d37c3){if(_0x4d37c3[_0x6ff9('0x39')]!==_0x6ff9('0x4b')){var _0x42b69f={};_0x42b69f[_0x4d37c3['name']]={'$like':'%'+_0xb0bad1['query'][_0x6ff9('0x49')]+'%'};return _0x42b69f;}})});}_0x3e7f0e=_['merge']({},_0x3e7f0e,_0xb0bad1['options']);var _0x4e09b3={'where':_0x3e7f0e[_0x6ff9('0x47')]};return db[_0x6ff9('0x4c')][_0x6ff9('0x2c')](_0x4e09b3)[_0x6ff9('0x1c')](function(_0x3fad37){_0x1dd68d[_0x6ff9('0x2c')]=_0x3fad37;if(_0xb0bad1[_0x6ff9('0x3c')][_0x6ff9('0x4d')]){_0x3e7f0e['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x6ff9('0x4e')](_0x3e7f0e);})[_0x6ff9('0x1c')](function(_0x425a0f){_0x1dd68d[_0x6ff9('0x4f')]=_0x425a0f;return _0x1dd68d;})[_0x6ff9('0x1c')](respondWithFilteredResult(_0x1b10c6,_0x3e7f0e))['catch'](handleError(_0x1b10c6,null));};exports[_0x6ff9('0x50')]=function(_0x355a1a,_0x3a136d){var _0x4e6371={'raw':![],'where':{'id':_0x355a1a[_0x6ff9('0x51')]['id']}},_0x162631={};_0x162631[_0x6ff9('0x3b')]=_['keys'](db[_0x6ff9('0x4c')][_0x6ff9('0x37')]);_0x162631[_0x6ff9('0x3c')]=_['keys'](_0x355a1a[_0x6ff9('0x3c')]);_0x162631[_0x6ff9('0x3e')]=_[_0x6ff9('0x3f')](_0x162631[_0x6ff9('0x3b')],_0x162631[_0x6ff9('0x3c')]);_0x4e6371[_0x6ff9('0x40')]=_[_0x6ff9('0x3f')](_0x162631[_0x6ff9('0x3b')],qs[_0x6ff9('0x41')](_0x355a1a[_0x6ff9('0x3c')][_0x6ff9('0x41')]));_0x4e6371[_0x6ff9('0x40')]=_0x4e6371[_0x6ff9('0x40')][_0x6ff9('0x42')]?_0x4e6371['attributes']:_0x162631[_0x6ff9('0x3b')];if(_0x355a1a[_0x6ff9('0x3c')][_0x6ff9('0x4d')]){_0x4e6371[_0x6ff9('0x52')]=[{'all':!![]}];}_0x4e6371=_['merge']({},_0x4e6371,_0x355a1a['options']);return db[_0x6ff9('0x4c')][_0x6ff9('0x53')](_0x4e6371)['then'](handleEntityNotFound(_0x3a136d,null))[_0x6ff9('0x1c')](respondWithResult(_0x3a136d,null))[_0x6ff9('0x26')](handleError(_0x3a136d,null));};exports[_0x6ff9('0x54')]=function(_0x34bab1,_0x4adb1f){return db[_0x6ff9('0x4c')][_0x6ff9('0x54')](_0x34bab1[_0x6ff9('0x55')],{})['then'](respondWithResult(_0x4adb1f,0xc9))[_0x6ff9('0x26')](handleError(_0x4adb1f,null));};exports[_0x6ff9('0x31')]=function(_0x45f965,_0x3e1942){if(_0x45f965[_0x6ff9('0x55')]['id']){delete _0x45f965['body']['id'];}return db['SugarcrmAccount'][_0x6ff9('0x53')]({'where':{'id':_0x45f965[_0x6ff9('0x51')]['id']}})['then'](handleEntityNotFound(_0x3e1942,null))[_0x6ff9('0x1c')](saveUpdates(_0x45f965[_0x6ff9('0x55')],null))[_0x6ff9('0x1c')](respondWithResult(_0x3e1942,null))[_0x6ff9('0x26')](handleError(_0x3e1942,null));};exports[_0x6ff9('0x56')]=function(_0x1d9e85,_0x2c31e0){return db[_0x6ff9('0x4c')][_0x6ff9('0x53')]({'where':{'id':_0x1d9e85[_0x6ff9('0x51')]['id']}})['then'](handleEntityNotFound(_0x2c31e0,null))[_0x6ff9('0x1c')](removeEntity(_0x2c31e0,null))[_0x6ff9('0x26')](handleError(_0x2c31e0,null));};exports['getConfigurations']=function(_0x2a7449,_0x54a1b8,_0x51efdb){var _0x466517={};var _0x42b82f={};var _0x2b0fee;var _0x14bb4e;return db[_0x6ff9('0x4c')]['findOne']({'where':{'id':_0x2a7449['params']['id']}})[_0x6ff9('0x1c')](handleEntityNotFound(_0x54a1b8,null))[_0x6ff9('0x1c')](function(_0x2ff821){if(_0x2ff821){_0x2b0fee=_0x2ff821;_0x42b82f[_0x6ff9('0x3b')]=_['keys'](db['SugarcrmConfiguration'][_0x6ff9('0x37')]);_0x42b82f[_0x6ff9('0x3c')]=_[_0x6ff9('0x3d')](_0x2a7449[_0x6ff9('0x3c')]);_0x42b82f[_0x6ff9('0x3e')]=_[_0x6ff9('0x3f')](_0x42b82f[_0x6ff9('0x3b')],_0x42b82f['query']);_0x466517[_0x6ff9('0x40')]=_['intersection'](_0x42b82f[_0x6ff9('0x3b')],qs['fields'](_0x2a7449['query'][_0x6ff9('0x41')]));_0x466517[_0x6ff9('0x40')]=_0x466517['attributes'][_0x6ff9('0x42')]?_0x466517[_0x6ff9('0x40')]:_0x42b82f[_0x6ff9('0x3b')];_0x466517[_0x6ff9('0x45')]=qs[_0x6ff9('0x46')](_0x2a7449[_0x6ff9('0x3c')]['sort']);_0x466517[_0x6ff9('0x47')]=qs[_0x6ff9('0x3e')](_['pick'](_0x2a7449['query'],_0x42b82f['filters']));if(_0x2a7449['query'][_0x6ff9('0x49')]){_0x466517[_0x6ff9('0x47')]=_['merge'](_0x466517[_0x6ff9('0x47')],{'$or':_[_0x6ff9('0x36')](_0x466517['attributes'],function(_0x41b59a){var _0x1e8cd8={};_0x1e8cd8[_0x41b59a]={'$like':'%'+_0x2a7449[_0x6ff9('0x3c')]['filter']+'%'};return _0x1e8cd8;})});}_0x466517=_[_0x6ff9('0x4a')]({},_0x466517,_0x2a7449[_0x6ff9('0x57')]);return _0x2b0fee[_0x6ff9('0x58')](_0x466517);}})['then'](function(_0x33e69e){if(_0x33e69e){_0x14bb4e=_0x33e69e['length'];if(!_0x2a7449[_0x6ff9('0x3c')]['hasOwnProperty'](_0x6ff9('0x43'))){_0x466517[_0x6ff9('0x44')]=qs[_0x6ff9('0x44')](_0x2a7449[_0x6ff9('0x3c')][_0x6ff9('0x44')]);_0x466517['offset']=qs[_0x6ff9('0x2a')](_0x2a7449['query'][_0x6ff9('0x2a')]);}return _0x2b0fee[_0x6ff9('0x58')](_0x466517);}})['then'](function(_0x1b935a){if(_0x1b935a){return _0x1b935a?{'count':_0x14bb4e,'rows':_0x1b935a}:null;}})[_0x6ff9('0x1c')](respondWithResult(_0x54a1b8,null))[_0x6ff9('0x26')](handleError(_0x54a1b8,null));};exports[_0x6ff9('0x59')]=function(_0x25119f,_0x5acb74,_0x167e45){if(_0x25119f[_0x6ff9('0x55')]['id']){delete _0x25119f['body']['id'];}return db[_0x6ff9('0x4c')][_0x6ff9('0x5a')]({'where':{'id':_0x25119f[_0x6ff9('0x51')]['id']}})[_0x6ff9('0x1c')](handleEntityNotFound(_0x5acb74,null))['then'](function(_0x5f860b){if(_0x5f860b){_0x25119f[_0x6ff9('0x55')]['AccountId']=_0x5f860b['id'];_0x25119f[_0x6ff9('0x55')][_0x6ff9('0x5b')]=integrations[_0x6ff9('0x5c')](_0x25119f[_0x6ff9('0x55')][_0x6ff9('0x5d')],_0x25119f[_0x6ff9('0x55')][_0x6ff9('0x39')]);_0x25119f['body']['Descriptions']=integrations[_0x6ff9('0x5e')](_0x25119f[_0x6ff9('0x55')][_0x6ff9('0x5d')],_0x25119f[_0x6ff9('0x55')][_0x6ff9('0x39')]);return db['SugarcrmConfiguration'][_0x6ff9('0x54')](_0x25119f[_0x6ff9('0x55')],{'include':[{'model':db[_0x6ff9('0x5f')],'as':_0x6ff9('0x5b')},{'model':db[_0x6ff9('0x5f')],'as':_0x6ff9('0x60')}]});}return null;})[_0x6ff9('0x1c')](respondWithResult(_0x5acb74,null))[_0x6ff9('0x26')](handleError(_0x5acb74,null));};exports[_0x6ff9('0x61')]=function(_0x4607a4,_0x4691c8,_0x22c291){var _0x5c275f='';var _0x44f3b2=['id',_0x6ff9('0x34'),_0x6ff9('0x62'),_0x6ff9('0x63'),'description',_0x6ff9('0x64'),_0x6ff9('0x65'),_0x6ff9('0x66'),_0x6ff9('0x67'),_0x6ff9('0x68'),_0x6ff9('0x69'),_0x6ff9('0x6a')];return db[_0x6ff9('0x4c')][_0x6ff9('0x5a')]({'where':{'id':_0x4607a4[_0x6ff9('0x51')]['id']},'attributes':['id',_0x6ff9('0x6b'),_0x6ff9('0x6c'),_0x6ff9('0x6d')]})['then'](handleEntityNotFound(_0x4691c8,null))[_0x6ff9('0x1c')](function(_0x2472e9){if(_0x2472e9){_0x5c275f=_0x2472e9[_0x6ff9('0x6d')];var _0x5da8c4=_0x5c275f[_0x6ff9('0x6e')](-0x1);if(_0x5da8c4==='/'){_0x5c275f=_0x5c275f['substring'](0x0,_0x5c275f[_0x6ff9('0x6f')](_0x5da8c4));}return rp({'method':_0x6ff9('0x70'),'uri':util[_0x6ff9('0x71')]('%s%s',_0x5c275f,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x6ff9('0x72'),'input_type':'JSON','response_type':_0x6ff9('0x73'),'rest_data':JSON[_0x6ff9('0x21')]({'user_auth':{'user_name':_0x2472e9[_0x6ff9('0x6b')],'password':_0x2472e9['password'],'encryption':'PLAIN'},'application':_0x6ff9('0x74')})}});}})[_0x6ff9('0x1c')](function(_0x297ed8){if(_0x297ed8&&_0x297ed8[_0x6ff9('0x34')]!==_0x6ff9('0x75')&&_0x297ed8[_0x6ff9('0x34')]!==_0x6ff9('0x76')){return rp({'method':_0x6ff9('0x70'),'uri':util[_0x6ff9('0x71')](_0x6ff9('0x77'),_0x5c275f,_0x6ff9('0x78')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x6ff9('0x73'),'response_type':_0x6ff9('0x73'),'rest_data':JSON[_0x6ff9('0x21')]({'session':_0x297ed8['id'],'module_name':_0x6ff9('0x79')})}})[_0x6ff9('0x1c')](function(_0x334286){if(_0x334286){var _0x557b2e=_[_0x6ff9('0x7a')](_0x334286['module_fields']);_[_0x6ff9('0x7b')](_0x557b2e,function(_0x2c3046){return _0x44f3b2[_0x6ff9('0x7c')](_0x2c3046[_0x6ff9('0x34')]);});return{'count':_0x557b2e[_0x6ff9('0x42')],'rows':_[_0x6ff9('0x36')](_0x557b2e,function(_0x223e5d){return{'id':_0x223e5d['name'],'name':_0x223e5d['label'],'custom':_[_0x6ff9('0x7d')](_0x223e5d[_0x6ff9('0x34')],'_c')?!![]:![],'options':_0x223e5d[_0x6ff9('0x57')]?_['map'](_[_0x6ff9('0x7a')](_0x223e5d['options']),function(_0x54d43d){return{'name':_0x54d43d[_0x6ff9('0x7e')],'value':_0x54d43d[_0x6ff9('0x34')]};}):[]};})};}})['then'](respondWithResult(_0x4691c8,null))[_0x6ff9('0x26')](function(_0x2507ba){var _0x2308a3=_0x4607a4[_0x6ff9('0x3c')][_0x6ff9('0x7f')]?0x1f4:_0x2507ba[_0x6ff9('0x80')]||0x1f4;logger[_0x6ff9('0x22')](_0x6ff9('0x81'),_0x6ff9('0x61'),_0x2308a3,JSON['stringify'](_0x2507ba));delete _0x2507ba[_0x6ff9('0x34')];if(_0x2308a3===0x191){_0x2308a3=0x190;}_0x4691c8[_0x6ff9('0x28')](_0x2308a3)['send'](_0x4607a4['query'][_0x6ff9('0x7f')]?{'message':_0x6ff9('0x82'),'statusCode':_0x2507ba[_0x6ff9('0x80')]}:_0x2507ba);});}else{var _0x2420db=0x1f4;_0x4691c8[_0x6ff9('0x28')](_0x2420db)[_0x6ff9('0x83')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xd0a0=['options','SugarcrmAccount','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','assigned_user_id','description','date_start','parent_id','parent_type','parent_name','direction','username','remoteUri','slice','substring','lastIndexOf','format','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','Calls','values','remove','includes','label','value','test','statusCode','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','destroy','end','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL'];(function(_0x4cf9e6,_0x1c4289){var _0xf9e375=function(_0x5044c6){while(--_0x5044c6){_0x4cf9e6['push'](_0x4cf9e6['shift']());}};_0xf9e375(++_0x1c4289);}(_0xd0a0,0x1b4));var _0x0d0a=function(_0x2a2166,_0x3a077f){_0x2a2166=_0x2a2166-0x0;var _0x3bcf50=_0xd0a0[_0x2a2166];return _0x3bcf50;};'use strict';var emlformat=require(_0x0d0a('0x0'));var rimraf=require(_0x0d0a('0x1'));var zipdir=require(_0x0d0a('0x2'));var jsonpatch=require(_0x0d0a('0x3'));var rp=require(_0x0d0a('0x4'));var moment=require(_0x0d0a('0x5'));var BPromise=require(_0x0d0a('0x6'));var Mustache=require(_0x0d0a('0x7'));var util=require('util');var path=require(_0x0d0a('0x8'));var sox=require('sox');var csv=require(_0x0d0a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d0a('0xa'));var _=require('lodash');var squel=require(_0x0d0a('0xb'));var crypto=require(_0x0d0a('0xc'));var jsforce=require(_0x0d0a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0d0a('0x9'));var querystring=require(_0x0d0a('0xe'));var Papa=require(_0x0d0a('0xf'));var Redis=require(_0x0d0a('0x10'));var authService=require(_0x0d0a('0x11'));var qs=require(_0x0d0a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d0a('0x13'));var logger=require(_0x0d0a('0x14'))(_0x0d0a('0x15'));var utils=require('../../config/utils');var config=require(_0x0d0a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d0a('0x17'))['db'];var integrations=require(_0x0d0a('0x18'));var jayson=require(_0x0d0a('0x19'));var client=jayson['client'][_0x0d0a('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3f29b2,_0x25cd1d,_0x22c001,_0x2cdc9c){return new BPromise(function(_0x1b66e4,_0x27eb7b){var _0x15188e=_0x2cdc9c||client;return _0x15188e[_0x0d0a('0x1b')](_0x3f29b2,_0x22c001)[_0x0d0a('0x1c')](function(_0x1fbef0){logger['info'](_0x0d0a('0x1d'),_0x25cd1d,_0x0d0a('0x1e'));logger[_0x0d0a('0x1f')](_0x0d0a('0x20'),_0x25cd1d,_0x0d0a('0x1e'),JSON['stringify'](_0x1fbef0));if(_0x1fbef0[_0x0d0a('0x21')]){if(_0x1fbef0[_0x0d0a('0x21')][_0x0d0a('0x22')]===0x1f4){logger[_0x0d0a('0x21')](_0x0d0a('0x1d'),_0x25cd1d,_0x1fbef0[_0x0d0a('0x21')]['message']);return _0x27eb7b(_0x1fbef0[_0x0d0a('0x21')][_0x0d0a('0x23')]);}logger['error'](_0x0d0a('0x1d'),_0x25cd1d,_0x1fbef0[_0x0d0a('0x21')]['message']);return _0x1b66e4(_0x1fbef0[_0x0d0a('0x21')][_0x0d0a('0x23')]);}else{logger[_0x0d0a('0x24')]('SugarcrmAccount,\x20%s,\x20%s',_0x25cd1d,_0x0d0a('0x1e'));_0x1b66e4(_0x1fbef0[_0x0d0a('0x25')][_0x0d0a('0x23')]);}})[_0x0d0a('0x26')](function(_0x42ea9f){logger[_0x0d0a('0x21')]('SugarcrmAccount,\x20%s,\x20%s',_0x25cd1d,_0x42ea9f);_0x27eb7b(_0x42ea9f);});});}function respondWithStatusCode(_0x5b5caa,_0x110e96){_0x110e96=_0x110e96||0xcc;return function(_0x53c1da){if(_0x53c1da){return _0x5b5caa['sendStatus'](_0x110e96);}return _0x5b5caa[_0x0d0a('0x27')](_0x110e96)['end']();};}function respondWithResult(_0x104409,_0x3c7c23){_0x3c7c23=_0x3c7c23||0xc8;return function(_0x5e46b1){if(_0x5e46b1){return _0x104409['status'](_0x3c7c23)['json'](_0x5e46b1);}};}function respondWithFilteredResult(_0x44f3f7,_0x1f287d){return function(_0x1e9af8){if(_0x1e9af8){var _0x4fd492=typeof _0x1f287d[_0x0d0a('0x28')]==='undefined'&&typeof _0x1f287d['limit']===_0x0d0a('0x29');var _0x223be2=_0x1e9af8['count'];var _0x621353=_0x4fd492?0x0:_0x1f287d[_0x0d0a('0x28')];var _0x1e55f0=_0x4fd492?_0x1e9af8[_0x0d0a('0x2a')]:_0x1f287d[_0x0d0a('0x28')]+_0x1f287d[_0x0d0a('0x2b')];var _0x37959d;if(_0x1e55f0>=_0x223be2){_0x1e55f0=_0x223be2;_0x37959d=0xc8;}else{_0x37959d=0xce;}_0x44f3f7[_0x0d0a('0x27')](_0x37959d);return _0x44f3f7[_0x0d0a('0x2c')](_0x0d0a('0x2d'),_0x621353+'-'+_0x1e55f0+'/'+_0x223be2)[_0x0d0a('0x2e')](_0x1e9af8);}return null;};}function patchUpdates(_0x105297){return function(_0x101a9c){try{jsonpatch[_0x0d0a('0x2f')](_0x101a9c,_0x105297,!![]);}catch(_0x41c2fa){return BPromise[_0x0d0a('0x30')](_0x41c2fa);}return _0x101a9c[_0x0d0a('0x31')]();};}function saveUpdates(_0x482e04,_0x57952b){return function(_0x20c092){if(_0x20c092){return _0x20c092['update'](_0x482e04)[_0x0d0a('0x1c')](function(_0x59d6da){return _0x59d6da;});}return null;};}function removeEntity(_0x677851,_0x9463a3){return function(_0x3b4ecb){if(_0x3b4ecb){return _0x3b4ecb[_0x0d0a('0x32')]()[_0x0d0a('0x1c')](function(){_0x677851[_0x0d0a('0x27')](0xcc)[_0x0d0a('0x33')]();});}};}function handleEntityNotFound(_0x216e51,_0x247c97){return function(_0x4f7cb3){if(!_0x4f7cb3){_0x216e51['sendStatus'](0x194);}return _0x4f7cb3;};}function handleError(_0x458d10,_0x1d9ce4){_0x1d9ce4=_0x1d9ce4||0x1f4;return function(_0x75a0ea){logger[_0x0d0a('0x21')](_0x75a0ea[_0x0d0a('0x34')]);if(_0x75a0ea[_0x0d0a('0x35')]){delete _0x75a0ea[_0x0d0a('0x35')];}_0x458d10[_0x0d0a('0x27')](_0x1d9ce4)[_0x0d0a('0x36')](_0x75a0ea);};}exports['index']=function(_0x5c4537,_0x32b86f){var _0x234d29={},_0x2af0e6={},_0x5a6b6e={'count':0x0,'rows':[]};var _0x2e148e=_['map'](db['SugarcrmAccount'][_0x0d0a('0x37')],function(_0x46686e){return{'name':_0x46686e[_0x0d0a('0x38')],'type':_0x46686e[_0x0d0a('0x39')][_0x0d0a('0x3a')]};});_0x2af0e6[_0x0d0a('0x3b')]=_[_0x0d0a('0x3c')](_0x2e148e,_0x0d0a('0x35'));_0x2af0e6[_0x0d0a('0x3d')]=_[_0x0d0a('0x3e')](_0x5c4537[_0x0d0a('0x3d')]);_0x2af0e6['filters']=_[_0x0d0a('0x3f')](_0x2af0e6[_0x0d0a('0x3b')],_0x2af0e6[_0x0d0a('0x3d')]);_0x234d29['attributes']=_['intersection'](_0x2af0e6[_0x0d0a('0x3b')],qs['fields'](_0x5c4537[_0x0d0a('0x3d')][_0x0d0a('0x40')]));_0x234d29[_0x0d0a('0x41')]=_0x234d29['attributes'][_0x0d0a('0x42')]?_0x234d29['attributes']:_0x2af0e6[_0x0d0a('0x3b')];if(!_0x5c4537[_0x0d0a('0x3d')][_0x0d0a('0x43')](_0x0d0a('0x44'))){_0x234d29[_0x0d0a('0x2b')]=qs['limit'](_0x5c4537[_0x0d0a('0x3d')]['limit']);_0x234d29[_0x0d0a('0x28')]=qs[_0x0d0a('0x28')](_0x5c4537['query']['offset']);}_0x234d29['order']=qs[_0x0d0a('0x45')](_0x5c4537[_0x0d0a('0x3d')][_0x0d0a('0x45')]);_0x234d29['where']=qs[_0x0d0a('0x46')](_[_0x0d0a('0x47')](_0x5c4537[_0x0d0a('0x3d')],_0x2af0e6['filters']),_0x2e148e);if(_0x5c4537[_0x0d0a('0x3d')][_0x0d0a('0x48')]){_0x234d29[_0x0d0a('0x49')]=_[_0x0d0a('0x4a')](_0x234d29[_0x0d0a('0x49')],{'$or':_[_0x0d0a('0x3c')](_0x2e148e,function(_0x532a76){if(_0x532a76[_0x0d0a('0x39')]!==_0x0d0a('0x4b')){var _0x51ce67={};_0x51ce67[_0x532a76[_0x0d0a('0x35')]]={'$like':'%'+_0x5c4537[_0x0d0a('0x3d')][_0x0d0a('0x48')]+'%'};return _0x51ce67;}})});}_0x234d29=_['merge']({},_0x234d29,_0x5c4537[_0x0d0a('0x4c')]);var _0x3773ef={'where':_0x234d29[_0x0d0a('0x49')]};return db[_0x0d0a('0x4d')][_0x0d0a('0x2a')](_0x3773ef)['then'](function(_0x399317){_0x5a6b6e[_0x0d0a('0x2a')]=_0x399317;if(_0x5c4537[_0x0d0a('0x3d')][_0x0d0a('0x4e')]){_0x234d29[_0x0d0a('0x4f')]=[{'all':!![]}];}return db[_0x0d0a('0x4d')][_0x0d0a('0x50')](_0x234d29);})['then'](function(_0x389435){_0x5a6b6e[_0x0d0a('0x51')]=_0x389435;return _0x5a6b6e;})[_0x0d0a('0x1c')](respondWithFilteredResult(_0x32b86f,_0x234d29))[_0x0d0a('0x26')](handleError(_0x32b86f,null));};exports[_0x0d0a('0x52')]=function(_0x49ac61,_0x292894){var _0x508a28={'raw':![],'where':{'id':_0x49ac61[_0x0d0a('0x53')]['id']}},_0x288fe4={};_0x288fe4[_0x0d0a('0x3b')]=_[_0x0d0a('0x3e')](db[_0x0d0a('0x4d')][_0x0d0a('0x37')]);_0x288fe4['query']=_['keys'](_0x49ac61[_0x0d0a('0x3d')]);_0x288fe4[_0x0d0a('0x46')]=_[_0x0d0a('0x3f')](_0x288fe4[_0x0d0a('0x3b')],_0x288fe4[_0x0d0a('0x3d')]);_0x508a28[_0x0d0a('0x41')]=_[_0x0d0a('0x3f')](_0x288fe4['model'],qs[_0x0d0a('0x40')](_0x49ac61[_0x0d0a('0x3d')]['fields']));_0x508a28[_0x0d0a('0x41')]=_0x508a28[_0x0d0a('0x41')][_0x0d0a('0x42')]?_0x508a28[_0x0d0a('0x41')]:_0x288fe4['model'];if(_0x49ac61[_0x0d0a('0x3d')][_0x0d0a('0x4e')]){_0x508a28['include']=[{'all':!![]}];}_0x508a28=_[_0x0d0a('0x4a')]({},_0x508a28,_0x49ac61[_0x0d0a('0x4c')]);return db['SugarcrmAccount'][_0x0d0a('0x54')](_0x508a28)[_0x0d0a('0x1c')](handleEntityNotFound(_0x292894,null))[_0x0d0a('0x1c')](respondWithResult(_0x292894,null))['catch'](handleError(_0x292894,null));};exports[_0x0d0a('0x55')]=function(_0x165165,_0x4c8690){return db[_0x0d0a('0x4d')]['create'](_0x165165[_0x0d0a('0x56')],{})[_0x0d0a('0x1c')](respondWithResult(_0x4c8690,0xc9))[_0x0d0a('0x26')](handleError(_0x4c8690,null));};exports['update']=function(_0x4f7302,_0x21e518){if(_0x4f7302[_0x0d0a('0x56')]['id']){delete _0x4f7302[_0x0d0a('0x56')]['id'];}return db[_0x0d0a('0x4d')]['find']({'where':{'id':_0x4f7302[_0x0d0a('0x53')]['id']}})['then'](handleEntityNotFound(_0x21e518,null))[_0x0d0a('0x1c')](saveUpdates(_0x4f7302[_0x0d0a('0x56')],null))[_0x0d0a('0x1c')](respondWithResult(_0x21e518,null))[_0x0d0a('0x26')](handleError(_0x21e518,null));};exports[_0x0d0a('0x32')]=function(_0x147525,_0x530fa0){return db[_0x0d0a('0x4d')][_0x0d0a('0x54')]({'where':{'id':_0x147525[_0x0d0a('0x53')]['id']}})[_0x0d0a('0x1c')](handleEntityNotFound(_0x530fa0,null))[_0x0d0a('0x1c')](removeEntity(_0x530fa0,null))[_0x0d0a('0x26')](handleError(_0x530fa0,null));};exports[_0x0d0a('0x57')]=function(_0x2ae15,_0x572f22,_0x2af3ec){var _0x268f33={};var _0x13907a={};var _0x38a57b;var _0x393304;return db[_0x0d0a('0x4d')][_0x0d0a('0x58')]({'where':{'id':_0x2ae15['params']['id']}})[_0x0d0a('0x1c')](handleEntityNotFound(_0x572f22,null))['then'](function(_0x236bbe){if(_0x236bbe){_0x38a57b=_0x236bbe;_0x13907a[_0x0d0a('0x3b')]=_[_0x0d0a('0x3e')](db[_0x0d0a('0x59')][_0x0d0a('0x37')]);_0x13907a['query']=_['keys'](_0x2ae15[_0x0d0a('0x3d')]);_0x13907a[_0x0d0a('0x46')]=_['intersection'](_0x13907a[_0x0d0a('0x3b')],_0x13907a[_0x0d0a('0x3d')]);_0x268f33[_0x0d0a('0x41')]=_['intersection'](_0x13907a[_0x0d0a('0x3b')],qs[_0x0d0a('0x40')](_0x2ae15[_0x0d0a('0x3d')][_0x0d0a('0x40')]));_0x268f33['attributes']=_0x268f33[_0x0d0a('0x41')][_0x0d0a('0x42')]?_0x268f33[_0x0d0a('0x41')]:_0x13907a[_0x0d0a('0x3b')];_0x268f33['order']=qs[_0x0d0a('0x45')](_0x2ae15[_0x0d0a('0x3d')][_0x0d0a('0x45')]);_0x268f33[_0x0d0a('0x49')]=qs[_0x0d0a('0x46')](_[_0x0d0a('0x47')](_0x2ae15[_0x0d0a('0x3d')],_0x13907a[_0x0d0a('0x46')]));if(_0x2ae15[_0x0d0a('0x3d')][_0x0d0a('0x48')]){_0x268f33[_0x0d0a('0x49')]=_['merge'](_0x268f33['where'],{'$or':_[_0x0d0a('0x3c')](_0x268f33[_0x0d0a('0x41')],function(_0x2c404f){var _0x4da876={};_0x4da876[_0x2c404f]={'$like':'%'+_0x2ae15['query'][_0x0d0a('0x48')]+'%'};return _0x4da876;})});}_0x268f33=_[_0x0d0a('0x4a')]({},_0x268f33,_0x2ae15['options']);return _0x38a57b[_0x0d0a('0x57')](_0x268f33);}})[_0x0d0a('0x1c')](function(_0x1ba37d){if(_0x1ba37d){_0x393304=_0x1ba37d[_0x0d0a('0x42')];if(!_0x2ae15[_0x0d0a('0x3d')][_0x0d0a('0x43')](_0x0d0a('0x44'))){_0x268f33[_0x0d0a('0x2b')]=qs[_0x0d0a('0x2b')](_0x2ae15[_0x0d0a('0x3d')][_0x0d0a('0x2b')]);_0x268f33[_0x0d0a('0x28')]=qs[_0x0d0a('0x28')](_0x2ae15[_0x0d0a('0x3d')][_0x0d0a('0x28')]);}return _0x38a57b[_0x0d0a('0x57')](_0x268f33);}})[_0x0d0a('0x1c')](function(_0x2f473f){if(_0x2f473f){return _0x2f473f?{'count':_0x393304,'rows':_0x2f473f}:null;}})[_0x0d0a('0x1c')](respondWithResult(_0x572f22,null))['catch'](handleError(_0x572f22,null));};exports[_0x0d0a('0x5a')]=function(_0x21b6de,_0x3d6596,_0x976182){if(_0x21b6de['body']['id']){delete _0x21b6de[_0x0d0a('0x56')]['id'];}return db['SugarcrmAccount'][_0x0d0a('0x58')]({'where':{'id':_0x21b6de[_0x0d0a('0x53')]['id']}})[_0x0d0a('0x1c')](handleEntityNotFound(_0x3d6596,null))[_0x0d0a('0x1c')](function(_0x309de1){if(_0x309de1){_0x21b6de[_0x0d0a('0x56')]['AccountId']=_0x309de1['id'];_0x21b6de[_0x0d0a('0x56')][_0x0d0a('0x5b')]=integrations[_0x0d0a('0x5c')](_0x21b6de[_0x0d0a('0x56')]['channel'],_0x21b6de[_0x0d0a('0x56')][_0x0d0a('0x39')]);_0x21b6de[_0x0d0a('0x56')][_0x0d0a('0x5d')]=integrations[_0x0d0a('0x5e')](_0x21b6de['body'][_0x0d0a('0x5f')],_0x21b6de['body'][_0x0d0a('0x39')]);return db[_0x0d0a('0x59')][_0x0d0a('0x55')](_0x21b6de[_0x0d0a('0x56')],{'include':[{'model':db[_0x0d0a('0x60')],'as':_0x0d0a('0x5b')},{'model':db[_0x0d0a('0x60')],'as':'Descriptions'}]});}return null;})[_0x0d0a('0x1c')](respondWithResult(_0x3d6596,null))[_0x0d0a('0x26')](handleError(_0x3d6596,null));};exports['getFields']=function(_0x21e13e,_0x5add71,_0x31e4fd){var _0x32f033='';var _0x1be883=['id','name',_0x0d0a('0x61'),'created_by',_0x0d0a('0x62'),_0x0d0a('0x63'),'duration_hours','duration_minutes',_0x0d0a('0x64'),_0x0d0a('0x65'),_0x0d0a('0x66'),_0x0d0a('0x67')];return db['SugarcrmAccount'][_0x0d0a('0x58')]({'where':{'id':_0x21e13e[_0x0d0a('0x53')]['id']},'attributes':['id',_0x0d0a('0x68'),'password',_0x0d0a('0x69')]})[_0x0d0a('0x1c')](handleEntityNotFound(_0x5add71,null))[_0x0d0a('0x1c')](function(_0x45baf3){if(_0x45baf3){_0x32f033=_0x45baf3['remoteUri'];var _0xfaa4af=_0x32f033[_0x0d0a('0x6a')](-0x1);if(_0xfaa4af==='/'){_0x32f033=_0x32f033[_0x0d0a('0x6b')](0x0,_0x32f033[_0x0d0a('0x6c')](_0xfaa4af));}return rp({'method':'POST','uri':util[_0x0d0a('0x6d')]('%s%s',_0x32f033,_0x0d0a('0x6e')),'json':!![],'form':{'method':'login','input_type':_0x0d0a('0x6f'),'response_type':'JSON','rest_data':JSON[_0x0d0a('0x70')]({'user_auth':{'user_name':_0x45baf3[_0x0d0a('0x68')],'password':_0x45baf3['password'],'encryption':_0x0d0a('0x71')},'application':_0x0d0a('0x72')})}});}})[_0x0d0a('0x1c')](function(_0x3b81c7){if(_0x3b81c7&&_0x3b81c7['name']!==_0x0d0a('0x73')&&_0x3b81c7[_0x0d0a('0x35')]!==_0x0d0a('0x74')){return rp({'method':_0x0d0a('0x75'),'uri':util[_0x0d0a('0x6d')]('%s%s',_0x32f033,_0x0d0a('0x6e')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x0d0a('0x6f'),'response_type':_0x0d0a('0x6f'),'rest_data':JSON[_0x0d0a('0x70')]({'session':_0x3b81c7['id'],'module_name':_0x0d0a('0x76')})}})[_0x0d0a('0x1c')](function(_0x4b8af2){if(_0x4b8af2){var _0xb6083e=_[_0x0d0a('0x77')](_0x4b8af2['module_fields']);_[_0x0d0a('0x78')](_0xb6083e,function(_0xf315f8){return _0x1be883[_0x0d0a('0x79')](_0xf315f8[_0x0d0a('0x35')]);});return{'count':_0xb6083e[_0x0d0a('0x42')],'rows':_[_0x0d0a('0x3c')](_0xb6083e,function(_0x56a1c5){return{'id':_0x56a1c5[_0x0d0a('0x35')],'name':_0x56a1c5[_0x0d0a('0x7a')],'custom':_['endsWith'](_0x56a1c5[_0x0d0a('0x35')],'_c')?!![]:![],'options':_0x56a1c5[_0x0d0a('0x4c')]?_[_0x0d0a('0x3c')](_[_0x0d0a('0x77')](_0x56a1c5[_0x0d0a('0x4c')]),function(_0x588383){return{'name':_0x588383[_0x0d0a('0x7b')],'value':_0x588383[_0x0d0a('0x35')]};}):[]};})};}})[_0x0d0a('0x1c')](respondWithResult(_0x5add71,null))[_0x0d0a('0x26')](function(_0x16199a){var _0x58c9b7=_0x21e13e[_0x0d0a('0x3d')][_0x0d0a('0x7c')]?0x1f4:_0x16199a[_0x0d0a('0x7d')]||0x1f4;logger[_0x0d0a('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0x0d0a('0x7e'),_0x58c9b7,JSON[_0x0d0a('0x70')](_0x16199a));delete _0x16199a['name'];if(_0x58c9b7===0x191){_0x58c9b7=0x190;}_0x5add71[_0x0d0a('0x27')](_0x58c9b7)[_0x0d0a('0x36')](_0x21e13e[_0x0d0a('0x3d')][_0x0d0a('0x7c')]?{'message':_0x0d0a('0x7f'),'statusCode':_0x16199a['statusCode']}:_0x16199a);});}else{var _0x2c63d0=0x1f4;_0x5add71[_0x0d0a('0x27')](_0x2c63d0)['send']({'message':_0x0d0a('0x7f'),'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 4ba5899..e526948 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 _0x2125=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5bb9ac,_0x417c09){var _0x38fd65=function(_0x17b739){while(--_0x17b739){_0x5bb9ac['push'](_0x5bb9ac['shift']());}};_0x38fd65(++_0x417c09);}(_0x2125,0xa2));var _0x5212=function(_0x52b784,_0x3148ce){_0x52b784=_0x52b784-0x0;var _0x43018b=_0x2125[_0x52b784];return _0x43018b;};'use strict';var _=require(_0x5212('0x0'));var util=require(_0x5212('0x1'));var logger=require('../../config/logger')(_0x5212('0x2'));var moment=require(_0x5212('0x3'));var BPromise=require(_0x5212('0x4'));var rp=require(_0x5212('0x5'));var fs=require('fs');var path=require(_0x5212('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5212('0x7'));var integrations=require(_0x5212('0x8'));module[_0x5212('0x9')]=function(_0x3df22b,_0x1e97fb){return _0x3df22b[_0x5212('0xa')](_0x5212('0xb'),attributes,{'tableName':_0x5212('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9aa2=['request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','exports','lodash','../../config/logger','moment'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9aa2,0x125));var _0x29aa=function(_0x1e7c1a,_0x1e1385){_0x1e7c1a=_0x1e7c1a-0x0;var _0x4761d5=_0x9aa2[_0x1e7c1a];return _0x4761d5;};'use strict';var _=require(_0x29aa('0x0'));var util=require('util');var logger=require(_0x29aa('0x1'))('api');var moment=require(_0x29aa('0x2'));var BPromise=require('bluebird');var rp=require(_0x29aa('0x3'));var fs=require('fs');var path=require(_0x29aa('0x4'));var rimraf=require('rimraf');var config=require(_0x29aa('0x5'));var attributes=require(_0x29aa('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x29aa('0x7')]=function(_0xcbbf34,_0x18a7fb){return _0xcbbf34['define']('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index d4e5fcc..7323114 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 _0xe446=['where','limit','include','model','attributes','map','ShowSugarcrmAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0xe446,0x189));var _0x6e44=function(_0x3d92a8,_0xa9bba1){_0x3d92a8=_0x3d92a8-0x0;var _0x3a3f23=_0xe446[_0x3d92a8];return _0x3a3f23;};'use strict';var _=require(_0x6e44('0x0'));var util=require(_0x6e44('0x1'));var moment=require('moment');var BPromise=require(_0x6e44('0x2'));var rs=require(_0x6e44('0x3'));var fs=require('fs');var Redis=require(_0x6e44('0x4'));var db=require(_0x6e44('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e44('0x6'))(_0x6e44('0x7'));var config=require(_0x6e44('0x8'));var jayson=require(_0x6e44('0x9'));var client=jayson[_0x6e44('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5609a0,_0x43e923,_0x464b45){return new BPromise(function(_0x47fcf3,_0x262eb9){return client[_0x6e44('0xb')](_0x5609a0,_0x464b45)[_0x6e44('0xc')](function(_0x35ce8c){logger[_0x6e44('0xd')](_0x6e44('0xe'),_0x43e923,'request\x20sent');logger[_0x6e44('0xf')](_0x6e44('0x10'),_0x43e923,_0x6e44('0x11'),JSON[_0x6e44('0x12')](_0x35ce8c));if(_0x35ce8c[_0x6e44('0x13')]){if(_0x35ce8c[_0x6e44('0x13')]['code']===0x1f4){logger[_0x6e44('0x13')](_0x6e44('0xe'),_0x43e923,_0x35ce8c[_0x6e44('0x13')][_0x6e44('0x14')]);return _0x262eb9(_0x35ce8c[_0x6e44('0x13')][_0x6e44('0x14')]);}logger[_0x6e44('0x13')](_0x6e44('0xe'),_0x43e923,_0x35ce8c[_0x6e44('0x13')][_0x6e44('0x14')]);return _0x47fcf3(_0x35ce8c[_0x6e44('0x13')][_0x6e44('0x14')]);}else{logger[_0x6e44('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x43e923,_0x6e44('0x11'));_0x47fcf3(_0x35ce8c['result'][_0x6e44('0x14')]);}})[_0x6e44('0x15')](function(_0x1690b0){logger[_0x6e44('0x13')](_0x6e44('0xe'),_0x43e923,_0x1690b0);_0x262eb9(_0x1690b0);});});}exports[_0x6e44('0x16')]=function(_0x7eafe){var _0xde2e43=this;return new Promise(function(_0x3d7f1b,_0x53d187){return db[_0x6e44('0x17')][_0x6e44('0x18')]({'raw':_0x7eafe[_0x6e44('0x19')]?_0x7eafe['options'][_0x6e44('0x1a')]===undefined?!![]:![]:!![],'where':_0x7eafe[_0x6e44('0x19')]?_0x7eafe['options'][_0x6e44('0x1b')]||null:null,'attributes':_0x7eafe[_0x6e44('0x19')]?_0x7eafe[_0x6e44('0x19')]['attributes']||null:null,'limit':_0x7eafe['options']?_0x7eafe[_0x6e44('0x19')][_0x6e44('0x1c')]||null:null,'include':_0x7eafe[_0x6e44('0x19')]?_0x7eafe[_0x6e44('0x19')]['include']?_['map'](_0x7eafe[_0x6e44('0x19')][_0x6e44('0x1d')],function(_0x320e67){return{'model':db[_0x320e67[_0x6e44('0x1e')]],'as':_0x320e67['as'],'attributes':_0x320e67[_0x6e44('0x1f')],'include':_0x320e67[_0x6e44('0x1d')]?_[_0x6e44('0x20')](_0x320e67[_0x6e44('0x1d')],function(_0x24e5bf){return{'model':db[_0x24e5bf['model']],'as':_0x24e5bf['as'],'attributes':_0x24e5bf[_0x6e44('0x1f')],'include':_0x24e5bf['include']?_[_0x6e44('0x20')](_0x24e5bf[_0x6e44('0x1d')],function(_0x11b9ea){return{'model':db[_0x11b9ea['model']],'as':_0x11b9ea['as'],'attributes':_0x11b9ea[_0x6e44('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1db22f){logger[_0x6e44('0xd')]('GetSugarcrmAccount',_0x7eafe);logger[_0x6e44('0xf')](_0x6e44('0x16'),_0x7eafe,JSON[_0x6e44('0x12')](_0x1db22f));_0x3d7f1b(_0x1db22f);})[_0x6e44('0x15')](function(_0x22baae){logger[_0x6e44('0x13')](_0x6e44('0x16'),_0x22baae[_0x6e44('0x14')],_0x7eafe);_0x53d187(_0xde2e43['error'](0x1f4,_0x22baae[_0x6e44('0x14')]));});});};exports[_0x6e44('0x21')]=function(_0x35741d){var _0x2283ee=this;return new Promise(function(_0x320417,_0xab6879){return db[_0x6e44('0x17')][_0x6e44('0x22')]({'raw':_0x35741d['options']?_0x35741d['options'][_0x6e44('0x1a')]===undefined?!![]:![]:!![],'where':_0x35741d[_0x6e44('0x19')]?_0x35741d['options'][_0x6e44('0x1b')]||null:null,'attributes':_0x35741d['options']?_0x35741d[_0x6e44('0x19')][_0x6e44('0x1f')]||null:null,'include':_0x35741d[_0x6e44('0x19')]?_0x35741d[_0x6e44('0x19')][_0x6e44('0x1d')]?_[_0x6e44('0x20')](_0x35741d['options'][_0x6e44('0x1d')],function(_0x214351){return{'model':db[_0x214351[_0x6e44('0x1e')]],'as':_0x214351['as'],'attributes':_0x214351['attributes'],'include':_0x214351[_0x6e44('0x1d')]?_[_0x6e44('0x20')](_0x214351[_0x6e44('0x1d')],function(_0x482d4d){return{'model':db[_0x482d4d['model']],'as':_0x482d4d['as'],'attributes':_0x482d4d[_0x6e44('0x1f')],'include':_0x482d4d[_0x6e44('0x1d')]?_[_0x6e44('0x20')](_0x482d4d[_0x6e44('0x1d')],function(_0x4b65c7){return{'model':db[_0x4b65c7[_0x6e44('0x1e')]],'as':_0x4b65c7['as'],'attributes':_0x4b65c7[_0x6e44('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6e44('0xc')](function(_0x3d2cdd){logger[_0x6e44('0xd')](_0x6e44('0x21'),_0x35741d);logger[_0x6e44('0xf')](_0x6e44('0x21'),_0x35741d,JSON[_0x6e44('0x12')](_0x3d2cdd));_0x320417(_0x3d2cdd);})[_0x6e44('0x15')](function(_0x2472a5){logger['error'](_0x6e44('0x21'),_0x2472a5['message'],_0x35741d);_0xab6879(_0x2283ee[_0x6e44('0x13')](0x1f4,_0x2472a5[_0x6e44('0x14')]));});});}; \ No newline at end of file +var _0x9f19=['where','attributes','limit','include','map','model','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw'];(function(_0x26721d,_0x448ba5){var _0x1035c5=function(_0x1c1b86){while(--_0x1c1b86){_0x26721d['push'](_0x26721d['shift']());}};_0x1035c5(++_0x448ba5);}(_0x9f19,0x11f));var _0x99f1=function(_0x4d4702,_0x5e60d9){_0x4d4702=_0x4d4702-0x0;var _0x37def6=_0x9f19[_0x4d4702];return _0x37def6;};'use strict';var _=require(_0x99f1('0x0'));var util=require(_0x99f1('0x1'));var moment=require(_0x99f1('0x2'));var BPromise=require(_0x99f1('0x3'));var rs=require(_0x99f1('0x4'));var fs=require('fs');var Redis=require(_0x99f1('0x5'));var db=require(_0x99f1('0x6'))['db'];var utils=require(_0x99f1('0x7'));var logger=require(_0x99f1('0x8'))('rpc');var config=require(_0x99f1('0x9'));var jayson=require(_0x99f1('0xa'));var client=jayson['client'][_0x99f1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6de9ce,_0x1a268c,_0x29e1f2){return new BPromise(function(_0x38f9ec,_0x406d9c){return client['request'](_0x6de9ce,_0x29e1f2)[_0x99f1('0xc')](function(_0x4f8a6b){logger[_0x99f1('0xd')](_0x99f1('0xe'),_0x1a268c,_0x99f1('0xf'));logger[_0x99f1('0x10')](_0x99f1('0x11'),_0x1a268c,_0x99f1('0xf'),JSON[_0x99f1('0x12')](_0x4f8a6b));if(_0x4f8a6b[_0x99f1('0x13')]){if(_0x4f8a6b[_0x99f1('0x13')][_0x99f1('0x14')]===0x1f4){logger[_0x99f1('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x1a268c,_0x4f8a6b[_0x99f1('0x13')][_0x99f1('0x15')]);return _0x406d9c(_0x4f8a6b[_0x99f1('0x13')][_0x99f1('0x15')]);}logger[_0x99f1('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x1a268c,_0x4f8a6b[_0x99f1('0x13')][_0x99f1('0x15')]);return _0x38f9ec(_0x4f8a6b[_0x99f1('0x13')][_0x99f1('0x15')]);}else{logger[_0x99f1('0xd')](_0x99f1('0xe'),_0x1a268c,_0x99f1('0xf'));_0x38f9ec(_0x4f8a6b[_0x99f1('0x16')][_0x99f1('0x15')]);}})[_0x99f1('0x17')](function(_0x2a1ca1){logger[_0x99f1('0x13')](_0x99f1('0xe'),_0x1a268c,_0x2a1ca1);_0x406d9c(_0x2a1ca1);});});}exports[_0x99f1('0x18')]=function(_0x466905){var _0x38b064=this;return new Promise(function(_0x53edc4,_0x1f2f22){return db[_0x99f1('0x19')]['findAll']({'raw':_0x466905['options']?_0x466905[_0x99f1('0x1a')][_0x99f1('0x1b')]===undefined?!![]:![]:!![],'where':_0x466905[_0x99f1('0x1a')]?_0x466905[_0x99f1('0x1a')][_0x99f1('0x1c')]||null:null,'attributes':_0x466905[_0x99f1('0x1a')]?_0x466905[_0x99f1('0x1a')][_0x99f1('0x1d')]||null:null,'limit':_0x466905[_0x99f1('0x1a')]?_0x466905['options'][_0x99f1('0x1e')]||null:null,'include':_0x466905[_0x99f1('0x1a')]?_0x466905['options'][_0x99f1('0x1f')]?_[_0x99f1('0x20')](_0x466905[_0x99f1('0x1a')]['include'],function(_0x338456){return{'model':db[_0x338456[_0x99f1('0x21')]],'as':_0x338456['as'],'attributes':_0x338456[_0x99f1('0x1d')],'include':_0x338456[_0x99f1('0x1f')]?_['map'](_0x338456[_0x99f1('0x1f')],function(_0x1cb6d2){return{'model':db[_0x1cb6d2['model']],'as':_0x1cb6d2['as'],'attributes':_0x1cb6d2[_0x99f1('0x1d')],'include':_0x1cb6d2[_0x99f1('0x1f')]?_[_0x99f1('0x20')](_0x1cb6d2[_0x99f1('0x1f')],function(_0x324645){return{'model':db[_0x324645[_0x99f1('0x21')]],'as':_0x324645['as'],'attributes':_0x324645[_0x99f1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x99f1('0xc')](function(_0x91939){logger[_0x99f1('0xd')](_0x99f1('0x18'),_0x466905);logger[_0x99f1('0x10')](_0x99f1('0x18'),_0x466905,JSON['stringify'](_0x91939));_0x53edc4(_0x91939);})['catch'](function(_0x1bcba7){logger[_0x99f1('0x13')](_0x99f1('0x18'),_0x1bcba7[_0x99f1('0x15')],_0x466905);_0x1f2f22(_0x38b064[_0x99f1('0x13')](0x1f4,_0x1bcba7[_0x99f1('0x15')]));});});};exports[_0x99f1('0x22')]=function(_0xcd6840){var _0x348e0d=this;return new Promise(function(_0x2e9d35,_0x49f10c){return db[_0x99f1('0x19')]['find']({'raw':_0xcd6840[_0x99f1('0x1a')]?_0xcd6840[_0x99f1('0x1a')][_0x99f1('0x1b')]===undefined?!![]:![]:!![],'where':_0xcd6840[_0x99f1('0x1a')]?_0xcd6840[_0x99f1('0x1a')]['where']||null:null,'attributes':_0xcd6840[_0x99f1('0x1a')]?_0xcd6840[_0x99f1('0x1a')][_0x99f1('0x1d')]||null:null,'include':_0xcd6840['options']?_0xcd6840['options']['include']?_[_0x99f1('0x20')](_0xcd6840[_0x99f1('0x1a')][_0x99f1('0x1f')],function(_0x395e6e){return{'model':db[_0x395e6e[_0x99f1('0x21')]],'as':_0x395e6e['as'],'attributes':_0x395e6e[_0x99f1('0x1d')],'include':_0x395e6e['include']?_['map'](_0x395e6e[_0x99f1('0x1f')],function(_0x56eea9){return{'model':db[_0x56eea9[_0x99f1('0x21')]],'as':_0x56eea9['as'],'attributes':_0x56eea9['attributes'],'include':_0x56eea9[_0x99f1('0x1f')]?_['map'](_0x56eea9[_0x99f1('0x1f')],function(_0x5cdd82){return{'model':db[_0x5cdd82[_0x99f1('0x21')]],'as':_0x5cdd82['as'],'attributes':_0x5cdd82[_0x99f1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x99f1('0xc')](function(_0x5e849b){logger[_0x99f1('0xd')]('ShowSugarcrmAccount',_0xcd6840);logger['debug']('ShowSugarcrmAccount',_0xcd6840,JSON[_0x99f1('0x12')](_0x5e849b));_0x2e9d35(_0x5e849b);})[_0x99f1('0x17')](function(_0x1562b1){logger[_0x99f1('0x13')](_0x99f1('0x22'),_0x1562b1[_0x99f1('0x15')],_0xcd6840);_0x49f10c(_0x348e0d[_0x99f1('0x13')](0x1f4,_0x1562b1['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index c92f09d..1862959 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 _0xee6e=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete'];(function(_0x2efdfc,_0x4d21e7){var _0x20cdc4=function(_0x269b55){while(--_0x269b55){_0x2efdfc['push'](_0x2efdfc['shift']());}};_0x20cdc4(++_0x4d21e7);}(_0xee6e,0x1ca));var _0xeee6=function(_0x4632c6,_0x497902){_0x4632c6=_0x4632c6-0x0;var _0x51916d=_0xee6e[_0x4632c6];return _0x51916d;};'use strict';var multer=require(_0xeee6('0x0'));var util=require(_0xeee6('0x1'));var path=require('path');var timeout=require(_0xeee6('0x2'));var express=require('express');var router=express[_0xeee6('0x3')]();var fs_extra=require(_0xeee6('0x4'));var auth=require(_0xeee6('0x5'));var interaction=require(_0xeee6('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0xeee6('0x7')]('/',auth[_0xeee6('0x8')](),controller[_0xeee6('0x9')]);router[_0xeee6('0x7')](_0xeee6('0xa'),auth[_0xeee6('0x8')](),controller[_0xeee6('0xb')]);router[_0xeee6('0x7')](_0xeee6('0xc'),auth['isAuthenticated'](),controller[_0xeee6('0xd')]);router['get'](_0xeee6('0xe'),auth[_0xeee6('0x8')](),controller[_0xeee6('0xf')]);router[_0xeee6('0x7')](_0xeee6('0x10'),auth['isAuthenticated'](),controller[_0xeee6('0x11')]);router[_0xeee6('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xeee6('0x13')]('/:id',auth[_0xeee6('0x8')](),controller[_0xeee6('0x14')]);router[_0xeee6('0x15')](_0xeee6('0xa'),auth[_0xeee6('0x8')](),controller[_0xeee6('0x16')]);module[_0xeee6('0x17')]=router; \ No newline at end of file +var _0xbb99=['../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2330fd,_0x56e9c7){var _0x5c1eba=function(_0x517719){while(--_0x517719){_0x2330fd['push'](_0x2330fd['shift']());}};_0x5c1eba(++_0x56e9c7);}(_0xbb99,0xd1));var _0x9bb9=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0xbb99[_0x32b993];return _0x482780;};'use strict';var multer=require(_0x9bb9('0x0'));var util=require(_0x9bb9('0x1'));var path=require(_0x9bb9('0x2'));var timeout=require(_0x9bb9('0x3'));var express=require(_0x9bb9('0x4'));var router=express[_0x9bb9('0x5')]();var fs_extra=require(_0x9bb9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9bb9('0x7'));var config=require('../../config/environment');var controller=require(_0x9bb9('0x8'));router[_0x9bb9('0x9')]('/',auth[_0x9bb9('0xa')](),controller[_0x9bb9('0xb')]);router[_0x9bb9('0x9')]('/:id',auth[_0x9bb9('0xa')](),controller[_0x9bb9('0xc')]);router['get'](_0x9bb9('0xd'),auth['isAuthenticated'](),controller[_0x9bb9('0xe')]);router[_0x9bb9('0x9')](_0x9bb9('0xf'),auth[_0x9bb9('0xa')](),controller[_0x9bb9('0x10')]);router['get']('/:id/descriptions',auth[_0x9bb9('0xa')](),controller[_0x9bb9('0x11')]);router[_0x9bb9('0x12')]('/',auth['isAuthenticated'](),controller[_0x9bb9('0x13')]);router[_0x9bb9('0x14')](_0x9bb9('0x15'),auth[_0x9bb9('0xa')](),controller['update']);router[_0x9bb9('0x16')](_0x9bb9('0x15'),auth[_0x9bb9('0xa')](),controller[_0x9bb9('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index d566fc9..42a8f7e 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 _0x09eb=['exports','STRING','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x09eb,0xe3));var _0xb09e=function(_0x644560,_0x1783aa){_0x644560=_0x644560-0x0;var _0x41b76b=_0x09eb[_0x644560];return _0x41b76b;};'use strict';var Sequelize=require(_0xb09e('0x0'));module[_0xb09e('0x1')]={'name':{'type':Sequelize[_0xb09e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbc02=['STRING','exports'];(function(_0x430ca1,_0x26bfb3){var _0x4cb726=function(_0x4972cf){while(--_0x4972cf){_0x430ca1['push'](_0x430ca1['shift']());}};_0x4cb726(++_0x26bfb3);}(_0xbc02,0xa7));var _0x2bc0=function(_0x24f9d9,_0x6b4d81){_0x24f9d9=_0x24f9d9-0x0;var _0x392b6c=_0xbc02[_0x24f9d9];return _0x392b6c;};'use strict';var Sequelize=require('sequelize');module[_0x2bc0('0x0')]={'name':{'type':Sequelize[_0x2bc0('0x1')]},'description':{'type':Sequelize[_0x2bc0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index a0cde83..57f2516 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 _0x34d8=['findAll','rows','params','intersection','length','find','create','update','body','getFields','SugarcrmField','filter','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','end','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','SugarcrmConfiguration','includeAll','include'];(function(_0x596dde,_0x102475){var _0x310929=function(_0x276987){while(--_0x276987){_0x596dde['push'](_0x596dde['shift']());}};_0x310929(++_0x102475);}(_0x34d8,0x167));var _0x834d=function(_0x5d3cae,_0x5f093c){_0x5d3cae=_0x5d3cae-0x0;var _0x4ef648=_0x34d8[_0x5d3cae];return _0x4ef648;};'use strict';var emlformat=require(_0x834d('0x0'));var rimraf=require(_0x834d('0x1'));var zipdir=require(_0x834d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x834d('0x3'));var Mustache=require(_0x834d('0x4'));var util=require(_0x834d('0x5'));var path=require(_0x834d('0x6'));var sox=require(_0x834d('0x7'));var csv=require('to-csv');var ejs=require(_0x834d('0x8'));var fs=require('fs');var fs_extra=require(_0x834d('0x9'));var _=require(_0x834d('0xa'));var squel=require('squel');var crypto=require(_0x834d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x834d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x834d('0xd'));var Redis=require('ioredis');var authService=require(_0x834d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x834d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x834d('0x10'))('api');var utils=require(_0x834d('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x834d('0x12'));var db=require(_0x834d('0x13'))['db'];var jayson=require(_0x834d('0x14'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c7715,_0x11d6bb,_0x42eb16,_0x48bc96){return new BPromise(function(_0x356b0b,_0x1514db){var _0x2a5075=_0x48bc96||client;return _0x2a5075[_0x834d('0x15')](_0x2c7715,_0x42eb16)[_0x834d('0x16')](function(_0x24a69b){logger[_0x834d('0x17')](_0x834d('0x18'),_0x11d6bb,'request\x20sent');logger[_0x834d('0x19')](_0x834d('0x1a'),_0x11d6bb,_0x834d('0x1b'),JSON[_0x834d('0x1c')](_0x24a69b));if(_0x24a69b['error']){if(_0x24a69b[_0x834d('0x1d')]['code']===0x1f4){logger[_0x834d('0x1d')](_0x834d('0x18'),_0x11d6bb,_0x24a69b[_0x834d('0x1d')]['message']);return _0x1514db(_0x24a69b['error']['message']);}logger['error'](_0x834d('0x18'),_0x11d6bb,_0x24a69b['error'][_0x834d('0x1e')]);return _0x356b0b(_0x24a69b['error'][_0x834d('0x1e')]);}else{logger[_0x834d('0x17')](_0x834d('0x18'),_0x11d6bb,'request\x20sent');_0x356b0b(_0x24a69b['result'][_0x834d('0x1e')]);}})[_0x834d('0x1f')](function(_0x1f089e){logger[_0x834d('0x1d')](_0x834d('0x18'),_0x11d6bb,_0x1f089e);_0x1514db(_0x1f089e);});});}function respondWithStatusCode(_0x591dfc,_0x5b1458){_0x5b1458=_0x5b1458||0xcc;return function(_0x63bb75){if(_0x63bb75){return _0x591dfc[_0x834d('0x20')](_0x5b1458);}return _0x591dfc[_0x834d('0x21')](_0x5b1458)['end']();};}function respondWithResult(_0x39fbbe,_0x20443a){_0x20443a=_0x20443a||0xc8;return function(_0x90ba74){if(_0x90ba74){return _0x39fbbe[_0x834d('0x21')](_0x20443a)[_0x834d('0x22')](_0x90ba74);}};}function respondWithFilteredResult(_0x7f2d59,_0x573760){return function(_0x33a997){if(_0x33a997){var _0x16cd6a=typeof _0x573760[_0x834d('0x23')]===_0x834d('0x24')&&typeof _0x573760[_0x834d('0x25')]==='undefined';var _0x5bce1a=_0x33a997[_0x834d('0x26')];var _0x1b0559=_0x16cd6a?0x0:_0x573760[_0x834d('0x23')];var _0x4dc063=_0x16cd6a?_0x33a997[_0x834d('0x26')]:_0x573760[_0x834d('0x23')]+_0x573760[_0x834d('0x25')];var _0x468e3c;if(_0x4dc063>=_0x5bce1a){_0x4dc063=_0x5bce1a;_0x468e3c=0xc8;}else{_0x468e3c=0xce;}_0x7f2d59[_0x834d('0x21')](_0x468e3c);return _0x7f2d59[_0x834d('0x27')](_0x834d('0x28'),_0x1b0559+'-'+_0x4dc063+'/'+_0x5bce1a)[_0x834d('0x22')](_0x33a997);}return null;};}function patchUpdates(_0x325f66){return function(_0x4a0a15){try{jsonpatch[_0x834d('0x29')](_0x4a0a15,_0x325f66,!![]);}catch(_0x473ae5){return BPromise['reject'](_0x473ae5);}return _0x4a0a15[_0x834d('0x2a')]();};}function saveUpdates(_0x14f846,_0x49cbfe){return function(_0x4e5c9f){if(_0x4e5c9f){return _0x4e5c9f['update'](_0x14f846)[_0x834d('0x16')](function(_0x316a0f){return _0x316a0f;});}return null;};}function removeEntity(_0x43e39a,_0x314873){return function(_0x173e2b){if(_0x173e2b){return _0x173e2b[_0x834d('0x2b')]()[_0x834d('0x16')](function(){_0x43e39a[_0x834d('0x21')](0xcc)[_0x834d('0x2c')]();});}};}function handleEntityNotFound(_0x61e3c9,_0x460426){return function(_0x8d9633){if(!_0x8d9633){_0x61e3c9['sendStatus'](0x194);}return _0x8d9633;};}function handleError(_0x525d24,_0xa8a5db){_0xa8a5db=_0xa8a5db||0x1f4;return function(_0x2fd2dd){logger[_0x834d('0x1d')](_0x2fd2dd[_0x834d('0x2d')]);if(_0x2fd2dd[_0x834d('0x2e')]){delete _0x2fd2dd['name'];}_0x525d24[_0x834d('0x21')](_0xa8a5db)[_0x834d('0x2f')](_0x2fd2dd);};}exports['index']=function(_0x4e1003,_0x3ad253){var _0x475127={},_0x25e48a={},_0x1392d4={'count':0x0,'rows':[]};var _0x6968de=_['map'](db['SugarcrmConfiguration'][_0x834d('0x30')],function(_0x58e1f0){return{'name':_0x58e1f0[_0x834d('0x31')],'type':_0x58e1f0[_0x834d('0x32')][_0x834d('0x33')]};});_0x25e48a[_0x834d('0x34')]=_[_0x834d('0x35')](_0x6968de,'name');_0x25e48a[_0x834d('0x36')]=_[_0x834d('0x37')](_0x4e1003[_0x834d('0x36')]);_0x25e48a[_0x834d('0x38')]=_['intersection'](_0x25e48a[_0x834d('0x34')],_0x25e48a[_0x834d('0x36')]);_0x475127[_0x834d('0x39')]=_['intersection'](_0x25e48a[_0x834d('0x34')],qs[_0x834d('0x3a')](_0x4e1003[_0x834d('0x36')][_0x834d('0x3a')]));_0x475127[_0x834d('0x39')]=_0x475127[_0x834d('0x39')]['length']?_0x475127[_0x834d('0x39')]:_0x25e48a[_0x834d('0x34')];if(!_0x4e1003['query'][_0x834d('0x3b')](_0x834d('0x3c'))){_0x475127['limit']=qs[_0x834d('0x25')](_0x4e1003[_0x834d('0x36')][_0x834d('0x25')]);_0x475127['offset']=qs[_0x834d('0x23')](_0x4e1003[_0x834d('0x36')][_0x834d('0x23')]);}_0x475127[_0x834d('0x3d')]=qs[_0x834d('0x3e')](_0x4e1003[_0x834d('0x36')][_0x834d('0x3e')]);_0x475127[_0x834d('0x3f')]=qs[_0x834d('0x38')](_[_0x834d('0x40')](_0x4e1003['query'],_0x25e48a[_0x834d('0x38')]),_0x6968de);if(_0x4e1003['query']['filter']){_0x475127[_0x834d('0x3f')]=_['merge'](_0x475127['where'],{'$or':_[_0x834d('0x35')](_0x6968de,function(_0x54bb42){if(_0x54bb42[_0x834d('0x32')]!==_0x834d('0x41')){var _0x102ced={};_0x102ced[_0x54bb42[_0x834d('0x2e')]]={'$like':'%'+_0x4e1003[_0x834d('0x36')]['filter']+'%'};return _0x102ced;}})});}_0x475127=_[_0x834d('0x42')]({},_0x475127,_0x4e1003[_0x834d('0x43')]);var _0x29dd56={'where':_0x475127['where']};return db[_0x834d('0x44')]['count'](_0x29dd56)['then'](function(_0x1f151f){_0x1392d4[_0x834d('0x26')]=_0x1f151f;if(_0x4e1003['query'][_0x834d('0x45')]){_0x475127[_0x834d('0x46')]=[{'all':!![]}];}return db[_0x834d('0x44')][_0x834d('0x47')](_0x475127);})[_0x834d('0x16')](function(_0x4877f){_0x1392d4[_0x834d('0x48')]=_0x4877f;return _0x1392d4;})[_0x834d('0x16')](respondWithFilteredResult(_0x3ad253,_0x475127))['catch'](handleError(_0x3ad253,null));};exports['show']=function(_0xb46dca,_0x3fc0e4){var _0x58b5ea={'raw':![],'where':{'id':_0xb46dca[_0x834d('0x49')]['id']}},_0x180b24={};_0x180b24[_0x834d('0x34')]=_['keys'](db[_0x834d('0x44')]['rawAttributes']);_0x180b24[_0x834d('0x36')]=_[_0x834d('0x37')](_0xb46dca[_0x834d('0x36')]);_0x180b24[_0x834d('0x38')]=_[_0x834d('0x4a')](_0x180b24[_0x834d('0x34')],_0x180b24[_0x834d('0x36')]);_0x58b5ea['attributes']=_[_0x834d('0x4a')](_0x180b24['model'],qs[_0x834d('0x3a')](_0xb46dca[_0x834d('0x36')][_0x834d('0x3a')]));_0x58b5ea[_0x834d('0x39')]=_0x58b5ea[_0x834d('0x39')][_0x834d('0x4b')]?_0x58b5ea[_0x834d('0x39')]:_0x180b24[_0x834d('0x34')];if(_0xb46dca['query'][_0x834d('0x45')]){_0x58b5ea['include']=[{'all':!![]}];}_0x58b5ea=_[_0x834d('0x42')]({},_0x58b5ea,_0xb46dca[_0x834d('0x43')]);return db['SugarcrmConfiguration'][_0x834d('0x4c')](_0x58b5ea)[_0x834d('0x16')](handleEntityNotFound(_0x3fc0e4,null))[_0x834d('0x16')](respondWithResult(_0x3fc0e4,null))['catch'](handleError(_0x3fc0e4,null));};exports['create']=function(_0x174744,_0x406d3f){return db[_0x834d('0x44')][_0x834d('0x4d')](_0x174744['body'],{})['then'](respondWithResult(_0x406d3f,0xc9))[_0x834d('0x1f')](handleError(_0x406d3f,null));};exports[_0x834d('0x4e')]=function(_0x3e07c7,_0x46dfb9){if(_0x3e07c7['body']['id']){delete _0x3e07c7['body']['id'];}return db['SugarcrmConfiguration'][_0x834d('0x4c')]({'where':{'id':_0x3e07c7[_0x834d('0x49')]['id']}})[_0x834d('0x16')](handleEntityNotFound(_0x46dfb9,null))[_0x834d('0x16')](saveUpdates(_0x3e07c7[_0x834d('0x4f')],null))[_0x834d('0x16')](respondWithResult(_0x46dfb9,null))[_0x834d('0x1f')](handleError(_0x46dfb9,null));};exports['destroy']=function(_0x205495,_0x38a7dc){return db[_0x834d('0x44')][_0x834d('0x4c')]({'where':{'id':_0x205495[_0x834d('0x49')]['id']}})[_0x834d('0x16')](handleEntityNotFound(_0x38a7dc,null))[_0x834d('0x16')](removeEntity(_0x38a7dc,null))[_0x834d('0x1f')](handleError(_0x38a7dc,null));};exports[_0x834d('0x50')]=function(_0x1b7933,_0x108766,_0x5ab4f9){var _0x10a989={};var _0x30e3a6={};var _0x1b7e71;var _0x8cd882;return db[_0x834d('0x44')]['findOne']({'where':{'id':_0x1b7933['params']['id']}})[_0x834d('0x16')](handleEntityNotFound(_0x108766,null))[_0x834d('0x16')](function(_0x3e1110){if(_0x3e1110){_0x1b7e71=_0x3e1110;_0x30e3a6[_0x834d('0x34')]=_['keys'](db[_0x834d('0x51')][_0x834d('0x30')]);_0x30e3a6['query']=_[_0x834d('0x37')](_0x1b7933[_0x834d('0x36')]);_0x30e3a6[_0x834d('0x38')]=_['intersection'](_0x30e3a6[_0x834d('0x34')],_0x30e3a6['query']);_0x10a989[_0x834d('0x39')]=_[_0x834d('0x4a')](_0x30e3a6['model'],qs['fields'](_0x1b7933[_0x834d('0x36')][_0x834d('0x3a')]));_0x10a989[_0x834d('0x39')]=_0x10a989[_0x834d('0x39')][_0x834d('0x4b')]?_0x10a989[_0x834d('0x39')]:_0x30e3a6[_0x834d('0x34')];_0x10a989[_0x834d('0x3d')]=qs[_0x834d('0x3e')](_0x1b7933['query'][_0x834d('0x3e')]);_0x10a989[_0x834d('0x3f')]=qs[_0x834d('0x38')](_[_0x834d('0x40')](_0x1b7933[_0x834d('0x36')],_0x30e3a6['filters']));if(_0x1b7933[_0x834d('0x36')][_0x834d('0x52')]){_0x10a989['where']=_[_0x834d('0x42')](_0x10a989[_0x834d('0x3f')],{'$or':_[_0x834d('0x35')](_0x10a989[_0x834d('0x39')],function(_0x585fd0){var _0x1912a7={};_0x1912a7[_0x585fd0]={'$like':'%'+_0x1b7933[_0x834d('0x36')]['filter']+'%'};return _0x1912a7;})});}_0x10a989=_[_0x834d('0x42')]({},_0x10a989,_0x1b7933[_0x834d('0x43')]);return _0x1b7e71['getFields'](_0x10a989);}})[_0x834d('0x16')](function(_0x2a6802){if(_0x2a6802){_0x8cd882=_0x2a6802[_0x834d('0x4b')];if(!_0x1b7933[_0x834d('0x36')][_0x834d('0x3b')]('nolimit')){_0x10a989[_0x834d('0x25')]=qs['limit'](_0x1b7933[_0x834d('0x36')][_0x834d('0x25')]);_0x10a989[_0x834d('0x23')]=qs['offset'](_0x1b7933[_0x834d('0x36')]['offset']);}return _0x1b7e71[_0x834d('0x50')](_0x10a989);}})[_0x834d('0x16')](function(_0x4c7b45){if(_0x4c7b45){return _0x4c7b45?{'count':_0x8cd882,'rows':_0x4c7b45}:null;}})[_0x834d('0x16')](respondWithResult(_0x108766,null))[_0x834d('0x1f')](handleError(_0x108766,null));};exports[_0x834d('0x53')]=function(_0x39207f,_0x1f61f2,_0x2c488e){var _0x2f0002={};var _0x45487a={};var _0xef670b;var _0x57859d;return db[_0x834d('0x44')]['findOne']({'where':{'id':_0x39207f[_0x834d('0x49')]['id']}})[_0x834d('0x16')](handleEntityNotFound(_0x1f61f2,null))[_0x834d('0x16')](function(_0x58d493){if(_0x58d493){_0xef670b=_0x58d493;_0x45487a['model']=_[_0x834d('0x37')](db[_0x834d('0x51')][_0x834d('0x30')]);_0x45487a[_0x834d('0x36')]=_[_0x834d('0x37')](_0x39207f[_0x834d('0x36')]);_0x45487a[_0x834d('0x38')]=_[_0x834d('0x4a')](_0x45487a[_0x834d('0x34')],_0x45487a[_0x834d('0x36')]);_0x2f0002[_0x834d('0x39')]=_['intersection'](_0x45487a[_0x834d('0x34')],qs[_0x834d('0x3a')](_0x39207f[_0x834d('0x36')][_0x834d('0x3a')]));_0x2f0002[_0x834d('0x39')]=_0x2f0002[_0x834d('0x39')]['length']?_0x2f0002[_0x834d('0x39')]:_0x45487a[_0x834d('0x34')];_0x2f0002[_0x834d('0x3d')]=qs[_0x834d('0x3e')](_0x39207f[_0x834d('0x36')]['sort']);_0x2f0002[_0x834d('0x3f')]=qs[_0x834d('0x38')](_['pick'](_0x39207f['query'],_0x45487a[_0x834d('0x38')]));if(_0x39207f['query']['filter']){_0x2f0002[_0x834d('0x3f')]=_[_0x834d('0x42')](_0x2f0002[_0x834d('0x3f')],{'$or':_[_0x834d('0x35')](_0x2f0002[_0x834d('0x39')],function(_0x3df05c){var _0x25afc1={};_0x25afc1[_0x3df05c]={'$like':'%'+_0x39207f[_0x834d('0x36')][_0x834d('0x52')]+'%'};return _0x25afc1;})});}_0x2f0002=_[_0x834d('0x42')]({},_0x2f0002,_0x39207f[_0x834d('0x43')]);return _0xef670b[_0x834d('0x53')](_0x2f0002);}})[_0x834d('0x16')](function(_0x22158b){if(_0x22158b){_0x57859d=_0x22158b[_0x834d('0x4b')];if(!_0x39207f[_0x834d('0x36')][_0x834d('0x3b')](_0x834d('0x3c'))){_0x2f0002['limit']=qs[_0x834d('0x25')](_0x39207f[_0x834d('0x36')][_0x834d('0x25')]);_0x2f0002['offset']=qs['offset'](_0x39207f['query']['offset']);}return _0xef670b[_0x834d('0x53')](_0x2f0002);}})[_0x834d('0x16')](function(_0x2f5e35){if(_0x2f5e35){return _0x2f5e35?{'count':_0x57859d,'rows':_0x2f5e35}:null;}})[_0x834d('0x16')](respondWithResult(_0x1f61f2,null))[_0x834d('0x1f')](handleError(_0x1f61f2,null));};exports[_0x834d('0x54')]=function(_0x178d08,_0x4a68f0,_0x36e0fe){var _0x126ed5={};var _0x4b9847={};var _0x11eb8f;var _0x5927ff;return db[_0x834d('0x44')][_0x834d('0x55')]({'where':{'id':_0x178d08['params']['id']}})[_0x834d('0x16')](handleEntityNotFound(_0x4a68f0,null))['then'](function(_0x2f8e93){if(_0x2f8e93){_0x11eb8f=_0x2f8e93;_0x4b9847[_0x834d('0x34')]=_['keys'](db[_0x834d('0x51')][_0x834d('0x30')]);_0x4b9847[_0x834d('0x36')]=_['keys'](_0x178d08[_0x834d('0x36')]);_0x4b9847[_0x834d('0x38')]=_['intersection'](_0x4b9847[_0x834d('0x34')],_0x4b9847[_0x834d('0x36')]);_0x126ed5[_0x834d('0x39')]=_[_0x834d('0x4a')](_0x4b9847[_0x834d('0x34')],qs[_0x834d('0x3a')](_0x178d08[_0x834d('0x36')][_0x834d('0x3a')]));_0x126ed5[_0x834d('0x39')]=_0x126ed5[_0x834d('0x39')]['length']?_0x126ed5[_0x834d('0x39')]:_0x4b9847['model'];_0x126ed5['order']=qs[_0x834d('0x3e')](_0x178d08['query']['sort']);_0x126ed5['where']=qs[_0x834d('0x38')](_['pick'](_0x178d08[_0x834d('0x36')],_0x4b9847[_0x834d('0x38')]));if(_0x178d08[_0x834d('0x36')][_0x834d('0x52')]){_0x126ed5[_0x834d('0x3f')]=_[_0x834d('0x42')](_0x126ed5[_0x834d('0x3f')],{'$or':_[_0x834d('0x35')](_0x126ed5[_0x834d('0x39')],function(_0x143017){var _0x19ef58={};_0x19ef58[_0x143017]={'$like':'%'+_0x178d08[_0x834d('0x36')][_0x834d('0x52')]+'%'};return _0x19ef58;})});}_0x126ed5=_[_0x834d('0x42')]({},_0x126ed5,_0x178d08['options']);return _0x11eb8f[_0x834d('0x54')](_0x126ed5);}})[_0x834d('0x16')](function(_0x92d189){if(_0x92d189){_0x5927ff=_0x92d189[_0x834d('0x4b')];if(!_0x178d08[_0x834d('0x36')][_0x834d('0x3b')](_0x834d('0x3c'))){_0x126ed5[_0x834d('0x25')]=qs['limit'](_0x178d08['query'][_0x834d('0x25')]);_0x126ed5[_0x834d('0x23')]=qs[_0x834d('0x23')](_0x178d08[_0x834d('0x36')]['offset']);}return _0x11eb8f[_0x834d('0x54')](_0x126ed5);}})['then'](function(_0xe95a54){if(_0xe95a54){return _0xe95a54?{'count':_0x5927ff,'rows':_0xe95a54}:null;}})[_0x834d('0x16')](respondWithResult(_0x4a68f0,null))[_0x834d('0x1f')](handleError(_0x4a68f0,null));}; \ No newline at end of file +var _0x2dae=['find','findOne','pick','getFields','getSubjects','SugarcrmField','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','options','includeAll','params','include','merge','create','body'];(function(_0x162758,_0x173413){var _0x33e2bd=function(_0x462106){while(--_0x462106){_0x162758['push'](_0x162758['shift']());}};_0x33e2bd(++_0x173413);}(_0x2dae,0xc3));var _0xe2da=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0x2dae[_0x56e4e7];return _0x383618;};'use strict';var emlformat=require(_0xe2da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe2da('0x1'));var jsonpatch=require(_0xe2da('0x2'));var rp=require(_0xe2da('0x3'));var moment=require(_0xe2da('0x4'));var BPromise=require(_0xe2da('0x5'));var Mustache=require('mustache');var util=require(_0xe2da('0x6'));var path=require(_0xe2da('0x7'));var sox=require(_0xe2da('0x8'));var csv=require(_0xe2da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2da('0xa'));var _=require(_0xe2da('0xb'));var squel=require(_0xe2da('0xc'));var crypto=require(_0xe2da('0xd'));var jsforce=require(_0xe2da('0xe'));var deskjs=require(_0xe2da('0xf'));var toCsv=require(_0xe2da('0x9'));var querystring=require(_0xe2da('0x10'));var Papa=require(_0xe2da('0x11'));var Redis=require('ioredis');var authService=require(_0xe2da('0x12'));var qs=require(_0xe2da('0x13'));var as=require(_0xe2da('0x14'));var hardwareService=require(_0xe2da('0x15'));var logger=require(_0xe2da('0x16'))(_0xe2da('0x17'));var utils=require(_0xe2da('0x18'));var config=require(_0xe2da('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2da('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe2da('0x1b')][_0xe2da('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x37064e,_0x411b9f,_0xfab73e,_0x5660b5){return new BPromise(function(_0x295a86,_0x48584b){var _0x236e7a=_0x5660b5||client;return _0x236e7a['request'](_0x37064e,_0xfab73e)['then'](function(_0x403d1c){logger[_0xe2da('0x1d')](_0xe2da('0x1e'),_0x411b9f,'request\x20sent');logger[_0xe2da('0x1f')](_0xe2da('0x20'),_0x411b9f,_0xe2da('0x21'),JSON[_0xe2da('0x22')](_0x403d1c));if(_0x403d1c['error']){if(_0x403d1c[_0xe2da('0x23')][_0xe2da('0x24')]===0x1f4){logger[_0xe2da('0x23')](_0xe2da('0x1e'),_0x411b9f,_0x403d1c[_0xe2da('0x23')]['message']);return _0x48584b(_0x403d1c[_0xe2da('0x23')][_0xe2da('0x25')]);}logger['error'](_0xe2da('0x1e'),_0x411b9f,_0x403d1c[_0xe2da('0x23')][_0xe2da('0x25')]);return _0x295a86(_0x403d1c[_0xe2da('0x23')][_0xe2da('0x25')]);}else{logger[_0xe2da('0x1d')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x411b9f,_0xe2da('0x21'));_0x295a86(_0x403d1c['result'][_0xe2da('0x25')]);}})[_0xe2da('0x26')](function(_0x395af6){logger[_0xe2da('0x23')](_0xe2da('0x1e'),_0x411b9f,_0x395af6);_0x48584b(_0x395af6);});});}function respondWithStatusCode(_0x1e45e9,_0x38f2c4){_0x38f2c4=_0x38f2c4||0xcc;return function(_0x221e98){if(_0x221e98){return _0x1e45e9['sendStatus'](_0x38f2c4);}return _0x1e45e9[_0xe2da('0x27')](_0x38f2c4)[_0xe2da('0x28')]();};}function respondWithResult(_0xb4d957,_0x14704d){_0x14704d=_0x14704d||0xc8;return function(_0x3778dc){if(_0x3778dc){return _0xb4d957[_0xe2da('0x27')](_0x14704d)[_0xe2da('0x29')](_0x3778dc);}};}function respondWithFilteredResult(_0x56c37e,_0x2adc49){return function(_0x3e23d7){if(_0x3e23d7){var _0x1dc228=typeof _0x2adc49[_0xe2da('0x2a')]===_0xe2da('0x2b')&&typeof _0x2adc49[_0xe2da('0x2c')]===_0xe2da('0x2b');var _0x39f60e=_0x3e23d7['count'];var _0x487a7c=_0x1dc228?0x0:_0x2adc49['offset'];var _0x3c4845=_0x1dc228?_0x3e23d7[_0xe2da('0x2d')]:_0x2adc49[_0xe2da('0x2a')]+_0x2adc49[_0xe2da('0x2c')];var _0x5de7fb;if(_0x3c4845>=_0x39f60e){_0x3c4845=_0x39f60e;_0x5de7fb=0xc8;}else{_0x5de7fb=0xce;}_0x56c37e['status'](_0x5de7fb);return _0x56c37e[_0xe2da('0x2e')](_0xe2da('0x2f'),_0x487a7c+'-'+_0x3c4845+'/'+_0x39f60e)[_0xe2da('0x29')](_0x3e23d7);}return null;};}function patchUpdates(_0x39f983){return function(_0x7ab5ee){try{jsonpatch[_0xe2da('0x30')](_0x7ab5ee,_0x39f983,!![]);}catch(_0x195b93){return BPromise[_0xe2da('0x31')](_0x195b93);}return _0x7ab5ee[_0xe2da('0x32')]();};}function saveUpdates(_0x499400,_0x576959){return function(_0x672767){if(_0x672767){return _0x672767[_0xe2da('0x33')](_0x499400)[_0xe2da('0x34')](function(_0x34f5fe){return _0x34f5fe;});}return null;};}function removeEntity(_0x195537,_0x27e86d){return function(_0x121cbf){if(_0x121cbf){return _0x121cbf[_0xe2da('0x35')]()[_0xe2da('0x34')](function(){_0x195537[_0xe2da('0x27')](0xcc)[_0xe2da('0x28')]();});}};}function handleEntityNotFound(_0x2386b8,_0x4ef546){return function(_0x19d6c8){if(!_0x19d6c8){_0x2386b8[_0xe2da('0x36')](0x194);}return _0x19d6c8;};}function handleError(_0x2618a1,_0x109d51){_0x109d51=_0x109d51||0x1f4;return function(_0x3a6f08){logger['error'](_0x3a6f08[_0xe2da('0x37')]);if(_0x3a6f08[_0xe2da('0x38')]){delete _0x3a6f08[_0xe2da('0x38')];}_0x2618a1['status'](_0x109d51)[_0xe2da('0x39')](_0x3a6f08);};}exports[_0xe2da('0x3a')]=function(_0x262bf8,_0x53af7f){var _0x4d0963={},_0x156deb={},_0x1f4a5a={'count':0x0,'rows':[]};var _0x4d6e6c=_[_0xe2da('0x3b')](db[_0xe2da('0x3c')][_0xe2da('0x3d')],function(_0x256a0c){return{'name':_0x256a0c[_0xe2da('0x3e')],'type':_0x256a0c['type'][_0xe2da('0x3f')]};});_0x156deb['model']=_['map'](_0x4d6e6c,_0xe2da('0x38'));_0x156deb['query']=_[_0xe2da('0x40')](_0x262bf8[_0xe2da('0x41')]);_0x156deb['filters']=_[_0xe2da('0x42')](_0x156deb[_0xe2da('0x43')],_0x156deb['query']);_0x4d0963['attributes']=_['intersection'](_0x156deb[_0xe2da('0x43')],qs[_0xe2da('0x44')](_0x262bf8[_0xe2da('0x41')][_0xe2da('0x44')]));_0x4d0963[_0xe2da('0x45')]=_0x4d0963[_0xe2da('0x45')][_0xe2da('0x46')]?_0x4d0963['attributes']:_0x156deb[_0xe2da('0x43')];if(!_0x262bf8[_0xe2da('0x41')][_0xe2da('0x47')](_0xe2da('0x48'))){_0x4d0963[_0xe2da('0x2c')]=qs['limit'](_0x262bf8[_0xe2da('0x41')][_0xe2da('0x2c')]);_0x4d0963[_0xe2da('0x2a')]=qs['offset'](_0x262bf8[_0xe2da('0x41')][_0xe2da('0x2a')]);}_0x4d0963[_0xe2da('0x49')]=qs[_0xe2da('0x4a')](_0x262bf8[_0xe2da('0x41')][_0xe2da('0x4a')]);_0x4d0963[_0xe2da('0x4b')]=qs[_0xe2da('0x4c')](_['pick'](_0x262bf8[_0xe2da('0x41')],_0x156deb[_0xe2da('0x4c')]),_0x4d6e6c);if(_0x262bf8[_0xe2da('0x41')][_0xe2da('0x4d')]){_0x4d0963[_0xe2da('0x4b')]=_['merge'](_0x4d0963[_0xe2da('0x4b')],{'$or':_[_0xe2da('0x3b')](_0x4d6e6c,function(_0x9ecea8){if(_0x9ecea8[_0xe2da('0x4e')]!==_0xe2da('0x4f')){var _0x3383cc={};_0x3383cc[_0x9ecea8[_0xe2da('0x38')]]={'$like':'%'+_0x262bf8['query'][_0xe2da('0x4d')]+'%'};return _0x3383cc;}})});}_0x4d0963=_['merge']({},_0x4d0963,_0x262bf8[_0xe2da('0x50')]);var _0x54b3ad={'where':_0x4d0963[_0xe2da('0x4b')]};return db['SugarcrmConfiguration'][_0xe2da('0x2d')](_0x54b3ad)[_0xe2da('0x34')](function(_0x525912){_0x1f4a5a[_0xe2da('0x2d')]=_0x525912;if(_0x262bf8[_0xe2da('0x41')][_0xe2da('0x51')]){_0x4d0963['include']=[{'all':!![]}];}return db[_0xe2da('0x3c')]['findAll'](_0x4d0963);})['then'](function(_0x16a393){_0x1f4a5a['rows']=_0x16a393;return _0x1f4a5a;})[_0xe2da('0x34')](respondWithFilteredResult(_0x53af7f,_0x4d0963))[_0xe2da('0x26')](handleError(_0x53af7f,null));};exports['show']=function(_0xa7ddc,_0x1464b7){var _0x482547={'raw':![],'where':{'id':_0xa7ddc[_0xe2da('0x52')]['id']}},_0x4a6d80={};_0x4a6d80['model']=_[_0xe2da('0x40')](db[_0xe2da('0x3c')][_0xe2da('0x3d')]);_0x4a6d80[_0xe2da('0x41')]=_[_0xe2da('0x40')](_0xa7ddc[_0xe2da('0x41')]);_0x4a6d80[_0xe2da('0x4c')]=_[_0xe2da('0x42')](_0x4a6d80[_0xe2da('0x43')],_0x4a6d80['query']);_0x482547[_0xe2da('0x45')]=_[_0xe2da('0x42')](_0x4a6d80[_0xe2da('0x43')],qs['fields'](_0xa7ddc[_0xe2da('0x41')][_0xe2da('0x44')]));_0x482547[_0xe2da('0x45')]=_0x482547[_0xe2da('0x45')][_0xe2da('0x46')]?_0x482547[_0xe2da('0x45')]:_0x4a6d80[_0xe2da('0x43')];if(_0xa7ddc['query']['includeAll']){_0x482547[_0xe2da('0x53')]=[{'all':!![]}];}_0x482547=_[_0xe2da('0x54')]({},_0x482547,_0xa7ddc[_0xe2da('0x50')]);return db['SugarcrmConfiguration']['find'](_0x482547)[_0xe2da('0x34')](handleEntityNotFound(_0x1464b7,null))['then'](respondWithResult(_0x1464b7,null))[_0xe2da('0x26')](handleError(_0x1464b7,null));};exports[_0xe2da('0x55')]=function(_0x8e78b9,_0x3099aa){return db[_0xe2da('0x3c')][_0xe2da('0x55')](_0x8e78b9[_0xe2da('0x56')],{})[_0xe2da('0x34')](respondWithResult(_0x3099aa,0xc9))[_0xe2da('0x26')](handleError(_0x3099aa,null));};exports['update']=function(_0x26a9f0,_0x2f763b){if(_0x26a9f0[_0xe2da('0x56')]['id']){delete _0x26a9f0[_0xe2da('0x56')]['id'];}return db['SugarcrmConfiguration'][_0xe2da('0x57')]({'where':{'id':_0x26a9f0[_0xe2da('0x52')]['id']}})[_0xe2da('0x34')](handleEntityNotFound(_0x2f763b,null))['then'](saveUpdates(_0x26a9f0[_0xe2da('0x56')],null))[_0xe2da('0x34')](respondWithResult(_0x2f763b,null))[_0xe2da('0x26')](handleError(_0x2f763b,null));};exports[_0xe2da('0x35')]=function(_0x188bb0,_0x22a571){return db[_0xe2da('0x3c')][_0xe2da('0x57')]({'where':{'id':_0x188bb0[_0xe2da('0x52')]['id']}})[_0xe2da('0x34')](handleEntityNotFound(_0x22a571,null))[_0xe2da('0x34')](removeEntity(_0x22a571,null))[_0xe2da('0x26')](handleError(_0x22a571,null));};exports['getFields']=function(_0x2b50cb,_0x705010,_0xe5d403){var _0x268052={};var _0x7526bd={};var _0x277e8c;var _0x1fc0df;return db['SugarcrmConfiguration'][_0xe2da('0x58')]({'where':{'id':_0x2b50cb['params']['id']}})[_0xe2da('0x34')](handleEntityNotFound(_0x705010,null))[_0xe2da('0x34')](function(_0x5b0c33){if(_0x5b0c33){_0x277e8c=_0x5b0c33;_0x7526bd['model']=_[_0xe2da('0x40')](db['SugarcrmField'][_0xe2da('0x3d')]);_0x7526bd['query']=_[_0xe2da('0x40')](_0x2b50cb[_0xe2da('0x41')]);_0x7526bd[_0xe2da('0x4c')]=_['intersection'](_0x7526bd['model'],_0x7526bd['query']);_0x268052[_0xe2da('0x45')]=_[_0xe2da('0x42')](_0x7526bd[_0xe2da('0x43')],qs[_0xe2da('0x44')](_0x2b50cb['query'][_0xe2da('0x44')]));_0x268052[_0xe2da('0x45')]=_0x268052[_0xe2da('0x45')][_0xe2da('0x46')]?_0x268052[_0xe2da('0x45')]:_0x7526bd[_0xe2da('0x43')];_0x268052[_0xe2da('0x49')]=qs['sort'](_0x2b50cb[_0xe2da('0x41')][_0xe2da('0x4a')]);_0x268052[_0xe2da('0x4b')]=qs[_0xe2da('0x4c')](_[_0xe2da('0x59')](_0x2b50cb['query'],_0x7526bd[_0xe2da('0x4c')]));if(_0x2b50cb['query'][_0xe2da('0x4d')]){_0x268052['where']=_[_0xe2da('0x54')](_0x268052['where'],{'$or':_['map'](_0x268052[_0xe2da('0x45')],function(_0x405743){var _0x2cff55={};_0x2cff55[_0x405743]={'$like':'%'+_0x2b50cb[_0xe2da('0x41')][_0xe2da('0x4d')]+'%'};return _0x2cff55;})});}_0x268052=_[_0xe2da('0x54')]({},_0x268052,_0x2b50cb[_0xe2da('0x50')]);return _0x277e8c[_0xe2da('0x5a')](_0x268052);}})[_0xe2da('0x34')](function(_0x17af45){if(_0x17af45){_0x1fc0df=_0x17af45['length'];if(!_0x2b50cb[_0xe2da('0x41')][_0xe2da('0x47')](_0xe2da('0x48'))){_0x268052[_0xe2da('0x2c')]=qs['limit'](_0x2b50cb[_0xe2da('0x41')][_0xe2da('0x2c')]);_0x268052[_0xe2da('0x2a')]=qs[_0xe2da('0x2a')](_0x2b50cb['query'][_0xe2da('0x2a')]);}return _0x277e8c['getFields'](_0x268052);}})[_0xe2da('0x34')](function(_0x3c2294){if(_0x3c2294){return _0x3c2294?{'count':_0x1fc0df,'rows':_0x3c2294}:null;}})['then'](respondWithResult(_0x705010,null))[_0xe2da('0x26')](handleError(_0x705010,null));};exports[_0xe2da('0x5b')]=function(_0x2843b,_0x835995,_0x42f865){var _0x4fe3dd={};var _0x1a6f48={};var _0x53a070;var _0x4943b3;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x2843b[_0xe2da('0x52')]['id']}})[_0xe2da('0x34')](handleEntityNotFound(_0x835995,null))[_0xe2da('0x34')](function(_0xc378ca){if(_0xc378ca){_0x53a070=_0xc378ca;_0x1a6f48[_0xe2da('0x43')]=_[_0xe2da('0x40')](db[_0xe2da('0x5c')][_0xe2da('0x3d')]);_0x1a6f48[_0xe2da('0x41')]=_['keys'](_0x2843b[_0xe2da('0x41')]);_0x1a6f48[_0xe2da('0x4c')]=_[_0xe2da('0x42')](_0x1a6f48[_0xe2da('0x43')],_0x1a6f48[_0xe2da('0x41')]);_0x4fe3dd[_0xe2da('0x45')]=_[_0xe2da('0x42')](_0x1a6f48[_0xe2da('0x43')],qs[_0xe2da('0x44')](_0x2843b[_0xe2da('0x41')]['fields']));_0x4fe3dd[_0xe2da('0x45')]=_0x4fe3dd[_0xe2da('0x45')][_0xe2da('0x46')]?_0x4fe3dd[_0xe2da('0x45')]:_0x1a6f48[_0xe2da('0x43')];_0x4fe3dd[_0xe2da('0x49')]=qs[_0xe2da('0x4a')](_0x2843b[_0xe2da('0x41')][_0xe2da('0x4a')]);_0x4fe3dd[_0xe2da('0x4b')]=qs[_0xe2da('0x4c')](_[_0xe2da('0x59')](_0x2843b['query'],_0x1a6f48[_0xe2da('0x4c')]));if(_0x2843b['query'][_0xe2da('0x4d')]){_0x4fe3dd[_0xe2da('0x4b')]=_[_0xe2da('0x54')](_0x4fe3dd[_0xe2da('0x4b')],{'$or':_[_0xe2da('0x3b')](_0x4fe3dd[_0xe2da('0x45')],function(_0x252578){var _0x54a1b8={};_0x54a1b8[_0x252578]={'$like':'%'+_0x2843b[_0xe2da('0x41')][_0xe2da('0x4d')]+'%'};return _0x54a1b8;})});}_0x4fe3dd=_[_0xe2da('0x54')]({},_0x4fe3dd,_0x2843b[_0xe2da('0x50')]);return _0x53a070[_0xe2da('0x5b')](_0x4fe3dd);}})[_0xe2da('0x34')](function(_0x4a9e88){if(_0x4a9e88){_0x4943b3=_0x4a9e88[_0xe2da('0x46')];if(!_0x2843b[_0xe2da('0x41')][_0xe2da('0x47')](_0xe2da('0x48'))){_0x4fe3dd[_0xe2da('0x2c')]=qs[_0xe2da('0x2c')](_0x2843b[_0xe2da('0x41')]['limit']);_0x4fe3dd[_0xe2da('0x2a')]=qs[_0xe2da('0x2a')](_0x2843b[_0xe2da('0x41')][_0xe2da('0x2a')]);}return _0x53a070[_0xe2da('0x5b')](_0x4fe3dd);}})[_0xe2da('0x34')](function(_0x5cfa5f){if(_0x5cfa5f){return _0x5cfa5f?{'count':_0x4943b3,'rows':_0x5cfa5f}:null;}})[_0xe2da('0x34')](respondWithResult(_0x835995,null))['catch'](handleError(_0x835995,null));};exports['getDescriptions']=function(_0x3a6bf4,_0x6b5a99,_0x4afc18){var _0x539c43={};var _0x3f0e80={};var _0x23daa8;var _0x20bf30;return db[_0xe2da('0x3c')]['findOne']({'where':{'id':_0x3a6bf4[_0xe2da('0x52')]['id']}})['then'](handleEntityNotFound(_0x6b5a99,null))['then'](function(_0x423b63){if(_0x423b63){_0x23daa8=_0x423b63;_0x3f0e80[_0xe2da('0x43')]=_[_0xe2da('0x40')](db[_0xe2da('0x5c')][_0xe2da('0x3d')]);_0x3f0e80[_0xe2da('0x41')]=_['keys'](_0x3a6bf4[_0xe2da('0x41')]);_0x3f0e80[_0xe2da('0x4c')]=_[_0xe2da('0x42')](_0x3f0e80['model'],_0x3f0e80[_0xe2da('0x41')]);_0x539c43[_0xe2da('0x45')]=_[_0xe2da('0x42')](_0x3f0e80['model'],qs[_0xe2da('0x44')](_0x3a6bf4[_0xe2da('0x41')][_0xe2da('0x44')]));_0x539c43[_0xe2da('0x45')]=_0x539c43[_0xe2da('0x45')]['length']?_0x539c43[_0xe2da('0x45')]:_0x3f0e80[_0xe2da('0x43')];_0x539c43[_0xe2da('0x49')]=qs[_0xe2da('0x4a')](_0x3a6bf4[_0xe2da('0x41')][_0xe2da('0x4a')]);_0x539c43[_0xe2da('0x4b')]=qs[_0xe2da('0x4c')](_[_0xe2da('0x59')](_0x3a6bf4['query'],_0x3f0e80[_0xe2da('0x4c')]));if(_0x3a6bf4[_0xe2da('0x41')]['filter']){_0x539c43[_0xe2da('0x4b')]=_['merge'](_0x539c43['where'],{'$or':_['map'](_0x539c43[_0xe2da('0x45')],function(_0x69d108){var _0x5f5cca={};_0x5f5cca[_0x69d108]={'$like':'%'+_0x3a6bf4[_0xe2da('0x41')]['filter']+'%'};return _0x5f5cca;})});}_0x539c43=_[_0xe2da('0x54')]({},_0x539c43,_0x3a6bf4[_0xe2da('0x50')]);return _0x23daa8[_0xe2da('0x5d')](_0x539c43);}})[_0xe2da('0x34')](function(_0x3e81e8){if(_0x3e81e8){_0x20bf30=_0x3e81e8[_0xe2da('0x46')];if(!_0x3a6bf4[_0xe2da('0x41')]['hasOwnProperty']('nolimit')){_0x539c43[_0xe2da('0x2c')]=qs[_0xe2da('0x2c')](_0x3a6bf4[_0xe2da('0x41')][_0xe2da('0x2c')]);_0x539c43['offset']=qs[_0xe2da('0x2a')](_0x3a6bf4['query'][_0xe2da('0x2a')]);}return _0x23daa8[_0xe2da('0x5d')](_0x539c43);}})[_0xe2da('0x34')](function(_0x15fabb){if(_0x15fabb){return _0x15fabb?{'count':_0x20bf30,'rows':_0x15fabb}:null;}})[_0xe2da('0x34')](respondWithResult(_0x6b5a99,null))[_0xe2da('0x26')](handleError(_0x6b5a99,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index ffc8134..3dd018e 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 _0x1a78=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0x1a78,0x1da));var _0x81a7=function(_0x5d7097,_0x4f7575){_0x5d7097=_0x5d7097-0x0;var _0x280bba=_0x1a78[_0x5d7097];return _0x280bba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x81a7('0x0'))(_0x81a7('0x1'));var moment=require(_0x81a7('0x2'));var BPromise=require(_0x81a7('0x3'));var rp=require(_0x81a7('0x4'));var fs=require('fs');var path=require(_0x81a7('0x5'));var rimraf=require(_0x81a7('0x6'));var config=require(_0x81a7('0x7'));var attributes=require(_0x81a7('0x8'));module[_0x81a7('0x9')]=function(_0x2a401d,_0x1e34b4){return _0x2a401d[_0x81a7('0xa')](_0x81a7('0xb'),attributes,{'tableName':_0x81a7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86d9=['request-promise','path','rimraf','../../config/environment','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x50dccc,_0x268d91){var _0x249167=function(_0x536417){while(--_0x536417){_0x50dccc['push'](_0x50dccc['shift']());}};_0x249167(++_0x268d91);}(_0x86d9,0x7c));var _0x986d=function(_0x9e9a80,_0x2ce689){_0x9e9a80=_0x9e9a80-0x0;var _0x473f6d=_0x86d9[_0x9e9a80];return _0x473f6d;};'use strict';var _=require(_0x986d('0x0'));var util=require(_0x986d('0x1'));var logger=require(_0x986d('0x2'))(_0x986d('0x3'));var moment=require(_0x986d('0x4'));var BPromise=require(_0x986d('0x5'));var rp=require(_0x986d('0x6'));var fs=require('fs');var path=require(_0x986d('0x7'));var rimraf=require(_0x986d('0x8'));var config=require(_0x986d('0x9'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x986d('0xa')]=function(_0x26c05b,_0x31dbde){return _0x26c05b['define'](_0x986d('0xb'),attributes,{'tableName':_0x986d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 6e8f323..e3ba4f6 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 _0x34f5=['SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x209b0a,_0x12fef1){var _0x20db2f=function(_0x38c34){while(--_0x38c34){_0x209b0a['push'](_0x209b0a['shift']());}};_0x20db2f(++_0x12fef1);}(_0x34f5,0xfe));var _0x534f=function(_0x4aa1df,_0x215aad){_0x4aa1df=_0x4aa1df-0x0;var _0x58e374=_0x34f5[_0x4aa1df];return _0x58e374;};'use strict';var _=require(_0x534f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x534f('0x1'));var rs=require(_0x534f('0x2'));var fs=require('fs');var Redis=require(_0x534f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x534f('0x4'));var logger=require('../../config/logger')(_0x534f('0x5'));var config=require(_0x534f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x534f('0x7')][_0x534f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b5321,_0x231b08,_0x401dd8){return new BPromise(function(_0x4bb9e2,_0x224369){return client[_0x534f('0x9')](_0x5b5321,_0x401dd8)[_0x534f('0xa')](function(_0x4c3aee){logger[_0x534f('0xb')](_0x534f('0xc'),_0x231b08,_0x534f('0xd'));logger['debug'](_0x534f('0xe'),_0x231b08,_0x534f('0xd'),JSON['stringify'](_0x4c3aee));if(_0x4c3aee[_0x534f('0xf')]){if(_0x4c3aee['error'][_0x534f('0x10')]===0x1f4){logger[_0x534f('0xf')](_0x534f('0xc'),_0x231b08,_0x4c3aee['error'][_0x534f('0x11')]);return _0x224369(_0x4c3aee['error'][_0x534f('0x11')]);}logger['error'](_0x534f('0xc'),_0x231b08,_0x4c3aee['error'][_0x534f('0x11')]);return _0x4bb9e2(_0x4c3aee[_0x534f('0xf')][_0x534f('0x11')]);}else{logger[_0x534f('0xb')](_0x534f('0xc'),_0x231b08,_0x534f('0xd'));_0x4bb9e2(_0x4c3aee['result']['message']);}})[_0x534f('0x12')](function(_0x156395){logger[_0x534f('0xf')](_0x534f('0xc'),_0x231b08,_0x156395);_0x224369(_0x156395);});});} \ No newline at end of file +var _0x3826=['request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x6c75da,_0x1b96d6){var _0x5f5d21=function(_0x5ef793){while(--_0x5ef793){_0x6c75da['push'](_0x6c75da['shift']());}};_0x5f5d21(++_0x1b96d6);}(_0x3826,0x95));var _0x6382=function(_0x5d57c7,_0x3547be){_0x5d57c7=_0x5d57c7-0x0;var _0x2ee0ee=_0x3826[_0x5d57c7];return _0x2ee0ee;};'use strict';var _=require(_0x6382('0x0'));var util=require(_0x6382('0x1'));var moment=require(_0x6382('0x2'));var BPromise=require(_0x6382('0x3'));var rs=require(_0x6382('0x4'));var fs=require('fs');var Redis=require(_0x6382('0x5'));var db=require(_0x6382('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6382('0x7'))(_0x6382('0x8'));var config=require(_0x6382('0x9'));var jayson=require(_0x6382('0xa'));var client=jayson['client'][_0x6382('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8a5488,_0x3f60e3,_0x1523a9){return new BPromise(function(_0x3a81ae,_0x958e7d){return client[_0x6382('0xc')](_0x8a5488,_0x1523a9)['then'](function(_0x324687){logger[_0x6382('0xd')](_0x6382('0xe'),_0x3f60e3,_0x6382('0xf'));logger['debug'](_0x6382('0x10'),_0x3f60e3,_0x6382('0xf'),JSON[_0x6382('0x11')](_0x324687));if(_0x324687['error']){if(_0x324687[_0x6382('0x12')][_0x6382('0x13')]===0x1f4){logger[_0x6382('0x12')](_0x6382('0xe'),_0x3f60e3,_0x324687['error'][_0x6382('0x14')]);return _0x958e7d(_0x324687[_0x6382('0x12')]['message']);}logger[_0x6382('0x12')](_0x6382('0xe'),_0x3f60e3,_0x324687[_0x6382('0x12')][_0x6382('0x14')]);return _0x3a81ae(_0x324687[_0x6382('0x12')][_0x6382('0x14')]);}else{logger[_0x6382('0xd')](_0x6382('0xe'),_0x3f60e3,_0x6382('0xf'));_0x3a81ae(_0x324687[_0x6382('0x15')][_0x6382('0x14')]);}})[_0x6382('0x16')](function(_0x4da1ac){logger['error'](_0x6382('0xe'),_0x3f60e3,_0x4da1ac);_0x958e7d(_0x4da1ac);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index c76822f..974269c 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 _0x5199=['./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3edd2d,_0x91dcb2){var _0x4e5484=function(_0x5c7099){while(--_0x5c7099){_0x3edd2d['push'](_0x3edd2d['shift']());}};_0x4e5484(++_0x91dcb2);}(_0x5199,0x115));var _0x9519=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5199[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x9519('0x0'));var util=require(_0x9519('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9519('0x2'));var router=express[_0x9519('0x3')]();var fs_extra=require(_0x9519('0x4'));var auth=require(_0x9519('0x5'));var interaction=require(_0x9519('0x6'));var config=require(_0x9519('0x7'));var controller=require(_0x9519('0x8'));router[_0x9519('0x9')]('/',auth[_0x9519('0xa')](),controller[_0x9519('0xb')]);router[_0x9519('0x9')](_0x9519('0xc'),auth[_0x9519('0xa')](),controller[_0x9519('0xd')]);router[_0x9519('0xe')]('/',auth[_0x9519('0xa')](),controller['create']);router[_0x9519('0xf')](_0x9519('0xc'),auth[_0x9519('0xa')](),controller[_0x9519('0x10')]);router[_0x9519('0x11')](_0x9519('0xc'),auth[_0x9519('0xa')](),controller['destroy']);module[_0x9519('0x12')]=router; \ No newline at end of file +var _0xc1e8=['index','/:id','show','post','isAuthenticated','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0xc1e8,0x87));var _0x8c1e=function(_0x12d812,_0x496bb7){_0x12d812=_0x12d812-0x0;var _0x3711ab=_0xc1e8[_0x12d812];return _0x3711ab;};'use strict';var multer=require(_0x8c1e('0x0'));var util=require(_0x8c1e('0x1'));var path=require(_0x8c1e('0x2'));var timeout=require(_0x8c1e('0x3'));var express=require(_0x8c1e('0x4'));var router=express[_0x8c1e('0x5')]();var fs_extra=require(_0x8c1e('0x6'));var auth=require(_0x8c1e('0x7'));var interaction=require(_0x8c1e('0x8'));var config=require(_0x8c1e('0x9'));var controller=require(_0x8c1e('0xa'));router[_0x8c1e('0xb')]('/',auth['isAuthenticated'](),controller[_0x8c1e('0xc')]);router[_0x8c1e('0xb')](_0x8c1e('0xd'),auth['isAuthenticated'](),controller[_0x8c1e('0xe')]);router[_0x8c1e('0xf')]('/',auth[_0x8c1e('0x10')](),controller[_0x8c1e('0x11')]);router[_0x8c1e('0x12')]('/:id',auth[_0x8c1e('0x10')](),controller[_0x8c1e('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8c1e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 8ee40fb..1a5cbe9 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 _0x495e=['STRING','ENUM','BOOLEAN','sequelize','string','variable','customVariable','keyValue'];(function(_0x2bb3f6,_0x25fde0){var _0x62b339=function(_0x53e014){while(--_0x53e014){_0x2bb3f6['push'](_0x2bb3f6['shift']());}};_0x62b339(++_0x25fde0);}(_0x495e,0xfb));var _0xe495=function(_0xaaf2e2,_0x19d28a){_0xaaf2e2=_0xaaf2e2-0x0;var _0x28bc36=_0x495e[_0xaaf2e2];return _0x28bc36;};'use strict';var Sequelize=require(_0xe495('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xe495('0x1'),_0xe495('0x2'),_0xe495('0x3'),_0xe495('0x4'),'picklist'),'defaultValue':_0xe495('0x1')},'content':{'type':Sequelize[_0xe495('0x5')]},'key':{'type':Sequelize[_0xe495('0x5')]},'keyType':{'type':Sequelize[_0xe495('0x6')](_0xe495('0x1'),_0xe495('0x2'),_0xe495('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe495('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x19ea=['variable','BOOLEAN','sequelize','string','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x403c23,_0x36d1ad){var _0x23f3ce=function(_0x510da5){while(--_0x510da5){_0x403c23['push'](_0x403c23['shift']());}};_0x23f3ce(++_0x36d1ad);}(_0x19ea,0xfe));var _0xa19e=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0x19ea[_0x4e4f0e];return _0x1a7219;};'use strict';var Sequelize=require(_0xa19e('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xa19e('0x1'),'variable',_0xa19e('0x2'),_0xa19e('0x3'),_0xa19e('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa19e('0x5')]},'keyType':{'type':Sequelize[_0xa19e('0x6')](_0xa19e('0x1'),_0xa19e('0x7'),_0xa19e('0x2'))},'keyContent':{'type':Sequelize[_0xa19e('0x5')]},'idField':{'type':Sequelize[_0xa19e('0x5')]},'nameField':{'type':Sequelize[_0xa19e('0x5')]},'customField':{'type':Sequelize[_0xa19e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa19e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index ca44b42..4fd0078 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 _0xf021=['lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','limit','reject','save','update','then','error','stack','name','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','count','includeAll','include','rows','catch','show','params','keys','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs'];(function(_0x462ed1,_0x18b3a7){var _0x3337e1=function(_0x3d13ad){while(--_0x3d13ad){_0x462ed1['push'](_0x462ed1['shift']());}};_0x3337e1(++_0x18b3a7);}(_0xf021,0x18f));var _0x1f02=function(_0x5b57ae,_0x31bac6){_0x5b57ae=_0x5b57ae-0x0;var _0x1877c2=_0xf021[_0x5b57ae];return _0x1877c2;};'use strict';var emlformat=require(_0x1f02('0x0'));var rimraf=require(_0x1f02('0x1'));var zipdir=require(_0x1f02('0x2'));var jsonpatch=require(_0x1f02('0x3'));var rp=require(_0x1f02('0x4'));var moment=require('moment');var BPromise=require(_0x1f02('0x5'));var Mustache=require('mustache');var util=require(_0x1f02('0x6'));var path=require(_0x1f02('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1f02('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f02('0x9'));var squel=require(_0x1f02('0xa'));var crypto=require(_0x1f02('0xb'));var jsforce=require(_0x1f02('0xc'));var deskjs=require(_0x1f02('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1f02('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1f02('0xf'));var as=require(_0x1f02('0x10'));var hardwareService=require(_0x1f02('0x11'));var logger=require(_0x1f02('0x12'))(_0x1f02('0x13'));var utils=require('../../config/utils');var config=require(_0x1f02('0x14'));var licenseUtil=require(_0x1f02('0x15'));var db=require(_0x1f02('0x16'))['db'];function respondWithStatusCode(_0x56a2c2,_0x24e9b8){_0x24e9b8=_0x24e9b8||0xcc;return function(_0x1ac6eb){if(_0x1ac6eb){return _0x56a2c2[_0x1f02('0x17')](_0x24e9b8);}return _0x56a2c2['status'](_0x24e9b8)['end']();};}function respondWithResult(_0x4974bd,_0x11ba7e){_0x11ba7e=_0x11ba7e||0xc8;return function(_0x2c08ad){if(_0x2c08ad){return _0x4974bd[_0x1f02('0x18')](_0x11ba7e)[_0x1f02('0x19')](_0x2c08ad);}};}function respondWithFilteredResult(_0x1c16ce,_0x45bae1){return function(_0x440328){if(_0x440328){var _0x3b0a3d=typeof _0x45bae1['offset']===_0x1f02('0x1a')&&typeof _0x45bae1['limit']==='undefined';var _0x4a66a5=_0x440328['count'];var _0x4d1e4f=_0x3b0a3d?0x0:_0x45bae1[_0x1f02('0x1b')];var _0x3033a2=_0x3b0a3d?_0x440328['count']:_0x45bae1[_0x1f02('0x1b')]+_0x45bae1[_0x1f02('0x1c')];var _0x356444;if(_0x3033a2>=_0x4a66a5){_0x3033a2=_0x4a66a5;_0x356444=0xc8;}else{_0x356444=0xce;}_0x1c16ce[_0x1f02('0x18')](_0x356444);return _0x1c16ce['set']('Content-Range',_0x4d1e4f+'-'+_0x3033a2+'/'+_0x4a66a5)[_0x1f02('0x19')](_0x440328);}return null;};}function patchUpdates(_0x37393a){return function(_0x5e78c2){try{jsonpatch['apply'](_0x5e78c2,_0x37393a,!![]);}catch(_0x339c29){return BPromise[_0x1f02('0x1d')](_0x339c29);}return _0x5e78c2[_0x1f02('0x1e')]();};}function saveUpdates(_0xbabbd7,_0x480297){return function(_0x12c4af){if(_0x12c4af){return _0x12c4af[_0x1f02('0x1f')](_0xbabbd7)[_0x1f02('0x20')](function(_0x2f422c){return _0x2f422c;});}return null;};}function removeEntity(_0x43b3e7,_0x134398){return function(_0x1328ea){if(_0x1328ea){return _0x1328ea['destroy']()[_0x1f02('0x20')](function(){_0x43b3e7[_0x1f02('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25a8d1,_0x43db49){return function(_0x575a86){if(!_0x575a86){_0x25a8d1['sendStatus'](0x194);}return _0x575a86;};}function handleError(_0x3f7426,_0x36c8c1){_0x36c8c1=_0x36c8c1||0x1f4;return function(_0x3c3fda){logger[_0x1f02('0x21')](_0x3c3fda[_0x1f02('0x22')]);if(_0x3c3fda[_0x1f02('0x23')]){delete _0x3c3fda[_0x1f02('0x23')];}_0x3f7426['status'](_0x36c8c1)['send'](_0x3c3fda);};}exports['index']=function(_0x3ef4bf,_0x1d380a){var _0x23059a={},_0x496afd={},_0x5c2c42={'count':0x0,'rows':[]};var _0x227567=_[_0x1f02('0x24')](db[_0x1f02('0x25')][_0x1f02('0x26')],function(_0x220345){return{'name':_0x220345[_0x1f02('0x27')],'type':_0x220345[_0x1f02('0x28')][_0x1f02('0x29')]};});_0x496afd[_0x1f02('0x2a')]=_[_0x1f02('0x24')](_0x227567,'name');_0x496afd[_0x1f02('0x2b')]=_['keys'](_0x3ef4bf[_0x1f02('0x2b')]);_0x496afd[_0x1f02('0x2c')]=_[_0x1f02('0x2d')](_0x496afd[_0x1f02('0x2a')],_0x496afd[_0x1f02('0x2b')]);_0x23059a[_0x1f02('0x2e')]=_['intersection'](_0x496afd['model'],qs[_0x1f02('0x2f')](_0x3ef4bf[_0x1f02('0x2b')]['fields']));_0x23059a[_0x1f02('0x2e')]=_0x23059a['attributes'][_0x1f02('0x30')]?_0x23059a['attributes']:_0x496afd[_0x1f02('0x2a')];if(!_0x3ef4bf['query']['hasOwnProperty'](_0x1f02('0x31'))){_0x23059a[_0x1f02('0x1c')]=qs[_0x1f02('0x1c')](_0x3ef4bf[_0x1f02('0x2b')]['limit']);_0x23059a[_0x1f02('0x1b')]=qs[_0x1f02('0x1b')](_0x3ef4bf[_0x1f02('0x2b')]['offset']);}_0x23059a[_0x1f02('0x32')]=qs[_0x1f02('0x33')](_0x3ef4bf[_0x1f02('0x2b')][_0x1f02('0x33')]);_0x23059a[_0x1f02('0x34')]=qs[_0x1f02('0x2c')](_['pick'](_0x3ef4bf[_0x1f02('0x2b')],_0x496afd[_0x1f02('0x2c')]),_0x227567);if(_0x3ef4bf[_0x1f02('0x2b')]['filter']){_0x23059a[_0x1f02('0x34')]=_['merge'](_0x23059a[_0x1f02('0x34')],{'$or':_['map'](_0x227567,function(_0x554665){if(_0x554665[_0x1f02('0x28')]!=='VIRTUAL'){var _0x591a1c={};_0x591a1c[_0x554665[_0x1f02('0x23')]]={'$like':'%'+_0x3ef4bf[_0x1f02('0x2b')][_0x1f02('0x35')]+'%'};return _0x591a1c;}})});}_0x23059a=_[_0x1f02('0x36')]({},_0x23059a,_0x3ef4bf['options']);var _0x2b48a3={'where':_0x23059a['where']};return db[_0x1f02('0x25')][_0x1f02('0x37')](_0x2b48a3)[_0x1f02('0x20')](function(_0x43e7bf){_0x5c2c42[_0x1f02('0x37')]=_0x43e7bf;if(_0x3ef4bf[_0x1f02('0x2b')][_0x1f02('0x38')]){_0x23059a[_0x1f02('0x39')]=[{'all':!![]}];}return db[_0x1f02('0x25')]['findAll'](_0x23059a);})[_0x1f02('0x20')](function(_0x5aab10){_0x5c2c42[_0x1f02('0x3a')]=_0x5aab10;return _0x5c2c42;})['then'](respondWithFilteredResult(_0x1d380a,_0x23059a))[_0x1f02('0x3b')](handleError(_0x1d380a,null));};exports[_0x1f02('0x3c')]=function(_0x1c7182,_0x5b15be){var _0x5938e1={'raw':!![],'where':{'id':_0x1c7182[_0x1f02('0x3d')]['id']}},_0x1c3f09={};_0x1c3f09[_0x1f02('0x2a')]=_[_0x1f02('0x3e')](db[_0x1f02('0x25')][_0x1f02('0x26')]);_0x1c3f09[_0x1f02('0x2b')]=_[_0x1f02('0x3e')](_0x1c7182[_0x1f02('0x2b')]);_0x1c3f09['filters']=_[_0x1f02('0x2d')](_0x1c3f09['model'],_0x1c3f09['query']);_0x5938e1[_0x1f02('0x2e')]=_['intersection'](_0x1c3f09['model'],qs[_0x1f02('0x2f')](_0x1c7182['query']['fields']));_0x5938e1[_0x1f02('0x2e')]=_0x5938e1[_0x1f02('0x2e')]['length']?_0x5938e1[_0x1f02('0x2e')]:_0x1c3f09[_0x1f02('0x2a')];if(_0x1c7182[_0x1f02('0x2b')][_0x1f02('0x38')]){_0x5938e1['include']=[{'all':!![]}];}_0x5938e1=_[_0x1f02('0x36')]({},_0x5938e1,_0x1c7182[_0x1f02('0x3f')]);return db[_0x1f02('0x25')][_0x1f02('0x40')](_0x5938e1)[_0x1f02('0x20')](handleEntityNotFound(_0x5b15be,null))[_0x1f02('0x20')](respondWithResult(_0x5b15be,null))[_0x1f02('0x3b')](handleError(_0x5b15be,null));};exports[_0x1f02('0x41')]=function(_0x16bec7,_0x282e5b){return db[_0x1f02('0x25')][_0x1f02('0x41')](_0x16bec7[_0x1f02('0x42')],{})[_0x1f02('0x20')](respondWithResult(_0x282e5b,0xc9))['catch'](handleError(_0x282e5b,null));};exports[_0x1f02('0x1f')]=function(_0x50d5ed,_0x37759d){if(_0x50d5ed['body']['id']){delete _0x50d5ed[_0x1f02('0x42')]['id'];}return db[_0x1f02('0x25')][_0x1f02('0x40')]({'where':{'id':_0x50d5ed[_0x1f02('0x3d')]['id']}})[_0x1f02('0x20')](handleEntityNotFound(_0x37759d,null))[_0x1f02('0x20')](saveUpdates(_0x50d5ed[_0x1f02('0x42')],null))[_0x1f02('0x20')](respondWithResult(_0x37759d,null))[_0x1f02('0x3b')](handleError(_0x37759d,null));};exports[_0x1f02('0x43')]=function(_0x1241c5,_0x5792d8){return db[_0x1f02('0x25')][_0x1f02('0x40')]({'where':{'id':_0x1241c5[_0x1f02('0x3d')]['id']}})[_0x1f02('0x20')](handleEntityNotFound(_0x5792d8,null))[_0x1f02('0x20')](removeEntity(_0x5792d8,null))[_0x1f02('0x3b')](handleError(_0x5792d8,null));}; \ No newline at end of file +var _0xedd9=['key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','SugarcrmField','rawAttributes','fieldName','type'];(function(_0x5cc8b5,_0x592249){var _0x4a64f8=function(_0x1fd7b2){while(--_0x1fd7b2){_0x5cc8b5['push'](_0x5cc8b5['shift']());}};_0x4a64f8(++_0x592249);}(_0xedd9,0xfc));var _0x9edd=function(_0x18f27e,_0x4cee11){_0x18f27e=_0x18f27e-0x0;var _0x59a719=_0xedd9[_0x18f27e];return _0x59a719;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['SugarcrmField'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['SugarcrmField'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['SugarcrmField'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 4720eef..14a16ad 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 _0x4f15=['./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x272376,_0x18e088){var _0x10b72c=function(_0x1509b1){while(--_0x1509b1){_0x272376['push'](_0x272376['shift']());}};_0x10b72c(++_0x18e088);}(_0x4f15,0x1c1));var _0x54f1=function(_0x384c3c,_0x43c1c0){_0x384c3c=_0x384c3c-0x0;var _0x3edf2e=_0x4f15[_0x384c3c];return _0x3edf2e;};'use strict';var _=require(_0x54f1('0x0'));var util=require(_0x54f1('0x1'));var logger=require(_0x54f1('0x2'))(_0x54f1('0x3'));var moment=require(_0x54f1('0x4'));var BPromise=require(_0x54f1('0x5'));var rp=require(_0x54f1('0x6'));var fs=require('fs');var path=require(_0x54f1('0x7'));var rimraf=require(_0x54f1('0x8'));var config=require(_0x54f1('0x9'));var attributes=require(_0x54f1('0xa'));module[_0x54f1('0xb')]=function(_0x3f6509,_0x5a17ed){return _0x3f6509[_0x54f1('0xc')](_0x54f1('0xd'),attributes,{'tableName':_0x54f1('0xe'),'paranoid':![],'indexes':[{'name':_0x54f1('0xf'),'fields':['idField',_0x54f1('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe531=['moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x2330c9,_0x583368){var _0x2491e2=function(_0x1490aa){while(--_0x1490aa){_0x2330c9['push'](_0x2330c9['shift']());}};_0x2491e2(++_0x583368);}(_0xe531,0x8d));var _0x1e53=function(_0x4d7b8d,_0x57d433){_0x4d7b8d=_0x4d7b8d-0x0;var _0x440892=_0xe531[_0x4d7b8d];return _0x440892;};'use strict';var _=require(_0x1e53('0x0'));var util=require(_0x1e53('0x1'));var logger=require(_0x1e53('0x2'))('api');var moment=require(_0x1e53('0x3'));var BPromise=require(_0x1e53('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e53('0x5'));var rimraf=require(_0x1e53('0x6'));var config=require(_0x1e53('0x7'));var attributes=require(_0x1e53('0x8'));module[_0x1e53('0x9')]=function(_0x4f9325,_0x2d2480){return _0x4f9325[_0x1e53('0xa')](_0x1e53('0xb'),attributes,{'tableName':_0x1e53('0xc'),'paranoid':![],'indexes':[{'name':_0x1e53('0xd'),'fields':[_0x1e53('0xe'),_0x1e53('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 dc4b20c..bbfae89 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x3fcfa4,_0x3b6fb7){var _0x40ecea=function(_0x4205bc){while(--_0x4205bc){_0x3fcfa4['push'](_0x3fcfa4['shift']());}};_0x40ecea(++_0x3b6fb7);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x121f0a,_0x38d0a6){var _0x47afc8=function(_0x22a077){while(--_0x22a077){_0x121f0a['push'](_0x121f0a['shift']());}};_0x47afc8(++_0x38d0a6);}(_0x14a0,0x8e));var _0x014a=function(_0x39d6c7,_0x55d7d0){_0x39d6c7=_0x39d6c7-0x0;var _0xc0d795=_0x14a0[_0x39d6c7];return _0xc0d795;};'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});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index adc85f1..532fcd0 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 _0x741c=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','/:id','update','delete'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x741c,0x98));var _0xc741=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x741c[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var path=require(_0xc741('0x2'));var timeout=require(_0xc741('0x3'));var express=require(_0xc741('0x4'));var router=express['Router']();var fs_extra=require(_0xc741('0x5'));var auth=require(_0xc741('0x6'));var interaction=require(_0xc741('0x7'));var config=require(_0xc741('0x8'));var controller=require('./intVtigerAccount.controller');router[_0xc741('0x9')]('/',auth[_0xc741('0xa')](),controller[_0xc741('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc741('0xc')]);router[_0xc741('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xc741('0xd')]);router[_0xc741('0x9')](_0xc741('0xe'),auth[_0xc741('0xa')](),controller[_0xc741('0xf')]);router[_0xc741('0x10')]('/',auth['isAuthenticated'](),controller[_0xc741('0x11')]);router[_0xc741('0x10')](_0xc741('0x12'),auth[_0xc741('0xa')](),controller['addConfiguration']);router[_0xc741('0x13')](_0xc741('0x14'),auth[_0xc741('0xa')](),controller[_0xc741('0x15')]);router[_0xc741('0x16')](_0xc741('0x14'),auth[_0xc741('0xa')](),controller[_0xc741('0x17')]);module[_0xc741('0x18')]=router; \ No newline at end of file +var _0x8aca=['../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1dc4cb,_0x1719d3){var _0x16e4ac=function(_0x100882){while(--_0x100882){_0x1dc4cb['push'](_0x1dc4cb['shift']());}};_0x16e4ac(++_0x1719d3);}(_0x8aca,0xb2));var _0xa8ac=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x8aca[_0x237546];return _0x233e29;};'use strict';var multer=require(_0xa8ac('0x0'));var util=require('util');var path=require(_0xa8ac('0x1'));var timeout=require('connect-timeout');var express=require(_0xa8ac('0x2'));var router=express[_0xa8ac('0x3')]();var fs_extra=require(_0xa8ac('0x4'));var auth=require(_0xa8ac('0x5'));var interaction=require(_0xa8ac('0x6'));var config=require(_0xa8ac('0x7'));var controller=require(_0xa8ac('0x8'));router[_0xa8ac('0x9')]('/',auth['isAuthenticated'](),controller[_0xa8ac('0xa')]);router[_0xa8ac('0x9')](_0xa8ac('0xb'),auth[_0xa8ac('0xc')](),controller[_0xa8ac('0xd')]);router[_0xa8ac('0x9')](_0xa8ac('0xe'),auth['isAuthenticated'](),controller[_0xa8ac('0xf')]);router[_0xa8ac('0x9')](_0xa8ac('0x10'),auth[_0xa8ac('0xc')](),controller['getFields']);router[_0xa8ac('0x11')]('/',auth[_0xa8ac('0xc')](),controller[_0xa8ac('0x12')]);router['post'](_0xa8ac('0xe'),auth['isAuthenticated'](),controller[_0xa8ac('0x13')]);router['put'](_0xa8ac('0xb'),auth[_0xa8ac('0xc')](),controller[_0xa8ac('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa8ac('0x15')]);module[_0xa8ac('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index a758947..5307180 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 _0x0683=['exports','STRING','HelpDesk'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0683,0xe1));var _0x3068=function(_0xf094a0,_0x5774cd){_0xf094a0=_0xf094a0-0x0;var _0x1bf5ce=_0x0683[_0xf094a0];return _0x1bf5ce;};'use strict';var Sequelize=require('sequelize');module[_0x3068('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3068('0x1')]},'username':{'type':Sequelize[_0x3068('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3068('0x2')},'remoteUri':{'type':Sequelize[_0x3068('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x3068('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x3068('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xb306=['STRING','HelpDesk','sequelize'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xb306,0x12e));var _0x6b30=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb306[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x6b30('0x0'));module['exports']={'name':{'type':Sequelize[_0x6b30('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6b30('0x1')]},'username':{'type':Sequelize[_0x6b30('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6b30('0x1')],'allowNull':![],'defaultValue':_0x6b30('0x2')},'remoteUri':{'type':Sequelize[_0x6b30('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6b30('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 5d83306..5f070b4 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 _0x9ffd=['getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerField','Subjects','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','login','token','GET','autogenerated','reference','owner','remove','includes','false','label','picklist','picklistValues','log','vTiger\x20error:\x20','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','stack','name','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','VtigerAccount','include','findAll','rows','params','keys','rawAttributes','includeAll','options','find','create','body','findOne','VtigerConfiguration','order','merge'];(function(_0x12745e,_0x2d7507){var _0x156708=function(_0x1166d3){while(--_0x1166d3){_0x12745e['push'](_0x12745e['shift']());}};_0x156708(++_0x2d7507);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1317af,_0x19f6d7){_0x1317af=_0x1317af-0x0;var _0x40f59f=_0x9ffd[_0x1317af];return _0x40f59f;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x1a')][_0xd9ff('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x415c58,_0x350a5d,_0x12c39a,_0x556aa4){return new BPromise(function(_0x2f78c1,_0x3c9ace){var _0x5c1a28=_0x556aa4||client;return _0x5c1a28[_0xd9ff('0x1c')](_0x415c58,_0x12c39a)['then'](function(_0x4ffe54){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x350a5d,_0xd9ff('0x1d'));logger['debug'](_0xd9ff('0x1e'),_0x350a5d,_0xd9ff('0x1d'),JSON[_0xd9ff('0x1f')](_0x4ffe54));if(_0x4ffe54[_0xd9ff('0x20')]){if(_0x4ffe54[_0xd9ff('0x20')][_0xd9ff('0x21')]===0x1f4){logger[_0xd9ff('0x20')](_0xd9ff('0x22'),_0x350a5d,_0x4ffe54[_0xd9ff('0x20')][_0xd9ff('0x23')]);return _0x3c9ace(_0x4ffe54[_0xd9ff('0x20')][_0xd9ff('0x23')]);}logger[_0xd9ff('0x20')]('VtigerAccount,\x20%s,\x20%s',_0x350a5d,_0x4ffe54['error'][_0xd9ff('0x23')]);return _0x2f78c1(_0x4ffe54[_0xd9ff('0x20')]['message']);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x350a5d,'request\x20sent');_0x2f78c1(_0x4ffe54[_0xd9ff('0x24')]['message']);}})[_0xd9ff('0x25')](function(_0x3fd141){logger[_0xd9ff('0x20')](_0xd9ff('0x22'),_0x350a5d,_0x3fd141);_0x3c9ace(_0x3fd141);});});}function respondWithStatusCode(_0x278b66,_0x42a828){_0x42a828=_0x42a828||0xcc;return function(_0x4b058a){if(_0x4b058a){return _0x278b66['sendStatus'](_0x42a828);}return _0x278b66[_0xd9ff('0x26')](_0x42a828)['end']();};}function respondWithResult(_0x3ca906,_0x4d86fe){_0x4d86fe=_0x4d86fe||0xc8;return function(_0x285002){if(_0x285002){return _0x3ca906['status'](_0x4d86fe)[_0xd9ff('0x27')](_0x285002);}};}function respondWithFilteredResult(_0x159e56,_0x2138b4){return function(_0x2970e8){if(_0x2970e8){var _0x5d685e=typeof _0x2138b4[_0xd9ff('0x28')]===_0xd9ff('0x29')&&typeof _0x2138b4[_0xd9ff('0x2a')]===_0xd9ff('0x29');var _0x5c1c1f=_0x2970e8[_0xd9ff('0x2b')];var _0x3792d9=_0x5d685e?0x0:_0x2138b4[_0xd9ff('0x28')];var _0x45fb63=_0x5d685e?_0x2970e8[_0xd9ff('0x2b')]:_0x2138b4[_0xd9ff('0x28')]+_0x2138b4[_0xd9ff('0x2a')];var _0x1b5953;if(_0x45fb63>=_0x5c1c1f){_0x45fb63=_0x5c1c1f;_0x1b5953=0xc8;}else{_0x1b5953=0xce;}_0x159e56[_0xd9ff('0x26')](_0x1b5953);return _0x159e56['set'](_0xd9ff('0x2c'),_0x3792d9+'-'+_0x45fb63+'/'+_0x5c1c1f)['json'](_0x2970e8);}return null;};}function patchUpdates(_0x1d55fd){return function(_0x29c532){try{jsonpatch[_0xd9ff('0x2d')](_0x29c532,_0x1d55fd,!![]);}catch(_0x552d08){return BPromise[_0xd9ff('0x2e')](_0x552d08);}return _0x29c532[_0xd9ff('0x2f')]();};}function saveUpdates(_0x56e5be,_0x436a55){return function(_0x509291){if(_0x509291){return _0x509291[_0xd9ff('0x30')](_0x56e5be)['then'](function(_0x18c28b){return _0x18c28b;});}return null;};}function removeEntity(_0x2419f5,_0x323cb5){return function(_0x206424){if(_0x206424){return _0x206424[_0xd9ff('0x31')]()[_0xd9ff('0x32')](function(){_0x2419f5[_0xd9ff('0x26')](0xcc)[_0xd9ff('0x33')]();});}};}function handleEntityNotFound(_0x36749c,_0x190fac){return function(_0x4813a5){if(!_0x4813a5){_0x36749c[_0xd9ff('0x34')](0x194);}return _0x4813a5;};}function handleError(_0x4670e4,_0x66f4d){_0x66f4d=_0x66f4d||0x1f4;return function(_0x498025){logger[_0xd9ff('0x20')](_0x498025[_0xd9ff('0x35')]);if(_0x498025[_0xd9ff('0x36')]){delete _0x498025['name'];}_0x4670e4[_0xd9ff('0x26')](_0x66f4d)['send'](_0x498025);};}exports[_0xd9ff('0x37')]=function(_0x4ae56b,_0x20a021){var _0x5db498={},_0x1a6c4d={},_0x99ea5b={'count':0x0,'rows':[]};var _0x11566b=_['map'](db['VtigerAccount']['rawAttributes'],function(_0x7ac3d1){return{'name':_0x7ac3d1[_0xd9ff('0x38')],'type':_0x7ac3d1[_0xd9ff('0x39')][_0xd9ff('0x3a')]};});_0x1a6c4d[_0xd9ff('0x3b')]=_[_0xd9ff('0x3c')](_0x11566b,'name');_0x1a6c4d['query']=_['keys'](_0x4ae56b[_0xd9ff('0x3d')]);_0x1a6c4d[_0xd9ff('0x3e')]=_[_0xd9ff('0x3f')](_0x1a6c4d[_0xd9ff('0x3b')],_0x1a6c4d['query']);_0x5db498[_0xd9ff('0x40')]=_['intersection'](_0x1a6c4d[_0xd9ff('0x3b')],qs[_0xd9ff('0x41')](_0x4ae56b[_0xd9ff('0x3d')][_0xd9ff('0x41')]));_0x5db498['attributes']=_0x5db498[_0xd9ff('0x40')][_0xd9ff('0x42')]?_0x5db498['attributes']:_0x1a6c4d[_0xd9ff('0x3b')];if(!_0x4ae56b[_0xd9ff('0x3d')][_0xd9ff('0x43')](_0xd9ff('0x44'))){_0x5db498[_0xd9ff('0x2a')]=qs[_0xd9ff('0x2a')](_0x4ae56b['query'][_0xd9ff('0x2a')]);_0x5db498[_0xd9ff('0x28')]=qs[_0xd9ff('0x28')](_0x4ae56b[_0xd9ff('0x3d')][_0xd9ff('0x28')]);}_0x5db498['order']=qs[_0xd9ff('0x45')](_0x4ae56b[_0xd9ff('0x3d')][_0xd9ff('0x45')]);_0x5db498['where']=qs['filters'](_[_0xd9ff('0x46')](_0x4ae56b[_0xd9ff('0x3d')],_0x1a6c4d[_0xd9ff('0x3e')]),_0x11566b);if(_0x4ae56b[_0xd9ff('0x3d')][_0xd9ff('0x47')]){_0x5db498[_0xd9ff('0x48')]=_['merge'](_0x5db498[_0xd9ff('0x48')],{'$or':_[_0xd9ff('0x3c')](_0x11566b,function(_0x54726c){if(_0x54726c[_0xd9ff('0x39')]!==_0xd9ff('0x49')){var _0x13a1ec={};_0x13a1ec[_0x54726c[_0xd9ff('0x36')]]={'$like':'%'+_0x4ae56b[_0xd9ff('0x3d')]['filter']+'%'};return _0x13a1ec;}})});}_0x5db498=_['merge']({},_0x5db498,_0x4ae56b['options']);var _0x301ebb={'where':_0x5db498['where']};return db[_0xd9ff('0x4a')][_0xd9ff('0x2b')](_0x301ebb)[_0xd9ff('0x32')](function(_0x4cfba7){_0x99ea5b[_0xd9ff('0x2b')]=_0x4cfba7;if(_0x4ae56b[_0xd9ff('0x3d')]['includeAll']){_0x5db498[_0xd9ff('0x4b')]=[{'all':!![]}];}return db[_0xd9ff('0x4a')][_0xd9ff('0x4c')](_0x5db498);})[_0xd9ff('0x32')](function(_0x559101){_0x99ea5b[_0xd9ff('0x4d')]=_0x559101;return _0x99ea5b;})['then'](respondWithFilteredResult(_0x20a021,_0x5db498))[_0xd9ff('0x25')](handleError(_0x20a021,null));};exports['show']=function(_0x450ca1,_0x3d91e6){var _0x2bf37a={'raw':![],'where':{'id':_0x450ca1[_0xd9ff('0x4e')]['id']}},_0x1760c3={};_0x1760c3['model']=_[_0xd9ff('0x4f')](db[_0xd9ff('0x4a')][_0xd9ff('0x50')]);_0x1760c3[_0xd9ff('0x3d')]=_['keys'](_0x450ca1['query']);_0x1760c3['filters']=_[_0xd9ff('0x3f')](_0x1760c3[_0xd9ff('0x3b')],_0x1760c3[_0xd9ff('0x3d')]);_0x2bf37a['attributes']=_[_0xd9ff('0x3f')](_0x1760c3[_0xd9ff('0x3b')],qs[_0xd9ff('0x41')](_0x450ca1[_0xd9ff('0x3d')][_0xd9ff('0x41')]));_0x2bf37a[_0xd9ff('0x40')]=_0x2bf37a[_0xd9ff('0x40')][_0xd9ff('0x42')]?_0x2bf37a[_0xd9ff('0x40')]:_0x1760c3[_0xd9ff('0x3b')];if(_0x450ca1[_0xd9ff('0x3d')][_0xd9ff('0x51')]){_0x2bf37a[_0xd9ff('0x4b')]=[{'all':!![]}];}_0x2bf37a=_['merge']({},_0x2bf37a,_0x450ca1[_0xd9ff('0x52')]);return db['VtigerAccount'][_0xd9ff('0x53')](_0x2bf37a)['then'](handleEntityNotFound(_0x3d91e6,null))[_0xd9ff('0x32')](respondWithResult(_0x3d91e6,null))['catch'](handleError(_0x3d91e6,null));};exports[_0xd9ff('0x54')]=function(_0x5624a0,_0x3aea70){return db['VtigerAccount'][_0xd9ff('0x54')](_0x5624a0['body'],{})[_0xd9ff('0x32')](respondWithResult(_0x3aea70,0xc9))['catch'](handleError(_0x3aea70,null));};exports[_0xd9ff('0x30')]=function(_0x103c99,_0x122c9d){if(_0x103c99[_0xd9ff('0x55')]['id']){delete _0x103c99['body']['id'];}return db[_0xd9ff('0x4a')][_0xd9ff('0x53')]({'where':{'id':_0x103c99[_0xd9ff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x122c9d,null))[_0xd9ff('0x32')](saveUpdates(_0x103c99[_0xd9ff('0x55')],null))[_0xd9ff('0x32')](respondWithResult(_0x122c9d,null))[_0xd9ff('0x25')](handleError(_0x122c9d,null));};exports[_0xd9ff('0x31')]=function(_0x56e8e8,_0x27cc9e){return db[_0xd9ff('0x4a')][_0xd9ff('0x53')]({'where':{'id':_0x56e8e8[_0xd9ff('0x4e')]['id']}})[_0xd9ff('0x32')](handleEntityNotFound(_0x27cc9e,null))[_0xd9ff('0x32')](removeEntity(_0x27cc9e,null))[_0xd9ff('0x25')](handleError(_0x27cc9e,null));};exports['getConfigurations']=function(_0x3be850,_0x11251f,_0x561a9b){var _0x1c885f={};var _0x17c1b2={};var _0x5b17c0;var _0x11b0a5;return db[_0xd9ff('0x4a')][_0xd9ff('0x56')]({'where':{'id':_0x3be850['params']['id']}})['then'](handleEntityNotFound(_0x11251f,null))[_0xd9ff('0x32')](function(_0x4f0c33){if(_0x4f0c33){_0x5b17c0=_0x4f0c33;_0x17c1b2[_0xd9ff('0x3b')]=_[_0xd9ff('0x4f')](db[_0xd9ff('0x57')][_0xd9ff('0x50')]);_0x17c1b2['query']=_['keys'](_0x3be850['query']);_0x17c1b2[_0xd9ff('0x3e')]=_[_0xd9ff('0x3f')](_0x17c1b2[_0xd9ff('0x3b')],_0x17c1b2[_0xd9ff('0x3d')]);_0x1c885f[_0xd9ff('0x40')]=_['intersection'](_0x17c1b2[_0xd9ff('0x3b')],qs['fields'](_0x3be850[_0xd9ff('0x3d')][_0xd9ff('0x41')]));_0x1c885f[_0xd9ff('0x40')]=_0x1c885f[_0xd9ff('0x40')][_0xd9ff('0x42')]?_0x1c885f[_0xd9ff('0x40')]:_0x17c1b2[_0xd9ff('0x3b')];_0x1c885f[_0xd9ff('0x58')]=qs['sort'](_0x3be850[_0xd9ff('0x3d')][_0xd9ff('0x45')]);_0x1c885f['where']=qs['filters'](_[_0xd9ff('0x46')](_0x3be850['query'],_0x17c1b2[_0xd9ff('0x3e')]));if(_0x3be850[_0xd9ff('0x3d')]['filter']){_0x1c885f[_0xd9ff('0x48')]=_[_0xd9ff('0x59')](_0x1c885f[_0xd9ff('0x48')],{'$or':_[_0xd9ff('0x3c')](_0x1c885f[_0xd9ff('0x40')],function(_0x49c5fa){var _0x12a8d7={};_0x12a8d7[_0x49c5fa]={'$like':'%'+_0x3be850['query']['filter']+'%'};return _0x12a8d7;})});}_0x1c885f=_[_0xd9ff('0x59')]({},_0x1c885f,_0x3be850[_0xd9ff('0x52')]);return _0x5b17c0[_0xd9ff('0x5a')](_0x1c885f);}})[_0xd9ff('0x32')](function(_0x56d822){if(_0x56d822){_0x11b0a5=_0x56d822[_0xd9ff('0x42')];if(!_0x3be850[_0xd9ff('0x3d')][_0xd9ff('0x43')](_0xd9ff('0x44'))){_0x1c885f[_0xd9ff('0x2a')]=qs[_0xd9ff('0x2a')](_0x3be850[_0xd9ff('0x3d')][_0xd9ff('0x2a')]);_0x1c885f['offset']=qs['offset'](_0x3be850['query'][_0xd9ff('0x28')]);}return _0x5b17c0[_0xd9ff('0x5a')](_0x1c885f);}})['then'](function(_0x196670){if(_0x196670){return _0x196670?{'count':_0x11b0a5,'rows':_0x196670}:null;}})[_0xd9ff('0x32')](respondWithResult(_0x11251f,null))[_0xd9ff('0x25')](handleError(_0x11251f,null));};exports[_0xd9ff('0x5b')]=function(_0x17884a,_0x471e03,_0x2a9fdf){if(_0x17884a[_0xd9ff('0x55')]['id']){delete _0x17884a['body']['id'];}return db[_0xd9ff('0x4a')][_0xd9ff('0x56')]({'where':{'id':_0x17884a[_0xd9ff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x471e03,null))[_0xd9ff('0x32')](function(_0x58c9c2){if(_0x58c9c2){_0x17884a[_0xd9ff('0x55')][_0xd9ff('0x5c')]=_0x58c9c2['id'];_0x17884a[_0xd9ff('0x55')]['Subjects']=integrations[_0xd9ff('0x5d')](_0x17884a[_0xd9ff('0x55')][_0xd9ff('0x5e')],_0x17884a[_0xd9ff('0x55')]['type']);_0x17884a[_0xd9ff('0x55')][_0xd9ff('0x5f')]=integrations[_0xd9ff('0x60')](_0x17884a['body'][_0xd9ff('0x5e')],_0x17884a[_0xd9ff('0x55')][_0xd9ff('0x39')]);return db['VtigerConfiguration'][_0xd9ff('0x54')](_0x17884a[_0xd9ff('0x55')],{'include':[{'model':db[_0xd9ff('0x61')],'as':_0xd9ff('0x62')},{'model':db[_0xd9ff('0x61')],'as':'Descriptions'}]});}return null;})[_0xd9ff('0x32')](respondWithResult(_0x471e03,null))[_0xd9ff('0x25')](handleError(_0x471e03,null));};var md5=require('md5');exports[_0xd9ff('0x63')]=function(_0x2404ed,_0xf75739,_0x5d1973){var _0x432644=null;var _0x48f57d=null;var _0x1e46fc=null;var _0x478e0d=null;var _0x3b2848='';return db[_0xd9ff('0x4a')][_0xd9ff('0x56')]({'where':{'id':_0x2404ed[_0xd9ff('0x4e')]['id']},'attributes':['id',_0xd9ff('0x36'),_0xd9ff('0x64'),_0xd9ff('0x65'),_0xd9ff('0x66'),_0xd9ff('0x67'),_0xd9ff('0x68'),'accessKey']})[_0xd9ff('0x32')](handleEntityNotFound(_0xf75739,null))[_0xd9ff('0x32')](function(_0x1f6cb9){if(_0x1f6cb9){_0x432644=_0x1f6cb9[_0xd9ff('0x64')];_0x48f57d=_0x1f6cb9[_0xd9ff('0x69')];_0x1e46fc=_0x1f6cb9[_0xd9ff('0x66')];_0x3b2848=_0x1f6cb9['remoteUri'];var _0x4b2b32=_0x3b2848[_0xd9ff('0x6a')](-0x1);if(_0x4b2b32==='/'){_0x3b2848=_0x3b2848[_0xd9ff('0x6b')](0x0,_0x3b2848[_0xd9ff('0x6c')](_0x4b2b32));}_0x478e0d=util[_0xd9ff('0x6d')](_0xd9ff('0x6e'),_0x3b2848);var _0x183199={'method':'GET','uri':_0x478e0d,'qs':{'operation':_0xd9ff('0x6f'),'username':_0x1f6cb9[_0xd9ff('0x64')]},'json':!![]};return rp(_0x183199);}})[_0xd9ff('0x32')](function(_0x3d4953){if(_0x3d4953[_0xd9ff('0x70')]){var _0x32aa19={'method':'POST','uri':_0x478e0d,'form':{'operation':_0xd9ff('0x71'),'username':_0x432644,'accessKey':md5(_0x3d4953[_0xd9ff('0x24')][_0xd9ff('0x72')]+_0x48f57d)},'json':!![]};return rp(_0x32aa19);}})[_0xd9ff('0x32')](function(_0x373a32){if(_0x373a32[_0xd9ff('0x70')]){var _0x1c4fb6={'method':_0xd9ff('0x73'),'uri':_0x478e0d,'qs':{'operation':'describe','username':_0x432644,'sessionName':_0x373a32[_0xd9ff('0x24')]['sessionName'],'elementType':_0x1e46fc},'json':!![]};return rp(_0x1c4fb6);}})[_0xd9ff('0x32')](function(_0x304d1e){if(_0x304d1e[_0xd9ff('0x70')]){var _0x2d2d1c=[_0xd9ff('0x74'),_0xd9ff('0x75'),_0xd9ff('0x76')];_[_0xd9ff('0x77')](_0x304d1e[_0xd9ff('0x24')][_0xd9ff('0x41')],function(_0x44b20b){return _0x2d2d1c[_0xd9ff('0x78')](_0x44b20b[_0xd9ff('0x39')]['name']);});_[_0xd9ff('0x77')](_0x304d1e[_0xd9ff('0x24')][_0xd9ff('0x41')],function(_0x19ecf3){return _0x19ecf3['editable']===_0xd9ff('0x79');});return{'count':_0x304d1e[_0xd9ff('0x24')]['fields'][_0xd9ff('0x42')],'rows':_[_0xd9ff('0x3c')](_0x304d1e[_0xd9ff('0x24')][_0xd9ff('0x41')],function(_0x15f805){return{'id':_0x15f805[_0xd9ff('0x36')],'name':_0x15f805[_0xd9ff('0x7a')],'custom':_['startsWith'](_0x15f805[_0xd9ff('0x36')],'cf_')?!![]:![],'options':_0x15f805[_0xd9ff('0x39')][_0xd9ff('0x36')]===_0xd9ff('0x7b')&&_0x15f805[_0xd9ff('0x39')][_0xd9ff('0x7c')][_0xd9ff('0x42')]>0x0?_[_0xd9ff('0x3c')](_0x15f805[_0xd9ff('0x39')][_0xd9ff('0x7c')],function(_0x108583){return{'name':_0x108583[_0xd9ff('0x7a')],'value':_0x108583['value']};}):[]};})};}})[_0xd9ff('0x32')](respondWithResult(_0xf75739,null))[_0xd9ff('0x25')](function(_0x50b4aa){console[_0xd9ff('0x7d')](_0xd9ff('0x7e')+_0x50b4aa);var _0x3b3511=_0x2404ed[_0xd9ff('0x3d')][_0xd9ff('0x7f')]?0x1f4:_0x50b4aa[_0xd9ff('0x80')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xd9ff('0x63'),_0x3b3511,JSON['stringify'](_0x50b4aa));delete _0x50b4aa['name'];if(_0x3b3511===0x191){_0x3b3511=0x190;}_0xf75739['status'](_0x3b3511)['send'](_0x2404ed[_0xd9ff('0x3d')][_0xd9ff('0x7f')]?{'message':_0xd9ff('0x81'),'statusCode':_0x50b4aa['statusCode']}:_0x50b4aa);});}; \ No newline at end of file +var _0xaa88=['rawAttributes','include','find','create','body','destroy','getConfigurations','findOne','VtigerConfiguration','addConfiguration','params','AccountId','channel','type','Descriptions','getDescriptions','VtigerField','Subjects','md5','getFields','username','moduleName','remoteUri','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','login','token','describe','result','sessionName','includes','remove','editable','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','VtigerAccount','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show'];(function(_0x42e726,_0xf42a58){var _0x4c9629=function(_0x3b2703){while(--_0x3b2703){_0x42e726['push'](_0x42e726['shift']());}};_0x4c9629(++_0xf42a58);}(_0xaa88,0x137));var _0x8aa8=function(_0xdbb6cb,_0x3b8fda){_0xdbb6cb=_0xdbb6cb-0x0;var _0x476b50=_0xaa88[_0xdbb6cb];return _0x476b50;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));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 licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];var integrations=require(_0x8aa8('0x19'));var jayson=require(_0x8aa8('0x1a'));var client=jayson['client'][_0x8aa8('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x179e33,_0x2fa66f,_0x4b686e,_0x391642){return new BPromise(function(_0x4af534,_0x4f3a2e){var _0x433e95=_0x391642||client;return _0x433e95[_0x8aa8('0x1c')](_0x179e33,_0x4b686e)[_0x8aa8('0x1d')](function(_0xa6c2af){logger[_0x8aa8('0x1e')](_0x8aa8('0x1f'),_0x2fa66f,_0x8aa8('0x20'));logger[_0x8aa8('0x21')](_0x8aa8('0x22'),_0x2fa66f,'request\x20sent',JSON['stringify'](_0xa6c2af));if(_0xa6c2af[_0x8aa8('0x23')]){if(_0xa6c2af['error']['code']===0x1f4){logger[_0x8aa8('0x23')]('VtigerAccount,\x20%s,\x20%s',_0x2fa66f,_0xa6c2af[_0x8aa8('0x23')][_0x8aa8('0x24')]);return _0x4f3a2e(_0xa6c2af[_0x8aa8('0x23')][_0x8aa8('0x24')]);}logger['error'](_0x8aa8('0x1f'),_0x2fa66f,_0xa6c2af[_0x8aa8('0x23')][_0x8aa8('0x24')]);return _0x4af534(_0xa6c2af[_0x8aa8('0x23')][_0x8aa8('0x24')]);}else{logger[_0x8aa8('0x1e')]('VtigerAccount,\x20%s,\x20%s',_0x2fa66f,_0x8aa8('0x20'));_0x4af534(_0xa6c2af['result'][_0x8aa8('0x24')]);}})['catch'](function(_0x2c1828){logger['error'](_0x8aa8('0x1f'),_0x2fa66f,_0x2c1828);_0x4f3a2e(_0x2c1828);});});}function respondWithStatusCode(_0x40adb5,_0x3ca7dc){_0x3ca7dc=_0x3ca7dc||0xcc;return function(_0x5e5d91){if(_0x5e5d91){return _0x40adb5[_0x8aa8('0x25')](_0x3ca7dc);}return _0x40adb5[_0x8aa8('0x26')](_0x3ca7dc)[_0x8aa8('0x27')]();};}function respondWithResult(_0x547a7b,_0x57acd2){_0x57acd2=_0x57acd2||0xc8;return function(_0x2d1508){if(_0x2d1508){return _0x547a7b[_0x8aa8('0x26')](_0x57acd2)[_0x8aa8('0x28')](_0x2d1508);}};}function respondWithFilteredResult(_0x3a3c7a,_0x24143e){return function(_0x4a8212){if(_0x4a8212){var _0x2bc34a=typeof _0x24143e['offset']===_0x8aa8('0x29')&&typeof _0x24143e[_0x8aa8('0x2a')]===_0x8aa8('0x29');var _0x519ac0=_0x4a8212['count'];var _0x10810d=_0x2bc34a?0x0:_0x24143e['offset'];var _0x385208=_0x2bc34a?_0x4a8212[_0x8aa8('0x2b')]:_0x24143e[_0x8aa8('0x2c')]+_0x24143e[_0x8aa8('0x2a')];var _0xe07a83;if(_0x385208>=_0x519ac0){_0x385208=_0x519ac0;_0xe07a83=0xc8;}else{_0xe07a83=0xce;}_0x3a3c7a['status'](_0xe07a83);return _0x3a3c7a[_0x8aa8('0x2d')](_0x8aa8('0x2e'),_0x10810d+'-'+_0x385208+'/'+_0x519ac0)['json'](_0x4a8212);}return null;};}function patchUpdates(_0x99f74e){return function(_0xee2f61){try{jsonpatch[_0x8aa8('0x2f')](_0xee2f61,_0x99f74e,!![]);}catch(_0x5b6d5d){return BPromise[_0x8aa8('0x30')](_0x5b6d5d);}return _0xee2f61[_0x8aa8('0x31')]();};}function saveUpdates(_0x23a37c,_0x423b02){return function(_0x1313f8){if(_0x1313f8){return _0x1313f8[_0x8aa8('0x32')](_0x23a37c)[_0x8aa8('0x1d')](function(_0xcad4f8){return _0xcad4f8;});}return null;};}function removeEntity(_0x354375,_0x3a257c){return function(_0x3e069a){if(_0x3e069a){return _0x3e069a['destroy']()['then'](function(){_0x354375[_0x8aa8('0x26')](0xcc)[_0x8aa8('0x27')]();});}};}function handleEntityNotFound(_0x201d8d,_0x106ccb){return function(_0xbe7639){if(!_0xbe7639){_0x201d8d[_0x8aa8('0x25')](0x194);}return _0xbe7639;};}function handleError(_0x4b6f91,_0x4b8118){_0x4b8118=_0x4b8118||0x1f4;return function(_0x19ed76){logger['error'](_0x19ed76[_0x8aa8('0x33')]);if(_0x19ed76[_0x8aa8('0x34')]){delete _0x19ed76[_0x8aa8('0x34')];}_0x4b6f91['status'](_0x4b8118)[_0x8aa8('0x35')](_0x19ed76);};}exports[_0x8aa8('0x36')]=function(_0x231e29,_0x5c28fa){var _0x526779={},_0x22b511={},_0x1f90fc={'count':0x0,'rows':[]};var _0x52f87d=_[_0x8aa8('0x37')](db[_0x8aa8('0x38')]['rawAttributes'],function(_0x3bbdd5){return{'name':_0x3bbdd5['fieldName'],'type':_0x3bbdd5['type'][_0x8aa8('0x39')]};});_0x22b511['model']=_[_0x8aa8('0x37')](_0x52f87d,_0x8aa8('0x34'));_0x22b511[_0x8aa8('0x3a')]=_[_0x8aa8('0x3b')](_0x231e29['query']);_0x22b511[_0x8aa8('0x3c')]=_[_0x8aa8('0x3d')](_0x22b511['model'],_0x22b511[_0x8aa8('0x3a')]);_0x526779[_0x8aa8('0x3e')]=_['intersection'](_0x22b511[_0x8aa8('0x3f')],qs[_0x8aa8('0x40')](_0x231e29[_0x8aa8('0x3a')][_0x8aa8('0x40')]));_0x526779[_0x8aa8('0x3e')]=_0x526779[_0x8aa8('0x3e')][_0x8aa8('0x41')]?_0x526779[_0x8aa8('0x3e')]:_0x22b511[_0x8aa8('0x3f')];if(!_0x231e29[_0x8aa8('0x3a')][_0x8aa8('0x42')](_0x8aa8('0x43'))){_0x526779[_0x8aa8('0x2a')]=qs[_0x8aa8('0x2a')](_0x231e29[_0x8aa8('0x3a')][_0x8aa8('0x2a')]);_0x526779['offset']=qs[_0x8aa8('0x2c')](_0x231e29['query']['offset']);}_0x526779['order']=qs[_0x8aa8('0x44')](_0x231e29['query']['sort']);_0x526779[_0x8aa8('0x45')]=qs['filters'](_[_0x8aa8('0x46')](_0x231e29['query'],_0x22b511['filters']),_0x52f87d);if(_0x231e29[_0x8aa8('0x3a')][_0x8aa8('0x47')]){_0x526779[_0x8aa8('0x45')]=_[_0x8aa8('0x48')](_0x526779[_0x8aa8('0x45')],{'$or':_[_0x8aa8('0x37')](_0x52f87d,function(_0x9618e3){if(_0x9618e3['type']!==_0x8aa8('0x49')){var _0x53a7a4={};_0x53a7a4[_0x9618e3[_0x8aa8('0x34')]]={'$like':'%'+_0x231e29[_0x8aa8('0x3a')][_0x8aa8('0x47')]+'%'};return _0x53a7a4;}})});}_0x526779=_[_0x8aa8('0x48')]({},_0x526779,_0x231e29[_0x8aa8('0x4a')]);var _0x44f2b4={'where':_0x526779['where']};return db['VtigerAccount'][_0x8aa8('0x2b')](_0x44f2b4)[_0x8aa8('0x1d')](function(_0x5e1d3a){_0x1f90fc[_0x8aa8('0x2b')]=_0x5e1d3a;if(_0x231e29[_0x8aa8('0x3a')][_0x8aa8('0x4b')]){_0x526779['include']=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x526779);})['then'](function(_0x2bd2ae){_0x1f90fc[_0x8aa8('0x4c')]=_0x2bd2ae;return _0x1f90fc;})['then'](respondWithFilteredResult(_0x5c28fa,_0x526779))[_0x8aa8('0x4d')](handleError(_0x5c28fa,null));};exports[_0x8aa8('0x4e')]=function(_0x20a463,_0x1aa1b6){var _0x20384a={'raw':![],'where':{'id':_0x20a463['params']['id']}},_0x6a6f93={};_0x6a6f93['model']=_[_0x8aa8('0x3b')](db['VtigerAccount'][_0x8aa8('0x4f')]);_0x6a6f93['query']=_[_0x8aa8('0x3b')](_0x20a463[_0x8aa8('0x3a')]);_0x6a6f93[_0x8aa8('0x3c')]=_[_0x8aa8('0x3d')](_0x6a6f93[_0x8aa8('0x3f')],_0x6a6f93[_0x8aa8('0x3a')]);_0x20384a[_0x8aa8('0x3e')]=_[_0x8aa8('0x3d')](_0x6a6f93[_0x8aa8('0x3f')],qs[_0x8aa8('0x40')](_0x20a463[_0x8aa8('0x3a')][_0x8aa8('0x40')]));_0x20384a['attributes']=_0x20384a[_0x8aa8('0x3e')]['length']?_0x20384a['attributes']:_0x6a6f93['model'];if(_0x20a463[_0x8aa8('0x3a')]['includeAll']){_0x20384a[_0x8aa8('0x50')]=[{'all':!![]}];}_0x20384a=_[_0x8aa8('0x48')]({},_0x20384a,_0x20a463[_0x8aa8('0x4a')]);return db['VtigerAccount'][_0x8aa8('0x51')](_0x20384a)[_0x8aa8('0x1d')](handleEntityNotFound(_0x1aa1b6,null))[_0x8aa8('0x1d')](respondWithResult(_0x1aa1b6,null))[_0x8aa8('0x4d')](handleError(_0x1aa1b6,null));};exports['create']=function(_0x5f16d5,_0x334975){return db[_0x8aa8('0x38')][_0x8aa8('0x52')](_0x5f16d5[_0x8aa8('0x53')],{})['then'](respondWithResult(_0x334975,0xc9))['catch'](handleError(_0x334975,null));};exports[_0x8aa8('0x32')]=function(_0x1bd389,_0x26eb56){if(_0x1bd389['body']['id']){delete _0x1bd389[_0x8aa8('0x53')]['id'];}return db[_0x8aa8('0x38')]['find']({'where':{'id':_0x1bd389['params']['id']}})['then'](handleEntityNotFound(_0x26eb56,null))['then'](saveUpdates(_0x1bd389[_0x8aa8('0x53')],null))['then'](respondWithResult(_0x26eb56,null))[_0x8aa8('0x4d')](handleError(_0x26eb56,null));};exports[_0x8aa8('0x54')]=function(_0x57d247,_0x581baa){return db[_0x8aa8('0x38')][_0x8aa8('0x51')]({'where':{'id':_0x57d247['params']['id']}})['then'](handleEntityNotFound(_0x581baa,null))['then'](removeEntity(_0x581baa,null))[_0x8aa8('0x4d')](handleError(_0x581baa,null));};exports[_0x8aa8('0x55')]=function(_0x570f6a,_0x5ef6b1,_0x20feaf){var _0x18f5c6={};var _0x5ac786={};var _0x3b141c;var _0x43e352;return db['VtigerAccount'][_0x8aa8('0x56')]({'where':{'id':_0x570f6a['params']['id']}})[_0x8aa8('0x1d')](handleEntityNotFound(_0x5ef6b1,null))['then'](function(_0x26f771){if(_0x26f771){_0x3b141c=_0x26f771;_0x5ac786[_0x8aa8('0x3f')]=_[_0x8aa8('0x3b')](db[_0x8aa8('0x57')][_0x8aa8('0x4f')]);_0x5ac786['query']=_[_0x8aa8('0x3b')](_0x570f6a[_0x8aa8('0x3a')]);_0x5ac786[_0x8aa8('0x3c')]=_[_0x8aa8('0x3d')](_0x5ac786['model'],_0x5ac786[_0x8aa8('0x3a')]);_0x18f5c6[_0x8aa8('0x3e')]=_['intersection'](_0x5ac786[_0x8aa8('0x3f')],qs[_0x8aa8('0x40')](_0x570f6a[_0x8aa8('0x3a')][_0x8aa8('0x40')]));_0x18f5c6[_0x8aa8('0x3e')]=_0x18f5c6[_0x8aa8('0x3e')][_0x8aa8('0x41')]?_0x18f5c6['attributes']:_0x5ac786['model'];_0x18f5c6['order']=qs[_0x8aa8('0x44')](_0x570f6a[_0x8aa8('0x3a')][_0x8aa8('0x44')]);_0x18f5c6[_0x8aa8('0x45')]=qs[_0x8aa8('0x3c')](_[_0x8aa8('0x46')](_0x570f6a[_0x8aa8('0x3a')],_0x5ac786[_0x8aa8('0x3c')]));if(_0x570f6a[_0x8aa8('0x3a')][_0x8aa8('0x47')]){_0x18f5c6[_0x8aa8('0x45')]=_[_0x8aa8('0x48')](_0x18f5c6[_0x8aa8('0x45')],{'$or':_[_0x8aa8('0x37')](_0x18f5c6[_0x8aa8('0x3e')],function(_0x36523a){var _0x84c520={};_0x84c520[_0x36523a]={'$like':'%'+_0x570f6a[_0x8aa8('0x3a')][_0x8aa8('0x47')]+'%'};return _0x84c520;})});}_0x18f5c6=_['merge']({},_0x18f5c6,_0x570f6a[_0x8aa8('0x4a')]);return _0x3b141c[_0x8aa8('0x55')](_0x18f5c6);}})[_0x8aa8('0x1d')](function(_0x1f2b70){if(_0x1f2b70){_0x43e352=_0x1f2b70[_0x8aa8('0x41')];if(!_0x570f6a[_0x8aa8('0x3a')][_0x8aa8('0x42')](_0x8aa8('0x43'))){_0x18f5c6[_0x8aa8('0x2a')]=qs['limit'](_0x570f6a[_0x8aa8('0x3a')][_0x8aa8('0x2a')]);_0x18f5c6['offset']=qs[_0x8aa8('0x2c')](_0x570f6a['query'][_0x8aa8('0x2c')]);}return _0x3b141c[_0x8aa8('0x55')](_0x18f5c6);}})['then'](function(_0x2fcdf2){if(_0x2fcdf2){return _0x2fcdf2?{'count':_0x43e352,'rows':_0x2fcdf2}:null;}})[_0x8aa8('0x1d')](respondWithResult(_0x5ef6b1,null))[_0x8aa8('0x4d')](handleError(_0x5ef6b1,null));};exports[_0x8aa8('0x58')]=function(_0xd136db,_0x27e3af,_0x7236f9){if(_0xd136db['body']['id']){delete _0xd136db[_0x8aa8('0x53')]['id'];}return db[_0x8aa8('0x38')][_0x8aa8('0x56')]({'where':{'id':_0xd136db[_0x8aa8('0x59')]['id']}})['then'](handleEntityNotFound(_0x27e3af,null))['then'](function(_0x284600){if(_0x284600){_0xd136db[_0x8aa8('0x53')][_0x8aa8('0x5a')]=_0x284600['id'];_0xd136db[_0x8aa8('0x53')]['Subjects']=integrations['getSubjects'](_0xd136db['body'][_0x8aa8('0x5b')],_0xd136db[_0x8aa8('0x53')][_0x8aa8('0x5c')]);_0xd136db[_0x8aa8('0x53')][_0x8aa8('0x5d')]=integrations[_0x8aa8('0x5e')](_0xd136db[_0x8aa8('0x53')][_0x8aa8('0x5b')],_0xd136db[_0x8aa8('0x53')]['type']);return db[_0x8aa8('0x57')]['create'](_0xd136db['body'],{'include':[{'model':db[_0x8aa8('0x5f')],'as':_0x8aa8('0x60')},{'model':db[_0x8aa8('0x5f')],'as':'Descriptions'}]});}return null;})[_0x8aa8('0x1d')](respondWithResult(_0x27e3af,null))['catch'](handleError(_0x27e3af,null));};var md5=require(_0x8aa8('0x61'));exports[_0x8aa8('0x62')]=function(_0x46a637,_0xdb62e7,_0x4685cf){var _0x5d1c8e=null;var _0x5d504c=null;var _0x11d2e9=null;var _0x12d40e=null;var _0x4122eb='';return db[_0x8aa8('0x38')][_0x8aa8('0x56')]({'where':{'id':_0x46a637[_0x8aa8('0x59')]['id']},'attributes':['id',_0x8aa8('0x34'),_0x8aa8('0x63'),'description',_0x8aa8('0x64'),_0x8aa8('0x65'),'serverUrl','accessKey']})[_0x8aa8('0x1d')](handleEntityNotFound(_0xdb62e7,null))[_0x8aa8('0x1d')](function(_0x505100){if(_0x505100){_0x5d1c8e=_0x505100[_0x8aa8('0x63')];_0x5d504c=_0x505100[_0x8aa8('0x66')];_0x11d2e9=_0x505100[_0x8aa8('0x64')];_0x4122eb=_0x505100['remoteUri'];var _0x4d213b=_0x4122eb['slice'](-0x1);if(_0x4d213b==='/'){_0x4122eb=_0x4122eb[_0x8aa8('0x67')](0x0,_0x4122eb[_0x8aa8('0x68')](_0x4d213b));}_0x12d40e=util[_0x8aa8('0x69')](_0x8aa8('0x6a'),_0x4122eb);var _0x4875d0={'method':_0x8aa8('0x6b'),'uri':_0x12d40e,'qs':{'operation':_0x8aa8('0x6c'),'username':_0x505100[_0x8aa8('0x63')]},'json':!![]};return rp(_0x4875d0);}})[_0x8aa8('0x1d')](function(_0x5bfcb3){if(_0x5bfcb3[_0x8aa8('0x6d')]){var _0x5714b7={'method':'POST','uri':_0x12d40e,'form':{'operation':_0x8aa8('0x6e'),'username':_0x5d1c8e,'accessKey':md5(_0x5bfcb3['result'][_0x8aa8('0x6f')]+_0x5d504c)},'json':!![]};return rp(_0x5714b7);}})[_0x8aa8('0x1d')](function(_0x2a7e7f){if(_0x2a7e7f['success']){var _0x46507d={'method':_0x8aa8('0x6b'),'uri':_0x12d40e,'qs':{'operation':_0x8aa8('0x70'),'username':_0x5d1c8e,'sessionName':_0x2a7e7f[_0x8aa8('0x71')][_0x8aa8('0x72')],'elementType':_0x11d2e9},'json':!![]};return rp(_0x46507d);}})[_0x8aa8('0x1d')](function(_0x49f4de){if(_0x49f4de['success']){var _0x839d86=['autogenerated','reference','owner'];_['remove'](_0x49f4de['result'][_0x8aa8('0x40')],function(_0x26092c){return _0x839d86[_0x8aa8('0x73')](_0x26092c[_0x8aa8('0x5c')][_0x8aa8('0x34')]);});_[_0x8aa8('0x74')](_0x49f4de[_0x8aa8('0x71')][_0x8aa8('0x40')],function(_0x1582bd){return _0x1582bd[_0x8aa8('0x75')]==='false';});return{'count':_0x49f4de['result'][_0x8aa8('0x40')][_0x8aa8('0x41')],'rows':_[_0x8aa8('0x37')](_0x49f4de[_0x8aa8('0x71')][_0x8aa8('0x40')],function(_0x227591){return{'id':_0x227591[_0x8aa8('0x34')],'name':_0x227591[_0x8aa8('0x76')],'custom':_['startsWith'](_0x227591[_0x8aa8('0x34')],_0x8aa8('0x77'))?!![]:![],'options':_0x227591[_0x8aa8('0x5c')]['name']===_0x8aa8('0x78')&&_0x227591[_0x8aa8('0x5c')]['picklistValues'][_0x8aa8('0x41')]>0x0?_[_0x8aa8('0x37')](_0x227591[_0x8aa8('0x5c')][_0x8aa8('0x79')],function(_0x384a39){return{'name':_0x384a39['label'],'value':_0x384a39[_0x8aa8('0x7a')]};}):[]};})};}})[_0x8aa8('0x1d')](respondWithResult(_0xdb62e7,null))[_0x8aa8('0x4d')](function(_0x47b4db){console[_0x8aa8('0x7b')](_0x8aa8('0x7c')+_0x47b4db);var _0x786047=_0x46a637[_0x8aa8('0x3a')][_0x8aa8('0x7d')]?0x1f4:_0x47b4db[_0x8aa8('0x7e')]||0x1f4;logger['error'](_0x8aa8('0x7f'),'getFields',_0x786047,JSON[_0x8aa8('0x80')](_0x47b4db));delete _0x47b4db[_0x8aa8('0x34')];if(_0x786047===0x191){_0x786047=0x190;}_0xdb62e7[_0x8aa8('0x26')](_0x786047)[_0x8aa8('0x35')](_0x46a637[_0x8aa8('0x3a')]['test']?{'message':_0x8aa8('0x81'),'statusCode':_0x47b4db[_0x8aa8('0x7e')]}:_0x47b4db);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index eab8246..772db37 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 _0x9d99=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x3c41c1,_0x460f61){var _0x3ebc17=function(_0x46c2b5){while(--_0x46c2b5){_0x3c41c1['push'](_0x3c41c1['shift']());}};_0x3ebc17(++_0x460f61);}(_0x9d99,0x158));var _0x99d9=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x9d99[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0x99d9('0x0'));var util=require(_0x99d9('0x1'));var logger=require(_0x99d9('0x2'))(_0x99d9('0x3'));var moment=require('moment');var BPromise=require(_0x99d9('0x4'));var rp=require(_0x99d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99d9('0x6'));var config=require(_0x99d9('0x7'));var attributes=require(_0x99d9('0x8'));var integrations=require(_0x99d9('0x9'));module[_0x99d9('0xa')]=function(_0x19f1c2,_0x1d36b8){return _0x19f1c2[_0x99d9('0xb')](_0x99d9('0xc'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20c6=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','define','VtigerAccount','lodash','util'];(function(_0x22e49d,_0x173e40){var _0xe00a10=function(_0x15afee){while(--_0x15afee){_0x22e49d['push'](_0x22e49d['shift']());}};_0xe00a10(++_0x173e40);}(_0x20c6,0xdb));var _0x620c=function(_0x370de9,_0x57af01){_0x370de9=_0x370de9-0x0;var _0x1a43ee=_0x20c6[_0x370de9];return _0x1a43ee;};'use strict';var _=require(_0x620c('0x0'));var util=require(_0x620c('0x1'));var logger=require(_0x620c('0x2'))(_0x620c('0x3'));var moment=require(_0x620c('0x4'));var BPromise=require(_0x620c('0x5'));var rp=require(_0x620c('0x6'));var fs=require('fs');var path=require(_0x620c('0x7'));var rimraf=require(_0x620c('0x8'));var config=require(_0x620c('0x9'));var attributes=require(_0x620c('0xa'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x1031c4,_0x323c95){return _0x1031c4[_0x620c('0xb')](_0x620c('0xc'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index d77f34d..15b7255 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 _0x79c4=['jayson/promise','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','raw','options','attributes','include','map','model','ShowVtigerAccount','find','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x79c4,0x11c));var _0x479c=function(_0x2ce645,_0x2943bc){_0x2ce645=_0x2ce645-0x0;var _0xbbbcaa=_0x79c4[_0x2ce645];return _0xbbbcaa;};'use strict';var _=require('lodash');var util=require(_0x479c('0x0'));var moment=require(_0x479c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x479c('0x2'));var db=require(_0x479c('0x3'))['db'];var utils=require(_0x479c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x479c('0x5'));var jayson=require(_0x479c('0x6'));var client=jayson['client'][_0x479c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x175f61,_0x4c40fb,_0x4a8c66){return new BPromise(function(_0x3e6f67,_0x5c67ed){return client['request'](_0x175f61,_0x4a8c66)[_0x479c('0x8')](function(_0x558967){logger[_0x479c('0x9')](_0x479c('0xa'),_0x4c40fb,_0x479c('0xb'));logger[_0x479c('0xc')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4c40fb,'request\x20sent',JSON['stringify'](_0x558967));if(_0x558967[_0x479c('0xd')]){if(_0x558967['error'][_0x479c('0xe')]===0x1f4){logger[_0x479c('0xd')](_0x479c('0xa'),_0x4c40fb,_0x558967['error']['message']);return _0x5c67ed(_0x558967[_0x479c('0xd')]['message']);}logger[_0x479c('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x4c40fb,_0x558967[_0x479c('0xd')][_0x479c('0xf')]);return _0x3e6f67(_0x558967[_0x479c('0xd')][_0x479c('0xf')]);}else{logger['info'](_0x479c('0xa'),_0x4c40fb,_0x479c('0xb'));_0x3e6f67(_0x558967[_0x479c('0x10')][_0x479c('0xf')]);}})[_0x479c('0x11')](function(_0x76cfef){logger[_0x479c('0xd')](_0x479c('0xa'),_0x4c40fb,_0x76cfef);_0x5c67ed(_0x76cfef);});});}exports[_0x479c('0x12')]=function(_0xdab02){var _0x187940=this;return new Promise(function(_0x12642d,_0x49222c){return db[_0x479c('0x13')][_0x479c('0x14')]({'raw':_0xdab02['options']?_0xdab02['options'][_0x479c('0x15')]===undefined?!![]:![]:!![],'where':_0xdab02[_0x479c('0x16')]?_0xdab02[_0x479c('0x16')]['where']||null:null,'attributes':_0xdab02[_0x479c('0x16')]?_0xdab02[_0x479c('0x16')][_0x479c('0x17')]||null:null,'limit':_0xdab02[_0x479c('0x16')]?_0xdab02[_0x479c('0x16')]['limit']||null:null,'include':_0xdab02[_0x479c('0x16')]?_0xdab02[_0x479c('0x16')][_0x479c('0x18')]?_[_0x479c('0x19')](_0xdab02[_0x479c('0x16')][_0x479c('0x18')],function(_0x9c97b){return{'model':db[_0x9c97b[_0x479c('0x1a')]],'as':_0x9c97b['as'],'attributes':_0x9c97b[_0x479c('0x17')],'include':_0x9c97b[_0x479c('0x18')]?_[_0x479c('0x19')](_0x9c97b[_0x479c('0x18')],function(_0x39fe2b){return{'model':db[_0x39fe2b[_0x479c('0x1a')]],'as':_0x39fe2b['as'],'attributes':_0x39fe2b[_0x479c('0x17')],'include':_0x39fe2b['include']?_[_0x479c('0x19')](_0x39fe2b[_0x479c('0x18')],function(_0x50308d){return{'model':db[_0x50308d[_0x479c('0x1a')]],'as':_0x50308d['as'],'attributes':_0x50308d['attributes']};}):[]};}):[]};}):[]:[]})[_0x479c('0x8')](function(_0x2812c6){logger[_0x479c('0x9')](_0x479c('0x12'),_0xdab02);logger[_0x479c('0xc')]('GetVtigerAccount',_0xdab02,JSON['stringify'](_0x2812c6));_0x12642d(_0x2812c6);})[_0x479c('0x11')](function(_0x133e6e){logger['error']('GetVtigerAccount',_0x133e6e[_0x479c('0xf')],_0xdab02);_0x49222c(_0x187940[_0x479c('0xd')](0x1f4,_0x133e6e[_0x479c('0xf')]));});});};exports[_0x479c('0x1b')]=function(_0x1e3ab9){var _0x3b5872=this;return new Promise(function(_0x21c95c,_0x3841c8){return db[_0x479c('0x13')][_0x479c('0x1c')]({'raw':_0x1e3ab9[_0x479c('0x16')]?_0x1e3ab9[_0x479c('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1e3ab9['options']?_0x1e3ab9['options']['where']||null:null,'attributes':_0x1e3ab9[_0x479c('0x16')]?_0x1e3ab9[_0x479c('0x16')]['attributes']||null:null,'include':_0x1e3ab9['options']?_0x1e3ab9[_0x479c('0x16')][_0x479c('0x18')]?_[_0x479c('0x19')](_0x1e3ab9[_0x479c('0x16')][_0x479c('0x18')],function(_0x162149){return{'model':db[_0x162149['model']],'as':_0x162149['as'],'attributes':_0x162149['attributes'],'include':_0x162149[_0x479c('0x18')]?_[_0x479c('0x19')](_0x162149[_0x479c('0x18')],function(_0x122971){return{'model':db[_0x122971['model']],'as':_0x122971['as'],'attributes':_0x122971[_0x479c('0x17')],'include':_0x122971['include']?_[_0x479c('0x19')](_0x122971[_0x479c('0x18')],function(_0x10754d){return{'model':db[_0x10754d[_0x479c('0x1a')]],'as':_0x10754d['as'],'attributes':_0x10754d[_0x479c('0x17')]};}):[]};}):[]};}):[]:[]})[_0x479c('0x8')](function(_0x20cfb9){logger[_0x479c('0x9')]('ShowVtigerAccount',_0x1e3ab9);logger[_0x479c('0xc')](_0x479c('0x1b'),_0x1e3ab9,JSON['stringify'](_0x20cfb9));_0x21c95c(_0x20cfb9);})['catch'](function(_0x228ae0){logger[_0x479c('0xd')](_0x479c('0x1b'),_0x228ae0['message'],_0x1e3ab9);_0x3841c8(_0x3b5872['error'](0x1f4,_0x228ae0['message']));});});}; \ No newline at end of file +var _0x4a8c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','VtigerAccount','findAll','raw','options','where','attributes','include','map','model','GetVtigerAccount','debug','stringify','ShowVtigerAccount','find','lodash','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x4a8c,0xa5));var _0xc4a8=function(_0x4ebe9b,_0x2ea11d){_0x4ebe9b=_0x4ebe9b-0x0;var _0x2dbe82=_0x4a8c[_0x4ebe9b];return _0x2dbe82;};'use strict';var _=require(_0xc4a8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc4a8('0x1'));var rs=require(_0xc4a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc4a8('0x3'))['db'];var utils=require(_0xc4a8('0x4'));var logger=require(_0xc4a8('0x5'))(_0xc4a8('0x6'));var config=require(_0xc4a8('0x7'));var jayson=require(_0xc4a8('0x8'));var client=jayson[_0xc4a8('0x9')][_0xc4a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x275ba1,_0x3c74aa,_0x5d4915){return new BPromise(function(_0x22a9c3,_0x48b3f9){return client['request'](_0x275ba1,_0x5d4915)[_0xc4a8('0xb')](function(_0x57949d){logger[_0xc4a8('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x3c74aa,'request\x20sent');logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x3c74aa,_0xc4a8('0xd'),JSON['stringify'](_0x57949d));if(_0x57949d[_0xc4a8('0xe')]){if(_0x57949d[_0xc4a8('0xe')][_0xc4a8('0xf')]===0x1f4){logger[_0xc4a8('0xe')](_0xc4a8('0x10'),_0x3c74aa,_0x57949d['error']['message']);return _0x48b3f9(_0x57949d[_0xc4a8('0xe')][_0xc4a8('0x11')]);}logger[_0xc4a8('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x3c74aa,_0x57949d[_0xc4a8('0xe')][_0xc4a8('0x11')]);return _0x22a9c3(_0x57949d[_0xc4a8('0xe')]['message']);}else{logger[_0xc4a8('0xc')](_0xc4a8('0x10'),_0x3c74aa,'request\x20sent');_0x22a9c3(_0x57949d[_0xc4a8('0x12')]['message']);}})[_0xc4a8('0x13')](function(_0x283417){logger[_0xc4a8('0xe')](_0xc4a8('0x10'),_0x3c74aa,_0x283417);_0x48b3f9(_0x283417);});});}exports['GetVtigerAccount']=function(_0x451717){var _0x55314b=this;return new Promise(function(_0x1a9862,_0xa3ea8f){return db[_0xc4a8('0x14')][_0xc4a8('0x15')]({'raw':_0x451717['options']?_0x451717['options'][_0xc4a8('0x16')]===undefined?!![]:![]:!![],'where':_0x451717[_0xc4a8('0x17')]?_0x451717[_0xc4a8('0x17')][_0xc4a8('0x18')]||null:null,'attributes':_0x451717[_0xc4a8('0x17')]?_0x451717[_0xc4a8('0x17')][_0xc4a8('0x19')]||null:null,'limit':_0x451717[_0xc4a8('0x17')]?_0x451717[_0xc4a8('0x17')]['limit']||null:null,'include':_0x451717[_0xc4a8('0x17')]?_0x451717[_0xc4a8('0x17')][_0xc4a8('0x1a')]?_[_0xc4a8('0x1b')](_0x451717[_0xc4a8('0x17')][_0xc4a8('0x1a')],function(_0xed58ac){return{'model':db[_0xed58ac['model']],'as':_0xed58ac['as'],'attributes':_0xed58ac[_0xc4a8('0x19')],'include':_0xed58ac[_0xc4a8('0x1a')]?_[_0xc4a8('0x1b')](_0xed58ac['include'],function(_0x5ac60d){return{'model':db[_0x5ac60d[_0xc4a8('0x1c')]],'as':_0x5ac60d['as'],'attributes':_0x5ac60d[_0xc4a8('0x19')],'include':_0x5ac60d['include']?_[_0xc4a8('0x1b')](_0x5ac60d['include'],function(_0x1527f3){return{'model':db[_0x1527f3[_0xc4a8('0x1c')]],'as':_0x1527f3['as'],'attributes':_0x1527f3[_0xc4a8('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc4a8('0xb')](function(_0x39118d){logger[_0xc4a8('0xc')](_0xc4a8('0x1d'),_0x451717);logger[_0xc4a8('0x1e')](_0xc4a8('0x1d'),_0x451717,JSON[_0xc4a8('0x1f')](_0x39118d));_0x1a9862(_0x39118d);})['catch'](function(_0x528505){logger[_0xc4a8('0xe')](_0xc4a8('0x1d'),_0x528505[_0xc4a8('0x11')],_0x451717);_0xa3ea8f(_0x55314b[_0xc4a8('0xe')](0x1f4,_0x528505['message']));});});};exports[_0xc4a8('0x20')]=function(_0x2fb38c){var _0x17c710=this;return new Promise(function(_0x450e8b,_0x124fdd){return db[_0xc4a8('0x14')][_0xc4a8('0x21')]({'raw':_0x2fb38c[_0xc4a8('0x17')]?_0x2fb38c[_0xc4a8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2fb38c['options']?_0x2fb38c[_0xc4a8('0x17')][_0xc4a8('0x18')]||null:null,'attributes':_0x2fb38c['options']?_0x2fb38c[_0xc4a8('0x17')][_0xc4a8('0x19')]||null:null,'include':_0x2fb38c['options']?_0x2fb38c[_0xc4a8('0x17')][_0xc4a8('0x1a')]?_[_0xc4a8('0x1b')](_0x2fb38c[_0xc4a8('0x17')]['include'],function(_0x1515ab){return{'model':db[_0x1515ab[_0xc4a8('0x1c')]],'as':_0x1515ab['as'],'attributes':_0x1515ab['attributes'],'include':_0x1515ab[_0xc4a8('0x1a')]?_[_0xc4a8('0x1b')](_0x1515ab[_0xc4a8('0x1a')],function(_0x1b7232){return{'model':db[_0x1b7232[_0xc4a8('0x1c')]],'as':_0x1b7232['as'],'attributes':_0x1b7232[_0xc4a8('0x19')],'include':_0x1b7232[_0xc4a8('0x1a')]?_[_0xc4a8('0x1b')](_0x1b7232['include'],function(_0x36c390){return{'model':db[_0x36c390['model']],'as':_0x36c390['as'],'attributes':_0x36c390[_0xc4a8('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc4a8('0xb')](function(_0x271999){logger[_0xc4a8('0xc')](_0xc4a8('0x20'),_0x2fb38c);logger['debug'](_0xc4a8('0x20'),_0x2fb38c,JSON[_0xc4a8('0x1f')](_0x271999));_0x450e8b(_0x271999);})[_0xc4a8('0x13')](function(_0x5baa22){logger[_0xc4a8('0xe')](_0xc4a8('0x20'),_0x5baa22[_0xc4a8('0x11')],_0x2fb38c);_0x124fdd(_0x17c710['error'](0x1f4,_0x5baa22[_0xc4a8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index a3c5590..b5e3a1b 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 _0xc4aa=['getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0x12')]);router[_0xac4a('0x13')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x14')]);router[_0xac4a('0x15')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x16')]);module[_0xac4a('0x17')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0xb1de68,_0x4a194b){var _0x134f02=function(_0xb37976){while(--_0xb37976){_0xb1de68['push'](_0xb1de68['shift']());}};_0x134f02(++_0x4a194b);}(_0xadb5,0xad));var _0x5adb=function(_0x17af6d,_0x34e694){_0x17af6d=_0x17af6d-0x0;var _0x1800bb=_0xadb5[_0x17af6d];return _0x1800bb;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intVtigerConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 32aa20b..28a4b31 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 _0x55cc=['STRING','sequelize'];(function(_0x65ffa1,_0x14114b){var _0x1ab722=function(_0x135778){while(--_0x135778){_0x65ffa1['push'](_0x65ffa1['shift']());}};_0x1ab722(++_0x14114b);}(_0x55cc,0x7b));var _0xc55c=function(_0xe8c7e7,_0x46781f){_0xe8c7e7=_0xe8c7e7-0x0;var _0x276a8f=_0x55cc[_0xe8c7e7];return _0x276a8f;};'use strict';var Sequelize=require(_0xc55c('0x0'));module['exports']={'name':{'type':Sequelize[_0xc55c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6224=['STRING','exports'];(function(_0x10427a,_0x1dfe34){var _0x45e8e2=function(_0x3f5fca){while(--_0x3f5fca){_0x10427a['push'](_0x10427a['shift']());}};_0x45e8e2(++_0x1dfe34);}(_0x6224,0x189));var _0x4622=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0x6224[_0x3cae69];return _0x3128eb;};'use strict';var Sequelize=require('sequelize');module[_0x4622('0x0')]={'name':{'type':Sequelize[_0x4622('0x1')]},'description':{'type':Sequelize[_0x4622('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 4084736..2631bf0 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 _0x3694=['squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','client','http','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','save','update','destroy','then','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','VtigerConfiguration','findAll','rows','catch','show','params','rawAttributes','create','body','find','getFields','VtigerField','findOne','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x96be88,_0x2c01a4){var _0x1c14c0=function(_0x20aeff){while(--_0x20aeff){_0x96be88['push'](_0x96be88['shift']());}};_0x1c14c0(++_0x2c01a4);}(_0x3694,0x1ae));var _0x4369=function(_0x514714,_0x224dcf){_0x514714=_0x514714-0x0;var _0x23f4c2=_0x3694[_0x514714];return _0x23f4c2;};'use strict';var emlformat=require(_0x4369('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4369('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4369('0x2'));var moment=require(_0x4369('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4369('0x4'));var util=require('util');var path=require('path');var sox=require(_0x4369('0x5'));var csv=require(_0x4369('0x6'));var ejs=require(_0x4369('0x7'));var fs=require('fs');var fs_extra=require(_0x4369('0x8'));var _=require(_0x4369('0x9'));var squel=require(_0x4369('0xa'));var crypto=require('crypto');var jsforce=require(_0x4369('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4369('0x6'));var querystring=require('querystring');var Papa=require(_0x4369('0xc'));var Redis=require(_0x4369('0xd'));var authService=require(_0x4369('0xe'));var qs=require(_0x4369('0xf'));var as=require(_0x4369('0x10'));var hardwareService=require(_0x4369('0x11'));var logger=require(_0x4369('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x4369('0x13'));var licenseUtil=require(_0x4369('0x14'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x4369('0x15')][_0x4369('0x16')]({'port':0x232a});function respondWithRpcPromise(_0xa8d239,_0x2f412c,_0xe076a7,_0x223298){return new BPromise(function(_0x21c1a9,_0x22653f){var _0x31d0f8=_0x223298||client;return _0x31d0f8['request'](_0xa8d239,_0xe076a7)['then'](function(_0x58bfae){logger[_0x4369('0x17')](_0x4369('0x18'),_0x2f412c,'request\x20sent');logger[_0x4369('0x19')](_0x4369('0x1a'),_0x2f412c,_0x4369('0x1b'),JSON[_0x4369('0x1c')](_0x58bfae));if(_0x58bfae[_0x4369('0x1d')]){if(_0x58bfae[_0x4369('0x1d')][_0x4369('0x1e')]===0x1f4){logger['error'](_0x4369('0x18'),_0x2f412c,_0x58bfae[_0x4369('0x1d')][_0x4369('0x1f')]);return _0x22653f(_0x58bfae['error']['message']);}logger[_0x4369('0x1d')](_0x4369('0x18'),_0x2f412c,_0x58bfae['error'][_0x4369('0x1f')]);return _0x21c1a9(_0x58bfae[_0x4369('0x1d')]['message']);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x2f412c,_0x4369('0x1b'));_0x21c1a9(_0x58bfae[_0x4369('0x20')][_0x4369('0x1f')]);}})['catch'](function(_0x21fa3f){logger[_0x4369('0x1d')](_0x4369('0x18'),_0x2f412c,_0x21fa3f);_0x22653f(_0x21fa3f);});});}function respondWithStatusCode(_0x323159,_0x343e65){_0x343e65=_0x343e65||0xcc;return function(_0x24608d){if(_0x24608d){return _0x323159[_0x4369('0x21')](_0x343e65);}return _0x323159['status'](_0x343e65)[_0x4369('0x22')]();};}function respondWithResult(_0xa6c2de,_0xb2d868){_0xb2d868=_0xb2d868||0xc8;return function(_0x277496){if(_0x277496){return _0xa6c2de[_0x4369('0x23')](_0xb2d868)['json'](_0x277496);}};}function respondWithFilteredResult(_0x369049,_0xe09e7b){return function(_0x754fba){if(_0x754fba){var _0x2151d3=typeof _0xe09e7b[_0x4369('0x24')]===_0x4369('0x25')&&typeof _0xe09e7b['limit']===_0x4369('0x25');var _0xab0cb3=_0x754fba['count'];var _0x30f976=_0x2151d3?0x0:_0xe09e7b[_0x4369('0x24')];var _0x5409a2=_0x2151d3?_0x754fba[_0x4369('0x26')]:_0xe09e7b[_0x4369('0x24')]+_0xe09e7b[_0x4369('0x27')];var _0x27a339;if(_0x5409a2>=_0xab0cb3){_0x5409a2=_0xab0cb3;_0x27a339=0xc8;}else{_0x27a339=0xce;}_0x369049[_0x4369('0x23')](_0x27a339);return _0x369049[_0x4369('0x28')](_0x4369('0x29'),_0x30f976+'-'+_0x5409a2+'/'+_0xab0cb3)[_0x4369('0x2a')](_0x754fba);}return null;};}function patchUpdates(_0x2cd406){return function(_0x380d2b){try{jsonpatch['apply'](_0x380d2b,_0x2cd406,!![]);}catch(_0x3a0283){return BPromise['reject'](_0x3a0283);}return _0x380d2b[_0x4369('0x2b')]();};}function saveUpdates(_0x37ab77,_0x62e82c){return function(_0x475638){if(_0x475638){return _0x475638[_0x4369('0x2c')](_0x37ab77)['then'](function(_0x1b5b83){return _0x1b5b83;});}return null;};}function removeEntity(_0xe9cc1a,_0x311b07){return function(_0x1d4201){if(_0x1d4201){return _0x1d4201[_0x4369('0x2d')]()[_0x4369('0x2e')](function(){_0xe9cc1a[_0x4369('0x23')](0xcc)[_0x4369('0x22')]();});}};}function handleEntityNotFound(_0x13ddd9,_0x418a42){return function(_0x35d049){if(!_0x35d049){_0x13ddd9[_0x4369('0x21')](0x194);}return _0x35d049;};}function handleError(_0x2406c8,_0x56ee4b){_0x56ee4b=_0x56ee4b||0x1f4;return function(_0x5b5053){logger[_0x4369('0x1d')](_0x5b5053[_0x4369('0x2f')]);if(_0x5b5053['name']){delete _0x5b5053[_0x4369('0x30')];}_0x2406c8[_0x4369('0x23')](_0x56ee4b)[_0x4369('0x31')](_0x5b5053);};}exports[_0x4369('0x32')]=function(_0x464828,_0x428967){var _0x51f4c6={},_0x1f93ea={},_0x459b14={'count':0x0,'rows':[]};var _0x5e6edc=_[_0x4369('0x33')](db['VtigerConfiguration']['rawAttributes'],function(_0x3fda3f){return{'name':_0x3fda3f[_0x4369('0x34')],'type':_0x3fda3f[_0x4369('0x35')]['key']};});_0x1f93ea[_0x4369('0x36')]=_['map'](_0x5e6edc,_0x4369('0x30'));_0x1f93ea[_0x4369('0x37')]=_[_0x4369('0x38')](_0x464828[_0x4369('0x37')]);_0x1f93ea[_0x4369('0x39')]=_[_0x4369('0x3a')](_0x1f93ea[_0x4369('0x36')],_0x1f93ea[_0x4369('0x37')]);_0x51f4c6[_0x4369('0x3b')]=_[_0x4369('0x3a')](_0x1f93ea[_0x4369('0x36')],qs[_0x4369('0x3c')](_0x464828[_0x4369('0x37')][_0x4369('0x3c')]));_0x51f4c6[_0x4369('0x3b')]=_0x51f4c6['attributes'][_0x4369('0x3d')]?_0x51f4c6[_0x4369('0x3b')]:_0x1f93ea[_0x4369('0x36')];if(!_0x464828[_0x4369('0x37')][_0x4369('0x3e')](_0x4369('0x3f'))){_0x51f4c6[_0x4369('0x27')]=qs[_0x4369('0x27')](_0x464828['query']['limit']);_0x51f4c6[_0x4369('0x24')]=qs[_0x4369('0x24')](_0x464828[_0x4369('0x37')]['offset']);}_0x51f4c6[_0x4369('0x40')]=qs[_0x4369('0x41')](_0x464828['query'][_0x4369('0x41')]);_0x51f4c6[_0x4369('0x42')]=qs[_0x4369('0x39')](_[_0x4369('0x43')](_0x464828[_0x4369('0x37')],_0x1f93ea[_0x4369('0x39')]),_0x5e6edc);if(_0x464828[_0x4369('0x37')][_0x4369('0x44')]){_0x51f4c6[_0x4369('0x42')]=_[_0x4369('0x45')](_0x51f4c6[_0x4369('0x42')],{'$or':_[_0x4369('0x33')](_0x5e6edc,function(_0x355bda){if(_0x355bda['type']!==_0x4369('0x46')){var _0x4f5c54={};_0x4f5c54[_0x355bda[_0x4369('0x30')]]={'$like':'%'+_0x464828[_0x4369('0x37')][_0x4369('0x44')]+'%'};return _0x4f5c54;}})});}_0x51f4c6=_[_0x4369('0x45')]({},_0x51f4c6,_0x464828[_0x4369('0x47')]);var _0x39dcc1={'where':_0x51f4c6['where']};return db['VtigerConfiguration'][_0x4369('0x26')](_0x39dcc1)[_0x4369('0x2e')](function(_0x24487f){_0x459b14['count']=_0x24487f;if(_0x464828['query']['includeAll']){_0x51f4c6[_0x4369('0x48')]=[{'all':!![]}];}return db[_0x4369('0x49')][_0x4369('0x4a')](_0x51f4c6);})['then'](function(_0x34180d){_0x459b14[_0x4369('0x4b')]=_0x34180d;return _0x459b14;})['then'](respondWithFilteredResult(_0x428967,_0x51f4c6))[_0x4369('0x4c')](handleError(_0x428967,null));};exports[_0x4369('0x4d')]=function(_0x2ce1c0,_0x42a9eb){var _0x70c043={'raw':![],'where':{'id':_0x2ce1c0[_0x4369('0x4e')]['id']}},_0x543769={};_0x543769[_0x4369('0x36')]=_[_0x4369('0x38')](db[_0x4369('0x49')][_0x4369('0x4f')]);_0x543769[_0x4369('0x37')]=_[_0x4369('0x38')](_0x2ce1c0['query']);_0x543769[_0x4369('0x39')]=_[_0x4369('0x3a')](_0x543769[_0x4369('0x36')],_0x543769[_0x4369('0x37')]);_0x70c043[_0x4369('0x3b')]=_[_0x4369('0x3a')](_0x543769['model'],qs[_0x4369('0x3c')](_0x2ce1c0['query'][_0x4369('0x3c')]));_0x70c043[_0x4369('0x3b')]=_0x70c043[_0x4369('0x3b')]['length']?_0x70c043[_0x4369('0x3b')]:_0x543769[_0x4369('0x36')];if(_0x2ce1c0[_0x4369('0x37')]['includeAll']){_0x70c043[_0x4369('0x48')]=[{'all':!![]}];}_0x70c043=_[_0x4369('0x45')]({},_0x70c043,_0x2ce1c0[_0x4369('0x47')]);return db[_0x4369('0x49')]['find'](_0x70c043)[_0x4369('0x2e')](handleEntityNotFound(_0x42a9eb,null))['then'](respondWithResult(_0x42a9eb,null))['catch'](handleError(_0x42a9eb,null));};exports[_0x4369('0x50')]=function(_0x157244,_0x55b190){return db['VtigerConfiguration']['create'](_0x157244[_0x4369('0x51')],{})['then'](respondWithResult(_0x55b190,0xc9))[_0x4369('0x4c')](handleError(_0x55b190,null));};exports[_0x4369('0x2c')]=function(_0x1ecb59,_0x10d249){if(_0x1ecb59[_0x4369('0x51')]['id']){delete _0x1ecb59[_0x4369('0x51')]['id'];}return db[_0x4369('0x49')][_0x4369('0x52')]({'where':{'id':_0x1ecb59[_0x4369('0x4e')]['id']}})[_0x4369('0x2e')](handleEntityNotFound(_0x10d249,null))[_0x4369('0x2e')](saveUpdates(_0x1ecb59[_0x4369('0x51')],null))['then'](respondWithResult(_0x10d249,null))['catch'](handleError(_0x10d249,null));};exports[_0x4369('0x2d')]=function(_0x366a7b,_0x203eae){return db[_0x4369('0x49')]['find']({'where':{'id':_0x366a7b[_0x4369('0x4e')]['id']}})[_0x4369('0x2e')](handleEntityNotFound(_0x203eae,null))[_0x4369('0x2e')](removeEntity(_0x203eae,null))[_0x4369('0x4c')](handleError(_0x203eae,null));};exports[_0x4369('0x53')]=function(_0x18ba79,_0x3aa8e8,_0xf1cb7){var _0x26bb96={};var _0x47626c={};var _0x2cd102;var _0x392859;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x18ba79[_0x4369('0x4e')]['id']}})[_0x4369('0x2e')](handleEntityNotFound(_0x3aa8e8,null))[_0x4369('0x2e')](function(_0x5d4c30){if(_0x5d4c30){_0x2cd102=_0x5d4c30;_0x47626c['model']=_[_0x4369('0x38')](db[_0x4369('0x54')]['rawAttributes']);_0x47626c[_0x4369('0x37')]=_[_0x4369('0x38')](_0x18ba79['query']);_0x47626c[_0x4369('0x39')]=_['intersection'](_0x47626c['model'],_0x47626c[_0x4369('0x37')]);_0x26bb96[_0x4369('0x3b')]=_[_0x4369('0x3a')](_0x47626c[_0x4369('0x36')],qs[_0x4369('0x3c')](_0x18ba79[_0x4369('0x37')][_0x4369('0x3c')]));_0x26bb96[_0x4369('0x3b')]=_0x26bb96[_0x4369('0x3b')][_0x4369('0x3d')]?_0x26bb96[_0x4369('0x3b')]:_0x47626c[_0x4369('0x36')];_0x26bb96[_0x4369('0x40')]=qs[_0x4369('0x41')](_0x18ba79[_0x4369('0x37')][_0x4369('0x41')]);_0x26bb96['where']=qs[_0x4369('0x39')](_[_0x4369('0x43')](_0x18ba79['query'],_0x47626c[_0x4369('0x39')]));if(_0x18ba79['query']['filter']){_0x26bb96[_0x4369('0x42')]=_['merge'](_0x26bb96['where'],{'$or':_[_0x4369('0x33')](_0x26bb96['attributes'],function(_0xb008a7){var _0x2f22da={};_0x2f22da[_0xb008a7]={'$like':'%'+_0x18ba79[_0x4369('0x37')][_0x4369('0x44')]+'%'};return _0x2f22da;})});}_0x26bb96=_['merge']({},_0x26bb96,_0x18ba79[_0x4369('0x47')]);return _0x2cd102[_0x4369('0x53')](_0x26bb96);}})[_0x4369('0x2e')](function(_0x3e4e6b){if(_0x3e4e6b){_0x392859=_0x3e4e6b[_0x4369('0x3d')];if(!_0x18ba79['query'][_0x4369('0x3e')](_0x4369('0x3f'))){_0x26bb96[_0x4369('0x27')]=qs[_0x4369('0x27')](_0x18ba79[_0x4369('0x37')]['limit']);_0x26bb96[_0x4369('0x24')]=qs['offset'](_0x18ba79[_0x4369('0x37')][_0x4369('0x24')]);}return _0x2cd102[_0x4369('0x53')](_0x26bb96);}})[_0x4369('0x2e')](function(_0x5905f2){if(_0x5905f2){return _0x5905f2?{'count':_0x392859,'rows':_0x5905f2}:null;}})[_0x4369('0x2e')](respondWithResult(_0x3aa8e8,null))[_0x4369('0x4c')](handleError(_0x3aa8e8,null));};exports['getSubjects']=function(_0x37d610,_0x32d079,_0x42a1b5){var _0x522da5={};var _0x24f3ab={};var _0x1b9ba5;var _0x56d54;return db[_0x4369('0x49')][_0x4369('0x55')]({'where':{'id':_0x37d610[_0x4369('0x4e')]['id']}})[_0x4369('0x2e')](handleEntityNotFound(_0x32d079,null))[_0x4369('0x2e')](function(_0x22ad7f){if(_0x22ad7f){_0x1b9ba5=_0x22ad7f;_0x24f3ab[_0x4369('0x36')]=_[_0x4369('0x38')](db['VtigerField'][_0x4369('0x4f')]);_0x24f3ab[_0x4369('0x37')]=_[_0x4369('0x38')](_0x37d610[_0x4369('0x37')]);_0x24f3ab[_0x4369('0x39')]=_['intersection'](_0x24f3ab[_0x4369('0x36')],_0x24f3ab[_0x4369('0x37')]);_0x522da5[_0x4369('0x3b')]=_[_0x4369('0x3a')](_0x24f3ab['model'],qs[_0x4369('0x3c')](_0x37d610['query'][_0x4369('0x3c')]));_0x522da5[_0x4369('0x3b')]=_0x522da5[_0x4369('0x3b')][_0x4369('0x3d')]?_0x522da5['attributes']:_0x24f3ab[_0x4369('0x36')];_0x522da5[_0x4369('0x40')]=qs[_0x4369('0x41')](_0x37d610[_0x4369('0x37')][_0x4369('0x41')]);_0x522da5[_0x4369('0x42')]=qs[_0x4369('0x39')](_['pick'](_0x37d610[_0x4369('0x37')],_0x24f3ab[_0x4369('0x39')]));if(_0x37d610[_0x4369('0x37')][_0x4369('0x44')]){_0x522da5['where']=_[_0x4369('0x45')](_0x522da5[_0x4369('0x42')],{'$or':_[_0x4369('0x33')](_0x522da5[_0x4369('0x3b')],function(_0x48a3ef){var _0x530afc={};_0x530afc[_0x48a3ef]={'$like':'%'+_0x37d610[_0x4369('0x37')][_0x4369('0x44')]+'%'};return _0x530afc;})});}_0x522da5=_[_0x4369('0x45')]({},_0x522da5,_0x37d610[_0x4369('0x47')]);return _0x1b9ba5[_0x4369('0x56')](_0x522da5);}})['then'](function(_0x27c359){if(_0x27c359){_0x56d54=_0x27c359[_0x4369('0x3d')];if(!_0x37d610[_0x4369('0x37')][_0x4369('0x3e')](_0x4369('0x3f'))){_0x522da5[_0x4369('0x27')]=qs[_0x4369('0x27')](_0x37d610[_0x4369('0x37')][_0x4369('0x27')]);_0x522da5['offset']=qs[_0x4369('0x24')](_0x37d610[_0x4369('0x37')][_0x4369('0x24')]);}return _0x1b9ba5['getSubjects'](_0x522da5);}})['then'](function(_0x9bc40c){if(_0x9bc40c){return _0x9bc40c?{'count':_0x56d54,'rows':_0x9bc40c}:null;}})['then'](respondWithResult(_0x32d079,null))[_0x4369('0x4c')](handleError(_0x32d079,null));};exports['getDescriptions']=function(_0x1859c6,_0x522a31,_0x46cb0b){var _0x3e840e={};var _0x176cb3={};var _0x249922;var _0x5a1e27;return db[_0x4369('0x49')][_0x4369('0x55')]({'where':{'id':_0x1859c6[_0x4369('0x4e')]['id']}})['then'](handleEntityNotFound(_0x522a31,null))[_0x4369('0x2e')](function(_0x33a550){if(_0x33a550){_0x249922=_0x33a550;_0x176cb3['model']=_[_0x4369('0x38')](db[_0x4369('0x54')][_0x4369('0x4f')]);_0x176cb3['query']=_['keys'](_0x1859c6['query']);_0x176cb3[_0x4369('0x39')]=_[_0x4369('0x3a')](_0x176cb3[_0x4369('0x36')],_0x176cb3[_0x4369('0x37')]);_0x3e840e[_0x4369('0x3b')]=_[_0x4369('0x3a')](_0x176cb3[_0x4369('0x36')],qs['fields'](_0x1859c6[_0x4369('0x37')][_0x4369('0x3c')]));_0x3e840e['attributes']=_0x3e840e[_0x4369('0x3b')][_0x4369('0x3d')]?_0x3e840e[_0x4369('0x3b')]:_0x176cb3['model'];_0x3e840e['order']=qs[_0x4369('0x41')](_0x1859c6[_0x4369('0x37')][_0x4369('0x41')]);_0x3e840e['where']=qs['filters'](_[_0x4369('0x43')](_0x1859c6[_0x4369('0x37')],_0x176cb3[_0x4369('0x39')]));if(_0x1859c6[_0x4369('0x37')][_0x4369('0x44')]){_0x3e840e[_0x4369('0x42')]=_[_0x4369('0x45')](_0x3e840e[_0x4369('0x42')],{'$or':_[_0x4369('0x33')](_0x3e840e[_0x4369('0x3b')],function(_0x53baf6){var _0x40647e={};_0x40647e[_0x53baf6]={'$like':'%'+_0x1859c6[_0x4369('0x37')][_0x4369('0x44')]+'%'};return _0x40647e;})});}_0x3e840e=_['merge']({},_0x3e840e,_0x1859c6[_0x4369('0x47')]);return _0x249922['getDescriptions'](_0x3e840e);}})[_0x4369('0x2e')](function(_0x4eccb0){if(_0x4eccb0){_0x5a1e27=_0x4eccb0['length'];if(!_0x1859c6[_0x4369('0x37')][_0x4369('0x3e')](_0x4369('0x3f'))){_0x3e840e['limit']=qs[_0x4369('0x27')](_0x1859c6[_0x4369('0x37')][_0x4369('0x27')]);_0x3e840e[_0x4369('0x24')]=qs[_0x4369('0x24')](_0x1859c6[_0x4369('0x37')][_0x4369('0x24')]);}return _0x249922[_0x4369('0x57')](_0x3e840e);}})[_0x4369('0x2e')](function(_0x5914b3){if(_0x5914b3){return _0x5914b3?{'count':_0x5a1e27,'rows':_0x5914b3}:null;}})[_0x4369('0x2e')](respondWithResult(_0x522a31,null))['catch'](handleError(_0x522a31,null));}; \ No newline at end of file +var _0xf71c=['pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','create','body','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x10379e,_0x28f9a){var _0x7d604d=function(_0x5d7a29){while(--_0x5d7a29){_0x10379e['push'](_0x10379e['shift']());}};_0x7d604d(++_0x28f9a);}(_0xf71c,0xc7));var _0xcf71=function(_0x177ac1,_0x45b891){_0x177ac1=_0x177ac1-0x0;var _0x21dc92=_0xf71c[_0x177ac1];return _0x21dc92;};'use strict';var emlformat=require(_0xcf71('0x0'));var rimraf=require(_0xcf71('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcf71('0x2'));var BPromise=require(_0xcf71('0x3'));var Mustache=require(_0xcf71('0x4'));var util=require('util');var path=require(_0xcf71('0x5'));var sox=require(_0xcf71('0x6'));var csv=require(_0xcf71('0x7'));var ejs=require(_0xcf71('0x8'));var fs=require('fs');var fs_extra=require(_0xcf71('0x9'));var _=require(_0xcf71('0xa'));var squel=require('squel');var crypto=require(_0xcf71('0xb'));var jsforce=require(_0xcf71('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcf71('0x7'));var querystring=require('querystring');var Papa=require(_0xcf71('0xd'));var Redis=require(_0xcf71('0xe'));var authService=require(_0xcf71('0xf'));var qs=require(_0xcf71('0x10'));var as=require(_0xcf71('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xcf71('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xcf71('0x13'));var db=require(_0xcf71('0x14'))['db'];var jayson=require(_0xcf71('0x15'));var client=jayson[_0xcf71('0x16')][_0xcf71('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x56cc3a,_0xd774da,_0x37d018,_0x500da4){return new BPromise(function(_0x273f70,_0x57ef42){var _0x2f4d9b=_0x500da4||client;return _0x2f4d9b[_0xcf71('0x18')](_0x56cc3a,_0x37d018)[_0xcf71('0x19')](function(_0x111d1c){logger[_0xcf71('0x1a')](_0xcf71('0x1b'),_0xd774da,_0xcf71('0x1c'));logger[_0xcf71('0x1d')](_0xcf71('0x1e'),_0xd774da,_0xcf71('0x1c'),JSON[_0xcf71('0x1f')](_0x111d1c));if(_0x111d1c[_0xcf71('0x20')]){if(_0x111d1c[_0xcf71('0x20')]['code']===0x1f4){logger[_0xcf71('0x20')](_0xcf71('0x1b'),_0xd774da,_0x111d1c[_0xcf71('0x20')][_0xcf71('0x21')]);return _0x57ef42(_0x111d1c[_0xcf71('0x20')]['message']);}logger['error'](_0xcf71('0x1b'),_0xd774da,_0x111d1c['error'][_0xcf71('0x21')]);return _0x273f70(_0x111d1c[_0xcf71('0x20')][_0xcf71('0x21')]);}else{logger['info'](_0xcf71('0x1b'),_0xd774da,_0xcf71('0x1c'));_0x273f70(_0x111d1c[_0xcf71('0x22')]['message']);}})[_0xcf71('0x23')](function(_0x45b9fe){logger['error'](_0xcf71('0x1b'),_0xd774da,_0x45b9fe);_0x57ef42(_0x45b9fe);});});}function respondWithStatusCode(_0x4a3aab,_0x166847){_0x166847=_0x166847||0xcc;return function(_0x2739fe){if(_0x2739fe){return _0x4a3aab['sendStatus'](_0x166847);}return _0x4a3aab[_0xcf71('0x24')](_0x166847)[_0xcf71('0x25')]();};}function respondWithResult(_0x1df011,_0x1fd0b4){_0x1fd0b4=_0x1fd0b4||0xc8;return function(_0x16507c){if(_0x16507c){return _0x1df011[_0xcf71('0x24')](_0x1fd0b4)[_0xcf71('0x26')](_0x16507c);}};}function respondWithFilteredResult(_0x4888fb,_0x464182){return function(_0x1c045d){if(_0x1c045d){var _0x1780ff=typeof _0x464182[_0xcf71('0x27')]===_0xcf71('0x28')&&typeof _0x464182[_0xcf71('0x29')]===_0xcf71('0x28');var _0x4b95d1=_0x1c045d['count'];var _0x36edb2=_0x1780ff?0x0:_0x464182[_0xcf71('0x27')];var _0x370cf8=_0x1780ff?_0x1c045d[_0xcf71('0x2a')]:_0x464182[_0xcf71('0x27')]+_0x464182[_0xcf71('0x29')];var _0x33f80c;if(_0x370cf8>=_0x4b95d1){_0x370cf8=_0x4b95d1;_0x33f80c=0xc8;}else{_0x33f80c=0xce;}_0x4888fb[_0xcf71('0x24')](_0x33f80c);return _0x4888fb['set'](_0xcf71('0x2b'),_0x36edb2+'-'+_0x370cf8+'/'+_0x4b95d1)[_0xcf71('0x26')](_0x1c045d);}return null;};}function patchUpdates(_0x331fcc){return function(_0x113fa9){try{jsonpatch['apply'](_0x113fa9,_0x331fcc,!![]);}catch(_0x217f57){return BPromise[_0xcf71('0x2c')](_0x217f57);}return _0x113fa9[_0xcf71('0x2d')]();};}function saveUpdates(_0x4a7c88,_0x503ac4){return function(_0x10d35b){if(_0x10d35b){return _0x10d35b[_0xcf71('0x2e')](_0x4a7c88)[_0xcf71('0x19')](function(_0x3f752b){return _0x3f752b;});}return null;};}function removeEntity(_0x427037,_0x26f906){return function(_0x2eab08){if(_0x2eab08){return _0x2eab08[_0xcf71('0x2f')]()[_0xcf71('0x19')](function(){_0x427037[_0xcf71('0x24')](0xcc)[_0xcf71('0x25')]();});}};}function handleEntityNotFound(_0x90bc26,_0x75dc60){return function(_0x5acca7){if(!_0x5acca7){_0x90bc26[_0xcf71('0x30')](0x194);}return _0x5acca7;};}function handleError(_0x4bd76a,_0x5257c5){_0x5257c5=_0x5257c5||0x1f4;return function(_0x3bc5e8){logger[_0xcf71('0x20')](_0x3bc5e8[_0xcf71('0x31')]);if(_0x3bc5e8['name']){delete _0x3bc5e8[_0xcf71('0x32')];}_0x4bd76a[_0xcf71('0x24')](_0x5257c5)[_0xcf71('0x33')](_0x3bc5e8);};}exports[_0xcf71('0x34')]=function(_0x2b2c4d,_0x4d63e1){var _0x34d8d6={},_0x40275a={},_0x5057e3={'count':0x0,'rows':[]};var _0x47f785=_[_0xcf71('0x35')](db[_0xcf71('0x36')][_0xcf71('0x37')],function(_0x41fc19){return{'name':_0x41fc19[_0xcf71('0x38')],'type':_0x41fc19[_0xcf71('0x39')][_0xcf71('0x3a')]};});_0x40275a['model']=_[_0xcf71('0x35')](_0x47f785,'name');_0x40275a[_0xcf71('0x3b')]=_[_0xcf71('0x3c')](_0x2b2c4d[_0xcf71('0x3b')]);_0x40275a[_0xcf71('0x3d')]=_[_0xcf71('0x3e')](_0x40275a[_0xcf71('0x3f')],_0x40275a[_0xcf71('0x3b')]);_0x34d8d6[_0xcf71('0x40')]=_[_0xcf71('0x3e')](_0x40275a['model'],qs[_0xcf71('0x41')](_0x2b2c4d[_0xcf71('0x3b')][_0xcf71('0x41')]));_0x34d8d6[_0xcf71('0x40')]=_0x34d8d6[_0xcf71('0x40')][_0xcf71('0x42')]?_0x34d8d6[_0xcf71('0x40')]:_0x40275a[_0xcf71('0x3f')];if(!_0x2b2c4d[_0xcf71('0x3b')][_0xcf71('0x43')](_0xcf71('0x44'))){_0x34d8d6[_0xcf71('0x29')]=qs[_0xcf71('0x29')](_0x2b2c4d[_0xcf71('0x3b')][_0xcf71('0x29')]);_0x34d8d6[_0xcf71('0x27')]=qs[_0xcf71('0x27')](_0x2b2c4d['query'][_0xcf71('0x27')]);}_0x34d8d6['order']=qs['sort'](_0x2b2c4d[_0xcf71('0x3b')][_0xcf71('0x45')]);_0x34d8d6[_0xcf71('0x46')]=qs[_0xcf71('0x3d')](_[_0xcf71('0x47')](_0x2b2c4d[_0xcf71('0x3b')],_0x40275a['filters']),_0x47f785);if(_0x2b2c4d['query'][_0xcf71('0x48')]){_0x34d8d6[_0xcf71('0x46')]=_[_0xcf71('0x49')](_0x34d8d6[_0xcf71('0x46')],{'$or':_[_0xcf71('0x35')](_0x47f785,function(_0xd983d9){if(_0xd983d9[_0xcf71('0x39')]!==_0xcf71('0x4a')){var _0xe18618={};_0xe18618[_0xd983d9[_0xcf71('0x32')]]={'$like':'%'+_0x2b2c4d[_0xcf71('0x3b')][_0xcf71('0x48')]+'%'};return _0xe18618;}})});}_0x34d8d6=_['merge']({},_0x34d8d6,_0x2b2c4d[_0xcf71('0x4b')]);var _0x27506e={'where':_0x34d8d6[_0xcf71('0x46')]};return db[_0xcf71('0x36')][_0xcf71('0x2a')](_0x27506e)['then'](function(_0x5b6d52){_0x5057e3[_0xcf71('0x2a')]=_0x5b6d52;if(_0x2b2c4d[_0xcf71('0x3b')][_0xcf71('0x4c')]){_0x34d8d6['include']=[{'all':!![]}];}return db[_0xcf71('0x36')][_0xcf71('0x4d')](_0x34d8d6);})[_0xcf71('0x19')](function(_0x4c0e71){_0x5057e3[_0xcf71('0x4e')]=_0x4c0e71;return _0x5057e3;})['then'](respondWithFilteredResult(_0x4d63e1,_0x34d8d6))[_0xcf71('0x23')](handleError(_0x4d63e1,null));};exports['show']=function(_0x1ba67d,_0x3fc672){var _0xdfae45={'raw':![],'where':{'id':_0x1ba67d[_0xcf71('0x4f')]['id']}},_0x205fc4={};_0x205fc4[_0xcf71('0x3f')]=_[_0xcf71('0x3c')](db[_0xcf71('0x36')]['rawAttributes']);_0x205fc4[_0xcf71('0x3b')]=_['keys'](_0x1ba67d[_0xcf71('0x3b')]);_0x205fc4[_0xcf71('0x3d')]=_[_0xcf71('0x3e')](_0x205fc4[_0xcf71('0x3f')],_0x205fc4[_0xcf71('0x3b')]);_0xdfae45[_0xcf71('0x40')]=_['intersection'](_0x205fc4[_0xcf71('0x3f')],qs[_0xcf71('0x41')](_0x1ba67d['query'][_0xcf71('0x41')]));_0xdfae45[_0xcf71('0x40')]=_0xdfae45['attributes'][_0xcf71('0x42')]?_0xdfae45[_0xcf71('0x40')]:_0x205fc4[_0xcf71('0x3f')];if(_0x1ba67d[_0xcf71('0x3b')][_0xcf71('0x4c')]){_0xdfae45[_0xcf71('0x50')]=[{'all':!![]}];}_0xdfae45=_[_0xcf71('0x49')]({},_0xdfae45,_0x1ba67d['options']);return db['VtigerConfiguration'][_0xcf71('0x51')](_0xdfae45)['then'](handleEntityNotFound(_0x3fc672,null))[_0xcf71('0x19')](respondWithResult(_0x3fc672,null))['catch'](handleError(_0x3fc672,null));};exports[_0xcf71('0x52')]=function(_0x5b1d94,_0x1f5f6b){return db['VtigerConfiguration']['create'](_0x5b1d94[_0xcf71('0x53')],{})['then'](respondWithResult(_0x1f5f6b,0xc9))[_0xcf71('0x23')](handleError(_0x1f5f6b,null));};exports['update']=function(_0x425b79,_0x57dd3b){if(_0x425b79['body']['id']){delete _0x425b79[_0xcf71('0x53')]['id'];}return db[_0xcf71('0x36')][_0xcf71('0x51')]({'where':{'id':_0x425b79[_0xcf71('0x4f')]['id']}})['then'](handleEntityNotFound(_0x57dd3b,null))['then'](saveUpdates(_0x425b79[_0xcf71('0x53')],null))['then'](respondWithResult(_0x57dd3b,null))['catch'](handleError(_0x57dd3b,null));};exports['destroy']=function(_0x1d9c72,_0x5cfac9){return db['VtigerConfiguration'][_0xcf71('0x51')]({'where':{'id':_0x1d9c72[_0xcf71('0x4f')]['id']}})[_0xcf71('0x19')](handleEntityNotFound(_0x5cfac9,null))[_0xcf71('0x19')](removeEntity(_0x5cfac9,null))[_0xcf71('0x23')](handleError(_0x5cfac9,null));};exports[_0xcf71('0x54')]=function(_0x7b0bd7,_0x56d22f,_0x11f532){var _0x36760e={};var _0x509257={};var _0x504113;var _0x5a2bb9;return db[_0xcf71('0x36')][_0xcf71('0x55')]({'where':{'id':_0x7b0bd7[_0xcf71('0x4f')]['id']}})[_0xcf71('0x19')](handleEntityNotFound(_0x56d22f,null))[_0xcf71('0x19')](function(_0x2a446f){if(_0x2a446f){_0x504113=_0x2a446f;_0x509257[_0xcf71('0x3f')]=_[_0xcf71('0x3c')](db[_0xcf71('0x56')][_0xcf71('0x37')]);_0x509257[_0xcf71('0x3b')]=_[_0xcf71('0x3c')](_0x7b0bd7[_0xcf71('0x3b')]);_0x509257[_0xcf71('0x3d')]=_[_0xcf71('0x3e')](_0x509257[_0xcf71('0x3f')],_0x509257[_0xcf71('0x3b')]);_0x36760e[_0xcf71('0x40')]=_['intersection'](_0x509257['model'],qs[_0xcf71('0x41')](_0x7b0bd7[_0xcf71('0x3b')][_0xcf71('0x41')]));_0x36760e[_0xcf71('0x40')]=_0x36760e[_0xcf71('0x40')][_0xcf71('0x42')]?_0x36760e[_0xcf71('0x40')]:_0x509257[_0xcf71('0x3f')];_0x36760e[_0xcf71('0x57')]=qs[_0xcf71('0x45')](_0x7b0bd7[_0xcf71('0x3b')]['sort']);_0x36760e[_0xcf71('0x46')]=qs[_0xcf71('0x3d')](_['pick'](_0x7b0bd7[_0xcf71('0x3b')],_0x509257['filters']));if(_0x7b0bd7['query'][_0xcf71('0x48')]){_0x36760e[_0xcf71('0x46')]=_['merge'](_0x36760e['where'],{'$or':_[_0xcf71('0x35')](_0x36760e[_0xcf71('0x40')],function(_0x5dd124){var _0x582a13={};_0x582a13[_0x5dd124]={'$like':'%'+_0x7b0bd7['query'][_0xcf71('0x48')]+'%'};return _0x582a13;})});}_0x36760e=_['merge']({},_0x36760e,_0x7b0bd7[_0xcf71('0x4b')]);return _0x504113['getFields'](_0x36760e);}})['then'](function(_0x3e021f){if(_0x3e021f){_0x5a2bb9=_0x3e021f['length'];if(!_0x7b0bd7[_0xcf71('0x3b')][_0xcf71('0x43')]('nolimit')){_0x36760e[_0xcf71('0x29')]=qs[_0xcf71('0x29')](_0x7b0bd7[_0xcf71('0x3b')]['limit']);_0x36760e['offset']=qs['offset'](_0x7b0bd7[_0xcf71('0x3b')][_0xcf71('0x27')]);}return _0x504113[_0xcf71('0x54')](_0x36760e);}})[_0xcf71('0x19')](function(_0x4262e9){if(_0x4262e9){return _0x4262e9?{'count':_0x5a2bb9,'rows':_0x4262e9}:null;}})[_0xcf71('0x19')](respondWithResult(_0x56d22f,null))[_0xcf71('0x23')](handleError(_0x56d22f,null));};exports['getSubjects']=function(_0x11c19f,_0x2815eb,_0x5b0943){var _0x28152d={};var _0x34a363={};var _0x357ce2;var _0x426d69;return db['VtigerConfiguration'][_0xcf71('0x55')]({'where':{'id':_0x11c19f[_0xcf71('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2815eb,null))['then'](function(_0x49f9d8){if(_0x49f9d8){_0x357ce2=_0x49f9d8;_0x34a363['model']=_[_0xcf71('0x3c')](db[_0xcf71('0x56')][_0xcf71('0x37')]);_0x34a363[_0xcf71('0x3b')]=_[_0xcf71('0x3c')](_0x11c19f[_0xcf71('0x3b')]);_0x34a363['filters']=_[_0xcf71('0x3e')](_0x34a363['model'],_0x34a363['query']);_0x28152d[_0xcf71('0x40')]=_[_0xcf71('0x3e')](_0x34a363['model'],qs[_0xcf71('0x41')](_0x11c19f[_0xcf71('0x3b')][_0xcf71('0x41')]));_0x28152d[_0xcf71('0x40')]=_0x28152d[_0xcf71('0x40')][_0xcf71('0x42')]?_0x28152d[_0xcf71('0x40')]:_0x34a363[_0xcf71('0x3f')];_0x28152d[_0xcf71('0x57')]=qs['sort'](_0x11c19f[_0xcf71('0x3b')][_0xcf71('0x45')]);_0x28152d[_0xcf71('0x46')]=qs[_0xcf71('0x3d')](_[_0xcf71('0x47')](_0x11c19f[_0xcf71('0x3b')],_0x34a363[_0xcf71('0x3d')]));if(_0x11c19f[_0xcf71('0x3b')][_0xcf71('0x48')]){_0x28152d['where']=_['merge'](_0x28152d[_0xcf71('0x46')],{'$or':_[_0xcf71('0x35')](_0x28152d['attributes'],function(_0xc6f2c3){var _0x18b479={};_0x18b479[_0xc6f2c3]={'$like':'%'+_0x11c19f[_0xcf71('0x3b')][_0xcf71('0x48')]+'%'};return _0x18b479;})});}_0x28152d=_[_0xcf71('0x49')]({},_0x28152d,_0x11c19f[_0xcf71('0x4b')]);return _0x357ce2[_0xcf71('0x58')](_0x28152d);}})['then'](function(_0x501b92){if(_0x501b92){_0x426d69=_0x501b92[_0xcf71('0x42')];if(!_0x11c19f['query'][_0xcf71('0x43')](_0xcf71('0x44'))){_0x28152d[_0xcf71('0x29')]=qs[_0xcf71('0x29')](_0x11c19f[_0xcf71('0x3b')][_0xcf71('0x29')]);_0x28152d[_0xcf71('0x27')]=qs['offset'](_0x11c19f[_0xcf71('0x3b')]['offset']);}return _0x357ce2['getSubjects'](_0x28152d);}})[_0xcf71('0x19')](function(_0x27af05){if(_0x27af05){return _0x27af05?{'count':_0x426d69,'rows':_0x27af05}:null;}})[_0xcf71('0x19')](respondWithResult(_0x2815eb,null))[_0xcf71('0x23')](handleError(_0x2815eb,null));};exports[_0xcf71('0x59')]=function(_0x9c7fa6,_0x3813fb,_0x44662f){var _0x2e2933={};var _0x2cb322={};var _0x545d50;var _0x5974ec;return db['VtigerConfiguration'][_0xcf71('0x55')]({'where':{'id':_0x9c7fa6['params']['id']}})['then'](handleEntityNotFound(_0x3813fb,null))[_0xcf71('0x19')](function(_0x33a64f){if(_0x33a64f){_0x545d50=_0x33a64f;_0x2cb322[_0xcf71('0x3f')]=_['keys'](db[_0xcf71('0x56')]['rawAttributes']);_0x2cb322[_0xcf71('0x3b')]=_['keys'](_0x9c7fa6['query']);_0x2cb322['filters']=_['intersection'](_0x2cb322['model'],_0x2cb322[_0xcf71('0x3b')]);_0x2e2933[_0xcf71('0x40')]=_[_0xcf71('0x3e')](_0x2cb322[_0xcf71('0x3f')],qs[_0xcf71('0x41')](_0x9c7fa6[_0xcf71('0x3b')]['fields']));_0x2e2933['attributes']=_0x2e2933[_0xcf71('0x40')][_0xcf71('0x42')]?_0x2e2933[_0xcf71('0x40')]:_0x2cb322[_0xcf71('0x3f')];_0x2e2933[_0xcf71('0x57')]=qs[_0xcf71('0x45')](_0x9c7fa6[_0xcf71('0x3b')][_0xcf71('0x45')]);_0x2e2933[_0xcf71('0x46')]=qs[_0xcf71('0x3d')](_[_0xcf71('0x47')](_0x9c7fa6[_0xcf71('0x3b')],_0x2cb322[_0xcf71('0x3d')]));if(_0x9c7fa6[_0xcf71('0x3b')][_0xcf71('0x48')]){_0x2e2933[_0xcf71('0x46')]=_['merge'](_0x2e2933[_0xcf71('0x46')],{'$or':_[_0xcf71('0x35')](_0x2e2933['attributes'],function(_0x9e2b2c){var _0x490b21={};_0x490b21[_0x9e2b2c]={'$like':'%'+_0x9c7fa6[_0xcf71('0x3b')][_0xcf71('0x48')]+'%'};return _0x490b21;})});}_0x2e2933=_[_0xcf71('0x49')]({},_0x2e2933,_0x9c7fa6[_0xcf71('0x4b')]);return _0x545d50[_0xcf71('0x59')](_0x2e2933);}})['then'](function(_0x3a3fee){if(_0x3a3fee){_0x5974ec=_0x3a3fee[_0xcf71('0x42')];if(!_0x9c7fa6[_0xcf71('0x3b')][_0xcf71('0x43')]('nolimit')){_0x2e2933[_0xcf71('0x29')]=qs['limit'](_0x9c7fa6['query'][_0xcf71('0x29')]);_0x2e2933[_0xcf71('0x27')]=qs[_0xcf71('0x27')](_0x9c7fa6[_0xcf71('0x3b')][_0xcf71('0x27')]);}return _0x545d50[_0xcf71('0x59')](_0x2e2933);}})['then'](function(_0x3129f1){if(_0x3129f1){return _0x3129f1?{'count':_0x5974ec,'rows':_0x3129f1}:null;}})[_0xcf71('0x19')](respondWithResult(_0x3813fb,null))[_0xcf71('0x23')](handleError(_0x3813fb,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index d5f4013..902c696 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 _0x964f=['request-promise','rimraf','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','bluebird'];(function(_0x52d0f6,_0x38a8e8){var _0x15e5b9=function(_0x556f47){while(--_0x556f47){_0x52d0f6['push'](_0x52d0f6['shift']());}};_0x15e5b9(++_0x38a8e8);}(_0x964f,0xa7));var _0xf964=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x964f[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xf964('0x0'));var util=require('util');var logger=require(_0xf964('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf964('0x2'));var rp=require(_0xf964('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf964('0x4'));var config=require(_0xf964('0x5'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xf964('0x6')]=function(_0x69d5a5,_0x3ecb73){return _0x69d5a5[_0xf964('0x7')](_0xf964('0x8'),attributes,{'tableName':_0xf964('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2897=['./intVtigerConfiguration.attributes','exports','VtigerConfiguration','lodash','util','../../config/logger','api','bluebird','../../config/environment'];(function(_0x372128,_0x4a05d6){var _0x3c57c1=function(_0x224e30){while(--_0x224e30){_0x372128['push'](_0x372128['shift']());}};_0x3c57c1(++_0x4a05d6);}(_0x2897,0x1ce));var _0x7289=function(_0x3e5b5f,_0x391308){_0x3e5b5f=_0x3e5b5f-0x0;var _0x1782a6=_0x2897[_0x3e5b5f];return _0x1782a6;};'use strict';var _=require(_0x7289('0x0'));var util=require(_0x7289('0x1'));var logger=require(_0x7289('0x2'))(_0x7289('0x3'));var moment=require('moment');var BPromise=require(_0x7289('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7289('0x5'));var attributes=require(_0x7289('0x6'));module[_0x7289('0x7')]=function(_0x4e2adb,_0x118ba9){return _0x4e2adb['define'](_0x7289('0x8'),attributes,{'tableName':'int_vtiger_configurations','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 ec3ad89..ddfaa6f 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 _0x4682=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x54c695,_0x5d6677){var _0x3ce06b=function(_0x55bdf1){while(--_0x55bdf1){_0x54c695['push'](_0x54c695['shift']());}};_0x3ce06b(++_0x5d6677);}(_0x4682,0x15f));var _0x2468=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x4682[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require('lodash');var util=require(_0x2468('0x0'));var moment=require('moment');var BPromise=require(_0x2468('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2468('0x2'));var db=require(_0x2468('0x3'))['db'];var utils=require(_0x2468('0x4'));var logger=require(_0x2468('0x5'))('rpc');var config=require(_0x2468('0x6'));var jayson=require(_0x2468('0x7'));var client=jayson['client'][_0x2468('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9ab7dd,_0x116973,_0x5f4439){return new BPromise(function(_0x3d606a,_0x45d68f){return client[_0x2468('0x9')](_0x9ab7dd,_0x5f4439)[_0x2468('0xa')](function(_0x1ec8fd){logger[_0x2468('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x116973,_0x2468('0xc'));logger[_0x2468('0xd')](_0x2468('0xe'),_0x116973,'request\x20sent',JSON[_0x2468('0xf')](_0x1ec8fd));if(_0x1ec8fd[_0x2468('0x10')]){if(_0x1ec8fd[_0x2468('0x10')]['code']===0x1f4){logger[_0x2468('0x10')](_0x2468('0x11'),_0x116973,_0x1ec8fd['error'][_0x2468('0x12')]);return _0x45d68f(_0x1ec8fd['error']['message']);}logger['error'](_0x2468('0x11'),_0x116973,_0x1ec8fd[_0x2468('0x10')]['message']);return _0x3d606a(_0x1ec8fd[_0x2468('0x10')][_0x2468('0x12')]);}else{logger[_0x2468('0xb')](_0x2468('0x11'),_0x116973,_0x2468('0xc'));_0x3d606a(_0x1ec8fd[_0x2468('0x13')][_0x2468('0x12')]);}})[_0x2468('0x14')](function(_0x463f67){logger['error'](_0x2468('0x11'),_0x116973,_0x463f67);_0x45d68f(_0x463f67);});});} \ No newline at end of file +var _0x3da4=['then','request\x20sent','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request'];(function(_0xf27a18,_0x1b5b0f){var _0x35c069=function(_0x304f54){while(--_0x304f54){_0xf27a18['push'](_0xf27a18['shift']());}};_0x35c069(++_0x1b5b0f);}(_0x3da4,0x177));var _0x43da=function(_0xa8213,_0x38ed6e){_0xa8213=_0xa8213-0x0;var _0x4e739b=_0x3da4[_0xa8213];return _0x4e739b;};'use strict';var _=require(_0x43da('0x0'));var util=require('util');var moment=require(_0x43da('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43da('0x2'));var db=require(_0x43da('0x3'))['db'];var utils=require(_0x43da('0x4'));var logger=require(_0x43da('0x5'))(_0x43da('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x43da('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x70b1c7,_0x1cecc1,_0x22ec76){return new BPromise(function(_0x573b15,_0x50aeb0){return client[_0x43da('0x8')](_0x70b1c7,_0x22ec76)[_0x43da('0x9')](function(_0xc28186){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x1cecc1,_0x43da('0xa'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x1cecc1,_0x43da('0xa'),JSON['stringify'](_0xc28186));if(_0xc28186[_0x43da('0xb')]){if(_0xc28186[_0x43da('0xb')][_0x43da('0xc')]===0x1f4){logger['error'](_0x43da('0xd'),_0x1cecc1,_0xc28186['error'][_0x43da('0xe')]);return _0x50aeb0(_0xc28186[_0x43da('0xb')][_0x43da('0xe')]);}logger[_0x43da('0xb')](_0x43da('0xd'),_0x1cecc1,_0xc28186['error'][_0x43da('0xe')]);return _0x573b15(_0xc28186[_0x43da('0xb')]['message']);}else{logger[_0x43da('0xf')](_0x43da('0xd'),_0x1cecc1,_0x43da('0xa'));_0x573b15(_0xc28186['result'][_0x43da('0xe')]);}})['catch'](function(_0x290e60){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x1cecc1,_0x290e60);_0x50aeb0(_0x290e60);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 2268b1d..f558560 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 _0xc4aa=['connect-timeout','express','Router','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','create','put','update','delete','exports','multer','util','path'];(function(_0x7ae92b,_0x153311){var _0x4599e1=function(_0x4b5108){while(--_0x4b5108){_0x7ae92b['push'](_0x7ae92b['shift']());}};_0x4599e1(++_0x153311);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc4aa[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xc')]);router[_0xac4a('0xd')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['destroy']);module[_0xac4a('0x10')]=router; \ No newline at end of file +var _0x2ef3=['show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','/:id','isAuthenticated'];(function(_0x80fec,_0x196330){var _0x56c96a=function(_0x122201){while(--_0x122201){_0x80fec['push'](_0x80fec['shift']());}};_0x56c96a(++_0x196330);}(_0x2ef3,0xba));var _0x32ef=function(_0xddf9d3,_0x200ddf){_0xddf9d3=_0xddf9d3-0x0;var _0x81e924=_0x2ef3[_0xddf9d3];return _0x81e924;};'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 fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0xd')]('/',auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller['update']);router['delete'](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);module[_0x32ef('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 2c64148..c498f4a 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 _0xb6b1=['STRING','string','BOOLEAN','sequelize','ENUM','variable','customVariable','picklist'];(function(_0x348d93,_0x39bccb){var _0xa59df6=function(_0x2d1803){while(--_0x2d1803){_0x348d93['push'](_0x348d93['shift']());}};_0xa59df6(++_0x39bccb);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xb6b1[_0x1e6db3];return _0x1de886;};'use strict';var Sequelize=require(_0x1b6b('0x0'));module['exports']={'type':{'type':Sequelize[_0x1b6b('0x1')]('string',_0x1b6b('0x2'),_0x1b6b('0x3'),'keyValue',_0x1b6b('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1b6b('0x5')]},'key':{'type':Sequelize[_0x1b6b('0x5')]},'keyType':{'type':Sequelize[_0x1b6b('0x1')](_0x1b6b('0x6'),'variable',_0x1b6b('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1b6b('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1b6b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1b6b('0x5')]}}; \ No newline at end of file +var _0xd0bb=['BOOLEAN','sequelize','exports','ENUM','variable','keyValue','picklist','STRING','string','customVariable'];(function(_0x236b4b,_0x5a39f9){var _0x5220b2=function(_0x26215b){while(--_0x26215b){_0x236b4b['push'](_0x236b4b['shift']());}};_0x5220b2(++_0x5a39f9);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x4fde9a,_0x5d1eda){_0x4fde9a=_0x4fde9a-0x0;var _0x58f321=_0xd0bb[_0x4fde9a];return _0x58f321;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'type':{'type':Sequelize[_0xbd0b('0x2')]('string',_0xbd0b('0x3'),'customVariable',_0xbd0b('0x4'),_0xbd0b('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbd0b('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbd0b('0x2')](_0xbd0b('0x7'),_0xbd0b('0x3'),_0xbd0b('0x8'))},'keyContent':{'type':Sequelize[_0xbd0b('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbd0b('0x6')]},'customField':{'type':Sequelize[_0xbd0b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd0b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index a6f1353..fbc6ad5 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 _0xada1=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','find','catch','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','keys','query','intersection','attributes','fields','length','model','nolimit','order','sort','where','filters'];(function(_0x12f98d,_0x1c3b5f){var _0x5c8d41=function(_0x15199d){while(--_0x15199d){_0x12f98d['push'](_0x12f98d['shift']());}};_0x5c8d41(++_0x1c3b5f);}(_0xada1,0x12d));var _0x1ada=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xada1[_0x2112d4];return _0x434972;};'use strict';var emlformat=require(_0x1ada('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ada('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1ada('0x2'));var moment=require(_0x1ada('0x3'));var BPromise=require(_0x1ada('0x4'));var Mustache=require(_0x1ada('0x5'));var util=require(_0x1ada('0x6'));var path=require(_0x1ada('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ada('0x8'));var fs=require('fs');var fs_extra=require(_0x1ada('0x9'));var _=require('lodash');var squel=require(_0x1ada('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1ada('0xb'));var toCsv=require(_0x1ada('0xc'));var querystring=require('querystring');var Papa=require(_0x1ada('0xd'));var Redis=require(_0x1ada('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1ada('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ada('0x10'));var logger=require('../../config/logger')(_0x1ada('0x11'));var utils=require('../../config/utils');var config=require(_0x1ada('0x12'));var licenseUtil=require(_0x1ada('0x13'));var db=require(_0x1ada('0x14'))['db'];function respondWithStatusCode(_0x23985c,_0x25ab77){_0x25ab77=_0x25ab77||0xcc;return function(_0x426c7e){if(_0x426c7e){return _0x23985c['sendStatus'](_0x25ab77);}return _0x23985c[_0x1ada('0x15')](_0x25ab77)[_0x1ada('0x16')]();};}function respondWithResult(_0x5a3bed,_0x2724d0){_0x2724d0=_0x2724d0||0xc8;return function(_0x366943){if(_0x366943){return _0x5a3bed[_0x1ada('0x15')](_0x2724d0)[_0x1ada('0x17')](_0x366943);}};}function respondWithFilteredResult(_0x3dcb12,_0x525b7d){return function(_0x1aa18b){if(_0x1aa18b){var _0x2157de=typeof _0x525b7d['offset']===_0x1ada('0x18')&&typeof _0x525b7d[_0x1ada('0x19')]===_0x1ada('0x18');var _0x51ce1f=_0x1aa18b[_0x1ada('0x1a')];var _0x2bd224=_0x2157de?0x0:_0x525b7d[_0x1ada('0x1b')];var _0x22fa43=_0x2157de?_0x1aa18b['count']:_0x525b7d[_0x1ada('0x1b')]+_0x525b7d['limit'];var _0x2c426c;if(_0x22fa43>=_0x51ce1f){_0x22fa43=_0x51ce1f;_0x2c426c=0xc8;}else{_0x2c426c=0xce;}_0x3dcb12[_0x1ada('0x15')](_0x2c426c);return _0x3dcb12[_0x1ada('0x1c')](_0x1ada('0x1d'),_0x2bd224+'-'+_0x22fa43+'/'+_0x51ce1f)[_0x1ada('0x17')](_0x1aa18b);}return null;};}function patchUpdates(_0x1d96a8){return function(_0x2eb4e1){try{jsonpatch[_0x1ada('0x1e')](_0x2eb4e1,_0x1d96a8,!![]);}catch(_0x9945e4){return BPromise[_0x1ada('0x1f')](_0x9945e4);}return _0x2eb4e1[_0x1ada('0x20')]();};}function saveUpdates(_0xc6366e,_0x12da6c){return function(_0x4ad25a){if(_0x4ad25a){return _0x4ad25a[_0x1ada('0x21')](_0xc6366e)[_0x1ada('0x22')](function(_0x4dca59){return _0x4dca59;});}return null;};}function removeEntity(_0x5eda2d,_0x166f58){return function(_0x5db8fb){if(_0x5db8fb){return _0x5db8fb[_0x1ada('0x23')]()['then'](function(){_0x5eda2d[_0x1ada('0x15')](0xcc)[_0x1ada('0x16')]();});}};}function handleEntityNotFound(_0x31fd2f,_0x752e17){return function(_0x3ac289){if(!_0x3ac289){_0x31fd2f['sendStatus'](0x194);}return _0x3ac289;};}function handleError(_0x5c8c4c,_0x1078e5){_0x1078e5=_0x1078e5||0x1f4;return function(_0x25758f){logger[_0x1ada('0x24')](_0x25758f[_0x1ada('0x25')]);if(_0x25758f[_0x1ada('0x26')]){delete _0x25758f[_0x1ada('0x26')];}_0x5c8c4c[_0x1ada('0x15')](_0x1078e5)[_0x1ada('0x27')](_0x25758f);};}exports[_0x1ada('0x28')]=function(_0x23648c,_0x5d91dc){var _0x25a2e2={},_0x569ef1={},_0x228207={'count':0x0,'rows':[]};var _0x12b6e9=_[_0x1ada('0x29')](db[_0x1ada('0x2a')][_0x1ada('0x2b')],function(_0x2c9a95){return{'name':_0x2c9a95[_0x1ada('0x2c')],'type':_0x2c9a95[_0x1ada('0x2d')][_0x1ada('0x2e')]};});_0x569ef1['model']=_['map'](_0x12b6e9,_0x1ada('0x26'));_0x569ef1['query']=_[_0x1ada('0x2f')](_0x23648c[_0x1ada('0x30')]);_0x569ef1['filters']=_[_0x1ada('0x31')](_0x569ef1['model'],_0x569ef1[_0x1ada('0x30')]);_0x25a2e2[_0x1ada('0x32')]=_[_0x1ada('0x31')](_0x569ef1['model'],qs['fields'](_0x23648c[_0x1ada('0x30')][_0x1ada('0x33')]));_0x25a2e2['attributes']=_0x25a2e2['attributes'][_0x1ada('0x34')]?_0x25a2e2[_0x1ada('0x32')]:_0x569ef1[_0x1ada('0x35')];if(!_0x23648c['query']['hasOwnProperty'](_0x1ada('0x36'))){_0x25a2e2['limit']=qs[_0x1ada('0x19')](_0x23648c[_0x1ada('0x30')][_0x1ada('0x19')]);_0x25a2e2[_0x1ada('0x1b')]=qs['offset'](_0x23648c['query'][_0x1ada('0x1b')]);}_0x25a2e2[_0x1ada('0x37')]=qs[_0x1ada('0x38')](_0x23648c['query'][_0x1ada('0x38')]);_0x25a2e2[_0x1ada('0x39')]=qs[_0x1ada('0x3a')](_[_0x1ada('0x3b')](_0x23648c[_0x1ada('0x30')],_0x569ef1[_0x1ada('0x3a')]),_0x12b6e9);if(_0x23648c[_0x1ada('0x30')][_0x1ada('0x3c')]){_0x25a2e2['where']=_[_0x1ada('0x3d')](_0x25a2e2[_0x1ada('0x39')],{'$or':_[_0x1ada('0x29')](_0x12b6e9,function(_0x31dc9f){if(_0x31dc9f[_0x1ada('0x2d')]!==_0x1ada('0x3e')){var _0x192eac={};_0x192eac[_0x31dc9f['name']]={'$like':'%'+_0x23648c[_0x1ada('0x30')][_0x1ada('0x3c')]+'%'};return _0x192eac;}})});}_0x25a2e2=_['merge']({},_0x25a2e2,_0x23648c[_0x1ada('0x3f')]);var _0x10e6f1={'where':_0x25a2e2[_0x1ada('0x39')]};return db[_0x1ada('0x2a')][_0x1ada('0x1a')](_0x10e6f1)['then'](function(_0x4ba444){_0x228207[_0x1ada('0x1a')]=_0x4ba444;if(_0x23648c[_0x1ada('0x30')][_0x1ada('0x40')]){_0x25a2e2[_0x1ada('0x41')]=[{'all':!![]}];}return db[_0x1ada('0x2a')][_0x1ada('0x42')](_0x25a2e2);})[_0x1ada('0x22')](function(_0x5d23f8){_0x228207['rows']=_0x5d23f8;return _0x228207;})[_0x1ada('0x22')](respondWithFilteredResult(_0x5d91dc,_0x25a2e2))['catch'](handleError(_0x5d91dc,null));};exports['show']=function(_0x375912,_0x2ea087){var _0x8317d7={'raw':!![],'where':{'id':_0x375912[_0x1ada('0x43')]['id']}},_0x55db60={};_0x55db60[_0x1ada('0x35')]=_['keys'](db[_0x1ada('0x2a')][_0x1ada('0x2b')]);_0x55db60['query']=_[_0x1ada('0x2f')](_0x375912[_0x1ada('0x30')]);_0x55db60[_0x1ada('0x3a')]=_[_0x1ada('0x31')](_0x55db60[_0x1ada('0x35')],_0x55db60[_0x1ada('0x30')]);_0x8317d7[_0x1ada('0x32')]=_[_0x1ada('0x31')](_0x55db60['model'],qs['fields'](_0x375912['query'][_0x1ada('0x33')]));_0x8317d7[_0x1ada('0x32')]=_0x8317d7[_0x1ada('0x32')]['length']?_0x8317d7[_0x1ada('0x32')]:_0x55db60[_0x1ada('0x35')];if(_0x375912[_0x1ada('0x30')][_0x1ada('0x40')]){_0x8317d7[_0x1ada('0x41')]=[{'all':!![]}];}_0x8317d7=_[_0x1ada('0x3d')]({},_0x8317d7,_0x375912[_0x1ada('0x3f')]);return db[_0x1ada('0x2a')][_0x1ada('0x44')](_0x8317d7)[_0x1ada('0x22')](handleEntityNotFound(_0x2ea087,null))[_0x1ada('0x22')](respondWithResult(_0x2ea087,null))[_0x1ada('0x45')](handleError(_0x2ea087,null));};exports[_0x1ada('0x46')]=function(_0xd894f4,_0x1b09fe){return db[_0x1ada('0x2a')]['create'](_0xd894f4[_0x1ada('0x47')],{})[_0x1ada('0x22')](respondWithResult(_0x1b09fe,0xc9))[_0x1ada('0x45')](handleError(_0x1b09fe,null));};exports[_0x1ada('0x21')]=function(_0x464b26,_0xddf5a5){if(_0x464b26[_0x1ada('0x47')]['id']){delete _0x464b26[_0x1ada('0x47')]['id'];}return db['VtigerField'][_0x1ada('0x44')]({'where':{'id':_0x464b26['params']['id']}})[_0x1ada('0x22')](handleEntityNotFound(_0xddf5a5,null))[_0x1ada('0x22')](saveUpdates(_0x464b26['body'],null))[_0x1ada('0x22')](respondWithResult(_0xddf5a5,null))[_0x1ada('0x45')](handleError(_0xddf5a5,null));};exports[_0x1ada('0x23')]=function(_0x75e2c3,_0x3094e2){return db[_0x1ada('0x2a')]['find']({'where':{'id':_0x75e2c3[_0x1ada('0x43')]['id']}})['then'](handleEntityNotFound(_0x3094e2,null))[_0x1ada('0x22')](removeEntity(_0x3094e2,null))[_0x1ada('0x45')](handleError(_0x3094e2,null));}; \ No newline at end of file +var _0xe9ca=['count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','options','includeAll','findAll','rows','catch','show','params','include','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit'];(function(_0x57330e,_0x1123fc){var _0x33c870=function(_0x488157){while(--_0x488157){_0x57330e['push'](_0x57330e['shift']());}};_0x33c870(++_0x1123fc);}(_0xe9ca,0x1db));var _0xae9c=function(_0x52c511,_0x13f96d){_0x52c511=_0x52c511-0x0;var _0x518408=_0xe9ca[_0x52c511];return _0x518408;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae9c('0x0'));var zipdir=require(_0xae9c('0x1'));var jsonpatch=require(_0xae9c('0x2'));var rp=require(_0xae9c('0x3'));var moment=require(_0xae9c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xae9c('0x5'));var path=require(_0xae9c('0x6'));var sox=require(_0xae9c('0x7'));var csv=require(_0xae9c('0x8'));var ejs=require(_0xae9c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae9c('0xa'));var squel=require(_0xae9c('0xb'));var crypto=require(_0xae9c('0xc'));var jsforce=require(_0xae9c('0xd'));var deskjs=require(_0xae9c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xae9c('0xf'));var Papa=require(_0xae9c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xae9c('0x11'));var as=require(_0xae9c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae9c('0x13'))(_0xae9c('0x14'));var utils=require(_0xae9c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xae9c('0x16'))['db'];function respondWithStatusCode(_0x4e6422,_0x28e469){_0x28e469=_0x28e469||0xcc;return function(_0x1d0b46){if(_0x1d0b46){return _0x4e6422[_0xae9c('0x17')](_0x28e469);}return _0x4e6422[_0xae9c('0x18')](_0x28e469)[_0xae9c('0x19')]();};}function respondWithResult(_0x1b6e6c,_0x25ad0a){_0x25ad0a=_0x25ad0a||0xc8;return function(_0x406b6d){if(_0x406b6d){return _0x1b6e6c['status'](_0x25ad0a)[_0xae9c('0x1a')](_0x406b6d);}};}function respondWithFilteredResult(_0x40735f,_0x4530ce){return function(_0x3c5086){if(_0x3c5086){var _0xeee5c3=typeof _0x4530ce['offset']===_0xae9c('0x1b')&&typeof _0x4530ce[_0xae9c('0x1c')]===_0xae9c('0x1b');var _0x2a074e=_0x3c5086[_0xae9c('0x1d')];var _0x5ad39e=_0xeee5c3?0x0:_0x4530ce[_0xae9c('0x1e')];var _0x166db0=_0xeee5c3?_0x3c5086[_0xae9c('0x1d')]:_0x4530ce['offset']+_0x4530ce[_0xae9c('0x1c')];var _0x4ef1ca;if(_0x166db0>=_0x2a074e){_0x166db0=_0x2a074e;_0x4ef1ca=0xc8;}else{_0x4ef1ca=0xce;}_0x40735f['status'](_0x4ef1ca);return _0x40735f[_0xae9c('0x1f')](_0xae9c('0x20'),_0x5ad39e+'-'+_0x166db0+'/'+_0x2a074e)[_0xae9c('0x1a')](_0x3c5086);}return null;};}function patchUpdates(_0xc33971){return function(_0x2fc43a){try{jsonpatch[_0xae9c('0x21')](_0x2fc43a,_0xc33971,!![]);}catch(_0x444802){return BPromise['reject'](_0x444802);}return _0x2fc43a['save']();};}function saveUpdates(_0x1b2142,_0x17c25b){return function(_0x27f3f1){if(_0x27f3f1){return _0x27f3f1[_0xae9c('0x22')](_0x1b2142)[_0xae9c('0x23')](function(_0x3c2d0d){return _0x3c2d0d;});}return null;};}function removeEntity(_0x1d6d23,_0x2e3f53){return function(_0x2c2d44){if(_0x2c2d44){return _0x2c2d44[_0xae9c('0x24')]()['then'](function(){_0x1d6d23[_0xae9c('0x18')](0xcc)[_0xae9c('0x19')]();});}};}function handleEntityNotFound(_0x12722e,_0x598d2d){return function(_0x38e2ad){if(!_0x38e2ad){_0x12722e[_0xae9c('0x17')](0x194);}return _0x38e2ad;};}function handleError(_0x5183ba,_0x5292dc){_0x5292dc=_0x5292dc||0x1f4;return function(_0x4a6c31){logger[_0xae9c('0x25')](_0x4a6c31[_0xae9c('0x26')]);if(_0x4a6c31[_0xae9c('0x27')]){delete _0x4a6c31[_0xae9c('0x27')];}_0x5183ba[_0xae9c('0x18')](_0x5292dc)['send'](_0x4a6c31);};}exports[_0xae9c('0x28')]=function(_0x347839,_0x1dc0a4){var _0x39a9de={},_0x5995f6={},_0x57b5aa={'count':0x0,'rows':[]};var _0x22b77c=_[_0xae9c('0x29')](db[_0xae9c('0x2a')][_0xae9c('0x2b')],function(_0x45ea63){return{'name':_0x45ea63[_0xae9c('0x2c')],'type':_0x45ea63[_0xae9c('0x2d')][_0xae9c('0x2e')]};});_0x5995f6[_0xae9c('0x2f')]=_[_0xae9c('0x29')](_0x22b77c,'name');_0x5995f6[_0xae9c('0x30')]=_[_0xae9c('0x31')](_0x347839[_0xae9c('0x30')]);_0x5995f6[_0xae9c('0x32')]=_[_0xae9c('0x33')](_0x5995f6[_0xae9c('0x2f')],_0x5995f6['query']);_0x39a9de[_0xae9c('0x34')]=_[_0xae9c('0x33')](_0x5995f6['model'],qs[_0xae9c('0x35')](_0x347839[_0xae9c('0x30')]['fields']));_0x39a9de[_0xae9c('0x34')]=_0x39a9de[_0xae9c('0x34')][_0xae9c('0x36')]?_0x39a9de['attributes']:_0x5995f6[_0xae9c('0x2f')];if(!_0x347839[_0xae9c('0x30')][_0xae9c('0x37')](_0xae9c('0x38'))){_0x39a9de['limit']=qs[_0xae9c('0x1c')](_0x347839[_0xae9c('0x30')][_0xae9c('0x1c')]);_0x39a9de['offset']=qs[_0xae9c('0x1e')](_0x347839['query'][_0xae9c('0x1e')]);}_0x39a9de['order']=qs[_0xae9c('0x39')](_0x347839[_0xae9c('0x30')]['sort']);_0x39a9de['where']=qs[_0xae9c('0x32')](_[_0xae9c('0x3a')](_0x347839['query'],_0x5995f6[_0xae9c('0x32')]),_0x22b77c);if(_0x347839[_0xae9c('0x30')][_0xae9c('0x3b')]){_0x39a9de['where']=_[_0xae9c('0x3c')](_0x39a9de[_0xae9c('0x3d')],{'$or':_[_0xae9c('0x29')](_0x22b77c,function(_0x1ad9c5){if(_0x1ad9c5[_0xae9c('0x2d')]!=='VIRTUAL'){var _0x349ad5={};_0x349ad5[_0x1ad9c5[_0xae9c('0x27')]]={'$like':'%'+_0x347839[_0xae9c('0x30')]['filter']+'%'};return _0x349ad5;}})});}_0x39a9de=_[_0xae9c('0x3c')]({},_0x39a9de,_0x347839[_0xae9c('0x3e')]);var _0x3385d1={'where':_0x39a9de[_0xae9c('0x3d')]};return db[_0xae9c('0x2a')]['count'](_0x3385d1)['then'](function(_0x45b3c4){_0x57b5aa['count']=_0x45b3c4;if(_0x347839[_0xae9c('0x30')][_0xae9c('0x3f')]){_0x39a9de['include']=[{'all':!![]}];}return db[_0xae9c('0x2a')][_0xae9c('0x40')](_0x39a9de);})[_0xae9c('0x23')](function(_0x374f34){_0x57b5aa[_0xae9c('0x41')]=_0x374f34;return _0x57b5aa;})[_0xae9c('0x23')](respondWithFilteredResult(_0x1dc0a4,_0x39a9de))[_0xae9c('0x42')](handleError(_0x1dc0a4,null));};exports[_0xae9c('0x43')]=function(_0x539765,_0x3d0b0e){var _0x5a24a8={'raw':!![],'where':{'id':_0x539765[_0xae9c('0x44')]['id']}},_0x2d1316={};_0x2d1316[_0xae9c('0x2f')]=_[_0xae9c('0x31')](db[_0xae9c('0x2a')]['rawAttributes']);_0x2d1316[_0xae9c('0x30')]=_['keys'](_0x539765[_0xae9c('0x30')]);_0x2d1316[_0xae9c('0x32')]=_[_0xae9c('0x33')](_0x2d1316['model'],_0x2d1316[_0xae9c('0x30')]);_0x5a24a8['attributes']=_[_0xae9c('0x33')](_0x2d1316[_0xae9c('0x2f')],qs[_0xae9c('0x35')](_0x539765[_0xae9c('0x30')][_0xae9c('0x35')]));_0x5a24a8['attributes']=_0x5a24a8[_0xae9c('0x34')][_0xae9c('0x36')]?_0x5a24a8[_0xae9c('0x34')]:_0x2d1316[_0xae9c('0x2f')];if(_0x539765[_0xae9c('0x30')][_0xae9c('0x3f')]){_0x5a24a8[_0xae9c('0x45')]=[{'all':!![]}];}_0x5a24a8=_['merge']({},_0x5a24a8,_0x539765[_0xae9c('0x3e')]);return db[_0xae9c('0x2a')]['find'](_0x5a24a8)['then'](handleEntityNotFound(_0x3d0b0e,null))[_0xae9c('0x23')](respondWithResult(_0x3d0b0e,null))[_0xae9c('0x42')](handleError(_0x3d0b0e,null));};exports[_0xae9c('0x46')]=function(_0x3eb59a,_0x394b76){return db['VtigerField'][_0xae9c('0x46')](_0x3eb59a[_0xae9c('0x47')],{})[_0xae9c('0x23')](respondWithResult(_0x394b76,0xc9))[_0xae9c('0x42')](handleError(_0x394b76,null));};exports['update']=function(_0x516e17,_0xcc20ce){if(_0x516e17[_0xae9c('0x47')]['id']){delete _0x516e17['body']['id'];}return db[_0xae9c('0x2a')]['find']({'where':{'id':_0x516e17[_0xae9c('0x44')]['id']}})[_0xae9c('0x23')](handleEntityNotFound(_0xcc20ce,null))[_0xae9c('0x23')](saveUpdates(_0x516e17['body'],null))['then'](respondWithResult(_0xcc20ce,null))[_0xae9c('0x42')](handleError(_0xcc20ce,null));};exports[_0xae9c('0x24')]=function(_0x1e855b,_0x3c3338){return db['VtigerField']['find']({'where':{'id':_0x1e855b[_0xae9c('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c3338,null))[_0xae9c('0x23')](removeEntity(_0x3c3338,null))['catch'](handleError(_0x3c3338,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index c70d204..1381b31 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(_0x1b760d,_0x15a65b){var _0x2dfe37=function(_0x20cc9e){while(--_0x20cc9e){_0x1b760d['push'](_0x1b760d['shift']());}};_0x2dfe37(++_0x15a65b);}(_0x7a54,0x106));var _0x47a5=function(_0xf55cda,_0x2ac913){_0xf55cda=_0xf55cda-0x0;var _0x158040=_0x7a54[_0xf55cda];return _0x158040;};'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(_0x3ed824,_0x1ea959){var _0x2204c9=function(_0x5592ed){while(--_0x5592ed){_0x3ed824['push'](_0x3ed824['shift']());}};_0x2204c9(++_0x1ea959);}(_0x7a54,0x106));var _0x47a5=function(_0x2906e2,_0x4e78a3){_0x2906e2=_0x2906e2-0x0;var _0x239098=_0x7a54[_0x2906e2];return _0x239098;};'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 030818e..b1c07a8 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 _0x19e1=['moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','VtigerField,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0xa317a6,_0x2934eb){var _0x3747c8=function(_0x110927){while(--_0x110927){_0xa317a6['push'](_0xa317a6['shift']());}};_0x3747c8(++_0x2934eb);}(_0x19e1,0x163));var _0x119e=function(_0x2de020,_0x252df0){_0x2de020=_0x2de020-0x0;var _0x182b7c=_0x19e1[_0x2de020];return _0x182b7c;};'use strict';var _=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var moment=require(_0x119e('0x2'));var BPromise=require(_0x119e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x119e('0x4'))['db'];var utils=require(_0x119e('0x5'));var logger=require('../../config/logger')(_0x119e('0x6'));var config=require(_0x119e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x119e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b5306,_0x25e166,_0x16a2ee){return new BPromise(function(_0x1b3797,_0x53d5b7){return client[_0x119e('0x9')](_0x1b5306,_0x16a2ee)[_0x119e('0xa')](function(_0x1a6747){logger['info']('VtigerField,\x20%s,\x20%s',_0x25e166,_0x119e('0xb'));logger[_0x119e('0xc')](_0x119e('0xd'),_0x25e166,_0x119e('0xb'),JSON[_0x119e('0xe')](_0x1a6747));if(_0x1a6747[_0x119e('0xf')]){if(_0x1a6747[_0x119e('0xf')]['code']===0x1f4){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x53d5b7(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}logger['error'](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x1b3797(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}else{logger[_0x119e('0x12')](_0x119e('0x10'),_0x25e166,_0x119e('0xb'));_0x1b3797(_0x1a6747[_0x119e('0x13')][_0x119e('0x11')]);}})[_0x119e('0x14')](function(_0x54c326){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x54c326);_0x53d5b7(_0x54c326);});});} \ No newline at end of file +var _0x7072=['randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0xd6db21,_0x1d08f3){var _0x3b96a0=function(_0x157017){while(--_0x157017){_0xd6db21['push'](_0xd6db21['shift']());}};_0x3b96a0(++_0x1d08f3);}(_0x7072,0x138));var _0x2707=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x7072[_0x125ff8];return _0x2d9ef;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var moment=require(_0x2707('0x1'));var BPromise=require(_0x2707('0x2'));var rs=require(_0x2707('0x3'));var fs=require('fs');var Redis=require(_0x2707('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2707('0x5'))('rpc');var config=require(_0x2707('0x6'));var jayson=require(_0x2707('0x7'));var client=jayson[_0x2707('0x8')][_0x2707('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd8ff,_0x128205,_0x21b0a0){return new BPromise(function(_0x745cfd,_0x4062b6){return client[_0x2707('0xa')](_0x2fd8ff,_0x21b0a0)['then'](function(_0x597ff9){logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));logger[_0x2707('0xe')](_0x2707('0xf'),_0x128205,_0x2707('0xd'),JSON[_0x2707('0x10')](_0x597ff9));if(_0x597ff9[_0x2707('0x11')]){if(_0x597ff9[_0x2707('0x11')][_0x2707('0x12')]===0x1f4){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')]['message']);return _0x4062b6(_0x597ff9[_0x2707('0x11')]['message']);}logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')][_0x2707('0x13')]);return _0x745cfd(_0x597ff9[_0x2707('0x11')]['message']);}else{logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));_0x745cfd(_0x597ff9['result'][_0x2707('0x13')]);}})[_0x2707('0x14')](function(_0x1a979e){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x1a979e);_0x4062b6(_0x1a979e);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index daa1afe..f43b1ba 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 _0xd8fb=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','index','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','isAuthenticated','put','update','delete','destroy','exports','multer'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xd8fb,0x99));var _0xbd8f=function(_0x564aa6,_0x21b8da){_0x564aa6=_0x564aa6-0x0;var _0x133d68=_0xd8fb[_0x564aa6];return _0x133d68;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0x8')]);router['get'](_0xbd8f('0x9'),auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xbd8f('0xb')]);router[_0xbd8f('0x7')](_0xbd8f('0xc'),auth['isAuthenticated'](),controller[_0xbd8f('0xd')]);router[_0xbd8f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbd8f('0xe')](_0xbd8f('0xf'),auth[_0xbd8f('0x10')](),controller['addConfiguration']);router[_0xbd8f('0x11')](_0xbd8f('0x9'),auth[_0xbd8f('0x10')](),controller[_0xbd8f('0x12')]);router[_0xbd8f('0x13')](_0xbd8f('0x9'),auth[_0xbd8f('0x10')](),controller[_0xbd8f('0x14')]);module[_0xbd8f('0x15')]=router; \ No newline at end of file +var _0xfd20=['destroy','exports','util','express','Router','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','/:id','update'];(function(_0x5529c7,_0x204602){var _0x507f58=function(_0x49a77f){while(--_0x49a77f){_0x5529c7['push'](_0x5529c7['shift']());}};_0x507f58(++_0x204602);}(_0xfd20,0x66));var _0x0fd2=function(_0x443111,_0x3c94ae){_0x443111=_0x443111-0x0;var _0x3056c5=_0xfd20[_0x443111];return _0x3056c5;};'use strict';var multer=require('multer');var util=require(_0x0fd2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0fd2('0x1'));var router=express[_0x0fd2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0fd2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0fd2('0x4'));var controller=require(_0x0fd2('0x5'));router[_0x0fd2('0x6')]('/',auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x8')]);router['get']('/:id',auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x9')]);router[_0x0fd2('0x6')](_0x0fd2('0xa'),auth[_0x0fd2('0x7')](),controller[_0x0fd2('0xb')]);router[_0x0fd2('0x6')]('/:id/fields',auth[_0x0fd2('0x7')](),controller[_0x0fd2('0xc')]);router['post']('/',auth[_0x0fd2('0x7')](),controller['create']);router[_0x0fd2('0xd')](_0x0fd2('0xa'),auth[_0x0fd2('0x7')](),controller[_0x0fd2('0xe')]);router[_0x0fd2('0xf')](_0x0fd2('0x10'),auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x11')]);router['delete']('/:id',auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x12')]);module[_0x0fd2('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 0161a0b..32ccd24 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 _0x163b=['integrationTab','newTab','sequelize','exports','STRING','remoteUri','ENUM','token','password'];(function(_0x49c78d,_0x146218){var _0xa9d0c9=function(_0x1bdc0a){while(--_0x1bdc0a){_0x49c78d['push'](_0x49c78d['shift']());}};_0xa9d0c9(++_0x146218);}(_0x163b,0x158));var _0xb163=function(_0x596bcf,_0x54405e){_0x596bcf=_0x596bcf-0x0;var _0x43a9db=_0x163b[_0x596bcf];return _0x43a9db;};'use strict';var Sequelize=require(_0xb163('0x0'));module[_0xb163('0x1')]={'name':{'type':Sequelize[_0xb163('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb163('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xb163('0x2')]},'token':{'type':Sequelize[_0xb163('0x2')]},'remoteUri':{'type':Sequelize[_0xb163('0x2')],'unique':_0xb163('0x3')},'authType':{'type':Sequelize[_0xb163('0x4')]('password',_0xb163('0x5')),'defaultValue':_0xb163('0x6')},'serverUrl':{'type':Sequelize[_0xb163('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb163('0x4')](_0xb163('0x7'),_0xb163('0x8')),'defaultValue':_0xb163('0x7')}}; \ No newline at end of file +var _0x9b77=['integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM','password','token'];(function(_0x37a0ab,_0x34b900){var _0x13ca1d=function(_0x3c6a41){while(--_0x3c6a41){_0x37a0ab['push'](_0x37a0ab['shift']());}};_0x13ca1d(++_0x34b900);}(_0x9b77,0x17e));var _0x79b7=function(_0x207140,_0x4c6556){_0x207140=_0x207140-0x0;var _0x39e8cf=_0x9b77[_0x207140];return _0x39e8cf;};'use strict';var Sequelize=require(_0x79b7('0x0'));module[_0x79b7('0x1')]={'name':{'type':Sequelize[_0x79b7('0x2')]},'description':{'type':Sequelize[_0x79b7('0x2')]},'username':{'type':Sequelize[_0x79b7('0x2')],'unique':_0x79b7('0x3')},'password':{'type':Sequelize[_0x79b7('0x2')]},'token':{'type':Sequelize[_0x79b7('0x2')]},'remoteUri':{'type':Sequelize[_0x79b7('0x2')],'unique':_0x79b7('0x4')},'authType':{'type':Sequelize[_0x79b7('0x5')](_0x79b7('0x6'),_0x79b7('0x7')),'defaultValue':_0x79b7('0x6')},'serverUrl':{'type':Sequelize[_0x79b7('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x79b7('0x5')](_0x79b7('0x8'),_0x79b7('0x9')),'defaultValue':_0x79b7('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index fdeff08..69f5e4c 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 _0x3e87=['key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','body','findOne','length','order','options','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZendeskConfiguration','ZendeskField','username','remoteUri','slice','substring','%s/%s','ticket_fields','headers','format','Basic\x20%s','%s:%s','password','toString','base64','token','Sequelize','Unknown\x20authentication\x20type','subject','description','group','remove','includes','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','end','stack','name','send','index','ZendeskAccount','fieldName','type'];(function(_0x2b5979,_0x3773e0){var _0x49cb09=function(_0x24dbfc){while(--_0x24dbfc){_0x2b5979['push'](_0x2b5979['shift']());}};_0x49cb09(++_0x3773e0);}(_0x3e87,0x1b5));var _0x73e8=function(_0x1abb54,_0x16cf32){_0x1abb54=_0x1abb54-0x0;var _0xeb83f0=_0x3e87[_0x1abb54];return _0xeb83f0;};'use strict';var emlformat=require(_0x73e8('0x0'));var rimraf=require(_0x73e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x73e8('0x2'));var rp=require(_0x73e8('0x3'));var moment=require('moment');var BPromise=require(_0x73e8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x73e8('0x5'));var csv=require(_0x73e8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73e8('0x7'));var _=require(_0x73e8('0x8'));var squel=require('squel');var crypto=require(_0x73e8('0x9'));var jsforce=require(_0x73e8('0xa'));var deskjs=require(_0x73e8('0xb'));var toCsv=require(_0x73e8('0x6'));var querystring=require(_0x73e8('0xc'));var Papa=require(_0x73e8('0xd'));var Redis=require(_0x73e8('0xe'));var authService=require(_0x73e8('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x73e8('0x10'));var logger=require('../../config/logger')(_0x73e8('0x11'));var utils=require('../../config/utils');var config=require(_0x73e8('0x12'));var licenseUtil=require(_0x73e8('0x13'));var db=require(_0x73e8('0x14'))['db'];var integrations=require(_0x73e8('0x15'));var jayson=require(_0x73e8('0x16'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10716,_0x24898f,_0x2a9e27,_0xdaec86){return new BPromise(function(_0x2e6d27,_0x1e9fe7){var _0x527b3b=_0xdaec86||client;return _0x527b3b['request'](_0x10716,_0x2a9e27)['then'](function(_0x250ab){logger[_0x73e8('0x17')](_0x73e8('0x18'),_0x24898f,'request\x20sent');logger[_0x73e8('0x19')](_0x73e8('0x1a'),_0x24898f,_0x73e8('0x1b'),JSON['stringify'](_0x250ab));if(_0x250ab[_0x73e8('0x1c')]){if(_0x250ab[_0x73e8('0x1c')][_0x73e8('0x1d')]===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x24898f,_0x250ab[_0x73e8('0x1c')][_0x73e8('0x1e')]);return _0x1e9fe7(_0x250ab[_0x73e8('0x1c')][_0x73e8('0x1e')]);}logger[_0x73e8('0x1c')](_0x73e8('0x18'),_0x24898f,_0x250ab[_0x73e8('0x1c')][_0x73e8('0x1e')]);return _0x2e6d27(_0x250ab[_0x73e8('0x1c')]['message']);}else{logger[_0x73e8('0x17')](_0x73e8('0x18'),_0x24898f,_0x73e8('0x1b'));_0x2e6d27(_0x250ab[_0x73e8('0x1f')][_0x73e8('0x1e')]);}})[_0x73e8('0x20')](function(_0x169bb0){logger[_0x73e8('0x1c')](_0x73e8('0x18'),_0x24898f,_0x169bb0);_0x1e9fe7(_0x169bb0);});});}function respondWithStatusCode(_0x31ce5c,_0x5bc0de){_0x5bc0de=_0x5bc0de||0xcc;return function(_0xa2922c){if(_0xa2922c){return _0x31ce5c[_0x73e8('0x21')](_0x5bc0de);}return _0x31ce5c['status'](_0x5bc0de)['end']();};}function respondWithResult(_0x191c99,_0x1bbb4c){_0x1bbb4c=_0x1bbb4c||0xc8;return function(_0x249b58){if(_0x249b58){return _0x191c99[_0x73e8('0x22')](_0x1bbb4c)['json'](_0x249b58);}};}function respondWithFilteredResult(_0x5d05b9,_0x14df3f){return function(_0x224fe7){if(_0x224fe7){var _0x3d1301=typeof _0x14df3f['offset']===_0x73e8('0x23')&&typeof _0x14df3f[_0x73e8('0x24')]===_0x73e8('0x23');var _0x2e1bf6=_0x224fe7[_0x73e8('0x25')];var _0x10073b=_0x3d1301?0x0:_0x14df3f[_0x73e8('0x26')];var _0x5c1d18=_0x3d1301?_0x224fe7[_0x73e8('0x25')]:_0x14df3f[_0x73e8('0x26')]+_0x14df3f[_0x73e8('0x24')];var _0x4e38f4;if(_0x5c1d18>=_0x2e1bf6){_0x5c1d18=_0x2e1bf6;_0x4e38f4=0xc8;}else{_0x4e38f4=0xce;}_0x5d05b9[_0x73e8('0x22')](_0x4e38f4);return _0x5d05b9[_0x73e8('0x27')](_0x73e8('0x28'),_0x10073b+'-'+_0x5c1d18+'/'+_0x2e1bf6)[_0x73e8('0x29')](_0x224fe7);}return null;};}function patchUpdates(_0x4634ef){return function(_0x1d670d){try{jsonpatch['apply'](_0x1d670d,_0x4634ef,!![]);}catch(_0x1ef159){return BPromise[_0x73e8('0x2a')](_0x1ef159);}return _0x1d670d[_0x73e8('0x2b')]();};}function saveUpdates(_0x4442d8,_0x342b77){return function(_0x599b26){if(_0x599b26){return _0x599b26[_0x73e8('0x2c')](_0x4442d8)[_0x73e8('0x2d')](function(_0x221fae){return _0x221fae;});}return null;};}function removeEntity(_0x145949,_0x7dbdc4){return function(_0x19e4e7){if(_0x19e4e7){return _0x19e4e7[_0x73e8('0x2e')]()['then'](function(){_0x145949[_0x73e8('0x22')](0xcc)[_0x73e8('0x2f')]();});}};}function handleEntityNotFound(_0x484cc4,_0x6df5ab){return function(_0x231f5b){if(!_0x231f5b){_0x484cc4['sendStatus'](0x194);}return _0x231f5b;};}function handleError(_0x2cda90,_0x4aee60){_0x4aee60=_0x4aee60||0x1f4;return function(_0x429c1e){logger[_0x73e8('0x1c')](_0x429c1e[_0x73e8('0x30')]);if(_0x429c1e[_0x73e8('0x31')]){delete _0x429c1e[_0x73e8('0x31')];}_0x2cda90['status'](_0x4aee60)[_0x73e8('0x32')](_0x429c1e);};}exports[_0x73e8('0x33')]=function(_0x50484c,_0x3c8eb0){var _0x612b47={},_0x3b6118={},_0x593bd5={'count':0x0,'rows':[]};var _0x1e69db=_['map'](db[_0x73e8('0x34')]['rawAttributes'],function(_0x1e9c89){return{'name':_0x1e9c89[_0x73e8('0x35')],'type':_0x1e9c89[_0x73e8('0x36')][_0x73e8('0x37')]};});_0x3b6118[_0x73e8('0x38')]=_[_0x73e8('0x39')](_0x1e69db,_0x73e8('0x31'));_0x3b6118[_0x73e8('0x3a')]=_['keys'](_0x50484c[_0x73e8('0x3a')]);_0x3b6118[_0x73e8('0x3b')]=_['intersection'](_0x3b6118[_0x73e8('0x38')],_0x3b6118[_0x73e8('0x3a')]);_0x612b47[_0x73e8('0x3c')]=_[_0x73e8('0x3d')](_0x3b6118[_0x73e8('0x38')],qs[_0x73e8('0x3e')](_0x50484c[_0x73e8('0x3a')][_0x73e8('0x3e')]));_0x612b47[_0x73e8('0x3c')]=_0x612b47['attributes']['length']?_0x612b47[_0x73e8('0x3c')]:_0x3b6118[_0x73e8('0x38')];if(!_0x50484c['query'][_0x73e8('0x3f')](_0x73e8('0x40'))){_0x612b47[_0x73e8('0x24')]=qs['limit'](_0x50484c['query']['limit']);_0x612b47['offset']=qs[_0x73e8('0x26')](_0x50484c['query'][_0x73e8('0x26')]);}_0x612b47['order']=qs[_0x73e8('0x41')](_0x50484c[_0x73e8('0x3a')][_0x73e8('0x41')]);_0x612b47[_0x73e8('0x42')]=qs['filters'](_[_0x73e8('0x43')](_0x50484c['query'],_0x3b6118[_0x73e8('0x3b')]),_0x1e69db);if(_0x50484c[_0x73e8('0x3a')][_0x73e8('0x44')]){_0x612b47[_0x73e8('0x42')]=_[_0x73e8('0x45')](_0x612b47[_0x73e8('0x42')],{'$or':_['map'](_0x1e69db,function(_0x388702){if(_0x388702[_0x73e8('0x36')]!==_0x73e8('0x46')){var _0x30af76={};_0x30af76[_0x388702[_0x73e8('0x31')]]={'$like':'%'+_0x50484c[_0x73e8('0x3a')]['filter']+'%'};return _0x30af76;}})});}_0x612b47=_[_0x73e8('0x45')]({},_0x612b47,_0x50484c['options']);var _0xdb7df5={'where':_0x612b47[_0x73e8('0x42')]};return db['ZendeskAccount']['count'](_0xdb7df5)[_0x73e8('0x2d')](function(_0x40da38){_0x593bd5[_0x73e8('0x25')]=_0x40da38;if(_0x50484c['query'][_0x73e8('0x47')]){_0x612b47[_0x73e8('0x48')]=[{'all':!![]}];}return db[_0x73e8('0x34')][_0x73e8('0x49')](_0x612b47);})[_0x73e8('0x2d')](function(_0x52141f){_0x593bd5[_0x73e8('0x4a')]=_0x52141f;return _0x593bd5;})[_0x73e8('0x2d')](respondWithFilteredResult(_0x3c8eb0,_0x612b47))[_0x73e8('0x20')](handleError(_0x3c8eb0,null));};exports[_0x73e8('0x4b')]=function(_0x4a95e2,_0x3e191f){var _0x31731f={'raw':![],'where':{'id':_0x4a95e2[_0x73e8('0x4c')]['id']}},_0xf77ac0={};_0xf77ac0[_0x73e8('0x38')]=_[_0x73e8('0x4d')](db[_0x73e8('0x34')][_0x73e8('0x4e')]);_0xf77ac0[_0x73e8('0x3a')]=_[_0x73e8('0x4d')](_0x4a95e2['query']);_0xf77ac0[_0x73e8('0x3b')]=_[_0x73e8('0x3d')](_0xf77ac0[_0x73e8('0x38')],_0xf77ac0[_0x73e8('0x3a')]);_0x31731f['attributes']=_[_0x73e8('0x3d')](_0xf77ac0[_0x73e8('0x38')],qs[_0x73e8('0x3e')](_0x4a95e2[_0x73e8('0x3a')][_0x73e8('0x3e')]));_0x31731f[_0x73e8('0x3c')]=_0x31731f[_0x73e8('0x3c')]['length']?_0x31731f['attributes']:_0xf77ac0[_0x73e8('0x38')];if(_0x4a95e2['query'][_0x73e8('0x47')]){_0x31731f['include']=[{'all':!![]}];}_0x31731f=_[_0x73e8('0x45')]({},_0x31731f,_0x4a95e2['options']);return db['ZendeskAccount'][_0x73e8('0x4f')](_0x31731f)['then'](handleEntityNotFound(_0x3e191f,null))[_0x73e8('0x2d')](respondWithResult(_0x3e191f,null))[_0x73e8('0x20')](handleError(_0x3e191f,null));};exports[_0x73e8('0x50')]=function(_0x2ef872,_0x5a5c61){return db[_0x73e8('0x34')]['create'](_0x2ef872[_0x73e8('0x51')],{})['then'](respondWithResult(_0x5a5c61,0xc9))[_0x73e8('0x20')](handleError(_0x5a5c61,null));};exports[_0x73e8('0x2c')]=function(_0x536d61,_0x15a00d){if(_0x536d61['body']['id']){delete _0x536d61[_0x73e8('0x51')]['id'];}return db['ZendeskAccount'][_0x73e8('0x4f')]({'where':{'id':_0x536d61['params']['id']}})[_0x73e8('0x2d')](handleEntityNotFound(_0x15a00d,null))[_0x73e8('0x2d')](saveUpdates(_0x536d61[_0x73e8('0x51')],null))[_0x73e8('0x2d')](respondWithResult(_0x15a00d,null))[_0x73e8('0x20')](handleError(_0x15a00d,null));};exports[_0x73e8('0x2e')]=function(_0x463ece,_0x2c61a5){return db[_0x73e8('0x34')][_0x73e8('0x4f')]({'where':{'id':_0x463ece[_0x73e8('0x4c')]['id']}})[_0x73e8('0x2d')](handleEntityNotFound(_0x2c61a5,null))['then'](removeEntity(_0x2c61a5,null))[_0x73e8('0x20')](handleError(_0x2c61a5,null));};exports['getConfigurations']=function(_0x412b5c,_0x8eddaa,_0x27f083){var _0x35b79c={};var _0x2b16e1={};var _0x1fa686;var _0x2686aa;return db[_0x73e8('0x34')][_0x73e8('0x52')]({'where':{'id':_0x412b5c[_0x73e8('0x4c')]['id']}})[_0x73e8('0x2d')](handleEntityNotFound(_0x8eddaa,null))[_0x73e8('0x2d')](function(_0x3091ac){if(_0x3091ac){_0x1fa686=_0x3091ac;_0x2b16e1[_0x73e8('0x38')]=_['keys'](db['ZendeskConfiguration'][_0x73e8('0x4e')]);_0x2b16e1[_0x73e8('0x3a')]=_[_0x73e8('0x4d')](_0x412b5c[_0x73e8('0x3a')]);_0x2b16e1[_0x73e8('0x3b')]=_['intersection'](_0x2b16e1[_0x73e8('0x38')],_0x2b16e1[_0x73e8('0x3a')]);_0x35b79c[_0x73e8('0x3c')]=_[_0x73e8('0x3d')](_0x2b16e1[_0x73e8('0x38')],qs[_0x73e8('0x3e')](_0x412b5c[_0x73e8('0x3a')][_0x73e8('0x3e')]));_0x35b79c[_0x73e8('0x3c')]=_0x35b79c[_0x73e8('0x3c')][_0x73e8('0x53')]?_0x35b79c[_0x73e8('0x3c')]:_0x2b16e1[_0x73e8('0x38')];_0x35b79c[_0x73e8('0x54')]=qs['sort'](_0x412b5c[_0x73e8('0x3a')][_0x73e8('0x41')]);_0x35b79c[_0x73e8('0x42')]=qs['filters'](_[_0x73e8('0x43')](_0x412b5c[_0x73e8('0x3a')],_0x2b16e1[_0x73e8('0x3b')]));if(_0x412b5c[_0x73e8('0x3a')]['filter']){_0x35b79c[_0x73e8('0x42')]=_['merge'](_0x35b79c[_0x73e8('0x42')],{'$or':_[_0x73e8('0x39')](_0x35b79c[_0x73e8('0x3c')],function(_0x28d5ae){var _0x2305db={};_0x2305db[_0x28d5ae]={'$like':'%'+_0x412b5c['query'][_0x73e8('0x44')]+'%'};return _0x2305db;})});}_0x35b79c=_['merge']({},_0x35b79c,_0x412b5c[_0x73e8('0x55')]);return _0x1fa686[_0x73e8('0x56')](_0x35b79c);}})[_0x73e8('0x2d')](function(_0x2d03d8){if(_0x2d03d8){_0x2686aa=_0x2d03d8[_0x73e8('0x53')];if(!_0x412b5c[_0x73e8('0x3a')]['hasOwnProperty'](_0x73e8('0x40'))){_0x35b79c[_0x73e8('0x24')]=qs[_0x73e8('0x24')](_0x412b5c['query'][_0x73e8('0x24')]);_0x35b79c[_0x73e8('0x26')]=qs[_0x73e8('0x26')](_0x412b5c['query'][_0x73e8('0x26')]);}return _0x1fa686[_0x73e8('0x56')](_0x35b79c);}})['then'](function(_0x53d9c9){if(_0x53d9c9){return _0x53d9c9?{'count':_0x2686aa,'rows':_0x53d9c9}:null;}})[_0x73e8('0x2d')](respondWithResult(_0x8eddaa,null))[_0x73e8('0x20')](handleError(_0x8eddaa,null));};exports[_0x73e8('0x57')]=function(_0xb89ca0,_0x53c1bd,_0x5abf4b){if(_0xb89ca0[_0x73e8('0x51')]['id']){delete _0xb89ca0[_0x73e8('0x51')]['id'];}return db[_0x73e8('0x34')][_0x73e8('0x52')]({'where':{'id':_0xb89ca0[_0x73e8('0x4c')]['id']}})[_0x73e8('0x2d')](handleEntityNotFound(_0x53c1bd,null))[_0x73e8('0x2d')](function(_0x15de8e){if(_0x15de8e){_0xb89ca0['body'][_0x73e8('0x58')]=_0x15de8e['id'];_0xb89ca0['body'][_0x73e8('0x59')]=integrations[_0x73e8('0x5a')](_0xb89ca0['body'][_0x73e8('0x5b')],_0xb89ca0[_0x73e8('0x51')][_0x73e8('0x36')]);_0xb89ca0[_0x73e8('0x51')][_0x73e8('0x5c')]=integrations['getDescriptions'](_0xb89ca0[_0x73e8('0x51')]['channel'],_0xb89ca0['body']['type']);return db[_0x73e8('0x5d')]['create'](_0xb89ca0[_0x73e8('0x51')],{'include':[{'model':db[_0x73e8('0x5e')],'as':_0x73e8('0x59')},{'model':db[_0x73e8('0x5e')],'as':_0x73e8('0x5c')}]});}return null;})[_0x73e8('0x2d')](respondWithResult(_0x53c1bd,null))[_0x73e8('0x20')](handleError(_0x53c1bd,null));};exports['getFields']=function(_0x3413b1,_0x1dd16c,_0x2ab8f8){var _0x2c69ba='';return db['ZendeskAccount'][_0x73e8('0x52')]({'where':{'id':_0x3413b1[_0x73e8('0x4c')]['id']},'attributes':['id',_0x73e8('0x5f'),'password','token','authType',_0x73e8('0x60')]})[_0x73e8('0x2d')](handleEntityNotFound(_0x1dd16c,null))[_0x73e8('0x2d')](function(_0x349c02){if(_0x349c02){_0x2c69ba=_0x349c02[_0x73e8('0x60')];var _0x522029=_0x2c69ba[_0x73e8('0x61')](-0x1);if(_0x522029==='/'){_0x2c69ba=_0x2c69ba[_0x73e8('0x62')](0x0,_0x2c69ba['lastIndexOf'](_0x522029));}var _0x241e96={'method':'GET','uri':util['format'](_0x73e8('0x63'),_0x2c69ba,_0x73e8('0x64')),'json':!![]};switch(_0x349c02['authType']){case'password':_0x241e96[_0x73e8('0x65')]={'Authorization':util[_0x73e8('0x66')](_0x73e8('0x67'),new Buffer(util[_0x73e8('0x66')](_0x73e8('0x68'),_0x349c02[_0x73e8('0x5f')],_0x349c02[_0x73e8('0x69')]))[_0x73e8('0x6a')](_0x73e8('0x6b')))};break;case _0x73e8('0x6c'):_0x241e96[_0x73e8('0x65')]={'Authorization':util[_0x73e8('0x66')](_0x73e8('0x67'),new Buffer(util[_0x73e8('0x66')]('%s/token:%s',_0x349c02[_0x73e8('0x5f')],_0x349c02['token']))[_0x73e8('0x6a')](_0x73e8('0x6b')))};break;default:throw new db[(_0x73e8('0x6d'))]['ValidationError'](_0x73e8('0x6e'));}return rp(_0x241e96);}})[_0x73e8('0x2d')](function(_0x1d22b8){if(_0x1d22b8){var _0x375abb=[_0x73e8('0x6f'),_0x73e8('0x70'),_0x73e8('0x71'),'assignee'];_[_0x73e8('0x72')](_0x1d22b8[_0x73e8('0x64')],function(_0x6e8a12){return _0x375abb[_0x73e8('0x73')](_0x6e8a12['type']);});return{'count':_0x1d22b8[_0x73e8('0x64')]['length'],'rows':_[_0x73e8('0x39')](_0x1d22b8['ticket_fields'],function(_0x3c9943){return{'id':_0x3c9943['id'],'name':_0x3c9943[_0x73e8('0x74')]>0x7?_0x3c9943['title']:_0x3c9943[_0x73e8('0x36')],'custom':_0x3c9943[_0x73e8('0x74')]>0x7?!![]:![],'options':_0x3c9943[_0x73e8('0x75')]?_0x3c9943[_0x73e8('0x75')]:_0x3c9943[_0x73e8('0x76')]?_0x3c9943['custom_field_options']:[]};})};}})[_0x73e8('0x2d')](respondWithResult(_0x1dd16c,null))[_0x73e8('0x20')](function(_0x341ab4){var _0xce5011=_0x3413b1[_0x73e8('0x3a')]['test']?0x1f4:_0x341ab4[_0x73e8('0x77')]||0x1f4;logger[_0x73e8('0x1c')](_0x73e8('0x78'),_0x73e8('0x79'),_0xce5011,JSON['stringify'](_0x341ab4));delete _0x341ab4['name'];if(_0xce5011===0x191){_0xce5011=0x190;}_0x1dd16c[_0x73e8('0x22')](_0xce5011)['send'](_0x3413b1[_0x73e8('0x3a')]['test']?{'message':_0x73e8('0x7a'),'statusCode':_0x341ab4[_0x73e8('0x77')]}:_0x341ab4);});}; \ No newline at end of file +var _0xc780=['message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','includeAll','include','ZendeskAccount','findAll','rows','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','nolimit','Subjects','getSubjects','channel','Descriptions','ZendeskField','getFields','authType','remoteUri','slice','substring','lastIndexOf','GET','ticket_fields','password','headers','format','Basic\x20%s','username','base64','token','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','remove','includes','title','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b778b,_0x4cf753){var _0x1c7151=function(_0x47be9b){while(--_0x47be9b){_0x4b778b['push'](_0x4b778b['shift']());}};_0x1c7151(++_0x4cf753);}(_0xc780,0xd4));var _0x0c78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc780[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0c78('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c78('0x1'));var jsonpatch=require(_0x0c78('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0c78('0x3'));var Mustache=require(_0x0c78('0x4'));var util=require(_0x0c78('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0c78('0x6'));var ejs=require(_0x0c78('0x7'));var fs=require('fs');var fs_extra=require(_0x0c78('0x8'));var _=require(_0x0c78('0x9'));var squel=require(_0x0c78('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0c78('0xb'));var toCsv=require(_0x0c78('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0c78('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x0c78('0xd'));var hardwareService=require(_0x0c78('0xe'));var logger=require('../../config/logger')(_0x0c78('0xf'));var utils=require(_0x0c78('0x10'));var config=require(_0x0c78('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c78('0x12'))['db'];var integrations=require(_0x0c78('0x13'));var jayson=require('jayson/promise');var client=jayson[_0x0c78('0x14')][_0x0c78('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x31e6a1,_0xb97d84,_0x5c37c0,_0x12e157){return new BPromise(function(_0x25d926,_0x2216a6){var _0x1f00ac=_0x12e157||client;return _0x1f00ac['request'](_0x31e6a1,_0x5c37c0)['then'](function(_0x5a3c35){logger[_0x0c78('0x16')](_0x0c78('0x17'),_0xb97d84,_0x0c78('0x18'));logger[_0x0c78('0x19')](_0x0c78('0x1a'),_0xb97d84,_0x0c78('0x18'),JSON[_0x0c78('0x1b')](_0x5a3c35));if(_0x5a3c35['error']){if(_0x5a3c35[_0x0c78('0x1c')][_0x0c78('0x1d')]===0x1f4){logger[_0x0c78('0x1c')]('ZendeskAccount,\x20%s,\x20%s',_0xb97d84,_0x5a3c35['error'][_0x0c78('0x1e')]);return _0x2216a6(_0x5a3c35[_0x0c78('0x1c')][_0x0c78('0x1e')]);}logger[_0x0c78('0x1c')]('ZendeskAccount,\x20%s,\x20%s',_0xb97d84,_0x5a3c35[_0x0c78('0x1c')]['message']);return _0x25d926(_0x5a3c35[_0x0c78('0x1c')]['message']);}else{logger[_0x0c78('0x16')](_0x0c78('0x17'),_0xb97d84,'request\x20sent');_0x25d926(_0x5a3c35[_0x0c78('0x1f')][_0x0c78('0x1e')]);}})[_0x0c78('0x20')](function(_0x1d0e91){logger[_0x0c78('0x1c')](_0x0c78('0x17'),_0xb97d84,_0x1d0e91);_0x2216a6(_0x1d0e91);});});}function respondWithStatusCode(_0x15c897,_0x176b51){_0x176b51=_0x176b51||0xcc;return function(_0x262a56){if(_0x262a56){return _0x15c897[_0x0c78('0x21')](_0x176b51);}return _0x15c897[_0x0c78('0x22')](_0x176b51)['end']();};}function respondWithResult(_0x1f66b7,_0x587906){_0x587906=_0x587906||0xc8;return function(_0x1eb7cd){if(_0x1eb7cd){return _0x1f66b7['status'](_0x587906)[_0x0c78('0x23')](_0x1eb7cd);}};}function respondWithFilteredResult(_0x536eae,_0xcd437b){return function(_0x5e1b0b){if(_0x5e1b0b){var _0x1da0ad=typeof _0xcd437b[_0x0c78('0x24')]===_0x0c78('0x25')&&typeof _0xcd437b[_0x0c78('0x26')]===_0x0c78('0x25');var _0x101ece=_0x5e1b0b[_0x0c78('0x27')];var _0x2ea7d8=_0x1da0ad?0x0:_0xcd437b[_0x0c78('0x24')];var _0x247352=_0x1da0ad?_0x5e1b0b[_0x0c78('0x27')]:_0xcd437b[_0x0c78('0x24')]+_0xcd437b[_0x0c78('0x26')];var _0x187315;if(_0x247352>=_0x101ece){_0x247352=_0x101ece;_0x187315=0xc8;}else{_0x187315=0xce;}_0x536eae[_0x0c78('0x22')](_0x187315);return _0x536eae[_0x0c78('0x28')](_0x0c78('0x29'),_0x2ea7d8+'-'+_0x247352+'/'+_0x101ece)[_0x0c78('0x23')](_0x5e1b0b);}return null;};}function patchUpdates(_0x1874b2){return function(_0x148de3){try{jsonpatch[_0x0c78('0x2a')](_0x148de3,_0x1874b2,!![]);}catch(_0x23d55f){return BPromise[_0x0c78('0x2b')](_0x23d55f);}return _0x148de3[_0x0c78('0x2c')]();};}function saveUpdates(_0xdce784,_0x1a9ec3){return function(_0xa4d7b6){if(_0xa4d7b6){return _0xa4d7b6['update'](_0xdce784)[_0x0c78('0x2d')](function(_0x83c7a0){return _0x83c7a0;});}return null;};}function removeEntity(_0x379286,_0x290980){return function(_0x441acc){if(_0x441acc){return _0x441acc[_0x0c78('0x2e')]()[_0x0c78('0x2d')](function(){_0x379286[_0x0c78('0x22')](0xcc)[_0x0c78('0x2f')]();});}};}function handleEntityNotFound(_0x4a0095,_0xb9d432){return function(_0x24c56a){if(!_0x24c56a){_0x4a0095[_0x0c78('0x21')](0x194);}return _0x24c56a;};}function handleError(_0x33586d,_0x415ffb){_0x415ffb=_0x415ffb||0x1f4;return function(_0x12427e){logger[_0x0c78('0x1c')](_0x12427e[_0x0c78('0x30')]);if(_0x12427e[_0x0c78('0x31')]){delete _0x12427e[_0x0c78('0x31')];}_0x33586d[_0x0c78('0x22')](_0x415ffb)[_0x0c78('0x32')](_0x12427e);};}exports[_0x0c78('0x33')]=function(_0x466f9a,_0x156c1e){var _0x433a0e={},_0x2a1176={},_0x40455b={'count':0x0,'rows':[]};var _0x256e2c=_[_0x0c78('0x34')](db['ZendeskAccount'][_0x0c78('0x35')],function(_0x3534db){return{'name':_0x3534db[_0x0c78('0x36')],'type':_0x3534db[_0x0c78('0x37')][_0x0c78('0x38')]};});_0x2a1176[_0x0c78('0x39')]=_['map'](_0x256e2c,'name');_0x2a1176[_0x0c78('0x3a')]=_[_0x0c78('0x3b')](_0x466f9a[_0x0c78('0x3a')]);_0x2a1176[_0x0c78('0x3c')]=_[_0x0c78('0x3d')](_0x2a1176[_0x0c78('0x39')],_0x2a1176[_0x0c78('0x3a')]);_0x433a0e[_0x0c78('0x3e')]=_['intersection'](_0x2a1176[_0x0c78('0x39')],qs[_0x0c78('0x3f')](_0x466f9a[_0x0c78('0x3a')][_0x0c78('0x3f')]));_0x433a0e[_0x0c78('0x3e')]=_0x433a0e[_0x0c78('0x3e')][_0x0c78('0x40')]?_0x433a0e[_0x0c78('0x3e')]:_0x2a1176['model'];if(!_0x466f9a[_0x0c78('0x3a')][_0x0c78('0x41')]('nolimit')){_0x433a0e['limit']=qs['limit'](_0x466f9a[_0x0c78('0x3a')][_0x0c78('0x26')]);_0x433a0e['offset']=qs[_0x0c78('0x24')](_0x466f9a[_0x0c78('0x3a')][_0x0c78('0x24')]);}_0x433a0e[_0x0c78('0x42')]=qs[_0x0c78('0x43')](_0x466f9a[_0x0c78('0x3a')][_0x0c78('0x43')]);_0x433a0e['where']=qs[_0x0c78('0x3c')](_[_0x0c78('0x44')](_0x466f9a[_0x0c78('0x3a')],_0x2a1176[_0x0c78('0x3c')]),_0x256e2c);if(_0x466f9a[_0x0c78('0x3a')][_0x0c78('0x45')]){_0x433a0e[_0x0c78('0x46')]=_[_0x0c78('0x47')](_0x433a0e[_0x0c78('0x46')],{'$or':_['map'](_0x256e2c,function(_0x2c1a0f){if(_0x2c1a0f[_0x0c78('0x37')]!=='VIRTUAL'){var _0x243ff0={};_0x243ff0[_0x2c1a0f[_0x0c78('0x31')]]={'$like':'%'+_0x466f9a[_0x0c78('0x3a')][_0x0c78('0x45')]+'%'};return _0x243ff0;}})});}_0x433a0e=_[_0x0c78('0x47')]({},_0x433a0e,_0x466f9a['options']);var _0x54728d={'where':_0x433a0e[_0x0c78('0x46')]};return db['ZendeskAccount'][_0x0c78('0x27')](_0x54728d)[_0x0c78('0x2d')](function(_0x1f9aca){_0x40455b[_0x0c78('0x27')]=_0x1f9aca;if(_0x466f9a[_0x0c78('0x3a')][_0x0c78('0x48')]){_0x433a0e[_0x0c78('0x49')]=[{'all':!![]}];}return db[_0x0c78('0x4a')][_0x0c78('0x4b')](_0x433a0e);})[_0x0c78('0x2d')](function(_0x2cb555){_0x40455b[_0x0c78('0x4c')]=_0x2cb555;return _0x40455b;})[_0x0c78('0x2d')](respondWithFilteredResult(_0x156c1e,_0x433a0e))[_0x0c78('0x20')](handleError(_0x156c1e,null));};exports[_0x0c78('0x4d')]=function(_0x5b639a,_0x134f20){var _0x49167c={'raw':![],'where':{'id':_0x5b639a[_0x0c78('0x4e')]['id']}},_0x30d3d3={};_0x30d3d3[_0x0c78('0x39')]=_[_0x0c78('0x3b')](db[_0x0c78('0x4a')][_0x0c78('0x35')]);_0x30d3d3['query']=_[_0x0c78('0x3b')](_0x5b639a[_0x0c78('0x3a')]);_0x30d3d3[_0x0c78('0x3c')]=_[_0x0c78('0x3d')](_0x30d3d3[_0x0c78('0x39')],_0x30d3d3[_0x0c78('0x3a')]);_0x49167c['attributes']=_[_0x0c78('0x3d')](_0x30d3d3[_0x0c78('0x39')],qs[_0x0c78('0x3f')](_0x5b639a[_0x0c78('0x3a')]['fields']));_0x49167c['attributes']=_0x49167c['attributes']['length']?_0x49167c['attributes']:_0x30d3d3['model'];if(_0x5b639a[_0x0c78('0x3a')]['includeAll']){_0x49167c[_0x0c78('0x49')]=[{'all':!![]}];}_0x49167c=_[_0x0c78('0x47')]({},_0x49167c,_0x5b639a['options']);return db[_0x0c78('0x4a')][_0x0c78('0x4f')](_0x49167c)[_0x0c78('0x2d')](handleEntityNotFound(_0x134f20,null))[_0x0c78('0x2d')](respondWithResult(_0x134f20,null))[_0x0c78('0x20')](handleError(_0x134f20,null));};exports[_0x0c78('0x50')]=function(_0xd114fa,_0x491e0a){return db[_0x0c78('0x4a')][_0x0c78('0x50')](_0xd114fa[_0x0c78('0x51')],{})[_0x0c78('0x2d')](respondWithResult(_0x491e0a,0xc9))['catch'](handleError(_0x491e0a,null));};exports['update']=function(_0x53d5b9,_0x28d794){if(_0x53d5b9[_0x0c78('0x51')]['id']){delete _0x53d5b9['body']['id'];}return db[_0x0c78('0x4a')]['find']({'where':{'id':_0x53d5b9[_0x0c78('0x4e')]['id']}})[_0x0c78('0x2d')](handleEntityNotFound(_0x28d794,null))['then'](saveUpdates(_0x53d5b9[_0x0c78('0x51')],null))['then'](respondWithResult(_0x28d794,null))[_0x0c78('0x20')](handleError(_0x28d794,null));};exports[_0x0c78('0x2e')]=function(_0x57ad60,_0x57674c){return db['ZendeskAccount']['find']({'where':{'id':_0x57ad60[_0x0c78('0x4e')]['id']}})[_0x0c78('0x2d')](handleEntityNotFound(_0x57674c,null))[_0x0c78('0x2d')](removeEntity(_0x57674c,null))['catch'](handleError(_0x57674c,null));};exports[_0x0c78('0x52')]=function(_0x7b3e2b,_0x59cc4b,_0x266b81){var _0x5178a5={};var _0x4527c1={};var _0x12553f;var _0x4e3e4f;return db[_0x0c78('0x4a')][_0x0c78('0x53')]({'where':{'id':_0x7b3e2b['params']['id']}})[_0x0c78('0x2d')](handleEntityNotFound(_0x59cc4b,null))[_0x0c78('0x2d')](function(_0x24ae7b){if(_0x24ae7b){_0x12553f=_0x24ae7b;_0x4527c1[_0x0c78('0x39')]=_[_0x0c78('0x3b')](db[_0x0c78('0x54')][_0x0c78('0x35')]);_0x4527c1[_0x0c78('0x3a')]=_[_0x0c78('0x3b')](_0x7b3e2b[_0x0c78('0x3a')]);_0x4527c1['filters']=_['intersection'](_0x4527c1['model'],_0x4527c1[_0x0c78('0x3a')]);_0x5178a5[_0x0c78('0x3e')]=_['intersection'](_0x4527c1[_0x0c78('0x39')],qs['fields'](_0x7b3e2b[_0x0c78('0x3a')][_0x0c78('0x3f')]));_0x5178a5[_0x0c78('0x3e')]=_0x5178a5[_0x0c78('0x3e')][_0x0c78('0x40')]?_0x5178a5[_0x0c78('0x3e')]:_0x4527c1['model'];_0x5178a5[_0x0c78('0x42')]=qs[_0x0c78('0x43')](_0x7b3e2b[_0x0c78('0x3a')]['sort']);_0x5178a5[_0x0c78('0x46')]=qs['filters'](_['pick'](_0x7b3e2b[_0x0c78('0x3a')],_0x4527c1['filters']));if(_0x7b3e2b[_0x0c78('0x3a')][_0x0c78('0x45')]){_0x5178a5[_0x0c78('0x46')]=_[_0x0c78('0x47')](_0x5178a5[_0x0c78('0x46')],{'$or':_[_0x0c78('0x34')](_0x5178a5[_0x0c78('0x3e')],function(_0x55525d){var _0x7b7df5={};_0x7b7df5[_0x55525d]={'$like':'%'+_0x7b3e2b[_0x0c78('0x3a')][_0x0c78('0x45')]+'%'};return _0x7b7df5;})});}_0x5178a5=_[_0x0c78('0x47')]({},_0x5178a5,_0x7b3e2b['options']);return _0x12553f[_0x0c78('0x52')](_0x5178a5);}})[_0x0c78('0x2d')](function(_0x552177){if(_0x552177){_0x4e3e4f=_0x552177['length'];if(!_0x7b3e2b['query']['hasOwnProperty'](_0x0c78('0x55'))){_0x5178a5[_0x0c78('0x26')]=qs[_0x0c78('0x26')](_0x7b3e2b['query']['limit']);_0x5178a5[_0x0c78('0x24')]=qs['offset'](_0x7b3e2b['query']['offset']);}return _0x12553f[_0x0c78('0x52')](_0x5178a5);}})[_0x0c78('0x2d')](function(_0x1169df){if(_0x1169df){return _0x1169df?{'count':_0x4e3e4f,'rows':_0x1169df}:null;}})[_0x0c78('0x2d')](respondWithResult(_0x59cc4b,null))[_0x0c78('0x20')](handleError(_0x59cc4b,null));};exports['addConfiguration']=function(_0x3a3698,_0x28bb9d,_0x2e736a){if(_0x3a3698['body']['id']){delete _0x3a3698[_0x0c78('0x51')]['id'];}return db['ZendeskAccount'][_0x0c78('0x53')]({'where':{'id':_0x3a3698[_0x0c78('0x4e')]['id']}})[_0x0c78('0x2d')](handleEntityNotFound(_0x28bb9d,null))[_0x0c78('0x2d')](function(_0x314c1e){if(_0x314c1e){_0x3a3698['body']['AccountId']=_0x314c1e['id'];_0x3a3698[_0x0c78('0x51')][_0x0c78('0x56')]=integrations[_0x0c78('0x57')](_0x3a3698[_0x0c78('0x51')][_0x0c78('0x58')],_0x3a3698['body'][_0x0c78('0x37')]);_0x3a3698[_0x0c78('0x51')][_0x0c78('0x59')]=integrations['getDescriptions'](_0x3a3698[_0x0c78('0x51')][_0x0c78('0x58')],_0x3a3698[_0x0c78('0x51')][_0x0c78('0x37')]);return db[_0x0c78('0x54')][_0x0c78('0x50')](_0x3a3698[_0x0c78('0x51')],{'include':[{'model':db[_0x0c78('0x5a')],'as':_0x0c78('0x56')},{'model':db[_0x0c78('0x5a')],'as':_0x0c78('0x59')}]});}return null;})[_0x0c78('0x2d')](respondWithResult(_0x28bb9d,null))['catch'](handleError(_0x28bb9d,null));};exports[_0x0c78('0x5b')]=function(_0x4690b5,_0xc9fa81,_0x3c9492){var _0x27fc44='';return db[_0x0c78('0x4a')][_0x0c78('0x53')]({'where':{'id':_0x4690b5[_0x0c78('0x4e')]['id']},'attributes':['id','username','password','token',_0x0c78('0x5c'),_0x0c78('0x5d')]})[_0x0c78('0x2d')](handleEntityNotFound(_0xc9fa81,null))[_0x0c78('0x2d')](function(_0x526e63){if(_0x526e63){_0x27fc44=_0x526e63[_0x0c78('0x5d')];var _0x9c5f8e=_0x27fc44[_0x0c78('0x5e')](-0x1);if(_0x9c5f8e==='/'){_0x27fc44=_0x27fc44[_0x0c78('0x5f')](0x0,_0x27fc44[_0x0c78('0x60')](_0x9c5f8e));}var _0x421206={'method':_0x0c78('0x61'),'uri':util['format']('%s/%s',_0x27fc44,_0x0c78('0x62')),'json':!![]};switch(_0x526e63[_0x0c78('0x5c')]){case _0x0c78('0x63'):_0x421206[_0x0c78('0x64')]={'Authorization':util[_0x0c78('0x65')](_0x0c78('0x66'),new Buffer(util[_0x0c78('0x65')]('%s:%s',_0x526e63[_0x0c78('0x67')],_0x526e63[_0x0c78('0x63')]))['toString'](_0x0c78('0x68')))};break;case _0x0c78('0x69'):_0x421206[_0x0c78('0x64')]={'Authorization':util['format'](_0x0c78('0x66'),new Buffer(util[_0x0c78('0x65')](_0x0c78('0x6a'),_0x526e63[_0x0c78('0x67')],_0x526e63[_0x0c78('0x69')]))['toString'](_0x0c78('0x68')))};break;default:throw new db[(_0x0c78('0x6b'))][(_0x0c78('0x6c'))](_0x0c78('0x6d'));}return rp(_0x421206);}})[_0x0c78('0x2d')](function(_0x2741bd){if(_0x2741bd){var _0x554469=['subject',_0x0c78('0x6e'),_0x0c78('0x6f'),'assignee'];_[_0x0c78('0x70')](_0x2741bd['ticket_fields'],function(_0x4c4cb8){return _0x554469[_0x0c78('0x71')](_0x4c4cb8[_0x0c78('0x37')]);});return{'count':_0x2741bd['ticket_fields']['length'],'rows':_[_0x0c78('0x34')](_0x2741bd['ticket_fields'],function(_0x1e8ab5){return{'id':_0x1e8ab5['id'],'name':_0x1e8ab5['position']>0x7?_0x1e8ab5[_0x0c78('0x72')]:_0x1e8ab5[_0x0c78('0x37')],'custom':_0x1e8ab5[_0x0c78('0x73')]>0x7?!![]:![],'options':_0x1e8ab5[_0x0c78('0x74')]?_0x1e8ab5[_0x0c78('0x74')]:_0x1e8ab5[_0x0c78('0x75')]?_0x1e8ab5[_0x0c78('0x75')]:[]};})};}})[_0x0c78('0x2d')](respondWithResult(_0xc9fa81,null))[_0x0c78('0x20')](function(_0x84bf8e){var _0x49ed2d=_0x4690b5[_0x0c78('0x3a')][_0x0c78('0x76')]?0x1f4:_0x84bf8e[_0x0c78('0x77')]||0x1f4;logger[_0x0c78('0x1c')](_0x0c78('0x78'),_0x0c78('0x5b'),_0x49ed2d,JSON[_0x0c78('0x1b')](_0x84bf8e));delete _0x84bf8e[_0x0c78('0x31')];if(_0x49ed2d===0x191){_0x49ed2d=0x190;}_0xc9fa81[_0x0c78('0x22')](_0x49ed2d)[_0x0c78('0x32')](_0x4690b5[_0x0c78('0x3a')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x84bf8e[_0x0c78('0x77')]}:_0x84bf8e);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 1b38d6f..1968f8c 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 _0x154d=['ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x23b910,_0x591718){var _0x124c00=function(_0x11269c){while(--_0x11269c){_0x23b910['push'](_0x23b910['shift']());}};_0x124c00(++_0x591718);}(_0x154d,0x9e));var _0xd154=function(_0xf4639c,_0x213932){_0xf4639c=_0xf4639c-0x0;var _0x22cc63=_0x154d[_0xf4639c];return _0x22cc63;};'use strict';var _=require(_0xd154('0x0'));var util=require(_0xd154('0x1'));var logger=require(_0xd154('0x2'))(_0xd154('0x3'));var moment=require(_0xd154('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd154('0x5'));var rimraf=require(_0xd154('0x6'));var config=require('../../config/environment');var attributes=require(_0xd154('0x7'));var integrations=require(_0xd154('0x8'));module[_0xd154('0x9')]=function(_0x3654a9,_0x6563e){return _0x3654a9[_0xd154('0xa')](_0xd154('0xb'),attributes,{'tableName':_0xd154('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72c5=['rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','api','bluebird','request-promise'];(function(_0x18fcdc,_0x50716e){var _0x2a11cc=function(_0x169cad){while(--_0x169cad){_0x18fcdc['push'](_0x18fcdc['shift']());}};_0x2a11cc(++_0x50716e);}(_0x72c5,0x80));var _0x572c=function(_0x3671d7,_0x586bbc){_0x3671d7=_0x3671d7-0x0;var _0xf9f6e6=_0x72c5[_0x3671d7];return _0xf9f6e6;};'use strict';var _=require('lodash');var util=require(_0x572c('0x0'));var logger=require('../../config/logger')(_0x572c('0x1'));var moment=require('moment');var BPromise=require(_0x572c('0x2'));var rp=require(_0x572c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x572c('0x4'));var config=require(_0x572c('0x5'));var attributes=require(_0x572c('0x6'));var integrations=require(_0x572c('0x7'));module[_0x572c('0x8')]=function(_0x315607,_0x1d4bc6){return _0x315607[_0x572c('0x9')](_0x572c('0xa'),attributes,{'tableName':_0x572c('0xb'),'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 14719e9..1e66733 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 _0xd8b0=['raw','where','include','map','model','attributes','ShowZendeskAccount','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','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','options'];(function(_0x59add1,_0x541f05){var _0x371082=function(_0x191e54){while(--_0x191e54){_0x59add1['push'](_0x59add1['shift']());}};_0x371082(++_0x541f05);}(_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 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);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['findAll']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'limit':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['limit']||null:null,'include':_0x5fecbd['options']?_0x5fecbd['options'][_0x0d8b('0x1b')]?_[_0x0d8b('0x1c')](_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1b')],function(_0x221071){return{'model':db[_0x221071[_0x0d8b('0x1d')]],'as':_0x221071['as'],'attributes':_0x221071[_0x0d8b('0x1e')],'include':_0x221071[_0x0d8b('0x1b')]?_[_0x0d8b('0x1c')](_0x221071['include'],function(_0xe8bbee){return{'model':db[_0xe8bbee[_0x0d8b('0x1d')]],'as':_0xe8bbee['as'],'attributes':_0xe8bbee['attributes'],'include':_0xe8bbee[_0x0d8b('0x1b')]?_['map'](_0xe8bbee[_0x0d8b('0x1b')],function(_0x234bdd){return{'model':db[_0x234bdd[_0x0d8b('0x1d')]],'as':_0x234bdd['as'],'attributes':_0x234bdd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x28f639){logger[_0x0d8b('0xb')]('GetZendeskAccount',_0x5fecbd);logger[_0x0d8b('0xe')]('GetZendeskAccount',_0x5fecbd,JSON[_0x0d8b('0x10')](_0x28f639));_0x18dd2d(_0x28f639);})['catch'](function(_0x97050a){logger['error'](_0x0d8b('0x16'),_0x97050a['message'],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x97050a['message']));});});};exports[_0x0d8b('0x1f')]=function(_0x106e4c){var _0x2c058d=this;return new Promise(function(_0x56120a,_0x4c80a2){return db['ZendeskAccount'][_0x0d8b('0x20')]({'raw':_0x106e4c['options']?_0x106e4c[_0x0d8b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x106e4c['options']?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x106e4c[_0x0d8b('0x18')]?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1e')]||null:null,'include':_0x106e4c[_0x0d8b('0x18')]?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1b')]?_['map'](_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1b')],function(_0x4b3ea0){return{'model':db[_0x4b3ea0[_0x0d8b('0x1d')]],'as':_0x4b3ea0['as'],'attributes':_0x4b3ea0[_0x0d8b('0x1e')],'include':_0x4b3ea0[_0x0d8b('0x1b')]?_['map'](_0x4b3ea0[_0x0d8b('0x1b')],function(_0x2c507e){return{'model':db[_0x2c507e[_0x0d8b('0x1d')]],'as':_0x2c507e['as'],'attributes':_0x2c507e[_0x0d8b('0x1e')],'include':_0x2c507e[_0x0d8b('0x1b')]?_['map'](_0x2c507e[_0x0d8b('0x1b')],function(_0x1649fc){return{'model':db[_0x1649fc['model']],'as':_0x1649fc['as'],'attributes':_0x1649fc[_0x0d8b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0x188af2){logger[_0x0d8b('0xb')](_0x0d8b('0x1f'),_0x106e4c);logger['debug']('ShowZendeskAccount',_0x106e4c,JSON[_0x0d8b('0x10')](_0x188af2));_0x56120a(_0x188af2);})['catch'](function(_0x531c55){logger[_0x0d8b('0x11')](_0x0d8b('0x1f'),_0x531c55[_0x0d8b('0x13')],_0x106e4c);_0x4c80a2(_0x2c058d[_0x0d8b('0x11')](0x1f4,_0x531c55[_0x0d8b('0x13')]));});});}; \ No newline at end of file +var _0x757a=['stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','ShowZendeskAccount','find','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x10da5a,_0x5bb53c){var _0x49a6f5=function(_0x10f387){while(--_0x10f387){_0x10da5a['push'](_0x10da5a['shift']());}};_0x49a6f5(++_0x5bb53c);}(_0x757a,0xde));var _0xa757=function(_0x4de48d,_0x3c75fe){_0x4de48d=_0x4de48d-0x0;var _0x19984f=_0x757a[_0x4de48d];return _0x19984f;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}exports[_0xa757('0x15')]=function(_0x4d9f58){var _0x54b305=this;return new Promise(function(_0x151c04,_0x468d45){return db[_0xa757('0x16')][_0xa757('0x17')]({'raw':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58['options'][_0xa757('0x19')]||null:null,'attributes':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'limit':_0x4d9f58['options']?_0x4d9f58['options'][_0xa757('0x1b')]||null:null,'include':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')],function(_0x21f1af){return{'model':db[_0x21f1af[_0xa757('0x1e')]],'as':_0x21f1af['as'],'attributes':_0x21f1af['attributes'],'include':_0x21f1af[_0xa757('0x1c')]?_['map'](_0x21f1af[_0xa757('0x1c')],function(_0x47903b){return{'model':db[_0x47903b[_0xa757('0x1e')]],'as':_0x47903b['as'],'attributes':_0x47903b[_0xa757('0x1a')],'include':_0x47903b[_0xa757('0x1c')]?_['map'](_0x47903b[_0xa757('0x1c')],function(_0xcd98bd){return{'model':db[_0xcd98bd[_0xa757('0x1e')]],'as':_0xcd98bd['as'],'attributes':_0xcd98bd[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x449a7d){logger['info']('GetZendeskAccount',_0x4d9f58);logger['debug']('GetZendeskAccount',_0x4d9f58,JSON[_0xa757('0x10')](_0x449a7d));_0x151c04(_0x449a7d);})['catch'](function(_0x2208f9){logger[_0xa757('0x11')]('GetZendeskAccount',_0x2208f9[_0xa757('0x12')],_0x4d9f58);_0x468d45(_0x54b305['error'](0x1f4,_0x2208f9[_0xa757('0x12')]));});});};exports[_0xa757('0x1f')]=function(_0x5307c3){var _0x235e54=this;return new Promise(function(_0x5ade7b,_0x3a4a66){return db[_0xa757('0x16')][_0xa757('0x20')]({'raw':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x21')]===undefined?!![]:![]:!![],'where':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x19')]||null:null,'attributes':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'include':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')],function(_0x1eacde){return{'model':db[_0x1eacde[_0xa757('0x1e')]],'as':_0x1eacde['as'],'attributes':_0x1eacde[_0xa757('0x1a')],'include':_0x1eacde[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x1eacde[_0xa757('0x1c')],function(_0x59700d){return{'model':db[_0x59700d[_0xa757('0x1e')]],'as':_0x59700d['as'],'attributes':_0x59700d[_0xa757('0x1a')],'include':_0x59700d[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x59700d[_0xa757('0x1c')],function(_0x51e2aa){return{'model':db[_0x51e2aa[_0xa757('0x1e')]],'as':_0x51e2aa['as'],'attributes':_0x51e2aa[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa757('0xa')](function(_0x2c34b1){logger[_0xa757('0xb')](_0xa757('0x1f'),_0x5307c3);logger['debug'](_0xa757('0x1f'),_0x5307c3,JSON[_0xa757('0x10')](_0x2c34b1));_0x5ade7b(_0x2c34b1);})[_0xa757('0x14')](function(_0xc34409){logger[_0xa757('0x11')](_0xa757('0x1f'),_0xc34409[_0xa757('0x12')],_0x5307c3);_0x3a4a66(_0x235e54[_0xa757('0x11')](0x1f4,_0xc34409[_0xa757('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index f1e5ed4..1b43c2c 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 _0x8b6e=['post','create','setTags','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/descriptions','/:id/tags','getTags'];(function(_0x46fe2b,_0x3931b3){var _0x33a923=function(_0x286913){while(--_0x286913){_0x46fe2b['push'](_0x46fe2b['shift']());}};_0x33a923(++_0x3931b3);}(_0x8b6e,0x16f));var _0xe8b6=function(_0x30e045,_0x278ce2){_0x30e045=_0x30e045-0x0;var _0x488323=_0x8b6e[_0x30e045];return _0x488323;};'use strict';var multer=require('multer');var util=require(_0xe8b6('0x0'));var path=require(_0xe8b6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe8b6('0x2')]();var fs_extra=require(_0xe8b6('0x3'));var auth=require(_0xe8b6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe8b6('0x5'));var controller=require(_0xe8b6('0x6'));router['get']('/',auth[_0xe8b6('0x7')](),controller[_0xe8b6('0x8')]);router[_0xe8b6('0x9')](_0xe8b6('0xa'),auth['isAuthenticated'](),controller[_0xe8b6('0xb')]);router[_0xe8b6('0x9')](_0xe8b6('0xc'),auth[_0xe8b6('0x7')](),controller[_0xe8b6('0xd')]);router['get']('/:id/subjects',auth[_0xe8b6('0x7')](),controller['getSubjects']);router[_0xe8b6('0x9')](_0xe8b6('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xe8b6('0x9')](_0xe8b6('0xf'),auth['isAuthenticated'](),controller[_0xe8b6('0x10')]);router[_0xe8b6('0x11')]('/',auth[_0xe8b6('0x7')](),controller[_0xe8b6('0x12')]);router['post'](_0xe8b6('0xf'),auth[_0xe8b6('0x7')](),controller[_0xe8b6('0x13')]);router['put'](_0xe8b6('0xa'),auth[_0xe8b6('0x7')](),controller[_0xe8b6('0x14')]);router[_0xe8b6('0x15')](_0xe8b6('0xa'),auth[_0xe8b6('0x7')](),controller[_0xe8b6('0x16')]);module[_0xe8b6('0x17')]=router; \ No newline at end of file +var _0xd7d3=['exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/tags','getTags','create','post'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xd7d3,0x1b6));var _0x3d7d=function(_0x2adfb1,_0x406e6e){_0x2adfb1=_0x2adfb1-0x0;var _0xa52d45=_0xd7d3[_0x2adfb1];return _0xa52d45;};'use strict';var multer=require(_0x3d7d('0x0'));var util=require('util');var path=require(_0x3d7d('0x1'));var timeout=require('connect-timeout');var express=require(_0x3d7d('0x2'));var router=express[_0x3d7d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3d7d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3d7d('0x5'));var controller=require(_0x3d7d('0x6'));router[_0x3d7d('0x7')]('/',auth[_0x3d7d('0x8')](),controller[_0x3d7d('0x9')]);router[_0x3d7d('0x7')](_0x3d7d('0xa'),auth[_0x3d7d('0x8')](),controller[_0x3d7d('0xb')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get'](_0x3d7d('0xc'),auth['isAuthenticated'](),controller[_0x3d7d('0xd')]);router[_0x3d7d('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x3d7d('0x7')](_0x3d7d('0xe'),auth[_0x3d7d('0x8')](),controller[_0x3d7d('0xf')]);router['post']('/',auth[_0x3d7d('0x8')](),controller[_0x3d7d('0x10')]);router[_0x3d7d('0x11')]('/:id/tags',auth[_0x3d7d('0x8')](),controller['setTags']);router['put'](_0x3d7d('0xa'),auth[_0x3d7d('0x8')](),controller['update']);router['delete'](_0x3d7d('0xa'),auth[_0x3d7d('0x8')](),controller['destroy']);module[_0x3d7d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 692037d..71fa7c1 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 _0x1e39=['exports','STRING'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1e39,0x9e));var _0x91e3=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0x1e39[_0x54bac5];return _0xc15971;};'use strict';var Sequelize=require('sequelize');module[_0x91e3('0x0')]={'name':{'type':Sequelize[_0x91e3('0x1')]},'description':{'type':Sequelize[_0x91e3('0x1')]}}; \ No newline at end of file +var _0xe254=['sequelize','exports','STRING'];(function(_0x47d501,_0x57a192){var _0x10cff5=function(_0xd3b350){while(--_0xd3b350){_0x47d501['push'](_0x47d501['shift']());}};_0x10cff5(++_0x57a192);}(_0xe254,0x13e));var _0x4e25=function(_0x53337d,_0x59714b){_0x53337d=_0x53337d-0x0;var _0x2ef0b7=_0xe254[_0x53337d];return _0x2ef0b7;};'use strict';var Sequelize=require(_0x4e25('0x0'));module[_0x4e25('0x1')]={'name':{'type':Sequelize[_0x4e25('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d7e51a5..0215431 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 _0x1880=['rows','show','params','keys','intersection','includeAll','find','create','body','update','destroy','getFields','findOne','ZendeskField','getSubjects','getDescriptions','options','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include'];(function(_0x3b58c6,_0x2c740d){var _0x4b42a4=function(_0x4ca724){while(--_0x4ca724){_0x3b58c6['push'](_0x3b58c6['shift']());}};_0x4b42a4(++_0x2c740d);}(_0x1880,0x12e));var _0x0188=function(_0x29a707,_0x342505){_0x29a707=_0x29a707-0x0;var _0x229e83=_0x1880[_0x29a707];return _0x229e83;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0188('0x0'));var zipdir=require(_0x0188('0x1'));var jsonpatch=require(_0x0188('0x2'));var rp=require('request-promise');var moment=require(_0x0188('0x3'));var BPromise=require(_0x0188('0x4'));var Mustache=require(_0x0188('0x5'));var util=require('util');var path=require(_0x0188('0x6'));var sox=require(_0x0188('0x7'));var csv=require(_0x0188('0x8'));var ejs=require(_0x0188('0x9'));var fs=require('fs');var fs_extra=require(_0x0188('0xa'));var _=require('lodash');var squel=require(_0x0188('0xb'));var crypto=require(_0x0188('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0188('0xd'));var toCsv=require(_0x0188('0x8'));var querystring=require(_0x0188('0xe'));var Papa=require(_0x0188('0xf'));var Redis=require(_0x0188('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0188('0x11'));var as=require(_0x0188('0x12'));var hardwareService=require(_0x0188('0x13'));var logger=require(_0x0188('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x0188('0x15'));var licenseUtil=require(_0x0188('0x16'));var db=require(_0x0188('0x17'))['db'];var jayson=require(_0x0188('0x18'));var client=jayson[_0x0188('0x19')][_0x0188('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x24ae54,_0x2b1640,_0x32b677,_0x386c6e){return new BPromise(function(_0x1313ba,_0x5f35cb){var _0x403768=_0x386c6e||client;return _0x403768['request'](_0x24ae54,_0x32b677)[_0x0188('0x1b')](function(_0x5a8bab){logger['info'](_0x0188('0x1c'),_0x2b1640,_0x0188('0x1d'));logger[_0x0188('0x1e')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2b1640,_0x0188('0x1d'),JSON[_0x0188('0x1f')](_0x5a8bab));if(_0x5a8bab[_0x0188('0x20')]){if(_0x5a8bab[_0x0188('0x20')]['code']===0x1f4){logger[_0x0188('0x20')](_0x0188('0x1c'),_0x2b1640,_0x5a8bab[_0x0188('0x20')][_0x0188('0x21')]);return _0x5f35cb(_0x5a8bab[_0x0188('0x20')][_0x0188('0x21')]);}logger[_0x0188('0x20')](_0x0188('0x1c'),_0x2b1640,_0x5a8bab['error'][_0x0188('0x21')]);return _0x1313ba(_0x5a8bab[_0x0188('0x20')][_0x0188('0x21')]);}else{logger[_0x0188('0x22')](_0x0188('0x1c'),_0x2b1640,'request\x20sent');_0x1313ba(_0x5a8bab[_0x0188('0x23')][_0x0188('0x21')]);}})[_0x0188('0x24')](function(_0x1c219f){logger[_0x0188('0x20')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2b1640,_0x1c219f);_0x5f35cb(_0x1c219f);});});}function respondWithStatusCode(_0x3a013f,_0xcf711b){_0xcf711b=_0xcf711b||0xcc;return function(_0x33c7a2){if(_0x33c7a2){return _0x3a013f[_0x0188('0x25')](_0xcf711b);}return _0x3a013f[_0x0188('0x26')](_0xcf711b)[_0x0188('0x27')]();};}function respondWithResult(_0x1a80b7,_0x33d9f4){_0x33d9f4=_0x33d9f4||0xc8;return function(_0x45189f){if(_0x45189f){return _0x1a80b7[_0x0188('0x26')](_0x33d9f4)[_0x0188('0x28')](_0x45189f);}};}function respondWithFilteredResult(_0x5074e2,_0xacca56){return function(_0x32d749){if(_0x32d749){var _0x260631=typeof _0xacca56[_0x0188('0x29')]==='undefined'&&typeof _0xacca56[_0x0188('0x2a')]===_0x0188('0x2b');var _0x267321=_0x32d749[_0x0188('0x2c')];var _0x5c3aac=_0x260631?0x0:_0xacca56[_0x0188('0x29')];var _0x49da49=_0x260631?_0x32d749[_0x0188('0x2c')]:_0xacca56[_0x0188('0x29')]+_0xacca56[_0x0188('0x2a')];var _0x3a39ed;if(_0x49da49>=_0x267321){_0x49da49=_0x267321;_0x3a39ed=0xc8;}else{_0x3a39ed=0xce;}_0x5074e2['status'](_0x3a39ed);return _0x5074e2[_0x0188('0x2d')]('Content-Range',_0x5c3aac+'-'+_0x49da49+'/'+_0x267321)[_0x0188('0x28')](_0x32d749);}return null;};}function patchUpdates(_0x2cd991){return function(_0xbd2c0){try{jsonpatch[_0x0188('0x2e')](_0xbd2c0,_0x2cd991,!![]);}catch(_0x5345b6){return BPromise[_0x0188('0x2f')](_0x5345b6);}return _0xbd2c0[_0x0188('0x30')]();};}function saveUpdates(_0x246f5d,_0x63cd0a){return function(_0x472339){if(_0x472339){return _0x472339['update'](_0x246f5d)[_0x0188('0x1b')](function(_0x4030a5){return _0x4030a5;});}return null;};}function removeEntity(_0x1410dc,_0x48e6f8){return function(_0x53fc70){if(_0x53fc70){return _0x53fc70['destroy']()[_0x0188('0x1b')](function(){_0x1410dc[_0x0188('0x26')](0xcc)[_0x0188('0x27')]();});}};}function handleEntityNotFound(_0x2d4eb4,_0x5b15c4){return function(_0x405513){if(!_0x405513){_0x2d4eb4[_0x0188('0x25')](0x194);}return _0x405513;};}function handleError(_0x46e2d7,_0x2123e3){_0x2123e3=_0x2123e3||0x1f4;return function(_0x323c08){logger['error'](_0x323c08['stack']);if(_0x323c08[_0x0188('0x31')]){delete _0x323c08[_0x0188('0x31')];}_0x46e2d7[_0x0188('0x26')](_0x2123e3)[_0x0188('0x32')](_0x323c08);};}exports[_0x0188('0x33')]=function(_0x230331,_0x469e13){var _0x4495e5={},_0x4fedd5={},_0x41f432={'count':0x0,'rows':[]};var _0x3b6360=_[_0x0188('0x34')](db[_0x0188('0x35')][_0x0188('0x36')],function(_0x2c5808){return{'name':_0x2c5808[_0x0188('0x37')],'type':_0x2c5808[_0x0188('0x38')][_0x0188('0x39')]};});_0x4fedd5[_0x0188('0x3a')]=_[_0x0188('0x34')](_0x3b6360,_0x0188('0x31'));_0x4fedd5[_0x0188('0x3b')]=_['keys'](_0x230331[_0x0188('0x3b')]);_0x4fedd5[_0x0188('0x3c')]=_['intersection'](_0x4fedd5[_0x0188('0x3a')],_0x4fedd5[_0x0188('0x3b')]);_0x4495e5['attributes']=_['intersection'](_0x4fedd5['model'],qs['fields'](_0x230331[_0x0188('0x3b')][_0x0188('0x3d')]));_0x4495e5[_0x0188('0x3e')]=_0x4495e5[_0x0188('0x3e')][_0x0188('0x3f')]?_0x4495e5[_0x0188('0x3e')]:_0x4fedd5[_0x0188('0x3a')];if(!_0x230331[_0x0188('0x3b')][_0x0188('0x40')](_0x0188('0x41'))){_0x4495e5['limit']=qs[_0x0188('0x2a')](_0x230331[_0x0188('0x3b')]['limit']);_0x4495e5[_0x0188('0x29')]=qs[_0x0188('0x29')](_0x230331[_0x0188('0x3b')]['offset']);}_0x4495e5[_0x0188('0x42')]=qs['sort'](_0x230331[_0x0188('0x3b')][_0x0188('0x43')]);_0x4495e5[_0x0188('0x44')]=qs['filters'](_[_0x0188('0x45')](_0x230331[_0x0188('0x3b')],_0x4fedd5[_0x0188('0x3c')]),_0x3b6360);if(_0x230331[_0x0188('0x3b')][_0x0188('0x46')]){_0x4495e5['where']=_[_0x0188('0x47')](_0x4495e5['where'],{'$or':_['map'](_0x3b6360,function(_0x5005b8){if(_0x5005b8[_0x0188('0x38')]!==_0x0188('0x48')){var _0x991d87={};_0x991d87[_0x5005b8[_0x0188('0x31')]]={'$like':'%'+_0x230331[_0x0188('0x3b')]['filter']+'%'};return _0x991d87;}})});}_0x4495e5=_[_0x0188('0x47')]({},_0x4495e5,_0x230331['options']);var _0x2ed242={'where':_0x4495e5['where']};return db['ZendeskConfiguration'][_0x0188('0x2c')](_0x2ed242)[_0x0188('0x1b')](function(_0x56fdc7){_0x41f432['count']=_0x56fdc7;if(_0x230331[_0x0188('0x3b')]['includeAll']){_0x4495e5[_0x0188('0x49')]=[{'all':!![]}];}return db[_0x0188('0x35')]['findAll'](_0x4495e5);})[_0x0188('0x1b')](function(_0x5c1b2e){_0x41f432[_0x0188('0x4a')]=_0x5c1b2e;return _0x41f432;})[_0x0188('0x1b')](respondWithFilteredResult(_0x469e13,_0x4495e5))[_0x0188('0x24')](handleError(_0x469e13,null));};exports[_0x0188('0x4b')]=function(_0x505ee7,_0x52bc55){var _0x5bbd1f={'raw':![],'where':{'id':_0x505ee7[_0x0188('0x4c')]['id']}},_0x14c389={};_0x14c389[_0x0188('0x3a')]=_[_0x0188('0x4d')](db['ZendeskConfiguration']['rawAttributes']);_0x14c389[_0x0188('0x3b')]=_['keys'](_0x505ee7[_0x0188('0x3b')]);_0x14c389[_0x0188('0x3c')]=_[_0x0188('0x4e')](_0x14c389['model'],_0x14c389[_0x0188('0x3b')]);_0x5bbd1f['attributes']=_[_0x0188('0x4e')](_0x14c389['model'],qs['fields'](_0x505ee7[_0x0188('0x3b')]['fields']));_0x5bbd1f['attributes']=_0x5bbd1f['attributes'][_0x0188('0x3f')]?_0x5bbd1f[_0x0188('0x3e')]:_0x14c389[_0x0188('0x3a')];if(_0x505ee7[_0x0188('0x3b')][_0x0188('0x4f')]){_0x5bbd1f[_0x0188('0x49')]=[{'all':!![]}];}_0x5bbd1f=_[_0x0188('0x47')]({},_0x5bbd1f,_0x505ee7['options']);return db[_0x0188('0x35')][_0x0188('0x50')](_0x5bbd1f)[_0x0188('0x1b')](handleEntityNotFound(_0x52bc55,null))[_0x0188('0x1b')](respondWithResult(_0x52bc55,null))[_0x0188('0x24')](handleError(_0x52bc55,null));};exports[_0x0188('0x51')]=function(_0x338d4a,_0x30570e){return db[_0x0188('0x35')][_0x0188('0x51')](_0x338d4a[_0x0188('0x52')],{})['then'](respondWithResult(_0x30570e,0xc9))[_0x0188('0x24')](handleError(_0x30570e,null));};exports[_0x0188('0x53')]=function(_0x4ecde9,_0x5a97eb){if(_0x4ecde9[_0x0188('0x52')]['id']){delete _0x4ecde9[_0x0188('0x52')]['id'];}return db[_0x0188('0x35')][_0x0188('0x50')]({'where':{'id':_0x4ecde9[_0x0188('0x4c')]['id']}})[_0x0188('0x1b')](handleEntityNotFound(_0x5a97eb,null))[_0x0188('0x1b')](saveUpdates(_0x4ecde9[_0x0188('0x52')],null))[_0x0188('0x1b')](respondWithResult(_0x5a97eb,null))[_0x0188('0x24')](handleError(_0x5a97eb,null));};exports[_0x0188('0x54')]=function(_0x1db1e6,_0x4428b4){return db[_0x0188('0x35')][_0x0188('0x50')]({'where':{'id':_0x1db1e6[_0x0188('0x4c')]['id']}})[_0x0188('0x1b')](handleEntityNotFound(_0x4428b4,null))[_0x0188('0x1b')](removeEntity(_0x4428b4,null))[_0x0188('0x24')](handleError(_0x4428b4,null));};exports[_0x0188('0x55')]=function(_0xab7f2b,_0xad406d,_0x46ee19){var _0x4e1519={};var _0x1b0422={};var _0x377891;var _0x352773;return db[_0x0188('0x35')][_0x0188('0x56')]({'where':{'id':_0xab7f2b[_0x0188('0x4c')]['id']}})[_0x0188('0x1b')](handleEntityNotFound(_0xad406d,null))['then'](function(_0x447371){if(_0x447371){_0x377891=_0x447371;_0x1b0422[_0x0188('0x3a')]=_[_0x0188('0x4d')](db[_0x0188('0x57')][_0x0188('0x36')]);_0x1b0422['query']=_['keys'](_0xab7f2b[_0x0188('0x3b')]);_0x1b0422[_0x0188('0x3c')]=_[_0x0188('0x4e')](_0x1b0422[_0x0188('0x3a')],_0x1b0422[_0x0188('0x3b')]);_0x4e1519[_0x0188('0x3e')]=_[_0x0188('0x4e')](_0x1b0422[_0x0188('0x3a')],qs[_0x0188('0x3d')](_0xab7f2b[_0x0188('0x3b')]['fields']));_0x4e1519[_0x0188('0x3e')]=_0x4e1519[_0x0188('0x3e')][_0x0188('0x3f')]?_0x4e1519[_0x0188('0x3e')]:_0x1b0422[_0x0188('0x3a')];_0x4e1519['order']=qs[_0x0188('0x43')](_0xab7f2b[_0x0188('0x3b')][_0x0188('0x43')]);_0x4e1519[_0x0188('0x44')]=qs['filters'](_['pick'](_0xab7f2b['query'],_0x1b0422[_0x0188('0x3c')]));if(_0xab7f2b[_0x0188('0x3b')]['filter']){_0x4e1519[_0x0188('0x44')]=_[_0x0188('0x47')](_0x4e1519[_0x0188('0x44')],{'$or':_['map'](_0x4e1519[_0x0188('0x3e')],function(_0x3e5689){var _0x5be905={};_0x5be905[_0x3e5689]={'$like':'%'+_0xab7f2b[_0x0188('0x3b')][_0x0188('0x46')]+'%'};return _0x5be905;})});}_0x4e1519=_[_0x0188('0x47')]({},_0x4e1519,_0xab7f2b['options']);return _0x377891[_0x0188('0x55')](_0x4e1519);}})[_0x0188('0x1b')](function(_0x35db72){if(_0x35db72){_0x352773=_0x35db72[_0x0188('0x3f')];if(!_0xab7f2b['query'][_0x0188('0x40')](_0x0188('0x41'))){_0x4e1519[_0x0188('0x2a')]=qs['limit'](_0xab7f2b[_0x0188('0x3b')][_0x0188('0x2a')]);_0x4e1519[_0x0188('0x29')]=qs[_0x0188('0x29')](_0xab7f2b[_0x0188('0x3b')][_0x0188('0x29')]);}return _0x377891['getFields'](_0x4e1519);}})[_0x0188('0x1b')](function(_0x5aa39a){if(_0x5aa39a){return _0x5aa39a?{'count':_0x352773,'rows':_0x5aa39a}:null;}})['then'](respondWithResult(_0xad406d,null))['catch'](handleError(_0xad406d,null));};exports['getSubjects']=function(_0x5d3313,_0x1cb88f,_0x47fac5){var _0x1ea1db={};var _0x4956f6={};var _0x28251d;var _0x32cbaa;return db[_0x0188('0x35')]['findOne']({'where':{'id':_0x5d3313[_0x0188('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1cb88f,null))[_0x0188('0x1b')](function(_0x41b225){if(_0x41b225){_0x28251d=_0x41b225;_0x4956f6[_0x0188('0x3a')]=_['keys'](db['ZendeskField'][_0x0188('0x36')]);_0x4956f6[_0x0188('0x3b')]=_[_0x0188('0x4d')](_0x5d3313[_0x0188('0x3b')]);_0x4956f6[_0x0188('0x3c')]=_[_0x0188('0x4e')](_0x4956f6[_0x0188('0x3a')],_0x4956f6[_0x0188('0x3b')]);_0x1ea1db['attributes']=_['intersection'](_0x4956f6[_0x0188('0x3a')],qs['fields'](_0x5d3313['query']['fields']));_0x1ea1db[_0x0188('0x3e')]=_0x1ea1db[_0x0188('0x3e')]['length']?_0x1ea1db['attributes']:_0x4956f6[_0x0188('0x3a')];_0x1ea1db[_0x0188('0x42')]=qs['sort'](_0x5d3313[_0x0188('0x3b')][_0x0188('0x43')]);_0x1ea1db[_0x0188('0x44')]=qs['filters'](_['pick'](_0x5d3313[_0x0188('0x3b')],_0x4956f6[_0x0188('0x3c')]));if(_0x5d3313[_0x0188('0x3b')]['filter']){_0x1ea1db['where']=_[_0x0188('0x47')](_0x1ea1db[_0x0188('0x44')],{'$or':_[_0x0188('0x34')](_0x1ea1db[_0x0188('0x3e')],function(_0x212fb7){var _0x32b7bc={};_0x32b7bc[_0x212fb7]={'$like':'%'+_0x5d3313['query'][_0x0188('0x46')]+'%'};return _0x32b7bc;})});}_0x1ea1db=_['merge']({},_0x1ea1db,_0x5d3313['options']);return _0x28251d['getSubjects'](_0x1ea1db);}})[_0x0188('0x1b')](function(_0x111bd3){if(_0x111bd3){_0x32cbaa=_0x111bd3[_0x0188('0x3f')];if(!_0x5d3313[_0x0188('0x3b')][_0x0188('0x40')](_0x0188('0x41'))){_0x1ea1db[_0x0188('0x2a')]=qs['limit'](_0x5d3313[_0x0188('0x3b')][_0x0188('0x2a')]);_0x1ea1db['offset']=qs[_0x0188('0x29')](_0x5d3313[_0x0188('0x3b')]['offset']);}return _0x28251d[_0x0188('0x58')](_0x1ea1db);}})[_0x0188('0x1b')](function(_0x12abfd){if(_0x12abfd){return _0x12abfd?{'count':_0x32cbaa,'rows':_0x12abfd}:null;}})[_0x0188('0x1b')](respondWithResult(_0x1cb88f,null))[_0x0188('0x24')](handleError(_0x1cb88f,null));};exports[_0x0188('0x59')]=function(_0x478f14,_0x5684ba,_0x1f1649){var _0x54561f={};var _0x5c16ed={};var _0x2040e3;var _0xc5aa40;return db[_0x0188('0x35')][_0x0188('0x56')]({'where':{'id':_0x478f14['params']['id']}})[_0x0188('0x1b')](handleEntityNotFound(_0x5684ba,null))[_0x0188('0x1b')](function(_0x1252b1){if(_0x1252b1){_0x2040e3=_0x1252b1;_0x5c16ed[_0x0188('0x3a')]=_[_0x0188('0x4d')](db['ZendeskField'][_0x0188('0x36')]);_0x5c16ed[_0x0188('0x3b')]=_[_0x0188('0x4d')](_0x478f14['query']);_0x5c16ed[_0x0188('0x3c')]=_[_0x0188('0x4e')](_0x5c16ed[_0x0188('0x3a')],_0x5c16ed[_0x0188('0x3b')]);_0x54561f['attributes']=_[_0x0188('0x4e')](_0x5c16ed['model'],qs[_0x0188('0x3d')](_0x478f14[_0x0188('0x3b')][_0x0188('0x3d')]));_0x54561f[_0x0188('0x3e')]=_0x54561f[_0x0188('0x3e')][_0x0188('0x3f')]?_0x54561f['attributes']:_0x5c16ed['model'];_0x54561f[_0x0188('0x42')]=qs[_0x0188('0x43')](_0x478f14['query'][_0x0188('0x43')]);_0x54561f[_0x0188('0x44')]=qs[_0x0188('0x3c')](_[_0x0188('0x45')](_0x478f14[_0x0188('0x3b')],_0x5c16ed[_0x0188('0x3c')]));if(_0x478f14[_0x0188('0x3b')]['filter']){_0x54561f[_0x0188('0x44')]=_['merge'](_0x54561f['where'],{'$or':_[_0x0188('0x34')](_0x54561f['attributes'],function(_0x1c9ba4){var _0x55053d={};_0x55053d[_0x1c9ba4]={'$like':'%'+_0x478f14['query'][_0x0188('0x46')]+'%'};return _0x55053d;})});}_0x54561f=_[_0x0188('0x47')]({},_0x54561f,_0x478f14[_0x0188('0x5a')]);return _0x2040e3['getDescriptions'](_0x54561f);}})[_0x0188('0x1b')](function(_0xfe56e3){if(_0xfe56e3){_0xc5aa40=_0xfe56e3[_0x0188('0x3f')];if(!_0x478f14[_0x0188('0x3b')][_0x0188('0x40')]('nolimit')){_0x54561f[_0x0188('0x2a')]=qs[_0x0188('0x2a')](_0x478f14[_0x0188('0x3b')]['limit']);_0x54561f['offset']=qs[_0x0188('0x29')](_0x478f14[_0x0188('0x3b')]['offset']);}return _0x2040e3[_0x0188('0x59')](_0x54561f);}})[_0x0188('0x1b')](function(_0x530eae){if(_0x530eae){return _0x530eae?{'count':_0xc5aa40,'rows':_0x530eae}:null;}})[_0x0188('0x1b')](respondWithResult(_0x5684ba,null))[_0x0188('0x24')](handleError(_0x5684ba,null));};exports[_0x0188('0x5b')]=function(_0x5c105c,_0x1cd031,_0x5c933c){var _0x434bb7={};var _0x27f094={};var _0x418273;var _0x4da2ea;return db['ZendeskConfiguration'][_0x0188('0x56')]({'where':{'id':_0x5c105c[_0x0188('0x4c')]['id']}})[_0x0188('0x1b')](handleEntityNotFound(_0x1cd031,null))[_0x0188('0x1b')](function(_0xffabff){if(_0xffabff){_0x418273=_0xffabff;_0x27f094[_0x0188('0x3a')]=_[_0x0188('0x4d')](db['Tag'][_0x0188('0x36')]);_0x27f094['query']=_[_0x0188('0x4d')](_0x5c105c[_0x0188('0x3b')]);_0x27f094[_0x0188('0x3c')]=_[_0x0188('0x4e')](_0x27f094[_0x0188('0x3a')],_0x27f094['query']);_0x434bb7[_0x0188('0x3e')]=_[_0x0188('0x4e')](_0x27f094[_0x0188('0x3a')],qs[_0x0188('0x3d')](_0x5c105c[_0x0188('0x3b')][_0x0188('0x3d')]));_0x434bb7[_0x0188('0x3e')]=_0x434bb7['attributes']['length']?_0x434bb7[_0x0188('0x3e')]:_0x27f094[_0x0188('0x3a')];_0x434bb7[_0x0188('0x42')]=qs['sort'](_0x5c105c[_0x0188('0x3b')][_0x0188('0x43')]);_0x434bb7['where']=qs[_0x0188('0x3c')](_[_0x0188('0x45')](_0x5c105c['query'],_0x27f094[_0x0188('0x3c')]));if(_0x5c105c[_0x0188('0x3b')][_0x0188('0x46')]){_0x434bb7[_0x0188('0x44')]=_[_0x0188('0x47')](_0x434bb7['where'],{'$or':_[_0x0188('0x34')](_0x434bb7[_0x0188('0x3e')],function(_0x10a26d){var _0x29c683={};_0x29c683[_0x10a26d]={'$like':'%'+_0x5c105c['query'][_0x0188('0x46')]+'%'};return _0x29c683;})});}_0x434bb7=_[_0x0188('0x47')]({},_0x434bb7,_0x5c105c[_0x0188('0x5a')]);return _0x418273[_0x0188('0x5b')](_0x434bb7);}})[_0x0188('0x1b')](function(_0x43892b){if(_0x43892b){_0x4da2ea=_0x43892b[_0x0188('0x3f')];if(!_0x5c105c['query'][_0x0188('0x40')]('nolimit')){_0x434bb7[_0x0188('0x2a')]=qs[_0x0188('0x2a')](_0x5c105c[_0x0188('0x3b')]['limit']);_0x434bb7[_0x0188('0x29')]=qs[_0x0188('0x29')](_0x5c105c[_0x0188('0x3b')][_0x0188('0x29')]);}return _0x418273['getTags'](_0x434bb7);}})[_0x0188('0x1b')](function(_0x4c88e5){if(_0x4c88e5){return _0x4c88e5?{'count':_0x4da2ea,'rows':_0x4c88e5}:null;}})['then'](respondWithResult(_0x1cd031,null))[_0x0188('0x24')](handleError(_0x1cd031,null));};exports[_0x0188('0x5c')]=function(_0xfc37e,_0x5b9ba9,_0x3029ee){if(_0xfc37e[_0x0188('0x52')]['id']){delete _0xfc37e[_0x0188('0x52')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0xfc37e[_0x0188('0x4c')]['id']}})[_0x0188('0x1b')](handleEntityNotFound(_0x5b9ba9,null))['then'](function(_0x37e1c1){if(_0x37e1c1){return _0x37e1c1['setTags'](_0xfc37e[_0x0188('0x52')][_0x0188('0x5d')]||[]);}return null;})['then'](respondWithResult(_0x5b9ba9,null))[_0x0188('0x24')](handleError(_0x5b9ba9,null));}; \ No newline at end of file +var _0xa7ad=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','ZendeskConfiguration','length','options','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xa7ad,0xc4));var _0xda7a=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xa7ad[_0x2aea9e];return _0x430b92;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda7a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xda7a('0x1'));var rp=require(_0xda7a('0x2'));var moment=require(_0xda7a('0x3'));var BPromise=require(_0xda7a('0x4'));var Mustache=require(_0xda7a('0x5'));var util=require(_0xda7a('0x6'));var path=require(_0xda7a('0x7'));var sox=require(_0xda7a('0x8'));var csv=require(_0xda7a('0x9'));var ejs=require(_0xda7a('0xa'));var fs=require('fs');var fs_extra=require(_0xda7a('0xb'));var _=require(_0xda7a('0xc'));var squel=require(_0xda7a('0xd'));var crypto=require(_0xda7a('0xe'));var jsforce=require(_0xda7a('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xda7a('0x10'));var Papa=require(_0xda7a('0x11'));var Redis=require('ioredis');var authService=require(_0xda7a('0x12'));var qs=require(_0xda7a('0x13'));var as=require(_0xda7a('0x14'));var hardwareService=require(_0xda7a('0x15'));var logger=require(_0xda7a('0x16'))(_0xda7a('0x17'));var utils=require(_0xda7a('0x18'));var config=require(_0xda7a('0x19'));var licenseUtil=require(_0xda7a('0x1a'));var db=require(_0xda7a('0x1b'))['db'];var jayson=require(_0xda7a('0x1c'));var client=jayson[_0xda7a('0x1d')][_0xda7a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2202de,_0x2702ce,_0xf3da35,_0x3d20db){return new BPromise(function(_0x2ad4e5,_0x432809){var _0x4c0ff1=_0x3d20db||client;return _0x4c0ff1[_0xda7a('0x1f')](_0x2202de,_0xf3da35)[_0xda7a('0x20')](function(_0x1b01d0){logger[_0xda7a('0x21')](_0xda7a('0x22'),_0x2702ce,'request\x20sent');logger[_0xda7a('0x23')](_0xda7a('0x24'),_0x2702ce,_0xda7a('0x25'),JSON['stringify'](_0x1b01d0));if(_0x1b01d0[_0xda7a('0x26')]){if(_0x1b01d0[_0xda7a('0x26')][_0xda7a('0x27')]===0x1f4){logger[_0xda7a('0x26')](_0xda7a('0x22'),_0x2702ce,_0x1b01d0[_0xda7a('0x26')]['message']);return _0x432809(_0x1b01d0[_0xda7a('0x26')][_0xda7a('0x28')]);}logger[_0xda7a('0x26')](_0xda7a('0x22'),_0x2702ce,_0x1b01d0[_0xda7a('0x26')]['message']);return _0x2ad4e5(_0x1b01d0[_0xda7a('0x26')][_0xda7a('0x28')]);}else{logger[_0xda7a('0x21')](_0xda7a('0x22'),_0x2702ce,_0xda7a('0x25'));_0x2ad4e5(_0x1b01d0[_0xda7a('0x29')]['message']);}})[_0xda7a('0x2a')](function(_0x3f135d){logger[_0xda7a('0x26')](_0xda7a('0x22'),_0x2702ce,_0x3f135d);_0x432809(_0x3f135d);});});}function respondWithStatusCode(_0xd07a0b,_0x4bda97){_0x4bda97=_0x4bda97||0xcc;return function(_0x1cd325){if(_0x1cd325){return _0xd07a0b[_0xda7a('0x2b')](_0x4bda97);}return _0xd07a0b[_0xda7a('0x2c')](_0x4bda97)[_0xda7a('0x2d')]();};}function respondWithResult(_0x3b9cee,_0x33bb2e){_0x33bb2e=_0x33bb2e||0xc8;return function(_0x128add){if(_0x128add){return _0x3b9cee['status'](_0x33bb2e)[_0xda7a('0x2e')](_0x128add);}};}function respondWithFilteredResult(_0x51aba5,_0x24fd60){return function(_0x5f01bd){if(_0x5f01bd){var _0x22ae3d=typeof _0x24fd60[_0xda7a('0x2f')]==='undefined'&&typeof _0x24fd60['limit']==='undefined';var _0x139b42=_0x5f01bd['count'];var _0x404fc9=_0x22ae3d?0x0:_0x24fd60[_0xda7a('0x2f')];var _0x5e431e=_0x22ae3d?_0x5f01bd[_0xda7a('0x30')]:_0x24fd60[_0xda7a('0x2f')]+_0x24fd60[_0xda7a('0x31')];var _0x2df6c6;if(_0x5e431e>=_0x139b42){_0x5e431e=_0x139b42;_0x2df6c6=0xc8;}else{_0x2df6c6=0xce;}_0x51aba5[_0xda7a('0x2c')](_0x2df6c6);return _0x51aba5[_0xda7a('0x32')](_0xda7a('0x33'),_0x404fc9+'-'+_0x5e431e+'/'+_0x139b42)['json'](_0x5f01bd);}return null;};}function patchUpdates(_0x1808c3){return function(_0x2a253a){try{jsonpatch[_0xda7a('0x34')](_0x2a253a,_0x1808c3,!![]);}catch(_0x59e307){return BPromise[_0xda7a('0x35')](_0x59e307);}return _0x2a253a[_0xda7a('0x36')]();};}function saveUpdates(_0x3ec3f5,_0x25df58){return function(_0x77aba8){if(_0x77aba8){return _0x77aba8[_0xda7a('0x37')](_0x3ec3f5)['then'](function(_0x243ced){return _0x243ced;});}return null;};}function removeEntity(_0x1614f6,_0x46d5a4){return function(_0xf28bcc){if(_0xf28bcc){return _0xf28bcc[_0xda7a('0x38')]()[_0xda7a('0x20')](function(){_0x1614f6[_0xda7a('0x2c')](0xcc)[_0xda7a('0x2d')]();});}};}function handleEntityNotFound(_0x2a5b07,_0x53f2df){return function(_0x159152){if(!_0x159152){_0x2a5b07['sendStatus'](0x194);}return _0x159152;};}function handleError(_0x1204c6,_0x4e50c3){_0x4e50c3=_0x4e50c3||0x1f4;return function(_0x3e86b9){logger[_0xda7a('0x26')](_0x3e86b9[_0xda7a('0x39')]);if(_0x3e86b9[_0xda7a('0x3a')]){delete _0x3e86b9['name'];}_0x1204c6['status'](_0x4e50c3)[_0xda7a('0x3b')](_0x3e86b9);};}exports[_0xda7a('0x3c')]=function(_0x3da29a,_0xc12c1){var _0x4388c1={},_0x3b90a7={},_0xb3dcae={'count':0x0,'rows':[]};var _0x261eff=_[_0xda7a('0x3d')](db['ZendeskConfiguration'][_0xda7a('0x3e')],function(_0x25c369){return{'name':_0x25c369[_0xda7a('0x3f')],'type':_0x25c369['type'][_0xda7a('0x40')]};});_0x3b90a7[_0xda7a('0x41')]=_['map'](_0x261eff,_0xda7a('0x3a'));_0x3b90a7[_0xda7a('0x42')]=_[_0xda7a('0x43')](_0x3da29a[_0xda7a('0x42')]);_0x3b90a7[_0xda7a('0x44')]=_['intersection'](_0x3b90a7['model'],_0x3b90a7[_0xda7a('0x42')]);_0x4388c1['attributes']=_[_0xda7a('0x45')](_0x3b90a7[_0xda7a('0x41')],qs[_0xda7a('0x46')](_0x3da29a['query'][_0xda7a('0x46')]));_0x4388c1['attributes']=_0x4388c1[_0xda7a('0x47')]['length']?_0x4388c1[_0xda7a('0x47')]:_0x3b90a7[_0xda7a('0x41')];if(!_0x3da29a[_0xda7a('0x42')][_0xda7a('0x48')](_0xda7a('0x49'))){_0x4388c1[_0xda7a('0x31')]=qs[_0xda7a('0x31')](_0x3da29a[_0xda7a('0x42')][_0xda7a('0x31')]);_0x4388c1[_0xda7a('0x2f')]=qs[_0xda7a('0x2f')](_0x3da29a[_0xda7a('0x42')][_0xda7a('0x2f')]);}_0x4388c1[_0xda7a('0x4a')]=qs['sort'](_0x3da29a[_0xda7a('0x42')][_0xda7a('0x4b')]);_0x4388c1[_0xda7a('0x4c')]=qs[_0xda7a('0x44')](_[_0xda7a('0x4d')](_0x3da29a['query'],_0x3b90a7[_0xda7a('0x44')]),_0x261eff);if(_0x3da29a[_0xda7a('0x42')][_0xda7a('0x4e')]){_0x4388c1[_0xda7a('0x4c')]=_[_0xda7a('0x4f')](_0x4388c1[_0xda7a('0x4c')],{'$or':_[_0xda7a('0x3d')](_0x261eff,function(_0x1c183f){if(_0x1c183f['type']!==_0xda7a('0x50')){var _0x365ee8={};_0x365ee8[_0x1c183f['name']]={'$like':'%'+_0x3da29a['query'][_0xda7a('0x4e')]+'%'};return _0x365ee8;}})});}_0x4388c1=_[_0xda7a('0x4f')]({},_0x4388c1,_0x3da29a['options']);var _0x3518ca={'where':_0x4388c1['where']};return db['ZendeskConfiguration'][_0xda7a('0x30')](_0x3518ca)['then'](function(_0x67d1c4){_0xb3dcae['count']=_0x67d1c4;if(_0x3da29a[_0xda7a('0x42')][_0xda7a('0x51')]){_0x4388c1[_0xda7a('0x52')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xda7a('0x53')](_0x4388c1);})['then'](function(_0x3de09e){_0xb3dcae[_0xda7a('0x54')]=_0x3de09e;return _0xb3dcae;})[_0xda7a('0x20')](respondWithFilteredResult(_0xc12c1,_0x4388c1))[_0xda7a('0x2a')](handleError(_0xc12c1,null));};exports[_0xda7a('0x55')]=function(_0x481f7d,_0x34860c){var _0x23586b={'raw':![],'where':{'id':_0x481f7d[_0xda7a('0x56')]['id']}},_0x4264a5={};_0x4264a5[_0xda7a('0x41')]=_[_0xda7a('0x43')](db[_0xda7a('0x57')][_0xda7a('0x3e')]);_0x4264a5[_0xda7a('0x42')]=_[_0xda7a('0x43')](_0x481f7d[_0xda7a('0x42')]);_0x4264a5[_0xda7a('0x44')]=_[_0xda7a('0x45')](_0x4264a5['model'],_0x4264a5[_0xda7a('0x42')]);_0x23586b[_0xda7a('0x47')]=_['intersection'](_0x4264a5[_0xda7a('0x41')],qs[_0xda7a('0x46')](_0x481f7d[_0xda7a('0x42')]['fields']));_0x23586b[_0xda7a('0x47')]=_0x23586b[_0xda7a('0x47')][_0xda7a('0x58')]?_0x23586b[_0xda7a('0x47')]:_0x4264a5[_0xda7a('0x41')];if(_0x481f7d[_0xda7a('0x42')][_0xda7a('0x51')]){_0x23586b[_0xda7a('0x52')]=[{'all':!![]}];}_0x23586b=_['merge']({},_0x23586b,_0x481f7d[_0xda7a('0x59')]);return db[_0xda7a('0x57')][_0xda7a('0x5a')](_0x23586b)['then'](handleEntityNotFound(_0x34860c,null))[_0xda7a('0x20')](respondWithResult(_0x34860c,null))[_0xda7a('0x2a')](handleError(_0x34860c,null));};exports[_0xda7a('0x5b')]=function(_0x3c0990,_0x2a55e6){return db['ZendeskConfiguration'][_0xda7a('0x5b')](_0x3c0990['body'],{})[_0xda7a('0x20')](respondWithResult(_0x2a55e6,0xc9))['catch'](handleError(_0x2a55e6,null));};exports[_0xda7a('0x37')]=function(_0x44afdb,_0x3f5bc2){if(_0x44afdb[_0xda7a('0x5c')]['id']){delete _0x44afdb[_0xda7a('0x5c')]['id'];}return db[_0xda7a('0x57')]['find']({'where':{'id':_0x44afdb[_0xda7a('0x56')]['id']}})[_0xda7a('0x20')](handleEntityNotFound(_0x3f5bc2,null))['then'](saveUpdates(_0x44afdb[_0xda7a('0x5c')],null))[_0xda7a('0x20')](respondWithResult(_0x3f5bc2,null))[_0xda7a('0x2a')](handleError(_0x3f5bc2,null));};exports[_0xda7a('0x38')]=function(_0x2761ea,_0x25860c){return db[_0xda7a('0x57')][_0xda7a('0x5a')]({'where':{'id':_0x2761ea[_0xda7a('0x56')]['id']}})[_0xda7a('0x20')](handleEntityNotFound(_0x25860c,null))[_0xda7a('0x20')](removeEntity(_0x25860c,null))[_0xda7a('0x2a')](handleError(_0x25860c,null));};exports[_0xda7a('0x5d')]=function(_0x55e178,_0x27bd17,_0x2553bb){var _0x52dc28={};var _0xb074a={};var _0x40f8bc;var _0x409631;return db[_0xda7a('0x57')][_0xda7a('0x5e')]({'where':{'id':_0x55e178['params']['id']}})[_0xda7a('0x20')](handleEntityNotFound(_0x27bd17,null))[_0xda7a('0x20')](function(_0x511006){if(_0x511006){_0x40f8bc=_0x511006;_0xb074a[_0xda7a('0x41')]=_['keys'](db[_0xda7a('0x5f')][_0xda7a('0x3e')]);_0xb074a[_0xda7a('0x42')]=_['keys'](_0x55e178[_0xda7a('0x42')]);_0xb074a[_0xda7a('0x44')]=_[_0xda7a('0x45')](_0xb074a[_0xda7a('0x41')],_0xb074a[_0xda7a('0x42')]);_0x52dc28[_0xda7a('0x47')]=_[_0xda7a('0x45')](_0xb074a[_0xda7a('0x41')],qs['fields'](_0x55e178['query'][_0xda7a('0x46')]));_0x52dc28[_0xda7a('0x47')]=_0x52dc28[_0xda7a('0x47')]['length']?_0x52dc28[_0xda7a('0x47')]:_0xb074a['model'];_0x52dc28[_0xda7a('0x4a')]=qs['sort'](_0x55e178[_0xda7a('0x42')]['sort']);_0x52dc28['where']=qs['filters'](_[_0xda7a('0x4d')](_0x55e178[_0xda7a('0x42')],_0xb074a[_0xda7a('0x44')]));if(_0x55e178[_0xda7a('0x42')]['filter']){_0x52dc28['where']=_[_0xda7a('0x4f')](_0x52dc28[_0xda7a('0x4c')],{'$or':_[_0xda7a('0x3d')](_0x52dc28['attributes'],function(_0x46bb6f){var _0x259ee2={};_0x259ee2[_0x46bb6f]={'$like':'%'+_0x55e178[_0xda7a('0x42')]['filter']+'%'};return _0x259ee2;})});}_0x52dc28=_['merge']({},_0x52dc28,_0x55e178[_0xda7a('0x59')]);return _0x40f8bc[_0xda7a('0x5d')](_0x52dc28);}})[_0xda7a('0x20')](function(_0x29b692){if(_0x29b692){_0x409631=_0x29b692[_0xda7a('0x58')];if(!_0x55e178[_0xda7a('0x42')][_0xda7a('0x48')](_0xda7a('0x49'))){_0x52dc28[_0xda7a('0x31')]=qs[_0xda7a('0x31')](_0x55e178[_0xda7a('0x42')][_0xda7a('0x31')]);_0x52dc28['offset']=qs[_0xda7a('0x2f')](_0x55e178[_0xda7a('0x42')][_0xda7a('0x2f')]);}return _0x40f8bc[_0xda7a('0x5d')](_0x52dc28);}})[_0xda7a('0x20')](function(_0x10c4e1){if(_0x10c4e1){return _0x10c4e1?{'count':_0x409631,'rows':_0x10c4e1}:null;}})['then'](respondWithResult(_0x27bd17,null))[_0xda7a('0x2a')](handleError(_0x27bd17,null));};exports['getSubjects']=function(_0x3b85a6,_0x5f2749,_0x86949b){var _0x3de19b={};var _0x160bb8={};var _0xb0239;var _0x1ef1f2;return db[_0xda7a('0x57')][_0xda7a('0x5e')]({'where':{'id':_0x3b85a6['params']['id']}})[_0xda7a('0x20')](handleEntityNotFound(_0x5f2749,null))[_0xda7a('0x20')](function(_0x2eb291){if(_0x2eb291){_0xb0239=_0x2eb291;_0x160bb8[_0xda7a('0x41')]=_[_0xda7a('0x43')](db[_0xda7a('0x5f')][_0xda7a('0x3e')]);_0x160bb8[_0xda7a('0x42')]=_[_0xda7a('0x43')](_0x3b85a6[_0xda7a('0x42')]);_0x160bb8[_0xda7a('0x44')]=_['intersection'](_0x160bb8[_0xda7a('0x41')],_0x160bb8['query']);_0x3de19b[_0xda7a('0x47')]=_[_0xda7a('0x45')](_0x160bb8[_0xda7a('0x41')],qs[_0xda7a('0x46')](_0x3b85a6[_0xda7a('0x42')][_0xda7a('0x46')]));_0x3de19b[_0xda7a('0x47')]=_0x3de19b[_0xda7a('0x47')][_0xda7a('0x58')]?_0x3de19b['attributes']:_0x160bb8[_0xda7a('0x41')];_0x3de19b[_0xda7a('0x4a')]=qs[_0xda7a('0x4b')](_0x3b85a6[_0xda7a('0x42')]['sort']);_0x3de19b[_0xda7a('0x4c')]=qs[_0xda7a('0x44')](_[_0xda7a('0x4d')](_0x3b85a6[_0xda7a('0x42')],_0x160bb8[_0xda7a('0x44')]));if(_0x3b85a6[_0xda7a('0x42')][_0xda7a('0x4e')]){_0x3de19b[_0xda7a('0x4c')]=_[_0xda7a('0x4f')](_0x3de19b['where'],{'$or':_[_0xda7a('0x3d')](_0x3de19b[_0xda7a('0x47')],function(_0x28e31f){var _0x157492={};_0x157492[_0x28e31f]={'$like':'%'+_0x3b85a6[_0xda7a('0x42')]['filter']+'%'};return _0x157492;})});}_0x3de19b=_['merge']({},_0x3de19b,_0x3b85a6[_0xda7a('0x59')]);return _0xb0239[_0xda7a('0x60')](_0x3de19b);}})['then'](function(_0x295a6a){if(_0x295a6a){_0x1ef1f2=_0x295a6a[_0xda7a('0x58')];if(!_0x3b85a6[_0xda7a('0x42')][_0xda7a('0x48')]('nolimit')){_0x3de19b[_0xda7a('0x31')]=qs[_0xda7a('0x31')](_0x3b85a6[_0xda7a('0x42')][_0xda7a('0x31')]);_0x3de19b['offset']=qs[_0xda7a('0x2f')](_0x3b85a6[_0xda7a('0x42')][_0xda7a('0x2f')]);}return _0xb0239[_0xda7a('0x60')](_0x3de19b);}})[_0xda7a('0x20')](function(_0x124647){if(_0x124647){return _0x124647?{'count':_0x1ef1f2,'rows':_0x124647}:null;}})[_0xda7a('0x20')](respondWithResult(_0x5f2749,null))['catch'](handleError(_0x5f2749,null));};exports[_0xda7a('0x61')]=function(_0x3838a4,_0x3bb1a2,_0x436aa6){var _0x2340d5={};var _0x3eb15b={};var _0xadacd5;var _0x544bab;return db[_0xda7a('0x57')][_0xda7a('0x5e')]({'where':{'id':_0x3838a4[_0xda7a('0x56')]['id']}})['then'](handleEntityNotFound(_0x3bb1a2,null))[_0xda7a('0x20')](function(_0x25f756){if(_0x25f756){_0xadacd5=_0x25f756;_0x3eb15b[_0xda7a('0x41')]=_[_0xda7a('0x43')](db[_0xda7a('0x5f')][_0xda7a('0x3e')]);_0x3eb15b[_0xda7a('0x42')]=_[_0xda7a('0x43')](_0x3838a4[_0xda7a('0x42')]);_0x3eb15b[_0xda7a('0x44')]=_['intersection'](_0x3eb15b[_0xda7a('0x41')],_0x3eb15b[_0xda7a('0x42')]);_0x2340d5[_0xda7a('0x47')]=_['intersection'](_0x3eb15b[_0xda7a('0x41')],qs[_0xda7a('0x46')](_0x3838a4[_0xda7a('0x42')][_0xda7a('0x46')]));_0x2340d5['attributes']=_0x2340d5[_0xda7a('0x47')][_0xda7a('0x58')]?_0x2340d5[_0xda7a('0x47')]:_0x3eb15b[_0xda7a('0x41')];_0x2340d5[_0xda7a('0x4a')]=qs[_0xda7a('0x4b')](_0x3838a4['query'][_0xda7a('0x4b')]);_0x2340d5[_0xda7a('0x4c')]=qs['filters'](_['pick'](_0x3838a4[_0xda7a('0x42')],_0x3eb15b[_0xda7a('0x44')]));if(_0x3838a4['query'][_0xda7a('0x4e')]){_0x2340d5[_0xda7a('0x4c')]=_[_0xda7a('0x4f')](_0x2340d5[_0xda7a('0x4c')],{'$or':_[_0xda7a('0x3d')](_0x2340d5['attributes'],function(_0x2e5eeb){var _0x5b803e={};_0x5b803e[_0x2e5eeb]={'$like':'%'+_0x3838a4[_0xda7a('0x42')][_0xda7a('0x4e')]+'%'};return _0x5b803e;})});}_0x2340d5=_[_0xda7a('0x4f')]({},_0x2340d5,_0x3838a4[_0xda7a('0x59')]);return _0xadacd5[_0xda7a('0x61')](_0x2340d5);}})[_0xda7a('0x20')](function(_0x5cca9d){if(_0x5cca9d){_0x544bab=_0x5cca9d['length'];if(!_0x3838a4['query'][_0xda7a('0x48')](_0xda7a('0x49'))){_0x2340d5[_0xda7a('0x31')]=qs[_0xda7a('0x31')](_0x3838a4['query'][_0xda7a('0x31')]);_0x2340d5[_0xda7a('0x2f')]=qs['offset'](_0x3838a4[_0xda7a('0x42')][_0xda7a('0x2f')]);}return _0xadacd5['getDescriptions'](_0x2340d5);}})[_0xda7a('0x20')](function(_0x271c87){if(_0x271c87){return _0x271c87?{'count':_0x544bab,'rows':_0x271c87}:null;}})[_0xda7a('0x20')](respondWithResult(_0x3bb1a2,null))[_0xda7a('0x2a')](handleError(_0x3bb1a2,null));};exports[_0xda7a('0x62')]=function(_0x12541b,_0x1a939f,_0x39eae7){var _0x3d3cbc={};var _0x49768e={};var _0x52b4cd;var _0x4fc4a6;return db[_0xda7a('0x57')][_0xda7a('0x5e')]({'where':{'id':_0x12541b[_0xda7a('0x56')]['id']}})['then'](handleEntityNotFound(_0x1a939f,null))[_0xda7a('0x20')](function(_0x513c1a){if(_0x513c1a){_0x52b4cd=_0x513c1a;_0x49768e[_0xda7a('0x41')]=_[_0xda7a('0x43')](db[_0xda7a('0x63')][_0xda7a('0x3e')]);_0x49768e['query']=_[_0xda7a('0x43')](_0x12541b['query']);_0x49768e[_0xda7a('0x44')]=_[_0xda7a('0x45')](_0x49768e[_0xda7a('0x41')],_0x49768e['query']);_0x3d3cbc[_0xda7a('0x47')]=_[_0xda7a('0x45')](_0x49768e['model'],qs[_0xda7a('0x46')](_0x12541b['query'][_0xda7a('0x46')]));_0x3d3cbc[_0xda7a('0x47')]=_0x3d3cbc[_0xda7a('0x47')]['length']?_0x3d3cbc[_0xda7a('0x47')]:_0x49768e[_0xda7a('0x41')];_0x3d3cbc['order']=qs['sort'](_0x12541b[_0xda7a('0x42')][_0xda7a('0x4b')]);_0x3d3cbc[_0xda7a('0x4c')]=qs[_0xda7a('0x44')](_[_0xda7a('0x4d')](_0x12541b['query'],_0x49768e[_0xda7a('0x44')]));if(_0x12541b['query'][_0xda7a('0x4e')]){_0x3d3cbc[_0xda7a('0x4c')]=_[_0xda7a('0x4f')](_0x3d3cbc[_0xda7a('0x4c')],{'$or':_[_0xda7a('0x3d')](_0x3d3cbc[_0xda7a('0x47')],function(_0x2991f8){var _0x443289={};_0x443289[_0x2991f8]={'$like':'%'+_0x12541b[_0xda7a('0x42')][_0xda7a('0x4e')]+'%'};return _0x443289;})});}_0x3d3cbc=_['merge']({},_0x3d3cbc,_0x12541b['options']);return _0x52b4cd['getTags'](_0x3d3cbc);}})[_0xda7a('0x20')](function(_0x6172f3){if(_0x6172f3){_0x4fc4a6=_0x6172f3[_0xda7a('0x58')];if(!_0x12541b[_0xda7a('0x42')]['hasOwnProperty'](_0xda7a('0x49'))){_0x3d3cbc['limit']=qs[_0xda7a('0x31')](_0x12541b[_0xda7a('0x42')]['limit']);_0x3d3cbc[_0xda7a('0x2f')]=qs['offset'](_0x12541b[_0xda7a('0x42')][_0xda7a('0x2f')]);}return _0x52b4cd[_0xda7a('0x62')](_0x3d3cbc);}})[_0xda7a('0x20')](function(_0x966b66){if(_0x966b66){return _0x966b66?{'count':_0x4fc4a6,'rows':_0x966b66}:null;}})['then'](respondWithResult(_0x1a939f,null))['catch'](handleError(_0x1a939f,null));};exports[_0xda7a('0x64')]=function(_0x418d0d,_0x35d521,_0x4f54b6){if(_0x418d0d[_0xda7a('0x5c')]['id']){delete _0x418d0d[_0xda7a('0x5c')]['id'];}return db['ZendeskConfiguration'][_0xda7a('0x5e')]({'where':{'id':_0x418d0d['params']['id']}})[_0xda7a('0x20')](handleEntityNotFound(_0x35d521,null))['then'](function(_0xba1a38){if(_0xba1a38){return _0xba1a38[_0xda7a('0x64')](_0x418d0d[_0xda7a('0x5c')][_0xda7a('0x65')]||[]);}return null;})[_0xda7a('0x20')](respondWithResult(_0x35d521,null))[_0xda7a('0x2a')](handleError(_0x35d521,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index e0d03cc..1f8666b 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 _0x650b=['./intZendeskConfiguration.attributes','exports','int_zendesk_configurations','lodash','util','moment','bluebird','path','../../config/environment'];(function(_0x16bf0c,_0x158962){var _0xaff2fd=function(_0x2619b6){while(--_0x2619b6){_0x16bf0c['push'](_0x16bf0c['shift']());}};_0xaff2fd(++_0x158962);}(_0x650b,0x11a));var _0xb650=function(_0x2ec344,_0x133bcc){_0x2ec344=_0x2ec344-0x0;var _0x3ddebf=_0x650b[_0x2ec344];return _0x3ddebf;};'use strict';var _=require(_0xb650('0x0'));var util=require(_0xb650('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb650('0x2'));var BPromise=require(_0xb650('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb650('0x4'));var rimraf=require('rimraf');var config=require(_0xb650('0x5'));var attributes=require(_0xb650('0x6'));module[_0xb650('0x7')]=function(_0x3a328d,_0x78b5e9){return _0x3a328d['define']('ZendeskConfiguration',attributes,{'tableName':_0xb650('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x389e=['lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x389e,0x99));var _0xe389=function(_0x1c106d,_0x2c9dd1){_0x1c106d=_0x1c106d-0x0;var _0x15b77a=_0x389e[_0x1c106d];return _0x15b77a;};'use strict';var _=require(_0xe389('0x0'));var util=require('util');var logger=require(_0xe389('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe389('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe389('0x3'));var rimraf=require(_0xe389('0x4'));var config=require(_0xe389('0x5'));var attributes=require(_0xe389('0x6'));module[_0xe389('0x7')]=function(_0x3c10c7,_0x22477f){return _0x3c10c7[_0xe389('0x8')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','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 f9c6f61..888843b 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 _0x838d=['../../config/environment','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1c1e36,_0x3a04d4){var _0x5e746a=function(_0x51b112){while(--_0x51b112){_0x1c1e36['push'](_0x1c1e36['shift']());}};_0x5e746a(++_0x3a04d4);}(_0x838d,0x172));var _0xd838=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x838d[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0xd838('0x0'));var util=require('util');var moment=require(_0xd838('0x1'));var BPromise=require('bluebird');var rs=require(_0xd838('0x2'));var fs=require('fs');var Redis=require(_0xd838('0x3'));var db=require(_0xd838('0x4'))['db'];var utils=require(_0xd838('0x5'));var logger=require(_0xd838('0x6'))(_0xd838('0x7'));var config=require(_0xd838('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd838('0x9')][_0xd838('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x495f84,_0x4a8c3d,_0x48c65a){return new BPromise(function(_0x396c56,_0x1371ab){return client[_0xd838('0xb')](_0x495f84,_0x48c65a)[_0xd838('0xc')](function(_0x5e13a7){logger[_0xd838('0xd')](_0xd838('0xe'),_0x4a8c3d,_0xd838('0xf'));logger[_0xd838('0x10')](_0xd838('0x11'),_0x4a8c3d,_0xd838('0xf'),JSON['stringify'](_0x5e13a7));if(_0x5e13a7['error']){if(_0x5e13a7['error']['code']===0x1f4){logger[_0xd838('0x12')](_0xd838('0xe'),_0x4a8c3d,_0x5e13a7['error'][_0xd838('0x13')]);return _0x1371ab(_0x5e13a7[_0xd838('0x12')]['message']);}logger[_0xd838('0x12')](_0xd838('0xe'),_0x4a8c3d,_0x5e13a7[_0xd838('0x12')][_0xd838('0x13')]);return _0x396c56(_0x5e13a7[_0xd838('0x12')][_0xd838('0x13')]);}else{logger[_0xd838('0xd')](_0xd838('0xe'),_0x4a8c3d,'request\x20sent');_0x396c56(_0x5e13a7[_0xd838('0x14')]['message']);}})['catch'](function(_0x1fc3d5){logger[_0xd838('0x12')](_0xd838('0xe'),_0x4a8c3d,_0x1fc3d5);_0x1371ab(_0x1fc3d5);});});} \ No newline at end of file +var _0x1359=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1359,0x138));var _0x9135=function(_0x2d2aa4,_0x4f0c97){_0x2d2aa4=_0x2d2aa4-0x0;var _0x1b54bd=_0x1359[_0x2d2aa4];return _0x1b54bd;};'use strict';var _=require(_0x9135('0x0'));var util=require(_0x9135('0x1'));var moment=require(_0x9135('0x2'));var BPromise=require(_0x9135('0x3'));var rs=require(_0x9135('0x4'));var fs=require('fs');var Redis=require(_0x9135('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9135('0x6'));var logger=require(_0x9135('0x7'))(_0x9135('0x8'));var config=require(_0x9135('0x9'));var jayson=require(_0x9135('0xa'));var client=jayson[_0x9135('0xb')][_0x9135('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d2024,_0x482bb2,_0x4c9ea3){return new BPromise(function(_0x425e45,_0x282c16){return client['request'](_0x3d2024,_0x4c9ea3)[_0x9135('0xd')](function(_0x2942d1){logger[_0x9135('0xe')](_0x9135('0xf'),_0x482bb2,_0x9135('0x10'));logger[_0x9135('0x11')](_0x9135('0x12'),_0x482bb2,'request\x20sent',JSON['stringify'](_0x2942d1));if(_0x2942d1[_0x9135('0x13')]){if(_0x2942d1[_0x9135('0x13')][_0x9135('0x14')]===0x1f4){logger[_0x9135('0x13')](_0x9135('0xf'),_0x482bb2,_0x2942d1['error'][_0x9135('0x15')]);return _0x282c16(_0x2942d1[_0x9135('0x13')][_0x9135('0x15')]);}logger[_0x9135('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x482bb2,_0x2942d1['error']['message']);return _0x425e45(_0x2942d1[_0x9135('0x13')][_0x9135('0x15')]);}else{logger[_0x9135('0xe')](_0x9135('0xf'),_0x482bb2,_0x9135('0x10'));_0x425e45(_0x2942d1[_0x9135('0x16')]['message']);}})[_0x9135('0x17')](function(_0x2d8d83){logger[_0x9135('0x13')](_0x9135('0xf'),_0x482bb2,_0x2d8d83);_0x282c16(_0x2d8d83);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index ecc7825..afdb5b3 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 _0xc124=['./intZendeskField.controller','get','index','/:id','isAuthenticated','post','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0xc124,0x118));var _0x4c12=function(_0x251d24,_0x428b32){_0x251d24=_0x251d24-0x0;var _0x302497=_0xc124[_0x251d24];return _0x302497;};'use strict';var multer=require(_0x4c12('0x0'));var util=require(_0x4c12('0x1'));var path=require(_0x4c12('0x2'));var timeout=require(_0x4c12('0x3'));var express=require(_0x4c12('0x4'));var router=express[_0x4c12('0x5')]();var fs_extra=require(_0x4c12('0x6'));var auth=require(_0x4c12('0x7'));var interaction=require(_0x4c12('0x8'));var config=require('../../config/environment');var controller=require(_0x4c12('0x9'));router[_0x4c12('0xa')]('/',auth['isAuthenticated'](),controller[_0x4c12('0xb')]);router['get'](_0x4c12('0xc'),auth[_0x4c12('0xd')](),controller['show']);router[_0x4c12('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x4c12('0xc'),auth[_0x4c12('0xd')](),controller['update']);router['delete'](_0x4c12('0xc'),auth[_0x4c12('0xd')](),controller[_0x4c12('0xf')]);module[_0x4c12('0x10')]=router; \ No newline at end of file +var _0x9975=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x2aff0a,_0x291b32){var _0x4fad8e=function(_0x17daac){while(--_0x17daac){_0x2aff0a['push'](_0x2aff0a['shift']());}};_0x4fad8e(++_0x291b32);}(_0x9975,0xa0));var _0x5997=function(_0x5a167c,_0x121d32){_0x5a167c=_0x5a167c-0x0;var _0x2b66f4=_0x9975[_0x5a167c];return _0x2b66f4;};'use strict';var multer=require(_0x5997('0x0'));var util=require(_0x5997('0x1'));var path=require(_0x5997('0x2'));var timeout=require(_0x5997('0x3'));var express=require(_0x5997('0x4'));var router=express[_0x5997('0x5')]();var fs_extra=require(_0x5997('0x6'));var auth=require(_0x5997('0x7'));var interaction=require(_0x5997('0x8'));var config=require(_0x5997('0x9'));var controller=require('./intZendeskField.controller');router[_0x5997('0xa')]('/',auth[_0x5997('0xb')](),controller['index']);router[_0x5997('0xa')](_0x5997('0xc'),auth[_0x5997('0xb')](),controller[_0x5997('0xd')]);router[_0x5997('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5997('0xf')](_0x5997('0xc'),auth[_0x5997('0xb')](),controller[_0x5997('0x10')]);router[_0x5997('0x11')](_0x5997('0xc'),auth[_0x5997('0xb')](),controller[_0x5997('0x12')]);module[_0x5997('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index ee5a9b0..1b88165 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 _0x4b1f=['exports','string','variable','customVariable','picklist','STRING','sequelize'];(function(_0x2c6b92,_0x1dd332){var _0x2e3580=function(_0x3cb817){while(--_0x3cb817){_0x2c6b92['push'](_0x2c6b92['shift']());}};_0x2e3580(++_0x1dd332);}(_0x4b1f,0x195));var _0xf4b1=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x4b1f[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require(_0xf4b1('0x0'));module[_0xf4b1('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf4b1('0x2'),_0xf4b1('0x3'),_0xf4b1('0x4'),'keyValue',_0xf4b1('0x5')),'defaultValue':_0xf4b1('0x2')},'content':{'type':Sequelize[_0xf4b1('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xf4b1('0x2'),_0xf4b1('0x3'),_0xf4b1('0x4'))},'keyContent':{'type':Sequelize[_0xf4b1('0x6')]},'idField':{'type':Sequelize[_0xf4b1('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x222f=['string','keyValue','picklist','STRING','variable','customVariable','sequelize','exports','ENUM'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x222f,0x1a4));var _0xf222=function(_0x1c6551,_0x3fbc2e){_0x1c6551=_0x1c6551-0x0;var _0x3f7434=_0x222f[_0x1c6551];return _0x3f7434;};'use strict';var Sequelize=require(_0xf222('0x0'));module[_0xf222('0x1')]={'type':{'type':Sequelize[_0xf222('0x2')](_0xf222('0x3'),'variable','customVariable',_0xf222('0x4'),_0xf222('0x5')),'defaultValue':_0xf222('0x3')},'content':{'type':Sequelize[_0xf222('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf222('0x2')]('string',_0xf222('0x7'),_0xf222('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf222('0x6')]},'nameField':{'type':Sequelize[_0xf222('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf222('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 2100a58..ad4547f 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 _0x44d8=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','ZendeskField','fieldName','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x20c356,_0xcf42fe){var _0x33bdd7=function(_0x1e0f4c){while(--_0x1e0f4c){_0x20c356['push'](_0x20c356['shift']());}};_0x33bdd7(++_0xcf42fe);}(_0x44d8,0x170));var _0x844d=function(_0x40c3e4,_0x59d4df){_0x40c3e4=_0x40c3e4-0x0;var _0x2871e2=_0x44d8[_0x40c3e4];return _0x2871e2;};'use strict';var emlformat=require(_0x844d('0x0'));var rimraf=require(_0x844d('0x1'));var zipdir=require(_0x844d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x844d('0x3'));var moment=require(_0x844d('0x4'));var BPromise=require(_0x844d('0x5'));var Mustache=require(_0x844d('0x6'));var util=require(_0x844d('0x7'));var path=require(_0x844d('0x8'));var sox=require('sox');var csv=require(_0x844d('0x9'));var ejs=require(_0x844d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x844d('0xb'));var squel=require(_0x844d('0xc'));var crypto=require('crypto');var jsforce=require(_0x844d('0xd'));var deskjs=require(_0x844d('0xe'));var toCsv=require(_0x844d('0x9'));var querystring=require(_0x844d('0xf'));var Papa=require(_0x844d('0x10'));var Redis=require('ioredis');var authService=require(_0x844d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x844d('0x12'));var logger=require(_0x844d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x844d('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ceba2,_0x4c6259){_0x4c6259=_0x4c6259||0xcc;return function(_0xa01351){if(_0xa01351){return _0x3ceba2[_0x844d('0x15')](_0x4c6259);}return _0x3ceba2[_0x844d('0x16')](_0x4c6259)['end']();};}function respondWithResult(_0x3086f9,_0xfbf899){_0xfbf899=_0xfbf899||0xc8;return function(_0x51e2d4){if(_0x51e2d4){return _0x3086f9[_0x844d('0x16')](_0xfbf899)[_0x844d('0x17')](_0x51e2d4);}};}function respondWithFilteredResult(_0x4afda2,_0x3d1633){return function(_0x4af9cf){if(_0x4af9cf){var _0x5b9fb0=typeof _0x3d1633['offset']===_0x844d('0x18')&&typeof _0x3d1633[_0x844d('0x19')]===_0x844d('0x18');var _0x1c88a3=_0x4af9cf[_0x844d('0x1a')];var _0x313a0e=_0x5b9fb0?0x0:_0x3d1633[_0x844d('0x1b')];var _0x1a1583=_0x5b9fb0?_0x4af9cf[_0x844d('0x1a')]:_0x3d1633['offset']+_0x3d1633[_0x844d('0x19')];var _0x3ec57f;if(_0x1a1583>=_0x1c88a3){_0x1a1583=_0x1c88a3;_0x3ec57f=0xc8;}else{_0x3ec57f=0xce;}_0x4afda2[_0x844d('0x16')](_0x3ec57f);return _0x4afda2[_0x844d('0x1c')](_0x844d('0x1d'),_0x313a0e+'-'+_0x1a1583+'/'+_0x1c88a3)[_0x844d('0x17')](_0x4af9cf);}return null;};}function patchUpdates(_0x503c52){return function(_0x1973d3){try{jsonpatch[_0x844d('0x1e')](_0x1973d3,_0x503c52,!![]);}catch(_0x53a985){return BPromise[_0x844d('0x1f')](_0x53a985);}return _0x1973d3[_0x844d('0x20')]();};}function saveUpdates(_0x38ce46,_0x15d151){return function(_0x5995c9){if(_0x5995c9){return _0x5995c9[_0x844d('0x21')](_0x38ce46)[_0x844d('0x22')](function(_0x32fffa){return _0x32fffa;});}return null;};}function removeEntity(_0x53f9f0,_0xe40d30){return function(_0x2d9b28){if(_0x2d9b28){return _0x2d9b28[_0x844d('0x23')]()['then'](function(){_0x53f9f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x340b24,_0x34df57){return function(_0x2d89dd){if(!_0x2d89dd){_0x340b24[_0x844d('0x15')](0x194);}return _0x2d89dd;};}function handleError(_0x412f01,_0x3958d2){_0x3958d2=_0x3958d2||0x1f4;return function(_0x23b094){logger[_0x844d('0x24')](_0x23b094[_0x844d('0x25')]);if(_0x23b094[_0x844d('0x26')]){delete _0x23b094[_0x844d('0x26')];}_0x412f01[_0x844d('0x16')](_0x3958d2)['send'](_0x23b094);};}exports['index']=function(_0xac147e,_0x4993da){var _0xb369bc={},_0x5569ba={},_0x50cc35={'count':0x0,'rows':[]};var _0xec774a=_[_0x844d('0x27')](db[_0x844d('0x28')]['rawAttributes'],function(_0x482e3d){return{'name':_0x482e3d[_0x844d('0x29')],'type':_0x482e3d[_0x844d('0x2a')]['key']};});_0x5569ba[_0x844d('0x2b')]=_[_0x844d('0x27')](_0xec774a,_0x844d('0x26'));_0x5569ba['query']=_['keys'](_0xac147e['query']);_0x5569ba[_0x844d('0x2c')]=_[_0x844d('0x2d')](_0x5569ba[_0x844d('0x2b')],_0x5569ba[_0x844d('0x2e')]);_0xb369bc[_0x844d('0x2f')]=_[_0x844d('0x2d')](_0x5569ba[_0x844d('0x2b')],qs[_0x844d('0x30')](_0xac147e[_0x844d('0x2e')][_0x844d('0x30')]));_0xb369bc[_0x844d('0x2f')]=_0xb369bc[_0x844d('0x2f')][_0x844d('0x31')]?_0xb369bc[_0x844d('0x2f')]:_0x5569ba['model'];if(!_0xac147e[_0x844d('0x2e')][_0x844d('0x32')](_0x844d('0x33'))){_0xb369bc['limit']=qs['limit'](_0xac147e['query']['limit']);_0xb369bc[_0x844d('0x1b')]=qs[_0x844d('0x1b')](_0xac147e[_0x844d('0x2e')][_0x844d('0x1b')]);}_0xb369bc[_0x844d('0x34')]=qs[_0x844d('0x35')](_0xac147e['query'][_0x844d('0x35')]);_0xb369bc[_0x844d('0x36')]=qs[_0x844d('0x2c')](_[_0x844d('0x37')](_0xac147e[_0x844d('0x2e')],_0x5569ba[_0x844d('0x2c')]),_0xec774a);if(_0xac147e['query'][_0x844d('0x38')]){_0xb369bc[_0x844d('0x36')]=_[_0x844d('0x39')](_0xb369bc[_0x844d('0x36')],{'$or':_[_0x844d('0x27')](_0xec774a,function(_0x31a0ad){if(_0x31a0ad[_0x844d('0x2a')]!==_0x844d('0x3a')){var _0x32aad9={};_0x32aad9[_0x31a0ad[_0x844d('0x26')]]={'$like':'%'+_0xac147e['query'][_0x844d('0x38')]+'%'};return _0x32aad9;}})});}_0xb369bc=_[_0x844d('0x39')]({},_0xb369bc,_0xac147e[_0x844d('0x3b')]);var _0x17dbf3={'where':_0xb369bc[_0x844d('0x36')]};return db['ZendeskField'][_0x844d('0x1a')](_0x17dbf3)['then'](function(_0x587bfe){_0x50cc35[_0x844d('0x1a')]=_0x587bfe;if(_0xac147e[_0x844d('0x2e')][_0x844d('0x3c')]){_0xb369bc[_0x844d('0x3d')]=[{'all':!![]}];}return db['ZendeskField'][_0x844d('0x3e')](_0xb369bc);})[_0x844d('0x22')](function(_0xfddb2c){_0x50cc35[_0x844d('0x3f')]=_0xfddb2c;return _0x50cc35;})[_0x844d('0x22')](respondWithFilteredResult(_0x4993da,_0xb369bc))[_0x844d('0x40')](handleError(_0x4993da,null));};exports['show']=function(_0x267c48,_0x43a3bc){var _0x19527b={'raw':!![],'where':{'id':_0x267c48['params']['id']}},_0x18ce62={};_0x18ce62[_0x844d('0x2b')]=_[_0x844d('0x41')](db['ZendeskField'][_0x844d('0x42')]);_0x18ce62[_0x844d('0x2e')]=_[_0x844d('0x41')](_0x267c48[_0x844d('0x2e')]);_0x18ce62['filters']=_[_0x844d('0x2d')](_0x18ce62[_0x844d('0x2b')],_0x18ce62[_0x844d('0x2e')]);_0x19527b[_0x844d('0x2f')]=_[_0x844d('0x2d')](_0x18ce62[_0x844d('0x2b')],qs['fields'](_0x267c48[_0x844d('0x2e')][_0x844d('0x30')]));_0x19527b[_0x844d('0x2f')]=_0x19527b[_0x844d('0x2f')][_0x844d('0x31')]?_0x19527b[_0x844d('0x2f')]:_0x18ce62[_0x844d('0x2b')];if(_0x267c48[_0x844d('0x2e')][_0x844d('0x3c')]){_0x19527b[_0x844d('0x3d')]=[{'all':!![]}];}_0x19527b=_[_0x844d('0x39')]({},_0x19527b,_0x267c48[_0x844d('0x3b')]);return db[_0x844d('0x28')][_0x844d('0x43')](_0x19527b)[_0x844d('0x22')](handleEntityNotFound(_0x43a3bc,null))[_0x844d('0x22')](respondWithResult(_0x43a3bc,null))[_0x844d('0x40')](handleError(_0x43a3bc,null));};exports[_0x844d('0x44')]=function(_0x367167,_0x5a1486){return db[_0x844d('0x28')][_0x844d('0x44')](_0x367167[_0x844d('0x45')],{})[_0x844d('0x22')](respondWithResult(_0x5a1486,0xc9))['catch'](handleError(_0x5a1486,null));};exports[_0x844d('0x21')]=function(_0x1b8f0a,_0x3b579b){if(_0x1b8f0a['body']['id']){delete _0x1b8f0a[_0x844d('0x45')]['id'];}return db[_0x844d('0x28')]['find']({'where':{'id':_0x1b8f0a['params']['id']}})[_0x844d('0x22')](handleEntityNotFound(_0x3b579b,null))[_0x844d('0x22')](saveUpdates(_0x1b8f0a['body'],null))[_0x844d('0x22')](respondWithResult(_0x3b579b,null))[_0x844d('0x40')](handleError(_0x3b579b,null));};exports[_0x844d('0x23')]=function(_0x5ed2d2,_0x5742b8){return db['ZendeskField'][_0x844d('0x43')]({'where':{'id':_0x5ed2d2['params']['id']}})[_0x844d('0x22')](handleEntityNotFound(_0x5742b8,null))[_0x844d('0x22')](removeEntity(_0x5742b8,null))['catch'](handleError(_0x5742b8,null));}; \ No newline at end of file +var _0xb24d=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','ZendeskField','fieldName','type','key','model','keys','query'];(function(_0x25e1b3,_0x401acb){var _0x456406=function(_0x3bbc49){while(--_0x3bbc49){_0x25e1b3['push'](_0x25e1b3['shift']());}};_0x456406(++_0x401acb);}(_0xb24d,0xb4));var _0xdb24=function(_0x3d7d7e,_0x22db6b){_0x3d7d7e=_0x3d7d7e-0x0;var _0x32840e=_0xb24d[_0x3d7d7e];return _0x32840e;};'use strict';var emlformat=require(_0xdb24('0x0'));var rimraf=require(_0xdb24('0x1'));var zipdir=require(_0xdb24('0x2'));var jsonpatch=require(_0xdb24('0x3'));var rp=require(_0xdb24('0x4'));var moment=require(_0xdb24('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdb24('0x6'));var path=require('path');var sox=require(_0xdb24('0x7'));var csv=require('to-csv');var ejs=require(_0xdb24('0x8'));var fs=require('fs');var fs_extra=require(_0xdb24('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb24('0xa'));var jsforce=require(_0xdb24('0xb'));var deskjs=require(_0xdb24('0xc'));var toCsv=require(_0xdb24('0xd'));var querystring=require(_0xdb24('0xe'));var Papa=require(_0xdb24('0xf'));var Redis=require(_0xdb24('0x10'));var authService=require(_0xdb24('0x11'));var qs=require(_0xdb24('0x12'));var as=require(_0xdb24('0x13'));var hardwareService=require(_0xdb24('0x14'));var logger=require(_0xdb24('0x15'))(_0xdb24('0x16'));var utils=require('../../config/utils');var config=require(_0xdb24('0x17'));var licenseUtil=require(_0xdb24('0x18'));var db=require(_0xdb24('0x19'))['db'];function respondWithStatusCode(_0x2a8450,_0x31f4f3){_0x31f4f3=_0x31f4f3||0xcc;return function(_0x383fbc){if(_0x383fbc){return _0x2a8450['sendStatus'](_0x31f4f3);}return _0x2a8450[_0xdb24('0x1a')](_0x31f4f3)[_0xdb24('0x1b')]();};}function respondWithResult(_0x424993,_0x3ac7e0){_0x3ac7e0=_0x3ac7e0||0xc8;return function(_0x5c2c30){if(_0x5c2c30){return _0x424993[_0xdb24('0x1a')](_0x3ac7e0)[_0xdb24('0x1c')](_0x5c2c30);}};}function respondWithFilteredResult(_0x2f03f4,_0x1cc94a){return function(_0x3e9ab3){if(_0x3e9ab3){var _0x1451dc=typeof _0x1cc94a[_0xdb24('0x1d')]===_0xdb24('0x1e')&&typeof _0x1cc94a[_0xdb24('0x1f')]===_0xdb24('0x1e');var _0x219cc3=_0x3e9ab3['count'];var _0x2468a0=_0x1451dc?0x0:_0x1cc94a['offset'];var _0x20d5db=_0x1451dc?_0x3e9ab3['count']:_0x1cc94a[_0xdb24('0x1d')]+_0x1cc94a[_0xdb24('0x1f')];var _0x33d1c7;if(_0x20d5db>=_0x219cc3){_0x20d5db=_0x219cc3;_0x33d1c7=0xc8;}else{_0x33d1c7=0xce;}_0x2f03f4[_0xdb24('0x1a')](_0x33d1c7);return _0x2f03f4[_0xdb24('0x20')](_0xdb24('0x21'),_0x2468a0+'-'+_0x20d5db+'/'+_0x219cc3)[_0xdb24('0x1c')](_0x3e9ab3);}return null;};}function patchUpdates(_0x85bf24){return function(_0x4453a0){try{jsonpatch['apply'](_0x4453a0,_0x85bf24,!![]);}catch(_0x48d367){return BPromise[_0xdb24('0x22')](_0x48d367);}return _0x4453a0[_0xdb24('0x23')]();};}function saveUpdates(_0x23d1f5,_0x4a37e1){return function(_0x3c8b89){if(_0x3c8b89){return _0x3c8b89[_0xdb24('0x24')](_0x23d1f5)['then'](function(_0x174eb2){return _0x174eb2;});}return null;};}function removeEntity(_0x4d174e,_0x6d1a34){return function(_0x26a209){if(_0x26a209){return _0x26a209['destroy']()[_0xdb24('0x25')](function(){_0x4d174e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21f62d,_0x2202d2){return function(_0x1de3e5){if(!_0x1de3e5){_0x21f62d['sendStatus'](0x194);}return _0x1de3e5;};}function handleError(_0xac1455,_0x33377f){_0x33377f=_0x33377f||0x1f4;return function(_0x52b903){logger[_0xdb24('0x26')](_0x52b903[_0xdb24('0x27')]);if(_0x52b903[_0xdb24('0x28')]){delete _0x52b903[_0xdb24('0x28')];}_0xac1455['status'](_0x33377f)[_0xdb24('0x29')](_0x52b903);};}exports[_0xdb24('0x2a')]=function(_0x154436,_0x2131e6){var _0x324388={},_0xbf91d={},_0x27c66d={'count':0x0,'rows':[]};var _0x202292=_[_0xdb24('0x2b')](db[_0xdb24('0x2c')]['rawAttributes'],function(_0x124bf3){return{'name':_0x124bf3[_0xdb24('0x2d')],'type':_0x124bf3[_0xdb24('0x2e')][_0xdb24('0x2f')]};});_0xbf91d[_0xdb24('0x30')]=_[_0xdb24('0x2b')](_0x202292,_0xdb24('0x28'));_0xbf91d['query']=_[_0xdb24('0x31')](_0x154436[_0xdb24('0x32')]);_0xbf91d[_0xdb24('0x33')]=_[_0xdb24('0x34')](_0xbf91d[_0xdb24('0x30')],_0xbf91d['query']);_0x324388['attributes']=_[_0xdb24('0x34')](_0xbf91d['model'],qs[_0xdb24('0x35')](_0x154436[_0xdb24('0x32')][_0xdb24('0x35')]));_0x324388[_0xdb24('0x36')]=_0x324388[_0xdb24('0x36')][_0xdb24('0x37')]?_0x324388['attributes']:_0xbf91d['model'];if(!_0x154436[_0xdb24('0x32')][_0xdb24('0x38')](_0xdb24('0x39'))){_0x324388[_0xdb24('0x1f')]=qs[_0xdb24('0x1f')](_0x154436[_0xdb24('0x32')][_0xdb24('0x1f')]);_0x324388[_0xdb24('0x1d')]=qs[_0xdb24('0x1d')](_0x154436['query'][_0xdb24('0x1d')]);}_0x324388[_0xdb24('0x3a')]=qs[_0xdb24('0x3b')](_0x154436[_0xdb24('0x32')][_0xdb24('0x3b')]);_0x324388[_0xdb24('0x3c')]=qs['filters'](_[_0xdb24('0x3d')](_0x154436[_0xdb24('0x32')],_0xbf91d[_0xdb24('0x33')]),_0x202292);if(_0x154436[_0xdb24('0x32')][_0xdb24('0x3e')]){_0x324388[_0xdb24('0x3c')]=_['merge'](_0x324388[_0xdb24('0x3c')],{'$or':_[_0xdb24('0x2b')](_0x202292,function(_0x343173){if(_0x343173[_0xdb24('0x2e')]!==_0xdb24('0x3f')){var _0x354bed={};_0x354bed[_0x343173[_0xdb24('0x28')]]={'$like':'%'+_0x154436[_0xdb24('0x32')][_0xdb24('0x3e')]+'%'};return _0x354bed;}})});}_0x324388=_['merge']({},_0x324388,_0x154436[_0xdb24('0x40')]);var _0x52f520={'where':_0x324388[_0xdb24('0x3c')]};return db[_0xdb24('0x2c')][_0xdb24('0x41')](_0x52f520)[_0xdb24('0x25')](function(_0x1eb16e){_0x27c66d[_0xdb24('0x41')]=_0x1eb16e;if(_0x154436[_0xdb24('0x32')][_0xdb24('0x42')]){_0x324388['include']=[{'all':!![]}];}return db['ZendeskField'][_0xdb24('0x43')](_0x324388);})[_0xdb24('0x25')](function(_0x785799){_0x27c66d[_0xdb24('0x44')]=_0x785799;return _0x27c66d;})[_0xdb24('0x25')](respondWithFilteredResult(_0x2131e6,_0x324388))[_0xdb24('0x45')](handleError(_0x2131e6,null));};exports[_0xdb24('0x46')]=function(_0x541228,_0x395b5e){var _0x2b5b20={'raw':!![],'where':{'id':_0x541228[_0xdb24('0x47')]['id']}},_0x36072e={};_0x36072e[_0xdb24('0x30')]=_['keys'](db[_0xdb24('0x2c')][_0xdb24('0x48')]);_0x36072e['query']=_[_0xdb24('0x31')](_0x541228[_0xdb24('0x32')]);_0x36072e[_0xdb24('0x33')]=_[_0xdb24('0x34')](_0x36072e[_0xdb24('0x30')],_0x36072e[_0xdb24('0x32')]);_0x2b5b20[_0xdb24('0x36')]=_[_0xdb24('0x34')](_0x36072e[_0xdb24('0x30')],qs[_0xdb24('0x35')](_0x541228['query'][_0xdb24('0x35')]));_0x2b5b20[_0xdb24('0x36')]=_0x2b5b20[_0xdb24('0x36')][_0xdb24('0x37')]?_0x2b5b20[_0xdb24('0x36')]:_0x36072e['model'];if(_0x541228[_0xdb24('0x32')][_0xdb24('0x42')]){_0x2b5b20['include']=[{'all':!![]}];}_0x2b5b20=_[_0xdb24('0x49')]({},_0x2b5b20,_0x541228['options']);return db['ZendeskField'][_0xdb24('0x4a')](_0x2b5b20)[_0xdb24('0x25')](handleEntityNotFound(_0x395b5e,null))[_0xdb24('0x25')](respondWithResult(_0x395b5e,null))['catch'](handleError(_0x395b5e,null));};exports[_0xdb24('0x4b')]=function(_0x5d799b,_0x1cd886){return db[_0xdb24('0x2c')][_0xdb24('0x4b')](_0x5d799b[_0xdb24('0x4c')],{})[_0xdb24('0x25')](respondWithResult(_0x1cd886,0xc9))[_0xdb24('0x45')](handleError(_0x1cd886,null));};exports[_0xdb24('0x24')]=function(_0x19c972,_0x111c48){if(_0x19c972[_0xdb24('0x4c')]['id']){delete _0x19c972['body']['id'];}return db[_0xdb24('0x2c')]['find']({'where':{'id':_0x19c972[_0xdb24('0x47')]['id']}})[_0xdb24('0x25')](handleEntityNotFound(_0x111c48,null))['then'](saveUpdates(_0x19c972['body'],null))[_0xdb24('0x25')](respondWithResult(_0x111c48,null))[_0xdb24('0x45')](handleError(_0x111c48,null));};exports['destroy']=function(_0x299b69,_0x10b1e8){return db[_0xdb24('0x2c')][_0xdb24('0x4a')]({'where':{'id':_0x299b69[_0xdb24('0x47')]['id']}})['then'](handleEntityNotFound(_0x10b1e8,null))[_0xdb24('0x25')](removeEntity(_0x10b1e8,null))['catch'](handleError(_0x10b1e8,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 0e1311e..435430f 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 _0x6be1=['ZendeskField','zendesk_unique_index','idField','FieldId','lodash','util','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define'];(function(_0x17876c,_0x17c9e3){var _0x26844b=function(_0x497029){while(--_0x497029){_0x17876c['push'](_0x17876c['shift']());}};_0x26844b(++_0x17c9e3);}(_0x6be1,0x12f));var _0x16be=function(_0x207b43,_0x4caa13){_0x207b43=_0x207b43-0x0;var _0x262998=_0x6be1[_0x207b43];return _0x262998;};'use strict';var _=require(_0x16be('0x0'));var util=require(_0x16be('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x16be('0x2'));var fs=require('fs');var path=require(_0x16be('0x3'));var rimraf=require(_0x16be('0x4'));var config=require(_0x16be('0x5'));var attributes=require(_0x16be('0x6'));module[_0x16be('0x7')]=function(_0x36e4da,_0x19754e){return _0x36e4da[_0x16be('0x8')](_0x16be('0x9'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x16be('0xa'),'fields':[_0x16be('0xb'),_0x16be('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3402=['exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./intZendeskField.attributes'];(function(_0x467510,_0x48d904){var _0x2991cb=function(_0x1ea6e5){while(--_0x1ea6e5){_0x467510['push'](_0x467510['shift']());}};_0x2991cb(++_0x48d904);}(_0x3402,0x1f0));var _0x2340=function(_0x1b98fc,_0x1bd2bb){_0x1b98fc=_0x1b98fc-0x0;var _0x46ea3a=_0x3402[_0x1b98fc];return _0x46ea3a;};'use strict';var _=require(_0x2340('0x0'));var util=require('util');var logger=require(_0x2340('0x1'))(_0x2340('0x2'));var moment=require(_0x2340('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2340('0x4'));var rimraf=require(_0x2340('0x5'));var config=require(_0x2340('0x6'));var attributes=require(_0x2340('0x7'));module[_0x2340('0x8')]=function(_0x5dc7e6,_0x5cf949){return _0x5dc7e6[_0x2340('0x9')](_0x2340('0xa'),attributes,{'tableName':_0x2340('0xb'),'paranoid':![],'indexes':[{'name':_0x2340('0xc'),'fields':[_0x2340('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index f29f8cc..b52e499 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 _0xe030=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','info','result','catch'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xe030,0x19e));var _0x0e03=function(_0x5746a1,_0x11eab1){_0x5746a1=_0x5746a1-0x0;var _0x551a43=_0xe030[_0x5746a1];return _0x551a43;};'use strict';var _=require(_0x0e03('0x0'));var util=require(_0x0e03('0x1'));var moment=require('moment');var BPromise=require(_0x0e03('0x2'));var rs=require(_0x0e03('0x3'));var fs=require('fs');var Redis=require(_0x0e03('0x4'));var db=require(_0x0e03('0x5'))['db'];var utils=require(_0x0e03('0x6'));var logger=require(_0x0e03('0x7'))(_0x0e03('0x8'));var config=require(_0x0e03('0x9'));var jayson=require(_0x0e03('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x86e356,_0x191370,_0x21a506){return new BPromise(function(_0xc5193f,_0x1badff){return client[_0x0e03('0xb')](_0x86e356,_0x21a506)[_0x0e03('0xc')](function(_0xea5c){logger['info']('ZendeskField,\x20%s,\x20%s',_0x191370,_0x0e03('0xd'));logger[_0x0e03('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x191370,_0x0e03('0xd'),JSON[_0x0e03('0xf')](_0xea5c));if(_0xea5c[_0x0e03('0x10')]){if(_0xea5c[_0x0e03('0x10')][_0x0e03('0x11')]===0x1f4){logger[_0x0e03('0x10')](_0x0e03('0x12'),_0x191370,_0xea5c[_0x0e03('0x10')][_0x0e03('0x13')]);return _0x1badff(_0xea5c['error']['message']);}logger[_0x0e03('0x10')]('ZendeskField,\x20%s,\x20%s',_0x191370,_0xea5c[_0x0e03('0x10')]['message']);return _0xc5193f(_0xea5c[_0x0e03('0x10')][_0x0e03('0x13')]);}else{logger[_0x0e03('0x14')](_0x0e03('0x12'),_0x191370,_0x0e03('0xd'));_0xc5193f(_0xea5c[_0x0e03('0x15')]['message']);}})[_0x0e03('0x16')](function(_0x392c9b){logger['error'](_0x0e03('0x12'),_0x191370,_0x392c9b);_0x1badff(_0x392c9b);});});} \ No newline at end of file +var _0x5c41=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment'];(function(_0x674a4,_0x1cc0ec){var _0x2dd94f=function(_0x3d6694){while(--_0x3d6694){_0x674a4['push'](_0x674a4['shift']());}};_0x2dd94f(++_0x1cc0ec);}(_0x5c41,0xfa));var _0x15c4=function(_0x303d27,_0x34d5f8){_0x303d27=_0x303d27-0x0;var _0x3eae5d=_0x5c41[_0x303d27];return _0x3eae5d;};'use strict';var _=require(_0x15c4('0x0'));var util=require('util');var moment=require(_0x15c4('0x1'));var BPromise=require(_0x15c4('0x2'));var rs=require(_0x15c4('0x3'));var fs=require('fs');var Redis=require(_0x15c4('0x4'));var db=require(_0x15c4('0x5'))['db'];var utils=require(_0x15c4('0x6'));var logger=require(_0x15c4('0x7'))(_0x15c4('0x8'));var config=require(_0x15c4('0x9'));var jayson=require(_0x15c4('0xa'));var client=jayson['client'][_0x15c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53abc3,_0x235ee3,_0x43bfaf){return new BPromise(function(_0x5caba0,_0x171e39){return client[_0x15c4('0xc')](_0x53abc3,_0x43bfaf)['then'](function(_0x17421c){logger[_0x15c4('0xd')](_0x15c4('0xe'),_0x235ee3,'request\x20sent');logger[_0x15c4('0xf')](_0x15c4('0x10'),_0x235ee3,'request\x20sent',JSON['stringify'](_0x17421c));if(_0x17421c[_0x15c4('0x11')]){if(_0x17421c[_0x15c4('0x11')][_0x15c4('0x12')]===0x1f4){logger[_0x15c4('0x11')](_0x15c4('0xe'),_0x235ee3,_0x17421c[_0x15c4('0x11')][_0x15c4('0x13')]);return _0x171e39(_0x17421c[_0x15c4('0x11')]['message']);}logger[_0x15c4('0x11')](_0x15c4('0xe'),_0x235ee3,_0x17421c[_0x15c4('0x11')][_0x15c4('0x13')]);return _0x5caba0(_0x17421c['error']['message']);}else{logger['info'](_0x15c4('0xe'),_0x235ee3,'request\x20sent');_0x5caba0(_0x17421c['result']['message']);}})[_0x15c4('0x14')](function(_0x19ae4e){logger[_0x15c4('0x11')](_0x15c4('0xe'),_0x235ee3,_0x19ae4e);_0x171e39(_0x19ae4e);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 15bebc7..7816bc6 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 _0xa2ea=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','post','create','/:id/configurations','addConfiguration','put','delete','destroy','exports','util','path'];(function(_0x434903,_0x2bae84){var _0x31021e=function(_0x176a5f){while(--_0x176a5f){_0x434903['push'](_0x434903['shift']());}};_0x31021e(++_0x2bae84);}(_0xa2ea,0xbb));var _0xaa2e=function(_0x4f6259,_0x35094b){_0x4f6259=_0x4f6259-0x0;var _0x35f1bb=_0xa2ea[_0x4f6259];return _0x35f1bb;};'use strict';var multer=require('multer');var util=require(_0xaa2e('0x0'));var path=require(_0xaa2e('0x1'));var timeout=require('connect-timeout');var express=require(_0xaa2e('0x2'));var router=express[_0xaa2e('0x3')]();var fs_extra=require(_0xaa2e('0x4'));var auth=require(_0xaa2e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaa2e('0x6'));var controller=require('./intZohoAccount.controller');router[_0xaa2e('0x7')]('/',auth[_0xaa2e('0x8')](),controller[_0xaa2e('0x9')]);router[_0xaa2e('0x7')](_0xaa2e('0xa'),auth[_0xaa2e('0x8')](),controller[_0xaa2e('0xb')]);router[_0xaa2e('0x7')]('/:id/configurations',auth[_0xaa2e('0x8')](),controller[_0xaa2e('0xc')]);router['get']('/:id/fields',auth[_0xaa2e('0x8')](),controller['getFields']);router[_0xaa2e('0xd')]('/',auth['isAuthenticated'](),controller[_0xaa2e('0xe')]);router['post'](_0xaa2e('0xf'),auth[_0xaa2e('0x8')](),controller[_0xaa2e('0x10')]);router[_0xaa2e('0x11')](_0xaa2e('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xaa2e('0x12')](_0xaa2e('0xa'),auth[_0xaa2e('0x8')](),controller[_0xaa2e('0x13')]);module[_0xaa2e('0x14')]=router; \ No newline at end of file +var _0xaf8b=['Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','express'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0xaf8b,0x18c));var _0xbaf8=function(_0x30ef53,_0x1927f7){_0x30ef53=_0x30ef53-0x0;var _0x12fab2=_0xaf8b[_0x30ef53];return _0x12fab2;};'use strict';var multer=require(_0xbaf8('0x0'));var util=require(_0xbaf8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbaf8('0x2'));var router=express[_0xbaf8('0x3')]();var fs_extra=require(_0xbaf8('0x4'));var auth=require(_0xbaf8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0xbaf8('0x6')]('/',auth[_0xbaf8('0x7')](),controller[_0xbaf8('0x8')]);router[_0xbaf8('0x6')](_0xbaf8('0x9'),auth[_0xbaf8('0x7')](),controller[_0xbaf8('0xa')]);router[_0xbaf8('0x6')](_0xbaf8('0xb'),auth[_0xbaf8('0x7')](),controller[_0xbaf8('0xc')]);router[_0xbaf8('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0xbaf8('0xd')]);router[_0xbaf8('0xe')]('/',auth[_0xbaf8('0x7')](),controller['create']);router[_0xbaf8('0xe')](_0xbaf8('0xb'),auth[_0xbaf8('0x7')](),controller[_0xbaf8('0xf')]);router[_0xbaf8('0x10')](_0xbaf8('0x9'),auth[_0xbaf8('0x7')](),controller[_0xbaf8('0x11')]);router[_0xbaf8('0x12')](_0xbaf8('0x9'),auth['isAuthenticated'](),controller[_0xbaf8('0x13')]);module[_0xbaf8('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 3c00766..3e9821a 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 _0x3225=['STRING','sequelize','exports'];(function(_0x257e8f,_0xdc7fc9){var _0x2d8b1e=function(_0x24739a){while(--_0x24739a){_0x257e8f['push'](_0x257e8f['shift']());}};_0x2d8b1e(++_0xdc7fc9);}(_0x3225,0xc7));var _0x5322=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3225[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5322('0x0'));module[_0x5322('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5322('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x5322('0x2')]},'serverUrl':{'type':Sequelize[_0x5322('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x5322('0x2')]},'refreshToken':{'type':Sequelize[_0x5322('0x2')]}}; \ No newline at end of file +var _0x86de=['STRING'];(function(_0x27ccd3,_0x54b108){var _0x494076=function(_0x59e698){while(--_0x59e698){_0x27ccd3['push'](_0x27ccd3['shift']());}};_0x494076(++_0x54b108);}(_0x86de,0x68));var _0xe86d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x86de[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe86d('0x0')]},'host':{'type':Sequelize[_0xe86d('0x0')]},'zone':{'type':Sequelize[_0xe86d('0x0')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xe86d('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0xe86d('0x0')]},'refreshToken':{'type':Sequelize[_0xe86d('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 237ff89..9613d7b 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 _0x9aea=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','rows','params','find','catch','create','body','getConfigurations','ZohoConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','map','rawAttributes','fieldName','key','model','query'];(function(_0x436d88,_0x481b5c){var _0x4e2387=function(_0x56ae00){while(--_0x56ae00){_0x436d88['push'](_0x436d88['shift']());}};_0x4e2387(++_0x481b5c);}(_0x9aea,0xdd));var _0xa9ae=function(_0x44d0e3,_0x241bd8){_0x44d0e3=_0x44d0e3-0x0;var _0x4c362c=_0x9aea[_0x44d0e3];return _0x4c362c;};'use strict';var emlformat=require(_0xa9ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9ae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa9ae('0x2'));var moment=require(_0xa9ae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa9ae('0x4'));var util=require(_0xa9ae('0x5'));var path=require(_0xa9ae('0x6'));var sox=require(_0xa9ae('0x7'));var csv=require(_0xa9ae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9ae('0x9'));var _=require(_0xa9ae('0xa'));var squel=require(_0xa9ae('0xb'));var crypto=require('crypto');var jsforce=require(_0xa9ae('0xc'));var deskjs=require(_0xa9ae('0xd'));var toCsv=require(_0xa9ae('0x8'));var querystring=require(_0xa9ae('0xe'));var Papa=require(_0xa9ae('0xf'));var Redis=require(_0xa9ae('0x10'));var authService=require(_0xa9ae('0x11'));var qs=require(_0xa9ae('0x12'));var as=require(_0xa9ae('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9ae('0x14'))('api');var utils=require(_0xa9ae('0x15'));var config=require(_0xa9ae('0x16'));var licenseUtil=require(_0xa9ae('0x17'));var db=require(_0xa9ae('0x18'))['db'];var integrations=require(_0xa9ae('0x19'));var jayson=require(_0xa9ae('0x1a'));var client=jayson[_0xa9ae('0x1b')][_0xa9ae('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x56de45,_0x1859c3,_0x365e90,_0x10882e){return new BPromise(function(_0x3f7f61,_0x4d0bd9){var _0x28ce2d=_0x10882e||client;return _0x28ce2d[_0xa9ae('0x1d')](_0x56de45,_0x365e90)[_0xa9ae('0x1e')](function(_0x40b756){logger[_0xa9ae('0x1f')](_0xa9ae('0x20'),_0x1859c3,'request\x20sent');logger[_0xa9ae('0x21')](_0xa9ae('0x22'),_0x1859c3,_0xa9ae('0x23'),JSON['stringify'](_0x40b756));if(_0x40b756['error']){if(_0x40b756[_0xa9ae('0x24')]['code']===0x1f4){logger['error'](_0xa9ae('0x20'),_0x1859c3,_0x40b756[_0xa9ae('0x24')][_0xa9ae('0x25')]);return _0x4d0bd9(_0x40b756[_0xa9ae('0x24')]['message']);}logger[_0xa9ae('0x24')](_0xa9ae('0x20'),_0x1859c3,_0x40b756[_0xa9ae('0x24')][_0xa9ae('0x25')]);return _0x3f7f61(_0x40b756[_0xa9ae('0x24')][_0xa9ae('0x25')]);}else{logger[_0xa9ae('0x1f')]('ZohoAccount,\x20%s,\x20%s',_0x1859c3,_0xa9ae('0x23'));_0x3f7f61(_0x40b756['result']['message']);}})['catch'](function(_0x478bb7){logger[_0xa9ae('0x24')]('ZohoAccount,\x20%s,\x20%s',_0x1859c3,_0x478bb7);_0x4d0bd9(_0x478bb7);});});}function respondWithStatusCode(_0x13fb05,_0x5093ad){_0x5093ad=_0x5093ad||0xcc;return function(_0x2ff25c){if(_0x2ff25c){return _0x13fb05[_0xa9ae('0x26')](_0x5093ad);}return _0x13fb05[_0xa9ae('0x27')](_0x5093ad)[_0xa9ae('0x28')]();};}function respondWithResult(_0x12b061,_0x3f3f97){_0x3f3f97=_0x3f3f97||0xc8;return function(_0x23c1ec){if(_0x23c1ec){return _0x12b061['status'](_0x3f3f97)[_0xa9ae('0x29')](_0x23c1ec);}};}function respondWithFilteredResult(_0x3873aa,_0x2aac9e){return function(_0xfe9ef1){if(_0xfe9ef1){var _0x222db7=typeof _0x2aac9e[_0xa9ae('0x2a')]===_0xa9ae('0x2b')&&typeof _0x2aac9e['limit']==='undefined';var _0x2f1a9f=_0xfe9ef1[_0xa9ae('0x2c')];var _0x3d1131=_0x222db7?0x0:_0x2aac9e[_0xa9ae('0x2a')];var _0x74cd94=_0x222db7?_0xfe9ef1['count']:_0x2aac9e['offset']+_0x2aac9e[_0xa9ae('0x2d')];var _0x34616f;if(_0x74cd94>=_0x2f1a9f){_0x74cd94=_0x2f1a9f;_0x34616f=0xc8;}else{_0x34616f=0xce;}_0x3873aa[_0xa9ae('0x27')](_0x34616f);return _0x3873aa[_0xa9ae('0x2e')](_0xa9ae('0x2f'),_0x3d1131+'-'+_0x74cd94+'/'+_0x2f1a9f)[_0xa9ae('0x29')](_0xfe9ef1);}return null;};}function patchUpdates(_0x5d0c84){return function(_0x5415f1){try{jsonpatch[_0xa9ae('0x30')](_0x5415f1,_0x5d0c84,!![]);}catch(_0x268137){return BPromise[_0xa9ae('0x31')](_0x268137);}return _0x5415f1[_0xa9ae('0x32')]();};}function saveUpdates(_0x36c4d5,_0x231152){return function(_0x15f060){if(_0x15f060){return _0x15f060[_0xa9ae('0x33')](_0x36c4d5)['then'](function(_0x220858){return _0x220858;});}return null;};}function removeEntity(_0x4ea36a,_0x24cc1b){return function(_0x107ef8){if(_0x107ef8){return _0x107ef8[_0xa9ae('0x34')]()['then'](function(){_0x4ea36a[_0xa9ae('0x27')](0xcc)[_0xa9ae('0x28')]();});}};}function handleEntityNotFound(_0x383511,_0x22f737){return function(_0x353227){if(!_0x353227){_0x383511['sendStatus'](0x194);}return _0x353227;};}function handleError(_0xeb1639,_0xa0730a){_0xa0730a=_0xa0730a||0x1f4;return function(_0x44053a){logger['error'](_0x44053a['stack']);if(_0x44053a[_0xa9ae('0x35')]){delete _0x44053a[_0xa9ae('0x35')];}_0xeb1639[_0xa9ae('0x27')](_0xa0730a)[_0xa9ae('0x36')](_0x44053a);};}exports['index']=function(_0x356307,_0x2f5ba4){var _0x231192={},_0x9766c9={},_0x276842={'count':0x0,'rows':[]};var _0x4eafaf=_[_0xa9ae('0x37')](db['ZohoAccount'][_0xa9ae('0x38')],function(_0x38f360){return{'name':_0x38f360[_0xa9ae('0x39')],'type':_0x38f360['type'][_0xa9ae('0x3a')]};});_0x9766c9[_0xa9ae('0x3b')]=_[_0xa9ae('0x37')](_0x4eafaf,'name');_0x9766c9[_0xa9ae('0x3c')]=_[_0xa9ae('0x3d')](_0x356307['query']);_0x9766c9[_0xa9ae('0x3e')]=_['intersection'](_0x9766c9[_0xa9ae('0x3b')],_0x9766c9[_0xa9ae('0x3c')]);_0x231192['attributes']=_[_0xa9ae('0x3f')](_0x9766c9[_0xa9ae('0x3b')],qs[_0xa9ae('0x40')](_0x356307[_0xa9ae('0x3c')][_0xa9ae('0x40')]));_0x231192[_0xa9ae('0x41')]=_0x231192['attributes'][_0xa9ae('0x42')]?_0x231192[_0xa9ae('0x41')]:_0x9766c9['model'];if(!_0x356307['query'][_0xa9ae('0x43')](_0xa9ae('0x44'))){_0x231192[_0xa9ae('0x2d')]=qs[_0xa9ae('0x2d')](_0x356307['query'][_0xa9ae('0x2d')]);_0x231192[_0xa9ae('0x2a')]=qs[_0xa9ae('0x2a')](_0x356307[_0xa9ae('0x3c')][_0xa9ae('0x2a')]);}_0x231192[_0xa9ae('0x45')]=qs[_0xa9ae('0x46')](_0x356307['query'][_0xa9ae('0x46')]);_0x231192[_0xa9ae('0x47')]=qs['filters'](_[_0xa9ae('0x48')](_0x356307['query'],_0x9766c9[_0xa9ae('0x3e')]),_0x4eafaf);if(_0x356307[_0xa9ae('0x3c')][_0xa9ae('0x49')]){_0x231192[_0xa9ae('0x47')]=_[_0xa9ae('0x4a')](_0x231192[_0xa9ae('0x47')],{'$or':_[_0xa9ae('0x37')](_0x4eafaf,function(_0x4ce0ac){if(_0x4ce0ac[_0xa9ae('0x4b')]!==_0xa9ae('0x4c')){var _0x5cc0e3={};_0x5cc0e3[_0x4ce0ac[_0xa9ae('0x35')]]={'$like':'%'+_0x356307[_0xa9ae('0x3c')][_0xa9ae('0x49')]+'%'};return _0x5cc0e3;}})});}_0x231192=_[_0xa9ae('0x4a')]({},_0x231192,_0x356307[_0xa9ae('0x4d')]);var _0x76502d={'where':_0x231192['where']};return db[_0xa9ae('0x4e')]['count'](_0x76502d)[_0xa9ae('0x1e')](function(_0x44539a){_0x276842['count']=_0x44539a;if(_0x356307['query'][_0xa9ae('0x4f')]){_0x231192[_0xa9ae('0x50')]=[{'all':!![]}];}return db[_0xa9ae('0x4e')][_0xa9ae('0x51')](_0x231192);})[_0xa9ae('0x1e')](function(_0x27f19e){_0x276842[_0xa9ae('0x52')]=_0x27f19e;return _0x276842;})[_0xa9ae('0x1e')](respondWithFilteredResult(_0x2f5ba4,_0x231192))['catch'](handleError(_0x2f5ba4,null));};exports['show']=function(_0x10e02f,_0x3cf89c){var _0x4efe55={'raw':![],'where':{'id':_0x10e02f[_0xa9ae('0x53')]['id']}},_0x2aada4={};_0x2aada4[_0xa9ae('0x3b')]=_[_0xa9ae('0x3d')](db[_0xa9ae('0x4e')][_0xa9ae('0x38')]);_0x2aada4[_0xa9ae('0x3c')]=_[_0xa9ae('0x3d')](_0x10e02f['query']);_0x2aada4[_0xa9ae('0x3e')]=_[_0xa9ae('0x3f')](_0x2aada4['model'],_0x2aada4[_0xa9ae('0x3c')]);_0x4efe55['attributes']=_['intersection'](_0x2aada4['model'],qs[_0xa9ae('0x40')](_0x10e02f[_0xa9ae('0x3c')]['fields']));_0x4efe55['attributes']=_0x4efe55['attributes'][_0xa9ae('0x42')]?_0x4efe55['attributes']:_0x2aada4[_0xa9ae('0x3b')];if(_0x10e02f[_0xa9ae('0x3c')]['includeAll']){_0x4efe55[_0xa9ae('0x50')]=[{'all':!![]}];}_0x4efe55=_['merge']({},_0x4efe55,_0x10e02f[_0xa9ae('0x4d')]);return db[_0xa9ae('0x4e')][_0xa9ae('0x54')](_0x4efe55)[_0xa9ae('0x1e')](handleEntityNotFound(_0x3cf89c,null))[_0xa9ae('0x1e')](respondWithResult(_0x3cf89c,null))[_0xa9ae('0x55')](handleError(_0x3cf89c,null));};exports[_0xa9ae('0x56')]=function(_0x314a7c,_0x2fab05){return db[_0xa9ae('0x4e')][_0xa9ae('0x56')](_0x314a7c[_0xa9ae('0x57')],{})['then'](respondWithResult(_0x2fab05,0xc9))[_0xa9ae('0x55')](handleError(_0x2fab05,null));};exports[_0xa9ae('0x33')]=function(_0x24087a,_0x205c90){if(_0x24087a[_0xa9ae('0x57')]['id']){delete _0x24087a['body']['id'];}return db['ZohoAccount'][_0xa9ae('0x54')]({'where':{'id':_0x24087a[_0xa9ae('0x53')]['id']}})['then'](handleEntityNotFound(_0x205c90,null))['then'](saveUpdates(_0x24087a[_0xa9ae('0x57')],null))['then'](respondWithResult(_0x205c90,null))[_0xa9ae('0x55')](handleError(_0x205c90,null));};exports[_0xa9ae('0x34')]=function(_0x1a1605,_0x57c2e6){return db[_0xa9ae('0x4e')]['find']({'where':{'id':_0x1a1605[_0xa9ae('0x53')]['id']}})['then'](handleEntityNotFound(_0x57c2e6,null))[_0xa9ae('0x1e')](removeEntity(_0x57c2e6,null))[_0xa9ae('0x55')](handleError(_0x57c2e6,null));};exports[_0xa9ae('0x58')]=function(_0x3d4988,_0x158afa,_0x44c3cc){var _0x57971e={};var _0x3f54fa={};var _0x466f03;var _0x19f58d;return db[_0xa9ae('0x4e')]['findOne']({'where':{'id':_0x3d4988[_0xa9ae('0x53')]['id']}})[_0xa9ae('0x1e')](handleEntityNotFound(_0x158afa,null))[_0xa9ae('0x1e')](function(_0x1219fa){if(_0x1219fa){_0x466f03=_0x1219fa;_0x3f54fa[_0xa9ae('0x3b')]=_[_0xa9ae('0x3d')](db[_0xa9ae('0x59')][_0xa9ae('0x38')]);_0x3f54fa[_0xa9ae('0x3c')]=_[_0xa9ae('0x3d')](_0x3d4988['query']);_0x3f54fa[_0xa9ae('0x3e')]=_[_0xa9ae('0x3f')](_0x3f54fa[_0xa9ae('0x3b')],_0x3f54fa[_0xa9ae('0x3c')]);_0x57971e['attributes']=_[_0xa9ae('0x3f')](_0x3f54fa[_0xa9ae('0x3b')],qs['fields'](_0x3d4988[_0xa9ae('0x3c')][_0xa9ae('0x40')]));_0x57971e[_0xa9ae('0x41')]=_0x57971e['attributes']['length']?_0x57971e[_0xa9ae('0x41')]:_0x3f54fa[_0xa9ae('0x3b')];_0x57971e['order']=qs['sort'](_0x3d4988[_0xa9ae('0x3c')][_0xa9ae('0x46')]);_0x57971e[_0xa9ae('0x47')]=qs['filters'](_[_0xa9ae('0x48')](_0x3d4988[_0xa9ae('0x3c')],_0x3f54fa[_0xa9ae('0x3e')]));if(_0x3d4988[_0xa9ae('0x3c')][_0xa9ae('0x49')]){_0x57971e[_0xa9ae('0x47')]=_[_0xa9ae('0x4a')](_0x57971e[_0xa9ae('0x47')],{'$or':_[_0xa9ae('0x37')](_0x57971e[_0xa9ae('0x41')],function(_0x53445e){var _0x4acac8={};_0x4acac8[_0x53445e]={'$like':'%'+_0x3d4988[_0xa9ae('0x3c')][_0xa9ae('0x49')]+'%'};return _0x4acac8;})});}_0x57971e=_[_0xa9ae('0x4a')]({},_0x57971e,_0x3d4988['options']);return _0x466f03[_0xa9ae('0x58')](_0x57971e);}})[_0xa9ae('0x1e')](function(_0x3f823c){if(_0x3f823c){_0x19f58d=_0x3f823c['length'];if(!_0x3d4988['query'][_0xa9ae('0x43')]('nolimit')){_0x57971e[_0xa9ae('0x2d')]=qs[_0xa9ae('0x2d')](_0x3d4988[_0xa9ae('0x3c')][_0xa9ae('0x2d')]);_0x57971e[_0xa9ae('0x2a')]=qs[_0xa9ae('0x2a')](_0x3d4988[_0xa9ae('0x3c')][_0xa9ae('0x2a')]);}return _0x466f03[_0xa9ae('0x58')](_0x57971e);}})[_0xa9ae('0x1e')](function(_0x4fc3fa){if(_0x4fc3fa){return _0x4fc3fa?{'count':_0x19f58d,'rows':_0x4fc3fa}:null;}})[_0xa9ae('0x1e')](respondWithResult(_0x158afa,null))['catch'](handleError(_0x158afa,null));};exports[_0xa9ae('0x5a')]=function(_0x3bca8f,_0x255ddb,_0xe80696){if(_0x3bca8f[_0xa9ae('0x57')]['id']){delete _0x3bca8f['body']['id'];}return db[_0xa9ae('0x4e')][_0xa9ae('0x5b')]({'where':{'id':_0x3bca8f[_0xa9ae('0x53')]['id']}})[_0xa9ae('0x1e')](handleEntityNotFound(_0x255ddb,null))[_0xa9ae('0x1e')](function(_0x5c02d3){if(_0x5c02d3){_0x3bca8f[_0xa9ae('0x57')][_0xa9ae('0x5c')]=_0x5c02d3['id'];_0x3bca8f[_0xa9ae('0x57')][_0xa9ae('0x5d')]=integrations[_0xa9ae('0x5e')](_0x3bca8f['body']['channel'],_0x3bca8f[_0xa9ae('0x57')][_0xa9ae('0x4b')]);_0x3bca8f[_0xa9ae('0x57')][_0xa9ae('0x5f')]=integrations[_0xa9ae('0x60')](_0x3bca8f['body']['channel'],_0x3bca8f[_0xa9ae('0x57')][_0xa9ae('0x4b')]);return db['ZohoConfiguration']['create'](_0x3bca8f[_0xa9ae('0x57')],{'include':[{'model':db[_0xa9ae('0x61')],'as':_0xa9ae('0x5d')},{'model':db[_0xa9ae('0x61')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x255ddb,null))[_0xa9ae('0x55')](handleError(_0x255ddb,null));};function getAccessToken(_0x5275c9){return new Promise(function(_0x54294c,_0x592ff4){var _0x4b3847;switch(_0x5275c9[_0xa9ae('0x62')]){case'US':_0x4b3847=_0xa9ae('0x63');break;case'AU':_0x4b3847=_0xa9ae('0x64');break;case'EU':_0x4b3847=_0xa9ae('0x65');break;case'IN':_0x4b3847='https://accounts.zoho.in';break;case'CN':_0x4b3847=_0xa9ae('0x66');break;default:_0x4b3847=_0xa9ae('0x65');break;}var _0x4903df={'method':_0xa9ae('0x67'),'uri':_0x4b3847+'/oauth/v2/token','qs':{'refresh_token':_0x5275c9[_0xa9ae('0x68')],'client_id':_0x5275c9[_0xa9ae('0x69')],'client_secret':_0x5275c9[_0xa9ae('0x6a')],'grant_type':_0xa9ae('0x6b')},'json':!![]};return rp(_0x4903df)[_0xa9ae('0x1e')](function(_0xb66631){if(_0xb66631['access_token']){_0x54294c(_0xb66631[_0xa9ae('0x6c')]);}else{_0x592ff4(_0xa9ae('0x6d'));}})[_0xa9ae('0x55')](function(_0x11c9a8){_0x592ff4(_0x11c9a8);});});}exports[_0xa9ae('0x6e')]=function(_0x36bc83,_0x193579,_0x998cd0){var _0x5c6ae6,_0x468777,_0x2143de,_0x3dc17a,_0x190a2e;return db[_0xa9ae('0x4e')][_0xa9ae('0x5b')]({'where':{'id':_0x36bc83[_0xa9ae('0x53')]['id']},'attributes':['id',_0xa9ae('0x6f'),_0xa9ae('0x62'),_0xa9ae('0x69'),_0xa9ae('0x6a'),_0xa9ae('0x70'),_0xa9ae('0x71'),_0xa9ae('0x68')]})[_0xa9ae('0x1e')](handleEntityNotFound(_0x193579,null))[_0xa9ae('0x1e')](function(_0x2c8e7a){_0x190a2e=_0x2c8e7a;_0x5c6ae6=_0x190a2e[_0xa9ae('0x6f')];_0x468777=_0x5c6ae6===_0xa9ae('0x72')?'eu':'com';_0x2143de=_0x190a2e[_0xa9ae('0x70')];var _0x45bb2f=_0x2143de[_0xa9ae('0x73')](-0x1);if(_0x45bb2f==='/'||_0x45bb2f==='\x5c'||_0x45bb2f===':'){_0x2143de=_0x2143de[_0xa9ae('0x74')](0x0,_0x2143de[_0xa9ae('0x75')](_0x45bb2f));}if(!_0x190a2e[_0xa9ae('0x68')]){throw new Error(_0xa9ae('0x76'));}return getAccessToken(_0x190a2e);})[_0xa9ae('0x1e')](function(_0x383397){if(_0x383397){return rp({'method':'GET','uri':util[_0xa9ae('0x77')](_0xa9ae('0x78'),_0x468777),'qs':{'module':_0xa9ae('0x79')},'headers':{'Authorization':_0xa9ae('0x7a')+_0x383397},'json':!![]});}})[_0xa9ae('0x1e')](function(_0x49595d){if(_0x49595d){if(_0x49595d['response']&&_0x49595d[_0xa9ae('0x7b')][_0xa9ae('0x24')]){throw new Error(_0x49595d['response'][_0xa9ae('0x24')][_0xa9ae('0x25')]);}var _0x2751f4=[];var _0x43ce6c=[];var _0x418ace=[_0xa9ae('0x7c'),'Subject',_0xa9ae('0x7d'),_0xa9ae('0x7e'),_0xa9ae('0x7f'),_0xa9ae('0x80'),_0xa9ae('0x81'),'Call_Type'];_0x43ce6c=_[_0xa9ae('0x82')](_0x49595d['fields'],function(_0x1bcf51){return _0x418ace['includes'](_0x1bcf51[_0xa9ae('0x83')]);});for(var _0x12cc91=0x0;_0x12cc91<_0x43ce6c['length'];_0x12cc91++){if(_0x43ce6c[_0x12cc91]['system_mandatory']===![]){_0x2751f4[_0xa9ae('0x84')]({'id':_0x43ce6c[_0x12cc91]['id'],'name':_0x43ce6c[_0x12cc91][_0xa9ae('0x85')],'custom':_0x43ce6c[_0x12cc91][_0xa9ae('0x86')],'options':_0x43ce6c[_0x12cc91][_0xa9ae('0x87')]===_0xa9ae('0x88')&&_0x43ce6c[_0x12cc91][_0xa9ae('0x89')][_0xa9ae('0x42')]>-0x1?_['map'](_0x43ce6c[_0x12cc91][_0xa9ae('0x89')],function(_0x49fd54){return{'name':_0x49fd54,'value':_0x49fd54};}):[]});}}return{'count':_0x2751f4[_0xa9ae('0x42')],'rows':_0x2751f4};}else{return{'count':0x0,'rows':[]};}})[_0xa9ae('0x1e')](respondWithResult(_0x193579,null))['catch'](function(_0x4968f8){var _0x43d82d=_0x36bc83[_0xa9ae('0x3c')][_0xa9ae('0x8a')]?0x1f4:_0x4968f8[_0xa9ae('0x8b')]||0x1f4;logger[_0xa9ae('0x24')](_0xa9ae('0x8c'),_0xa9ae('0x6e'),_0x43d82d,JSON['stringify'](_0x4968f8));delete _0x4968f8[_0xa9ae('0x35')];if(_0x43d82d===0x191){_0x43d82d=0x190;}_0x193579[_0xa9ae('0x27')](_0x43d82d)['send'](_0x36bc83[_0xa9ae('0x3c')][_0xa9ae('0x8a')]?{'message':'Wrong\x20credentials','statusCode':_0x4968f8[_0xa9ae('0x8b')]}:_0x4968f8);});}; \ No newline at end of file +var _0x6324=['https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','refreshToken','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','push','display_label','custom_field','picklist','pick_list_values','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','then','destroy','name','index','map','ZohoAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','update','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0x6324,0x142));var _0x4632=function(_0x2478b8,_0x40961b){_0x2478b8=_0x2478b8-0x0;var _0x102501=_0x6324[_0x2478b8];return _0x102501;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4632('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x4632('0x19')][_0x4632('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3ef228,_0x2dce9f,_0x51ee37,_0x3ba361){return new BPromise(function(_0x255882,_0x3b9901){var _0x37d798=_0x3ba361||client;return _0x37d798[_0x4632('0x1b')](_0x3ef228,_0x51ee37)['then'](function(_0x47b349){logger[_0x4632('0x1c')](_0x4632('0x1d'),_0x2dce9f,_0x4632('0x1e'));logger[_0x4632('0x1f')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2dce9f,_0x4632('0x1e'),JSON[_0x4632('0x20')](_0x47b349));if(_0x47b349[_0x4632('0x21')]){if(_0x47b349['error'][_0x4632('0x22')]===0x1f4){logger[_0x4632('0x21')]('ZohoAccount,\x20%s,\x20%s',_0x2dce9f,_0x47b349['error'][_0x4632('0x23')]);return _0x3b9901(_0x47b349[_0x4632('0x21')][_0x4632('0x23')]);}logger[_0x4632('0x21')](_0x4632('0x1d'),_0x2dce9f,_0x47b349[_0x4632('0x21')][_0x4632('0x23')]);return _0x255882(_0x47b349[_0x4632('0x21')][_0x4632('0x23')]);}else{logger[_0x4632('0x1c')](_0x4632('0x1d'),_0x2dce9f,_0x4632('0x1e'));_0x255882(_0x47b349[_0x4632('0x24')][_0x4632('0x23')]);}})[_0x4632('0x25')](function(_0x1a9695){logger[_0x4632('0x21')](_0x4632('0x1d'),_0x2dce9f,_0x1a9695);_0x3b9901(_0x1a9695);});});}function respondWithStatusCode(_0x380a9f,_0x1e1b86){_0x1e1b86=_0x1e1b86||0xcc;return function(_0x38cbbc){if(_0x38cbbc){return _0x380a9f[_0x4632('0x26')](_0x1e1b86);}return _0x380a9f[_0x4632('0x27')](_0x1e1b86)[_0x4632('0x28')]();};}function respondWithResult(_0xb074d,_0x1b8de0){_0x1b8de0=_0x1b8de0||0xc8;return function(_0x4af026){if(_0x4af026){return _0xb074d[_0x4632('0x27')](_0x1b8de0)[_0x4632('0x29')](_0x4af026);}};}function respondWithFilteredResult(_0x372679,_0x22d0f5){return function(_0x2a0b11){if(_0x2a0b11){var _0x438354=typeof _0x22d0f5['offset']==='undefined'&&typeof _0x22d0f5[_0x4632('0x2a')]===_0x4632('0x2b');var _0x2f6656=_0x2a0b11[_0x4632('0x2c')];var _0x34079f=_0x438354?0x0:_0x22d0f5[_0x4632('0x2d')];var _0x3570b2=_0x438354?_0x2a0b11['count']:_0x22d0f5[_0x4632('0x2d')]+_0x22d0f5[_0x4632('0x2a')];var _0x48f5fb;if(_0x3570b2>=_0x2f6656){_0x3570b2=_0x2f6656;_0x48f5fb=0xc8;}else{_0x48f5fb=0xce;}_0x372679[_0x4632('0x27')](_0x48f5fb);return _0x372679['set'](_0x4632('0x2e'),_0x34079f+'-'+_0x3570b2+'/'+_0x2f6656)['json'](_0x2a0b11);}return null;};}function patchUpdates(_0x4fda35){return function(_0x1973eb){try{jsonpatch[_0x4632('0x2f')](_0x1973eb,_0x4fda35,!![]);}catch(_0x3fe812){return BPromise['reject'](_0x3fe812);}return _0x1973eb['save']();};}function saveUpdates(_0x395f4e,_0x7671ab){return function(_0x596586){if(_0x596586){return _0x596586['update'](_0x395f4e)[_0x4632('0x30')](function(_0x666af9){return _0x666af9;});}return null;};}function removeEntity(_0x49621b,_0x101906){return function(_0x2a1093){if(_0x2a1093){return _0x2a1093[_0x4632('0x31')]()[_0x4632('0x30')](function(){_0x49621b[_0x4632('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f0382,_0x3cc984){return function(_0x5a577c){if(!_0x5a577c){_0x5f0382['sendStatus'](0x194);}return _0x5a577c;};}function handleError(_0x465831,_0x59de6f){_0x59de6f=_0x59de6f||0x1f4;return function(_0x49355c){logger[_0x4632('0x21')](_0x49355c['stack']);if(_0x49355c[_0x4632('0x32')]){delete _0x49355c[_0x4632('0x32')];}_0x465831[_0x4632('0x27')](_0x59de6f)['send'](_0x49355c);};}exports[_0x4632('0x33')]=function(_0xf37b63,_0x39305a){var _0xca07f5={},_0x37c4d0={},_0x5d20f9={'count':0x0,'rows':[]};var _0x486f6c=_[_0x4632('0x34')](db[_0x4632('0x35')][_0x4632('0x36')],function(_0x4f40af){return{'name':_0x4f40af['fieldName'],'type':_0x4f40af['type'][_0x4632('0x37')]};});_0x37c4d0[_0x4632('0x38')]=_['map'](_0x486f6c,_0x4632('0x32'));_0x37c4d0[_0x4632('0x39')]=_[_0x4632('0x3a')](_0xf37b63[_0x4632('0x39')]);_0x37c4d0[_0x4632('0x3b')]=_[_0x4632('0x3c')](_0x37c4d0[_0x4632('0x38')],_0x37c4d0[_0x4632('0x39')]);_0xca07f5[_0x4632('0x3d')]=_[_0x4632('0x3c')](_0x37c4d0[_0x4632('0x38')],qs[_0x4632('0x3e')](_0xf37b63['query'][_0x4632('0x3e')]));_0xca07f5[_0x4632('0x3d')]=_0xca07f5['attributes'][_0x4632('0x3f')]?_0xca07f5[_0x4632('0x3d')]:_0x37c4d0['model'];if(!_0xf37b63[_0x4632('0x39')]['hasOwnProperty'](_0x4632('0x40'))){_0xca07f5[_0x4632('0x2a')]=qs[_0x4632('0x2a')](_0xf37b63[_0x4632('0x39')]['limit']);_0xca07f5[_0x4632('0x2d')]=qs[_0x4632('0x2d')](_0xf37b63[_0x4632('0x39')][_0x4632('0x2d')]);}_0xca07f5['order']=qs['sort'](_0xf37b63[_0x4632('0x39')][_0x4632('0x41')]);_0xca07f5[_0x4632('0x42')]=qs['filters'](_[_0x4632('0x43')](_0xf37b63[_0x4632('0x39')],_0x37c4d0[_0x4632('0x3b')]),_0x486f6c);if(_0xf37b63[_0x4632('0x39')][_0x4632('0x44')]){_0xca07f5[_0x4632('0x42')]=_[_0x4632('0x45')](_0xca07f5['where'],{'$or':_[_0x4632('0x34')](_0x486f6c,function(_0xa0022c){if(_0xa0022c[_0x4632('0x46')]!==_0x4632('0x47')){var _0x165c00={};_0x165c00[_0xa0022c['name']]={'$like':'%'+_0xf37b63['query'][_0x4632('0x44')]+'%'};return _0x165c00;}})});}_0xca07f5=_[_0x4632('0x45')]({},_0xca07f5,_0xf37b63[_0x4632('0x48')]);var _0x2e5978={'where':_0xca07f5['where']};return db[_0x4632('0x35')][_0x4632('0x2c')](_0x2e5978)[_0x4632('0x30')](function(_0x20c8cc){_0x5d20f9[_0x4632('0x2c')]=_0x20c8cc;if(_0xf37b63['query'][_0x4632('0x49')]){_0xca07f5[_0x4632('0x4a')]=[{'all':!![]}];}return db[_0x4632('0x35')][_0x4632('0x4b')](_0xca07f5);})[_0x4632('0x30')](function(_0x2eb8b0){_0x5d20f9[_0x4632('0x4c')]=_0x2eb8b0;return _0x5d20f9;})[_0x4632('0x30')](respondWithFilteredResult(_0x39305a,_0xca07f5))[_0x4632('0x25')](handleError(_0x39305a,null));};exports[_0x4632('0x4d')]=function(_0x127db3,_0x517584){var _0xc3ffd0={'raw':![],'where':{'id':_0x127db3[_0x4632('0x4e')]['id']}},_0x1ccadb={};_0x1ccadb['model']=_[_0x4632('0x3a')](db[_0x4632('0x35')][_0x4632('0x36')]);_0x1ccadb[_0x4632('0x39')]=_[_0x4632('0x3a')](_0x127db3[_0x4632('0x39')]);_0x1ccadb[_0x4632('0x3b')]=_[_0x4632('0x3c')](_0x1ccadb[_0x4632('0x38')],_0x1ccadb[_0x4632('0x39')]);_0xc3ffd0['attributes']=_[_0x4632('0x3c')](_0x1ccadb[_0x4632('0x38')],qs['fields'](_0x127db3[_0x4632('0x39')][_0x4632('0x3e')]));_0xc3ffd0[_0x4632('0x3d')]=_0xc3ffd0[_0x4632('0x3d')][_0x4632('0x3f')]?_0xc3ffd0[_0x4632('0x3d')]:_0x1ccadb[_0x4632('0x38')];if(_0x127db3[_0x4632('0x39')][_0x4632('0x49')]){_0xc3ffd0[_0x4632('0x4a')]=[{'all':!![]}];}_0xc3ffd0=_[_0x4632('0x45')]({},_0xc3ffd0,_0x127db3[_0x4632('0x48')]);return db[_0x4632('0x35')][_0x4632('0x4f')](_0xc3ffd0)[_0x4632('0x30')](handleEntityNotFound(_0x517584,null))[_0x4632('0x30')](respondWithResult(_0x517584,null))[_0x4632('0x25')](handleError(_0x517584,null));};exports[_0x4632('0x50')]=function(_0xb1456b,_0x36c824){return db['ZohoAccount'][_0x4632('0x50')](_0xb1456b[_0x4632('0x51')],{})[_0x4632('0x30')](respondWithResult(_0x36c824,0xc9))[_0x4632('0x25')](handleError(_0x36c824,null));};exports[_0x4632('0x52')]=function(_0x33ad25,_0x5d2cbb){if(_0x33ad25[_0x4632('0x51')]['id']){delete _0x33ad25[_0x4632('0x51')]['id'];}return db[_0x4632('0x35')]['find']({'where':{'id':_0x33ad25[_0x4632('0x4e')]['id']}})[_0x4632('0x30')](handleEntityNotFound(_0x5d2cbb,null))['then'](saveUpdates(_0x33ad25[_0x4632('0x51')],null))[_0x4632('0x30')](respondWithResult(_0x5d2cbb,null))[_0x4632('0x25')](handleError(_0x5d2cbb,null));};exports['destroy']=function(_0x3aeefd,_0x334a8e){return db[_0x4632('0x35')][_0x4632('0x4f')]({'where':{'id':_0x3aeefd[_0x4632('0x4e')]['id']}})[_0x4632('0x30')](handleEntityNotFound(_0x334a8e,null))[_0x4632('0x30')](removeEntity(_0x334a8e,null))[_0x4632('0x25')](handleError(_0x334a8e,null));};exports[_0x4632('0x53')]=function(_0x3abcbf,_0x58d39a,_0x3eb7bc){var _0x7273dd={};var _0x556bec={};var _0x381a9e;var _0x503ccd;return db['ZohoAccount'][_0x4632('0x54')]({'where':{'id':_0x3abcbf[_0x4632('0x4e')]['id']}})[_0x4632('0x30')](handleEntityNotFound(_0x58d39a,null))[_0x4632('0x30')](function(_0x3a030b){if(_0x3a030b){_0x381a9e=_0x3a030b;_0x556bec[_0x4632('0x38')]=_[_0x4632('0x3a')](db[_0x4632('0x55')][_0x4632('0x36')]);_0x556bec[_0x4632('0x39')]=_[_0x4632('0x3a')](_0x3abcbf[_0x4632('0x39')]);_0x556bec[_0x4632('0x3b')]=_[_0x4632('0x3c')](_0x556bec['model'],_0x556bec['query']);_0x7273dd[_0x4632('0x3d')]=_[_0x4632('0x3c')](_0x556bec[_0x4632('0x38')],qs[_0x4632('0x3e')](_0x3abcbf[_0x4632('0x39')][_0x4632('0x3e')]));_0x7273dd['attributes']=_0x7273dd[_0x4632('0x3d')][_0x4632('0x3f')]?_0x7273dd[_0x4632('0x3d')]:_0x556bec[_0x4632('0x38')];_0x7273dd['order']=qs['sort'](_0x3abcbf[_0x4632('0x39')]['sort']);_0x7273dd[_0x4632('0x42')]=qs[_0x4632('0x3b')](_[_0x4632('0x43')](_0x3abcbf[_0x4632('0x39')],_0x556bec[_0x4632('0x3b')]));if(_0x3abcbf['query'][_0x4632('0x44')]){_0x7273dd[_0x4632('0x42')]=_['merge'](_0x7273dd['where'],{'$or':_[_0x4632('0x34')](_0x7273dd[_0x4632('0x3d')],function(_0x47391f){var _0x3090d6={};_0x3090d6[_0x47391f]={'$like':'%'+_0x3abcbf['query']['filter']+'%'};return _0x3090d6;})});}_0x7273dd=_['merge']({},_0x7273dd,_0x3abcbf[_0x4632('0x48')]);return _0x381a9e['getConfigurations'](_0x7273dd);}})[_0x4632('0x30')](function(_0x3595fa){if(_0x3595fa){_0x503ccd=_0x3595fa[_0x4632('0x3f')];if(!_0x3abcbf[_0x4632('0x39')][_0x4632('0x56')](_0x4632('0x40'))){_0x7273dd[_0x4632('0x2a')]=qs[_0x4632('0x2a')](_0x3abcbf[_0x4632('0x39')][_0x4632('0x2a')]);_0x7273dd[_0x4632('0x2d')]=qs[_0x4632('0x2d')](_0x3abcbf[_0x4632('0x39')][_0x4632('0x2d')]);}return _0x381a9e[_0x4632('0x53')](_0x7273dd);}})[_0x4632('0x30')](function(_0x550c4d){if(_0x550c4d){return _0x550c4d?{'count':_0x503ccd,'rows':_0x550c4d}:null;}})[_0x4632('0x30')](respondWithResult(_0x58d39a,null))[_0x4632('0x25')](handleError(_0x58d39a,null));};exports[_0x4632('0x57')]=function(_0x26a3f3,_0x1e0948,_0x273a0d){if(_0x26a3f3[_0x4632('0x51')]['id']){delete _0x26a3f3[_0x4632('0x51')]['id'];}return db[_0x4632('0x35')][_0x4632('0x54')]({'where':{'id':_0x26a3f3[_0x4632('0x4e')]['id']}})[_0x4632('0x30')](handleEntityNotFound(_0x1e0948,null))[_0x4632('0x30')](function(_0x4bba05){if(_0x4bba05){_0x26a3f3[_0x4632('0x51')][_0x4632('0x58')]=_0x4bba05['id'];_0x26a3f3[_0x4632('0x51')][_0x4632('0x59')]=integrations[_0x4632('0x5a')](_0x26a3f3[_0x4632('0x51')]['channel'],_0x26a3f3[_0x4632('0x51')][_0x4632('0x46')]);_0x26a3f3['body'][_0x4632('0x5b')]=integrations[_0x4632('0x5c')](_0x26a3f3[_0x4632('0x51')][_0x4632('0x5d')],_0x26a3f3[_0x4632('0x51')]['type']);return db[_0x4632('0x55')][_0x4632('0x50')](_0x26a3f3[_0x4632('0x51')],{'include':[{'model':db['ZohoField'],'as':_0x4632('0x59')},{'model':db[_0x4632('0x5e')],'as':_0x4632('0x5b')}]});}return null;})[_0x4632('0x30')](respondWithResult(_0x1e0948,null))[_0x4632('0x25')](handleError(_0x1e0948,null));};function getAccessToken(_0x3a3f3a){return new Promise(function(_0x35ca5d,_0x295b86){var _0x48fb81;switch(_0x3a3f3a[_0x4632('0x5f')]){case'US':_0x48fb81=_0x4632('0x60');break;case'AU':_0x48fb81=_0x4632('0x61');break;case'EU':_0x48fb81='https://accounts.zoho.eu';break;case'IN':_0x48fb81=_0x4632('0x62');break;case'CN':_0x48fb81=_0x4632('0x63');break;default:_0x48fb81='https://accounts.zoho.eu';break;}var _0x4a4ae2={'method':_0x4632('0x64'),'uri':_0x48fb81+_0x4632('0x65'),'qs':{'refresh_token':_0x3a3f3a['refreshToken'],'client_id':_0x3a3f3a[_0x4632('0x66')],'client_secret':_0x3a3f3a[_0x4632('0x67')],'grant_type':_0x4632('0x68')},'json':!![]};return rp(_0x4a4ae2)[_0x4632('0x30')](function(_0x40b7c5){if(_0x40b7c5[_0x4632('0x69')]){_0x35ca5d(_0x40b7c5[_0x4632('0x69')]);}else{_0x295b86(_0x4632('0x6a'));}})['catch'](function(_0x1604da){_0x295b86(_0x1604da);});});}exports[_0x4632('0x6b')]=function(_0x32d228,_0x16085e,_0x4fc23d){var _0x32da20,_0x22fae3,_0x45f42f,_0x194bec,_0x3cee1d;return db['ZohoAccount'][_0x4632('0x54')]({'where':{'id':_0x32d228[_0x4632('0x4e')]['id']},'attributes':['id',_0x4632('0x6c'),_0x4632('0x5f'),_0x4632('0x66'),_0x4632('0x67'),_0x4632('0x6d'),_0x4632('0x22'),'refreshToken']})[_0x4632('0x30')](handleEntityNotFound(_0x16085e,null))[_0x4632('0x30')](function(_0x44f95d){_0x3cee1d=_0x44f95d;_0x32da20=_0x3cee1d[_0x4632('0x6c')];_0x22fae3=_0x32da20===_0x4632('0x6e')?'eu':_0x4632('0x6f');_0x45f42f=_0x3cee1d['serverUrl'];var _0x26b3de=_0x45f42f[_0x4632('0x70')](-0x1);if(_0x26b3de==='/'||_0x26b3de==='\x5c'||_0x26b3de===':'){_0x45f42f=_0x45f42f[_0x4632('0x71')](0x0,_0x45f42f[_0x4632('0x72')](_0x26b3de));}if(!_0x3cee1d[_0x4632('0x73')]){throw new Error(_0x4632('0x74'));}return getAccessToken(_0x3cee1d);})[_0x4632('0x30')](function(_0x4db3d2){if(_0x4db3d2){return rp({'method':_0x4632('0x75'),'uri':util[_0x4632('0x76')](_0x4632('0x77'),_0x22fae3),'qs':{'module':_0x4632('0x78')},'headers':{'Authorization':_0x4632('0x79')+_0x4db3d2},'json':!![]});}})[_0x4632('0x30')](function(_0x447b84){if(_0x447b84){if(_0x447b84['response']&&_0x447b84[_0x4632('0x7a')]['error']){throw new Error(_0x447b84[_0x4632('0x7a')][_0x4632('0x21')][_0x4632('0x23')]);}var _0x1192ed=[];var _0x232962=[];var _0x13d927=[_0x4632('0x7b'),_0x4632('0x7c'),_0x4632('0x7d'),'WhoId',_0x4632('0x7e'),_0x4632('0x7f'),_0x4632('0x80'),'Call_Type'];_0x232962=_[_0x4632('0x81')](_0x447b84[_0x4632('0x3e')],function(_0x3cacec){return _0x13d927[_0x4632('0x82')](_0x3cacec[_0x4632('0x83')]);});for(var _0x314821=0x0;_0x314821<_0x232962['length'];_0x314821++){if(_0x232962[_0x314821]['system_mandatory']===![]){_0x1192ed[_0x4632('0x84')]({'id':_0x232962[_0x314821]['id'],'name':_0x232962[_0x314821][_0x4632('0x85')],'custom':_0x232962[_0x314821][_0x4632('0x86')],'options':_0x232962[_0x314821]['data_type']===_0x4632('0x87')&&_0x232962[_0x314821]['pick_list_values'][_0x4632('0x3f')]>-0x1?_['map'](_0x232962[_0x314821][_0x4632('0x88')],function(_0xede2e9){return{'name':_0xede2e9,'value':_0xede2e9};}):[]});}}return{'count':_0x1192ed['length'],'rows':_0x1192ed};}else{return{'count':0x0,'rows':[]};}})[_0x4632('0x30')](respondWithResult(_0x16085e,null))[_0x4632('0x25')](function(_0x312040){var _0x5d36c4=_0x32d228[_0x4632('0x39')][_0x4632('0x89')]?0x1f4:_0x312040[_0x4632('0x8a')]||0x1f4;logger[_0x4632('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0x4632('0x6b'),_0x5d36c4,JSON[_0x4632('0x20')](_0x312040));delete _0x312040[_0x4632('0x32')];if(_0x5d36c4===0x191){_0x5d36c4=0x190;}_0x16085e[_0x4632('0x27')](_0x5d36c4)['send'](_0x32d228['query'][_0x4632('0x89')]?{'message':_0x4632('0x8b'),'statusCode':_0x312040[_0x4632('0x8a')]}:_0x312040);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 3bcee22..adb9d9b 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 _0x0671=['https://accounts.zoho.in','https://accounts.zoho.eu','POST','authorization_code','clientId','application/x-www-form-urlencoded','parse','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host','substring','/oauth/v2/token','then','refreshToken','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','changed','serverUrl','clientSecret','code','slice','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0671,0x13b));var _0x1067=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x0671[_0x2405bc];return _0x5272d4;};'use strict';var _=require(_0x1067('0x0'));var util=require(_0x1067('0x1'));var logger=require(_0x1067('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1067('0x3'));var rp=require(_0x1067('0x4'));var fs=require('fs');var path=require(_0x1067('0x5'));var rimraf=require(_0x1067('0x6'));var config=require(_0x1067('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x1067('0x8'));module[_0x1067('0x9')]=function(_0x37b6b1,_0x56b865){return _0x37b6b1[_0x1067('0xa')](_0x1067('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x970813,_0x1d888f,_0x3b3f59){if(_0x970813[_0x1067('0xc')]('zone')||_0x970813['changed'](_0x1067('0xd'))||_0x970813[_0x1067('0xc')]('clientId')||_0x970813[_0x1067('0xc')](_0x1067('0xe'))||_0x970813[_0x1067('0xc')](_0x1067('0xf'))||_0x970813[_0x1067('0xc')]('host')){var _0x6c1e69,_0x23b6ac;_0x6c1e69=_0x970813[_0x1067('0xd')];var _0x373ca7=_0x6c1e69[_0x1067('0x10')](-0x1);if(_0x373ca7==='/'||_0x373ca7==='\x5c'||_0x373ca7===':'){_0x6c1e69=_0x6c1e69['substring'](0x0,_0x6c1e69[_0x1067('0x11')](_0x373ca7));}switch(_0x970813[_0x1067('0x12')]){case'US':_0x23b6ac=_0x1067('0x13');break;case'AU':_0x23b6ac=_0x1067('0x14');break;case'IN':_0x23b6ac=_0x1067('0x15');break;case'CN':_0x23b6ac='https://accounts.zoho.com.cn';break;default:_0x23b6ac=_0x1067('0x16');break;}var _0x49c37d={'method':_0x1067('0x17'),'uri':_0x23b6ac+'/oauth/v2/token','form':{'grant_type':_0x1067('0x18'),'client_id':_0x970813[_0x1067('0x19')],'client_secret':_0x970813['clientSecret'],'redirect_uri':_0x970813[_0x1067('0xd')],'code':_0x970813[_0x1067('0xf')]},'headers':{'Content-Type':_0x1067('0x1a')}};return rp(_0x49c37d)['then'](function(_0x4e179a){var _0x99ddfe=JSON[_0x1067('0x1b')](_0x4e179a);if(_0x99ddfe[_0x1067('0x1c')]){_0x970813['refreshToken']=_0x99ddfe[_0x1067('0x1c')];logger[_0x1067('0x1d')](util['format'](_0x1067('0x1e'),_0x970813[_0x1067('0x1f')],_0x970813['id']));}else{logger[_0x1067('0x20')](util[_0x1067('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x970813[_0x1067('0x1f')],_0x970813['id']),util[_0x1067('0x22')](_0x99ddfe,{'showHidden':![],'depth':null}));}return _0x3b3f59(null,_0x1d888f);})[_0x1067('0x23')](function(_0x489e10){logger['error'](util[_0x1067('0x21')](_0x1067('0x24'),_0x970813[_0x1067('0x1f')],_0x970813['id']),util[_0x1067('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x3b3f59(_0x489e10);});}else{return _0x3b3f59(null,_0x1d888f);}},'beforeUpdate':function(_0x11c9c4,_0x24d2e7,_0x3a0db7){if(_0x11c9c4[_0x1067('0xc')]('zone')||_0x11c9c4[_0x1067('0xc')]('serverUrl')||_0x11c9c4[_0x1067('0xc')](_0x1067('0x19'))||_0x11c9c4['changed'](_0x1067('0xe'))||_0x11c9c4[_0x1067('0xc')]('code')||_0x11c9c4[_0x1067('0xc')](_0x1067('0x25'))){var _0xecbe49,_0x593699;_0xecbe49=_0x11c9c4[_0x1067('0xd')];var _0x147ab1=_0xecbe49[_0x1067('0x10')](-0x1);if(_0x147ab1==='/'||_0x147ab1==='\x5c'||_0x147ab1===':'){_0xecbe49=_0xecbe49[_0x1067('0x26')](0x0,_0xecbe49[_0x1067('0x11')](_0x147ab1));}switch(_0x11c9c4[_0x1067('0x12')]){case'US':_0x593699=_0x1067('0x13');break;case'AU':_0x593699='https://accounts.zoho.com.au';break;case'IN':_0x593699='https://accounts.zoho.in';break;case'CN':_0x593699='https://accounts.zoho.com.cn';break;default:_0x593699=_0x1067('0x16');break;}var _0x7cc590={'method':_0x1067('0x17'),'uri':_0x593699+_0x1067('0x27'),'form':{'grant_type':_0x1067('0x18'),'client_id':_0x11c9c4[_0x1067('0x19')],'client_secret':_0x11c9c4[_0x1067('0xe')],'redirect_uri':_0x11c9c4[_0x1067('0xd')],'code':_0x11c9c4[_0x1067('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x7cc590)[_0x1067('0x28')](function(_0x41a8bb){var _0x4a562d=JSON[_0x1067('0x1b')](_0x41a8bb);if(_0x4a562d['refresh_token']){_0x11c9c4[_0x1067('0x29')]=_0x4a562d[_0x1067('0x1c')];logger[_0x1067('0x1d')](util['format'](_0x1067('0x1e'),_0x11c9c4[_0x1067('0x1f')],_0x11c9c4['id']));}else{logger['error'](util[_0x1067('0x21')](_0x1067('0x24'),_0x11c9c4[_0x1067('0x1f')],_0x11c9c4['id']),util[_0x1067('0x22')](_0x4a562d,{'showHidden':![],'depth':null}));}return _0x3a0db7(null,_0x24d2e7);})[_0x1067('0x23')](function(_0x37f729){logger[_0x1067('0x20')](util[_0x1067('0x21')](_0x1067('0x24'),_0x11c9c4[_0x1067('0x1f')],_0x11c9c4['id']),util[_0x1067('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x3a0db7(_0x37f729);});}else{return _0x3a0db7(null,_0x24d2e7);}}}});}; \ No newline at end of file +var _0x2818=['define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','then','parse','refreshToken','refresh_token','info','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','inspect','catch','error','https://accounts.zoho.com','https://accounts.zoho.com.cn','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports'];(function(_0x59b4d4,_0x368618){var _0x120c5d=function(_0x5f12f9){while(--_0x5f12f9){_0x59b4d4['push'](_0x59b4d4['shift']());}};_0x120c5d(++_0x368618);}(_0x2818,0x181));var _0x8281=function(_0x631b77,_0x4eaa3b){_0x631b77=_0x631b77-0x0;var _0x1ef794=_0x2818[_0x631b77];return _0x1ef794;};'use strict';var _=require(_0x8281('0x0'));var util=require(_0x8281('0x1'));var logger=require(_0x8281('0x2'))('api');var moment=require(_0x8281('0x3'));var BPromise=require(_0x8281('0x4'));var rp=require(_0x8281('0x5'));var fs=require('fs');var path=require(_0x8281('0x6'));var rimraf=require(_0x8281('0x7'));var config=require(_0x8281('0x8'));var attributes=require(_0x8281('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x8281('0xa')]=function(_0x1a5d20,_0xc1e24b){return _0x1a5d20[_0x8281('0xb')](_0x8281('0xc'),attributes,{'tableName':_0x8281('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2eaccc,_0x369496,_0x6a0735){if(_0x2eaccc[_0x8281('0xe')](_0x8281('0xf'))||_0x2eaccc['changed'](_0x8281('0x10'))||_0x2eaccc[_0x8281('0xe')](_0x8281('0x11'))||_0x2eaccc['changed'](_0x8281('0x12'))||_0x2eaccc['changed'](_0x8281('0x13'))||_0x2eaccc[_0x8281('0xe')](_0x8281('0x14'))){var _0xe6c35c,_0x446846;_0xe6c35c=_0x2eaccc[_0x8281('0x10')];var _0x581d9d=_0xe6c35c[_0x8281('0x15')](-0x1);if(_0x581d9d==='/'||_0x581d9d==='\x5c'||_0x581d9d===':'){_0xe6c35c=_0xe6c35c[_0x8281('0x16')](0x0,_0xe6c35c[_0x8281('0x17')](_0x581d9d));}switch(_0x2eaccc['zone']){case'US':_0x446846='https://accounts.zoho.com';break;case'AU':_0x446846=_0x8281('0x18');break;case'IN':_0x446846=_0x8281('0x19');break;case'CN':_0x446846='https://accounts.zoho.com.cn';break;default:_0x446846=_0x8281('0x1a');break;}var _0x262e17={'method':_0x8281('0x1b'),'uri':_0x446846+_0x8281('0x1c'),'form':{'grant_type':_0x8281('0x1d'),'client_id':_0x2eaccc[_0x8281('0x11')],'client_secret':_0x2eaccc[_0x8281('0x12')],'redirect_uri':_0x2eaccc[_0x8281('0x10')],'code':_0x2eaccc[_0x8281('0x13')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x262e17)[_0x8281('0x1e')](function(_0x398a04){var _0x1ae3a8=JSON[_0x8281('0x1f')](_0x398a04);if(_0x1ae3a8['refresh_token']){_0x2eaccc[_0x8281('0x20')]=_0x1ae3a8[_0x8281('0x21')];logger[_0x8281('0x22')](util[_0x8281('0x23')](_0x8281('0x24'),_0x2eaccc['name'],_0x2eaccc['id']));}else{logger['error'](util[_0x8281('0x23')](_0x8281('0x25'),_0x2eaccc[_0x8281('0x26')],_0x2eaccc['id']),util[_0x8281('0x27')](_0x1ae3a8,{'showHidden':![],'depth':null}));}return _0x6a0735(null,_0x369496);})[_0x8281('0x28')](function(_0x27795f){logger[_0x8281('0x29')](util[_0x8281('0x23')](_0x8281('0x25'),_0x2eaccc[_0x8281('0x26')],_0x2eaccc['id']),util[_0x8281('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x6a0735(_0x27795f);});}else{return _0x6a0735(null,_0x369496);}},'beforeUpdate':function(_0x401ec9,_0x3d62f0,_0x589f50){if(_0x401ec9[_0x8281('0xe')]('zone')||_0x401ec9['changed'](_0x8281('0x10'))||_0x401ec9[_0x8281('0xe')]('clientId')||_0x401ec9[_0x8281('0xe')]('clientSecret')||_0x401ec9[_0x8281('0xe')]('code')||_0x401ec9[_0x8281('0xe')](_0x8281('0x14'))){var _0x34d152,_0x185880;_0x34d152=_0x401ec9[_0x8281('0x10')];var _0x296b0b=_0x34d152[_0x8281('0x15')](-0x1);if(_0x296b0b==='/'||_0x296b0b==='\x5c'||_0x296b0b===':'){_0x34d152=_0x34d152['substring'](0x0,_0x34d152['lastIndexOf'](_0x296b0b));}switch(_0x401ec9[_0x8281('0xf')]){case'US':_0x185880=_0x8281('0x2a');break;case'AU':_0x185880=_0x8281('0x18');break;case'IN':_0x185880=_0x8281('0x19');break;case'CN':_0x185880=_0x8281('0x2b');break;default:_0x185880=_0x8281('0x1a');break;}var _0x4fdf7a={'method':'POST','uri':_0x185880+_0x8281('0x1c'),'form':{'grant_type':'authorization_code','client_id':_0x401ec9[_0x8281('0x11')],'client_secret':_0x401ec9[_0x8281('0x12')],'redirect_uri':_0x401ec9['serverUrl'],'code':_0x401ec9[_0x8281('0x13')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4fdf7a)[_0x8281('0x1e')](function(_0x10b820){var _0x31cc97=JSON[_0x8281('0x1f')](_0x10b820);if(_0x31cc97['refresh_token']){_0x401ec9[_0x8281('0x20')]=_0x31cc97[_0x8281('0x21')];logger['info'](util[_0x8281('0x23')](_0x8281('0x24'),_0x401ec9['name'],_0x401ec9['id']));}else{logger[_0x8281('0x29')](util['format'](_0x8281('0x25'),_0x401ec9[_0x8281('0x26')],_0x401ec9['id']),util[_0x8281('0x27')](_0x31cc97,{'showHidden':![],'depth':null}));}return _0x589f50(null,_0x3d62f0);})[_0x8281('0x28')](function(_0x480c58){logger[_0x8281('0x29')](util['format'](_0x8281('0x25'),_0x401ec9[_0x8281('0x26')],_0x401ec9['id']),util[_0x8281('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x589f50(_0x480c58);});}else{return _0x589f50(null,_0x3d62f0);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 3814490..85d02b3 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 _0x9ba8=['client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetZohoAccount','ZohoAccount','options','attributes','include','map','model','ShowZohoAccount','find','raw','where','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x16311c,_0x550fd7){var _0x33951d=function(_0x453500){while(--_0x453500){_0x16311c['push'](_0x16311c['shift']());}};_0x33951d(++_0x550fd7);}(_0x9ba8,0x78));var _0x89ba=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x9ba8[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x89ba('0x0'));var util=require(_0x89ba('0x1'));var moment=require('moment');var BPromise=require(_0x89ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89ba('0x3'));var db=require(_0x89ba('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x89ba('0x5'))(_0x89ba('0x6'));var config=require('../../config/environment');var jayson=require(_0x89ba('0x7'));var client=jayson[_0x89ba('0x8')][_0x89ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2466b8,_0x467222,_0x242a07){return new BPromise(function(_0x5f0b4c,_0x23464d){return client['request'](_0x2466b8,_0x242a07)[_0x89ba('0xa')](function(_0x1872b5){logger[_0x89ba('0xb')](_0x89ba('0xc'),_0x467222,_0x89ba('0xd'));logger[_0x89ba('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x467222,_0x89ba('0xd'),JSON['stringify'](_0x1872b5));if(_0x1872b5[_0x89ba('0xf')]){if(_0x1872b5[_0x89ba('0xf')][_0x89ba('0x10')]===0x1f4){logger[_0x89ba('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x467222,_0x1872b5[_0x89ba('0xf')][_0x89ba('0x11')]);return _0x23464d(_0x1872b5[_0x89ba('0xf')][_0x89ba('0x11')]);}logger[_0x89ba('0xf')](_0x89ba('0xc'),_0x467222,_0x1872b5[_0x89ba('0xf')][_0x89ba('0x11')]);return _0x5f0b4c(_0x1872b5[_0x89ba('0xf')][_0x89ba('0x11')]);}else{logger[_0x89ba('0xb')](_0x89ba('0xc'),_0x467222,_0x89ba('0xd'));_0x5f0b4c(_0x1872b5[_0x89ba('0x12')][_0x89ba('0x11')]);}})[_0x89ba('0x13')](function(_0x4af2ec){logger[_0x89ba('0xf')](_0x89ba('0xc'),_0x467222,_0x4af2ec);_0x23464d(_0x4af2ec);});});}exports[_0x89ba('0x14')]=function(_0x12984c){var _0x45a225=this;return new Promise(function(_0x3c510c,_0x1db985){return db[_0x89ba('0x15')]['findAll']({'raw':_0x12984c[_0x89ba('0x16')]?_0x12984c[_0x89ba('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x12984c[_0x89ba('0x16')]?_0x12984c[_0x89ba('0x16')]['where']||null:null,'attributes':_0x12984c[_0x89ba('0x16')]?_0x12984c[_0x89ba('0x16')][_0x89ba('0x17')]||null:null,'limit':_0x12984c['options']?_0x12984c['options']['limit']||null:null,'include':_0x12984c[_0x89ba('0x16')]?_0x12984c[_0x89ba('0x16')][_0x89ba('0x18')]?_[_0x89ba('0x19')](_0x12984c[_0x89ba('0x16')]['include'],function(_0x365944){return{'model':db[_0x365944[_0x89ba('0x1a')]],'as':_0x365944['as'],'attributes':_0x365944[_0x89ba('0x17')],'include':_0x365944['include']?_[_0x89ba('0x19')](_0x365944['include'],function(_0x469ece){return{'model':db[_0x469ece[_0x89ba('0x1a')]],'as':_0x469ece['as'],'attributes':_0x469ece[_0x89ba('0x17')],'include':_0x469ece[_0x89ba('0x18')]?_[_0x89ba('0x19')](_0x469ece[_0x89ba('0x18')],function(_0x188cdf){return{'model':db[_0x188cdf['model']],'as':_0x188cdf['as'],'attributes':_0x188cdf['attributes']};}):[]};}):[]};}):[]:[]})[_0x89ba('0xa')](function(_0x486c33){logger[_0x89ba('0xb')](_0x89ba('0x14'),_0x12984c);logger['debug'](_0x89ba('0x14'),_0x12984c,JSON['stringify'](_0x486c33));_0x3c510c(_0x486c33);})[_0x89ba('0x13')](function(_0x277184){logger[_0x89ba('0xf')](_0x89ba('0x14'),_0x277184['message'],_0x12984c);_0x1db985(_0x45a225[_0x89ba('0xf')](0x1f4,_0x277184[_0x89ba('0x11')]));});});};exports[_0x89ba('0x1b')]=function(_0x18b141){var _0x350740=this;return new Promise(function(_0x3fe50c,_0x333015){return db[_0x89ba('0x15')][_0x89ba('0x1c')]({'raw':_0x18b141[_0x89ba('0x16')]?_0x18b141['options'][_0x89ba('0x1d')]===undefined?!![]:![]:!![],'where':_0x18b141[_0x89ba('0x16')]?_0x18b141[_0x89ba('0x16')][_0x89ba('0x1e')]||null:null,'attributes':_0x18b141[_0x89ba('0x16')]?_0x18b141[_0x89ba('0x16')][_0x89ba('0x17')]||null:null,'include':_0x18b141[_0x89ba('0x16')]?_0x18b141['options'][_0x89ba('0x18')]?_[_0x89ba('0x19')](_0x18b141[_0x89ba('0x16')]['include'],function(_0x367a24){return{'model':db[_0x367a24[_0x89ba('0x1a')]],'as':_0x367a24['as'],'attributes':_0x367a24[_0x89ba('0x17')],'include':_0x367a24[_0x89ba('0x18')]?_[_0x89ba('0x19')](_0x367a24[_0x89ba('0x18')],function(_0x2fb014){return{'model':db[_0x2fb014['model']],'as':_0x2fb014['as'],'attributes':_0x2fb014['attributes'],'include':_0x2fb014[_0x89ba('0x18')]?_['map'](_0x2fb014[_0x89ba('0x18')],function(_0x4339eb){return{'model':db[_0x4339eb[_0x89ba('0x1a')]],'as':_0x4339eb['as'],'attributes':_0x4339eb[_0x89ba('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf74609){logger[_0x89ba('0xb')](_0x89ba('0x1b'),_0x18b141);logger[_0x89ba('0xe')](_0x89ba('0x1b'),_0x18b141,JSON[_0x89ba('0x1f')](_0xf74609));_0x3fe50c(_0xf74609);})['catch'](function(_0x28cba7){logger['error'](_0x89ba('0x1b'),_0x28cba7[_0x89ba('0x11')],_0x18b141);_0x333015(_0x350740[_0x89ba('0xf')](0x1f4,_0x28cba7[_0x89ba('0x11')]));});});}; \ No newline at end of file +var _0x780c=['ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','then','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetZohoAccount'];(function(_0x151813,_0x4bf7fc){var _0x37183f=function(_0x406b80){while(--_0x406b80){_0x151813['push'](_0x151813['shift']());}};_0x37183f(++_0x4bf7fc);}(_0x780c,0xd3));var _0xc780=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x780c[_0x12a554];return _0x244ba0;};'use strict';var _=require(_0xc780('0x0'));var util=require('util');var moment=require(_0xc780('0x1'));var BPromise=require(_0xc780('0x2'));var rs=require(_0xc780('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc780('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc780('0x5'))('rpc');var config=require(_0xc780('0x6'));var jayson=require(_0xc780('0x7'));var client=jayson['client'][_0xc780('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x199d5a,_0x1fb792,_0x11ce65){return new BPromise(function(_0x51d177,_0x14f3c6){return client[_0xc780('0x9')](_0x199d5a,_0x11ce65)['then'](function(_0x5209a8){logger[_0xc780('0xa')](_0xc780('0xb'),_0x1fb792,_0xc780('0xc'));logger[_0xc780('0xd')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x1fb792,_0xc780('0xc'),JSON['stringify'](_0x5209a8));if(_0x5209a8[_0xc780('0xe')]){if(_0x5209a8['error'][_0xc780('0xf')]===0x1f4){logger[_0xc780('0xe')](_0xc780('0xb'),_0x1fb792,_0x5209a8[_0xc780('0xe')]['message']);return _0x14f3c6(_0x5209a8[_0xc780('0xe')][_0xc780('0x10')]);}logger[_0xc780('0xe')](_0xc780('0xb'),_0x1fb792,_0x5209a8['error'][_0xc780('0x10')]);return _0x51d177(_0x5209a8['error'][_0xc780('0x10')]);}else{logger['info'](_0xc780('0xb'),_0x1fb792,_0xc780('0xc'));_0x51d177(_0x5209a8[_0xc780('0x11')][_0xc780('0x10')]);}})[_0xc780('0x12')](function(_0x1f58d5){logger['error'](_0xc780('0xb'),_0x1fb792,_0x1f58d5);_0x14f3c6(_0x1f58d5);});});}exports[_0xc780('0x13')]=function(_0x39a3d4){var _0x224660=this;return new Promise(function(_0x2f3374,_0x21ce79){return db[_0xc780('0x14')][_0xc780('0x15')]({'raw':_0x39a3d4['options']?_0x39a3d4[_0xc780('0x16')][_0xc780('0x17')]===undefined?!![]:![]:!![],'where':_0x39a3d4[_0xc780('0x16')]?_0x39a3d4[_0xc780('0x16')][_0xc780('0x18')]||null:null,'attributes':_0x39a3d4[_0xc780('0x16')]?_0x39a3d4[_0xc780('0x16')][_0xc780('0x19')]||null:null,'limit':_0x39a3d4['options']?_0x39a3d4[_0xc780('0x16')][_0xc780('0x1a')]||null:null,'include':_0x39a3d4[_0xc780('0x16')]?_0x39a3d4['options'][_0xc780('0x1b')]?_[_0xc780('0x1c')](_0x39a3d4['options'][_0xc780('0x1b')],function(_0x51d009){return{'model':db[_0x51d009[_0xc780('0x1d')]],'as':_0x51d009['as'],'attributes':_0x51d009[_0xc780('0x19')],'include':_0x51d009[_0xc780('0x1b')]?_[_0xc780('0x1c')](_0x51d009[_0xc780('0x1b')],function(_0x5bcbe8){return{'model':db[_0x5bcbe8['model']],'as':_0x5bcbe8['as'],'attributes':_0x5bcbe8[_0xc780('0x19')],'include':_0x5bcbe8['include']?_[_0xc780('0x1c')](_0x5bcbe8[_0xc780('0x1b')],function(_0x125652){return{'model':db[_0x125652[_0xc780('0x1d')]],'as':_0x125652['as'],'attributes':_0x125652[_0xc780('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x478418){logger[_0xc780('0xa')](_0xc780('0x13'),_0x39a3d4);logger[_0xc780('0xd')]('GetZohoAccount',_0x39a3d4,JSON['stringify'](_0x478418));_0x2f3374(_0x478418);})[_0xc780('0x12')](function(_0x132683){logger[_0xc780('0xe')](_0xc780('0x13'),_0x132683[_0xc780('0x10')],_0x39a3d4);_0x21ce79(_0x224660[_0xc780('0xe')](0x1f4,_0x132683['message']));});});};exports[_0xc780('0x1e')]=function(_0x523412){var _0x1d6f83=this;return new Promise(function(_0x235ae7,_0x14d79d){return db[_0xc780('0x14')]['find']({'raw':_0x523412[_0xc780('0x16')]?_0x523412[_0xc780('0x16')][_0xc780('0x17')]===undefined?!![]:![]:!![],'where':_0x523412[_0xc780('0x16')]?_0x523412[_0xc780('0x16')][_0xc780('0x18')]||null:null,'attributes':_0x523412[_0xc780('0x16')]?_0x523412[_0xc780('0x16')][_0xc780('0x19')]||null:null,'include':_0x523412[_0xc780('0x16')]?_0x523412[_0xc780('0x16')][_0xc780('0x1b')]?_[_0xc780('0x1c')](_0x523412['options'][_0xc780('0x1b')],function(_0x4f423a){return{'model':db[_0x4f423a['model']],'as':_0x4f423a['as'],'attributes':_0x4f423a['attributes'],'include':_0x4f423a[_0xc780('0x1b')]?_[_0xc780('0x1c')](_0x4f423a[_0xc780('0x1b')],function(_0x429707){return{'model':db[_0x429707[_0xc780('0x1d')]],'as':_0x429707['as'],'attributes':_0x429707['attributes'],'include':_0x429707[_0xc780('0x1b')]?_['map'](_0x429707[_0xc780('0x1b')],function(_0x496d77){return{'model':db[_0x496d77[_0xc780('0x1d')]],'as':_0x496d77['as'],'attributes':_0x496d77[_0xc780('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc780('0x1f')](function(_0x1da072){logger['info'](_0xc780('0x1e'),_0x523412);logger[_0xc780('0xd')](_0xc780('0x1e'),_0x523412,JSON[_0xc780('0x20')](_0x1da072));_0x235ae7(_0x1da072);})['catch'](function(_0x4f6948){logger[_0xc780('0xe')]('ShowZohoAccount',_0x4f6948['message'],_0x523412);_0x14d79d(_0x1d6f83[_0xc780('0xe')](0x1f4,_0x4f6948['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 57789a0..0fc5a2c 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 _0x5d90=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','destroy','exports','util'];(function(_0x3a441a,_0x43eb56){var _0x3128a2=function(_0x5d5a17){while(--_0x5d5a17){_0x3a441a['push'](_0x3a441a['shift']());}};_0x3128a2(++_0x43eb56);}(_0x5d90,0xdb));var _0x05d9=function(_0x1802a6,_0x23bce6){_0x1802a6=_0x1802a6-0x0;var _0x238a1a=_0x5d90[_0x1802a6];return _0x238a1a;};'use strict';var multer=require('multer');var util=require(_0x05d9('0x0'));var path=require(_0x05d9('0x1'));var timeout=require(_0x05d9('0x2'));var express=require('express');var router=express[_0x05d9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x05d9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x05d9('0x5'));var controller=require(_0x05d9('0x6'));router[_0x05d9('0x7')]('/',auth['isAuthenticated'](),controller[_0x05d9('0x8')]);router[_0x05d9('0x7')](_0x05d9('0x9'),auth[_0x05d9('0xa')](),controller[_0x05d9('0xb')]);router[_0x05d9('0x7')](_0x05d9('0xc'),auth[_0x05d9('0xa')](),controller[_0x05d9('0xd')]);router[_0x05d9('0x7')](_0x05d9('0xe'),auth[_0x05d9('0xa')](),controller[_0x05d9('0xf')]);router['get'](_0x05d9('0x10'),auth[_0x05d9('0xa')](),controller[_0x05d9('0x11')]);router[_0x05d9('0x12')]('/',auth[_0x05d9('0xa')](),controller['create']);router['put'](_0x05d9('0x9'),auth[_0x05d9('0xa')](),controller[_0x05d9('0x13')]);router['delete'](_0x05d9('0x9'),auth[_0x05d9('0xa')](),controller[_0x05d9('0x14')]);module[_0x05d9('0x15')]=router; \ No newline at end of file +var _0xc167=['./intZohoConfiguration.controller','isAuthenticated','get','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','create','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xc167,0x171));var _0x7c16=function(_0x1d02bf,_0x1940de){_0x1d02bf=_0x1d02bf-0x0;var _0x8def97=_0xc167[_0x1d02bf];return _0x8def97;};'use strict';var multer=require('multer');var util=require(_0x7c16('0x0'));var path=require(_0x7c16('0x1'));var timeout=require(_0x7c16('0x2'));var express=require(_0x7c16('0x3'));var router=express[_0x7c16('0x4')]();var fs_extra=require(_0x7c16('0x5'));var auth=require(_0x7c16('0x6'));var interaction=require(_0x7c16('0x7'));var config=require(_0x7c16('0x8'));var controller=require(_0x7c16('0x9'));router['get']('/',auth[_0x7c16('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7c16('0xb')](_0x7c16('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x7c16('0xb')]('/:id/subjects',auth[_0x7c16('0xa')](),controller[_0x7c16('0xd')]);router[_0x7c16('0xb')](_0x7c16('0xe'),auth['isAuthenticated'](),controller[_0x7c16('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7c16('0x10')]);router['put'](_0x7c16('0x11'),auth[_0x7c16('0xa')](),controller[_0x7c16('0x12')]);router[_0x7c16('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7c16('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index b830431..2132fa5 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 _0xa40e=['STRING','ENUM','contact','lead','contact_lead','sequelize','exports'];(function(_0x24f4cd,_0x1ce85a){var _0x40be68=function(_0x49d910){while(--_0x49d910){_0x24f4cd['push'](_0x24f4cd['shift']());}};_0x40be68(++_0x1ce85a);}(_0xa40e,0x1e8));var _0xea40=function(_0x5c224b,_0x382967){_0x5c224b=_0x5c224b-0x0;var _0x2f1868=_0xa40e[_0x5c224b];return _0x2f1868;};'use strict';var Sequelize=require(_0xea40('0x0'));module[_0xea40('0x1')]={'name':{'type':Sequelize[_0xea40('0x2')]},'moduleCreate':{'type':Sequelize[_0xea40('0x3')]('lead',_0xea40('0x4'),'nothing'),'defaultValue':_0xea40('0x5')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xea40('0x4'),'lead'),'defaultValue':_0xea40('0x6')},'description':{'type':Sequelize[_0xea40('0x2')]}}; \ No newline at end of file +var _0x2031=['contact_lead','sequelize','exports','STRING','ENUM','lead','contact','nothing'];(function(_0x52560d,_0x3a3b7a){var _0x13f3b7=function(_0x67f835){while(--_0x67f835){_0x52560d['push'](_0x52560d['shift']());}};_0x13f3b7(++_0x3a3b7a);}(_0x2031,0x1c9));var _0x1203=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2031[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x1203('0x0'));module[_0x1203('0x1')]={'name':{'type':Sequelize[_0x1203('0x2')]},'moduleCreate':{'type':Sequelize[_0x1203('0x3')](_0x1203('0x4'),_0x1203('0x5'),_0x1203('0x6')),'defaultValue':_0x1203('0x4')},'moduleSearch':{'type':Sequelize[_0x1203('0x3')](_0x1203('0x7'),'contact',_0x1203('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x1203('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 5128129..bde6c76 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 _0x55ca=['pick','type','VIRTUAL','filter','options','ZohoConfiguration','includeAll','include','findAll','rows','show','params','keys','intersection','merge','find','create','body','findOne','ZohoField','order','getFields','getSubjects','getDescriptions','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','end','sendStatus','stack','name','map','rawAttributes','fieldName','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0x55ca,0x126));var _0xa55c=function(_0x1ee5be,_0x5f46e3){_0x1ee5be=_0x1ee5be-0x0;var _0x177140=_0x55ca[_0x1ee5be];return _0x177140;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xa55c('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x576044,_0x5a3672,_0x59ea8d,_0x18ee85){return new BPromise(function(_0x3930e4,_0x462cd6){var _0x938bd6=_0x18ee85||client;return _0x938bd6[_0xa55c('0x19')](_0x576044,_0x59ea8d)[_0xa55c('0x1a')](function(_0x4e0b2f){logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,_0xa55c('0x1d'));logger[_0xa55c('0x1e')](_0xa55c('0x1f'),_0x5a3672,_0xa55c('0x1d'),JSON[_0xa55c('0x20')](_0x4e0b2f));if(_0x4e0b2f[_0xa55c('0x21')]){if(_0x4e0b2f[_0xa55c('0x21')]['code']===0x1f4){logger[_0xa55c('0x21')](_0xa55c('0x1c'),_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x462cd6(_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x3930e4(_0x4e0b2f[_0xa55c('0x21')]['message']);}else{logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,'request\x20sent');_0x3930e4(_0x4e0b2f[_0xa55c('0x23')][_0xa55c('0x22')]);}})[_0xa55c('0x24')](function(_0x1965f1){logger[_0xa55c('0x21')]('ZohoConfiguration,\x20%s,\x20%s',_0x5a3672,_0x1965f1);_0x462cd6(_0x1965f1);});});}function respondWithStatusCode(_0x1fc828,_0x504c24){_0x504c24=_0x504c24||0xcc;return function(_0x5ba836){if(_0x5ba836){return _0x1fc828['sendStatus'](_0x504c24);}return _0x1fc828[_0xa55c('0x25')](_0x504c24)['end']();};}function respondWithResult(_0x3ecbe7,_0x190757){_0x190757=_0x190757||0xc8;return function(_0x3f64de){if(_0x3f64de){return _0x3ecbe7[_0xa55c('0x25')](_0x190757)[_0xa55c('0x26')](_0x3f64de);}};}function respondWithFilteredResult(_0x170ba4,_0x1da633){return function(_0x11e7f7){if(_0x11e7f7){var _0x192df2=typeof _0x1da633[_0xa55c('0x27')]===_0xa55c('0x28')&&typeof _0x1da633['limit']===_0xa55c('0x28');var _0x28814f=_0x11e7f7[_0xa55c('0x29')];var _0x906caa=_0x192df2?0x0:_0x1da633['offset'];var _0x1377b0=_0x192df2?_0x11e7f7[_0xa55c('0x29')]:_0x1da633[_0xa55c('0x27')]+_0x1da633[_0xa55c('0x2a')];var _0x45ee8d;if(_0x1377b0>=_0x28814f){_0x1377b0=_0x28814f;_0x45ee8d=0xc8;}else{_0x45ee8d=0xce;}_0x170ba4[_0xa55c('0x25')](_0x45ee8d);return _0x170ba4['set'](_0xa55c('0x2b'),_0x906caa+'-'+_0x1377b0+'/'+_0x28814f)['json'](_0x11e7f7);}return null;};}function patchUpdates(_0x35c9c2){return function(_0x1d730b){try{jsonpatch[_0xa55c('0x2c')](_0x1d730b,_0x35c9c2,!![]);}catch(_0x223813){return BPromise['reject'](_0x223813);}return _0x1d730b[_0xa55c('0x2d')]();};}function saveUpdates(_0x2096ae,_0x331e58){return function(_0x20da31){if(_0x20da31){return _0x20da31[_0xa55c('0x2e')](_0x2096ae)[_0xa55c('0x1a')](function(_0x29748a){return _0x29748a;});}return null;};}function removeEntity(_0x24d44d,_0x2808e9){return function(_0xcbaf2e){if(_0xcbaf2e){return _0xcbaf2e[_0xa55c('0x2f')]()['then'](function(){_0x24d44d['status'](0xcc)[_0xa55c('0x30')]();});}};}function handleEntityNotFound(_0x19733e,_0x4932d0){return function(_0x30fadd){if(!_0x30fadd){_0x19733e[_0xa55c('0x31')](0x194);}return _0x30fadd;};}function handleError(_0x2e9623,_0x1839ac){_0x1839ac=_0x1839ac||0x1f4;return function(_0x30d4f8){logger[_0xa55c('0x21')](_0x30d4f8[_0xa55c('0x32')]);if(_0x30d4f8[_0xa55c('0x33')]){delete _0x30d4f8[_0xa55c('0x33')];}_0x2e9623['status'](_0x1839ac)['send'](_0x30d4f8);};}exports['index']=function(_0x3fd75f,_0x18e00e){var _0x2bb4f0={},_0x5802e4={},_0x768408={'count':0x0,'rows':[]};var _0x547930=_[_0xa55c('0x34')](db['ZohoConfiguration'][_0xa55c('0x35')],function(_0x39267c){return{'name':_0x39267c[_0xa55c('0x36')],'type':_0x39267c['type'][_0xa55c('0x37')]};});_0x5802e4[_0xa55c('0x38')]=_['map'](_0x547930,_0xa55c('0x33'));_0x5802e4[_0xa55c('0x39')]=_['keys'](_0x3fd75f['query']);_0x5802e4[_0xa55c('0x3a')]=_['intersection'](_0x5802e4[_0xa55c('0x38')],_0x5802e4[_0xa55c('0x39')]);_0x2bb4f0['attributes']=_['intersection'](_0x5802e4['model'],qs['fields'](_0x3fd75f[_0xa55c('0x39')][_0xa55c('0x3b')]));_0x2bb4f0[_0xa55c('0x3c')]=_0x2bb4f0[_0xa55c('0x3c')][_0xa55c('0x3d')]?_0x2bb4f0['attributes']:_0x5802e4[_0xa55c('0x38')];if(!_0x3fd75f[_0xa55c('0x39')][_0xa55c('0x3e')](_0xa55c('0x3f'))){_0x2bb4f0[_0xa55c('0x2a')]=qs[_0xa55c('0x2a')](_0x3fd75f['query'][_0xa55c('0x2a')]);_0x2bb4f0['offset']=qs['offset'](_0x3fd75f[_0xa55c('0x39')][_0xa55c('0x27')]);}_0x2bb4f0['order']=qs[_0xa55c('0x40')](_0x3fd75f['query']['sort']);_0x2bb4f0[_0xa55c('0x41')]=qs[_0xa55c('0x3a')](_[_0xa55c('0x42')](_0x3fd75f['query'],_0x5802e4[_0xa55c('0x3a')]),_0x547930);if(_0x3fd75f[_0xa55c('0x39')]['filter']){_0x2bb4f0[_0xa55c('0x41')]=_['merge'](_0x2bb4f0[_0xa55c('0x41')],{'$or':_[_0xa55c('0x34')](_0x547930,function(_0x5be43f){if(_0x5be43f[_0xa55c('0x43')]!==_0xa55c('0x44')){var _0x5d834d={};_0x5d834d[_0x5be43f[_0xa55c('0x33')]]={'$like':'%'+_0x3fd75f[_0xa55c('0x39')][_0xa55c('0x45')]+'%'};return _0x5d834d;}})});}_0x2bb4f0=_['merge']({},_0x2bb4f0,_0x3fd75f[_0xa55c('0x46')]);var _0x582901={'where':_0x2bb4f0[_0xa55c('0x41')]};return db[_0xa55c('0x47')][_0xa55c('0x29')](_0x582901)['then'](function(_0x41eab1){_0x768408[_0xa55c('0x29')]=_0x41eab1;if(_0x3fd75f['query'][_0xa55c('0x48')]){_0x2bb4f0[_0xa55c('0x49')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0xa55c('0x4a')](_0x2bb4f0);})[_0xa55c('0x1a')](function(_0x52f9a7){_0x768408[_0xa55c('0x4b')]=_0x52f9a7;return _0x768408;})[_0xa55c('0x1a')](respondWithFilteredResult(_0x18e00e,_0x2bb4f0))[_0xa55c('0x24')](handleError(_0x18e00e,null));};exports[_0xa55c('0x4c')]=function(_0x564cb3,_0x143989){var _0x58a7ea={'raw':![],'where':{'id':_0x564cb3[_0xa55c('0x4d')]['id']}},_0x2157d6={};_0x2157d6[_0xa55c('0x38')]=_['keys'](db[_0xa55c('0x47')][_0xa55c('0x35')]);_0x2157d6['query']=_[_0xa55c('0x4e')](_0x564cb3[_0xa55c('0x39')]);_0x2157d6[_0xa55c('0x3a')]=_[_0xa55c('0x4f')](_0x2157d6[_0xa55c('0x38')],_0x2157d6[_0xa55c('0x39')]);_0x58a7ea[_0xa55c('0x3c')]=_[_0xa55c('0x4f')](_0x2157d6[_0xa55c('0x38')],qs[_0xa55c('0x3b')](_0x564cb3['query'][_0xa55c('0x3b')]));_0x58a7ea[_0xa55c('0x3c')]=_0x58a7ea[_0xa55c('0x3c')]['length']?_0x58a7ea[_0xa55c('0x3c')]:_0x2157d6[_0xa55c('0x38')];if(_0x564cb3['query'][_0xa55c('0x48')]){_0x58a7ea['include']=[{'all':!![]}];}_0x58a7ea=_[_0xa55c('0x50')]({},_0x58a7ea,_0x564cb3[_0xa55c('0x46')]);return db[_0xa55c('0x47')][_0xa55c('0x51')](_0x58a7ea)[_0xa55c('0x1a')](handleEntityNotFound(_0x143989,null))['then'](respondWithResult(_0x143989,null))[_0xa55c('0x24')](handleError(_0x143989,null));};exports[_0xa55c('0x52')]=function(_0x4b85cc,_0x3929a6){return db[_0xa55c('0x47')][_0xa55c('0x52')](_0x4b85cc[_0xa55c('0x53')],{})['then'](respondWithResult(_0x3929a6,0xc9))['catch'](handleError(_0x3929a6,null));};exports[_0xa55c('0x2e')]=function(_0x250dea,_0x3ca5b8){if(_0x250dea[_0xa55c('0x53')]['id']){delete _0x250dea['body']['id'];}return db[_0xa55c('0x47')]['find']({'where':{'id':_0x250dea[_0xa55c('0x4d')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x3ca5b8,null))[_0xa55c('0x1a')](saveUpdates(_0x250dea[_0xa55c('0x53')],null))[_0xa55c('0x1a')](respondWithResult(_0x3ca5b8,null))['catch'](handleError(_0x3ca5b8,null));};exports[_0xa55c('0x2f')]=function(_0x54f776,_0x23f67f){return db[_0xa55c('0x47')][_0xa55c('0x51')]({'where':{'id':_0x54f776[_0xa55c('0x4d')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x23f67f,null))[_0xa55c('0x1a')](removeEntity(_0x23f67f,null))[_0xa55c('0x24')](handleError(_0x23f67f,null));};exports['getFields']=function(_0x450567,_0x449e00,_0x2f2d21){var _0x23a30e={};var _0x3fa00f={};var _0x5ba2b0;var _0xa72718;return db[_0xa55c('0x47')][_0xa55c('0x54')]({'where':{'id':_0x450567[_0xa55c('0x4d')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x449e00,null))['then'](function(_0xdd92c1){if(_0xdd92c1){_0x5ba2b0=_0xdd92c1;_0x3fa00f[_0xa55c('0x38')]=_[_0xa55c('0x4e')](db[_0xa55c('0x55')][_0xa55c('0x35')]);_0x3fa00f['query']=_[_0xa55c('0x4e')](_0x450567['query']);_0x3fa00f[_0xa55c('0x3a')]=_['intersection'](_0x3fa00f[_0xa55c('0x38')],_0x3fa00f['query']);_0x23a30e[_0xa55c('0x3c')]=_[_0xa55c('0x4f')](_0x3fa00f[_0xa55c('0x38')],qs[_0xa55c('0x3b')](_0x450567[_0xa55c('0x39')][_0xa55c('0x3b')]));_0x23a30e[_0xa55c('0x3c')]=_0x23a30e[_0xa55c('0x3c')][_0xa55c('0x3d')]?_0x23a30e[_0xa55c('0x3c')]:_0x3fa00f['model'];_0x23a30e[_0xa55c('0x56')]=qs[_0xa55c('0x40')](_0x450567['query'][_0xa55c('0x40')]);_0x23a30e[_0xa55c('0x41')]=qs[_0xa55c('0x3a')](_[_0xa55c('0x42')](_0x450567[_0xa55c('0x39')],_0x3fa00f[_0xa55c('0x3a')]));if(_0x450567[_0xa55c('0x39')][_0xa55c('0x45')]){_0x23a30e['where']=_[_0xa55c('0x50')](_0x23a30e[_0xa55c('0x41')],{'$or':_[_0xa55c('0x34')](_0x23a30e[_0xa55c('0x3c')],function(_0x1a52b9){var _0x1bcb40={};_0x1bcb40[_0x1a52b9]={'$like':'%'+_0x450567[_0xa55c('0x39')][_0xa55c('0x45')]+'%'};return _0x1bcb40;})});}_0x23a30e=_[_0xa55c('0x50')]({},_0x23a30e,_0x450567['options']);return _0x5ba2b0[_0xa55c('0x57')](_0x23a30e);}})[_0xa55c('0x1a')](function(_0x40c56a){if(_0x40c56a){_0xa72718=_0x40c56a[_0xa55c('0x3d')];if(!_0x450567[_0xa55c('0x39')][_0xa55c('0x3e')](_0xa55c('0x3f'))){_0x23a30e[_0xa55c('0x2a')]=qs[_0xa55c('0x2a')](_0x450567[_0xa55c('0x39')][_0xa55c('0x2a')]);_0x23a30e['offset']=qs[_0xa55c('0x27')](_0x450567['query'][_0xa55c('0x27')]);}return _0x5ba2b0[_0xa55c('0x57')](_0x23a30e);}})[_0xa55c('0x1a')](function(_0x4f2a7b){if(_0x4f2a7b){return _0x4f2a7b?{'count':_0xa72718,'rows':_0x4f2a7b}:null;}})['then'](respondWithResult(_0x449e00,null))[_0xa55c('0x24')](handleError(_0x449e00,null));};exports[_0xa55c('0x58')]=function(_0x23c84c,_0x42529f,_0x4c7ee1){var _0x149cb9={};var _0xd02251={};var _0x8ea1c6;var _0x3a9910;return db[_0xa55c('0x47')]['findOne']({'where':{'id':_0x23c84c['params']['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x42529f,null))[_0xa55c('0x1a')](function(_0x3f9d0a){if(_0x3f9d0a){_0x8ea1c6=_0x3f9d0a;_0xd02251[_0xa55c('0x38')]=_[_0xa55c('0x4e')](db['ZohoField'][_0xa55c('0x35')]);_0xd02251[_0xa55c('0x39')]=_['keys'](_0x23c84c[_0xa55c('0x39')]);_0xd02251[_0xa55c('0x3a')]=_[_0xa55c('0x4f')](_0xd02251['model'],_0xd02251[_0xa55c('0x39')]);_0x149cb9[_0xa55c('0x3c')]=_[_0xa55c('0x4f')](_0xd02251[_0xa55c('0x38')],qs[_0xa55c('0x3b')](_0x23c84c['query'][_0xa55c('0x3b')]));_0x149cb9[_0xa55c('0x3c')]=_0x149cb9['attributes']['length']?_0x149cb9[_0xa55c('0x3c')]:_0xd02251['model'];_0x149cb9[_0xa55c('0x56')]=qs[_0xa55c('0x40')](_0x23c84c[_0xa55c('0x39')][_0xa55c('0x40')]);_0x149cb9[_0xa55c('0x41')]=qs[_0xa55c('0x3a')](_[_0xa55c('0x42')](_0x23c84c[_0xa55c('0x39')],_0xd02251[_0xa55c('0x3a')]));if(_0x23c84c['query'][_0xa55c('0x45')]){_0x149cb9[_0xa55c('0x41')]=_[_0xa55c('0x50')](_0x149cb9[_0xa55c('0x41')],{'$or':_['map'](_0x149cb9[_0xa55c('0x3c')],function(_0x409346){var _0x1baa8b={};_0x1baa8b[_0x409346]={'$like':'%'+_0x23c84c[_0xa55c('0x39')]['filter']+'%'};return _0x1baa8b;})});}_0x149cb9=_['merge']({},_0x149cb9,_0x23c84c[_0xa55c('0x46')]);return _0x8ea1c6[_0xa55c('0x58')](_0x149cb9);}})[_0xa55c('0x1a')](function(_0x12347c){if(_0x12347c){_0x3a9910=_0x12347c['length'];if(!_0x23c84c['query'][_0xa55c('0x3e')](_0xa55c('0x3f'))){_0x149cb9[_0xa55c('0x2a')]=qs[_0xa55c('0x2a')](_0x23c84c[_0xa55c('0x39')][_0xa55c('0x2a')]);_0x149cb9[_0xa55c('0x27')]=qs['offset'](_0x23c84c[_0xa55c('0x39')]['offset']);}return _0x8ea1c6[_0xa55c('0x58')](_0x149cb9);}})['then'](function(_0x36ded7){if(_0x36ded7){return _0x36ded7?{'count':_0x3a9910,'rows':_0x36ded7}:null;}})[_0xa55c('0x1a')](respondWithResult(_0x42529f,null))[_0xa55c('0x24')](handleError(_0x42529f,null));};exports[_0xa55c('0x59')]=function(_0xe3444f,_0x402f02,_0x1ea5b6){var _0x2c71ca={};var _0x576a1b={};var _0x59414d;var _0x14cb74;return db[_0xa55c('0x47')][_0xa55c('0x54')]({'where':{'id':_0xe3444f[_0xa55c('0x4d')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x402f02,null))[_0xa55c('0x1a')](function(_0x47e8e2){if(_0x47e8e2){_0x59414d=_0x47e8e2;_0x576a1b[_0xa55c('0x38')]=_[_0xa55c('0x4e')](db[_0xa55c('0x55')][_0xa55c('0x35')]);_0x576a1b[_0xa55c('0x39')]=_[_0xa55c('0x4e')](_0xe3444f[_0xa55c('0x39')]);_0x576a1b[_0xa55c('0x3a')]=_['intersection'](_0x576a1b[_0xa55c('0x38')],_0x576a1b[_0xa55c('0x39')]);_0x2c71ca[_0xa55c('0x3c')]=_[_0xa55c('0x4f')](_0x576a1b[_0xa55c('0x38')],qs['fields'](_0xe3444f[_0xa55c('0x39')][_0xa55c('0x3b')]));_0x2c71ca['attributes']=_0x2c71ca['attributes'][_0xa55c('0x3d')]?_0x2c71ca[_0xa55c('0x3c')]:_0x576a1b['model'];_0x2c71ca['order']=qs['sort'](_0xe3444f['query'][_0xa55c('0x40')]);_0x2c71ca[_0xa55c('0x41')]=qs[_0xa55c('0x3a')](_[_0xa55c('0x42')](_0xe3444f[_0xa55c('0x39')],_0x576a1b[_0xa55c('0x3a')]));if(_0xe3444f['query'][_0xa55c('0x45')]){_0x2c71ca[_0xa55c('0x41')]=_[_0xa55c('0x50')](_0x2c71ca[_0xa55c('0x41')],{'$or':_['map'](_0x2c71ca[_0xa55c('0x3c')],function(_0x25e4e0){var _0x36824c={};_0x36824c[_0x25e4e0]={'$like':'%'+_0xe3444f['query'][_0xa55c('0x45')]+'%'};return _0x36824c;})});}_0x2c71ca=_['merge']({},_0x2c71ca,_0xe3444f['options']);return _0x59414d[_0xa55c('0x59')](_0x2c71ca);}})[_0xa55c('0x1a')](function(_0x1e298d){if(_0x1e298d){_0x14cb74=_0x1e298d[_0xa55c('0x3d')];if(!_0xe3444f[_0xa55c('0x39')][_0xa55c('0x3e')](_0xa55c('0x3f'))){_0x2c71ca['limit']=qs['limit'](_0xe3444f[_0xa55c('0x39')][_0xa55c('0x2a')]);_0x2c71ca[_0xa55c('0x27')]=qs[_0xa55c('0x27')](_0xe3444f[_0xa55c('0x39')][_0xa55c('0x27')]);}return _0x59414d[_0xa55c('0x59')](_0x2c71ca);}})[_0xa55c('0x1a')](function(_0xc79fb8){if(_0xc79fb8){return _0xc79fb8?{'count':_0x14cb74,'rows':_0xc79fb8}:null;}})[_0xa55c('0x1a')](respondWithResult(_0x402f02,null))['catch'](handleError(_0x402f02,null));}; \ No newline at end of file +var _0xb138=['path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','ZohoConfiguration','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','length','order','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','update','getFields','findOne','ZohoField','sort','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x4ea851,_0x410ac3){var _0x30937f=function(_0x388e91){while(--_0x388e91){_0x4ea851['push'](_0x4ea851['shift']());}};_0x30937f(++_0x410ac3);}(_0xb138,0x1dd));var _0x8b13=function(_0x4e9b13,_0x24f7dc){_0x4e9b13=_0x4e9b13-0x0;var _0x402563=_0xb138[_0x4e9b13];return _0x402563;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];var jayson=require(_0x8b13('0x1a'));var client=jayson[_0x8b13('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50e7a4,_0x3dcde6,_0x130a6f,_0x5f12b5){return new BPromise(function(_0x51a935,_0x479773){var _0x272cb0=_0x5f12b5||client;return _0x272cb0[_0x8b13('0x1c')](_0x50e7a4,_0x130a6f)[_0x8b13('0x1d')](function(_0x2c615a){logger[_0x8b13('0x1e')]('ZohoConfiguration,\x20%s,\x20%s',_0x3dcde6,_0x8b13('0x1f'));logger[_0x8b13('0x20')](_0x8b13('0x21'),_0x3dcde6,_0x8b13('0x1f'),JSON[_0x8b13('0x22')](_0x2c615a));if(_0x2c615a[_0x8b13('0x23')]){if(_0x2c615a[_0x8b13('0x23')][_0x8b13('0x24')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x3dcde6,_0x2c615a[_0x8b13('0x23')][_0x8b13('0x25')]);return _0x479773(_0x2c615a[_0x8b13('0x23')][_0x8b13('0x25')]);}logger[_0x8b13('0x23')](_0x8b13('0x26'),_0x3dcde6,_0x2c615a['error'][_0x8b13('0x25')]);return _0x51a935(_0x2c615a[_0x8b13('0x23')][_0x8b13('0x25')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3dcde6,_0x8b13('0x1f'));_0x51a935(_0x2c615a[_0x8b13('0x27')]['message']);}})[_0x8b13('0x28')](function(_0x2c3afb){logger[_0x8b13('0x23')](_0x8b13('0x26'),_0x3dcde6,_0x2c3afb);_0x479773(_0x2c3afb);});});}function respondWithStatusCode(_0xc05d5c,_0x583639){_0x583639=_0x583639||0xcc;return function(_0x339271){if(_0x339271){return _0xc05d5c[_0x8b13('0x29')](_0x583639);}return _0xc05d5c['status'](_0x583639)[_0x8b13('0x2a')]();};}function respondWithResult(_0x4fdd1c,_0x420772){_0x420772=_0x420772||0xc8;return function(_0x325d68){if(_0x325d68){return _0x4fdd1c['status'](_0x420772)[_0x8b13('0x2b')](_0x325d68);}};}function respondWithFilteredResult(_0x3223d8,_0x4f8e58){return function(_0x134c5e){if(_0x134c5e){var _0x14a739=typeof _0x4f8e58[_0x8b13('0x2c')]===_0x8b13('0x2d')&&typeof _0x4f8e58[_0x8b13('0x2e')]==='undefined';var _0x6023f5=_0x134c5e[_0x8b13('0x2f')];var _0x3475d8=_0x14a739?0x0:_0x4f8e58[_0x8b13('0x2c')];var _0x114b01=_0x14a739?_0x134c5e[_0x8b13('0x2f')]:_0x4f8e58['offset']+_0x4f8e58[_0x8b13('0x2e')];var _0xfec033;if(_0x114b01>=_0x6023f5){_0x114b01=_0x6023f5;_0xfec033=0xc8;}else{_0xfec033=0xce;}_0x3223d8[_0x8b13('0x30')](_0xfec033);return _0x3223d8[_0x8b13('0x31')](_0x8b13('0x32'),_0x3475d8+'-'+_0x114b01+'/'+_0x6023f5)[_0x8b13('0x2b')](_0x134c5e);}return null;};}function patchUpdates(_0x3304bd){return function(_0x44bce2){try{jsonpatch[_0x8b13('0x33')](_0x44bce2,_0x3304bd,!![]);}catch(_0x5751db){return BPromise[_0x8b13('0x34')](_0x5751db);}return _0x44bce2[_0x8b13('0x35')]();};}function saveUpdates(_0x288ff7,_0x2878a6){return function(_0x51a334){if(_0x51a334){return _0x51a334['update'](_0x288ff7)[_0x8b13('0x1d')](function(_0x5cedea){return _0x5cedea;});}return null;};}function removeEntity(_0x5663fa,_0x3b1dfa){return function(_0x535521){if(_0x535521){return _0x535521[_0x8b13('0x36')]()[_0x8b13('0x1d')](function(){_0x5663fa[_0x8b13('0x30')](0xcc)[_0x8b13('0x2a')]();});}};}function handleEntityNotFound(_0x11657e,_0x669416){return function(_0x1fcd82){if(!_0x1fcd82){_0x11657e[_0x8b13('0x29')](0x194);}return _0x1fcd82;};}function handleError(_0x269743,_0x1b313d){_0x1b313d=_0x1b313d||0x1f4;return function(_0x4d45bc){logger[_0x8b13('0x23')](_0x4d45bc[_0x8b13('0x37')]);if(_0x4d45bc[_0x8b13('0x38')]){delete _0x4d45bc[_0x8b13('0x38')];}_0x269743[_0x8b13('0x30')](_0x1b313d)[_0x8b13('0x39')](_0x4d45bc);};}exports[_0x8b13('0x3a')]=function(_0x241687,_0x5c67b1){var _0x219bdf={},_0x5089c6={},_0x3826a5={'count':0x0,'rows':[]};var _0x37732c=_[_0x8b13('0x3b')](db[_0x8b13('0x3c')][_0x8b13('0x3d')],function(_0x327eb1){return{'name':_0x327eb1['fieldName'],'type':_0x327eb1['type'][_0x8b13('0x3e')]};});_0x5089c6['model']=_[_0x8b13('0x3b')](_0x37732c,'name');_0x5089c6[_0x8b13('0x3f')]=_[_0x8b13('0x40')](_0x241687[_0x8b13('0x3f')]);_0x5089c6[_0x8b13('0x41')]=_[_0x8b13('0x42')](_0x5089c6['model'],_0x5089c6['query']);_0x219bdf[_0x8b13('0x43')]=_['intersection'](_0x5089c6[_0x8b13('0x44')],qs[_0x8b13('0x45')](_0x241687['query'][_0x8b13('0x45')]));_0x219bdf[_0x8b13('0x43')]=_0x219bdf[_0x8b13('0x43')][_0x8b13('0x46')]?_0x219bdf[_0x8b13('0x43')]:_0x5089c6[_0x8b13('0x44')];if(!_0x241687[_0x8b13('0x3f')]['hasOwnProperty']('nolimit')){_0x219bdf['limit']=qs[_0x8b13('0x2e')](_0x241687[_0x8b13('0x3f')][_0x8b13('0x2e')]);_0x219bdf[_0x8b13('0x2c')]=qs[_0x8b13('0x2c')](_0x241687[_0x8b13('0x3f')]['offset']);}_0x219bdf[_0x8b13('0x47')]=qs['sort'](_0x241687[_0x8b13('0x3f')]['sort']);_0x219bdf[_0x8b13('0x48')]=qs[_0x8b13('0x41')](_[_0x8b13('0x49')](_0x241687[_0x8b13('0x3f')],_0x5089c6[_0x8b13('0x41')]),_0x37732c);if(_0x241687[_0x8b13('0x3f')][_0x8b13('0x4a')]){_0x219bdf['where']=_['merge'](_0x219bdf['where'],{'$or':_[_0x8b13('0x3b')](_0x37732c,function(_0x30d58f){if(_0x30d58f[_0x8b13('0x4b')]!==_0x8b13('0x4c')){var _0x4a4018={};_0x4a4018[_0x30d58f['name']]={'$like':'%'+_0x241687[_0x8b13('0x3f')]['filter']+'%'};return _0x4a4018;}})});}_0x219bdf=_[_0x8b13('0x4d')]({},_0x219bdf,_0x241687[_0x8b13('0x4e')]);var _0x20c363={'where':_0x219bdf[_0x8b13('0x48')]};return db[_0x8b13('0x3c')]['count'](_0x20c363)[_0x8b13('0x1d')](function(_0x2044fc){_0x3826a5[_0x8b13('0x2f')]=_0x2044fc;if(_0x241687[_0x8b13('0x3f')][_0x8b13('0x4f')]){_0x219bdf[_0x8b13('0x50')]=[{'all':!![]}];}return db[_0x8b13('0x3c')][_0x8b13('0x51')](_0x219bdf);})[_0x8b13('0x1d')](function(_0x518298){_0x3826a5[_0x8b13('0x52')]=_0x518298;return _0x3826a5;})['then'](respondWithFilteredResult(_0x5c67b1,_0x219bdf))[_0x8b13('0x28')](handleError(_0x5c67b1,null));};exports[_0x8b13('0x53')]=function(_0x403651,_0x5d9ddb){var _0x148efb={'raw':![],'where':{'id':_0x403651[_0x8b13('0x54')]['id']}},_0x35f612={};_0x35f612[_0x8b13('0x44')]=_[_0x8b13('0x40')](db[_0x8b13('0x3c')][_0x8b13('0x3d')]);_0x35f612['query']=_[_0x8b13('0x40')](_0x403651['query']);_0x35f612[_0x8b13('0x41')]=_[_0x8b13('0x42')](_0x35f612[_0x8b13('0x44')],_0x35f612[_0x8b13('0x3f')]);_0x148efb[_0x8b13('0x43')]=_[_0x8b13('0x42')](_0x35f612[_0x8b13('0x44')],qs[_0x8b13('0x45')](_0x403651[_0x8b13('0x3f')][_0x8b13('0x45')]));_0x148efb[_0x8b13('0x43')]=_0x148efb[_0x8b13('0x43')][_0x8b13('0x46')]?_0x148efb[_0x8b13('0x43')]:_0x35f612[_0x8b13('0x44')];if(_0x403651[_0x8b13('0x3f')][_0x8b13('0x4f')]){_0x148efb['include']=[{'all':!![]}];}_0x148efb=_[_0x8b13('0x4d')]({},_0x148efb,_0x403651[_0x8b13('0x4e')]);return db['ZohoConfiguration'][_0x8b13('0x55')](_0x148efb)[_0x8b13('0x1d')](handleEntityNotFound(_0x5d9ddb,null))[_0x8b13('0x1d')](respondWithResult(_0x5d9ddb,null))[_0x8b13('0x28')](handleError(_0x5d9ddb,null));};exports[_0x8b13('0x56')]=function(_0x12549b,_0x934f){return db[_0x8b13('0x3c')][_0x8b13('0x56')](_0x12549b[_0x8b13('0x57')],{})[_0x8b13('0x1d')](respondWithResult(_0x934f,0xc9))[_0x8b13('0x28')](handleError(_0x934f,null));};exports[_0x8b13('0x58')]=function(_0x25ab1f,_0x22e7a6){if(_0x25ab1f['body']['id']){delete _0x25ab1f[_0x8b13('0x57')]['id'];}return db[_0x8b13('0x3c')]['find']({'where':{'id':_0x25ab1f[_0x8b13('0x54')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x22e7a6,null))[_0x8b13('0x1d')](saveUpdates(_0x25ab1f[_0x8b13('0x57')],null))[_0x8b13('0x1d')](respondWithResult(_0x22e7a6,null))['catch'](handleError(_0x22e7a6,null));};exports[_0x8b13('0x36')]=function(_0xcd5c10,_0x46850a){return db['ZohoConfiguration'][_0x8b13('0x55')]({'where':{'id':_0xcd5c10[_0x8b13('0x54')]['id']}})['then'](handleEntityNotFound(_0x46850a,null))[_0x8b13('0x1d')](removeEntity(_0x46850a,null))[_0x8b13('0x28')](handleError(_0x46850a,null));};exports[_0x8b13('0x59')]=function(_0xd29067,_0x49e5cd,_0x13c8bd){var _0x28d568={};var _0x52e705={};var _0x33a1ad;var _0x130704;return db[_0x8b13('0x3c')][_0x8b13('0x5a')]({'where':{'id':_0xd29067['params']['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x49e5cd,null))[_0x8b13('0x1d')](function(_0x25a3bd){if(_0x25a3bd){_0x33a1ad=_0x25a3bd;_0x52e705[_0x8b13('0x44')]=_[_0x8b13('0x40')](db[_0x8b13('0x5b')]['rawAttributes']);_0x52e705[_0x8b13('0x3f')]=_[_0x8b13('0x40')](_0xd29067[_0x8b13('0x3f')]);_0x52e705['filters']=_[_0x8b13('0x42')](_0x52e705[_0x8b13('0x44')],_0x52e705[_0x8b13('0x3f')]);_0x28d568[_0x8b13('0x43')]=_['intersection'](_0x52e705['model'],qs['fields'](_0xd29067['query']['fields']));_0x28d568[_0x8b13('0x43')]=_0x28d568[_0x8b13('0x43')]['length']?_0x28d568[_0x8b13('0x43')]:_0x52e705['model'];_0x28d568[_0x8b13('0x47')]=qs[_0x8b13('0x5c')](_0xd29067[_0x8b13('0x3f')][_0x8b13('0x5c')]);_0x28d568[_0x8b13('0x48')]=qs[_0x8b13('0x41')](_[_0x8b13('0x49')](_0xd29067['query'],_0x52e705[_0x8b13('0x41')]));if(_0xd29067['query'][_0x8b13('0x4a')]){_0x28d568[_0x8b13('0x48')]=_[_0x8b13('0x4d')](_0x28d568[_0x8b13('0x48')],{'$or':_[_0x8b13('0x3b')](_0x28d568[_0x8b13('0x43')],function(_0x10f1bf){var _0x550ff1={};_0x550ff1[_0x10f1bf]={'$like':'%'+_0xd29067[_0x8b13('0x3f')]['filter']+'%'};return _0x550ff1;})});}_0x28d568=_[_0x8b13('0x4d')]({},_0x28d568,_0xd29067[_0x8b13('0x4e')]);return _0x33a1ad[_0x8b13('0x59')](_0x28d568);}})[_0x8b13('0x1d')](function(_0x177a64){if(_0x177a64){_0x130704=_0x177a64['length'];if(!_0xd29067['query'][_0x8b13('0x5d')](_0x8b13('0x5e'))){_0x28d568['limit']=qs[_0x8b13('0x2e')](_0xd29067[_0x8b13('0x3f')][_0x8b13('0x2e')]);_0x28d568['offset']=qs[_0x8b13('0x2c')](_0xd29067[_0x8b13('0x3f')][_0x8b13('0x2c')]);}return _0x33a1ad[_0x8b13('0x59')](_0x28d568);}})['then'](function(_0x2a6c62){if(_0x2a6c62){return _0x2a6c62?{'count':_0x130704,'rows':_0x2a6c62}:null;}})[_0x8b13('0x1d')](respondWithResult(_0x49e5cd,null))['catch'](handleError(_0x49e5cd,null));};exports[_0x8b13('0x5f')]=function(_0x3bfd74,_0x69e237,_0x3734e7){var _0x45fe23={};var _0x1243f8={};var _0x4334c1;var _0x1bb954;return db[_0x8b13('0x3c')][_0x8b13('0x5a')]({'where':{'id':_0x3bfd74[_0x8b13('0x54')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x69e237,null))[_0x8b13('0x1d')](function(_0x1db235){if(_0x1db235){_0x4334c1=_0x1db235;_0x1243f8['model']=_[_0x8b13('0x40')](db['ZohoField'][_0x8b13('0x3d')]);_0x1243f8[_0x8b13('0x3f')]=_[_0x8b13('0x40')](_0x3bfd74[_0x8b13('0x3f')]);_0x1243f8['filters']=_['intersection'](_0x1243f8[_0x8b13('0x44')],_0x1243f8[_0x8b13('0x3f')]);_0x45fe23['attributes']=_[_0x8b13('0x42')](_0x1243f8[_0x8b13('0x44')],qs[_0x8b13('0x45')](_0x3bfd74[_0x8b13('0x3f')][_0x8b13('0x45')]));_0x45fe23[_0x8b13('0x43')]=_0x45fe23[_0x8b13('0x43')][_0x8b13('0x46')]?_0x45fe23[_0x8b13('0x43')]:_0x1243f8[_0x8b13('0x44')];_0x45fe23['order']=qs[_0x8b13('0x5c')](_0x3bfd74[_0x8b13('0x3f')]['sort']);_0x45fe23[_0x8b13('0x48')]=qs[_0x8b13('0x41')](_['pick'](_0x3bfd74[_0x8b13('0x3f')],_0x1243f8[_0x8b13('0x41')]));if(_0x3bfd74[_0x8b13('0x3f')][_0x8b13('0x4a')]){_0x45fe23[_0x8b13('0x48')]=_[_0x8b13('0x4d')](_0x45fe23[_0x8b13('0x48')],{'$or':_[_0x8b13('0x3b')](_0x45fe23['attributes'],function(_0x2642b1){var _0x213b43={};_0x213b43[_0x2642b1]={'$like':'%'+_0x3bfd74[_0x8b13('0x3f')]['filter']+'%'};return _0x213b43;})});}_0x45fe23=_[_0x8b13('0x4d')]({},_0x45fe23,_0x3bfd74['options']);return _0x4334c1[_0x8b13('0x5f')](_0x45fe23);}})[_0x8b13('0x1d')](function(_0x38a1ce){if(_0x38a1ce){_0x1bb954=_0x38a1ce[_0x8b13('0x46')];if(!_0x3bfd74[_0x8b13('0x3f')][_0x8b13('0x5d')](_0x8b13('0x5e'))){_0x45fe23[_0x8b13('0x2e')]=qs[_0x8b13('0x2e')](_0x3bfd74[_0x8b13('0x3f')]['limit']);_0x45fe23[_0x8b13('0x2c')]=qs[_0x8b13('0x2c')](_0x3bfd74[_0x8b13('0x3f')][_0x8b13('0x2c')]);}return _0x4334c1[_0x8b13('0x5f')](_0x45fe23);}})[_0x8b13('0x1d')](function(_0x2c69f5){if(_0x2c69f5){return _0x2c69f5?{'count':_0x1bb954,'rows':_0x2c69f5}:null;}})[_0x8b13('0x1d')](respondWithResult(_0x69e237,null))[_0x8b13('0x28')](handleError(_0x69e237,null));};exports[_0x8b13('0x60')]=function(_0x291962,_0x1819fb,_0x378e33){var _0x4bb71a={};var _0x491bf8={};var _0x3870a9;var _0x512f30;return db[_0x8b13('0x3c')][_0x8b13('0x5a')]({'where':{'id':_0x291962['params']['id']}})['then'](handleEntityNotFound(_0x1819fb,null))[_0x8b13('0x1d')](function(_0x416f9c){if(_0x416f9c){_0x3870a9=_0x416f9c;_0x491bf8[_0x8b13('0x44')]=_[_0x8b13('0x40')](db[_0x8b13('0x5b')]['rawAttributes']);_0x491bf8[_0x8b13('0x3f')]=_['keys'](_0x291962[_0x8b13('0x3f')]);_0x491bf8[_0x8b13('0x41')]=_['intersection'](_0x491bf8[_0x8b13('0x44')],_0x491bf8[_0x8b13('0x3f')]);_0x4bb71a[_0x8b13('0x43')]=_[_0x8b13('0x42')](_0x491bf8[_0x8b13('0x44')],qs['fields'](_0x291962[_0x8b13('0x3f')][_0x8b13('0x45')]));_0x4bb71a[_0x8b13('0x43')]=_0x4bb71a['attributes'][_0x8b13('0x46')]?_0x4bb71a['attributes']:_0x491bf8[_0x8b13('0x44')];_0x4bb71a[_0x8b13('0x47')]=qs[_0x8b13('0x5c')](_0x291962[_0x8b13('0x3f')][_0x8b13('0x5c')]);_0x4bb71a[_0x8b13('0x48')]=qs[_0x8b13('0x41')](_[_0x8b13('0x49')](_0x291962[_0x8b13('0x3f')],_0x491bf8[_0x8b13('0x41')]));if(_0x291962['query'][_0x8b13('0x4a')]){_0x4bb71a[_0x8b13('0x48')]=_[_0x8b13('0x4d')](_0x4bb71a[_0x8b13('0x48')],{'$or':_[_0x8b13('0x3b')](_0x4bb71a['attributes'],function(_0x1a4c09){var _0x45dc31={};_0x45dc31[_0x1a4c09]={'$like':'%'+_0x291962[_0x8b13('0x3f')][_0x8b13('0x4a')]+'%'};return _0x45dc31;})});}_0x4bb71a=_[_0x8b13('0x4d')]({},_0x4bb71a,_0x291962[_0x8b13('0x4e')]);return _0x3870a9['getDescriptions'](_0x4bb71a);}})[_0x8b13('0x1d')](function(_0xd2b08b){if(_0xd2b08b){_0x512f30=_0xd2b08b['length'];if(!_0x291962[_0x8b13('0x3f')]['hasOwnProperty'](_0x8b13('0x5e'))){_0x4bb71a['limit']=qs[_0x8b13('0x2e')](_0x291962[_0x8b13('0x3f')][_0x8b13('0x2e')]);_0x4bb71a[_0x8b13('0x2c')]=qs[_0x8b13('0x2c')](_0x291962[_0x8b13('0x3f')][_0x8b13('0x2c')]);}return _0x3870a9[_0x8b13('0x60')](_0x4bb71a);}})['then'](function(_0x800c3c){if(_0x800c3c){return _0x800c3c?{'count':_0x512f30,'rows':_0x800c3c}:null;}})[_0x8b13('0x1d')](respondWithResult(_0x1819fb,null))['catch'](handleError(_0x1819fb,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index daff1da..fd8c3cf 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 _0x9ed1=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x59f9e,_0x8614a3){var _0x191398=function(_0x2b598a){while(--_0x2b598a){_0x59f9e['push'](_0x59f9e['shift']());}};_0x191398(++_0x8614a3);}(_0x9ed1,0x7d));var _0x19ed=function(_0x380144,_0xe473c1){_0x380144=_0x380144-0x0;var _0x298587=_0x9ed1[_0x380144];return _0x298587;};'use strict';var _=require(_0x19ed('0x0'));var util=require(_0x19ed('0x1'));var logger=require(_0x19ed('0x2'))(_0x19ed('0x3'));var moment=require(_0x19ed('0x4'));var BPromise=require(_0x19ed('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19ed('0x6'));var rimraf=require(_0x19ed('0x7'));var config=require(_0x19ed('0x8'));var attributes=require(_0x19ed('0x9'));module[_0x19ed('0xa')]=function(_0x1603c5,_0x9b8194){return _0x1603c5['define']('ZohoConfiguration',attributes,{'tableName':_0x19ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd82=['../../config/logger','api','moment','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util'];(function(_0x5b7b86,_0x14da00){var _0x3027b4=function(_0x41df2c){while(--_0x41df2c){_0x5b7b86['push'](_0x5b7b86['shift']());}};_0x3027b4(++_0x14da00);}(_0xbd82,0x150));var _0x2bd8=function(_0x24d7b5,_0x3b7b3e){_0x24d7b5=_0x24d7b5-0x0;var _0x2da79e=_0xbd82[_0x24d7b5];return _0x2da79e;};'use strict';var _=require(_0x2bd8('0x0'));var util=require(_0x2bd8('0x1'));var logger=require(_0x2bd8('0x2'))(_0x2bd8('0x3'));var moment=require(_0x2bd8('0x4'));var BPromise=require('bluebird');var rp=require(_0x2bd8('0x5'));var fs=require('fs');var path=require(_0x2bd8('0x6'));var rimraf=require('rimraf');var config=require(_0x2bd8('0x7'));var attributes=require(_0x2bd8('0x8'));module[_0x2bd8('0x9')]=function(_0x45a4f6,_0x2774be){return _0x45a4f6[_0x2bd8('0xa')](_0x2bd8('0xb'),attributes,{'tableName':_0x2bd8('0xc'),'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 e4ccabb..33298fc 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 _0x1211=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x17db90,_0x2377ed){var _0x5d50e0=function(_0x3852c0){while(--_0x3852c0){_0x17db90['push'](_0x17db90['shift']());}};_0x5d50e0(++_0x2377ed);}(_0x1211,0x10d));var _0x1121=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1211[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1121('0x0'));var util=require('util');var moment=require(_0x1121('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1121('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1121('0x3'))(_0x1121('0x4'));var config=require(_0x1121('0x5'));var jayson=require(_0x1121('0x6'));var client=jayson[_0x1121('0x7')][_0x1121('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e2ddd,_0x3dbf65,_0x7901b3){return new BPromise(function(_0x15ee17,_0x59b870){return client[_0x1121('0x9')](_0x1e2ddd,_0x7901b3)[_0x1121('0xa')](function(_0x2a0e01){logger['info'](_0x1121('0xb'),_0x3dbf65,_0x1121('0xc'));logger[_0x1121('0xd')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3dbf65,'request\x20sent',JSON[_0x1121('0xe')](_0x2a0e01));if(_0x2a0e01['error']){if(_0x2a0e01[_0x1121('0xf')][_0x1121('0x10')]===0x1f4){logger[_0x1121('0xf')](_0x1121('0xb'),_0x3dbf65,_0x2a0e01['error']['message']);return _0x59b870(_0x2a0e01[_0x1121('0xf')][_0x1121('0x11')]);}logger[_0x1121('0xf')](_0x1121('0xb'),_0x3dbf65,_0x2a0e01['error'][_0x1121('0x11')]);return _0x15ee17(_0x2a0e01[_0x1121('0xf')][_0x1121('0x11')]);}else{logger[_0x1121('0x12')](_0x1121('0xb'),_0x3dbf65,_0x1121('0xc'));_0x15ee17(_0x2a0e01[_0x1121('0x13')][_0x1121('0x11')]);}})['catch'](function(_0x4256e5){logger[_0x1121('0xf')](_0x1121('0xb'),_0x3dbf65,_0x4256e5);_0x59b870(_0x4256e5);});});} \ No newline at end of file +var _0xe78c=['message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x42d645,_0x61c13f){var _0x448a1=function(_0x285d12){while(--_0x285d12){_0x42d645['push'](_0x42d645['shift']());}};_0x448a1(++_0x61c13f);}(_0xe78c,0x1d1));var _0xce78=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe78c[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xce78('0x0'));var util=require(_0xce78('0x1'));var moment=require('moment');var BPromise=require(_0xce78('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce78('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xce78('0x4'));var logger=require(_0xce78('0x5'))(_0xce78('0x6'));var config=require(_0xce78('0x7'));var jayson=require(_0xce78('0x8'));var client=jayson['client'][_0xce78('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f185f,_0x539fea,_0x4cc28c){return new BPromise(function(_0x2fe327,_0x4e65df){return client['request'](_0x1f185f,_0x4cc28c)[_0xce78('0xa')](function(_0x3436c1){logger[_0xce78('0xb')](_0xce78('0xc'),_0x539fea,_0xce78('0xd'));logger[_0xce78('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x539fea,'request\x20sent',JSON[_0xce78('0xf')](_0x3436c1));if(_0x3436c1[_0xce78('0x10')]){if(_0x3436c1[_0xce78('0x10')][_0xce78('0x11')]===0x1f4){logger[_0xce78('0x10')](_0xce78('0xc'),_0x539fea,_0x3436c1[_0xce78('0x10')][_0xce78('0x12')]);return _0x4e65df(_0x3436c1[_0xce78('0x10')][_0xce78('0x12')]);}logger[_0xce78('0x10')](_0xce78('0xc'),_0x539fea,_0x3436c1['error'][_0xce78('0x12')]);return _0x2fe327(_0x3436c1[_0xce78('0x10')][_0xce78('0x12')]);}else{logger[_0xce78('0xb')](_0xce78('0xc'),_0x539fea,_0xce78('0xd'));_0x2fe327(_0x3436c1[_0xce78('0x13')][_0xce78('0x12')]);}})[_0xce78('0x14')](function(_0xad7497){logger['error'](_0xce78('0xc'),_0x539fea,_0xad7497);_0x4e65df(_0xad7497);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 8908294..4e88d8a 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 _0x5236=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5236,0x109));var _0x6523=function(_0x4a58fe,_0x37d1b8){_0x4a58fe=_0x4a58fe-0x0;var _0x29a6c9=_0x5236[_0x4a58fe];return _0x29a6c9;};'use strict';var multer=require(_0x6523('0x0'));var util=require(_0x6523('0x1'));var path=require(_0x6523('0x2'));var timeout=require(_0x6523('0x3'));var express=require(_0x6523('0x4'));var router=express['Router']();var fs_extra=require(_0x6523('0x5'));var auth=require(_0x6523('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6523('0x7'));var controller=require(_0x6523('0x8'));router[_0x6523('0x9')]('/',auth[_0x6523('0xa')](),controller[_0x6523('0xb')]);router['get'](_0x6523('0xc'),auth[_0x6523('0xa')](),controller[_0x6523('0xd')]);router['post']('/',auth[_0x6523('0xa')](),controller[_0x6523('0xe')]);router[_0x6523('0xf')](_0x6523('0xc'),auth[_0x6523('0xa')](),controller[_0x6523('0x10')]);router['delete'](_0x6523('0xc'),auth[_0x6523('0xa')](),controller[_0x6523('0x11')]);module[_0x6523('0x12')]=router; \ No newline at end of file +var _0x32d5=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post'];(function(_0x434bf7,_0xaab22d){var _0x355355=function(_0x4f6319){while(--_0x4f6319){_0x434bf7['push'](_0x434bf7['shift']());}};_0x355355(++_0xaab22d);}(_0x32d5,0x1aa));var _0x532d=function(_0x5e0870,_0x357a71){_0x5e0870=_0x5e0870-0x0;var _0x3709a7=_0x32d5[_0x5e0870];return _0x3709a7;};'use strict';var multer=require(_0x532d('0x0'));var util=require(_0x532d('0x1'));var path=require(_0x532d('0x2'));var timeout=require(_0x532d('0x3'));var express=require(_0x532d('0x4'));var router=express[_0x532d('0x5')]();var fs_extra=require(_0x532d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x532d('0x7'));var config=require(_0x532d('0x8'));var controller=require('./intZohoField.controller');router[_0x532d('0x9')]('/',auth[_0x532d('0xa')](),controller[_0x532d('0xb')]);router[_0x532d('0x9')](_0x532d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x532d('0xd')]('/',auth['isAuthenticated'](),controller[_0x532d('0xe')]);router[_0x532d('0xf')](_0x532d('0xc'),auth[_0x532d('0xa')](),controller[_0x532d('0x10')]);router[_0x532d('0x11')](_0x532d('0xc'),auth[_0x532d('0xa')](),controller[_0x532d('0x12')]);module[_0x532d('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 0c84412..e8d4bb0 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 _0x8664=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x4871a,_0x3fc52e){var _0x13e1e6=function(_0x3baf82){while(--_0x3baf82){_0x4871a['push'](_0x4871a['shift']());}};_0x13e1e6(++_0x3fc52e);}(_0x8664,0x11a));var _0x4866=function(_0x59b258,_0x1ff184){_0x59b258=_0x59b258-0x0;var _0x26ffcf=_0x8664[_0x59b258];return _0x26ffcf;};'use strict';var Sequelize=require(_0x4866('0x0'));module[_0x4866('0x1')]={'type':{'type':Sequelize[_0x4866('0x2')](_0x4866('0x3'),_0x4866('0x4'),_0x4866('0x5'),_0x4866('0x6'),_0x4866('0x7')),'defaultValue':_0x4866('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4866('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x4866('0x3'),_0x4866('0x4'),_0x4866('0x5'))},'keyContent':{'type':Sequelize[_0x4866('0x8')]},'idField':{'type':Sequelize[_0x4866('0x8')]},'nameField':{'type':Sequelize[_0x4866('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4866('0x8')]}}; \ No newline at end of file +var _0x7341=['ENUM','variable','customVariable','picklist','string','STRING'];(function(_0x298d18,_0x2364a1){var _0x3ecf4a=function(_0x30eb9f){while(--_0x30eb9f){_0x298d18['push'](_0x298d18['shift']());}};_0x3ecf4a(++_0x2364a1);}(_0x7341,0xe4));var _0x1734=function(_0x5594a0,_0x2fbdc6){_0x5594a0=_0x5594a0-0x0;var _0x115e70=_0x7341[_0x5594a0];return _0x115e70;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1734('0x0')]('string',_0x1734('0x1'),_0x1734('0x2'),'keyValue',_0x1734('0x3')),'defaultValue':_0x1734('0x4')},'content':{'type':Sequelize[_0x1734('0x5')]},'key':{'type':Sequelize[_0x1734('0x5')]},'keyType':{'type':Sequelize[_0x1734('0x0')](_0x1734('0x4'),_0x1734('0x1'),'customVariable')},'keyContent':{'type':Sequelize[_0x1734('0x5')]},'idField':{'type':Sequelize[_0x1734('0x5')]},'nameField':{'type':Sequelize[_0x1734('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1734('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 3d10b0a..b8bc145 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 _0xf570=['pick','filter','merge','options','includeAll','include','catch','show','params','find','create','body','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','update','then','destroy','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters'];(function(_0x1c22ac,_0x4c86bd){var _0x4c867a=function(_0x370c7d){while(--_0x370c7d){_0x1c22ac['push'](_0x1c22ac['shift']());}};_0x4c867a(++_0x4c86bd);}(_0xf570,0x160));var _0x0f57=function(_0x40db6b,_0x377f92){_0x40db6b=_0x40db6b-0x0;var _0x1071c8=_0xf570[_0x40db6b];return _0x1071c8;};'use strict';var emlformat=require(_0x0f57('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f57('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f57('0x2'));var moment=require('moment');var BPromise=require(_0x0f57('0x3'));var Mustache=require(_0x0f57('0x4'));var util=require(_0x0f57('0x5'));var path=require(_0x0f57('0x6'));var sox=require('sox');var csv=require(_0x0f57('0x7'));var ejs=require(_0x0f57('0x8'));var fs=require('fs');var fs_extra=require(_0x0f57('0x9'));var _=require(_0x0f57('0xa'));var squel=require(_0x0f57('0xb'));var crypto=require(_0x0f57('0xc'));var jsforce=require(_0x0f57('0xd'));var deskjs=require(_0x0f57('0xe'));var toCsv=require(_0x0f57('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0f57('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0f57('0x10'));var hardwareService=require(_0x0f57('0x11'));var logger=require('../../config/logger')(_0x0f57('0x12'));var utils=require(_0x0f57('0x13'));var config=require(_0x0f57('0x14'));var licenseUtil=require(_0x0f57('0x15'));var db=require(_0x0f57('0x16'))['db'];function respondWithStatusCode(_0x543975,_0x54cc5f){_0x54cc5f=_0x54cc5f||0xcc;return function(_0x556a46){if(_0x556a46){return _0x543975[_0x0f57('0x17')](_0x54cc5f);}return _0x543975[_0x0f57('0x18')](_0x54cc5f)[_0x0f57('0x19')]();};}function respondWithResult(_0x3e7d25,_0x252469){_0x252469=_0x252469||0xc8;return function(_0x11b700){if(_0x11b700){return _0x3e7d25['status'](_0x252469)[_0x0f57('0x1a')](_0x11b700);}};}function respondWithFilteredResult(_0x259d11,_0x1c3bef){return function(_0x1b6056){if(_0x1b6056){var _0x5ef20d=typeof _0x1c3bef[_0x0f57('0x1b')]===_0x0f57('0x1c')&&typeof _0x1c3bef['limit']===_0x0f57('0x1c');var _0x3e4f97=_0x1b6056[_0x0f57('0x1d')];var _0x273c3b=_0x5ef20d?0x0:_0x1c3bef[_0x0f57('0x1b')];var _0x1758f0=_0x5ef20d?_0x1b6056[_0x0f57('0x1d')]:_0x1c3bef[_0x0f57('0x1b')]+_0x1c3bef[_0x0f57('0x1e')];var _0x5c1746;if(_0x1758f0>=_0x3e4f97){_0x1758f0=_0x3e4f97;_0x5c1746=0xc8;}else{_0x5c1746=0xce;}_0x259d11[_0x0f57('0x18')](_0x5c1746);return _0x259d11[_0x0f57('0x1f')]('Content-Range',_0x273c3b+'-'+_0x1758f0+'/'+_0x3e4f97)[_0x0f57('0x1a')](_0x1b6056);}return null;};}function patchUpdates(_0x584ca2){return function(_0x41f255){try{jsonpatch['apply'](_0x41f255,_0x584ca2,!![]);}catch(_0x151dd0){return BPromise['reject'](_0x151dd0);}return _0x41f255['save']();};}function saveUpdates(_0x5f0b2d,_0x285026){return function(_0x4adbc6){if(_0x4adbc6){return _0x4adbc6[_0x0f57('0x20')](_0x5f0b2d)[_0x0f57('0x21')](function(_0x594178){return _0x594178;});}return null;};}function removeEntity(_0x2cef00,_0x4b5e66){return function(_0x1b5782){if(_0x1b5782){return _0x1b5782[_0x0f57('0x22')]()[_0x0f57('0x21')](function(){_0x2cef00[_0x0f57('0x18')](0xcc)[_0x0f57('0x19')]();});}};}function handleEntityNotFound(_0x47e413,_0x813495){return function(_0x4549fc){if(!_0x4549fc){_0x47e413[_0x0f57('0x17')](0x194);}return _0x4549fc;};}function handleError(_0x3b5c47,_0x5691ea){_0x5691ea=_0x5691ea||0x1f4;return function(_0x1d3120){logger[_0x0f57('0x23')](_0x1d3120[_0x0f57('0x24')]);if(_0x1d3120[_0x0f57('0x25')]){delete _0x1d3120[_0x0f57('0x25')];}_0x3b5c47[_0x0f57('0x18')](_0x5691ea)[_0x0f57('0x26')](_0x1d3120);};}exports['index']=function(_0x3ebebe,_0x4d164a){var _0x7cd431={},_0xaa8c79={},_0x36676c={'count':0x0,'rows':[]};var _0xf34bfa=_[_0x0f57('0x27')](db[_0x0f57('0x28')][_0x0f57('0x29')],function(_0x24b873){return{'name':_0x24b873[_0x0f57('0x2a')],'type':_0x24b873[_0x0f57('0x2b')]['key']};});_0xaa8c79[_0x0f57('0x2c')]=_['map'](_0xf34bfa,_0x0f57('0x25'));_0xaa8c79['query']=_[_0x0f57('0x2d')](_0x3ebebe[_0x0f57('0x2e')]);_0xaa8c79['filters']=_[_0x0f57('0x2f')](_0xaa8c79[_0x0f57('0x2c')],_0xaa8c79[_0x0f57('0x2e')]);_0x7cd431['attributes']=_[_0x0f57('0x2f')](_0xaa8c79[_0x0f57('0x2c')],qs[_0x0f57('0x30')](_0x3ebebe[_0x0f57('0x2e')][_0x0f57('0x30')]));_0x7cd431[_0x0f57('0x31')]=_0x7cd431['attributes'][_0x0f57('0x32')]?_0x7cd431[_0x0f57('0x31')]:_0xaa8c79[_0x0f57('0x2c')];if(!_0x3ebebe[_0x0f57('0x2e')][_0x0f57('0x33')](_0x0f57('0x34'))){_0x7cd431[_0x0f57('0x1e')]=qs[_0x0f57('0x1e')](_0x3ebebe[_0x0f57('0x2e')][_0x0f57('0x1e')]);_0x7cd431['offset']=qs[_0x0f57('0x1b')](_0x3ebebe[_0x0f57('0x2e')][_0x0f57('0x1b')]);}_0x7cd431['order']=qs[_0x0f57('0x35')](_0x3ebebe['query'][_0x0f57('0x35')]);_0x7cd431[_0x0f57('0x36')]=qs[_0x0f57('0x37')](_[_0x0f57('0x38')](_0x3ebebe[_0x0f57('0x2e')],_0xaa8c79[_0x0f57('0x37')]),_0xf34bfa);if(_0x3ebebe['query'][_0x0f57('0x39')]){_0x7cd431[_0x0f57('0x36')]=_[_0x0f57('0x3a')](_0x7cd431[_0x0f57('0x36')],{'$or':_[_0x0f57('0x27')](_0xf34bfa,function(_0x115b97){if(_0x115b97['type']!=='VIRTUAL'){var _0x313e84={};_0x313e84[_0x115b97[_0x0f57('0x25')]]={'$like':'%'+_0x3ebebe[_0x0f57('0x2e')][_0x0f57('0x39')]+'%'};return _0x313e84;}})});}_0x7cd431=_['merge']({},_0x7cd431,_0x3ebebe[_0x0f57('0x3b')]);var _0x19706f={'where':_0x7cd431[_0x0f57('0x36')]};return db['ZohoField'][_0x0f57('0x1d')](_0x19706f)[_0x0f57('0x21')](function(_0x336d20){_0x36676c[_0x0f57('0x1d')]=_0x336d20;if(_0x3ebebe[_0x0f57('0x2e')][_0x0f57('0x3c')]){_0x7cd431[_0x0f57('0x3d')]=[{'all':!![]}];}return db[_0x0f57('0x28')]['findAll'](_0x7cd431);})[_0x0f57('0x21')](function(_0x447a6b){_0x36676c['rows']=_0x447a6b;return _0x36676c;})[_0x0f57('0x21')](respondWithFilteredResult(_0x4d164a,_0x7cd431))[_0x0f57('0x3e')](handleError(_0x4d164a,null));};exports[_0x0f57('0x3f')]=function(_0x55c52e,_0x6ac706){var _0x4af2f1={'raw':!![],'where':{'id':_0x55c52e[_0x0f57('0x40')]['id']}},_0x431d57={};_0x431d57['model']=_[_0x0f57('0x2d')](db[_0x0f57('0x28')][_0x0f57('0x29')]);_0x431d57['query']=_['keys'](_0x55c52e[_0x0f57('0x2e')]);_0x431d57[_0x0f57('0x37')]=_[_0x0f57('0x2f')](_0x431d57[_0x0f57('0x2c')],_0x431d57[_0x0f57('0x2e')]);_0x4af2f1[_0x0f57('0x31')]=_[_0x0f57('0x2f')](_0x431d57['model'],qs[_0x0f57('0x30')](_0x55c52e[_0x0f57('0x2e')][_0x0f57('0x30')]));_0x4af2f1[_0x0f57('0x31')]=_0x4af2f1['attributes'][_0x0f57('0x32')]?_0x4af2f1[_0x0f57('0x31')]:_0x431d57['model'];if(_0x55c52e['query']['includeAll']){_0x4af2f1[_0x0f57('0x3d')]=[{'all':!![]}];}_0x4af2f1=_[_0x0f57('0x3a')]({},_0x4af2f1,_0x55c52e[_0x0f57('0x3b')]);return db[_0x0f57('0x28')][_0x0f57('0x41')](_0x4af2f1)[_0x0f57('0x21')](handleEntityNotFound(_0x6ac706,null))[_0x0f57('0x21')](respondWithResult(_0x6ac706,null))[_0x0f57('0x3e')](handleError(_0x6ac706,null));};exports[_0x0f57('0x42')]=function(_0x1b0638,_0x3d2858){return db[_0x0f57('0x28')][_0x0f57('0x42')](_0x1b0638['body'],{})[_0x0f57('0x21')](respondWithResult(_0x3d2858,0xc9))[_0x0f57('0x3e')](handleError(_0x3d2858,null));};exports[_0x0f57('0x20')]=function(_0x3b7c83,_0x51771b){if(_0x3b7c83[_0x0f57('0x43')]['id']){delete _0x3b7c83[_0x0f57('0x43')]['id'];}return db[_0x0f57('0x28')]['find']({'where':{'id':_0x3b7c83['params']['id']}})[_0x0f57('0x21')](handleEntityNotFound(_0x51771b,null))[_0x0f57('0x21')](saveUpdates(_0x3b7c83[_0x0f57('0x43')],null))[_0x0f57('0x21')](respondWithResult(_0x51771b,null))[_0x0f57('0x3e')](handleError(_0x51771b,null));};exports['destroy']=function(_0xda3aaf,_0x512f57){return db[_0x0f57('0x28')]['find']({'where':{'id':_0xda3aaf[_0x0f57('0x40')]['id']}})[_0x0f57('0x21')](handleEntityNotFound(_0x512f57,null))[_0x0f57('0x21')](removeEntity(_0x512f57,null))[_0x0f57('0x3e')](handleError(_0x512f57,null));}; \ No newline at end of file +var _0x959b=['VIRTUAL','filter','options','ZohoField','include','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge'];(function(_0x590b71,_0xf2162b){var _0x4bbc59=function(_0x34fe71){while(--_0x34fe71){_0x590b71['push'](_0x590b71['shift']());}};_0x4bbc59(++_0xf2162b);}(_0x959b,0x1ca));var _0xb959=function(_0x8284ac,_0x47ae5f){_0x8284ac=_0x8284ac-0x0;var _0x4f0524=_0x959b[_0x8284ac];return _0x4f0524;};'use strict';var emlformat=require(_0xb959('0x0'));var rimraf=require(_0xb959('0x1'));var zipdir=require(_0xb959('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb959('0x3'));var moment=require(_0xb959('0x4'));var BPromise=require(_0xb959('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb959('0x6'));var csv=require(_0xb959('0x7'));var ejs=require(_0xb959('0x8'));var fs=require('fs');var fs_extra=require(_0xb959('0x9'));var _=require(_0xb959('0xa'));var squel=require(_0xb959('0xb'));var crypto=require(_0xb959('0xc'));var jsforce=require(_0xb959('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb959('0x7'));var querystring=require(_0xb959('0xe'));var Papa=require('papaparse');var Redis=require(_0xb959('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb959('0x10'));var as=require(_0xb959('0x11'));var hardwareService=require(_0xb959('0x12'));var logger=require(_0xb959('0x13'))(_0xb959('0x14'));var utils=require('../../config/utils');var config=require(_0xb959('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb959('0x16'))['db'];function respondWithStatusCode(_0x540e34,_0x31522e){_0x31522e=_0x31522e||0xcc;return function(_0x2ab872){if(_0x2ab872){return _0x540e34['sendStatus'](_0x31522e);}return _0x540e34['status'](_0x31522e)[_0xb959('0x17')]();};}function respondWithResult(_0x12dd0c,_0x16446f){_0x16446f=_0x16446f||0xc8;return function(_0x136d0f){if(_0x136d0f){return _0x12dd0c[_0xb959('0x18')](_0x16446f)[_0xb959('0x19')](_0x136d0f);}};}function respondWithFilteredResult(_0x2ecbcf,_0x1a1972){return function(_0x3b2c7a){if(_0x3b2c7a){var _0x51a188=typeof _0x1a1972['offset']===_0xb959('0x1a')&&typeof _0x1a1972[_0xb959('0x1b')]===_0xb959('0x1a');var _0x4f2f5a=_0x3b2c7a[_0xb959('0x1c')];var _0x5ecd4d=_0x51a188?0x0:_0x1a1972[_0xb959('0x1d')];var _0x5ea437=_0x51a188?_0x3b2c7a['count']:_0x1a1972[_0xb959('0x1d')]+_0x1a1972[_0xb959('0x1b')];var _0x4e855b;if(_0x5ea437>=_0x4f2f5a){_0x5ea437=_0x4f2f5a;_0x4e855b=0xc8;}else{_0x4e855b=0xce;}_0x2ecbcf[_0xb959('0x18')](_0x4e855b);return _0x2ecbcf[_0xb959('0x1e')](_0xb959('0x1f'),_0x5ecd4d+'-'+_0x5ea437+'/'+_0x4f2f5a)[_0xb959('0x19')](_0x3b2c7a);}return null;};}function patchUpdates(_0xa6d6b9){return function(_0x5ca952){try{jsonpatch[_0xb959('0x20')](_0x5ca952,_0xa6d6b9,!![]);}catch(_0x57754a){return BPromise['reject'](_0x57754a);}return _0x5ca952[_0xb959('0x21')]();};}function saveUpdates(_0x566dde,_0x959148){return function(_0x2a1e21){if(_0x2a1e21){return _0x2a1e21[_0xb959('0x22')](_0x566dde)['then'](function(_0x2e7fa8){return _0x2e7fa8;});}return null;};}function removeEntity(_0x4783d7,_0x4f3b18){return function(_0x26f6a1){if(_0x26f6a1){return _0x26f6a1[_0xb959('0x23')]()[_0xb959('0x24')](function(){_0x4783d7['status'](0xcc)[_0xb959('0x17')]();});}};}function handleEntityNotFound(_0x466604,_0x459d1a){return function(_0x1d1e24){if(!_0x1d1e24){_0x466604[_0xb959('0x25')](0x194);}return _0x1d1e24;};}function handleError(_0x226ca0,_0x44ac3f){_0x44ac3f=_0x44ac3f||0x1f4;return function(_0x356382){logger['error'](_0x356382[_0xb959('0x26')]);if(_0x356382[_0xb959('0x27')]){delete _0x356382['name'];}_0x226ca0[_0xb959('0x18')](_0x44ac3f)[_0xb959('0x28')](_0x356382);};}exports[_0xb959('0x29')]=function(_0x33f28a,_0x40bd32){var _0x3342f4={},_0x1cf179={},_0x4d3d77={'count':0x0,'rows':[]};var _0x171d4c=_[_0xb959('0x2a')](db['ZohoField'][_0xb959('0x2b')],function(_0x3f1aef){return{'name':_0x3f1aef[_0xb959('0x2c')],'type':_0x3f1aef[_0xb959('0x2d')][_0xb959('0x2e')]};});_0x1cf179[_0xb959('0x2f')]=_[_0xb959('0x2a')](_0x171d4c,_0xb959('0x27'));_0x1cf179[_0xb959('0x30')]=_[_0xb959('0x31')](_0x33f28a['query']);_0x1cf179[_0xb959('0x32')]=_[_0xb959('0x33')](_0x1cf179['model'],_0x1cf179[_0xb959('0x30')]);_0x3342f4[_0xb959('0x34')]=_[_0xb959('0x33')](_0x1cf179[_0xb959('0x2f')],qs['fields'](_0x33f28a[_0xb959('0x30')]['fields']));_0x3342f4[_0xb959('0x34')]=_0x3342f4[_0xb959('0x34')][_0xb959('0x35')]?_0x3342f4[_0xb959('0x34')]:_0x1cf179[_0xb959('0x2f')];if(!_0x33f28a['query'][_0xb959('0x36')](_0xb959('0x37'))){_0x3342f4[_0xb959('0x1b')]=qs['limit'](_0x33f28a[_0xb959('0x30')][_0xb959('0x1b')]);_0x3342f4[_0xb959('0x1d')]=qs[_0xb959('0x1d')](_0x33f28a[_0xb959('0x30')]['offset']);}_0x3342f4['order']=qs[_0xb959('0x38')](_0x33f28a['query']['sort']);_0x3342f4[_0xb959('0x39')]=qs[_0xb959('0x32')](_[_0xb959('0x3a')](_0x33f28a[_0xb959('0x30')],_0x1cf179[_0xb959('0x32')]),_0x171d4c);if(_0x33f28a[_0xb959('0x30')]['filter']){_0x3342f4[_0xb959('0x39')]=_[_0xb959('0x3b')](_0x3342f4[_0xb959('0x39')],{'$or':_['map'](_0x171d4c,function(_0x2b542a){if(_0x2b542a['type']!==_0xb959('0x3c')){var _0x1419c3={};_0x1419c3[_0x2b542a[_0xb959('0x27')]]={'$like':'%'+_0x33f28a[_0xb959('0x30')][_0xb959('0x3d')]+'%'};return _0x1419c3;}})});}_0x3342f4=_[_0xb959('0x3b')]({},_0x3342f4,_0x33f28a[_0xb959('0x3e')]);var _0x16818a={'where':_0x3342f4['where']};return db[_0xb959('0x3f')][_0xb959('0x1c')](_0x16818a)[_0xb959('0x24')](function(_0x46559d){_0x4d3d77[_0xb959('0x1c')]=_0x46559d;if(_0x33f28a[_0xb959('0x30')]['includeAll']){_0x3342f4[_0xb959('0x40')]=[{'all':!![]}];}return db['ZohoField'][_0xb959('0x41')](_0x3342f4);})[_0xb959('0x24')](function(_0x4515b9){_0x4d3d77[_0xb959('0x42')]=_0x4515b9;return _0x4d3d77;})[_0xb959('0x24')](respondWithFilteredResult(_0x40bd32,_0x3342f4))[_0xb959('0x43')](handleError(_0x40bd32,null));};exports[_0xb959('0x44')]=function(_0x36533d,_0x2073be){var _0x476750={'raw':!![],'where':{'id':_0x36533d[_0xb959('0x45')]['id']}},_0x3d2053={};_0x3d2053['model']=_[_0xb959('0x31')](db['ZohoField'][_0xb959('0x2b')]);_0x3d2053['query']=_['keys'](_0x36533d[_0xb959('0x30')]);_0x3d2053[_0xb959('0x32')]=_[_0xb959('0x33')](_0x3d2053[_0xb959('0x2f')],_0x3d2053[_0xb959('0x30')]);_0x476750[_0xb959('0x34')]=_['intersection'](_0x3d2053[_0xb959('0x2f')],qs[_0xb959('0x46')](_0x36533d['query'][_0xb959('0x46')]));_0x476750[_0xb959('0x34')]=_0x476750[_0xb959('0x34')]['length']?_0x476750['attributes']:_0x3d2053[_0xb959('0x2f')];if(_0x36533d[_0xb959('0x30')]['includeAll']){_0x476750[_0xb959('0x40')]=[{'all':!![]}];}_0x476750=_[_0xb959('0x3b')]({},_0x476750,_0x36533d[_0xb959('0x3e')]);return db[_0xb959('0x3f')][_0xb959('0x47')](_0x476750)[_0xb959('0x24')](handleEntityNotFound(_0x2073be,null))[_0xb959('0x24')](respondWithResult(_0x2073be,null))[_0xb959('0x43')](handleError(_0x2073be,null));};exports[_0xb959('0x48')]=function(_0x273aab,_0x411d44){return db['ZohoField'][_0xb959('0x48')](_0x273aab[_0xb959('0x49')],{})['then'](respondWithResult(_0x411d44,0xc9))[_0xb959('0x43')](handleError(_0x411d44,null));};exports[_0xb959('0x22')]=function(_0x13cc3a,_0x295e3c){if(_0x13cc3a[_0xb959('0x49')]['id']){delete _0x13cc3a[_0xb959('0x49')]['id'];}return db[_0xb959('0x3f')][_0xb959('0x47')]({'where':{'id':_0x13cc3a[_0xb959('0x45')]['id']}})[_0xb959('0x24')](handleEntityNotFound(_0x295e3c,null))['then'](saveUpdates(_0x13cc3a[_0xb959('0x49')],null))[_0xb959('0x24')](respondWithResult(_0x295e3c,null))[_0xb959('0x43')](handleError(_0x295e3c,null));};exports[_0xb959('0x23')]=function(_0xda7fc2,_0x2c1204){return db['ZohoField'][_0xb959('0x47')]({'where':{'id':_0xda7fc2[_0xb959('0x45')]['id']}})[_0xb959('0x24')](handleEntityNotFound(_0x2c1204,null))[_0xb959('0x24')](removeEntity(_0x2c1204,null))[_0xb959('0x43')](handleError(_0x2c1204,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 82d51aa..05d4d41 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 _0x07c9=['int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x07c9,0x179));var _0x907c=function(_0x4c6325,_0x4b9b56){_0x4c6325=_0x4c6325-0x0;var _0x12544b=_0x07c9[_0x4c6325];return _0x12544b;};'use strict';var _=require(_0x907c('0x0'));var util=require(_0x907c('0x1'));var logger=require(_0x907c('0x2'))(_0x907c('0x3'));var moment=require(_0x907c('0x4'));var BPromise=require(_0x907c('0x5'));var rp=require(_0x907c('0x6'));var fs=require('fs');var path=require(_0x907c('0x7'));var rimraf=require(_0x907c('0x8'));var config=require(_0x907c('0x9'));var attributes=require(_0x907c('0xa'));module[_0x907c('0xb')]=function(_0x4554f8,_0x370cbf){return _0x4554f8[_0x907c('0xc')](_0x907c('0xd'),attributes,{'tableName':_0x907c('0xe'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x907c('0xf'),_0x907c('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ba6=['define','ZohoField','zoho_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZohoField.attributes'];(function(_0x58ee96,_0x5affd5){var _0xb346aa=function(_0x245b1a){while(--_0x245b1a){_0x58ee96['push'](_0x58ee96['shift']());}};_0xb346aa(++_0x5affd5);}(_0x7ba6,0x115));var _0x67ba=function(_0x3ff725,_0xe1c308){_0x3ff725=_0x3ff725-0x0;var _0x529c19=_0x7ba6[_0x3ff725];return _0x529c19;};'use strict';var _=require(_0x67ba('0x0'));var util=require(_0x67ba('0x1'));var logger=require(_0x67ba('0x2'))(_0x67ba('0x3'));var moment=require('moment');var BPromise=require(_0x67ba('0x4'));var rp=require(_0x67ba('0x5'));var fs=require('fs');var path=require(_0x67ba('0x6'));var rimraf=require(_0x67ba('0x7'));var config=require('../../config/environment');var attributes=require(_0x67ba('0x8'));module['exports']=function(_0x4aa69f,_0x5d7feb){return _0x4aa69f[_0x67ba('0x9')](_0x67ba('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x67ba('0xb'),'fields':[_0x67ba('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 992dc55..3807180 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 _0x2d17=['ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1f404a,_0x5088b2){var _0x2cdcd5=function(_0xe30d8c){while(--_0xe30d8c){_0x1f404a['push'](_0x1f404a['shift']());}};_0x2cdcd5(++_0x5088b2);}(_0x2d17,0x17e));var _0x72d1=function(_0x57db93,_0x49661b){_0x57db93=_0x57db93-0x0;var _0x130f35=_0x2d17[_0x57db93];return _0x130f35;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){return client['request'](_0x239d1f,_0x477264)[_0x72d1('0x9')](function(_0x288362){logger[_0x72d1('0xa')]('ZohoField,\x20%s,\x20%s',_0x5b40a9,_0x72d1('0xb'));logger[_0x72d1('0xc')](_0x72d1('0xd'),_0x5b40a9,_0x72d1('0xb'),JSON[_0x72d1('0xe')](_0x288362));if(_0x288362[_0x72d1('0xf')]){if(_0x288362[_0x72d1('0xf')][_0x72d1('0x10')]===0x1f4){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362['error'][_0x72d1('0x12')]);return _0x19e248(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);return _0x422f5a(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}else{logger[_0x72d1('0xa')](_0x72d1('0x11'),_0x5b40a9,_0x72d1('0xb'));_0x422f5a(_0x288362[_0x72d1('0x13')]['message']);}})[_0x72d1('0x14')](function(_0x5262b0){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x5262b0);_0x19e248(_0x5262b0);});});} \ No newline at end of file +var _0x032e=['code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x6ae9e6,_0x23ac45){var _0x4c2511=function(_0x3729f2){while(--_0x3729f2){_0x6ae9e6['push'](_0x6ae9e6['shift']());}};_0x4c2511(++_0x23ac45);}(_0x032e,0x124));var _0xe032=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x032e[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37432f,_0x1576c8,_0x3289b0){return new BPromise(function(_0xd84027,_0xaf3907){return client[_0xe032('0xb')](_0x37432f,_0x3289b0)[_0xe032('0xc')](function(_0x2d8a14){logger[_0xe032('0xd')](_0xe032('0xe'),_0x1576c8,'request\x20sent');logger[_0xe032('0xf')](_0xe032('0x10'),_0x1576c8,_0xe032('0x11'),JSON[_0xe032('0x12')](_0x2d8a14));if(_0x2d8a14[_0xe032('0x13')]){if(_0x2d8a14[_0xe032('0x13')][_0xe032('0x14')]===0x1f4){logger['error'](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xaf3907(_0x2d8a14[_0xe032('0x13')]['message']);}logger[_0xe032('0x13')](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xd84027(_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);}else{logger[_0xe032('0xd')]('ZohoField,\x20%s,\x20%s',_0x1576c8,_0xe032('0x11'));_0xd84027(_0x2d8a14[_0xe032('0x16')][_0xe032('0x15')]);}})[_0xe032('0x17')](function(_0x1938c4){logger[_0xe032('0x13')]('ZohoField,\x20%s,\x20%s',_0x1576c8,_0x1938c4);_0xaf3907(_0x1938c4);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index dc0a88b..3183ff3 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 _0x2c91=['../../components/auth/service','../../config/environment','util','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c91,0xe0));var _0x12c9=function(_0x3e1ec5,_0x2a695f){_0x3e1ec5=_0x3e1ec5-0x0;var _0x1118cf=_0x2c91[_0x3e1ec5];return _0x1118cf;};'use strict';var multer=require('multer');var util=require(_0x12c9('0x0'));var path=require('path');var timeout=require(_0x12c9('0x1'));var express=require(_0x12c9('0x2'));var router=express[_0x12c9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x12c9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x12c9('0x5'));module['exports']=router; \ No newline at end of file +var _0xc584=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x329f42,_0x2de7e7){var _0x3618f0=function(_0xf18f87){while(--_0xf18f87){_0x329f42['push'](_0x329f42['shift']());}};_0x3618f0(++_0x2de7e7);}(_0xc584,0xa8));var _0x4c58=function(_0x4cf8d4,_0x5aee73){_0x4cf8d4=_0x4cf8d4-0x0;var _0x2c1beb=_0xc584[_0x4cf8d4];return _0x2c1beb;};'use strict';var multer=require('multer');var util=require(_0x4c58('0x0'));var path=require(_0x4c58('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c58('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4c58('0x3'));var interaction=require(_0x4c58('0x4'));var config=require(_0x4c58('0x5'));module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 4ff7e0d..8afb56e 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 _0x5a9a=['INTEGER','BOOLEAN','sequelize','exports','unique_name_and_version','STRING','app.js'];(function(_0x18f8d3,_0x55bac8){var _0x46d055=function(_0x202721){while(--_0x202721){_0x18f8d3['push'](_0x18f8d3['shift']());}};_0x46d055(++_0x55bac8);}(_0x5a9a,0x9c));var _0xa5a9=function(_0x2f0e9c,_0x369f99){_0x2f0e9c=_0x2f0e9c-0x0;var _0x304209=_0x5a9a[_0x2f0e9c];return _0x304209;};'use strict';var Sequelize=require(_0xa5a9('0x0'));module[_0xa5a9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa5a9('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa5a9('0x2')},'main':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':_0xa5a9('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xa5a9('0x3')]},'type':{'type':Sequelize[_0xa5a9('0x3')]},'size':{'type':Sequelize[_0xa5a9('0x5')]},'active':{'type':Sequelize[_0xa5a9('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xa5a9('0x3')]},'state':{'type':Sequelize[_0xa5a9('0x3')],'unique':'state'},'description':{'type':Sequelize[_0xa5a9('0x3')]},'title':{'type':Sequelize[_0xa5a9('0x3')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xa5a9('0x3')],'defaultValue':'#'}}; \ No newline at end of file +var _0x98dc=['state','sequelize','exports','unique_name_and_version','STRING','app.js','INTEGER','BOOLEAN'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x98dc,0x171));var _0xc98d=function(_0x149ea5,_0x181c89){_0x149ea5=_0x149ea5-0x0;var _0x4aa47c=_0x98dc[_0x149ea5];return _0x4aa47c;};'use strict';var Sequelize=require(_0xc98d('0x0'));module[_0xc98d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc98d('0x2')},'version':{'type':Sequelize[_0xc98d('0x3')],'allowNull':![],'unique':_0xc98d('0x2')},'main':{'type':Sequelize[_0xc98d('0x3')],'defaultValue':_0xc98d('0x4')},'filename':{'type':Sequelize[_0xc98d('0x3')]},'path':{'type':Sequelize[_0xc98d('0x3')]},'type':{'type':Sequelize[_0xc98d('0x3')]},'size':{'type':Sequelize[_0xc98d('0x5')]},'active':{'type':Sequelize[_0xc98d('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xc98d('0x3')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xc98d('0x3')],'unique':_0xc98d('0x7')},'description':{'type':Sequelize[_0xc98d('0x3')]},'title':{'type':Sequelize[_0xc98d('0x3')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xc98d('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 189536b..bab32ca 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 _0xc694=['limit','set','Content-Range','json','apply','reject','sendStatus','error','stack','name','map','Integration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','then','includeAll','include','catch','show','params','keys','find','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','count'];(function(_0x1b6294,_0x179c76){var _0x43335a=function(_0x238a23){while(--_0x238a23){_0x1b6294['push'](_0x1b6294['shift']());}};_0x43335a(++_0x179c76);}(_0xc694,0x1da));var _0x4c69=function(_0x3e8cae,_0x4cb96a){_0x3e8cae=_0x3e8cae-0x0;var _0x45c4d6=_0xc694[_0x3e8cae];return _0x45c4d6;};'use strict';var emlformat=require(_0x4c69('0x0'));var rimraf=require(_0x4c69('0x1'));var zipdir=require(_0x4c69('0x2'));var jsonpatch=require(_0x4c69('0x3'));var rp=require(_0x4c69('0x4'));var moment=require('moment');var BPromise=require(_0x4c69('0x5'));var Mustache=require(_0x4c69('0x6'));var util=require(_0x4c69('0x7'));var path=require(_0x4c69('0x8'));var sox=require(_0x4c69('0x9'));var csv=require(_0x4c69('0xa'));var ejs=require(_0x4c69('0xb'));var fs=require('fs');var fs_extra=require(_0x4c69('0xc'));var _=require('lodash');var squel=require(_0x4c69('0xd'));var crypto=require('crypto');var jsforce=require(_0x4c69('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4c69('0xa'));var querystring=require(_0x4c69('0xf'));var Papa=require('papaparse');var Redis=require(_0x4c69('0x10'));var authService=require(_0x4c69('0x11'));var qs=require(_0x4c69('0x12'));var as=require(_0x4c69('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c69('0x14'))(_0x4c69('0x15'));var utils=require(_0x4c69('0x16'));var config=require(_0x4c69('0x17'));var licenseUtil=require(_0x4c69('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x435e4a,_0x1ce35f){_0x1ce35f=_0x1ce35f||0xcc;return function(_0x16e965){if(_0x16e965){return _0x435e4a['sendStatus'](_0x1ce35f);}return _0x435e4a[_0x4c69('0x19')](_0x1ce35f)[_0x4c69('0x1a')]();};}function respondWithResult(_0x4e38bd,_0x34df9e){_0x34df9e=_0x34df9e||0xc8;return function(_0x1aa3b6){if(_0x1aa3b6){return _0x4e38bd[_0x4c69('0x19')](_0x34df9e)['json'](_0x1aa3b6);}};}function respondWithFilteredResult(_0xa54050,_0x5eed13){return function(_0x47f1fa){if(_0x47f1fa){var _0x512cee=typeof _0x5eed13[_0x4c69('0x1b')]===_0x4c69('0x1c')&&typeof _0x5eed13['limit']===_0x4c69('0x1c');var _0x36cf56=_0x47f1fa[_0x4c69('0x1d')];var _0x574af3=_0x512cee?0x0:_0x5eed13['offset'];var _0x24570a=_0x512cee?_0x47f1fa[_0x4c69('0x1d')]:_0x5eed13[_0x4c69('0x1b')]+_0x5eed13[_0x4c69('0x1e')];var _0x4eb4c4;if(_0x24570a>=_0x36cf56){_0x24570a=_0x36cf56;_0x4eb4c4=0xc8;}else{_0x4eb4c4=0xce;}_0xa54050['status'](_0x4eb4c4);return _0xa54050[_0x4c69('0x1f')](_0x4c69('0x20'),_0x574af3+'-'+_0x24570a+'/'+_0x36cf56)[_0x4c69('0x21')](_0x47f1fa);}return null;};}function patchUpdates(_0x286783){return function(_0x532edf){try{jsonpatch[_0x4c69('0x22')](_0x532edf,_0x286783,!![]);}catch(_0x5bd874){return BPromise[_0x4c69('0x23')](_0x5bd874);}return _0x532edf['save']();};}function saveUpdates(_0x873bd5,_0xa4995f){return function(_0x2eba82){if(_0x2eba82){return _0x2eba82['update'](_0x873bd5)['then'](function(_0x46ef3d){return _0x46ef3d;});}return null;};}function removeEntity(_0x2b0a57,_0x182f39){return function(_0xd6d3b9){if(_0xd6d3b9){return _0xd6d3b9['destroy']()['then'](function(){_0x2b0a57[_0x4c69('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48f7ee,_0xf5845){return function(_0x15f2ac){if(!_0x15f2ac){_0x48f7ee[_0x4c69('0x24')](0x194);}return _0x15f2ac;};}function handleError(_0xfbd7f8,_0x16d044){_0x16d044=_0x16d044||0x1f4;return function(_0x1ec7d8){logger[_0x4c69('0x25')](_0x1ec7d8[_0x4c69('0x26')]);if(_0x1ec7d8[_0x4c69('0x27')]){delete _0x1ec7d8[_0x4c69('0x27')];}_0xfbd7f8[_0x4c69('0x19')](_0x16d044)['send'](_0x1ec7d8);};}exports['index']=function(_0x389015,_0x5ade99){var _0x40bd83={},_0x515273={},_0x2357da={'count':0x0,'rows':[]};var _0x354211=_[_0x4c69('0x28')](db[_0x4c69('0x29')][_0x4c69('0x2a')],function(_0x5085aa){return{'name':_0x5085aa[_0x4c69('0x2b')],'type':_0x5085aa[_0x4c69('0x2c')][_0x4c69('0x2d')]};});_0x515273['model']=_[_0x4c69('0x28')](_0x354211,_0x4c69('0x27'));_0x515273[_0x4c69('0x2e')]=_['keys'](_0x389015[_0x4c69('0x2e')]);_0x515273[_0x4c69('0x2f')]=_[_0x4c69('0x30')](_0x515273[_0x4c69('0x31')],_0x515273[_0x4c69('0x2e')]);_0x40bd83[_0x4c69('0x32')]=_[_0x4c69('0x30')](_0x515273['model'],qs[_0x4c69('0x33')](_0x389015[_0x4c69('0x2e')][_0x4c69('0x33')]));_0x40bd83[_0x4c69('0x32')]=_0x40bd83[_0x4c69('0x32')][_0x4c69('0x34')]?_0x40bd83[_0x4c69('0x32')]:_0x515273[_0x4c69('0x31')];if(!_0x389015[_0x4c69('0x2e')][_0x4c69('0x35')]('nolimit')){_0x40bd83['limit']=qs['limit'](_0x389015[_0x4c69('0x2e')]['limit']);_0x40bd83[_0x4c69('0x1b')]=qs['offset'](_0x389015[_0x4c69('0x2e')][_0x4c69('0x1b')]);}_0x40bd83['order']=qs['sort'](_0x389015[_0x4c69('0x2e')][_0x4c69('0x36')]);_0x40bd83[_0x4c69('0x37')]=qs[_0x4c69('0x2f')](_[_0x4c69('0x38')](_0x389015[_0x4c69('0x2e')],_0x515273[_0x4c69('0x2f')]),_0x354211);if(_0x389015[_0x4c69('0x2e')]['filter']){_0x40bd83[_0x4c69('0x37')]=_[_0x4c69('0x39')](_0x40bd83[_0x4c69('0x37')],{'$or':_[_0x4c69('0x28')](_0x354211,function(_0x144196){if(_0x144196['type']!=='VIRTUAL'){var _0x5403ea={};_0x5403ea[_0x144196[_0x4c69('0x27')]]={'$like':'%'+_0x389015[_0x4c69('0x2e')][_0x4c69('0x3a')]+'%'};return _0x5403ea;}})});}_0x40bd83=_[_0x4c69('0x39')]({},_0x40bd83,_0x389015[_0x4c69('0x3b')]);var _0x5a1abe={'where':_0x40bd83[_0x4c69('0x37')]};return db[_0x4c69('0x29')][_0x4c69('0x1d')](_0x5a1abe)[_0x4c69('0x3c')](function(_0x48c6cb){_0x2357da[_0x4c69('0x1d')]=_0x48c6cb;if(_0x389015['query'][_0x4c69('0x3d')]){_0x40bd83[_0x4c69('0x3e')]=[{'all':!![]}];}return db[_0x4c69('0x29')]['findAll'](_0x40bd83);})[_0x4c69('0x3c')](function(_0x451be4){_0x2357da['rows']=_0x451be4;return _0x2357da;})['then'](respondWithFilteredResult(_0x5ade99,_0x40bd83))[_0x4c69('0x3f')](handleError(_0x5ade99,null));};exports[_0x4c69('0x40')]=function(_0x473aed,_0x3b3983){var _0x5ba699={'raw':![],'where':{'id':_0x473aed[_0x4c69('0x41')]['id']}},_0x4747e9={};_0x4747e9[_0x4c69('0x31')]=_[_0x4c69('0x42')](db[_0x4c69('0x29')][_0x4c69('0x2a')]);_0x4747e9['query']=_[_0x4c69('0x42')](_0x473aed['query']);_0x4747e9[_0x4c69('0x2f')]=_['intersection'](_0x4747e9['model'],_0x4747e9['query']);_0x5ba699[_0x4c69('0x32')]=_['intersection'](_0x4747e9['model'],qs['fields'](_0x473aed[_0x4c69('0x2e')][_0x4c69('0x33')]));_0x5ba699[_0x4c69('0x32')]=_0x5ba699[_0x4c69('0x32')]['length']?_0x5ba699[_0x4c69('0x32')]:_0x4747e9['model'];if(_0x473aed[_0x4c69('0x2e')][_0x4c69('0x3d')]){_0x5ba699[_0x4c69('0x3e')]=[{'all':!![]}];}_0x5ba699=_['merge']({},_0x5ba699,_0x473aed[_0x4c69('0x3b')]);return db[_0x4c69('0x29')][_0x4c69('0x43')](_0x5ba699)[_0x4c69('0x3c')](handleEntityNotFound(_0x3b3983,null))['then'](respondWithResult(_0x3b3983,null))[_0x4c69('0x3f')](handleError(_0x3b3983,null));};exports[_0x4c69('0x44')]=function(_0x57cfd7,_0x2b843b){return db['Integration'][_0x4c69('0x44')](_0x57cfd7['body'],{})['then'](respondWithResult(_0x2b843b,0xc9))[_0x4c69('0x3f')](handleError(_0x2b843b,null));};exports[_0x4c69('0x45')]=function(_0x123ac1,_0xa99955){if(_0x123ac1[_0x4c69('0x46')]['id']){delete _0x123ac1[_0x4c69('0x46')]['id'];}return db['Integration'][_0x4c69('0x43')]({'where':{'id':_0x123ac1[_0x4c69('0x41')]['id']}})[_0x4c69('0x3c')](handleEntityNotFound(_0xa99955,null))[_0x4c69('0x3c')](saveUpdates(_0x123ac1[_0x4c69('0x46')],null))[_0x4c69('0x3c')](respondWithResult(_0xa99955,null))['catch'](handleError(_0xa99955,null));};exports[_0x4c69('0x47')]=function(_0x328895,_0xd87bb4){return db[_0x4c69('0x29')][_0x4c69('0x43')]({'where':{'id':_0x328895[_0x4c69('0x41')]['id']}})[_0x4c69('0x3c')](handleEntityNotFound(_0xd87bb4,null))[_0x4c69('0x3c')](removeEntity(_0xd87bb4,null))[_0x4c69('0x3f')](handleError(_0xd87bb4,null));}; \ No newline at end of file +var _0xc4e5=['fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','include','findAll','rows','catch','show','params','keys','intersection','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','filters','attributes'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xc4e5,0x1c5));var _0x5c4e=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0xc4e5[_0x18d631];return _0x50d708;};'use strict';var emlformat=require(_0x5c4e('0x0'));var rimraf=require(_0x5c4e('0x1'));var zipdir=require(_0x5c4e('0x2'));var jsonpatch=require(_0x5c4e('0x3'));var rp=require(_0x5c4e('0x4'));var moment=require('moment');var BPromise=require(_0x5c4e('0x5'));var Mustache=require(_0x5c4e('0x6'));var util=require('util');var path=require(_0x5c4e('0x7'));var sox=require(_0x5c4e('0x8'));var csv=require(_0x5c4e('0x9'));var ejs=require(_0x5c4e('0xa'));var fs=require('fs');var fs_extra=require(_0x5c4e('0xb'));var _=require('lodash');var squel=require(_0x5c4e('0xc'));var crypto=require(_0x5c4e('0xd'));var jsforce=require(_0x5c4e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5c4e('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5c4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c4e('0x10'))(_0x5c4e('0x11'));var utils=require(_0x5c4e('0x12'));var config=require(_0x5c4e('0x13'));var licenseUtil=require(_0x5c4e('0x14'));var db=require(_0x5c4e('0x15'))['db'];function respondWithStatusCode(_0x25b51a,_0x2c7a2a){_0x2c7a2a=_0x2c7a2a||0xcc;return function(_0x41a78c){if(_0x41a78c){return _0x25b51a[_0x5c4e('0x16')](_0x2c7a2a);}return _0x25b51a[_0x5c4e('0x17')](_0x2c7a2a)['end']();};}function respondWithResult(_0x551851,_0x598ae5){_0x598ae5=_0x598ae5||0xc8;return function(_0x384984){if(_0x384984){return _0x551851['status'](_0x598ae5)['json'](_0x384984);}};}function respondWithFilteredResult(_0x3e069f,_0x29c991){return function(_0x7de481){if(_0x7de481){var _0xb7c851=typeof _0x29c991[_0x5c4e('0x18')]===_0x5c4e('0x19')&&typeof _0x29c991['limit']===_0x5c4e('0x19');var _0x1b039c=_0x7de481[_0x5c4e('0x1a')];var _0x2962c7=_0xb7c851?0x0:_0x29c991[_0x5c4e('0x18')];var _0x64f2f=_0xb7c851?_0x7de481['count']:_0x29c991['offset']+_0x29c991[_0x5c4e('0x1b')];var _0x15b9a0;if(_0x64f2f>=_0x1b039c){_0x64f2f=_0x1b039c;_0x15b9a0=0xc8;}else{_0x15b9a0=0xce;}_0x3e069f['status'](_0x15b9a0);return _0x3e069f[_0x5c4e('0x1c')](_0x5c4e('0x1d'),_0x2962c7+'-'+_0x64f2f+'/'+_0x1b039c)['json'](_0x7de481);}return null;};}function patchUpdates(_0x3f7e0e){return function(_0x21ca7b){try{jsonpatch[_0x5c4e('0x1e')](_0x21ca7b,_0x3f7e0e,!![]);}catch(_0x42f309){return BPromise[_0x5c4e('0x1f')](_0x42f309);}return _0x21ca7b[_0x5c4e('0x20')]();};}function saveUpdates(_0x281847,_0x15bacb){return function(_0x5cbdfa){if(_0x5cbdfa){return _0x5cbdfa[_0x5c4e('0x21')](_0x281847)[_0x5c4e('0x22')](function(_0x4b29f4){return _0x4b29f4;});}return null;};}function removeEntity(_0x5db2dd,_0x14703d){return function(_0xb03e96){if(_0xb03e96){return _0xb03e96[_0x5c4e('0x23')]()[_0x5c4e('0x22')](function(){_0x5db2dd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b7897,_0x3cd925){return function(_0x28189d){if(!_0x28189d){_0x1b7897[_0x5c4e('0x16')](0x194);}return _0x28189d;};}function handleError(_0x53f3e5,_0x169a43){_0x169a43=_0x169a43||0x1f4;return function(_0x2431a6){logger[_0x5c4e('0x24')](_0x2431a6[_0x5c4e('0x25')]);if(_0x2431a6[_0x5c4e('0x26')]){delete _0x2431a6[_0x5c4e('0x26')];}_0x53f3e5[_0x5c4e('0x17')](_0x169a43)[_0x5c4e('0x27')](_0x2431a6);};}exports[_0x5c4e('0x28')]=function(_0x283793,_0x55faf7){var _0x4126b0={},_0xd42be1={},_0xc41335={'count':0x0,'rows':[]};var _0x37d08a=_[_0x5c4e('0x29')](db[_0x5c4e('0x2a')][_0x5c4e('0x2b')],function(_0x435041){return{'name':_0x435041[_0x5c4e('0x2c')],'type':_0x435041[_0x5c4e('0x2d')][_0x5c4e('0x2e')]};});_0xd42be1[_0x5c4e('0x2f')]=_[_0x5c4e('0x29')](_0x37d08a,'name');_0xd42be1[_0x5c4e('0x30')]=_['keys'](_0x283793[_0x5c4e('0x30')]);_0xd42be1[_0x5c4e('0x31')]=_['intersection'](_0xd42be1[_0x5c4e('0x2f')],_0xd42be1['query']);_0x4126b0[_0x5c4e('0x32')]=_['intersection'](_0xd42be1['model'],qs[_0x5c4e('0x33')](_0x283793[_0x5c4e('0x30')][_0x5c4e('0x33')]));_0x4126b0[_0x5c4e('0x32')]=_0x4126b0[_0x5c4e('0x32')][_0x5c4e('0x34')]?_0x4126b0[_0x5c4e('0x32')]:_0xd42be1['model'];if(!_0x283793[_0x5c4e('0x30')][_0x5c4e('0x35')]('nolimit')){_0x4126b0['limit']=qs['limit'](_0x283793['query'][_0x5c4e('0x1b')]);_0x4126b0[_0x5c4e('0x18')]=qs[_0x5c4e('0x18')](_0x283793[_0x5c4e('0x30')][_0x5c4e('0x18')]);}_0x4126b0[_0x5c4e('0x36')]=qs[_0x5c4e('0x37')](_0x283793[_0x5c4e('0x30')]['sort']);_0x4126b0[_0x5c4e('0x38')]=qs[_0x5c4e('0x31')](_[_0x5c4e('0x39')](_0x283793[_0x5c4e('0x30')],_0xd42be1[_0x5c4e('0x31')]),_0x37d08a);if(_0x283793[_0x5c4e('0x30')]['filter']){_0x4126b0[_0x5c4e('0x38')]=_[_0x5c4e('0x3a')](_0x4126b0[_0x5c4e('0x38')],{'$or':_[_0x5c4e('0x29')](_0x37d08a,function(_0x27e7bb){if(_0x27e7bb[_0x5c4e('0x2d')]!=='VIRTUAL'){var _0x4df1d6={};_0x4df1d6[_0x27e7bb[_0x5c4e('0x26')]]={'$like':'%'+_0x283793[_0x5c4e('0x30')][_0x5c4e('0x3b')]+'%'};return _0x4df1d6;}})});}_0x4126b0=_[_0x5c4e('0x3a')]({},_0x4126b0,_0x283793['options']);var _0x2f09b4={'where':_0x4126b0[_0x5c4e('0x38')]};return db[_0x5c4e('0x2a')][_0x5c4e('0x1a')](_0x2f09b4)[_0x5c4e('0x22')](function(_0x1cf93d){_0xc41335[_0x5c4e('0x1a')]=_0x1cf93d;if(_0x283793[_0x5c4e('0x30')]['includeAll']){_0x4126b0[_0x5c4e('0x3c')]=[{'all':!![]}];}return db[_0x5c4e('0x2a')][_0x5c4e('0x3d')](_0x4126b0);})['then'](function(_0x3f5a27){_0xc41335[_0x5c4e('0x3e')]=_0x3f5a27;return _0xc41335;})[_0x5c4e('0x22')](respondWithFilteredResult(_0x55faf7,_0x4126b0))[_0x5c4e('0x3f')](handleError(_0x55faf7,null));};exports[_0x5c4e('0x40')]=function(_0x729e0c,_0x322167){var _0x3a9de0={'raw':![],'where':{'id':_0x729e0c[_0x5c4e('0x41')]['id']}},_0x3dfebf={};_0x3dfebf[_0x5c4e('0x2f')]=_[_0x5c4e('0x42')](db['Integration'][_0x5c4e('0x2b')]);_0x3dfebf[_0x5c4e('0x30')]=_[_0x5c4e('0x42')](_0x729e0c[_0x5c4e('0x30')]);_0x3dfebf['filters']=_[_0x5c4e('0x43')](_0x3dfebf[_0x5c4e('0x2f')],_0x3dfebf[_0x5c4e('0x30')]);_0x3a9de0[_0x5c4e('0x32')]=_['intersection'](_0x3dfebf['model'],qs[_0x5c4e('0x33')](_0x729e0c[_0x5c4e('0x30')][_0x5c4e('0x33')]));_0x3a9de0['attributes']=_0x3a9de0[_0x5c4e('0x32')][_0x5c4e('0x34')]?_0x3a9de0[_0x5c4e('0x32')]:_0x3dfebf[_0x5c4e('0x2f')];if(_0x729e0c[_0x5c4e('0x30')]['includeAll']){_0x3a9de0[_0x5c4e('0x3c')]=[{'all':!![]}];}_0x3a9de0=_[_0x5c4e('0x3a')]({},_0x3a9de0,_0x729e0c[_0x5c4e('0x44')]);return db[_0x5c4e('0x2a')][_0x5c4e('0x45')](_0x3a9de0)[_0x5c4e('0x22')](handleEntityNotFound(_0x322167,null))[_0x5c4e('0x22')](respondWithResult(_0x322167,null))[_0x5c4e('0x3f')](handleError(_0x322167,null));};exports[_0x5c4e('0x46')]=function(_0x5d3faa,_0x5beafa){return db[_0x5c4e('0x2a')][_0x5c4e('0x46')](_0x5d3faa[_0x5c4e('0x47')],{})[_0x5c4e('0x22')](respondWithResult(_0x5beafa,0xc9))[_0x5c4e('0x3f')](handleError(_0x5beafa,null));};exports[_0x5c4e('0x21')]=function(_0x1c479b,_0xe978f9){if(_0x1c479b[_0x5c4e('0x47')]['id']){delete _0x1c479b[_0x5c4e('0x47')]['id'];}return db['Integration'][_0x5c4e('0x45')]({'where':{'id':_0x1c479b[_0x5c4e('0x41')]['id']}})[_0x5c4e('0x22')](handleEntityNotFound(_0xe978f9,null))[_0x5c4e('0x22')](saveUpdates(_0x1c479b[_0x5c4e('0x47')],null))[_0x5c4e('0x22')](respondWithResult(_0xe978f9,null))['catch'](handleError(_0xe978f9,null));};exports[_0x5c4e('0x23')]=function(_0x1f355a,_0x306191){return db[_0x5c4e('0x2a')][_0x5c4e('0x45')]({'where':{'id':_0x1f355a[_0x5c4e('0x41')]['id']}})['then'](handleEntityNotFound(_0x306191,null))[_0x5c4e('0x22')](removeEntity(_0x306191,null))[_0x5c4e('0x3f')](handleError(_0x306191,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index aa3b896..b73f8b9 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 _0xfe82=['request-promise','path','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api','bluebird'];(function(_0x315aa8,_0x15a9ba){var _0x431d49=function(_0x30aa5a){while(--_0x30aa5a){_0x315aa8['push'](_0x315aa8['shift']());}};_0x431d49(++_0x15a9ba);}(_0xfe82,0x14b));var _0x2fe8=function(_0x449d22,_0x4b1fe4){_0x449d22=_0x449d22-0x0;var _0x5dabb1=_0xfe82[_0x449d22];return _0x5dabb1;};'use strict';var _=require(_0x2fe8('0x0'));var util=require(_0x2fe8('0x1'));var logger=require(_0x2fe8('0x2'))(_0x2fe8('0x3'));var moment=require('moment');var BPromise=require(_0x2fe8('0x4'));var rp=require(_0x2fe8('0x5'));var fs=require('fs');var path=require(_0x2fe8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2fe8('0x7'));module[_0x2fe8('0x8')]=function(_0x50574b,_0x21c361){return _0x50574b[_0x2fe8('0x9')](_0x2fe8('0xa'),attributes,{'tableName':_0x2fe8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd64=['path','../../config/environment','define','Integration','integrations','lodash','../../config/logger','api'];(function(_0x88484d,_0x4c302b){var _0x5f26df=function(_0x56c552){while(--_0x56c552){_0x88484d['push'](_0x88484d['shift']());}};_0x5f26df(++_0x4c302b);}(_0xcd64,0x1a5));var _0x4cd6=function(_0x52774c,_0x5e47ba){_0x52774c=_0x52774c-0x0;var _0x1d58c3=_0xcd64[_0x52774c];return _0x1d58c3;};'use strict';var _=require(_0x4cd6('0x0'));var util=require('util');var logger=require(_0x4cd6('0x1'))(_0x4cd6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4cd6('0x3'));var rimraf=require('rimraf');var config=require(_0x4cd6('0x4'));var attributes=require('./integration.attributes');module['exports']=function(_0x3ce1d1,_0x3e4918){return _0x3ce1d1[_0x4cd6('0x5')](_0x4cd6('0x6'),attributes,{'tableName':_0x4cd6('0x7'),'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 e21b79f..9e5a289 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 _0x653d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x653d,0x133));var _0xd653=function(_0x379a70,_0x367de6){_0x379a70=_0x379a70-0x0;var _0x3ddaa4=_0x653d[_0x379a70];return _0x3ddaa4;};'use strict';var _=require('lodash');var util=require(_0xd653('0x0'));var moment=require(_0xd653('0x1'));var BPromise=require(_0xd653('0x2'));var rs=require(_0xd653('0x3'));var fs=require('fs');var Redis=require(_0xd653('0x4'));var db=require(_0xd653('0x5'))['db'];var utils=require(_0xd653('0x6'));var logger=require(_0xd653('0x7'))(_0xd653('0x8'));var config=require(_0xd653('0x9'));var jayson=require(_0xd653('0xa'));var client=jayson[_0xd653('0xb')][_0xd653('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2bf7a1,_0x490041,_0x5cbb43){return new BPromise(function(_0x378ba9,_0x5b46f9){return client[_0xd653('0xd')](_0x2bf7a1,_0x5cbb43)[_0xd653('0xe')](function(_0x5234e0){logger[_0xd653('0xf')](_0xd653('0x10'),_0x490041,_0xd653('0x11'));logger['debug'](_0xd653('0x12'),_0x490041,'request\x20sent',JSON[_0xd653('0x13')](_0x5234e0));if(_0x5234e0[_0xd653('0x14')]){if(_0x5234e0[_0xd653('0x14')][_0xd653('0x15')]===0x1f4){logger[_0xd653('0x14')](_0xd653('0x10'),_0x490041,_0x5234e0[_0xd653('0x14')]['message']);return _0x5b46f9(_0x5234e0['error'][_0xd653('0x16')]);}logger[_0xd653('0x14')](_0xd653('0x10'),_0x490041,_0x5234e0[_0xd653('0x14')][_0xd653('0x16')]);return _0x378ba9(_0x5234e0[_0xd653('0x14')]['message']);}else{logger['info']('Integration,\x20%s,\x20%s',_0x490041,_0xd653('0x11'));_0x378ba9(_0x5234e0[_0xd653('0x17')][_0xd653('0x16')]);}})['catch'](function(_0x2a4d7f){logger[_0xd653('0x14')](_0xd653('0x10'),_0x490041,_0x2a4d7f);_0x5b46f9(_0x2a4d7f);});});} \ No newline at end of file +var _0x320e=['result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x53f707,_0x51a2f7){var _0x10a9f5=function(_0x14b513){while(--_0x14b513){_0x53f707['push'](_0x53f707['shift']());}};_0x10a9f5(++_0x51a2f7);}(_0x320e,0x8c));var _0xe320=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0x320e[_0x47568e];return _0x33815b;};'use strict';var _=require(_0xe320('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe320('0x1'));var fs=require('fs');var Redis=require(_0xe320('0x2'));var db=require(_0xe320('0x3'))['db'];var utils=require(_0xe320('0x4'));var logger=require('../../config/logger')(_0xe320('0x5'));var config=require(_0xe320('0x6'));var jayson=require(_0xe320('0x7'));var client=jayson[_0xe320('0x8')][_0xe320('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x454fd8,_0x4d3c57,_0x3596d9){return new BPromise(function(_0x1da78a,_0x234d55){return client[_0xe320('0xa')](_0x454fd8,_0x3596d9)[_0xe320('0xb')](function(_0x13cabb){logger[_0xe320('0xc')](_0xe320('0xd'),_0x4d3c57,_0xe320('0xe'));logger[_0xe320('0xf')](_0xe320('0x10'),_0x4d3c57,_0xe320('0xe'),JSON[_0xe320('0x11')](_0x13cabb));if(_0x13cabb['error']){if(_0x13cabb[_0xe320('0x12')][_0xe320('0x13')]===0x1f4){logger[_0xe320('0x12')](_0xe320('0xd'),_0x4d3c57,_0x13cabb[_0xe320('0x12')][_0xe320('0x14')]);return _0x234d55(_0x13cabb[_0xe320('0x12')][_0xe320('0x14')]);}logger[_0xe320('0x12')](_0xe320('0xd'),_0x4d3c57,_0x13cabb[_0xe320('0x12')][_0xe320('0x14')]);return _0x1da78a(_0x13cabb[_0xe320('0x12')]['message']);}else{logger['info']('Integration,\x20%s,\x20%s',_0x4d3c57,_0xe320('0xe'));_0x1da78a(_0x13cabb[_0xe320('0x15')][_0xe320('0x14')]);}})[_0xe320('0x16')](function(_0x257467){logger[_0xe320('0x12')](_0xe320('0xd'),_0x4d3c57,_0x257467);_0x234d55(_0x257467);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 1eedfd7..33a6bc2 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 _0x69dc=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','show','post','create','put','isAuthenticated','update','delete','destroy'];(function(_0x2d1238,_0x444f4e){var _0x36c1a7=function(_0x20452f){while(--_0x20452f){_0x2d1238['push'](_0x2d1238['shift']());}};_0x36c1a7(++_0x444f4e);}(_0x69dc,0x1b9));var _0xc69d=function(_0x1e6bc2,_0x3c62f6){_0x1e6bc2=_0x1e6bc2-0x0;var _0x5bd7d8=_0x69dc[_0x1e6bc2];return _0x5bd7d8;};'use strict';var multer=require(_0xc69d('0x0'));var util=require(_0xc69d('0x1'));var path=require(_0xc69d('0x2'));var timeout=require(_0xc69d('0x3'));var express=require('express');var router=express[_0xc69d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc69d('0x5'));var interaction=require(_0xc69d('0x6'));var config=require(_0xc69d('0x7'));var controller=require('./integrationReport.controller');router[_0xc69d('0x8')]('/',auth['isAuthenticated'](),controller[_0xc69d('0x9')]);router['get'](_0xc69d('0xa'),auth['isAuthenticated'](),controller[_0xc69d('0xb')]);router[_0xc69d('0x8')](_0xc69d('0xc'),auth['isAuthenticated'](),controller[_0xc69d('0xd')]);router[_0xc69d('0xe')]('/',auth['isAuthenticated'](),controller[_0xc69d('0xf')]);router[_0xc69d('0x10')]('/:id',auth[_0xc69d('0x11')](),controller[_0xc69d('0x12')]);router[_0xc69d('0x13')](_0xc69d('0xc'),auth[_0xc69d('0x11')](),controller[_0xc69d('0x14')]);module[_0xc69d('0x15')]=router; \ No newline at end of file +var _0xbdb6=['isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./integrationReport.controller','get','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb6,0x199));var _0x6bdb=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0xbdb6[_0x441563];return _0x2369ec;};'use strict';var multer=require(_0x6bdb('0x0'));var util=require(_0x6bdb('0x1'));var path=require(_0x6bdb('0x2'));var timeout=require(_0x6bdb('0x3'));var express=require(_0x6bdb('0x4'));var router=express[_0x6bdb('0x5')]();var fs_extra=require(_0x6bdb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6bdb('0x7'));var config=require('../../config/environment');var controller=require(_0x6bdb('0x8'));router[_0x6bdb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6bdb('0x9')](_0x6bdb('0xa'),auth[_0x6bdb('0xb')](),controller[_0x6bdb('0xc')]);router[_0x6bdb('0x9')](_0x6bdb('0xd'),auth[_0x6bdb('0xb')](),controller['show']);router[_0x6bdb('0xe')]('/',auth[_0x6bdb('0xb')](),controller[_0x6bdb('0xf')]);router[_0x6bdb('0x10')](_0x6bdb('0xd'),auth[_0x6bdb('0xb')](),controller[_0x6bdb('0x11')]);router[_0x6bdb('0x12')]('/:id',auth[_0x6bdb('0xb')](),controller[_0x6bdb('0x13')]);module[_0x6bdb('0x14')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index e6fbb31..ff21066 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 _0xd82d=['SENDING','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x48c440,_0x3b2aee){var _0x32f4d8=function(_0x1601b2){while(--_0x1601b2){_0x48c440['push'](_0x48c440['shift']());}};_0x32f4d8(++_0x3b2aee);}(_0xd82d,0x65));var _0xdd82=function(_0x24eec7,_0x557292){_0x24eec7=_0x24eec7-0x0;var _0xa1ea56=_0xd82d[_0x24eec7];return _0xa1ea56;};'use strict';var Sequelize=require(_0xdd82('0x0'));module[_0xdd82('0x1')]={'integration':{'type':Sequelize[_0xdd82('0x2')]},'eventChannel':{'type':Sequelize[_0xdd82('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xdd82('0x2')]},'integrationId':{'type':Sequelize[_0xdd82('0x3')]},'contacts':{'type':Sequelize[_0xdd82('0x2')]},'uniqueid':{'type':Sequelize[_0xdd82('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdd82('0x2')]},'queue':{'type':Sequelize[_0xdd82('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xdd82('0x2')]},'agentcalledAt':{'type':Sequelize[_0xdd82('0x4')]},'agentconnectAt':{'type':Sequelize[_0xdd82('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xdd82('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xdd82('0x4')]},'talktime':{'type':Sequelize[_0xdd82('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xdd82('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xdd82('0x4')]},'agentdump':{'type':Sequelize[_0xdd82('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xdd82('0x4')]},'lastevent':{'type':Sequelize[_0xdd82('0x2')]},'channel':{'type':Sequelize[_0xdd82('0x2')]},'channelstate':{'type':Sequelize[_0xdd82('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdd82('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdd82('0x2')]},'connectedlinename':{'type':Sequelize[_0xdd82('0x2')]},'language':{'type':Sequelize[_0xdd82('0x2')]},'accountcode':{'type':Sequelize[_0xdd82('0x2')]},'context':{'type':Sequelize[_0xdd82('0x2')]},'exten':{'type':Sequelize[_0xdd82('0x2')]},'priority':{'type':Sequelize[_0xdd82('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdd82('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xdd82('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xdd82('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xdd82('0x2')]},'destlanguage':{'type':Sequelize[_0xdd82('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xdd82('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xdd82('0x2')]},'inReplyTo':{'type':Sequelize[_0xdd82('0x2')]},'subject':{'type':Sequelize[_0xdd82('0x2')]},'from':{'type':Sequelize[_0xdd82('0x2')]},'to':{'type':Sequelize[_0xdd82('0x2')]},'cc':{'type':Sequelize[_0xdd82('0x2')]},'attachment':{'type':Sequelize[_0xdd82('0x6')]},'html':{'type':Sequelize[_0xdd82('0x6')]},'text':{'type':Sequelize[_0xdd82('0x6')]},'status':{'type':Sequelize[_0xdd82('0x7')](_0xdd82('0x8'),_0xdd82('0x9'),'RECEIVED',_0xdd82('0xa'))},'url':{'type':Sequelize[_0xdd82('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xdd82('0x2')]},'projectId':{'type':Sequelize[_0xdd82('0x3')]}}; \ No newline at end of file +var _0xa674=['TEXT','ENUM','SENT','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x22cb92,_0x4b48d8){var _0x321931=function(_0x3a1796){while(--_0x3a1796){_0x22cb92['push'](_0x22cb92['shift']());}};_0x321931(++_0x4b48d8);}(_0xa674,0x12d));var _0x4a67=function(_0x1e47c7,_0x30e922){_0x1e47c7=_0x1e47c7-0x0;var _0xbf8e72=_0xa674[_0x1e47c7];return _0xbf8e72;};'use strict';var Sequelize=require('sequelize');module[_0x4a67('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x4a67('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x4a67('0x1')]},'integrationId':{'type':Sequelize[_0x4a67('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4a67('0x1')]},'calleridname':{'type':Sequelize[_0x4a67('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4a67('0x1')]},'membername':{'type':Sequelize[_0x4a67('0x1')]},'agentcalledAt':{'type':Sequelize[_0x4a67('0x3')]},'agentconnectAt':{'type':Sequelize[_0x4a67('0x3')]},'holdtime':{'type':Sequelize[_0x4a67('0x2')]},'agentcomplete':{'type':Sequelize[_0x4a67('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4a67('0x3')]},'talktime':{'type':Sequelize[_0x4a67('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x4a67('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4a67('0x3')]},'agentdump':{'type':Sequelize[_0x4a67('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4a67('0x3')]},'lastevent':{'type':Sequelize[_0x4a67('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x4a67('0x2')]},'channelstatedesc':{'type':Sequelize[_0x4a67('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x4a67('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4a67('0x1')]},'context':{'type':Sequelize[_0x4a67('0x1')]},'exten':{'type':Sequelize[_0x4a67('0x1')]},'priority':{'type':Sequelize[_0x4a67('0x1')]},'destchannel':{'type':Sequelize[_0x4a67('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x4a67('0x1')]},'destcalleridnum':{'type':Sequelize[_0x4a67('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x4a67('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4a67('0x1')]},'destcontext':{'type':Sequelize[_0x4a67('0x1')]},'destexten':{'type':Sequelize[_0x4a67('0x1')]},'destpriority':{'type':Sequelize[_0x4a67('0x1')]},'destuniqueid':{'type':Sequelize[_0x4a67('0x1')]},'messageId':{'type':Sequelize[_0x4a67('0x1')]},'inReplyTo':{'type':Sequelize[_0x4a67('0x1')]},'subject':{'type':Sequelize[_0x4a67('0x1')]},'from':{'type':Sequelize[_0x4a67('0x1')]},'to':{'type':Sequelize[_0x4a67('0x1')]},'cc':{'type':Sequelize[_0x4a67('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x4a67('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x4a67('0x6')](_0x4a67('0x7'),'SENDING','RECEIVED',_0x4a67('0x8'))},'url':{'type':Sequelize[_0x4a67('0x1')]},'app':{'type':Sequelize[_0x4a67('0x1')]},'appdata':{'type':Sequelize[_0x4a67('0x1')]},'projectId':{'type':Sequelize[_0x4a67('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index ff07295..9569693 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 _0x8c39=['squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','stack','name','IntegrationReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','catch','create','body','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra'];(function(_0xea587d,_0x3fc7e0){var _0x10c67c=function(_0x230823){while(--_0x230823){_0xea587d['push'](_0xea587d['shift']());}};_0x10c67c(++_0x3fc7e0);}(_0x8c39,0x1df));var _0x98c3=function(_0x378405,_0x14b3d7){_0x378405=_0x378405-0x0;var _0x5855a8=_0x8c39[_0x378405];return _0x5855a8;};'use strict';var emlformat=require(_0x98c3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x98c3('0x1'));var jsonpatch=require(_0x98c3('0x2'));var rp=require(_0x98c3('0x3'));var moment=require(_0x98c3('0x4'));var BPromise=require(_0x98c3('0x5'));var Mustache=require('mustache');var util=require(_0x98c3('0x6'));var path=require(_0x98c3('0x7'));var sox=require(_0x98c3('0x8'));var csv=require('to-csv');var ejs=require(_0x98c3('0x9'));var fs=require('fs');var fs_extra=require(_0x98c3('0xa'));var _=require('lodash');var squel=require(_0x98c3('0xb'));var crypto=require('crypto');var jsforce=require(_0x98c3('0xc'));var deskjs=require(_0x98c3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x98c3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x98c3('0xf'));var qs=require(_0x98c3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98c3('0x11'));var logger=require(_0x98c3('0x12'))(_0x98c3('0x13'));var utils=require(_0x98c3('0x14'));var config=require(_0x98c3('0x15'));var licenseUtil=require(_0x98c3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1eae01,_0x56c0e7){_0x56c0e7=_0x56c0e7||0xcc;return function(_0x9242a7){if(_0x9242a7){return _0x1eae01[_0x98c3('0x17')](_0x56c0e7);}return _0x1eae01[_0x98c3('0x18')](_0x56c0e7)[_0x98c3('0x19')]();};}function respondWithResult(_0x3c8000,_0x519666){_0x519666=_0x519666||0xc8;return function(_0x28b674){if(_0x28b674){return _0x3c8000[_0x98c3('0x18')](_0x519666)[_0x98c3('0x1a')](_0x28b674);}};}function respondWithFilteredResult(_0x31d89e,_0x555036){return function(_0x5a61c1){if(_0x5a61c1){var _0x238c26=typeof _0x555036['offset']===_0x98c3('0x1b')&&typeof _0x555036[_0x98c3('0x1c')]===_0x98c3('0x1b');var _0x99f9ce=_0x5a61c1[_0x98c3('0x1d')];var _0x3518fa=_0x238c26?0x0:_0x555036[_0x98c3('0x1e')];var _0x1ec557=_0x238c26?_0x5a61c1['count']:_0x555036[_0x98c3('0x1e')]+_0x555036['limit'];var _0x1cb944;if(_0x1ec557>=_0x99f9ce){_0x1ec557=_0x99f9ce;_0x1cb944=0xc8;}else{_0x1cb944=0xce;}_0x31d89e[_0x98c3('0x18')](_0x1cb944);return _0x31d89e['set'](_0x98c3('0x1f'),_0x3518fa+'-'+_0x1ec557+'/'+_0x99f9ce)['json'](_0x5a61c1);}return null;};}function patchUpdates(_0x3a0aa5){return function(_0x171dcf){try{jsonpatch[_0x98c3('0x20')](_0x171dcf,_0x3a0aa5,!![]);}catch(_0x4e63b7){return BPromise[_0x98c3('0x21')](_0x4e63b7);}return _0x171dcf[_0x98c3('0x22')]();};}function saveUpdates(_0x40da4c,_0x1ee8e6){return function(_0x21b284){if(_0x21b284){return _0x21b284['update'](_0x40da4c)[_0x98c3('0x23')](function(_0x1a8d24){return _0x1a8d24;});}return null;};}function removeEntity(_0x17a24,_0x365806){return function(_0x2ee5eb){if(_0x2ee5eb){return _0x2ee5eb['destroy']()[_0x98c3('0x23')](function(){_0x17a24[_0x98c3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29f9f7,_0x1d5985){return function(_0x13df06){if(!_0x13df06){_0x29f9f7[_0x98c3('0x17')](0x194);}return _0x13df06;};}function handleError(_0x27c548,_0x726e48){_0x726e48=_0x726e48||0x1f4;return function(_0x4aca0e){logger['error'](_0x4aca0e[_0x98c3('0x24')]);if(_0x4aca0e[_0x98c3('0x25')]){delete _0x4aca0e['name'];}_0x27c548[_0x98c3('0x18')](_0x726e48)['send'](_0x4aca0e);};}exports['index']=function(_0x26a939,_0xcec32b){var _0x5ee2ce={},_0x15822c={},_0x5ea272={'count':0x0,'rows':[]};var _0x4e88e5=_['map'](db[_0x98c3('0x26')][_0x98c3('0x27')],function(_0x339532){return{'name':_0x339532[_0x98c3('0x28')],'type':_0x339532[_0x98c3('0x29')][_0x98c3('0x2a')]};});_0x15822c[_0x98c3('0x2b')]=_[_0x98c3('0x2c')](_0x4e88e5,_0x98c3('0x25'));_0x15822c[_0x98c3('0x2d')]=_[_0x98c3('0x2e')](_0x26a939[_0x98c3('0x2d')]);_0x15822c[_0x98c3('0x2f')]=_[_0x98c3('0x30')](_0x15822c['model'],_0x15822c[_0x98c3('0x2d')]);_0x5ee2ce['attributes']=_[_0x98c3('0x30')](_0x15822c['model'],qs[_0x98c3('0x31')](_0x26a939['query'][_0x98c3('0x31')]));_0x5ee2ce[_0x98c3('0x32')]=_0x5ee2ce[_0x98c3('0x32')][_0x98c3('0x33')]?_0x5ee2ce['attributes']:_0x15822c[_0x98c3('0x2b')];if(!_0x26a939[_0x98c3('0x2d')][_0x98c3('0x34')]('nolimit')){_0x5ee2ce[_0x98c3('0x1c')]=qs['limit'](_0x26a939[_0x98c3('0x2d')][_0x98c3('0x1c')]);_0x5ee2ce['offset']=qs['offset'](_0x26a939['query'][_0x98c3('0x1e')]);}_0x5ee2ce[_0x98c3('0x35')]=qs['sort'](_0x26a939[_0x98c3('0x2d')]['sort']);_0x5ee2ce[_0x98c3('0x36')]=qs['filters'](_[_0x98c3('0x37')](_0x26a939['query'],_0x15822c[_0x98c3('0x2f')]),_0x4e88e5);if(_0x26a939[_0x98c3('0x2d')]['filter']){_0x5ee2ce[_0x98c3('0x36')]=_['merge'](_0x5ee2ce['where'],{'$or':_[_0x98c3('0x2c')](_0x4e88e5,function(_0x36821f){if(_0x36821f[_0x98c3('0x29')]!=='VIRTUAL'){var _0x5255de={};_0x5255de[_0x36821f[_0x98c3('0x25')]]={'$like':'%'+_0x26a939[_0x98c3('0x2d')][_0x98c3('0x38')]+'%'};return _0x5255de;}})});}_0x5ee2ce=_[_0x98c3('0x39')]({},_0x5ee2ce,_0x26a939[_0x98c3('0x3a')]);var _0x17b346={'where':_0x5ee2ce['where']};return db['IntegrationReport'][_0x98c3('0x1d')](_0x17b346)[_0x98c3('0x23')](function(_0x2c19cf){_0x5ea272[_0x98c3('0x1d')]=_0x2c19cf;if(_0x26a939[_0x98c3('0x2d')][_0x98c3('0x3b')]){_0x5ee2ce['include']=[{'all':!![]}];}return db[_0x98c3('0x26')][_0x98c3('0x3c')](_0x5ee2ce);})['then'](function(_0x355f0e){_0x5ea272[_0x98c3('0x3d')]=_0x355f0e;return _0x5ea272;})[_0x98c3('0x23')](respondWithFilteredResult(_0xcec32b,_0x5ee2ce))['catch'](handleError(_0xcec32b,null));};exports[_0x98c3('0x3e')]=function(_0x14a531,_0xaa88ad){var _0x5970ed={'raw':![],'where':{'id':_0x14a531[_0x98c3('0x3f')]['id']}},_0x52e553={};_0x52e553['model']=_[_0x98c3('0x2e')](db[_0x98c3('0x26')][_0x98c3('0x27')]);_0x52e553['query']=_[_0x98c3('0x2e')](_0x14a531[_0x98c3('0x2d')]);_0x52e553[_0x98c3('0x2f')]=_[_0x98c3('0x30')](_0x52e553[_0x98c3('0x2b')],_0x52e553[_0x98c3('0x2d')]);_0x5970ed['attributes']=_[_0x98c3('0x30')](_0x52e553['model'],qs[_0x98c3('0x31')](_0x14a531[_0x98c3('0x2d')]['fields']));_0x5970ed['attributes']=_0x5970ed['attributes'][_0x98c3('0x33')]?_0x5970ed[_0x98c3('0x32')]:_0x52e553[_0x98c3('0x2b')];if(_0x14a531['query']['includeAll']){_0x5970ed[_0x98c3('0x40')]=[{'all':!![]}];}_0x5970ed=_[_0x98c3('0x39')]({},_0x5970ed,_0x14a531['options']);return db[_0x98c3('0x26')]['find'](_0x5970ed)['then'](handleEntityNotFound(_0xaa88ad,null))['then'](respondWithResult(_0xaa88ad,null))[_0x98c3('0x41')](handleError(_0xaa88ad,null));};exports[_0x98c3('0x42')]=function(_0x2b887e,_0x438ef3){return db[_0x98c3('0x26')]['create'](_0x2b887e[_0x98c3('0x43')],{})[_0x98c3('0x23')](respondWithResult(_0x438ef3,0xc9))[_0x98c3('0x41')](handleError(_0x438ef3,null));};exports['update']=function(_0x47866a,_0x5a216d){if(_0x47866a[_0x98c3('0x43')]['id']){delete _0x47866a[_0x98c3('0x43')]['id'];}return db['IntegrationReport'][_0x98c3('0x44')]({'where':{'id':_0x47866a[_0x98c3('0x3f')]['id']}})[_0x98c3('0x23')](handleEntityNotFound(_0x5a216d,null))[_0x98c3('0x23')](saveUpdates(_0x47866a[_0x98c3('0x43')],null))[_0x98c3('0x23')](respondWithResult(_0x5a216d,null))[_0x98c3('0x41')](handleError(_0x5a216d,null));};exports[_0x98c3('0x45')]=function(_0x46a9ad,_0x42f2c3){return db[_0x98c3('0x26')][_0x98c3('0x44')]({'where':{'id':_0x46a9ad['params']['id']}})[_0x98c3('0x23')](handleEntityNotFound(_0x42f2c3,null))[_0x98c3('0x23')](removeEntity(_0x42f2c3,null))[_0x98c3('0x41')](handleError(_0x42f2c3,null));};exports['describe']=function(_0x262456,_0x2f8dd3){return db[_0x98c3('0x26')]['describe']()[_0x98c3('0x23')](respondWithResult(_0x2f8dd3,null))[_0x98c3('0x41')](handleError(_0x2f8dd3,null));}; \ No newline at end of file +var _0xc300=['catch','create','body','find','params','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','IntegrationReport','rawAttributes','type','key','query','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','include','rows','show','keys','includeAll'];(function(_0x32d788,_0xbaa65e){var _0x1b671a=function(_0x1f8ff3){while(--_0x1f8ff3){_0x32d788['push'](_0x32d788['shift']());}};_0x1b671a(++_0xbaa65e);}(_0xc300,0x132));var _0x0c30=function(_0x290cad,_0x46d566){_0x290cad=_0x290cad-0x0;var _0x56f92f=_0xc300[_0x290cad];return _0x56f92f;};'use strict';var emlformat=require(_0x0c30('0x0'));var rimraf=require(_0x0c30('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0c30('0x2'));var moment=require(_0x0c30('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0c30('0x4'));var util=require(_0x0c30('0x5'));var path=require(_0x0c30('0x6'));var sox=require(_0x0c30('0x7'));var csv=require(_0x0c30('0x8'));var ejs=require(_0x0c30('0x9'));var fs=require('fs');var fs_extra=require(_0x0c30('0xa'));var _=require(_0x0c30('0xb'));var squel=require('squel');var crypto=require(_0x0c30('0xc'));var jsforce=require(_0x0c30('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0c30('0x8'));var querystring=require(_0x0c30('0xe'));var Papa=require('papaparse');var Redis=require(_0x0c30('0xf'));var authService=require(_0x0c30('0x10'));var qs=require(_0x0c30('0x11'));var as=require(_0x0c30('0x12'));var hardwareService=require(_0x0c30('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x0c30('0x14'));var config=require(_0x0c30('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x67a814,_0x192ae4){_0x192ae4=_0x192ae4||0xcc;return function(_0x2be3b0){if(_0x2be3b0){return _0x67a814[_0x0c30('0x16')](_0x192ae4);}return _0x67a814[_0x0c30('0x17')](_0x192ae4)['end']();};}function respondWithResult(_0x11c0ae,_0x50ed2a){_0x50ed2a=_0x50ed2a||0xc8;return function(_0x2b727d){if(_0x2b727d){return _0x11c0ae[_0x0c30('0x17')](_0x50ed2a)[_0x0c30('0x18')](_0x2b727d);}};}function respondWithFilteredResult(_0x10061d,_0x295efb){return function(_0x3aa672){if(_0x3aa672){var _0x58ac6e=typeof _0x295efb[_0x0c30('0x19')]==='undefined'&&typeof _0x295efb[_0x0c30('0x1a')]===_0x0c30('0x1b');var _0x22bd25=_0x3aa672['count'];var _0x2538a6=_0x58ac6e?0x0:_0x295efb[_0x0c30('0x19')];var _0x3df784=_0x58ac6e?_0x3aa672[_0x0c30('0x1c')]:_0x295efb['offset']+_0x295efb[_0x0c30('0x1a')];var _0x3c2e66;if(_0x3df784>=_0x22bd25){_0x3df784=_0x22bd25;_0x3c2e66=0xc8;}else{_0x3c2e66=0xce;}_0x10061d[_0x0c30('0x17')](_0x3c2e66);return _0x10061d[_0x0c30('0x1d')](_0x0c30('0x1e'),_0x2538a6+'-'+_0x3df784+'/'+_0x22bd25)[_0x0c30('0x18')](_0x3aa672);}return null;};}function patchUpdates(_0x11442a){return function(_0x5305d6){try{jsonpatch[_0x0c30('0x1f')](_0x5305d6,_0x11442a,!![]);}catch(_0x3dd61f){return BPromise[_0x0c30('0x20')](_0x3dd61f);}return _0x5305d6[_0x0c30('0x21')]();};}function saveUpdates(_0x1e9ac5,_0x1fa8ba){return function(_0x299316){if(_0x299316){return _0x299316[_0x0c30('0x22')](_0x1e9ac5)[_0x0c30('0x23')](function(_0x3e4563){return _0x3e4563;});}return null;};}function removeEntity(_0x262198,_0x1289e5){return function(_0x5bc7f4){if(_0x5bc7f4){return _0x5bc7f4[_0x0c30('0x24')]()[_0x0c30('0x23')](function(){_0x262198['status'](0xcc)[_0x0c30('0x25')]();});}};}function handleEntityNotFound(_0x47c67c,_0x529855){return function(_0x3672a5){if(!_0x3672a5){_0x47c67c['sendStatus'](0x194);}return _0x3672a5;};}function handleError(_0x8ffdf8,_0x2d9959){_0x2d9959=_0x2d9959||0x1f4;return function(_0x1453d6){logger[_0x0c30('0x26')](_0x1453d6[_0x0c30('0x27')]);if(_0x1453d6['name']){delete _0x1453d6[_0x0c30('0x28')];}_0x8ffdf8[_0x0c30('0x17')](_0x2d9959)[_0x0c30('0x29')](_0x1453d6);};}exports['index']=function(_0x58a64e,_0x14f9a8){var _0x2791d0={},_0x2b1413={},_0x3175dc={'count':0x0,'rows':[]};var _0x2a90a0=_['map'](db[_0x0c30('0x2a')][_0x0c30('0x2b')],function(_0x3f5d7f){return{'name':_0x3f5d7f['fieldName'],'type':_0x3f5d7f[_0x0c30('0x2c')][_0x0c30('0x2d')]};});_0x2b1413['model']=_['map'](_0x2a90a0,_0x0c30('0x28'));_0x2b1413[_0x0c30('0x2e')]=_['keys'](_0x58a64e['query']);_0x2b1413['filters']=_[_0x0c30('0x2f')](_0x2b1413['model'],_0x2b1413['query']);_0x2791d0[_0x0c30('0x30')]=_[_0x0c30('0x2f')](_0x2b1413['model'],qs[_0x0c30('0x31')](_0x58a64e[_0x0c30('0x2e')][_0x0c30('0x31')]));_0x2791d0[_0x0c30('0x30')]=_0x2791d0[_0x0c30('0x30')][_0x0c30('0x32')]?_0x2791d0[_0x0c30('0x30')]:_0x2b1413[_0x0c30('0x33')];if(!_0x58a64e[_0x0c30('0x2e')][_0x0c30('0x34')](_0x0c30('0x35'))){_0x2791d0['limit']=qs['limit'](_0x58a64e[_0x0c30('0x2e')][_0x0c30('0x1a')]);_0x2791d0[_0x0c30('0x19')]=qs[_0x0c30('0x19')](_0x58a64e[_0x0c30('0x2e')]['offset']);}_0x2791d0[_0x0c30('0x36')]=qs['sort'](_0x58a64e[_0x0c30('0x2e')][_0x0c30('0x37')]);_0x2791d0[_0x0c30('0x38')]=qs[_0x0c30('0x39')](_[_0x0c30('0x3a')](_0x58a64e['query'],_0x2b1413['filters']),_0x2a90a0);if(_0x58a64e[_0x0c30('0x2e')][_0x0c30('0x3b')]){_0x2791d0[_0x0c30('0x38')]=_[_0x0c30('0x3c')](_0x2791d0['where'],{'$or':_[_0x0c30('0x3d')](_0x2a90a0,function(_0x13dfde){if(_0x13dfde[_0x0c30('0x2c')]!==_0x0c30('0x3e')){var _0x4b3827={};_0x4b3827[_0x13dfde[_0x0c30('0x28')]]={'$like':'%'+_0x58a64e[_0x0c30('0x2e')][_0x0c30('0x3b')]+'%'};return _0x4b3827;}})});}_0x2791d0=_[_0x0c30('0x3c')]({},_0x2791d0,_0x58a64e[_0x0c30('0x3f')]);var _0x283851={'where':_0x2791d0['where']};return db[_0x0c30('0x2a')][_0x0c30('0x1c')](_0x283851)[_0x0c30('0x23')](function(_0x221d4c){_0x3175dc[_0x0c30('0x1c')]=_0x221d4c;if(_0x58a64e[_0x0c30('0x2e')]['includeAll']){_0x2791d0[_0x0c30('0x40')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x2791d0);})[_0x0c30('0x23')](function(_0x2cc81e){_0x3175dc[_0x0c30('0x41')]=_0x2cc81e;return _0x3175dc;})[_0x0c30('0x23')](respondWithFilteredResult(_0x14f9a8,_0x2791d0))['catch'](handleError(_0x14f9a8,null));};exports[_0x0c30('0x42')]=function(_0x3e90a5,_0x3ef844){var _0x2e665d={'raw':![],'where':{'id':_0x3e90a5['params']['id']}},_0x1efd0f={};_0x1efd0f[_0x0c30('0x33')]=_['keys'](db[_0x0c30('0x2a')][_0x0c30('0x2b')]);_0x1efd0f[_0x0c30('0x2e')]=_[_0x0c30('0x43')](_0x3e90a5[_0x0c30('0x2e')]);_0x1efd0f[_0x0c30('0x39')]=_[_0x0c30('0x2f')](_0x1efd0f[_0x0c30('0x33')],_0x1efd0f[_0x0c30('0x2e')]);_0x2e665d[_0x0c30('0x30')]=_[_0x0c30('0x2f')](_0x1efd0f['model'],qs['fields'](_0x3e90a5[_0x0c30('0x2e')][_0x0c30('0x31')]));_0x2e665d[_0x0c30('0x30')]=_0x2e665d[_0x0c30('0x30')][_0x0c30('0x32')]?_0x2e665d[_0x0c30('0x30')]:_0x1efd0f['model'];if(_0x3e90a5[_0x0c30('0x2e')][_0x0c30('0x44')]){_0x2e665d[_0x0c30('0x40')]=[{'all':!![]}];}_0x2e665d=_[_0x0c30('0x3c')]({},_0x2e665d,_0x3e90a5[_0x0c30('0x3f')]);return db['IntegrationReport']['find'](_0x2e665d)[_0x0c30('0x23')](handleEntityNotFound(_0x3ef844,null))[_0x0c30('0x23')](respondWithResult(_0x3ef844,null))[_0x0c30('0x45')](handleError(_0x3ef844,null));};exports[_0x0c30('0x46')]=function(_0x2b59fa,_0x1d687f){return db[_0x0c30('0x2a')][_0x0c30('0x46')](_0x2b59fa['body'],{})[_0x0c30('0x23')](respondWithResult(_0x1d687f,0xc9))[_0x0c30('0x45')](handleError(_0x1d687f,null));};exports[_0x0c30('0x22')]=function(_0x158c1d,_0x1bba03){if(_0x158c1d[_0x0c30('0x47')]['id']){delete _0x158c1d['body']['id'];}return db[_0x0c30('0x2a')][_0x0c30('0x48')]({'where':{'id':_0x158c1d[_0x0c30('0x49')]['id']}})[_0x0c30('0x23')](handleEntityNotFound(_0x1bba03,null))[_0x0c30('0x23')](saveUpdates(_0x158c1d[_0x0c30('0x47')],null))['then'](respondWithResult(_0x1bba03,null))[_0x0c30('0x45')](handleError(_0x1bba03,null));};exports['destroy']=function(_0x324c60,_0x595621){return db['IntegrationReport'][_0x0c30('0x48')]({'where':{'id':_0x324c60[_0x0c30('0x49')]['id']}})['then'](handleEntityNotFound(_0x595621,null))[_0x0c30('0x23')](removeEntity(_0x595621,null))[_0x0c30('0x45')](handleError(_0x595621,null));};exports[_0x0c30('0x4a')]=function(_0x2b1cb7,_0x3c5bb3){return db['IntegrationReport'][_0x0c30('0x4a')]()[_0x0c30('0x23')](respondWithResult(_0x3c5bb3,null))['catch'](handleError(_0x3c5bb3,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 139c426..7c39c49 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 _0x9e01=['IntegrationReport','report_integration','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x22c50e,_0x4ea131){var _0x500f85=function(_0x412f7b){while(--_0x412f7b){_0x22c50e['push'](_0x22c50e['shift']());}};_0x500f85(++_0x4ea131);}(_0x9e01,0x18e));var _0x19e0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x9e01[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x19e0('0x0'));var util=require(_0x19e0('0x1'));var logger=require(_0x19e0('0x2'))(_0x19e0('0x3'));var moment=require('moment');var BPromise=require(_0x19e0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19e0('0x5'));var rimraf=require(_0x19e0('0x6'));var config=require(_0x19e0('0x7'));var attributes=require(_0x19e0('0x8'));module[_0x19e0('0x9')]=function(_0xaba3d2,_0x2e52f5){return _0xaba3d2['define'](_0x19e0('0xa'),attributes,{'tableName':_0x19e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ac1=['report_integration','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','IntegrationReport'];(function(_0xd5c983,_0x394e66){var _0x3d2d91=function(_0x4291dc){while(--_0x4291dc){_0xd5c983['push'](_0xd5c983['shift']());}};_0x3d2d91(++_0x394e66);}(_0x2ac1,0x97));var _0x12ac=function(_0x4abc62,_0xb6b96f){_0x4abc62=_0x4abc62-0x0;var _0x4c65c9=_0x2ac1[_0x4abc62];return _0x4c65c9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x12ac('0x0'))(_0x12ac('0x1'));var moment=require('moment');var BPromise=require(_0x12ac('0x2'));var rp=require(_0x12ac('0x3'));var fs=require('fs');var path=require(_0x12ac('0x4'));var rimraf=require(_0x12ac('0x5'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0x12ac('0x6')]=function(_0x5567aa,_0x111f8f){return _0x5567aa[_0x12ac('0x7')](_0x12ac('0x8'),attributes,{'tableName':_0x12ac('0x9'),'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 62b8f56..81266a8 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 _0xda3f=['rpc','jayson/promise','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0xda3f,0xec));var _0xfda3=function(_0x1b8870,_0xb97bb0){_0x1b8870=_0x1b8870-0x0;var _0x4b622e=_0xda3f[_0x1b8870];return _0x4b622e;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('IntegrationReport,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file +var _0x5eb8=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x522ac7,_0x21868a){var _0x25ab5b=function(_0x5ce9fa){while(--_0x5ce9fa){_0x522ac7['push'](_0x522ac7['shift']());}};_0x25ab5b(++_0x21868a);}(_0x5eb8,0xb0));var _0x85eb=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0x5eb8[_0x35f83e];return _0x249b05;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 4a6b33b..2c82bf3 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 _0x2d4f=['addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/sub_intervals','isAuthenticated','getIntervals','create','post'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x2d4f,0x7f));var _0xf2d4=function(_0x12893c,_0x539618){_0x12893c=_0x12893c-0x0;var _0x4751ac=_0x2d4f[_0x12893c];return _0x4751ac;};'use strict';var multer=require(_0xf2d4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf2d4('0x1'));var express=require(_0xf2d4('0x2'));var router=express[_0xf2d4('0x3')]();var fs_extra=require(_0xf2d4('0x4'));var auth=require(_0xf2d4('0x5'));var interaction=require(_0xf2d4('0x6'));var config=require(_0xf2d4('0x7'));var controller=require('./interval.controller');router[_0xf2d4('0x8')]('/',auth['isAuthenticated'](),controller[_0xf2d4('0x9')]);router[_0xf2d4('0x8')](_0xf2d4('0xa'),auth['isAuthenticated'](),controller[_0xf2d4('0xb')]);router[_0xf2d4('0x8')](_0xf2d4('0xc'),auth[_0xf2d4('0xd')](),controller[_0xf2d4('0xe')]);router['post']('/',auth[_0xf2d4('0xd')](),controller[_0xf2d4('0xf')]);router[_0xf2d4('0x10')](_0xf2d4('0xc'),auth['isAuthenticated'](),controller[_0xf2d4('0x11')]);router['post'](_0xf2d4('0x12'),auth[_0xf2d4('0xd')](),controller[_0xf2d4('0x13')]);router[_0xf2d4('0x14')]('/:id',auth[_0xf2d4('0xd')](),controller[_0xf2d4('0x15')]);router[_0xf2d4('0x16')](_0xf2d4('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xf2d4('0x17')]=router; \ No newline at end of file +var _0xdd5e=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show','post','create','addInterval','addIntervals','/:id','update','delete','destroy'];(function(_0x1c9c50,_0x3cfd26){var _0x355ae5=function(_0x36530e){while(--_0x36530e){_0x1c9c50['push'](_0x1c9c50['shift']());}};_0x355ae5(++_0x3cfd26);}(_0xdd5e,0x127));var _0xedd5=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xdd5e[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require('multer');var util=require(_0xedd5('0x0'));var path=require(_0xedd5('0x1'));var timeout=require(_0xedd5('0x2'));var express=require('express');var router=express[_0xedd5('0x3')]();var fs_extra=require(_0xedd5('0x4'));var auth=require(_0xedd5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xedd5('0x6'));var controller=require(_0xedd5('0x7'));router[_0xedd5('0x8')]('/',auth[_0xedd5('0x9')](),controller[_0xedd5('0xa')]);router[_0xedd5('0x8')]('/:id',auth[_0xedd5('0x9')](),controller[_0xedd5('0xb')]);router[_0xedd5('0x8')]('/:id/sub_intervals',auth[_0xedd5('0x9')](),controller['getIntervals']);router[_0xedd5('0xc')]('/',auth[_0xedd5('0x9')](),controller[_0xedd5('0xd')]);router[_0xedd5('0xc')]('/:id/sub_intervals',auth[_0xedd5('0x9')](),controller[_0xedd5('0xe')]);router['post']('/:id/sub_intervals/create_many',auth[_0xedd5('0x9')](),controller[_0xedd5('0xf')]);router['put'](_0xedd5('0x10'),auth['isAuthenticated'](),controller[_0xedd5('0x11')]);router[_0xedd5('0x12')](_0xedd5('0x10'),auth[_0xedd5('0x9')](),controller[_0xedd5('0x13')]);module[_0xedd5('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 30776e7..cea1382 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 _0x8b9c=['STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b9c,0xbb));var _0xc8b9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8b9c[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0xc8b9('0x0')]={'name':{'type':Sequelize[_0xc8b9('0x1')]},'description':{'type':Sequelize[_0xc8b9('0x1')]},'interval':{'type':Sequelize[_0xc8b9('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x4af1=['sequelize','STRING'];(function(_0x262fa1,_0x9ff6fb){var _0x5b4510=function(_0x356cce){while(--_0x356cce){_0x262fa1['push'](_0x262fa1['shift']());}};_0x5b4510(++_0x9ff6fb);}(_0x4af1,0x18e));var _0x14af=function(_0xdc2bd,_0x312ba7){_0xdc2bd=_0xdc2bd-0x0;var _0xef8903=_0x4af1[_0xdc2bd];return _0xef8903;};'use strict';var Sequelize=require(_0x14af('0x0'));module['exports']={'name':{'type':Sequelize[_0x14af('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x14af('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 37b4348..1a5ae2e 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 _0x83f7=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Interval','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','find','destroy','addInterval','getIntervals','addIntervals','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','Intervals','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields'];(function(_0xc8023,_0xd1912){var _0x448b50=function(_0x4b8a6f){while(--_0x4b8a6f){_0xc8023['push'](_0xc8023['shift']());}};_0x448b50(++_0xd1912);}(_0x83f7,0x84));var _0x783f=function(_0x5de26b,_0x1d2f14){_0x5de26b=_0x5de26b-0x0;var _0x5a0b72=_0x83f7[_0x5de26b];return _0x5a0b72;};'use strict';var emlformat=require(_0x783f('0x0'));var rimraf=require(_0x783f('0x1'));var zipdir=require(_0x783f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x783f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x783f('0x4'));var util=require(_0x783f('0x5'));var path=require(_0x783f('0x6'));var sox=require(_0x783f('0x7'));var csv=require(_0x783f('0x8'));var ejs=require(_0x783f('0x9'));var fs=require('fs');var fs_extra=require(_0x783f('0xa'));var _=require(_0x783f('0xb'));var squel=require('squel');var crypto=require(_0x783f('0xc'));var jsforce=require(_0x783f('0xd'));var deskjs=require(_0x783f('0xe'));var toCsv=require(_0x783f('0x8'));var querystring=require('querystring');var Papa=require(_0x783f('0xf'));var Redis=require('ioredis');var authService=require(_0x783f('0x10'));var qs=require(_0x783f('0x11'));var as=require(_0x783f('0x12'));var hardwareService=require(_0x783f('0x13'));var logger=require(_0x783f('0x14'))(_0x783f('0x15'));var utils=require(_0x783f('0x16'));var config=require(_0x783f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x783f('0x18'))['db'];var extensions=require(_0x783f('0x19'));function respondWithStatusCode(_0x5d9225,_0x334fce){_0x334fce=_0x334fce||0xcc;return function(_0x2eb246){if(_0x2eb246){return _0x5d9225[_0x783f('0x1a')](_0x334fce);}return _0x5d9225[_0x783f('0x1b')](_0x334fce)[_0x783f('0x1c')]();};}function respondWithResult(_0x4bf50e,_0x291d85){_0x291d85=_0x291d85||0xc8;return function(_0x44c18e){if(_0x44c18e){return _0x4bf50e[_0x783f('0x1b')](_0x291d85)['json'](_0x44c18e);}};}function respondWithFilteredResult(_0x59c0d7,_0x204350){return function(_0x15e0ba){if(_0x15e0ba){var _0xcc2994=typeof _0x204350[_0x783f('0x1d')]===_0x783f('0x1e')&&typeof _0x204350[_0x783f('0x1f')]==='undefined';var _0x3e42a9=_0x15e0ba[_0x783f('0x20')];var _0x1ccf42=_0xcc2994?0x0:_0x204350[_0x783f('0x1d')];var _0x486155=_0xcc2994?_0x15e0ba[_0x783f('0x20')]:_0x204350[_0x783f('0x1d')]+_0x204350['limit'];var _0x105f9a;if(_0x486155>=_0x3e42a9){_0x486155=_0x3e42a9;_0x105f9a=0xc8;}else{_0x105f9a=0xce;}_0x59c0d7[_0x783f('0x1b')](_0x105f9a);return _0x59c0d7[_0x783f('0x21')]('Content-Range',_0x1ccf42+'-'+_0x486155+'/'+_0x3e42a9)[_0x783f('0x22')](_0x15e0ba);}return null;};}function patchUpdates(_0x1b8c4e){return function(_0x1266e8){try{jsonpatch[_0x783f('0x23')](_0x1266e8,_0x1b8c4e,!![]);}catch(_0x1a0d72){return BPromise[_0x783f('0x24')](_0x1a0d72);}return _0x1266e8[_0x783f('0x25')]();};}function saveUpdates(_0x20bd86,_0x451d41){return function(_0x4e19a5){if(_0x4e19a5){return _0x4e19a5[_0x783f('0x26')](_0x20bd86)[_0x783f('0x27')](function(_0x2cb017){return _0x2cb017;});}return null;};}function removeEntity(_0x168c90,_0x27a61c){return function(_0x38bc45){if(_0x38bc45){return _0x38bc45['destroy']()[_0x783f('0x27')](function(){var _0xf04f83=_0x38bc45[_0x783f('0x28')]({'plain':!![]});var _0x50c849=_0x783f('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x50c849,'resourceId':_0xf04f83['id']}})['then'](function(){return _0x38bc45;});})[_0x783f('0x27')](function(){_0x168c90[_0x783f('0x1b')](0xcc)[_0x783f('0x1c')]();});}};}function handleEntityNotFound(_0x5534b2,_0x5ddfa5){return function(_0xa19615){if(!_0xa19615){_0x5534b2[_0x783f('0x1a')](0x194);}return _0xa19615;};}function handleError(_0x2ce690,_0x369560){_0x369560=_0x369560||0x1f4;return function(_0x4283d0){logger[_0x783f('0x2a')](_0x4283d0[_0x783f('0x2b')]);if(_0x4283d0[_0x783f('0x2c')]){delete _0x4283d0[_0x783f('0x2c')];}_0x2ce690[_0x783f('0x1b')](_0x369560)[_0x783f('0x2d')](_0x4283d0);};}exports[_0x783f('0x2e')]=function(_0x47eadb,_0x56b28d){var _0x2f82a1={},_0xa243b6={},_0xdf6e1c={'count':0x0,'rows':[]};var _0x136098=_['map'](db['Interval'][_0x783f('0x2f')],function(_0xb302fb){return{'name':_0xb302fb[_0x783f('0x30')],'type':_0xb302fb[_0x783f('0x31')][_0x783f('0x32')]};});_0xa243b6[_0x783f('0x33')]=_[_0x783f('0x34')](_0x136098,'name');_0xa243b6[_0x783f('0x35')]=_[_0x783f('0x36')](_0x47eadb[_0x783f('0x35')]);_0xa243b6[_0x783f('0x37')]=_[_0x783f('0x38')](_0xa243b6[_0x783f('0x33')],_0xa243b6[_0x783f('0x35')]);_0x2f82a1['attributes']=_['intersection'](_0xa243b6[_0x783f('0x33')],qs[_0x783f('0x39')](_0x47eadb['query'][_0x783f('0x39')]));_0x2f82a1[_0x783f('0x3a')]=_0x2f82a1['attributes'][_0x783f('0x3b')]?_0x2f82a1['attributes']:_0xa243b6[_0x783f('0x33')];if(!_0x47eadb[_0x783f('0x35')][_0x783f('0x3c')](_0x783f('0x3d'))){_0x2f82a1[_0x783f('0x1f')]=qs[_0x783f('0x1f')](_0x47eadb[_0x783f('0x35')][_0x783f('0x1f')]);_0x2f82a1[_0x783f('0x1d')]=qs['offset'](_0x47eadb[_0x783f('0x35')][_0x783f('0x1d')]);}_0x2f82a1[_0x783f('0x3e')]=qs[_0x783f('0x3f')](_0x47eadb[_0x783f('0x35')][_0x783f('0x3f')]);_0x2f82a1[_0x783f('0x40')]=qs['filters'](_[_0x783f('0x41')](_0x47eadb[_0x783f('0x35')],_0xa243b6['filters']),_0x136098);if(_0x47eadb[_0x783f('0x35')][_0x783f('0x42')]){_0x2f82a1['where']=_[_0x783f('0x43')](_0x2f82a1['where'],{'$or':_[_0x783f('0x34')](_0x136098,function(_0x31ce04){if(_0x31ce04[_0x783f('0x31')]!==_0x783f('0x44')){var _0x36431d={};_0x36431d[_0x31ce04[_0x783f('0x2c')]]={'$like':'%'+_0x47eadb['query']['filter']+'%'};return _0x36431d;}})});}_0x2f82a1=_[_0x783f('0x43')]({},_0x2f82a1,_0x47eadb[_0x783f('0x45')]);var _0x52224a={'where':_0x2f82a1['where']};return db['Interval']['count'](_0x52224a)['then'](function(_0x172397){_0xdf6e1c[_0x783f('0x20')]=_0x172397;if(_0x47eadb[_0x783f('0x35')][_0x783f('0x46')]){_0x2f82a1[_0x783f('0x47')]=[{'all':!![]}];}return db[_0x783f('0x48')][_0x783f('0x49')](_0x2f82a1);})[_0x783f('0x27')](function(_0x9d9406){_0xdf6e1c[_0x783f('0x4a')]=_0x9d9406;return _0xdf6e1c;})[_0x783f('0x27')](respondWithFilteredResult(_0x56b28d,_0x2f82a1))[_0x783f('0x4b')](handleError(_0x56b28d,null));};exports[_0x783f('0x4c')]=function(_0x417b3a,_0x50c655){var _0x595303={'raw':!![],'where':{'id':_0x417b3a[_0x783f('0x4d')]['id']}},_0x36a610={};_0x36a610[_0x783f('0x33')]=_[_0x783f('0x36')](db[_0x783f('0x48')][_0x783f('0x2f')]);_0x36a610[_0x783f('0x35')]=_['keys'](_0x417b3a[_0x783f('0x35')]);_0x36a610[_0x783f('0x37')]=_[_0x783f('0x38')](_0x36a610[_0x783f('0x33')],_0x36a610[_0x783f('0x35')]);_0x595303['attributes']=_[_0x783f('0x38')](_0x36a610['model'],qs[_0x783f('0x39')](_0x417b3a[_0x783f('0x35')][_0x783f('0x39')]));_0x595303['attributes']=_0x595303['attributes'][_0x783f('0x3b')]?_0x595303[_0x783f('0x3a')]:_0x36a610[_0x783f('0x33')];if(_0x417b3a['query'][_0x783f('0x46')]){_0x595303[_0x783f('0x47')]=[{'all':!![]}];}_0x595303=_[_0x783f('0x43')]({},_0x595303,_0x417b3a[_0x783f('0x45')]);return db['Interval']['find'](_0x595303)[_0x783f('0x27')](handleEntityNotFound(_0x50c655,null))[_0x783f('0x27')](respondWithResult(_0x50c655,null))[_0x783f('0x4b')](handleError(_0x50c655,null));};exports[_0x783f('0x4e')]=function(_0x4ce2d5,_0x14f29c){return db[_0x783f('0x48')]['create'](_0x4ce2d5[_0x783f('0x4f')],{})[_0x783f('0x27')](function(_0x5570fe){var _0x489d00=_0x4ce2d5[_0x783f('0x50')]['get']({'plain':!![]});if(!_0x489d00)throw new Error(_0x783f('0x51'));if(_0x489d00['role']===_0x783f('0x50')){var _0x56f7c9=_0x5570fe['get']({'plain':!![]});var _0x25f45a='Intervals';return db[_0x783f('0x52')]['find']({'where':{'name':_0x25f45a,'userProfileId':_0x489d00[_0x783f('0x53')]},'raw':!![]})[_0x783f('0x27')](function(_0xb02c78){if(_0xb02c78&&_0xb02c78[_0x783f('0x54')]===0x0){return db[_0x783f('0x55')][_0x783f('0x4e')]({'name':_0x56f7c9['name'],'resourceId':_0x56f7c9['id'],'type':_0xb02c78['name'],'sectionId':_0xb02c78['id']},{})[_0x783f('0x27')](function(){return _0x5570fe;});}else{return _0x5570fe;}})['catch'](function(_0x956b17){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x956b17);throw _0x956b17;});}return _0x5570fe;})[_0x783f('0x27')](respondWithResult(_0x14f29c,0xc9))[_0x783f('0x4b')](handleError(_0x14f29c,null));};exports[_0x783f('0x26')]=function(_0x23bb8c,_0x3e7cf3){if(_0x23bb8c[_0x783f('0x4f')]['id']){delete _0x23bb8c[_0x783f('0x4f')]['id'];}return db['Interval'][_0x783f('0x56')]({'where':{'id':_0x23bb8c[_0x783f('0x4d')]['id']}})[_0x783f('0x27')](handleEntityNotFound(_0x3e7cf3,null))['then'](saveUpdates(_0x23bb8c[_0x783f('0x4f')],null))[_0x783f('0x27')](respondWithResult(_0x3e7cf3,null))[_0x783f('0x4b')](handleError(_0x3e7cf3,null));};exports[_0x783f('0x57')]=function(_0x109482,_0x478e0c){return db['Interval'][_0x783f('0x56')]({'where':{'id':_0x109482['params']['id']}})[_0x783f('0x27')](handleEntityNotFound(_0x478e0c,null))[_0x783f('0x27')](removeEntity(_0x478e0c,null))[_0x783f('0x4b')](handleError(_0x478e0c,null));};exports[_0x783f('0x58')]=function(_0x3a1e18,_0x4dc194,_0x4bfae4){if(_0x3a1e18[_0x783f('0x4f')]['id']){delete _0x3a1e18[_0x783f('0x4f')]['id'];}return db['Interval']['find']({'where':{'id':_0x3a1e18[_0x783f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4dc194,null))[_0x783f('0x27')](function(_0x527616){if(_0x527616){_0x3a1e18[_0x783f('0x4f')]['IntervalId']=_0x527616['id'];return db[_0x783f('0x48')][_0x783f('0x4e')](_0x3a1e18[_0x783f('0x4f')]);}})[_0x783f('0x27')](respondWithResult(_0x4dc194,null))['catch'](handleError(_0x4dc194,null));};exports[_0x783f('0x59')]=function(_0x30f356,_0x4815fa,_0x1f1df6){var _0x2bead7={};var _0x3a606f={};var _0x15ba37;var _0x1ac1b0;return db['Interval']['findOne']({'where':{'id':_0x30f356[_0x783f('0x4d')]['id']}})[_0x783f('0x27')](handleEntityNotFound(_0x4815fa,null))[_0x783f('0x27')](function(_0x5383c5){if(_0x5383c5){_0x15ba37=_0x5383c5;_0x3a606f[_0x783f('0x33')]=_[_0x783f('0x36')](db[_0x783f('0x48')][_0x783f('0x2f')]);_0x3a606f['query']=_[_0x783f('0x36')](_0x30f356['query']);_0x3a606f[_0x783f('0x37')]=_[_0x783f('0x38')](_0x3a606f[_0x783f('0x33')],_0x3a606f[_0x783f('0x35')]);_0x2bead7['attributes']=_['intersection'](_0x3a606f[_0x783f('0x33')],qs['fields'](_0x30f356[_0x783f('0x35')][_0x783f('0x39')]));_0x2bead7[_0x783f('0x3a')]=_0x2bead7['attributes'][_0x783f('0x3b')]?_0x2bead7[_0x783f('0x3a')]:_0x3a606f[_0x783f('0x33')];_0x2bead7[_0x783f('0x3e')]=qs['sort'](_0x30f356[_0x783f('0x35')]['sort']);_0x2bead7[_0x783f('0x40')]=qs['filters'](_['pick'](_0x30f356[_0x783f('0x35')],_0x3a606f['filters']));if(_0x30f356[_0x783f('0x35')]['filter']){_0x2bead7['where']=_['merge'](_0x2bead7[_0x783f('0x40')],{'$or':_[_0x783f('0x34')](_0x2bead7[_0x783f('0x3a')],function(_0x4af146){var _0x51ca93={};_0x51ca93[_0x4af146]={'$like':'%'+_0x30f356[_0x783f('0x35')][_0x783f('0x42')]+'%'};return _0x51ca93;})});}_0x2bead7=_[_0x783f('0x43')]({},_0x2bead7,_0x30f356[_0x783f('0x45')]);return _0x15ba37[_0x783f('0x59')](_0x2bead7);}})['then'](function(_0x20c5e0){if(_0x20c5e0){_0x1ac1b0=_0x20c5e0[_0x783f('0x3b')];if(!_0x30f356['query'][_0x783f('0x3c')](_0x783f('0x3d'))){_0x2bead7[_0x783f('0x1f')]=qs[_0x783f('0x1f')](_0x30f356[_0x783f('0x35')][_0x783f('0x1f')]);_0x2bead7[_0x783f('0x1d')]=qs['offset'](_0x30f356[_0x783f('0x35')][_0x783f('0x1d')]);}return _0x15ba37[_0x783f('0x59')](_0x2bead7);}})[_0x783f('0x27')](function(_0x87963d){if(_0x87963d){return _0x87963d?{'count':_0x1ac1b0,'rows':_0x87963d}:null;}})[_0x783f('0x27')](respondWithResult(_0x4815fa,null))[_0x783f('0x4b')](handleError(_0x4815fa,null));};exports[_0x783f('0x5a')]=function(_0x2b554e,_0x157181,_0x398776){return db[_0x783f('0x48')]['findOne']({'where':{'id':_0x2b554e[_0x783f('0x4d')]['id']}})[_0x783f('0x27')](handleEntityNotFound(_0x157181,null))[_0x783f('0x27')](function(_0x5b4ae1){if(_0x5b4ae1){return db[_0x783f('0x5b')][_0x783f('0x5c')](function(_0x1db6dc){return db[_0x783f('0x48')][_0x783f('0x57')]({'where':{'IntervalId':_0x2b554e[_0x783f('0x4d')]['id']},'transaction':_0x1db6dc})[_0x783f('0x27')](function(_0x3cb086){var _0x53ff10=_[_0x783f('0x34')](_0x2b554e[_0x783f('0x4f')],function(_0x3429ca){delete _0x3429ca['id'];_0x3429ca[_0x783f('0x5d')]=_0x2b554e[_0x783f('0x4d')]['id'];return _0x3429ca;});return db[_0x783f('0x48')][_0x783f('0x5e')](_0x53ff10,{'transaction':_0x1db6dc});});})['then'](function(){return db[_0x783f('0x48')][_0x783f('0x49')]({'where':{'IntervalId':_0x2b554e['params']['id']}});});}})[_0x783f('0x27')](respondWithResult(_0x157181,null))[_0x783f('0x4b')](handleError(_0x157181,null));}; \ No newline at end of file +var _0x6324=['type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','get','Intervals','UserProfileResource','stack','name','map','Interval','fieldName'];(function(_0x5bf152,_0x2884b3){var _0x5d1230=function(_0x40a921){while(--_0x40a921){_0x5bf152['push'](_0x5bf152['shift']());}};_0x5d1230(++_0x2884b3);}(_0x6324,0x13b));var _0x4632=function(_0x41b654,_0x39239c){_0x41b654=_0x41b654-0x0;var _0x55c219=_0x6324[_0x41b654];return _0x55c219;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4632('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4632('0x2'));var moment=require(_0x4632('0x3'));var BPromise=require(_0x4632('0x4'));var Mustache=require(_0x4632('0x5'));var util=require(_0x4632('0x6'));var path=require(_0x4632('0x7'));var sox=require(_0x4632('0x8'));var csv=require(_0x4632('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4632('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require(_0x4632('0x10'));var authService=require(_0x4632('0x11'));var qs=require(_0x4632('0x12'));var as=require(_0x4632('0x13'));var hardwareService=require(_0x4632('0x14'));var logger=require('../../config/logger')(_0x4632('0x15'));var utils=require(_0x4632('0x16'));var config=require(_0x4632('0x17'));var licenseUtil=require(_0x4632('0x18'));var db=require(_0x4632('0x19'))['db'];var extensions=require(_0x4632('0x1a'));function respondWithStatusCode(_0x1ef599,_0x229141){_0x229141=_0x229141||0xcc;return function(_0xacec7){if(_0xacec7){return _0x1ef599[_0x4632('0x1b')](_0x229141);}return _0x1ef599[_0x4632('0x1c')](_0x229141)[_0x4632('0x1d')]();};}function respondWithResult(_0x2d6247,_0x590c1a){_0x590c1a=_0x590c1a||0xc8;return function(_0x5e6818){if(_0x5e6818){return _0x2d6247[_0x4632('0x1c')](_0x590c1a)[_0x4632('0x1e')](_0x5e6818);}};}function respondWithFilteredResult(_0x4c466e,_0x271168){return function(_0x28f78c){if(_0x28f78c){var _0x379478=typeof _0x271168[_0x4632('0x1f')]==='undefined'&&typeof _0x271168[_0x4632('0x20')]===_0x4632('0x21');var _0x49bb8a=_0x28f78c[_0x4632('0x22')];var _0x4367ad=_0x379478?0x0:_0x271168[_0x4632('0x1f')];var _0x4263e1=_0x379478?_0x28f78c[_0x4632('0x22')]:_0x271168[_0x4632('0x1f')]+_0x271168[_0x4632('0x20')];var _0x4bbd57;if(_0x4263e1>=_0x49bb8a){_0x4263e1=_0x49bb8a;_0x4bbd57=0xc8;}else{_0x4bbd57=0xce;}_0x4c466e[_0x4632('0x1c')](_0x4bbd57);return _0x4c466e[_0x4632('0x23')]('Content-Range',_0x4367ad+'-'+_0x4263e1+'/'+_0x49bb8a)[_0x4632('0x1e')](_0x28f78c);}return null;};}function patchUpdates(_0x506bc6){return function(_0x5d1fe0){try{jsonpatch[_0x4632('0x24')](_0x5d1fe0,_0x506bc6,!![]);}catch(_0x43cd63){return BPromise['reject'](_0x43cd63);}return _0x5d1fe0[_0x4632('0x25')]();};}function saveUpdates(_0x56838e,_0x15dd3e){return function(_0x33c34e){if(_0x33c34e){return _0x33c34e[_0x4632('0x26')](_0x56838e)[_0x4632('0x27')](function(_0x5588d9){return _0x5588d9;});}return null;};}function removeEntity(_0x27859a,_0xe3a260){return function(_0x61c885){if(_0x61c885){return _0x61c885[_0x4632('0x28')]()['then'](function(){var _0x1bab0f=_0x61c885[_0x4632('0x29')]({'plain':!![]});var _0x3bfef9=_0x4632('0x2a');return db[_0x4632('0x2b')][_0x4632('0x28')]({'where':{'type':_0x3bfef9,'resourceId':_0x1bab0f['id']}})['then'](function(){return _0x61c885;});})[_0x4632('0x27')](function(){_0x27859a[_0x4632('0x1c')](0xcc)[_0x4632('0x1d')]();});}};}function handleEntityNotFound(_0x307b03,_0x25c93b){return function(_0x592c8f){if(!_0x592c8f){_0x307b03[_0x4632('0x1b')](0x194);}return _0x592c8f;};}function handleError(_0x4fbdab,_0x2fb7e0){_0x2fb7e0=_0x2fb7e0||0x1f4;return function(_0x2ffd62){logger['error'](_0x2ffd62[_0x4632('0x2c')]);if(_0x2ffd62[_0x4632('0x2d')]){delete _0x2ffd62[_0x4632('0x2d')];}_0x4fbdab[_0x4632('0x1c')](_0x2fb7e0)['send'](_0x2ffd62);};}exports['index']=function(_0x5ef877,_0x4b473a){var _0x36979e={},_0x54c481={},_0x32412f={'count':0x0,'rows':[]};var _0x36cdcc=_[_0x4632('0x2e')](db[_0x4632('0x2f')]['rawAttributes'],function(_0x43ef5c){return{'name':_0x43ef5c[_0x4632('0x30')],'type':_0x43ef5c[_0x4632('0x31')]['key']};});_0x54c481[_0x4632('0x32')]=_['map'](_0x36cdcc,_0x4632('0x2d'));_0x54c481['query']=_[_0x4632('0x33')](_0x5ef877[_0x4632('0x34')]);_0x54c481[_0x4632('0x35')]=_[_0x4632('0x36')](_0x54c481['model'],_0x54c481['query']);_0x36979e[_0x4632('0x37')]=_[_0x4632('0x36')](_0x54c481['model'],qs[_0x4632('0x38')](_0x5ef877['query'][_0x4632('0x38')]));_0x36979e[_0x4632('0x37')]=_0x36979e[_0x4632('0x37')][_0x4632('0x39')]?_0x36979e[_0x4632('0x37')]:_0x54c481['model'];if(!_0x5ef877[_0x4632('0x34')][_0x4632('0x3a')](_0x4632('0x3b'))){_0x36979e['limit']=qs[_0x4632('0x20')](_0x5ef877['query']['limit']);_0x36979e[_0x4632('0x1f')]=qs[_0x4632('0x1f')](_0x5ef877[_0x4632('0x34')][_0x4632('0x1f')]);}_0x36979e[_0x4632('0x3c')]=qs['sort'](_0x5ef877[_0x4632('0x34')][_0x4632('0x3d')]);_0x36979e[_0x4632('0x3e')]=qs[_0x4632('0x35')](_[_0x4632('0x3f')](_0x5ef877[_0x4632('0x34')],_0x54c481[_0x4632('0x35')]),_0x36cdcc);if(_0x5ef877['query'][_0x4632('0x40')]){_0x36979e[_0x4632('0x3e')]=_['merge'](_0x36979e[_0x4632('0x3e')],{'$or':_[_0x4632('0x2e')](_0x36cdcc,function(_0x1b5597){if(_0x1b5597[_0x4632('0x31')]!==_0x4632('0x41')){var _0x4c01b3={};_0x4c01b3[_0x1b5597['name']]={'$like':'%'+_0x5ef877['query']['filter']+'%'};return _0x4c01b3;}})});}_0x36979e=_[_0x4632('0x42')]({},_0x36979e,_0x5ef877[_0x4632('0x43')]);var _0x2bbeec={'where':_0x36979e[_0x4632('0x3e')]};return db[_0x4632('0x2f')][_0x4632('0x22')](_0x2bbeec)[_0x4632('0x27')](function(_0x37a626){_0x32412f[_0x4632('0x22')]=_0x37a626;if(_0x5ef877[_0x4632('0x34')][_0x4632('0x44')]){_0x36979e['include']=[{'all':!![]}];}return db[_0x4632('0x2f')][_0x4632('0x45')](_0x36979e);})[_0x4632('0x27')](function(_0x6e2a2e){_0x32412f['rows']=_0x6e2a2e;return _0x32412f;})[_0x4632('0x27')](respondWithFilteredResult(_0x4b473a,_0x36979e))[_0x4632('0x46')](handleError(_0x4b473a,null));};exports[_0x4632('0x47')]=function(_0x537ee8,_0x575f59){var _0x27c546={'raw':!![],'where':{'id':_0x537ee8[_0x4632('0x48')]['id']}},_0x1b081d={};_0x1b081d[_0x4632('0x32')]=_[_0x4632('0x33')](db[_0x4632('0x2f')][_0x4632('0x49')]);_0x1b081d[_0x4632('0x34')]=_['keys'](_0x537ee8[_0x4632('0x34')]);_0x1b081d[_0x4632('0x35')]=_[_0x4632('0x36')](_0x1b081d['model'],_0x1b081d[_0x4632('0x34')]);_0x27c546['attributes']=_[_0x4632('0x36')](_0x1b081d[_0x4632('0x32')],qs[_0x4632('0x38')](_0x537ee8[_0x4632('0x34')][_0x4632('0x38')]));_0x27c546['attributes']=_0x27c546[_0x4632('0x37')][_0x4632('0x39')]?_0x27c546[_0x4632('0x37')]:_0x1b081d['model'];if(_0x537ee8['query'][_0x4632('0x44')]){_0x27c546[_0x4632('0x4a')]=[{'all':!![]}];}_0x27c546=_[_0x4632('0x42')]({},_0x27c546,_0x537ee8[_0x4632('0x43')]);return db[_0x4632('0x2f')][_0x4632('0x4b')](_0x27c546)[_0x4632('0x27')](handleEntityNotFound(_0x575f59,null))[_0x4632('0x27')](respondWithResult(_0x575f59,null))[_0x4632('0x46')](handleError(_0x575f59,null));};exports[_0x4632('0x4c')]=function(_0x21858e,_0x2728ac){return db[_0x4632('0x2f')][_0x4632('0x4c')](_0x21858e[_0x4632('0x4d')],{})[_0x4632('0x27')](function(_0x418900){var _0x378157=_0x21858e[_0x4632('0x4e')][_0x4632('0x29')]({'plain':!![]});if(!_0x378157)throw new Error(_0x4632('0x4f'));if(_0x378157[_0x4632('0x50')]===_0x4632('0x4e')){var _0x2709af=_0x418900[_0x4632('0x29')]({'plain':!![]});var _0x2b90df=_0x4632('0x2a');return db[_0x4632('0x51')][_0x4632('0x4b')]({'where':{'name':_0x2b90df,'userProfileId':_0x378157[_0x4632('0x52')]},'raw':!![]})[_0x4632('0x27')](function(_0x2afd3d){if(_0x2afd3d&&_0x2afd3d[_0x4632('0x53')]===0x0){return db[_0x4632('0x2b')]['create']({'name':_0x2709af[_0x4632('0x2d')],'resourceId':_0x2709af['id'],'type':_0x2afd3d[_0x4632('0x2d')],'sectionId':_0x2afd3d['id']},{})[_0x4632('0x27')](function(){return _0x418900;});}else{return _0x418900;}})[_0x4632('0x46')](function(_0x66dbf9){logger[_0x4632('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x66dbf9);throw _0x66dbf9;});}return _0x418900;})[_0x4632('0x27')](respondWithResult(_0x2728ac,0xc9))['catch'](handleError(_0x2728ac,null));};exports[_0x4632('0x26')]=function(_0x3788aa,_0x2ac005){if(_0x3788aa[_0x4632('0x4d')]['id']){delete _0x3788aa[_0x4632('0x4d')]['id'];}return db[_0x4632('0x2f')][_0x4632('0x4b')]({'where':{'id':_0x3788aa[_0x4632('0x48')]['id']}})['then'](handleEntityNotFound(_0x2ac005,null))[_0x4632('0x27')](saveUpdates(_0x3788aa[_0x4632('0x4d')],null))['then'](respondWithResult(_0x2ac005,null))['catch'](handleError(_0x2ac005,null));};exports[_0x4632('0x28')]=function(_0x4e2638,_0x33ccfe){return db['Interval']['find']({'where':{'id':_0x4e2638[_0x4632('0x48')]['id']}})[_0x4632('0x27')](handleEntityNotFound(_0x33ccfe,null))[_0x4632('0x27')](removeEntity(_0x33ccfe,null))[_0x4632('0x46')](handleError(_0x33ccfe,null));};exports[_0x4632('0x55')]=function(_0x1e572e,_0x3437cd,_0x552cc7){if(_0x1e572e[_0x4632('0x4d')]['id']){delete _0x1e572e[_0x4632('0x4d')]['id'];}return db['Interval']['find']({'where':{'id':_0x1e572e[_0x4632('0x48')]['id']}})[_0x4632('0x27')](handleEntityNotFound(_0x3437cd,null))[_0x4632('0x27')](function(_0x554107){if(_0x554107){_0x1e572e['body'][_0x4632('0x56')]=_0x554107['id'];return db[_0x4632('0x2f')]['create'](_0x1e572e['body']);}})[_0x4632('0x27')](respondWithResult(_0x3437cd,null))['catch'](handleError(_0x3437cd,null));};exports[_0x4632('0x57')]=function(_0x124cc5,_0x4c9ff6,_0x26b4b8){var _0x5043f0={};var _0x440c7e={};var _0x2f05f3;var _0x5ba02c;return db[_0x4632('0x2f')][_0x4632('0x58')]({'where':{'id':_0x124cc5['params']['id']}})[_0x4632('0x27')](handleEntityNotFound(_0x4c9ff6,null))[_0x4632('0x27')](function(_0x1decdf){if(_0x1decdf){_0x2f05f3=_0x1decdf;_0x440c7e[_0x4632('0x32')]=_[_0x4632('0x33')](db[_0x4632('0x2f')][_0x4632('0x49')]);_0x440c7e[_0x4632('0x34')]=_['keys'](_0x124cc5['query']);_0x440c7e[_0x4632('0x35')]=_[_0x4632('0x36')](_0x440c7e['model'],_0x440c7e[_0x4632('0x34')]);_0x5043f0[_0x4632('0x37')]=_[_0x4632('0x36')](_0x440c7e[_0x4632('0x32')],qs[_0x4632('0x38')](_0x124cc5[_0x4632('0x34')][_0x4632('0x38')]));_0x5043f0[_0x4632('0x37')]=_0x5043f0[_0x4632('0x37')][_0x4632('0x39')]?_0x5043f0['attributes']:_0x440c7e[_0x4632('0x32')];_0x5043f0[_0x4632('0x3c')]=qs[_0x4632('0x3d')](_0x124cc5[_0x4632('0x34')][_0x4632('0x3d')]);_0x5043f0[_0x4632('0x3e')]=qs[_0x4632('0x35')](_[_0x4632('0x3f')](_0x124cc5[_0x4632('0x34')],_0x440c7e[_0x4632('0x35')]));if(_0x124cc5[_0x4632('0x34')][_0x4632('0x40')]){_0x5043f0[_0x4632('0x3e')]=_[_0x4632('0x42')](_0x5043f0[_0x4632('0x3e')],{'$or':_[_0x4632('0x2e')](_0x5043f0['attributes'],function(_0x50a2f8){var _0x11c8e7={};_0x11c8e7[_0x50a2f8]={'$like':'%'+_0x124cc5['query'][_0x4632('0x40')]+'%'};return _0x11c8e7;})});}_0x5043f0=_[_0x4632('0x42')]({},_0x5043f0,_0x124cc5['options']);return _0x2f05f3[_0x4632('0x57')](_0x5043f0);}})[_0x4632('0x27')](function(_0x1b93f5){if(_0x1b93f5){_0x5ba02c=_0x1b93f5[_0x4632('0x39')];if(!_0x124cc5['query']['hasOwnProperty'](_0x4632('0x3b'))){_0x5043f0[_0x4632('0x20')]=qs['limit'](_0x124cc5[_0x4632('0x34')][_0x4632('0x20')]);_0x5043f0[_0x4632('0x1f')]=qs[_0x4632('0x1f')](_0x124cc5['query'][_0x4632('0x1f')]);}return _0x2f05f3[_0x4632('0x57')](_0x5043f0);}})[_0x4632('0x27')](function(_0x15f60b){if(_0x15f60b){return _0x15f60b?{'count':_0x5ba02c,'rows':_0x15f60b}:null;}})[_0x4632('0x27')](respondWithResult(_0x4c9ff6,null))[_0x4632('0x46')](handleError(_0x4c9ff6,null));};exports[_0x4632('0x59')]=function(_0x53529d,_0x221114,_0x127d83){return db[_0x4632('0x2f')][_0x4632('0x58')]({'where':{'id':_0x53529d['params']['id']}})[_0x4632('0x27')](handleEntityNotFound(_0x221114,null))[_0x4632('0x27')](function(_0x43f012){if(_0x43f012){return db[_0x4632('0x5a')]['transaction'](function(_0xe68ae8){return db[_0x4632('0x2f')][_0x4632('0x28')]({'where':{'IntervalId':_0x53529d[_0x4632('0x48')]['id']},'transaction':_0xe68ae8})[_0x4632('0x27')](function(_0x1ffec4){var _0x5c916b=_[_0x4632('0x2e')](_0x53529d[_0x4632('0x4d')],function(_0x1528e9){delete _0x1528e9['id'];_0x1528e9[_0x4632('0x56')]=_0x53529d['params']['id'];return _0x1528e9;});return db[_0x4632('0x2f')]['bulkCreate'](_0x5c916b,{'transaction':_0xe68ae8});});})[_0x4632('0x27')](function(){return db['Interval'][_0x4632('0x45')]({'where':{'IntervalId':_0x53529d[_0x4632('0x48')]['id']}});});}})['then'](respondWithResult(_0x221114,null))['catch'](handleError(_0x221114,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index bbc6c26..bf785f8 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 _0xfc61=['lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./interval.attributes','define','Interval','tools_intervals','rewrite'];(function(_0x25c57f,_0x30ca62){var _0x1e77d2=function(_0x4ebb5b){while(--_0x4ebb5b){_0x25c57f['push'](_0x25c57f['shift']());}};_0x1e77d2(++_0x30ca62);}(_0xfc61,0x78));var _0x1fc6=function(_0x29fb49,_0x1b4669){_0x29fb49=_0x29fb49-0x0;var _0x24d579=_0xfc61[_0x29fb49];return _0x24d579;};'use strict';var _=require(_0x1fc6('0x0'));var util=require(_0x1fc6('0x1'));var logger=require(_0x1fc6('0x2'))(_0x1fc6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fc6('0x4'));var rimraf=require(_0x1fc6('0x5'));var config=require(_0x1fc6('0x6'));var attributes=require(_0x1fc6('0x7'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x2c32ca,_0x2afe7c){return _0x2c32ca[_0x1fc6('0x8')](_0x1fc6('0x9'),attributes,{'tableName':_0x1fc6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x567c47,_0x8891cc){extensions[_0x1fc6('0xb')](_0x2c32ca,_0x567c47);},'afterBulkCreate':function(_0x300375,_0x132f16,_0x5a3e6f){_0x5a3e6f();extensions[_0x1fc6('0xb')](_0x2c32ca,_0x300375[0x0]);},'afterUpdate':function(_0xd02ed5,_0x480324){extensions[_0x1fc6('0xb')](_0x2c32ca,_0xd02ed5);},'afterDestroy':function(_0x12c3d9,_0x2bc710){extensions[_0x1fc6('0xb')](_0x2c32ca,_0x12c3d9);}}});}; \ No newline at end of file +var _0xd5c4=['Interval','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','../../components/extensions/rewrite','define'];(function(_0x2249c2,_0x125dd2){var _0xa94ad=function(_0x24c014){while(--_0x24c014){_0x2249c2['push'](_0x2249c2['shift']());}};_0xa94ad(++_0x125dd2);}(_0xd5c4,0x12d));var _0x4d5c=function(_0x31f7fe,_0xbad764){_0x31f7fe=_0x31f7fe-0x0;var _0xcaed36=_0xd5c4[_0x31f7fe];return _0xcaed36;};'use strict';var _=require(_0x4d5c('0x0'));var util=require(_0x4d5c('0x1'));var logger=require(_0x4d5c('0x2'))(_0x4d5c('0x3'));var moment=require(_0x4d5c('0x4'));var BPromise=require(_0x4d5c('0x5'));var rp=require(_0x4d5c('0x6'));var fs=require('fs');var path=require(_0x4d5c('0x7'));var rimraf=require('rimraf');var config=require(_0x4d5c('0x8'));var attributes=require('./interval.attributes');var extensions=require(_0x4d5c('0x9'));module['exports']=function(_0x453881,_0x3000a7){return _0x453881[_0x4d5c('0xa')](_0x4d5c('0xb'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ecf04,_0x43a4e6){extensions['rewrite'](_0x453881,_0x1ecf04);},'afterBulkCreate':function(_0x42a5ce,_0x570729,_0x1ab514){_0x1ab514();extensions[_0x4d5c('0xc')](_0x453881,_0x42a5ce[0x0]);},'afterUpdate':function(_0x5ce2ac,_0x1e625a){extensions['rewrite'](_0x453881,_0x5ce2ac);},'afterDestroy':function(_0x2be347,_0x28f489){extensions[_0x4d5c('0xc')](_0x453881,_0x2be347);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 68963cc..fc69d67 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 _0x2bb2=['options','raw','where','limit','include','map','model','ShowInterval','find','attributes','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetInterval','Interval','findAll'];(function(_0x2bf635,_0x454fe4){var _0xfed6a=function(_0x35d099){while(--_0x35d099){_0x2bf635['push'](_0x2bf635['shift']());}};_0xfed6a(++_0x454fe4);}(_0x2bb2,0x133));var _0x22bb=function(_0x2e1a9a,_0x11e43f){_0x2e1a9a=_0x2e1a9a-0x0;var _0x33f5e7=_0x2bb2[_0x2e1a9a];return _0x33f5e7;};'use strict';var _=require(_0x22bb('0x0'));var util=require(_0x22bb('0x1'));var moment=require(_0x22bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x22bb('0x3'));var fs=require('fs');var Redis=require(_0x22bb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x22bb('0x5'));var logger=require(_0x22bb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x22bb('0x7')][_0x22bb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x122f7f,_0x265c0a,_0x346899){return new BPromise(function(_0x144438,_0x1ded73){return client[_0x22bb('0x9')](_0x122f7f,_0x346899)[_0x22bb('0xa')](function(_0xd825a4){logger[_0x22bb('0xb')](_0x22bb('0xc'),_0x265c0a,_0x22bb('0xd'));logger[_0x22bb('0xe')](_0x22bb('0xf'),_0x265c0a,_0x22bb('0xd'),JSON[_0x22bb('0x10')](_0xd825a4));if(_0xd825a4[_0x22bb('0x11')]){if(_0xd825a4['error']['code']===0x1f4){logger[_0x22bb('0x11')](_0x22bb('0xc'),_0x265c0a,_0xd825a4[_0x22bb('0x11')][_0x22bb('0x12')]);return _0x1ded73(_0xd825a4[_0x22bb('0x11')]['message']);}logger[_0x22bb('0x11')]('Interval,\x20%s,\x20%s',_0x265c0a,_0xd825a4['error'][_0x22bb('0x12')]);return _0x144438(_0xd825a4['error']['message']);}else{logger[_0x22bb('0xb')](_0x22bb('0xc'),_0x265c0a,'request\x20sent');_0x144438(_0xd825a4['result'][_0x22bb('0x12')]);}})[_0x22bb('0x13')](function(_0x4cd5ab){logger[_0x22bb('0x11')](_0x22bb('0xc'),_0x265c0a,_0x4cd5ab);_0x1ded73(_0x4cd5ab);});});}exports[_0x22bb('0x14')]=function(_0x4deb7f){var _0x1f3f4d=this;return new Promise(function(_0x25f660,_0x353799){return db[_0x22bb('0x15')][_0x22bb('0x16')]({'raw':_0x4deb7f[_0x22bb('0x17')]?_0x4deb7f['options'][_0x22bb('0x18')]===undefined?!![]:![]:!![],'where':_0x4deb7f[_0x22bb('0x17')]?_0x4deb7f[_0x22bb('0x17')][_0x22bb('0x19')]||null:null,'attributes':_0x4deb7f[_0x22bb('0x17')]?_0x4deb7f[_0x22bb('0x17')]['attributes']||null:null,'limit':_0x4deb7f[_0x22bb('0x17')]?_0x4deb7f[_0x22bb('0x17')][_0x22bb('0x1a')]||null:null,'include':_0x4deb7f[_0x22bb('0x17')]?_0x4deb7f['options'][_0x22bb('0x1b')]?_[_0x22bb('0x1c')](_0x4deb7f['options'][_0x22bb('0x1b')],function(_0x1447e0){return{'model':db[_0x1447e0[_0x22bb('0x1d')]],'as':_0x1447e0['as'],'attributes':_0x1447e0['attributes'],'include':_0x1447e0[_0x22bb('0x1b')]?_['map'](_0x1447e0[_0x22bb('0x1b')],function(_0x4583e2){return{'model':db[_0x4583e2['model']],'as':_0x4583e2['as'],'attributes':_0x4583e2['attributes'],'include':_0x4583e2['include']?_[_0x22bb('0x1c')](_0x4583e2['include'],function(_0x272dfa){return{'model':db[_0x272dfa['model']],'as':_0x272dfa['as'],'attributes':_0x272dfa['attributes']};}):[]};}):[]};}):[]:[]})[_0x22bb('0xa')](function(_0x71f705){logger[_0x22bb('0xb')]('GetInterval',_0x4deb7f);logger[_0x22bb('0xe')](_0x22bb('0x14'),_0x4deb7f,JSON[_0x22bb('0x10')](_0x71f705));_0x25f660(_0x71f705);})[_0x22bb('0x13')](function(_0x361f11){logger[_0x22bb('0x11')](_0x22bb('0x14'),_0x361f11[_0x22bb('0x12')],_0x4deb7f);_0x353799(_0x1f3f4d[_0x22bb('0x11')](0x1f4,_0x361f11['message']));});});};exports[_0x22bb('0x1e')]=function(_0x574dd5){var _0x5ab44a=this;return new Promise(function(_0x46aadf,_0x520fd1){return db[_0x22bb('0x15')][_0x22bb('0x1f')]({'raw':_0x574dd5[_0x22bb('0x17')]?_0x574dd5[_0x22bb('0x17')][_0x22bb('0x18')]===undefined?!![]:![]:!![],'where':_0x574dd5[_0x22bb('0x17')]?_0x574dd5[_0x22bb('0x17')]['where']||null:null,'attributes':_0x574dd5[_0x22bb('0x17')]?_0x574dd5[_0x22bb('0x17')]['attributes']||null:null,'include':_0x574dd5[_0x22bb('0x17')]?_0x574dd5['options']['include']?_['map'](_0x574dd5['options'][_0x22bb('0x1b')],function(_0x1c1dd3){return{'model':db[_0x1c1dd3['model']],'as':_0x1c1dd3['as'],'attributes':_0x1c1dd3['attributes'],'include':_0x1c1dd3['include']?_[_0x22bb('0x1c')](_0x1c1dd3['include'],function(_0x1cba5f){return{'model':db[_0x1cba5f[_0x22bb('0x1d')]],'as':_0x1cba5f['as'],'attributes':_0x1cba5f[_0x22bb('0x20')],'include':_0x1cba5f[_0x22bb('0x1b')]?_[_0x22bb('0x1c')](_0x1cba5f['include'],function(_0x6e9f1c){return{'model':db[_0x6e9f1c[_0x22bb('0x1d')]],'as':_0x6e9f1c['as'],'attributes':_0x6e9f1c[_0x22bb('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b88f9){logger[_0x22bb('0xb')](_0x22bb('0x1e'),_0x574dd5);logger[_0x22bb('0xe')](_0x22bb('0x1e'),_0x574dd5,JSON[_0x22bb('0x10')](_0x2b88f9));_0x46aadf(_0x2b88f9);})[_0x22bb('0x13')](function(_0x1efc3d){logger[_0x22bb('0x11')](_0x22bb('0x1e'),_0x1efc3d[_0x22bb('0x12')],_0x574dd5);_0x520fd1(_0x5ab44a['error'](0x1f4,_0x1efc3d[_0x22bb('0x12')]));});});}; \ No newline at end of file +var _0x2225=['debug','stringify','error','code','message','result','GetInterval','findAll','options','raw','where','attributes','include','map','model','catch','ShowInterval','find','then','info','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','Interval,\x20%s,\x20%s','request\x20sent'];(function(_0x42de31,_0x2d33eb){var _0x313209=function(_0x25d3d9){while(--_0x25d3d9){_0x42de31['push'](_0x42de31['shift']());}};_0x313209(++_0x2d33eb);}(_0x2225,0x194));var _0x5222=function(_0x373250,_0x2f013f){_0x373250=_0x373250-0x0;var _0x18992a=_0x2225[_0x373250];return _0x18992a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5222('0x0'));var BPromise=require(_0x5222('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5222('0x2'));var db=require(_0x5222('0x3'))['db'];var utils=require(_0x5222('0x4'));var logger=require('../../config/logger')(_0x5222('0x5'));var config=require(_0x5222('0x6'));var jayson=require(_0x5222('0x7'));var client=jayson[_0x5222('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aa892,_0x3fc383,_0x518146){return new BPromise(function(_0x17a308,_0x5bdb27){return client[_0x5222('0x9')](_0x3aa892,_0x518146)['then'](function(_0x530f24){logger['info'](_0x5222('0xa'),_0x3fc383,_0x5222('0xb'));logger[_0x5222('0xc')]('Interval,\x20%s,\x20%s,\x20%s',_0x3fc383,_0x5222('0xb'),JSON[_0x5222('0xd')](_0x530f24));if(_0x530f24[_0x5222('0xe')]){if(_0x530f24['error'][_0x5222('0xf')]===0x1f4){logger['error'](_0x5222('0xa'),_0x3fc383,_0x530f24['error'][_0x5222('0x10')]);return _0x5bdb27(_0x530f24[_0x5222('0xe')][_0x5222('0x10')]);}logger['error'](_0x5222('0xa'),_0x3fc383,_0x530f24['error'][_0x5222('0x10')]);return _0x17a308(_0x530f24[_0x5222('0xe')][_0x5222('0x10')]);}else{logger['info'](_0x5222('0xa'),_0x3fc383,_0x5222('0xb'));_0x17a308(_0x530f24[_0x5222('0x11')][_0x5222('0x10')]);}})['catch'](function(_0x3a109a){logger[_0x5222('0xe')](_0x5222('0xa'),_0x3fc383,_0x3a109a);_0x5bdb27(_0x3a109a);});});}exports[_0x5222('0x12')]=function(_0x178e1f){var _0x2b68fe=this;return new Promise(function(_0x1357f4,_0x5ee925){return db['Interval'][_0x5222('0x13')]({'raw':_0x178e1f[_0x5222('0x14')]?_0x178e1f['options'][_0x5222('0x15')]===undefined?!![]:![]:!![],'where':_0x178e1f[_0x5222('0x14')]?_0x178e1f['options'][_0x5222('0x16')]||null:null,'attributes':_0x178e1f['options']?_0x178e1f[_0x5222('0x14')][_0x5222('0x17')]||null:null,'limit':_0x178e1f['options']?_0x178e1f[_0x5222('0x14')]['limit']||null:null,'include':_0x178e1f['options']?_0x178e1f[_0x5222('0x14')][_0x5222('0x18')]?_[_0x5222('0x19')](_0x178e1f[_0x5222('0x14')][_0x5222('0x18')],function(_0x4a99bc){return{'model':db[_0x4a99bc[_0x5222('0x1a')]],'as':_0x4a99bc['as'],'attributes':_0x4a99bc[_0x5222('0x17')],'include':_0x4a99bc[_0x5222('0x18')]?_[_0x5222('0x19')](_0x4a99bc[_0x5222('0x18')],function(_0x18e0b1){return{'model':db[_0x18e0b1[_0x5222('0x1a')]],'as':_0x18e0b1['as'],'attributes':_0x18e0b1[_0x5222('0x17')],'include':_0x18e0b1[_0x5222('0x18')]?_[_0x5222('0x19')](_0x18e0b1[_0x5222('0x18')],function(_0x187ecb){return{'model':db[_0x187ecb[_0x5222('0x1a')]],'as':_0x187ecb['as'],'attributes':_0x187ecb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c634a){logger['info']('GetInterval',_0x178e1f);logger[_0x5222('0xc')]('GetInterval',_0x178e1f,JSON[_0x5222('0xd')](_0x3c634a));_0x1357f4(_0x3c634a);})[_0x5222('0x1b')](function(_0x1e4d21){logger[_0x5222('0xe')]('GetInterval',_0x1e4d21[_0x5222('0x10')],_0x178e1f);_0x5ee925(_0x2b68fe[_0x5222('0xe')](0x1f4,_0x1e4d21[_0x5222('0x10')]));});});};exports[_0x5222('0x1c')]=function(_0x4af986){var _0x311fd9=this;return new Promise(function(_0x55e046,_0x4e5c20){return db['Interval'][_0x5222('0x1d')]({'raw':_0x4af986[_0x5222('0x14')]?_0x4af986[_0x5222('0x14')][_0x5222('0x15')]===undefined?!![]:![]:!![],'where':_0x4af986[_0x5222('0x14')]?_0x4af986[_0x5222('0x14')][_0x5222('0x16')]||null:null,'attributes':_0x4af986[_0x5222('0x14')]?_0x4af986['options'][_0x5222('0x17')]||null:null,'include':_0x4af986['options']?_0x4af986[_0x5222('0x14')][_0x5222('0x18')]?_[_0x5222('0x19')](_0x4af986['options'][_0x5222('0x18')],function(_0x598d77){return{'model':db[_0x598d77['model']],'as':_0x598d77['as'],'attributes':_0x598d77['attributes'],'include':_0x598d77[_0x5222('0x18')]?_[_0x5222('0x19')](_0x598d77['include'],function(_0x24e97e){return{'model':db[_0x24e97e[_0x5222('0x1a')]],'as':_0x24e97e['as'],'attributes':_0x24e97e['attributes'],'include':_0x24e97e['include']?_[_0x5222('0x19')](_0x24e97e[_0x5222('0x18')],function(_0x432bbf){return{'model':db[_0x432bbf['model']],'as':_0x432bbf['as'],'attributes':_0x432bbf['attributes']};}):[]};}):[]};}):[]:[]})[_0x5222('0x1e')](function(_0x136c9c){logger[_0x5222('0x1f')](_0x5222('0x1c'),_0x4af986);logger[_0x5222('0xc')](_0x5222('0x1c'),_0x4af986,JSON[_0x5222('0xd')](_0x136c9c));_0x55e046(_0x136c9c);})[_0x5222('0x1b')](function(_0x142f5d){logger[_0x5222('0xe')](_0x5222('0x1c'),_0x142f5d['message'],_0x4af986);_0x4e5c20(_0x311fd9[_0x5222('0xe')](0x1f4,_0x142f5d['message']));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index ade4f42..551fde0 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 _0xeefd=['post','isAuthenticated','send','exports','express','Router','./jira.controller'];(function(_0x3972e9,_0xdd1d03){var _0x4b87c0=function(_0x4c0d34){while(--_0x4c0d34){_0x3972e9['push'](_0x3972e9['shift']());}};_0x4b87c0(++_0xdd1d03);}(_0xeefd,0xeb));var _0xdeef=function(_0x2db175,_0x320320){_0x2db175=_0x2db175-0x0;var _0x4a52ea=_0xeefd[_0x2db175];return _0x4a52ea;};'use strict';var express=require(_0xdeef('0x0'));var router=express[_0xdeef('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xdeef('0x2'));router[_0xdeef('0x3')]('/',auth[_0xdeef('0x4')](),controller[_0xdeef('0x5')]);module[_0xdeef('0x6')]=router; \ No newline at end of file +var _0xc53a=['Router','../../components/auth/service','isAuthenticated','send','express'];(function(_0x101134,_0x1ed1d3){var _0xc47acc=function(_0x7ea469){while(--_0x7ea469){_0x101134['push'](_0x101134['shift']());}};_0xc47acc(++_0x1ed1d3);}(_0xc53a,0xd6));var _0xac53=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc53a[_0x167cc1];return _0x10bc4b;};'use strict';var express=require(_0xac53('0x0'));var router=express[_0xac53('0x1')]();var auth=require(_0xac53('0x2'));var controller=require('./jira.controller');router['post']('/',auth[_0xac53('0x3')](),controller[_0xac53('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 2680035..27afd48 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 _0x5b2e=['customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','request','setEncoding','utf8','data','status','statusCode','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','https','../../config/logger','api','support','3eAmWpBVP0','key','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11501','oldToken','customfield_11502','newToken'];(function(_0x25deaf,_0x5d3e5b){var _0x579eb8=function(_0x11990e){while(--_0x11990e){_0x25deaf['push'](_0x25deaf['shift']());}};_0x579eb8(++_0x5d3e5b);}(_0x5b2e,0x1c8));var _0xe5b2=function(_0x19e975,_0x2ad9fc){_0x19e975=_0x19e975-0x0;var _0x283c52=_0x5b2e[_0x19e975];return _0x283c52;};'use strict';var BPromise=require('bluebird');var https=require(_0xe5b2('0x0'));var logger=require(_0xe5b2('0x1'))(_0xe5b2('0x2'));var USERNAME=_0xe5b2('0x3');var PASSWORD=_0xe5b2('0x4');function openIssue(_0x374473,_0x179e87){var _0x1777da={'fields':{'project':{'key':_0x374473[_0xe5b2('0x5')]||'MOTGUI'},'summary':(_0x374473['summary']||_0xe5b2('0x6'))+_0xe5b2('0x7')+_0x374473['ip'],'description':_0x374473[_0xe5b2('0x8')]||JSON[_0xe5b2('0x9')](_0x374473),'issuetype':{'name':_0x374473[_0xe5b2('0xa')]||_0xe5b2('0xb')}}};_0x1777da[_0xe5b2('0xc')]['customfield_11500']=_0x374473['email'];_0x1777da['fields'][_0xe5b2('0xd')]=_0x374473[_0xe5b2('0xe')];_0x1777da[_0xe5b2('0xc')][_0xe5b2('0xf')]=_0x374473[_0xe5b2('0x10')];_0x1777da['fields'][_0xe5b2('0x11')]=_0x374473['name'];_0x1777da[_0xe5b2('0xc')][_0xe5b2('0x12')]=_0x374473[_0xe5b2('0x13')];_0x1777da[_0xe5b2('0xc')][_0xe5b2('0x14')]=_0x374473['ip'];var _0x30f7c6={'host':_0xe5b2('0x15'),'port':0x1bb,'path':_0xe5b2('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xe5b2('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x5ec4a0=JSON[_0xe5b2('0x9')](_0x1777da);var _0x3bff08=https[_0xe5b2('0x18')](_0x30f7c6,function(_0x2a53cb){_0x2a53cb[_0xe5b2('0x19')](_0xe5b2('0x1a'));var _0x14766d='';_0x2a53cb['on'](_0xe5b2('0x1b'),function(_0x494f17){_0x14766d+=_0x494f17;});_0x2a53cb['on']('end',function(){if(_0x179e87){return _0x179e87[_0xe5b2('0x1c')](_0x2a53cb[_0xe5b2('0x1d')])['json'](JSON[_0xe5b2('0x1e')](_0x14766d));}});});_0x3bff08['on'](_0xe5b2('0x1f'),function(_0xbf6cb6){if(_0x179e87){return _0x179e87[_0xe5b2('0x1c')](0x1f4)['json']({'errors':[{'message':_0xe5b2('0x20'),'type':_0xe5b2('0x21')}]});}});_0x3bff08[_0xe5b2('0x22')](_0x5ec4a0);_0x3bff08[_0xe5b2('0x23')]();}exports['openIssue']=openIssue;exports[_0xe5b2('0x24')]=function(_0x5cd6a7,_0x3e99e0){_0x5cd6a7['body']['ip']=_0x5cd6a7[_0xe5b2('0x25')][_0xe5b2('0x26')]||_0x5cd6a7[_0xe5b2('0x27')][_0xe5b2('0x28')]||_0x5cd6a7[_0xe5b2('0x29')][_0xe5b2('0x28')]||_0x5cd6a7[_0xe5b2('0x27')]['socket'][_0xe5b2('0x28')];return openIssue(_0x5cd6a7[_0xe5b2('0x2a')],_0x3e99e0);}; \ No newline at end of file +var _0x89ac=['key','Report','\x20from\x20','description','issuetype','fields','email','customfield_11501','oldToken','customfield_11502','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','stringify','request','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','https','../../config/logger','api'];(function(_0x75da33,_0x2096b1){var _0x5a5571=function(_0x21d941){while(--_0x21d941){_0x75da33['push'](_0x75da33['shift']());}};_0x5a5571(++_0x2096b1);}(_0x89ac,0x7b));var _0xc89a=function(_0x23c9bd,_0x482ca2){_0x23c9bd=_0x23c9bd-0x0;var _0x549cb5=_0x89ac[_0x23c9bd];return _0x549cb5;};'use strict';var BPromise=require('bluebird');var https=require(_0xc89a('0x0'));var logger=require(_0xc89a('0x1'))(_0xc89a('0x2'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x4101b4,_0x4c288b){var _0xfe5a91={'fields':{'project':{'key':_0x4101b4[_0xc89a('0x3')]||'MOTGUI'},'summary':(_0x4101b4['summary']||_0xc89a('0x4'))+_0xc89a('0x5')+_0x4101b4['ip'],'description':_0x4101b4[_0xc89a('0x6')]||JSON['stringify'](_0x4101b4),'issuetype':{'name':_0x4101b4[_0xc89a('0x7')]||'Bug'}}};_0xfe5a91[_0xc89a('0x8')]['customfield_11500']=_0x4101b4[_0xc89a('0x9')];_0xfe5a91['fields'][_0xc89a('0xa')]=_0x4101b4[_0xc89a('0xb')];_0xfe5a91['fields'][_0xc89a('0xc')]=_0x4101b4['newToken'];_0xfe5a91[_0xc89a('0x8')][_0xc89a('0xd')]=_0x4101b4[_0xc89a('0xe')];_0xfe5a91['fields']['customfield_11504']=_0x4101b4[_0xc89a('0xf')];_0xfe5a91[_0xc89a('0x8')][_0xc89a('0x10')]=_0x4101b4['ip'];var _0x165ab8={'host':_0xc89a('0x11'),'port':0x1bb,'path':_0xc89a('0x12'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xc89a('0x13'),'Authorization':_0xc89a('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0xc89a('0x15')]('base64')}};var _0x254c93=JSON[_0xc89a('0x16')](_0xfe5a91);var _0x1f6683=https[_0xc89a('0x17')](_0x165ab8,function(_0x448a55){_0x448a55['setEncoding'](_0xc89a('0x18'));var _0x1372bf='';_0x448a55['on'](_0xc89a('0x19'),function(_0x3183a5){_0x1372bf+=_0x3183a5;});_0x448a55['on'](_0xc89a('0x1a'),function(){if(_0x4c288b){return _0x4c288b[_0xc89a('0x1b')](_0x448a55[_0xc89a('0x1c')])[_0xc89a('0x1d')](JSON[_0xc89a('0x1e')](_0x1372bf));}});});_0x1f6683['on'](_0xc89a('0x1f'),function(_0x4e3789){if(_0x4c288b){return _0x4c288b[_0xc89a('0x1b')](0x1f4)['json']({'errors':[{'message':_0xc89a('0x20'),'type':_0xc89a('0x21')}]});}});_0x1f6683[_0xc89a('0x22')](_0x254c93);_0x1f6683[_0xc89a('0x1a')]();}exports[_0xc89a('0x23')]=openIssue;exports[_0xc89a('0x24')]=function(_0x3307a9,_0x588a05){_0x3307a9[_0xc89a('0x25')]['ip']=_0x3307a9[_0xc89a('0x26')][_0xc89a('0x27')]||_0x3307a9['connection'][_0xc89a('0x28')]||_0x3307a9[_0xc89a('0x29')][_0xc89a('0x28')]||_0x3307a9['connection'][_0xc89a('0x29')][_0xc89a('0x28')];return openIssue(_0x3307a9[_0xc89a('0x25')],_0x588a05);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index a3a0996..129375a 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 _0x16f2=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x257fd4,_0x446a74){var _0x3bbcba=function(_0x53549c){while(--_0x53549c){_0x257fd4['push'](_0x257fd4['shift']());}};_0x3bbcba(++_0x446a74);}(_0x16f2,0x135));var _0x216f=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0x16f2[_0x5eb22e];return _0x27fed5;};'use strict';var multer=require(_0x216f('0x0'));var util=require(_0x216f('0x1'));var path=require(_0x216f('0x2'));var timeout=require('connect-timeout');var express=require(_0x216f('0x3'));var router=express[_0x216f('0x4')]();var fs_extra=require(_0x216f('0x5'));var auth=require(_0x216f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x216f('0x7'));var controller=require(_0x216f('0x8'));router['get']('/',auth[_0x216f('0x9')](),controller[_0x216f('0xa')]);router[_0x216f('0xb')](_0x216f('0xc'),auth[_0x216f('0x9')](),controller[_0x216f('0xd')]);router['get'](_0x216f('0xe'),auth[_0x216f('0x9')](),controller[_0x216f('0xf')]);router[_0x216f('0x10')]('/',auth['isAuthenticated'](),controller[_0x216f('0x11')]);router[_0x216f('0x12')](_0x216f('0xe'),auth[_0x216f('0x9')](),controller[_0x216f('0x13')]);router[_0x216f('0x14')]('/:id',auth[_0x216f('0x9')](),controller['destroy']);module[_0x216f('0x15')]=router; \ No newline at end of file +var _0xfc33=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x4e8ac0,_0x45d5d9){var _0x1ce292=function(_0xc1741f){while(--_0xc1741f){_0x4e8ac0['push'](_0x4e8ac0['shift']());}};_0x1ce292(++_0x45d5d9);}(_0xfc33,0x9f));var _0x3fc3=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xfc33[_0x1203f];return _0x365f0a;};'use strict';var multer=require(_0x3fc3('0x0'));var util=require(_0x3fc3('0x1'));var path=require(_0x3fc3('0x2'));var timeout=require('connect-timeout');var express=require(_0x3fc3('0x3'));var router=express[_0x3fc3('0x4')]();var fs_extra=require(_0x3fc3('0x5'));var auth=require(_0x3fc3('0x6'));var interaction=require(_0x3fc3('0x7'));var config=require(_0x3fc3('0x8'));var controller=require(_0x3fc3('0x9'));router[_0x3fc3('0xa')]('/',auth[_0x3fc3('0xb')](),controller[_0x3fc3('0xc')]);router['get'](_0x3fc3('0xd'),auth[_0x3fc3('0xb')](),controller[_0x3fc3('0xe')]);router[_0x3fc3('0xa')](_0x3fc3('0xf'),auth['isAuthenticated'](),controller[_0x3fc3('0x10')]);router[_0x3fc3('0x11')]('/',auth[_0x3fc3('0xb')](),controller['create']);router[_0x3fc3('0x12')](_0x3fc3('0xf'),auth[_0x3fc3('0xb')](),controller[_0x3fc3('0x13')]);router[_0x3fc3('0x14')](_0x3fc3('0xf'),auth[_0x3fc3('0xb')](),controller[_0x3fc3('0x15')]);module[_0x3fc3('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index a6ed679..9bdfdb7 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 _0x7fce=['sequelize','exports','TEXT','long','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fce,0xdc));var _0xe7fc=function(_0x52065d,_0x28d621){_0x52065d=_0x52065d-0x0;var _0x20bf41=_0x7fce[_0x52065d];return _0x20bf41;};'use strict';var Sequelize=require(_0xe7fc('0x0'));module[_0xe7fc('0x1')]={'question':{'type':Sequelize[_0xe7fc('0x2')]},'answer':{'type':Sequelize['TEXT'](_0xe7fc('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xe7fc('0x4')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe7fc('0x4')]},'calleridname':{'type':Sequelize[_0xe7fc('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x087b=['long','STRING','sequelize','exports'];(function(_0x39bc80,_0x18f609){var _0x350050=function(_0x318e71){while(--_0x318e71){_0x39bc80['push'](_0x39bc80['shift']());}};_0x350050(++_0x18f609);}(_0x087b,0x11a));var _0xb087=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x087b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb087('0x0'));module[_0xb087('0x1')]={'question':{'type':Sequelize['TEXT']},'answer':{'type':Sequelize['TEXT'](_0xb087('0x2'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xb087('0x3')]},'queue':{'type':Sequelize[_0xb087('0x3')]},'uniqueid':{'type':Sequelize[_0xb087('0x3')]},'calleridname':{'type':Sequelize[_0xb087('0x3')]},'calleridnum':{'type':Sequelize[_0xb087('0x3')]},'questionId':{'type':Sequelize[_0xb087('0x3')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 407d7cd..9a1a767 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 _0x857e=['offset','set','Content-Range','json','apply','update','then','destroy','stack','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','undefined','limit','count'];(function(_0x2870e6,_0x44e338){var _0x274d99=function(_0x2ef92e){while(--_0x2ef92e){_0x2870e6['push'](_0x2870e6['shift']());}};_0x274d99(++_0x44e338);}(_0x857e,0x14c));var _0xe857=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0x857e[_0x576e2b];return _0x46461a;};'use strict';var emlformat=require(_0xe857('0x0'));var rimraf=require(_0xe857('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe857('0x2'));var rp=require(_0xe857('0x3'));var moment=require(_0xe857('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe857('0x5'));var util=require(_0xe857('0x6'));var path=require(_0xe857('0x7'));var sox=require('sox');var csv=require(_0xe857('0x8'));var ejs=require(_0xe857('0x9'));var fs=require('fs');var fs_extra=require(_0xe857('0xa'));var _=require(_0xe857('0xb'));var squel=require(_0xe857('0xc'));var crypto=require('crypto');var jsforce=require(_0xe857('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe857('0xe'));var Papa=require(_0xe857('0xf'));var Redis=require('ioredis');var authService=require(_0xe857('0x10'));var qs=require(_0xe857('0x11'));var as=require(_0xe857('0x12'));var hardwareService=require(_0xe857('0x13'));var logger=require('../../config/logger')(_0xe857('0x14'));var utils=require('../../config/utils');var config=require(_0xe857('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22b699,_0x337204){_0x337204=_0x337204||0xcc;return function(_0x3d518b){if(_0x3d518b){return _0x22b699[_0xe857('0x16')](_0x337204);}return _0x22b699[_0xe857('0x17')](_0x337204)[_0xe857('0x18')]();};}function respondWithResult(_0x1c6054,_0x1497f3){_0x1497f3=_0x1497f3||0xc8;return function(_0x1d3410){if(_0x1d3410){return _0x1c6054[_0xe857('0x17')](_0x1497f3)['json'](_0x1d3410);}};}function respondWithFilteredResult(_0xfae086,_0x202ee7){return function(_0x5f5bcd){if(_0x5f5bcd){var _0x49e164=typeof _0x202ee7['offset']===_0xe857('0x19')&&typeof _0x202ee7[_0xe857('0x1a')]==='undefined';var _0x31d6d8=_0x5f5bcd[_0xe857('0x1b')];var _0x519ec7=_0x49e164?0x0:_0x202ee7[_0xe857('0x1c')];var _0x5a64e0=_0x49e164?_0x5f5bcd['count']:_0x202ee7['offset']+_0x202ee7[_0xe857('0x1a')];var _0x228929;if(_0x5a64e0>=_0x31d6d8){_0x5a64e0=_0x31d6d8;_0x228929=0xc8;}else{_0x228929=0xce;}_0xfae086[_0xe857('0x17')](_0x228929);return _0xfae086[_0xe857('0x1d')](_0xe857('0x1e'),_0x519ec7+'-'+_0x5a64e0+'/'+_0x31d6d8)[_0xe857('0x1f')](_0x5f5bcd);}return null;};}function patchUpdates(_0x877c2b){return function(_0x12ac35){try{jsonpatch[_0xe857('0x20')](_0x12ac35,_0x877c2b,!![]);}catch(_0x3fc18d){return BPromise['reject'](_0x3fc18d);}return _0x12ac35['save']();};}function saveUpdates(_0x43aeba,_0x155082){return function(_0x4f292e){if(_0x4f292e){return _0x4f292e[_0xe857('0x21')](_0x43aeba)[_0xe857('0x22')](function(_0x2d8ced){return _0x2d8ced;});}return null;};}function removeEntity(_0x3fcb29,_0x5c9446){return function(_0x2d437c){if(_0x2d437c){return _0x2d437c[_0xe857('0x23')]()[_0xe857('0x22')](function(){_0x3fcb29[_0xe857('0x17')](0xcc)[_0xe857('0x18')]();});}};}function handleEntityNotFound(_0x3f94ea,_0x2e2bd9){return function(_0x5e5ce4){if(!_0x5e5ce4){_0x3f94ea[_0xe857('0x16')](0x194);}return _0x5e5ce4;};}function handleError(_0x132533,_0x487435){_0x487435=_0x487435||0x1f4;return function(_0x152578){logger['error'](_0x152578[_0xe857('0x24')]);if(_0x152578['name']){delete _0x152578[_0xe857('0x25')];}_0x132533[_0xe857('0x17')](_0x487435)[_0xe857('0x26')](_0x152578);};}exports['index']=function(_0x40567c,_0x4b390d){var _0x422809={},_0x552e6d={},_0x48b9e0={'count':0x0,'rows':[]};var _0x2288b9=_[_0xe857('0x27')](db[_0xe857('0x28')][_0xe857('0x29')],function(_0x308ba3){return{'name':_0x308ba3[_0xe857('0x2a')],'type':_0x308ba3['type'][_0xe857('0x2b')]};});_0x552e6d[_0xe857('0x2c')]=_[_0xe857('0x27')](_0x2288b9,_0xe857('0x25'));_0x552e6d[_0xe857('0x2d')]=_[_0xe857('0x2e')](_0x40567c['query']);_0x552e6d[_0xe857('0x2f')]=_[_0xe857('0x30')](_0x552e6d[_0xe857('0x2c')],_0x552e6d[_0xe857('0x2d')]);_0x422809[_0xe857('0x31')]=_[_0xe857('0x30')](_0x552e6d[_0xe857('0x2c')],qs['fields'](_0x40567c['query'][_0xe857('0x32')]));_0x422809[_0xe857('0x31')]=_0x422809['attributes'][_0xe857('0x33')]?_0x422809['attributes']:_0x552e6d[_0xe857('0x2c')];if(!_0x40567c[_0xe857('0x2d')][_0xe857('0x34')](_0xe857('0x35'))){_0x422809[_0xe857('0x1a')]=qs[_0xe857('0x1a')](_0x40567c[_0xe857('0x2d')][_0xe857('0x1a')]);_0x422809[_0xe857('0x1c')]=qs['offset'](_0x40567c['query']['offset']);}_0x422809[_0xe857('0x36')]=qs[_0xe857('0x37')](_0x40567c['query'][_0xe857('0x37')]);_0x422809[_0xe857('0x38')]=qs[_0xe857('0x2f')](_['pick'](_0x40567c['query'],_0x552e6d[_0xe857('0x2f')]),_0x2288b9);if(_0x40567c[_0xe857('0x2d')][_0xe857('0x39')]){_0x422809[_0xe857('0x38')]=_[_0xe857('0x3a')](_0x422809[_0xe857('0x38')],{'$or':_['map'](_0x2288b9,function(_0x565d45){if(_0x565d45[_0xe857('0x3b')]!==_0xe857('0x3c')){var _0x37c7d4={};_0x37c7d4[_0x565d45['name']]={'$like':'%'+_0x40567c['query'][_0xe857('0x39')]+'%'};return _0x37c7d4;}})});}_0x422809=_[_0xe857('0x3a')]({},_0x422809,_0x40567c[_0xe857('0x3d')]);var _0x1b45af={'where':_0x422809['where']};return db['JscriptyAnswerReport'][_0xe857('0x1b')](_0x1b45af)[_0xe857('0x22')](function(_0x367221){_0x48b9e0[_0xe857('0x1b')]=_0x367221;if(_0x40567c[_0xe857('0x2d')][_0xe857('0x3e')]){_0x422809[_0xe857('0x3f')]=[{'all':!![]}];}return db[_0xe857('0x28')][_0xe857('0x40')](_0x422809);})[_0xe857('0x22')](function(_0x3328c8){_0x48b9e0[_0xe857('0x41')]=_0x3328c8;return _0x48b9e0;})[_0xe857('0x22')](respondWithFilteredResult(_0x4b390d,_0x422809))[_0xe857('0x42')](handleError(_0x4b390d,null));};exports['show']=function(_0x2660c9,_0x442fd2){var _0x556e8d={'raw':!![],'where':{'id':_0x2660c9[_0xe857('0x43')]['id']}},_0x500855={};_0x500855[_0xe857('0x2c')]=_['keys'](db[_0xe857('0x28')][_0xe857('0x29')]);_0x500855[_0xe857('0x2d')]=_[_0xe857('0x2e')](_0x2660c9[_0xe857('0x2d')]);_0x500855['filters']=_[_0xe857('0x30')](_0x500855[_0xe857('0x2c')],_0x500855['query']);_0x556e8d[_0xe857('0x31')]=_[_0xe857('0x30')](_0x500855[_0xe857('0x2c')],qs[_0xe857('0x32')](_0x2660c9['query'][_0xe857('0x32')]));_0x556e8d[_0xe857('0x31')]=_0x556e8d['attributes']['length']?_0x556e8d['attributes']:_0x500855['model'];if(_0x2660c9['query'][_0xe857('0x3e')]){_0x556e8d[_0xe857('0x3f')]=[{'all':!![]}];}_0x556e8d=_['merge']({},_0x556e8d,_0x2660c9['options']);return db['JscriptyAnswerReport'][_0xe857('0x44')](_0x556e8d)[_0xe857('0x22')](handleEntityNotFound(_0x442fd2,null))['then'](respondWithResult(_0x442fd2,null))[_0xe857('0x42')](handleError(_0x442fd2,null));};exports[_0xe857('0x45')]=function(_0x3f1485,_0x566f8d){return db[_0xe857('0x28')]['create'](_0x3f1485[_0xe857('0x46')],{})[_0xe857('0x22')](respondWithResult(_0x566f8d,0xc9))[_0xe857('0x42')](handleError(_0x566f8d,null));};exports[_0xe857('0x21')]=function(_0x4b1acd,_0x3f8191){if(_0x4b1acd[_0xe857('0x46')]['id']){delete _0x4b1acd['body']['id'];}return db['JscriptyAnswerReport'][_0xe857('0x44')]({'where':{'id':_0x4b1acd['params']['id']}})[_0xe857('0x22')](handleEntityNotFound(_0x3f8191,null))[_0xe857('0x22')](saveUpdates(_0x4b1acd[_0xe857('0x46')],null))[_0xe857('0x22')](respondWithResult(_0x3f8191,null))[_0xe857('0x42')](handleError(_0x3f8191,null));};exports['destroy']=function(_0x5c2eac,_0x33e3e7){return db[_0xe857('0x28')]['find']({'where':{'id':_0x5c2eac['params']['id']}})[_0xe857('0x22')](handleEntityNotFound(_0x33e3e7,null))[_0xe857('0x22')](removeEntity(_0x33e3e7,null))[_0xe857('0x42')](handleError(_0x33e3e7,null));};exports[_0xe857('0x47')]=function(_0x5a74e4,_0x2eb917){return db[_0xe857('0x28')][_0xe857('0x47')]()[_0xe857('0x22')](respondWithResult(_0x2eb917,null))[_0xe857('0x42')](handleError(_0x2eb917,null));}; \ No newline at end of file +var _0x06f0=['name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','end','sendStatus','error','stack'];(function(_0x586c21,_0x17875f){var _0x903a23=function(_0x256a94){while(--_0x256a94){_0x586c21['push'](_0x586c21['shift']());}};_0x903a23(++_0x17875f);}(_0x06f0,0x115));var _0x006f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06f0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x006f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x006f('0x1'));var rp=require(_0x006f('0x2'));var moment=require('moment');var BPromise=require(_0x006f('0x3'));var Mustache=require('mustache');var util=require(_0x006f('0x4'));var path=require(_0x006f('0x5'));var sox=require('sox');var csv=require(_0x006f('0x6'));var ejs=require(_0x006f('0x7'));var fs=require('fs');var fs_extra=require(_0x006f('0x8'));var _=require(_0x006f('0x9'));var squel=require(_0x006f('0xa'));var crypto=require(_0x006f('0xb'));var jsforce=require(_0x006f('0xc'));var deskjs=require(_0x006f('0xd'));var toCsv=require(_0x006f('0x6'));var querystring=require(_0x006f('0xe'));var Papa=require('papaparse');var Redis=require(_0x006f('0xf'));var authService=require(_0x006f('0x10'));var qs=require(_0x006f('0x11'));var as=require(_0x006f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x006f('0x13'))(_0x006f('0x14'));var utils=require(_0x006f('0x15'));var config=require(_0x006f('0x16'));var licenseUtil=require(_0x006f('0x17'));var db=require(_0x006f('0x18'))['db'];function respondWithStatusCode(_0x50fc3c,_0x4ca056){_0x4ca056=_0x4ca056||0xcc;return function(_0x581a5e){if(_0x581a5e){return _0x50fc3c['sendStatus'](_0x4ca056);}return _0x50fc3c[_0x006f('0x19')](_0x4ca056)['end']();};}function respondWithResult(_0x59b5db,_0x55eaa5){_0x55eaa5=_0x55eaa5||0xc8;return function(_0x2cee93){if(_0x2cee93){return _0x59b5db[_0x006f('0x19')](_0x55eaa5)['json'](_0x2cee93);}};}function respondWithFilteredResult(_0x49a9e9,_0x674f54){return function(_0x4f747e){if(_0x4f747e){var _0xf1825a=typeof _0x674f54['offset']===_0x006f('0x1a')&&typeof _0x674f54[_0x006f('0x1b')]===_0x006f('0x1a');var _0x293638=_0x4f747e['count'];var _0x58a378=_0xf1825a?0x0:_0x674f54['offset'];var _0x38285f=_0xf1825a?_0x4f747e[_0x006f('0x1c')]:_0x674f54[_0x006f('0x1d')]+_0x674f54[_0x006f('0x1b')];var _0x1e5ba5;if(_0x38285f>=_0x293638){_0x38285f=_0x293638;_0x1e5ba5=0xc8;}else{_0x1e5ba5=0xce;}_0x49a9e9[_0x006f('0x19')](_0x1e5ba5);return _0x49a9e9[_0x006f('0x1e')](_0x006f('0x1f'),_0x58a378+'-'+_0x38285f+'/'+_0x293638)[_0x006f('0x20')](_0x4f747e);}return null;};}function patchUpdates(_0x529319){return function(_0x91c3eb){try{jsonpatch[_0x006f('0x21')](_0x91c3eb,_0x529319,!![]);}catch(_0x23dc65){return BPromise[_0x006f('0x22')](_0x23dc65);}return _0x91c3eb[_0x006f('0x23')]();};}function saveUpdates(_0x1bc51c,_0x97fcae){return function(_0x1ef6b9){if(_0x1ef6b9){return _0x1ef6b9[_0x006f('0x24')](_0x1bc51c)['then'](function(_0xdc9331){return _0xdc9331;});}return null;};}function removeEntity(_0x3faf63,_0x20e942){return function(_0xe5a9fb){if(_0xe5a9fb){return _0xe5a9fb[_0x006f('0x25')]()[_0x006f('0x26')](function(){_0x3faf63[_0x006f('0x19')](0xcc)[_0x006f('0x27')]();});}};}function handleEntityNotFound(_0x5504f8,_0x3c59c1){return function(_0x4e7924){if(!_0x4e7924){_0x5504f8[_0x006f('0x28')](0x194);}return _0x4e7924;};}function handleError(_0x5903d3,_0x39657c){_0x39657c=_0x39657c||0x1f4;return function(_0x40cf22){logger[_0x006f('0x29')](_0x40cf22[_0x006f('0x2a')]);if(_0x40cf22[_0x006f('0x2b')]){delete _0x40cf22['name'];}_0x5903d3[_0x006f('0x19')](_0x39657c)[_0x006f('0x2c')](_0x40cf22);};}exports[_0x006f('0x2d')]=function(_0x3a782d,_0x332a83){var _0xf5844e={},_0x32f409={},_0x26e8f1={'count':0x0,'rows':[]};var _0x348c9d=_[_0x006f('0x2e')](db[_0x006f('0x2f')][_0x006f('0x30')],function(_0x1f48ec){return{'name':_0x1f48ec[_0x006f('0x31')],'type':_0x1f48ec[_0x006f('0x32')][_0x006f('0x33')]};});_0x32f409[_0x006f('0x34')]=_[_0x006f('0x2e')](_0x348c9d,_0x006f('0x2b'));_0x32f409[_0x006f('0x35')]=_[_0x006f('0x36')](_0x3a782d[_0x006f('0x35')]);_0x32f409[_0x006f('0x37')]=_[_0x006f('0x38')](_0x32f409[_0x006f('0x34')],_0x32f409[_0x006f('0x35')]);_0xf5844e[_0x006f('0x39')]=_['intersection'](_0x32f409[_0x006f('0x34')],qs[_0x006f('0x3a')](_0x3a782d[_0x006f('0x35')]['fields']));_0xf5844e['attributes']=_0xf5844e[_0x006f('0x39')][_0x006f('0x3b')]?_0xf5844e[_0x006f('0x39')]:_0x32f409['model'];if(!_0x3a782d[_0x006f('0x35')][_0x006f('0x3c')](_0x006f('0x3d'))){_0xf5844e[_0x006f('0x1b')]=qs[_0x006f('0x1b')](_0x3a782d[_0x006f('0x35')][_0x006f('0x1b')]);_0xf5844e[_0x006f('0x1d')]=qs[_0x006f('0x1d')](_0x3a782d['query'][_0x006f('0x1d')]);}_0xf5844e[_0x006f('0x3e')]=qs[_0x006f('0x3f')](_0x3a782d[_0x006f('0x35')][_0x006f('0x3f')]);_0xf5844e[_0x006f('0x40')]=qs[_0x006f('0x37')](_[_0x006f('0x41')](_0x3a782d['query'],_0x32f409[_0x006f('0x37')]),_0x348c9d);if(_0x3a782d[_0x006f('0x35')]['filter']){_0xf5844e['where']=_[_0x006f('0x42')](_0xf5844e[_0x006f('0x40')],{'$or':_['map'](_0x348c9d,function(_0x4dc1c6){if(_0x4dc1c6[_0x006f('0x32')]!==_0x006f('0x43')){var _0x42191e={};_0x42191e[_0x4dc1c6[_0x006f('0x2b')]]={'$like':'%'+_0x3a782d[_0x006f('0x35')]['filter']+'%'};return _0x42191e;}})});}_0xf5844e=_[_0x006f('0x42')]({},_0xf5844e,_0x3a782d[_0x006f('0x44')]);var _0xe073b7={'where':_0xf5844e[_0x006f('0x40')]};return db[_0x006f('0x2f')][_0x006f('0x1c')](_0xe073b7)['then'](function(_0x4c940e){_0x26e8f1[_0x006f('0x1c')]=_0x4c940e;if(_0x3a782d[_0x006f('0x35')]['includeAll']){_0xf5844e[_0x006f('0x45')]=[{'all':!![]}];}return db[_0x006f('0x2f')][_0x006f('0x46')](_0xf5844e);})[_0x006f('0x26')](function(_0x4b4200){_0x26e8f1[_0x006f('0x47')]=_0x4b4200;return _0x26e8f1;})[_0x006f('0x26')](respondWithFilteredResult(_0x332a83,_0xf5844e))[_0x006f('0x48')](handleError(_0x332a83,null));};exports[_0x006f('0x49')]=function(_0x219885,_0x10f66f){var _0x479f31={'raw':!![],'where':{'id':_0x219885[_0x006f('0x4a')]['id']}},_0x2f4f9e={};_0x2f4f9e['model']=_[_0x006f('0x36')](db[_0x006f('0x2f')][_0x006f('0x30')]);_0x2f4f9e['query']=_['keys'](_0x219885[_0x006f('0x35')]);_0x2f4f9e[_0x006f('0x37')]=_['intersection'](_0x2f4f9e['model'],_0x2f4f9e[_0x006f('0x35')]);_0x479f31[_0x006f('0x39')]=_[_0x006f('0x38')](_0x2f4f9e[_0x006f('0x34')],qs[_0x006f('0x3a')](_0x219885[_0x006f('0x35')][_0x006f('0x3a')]));_0x479f31[_0x006f('0x39')]=_0x479f31[_0x006f('0x39')][_0x006f('0x3b')]?_0x479f31['attributes']:_0x2f4f9e['model'];if(_0x219885[_0x006f('0x35')][_0x006f('0x4b')]){_0x479f31[_0x006f('0x45')]=[{'all':!![]}];}_0x479f31=_['merge']({},_0x479f31,_0x219885['options']);return db['JscriptyAnswerReport'][_0x006f('0x4c')](_0x479f31)[_0x006f('0x26')](handleEntityNotFound(_0x10f66f,null))[_0x006f('0x26')](respondWithResult(_0x10f66f,null))['catch'](handleError(_0x10f66f,null));};exports['create']=function(_0x4cf9c7,_0x11ef88){return db[_0x006f('0x2f')][_0x006f('0x4d')](_0x4cf9c7['body'],{})[_0x006f('0x26')](respondWithResult(_0x11ef88,0xc9))[_0x006f('0x48')](handleError(_0x11ef88,null));};exports[_0x006f('0x24')]=function(_0x44ce70,_0x41d1c5){if(_0x44ce70[_0x006f('0x4e')]['id']){delete _0x44ce70['body']['id'];}return db[_0x006f('0x2f')]['find']({'where':{'id':_0x44ce70[_0x006f('0x4a')]['id']}})[_0x006f('0x26')](handleEntityNotFound(_0x41d1c5,null))[_0x006f('0x26')](saveUpdates(_0x44ce70[_0x006f('0x4e')],null))[_0x006f('0x26')](respondWithResult(_0x41d1c5,null))[_0x006f('0x48')](handleError(_0x41d1c5,null));};exports['destroy']=function(_0x7d0351,_0x21c2bc){return db['JscriptyAnswerReport'][_0x006f('0x4c')]({'where':{'id':_0x7d0351[_0x006f('0x4a')]['id']}})[_0x006f('0x26')](handleEntityNotFound(_0x21c2bc,null))[_0x006f('0x26')](removeEntity(_0x21c2bc,null))[_0x006f('0x48')](handleError(_0x21c2bc,null));};exports['describe']=function(_0x41cd02,_0x4369b5){return db[_0x006f('0x2f')][_0x006f('0x4f')]()[_0x006f('0x26')](respondWithResult(_0x4369b5,null))[_0x006f('0x48')](handleError(_0x4369b5,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 3dd9a42..7709964 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 _0x1994=['define','JscriptyAnswerReport','report_jscripty_answers','util','api','moment','bluebird','request-promise','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x4cd0d0,_0x717e19){var _0x506f45=function(_0x2b6eb0){while(--_0x2b6eb0){_0x4cd0d0['push'](_0x4cd0d0['shift']());}};_0x506f45(++_0x717e19);}(_0x1994,0x87));var _0x4199=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1994[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x4199('0x0'));var logger=require('../../config/logger')(_0x4199('0x1'));var moment=require(_0x4199('0x2'));var BPromise=require(_0x4199('0x3'));var rp=require(_0x4199('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4199('0x5'));var attributes=require(_0x4199('0x6'));module[_0x4199('0x7')]=function(_0x39138e,_0x47bb7c){return _0x39138e[_0x4199('0x8')](_0x4199('0x9'),attributes,{'tableName':_0x4199('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x17d7=['JscriptyAnswerReport','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x17d7,0x14b));var _0x717d=function(_0x1acf74,_0x4c04ef){_0x1acf74=_0x1acf74-0x0;var _0x5d425f=_0x17d7[_0x1acf74];return _0x5d425f;};'use strict';var _=require(_0x717d('0x0'));var util=require('util');var logger=require(_0x717d('0x1'))(_0x717d('0x2'));var moment=require(_0x717d('0x3'));var BPromise=require(_0x717d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x717d('0x5'));var config=require(_0x717d('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x717d('0x7')]=function(_0x18bf92,_0x3058ff){return _0x18bf92[_0x717d('0x8')](_0x717d('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 5d5eb4d..d4ce4bf 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 _0xd7fc=['jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x31056f,_0x4082b1){var _0x3c7de0=function(_0x2714c2){while(--_0x2714c2){_0x31056f['push'](_0x31056f['shift']());}};_0x3c7de0(++_0x4082b1);}(_0xd7fc,0x187));var _0xcd7f=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0xd7fc[_0x183256];return _0x5394a2;};'use strict';var _=require(_0xcd7f('0x0'));var util=require(_0xcd7f('0x1'));var moment=require(_0xcd7f('0x2'));var BPromise=require(_0xcd7f('0x3'));var rs=require(_0xcd7f('0x4'));var fs=require('fs');var Redis=require(_0xcd7f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd7f('0x6'));var logger=require('../../config/logger')(_0xcd7f('0x7'));var config=require(_0xcd7f('0x8'));var jayson=require(_0xcd7f('0x9'));var client=jayson[_0xcd7f('0xa')][_0xcd7f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb85839,_0x4f3186,_0x46bab5){return new BPromise(function(_0xb3c645,_0x14f33a){return client[_0xcd7f('0xc')](_0xb85839,_0x46bab5)[_0xcd7f('0xd')](function(_0x300f7e){logger['info'](_0xcd7f('0xe'),_0x4f3186,'request\x20sent');logger[_0xcd7f('0xf')](_0xcd7f('0x10'),_0x4f3186,_0xcd7f('0x11'),JSON[_0xcd7f('0x12')](_0x300f7e));if(_0x300f7e[_0xcd7f('0x13')]){if(_0x300f7e['error'][_0xcd7f('0x14')]===0x1f4){logger[_0xcd7f('0x13')](_0xcd7f('0xe'),_0x4f3186,_0x300f7e[_0xcd7f('0x13')][_0xcd7f('0x15')]);return _0x14f33a(_0x300f7e[_0xcd7f('0x13')][_0xcd7f('0x15')]);}logger[_0xcd7f('0x13')](_0xcd7f('0xe'),_0x4f3186,_0x300f7e[_0xcd7f('0x13')][_0xcd7f('0x15')]);return _0xb3c645(_0x300f7e[_0xcd7f('0x13')][_0xcd7f('0x15')]);}else{logger[_0xcd7f('0x16')](_0xcd7f('0xe'),_0x4f3186,_0xcd7f('0x11'));_0xb3c645(_0x300f7e[_0xcd7f('0x17')][_0xcd7f('0x15')]);}})[_0xcd7f('0x18')](function(_0x33ec44){logger[_0xcd7f('0x13')](_0xcd7f('0xe'),_0x4f3186,_0x33ec44);_0x14f33a(_0x33ec44);});});} \ No newline at end of file +var _0xc60d=['error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x372d83,_0x4ea7c8){var _0x3c28d9=function(_0x18aaed){while(--_0x18aaed){_0x372d83['push'](_0x372d83['shift']());}};_0x3c28d9(++_0x4ea7c8);}(_0xc60d,0x1e8));var _0xdc60=function(_0x50c7d6,_0x43aaed){_0x50c7d6=_0x50c7d6-0x0;var _0x4e1b11=_0xc60d[_0x50c7d6];return _0x4e1b11;};'use strict';var _=require(_0xdc60('0x0'));var util=require(_0xdc60('0x1'));var moment=require('moment');var BPromise=require(_0xdc60('0x2'));var rs=require(_0xdc60('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdc60('0x4'))['db'];var utils=require(_0xdc60('0x5'));var logger=require(_0xdc60('0x6'))(_0xdc60('0x7'));var config=require(_0xdc60('0x8'));var jayson=require(_0xdc60('0x9'));var client=jayson[_0xdc60('0xa')][_0xdc60('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1afc54,_0x2d96cd,_0x83e7c1){return new BPromise(function(_0x5bdbcd,_0x49b35b){return client['request'](_0x1afc54,_0x83e7c1)['then'](function(_0x10ed04){logger[_0xdc60('0xc')](_0xdc60('0xd'),_0x2d96cd,_0xdc60('0xe'));logger[_0xdc60('0xf')](_0xdc60('0x10'),_0x2d96cd,_0xdc60('0xe'),JSON[_0xdc60('0x11')](_0x10ed04));if(_0x10ed04[_0xdc60('0x12')]){if(_0x10ed04[_0xdc60('0x12')][_0xdc60('0x13')]===0x1f4){logger[_0xdc60('0x12')](_0xdc60('0xd'),_0x2d96cd,_0x10ed04[_0xdc60('0x12')][_0xdc60('0x14')]);return _0x49b35b(_0x10ed04['error'][_0xdc60('0x14')]);}logger['error'](_0xdc60('0xd'),_0x2d96cd,_0x10ed04[_0xdc60('0x12')]['message']);return _0x5bdbcd(_0x10ed04['error'][_0xdc60('0x14')]);}else{logger[_0xdc60('0xc')](_0xdc60('0xd'),_0x2d96cd,_0xdc60('0xe'));_0x5bdbcd(_0x10ed04[_0xdc60('0x15')][_0xdc60('0x14')]);}})[_0xdc60('0x16')](function(_0x20a6d5){logger[_0xdc60('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2d96cd,_0x20a6d5);_0x49b35b(_0x20a6d5);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 88a744b..c93f46c 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 _0xffd6=['Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','/:id/clone','clone','update','destroy','multer','util','path'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xffd6,0x97));var _0x6ffd=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xffd6[_0x424a9a];return _0xa7831c;};'use strict';var multer=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var path=require(_0x6ffd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ffd('0x3')]();var fs_extra=require(_0x6ffd('0x4'));var auth=require(_0x6ffd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ffd('0x6'));var controller=require(_0x6ffd('0x7'));router[_0x6ffd('0x8')]('/',auth[_0x6ffd('0x9')](),controller['index']);router[_0x6ffd('0x8')](_0x6ffd('0xa'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xb')]);router[_0x6ffd('0x8')]('/:id/sessions',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xc')]);router['get'](_0x6ffd('0xd'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xe')]);router[_0x6ffd('0x8')](_0x6ffd('0xf'),auth[_0x6ffd('0x9')](),timeout(_0x6ffd('0x10')),controller['getSummary']);router[_0x6ffd('0x11')]('/',auth[_0x6ffd('0x9')](),controller['create']);router[_0x6ffd('0x11')](_0x6ffd('0x12'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x13')]);router['put'](_0x6ffd('0xa'),auth['isAuthenticated'](),controller[_0x6ffd('0x14')]);router['delete'](_0x6ffd('0xa'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x15')]);module['exports']=router; \ No newline at end of file +var _0xffd6=['Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','/:id/clone','clone','update','destroy','multer','util','path'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xffd6,0x97));var _0x6ffd=function(_0x5c78d9,_0x2736c7){_0x5c78d9=_0x5c78d9-0x0;var _0x69ae1f=_0xffd6[_0x5c78d9];return _0x69ae1f;};'use strict';var multer=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var path=require(_0x6ffd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ffd('0x3')]();var fs_extra=require(_0x6ffd('0x4'));var auth=require(_0x6ffd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ffd('0x6'));var controller=require(_0x6ffd('0x7'));router[_0x6ffd('0x8')]('/',auth[_0x6ffd('0x9')](),controller['index']);router[_0x6ffd('0x8')](_0x6ffd('0xa'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xb')]);router[_0x6ffd('0x8')]('/:id/sessions',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xc')]);router['get'](_0x6ffd('0xd'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xe')]);router[_0x6ffd('0x8')](_0x6ffd('0xf'),auth[_0x6ffd('0x9')](),timeout(_0x6ffd('0x10')),controller['getSummary']);router[_0x6ffd('0x11')]('/',auth[_0x6ffd('0x9')](),controller['create']);router[_0x6ffd('0x11')](_0x6ffd('0x12'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x13')]);router['put'](_0x6ffd('0xa'),auth['isAuthenticated'](),controller[_0x6ffd('0x14')]);router['delete'](_0x6ffd('0xa'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 6f55a7e..27133cd 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 _0xd13c=['isString','getDataValue','BOOLEAN','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData'];(function(_0x25e5c7,_0x119cc0){var _0x5757a6=function(_0x5f1131){while(--_0x5f1131){_0x25e5c7['push'](_0x25e5c7['shift']());}};_0x5757a6(++_0x119cc0);}(_0xd13c,0x163));var _0xcd13=function(_0x3ea6f2,_0x5cb125){_0x3ea6f2=_0x3ea6f2-0x0;var _0x4e5ef4=_0xd13c[_0x3ea6f2];return _0x4e5ef4;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require('util');module[_0xcd13('0x0')]={'name':{'type':Sequelize[_0xcd13('0x1')],'unique':_0xcd13('0x2')},'description':{'type':Sequelize[_0xcd13('0x1')]},'formData':{'type':Sequelize[_0xcd13('0x3')](_0xcd13('0x4')),'set':function(_0x143cbe){if(_[_0xcd13('0x5')](_0x143cbe)){this[_0xcd13('0x6')](_0xcd13('0x7'),JSON['stringify'](_0x143cbe));}else if(_[_0xcd13('0x8')](_0x143cbe)){this[_0xcd13('0x6')](_0xcd13('0x7'),_0x143cbe);}else{this[_0xcd13('0x6')](_0xcd13('0x7'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xcd13('0x9')]('name')||'',this[_0xcd13('0x9')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xcd13('0xa')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xcd13('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0x24a0=['setDataValue','stringify','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','exports','STRING','name','TEXT','long'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x24a0,0x13c));var _0x024a=function(_0x4f103d,_0x42dce8){_0x4f103d=_0x4f103d-0x0;var _0x3b14b2=_0x24a0[_0x4f103d];return _0x3b14b2;};'use strict';var Sequelize=require(_0x024a('0x0'));var _=require('lodash');var util=require('util');module[_0x024a('0x1')]={'name':{'type':Sequelize[_0x024a('0x2')],'unique':_0x024a('0x3')},'description':{'type':Sequelize[_0x024a('0x2')]},'formData':{'type':Sequelize[_0x024a('0x4')](_0x024a('0x5')),'set':function(_0x1f083a){if(_['isObjectLike'](_0x1f083a)){this[_0x024a('0x6')]('formData',JSON[_0x024a('0x7')](_0x1f083a));}else if(_['isString'](_0x1f083a)){this[_0x024a('0x6')]('formData',_0x1f083a);}else{this[_0x024a('0x6')](_0x024a('0x8'),util[_0x024a('0x9')](_0x024a('0xa'),this[_0x024a('0xb')](_0x024a('0x3'))||'',this[_0x024a('0xb')](_0x024a('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x024a('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x024a('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index adc746d..a7093c9 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 _0xa9e0=['length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','omit','createdAt','updatedAt','Projects','UserProfileSection','params','getSessions','findOne','JscriptySessionReport','order','ProjectId','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','-createdAt','questionId','question','starttime','SessionId','answer','push','writeFileSync','format','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields'];(function(_0x5a7f2d,_0x246701){var _0x429a0b=function(_0x2c961b){while(--_0x2c961b){_0x5a7f2d['push'](_0x5a7f2d['shift']());}};_0x429a0b(++_0x246701);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x24')]({'plain':!![]});var _0x16b1ca='Projects';return db['UserProfileResource'][_0x0a9e('0x23')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x22')](function(){return _0x2fb0e4;});})[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x25')](_0x25fba9[_0x0a9e('0x26')]);if(_0x25fba9[_0x0a9e('0x27')]){delete _0x25fba9[_0x0a9e('0x27')];}_0x1dc186[_0x0a9e('0x17')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x28')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x563b45){return{'name':_0x563b45[_0x0a9e('0x2c')],'type':_0x563b45[_0x0a9e('0x2d')][_0x0a9e('0x2e')]};});_0x5c877d['model']=_[_0x0a9e('0x29')](_0x40e7a3,'name');_0x5c877d[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x468813[_0x0a9e('0x2f')]);_0x5c877d[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2f')]);_0x2ec755[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x5c877d[_0x0a9e('0x34')],qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x35')]));_0x2ec755[_0x0a9e('0x33')]=_0x2ec755['attributes'][_0x0a9e('0x36')]?_0x2ec755['attributes']:_0x5c877d[_0x0a9e('0x34')];if(!_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x37')](_0x0a9e('0x38'))){_0x2ec755['limit']=qs[_0x0a9e('0x1a')](_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x1a')]);_0x2ec755[_0x0a9e('0x1b')]=qs['offset'](_0x468813['query'][_0x0a9e('0x1b')]);}_0x2ec755['order']=qs[_0x0a9e('0x39')](_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x39')]);_0x2ec755[_0x0a9e('0x3a')]=qs['filters'](_[_0x0a9e('0x3b')](_0x468813[_0x0a9e('0x2f')],_0x5c877d[_0x0a9e('0x31')]),_0x40e7a3);if(_0x468813['query'][_0x0a9e('0x3c')]){_0x2ec755[_0x0a9e('0x3a')]=_[_0x0a9e('0x3d')](_0x2ec755['where'],{'$or':_['map'](_0x40e7a3,function(_0x11b61d){if(_0x11b61d[_0x0a9e('0x2d')]!=='VIRTUAL'){var _0x2b814e={};_0x2b814e[_0x11b61d[_0x0a9e('0x27')]]={'$like':'%'+_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x3c')]+'%'};return _0x2b814e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813['options']);var _0x15e37d={'where':_0x2ec755[_0x0a9e('0x3a')]};return db['JscriptyProject'][_0x0a9e('0x1c')](_0x15e37d)[_0x0a9e('0x22')](function(_0x1459bb){_0x15b200['count']=_0x1459bb;if(_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x3e')]){_0x2ec755[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x40')](_0x2ec755);})[_0x0a9e('0x22')](function(_0x2881b3){_0x15b200[_0x0a9e('0x41')]=_0x2881b3;return _0x15b200;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x148007,_0x1a7bce){var _0x11ca30={'raw':![],'where':{'id':_0x148007['params']['id']}},_0x37f6cc={};_0x37f6cc['model']=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x37f6cc[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x148007[_0x0a9e('0x2f')]);_0x37f6cc[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x37f6cc[_0x0a9e('0x34')],_0x37f6cc[_0x0a9e('0x2f')]);_0x11ca30[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x37f6cc['model'],qs[_0x0a9e('0x35')](_0x148007[_0x0a9e('0x2f')][_0x0a9e('0x35')]));_0x11ca30[_0x0a9e('0x33')]=_0x11ca30[_0x0a9e('0x33')][_0x0a9e('0x36')]?_0x11ca30[_0x0a9e('0x33')]:_0x37f6cc[_0x0a9e('0x34')];if(_0x148007['query'][_0x0a9e('0x3e')]){_0x11ca30['include']=[{'all':!![]}];}_0x11ca30=_[_0x0a9e('0x3d')]({},_0x11ca30,_0x148007[_0x0a9e('0x44')]);return db[_0x0a9e('0x2a')]['find'](_0x11ca30)[_0x0a9e('0x22')](handleEntityNotFound(_0x1a7bce,null))[_0x0a9e('0x22')](respondWithResult(_0x1a7bce,null))[_0x0a9e('0x42')](handleError(_0x1a7bce,null));};exports[_0x0a9e('0x45')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x2a')]['create'](_0x45c845[_0x0a9e('0x46')],{})[_0x0a9e('0x22')](function(_0x1b5e80){var _0x16f976=_0x45c845[_0x0a9e('0x47')][_0x0a9e('0x24')]({'plain':!![]});if(!_0x16f976)throw new Error(_0x0a9e('0x48'));if(_0x16f976[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x58a5c2=_0x1b5e80[_0x0a9e('0x24')]({'plain':!![]});var _0x3fe430='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x3fe430,'userProfileId':_0x16f976[_0x0a9e('0x4a')]},'raw':!![]})[_0x0a9e('0x22')](function(_0x37edaa){if(_0x37edaa&&_0x37edaa[_0x0a9e('0x4b')]===0x0){return db[_0x0a9e('0x4c')][_0x0a9e('0x45')]({'name':_0x58a5c2[_0x0a9e('0x27')],'resourceId':_0x58a5c2['id'],'type':_0x37edaa[_0x0a9e('0x27')],'sectionId':_0x37edaa['id']},{})['then'](function(){return _0x1b5e80;});}else{return _0x1b5e80;}})['catch'](function(_0x53975a){logger[_0x0a9e('0x25')](_0x0a9e('0x4d'),_0x53975a);throw _0x53975a;});}return _0x1b5e80;})[_0x0a9e('0x22')](respondWithResult(_0x37be73,0xc9))['catch'](handleError(_0x37be73,null));};exports[_0x0a9e('0x4e')]=function(_0x161aa7,_0x53d113){var _0x5a88da={'where':{'id':_0x161aa7['params']['id']}},_0x2ef381={};_0x2ef381[_0x0a9e('0x34')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x5a88da[_0x0a9e('0x33')]=_['intersection'](_0x2ef381[_0x0a9e('0x34')],qs[_0x0a9e('0x35')](_0x161aa7['query']['fields']));_0x5a88da[_0x0a9e('0x33')]=_0x5a88da[_0x0a9e('0x33')]['length']?_0x5a88da[_0x0a9e('0x33')]:_0x2ef381['model'];if(_0x161aa7[_0x0a9e('0x2f')]['includeAll']){_0x5a88da[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x5a88da=_['merge']({},_0x5a88da,_0x161aa7['options']);return db['JscriptyProject'][_0x0a9e('0x4f')](_0x5a88da)['then'](handleEntityNotFound(_0x53d113,null))[_0x0a9e('0x22')](function(_0x65432){if(_0x65432){var _0x3cfd00=_0x65432[_0x0a9e('0x24')]({'plain':!![]});_0x3cfd00=qs[_0x0a9e('0x50')](_0x3cfd00,['id',_0x0a9e('0x51'),_0x0a9e('0x52')]);_0x161aa7[_0x0a9e('0x46')]=_['omit'](_0x161aa7[_0x0a9e('0x46')],['id',_0x0a9e('0x51'),_0x0a9e('0x52')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x45')](_[_0x0a9e('0x3d')](_0x3cfd00,_0x161aa7['body']),{'include':_0x161aa7[_0x0a9e('0x2f')][_0x0a9e('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0x3649cc){var _0x5cc8fb=_0x161aa7[_0x0a9e('0x47')]['get']({'plain':!![]});if(!_0x5cc8fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cc8fb['role']===_0x0a9e('0x47')){var _0x49d231=_0x3649cc[_0x0a9e('0x24')]({'plain':!![]});var _0x1fc70e=_0x0a9e('0x53');return db[_0x0a9e('0x54')][_0x0a9e('0x4f')]({'where':{'name':_0x1fc70e,'userProfileId':_0x5cc8fb[_0x0a9e('0x4a')]},'raw':!![]})['then'](function(_0x1627a7){if(_0x1627a7&&_0x1627a7['autoAssociation']===0x0){return db[_0x0a9e('0x4c')][_0x0a9e('0x45')]({'name':_0x49d231[_0x0a9e('0x27')],'resourceId':_0x49d231['id'],'type':_0x1627a7['name'],'sectionId':_0x1627a7['id']},{})[_0x0a9e('0x22')](function(){return _0x3649cc;});}else{return _0x3649cc;}})[_0x0a9e('0x42')](function(_0x119677){logger[_0x0a9e('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x119677);throw _0x119677;});}return _0x3649cc;});}})[_0x0a9e('0x22')](respondWithResult(_0x53d113,0xc9))[_0x0a9e('0x42')](handleError(_0x53d113,null));};exports['update']=function(_0x797b45,_0x17e88c){if(_0x797b45[_0x0a9e('0x46')]['id']){delete _0x797b45[_0x0a9e('0x46')]['id'];}return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x797b45[_0x0a9e('0x55')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x17e88c,null))[_0x0a9e('0x22')](saveUpdates(_0x797b45['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x17e88c,null))['catch'](handleError(_0x17e88c,null));};exports['destroy']=function(_0x242745,_0x4556c5){return db[_0x0a9e('0x2a')][_0x0a9e('0x4f')]({'where':{'id':_0x242745[_0x0a9e('0x55')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4556c5,null))[_0x0a9e('0x22')](removeEntity(_0x4556c5,null))[_0x0a9e('0x42')](handleError(_0x4556c5,null));};exports[_0x0a9e('0x56')]=function(_0x1cc4f3,_0x2e89b7,_0x19012b){var _0x2bbb86={'raw':!![],'where':{}};var _0x2b8192={};var _0x320898={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x57')]({'where':{'id':_0x1cc4f3[_0x0a9e('0x55')]['id']}})['then'](handleEntityNotFound(_0x2e89b7,null))[_0x0a9e('0x22')](function(_0x295763){if(_0x295763){_0x2b8192[_0x0a9e('0x34')]=_['keys'](db[_0x0a9e('0x58')][_0x0a9e('0x2b')]);_0x2b8192['query']=_[_0x0a9e('0x30')](_0x1cc4f3[_0x0a9e('0x2f')]);_0x2b8192[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x2b8192[_0x0a9e('0x34')],_0x2b8192['query']);_0x2bbb86['attributes']=_['intersection'](_0x2b8192[_0x0a9e('0x34')],qs[_0x0a9e('0x35')](_0x1cc4f3[_0x0a9e('0x2f')][_0x0a9e('0x35')]));_0x2bbb86[_0x0a9e('0x33')]=_0x2bbb86[_0x0a9e('0x33')][_0x0a9e('0x36')]?_0x2bbb86[_0x0a9e('0x33')]:_0x2b8192['model'];if(!_0x1cc4f3[_0x0a9e('0x2f')][_0x0a9e('0x37')](_0x0a9e('0x38'))){_0x2bbb86['limit']=qs[_0x0a9e('0x1a')](_0x1cc4f3['query'][_0x0a9e('0x1a')]);_0x2bbb86[_0x0a9e('0x1b')]=qs['offset'](_0x1cc4f3[_0x0a9e('0x2f')][_0x0a9e('0x1b')]);}_0x2bbb86[_0x0a9e('0x59')]=qs[_0x0a9e('0x39')](_0x1cc4f3['query'][_0x0a9e('0x39')]);_0x2bbb86[_0x0a9e('0x3a')]=qs[_0x0a9e('0x31')](_[_0x0a9e('0x3b')](_0x1cc4f3['query'],_0x2b8192[_0x0a9e('0x31')]));_0x2bbb86[_0x0a9e('0x3a')][_0x0a9e('0x5a')]=_0x295763['id'];if(_0x1cc4f3[_0x0a9e('0x2f')]['filter']){_0x2bbb86[_0x0a9e('0x3a')]=_[_0x0a9e('0x3d')](_0x2bbb86[_0x0a9e('0x3a')],{'$or':_[_0x0a9e('0x29')](_0x2bbb86[_0x0a9e('0x33')],function(_0xdb98ca){var _0x40fc56={};_0x40fc56[_0xdb98ca]={'$like':'%'+_0x1cc4f3[_0x0a9e('0x2f')][_0x0a9e('0x3c')]+'%'};return _0x40fc56;})});}_0x2bbb86=_[_0x0a9e('0x3d')]({},_0x2bbb86,_0x1cc4f3[_0x0a9e('0x44')]);return db[_0x0a9e('0x58')][_0x0a9e('0x1c')]({'where':_0x2bbb86[_0x0a9e('0x3a')]})['then'](function(_0xf4120f){_0x320898[_0x0a9e('0x1c')]=_0xf4120f;if(_0x1cc4f3[_0x0a9e('0x2f')]['includeAll']){_0x2bbb86[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x58')][_0x0a9e('0x40')](_0x2bbb86);})[_0x0a9e('0x22')](function(_0x56d650){_0x320898['rows']=_0x56d650;return _0x320898;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x2e89b7,_0x2bbb86))[_0x0a9e('0x42')](handleError(_0x2e89b7,null));};exports['getAnswers']=function(_0x45108c,_0x53a6a1,_0x260f4b){var _0x8ebf02={'raw':!![],'where':{}};var _0x5637a1={};var _0x28a942={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x57')]({'where':{'id':_0x45108c[_0x0a9e('0x55')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x53a6a1,null))[_0x0a9e('0x22')](function(_0x444f1f){if(_0x444f1f){_0x5637a1['model']=_[_0x0a9e('0x30')](db[_0x0a9e('0x5b')][_0x0a9e('0x2b')]);_0x5637a1[_0x0a9e('0x2f')]=_['keys'](_0x45108c[_0x0a9e('0x2f')]);_0x5637a1[_0x0a9e('0x31')]=_['intersection'](_0x5637a1[_0x0a9e('0x34')],_0x5637a1['query']);_0x8ebf02[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x5637a1[_0x0a9e('0x34')],qs[_0x0a9e('0x35')](_0x45108c['query']['fields']));_0x8ebf02[_0x0a9e('0x33')]=_0x8ebf02[_0x0a9e('0x33')][_0x0a9e('0x36')]?_0x8ebf02['attributes']:_0x5637a1[_0x0a9e('0x34')];if(!_0x45108c[_0x0a9e('0x2f')]['hasOwnProperty']('nolimit')){_0x8ebf02[_0x0a9e('0x1a')]=qs['limit'](_0x45108c['query']['limit']);_0x8ebf02[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x45108c[_0x0a9e('0x2f')][_0x0a9e('0x1b')]);}_0x8ebf02[_0x0a9e('0x59')]=qs[_0x0a9e('0x39')](_0x45108c['query'][_0x0a9e('0x39')]);_0x8ebf02['where']=qs[_0x0a9e('0x31')](_[_0x0a9e('0x3b')](_0x45108c[_0x0a9e('0x2f')],_0x5637a1[_0x0a9e('0x31')]));_0x8ebf02['where'][_0x0a9e('0x5a')]=_0x444f1f['id'];if(_0x45108c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]){_0x8ebf02['where']=_[_0x0a9e('0x3d')](_0x8ebf02[_0x0a9e('0x3a')],{'$or':_[_0x0a9e('0x29')](_0x8ebf02[_0x0a9e('0x33')],function(_0x255e49){var _0x1910bf={};_0x1910bf[_0x255e49]={'$like':'%'+_0x45108c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]+'%'};return _0x1910bf;})});}_0x8ebf02=_['merge']({},_0x8ebf02,_0x45108c[_0x0a9e('0x44')]);return db[_0x0a9e('0x5b')]['count']({'where':_0x8ebf02[_0x0a9e('0x3a')]})[_0x0a9e('0x22')](function(_0x3a1974){_0x28a942['count']=_0x3a1974;if(_0x45108c[_0x0a9e('0x2f')]['includeAll']){_0x8ebf02[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x5b')][_0x0a9e('0x40')](_0x8ebf02);})[_0x0a9e('0x22')](function(_0x842d6f){_0x28a942[_0x0a9e('0x41')]=_0x842d6f;return _0x28a942;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x53a6a1,_0x8ebf02))[_0x0a9e('0x42')](handleError(_0x53a6a1,null));};function char(_0x501050){return _0x0a9e('0x5c')===typeof _0x501050?String[_0x0a9e('0x5d')][_0x0a9e('0x1f')](null,arguments):_0x501050;}function needsEncapsulation(_0x30ef6e){return!!_0x30ef6e&&(_0x30ef6e[_0x0a9e('0x5e')]()[_0x0a9e('0x5f')](char(0xd))>=0x0||_0x30ef6e[_0x0a9e('0x5e')]()[_0x0a9e('0x5f')](char(0xa))>=0x0||_0x30ef6e[_0x0a9e('0x5e')]()[_0x0a9e('0x5f')](char(0x2c))>=0x0||_0x30ef6e[_0x0a9e('0x5e')]()[_0x0a9e('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x18273f){var _0x4989f9=char(0x22),_0xc81b64='\x5c'+char(0x22),_0x23e2bd=_0x18273f[_0x0a9e('0x5e')]()[_0x0a9e('0x60')](new RegExp(_0x4989f9,'g'),_0xc81b64);return _0x4989f9+_0x23e2bd+_0x4989f9;}exports[_0x0a9e('0x61')]=function(_0x5d9ddb,_0x3afc8c,_0x1756c7){var _0x5ce99d,_0x23b447;var _0x5e725e={'where':{'ProjectId':_0x5d9ddb[_0x0a9e('0x55')]['id']}};if(_0x5d9ddb[_0x0a9e('0x2f')][_0x0a9e('0x62')]){_0x5e725e[_0x0a9e('0x3a')]['starttime']=JSON[_0x0a9e('0x63')](_0x5d9ddb['query'][_0x0a9e('0x62')]);}return db[_0x0a9e('0x58')]['findAll'](_0x5e725e)[_0x0a9e('0x22')](handleEntityNotFound(_0x3afc8c,null))[_0x0a9e('0x22')](function(_0x1dd541){if(_0x1dd541){_0x5ce99d=_0x1dd541;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0x0a9e('0x29')](_0x5ce99d,'id')},'ProjectId':_0x5d9ddb[_0x0a9e('0x55')]['id']},'order':_0x0a9e('0x64')});}})[_0x0a9e('0x22')](handleEntityNotFound(_0x3afc8c,null))[_0x0a9e('0x22')](function(_0x2450a8){if(_0x2450a8){_0x23b447=_0x2450a8;var _0x17793e={};for(var _0x3c75b9=0x0,_0x3f8124=_0x23b447['length'];_0x3c75b9<_0x3f8124;_0x3c75b9++){if(!_0x17793e[_0x0a9e('0x37')](_0x23b447[_0x3c75b9]['questionId'])){_0x17793e[_0x23b447[_0x3c75b9][_0x0a9e('0x65')]]=needsEncapsulation(_0x23b447[_0x3c75b9][_0x0a9e('0x66')])?encapsulate(_0x23b447[_0x3c75b9][_0x0a9e('0x66')]):_0x23b447[_0x3c75b9][_0x0a9e('0x66')];}}var _0x1b61d5=[],_0x4e7273={};for(var _0x436313=0x0,_0x4667bf=_0x5ce99d[_0x0a9e('0x36')];_0x436313<_0x4667bf;_0x436313++){_0x4e7273={'ProjectId':_0x5d9ddb[_0x0a9e('0x55')]['id'],'SessionId':_0x5ce99d[_0x436313]['id'],'StartTime':moment(_0x5ce99d[_0x436313][_0x0a9e('0x67')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x22a3cb=0x0,_0x583662=_0x23b447[_0x0a9e('0x36')];_0x22a3cb<_0x583662;_0x22a3cb++){if(_0x23b447[_0x22a3cb][_0x0a9e('0x68')]==_0x5ce99d[_0x436313]['id']&&_0x17793e[_0x0a9e('0x37')](_0x23b447[_0x22a3cb][_0x0a9e('0x65')])){_0x4e7273[_0x17793e[_0x23b447[_0x22a3cb][_0x0a9e('0x65')]]]=_0x23b447[_0x22a3cb][_0x0a9e('0x69')];}}for(var _0x596312 in _0x17793e){if(!_0x4e7273['hasOwnProperty'](_0x17793e[_0x596312])){_0x4e7273[_0x17793e[_0x596312]]=null;}}_0x1b61d5[_0x0a9e('0x6a')](_0x4e7273);}return _0x1b61d5;}})['then'](function(_0x2469d1){if(!_['isEmpty'](_0x2469d1)){var _0x427ccc=toCsv(_0x2469d1);var _0x564db2=Date['now']();fs[_0x0a9e('0x6b')](util[_0x0a9e('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x5d9ddb[_0x0a9e('0x55')]['id'],_0x564db2),_0x427ccc);_0x3afc8c[_0x0a9e('0x6d')](_0x0a9e('0x6e'),_0x0a9e('0x6f')+util[_0x0a9e('0x6c')]('Jscripty_Project_%d_Summary_%s.csv',_0x5d9ddb['params']['id'],_0x564db2));_0x3afc8c[_0x0a9e('0x6d')](_0x0a9e('0x70'),_0x0a9e('0x71'));return _0x3afc8c[_0x0a9e('0x72')](util[_0x0a9e('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x5d9ddb[_0x0a9e('0x55')]['id'],_0x564db2));}else{return _0x3afc8c[_0x0a9e('0x15')](0xcc);}})['catch'](handleError(_0x3afc8c,null));}; \ No newline at end of file +var _0xa9e0=['length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','omit','createdAt','updatedAt','Projects','UserProfileSection','params','getSessions','findOne','JscriptySessionReport','order','ProjectId','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','-createdAt','questionId','question','starttime','SessionId','answer','push','writeFileSync','format','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields'];(function(_0x221f25,_0x389676){var _0x17be81=function(_0x22e79f){while(--_0x22e79f){_0x221f25['push'](_0x221f25['shift']());}};_0x17be81(++_0x389676);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x24')]({'plain':!![]});var _0x16b1ca='Projects';return db['UserProfileResource'][_0x0a9e('0x23')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x22')](function(){return _0x2fb0e4;});})[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x25')](_0x25fba9[_0x0a9e('0x26')]);if(_0x25fba9[_0x0a9e('0x27')]){delete _0x25fba9[_0x0a9e('0x27')];}_0x1dc186[_0x0a9e('0x17')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x28')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x563b45){return{'name':_0x563b45[_0x0a9e('0x2c')],'type':_0x563b45[_0x0a9e('0x2d')][_0x0a9e('0x2e')]};});_0x5c877d['model']=_[_0x0a9e('0x29')](_0x40e7a3,'name');_0x5c877d[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x468813[_0x0a9e('0x2f')]);_0x5c877d[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2f')]);_0x2ec755[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x5c877d[_0x0a9e('0x34')],qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x35')]));_0x2ec755[_0x0a9e('0x33')]=_0x2ec755['attributes'][_0x0a9e('0x36')]?_0x2ec755['attributes']:_0x5c877d[_0x0a9e('0x34')];if(!_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x37')](_0x0a9e('0x38'))){_0x2ec755['limit']=qs[_0x0a9e('0x1a')](_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x1a')]);_0x2ec755[_0x0a9e('0x1b')]=qs['offset'](_0x468813['query'][_0x0a9e('0x1b')]);}_0x2ec755['order']=qs[_0x0a9e('0x39')](_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x39')]);_0x2ec755[_0x0a9e('0x3a')]=qs['filters'](_[_0x0a9e('0x3b')](_0x468813[_0x0a9e('0x2f')],_0x5c877d[_0x0a9e('0x31')]),_0x40e7a3);if(_0x468813['query'][_0x0a9e('0x3c')]){_0x2ec755[_0x0a9e('0x3a')]=_[_0x0a9e('0x3d')](_0x2ec755['where'],{'$or':_['map'](_0x40e7a3,function(_0x11b61d){if(_0x11b61d[_0x0a9e('0x2d')]!=='VIRTUAL'){var _0x2b814e={};_0x2b814e[_0x11b61d[_0x0a9e('0x27')]]={'$like':'%'+_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x3c')]+'%'};return _0x2b814e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813['options']);var _0x15e37d={'where':_0x2ec755[_0x0a9e('0x3a')]};return db['JscriptyProject'][_0x0a9e('0x1c')](_0x15e37d)[_0x0a9e('0x22')](function(_0x1459bb){_0x15b200['count']=_0x1459bb;if(_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x3e')]){_0x2ec755[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x40')](_0x2ec755);})[_0x0a9e('0x22')](function(_0x2881b3){_0x15b200[_0x0a9e('0x41')]=_0x2881b3;return _0x15b200;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x148007,_0x1a7bce){var _0x11ca30={'raw':![],'where':{'id':_0x148007['params']['id']}},_0x37f6cc={};_0x37f6cc['model']=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x37f6cc[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x148007[_0x0a9e('0x2f')]);_0x37f6cc[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x37f6cc[_0x0a9e('0x34')],_0x37f6cc[_0x0a9e('0x2f')]);_0x11ca30[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x37f6cc['model'],qs[_0x0a9e('0x35')](_0x148007[_0x0a9e('0x2f')][_0x0a9e('0x35')]));_0x11ca30[_0x0a9e('0x33')]=_0x11ca30[_0x0a9e('0x33')][_0x0a9e('0x36')]?_0x11ca30[_0x0a9e('0x33')]:_0x37f6cc[_0x0a9e('0x34')];if(_0x148007['query'][_0x0a9e('0x3e')]){_0x11ca30['include']=[{'all':!![]}];}_0x11ca30=_[_0x0a9e('0x3d')]({},_0x11ca30,_0x148007[_0x0a9e('0x44')]);return db[_0x0a9e('0x2a')]['find'](_0x11ca30)[_0x0a9e('0x22')](handleEntityNotFound(_0x1a7bce,null))[_0x0a9e('0x22')](respondWithResult(_0x1a7bce,null))[_0x0a9e('0x42')](handleError(_0x1a7bce,null));};exports[_0x0a9e('0x45')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x2a')]['create'](_0x45c845[_0x0a9e('0x46')],{})[_0x0a9e('0x22')](function(_0x1b5e80){var _0x16f976=_0x45c845[_0x0a9e('0x47')][_0x0a9e('0x24')]({'plain':!![]});if(!_0x16f976)throw new Error(_0x0a9e('0x48'));if(_0x16f976[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x58a5c2=_0x1b5e80[_0x0a9e('0x24')]({'plain':!![]});var _0x3fe430='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x3fe430,'userProfileId':_0x16f976[_0x0a9e('0x4a')]},'raw':!![]})[_0x0a9e('0x22')](function(_0x37edaa){if(_0x37edaa&&_0x37edaa[_0x0a9e('0x4b')]===0x0){return db[_0x0a9e('0x4c')][_0x0a9e('0x45')]({'name':_0x58a5c2[_0x0a9e('0x27')],'resourceId':_0x58a5c2['id'],'type':_0x37edaa[_0x0a9e('0x27')],'sectionId':_0x37edaa['id']},{})['then'](function(){return _0x1b5e80;});}else{return _0x1b5e80;}})['catch'](function(_0x53975a){logger[_0x0a9e('0x25')](_0x0a9e('0x4d'),_0x53975a);throw _0x53975a;});}return _0x1b5e80;})[_0x0a9e('0x22')](respondWithResult(_0x37be73,0xc9))['catch'](handleError(_0x37be73,null));};exports[_0x0a9e('0x4e')]=function(_0x161aa7,_0x53d113){var _0x5a88da={'where':{'id':_0x161aa7['params']['id']}},_0x2ef381={};_0x2ef381[_0x0a9e('0x34')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x5a88da[_0x0a9e('0x33')]=_['intersection'](_0x2ef381[_0x0a9e('0x34')],qs[_0x0a9e('0x35')](_0x161aa7['query']['fields']));_0x5a88da[_0x0a9e('0x33')]=_0x5a88da[_0x0a9e('0x33')]['length']?_0x5a88da[_0x0a9e('0x33')]:_0x2ef381['model'];if(_0x161aa7[_0x0a9e('0x2f')]['includeAll']){_0x5a88da[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x5a88da=_['merge']({},_0x5a88da,_0x161aa7['options']);return db['JscriptyProject'][_0x0a9e('0x4f')](_0x5a88da)['then'](handleEntityNotFound(_0x53d113,null))[_0x0a9e('0x22')](function(_0x65432){if(_0x65432){var _0x3cfd00=_0x65432[_0x0a9e('0x24')]({'plain':!![]});_0x3cfd00=qs[_0x0a9e('0x50')](_0x3cfd00,['id',_0x0a9e('0x51'),_0x0a9e('0x52')]);_0x161aa7[_0x0a9e('0x46')]=_['omit'](_0x161aa7[_0x0a9e('0x46')],['id',_0x0a9e('0x51'),_0x0a9e('0x52')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x45')](_[_0x0a9e('0x3d')](_0x3cfd00,_0x161aa7['body']),{'include':_0x161aa7[_0x0a9e('0x2f')][_0x0a9e('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0x3649cc){var _0x5cc8fb=_0x161aa7[_0x0a9e('0x47')]['get']({'plain':!![]});if(!_0x5cc8fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cc8fb['role']===_0x0a9e('0x47')){var _0x49d231=_0x3649cc[_0x0a9e('0x24')]({'plain':!![]});var _0x1fc70e=_0x0a9e('0x53');return db[_0x0a9e('0x54')][_0x0a9e('0x4f')]({'where':{'name':_0x1fc70e,'userProfileId':_0x5cc8fb[_0x0a9e('0x4a')]},'raw':!![]})['then'](function(_0x1627a7){if(_0x1627a7&&_0x1627a7['autoAssociation']===0x0){return db[_0x0a9e('0x4c')][_0x0a9e('0x45')]({'name':_0x49d231[_0x0a9e('0x27')],'resourceId':_0x49d231['id'],'type':_0x1627a7['name'],'sectionId':_0x1627a7['id']},{})[_0x0a9e('0x22')](function(){return _0x3649cc;});}else{return _0x3649cc;}})[_0x0a9e('0x42')](function(_0x119677){logger[_0x0a9e('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x119677);throw _0x119677;});}return _0x3649cc;});}})[_0x0a9e('0x22')](respondWithResult(_0x53d113,0xc9))[_0x0a9e('0x42')](handleError(_0x53d113,null));};exports['update']=function(_0x797b45,_0x17e88c){if(_0x797b45[_0x0a9e('0x46')]['id']){delete _0x797b45[_0x0a9e('0x46')]['id'];}return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x797b45[_0x0a9e('0x55')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x17e88c,null))[_0x0a9e('0x22')](saveUpdates(_0x797b45['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x17e88c,null))['catch'](handleError(_0x17e88c,null));};exports['destroy']=function(_0x242745,_0x4556c5){return db[_0x0a9e('0x2a')][_0x0a9e('0x4f')]({'where':{'id':_0x242745[_0x0a9e('0x55')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4556c5,null))[_0x0a9e('0x22')](removeEntity(_0x4556c5,null))[_0x0a9e('0x42')](handleError(_0x4556c5,null));};exports[_0x0a9e('0x56')]=function(_0x1cc4f3,_0x2e89b7,_0x19012b){var _0x2bbb86={'raw':!![],'where':{}};var _0x2b8192={};var _0x320898={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x57')]({'where':{'id':_0x1cc4f3[_0x0a9e('0x55')]['id']}})['then'](handleEntityNotFound(_0x2e89b7,null))[_0x0a9e('0x22')](function(_0x295763){if(_0x295763){_0x2b8192[_0x0a9e('0x34')]=_['keys'](db[_0x0a9e('0x58')][_0x0a9e('0x2b')]);_0x2b8192['query']=_[_0x0a9e('0x30')](_0x1cc4f3[_0x0a9e('0x2f')]);_0x2b8192[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x2b8192[_0x0a9e('0x34')],_0x2b8192['query']);_0x2bbb86['attributes']=_['intersection'](_0x2b8192[_0x0a9e('0x34')],qs[_0x0a9e('0x35')](_0x1cc4f3[_0x0a9e('0x2f')][_0x0a9e('0x35')]));_0x2bbb86[_0x0a9e('0x33')]=_0x2bbb86[_0x0a9e('0x33')][_0x0a9e('0x36')]?_0x2bbb86[_0x0a9e('0x33')]:_0x2b8192['model'];if(!_0x1cc4f3[_0x0a9e('0x2f')][_0x0a9e('0x37')](_0x0a9e('0x38'))){_0x2bbb86['limit']=qs[_0x0a9e('0x1a')](_0x1cc4f3['query'][_0x0a9e('0x1a')]);_0x2bbb86[_0x0a9e('0x1b')]=qs['offset'](_0x1cc4f3[_0x0a9e('0x2f')][_0x0a9e('0x1b')]);}_0x2bbb86[_0x0a9e('0x59')]=qs[_0x0a9e('0x39')](_0x1cc4f3['query'][_0x0a9e('0x39')]);_0x2bbb86[_0x0a9e('0x3a')]=qs[_0x0a9e('0x31')](_[_0x0a9e('0x3b')](_0x1cc4f3['query'],_0x2b8192[_0x0a9e('0x31')]));_0x2bbb86[_0x0a9e('0x3a')][_0x0a9e('0x5a')]=_0x295763['id'];if(_0x1cc4f3[_0x0a9e('0x2f')]['filter']){_0x2bbb86[_0x0a9e('0x3a')]=_[_0x0a9e('0x3d')](_0x2bbb86[_0x0a9e('0x3a')],{'$or':_[_0x0a9e('0x29')](_0x2bbb86[_0x0a9e('0x33')],function(_0xdb98ca){var _0x40fc56={};_0x40fc56[_0xdb98ca]={'$like':'%'+_0x1cc4f3[_0x0a9e('0x2f')][_0x0a9e('0x3c')]+'%'};return _0x40fc56;})});}_0x2bbb86=_[_0x0a9e('0x3d')]({},_0x2bbb86,_0x1cc4f3[_0x0a9e('0x44')]);return db[_0x0a9e('0x58')][_0x0a9e('0x1c')]({'where':_0x2bbb86[_0x0a9e('0x3a')]})['then'](function(_0xf4120f){_0x320898[_0x0a9e('0x1c')]=_0xf4120f;if(_0x1cc4f3[_0x0a9e('0x2f')]['includeAll']){_0x2bbb86[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x58')][_0x0a9e('0x40')](_0x2bbb86);})[_0x0a9e('0x22')](function(_0x56d650){_0x320898['rows']=_0x56d650;return _0x320898;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x2e89b7,_0x2bbb86))[_0x0a9e('0x42')](handleError(_0x2e89b7,null));};exports['getAnswers']=function(_0x45108c,_0x53a6a1,_0x260f4b){var _0x8ebf02={'raw':!![],'where':{}};var _0x5637a1={};var _0x28a942={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x57')]({'where':{'id':_0x45108c[_0x0a9e('0x55')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x53a6a1,null))[_0x0a9e('0x22')](function(_0x444f1f){if(_0x444f1f){_0x5637a1['model']=_[_0x0a9e('0x30')](db[_0x0a9e('0x5b')][_0x0a9e('0x2b')]);_0x5637a1[_0x0a9e('0x2f')]=_['keys'](_0x45108c[_0x0a9e('0x2f')]);_0x5637a1[_0x0a9e('0x31')]=_['intersection'](_0x5637a1[_0x0a9e('0x34')],_0x5637a1['query']);_0x8ebf02[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x5637a1[_0x0a9e('0x34')],qs[_0x0a9e('0x35')](_0x45108c['query']['fields']));_0x8ebf02[_0x0a9e('0x33')]=_0x8ebf02[_0x0a9e('0x33')][_0x0a9e('0x36')]?_0x8ebf02['attributes']:_0x5637a1[_0x0a9e('0x34')];if(!_0x45108c[_0x0a9e('0x2f')]['hasOwnProperty']('nolimit')){_0x8ebf02[_0x0a9e('0x1a')]=qs['limit'](_0x45108c['query']['limit']);_0x8ebf02[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x45108c[_0x0a9e('0x2f')][_0x0a9e('0x1b')]);}_0x8ebf02[_0x0a9e('0x59')]=qs[_0x0a9e('0x39')](_0x45108c['query'][_0x0a9e('0x39')]);_0x8ebf02['where']=qs[_0x0a9e('0x31')](_[_0x0a9e('0x3b')](_0x45108c[_0x0a9e('0x2f')],_0x5637a1[_0x0a9e('0x31')]));_0x8ebf02['where'][_0x0a9e('0x5a')]=_0x444f1f['id'];if(_0x45108c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]){_0x8ebf02['where']=_[_0x0a9e('0x3d')](_0x8ebf02[_0x0a9e('0x3a')],{'$or':_[_0x0a9e('0x29')](_0x8ebf02[_0x0a9e('0x33')],function(_0x255e49){var _0x1910bf={};_0x1910bf[_0x255e49]={'$like':'%'+_0x45108c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]+'%'};return _0x1910bf;})});}_0x8ebf02=_['merge']({},_0x8ebf02,_0x45108c[_0x0a9e('0x44')]);return db[_0x0a9e('0x5b')]['count']({'where':_0x8ebf02[_0x0a9e('0x3a')]})[_0x0a9e('0x22')](function(_0x3a1974){_0x28a942['count']=_0x3a1974;if(_0x45108c[_0x0a9e('0x2f')]['includeAll']){_0x8ebf02[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x5b')][_0x0a9e('0x40')](_0x8ebf02);})[_0x0a9e('0x22')](function(_0x842d6f){_0x28a942[_0x0a9e('0x41')]=_0x842d6f;return _0x28a942;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x53a6a1,_0x8ebf02))[_0x0a9e('0x42')](handleError(_0x53a6a1,null));};function char(_0x501050){return _0x0a9e('0x5c')===typeof _0x501050?String[_0x0a9e('0x5d')][_0x0a9e('0x1f')](null,arguments):_0x501050;}function needsEncapsulation(_0x30ef6e){return!!_0x30ef6e&&(_0x30ef6e[_0x0a9e('0x5e')]()[_0x0a9e('0x5f')](char(0xd))>=0x0||_0x30ef6e[_0x0a9e('0x5e')]()[_0x0a9e('0x5f')](char(0xa))>=0x0||_0x30ef6e[_0x0a9e('0x5e')]()[_0x0a9e('0x5f')](char(0x2c))>=0x0||_0x30ef6e[_0x0a9e('0x5e')]()[_0x0a9e('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x18273f){var _0x4989f9=char(0x22),_0xc81b64='\x5c'+char(0x22),_0x23e2bd=_0x18273f[_0x0a9e('0x5e')]()[_0x0a9e('0x60')](new RegExp(_0x4989f9,'g'),_0xc81b64);return _0x4989f9+_0x23e2bd+_0x4989f9;}exports[_0x0a9e('0x61')]=function(_0x5d9ddb,_0x3afc8c,_0x1756c7){var _0x5ce99d,_0x23b447;var _0x5e725e={'where':{'ProjectId':_0x5d9ddb[_0x0a9e('0x55')]['id']}};if(_0x5d9ddb[_0x0a9e('0x2f')][_0x0a9e('0x62')]){_0x5e725e[_0x0a9e('0x3a')]['starttime']=JSON[_0x0a9e('0x63')](_0x5d9ddb['query'][_0x0a9e('0x62')]);}return db[_0x0a9e('0x58')]['findAll'](_0x5e725e)[_0x0a9e('0x22')](handleEntityNotFound(_0x3afc8c,null))[_0x0a9e('0x22')](function(_0x1dd541){if(_0x1dd541){_0x5ce99d=_0x1dd541;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0x0a9e('0x29')](_0x5ce99d,'id')},'ProjectId':_0x5d9ddb[_0x0a9e('0x55')]['id']},'order':_0x0a9e('0x64')});}})[_0x0a9e('0x22')](handleEntityNotFound(_0x3afc8c,null))[_0x0a9e('0x22')](function(_0x2450a8){if(_0x2450a8){_0x23b447=_0x2450a8;var _0x17793e={};for(var _0x3c75b9=0x0,_0x3f8124=_0x23b447['length'];_0x3c75b9<_0x3f8124;_0x3c75b9++){if(!_0x17793e[_0x0a9e('0x37')](_0x23b447[_0x3c75b9]['questionId'])){_0x17793e[_0x23b447[_0x3c75b9][_0x0a9e('0x65')]]=needsEncapsulation(_0x23b447[_0x3c75b9][_0x0a9e('0x66')])?encapsulate(_0x23b447[_0x3c75b9][_0x0a9e('0x66')]):_0x23b447[_0x3c75b9][_0x0a9e('0x66')];}}var _0x1b61d5=[],_0x4e7273={};for(var _0x436313=0x0,_0x4667bf=_0x5ce99d[_0x0a9e('0x36')];_0x436313<_0x4667bf;_0x436313++){_0x4e7273={'ProjectId':_0x5d9ddb[_0x0a9e('0x55')]['id'],'SessionId':_0x5ce99d[_0x436313]['id'],'StartTime':moment(_0x5ce99d[_0x436313][_0x0a9e('0x67')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x22a3cb=0x0,_0x583662=_0x23b447[_0x0a9e('0x36')];_0x22a3cb<_0x583662;_0x22a3cb++){if(_0x23b447[_0x22a3cb][_0x0a9e('0x68')]==_0x5ce99d[_0x436313]['id']&&_0x17793e[_0x0a9e('0x37')](_0x23b447[_0x22a3cb][_0x0a9e('0x65')])){_0x4e7273[_0x17793e[_0x23b447[_0x22a3cb][_0x0a9e('0x65')]]]=_0x23b447[_0x22a3cb][_0x0a9e('0x69')];}}for(var _0x596312 in _0x17793e){if(!_0x4e7273['hasOwnProperty'](_0x17793e[_0x596312])){_0x4e7273[_0x17793e[_0x596312]]=null;}}_0x1b61d5[_0x0a9e('0x6a')](_0x4e7273);}return _0x1b61d5;}})['then'](function(_0x2469d1){if(!_['isEmpty'](_0x2469d1)){var _0x427ccc=toCsv(_0x2469d1);var _0x564db2=Date['now']();fs[_0x0a9e('0x6b')](util[_0x0a9e('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x5d9ddb[_0x0a9e('0x55')]['id'],_0x564db2),_0x427ccc);_0x3afc8c[_0x0a9e('0x6d')](_0x0a9e('0x6e'),_0x0a9e('0x6f')+util[_0x0a9e('0x6c')]('Jscripty_Project_%d_Summary_%s.csv',_0x5d9ddb['params']['id'],_0x564db2));_0x3afc8c[_0x0a9e('0x6d')](_0x0a9e('0x70'),_0x0a9e('0x71'));return _0x3afc8c[_0x0a9e('0x72')](util[_0x0a9e('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x5d9ddb[_0x0a9e('0x55')]['id'],_0x564db2));}else{return _0x3afc8c[_0x0a9e('0x15')](0xcc);}})['catch'](handleError(_0x3afc8c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 6a66c47..c7a15f4 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 _0x3fea=['./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x42075c,_0xd4329f){var _0x45eaa1=function(_0x2ed6c4){while(--_0x2ed6c4){_0x42075c['push'](_0x42075c['shift']());}};_0x45eaa1(++_0xd4329f);}(_0x3fea,0x164));var _0xa3fe=function(_0x82f9d6,_0x374fce){_0x82f9d6=_0x82f9d6-0x0;var _0x541c27=_0x3fea[_0x82f9d6];return _0x541c27;};'use strict';var _=require('lodash');var util=require(_0xa3fe('0x0'));var logger=require(_0xa3fe('0x1'))('api');var moment=require(_0xa3fe('0x2'));var BPromise=require(_0xa3fe('0x3'));var rp=require(_0xa3fe('0x4'));var fs=require('fs');var path=require(_0xa3fe('0x5'));var rimraf=require(_0xa3fe('0x6'));var config=require(_0xa3fe('0x7'));var attributes=require(_0xa3fe('0x8'));module[_0xa3fe('0x9')]=function(_0x3e1996,_0x5c2366){return _0x3e1996[_0xa3fe('0xa')](_0xa3fe('0xb'),attributes,{'tableName':_0xa3fe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bbb=['../../config/environment','./jscriptyProject.attributes','JscriptyProject','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x446172,_0x3f0651){var _0x5349d9=function(_0x1ba7f9){while(--_0x1ba7f9){_0x446172['push'](_0x446172['shift']());}};_0x5349d9(++_0x3f0651);}(_0x2bbb,0x1d9));var _0xb2bb=function(_0x18099a,_0x5a9e3d){_0x18099a=_0x18099a-0x0;var _0x180791=_0x2bbb[_0x18099a];return _0x180791;};'use strict';var _=require(_0xb2bb('0x0'));var util=require(_0xb2bb('0x1'));var logger=require(_0xb2bb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb2bb('0x3'));var rp=require(_0xb2bb('0x4'));var fs=require('fs');var path=require(_0xb2bb('0x5'));var rimraf=require(_0xb2bb('0x6'));var config=require(_0xb2bb('0x7'));var attributes=require(_0xb2bb('0x8'));module['exports']=function(_0x425aca,_0x2718b7){return _0x425aca['define'](_0xb2bb('0x9'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index d9805a2..9e124fc 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 _0xc7c0=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird','randomstring','ioredis'];(function(_0x242e3f,_0x31b451){var _0x1ba9d9=function(_0x1d9887){while(--_0x1d9887){_0x242e3f['push'](_0x242e3f['shift']());}};_0x1ba9d9(++_0x31b451);}(_0xc7c0,0x10d));var _0x0c7c=function(_0x4a3102,_0x280e04){_0x4a3102=_0x4a3102-0x0;var _0x19fd4d=_0xc7c0[_0x4a3102];return _0x19fd4d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0c7c('0x0'));var BPromise=require(_0x0c7c('0x1'));var rs=require(_0x0c7c('0x2'));var fs=require('fs');var Redis=require(_0x0c7c('0x3'));var db=require(_0x0c7c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c7c('0x5'))(_0x0c7c('0x6'));var config=require(_0x0c7c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0c7c('0x8')][_0x0c7c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3dce89,_0x2e6b8,_0x5bf6bb){return new BPromise(function(_0x1fc0db,_0x58bba9){return client[_0x0c7c('0xa')](_0x3dce89,_0x5bf6bb)[_0x0c7c('0xb')](function(_0x3978b4){logger[_0x0c7c('0xc')](_0x0c7c('0xd'),_0x2e6b8,_0x0c7c('0xe'));logger[_0x0c7c('0xf')](_0x0c7c('0x10'),_0x2e6b8,_0x0c7c('0xe'),JSON[_0x0c7c('0x11')](_0x3978b4));if(_0x3978b4['error']){if(_0x3978b4[_0x0c7c('0x12')][_0x0c7c('0x13')]===0x1f4){logger['error'](_0x0c7c('0xd'),_0x2e6b8,_0x3978b4['error']['message']);return _0x58bba9(_0x3978b4[_0x0c7c('0x12')]['message']);}logger[_0x0c7c('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2e6b8,_0x3978b4['error'][_0x0c7c('0x14')]);return _0x1fc0db(_0x3978b4[_0x0c7c('0x12')][_0x0c7c('0x14')]);}else{logger[_0x0c7c('0xc')](_0x0c7c('0xd'),_0x2e6b8,'request\x20sent');_0x1fc0db(_0x3978b4['result'][_0x0c7c('0x14')]);}})['catch'](function(_0x21a1e6){logger[_0x0c7c('0x12')](_0x0c7c('0xd'),_0x2e6b8,_0x21a1e6);_0x58bba9(_0x21a1e6);});});} \ No newline at end of file +var _0x22c2=['../../config/utils','../../config/logger','rpc','client','http','request','then','JscriptyProject,\x20%s,\x20%s','request\x20sent','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0x22c2,0x1c8));var _0x222c=function(_0x39a40f,_0x278f1d){_0x39a40f=_0x39a40f-0x0;var _0x3d32c7=_0x22c2[_0x39a40f];return _0x3d32c7;};'use strict';var _=require('lodash');var util=require(_0x222c('0x0'));var moment=require(_0x222c('0x1'));var BPromise=require(_0x222c('0x2'));var rs=require(_0x222c('0x3'));var fs=require('fs');var Redis=require(_0x222c('0x4'));var db=require(_0x222c('0x5'))['db'];var utils=require(_0x222c('0x6'));var logger=require(_0x222c('0x7'))(_0x222c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x222c('0x9')][_0x222c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dcaab,_0x254abb,_0x3ce9f0){return new BPromise(function(_0x169dbc,_0x2d1d2c){return client[_0x222c('0xb')](_0x4dcaab,_0x3ce9f0)[_0x222c('0xc')](function(_0xa1cf8f){logger['info'](_0x222c('0xd'),_0x254abb,_0x222c('0xe'));logger['debug'](_0x222c('0xf'),_0x254abb,_0x222c('0xe'),JSON[_0x222c('0x10')](_0xa1cf8f));if(_0xa1cf8f[_0x222c('0x11')]){if(_0xa1cf8f[_0x222c('0x11')][_0x222c('0x12')]===0x1f4){logger['error'](_0x222c('0xd'),_0x254abb,_0xa1cf8f['error']['message']);return _0x2d1d2c(_0xa1cf8f[_0x222c('0x11')][_0x222c('0x13')]);}logger['error'](_0x222c('0xd'),_0x254abb,_0xa1cf8f[_0x222c('0x11')][_0x222c('0x13')]);return _0x169dbc(_0xa1cf8f['error'][_0x222c('0x13')]);}else{logger[_0x222c('0x14')](_0x222c('0xd'),_0x254abb,_0x222c('0xe'));_0x169dbc(_0xa1cf8f['result'][_0x222c('0x13')]);}})[_0x222c('0x15')](function(_0x389a86){logger[_0x222c('0x11')]('JscriptyProject,\x20%s,\x20%s',_0x254abb,_0x389a86);_0x2d1d2c(_0x389a86);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 2455848..2ed83b6 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 _0x1c2d=['/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x570016,_0x111cb9){var _0x3b4176=function(_0x147f5b){while(--_0x147f5b){_0x570016['push'](_0x570016['shift']());}};_0x3b4176(++_0x111cb9);}(_0x1c2d,0x142));var _0xd1c2=function(_0x205496,_0x11ab53){_0x205496=_0x205496-0x0;var _0x449187=_0x1c2d[_0x205496];return _0x449187;};'use strict';var multer=require(_0xd1c2('0x0'));var util=require(_0xd1c2('0x1'));var path=require(_0xd1c2('0x2'));var timeout=require(_0xd1c2('0x3'));var express=require(_0xd1c2('0x4'));var router=express[_0xd1c2('0x5')]();var fs_extra=require(_0xd1c2('0x6'));var auth=require(_0xd1c2('0x7'));var interaction=require(_0xd1c2('0x8'));var config=require(_0xd1c2('0x9'));var controller=require('./jscriptyQuestionReport.controller');router[_0xd1c2('0xa')]('/',auth[_0xd1c2('0xb')](),controller[_0xd1c2('0xc')]);router[_0xd1c2('0xa')]('/describe',auth[_0xd1c2('0xb')](),controller[_0xd1c2('0xd')]);router['get'](_0xd1c2('0xe'),auth[_0xd1c2('0xb')](),controller[_0xd1c2('0xf')]);router['post']('/',auth[_0xd1c2('0xb')](),controller[_0xd1c2('0x10')]);router[_0xd1c2('0x11')](_0xd1c2('0xe'),auth[_0xd1c2('0xb')](),controller[_0xd1c2('0x12')]);router['delete'](_0xd1c2('0xe'),auth['isAuthenticated'](),controller[_0xd1c2('0x13')]);module[_0xd1c2('0x14')]=router; \ No newline at end of file +var _0x6d6a=['/:id','show','post','create','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x6d6a,0x16c));var _0xa6d6=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x6d6a[_0x26462c];return _0x509a42;};'use strict';var multer=require(_0xa6d6('0x0'));var util=require(_0xa6d6('0x1'));var path=require('path');var timeout=require(_0xa6d6('0x2'));var express=require(_0xa6d6('0x3'));var router=express[_0xa6d6('0x4')]();var fs_extra=require(_0xa6d6('0x5'));var auth=require(_0xa6d6('0x6'));var interaction=require(_0xa6d6('0x7'));var config=require(_0xa6d6('0x8'));var controller=require(_0xa6d6('0x9'));router[_0xa6d6('0xa')]('/',auth[_0xa6d6('0xb')](),controller['index']);router[_0xa6d6('0xa')](_0xa6d6('0xc'),auth[_0xa6d6('0xb')](),controller[_0xa6d6('0xd')]);router[_0xa6d6('0xa')](_0xa6d6('0xe'),auth[_0xa6d6('0xb')](),controller[_0xa6d6('0xf')]);router[_0xa6d6('0x10')]('/',auth[_0xa6d6('0xb')](),controller[_0xa6d6('0x11')]);router['put'](_0xa6d6('0xe'),auth[_0xa6d6('0xb')](),controller['update']);router[_0xa6d6('0x12')](_0xa6d6('0xe'),auth['isAuthenticated'](),controller[_0xa6d6('0x13')]);module[_0xa6d6('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index d0b14eb..1537af8 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 _0x7d25=['long','STRING','exports','TEXT'];(function(_0x56ba26,_0x2ce5f7){var _0x28ed24=function(_0x2e1d03){while(--_0x2e1d03){_0x56ba26['push'](_0x56ba26['shift']());}};_0x28ed24(++_0x2ce5f7);}(_0x7d25,0x8a));var _0x57d2=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x7d25[_0x525c7b];return _0x27b33e;};'use strict';var Sequelize=require('sequelize');module[_0x57d2('0x0')]={'question':{'type':Sequelize[_0x57d2('0x1')]},'answer':{'type':Sequelize[_0x57d2('0x1')](_0x57d2('0x2'))},'membername':{'type':Sequelize[_0x57d2('0x3')]},'projectname':{'type':Sequelize[_0x57d2('0x3')]},'queue':{'type':Sequelize[_0x57d2('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd139=['long','STRING','sequelize','exports'];(function(_0xa4f529,_0x36add4){var _0x3ce0df=function(_0x4ac770){while(--_0x4ac770){_0xa4f529['push'](_0xa4f529['shift']());}};_0x3ce0df(++_0x36add4);}(_0xd139,0x14e));var _0x9d13=function(_0x3e6546,_0x512dc7){_0x3e6546=_0x3e6546-0x0;var _0x466c74=_0xd139[_0x3e6546];return _0x466c74;};'use strict';var Sequelize=require(_0x9d13('0x0'));module[_0x9d13('0x1')]={'question':{'type':Sequelize['TEXT']},'answer':{'type':Sequelize['TEXT'](_0x9d13('0x2'))},'membername':{'type':Sequelize[_0x9d13('0x3')]},'projectname':{'type':Sequelize[_0x9d13('0x3')]},'queue':{'type':Sequelize[_0x9d13('0x3')]},'uniqueid':{'type':Sequelize[_0x9d13('0x3')]},'calleridname':{'type':Sequelize[_0x9d13('0x3')]},'calleridnum':{'type':Sequelize[_0x9d13('0x3')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index ad93019..2baa886 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 _0xa571=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','save','update','then','destroy','end','error','name','index','map','JscriptyQuestionReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x36fa16,_0x416a6d){var _0x548bec=function(_0x331e7a){while(--_0x331e7a){_0x36fa16['push'](_0x36fa16['shift']());}};_0x548bec(++_0x416a6d);}(_0xa571,0x107));var _0x1a57=function(_0x4f2654,_0xddb1ad){_0x4f2654=_0x4f2654-0x0;var _0x3858b6=_0xa571[_0x4f2654];return _0x3858b6;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];function respondWithStatusCode(_0x1911b2,_0x202d9a){_0x202d9a=_0x202d9a||0xcc;return function(_0x5ae643){if(_0x5ae643){return _0x1911b2[_0x1a57('0x18')](_0x202d9a);}return _0x1911b2[_0x1a57('0x19')](_0x202d9a)['end']();};}function respondWithResult(_0x503278,_0x587422){_0x587422=_0x587422||0xc8;return function(_0xd08107){if(_0xd08107){return _0x503278[_0x1a57('0x19')](_0x587422)[_0x1a57('0x1a')](_0xd08107);}};}function respondWithFilteredResult(_0x153d01,_0x5802d6){return function(_0x20f7ad){if(_0x20f7ad){var _0x53c61f=typeof _0x5802d6['offset']===_0x1a57('0x1b')&&typeof _0x5802d6[_0x1a57('0x1c')]===_0x1a57('0x1b');var _0x51b4c2=_0x20f7ad[_0x1a57('0x1d')];var _0x1662a3=_0x53c61f?0x0:_0x5802d6[_0x1a57('0x1e')];var _0x53bb20=_0x53c61f?_0x20f7ad[_0x1a57('0x1d')]:_0x5802d6[_0x1a57('0x1e')]+_0x5802d6[_0x1a57('0x1c')];var _0xcba6b7;if(_0x53bb20>=_0x51b4c2){_0x53bb20=_0x51b4c2;_0xcba6b7=0xc8;}else{_0xcba6b7=0xce;}_0x153d01[_0x1a57('0x19')](_0xcba6b7);return _0x153d01['set']('Content-Range',_0x1662a3+'-'+_0x53bb20+'/'+_0x51b4c2)[_0x1a57('0x1a')](_0x20f7ad);}return null;};}function patchUpdates(_0x21e811){return function(_0x211c63){try{jsonpatch['apply'](_0x211c63,_0x21e811,!![]);}catch(_0x5c200e){return BPromise['reject'](_0x5c200e);}return _0x211c63[_0x1a57('0x1f')]();};}function saveUpdates(_0x113ad4,_0x3f52b9){return function(_0xee133b){if(_0xee133b){return _0xee133b[_0x1a57('0x20')](_0x113ad4)[_0x1a57('0x21')](function(_0x2efa49){return _0x2efa49;});}return null;};}function removeEntity(_0x2f8b00,_0x183ca3){return function(_0x35d5dc){if(_0x35d5dc){return _0x35d5dc[_0x1a57('0x22')]()[_0x1a57('0x21')](function(){_0x2f8b00[_0x1a57('0x19')](0xcc)[_0x1a57('0x23')]();});}};}function handleEntityNotFound(_0x2f9454,_0x182649){return function(_0x25c1e9){if(!_0x25c1e9){_0x2f9454[_0x1a57('0x18')](0x194);}return _0x25c1e9;};}function handleError(_0x27cfe1,_0xf6ffef){_0xf6ffef=_0xf6ffef||0x1f4;return function(_0x26584b){logger[_0x1a57('0x24')](_0x26584b['stack']);if(_0x26584b['name']){delete _0x26584b[_0x1a57('0x25')];}_0x27cfe1[_0x1a57('0x19')](_0xf6ffef)['send'](_0x26584b);};}exports[_0x1a57('0x26')]=function(_0x54f6a5,_0x2d8738){var _0x4a2901={},_0x53bf6e={},_0x8179a4={'count':0x0,'rows':[]};var _0x274fe6=_[_0x1a57('0x27')](db[_0x1a57('0x28')]['rawAttributes'],function(_0x366d5f){return{'name':_0x366d5f[_0x1a57('0x29')],'type':_0x366d5f[_0x1a57('0x2a')][_0x1a57('0x2b')]};});_0x53bf6e['model']=_[_0x1a57('0x27')](_0x274fe6,_0x1a57('0x25'));_0x53bf6e[_0x1a57('0x2c')]=_[_0x1a57('0x2d')](_0x54f6a5[_0x1a57('0x2c')]);_0x53bf6e[_0x1a57('0x2e')]=_[_0x1a57('0x2f')](_0x53bf6e[_0x1a57('0x30')],_0x53bf6e[_0x1a57('0x2c')]);_0x4a2901['attributes']=_[_0x1a57('0x2f')](_0x53bf6e[_0x1a57('0x30')],qs['fields'](_0x54f6a5['query'][_0x1a57('0x31')]));_0x4a2901[_0x1a57('0x32')]=_0x4a2901[_0x1a57('0x32')][_0x1a57('0x33')]?_0x4a2901[_0x1a57('0x32')]:_0x53bf6e[_0x1a57('0x30')];if(!_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x34')](_0x1a57('0x35'))){_0x4a2901[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x1c')]);_0x4a2901[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x1e')]);}_0x4a2901[_0x1a57('0x36')]=qs['sort'](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x37')]);_0x4a2901[_0x1a57('0x38')]=qs[_0x1a57('0x2e')](_[_0x1a57('0x39')](_0x54f6a5[_0x1a57('0x2c')],_0x53bf6e[_0x1a57('0x2e')]),_0x274fe6);if(_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3a')]){_0x4a2901['where']=_['merge'](_0x4a2901['where'],{'$or':_['map'](_0x274fe6,function(_0x333b32){if(_0x333b32[_0x1a57('0x2a')]!==_0x1a57('0x3b')){var _0x4d6e1e={};_0x4d6e1e[_0x333b32[_0x1a57('0x25')]]={'$like':'%'+_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3a')]+'%'};return _0x4d6e1e;}})});}_0x4a2901=_[_0x1a57('0x3c')]({},_0x4a2901,_0x54f6a5['options']);var _0x1be254={'where':_0x4a2901['where']};return db[_0x1a57('0x28')][_0x1a57('0x1d')](_0x1be254)[_0x1a57('0x21')](function(_0x534a9a){_0x8179a4[_0x1a57('0x1d')]=_0x534a9a;if(_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3d')]){_0x4a2901[_0x1a57('0x3e')]=[{'all':!![]}];}return db[_0x1a57('0x28')]['findAll'](_0x4a2901);})[_0x1a57('0x21')](function(_0x47e998){_0x8179a4['rows']=_0x47e998;return _0x8179a4;})[_0x1a57('0x21')](respondWithFilteredResult(_0x2d8738,_0x4a2901))['catch'](handleError(_0x2d8738,null));};exports[_0x1a57('0x3f')]=function(_0x398c59,_0x3fbae1){var _0x59abb1={'raw':!![],'where':{'id':_0x398c59[_0x1a57('0x40')]['id']}},_0x188a50={};_0x188a50[_0x1a57('0x30')]=_[_0x1a57('0x2d')](db['JscriptyQuestionReport'][_0x1a57('0x41')]);_0x188a50[_0x1a57('0x2c')]=_['keys'](_0x398c59[_0x1a57('0x2c')]);_0x188a50['filters']=_['intersection'](_0x188a50[_0x1a57('0x30')],_0x188a50[_0x1a57('0x2c')]);_0x59abb1[_0x1a57('0x32')]=_[_0x1a57('0x2f')](_0x188a50['model'],qs[_0x1a57('0x31')](_0x398c59[_0x1a57('0x2c')][_0x1a57('0x31')]));_0x59abb1[_0x1a57('0x32')]=_0x59abb1[_0x1a57('0x32')]['length']?_0x59abb1[_0x1a57('0x32')]:_0x188a50[_0x1a57('0x30')];if(_0x398c59[_0x1a57('0x2c')][_0x1a57('0x3d')]){_0x59abb1['include']=[{'all':!![]}];}_0x59abb1=_[_0x1a57('0x3c')]({},_0x59abb1,_0x398c59['options']);return db[_0x1a57('0x28')][_0x1a57('0x42')](_0x59abb1)[_0x1a57('0x21')](handleEntityNotFound(_0x3fbae1,null))[_0x1a57('0x21')](respondWithResult(_0x3fbae1,null))[_0x1a57('0x43')](handleError(_0x3fbae1,null));};exports[_0x1a57('0x44')]=function(_0x28f629,_0x401285){return db[_0x1a57('0x28')][_0x1a57('0x44')](_0x28f629[_0x1a57('0x45')],{})[_0x1a57('0x21')](respondWithResult(_0x401285,0xc9))[_0x1a57('0x43')](handleError(_0x401285,null));};exports['update']=function(_0xf4d056,_0x480aff){if(_0xf4d056[_0x1a57('0x45')]['id']){delete _0xf4d056[_0x1a57('0x45')]['id'];}return db[_0x1a57('0x28')][_0x1a57('0x42')]({'where':{'id':_0xf4d056[_0x1a57('0x40')]['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x480aff,null))[_0x1a57('0x21')](saveUpdates(_0xf4d056[_0x1a57('0x45')],null))[_0x1a57('0x21')](respondWithResult(_0x480aff,null))['catch'](handleError(_0x480aff,null));};exports[_0x1a57('0x22')]=function(_0x439a42,_0x51651d){return db[_0x1a57('0x28')][_0x1a57('0x42')]({'where':{'id':_0x439a42['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x51651d,null))[_0x1a57('0x21')](removeEntity(_0x51651d,null))['catch'](handleError(_0x51651d,null));};exports['describe']=function(_0x5b0563,_0x2c1bac){return db[_0x1a57('0x28')]['describe']()[_0x1a57('0x21')](respondWithResult(_0x2c1bac,null))[_0x1a57('0x43')](handleError(_0x2c1bac,null));}; \ No newline at end of file +var _0xe706=['includeAll','rows','catch','include','find','body','params','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options'];(function(_0x3f9137,_0x59a8bc){var _0x14f8b6=function(_0x5ceb44){while(--_0x5ceb44){_0x3f9137['push'](_0x3f9137['shift']());}};_0x14f8b6(++_0x59a8bc);}(_0xe706,0xa3));var _0x6e70=function(_0x31c68e,_0x5f0385){_0x31c68e=_0x31c68e-0x0;var _0x159e5d=_0xe706[_0x31c68e];return _0x159e5d;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));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('0xa'));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 licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={},_0xecf336={},_0x2864a0={'count':0x0,'rows':[]};var _0x396a67=_[_0x6e70('0x2e')](db[_0x6e70('0x2f')][_0x6e70('0x30')],function(_0x3a0821){return{'name':_0x3a0821[_0x6e70('0x31')],'type':_0x3a0821['type'][_0x6e70('0x32')]};});_0xecf336['model']=_[_0x6e70('0x2e')](_0x396a67,'name');_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x5d772a[_0x6e70('0x33')]);_0xecf336['filters']=_[_0x6e70('0x35')](_0xecf336[_0x6e70('0x36')],_0xecf336['query']);_0x406f29[_0x6e70('0x37')]=_[_0x6e70('0x35')](_0xecf336['model'],qs[_0x6e70('0x38')](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x38')]));_0x406f29[_0x6e70('0x37')]=_0x406f29[_0x6e70('0x37')][_0x6e70('0x39')]?_0x406f29[_0x6e70('0x37')]:_0xecf336[_0x6e70('0x36')];if(!_0x5d772a[_0x6e70('0x33')][_0x6e70('0x3a')]('nolimit')){_0x406f29[_0x6e70('0x20')]=qs['limit'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x20')]);_0x406f29[_0x6e70('0x22')]=qs[_0x6e70('0x22')](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x22')]);}_0x406f29[_0x6e70('0x3b')]=qs[_0x6e70('0x3c')](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x3c')]);_0x406f29[_0x6e70('0x3d')]=qs[_0x6e70('0x3e')](_[_0x6e70('0x3f')](_0x5d772a['query'],_0xecf336['filters']),_0x396a67);if(_0x5d772a['query'][_0x6e70('0x40')]){_0x406f29[_0x6e70('0x3d')]=_[_0x6e70('0x41')](_0x406f29[_0x6e70('0x3d')],{'$or':_[_0x6e70('0x2e')](_0x396a67,function(_0x3bdd87){if(_0x3bdd87['type']!==_0x6e70('0x42')){var _0x9e7ad2={};_0x9e7ad2[_0x3bdd87[_0x6e70('0x2b')]]={'$like':'%'+_0x5d772a[_0x6e70('0x33')][_0x6e70('0x40')]+'%'};return _0x9e7ad2;}})});}_0x406f29=_[_0x6e70('0x41')]({},_0x406f29,_0x5d772a[_0x6e70('0x43')]);var _0x16fc7d={'where':_0x406f29['where']};return db[_0x6e70('0x2f')][_0x6e70('0x21')](_0x16fc7d)[_0x6e70('0x29')](function(_0x31cad2){_0x2864a0[_0x6e70('0x21')]=_0x31cad2;if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x44')]){_0x406f29['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x406f29);})[_0x6e70('0x29')](function(_0x2b63cc){_0x2864a0[_0x6e70('0x45')]=_0x2b63cc;return _0x2864a0;})[_0x6e70('0x29')](respondWithFilteredResult(_0x1952ea,_0x406f29))[_0x6e70('0x46')](handleError(_0x1952ea,null));};exports['show']=function(_0x225d44,_0x2a58d7){var _0x2a2aca={'raw':!![],'where':{'id':_0x225d44['params']['id']}},_0x52b197={};_0x52b197['model']=_[_0x6e70('0x34')](db['JscriptyQuestionReport'][_0x6e70('0x30')]);_0x52b197[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x225d44[_0x6e70('0x33')]);_0x52b197['filters']=_[_0x6e70('0x35')](_0x52b197['model'],_0x52b197[_0x6e70('0x33')]);_0x2a2aca[_0x6e70('0x37')]=_[_0x6e70('0x35')](_0x52b197[_0x6e70('0x36')],qs['fields'](_0x225d44[_0x6e70('0x33')][_0x6e70('0x38')]));_0x2a2aca[_0x6e70('0x37')]=_0x2a2aca[_0x6e70('0x37')][_0x6e70('0x39')]?_0x2a2aca[_0x6e70('0x37')]:_0x52b197[_0x6e70('0x36')];if(_0x225d44['query'][_0x6e70('0x44')]){_0x2a2aca[_0x6e70('0x47')]=[{'all':!![]}];}_0x2a2aca=_[_0x6e70('0x41')]({},_0x2a2aca,_0x225d44[_0x6e70('0x43')]);return db[_0x6e70('0x2f')][_0x6e70('0x48')](_0x2a2aca)[_0x6e70('0x29')](handleEntityNotFound(_0x2a58d7,null))['then'](respondWithResult(_0x2a58d7,null))[_0x6e70('0x46')](handleError(_0x2a58d7,null));};exports['create']=function(_0x11794e,_0x3836e4){return db['JscriptyQuestionReport']['create'](_0x11794e[_0x6e70('0x49')],{})[_0x6e70('0x29')](respondWithResult(_0x3836e4,0xc9))[_0x6e70('0x46')](handleError(_0x3836e4,null));};exports['update']=function(_0x4af9b1,_0x238ebb){if(_0x4af9b1[_0x6e70('0x49')]['id']){delete _0x4af9b1[_0x6e70('0x49')]['id'];}return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x4af9b1[_0x6e70('0x4a')]['id']}})['then'](handleEntityNotFound(_0x238ebb,null))[_0x6e70('0x29')](saveUpdates(_0x4af9b1[_0x6e70('0x49')],null))[_0x6e70('0x29')](respondWithResult(_0x238ebb,null))[_0x6e70('0x46')](handleError(_0x238ebb,null));};exports[_0x6e70('0x4b')]=function(_0x4b354e,_0x4ae901){return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x4b354e[_0x6e70('0x4a')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x4ae901,null))[_0x6e70('0x29')](removeEntity(_0x4ae901,null))['catch'](handleError(_0x4ae901,null));};exports[_0x6e70('0x4c')]=function(_0x232366,_0x1fa320){return db[_0x6e70('0x2f')][_0x6e70('0x4c')]()['then'](respondWithResult(_0x1fa320,null))[_0x6e70('0x46')](handleError(_0x1fa320,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 143fd85..7924f31 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 _0x2ddc=['moment','request-promise','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','lodash','../../config/logger','api'];(function(_0x5c5310,_0x3ab51c){var _0x32da9d=function(_0x399bbf){while(--_0x399bbf){_0x5c5310['push'](_0x5c5310['shift']());}};_0x32da9d(++_0x3ab51c);}(_0x2ddc,0x185));var _0xc2dd=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x2ddc[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0xc2dd('0x0'));var util=require('util');var logger=require(_0xc2dd('0x1'))(_0xc2dd('0x2'));var moment=require(_0xc2dd('0x3'));var BPromise=require('bluebird');var rp=require(_0xc2dd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc2dd('0x5'));module['exports']=function(_0x4778d7,_0x1a1d04){return _0x4778d7[_0xc2dd('0x6')](_0xc2dd('0x7'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb304=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xb304,0x1ec));var _0x4b30=function(_0x482d88,_0x1e4c15){_0x482d88=_0x482d88-0x0;var _0x54c7c2=_0xb304[_0x482d88];return _0x54c7c2;};'use strict';var _=require(_0x4b30('0x0'));var util=require('util');var logger=require(_0x4b30('0x1'))(_0x4b30('0x2'));var moment=require(_0x4b30('0x3'));var BPromise=require(_0x4b30('0x4'));var rp=require(_0x4b30('0x5'));var fs=require('fs');var path=require(_0x4b30('0x6'));var rimraf=require(_0x4b30('0x7'));var config=require(_0x4b30('0x8'));var attributes=require(_0x4b30('0x9'));module[_0x4b30('0xa')]=function(_0x3ae346,_0x1f1169){return _0x3ae346['define'](_0x4b30('0xb'),attributes,{'tableName':_0x4b30('0xc'),'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 4a7f337..342d98e 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 _0x071a=['JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','JscriptyQuestionReport,\x20%s,\x20%s','message','error','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x3ffb80,_0x209661){var _0x3a8a4c=function(_0x24b3e2){while(--_0x24b3e2){_0x3ffb80['push'](_0x3ffb80['shift']());}};_0x3a8a4c(++_0x209661);}(_0x071a,0x165));var _0xa071=function(_0x439534,_0x4ff786){_0x439534=_0x439534-0x0;var _0x211660=_0x071a[_0x439534];return _0x211660;};'use strict';var _=require(_0xa071('0x0'));var util=require(_0xa071('0x1'));var moment=require(_0xa071('0x2'));var BPromise=require(_0xa071('0x3'));var rs=require(_0xa071('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa071('0x5'))['db'];var utils=require(_0xa071('0x6'));var logger=require(_0xa071('0x7'))(_0xa071('0x8'));var config=require('../../config/environment');var jayson=require(_0xa071('0x9'));var client=jayson[_0xa071('0xa')][_0xa071('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42b022,_0x46a3c1,_0xcd6c20){return new BPromise(function(_0x14fb0d,_0x2a98f6){return client[_0xa071('0xc')](_0x42b022,_0xcd6c20)[_0xa071('0xd')](function(_0x3b8593){logger[_0xa071('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x46a3c1,_0xa071('0xf'));logger[_0xa071('0x10')](_0xa071('0x11'),_0x46a3c1,'request\x20sent',JSON['stringify'](_0x3b8593));if(_0x3b8593['error']){if(_0x3b8593['error']['code']===0x1f4){logger['error'](_0xa071('0x12'),_0x46a3c1,_0x3b8593['error'][_0xa071('0x13')]);return _0x2a98f6(_0x3b8593[_0xa071('0x14')][_0xa071('0x13')]);}logger[_0xa071('0x14')](_0xa071('0x12'),_0x46a3c1,_0x3b8593['error'][_0xa071('0x13')]);return _0x14fb0d(_0x3b8593[_0xa071('0x14')]['message']);}else{logger['info'](_0xa071('0x12'),_0x46a3c1,'request\x20sent');_0x14fb0d(_0x3b8593['result'][_0xa071('0x13')]);}})[_0xa071('0x15')](function(_0xa7dd42){logger[_0xa071('0x14')](_0xa071('0x12'),_0x46a3c1,_0xa7dd42);_0x2a98f6(_0xa7dd42);});});} \ No newline at end of file +var _0xcfcf=['../../config/utils','../../config/logger','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x569059,_0x490d98){var _0x4c2cfb=function(_0xa90da0){while(--_0xa90da0){_0x569059['push'](_0x569059['shift']());}};_0x4c2cfb(++_0x490d98);}(_0xcfcf,0x1c5));var _0xfcfc=function(_0x168888,_0x1f8123){_0x168888=_0x168888-0x0;var _0x442a72=_0xcfcf[_0x168888];return _0x442a72;};'use strict';var _=require(_0xfcfc('0x0'));var util=require(_0xfcfc('0x1'));var moment=require(_0xfcfc('0x2'));var BPromise=require(_0xfcfc('0x3'));var rs=require(_0xfcfc('0x4'));var fs=require('fs');var Redis=require(_0xfcfc('0x5'));var db=require(_0xfcfc('0x6'))['db'];var utils=require(_0xfcfc('0x7'));var logger=require(_0xfcfc('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfcfc('0x9'));var client=jayson['client'][_0xfcfc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c2969,_0x375508,_0x5b207d){return new BPromise(function(_0x8f2d6f,_0x2d646d){return client[_0xfcfc('0xb')](_0x1c2969,_0x5b207d)[_0xfcfc('0xc')](function(_0x203c6e){logger[_0xfcfc('0xd')](_0xfcfc('0xe'),_0x375508,_0xfcfc('0xf'));logger[_0xfcfc('0x10')](_0xfcfc('0x11'),_0x375508,_0xfcfc('0xf'),JSON[_0xfcfc('0x12')](_0x203c6e));if(_0x203c6e[_0xfcfc('0x13')]){if(_0x203c6e[_0xfcfc('0x13')][_0xfcfc('0x14')]===0x1f4){logger[_0xfcfc('0x13')](_0xfcfc('0xe'),_0x375508,_0x203c6e['error'][_0xfcfc('0x15')]);return _0x2d646d(_0x203c6e[_0xfcfc('0x13')][_0xfcfc('0x15')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x375508,_0x203c6e[_0xfcfc('0x13')][_0xfcfc('0x15')]);return _0x8f2d6f(_0x203c6e[_0xfcfc('0x13')][_0xfcfc('0x15')]);}else{logger['info'](_0xfcfc('0xe'),_0x375508,_0xfcfc('0xf'));_0x8f2d6f(_0x203c6e['result']['message']);}})[_0xfcfc('0x16')](function(_0x578b07){logger[_0xfcfc('0x13')](_0xfcfc('0xe'),_0x375508,_0x578b07);_0x2d646d(_0x578b07);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 939b489..c8969dd 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 _0x5fab=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','getQuestions','post','create','put','update'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x5fab,0x177));var _0xb5fa=function(_0x2ce5e3,_0x429426){_0x2ce5e3=_0x2ce5e3-0x0;var _0xe1e73c=_0x5fab[_0x2ce5e3];return _0xe1e73c;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['get']('/:id/questions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')]('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);router['delete'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller['destroy']);module[_0xb5fa('0x15')]=router; \ No newline at end of file +var _0x038b=['isAuthenticated','/:id','/:id/questions','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','/describe'];(function(_0x3b9812,_0x540ccd){var _0x5bd515=function(_0x538c2a){while(--_0x538c2a){_0x3b9812['push'](_0x3b9812['shift']());}};_0x5bd515(++_0x540ccd);}(_0x038b,0x114));var _0xb038=function(_0x502594,_0x37b2da){_0x502594=_0x502594-0x0;var _0x77bba4=_0x038b[_0x502594];return _0x77bba4;};'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 fs_extra=require('fs-extra');var auth=require(_0xb038('0x4'));var interaction=require(_0xb038('0x5'));var config=require('../../config/environment');var controller=require(_0xb038('0x6'));router[_0xb038('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb038('0x7')](_0xb038('0x8'),auth[_0xb038('0x9')](),controller['describe']);router['get'](_0xb038('0xa'),auth[_0xb038('0x9')](),controller['show']);router['get'](_0xb038('0xb'),auth[_0xb038('0x9')](),controller['getQuestions']);router[_0xb038('0xc')]('/',auth[_0xb038('0x9')](),controller[_0xb038('0xd')]);router[_0xb038('0xe')](_0xb038('0xa'),auth[_0xb038('0x9')](),controller[_0xb038('0xf')]);router[_0xb038('0x10')](_0xb038('0xa'),auth[_0xb038('0x9')](),controller[_0xb038('0x11')]);module[_0xb038('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 0e6c496..78a2c06 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 _0x6dcd=['setDataValue','starttime','endtime','format','STRING','moment','sequelize','DATE'];(function(_0x3c8d1c,_0x293734){var _0x9ad1e3=function(_0x332058){while(--_0x332058){_0x3c8d1c['push'](_0x3c8d1c['shift']());}};_0x9ad1e3(++_0x293734);}(_0x6dcd,0x7d));var _0xd6dc=function(_0x6e79bf,_0x52f2ba){_0x6e79bf=_0x6e79bf-0x0;var _0x5b0e31=_0x6dcd[_0x6e79bf];return _0x5b0e31;};'use strict';var moment=require(_0xd6dc('0x0'));var Sequelize=require(_0xd6dc('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xd6dc('0x2')],'set':function(_0x224100){this[_0xd6dc('0x3')](_0xd6dc('0x4'),_0x224100);this[_0xd6dc('0x3')](_0xd6dc('0x5'),moment()[_0xd6dc('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xd6dc('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xd6dc('0x7')]},'uniqueid':{'type':Sequelize[_0xd6dc('0x7')]},'calleridname':{'type':Sequelize[_0xd6dc('0x7')]},'calleridnum':{'type':Sequelize[_0xd6dc('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4a83=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','DATE','setDataValue'];(function(_0xdfaef5,_0x4c76ef){var _0x20286b=function(_0x51a2bc){while(--_0x51a2bc){_0xdfaef5['push'](_0xdfaef5['shift']());}};_0x20286b(++_0x4c76ef);}(_0x4a83,0x140));var _0x34a8=function(_0x51fb15,_0x4ffc5f){_0x51fb15=_0x51fb15-0x0;var _0x11899e=_0x4a83[_0x51fb15];return _0x11899e;};'use strict';var moment=require(_0x34a8('0x0'));var Sequelize=require(_0x34a8('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x34a8('0x2')],'set':function(_0xdc3eff){this[_0x34a8('0x3')]('starttime',_0xdc3eff);this[_0x34a8('0x3')](_0x34a8('0x4'),moment()[_0x34a8('0x5')](_0x34a8('0x6')));}},'endtime':{'type':Sequelize[_0x34a8('0x2')]},'membername':{'type':Sequelize[_0x34a8('0x7')]},'projectname':{'type':Sequelize[_0x34a8('0x7')]},'queue':{'type':Sequelize[_0x34a8('0x7')]},'uniqueid':{'type':Sequelize[_0x34a8('0x7')]},'calleridname':{'type':Sequelize[_0x34a8('0x7')]},'calleridnum':{'type':Sequelize[_0x34a8('0x7')]},'completed':{'type':Sequelize[_0x34a8('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 70fc458..7678638 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 _0x59f3=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptySessionReport','findAll','rows','catch','show','params','include','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x2a25d9,_0x56192b){var _0x16ec3e=function(_0x3b3a86){while(--_0x3b3a86){_0x2a25d9['push'](_0x2a25d9['shift']());}};_0x16ec3e(++_0x56192b);}(_0x59f3,0x1c3));var _0x359f=function(_0x542d80,_0x150561){_0x542d80=_0x542d80-0x0;var _0x1f4492=_0x59f3[_0x542d80];return _0x1f4492;};'use strict';var emlformat=require(_0x359f('0x0'));var rimraf=require(_0x359f('0x1'));var zipdir=require(_0x359f('0x2'));var jsonpatch=require(_0x359f('0x3'));var rp=require(_0x359f('0x4'));var moment=require(_0x359f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x359f('0x6'));var util=require(_0x359f('0x7'));var path=require(_0x359f('0x8'));var sox=require(_0x359f('0x9'));var csv=require(_0x359f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x359f('0xb'));var squel=require(_0x359f('0xc'));var crypto=require('crypto');var jsforce=require(_0x359f('0xd'));var deskjs=require(_0x359f('0xe'));var toCsv=require(_0x359f('0xa'));var querystring=require(_0x359f('0xf'));var Papa=require(_0x359f('0x10'));var Redis=require(_0x359f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x359f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x359f('0x13'));var logger=require(_0x359f('0x14'))('api');var utils=require(_0x359f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x359f('0x16'));var db=require(_0x359f('0x17'))['db'];function respondWithStatusCode(_0x5e28ea,_0x5c8a86){_0x5c8a86=_0x5c8a86||0xcc;return function(_0x26bdca){if(_0x26bdca){return _0x5e28ea[_0x359f('0x18')](_0x5c8a86);}return _0x5e28ea[_0x359f('0x19')](_0x5c8a86)[_0x359f('0x1a')]();};}function respondWithResult(_0x550a07,_0x5bd21b){_0x5bd21b=_0x5bd21b||0xc8;return function(_0x11ab0d){if(_0x11ab0d){return _0x550a07[_0x359f('0x19')](_0x5bd21b)[_0x359f('0x1b')](_0x11ab0d);}};}function respondWithFilteredResult(_0x2c3bdb,_0x5136e1){return function(_0x3e7c6c){if(_0x3e7c6c){var _0x3af305=typeof _0x5136e1[_0x359f('0x1c')]===_0x359f('0x1d')&&typeof _0x5136e1[_0x359f('0x1e')]===_0x359f('0x1d');var _0x3f3a2f=_0x3e7c6c[_0x359f('0x1f')];var _0xf5609a=_0x3af305?0x0:_0x5136e1[_0x359f('0x1c')];var _0x5bacf9=_0x3af305?_0x3e7c6c[_0x359f('0x1f')]:_0x5136e1[_0x359f('0x1c')]+_0x5136e1[_0x359f('0x1e')];var _0x5064e8;if(_0x5bacf9>=_0x3f3a2f){_0x5bacf9=_0x3f3a2f;_0x5064e8=0xc8;}else{_0x5064e8=0xce;}_0x2c3bdb['status'](_0x5064e8);return _0x2c3bdb[_0x359f('0x20')](_0x359f('0x21'),_0xf5609a+'-'+_0x5bacf9+'/'+_0x3f3a2f)['json'](_0x3e7c6c);}return null;};}function patchUpdates(_0x3df4c6){return function(_0x6cb4ef){try{jsonpatch['apply'](_0x6cb4ef,_0x3df4c6,!![]);}catch(_0x330a0d){return BPromise[_0x359f('0x22')](_0x330a0d);}return _0x6cb4ef['save']();};}function saveUpdates(_0x57bc64,_0x49caed){return function(_0x56bef0){if(_0x56bef0){return _0x56bef0['update'](_0x57bc64)[_0x359f('0x23')](function(_0x3b65f8){return _0x3b65f8;});}return null;};}function removeEntity(_0x22b9dc,_0x3d0371){return function(_0x3e3113){if(_0x3e3113){return _0x3e3113[_0x359f('0x24')]()[_0x359f('0x23')](function(){_0x22b9dc[_0x359f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x128ad2,_0x33a191){return function(_0xc2c134){if(!_0xc2c134){_0x128ad2[_0x359f('0x18')](0x194);}return _0xc2c134;};}function handleError(_0x679451,_0x175279){_0x175279=_0x175279||0x1f4;return function(_0x320e1c){logger[_0x359f('0x25')](_0x320e1c[_0x359f('0x26')]);if(_0x320e1c[_0x359f('0x27')]){delete _0x320e1c[_0x359f('0x27')];}_0x679451[_0x359f('0x19')](_0x175279)['send'](_0x320e1c);};}exports[_0x359f('0x28')]=function(_0x258455,_0x24427d){var _0x3fe8ed={},_0x1052b9={},_0x436d86={'count':0x0,'rows':[]};var _0x4f4b68=_[_0x359f('0x29')](db['JscriptySessionReport'][_0x359f('0x2a')],function(_0x47f8c7){return{'name':_0x47f8c7[_0x359f('0x2b')],'type':_0x47f8c7[_0x359f('0x2c')][_0x359f('0x2d')]};});_0x1052b9[_0x359f('0x2e')]=_[_0x359f('0x29')](_0x4f4b68,_0x359f('0x27'));_0x1052b9['query']=_[_0x359f('0x2f')](_0x258455[_0x359f('0x30')]);_0x1052b9[_0x359f('0x31')]=_[_0x359f('0x32')](_0x1052b9[_0x359f('0x2e')],_0x1052b9[_0x359f('0x30')]);_0x3fe8ed[_0x359f('0x33')]=_[_0x359f('0x32')](_0x1052b9[_0x359f('0x2e')],qs[_0x359f('0x34')](_0x258455[_0x359f('0x30')][_0x359f('0x34')]));_0x3fe8ed[_0x359f('0x33')]=_0x3fe8ed[_0x359f('0x33')][_0x359f('0x35')]?_0x3fe8ed[_0x359f('0x33')]:_0x1052b9[_0x359f('0x2e')];if(!_0x258455[_0x359f('0x30')][_0x359f('0x36')]('nolimit')){_0x3fe8ed[_0x359f('0x1e')]=qs[_0x359f('0x1e')](_0x258455[_0x359f('0x30')]['limit']);_0x3fe8ed[_0x359f('0x1c')]=qs[_0x359f('0x1c')](_0x258455[_0x359f('0x30')][_0x359f('0x1c')]);}_0x3fe8ed[_0x359f('0x37')]=qs[_0x359f('0x38')](_0x258455[_0x359f('0x30')]['sort']);_0x3fe8ed[_0x359f('0x39')]=qs[_0x359f('0x31')](_[_0x359f('0x3a')](_0x258455['query'],_0x1052b9[_0x359f('0x31')]),_0x4f4b68);if(_0x258455[_0x359f('0x30')][_0x359f('0x3b')]){_0x3fe8ed['where']=_[_0x359f('0x3c')](_0x3fe8ed[_0x359f('0x39')],{'$or':_[_0x359f('0x29')](_0x4f4b68,function(_0x376e81){if(_0x376e81['type']!==_0x359f('0x3d')){var _0x41246f={};_0x41246f[_0x376e81['name']]={'$like':'%'+_0x258455[_0x359f('0x30')][_0x359f('0x3b')]+'%'};return _0x41246f;}})});}_0x3fe8ed=_[_0x359f('0x3c')]({},_0x3fe8ed,_0x258455[_0x359f('0x3e')]);var _0x5c5157={'where':_0x3fe8ed['where']};return db[_0x359f('0x3f')][_0x359f('0x1f')](_0x5c5157)['then'](function(_0x5cb01a){_0x436d86['count']=_0x5cb01a;if(_0x258455['query']['includeAll']){_0x3fe8ed['include']=[{'all':!![]}];}return db[_0x359f('0x3f')][_0x359f('0x40')](_0x3fe8ed);})['then'](function(_0x599006){_0x436d86[_0x359f('0x41')]=_0x599006;return _0x436d86;})[_0x359f('0x23')](respondWithFilteredResult(_0x24427d,_0x3fe8ed))[_0x359f('0x42')](handleError(_0x24427d,null));};exports[_0x359f('0x43')]=function(_0x405abe,_0x106eaa){var _0x1bce8e={'raw':!![],'where':{'id':_0x405abe[_0x359f('0x44')]['id']}},_0x55e6b8={};_0x55e6b8[_0x359f('0x2e')]=_[_0x359f('0x2f')](db[_0x359f('0x3f')][_0x359f('0x2a')]);_0x55e6b8[_0x359f('0x30')]=_['keys'](_0x405abe[_0x359f('0x30')]);_0x55e6b8[_0x359f('0x31')]=_[_0x359f('0x32')](_0x55e6b8[_0x359f('0x2e')],_0x55e6b8[_0x359f('0x30')]);_0x1bce8e[_0x359f('0x33')]=_['intersection'](_0x55e6b8[_0x359f('0x2e')],qs['fields'](_0x405abe['query'][_0x359f('0x34')]));_0x1bce8e['attributes']=_0x1bce8e[_0x359f('0x33')]['length']?_0x1bce8e[_0x359f('0x33')]:_0x55e6b8['model'];if(_0x405abe['query']['includeAll']){_0x1bce8e[_0x359f('0x45')]=[{'all':!![]}];}_0x1bce8e=_[_0x359f('0x3c')]({},_0x1bce8e,_0x405abe['options']);return db['JscriptySessionReport'][_0x359f('0x46')](_0x1bce8e)[_0x359f('0x23')](handleEntityNotFound(_0x106eaa,null))['then'](respondWithResult(_0x106eaa,null))[_0x359f('0x42')](handleError(_0x106eaa,null));};exports['create']=function(_0x3cbb6d,_0x1e7f2b){return db[_0x359f('0x3f')][_0x359f('0x47')](_0x3cbb6d[_0x359f('0x48')],{})['then'](respondWithResult(_0x1e7f2b,0xc9))[_0x359f('0x42')](handleError(_0x1e7f2b,null));};exports['update']=function(_0x85a28c,_0x2785d3){if(_0x85a28c[_0x359f('0x48')]['id']){delete _0x85a28c[_0x359f('0x48')]['id'];}return db['JscriptySessionReport'][_0x359f('0x46')]({'where':{'id':_0x85a28c[_0x359f('0x44')]['id']}})[_0x359f('0x23')](handleEntityNotFound(_0x2785d3,null))['then'](saveUpdates(_0x85a28c['body'],null))['then'](respondWithResult(_0x2785d3,null))['catch'](handleError(_0x2785d3,null));};exports['destroy']=function(_0x4de57a,_0x59e7c7){return db[_0x359f('0x3f')][_0x359f('0x46')]({'where':{'id':_0x4de57a['params']['id']}})['then'](handleEntityNotFound(_0x59e7c7,null))[_0x359f('0x23')](removeEntity(_0x59e7c7,null))[_0x359f('0x42')](handleError(_0x59e7c7,null));};exports[_0x359f('0x49')]=function(_0x27e2a2,_0x3ec8f5){return db[_0x359f('0x3f')]['describe']()[_0x359f('0x23')](respondWithResult(_0x3ec8f5,null))[_0x359f('0x42')](handleError(_0x3ec8f5,null));};exports[_0x359f('0x4a')]=function(_0x3882a5,_0xe3af5a,_0x518bee){var _0x5b887e={'raw':!![],'where':{}};var _0x584df4={};var _0x51a765={'count':0x0,'rows':[]};return db[_0x359f('0x3f')][_0x359f('0x4b')]({'where':{'id':_0x3882a5['params']['id']}})['then'](handleEntityNotFound(_0xe3af5a,null))[_0x359f('0x23')](function(_0x1741bd){if(_0x1741bd){_0x584df4[_0x359f('0x2e')]=_['keys'](db[_0x359f('0x4c')][_0x359f('0x2a')]);_0x584df4['query']=_[_0x359f('0x2f')](_0x3882a5[_0x359f('0x30')]);_0x584df4[_0x359f('0x31')]=_[_0x359f('0x32')](_0x584df4[_0x359f('0x2e')],_0x584df4[_0x359f('0x30')]);_0x5b887e[_0x359f('0x33')]=_[_0x359f('0x32')](_0x584df4[_0x359f('0x2e')],qs[_0x359f('0x34')](_0x3882a5[_0x359f('0x30')][_0x359f('0x34')]));_0x5b887e[_0x359f('0x33')]=_0x5b887e[_0x359f('0x33')][_0x359f('0x35')]?_0x5b887e[_0x359f('0x33')]:_0x584df4[_0x359f('0x2e')];if(!_0x3882a5[_0x359f('0x30')]['hasOwnProperty'](_0x359f('0x4d'))){_0x5b887e[_0x359f('0x1e')]=qs[_0x359f('0x1e')](_0x3882a5[_0x359f('0x30')][_0x359f('0x1e')]);_0x5b887e[_0x359f('0x1c')]=qs[_0x359f('0x1c')](_0x3882a5[_0x359f('0x30')][_0x359f('0x1c')]);}_0x5b887e[_0x359f('0x37')]=qs['sort'](_0x3882a5[_0x359f('0x30')][_0x359f('0x38')]);_0x5b887e[_0x359f('0x39')]=qs[_0x359f('0x31')](_[_0x359f('0x3a')](_0x3882a5['query'],_0x584df4[_0x359f('0x31')]));_0x5b887e[_0x359f('0x39')]['SessionId']=_0x1741bd['id'];if(_0x3882a5[_0x359f('0x30')][_0x359f('0x3b')]){_0x5b887e[_0x359f('0x39')]=_[_0x359f('0x3c')](_0x5b887e['where'],{'$or':_[_0x359f('0x29')](_0x5b887e[_0x359f('0x33')],function(_0x1d2f14){var _0x2500bd={};_0x2500bd[_0x1d2f14]={'$like':'%'+_0x3882a5[_0x359f('0x30')][_0x359f('0x3b')]+'%'};return _0x2500bd;})});}_0x5b887e=_[_0x359f('0x3c')]({},_0x5b887e,_0x3882a5[_0x359f('0x3e')]);return db[_0x359f('0x4c')][_0x359f('0x1f')]({'where':_0x5b887e['where']})['then'](function(_0x304691){_0x51a765[_0x359f('0x1f')]=_0x304691;if(_0x3882a5['query']['includeAll']){_0x5b887e[_0x359f('0x45')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x359f('0x40')](_0x5b887e);})[_0x359f('0x23')](function(_0xde3776){_0x51a765['rows']=_0xde3776;return _0x51a765;});}})[_0x359f('0x23')](respondWithFilteredResult(_0xe3af5a,_0x5b887e))[_0x359f('0x42')](handleError(_0xe3af5a,null));}; \ No newline at end of file +var _0xaa0a=['create','body','params','describe','findOne','JscriptyQuestionReport','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','find'];(function(_0x4029c1,_0x1f3fa8){var _0x2e1107=function(_0x11ded3){while(--_0x11ded3){_0x4029c1['push'](_0x4029c1['shift']());}};_0x2e1107(++_0x1f3fa8);}(_0xaa0a,0x18d));var _0xaaa0=function(_0x3bd6fc,_0x56493c){_0x3bd6fc=_0x3bd6fc-0x0;var _0x16e4bd=_0xaa0a[_0x3bd6fc];return _0x16e4bd;};'use strict';var emlformat=require(_0xaaa0('0x0'));var rimraf=require(_0xaaa0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaaa0('0x2'));var rp=require(_0xaaa0('0x3'));var moment=require(_0xaaa0('0x4'));var BPromise=require(_0xaaa0('0x5'));var Mustache=require('mustache');var util=require(_0xaaa0('0x6'));var path=require(_0xaaa0('0x7'));var sox=require('sox');var csv=require(_0xaaa0('0x8'));var ejs=require(_0xaaa0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaaa0('0xa'));var squel=require('squel');var crypto=require(_0xaaa0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xaaa0('0xc'));var toCsv=require(_0xaaa0('0x8'));var querystring=require(_0xaaa0('0xd'));var Papa=require(_0xaaa0('0xe'));var Redis=require('ioredis');var authService=require(_0xaaa0('0xf'));var qs=require(_0xaaa0('0x10'));var as=require(_0xaaa0('0x11'));var hardwareService=require(_0xaaa0('0x12'));var logger=require('../../config/logger')(_0xaaa0('0x13'));var utils=require('../../config/utils');var config=require(_0xaaa0('0x14'));var licenseUtil=require(_0xaaa0('0x15'));var db=require(_0xaaa0('0x16'))['db'];function respondWithStatusCode(_0x4c5a18,_0x1aa84f){_0x1aa84f=_0x1aa84f||0xcc;return function(_0x2c15b7){if(_0x2c15b7){return _0x4c5a18[_0xaaa0('0x17')](_0x1aa84f);}return _0x4c5a18[_0xaaa0('0x18')](_0x1aa84f)[_0xaaa0('0x19')]();};}function respondWithResult(_0xbe687c,_0x50d7e1){_0x50d7e1=_0x50d7e1||0xc8;return function(_0x5ac719){if(_0x5ac719){return _0xbe687c[_0xaaa0('0x18')](_0x50d7e1)[_0xaaa0('0x1a')](_0x5ac719);}};}function respondWithFilteredResult(_0x23ac50,_0x2de62b){return function(_0x1df0cf){if(_0x1df0cf){var _0x4247bf=typeof _0x2de62b[_0xaaa0('0x1b')]===_0xaaa0('0x1c')&&typeof _0x2de62b[_0xaaa0('0x1d')]==='undefined';var _0x31a55c=_0x1df0cf['count'];var _0x458e87=_0x4247bf?0x0:_0x2de62b[_0xaaa0('0x1b')];var _0x334166=_0x4247bf?_0x1df0cf[_0xaaa0('0x1e')]:_0x2de62b[_0xaaa0('0x1b')]+_0x2de62b[_0xaaa0('0x1d')];var _0xf51ad7;if(_0x334166>=_0x31a55c){_0x334166=_0x31a55c;_0xf51ad7=0xc8;}else{_0xf51ad7=0xce;}_0x23ac50['status'](_0xf51ad7);return _0x23ac50['set'](_0xaaa0('0x1f'),_0x458e87+'-'+_0x334166+'/'+_0x31a55c)[_0xaaa0('0x1a')](_0x1df0cf);}return null;};}function patchUpdates(_0x2925a6){return function(_0xfe92d4){try{jsonpatch[_0xaaa0('0x20')](_0xfe92d4,_0x2925a6,!![]);}catch(_0x4272be){return BPromise[_0xaaa0('0x21')](_0x4272be);}return _0xfe92d4[_0xaaa0('0x22')]();};}function saveUpdates(_0x228079,_0x255a84){return function(_0x4b5cd8){if(_0x4b5cd8){return _0x4b5cd8[_0xaaa0('0x23')](_0x228079)[_0xaaa0('0x24')](function(_0x2cbda3){return _0x2cbda3;});}return null;};}function removeEntity(_0xa5ee4b,_0x4565a9){return function(_0x57bee0){if(_0x57bee0){return _0x57bee0[_0xaaa0('0x25')]()[_0xaaa0('0x24')](function(){_0xa5ee4b[_0xaaa0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4373ae,_0x589915){return function(_0x573e34){if(!_0x573e34){_0x4373ae[_0xaaa0('0x17')](0x194);}return _0x573e34;};}function handleError(_0x2759f2,_0x33d348){_0x33d348=_0x33d348||0x1f4;return function(_0x25cbc6){logger['error'](_0x25cbc6[_0xaaa0('0x26')]);if(_0x25cbc6['name']){delete _0x25cbc6[_0xaaa0('0x27')];}_0x2759f2[_0xaaa0('0x18')](_0x33d348)[_0xaaa0('0x28')](_0x25cbc6);};}exports[_0xaaa0('0x29')]=function(_0x2defad,_0x326377){var _0x15850f={},_0x865173={},_0x4b52d6={'count':0x0,'rows':[]};var _0x5f4f90=_['map'](db[_0xaaa0('0x2a')][_0xaaa0('0x2b')],function(_0x320b3c){return{'name':_0x320b3c[_0xaaa0('0x2c')],'type':_0x320b3c[_0xaaa0('0x2d')][_0xaaa0('0x2e')]};});_0x865173['model']=_['map'](_0x5f4f90,_0xaaa0('0x27'));_0x865173[_0xaaa0('0x2f')]=_[_0xaaa0('0x30')](_0x2defad[_0xaaa0('0x2f')]);_0x865173[_0xaaa0('0x31')]=_['intersection'](_0x865173[_0xaaa0('0x32')],_0x865173['query']);_0x15850f[_0xaaa0('0x33')]=_[_0xaaa0('0x34')](_0x865173[_0xaaa0('0x32')],qs[_0xaaa0('0x35')](_0x2defad['query'][_0xaaa0('0x35')]));_0x15850f[_0xaaa0('0x33')]=_0x15850f['attributes'][_0xaaa0('0x36')]?_0x15850f['attributes']:_0x865173[_0xaaa0('0x32')];if(!_0x2defad[_0xaaa0('0x2f')][_0xaaa0('0x37')](_0xaaa0('0x38'))){_0x15850f['limit']=qs['limit'](_0x2defad['query'][_0xaaa0('0x1d')]);_0x15850f['offset']=qs[_0xaaa0('0x1b')](_0x2defad[_0xaaa0('0x2f')]['offset']);}_0x15850f[_0xaaa0('0x39')]=qs[_0xaaa0('0x3a')](_0x2defad[_0xaaa0('0x2f')][_0xaaa0('0x3a')]);_0x15850f[_0xaaa0('0x3b')]=qs[_0xaaa0('0x31')](_[_0xaaa0('0x3c')](_0x2defad[_0xaaa0('0x2f')],_0x865173[_0xaaa0('0x31')]),_0x5f4f90);if(_0x2defad['query'][_0xaaa0('0x3d')]){_0x15850f[_0xaaa0('0x3b')]=_[_0xaaa0('0x3e')](_0x15850f['where'],{'$or':_[_0xaaa0('0x3f')](_0x5f4f90,function(_0x5e5db9){if(_0x5e5db9[_0xaaa0('0x2d')]!==_0xaaa0('0x40')){var _0x50796b={};_0x50796b[_0x5e5db9[_0xaaa0('0x27')]]={'$like':'%'+_0x2defad['query'][_0xaaa0('0x3d')]+'%'};return _0x50796b;}})});}_0x15850f=_[_0xaaa0('0x3e')]({},_0x15850f,_0x2defad[_0xaaa0('0x41')]);var _0x31276e={'where':_0x15850f[_0xaaa0('0x3b')]};return db[_0xaaa0('0x2a')][_0xaaa0('0x1e')](_0x31276e)[_0xaaa0('0x24')](function(_0x3e5904){_0x4b52d6[_0xaaa0('0x1e')]=_0x3e5904;if(_0x2defad['query'][_0xaaa0('0x42')]){_0x15850f[_0xaaa0('0x43')]=[{'all':!![]}];}return db[_0xaaa0('0x2a')]['findAll'](_0x15850f);})[_0xaaa0('0x24')](function(_0x5462c0){_0x4b52d6[_0xaaa0('0x44')]=_0x5462c0;return _0x4b52d6;})[_0xaaa0('0x24')](respondWithFilteredResult(_0x326377,_0x15850f))[_0xaaa0('0x45')](handleError(_0x326377,null));};exports['show']=function(_0x515e72,_0x4179f8){var _0x5ee550={'raw':!![],'where':{'id':_0x515e72['params']['id']}},_0x5b1930={};_0x5b1930[_0xaaa0('0x32')]=_['keys'](db['JscriptySessionReport'][_0xaaa0('0x2b')]);_0x5b1930[_0xaaa0('0x2f')]=_[_0xaaa0('0x30')](_0x515e72[_0xaaa0('0x2f')]);_0x5b1930[_0xaaa0('0x31')]=_[_0xaaa0('0x34')](_0x5b1930[_0xaaa0('0x32')],_0x5b1930[_0xaaa0('0x2f')]);_0x5ee550[_0xaaa0('0x33')]=_[_0xaaa0('0x34')](_0x5b1930[_0xaaa0('0x32')],qs[_0xaaa0('0x35')](_0x515e72[_0xaaa0('0x2f')][_0xaaa0('0x35')]));_0x5ee550[_0xaaa0('0x33')]=_0x5ee550[_0xaaa0('0x33')][_0xaaa0('0x36')]?_0x5ee550[_0xaaa0('0x33')]:_0x5b1930[_0xaaa0('0x32')];if(_0x515e72[_0xaaa0('0x2f')][_0xaaa0('0x42')]){_0x5ee550[_0xaaa0('0x43')]=[{'all':!![]}];}_0x5ee550=_[_0xaaa0('0x3e')]({},_0x5ee550,_0x515e72[_0xaaa0('0x41')]);return db[_0xaaa0('0x2a')][_0xaaa0('0x46')](_0x5ee550)[_0xaaa0('0x24')](handleEntityNotFound(_0x4179f8,null))[_0xaaa0('0x24')](respondWithResult(_0x4179f8,null))[_0xaaa0('0x45')](handleError(_0x4179f8,null));};exports[_0xaaa0('0x47')]=function(_0x542457,_0x50f987){return db[_0xaaa0('0x2a')][_0xaaa0('0x47')](_0x542457[_0xaaa0('0x48')],{})[_0xaaa0('0x24')](respondWithResult(_0x50f987,0xc9))[_0xaaa0('0x45')](handleError(_0x50f987,null));};exports[_0xaaa0('0x23')]=function(_0x13484f,_0x364ccd){if(_0x13484f['body']['id']){delete _0x13484f[_0xaaa0('0x48')]['id'];}return db[_0xaaa0('0x2a')]['find']({'where':{'id':_0x13484f[_0xaaa0('0x49')]['id']}})['then'](handleEntityNotFound(_0x364ccd,null))[_0xaaa0('0x24')](saveUpdates(_0x13484f[_0xaaa0('0x48')],null))[_0xaaa0('0x24')](respondWithResult(_0x364ccd,null))[_0xaaa0('0x45')](handleError(_0x364ccd,null));};exports[_0xaaa0('0x25')]=function(_0x932b33,_0x319823){return db[_0xaaa0('0x2a')][_0xaaa0('0x46')]({'where':{'id':_0x932b33[_0xaaa0('0x49')]['id']}})[_0xaaa0('0x24')](handleEntityNotFound(_0x319823,null))['then'](removeEntity(_0x319823,null))[_0xaaa0('0x45')](handleError(_0x319823,null));};exports[_0xaaa0('0x4a')]=function(_0x2929b8,_0x32368a){return db[_0xaaa0('0x2a')][_0xaaa0('0x4a')]()[_0xaaa0('0x24')](respondWithResult(_0x32368a,null))[_0xaaa0('0x45')](handleError(_0x32368a,null));};exports['getQuestions']=function(_0x11824f,_0x364102,_0xcd5063){var _0x57e7da={'raw':!![],'where':{}};var _0x51673c={};var _0x22ef2b={'count':0x0,'rows':[]};return db[_0xaaa0('0x2a')][_0xaaa0('0x4b')]({'where':{'id':_0x11824f[_0xaaa0('0x49')]['id']}})[_0xaaa0('0x24')](handleEntityNotFound(_0x364102,null))[_0xaaa0('0x24')](function(_0x1f8405){if(_0x1f8405){_0x51673c[_0xaaa0('0x32')]=_[_0xaaa0('0x30')](db[_0xaaa0('0x4c')][_0xaaa0('0x2b')]);_0x51673c['query']=_[_0xaaa0('0x30')](_0x11824f['query']);_0x51673c[_0xaaa0('0x31')]=_[_0xaaa0('0x34')](_0x51673c['model'],_0x51673c[_0xaaa0('0x2f')]);_0x57e7da[_0xaaa0('0x33')]=_[_0xaaa0('0x34')](_0x51673c[_0xaaa0('0x32')],qs['fields'](_0x11824f[_0xaaa0('0x2f')][_0xaaa0('0x35')]));_0x57e7da[_0xaaa0('0x33')]=_0x57e7da[_0xaaa0('0x33')]['length']?_0x57e7da[_0xaaa0('0x33')]:_0x51673c['model'];if(!_0x11824f['query'][_0xaaa0('0x37')](_0xaaa0('0x38'))){_0x57e7da[_0xaaa0('0x1d')]=qs[_0xaaa0('0x1d')](_0x11824f[_0xaaa0('0x2f')][_0xaaa0('0x1d')]);_0x57e7da[_0xaaa0('0x1b')]=qs[_0xaaa0('0x1b')](_0x11824f[_0xaaa0('0x2f')][_0xaaa0('0x1b')]);}_0x57e7da[_0xaaa0('0x39')]=qs[_0xaaa0('0x3a')](_0x11824f[_0xaaa0('0x2f')][_0xaaa0('0x3a')]);_0x57e7da[_0xaaa0('0x3b')]=qs['filters'](_[_0xaaa0('0x3c')](_0x11824f[_0xaaa0('0x2f')],_0x51673c[_0xaaa0('0x31')]));_0x57e7da[_0xaaa0('0x3b')]['SessionId']=_0x1f8405['id'];if(_0x11824f[_0xaaa0('0x2f')][_0xaaa0('0x3d')]){_0x57e7da['where']=_[_0xaaa0('0x3e')](_0x57e7da[_0xaaa0('0x3b')],{'$or':_[_0xaaa0('0x3f')](_0x57e7da[_0xaaa0('0x33')],function(_0xea8eba){var _0x3a1075={};_0x3a1075[_0xea8eba]={'$like':'%'+_0x11824f['query'][_0xaaa0('0x3d')]+'%'};return _0x3a1075;})});}_0x57e7da=_[_0xaaa0('0x3e')]({},_0x57e7da,_0x11824f[_0xaaa0('0x41')]);return db[_0xaaa0('0x4c')]['count']({'where':_0x57e7da[_0xaaa0('0x3b')]})[_0xaaa0('0x24')](function(_0x4ec103){_0x22ef2b[_0xaaa0('0x1e')]=_0x4ec103;if(_0x11824f['query']['includeAll']){_0x57e7da['include']=[{'all':!![]}];}return db[_0xaaa0('0x4c')][_0xaaa0('0x4d')](_0x57e7da);})[_0xaaa0('0x24')](function(_0x1f7f3a){_0x22ef2b[_0xaaa0('0x44')]=_0x1f7f3a;return _0x22ef2b;});}})[_0xaaa0('0x24')](respondWithFilteredResult(_0x364102,_0x57e7da))[_0xaaa0('0x45')](handleError(_0x364102,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 3bf5ea7..8443a06 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 _0x8013=['./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x52c251,_0x567698){var _0x4a3ac2=function(_0x260fd0){while(--_0x260fd0){_0x52c251['push'](_0x52c251['shift']());}};_0x4a3ac2(++_0x567698);}(_0x8013,0x149));var _0x3801=function(_0x3afd0a,_0xa8a228){_0x3afd0a=_0x3afd0a-0x0;var _0x26651f=_0x8013[_0x3afd0a];return _0x26651f;};'use strict';var _=require(_0x3801('0x0'));var util=require(_0x3801('0x1'));var logger=require(_0x3801('0x2'))(_0x3801('0x3'));var moment=require(_0x3801('0x4'));var BPromise=require('bluebird');var rp=require(_0x3801('0x5'));var fs=require('fs');var path=require(_0x3801('0x6'));var rimraf=require(_0x3801('0x7'));var config=require(_0x3801('0x8'));var attributes=require(_0x3801('0x9'));module[_0x3801('0xa')]=function(_0x5d52c7,_0x2f024d){return _0x5d52c7[_0x3801('0xb')](_0x3801('0xc'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7823=['../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','util','../../config/logger','request-promise','path','rimraf'];(function(_0x55b523,_0x153614){var _0x2d3897=function(_0x3b4eb4){while(--_0x3b4eb4){_0x55b523['push'](_0x55b523['shift']());}};_0x2d3897(++_0x153614);}(_0x7823,0x1bd));var _0x3782=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7823[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x3782('0x0'));var logger=require(_0x3782('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3782('0x2'));var fs=require('fs');var path=require(_0x3782('0x3'));var rimraf=require(_0x3782('0x4'));var config=require(_0x3782('0x5'));var attributes=require(_0x3782('0x6'));module[_0x3782('0x7')]=function(_0x24bdd9,_0x13b5d3){return _0x24bdd9['define'](_0x3782('0x8'),attributes,{'tableName':_0x3782('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index beb30b1..ee99f62 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 _0x8b78=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8b78,0xaa));var _0x88b7=function(_0x5b227d,_0x5f3170){_0x5b227d=_0x5b227d-0x0;var _0x5b88a3=_0x8b78[_0x5b227d];return _0x5b88a3;};'use strict';var _=require(_0x88b7('0x0'));var util=require('util');var moment=require(_0x88b7('0x1'));var BPromise=require('bluebird');var rs=require(_0x88b7('0x2'));var fs=require('fs');var Redis=require(_0x88b7('0x3'));var db=require(_0x88b7('0x4'))['db'];var utils=require(_0x88b7('0x5'));var logger=require('../../config/logger')(_0x88b7('0x6'));var config=require('../../config/environment');var jayson=require(_0x88b7('0x7'));var client=jayson[_0x88b7('0x8')][_0x88b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x500247,_0x117d86,_0x26d62b){return new BPromise(function(_0x1188b6,_0x484c44){return client[_0x88b7('0xa')](_0x500247,_0x26d62b)[_0x88b7('0xb')](function(_0x53ffc7){logger[_0x88b7('0xc')](_0x88b7('0xd'),_0x117d86,_0x88b7('0xe'));logger[_0x88b7('0xf')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x117d86,_0x88b7('0xe'),JSON['stringify'](_0x53ffc7));if(_0x53ffc7[_0x88b7('0x10')]){if(_0x53ffc7['error'][_0x88b7('0x11')]===0x1f4){logger[_0x88b7('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x117d86,_0x53ffc7['error']['message']);return _0x484c44(_0x53ffc7[_0x88b7('0x10')][_0x88b7('0x12')]);}logger['error'](_0x88b7('0xd'),_0x117d86,_0x53ffc7['error']['message']);return _0x1188b6(_0x53ffc7[_0x88b7('0x10')][_0x88b7('0x12')]);}else{logger['info'](_0x88b7('0xd'),_0x117d86,_0x88b7('0xe'));_0x1188b6(_0x53ffc7[_0x88b7('0x13')][_0x88b7('0x12')]);}})[_0x88b7('0x14')](function(_0x3e6b2b){logger[_0x88b7('0x10')](_0x88b7('0xd'),_0x117d86,_0x3e6b2b);_0x484c44(_0x3e6b2b);});});} \ No newline at end of file +var _0x2a2b=['stringify','code','error','message','info','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x2a2b,0x1d5));var _0xb2a2=function(_0x18c8dc,_0x510c11){_0x18c8dc=_0x18c8dc-0x0;var _0x5b1272=_0x2a2b[_0x18c8dc];return _0x5b1272;};'use strict';var _=require(_0xb2a2('0x0'));var util=require('util');var moment=require(_0xb2a2('0x1'));var BPromise=require(_0xb2a2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb2a2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb2a2('0x4'))('rpc');var config=require(_0xb2a2('0x5'));var jayson=require(_0xb2a2('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x28430c,_0x578330,_0x4956e3){return new BPromise(function(_0x49a161,_0x3319f4){return client['request'](_0x28430c,_0x4956e3)['then'](function(_0x546b01){logger['info'](_0xb2a2('0x7'),_0x578330,_0xb2a2('0x8'));logger[_0xb2a2('0x9')](_0xb2a2('0xa'),_0x578330,_0xb2a2('0x8'),JSON[_0xb2a2('0xb')](_0x546b01));if(_0x546b01['error']){if(_0x546b01['error'][_0xb2a2('0xc')]===0x1f4){logger['error'](_0xb2a2('0x7'),_0x578330,_0x546b01[_0xb2a2('0xd')]['message']);return _0x3319f4(_0x546b01[_0xb2a2('0xd')][_0xb2a2('0xe')]);}logger[_0xb2a2('0xd')](_0xb2a2('0x7'),_0x578330,_0x546b01[_0xb2a2('0xd')][_0xb2a2('0xe')]);return _0x49a161(_0x546b01[_0xb2a2('0xd')][_0xb2a2('0xe')]);}else{logger[_0xb2a2('0xf')](_0xb2a2('0x7'),_0x578330,_0xb2a2('0x8'));_0x49a161(_0x546b01['result'][_0xb2a2('0xe')]);}})['catch'](function(_0x768341){logger[_0xb2a2('0xd')](_0xb2a2('0x7'),_0x578330,_0x768341);_0x3319f4(_0x768341);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index b81e6a3..3d40890 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 _0xda86=['get','index','/:id','isAuthenticated','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x33e4a7,_0x2e80a2){var _0x598620=function(_0x65d618){while(--_0x65d618){_0x33e4a7['push'](_0x33e4a7['shift']());}};_0x598620(++_0x2e80a2);}(_0xda86,0x1f3));var _0x6da8=function(_0x19a536,_0x1ff268){_0x19a536=_0x19a536-0x0;var _0x537e52=_0xda86[_0x19a536];return _0x537e52;};'use strict';var multer=require('multer');var util=require(_0x6da8('0x0'));var path=require(_0x6da8('0x1'));var timeout=require(_0x6da8('0x2'));var express=require('express');var router=express[_0x6da8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6da8('0x4'));var interaction=require(_0x6da8('0x5'));var config=require(_0x6da8('0x6'));var controller=require(_0x6da8('0x7'));router[_0x6da8('0x8')]('/',controller[_0x6da8('0x9')]);router['put'](_0x6da8('0xa'),auth[_0x6da8('0xb')](),controller['update']);module[_0x6da8('0xc')]=router; \ No newline at end of file +var _0x4828=['./license.controller','get','index','put','/:id','update','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x4828,0x13f));var _0x8482=function(_0x4a7fd1,_0x4bdde1){_0x4a7fd1=_0x4a7fd1-0x0;var _0x12ef10=_0x4828[_0x4a7fd1];return _0x12ef10;};'use strict';var multer=require('multer');var util=require(_0x8482('0x0'));var path=require('path');var timeout=require(_0x8482('0x1'));var express=require(_0x8482('0x2'));var router=express[_0x8482('0x3')]();var fs_extra=require(_0x8482('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8482('0x5'));var controller=require(_0x8482('0x6'));router[_0x8482('0x7')]('/',controller[_0x8482('0x8')]);router[_0x8482('0x9')](_0x8482('0xa'),auth['isAuthenticated'](),controller[_0x8482('0xb')]);module[_0x8482('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 48fad12..c99e5ed 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 _0xc4aa=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x5e81e2,_0x1d11bd){var _0x1f8673=function(_0x357ab8){while(--_0x357ab8){_0x5e81e2['push'](_0x5e81e2['shift']());}};_0x1f8673(++_0x1d11bd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'license':{'type':Sequelize[_0xac4a('0x2')]},'data1':{'type':Sequelize[_0xac4a('0x3')]},'data2':{'type':Sequelize[_0xac4a('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xac4a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdbf5=['exports','STRING','INTEGER'];(function(_0x2d6d5f,_0x583ccd){var _0x7a96b7=function(_0xe43cbe){while(--_0xe43cbe){_0x2d6d5f['push'](_0x2d6d5f['shift']());}};_0x7a96b7(++_0x583ccd);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x178e47,_0x170e1d){_0x178e47=_0x178e47-0x0;var _0x2f42f6=_0xdbf5[_0x178e47];return _0x2f42f6;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x5dbf('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x5dbf('0x2')],'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 89d571b..01dbc8b 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 _0xeda8=['filters','intersection','fields','query','length','attributes','merge','options','getLicense','catch','body','params','get','checkLicense','key','demo','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','send','index','model','keys','License','rawAttributes'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xeda8,0x104));var _0x8eda=function(_0x21bedf,_0x3ba1be){_0x21bedf=_0x21bedf-0x0;var _0x4ce187=_0xeda8[_0x21bedf];return _0x4ce187;};'use strict';var emlformat=require(_0x8eda('0x0'));var rimraf=require(_0x8eda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eda('0x2'));var rp=require(_0x8eda('0x3'));var moment=require(_0x8eda('0x4'));var BPromise=require(_0x8eda('0x5'));var Mustache=require(_0x8eda('0x6'));var util=require(_0x8eda('0x7'));var path=require(_0x8eda('0x8'));var sox=require(_0x8eda('0x9'));var csv=require(_0x8eda('0xa'));var ejs=require(_0x8eda('0xb'));var fs=require('fs');var fs_extra=require(_0x8eda('0xc'));var _=require(_0x8eda('0xd'));var squel=require('squel');var crypto=require(_0x8eda('0xe'));var jsforce=require(_0x8eda('0xf'));var deskjs=require(_0x8eda('0x10'));var toCsv=require(_0x8eda('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8eda('0x11'));var as=require(_0x8eda('0x12'));var hardwareService=require(_0x8eda('0x13'));var logger=require('../../config/logger')(_0x8eda('0x14'));var utils=require('../../config/utils');var config=require(_0x8eda('0x15'));var licenseUtil=require(_0x8eda('0x16'));var db=require(_0x8eda('0x17'))['db'];function respondWithStatusCode(_0x1ad3df,_0x337573){_0x337573=_0x337573||0xcc;return function(_0x3af00c){if(_0x3af00c){return _0x1ad3df[_0x8eda('0x18')](_0x337573);}return _0x1ad3df[_0x8eda('0x19')](_0x337573)['end']();};}function respondWithResult(_0x500bd4,_0xe04d90){_0xe04d90=_0xe04d90||0xc8;return function(_0x223dcf){if(_0x223dcf){return _0x500bd4['status'](_0xe04d90)[_0x8eda('0x1a')](_0x223dcf);}};}function respondWithFilteredResult(_0x34b1ee,_0x123905){return function(_0x56ff8a){if(_0x56ff8a){var _0x3f2925=typeof _0x123905['offset']===_0x8eda('0x1b')&&typeof _0x123905['limit']===_0x8eda('0x1b');var _0x58023b=_0x56ff8a[_0x8eda('0x1c')];var _0x2a4d2b=_0x3f2925?0x0:_0x123905['offset'];var _0x5e44b7=_0x3f2925?_0x56ff8a[_0x8eda('0x1c')]:_0x123905[_0x8eda('0x1d')]+_0x123905[_0x8eda('0x1e')];var _0x41abfa;if(_0x5e44b7>=_0x58023b){_0x5e44b7=_0x58023b;_0x41abfa=0xc8;}else{_0x41abfa=0xce;}_0x34b1ee[_0x8eda('0x19')](_0x41abfa);return _0x34b1ee[_0x8eda('0x1f')](_0x8eda('0x20'),_0x2a4d2b+'-'+_0x5e44b7+'/'+_0x58023b)[_0x8eda('0x1a')](_0x56ff8a);}return null;};}function patchUpdates(_0x850cce){return function(_0x232786){try{jsonpatch[_0x8eda('0x21')](_0x232786,_0x850cce,!![]);}catch(_0x57f336){return BPromise[_0x8eda('0x22')](_0x57f336);}return _0x232786['save']();};}function saveUpdates(_0x45517e,_0x5183bc){return function(_0x1033d6){if(_0x1033d6){return _0x1033d6[_0x8eda('0x23')](_0x45517e)['then'](function(_0x58e54b){return _0x58e54b;});}return null;};}function removeEntity(_0x56dba4,_0x2a4c99){return function(_0x17cae8){if(_0x17cae8){return _0x17cae8['destroy']()[_0x8eda('0x24')](function(){_0x56dba4[_0x8eda('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e955,_0xfa57ca){return function(_0x24b1e1){if(!_0x24b1e1){_0x25e955[_0x8eda('0x18')](0x194);}return _0x24b1e1;};}function handleError(_0x2e42e4,_0x5c8488){_0x5c8488=_0x5c8488||0x1f4;return function(_0x41b5a9){logger['error'](_0x41b5a9[_0x8eda('0x25')]);if(_0x41b5a9[_0x8eda('0x26')]){delete _0x41b5a9[_0x8eda('0x26')];}_0x2e42e4['status'](_0x5c8488)[_0x8eda('0x27')](_0x41b5a9);};}var utilLicense=require(_0x8eda('0x16'));exports[_0x8eda('0x28')]=function(_0x4cdd2e,_0x1616ea){var _0x11a999={'raw':!![],'where':{'id':0x1}},_0x5dd315={};_0x5dd315[_0x8eda('0x29')]=_[_0x8eda('0x2a')](db[_0x8eda('0x2b')][_0x8eda('0x2c')]);_0x5dd315['query']=_['keys'](_0x4cdd2e['query']);_0x5dd315[_0x8eda('0x2d')]=_[_0x8eda('0x2e')](_0x5dd315[_0x8eda('0x29')],_0x5dd315['query']);_0x11a999['attributes']=_['intersection'](_0x5dd315[_0x8eda('0x29')],qs[_0x8eda('0x2f')](_0x4cdd2e[_0x8eda('0x30')]['fields']));_0x11a999['attributes']=_0x11a999['attributes'][_0x8eda('0x31')]?_0x11a999[_0x8eda('0x32')]:_0x5dd315[_0x8eda('0x29')];_0x11a999=_[_0x8eda('0x33')]({},_0x11a999,_0x4cdd2e[_0x8eda('0x34')]);return utilLicense[_0x8eda('0x35')](_0x11a999)[_0x8eda('0x24')](respondWithResult(_0x1616ea,null))[_0x8eda('0x36')](handleError(_0x1616ea,null));};exports[_0x8eda('0x23')]=function(_0x11f40e,_0x2bc4c4){if(_0x11f40e[_0x8eda('0x37')]['id']){delete _0x11f40e[_0x8eda('0x37')]['id'];}return db[_0x8eda('0x2b')]['find']({'where':{'id':_0x11f40e[_0x8eda('0x38')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x2bc4c4,null))[_0x8eda('0x24')](function(_0x4e3b81){var _0x5061a3=_0x4e3b81[_0x8eda('0x39')]({'plain':!![]});return utilLicense[_0x8eda('0x3a')](_0x5061a3,_0x11f40e[_0x8eda('0x37')][_0x8eda('0x3b')]);})['then'](function(_0x443058){if(!_0x443058[_0x8eda('0x3c')]){return saveUpdates(_0x11f40e[_0x8eda('0x37')],null);}return _0x443058;})[_0x8eda('0x24')](respondWithResult(_0x2bc4c4,null))[_0x8eda('0x36')](handleError(_0x2bc4c4,null));}; \ No newline at end of file +var _0xb4b6=['License','rawAttributes','query','attributes','intersection','fields','getLicense','catch','update','body','params','get','checkLicense','demo','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','save','then','stack','name','model','keys'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x2ede45,_0x203b12){_0x2ede45=_0x2ede45-0x0;var _0x2842ac=_0xb4b6[_0x2ede45];return _0x2842ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b4b('0x0'));var zipdir=require(_0x6b4b('0x1'));var jsonpatch=require(_0x6b4b('0x2'));var rp=require(_0x6b4b('0x3'));var moment=require(_0x6b4b('0x4'));var BPromise=require(_0x6b4b('0x5'));var Mustache=require(_0x6b4b('0x6'));var util=require(_0x6b4b('0x7'));var path=require(_0x6b4b('0x8'));var sox=require('sox');var csv=require(_0x6b4b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b4b('0xa'));var _=require(_0x6b4b('0xb'));var squel=require(_0x6b4b('0xc'));var crypto=require(_0x6b4b('0xd'));var jsforce=require(_0x6b4b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6b4b('0x9'));var querystring=require(_0x6b4b('0xf'));var Papa=require(_0x6b4b('0x10'));var Redis=require(_0x6b4b('0x11'));var authService=require(_0x6b4b('0x12'));var qs=require(_0x6b4b('0x13'));var as=require(_0x6b4b('0x14'));var hardwareService=require(_0x6b4b('0x15'));var logger=require('../../config/logger')(_0x6b4b('0x16'));var utils=require('../../config/utils');var config=require(_0x6b4b('0x17'));var licenseUtil=require(_0x6b4b('0x18'));var db=require(_0x6b4b('0x19'))['db'];function respondWithStatusCode(_0x2ba8a0,_0x476d20){_0x476d20=_0x476d20||0xcc;return function(_0xa50ae5){if(_0xa50ae5){return _0x2ba8a0[_0x6b4b('0x1a')](_0x476d20);}return _0x2ba8a0['status'](_0x476d20)[_0x6b4b('0x1b')]();};}function respondWithResult(_0x2acc64,_0x3b99db){_0x3b99db=_0x3b99db||0xc8;return function(_0x587ed1){if(_0x587ed1){return _0x2acc64['status'](_0x3b99db)[_0x6b4b('0x1c')](_0x587ed1);}};}function respondWithFilteredResult(_0x2bf3fe,_0x5bf378){return function(_0x21ab38){if(_0x21ab38){var _0x3842a6=typeof _0x5bf378[_0x6b4b('0x1d')]===_0x6b4b('0x1e')&&typeof _0x5bf378[_0x6b4b('0x1f')]===_0x6b4b('0x1e');var _0x2fecb4=_0x21ab38[_0x6b4b('0x20')];var _0x15333b=_0x3842a6?0x0:_0x5bf378['offset'];var _0x5a1afc=_0x3842a6?_0x21ab38[_0x6b4b('0x20')]:_0x5bf378['offset']+_0x5bf378[_0x6b4b('0x1f')];var _0x44c5f6;if(_0x5a1afc>=_0x2fecb4){_0x5a1afc=_0x2fecb4;_0x44c5f6=0xc8;}else{_0x44c5f6=0xce;}_0x2bf3fe[_0x6b4b('0x21')](_0x44c5f6);return _0x2bf3fe[_0x6b4b('0x22')]('Content-Range',_0x15333b+'-'+_0x5a1afc+'/'+_0x2fecb4)[_0x6b4b('0x1c')](_0x21ab38);}return null;};}function patchUpdates(_0x6235eb){return function(_0x5f2224){try{jsonpatch['apply'](_0x5f2224,_0x6235eb,!![]);}catch(_0x5ec8a9){return BPromise[_0x6b4b('0x23')](_0x5ec8a9);}return _0x5f2224[_0x6b4b('0x24')]();};}function saveUpdates(_0x203f2a,_0x222e23){return function(_0x1a9fba){if(_0x1a9fba){return _0x1a9fba['update'](_0x203f2a)[_0x6b4b('0x25')](function(_0xbee434){return _0xbee434;});}return null;};}function removeEntity(_0x3a0376,_0xef64c9){return function(_0x595f33){if(_0x595f33){return _0x595f33['destroy']()['then'](function(){_0x3a0376['status'](0xcc)[_0x6b4b('0x1b')]();});}};}function handleEntityNotFound(_0x526f6d,_0x5df887){return function(_0x24e78a){if(!_0x24e78a){_0x526f6d[_0x6b4b('0x1a')](0x194);}return _0x24e78a;};}function handleError(_0x46580b,_0x35b517){_0x35b517=_0x35b517||0x1f4;return function(_0x5afba8){logger['error'](_0x5afba8[_0x6b4b('0x26')]);if(_0x5afba8[_0x6b4b('0x27')]){delete _0x5afba8[_0x6b4b('0x27')];}_0x46580b[_0x6b4b('0x21')](_0x35b517)['send'](_0x5afba8);};}var utilLicense=require(_0x6b4b('0x18'));exports['index']=function(_0x1c2f42,_0x1ab47c){var _0x334cf8={'raw':!![],'where':{'id':0x1}},_0x5efba8={};_0x5efba8[_0x6b4b('0x28')]=_[_0x6b4b('0x29')](db[_0x6b4b('0x2a')][_0x6b4b('0x2b')]);_0x5efba8[_0x6b4b('0x2c')]=_[_0x6b4b('0x29')](_0x1c2f42['query']);_0x5efba8['filters']=_['intersection'](_0x5efba8[_0x6b4b('0x28')],_0x5efba8[_0x6b4b('0x2c')]);_0x334cf8[_0x6b4b('0x2d')]=_[_0x6b4b('0x2e')](_0x5efba8[_0x6b4b('0x28')],qs[_0x6b4b('0x2f')](_0x1c2f42['query']['fields']));_0x334cf8['attributes']=_0x334cf8[_0x6b4b('0x2d')]['length']?_0x334cf8[_0x6b4b('0x2d')]:_0x5efba8['model'];_0x334cf8=_['merge']({},_0x334cf8,_0x1c2f42['options']);return utilLicense[_0x6b4b('0x30')](_0x334cf8)[_0x6b4b('0x25')](respondWithResult(_0x1ab47c,null))[_0x6b4b('0x31')](handleError(_0x1ab47c,null));};exports[_0x6b4b('0x32')]=function(_0x20d81a,_0x59015c){if(_0x20d81a[_0x6b4b('0x33')]['id']){delete _0x20d81a['body']['id'];}return db[_0x6b4b('0x2a')]['find']({'where':{'id':_0x20d81a[_0x6b4b('0x34')]['id']}})[_0x6b4b('0x25')](handleEntityNotFound(_0x59015c,null))[_0x6b4b('0x25')](function(_0x509fc1){var _0x273521=_0x509fc1[_0x6b4b('0x35')]({'plain':!![]});return utilLicense[_0x6b4b('0x36')](_0x273521,_0x20d81a['body']['key']);})[_0x6b4b('0x25')](function(_0x14522f){if(!_0x14522f[_0x6b4b('0x37')]){return saveUpdates(_0x20d81a[_0x6b4b('0x33')],null);}return _0x14522f;})[_0x6b4b('0x25')](respondWithResult(_0x59015c,null))[_0x6b4b('0x31')](handleError(_0x59015c,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 1baa67f..1329370 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 _0xdc3d=['request-promise','path','rimraf','../../config/environment','exports','define','License','license','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xdc3d,0x14d));var _0xddc3=function(_0x279c21,_0x5a2304){_0x279c21=_0x279c21-0x0;var _0x3d19e2=_0xdc3d[_0x279c21];return _0x3d19e2;};'use strict';var _=require(_0xddc3('0x0'));var util=require('util');var logger=require(_0xddc3('0x1'))(_0xddc3('0x2'));var moment=require(_0xddc3('0x3'));var BPromise=require(_0xddc3('0x4'));var rp=require(_0xddc3('0x5'));var fs=require('fs');var path=require(_0xddc3('0x6'));var rimraf=require(_0xddc3('0x7'));var config=require(_0xddc3('0x8'));var attributes=require('./license.attributes');module[_0xddc3('0x9')]=function(_0x2494ac,_0x5e2c1a){return _0x2494ac[_0xddc3('0xa')](_0xddc3('0xb'),attributes,{'tableName':_0xddc3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90c8=['license','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./license.attributes','exports','define','License'];(function(_0x54a192,_0x4d8636){var _0x18560d=function(_0x538d01){while(--_0x538d01){_0x54a192['push'](_0x54a192['shift']());}};_0x18560d(++_0x4d8636);}(_0x90c8,0x1eb));var _0x890c=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x90c8[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x890c('0x0'));var util=require(_0x890c('0x1'));var logger=require(_0x890c('0x2'))(_0x890c('0x3'));var moment=require(_0x890c('0x4'));var BPromise=require(_0x890c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x890c('0x6'));var rimraf=require(_0x890c('0x7'));var config=require(_0x890c('0x8'));var attributes=require(_0x890c('0x9'));module[_0x890c('0xa')]=function(_0x1b1b10,_0x1adc15){return _0x1b1b10[_0x890c('0xb')](_0x890c('0xc'),attributes,{'tableName':_0x890c('0xd'),'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 a7fe358..eb4a592 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 _0xffaa=['http','request','License,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xffaa,0x130));var _0xaffa=function(_0x436a16,_0x119822){_0x436a16=_0x436a16-0x0;var _0x312e0e=_0xffaa[_0x436a16];return _0x312e0e;};'use strict';var _=require(_0xaffa('0x0'));var util=require(_0xaffa('0x1'));var moment=require(_0xaffa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaffa('0x3'));var db=require(_0xaffa('0x4'))['db'];var utils=require(_0xaffa('0x5'));var logger=require(_0xaffa('0x6'))(_0xaffa('0x7'));var config=require(_0xaffa('0x8'));var jayson=require(_0xaffa('0x9'));var client=jayson[_0xaffa('0xa')][_0xaffa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x281191,_0x48320d,_0xa081be){return new BPromise(function(_0x7c018f,_0x10be9f){return client[_0xaffa('0xc')](_0x281191,_0xa081be)['then'](function(_0x32eeca){logger['info'](_0xaffa('0xd'),_0x48320d,_0xaffa('0xe'));logger[_0xaffa('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x48320d,_0xaffa('0xe'),JSON['stringify'](_0x32eeca));if(_0x32eeca['error']){if(_0x32eeca['error'][_0xaffa('0x10')]===0x1f4){logger[_0xaffa('0x11')](_0xaffa('0xd'),_0x48320d,_0x32eeca['error'][_0xaffa('0x12')]);return _0x10be9f(_0x32eeca['error'][_0xaffa('0x12')]);}logger['error'](_0xaffa('0xd'),_0x48320d,_0x32eeca[_0xaffa('0x11')][_0xaffa('0x12')]);return _0x7c018f(_0x32eeca[_0xaffa('0x11')][_0xaffa('0x12')]);}else{logger[_0xaffa('0x13')](_0xaffa('0xd'),_0x48320d,_0xaffa('0xe'));_0x7c018f(_0x32eeca['result'][_0xaffa('0x12')]);}})[_0xaffa('0x14')](function(_0x4b7d89){logger[_0xaffa('0x11')]('License,\x20%s,\x20%s',_0x48320d,_0x4b7d89);_0x10be9f(_0x4b7d89);});});} \ No newline at end of file +var _0x4d41=['request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','License,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x4ae8b6,_0x2415d0){var _0x414254=function(_0x234500){while(--_0x234500){_0x4ae8b6['push'](_0x4ae8b6['shift']());}};_0x414254(++_0x2415d0);}(_0x4d41,0x153));var _0x14d4=function(_0x242152,_0x2f7b09){_0x242152=_0x242152-0x0;var _0x167a0d=_0x4d41[_0x242152];return _0x167a0d;};'use strict';var _=require(_0x14d4('0x0'));var util=require(_0x14d4('0x1'));var moment=require(_0x14d4('0x2'));var BPromise=require('bluebird');var rs=require(_0x14d4('0x3'));var fs=require('fs');var Redis=require(_0x14d4('0x4'));var db=require(_0x14d4('0x5'))['db'];var utils=require(_0x14d4('0x6'));var logger=require(_0x14d4('0x7'))(_0x14d4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x14d4('0x9')][_0x14d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f7d30,_0x586569,_0x5a6cc0){return new BPromise(function(_0x5af0d5,_0x38ad4e){return client[_0x14d4('0xb')](_0x2f7d30,_0x5a6cc0)[_0x14d4('0xc')](function(_0x466286){logger['info']('License,\x20%s,\x20%s',_0x586569,_0x14d4('0xd'));logger[_0x14d4('0xe')](_0x14d4('0xf'),_0x586569,'request\x20sent',JSON['stringify'](_0x466286));if(_0x466286[_0x14d4('0x10')]){if(_0x466286['error'][_0x14d4('0x11')]===0x1f4){logger[_0x14d4('0x10')]('License,\x20%s,\x20%s',_0x586569,_0x466286[_0x14d4('0x10')][_0x14d4('0x12')]);return _0x38ad4e(_0x466286[_0x14d4('0x10')][_0x14d4('0x12')]);}logger[_0x14d4('0x10')](_0x14d4('0x13'),_0x586569,_0x466286[_0x14d4('0x10')][_0x14d4('0x12')]);return _0x5af0d5(_0x466286[_0x14d4('0x10')]['message']);}else{logger[_0x14d4('0x14')](_0x14d4('0x13'),_0x586569,_0x14d4('0xd'));_0x5af0d5(_0x466286['result'][_0x14d4('0x12')]);}})[_0x14d4('0x15')](function(_0x2eafb9){logger[_0x14d4('0x10')](_0x14d4('0x13'),_0x586569,_0x2eafb9);_0x38ad4e(_0x2eafb9);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 70b01ab..f0669ce 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 _0x4a82=['getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','addAgents','update','removeDispositions','delete','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','./mailAccount.controller','isAuthenticated','index','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0x4a82,0x18b));var _0x24a8=function(_0x49a86c,_0x34bac7){_0x49a86c=_0x49a86c-0x0;var _0x6dddf9=_0x4a82[_0x49a86c];return _0x6dddf9;};'use strict';var multer=require(_0x24a8('0x0'));var util=require('util');var path=require(_0x24a8('0x1'));var timeout=require(_0x24a8('0x2'));var express=require(_0x24a8('0x3'));var router=express['Router']();var fs_extra=require(_0x24a8('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x24a8('0x5'));var controller=require(_0x24a8('0x6'));router['get']('/',auth[_0x24a8('0x7')](),controller[_0x24a8('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x24a8('0x9')]);router[_0x24a8('0xa')](_0x24a8('0xb'),auth['isAuthenticated'](),controller[_0x24a8('0xc')]);router[_0x24a8('0xa')](_0x24a8('0xd'),auth['isAuthenticated'](),controller[_0x24a8('0xe')]);router['get'](_0x24a8('0xf'),auth[_0x24a8('0x7')](),controller[_0x24a8('0x10')]);router[_0x24a8('0xa')](_0x24a8('0x11'),auth[_0x24a8('0x7')](),controller[_0x24a8('0x12')]);router[_0x24a8('0xa')](_0x24a8('0x13'),auth['isAuthenticated'](),controller[_0x24a8('0x14')]);router[_0x24a8('0xa')]('/:id/interactions',auth[_0x24a8('0x7')](),controller[_0x24a8('0x15')]);router[_0x24a8('0xa')](_0x24a8('0x16'),auth[_0x24a8('0x7')](),controller[_0x24a8('0x17')]);router['get'](_0x24a8('0x18'),auth[_0x24a8('0x7')](),controller[_0x24a8('0x19')]);router[_0x24a8('0xa')](_0x24a8('0x1a'),auth[_0x24a8('0x7')](),controller['verifySmtp']);router['get'](_0x24a8('0x1b'),auth[_0x24a8('0x7')](),controller[_0x24a8('0x1c')]);router[_0x24a8('0x1d')](_0x24a8('0xd'),auth[_0x24a8('0x7')](),controller[_0x24a8('0x1e')]);router['post'](_0x24a8('0xf'),auth[_0x24a8('0x7')](),controller[_0x24a8('0x1f')]);router[_0x24a8('0x1d')]('/',auth['isAuthenticated'](),controller[_0x24a8('0x20')]);router[_0x24a8('0x1d')](_0x24a8('0x11'),auth[_0x24a8('0x7')](),controller[_0x24a8('0x21')]);router[_0x24a8('0x1d')](_0x24a8('0x13'),auth[_0x24a8('0x7')](),controller[_0x24a8('0x22')]);router[_0x24a8('0x1d')](_0x24a8('0x23'),auth[_0x24a8('0x7')](),controller[_0x24a8('0x24')]);router[_0x24a8('0x1d')](_0x24a8('0x16'),auth['isAuthenticated'](),controller[_0x24a8('0x25')]);router[_0x24a8('0x1d')](_0x24a8('0x26'),auth['isAuthenticated'](),controller['send']);router[_0x24a8('0x1d')]('/:id/users',auth['isAuthenticated'](),controller[_0x24a8('0x27')]);router['put'](_0x24a8('0xb'),auth[_0x24a8('0x7')](),controller[_0x24a8('0x28')]);router['delete']('/:id/dispositions',auth[_0x24a8('0x7')](),controller[_0x24a8('0x29')]);router[_0x24a8('0x2a')](_0x24a8('0xf'),auth[_0x24a8('0x7')](),controller['removeAnswers']);router['delete'](_0x24a8('0x11'),auth[_0x24a8('0x7')](),controller['removeImap']);router[_0x24a8('0x2a')](_0x24a8('0x13'),auth['isAuthenticated'](),controller[_0x24a8('0x2b')]);router[_0x24a8('0x2a')]('/:id',auth[_0x24a8('0x7')](),controller[_0x24a8('0x2c')]);router['delete']('/:id/users',auth[_0x24a8('0x7')](),controller[_0x24a8('0x2d')]);module[_0x24a8('0x2e')]=router; \ No newline at end of file +var _0xcf1e=['addDisposition','addAnswer','addImap','addSmtp','addApplications','/:id/send','send','addAgents','put','/:id','update','delete','removeDispositions','removeImap','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post'];(function(_0x147e9e,_0x3dfac5){var _0x1b42cf=function(_0x3a9bdc){while(--_0x3a9bdc){_0x147e9e['push'](_0x147e9e['shift']());}};_0x1b42cf(++_0x3dfac5);}(_0xcf1e,0xa7));var _0xecf1=function(_0x44f3c8,_0x42bdd7){_0x44f3c8=_0x44f3c8-0x0;var _0x272fd4=_0xcf1e[_0x44f3c8];return _0x272fd4;};'use strict';var multer=require(_0xecf1('0x0'));var util=require(_0xecf1('0x1'));var path=require(_0xecf1('0x2'));var timeout=require(_0xecf1('0x3'));var express=require('express');var router=express[_0xecf1('0x4')]();var fs_extra=require(_0xecf1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xecf1('0x6'));var config=require(_0xecf1('0x7'));var controller=require(_0xecf1('0x8'));router[_0xecf1('0x9')]('/',auth[_0xecf1('0xa')](),controller[_0xecf1('0xb')]);router['get']('/describe',auth[_0xecf1('0xa')](),controller[_0xecf1('0xc')]);router['get']('/:id',auth[_0xecf1('0xa')](),controller[_0xecf1('0xd')]);router['get'](_0xecf1('0xe'),auth[_0xecf1('0xa')](),controller[_0xecf1('0xf')]);router[_0xecf1('0x9')](_0xecf1('0x10'),auth['isAuthenticated'](),controller[_0xecf1('0x11')]);router[_0xecf1('0x9')](_0xecf1('0x12'),auth[_0xecf1('0xa')](),controller[_0xecf1('0x13')]);router['get'](_0xecf1('0x14'),auth[_0xecf1('0xa')](),controller[_0xecf1('0x15')]);router['get'](_0xecf1('0x16'),auth['isAuthenticated'](),controller[_0xecf1('0x17')]);router[_0xecf1('0x9')](_0xecf1('0x18'),auth['isAuthenticated'](),controller[_0xecf1('0x19')]);router[_0xecf1('0x9')](_0xecf1('0x1a'),auth[_0xecf1('0xa')](),controller[_0xecf1('0x1b')]);router['get'](_0xecf1('0x1c'),auth['isAuthenticated'](),controller[_0xecf1('0x1d')]);router['get'](_0xecf1('0x1e'),auth[_0xecf1('0xa')](),controller[_0xecf1('0x1f')]);router[_0xecf1('0x20')](_0xecf1('0xe'),auth['isAuthenticated'](),controller[_0xecf1('0x21')]);router['post'](_0xecf1('0x10'),auth[_0xecf1('0xa')](),controller[_0xecf1('0x22')]);router[_0xecf1('0x20')]('/',auth[_0xecf1('0xa')](),controller['create']);router[_0xecf1('0x20')](_0xecf1('0x12'),auth[_0xecf1('0xa')](),controller[_0xecf1('0x23')]);router[_0xecf1('0x20')](_0xecf1('0x14'),auth[_0xecf1('0xa')](),controller[_0xecf1('0x24')]);router[_0xecf1('0x20')](_0xecf1('0x16'),auth['isAuthenticated'](),controller['addInteraction']);router['post'](_0xecf1('0x18'),auth[_0xecf1('0xa')](),controller[_0xecf1('0x25')]);router[_0xecf1('0x20')](_0xecf1('0x26'),auth[_0xecf1('0xa')](),controller[_0xecf1('0x27')]);router[_0xecf1('0x20')](_0xecf1('0x1e'),auth[_0xecf1('0xa')](),controller[_0xecf1('0x28')]);router[_0xecf1('0x29')](_0xecf1('0x2a'),auth[_0xecf1('0xa')](),controller[_0xecf1('0x2b')]);router[_0xecf1('0x2c')](_0xecf1('0xe'),auth[_0xecf1('0xa')](),controller[_0xecf1('0x2d')]);router[_0xecf1('0x2c')]('/:id/canned_answers',auth[_0xecf1('0xa')](),controller['removeAnswers']);router[_0xecf1('0x2c')](_0xecf1('0x12'),auth[_0xecf1('0xa')](),controller[_0xecf1('0x2e')]);router[_0xecf1('0x2c')](_0xecf1('0x14'),auth[_0xecf1('0xa')](),controller['removeSmtp']);router[_0xecf1('0x2c')]('/:id',auth[_0xecf1('0xa')](),controller[_0xecf1('0x2f')]);router[_0xecf1('0x2c')]('/:id/users',auth[_0xecf1('0xa')](),controller[_0xecf1('0x30')]);module[_0xecf1('0x31')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index efb0611..241ce2a 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 _0xda11=['UNSIGNED','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','mandatoryDispositionPauseId','mandatoryDisposition','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xda11,0x91));var _0x1da1=function(_0x4bf106,_0x8a93d2){_0x4bf106=_0x4bf106-0x0;var _0x4a293e=_0xda11[_0x4bf106];return _0x4a293e;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x1da1('0x0')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x1da1('0x1')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x1da1('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x1da1('0x2')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x1da1('0x0')],'allowNull':![],'defaultValue':_0x1da1('0x3')},'fontSize':{'type':Sequelize[_0x1da1('0x4')](0x2)[_0x1da1('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1da1('0x6');}},'notificationSound':{'type':Sequelize[_0x1da1('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1da1('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1da1('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1da1('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1da1('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1da1('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1da1('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1da1('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x1da1('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x1da1('0x1')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4d07f4){if(!_0x4d07f4)this['setDataValue'](_0x1da1('0x8'),null);this['setDataValue'](_0x1da1('0x9'),_0x4d07f4);}}}; \ No newline at end of file +var _0x72f5=['mandatoryDisposition','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','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','mandatoryDispositionPauseId','setDataValue'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x72f5,0x1c8));var _0x572f=function(_0x138ed4,_0x2e6a7a){_0x138ed4=_0x138ed4-0x0;var _0x453256=_0x72f5[_0x138ed4];return _0x453256;};'use strict';var Sequelize=require('sequelize');module[_0x572f('0x0')]={'description':{'type':Sequelize[_0x572f('0x1')]},'name':{'type':Sequelize[_0x572f('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x572f('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x572f('0x3')]},'markAsUnread':{'type':Sequelize[_0x572f('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x572f('0x1')],'allowNull':![],'defaultValue':_0x572f('0x4')},'fontSize':{'type':Sequelize[_0x572f('0x5')](0x2)[_0x572f('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x572f('0x7');}},'notificationSound':{'type':Sequelize[_0x572f('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x572f('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x572f('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x572f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x572f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x572f('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x572f('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x572f('0x2')],'defaultValue':![],'comment':_0x572f('0x9'),'set':function(_0x517fda){if(!_0x517fda)this['setDataValue'](_0x572f('0xa'),null);this[_0x572f('0xb')](_0x572f('0xc'),_0x517fda);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 639c806..9c74fdf 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 _0xf712=['out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./mailAccount.socket','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','status','end','json','offset','limit','undefined','count','set','save','update','get','MailAccounts','UserProfileResource','sendStatus','stack','name','send','index','Imap','MailServerOut','Smtp','Pause','map','MailAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','type','merge','include','findAll','show','params','MailServerIn','mandatoryDispositionPause','length','includeAll','options','body','describe','find','MailAccountId','create','getDispositions','Disposition','order','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','key','email','ListId','isNil','active','description','cservice','cauthentication','user','pass','cpassword','authentication','host','port','service','cuser','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tags','tag','sequelize','transaction','MailApplication','destroy','bulkCreate','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','Contacts','updatedAt','DESC','from','attachments','join','root','server/files/attachments','auth','secure','SendMail','sendMail','List','messageId','subject','attach'];(function(_0x3e0dc4,_0x13971b){var _0x586111=function(_0x123c53){while(--_0x123c53){_0x3e0dc4['push'](_0x3e0dc4['shift']());}};_0x586111(++_0x13971b);}(_0xf712,0x195));var _0x2f71=function(_0x1a5498,_0x48f669){_0x1a5498=_0x1a5498-0x0;var _0x20b11a=_0xf712[_0x1a5498];return _0x20b11a;};'use strict';var emlformat=require(_0x2f71('0x0'));var rimraf=require(_0x2f71('0x1'));var zipdir=require(_0x2f71('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2f71('0x3'));var Mustache=require('mustache');var util=require(_0x2f71('0x4'));var path=require(_0x2f71('0x5'));var sox=require(_0x2f71('0x6'));var csv=require(_0x2f71('0x7'));var ejs=require(_0x2f71('0x8'));var fs=require('fs');var fs_extra=require(_0x2f71('0x9'));var _=require(_0x2f71('0xa'));var squel=require('squel');var crypto=require(_0x2f71('0xb'));var jsforce=require(_0x2f71('0xc'));var deskjs=require(_0x2f71('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2f71('0xe'));var htmlToText=require('html-to-text');var juice=require('juice');var Redis=require(_0x2f71('0xf'));var authService=require(_0x2f71('0x10'));var qs=require(_0x2f71('0x11'));var as=require(_0x2f71('0x12'));var hardwareService=require(_0x2f71('0x13'));var logger=require(_0x2f71('0x14'))(_0x2f71('0x15'));var utils=require(_0x2f71('0x16'));var config=require(_0x2f71('0x17'));var licenseUtil=require(_0x2f71('0x18'));var db=require(_0x2f71('0x19'))['db'];config['redis']=_[_0x2f71('0x1a')](config[_0x2f71('0x1b')],{'host':_0x2f71('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2f71('0x1d'))['register'](socket);var jayson=require(_0x2f71('0x1e'));var client=jayson[_0x2f71('0x1f')][_0x2f71('0x20')]({'port':0x232b});function respondWithRpcPromise(_0x4792ca,_0x16501e,_0xef4f35,_0x441435){return new BPromise(function(_0x3b4b6f,_0x4abcf4){var _0x1f8186=_0x441435||client;return _0x1f8186[_0x2f71('0x21')](_0x4792ca,_0xef4f35)[_0x2f71('0x22')](function(_0x48b4aa){logger['info'](_0x2f71('0x23'),_0x16501e,'request\x20sent');logger['debug'](_0x2f71('0x24'),_0x16501e,'request\x20sent',JSON[_0x2f71('0x25')](_0x48b4aa));if(_0x48b4aa[_0x2f71('0x26')]){if(_0x48b4aa[_0x2f71('0x26')]['code']===0x1f4){logger[_0x2f71('0x26')](_0x2f71('0x23'),_0x16501e,_0x48b4aa['error'][_0x2f71('0x27')]);return _0x4abcf4(_0x48b4aa['error'][_0x2f71('0x27')]);}logger['error'](_0x2f71('0x23'),_0x16501e,_0x48b4aa[_0x2f71('0x26')][_0x2f71('0x27')]);return _0x3b4b6f(_0x48b4aa[_0x2f71('0x26')][_0x2f71('0x27')]);}else{logger[_0x2f71('0x28')](_0x2f71('0x23'),_0x16501e,_0x2f71('0x29'));_0x3b4b6f(_0x48b4aa[_0x2f71('0x2a')]['message']);}})[_0x2f71('0x2b')](function(_0x431fd9){logger[_0x2f71('0x26')]('MailAccount,\x20%s,\x20%s',_0x16501e,_0x431fd9);_0x4abcf4(_0x431fd9);});});}function respondWithStatusCode(_0x2ef86c,_0x5392e6){_0x5392e6=_0x5392e6||0xcc;return function(_0x1d4640){if(_0x1d4640){return _0x2ef86c['sendStatus'](_0x5392e6);}return _0x2ef86c[_0x2f71('0x2c')](_0x5392e6)[_0x2f71('0x2d')]();};}function respondWithResult(_0x5d5827,_0x4ebd20){_0x4ebd20=_0x4ebd20||0xc8;return function(_0x33641d){if(_0x33641d){return _0x5d5827[_0x2f71('0x2c')](_0x4ebd20)[_0x2f71('0x2e')](_0x33641d);}};}function respondWithFilteredResult(_0x526581,_0x30db7f){return function(_0x193e2f){if(_0x193e2f){var _0x66c791=typeof _0x30db7f[_0x2f71('0x2f')]==='undefined'&&typeof _0x30db7f[_0x2f71('0x30')]===_0x2f71('0x31');var _0x280cd3=_0x193e2f['count'];var _0x575fb2=_0x66c791?0x0:_0x30db7f[_0x2f71('0x2f')];var _0x56034d=_0x66c791?_0x193e2f[_0x2f71('0x32')]:_0x30db7f[_0x2f71('0x2f')]+_0x30db7f[_0x2f71('0x30')];var _0x5d3171;if(_0x56034d>=_0x280cd3){_0x56034d=_0x280cd3;_0x5d3171=0xc8;}else{_0x5d3171=0xce;}_0x526581[_0x2f71('0x2c')](_0x5d3171);return _0x526581[_0x2f71('0x33')]('Content-Range',_0x575fb2+'-'+_0x56034d+'/'+_0x280cd3)['json'](_0x193e2f);}return null;};}function patchUpdates(_0xaff638){return function(_0xde9ec0){try{jsonpatch['apply'](_0xde9ec0,_0xaff638,!![]);}catch(_0x12c452){return BPromise['reject'](_0x12c452);}return _0xde9ec0[_0x2f71('0x34')]();};}function saveUpdates(_0x5b35da,_0x57f578){return function(_0x3bc021){if(_0x3bc021){return _0x3bc021[_0x2f71('0x35')](_0x5b35da)[_0x2f71('0x22')](function(_0xd6fbcc){return _0xd6fbcc;});}return null;};}function removeEntity(_0x27abba,_0x58df40){return function(_0xa5a7dd){if(_0xa5a7dd){return _0xa5a7dd['destroy']()['then'](function(){var _0x4df836=_0xa5a7dd[_0x2f71('0x36')]({'plain':!![]});var _0x353a91=_0x2f71('0x37');return db[_0x2f71('0x38')]['destroy']({'where':{'type':_0x353a91,'resourceId':_0x4df836['id']}})[_0x2f71('0x22')](function(){return _0xa5a7dd;});})[_0x2f71('0x22')](function(){_0x27abba[_0x2f71('0x2c')](0xcc)[_0x2f71('0x2d')]();});}};}function handleEntityNotFound(_0x22b695,_0x5ab4b5){return function(_0x598c6e){if(!_0x598c6e){_0x22b695[_0x2f71('0x39')](0x194);}return _0x598c6e;};}function handleError(_0x5f154e,_0x340e78){_0x340e78=_0x340e78||0x1f4;return function(_0x402dd2){logger[_0x2f71('0x26')](_0x402dd2[_0x2f71('0x3a')]);if(_0x402dd2[_0x2f71('0x3b')]){delete _0x402dd2[_0x2f71('0x3b')];}_0x5f154e[_0x2f71('0x2c')](_0x340e78)[_0x2f71('0x3c')](_0x402dd2);};}exports[_0x2f71('0x3d')]=function(_0x277de2,_0x591efb){var _0x2ac9b2={'include':[{'model':db['MailServerIn'],'as':_0x2f71('0x3e')},{'model':db[_0x2f71('0x3f')],'as':_0x2f71('0x40')},{'model':db[_0x2f71('0x41')],'as':'mandatoryDispositionPause'}]},_0x396773={},_0x29995c={'count':0x0,'rows':[]};var _0x373116=_[_0x2f71('0x42')](db[_0x2f71('0x43')][_0x2f71('0x44')],function(_0x14feb5){return{'name':_0x14feb5[_0x2f71('0x45')],'type':_0x14feb5['type']['key']};});_0x396773[_0x2f71('0x46')]=_[_0x2f71('0x42')](_0x373116,'name');_0x396773[_0x2f71('0x47')]=_[_0x2f71('0x48')](_0x277de2['query']);_0x396773[_0x2f71('0x49')]=_[_0x2f71('0x4a')](_0x396773[_0x2f71('0x46')],_0x396773[_0x2f71('0x47')]);_0x2ac9b2['attributes']=_[_0x2f71('0x4a')](_0x396773['model'],qs[_0x2f71('0x4b')](_0x277de2[_0x2f71('0x47')]['fields']));_0x2ac9b2['attributes']=_0x2ac9b2[_0x2f71('0x4c')]['length']?_0x2ac9b2[_0x2f71('0x4c')]:_0x396773['model'];if(!_0x277de2['query'][_0x2f71('0x4d')](_0x2f71('0x4e'))){_0x2ac9b2[_0x2f71('0x30')]=qs[_0x2f71('0x30')](_0x277de2[_0x2f71('0x47')][_0x2f71('0x30')]);_0x2ac9b2[_0x2f71('0x2f')]=qs[_0x2f71('0x2f')](_0x277de2[_0x2f71('0x47')]['offset']);}_0x2ac9b2['order']=qs[_0x2f71('0x4f')](_0x277de2['query']['sort']);_0x2ac9b2[_0x2f71('0x50')]=qs[_0x2f71('0x49')](_[_0x2f71('0x51')](_0x277de2['query'],_0x396773[_0x2f71('0x49')]),_0x373116);if(_0x277de2[_0x2f71('0x47')][_0x2f71('0x52')]){_0x2ac9b2[_0x2f71('0x50')]=_['merge'](_0x2ac9b2[_0x2f71('0x50')],{'$or':_[_0x2f71('0x42')](_0x373116,function(_0x25d746){if(_0x25d746[_0x2f71('0x53')]!=='VIRTUAL'){var _0x42e5ff={};_0x42e5ff[_0x25d746['name']]={'$like':'%'+_0x277de2['query'][_0x2f71('0x52')]+'%'};return _0x42e5ff;}})});}_0x2ac9b2=_[_0x2f71('0x54')]({},_0x2ac9b2,_0x277de2['options']);var _0x555598={'where':_0x2ac9b2[_0x2f71('0x50')]};return db['MailAccount'][_0x2f71('0x32')](_0x555598)[_0x2f71('0x22')](function(_0x34241d){_0x29995c[_0x2f71('0x32')]=_0x34241d;if(_0x277de2[_0x2f71('0x47')]['includeAll']){_0x2ac9b2[_0x2f71('0x55')]=[{'all':!![]}];}return db[_0x2f71('0x43')][_0x2f71('0x56')](_0x2ac9b2);})[_0x2f71('0x22')](function(_0x354fee){_0x29995c['rows']=_0x354fee;return _0x29995c;})['then'](respondWithFilteredResult(_0x591efb,_0x2ac9b2))[_0x2f71('0x2b')](handleError(_0x591efb,null));};exports[_0x2f71('0x57')]=function(_0x25a019,_0x31a205){var _0x31e694={'raw':![],'where':{'id':_0x25a019[_0x2f71('0x58')]['id']},'include':[{'model':db[_0x2f71('0x59')],'as':_0x2f71('0x3e')},{'model':db['MailServerOut'],'as':_0x2f71('0x40')},{'model':db[_0x2f71('0x41')],'as':_0x2f71('0x5a')}]},_0x3a911c={};_0x3a911c[_0x2f71('0x46')]=_[_0x2f71('0x48')](db[_0x2f71('0x43')]['rawAttributes']);_0x3a911c[_0x2f71('0x47')]=_[_0x2f71('0x48')](_0x25a019['query']);_0x3a911c['filters']=_[_0x2f71('0x4a')](_0x3a911c[_0x2f71('0x46')],_0x3a911c[_0x2f71('0x47')]);_0x31e694[_0x2f71('0x4c')]=_[_0x2f71('0x4a')](_0x3a911c[_0x2f71('0x46')],qs['fields'](_0x25a019[_0x2f71('0x47')][_0x2f71('0x4b')]));_0x31e694[_0x2f71('0x4c')]=_0x31e694[_0x2f71('0x4c')][_0x2f71('0x5b')]?_0x31e694[_0x2f71('0x4c')]:_0x3a911c[_0x2f71('0x46')];if(_0x25a019['query'][_0x2f71('0x5c')]){_0x31e694[_0x2f71('0x55')]=[{'all':!![]}];}_0x31e694=_['merge']({},_0x31e694,_0x25a019[_0x2f71('0x5d')]);return db[_0x2f71('0x43')]['find'](_0x31e694)[_0x2f71('0x22')](handleEntityNotFound(_0x31a205,null))['then'](respondWithResult(_0x31a205,null))['catch'](handleError(_0x31a205,null));};exports[_0x2f71('0x35')]=function(_0x76977d,_0x3149bf){if(_0x76977d[_0x2f71('0x5e')]['id']){delete _0x76977d[_0x2f71('0x5e')]['id'];}return db[_0x2f71('0x43')]['find']({'where':{'id':_0x76977d[_0x2f71('0x58')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x2f71('0x3e')},{'model':db[_0x2f71('0x3f')],'as':_0x2f71('0x40')},{'model':db[_0x2f71('0x41')],'as':_0x2f71('0x5a')}]})[_0x2f71('0x22')](handleEntityNotFound(_0x3149bf,null))[_0x2f71('0x22')](saveUpdates(_0x76977d[_0x2f71('0x5e')],null))[_0x2f71('0x22')](function(_0x2b88ec){if(_0x2b88ec&&_0x76977d[_0x2f71('0x5e')][_0x2f71('0x3e')]){return db[_0x2f71('0x59')][_0x2f71('0x35')](_0x76977d[_0x2f71('0x5e')][_0x2f71('0x3e')],{'where':{'MailAccountId':_0x2b88ec['id']}})[_0x2f71('0x22')](function(){return _0x2b88ec;});}return _0x2b88ec;})['then'](function(_0x31b08d){if(_0x31b08d&&_0x76977d[_0x2f71('0x5e')][_0x2f71('0x40')]){return db['MailServerOut'][_0x2f71('0x35')](_0x76977d[_0x2f71('0x5e')]['Smtp'],{'where':{'MailAccountId':_0x31b08d['id']}})['then'](function(){return _0x31b08d;});}return _0x31b08d;})[_0x2f71('0x22')](respondWithResult(_0x3149bf,null))[_0x2f71('0x2b')](handleError(_0x3149bf,null));};exports['describe']=function(_0x312c47,_0x5c66ff){return db[_0x2f71('0x43')][_0x2f71('0x5f')]()['then'](respondWithResult(_0x5c66ff,null))[_0x2f71('0x2b')](handleError(_0x5c66ff,null));};exports['addDisposition']=function(_0x115175,_0x20d818,_0x3cfa78){if(_0x115175[_0x2f71('0x5e')]['id']){delete _0x115175[_0x2f71('0x5e')]['id'];}return db['MailAccount'][_0x2f71('0x60')]({'where':{'id':_0x115175[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x20d818,null))[_0x2f71('0x22')](function(_0x1c7e95){if(_0x1c7e95){_0x115175['body'][_0x2f71('0x61')]=_0x1c7e95['id'];return db['Disposition'][_0x2f71('0x62')](_0x115175[_0x2f71('0x5e')]);}})[_0x2f71('0x22')](respondWithResult(_0x20d818,null))[_0x2f71('0x2b')](handleError(_0x20d818,null));};exports[_0x2f71('0x63')]=function(_0x293239,_0x49f8d8,_0x441e75){var _0x124149={'raw':![],'where':{}};var _0x105e8d={};var _0x174785={'count':0x0,'rows':[]};return db[_0x2f71('0x43')]['findOne']({'where':{'id':_0x293239[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x49f8d8,null))[_0x2f71('0x22')](function(_0x4a4a33){if(_0x4a4a33){_0x105e8d['model']=_[_0x2f71('0x48')](db[_0x2f71('0x64')]['rawAttributes']);_0x105e8d[_0x2f71('0x47')]=_[_0x2f71('0x48')](_0x293239[_0x2f71('0x47')]);_0x105e8d[_0x2f71('0x49')]=_[_0x2f71('0x4a')](_0x105e8d[_0x2f71('0x46')],_0x105e8d[_0x2f71('0x47')]);_0x124149[_0x2f71('0x4c')]=_['intersection'](_0x105e8d['model'],qs[_0x2f71('0x4b')](_0x293239[_0x2f71('0x47')][_0x2f71('0x4b')]));_0x124149[_0x2f71('0x4c')]=_0x124149[_0x2f71('0x4c')][_0x2f71('0x5b')]?_0x124149[_0x2f71('0x4c')]:_0x105e8d[_0x2f71('0x46')];if(!_0x293239['query'][_0x2f71('0x4d')](_0x2f71('0x4e'))){_0x124149['limit']=qs['limit'](_0x293239[_0x2f71('0x47')][_0x2f71('0x30')]);_0x124149[_0x2f71('0x2f')]=qs[_0x2f71('0x2f')](_0x293239[_0x2f71('0x47')][_0x2f71('0x2f')]);}_0x124149[_0x2f71('0x65')]=qs[_0x2f71('0x4f')](_0x293239[_0x2f71('0x47')][_0x2f71('0x4f')]);_0x124149[_0x2f71('0x50')]=qs[_0x2f71('0x49')](_[_0x2f71('0x51')](_0x293239[_0x2f71('0x47')],_0x105e8d[_0x2f71('0x49')]));_0x124149[_0x2f71('0x50')]['MailAccountId']=_0x4a4a33['id'];if(_0x293239['query']['filter']){_0x124149[_0x2f71('0x50')]=_[_0x2f71('0x54')](_0x124149[_0x2f71('0x50')],{'$or':_[_0x2f71('0x42')](_0x124149['attributes'],function(_0x166a67){var _0x5a3d14={};_0x5a3d14[_0x166a67]={'$like':'%'+_0x293239['query'][_0x2f71('0x52')]+'%'};return _0x5a3d14;})});}_0x124149=_[_0x2f71('0x54')]({},_0x124149,_0x293239[_0x2f71('0x5d')]);return db['Disposition'][_0x2f71('0x32')]({'where':_0x124149[_0x2f71('0x50')]})['then'](function(_0xcc980b){_0x174785['count']=_0xcc980b;if(_0x293239[_0x2f71('0x47')]['includeAll']){_0x124149[_0x2f71('0x55')]=[{'all':!![]}];}return db[_0x2f71('0x64')]['findAll'](_0x124149);})['then'](function(_0x42c589){_0x174785[_0x2f71('0x66')]=_0x42c589;return _0x174785;});}})[_0x2f71('0x22')](respondWithFilteredResult(_0x49f8d8,_0x124149))['catch'](handleError(_0x49f8d8,null));};exports['removeDispositions']=function(_0x184887,_0x2aa25a,_0x431fef){return db[_0x2f71('0x43')][_0x2f71('0x60')]({'where':{'id':_0x184887[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x2aa25a,null))[_0x2f71('0x22')](function(_0x21be79){if(_0x21be79){return _0x21be79[_0x2f71('0x67')](_0x184887[_0x2f71('0x47')][_0x2f71('0x68')]);}})['then'](respondWithStatusCode(_0x2aa25a,null))[_0x2f71('0x2b')](handleError(_0x2aa25a,null));};exports['addAnswer']=function(_0x562909,_0x2e96be,_0x467f02){if(_0x562909[_0x2f71('0x5e')]['id']){delete _0x562909[_0x2f71('0x5e')]['id'];}return db[_0x2f71('0x43')][_0x2f71('0x60')]({'where':{'id':_0x562909['params']['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x2e96be,null))['then'](function(_0xf4cd3c){if(_0xf4cd3c){_0x562909['body'][_0x2f71('0x61')]=_0xf4cd3c['id'];return db[_0x2f71('0x69')][_0x2f71('0x62')](_0x562909[_0x2f71('0x5e')]);}})[_0x2f71('0x22')](respondWithResult(_0x2e96be,null))['catch'](handleError(_0x2e96be,null));};exports[_0x2f71('0x6a')]=function(_0x2beaa8,_0x2ed08a,_0x4ee0d4){var _0x37174c={'raw':![],'where':{}};var _0x53698f={};var _0x249327={'count':0x0,'rows':[]};return db[_0x2f71('0x43')]['findOne']({'where':{'id':_0x2beaa8[_0x2f71('0x58')]['id']}})['then'](handleEntityNotFound(_0x2ed08a,null))[_0x2f71('0x22')](function(_0x35dc15){if(_0x35dc15){_0x53698f[_0x2f71('0x46')]=_[_0x2f71('0x48')](db[_0x2f71('0x69')][_0x2f71('0x44')]);_0x53698f[_0x2f71('0x47')]=_[_0x2f71('0x48')](_0x2beaa8['query']);_0x53698f[_0x2f71('0x49')]=_[_0x2f71('0x4a')](_0x53698f['model'],_0x53698f[_0x2f71('0x47')]);_0x37174c[_0x2f71('0x4c')]=_[_0x2f71('0x4a')](_0x53698f[_0x2f71('0x46')],qs['fields'](_0x2beaa8[_0x2f71('0x47')][_0x2f71('0x4b')]));_0x37174c['attributes']=_0x37174c['attributes']['length']?_0x37174c['attributes']:_0x53698f[_0x2f71('0x46')];if(!_0x2beaa8[_0x2f71('0x47')][_0x2f71('0x4d')]('nolimit')){_0x37174c['limit']=qs[_0x2f71('0x30')](_0x2beaa8['query']['limit']);_0x37174c['offset']=qs[_0x2f71('0x2f')](_0x2beaa8[_0x2f71('0x47')]['offset']);}_0x37174c[_0x2f71('0x65')]=qs[_0x2f71('0x4f')](_0x2beaa8[_0x2f71('0x47')][_0x2f71('0x4f')]);_0x37174c['where']=qs['filters'](_[_0x2f71('0x51')](_0x2beaa8[_0x2f71('0x47')],_0x53698f[_0x2f71('0x49')]));_0x37174c['where'][_0x2f71('0x61')]=_0x35dc15['id'];if(_0x2beaa8[_0x2f71('0x47')][_0x2f71('0x52')]){_0x37174c[_0x2f71('0x50')]=_[_0x2f71('0x54')](_0x37174c['where'],{'$or':_[_0x2f71('0x42')](_0x37174c['attributes'],function(_0x5052c7){var _0x57d5ab={};_0x57d5ab[_0x5052c7]={'$like':'%'+_0x2beaa8[_0x2f71('0x47')]['filter']+'%'};return _0x57d5ab;})});}_0x37174c=_[_0x2f71('0x54')]({},_0x37174c,_0x2beaa8[_0x2f71('0x5d')]);return db[_0x2f71('0x69')][_0x2f71('0x32')]({'where':_0x37174c[_0x2f71('0x50')]})[_0x2f71('0x22')](function(_0x50c522){_0x249327['count']=_0x50c522;if(_0x2beaa8[_0x2f71('0x47')][_0x2f71('0x5c')]){_0x37174c[_0x2f71('0x55')]=[{'all':!![]}];}return db[_0x2f71('0x69')][_0x2f71('0x56')](_0x37174c);})[_0x2f71('0x22')](function(_0x2b9349){_0x249327['rows']=_0x2b9349;return _0x249327;});}})[_0x2f71('0x22')](respondWithFilteredResult(_0x2ed08a,_0x37174c))[_0x2f71('0x2b')](handleError(_0x2ed08a,null));};exports[_0x2f71('0x6b')]=function(_0x2152a8,_0x43abf3,_0x5e4553){return db['MailAccount'][_0x2f71('0x60')]({'where':{'id':_0x2152a8[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x43abf3,null))[_0x2f71('0x22')](function(_0x40c2c6){if(_0x40c2c6){return _0x40c2c6[_0x2f71('0x6b')](_0x2152a8[_0x2f71('0x47')]['ids']);}})[_0x2f71('0x22')](respondWithStatusCode(_0x43abf3,null))[_0x2f71('0x2b')](handleError(_0x43abf3,null));};exports['create']=function(_0x287036,_0x1cded6){var _0x3fca61={'name':_0x287036['body'][_0x2f71('0x3b')],'key':_0x287036[_0x2f71('0x5e')][_0x2f71('0x6c')],'email':_0x287036['body'][_0x2f71('0x6d')],'ListId':_0x287036[_0x2f71('0x5e')][_0x2f71('0x6e')],'active':!_[_0x2f71('0x6f')](_0x287036[_0x2f71('0x5e')][_0x2f71('0x70')])?_0x287036['body'][_0x2f71('0x70')]:!![],'description':_0x287036[_0x2f71('0x5e')][_0x2f71('0x71')]||null,'Imap':{},'Smtp':{}};if(_[_0x2f71('0x6f')](_0x287036[_0x2f71('0x5e')][_0x2f71('0x72')])){if(_0x287036[_0x2f71('0x5e')][_0x2f71('0x73')]){_0x3fca61[_0x2f71('0x3e')][_0x2f71('0x74')]=_0x3fca61[_0x2f71('0x40')][_0x2f71('0x74')]=_0x287036['body']['cuser'];_0x3fca61['Imap']['password']=_0x3fca61[_0x2f71('0x40')][_0x2f71('0x75')]=_0x287036['body'][_0x2f71('0x76')];}else{_0x3fca61[_0x2f71('0x3e')][_0x2f71('0x77')]=_0x3fca61[_0x2f71('0x40')]['authentication']=![];}_0x3fca61[_0x2f71('0x3e')][_0x2f71('0x78')]=_0x287036[_0x2f71('0x5e')][_0x2f71('0x3e')][_0x2f71('0x78')];_0x3fca61[_0x2f71('0x3e')][_0x2f71('0x79')]=_0x287036[_0x2f71('0x5e')][_0x2f71('0x3e')][_0x2f71('0x79')];_0x3fca61[_0x2f71('0x40')][_0x2f71('0x78')]=_0x287036[_0x2f71('0x5e')]['Smtp']['host'];_0x3fca61[_0x2f71('0x40')][_0x2f71('0x79')]=_0x287036[_0x2f71('0x5e')][_0x2f71('0x40')]['port'];}else{_0x3fca61['Imap']['service']=_0x3fca61[_0x2f71('0x40')][_0x2f71('0x7a')]=_0x287036['body'][_0x2f71('0x72')];_0x3fca61[_0x2f71('0x3e')][_0x2f71('0x74')]=_0x3fca61[_0x2f71('0x40')][_0x2f71('0x74')]=_0x287036[_0x2f71('0x5e')][_0x2f71('0x7b')];_0x3fca61[_0x2f71('0x3e')][_0x2f71('0x7c')]=_0x3fca61[_0x2f71('0x40')][_0x2f71('0x75')]=_0x287036['body']['cpassword'];}return db[_0x2f71('0x43')]['create'](_0x3fca61,{'include':[{'model':db[_0x2f71('0x3f')],'as':_0x2f71('0x40')},{'model':db[_0x2f71('0x59')],'as':_0x2f71('0x3e')}]})[_0x2f71('0x22')](function(_0x5b8e69){var _0xfc935a=_0x287036['user'][_0x2f71('0x36')]({'plain':!![]});if(!_0xfc935a)throw new Error(_0x2f71('0x7d'));if(_0xfc935a[_0x2f71('0x7e')]===_0x2f71('0x74')){var _0x253e68=_0x5b8e69[_0x2f71('0x36')]({'plain':!![]});return db[_0x2f71('0x7f')][_0x2f71('0x60')]({'where':{'name':_0x2f71('0x37'),'userProfileId':_0xfc935a[_0x2f71('0x80')]},'raw':!![]})[_0x2f71('0x22')](function(_0x57ca34){if(_0x57ca34&&_0x57ca34[_0x2f71('0x81')]===0x0){return db[_0x2f71('0x38')]['create']({'name':_0x253e68[_0x2f71('0x3b')],'resourceId':_0x253e68['id'],'type':_0x57ca34[_0x2f71('0x3b')],'sectionId':_0x57ca34['id']},{})[_0x2f71('0x22')](function(){return _0x5b8e69;});}else{return _0x5b8e69;}})[_0x2f71('0x2b')](function(_0x54e511){logger['error'](_0x2f71('0x82'),_0x54e511);throw _0x54e511;});}return _0x5b8e69;})[_0x2f71('0x22')](respondWithResult(_0x1cded6,0xc9))[_0x2f71('0x2b')](handleError(_0x1cded6,null));};exports['getImap']=function(_0x72b509,_0x3aac4c,_0x4b65fe){return db[_0x2f71('0x43')][_0x2f71('0x83')]({'where':{'id':_0x72b509[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x3aac4c,null))[_0x2f71('0x22')](function(_0x15d17f){if(_0x15d17f){return _0x15d17f[_0x2f71('0x84')]();}return null;})[_0x2f71('0x22')](respondWithResult(_0x3aac4c,null))[_0x2f71('0x2b')](handleError(_0x3aac4c,null));};exports[_0x2f71('0x85')]=function(_0xd24950,_0x59b3d3,_0x63620){if(_0xd24950[_0x2f71('0x5e')]['id']){delete _0xd24950[_0x2f71('0x5e')]['id'];}return db[_0x2f71('0x43')][_0x2f71('0x60')]({'where':{'id':_0xd24950[_0x2f71('0x58')]['id']}})['then'](handleEntityNotFound(_0x59b3d3,null))[_0x2f71('0x22')](function(_0x54f0c4){if(_0x54f0c4){_0xd24950[_0x2f71('0x5e')][_0x2f71('0x61')]=_0x54f0c4['id'];return db['MailServerIn'][_0x2f71('0x62')](_0xd24950[_0x2f71('0x5e')]);}})[_0x2f71('0x22')](respondWithResult(_0x59b3d3,null))[_0x2f71('0x2b')](handleError(_0x59b3d3,null));};exports[_0x2f71('0x86')]=function(_0x314201,_0x34e252,_0x4e60e6){return db[_0x2f71('0x43')][_0x2f71('0x83')]({'where':{'id':_0x314201['params']['id']}})['then'](handleEntityNotFound(_0x34e252,null))[_0x2f71('0x22')](function(_0x21d1ea){if(_0x21d1ea){return _0x21d1ea[_0x2f71('0x87')](null);}return null;})[_0x2f71('0x22')](respondWithStatusCode(_0x34e252,null))[_0x2f71('0x2b')](handleError(_0x34e252,null));};exports[_0x2f71('0x88')]=function(_0x3b641f,_0x5af77f,_0x434186){return db[_0x2f71('0x43')][_0x2f71('0x83')]({'where':{'id':_0x3b641f['params']['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x5af77f,null))[_0x2f71('0x22')](function(_0x3bb809){if(_0x3bb809){return _0x3bb809[_0x2f71('0x88')]();}return null;})['then'](respondWithResult(_0x5af77f,null))[_0x2f71('0x2b')](handleError(_0x5af77f,null));};exports[_0x2f71('0x89')]=function(_0x4a42c9,_0x2d3c18,_0x5b782c){if(_0x4a42c9[_0x2f71('0x5e')]['id']){delete _0x4a42c9[_0x2f71('0x5e')]['id'];}return db[_0x2f71('0x43')][_0x2f71('0x60')]({'where':{'id':_0x4a42c9['params']['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x2d3c18,null))[_0x2f71('0x22')](function(_0x4212c1){if(_0x4212c1){_0x4a42c9[_0x2f71('0x5e')][_0x2f71('0x61')]=_0x4212c1['id'];return db[_0x2f71('0x3f')][_0x2f71('0x62')](_0x4a42c9[_0x2f71('0x5e')]);}})[_0x2f71('0x22')](respondWithResult(_0x2d3c18,null))[_0x2f71('0x2b')](handleError(_0x2d3c18,null));};exports['removeSmtp']=function(_0x523243,_0x1e3ffa,_0x54fc77){return db[_0x2f71('0x43')]['findOne']({'where':{'id':_0x523243[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x1e3ffa,null))[_0x2f71('0x22')](function(_0x296e51){if(_0x296e51){return _0x296e51['setSmtp'](null);}return null;})[_0x2f71('0x22')](respondWithStatusCode(_0x1e3ffa,null))[_0x2f71('0x2b')](handleError(_0x1e3ffa,null));};exports[_0x2f71('0x8a')]=function(_0x2515de,_0xda08fc,_0x558b99){return db[_0x2f71('0x8b')][_0x2f71('0x60')]({'where':{'id':_0x2515de[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0xda08fc,null))[_0x2f71('0x22')](function(_0x5a19f8){if(_0x5a19f8){return _0x5a19f8[_0x2f71('0x8a')](_0x2515de[_0x2f71('0x5e')]['ids'],_[_0x2f71('0x8c')](_0x2515de['body'],[_0x2f71('0x68'),'id'])||{});}})[_0x2f71('0x22')](respondWithResult(_0xda08fc,null))[_0x2f71('0x2b')](handleError(_0xda08fc,null));};exports[_0x2f71('0x8d')]=function(_0x226c4f,_0x4c6102,_0x4a2c10){var _0x3e581e={'raw':![],'where':{}};var _0x154ffc={};var _0xbceca={'count':0x0,'rows':[]};return db['MailAccount'][_0x2f71('0x83')]({'where':{'id':_0x226c4f[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x4c6102,null))[_0x2f71('0x22')](function(_0x2c3f62){if(_0x2c3f62){_0x154ffc[_0x2f71('0x46')]=_[_0x2f71('0x48')](db['MailInteraction']['rawAttributes']);_0x154ffc[_0x2f71('0x47')]=_['keys'](_0x226c4f['query']);_0x154ffc[_0x2f71('0x49')]=_[_0x2f71('0x4a')](_0x154ffc[_0x2f71('0x46')],_0x154ffc['query']);_0x3e581e[_0x2f71('0x4c')]=_['intersection'](_0x154ffc[_0x2f71('0x46')],qs[_0x2f71('0x4b')](_0x226c4f[_0x2f71('0x47')][_0x2f71('0x4b')]));_0x3e581e[_0x2f71('0x4c')]=_0x3e581e[_0x2f71('0x4c')][_0x2f71('0x5b')]?_0x3e581e[_0x2f71('0x4c')]:_0x154ffc[_0x2f71('0x46')];if(!_0x226c4f[_0x2f71('0x47')][_0x2f71('0x4d')](_0x2f71('0x4e'))){_0x3e581e[_0x2f71('0x30')]=qs[_0x2f71('0x30')](_0x226c4f[_0x2f71('0x47')][_0x2f71('0x30')]);_0x3e581e[_0x2f71('0x2f')]=qs['offset'](_0x226c4f[_0x2f71('0x47')]['offset']);}_0x3e581e['order']=qs[_0x2f71('0x4f')](_0x226c4f[_0x2f71('0x47')][_0x2f71('0x4f')]);_0x3e581e[_0x2f71('0x50')]=qs[_0x2f71('0x49')](_[_0x2f71('0x51')](_0x226c4f[_0x2f71('0x47')],_0x154ffc[_0x2f71('0x49')]));_0x3e581e['where']['MailAccountId']=_0x2c3f62['id'];if(_0x226c4f[_0x2f71('0x47')][_0x2f71('0x52')]){_0x3e581e[_0x2f71('0x50')]=_[_0x2f71('0x54')](_0x3e581e[_0x2f71('0x50')],{'$or':_[_0x2f71('0x42')](_0x3e581e['attributes'],function(_0x5817d4){var _0x95ca78={};_0x95ca78[_0x5817d4]={'$like':'%'+_0x226c4f[_0x2f71('0x47')]['filter']+'%'};return _0x95ca78;})});}_0x3e581e=_['merge']({},_0x3e581e,_0x226c4f[_0x2f71('0x5d')]);return db[_0x2f71('0x8b')][_0x2f71('0x32')]({'where':_0x3e581e[_0x2f71('0x50')]})[_0x2f71('0x22')](function(_0x480996){_0xbceca['count']=_0x480996;if(_0x226c4f[_0x2f71('0x47')][_0x2f71('0x5c')]){_0x3e581e[_0x2f71('0x55')]=[{'model':db[_0x2f71('0x8e')],'as':_0x2f71('0x8f'),'required':![]},{'model':db[_0x2f71('0x90')],'as':_0x2f71('0x91'),'attributes':[_0x2f71('0x3b'),_0x2f71('0x92'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x2f71('0x93'),'attributes':['id','name','color'],'where':_0x226c4f[_0x2f71('0x47')][_0x2f71('0x94')]?{'id':_0x226c4f[_0x2f71('0x47')][_0x2f71('0x94')]}:undefined,'required':_0x226c4f[_0x2f71('0x47')][_0x2f71('0x94')]?!![]:![]}];}return db[_0x2f71('0x8b')][_0x2f71('0x56')](_0x3e581e);})[_0x2f71('0x22')](function(_0x14de8c){_0xbceca[_0x2f71('0x66')]=_0x14de8c;return _0xbceca;});}})['then'](respondWithFilteredResult(_0x4c6102,_0x3e581e))[_0x2f71('0x2b')](handleError(_0x4c6102,null));};exports['addApplications']=function(_0x1171d3,_0x4db39b,_0x49b09d){return db[_0x2f71('0x43')][_0x2f71('0x83')]({'where':{'id':_0x1171d3[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x4db39b,null))[_0x2f71('0x22')](function(_0x1ead1e){if(_0x1ead1e){return db[_0x2f71('0x95')][_0x2f71('0x96')](function(_0x287962){return db[_0x2f71('0x97')][_0x2f71('0x98')]({'where':{'MailAccountId':_0x1171d3['params']['id']},'transaction':_0x287962})['then'](function(_0x532b17){var _0x28fedf=_[_0x2f71('0x42')](_0x1171d3[_0x2f71('0x5e')],function(_0xc52132){_0xc52132[_0x2f71('0x61')]=_0x1171d3[_0x2f71('0x58')]['id'];return _0xc52132;});return db[_0x2f71('0x97')][_0x2f71('0x99')](_0x28fedf,{'transaction':_0x287962});});})['then'](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x1171d3[_0x2f71('0x58')]['id']},'order':_0x2f71('0x9a')});});}})['then'](respondWithResult(_0x4db39b,null))[_0x2f71('0x2b')](handleError(_0x4db39b,null));};exports['getApplications']=function(_0x406cc8,_0x59cb69,_0x4d2490){var _0x58e05f={};var _0x26fd50={};var _0x4d2871;var _0x10ce85;return db['MailAccount'][_0x2f71('0x83')]({'where':{'id':_0x406cc8[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x59cb69,null))['then'](function(_0x3fe9b4){if(_0x3fe9b4){_0x4d2871=_0x3fe9b4;_0x26fd50[_0x2f71('0x46')]=_[_0x2f71('0x48')](db['MailApplication'][_0x2f71('0x44')]);_0x26fd50[_0x2f71('0x47')]=_['keys'](_0x406cc8[_0x2f71('0x47')]);_0x26fd50[_0x2f71('0x49')]=_[_0x2f71('0x4a')](_0x26fd50[_0x2f71('0x46')],_0x26fd50[_0x2f71('0x47')]);_0x58e05f['attributes']=_[_0x2f71('0x4a')](_0x26fd50['model'],qs['fields'](_0x406cc8[_0x2f71('0x47')][_0x2f71('0x4b')]));_0x58e05f[_0x2f71('0x4c')]=_0x58e05f[_0x2f71('0x4c')]['length']?_0x58e05f['attributes']:_0x26fd50[_0x2f71('0x46')];_0x58e05f[_0x2f71('0x65')]=qs[_0x2f71('0x4f')](_0x406cc8[_0x2f71('0x47')][_0x2f71('0x4f')]);_0x58e05f[_0x2f71('0x50')]=qs[_0x2f71('0x49')](_[_0x2f71('0x51')](_0x406cc8[_0x2f71('0x47')],_0x26fd50['filters']));if(_0x406cc8[_0x2f71('0x47')][_0x2f71('0x52')]){_0x58e05f['where']=_[_0x2f71('0x54')](_0x58e05f['where'],{'$or':_[_0x2f71('0x42')](_0x58e05f[_0x2f71('0x4c')],function(_0x3d866b){var _0x3c1fe6={};_0x3c1fe6[_0x3d866b]={'$like':'%'+_0x406cc8[_0x2f71('0x47')][_0x2f71('0x52')]+'%'};return _0x3c1fe6;})});}_0x58e05f=_[_0x2f71('0x54')]({},_0x58e05f,_0x406cc8['options']);return _0x4d2871[_0x2f71('0x9b')](_0x58e05f);}})[_0x2f71('0x22')](function(_0x11bdac){if(_0x11bdac){_0x10ce85=_0x11bdac['length'];if(!_0x406cc8[_0x2f71('0x47')][_0x2f71('0x4d')](_0x2f71('0x4e'))){_0x58e05f[_0x2f71('0x30')]=qs['limit'](_0x406cc8[_0x2f71('0x47')][_0x2f71('0x30')]);_0x58e05f[_0x2f71('0x2f')]=qs[_0x2f71('0x2f')](_0x406cc8['query']['offset']);}return _0x4d2871[_0x2f71('0x9b')](_0x58e05f);}})[_0x2f71('0x22')](function(_0x89dff7){if(_0x89dff7){return _0x89dff7?{'count':_0x10ce85,'rows':_0x89dff7}:null;}})[_0x2f71('0x22')](respondWithResult(_0x59cb69,null))[_0x2f71('0x2b')](handleError(_0x59cb69,null));};exports[_0x2f71('0x9c')]=function(_0x524d0f,_0x17bd25,_0x43d986){var _0x3f1603={'raw':!![],'where':{}};var _0x4d59f0={};var _0x4541fa={'count':0x0,'rows':[]};return db['MailAccount'][_0x2f71('0x83')]({'where':{'id':_0x524d0f[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x17bd25,null))[_0x2f71('0x22')](function(_0xcd9d5a){if(_0xcd9d5a){_0x4d59f0[_0x2f71('0x46')]=_['keys'](db[_0x2f71('0x9d')]['rawAttributes']);_0x4d59f0[_0x2f71('0x47')]=_[_0x2f71('0x48')](_0x524d0f['query']);_0x4d59f0['filters']=_[_0x2f71('0x4a')](_0x4d59f0[_0x2f71('0x46')],_0x4d59f0[_0x2f71('0x47')]);_0x3f1603[_0x2f71('0x4c')]=_['intersection'](_0x4d59f0['model'],qs['fields'](_0x524d0f[_0x2f71('0x47')][_0x2f71('0x4b')]));_0x3f1603[_0x2f71('0x4c')]=_0x3f1603[_0x2f71('0x4c')][_0x2f71('0x5b')]?_0x3f1603[_0x2f71('0x4c')]:_0x4d59f0['model'];if(!_0x524d0f['query'][_0x2f71('0x4d')](_0x2f71('0x4e'))){_0x3f1603[_0x2f71('0x30')]=qs['limit'](_0x524d0f[_0x2f71('0x47')][_0x2f71('0x30')]);_0x3f1603[_0x2f71('0x2f')]=qs[_0x2f71('0x2f')](_0x524d0f['query'][_0x2f71('0x2f')]);}_0x3f1603[_0x2f71('0x65')]=qs[_0x2f71('0x4f')](_0x524d0f[_0x2f71('0x47')]['sort']);_0x3f1603[_0x2f71('0x50')]=qs['filters'](_[_0x2f71('0x51')](_0x524d0f[_0x2f71('0x47')],_0x4d59f0['filters']));_0x3f1603[_0x2f71('0x50')][_0x2f71('0x61')]=_0xcd9d5a['id'];if(_0x524d0f['query'][_0x2f71('0x52')]){_0x3f1603[_0x2f71('0x50')]=_[_0x2f71('0x54')](_0x3f1603[_0x2f71('0x50')],{'$or':_[_0x2f71('0x42')](_0x3f1603['attributes'],function(_0xb6184d){var _0x31b7e3={};_0x31b7e3[_0xb6184d]={'$like':'%'+_0x524d0f[_0x2f71('0x47')][_0x2f71('0x52')]+'%'};return _0x31b7e3;})});}if(_0x524d0f[_0x2f71('0x47')][_0x2f71('0x9e')]){var _0x355514=_0x524d0f[_0x2f71('0x47')]['$gte'][_0x2f71('0x9f')](',');var _0x22ab46={};_0x22ab46[_0x355514[0x0]]={'$gte':moment(_0x355514[0x1])[_0x2f71('0xa0')](_0x2f71('0xa1'))};_0x3f1603[_0x2f71('0x50')]=_['merge'](_0x3f1603[_0x2f71('0x50')],_0x22ab46);}_0x3f1603=_['merge']({},_0x3f1603,_0x524d0f[_0x2f71('0x5d')]);return db['MailMessage'][_0x2f71('0x32')]({'where':_0x3f1603[_0x2f71('0x50')]})['then'](function(_0x1b513f){_0x4541fa[_0x2f71('0x32')]=_0x1b513f;if(_0x524d0f[_0x2f71('0x47')][_0x2f71('0x5c')]){_0x3f1603[_0x2f71('0x55')]=[{'all':!![]}];}return db['MailMessage'][_0x2f71('0x56')](_0x3f1603);})[_0x2f71('0x22')](function(_0x2d96f4){if(_0x524d0f['query'][_0x2f71('0xa2')]===_0x2f71('0xa3')){for(var _0x17df95=0x0;_0x17df95<_0x2d96f4[_0x2f71('0x5b')];_0x17df95++){_0x2d96f4[_0x17df95][_0x2f71('0x5e')]=juice(_0x2d96f4[_0x17df95][_0x2f71('0x5e')]);}}_0x4541fa[_0x2f71('0x66')]=_0x2d96f4;return _0x4541fa;});}})[_0x2f71('0x22')](respondWithFilteredResult(_0x17bd25,_0x3f1603))['catch'](handleError(_0x17bd25,null));};exports[_0x2f71('0x3c')]=function(_0x92146a,_0x1780af,_0x4ba60b){var _0x5196d2,_0x42559a={},_0x13d7a7;if(_0x92146a[_0x2f71('0x5e')]['to']){_0x13d7a7=_0x92146a[_0x2f71('0x5e')]['to'][_0x2f71('0x9f')](',')[0x0];}return db[_0x2f71('0x43')][_0x2f71('0x60')]({'where':{'id':_0x92146a[_0x2f71('0x58')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x2f71('0x8e')],'as':_0x2f71('0xa4'),'where':{'email':_0x13d7a7},'limit':0x1,'order':[[_0x2f71('0xa5'),_0x2f71('0xa6')]]}]},{'model':db[_0x2f71('0x3f')],'as':_0x2f71('0x40'),'raw':!![]}]})[_0x2f71('0x22')](handleEntityNotFound(_0x1780af,null))['then'](function(_0x52b181){if(_0x52b181){_0x5196d2=_0x52b181;if(_0x52b181[_0x2f71('0x40')]){if(_[_0x2f71('0x6f')](_0x92146a[_0x2f71('0x5e')]['from'])){_0x92146a['body'][_0x2f71('0xa7')]=util[_0x2f71('0xa0')]('%s\x20<%s>',_0x52b181['name'],_0x52b181['email']||_0x52b181[_0x2f71('0x40')]['user']);}if(_0x92146a[_0x2f71('0x5e')][_0x2f71('0xa8')]&&_0x92146a['body'][_0x2f71('0xa8')][_0x2f71('0x5b')]){for(var _0x25fd00=0x0;_0x25fd00<_0x92146a[_0x2f71('0x5e')][_0x2f71('0xa8')][_0x2f71('0x5b')];_0x25fd00+=0x1){_0x92146a[_0x2f71('0x5e')][_0x2f71('0xa8')][_0x25fd00]={'filename':_0x92146a[_0x2f71('0x5e')][_0x2f71('0xa8')][_0x25fd00][_0x2f71('0x3b')],'path':path[_0x2f71('0xa9')](config[_0x2f71('0xaa')],_0x2f71('0xab'),_0x92146a[_0x2f71('0x5e')][_0x2f71('0xa8')][_0x25fd00]['basename'])};}}var _0x3bc88a={'tls':{'rejectUnauthorized':![]}};if(_[_0x2f71('0x6f')](_0x52b181['Smtp'][_0x2f71('0x7a')])){if(_0x52b181[_0x2f71('0x40')][_0x2f71('0x77')]){_0x3bc88a[_0x2f71('0xac')]={'user':_0x52b181[_0x2f71('0x40')][_0x2f71('0x74')],'pass':_0x52b181[_0x2f71('0x40')][_0x2f71('0x75')]};}_0x3bc88a[_0x2f71('0x78')]=_0x52b181['Smtp'][_0x2f71('0x78')];_0x3bc88a[_0x2f71('0x79')]=_0x52b181[_0x2f71('0x40')][_0x2f71('0x79')];_0x3bc88a[_0x2f71('0xad')]=_0x52b181[_0x2f71('0x40')][_0x2f71('0xad')];}else{_0x3bc88a[_0x2f71('0x7a')]=_0x52b181['Smtp']['service'];_0x3bc88a[_0x2f71('0xac')]={'user':_0x52b181[_0x2f71('0x40')]['user'],'pass':_0x52b181['Smtp'][_0x2f71('0x75')]};}return respondWithRpcPromise(_0x2f71('0xae'),_0x2f71('0xaf'),{'account':_0x3bc88a,'message':_0x92146a[_0x2f71('0x5e')]});}else{throw new Error('List\x20not\x20found');}}})[_0x2f71('0x22')](function(_0x14fea3){if(_0x14fea3){_0x42559a=_0x14fea3;if(_0x5196d2[_0x2f71('0xb0')]){if(_0x5196d2[_0x2f71('0xb0')][_0x2f71('0xa4')][_0x2f71('0x5b')]){return _0x5196d2[_0x2f71('0xb0')][_0x2f71('0xa4')][0x0];}else{return db['CmContact'][_0x2f71('0x62')](_[_0x2f71('0x1a')](_0x92146a[_0x2f71('0x5e')],{'firstName':_0x92146a[_0x2f71('0x5e')]['to'],'email':_0x92146a[_0x2f71('0x5e')]['to'],'phone':_0x92146a['body']['to'],'ListId':_0x5196d2[_0x2f71('0x6e')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0x2f71('0x22')](function(_0x3253f7){if(_0x3253f7){var _0x581c62={'UserId':_0x92146a['user']['id'],'ContactId':_0x3253f7['id'],'MailAccountId':_0x5196d2['id'],'inReplyTo':_0x42559a[_0x2f71('0xb1')],'to':_0x92146a[_0x2f71('0x5e')][_0x2f71('0xa7')],'cc':_0x92146a[_0x2f71('0x5e')]['cc'],'subject':_0x92146a[_0x2f71('0x5e')][_0x2f71('0xb2')],'attach':_0x92146a[_0x2f71('0x5e')][_0x2f71('0xb3')],'firstMsgDirection':_0x2f71('0xb4'),'lastMsgAt':moment()[_0x2f71('0xa0')](_0x2f71('0xa1')),'lastMsgDirection':_0x2f71('0xb4'),'Messages':[_[_0x2f71('0x54')](_0x92146a[_0x2f71('0x5e')],{'messageId':_0x42559a[_0x2f71('0xb1')],'sentAt':moment()[_0x2f71('0xa0')](_0x2f71('0xa1')),'read':!![],'MailAccountId':_0x5196d2['id'],'UserId':_0x92146a[_0x2f71('0x74')]['id'],'ContactId':_0x3253f7['id']})]};if(_0x92146a[_0x2f71('0x5e')][_0x2f71('0xb5')]){_0x581c62=_['merge'](_0x581c62,_0x92146a[_0x2f71('0x5e')][_0x2f71('0xb5')]);}return db[_0x2f71('0x8b')][_0x2f71('0x62')](_0x581c62,{'include':[{'model':db[_0x2f71('0x9d')],'as':_0x2f71('0xb6')}]});}})[_0x2f71('0x22')](respondWithResult(_0x1780af,null))[_0x2f71('0x2b')](handleError(_0x1780af,null));};exports[_0x2f71('0xb7')]=function(_0x419a5a,_0x235c8d,_0x285954){return db['MailAccount'][_0x2f71('0x60')]({'where':{'id':_0x419a5a[_0x2f71('0x58')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x2f71('0x40'),'raw':!![]}]})[_0x2f71('0x22')](handleEntityNotFound(_0x235c8d,null))[_0x2f71('0x22')](function(_0x10fde8){if(_0x10fde8&&_0x10fde8[_0x2f71('0x40')]){var _0xb2640b={'id':_0x10fde8['id'],'tls':{'rejectUnauthorized':![]}};if(_0x10fde8[_0x2f71('0x40')]['service']){_0xb2640b['service']=_0x10fde8[_0x2f71('0x40')][_0x2f71('0x7a')];}else{_0xb2640b[_0x2f71('0x78')]=_0x10fde8[_0x2f71('0x40')][_0x2f71('0x78')];_0xb2640b[_0x2f71('0x79')]=_0x10fde8[_0x2f71('0x40')][_0x2f71('0x79')];_0xb2640b['secure']=_0x10fde8['Smtp'][_0x2f71('0xad')];}if(_0x10fde8[_0x2f71('0x40')][_0x2f71('0x77')]){_0xb2640b[_0x2f71('0xac')]={'user':_0x10fde8['Smtp'][_0x2f71('0x74')],'pass':_0x10fde8[_0x2f71('0x40')][_0x2f71('0x75')]};}return respondWithRpcPromise(_0x2f71('0xb8'),'verifySmtp',{'account':_0xb2640b});}})[_0x2f71('0x22')](respondWithResult(_0x235c8d,null))['catch'](handleError(_0x235c8d,null));};exports[_0x2f71('0x98')]=function(_0x5909c4,_0x36ec19){return db[_0x2f71('0x43')][_0x2f71('0x60')]({'where':{'id':_0x5909c4['params']['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x36ec19,null))[_0x2f71('0x22')](function(_0x4f9cb4){if(_0x4f9cb4&&_0x4f9cb4[_0x2f71('0x7a')]){throw new db[(_0x2f71('0xb9'))][(_0x2f71('0xba'))](_0x2f71('0xbb'));}return _0x4f9cb4;})['then'](removeEntity(_0x36ec19,null))[_0x2f71('0x2b')](handleError(_0x36ec19,null));};exports[_0x2f71('0xbc')]=function(_0x326345,_0x1f9641,_0x206c64){return db[_0x2f71('0x43')][_0x2f71('0x60')]({'where':{'id':_0x326345[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x1f9641,null))['then'](function(_0x67b76d){if(_0x67b76d){return _0x67b76d[_0x2f71('0xbc')](_0x326345[_0x2f71('0x5e')][_0x2f71('0x68')],_[_0x2f71('0x8c')](_0x326345[_0x2f71('0x5e')],['ids','id'])||{})[_0x2f71('0xbd')](function(_0x1178da){for(var _0x1cea52=0x0;_0x1cea52<_0x326345[_0x2f71('0x5e')][_0x2f71('0x68')]['length'];_0x1cea52+=0x1){socket['emit'](_0x2f71('0xbe'),{'UserId':_0x326345[_0x2f71('0x5e')][_0x2f71('0x68')][_0x1cea52],'MailAccountId':_0x326345['params']['id']});}return _0x1178da;});}})[_0x2f71('0x22')](respondWithResult(_0x1f9641,null))[_0x2f71('0x2b')](handleError(_0x1f9641,null));};exports[_0x2f71('0xbf')]=function(_0x314552,_0x3782b5,_0x19c7f5){return db[_0x2f71('0x43')][_0x2f71('0x60')]({'where':{'id':_0x314552[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x3782b5,null))[_0x2f71('0x22')](function(_0x2e9d49){if(_0x2e9d49){return _0x2e9d49[_0x2f71('0xbf')](_0x314552[_0x2f71('0x47')][_0x2f71('0x68')])[_0x2f71('0x22')](function(){if(_['isArray'](_0x314552[_0x2f71('0x47')][_0x2f71('0x68')])){for(var _0x9dd9f1=0x0;_0x9dd9f1<_0x314552[_0x2f71('0x47')]['ids'][_0x2f71('0x5b')];_0x9dd9f1+=0x1){socket[_0x2f71('0xc0')](_0x2f71('0xc1'),{'UserId':Number(_0x314552[_0x2f71('0x47')][_0x2f71('0x68')][_0x9dd9f1]),'MailAccountId':Number(_0x314552[_0x2f71('0x58')]['id'])});}}else{socket['emit'](_0x2f71('0xc1'),{'UserId':Number(_0x314552[_0x2f71('0x47')][_0x2f71('0x68')]),'MailAccountId':Number(_0x314552['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3782b5,null))[_0x2f71('0x2b')](handleError(_0x3782b5,null));};exports['getAgents']=function(_0x2c9238,_0x4159b9,_0x494805){var _0x30adef={};var _0x13bedb={};var _0xf5fda4;var _0x19470f;return db[_0x2f71('0x43')][_0x2f71('0x83')]({'where':{'id':_0x2c9238[_0x2f71('0x58')]['id']}})[_0x2f71('0x22')](handleEntityNotFound(_0x4159b9,null))[_0x2f71('0x22')](function(_0x476a93){if(_0x476a93){_0xf5fda4=_0x476a93;_0x13bedb['model']=_[_0x2f71('0x48')](db[_0x2f71('0x90')][_0x2f71('0x44')]);_0x13bedb[_0x2f71('0x47')]=_['keys'](_0x2c9238['query']);_0x13bedb[_0x2f71('0x49')]=_[_0x2f71('0x4a')](_0x13bedb['model'],_0x13bedb[_0x2f71('0x47')]);_0x30adef['attributes']=_[_0x2f71('0x4a')](_0x13bedb[_0x2f71('0x46')],qs[_0x2f71('0x4b')](_0x2c9238['query']['fields']));_0x30adef[_0x2f71('0x4c')]=_0x30adef[_0x2f71('0x4c')]['length']?_0x30adef[_0x2f71('0x4c')]:_0x13bedb['model'];_0x30adef[_0x2f71('0x65')]=qs['sort'](_0x2c9238['query'][_0x2f71('0x4f')]);_0x30adef['where']=qs['filters'](_[_0x2f71('0x51')](_0x2c9238[_0x2f71('0x47')],_0x13bedb[_0x2f71('0x49')]));if(_0x2c9238[_0x2f71('0x47')][_0x2f71('0x52')]){_0x30adef[_0x2f71('0x50')]=_['merge'](_0x30adef['where'],{'$or':_[_0x2f71('0x42')](_0x30adef['attributes'],function(_0x181ca1){var _0x902b3e={};_0x902b3e[_0x181ca1]={'$like':'%'+_0x2c9238[_0x2f71('0x47')][_0x2f71('0x52')]+'%'};return _0x902b3e;})});}_0x30adef=_[_0x2f71('0x54')]({},_0x30adef,_0x2c9238[_0x2f71('0x5d')]);return _0xf5fda4['getAgents'](_0x30adef);}})[_0x2f71('0x22')](function(_0x347ca7){if(_0x347ca7){_0x19470f=_0x347ca7[_0x2f71('0x5b')];if(!_0x2c9238[_0x2f71('0x47')][_0x2f71('0x4d')]('nolimit')){_0x30adef[_0x2f71('0x30')]=qs[_0x2f71('0x30')](_0x2c9238[_0x2f71('0x47')]['limit']);_0x30adef['offset']=qs[_0x2f71('0x2f')](_0x2c9238['query']['offset']);}return _0xf5fda4[_0x2f71('0xc2')](_0x30adef);}})[_0x2f71('0x22')](function(_0x42e1d8){if(_0x42e1d8){return _0x42e1d8?{'count':_0x19470f,'rows':_0x42e1d8}:null;}})[_0x2f71('0x22')](respondWithResult(_0x4159b9,null))[_0x2f71('0x2b')](handleError(_0x4159b9,null));}; \ No newline at end of file +var _0x36fb=['userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./mailAccount.socket','jayson/promise','client','http','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','json','save','update','destroy','MailAccounts','UserProfileResource','name','send','index','MailServerIn','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','include','findAll','rows','show','params','Imap','find','body','describe','addDisposition','MailAccountId','Disposition','create','findOne','nolimit','includeAll','removeDispositions','CannedAnswer','getAnswers','ids','email','ListId','active','description','isNil','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','User','fullname','Tag','Tags','color','tag','transaction','MailApplication','findAndCountAll','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','auth','secure','SendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','VerifySmtp','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit'];(function(_0x19ff50,_0x4ec334){var _0x33b996=function(_0x203a79){while(--_0x203a79){_0x19ff50['push'](_0x19ff50['shift']());}};_0x33b996(++_0x4ec334);}(_0x36fb,0xc8));var _0xb36f=function(_0x1fc987,_0x4f5657){_0x1fc987=_0x1fc987-0x0;var _0x56a13d=_0x36fb[_0x1fc987];return _0x56a13d;};'use strict';var emlformat=require(_0xb36f('0x0'));var rimraf=require(_0xb36f('0x1'));var zipdir=require(_0xb36f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb36f('0x3'));var moment=require(_0xb36f('0x4'));var BPromise=require(_0xb36f('0x5'));var Mustache=require(_0xb36f('0x6'));var util=require('util');var path=require(_0xb36f('0x7'));var sox=require(_0xb36f('0x8'));var csv=require(_0xb36f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb36f('0xa'));var _=require(_0xb36f('0xb'));var squel=require(_0xb36f('0xc'));var crypto=require(_0xb36f('0xd'));var jsforce=require(_0xb36f('0xe'));var deskjs=require(_0xb36f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb36f('0x10'));var Papa=require(_0xb36f('0x11'));var htmlToText=require(_0xb36f('0x12'));var juice=require(_0xb36f('0x13'));var Redis=require(_0xb36f('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xb36f('0x15'));var as=require(_0xb36f('0x16'));var hardwareService=require(_0xb36f('0x17'));var logger=require(_0xb36f('0x18'))('api');var utils=require(_0xb36f('0x19'));var config=require(_0xb36f('0x1a'));var licenseUtil=require(_0xb36f('0x1b'));var db=require(_0xb36f('0x1c'))['db'];config[_0xb36f('0x1d')]=_[_0xb36f('0x1e')](config[_0xb36f('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb36f('0x1f'))['register'](socket);var jayson=require(_0xb36f('0x20'));var client=jayson[_0xb36f('0x21')][_0xb36f('0x22')]({'port':0x232b});function respondWithRpcPromise(_0x5860cd,_0x4cbbd2,_0x4083b5,_0x5c1f3c){return new BPromise(function(_0x2c18c4,_0x44fd5e){var _0x1fe7a3=_0x5c1f3c||client;return _0x1fe7a3['request'](_0x5860cd,_0x4083b5)[_0xb36f('0x23')](function(_0x14c751){logger[_0xb36f('0x24')]('MailAccount,\x20%s,\x20%s',_0x4cbbd2,_0xb36f('0x25'));logger['debug'](_0xb36f('0x26'),_0x4cbbd2,_0xb36f('0x25'),JSON[_0xb36f('0x27')](_0x14c751));if(_0x14c751[_0xb36f('0x28')]){if(_0x14c751[_0xb36f('0x28')][_0xb36f('0x29')]===0x1f4){logger[_0xb36f('0x28')](_0xb36f('0x2a'),_0x4cbbd2,_0x14c751['error'][_0xb36f('0x2b')]);return _0x44fd5e(_0x14c751[_0xb36f('0x28')][_0xb36f('0x2b')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x4cbbd2,_0x14c751[_0xb36f('0x28')][_0xb36f('0x2b')]);return _0x2c18c4(_0x14c751[_0xb36f('0x28')]['message']);}else{logger[_0xb36f('0x24')]('MailAccount,\x20%s,\x20%s',_0x4cbbd2,_0xb36f('0x25'));_0x2c18c4(_0x14c751[_0xb36f('0x2c')][_0xb36f('0x2b')]);}})[_0xb36f('0x2d')](function(_0x52b3b7){logger['error']('MailAccount,\x20%s,\x20%s',_0x4cbbd2,_0x52b3b7);_0x44fd5e(_0x52b3b7);});});}function respondWithStatusCode(_0x72d902,_0x4249b8){_0x4249b8=_0x4249b8||0xcc;return function(_0x472db7){if(_0x472db7){return _0x72d902[_0xb36f('0x2e')](_0x4249b8);}return _0x72d902[_0xb36f('0x2f')](_0x4249b8)[_0xb36f('0x30')]();};}function respondWithResult(_0x13e7e7,_0x358d8b){_0x358d8b=_0x358d8b||0xc8;return function(_0x3693e1){if(_0x3693e1){return _0x13e7e7[_0xb36f('0x2f')](_0x358d8b)['json'](_0x3693e1);}};}function respondWithFilteredResult(_0x424dc1,_0xaa2650){return function(_0x2668b7){if(_0x2668b7){var _0x45c3dd=typeof _0xaa2650[_0xb36f('0x31')]==='undefined'&&typeof _0xaa2650[_0xb36f('0x32')]===_0xb36f('0x33');var _0x226c23=_0x2668b7[_0xb36f('0x34')];var _0x583887=_0x45c3dd?0x0:_0xaa2650[_0xb36f('0x31')];var _0x1e5a99=_0x45c3dd?_0x2668b7[_0xb36f('0x34')]:_0xaa2650[_0xb36f('0x31')]+_0xaa2650[_0xb36f('0x32')];var _0x263bd7;if(_0x1e5a99>=_0x226c23){_0x1e5a99=_0x226c23;_0x263bd7=0xc8;}else{_0x263bd7=0xce;}_0x424dc1[_0xb36f('0x2f')](_0x263bd7);return _0x424dc1[_0xb36f('0x35')]('Content-Range',_0x583887+'-'+_0x1e5a99+'/'+_0x226c23)[_0xb36f('0x36')](_0x2668b7);}return null;};}function patchUpdates(_0x42ada3){return function(_0x42bb19){try{jsonpatch['apply'](_0x42bb19,_0x42ada3,!![]);}catch(_0x30e2a6){return BPromise['reject'](_0x30e2a6);}return _0x42bb19[_0xb36f('0x37')]();};}function saveUpdates(_0x452ae7,_0x486c09){return function(_0x513f74){if(_0x513f74){return _0x513f74[_0xb36f('0x38')](_0x452ae7)['then'](function(_0x42cdbf){return _0x42cdbf;});}return null;};}function removeEntity(_0x80c966,_0x3e2082){return function(_0x18267e){if(_0x18267e){return _0x18267e[_0xb36f('0x39')]()[_0xb36f('0x23')](function(){var _0x2d5f32=_0x18267e['get']({'plain':!![]});var _0x4f48bd=_0xb36f('0x3a');return db[_0xb36f('0x3b')][_0xb36f('0x39')]({'where':{'type':_0x4f48bd,'resourceId':_0x2d5f32['id']}})['then'](function(){return _0x18267e;});})[_0xb36f('0x23')](function(){_0x80c966[_0xb36f('0x2f')](0xcc)[_0xb36f('0x30')]();});}};}function handleEntityNotFound(_0x10674f,_0x1be313){return function(_0x1b71f3){if(!_0x1b71f3){_0x10674f['sendStatus'](0x194);}return _0x1b71f3;};}function handleError(_0x47b857,_0x2c6f9a){_0x2c6f9a=_0x2c6f9a||0x1f4;return function(_0x419f06){logger[_0xb36f('0x28')](_0x419f06['stack']);if(_0x419f06[_0xb36f('0x3c')]){delete _0x419f06[_0xb36f('0x3c')];}_0x47b857['status'](_0x2c6f9a)[_0xb36f('0x3d')](_0x419f06);};}exports[_0xb36f('0x3e')]=function(_0x313435,_0x15c9c7){var _0x70d1bf={'include':[{'model':db[_0xb36f('0x3f')],'as':'Imap'},{'model':db[_0xb36f('0x40')],'as':_0xb36f('0x41')},{'model':db[_0xb36f('0x42')],'as':_0xb36f('0x43')}]},_0x29d178={},_0x978abb={'count':0x0,'rows':[]};var _0x298b7a=_[_0xb36f('0x44')](db[_0xb36f('0x45')][_0xb36f('0x46')],function(_0x196849){return{'name':_0x196849[_0xb36f('0x47')],'type':_0x196849[_0xb36f('0x48')][_0xb36f('0x49')]};});_0x29d178[_0xb36f('0x4a')]=_['map'](_0x298b7a,_0xb36f('0x3c'));_0x29d178['query']=_[_0xb36f('0x4b')](_0x313435[_0xb36f('0x4c')]);_0x29d178['filters']=_[_0xb36f('0x4d')](_0x29d178[_0xb36f('0x4a')],_0x29d178[_0xb36f('0x4c')]);_0x70d1bf[_0xb36f('0x4e')]=_[_0xb36f('0x4d')](_0x29d178[_0xb36f('0x4a')],qs[_0xb36f('0x4f')](_0x313435[_0xb36f('0x4c')][_0xb36f('0x4f')]));_0x70d1bf['attributes']=_0x70d1bf[_0xb36f('0x4e')][_0xb36f('0x50')]?_0x70d1bf[_0xb36f('0x4e')]:_0x29d178[_0xb36f('0x4a')];if(!_0x313435[_0xb36f('0x4c')][_0xb36f('0x51')]('nolimit')){_0x70d1bf[_0xb36f('0x32')]=qs['limit'](_0x313435[_0xb36f('0x4c')][_0xb36f('0x32')]);_0x70d1bf[_0xb36f('0x31')]=qs[_0xb36f('0x31')](_0x313435[_0xb36f('0x4c')]['offset']);}_0x70d1bf[_0xb36f('0x52')]=qs['sort'](_0x313435[_0xb36f('0x4c')][_0xb36f('0x53')]);_0x70d1bf[_0xb36f('0x54')]=qs[_0xb36f('0x55')](_[_0xb36f('0x56')](_0x313435[_0xb36f('0x4c')],_0x29d178[_0xb36f('0x55')]),_0x298b7a);if(_0x313435[_0xb36f('0x4c')]['filter']){_0x70d1bf['where']=_['merge'](_0x70d1bf[_0xb36f('0x54')],{'$or':_[_0xb36f('0x44')](_0x298b7a,function(_0x1b3573){if(_0x1b3573[_0xb36f('0x48')]!==_0xb36f('0x57')){var _0x273b4c={};_0x273b4c[_0x1b3573[_0xb36f('0x3c')]]={'$like':'%'+_0x313435[_0xb36f('0x4c')][_0xb36f('0x58')]+'%'};return _0x273b4c;}})});}_0x70d1bf=_[_0xb36f('0x59')]({},_0x70d1bf,_0x313435[_0xb36f('0x5a')]);var _0x4b6c25={'where':_0x70d1bf[_0xb36f('0x54')]};return db['MailAccount'][_0xb36f('0x34')](_0x4b6c25)[_0xb36f('0x23')](function(_0x611967){_0x978abb['count']=_0x611967;if(_0x313435[_0xb36f('0x4c')]['includeAll']){_0x70d1bf[_0xb36f('0x5b')]=[{'all':!![]}];}return db[_0xb36f('0x45')][_0xb36f('0x5c')](_0x70d1bf);})[_0xb36f('0x23')](function(_0x1c7b0d){_0x978abb[_0xb36f('0x5d')]=_0x1c7b0d;return _0x978abb;})['then'](respondWithFilteredResult(_0x15c9c7,_0x70d1bf))[_0xb36f('0x2d')](handleError(_0x15c9c7,null));};exports[_0xb36f('0x5e')]=function(_0x16da4b,_0x46fd93){var _0x3c70c5={'raw':![],'where':{'id':_0x16da4b[_0xb36f('0x5f')]['id']},'include':[{'model':db[_0xb36f('0x3f')],'as':_0xb36f('0x60')},{'model':db[_0xb36f('0x40')],'as':_0xb36f('0x41')},{'model':db[_0xb36f('0x42')],'as':_0xb36f('0x43')}]},_0x3722ac={};_0x3722ac[_0xb36f('0x4a')]=_[_0xb36f('0x4b')](db[_0xb36f('0x45')][_0xb36f('0x46')]);_0x3722ac[_0xb36f('0x4c')]=_[_0xb36f('0x4b')](_0x16da4b[_0xb36f('0x4c')]);_0x3722ac['filters']=_[_0xb36f('0x4d')](_0x3722ac['model'],_0x3722ac[_0xb36f('0x4c')]);_0x3c70c5[_0xb36f('0x4e')]=_['intersection'](_0x3722ac[_0xb36f('0x4a')],qs[_0xb36f('0x4f')](_0x16da4b['query'][_0xb36f('0x4f')]));_0x3c70c5[_0xb36f('0x4e')]=_0x3c70c5[_0xb36f('0x4e')][_0xb36f('0x50')]?_0x3c70c5[_0xb36f('0x4e')]:_0x3722ac[_0xb36f('0x4a')];if(_0x16da4b[_0xb36f('0x4c')]['includeAll']){_0x3c70c5[_0xb36f('0x5b')]=[{'all':!![]}];}_0x3c70c5=_[_0xb36f('0x59')]({},_0x3c70c5,_0x16da4b[_0xb36f('0x5a')]);return db[_0xb36f('0x45')][_0xb36f('0x61')](_0x3c70c5)[_0xb36f('0x23')](handleEntityNotFound(_0x46fd93,null))[_0xb36f('0x23')](respondWithResult(_0x46fd93,null))[_0xb36f('0x2d')](handleError(_0x46fd93,null));};exports[_0xb36f('0x38')]=function(_0x5ec220,_0x2d009a){if(_0x5ec220[_0xb36f('0x62')]['id']){delete _0x5ec220[_0xb36f('0x62')]['id'];}return db[_0xb36f('0x45')]['find']({'where':{'id':_0x5ec220[_0xb36f('0x5f')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xb36f('0x40')],'as':_0xb36f('0x41')},{'model':db[_0xb36f('0x42')],'as':'mandatoryDispositionPause'}]})[_0xb36f('0x23')](handleEntityNotFound(_0x2d009a,null))[_0xb36f('0x23')](saveUpdates(_0x5ec220['body'],null))[_0xb36f('0x23')](function(_0x32eeaf){if(_0x32eeaf&&_0x5ec220[_0xb36f('0x62')]['Imap']){return db[_0xb36f('0x3f')][_0xb36f('0x38')](_0x5ec220['body'][_0xb36f('0x60')],{'where':{'MailAccountId':_0x32eeaf['id']}})['then'](function(){return _0x32eeaf;});}return _0x32eeaf;})[_0xb36f('0x23')](function(_0x210eff){if(_0x210eff&&_0x5ec220[_0xb36f('0x62')][_0xb36f('0x41')]){return db[_0xb36f('0x40')][_0xb36f('0x38')](_0x5ec220[_0xb36f('0x62')][_0xb36f('0x41')],{'where':{'MailAccountId':_0x210eff['id']}})['then'](function(){return _0x210eff;});}return _0x210eff;})[_0xb36f('0x23')](respondWithResult(_0x2d009a,null))[_0xb36f('0x2d')](handleError(_0x2d009a,null));};exports[_0xb36f('0x63')]=function(_0x48cf03,_0x2bea80){return db[_0xb36f('0x45')][_0xb36f('0x63')]()[_0xb36f('0x23')](respondWithResult(_0x2bea80,null))[_0xb36f('0x2d')](handleError(_0x2bea80,null));};exports[_0xb36f('0x64')]=function(_0x17c27f,_0x12989a,_0x4dbbb0){if(_0x17c27f[_0xb36f('0x62')]['id']){delete _0x17c27f[_0xb36f('0x62')]['id'];}return db[_0xb36f('0x45')]['find']({'where':{'id':_0x17c27f[_0xb36f('0x5f')]['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0x12989a,null))['then'](function(_0xfdaf80){if(_0xfdaf80){_0x17c27f['body'][_0xb36f('0x65')]=_0xfdaf80['id'];return db[_0xb36f('0x66')][_0xb36f('0x67')](_0x17c27f[_0xb36f('0x62')]);}})[_0xb36f('0x23')](respondWithResult(_0x12989a,null))['catch'](handleError(_0x12989a,null));};exports['getDispositions']=function(_0x55276d,_0x3f9448,_0x3560dc){var _0xe6a499={'raw':![],'where':{}};var _0x327420={};var _0x4df6f2={'count':0x0,'rows':[]};return db[_0xb36f('0x45')][_0xb36f('0x68')]({'where':{'id':_0x55276d[_0xb36f('0x5f')]['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0x3f9448,null))[_0xb36f('0x23')](function(_0x2c44e6){if(_0x2c44e6){_0x327420[_0xb36f('0x4a')]=_['keys'](db[_0xb36f('0x66')]['rawAttributes']);_0x327420['query']=_[_0xb36f('0x4b')](_0x55276d[_0xb36f('0x4c')]);_0x327420[_0xb36f('0x55')]=_[_0xb36f('0x4d')](_0x327420['model'],_0x327420['query']);_0xe6a499[_0xb36f('0x4e')]=_[_0xb36f('0x4d')](_0x327420['model'],qs[_0xb36f('0x4f')](_0x55276d[_0xb36f('0x4c')]['fields']));_0xe6a499[_0xb36f('0x4e')]=_0xe6a499[_0xb36f('0x4e')]['length']?_0xe6a499[_0xb36f('0x4e')]:_0x327420[_0xb36f('0x4a')];if(!_0x55276d[_0xb36f('0x4c')][_0xb36f('0x51')](_0xb36f('0x69'))){_0xe6a499['limit']=qs['limit'](_0x55276d[_0xb36f('0x4c')]['limit']);_0xe6a499[_0xb36f('0x31')]=qs[_0xb36f('0x31')](_0x55276d[_0xb36f('0x4c')][_0xb36f('0x31')]);}_0xe6a499[_0xb36f('0x52')]=qs[_0xb36f('0x53')](_0x55276d[_0xb36f('0x4c')][_0xb36f('0x53')]);_0xe6a499[_0xb36f('0x54')]=qs[_0xb36f('0x55')](_[_0xb36f('0x56')](_0x55276d['query'],_0x327420[_0xb36f('0x55')]));_0xe6a499[_0xb36f('0x54')]['MailAccountId']=_0x2c44e6['id'];if(_0x55276d[_0xb36f('0x4c')][_0xb36f('0x58')]){_0xe6a499['where']=_[_0xb36f('0x59')](_0xe6a499[_0xb36f('0x54')],{'$or':_[_0xb36f('0x44')](_0xe6a499[_0xb36f('0x4e')],function(_0x4facf5){var _0x3dc3a2={};_0x3dc3a2[_0x4facf5]={'$like':'%'+_0x55276d[_0xb36f('0x4c')][_0xb36f('0x58')]+'%'};return _0x3dc3a2;})});}_0xe6a499=_[_0xb36f('0x59')]({},_0xe6a499,_0x55276d[_0xb36f('0x5a')]);return db[_0xb36f('0x66')][_0xb36f('0x34')]({'where':_0xe6a499[_0xb36f('0x54')]})[_0xb36f('0x23')](function(_0x5dc7fc){_0x4df6f2[_0xb36f('0x34')]=_0x5dc7fc;if(_0x55276d[_0xb36f('0x4c')][_0xb36f('0x6a')]){_0xe6a499[_0xb36f('0x5b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0xe6a499);})['then'](function(_0x2c2a11){_0x4df6f2[_0xb36f('0x5d')]=_0x2c2a11;return _0x4df6f2;});}})[_0xb36f('0x23')](respondWithFilteredResult(_0x3f9448,_0xe6a499))['catch'](handleError(_0x3f9448,null));};exports[_0xb36f('0x6b')]=function(_0x1a8a8c,_0x2e58d8,_0x466c86){return db[_0xb36f('0x45')][_0xb36f('0x61')]({'where':{'id':_0x1a8a8c[_0xb36f('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2e58d8,null))['then'](function(_0x5c2cdd){if(_0x5c2cdd){return _0x5c2cdd[_0xb36f('0x6b')](_0x1a8a8c['query']['ids']);}})[_0xb36f('0x23')](respondWithStatusCode(_0x2e58d8,null))[_0xb36f('0x2d')](handleError(_0x2e58d8,null));};exports['addAnswer']=function(_0x1eb338,_0x3badb5,_0xae9048){if(_0x1eb338[_0xb36f('0x62')]['id']){delete _0x1eb338[_0xb36f('0x62')]['id'];}return db[_0xb36f('0x45')][_0xb36f('0x61')]({'where':{'id':_0x1eb338['params']['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0x3badb5,null))[_0xb36f('0x23')](function(_0x5191c2){if(_0x5191c2){_0x1eb338[_0xb36f('0x62')]['MailAccountId']=_0x5191c2['id'];return db[_0xb36f('0x6c')][_0xb36f('0x67')](_0x1eb338[_0xb36f('0x62')]);}})[_0xb36f('0x23')](respondWithResult(_0x3badb5,null))[_0xb36f('0x2d')](handleError(_0x3badb5,null));};exports[_0xb36f('0x6d')]=function(_0x3b2017,_0x3afbee,_0x1d3dda){var _0x1e365e={'raw':![],'where':{}};var _0x522ff5={};var _0x36767b={'count':0x0,'rows':[]};return db[_0xb36f('0x45')]['findOne']({'where':{'id':_0x3b2017[_0xb36f('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3afbee,null))[_0xb36f('0x23')](function(_0x196507){if(_0x196507){_0x522ff5[_0xb36f('0x4a')]=_[_0xb36f('0x4b')](db['CannedAnswer'][_0xb36f('0x46')]);_0x522ff5[_0xb36f('0x4c')]=_[_0xb36f('0x4b')](_0x3b2017['query']);_0x522ff5[_0xb36f('0x55')]=_['intersection'](_0x522ff5[_0xb36f('0x4a')],_0x522ff5[_0xb36f('0x4c')]);_0x1e365e[_0xb36f('0x4e')]=_['intersection'](_0x522ff5['model'],qs[_0xb36f('0x4f')](_0x3b2017[_0xb36f('0x4c')][_0xb36f('0x4f')]));_0x1e365e['attributes']=_0x1e365e[_0xb36f('0x4e')][_0xb36f('0x50')]?_0x1e365e[_0xb36f('0x4e')]:_0x522ff5[_0xb36f('0x4a')];if(!_0x3b2017[_0xb36f('0x4c')][_0xb36f('0x51')](_0xb36f('0x69'))){_0x1e365e[_0xb36f('0x32')]=qs[_0xb36f('0x32')](_0x3b2017[_0xb36f('0x4c')][_0xb36f('0x32')]);_0x1e365e[_0xb36f('0x31')]=qs[_0xb36f('0x31')](_0x3b2017[_0xb36f('0x4c')][_0xb36f('0x31')]);}_0x1e365e[_0xb36f('0x52')]=qs[_0xb36f('0x53')](_0x3b2017[_0xb36f('0x4c')][_0xb36f('0x53')]);_0x1e365e[_0xb36f('0x54')]=qs[_0xb36f('0x55')](_[_0xb36f('0x56')](_0x3b2017['query'],_0x522ff5[_0xb36f('0x55')]));_0x1e365e[_0xb36f('0x54')]['MailAccountId']=_0x196507['id'];if(_0x3b2017[_0xb36f('0x4c')][_0xb36f('0x58')]){_0x1e365e['where']=_[_0xb36f('0x59')](_0x1e365e[_0xb36f('0x54')],{'$or':_[_0xb36f('0x44')](_0x1e365e['attributes'],function(_0xa394de){var _0x4d3486={};_0x4d3486[_0xa394de]={'$like':'%'+_0x3b2017['query'][_0xb36f('0x58')]+'%'};return _0x4d3486;})});}_0x1e365e=_[_0xb36f('0x59')]({},_0x1e365e,_0x3b2017['options']);return db[_0xb36f('0x6c')][_0xb36f('0x34')]({'where':_0x1e365e[_0xb36f('0x54')]})[_0xb36f('0x23')](function(_0x12c462){_0x36767b['count']=_0x12c462;if(_0x3b2017['query']['includeAll']){_0x1e365e['include']=[{'all':!![]}];}return db[_0xb36f('0x6c')][_0xb36f('0x5c')](_0x1e365e);})[_0xb36f('0x23')](function(_0x25cd4f){_0x36767b['rows']=_0x25cd4f;return _0x36767b;});}})['then'](respondWithFilteredResult(_0x3afbee,_0x1e365e))[_0xb36f('0x2d')](handleError(_0x3afbee,null));};exports['removeAnswers']=function(_0x3eef59,_0x3aaf86,_0x1e02e8){return db[_0xb36f('0x45')][_0xb36f('0x61')]({'where':{'id':_0x3eef59[_0xb36f('0x5f')]['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0x3aaf86,null))[_0xb36f('0x23')](function(_0x2edd2a){if(_0x2edd2a){return _0x2edd2a['removeAnswers'](_0x3eef59[_0xb36f('0x4c')][_0xb36f('0x6e')]);}})['then'](respondWithStatusCode(_0x3aaf86,null))['catch'](handleError(_0x3aaf86,null));};exports[_0xb36f('0x67')]=function(_0x1c0737,_0x36fc11){var _0x2e98e0={'name':_0x1c0737[_0xb36f('0x62')][_0xb36f('0x3c')],'key':_0x1c0737['body']['key'],'email':_0x1c0737['body'][_0xb36f('0x6f')],'ListId':_0x1c0737[_0xb36f('0x62')][_0xb36f('0x70')],'active':!_['isNil'](_0x1c0737['body'][_0xb36f('0x71')])?_0x1c0737[_0xb36f('0x62')][_0xb36f('0x71')]:!![],'description':_0x1c0737[_0xb36f('0x62')][_0xb36f('0x72')]||null,'Imap':{},'Smtp':{}};if(_[_0xb36f('0x73')](_0x1c0737[_0xb36f('0x62')][_0xb36f('0x74')])){if(_0x1c0737['body'][_0xb36f('0x75')]){_0x2e98e0[_0xb36f('0x60')][_0xb36f('0x76')]=_0x2e98e0[_0xb36f('0x41')][_0xb36f('0x76')]=_0x1c0737[_0xb36f('0x62')][_0xb36f('0x77')];_0x2e98e0[_0xb36f('0x60')][_0xb36f('0x78')]=_0x2e98e0['Smtp'][_0xb36f('0x79')]=_0x1c0737[_0xb36f('0x62')][_0xb36f('0x7a')];}else{_0x2e98e0[_0xb36f('0x60')][_0xb36f('0x7b')]=_0x2e98e0[_0xb36f('0x41')][_0xb36f('0x7b')]=![];}_0x2e98e0[_0xb36f('0x60')][_0xb36f('0x7c')]=_0x1c0737[_0xb36f('0x62')][_0xb36f('0x60')][_0xb36f('0x7c')];_0x2e98e0[_0xb36f('0x60')]['port']=_0x1c0737[_0xb36f('0x62')][_0xb36f('0x60')][_0xb36f('0x7d')];_0x2e98e0['Smtp'][_0xb36f('0x7c')]=_0x1c0737['body'][_0xb36f('0x41')][_0xb36f('0x7c')];_0x2e98e0['Smtp']['port']=_0x1c0737[_0xb36f('0x62')][_0xb36f('0x41')][_0xb36f('0x7d')];}else{_0x2e98e0[_0xb36f('0x60')][_0xb36f('0x7e')]=_0x2e98e0['Smtp'][_0xb36f('0x7e')]=_0x1c0737[_0xb36f('0x62')][_0xb36f('0x74')];_0x2e98e0['Imap'][_0xb36f('0x76')]=_0x2e98e0[_0xb36f('0x41')][_0xb36f('0x76')]=_0x1c0737[_0xb36f('0x62')][_0xb36f('0x77')];_0x2e98e0[_0xb36f('0x60')][_0xb36f('0x78')]=_0x2e98e0[_0xb36f('0x41')][_0xb36f('0x79')]=_0x1c0737['body']['cpassword'];}return db[_0xb36f('0x45')]['create'](_0x2e98e0,{'include':[{'model':db[_0xb36f('0x40')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0xb36f('0x60')}]})['then'](function(_0x101eff){var _0x5df467=_0x1c0737[_0xb36f('0x76')][_0xb36f('0x7f')]({'plain':!![]});if(!_0x5df467)throw new Error(_0xb36f('0x80'));if(_0x5df467[_0xb36f('0x81')]===_0xb36f('0x76')){var _0x91fee0=_0x101eff['get']({'plain':!![]});return db[_0xb36f('0x82')][_0xb36f('0x61')]({'where':{'name':'MailAccounts','userProfileId':_0x5df467[_0xb36f('0x83')]},'raw':!![]})['then'](function(_0x38e524){if(_0x38e524&&_0x38e524[_0xb36f('0x84')]===0x0){return db[_0xb36f('0x3b')]['create']({'name':_0x91fee0['name'],'resourceId':_0x91fee0['id'],'type':_0x38e524['name'],'sectionId':_0x38e524['id']},{})['then'](function(){return _0x101eff;});}else{return _0x101eff;}})[_0xb36f('0x2d')](function(_0x565327){logger[_0xb36f('0x28')](_0xb36f('0x85'),_0x565327);throw _0x565327;});}return _0x101eff;})['then'](respondWithResult(_0x36fc11,0xc9))['catch'](handleError(_0x36fc11,null));};exports[_0xb36f('0x86')]=function(_0x371418,_0x364972,_0x224ef0){return db[_0xb36f('0x45')]['findOne']({'where':{'id':_0x371418[_0xb36f('0x5f')]['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0x364972,null))[_0xb36f('0x23')](function(_0x2aa194){if(_0x2aa194){return _0x2aa194[_0xb36f('0x86')]();}return null;})[_0xb36f('0x23')](respondWithResult(_0x364972,null))[_0xb36f('0x2d')](handleError(_0x364972,null));};exports[_0xb36f('0x87')]=function(_0x58bd2d,_0x368e78,_0x1e0d92){if(_0x58bd2d[_0xb36f('0x62')]['id']){delete _0x58bd2d[_0xb36f('0x62')]['id'];}return db[_0xb36f('0x45')]['find']({'where':{'id':_0x58bd2d['params']['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0x368e78,null))[_0xb36f('0x23')](function(_0x563e90){if(_0x563e90){_0x58bd2d['body'][_0xb36f('0x65')]=_0x563e90['id'];return db[_0xb36f('0x3f')]['create'](_0x58bd2d[_0xb36f('0x62')]);}})[_0xb36f('0x23')](respondWithResult(_0x368e78,null))[_0xb36f('0x2d')](handleError(_0x368e78,null));};exports[_0xb36f('0x88')]=function(_0x54ebbe,_0xe06e1b,_0x43288c){return db[_0xb36f('0x45')][_0xb36f('0x68')]({'where':{'id':_0x54ebbe[_0xb36f('0x5f')]['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0xe06e1b,null))[_0xb36f('0x23')](function(_0x204319){if(_0x204319){return _0x204319[_0xb36f('0x89')](null);}return null;})[_0xb36f('0x23')](respondWithStatusCode(_0xe06e1b,null))[_0xb36f('0x2d')](handleError(_0xe06e1b,null));};exports[_0xb36f('0x8a')]=function(_0x124823,_0x1506ef,_0x27ce59){return db[_0xb36f('0x45')][_0xb36f('0x68')]({'where':{'id':_0x124823[_0xb36f('0x5f')]['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0x1506ef,null))['then'](function(_0x33c3b8){if(_0x33c3b8){return _0x33c3b8[_0xb36f('0x8a')]();}return null;})[_0xb36f('0x23')](respondWithResult(_0x1506ef,null))['catch'](handleError(_0x1506ef,null));};exports[_0xb36f('0x8b')]=function(_0x309395,_0x1a2e02,_0x279c54){if(_0x309395[_0xb36f('0x62')]['id']){delete _0x309395[_0xb36f('0x62')]['id'];}return db[_0xb36f('0x45')][_0xb36f('0x61')]({'where':{'id':_0x309395[_0xb36f('0x5f')]['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0x1a2e02,null))[_0xb36f('0x23')](function(_0x26c2b3){if(_0x26c2b3){_0x309395[_0xb36f('0x62')][_0xb36f('0x65')]=_0x26c2b3['id'];return db[_0xb36f('0x40')]['create'](_0x309395[_0xb36f('0x62')]);}})[_0xb36f('0x23')](respondWithResult(_0x1a2e02,null))[_0xb36f('0x2d')](handleError(_0x1a2e02,null));};exports['removeSmtp']=function(_0x947455,_0xb3b324,_0x46556a){return db[_0xb36f('0x45')][_0xb36f('0x68')]({'where':{'id':_0x947455[_0xb36f('0x5f')]['id']}})['then'](handleEntityNotFound(_0xb3b324,null))[_0xb36f('0x23')](function(_0x5ae527){if(_0x5ae527){return _0x5ae527[_0xb36f('0x8c')](null);}return null;})[_0xb36f('0x23')](respondWithStatusCode(_0xb3b324,null))[_0xb36f('0x2d')](handleError(_0xb3b324,null));};exports[_0xb36f('0x8d')]=function(_0x30b67b,_0x316c02,_0x1aba57){return db['MailInteraction'][_0xb36f('0x61')]({'where':{'id':_0x30b67b[_0xb36f('0x5f')]['id']}})['then'](handleEntityNotFound(_0x316c02,null))[_0xb36f('0x23')](function(_0x5b454e){if(_0x5b454e){return _0x5b454e['addInteraction'](_0x30b67b[_0xb36f('0x62')][_0xb36f('0x6e')],_[_0xb36f('0x8e')](_0x30b67b[_0xb36f('0x62')],['ids','id'])||{});}})[_0xb36f('0x23')](respondWithResult(_0x316c02,null))['catch'](handleError(_0x316c02,null));};exports[_0xb36f('0x8f')]=function(_0x3480ce,_0x25cd94,_0x2f3170){var _0x335bdd={'raw':![],'where':{}};var _0x5b2670={};var _0x152c4e={'count':0x0,'rows':[]};return db[_0xb36f('0x45')][_0xb36f('0x68')]({'where':{'id':_0x3480ce[_0xb36f('0x5f')]['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0x25cd94,null))['then'](function(_0x381a0a){if(_0x381a0a){_0x5b2670[_0xb36f('0x4a')]=_[_0xb36f('0x4b')](db[_0xb36f('0x90')][_0xb36f('0x46')]);_0x5b2670['query']=_['keys'](_0x3480ce[_0xb36f('0x4c')]);_0x5b2670[_0xb36f('0x55')]=_[_0xb36f('0x4d')](_0x5b2670[_0xb36f('0x4a')],_0x5b2670[_0xb36f('0x4c')]);_0x335bdd[_0xb36f('0x4e')]=_['intersection'](_0x5b2670['model'],qs[_0xb36f('0x4f')](_0x3480ce[_0xb36f('0x4c')][_0xb36f('0x4f')]));_0x335bdd['attributes']=_0x335bdd[_0xb36f('0x4e')]['length']?_0x335bdd['attributes']:_0x5b2670[_0xb36f('0x4a')];if(!_0x3480ce['query']['hasOwnProperty']('nolimit')){_0x335bdd['limit']=qs[_0xb36f('0x32')](_0x3480ce[_0xb36f('0x4c')][_0xb36f('0x32')]);_0x335bdd[_0xb36f('0x31')]=qs[_0xb36f('0x31')](_0x3480ce[_0xb36f('0x4c')]['offset']);}_0x335bdd[_0xb36f('0x52')]=qs['sort'](_0x3480ce[_0xb36f('0x4c')][_0xb36f('0x53')]);_0x335bdd[_0xb36f('0x54')]=qs[_0xb36f('0x55')](_[_0xb36f('0x56')](_0x3480ce[_0xb36f('0x4c')],_0x5b2670[_0xb36f('0x55')]));_0x335bdd[_0xb36f('0x54')][_0xb36f('0x65')]=_0x381a0a['id'];if(_0x3480ce[_0xb36f('0x4c')]['filter']){_0x335bdd['where']=_[_0xb36f('0x59')](_0x335bdd[_0xb36f('0x54')],{'$or':_[_0xb36f('0x44')](_0x335bdd[_0xb36f('0x4e')],function(_0x5461fc){var _0x551809={};_0x551809[_0x5461fc]={'$like':'%'+_0x3480ce[_0xb36f('0x4c')][_0xb36f('0x58')]+'%'};return _0x551809;})});}_0x335bdd=_['merge']({},_0x335bdd,_0x3480ce[_0xb36f('0x5a')]);return db[_0xb36f('0x90')][_0xb36f('0x34')]({'where':_0x335bdd['where']})['then'](function(_0x152e2d){_0x152c4e[_0xb36f('0x34')]=_0x152e2d;if(_0x3480ce[_0xb36f('0x4c')]['includeAll']){_0x335bdd[_0xb36f('0x5b')]=[{'model':db[_0xb36f('0x91')],'as':'Contact','required':![]},{'model':db[_0xb36f('0x92')],'as':'Owner','attributes':[_0xb36f('0x3c'),_0xb36f('0x93'),'internal'],'required':![]},{'model':db[_0xb36f('0x94')],'as':_0xb36f('0x95'),'attributes':['id',_0xb36f('0x3c'),_0xb36f('0x96')],'where':_0x3480ce[_0xb36f('0x4c')][_0xb36f('0x97')]?{'id':_0x3480ce[_0xb36f('0x4c')]['tag']}:undefined,'required':_0x3480ce[_0xb36f('0x4c')][_0xb36f('0x97')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x335bdd);})['then'](function(_0x287720){_0x152c4e[_0xb36f('0x5d')]=_0x287720;return _0x152c4e;});}})[_0xb36f('0x23')](respondWithFilteredResult(_0x25cd94,_0x335bdd))['catch'](handleError(_0x25cd94,null));};exports['addApplications']=function(_0x1ac8c1,_0x223d03,_0x31ed6c){return db[_0xb36f('0x45')][_0xb36f('0x68')]({'where':{'id':_0x1ac8c1[_0xb36f('0x5f')]['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0x223d03,null))['then'](function(_0x271d38){if(_0x271d38){return db['sequelize'][_0xb36f('0x98')](function(_0x75ae12){return db['MailApplication'][_0xb36f('0x39')]({'where':{'MailAccountId':_0x1ac8c1['params']['id']},'transaction':_0x75ae12})[_0xb36f('0x23')](function(_0xde3332){var _0x18f584=_[_0xb36f('0x44')](_0x1ac8c1[_0xb36f('0x62')],function(_0x40426d){_0x40426d[_0xb36f('0x65')]=_0x1ac8c1[_0xb36f('0x5f')]['id'];return _0x40426d;});return db[_0xb36f('0x99')]['bulkCreate'](_0x18f584,{'transaction':_0x75ae12});});})[_0xb36f('0x23')](function(){return db[_0xb36f('0x99')][_0xb36f('0x9a')]({'where':{'MailAccountId':_0x1ac8c1[_0xb36f('0x5f')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x223d03,null))[_0xb36f('0x2d')](handleError(_0x223d03,null));};exports['getApplications']=function(_0x26751b,_0xe4e05f,_0x10b1af){var _0x52f3d6={};var _0x10e9f7={};var _0x360958;var _0x4dc846;return db[_0xb36f('0x45')][_0xb36f('0x68')]({'where':{'id':_0x26751b['params']['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0xe4e05f,null))[_0xb36f('0x23')](function(_0x39fdc1){if(_0x39fdc1){_0x360958=_0x39fdc1;_0x10e9f7[_0xb36f('0x4a')]=_[_0xb36f('0x4b')](db[_0xb36f('0x99')][_0xb36f('0x46')]);_0x10e9f7[_0xb36f('0x4c')]=_[_0xb36f('0x4b')](_0x26751b['query']);_0x10e9f7['filters']=_[_0xb36f('0x4d')](_0x10e9f7[_0xb36f('0x4a')],_0x10e9f7[_0xb36f('0x4c')]);_0x52f3d6[_0xb36f('0x4e')]=_[_0xb36f('0x4d')](_0x10e9f7[_0xb36f('0x4a')],qs['fields'](_0x26751b[_0xb36f('0x4c')][_0xb36f('0x4f')]));_0x52f3d6['attributes']=_0x52f3d6['attributes']['length']?_0x52f3d6[_0xb36f('0x4e')]:_0x10e9f7[_0xb36f('0x4a')];_0x52f3d6['order']=qs[_0xb36f('0x53')](_0x26751b[_0xb36f('0x4c')][_0xb36f('0x53')]);_0x52f3d6[_0xb36f('0x54')]=qs[_0xb36f('0x55')](_[_0xb36f('0x56')](_0x26751b[_0xb36f('0x4c')],_0x10e9f7['filters']));if(_0x26751b[_0xb36f('0x4c')][_0xb36f('0x58')]){_0x52f3d6[_0xb36f('0x54')]=_['merge'](_0x52f3d6[_0xb36f('0x54')],{'$or':_[_0xb36f('0x44')](_0x52f3d6['attributes'],function(_0xacd5d8){var _0x1606c1={};_0x1606c1[_0xacd5d8]={'$like':'%'+_0x26751b[_0xb36f('0x4c')][_0xb36f('0x58')]+'%'};return _0x1606c1;})});}_0x52f3d6=_[_0xb36f('0x59')]({},_0x52f3d6,_0x26751b[_0xb36f('0x5a')]);return _0x360958[_0xb36f('0x9b')](_0x52f3d6);}})[_0xb36f('0x23')](function(_0x1263d3){if(_0x1263d3){_0x4dc846=_0x1263d3[_0xb36f('0x50')];if(!_0x26751b[_0xb36f('0x4c')]['hasOwnProperty'](_0xb36f('0x69'))){_0x52f3d6[_0xb36f('0x32')]=qs[_0xb36f('0x32')](_0x26751b['query']['limit']);_0x52f3d6['offset']=qs['offset'](_0x26751b[_0xb36f('0x4c')][_0xb36f('0x31')]);}return _0x360958[_0xb36f('0x9b')](_0x52f3d6);}})[_0xb36f('0x23')](function(_0x55535b){if(_0x55535b){return _0x55535b?{'count':_0x4dc846,'rows':_0x55535b}:null;}})['then'](respondWithResult(_0xe4e05f,null))[_0xb36f('0x2d')](handleError(_0xe4e05f,null));};exports[_0xb36f('0x9c')]=function(_0x4ed702,_0x44b50a,_0x3b7eb6){var _0x5aeed3={'raw':!![],'where':{}};var _0x1f031a={};var _0xda3eb4={'count':0x0,'rows':[]};return db[_0xb36f('0x45')][_0xb36f('0x68')]({'where':{'id':_0x4ed702['params']['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0x44b50a,null))[_0xb36f('0x23')](function(_0x55b29e){if(_0x55b29e){_0x1f031a[_0xb36f('0x4a')]=_[_0xb36f('0x4b')](db[_0xb36f('0x9d')]['rawAttributes']);_0x1f031a[_0xb36f('0x4c')]=_[_0xb36f('0x4b')](_0x4ed702[_0xb36f('0x4c')]);_0x1f031a[_0xb36f('0x55')]=_[_0xb36f('0x4d')](_0x1f031a[_0xb36f('0x4a')],_0x1f031a[_0xb36f('0x4c')]);_0x5aeed3['attributes']=_[_0xb36f('0x4d')](_0x1f031a[_0xb36f('0x4a')],qs[_0xb36f('0x4f')](_0x4ed702[_0xb36f('0x4c')][_0xb36f('0x4f')]));_0x5aeed3[_0xb36f('0x4e')]=_0x5aeed3['attributes'][_0xb36f('0x50')]?_0x5aeed3[_0xb36f('0x4e')]:_0x1f031a[_0xb36f('0x4a')];if(!_0x4ed702[_0xb36f('0x4c')][_0xb36f('0x51')](_0xb36f('0x69'))){_0x5aeed3[_0xb36f('0x32')]=qs[_0xb36f('0x32')](_0x4ed702['query'][_0xb36f('0x32')]);_0x5aeed3[_0xb36f('0x31')]=qs[_0xb36f('0x31')](_0x4ed702[_0xb36f('0x4c')]['offset']);}_0x5aeed3[_0xb36f('0x52')]=qs[_0xb36f('0x53')](_0x4ed702[_0xb36f('0x4c')][_0xb36f('0x53')]);_0x5aeed3[_0xb36f('0x54')]=qs[_0xb36f('0x55')](_[_0xb36f('0x56')](_0x4ed702[_0xb36f('0x4c')],_0x1f031a['filters']));_0x5aeed3[_0xb36f('0x54')]['MailAccountId']=_0x55b29e['id'];if(_0x4ed702[_0xb36f('0x4c')][_0xb36f('0x58')]){_0x5aeed3[_0xb36f('0x54')]=_[_0xb36f('0x59')](_0x5aeed3[_0xb36f('0x54')],{'$or':_[_0xb36f('0x44')](_0x5aeed3[_0xb36f('0x4e')],function(_0x3ea8e2){var _0x558753={};_0x558753[_0x3ea8e2]={'$like':'%'+_0x4ed702[_0xb36f('0x4c')][_0xb36f('0x58')]+'%'};return _0x558753;})});}if(_0x4ed702[_0xb36f('0x4c')]['$gte']){var _0x526ae7=_0x4ed702[_0xb36f('0x4c')][_0xb36f('0x9e')][_0xb36f('0x9f')](',');var _0x2ed5ea={};_0x2ed5ea[_0x526ae7[0x0]]={'$gte':moment(_0x526ae7[0x1])[_0xb36f('0xa0')](_0xb36f('0xa1'))};_0x5aeed3[_0xb36f('0x54')]=_[_0xb36f('0x59')](_0x5aeed3[_0xb36f('0x54')],_0x2ed5ea);}_0x5aeed3=_[_0xb36f('0x59')]({},_0x5aeed3,_0x4ed702[_0xb36f('0x5a')]);return db[_0xb36f('0x9d')]['count']({'where':_0x5aeed3['where']})[_0xb36f('0x23')](function(_0x161418){_0xda3eb4[_0xb36f('0x34')]=_0x161418;if(_0x4ed702['query'][_0xb36f('0x6a')]){_0x5aeed3[_0xb36f('0x5b')]=[{'all':!![]}];}return db[_0xb36f('0x9d')][_0xb36f('0x5c')](_0x5aeed3);})[_0xb36f('0x23')](function(_0x37bb00){if(_0x4ed702['query'][_0xb36f('0xa2')]===_0xb36f('0xa3')){for(var _0x445928=0x0;_0x445928<_0x37bb00[_0xb36f('0x50')];_0x445928++){_0x37bb00[_0x445928][_0xb36f('0x62')]=juice(_0x37bb00[_0x445928][_0xb36f('0x62')]);}}_0xda3eb4[_0xb36f('0x5d')]=_0x37bb00;return _0xda3eb4;});}})[_0xb36f('0x23')](respondWithFilteredResult(_0x44b50a,_0x5aeed3))[_0xb36f('0x2d')](handleError(_0x44b50a,null));};exports[_0xb36f('0x3d')]=function(_0x253167,_0x38cb47,_0x36ea20){var _0x18a88c,_0x4eb81b={},_0x56e44a;if(_0x253167[_0xb36f('0x62')]['to']){_0x56e44a=_0x253167[_0xb36f('0x62')]['to'][_0xb36f('0x9f')](',')[0x0];}return db[_0xb36f('0x45')][_0xb36f('0x61')]({'where':{'id':_0x253167[_0xb36f('0x5f')]['id']},'include':[{'model':db[_0xb36f('0xa4')],'as':_0xb36f('0xa5'),'include':[{'model':db[_0xb36f('0x91')],'as':_0xb36f('0xa6'),'where':{'email':_0x56e44a},'limit':0x1,'order':[[_0xb36f('0xa7'),_0xb36f('0xa8')]]}]},{'model':db[_0xb36f('0x40')],'as':_0xb36f('0x41'),'raw':!![]}]})[_0xb36f('0x23')](handleEntityNotFound(_0x38cb47,null))[_0xb36f('0x23')](function(_0x178e22){if(_0x178e22){_0x18a88c=_0x178e22;if(_0x178e22['Smtp']){if(_[_0xb36f('0x73')](_0x253167['body'][_0xb36f('0xa9')])){_0x253167[_0xb36f('0x62')]['from']=util[_0xb36f('0xa0')](_0xb36f('0xaa'),_0x178e22[_0xb36f('0x3c')],_0x178e22[_0xb36f('0x6f')]||_0x178e22[_0xb36f('0x41')][_0xb36f('0x76')]);}if(_0x253167[_0xb36f('0x62')][_0xb36f('0xab')]&&_0x253167[_0xb36f('0x62')]['attachments'][_0xb36f('0x50')]){for(var _0x4ca89c=0x0;_0x4ca89c<_0x253167['body'][_0xb36f('0xab')][_0xb36f('0x50')];_0x4ca89c+=0x1){_0x253167[_0xb36f('0x62')]['attachments'][_0x4ca89c]={'filename':_0x253167[_0xb36f('0x62')][_0xb36f('0xab')][_0x4ca89c]['name'],'path':path['join'](config[_0xb36f('0xac')],_0xb36f('0xad'),_0x253167['body'][_0xb36f('0xab')][_0x4ca89c][_0xb36f('0xae')])};}}var _0xbf522e={'tls':{'rejectUnauthorized':![]}};if(_[_0xb36f('0x73')](_0x178e22[_0xb36f('0x41')][_0xb36f('0x7e')])){if(_0x178e22[_0xb36f('0x41')][_0xb36f('0x7b')]){_0xbf522e[_0xb36f('0xaf')]={'user':_0x178e22[_0xb36f('0x41')]['user'],'pass':_0x178e22[_0xb36f('0x41')][_0xb36f('0x79')]};}_0xbf522e['host']=_0x178e22[_0xb36f('0x41')][_0xb36f('0x7c')];_0xbf522e[_0xb36f('0x7d')]=_0x178e22[_0xb36f('0x41')][_0xb36f('0x7d')];_0xbf522e[_0xb36f('0xb0')]=_0x178e22[_0xb36f('0x41')]['secure'];}else{_0xbf522e['service']=_0x178e22[_0xb36f('0x41')][_0xb36f('0x7e')];_0xbf522e['auth']={'user':_0x178e22[_0xb36f('0x41')][_0xb36f('0x76')],'pass':_0x178e22[_0xb36f('0x41')][_0xb36f('0x79')]};}return respondWithRpcPromise(_0xb36f('0xb1'),'sendMail',{'account':_0xbf522e,'message':_0x253167[_0xb36f('0x62')]});}else{throw new Error(_0xb36f('0xb2'));}}})[_0xb36f('0x23')](function(_0x5775dc){if(_0x5775dc){_0x4eb81b=_0x5775dc;if(_0x18a88c[_0xb36f('0xa5')]){if(_0x18a88c[_0xb36f('0xa5')][_0xb36f('0xa6')][_0xb36f('0x50')]){return _0x18a88c['List'][_0xb36f('0xa6')][0x0];}else{return db[_0xb36f('0x91')][_0xb36f('0x67')](_['defaults'](_0x253167[_0xb36f('0x62')],{'firstName':_0x253167['body']['to'],'email':_0x253167['body']['to'],'phone':_0x253167[_0xb36f('0x62')]['to'],'ListId':_0x18a88c[_0xb36f('0x70')]}));}}else{throw new Error(_0xb36f('0xb2'));}}})['then'](function(_0x3977d0){if(_0x3977d0){var _0x522040={'UserId':_0x253167[_0xb36f('0x76')]['id'],'ContactId':_0x3977d0['id'],'MailAccountId':_0x18a88c['id'],'inReplyTo':_0x4eb81b[_0xb36f('0xb3')],'to':_0x253167[_0xb36f('0x62')]['from'],'cc':_0x253167[_0xb36f('0x62')]['cc'],'subject':_0x253167[_0xb36f('0x62')][_0xb36f('0xb4')],'attach':_0x253167[_0xb36f('0x62')][_0xb36f('0xb5')],'firstMsgDirection':_0xb36f('0xb6'),'lastMsgAt':moment()[_0xb36f('0xa0')](_0xb36f('0xa1')),'lastMsgDirection':'out','Messages':[_[_0xb36f('0x59')](_0x253167[_0xb36f('0x62')],{'messageId':_0x4eb81b[_0xb36f('0xb3')],'sentAt':moment()[_0xb36f('0xa0')](_0xb36f('0xa1')),'read':!![],'MailAccountId':_0x18a88c['id'],'UserId':_0x253167[_0xb36f('0x76')]['id'],'ContactId':_0x3977d0['id']})]};if(_0x253167[_0xb36f('0x62')][_0xb36f('0xb7')]){_0x522040=_['merge'](_0x522040,_0x253167[_0xb36f('0x62')][_0xb36f('0xb7')]);}return db[_0xb36f('0x90')][_0xb36f('0x67')](_0x522040,{'include':[{'model':db['MailMessage'],'as':_0xb36f('0xb8')}]});}})[_0xb36f('0x23')](respondWithResult(_0x38cb47,null))['catch'](handleError(_0x38cb47,null));};exports['verifySmtp']=function(_0x28afa1,_0x7014ac,_0x14a1c7){return db[_0xb36f('0x45')][_0xb36f('0x61')]({'where':{'id':_0x28afa1[_0xb36f('0x5f')]['id']},'include':[{'model':db[_0xb36f('0x40')],'as':'Smtp','raw':!![]}]})[_0xb36f('0x23')](handleEntityNotFound(_0x7014ac,null))[_0xb36f('0x23')](function(_0x53ceb5){if(_0x53ceb5&&_0x53ceb5[_0xb36f('0x41')]){var _0x54d6fb={'id':_0x53ceb5['id'],'tls':{'rejectUnauthorized':![]}};if(_0x53ceb5[_0xb36f('0x41')][_0xb36f('0x7e')]){_0x54d6fb['service']=_0x53ceb5[_0xb36f('0x41')][_0xb36f('0x7e')];}else{_0x54d6fb[_0xb36f('0x7c')]=_0x53ceb5[_0xb36f('0x41')][_0xb36f('0x7c')];_0x54d6fb[_0xb36f('0x7d')]=_0x53ceb5['Smtp'][_0xb36f('0x7d')];_0x54d6fb[_0xb36f('0xb0')]=_0x53ceb5['Smtp'][_0xb36f('0xb0')];}if(_0x53ceb5[_0xb36f('0x41')][_0xb36f('0x7b')]){_0x54d6fb[_0xb36f('0xaf')]={'user':_0x53ceb5['Smtp']['user'],'pass':_0x53ceb5[_0xb36f('0x41')]['pass']};}return respondWithRpcPromise(_0xb36f('0xb9'),_0xb36f('0xba'),{'account':_0x54d6fb});}})['then'](respondWithResult(_0x7014ac,null))[_0xb36f('0x2d')](handleError(_0x7014ac,null));};exports[_0xb36f('0x39')]=function(_0x45440e,_0xa7a566){return db[_0xb36f('0x45')][_0xb36f('0x61')]({'where':{'id':_0x45440e[_0xb36f('0x5f')]['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0xa7a566,null))[_0xb36f('0x23')](function(_0x4d8f5f){if(_0x4d8f5f&&_0x4d8f5f[_0xb36f('0x7e')]){throw new db['Sequelize'][(_0xb36f('0xbb'))](_0xb36f('0xbc'));}return _0x4d8f5f;})[_0xb36f('0x23')](removeEntity(_0xa7a566,null))[_0xb36f('0x2d')](handleError(_0xa7a566,null));};exports['addAgents']=function(_0x23bff6,_0x26cf9e,_0x5cb340){return db[_0xb36f('0x45')][_0xb36f('0x61')]({'where':{'id':_0x23bff6[_0xb36f('0x5f')]['id']}})['then'](handleEntityNotFound(_0x26cf9e,null))[_0xb36f('0x23')](function(_0x3bf380){if(_0x3bf380){return _0x3bf380[_0xb36f('0xbd')](_0x23bff6[_0xb36f('0x62')][_0xb36f('0x6e')],_[_0xb36f('0x8e')](_0x23bff6['body'],['ids','id'])||{})[_0xb36f('0xbe')](function(_0x2746af){for(var _0x15d01c=0x0;_0x15d01c<_0x23bff6['body']['ids']['length'];_0x15d01c+=0x1){socket[_0xb36f('0xbf')](_0xb36f('0xc0'),{'UserId':_0x23bff6[_0xb36f('0x62')][_0xb36f('0x6e')][_0x15d01c],'MailAccountId':_0x23bff6[_0xb36f('0x5f')]['id']});}return _0x2746af;});}})['then'](respondWithResult(_0x26cf9e,null))[_0xb36f('0x2d')](handleError(_0x26cf9e,null));};exports[_0xb36f('0xc1')]=function(_0x1339c8,_0x27bc6d,_0x4f4b21){return db['MailAccount'][_0xb36f('0x61')]({'where':{'id':_0x1339c8[_0xb36f('0x5f')]['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0x27bc6d,null))['then'](function(_0x56c0cf){if(_0x56c0cf){return _0x56c0cf['removeAgents'](_0x1339c8[_0xb36f('0x4c')][_0xb36f('0x6e')])[_0xb36f('0x23')](function(){if(_['isArray'](_0x1339c8['query'][_0xb36f('0x6e')])){for(var _0x637805=0x0;_0x637805<_0x1339c8[_0xb36f('0x4c')][_0xb36f('0x6e')][_0xb36f('0x50')];_0x637805+=0x1){socket[_0xb36f('0xbf')](_0xb36f('0xc2'),{'UserId':Number(_0x1339c8[_0xb36f('0x4c')]['ids'][_0x637805]),'MailAccountId':Number(_0x1339c8[_0xb36f('0x5f')]['id'])});}}else{socket[_0xb36f('0xbf')]('userMailAccount:remove',{'UserId':Number(_0x1339c8['query']['ids']),'MailAccountId':Number(_0x1339c8[_0xb36f('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x27bc6d,null))[_0xb36f('0x2d')](handleError(_0x27bc6d,null));};exports[_0xb36f('0xc3')]=function(_0x255a05,_0x3a1f8b,_0x2246f2){var _0x23afb9={};var _0x1ed111={};var _0x1d7b0d;var _0x9db61e;return db[_0xb36f('0x45')][_0xb36f('0x68')]({'where':{'id':_0x255a05[_0xb36f('0x5f')]['id']}})[_0xb36f('0x23')](handleEntityNotFound(_0x3a1f8b,null))[_0xb36f('0x23')](function(_0x4ada33){if(_0x4ada33){_0x1d7b0d=_0x4ada33;_0x1ed111[_0xb36f('0x4a')]=_[_0xb36f('0x4b')](db[_0xb36f('0x92')][_0xb36f('0x46')]);_0x1ed111['query']=_[_0xb36f('0x4b')](_0x255a05[_0xb36f('0x4c')]);_0x1ed111[_0xb36f('0x55')]=_[_0xb36f('0x4d')](_0x1ed111[_0xb36f('0x4a')],_0x1ed111['query']);_0x23afb9[_0xb36f('0x4e')]=_[_0xb36f('0x4d')](_0x1ed111['model'],qs['fields'](_0x255a05['query']['fields']));_0x23afb9[_0xb36f('0x4e')]=_0x23afb9[_0xb36f('0x4e')]['length']?_0x23afb9['attributes']:_0x1ed111['model'];_0x23afb9['order']=qs[_0xb36f('0x53')](_0x255a05['query'][_0xb36f('0x53')]);_0x23afb9[_0xb36f('0x54')]=qs['filters'](_[_0xb36f('0x56')](_0x255a05[_0xb36f('0x4c')],_0x1ed111[_0xb36f('0x55')]));if(_0x255a05[_0xb36f('0x4c')]['filter']){_0x23afb9['where']=_[_0xb36f('0x59')](_0x23afb9[_0xb36f('0x54')],{'$or':_[_0xb36f('0x44')](_0x23afb9[_0xb36f('0x4e')],function(_0x4c5643){var _0x52d80b={};_0x52d80b[_0x4c5643]={'$like':'%'+_0x255a05[_0xb36f('0x4c')]['filter']+'%'};return _0x52d80b;})});}_0x23afb9=_['merge']({},_0x23afb9,_0x255a05['options']);return _0x1d7b0d[_0xb36f('0xc3')](_0x23afb9);}})[_0xb36f('0x23')](function(_0xd82c2){if(_0xd82c2){_0x9db61e=_0xd82c2[_0xb36f('0x50')];if(!_0x255a05['query'][_0xb36f('0x51')](_0xb36f('0x69'))){_0x23afb9[_0xb36f('0x32')]=qs[_0xb36f('0x32')](_0x255a05[_0xb36f('0x4c')][_0xb36f('0x32')]);_0x23afb9[_0xb36f('0x31')]=qs['offset'](_0x255a05['query'][_0xb36f('0x31')]);}return _0x1d7b0d['getAgents'](_0x23afb9);}})['then'](function(_0x81c03d){if(_0x81c03d){return _0x81c03d?{'count':_0x9db61e,'rows':_0x81c03d}:null;}})[_0xb36f('0x23')](respondWithResult(_0x3a1f8b,null))[_0xb36f('0x2d')](handleError(_0x3a1f8b,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 9009456..ce2d754 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 _0x9106=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb','MailAccount'];(function(_0x27ca80,_0x20a064){var _0x176f0a=function(_0x1e5d6a){while(--_0x1e5d6a){_0x27ca80['push'](_0x27ca80['shift']());}};_0x176f0a(++_0x20a064);}(_0x9106,0x141));var _0x6910=function(_0x34bd34,_0x1444f7){_0x34bd34=_0x34bd34-0x0;var _0x4e36d6=_0x9106[_0x34bd34];return _0x4e36d6;};'use strict';var EventEmitter=require(_0x6910('0x0'));var MailAccount=require(_0x6910('0x1'))['db'][_0x6910('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6910('0x3')](0x0);var events={'afterCreate':_0x6910('0x4'),'afterUpdate':_0x6910('0x5'),'afterDestroy':_0x6910('0x6')};function emitEvent(_0x315b62){return function(_0x4597e7,_0x53d05f,_0x206e5c){MailAccountEvents[_0x6910('0x7')](_0x315b62+':'+_0x4597e7['id'],_0x4597e7);MailAccountEvents[_0x6910('0x7')](_0x315b62,_0x4597e7);_0x206e5c(null);};}for(var e in events){if(events[_0x6910('0x8')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x138e=['emit','hasOwnProperty','exports','../../mysqldb','MailAccount','update','remove'];(function(_0x23b785,_0xf98051){var _0x25066a=function(_0x51a04c){while(--_0x51a04c){_0x23b785['push'](_0x23b785['shift']());}};_0x25066a(++_0xf98051);}(_0x138e,0xc0));var _0xe138=function(_0x506d47,_0x42fe39){_0x506d47=_0x506d47-0x0;var _0x1fb5a2=_0x138e[_0x506d47];return _0x1fb5a2;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xe138('0x0'))['db'][_0xe138('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe138('0x2'),'afterDestroy':_0xe138('0x3')};function emitEvent(_0x30fb2e){return function(_0x69ceda,_0x4f0687,_0x4c156f){MailAccountEvents[_0xe138('0x4')](_0x30fb2e+':'+_0x69ceda['id'],_0x69ceda);MailAccountEvents[_0xe138('0x4')](_0x30fb2e,_0x69ceda);_0x4c156f(null);};}for(var e in events){if(events[_0xe138('0x5')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xe138('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 621bd9f..342fd97 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 _0xd5b7=['path','rimraf','../../config/environment','exports','define','MailAccount','mail_accounts','lodash','util','moment','bluebird','request-promise'];(function(_0x470252,_0xcda744){var _0x8bab4e=function(_0x2e43f2){while(--_0x2e43f2){_0x470252['push'](_0x470252['shift']());}};_0x8bab4e(++_0xcda744);}(_0xd5b7,0xaf));var _0x7d5b=function(_0x56a061,_0x53fb1b){_0x56a061=_0x56a061-0x0;var _0x105fa0=_0xd5b7[_0x56a061];return _0x105fa0;};'use strict';var _=require(_0x7d5b('0x0'));var util=require(_0x7d5b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7d5b('0x2'));var BPromise=require(_0x7d5b('0x3'));var rp=require(_0x7d5b('0x4'));var fs=require('fs');var path=require(_0x7d5b('0x5'));var rimraf=require(_0x7d5b('0x6'));var config=require(_0x7d5b('0x7'));var attributes=require('./mailAccount.attributes');module[_0x7d5b('0x8')]=function(_0x2b45df,_0x2b3c6f){return _0x2b45df[_0x7d5b('0x9')](_0x7d5b('0xa'),attributes,{'tableName':_0x7d5b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd140=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts'];(function(_0x3aa819,_0x1d04ee){var _0x3b4cb3=function(_0xee072d){while(--_0xee072d){_0x3aa819['push'](_0x3aa819['shift']());}};_0x3b4cb3(++_0x1d04ee);}(_0xd140,0x1d4));var _0x0d14=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd140[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d14('0x0'));var util=require('util');var logger=require(_0x0d14('0x1'))(_0x0d14('0x2'));var moment=require(_0x0d14('0x3'));var BPromise=require(_0x0d14('0x4'));var rp=require(_0x0d14('0x5'));var fs=require('fs');var path=require(_0x0d14('0x6'));var rimraf=require('rimraf');var config=require(_0x0d14('0x7'));var attributes=require(_0x0d14('0x8'));module[_0x0d14('0x9')]=function(_0x4e6dfe,_0xf33b6c){return _0x4e6dfe[_0x0d14('0xa')](_0x0d14('0xb'),attributes,{'tableName':_0x0d14('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 0bf7488..3188a37 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 _0xc1d0=['lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','map','model','ShowMailAccount','find','where','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','DESC','MailApplication','Applications','Smtp','get','omit','applications','list','orderBy','priority','asc','autoclose','push','length','Contacts','defaults','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Contact\x20not\x20found','spread','interaction','created','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','User','name','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting'];(function(_0x1013e3,_0xccc357){var _0x1b948c=function(_0x516477){while(--_0x516477){_0x1013e3['push'](_0x1013e3['shift']());}};_0x1b948c(++_0xccc357);}(_0xc1d0,0x1a0));var _0x0c1d=function(_0x3c6835,_0x952d5c){_0x3c6835=_0x3c6835-0x0;var _0x1adeb9=_0xc1d0[_0x3c6835];return _0x1adeb9;};'use strict';var _=require(_0x0c1d('0x0'));var util=require(_0x0c1d('0x1'));var moment=require(_0x0c1d('0x2'));var BPromise=require('bluebird');var rs=require(_0x0c1d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0c1d('0x4'));var logger=require(_0x0c1d('0x5'))('rpc');var config=require(_0x0c1d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0c1d('0x7')][_0x0c1d('0x8')]({'port':0x232c});config[_0x0c1d('0x9')]=_['defaults'](config['redis'],{'host':_0x0c1d('0xa'),'port':0x18eb});var socket=require(_0x0c1d('0xb'))(new Redis(config[_0x0c1d('0x9')]));require(_0x0c1d('0xc'))[_0x0c1d('0xd')](socket);function respondWithRpcPromise(_0x5806e7,_0x59feca,_0x53c408){return new BPromise(function(_0x12b9fc,_0x26ecee){return client['request'](_0x5806e7,_0x53c408)[_0x0c1d('0xe')](function(_0xb40b9a){logger[_0x0c1d('0xf')](_0x0c1d('0x10'),_0x59feca,_0x0c1d('0x11'));logger[_0x0c1d('0x12')](_0x0c1d('0x13'),_0x59feca,_0x0c1d('0x11'),JSON[_0x0c1d('0x14')](_0xb40b9a));if(_0xb40b9a[_0x0c1d('0x15')]){if(_0xb40b9a[_0x0c1d('0x15')][_0x0c1d('0x16')]===0x1f4){logger[_0x0c1d('0x15')]('MailAccount,\x20%s,\x20%s',_0x59feca,_0xb40b9a['error'][_0x0c1d('0x17')]);return _0x26ecee(_0xb40b9a[_0x0c1d('0x15')][_0x0c1d('0x17')]);}logger[_0x0c1d('0x15')](_0x0c1d('0x10'),_0x59feca,_0xb40b9a[_0x0c1d('0x15')][_0x0c1d('0x17')]);return _0x12b9fc(_0xb40b9a[_0x0c1d('0x15')][_0x0c1d('0x17')]);}else{logger[_0x0c1d('0xf')]('MailAccount,\x20%s,\x20%s',_0x59feca,_0x0c1d('0x11'));_0x12b9fc(_0xb40b9a['result'][_0x0c1d('0x17')]);}})[_0x0c1d('0x18')](function(_0x329782){logger[_0x0c1d('0x15')](_0x0c1d('0x10'),_0x59feca,_0x329782);_0x26ecee(_0x329782);});});}exports[_0x0c1d('0x19')]=function(_0x40eff8){var _0x333c9e=this;return new Promise(function(_0x208cb2,_0xbf01ca){return db[_0x0c1d('0x1a')][_0x0c1d('0x1b')]({'raw':_0x40eff8[_0x0c1d('0x1c')]?_0x40eff8[_0x0c1d('0x1c')][_0x0c1d('0x1d')]===undefined?!![]:![]:!![],'where':_0x40eff8['options']?_0x40eff8[_0x0c1d('0x1c')]['where']||null:null,'attributes':_0x40eff8[_0x0c1d('0x1c')]?_0x40eff8[_0x0c1d('0x1c')][_0x0c1d('0x1e')]||null:null,'limit':_0x40eff8[_0x0c1d('0x1c')]?_0x40eff8[_0x0c1d('0x1c')][_0x0c1d('0x1f')]||null:null,'include':_0x40eff8['options']?_0x40eff8[_0x0c1d('0x1c')][_0x0c1d('0x20')]?_[_0x0c1d('0x21')](_0x40eff8[_0x0c1d('0x1c')][_0x0c1d('0x20')],function(_0x42119d){return{'model':db[_0x42119d[_0x0c1d('0x22')]],'as':_0x42119d['as'],'attributes':_0x42119d['attributes'],'include':_0x42119d[_0x0c1d('0x20')]?_[_0x0c1d('0x21')](_0x42119d[_0x0c1d('0x20')],function(_0x5200a3){return{'model':db[_0x5200a3[_0x0c1d('0x22')]],'as':_0x5200a3['as'],'attributes':_0x5200a3[_0x0c1d('0x1e')],'include':_0x5200a3[_0x0c1d('0x20')]?_[_0x0c1d('0x21')](_0x5200a3[_0x0c1d('0x20')],function(_0x3e8454){return{'model':db[_0x3e8454[_0x0c1d('0x22')]],'as':_0x3e8454['as'],'attributes':_0x3e8454[_0x0c1d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0c1d('0xe')](function(_0x505836){logger[_0x0c1d('0xf')]('GetMailAccount',_0x40eff8);logger[_0x0c1d('0x12')]('GetMailAccount',_0x40eff8,JSON[_0x0c1d('0x14')](_0x505836));_0x208cb2(_0x505836);})['catch'](function(_0x58d141){logger[_0x0c1d('0x15')](_0x0c1d('0x19'),_0x58d141[_0x0c1d('0x17')],_0x40eff8);_0xbf01ca(_0x333c9e[_0x0c1d('0x15')](0x1f4,_0x58d141[_0x0c1d('0x17')]));});});};exports[_0x0c1d('0x23')]=function(_0x466632){var _0x341b45=this;return new Promise(function(_0x5bdae4,_0x59eb28){return db[_0x0c1d('0x1a')][_0x0c1d('0x24')]({'raw':_0x466632[_0x0c1d('0x1c')]?_0x466632[_0x0c1d('0x1c')][_0x0c1d('0x1d')]===undefined?!![]:![]:!![],'where':_0x466632[_0x0c1d('0x1c')]?_0x466632[_0x0c1d('0x1c')][_0x0c1d('0x25')]||null:null,'attributes':_0x466632[_0x0c1d('0x1c')]?_0x466632[_0x0c1d('0x1c')][_0x0c1d('0x1e')]||null:null,'include':_0x466632[_0x0c1d('0x1c')]?_0x466632[_0x0c1d('0x1c')][_0x0c1d('0x20')]?_[_0x0c1d('0x21')](_0x466632[_0x0c1d('0x1c')][_0x0c1d('0x20')],function(_0x24ed30){return{'model':db[_0x24ed30[_0x0c1d('0x22')]],'as':_0x24ed30['as'],'attributes':_0x24ed30[_0x0c1d('0x1e')],'include':_0x24ed30[_0x0c1d('0x20')]?_[_0x0c1d('0x21')](_0x24ed30[_0x0c1d('0x20')],function(_0x388a80){return{'model':db[_0x388a80['model']],'as':_0x388a80['as'],'attributes':_0x388a80['attributes'],'include':_0x388a80[_0x0c1d('0x20')]?_['map'](_0x388a80[_0x0c1d('0x20')],function(_0x4e7518){return{'model':db[_0x4e7518[_0x0c1d('0x22')]],'as':_0x4e7518['as'],'attributes':_0x4e7518[_0x0c1d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0c1d('0xe')](function(_0x9098a4){logger[_0x0c1d('0xf')](_0x0c1d('0x23'),_0x466632);logger[_0x0c1d('0x12')](_0x0c1d('0x23'),_0x466632,JSON[_0x0c1d('0x14')](_0x9098a4));_0x5bdae4(_0x9098a4);})[_0x0c1d('0x18')](function(_0x2391d8){logger[_0x0c1d('0x15')]('ShowMailAccount',_0x2391d8['message'],_0x466632);_0x59eb28(_0x341b45['error'](0x1f4,_0x2391d8[_0x0c1d('0x17')]));});});};exports[_0x0c1d('0x26')]=function(_0x275e97){var _0x367c70=this;return new Promise(function(_0x16c052,_0x3c8624){var _0x48d37e={'body':_0x275e97[_0x0c1d('0x27')],'channel':_0x0c1d('0x28')};var _0x205d4a=_[_0x0c1d('0x29')](_[_0x0c1d('0x2a')](db[_0x0c1d('0x2b')]['rawAttributes']),[_0x0c1d('0x2c'),_0x0c1d('0x2d'),_0x0c1d('0x2e'),_0x0c1d('0x2f')]);var _0x12653f=![];if(_0x275e97[_0x0c1d('0x27')]['id']){delete _0x275e97[_0x0c1d('0x27')]['id'];}if(_[_0x0c1d('0x30')](_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x31')])){return _0x3c8624(_0x367c70['error'](0x1f4,_0x0c1d('0x32')));}if(_[_0x0c1d('0x30')](_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x27')])||_0x275e97[_0x0c1d('0x27')]['body']===''){return _0x3c8624(_0x367c70[_0x0c1d('0x15')](0x1f4,_0x0c1d('0x33')));}if(_[_0x0c1d('0x30')](_0x275e97['body'][_0x0c1d('0x34')])){return _0x3c8624(_0x367c70[_0x0c1d('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x205d4a));}if(!_[_0x0c1d('0x35')](_0x205d4a,_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x34')])){return _0x3c8624(_0x367c70[_0x0c1d('0x15')](0x1f4,_0x0c1d('0x36')+_0x205d4a));}var _0x53de63={};_0x53de63[_0x275e97['body']['mapKey']]=_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x31')];return db['MailAccount'][_0x0c1d('0x24')]({'where':{'id':_0x275e97[_0x0c1d('0x37')]['id']},'include':[{'model':db[_0x0c1d('0x38')],'as':_0x0c1d('0x39'),'include':[{'model':db[_0x0c1d('0x2b')],'as':'Contacts','where':_0x53de63,'limit':0x1,'order':[[_0x0c1d('0x2d'),_0x0c1d('0x3a')]]}]},{'model':db[_0x0c1d('0x3b')],'as':_0x0c1d('0x3c')},{'model':db['MailServerOut'],'as':_0x0c1d('0x3d')}]})[_0x0c1d('0xe')](function(_0x223b4c){if(_0x223b4c&&_0x223b4c[_0x0c1d('0x39')]){var _0x59180c=_0x223b4c[_0x0c1d('0x3e')]({'plain':!![]});_0x48d37e[_0x0c1d('0x37')]=_[_0x0c1d('0x3f')](_0x59180c,['Applications','List']);_0x48d37e[_0x0c1d('0x40')]=_0x59180c['Applications'];_0x48d37e[_0x0c1d('0x41')]=_0x59180c[_0x0c1d('0x39')];_0x48d37e[_0x0c1d('0x40')]=_[_0x0c1d('0x42')](_0x48d37e[_0x0c1d('0x40')],[_0x0c1d('0x43')],[_0x0c1d('0x44')]);if(_0x48d37e[_0x0c1d('0x37')]&&_0x48d37e['account'][_0x0c1d('0x45')]){_0x48d37e[_0x0c1d('0x40')][_0x0c1d('0x46')]({'id':0x0,'priority':_0x48d37e[_0x0c1d('0x40')][_0x0c1d('0x47')]+0x1,'app':'close','appdata':_0x0c1d('0x45'),'interval':'*,*,*,*'});}if(_0x48d37e[_0x0c1d('0x37')]['Applications']){delete _0x48d37e['account'][_0x0c1d('0x3c')];}if(_0x48d37e[_0x0c1d('0x37')]['List']){delete _0x48d37e['account'][_0x0c1d('0x39')];}if(_0x59180c[_0x0c1d('0x39')][_0x0c1d('0x48')]['length']){return _0x59180c['List'][_0x0c1d('0x48')][0x0];}var _0x2234fc=_[_0x0c1d('0x49')](_0x275e97[_0x0c1d('0x27')],{'firstName':_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x31')],'ListId':_0x59180c[_0x0c1d('0x2f')]});_0x2234fc[_0x275e97['body']['mapKey']]=_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x31')];return db['CmContact'][_0x0c1d('0x4a')](_0x2234fc);}else{throw new Error(_0x0c1d('0x4b'));}})[_0x0c1d('0xe')](function(_0xb90349){_0x48d37e[_0x0c1d('0x4c')]=_0xb90349;if(_0xb90349){if(!_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')][_0x0c1d('0x4d')]){_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')][_0x0c1d('0x4d')]=rs[_0x0c1d('0x4e')]()+'\x20'+_0x275e97['body'][_0x0c1d('0x17')][_0x0c1d('0x31')];}var _0x339a11={'ContactId':_0xb90349['id'],'MailAccountId':_0x275e97['account']['id'],'inReplyTo':_0x275e97['body']['message'][_0x0c1d('0x4d')],'to':_0x275e97[_0x0c1d('0x27')]['message'][_0x0c1d('0x31')],'cc':_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')]['cc'],'subject':_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')][_0x0c1d('0x4f')],'attach':_0x275e97['body'][_0x0c1d('0x17')][_0x0c1d('0x50')],'lastMsgAt':moment()[_0x0c1d('0x51')](_0x0c1d('0x52')),'lastMsgDirection':'in'};return db[_0x0c1d('0x53')]['find']({'where':{'closed':![],'MailAccountId':_0x275e97[_0x0c1d('0x37')]['id']},'include':[{'model':db[_0x0c1d('0x54')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')]['inReplyTo']}}]})[_0x0c1d('0xe')](function(_0xaf1322){if(_0xaf1322){return[_0xaf1322,![]];}return db['MailInteraction']['create'](_0x339a11)[_0x0c1d('0xe')](function(_0x32cf03){return[_0x32cf03,!![]];});});}else{throw new Error(_0x0c1d('0x55'));}})[_0x0c1d('0x56')](function(_0x14bf4c,_0x34761d){if(_0x14bf4c){_0x12653f=_0x34761d;if(!_0x34761d){return _0x14bf4c['update']({'inReplyTo':_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')][_0x0c1d('0x4d')],'to':_0x275e97[_0x0c1d('0x27')]['message'][_0x0c1d('0x31')],'cc':_0x275e97[_0x0c1d('0x27')]['message']['cc'],'subject':_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')][_0x0c1d('0x4f')],'attach':_0x14bf4c[_0x0c1d('0x50')]?_0x14bf4c[_0x0c1d('0x50')]:_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')][_0x0c1d('0x50')],'substatus':null,'substatusAt':moment()['format'](_0x0c1d('0x52')),'lastMsgAt':moment()[_0x0c1d('0x51')](_0x0c1d('0x52')),'lastMsgDirection':'in'});}else{return _0x14bf4c;}}})[_0x0c1d('0xe')](function(_0x1d13ae){_0x48d37e[_0x0c1d('0x57')]=_0x1d13ae[_0x0c1d('0x3e')]({'plain':!![]});_0x48d37e[_0x0c1d('0x57')][_0x0c1d('0x58')]=_0x12653f;return db['MailMessage'][_0x0c1d('0x4a')]({'body':_0x275e97[_0x0c1d('0x27')]['body'],'MailAccountId':_0x275e97[_0x0c1d('0x37')]['id'],'MailInteractionId':_0x1d13ae['id'],'direction':'in','ContactId':_0x48d37e[_0x0c1d('0x4c')]['id'],'messageId':_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')][_0x0c1d('0x4d')],'from':_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')]['from'],'to':_0x275e97[_0x0c1d('0x27')]['message']['to'],'cc':_0x275e97['body'][_0x0c1d('0x17')]['cc'],'subject':_0x275e97['body'][_0x0c1d('0x17')][_0x0c1d('0x4f')],'attach':_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')][_0x0c1d('0x50')],'Attachments':_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')]['attachments'],'originTo':_0x275e97[_0x0c1d('0x27')]['message'][_0x0c1d('0x59')],'originCc':_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')][_0x0c1d('0x5a')],'bcc':_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')]['bcc'],'ChatWebsiteId':_0x275e97['body']['message'][_0x0c1d('0x5b')]||null,'originChannel':_0x275e97[_0x0c1d('0x27')][_0x0c1d('0x17')][_0x0c1d('0x5c')]||_0x0c1d('0x5d'),'ChatOfflineMessageId':_0x275e97['body']['message'][_0x0c1d('0x5e')]||null},{'include':[{'model':db[_0x0c1d('0x5f')],'as':'Attachments'}]});})['then'](function(_0x37ac19){_0x48d37e[_0x0c1d('0x17')]=_0x37ac19;if(_0x48d37e['interaction'][_0x0c1d('0x60')]){return db[_0x0c1d('0x61')][_0x0c1d('0x24')]({'attributes':['id',_0x0c1d('0x62')],'where':{'id':_0x48d37e[_0x0c1d('0x57')][_0x0c1d('0x60')]}})['then'](function(_0x5782fe){if(_0x5782fe){_0x48d37e[_0x0c1d('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0c1d('0x63'),'appdata':_0x5782fe[_0x0c1d('0x62')]+','+(_0x48d37e[_0x0c1d('0x37')][_0x0c1d('0x64')]||0xa),'interval':_0x0c1d('0x65')});}return respondWithRpcPromise(_0x0c1d('0x66'),_0x0c1d('0x67'),_0x48d37e);});}return respondWithRpcPromise(_0x0c1d('0x66'),'startRouting',_0x48d37e);})[_0x0c1d('0xe')](function(_0xbcbe6){_0x16c052(_0xbcbe6);})[_0x0c1d('0x18')](function(_0x5f24e2){_0x3c8624(_0x367c70[_0x0c1d('0x15')](0x1f4,_0x5f24e2[_0x0c1d('0x17')]));});});}; \ No newline at end of file +var _0x3316=['Applications','List','get','omit','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','spread','update','format','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','Attachments','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowMailAccount','find','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','body','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','account','Contacts','DESC'];(function(_0x2fa393,_0x57e26d){var _0x15a4fb=function(_0x2a8eb9){while(--_0x2a8eb9){_0x2fa393['push'](_0x2fa393['shift']());}};_0x15a4fb(++_0x57e26d);}(_0x3316,0x16c));var _0x6331=function(_0x4024a8,_0x24792b){_0x4024a8=_0x4024a8-0x0;var _0x4d7178=_0x3316[_0x4024a8];return _0x4d7178;};'use strict';var _=require(_0x6331('0x0'));var util=require(_0x6331('0x1'));var moment=require('moment');var BPromise=require(_0x6331('0x2'));var rs=require(_0x6331('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6331('0x4'))['db'];var utils=require(_0x6331('0x5'));var logger=require(_0x6331('0x6'))(_0x6331('0x7'));var config=require(_0x6331('0x8'));var jayson=require(_0x6331('0x9'));var client=jayson[_0x6331('0xa')][_0x6331('0xb')]({'port':0x232c});config['redis']=_[_0x6331('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6331('0xd'))(new Redis(config[_0x6331('0xe')]));require(_0x6331('0xf'))[_0x6331('0x10')](socket);function respondWithRpcPromise(_0x42a17e,_0x13e12c,_0x29906f){return new BPromise(function(_0x510ab0,_0x43f275){return client[_0x6331('0x11')](_0x42a17e,_0x29906f)[_0x6331('0x12')](function(_0x57787f){logger['info'](_0x6331('0x13'),_0x13e12c,_0x6331('0x14'));logger[_0x6331('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x13e12c,_0x6331('0x14'),JSON[_0x6331('0x16')](_0x57787f));if(_0x57787f[_0x6331('0x17')]){if(_0x57787f[_0x6331('0x17')][_0x6331('0x18')]===0x1f4){logger[_0x6331('0x17')]('MailAccount,\x20%s,\x20%s',_0x13e12c,_0x57787f['error']['message']);return _0x43f275(_0x57787f['error'][_0x6331('0x19')]);}logger[_0x6331('0x17')](_0x6331('0x13'),_0x13e12c,_0x57787f[_0x6331('0x17')]['message']);return _0x510ab0(_0x57787f[_0x6331('0x17')][_0x6331('0x19')]);}else{logger[_0x6331('0x1a')](_0x6331('0x13'),_0x13e12c,_0x6331('0x14'));_0x510ab0(_0x57787f[_0x6331('0x1b')][_0x6331('0x19')]);}})['catch'](function(_0x38ca0a){logger['error'](_0x6331('0x13'),_0x13e12c,_0x38ca0a);_0x43f275(_0x38ca0a);});});}exports[_0x6331('0x1c')]=function(_0x68e1bf){var _0x3c8a37=this;return new Promise(function(_0x2bd36f,_0x3287b5){return db[_0x6331('0x1d')][_0x6331('0x1e')]({'raw':_0x68e1bf['options']?_0x68e1bf[_0x6331('0x1f')][_0x6331('0x20')]===undefined?!![]:![]:!![],'where':_0x68e1bf[_0x6331('0x1f')]?_0x68e1bf[_0x6331('0x1f')][_0x6331('0x21')]||null:null,'attributes':_0x68e1bf[_0x6331('0x1f')]?_0x68e1bf[_0x6331('0x1f')][_0x6331('0x22')]||null:null,'limit':_0x68e1bf[_0x6331('0x1f')]?_0x68e1bf['options'][_0x6331('0x23')]||null:null,'include':_0x68e1bf[_0x6331('0x1f')]?_0x68e1bf[_0x6331('0x1f')][_0x6331('0x24')]?_[_0x6331('0x25')](_0x68e1bf['options']['include'],function(_0x129ebb){return{'model':db[_0x129ebb[_0x6331('0x26')]],'as':_0x129ebb['as'],'attributes':_0x129ebb[_0x6331('0x22')],'include':_0x129ebb[_0x6331('0x24')]?_[_0x6331('0x25')](_0x129ebb['include'],function(_0xd4c3a3){return{'model':db[_0xd4c3a3[_0x6331('0x26')]],'as':_0xd4c3a3['as'],'attributes':_0xd4c3a3[_0x6331('0x22')],'include':_0xd4c3a3[_0x6331('0x24')]?_[_0x6331('0x25')](_0xd4c3a3[_0x6331('0x24')],function(_0x61c725){return{'model':db[_0x61c725['model']],'as':_0x61c725['as'],'attributes':_0x61c725[_0x6331('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f8fc3){logger[_0x6331('0x1a')](_0x6331('0x1c'),_0x68e1bf);logger[_0x6331('0x15')]('GetMailAccount',_0x68e1bf,JSON[_0x6331('0x16')](_0x3f8fc3));_0x2bd36f(_0x3f8fc3);})[_0x6331('0x27')](function(_0x195d8d){logger[_0x6331('0x17')](_0x6331('0x1c'),_0x195d8d[_0x6331('0x19')],_0x68e1bf);_0x3287b5(_0x3c8a37[_0x6331('0x17')](0x1f4,_0x195d8d[_0x6331('0x19')]));});});};exports[_0x6331('0x28')]=function(_0x404509){var _0x4ea71f=this;return new Promise(function(_0x41f513,_0x515f5a){return db[_0x6331('0x1d')][_0x6331('0x29')]({'raw':_0x404509['options']?_0x404509[_0x6331('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x404509[_0x6331('0x1f')]?_0x404509[_0x6331('0x1f')][_0x6331('0x21')]||null:null,'attributes':_0x404509[_0x6331('0x1f')]?_0x404509[_0x6331('0x1f')][_0x6331('0x22')]||null:null,'include':_0x404509[_0x6331('0x1f')]?_0x404509[_0x6331('0x1f')][_0x6331('0x24')]?_['map'](_0x404509[_0x6331('0x1f')][_0x6331('0x24')],function(_0x111b13){return{'model':db[_0x111b13[_0x6331('0x26')]],'as':_0x111b13['as'],'attributes':_0x111b13[_0x6331('0x22')],'include':_0x111b13['include']?_[_0x6331('0x25')](_0x111b13[_0x6331('0x24')],function(_0x473204){return{'model':db[_0x473204[_0x6331('0x26')]],'as':_0x473204['as'],'attributes':_0x473204['attributes'],'include':_0x473204[_0x6331('0x24')]?_[_0x6331('0x25')](_0x473204['include'],function(_0x9a77b8){return{'model':db[_0x9a77b8['model']],'as':_0x9a77b8['as'],'attributes':_0x9a77b8[_0x6331('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50d93a){logger[_0x6331('0x1a')](_0x6331('0x28'),_0x404509);logger[_0x6331('0x15')](_0x6331('0x28'),_0x404509,JSON[_0x6331('0x16')](_0x50d93a));_0x41f513(_0x50d93a);})[_0x6331('0x27')](function(_0x1ab311){logger[_0x6331('0x17')](_0x6331('0x28'),_0x1ab311['message'],_0x404509);_0x515f5a(_0x4ea71f[_0x6331('0x17')](0x1f4,_0x1ab311['message']));});});};exports[_0x6331('0x2a')]=function(_0x74999a){var _0x18a6c3=this;return new Promise(function(_0x18f368,_0x19982f){var _0x50eb9b={'body':_0x74999a['body'],'channel':_0x6331('0x2b')};var _0x3f8f76=_[_0x6331('0x2c')](_[_0x6331('0x2d')](db[_0x6331('0x2e')][_0x6331('0x2f')]),[_0x6331('0x30'),_0x6331('0x31'),_0x6331('0x32'),_0x6331('0x33')]);var _0x59cd18=![];if(_0x74999a['body']['id']){delete _0x74999a['body']['id'];}if(_[_0x6331('0x34')](_0x74999a[_0x6331('0x35')]['from'])){return _0x19982f(_0x18a6c3[_0x6331('0x17')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x74999a[_0x6331('0x35')][_0x6331('0x35')])||_0x74999a[_0x6331('0x35')][_0x6331('0x35')]===''){return _0x19982f(_0x18a6c3['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x6331('0x34')](_0x74999a['body']['mapKey'])){return _0x19982f(_0x18a6c3[_0x6331('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3f8f76));}if(!_['includes'](_0x3f8f76,_0x74999a[_0x6331('0x35')]['mapKey'])){return _0x19982f(_0x18a6c3['error'](0x1f4,_0x6331('0x36')+_0x3f8f76));}var _0x33e548={};_0x33e548[_0x74999a[_0x6331('0x35')][_0x6331('0x37')]]=_0x74999a[_0x6331('0x35')][_0x6331('0x38')];return db[_0x6331('0x1d')][_0x6331('0x29')]({'where':{'id':_0x74999a[_0x6331('0x39')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x6331('0x3a'),'where':_0x33e548,'limit':0x1,'order':[[_0x6331('0x31'),_0x6331('0x3b')]]}]},{'model':db['MailApplication'],'as':_0x6331('0x3c')},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x6331('0x12')](function(_0x4ce311){if(_0x4ce311&&_0x4ce311[_0x6331('0x3d')]){var _0x26dde7=_0x4ce311[_0x6331('0x3e')]({'plain':!![]});_0x50eb9b['account']=_[_0x6331('0x3f')](_0x26dde7,[_0x6331('0x3c'),_0x6331('0x3d')]);_0x50eb9b[_0x6331('0x40')]=_0x26dde7[_0x6331('0x3c')];_0x50eb9b[_0x6331('0x41')]=_0x26dde7['List'];_0x50eb9b[_0x6331('0x40')]=_[_0x6331('0x42')](_0x50eb9b[_0x6331('0x40')],[_0x6331('0x43')],[_0x6331('0x44')]);if(_0x50eb9b['account']&&_0x50eb9b[_0x6331('0x39')][_0x6331('0x45')]){_0x50eb9b[_0x6331('0x40')][_0x6331('0x46')]({'id':0x0,'priority':_0x50eb9b['applications'][_0x6331('0x47')]+0x1,'app':_0x6331('0x48'),'appdata':_0x6331('0x45'),'interval':_0x6331('0x49')});}if(_0x50eb9b[_0x6331('0x39')][_0x6331('0x3c')]){delete _0x50eb9b[_0x6331('0x39')][_0x6331('0x3c')];}if(_0x50eb9b[_0x6331('0x39')][_0x6331('0x3d')]){delete _0x50eb9b['account']['List'];}if(_0x26dde7[_0x6331('0x3d')]['Contacts'][_0x6331('0x47')]){return _0x26dde7['List']['Contacts'][0x0];}var _0x5b6be9=_[_0x6331('0xc')](_0x74999a[_0x6331('0x35')],{'firstName':_0x74999a[_0x6331('0x35')][_0x6331('0x38')],'ListId':_0x26dde7[_0x6331('0x33')]});_0x5b6be9[_0x74999a['body'][_0x6331('0x37')]]=_0x74999a[_0x6331('0x35')][_0x6331('0x38')];return db['CmContact'][_0x6331('0x4a')](_0x5b6be9);}else{throw new Error(_0x6331('0x4b'));}})['then'](function(_0xe6f3f0){_0x50eb9b['contact']=_0xe6f3f0;if(_0xe6f3f0){if(!_0x74999a[_0x6331('0x35')]['message'][_0x6331('0x4c')]){_0x74999a['body']['message'][_0x6331('0x4c')]=rs[_0x6331('0x4d')]()+'\x20'+_0x74999a[_0x6331('0x35')]['message']['from'];}var _0x36eae4={'ContactId':_0xe6f3f0['id'],'MailAccountId':_0x74999a['account']['id'],'inReplyTo':_0x74999a[_0x6331('0x35')][_0x6331('0x19')][_0x6331('0x4c')],'to':_0x74999a[_0x6331('0x35')][_0x6331('0x19')][_0x6331('0x38')],'cc':_0x74999a[_0x6331('0x35')][_0x6331('0x19')]['cc'],'subject':_0x74999a['body'][_0x6331('0x19')][_0x6331('0x4e')],'attach':_0x74999a['body']['message'][_0x6331('0x4f')],'lastMsgAt':moment()['format'](_0x6331('0x50')),'lastMsgDirection':'in'};return db[_0x6331('0x51')][_0x6331('0x29')]({'where':{'closed':![],'MailAccountId':_0x74999a[_0x6331('0x39')]['id']},'include':[{'model':db[_0x6331('0x52')],'as':_0x6331('0x53'),'attributes':[_0x6331('0x4c')],'where':{'messageId':_0x74999a['body'][_0x6331('0x19')]['inReplyTo']}}]})[_0x6331('0x12')](function(_0x11d710){if(_0x11d710){return[_0x11d710,![]];}return db['MailInteraction'][_0x6331('0x4a')](_0x36eae4)['then'](function(_0x15315c){return[_0x15315c,!![]];});});}else{throw new Error(_0x6331('0x54'));}})[_0x6331('0x55')](function(_0x460044,_0x65cd86){if(_0x460044){_0x59cd18=_0x65cd86;if(!_0x65cd86){return _0x460044[_0x6331('0x56')]({'inReplyTo':_0x74999a[_0x6331('0x35')][_0x6331('0x19')][_0x6331('0x4c')],'to':_0x74999a[_0x6331('0x35')][_0x6331('0x19')][_0x6331('0x38')],'cc':_0x74999a[_0x6331('0x35')]['message']['cc'],'subject':_0x74999a[_0x6331('0x35')][_0x6331('0x19')][_0x6331('0x4e')],'attach':_0x460044[_0x6331('0x4f')]?_0x460044[_0x6331('0x4f')]:_0x74999a[_0x6331('0x35')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0x6331('0x57')](_0x6331('0x50')),'lastMsgAt':moment()[_0x6331('0x57')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x460044;}}})[_0x6331('0x12')](function(_0x4357c0){_0x50eb9b[_0x6331('0x58')]=_0x4357c0[_0x6331('0x3e')]({'plain':!![]});_0x50eb9b[_0x6331('0x58')][_0x6331('0x59')]=_0x59cd18;return db['MailMessage'][_0x6331('0x4a')]({'body':_0x74999a['body'][_0x6331('0x35')],'MailAccountId':_0x74999a[_0x6331('0x39')]['id'],'MailInteractionId':_0x4357c0['id'],'direction':'in','ContactId':_0x50eb9b[_0x6331('0x5a')]['id'],'messageId':_0x74999a['body'][_0x6331('0x19')][_0x6331('0x4c')],'from':_0x74999a[_0x6331('0x35')][_0x6331('0x19')][_0x6331('0x38')],'to':_0x74999a[_0x6331('0x35')]['message']['to'],'cc':_0x74999a[_0x6331('0x35')][_0x6331('0x19')]['cc'],'subject':_0x74999a[_0x6331('0x35')]['message'][_0x6331('0x4e')],'attach':_0x74999a[_0x6331('0x35')][_0x6331('0x19')][_0x6331('0x4f')],'Attachments':_0x74999a[_0x6331('0x35')][_0x6331('0x19')][_0x6331('0x5b')],'originTo':_0x74999a['body'][_0x6331('0x19')][_0x6331('0x5c')],'originCc':_0x74999a[_0x6331('0x35')][_0x6331('0x19')][_0x6331('0x5d')],'bcc':_0x74999a['body'][_0x6331('0x19')][_0x6331('0x5e')],'ChatWebsiteId':_0x74999a['body']['message'][_0x6331('0x5f')]||null,'originChannel':_0x74999a[_0x6331('0x35')][_0x6331('0x19')]['originChannel']||_0x6331('0x60'),'ChatOfflineMessageId':_0x74999a[_0x6331('0x35')][_0x6331('0x19')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0x6331('0x61')}]});})[_0x6331('0x12')](function(_0x32e626){_0x50eb9b['message']=_0x32e626;if(_0x50eb9b[_0x6331('0x58')]['UserId']){return db[_0x6331('0x62')][_0x6331('0x29')]({'attributes':['id',_0x6331('0x63')],'where':{'id':_0x50eb9b[_0x6331('0x58')][_0x6331('0x64')]}})[_0x6331('0x12')](function(_0x2038ac){if(_0x2038ac){_0x50eb9b['applications'][_0x6331('0x65')]({'id':0x0,'priority':0x0,'app':_0x6331('0x66'),'appdata':_0x2038ac[_0x6331('0x63')]+','+(_0x50eb9b['account'][_0x6331('0x67')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x50eb9b);});}return respondWithRpcPromise(_0x6331('0x68'),_0x6331('0x69'),_0x50eb9b);})[_0x6331('0x12')](function(_0x491d31){_0x18f368(_0x491d31);})[_0x6331('0x27')](function(_0x39ec75){_0x19982f(_0x18a6c3[_0x6331('0x17')](0x1f4,_0x39ec75[_0x6331('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 2acc5c0..4ead90e 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 _0x2dc3=['mailAccount:','save','remove','update','emit','register','length'];(function(_0x10da23,_0x5869d4){var _0x5f0fe7=function(_0x49e1b3){while(--_0x49e1b3){_0x10da23['push'](_0x10da23['shift']());}};_0x5f0fe7(++_0x5869d4);}(_0x2dc3,0x127));var _0x32dc=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x2dc3[_0x6131cd];return _0x47e916;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x32dc('0x0'),_0x32dc('0x1'),_0x32dc('0x2')];function createListener(_0x25b524,_0x2f8a4c){return function(_0x597050){_0x2f8a4c[_0x32dc('0x3')](_0x25b524,_0x597050);};}function removeListener(_0x15c3f6,_0x53b74c){return function(){MailAccountEvents['removeListener'](_0x15c3f6,_0x53b74c);};}exports[_0x32dc('0x4')]=function(_0x58b6ba){for(var _0x1f59d3=0x0,_0x52336b=events[_0x32dc('0x5')];_0x1f59d3<_0x52336b;_0x1f59d3++){var _0x491a56=events[_0x1f59d3];var _0x49c416=createListener(_0x32dc('0x6')+_0x491a56,_0x58b6ba);MailAccountEvents['on'](_0x491a56,_0x49c416);}}; \ No newline at end of file +var _0x13fe=['update','emit','removeListener','register','./mailAccount.events','save','remove'];(function(_0x47f9d1,_0x3f9922){var _0x3fe0b7=function(_0x1add18){while(--_0x1add18){_0x47f9d1['push'](_0x47f9d1['shift']());}};_0x3fe0b7(++_0x3f9922);}(_0x13fe,0x138));var _0xe13f=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x13fe[_0x13ea00];return _0x1f7347;};'use strict';var MailAccountEvents=require(_0xe13f('0x0'));var events=[_0xe13f('0x1'),_0xe13f('0x2'),_0xe13f('0x3')];function createListener(_0x329355,_0x2efd00){return function(_0x5f0bd1){_0x2efd00[_0xe13f('0x4')](_0x329355,_0x5f0bd1);};}function removeListener(_0x466eee,_0x19c559){return function(){MailAccountEvents[_0xe13f('0x5')](_0x466eee,_0x19c559);};}exports[_0xe13f('0x6')]=function(_0x1ddbff){for(var _0x2832ce=0x0,_0x594e3b=events['length'];_0x2832ce<_0x594e3b;_0x2832ce++){var _0x1b237d=events[_0x2832ce];var _0x39a413=createListener('mailAccount:'+_0x1b237d,_0x1ddbff);MailAccountEvents['on'](_0x1b237d,_0x39a413);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 5857f03..cb0ed72 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 _0x2ef3=['/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','show','put'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x2ef3,0xba));var _0x32ef=function(_0x104324,_0x4e3dc9){_0x104324=_0x104324-0x0;var _0x2ed30a=_0x2ef3[_0x104324];return _0x2ed30a;};'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 fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0xc'),auth[_0x32ef('0xd')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')](_0x32ef('0xc'),auth[_0x32ef('0xd')](),controller[_0x32ef('0x10')]);module[_0x32ef('0x11')]=router; \ No newline at end of file +var _0x1261=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','/:id','update','delete','destroy'];(function(_0x5524a4,_0x335747){var _0x53469d=function(_0x470184){while(--_0x470184){_0x5524a4['push'](_0x5524a4['shift']());}};_0x53469d(++_0x335747);}(_0x1261,0x144));var _0x1126=function(_0x591781,_0x8e0ed2){_0x591781=_0x591781-0x0;var _0x315bd9=_0x1261[_0x591781];return _0x315bd9;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/:id',auth[_0x1126('0xa')](),controller[_0x1126('0xb')]);router['put'](_0x1126('0xc'),auth[_0x1126('0xa')](),controller[_0x1126('0xd')]);router[_0x1126('0xe')](_0x1126('0xc'),auth['isAuthenticated'](),controller[_0x1126('0xf')]);module[_0x1126('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 185433d..2e4435a 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 _0x3566=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x5ed85c,_0x3de2b4){var _0x2b3917=function(_0x487356){while(--_0x487356){_0x5ed85c['push'](_0x5ed85c['shift']());}};_0x2b3917(++_0x3de2b4);}(_0x3566,0x96));var _0x6356=function(_0x37f0dc,_0x3725b4){_0x37f0dc=_0x37f0dc-0x0;var _0x495d5f=_0x3566[_0x37f0dc];return _0x495d5f;};'use strict';var Sequelize=require(_0x6356('0x0'));module[_0x6356('0x1')]={'priority':{'type':Sequelize[_0x6356('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6356('0x3')],'allowNull':![],'defaultValue':_0x6356('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6356('0x3')]},'interval':{'type':Sequelize[_0x6356('0x3')],'defaultValue':_0x6356('0x5')}}; \ No newline at end of file +var _0xe07e=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xe07e,0xdd));var _0xee07=function(_0x57966a,_0x477964){_0x57966a=_0x57966a-0x0;var _0x191765=_0xe07e[_0x57966a];return _0x191765;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xee07('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xee07('0x1')],'allowNull':![],'defaultValue':_0xee07('0x2')},'appdata':{'type':Sequelize[_0xee07('0x3')]()},'description':{'type':Sequelize[_0xee07('0x1')]},'interval':{'type':Sequelize[_0xee07('0x1')],'defaultValue':_0xee07('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index b40af44..6b99636 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 _0xae93=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','error','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','attributes','fields','includeAll','include','merge','catch','body','find','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils'];(function(_0x188da4,_0x3e71a3){var _0x40a756=function(_0x584fd8){while(--_0x584fd8){_0x188da4['push'](_0x188da4['shift']());}};_0x40a756(++_0x3e71a3);}(_0xae93,0x131));var _0x3ae9=function(_0x18af8f,_0x35926f){_0x18af8f=_0x18af8f-0x0;var _0x41e9c9=_0xae93[_0x18af8f];return _0x41e9c9;};'use strict';var emlformat=require(_0x3ae9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3ae9('0x1'));var rp=require(_0x3ae9('0x2'));var moment=require(_0x3ae9('0x3'));var BPromise=require(_0x3ae9('0x4'));var Mustache=require(_0x3ae9('0x5'));var util=require('util');var path=require(_0x3ae9('0x6'));var sox=require(_0x3ae9('0x7'));var csv=require(_0x3ae9('0x8'));var ejs=require(_0x3ae9('0x9'));var fs=require('fs');var fs_extra=require(_0x3ae9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3ae9('0xb'));var jsforce=require(_0x3ae9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3ae9('0x8'));var querystring=require(_0x3ae9('0xd'));var Papa=require(_0x3ae9('0xe'));var Redis=require('ioredis');var authService=require(_0x3ae9('0xf'));var qs=require(_0x3ae9('0x10'));var as=require(_0x3ae9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x3ae9('0x12'));var config=require(_0x3ae9('0x13'));var licenseUtil=require(_0x3ae9('0x14'));var db=require(_0x3ae9('0x15'))['db'];function respondWithStatusCode(_0xfafd4,_0x34975f){_0x34975f=_0x34975f||0xcc;return function(_0x50c7b7){if(_0x50c7b7){return _0xfafd4[_0x3ae9('0x16')](_0x34975f);}return _0xfafd4['status'](_0x34975f)['end']();};}function respondWithResult(_0x2b58fa,_0x1a8b78){_0x1a8b78=_0x1a8b78||0xc8;return function(_0x17272e){if(_0x17272e){return _0x2b58fa[_0x3ae9('0x17')](_0x1a8b78)[_0x3ae9('0x18')](_0x17272e);}};}function respondWithFilteredResult(_0x1b601d,_0x343168){return function(_0x6c1f8d){if(_0x6c1f8d){var _0xb34b3a=typeof _0x343168[_0x3ae9('0x19')]===_0x3ae9('0x1a')&&typeof _0x343168[_0x3ae9('0x1b')]===_0x3ae9('0x1a');var _0x1dbdc9=_0x6c1f8d[_0x3ae9('0x1c')];var _0x305eb7=_0xb34b3a?0x0:_0x343168[_0x3ae9('0x19')];var _0x27573d=_0xb34b3a?_0x6c1f8d[_0x3ae9('0x1c')]:_0x343168[_0x3ae9('0x19')]+_0x343168[_0x3ae9('0x1b')];var _0x23cc77;if(_0x27573d>=_0x1dbdc9){_0x27573d=_0x1dbdc9;_0x23cc77=0xc8;}else{_0x23cc77=0xce;}_0x1b601d[_0x3ae9('0x17')](_0x23cc77);return _0x1b601d['set'](_0x3ae9('0x1d'),_0x305eb7+'-'+_0x27573d+'/'+_0x1dbdc9)[_0x3ae9('0x18')](_0x6c1f8d);}return null;};}function patchUpdates(_0x498299){return function(_0x485797){try{jsonpatch[_0x3ae9('0x1e')](_0x485797,_0x498299,!![]);}catch(_0x57472d){return BPromise[_0x3ae9('0x1f')](_0x57472d);}return _0x485797[_0x3ae9('0x20')]();};}function saveUpdates(_0xbdf332,_0x51ca46){return function(_0x28b340){if(_0x28b340){return _0x28b340[_0x3ae9('0x21')](_0xbdf332)[_0x3ae9('0x22')](function(_0xc1fa25){return _0xc1fa25;});}return null;};}function removeEntity(_0x1b1ebd,_0x5bb47c){return function(_0x2695b2){if(_0x2695b2){return _0x2695b2['destroy']()[_0x3ae9('0x22')](function(){_0x1b1ebd['status'](0xcc)[_0x3ae9('0x23')]();});}};}function handleEntityNotFound(_0x2c88ff,_0x348eda){return function(_0x544b59){if(!_0x544b59){_0x2c88ff['sendStatus'](0x194);}return _0x544b59;};}function handleError(_0x467478,_0x5034a5){_0x5034a5=_0x5034a5||0x1f4;return function(_0x10af62){logger[_0x3ae9('0x24')](_0x10af62['stack']);if(_0x10af62['name']){delete _0x10af62['name'];}_0x467478[_0x3ae9('0x17')](_0x5034a5)[_0x3ae9('0x25')](_0x10af62);};}exports[_0x3ae9('0x26')]=function(_0x300a56,_0x58b11c){var _0x40a980={'raw':!![],'where':{'id':_0x300a56[_0x3ae9('0x27')]['id']}},_0x16bd77={};_0x16bd77[_0x3ae9('0x28')]=_['keys'](db[_0x3ae9('0x29')][_0x3ae9('0x2a')]);_0x16bd77[_0x3ae9('0x2b')]=_[_0x3ae9('0x2c')](_0x300a56['query']);_0x16bd77[_0x3ae9('0x2d')]=_['intersection'](_0x16bd77['model'],_0x16bd77['query']);_0x40a980[_0x3ae9('0x2e')]=_['intersection'](_0x16bd77[_0x3ae9('0x28')],qs[_0x3ae9('0x2f')](_0x300a56[_0x3ae9('0x2b')][_0x3ae9('0x2f')]));_0x40a980[_0x3ae9('0x2e')]=_0x40a980[_0x3ae9('0x2e')]['length']?_0x40a980['attributes']:_0x16bd77[_0x3ae9('0x28')];if(_0x300a56[_0x3ae9('0x2b')][_0x3ae9('0x30')]){_0x40a980[_0x3ae9('0x31')]=[{'all':!![]}];}_0x40a980=_[_0x3ae9('0x32')]({},_0x40a980,_0x300a56['options']);return db['MailApplication']['find'](_0x40a980)[_0x3ae9('0x22')](handleEntityNotFound(_0x58b11c,null))[_0x3ae9('0x22')](respondWithResult(_0x58b11c,null))[_0x3ae9('0x33')](handleError(_0x58b11c,null));};exports[_0x3ae9('0x21')]=function(_0xfd17bb,_0x16cec7){if(_0xfd17bb[_0x3ae9('0x34')]['id']){delete _0xfd17bb[_0x3ae9('0x34')]['id'];}return db[_0x3ae9('0x29')][_0x3ae9('0x35')]({'where':{'id':_0xfd17bb['params']['id']}})[_0x3ae9('0x22')](handleEntityNotFound(_0x16cec7,null))[_0x3ae9('0x22')](saveUpdates(_0xfd17bb[_0x3ae9('0x34')],null))[_0x3ae9('0x22')](respondWithResult(_0x16cec7,null))['catch'](handleError(_0x16cec7,null));};exports['destroy']=function(_0x448bd3,_0xd5a162){return db[_0x3ae9('0x29')][_0x3ae9('0x35')]({'where':{'id':_0x448bd3[_0x3ae9('0x27')]['id']}})['then'](handleEntityNotFound(_0xd5a162,null))['then'](removeEntity(_0xd5a162,null))[_0x3ae9('0x33')](handleError(_0xd5a162,null));}; \ No newline at end of file +var _0x9e56=['filters','intersection','model','fields','attributes','length','include','merge','options','catch','body','find','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','show','params','keys','MailApplication','rawAttributes','query'];(function(_0x194c84,_0xd0086a){var _0x5a0899=function(_0x45ba39){while(--_0x45ba39){_0x194c84['push'](_0x194c84['shift']());}};_0x5a0899(++_0xd0086a);}(_0x9e56,0x16e));var _0x69e5=function(_0x499eaf,_0x560a5a){_0x499eaf=_0x499eaf-0x0;var _0x2fa121=_0x9e56[_0x499eaf];return _0x2fa121;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x69e5('0x0'));var rp=require(_0x69e5('0x1'));var moment=require(_0x69e5('0x2'));var BPromise=require(_0x69e5('0x3'));var Mustache=require(_0x69e5('0x4'));var util=require(_0x69e5('0x5'));var path=require('path');var sox=require(_0x69e5('0x6'));var csv=require('to-csv');var ejs=require(_0x69e5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69e5('0x8'));var squel=require(_0x69e5('0x9'));var crypto=require(_0x69e5('0xa'));var jsforce=require(_0x69e5('0xb'));var deskjs=require(_0x69e5('0xc'));var toCsv=require(_0x69e5('0xd'));var querystring=require(_0x69e5('0xe'));var Papa=require('papaparse');var Redis=require(_0x69e5('0xf'));var authService=require(_0x69e5('0x10'));var qs=require(_0x69e5('0x11'));var as=require(_0x69e5('0x12'));var hardwareService=require(_0x69e5('0x13'));var logger=require('../../config/logger')(_0x69e5('0x14'));var utils=require(_0x69e5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x69e5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5aa404,_0xca6555){_0xca6555=_0xca6555||0xcc;return function(_0x4bce39){if(_0x4bce39){return _0x5aa404['sendStatus'](_0xca6555);}return _0x5aa404[_0x69e5('0x17')](_0xca6555)[_0x69e5('0x18')]();};}function respondWithResult(_0x323c3d,_0x1ade13){_0x1ade13=_0x1ade13||0xc8;return function(_0x112b81){if(_0x112b81){return _0x323c3d[_0x69e5('0x17')](_0x1ade13)[_0x69e5('0x19')](_0x112b81);}};}function respondWithFilteredResult(_0x3dad4a,_0xa358c7){return function(_0x11e668){if(_0x11e668){var _0x47fdd7=typeof _0xa358c7[_0x69e5('0x1a')]==='undefined'&&typeof _0xa358c7[_0x69e5('0x1b')]===_0x69e5('0x1c');var _0x557c88=_0x11e668[_0x69e5('0x1d')];var _0xb0d89f=_0x47fdd7?0x0:_0xa358c7[_0x69e5('0x1a')];var _0x2cd94e=_0x47fdd7?_0x11e668[_0x69e5('0x1d')]:_0xa358c7[_0x69e5('0x1a')]+_0xa358c7[_0x69e5('0x1b')];var _0x36367c;if(_0x2cd94e>=_0x557c88){_0x2cd94e=_0x557c88;_0x36367c=0xc8;}else{_0x36367c=0xce;}_0x3dad4a[_0x69e5('0x17')](_0x36367c);return _0x3dad4a['set'](_0x69e5('0x1e'),_0xb0d89f+'-'+_0x2cd94e+'/'+_0x557c88)[_0x69e5('0x19')](_0x11e668);}return null;};}function patchUpdates(_0x2b8d99){return function(_0x37d10b){try{jsonpatch[_0x69e5('0x1f')](_0x37d10b,_0x2b8d99,!![]);}catch(_0x542574){return BPromise['reject'](_0x542574);}return _0x37d10b[_0x69e5('0x20')]();};}function saveUpdates(_0x5388d0,_0x1bf123){return function(_0x1e6b84){if(_0x1e6b84){return _0x1e6b84[_0x69e5('0x21')](_0x5388d0)[_0x69e5('0x22')](function(_0x54598c){return _0x54598c;});}return null;};}function removeEntity(_0x331a66,_0x3786c6){return function(_0x151a48){if(_0x151a48){return _0x151a48[_0x69e5('0x23')]()[_0x69e5('0x22')](function(){_0x331a66[_0x69e5('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39a75b,_0x1e7c0a){return function(_0x275642){if(!_0x275642){_0x39a75b[_0x69e5('0x24')](0x194);}return _0x275642;};}function handleError(_0x1ab063,_0x25ae3e){_0x25ae3e=_0x25ae3e||0x1f4;return function(_0x5a7136){logger[_0x69e5('0x25')](_0x5a7136[_0x69e5('0x26')]);if(_0x5a7136[_0x69e5('0x27')]){delete _0x5a7136[_0x69e5('0x27')];}_0x1ab063['status'](_0x25ae3e)[_0x69e5('0x28')](_0x5a7136);};}exports[_0x69e5('0x29')]=function(_0x16dbba,_0x16aea0){var _0x12ad3d={'raw':!![],'where':{'id':_0x16dbba[_0x69e5('0x2a')]['id']}},_0x1972a8={};_0x1972a8['model']=_[_0x69e5('0x2b')](db[_0x69e5('0x2c')][_0x69e5('0x2d')]);_0x1972a8[_0x69e5('0x2e')]=_[_0x69e5('0x2b')](_0x16dbba[_0x69e5('0x2e')]);_0x1972a8[_0x69e5('0x2f')]=_[_0x69e5('0x30')](_0x1972a8[_0x69e5('0x31')],_0x1972a8[_0x69e5('0x2e')]);_0x12ad3d['attributes']=_[_0x69e5('0x30')](_0x1972a8['model'],qs[_0x69e5('0x32')](_0x16dbba[_0x69e5('0x2e')]['fields']));_0x12ad3d[_0x69e5('0x33')]=_0x12ad3d['attributes'][_0x69e5('0x34')]?_0x12ad3d[_0x69e5('0x33')]:_0x1972a8['model'];if(_0x16dbba['query']['includeAll']){_0x12ad3d[_0x69e5('0x35')]=[{'all':!![]}];}_0x12ad3d=_[_0x69e5('0x36')]({},_0x12ad3d,_0x16dbba[_0x69e5('0x37')]);return db[_0x69e5('0x2c')]['find'](_0x12ad3d)[_0x69e5('0x22')](handleEntityNotFound(_0x16aea0,null))[_0x69e5('0x22')](respondWithResult(_0x16aea0,null))[_0x69e5('0x38')](handleError(_0x16aea0,null));};exports[_0x69e5('0x21')]=function(_0x1d37ba,_0x399d11){if(_0x1d37ba['body']['id']){delete _0x1d37ba[_0x69e5('0x39')]['id'];}return db[_0x69e5('0x2c')][_0x69e5('0x3a')]({'where':{'id':_0x1d37ba['params']['id']}})[_0x69e5('0x22')](handleEntityNotFound(_0x399d11,null))['then'](saveUpdates(_0x1d37ba[_0x69e5('0x39')],null))[_0x69e5('0x22')](respondWithResult(_0x399d11,null))[_0x69e5('0x38')](handleError(_0x399d11,null));};exports[_0x69e5('0x23')]=function(_0x2aa367,_0x2005e3){return db['MailApplication'][_0x69e5('0x3a')]({'where':{'id':_0x2aa367[_0x69e5('0x2a')]['id']}})[_0x69e5('0x22')](handleEntityNotFound(_0x2005e3,null))[_0x69e5('0x22')](removeEntity(_0x2005e3,null))[_0x69e5('0x38')](handleError(_0x2005e3,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index f9b6010..4e3e325 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 _0x34bd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api'];(function(_0x5c9a04,_0x1c1ebd){var _0x1cb316=function(_0xa755cb){while(--_0xa755cb){_0x5c9a04['push'](_0x5c9a04['shift']());}};_0x1cb316(++_0x1c1ebd);}(_0x34bd,0x1d2));var _0xd34b=function(_0x222550,_0x3c0a0c){_0x222550=_0x222550-0x0;var _0x58ac61=_0x34bd[_0x222550];return _0x58ac61;};'use strict';var _=require(_0xd34b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd34b('0x1'));var moment=require(_0xd34b('0x2'));var BPromise=require(_0xd34b('0x3'));var rp=require(_0xd34b('0x4'));var fs=require('fs');var path=require(_0xd34b('0x5'));var rimraf=require(_0xd34b('0x6'));var config=require(_0xd34b('0x7'));var attributes=require('./mailApplication.attributes');module[_0xd34b('0x8')]=function(_0x5d161e,_0x4e6e94){return _0x5d161e['define'](_0xd34b('0x9'),attributes,{'tableName':_0xd34b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd34b('0xb'),'collate':_0xd34b('0xc')});}; \ No newline at end of file +var _0x3419=['api','moment','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x30acd4,_0x53f020){var _0x245d4b=function(_0x301312){while(--_0x301312){_0x30acd4['push'](_0x30acd4['shift']());}};_0x245d4b(++_0x53f020);}(_0x3419,0xb3));var _0x9341=function(_0x4d515d,_0x108c96){_0x4d515d=_0x4d515d-0x0;var _0x58fe07=_0x3419[_0x4d515d];return _0x58fe07;};'use strict';var _=require(_0x9341('0x0'));var util=require(_0x9341('0x1'));var logger=require(_0x9341('0x2'))(_0x9341('0x3'));var moment=require(_0x9341('0x4'));var BPromise=require('bluebird');var rp=require(_0x9341('0x5'));var fs=require('fs');var path=require(_0x9341('0x6'));var rimraf=require(_0x9341('0x7'));var config=require(_0x9341('0x8'));var attributes=require(_0x9341('0x9'));module['exports']=function(_0xa36232,_0x204ee){return _0xa36232['define'](_0x9341('0xa'),attributes,{'tableName':_0x9341('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9341('0xc'),'collate':_0x9341('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index d2bf6fc..150359c 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 _0xf184=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where'];(function(_0x502c54,_0x567a3d){var _0x14e97c=function(_0x5481cb){while(--_0x5481cb){_0x502c54['push'](_0x502c54['shift']());}};_0x14e97c(++_0x567a3d);}(_0xf184,0x1ee));var _0x4f18=function(_0x4e4061,_0x26503b){_0x4e4061=_0x4e4061-0x0;var _0x371dbd=_0xf184[_0x4e4061];return _0x371dbd;};'use strict';var _=require('lodash');var util=require(_0x4f18('0x0'));var moment=require(_0x4f18('0x1'));var BPromise=require(_0x4f18('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f18('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f18('0x4'));var logger=require(_0x4f18('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4f18('0x6'));var client=jayson[_0x4f18('0x7')][_0x4f18('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5deda4,_0x3dc926,_0x58d953){return new BPromise(function(_0x36ac5a,_0x4f37a5){return client['request'](_0x5deda4,_0x58d953)[_0x4f18('0x9')](function(_0x19b024){logger[_0x4f18('0xa')](_0x4f18('0xb'),_0x3dc926,_0x4f18('0xc'));logger[_0x4f18('0xd')](_0x4f18('0xe'),_0x3dc926,'request\x20sent',JSON[_0x4f18('0xf')](_0x19b024));if(_0x19b024[_0x4f18('0x10')]){if(_0x19b024[_0x4f18('0x10')]['code']===0x1f4){logger[_0x4f18('0x10')](_0x4f18('0xb'),_0x3dc926,_0x19b024['error']['message']);return _0x4f37a5(_0x19b024[_0x4f18('0x10')][_0x4f18('0x11')]);}logger['error'](_0x4f18('0xb'),_0x3dc926,_0x19b024['error'][_0x4f18('0x11')]);return _0x36ac5a(_0x19b024[_0x4f18('0x10')][_0x4f18('0x11')]);}else{logger[_0x4f18('0xa')](_0x4f18('0xb'),_0x3dc926,_0x4f18('0xc'));_0x36ac5a(_0x19b024['result']['message']);}})[_0x4f18('0x12')](function(_0x2a69e6){logger[_0x4f18('0x10')](_0x4f18('0xb'),_0x3dc926,_0x2a69e6);_0x4f37a5(_0x2a69e6);});});}exports[_0x4f18('0x13')]=function(_0x58c9de){var _0x3a17f7=this;return new Promise(function(_0x333bbf,_0x4b4d63){return db[_0x4f18('0x14')][_0x4f18('0x15')](_0x58c9de[_0x4f18('0x16')],{'raw':_0x58c9de[_0x4f18('0x17')]?_0x58c9de['options'][_0x4f18('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58c9de['options']?_0x58c9de[_0x4f18('0x17')][_0x4f18('0x19')]||null:null,'attributes':_0x58c9de['options']?_0x58c9de['options']['attributes']||null:null,'limit':_0x58c9de['options']?_0x58c9de[_0x4f18('0x17')]['limit']||null:null})['then'](function(_0xb526d1){logger['info'](_0x4f18('0x13'),_0x58c9de);logger[_0x4f18('0xd')](_0x4f18('0x13'),_0x58c9de,JSON['stringify'](_0xb526d1));_0x333bbf(_0xb526d1);})[_0x4f18('0x12')](function(_0xd19e90){logger[_0x4f18('0x10')](_0x4f18('0x13'),_0xd19e90[_0x4f18('0x11')],_0x58c9de);_0x4b4d63(_0x3a17f7['error'](0x1f4,_0xd19e90[_0x4f18('0x11')]));});});}; \ No newline at end of file +var _0x3ff4=['update','body','options','raw','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication'];(function(_0x351509,_0x54725c){var _0x4e9861=function(_0x54f92c){while(--_0x54f92c){_0x351509['push'](_0x351509['shift']());}};_0x4e9861(++_0x54725c);}(_0x3ff4,0xd2));var _0x43ff=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x3ff4[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x43ff('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x43ff('0x1'));var rs=require(_0x43ff('0x2'));var fs=require('fs');var Redis=require(_0x43ff('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x43ff('0x4'));var logger=require(_0x43ff('0x5'))(_0x43ff('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x43ff('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c1499,_0x5719fb,_0x3fc35f){return new BPromise(function(_0x3955e4,_0x300352){return client['request'](_0x1c1499,_0x3fc35f)[_0x43ff('0x8')](function(_0x5a1245){logger[_0x43ff('0x9')](_0x43ff('0xa'),_0x5719fb,_0x43ff('0xb'));logger[_0x43ff('0xc')](_0x43ff('0xd'),_0x5719fb,'request\x20sent',JSON[_0x43ff('0xe')](_0x5a1245));if(_0x5a1245[_0x43ff('0xf')]){if(_0x5a1245['error'][_0x43ff('0x10')]===0x1f4){logger[_0x43ff('0xf')](_0x43ff('0xa'),_0x5719fb,_0x5a1245[_0x43ff('0xf')][_0x43ff('0x11')]);return _0x300352(_0x5a1245['error'][_0x43ff('0x11')]);}logger[_0x43ff('0xf')](_0x43ff('0xa'),_0x5719fb,_0x5a1245[_0x43ff('0xf')][_0x43ff('0x11')]);return _0x3955e4(_0x5a1245[_0x43ff('0xf')]['message']);}else{logger[_0x43ff('0x9')](_0x43ff('0xa'),_0x5719fb,'request\x20sent');_0x3955e4(_0x5a1245[_0x43ff('0x12')][_0x43ff('0x11')]);}})[_0x43ff('0x13')](function(_0x56fe0b){logger[_0x43ff('0xf')](_0x43ff('0xa'),_0x5719fb,_0x56fe0b);_0x300352(_0x56fe0b);});});}exports[_0x43ff('0x14')]=function(_0x3bdb85){var _0x56bfdb=this;return new Promise(function(_0xf0c4a5,_0x1f100c){return db[_0x43ff('0x15')][_0x43ff('0x16')](_0x3bdb85[_0x43ff('0x17')],{'raw':_0x3bdb85['options']?_0x3bdb85[_0x43ff('0x18')][_0x43ff('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bdb85[_0x43ff('0x18')]?_0x3bdb85[_0x43ff('0x18')][_0x43ff('0x1a')]||null:null,'attributes':_0x3bdb85[_0x43ff('0x18')]?_0x3bdb85[_0x43ff('0x18')][_0x43ff('0x1b')]||null:null,'limit':_0x3bdb85['options']?_0x3bdb85[_0x43ff('0x18')][_0x43ff('0x1c')]||null:null})['then'](function(_0x179d6a){logger[_0x43ff('0x9')]('UpdateMailApplication',_0x3bdb85);logger[_0x43ff('0xc')](_0x43ff('0x14'),_0x3bdb85,JSON[_0x43ff('0xe')](_0x179d6a));_0xf0c4a5(_0x179d6a);})[_0x43ff('0x13')](function(_0x1278c4){logger[_0x43ff('0xf')]('UpdateMailApplication',_0x1278c4['message'],_0x3bdb85);_0x1f100c(_0x56bfdb[_0x43ff('0xf')](0x1f4,_0x1278c4['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 2c3dff8..4ec13cb 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 _0x49de=['/:id/download','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','/:id','tracked','mailinteraction:update','update','mailinteraction:destroy','removeTags','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','describe','show','/:id/messages','getMessages'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x49de,0x171));var _0xe49d=function(_0x51539c,_0x25f587){_0x51539c=_0x51539c-0x0;var _0x4f7914=_0x49de[_0x51539c];return _0x4f7914;};'use strict';var multer=require(_0xe49d('0x0'));var util=require(_0xe49d('0x1'));var path=require(_0xe49d('0x2'));var timeout=require('connect-timeout');var express=require(_0xe49d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe49d('0x4'));var interaction=require(_0xe49d('0x5'));var config=require(_0xe49d('0x6'));var controller=require(_0xe49d('0x7'));router[_0xe49d('0x8')]('/',auth[_0xe49d('0x9')](),controller[_0xe49d('0xa')]);router['get']('/describe',auth[_0xe49d('0x9')](),controller[_0xe49d('0xb')]);router[_0xe49d('0x8')]('/:id',auth[_0xe49d('0x9')](),controller[_0xe49d('0xc')]);router[_0xe49d('0x8')](_0xe49d('0xd'),auth[_0xe49d('0x9')](),controller[_0xe49d('0xe')]);router[_0xe49d('0x8')](_0xe49d('0xf'),auth['isAuthenticated'](),controller[_0xe49d('0x10')]);router[_0xe49d('0x11')]('/',auth[_0xe49d('0x9')](),controller[_0xe49d('0x12')]);router['post'](_0xe49d('0xd'),auth[_0xe49d('0x9')](),controller[_0xe49d('0x13')]);router[_0xe49d('0x11')](_0xe49d('0x14'),auth[_0xe49d('0x9')](),interaction['tracked'](_0xe49d('0x15'),_0xe49d('0x16')),controller[_0xe49d('0x17')]);router[_0xe49d('0x18')](_0xe49d('0x19'),auth[_0xe49d('0x9')](),interaction[_0xe49d('0x1a')]('mail',_0xe49d('0x1b')),controller[_0xe49d('0x1c')]);router['delete'](_0xe49d('0x19'),auth[_0xe49d('0x9')](),interaction[_0xe49d('0x1a')](_0xe49d('0x15'),_0xe49d('0x1d')),controller['destroy']);router['delete'](_0xe49d('0x14'),auth['isAuthenticated'](),controller[_0xe49d('0x1e')]);module[_0xe49d('0x1f')]=router; \ No newline at end of file +var _0xc17e=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','/:id/messages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','mail','addTags','put','mailinteraction:update','delete','mailinteraction:destroy','exports','util'];(function(_0x10791d,_0x2562b6){var _0x1b4f9c=function(_0x3b2815){while(--_0x3b2815){_0x10791d['push'](_0x10791d['shift']());}};_0x1b4f9c(++_0x2562b6);}(_0xc17e,0xc3));var _0xec17=function(_0x496cdc,_0x9d6db3){_0x496cdc=_0x496cdc-0x0;var _0x103a8e=_0xc17e[_0x496cdc];return _0x103a8e;};'use strict';var multer=require('multer');var util=require(_0xec17('0x0'));var path=require(_0xec17('0x1'));var timeout=require('connect-timeout');var express=require(_0xec17('0x2'));var router=express[_0xec17('0x3')]();var fs_extra=require(_0xec17('0x4'));var auth=require(_0xec17('0x5'));var interaction=require(_0xec17('0x6'));var config=require(_0xec17('0x7'));var controller=require('./mailInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xec17('0x8')]);router[_0xec17('0x9')](_0xec17('0xa'),auth[_0xec17('0xb')](),controller['describe']);router[_0xec17('0x9')](_0xec17('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xec17('0xd'),auth[_0xec17('0xb')](),controller['getMessages']);router[_0xec17('0x9')](_0xec17('0xe'),auth[_0xec17('0xb')](),controller[_0xec17('0xf')]);router['post']('/',auth[_0xec17('0xb')](),controller[_0xec17('0x10')]);router[_0xec17('0x11')](_0xec17('0xd'),auth[_0xec17('0xb')](),controller[_0xec17('0x12')]);router[_0xec17('0x11')](_0xec17('0x13'),auth[_0xec17('0xb')](),interaction[_0xec17('0x14')](_0xec17('0x15'),'mailinteraction:addtags'),controller[_0xec17('0x16')]);router[_0xec17('0x17')](_0xec17('0xc'),auth[_0xec17('0xb')](),interaction[_0xec17('0x14')](_0xec17('0x15'),_0xec17('0x18')),controller['update']);router[_0xec17('0x19')]('/:id',auth[_0xec17('0xb')](),interaction[_0xec17('0x14')]('mail',_0xec17('0x1a')),controller['destroy']);router[_0xec17('0x19')](_0xec17('0x13'),auth[_0xec17('0xb')](),controller['removeTags']);module[_0xec17('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 58a7b1b..f7ff758 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 _0x3c71=['iconv','exports','BOOLEAN','STRING','TEXT','DATE','ENUM','out','sequelize'];(function(_0x865ec9,_0x274e5d){var _0x5a4014=function(_0x5eed06){while(--_0x5eed06){_0x865ec9['push'](_0x865ec9['shift']());}};_0x5a4014(++_0x274e5d);}(_0x3c71,0x98));var _0x13c7=function(_0x18497b,_0x215e3b){_0x18497b=_0x18497b-0x0;var _0x1f238e=_0x3c71[_0x18497b];return _0x1f238e;};'use strict';var Sequelize=require(_0x13c7('0x0'));var iconv=require(_0x13c7('0x1'));module[_0x13c7('0x2')]={'closed':{'type':Sequelize[_0x13c7('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x13c7('0x4')]},'secondDisposition':{'type':Sequelize[_0x13c7('0x4')]},'thirdDisposition':{'type':Sequelize[_0x13c7('0x4')]},'note':{'type':Sequelize[_0x13c7('0x4')]},'inReplyTo':{'type':Sequelize[_0x13c7('0x4')](0x1fe)},'to':{'type':Sequelize[_0x13c7('0x4')]},'cc':{'type':Sequelize[_0x13c7('0x5')]('long')},'subject':{'type':Sequelize[_0x13c7('0x5')]()},'attach':{'type':Sequelize[_0x13c7('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x13c7('0x6')]},'substatus':{'type':Sequelize[_0x13c7('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x13c7('0x7')]('in',_0x13c7('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x13c7('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x13c7('0x7')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xdd8f=['long','ENUM','out','iconv','BOOLEAN','DATE','STRING','TEXT'];(function(_0x2f66fe,_0x46be8b){var _0x1a1d22=function(_0x1bd32a){while(--_0x1bd32a){_0x2f66fe['push'](_0x2f66fe['shift']());}};_0x1a1d22(++_0x46be8b);}(_0xdd8f,0x6b));var _0xfdd8=function(_0x5f0b7e,_0x3a40d3){_0x5f0b7e=_0x5f0b7e-0x0;var _0x3e024f=_0xdd8f[_0x5f0b7e];return _0x3e024f;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xfdd8('0x0'));module['exports']={'closed':{'type':Sequelize[_0xfdd8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfdd8('0x2')]},'disposition':{'type':Sequelize[_0xfdd8('0x3')]},'secondDisposition':{'type':Sequelize[_0xfdd8('0x3')]},'thirdDisposition':{'type':Sequelize[_0xfdd8('0x3')]},'note':{'type':Sequelize[_0xfdd8('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xfdd8('0x3')]},'cc':{'type':Sequelize[_0xfdd8('0x4')](_0xfdd8('0x5'))},'subject':{'type':Sequelize[_0xfdd8('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xfdd8('0x2')]},'substatus':{'type':Sequelize[_0xfdd8('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xfdd8('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xfdd8('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfdd8('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xfdd8('0x6')]('in',_0xfdd8('0x7')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index ecfd2a5..610f93d 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 _0x8309=['parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','user','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.thirdDisposition','i.substatus','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','Owner.internal','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','push','all','rows','params','intersection','includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','MailMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','spread','emit','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','log','err','unlinkSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','html-to-text','juice','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','then','status','name','send','map','Tags','TagIds','split','forEach','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','type','key','query','keys','filters','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','ui.MailInteractionId','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','value','having','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','some','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt'];(function(_0xe262e0,_0x5d1962){var _0x3818fa=function(_0xf39ef2){while(--_0xf39ef2){_0xe262e0['push'](_0xe262e0['shift']());}};_0x3818fa(++_0x5d1962);}(_0x8309,0x176));var _0x9830=function(_0xefcb88,_0x21c846){_0xefcb88=_0xefcb88-0x0;var _0x56f006=_0x8309[_0xefcb88];return _0x56f006;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9830('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9830('0x1'));var moment=require(_0x9830('0x2'));var BPromise=require(_0x9830('0x3'));var Mustache=require(_0x9830('0x4'));var util=require(_0x9830('0x5'));var path=require(_0x9830('0x6'));var sox=require(_0x9830('0x7'));var csv=require(_0x9830('0x8'));var ejs=require(_0x9830('0x9'));var fs=require('fs');var fs_extra=require(_0x9830('0xa'));var _=require(_0x9830('0xb'));var squel=require(_0x9830('0xc'));var crypto=require(_0x9830('0xd'));var jsforce=require(_0x9830('0xe'));var deskjs=require(_0x9830('0xf'));var toCsv=require(_0x9830('0x8'));var querystring=require(_0x9830('0x10'));var Papa=require('papaparse');var htmlToText=require(_0x9830('0x11'));var juice=require(_0x9830('0x12'));var Redis=require(_0x9830('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9830('0x14'));var hardwareService=require(_0x9830('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x9830('0x16'));var config=require(_0x9830('0x17'));var licenseUtil=require(_0x9830('0x18'));var db=require(_0x9830('0x19'))['db'];config[_0x9830('0x1a')]=_[_0x9830('0x1b')](config[_0x9830('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x9830('0x1c'))(new Redis(config[_0x9830('0x1a')]));require(_0x9830('0x1d'))[_0x9830('0x1e')](socket);function respondWithStatusCode(_0x3b526b,_0xa2a8d0){_0xa2a8d0=_0xa2a8d0||0xcc;return function(_0x454ba5){if(_0x454ba5){return _0x3b526b[_0x9830('0x1f')](_0xa2a8d0);}return _0x3b526b['status'](_0xa2a8d0)[_0x9830('0x20')]();};}function respondWithResult(_0x41755a,_0xf70578){_0xf70578=_0xf70578||0xc8;return function(_0x3c85ca){if(_0x3c85ca){return _0x41755a['status'](_0xf70578)['json'](_0x3c85ca);}};}function respondWithFilteredResult(_0x29cd45,_0x3a63be){return function(_0x8b78e2){if(_0x8b78e2){var _0xad4570=typeof _0x3a63be[_0x9830('0x21')]===_0x9830('0x22')&&typeof _0x3a63be[_0x9830('0x23')]===_0x9830('0x22');var _0x55b96a=_0x8b78e2[_0x9830('0x24')];var _0x47aa04=_0xad4570?0x0:_0x3a63be[_0x9830('0x21')];var _0x1ca333=_0xad4570?_0x8b78e2[_0x9830('0x24')]:_0x3a63be[_0x9830('0x21')]+_0x3a63be[_0x9830('0x23')];var _0xd8a646;if(_0x1ca333>=_0x55b96a){_0x1ca333=_0x55b96a;_0xd8a646=0xc8;}else{_0xd8a646=0xce;}_0x29cd45['status'](_0xd8a646);return _0x29cd45[_0x9830('0x25')](_0x9830('0x26'),_0x47aa04+'-'+_0x1ca333+'/'+_0x55b96a)[_0x9830('0x27')](_0x8b78e2);}return null;};}function patchUpdates(_0x1c7c13){return function(_0x4cd8de){try{jsonpatch[_0x9830('0x28')](_0x4cd8de,_0x1c7c13,!![]);}catch(_0x45ea84){return BPromise['reject'](_0x45ea84);}return _0x4cd8de[_0x9830('0x29')]();};}function saveUpdates(_0x392785,_0x3a3bf1){return function(_0x12d2db){if(_0x12d2db){return _0x12d2db[_0x9830('0x2a')](_0x392785)['then'](function(_0x5ea837){return _0x5ea837;});}return null;};}function removeEntity(_0x172fbc,_0x2d4562){return function(_0x50c452){if(_0x50c452){return _0x50c452[_0x9830('0x2b')]()[_0x9830('0x2c')](function(){_0x172fbc[_0x9830('0x2d')](0xcc)[_0x9830('0x20')]();});}};}function handleEntityNotFound(_0x524d39,_0x293845){return function(_0x3063be){if(!_0x3063be){_0x524d39[_0x9830('0x1f')](0x194);}return _0x3063be;};}function handleError(_0x41fe58,_0x14d370){_0x14d370=_0x14d370||0x1f4;return function(_0x3466fd){logger['error'](_0x3466fd['stack']);if(_0x3466fd[_0x9830('0x2e')]){delete _0x3466fd[_0x9830('0x2e')];}_0x41fe58[_0x9830('0x2d')](_0x14d370)[_0x9830('0x2f')](_0x3466fd);};}function getInteractionUsers(_0x3c4001,_0x4396c1){return new BPromise(function(_0x4b1654,_0x160580){try{if(_0x4396c1[_0x3c4001['id']]){_0x3c4001['Users']=_[_0x9830('0x30')](_0x4396c1[_0x3c4001['id']],function(_0x2d33b1){return{'id':_0x2d33b1['id'],'fullname':_0x2d33b1['fullname']};});}}catch(_0x4ae84f){_0x160580(_0x4ae84f);}_0x4b1654(_0x3c4001);});}function getInteractionTags(_0x419e91,_0x47b9e8){return new BPromise(function(_0x264a94,_0x2910a7){try{if(_0x419e91['TagIds']){_0x419e91[_0x9830('0x31')]=[];_0x419e91[_0x9830('0x32')][_0x9830('0x33')](',')[_0x9830('0x34')](function(_0xb9f388){_0x419e91[_0x9830('0x31')]['push'](_0x47b9e8[_0xb9f388]);});}delete _0x419e91['TagIds'];}catch(_0x50e4){_0x2910a7(_0x50e4);}_0x264a94(_0x419e91);});}function getLastMessageText(_0x452556){return new BPromise(function(_0x5ab167,_0x27d3ea){return db['MailMessage'][_0x9830('0x35')]({'where':{'$and':[{'MailInteractionId':_0x452556['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9830('0x36')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9830('0x37')],'order':_0x9830('0x38'),'raw':!![]})[_0x9830('0x2c')](function(_0x1ae1ca){if(_0x1ae1ca&&_0x1ae1ca['plainBody']){_0x452556[_0x9830('0x39')]=_[_0x9830('0x3a')](_0x1ae1ca[_0x9830('0x37')]);}_0x5ab167(_0x452556);})[_0x9830('0x3b')](function(_0x489c73){_0x27d3ea(_0x489c73);});});}function updateMailInteraction(_0x419938,_0x6d6d53,_0xc68c95,_0x1f29fb){return new BPromise(function(_0x3bbc96,_0x8d5af4){return getInteractionUsers(_0x419938,_0xc68c95)[_0x9830('0x2c')](function(_0x15a982){return getInteractionTags(_0x15a982,_0x6d6d53);})[_0x9830('0x2c')](function(_0xef36ea){if(_0x1f29fb){_0x3bbc96(getLastMessageText(_0xef36ea));}else{_0x3bbc96(_0xef36ea);}})[_0x9830('0x3b')](function(_0x3fd205){_0x8d5af4(_0x3fd205);});});}exports[_0x9830('0x3c')]=function(_0x1ad2f4,_0x4b097c){var _0x341f61={},_0x308534={},_0x1511cb={'count':0x0,'rows':[]};var _0x19bc2d=_[_0x9830('0x30')](db[_0x9830('0x3d')][_0x9830('0x3e')],function(_0x39b57c){return{'name':_0x39b57c[_0x9830('0x3f')],'type':_0x39b57c[_0x9830('0x40')][_0x9830('0x41')]};});_0x308534['model']=_[_0x9830('0x30')](_0x19bc2d,_0x9830('0x2e'));_0x308534[_0x9830('0x42')]=_[_0x9830('0x43')](_0x1ad2f4[_0x9830('0x42')]);_0x308534[_0x9830('0x44')]=_['intersection'](_0x308534['model'],_0x308534[_0x9830('0x42')]);_0x341f61[_0x9830('0x45')]=_['intersection'](_0x308534['model'],qs[_0x9830('0x46')](_0x1ad2f4[_0x9830('0x42')][_0x9830('0x46')]));_0x341f61[_0x9830('0x45')]=_0x341f61[_0x9830('0x45')][_0x9830('0x47')]?_0x341f61[_0x9830('0x45')]:_0x308534[_0x9830('0x48')];if(!_0x1ad2f4['query'][_0x9830('0x49')](_0x9830('0x4a'))){_0x341f61[_0x9830('0x23')]=qs[_0x9830('0x23')](_0x1ad2f4[_0x9830('0x42')][_0x9830('0x23')]);_0x341f61[_0x9830('0x21')]=qs[_0x9830('0x21')](_0x1ad2f4['query'][_0x9830('0x21')]);}_0x341f61[_0x9830('0x4b')]=qs['sort'](_0x1ad2f4[_0x9830('0x42')][_0x9830('0x4c')]);_0x341f61[_0x9830('0x4d')]=qs['filters'](_[_0x9830('0x4e')](_0x1ad2f4[_0x9830('0x42')],_0x308534[_0x9830('0x44')]),_0x19bc2d);var _0x2c3554=[];var _0x153b61=squel[_0x9830('0x4f')]()[_0x9830('0x50')]('id')[_0x9830('0x50')](_0x9830('0x2e'))[_0x9830('0x50')](_0x9830('0x51'))[_0x9830('0x52')]('tools_tags');var _0x533921=squel[_0x9830('0x4f')]()[_0x9830('0x50')]('u.id')[_0x9830('0x50')]('u.fullname')[_0x9830('0x50')](_0x9830('0x53'))[_0x9830('0x52')](_0x9830('0x54'),'ui')[_0x9830('0x55')]('users','u',_0x9830('0x56'));var _0x5eaefc=squel['select']()['from'](_0x9830('0x57'),'i')[_0x9830('0x55')](_0x9830('0x58'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x9830('0x55')](_0x9830('0x59'),'o',_0x9830('0x5a'))[_0x9830('0x55')]('mail_accounts','a',_0x9830('0x5b'))[_0x9830('0x55')]('mail_messages','me',_0x9830('0x5c'))[_0x9830('0x55')](_0x9830('0x5d'),'it',_0x9830('0x5e'))[_0x9830('0x55')](_0x9830('0x5f'),'t',_0x9830('0x60'));var _0x297f5e=squel[_0x9830('0x61')]();var _0x4f0f6f=[];var _0x51d9e2=squel[_0x9830('0x61')]();var _0x388cc5;if(_0x1ad2f4[_0x9830('0x42')]['search']){_0x388cc5=as[_0x9830('0x62')](_0x1ad2f4[_0x9830('0x42')][_0x9830('0x63')]);var _0x41ac3f=_0x388cc5['sqlOperator'];for(var _0x5bddbd=0x0;_0x5bddbd<_0x388cc5[_0x9830('0x64')][_0x9830('0x47')];_0x5bddbd++){var _0x315afd=_0x388cc5['conditions'][_0x5bddbd];var _0x58b1e2='i';var _0x1671c3=_[_0x9830('0x65')](_0x19bc2d,[_0x9830('0x2e'),_0x315afd[_0x9830('0x50')]]);if(!_0x1671c3){switch(_0x315afd[_0x9830('0x50')]){case _0x9830('0x66'):if(_0x315afd[_0x9830('0x67')]==0x1){_0x5eaefc[_0x9830('0x68')]('`'+_0x315afd[_0x9830('0x50')]+'`\x20=\x200');}else{_0x5eaefc[_0x9830('0x68')]('`'+_0x315afd[_0x9830('0x50')]+'`\x20>\x200');}break;case _0x9830('0x69'):if(_0x315afd[_0x9830('0x6a')]==='$substring'){if(_0x315afd[_0x9830('0x67')][_0x9830('0x33')]('\x20')[_0x9830('0x47')]>0x1){_0x297f5e[_0x41ac3f](_0x9830('0x6b'),qs[_0x9830('0x6c')](_0x315afd[_0x9830('0x67')]),null);}else{var _0x51664f='%'+_0x315afd[_0x9830('0x67')]+'%';_0x297f5e[_0x41ac3f](_0x9830('0x6d'),_0x51664f,_0x51664f,_0x51664f);}}else{_0x1671c3=_['find'](_0x19bc2d,[_0x9830('0x2e'),_0x9830('0x6e')]);_0x315afd['field']=_0x9830('0x6e');_0x531815=as['buildExpression'](_0x58b1e2,_0x1671c3[_0x9830('0x40')],_0x315afd);_0x297f5e[_0x41ac3f](_0x531815[_0x9830('0x6f')],_0x531815[_0x9830('0x67')]['start'],_0x531815[_0x9830('0x67')][_0x9830('0x20')]);}break;case _0x9830('0x70'):var _0xa5f16=_0x315afd[_0x9830('0x67')]['split'](',')['map'](function(_0x3bc9af){return Number(_0x3bc9af);});_0xa5f16[_0x9830('0x34')](function(_0x1b3398){_0x51d9e2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1b3398+',%');});_0x4f0f6f=_['union'](_0x4f0f6f,_0xa5f16);break;case _0x9830('0x71'):if(_0x315afd[_0x9830('0x6a')]===_0x9830('0x72')){_0x297f5e[_0x41ac3f](_0x9830('0x73'),'%'+_0x315afd[_0x9830('0x67')]+'%',null);}else{_0x1671c3=_['find'](_0x19bc2d,[_0x9830('0x2e'),_0x9830('0x74')]);_0x315afd[_0x9830('0x50')]=_0x9830('0x74');_0x531815=as[_0x9830('0x75')](_0x58b1e2,_0x1671c3[_0x9830('0x40')],_0x315afd);_0x297f5e[_0x41ac3f](_0x531815[_0x9830('0x6f')],_0x531815[_0x9830('0x67')][_0x9830('0x76')],_0x531815['value']['end']);}break;case _0x9830('0x37'):_0x531815=as[_0x9830('0x75')]('me',null,_0x315afd);_0x297f5e[_0x41ac3f](_0x531815[_0x9830('0x6f')],_0x531815['value'][_0x9830('0x76')],_0x531815['value'][_0x9830('0x20')]);break;}}else{var _0x531815=as[_0x9830('0x75')](_0x58b1e2,_0x1671c3[_0x9830('0x40')],_0x315afd);_0x297f5e[_0x41ac3f](_0x531815[_0x9830('0x6f')],_0x531815[_0x9830('0x67')][_0x9830('0x76')],_0x531815['value'][_0x9830('0x20')]);}}}else{var _0x936e4f=_(_0x1ad2f4[_0x9830('0x42')])[_0x9830('0x43')]()[_0x9830('0x30')](function(_0x1bf188){return _[_0x9830('0x77')](_0x19bc2d,[_0x9830('0x2e'),_0x1bf188])?_0x1bf188:undefined;})['compact']()[_0x9830('0x67')]();if(!_[_0x9830('0x78')](_0x936e4f)){_0x936e4f[_0x9830('0x34')](function(_0x2f5c30){if(_0x2f5c30==='MailAccountId'){_0x5eaefc[_0x9830('0x4d')](_0x9830('0x79'),[][_0x9830('0x7a')](_0x1ad2f4['query'][_0x2f5c30]));}else if(_0x2f5c30===_0x9830('0x7b')){var _0x3e16fc=JSON[_0x9830('0x7c')](_0x1ad2f4[_0x9830('0x42')][_0x2f5c30])[_0x9830('0x7d')];var _0x3f092c=JSON[_0x9830('0x7c')](_0x1ad2f4[_0x9830('0x42')][_0x2f5c30])[_0x9830('0x7e')];_0x5eaefc[_0x9830('0x4d')](_0x9830('0x7f'),_0x3e16fc,_0x3f092c);}else{if(_0x1ad2f4[_0x9830('0x42')][_0x2f5c30]===_0x9830('0x80')){_0x5eaefc[_0x9830('0x4d')]('i.'+_0x2f5c30+'\x20IS\x20NULL');}else{_0x5eaefc[_0x9830('0x4d')]('i.'+_0x2f5c30+_0x9830('0x81'),_0x1ad2f4[_0x9830('0x42')][_0x2f5c30]);}}});}if(_0x1ad2f4['query'][_0x9830('0x82')]){if(_0x1ad2f4['query'][_0x9830('0x82')]==0x1){_0x5eaefc[_0x9830('0x68')]('`unreadMessages`\x20=\x200');}else{_0x5eaefc[_0x9830('0x68')](_0x9830('0x83'));}}if(_0x1ad2f4[_0x9830('0x42')]['tag']){_0x4f0f6f=_['isArray'](_0x1ad2f4[_0x9830('0x42')][_0x9830('0x84')])?_0x1ad2f4[_0x9830('0x42')]['tag']:new Array(_0x1ad2f4[_0x9830('0x42')][_0x9830('0x84')]);_0x4f0f6f[_0x9830('0x34')](function(_0x506284){_0x51d9e2['or'](_0x9830('0x85'),'%,'+_0x506284+',%');});}if(_0x1ad2f4[_0x9830('0x42')][_0x9830('0x86')]){var _0xd15b93=_0x1ad2f4[_0x9830('0x42')][_0x9830('0x86')]['replace']('\x5c','\x5c\x5c')[_0x9830('0x87')](/'/g,'\x27\x27');if(qs[_0x9830('0x88')](_0xd15b93)){_0x297f5e['or'](_0x9830('0x89'),_0xd15b93+'%');}else if(qs['isEmail'](_0xd15b93)){_0x297f5e['or'](_0x9830('0x8a'),_0xd15b93+'%');}else{_0x297f5e['or'](_0x9830('0x8b'),qs[_0x9830('0x6c')](_0xd15b93))['or'](_0x9830('0x8c'),qs[_0x9830('0x6c')](_0xd15b93));}}}_0x5eaefc[_0x9830('0x4d')](_0x297f5e);_0x5eaefc[_0x9830('0x8d')]('i.id');var _0x4eb823={'type':db[_0x9830('0x8e')][_0x9830('0x8f')][_0x9830('0x90')],'raw':!![]};var _0x49a9a9=_0x5eaefc[_0x9830('0x91')]();_0x49a9a9[_0x9830('0x50')](_0x9830('0x92'));_0x49a9a9[_0x9830('0x50')](_0x9830('0x93'),_0x9830('0x66'));if(_0x341f61[_0x9830('0x4b')]){_0x341f61[_0x9830('0x4b')][_0x9830('0x34')](function(_0x4e9924){var _0x28e823=_0x4e9924[0x0]===_0x9830('0x94')?_0x4e9924[0x0]:'i.'+_0x4e9924[0x0];_0x5eaefc[_0x9830('0x4b')](_0x28e823,_0x4e9924[0x1]===_0x9830('0x95')?![]:!![]);});}if(!_[_0x9830('0x78')](_0x4f0f6f)){_0x5eaefc[_0x9830('0x68')](_0x51d9e2);_0x49a9a9[_0x9830('0x4d')](_0x9830('0x96'),_0x4f0f6f);}BPromise[_0x9830('0x97')]()[_0x9830('0x2c')](function(){if(!_0x388cc5){if(_0x1ad2f4[_0x9830('0x42')][_0x9830('0x98')])return;_0x49a9a9[_0x9830('0x4d')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x5eaefc[_0x9830('0x4d')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1ad2f4[_0x9830('0x99')]['role']!==_0x9830('0x9a'))return;return _0x1ad2f4[_0x9830('0x99')][_0x9830('0x9b')]({'attributes':['id'],'raw':!![]})[_0x9830('0x2c')](function(_0x57ad10){if(_[_0x9830('0x78')](_0x57ad10)){_0x49a9a9[_0x9830('0x4d')]('i.MailAccountId\x20IS\x20NULL');_0x5eaefc['where'](_0x9830('0x9c'));}else{_0x49a9a9[_0x9830('0x4d')](_0x9830('0x79'),_['map'](_0x57ad10,'id'));_0x5eaefc[_0x9830('0x4d')]('i.MailAccountId\x20IN\x20?',_[_0x9830('0x30')](_0x57ad10,'id'));}});})[_0x9830('0x2c')](function(){if(_0x1ad2f4[_0x9830('0x99')][_0x9830('0x9d')]==='agent'&&!_0x388cc5&&!_0x1ad2f4[_0x9830('0x42')][_0x9830('0x98')])return[];return db[_0x9830('0x9e')][_0x9830('0x42')](_0x49a9a9['toString'](),_0x4eb823);})[_0x9830('0x2c')](function(_0x607419){_0x1511cb['count']=_0x607419[_0x9830('0x47')];if(_0x1511cb['count']===0x0)return[];return db[_0x9830('0x9e')]['query'](_0x153b61[_0x9830('0x9f')](),_0x4eb823)[_0x9830('0x2c')](function(_0xdfc776){_0x2c3554=_[_0x9830('0xa0')](_0xdfc776,'id');_0x4eb823=_[_0x9830('0xa1')](_0x4eb823,{'model':db[_0x9830('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1ad2f4[_0x9830('0x42')][_0x9830('0x46')]){_0x341f61['attributes']['forEach'](function(_0x915a27){_0x5eaefc['field']('i.'+_0x915a27);});}else{_0x5eaefc[_0x9830('0x50')](_0x9830('0x93'),'unreadMessages');_0x5eaefc['field'](_0x9830('0xa2'),_0x9830('0xa3'));_0x5eaefc['field'](_0x9830('0xa4'),'Account.mandatoryDisposition');_0x5eaefc[_0x9830('0x50')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x5eaefc[_0x9830('0x50')](_0x9830('0x92'));_0x5eaefc['field'](_0x9830('0xa5'));_0x5eaefc[_0x9830('0x50')](_0x9830('0xa6'));_0x5eaefc[_0x9830('0x50')](_0x9830('0xa7'));_0x5eaefc[_0x9830('0x50')](_0x9830('0xa8'));_0x5eaefc[_0x9830('0x50')]('i.attach');_0x5eaefc[_0x9830('0x50')]('i.lastMsgAt');_0x5eaefc[_0x9830('0x50')](_0x9830('0xa9'));_0x5eaefc['field'](_0x9830('0xaa'));_0x5eaefc[_0x9830('0x50')]('i.disposition');_0x5eaefc[_0x9830('0x50')](_0x9830('0xab'));_0x5eaefc['field'](_0x9830('0xac'));_0x5eaefc[_0x9830('0x50')](_0x9830('0xad'));_0x5eaefc['field']('i.to');_0x5eaefc[_0x9830('0x50')](_0x9830('0xae'));_0x5eaefc[_0x9830('0x50')](_0x9830('0xaf'));_0x5eaefc['field'](_0x9830('0xb0'));_0x5eaefc['field'](_0x9830('0xb1'),_0x9830('0xb2'));_0x5eaefc[_0x9830('0x50')](_0x9830('0xb3'),_0x9830('0xb4'));_0x5eaefc[_0x9830('0x50')](_0x9830('0xb5'),_0x9830('0xb6'));_0x5eaefc[_0x9830('0x50')](_0x9830('0xb7'),_0x9830('0xb8'));_0x5eaefc[_0x9830('0x50')](_0x9830('0xb9'),_0x9830('0xba'));_0x5eaefc[_0x9830('0x50')](_0x9830('0xbb'),_0x9830('0xbc'));_0x5eaefc[_0x9830('0x50')](_0x9830('0xbd'),_0x9830('0xbe'));_0x5eaefc[_0x9830('0x50')]('o.internal',_0x9830('0xbf'));_0x5eaefc['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9830('0x32'));}if(_0x341f61[_0x9830('0x23')])_0x5eaefc[_0x9830('0x23')](_0x341f61['limit']);if(_0x341f61[_0x9830('0x21')])_0x5eaefc[_0x9830('0x21')](_0x341f61[_0x9830('0x21')]);return db['sequelize'][_0x9830('0x42')](_0x5eaefc[_0x9830('0x9f')](),_0x4eb823);})['then'](function(_0x46fade){if(_0x46fade[_0x9830('0x47')]>0x0)_0x533921[_0x9830('0x4d')](_0x9830('0xc0'),_[_0x9830('0x30')](_0x46fade,'id'));return db[_0x9830('0x9e')][_0x9830('0x42')](_0x533921[_0x9830('0x9f')](),_0x4eb823)[_0x9830('0x2c')](function(_0x1cb057){var _0x168310=_['groupBy'](_0x1cb057,_0x9830('0xc1'));var _0x51ee91=[];return db[_0x9830('0xc2')]['findOne']({'attributes':[_0x9830('0xc3')],'raw':!![]})[_0x9830('0x2c')](function(_0x1e1c24){var _0x4d4250=_0x1e1c24['enableEmailPreview'];_0x46fade[_0x9830('0x34')](function(_0x1ef648){_0x51ee91[_0x9830('0xc4')](updateMailInteraction(_0x1ef648,_0x2c3554,_0x168310,_0x4d4250));});return BPromise[_0x9830('0xc5')](_0x51ee91);});});});})[_0x9830('0x2c')](function(_0x13f553){_0x1511cb[_0x9830('0xc6')]=_0x13f553;return _0x1511cb;})[_0x9830('0x2c')](respondWithFilteredResult(_0x4b097c,_0x341f61))[_0x9830('0x3b')](handleError(_0x4b097c,null));};exports['show']=function(_0x551e5f,_0x15afae){var _0x4f9f95={'raw':![],'where':{'id':_0x551e5f[_0x9830('0xc7')]['id']}},_0x23d26c={};_0x23d26c[_0x9830('0x48')]=_[_0x9830('0x43')](db['MailInteraction'][_0x9830('0x3e')]);_0x23d26c[_0x9830('0x42')]=_[_0x9830('0x43')](_0x551e5f['query']);_0x23d26c[_0x9830('0x44')]=_['intersection'](_0x23d26c[_0x9830('0x48')],_0x23d26c[_0x9830('0x42')]);_0x4f9f95[_0x9830('0x45')]=_[_0x9830('0xc8')](_0x23d26c['model'],qs['fields'](_0x551e5f['query'][_0x9830('0x46')]));_0x4f9f95[_0x9830('0x45')]=_0x4f9f95['attributes'][_0x9830('0x47')]?_0x4f9f95['attributes']:_0x23d26c[_0x9830('0x48')];if(_0x551e5f['query'][_0x9830('0xc9')]){_0x4f9f95[_0x9830('0xca')]=[{'all':!![]}];}_0x4f9f95=_[_0x9830('0xa1')]({},_0x4f9f95,_0x551e5f[_0x9830('0xcb')]);return db[_0x9830('0x3d')][_0x9830('0x65')](_0x4f9f95)[_0x9830('0x2c')](handleEntityNotFound(_0x15afae,null))['then'](respondWithResult(_0x15afae,null))[_0x9830('0x3b')](handleError(_0x15afae,null));};exports[_0x9830('0xcc')]=function(_0x47bc8d,_0x14d90a){return db['MailInteraction'][_0x9830('0xcc')](_0x47bc8d['body'],{})[_0x9830('0x2c')](respondWithResult(_0x14d90a,0xc9))['catch'](handleError(_0x14d90a,null));};exports['update']=function(_0x10ef7c,_0x31dd38){if(_0x10ef7c[_0x9830('0xcd')]['id']){delete _0x10ef7c[_0x9830('0xcd')]['id'];}return db[_0x9830('0x3d')][_0x9830('0x65')]({'where':{'id':_0x10ef7c[_0x9830('0xc7')]['id']}})['then'](handleEntityNotFound(_0x31dd38,null))[_0x9830('0x2c')](saveUpdates(_0x10ef7c[_0x9830('0xcd')],null))[_0x9830('0x2c')](respondWithResult(_0x31dd38,null))[_0x9830('0x3b')](handleError(_0x31dd38,null));};exports[_0x9830('0x2b')]=function(_0x260a71,_0x127ee2){return db[_0x9830('0x3d')][_0x9830('0x65')]({'where':{'id':_0x260a71[_0x9830('0xc7')]['id']}})['then'](handleEntityNotFound(_0x127ee2,null))[_0x9830('0x2c')](removeEntity(_0x127ee2,null))[_0x9830('0x3b')](handleError(_0x127ee2,null));};exports[_0x9830('0xce')]=function(_0x41dd82,_0x275480){return db['MailInteraction'][_0x9830('0xce')]()[_0x9830('0x2c')](respondWithResult(_0x275480,null))[_0x9830('0x3b')](handleError(_0x275480,null));};exports[_0x9830('0xcf')]=function(_0x381c07,_0x51ecee,_0x687213){return db['MailMessage'][_0x9830('0x65')]({'where':{'id':_0x381c07[_0x9830('0xc7')]['id']}})[_0x9830('0x2c')](handleEntityNotFound(_0x51ecee,null))['then'](function(_0xf9ccb1){if(_0xf9ccb1){return _0xf9ccb1[_0x9830('0xcf')](_0x381c07['body'][_0x9830('0xd0')],_[_0x9830('0xd1')](_0x381c07[_0x9830('0xcd')],[_0x9830('0xd0'),'id'])||{});}})[_0x9830('0x2c')](respondWithResult(_0x51ecee,null))[_0x9830('0x3b')](handleError(_0x51ecee,null));};exports[_0x9830('0xd2')]=function(_0x7ff15a,_0x47dd8f,_0xa16e84){var _0x18f0e2={'raw':![],'where':{}};var _0x5db69d={};var _0x538647={'count':0x0,'rows':[]};return db[_0x9830('0x3d')]['findOne']({'where':{'id':_0x7ff15a[_0x9830('0xc7')]['id']}})[_0x9830('0x2c')](handleEntityNotFound(_0x47dd8f,null))['then'](function(_0x4cfeb9){if(_0x4cfeb9){_0x5db69d[_0x9830('0x48')]=_[_0x9830('0x43')](db[_0x9830('0xd3')][_0x9830('0x3e')]);_0x5db69d[_0x9830('0x42')]=_[_0x9830('0x43')](_0x7ff15a['query']);_0x5db69d[_0x9830('0x44')]=_[_0x9830('0xc8')](_0x5db69d[_0x9830('0x48')],_0x5db69d['query']);_0x18f0e2[_0x9830('0x45')]=_[_0x9830('0xc8')](_0x5db69d[_0x9830('0x48')],qs['fields'](_0x7ff15a[_0x9830('0x42')][_0x9830('0x46')]));_0x18f0e2[_0x9830('0x45')]=_0x18f0e2['attributes'][_0x9830('0x47')]?_0x18f0e2[_0x9830('0x45')]:_0x5db69d[_0x9830('0x48')];if(!_0x7ff15a[_0x9830('0x42')][_0x9830('0x49')](_0x9830('0x4a'))){_0x18f0e2[_0x9830('0x23')]=qs[_0x9830('0x23')](_0x7ff15a[_0x9830('0x42')]['limit']);_0x18f0e2[_0x9830('0x21')]=qs['offset'](_0x7ff15a[_0x9830('0x42')]['offset']);}_0x18f0e2[_0x9830('0x4b')]=qs[_0x9830('0x4c')](_0x7ff15a['query'][_0x9830('0x4c')]);_0x18f0e2['where']=qs['filters'](_['pick'](_0x7ff15a[_0x9830('0x42')],_0x5db69d['filters']));_0x18f0e2[_0x9830('0x4d')][_0x9830('0xc1')]=_0x4cfeb9['id'];if(_0x7ff15a[_0x9830('0x42')][_0x9830('0x86')]){_0x18f0e2[_0x9830('0x4d')]=_[_0x9830('0xa1')](_0x18f0e2['where'],{'$or':_[_0x9830('0x30')](_0x18f0e2[_0x9830('0x45')],function(_0x19060d){var _0x7773b3={};_0x7773b3[_0x19060d]={'$like':'%'+_0x7ff15a[_0x9830('0x42')][_0x9830('0x86')]+'%'};return _0x7773b3;})});}if(_0x7ff15a[_0x9830('0x42')][_0x9830('0x7d')]){var _0x24efdb=_0x7ff15a[_0x9830('0x42')][_0x9830('0x7d')][_0x9830('0x33')](',');var _0x5a6605={};_0x5a6605[_0x24efdb[0x0]]={'$gte':moment(_0x24efdb[0x1])[_0x9830('0xd4')](_0x9830('0xd5'))};_0x18f0e2[_0x9830('0x4d')]=_[_0x9830('0xa1')](_0x18f0e2['where'],_0x5a6605);}_0x18f0e2=_[_0x9830('0xa1')]({},_0x18f0e2,_0x7ff15a['options']);return db['MailMessage'][_0x9830('0x24')]({'where':_0x18f0e2[_0x9830('0x4d')]})[_0x9830('0x2c')](function(_0x4f0308){_0x538647[_0x9830('0x24')]=_0x4f0308;if(_0x7ff15a[_0x9830('0x42')][_0x9830('0xc9')]){_0x18f0e2[_0x9830('0xca')]=[{'all':!![]}];}return db[_0x9830('0xd3')][_0x9830('0xd6')](_0x18f0e2);})['then'](function(_0x4f5940){if(_0x7ff15a[_0x9830('0x42')][_0x9830('0xd7')]===_0x9830('0xd8')){for(var _0x36978c=0x0;_0x36978c<_0x4f5940[_0x9830('0x47')];_0x36978c++){_0x4f5940[_0x36978c][_0x9830('0xcd')]=juice(_0x4f5940[_0x36978c]['body']);}}_0x538647['rows']=_0x4f5940;return _0x538647;});}})[_0x9830('0x2c')](respondWithFilteredResult(_0x47dd8f,_0x18f0e2))[_0x9830('0x3b')](handleError(_0x47dd8f,null));};exports[_0x9830('0xd9')]=function(_0x103387,_0x3f48a8,_0x35dcef){return db[_0x9830('0x3d')][_0x9830('0x65')]({'where':{'id':_0x103387[_0x9830('0xc7')]['id']}})[_0x9830('0x2c')](handleEntityNotFound(_0x3f48a8,null))[_0x9830('0x2c')](function(_0x4cbb12){if(_0x4cbb12){return _0x4cbb12[_0x9830('0xda')](_0x103387[_0x9830('0xcd')][_0x9830('0xd0')],_[_0x9830('0xd1')](_0x103387[_0x9830('0xcd')],[_0x9830('0xd0'),'id'])||{})[_0x9830('0xdb')](function(){return db[_0x9830('0x70')]['findAll']({'attributes':['id',_0x9830('0x2e'),_0x9830('0x51')],'where':{'id':_0x103387[_0x9830('0xcd')][_0x9830('0xd0')]}});})[_0x9830('0x2c')](function(_0xc9c3c2){socket[_0x9830('0xdc')]('mailInteractionTags:save',{'id':Number(_0x103387[_0x9830('0xc7')]['id']),'tags':_0xc9c3c2||[]});return{'id':Number(_0x103387[_0x9830('0xc7')]['id']),'tags':_0xc9c3c2||[]};});}})[_0x9830('0x2c')](respondWithResult(_0x3f48a8,null))[_0x9830('0x3b')](handleError(_0x3f48a8,null));};exports[_0x9830('0xdd')]=function(_0x1a2c26,_0x5b4509,_0x5eeed5){return db['MailInteraction']['find']({'where':{'id':_0x1a2c26[_0x9830('0xc7')]['id']}})[_0x9830('0x2c')](handleEntityNotFound(_0x5b4509,null))['then'](function(_0x14860a){if(_0x14860a){return _0x14860a[_0x9830('0xdd')](_0x1a2c26['query'][_0x9830('0xd0')]);}})[_0x9830('0x2c')](respondWithStatusCode(_0x5b4509,null))['catch'](handleError(_0x5b4509,null));};exports['download']=function(_0x1dcdd2,_0x394ef8){var _0x359a85=moment()[_0x9830('0xde')]()[_0x9830('0x9f')]();var _0x3f91e1=path[_0x9830('0xdf')](config[_0x9830('0xe0')],_0x9830('0xe1'),_0x9830('0xe2'),'tmp');var _0x3eb0ba=path[_0x9830('0xdf')](config[_0x9830('0xe0')],_0x9830('0xe1'),'files',_0x9830('0xe3'));var _0x5b328e=path[_0x9830('0xdf')](_0x3f91e1,_0x359a85);var _0x202057=util[_0x9830('0xd4')](_0x9830('0xe4'),_0x1dcdd2[_0x9830('0xc7')]['id'],_0x359a85);var _0x2b3c85=path[_0x9830('0xdf')](_0x3f91e1,_0x202057);var _0x84ef75=[];if(_0x1dcdd2[_0x9830('0x42')][_0x9830('0xe3')]){_0x84ef75[_0x9830('0xc4')]({'model':db[_0x9830('0xe5')],'as':_0x9830('0xe6'),'raw':!![]});}var _0x5f06dd=[{'model':db[_0x9830('0xd3')],'as':_0x9830('0xe7'),'attributes':['id','body',_0x9830('0x52'),'to','cc',_0x9830('0xe8'),_0x9830('0xe9'),'createdAt'],'where':{'secret':![]},'order':qs[_0x9830('0x4c')]('id'),'include':_0x84ef75}];return db[_0x9830('0x3d')]['find']({'where':{'id':_0x1dcdd2[_0x9830('0xc7')]['id']},'include':_0x5f06dd})[_0x9830('0x2c')](handleEntityNotFound(_0x394ef8,null))[_0x9830('0x2c')](function(_0x4e573a){if(_0x4e573a&&_0x4e573a[_0x9830('0xe7')]){var _0x11135a=_0x4e573a['get']({'plain':!![]});fs[_0x9830('0xea')](_0x5b328e);return BPromise[_0x9830('0xeb')](_0x11135a['Messages'],function(_0x53fcc3,_0x3886db){var _0x378fad={'from':_0x53fcc3['from'],'to':_0x53fcc3['to'],'subject':_0x53fcc3[_0x9830('0xe9')],'html':_0x53fcc3[_0x9830('0xcd')],'headers':{'Date':moment(_0x53fcc3[_0x9830('0x7b')])['format'](_0x9830('0xec'))},'attachments':[]};if(_0x53fcc3['cc']){_0x378fad[_0x9830('0xed')]['Cc']=_0x53fcc3['cc'];}if(_0x53fcc3['bcc']){_0x378fad[_0x9830('0xed')][_0x9830('0xee')]=_0x53fcc3[_0x9830('0xe8')];}return new BPromise(function(_0xbba47f,_0x23b557){if(_0x53fcc3[_0x9830('0xe6')]){for(var _0x5a22f5=0x0;_0x5a22f5<_0x53fcc3[_0x9830('0xe6')][_0x9830('0x47')];_0x5a22f5++){var _0x4bcfd0=_0x53fcc3[_0x9830('0xe6')][_0x5a22f5];var _0x3cc1e2=path[_0x9830('0xdf')](_0x3eb0ba,_0x4bcfd0[_0x9830('0xef')]);if(fs[_0x9830('0xf0')](_0x3cc1e2)){_0x378fad[_0x9830('0xe3')][_0x9830('0xc4')]({'name':_0x4bcfd0[_0x9830('0x2e')],'contentType':_0x4bcfd0[_0x9830('0x40')],'data':fs[_0x9830('0xf1')](_0x3cc1e2)});}}}emlformat[_0x9830('0xf2')](_0x378fad,function(_0x1c4c86,_0x37bbc7){if(_0x1c4c86)return _0x23b557(_0x1c4c86);fs[_0x9830('0xf3')](path[_0x9830('0xdf')](_0x5b328e,util['format'](_0x9830('0xf4'),_0x3886db)),_0x37bbc7);return _0xbba47f(_0x37bbc7);});});})[_0x9830('0x2c')](function(){return new BPromise(function(_0x1370c7,_0x2a80e5){zipdir(_0x5b328e,{'saveTo':_0x2b3c85},function(_0x257fdb,_0x850e9b){if(_0x257fdb)return _0x2a80e5(_0x257fdb);return _0x1370c7(_0x850e9b);});})[_0x9830('0x2c')](function(){return new BPromise(function(_0x300d82,_0x27ed24){rimraf(_0x5b328e,function(_0x2db2af){if(_0x2db2af)_0x27ed24(_0x2db2af);return _0x300d82();});});})['then'](function(){return _0x394ef8[_0x9830('0xf5')](_0x2b3c85,_0x202057,function(_0x4f4f6c){if(_0x4f4f6c){console[_0x9830('0xf6')](_0x9830('0xf7'),_0x4f4f6c);}else{fs[_0x9830('0xf8')](_0x2b3c85);}});});});}else{return _0x394ef8[_0x9830('0x1f')](0xc8);}})[_0x9830('0x3b')](handleError(_0x394ef8,null));}; \ No newline at end of file +var _0x210c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','catch','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.MailInteractionId','from','left_join','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','union','User','UserId','text','some','MailAccountId','i.MailAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','MailInteraction','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.substatus','i.MailAccountId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','Owner.fullname','o.internal','Owner.internal','ui.MailInteractionId\x20IN\x20?','Setting','enableEmailPreview','all','rows','show','params','options','create','body','describe','addMessage','ids','getMessages','filter','format','includeAll','include','findAll','inlineCss','true','omit','spread','emit','removeTags','download','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','bcc','subject','createdAt','Messages','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','build','message%d.eml','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2cd6ed,_0x5b5051){var _0x44537b=function(_0x343f0a){while(--_0x343f0a){_0x2cd6ed['push'](_0x2cd6ed['shift']());}};_0x44537b(++_0x5b5051);}(_0x210c,0x1d0));var _0xc210=function(_0x26a672,_0x59f5be){_0x26a672=_0x26a672-0x0;var _0x348f43=_0x210c[_0x26a672];return _0x348f43;};'use strict';var emlformat=require(_0xc210('0x0'));var rimraf=require(_0xc210('0x1'));var zipdir=require(_0xc210('0x2'));var jsonpatch=require(_0xc210('0x3'));var rp=require(_0xc210('0x4'));var moment=require(_0xc210('0x5'));var BPromise=require(_0xc210('0x6'));var Mustache=require(_0xc210('0x7'));var util=require(_0xc210('0x8'));var path=require(_0xc210('0x9'));var sox=require(_0xc210('0xa'));var csv=require(_0xc210('0xb'));var ejs=require(_0xc210('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc210('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc210('0xe'));var deskjs=require(_0xc210('0xf'));var toCsv=require(_0xc210('0xb'));var querystring=require('querystring');var Papa=require(_0xc210('0x10'));var htmlToText=require(_0xc210('0x11'));var juice=require(_0xc210('0x12'));var Redis=require(_0xc210('0x13'));var authService=require(_0xc210('0x14'));var qs=require(_0xc210('0x15'));var as=require(_0xc210('0x16'));var hardwareService=require(_0xc210('0x17'));var logger=require(_0xc210('0x18'))(_0xc210('0x19'));var utils=require(_0xc210('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xc210('0x1b'));var db=require(_0xc210('0x1c'))['db'];config[_0xc210('0x1d')]=_[_0xc210('0x1e')](config[_0xc210('0x1d')],{'host':_0xc210('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0xc210('0x20')](socket);function respondWithStatusCode(_0x40ee06,_0x4a6b16){_0x4a6b16=_0x4a6b16||0xcc;return function(_0x267d79){if(_0x267d79){return _0x40ee06[_0xc210('0x21')](_0x4a6b16);}return _0x40ee06[_0xc210('0x22')](_0x4a6b16)[_0xc210('0x23')]();};}function respondWithResult(_0x2511c3,_0x1e05c7){_0x1e05c7=_0x1e05c7||0xc8;return function(_0x39b0cf){if(_0x39b0cf){return _0x2511c3[_0xc210('0x22')](_0x1e05c7)['json'](_0x39b0cf);}};}function respondWithFilteredResult(_0x217a52,_0x47fd11){return function(_0x3ccbc5){if(_0x3ccbc5){var _0x58db9f=typeof _0x47fd11[_0xc210('0x24')]===_0xc210('0x25')&&typeof _0x47fd11[_0xc210('0x26')]==='undefined';var _0x5def9c=_0x3ccbc5['count'];var _0x507ea3=_0x58db9f?0x0:_0x47fd11[_0xc210('0x24')];var _0xa895ef=_0x58db9f?_0x3ccbc5['count']:_0x47fd11[_0xc210('0x24')]+_0x47fd11[_0xc210('0x26')];var _0x45f0de;if(_0xa895ef>=_0x5def9c){_0xa895ef=_0x5def9c;_0x45f0de=0xc8;}else{_0x45f0de=0xce;}_0x217a52[_0xc210('0x22')](_0x45f0de);return _0x217a52['set'](_0xc210('0x27'),_0x507ea3+'-'+_0xa895ef+'/'+_0x5def9c)[_0xc210('0x28')](_0x3ccbc5);}return null;};}function patchUpdates(_0x575600){return function(_0x10cddf){try{jsonpatch[_0xc210('0x29')](_0x10cddf,_0x575600,!![]);}catch(_0x252ef9){return BPromise['reject'](_0x252ef9);}return _0x10cddf[_0xc210('0x2a')]();};}function saveUpdates(_0x34307a,_0x2c4264){return function(_0x1e1945){if(_0x1e1945){return _0x1e1945[_0xc210('0x2b')](_0x34307a)[_0xc210('0x2c')](function(_0x52021d){return _0x52021d;});}return null;};}function removeEntity(_0x59bb94,_0xa98200){return function(_0x20bc54){if(_0x20bc54){return _0x20bc54[_0xc210('0x2d')]()[_0xc210('0x2c')](function(){_0x59bb94[_0xc210('0x22')](0xcc)[_0xc210('0x23')]();});}};}function handleEntityNotFound(_0x3a4fa4,_0x9336ee){return function(_0x4cf042){if(!_0x4cf042){_0x3a4fa4[_0xc210('0x21')](0x194);}return _0x4cf042;};}function handleError(_0x230cd4,_0x3964d4){_0x3964d4=_0x3964d4||0x1f4;return function(_0x189c1f){logger[_0xc210('0x2e')](_0x189c1f[_0xc210('0x2f')]);if(_0x189c1f[_0xc210('0x30')]){delete _0x189c1f[_0xc210('0x30')];}_0x230cd4[_0xc210('0x22')](_0x3964d4)[_0xc210('0x31')](_0x189c1f);};}function getInteractionUsers(_0x1beeff,_0x1fc585){return new BPromise(function(_0x5a1e93,_0x534cba){try{if(_0x1fc585[_0x1beeff['id']]){_0x1beeff[_0xc210('0x32')]=_[_0xc210('0x33')](_0x1fc585[_0x1beeff['id']],function(_0x55fe1e){return{'id':_0x55fe1e['id'],'fullname':_0x55fe1e[_0xc210('0x34')]};});}}catch(_0x357611){_0x534cba(_0x357611);}_0x5a1e93(_0x1beeff);});}function getInteractionTags(_0x513bc4,_0x39aab2){return new BPromise(function(_0x41fc89,_0x2aa831){try{if(_0x513bc4[_0xc210('0x35')]){_0x513bc4[_0xc210('0x36')]=[];_0x513bc4[_0xc210('0x35')][_0xc210('0x37')](',')[_0xc210('0x38')](function(_0x1e3311){_0x513bc4[_0xc210('0x36')][_0xc210('0x39')](_0x39aab2[_0x1e3311]);});}delete _0x513bc4['TagIds'];}catch(_0x3a9654){_0x2aa831(_0x3a9654);}_0x41fc89(_0x513bc4);});}function getLastMessageText(_0x624118){return new BPromise(function(_0x8ff02d,_0x319099){return db[_0xc210('0x3a')][_0xc210('0x3b')]({'where':{'$and':[{'MailInteractionId':_0x624118['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xc210('0x3c')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xc210('0x3d')],'order':_0xc210('0x3e'),'raw':!![]})[_0xc210('0x2c')](function(_0x59dec9){if(_0x59dec9&&_0x59dec9[_0xc210('0x3d')]){_0x624118[_0xc210('0x3f')]=_['trimStart'](_0x59dec9[_0xc210('0x3d')]);}_0x8ff02d(_0x624118);})[_0xc210('0x40')](function(_0x580545){_0x319099(_0x580545);});});}function updateMailInteraction(_0x12cf82,_0x438ec2,_0x566176,_0xe2ab78){return new BPromise(function(_0x52e31f,_0x5d2767){return getInteractionUsers(_0x12cf82,_0x566176)['then'](function(_0x2b8703){return getInteractionTags(_0x2b8703,_0x438ec2);})[_0xc210('0x2c')](function(_0x31c4d5){if(_0xe2ab78){_0x52e31f(getLastMessageText(_0x31c4d5));}else{_0x52e31f(_0x31c4d5);}})[_0xc210('0x40')](function(_0x2b9471){_0x5d2767(_0x2b9471);});});}exports[_0xc210('0x41')]=function(_0x2a2105,_0x58b953){var _0x4baab4={},_0x90a608={},_0xe86040={'count':0x0,'rows':[]};var _0x531e2e=_[_0xc210('0x33')](db['MailInteraction'][_0xc210('0x42')],function(_0xbbe8cd){return{'name':_0xbbe8cd['fieldName'],'type':_0xbbe8cd[_0xc210('0x43')][_0xc210('0x44')]};});_0x90a608[_0xc210('0x45')]=_['map'](_0x531e2e,_0xc210('0x30'));_0x90a608[_0xc210('0x46')]=_[_0xc210('0x47')](_0x2a2105[_0xc210('0x46')]);_0x90a608[_0xc210('0x48')]=_[_0xc210('0x49')](_0x90a608[_0xc210('0x45')],_0x90a608[_0xc210('0x46')]);_0x4baab4[_0xc210('0x4a')]=_['intersection'](_0x90a608[_0xc210('0x45')],qs['fields'](_0x2a2105[_0xc210('0x46')][_0xc210('0x4b')]));_0x4baab4[_0xc210('0x4a')]=_0x4baab4['attributes'][_0xc210('0x4c')]?_0x4baab4['attributes']:_0x90a608[_0xc210('0x45')];if(!_0x2a2105[_0xc210('0x46')][_0xc210('0x4d')](_0xc210('0x4e'))){_0x4baab4[_0xc210('0x26')]=qs[_0xc210('0x26')](_0x2a2105[_0xc210('0x46')][_0xc210('0x26')]);_0x4baab4[_0xc210('0x24')]=qs[_0xc210('0x24')](_0x2a2105[_0xc210('0x46')][_0xc210('0x24')]);}_0x4baab4['order']=qs['sort'](_0x2a2105[_0xc210('0x46')][_0xc210('0x4f')]);_0x4baab4[_0xc210('0x50')]=qs[_0xc210('0x48')](_[_0xc210('0x51')](_0x2a2105['query'],_0x90a608[_0xc210('0x48')]),_0x531e2e);var _0xf5b26a=[];var _0x5035cf=squel[_0xc210('0x52')]()[_0xc210('0x53')]('id')['field'](_0xc210('0x30'))[_0xc210('0x53')](_0xc210('0x54'))['from'](_0xc210('0x55'));var _0x45ea3c=squel['select']()['field'](_0xc210('0x56'))[_0xc210('0x53')](_0xc210('0x57'))[_0xc210('0x53')](_0xc210('0x58'))[_0xc210('0x59')]('user_has_mail_interactions','ui')[_0xc210('0x5a')]('users','u','u.id\x20=\x20ui.UserId');var _0x46adf7=squel[_0xc210('0x52')]()[_0xc210('0x59')](_0xc210('0x5b'),'i')[_0xc210('0x5a')](_0xc210('0x5c'),'c',_0xc210('0x5d'))[_0xc210('0x5a')](_0xc210('0x5e'),'o',_0xc210('0x5f'))[_0xc210('0x5a')]('mail_accounts','a',_0xc210('0x60'))[_0xc210('0x5a')](_0xc210('0x61'),'me',_0xc210('0x62'))['left_join'](_0xc210('0x63'),'it',_0xc210('0x64'))[_0xc210('0x5a')]('tools_tags','t',_0xc210('0x65'));var _0xa0b05d=squel[_0xc210('0x66')]();var _0x9f100e=[];var _0x8d1bbf=squel['expr']();var _0x38199f;if(_0x2a2105['query'][_0xc210('0x67')]){_0x38199f=as[_0xc210('0x68')](_0x2a2105[_0xc210('0x46')][_0xc210('0x67')]);var _0x2951be=_0x38199f[_0xc210('0x69')];for(var _0x20455f=0x0;_0x20455f<_0x38199f[_0xc210('0x6a')][_0xc210('0x4c')];_0x20455f++){var _0x4fc227=_0x38199f[_0xc210('0x6a')][_0x20455f];var _0x30a305='i';var _0x3017dc=_['find'](_0x531e2e,['name',_0x4fc227[_0xc210('0x53')]]);if(!_0x3017dc){switch(_0x4fc227[_0xc210('0x53')]){case _0xc210('0x6b'):if(_0x4fc227[_0xc210('0x6c')]==0x1){_0x46adf7[_0xc210('0x6d')]('`'+_0x4fc227['field']+_0xc210('0x6e'));}else{_0x46adf7[_0xc210('0x6d')]('`'+_0x4fc227['field']+_0xc210('0x6f'));}break;case _0xc210('0x70'):if(_0x4fc227[_0xc210('0x71')]===_0xc210('0x72')){if(_0x4fc227[_0xc210('0x6c')][_0xc210('0x37')]('\x20')[_0xc210('0x4c')]>0x1){_0xa0b05d[_0x2951be]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4fc227[_0xc210('0x6c')]),null);}else{var _0x81b435='%'+_0x4fc227[_0xc210('0x6c')]+'%';_0xa0b05d[_0x2951be](_0xc210('0x73'),_0x81b435,_0x81b435,_0x81b435);}}else{_0x3017dc=_[_0xc210('0x74')](_0x531e2e,[_0xc210('0x30'),_0xc210('0x75')]);_0x4fc227[_0xc210('0x53')]=_0xc210('0x75');_0x2bc5f8=as[_0xc210('0x76')](_0x30a305,_0x3017dc[_0xc210('0x43')],_0x4fc227);_0xa0b05d[_0x2951be](_0x2bc5f8['text'],_0x2bc5f8['value'][_0xc210('0x77')],_0x2bc5f8[_0xc210('0x6c')][_0xc210('0x23')]);}break;case _0xc210('0x78'):var _0x8e7a45=_0x4fc227['value'][_0xc210('0x37')](',')[_0xc210('0x33')](function(_0x384d24){return Number(_0x384d24);});_0x8e7a45['forEach'](function(_0x435015){_0x8d1bbf['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x435015+',%');});_0x9f100e=_[_0xc210('0x79')](_0x9f100e,_0x8e7a45);break;case _0xc210('0x7a'):if(_0x4fc227[_0xc210('0x71')]===_0xc210('0x72')){_0xa0b05d[_0x2951be]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4fc227[_0xc210('0x6c')]+'%',null);}else{_0x3017dc=_[_0xc210('0x74')](_0x531e2e,[_0xc210('0x30'),_0xc210('0x7b')]);_0x4fc227['field']=_0xc210('0x7b');_0x2bc5f8=as[_0xc210('0x76')](_0x30a305,_0x3017dc['type'],_0x4fc227);_0xa0b05d[_0x2951be](_0x2bc5f8[_0xc210('0x7c')],_0x2bc5f8['value'][_0xc210('0x77')],_0x2bc5f8['value'][_0xc210('0x23')]);}break;case _0xc210('0x3d'):_0x2bc5f8=as[_0xc210('0x76')]('me',null,_0x4fc227);_0xa0b05d[_0x2951be](_0x2bc5f8[_0xc210('0x7c')],_0x2bc5f8[_0xc210('0x6c')][_0xc210('0x77')],_0x2bc5f8['value']['end']);break;}}else{var _0x2bc5f8=as[_0xc210('0x76')](_0x30a305,_0x3017dc[_0xc210('0x43')],_0x4fc227);_0xa0b05d[_0x2951be](_0x2bc5f8[_0xc210('0x7c')],_0x2bc5f8[_0xc210('0x6c')]['start'],_0x2bc5f8[_0xc210('0x6c')][_0xc210('0x23')]);}}}else{var _0x5a7dd1=_(_0x2a2105['query'])[_0xc210('0x47')]()[_0xc210('0x33')](function(_0x31cc91){return _[_0xc210('0x7d')](_0x531e2e,[_0xc210('0x30'),_0x31cc91])?_0x31cc91:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x5a7dd1)){_0x5a7dd1[_0xc210('0x38')](function(_0x428121){if(_0x428121===_0xc210('0x7e')){_0x46adf7['where'](_0xc210('0x7f'),[][_0xc210('0x80')](_0x2a2105['query'][_0x428121]));}else if(_0x428121==='createdAt'){var _0x10f25b=JSON[_0xc210('0x81')](_0x2a2105[_0xc210('0x46')][_0x428121])[_0xc210('0x82')];var _0x173f98=JSON[_0xc210('0x81')](_0x2a2105[_0xc210('0x46')][_0x428121])[_0xc210('0x83')];_0x46adf7[_0xc210('0x50')](_0xc210('0x84'),_0x10f25b,_0x173f98);}else{if(_0x2a2105[_0xc210('0x46')][_0x428121]==='null'){_0x46adf7[_0xc210('0x50')]('i.'+_0x428121+_0xc210('0x85'));}else{_0x46adf7['where']('i.'+_0x428121+_0xc210('0x86'),_0x2a2105['query'][_0x428121]);}}});}if(_0x2a2105[_0xc210('0x46')][_0xc210('0x87')]){if(_0x2a2105[_0xc210('0x46')][_0xc210('0x87')]==0x1){_0x46adf7[_0xc210('0x6d')](_0xc210('0x88'));}else{_0x46adf7['having']('`unreadMessages`\x20>\x200');}}if(_0x2a2105[_0xc210('0x46')][_0xc210('0x89')]){_0x9f100e=_[_0xc210('0x8a')](_0x2a2105[_0xc210('0x46')]['tag'])?_0x2a2105['query'][_0xc210('0x89')]:new Array(_0x2a2105[_0xc210('0x46')][_0xc210('0x89')]);_0x9f100e['forEach'](function(_0x81ba83){_0x8d1bbf['or'](_0xc210('0x8b'),'%,'+_0x81ba83+',%');});}if(_0x2a2105[_0xc210('0x46')]['filter']){var _0x5a030d=_0x2a2105[_0xc210('0x46')]['filter'][_0xc210('0x8c')]('\x5c','\x5c\x5c')[_0xc210('0x8c')](/'/g,'\x27\x27');if(qs[_0xc210('0x8d')](_0x5a030d)){_0xa0b05d['or'](_0xc210('0x8e'),_0x5a030d+'%');}else if(qs['isEmail'](_0x5a030d)){_0xa0b05d['or']('c.email\x20LIKE\x20?',_0x5a030d+'%');}else{_0xa0b05d['or'](_0xc210('0x8f'),qs[_0xc210('0x90')](_0x5a030d))['or'](_0xc210('0x91'),qs['getFullTextValue'](_0x5a030d));}}}_0x46adf7['where'](_0xa0b05d);_0x46adf7[_0xc210('0x92')](_0xc210('0x93'));var _0x13a93b={'type':db[_0xc210('0x94')]['QueryTypes'][_0xc210('0x95')],'raw':!![]};var _0xfe3f05=_0x46adf7[_0xc210('0x96')]();_0xfe3f05['field'](_0xc210('0x93'));_0xfe3f05['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc210('0x6b'));if(_0x4baab4[_0xc210('0x97')]){_0x4baab4[_0xc210('0x97')]['forEach'](function(_0x403946){var _0x4105bb=_0x403946[0x0]===_0xc210('0x98')?_0x403946[0x0]:'i.'+_0x403946[0x0];_0x46adf7[_0xc210('0x97')](_0x4105bb,_0x403946[0x1]===_0xc210('0x99')?![]:!![]);});}if(!_[_0xc210('0x9a')](_0x9f100e)){_0x46adf7[_0xc210('0x6d')](_0x8d1bbf);_0xfe3f05[_0xc210('0x50')](_0xc210('0x9b'),_0x9f100e);}BPromise[_0xc210('0x9c')]()[_0xc210('0x2c')](function(){if(!_0x38199f){if(_0x2a2105[_0xc210('0x46')][_0xc210('0x7e')])return;_0xfe3f05[_0xc210('0x50')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x46adf7[_0xc210('0x50')](_0xc210('0x9d'));return;}if(_0x2a2105[_0xc210('0x9e')][_0xc210('0x9f')]!=='agent')return;return _0x2a2105[_0xc210('0x9e')][_0xc210('0xa0')]({'attributes':['id'],'raw':!![]})[_0xc210('0x2c')](function(_0x130129){if(_['isEmpty'](_0x130129)){_0xfe3f05['where'](_0xc210('0xa1'));_0x46adf7[_0xc210('0x50')](_0xc210('0xa1'));}else{_0xfe3f05[_0xc210('0x50')](_0xc210('0x7f'),_[_0xc210('0x33')](_0x130129,'id'));_0x46adf7[_0xc210('0x50')]('i.MailAccountId\x20IN\x20?',_[_0xc210('0x33')](_0x130129,'id'));}});})[_0xc210('0x2c')](function(){if(_0x2a2105['user'][_0xc210('0x9f')]==='agent'&&!_0x38199f&&!_0x2a2105[_0xc210('0x46')]['MailAccountId'])return[];return db[_0xc210('0xa2')][_0xc210('0x46')](_0xfe3f05[_0xc210('0xa3')](),_0x13a93b);})[_0xc210('0x2c')](function(_0x517771){_0xe86040[_0xc210('0xa4')]=_0x517771[_0xc210('0x4c')];if(_0xe86040['count']===0x0)return[];return db[_0xc210('0xa2')][_0xc210('0x46')](_0x5035cf[_0xc210('0xa3')](),_0x13a93b)[_0xc210('0x2c')](function(_0x252e30){_0xf5b26a=_[_0xc210('0xa5')](_0x252e30,'id');_0x13a93b=_[_0xc210('0xa6')](_0x13a93b,{'model':db[_0xc210('0xa7')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2a2105[_0xc210('0x46')][_0xc210('0x4b')]){_0x4baab4[_0xc210('0x4a')]['forEach'](function(_0xab6cf1){_0x46adf7['field']('i.'+_0xab6cf1);});}else{_0x46adf7[_0xc210('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc210('0x6b'));_0x46adf7[_0xc210('0x53')](_0xc210('0xa8'),_0xc210('0xa9'));_0x46adf7['field']('a.mandatoryDisposition',_0xc210('0xaa'));_0x46adf7[_0xc210('0x53')](_0xc210('0xab'),_0xc210('0x98'));_0x46adf7[_0xc210('0x53')](_0xc210('0x93'));_0x46adf7[_0xc210('0x53')](_0xc210('0xac'));_0x46adf7['field'](_0xc210('0xad'));_0x46adf7['field'](_0xc210('0xae'));_0x46adf7[_0xc210('0x53')](_0xc210('0xaf'));_0x46adf7[_0xc210('0x53')]('i.attach');_0x46adf7[_0xc210('0x53')](_0xc210('0xb0'));_0x46adf7['field'](_0xc210('0xb1'));_0x46adf7[_0xc210('0x53')](_0xc210('0xb2'));_0x46adf7[_0xc210('0x53')](_0xc210('0xb3'));_0x46adf7['field'](_0xc210('0xb4'));_0x46adf7[_0xc210('0x53')]('i.thirdDisposition');_0x46adf7[_0xc210('0x53')](_0xc210('0xb5'));_0x46adf7[_0xc210('0x53')]('i.to');_0x46adf7[_0xc210('0x53')]('i.ContactId');_0x46adf7[_0xc210('0x53')](_0xc210('0xb6'));_0x46adf7[_0xc210('0x53')]('i.UserId');_0x46adf7[_0xc210('0x53')](_0xc210('0xb7'),_0xc210('0xb8'));_0x46adf7[_0xc210('0x53')](_0xc210('0xb9'),_0xc210('0xba'));_0x46adf7[_0xc210('0x53')](_0xc210('0xbb'),'Contact.email');_0x46adf7['field'](_0xc210('0xbc'),'Contact.phone');_0x46adf7['field'](_0xc210('0xbd'),_0xc210('0xbe'));_0x46adf7['field']('c.fax','Contact.fax');_0x46adf7[_0xc210('0x53')]('o.fullname',_0xc210('0xbf'));_0x46adf7[_0xc210('0x53')](_0xc210('0xc0'),_0xc210('0xc1'));_0x46adf7[_0xc210('0x53')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x4baab4[_0xc210('0x26')])_0x46adf7[_0xc210('0x26')](_0x4baab4[_0xc210('0x26')]);if(_0x4baab4[_0xc210('0x24')])_0x46adf7[_0xc210('0x24')](_0x4baab4[_0xc210('0x24')]);return db[_0xc210('0xa2')]['query'](_0x46adf7[_0xc210('0xa3')](),_0x13a93b);})['then'](function(_0x3c7947){if(_0x3c7947[_0xc210('0x4c')]>0x0)_0x45ea3c[_0xc210('0x50')](_0xc210('0xc2'),_['map'](_0x3c7947,'id'));return db[_0xc210('0xa2')][_0xc210('0x46')](_0x45ea3c[_0xc210('0xa3')](),_0x13a93b)[_0xc210('0x2c')](function(_0x8ab8b6){var _0x34589e=_['groupBy'](_0x8ab8b6,'MailInteractionId');var _0x4ff475=[];return db[_0xc210('0xc3')][_0xc210('0x3b')]({'attributes':[_0xc210('0xc4')],'raw':!![]})[_0xc210('0x2c')](function(_0x567f9d){var _0x30ef97=_0x567f9d['enableEmailPreview'];_0x3c7947[_0xc210('0x38')](function(_0x12091b){_0x4ff475[_0xc210('0x39')](updateMailInteraction(_0x12091b,_0xf5b26a,_0x34589e,_0x30ef97));});return BPromise[_0xc210('0xc5')](_0x4ff475);});});});})[_0xc210('0x2c')](function(_0x302fee){_0xe86040[_0xc210('0xc6')]=_0x302fee;return _0xe86040;})[_0xc210('0x2c')](respondWithFilteredResult(_0x58b953,_0x4baab4))[_0xc210('0x40')](handleError(_0x58b953,null));};exports[_0xc210('0xc7')]=function(_0x257452,_0x360e47){var _0x4544e7={'raw':![],'where':{'id':_0x257452[_0xc210('0xc8')]['id']}},_0x261c3a={};_0x261c3a['model']=_[_0xc210('0x47')](db[_0xc210('0xa7')][_0xc210('0x42')]);_0x261c3a[_0xc210('0x46')]=_[_0xc210('0x47')](_0x257452[_0xc210('0x46')]);_0x261c3a['filters']=_[_0xc210('0x49')](_0x261c3a['model'],_0x261c3a[_0xc210('0x46')]);_0x4544e7[_0xc210('0x4a')]=_['intersection'](_0x261c3a[_0xc210('0x45')],qs[_0xc210('0x4b')](_0x257452['query'][_0xc210('0x4b')]));_0x4544e7['attributes']=_0x4544e7[_0xc210('0x4a')][_0xc210('0x4c')]?_0x4544e7['attributes']:_0x261c3a[_0xc210('0x45')];if(_0x257452[_0xc210('0x46')]['includeAll']){_0x4544e7['include']=[{'all':!![]}];}_0x4544e7=_[_0xc210('0xa6')]({},_0x4544e7,_0x257452[_0xc210('0xc9')]);return db[_0xc210('0xa7')][_0xc210('0x74')](_0x4544e7)[_0xc210('0x2c')](handleEntityNotFound(_0x360e47,null))[_0xc210('0x2c')](respondWithResult(_0x360e47,null))[_0xc210('0x40')](handleError(_0x360e47,null));};exports['create']=function(_0x1ecffb,_0x37e23c){return db[_0xc210('0xa7')][_0xc210('0xca')](_0x1ecffb[_0xc210('0xcb')],{})[_0xc210('0x2c')](respondWithResult(_0x37e23c,0xc9))[_0xc210('0x40')](handleError(_0x37e23c,null));};exports[_0xc210('0x2b')]=function(_0x5306de,_0x7b5846){if(_0x5306de[_0xc210('0xcb')]['id']){delete _0x5306de[_0xc210('0xcb')]['id'];}return db[_0xc210('0xa7')]['find']({'where':{'id':_0x5306de[_0xc210('0xc8')]['id']}})[_0xc210('0x2c')](handleEntityNotFound(_0x7b5846,null))['then'](saveUpdates(_0x5306de[_0xc210('0xcb')],null))['then'](respondWithResult(_0x7b5846,null))[_0xc210('0x40')](handleError(_0x7b5846,null));};exports[_0xc210('0x2d')]=function(_0x42e1fe,_0x1b10d8){return db['MailInteraction'][_0xc210('0x74')]({'where':{'id':_0x42e1fe['params']['id']}})[_0xc210('0x2c')](handleEntityNotFound(_0x1b10d8,null))[_0xc210('0x2c')](removeEntity(_0x1b10d8,null))['catch'](handleError(_0x1b10d8,null));};exports[_0xc210('0xcc')]=function(_0xdda48,_0x2a41ce){return db[_0xc210('0xa7')][_0xc210('0xcc')]()[_0xc210('0x2c')](respondWithResult(_0x2a41ce,null))[_0xc210('0x40')](handleError(_0x2a41ce,null));};exports[_0xc210('0xcd')]=function(_0x280e83,_0x576a0e,_0x328edf){return db['MailMessage']['find']({'where':{'id':_0x280e83[_0xc210('0xc8')]['id']}})[_0xc210('0x2c')](handleEntityNotFound(_0x576a0e,null))['then'](function(_0x185836){if(_0x185836){return _0x185836['addMessage'](_0x280e83[_0xc210('0xcb')][_0xc210('0xce')],_['omit'](_0x280e83[_0xc210('0xcb')],[_0xc210('0xce'),'id'])||{});}})[_0xc210('0x2c')](respondWithResult(_0x576a0e,null))[_0xc210('0x40')](handleError(_0x576a0e,null));};exports[_0xc210('0xcf')]=function(_0x114ba0,_0x72d0c9,_0x533fb){var _0x162a28={'raw':![],'where':{}};var _0x24bdd6={};var _0x80d3b8={'count':0x0,'rows':[]};return db[_0xc210('0xa7')]['findOne']({'where':{'id':_0x114ba0[_0xc210('0xc8')]['id']}})[_0xc210('0x2c')](handleEntityNotFound(_0x72d0c9,null))[_0xc210('0x2c')](function(_0x1ae795){if(_0x1ae795){_0x24bdd6[_0xc210('0x45')]=_[_0xc210('0x47')](db['MailMessage'][_0xc210('0x42')]);_0x24bdd6[_0xc210('0x46')]=_[_0xc210('0x47')](_0x114ba0[_0xc210('0x46')]);_0x24bdd6[_0xc210('0x48')]=_[_0xc210('0x49')](_0x24bdd6['model'],_0x24bdd6[_0xc210('0x46')]);_0x162a28[_0xc210('0x4a')]=_['intersection'](_0x24bdd6['model'],qs[_0xc210('0x4b')](_0x114ba0[_0xc210('0x46')][_0xc210('0x4b')]));_0x162a28[_0xc210('0x4a')]=_0x162a28[_0xc210('0x4a')][_0xc210('0x4c')]?_0x162a28[_0xc210('0x4a')]:_0x24bdd6[_0xc210('0x45')];if(!_0x114ba0[_0xc210('0x46')]['hasOwnProperty'](_0xc210('0x4e'))){_0x162a28[_0xc210('0x26')]=qs[_0xc210('0x26')](_0x114ba0[_0xc210('0x46')]['limit']);_0x162a28[_0xc210('0x24')]=qs[_0xc210('0x24')](_0x114ba0[_0xc210('0x46')][_0xc210('0x24')]);}_0x162a28['order']=qs[_0xc210('0x4f')](_0x114ba0['query'][_0xc210('0x4f')]);_0x162a28[_0xc210('0x50')]=qs[_0xc210('0x48')](_[_0xc210('0x51')](_0x114ba0['query'],_0x24bdd6[_0xc210('0x48')]));_0x162a28[_0xc210('0x50')]['MailInteractionId']=_0x1ae795['id'];if(_0x114ba0['query']['filter']){_0x162a28[_0xc210('0x50')]=_[_0xc210('0xa6')](_0x162a28[_0xc210('0x50')],{'$or':_[_0xc210('0x33')](_0x162a28[_0xc210('0x4a')],function(_0x3ad89d){var _0x549f6c={};_0x549f6c[_0x3ad89d]={'$like':'%'+_0x114ba0['query'][_0xc210('0xd0')]+'%'};return _0x549f6c;})});}if(_0x114ba0[_0xc210('0x46')][_0xc210('0x82')]){var _0x32ef9e=_0x114ba0['query']['$gte']['split'](',');var _0x3fd996={};_0x3fd996[_0x32ef9e[0x0]]={'$gte':moment(_0x32ef9e[0x1])[_0xc210('0xd1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x162a28[_0xc210('0x50')]=_[_0xc210('0xa6')](_0x162a28['where'],_0x3fd996);}_0x162a28=_[_0xc210('0xa6')]({},_0x162a28,_0x114ba0[_0xc210('0xc9')]);return db['MailMessage'][_0xc210('0xa4')]({'where':_0x162a28[_0xc210('0x50')]})[_0xc210('0x2c')](function(_0x59e93c){_0x80d3b8['count']=_0x59e93c;if(_0x114ba0[_0xc210('0x46')][_0xc210('0xd2')]){_0x162a28[_0xc210('0xd3')]=[{'all':!![]}];}return db['MailMessage'][_0xc210('0xd4')](_0x162a28);})[_0xc210('0x2c')](function(_0x5bb30){if(_0x114ba0[_0xc210('0x46')][_0xc210('0xd5')]===_0xc210('0xd6')){for(var _0x55c2e1=0x0;_0x55c2e1<_0x5bb30['length'];_0x55c2e1++){_0x5bb30[_0x55c2e1]['body']=juice(_0x5bb30[_0x55c2e1]['body']);}}_0x80d3b8[_0xc210('0xc6')]=_0x5bb30;return _0x80d3b8;});}})[_0xc210('0x2c')](respondWithFilteredResult(_0x72d0c9,_0x162a28))['catch'](handleError(_0x72d0c9,null));};exports['addTags']=function(_0x201fc5,_0x395a0b,_0x352b4b){return db[_0xc210('0xa7')][_0xc210('0x74')]({'where':{'id':_0x201fc5[_0xc210('0xc8')]['id']}})[_0xc210('0x2c')](handleEntityNotFound(_0x395a0b,null))[_0xc210('0x2c')](function(_0x40e7c4){if(_0x40e7c4){return _0x40e7c4['setTags'](_0x201fc5[_0xc210('0xcb')][_0xc210('0xce')],_[_0xc210('0xd7')](_0x201fc5[_0xc210('0xcb')],[_0xc210('0xce'),'id'])||{})[_0xc210('0xd8')](function(){return db[_0xc210('0x78')][_0xc210('0xd4')]({'attributes':['id',_0xc210('0x30'),_0xc210('0x54')],'where':{'id':_0x201fc5[_0xc210('0xcb')][_0xc210('0xce')]}});})['then'](function(_0x2701f8){socket[_0xc210('0xd9')]('mailInteractionTags:save',{'id':Number(_0x201fc5['params']['id']),'tags':_0x2701f8||[]});return{'id':Number(_0x201fc5['params']['id']),'tags':_0x2701f8||[]};});}})['then'](respondWithResult(_0x395a0b,null))[_0xc210('0x40')](handleError(_0x395a0b,null));};exports[_0xc210('0xda')]=function(_0x28bea4,_0x5a9529,_0x1cd228){return db['MailInteraction']['find']({'where':{'id':_0x28bea4[_0xc210('0xc8')]['id']}})[_0xc210('0x2c')](handleEntityNotFound(_0x5a9529,null))[_0xc210('0x2c')](function(_0x47f485){if(_0x47f485){return _0x47f485[_0xc210('0xda')](_0x28bea4['query'][_0xc210('0xce')]);}})[_0xc210('0x2c')](respondWithStatusCode(_0x5a9529,null))['catch'](handleError(_0x5a9529,null));};exports[_0xc210('0xdb')]=function(_0x17d14f,_0x29e138){var _0x27ad99=moment()['unix']()[_0xc210('0xa3')]();var _0x38fb6a=path[_0xc210('0xdc')](config[_0xc210('0xdd')],_0xc210('0xde'),_0xc210('0xdf'),'tmp');var _0x28435a=path[_0xc210('0xdc')](config[_0xc210('0xdd')],'server',_0xc210('0xdf'),_0xc210('0xe0'));var _0x24c2a7=path[_0xc210('0xdc')](_0x38fb6a,_0x27ad99);var _0x436ad5=util['format'](_0xc210('0xe1'),_0x17d14f['params']['id'],_0x27ad99);var _0xec17bb=path[_0xc210('0xdc')](_0x38fb6a,_0x436ad5);var _0x248488=[];if(_0x17d14f[_0xc210('0x46')][_0xc210('0xe0')]){_0x248488[_0xc210('0x39')]({'model':db[_0xc210('0xe2')],'as':_0xc210('0xe3'),'raw':!![]});}var _0x2731aa=[{'model':db[_0xc210('0x3a')],'as':'Messages','attributes':['id',_0xc210('0xcb'),_0xc210('0x59'),'to','cc',_0xc210('0xe4'),_0xc210('0xe5'),_0xc210('0xe6')],'where':{'secret':![]},'order':qs[_0xc210('0x4f')]('id'),'include':_0x248488}];return db[_0xc210('0xa7')][_0xc210('0x74')]({'where':{'id':_0x17d14f['params']['id']},'include':_0x2731aa})['then'](handleEntityNotFound(_0x29e138,null))['then'](function(_0x66fb24){if(_0x66fb24&&_0x66fb24[_0xc210('0xe7')]){var _0x4f85f6=_0x66fb24[_0xc210('0xe8')]({'plain':!![]});fs['mkdirSync'](_0x24c2a7);return BPromise[_0xc210('0xe9')](_0x4f85f6['Messages'],function(_0x27282f,_0x20f6ef){var _0x252476={'from':_0x27282f['from'],'to':_0x27282f['to'],'subject':_0x27282f[_0xc210('0xe5')],'html':_0x27282f['body'],'headers':{'Date':moment(_0x27282f[_0xc210('0xe6')])[_0xc210('0xd1')](_0xc210('0xea'))},'attachments':[]};if(_0x27282f['cc']){_0x252476[_0xc210('0xeb')]['Cc']=_0x27282f['cc'];}if(_0x27282f[_0xc210('0xe4')]){_0x252476[_0xc210('0xeb')][_0xc210('0xec')]=_0x27282f[_0xc210('0xe4')];}return new BPromise(function(_0x39d721,_0x18e021){if(_0x27282f[_0xc210('0xe3')]){for(var _0x469d29=0x0;_0x469d29<_0x27282f['Attachments'][_0xc210('0x4c')];_0x469d29++){var _0x3cb11b=_0x27282f['Attachments'][_0x469d29];var _0x4e0862=path[_0xc210('0xdc')](_0x28435a,_0x3cb11b['basename']);if(fs[_0xc210('0xed')](_0x4e0862)){_0x252476['attachments'][_0xc210('0x39')]({'name':_0x3cb11b['name'],'contentType':_0x3cb11b['type'],'data':fs['readFileSync'](_0x4e0862)});}}}emlformat[_0xc210('0xee')](_0x252476,function(_0x5cd885,_0xa2d66e){if(_0x5cd885)return _0x18e021(_0x5cd885);fs['writeFileSync'](path[_0xc210('0xdc')](_0x24c2a7,util[_0xc210('0xd1')](_0xc210('0xef'),_0x20f6ef)),_0xa2d66e);return _0x39d721(_0xa2d66e);});});})[_0xc210('0x2c')](function(){return new BPromise(function(_0x1a58f6,_0x321b2d){zipdir(_0x24c2a7,{'saveTo':_0xec17bb},function(_0x15f360,_0x248411){if(_0x15f360)return _0x321b2d(_0x15f360);return _0x1a58f6(_0x248411);});})[_0xc210('0x2c')](function(){return new BPromise(function(_0xfa0e54,_0x439441){rimraf(_0x24c2a7,function(_0x42026d){if(_0x42026d)_0x439441(_0x42026d);return _0xfa0e54();});});})[_0xc210('0x2c')](function(){return _0x29e138['download'](_0xec17bb,_0x436ad5,function(_0x20c239){if(_0x20c239){console[_0xc210('0xf0')](_0xc210('0xf1'),_0x20c239);}else{fs[_0xc210('0xf2')](_0xec17bb);}});});});}else{return _0x29e138[_0xc210('0x21')](0xc8);}})[_0xc210('0x40')](handleError(_0x29e138,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 26f4d3d..a7c6097 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 _0xd22b=['exports','events','MailInteraction','../../mysqldb','setMaxListeners','save','remove','getUsers','map','findAll','then','length','emit','catch','hasOwnProperty','hook'];(function(_0x1b4a0a,_0x41a6a9){var _0x3b76f0=function(_0x575b7c){while(--_0x575b7c){_0x1b4a0a['push'](_0x1b4a0a['shift']());}};_0x3b76f0(++_0x41a6a9);}(_0xd22b,0xa1));var _0xbd22=function(_0x5eff9b,_0x5b4d26){_0x5eff9b=_0x5eff9b-0x0;var _0x3504db=_0xd22b[_0x5eff9b];return _0x3504db;};'use strict';var EventEmitter=require(_0xbd22('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xbd22('0x1')];var MailMessage=require(_0xbd22('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbd22('0x3')](0x0);var events={'afterCreate':_0xbd22('0x4'),'afterUpdate':'update','afterDestroy':_0xbd22('0x5')};function emitEvent(_0x13f6c9){return function(_0x4c0444,_0xfb23a7,_0x1ac79a){_0x4c0444[_0xbd22('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x58f797){_0x4c0444['setDataValue']('Users',_0x58f797[_0xbd22('0x7')](function(_0x472edc){return{'id':_0x472edc['id']};}));return MailMessage[_0xbd22('0x8')]({'where':{'MailInteractionId':_0x4c0444['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbd22('0x9')](function(_0x2eb78d){_0x4c0444['setDataValue']('unreadMessages',_0x2eb78d[_0xbd22('0xa')]);MailInteractionEvents[_0xbd22('0xb')](_0x13f6c9+':'+_0x4c0444['id'],_0x4c0444);MailInteractionEvents[_0xbd22('0xb')](_0x13f6c9,_0x4c0444);_0x1ac79a(null);})[_0xbd22('0xc')](_0x1ac79a(null));};}for(var e in events){if(events[_0xbd22('0xd')](e)){var event=events[e];MailInteraction[_0xbd22('0xe')](e,emitEvent(event));}}module[_0xbd22('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0xe764=['getUsers','setDataValue','Users','map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook','events','MailInteraction','setMaxListeners','save','update'];(function(_0x33f54b,_0x41df7d){var _0x191255=function(_0x1c4faf){while(--_0x1c4faf){_0x33f54b['push'](_0x33f54b['shift']());}};_0x191255(++_0x41df7d);}(_0xe764,0xcb));var _0x4e76=function(_0x1856e8,_0x4532d6){_0x1856e8=_0x1856e8-0x0;var _0x4ad341=_0xe764[_0x1856e8];return _0x4ad341;};'use strict';var EventEmitter=require(_0x4e76('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x4e76('0x1')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4e76('0x2')](0x0);var events={'afterCreate':_0x4e76('0x3'),'afterUpdate':_0x4e76('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5e4136){return function(_0x2c2e0b,_0x3cd2fb,_0x41b44e){_0x2c2e0b[_0x4e76('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4bc004){_0x2c2e0b[_0x4e76('0x6')](_0x4e76('0x7'),_0x4bc004[_0x4e76('0x8')](function(_0x52322b){return{'id':_0x52322b['id']};}));return MailMessage[_0x4e76('0x9')]({'where':{'MailInteractionId':_0x2c2e0b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4e76('0xa')](function(_0x824934){_0x2c2e0b[_0x4e76('0x6')](_0x4e76('0xb'),_0x824934['length']);MailInteractionEvents[_0x4e76('0xc')](_0x5e4136+':'+_0x2c2e0b['id'],_0x2c2e0b);MailInteractionEvents[_0x4e76('0xc')](_0x5e4136,_0x2c2e0b);_0x41b44e(null);})[_0x4e76('0xd')](_0x41b44e(null));};}for(var e in events){if(events[_0x4e76('0xe')](e)){var event=events[e];MailInteraction[_0x4e76('0xf')](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 74205ed..15abb7d 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 _0xa6f0=['substatusAt','changed','closed','closedAt','models','get','MailMessage','then','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0xa6f0,0xea));var _0x0a6f=function(_0x13d545,_0x48861e){_0x13d545=_0x13d545-0x0;var _0x411cf3=_0xa6f0[_0x13d545];return _0x411cf3;};'use strict';var _=require(_0x0a6f('0x0'));var util=require(_0x0a6f('0x1'));var logger=require(_0x0a6f('0x2'))(_0x0a6f('0x3'));var moment=require(_0x0a6f('0x4'));var BPromise=require(_0x0a6f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a6f('0x6'));var rimraf=require(_0x0a6f('0x7'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x707695,_0x40598f){return _0x707695[_0x0a6f('0x8')]('MailInteraction',attributes,{'tableName':_0x0a6f('0x9'),'paranoid':![],'indexes':[{'name':_0x0a6f('0xa'),'fields':[_0x0a6f('0xb'),'to'],'type':_0x0a6f('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x592903,_0x434512,_0x505376){if(_0x592903[_0x0a6f('0xd')]){_0x592903['substatusAt']=moment()[_0x0a6f('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x592903['closed']){_0x592903['closedAt']=moment()[_0x0a6f('0xe')](_0x0a6f('0xf'));}_0x505376(null,_0x434512);},'beforeUpdate':function(_0x40ea9f,_0xee9bdb,_0x47d3ec){if(_0x40ea9f['changed'](_0x0a6f('0xd'))){_0x40ea9f[_0x0a6f('0x10')]=_0x40ea9f['substatus']?moment()['format'](_0x0a6f('0xf')):null;}if(_0x40ea9f[_0x0a6f('0x11')](_0x0a6f('0x12'))){_0x40ea9f[_0x0a6f('0x13')]=moment()[_0x0a6f('0xe')](_0x0a6f('0xf'));_0x40ea9f['substatus']=null;_0x40ea9f[_0x0a6f('0x10')]=null;}_0x47d3ec(null,_0x40ea9f);},'afterUpdate':function(_0x91e149,_0x31e350,_0x4c6e8a){var _0x2edefd=_0x707695[_0x0a6f('0x14')];var _0x581fee=_0x91e149[_0x0a6f('0x15')]({'plain':!![]});if(_0x581fee[_0x0a6f('0x12')]){return _0x2edefd[_0x0a6f('0x16')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x581fee['id']}})[_0x0a6f('0x17')](function(){_0x4c6e8a();})['catch'](function(_0xa59e05){_0x4c6e8a(_0xa59e05);});}else{_0x4c6e8a();}}},'charset':'utf8mb4','collate':_0x0a6f('0x18')});}; \ No newline at end of file +var _0x131e=['closedAt','substatus','changed','models','MailMessage','update','then','catch','utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x394322,_0x2cf44f){var _0x229cf0=function(_0x4e31c9){while(--_0x4e31c9){_0x394322['push'](_0x394322['shift']());}};_0x229cf0(++_0x2cf44f);}(_0x131e,0x1ec));var _0xe131=function(_0x2e2bb9,_0x3afb53){_0x2e2bb9=_0x2e2bb9-0x0;var _0x2cc582=_0x131e[_0x2e2bb9];return _0x2cc582;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe131('0x0'));var moment=require(_0xe131('0x1'));var BPromise=require(_0xe131('0x2'));var rp=require(_0xe131('0x3'));var fs=require('fs');var path=require(_0xe131('0x4'));var rimraf=require(_0xe131('0x5'));var config=require('../../config/environment');var attributes=require(_0xe131('0x6'));module[_0xe131('0x7')]=function(_0x2de969,_0x1eb0df){return _0x2de969[_0xe131('0x8')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0xe131('0x9')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x210bb5,_0x530ecb,_0xfdbf4c){if(_0x210bb5['substatus']){_0x210bb5[_0xe131('0xa')]=moment()[_0xe131('0xb')](_0xe131('0xc'));}if(_0x210bb5[_0xe131('0xd')]){_0x210bb5[_0xe131('0xe')]=moment()[_0xe131('0xb')](_0xe131('0xc'));}_0xfdbf4c(null,_0x530ecb);},'beforeUpdate':function(_0x555b36,_0x55768a,_0x554db6){if(_0x555b36['changed'](_0xe131('0xf'))){_0x555b36[_0xe131('0xa')]=_0x555b36[_0xe131('0xf')]?moment()[_0xe131('0xb')](_0xe131('0xc')):null;}if(_0x555b36[_0xe131('0x10')](_0xe131('0xd'))){_0x555b36[_0xe131('0xe')]=moment()[_0xe131('0xb')]('YYYY-MM-DD\x20HH:mm:ss');_0x555b36['substatus']=null;_0x555b36['substatusAt']=null;}_0x554db6(null,_0x555b36);},'afterUpdate':function(_0x5a6ca9,_0x4987dc,_0x2628e7){var _0x32091b=_0x2de969[_0xe131('0x11')];var _0x5a02b6=_0x5a6ca9['get']({'plain':!![]});if(_0x5a02b6[_0xe131('0xd')]){return _0x32091b[_0xe131('0x12')][_0xe131('0x13')]({'read':!![]},{'where':{'MailInteractionId':_0x5a02b6['id']}})[_0xe131('0x14')](function(){_0x2628e7();})[_0xe131('0x15')](function(_0x76fd26){_0x2628e7(_0x76fd26);});}else{_0x2628e7();}}},'charset':'utf8mb4','collate':_0xe131('0x16')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 4569fc9..a2c5e30 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 _0xfc65=['./mailInteraction.socket','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','MailInteraction','update','body','options','raw','limit','UpdateMailInteraction','AddTagsToMailInteraction','find','where','then','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xfc65,0x1b4));var _0x5fc6=function(_0x45351a,_0x4e610f){_0x45351a=_0x45351a-0x0;var _0x46e2fd=_0xfc65[_0x45351a];return _0x46e2fd;};'use strict';var _=require(_0x5fc6('0x0'));var util=require(_0x5fc6('0x1'));var moment=require(_0x5fc6('0x2'));var BPromise=require(_0x5fc6('0x3'));var rs=require(_0x5fc6('0x4'));var fs=require('fs');var Redis=require(_0x5fc6('0x5'));var db=require(_0x5fc6('0x6'))['db'];var utils=require(_0x5fc6('0x7'));var logger=require(_0x5fc6('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5fc6('0x9'));var client=jayson[_0x5fc6('0xa')][_0x5fc6('0xb')]({'port':0x232a});config[_0x5fc6('0xc')]=_[_0x5fc6('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5fc6('0xe'))(new Redis(config[_0x5fc6('0xc')]));require(_0x5fc6('0xf'))['register'](socket);function respondWithRpcPromise(_0x3c0c98,_0x4e5f13,_0x49a9c8){return new BPromise(function(_0x6daec,_0x3a0a5c){return client['request'](_0x3c0c98,_0x49a9c8)['then'](function(_0x3caadc){logger[_0x5fc6('0x10')](_0x5fc6('0x11'),_0x4e5f13,'request\x20sent');logger[_0x5fc6('0x12')](_0x5fc6('0x13'),_0x4e5f13,_0x5fc6('0x14'),JSON[_0x5fc6('0x15')](_0x3caadc));if(_0x3caadc[_0x5fc6('0x16')]){if(_0x3caadc[_0x5fc6('0x16')]['code']===0x1f4){logger[_0x5fc6('0x16')]('MailInteraction,\x20%s,\x20%s',_0x4e5f13,_0x3caadc[_0x5fc6('0x16')][_0x5fc6('0x17')]);return _0x3a0a5c(_0x3caadc[_0x5fc6('0x16')][_0x5fc6('0x17')]);}logger['error'](_0x5fc6('0x11'),_0x4e5f13,_0x3caadc['error'][_0x5fc6('0x17')]);return _0x6daec(_0x3caadc['error']['message']);}else{logger[_0x5fc6('0x10')](_0x5fc6('0x11'),_0x4e5f13,_0x5fc6('0x14'));_0x6daec(_0x3caadc[_0x5fc6('0x18')][_0x5fc6('0x17')]);}})[_0x5fc6('0x19')](function(_0x47c75b){logger[_0x5fc6('0x16')](_0x5fc6('0x11'),_0x4e5f13,_0x47c75b);_0x3a0a5c(_0x47c75b);});});}exports['UpdateMailInteraction']=function(_0x54855c){var _0x18fe24=this;return new Promise(function(_0x1d39eb,_0x4b3b35){return db[_0x5fc6('0x1a')][_0x5fc6('0x1b')](_0x54855c[_0x5fc6('0x1c')],{'raw':_0x54855c[_0x5fc6('0x1d')]?_0x54855c[_0x5fc6('0x1d')][_0x5fc6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54855c['options']?_0x54855c['options']['where']||null:null,'attributes':_0x54855c[_0x5fc6('0x1d')]?_0x54855c['options']['attributes']||null:null,'limit':_0x54855c[_0x5fc6('0x1d')]?_0x54855c[_0x5fc6('0x1d')][_0x5fc6('0x1f')]||null:null})['then'](function(_0x5a7c5e){logger[_0x5fc6('0x10')](_0x5fc6('0x20'),_0x54855c);logger[_0x5fc6('0x12')](_0x5fc6('0x20'),_0x54855c,JSON[_0x5fc6('0x15')](_0x5a7c5e));_0x1d39eb(_0x5a7c5e);})[_0x5fc6('0x19')](function(_0x283eff){logger[_0x5fc6('0x16')](_0x5fc6('0x20'),_0x283eff['message'],_0x54855c);_0x4b3b35(_0x18fe24[_0x5fc6('0x16')](0x1f4,_0x283eff['message']));});});};exports[_0x5fc6('0x21')]=function(_0x440e07){return new Promise(function(_0x2d3aeb,_0xec58dc){return db[_0x5fc6('0x1a')][_0x5fc6('0x22')]({'where':_0x440e07[_0x5fc6('0x1d')]?_0x440e07[_0x5fc6('0x1d')][_0x5fc6('0x23')]||null:null})[_0x5fc6('0x24')](function(_0x4a8fc0){if(_0x4a8fc0){return _0x4a8fc0['addTags'](_0x440e07[_0x5fc6('0x1c')][_0x5fc6('0x25')],_[_0x5fc6('0x26')](_0x440e07[_0x5fc6('0x1c')],['ids','id'])||{});}})[_0x5fc6('0x27')](function(_0x4764a4){logger[_0x5fc6('0x10')]('AddTags',_0x440e07);logger[_0x5fc6('0x12')]('AddTags',_0x440e07,JSON[_0x5fc6('0x15')](_0x4764a4));_0x2d3aeb(_0x4764a4);})[_0x5fc6('0x19')](function(_0x15bb78){logger[_0x5fc6('0x16')](_0x5fc6('0x28'),_0x15bb78[_0x5fc6('0x17')],_0x440e07);_0xec58dc(_this['error'](0x1f4,_0x15bb78[_0x5fc6('0x17')]));});});}; \ No newline at end of file +var _0x2cbd=['ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','socket.io-emitter','./mailInteraction.socket','register','request','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes','limit','find','ids','spread','AddTags','lodash','util','bluebird','randomstring'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2cbd,0x19e));var _0xd2cb=function(_0x55969b,_0x1ebe62){_0x55969b=_0x55969b-0x0;var _0x3d7fc1=_0x2cbd[_0x55969b];return _0x3d7fc1;};'use strict';var _=require(_0xd2cb('0x0'));var util=require(_0xd2cb('0x1'));var moment=require('moment');var BPromise=require(_0xd2cb('0x2'));var rs=require(_0xd2cb('0x3'));var fs=require('fs');var Redis=require(_0xd2cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd2cb('0x5'));var logger=require(_0xd2cb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd2cb('0x7'));var client=jayson[_0xd2cb('0x8')][_0xd2cb('0x9')]({'port':0x232a});config[_0xd2cb('0xa')]=_['defaults'](config[_0xd2cb('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd2cb('0xb'))(new Redis(config['redis']));require(_0xd2cb('0xc'))[_0xd2cb('0xd')](socket);function respondWithRpcPromise(_0x4b6cf4,_0x36e855,_0x216a2c){return new BPromise(function(_0x4f4a00,_0xa5ad40){return client[_0xd2cb('0xe')](_0x4b6cf4,_0x216a2c)[_0xd2cb('0xf')](function(_0x284441){logger[_0xd2cb('0x10')]('MailInteraction,\x20%s,\x20%s',_0x36e855,_0xd2cb('0x11'));logger[_0xd2cb('0x12')](_0xd2cb('0x13'),_0x36e855,_0xd2cb('0x11'),JSON[_0xd2cb('0x14')](_0x284441));if(_0x284441['error']){if(_0x284441[_0xd2cb('0x15')][_0xd2cb('0x16')]===0x1f4){logger[_0xd2cb('0x15')]('MailInteraction,\x20%s,\x20%s',_0x36e855,_0x284441[_0xd2cb('0x15')][_0xd2cb('0x17')]);return _0xa5ad40(_0x284441['error'][_0xd2cb('0x17')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x36e855,_0x284441[_0xd2cb('0x15')][_0xd2cb('0x17')]);return _0x4f4a00(_0x284441[_0xd2cb('0x15')][_0xd2cb('0x17')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x36e855,_0xd2cb('0x11'));_0x4f4a00(_0x284441[_0xd2cb('0x18')]['message']);}})[_0xd2cb('0x19')](function(_0xd74fd1){logger[_0xd2cb('0x15')]('MailInteraction,\x20%s,\x20%s',_0x36e855,_0xd74fd1);_0xa5ad40(_0xd74fd1);});});}exports[_0xd2cb('0x1a')]=function(_0x4ea157){var _0x4cf1e8=this;return new Promise(function(_0x42d379,_0x190cbb){return db[_0xd2cb('0x1b')]['update'](_0x4ea157[_0xd2cb('0x1c')],{'raw':_0x4ea157[_0xd2cb('0x1d')]?_0x4ea157[_0xd2cb('0x1d')][_0xd2cb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ea157[_0xd2cb('0x1d')]?_0x4ea157[_0xd2cb('0x1d')][_0xd2cb('0x1f')]||null:null,'attributes':_0x4ea157[_0xd2cb('0x1d')]?_0x4ea157['options'][_0xd2cb('0x20')]||null:null,'limit':_0x4ea157[_0xd2cb('0x1d')]?_0x4ea157['options'][_0xd2cb('0x21')]||null:null})[_0xd2cb('0xf')](function(_0x138498){logger[_0xd2cb('0x10')](_0xd2cb('0x1a'),_0x4ea157);logger[_0xd2cb('0x12')]('UpdateMailInteraction',_0x4ea157,JSON[_0xd2cb('0x14')](_0x138498));_0x42d379(_0x138498);})['catch'](function(_0x5978c1){logger['error'](_0xd2cb('0x1a'),_0x5978c1[_0xd2cb('0x17')],_0x4ea157);_0x190cbb(_0x4cf1e8[_0xd2cb('0x15')](0x1f4,_0x5978c1[_0xd2cb('0x17')]));});});};exports['AddTagsToMailInteraction']=function(_0x30214e){return new Promise(function(_0x45f762,_0xd28ae7){return db[_0xd2cb('0x1b')][_0xd2cb('0x22')]({'where':_0x30214e[_0xd2cb('0x1d')]?_0x30214e[_0xd2cb('0x1d')][_0xd2cb('0x1f')]||null:null})[_0xd2cb('0xf')](function(_0x24dba2){if(_0x24dba2){return _0x24dba2['addTags'](_0x30214e[_0xd2cb('0x1c')][_0xd2cb('0x23')],_['omit'](_0x30214e[_0xd2cb('0x1c')],[_0xd2cb('0x23'),'id'])||{});}})[_0xd2cb('0x24')](function(_0x2f64f7){logger['info']('AddTags',_0x30214e);logger[_0xd2cb('0x12')](_0xd2cb('0x25'),_0x30214e,JSON[_0xd2cb('0x14')](_0x2f64f7));_0x45f762(_0x2f64f7);})[_0xd2cb('0x19')](function(_0x416c40){logger['error'](_0xd2cb('0x25'),_0x416c40[_0xd2cb('0x17')],_0x30214e);_0xd28ae7(_this[_0xd2cb('0x15')](0x1f4,_0x416c40[_0xd2cb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index b1248d0..a05ce7c 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 _0x921e=['./mailInteraction.events','remove','update','removeListener'];(function(_0x210fc6,_0x2e27eb){var _0x27cf7a=function(_0x5d8dd0){while(--_0x5d8dd0){_0x210fc6['push'](_0x210fc6['shift']());}};_0x27cf7a(++_0x2e27eb);}(_0x921e,0x13c));var _0xe921=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x921e[_0x3dd15e];return _0x231fd0;};'use strict';var MailInteractionEvents=require(_0xe921('0x0'));var events=['save',_0xe921('0x1'),_0xe921('0x2')];function createListener(_0x4abfe8,_0x2e0ad7){return function(_0x57c0e7){_0x2e0ad7['emit'](_0x4abfe8,_0x57c0e7);};}function removeListener(_0x19f35d,_0x2d3cff){return function(){MailInteractionEvents[_0xe921('0x3')](_0x19f35d,_0x2d3cff);};}exports['register']=function(_0x3a7380){for(var _0x3e6af5=0x0,_0x1aa063=events['length'];_0x3e6af5<_0x1aa063;_0x3e6af5++){var _0x2ed181=events[_0x3e6af5];var _0x4e129b=createListener('mailInteraction:'+_0x2ed181,_0x3a7380);MailInteractionEvents['on'](_0x2ed181,_0x4e129b);}}; \ No newline at end of file +var _0xdc90=['register','length','mailInteraction:','./mailInteraction.events','remove','update'];(function(_0x3ba38b,_0x39c0be){var _0x574206=function(_0x138d19){while(--_0x138d19){_0x3ba38b['push'](_0x3ba38b['shift']());}};_0x574206(++_0x39c0be);}(_0xdc90,0x135));var _0x0dc9=function(_0x17c710,_0x4583f3){_0x17c710=_0x17c710-0x0;var _0x33493d=_0xdc90[_0x17c710];return _0x33493d;};'use strict';var MailInteractionEvents=require(_0x0dc9('0x0'));var events=['save',_0x0dc9('0x1'),_0x0dc9('0x2')];function createListener(_0x5024d0,_0x214732){return function(_0x5b026e){_0x214732['emit'](_0x5024d0,_0x5b026e);};}function removeListener(_0x1e2be8,_0x488b51){return function(){MailInteractionEvents['removeListener'](_0x1e2be8,_0x488b51);};}exports[_0x0dc9('0x3')]=function(_0x232f6a){for(var _0x54a43f=0x0,_0xc04b25=events[_0x0dc9('0x4')];_0x54a43f<_0xc04b25;_0x54a43f++){var _0x4b94e8=events[_0x54a43f];var _0x25e0fd=createListener(_0x0dc9('0x5')+_0x4b94e8,_0x232f6a);MailInteractionEvents['on'](_0x4b94e8,_0x25e0fd);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 080f8c0..92c93ef 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 _0x695c=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','describe','/:id','isAuthenticated','show','download','post','tracked','mail','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','path'];(function(_0x30fe8c,_0x272cb9){var _0x4f1068=function(_0x5f52c7){while(--_0x5f52c7){_0x30fe8c['push'](_0x30fe8c['shift']());}};_0x4f1068(++_0x272cb9);}(_0x695c,0x7c));var _0xc695=function(_0x12b83d,_0x4bcec7){_0x12b83d=_0x12b83d-0x0;var _0x1fd39d=_0x695c[_0x12b83d];return _0x1fd39d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc695('0x0'));var timeout=require(_0xc695('0x1'));var express=require(_0xc695('0x2'));var router=express['Router']();var fs_extra=require(_0xc695('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc695('0x4'));var config=require(_0xc695('0x5'));var controller=require(_0xc695('0x6'));router[_0xc695('0x7')]('/',auth['isAuthenticated'](),controller[_0xc695('0x8')]);router[_0xc695('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xc695('0x9')]);router[_0xc695('0x7')](_0xc695('0xa'),auth[_0xc695('0xb')](),controller[_0xc695('0xc')]);router[_0xc695('0x7')]('/:id/download',auth[_0xc695('0xb')](),controller[_0xc695('0xd')]);router[_0xc695('0xe')]('/',auth[_0xc695('0xb')](),interaction[_0xc695('0xf')](_0xc695('0x10'),'mailmessage:create'),controller[_0xc695('0x11')]);router[_0xc695('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc695('0x12')](_0xc695('0x13'),auth['isAuthenticated'](),controller[_0xc695('0x14')]);router['put'](_0xc695('0x15'),auth[_0xc695('0xb')](),controller[_0xc695('0x16')]);router[_0xc695('0x17')](_0xc695('0xa'),auth[_0xc695('0xb')](),controller[_0xc695('0x18')]);module['exports']=router; \ No newline at end of file +var _0x2568=['index','/describe','show','/:id/download','download','post','tracked','mailmessage:create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2568,0xad));var _0x8256=function(_0x1f3409,_0x57493b){_0x1f3409=_0x1f3409-0x0;var _0x336c55=_0x2568[_0x1f3409];return _0x336c55;};'use strict';var multer=require(_0x8256('0x0'));var util=require(_0x8256('0x1'));var path=require(_0x8256('0x2'));var timeout=require(_0x8256('0x3'));var express=require(_0x8256('0x4'));var router=express[_0x8256('0x5')]();var fs_extra=require(_0x8256('0x6'));var auth=require(_0x8256('0x7'));var interaction=require(_0x8256('0x8'));var config=require(_0x8256('0x9'));var controller=require(_0x8256('0xa'));router[_0x8256('0xb')]('/',auth[_0x8256('0xc')](),controller[_0x8256('0xd')]);router[_0x8256('0xb')](_0x8256('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x8256('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x8256('0xf')]);router['get'](_0x8256('0x10'),auth[_0x8256('0xc')](),controller[_0x8256('0x11')]);router[_0x8256('0x12')]('/',auth[_0x8256('0xc')](),interaction[_0x8256('0x13')]('mail',_0x8256('0x14')),controller['create']);router[_0x8256('0x15')](_0x8256('0x16'),auth['isAuthenticated'](),controller[_0x8256('0x17')]);router['put'](_0x8256('0x18'),auth[_0x8256('0xc')](),controller[_0x8256('0x19')]);router[_0x8256('0x15')](_0x8256('0x1a'),auth[_0x8256('0xc')](),controller[_0x8256('0x1b')]);router[_0x8256('0x1c')]('/:id',auth[_0x8256('0xc')](),controller[_0x8256('0x1d')]);module[_0x8256('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 12f471e..750245f 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 _0xfae4=['Email','Chat','lodash','exports','long','TEXT','medium','ENUM','out','STRING','INTEGER','BOOLEAN','DATE'];(function(_0x3bc0bc,_0x567fba){var _0x13fb7f=function(_0x302a40){while(--_0x302a40){_0x3bc0bc['push'](_0x3bc0bc['shift']());}};_0x13fb7f(++_0x567fba);}(_0xfae4,0xab));var _0x4fae=function(_0x2f5261,_0x5e44b7){_0x2f5261=_0x2f5261-0x0;var _0x5388a0=_0xfae4[_0x2f5261];return _0x5388a0;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4fae('0x0'));module[_0x4fae('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4fae('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4fae('0x3')](_0x4fae('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4fae('0x5')]('in',_0x4fae('0x6')),'defaultValue':_0x4fae('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4fae('0x7')](0x1fe)},'from':{'type':Sequelize[_0x4fae('0x7')]},'to':{'type':Sequelize[_0x4fae('0x3')]('long')},'cc':{'type':Sequelize[_0x4fae('0x3')](_0x4fae('0x2'))},'bcc':{'type':Sequelize[_0x4fae('0x3')](_0x4fae('0x2'))},'subject':{'type':Sequelize[_0x4fae('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x4fae('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4fae('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4fae('0xa')]},'originTo':{'type':Sequelize['TEXT'](_0x4fae('0x2'))},'originCc':{'type':Sequelize[_0x4fae('0x3')](_0x4fae('0x2'))},'originChannel':{'type':Sequelize[_0x4fae('0x5')](_0x4fae('0xb'),_0x4fae('0xc')),'defaultValue':_0x4fae('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0xcd15=['TEXT','out','STRING','long','DATE','BOOLEAN','ENUM','Email','lodash','exports'];(function(_0x4f08dd,_0x3784ec){var _0x3017ee=function(_0x7d95be){while(--_0x7d95be){_0x4f08dd['push'](_0x4f08dd['shift']());}};_0x3017ee(++_0x3784ec);}(_0xcd15,0x1a2));var _0x5cd1=function(_0x173f10,_0x35db61){_0x173f10=_0x173f10-0x0;var _0x53142d=_0xcd15[_0x173f10];return _0x53142d;};'use strict';var Sequelize=require('sequelize');var _=require(_0x5cd1('0x0'));module[_0x5cd1('0x1')]={'body':{'type':Sequelize[_0x5cd1('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5cd1('0x2')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5cd1('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x5cd1('0x4')](0x1fe)},'from':{'type':Sequelize[_0x5cd1('0x4')]},'to':{'type':Sequelize[_0x5cd1('0x2')](_0x5cd1('0x5'))},'cc':{'type':Sequelize[_0x5cd1('0x2')](_0x5cd1('0x5'))},'bcc':{'type':Sequelize[_0x5cd1('0x2')](_0x5cd1('0x5'))},'subject':{'type':Sequelize[_0x5cd1('0x2')]},'sentAt':{'type':Sequelize[_0x5cd1('0x6')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x5cd1('0x7')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x5cd1('0x6')]},'originTo':{'type':Sequelize[_0x5cd1('0x2')]('long')},'originCc':{'type':Sequelize['TEXT'](_0x5cd1('0x5'))},'originChannel':{'type':Sequelize[_0x5cd1('0x8')](_0x5cd1('0x9'),'Chat'),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 1b2ed1d..4d956b3 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 _0x08db=['format','UserId','agent','Contact','get','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','startsWith','cf_','push','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','interface','channel','EventManager','acceptmessage','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','rejectmessage','download','unix','toString','server','tmp','files','from','bcc','subject','Attachment','Attachments','createdAt','headers','Bcc','existsSync','readFileSync','build','writeFileSync','log','unlinkSync','rimraf','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','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','destroy','name','send','index','map','MailMessage','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','body','params','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmContact','Contacts','updatedAt','Smtp','isNil','service','host','port','secure','auth','user','pass','attachments','join','root','server/files/attachments','basename','List','List\x20not\x20found','SendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','readAt'];(function(_0x4240c5,_0x325af3){var _0x52e33e=function(_0x22fb0f){while(--_0x22fb0f){_0x4240c5['push'](_0x4240c5['shift']());}};_0x52e33e(++_0x325af3);}(_0x08db,0x198));var _0xb08d=function(_0x167c83,_0x46b3b5){_0x167c83=_0x167c83-0x0;var _0x359721=_0x08db[_0x167c83];return _0x359721;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb08d('0x0'));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(_0xb08d('0x1'));var util=require(_0xb08d('0x2'));var path=require(_0xb08d('0x3'));var sox=require(_0xb08d('0x4'));var csv=require(_0xb08d('0x5'));var ejs=require(_0xb08d('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb08d('0x7'));var squel=require(_0xb08d('0x8'));var crypto=require(_0xb08d('0x9'));var jsforce=require(_0xb08d('0xa'));var deskjs=require(_0xb08d('0xb'));var toCsv=require(_0xb08d('0x5'));var querystring=require(_0xb08d('0xc'));var Papa=require(_0xb08d('0xd'));var Redis=require(_0xb08d('0xe'));var authService=require(_0xb08d('0xf'));var qs=require(_0xb08d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb08d('0x11'));var logger=require(_0xb08d('0x12'))(_0xb08d('0x13'));var utils=require(_0xb08d('0x14'));var config=require(_0xb08d('0x15'));var licenseUtil=require(_0xb08d('0x16'));var db=require(_0xb08d('0x17'))['db'];config['redis']=_[_0xb08d('0x18')](config[_0xb08d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb08d('0x1a'))(new Redis(config[_0xb08d('0x19')]));require('./mailMessage.socket')[_0xb08d('0x1b')](socket);var jayson=require(_0xb08d('0x1c'));var client=jayson[_0xb08d('0x1d')][_0xb08d('0x1e')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson['client'][_0xb08d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x180a09,_0xa8af17,_0x531638,_0x5bc21e){return new BPromise(function(_0x4c3647,_0x6a38cd){var _0x28a43d=_0x5bc21e||client;return _0x28a43d[_0xb08d('0x1f')](_0x180a09,_0x531638)[_0xb08d('0x20')](function(_0x134677){logger['info'](_0xb08d('0x21'),_0xa8af17,_0xb08d('0x22'));logger[_0xb08d('0x23')](_0xb08d('0x24'),_0xa8af17,_0xb08d('0x22'),JSON[_0xb08d('0x25')](_0x134677));if(_0x134677[_0xb08d('0x26')]){if(_0x134677[_0xb08d('0x26')][_0xb08d('0x27')]===0x1f4){logger[_0xb08d('0x26')](_0xb08d('0x21'),_0xa8af17,_0x134677[_0xb08d('0x26')][_0xb08d('0x28')]);return _0x6a38cd(_0x134677['error']['message']);}logger[_0xb08d('0x26')](_0xb08d('0x21'),_0xa8af17,_0x134677[_0xb08d('0x26')][_0xb08d('0x28')]);return _0x4c3647(_0x134677[_0xb08d('0x26')][_0xb08d('0x28')]);}else{logger[_0xb08d('0x29')]('MailMessage,\x20%s,\x20%s',_0xa8af17,_0xb08d('0x22'));_0x4c3647(_0x134677[_0xb08d('0x2a')][_0xb08d('0x28')]);}})['catch'](function(_0x191eda){logger[_0xb08d('0x26')](_0xb08d('0x21'),_0xa8af17,_0x191eda);_0x6a38cd(_0x191eda);});});}function respondWithStatusCode(_0x43b4c1,_0x26f363){_0x26f363=_0x26f363||0xcc;return function(_0x3ea08e){if(_0x3ea08e){return _0x43b4c1[_0xb08d('0x2b')](_0x26f363);}return _0x43b4c1[_0xb08d('0x2c')](_0x26f363)[_0xb08d('0x2d')]();};}function respondWithResult(_0x2e23e1,_0x3870da){_0x3870da=_0x3870da||0xc8;return function(_0x5614c2){if(_0x5614c2){return _0x2e23e1[_0xb08d('0x2c')](_0x3870da)[_0xb08d('0x2e')](_0x5614c2);}};}function respondWithFilteredResult(_0xe2a263,_0x447f42){return function(_0x277332){if(_0x277332){var _0x2b7091=typeof _0x447f42[_0xb08d('0x2f')]==='undefined'&&typeof _0x447f42[_0xb08d('0x30')]===_0xb08d('0x31');var _0x313cb4=_0x277332[_0xb08d('0x32')];var _0x14beb2=_0x2b7091?0x0:_0x447f42[_0xb08d('0x2f')];var _0x3f4e43=_0x2b7091?_0x277332[_0xb08d('0x32')]:_0x447f42[_0xb08d('0x2f')]+_0x447f42['limit'];var _0x1b9778;if(_0x3f4e43>=_0x313cb4){_0x3f4e43=_0x313cb4;_0x1b9778=0xc8;}else{_0x1b9778=0xce;}_0xe2a263[_0xb08d('0x2c')](_0x1b9778);return _0xe2a263['set'](_0xb08d('0x33'),_0x14beb2+'-'+_0x3f4e43+'/'+_0x313cb4)[_0xb08d('0x2e')](_0x277332);}return null;};}function patchUpdates(_0xb93c){return function(_0x31155a){try{jsonpatch[_0xb08d('0x34')](_0x31155a,_0xb93c,!![]);}catch(_0x110071){return BPromise['reject'](_0x110071);}return _0x31155a[_0xb08d('0x35')]();};}function saveUpdates(_0x1629ef,_0xbdb3cf){return function(_0x3d72f3){if(_0x3d72f3){return _0x3d72f3[_0xb08d('0x36')](_0x1629ef)['then'](function(_0x34c93d){return _0x34c93d;});}return null;};}function removeEntity(_0x254556,_0x361a95){return function(_0x4dd87d){if(_0x4dd87d){return _0x4dd87d[_0xb08d('0x37')]()['then'](function(){_0x254556[_0xb08d('0x2c')](0xcc)[_0xb08d('0x2d')]();});}};}function handleEntityNotFound(_0x36dccf,_0x370dec){return function(_0x11d55e){if(!_0x11d55e){_0x36dccf[_0xb08d('0x2b')](0x194);}return _0x11d55e;};}function handleError(_0x212895,_0x3a59ac){_0x3a59ac=_0x3a59ac||0x1f4;return function(_0x16f86a){logger[_0xb08d('0x26')](_0x16f86a['stack']);if(_0x16f86a[_0xb08d('0x38')]){delete _0x16f86a['name'];}_0x212895[_0xb08d('0x2c')](_0x3a59ac)[_0xb08d('0x39')](_0x16f86a);};}exports[_0xb08d('0x3a')]=function(_0x534d44,_0x14bf24){var _0x2aff00={},_0x40d140={},_0x537eb4={'count':0x0,'rows':[]};var _0x240e60=_[_0xb08d('0x3b')](db[_0xb08d('0x3c')]['rawAttributes'],function(_0x482309){return{'name':_0x482309['fieldName'],'type':_0x482309[_0xb08d('0x3d')][_0xb08d('0x3e')]};});_0x40d140[_0xb08d('0x3f')]=_['map'](_0x240e60,_0xb08d('0x38'));_0x40d140[_0xb08d('0x40')]=_[_0xb08d('0x41')](_0x534d44[_0xb08d('0x40')]);_0x40d140[_0xb08d('0x42')]=_['intersection'](_0x40d140[_0xb08d('0x3f')],_0x40d140[_0xb08d('0x40')]);_0x2aff00[_0xb08d('0x43')]=_[_0xb08d('0x44')](_0x40d140[_0xb08d('0x3f')],qs[_0xb08d('0x45')](_0x534d44['query'][_0xb08d('0x45')]));_0x2aff00['attributes']=_0x2aff00[_0xb08d('0x43')][_0xb08d('0x46')]?_0x2aff00['attributes']:_0x40d140['model'];if(!_0x534d44[_0xb08d('0x40')][_0xb08d('0x47')](_0xb08d('0x48'))){_0x2aff00['limit']=qs[_0xb08d('0x30')](_0x534d44[_0xb08d('0x40')]['limit']);_0x2aff00[_0xb08d('0x2f')]=qs['offset'](_0x534d44[_0xb08d('0x40')][_0xb08d('0x2f')]);}_0x2aff00[_0xb08d('0x49')]=qs['sort'](_0x534d44[_0xb08d('0x40')][_0xb08d('0x4a')]);_0x2aff00[_0xb08d('0x4b')]=qs[_0xb08d('0x42')](_['pick'](_0x534d44['query'],_0x40d140[_0xb08d('0x42')]),_0x240e60);if(_0x534d44[_0xb08d('0x40')][_0xb08d('0x4c')]){_0x2aff00['where']=_[_0xb08d('0x4d')](_0x2aff00[_0xb08d('0x4b')],{'$or':_[_0xb08d('0x3b')](_0x240e60,function(_0x45bd20){if(_0x45bd20[_0xb08d('0x3d')]!==_0xb08d('0x4e')){var _0xb4fc51={};_0xb4fc51[_0x45bd20[_0xb08d('0x38')]]={'$like':'%'+_0x534d44['query'][_0xb08d('0x4c')]+'%'};return _0xb4fc51;}})});}_0x2aff00=_[_0xb08d('0x4d')]({},_0x2aff00,_0x534d44[_0xb08d('0x4f')]);var _0x2e2439={'where':_0x2aff00['where']};return db['MailMessage'][_0xb08d('0x32')](_0x2e2439)[_0xb08d('0x20')](function(_0x587278){_0x537eb4[_0xb08d('0x32')]=_0x587278;if(_0x534d44[_0xb08d('0x40')][_0xb08d('0x50')]){_0x2aff00[_0xb08d('0x51')]=[{'all':!![]}];}return db[_0xb08d('0x3c')][_0xb08d('0x52')](_0x2aff00);})['then'](function(_0x3f2e0d){_0x537eb4[_0xb08d('0x53')]=_0x3f2e0d;return _0x537eb4;})[_0xb08d('0x20')](respondWithFilteredResult(_0x14bf24,_0x2aff00))[_0xb08d('0x54')](handleError(_0x14bf24,null));};exports[_0xb08d('0x55')]=function(_0x207c5c,_0x404767){var _0x2269ab={'raw':!![],'where':{'id':_0x207c5c['params']['id']}},_0x1d41ea={};_0x1d41ea[_0xb08d('0x3f')]=_[_0xb08d('0x41')](db['MailMessage'][_0xb08d('0x56')]);_0x1d41ea[_0xb08d('0x40')]=_[_0xb08d('0x41')](_0x207c5c[_0xb08d('0x40')]);_0x1d41ea[_0xb08d('0x42')]=_[_0xb08d('0x44')](_0x1d41ea['model'],_0x1d41ea[_0xb08d('0x40')]);_0x2269ab[_0xb08d('0x43')]=_[_0xb08d('0x44')](_0x1d41ea[_0xb08d('0x3f')],qs[_0xb08d('0x45')](_0x207c5c[_0xb08d('0x40')][_0xb08d('0x45')]));_0x2269ab[_0xb08d('0x43')]=_0x2269ab[_0xb08d('0x43')][_0xb08d('0x46')]?_0x2269ab[_0xb08d('0x43')]:_0x1d41ea[_0xb08d('0x3f')];if(_0x207c5c['query'][_0xb08d('0x50')]){_0x2269ab['include']=[{'all':!![]}];}_0x2269ab=_[_0xb08d('0x4d')]({},_0x2269ab,_0x207c5c[_0xb08d('0x4f')]);return db[_0xb08d('0x3c')][_0xb08d('0x57')](_0x2269ab)['then'](handleEntityNotFound(_0x404767,null))[_0xb08d('0x20')](respondWithResult(_0x404767,null))[_0xb08d('0x54')](handleError(_0x404767,null));};exports[_0xb08d('0x36')]=function(_0x3d06ef,_0x5a3455){if(_0x3d06ef[_0xb08d('0x58')]['id']){delete _0x3d06ef[_0xb08d('0x58')]['id'];}return db[_0xb08d('0x3c')][_0xb08d('0x57')]({'where':{'id':_0x3d06ef[_0xb08d('0x59')]['id']}})[_0xb08d('0x20')](handleEntityNotFound(_0x5a3455,null))[_0xb08d('0x20')](saveUpdates(_0x3d06ef['body'],null))['then'](respondWithResult(_0x5a3455,null))[_0xb08d('0x54')](handleError(_0x5a3455,null));};exports['destroy']=function(_0x5738b5,_0x35ef93){return db[_0xb08d('0x3c')][_0xb08d('0x57')]({'where':{'id':_0x5738b5['params']['id']}})[_0xb08d('0x20')](handleEntityNotFound(_0x35ef93,null))[_0xb08d('0x20')](removeEntity(_0x35ef93,null))[_0xb08d('0x54')](handleError(_0x35ef93,null));};exports[_0xb08d('0x5a')]=function(_0x10e2de,_0x2da06c){return db[_0xb08d('0x3c')]['describe']()[_0xb08d('0x20')](respondWithResult(_0x2da06c,null))['catch'](handleError(_0x2da06c,null));};exports[_0xb08d('0x5b')]=function(_0xf9680b,_0x3863c7){return db[_0xb08d('0x3c')]['create'](_0xf9680b[_0xb08d('0x58')])[_0xb08d('0x20')](function(_0x339621){if(_0x339621){if(_0x339621[_0xb08d('0x5c')]===_0xb08d('0x5d')&&!_0x339621[_0xb08d('0x5e')]){var _0x63cf0e,_0x5e0ac1,_0x301612;if(_0xf9680b[_0xb08d('0x58')]['to']){_0x5e0ac1=_0xf9680b[_0xb08d('0x58')]['to'][_0xb08d('0x5f')](',')[0x0];}return db[_0xb08d('0x60')][_0xb08d('0x61')]({'where':{'id':_0x339621[_0xb08d('0x62')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb08d('0x63')],'as':_0xb08d('0x64'),'where':{'email':_0x5e0ac1},'limit':0x1,'order':[[_0xb08d('0x65'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0xb08d('0x66'),'raw':!![]}]})['then'](function(_0x27a2da){_0x63cf0e=_0x27a2da;if(_0x63cf0e&&_0x63cf0e[_0xb08d('0x66')]){var _0x4aa261={'tls':{'rejectUnauthorized':![]}};if(_[_0xb08d('0x67')](_0x63cf0e[_0xb08d('0x66')][_0xb08d('0x68')])){_0x4aa261[_0xb08d('0x69')]=_0x63cf0e[_0xb08d('0x66')][_0xb08d('0x69')];_0x4aa261[_0xb08d('0x6a')]=_0x63cf0e[_0xb08d('0x66')][_0xb08d('0x6a')];_0x4aa261[_0xb08d('0x6b')]=_0x63cf0e[_0xb08d('0x66')][_0xb08d('0x6b')];if(_0x63cf0e[_0xb08d('0x66')]['authentication']){_0x4aa261[_0xb08d('0x6c')]={'user':_0x63cf0e['Smtp'][_0xb08d('0x6d')],'pass':_0x63cf0e[_0xb08d('0x66')]['pass']};}}else{_0x4aa261[_0xb08d('0x68')]=_0x63cf0e['Smtp'][_0xb08d('0x68')];_0x4aa261[_0xb08d('0x6c')]={'user':_0x63cf0e['Smtp'][_0xb08d('0x6d')],'pass':_0x63cf0e[_0xb08d('0x66')][_0xb08d('0x6e')]};_0x4aa261[_0xb08d('0x6b')]=_0x63cf0e['Smtp'][_0xb08d('0x6b')];}if(_0xf9680b[_0xb08d('0x58')][_0xb08d('0x6f')]&&_0xf9680b['body'][_0xb08d('0x6f')][_0xb08d('0x46')]){for(var _0x1742a3=0x0;_0x1742a3<_0xf9680b['body'][_0xb08d('0x6f')][_0xb08d('0x46')];_0x1742a3+=0x1){_0xf9680b[_0xb08d('0x58')][_0xb08d('0x6f')][_0x1742a3]={'filename':_0xf9680b[_0xb08d('0x58')][_0xb08d('0x6f')][_0x1742a3][_0xb08d('0x38')],'path':path[_0xb08d('0x70')](config[_0xb08d('0x71')],_0xb08d('0x72'),_0xf9680b['body'][_0xb08d('0x6f')][_0x1742a3][_0xb08d('0x73')])};}}_0x301612={'account':_0x4aa261,'message':_0xf9680b[_0xb08d('0x58')]};return;}})[_0xb08d('0x20')](function(){if(_0x63cf0e[_0xb08d('0x74')]){if(_0x63cf0e[_0xb08d('0x74')]['Contacts'][_0xb08d('0x46')]){return _0x63cf0e[_0xb08d('0x74')][_0xb08d('0x64')][0x0];}else{return db[_0xb08d('0x63')][_0xb08d('0x5b')](_[_0xb08d('0x18')](_0xf9680b['body'],{'firstName':_0xf9680b[_0xb08d('0x58')]['to'],'email':_0xf9680b[_0xb08d('0x58')]['to'],'phone':_0xf9680b[_0xb08d('0x58')]['to'],'ListId':_0x63cf0e['ListId']}));}}else{throw new Error(_0xb08d('0x75'));}})[_0xb08d('0x20')](function(){if(_0x301612){return respondWithRpcPromise(_0xb08d('0x76'),'sendMail',_0x301612,client9003)['then'](function(_0x34845f){return _0x339621[_0xb08d('0x36')]({'read':!![],'messageId':_0x34845f[_0xb08d('0x77')],'sentAt':moment()['format'](_0xb08d('0x78'))});})[_0xb08d('0x54')](function(_0x551628){logger[_0xb08d('0x26')]('%s',JSON[_0xb08d('0x25')](_0x551628));return _0x339621;});}return _0x339621;});}return _0x339621;}})[_0xb08d('0x20')](respondWithResult(_0x3863c7,0xc9))[_0xb08d('0x54')](handleError(_0x3863c7,null));};var interaction_log=require(_0xb08d('0x12'))(_0xb08d('0x79'));exports[_0xb08d('0x7a')]=function(_0x1c4d51,_0x437d08,_0x44865f){var _0x281228={'agent':{},'channel':_0xb08d('0x7b')};if(_0x1c4d51[_0xb08d('0x58')]['id']){delete _0x1c4d51[_0xb08d('0x58')]['id'];}_0x1c4d51[_0xb08d('0x58')][_0xb08d('0x7c')]=!![];_0x1c4d51['body'][_0xb08d('0x7d')]=moment()[_0xb08d('0x7e')](_0xb08d('0x78'));_0x1c4d51[_0xb08d('0x58')][_0xb08d('0x7f')]=_0x1c4d51[_0xb08d('0x58')][_0xb08d('0x7f')]||_0x1c4d51[_0xb08d('0x6d')]['id'];_0x281228[_0xb08d('0x80')]['id']=_0x1c4d51[_0xb08d('0x58')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x1c4d51[_0xb08d('0x59')]['id'],'UserId':null},'include':[{'model':db[_0xb08d('0x63')],'as':_0xb08d('0x81')}]})[_0xb08d('0x20')](handleEntityNotFound(_0x437d08,null))[_0xb08d('0x20')](saveUpdates(_0x1c4d51['body'],null))[_0xb08d('0x20')](function(_0x241578){if(_0x241578){_0x281228[_0xb08d('0x28')]=_0x241578[_0xb08d('0x82')]({'plain':!![]});return db['MailInteraction'][_0xb08d('0x57')]({'where':{'id':_0x241578[_0xb08d('0x83')]}});}return null;})['then'](handleEntityNotFound(_0x437d08,null))[_0xb08d('0x20')](function(_0x268fdd){if(_0x268fdd){return _0x268fdd[_0xb08d('0x36')]({'UserId':_0x1c4d51[_0xb08d('0x58')]['UserId'],'read1stAt':_['isNil'](_0x268fdd[_0xb08d('0x84')])?moment()[_0xb08d('0x7e')](_0xb08d('0x78')):undefined});}return null;})[_0xb08d('0x20')](function(_0x45df25){if(_0x45df25){_0x281228[_0xb08d('0x85')]=_0x45df25[_0xb08d('0x82')]({'plain':!![]});interaction_log[_0xb08d('0x29')](_0xb08d('0x86'),_0x1c4d51[_0xb08d('0x6d')]['id'],_0x1c4d51[_0xb08d('0x6d')][_0xb08d('0x38')],_0x1c4d51[_0xb08d('0x6d')]['role'],_0x281228[_0xb08d('0x85')]['id'],_0x1c4d51[_0xb08d('0x58')]?JSON[_0xb08d('0x25')](_0x1c4d51[_0xb08d('0x58')]):'null');return respondWithRpcPromise(_0xb08d('0x87'),_0xb08d('0x88'),_0x281228);}return null;})[_0xb08d('0x20')](function(_0x177129){return db['CmContact'][_0xb08d('0x5a')]()[_0xb08d('0x20')](function(_0x2dc8f8){var _0x2d2145=[];for(var _0x583729=0x0;_0x583729=_0x44a672){_0x551f8a=_0x44a672;_0x3e42a2=0xc8;}else{_0x3e42a2=0xce;}_0x48e768[_0xbbac('0x2d')](_0x3e42a2);return _0x48e768['set'](_0xbbac('0x33'),_0x1255ab+'-'+_0x551f8a+'/'+_0x44a672)[_0xbbac('0x2e')](_0x30d552);}return null;};}function patchUpdates(_0x20701f){return function(_0x5ee4d3){try{jsonpatch[_0xbbac('0x34')](_0x5ee4d3,_0x20701f,!![]);}catch(_0x34a93f){return BPromise[_0xbbac('0x35')](_0x34a93f);}return _0x5ee4d3['save']();};}function saveUpdates(_0x3a5b77,_0x44df8b){return function(_0xbb6960){if(_0xbb6960){return _0xbb6960['update'](_0x3a5b77)['then'](function(_0x5e87b3){return _0x5e87b3;});}return null;};}function removeEntity(_0x3fd372,_0x18a5d9){return function(_0x145bf6){if(_0x145bf6){return _0x145bf6[_0xbbac('0x36')]()['then'](function(){_0x3fd372['status'](0xcc)[_0xbbac('0x37')]();});}};}function handleEntityNotFound(_0x250937,_0x422411){return function(_0x5c15eb){if(!_0x5c15eb){_0x250937[_0xbbac('0x2c')](0x194);}return _0x5c15eb;};}function handleError(_0xc167fd,_0x295f30){_0x295f30=_0x295f30||0x1f4;return function(_0x48c379){logger[_0xbbac('0x27')](_0x48c379[_0xbbac('0x38')]);if(_0x48c379['name']){delete _0x48c379['name'];}_0xc167fd[_0xbbac('0x2d')](_0x295f30)['send'](_0x48c379);};}exports['index']=function(_0x53e510,_0x2233e2){var _0xd4b0fb={},_0x586e49={},_0x2bfa0b={'count':0x0,'rows':[]};var _0x37fc7f=_[_0xbbac('0x39')](db[_0xbbac('0x3a')][_0xbbac('0x3b')],function(_0x1e7dbf){return{'name':_0x1e7dbf[_0xbbac('0x3c')],'type':_0x1e7dbf[_0xbbac('0x3d')][_0xbbac('0x3e')]};});_0x586e49[_0xbbac('0x3f')]=_[_0xbbac('0x39')](_0x37fc7f,_0xbbac('0x40'));_0x586e49[_0xbbac('0x41')]=_[_0xbbac('0x42')](_0x53e510[_0xbbac('0x41')]);_0x586e49[_0xbbac('0x43')]=_[_0xbbac('0x44')](_0x586e49[_0xbbac('0x3f')],_0x586e49['query']);_0xd4b0fb['attributes']=_[_0xbbac('0x44')](_0x586e49['model'],qs[_0xbbac('0x45')](_0x53e510[_0xbbac('0x41')][_0xbbac('0x45')]));_0xd4b0fb['attributes']=_0xd4b0fb[_0xbbac('0x46')][_0xbbac('0x47')]?_0xd4b0fb[_0xbbac('0x46')]:_0x586e49[_0xbbac('0x3f')];if(!_0x53e510[_0xbbac('0x41')][_0xbbac('0x48')](_0xbbac('0x49'))){_0xd4b0fb[_0xbbac('0x30')]=qs[_0xbbac('0x30')](_0x53e510[_0xbbac('0x41')][_0xbbac('0x30')]);_0xd4b0fb['offset']=qs[_0xbbac('0x32')](_0x53e510[_0xbbac('0x41')][_0xbbac('0x32')]);}_0xd4b0fb[_0xbbac('0x4a')]=qs[_0xbbac('0x4b')](_0x53e510['query'][_0xbbac('0x4b')]);_0xd4b0fb[_0xbbac('0x4c')]=qs['filters'](_[_0xbbac('0x4d')](_0x53e510['query'],_0x586e49[_0xbbac('0x43')]),_0x37fc7f);if(_0x53e510[_0xbbac('0x41')][_0xbbac('0x4e')]){_0xd4b0fb[_0xbbac('0x4c')]=_['merge'](_0xd4b0fb['where'],{'$or':_[_0xbbac('0x39')](_0x37fc7f,function(_0x522555){if(_0x522555[_0xbbac('0x3d')]!=='VIRTUAL'){var _0x19ab8d={};_0x19ab8d[_0x522555[_0xbbac('0x40')]]={'$like':'%'+_0x53e510[_0xbbac('0x41')][_0xbbac('0x4e')]+'%'};return _0x19ab8d;}})});}_0xd4b0fb=_[_0xbbac('0x4f')]({},_0xd4b0fb,_0x53e510['options']);var _0x312c4f={'where':_0xd4b0fb[_0xbbac('0x4c')]};return db[_0xbbac('0x3a')]['count'](_0x312c4f)[_0xbbac('0x21')](function(_0x5f44a8){_0x2bfa0b['count']=_0x5f44a8;if(_0x53e510['query'][_0xbbac('0x50')]){_0xd4b0fb[_0xbbac('0x51')]=[{'all':!![]}];}return db[_0xbbac('0x3a')][_0xbbac('0x52')](_0xd4b0fb);})['then'](function(_0x61889c){_0x2bfa0b[_0xbbac('0x53')]=_0x61889c;return _0x2bfa0b;})['then'](respondWithFilteredResult(_0x2233e2,_0xd4b0fb))[_0xbbac('0x2b')](handleError(_0x2233e2,null));};exports[_0xbbac('0x54')]=function(_0x55937c,_0x221f34){var _0x54f9bb={'raw':!![],'where':{'id':_0x55937c['params']['id']}},_0x41cac6={};_0x41cac6[_0xbbac('0x3f')]=_[_0xbbac('0x42')](db[_0xbbac('0x3a')]['rawAttributes']);_0x41cac6[_0xbbac('0x41')]=_[_0xbbac('0x42')](_0x55937c[_0xbbac('0x41')]);_0x41cac6[_0xbbac('0x43')]=_['intersection'](_0x41cac6['model'],_0x41cac6[_0xbbac('0x41')]);_0x54f9bb[_0xbbac('0x46')]=_['intersection'](_0x41cac6[_0xbbac('0x3f')],qs['fields'](_0x55937c['query'][_0xbbac('0x45')]));_0x54f9bb['attributes']=_0x54f9bb['attributes']['length']?_0x54f9bb['attributes']:_0x41cac6[_0xbbac('0x3f')];if(_0x55937c[_0xbbac('0x41')][_0xbbac('0x50')]){_0x54f9bb['include']=[{'all':!![]}];}_0x54f9bb=_[_0xbbac('0x4f')]({},_0x54f9bb,_0x55937c['options']);return db[_0xbbac('0x3a')]['find'](_0x54f9bb)['then'](handleEntityNotFound(_0x221f34,null))['then'](respondWithResult(_0x221f34,null))['catch'](handleError(_0x221f34,null));};exports[_0xbbac('0x55')]=function(_0x4ed2f4,_0x379141){if(_0x4ed2f4[_0xbbac('0x56')]['id']){delete _0x4ed2f4[_0xbbac('0x56')]['id'];}return db['MailMessage'][_0xbbac('0x57')]({'where':{'id':_0x4ed2f4[_0xbbac('0x58')]['id']}})[_0xbbac('0x21')](handleEntityNotFound(_0x379141,null))[_0xbbac('0x21')](saveUpdates(_0x4ed2f4[_0xbbac('0x56')],null))[_0xbbac('0x21')](respondWithResult(_0x379141,null))[_0xbbac('0x2b')](handleError(_0x379141,null));};exports['destroy']=function(_0x4cc75f,_0x496493){return db[_0xbbac('0x3a')][_0xbbac('0x57')]({'where':{'id':_0x4cc75f[_0xbbac('0x58')]['id']}})['then'](handleEntityNotFound(_0x496493,null))[_0xbbac('0x21')](removeEntity(_0x496493,null))['catch'](handleError(_0x496493,null));};exports[_0xbbac('0x59')]=function(_0x35d896,_0x9803b9){return db[_0xbbac('0x3a')][_0xbbac('0x59')]()[_0xbbac('0x21')](respondWithResult(_0x9803b9,null))[_0xbbac('0x2b')](handleError(_0x9803b9,null));};exports['create']=function(_0x4a5e5b,_0x5d8f63){return db['MailMessage'][_0xbbac('0x5a')](_0x4a5e5b['body'])['then'](function(_0x3b740f){if(_0x3b740f){if(_0x3b740f['direction']===_0xbbac('0x5b')&&!_0x3b740f[_0xbbac('0x5c')]){var _0x8e5218,_0x33a443,_0x23a523;if(_0x4a5e5b[_0xbbac('0x56')]['to']){_0x33a443=_0x4a5e5b[_0xbbac('0x56')]['to'][_0xbbac('0x5d')](',')[0x0];}return db[_0xbbac('0x5e')][_0xbbac('0x5f')]({'where':{'id':_0x3b740f[_0xbbac('0x60')]},'include':[{'model':db[_0xbbac('0x61')],'as':'List','include':[{'model':db[_0xbbac('0x62')],'as':_0xbbac('0x63'),'where':{'email':_0x33a443},'limit':0x1,'order':[[_0xbbac('0x64'),_0xbbac('0x65')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xbbac('0x21')](function(_0xf99d02){_0x8e5218=_0xf99d02;if(_0x8e5218&&_0x8e5218['Smtp']){var _0x41b3e3={'tls':{'rejectUnauthorized':![]}};if(_[_0xbbac('0x66')](_0x8e5218[_0xbbac('0x67')][_0xbbac('0x68')])){_0x41b3e3['host']=_0x8e5218[_0xbbac('0x67')][_0xbbac('0x69')];_0x41b3e3[_0xbbac('0x6a')]=_0x8e5218['Smtp'][_0xbbac('0x6a')];_0x41b3e3[_0xbbac('0x6b')]=_0x8e5218['Smtp'][_0xbbac('0x6b')];if(_0x8e5218[_0xbbac('0x67')][_0xbbac('0x6c')]){_0x41b3e3[_0xbbac('0x6d')]={'user':_0x8e5218['Smtp'][_0xbbac('0x6e')],'pass':_0x8e5218[_0xbbac('0x67')][_0xbbac('0x6f')]};}}else{_0x41b3e3[_0xbbac('0x68')]=_0x8e5218[_0xbbac('0x67')][_0xbbac('0x68')];_0x41b3e3[_0xbbac('0x6d')]={'user':_0x8e5218[_0xbbac('0x67')][_0xbbac('0x6e')],'pass':_0x8e5218[_0xbbac('0x67')][_0xbbac('0x6f')]};_0x41b3e3[_0xbbac('0x6b')]=_0x8e5218['Smtp'][_0xbbac('0x6b')];}if(_0x4a5e5b['body'][_0xbbac('0x70')]&&_0x4a5e5b[_0xbbac('0x56')][_0xbbac('0x70')]['length']){for(var _0x454e48=0x0;_0x454e48<_0x4a5e5b['body']['attachments'][_0xbbac('0x47')];_0x454e48+=0x1){_0x4a5e5b[_0xbbac('0x56')]['attachments'][_0x454e48]={'filename':_0x4a5e5b[_0xbbac('0x56')][_0xbbac('0x70')][_0x454e48]['name'],'path':path['join'](config['root'],_0xbbac('0x71'),_0x4a5e5b[_0xbbac('0x56')][_0xbbac('0x70')][_0x454e48]['basename'])};}}_0x23a523={'account':_0x41b3e3,'message':_0x4a5e5b['body']};return;}})[_0xbbac('0x21')](function(){if(_0x8e5218['List']){if(_0x8e5218['List'][_0xbbac('0x63')]['length']){return _0x8e5218[_0xbbac('0x72')][_0xbbac('0x63')][0x0];}else{return db['CmContact']['create'](_[_0xbbac('0x19')](_0x4a5e5b[_0xbbac('0x56')],{'firstName':_0x4a5e5b['body']['to'],'email':_0x4a5e5b['body']['to'],'phone':_0x4a5e5b[_0xbbac('0x56')]['to'],'ListId':_0x8e5218['ListId']}));}}else{throw new Error(_0xbbac('0x73'));}})[_0xbbac('0x21')](function(){if(_0x23a523){return respondWithRpcPromise(_0xbbac('0x74'),_0xbbac('0x75'),_0x23a523,client9003)[_0xbbac('0x21')](function(_0x427d56){return _0x3b740f[_0xbbac('0x55')]({'read':!![],'messageId':_0x427d56[_0xbbac('0x76')],'sentAt':moment()[_0xbbac('0x77')](_0xbbac('0x78'))});})['catch'](function(_0x51e39e){logger[_0xbbac('0x27')]('%s',JSON[_0xbbac('0x26')](_0x51e39e));return _0x3b740f;});}return _0x3b740f;});}return _0x3b740f;}})[_0xbbac('0x21')](respondWithResult(_0x5d8f63,0xc9))[_0xbbac('0x2b')](handleError(_0x5d8f63,null));};var interaction_log=require(_0xbbac('0x15'))(_0xbbac('0x79'));exports[_0xbbac('0x7a')]=function(_0x20e9c2,_0x1417cd,_0x21d447){var _0x3e3c34={'agent':{},'channel':'mail'};if(_0x20e9c2['body']['id']){delete _0x20e9c2[_0xbbac('0x56')]['id'];}_0x20e9c2[_0xbbac('0x56')][_0xbbac('0x7b')]=!![];_0x20e9c2[_0xbbac('0x56')][_0xbbac('0x7c')]=moment()[_0xbbac('0x77')](_0xbbac('0x78'));_0x20e9c2['body'][_0xbbac('0x7d')]=_0x20e9c2[_0xbbac('0x56')][_0xbbac('0x7d')]||_0x20e9c2[_0xbbac('0x6e')]['id'];_0x3e3c34[_0xbbac('0x7e')]['id']=_0x20e9c2[_0xbbac('0x56')][_0xbbac('0x7d')];return db[_0xbbac('0x3a')][_0xbbac('0x57')]({'where':{'id':_0x20e9c2[_0xbbac('0x58')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xbbac('0x7f')}]})[_0xbbac('0x21')](handleEntityNotFound(_0x1417cd,null))[_0xbbac('0x21')](saveUpdates(_0x20e9c2[_0xbbac('0x56')],null))[_0xbbac('0x21')](function(_0x553354){if(_0x553354){_0x3e3c34[_0xbbac('0x29')]=_0x553354[_0xbbac('0x80')]({'plain':!![]});return db['MailInteraction'][_0xbbac('0x57')]({'where':{'id':_0x553354[_0xbbac('0x81')]}});}return null;})[_0xbbac('0x21')](handleEntityNotFound(_0x1417cd,null))[_0xbbac('0x21')](function(_0x15fa97){if(_0x15fa97){return _0x15fa97[_0xbbac('0x55')]({'UserId':_0x20e9c2[_0xbbac('0x56')]['UserId'],'read1stAt':_[_0xbbac('0x66')](_0x15fa97[_0xbbac('0x82')])?moment()[_0xbbac('0x77')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xbbac('0x21')](function(_0x1a276e){if(_0x1a276e){_0x3e3c34[_0xbbac('0x83')]=_0x1a276e[_0xbbac('0x80')]({'plain':!![]});interaction_log['info'](_0xbbac('0x84'),_0x20e9c2[_0xbbac('0x6e')]['id'],_0x20e9c2['user']['name'],_0x20e9c2['user'][_0xbbac('0x85')],_0x3e3c34[_0xbbac('0x83')]['id'],_0x20e9c2[_0xbbac('0x56')]?JSON[_0xbbac('0x26')](_0x20e9c2[_0xbbac('0x56')]):_0xbbac('0x86'));return respondWithRpcPromise(_0xbbac('0x87'),_0xbbac('0x88'),_0x3e3c34);}return null;})[_0xbbac('0x21')](function(_0x436d5a){return db[_0xbbac('0x62')][_0xbbac('0x59')]()['then'](function(_0x14493a){var _0x5938b2=[];for(var _0x14558b=0x0;_0x14558b=_0xb7c37b){_0x1e6bca=_0xb7c37b;_0x5168c8=0xc8;}else{_0x5168c8=0xce;}_0xd996b3[_0x4af8('0x20')](_0x5168c8);return _0xd996b3[_0x4af8('0x27')](_0x4af8('0x28'),_0x151b20+'-'+_0x1e6bca+'/'+_0xb7c37b)['json'](_0x494252);}return null;};}function patchUpdates(_0x3cdd65){return function(_0x530046){try{jsonpatch[_0x4af8('0x29')](_0x530046,_0x3cdd65,!![]);}catch(_0x3a712f){return BPromise['reject'](_0x3a712f);}return _0x530046['save']();};}function saveUpdates(_0xdf1f6e,_0x43f92a){return function(_0x3b01b2){if(_0x3b01b2){return _0x3b01b2[_0x4af8('0x2a')](_0xdf1f6e)['then'](function(_0x44bea2){return _0x44bea2;});}return null;};}function removeEntity(_0x987f9c,_0x580f68){return function(_0x47de3e){if(_0x47de3e){return _0x47de3e[_0x4af8('0x2b')]()[_0x4af8('0x2c')](function(){var _0x1430a0=_0x47de3e[_0x4af8('0x2d')]({'plain':!![]});var _0x198641=_0x4af8('0x2e');return db[_0x4af8('0x2f')]['destroy']({'where':{'type':_0x198641,'resourceId':_0x1430a0['id']}})[_0x4af8('0x2c')](function(){return _0x47de3e;});})['then'](function(){_0x987f9c[_0x4af8('0x20')](0xcc)[_0x4af8('0x21')]();});}};}function handleEntityNotFound(_0x55d764,_0x101d16){return function(_0x377784){if(!_0x377784){_0x55d764['sendStatus'](0x194);}return _0x377784;};}function handleError(_0x237ceb,_0x2aa07c){_0x2aa07c=_0x2aa07c||0x1f4;return function(_0x382b2b){logger[_0x4af8('0x30')](_0x382b2b[_0x4af8('0x31')]);if(_0x382b2b[_0x4af8('0x32')]){delete _0x382b2b[_0x4af8('0x32')];}_0x237ceb[_0x4af8('0x20')](_0x2aa07c)['send'](_0x382b2b);};}exports[_0x4af8('0x33')]=function(_0x1f579a,_0xe4496d){var _0x52016a={},_0x51df3f={},_0x3adc04={'count':0x0,'rows':[]};var _0x14cfb0=_[_0x4af8('0x34')](db[_0x4af8('0x35')]['rawAttributes'],function(_0x590cc1){return{'name':_0x590cc1[_0x4af8('0x36')],'type':_0x590cc1[_0x4af8('0x37')][_0x4af8('0x38')]};});_0x51df3f[_0x4af8('0x39')]=_['map'](_0x14cfb0,'name');_0x51df3f[_0x4af8('0x3a')]=_[_0x4af8('0x3b')](_0x1f579a[_0x4af8('0x3a')]);_0x51df3f['filters']=_[_0x4af8('0x3c')](_0x51df3f[_0x4af8('0x39')],_0x51df3f['query']);_0x52016a[_0x4af8('0x3d')]=_[_0x4af8('0x3c')](_0x51df3f[_0x4af8('0x39')],qs['fields'](_0x1f579a[_0x4af8('0x3a')]['fields']));_0x52016a[_0x4af8('0x3d')]=_0x52016a[_0x4af8('0x3d')][_0x4af8('0x3e')]?_0x52016a[_0x4af8('0x3d')]:_0x51df3f[_0x4af8('0x39')];if(!_0x1f579a[_0x4af8('0x3a')]['hasOwnProperty'](_0x4af8('0x3f'))){_0x52016a[_0x4af8('0x25')]=qs[_0x4af8('0x25')](_0x1f579a['query'][_0x4af8('0x25')]);_0x52016a[_0x4af8('0x23')]=qs[_0x4af8('0x23')](_0x1f579a['query']['offset']);}_0x52016a[_0x4af8('0x40')]=qs[_0x4af8('0x41')](_0x1f579a['query'][_0x4af8('0x41')]);_0x52016a[_0x4af8('0x42')]=qs[_0x4af8('0x43')](_['pick'](_0x1f579a[_0x4af8('0x3a')],_0x51df3f[_0x4af8('0x43')]),_0x14cfb0);if(_0x1f579a[_0x4af8('0x3a')][_0x4af8('0x44')]){_0x52016a[_0x4af8('0x42')]=_[_0x4af8('0x45')](_0x52016a[_0x4af8('0x42')],{'$or':_[_0x4af8('0x34')](_0x14cfb0,function(_0x24bc46){if(_0x24bc46[_0x4af8('0x37')]!=='VIRTUAL'){var _0x2604ad={};_0x2604ad[_0x24bc46['name']]={'$like':'%'+_0x1f579a[_0x4af8('0x3a')][_0x4af8('0x44')]+'%'};return _0x2604ad;}})});}_0x52016a=_['merge']({},_0x52016a,_0x1f579a[_0x4af8('0x46')]);var _0xecccf1={'where':_0x52016a[_0x4af8('0x42')]};return db[_0x4af8('0x35')]['count'](_0xecccf1)['then'](function(_0x36e532){_0x3adc04[_0x4af8('0x26')]=_0x36e532;if(_0x1f579a[_0x4af8('0x3a')][_0x4af8('0x47')]){_0x52016a[_0x4af8('0x48')]=[{'all':!![]}];}return db[_0x4af8('0x35')][_0x4af8('0x49')](_0x52016a);})['then'](function(_0x17ebe4){_0x3adc04[_0x4af8('0x4a')]=_0x17ebe4;return _0x3adc04;})['then'](respondWithFilteredResult(_0xe4496d,_0x52016a))['catch'](handleError(_0xe4496d,null));};exports['show']=function(_0x1ad902,_0x58e9c2){var _0x2776be={'raw':!![],'where':{'id':_0x1ad902[_0x4af8('0x4b')]['id']}},_0x417234={};_0x417234['model']=_[_0x4af8('0x3b')](db['MailQueue'][_0x4af8('0x4c')]);_0x417234[_0x4af8('0x3a')]=_[_0x4af8('0x3b')](_0x1ad902[_0x4af8('0x3a')]);_0x417234[_0x4af8('0x43')]=_[_0x4af8('0x3c')](_0x417234[_0x4af8('0x39')],_0x417234[_0x4af8('0x3a')]);_0x2776be[_0x4af8('0x3d')]=_['intersection'](_0x417234[_0x4af8('0x39')],qs[_0x4af8('0x4d')](_0x1ad902[_0x4af8('0x3a')][_0x4af8('0x4d')]));_0x2776be[_0x4af8('0x3d')]=_0x2776be['attributes']['length']?_0x2776be[_0x4af8('0x3d')]:_0x417234[_0x4af8('0x39')];if(_0x1ad902[_0x4af8('0x3a')][_0x4af8('0x47')]){_0x2776be[_0x4af8('0x48')]=[{'all':!![]}];}_0x2776be=_[_0x4af8('0x45')]({},_0x2776be,_0x1ad902[_0x4af8('0x46')]);return db[_0x4af8('0x35')][_0x4af8('0x4e')](_0x2776be)['then'](handleEntityNotFound(_0x58e9c2,null))['then'](respondWithResult(_0x58e9c2,null))[_0x4af8('0x4f')](handleError(_0x58e9c2,null));};exports[_0x4af8('0x50')]=function(_0x2050ad,_0x419dfc){return db['MailQueue'][_0x4af8('0x50')](_0x2050ad[_0x4af8('0x51')],{})[_0x4af8('0x2c')](function(_0x598b2b){var _0x5a83e7=_0x2050ad[_0x4af8('0x52')][_0x4af8('0x2d')]({'plain':!![]});if(!_0x5a83e7)throw new Error(_0x4af8('0x53'));if(_0x5a83e7[_0x4af8('0x54')]===_0x4af8('0x52')){var _0x3d91fd=_0x598b2b[_0x4af8('0x2d')]({'plain':!![]});var _0x446958=_0x4af8('0x2e');return db[_0x4af8('0x55')][_0x4af8('0x4e')]({'where':{'name':_0x446958,'userProfileId':_0x5a83e7['userProfileId']},'raw':!![]})[_0x4af8('0x2c')](function(_0xfdaa0){if(_0xfdaa0&&_0xfdaa0[_0x4af8('0x56')]===0x0){return db['UserProfileResource'][_0x4af8('0x50')]({'name':_0x3d91fd['name'],'resourceId':_0x3d91fd['id'],'type':_0xfdaa0[_0x4af8('0x32')],'sectionId':_0xfdaa0['id']},{})['then'](function(){return _0x598b2b;});}else{return _0x598b2b;}})[_0x4af8('0x4f')](function(_0x585c0e){logger[_0x4af8('0x30')](_0x4af8('0x57'),_0x585c0e);throw _0x585c0e;});}return _0x598b2b;})[_0x4af8('0x2c')](respondWithResult(_0x419dfc,0xc9))['catch'](handleError(_0x419dfc,null));};exports['update']=function(_0x4372cc,_0x5de1eb){if(_0x4372cc[_0x4af8('0x51')]['id']){delete _0x4372cc[_0x4af8('0x51')]['id'];}return db[_0x4af8('0x35')][_0x4af8('0x4e')]({'where':{'id':_0x4372cc['params']['id']}})[_0x4af8('0x2c')](handleEntityNotFound(_0x5de1eb,null))[_0x4af8('0x2c')](saveUpdates(_0x4372cc[_0x4af8('0x51')],null))[_0x4af8('0x2c')](respondWithResult(_0x5de1eb,null))[_0x4af8('0x4f')](handleError(_0x5de1eb,null));};exports[_0x4af8('0x2b')]=function(_0x388327,_0x1d5570){return db[_0x4af8('0x35')][_0x4af8('0x4e')]({'where':{'id':_0x388327[_0x4af8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1d5570,null))[_0x4af8('0x2c')](removeEntity(_0x1d5570,null))['catch'](handleError(_0x1d5570,null));};exports[_0x4af8('0x58')]=function(_0x33e9e3,_0xf66276){return db[_0x4af8('0x35')][_0x4af8('0x58')]()['then'](respondWithResult(_0xf66276,null))[_0x4af8('0x4f')](handleError(_0xf66276,null));};exports[_0x4af8('0x59')]=function(_0x295a71,_0x16a58d,_0x5ed1b2){var _0x1ff739={'raw':!![],'where':{}},_0x3ad427={},_0x4cdc56;return db['MailQueue']['findOne']({'where':{'id':_0x295a71[_0x4af8('0x4b')]['id']}})[_0x4af8('0x2c')](handleEntityNotFound(_0x16a58d,null))['then'](function(_0x2cadaf){if(_0x2cadaf){_0x4cdc56=_0x2cadaf[_0x4af8('0x2d')]({'plain':!![]});_0x3ad427[_0x4af8('0x39')]=_[_0x4af8('0x3b')](db[_0x4af8('0x5a')][_0x4af8('0x4c')]);_0x3ad427['query']=_[_0x4af8('0x3b')](_0x295a71[_0x4af8('0x3a')]);_0x3ad427[_0x4af8('0x43')]=_[_0x4af8('0x3c')](_0x3ad427[_0x4af8('0x39')],_0x3ad427['query']);_0x1ff739[_0x4af8('0x3d')]=_[_0x4af8('0x3c')](_0x3ad427[_0x4af8('0x39')],qs[_0x4af8('0x4d')](_0x295a71[_0x4af8('0x3a')][_0x4af8('0x4d')]));_0x1ff739[_0x4af8('0x3d')]=_0x1ff739[_0x4af8('0x3d')][_0x4af8('0x3e')]?_0x1ff739[_0x4af8('0x3d')]:_0x3ad427['model'];if(!_0x295a71['query']['hasOwnProperty'](_0x4af8('0x3f'))){_0x1ff739[_0x4af8('0x25')]=qs[_0x4af8('0x25')](_0x295a71[_0x4af8('0x3a')]['limit']);_0x1ff739[_0x4af8('0x23')]=qs[_0x4af8('0x23')](_0x295a71[_0x4af8('0x3a')][_0x4af8('0x23')]);}_0x1ff739[_0x4af8('0x40')]=qs[_0x4af8('0x41')](_0x295a71[_0x4af8('0x3a')][_0x4af8('0x41')]);_0x1ff739[_0x4af8('0x42')]=qs[_0x4af8('0x43')](_[_0x4af8('0x5b')](_0x295a71[_0x4af8('0x3a')],_0x3ad427['filters']));_0x1ff739[_0x4af8('0x42')][_0x4af8('0x5c')]=_0x2cadaf['id'];if(_0x295a71['query']['filter']){_0x1ff739[_0x4af8('0x42')]=_[_0x4af8('0x45')](_0x1ff739['where'],{'$or':_[_0x4af8('0x34')](_0x1ff739[_0x4af8('0x3d')],function(_0x38e94a){var _0x8be312={};_0x8be312[_0x38e94a]={'$like':'%'+_0x295a71[_0x4af8('0x3a')][_0x4af8('0x44')]+'%'};return _0x8be312;})});}_0x1ff739=_['merge']({},_0x1ff739,_0x295a71[_0x4af8('0x46')]);return db[_0x4af8('0x5a')][_0x4af8('0x49')](_0x1ff739);}})['then'](function(_0xeb1c41){if(_0xeb1c41){return db[_0x4af8('0x5d')][_0x4af8('0x5e')]({'where':{'id':_[_0x4af8('0x34')](_0xeb1c41,'UserId'),'role':_0x4af8('0x5f')},'attributes':['id',_0x4af8('0x32'),_0x4af8('0x60'),_0x4af8('0x61'),_0x4af8('0x62')]});}})['then'](function(_0x392ee9){if(_0x392ee9){return{'count':_0x392ee9[_0x4af8('0x26')],'rows':_['map'](_0x392ee9['rows'],function(_0xf598d3){return{'membername':_0xf598d3[_0x4af8('0x32')],'UserId':_0xf598d3['id'],'queue_name':_0x4cdc56['name'],'MailQueueId':_0x4cdc56['id'],'interface':util['format'](_0x4af8('0x63'),_0x4af8('0x64'),_0xf598d3['name']),'penalty':0x0,'paused':_0xf598d3['mailPause'],'createdAt':_0xf598d3[_0x4af8('0x62')],'updatedAt':_0xf598d3[_0x4af8('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4af8('0x2c')](respondWithFilteredResult(_0x16a58d,_0x1ff739))['catch'](handleError(_0x16a58d,null));};exports[_0x4af8('0x65')]=function(_0x5f03f4,_0x1384ef,_0x657984){var _0x16c54c={};var _0xa10800={};var _0x1c0778;var _0x5ad0d3;return db[_0x4af8('0x35')][_0x4af8('0x66')]({'where':{'id':_0x5f03f4[_0x4af8('0x4b')]['id']}})[_0x4af8('0x2c')](handleEntityNotFound(_0x1384ef,null))[_0x4af8('0x2c')](function(_0x42a163){if(_0x42a163){_0x1c0778=_0x42a163;_0xa10800[_0x4af8('0x39')]=_[_0x4af8('0x3b')](db['Team'][_0x4af8('0x4c')]);_0xa10800['query']=_[_0x4af8('0x3b')](_0x5f03f4[_0x4af8('0x3a')]);_0xa10800[_0x4af8('0x43')]=_[_0x4af8('0x3c')](_0xa10800['model'],_0xa10800['query']);_0x16c54c[_0x4af8('0x3d')]=_[_0x4af8('0x3c')](_0xa10800[_0x4af8('0x39')],qs[_0x4af8('0x4d')](_0x5f03f4[_0x4af8('0x3a')][_0x4af8('0x4d')]));_0x16c54c[_0x4af8('0x3d')]=_0x16c54c['attributes'][_0x4af8('0x3e')]?_0x16c54c[_0x4af8('0x3d')]:_0xa10800[_0x4af8('0x39')];_0x16c54c[_0x4af8('0x40')]=qs[_0x4af8('0x41')](_0x5f03f4[_0x4af8('0x3a')][_0x4af8('0x41')]);_0x16c54c[_0x4af8('0x42')]=qs['filters'](_[_0x4af8('0x5b')](_0x5f03f4[_0x4af8('0x3a')],_0xa10800[_0x4af8('0x43')]));if(_0x5f03f4[_0x4af8('0x3a')]['filter']){_0x16c54c['where']=_[_0x4af8('0x45')](_0x16c54c[_0x4af8('0x42')],{'$or':_[_0x4af8('0x34')](_0x16c54c[_0x4af8('0x3d')],function(_0x19b013){var _0x3c91c0={};_0x3c91c0[_0x19b013]={'$like':'%'+_0x5f03f4[_0x4af8('0x3a')][_0x4af8('0x44')]+'%'};return _0x3c91c0;})});}_0x16c54c=_[_0x4af8('0x45')]({},_0x16c54c,_0x5f03f4['options']);return _0x1c0778[_0x4af8('0x65')](_0x16c54c);}})['then'](function(_0x3d12bd){if(_0x3d12bd){_0x5ad0d3=_0x3d12bd[_0x4af8('0x3e')];if(!_0x5f03f4[_0x4af8('0x3a')][_0x4af8('0x67')](_0x4af8('0x3f'))){_0x16c54c[_0x4af8('0x25')]=qs[_0x4af8('0x25')](_0x5f03f4[_0x4af8('0x3a')]['limit']);_0x16c54c[_0x4af8('0x23')]=qs[_0x4af8('0x23')](_0x5f03f4[_0x4af8('0x3a')][_0x4af8('0x23')]);}return _0x1c0778['getTeams'](_0x16c54c);}})[_0x4af8('0x2c')](function(_0x3d02c0){if(_0x3d02c0){return _0x3d02c0?{'count':_0x5ad0d3,'rows':_0x3d02c0}:null;}})[_0x4af8('0x2c')](respondWithResult(_0x1384ef,null))[_0x4af8('0x4f')](handleError(_0x1384ef,null));};exports['addTeams']=function(_0x1ddf79,_0x1bcaa2,_0x138d8d){var _0x2a9b5c=_0x1ddf79[_0x4af8('0x51')]['ids'];return db['Team'][_0x4af8('0x49')]({'where':{'id':_0x2a9b5c},'attributes':['id'],'include':[{'model':db[_0x4af8('0x5d')],'as':'Agents','attributes':['id',_0x4af8('0x32'),_0x4af8('0x68'),_0x4af8('0x69'),'interface'],'raw':!![]}]})[_0x4af8('0x2c')](function(_0x3c1f5e){if(_0x3c1f5e){var _0x5a8ea9=_['flatMap'](_0x3c1f5e,function(_0x38a1d1){var _0x11a75e=_0x38a1d1[_0x4af8('0x2d')]({'plain':!![]});return _0x11a75e[_0x4af8('0x6a')];});return db[_0x4af8('0x35')][_0x4af8('0x4e')]({'where':{'id':_0x1ddf79[_0x4af8('0x4b')]['id']}})[_0x4af8('0x2c')](function(_0x38b905){return db[_0x4af8('0x6b')][_0x4af8('0x6c')](function(_0x439682){return _0x38b905[_0x4af8('0x6d')](_0x2a9b5c,{'transaction':_0x439682})[_0x4af8('0x2c')](function(){return BPromise[_0x4af8('0x6e')](_0x5a8ea9,function(_0x574504){return db[_0x4af8('0x5a')]['findOrCreate']({'where':{'UserId':_0x574504['id'],'MailQueueId':_0x1ddf79['params']['id']},'transaction':_0x439682});});})['then'](function(){_0x5a8ea9['forEach'](function(_0x1baddd){socket[_0x4af8('0x6f')](_0x4af8('0x70'),{'UserId':_0x1baddd['id'],'MailQueueId':_0x38b905['id']});});});});});}})['then'](respondWithStatusCode(_0x1bcaa2,null))[_0x4af8('0x4f')](handleError(_0x1bcaa2,null));};exports['removeTeams']=function(_0x144ec2,_0x5134d5,_0x446a0a){return db[_0x4af8('0x71')][_0x4af8('0x49')]({'where':{'id':_0x144ec2[_0x4af8('0x3a')][_0x4af8('0x72')]},'attributes':['id'],'include':[{'model':db[_0x4af8('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4af8('0x2c')](handleEntityNotFound(_0x5134d5,null))[_0x4af8('0x2c')](function(_0x1f31eb){var _0x269761=_[_0x4af8('0x34')](_0x1f31eb,'id');var _0x522e79=[];var _0x3408eb=[];var _0x51ef70=squel['select']();_0x51ef70[_0x4af8('0x73')]('tq.TeamId')[_0x4af8('0x74')](_0x4af8('0x75'),'tq')[_0x4af8('0x76')](_0x4af8('0x77'),'ut',_0x4af8('0x78'))[_0x4af8('0x42')](_0x4af8('0x79'),_0x144ec2['params']['id']);for(var _0x5622a2=0x0;_0x5622a2<_0x1f31eb[_0x4af8('0x3e')];_0x5622a2+=0x1){let _0x6b4ce1=_0x1f31eb[_0x5622a2];for(var _0x322114=0x0;_0x322114<_0x6b4ce1['Agents']['length'];_0x322114+=0x1){let _0x19338b=_0x6b4ce1[_0x4af8('0x6a')][_0x322114];var _0x8e1d24=_0x51ef70['clone']();_0x8e1d24[_0x4af8('0x42')](_0x4af8('0x7a'),_0x19338b['id']);_0x3408eb[_0x4af8('0x7b')](db[_0x4af8('0x6b')][_0x4af8('0x3a')](_0x8e1d24[_0x4af8('0x7c')](),{'type':db[_0x4af8('0x6b')][_0x4af8('0x7d')]['SELECT']})[_0x4af8('0x2c')](function(_0x25c3fc){if(_0x25c3fc[_0x4af8('0x3e')]===0x1){return _0x19338b['id'];}else{var _0xdee9=_['every'](_[_0x4af8('0x34')](_0x25c3fc,_0x4af8('0x7e')),function(_0x1c87ed){return _[_0x4af8('0x7f')](_0x269761,_0x1c87ed);});if(_0xdee9){return _0x19338b['id'];}}}));}}return BPromise[_0x4af8('0x80')](_0x3408eb)['then'](function(_0x11f0d8){_0x522e79=_(_0x522e79)[_0x4af8('0x81')](_0x11f0d8)[_0x4af8('0x82')]()['value']();return db[_0x4af8('0x35')][_0x4af8('0x4e')]({'where':{'id':_0x144ec2[_0x4af8('0x4b')]['id']}})[_0x4af8('0x2c')](function(_0x2c5052){return db[_0x4af8('0x6b')][_0x4af8('0x6c')](function(_0x4a5b5b){return _0x2c5052[_0x4af8('0x83')](_0x144ec2['query'][_0x4af8('0x72')],{'transaction':_0x4a5b5b})[_0x4af8('0x2c')](function(){if(!_[_0x4af8('0x84')](_0x522e79)){return _0x2c5052[_0x4af8('0x85')](_0x522e79,{'transaction':_0x4a5b5b});}})[_0x4af8('0x2c')](function(){_0x522e79['forEach'](function(_0x46ace9){socket[_0x4af8('0x6f')]('userMailQueue:remove',{'UserId':_0x46ace9,'MailQueueId':_0x2c5052['id']});});});});});});})[_0x4af8('0x2c')](respondWithStatusCode(_0x5134d5,null))['catch'](handleError(_0x5134d5,null));};exports[_0x4af8('0x86')]=function(_0x5cfa6e,_0x473e42,_0x3a063a){return db['MailQueue'][_0x4af8('0x4e')]({'where':{'id':_0x5cfa6e['params']['id']}})['then'](handleEntityNotFound(_0x473e42,null))['then'](function(_0x21b41a){if(_0x21b41a){return _0x21b41a['addAgents'](_0x5cfa6e[_0x4af8('0x51')][_0x4af8('0x72')],_[_0x4af8('0x87')](_0x5cfa6e[_0x4af8('0x51')],[_0x4af8('0x72'),'id'])||{})[_0x4af8('0x88')](function(_0xa0af2c){for(var _0x1cd531=0x0;_0x1cd531<_0x5cfa6e['body'][_0x4af8('0x72')][_0x4af8('0x3e')];_0x1cd531+=0x1){socket[_0x4af8('0x6f')](_0x4af8('0x70'),{'UserId':_0x5cfa6e[_0x4af8('0x51')][_0x4af8('0x72')][_0x1cd531],'MailQueueId':_0x5cfa6e[_0x4af8('0x4b')]['id']});}return _0xa0af2c;});}})[_0x4af8('0x2c')](respondWithResult(_0x473e42,null))[_0x4af8('0x4f')](handleError(_0x473e42,null));};exports[_0x4af8('0x85')]=function(_0x5dc8e5,_0x4932e7,_0x31789c){return db[_0x4af8('0x35')]['find']({'where':{'id':_0x5dc8e5['params']['id']}})[_0x4af8('0x2c')](handleEntityNotFound(_0x4932e7,null))['then'](function(_0x5343f2){if(_0x5343f2){return _0x5343f2[_0x4af8('0x85')](_0x5dc8e5[_0x4af8('0x3a')][_0x4af8('0x72')])[_0x4af8('0x2c')](function(){if(_[_0x4af8('0x89')](_0x5dc8e5[_0x4af8('0x3a')][_0x4af8('0x72')])){for(var _0x1e2fab=0x0;_0x1e2fab<_0x5dc8e5[_0x4af8('0x3a')][_0x4af8('0x72')][_0x4af8('0x3e')];_0x1e2fab+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x5dc8e5['query'][_0x4af8('0x72')][_0x1e2fab]),'MailQueueId':Number(_0x5dc8e5[_0x4af8('0x4b')]['id'])});}}else{socket[_0x4af8('0x6f')](_0x4af8('0x8a'),{'UserId':Number(_0x5dc8e5[_0x4af8('0x3a')][_0x4af8('0x72')]),'MailQueueId':Number(_0x5dc8e5[_0x4af8('0x4b')]['id'])});}});}})[_0x4af8('0x2c')](respondWithStatusCode(_0x4932e7,null))[_0x4af8('0x4f')](handleError(_0x4932e7,null));};exports[_0x4af8('0x8b')]=function(_0x25c26c,_0x5494d8,_0x35c5a2){var _0x5a5391={};var _0x575e9a={};var _0x1b3521;var _0x4269ea;return db[_0x4af8('0x35')]['findOne']({'where':{'id':_0x25c26c[_0x4af8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5494d8,null))[_0x4af8('0x2c')](function(_0xccd4fb){if(_0xccd4fb){_0x1b3521=_0xccd4fb;_0x575e9a[_0x4af8('0x39')]=_['keys'](db[_0x4af8('0x5d')][_0x4af8('0x4c')]);_0x575e9a[_0x4af8('0x3a')]=_[_0x4af8('0x3b')](_0x25c26c[_0x4af8('0x3a')]);_0x575e9a[_0x4af8('0x43')]=_[_0x4af8('0x3c')](_0x575e9a[_0x4af8('0x39')],_0x575e9a[_0x4af8('0x3a')]);_0x5a5391[_0x4af8('0x3d')]=_[_0x4af8('0x3c')](_0x575e9a['model'],qs['fields'](_0x25c26c[_0x4af8('0x3a')][_0x4af8('0x4d')]));_0x5a5391['attributes']=_0x5a5391['attributes'][_0x4af8('0x3e')]?_0x5a5391[_0x4af8('0x3d')]:_0x575e9a['model'];_0x5a5391['order']=qs[_0x4af8('0x41')](_0x25c26c['query'][_0x4af8('0x41')]);_0x5a5391[_0x4af8('0x42')]=qs[_0x4af8('0x43')](_[_0x4af8('0x5b')](_0x25c26c['query'],_0x575e9a['filters']));if(_0x25c26c[_0x4af8('0x3a')][_0x4af8('0x44')]){_0x5a5391[_0x4af8('0x42')]=_[_0x4af8('0x45')](_0x5a5391[_0x4af8('0x42')],{'$or':_[_0x4af8('0x34')](_0x5a5391['attributes'],function(_0x2042dc){var _0x1a66bb={};_0x1a66bb[_0x2042dc]={'$like':'%'+_0x25c26c['query'][_0x4af8('0x44')]+'%'};return _0x1a66bb;})});}_0x5a5391=_['merge']({},_0x5a5391,_0x25c26c[_0x4af8('0x46')]);return _0x1b3521['getAgents'](_0x5a5391);}})[_0x4af8('0x2c')](function(_0x48908c){if(_0x48908c){_0x4269ea=_0x48908c[_0x4af8('0x3e')];if(!_0x25c26c[_0x4af8('0x3a')][_0x4af8('0x67')](_0x4af8('0x3f'))){_0x5a5391[_0x4af8('0x25')]=qs['limit'](_0x25c26c[_0x4af8('0x3a')][_0x4af8('0x25')]);_0x5a5391[_0x4af8('0x23')]=qs[_0x4af8('0x23')](_0x25c26c[_0x4af8('0x3a')][_0x4af8('0x23')]);}return _0x1b3521[_0x4af8('0x8b')](_0x5a5391);}})[_0x4af8('0x2c')](function(_0x3b5039){if(_0x3b5039){return _0x3b5039?{'count':_0x4269ea,'rows':_0x3b5039}:null;}})[_0x4af8('0x2c')](respondWithResult(_0x5494d8,null))['catch'](handleError(_0x5494d8,null));}; \ No newline at end of file +var _0xc289=['options','where','include','findAll','catch','show','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserMailQueue','order','MailQueueId','findAndCountAll','updatedAt','rows','format','%s/%s','SIP','mailPause','getTeams','Team','addTeams','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','ids','select','field','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','isArray','getAgents','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','MailQueues','UserProfileResource','error','stack','name','index','map','MailQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','merge'];(function(_0x1c0fff,_0x1f1254){var _0x48063d=function(_0x248e5c){while(--_0x248e5c){_0x1c0fff['push'](_0x1c0fff['shift']());}};_0x48063d(++_0x1f1254);}(_0xc289,0xce));var _0x9c28=function(_0x13c191,_0x3b32db){_0x13c191=_0x13c191-0x0;var _0x3f5555=_0xc289[_0x13c191];return _0x3f5555;};'use strict';var emlformat=require(_0x9c28('0x0'));var rimraf=require(_0x9c28('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c28('0x2'));var rp=require(_0x9c28('0x3'));var moment=require(_0x9c28('0x4'));var BPromise=require(_0x9c28('0x5'));var Mustache=require(_0x9c28('0x6'));var util=require(_0x9c28('0x7'));var path=require(_0x9c28('0x8'));var sox=require('sox');var csv=require(_0x9c28('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c28('0xa'));var _=require(_0x9c28('0xb'));var squel=require(_0x9c28('0xc'));var crypto=require('crypto');var jsforce=require(_0x9c28('0xd'));var deskjs=require(_0x9c28('0xe'));var toCsv=require(_0x9c28('0x9'));var querystring=require(_0x9c28('0xf'));var Papa=require(_0x9c28('0x10'));var Redis=require(_0x9c28('0x11'));var authService=require(_0x9c28('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c28('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9c28('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9c28('0x15'))['db'];config[_0x9c28('0x16')]=_[_0x9c28('0x17')](config[_0x9c28('0x16')],{'host':_0x9c28('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9c28('0x19'))[_0x9c28('0x1a')](socket);function respondWithStatusCode(_0x108f8b,_0x2e8b0a){_0x2e8b0a=_0x2e8b0a||0xcc;return function(_0xb23f4f){if(_0xb23f4f){return _0x108f8b[_0x9c28('0x1b')](_0x2e8b0a);}return _0x108f8b[_0x9c28('0x1c')](_0x2e8b0a)[_0x9c28('0x1d')]();};}function respondWithResult(_0x38b473,_0x43afc5){_0x43afc5=_0x43afc5||0xc8;return function(_0x5cfbb8){if(_0x5cfbb8){return _0x38b473[_0x9c28('0x1c')](_0x43afc5)[_0x9c28('0x1e')](_0x5cfbb8);}};}function respondWithFilteredResult(_0x8e2acd,_0x418206){return function(_0x593c87){if(_0x593c87){var _0x2b519c=typeof _0x418206[_0x9c28('0x1f')]===_0x9c28('0x20')&&typeof _0x418206['limit']===_0x9c28('0x20');var _0x3c88ad=_0x593c87[_0x9c28('0x21')];var _0x2dc312=_0x2b519c?0x0:_0x418206[_0x9c28('0x1f')];var _0x27ad2c=_0x2b519c?_0x593c87[_0x9c28('0x21')]:_0x418206[_0x9c28('0x1f')]+_0x418206[_0x9c28('0x22')];var _0x4c4763;if(_0x27ad2c>=_0x3c88ad){_0x27ad2c=_0x3c88ad;_0x4c4763=0xc8;}else{_0x4c4763=0xce;}_0x8e2acd[_0x9c28('0x1c')](_0x4c4763);return _0x8e2acd[_0x9c28('0x23')](_0x9c28('0x24'),_0x2dc312+'-'+_0x27ad2c+'/'+_0x3c88ad)[_0x9c28('0x1e')](_0x593c87);}return null;};}function patchUpdates(_0x4ae4e9){return function(_0x1fc3bd){try{jsonpatch[_0x9c28('0x25')](_0x1fc3bd,_0x4ae4e9,!![]);}catch(_0x2208d5){return BPromise[_0x9c28('0x26')](_0x2208d5);}return _0x1fc3bd[_0x9c28('0x27')]();};}function saveUpdates(_0x10aabc,_0x256611){return function(_0x210edb){if(_0x210edb){return _0x210edb[_0x9c28('0x28')](_0x10aabc)[_0x9c28('0x29')](function(_0x35bb09){return _0x35bb09;});}return null;};}function removeEntity(_0x142c18,_0x4089dd){return function(_0x5e8e36){if(_0x5e8e36){return _0x5e8e36['destroy']()[_0x9c28('0x29')](function(){var _0x3d137c=_0x5e8e36['get']({'plain':!![]});var _0x1457e5=_0x9c28('0x2a');return db[_0x9c28('0x2b')]['destroy']({'where':{'type':_0x1457e5,'resourceId':_0x3d137c['id']}})['then'](function(){return _0x5e8e36;});})[_0x9c28('0x29')](function(){_0x142c18[_0x9c28('0x1c')](0xcc)[_0x9c28('0x1d')]();});}};}function handleEntityNotFound(_0x1bff77,_0x1d5c30){return function(_0x2c17c7){if(!_0x2c17c7){_0x1bff77['sendStatus'](0x194);}return _0x2c17c7;};}function handleError(_0x2cff5f,_0x612cc9){_0x612cc9=_0x612cc9||0x1f4;return function(_0x4727e4){logger[_0x9c28('0x2c')](_0x4727e4[_0x9c28('0x2d')]);if(_0x4727e4[_0x9c28('0x2e')]){delete _0x4727e4[_0x9c28('0x2e')];}_0x2cff5f[_0x9c28('0x1c')](_0x612cc9)['send'](_0x4727e4);};}exports[_0x9c28('0x2f')]=function(_0x33884f,_0x22f2ef){var _0x61c6b9={},_0x26c2f2={},_0x238074={'count':0x0,'rows':[]};var _0x34ffa3=_[_0x9c28('0x30')](db[_0x9c28('0x31')][_0x9c28('0x32')],function(_0x4900d0){return{'name':_0x4900d0[_0x9c28('0x33')],'type':_0x4900d0[_0x9c28('0x34')]['key']};});_0x26c2f2[_0x9c28('0x35')]=_[_0x9c28('0x30')](_0x34ffa3,_0x9c28('0x2e'));_0x26c2f2[_0x9c28('0x36')]=_[_0x9c28('0x37')](_0x33884f[_0x9c28('0x36')]);_0x26c2f2[_0x9c28('0x38')]=_['intersection'](_0x26c2f2['model'],_0x26c2f2[_0x9c28('0x36')]);_0x61c6b9['attributes']=_[_0x9c28('0x39')](_0x26c2f2['model'],qs[_0x9c28('0x3a')](_0x33884f[_0x9c28('0x36')][_0x9c28('0x3a')]));_0x61c6b9[_0x9c28('0x3b')]=_0x61c6b9['attributes'][_0x9c28('0x3c')]?_0x61c6b9['attributes']:_0x26c2f2[_0x9c28('0x35')];if(!_0x33884f[_0x9c28('0x36')]['hasOwnProperty'](_0x9c28('0x3d'))){_0x61c6b9[_0x9c28('0x22')]=qs[_0x9c28('0x22')](_0x33884f[_0x9c28('0x36')][_0x9c28('0x22')]);_0x61c6b9[_0x9c28('0x1f')]=qs[_0x9c28('0x1f')](_0x33884f[_0x9c28('0x36')][_0x9c28('0x1f')]);}_0x61c6b9['order']=qs[_0x9c28('0x3e')](_0x33884f[_0x9c28('0x36')]['sort']);_0x61c6b9['where']=qs[_0x9c28('0x38')](_[_0x9c28('0x3f')](_0x33884f['query'],_0x26c2f2['filters']),_0x34ffa3);if(_0x33884f[_0x9c28('0x36')][_0x9c28('0x40')]){_0x61c6b9['where']=_[_0x9c28('0x41')](_0x61c6b9['where'],{'$or':_[_0x9c28('0x30')](_0x34ffa3,function(_0x582c2c){if(_0x582c2c[_0x9c28('0x34')]!=='VIRTUAL'){var _0x17e3f3={};_0x17e3f3[_0x582c2c['name']]={'$like':'%'+_0x33884f['query'][_0x9c28('0x40')]+'%'};return _0x17e3f3;}})});}_0x61c6b9=_['merge']({},_0x61c6b9,_0x33884f[_0x9c28('0x42')]);var _0x33defd={'where':_0x61c6b9[_0x9c28('0x43')]};return db[_0x9c28('0x31')][_0x9c28('0x21')](_0x33defd)[_0x9c28('0x29')](function(_0x9a72bd){_0x238074['count']=_0x9a72bd;if(_0x33884f[_0x9c28('0x36')]['includeAll']){_0x61c6b9[_0x9c28('0x44')]=[{'all':!![]}];}return db[_0x9c28('0x31')][_0x9c28('0x45')](_0x61c6b9);})[_0x9c28('0x29')](function(_0x424357){_0x238074['rows']=_0x424357;return _0x238074;})[_0x9c28('0x29')](respondWithFilteredResult(_0x22f2ef,_0x61c6b9))[_0x9c28('0x46')](handleError(_0x22f2ef,null));};exports[_0x9c28('0x47')]=function(_0x5e3571,_0x462af3){var _0x1e03ec={'raw':!![],'where':{'id':_0x5e3571['params']['id']}},_0x404f2a={};_0x404f2a['model']=_[_0x9c28('0x37')](db[_0x9c28('0x31')][_0x9c28('0x32')]);_0x404f2a[_0x9c28('0x36')]=_[_0x9c28('0x37')](_0x5e3571[_0x9c28('0x36')]);_0x404f2a[_0x9c28('0x38')]=_['intersection'](_0x404f2a['model'],_0x404f2a['query']);_0x1e03ec['attributes']=_[_0x9c28('0x39')](_0x404f2a[_0x9c28('0x35')],qs[_0x9c28('0x3a')](_0x5e3571[_0x9c28('0x36')][_0x9c28('0x3a')]));_0x1e03ec[_0x9c28('0x3b')]=_0x1e03ec[_0x9c28('0x3b')][_0x9c28('0x3c')]?_0x1e03ec[_0x9c28('0x3b')]:_0x404f2a[_0x9c28('0x35')];if(_0x5e3571[_0x9c28('0x36')][_0x9c28('0x48')]){_0x1e03ec[_0x9c28('0x44')]=[{'all':!![]}];}_0x1e03ec=_[_0x9c28('0x41')]({},_0x1e03ec,_0x5e3571[_0x9c28('0x42')]);return db['MailQueue'][_0x9c28('0x49')](_0x1e03ec)['then'](handleEntityNotFound(_0x462af3,null))['then'](respondWithResult(_0x462af3,null))['catch'](handleError(_0x462af3,null));};exports['create']=function(_0x929ad,_0x391636){return db[_0x9c28('0x31')][_0x9c28('0x4a')](_0x929ad[_0x9c28('0x4b')],{})[_0x9c28('0x29')](function(_0x14158b){var _0x278126=_0x929ad['user'][_0x9c28('0x4c')]({'plain':!![]});if(!_0x278126)throw new Error(_0x9c28('0x4d'));if(_0x278126['role']===_0x9c28('0x4e')){var _0x51e2fa=_0x14158b['get']({'plain':!![]});var _0x580cdc=_0x9c28('0x2a');return db[_0x9c28('0x4f')][_0x9c28('0x49')]({'where':{'name':_0x580cdc,'userProfileId':_0x278126[_0x9c28('0x50')]},'raw':!![]})[_0x9c28('0x29')](function(_0x56f205){if(_0x56f205&&_0x56f205[_0x9c28('0x51')]===0x0){return db[_0x9c28('0x2b')][_0x9c28('0x4a')]({'name':_0x51e2fa['name'],'resourceId':_0x51e2fa['id'],'type':_0x56f205[_0x9c28('0x2e')],'sectionId':_0x56f205['id']},{})[_0x9c28('0x29')](function(){return _0x14158b;});}else{return _0x14158b;}})['catch'](function(_0x5ce56e){logger['error'](_0x9c28('0x52'),_0x5ce56e);throw _0x5ce56e;});}return _0x14158b;})['then'](respondWithResult(_0x391636,0xc9))[_0x9c28('0x46')](handleError(_0x391636,null));};exports[_0x9c28('0x28')]=function(_0x5255e2,_0x31ea05){if(_0x5255e2[_0x9c28('0x4b')]['id']){delete _0x5255e2[_0x9c28('0x4b')]['id'];}return db[_0x9c28('0x31')][_0x9c28('0x49')]({'where':{'id':_0x5255e2[_0x9c28('0x53')]['id']}})[_0x9c28('0x29')](handleEntityNotFound(_0x31ea05,null))[_0x9c28('0x29')](saveUpdates(_0x5255e2['body'],null))['then'](respondWithResult(_0x31ea05,null))[_0x9c28('0x46')](handleError(_0x31ea05,null));};exports['destroy']=function(_0x1ffd2f,_0x2e5669){return db[_0x9c28('0x31')][_0x9c28('0x49')]({'where':{'id':_0x1ffd2f['params']['id']}})[_0x9c28('0x29')](handleEntityNotFound(_0x2e5669,null))[_0x9c28('0x29')](removeEntity(_0x2e5669,null))[_0x9c28('0x46')](handleError(_0x2e5669,null));};exports['describe']=function(_0x110fd4,_0x762603){return db[_0x9c28('0x31')][_0x9c28('0x54')]()['then'](respondWithResult(_0x762603,null))[_0x9c28('0x46')](handleError(_0x762603,null));};exports['getMembers']=function(_0x337404,_0x30905f,_0x31be99){var _0x276a84={'raw':!![],'where':{}},_0x104ea5={},_0x1c9cfb;return db[_0x9c28('0x31')][_0x9c28('0x55')]({'where':{'id':_0x337404[_0x9c28('0x53')]['id']}})[_0x9c28('0x29')](handleEntityNotFound(_0x30905f,null))[_0x9c28('0x29')](function(_0xf4922c){if(_0xf4922c){_0x1c9cfb=_0xf4922c['get']({'plain':!![]});_0x104ea5['model']=_[_0x9c28('0x37')](db[_0x9c28('0x56')][_0x9c28('0x32')]);_0x104ea5['query']=_[_0x9c28('0x37')](_0x337404[_0x9c28('0x36')]);_0x104ea5[_0x9c28('0x38')]=_[_0x9c28('0x39')](_0x104ea5[_0x9c28('0x35')],_0x104ea5[_0x9c28('0x36')]);_0x276a84[_0x9c28('0x3b')]=_[_0x9c28('0x39')](_0x104ea5[_0x9c28('0x35')],qs[_0x9c28('0x3a')](_0x337404[_0x9c28('0x36')]['fields']));_0x276a84['attributes']=_0x276a84[_0x9c28('0x3b')]['length']?_0x276a84[_0x9c28('0x3b')]:_0x104ea5[_0x9c28('0x35')];if(!_0x337404['query']['hasOwnProperty']('nolimit')){_0x276a84['limit']=qs[_0x9c28('0x22')](_0x337404[_0x9c28('0x36')][_0x9c28('0x22')]);_0x276a84['offset']=qs[_0x9c28('0x1f')](_0x337404[_0x9c28('0x36')][_0x9c28('0x1f')]);}_0x276a84[_0x9c28('0x57')]=qs[_0x9c28('0x3e')](_0x337404[_0x9c28('0x36')][_0x9c28('0x3e')]);_0x276a84[_0x9c28('0x43')]=qs[_0x9c28('0x38')](_[_0x9c28('0x3f')](_0x337404[_0x9c28('0x36')],_0x104ea5['filters']));_0x276a84[_0x9c28('0x43')][_0x9c28('0x58')]=_0xf4922c['id'];if(_0x337404[_0x9c28('0x36')][_0x9c28('0x40')]){_0x276a84[_0x9c28('0x43')]=_[_0x9c28('0x41')](_0x276a84[_0x9c28('0x43')],{'$or':_[_0x9c28('0x30')](_0x276a84[_0x9c28('0x3b')],function(_0x22f16e){var _0x35f9c7={};_0x35f9c7[_0x22f16e]={'$like':'%'+_0x337404['query']['filter']+'%'};return _0x35f9c7;})});}_0x276a84=_[_0x9c28('0x41')]({},_0x276a84,_0x337404[_0x9c28('0x42')]);return db[_0x9c28('0x56')][_0x9c28('0x45')](_0x276a84);}})[_0x9c28('0x29')](function(_0x538abe){if(_0x538abe){return db['User'][_0x9c28('0x59')]({'where':{'id':_[_0x9c28('0x30')](_0x538abe,'UserId'),'role':'agent'},'attributes':['id',_0x9c28('0x2e'),'mailPause',_0x9c28('0x5a'),'createdAt']});}})['then'](function(_0x5f3cc5){if(_0x5f3cc5){return{'count':_0x5f3cc5[_0x9c28('0x21')],'rows':_[_0x9c28('0x30')](_0x5f3cc5[_0x9c28('0x5b')],function(_0x33ed44){return{'membername':_0x33ed44[_0x9c28('0x2e')],'UserId':_0x33ed44['id'],'queue_name':_0x1c9cfb[_0x9c28('0x2e')],'MailQueueId':_0x1c9cfb['id'],'interface':util[_0x9c28('0x5c')](_0x9c28('0x5d'),_0x9c28('0x5e'),_0x33ed44[_0x9c28('0x2e')]),'penalty':0x0,'paused':_0x33ed44[_0x9c28('0x5f')],'createdAt':_0x33ed44['createdAt'],'updatedAt':_0x33ed44[_0x9c28('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9c28('0x29')](respondWithFilteredResult(_0x30905f,_0x276a84))['catch'](handleError(_0x30905f,null));};exports[_0x9c28('0x60')]=function(_0x5bc263,_0x277637,_0x5c5634){var _0x1c75ea={};var _0x51e505={};var _0x51f0e0;var _0x3cc99c;return db['MailQueue'][_0x9c28('0x55')]({'where':{'id':_0x5bc263['params']['id']}})[_0x9c28('0x29')](handleEntityNotFound(_0x277637,null))[_0x9c28('0x29')](function(_0x539a88){if(_0x539a88){_0x51f0e0=_0x539a88;_0x51e505[_0x9c28('0x35')]=_[_0x9c28('0x37')](db[_0x9c28('0x61')][_0x9c28('0x32')]);_0x51e505['query']=_[_0x9c28('0x37')](_0x5bc263[_0x9c28('0x36')]);_0x51e505['filters']=_[_0x9c28('0x39')](_0x51e505[_0x9c28('0x35')],_0x51e505['query']);_0x1c75ea[_0x9c28('0x3b')]=_['intersection'](_0x51e505[_0x9c28('0x35')],qs['fields'](_0x5bc263['query'][_0x9c28('0x3a')]));_0x1c75ea['attributes']=_0x1c75ea[_0x9c28('0x3b')][_0x9c28('0x3c')]?_0x1c75ea[_0x9c28('0x3b')]:_0x51e505[_0x9c28('0x35')];_0x1c75ea[_0x9c28('0x57')]=qs[_0x9c28('0x3e')](_0x5bc263[_0x9c28('0x36')][_0x9c28('0x3e')]);_0x1c75ea[_0x9c28('0x43')]=qs['filters'](_[_0x9c28('0x3f')](_0x5bc263[_0x9c28('0x36')],_0x51e505[_0x9c28('0x38')]));if(_0x5bc263[_0x9c28('0x36')][_0x9c28('0x40')]){_0x1c75ea[_0x9c28('0x43')]=_[_0x9c28('0x41')](_0x1c75ea[_0x9c28('0x43')],{'$or':_[_0x9c28('0x30')](_0x1c75ea['attributes'],function(_0x5a3945){var _0x3ef82a={};_0x3ef82a[_0x5a3945]={'$like':'%'+_0x5bc263['query'][_0x9c28('0x40')]+'%'};return _0x3ef82a;})});}_0x1c75ea=_[_0x9c28('0x41')]({},_0x1c75ea,_0x5bc263[_0x9c28('0x42')]);return _0x51f0e0['getTeams'](_0x1c75ea);}})[_0x9c28('0x29')](function(_0x692736){if(_0x692736){_0x3cc99c=_0x692736[_0x9c28('0x3c')];if(!_0x5bc263['query']['hasOwnProperty'](_0x9c28('0x3d'))){_0x1c75ea[_0x9c28('0x22')]=qs[_0x9c28('0x22')](_0x5bc263[_0x9c28('0x36')][_0x9c28('0x22')]);_0x1c75ea[_0x9c28('0x1f')]=qs[_0x9c28('0x1f')](_0x5bc263[_0x9c28('0x36')][_0x9c28('0x1f')]);}return _0x51f0e0[_0x9c28('0x60')](_0x1c75ea);}})[_0x9c28('0x29')](function(_0xc844e2){if(_0xc844e2){return _0xc844e2?{'count':_0x3cc99c,'rows':_0xc844e2}:null;}})[_0x9c28('0x29')](respondWithResult(_0x277637,null))[_0x9c28('0x46')](handleError(_0x277637,null));};exports[_0x9c28('0x62')]=function(_0x2689d9,_0x2d1478,_0xcdb30d){var _0x3088a8=_0x2689d9[_0x9c28('0x4b')]['ids'];return db[_0x9c28('0x61')]['findAll']({'where':{'id':_0x3088a8},'attributes':['id'],'include':[{'model':db[_0x9c28('0x63')],'as':_0x9c28('0x64'),'attributes':['id','name',_0x9c28('0x65'),'voicePause',_0x9c28('0x66')],'raw':!![]}]})[_0x9c28('0x29')](function(_0x5d14ee){if(_0x5d14ee){var _0x2fd6ee=_[_0x9c28('0x67')](_0x5d14ee,function(_0x3016da){var _0x5e9f76=_0x3016da[_0x9c28('0x4c')]({'plain':!![]});return _0x5e9f76[_0x9c28('0x64')];});return db[_0x9c28('0x31')][_0x9c28('0x49')]({'where':{'id':_0x2689d9['params']['id']}})[_0x9c28('0x29')](function(_0x304848){return db[_0x9c28('0x68')][_0x9c28('0x69')](function(_0x3c2e87){return _0x304848['addTeams'](_0x3088a8,{'transaction':_0x3c2e87})[_0x9c28('0x29')](function(){return BPromise[_0x9c28('0x6a')](_0x2fd6ee,function(_0x5259de){return db[_0x9c28('0x56')][_0x9c28('0x6b')]({'where':{'UserId':_0x5259de['id'],'MailQueueId':_0x2689d9[_0x9c28('0x53')]['id']},'transaction':_0x3c2e87});});})['then'](function(){_0x2fd6ee[_0x9c28('0x6c')](function(_0x357b67){socket[_0x9c28('0x6d')](_0x9c28('0x6e'),{'UserId':_0x357b67['id'],'MailQueueId':_0x304848['id']});});});});});}})[_0x9c28('0x29')](respondWithStatusCode(_0x2d1478,null))[_0x9c28('0x46')](handleError(_0x2d1478,null));};exports['removeTeams']=function(_0x5d73f4,_0x48e56e,_0x379549){return db[_0x9c28('0x61')]['findAll']({'where':{'id':_0x5d73f4[_0x9c28('0x36')][_0x9c28('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x9c28('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9c28('0x29')](handleEntityNotFound(_0x48e56e,null))['then'](function(_0x397c12){var _0x2a9128=_['map'](_0x397c12,'id');var _0x1a68d6=[];var _0x3e2edb=[];var _0x4568fa=squel[_0x9c28('0x70')]();_0x4568fa[_0x9c28('0x71')]('tq.TeamId')[_0x9c28('0x72')](_0x9c28('0x73'),'tq')[_0x9c28('0x74')]('user_has_teams','ut',_0x9c28('0x75'))[_0x9c28('0x43')](_0x9c28('0x76'),_0x5d73f4[_0x9c28('0x53')]['id']);for(var _0x33c5c2=0x0;_0x33c5c2<_0x397c12[_0x9c28('0x3c')];_0x33c5c2+=0x1){let _0x3beb3c=_0x397c12[_0x33c5c2];for(var _0x34f42c=0x0;_0x34f42c<_0x3beb3c['Agents'][_0x9c28('0x3c')];_0x34f42c+=0x1){let _0x382dad=_0x3beb3c[_0x9c28('0x64')][_0x34f42c];var _0x4e3302=_0x4568fa['clone']();_0x4e3302[_0x9c28('0x43')](_0x9c28('0x77'),_0x382dad['id']);_0x3e2edb[_0x9c28('0x78')](db[_0x9c28('0x68')]['query'](_0x4e3302[_0x9c28('0x79')](),{'type':db[_0x9c28('0x68')][_0x9c28('0x7a')][_0x9c28('0x7b')]})[_0x9c28('0x29')](function(_0x4855ad){if(_0x4855ad[_0x9c28('0x3c')]===0x1){return _0x382dad['id'];}else{var _0x15cd03=_[_0x9c28('0x7c')](_['map'](_0x4855ad,'TeamId'),function(_0x27e821){return _['includes'](_0x2a9128,_0x27e821);});if(_0x15cd03){return _0x382dad['id'];}}}));}}return BPromise[_0x9c28('0x7d')](_0x3e2edb)[_0x9c28('0x29')](function(_0x331c6c){_0x1a68d6=_(_0x1a68d6)[_0x9c28('0x7e')](_0x331c6c)['compact']()['value']();return db['MailQueue']['find']({'where':{'id':_0x5d73f4[_0x9c28('0x53')]['id']}})[_0x9c28('0x29')](function(_0x39c490){return db[_0x9c28('0x68')]['transaction'](function(_0x2ef233){return _0x39c490[_0x9c28('0x7f')](_0x5d73f4['query']['ids'],{'transaction':_0x2ef233})[_0x9c28('0x29')](function(){if(!_[_0x9c28('0x80')](_0x1a68d6)){return _0x39c490[_0x9c28('0x81')](_0x1a68d6,{'transaction':_0x2ef233});}})[_0x9c28('0x29')](function(){_0x1a68d6[_0x9c28('0x6c')](function(_0x5071f9){socket[_0x9c28('0x6d')](_0x9c28('0x82'),{'UserId':_0x5071f9,'MailQueueId':_0x39c490['id']});});});});});});})[_0x9c28('0x29')](respondWithStatusCode(_0x48e56e,null))['catch'](handleError(_0x48e56e,null));};exports[_0x9c28('0x83')]=function(_0x494faf,_0x38d09a,_0x448fd0){return db[_0x9c28('0x31')][_0x9c28('0x49')]({'where':{'id':_0x494faf[_0x9c28('0x53')]['id']}})['then'](handleEntityNotFound(_0x38d09a,null))[_0x9c28('0x29')](function(_0x57716e){if(_0x57716e){return _0x57716e[_0x9c28('0x83')](_0x494faf['body']['ids'],_[_0x9c28('0x84')](_0x494faf[_0x9c28('0x4b')],[_0x9c28('0x6f'),'id'])||{})['spread'](function(_0xd4c9c9){for(var _0x2a1b51=0x0;_0x2a1b51<_0x494faf[_0x9c28('0x4b')][_0x9c28('0x6f')]['length'];_0x2a1b51+=0x1){socket[_0x9c28('0x6d')](_0x9c28('0x6e'),{'UserId':_0x494faf[_0x9c28('0x4b')][_0x9c28('0x6f')][_0x2a1b51],'MailQueueId':_0x494faf[_0x9c28('0x53')]['id']});}return _0xd4c9c9;});}})[_0x9c28('0x29')](respondWithResult(_0x38d09a,null))[_0x9c28('0x46')](handleError(_0x38d09a,null));};exports['removeAgents']=function(_0x2e1f66,_0x20c5fa,_0x4b92ca){return db[_0x9c28('0x31')][_0x9c28('0x49')]({'where':{'id':_0x2e1f66[_0x9c28('0x53')]['id']}})['then'](handleEntityNotFound(_0x20c5fa,null))[_0x9c28('0x29')](function(_0x1649c7){if(_0x1649c7){return _0x1649c7[_0x9c28('0x81')](_0x2e1f66[_0x9c28('0x36')]['ids'])[_0x9c28('0x29')](function(){if(_[_0x9c28('0x85')](_0x2e1f66['query'][_0x9c28('0x6f')])){for(var _0x250fde=0x0;_0x250fde<_0x2e1f66[_0x9c28('0x36')]['ids'][_0x9c28('0x3c')];_0x250fde+=0x1){socket[_0x9c28('0x6d')](_0x9c28('0x82'),{'UserId':Number(_0x2e1f66[_0x9c28('0x36')]['ids'][_0x250fde]),'MailQueueId':Number(_0x2e1f66[_0x9c28('0x53')]['id'])});}}else{socket[_0x9c28('0x6d')](_0x9c28('0x82'),{'UserId':Number(_0x2e1f66[_0x9c28('0x36')]['ids']),'MailQueueId':Number(_0x2e1f66[_0x9c28('0x53')]['id'])});}});}})[_0x9c28('0x29')](respondWithStatusCode(_0x20c5fa,null))['catch'](handleError(_0x20c5fa,null));};exports[_0x9c28('0x86')]=function(_0x3fb1e8,_0x33ee9d,_0x306987){var _0x492f89={};var _0x344057={};var _0x4593c2;var _0xf49477;return db['MailQueue'][_0x9c28('0x55')]({'where':{'id':_0x3fb1e8[_0x9c28('0x53')]['id']}})[_0x9c28('0x29')](handleEntityNotFound(_0x33ee9d,null))[_0x9c28('0x29')](function(_0x4c1a56){if(_0x4c1a56){_0x4593c2=_0x4c1a56;_0x344057['model']=_[_0x9c28('0x37')](db['User']['rawAttributes']);_0x344057[_0x9c28('0x36')]=_['keys'](_0x3fb1e8[_0x9c28('0x36')]);_0x344057[_0x9c28('0x38')]=_['intersection'](_0x344057[_0x9c28('0x35')],_0x344057[_0x9c28('0x36')]);_0x492f89[_0x9c28('0x3b')]=_[_0x9c28('0x39')](_0x344057[_0x9c28('0x35')],qs[_0x9c28('0x3a')](_0x3fb1e8['query'][_0x9c28('0x3a')]));_0x492f89[_0x9c28('0x3b')]=_0x492f89[_0x9c28('0x3b')][_0x9c28('0x3c')]?_0x492f89[_0x9c28('0x3b')]:_0x344057[_0x9c28('0x35')];_0x492f89[_0x9c28('0x57')]=qs[_0x9c28('0x3e')](_0x3fb1e8[_0x9c28('0x36')][_0x9c28('0x3e')]);_0x492f89[_0x9c28('0x43')]=qs[_0x9c28('0x38')](_[_0x9c28('0x3f')](_0x3fb1e8[_0x9c28('0x36')],_0x344057['filters']));if(_0x3fb1e8[_0x9c28('0x36')]['filter']){_0x492f89[_0x9c28('0x43')]=_[_0x9c28('0x41')](_0x492f89[_0x9c28('0x43')],{'$or':_[_0x9c28('0x30')](_0x492f89[_0x9c28('0x3b')],function(_0x1d152b){var _0x375bc2={};_0x375bc2[_0x1d152b]={'$like':'%'+_0x3fb1e8[_0x9c28('0x36')][_0x9c28('0x40')]+'%'};return _0x375bc2;})});}_0x492f89=_['merge']({},_0x492f89,_0x3fb1e8[_0x9c28('0x42')]);return _0x4593c2[_0x9c28('0x86')](_0x492f89);}})['then'](function(_0x25add6){if(_0x25add6){_0xf49477=_0x25add6[_0x9c28('0x3c')];if(!_0x3fb1e8[_0x9c28('0x36')][_0x9c28('0x87')]('nolimit')){_0x492f89[_0x9c28('0x22')]=qs['limit'](_0x3fb1e8[_0x9c28('0x36')][_0x9c28('0x22')]);_0x492f89[_0x9c28('0x1f')]=qs[_0x9c28('0x1f')](_0x3fb1e8['query'][_0x9c28('0x1f')]);}return _0x4593c2[_0x9c28('0x86')](_0x492f89);}})[_0x9c28('0x29')](function(_0x123b6a){if(_0x123b6a){return _0x123b6a?{'count':_0xf49477,'rows':_0x123b6a}:null;}})[_0x9c28('0x29')](respondWithResult(_0x33ee9d,null))[_0x9c28('0x46')](handleError(_0x33ee9d,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 2ad7d84..0dd8007 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 _0x4d52=['MailQueue','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0x4d52,0x1d7));var _0x24d5=function(_0x23aee1,_0x4280f9){_0x23aee1=_0x23aee1-0x0;var _0x18a9b1=_0x4d52[_0x23aee1];return _0x18a9b1;};'use strict';var EventEmitter=require(_0x24d5('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x24d5('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x24d5('0x2')](0x0);var events={'afterCreate':_0x24d5('0x3'),'afterUpdate':'update','afterDestroy':_0x24d5('0x4')};function emitEvent(_0x2333e8){return function(_0x4f23ee,_0x418101,_0xbf1b0e){MailQueueEvents[_0x24d5('0x5')](_0x2333e8+':'+_0x4f23ee['id'],_0x4f23ee);MailQueueEvents[_0x24d5('0x5')](_0x2333e8,_0x4f23ee);_0xbf1b0e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x24d5('0x6')](e,emitEvent(event));}}module[_0x24d5('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x7374=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x55a178,_0x2e135e){var _0x2fab3f=function(_0x1ad954){while(--_0x1ad954){_0x55a178['push'](_0x55a178['shift']());}};_0x2fab3f(++_0x2e135e);}(_0x7374,0x1de));var _0x4737=function(_0x31af27,_0x4b80be){_0x31af27=_0x31af27-0x0;var _0x3a9bf0=_0x7374[_0x31af27];return _0x3a9bf0;};'use strict';var EventEmitter=require(_0x4737('0x0'));var MailQueue=require(_0x4737('0x1'))['db'][_0x4737('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x4737('0x3')](0x0);var events={'afterCreate':_0x4737('0x4'),'afterUpdate':_0x4737('0x5'),'afterDestroy':_0x4737('0x6')};function emitEvent(_0x2c0584){return function(_0x58766a,_0x598f59,_0x15ee4c){MailQueueEvents[_0x4737('0x7')](_0x2c0584+':'+_0x58766a['id'],_0x58766a);MailQueueEvents[_0x4737('0x7')](_0x2c0584,_0x58766a);_0x15ee4c(null);};}for(var e in events){if(events[_0x4737('0x8')](e)){var event=events[e];MailQueue[_0x4737('0x9')](e,emitEvent(event));}}module[_0x4737('0xa')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 81e950b..89e08ce 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 _0x3519=['exports','define','MailQueue','mail_queues','lodash','moment','bluebird','path','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3519,0x1dd));var _0x9351=function(_0x2ec40b,_0x59a29c){_0x2ec40b=_0x2ec40b-0x0;var _0x28ba77=_0x3519[_0x2ec40b];return _0x28ba77;};'use strict';var _=require(_0x9351('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9351('0x1'));var BPromise=require(_0x9351('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9351('0x3'));var rimraf=require(_0x9351('0x4'));var config=require(_0x9351('0x5'));var attributes=require(_0x9351('0x6'));module[_0x9351('0x7')]=function(_0xa64e85,_0x518603){return _0xa64e85[_0x9351('0x8')](_0x9351('0x9'),attributes,{'tableName':_0x9351('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1981=['./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x2ec06f,_0x3bb56d){var _0x3a1c71=function(_0x5ca631){while(--_0x5ca631){_0x2ec06f['push'](_0x2ec06f['shift']());}};_0x3a1c71(++_0x3bb56d);}(_0x1981,0x1d9));var _0x1198=function(_0x5e62fa,_0x14276b){_0x5e62fa=_0x5e62fa-0x0;var _0x41d2c6=_0x1981[_0x5e62fa];return _0x41d2c6;};'use strict';var _=require(_0x1198('0x0'));var util=require(_0x1198('0x1'));var logger=require(_0x1198('0x2'))(_0x1198('0x3'));var moment=require('moment');var BPromise=require(_0x1198('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1198('0x5'));var rimraf=require(_0x1198('0x6'));var config=require('../../config/environment');var attributes=require(_0x1198('0x7'));module[_0x1198('0x8')]=function(_0xbb43b3,_0x1c778b){return _0xbb43b3[_0x1198('0x9')](_0x1198('0xa'),attributes,{'tableName':_0x1198('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 da22626..e34b042 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 _0xc468=['http','defaults','redis','socket.io-emitter','./mailQueue.socket','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','attributes','include','model','map','ShowMailQueue','find','lodash','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x3f0379,_0xf9a815){var _0x10401a=function(_0x133b58){while(--_0x133b58){_0x3f0379['push'](_0x3f0379['shift']());}};_0x10401a(++_0xf9a815);}(_0xc468,0x85));var _0x8c46=function(_0x626e55,_0x22db76){_0x626e55=_0x626e55-0x0;var _0x3d6b19=_0xc468[_0x626e55];return _0x3d6b19;};'use strict';var _=require(_0x8c46('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c46('0x1'));var db=require(_0x8c46('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c46('0x3'))(_0x8c46('0x4'));var config=require('../../config/environment');var jayson=require(_0x8c46('0x5'));var client=jayson[_0x8c46('0x6')][_0x8c46('0x7')]({'port':0x232a});config['redis']=_[_0x8c46('0x8')](config[_0x8c46('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8c46('0xa'))(new Redis(config['redis']));require(_0x8c46('0xb'))['register'](socket);function respondWithRpcPromise(_0x4a93ae,_0x4c19fd,_0x2aab67){return new BPromise(function(_0x4d79f8,_0x4c8c87){return client[_0x8c46('0xc')](_0x4a93ae,_0x2aab67)[_0x8c46('0xd')](function(_0x1d1555){logger['info'](_0x8c46('0xe'),_0x4c19fd,_0x8c46('0xf'));logger[_0x8c46('0x10')](_0x8c46('0x11'),_0x4c19fd,_0x8c46('0xf'),JSON[_0x8c46('0x12')](_0x1d1555));if(_0x1d1555['error']){if(_0x1d1555['error'][_0x8c46('0x13')]===0x1f4){logger[_0x8c46('0x14')](_0x8c46('0xe'),_0x4c19fd,_0x1d1555['error'][_0x8c46('0x15')]);return _0x4c8c87(_0x1d1555[_0x8c46('0x14')][_0x8c46('0x15')]);}logger['error'](_0x8c46('0xe'),_0x4c19fd,_0x1d1555[_0x8c46('0x14')]['message']);return _0x4d79f8(_0x1d1555[_0x8c46('0x14')][_0x8c46('0x15')]);}else{logger[_0x8c46('0x16')](_0x8c46('0xe'),_0x4c19fd,_0x8c46('0xf'));_0x4d79f8(_0x1d1555[_0x8c46('0x17')][_0x8c46('0x15')]);}})[_0x8c46('0x18')](function(_0x15ab2c){logger['error']('MailQueue,\x20%s,\x20%s',_0x4c19fd,_0x15ab2c);_0x4c8c87(_0x15ab2c);});});}exports[_0x8c46('0x19')]=function(_0x21db0b){var _0x15d7fb=this;return new Promise(function(_0x1caec0,_0x316cb9){return db[_0x8c46('0x1a')][_0x8c46('0x1b')]({'raw':_0x21db0b['options']?_0x21db0b['options']['raw']===undefined?!![]:![]:!![],'where':_0x21db0b[_0x8c46('0x1c')]?_0x21db0b['options']['where']||null:null,'attributes':_0x21db0b[_0x8c46('0x1c')]?_0x21db0b['options'][_0x8c46('0x1d')]||null:null,'limit':_0x21db0b[_0x8c46('0x1c')]?_0x21db0b[_0x8c46('0x1c')]['limit']||null:null,'include':_0x21db0b[_0x8c46('0x1c')]?_0x21db0b[_0x8c46('0x1c')][_0x8c46('0x1e')]?_['map'](_0x21db0b['options'][_0x8c46('0x1e')],function(_0x8672f0){return{'model':db[_0x8672f0[_0x8c46('0x1f')]],'as':_0x8672f0['as'],'attributes':_0x8672f0[_0x8c46('0x1d')],'include':_0x8672f0[_0x8c46('0x1e')]?_[_0x8c46('0x20')](_0x8672f0[_0x8c46('0x1e')],function(_0x4f3969){return{'model':db[_0x4f3969['model']],'as':_0x4f3969['as'],'attributes':_0x4f3969[_0x8c46('0x1d')],'include':_0x4f3969['include']?_[_0x8c46('0x20')](_0x4f3969[_0x8c46('0x1e')],function(_0x200ecb){return{'model':db[_0x200ecb[_0x8c46('0x1f')]],'as':_0x200ecb['as'],'attributes':_0x200ecb[_0x8c46('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8c46('0xd')](function(_0x3655a6){logger[_0x8c46('0x16')](_0x8c46('0x19'),_0x21db0b);logger[_0x8c46('0x10')](_0x8c46('0x19'),_0x21db0b,JSON[_0x8c46('0x12')](_0x3655a6));_0x1caec0(_0x3655a6);})[_0x8c46('0x18')](function(_0x313f31){logger[_0x8c46('0x14')](_0x8c46('0x19'),_0x313f31[_0x8c46('0x15')],_0x21db0b);_0x316cb9(_0x15d7fb['error'](0x1f4,_0x313f31[_0x8c46('0x15')]));});});};exports[_0x8c46('0x21')]=function(_0x1ae4e4){var _0x3f29ea=this;return new Promise(function(_0x76c33a,_0x3d55c5){return db[_0x8c46('0x1a')][_0x8c46('0x22')]({'raw':_0x1ae4e4[_0x8c46('0x1c')]?_0x1ae4e4[_0x8c46('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1ae4e4[_0x8c46('0x1c')]?_0x1ae4e4['options']['where']||null:null,'attributes':_0x1ae4e4[_0x8c46('0x1c')]?_0x1ae4e4['options'][_0x8c46('0x1d')]||null:null,'include':_0x1ae4e4['options']?_0x1ae4e4[_0x8c46('0x1c')][_0x8c46('0x1e')]?_[_0x8c46('0x20')](_0x1ae4e4[_0x8c46('0x1c')]['include'],function(_0x522935){return{'model':db[_0x522935[_0x8c46('0x1f')]],'as':_0x522935['as'],'attributes':_0x522935[_0x8c46('0x1d')],'include':_0x522935[_0x8c46('0x1e')]?_[_0x8c46('0x20')](_0x522935['include'],function(_0x3a08c9){return{'model':db[_0x3a08c9['model']],'as':_0x3a08c9['as'],'attributes':_0x3a08c9[_0x8c46('0x1d')],'include':_0x3a08c9[_0x8c46('0x1e')]?_[_0x8c46('0x20')](_0x3a08c9[_0x8c46('0x1e')],function(_0x48e352){return{'model':db[_0x48e352[_0x8c46('0x1f')]],'as':_0x48e352['as'],'attributes':_0x48e352[_0x8c46('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8c46('0xd')](function(_0x4d3a3a){logger['info'](_0x8c46('0x21'),_0x1ae4e4);logger['debug'](_0x8c46('0x21'),_0x1ae4e4,JSON[_0x8c46('0x12')](_0x4d3a3a));_0x76c33a(_0x4d3a3a);})[_0x8c46('0x18')](function(_0x58d8bf){logger['error'](_0x8c46('0x21'),_0x58d8bf[_0x8c46('0x15')],_0x1ae4e4);_0x3d55c5(_0x3f29ea[_0x8c46('0x14')](0x1f4,_0x58d8bf[_0x8c46('0x15')]));});});}; \ No newline at end of file +var _0x211d=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','model','map','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring'];(function(_0x4402b6,_0x2c8543){var _0x1c9a9b=function(_0x3f2f80){while(--_0x3f2f80){_0x4402b6['push'](_0x4402b6['shift']());}};_0x1c9a9b(++_0x2c8543);}(_0x211d,0xeb));var _0xd211=function(_0x19bbf0,_0x386a94){_0x19bbf0=_0x19bbf0-0x0;var _0x574bf6=_0x211d[_0x19bbf0];return _0x574bf6;};'use strict';var _=require(_0xd211('0x0'));var util=require(_0xd211('0x1'));var moment=require(_0xd211('0x2'));var BPromise=require(_0xd211('0x3'));var rs=require(_0xd211('0x4'));var fs=require('fs');var Redis=require(_0xd211('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd211('0x6'))(_0xd211('0x7'));var config=require(_0xd211('0x8'));var jayson=require(_0xd211('0x9'));var client=jayson[_0xd211('0xa')]['http']({'port':0x232a});config['redis']=_[_0xd211('0xb')](config[_0xd211('0xc')],{'host':_0xd211('0xd'),'port':0x18eb});var socket=require(_0xd211('0xe'))(new Redis(config[_0xd211('0xc')]));require(_0xd211('0xf'))[_0xd211('0x10')](socket);function respondWithRpcPromise(_0x55d47d,_0x47084d,_0x5882b9){return new BPromise(function(_0x39ed7a,_0x11248b){return client['request'](_0x55d47d,_0x5882b9)[_0xd211('0x11')](function(_0x377414){logger[_0xd211('0x12')]('MailQueue,\x20%s,\x20%s',_0x47084d,_0xd211('0x13'));logger[_0xd211('0x14')](_0xd211('0x15'),_0x47084d,_0xd211('0x13'),JSON[_0xd211('0x16')](_0x377414));if(_0x377414[_0xd211('0x17')]){if(_0x377414['error'][_0xd211('0x18')]===0x1f4){logger['error'](_0xd211('0x19'),_0x47084d,_0x377414['error'][_0xd211('0x1a')]);return _0x11248b(_0x377414[_0xd211('0x17')]['message']);}logger[_0xd211('0x17')](_0xd211('0x19'),_0x47084d,_0x377414[_0xd211('0x17')][_0xd211('0x1a')]);return _0x39ed7a(_0x377414['error'][_0xd211('0x1a')]);}else{logger['info'](_0xd211('0x19'),_0x47084d,_0xd211('0x13'));_0x39ed7a(_0x377414[_0xd211('0x1b')][_0xd211('0x1a')]);}})['catch'](function(_0x4834a7){logger[_0xd211('0x17')](_0xd211('0x19'),_0x47084d,_0x4834a7);_0x11248b(_0x4834a7);});});}exports[_0xd211('0x1c')]=function(_0x2208eb){var _0x4f8c9e=this;return new Promise(function(_0x3da319,_0x19899c){return db[_0xd211('0x1d')]['findAll']({'raw':_0x2208eb['options']?_0x2208eb[_0xd211('0x1e')][_0xd211('0x1f')]===undefined?!![]:![]:!![],'where':_0x2208eb[_0xd211('0x1e')]?_0x2208eb[_0xd211('0x1e')][_0xd211('0x20')]||null:null,'attributes':_0x2208eb[_0xd211('0x1e')]?_0x2208eb[_0xd211('0x1e')][_0xd211('0x21')]||null:null,'limit':_0x2208eb[_0xd211('0x1e')]?_0x2208eb[_0xd211('0x1e')][_0xd211('0x22')]||null:null,'include':_0x2208eb['options']?_0x2208eb[_0xd211('0x1e')]['include']?_['map'](_0x2208eb['options'][_0xd211('0x23')],function(_0x60485f){return{'model':db[_0x60485f[_0xd211('0x24')]],'as':_0x60485f['as'],'attributes':_0x60485f['attributes'],'include':_0x60485f[_0xd211('0x23')]?_[_0xd211('0x25')](_0x60485f[_0xd211('0x23')],function(_0x4f71e8){return{'model':db[_0x4f71e8[_0xd211('0x24')]],'as':_0x4f71e8['as'],'attributes':_0x4f71e8[_0xd211('0x21')],'include':_0x4f71e8[_0xd211('0x23')]?_[_0xd211('0x25')](_0x4f71e8[_0xd211('0x23')],function(_0x1622bc){return{'model':db[_0x1622bc[_0xd211('0x24')]],'as':_0x1622bc['as'],'attributes':_0x1622bc[_0xd211('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd211('0x11')](function(_0x30a90c){logger[_0xd211('0x12')]('GetMailQueue',_0x2208eb);logger[_0xd211('0x14')](_0xd211('0x1c'),_0x2208eb,JSON[_0xd211('0x16')](_0x30a90c));_0x3da319(_0x30a90c);})['catch'](function(_0x6d94ea){logger[_0xd211('0x17')](_0xd211('0x1c'),_0x6d94ea[_0xd211('0x1a')],_0x2208eb);_0x19899c(_0x4f8c9e[_0xd211('0x17')](0x1f4,_0x6d94ea[_0xd211('0x1a')]));});});};exports[_0xd211('0x26')]=function(_0x27f8cb){var _0x4516eb=this;return new Promise(function(_0x2e6e1b,_0x13a090){return db[_0xd211('0x1d')][_0xd211('0x27')]({'raw':_0x27f8cb['options']?_0x27f8cb[_0xd211('0x1e')][_0xd211('0x1f')]===undefined?!![]:![]:!![],'where':_0x27f8cb[_0xd211('0x1e')]?_0x27f8cb['options'][_0xd211('0x20')]||null:null,'attributes':_0x27f8cb[_0xd211('0x1e')]?_0x27f8cb[_0xd211('0x1e')][_0xd211('0x21')]||null:null,'include':_0x27f8cb[_0xd211('0x1e')]?_0x27f8cb[_0xd211('0x1e')][_0xd211('0x23')]?_['map'](_0x27f8cb[_0xd211('0x1e')][_0xd211('0x23')],function(_0x22da26){return{'model':db[_0x22da26['model']],'as':_0x22da26['as'],'attributes':_0x22da26[_0xd211('0x21')],'include':_0x22da26[_0xd211('0x23')]?_['map'](_0x22da26[_0xd211('0x23')],function(_0x5cd3b6){return{'model':db[_0x5cd3b6['model']],'as':_0x5cd3b6['as'],'attributes':_0x5cd3b6[_0xd211('0x21')],'include':_0x5cd3b6[_0xd211('0x23')]?_[_0xd211('0x25')](_0x5cd3b6[_0xd211('0x23')],function(_0x3ae7e9){return{'model':db[_0x3ae7e9['model']],'as':_0x3ae7e9['as'],'attributes':_0x3ae7e9[_0xd211('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd211('0x11')](function(_0xc44c4d){logger['info'](_0xd211('0x26'),_0x27f8cb);logger[_0xd211('0x14')]('ShowMailQueue',_0x27f8cb,JSON[_0xd211('0x16')](_0xc44c4d));_0x2e6e1b(_0xc44c4d);})['catch'](function(_0x11e2dc){logger['error'](_0xd211('0x26'),_0x11e2dc[_0xd211('0x1a')],_0x27f8cb);_0x13a090(_0x4516eb[_0xd211('0x17')](0x1f4,_0x11e2dc[_0xd211('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index d7183dd..b6c1b7c 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 _0xbddb=['./mailQueue.events','save','remove','update','emit','removeListener','register','length','mailQueue:'];(function(_0xd3aed9,_0x38e8d8){var _0x65f671=function(_0xaa2b06){while(--_0xaa2b06){_0xd3aed9['push'](_0xd3aed9['shift']());}};_0x65f671(++_0x38e8d8);}(_0xbddb,0x18c));var _0xbbdd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbddb[_0x2641f9];return _0x585741;};'use strict';var MailQueueEvents=require(_0xbbdd('0x0'));var events=[_0xbbdd('0x1'),_0xbbdd('0x2'),_0xbbdd('0x3')];function createListener(_0x54510e,_0x13aac6){return function(_0x432602){_0x13aac6[_0xbbdd('0x4')](_0x54510e,_0x432602);};}function removeListener(_0x5cb753,_0x3dbced){return function(){MailQueueEvents[_0xbbdd('0x5')](_0x5cb753,_0x3dbced);};}exports[_0xbbdd('0x6')]=function(_0x37b72d){for(var _0x4201df=0x0,_0x2d88c5=events[_0xbbdd('0x7')];_0x4201df<_0x2d88c5;_0x4201df++){var _0x1a021a=events[_0x4201df];var _0x17cf7b=createListener(_0xbbdd('0x8')+_0x1a021a,_0x37b72d);MailQueueEvents['on'](_0x1a021a,_0x17cf7b);}}; \ No newline at end of file +var _0x0b81=['save','removeListener','length','./mailQueue.events'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x0b81,0x1cb));var _0x10b8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b81[_0x3dd15e];return _0x231fd0;};'use strict';var MailQueueEvents=require(_0x10b8('0x0'));var events=[_0x10b8('0x1'),'remove','update'];function createListener(_0x3d5d21,_0x50ccfb){return function(_0x30148c){_0x50ccfb['emit'](_0x3d5d21,_0x30148c);};}function removeListener(_0x180845,_0x1cd016){return function(){MailQueueEvents[_0x10b8('0x2')](_0x180845,_0x1cd016);};}exports['register']=function(_0x93b04){for(var _0x551c50=0x0,_0x273249=events[_0x10b8('0x3')];_0x551c50<_0x273249;_0x551c50++){var _0x408350=events[_0x551c50];var _0x46cc97=createListener('mailQueue:'+_0x408350,_0x93b04);MailQueueEvents['on'](_0x408350,_0x46cc97);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 324fd5b..f23bfa8 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 _0x98fc=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','destroy','exports'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0x98fc,0x156));var _0xc98f=function(_0x1e8461,_0x5e1500){_0x1e8461=_0x1e8461-0x0;var _0x528f4d=_0x98fc[_0x1e8461];return _0x528f4d;};'use strict';var multer=require(_0xc98f('0x0'));var util=require(_0xc98f('0x1'));var path=require(_0xc98f('0x2'));var timeout=require(_0xc98f('0x3'));var express=require(_0xc98f('0x4'));var router=express['Router']();var fs_extra=require(_0xc98f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc98f('0x6'));var config=require('../../config/environment');var controller=require(_0xc98f('0x7'));router[_0xc98f('0x8')]('/',auth[_0xc98f('0x9')](),controller[_0xc98f('0xa')]);router[_0xc98f('0x8')](_0xc98f('0xb'),auth[_0xc98f('0x9')](),controller[_0xc98f('0xc')]);router[_0xc98f('0x8')](_0xc98f('0xd'),auth['isAuthenticated'](),controller[_0xc98f('0xe')]);router['post']('/',auth[_0xc98f('0x9')](),controller[_0xc98f('0xf')]);router[_0xc98f('0x10')](_0xc98f('0xd'),auth[_0xc98f('0x9')](),controller['update']);router['delete'](_0xc98f('0xd'),auth[_0xc98f('0x9')](),controller[_0xc98f('0x11')]);module[_0xc98f('0x12')]=router; \ No newline at end of file +var _0x88f5=['/:id','show','post','put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x208e83,_0x5af60a){var _0x21b194=function(_0x52f968){while(--_0x52f968){_0x208e83['push'](_0x208e83['shift']());}};_0x21b194(++_0x5af60a);}(_0x88f5,0x79));var _0x588f=function(_0x22dee2,_0x5d95bc){_0x22dee2=_0x22dee2-0x0;var _0x44d0cf=_0x88f5[_0x22dee2];return _0x44d0cf;};'use strict';var multer=require(_0x588f('0x0'));var util=require(_0x588f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x588f('0x2'));var router=express[_0x588f('0x3')]();var fs_extra=require(_0x588f('0x4'));var auth=require(_0x588f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x588f('0x6'));var controller=require(_0x588f('0x7'));router[_0x588f('0x8')]('/',auth[_0x588f('0x9')](),controller['index']);router[_0x588f('0x8')](_0x588f('0xa'),auth[_0x588f('0x9')](),controller[_0x588f('0xb')]);router[_0x588f('0x8')](_0x588f('0xc'),auth['isAuthenticated'](),controller[_0x588f('0xd')]);router[_0x588f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x588f('0xf')](_0x588f('0xc'),auth[_0x588f('0x9')](),controller['update']);router[_0x588f('0x10')]('/:id',auth[_0x588f('0x9')](),controller[_0x588f('0x11')]);module[_0x588f('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index c502779..77e7b2c 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 _0xc942=['moment','sequelize','exports','STRING','DATE'];(function(_0x264333,_0x5aff23){var _0x21cd20=function(_0x38e70b){while(--_0x38e70b){_0x264333['push'](_0x264333['shift']());}};_0x21cd20(++_0x5aff23);}(_0xc942,0x109));var _0x2c94=function(_0x2f3fc9,_0x4b5e2f){_0x2f3fc9=_0x2f3fc9-0x0;var _0x9eb26d=_0xc942[_0x2f3fc9];return _0x9eb26d;};'use strict';var moment=require(_0x2c94('0x0'));var Sequelize=require(_0x2c94('0x1'));module[_0x2c94('0x2')]={'uniqueid':{'type':Sequelize[_0x2c94('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2c94('0x3')]},'joinAt':{'type':Sequelize[_0x2c94('0x4')]},'leaveAt':{'type':Sequelize[_0x2c94('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc4cc=['exports','STRING','DATE'];(function(_0xba7a47,_0x22662a){var _0x3a0ce0=function(_0x59f41d){while(--_0x59f41d){_0xba7a47['push'](_0xba7a47['shift']());}};_0x3a0ce0(++_0x22662a);}(_0xc4cc,0x189));var _0xcc4c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc4cc[_0xa464c9];return _0x3d73c4;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xcc4c('0x0')]={'uniqueid':{'type':Sequelize[_0xcc4c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xcc4c('0x1')]},'joinAt':{'type':Sequelize[_0xcc4c('0x2')]},'leaveAt':{'type':Sequelize[_0xcc4c('0x2')]},'acceptAt':{'type':Sequelize[_0xcc4c('0x2')]},'exitAt':{'type':Sequelize[_0xcc4c('0x2')]},'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 ceb5b4e..e0b18b0 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 _0xe57e=['undefined','count','offset','status','set','Content-Range','apply','save','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','query','keys','intersection','length','attributes','hasOwnProperty','nolimit','order','sort','filters','merge','map','type','filter','options','includeAll','MailQueueReport','rows','catch','show','fields','include','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','end','json','limit'];(function(_0x2f67b1,_0x5c953e){var _0x59b080=function(_0x1e3522){while(--_0x1e3522){_0x2f67b1['push'](_0x2f67b1['shift']());}};_0x59b080(++_0x5c953e);}(_0xe57e,0x100));var _0xee57=function(_0x1e95c9,_0x245c92){_0x1e95c9=_0x1e95c9-0x0;var _0x3c7179=_0xe57e[_0x1e95c9];return _0x3c7179;};'use strict';var emlformat=require(_0xee57('0x0'));var rimraf=require(_0xee57('0x1'));var zipdir=require(_0xee57('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xee57('0x3'));var BPromise=require(_0xee57('0x4'));var Mustache=require(_0xee57('0x5'));var util=require('util');var path=require(_0xee57('0x6'));var sox=require(_0xee57('0x7'));var csv=require('to-csv');var ejs=require(_0xee57('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xee57('0x9'));var jsforce=require(_0xee57('0xa'));var deskjs=require(_0xee57('0xb'));var toCsv=require(_0xee57('0xc'));var querystring=require(_0xee57('0xd'));var Papa=require(_0xee57('0xe'));var Redis=require(_0xee57('0xf'));var authService=require(_0xee57('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xee57('0x11'));var hardwareService=require(_0xee57('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xee57('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4371b3,_0x240df5){_0x240df5=_0x240df5||0xcc;return function(_0x28e707){if(_0x28e707){return _0x4371b3[_0xee57('0x14')](_0x240df5);}return _0x4371b3['status'](_0x240df5)[_0xee57('0x15')]();};}function respondWithResult(_0xcb85c7,_0x35a37b){_0x35a37b=_0x35a37b||0xc8;return function(_0x1c2bc6){if(_0x1c2bc6){return _0xcb85c7['status'](_0x35a37b)[_0xee57('0x16')](_0x1c2bc6);}};}function respondWithFilteredResult(_0x521b96,_0x120c45){return function(_0x5b43ec){if(_0x5b43ec){var _0x19a68b=typeof _0x120c45['offset']==='undefined'&&typeof _0x120c45[_0xee57('0x17')]===_0xee57('0x18');var _0x400907=_0x5b43ec['count'];var _0x1ec268=_0x19a68b?0x0:_0x120c45['offset'];var _0x1f8750=_0x19a68b?_0x5b43ec[_0xee57('0x19')]:_0x120c45[_0xee57('0x1a')]+_0x120c45[_0xee57('0x17')];var _0x24de40;if(_0x1f8750>=_0x400907){_0x1f8750=_0x400907;_0x24de40=0xc8;}else{_0x24de40=0xce;}_0x521b96[_0xee57('0x1b')](_0x24de40);return _0x521b96[_0xee57('0x1c')](_0xee57('0x1d'),_0x1ec268+'-'+_0x1f8750+'/'+_0x400907)[_0xee57('0x16')](_0x5b43ec);}return null;};}function patchUpdates(_0x34b637){return function(_0x44eac1){try{jsonpatch[_0xee57('0x1e')](_0x44eac1,_0x34b637,!![]);}catch(_0x124537){return BPromise['reject'](_0x124537);}return _0x44eac1[_0xee57('0x1f')]();};}function saveUpdates(_0x25e4e3,_0xde1779){return function(_0xa8e808){if(_0xa8e808){return _0xa8e808['update'](_0x25e4e3)[_0xee57('0x20')](function(_0x376a25){return _0x376a25;});}return null;};}function removeEntity(_0x5164f8,_0x2b33cf){return function(_0xdfc315){if(_0xdfc315){return _0xdfc315[_0xee57('0x21')]()[_0xee57('0x20')](function(){_0x5164f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37b0d2,_0x476b92){return function(_0x4212c1){if(!_0x4212c1){_0x37b0d2[_0xee57('0x14')](0x194);}return _0x4212c1;};}function handleError(_0x425b1e,_0x2d07c1){_0x2d07c1=_0x2d07c1||0x1f4;return function(_0x15ab94){logger[_0xee57('0x22')](_0x15ab94[_0xee57('0x23')]);if(_0x15ab94[_0xee57('0x24')]){delete _0x15ab94[_0xee57('0x24')];}_0x425b1e['status'](_0x2d07c1)[_0xee57('0x25')](_0x15ab94);};}exports['index']=function(_0x3eea21,_0xa6e051){var _0x2d848a={},_0x4f3ef2={},_0x535d36={'count':0x0,'rows':[]};var _0x48d5ec=_['map'](db['MailQueueReport'][_0xee57('0x26')],function(_0x106740){return{'name':_0x106740[_0xee57('0x27')],'type':_0x106740['type'][_0xee57('0x28')]};});_0x4f3ef2[_0xee57('0x29')]=_['map'](_0x48d5ec,_0xee57('0x24'));_0x4f3ef2[_0xee57('0x2a')]=_[_0xee57('0x2b')](_0x3eea21[_0xee57('0x2a')]);_0x4f3ef2['filters']=_[_0xee57('0x2c')](_0x4f3ef2[_0xee57('0x29')],_0x4f3ef2[_0xee57('0x2a')]);_0x2d848a['attributes']=_[_0xee57('0x2c')](_0x4f3ef2[_0xee57('0x29')],qs['fields'](_0x3eea21[_0xee57('0x2a')]['fields']));_0x2d848a['attributes']=_0x2d848a['attributes'][_0xee57('0x2d')]?_0x2d848a[_0xee57('0x2e')]:_0x4f3ef2[_0xee57('0x29')];if(!_0x3eea21[_0xee57('0x2a')][_0xee57('0x2f')](_0xee57('0x30'))){_0x2d848a[_0xee57('0x17')]=qs[_0xee57('0x17')](_0x3eea21[_0xee57('0x2a')][_0xee57('0x17')]);_0x2d848a[_0xee57('0x1a')]=qs[_0xee57('0x1a')](_0x3eea21[_0xee57('0x2a')]['offset']);}_0x2d848a[_0xee57('0x31')]=qs[_0xee57('0x32')](_0x3eea21[_0xee57('0x2a')][_0xee57('0x32')]);_0x2d848a['where']=qs[_0xee57('0x33')](_['pick'](_0x3eea21[_0xee57('0x2a')],_0x4f3ef2['filters']),_0x48d5ec);if(_0x3eea21[_0xee57('0x2a')]['filter']){_0x2d848a['where']=_[_0xee57('0x34')](_0x2d848a['where'],{'$or':_[_0xee57('0x35')](_0x48d5ec,function(_0xbb8981){if(_0xbb8981[_0xee57('0x36')]!=='VIRTUAL'){var _0x322216={};_0x322216[_0xbb8981[_0xee57('0x24')]]={'$like':'%'+_0x3eea21[_0xee57('0x2a')][_0xee57('0x37')]+'%'};return _0x322216;}})});}_0x2d848a=_[_0xee57('0x34')]({},_0x2d848a,_0x3eea21[_0xee57('0x38')]);var _0x26cd5d={'where':_0x2d848a['where']};return db['MailQueueReport'][_0xee57('0x19')](_0x26cd5d)['then'](function(_0x145422){_0x535d36[_0xee57('0x19')]=_0x145422;if(_0x3eea21[_0xee57('0x2a')][_0xee57('0x39')]){_0x2d848a['include']=[{'all':!![]}];}return db[_0xee57('0x3a')]['findAll'](_0x2d848a);})[_0xee57('0x20')](function(_0x1cbfd0){_0x535d36[_0xee57('0x3b')]=_0x1cbfd0;return _0x535d36;})[_0xee57('0x20')](respondWithFilteredResult(_0xa6e051,_0x2d848a))[_0xee57('0x3c')](handleError(_0xa6e051,null));};exports[_0xee57('0x3d')]=function(_0x2e5619,_0x125a1e){var _0x3b371a={'raw':!![],'where':{'id':_0x2e5619['params']['id']}},_0x8d0d5d={};_0x8d0d5d[_0xee57('0x29')]=_[_0xee57('0x2b')](db[_0xee57('0x3a')]['rawAttributes']);_0x8d0d5d[_0xee57('0x2a')]=_[_0xee57('0x2b')](_0x2e5619['query']);_0x8d0d5d[_0xee57('0x33')]=_[_0xee57('0x2c')](_0x8d0d5d[_0xee57('0x29')],_0x8d0d5d[_0xee57('0x2a')]);_0x3b371a['attributes']=_['intersection'](_0x8d0d5d['model'],qs[_0xee57('0x3e')](_0x2e5619[_0xee57('0x2a')]['fields']));_0x3b371a[_0xee57('0x2e')]=_0x3b371a['attributes'][_0xee57('0x2d')]?_0x3b371a['attributes']:_0x8d0d5d[_0xee57('0x29')];if(_0x2e5619[_0xee57('0x2a')][_0xee57('0x39')]){_0x3b371a[_0xee57('0x3f')]=[{'all':!![]}];}_0x3b371a=_[_0xee57('0x34')]({},_0x3b371a,_0x2e5619[_0xee57('0x38')]);return db[_0xee57('0x3a')][_0xee57('0x40')](_0x3b371a)[_0xee57('0x20')](handleEntityNotFound(_0x125a1e,null))[_0xee57('0x20')](respondWithResult(_0x125a1e,null))[_0xee57('0x3c')](handleError(_0x125a1e,null));};exports['create']=function(_0x31a994,_0x515ada){return db[_0xee57('0x3a')][_0xee57('0x41')](_0x31a994[_0xee57('0x42')],{})[_0xee57('0x20')](respondWithResult(_0x515ada,0xc9))[_0xee57('0x3c')](handleError(_0x515ada,null));};exports[_0xee57('0x43')]=function(_0x2bf296,_0x1ba66a){if(_0x2bf296[_0xee57('0x42')]['id']){delete _0x2bf296['body']['id'];}return db[_0xee57('0x3a')][_0xee57('0x40')]({'where':{'id':_0x2bf296[_0xee57('0x44')]['id']}})[_0xee57('0x20')](handleEntityNotFound(_0x1ba66a,null))[_0xee57('0x20')](saveUpdates(_0x2bf296['body'],null))['then'](respondWithResult(_0x1ba66a,null))[_0xee57('0x3c')](handleError(_0x1ba66a,null));};exports[_0xee57('0x21')]=function(_0x1d361b,_0x59e4c0){return db['MailQueueReport'][_0xee57('0x40')]({'where':{'id':_0x1d361b[_0xee57('0x44')]['id']}})[_0xee57('0x20')](handleEntityNotFound(_0x59e4c0,null))[_0xee57('0x20')](removeEntity(_0x59e4c0,null))['catch'](handleError(_0x59e4c0,null));};exports[_0xee57('0x45')]=function(_0x1de767,_0x37a6bd){return db['MailQueueReport'][_0xee57('0x45')]()['then'](respondWithResult(_0x37a6bd,null))[_0xee57('0x3c')](handleError(_0x37a6bd,null));}; \ No newline at end of file +var _0x2b24=['stack','index','map','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','MailQueueReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','apply','reject','save','update','then','destroy','error'];(function(_0x197d9a,_0x9c38c4){var _0x1b4b1b=function(_0x46840c){while(--_0x46840c){_0x197d9a['push'](_0x197d9a['shift']());}};_0x1b4b1b(++_0x9c38c4);}(_0x2b24,0x72));var _0x42b2=function(_0x42e538,_0x54d51d){_0x42e538=_0x42e538-0x0;var _0x57475d=_0x2b24[_0x42e538];return _0x57475d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x42b2('0x0'));var zipdir=require(_0x42b2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x42b2('0x2'));var moment=require(_0x42b2('0x3'));var BPromise=require(_0x42b2('0x4'));var Mustache=require(_0x42b2('0x5'));var util=require('util');var path=require(_0x42b2('0x6'));var sox=require(_0x42b2('0x7'));var csv=require(_0x42b2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x42b2('0x9'));var _=require(_0x42b2('0xa'));var squel=require(_0x42b2('0xb'));var crypto=require(_0x42b2('0xc'));var jsforce=require(_0x42b2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x42b2('0x8'));var querystring=require(_0x42b2('0xe'));var Papa=require(_0x42b2('0xf'));var Redis=require(_0x42b2('0x10'));var authService=require(_0x42b2('0x11'));var qs=require(_0x42b2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x42b2('0x13'))(_0x42b2('0x14'));var utils=require(_0x42b2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x42b2('0x16'));var db=require(_0x42b2('0x17'))['db'];function respondWithStatusCode(_0xa60027,_0x5bc55a){_0x5bc55a=_0x5bc55a||0xcc;return function(_0x1acf90){if(_0x1acf90){return _0xa60027[_0x42b2('0x18')](_0x5bc55a);}return _0xa60027[_0x42b2('0x19')](_0x5bc55a)[_0x42b2('0x1a')]();};}function respondWithResult(_0x1e3985,_0x18fbda){_0x18fbda=_0x18fbda||0xc8;return function(_0x260480){if(_0x260480){return _0x1e3985['status'](_0x18fbda)['json'](_0x260480);}};}function respondWithFilteredResult(_0x29b64c,_0x35b8d2){return function(_0x2e945e){if(_0x2e945e){var _0x3ae2e4=typeof _0x35b8d2[_0x42b2('0x1b')]===_0x42b2('0x1c')&&typeof _0x35b8d2['limit']===_0x42b2('0x1c');var _0x1d4b41=_0x2e945e[_0x42b2('0x1d')];var _0xabcf0e=_0x3ae2e4?0x0:_0x35b8d2[_0x42b2('0x1b')];var _0x21d1b3=_0x3ae2e4?_0x2e945e[_0x42b2('0x1d')]:_0x35b8d2['offset']+_0x35b8d2['limit'];var _0x48e965;if(_0x21d1b3>=_0x1d4b41){_0x21d1b3=_0x1d4b41;_0x48e965=0xc8;}else{_0x48e965=0xce;}_0x29b64c[_0x42b2('0x19')](_0x48e965);return _0x29b64c[_0x42b2('0x1e')]('Content-Range',_0xabcf0e+'-'+_0x21d1b3+'/'+_0x1d4b41)['json'](_0x2e945e);}return null;};}function patchUpdates(_0x1fb2bb){return function(_0xb26ab3){try{jsonpatch[_0x42b2('0x1f')](_0xb26ab3,_0x1fb2bb,!![]);}catch(_0x2931bf){return BPromise[_0x42b2('0x20')](_0x2931bf);}return _0xb26ab3[_0x42b2('0x21')]();};}function saveUpdates(_0x2988de,_0x1a61c1){return function(_0x293550){if(_0x293550){return _0x293550[_0x42b2('0x22')](_0x2988de)[_0x42b2('0x23')](function(_0x16337e){return _0x16337e;});}return null;};}function removeEntity(_0x4c7e4f,_0x119519){return function(_0x2d6c88){if(_0x2d6c88){return _0x2d6c88[_0x42b2('0x24')]()[_0x42b2('0x23')](function(){_0x4c7e4f[_0x42b2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x215c63,_0x11cd9d){return function(_0x36c261){if(!_0x36c261){_0x215c63[_0x42b2('0x18')](0x194);}return _0x36c261;};}function handleError(_0x5569a7,_0x279fce){_0x279fce=_0x279fce||0x1f4;return function(_0x264431){logger[_0x42b2('0x25')](_0x264431[_0x42b2('0x26')]);if(_0x264431['name']){delete _0x264431['name'];}_0x5569a7['status'](_0x279fce)['send'](_0x264431);};}exports[_0x42b2('0x27')]=function(_0x3d49f9,_0x20cea9){var _0x25198d={},_0x34f936={},_0x4f5692={'count':0x0,'rows':[]};var _0x5784b2=_[_0x42b2('0x28')](db['MailQueueReport'][_0x42b2('0x29')],function(_0x501317){return{'name':_0x501317[_0x42b2('0x2a')],'type':_0x501317['type'][_0x42b2('0x2b')]};});_0x34f936[_0x42b2('0x2c')]=_[_0x42b2('0x28')](_0x5784b2,_0x42b2('0x2d'));_0x34f936[_0x42b2('0x2e')]=_['keys'](_0x3d49f9['query']);_0x34f936[_0x42b2('0x2f')]=_[_0x42b2('0x30')](_0x34f936['model'],_0x34f936[_0x42b2('0x2e')]);_0x25198d[_0x42b2('0x31')]=_[_0x42b2('0x30')](_0x34f936[_0x42b2('0x2c')],qs[_0x42b2('0x32')](_0x3d49f9[_0x42b2('0x2e')][_0x42b2('0x32')]));_0x25198d[_0x42b2('0x31')]=_0x25198d[_0x42b2('0x31')]['length']?_0x25198d[_0x42b2('0x31')]:_0x34f936['model'];if(!_0x3d49f9[_0x42b2('0x2e')][_0x42b2('0x33')](_0x42b2('0x34'))){_0x25198d[_0x42b2('0x35')]=qs['limit'](_0x3d49f9['query']['limit']);_0x25198d[_0x42b2('0x1b')]=qs['offset'](_0x3d49f9[_0x42b2('0x2e')][_0x42b2('0x1b')]);}_0x25198d[_0x42b2('0x36')]=qs[_0x42b2('0x37')](_0x3d49f9[_0x42b2('0x2e')][_0x42b2('0x37')]);_0x25198d['where']=qs['filters'](_[_0x42b2('0x38')](_0x3d49f9['query'],_0x34f936[_0x42b2('0x2f')]),_0x5784b2);if(_0x3d49f9['query'][_0x42b2('0x39')]){_0x25198d[_0x42b2('0x3a')]=_[_0x42b2('0x3b')](_0x25198d['where'],{'$or':_[_0x42b2('0x28')](_0x5784b2,function(_0x47fec9){if(_0x47fec9[_0x42b2('0x3c')]!==_0x42b2('0x3d')){var _0x1041e5={};_0x1041e5[_0x47fec9['name']]={'$like':'%'+_0x3d49f9[_0x42b2('0x2e')][_0x42b2('0x39')]+'%'};return _0x1041e5;}})});}_0x25198d=_[_0x42b2('0x3b')]({},_0x25198d,_0x3d49f9[_0x42b2('0x3e')]);var _0x2b5ad0={'where':_0x25198d[_0x42b2('0x3a')]};return db[_0x42b2('0x3f')][_0x42b2('0x1d')](_0x2b5ad0)[_0x42b2('0x23')](function(_0x3c3647){_0x4f5692[_0x42b2('0x1d')]=_0x3c3647;if(_0x3d49f9[_0x42b2('0x2e')][_0x42b2('0x40')]){_0x25198d[_0x42b2('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0x42b2('0x42')](_0x25198d);})[_0x42b2('0x23')](function(_0x21a037){_0x4f5692[_0x42b2('0x43')]=_0x21a037;return _0x4f5692;})[_0x42b2('0x23')](respondWithFilteredResult(_0x20cea9,_0x25198d))['catch'](handleError(_0x20cea9,null));};exports[_0x42b2('0x44')]=function(_0x507b04,_0x3a8f3e){var _0x2a7fd1={'raw':!![],'where':{'id':_0x507b04[_0x42b2('0x45')]['id']}},_0x4822fc={};_0x4822fc['model']=_['keys'](db[_0x42b2('0x3f')][_0x42b2('0x29')]);_0x4822fc['query']=_[_0x42b2('0x46')](_0x507b04[_0x42b2('0x2e')]);_0x4822fc['filters']=_['intersection'](_0x4822fc['model'],_0x4822fc['query']);_0x2a7fd1['attributes']=_[_0x42b2('0x30')](_0x4822fc[_0x42b2('0x2c')],qs['fields'](_0x507b04[_0x42b2('0x2e')][_0x42b2('0x32')]));_0x2a7fd1[_0x42b2('0x31')]=_0x2a7fd1['attributes']['length']?_0x2a7fd1[_0x42b2('0x31')]:_0x4822fc[_0x42b2('0x2c')];if(_0x507b04['query'][_0x42b2('0x40')]){_0x2a7fd1[_0x42b2('0x41')]=[{'all':!![]}];}_0x2a7fd1=_['merge']({},_0x2a7fd1,_0x507b04[_0x42b2('0x3e')]);return db[_0x42b2('0x3f')][_0x42b2('0x47')](_0x2a7fd1)['then'](handleEntityNotFound(_0x3a8f3e,null))[_0x42b2('0x23')](respondWithResult(_0x3a8f3e,null))[_0x42b2('0x48')](handleError(_0x3a8f3e,null));};exports[_0x42b2('0x49')]=function(_0x3fe93a,_0x597204){return db[_0x42b2('0x3f')][_0x42b2('0x49')](_0x3fe93a[_0x42b2('0x4a')],{})[_0x42b2('0x23')](respondWithResult(_0x597204,0xc9))[_0x42b2('0x48')](handleError(_0x597204,null));};exports[_0x42b2('0x22')]=function(_0x480ed6,_0x3ce642){if(_0x480ed6[_0x42b2('0x4a')]['id']){delete _0x480ed6['body']['id'];}return db[_0x42b2('0x3f')][_0x42b2('0x47')]({'where':{'id':_0x480ed6[_0x42b2('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ce642,null))[_0x42b2('0x23')](saveUpdates(_0x480ed6['body'],null))[_0x42b2('0x23')](respondWithResult(_0x3ce642,null))[_0x42b2('0x48')](handleError(_0x3ce642,null));};exports['destroy']=function(_0x3d7fa9,_0x111358){return db['MailQueueReport'][_0x42b2('0x47')]({'where':{'id':_0x3d7fa9['params']['id']}})['then'](handleEntityNotFound(_0x111358,null))[_0x42b2('0x23')](removeEntity(_0x111358,null))['catch'](handleError(_0x111358,null));};exports[_0x42b2('0x4b')]=function(_0x20bd72,_0x3c1b4a){return db[_0x42b2('0x3f')][_0x42b2('0x4b')]()[_0x42b2('0x23')](respondWithResult(_0x3c1b4a,null))[_0x42b2('0x48')](handleError(_0x3c1b4a,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index eab1f75..23e7e7a 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 _0xb072=['../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x1cef68,_0x1b4426){var _0x283998=function(_0x378992){while(--_0x378992){_0x1cef68['push'](_0x1cef68['shift']());}};_0x283998(++_0x1b4426);}(_0xb072,0x1cd));var _0x2b07=function(_0x424bfb,_0x123b8e){_0x424bfb=_0x424bfb-0x0;var _0x4bf457=_0xb072[_0x424bfb];return _0x4bf457;};'use strict';var _=require(_0x2b07('0x0'));var util=require(_0x2b07('0x1'));var logger=require('../../config/logger')(_0x2b07('0x2'));var moment=require(_0x2b07('0x3'));var BPromise=require(_0x2b07('0x4'));var rp=require(_0x2b07('0x5'));var fs=require('fs');var path=require(_0x2b07('0x6'));var rimraf=require('rimraf');var config=require(_0x2b07('0x7'));var attributes=require(_0x2b07('0x8'));module['exports']=function(_0xff0c60,_0x3ea0ea){return _0xff0c60[_0x2b07('0x9')](_0x2b07('0xa'),attributes,{'tableName':_0x2b07('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4703=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x28abca,_0x516224){var _0x1aa32e=function(_0x413290){while(--_0x413290){_0x28abca['push'](_0x28abca['shift']());}};_0x1aa32e(++_0x516224);}(_0x4703,0xda));var _0x3470=function(_0xb85d59,_0x289f2e){_0xb85d59=_0xb85d59-0x0;var _0x8ba75a=_0x4703[_0xb85d59];return _0x8ba75a;};'use strict';var _=require(_0x3470('0x0'));var util=require(_0x3470('0x1'));var logger=require(_0x3470('0x2'))(_0x3470('0x3'));var moment=require(_0x3470('0x4'));var BPromise=require(_0x3470('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3470('0x6'));var config=require(_0x3470('0x7'));var attributes=require(_0x3470('0x8'));module[_0x3470('0x9')]=function(_0x184fac,_0x55a269){return _0x184fac[_0x3470('0xa')](_0x3470('0xb'),attributes,{'tableName':_0x3470('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3470('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 8548e8b..389bcec 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 _0x65a4=['error','message','info','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','where','attributes','limit','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x65a4,0xd6));var _0x465a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x65a4[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x465a('0x0'));var rs=require(_0x465a('0x1'));var fs=require('fs');var Redis=require(_0x465a('0x2'));var db=require(_0x465a('0x3'))['db'];var utils=require(_0x465a('0x4'));var logger=require(_0x465a('0x5'))(_0x465a('0x6'));var config=require(_0x465a('0x7'));var jayson=require(_0x465a('0x8'));var client=jayson[_0x465a('0x9')][_0x465a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x258fa1,_0x264292,_0x52622e){return new BPromise(function(_0x31f34f,_0x31f0b4){return client[_0x465a('0xb')](_0x258fa1,_0x52622e)[_0x465a('0xc')](function(_0x2e81fb){logger['info'](_0x465a('0xd'),_0x264292,_0x465a('0xe'));logger[_0x465a('0xf')](_0x465a('0x10'),_0x264292,_0x465a('0xe'),JSON['stringify'](_0x2e81fb));if(_0x2e81fb[_0x465a('0x11')]){if(_0x2e81fb[_0x465a('0x11')]['code']===0x1f4){logger[_0x465a('0x11')](_0x465a('0xd'),_0x264292,_0x2e81fb[_0x465a('0x11')][_0x465a('0x12')]);return _0x31f0b4(_0x2e81fb[_0x465a('0x11')][_0x465a('0x12')]);}logger['error'](_0x465a('0xd'),_0x264292,_0x2e81fb['error']['message']);return _0x31f34f(_0x2e81fb[_0x465a('0x11')][_0x465a('0x12')]);}else{logger[_0x465a('0x13')](_0x465a('0xd'),_0x264292,_0x465a('0xe'));_0x31f34f(_0x2e81fb[_0x465a('0x14')][_0x465a('0x12')]);}})[_0x465a('0x15')](function(_0x588d20){logger[_0x465a('0x11')](_0x465a('0xd'),_0x264292,_0x588d20);_0x31f0b4(_0x588d20);});});}exports[_0x465a('0x16')]=function(_0x45e03a){var _0x1a944f=this;return new Promise(function(_0x1fbbea,_0x33dd8f){return db[_0x465a('0x17')][_0x465a('0x18')](_0x45e03a[_0x465a('0x19')],{'raw':_0x45e03a[_0x465a('0x1a')]?_0x45e03a[_0x465a('0x1a')][_0x465a('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1ff5c9){logger[_0x465a('0x13')]('CreateMailQueueReport',_0x45e03a);logger[_0x465a('0xf')](_0x465a('0x16'),_0x45e03a,JSON['stringify'](_0x1ff5c9));_0x1fbbea(_0x1ff5c9);})['catch'](function(_0x4669fc){logger[_0x465a('0x11')]('CreateMailQueueReport',_0x4669fc[_0x465a('0x12')],_0x45e03a);_0x33dd8f(_0x1a944f[_0x465a('0x11')](0x1f4,_0x4669fc[_0x465a('0x12')]));});});};exports[_0x465a('0x1c')]=function(_0x475f1c){var _0x5d79b7=this;return new Promise(function(_0x5acd70,_0x48f5c8){return db['MailQueueReport'][_0x465a('0x1d')](_0x475f1c[_0x465a('0x19')],{'raw':_0x475f1c[_0x465a('0x1a')]?_0x475f1c[_0x465a('0x1a')][_0x465a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x475f1c[_0x465a('0x1a')]?_0x475f1c[_0x465a('0x1a')][_0x465a('0x1e')]||null:null,'attributes':_0x475f1c[_0x465a('0x1a')]?_0x475f1c[_0x465a('0x1a')][_0x465a('0x1f')]||null:null,'limit':_0x475f1c[_0x465a('0x1a')]?_0x475f1c['options'][_0x465a('0x20')]||null:null})[_0x465a('0xc')](function(_0x426389){logger[_0x465a('0x13')]('UpdateMailQueueReport',_0x475f1c);logger['debug'](_0x465a('0x1c'),_0x475f1c,JSON['stringify'](_0x426389));_0x5acd70(_0x426389);})['catch'](function(_0x2afbbc){logger[_0x465a('0x11')]('UpdateMailQueueReport',_0x2afbbc[_0x465a('0x12')],_0x475f1c);_0x48f5c8(_0x5d79b7[_0x465a('0x11')](0x1f4,_0x2afbbc[_0x465a('0x12')]));});});}; \ No newline at end of file +var _0xb004=['UpdateMailQueueReport','raw','where','attributes','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport','create','body','options'];(function(_0xbd70e0,_0x193932){var _0x2f1f32=function(_0x279e6e){while(--_0x279e6e){_0xbd70e0['push'](_0xbd70e0['shift']());}};_0x2f1f32(++_0x193932);}(_0xb004,0x16c));var _0x4b00=function(_0x459ff4,_0xda1a1f){_0x459ff4=_0x459ff4-0x0;var _0x13a7f9=_0xb004[_0x459ff4];return _0x13a7f9;};'use strict';var _=require(_0x4b00('0x0'));var util=require(_0x4b00('0x1'));var moment=require(_0x4b00('0x2'));var BPromise=require('bluebird');var rs=require(_0x4b00('0x3'));var fs=require('fs');var Redis=require(_0x4b00('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b00('0x5'));var logger=require('../../config/logger')(_0x4b00('0x6'));var config=require('../../config/environment');var jayson=require(_0x4b00('0x7'));var client=jayson[_0x4b00('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b33b,_0x542ad0,_0x4dbde7){return new BPromise(function(_0x3c5744,_0x5923c1){return client[_0x4b00('0x9')](_0x10b33b,_0x4dbde7)[_0x4b00('0xa')](function(_0x2938b6){logger['info'](_0x4b00('0xb'),_0x542ad0,_0x4b00('0xc'));logger[_0x4b00('0xd')](_0x4b00('0xe'),_0x542ad0,_0x4b00('0xc'),JSON[_0x4b00('0xf')](_0x2938b6));if(_0x2938b6['error']){if(_0x2938b6[_0x4b00('0x10')][_0x4b00('0x11')]===0x1f4){logger[_0x4b00('0x10')](_0x4b00('0xb'),_0x542ad0,_0x2938b6[_0x4b00('0x10')]['message']);return _0x5923c1(_0x2938b6[_0x4b00('0x10')][_0x4b00('0x12')]);}logger[_0x4b00('0x10')](_0x4b00('0xb'),_0x542ad0,_0x2938b6[_0x4b00('0x10')][_0x4b00('0x12')]);return _0x3c5744(_0x2938b6['error'][_0x4b00('0x12')]);}else{logger[_0x4b00('0x13')](_0x4b00('0xb'),_0x542ad0,_0x4b00('0xc'));_0x3c5744(_0x2938b6['result'][_0x4b00('0x12')]);}})[_0x4b00('0x14')](function(_0x3e3e4b){logger['error'](_0x4b00('0xb'),_0x542ad0,_0x3e3e4b);_0x5923c1(_0x3e3e4b);});});}exports[_0x4b00('0x15')]=function(_0x2dc38e){var _0x5d2979=this;return new Promise(function(_0x10311f,_0x41c741){return db[_0x4b00('0x16')][_0x4b00('0x17')](_0x2dc38e[_0x4b00('0x18')],{'raw':_0x2dc38e[_0x4b00('0x19')]?_0x2dc38e[_0x4b00('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x4b00('0xa')](function(_0x2513d0){logger[_0x4b00('0x13')]('CreateMailQueueReport',_0x2dc38e);logger['debug'](_0x4b00('0x15'),_0x2dc38e,JSON['stringify'](_0x2513d0));_0x10311f(_0x2513d0);})[_0x4b00('0x14')](function(_0x15d1d7){logger[_0x4b00('0x10')](_0x4b00('0x15'),_0x15d1d7[_0x4b00('0x12')],_0x2dc38e);_0x41c741(_0x5d2979['error'](0x1f4,_0x15d1d7[_0x4b00('0x12')]));});});};exports[_0x4b00('0x1a')]=function(_0xfd2bb0){var _0xf563d7=this;return new Promise(function(_0x3f3484,_0x4d0830){return db['MailQueueReport']['update'](_0xfd2bb0[_0x4b00('0x18')],{'raw':_0xfd2bb0[_0x4b00('0x19')]?_0xfd2bb0[_0x4b00('0x19')][_0x4b00('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfd2bb0[_0x4b00('0x19')]?_0xfd2bb0[_0x4b00('0x19')][_0x4b00('0x1c')]||null:null,'attributes':_0xfd2bb0['options']?_0xfd2bb0['options'][_0x4b00('0x1d')]||null:null,'limit':_0xfd2bb0[_0x4b00('0x19')]?_0xfd2bb0[_0x4b00('0x19')]['limit']||null:null})[_0x4b00('0xa')](function(_0x3e96b1){logger['info']('UpdateMailQueueReport',_0xfd2bb0);logger[_0x4b00('0xd')](_0x4b00('0x1a'),_0xfd2bb0,JSON[_0x4b00('0xf')](_0x3e96b1));_0x3f3484(_0x3e96b1);})[_0x4b00('0x14')](function(_0x50417b){logger[_0x4b00('0x10')](_0x4b00('0x1a'),_0x50417b[_0x4b00('0x12')],_0xfd2bb0);_0x4d0830(_0xf563d7[_0x4b00('0x10')](0x1f4,_0x50417b[_0x4b00('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 65c2931..3271f46 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 _0xefda=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','connect-timeout'];(function(_0x1b3126,_0x566a16){var _0x1e6a9e=function(_0x5332c3){while(--_0x5332c3){_0x1b3126['push'](_0x1b3126['shift']());}};_0x1e6a9e(++_0x566a16);}(_0xefda,0x96));var _0xaefd=function(_0x3ac3ef,_0x437ec8){_0x3ac3ef=_0x3ac3ef-0x0;var _0x94eced=_0xefda[_0x3ac3ef];return _0x94eced;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));module[_0xaefd('0x7')]=router; \ No newline at end of file +var _0xa68c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa68c,0x187));var _0xca68=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa68c[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0xca68('0x0'));var util=require(_0xca68('0x1'));var path=require(_0xca68('0x2'));var timeout=require(_0xca68('0x3'));var express=require(_0xca68('0x4'));var router=express[_0xca68('0x5')]();var fs_extra=require(_0xca68('0x6'));var auth=require(_0xca68('0x7'));var interaction=require(_0xca68('0x8'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 02e072c..5b36de0 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 _0xa55a=['INTEGER','BOOLEAN','INBOX','sequelize','exports','STRING'];(function(_0x455645,_0xce5bc5){var _0x21c157=function(_0x5c6874){while(--_0x5c6874){_0x455645['push'](_0x455645['shift']());}};_0x21c157(++_0xce5bc5);}(_0xa55a,0xc9));var _0xaa55=function(_0x26108a,_0x3cff22){_0x26108a=_0x26108a-0x0;var _0xeddb9a=_0xa55a[_0x26108a];return _0xeddb9a;};'use strict';var Sequelize=require(_0xaa55('0x0'));module[_0xaa55('0x1')]={'description':{'type':Sequelize[_0xaa55('0x2')]},'host':{'type':Sequelize[_0xaa55('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xaa55('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xaa55('0x3')]},'tls':{'type':Sequelize[_0xaa55('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xaa55('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xaa55('0x2')]}}; \ No newline at end of file +var _0x998c=['INTEGER','STRING','sequelize','exports','BOOLEAN'];(function(_0x16e333,_0x50758e){var _0x48895c=function(_0x55b707){while(--_0x55b707){_0x16e333['push'](_0x16e333['shift']());}};_0x48895c(++_0x50758e);}(_0x998c,0x115));var _0xc998=function(_0x1c1da1,_0x4755d8){_0x1c1da1=_0x1c1da1-0x0;var _0x3c1816=_0x998c[_0x1c1da1];return _0x3c1816;};'use strict';var Sequelize=require(_0xc998('0x0'));module[_0xc998('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xc998('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xc998('0x3')]},'tls':{'type':Sequelize[_0xc998('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xc998('0x4')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xc998('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xc998('0x4')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index e7c50ed..bad8848 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 _0x574d=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api'];(function(_0x1b97e0,_0x183c1b){var _0x29f394=function(_0x18f714){while(--_0x18f714){_0x1b97e0['push'](_0x1b97e0['shift']());}};_0x29f394(++_0x183c1b);}(_0x574d,0xc0));var _0xd574=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x574d[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xd574('0x0'));var util=require(_0xd574('0x1'));var logger=require(_0xd574('0x2'))(_0xd574('0x3'));var moment=require(_0xd574('0x4'));var BPromise=require(_0xd574('0x5'));var rp=require(_0xd574('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd574('0x7'));var config=require(_0xd574('0x8'));var attributes=require(_0xd574('0x9'));module[_0xd574('0xa')]=function(_0x56ecee,_0x16a152){return _0x56ecee[_0xd574('0xb')](_0xd574('0xc'),attributes,{'tableName':_0xd574('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee4f=['bluebird','path','../../config/environment','MailServerIn','mail_servers_in','lodash','api','moment'];(function(_0x42e988,_0xd8abe0){var _0x5ce1fb=function(_0x2531bc){while(--_0x2531bc){_0x42e988['push'](_0x42e988['shift']());}};_0x5ce1fb(++_0xd8abe0);}(_0xee4f,0xad));var _0xfee4=function(_0xdfeba4,_0xdbd7da){_0xdfeba4=_0xdfeba4-0x0;var _0x41fa04=_0xee4f[_0xdfeba4];return _0x41fa04;};'use strict';var _=require(_0xfee4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfee4('0x1'));var moment=require(_0xfee4('0x2'));var BPromise=require(_0xfee4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfee4('0x4'));var rimraf=require('rimraf');var config=require(_0xfee4('0x5'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x1c39b1,_0x498647){return _0x1c39b1['define'](_0xfee4('0x6'),attributes,{'tableName':_0xfee4('0x7'),'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 436c475..15a1246 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 _0x3e2e=['MailServerIn,\x20%s,\x20%s','MailServerIn,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','findAll','options','where','limit','include','model','attributes','map','GetMailServerIn','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info'];(function(_0xff4fd2,_0x442a76){var _0x367435=function(_0x336ae5){while(--_0x336ae5){_0xff4fd2['push'](_0xff4fd2['shift']());}};_0x367435(++_0x442a76);}(_0x3e2e,0x1f1));var _0xe3e2=function(_0x48bb2e,_0x2c321c){_0x48bb2e=_0x48bb2e-0x0;var _0x3b9154=_0x3e2e[_0x48bb2e];return _0x3b9154;};'use strict';var _=require(_0xe3e2('0x0'));var util=require('util');var moment=require(_0xe3e2('0x1'));var BPromise=require(_0xe3e2('0x2'));var rs=require(_0xe3e2('0x3'));var fs=require('fs');var Redis=require(_0xe3e2('0x4'));var db=require(_0xe3e2('0x5'))['db'];var utils=require(_0xe3e2('0x6'));var logger=require(_0xe3e2('0x7'))(_0xe3e2('0x8'));var config=require(_0xe3e2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe3e2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b069c,_0x4d889b,_0x234c62){return new BPromise(function(_0x510620,_0x421d9e){return client['request'](_0x4b069c,_0x234c62)[_0xe3e2('0xb')](function(_0x5e06c1){logger[_0xe3e2('0xc')](_0xe3e2('0xd'),_0x4d889b,'request\x20sent');logger['debug'](_0xe3e2('0xe'),_0x4d889b,'request\x20sent',JSON['stringify'](_0x5e06c1));if(_0x5e06c1[_0xe3e2('0xf')]){if(_0x5e06c1[_0xe3e2('0xf')]['code']===0x1f4){logger['error'](_0xe3e2('0xd'),_0x4d889b,_0x5e06c1[_0xe3e2('0xf')][_0xe3e2('0x10')]);return _0x421d9e(_0x5e06c1[_0xe3e2('0xf')][_0xe3e2('0x10')]);}logger[_0xe3e2('0xf')](_0xe3e2('0xd'),_0x4d889b,_0x5e06c1[_0xe3e2('0xf')]['message']);return _0x510620(_0x5e06c1[_0xe3e2('0xf')][_0xe3e2('0x10')]);}else{logger[_0xe3e2('0xc')](_0xe3e2('0xd'),_0x4d889b,_0xe3e2('0x11'));_0x510620(_0x5e06c1[_0xe3e2('0x12')][_0xe3e2('0x10')]);}})[_0xe3e2('0x13')](function(_0x29fd7d){logger[_0xe3e2('0xf')]('MailServerIn,\x20%s,\x20%s',_0x4d889b,_0x29fd7d);_0x421d9e(_0x29fd7d);});});}exports['GetMailServerIn']=function(_0x19a2ff){var _0x3f2d0f=this;return new Promise(function(_0x3b77dd,_0x1a8889){return db['MailServerIn'][_0xe3e2('0x14')]({'raw':_0x19a2ff['options']?_0x19a2ff[_0xe3e2('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x19a2ff['options']?_0x19a2ff[_0xe3e2('0x15')][_0xe3e2('0x16')]||null:null,'attributes':_0x19a2ff[_0xe3e2('0x15')]?_0x19a2ff[_0xe3e2('0x15')]['attributes']||null:null,'limit':_0x19a2ff[_0xe3e2('0x15')]?_0x19a2ff[_0xe3e2('0x15')][_0xe3e2('0x17')]||null:null,'include':_0x19a2ff[_0xe3e2('0x15')]?_0x19a2ff['options'][_0xe3e2('0x18')]?_['map'](_0x19a2ff[_0xe3e2('0x15')]['include'],function(_0x5c3279){return{'model':db[_0x5c3279[_0xe3e2('0x19')]],'as':_0x5c3279['as'],'attributes':_0x5c3279[_0xe3e2('0x1a')],'include':_0x5c3279[_0xe3e2('0x18')]?_[_0xe3e2('0x1b')](_0x5c3279['include'],function(_0x456021){return{'model':db[_0x456021[_0xe3e2('0x19')]],'as':_0x456021['as'],'attributes':_0x456021[_0xe3e2('0x1a')],'include':_0x456021[_0xe3e2('0x18')]?_[_0xe3e2('0x1b')](_0x456021[_0xe3e2('0x18')],function(_0x17beea){return{'model':db[_0x17beea[_0xe3e2('0x19')]],'as':_0x17beea['as'],'attributes':_0x17beea[_0xe3e2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe3e2('0xb')](function(_0xec6dce){logger[_0xe3e2('0xc')]('GetMailServerIn',_0x19a2ff);logger['debug'](_0xe3e2('0x1c'),_0x19a2ff,JSON[_0xe3e2('0x1d')](_0xec6dce));_0x3b77dd(_0xec6dce);})[_0xe3e2('0x13')](function(_0x2bb134){logger['error']('GetMailServerIn',_0x2bb134[_0xe3e2('0x10')],_0x19a2ff);_0x1a8889(_0x3f2d0f['error'](0x1f4,_0x2bb134['message']));});});}; \ No newline at end of file +var _0x446d=['http','request','then','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','model','map','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x56c462,_0x5f2aa8){var _0x1e9f37=function(_0x41692a){while(--_0x41692a){_0x56c462['push'](_0x56c462['shift']());}};_0x1e9f37(++_0x5f2aa8);}(_0x446d,0x1bc));var _0xd446=function(_0x1ccb6b,_0x4e91e6){_0x1ccb6b=_0x1ccb6b-0x0;var _0x4c316=_0x446d[_0x1ccb6b];return _0x4c316;};'use strict';var _=require(_0xd446('0x0'));var util=require(_0xd446('0x1'));var moment=require('moment');var BPromise=require(_0xd446('0x2'));var rs=require(_0xd446('0x3'));var fs=require('fs');var Redis=require(_0xd446('0x4'));var db=require(_0xd446('0x5'))['db'];var utils=require(_0xd446('0x6'));var logger=require('../../config/logger')(_0xd446('0x7'));var config=require(_0xd446('0x8'));var jayson=require(_0xd446('0x9'));var client=jayson[_0xd446('0xa')][_0xd446('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x417ef3,_0x30ed72,_0x81346a){return new BPromise(function(_0x291479,_0x1b45b0){return client[_0xd446('0xc')](_0x417ef3,_0x81346a)[_0xd446('0xd')](function(_0x3cc286){logger['info'](_0xd446('0xe'),_0x30ed72,'request\x20sent');logger[_0xd446('0xf')](_0xd446('0x10'),_0x30ed72,_0xd446('0x11'),JSON[_0xd446('0x12')](_0x3cc286));if(_0x3cc286[_0xd446('0x13')]){if(_0x3cc286[_0xd446('0x13')]['code']===0x1f4){logger[_0xd446('0x13')](_0xd446('0xe'),_0x30ed72,_0x3cc286[_0xd446('0x13')][_0xd446('0x14')]);return _0x1b45b0(_0x3cc286[_0xd446('0x13')][_0xd446('0x14')]);}logger[_0xd446('0x13')]('MailServerIn,\x20%s,\x20%s',_0x30ed72,_0x3cc286[_0xd446('0x13')][_0xd446('0x14')]);return _0x291479(_0x3cc286[_0xd446('0x13')][_0xd446('0x14')]);}else{logger[_0xd446('0x15')](_0xd446('0xe'),_0x30ed72,'request\x20sent');_0x291479(_0x3cc286[_0xd446('0x16')][_0xd446('0x14')]);}})['catch'](function(_0x80156c){logger[_0xd446('0x13')]('MailServerIn,\x20%s,\x20%s',_0x30ed72,_0x80156c);_0x1b45b0(_0x80156c);});});}exports[_0xd446('0x17')]=function(_0x5e3270){var _0x4ec45d=this;return new Promise(function(_0x26f263,_0x3555d8){return db[_0xd446('0x18')][_0xd446('0x19')]({'raw':_0x5e3270[_0xd446('0x1a')]?_0x5e3270[_0xd446('0x1a')][_0xd446('0x1b')]===undefined?!![]:![]:!![],'where':_0x5e3270[_0xd446('0x1a')]?_0x5e3270['options'][_0xd446('0x1c')]||null:null,'attributes':_0x5e3270[_0xd446('0x1a')]?_0x5e3270[_0xd446('0x1a')][_0xd446('0x1d')]||null:null,'limit':_0x5e3270[_0xd446('0x1a')]?_0x5e3270['options'][_0xd446('0x1e')]||null:null,'include':_0x5e3270[_0xd446('0x1a')]?_0x5e3270[_0xd446('0x1a')]['include']?_['map'](_0x5e3270[_0xd446('0x1a')][_0xd446('0x1f')],function(_0x2675ed){return{'model':db[_0x2675ed[_0xd446('0x20')]],'as':_0x2675ed['as'],'attributes':_0x2675ed['attributes'],'include':_0x2675ed[_0xd446('0x1f')]?_[_0xd446('0x21')](_0x2675ed[_0xd446('0x1f')],function(_0xeb04e){return{'model':db[_0xeb04e[_0xd446('0x20')]],'as':_0xeb04e['as'],'attributes':_0xeb04e['attributes'],'include':_0xeb04e[_0xd446('0x1f')]?_[_0xd446('0x21')](_0xeb04e[_0xd446('0x1f')],function(_0x4fd93e){return{'model':db[_0x4fd93e[_0xd446('0x20')]],'as':_0x4fd93e['as'],'attributes':_0x4fd93e[_0xd446('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x264464){logger['info']('GetMailServerIn',_0x5e3270);logger[_0xd446('0xf')](_0xd446('0x17'),_0x5e3270,JSON[_0xd446('0x12')](_0x264464));_0x26f263(_0x264464);})[_0xd446('0x22')](function(_0x139507){logger['error'](_0xd446('0x17'),_0x139507[_0xd446('0x14')],_0x5e3270);_0x3555d8(_0x4ec45d[_0xd446('0x13')](0x1f4,_0x139507[_0xd446('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 2151d63..93a563a 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 _0xa9e0=['isAuthenticated','update','delete','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','index','/:id','post','put'];(function(_0x2c816a,_0x56fb51){var _0x230613=function(_0x5eb903){while(--_0x5eb903){_0x2c816a['push'](_0x2c816a['shift']());}};_0x230613(++_0x56fb51);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xc')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb43b=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x57bc17,_0x1065d3){_0x57bc17=_0x57bc17-0x0;var _0x327511=_0xb43b[_0x57bc17];return _0x327511;};'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 fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),auth[_0xbb43('0xb')](),controller[_0xbb43('0xc')]);router[_0xbb43('0xd')]('/',auth[_0xbb43('0xb')](),controller['create']);router[_0xbb43('0xe')](_0xbb43('0xa'),auth['isAuthenticated'](),controller[_0xbb43('0xf')]);router[_0xbb43('0x10')](_0xbb43('0xa'),auth[_0xbb43('0xb')](),controller[_0xbb43('0x11')]);module[_0xbb43('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 9939e68..be415c9 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 _0x9c48=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x9c48,0xa1));var _0x89c4=function(_0x5b6354,_0x5002fb){_0x5b6354=_0x5b6354-0x0;var _0x501644=_0x9c48[_0x5b6354];return _0x501644;};'use strict';var Sequelize=require(_0x89c4('0x0'));module[_0x89c4('0x1')]={'description':{'type':Sequelize[_0x89c4('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x89c4('0x2')]},'pass':{'type':Sequelize[_0x89c4('0x2')]},'port':{'type':Sequelize[_0x89c4('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x89c4('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0xae35=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xae35,0x172));var _0x5ae3=function(_0x3fad82,_0x5a36c8){_0x3fad82=_0x3fad82-0x0;var _0x185d81=_0xae35[_0x3fad82];return _0x185d81;};'use strict';var Sequelize=require(_0x5ae3('0x0'));module[_0x5ae3('0x1')]={'description':{'type':Sequelize[_0x5ae3('0x2')]},'host':{'type':Sequelize[_0x5ae3('0x2')]},'user':{'type':Sequelize[_0x5ae3('0x2')]},'pass':{'type':Sequelize[_0x5ae3('0x2')]},'port':{'type':Sequelize[_0x5ae3('0x3')]},'secure':{'type':Sequelize[_0x5ae3('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x5ae3('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 4fa443c..5c22b8c 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 _0xf0e0=['fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','apply','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','MailServerOut','includeAll','findAll','rows','show','params','include','catch','create','body','find','destroy','eml-format','rimraf','zip-dir'];(function(_0x297339,_0x1854ef){var _0x3507a2=function(_0x41361a){while(--_0x41361a){_0x297339['push'](_0x297339['shift']());}};_0x3507a2(++_0x1854ef);}(_0xf0e0,0x165));var _0x0f0e=function(_0x546802,_0x2078f4){_0x546802=_0x546802-0x0;var _0x28ddaf=_0xf0e0[_0x546802];return _0x28ddaf;};'use strict';var emlformat=require(_0x0f0e('0x0'));var rimraf=require(_0x0f0e('0x1'));var zipdir=require(_0x0f0e('0x2'));var jsonpatch=require(_0x0f0e('0x3'));var rp=require(_0x0f0e('0x4'));var moment=require(_0x0f0e('0x5'));var BPromise=require(_0x0f0e('0x6'));var Mustache=require(_0x0f0e('0x7'));var util=require(_0x0f0e('0x8'));var path=require('path');var sox=require(_0x0f0e('0x9'));var csv=require(_0x0f0e('0xa'));var ejs=require(_0x0f0e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f0e('0xc'));var squel=require(_0x0f0e('0xd'));var crypto=require(_0x0f0e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0f0e('0xf'));var toCsv=require(_0x0f0e('0xa'));var querystring=require(_0x0f0e('0x10'));var Papa=require('papaparse');var Redis=require(_0x0f0e('0x11'));var authService=require(_0x0f0e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0f0e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f0e('0x14'))(_0x0f0e('0x15'));var utils=require(_0x0f0e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0f0e('0x17'));var db=require(_0x0f0e('0x18'))['db'];function respondWithStatusCode(_0x59e669,_0x550b26){_0x550b26=_0x550b26||0xcc;return function(_0x915aca){if(_0x915aca){return _0x59e669['sendStatus'](_0x550b26);}return _0x59e669[_0x0f0e('0x19')](_0x550b26)[_0x0f0e('0x1a')]();};}function respondWithResult(_0x5989fd,_0x3c19d0){_0x3c19d0=_0x3c19d0||0xc8;return function(_0x1a2e07){if(_0x1a2e07){return _0x5989fd['status'](_0x3c19d0)[_0x0f0e('0x1b')](_0x1a2e07);}};}function respondWithFilteredResult(_0x1acccd,_0x4af35a){return function(_0x917c6b){if(_0x917c6b){var _0x2f3930=typeof _0x4af35a[_0x0f0e('0x1c')]==='undefined'&&typeof _0x4af35a[_0x0f0e('0x1d')]==='undefined';var _0x4cea1b=_0x917c6b[_0x0f0e('0x1e')];var _0x34f9a9=_0x2f3930?0x0:_0x4af35a[_0x0f0e('0x1c')];var _0x2786f0=_0x2f3930?_0x917c6b[_0x0f0e('0x1e')]:_0x4af35a['offset']+_0x4af35a[_0x0f0e('0x1d')];var _0x4f3163;if(_0x2786f0>=_0x4cea1b){_0x2786f0=_0x4cea1b;_0x4f3163=0xc8;}else{_0x4f3163=0xce;}_0x1acccd['status'](_0x4f3163);return _0x1acccd[_0x0f0e('0x1f')]('Content-Range',_0x34f9a9+'-'+_0x2786f0+'/'+_0x4cea1b)[_0x0f0e('0x1b')](_0x917c6b);}return null;};}function patchUpdates(_0x34134f){return function(_0x51c608){try{jsonpatch[_0x0f0e('0x20')](_0x51c608,_0x34134f,!![]);}catch(_0x7c366b){return BPromise['reject'](_0x7c366b);}return _0x51c608['save']();};}function saveUpdates(_0x2d4c04,_0x3339a3){return function(_0x471b84){if(_0x471b84){return _0x471b84[_0x0f0e('0x21')](_0x2d4c04)[_0x0f0e('0x22')](function(_0x5c2748){return _0x5c2748;});}return null;};}function removeEntity(_0x91a8bf,_0x371c20){return function(_0x13212f){if(_0x13212f){return _0x13212f['destroy']()[_0x0f0e('0x22')](function(){_0x91a8bf[_0x0f0e('0x19')](0xcc)[_0x0f0e('0x1a')]();});}};}function handleEntityNotFound(_0x4ed3ba,_0x3978e5){return function(_0x5b0522){if(!_0x5b0522){_0x4ed3ba['sendStatus'](0x194);}return _0x5b0522;};}function handleError(_0x1f6a3c,_0x4ff6d9){_0x4ff6d9=_0x4ff6d9||0x1f4;return function(_0x4a9054){logger[_0x0f0e('0x23')](_0x4a9054[_0x0f0e('0x24')]);if(_0x4a9054[_0x0f0e('0x25')]){delete _0x4a9054[_0x0f0e('0x25')];}_0x1f6a3c[_0x0f0e('0x19')](_0x4ff6d9)[_0x0f0e('0x26')](_0x4a9054);};}exports['index']=function(_0x18d0b9,_0x1b1ca0){var _0x475c1c={},_0x570992={},_0x88e47b={'count':0x0,'rows':[]};var _0x5072fc=_[_0x0f0e('0x27')](db['MailServerOut'][_0x0f0e('0x28')],function(_0x3bd618){return{'name':_0x3bd618[_0x0f0e('0x29')],'type':_0x3bd618[_0x0f0e('0x2a')][_0x0f0e('0x2b')]};});_0x570992[_0x0f0e('0x2c')]=_['map'](_0x5072fc,_0x0f0e('0x25'));_0x570992[_0x0f0e('0x2d')]=_[_0x0f0e('0x2e')](_0x18d0b9['query']);_0x570992[_0x0f0e('0x2f')]=_[_0x0f0e('0x30')](_0x570992[_0x0f0e('0x2c')],_0x570992[_0x0f0e('0x2d')]);_0x475c1c[_0x0f0e('0x31')]=_[_0x0f0e('0x30')](_0x570992['model'],qs['fields'](_0x18d0b9[_0x0f0e('0x2d')][_0x0f0e('0x32')]));_0x475c1c[_0x0f0e('0x31')]=_0x475c1c['attributes'][_0x0f0e('0x33')]?_0x475c1c[_0x0f0e('0x31')]:_0x570992[_0x0f0e('0x2c')];if(!_0x18d0b9[_0x0f0e('0x2d')][_0x0f0e('0x34')]('nolimit')){_0x475c1c[_0x0f0e('0x1d')]=qs['limit'](_0x18d0b9[_0x0f0e('0x2d')][_0x0f0e('0x1d')]);_0x475c1c['offset']=qs[_0x0f0e('0x1c')](_0x18d0b9[_0x0f0e('0x2d')][_0x0f0e('0x1c')]);}_0x475c1c[_0x0f0e('0x35')]=qs[_0x0f0e('0x36')](_0x18d0b9[_0x0f0e('0x2d')]['sort']);_0x475c1c[_0x0f0e('0x37')]=qs[_0x0f0e('0x2f')](_[_0x0f0e('0x38')](_0x18d0b9['query'],_0x570992[_0x0f0e('0x2f')]),_0x5072fc);if(_0x18d0b9[_0x0f0e('0x2d')][_0x0f0e('0x39')]){_0x475c1c['where']=_[_0x0f0e('0x3a')](_0x475c1c[_0x0f0e('0x37')],{'$or':_['map'](_0x5072fc,function(_0x3f1f34){if(_0x3f1f34[_0x0f0e('0x2a')]!=='VIRTUAL'){var _0x5ba888={};_0x5ba888[_0x3f1f34[_0x0f0e('0x25')]]={'$like':'%'+_0x18d0b9[_0x0f0e('0x2d')][_0x0f0e('0x39')]+'%'};return _0x5ba888;}})});}_0x475c1c=_['merge']({},_0x475c1c,_0x18d0b9[_0x0f0e('0x3b')]);var _0x26bec9={'where':_0x475c1c[_0x0f0e('0x37')]};return db[_0x0f0e('0x3c')][_0x0f0e('0x1e')](_0x26bec9)[_0x0f0e('0x22')](function(_0x1d8a90){_0x88e47b['count']=_0x1d8a90;if(_0x18d0b9['query'][_0x0f0e('0x3d')]){_0x475c1c['include']=[{'all':!![]}];}return db['MailServerOut'][_0x0f0e('0x3e')](_0x475c1c);})['then'](function(_0x27205a){_0x88e47b[_0x0f0e('0x3f')]=_0x27205a;return _0x88e47b;})[_0x0f0e('0x22')](respondWithFilteredResult(_0x1b1ca0,_0x475c1c))['catch'](handleError(_0x1b1ca0,null));};exports[_0x0f0e('0x40')]=function(_0x5560b2,_0x47a001){var _0x5dff88={'raw':!![],'where':{'id':_0x5560b2[_0x0f0e('0x41')]['id']}},_0x166ff2={};_0x166ff2[_0x0f0e('0x2c')]=_['keys'](db[_0x0f0e('0x3c')][_0x0f0e('0x28')]);_0x166ff2[_0x0f0e('0x2d')]=_[_0x0f0e('0x2e')](_0x5560b2[_0x0f0e('0x2d')]);_0x166ff2['filters']=_[_0x0f0e('0x30')](_0x166ff2[_0x0f0e('0x2c')],_0x166ff2[_0x0f0e('0x2d')]);_0x5dff88['attributes']=_[_0x0f0e('0x30')](_0x166ff2['model'],qs[_0x0f0e('0x32')](_0x5560b2[_0x0f0e('0x2d')]['fields']));_0x5dff88[_0x0f0e('0x31')]=_0x5dff88[_0x0f0e('0x31')]['length']?_0x5dff88['attributes']:_0x166ff2[_0x0f0e('0x2c')];if(_0x5560b2['query'][_0x0f0e('0x3d')]){_0x5dff88[_0x0f0e('0x42')]=[{'all':!![]}];}_0x5dff88=_[_0x0f0e('0x3a')]({},_0x5dff88,_0x5560b2[_0x0f0e('0x3b')]);return db[_0x0f0e('0x3c')]['find'](_0x5dff88)[_0x0f0e('0x22')](handleEntityNotFound(_0x47a001,null))[_0x0f0e('0x22')](respondWithResult(_0x47a001,null))[_0x0f0e('0x43')](handleError(_0x47a001,null));};exports[_0x0f0e('0x44')]=function(_0x4bf729,_0xf948e7){return db[_0x0f0e('0x3c')][_0x0f0e('0x44')](_0x4bf729[_0x0f0e('0x45')],{})[_0x0f0e('0x22')](respondWithResult(_0xf948e7,0xc9))[_0x0f0e('0x43')](handleError(_0xf948e7,null));};exports[_0x0f0e('0x21')]=function(_0x176e6c,_0x1eb466){if(_0x176e6c[_0x0f0e('0x45')]['id']){delete _0x176e6c[_0x0f0e('0x45')]['id'];}return db[_0x0f0e('0x3c')][_0x0f0e('0x46')]({'where':{'id':_0x176e6c[_0x0f0e('0x41')]['id']}})[_0x0f0e('0x22')](handleEntityNotFound(_0x1eb466,null))[_0x0f0e('0x22')](saveUpdates(_0x176e6c['body'],null))[_0x0f0e('0x22')](respondWithResult(_0x1eb466,null))[_0x0f0e('0x43')](handleError(_0x1eb466,null));};exports[_0x0f0e('0x47')]=function(_0x213b0b,_0x3311b8){return db['MailServerOut']['find']({'where':{'id':_0x213b0b[_0x0f0e('0x41')]['id']}})[_0x0f0e('0x22')](handleEntityNotFound(_0x3311b8,null))['then'](removeEntity(_0x3311b8,null))[_0x0f0e('0x43')](handleError(_0x3311b8,null));}; \ No newline at end of file +var _0xf534=['json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','status','end'];(function(_0x1c5778,_0x95d00a){var _0x5111e6=function(_0x354e36){while(--_0x354e36){_0x1c5778['push'](_0x1c5778['shift']());}};_0x5111e6(++_0x95d00a);}(_0xf534,0xc7));var _0x4f53=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf534[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x4f53('0x0'));var rimraf=require(_0x4f53('0x1'));var zipdir=require(_0x4f53('0x2'));var jsonpatch=require(_0x4f53('0x3'));var rp=require(_0x4f53('0x4'));var moment=require(_0x4f53('0x5'));var BPromise=require(_0x4f53('0x6'));var Mustache=require(_0x4f53('0x7'));var util=require(_0x4f53('0x8'));var path=require(_0x4f53('0x9'));var sox=require(_0x4f53('0xa'));var csv=require(_0x4f53('0xb'));var ejs=require(_0x4f53('0xc'));var fs=require('fs');var fs_extra=require(_0x4f53('0xd'));var _=require(_0x4f53('0xe'));var squel=require(_0x4f53('0xf'));var crypto=require(_0x4f53('0x10'));var jsforce=require(_0x4f53('0x11'));var deskjs=require(_0x4f53('0x12'));var toCsv=require(_0x4f53('0xb'));var querystring=require(_0x4f53('0x13'));var Papa=require(_0x4f53('0x14'));var Redis=require(_0x4f53('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x4f53('0x16'));var as=require(_0x4f53('0x17'));var hardwareService=require(_0x4f53('0x18'));var logger=require('../../config/logger')(_0x4f53('0x19'));var utils=require('../../config/utils');var config=require(_0x4f53('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f89c1,_0x4c1046){_0x4c1046=_0x4c1046||0xcc;return function(_0x384ec0){if(_0x384ec0){return _0x2f89c1['sendStatus'](_0x4c1046);}return _0x2f89c1[_0x4f53('0x1b')](_0x4c1046)[_0x4f53('0x1c')]();};}function respondWithResult(_0x42bb54,_0x5bf59f){_0x5bf59f=_0x5bf59f||0xc8;return function(_0x28db1c){if(_0x28db1c){return _0x42bb54[_0x4f53('0x1b')](_0x5bf59f)[_0x4f53('0x1d')](_0x28db1c);}};}function respondWithFilteredResult(_0x1736e4,_0x4ef00f){return function(_0xfdfbd9){if(_0xfdfbd9){var _0x1b3b45=typeof _0x4ef00f[_0x4f53('0x1e')]===_0x4f53('0x1f')&&typeof _0x4ef00f['limit']===_0x4f53('0x1f');var _0x4c5583=_0xfdfbd9[_0x4f53('0x20')];var _0x33af84=_0x1b3b45?0x0:_0x4ef00f['offset'];var _0x3f5e2d=_0x1b3b45?_0xfdfbd9['count']:_0x4ef00f[_0x4f53('0x1e')]+_0x4ef00f[_0x4f53('0x21')];var _0x2d2b13;if(_0x3f5e2d>=_0x4c5583){_0x3f5e2d=_0x4c5583;_0x2d2b13=0xc8;}else{_0x2d2b13=0xce;}_0x1736e4[_0x4f53('0x1b')](_0x2d2b13);return _0x1736e4['set'](_0x4f53('0x22'),_0x33af84+'-'+_0x3f5e2d+'/'+_0x4c5583)[_0x4f53('0x1d')](_0xfdfbd9);}return null;};}function patchUpdates(_0xe21109){return function(_0x337a2b){try{jsonpatch[_0x4f53('0x23')](_0x337a2b,_0xe21109,!![]);}catch(_0x4a3932){return BPromise['reject'](_0x4a3932);}return _0x337a2b[_0x4f53('0x24')]();};}function saveUpdates(_0x49cec6,_0x3e2bda){return function(_0x23d807){if(_0x23d807){return _0x23d807[_0x4f53('0x25')](_0x49cec6)[_0x4f53('0x26')](function(_0x2ffbbe){return _0x2ffbbe;});}return null;};}function removeEntity(_0x44d88b,_0x1d8fb8){return function(_0x47515d){if(_0x47515d){return _0x47515d[_0x4f53('0x27')]()[_0x4f53('0x26')](function(){_0x44d88b[_0x4f53('0x1b')](0xcc)[_0x4f53('0x1c')]();});}};}function handleEntityNotFound(_0x5cd276,_0x3762b3){return function(_0x20774e){if(!_0x20774e){_0x5cd276[_0x4f53('0x28')](0x194);}return _0x20774e;};}function handleError(_0x4d42e2,_0xa5d870){_0xa5d870=_0xa5d870||0x1f4;return function(_0x3c2862){logger['error'](_0x3c2862[_0x4f53('0x29')]);if(_0x3c2862[_0x4f53('0x2a')]){delete _0x3c2862['name'];}_0x4d42e2[_0x4f53('0x1b')](_0xa5d870)[_0x4f53('0x2b')](_0x3c2862);};}exports[_0x4f53('0x2c')]=function(_0x27626a,_0x2f772c){var _0x2c56fe={},_0x5deb91={},_0x2bea80={'count':0x0,'rows':[]};var _0x44e53e=_[_0x4f53('0x2d')](db[_0x4f53('0x2e')][_0x4f53('0x2f')],function(_0x3d1470){return{'name':_0x3d1470[_0x4f53('0x30')],'type':_0x3d1470[_0x4f53('0x31')][_0x4f53('0x32')]};});_0x5deb91[_0x4f53('0x33')]=_[_0x4f53('0x2d')](_0x44e53e,_0x4f53('0x2a'));_0x5deb91[_0x4f53('0x34')]=_[_0x4f53('0x35')](_0x27626a[_0x4f53('0x34')]);_0x5deb91[_0x4f53('0x36')]=_[_0x4f53('0x37')](_0x5deb91[_0x4f53('0x33')],_0x5deb91[_0x4f53('0x34')]);_0x2c56fe[_0x4f53('0x38')]=_[_0x4f53('0x37')](_0x5deb91['model'],qs[_0x4f53('0x39')](_0x27626a[_0x4f53('0x34')][_0x4f53('0x39')]));_0x2c56fe[_0x4f53('0x38')]=_0x2c56fe[_0x4f53('0x38')]['length']?_0x2c56fe[_0x4f53('0x38')]:_0x5deb91[_0x4f53('0x33')];if(!_0x27626a[_0x4f53('0x34')][_0x4f53('0x3a')](_0x4f53('0x3b'))){_0x2c56fe[_0x4f53('0x21')]=qs[_0x4f53('0x21')](_0x27626a[_0x4f53('0x34')][_0x4f53('0x21')]);_0x2c56fe[_0x4f53('0x1e')]=qs[_0x4f53('0x1e')](_0x27626a['query'][_0x4f53('0x1e')]);}_0x2c56fe[_0x4f53('0x3c')]=qs[_0x4f53('0x3d')](_0x27626a[_0x4f53('0x34')][_0x4f53('0x3d')]);_0x2c56fe[_0x4f53('0x3e')]=qs[_0x4f53('0x36')](_['pick'](_0x27626a[_0x4f53('0x34')],_0x5deb91[_0x4f53('0x36')]),_0x44e53e);if(_0x27626a[_0x4f53('0x34')][_0x4f53('0x3f')]){_0x2c56fe[_0x4f53('0x3e')]=_[_0x4f53('0x40')](_0x2c56fe[_0x4f53('0x3e')],{'$or':_['map'](_0x44e53e,function(_0x4bc3dd){if(_0x4bc3dd[_0x4f53('0x31')]!=='VIRTUAL'){var _0x12dc65={};_0x12dc65[_0x4bc3dd['name']]={'$like':'%'+_0x27626a[_0x4f53('0x34')][_0x4f53('0x3f')]+'%'};return _0x12dc65;}})});}_0x2c56fe=_[_0x4f53('0x40')]({},_0x2c56fe,_0x27626a[_0x4f53('0x41')]);var _0x4b7660={'where':_0x2c56fe[_0x4f53('0x3e')]};return db[_0x4f53('0x2e')]['count'](_0x4b7660)[_0x4f53('0x26')](function(_0x169230){_0x2bea80['count']=_0x169230;if(_0x27626a[_0x4f53('0x34')]['includeAll']){_0x2c56fe[_0x4f53('0x42')]=[{'all':!![]}];}return db[_0x4f53('0x2e')][_0x4f53('0x43')](_0x2c56fe);})['then'](function(_0x50fb99){_0x2bea80[_0x4f53('0x44')]=_0x50fb99;return _0x2bea80;})[_0x4f53('0x26')](respondWithFilteredResult(_0x2f772c,_0x2c56fe))[_0x4f53('0x45')](handleError(_0x2f772c,null));};exports[_0x4f53('0x46')]=function(_0x590c1c,_0x1418f4){var _0x37da38={'raw':!![],'where':{'id':_0x590c1c[_0x4f53('0x47')]['id']}},_0x2cbc8f={};_0x2cbc8f[_0x4f53('0x33')]=_[_0x4f53('0x35')](db[_0x4f53('0x2e')]['rawAttributes']);_0x2cbc8f[_0x4f53('0x34')]=_[_0x4f53('0x35')](_0x590c1c['query']);_0x2cbc8f[_0x4f53('0x36')]=_[_0x4f53('0x37')](_0x2cbc8f[_0x4f53('0x33')],_0x2cbc8f[_0x4f53('0x34')]);_0x37da38[_0x4f53('0x38')]=_['intersection'](_0x2cbc8f[_0x4f53('0x33')],qs[_0x4f53('0x39')](_0x590c1c[_0x4f53('0x34')]['fields']));_0x37da38['attributes']=_0x37da38[_0x4f53('0x38')]['length']?_0x37da38[_0x4f53('0x38')]:_0x2cbc8f[_0x4f53('0x33')];if(_0x590c1c[_0x4f53('0x34')][_0x4f53('0x48')]){_0x37da38[_0x4f53('0x42')]=[{'all':!![]}];}_0x37da38=_[_0x4f53('0x40')]({},_0x37da38,_0x590c1c[_0x4f53('0x41')]);return db['MailServerOut'][_0x4f53('0x49')](_0x37da38)[_0x4f53('0x26')](handleEntityNotFound(_0x1418f4,null))[_0x4f53('0x26')](respondWithResult(_0x1418f4,null))[_0x4f53('0x45')](handleError(_0x1418f4,null));};exports['create']=function(_0x33089f,_0xba9d65){return db[_0x4f53('0x2e')][_0x4f53('0x4a')](_0x33089f[_0x4f53('0x4b')],{})[_0x4f53('0x26')](respondWithResult(_0xba9d65,0xc9))[_0x4f53('0x45')](handleError(_0xba9d65,null));};exports[_0x4f53('0x25')]=function(_0x28905d,_0x58d3f6){if(_0x28905d[_0x4f53('0x4b')]['id']){delete _0x28905d[_0x4f53('0x4b')]['id'];}return db[_0x4f53('0x2e')][_0x4f53('0x49')]({'where':{'id':_0x28905d[_0x4f53('0x47')]['id']}})[_0x4f53('0x26')](handleEntityNotFound(_0x58d3f6,null))[_0x4f53('0x26')](saveUpdates(_0x28905d[_0x4f53('0x4b')],null))[_0x4f53('0x26')](respondWithResult(_0x58d3f6,null))['catch'](handleError(_0x58d3f6,null));};exports[_0x4f53('0x27')]=function(_0x5b970a,_0x361a72){return db[_0x4f53('0x2e')]['find']({'where':{'id':_0x5b970a[_0x4f53('0x47')]['id']}})[_0x4f53('0x26')](handleEntityNotFound(_0x361a72,null))[_0x4f53('0x26')](removeEntity(_0x361a72,null))[_0x4f53('0x45')](handleError(_0x361a72,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 35431a6..f899f55 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 _0x9957=['exports','define','MailServerOut','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./mailServerOut.attributes'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['mail_servers_out','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut'];(function(_0x5ef4c,_0x20cb0b){var _0x5adc60=function(_0x16c25f){while(--_0x16c25f){_0x5ef4c['push'](_0x5ef4c['shift']());}};_0x5adc60(++_0x20cb0b);}(_0x326f,0xd1));var _0xf326=function(_0x201c10,_0x4ea884){_0x201c10=_0x201c10-0x0;var _0x81cce7=_0x326f[_0x201c10];return _0x81cce7;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index a063edc..c6bb56e 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 _0xb064=['rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1619ac,_0x3127b0){var _0x268695=function(_0x2f2854){while(--_0x2f2854){_0x1619ac['push'](_0x1619ac['shift']());}};_0x268695(++_0x3127b0);}(_0xb064,0x1ba));var _0x4b06=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xb064[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x4b06('0x0'));var util=require(_0x4b06('0x1'));var moment=require(_0x4b06('0x2'));var BPromise=require(_0x4b06('0x3'));var rs=require(_0x4b06('0x4'));var fs=require('fs');var Redis=require(_0x4b06('0x5'));var db=require(_0x4b06('0x6'))['db'];var utils=require(_0x4b06('0x7'));var logger=require('../../config/logger')(_0x4b06('0x8'));var config=require(_0x4b06('0x9'));var jayson=require(_0x4b06('0xa'));var client=jayson[_0x4b06('0xb')][_0x4b06('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x97f737,_0xeaf237,_0x50eac5){return new BPromise(function(_0x4278df,_0x3cda99){return client[_0x4b06('0xd')](_0x97f737,_0x50eac5)[_0x4b06('0xe')](function(_0x192570){logger['info'](_0x4b06('0xf'),_0xeaf237,_0x4b06('0x10'));logger[_0x4b06('0x11')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0xeaf237,_0x4b06('0x10'),JSON[_0x4b06('0x12')](_0x192570));if(_0x192570[_0x4b06('0x13')]){if(_0x192570[_0x4b06('0x13')][_0x4b06('0x14')]===0x1f4){logger[_0x4b06('0x13')](_0x4b06('0xf'),_0xeaf237,_0x192570[_0x4b06('0x13')]['message']);return _0x3cda99(_0x192570[_0x4b06('0x13')][_0x4b06('0x15')]);}logger[_0x4b06('0x13')](_0x4b06('0xf'),_0xeaf237,_0x192570[_0x4b06('0x13')][_0x4b06('0x15')]);return _0x4278df(_0x192570[_0x4b06('0x13')][_0x4b06('0x15')]);}else{logger[_0x4b06('0x16')](_0x4b06('0xf'),_0xeaf237,_0x4b06('0x10'));_0x4278df(_0x192570[_0x4b06('0x17')][_0x4b06('0x15')]);}})[_0x4b06('0x18')](function(_0x5e35f8){logger['error'](_0x4b06('0xf'),_0xeaf237,_0x5e35f8);_0x3cda99(_0x5e35f8);});});} \ No newline at end of file +var _0x0c84=['jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x73e5b0,_0x241ec0){var _0x23ed6f=function(_0x12825c){while(--_0x12825c){_0x73e5b0['push'](_0x73e5b0['shift']());}};_0x23ed6f(++_0x241ec0);}(_0x0c84,0xc7));var _0x40c8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0c84[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x40c8('0x0'));var moment=require(_0x40c8('0x1'));var BPromise=require('bluebird');var rs=require(_0x40c8('0x2'));var fs=require('fs');var Redis=require(_0x40c8('0x3'));var db=require(_0x40c8('0x4'))['db'];var utils=require(_0x40c8('0x5'));var logger=require('../../config/logger')(_0x40c8('0x6'));var config=require(_0x40c8('0x7'));var jayson=require(_0x40c8('0x8'));var client=jayson[_0x40c8('0x9')][_0x40c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54d647,_0x2ad096,_0x46b57a){return new BPromise(function(_0x36ab24,_0x592a2d){return client[_0x40c8('0xb')](_0x54d647,_0x46b57a)[_0x40c8('0xc')](function(_0x5e1123){logger[_0x40c8('0xd')](_0x40c8('0xe'),_0x2ad096,_0x40c8('0xf'));logger[_0x40c8('0x10')](_0x40c8('0x11'),_0x2ad096,_0x40c8('0xf'),JSON[_0x40c8('0x12')](_0x5e1123));if(_0x5e1123[_0x40c8('0x13')]){if(_0x5e1123[_0x40c8('0x13')][_0x40c8('0x14')]===0x1f4){logger[_0x40c8('0x13')](_0x40c8('0xe'),_0x2ad096,_0x5e1123[_0x40c8('0x13')][_0x40c8('0x15')]);return _0x592a2d(_0x5e1123[_0x40c8('0x13')][_0x40c8('0x15')]);}logger['error'](_0x40c8('0xe'),_0x2ad096,_0x5e1123[_0x40c8('0x13')]['message']);return _0x36ab24(_0x5e1123[_0x40c8('0x13')][_0x40c8('0x15')]);}else{logger[_0x40c8('0xd')]('MailServerOut,\x20%s,\x20%s',_0x2ad096,_0x40c8('0xf'));_0x36ab24(_0x5e1123['result'][_0x40c8('0x15')]);}})[_0x40c8('0x16')](function(_0x1528d8){logger[_0x40c8('0x13')](_0x40c8('0xe'),_0x2ad096,_0x1528d8);_0x592a2d(_0x1528d8);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index df3e34c..bc39bee 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 _0x352e=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put'];(function(_0x297d7b,_0x421583){var _0x2ca5e8=function(_0x31da91){while(--_0x31da91){_0x297d7b['push'](_0x297d7b['shift']());}};_0x2ca5e8(++_0x421583);}(_0x352e,0x1a6));var _0xe352=function(_0xc8cdfb,_0x41c58e){_0xc8cdfb=_0xc8cdfb-0x0;var _0x56a506=_0x352e[_0xc8cdfb];return _0x56a506;};'use strict';var multer=require(_0xe352('0x0'));var util=require(_0xe352('0x1'));var path=require(_0xe352('0x2'));var timeout=require(_0xe352('0x3'));var express=require(_0xe352('0x4'));var router=express[_0xe352('0x5')]();var fs_extra=require(_0xe352('0x6'));var auth=require(_0xe352('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe352('0x8'));var controller=require(_0xe352('0x9'));router['get']('/',auth[_0xe352('0xa')](),controller[_0xe352('0xb')]);router[_0xe352('0xc')](_0xe352('0xd'),auth['isAuthenticated'](),controller[_0xe352('0xe')]);router[_0xe352('0xc')](_0xe352('0xf'),auth[_0xe352('0xa')](),controller['show']);router[_0xe352('0x10')]('/',auth[_0xe352('0xa')](),controller[_0xe352('0x11')]);router[_0xe352('0x12')](_0xe352('0xf'),auth[_0xe352('0xa')](),controller['update']);router['delete'](_0xe352('0xf'),auth[_0xe352('0xa')](),controller[_0xe352('0x13')]);module[_0xe352('0x14')]=router; \ No newline at end of file +var _0xd0a4=['destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','post','create','put'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0xd0a4,0x166));var _0x4d0a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xd0a4[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x4d0a('0x0'));var util=require(_0x4d0a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d0a('0x2')]();var fs_extra=require(_0x4d0a('0x3'));var auth=require(_0x4d0a('0x4'));var interaction=require(_0x4d0a('0x5'));var config=require(_0x4d0a('0x6'));var controller=require(_0x4d0a('0x7'));router[_0x4d0a('0x8')]('/',auth[_0x4d0a('0x9')](),controller[_0x4d0a('0xa')]);router['get']('/describe',auth[_0x4d0a('0x9')](),controller[_0x4d0a('0xb')]);router['get'](_0x4d0a('0xc'),auth[_0x4d0a('0x9')](),controller['show']);router[_0x4d0a('0xd')]('/',auth[_0x4d0a('0x9')](),controller[_0x4d0a('0xe')]);router[_0x4d0a('0xf')](_0x4d0a('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x4d0a('0xc'),auth[_0x4d0a('0x9')](),controller[_0x4d0a('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 35189c9..b008bd2 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 _0x6c45=['STRING','sequelize','exports','name'];(function(_0xff615d,_0x173ee1){var _0x12e91b=function(_0x138dfa){while(--_0x138dfa){_0xff615d['push'](_0xff615d['shift']());}};_0x12e91b(++_0x173ee1);}(_0x6c45,0xb1));var _0x56c4=function(_0x38006c,_0x53ca08){_0x38006c=_0x38006c-0x0;var _0x4de9d6=_0x6c45[_0x38006c];return _0x4de9d6;};'use strict';var Sequelize=require(_0x56c4('0x0'));module[_0x56c4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x56c4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x56c4('0x3')]}}; \ No newline at end of file +var _0x6fc2=['sequelize','exports','STRING'];(function(_0x376713,_0x5e9900){var _0x1c108c=function(_0x1d67fb){while(--_0x1d67fb){_0x376713['push'](_0x376713['shift']());}};_0x1c108c(++_0x5e9900);}(_0x6fc2,0x117));var _0x26fc=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x6fc2[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require(_0x26fc('0x0'));module[_0x26fc('0x1')]={'name':{'type':Sequelize[_0x26fc('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x26fc('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 34e4153..d5a8740 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 _0x622d=['save','update','then','end','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject'];(function(_0xce6839,_0x68cd47){var _0x4f15e7=function(_0x4079af){while(--_0x4079af){_0xce6839['push'](_0xce6839['shift']());}};_0x4f15e7(++_0x68cd47);}(_0x622d,0x19a));var _0xd622=function(_0x451ca2,_0x27e9ea){_0x451ca2=_0x451ca2-0x0;var _0x270b48=_0x622d[_0x451ca2];return _0x270b48;};'use strict';var emlformat=require(_0xd622('0x0'));var rimraf=require(_0xd622('0x1'));var zipdir=require(_0xd622('0x2'));var jsonpatch=require(_0xd622('0x3'));var rp=require(_0xd622('0x4'));var moment=require(_0xd622('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd622('0x6'));var util=require(_0xd622('0x7'));var path=require('path');var sox=require(_0xd622('0x8'));var csv=require(_0xd622('0x9'));var ejs=require(_0xd622('0xa'));var fs=require('fs');var fs_extra=require(_0xd622('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd622('0xc'));var jsforce=require(_0xd622('0xd'));var deskjs=require(_0xd622('0xe'));var toCsv=require(_0xd622('0x9'));var querystring=require(_0xd622('0xf'));var Papa=require('papaparse');var Redis=require(_0xd622('0x10'));var authService=require(_0xd622('0x11'));var qs=require(_0xd622('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd622('0x13'));var logger=require('../../config/logger')(_0xd622('0x14'));var utils=require(_0xd622('0x15'));var config=require(_0xd622('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd622('0x17'))['db'];function respondWithStatusCode(_0x4dd8a3,_0x88c79f){_0x88c79f=_0x88c79f||0xcc;return function(_0x2db4ec){if(_0x2db4ec){return _0x4dd8a3[_0xd622('0x18')](_0x88c79f);}return _0x4dd8a3[_0xd622('0x19')](_0x88c79f)['end']();};}function respondWithResult(_0x36bc48,_0x49cfaf){_0x49cfaf=_0x49cfaf||0xc8;return function(_0x20d9f4){if(_0x20d9f4){return _0x36bc48[_0xd622('0x19')](_0x49cfaf)[_0xd622('0x1a')](_0x20d9f4);}};}function respondWithFilteredResult(_0x2d4a96,_0x1828fe){return function(_0x291e3f){if(_0x291e3f){var _0x2ef8a3=typeof _0x1828fe[_0xd622('0x1b')]===_0xd622('0x1c')&&typeof _0x1828fe['limit']===_0xd622('0x1c');var _0x1a6cbb=_0x291e3f[_0xd622('0x1d')];var _0x25f2c9=_0x2ef8a3?0x0:_0x1828fe[_0xd622('0x1b')];var _0xe7efa=_0x2ef8a3?_0x291e3f[_0xd622('0x1d')]:_0x1828fe[_0xd622('0x1b')]+_0x1828fe['limit'];var _0x2c02cf;if(_0xe7efa>=_0x1a6cbb){_0xe7efa=_0x1a6cbb;_0x2c02cf=0xc8;}else{_0x2c02cf=0xce;}_0x2d4a96[_0xd622('0x19')](_0x2c02cf);return _0x2d4a96[_0xd622('0x1e')](_0xd622('0x1f'),_0x25f2c9+'-'+_0xe7efa+'/'+_0x1a6cbb)[_0xd622('0x1a')](_0x291e3f);}return null;};}function patchUpdates(_0xb8c03d){return function(_0x4cfc71){try{jsonpatch[_0xd622('0x20')](_0x4cfc71,_0xb8c03d,!![]);}catch(_0x670b8){return BPromise[_0xd622('0x21')](_0x670b8);}return _0x4cfc71[_0xd622('0x22')]();};}function saveUpdates(_0x42264b,_0x40cc20){return function(_0x1abb33){if(_0x1abb33){return _0x1abb33[_0xd622('0x23')](_0x42264b)[_0xd622('0x24')](function(_0x527141){return _0x527141;});}return null;};}function removeEntity(_0x5dcbe2,_0x40c995){return function(_0x4970a1){if(_0x4970a1){return _0x4970a1['destroy']()['then'](function(){_0x5dcbe2['status'](0xcc)[_0xd622('0x25')]();});}};}function handleEntityNotFound(_0x16cbbe,_0x6ccce1){return function(_0x10441e){if(!_0x10441e){_0x16cbbe['sendStatus'](0x194);}return _0x10441e;};}function handleError(_0x2dc3a3,_0x72f856){_0x72f856=_0x72f856||0x1f4;return function(_0x169e7b){logger[_0xd622('0x26')](_0x169e7b[_0xd622('0x27')]);if(_0x169e7b['name']){delete _0x169e7b[_0xd622('0x28')];}_0x2dc3a3['status'](_0x72f856)[_0xd622('0x29')](_0x169e7b);};}exports[_0xd622('0x2a')]=function(_0x3c02fe,_0x2c4147){var _0x4aa59c={},_0x4d97cb={},_0x48a438={'count':0x0,'rows':[]};var _0xb0de6d=_[_0xd622('0x2b')](db[_0xd622('0x2c')][_0xd622('0x2d')],function(_0x7a0ac9){return{'name':_0x7a0ac9[_0xd622('0x2e')],'type':_0x7a0ac9[_0xd622('0x2f')]['key']};});_0x4d97cb[_0xd622('0x30')]=_[_0xd622('0x2b')](_0xb0de6d,_0xd622('0x28'));_0x4d97cb[_0xd622('0x31')]=_[_0xd622('0x32')](_0x3c02fe[_0xd622('0x31')]);_0x4d97cb['filters']=_[_0xd622('0x33')](_0x4d97cb[_0xd622('0x30')],_0x4d97cb[_0xd622('0x31')]);_0x4aa59c[_0xd622('0x34')]=_[_0xd622('0x33')](_0x4d97cb[_0xd622('0x30')],qs[_0xd622('0x35')](_0x3c02fe['query']['fields']));_0x4aa59c['attributes']=_0x4aa59c[_0xd622('0x34')][_0xd622('0x36')]?_0x4aa59c[_0xd622('0x34')]:_0x4d97cb[_0xd622('0x30')];if(!_0x3c02fe[_0xd622('0x31')][_0xd622('0x37')](_0xd622('0x38'))){_0x4aa59c[_0xd622('0x39')]=qs[_0xd622('0x39')](_0x3c02fe[_0xd622('0x31')]['limit']);_0x4aa59c['offset']=qs[_0xd622('0x1b')](_0x3c02fe[_0xd622('0x31')][_0xd622('0x1b')]);}_0x4aa59c['order']=qs['sort'](_0x3c02fe['query'][_0xd622('0x3a')]);_0x4aa59c[_0xd622('0x3b')]=qs[_0xd622('0x3c')](_['pick'](_0x3c02fe[_0xd622('0x31')],_0x4d97cb[_0xd622('0x3c')]),_0xb0de6d);if(_0x3c02fe[_0xd622('0x31')][_0xd622('0x3d')]){_0x4aa59c['where']=_['merge'](_0x4aa59c['where'],{'$or':_[_0xd622('0x2b')](_0xb0de6d,function(_0x388615){if(_0x388615[_0xd622('0x2f')]!==_0xd622('0x3e')){var _0x2a7b99={};_0x2a7b99[_0x388615[_0xd622('0x28')]]={'$like':'%'+_0x3c02fe[_0xd622('0x31')][_0xd622('0x3d')]+'%'};return _0x2a7b99;}})});}_0x4aa59c=_['merge']({},_0x4aa59c,_0x3c02fe['options']);var _0x358cc8={'where':_0x4aa59c[_0xd622('0x3b')]};return db[_0xd622('0x2c')][_0xd622('0x1d')](_0x358cc8)[_0xd622('0x24')](function(_0x1a6fce){_0x48a438[_0xd622('0x1d')]=_0x1a6fce;if(_0x3c02fe[_0xd622('0x31')]['includeAll']){_0x4aa59c[_0xd622('0x3f')]=[{'all':!![]}];}return db['MailSubstatus'][_0xd622('0x40')](_0x4aa59c);})[_0xd622('0x24')](function(_0x18e52e){_0x48a438[_0xd622('0x41')]=_0x18e52e;return _0x48a438;})[_0xd622('0x24')](respondWithFilteredResult(_0x2c4147,_0x4aa59c))[_0xd622('0x42')](handleError(_0x2c4147,null));};exports[_0xd622('0x43')]=function(_0x45addf,_0x539276){var _0x300c7b={'raw':!![],'where':{'id':_0x45addf[_0xd622('0x44')]['id']}},_0x34fa71={};_0x34fa71[_0xd622('0x30')]=_[_0xd622('0x32')](db[_0xd622('0x2c')][_0xd622('0x2d')]);_0x34fa71[_0xd622('0x31')]=_[_0xd622('0x32')](_0x45addf[_0xd622('0x31')]);_0x34fa71[_0xd622('0x3c')]=_[_0xd622('0x33')](_0x34fa71[_0xd622('0x30')],_0x34fa71['query']);_0x300c7b[_0xd622('0x34')]=_[_0xd622('0x33')](_0x34fa71['model'],qs[_0xd622('0x35')](_0x45addf[_0xd622('0x31')][_0xd622('0x35')]));_0x300c7b['attributes']=_0x300c7b['attributes'][_0xd622('0x36')]?_0x300c7b[_0xd622('0x34')]:_0x34fa71[_0xd622('0x30')];if(_0x45addf[_0xd622('0x31')][_0xd622('0x45')]){_0x300c7b[_0xd622('0x3f')]=[{'all':!![]}];}_0x300c7b=_['merge']({},_0x300c7b,_0x45addf['options']);return db[_0xd622('0x2c')]['find'](_0x300c7b)[_0xd622('0x24')](handleEntityNotFound(_0x539276,null))[_0xd622('0x24')](respondWithResult(_0x539276,null))['catch'](handleError(_0x539276,null));};exports[_0xd622('0x46')]=function(_0x32297e,_0x5f4210){return db[_0xd622('0x2c')][_0xd622('0x46')](_0x32297e[_0xd622('0x47')],{})[_0xd622('0x24')](respondWithResult(_0x5f4210,0xc9))[_0xd622('0x42')](handleError(_0x5f4210,null));};exports[_0xd622('0x23')]=function(_0x5ae762,_0xcee086){if(_0x5ae762['body']['id']){delete _0x5ae762['body']['id'];}return db[_0xd622('0x2c')][_0xd622('0x48')]({'where':{'id':_0x5ae762[_0xd622('0x44')]['id']}})[_0xd622('0x24')](handleEntityNotFound(_0xcee086,null))[_0xd622('0x24')](saveUpdates(_0x5ae762[_0xd622('0x47')],null))['then'](respondWithResult(_0xcee086,null))[_0xd622('0x42')](handleError(_0xcee086,null));};exports['destroy']=function(_0xdd134,_0x229ac5){return db['MailSubstatus'][_0xd622('0x48')]({'where':{'id':_0xdd134[_0xd622('0x44')]['id']}})[_0xd622('0x24')](handleEntityNotFound(_0x229ac5,null))[_0xd622('0x24')](removeEntity(_0x229ac5,null))[_0xd622('0x42')](handleError(_0x229ac5,null));};exports[_0xd622('0x49')]=function(_0x47d81c,_0x1263c6){return db[_0xd622('0x2c')]['describe']()[_0xd622('0x24')](respondWithResult(_0x1263c6,null))[_0xd622('0x42')](handleError(_0x1263c6,null));}; \ No newline at end of file +var _0x0f72=['crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','stack','name','index','map','MailSubstatus','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x22de84,_0x56142b){var _0x54fc49=function(_0x3be7bc){while(--_0x3be7bc){_0x22de84['push'](_0x22de84['shift']());}};_0x54fc49(++_0x56142b);}(_0x0f72,0xcb));var _0x20f7=function(_0x12a9bf,_0x503ded){_0x12a9bf=_0x12a9bf-0x0;var _0x413c15=_0x0f72[_0x12a9bf];return _0x413c15;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x20f7('0x0'));var jsonpatch=require(_0x20f7('0x1'));var rp=require(_0x20f7('0x2'));var moment=require(_0x20f7('0x3'));var BPromise=require(_0x20f7('0x4'));var Mustache=require(_0x20f7('0x5'));var util=require(_0x20f7('0x6'));var path=require(_0x20f7('0x7'));var sox=require(_0x20f7('0x8'));var csv=require(_0x20f7('0x9'));var ejs=require(_0x20f7('0xa'));var fs=require('fs');var fs_extra=require(_0x20f7('0xb'));var _=require(_0x20f7('0xc'));var squel=require('squel');var crypto=require(_0x20f7('0xd'));var jsforce=require(_0x20f7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x20f7('0x9'));var querystring=require(_0x20f7('0xf'));var Papa=require('papaparse');var Redis=require(_0x20f7('0x10'));var authService=require(_0x20f7('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x20f7('0x12'));var logger=require(_0x20f7('0x13'))('api');var utils=require(_0x20f7('0x14'));var config=require(_0x20f7('0x15'));var licenseUtil=require(_0x20f7('0x16'));var db=require(_0x20f7('0x17'))['db'];function respondWithStatusCode(_0x30ed2b,_0x225a28){_0x225a28=_0x225a28||0xcc;return function(_0x530218){if(_0x530218){return _0x30ed2b[_0x20f7('0x18')](_0x225a28);}return _0x30ed2b[_0x20f7('0x19')](_0x225a28)['end']();};}function respondWithResult(_0x24c111,_0x367a23){_0x367a23=_0x367a23||0xc8;return function(_0x5064b0){if(_0x5064b0){return _0x24c111['status'](_0x367a23)[_0x20f7('0x1a')](_0x5064b0);}};}function respondWithFilteredResult(_0x1ba31d,_0x5db90d){return function(_0x4d3121){if(_0x4d3121){var _0x453848=typeof _0x5db90d[_0x20f7('0x1b')]===_0x20f7('0x1c')&&typeof _0x5db90d[_0x20f7('0x1d')]===_0x20f7('0x1c');var _0x407d5b=_0x4d3121['count'];var _0x102cf0=_0x453848?0x0:_0x5db90d['offset'];var _0x36dac8=_0x453848?_0x4d3121[_0x20f7('0x1e')]:_0x5db90d['offset']+_0x5db90d['limit'];var _0x2967fa;if(_0x36dac8>=_0x407d5b){_0x36dac8=_0x407d5b;_0x2967fa=0xc8;}else{_0x2967fa=0xce;}_0x1ba31d[_0x20f7('0x19')](_0x2967fa);return _0x1ba31d[_0x20f7('0x1f')]('Content-Range',_0x102cf0+'-'+_0x36dac8+'/'+_0x407d5b)[_0x20f7('0x1a')](_0x4d3121);}return null;};}function patchUpdates(_0x5536e9){return function(_0x2cc97b){try{jsonpatch[_0x20f7('0x20')](_0x2cc97b,_0x5536e9,!![]);}catch(_0x38b36c){return BPromise[_0x20f7('0x21')](_0x38b36c);}return _0x2cc97b['save']();};}function saveUpdates(_0x3c64f9,_0x70d3bb){return function(_0x23bfd9){if(_0x23bfd9){return _0x23bfd9[_0x20f7('0x22')](_0x3c64f9)[_0x20f7('0x23')](function(_0x49fa93){return _0x49fa93;});}return null;};}function removeEntity(_0x4316c7,_0x2b1c40){return function(_0x3295a8){if(_0x3295a8){return _0x3295a8[_0x20f7('0x24')]()[_0x20f7('0x23')](function(){_0x4316c7[_0x20f7('0x19')](0xcc)[_0x20f7('0x25')]();});}};}function handleEntityNotFound(_0x2e16d3,_0x29fde9){return function(_0xce33dd){if(!_0xce33dd){_0x2e16d3[_0x20f7('0x18')](0x194);}return _0xce33dd;};}function handleError(_0x2dd0da,_0x350cb7){_0x350cb7=_0x350cb7||0x1f4;return function(_0x5c4ef2){logger['error'](_0x5c4ef2[_0x20f7('0x26')]);if(_0x5c4ef2[_0x20f7('0x27')]){delete _0x5c4ef2['name'];}_0x2dd0da[_0x20f7('0x19')](_0x350cb7)['send'](_0x5c4ef2);};}exports[_0x20f7('0x28')]=function(_0x3b4933,_0x43e04f){var _0x3adacd={},_0x1c59fa={},_0x38d24c={'count':0x0,'rows':[]};var _0x441d5e=_[_0x20f7('0x29')](db[_0x20f7('0x2a')]['rawAttributes'],function(_0x5f0365){return{'name':_0x5f0365[_0x20f7('0x2b')],'type':_0x5f0365[_0x20f7('0x2c')][_0x20f7('0x2d')]};});_0x1c59fa[_0x20f7('0x2e')]=_[_0x20f7('0x29')](_0x441d5e,'name');_0x1c59fa[_0x20f7('0x2f')]=_[_0x20f7('0x30')](_0x3b4933[_0x20f7('0x2f')]);_0x1c59fa[_0x20f7('0x31')]=_['intersection'](_0x1c59fa[_0x20f7('0x2e')],_0x1c59fa[_0x20f7('0x2f')]);_0x3adacd['attributes']=_[_0x20f7('0x32')](_0x1c59fa['model'],qs['fields'](_0x3b4933[_0x20f7('0x2f')][_0x20f7('0x33')]));_0x3adacd['attributes']=_0x3adacd[_0x20f7('0x34')][_0x20f7('0x35')]?_0x3adacd[_0x20f7('0x34')]:_0x1c59fa[_0x20f7('0x2e')];if(!_0x3b4933['query'][_0x20f7('0x36')](_0x20f7('0x37'))){_0x3adacd[_0x20f7('0x1d')]=qs[_0x20f7('0x1d')](_0x3b4933['query']['limit']);_0x3adacd[_0x20f7('0x1b')]=qs['offset'](_0x3b4933[_0x20f7('0x2f')][_0x20f7('0x1b')]);}_0x3adacd[_0x20f7('0x38')]=qs[_0x20f7('0x39')](_0x3b4933['query'][_0x20f7('0x39')]);_0x3adacd[_0x20f7('0x3a')]=qs[_0x20f7('0x31')](_['pick'](_0x3b4933['query'],_0x1c59fa['filters']),_0x441d5e);if(_0x3b4933['query']['filter']){_0x3adacd[_0x20f7('0x3a')]=_[_0x20f7('0x3b')](_0x3adacd[_0x20f7('0x3a')],{'$or':_[_0x20f7('0x29')](_0x441d5e,function(_0x21fa6e){if(_0x21fa6e['type']!=='VIRTUAL'){var _0x44a568={};_0x44a568[_0x21fa6e[_0x20f7('0x27')]]={'$like':'%'+_0x3b4933[_0x20f7('0x2f')][_0x20f7('0x3c')]+'%'};return _0x44a568;}})});}_0x3adacd=_[_0x20f7('0x3b')]({},_0x3adacd,_0x3b4933['options']);var _0x444722={'where':_0x3adacd['where']};return db[_0x20f7('0x2a')][_0x20f7('0x1e')](_0x444722)[_0x20f7('0x23')](function(_0x54ac67){_0x38d24c[_0x20f7('0x1e')]=_0x54ac67;if(_0x3b4933[_0x20f7('0x2f')]['includeAll']){_0x3adacd[_0x20f7('0x3d')]=[{'all':!![]}];}return db['MailSubstatus'][_0x20f7('0x3e')](_0x3adacd);})[_0x20f7('0x23')](function(_0x4f615d){_0x38d24c[_0x20f7('0x3f')]=_0x4f615d;return _0x38d24c;})[_0x20f7('0x23')](respondWithFilteredResult(_0x43e04f,_0x3adacd))[_0x20f7('0x40')](handleError(_0x43e04f,null));};exports[_0x20f7('0x41')]=function(_0x23b53f,_0x37ead4){var _0x310149={'raw':!![],'where':{'id':_0x23b53f[_0x20f7('0x42')]['id']}},_0x4b09f7={};_0x4b09f7[_0x20f7('0x2e')]=_[_0x20f7('0x30')](db[_0x20f7('0x2a')][_0x20f7('0x43')]);_0x4b09f7[_0x20f7('0x2f')]=_[_0x20f7('0x30')](_0x23b53f[_0x20f7('0x2f')]);_0x4b09f7[_0x20f7('0x31')]=_[_0x20f7('0x32')](_0x4b09f7[_0x20f7('0x2e')],_0x4b09f7[_0x20f7('0x2f')]);_0x310149[_0x20f7('0x34')]=_[_0x20f7('0x32')](_0x4b09f7[_0x20f7('0x2e')],qs[_0x20f7('0x33')](_0x23b53f[_0x20f7('0x2f')]['fields']));_0x310149[_0x20f7('0x34')]=_0x310149[_0x20f7('0x34')][_0x20f7('0x35')]?_0x310149[_0x20f7('0x34')]:_0x4b09f7[_0x20f7('0x2e')];if(_0x23b53f[_0x20f7('0x2f')]['includeAll']){_0x310149[_0x20f7('0x3d')]=[{'all':!![]}];}_0x310149=_[_0x20f7('0x3b')]({},_0x310149,_0x23b53f['options']);return db['MailSubstatus'][_0x20f7('0x44')](_0x310149)['then'](handleEntityNotFound(_0x37ead4,null))[_0x20f7('0x23')](respondWithResult(_0x37ead4,null))['catch'](handleError(_0x37ead4,null));};exports['create']=function(_0x506071,_0x1f115f){return db['MailSubstatus'][_0x20f7('0x45')](_0x506071[_0x20f7('0x46')],{})[_0x20f7('0x23')](respondWithResult(_0x1f115f,0xc9))['catch'](handleError(_0x1f115f,null));};exports['update']=function(_0x30e2ff,_0x836491){if(_0x30e2ff['body']['id']){delete _0x30e2ff[_0x20f7('0x46')]['id'];}return db[_0x20f7('0x2a')]['find']({'where':{'id':_0x30e2ff[_0x20f7('0x42')]['id']}})[_0x20f7('0x23')](handleEntityNotFound(_0x836491,null))[_0x20f7('0x23')](saveUpdates(_0x30e2ff[_0x20f7('0x46')],null))['then'](respondWithResult(_0x836491,null))['catch'](handleError(_0x836491,null));};exports[_0x20f7('0x24')]=function(_0x59edc5,_0x3e8f0f){return db[_0x20f7('0x2a')][_0x20f7('0x44')]({'where':{'id':_0x59edc5[_0x20f7('0x42')]['id']}})[_0x20f7('0x23')](handleEntityNotFound(_0x3e8f0f,null))['then'](removeEntity(_0x3e8f0f,null))[_0x20f7('0x40')](handleError(_0x3e8f0f,null));};exports[_0x20f7('0x47')]=function(_0xa7d858,_0x854ef4){return db[_0x20f7('0x2a')][_0x20f7('0x47')]()[_0x20f7('0x23')](respondWithResult(_0x854ef4,null))[_0x20f7('0x40')](handleError(_0x854ef4,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 71daa82..4ef1db2 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 _0xb846=['request-promise','../../config/environment','./mailSubstatus.attributes','exports','mail_substatuses','lodash','api','moment','bluebird'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0xb846,0x1d0));var _0x6b84=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xb846[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x6b84('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6b84('0x1'));var moment=require(_0x6b84('0x2'));var BPromise=require(_0x6b84('0x3'));var rp=require(_0x6b84('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6b84('0x5'));var attributes=require(_0x6b84('0x6'));module[_0x6b84('0x7')]=function(_0x3448d0,_0x31856c){return _0x3448d0['define']('MailSubstatus',attributes,{'tableName':_0x6b84('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd4f=['exports','define','MailSubstatus','lodash','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0xb46344,_0x1909b0){_0xb46344=_0xb46344-0x0;var _0x82d37c=_0xdd4f[_0xb46344];return _0x82d37c;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfdd4('0x1'));var BPromise=require(_0xfdd4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdd4('0x3'));var rimraf=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var attributes=require('./mailSubstatus.attributes');module[_0xfdd4('0x6')]=function(_0x43cbcf,_0x30e080){return _0x43cbcf[_0xfdd4('0x7')](_0xfdd4('0x8'),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 29dca48..70e09c7 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 _0xb58b=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird'];(function(_0x215576,_0x2b3b52){var _0x434ebd=function(_0x371e72){while(--_0x371e72){_0x215576['push'](_0x215576['shift']());}};_0x434ebd(++_0x2b3b52);}(_0xb58b,0x1f1));var _0xbb58=function(_0x56387f,_0x46b179){_0x56387f=_0x56387f-0x0;var _0x327d46=_0xb58b[_0x56387f];return _0x327d46;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var moment=require(_0xbb58('0x1'));var BPromise=require(_0xbb58('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb58('0x3'));var db=require(_0xbb58('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb58('0x5'))('rpc');var config=require(_0xbb58('0x6'));var jayson=require(_0xbb58('0x7'));var client=jayson[_0xbb58('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27cbda,_0x323066,_0xe874f2){return new BPromise(function(_0x5d7fe8,_0xd94f1){return client[_0xbb58('0x9')](_0x27cbda,_0xe874f2)[_0xbb58('0xa')](function(_0x36ca50){logger[_0xbb58('0xb')](_0xbb58('0xc'),_0x323066,_0xbb58('0xd'));logger['debug'](_0xbb58('0xe'),_0x323066,'request\x20sent',JSON[_0xbb58('0xf')](_0x36ca50));if(_0x36ca50[_0xbb58('0x10')]){if(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x11')]===0x1f4){logger['error'](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0xd94f1(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}logger[_0xbb58('0x10')](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0x5d7fe8(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x323066,_0xbb58('0xd'));_0x5d7fe8(_0x36ca50[_0xbb58('0x13')][_0xbb58('0x12')]);}})['catch'](function(_0x5edc97){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x323066,_0x5edc97);_0xd94f1(_0x5edc97);});});} \ No newline at end of file +var _0x22fb=['MailSubstatus,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x118edb,_0x3ed3bf){var _0x5ad5c1=function(_0x207733){while(--_0x207733){_0x118edb['push'](_0x118edb['shift']());}};_0x5ad5c1(++_0x3ed3bf);}(_0x22fb,0x192));var _0xb22f=function(_0xffc671,_0xf94d24){_0xffc671=_0xffc671-0x0;var _0x583c90=_0x22fb[_0xffc671];return _0x583c90;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412a95,_0x367d4b,_0x47f61a){return new BPromise(function(_0x34433b,_0x22c509){return client[_0xb22f('0xa')](_0x412a95,_0x47f61a)[_0xb22f('0xb')](function(_0x1a3aae){logger[_0xb22f('0xc')](_0xb22f('0xd'),_0x367d4b,_0xb22f('0xe'));logger[_0xb22f('0xf')](_0xb22f('0x10'),_0x367d4b,_0xb22f('0xe'),JSON['stringify'](_0x1a3aae));if(_0x1a3aae['error']){if(_0x1a3aae['error'][_0xb22f('0x11')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x367d4b,_0x1a3aae['error'][_0xb22f('0x12')]);return _0x22c509(_0x1a3aae[_0xb22f('0x13')][_0xb22f('0x12')]);}logger[_0xb22f('0x13')](_0xb22f('0xd'),_0x367d4b,_0x1a3aae[_0xb22f('0x13')]['message']);return _0x34433b(_0x1a3aae[_0xb22f('0x13')]['message']);}else{logger[_0xb22f('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x367d4b,_0xb22f('0xe'));_0x34433b(_0x1a3aae[_0xb22f('0x14')][_0xb22f('0x12')]);}})[_0xb22f('0x15')](function(_0x447eaf){logger['error'](_0xb22f('0xd'),_0x367d4b,_0x447eaf);_0x22c509(_0x447eaf);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 1bc6226..2350157 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 _0x8d08=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','isAuthenticated','show','post','create','put','delete','/:id'];(function(_0x272427,_0x6ffc68){var _0x30f430=function(_0x1d3710){while(--_0x1d3710){_0x272427['push'](_0x272427['shift']());}};_0x30f430(++_0x6ffc68);}(_0x8d08,0x118));var _0x88d0=function(_0x4dae00,_0x15b194){_0x4dae00=_0x4dae00-0x0;var _0x16bf42=_0x8d08[_0x4dae00];return _0x16bf42;};'use strict';var multer=require(_0x88d0('0x0'));var util=require(_0x88d0('0x1'));var path=require(_0x88d0('0x2'));var timeout=require(_0x88d0('0x3'));var express=require(_0x88d0('0x4'));var router=express[_0x88d0('0x5')]();var fs_extra=require(_0x88d0('0x6'));var auth=require(_0x88d0('0x7'));var interaction=require(_0x88d0('0x8'));var config=require(_0x88d0('0x9'));var controller=require(_0x88d0('0xa'));router[_0x88d0('0xb')]('/',auth['isAuthenticated'](),controller[_0x88d0('0xc')]);router[_0x88d0('0xb')]('/describe',auth[_0x88d0('0xd')](),controller['describe']);router[_0x88d0('0xb')]('/:id',auth[_0x88d0('0xd')](),controller[_0x88d0('0xe')]);router[_0x88d0('0xf')]('/',auth['isAuthenticated'](),controller[_0x88d0('0x10')]);router[_0x88d0('0x11')]('/:id',auth[_0x88d0('0xd')](),controller['update']);router[_0x88d0('0x12')](_0x88d0('0x13'),auth[_0x88d0('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6ae2=['describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','/describe','isAuthenticated'];(function(_0x3383a9,_0x480978){var _0x2ec865=function(_0x5a5cc7){while(--_0x5a5cc7){_0x3383a9['push'](_0x3383a9['shift']());}};_0x2ec865(++_0x480978);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x459820,_0x50202a){_0x459820=_0x459820-0x0;var _0x1d0c05=_0x6ae2[_0x459820];return _0x1d0c05;};'use strict';var multer=require(_0x26ae('0x0'));var util=require(_0x26ae('0x1'));var path=require(_0x26ae('0x2'));var timeout=require(_0x26ae('0x3'));var express=require(_0x26ae('0x4'));var router=express[_0x26ae('0x5')]();var fs_extra=require(_0x26ae('0x6'));var auth=require(_0x26ae('0x7'));var interaction=require(_0x26ae('0x8'));var config=require('../../config/environment');var controller=require(_0x26ae('0x9'));router[_0x26ae('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x26ae('0xa')](_0x26ae('0xb'),auth[_0x26ae('0xc')](),controller[_0x26ae('0xd')]);router[_0x26ae('0xa')](_0x26ae('0xe'),auth[_0x26ae('0xc')](),controller[_0x26ae('0xf')]);router[_0x26ae('0x10')]('/',auth[_0x26ae('0xc')](),controller[_0x26ae('0x11')]);router[_0x26ae('0x12')]('/:id',auth[_0x26ae('0xc')](),controller['update']);router[_0x26ae('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x26ae('0x14')]);module[_0x26ae('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 70aa2c6..11196b2 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 _0xe0ef=['queue','DATE','NOW','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe0ef,0x9c));var _0xfe0e=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe0ef[_0x4e676e];return _0x336a3c;};'use strict';var moment=require('moment');var Sequelize=require(_0xfe0e('0x0'));module[_0xfe0e('0x1')]={'uniqueid':{'type':Sequelize[_0xfe0e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfe0e('0x3')](_0xfe0e('0x4'),_0xfe0e('0x5'),_0xfe0e('0x6')),'allowNull':![],'defaultValue':_0xfe0e('0x6')},'transferredAt':{'type':Sequelize[_0xfe0e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xfe0e('0x8')]}}; \ No newline at end of file +var _0xab97=['account','queue','moment','sequelize','STRING'];(function(_0x29794b,_0x17e57e){var _0x38f6cf=function(_0x256136){while(--_0x256136){_0x29794b['push'](_0x29794b['shift']());}};_0x38f6cf(++_0x17e57e);}(_0xab97,0x1c9));var _0x7ab9=function(_0x54effc,_0x2c57d0){_0x54effc=_0x54effc-0x0;var _0x55fca9=_0xab97[_0x54effc];return _0x55fca9;};'use strict';var moment=require(_0x7ab9('0x0'));var Sequelize=require(_0x7ab9('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x7ab9('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7ab9('0x3'),'agent',_0x7ab9('0x4')),'allowNull':![],'defaultValue':_0x7ab9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index bba335a..e63525c 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 _0x7f0d=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','end','error','stack','name','send','index','map','MailTransferReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','rows','catch','show','rawAttributes','includeAll','find','create','body','destroy','params','describe','eml-format'];(function(_0x6148ee,_0x4d2fca){var _0x5afc74=function(_0x351621){while(--_0x351621){_0x6148ee['push'](_0x6148ee['shift']());}};_0x5afc74(++_0x4d2fca);}(_0x7f0d,0x13b));var _0xd7f0=function(_0x350892,_0x43c6bd){_0x350892=_0x350892-0x0;var _0x1828c6=_0x7f0d[_0x350892];return _0x1828c6;};'use strict';var emlformat=require(_0xd7f0('0x0'));var rimraf=require(_0xd7f0('0x1'));var zipdir=require(_0xd7f0('0x2'));var jsonpatch=require(_0xd7f0('0x3'));var rp=require('request-promise');var moment=require(_0xd7f0('0x4'));var BPromise=require(_0xd7f0('0x5'));var Mustache=require(_0xd7f0('0x6'));var util=require(_0xd7f0('0x7'));var path=require(_0xd7f0('0x8'));var sox=require(_0xd7f0('0x9'));var csv=require(_0xd7f0('0xa'));var ejs=require(_0xd7f0('0xb'));var fs=require('fs');var fs_extra=require(_0xd7f0('0xc'));var _=require(_0xd7f0('0xd'));var squel=require('squel');var crypto=require(_0xd7f0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd7f0('0xf'));var toCsv=require(_0xd7f0('0xa'));var querystring=require(_0xd7f0('0x10'));var Papa=require(_0xd7f0('0x11'));var Redis=require('ioredis');var authService=require(_0xd7f0('0x12'));var qs=require(_0xd7f0('0x13'));var as=require(_0xd7f0('0x14'));var hardwareService=require(_0xd7f0('0x15'));var logger=require(_0xd7f0('0x16'))(_0xd7f0('0x17'));var utils=require(_0xd7f0('0x18'));var config=require(_0xd7f0('0x19'));var licenseUtil=require(_0xd7f0('0x1a'));var db=require(_0xd7f0('0x1b'))['db'];function respondWithStatusCode(_0x4b7688,_0x2ab659){_0x2ab659=_0x2ab659||0xcc;return function(_0x24a350){if(_0x24a350){return _0x4b7688[_0xd7f0('0x1c')](_0x2ab659);}return _0x4b7688[_0xd7f0('0x1d')](_0x2ab659)['end']();};}function respondWithResult(_0x9605dd,_0x140cdd){_0x140cdd=_0x140cdd||0xc8;return function(_0x54ca5b){if(_0x54ca5b){return _0x9605dd[_0xd7f0('0x1d')](_0x140cdd)['json'](_0x54ca5b);}};}function respondWithFilteredResult(_0x676cba,_0x4f80d4){return function(_0x53df22){if(_0x53df22){var _0x2d9fec=typeof _0x4f80d4[_0xd7f0('0x1e')]===_0xd7f0('0x1f')&&typeof _0x4f80d4[_0xd7f0('0x20')]===_0xd7f0('0x1f');var _0x52fac7=_0x53df22['count'];var _0x351696=_0x2d9fec?0x0:_0x4f80d4[_0xd7f0('0x1e')];var _0x2ffdd1=_0x2d9fec?_0x53df22[_0xd7f0('0x21')]:_0x4f80d4[_0xd7f0('0x1e')]+_0x4f80d4[_0xd7f0('0x20')];var _0x3a0fa6;if(_0x2ffdd1>=_0x52fac7){_0x2ffdd1=_0x52fac7;_0x3a0fa6=0xc8;}else{_0x3a0fa6=0xce;}_0x676cba[_0xd7f0('0x1d')](_0x3a0fa6);return _0x676cba[_0xd7f0('0x22')]('Content-Range',_0x351696+'-'+_0x2ffdd1+'/'+_0x52fac7)[_0xd7f0('0x23')](_0x53df22);}return null;};}function patchUpdates(_0x34f290){return function(_0x11ee13){try{jsonpatch[_0xd7f0('0x24')](_0x11ee13,_0x34f290,!![]);}catch(_0x22399a){return BPromise[_0xd7f0('0x25')](_0x22399a);}return _0x11ee13[_0xd7f0('0x26')]();};}function saveUpdates(_0x4ce722,_0x168fa0){return function(_0x28c04d){if(_0x28c04d){return _0x28c04d[_0xd7f0('0x27')](_0x4ce722)[_0xd7f0('0x28')](function(_0x58953a){return _0x58953a;});}return null;};}function removeEntity(_0x2894ee,_0x44a8c5){return function(_0x856023){if(_0x856023){return _0x856023['destroy']()[_0xd7f0('0x28')](function(){_0x2894ee[_0xd7f0('0x1d')](0xcc)[_0xd7f0('0x29')]();});}};}function handleEntityNotFound(_0x2a898a,_0xfba7a3){return function(_0x2f6d70){if(!_0x2f6d70){_0x2a898a['sendStatus'](0x194);}return _0x2f6d70;};}function handleError(_0x1566af,_0x8d152d){_0x8d152d=_0x8d152d||0x1f4;return function(_0x281d6c){logger[_0xd7f0('0x2a')](_0x281d6c[_0xd7f0('0x2b')]);if(_0x281d6c[_0xd7f0('0x2c')]){delete _0x281d6c[_0xd7f0('0x2c')];}_0x1566af[_0xd7f0('0x1d')](_0x8d152d)[_0xd7f0('0x2d')](_0x281d6c);};}exports[_0xd7f0('0x2e')]=function(_0x54719e,_0x58f35c){var _0x535391={},_0x160048={},_0xdb1f23={'count':0x0,'rows':[]};var _0x161244=_[_0xd7f0('0x2f')](db[_0xd7f0('0x30')]['rawAttributes'],function(_0x2d987b){return{'name':_0x2d987b[_0xd7f0('0x31')],'type':_0x2d987b[_0xd7f0('0x32')]['key']};});_0x160048[_0xd7f0('0x33')]=_[_0xd7f0('0x2f')](_0x161244,_0xd7f0('0x2c'));_0x160048[_0xd7f0('0x34')]=_[_0xd7f0('0x35')](_0x54719e[_0xd7f0('0x34')]);_0x160048[_0xd7f0('0x36')]=_[_0xd7f0('0x37')](_0x160048[_0xd7f0('0x33')],_0x160048[_0xd7f0('0x34')]);_0x535391[_0xd7f0('0x38')]=_[_0xd7f0('0x37')](_0x160048[_0xd7f0('0x33')],qs[_0xd7f0('0x39')](_0x54719e[_0xd7f0('0x34')][_0xd7f0('0x39')]));_0x535391[_0xd7f0('0x38')]=_0x535391[_0xd7f0('0x38')][_0xd7f0('0x3a')]?_0x535391[_0xd7f0('0x38')]:_0x160048[_0xd7f0('0x33')];if(!_0x54719e[_0xd7f0('0x34')][_0xd7f0('0x3b')](_0xd7f0('0x3c'))){_0x535391['limit']=qs[_0xd7f0('0x20')](_0x54719e[_0xd7f0('0x34')][_0xd7f0('0x20')]);_0x535391[_0xd7f0('0x1e')]=qs[_0xd7f0('0x1e')](_0x54719e[_0xd7f0('0x34')][_0xd7f0('0x1e')]);}_0x535391[_0xd7f0('0x3d')]=qs['sort'](_0x54719e['query'][_0xd7f0('0x3e')]);_0x535391[_0xd7f0('0x3f')]=qs[_0xd7f0('0x36')](_['pick'](_0x54719e[_0xd7f0('0x34')],_0x160048[_0xd7f0('0x36')]),_0x161244);if(_0x54719e[_0xd7f0('0x34')][_0xd7f0('0x40')]){_0x535391['where']=_[_0xd7f0('0x41')](_0x535391['where'],{'$or':_['map'](_0x161244,function(_0x254b60){if(_0x254b60['type']!=='VIRTUAL'){var _0x51caac={};_0x51caac[_0x254b60[_0xd7f0('0x2c')]]={'$like':'%'+_0x54719e[_0xd7f0('0x34')][_0xd7f0('0x40')]+'%'};return _0x51caac;}})});}_0x535391=_[_0xd7f0('0x41')]({},_0x535391,_0x54719e[_0xd7f0('0x42')]);var _0x1fd5d8={'where':_0x535391[_0xd7f0('0x3f')]};return db[_0xd7f0('0x30')]['count'](_0x1fd5d8)['then'](function(_0xe70e86){_0xdb1f23[_0xd7f0('0x21')]=_0xe70e86;if(_0x54719e['query']['includeAll']){_0x535391[_0xd7f0('0x43')]=[{'all':!![]}];}return db[_0xd7f0('0x30')]['findAll'](_0x535391);})[_0xd7f0('0x28')](function(_0x2aa22f){_0xdb1f23[_0xd7f0('0x44')]=_0x2aa22f;return _0xdb1f23;})[_0xd7f0('0x28')](respondWithFilteredResult(_0x58f35c,_0x535391))[_0xd7f0('0x45')](handleError(_0x58f35c,null));};exports[_0xd7f0('0x46')]=function(_0x29e8a3,_0x5f2481){var _0x2e3012={'raw':!![],'where':{'id':_0x29e8a3['params']['id']}},_0x31818b={};_0x31818b[_0xd7f0('0x33')]=_[_0xd7f0('0x35')](db[_0xd7f0('0x30')][_0xd7f0('0x47')]);_0x31818b[_0xd7f0('0x34')]=_[_0xd7f0('0x35')](_0x29e8a3[_0xd7f0('0x34')]);_0x31818b[_0xd7f0('0x36')]=_['intersection'](_0x31818b[_0xd7f0('0x33')],_0x31818b[_0xd7f0('0x34')]);_0x2e3012[_0xd7f0('0x38')]=_[_0xd7f0('0x37')](_0x31818b['model'],qs[_0xd7f0('0x39')](_0x29e8a3[_0xd7f0('0x34')][_0xd7f0('0x39')]));_0x2e3012[_0xd7f0('0x38')]=_0x2e3012[_0xd7f0('0x38')][_0xd7f0('0x3a')]?_0x2e3012[_0xd7f0('0x38')]:_0x31818b[_0xd7f0('0x33')];if(_0x29e8a3[_0xd7f0('0x34')][_0xd7f0('0x48')]){_0x2e3012[_0xd7f0('0x43')]=[{'all':!![]}];}_0x2e3012=_['merge']({},_0x2e3012,_0x29e8a3[_0xd7f0('0x42')]);return db[_0xd7f0('0x30')][_0xd7f0('0x49')](_0x2e3012)[_0xd7f0('0x28')](handleEntityNotFound(_0x5f2481,null))['then'](respondWithResult(_0x5f2481,null))[_0xd7f0('0x45')](handleError(_0x5f2481,null));};exports[_0xd7f0('0x4a')]=function(_0x59ec16,_0x2f662b){return db[_0xd7f0('0x30')]['create'](_0x59ec16['body'],{})['then'](respondWithResult(_0x2f662b,0xc9))[_0xd7f0('0x45')](handleError(_0x2f662b,null));};exports[_0xd7f0('0x27')]=function(_0x30cc5a,_0x3647de){if(_0x30cc5a[_0xd7f0('0x4b')]['id']){delete _0x30cc5a[_0xd7f0('0x4b')]['id'];}return db['MailTransferReport'][_0xd7f0('0x49')]({'where':{'id':_0x30cc5a['params']['id']}})[_0xd7f0('0x28')](handleEntityNotFound(_0x3647de,null))[_0xd7f0('0x28')](saveUpdates(_0x30cc5a[_0xd7f0('0x4b')],null))[_0xd7f0('0x28')](respondWithResult(_0x3647de,null))['catch'](handleError(_0x3647de,null));};exports[_0xd7f0('0x4c')]=function(_0x22459b,_0x46a712){return db[_0xd7f0('0x30')][_0xd7f0('0x49')]({'where':{'id':_0x22459b[_0xd7f0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x46a712,null))[_0xd7f0('0x28')](removeEntity(_0x46a712,null))[_0xd7f0('0x45')](handleError(_0x46a712,null));};exports[_0xd7f0('0x4e')]=function(_0x55ae29,_0x49dc9b){return db['MailTransferReport'][_0xd7f0('0x4e')]()[_0xd7f0('0x28')](respondWithResult(_0x49dc9b,null))[_0xd7f0('0x45')](handleError(_0x49dc9b,null));}; \ No newline at end of file +var _0xfeaf=['squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','end','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','sendStatus','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','include','findAll','rows','show','params','includeAll','options','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x3ce0d5,_0x203024){var _0x2e5731=function(_0x4be620){while(--_0x4be620){_0x3ce0d5['push'](_0x3ce0d5['shift']());}};_0x2e5731(++_0x203024);}(_0xfeaf,0x81));var _0xffea=function(_0x138147,_0x2f95b8){_0x138147=_0x138147-0x0;var _0x57870c=_0xfeaf[_0x138147];return _0x57870c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xffea('0x0'));var zipdir=require(_0xffea('0x1'));var jsonpatch=require(_0xffea('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xffea('0x3'));var Mustache=require(_0xffea('0x4'));var util=require(_0xffea('0x5'));var path=require(_0xffea('0x6'));var sox=require('sox');var csv=require(_0xffea('0x7'));var ejs=require(_0xffea('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xffea('0x9'));var crypto=require('crypto');var jsforce=require(_0xffea('0xa'));var deskjs=require(_0xffea('0xb'));var toCsv=require(_0xffea('0x7'));var querystring=require(_0xffea('0xc'));var Papa=require(_0xffea('0xd'));var Redis=require('ioredis');var authService=require(_0xffea('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xffea('0xf'));var hardwareService=require(_0xffea('0x10'));var logger=require('../../config/logger')(_0xffea('0x11'));var utils=require(_0xffea('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1952a8,_0x59d0cf){_0x59d0cf=_0x59d0cf||0xcc;return function(_0xf99383){if(_0xf99383){return _0x1952a8['sendStatus'](_0x59d0cf);}return _0x1952a8['status'](_0x59d0cf)[_0xffea('0x13')]();};}function respondWithResult(_0x4eb574,_0x2f8d36){_0x2f8d36=_0x2f8d36||0xc8;return function(_0x689749){if(_0x689749){return _0x4eb574[_0xffea('0x14')](_0x2f8d36)[_0xffea('0x15')](_0x689749);}};}function respondWithFilteredResult(_0x5f4548,_0x4322b7){return function(_0x474a81){if(_0x474a81){var _0x2eedfa=typeof _0x4322b7[_0xffea('0x16')]===_0xffea('0x17')&&typeof _0x4322b7[_0xffea('0x18')]==='undefined';var _0x586dbb=_0x474a81[_0xffea('0x19')];var _0xf7c8f=_0x2eedfa?0x0:_0x4322b7[_0xffea('0x16')];var _0x71c9dd=_0x2eedfa?_0x474a81['count']:_0x4322b7['offset']+_0x4322b7['limit'];var _0x76fc68;if(_0x71c9dd>=_0x586dbb){_0x71c9dd=_0x586dbb;_0x76fc68=0xc8;}else{_0x76fc68=0xce;}_0x5f4548['status'](_0x76fc68);return _0x5f4548['set'](_0xffea('0x1a'),_0xf7c8f+'-'+_0x71c9dd+'/'+_0x586dbb)[_0xffea('0x15')](_0x474a81);}return null;};}function patchUpdates(_0x639946){return function(_0x34202a){try{jsonpatch['apply'](_0x34202a,_0x639946,!![]);}catch(_0x2053ba){return BPromise['reject'](_0x2053ba);}return _0x34202a[_0xffea('0x1b')]();};}function saveUpdates(_0x40f995,_0x30d57c){return function(_0x39f0dd){if(_0x39f0dd){return _0x39f0dd[_0xffea('0x1c')](_0x40f995)[_0xffea('0x1d')](function(_0x476c9f){return _0x476c9f;});}return null;};}function removeEntity(_0x16e964,_0x4ea6b6){return function(_0x1d7fba){if(_0x1d7fba){return _0x1d7fba[_0xffea('0x1e')]()[_0xffea('0x1d')](function(){_0x16e964[_0xffea('0x14')](0xcc)[_0xffea('0x13')]();});}};}function handleEntityNotFound(_0xca9090,_0x532c6b){return function(_0x502e0d){if(!_0x502e0d){_0xca9090[_0xffea('0x1f')](0x194);}return _0x502e0d;};}function handleError(_0x581457,_0xa571f6){_0xa571f6=_0xa571f6||0x1f4;return function(_0x396bfe){logger['error'](_0x396bfe['stack']);if(_0x396bfe[_0xffea('0x20')]){delete _0x396bfe['name'];}_0x581457[_0xffea('0x14')](_0xa571f6)[_0xffea('0x21')](_0x396bfe);};}exports[_0xffea('0x22')]=function(_0x1caf87,_0x293e6a){var _0x30166f={},_0x5aa024={},_0x558e67={'count':0x0,'rows':[]};var _0xd147fa=_[_0xffea('0x23')](db[_0xffea('0x24')][_0xffea('0x25')],function(_0x2054f8){return{'name':_0x2054f8[_0xffea('0x26')],'type':_0x2054f8[_0xffea('0x27')]['key']};});_0x5aa024[_0xffea('0x28')]=_[_0xffea('0x23')](_0xd147fa,'name');_0x5aa024['query']=_[_0xffea('0x29')](_0x1caf87[_0xffea('0x2a')]);_0x5aa024['filters']=_[_0xffea('0x2b')](_0x5aa024[_0xffea('0x28')],_0x5aa024['query']);_0x30166f[_0xffea('0x2c')]=_['intersection'](_0x5aa024['model'],qs[_0xffea('0x2d')](_0x1caf87['query'][_0xffea('0x2d')]));_0x30166f[_0xffea('0x2c')]=_0x30166f['attributes'][_0xffea('0x2e')]?_0x30166f['attributes']:_0x5aa024[_0xffea('0x28')];if(!_0x1caf87[_0xffea('0x2a')][_0xffea('0x2f')](_0xffea('0x30'))){_0x30166f['limit']=qs[_0xffea('0x18')](_0x1caf87[_0xffea('0x2a')][_0xffea('0x18')]);_0x30166f[_0xffea('0x16')]=qs[_0xffea('0x16')](_0x1caf87[_0xffea('0x2a')][_0xffea('0x16')]);}_0x30166f[_0xffea('0x31')]=qs[_0xffea('0x32')](_0x1caf87['query'][_0xffea('0x32')]);_0x30166f[_0xffea('0x33')]=qs['filters'](_[_0xffea('0x34')](_0x1caf87[_0xffea('0x2a')],_0x5aa024[_0xffea('0x35')]),_0xd147fa);if(_0x1caf87[_0xffea('0x2a')]['filter']){_0x30166f[_0xffea('0x33')]=_[_0xffea('0x36')](_0x30166f[_0xffea('0x33')],{'$or':_[_0xffea('0x23')](_0xd147fa,function(_0x545386){if(_0x545386[_0xffea('0x27')]!==_0xffea('0x37')){var _0x528bf8={};_0x528bf8[_0x545386['name']]={'$like':'%'+_0x1caf87[_0xffea('0x2a')][_0xffea('0x38')]+'%'};return _0x528bf8;}})});}_0x30166f=_['merge']({},_0x30166f,_0x1caf87['options']);var _0x338fd0={'where':_0x30166f['where']};return db[_0xffea('0x24')][_0xffea('0x19')](_0x338fd0)[_0xffea('0x1d')](function(_0x3479c0){_0x558e67[_0xffea('0x19')]=_0x3479c0;if(_0x1caf87[_0xffea('0x2a')]['includeAll']){_0x30166f[_0xffea('0x39')]=[{'all':!![]}];}return db['MailTransferReport'][_0xffea('0x3a')](_0x30166f);})[_0xffea('0x1d')](function(_0x23ffee){_0x558e67[_0xffea('0x3b')]=_0x23ffee;return _0x558e67;})['then'](respondWithFilteredResult(_0x293e6a,_0x30166f))['catch'](handleError(_0x293e6a,null));};exports[_0xffea('0x3c')]=function(_0x1b811a,_0x43ad26){var _0x564b63={'raw':!![],'where':{'id':_0x1b811a[_0xffea('0x3d')]['id']}},_0x31e36f={};_0x31e36f[_0xffea('0x28')]=_['keys'](db['MailTransferReport']['rawAttributes']);_0x31e36f[_0xffea('0x2a')]=_[_0xffea('0x29')](_0x1b811a[_0xffea('0x2a')]);_0x31e36f[_0xffea('0x35')]=_[_0xffea('0x2b')](_0x31e36f[_0xffea('0x28')],_0x31e36f[_0xffea('0x2a')]);_0x564b63[_0xffea('0x2c')]=_[_0xffea('0x2b')](_0x31e36f[_0xffea('0x28')],qs['fields'](_0x1b811a[_0xffea('0x2a')][_0xffea('0x2d')]));_0x564b63[_0xffea('0x2c')]=_0x564b63[_0xffea('0x2c')][_0xffea('0x2e')]?_0x564b63['attributes']:_0x31e36f['model'];if(_0x1b811a[_0xffea('0x2a')][_0xffea('0x3e')]){_0x564b63[_0xffea('0x39')]=[{'all':!![]}];}_0x564b63=_[_0xffea('0x36')]({},_0x564b63,_0x1b811a[_0xffea('0x3f')]);return db[_0xffea('0x24')][_0xffea('0x40')](_0x564b63)['then'](handleEntityNotFound(_0x43ad26,null))['then'](respondWithResult(_0x43ad26,null))[_0xffea('0x41')](handleError(_0x43ad26,null));};exports[_0xffea('0x42')]=function(_0x9edcbb,_0x17213b){return db['MailTransferReport']['create'](_0x9edcbb['body'],{})['then'](respondWithResult(_0x17213b,0xc9))[_0xffea('0x41')](handleError(_0x17213b,null));};exports['update']=function(_0x46a0b2,_0x36e8f5){if(_0x46a0b2['body']['id']){delete _0x46a0b2[_0xffea('0x43')]['id'];}return db['MailTransferReport'][_0xffea('0x40')]({'where':{'id':_0x46a0b2['params']['id']}})[_0xffea('0x1d')](handleEntityNotFound(_0x36e8f5,null))[_0xffea('0x1d')](saveUpdates(_0x46a0b2['body'],null))['then'](respondWithResult(_0x36e8f5,null))[_0xffea('0x41')](handleError(_0x36e8f5,null));};exports[_0xffea('0x1e')]=function(_0x4abae7,_0x5bb232){return db['MailTransferReport'][_0xffea('0x40')]({'where':{'id':_0x4abae7[_0xffea('0x3d')]['id']}})[_0xffea('0x1d')](handleEntityNotFound(_0x5bb232,null))['then'](removeEntity(_0x5bb232,null))[_0xffea('0x41')](handleError(_0x5bb232,null));};exports[_0xffea('0x44')]=function(_0x87f951,_0x1e778f){return db['MailTransferReport'][_0xffea('0x44')]()[_0xffea('0x1d')](respondWithResult(_0x1e778f,null))[_0xffea('0x41')](handleError(_0x1e778f,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 811c434..aa0873f 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 _0x576c=['report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport'];(function(_0x60739a,_0x2308ef){var _0x540fe6=function(_0x330f64){while(--_0x330f64){_0x60739a['push'](_0x60739a['shift']());}};_0x540fe6(++_0x2308ef);}(_0x576c,0x1c9));var _0xc576=function(_0x1a455c,_0x3e182c){_0x1a455c=_0x1a455c-0x0;var _0x5d5a35=_0x576c[_0x1a455c];return _0x5d5a35;};'use strict';var _=require(_0xc576('0x0'));var util=require(_0xc576('0x1'));var logger=require(_0xc576('0x2'))(_0xc576('0x3'));var moment=require(_0xc576('0x4'));var BPromise=require('bluebird');var rp=require(_0xc576('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc576('0x6'));var config=require(_0xc576('0x7'));var attributes=require(_0xc576('0x8'));module['exports']=function(_0x1894eb,_0x1a88ce){return _0x1894eb[_0xc576('0x9')](_0xc576('0xa'),attributes,{'tableName':_0xc576('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc576('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3b0a=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x1008f0,_0x1d32bb){var _0x423ac5=function(_0x25b44d){while(--_0x25b44d){_0x1008f0['push'](_0x1008f0['shift']());}};_0x423ac5(++_0x1d32bb);}(_0x3b0a,0xa9));var _0xa3b0=function(_0x121652,_0x35ccd9){_0x121652=_0x121652-0x0;var _0x4469d9=_0x3b0a[_0x121652];return _0x4469d9;};'use strict';var _=require('lodash');var util=require(_0xa3b0('0x0'));var logger=require(_0xa3b0('0x1'))(_0xa3b0('0x2'));var moment=require(_0xa3b0('0x3'));var BPromise=require(_0xa3b0('0x4'));var rp=require(_0xa3b0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa3b0('0x6'));var config=require(_0xa3b0('0x7'));var attributes=require(_0xa3b0('0x8'));module['exports']=function(_0x29863f,_0x4446db){return _0x29863f[_0xa3b0('0x9')](_0xa3b0('0xa'),attributes,{'tableName':_0xa3b0('0xb'),'paranoid':![],'indexes':[{'name':_0xa3b0('0xc'),'fields':[_0xa3b0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 9861205..2c385c7 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 _0x7c74=['catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x505378,_0x209853){var _0x260405=function(_0x3bbd18){while(--_0x3bbd18){_0x505378['push'](_0x505378['shift']());}};_0x260405(++_0x209853);}(_0x7c74,0x191));var _0x47c7=function(_0x151553,_0x295f9c){_0x151553=_0x151553-0x0;var _0x1a0ad6=_0x7c74[_0x151553];return _0x1a0ad6;};'use strict';var _=require(_0x47c7('0x0'));var util=require('util');var moment=require(_0x47c7('0x1'));var BPromise=require(_0x47c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x47c7('0x3'));var logger=require(_0x47c7('0x4'))(_0x47c7('0x5'));var config=require(_0x47c7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x47c7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x157227,_0x26bf36,_0x500cbf){return new BPromise(function(_0x4826b2,_0x383d58){return client[_0x47c7('0x8')](_0x157227,_0x500cbf)[_0x47c7('0x9')](function(_0x24af63){logger[_0x47c7('0xa')](_0x47c7('0xb'),_0x26bf36,'request\x20sent');logger[_0x47c7('0xc')](_0x47c7('0xd'),_0x26bf36,_0x47c7('0xe'),JSON[_0x47c7('0xf')](_0x24af63));if(_0x24af63['error']){if(_0x24af63[_0x47c7('0x10')]['code']===0x1f4){logger[_0x47c7('0x10')](_0x47c7('0xb'),_0x26bf36,_0x24af63['error'][_0x47c7('0x11')]);return _0x383d58(_0x24af63[_0x47c7('0x10')]['message']);}logger[_0x47c7('0x10')](_0x47c7('0xb'),_0x26bf36,_0x24af63[_0x47c7('0x10')][_0x47c7('0x11')]);return _0x4826b2(_0x24af63['error'][_0x47c7('0x11')]);}else{logger[_0x47c7('0xa')](_0x47c7('0xb'),_0x26bf36,'request\x20sent');_0x4826b2(_0x24af63[_0x47c7('0x12')][_0x47c7('0x11')]);}})[_0x47c7('0x13')](function(_0x2f4eb7){logger[_0x47c7('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x26bf36,_0x2f4eb7);_0x383d58(_0x2f4eb7);});});} \ No newline at end of file +var _0x3629=['error','code','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x3629,0x1a8));var _0x9362=function(_0x5d28a3,_0x39fbb5){_0x5d28a3=_0x5d28a3-0x0;var _0x4141f2=_0x3629[_0x5d28a3];return _0x4141f2;};'use strict';var _=require(_0x9362('0x0'));var util=require('util');var moment=require(_0x9362('0x1'));var BPromise=require('bluebird');var rs=require(_0x9362('0x2'));var fs=require('fs');var Redis=require(_0x9362('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9362('0x4'));var logger=require(_0x9362('0x5'))(_0x9362('0x6'));var config=require(_0x9362('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9362('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x322218,_0x424e63,_0x56f686){return new BPromise(function(_0x40f9b0,_0x5c1c57){return client[_0x9362('0x9')](_0x322218,_0x56f686)[_0x9362('0xa')](function(_0x2338a0){logger[_0x9362('0xb')](_0x9362('0xc'),_0x424e63,'request\x20sent');logger[_0x9362('0xd')](_0x9362('0xe'),_0x424e63,'request\x20sent',JSON[_0x9362('0xf')](_0x2338a0));if(_0x2338a0['error']){if(_0x2338a0[_0x9362('0x10')][_0x9362('0x11')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x424e63,_0x2338a0['error'][_0x9362('0x12')]);return _0x5c1c57(_0x2338a0['error'][_0x9362('0x12')]);}logger[_0x9362('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x424e63,_0x2338a0[_0x9362('0x10')][_0x9362('0x12')]);return _0x40f9b0(_0x2338a0['error'][_0x9362('0x12')]);}else{logger[_0x9362('0xb')](_0x9362('0xc'),_0x424e63,_0x9362('0x13'));_0x40f9b0(_0x2338a0[_0x9362('0x14')]['message']);}})[_0x9362('0x15')](function(_0x146abd){logger['error'](_0x9362('0xc'),_0x424e63,_0x146abd);_0x5c1c57(_0x146abd);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a823f66..9f566b7 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 _0x933c=['get','isAuthenticated','describe','show','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x933c,0x99));var _0xc933=function(_0x1ec355,_0x312bb4){_0x1ec355=_0x1ec355-0x0;var _0x13fdd8=_0x933c[_0x1ec355];return _0x13fdd8;};'use strict';var multer=require(_0xc933('0x0'));var util=require(_0xc933('0x1'));var path=require(_0xc933('0x2'));var timeout=require(_0xc933('0x3'));var express=require(_0xc933('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc933('0x5'));var interaction=require(_0xc933('0x6'));var config=require(_0xc933('0x7'));var controller=require(_0xc933('0x8'));router[_0xc933('0x9')]('/',auth[_0xc933('0xa')](),controller['index']);router[_0xc933('0x9')]('/describe',auth[_0xc933('0xa')](),controller[_0xc933('0xb')]);router['get']('/:id',auth[_0xc933('0xa')](),controller[_0xc933('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc933('0xd')]);router[_0xc933('0xe')](_0xc933('0xf'),auth[_0xc933('0xa')](),controller[_0xc933('0x10')]);router[_0xc933('0x11')](_0xc933('0xf'),auth[_0xc933('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x741a=['put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4c1d95,_0x5879a6){var _0x2c1b32=function(_0x4003c3){while(--_0x4003c3){_0x4c1d95['push'](_0x4c1d95['shift']());}};_0x2c1b32(++_0x5879a6);}(_0x741a,0x7b));var _0xa741=function(_0x1cf164,_0x787a72){_0x1cf164=_0x1cf164-0x0;var _0x122c73=_0x741a[_0x1cf164];return _0x122c73;};'use strict';var multer=require(_0xa741('0x0'));var util=require(_0xa741('0x1'));var path=require(_0xa741('0x2'));var timeout=require(_0xa741('0x3'));var express=require('express');var router=express[_0xa741('0x4')]();var fs_extra=require(_0xa741('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa741('0x6'));router[_0xa741('0x7')]('/',auth[_0xa741('0x8')](),controller[_0xa741('0x9')]);router[_0xa741('0x7')](_0xa741('0xa'),auth[_0xa741('0x8')](),controller[_0xa741('0xb')]);router[_0xa741('0x7')](_0xa741('0xc'),auth[_0xa741('0x8')](),controller['show']);router['post']('/',auth[_0xa741('0x8')](),controller['create']);router[_0xa741('0xd')](_0xa741('0xc'),auth[_0xa741('0x8')](),controller[_0xa741('0xe')]);router[_0xa741('0xf')]('/:id',auth[_0xa741('0x8')](),controller[_0xa741('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 5599a0c..ab1b8c3 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 _0x5006=['DATE','getDataValue','enterAt','diff','seconds','exitAt','setDataValue','duration','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','INTEGER'];(function(_0x1353ae,_0x2abba7){var _0x4ae816=function(_0x5cea92){while(--_0x5cea92){_0x1353ae['push'](_0x1353ae['shift']());}};_0x4ae816(++_0x2abba7);}(_0x5006,0x13b));var _0x6500=function(_0x1d398f,_0x5d77ab){_0x1d398f=_0x1d398f-0x0;var _0x55553b=_0x5006[_0x1d398f];return _0x55553b;};'use strict';var Sequelize=require(_0x6500('0x0'));var moment=require(_0x6500('0x1'));module[_0x6500('0x2')]={'channel':{'type':Sequelize[_0x6500('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x6500('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x6500('0x4')]},'enterAt':{'type':Sequelize[_0x6500('0x5')]},'exitAt':{'type':Sequelize[_0x6500('0x5')],'set':function(_0x5a16e8){var _0x279aea=moment(_0x5a16e8);var _0x147b96=moment(this[_0x6500('0x6')](_0x6500('0x7')));var _0xbdfd53=_0x279aea[_0x6500('0x8')](_0x147b96,_0x6500('0x9'));this['setDataValue'](_0x6500('0xa'),_0x5a16e8);this[_0x6500('0xb')](_0x6500('0xc'),_0xbdfd53||null);}},'data1':{'type':Sequelize[_0x6500('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0x6500('0xd')},'data3':{'type':Sequelize[_0x6500('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x6500('0xe')},'data5':{'type':Sequelize[_0x6500('0x3')],'comment':_0x6500('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x6500('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcd0d=['exitAt','duration','talk:[start]','talk:[dial\x20string]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue'];(function(_0x2183bb,_0x582b4f){var _0x501e49=function(_0x52761d){while(--_0x52761d){_0x2183bb['push'](_0x2183bb['shift']());}};_0x501e49(++_0x582b4f);}(_0xcd0d,0x17a));var _0xdcd0=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xcd0d[_0x28d18d];return _0x470640;};'use strict';var Sequelize=require(_0xdcd0('0x0'));var moment=require(_0xdcd0('0x1'));module[_0xdcd0('0x2')]={'channel':{'type':Sequelize[_0xdcd0('0x3')]},'membername':{'type':Sequelize[_0xdcd0('0x3')]},'interface':{'type':Sequelize[_0xdcd0('0x3')]},'type':{'type':Sequelize[_0xdcd0('0x3')],'defaultValue':_0xdcd0('0x4'),'comment':_0xdcd0('0x5')},'duration':{'type':Sequelize[_0xdcd0('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xdcd0('0x7')],'set':function(_0x60ef6c){var _0x3442ae=moment(_0x60ef6c);var _0x47f2d6=moment(this[_0xdcd0('0x8')](_0xdcd0('0x9')));var _0x3b9937=_0x3442ae[_0xdcd0('0xa')](_0x47f2d6,_0xdcd0('0xb'));this[_0xdcd0('0xc')](_0xdcd0('0xd'),_0x60ef6c);this[_0xdcd0('0xc')](_0xdcd0('0xe'),_0x3b9937||null);}},'data1':{'type':Sequelize[_0xdcd0('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xdcd0('0x3')],'comment':_0xdcd0('0xf')},'data3':{'type':Sequelize[_0xdcd0('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xdcd0('0x3')],'comment':_0xdcd0('0x10')},'data5':{'type':Sequelize[_0xdcd0('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xdcd0('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xdcd0('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index ec84d59..1c8951a 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 _0x5fb6=['filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','MemberReport','merge','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick'];(function(_0x466082,_0x59080a){var _0x2cd2be=function(_0x28e417){while(--_0x28e417){_0x466082['push'](_0x466082['shift']());}};_0x2cd2be(++_0x59080a);}(_0x5fb6,0x1c1));var _0x65fb=function(_0xe65c8,_0x5e9904){_0xe65c8=_0xe65c8-0x0;var _0x326b48=_0x5fb6[_0xe65c8];return _0x326b48;};'use strict';var emlformat=require(_0x65fb('0x0'));var rimraf=require(_0x65fb('0x1'));var zipdir=require(_0x65fb('0x2'));var jsonpatch=require(_0x65fb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x65fb('0x4'));var path=require(_0x65fb('0x5'));var sox=require(_0x65fb('0x6'));var csv=require(_0x65fb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x65fb('0x8'));var _=require(_0x65fb('0x9'));var squel=require(_0x65fb('0xa'));var crypto=require(_0x65fb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x65fb('0xc'));var Papa=require(_0x65fb('0xd'));var Redis=require('ioredis');var authService=require(_0x65fb('0xe'));var qs=require(_0x65fb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x65fb('0x10'));var config=require(_0x65fb('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x65fb('0x12'))['db'];function respondWithStatusCode(_0x3a765d,_0x44f694){_0x44f694=_0x44f694||0xcc;return function(_0x15636b){if(_0x15636b){return _0x3a765d['sendStatus'](_0x44f694);}return _0x3a765d[_0x65fb('0x13')](_0x44f694)[_0x65fb('0x14')]();};}function respondWithResult(_0x5527cc,_0x55c293){_0x55c293=_0x55c293||0xc8;return function(_0xeec732){if(_0xeec732){return _0x5527cc[_0x65fb('0x13')](_0x55c293)[_0x65fb('0x15')](_0xeec732);}};}function respondWithFilteredResult(_0x10c67c,_0xefe3b5){return function(_0x29309d){if(_0x29309d){var _0x23dc2e=typeof _0xefe3b5[_0x65fb('0x16')]===_0x65fb('0x17')&&typeof _0xefe3b5[_0x65fb('0x18')]===_0x65fb('0x17');var _0x2278fc=_0x29309d[_0x65fb('0x19')];var _0x2d56f4=_0x23dc2e?0x0:_0xefe3b5['offset'];var _0x299728=_0x23dc2e?_0x29309d[_0x65fb('0x19')]:_0xefe3b5[_0x65fb('0x16')]+_0xefe3b5[_0x65fb('0x18')];var _0x93910c;if(_0x299728>=_0x2278fc){_0x299728=_0x2278fc;_0x93910c=0xc8;}else{_0x93910c=0xce;}_0x10c67c[_0x65fb('0x13')](_0x93910c);return _0x10c67c['set'](_0x65fb('0x1a'),_0x2d56f4+'-'+_0x299728+'/'+_0x2278fc)[_0x65fb('0x15')](_0x29309d);}return null;};}function patchUpdates(_0x41dcfd){return function(_0x5b0d22){try{jsonpatch[_0x65fb('0x1b')](_0x5b0d22,_0x41dcfd,!![]);}catch(_0x32c3ea){return BPromise[_0x65fb('0x1c')](_0x32c3ea);}return _0x5b0d22[_0x65fb('0x1d')]();};}function saveUpdates(_0x439ad9,_0x41155f){return function(_0x558c50){if(_0x558c50){return _0x558c50[_0x65fb('0x1e')](_0x439ad9)[_0x65fb('0x1f')](function(_0x48fadb){return _0x48fadb;});}return null;};}function removeEntity(_0xe1b5c9,_0x171f40){return function(_0x216d71){if(_0x216d71){return _0x216d71['destroy']()[_0x65fb('0x1f')](function(){_0xe1b5c9[_0x65fb('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32cd60,_0x12dc4e){return function(_0x2c55bb){if(!_0x2c55bb){_0x32cd60[_0x65fb('0x20')](0x194);}return _0x2c55bb;};}function handleError(_0x158100,_0x5cc29d){_0x5cc29d=_0x5cc29d||0x1f4;return function(_0x29a069){logger['error'](_0x29a069[_0x65fb('0x21')]);if(_0x29a069['name']){delete _0x29a069['name'];}_0x158100['status'](_0x5cc29d)[_0x65fb('0x22')](_0x29a069);};}exports[_0x65fb('0x23')]=function(_0x58c294,_0x5eccb1){var _0x52b4d9={},_0x328c24={},_0x461010={'count':0x0,'rows':[]};var _0x4a6bce=_[_0x65fb('0x24')](db['MemberReport'][_0x65fb('0x25')],function(_0x467e06){return{'name':_0x467e06[_0x65fb('0x26')],'type':_0x467e06[_0x65fb('0x27')][_0x65fb('0x28')]};});_0x328c24[_0x65fb('0x29')]=_[_0x65fb('0x24')](_0x4a6bce,_0x65fb('0x2a'));_0x328c24[_0x65fb('0x2b')]=_[_0x65fb('0x2c')](_0x58c294[_0x65fb('0x2b')]);_0x328c24[_0x65fb('0x2d')]=_[_0x65fb('0x2e')](_0x328c24['model'],_0x328c24[_0x65fb('0x2b')]);_0x52b4d9[_0x65fb('0x2f')]=_[_0x65fb('0x2e')](_0x328c24[_0x65fb('0x29')],qs['fields'](_0x58c294[_0x65fb('0x2b')][_0x65fb('0x30')]));_0x52b4d9['attributes']=_0x52b4d9[_0x65fb('0x2f')][_0x65fb('0x31')]?_0x52b4d9['attributes']:_0x328c24['model'];if(!_0x58c294[_0x65fb('0x2b')]['hasOwnProperty'](_0x65fb('0x32'))){_0x52b4d9[_0x65fb('0x18')]=qs[_0x65fb('0x18')](_0x58c294['query']['limit']);_0x52b4d9['offset']=qs[_0x65fb('0x16')](_0x58c294[_0x65fb('0x2b')][_0x65fb('0x16')]);}_0x52b4d9[_0x65fb('0x33')]=qs['sort'](_0x58c294['query'][_0x65fb('0x34')]);_0x52b4d9[_0x65fb('0x35')]=qs['filters'](_[_0x65fb('0x36')](_0x58c294['query'],_0x328c24[_0x65fb('0x2d')]),_0x4a6bce);if(_0x58c294[_0x65fb('0x2b')][_0x65fb('0x37')]){_0x52b4d9[_0x65fb('0x35')]=_['merge'](_0x52b4d9[_0x65fb('0x35')],{'$or':_[_0x65fb('0x24')](_0x4a6bce,function(_0x3f1492){if(_0x3f1492[_0x65fb('0x27')]!==_0x65fb('0x38')){var _0x585657={};_0x585657[_0x3f1492[_0x65fb('0x2a')]]={'$like':'%'+_0x58c294[_0x65fb('0x2b')][_0x65fb('0x37')]+'%'};return _0x585657;}})});}_0x52b4d9=_['merge']({},_0x52b4d9,_0x58c294[_0x65fb('0x39')]);var _0x34f0d5={'where':_0x52b4d9[_0x65fb('0x35')]};return db['MemberReport'][_0x65fb('0x19')](_0x34f0d5)[_0x65fb('0x1f')](function(_0x2cbb8f){_0x461010[_0x65fb('0x19')]=_0x2cbb8f;if(_0x58c294[_0x65fb('0x2b')][_0x65fb('0x3a')]){_0x52b4d9[_0x65fb('0x3b')]=[{'all':!![]}];}return db['MemberReport'][_0x65fb('0x3c')](_0x52b4d9);})[_0x65fb('0x1f')](function(_0x467503){_0x461010[_0x65fb('0x3d')]=_0x467503;return _0x461010;})['then'](respondWithFilteredResult(_0x5eccb1,_0x52b4d9))[_0x65fb('0x3e')](handleError(_0x5eccb1,null));};exports[_0x65fb('0x3f')]=function(_0x39674d,_0x563dad){var _0x3fa87e={'raw':!![],'where':{'id':_0x39674d[_0x65fb('0x40')]['id']}},_0x5ef265={};_0x5ef265[_0x65fb('0x29')]=_[_0x65fb('0x2c')](db[_0x65fb('0x41')][_0x65fb('0x25')]);_0x5ef265['query']=_['keys'](_0x39674d[_0x65fb('0x2b')]);_0x5ef265['filters']=_[_0x65fb('0x2e')](_0x5ef265[_0x65fb('0x29')],_0x5ef265['query']);_0x3fa87e[_0x65fb('0x2f')]=_[_0x65fb('0x2e')](_0x5ef265['model'],qs['fields'](_0x39674d[_0x65fb('0x2b')][_0x65fb('0x30')]));_0x3fa87e['attributes']=_0x3fa87e[_0x65fb('0x2f')][_0x65fb('0x31')]?_0x3fa87e[_0x65fb('0x2f')]:_0x5ef265[_0x65fb('0x29')];if(_0x39674d[_0x65fb('0x2b')][_0x65fb('0x3a')]){_0x3fa87e[_0x65fb('0x3b')]=[{'all':!![]}];}_0x3fa87e=_[_0x65fb('0x42')]({},_0x3fa87e,_0x39674d['options']);return db[_0x65fb('0x41')][_0x65fb('0x43')](_0x3fa87e)[_0x65fb('0x1f')](handleEntityNotFound(_0x563dad,null))[_0x65fb('0x1f')](respondWithResult(_0x563dad,null))[_0x65fb('0x3e')](handleError(_0x563dad,null));};exports['create']=function(_0x2a744a,_0xb6ff03){return db['MemberReport'][_0x65fb('0x44')](_0x2a744a[_0x65fb('0x45')],{})[_0x65fb('0x1f')](respondWithResult(_0xb6ff03,0xc9))[_0x65fb('0x3e')](handleError(_0xb6ff03,null));};exports['update']=function(_0x3d5219,_0xbc3b28){if(_0x3d5219['body']['id']){delete _0x3d5219[_0x65fb('0x45')]['id'];}return db[_0x65fb('0x41')][_0x65fb('0x43')]({'where':{'id':_0x3d5219[_0x65fb('0x40')]['id']}})[_0x65fb('0x1f')](handleEntityNotFound(_0xbc3b28,null))['then'](saveUpdates(_0x3d5219[_0x65fb('0x45')],null))[_0x65fb('0x1f')](respondWithResult(_0xbc3b28,null))['catch'](handleError(_0xbc3b28,null));};exports[_0x65fb('0x46')]=function(_0x4b21bd,_0x36261e){return db[_0x65fb('0x41')][_0x65fb('0x43')]({'where':{'id':_0x4b21bd[_0x65fb('0x40')]['id']}})['then'](handleEntityNotFound(_0x36261e,null))['then'](removeEntity(_0x36261e,null))[_0x65fb('0x3e')](handleError(_0x36261e,null));};exports['describe']=function(_0x1f6b24,_0xddf96){return db[_0x65fb('0x41')][_0x65fb('0x47')]()[_0x65fb('0x1f')](respondWithResult(_0xddf96,null))[_0x65fb('0x3e')](handleError(_0xddf96,null));}; \ No newline at end of file +var _0xec73=['end','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','MemberReport','fieldName','query','keys','filters','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','attributes','include','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status'];(function(_0x901f26,_0x3d7dd4){var _0x378315=function(_0x205bfe){while(--_0x205bfe){_0x901f26['push'](_0x901f26['shift']());}};_0x378315(++_0x3d7dd4);}(_0xec73,0xc3));var _0x3ec7=function(_0x3cf261,_0x578763){_0x3cf261=_0x3cf261-0x0;var _0x174f87=_0xec73[_0x3cf261];return _0x174f87;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ec7('0x0'));var zipdir=require(_0x3ec7('0x1'));var jsonpatch=require(_0x3ec7('0x2'));var rp=require(_0x3ec7('0x3'));var moment=require(_0x3ec7('0x4'));var BPromise=require(_0x3ec7('0x5'));var Mustache=require('mustache');var util=require(_0x3ec7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3ec7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ec7('0x8'));var squel=require(_0x3ec7('0x9'));var crypto=require(_0x3ec7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3ec7('0xb'));var toCsv=require(_0x3ec7('0x7'));var querystring=require(_0x3ec7('0xc'));var Papa=require(_0x3ec7('0xd'));var Redis=require(_0x3ec7('0xe'));var authService=require(_0x3ec7('0xf'));var qs=require(_0x3ec7('0x10'));var as=require(_0x3ec7('0x11'));var hardwareService=require(_0x3ec7('0x12'));var logger=require('../../config/logger')(_0x3ec7('0x13'));var utils=require(_0x3ec7('0x14'));var config=require(_0x3ec7('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d65f8,_0x387bb2){_0x387bb2=_0x387bb2||0xcc;return function(_0x50030c){if(_0x50030c){return _0x3d65f8[_0x3ec7('0x16')](_0x387bb2);}return _0x3d65f8[_0x3ec7('0x17')](_0x387bb2)[_0x3ec7('0x18')]();};}function respondWithResult(_0x54cb92,_0x5004fb){_0x5004fb=_0x5004fb||0xc8;return function(_0x108142){if(_0x108142){return _0x54cb92[_0x3ec7('0x17')](_0x5004fb)['json'](_0x108142);}};}function respondWithFilteredResult(_0x4bc919,_0xdf6dff){return function(_0x5b882d){if(_0x5b882d){var _0x13f812=typeof _0xdf6dff[_0x3ec7('0x19')]==='undefined'&&typeof _0xdf6dff[_0x3ec7('0x1a')]===_0x3ec7('0x1b');var _0x25f746=_0x5b882d[_0x3ec7('0x1c')];var _0x5b0d7d=_0x13f812?0x0:_0xdf6dff[_0x3ec7('0x19')];var _0x2f73e2=_0x13f812?_0x5b882d[_0x3ec7('0x1c')]:_0xdf6dff['offset']+_0xdf6dff['limit'];var _0x24323a;if(_0x2f73e2>=_0x25f746){_0x2f73e2=_0x25f746;_0x24323a=0xc8;}else{_0x24323a=0xce;}_0x4bc919[_0x3ec7('0x17')](_0x24323a);return _0x4bc919['set'](_0x3ec7('0x1d'),_0x5b0d7d+'-'+_0x2f73e2+'/'+_0x25f746)[_0x3ec7('0x1e')](_0x5b882d);}return null;};}function patchUpdates(_0x5f3333){return function(_0x20a3a5){try{jsonpatch['apply'](_0x20a3a5,_0x5f3333,!![]);}catch(_0x14a7f7){return BPromise[_0x3ec7('0x1f')](_0x14a7f7);}return _0x20a3a5[_0x3ec7('0x20')]();};}function saveUpdates(_0x4a7b5d,_0x56382a){return function(_0x2dd7f5){if(_0x2dd7f5){return _0x2dd7f5[_0x3ec7('0x21')](_0x4a7b5d)[_0x3ec7('0x22')](function(_0x45771c){return _0x45771c;});}return null;};}function removeEntity(_0x252f54,_0x486019){return function(_0x479b83){if(_0x479b83){return _0x479b83[_0x3ec7('0x23')]()[_0x3ec7('0x22')](function(){_0x252f54[_0x3ec7('0x17')](0xcc)[_0x3ec7('0x18')]();});}};}function handleEntityNotFound(_0x346322,_0x18c0ac){return function(_0x36c7cb){if(!_0x36c7cb){_0x346322['sendStatus'](0x194);}return _0x36c7cb;};}function handleError(_0x101c52,_0xdfed88){_0xdfed88=_0xdfed88||0x1f4;return function(_0x227bc8){logger[_0x3ec7('0x24')](_0x227bc8[_0x3ec7('0x25')]);if(_0x227bc8[_0x3ec7('0x26')]){delete _0x227bc8[_0x3ec7('0x26')];}_0x101c52[_0x3ec7('0x17')](_0xdfed88)[_0x3ec7('0x27')](_0x227bc8);};}exports[_0x3ec7('0x28')]=function(_0x5df47c,_0x56ed6e){var _0x56ee89={},_0xadf37c={},_0x393f5a={'count':0x0,'rows':[]};var _0x2aec35=_[_0x3ec7('0x29')](db[_0x3ec7('0x2a')]['rawAttributes'],function(_0x45dd75){return{'name':_0x45dd75[_0x3ec7('0x2b')],'type':_0x45dd75['type']['key']};});_0xadf37c['model']=_[_0x3ec7('0x29')](_0x2aec35,_0x3ec7('0x26'));_0xadf37c[_0x3ec7('0x2c')]=_[_0x3ec7('0x2d')](_0x5df47c[_0x3ec7('0x2c')]);_0xadf37c[_0x3ec7('0x2e')]=_[_0x3ec7('0x2f')](_0xadf37c[_0x3ec7('0x30')],_0xadf37c[_0x3ec7('0x2c')]);_0x56ee89['attributes']=_['intersection'](_0xadf37c[_0x3ec7('0x30')],qs[_0x3ec7('0x31')](_0x5df47c['query'][_0x3ec7('0x31')]));_0x56ee89['attributes']=_0x56ee89['attributes'][_0x3ec7('0x32')]?_0x56ee89['attributes']:_0xadf37c[_0x3ec7('0x30')];if(!_0x5df47c[_0x3ec7('0x2c')][_0x3ec7('0x33')](_0x3ec7('0x34'))){_0x56ee89[_0x3ec7('0x1a')]=qs[_0x3ec7('0x1a')](_0x5df47c[_0x3ec7('0x2c')][_0x3ec7('0x1a')]);_0x56ee89[_0x3ec7('0x19')]=qs[_0x3ec7('0x19')](_0x5df47c[_0x3ec7('0x2c')]['offset']);}_0x56ee89[_0x3ec7('0x35')]=qs['sort'](_0x5df47c[_0x3ec7('0x2c')][_0x3ec7('0x36')]);_0x56ee89['where']=qs[_0x3ec7('0x2e')](_['pick'](_0x5df47c['query'],_0xadf37c[_0x3ec7('0x2e')]),_0x2aec35);if(_0x5df47c[_0x3ec7('0x2c')]['filter']){_0x56ee89[_0x3ec7('0x37')]=_[_0x3ec7('0x38')](_0x56ee89[_0x3ec7('0x37')],{'$or':_[_0x3ec7('0x29')](_0x2aec35,function(_0x47a15e){if(_0x47a15e[_0x3ec7('0x39')]!==_0x3ec7('0x3a')){var _0x42cfa5={};_0x42cfa5[_0x47a15e['name']]={'$like':'%'+_0x5df47c['query'][_0x3ec7('0x3b')]+'%'};return _0x42cfa5;}})});}_0x56ee89=_['merge']({},_0x56ee89,_0x5df47c[_0x3ec7('0x3c')]);var _0xf6b417={'where':_0x56ee89[_0x3ec7('0x37')]};return db[_0x3ec7('0x2a')]['count'](_0xf6b417)[_0x3ec7('0x22')](function(_0x3f9feb){_0x393f5a[_0x3ec7('0x1c')]=_0x3f9feb;if(_0x5df47c[_0x3ec7('0x2c')][_0x3ec7('0x3d')]){_0x56ee89['include']=[{'all':!![]}];}return db[_0x3ec7('0x2a')][_0x3ec7('0x3e')](_0x56ee89);})[_0x3ec7('0x22')](function(_0x239564){_0x393f5a[_0x3ec7('0x3f')]=_0x239564;return _0x393f5a;})[_0x3ec7('0x22')](respondWithFilteredResult(_0x56ed6e,_0x56ee89))['catch'](handleError(_0x56ed6e,null));};exports[_0x3ec7('0x40')]=function(_0x186106,_0x34ffd2){var _0x35ae37={'raw':!![],'where':{'id':_0x186106[_0x3ec7('0x41')]['id']}},_0x5886f7={};_0x5886f7['model']=_[_0x3ec7('0x2d')](db[_0x3ec7('0x2a')]['rawAttributes']);_0x5886f7[_0x3ec7('0x2c')]=_[_0x3ec7('0x2d')](_0x186106[_0x3ec7('0x2c')]);_0x5886f7[_0x3ec7('0x2e')]=_[_0x3ec7('0x2f')](_0x5886f7['model'],_0x5886f7[_0x3ec7('0x2c')]);_0x35ae37['attributes']=_['intersection'](_0x5886f7[_0x3ec7('0x30')],qs[_0x3ec7('0x31')](_0x186106[_0x3ec7('0x2c')]['fields']));_0x35ae37[_0x3ec7('0x42')]=_0x35ae37[_0x3ec7('0x42')][_0x3ec7('0x32')]?_0x35ae37[_0x3ec7('0x42')]:_0x5886f7[_0x3ec7('0x30')];if(_0x186106[_0x3ec7('0x2c')][_0x3ec7('0x3d')]){_0x35ae37[_0x3ec7('0x43')]=[{'all':!![]}];}_0x35ae37=_['merge']({},_0x35ae37,_0x186106[_0x3ec7('0x3c')]);return db[_0x3ec7('0x2a')][_0x3ec7('0x44')](_0x35ae37)[_0x3ec7('0x22')](handleEntityNotFound(_0x34ffd2,null))[_0x3ec7('0x22')](respondWithResult(_0x34ffd2,null))[_0x3ec7('0x45')](handleError(_0x34ffd2,null));};exports[_0x3ec7('0x46')]=function(_0x437105,_0x27b226){return db[_0x3ec7('0x2a')][_0x3ec7('0x46')](_0x437105[_0x3ec7('0x47')],{})['then'](respondWithResult(_0x27b226,0xc9))[_0x3ec7('0x45')](handleError(_0x27b226,null));};exports[_0x3ec7('0x21')]=function(_0xa9a0aa,_0x5da1ad){if(_0xa9a0aa[_0x3ec7('0x47')]['id']){delete _0xa9a0aa['body']['id'];}return db[_0x3ec7('0x2a')][_0x3ec7('0x44')]({'where':{'id':_0xa9a0aa[_0x3ec7('0x41')]['id']}})[_0x3ec7('0x22')](handleEntityNotFound(_0x5da1ad,null))['then'](saveUpdates(_0xa9a0aa[_0x3ec7('0x47')],null))[_0x3ec7('0x22')](respondWithResult(_0x5da1ad,null))['catch'](handleError(_0x5da1ad,null));};exports[_0x3ec7('0x23')]=function(_0x2a09ee,_0x1722c7){return db[_0x3ec7('0x2a')][_0x3ec7('0x44')]({'where':{'id':_0x2a09ee[_0x3ec7('0x41')]['id']}})[_0x3ec7('0x22')](handleEntityNotFound(_0x1722c7,null))[_0x3ec7('0x22')](removeEntity(_0x1722c7,null))[_0x3ec7('0x45')](handleError(_0x1722c7,null));};exports[_0x3ec7('0x48')]=function(_0x24f299,_0x56726d){return db[_0x3ec7('0x2a')][_0x3ec7('0x48')]()[_0x3ec7('0x22')](respondWithResult(_0x56726d,null))[_0x3ec7('0x45')](handleError(_0x56726d,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 8851871..d046857 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 _0x1d05=['./memberReport.attributes','exports','define','MemberReport','report_member','membername','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0x1d05,0x1e6));var _0x51d0=function(_0x3c2e23,_0x333d1f){_0x3c2e23=_0x3c2e23-0x0;var _0x2b057a=_0x1d05[_0x3c2e23];return _0x2b057a;};'use strict';var _=require(_0x51d0('0x0'));var util=require(_0x51d0('0x1'));var logger=require(_0x51d0('0x2'))(_0x51d0('0x3'));var moment=require(_0x51d0('0x4'));var BPromise=require('bluebird');var rp=require(_0x51d0('0x5'));var fs=require('fs');var path=require(_0x51d0('0x6'));var rimraf=require(_0x51d0('0x7'));var config=require(_0x51d0('0x8'));var attributes=require(_0x51d0('0x9'));module[_0x51d0('0xa')]=function(_0x25c928,_0x56a591){return _0x25c928[_0x51d0('0xb')](_0x51d0('0xc'),attributes,{'tableName':_0x51d0('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x51d0('0xe'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc1ad=['request-promise','path','rimraf','../../config/environment','exports','report_member','lodash','moment'];(function(_0x1b384d,_0x495296){var _0x2e1695=function(_0xff8406){while(--_0xff8406){_0x1b384d['push'](_0x1b384d['shift']());}};_0x2e1695(++_0x495296);}(_0xc1ad,0xde));var _0xdc1a=function(_0x5a6b46,_0x5d016c){_0x5a6b46=_0x5a6b46-0x0;var _0x2a8765=_0xc1ad[_0x5a6b46];return _0x2a8765;};'use strict';var _=require(_0xdc1a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdc1a('0x1'));var BPromise=require('bluebird');var rp=require(_0xdc1a('0x2'));var fs=require('fs');var path=require(_0xdc1a('0x3'));var rimraf=require(_0xdc1a('0x4'));var config=require(_0xdc1a('0x5'));var attributes=require('./memberReport.attributes');module[_0xdc1a('0x6')]=function(_0x2eeda8,_0x5d29ea){return _0x2eeda8['define']('MemberReport',attributes,{'tableName':_0xdc1a('0x7'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index b1bd130..6db5d21 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 _0x61fe=['client','http','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','MemberReport,\x20%s,\x20%s','result','catch','GetMemberReport','MemberReport','options','raw','where','attributes','include','map','model','stringify','CreateMemberReport','create','body','then','UpdateMemberReport','update','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x61fe,0x17c));var _0xe61f=function(_0x343e01,_0x2a7c5b){_0x343e01=_0x343e01-0x0;var _0x5c162f=_0x61fe[_0x343e01];return _0x5c162f;};'use strict';var _=require(_0xe61f('0x0'));var util=require(_0xe61f('0x1'));var moment=require(_0xe61f('0x2'));var BPromise=require(_0xe61f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe61f('0x4'));var db=require(_0xe61f('0x5'))['db'];var utils=require(_0xe61f('0x6'));var logger=require('../../config/logger')(_0xe61f('0x7'));var config=require(_0xe61f('0x8'));var jayson=require(_0xe61f('0x9'));var client=jayson[_0xe61f('0xa')][_0xe61f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47101a,_0x3726c1,_0x1676e5){return new BPromise(function(_0xa159b4,_0xf7093a){return client['request'](_0x47101a,_0x1676e5)['then'](function(_0xac3ac){logger[_0xe61f('0xc')]('MemberReport,\x20%s,\x20%s',_0x3726c1,_0xe61f('0xd'));logger[_0xe61f('0xe')](_0xe61f('0xf'),_0x3726c1,'request\x20sent',JSON['stringify'](_0xac3ac));if(_0xac3ac[_0xe61f('0x10')]){if(_0xac3ac[_0xe61f('0x10')][_0xe61f('0x11')]===0x1f4){logger[_0xe61f('0x10')]('MemberReport,\x20%s,\x20%s',_0x3726c1,_0xac3ac[_0xe61f('0x10')]['message']);return _0xf7093a(_0xac3ac[_0xe61f('0x10')]['message']);}logger[_0xe61f('0x10')]('MemberReport,\x20%s,\x20%s',_0x3726c1,_0xac3ac[_0xe61f('0x10')][_0xe61f('0x12')]);return _0xa159b4(_0xac3ac['error'][_0xe61f('0x12')]);}else{logger['info'](_0xe61f('0x13'),_0x3726c1,_0xe61f('0xd'));_0xa159b4(_0xac3ac[_0xe61f('0x14')][_0xe61f('0x12')]);}})[_0xe61f('0x15')](function(_0x583f7c){logger[_0xe61f('0x10')](_0xe61f('0x13'),_0x3726c1,_0x583f7c);_0xf7093a(_0x583f7c);});});}exports[_0xe61f('0x16')]=function(_0x4a64d2){var _0x14233b=this;return new Promise(function(_0x4ade2c,_0x17a0b6){return db[_0xe61f('0x17')]['findAll']({'raw':_0x4a64d2[_0xe61f('0x18')]?_0x4a64d2[_0xe61f('0x18')][_0xe61f('0x19')]===undefined?!![]:![]:!![],'where':_0x4a64d2[_0xe61f('0x18')]?_0x4a64d2[_0xe61f('0x18')][_0xe61f('0x1a')]||null:null,'attributes':_0x4a64d2[_0xe61f('0x18')]?_0x4a64d2[_0xe61f('0x18')][_0xe61f('0x1b')]||null:null,'limit':_0x4a64d2[_0xe61f('0x18')]?_0x4a64d2[_0xe61f('0x18')]['limit']||null:null,'include':_0x4a64d2[_0xe61f('0x18')]?_0x4a64d2['options'][_0xe61f('0x1c')]?_[_0xe61f('0x1d')](_0x4a64d2['options'][_0xe61f('0x1c')],function(_0x4e727b){return{'model':db[_0x4e727b[_0xe61f('0x1e')]],'as':_0x4e727b['as'],'attributes':_0x4e727b[_0xe61f('0x1b')],'include':_0x4e727b['include']?_[_0xe61f('0x1d')](_0x4e727b['include'],function(_0x3435d2){return{'model':db[_0x3435d2[_0xe61f('0x1e')]],'as':_0x3435d2['as'],'attributes':_0x3435d2[_0xe61f('0x1b')],'include':_0x3435d2[_0xe61f('0x1c')]?_['map'](_0x3435d2[_0xe61f('0x1c')],function(_0x255602){return{'model':db[_0x255602[_0xe61f('0x1e')]],'as':_0x255602['as'],'attributes':_0x255602[_0xe61f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1895e5){logger[_0xe61f('0xc')](_0xe61f('0x16'),_0x4a64d2);logger[_0xe61f('0xe')](_0xe61f('0x16'),_0x4a64d2,JSON[_0xe61f('0x1f')](_0x1895e5));_0x4ade2c(_0x1895e5);})[_0xe61f('0x15')](function(_0x4d379c){logger[_0xe61f('0x10')](_0xe61f('0x16'),_0x4d379c[_0xe61f('0x12')],_0x4a64d2);_0x17a0b6(_0x14233b[_0xe61f('0x10')](0x1f4,_0x4d379c[_0xe61f('0x12')]));});});};exports[_0xe61f('0x20')]=function(_0x79da5a){var _0x67d919=this;return new Promise(function(_0x2b2bcc,_0x3f7cd9){return db[_0xe61f('0x17')][_0xe61f('0x21')](_0x79da5a[_0xe61f('0x22')],{'raw':_0x79da5a[_0xe61f('0x18')]?_0x79da5a['options']['raw']===undefined?!![]:![]:!![]})[_0xe61f('0x23')](function(_0x100549){logger[_0xe61f('0xc')](_0xe61f('0x20'),_0x79da5a);logger[_0xe61f('0xe')](_0xe61f('0x20'),_0x79da5a,JSON['stringify'](_0x100549));_0x2b2bcc(_0x100549);})[_0xe61f('0x15')](function(_0x3a70df){logger[_0xe61f('0x10')](_0xe61f('0x20'),_0x3a70df[_0xe61f('0x12')],_0x79da5a);_0x3f7cd9(_0x67d919['error'](0x1f4,_0x3a70df[_0xe61f('0x12')]));});});};exports[_0xe61f('0x24')]=function(_0x45e9dd){var _0x4bee51=this;return new Promise(function(_0x1f8262,_0x23aa17){return db[_0xe61f('0x17')][_0xe61f('0x25')](_0x45e9dd['body'],{'raw':_0x45e9dd['options']?_0x45e9dd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45e9dd['options']?_0x45e9dd[_0xe61f('0x18')][_0xe61f('0x1a')]||null:null,'attributes':_0x45e9dd[_0xe61f('0x18')]?_0x45e9dd[_0xe61f('0x18')][_0xe61f('0x1b')]||null:null,'limit':_0x45e9dd['options']?_0x45e9dd[_0xe61f('0x18')][_0xe61f('0x26')]||null:null})[_0xe61f('0x23')](function(_0x3b87ea){logger[_0xe61f('0xc')](_0xe61f('0x24'),_0x45e9dd);logger['debug']('UpdateMemberReport',_0x45e9dd,JSON[_0xe61f('0x1f')](_0x3b87ea));_0x1f8262(_0x3b87ea);})[_0xe61f('0x15')](function(_0x52679e){logger['error'](_0xe61f('0x24'),_0x52679e[_0xe61f('0x12')],_0x45e9dd);_0x23aa17(_0x4bee51[_0xe61f('0x10')](0x1f4,_0x52679e['message']));});});}; \ No newline at end of file +var _0xfc18=['rpc','../../config/environment','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','limit','include','map','model','attributes','debug','CreateMemberReport','create','raw','UpdateMemberReport','update','body','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xfc18,0xc0));var _0x8fc1=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0xfc18[_0x382a62];return _0x490a25;};'use strict';var _=require(_0x8fc1('0x0'));var util=require(_0x8fc1('0x1'));var moment=require(_0x8fc1('0x2'));var BPromise=require(_0x8fc1('0x3'));var rs=require(_0x8fc1('0x4'));var fs=require('fs');var Redis=require(_0x8fc1('0x5'));var db=require(_0x8fc1('0x6'))['db'];var utils=require(_0x8fc1('0x7'));var logger=require('../../config/logger')(_0x8fc1('0x8'));var config=require(_0x8fc1('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8fc1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x244f10,_0x37ad3c,_0x344c73){return new BPromise(function(_0x1125bd,_0x30a66f){return client[_0x8fc1('0xb')](_0x244f10,_0x344c73)[_0x8fc1('0xc')](function(_0x51097c){logger[_0x8fc1('0xd')](_0x8fc1('0xe'),_0x37ad3c,_0x8fc1('0xf'));logger['debug'](_0x8fc1('0x10'),_0x37ad3c,_0x8fc1('0xf'),JSON[_0x8fc1('0x11')](_0x51097c));if(_0x51097c[_0x8fc1('0x12')]){if(_0x51097c['error'][_0x8fc1('0x13')]===0x1f4){logger[_0x8fc1('0x12')](_0x8fc1('0xe'),_0x37ad3c,_0x51097c[_0x8fc1('0x12')]['message']);return _0x30a66f(_0x51097c[_0x8fc1('0x12')][_0x8fc1('0x14')]);}logger[_0x8fc1('0x12')]('MemberReport,\x20%s,\x20%s',_0x37ad3c,_0x51097c[_0x8fc1('0x12')][_0x8fc1('0x14')]);return _0x1125bd(_0x51097c[_0x8fc1('0x12')]['message']);}else{logger[_0x8fc1('0xd')](_0x8fc1('0xe'),_0x37ad3c,_0x8fc1('0xf'));_0x1125bd(_0x51097c[_0x8fc1('0x15')]['message']);}})[_0x8fc1('0x16')](function(_0x435c05){logger[_0x8fc1('0x12')](_0x8fc1('0xe'),_0x37ad3c,_0x435c05);_0x30a66f(_0x435c05);});});}exports[_0x8fc1('0x17')]=function(_0xdcc9c5){var _0x446e6c=this;return new Promise(function(_0x38d1c3,_0x2db7fe){return db[_0x8fc1('0x18')][_0x8fc1('0x19')]({'raw':_0xdcc9c5[_0x8fc1('0x1a')]?_0xdcc9c5[_0x8fc1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xdcc9c5[_0x8fc1('0x1a')]?_0xdcc9c5[_0x8fc1('0x1a')]['where']||null:null,'attributes':_0xdcc9c5['options']?_0xdcc9c5[_0x8fc1('0x1a')]['attributes']||null:null,'limit':_0xdcc9c5[_0x8fc1('0x1a')]?_0xdcc9c5['options'][_0x8fc1('0x1b')]||null:null,'include':_0xdcc9c5['options']?_0xdcc9c5['options'][_0x8fc1('0x1c')]?_[_0x8fc1('0x1d')](_0xdcc9c5[_0x8fc1('0x1a')][_0x8fc1('0x1c')],function(_0x3c4da8){return{'model':db[_0x3c4da8[_0x8fc1('0x1e')]],'as':_0x3c4da8['as'],'attributes':_0x3c4da8[_0x8fc1('0x1f')],'include':_0x3c4da8[_0x8fc1('0x1c')]?_[_0x8fc1('0x1d')](_0x3c4da8[_0x8fc1('0x1c')],function(_0x30d9d3){return{'model':db[_0x30d9d3[_0x8fc1('0x1e')]],'as':_0x30d9d3['as'],'attributes':_0x30d9d3[_0x8fc1('0x1f')],'include':_0x30d9d3[_0x8fc1('0x1c')]?_[_0x8fc1('0x1d')](_0x30d9d3[_0x8fc1('0x1c')],function(_0x33b9b9){return{'model':db[_0x33b9b9['model']],'as':_0x33b9b9['as'],'attributes':_0x33b9b9[_0x8fc1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8fc1('0xc')](function(_0x26c651){logger[_0x8fc1('0xd')](_0x8fc1('0x17'),_0xdcc9c5);logger[_0x8fc1('0x20')](_0x8fc1('0x17'),_0xdcc9c5,JSON[_0x8fc1('0x11')](_0x26c651));_0x38d1c3(_0x26c651);})[_0x8fc1('0x16')](function(_0x1b3fbf){logger[_0x8fc1('0x12')](_0x8fc1('0x17'),_0x1b3fbf[_0x8fc1('0x14')],_0xdcc9c5);_0x2db7fe(_0x446e6c[_0x8fc1('0x12')](0x1f4,_0x1b3fbf[_0x8fc1('0x14')]));});});};exports[_0x8fc1('0x21')]=function(_0x197a1a){var _0x179735=this;return new Promise(function(_0x154c56,_0x4704ce){return db[_0x8fc1('0x18')][_0x8fc1('0x22')](_0x197a1a['body'],{'raw':_0x197a1a[_0x8fc1('0x1a')]?_0x197a1a[_0x8fc1('0x1a')][_0x8fc1('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x3abec1){logger[_0x8fc1('0xd')](_0x8fc1('0x21'),_0x197a1a);logger[_0x8fc1('0x20')](_0x8fc1('0x21'),_0x197a1a,JSON[_0x8fc1('0x11')](_0x3abec1));_0x154c56(_0x3abec1);})[_0x8fc1('0x16')](function(_0x31d85f){logger[_0x8fc1('0x12')](_0x8fc1('0x21'),_0x31d85f[_0x8fc1('0x14')],_0x197a1a);_0x4704ce(_0x179735[_0x8fc1('0x12')](0x1f4,_0x31d85f['message']));});});};exports[_0x8fc1('0x24')]=function(_0x2474f0){var _0x38becd=this;return new Promise(function(_0x8dcc3,_0x15e2c0){return db[_0x8fc1('0x18')][_0x8fc1('0x25')](_0x2474f0[_0x8fc1('0x26')],{'raw':_0x2474f0[_0x8fc1('0x1a')]?_0x2474f0[_0x8fc1('0x1a')][_0x8fc1('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2474f0[_0x8fc1('0x1a')]?_0x2474f0['options'][_0x8fc1('0x27')]||null:null,'attributes':_0x2474f0[_0x8fc1('0x1a')]?_0x2474f0[_0x8fc1('0x1a')][_0x8fc1('0x1f')]||null:null,'limit':_0x2474f0[_0x8fc1('0x1a')]?_0x2474f0[_0x8fc1('0x1a')][_0x8fc1('0x1b')]||null:null})[_0x8fc1('0xc')](function(_0xc2b63d){logger[_0x8fc1('0xd')]('UpdateMemberReport',_0x2474f0);logger[_0x8fc1('0x20')]('UpdateMemberReport',_0x2474f0,JSON[_0x8fc1('0x11')](_0xc2b63d));_0x8dcc3(_0xc2b63d);})[_0x8fc1('0x16')](function(_0xeed6a0){logger[_0x8fc1('0x12')](_0x8fc1('0x24'),_0xeed6a0[_0x8fc1('0x14')],_0x2474f0);_0x15e2c0(_0x38becd[_0x8fc1('0x12')](0x1f4,_0xeed6a0['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 05d1bbc..4a07048 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 _0xed1f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x47677f,_0x28c987){var _0xde4698=function(_0x459d60){while(--_0x459d60){_0x47677f['push'](_0x47677f['shift']());}};_0xde4698(++_0x28c987);}(_0xed1f,0x6a));var _0xfed1=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xed1f[_0x4e9d3c];return _0x2d0825;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')]('/',controller[_0xfed1('0xc')]);module[_0xfed1('0xd')]=router; \ No newline at end of file +var _0x50a6=['../../components/auth/service','../../components/interaction/service','./migration.controller','exports','multer','util','express','fs-extra'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x50a6,0xa4));var _0x650a=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0x50a6[_0xdbd4f7];return _0x5c3f9d;};'use strict';var multer=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x650a('0x2'));var router=express['Router']();var fs_extra=require(_0x650a('0x3'));var auth=require(_0x650a('0x4'));var interaction=require(_0x650a('0x5'));var config=require('../../config/environment');var controller=require(_0x650a('0x6'));router['get']('/',controller['index']);module[_0x650a('0x7')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 688a032..627ab20 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 _0x7efb=['version','sequelize'];(function(_0x2f4de8,_0x313395){var _0x4569cb=function(_0x17572f){while(--_0x17572f){_0x2f4de8['push'](_0x2f4de8['shift']());}};_0x4569cb(++_0x313395);}(_0x7efb,0x1e9));var _0xb7ef=function(_0x17e858,_0x1dcd35){_0x17e858=_0x17e858-0x0;var _0x5a5f2e=_0x7efb[_0x17e858];return _0x5a5f2e;};'use strict';var Sequelize=require(_0xb7ef('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0xb7ef('0x1')}}; \ No newline at end of file +var _0x909e=['exports','version','sequelize'];(function(_0x5884a5,_0x3027d0){var _0x479778=function(_0x484159){while(--_0x484159){_0x5884a5['push'](_0x5884a5['shift']());}};_0x479778(++_0x3027d0);}(_0x909e,0x1a0));var _0xe909=function(_0xc9ea0a,_0x41d553){_0xc9ea0a=_0xc9ea0a-0x0;var _0x6bf251=_0x909e[_0xc9ea0a];return _0x6bf251;};'use strict';var Sequelize=require(_0xe909('0x0'));module[_0xe909('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0xe909('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 305d0c1..5bffc32 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 _0x9b35=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','Migration','includeAll','include','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','json','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map'];(function(_0x3ff05b,_0x3556d5){var _0x10323c=function(_0x2e758a){while(--_0x2e758a){_0x3ff05b['push'](_0x3ff05b['shift']());}};_0x10323c(++_0x3556d5);}(_0x9b35,0x11c));var _0x59b3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x9b35[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x59b3('0x0'));var rimraf=require(_0x59b3('0x1'));var zipdir=require(_0x59b3('0x2'));var jsonpatch=require(_0x59b3('0x3'));var rp=require(_0x59b3('0x4'));var moment=require('moment');var BPromise=require(_0x59b3('0x5'));var Mustache=require('mustache');var util=require(_0x59b3('0x6'));var path=require('path');var sox=require(_0x59b3('0x7'));var csv=require('to-csv');var ejs=require(_0x59b3('0x8'));var fs=require('fs');var fs_extra=require(_0x59b3('0x9'));var _=require('lodash');var squel=require(_0x59b3('0xa'));var crypto=require(_0x59b3('0xb'));var jsforce=require(_0x59b3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x59b3('0xd'));var querystring=require(_0x59b3('0xe'));var Papa=require('papaparse');var Redis=require(_0x59b3('0xf'));var authService=require(_0x59b3('0x10'));var qs=require(_0x59b3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x59b3('0x12'));var logger=require(_0x59b3('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x59b3('0x14'));var licenseUtil=require(_0x59b3('0x15'));var db=require(_0x59b3('0x16'))['db'];function respondWithStatusCode(_0x2aca94,_0x1f6c4f){_0x1f6c4f=_0x1f6c4f||0xcc;return function(_0x9fb61f){if(_0x9fb61f){return _0x2aca94['sendStatus'](_0x1f6c4f);}return _0x2aca94[_0x59b3('0x17')](_0x1f6c4f)[_0x59b3('0x18')]();};}function respondWithResult(_0x80134c,_0x286a7c){_0x286a7c=_0x286a7c||0xc8;return function(_0x2839d4){if(_0x2839d4){return _0x80134c['status'](_0x286a7c)['json'](_0x2839d4);}};}function respondWithFilteredResult(_0xb492b7,_0x5f5afa){return function(_0x1b8abf){if(_0x1b8abf){var _0x117106=typeof _0x5f5afa[_0x59b3('0x19')]==='undefined'&&typeof _0x5f5afa[_0x59b3('0x1a')]===_0x59b3('0x1b');var _0x1d672d=_0x1b8abf[_0x59b3('0x1c')];var _0x1e8fe6=_0x117106?0x0:_0x5f5afa['offset'];var _0x13b419=_0x117106?_0x1b8abf['count']:_0x5f5afa[_0x59b3('0x19')]+_0x5f5afa[_0x59b3('0x1a')];var _0x3c6c4f;if(_0x13b419>=_0x1d672d){_0x13b419=_0x1d672d;_0x3c6c4f=0xc8;}else{_0x3c6c4f=0xce;}_0xb492b7['status'](_0x3c6c4f);return _0xb492b7['set']('Content-Range',_0x1e8fe6+'-'+_0x13b419+'/'+_0x1d672d)[_0x59b3('0x1d')](_0x1b8abf);}return null;};}function patchUpdates(_0x186254){return function(_0x209f13){try{jsonpatch['apply'](_0x209f13,_0x186254,!![]);}catch(_0x3c8a12){return BPromise[_0x59b3('0x1e')](_0x3c8a12);}return _0x209f13[_0x59b3('0x1f')]();};}function saveUpdates(_0x4c0cd4,_0x2269e0){return function(_0xfdb570){if(_0xfdb570){return _0xfdb570[_0x59b3('0x20')](_0x4c0cd4)[_0x59b3('0x21')](function(_0x840977){return _0x840977;});}return null;};}function removeEntity(_0x53b814,_0x3dacab){return function(_0x2c3e1b){if(_0x2c3e1b){return _0x2c3e1b[_0x59b3('0x22')]()[_0x59b3('0x21')](function(){_0x53b814[_0x59b3('0x17')](0xcc)[_0x59b3('0x18')]();});}};}function handleEntityNotFound(_0x43bbe3,_0x19a9a2){return function(_0x41c453){if(!_0x41c453){_0x43bbe3[_0x59b3('0x23')](0x194);}return _0x41c453;};}function handleError(_0x337ae7,_0x4409fa){_0x4409fa=_0x4409fa||0x1f4;return function(_0x10968c){logger['error'](_0x10968c[_0x59b3('0x24')]);if(_0x10968c[_0x59b3('0x25')]){delete _0x10968c['name'];}_0x337ae7[_0x59b3('0x17')](_0x4409fa)[_0x59b3('0x26')](_0x10968c);};}exports[_0x59b3('0x27')]=function(_0x711753,_0x54b08a){var _0x230d33={},_0x411fbd={},_0x357e04={'count':0x0,'rows':[]};var _0x217592=_[_0x59b3('0x28')](db['Migration'][_0x59b3('0x29')],function(_0x19ee69){return{'name':_0x19ee69[_0x59b3('0x2a')],'type':_0x19ee69[_0x59b3('0x2b')][_0x59b3('0x2c')]};});_0x411fbd[_0x59b3('0x2d')]=_[_0x59b3('0x28')](_0x217592,'name');_0x411fbd[_0x59b3('0x2e')]=_[_0x59b3('0x2f')](_0x711753['query']);_0x411fbd[_0x59b3('0x30')]=_[_0x59b3('0x31')](_0x411fbd[_0x59b3('0x2d')],_0x411fbd['query']);_0x230d33['attributes']=_[_0x59b3('0x31')](_0x411fbd[_0x59b3('0x2d')],qs[_0x59b3('0x32')](_0x711753[_0x59b3('0x2e')]['fields']));_0x230d33['attributes']=_0x230d33[_0x59b3('0x33')]['length']?_0x230d33[_0x59b3('0x33')]:_0x411fbd[_0x59b3('0x2d')];if(!_0x711753[_0x59b3('0x2e')][_0x59b3('0x34')](_0x59b3('0x35'))){_0x230d33[_0x59b3('0x1a')]=qs[_0x59b3('0x1a')](_0x711753[_0x59b3('0x2e')][_0x59b3('0x1a')]);_0x230d33[_0x59b3('0x19')]=qs[_0x59b3('0x19')](_0x711753[_0x59b3('0x2e')]['offset']);}_0x230d33[_0x59b3('0x36')]=qs['sort'](_0x711753[_0x59b3('0x2e')][_0x59b3('0x37')]);_0x230d33[_0x59b3('0x38')]=qs[_0x59b3('0x30')](_['pick'](_0x711753['query'],_0x411fbd[_0x59b3('0x30')]),_0x217592);if(_0x711753[_0x59b3('0x2e')][_0x59b3('0x39')]){_0x230d33['where']=_['merge'](_0x230d33[_0x59b3('0x38')],{'$or':_['map'](_0x217592,function(_0x8a1fa7){if(_0x8a1fa7['type']!=='VIRTUAL'){var _0x25df1d={};_0x25df1d[_0x8a1fa7[_0x59b3('0x25')]]={'$like':'%'+_0x711753[_0x59b3('0x2e')][_0x59b3('0x39')]+'%'};return _0x25df1d;}})});}_0x230d33=_[_0x59b3('0x3a')]({},_0x230d33,_0x711753[_0x59b3('0x3b')]);var _0x24f258={'where':_0x230d33['where']};return db[_0x59b3('0x3c')][_0x59b3('0x1c')](_0x24f258)[_0x59b3('0x21')](function(_0x372653){_0x357e04[_0x59b3('0x1c')]=_0x372653;if(_0x711753[_0x59b3('0x2e')][_0x59b3('0x3d')]){_0x230d33[_0x59b3('0x3e')]=[{'all':!![]}];}return db[_0x59b3('0x3c')][_0x59b3('0x3f')](_0x230d33);})['then'](function(_0x4445eb){_0x357e04[_0x59b3('0x40')]=_0x4445eb;return _0x357e04;})['then'](respondWithFilteredResult(_0x54b08a,_0x230d33))['catch'](handleError(_0x54b08a,null));}; \ No newline at end of file +var _0xb401=['../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','pick','filters','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x267427,_0x11738f){var _0x548091=function(_0x4863bf){while(--_0x4863bf){_0x267427['push'](_0x267427['shift']());}};_0x548091(++_0x11738f);}(_0xb401,0xac));var _0x1b40=function(_0x4e3ebc,_0x5111ea){_0x4e3ebc=_0x4e3ebc-0x0;var _0x4bd1c9=_0xb401[_0x4e3ebc];return _0x4bd1c9;};'use strict';var emlformat=require(_0x1b40('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b40('0x1'));var jsonpatch=require(_0x1b40('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1b40('0x3'));var Mustache=require(_0x1b40('0x4'));var util=require(_0x1b40('0x5'));var path=require('path');var sox=require(_0x1b40('0x6'));var csv=require(_0x1b40('0x7'));var ejs=require(_0x1b40('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b40('0x9'));var squel=require('squel');var crypto=require(_0x1b40('0xa'));var jsforce=require(_0x1b40('0xb'));var deskjs=require(_0x1b40('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1b40('0xd'));var Papa=require(_0x1b40('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b40('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b40('0x10'));var logger=require('../../config/logger')(_0x1b40('0x11'));var utils=require(_0x1b40('0x12'));var config=require(_0x1b40('0x13'));var licenseUtil=require(_0x1b40('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4afbc2,_0xbde257){_0xbde257=_0xbde257||0xcc;return function(_0x564e30){if(_0x564e30){return _0x4afbc2[_0x1b40('0x15')](_0xbde257);}return _0x4afbc2[_0x1b40('0x16')](_0xbde257)[_0x1b40('0x17')]();};}function respondWithResult(_0x35e346,_0x32a7d9){_0x32a7d9=_0x32a7d9||0xc8;return function(_0x271b35){if(_0x271b35){return _0x35e346['status'](_0x32a7d9)[_0x1b40('0x18')](_0x271b35);}};}function respondWithFilteredResult(_0x5123a1,_0x20913a){return function(_0x41d6e3){if(_0x41d6e3){var _0x2870c4=typeof _0x20913a[_0x1b40('0x19')]===_0x1b40('0x1a')&&typeof _0x20913a[_0x1b40('0x1b')]==='undefined';var _0x2d5b6d=_0x41d6e3['count'];var _0xa028ba=_0x2870c4?0x0:_0x20913a['offset'];var _0x3cc9bd=_0x2870c4?_0x41d6e3[_0x1b40('0x1c')]:_0x20913a[_0x1b40('0x19')]+_0x20913a[_0x1b40('0x1b')];var _0x154094;if(_0x3cc9bd>=_0x2d5b6d){_0x3cc9bd=_0x2d5b6d;_0x154094=0xc8;}else{_0x154094=0xce;}_0x5123a1[_0x1b40('0x16')](_0x154094);return _0x5123a1['set'](_0x1b40('0x1d'),_0xa028ba+'-'+_0x3cc9bd+'/'+_0x2d5b6d)[_0x1b40('0x18')](_0x41d6e3);}return null;};}function patchUpdates(_0x1de1a4){return function(_0x56fbdb){try{jsonpatch[_0x1b40('0x1e')](_0x56fbdb,_0x1de1a4,!![]);}catch(_0xaf06a4){return BPromise[_0x1b40('0x1f')](_0xaf06a4);}return _0x56fbdb[_0x1b40('0x20')]();};}function saveUpdates(_0x410104,_0x597e19){return function(_0x267b08){if(_0x267b08){return _0x267b08[_0x1b40('0x21')](_0x410104)['then'](function(_0x1f27a0){return _0x1f27a0;});}return null;};}function removeEntity(_0x24f163,_0x161020){return function(_0x50a24b){if(_0x50a24b){return _0x50a24b['destroy']()[_0x1b40('0x22')](function(){_0x24f163[_0x1b40('0x16')](0xcc)[_0x1b40('0x17')]();});}};}function handleEntityNotFound(_0x5c07b9,_0x238bd0){return function(_0x3f11c9){if(!_0x3f11c9){_0x5c07b9[_0x1b40('0x15')](0x194);}return _0x3f11c9;};}function handleError(_0x504401,_0x26db01){_0x26db01=_0x26db01||0x1f4;return function(_0x25b10b){logger[_0x1b40('0x23')](_0x25b10b[_0x1b40('0x24')]);if(_0x25b10b[_0x1b40('0x25')]){delete _0x25b10b[_0x1b40('0x25')];}_0x504401[_0x1b40('0x16')](_0x26db01)[_0x1b40('0x26')](_0x25b10b);};}exports[_0x1b40('0x27')]=function(_0x2e1f63,_0x2f5bf8){var _0x1ea9be={},_0x5d543c={},_0x1c16d3={'count':0x0,'rows':[]};var _0xdb295d=_[_0x1b40('0x28')](db[_0x1b40('0x29')][_0x1b40('0x2a')],function(_0x84f1f7){return{'name':_0x84f1f7[_0x1b40('0x2b')],'type':_0x84f1f7[_0x1b40('0x2c')][_0x1b40('0x2d')]};});_0x5d543c[_0x1b40('0x2e')]=_[_0x1b40('0x28')](_0xdb295d,'name');_0x5d543c[_0x1b40('0x2f')]=_[_0x1b40('0x30')](_0x2e1f63[_0x1b40('0x2f')]);_0x5d543c['filters']=_[_0x1b40('0x31')](_0x5d543c[_0x1b40('0x2e')],_0x5d543c[_0x1b40('0x2f')]);_0x1ea9be[_0x1b40('0x32')]=_['intersection'](_0x5d543c[_0x1b40('0x2e')],qs[_0x1b40('0x33')](_0x2e1f63[_0x1b40('0x2f')][_0x1b40('0x33')]));_0x1ea9be['attributes']=_0x1ea9be['attributes']['length']?_0x1ea9be[_0x1b40('0x32')]:_0x5d543c[_0x1b40('0x2e')];if(!_0x2e1f63[_0x1b40('0x2f')][_0x1b40('0x34')]('nolimit')){_0x1ea9be[_0x1b40('0x1b')]=qs[_0x1b40('0x1b')](_0x2e1f63[_0x1b40('0x2f')][_0x1b40('0x1b')]);_0x1ea9be[_0x1b40('0x19')]=qs[_0x1b40('0x19')](_0x2e1f63[_0x1b40('0x2f')][_0x1b40('0x19')]);}_0x1ea9be['order']=qs[_0x1b40('0x35')](_0x2e1f63[_0x1b40('0x2f')][_0x1b40('0x35')]);_0x1ea9be['where']=qs['filters'](_[_0x1b40('0x36')](_0x2e1f63[_0x1b40('0x2f')],_0x5d543c[_0x1b40('0x37')]),_0xdb295d);if(_0x2e1f63[_0x1b40('0x2f')]['filter']){_0x1ea9be[_0x1b40('0x38')]=_[_0x1b40('0x39')](_0x1ea9be[_0x1b40('0x38')],{'$or':_[_0x1b40('0x28')](_0xdb295d,function(_0x29c934){if(_0x29c934[_0x1b40('0x2c')]!==_0x1b40('0x3a')){var _0x1b5b24={};_0x1b5b24[_0x29c934[_0x1b40('0x25')]]={'$like':'%'+_0x2e1f63[_0x1b40('0x2f')][_0x1b40('0x3b')]+'%'};return _0x1b5b24;}})});}_0x1ea9be=_[_0x1b40('0x39')]({},_0x1ea9be,_0x2e1f63[_0x1b40('0x3c')]);var _0xfea602={'where':_0x1ea9be[_0x1b40('0x38')]};return db[_0x1b40('0x29')]['count'](_0xfea602)[_0x1b40('0x22')](function(_0x1f2db4){_0x1c16d3[_0x1b40('0x1c')]=_0x1f2db4;if(_0x2e1f63['query'][_0x1b40('0x3d')]){_0x1ea9be['include']=[{'all':!![]}];}return db[_0x1b40('0x29')][_0x1b40('0x3e')](_0x1ea9be);})[_0x1b40('0x22')](function(_0x56c2cb){_0x1c16d3[_0x1b40('0x3f')]=_0x56c2cb;return _0x1c16d3;})[_0x1b40('0x22')](respondWithFilteredResult(_0x2f5bf8,_0x1ea9be))['catch'](handleError(_0x2f5bf8,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index d66e9e8..6b2ad43 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 _0x9b0c=['rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','api','bluebird','request-promise','path'];(function(_0x32890a,_0x1f3f36){var _0xc92d70=function(_0x508294){while(--_0x508294){_0x32890a['push'](_0x32890a['shift']());}};_0xc92d70(++_0x1f3f36);}(_0x9b0c,0x132));var _0xc9b0=function(_0x150417,_0x1ad82f){_0x150417=_0x150417-0x0;var _0x3dc372=_0x9b0c[_0x150417];return _0x3dc372;};'use strict';var _=require(_0xc9b0('0x0'));var util=require(_0xc9b0('0x1'));var logger=require('../../config/logger')(_0xc9b0('0x2'));var moment=require('moment');var BPromise=require(_0xc9b0('0x3'));var rp=require(_0xc9b0('0x4'));var fs=require('fs');var path=require(_0xc9b0('0x5'));var rimraf=require(_0xc9b0('0x6'));var config=require(_0xc9b0('0x7'));var attributes=require(_0xc9b0('0x8'));module[_0xc9b0('0x9')]=function(_0x179a56,_0xc97e4b){return _0x179a56[_0xc9b0('0xa')](_0xc9b0('0xb'),attributes,{'tableName':_0xc9b0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b8a=['define','migrations','../../config/logger','api','moment','request-promise','path','../../config/environment','exports'];(function(_0x22ab78,_0x436ebd){var _0x5dc502=function(_0x544a7c){while(--_0x544a7c){_0x22ab78['push'](_0x22ab78['shift']());}};_0x5dc502(++_0x436ebd);}(_0x2b8a,0x1a0));var _0xa2b8=function(_0xb2d841,_0xd6d7c6){_0xb2d841=_0xb2d841-0x0;var _0x3f186e=_0x2b8a[_0xb2d841];return _0x3f186e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa2b8('0x0'))(_0xa2b8('0x1'));var moment=require(_0xa2b8('0x2'));var BPromise=require('bluebird');var rp=require(_0xa2b8('0x3'));var fs=require('fs');var path=require(_0xa2b8('0x4'));var rimraf=require('rimraf');var config=require(_0xa2b8('0x5'));var attributes=require('./migration.attributes');module[_0xa2b8('0x6')]=function(_0x5007f3,_0x28f8ac){return _0x5007f3[_0xa2b8('0x7')]('Migration',attributes,{'tableName':_0xa2b8('0x8'),'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 4cd9cf4..3179511 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 _0x9d68=['http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9d68,0xaf));var _0x89d6=function(_0x409682,_0x370090){_0x409682=_0x409682-0x0;var _0x1ee901=_0x9d68[_0x409682];return _0x1ee901;};'use strict';var _=require('lodash');var util=require(_0x89d6('0x0'));var moment=require('moment');var BPromise=require(_0x89d6('0x1'));var rs=require(_0x89d6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89d6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x89d6('0x4'))(_0x89d6('0x5'));var config=require(_0x89d6('0x6'));var jayson=require(_0x89d6('0x7'));var client=jayson[_0x89d6('0x8')][_0x89d6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1799d0,_0x350cfb,_0x4e928f){return new BPromise(function(_0x3ede44,_0x1a6f48){return client[_0x89d6('0xa')](_0x1799d0,_0x4e928f)[_0x89d6('0xb')](function(_0x4ce9d9){logger[_0x89d6('0xc')](_0x89d6('0xd'),_0x350cfb,_0x89d6('0xe'));logger[_0x89d6('0xf')](_0x89d6('0x10'),_0x350cfb,_0x89d6('0xe'),JSON[_0x89d6('0x11')](_0x4ce9d9));if(_0x4ce9d9[_0x89d6('0x12')]){if(_0x4ce9d9['error'][_0x89d6('0x13')]===0x1f4){logger[_0x89d6('0x12')](_0x89d6('0xd'),_0x350cfb,_0x4ce9d9[_0x89d6('0x12')][_0x89d6('0x14')]);return _0x1a6f48(_0x4ce9d9['error']['message']);}logger['error'](_0x89d6('0xd'),_0x350cfb,_0x4ce9d9['error'][_0x89d6('0x14')]);return _0x3ede44(_0x4ce9d9[_0x89d6('0x12')][_0x89d6('0x14')]);}else{logger[_0x89d6('0xc')](_0x89d6('0xd'),_0x350cfb,_0x89d6('0xe'));_0x3ede44(_0x4ce9d9[_0x89d6('0x15')][_0x89d6('0x14')]);}})[_0x89d6('0x16')](function(_0x597e0d){logger['error'](_0x89d6('0xd'),_0x350cfb,_0x597e0d);_0x1a6f48(_0x597e0d);});});} \ No newline at end of file +var _0x7726=['request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2df5f3,_0x56a099){var _0x64b6d0=function(_0x62b423){while(--_0x62b423){_0x2df5f3['push'](_0x2df5f3['shift']());}};_0x64b6d0(++_0x56a099);}(_0x7726,0x107));var _0x6772=function(_0x16b0f0,_0x4540f9){_0x16b0f0=_0x16b0f0-0x0;var _0x5f2416=_0x7726[_0x16b0f0];return _0x5f2416;};'use strict';var _=require(_0x6772('0x0'));var util=require(_0x6772('0x1'));var moment=require(_0x6772('0x2'));var BPromise=require(_0x6772('0x3'));var rs=require(_0x6772('0x4'));var fs=require('fs');var Redis=require(_0x6772('0x5'));var db=require(_0x6772('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6772('0x7'))(_0x6772('0x8'));var config=require(_0x6772('0x9'));var jayson=require(_0x6772('0xa'));var client=jayson[_0x6772('0xb')][_0x6772('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f01bc,_0xe27108,_0x4c6205){return new BPromise(function(_0x4d9fcf,_0x1443ad){return client[_0x6772('0xd')](_0x2f01bc,_0x4c6205)[_0x6772('0xe')](function(_0x934ca8){logger[_0x6772('0xf')](_0x6772('0x10'),_0xe27108,_0x6772('0x11'));logger[_0x6772('0x12')](_0x6772('0x13'),_0xe27108,_0x6772('0x11'),JSON['stringify'](_0x934ca8));if(_0x934ca8[_0x6772('0x14')]){if(_0x934ca8[_0x6772('0x14')]['code']===0x1f4){logger[_0x6772('0x14')]('Migration,\x20%s,\x20%s',_0xe27108,_0x934ca8['error'][_0x6772('0x15')]);return _0x1443ad(_0x934ca8['error'][_0x6772('0x15')]);}logger[_0x6772('0x14')](_0x6772('0x10'),_0xe27108,_0x934ca8[_0x6772('0x14')]['message']);return _0x4d9fcf(_0x934ca8[_0x6772('0x14')]['message']);}else{logger[_0x6772('0xf')]('Migration,\x20%s,\x20%s',_0xe27108,_0x6772('0x11'));_0x4d9fcf(_0x934ca8[_0x6772('0x16')]['message']);}})['catch'](function(_0x36edd7){logger[_0x6772('0x14')]('Migration,\x20%s,\x20%s',_0xe27108,_0x36edd7);_0x1443ad(_0x36edd7);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 7a588f8..4af0650 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 _0x143c=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get'];(function(_0x19fc44,_0x4bca56){var _0x3414ec=function(_0x696b3d){while(--_0x696b3d){_0x19fc44['push'](_0x19fc44['shift']());}};_0x3414ec(++_0x4bca56);}(_0x143c,0x81));var _0xc143=function(_0x1fe14f,_0x36745d){_0x1fe14f=_0x1fe14f-0x0;var _0x4c4904=_0x143c[_0x1fe14f];return _0x4c4904;};'use strict';var multer=require('multer');var util=require(_0xc143('0x0'));var path=require(_0xc143('0x1'));var timeout=require(_0xc143('0x2'));var express=require(_0xc143('0x3'));var router=express[_0xc143('0x4')]();var fs_extra=require(_0xc143('0x5'));var auth=require(_0xc143('0x6'));var interaction=require(_0xc143('0x7'));var config=require(_0xc143('0x8'));var controller=require(_0xc143('0x9'));router[_0xc143('0xa')]('/',auth[_0xc143('0xb')](),controller[_0xc143('0xc')]);router[_0xc143('0xa')](_0xc143('0xd'),auth[_0xc143('0xb')](),controller[_0xc143('0xe')]);router[_0xc143('0xf')]('/',auth[_0xc143('0xb')](),controller[_0xc143('0x10')]);router[_0xc143('0x11')](_0xc143('0xd'),auth[_0xc143('0xb')](),controller['update']);router[_0xc143('0x12')](_0xc143('0xd'),auth[_0xc143('0xb')](),controller[_0xc143('0x13')]);module['exports']=router; \ No newline at end of file +var _0x41f9=['./network.controller','get','isAuthenticated','index','/:id','show','update','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x41f9,0x119));var _0x941f=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x41f9[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require(_0x941f('0x0'));var util=require('util');var path=require(_0x941f('0x1'));var timeout=require(_0x941f('0x2'));var express=require('express');var router=express[_0x941f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x941f('0x4'));var interaction=require(_0x941f('0x5'));var config=require(_0x941f('0x6'));var controller=require(_0x941f('0x7'));router[_0x941f('0x8')]('/',auth[_0x941f('0x9')](),controller[_0x941f('0xa')]);router['get'](_0x941f('0xb'),auth['isAuthenticated'](),controller[_0x941f('0xc')]);router['post']('/',auth[_0x941f('0x9')](),controller['create']);router['put'](_0x941f('0xb'),auth[_0x941f('0x9')](),controller[_0x941f('0xd')]);router[_0x941f('0xe')]('/:id',auth[_0x941f('0x9')](),controller[_0x941f('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 3f12534..2932970 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 _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x367567,_0x5ded2a){var _0x2bfce6=function(_0x268463){while(--_0x268463){_0x367567['push'](_0x367567['shift']());}};_0x2bfce6(++_0x5ded2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x3c5e93,_0x4b883e){var _0x2dc5a9=function(_0x37e70f){while(--_0x37e70f){_0x3c5e93['push'](_0x3c5e93['shift']());}};_0x2dc5a9(++_0x4b883e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index f32ceba..1d375de 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 _0x8ddc=['fast-json-patch','request-promise','moment','bluebird','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','stack','name','map','Network','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','show','includeAll','find','create','sequelize','transaction','body','findAll','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','update','params','STUN','TURN','toLowerCase','zip-dir'];(function(_0x57f340,_0x3edf9b){var _0x76037b=function(_0x1bd7ba){while(--_0x1bd7ba){_0x57f340['push'](_0x57f340['shift']());}};_0x76037b(++_0x3edf9b);}(_0x8ddc,0x1af));var _0xc8dd=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0x8ddc[_0x4de586];return _0x46baf5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc8dd('0x0'));var jsonpatch=require(_0xc8dd('0x1'));var rp=require(_0xc8dd('0x2'));var moment=require(_0xc8dd('0x3'));var BPromise=require(_0xc8dd('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc8dd('0x5'));var sox=require('sox');var csv=require(_0xc8dd('0x6'));var ejs=require(_0xc8dd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc8dd('0x8'));var squel=require(_0xc8dd('0x9'));var crypto=require(_0xc8dd('0xa'));var jsforce=require(_0xc8dd('0xb'));var deskjs=require(_0xc8dd('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc8dd('0xd'));var Redis=require(_0xc8dd('0xe'));var authService=require(_0xc8dd('0xf'));var qs=require(_0xc8dd('0x10'));var as=require(_0xc8dd('0x11'));var hardwareService=require(_0xc8dd('0x12'));var logger=require(_0xc8dd('0x13'))(_0xc8dd('0x14'));var utils=require(_0xc8dd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc8dd('0x16'));var db=require(_0xc8dd('0x17'))['db'];var jayson=require(_0xc8dd('0x18'));var client=jayson['client'][_0xc8dd('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4a1af1,_0x49568b,_0x41a2a3,_0x12e854){return new BPromise(function(_0x5bd512,_0x47ab54){var _0xd31a38=_0x12e854||client;return _0xd31a38[_0xc8dd('0x1a')](_0x4a1af1,_0x41a2a3)[_0xc8dd('0x1b')](function(_0xd9e991){logger[_0xc8dd('0x1c')](_0xc8dd('0x1d'),_0x49568b,_0xc8dd('0x1e'));logger[_0xc8dd('0x1f')](_0xc8dd('0x20'),_0x49568b,_0xc8dd('0x1e'),JSON[_0xc8dd('0x21')](_0xd9e991));if(_0xd9e991[_0xc8dd('0x22')]){if(_0xd9e991[_0xc8dd('0x22')][_0xc8dd('0x23')]===0x1f4){logger['error'](_0xc8dd('0x1d'),_0x49568b,_0xd9e991[_0xc8dd('0x22')][_0xc8dd('0x24')]);return _0x47ab54(_0xd9e991[_0xc8dd('0x22')][_0xc8dd('0x24')]);}logger[_0xc8dd('0x22')]('Network,\x20%s,\x20%s',_0x49568b,_0xd9e991['error'][_0xc8dd('0x24')]);return _0x5bd512(_0xd9e991[_0xc8dd('0x22')][_0xc8dd('0x24')]);}else{logger[_0xc8dd('0x1c')](_0xc8dd('0x1d'),_0x49568b,_0xc8dd('0x1e'));_0x5bd512(_0xd9e991[_0xc8dd('0x25')][_0xc8dd('0x24')]);}})[_0xc8dd('0x26')](function(_0x4d8842){logger[_0xc8dd('0x22')]('Network,\x20%s,\x20%s',_0x49568b,_0x4d8842);_0x47ab54(_0x4d8842);});});}function respondWithStatusCode(_0x445b1f,_0x58d8df){_0x58d8df=_0x58d8df||0xcc;return function(_0x1c17e2){if(_0x1c17e2){return _0x445b1f[_0xc8dd('0x27')](_0x58d8df);}return _0x445b1f[_0xc8dd('0x28')](_0x58d8df)[_0xc8dd('0x29')]();};}function respondWithResult(_0x5b69b7,_0x1adb48){_0x1adb48=_0x1adb48||0xc8;return function(_0x56f9e1){if(_0x56f9e1){return _0x5b69b7[_0xc8dd('0x28')](_0x1adb48)[_0xc8dd('0x2a')](_0x56f9e1);}};}function respondWithFilteredResult(_0x5e2f4c,_0x1cc01a){return function(_0x55de22){if(_0x55de22){var _0xf83062=typeof _0x1cc01a[_0xc8dd('0x2b')]==='undefined'&&typeof _0x1cc01a['limit']===_0xc8dd('0x2c');var _0x50a1f7=_0x55de22['count'];var _0x1b2ccb=_0xf83062?0x0:_0x1cc01a[_0xc8dd('0x2b')];var _0x4d27e1=_0xf83062?_0x55de22[_0xc8dd('0x2d')]:_0x1cc01a[_0xc8dd('0x2b')]+_0x1cc01a[_0xc8dd('0x2e')];var _0xcc1f64;if(_0x4d27e1>=_0x50a1f7){_0x4d27e1=_0x50a1f7;_0xcc1f64=0xc8;}else{_0xcc1f64=0xce;}_0x5e2f4c['status'](_0xcc1f64);return _0x5e2f4c[_0xc8dd('0x2f')](_0xc8dd('0x30'),_0x1b2ccb+'-'+_0x4d27e1+'/'+_0x50a1f7)[_0xc8dd('0x2a')](_0x55de22);}return null;};}function patchUpdates(_0xcbdc32){return function(_0x254edb){try{jsonpatch[_0xc8dd('0x31')](_0x254edb,_0xcbdc32,!![]);}catch(_0x2822bd){return BPromise[_0xc8dd('0x32')](_0x2822bd);}return _0x254edb[_0xc8dd('0x33')]();};}function saveUpdates(_0x20307d,_0x4b8167){return function(_0x2dfe29){if(_0x2dfe29){return _0x2dfe29['update'](_0x20307d)['then'](function(_0x47483d){return _0x47483d;});}return null;};}function removeEntity(_0x492198,_0x3dd84f){return function(_0xdf0d9f){if(_0xdf0d9f){return _0xdf0d9f[_0xc8dd('0x34')]()[_0xc8dd('0x1b')](function(){_0x492198['status'](0xcc)[_0xc8dd('0x29')]();});}};}function handleEntityNotFound(_0x576969,_0x3ddb4b){return function(_0x5e2b43){if(!_0x5e2b43){_0x576969[_0xc8dd('0x27')](0x194);}return _0x5e2b43;};}function handleError(_0x48e79b,_0x451831){_0x451831=_0x451831||0x1f4;return function(_0xbf7b21){logger['error'](_0xbf7b21[_0xc8dd('0x35')]);if(_0xbf7b21[_0xc8dd('0x36')]){delete _0xbf7b21['name'];}_0x48e79b[_0xc8dd('0x28')](_0x451831)['send'](_0xbf7b21);};}exports['index']=function(_0x1f4674,_0x480805){var _0x26d9dd={},_0x22ba0c={},_0x3834cf={'count':0x0,'rows':[]};var _0x2d770d=_[_0xc8dd('0x37')](db[_0xc8dd('0x38')][_0xc8dd('0x39')],function(_0x3510b9){return{'name':_0x3510b9['fieldName'],'type':_0x3510b9[_0xc8dd('0x3a')][_0xc8dd('0x3b')]};});_0x22ba0c[_0xc8dd('0x3c')]=_[_0xc8dd('0x37')](_0x2d770d,_0xc8dd('0x36'));_0x22ba0c[_0xc8dd('0x3d')]=_[_0xc8dd('0x3e')](_0x1f4674['query']);_0x22ba0c[_0xc8dd('0x3f')]=_[_0xc8dd('0x40')](_0x22ba0c[_0xc8dd('0x3c')],_0x22ba0c[_0xc8dd('0x3d')]);_0x26d9dd[_0xc8dd('0x41')]=_['intersection'](_0x22ba0c['model'],qs[_0xc8dd('0x42')](_0x1f4674[_0xc8dd('0x3d')][_0xc8dd('0x42')]));_0x26d9dd[_0xc8dd('0x41')]=_0x26d9dd['attributes'][_0xc8dd('0x43')]?_0x26d9dd[_0xc8dd('0x41')]:_0x22ba0c['model'];if(!_0x1f4674[_0xc8dd('0x3d')][_0xc8dd('0x44')](_0xc8dd('0x45'))){_0x26d9dd[_0xc8dd('0x2e')]=qs['limit'](_0x1f4674[_0xc8dd('0x3d')]['limit']);_0x26d9dd['offset']=qs[_0xc8dd('0x2b')](_0x1f4674['query'][_0xc8dd('0x2b')]);}_0x26d9dd[_0xc8dd('0x46')]=qs['sort'](_0x1f4674[_0xc8dd('0x3d')][_0xc8dd('0x47')]);_0x26d9dd[_0xc8dd('0x48')]=qs[_0xc8dd('0x3f')](_['pick'](_0x1f4674[_0xc8dd('0x3d')],_0x22ba0c[_0xc8dd('0x3f')]),_0x2d770d);if(_0x1f4674[_0xc8dd('0x3d')][_0xc8dd('0x49')]){_0x26d9dd[_0xc8dd('0x48')]=_[_0xc8dd('0x4a')](_0x26d9dd[_0xc8dd('0x48')],{'$or':_['map'](_0x2d770d,function(_0x369dda){if(_0x369dda['type']!==_0xc8dd('0x4b')){var _0x4b35af={};_0x4b35af[_0x369dda[_0xc8dd('0x36')]]={'$like':'%'+_0x1f4674[_0xc8dd('0x3d')][_0xc8dd('0x49')]+'%'};return _0x4b35af;}})});}_0x26d9dd=_['merge']({},_0x26d9dd,_0x1f4674[_0xc8dd('0x4c')]);var _0xd36bd2={'where':_0x26d9dd['where']};return db[_0xc8dd('0x38')]['count'](_0xd36bd2)[_0xc8dd('0x1b')](function(_0x3ba2d8){_0x3834cf[_0xc8dd('0x2d')]=_0x3ba2d8;if(_0x1f4674[_0xc8dd('0x3d')]['includeAll']){_0x26d9dd[_0xc8dd('0x4d')]=[{'all':!![]}];}return db[_0xc8dd('0x38')]['findAll'](_0x26d9dd);})[_0xc8dd('0x1b')](function(_0x2d8160){_0x3834cf[_0xc8dd('0x4e')]=_0x2d8160;return _0x3834cf;})[_0xc8dd('0x1b')](respondWithFilteredResult(_0x480805,_0x26d9dd))[_0xc8dd('0x26')](handleError(_0x480805,null));};exports[_0xc8dd('0x4f')]=function(_0x51d64d,_0x17db31){var _0x57db4f={'raw':!![],'where':{'id':_0x51d64d['params']['id']}},_0x453f08={};_0x453f08['model']=_[_0xc8dd('0x3e')](db['Network'][_0xc8dd('0x39')]);_0x453f08[_0xc8dd('0x3d')]=_[_0xc8dd('0x3e')](_0x51d64d[_0xc8dd('0x3d')]);_0x453f08[_0xc8dd('0x3f')]=_['intersection'](_0x453f08[_0xc8dd('0x3c')],_0x453f08[_0xc8dd('0x3d')]);_0x57db4f['attributes']=_[_0xc8dd('0x40')](_0x453f08[_0xc8dd('0x3c')],qs[_0xc8dd('0x42')](_0x51d64d['query'][_0xc8dd('0x42')]));_0x57db4f[_0xc8dd('0x41')]=_0x57db4f['attributes'][_0xc8dd('0x43')]?_0x57db4f['attributes']:_0x453f08[_0xc8dd('0x3c')];if(_0x51d64d['query'][_0xc8dd('0x50')]){_0x57db4f[_0xc8dd('0x4d')]=[{'all':!![]}];}_0x57db4f=_[_0xc8dd('0x4a')]({},_0x57db4f,_0x51d64d[_0xc8dd('0x4c')]);return db[_0xc8dd('0x38')][_0xc8dd('0x51')](_0x57db4f)['then'](handleEntityNotFound(_0x17db31,null))[_0xc8dd('0x1b')](respondWithResult(_0x17db31,null))[_0xc8dd('0x26')](handleError(_0x17db31,null));};exports[_0xc8dd('0x52')]=function(_0x3dfb8d,_0x2239ef,_0x278c35){var _0x580850;return db[_0xc8dd('0x53')][_0xc8dd('0x54')](function(_0x1b84b2){return db[_0xc8dd('0x38')]['create'](_0x3dfb8d[_0xc8dd('0x55')],{'raw':!![]})[_0xc8dd('0x1b')](function(_0x33ae23){_0x580850=_0x33ae23;return db[_0xc8dd('0x38')][_0xc8dd('0x56')]({'where':{'type':_0x3dfb8d[_0xc8dd('0x55')][_0xc8dd('0x3a')]},'raw':!![]});})['then'](function(_0x3d89a7){if(_0x580850['type'][_0xc8dd('0x57')]()=='STUN'){var _0x4ee275=fs[_0xc8dd('0x58')](path[_0xc8dd('0x59')](config[_0xc8dd('0x5a')],_0xc8dd('0x5b')),_0xc8dd('0x5c'));var _0x18762d=ejs[_0xc8dd('0x5d')](_0x4ee275,{'networks':_0x3d89a7||[]});fs[_0xc8dd('0x5e')](_0xc8dd('0x5f'),_0x18762d);return respondWithRpcPromise(_0xc8dd('0x60'),_0xc8dd('0x52'),{'module':_0xc8dd('0x61')});}else if(_0x580850['type'][_0xc8dd('0x57')]()=='TURN'){var _0x348181=fs[_0xc8dd('0x58')](path[_0xc8dd('0x59')](config[_0xc8dd('0x5a')],_0xc8dd('0x62')),'utf8');var _0x5e03fb=ejs[_0xc8dd('0x5d')](_0x348181,{'networks':_0x3d89a7||[]});fs['writeFileSync'](_0xc8dd('0x63'),_0x5e03fb);return respondWithRpcPromise(_0xc8dd('0x60'),'create',{'module':_0xc8dd('0x61')});}else{var _0x8a4bb9=fs['readFileSync'](path['join'](config['root'],_0xc8dd('0x64')),_0xc8dd('0x5c'));var _0x2f6a4a=ejs[_0xc8dd('0x5d')](_0x8a4bb9,{'networks':_0x3d89a7||[]});fs['writeFileSync'](util['format'](_0xc8dd('0x65'),_0x3dfb8d[_0xc8dd('0x55')][_0xc8dd('0x3a')]['toLowerCase']()),_0x2f6a4a);return respondWithRpcPromise(_0xc8dd('0x60'),_0xc8dd('0x52'),{'module':_0xc8dd('0x66')});}return null;})['then'](function(){return _0x580850;});})[_0xc8dd('0x1b')](respondWithResult(_0x2239ef,0xc9))[_0xc8dd('0x26')](handleError(_0x2239ef,null));};exports[_0xc8dd('0x67')]=function(_0x11959a,_0x29d1f8,_0x8338ba){var _0x3d615b;return db[_0xc8dd('0x53')][_0xc8dd('0x54')](function(_0x437a88){return db['Network'][_0xc8dd('0x51')]({'where':{'id':_0x11959a[_0xc8dd('0x68')]['id']}})[_0xc8dd('0x1b')](handleEntityNotFound(_0x29d1f8,null))[_0xc8dd('0x1b')](saveUpdates(_0x11959a[_0xc8dd('0x55')],null))[_0xc8dd('0x1b')](function(_0x9fcec7){if(_0x9fcec7){_0x3d615b=_0x9fcec7;return db['Network'][_0xc8dd('0x56')]({'where':{'type':_0x3d615b[_0xc8dd('0x3a')]},'raw':!![]});}return null;})[_0xc8dd('0x1b')](function(_0x4b5a99){if(_0x3d615b[_0xc8dd('0x3a')][_0xc8dd('0x57')]()==_0xc8dd('0x69')){var _0x25fbb0=fs[_0xc8dd('0x58')](path[_0xc8dd('0x59')](config[_0xc8dd('0x5a')],'server/files/templates/stun_multiple.ejs'),_0xc8dd('0x5c'));var _0x3f66a0=ejs[_0xc8dd('0x5d')](_0x25fbb0,{'networks':_0x4b5a99||[]});fs[_0xc8dd('0x5e')](_0xc8dd('0x5f'),_0x3f66a0);return respondWithRpcPromise(_0xc8dd('0x60'),_0xc8dd('0x67'),{'module':_0xc8dd('0x61')});}else if(_0x3d615b['type'][_0xc8dd('0x57')]()==_0xc8dd('0x6a')){var _0xdcc804=fs[_0xc8dd('0x58')](path[_0xc8dd('0x59')](config[_0xc8dd('0x5a')],_0xc8dd('0x62')),_0xc8dd('0x5c'));var _0x2de69e=ejs['render'](_0xdcc804,{'networks':_0x4b5a99||[]});fs[_0xc8dd('0x5e')]('/etc/asterisk/turn_xcally.conf',_0x2de69e);return respondWithRpcPromise('Reload',_0xc8dd('0x67'),{'module':'res_stun_monitor.so'});}else{var _0x285137=fs[_0xc8dd('0x58')](path['join'](config['root'],_0xc8dd('0x64')),'utf8');var _0x177324=ejs[_0xc8dd('0x5d')](_0x285137,{'networks':_0x4b5a99||[]});fs[_0xc8dd('0x5e')](util['format'](_0xc8dd('0x65'),_0x11959a[_0xc8dd('0x55')][_0xc8dd('0x3a')][_0xc8dd('0x6b')]()),_0x177324);return respondWithRpcPromise('Reload','update',{'module':_0xc8dd('0x66')});}return null;})[_0xc8dd('0x1b')](function(_0x134583){if(_0x134583){return _0x3d615b;}return null;});})[_0xc8dd('0x1b')](respondWithResult(_0x29d1f8,null))[_0xc8dd('0x26')](handleError(_0x29d1f8,null));};exports[_0xc8dd('0x34')]=function(_0x113b83,_0x4bb482,_0x555db2){var _0x15c107;return db[_0xc8dd('0x38')][_0xc8dd('0x51')]({'where':{'id':_0x113b83['params']['id']}})['then'](function(_0x251b82){_0x15c107=_0x251b82;return _0x251b82;})[_0xc8dd('0x1b')](handleEntityNotFound(_0x4bb482,null))[_0xc8dd('0x1b')](removeEntity(_0x4bb482,null))[_0xc8dd('0x1b')](function(){if(_0x15c107){return db[_0xc8dd('0x38')][_0xc8dd('0x56')]({'where':{'type':_0x15c107[_0xc8dd('0x3a')]},'raw':!![]});}})['then'](function(_0x3c35a3){if(_0x15c107[_0xc8dd('0x3a')][_0xc8dd('0x57')]()==_0xc8dd('0x69')){var _0xd6dc79=fs[_0xc8dd('0x58')](path['join'](config[_0xc8dd('0x5a')],_0xc8dd('0x5b')),_0xc8dd('0x5c'));var _0x47d283=ejs[_0xc8dd('0x5d')](_0xd6dc79,{'networks':_0x3c35a3||[]});fs['writeFileSync'](_0xc8dd('0x5f'),_0x47d283);return respondWithRpcPromise(_0xc8dd('0x60'),_0xc8dd('0x34'),{'module':_0xc8dd('0x61')});}else if(_0x15c107['type']['toUpperCase']()==_0xc8dd('0x6a')){var _0x43dba8=fs[_0xc8dd('0x58')](path[_0xc8dd('0x59')](config[_0xc8dd('0x5a')],_0xc8dd('0x62')),_0xc8dd('0x5c'));var _0x20bbdf=ejs[_0xc8dd('0x5d')](_0x43dba8,{'networks':_0x3c35a3||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x20bbdf);return respondWithRpcPromise(_0xc8dd('0x60'),'destroy',{'module':_0xc8dd('0x61')});}else{var _0x8e668=fs[_0xc8dd('0x58')](path[_0xc8dd('0x59')](config[_0xc8dd('0x5a')],_0xc8dd('0x64')),_0xc8dd('0x5c'));var _0x2717ef=ejs[_0xc8dd('0x5d')](_0x8e668,{'networks':_0x3c35a3||[]});fs[_0xc8dd('0x5e')](util['format'](_0xc8dd('0x65'),_0x113b83[_0xc8dd('0x55')][_0xc8dd('0x3a')][_0xc8dd('0x6b')]()),_0x2717ef);return respondWithRpcPromise('Reload',_0xc8dd('0x34'),{'module':_0xc8dd('0x66')});}return null;})[_0xc8dd('0x26')](handleError(_0x4bb482,null));}; \ No newline at end of file +var _0xd590=['Reload','res_stun_monitor.so','server/files/templates/network.ejs','toLowerCase','chan_sip.so','render','TURN','/etc/asterisk/sip_xcally_%s.conf','format','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','Network,\x20%s,\x20%s','request\x20sent','result','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','Network','includeAll','include','findAll','catch','params','rawAttributes','options','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf'];(function(_0x551666,_0x687957){var _0x4b37ff=function(_0x332ce1){while(--_0x332ce1){_0x551666['push'](_0x551666['shift']());}};_0x4b37ff(++_0x687957);}(_0xd590,0xdb));var _0x0d59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd590[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d59('0x0'));var zipdir=require(_0x0d59('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d59('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0d59('0x3'));var util=require(_0x0d59('0x4'));var path=require(_0x0d59('0x5'));var sox=require('sox');var csv=require(_0x0d59('0x6'));var ejs=require(_0x0d59('0x7'));var fs=require('fs');var fs_extra=require(_0x0d59('0x8'));var _=require(_0x0d59('0x9'));var squel=require(_0x0d59('0xa'));var crypto=require(_0x0d59('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0d59('0xc'));var toCsv=require(_0x0d59('0x6'));var querystring=require('querystring');var Papa=require(_0x0d59('0xd'));var Redis=require(_0x0d59('0xe'));var authService=require(_0x0d59('0xf'));var qs=require(_0x0d59('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d59('0x11'));var logger=require(_0x0d59('0x12'))(_0x0d59('0x13'));var utils=require(_0x0d59('0x14'));var config=require(_0x0d59('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d59('0x16'))['db'];var jayson=require(_0x0d59('0x17'));var client=jayson[_0x0d59('0x18')][_0x0d59('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x552314,_0x12585e,_0x527dec,_0x40380d){return new BPromise(function(_0x3d9cbb,_0x4dcb24){var _0x50b24c=_0x40380d||client;return _0x50b24c[_0x0d59('0x1a')](_0x552314,_0x527dec)[_0x0d59('0x1b')](function(_0x4fcba3){logger[_0x0d59('0x1c')]('Network,\x20%s,\x20%s',_0x12585e,'request\x20sent');logger[_0x0d59('0x1d')](_0x0d59('0x1e'),_0x12585e,'request\x20sent',JSON[_0x0d59('0x1f')](_0x4fcba3));if(_0x4fcba3['error']){if(_0x4fcba3['error']['code']===0x1f4){logger[_0x0d59('0x20')]('Network,\x20%s,\x20%s',_0x12585e,_0x4fcba3['error'][_0x0d59('0x21')]);return _0x4dcb24(_0x4fcba3['error']['message']);}logger['error'](_0x0d59('0x22'),_0x12585e,_0x4fcba3[_0x0d59('0x20')]['message']);return _0x3d9cbb(_0x4fcba3['error'][_0x0d59('0x21')]);}else{logger[_0x0d59('0x1c')](_0x0d59('0x22'),_0x12585e,_0x0d59('0x23'));_0x3d9cbb(_0x4fcba3[_0x0d59('0x24')][_0x0d59('0x21')]);}})['catch'](function(_0x2ba6c2){logger[_0x0d59('0x20')](_0x0d59('0x22'),_0x12585e,_0x2ba6c2);_0x4dcb24(_0x2ba6c2);});});}function respondWithStatusCode(_0x46dc11,_0x5e538a){_0x5e538a=_0x5e538a||0xcc;return function(_0x33a030){if(_0x33a030){return _0x46dc11['sendStatus'](_0x5e538a);}return _0x46dc11[_0x0d59('0x25')](_0x5e538a)['end']();};}function respondWithResult(_0x282c7f,_0x2d682c){_0x2d682c=_0x2d682c||0xc8;return function(_0x404b9f){if(_0x404b9f){return _0x282c7f[_0x0d59('0x25')](_0x2d682c)[_0x0d59('0x26')](_0x404b9f);}};}function respondWithFilteredResult(_0x18e670,_0xb28b8a){return function(_0xea8e25){if(_0xea8e25){var _0x4dc8b2=typeof _0xb28b8a[_0x0d59('0x27')]===_0x0d59('0x28')&&typeof _0xb28b8a[_0x0d59('0x29')]==='undefined';var _0x56e21a=_0xea8e25[_0x0d59('0x2a')];var _0x21b368=_0x4dc8b2?0x0:_0xb28b8a['offset'];var _0x373ee7=_0x4dc8b2?_0xea8e25[_0x0d59('0x2a')]:_0xb28b8a['offset']+_0xb28b8a['limit'];var _0x136975;if(_0x373ee7>=_0x56e21a){_0x373ee7=_0x56e21a;_0x136975=0xc8;}else{_0x136975=0xce;}_0x18e670['status'](_0x136975);return _0x18e670[_0x0d59('0x2b')]('Content-Range',_0x21b368+'-'+_0x373ee7+'/'+_0x56e21a)['json'](_0xea8e25);}return null;};}function patchUpdates(_0x10a777){return function(_0x540ba0){try{jsonpatch[_0x0d59('0x2c')](_0x540ba0,_0x10a777,!![]);}catch(_0x471906){return BPromise[_0x0d59('0x2d')](_0x471906);}return _0x540ba0[_0x0d59('0x2e')]();};}function saveUpdates(_0x2b2fbc,_0x408905){return function(_0x105c78){if(_0x105c78){return _0x105c78[_0x0d59('0x2f')](_0x2b2fbc)[_0x0d59('0x1b')](function(_0x3a4b16){return _0x3a4b16;});}return null;};}function removeEntity(_0x5a310b,_0x5270e2){return function(_0x5b810c){if(_0x5b810c){return _0x5b810c[_0x0d59('0x30')]()['then'](function(){_0x5a310b[_0x0d59('0x25')](0xcc)[_0x0d59('0x31')]();});}};}function handleEntityNotFound(_0x29eb5c,_0x414afe){return function(_0x48c9cb){if(!_0x48c9cb){_0x29eb5c[_0x0d59('0x32')](0x194);}return _0x48c9cb;};}function handleError(_0x456da1,_0xe921ea){_0xe921ea=_0xe921ea||0x1f4;return function(_0x1fc944){logger[_0x0d59('0x20')](_0x1fc944['stack']);if(_0x1fc944[_0x0d59('0x33')]){delete _0x1fc944[_0x0d59('0x33')];}_0x456da1['status'](_0xe921ea)[_0x0d59('0x34')](_0x1fc944);};}exports[_0x0d59('0x35')]=function(_0x538365,_0x806224){var _0x1a8f10={},_0x49f361={},_0x1e5e87={'count':0x0,'rows':[]};var _0x1d453a=_[_0x0d59('0x36')](db['Network']['rawAttributes'],function(_0x348ea5){return{'name':_0x348ea5[_0x0d59('0x37')],'type':_0x348ea5[_0x0d59('0x38')]['key']};});_0x49f361[_0x0d59('0x39')]=_[_0x0d59('0x36')](_0x1d453a,_0x0d59('0x33'));_0x49f361['query']=_[_0x0d59('0x3a')](_0x538365['query']);_0x49f361[_0x0d59('0x3b')]=_[_0x0d59('0x3c')](_0x49f361['model'],_0x49f361[_0x0d59('0x3d')]);_0x1a8f10[_0x0d59('0x3e')]=_['intersection'](_0x49f361['model'],qs[_0x0d59('0x3f')](_0x538365['query'][_0x0d59('0x3f')]));_0x1a8f10[_0x0d59('0x3e')]=_0x1a8f10[_0x0d59('0x3e')][_0x0d59('0x40')]?_0x1a8f10['attributes']:_0x49f361[_0x0d59('0x39')];if(!_0x538365[_0x0d59('0x3d')][_0x0d59('0x41')]('nolimit')){_0x1a8f10[_0x0d59('0x29')]=qs[_0x0d59('0x29')](_0x538365[_0x0d59('0x3d')]['limit']);_0x1a8f10[_0x0d59('0x27')]=qs[_0x0d59('0x27')](_0x538365[_0x0d59('0x3d')][_0x0d59('0x27')]);}_0x1a8f10[_0x0d59('0x42')]=qs[_0x0d59('0x43')](_0x538365[_0x0d59('0x3d')][_0x0d59('0x43')]);_0x1a8f10[_0x0d59('0x44')]=qs[_0x0d59('0x3b')](_[_0x0d59('0x45')](_0x538365['query'],_0x49f361[_0x0d59('0x3b')]),_0x1d453a);if(_0x538365[_0x0d59('0x3d')][_0x0d59('0x46')]){_0x1a8f10['where']=_[_0x0d59('0x47')](_0x1a8f10['where'],{'$or':_[_0x0d59('0x36')](_0x1d453a,function(_0x4e5ea3){if(_0x4e5ea3[_0x0d59('0x38')]!=='VIRTUAL'){var _0x4afb1e={};_0x4afb1e[_0x4e5ea3[_0x0d59('0x33')]]={'$like':'%'+_0x538365[_0x0d59('0x3d')][_0x0d59('0x46')]+'%'};return _0x4afb1e;}})});}_0x1a8f10=_['merge']({},_0x1a8f10,_0x538365['options']);var _0x408e32={'where':_0x1a8f10[_0x0d59('0x44')]};return db[_0x0d59('0x48')][_0x0d59('0x2a')](_0x408e32)[_0x0d59('0x1b')](function(_0x37c86b){_0x1e5e87['count']=_0x37c86b;if(_0x538365[_0x0d59('0x3d')][_0x0d59('0x49')]){_0x1a8f10[_0x0d59('0x4a')]=[{'all':!![]}];}return db[_0x0d59('0x48')][_0x0d59('0x4b')](_0x1a8f10);})[_0x0d59('0x1b')](function(_0x5e7ee2){_0x1e5e87['rows']=_0x5e7ee2;return _0x1e5e87;})['then'](respondWithFilteredResult(_0x806224,_0x1a8f10))[_0x0d59('0x4c')](handleError(_0x806224,null));};exports['show']=function(_0x33b54d,_0x1ce6e4){var _0x2da1fd={'raw':!![],'where':{'id':_0x33b54d[_0x0d59('0x4d')]['id']}},_0x272e63={};_0x272e63[_0x0d59('0x39')]=_['keys'](db[_0x0d59('0x48')][_0x0d59('0x4e')]);_0x272e63[_0x0d59('0x3d')]=_[_0x0d59('0x3a')](_0x33b54d[_0x0d59('0x3d')]);_0x272e63[_0x0d59('0x3b')]=_['intersection'](_0x272e63['model'],_0x272e63[_0x0d59('0x3d')]);_0x2da1fd[_0x0d59('0x3e')]=_[_0x0d59('0x3c')](_0x272e63['model'],qs[_0x0d59('0x3f')](_0x33b54d[_0x0d59('0x3d')][_0x0d59('0x3f')]));_0x2da1fd['attributes']=_0x2da1fd[_0x0d59('0x3e')][_0x0d59('0x40')]?_0x2da1fd[_0x0d59('0x3e')]:_0x272e63[_0x0d59('0x39')];if(_0x33b54d['query'][_0x0d59('0x49')]){_0x2da1fd[_0x0d59('0x4a')]=[{'all':!![]}];}_0x2da1fd=_[_0x0d59('0x47')]({},_0x2da1fd,_0x33b54d[_0x0d59('0x4f')]);return db[_0x0d59('0x48')][_0x0d59('0x50')](_0x2da1fd)[_0x0d59('0x1b')](handleEntityNotFound(_0x1ce6e4,null))['then'](respondWithResult(_0x1ce6e4,null))[_0x0d59('0x4c')](handleError(_0x1ce6e4,null));};exports[_0x0d59('0x51')]=function(_0x11df76,_0x50d558,_0x3a6ee0){var _0x3e9b29;return db[_0x0d59('0x52')][_0x0d59('0x53')](function(_0x2ff40c){return db[_0x0d59('0x48')][_0x0d59('0x51')](_0x11df76[_0x0d59('0x54')],{'raw':!![]})[_0x0d59('0x1b')](function(_0x3d780c){_0x3e9b29=_0x3d780c;return db[_0x0d59('0x48')][_0x0d59('0x4b')]({'where':{'type':_0x11df76[_0x0d59('0x54')][_0x0d59('0x38')]},'raw':!![]});})['then'](function(_0x441973){if(_0x3e9b29['type'][_0x0d59('0x55')]()==_0x0d59('0x56')){var _0xfb5e00=fs[_0x0d59('0x57')](path[_0x0d59('0x58')](config[_0x0d59('0x59')],_0x0d59('0x5a')),_0x0d59('0x5b'));var _0x2f2d6b=ejs['render'](_0xfb5e00,{'networks':_0x441973||[]});fs[_0x0d59('0x5c')](_0x0d59('0x5d'),_0x2f2d6b);return respondWithRpcPromise('Reload',_0x0d59('0x51'),{'module':'res_stun_monitor.so'});}else if(_0x3e9b29[_0x0d59('0x38')]['toUpperCase']()=='TURN'){var _0x35071e=fs[_0x0d59('0x57')](path[_0x0d59('0x58')](config[_0x0d59('0x59')],_0x0d59('0x5e')),_0x0d59('0x5b'));var _0x4d9c57=ejs['render'](_0x35071e,{'networks':_0x441973||[]});fs[_0x0d59('0x5c')](_0x0d59('0x5f'),_0x4d9c57);return respondWithRpcPromise(_0x0d59('0x60'),_0x0d59('0x51'),{'module':_0x0d59('0x61')});}else{var _0x381c00=fs[_0x0d59('0x57')](path[_0x0d59('0x58')](config[_0x0d59('0x59')],_0x0d59('0x62')),_0x0d59('0x5b'));var _0x59d4a0=ejs['render'](_0x381c00,{'networks':_0x441973||[]});fs[_0x0d59('0x5c')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x11df76[_0x0d59('0x54')][_0x0d59('0x38')][_0x0d59('0x63')]()),_0x59d4a0);return respondWithRpcPromise(_0x0d59('0x60'),_0x0d59('0x51'),{'module':_0x0d59('0x64')});}return null;})[_0x0d59('0x1b')](function(){return _0x3e9b29;});})[_0x0d59('0x1b')](respondWithResult(_0x50d558,0xc9))['catch'](handleError(_0x50d558,null));};exports['update']=function(_0x5b4d10,_0x1ad66f,_0x1a79fb){var _0x3d75fb;return db['sequelize'][_0x0d59('0x53')](function(_0x2286d7){return db[_0x0d59('0x48')][_0x0d59('0x50')]({'where':{'id':_0x5b4d10[_0x0d59('0x4d')]['id']}})[_0x0d59('0x1b')](handleEntityNotFound(_0x1ad66f,null))[_0x0d59('0x1b')](saveUpdates(_0x5b4d10[_0x0d59('0x54')],null))[_0x0d59('0x1b')](function(_0x26f3b2){if(_0x26f3b2){_0x3d75fb=_0x26f3b2;return db[_0x0d59('0x48')][_0x0d59('0x4b')]({'where':{'type':_0x3d75fb[_0x0d59('0x38')]},'raw':!![]});}return null;})[_0x0d59('0x1b')](function(_0x25dace){if(_0x3d75fb[_0x0d59('0x38')]['toUpperCase']()==_0x0d59('0x56')){var _0x53d933=fs[_0x0d59('0x57')](path[_0x0d59('0x58')](config['root'],_0x0d59('0x5a')),_0x0d59('0x5b'));var _0xc44b4c=ejs[_0x0d59('0x65')](_0x53d933,{'networks':_0x25dace||[]});fs[_0x0d59('0x5c')](_0x0d59('0x5d'),_0xc44b4c);return respondWithRpcPromise('Reload',_0x0d59('0x2f'),{'module':_0x0d59('0x61')});}else if(_0x3d75fb[_0x0d59('0x38')][_0x0d59('0x55')]()==_0x0d59('0x66')){var _0x1d1d5c=fs[_0x0d59('0x57')](path[_0x0d59('0x58')](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x53cd40=ejs['render'](_0x1d1d5c,{'networks':_0x25dace||[]});fs[_0x0d59('0x5c')](_0x0d59('0x5f'),_0x53cd40);return respondWithRpcPromise(_0x0d59('0x60'),'update',{'module':_0x0d59('0x61')});}else{var _0x5a5a99=fs[_0x0d59('0x57')](path['join'](config['root'],_0x0d59('0x62')),_0x0d59('0x5b'));var _0x1ae73c=ejs[_0x0d59('0x65')](_0x5a5a99,{'networks':_0x25dace||[]});fs[_0x0d59('0x5c')](util['format'](_0x0d59('0x67'),_0x5b4d10['body'][_0x0d59('0x38')][_0x0d59('0x63')]()),_0x1ae73c);return respondWithRpcPromise(_0x0d59('0x60'),'update',{'module':_0x0d59('0x64')});}return null;})[_0x0d59('0x1b')](function(_0x346d7d){if(_0x346d7d){return _0x3d75fb;}return null;});})[_0x0d59('0x1b')](respondWithResult(_0x1ad66f,null))[_0x0d59('0x4c')](handleError(_0x1ad66f,null));};exports[_0x0d59('0x30')]=function(_0x534ed0,_0x539567,_0x14f65a){var _0x58c47e;return db['Network'][_0x0d59('0x50')]({'where':{'id':_0x534ed0['params']['id']}})[_0x0d59('0x1b')](function(_0x81e2d3){_0x58c47e=_0x81e2d3;return _0x81e2d3;})['then'](handleEntityNotFound(_0x539567,null))[_0x0d59('0x1b')](removeEntity(_0x539567,null))[_0x0d59('0x1b')](function(){if(_0x58c47e){return db[_0x0d59('0x48')][_0x0d59('0x4b')]({'where':{'type':_0x58c47e[_0x0d59('0x38')]},'raw':!![]});}})[_0x0d59('0x1b')](function(_0x4f34c7){if(_0x58c47e['type'][_0x0d59('0x55')]()=='STUN'){var _0x34d478=fs['readFileSync'](path['join'](config[_0x0d59('0x59')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x5e200a=ejs[_0x0d59('0x65')](_0x34d478,{'networks':_0x4f34c7||[]});fs[_0x0d59('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x5e200a);return respondWithRpcPromise(_0x0d59('0x60'),_0x0d59('0x30'),{'module':'res_stun_monitor.so'});}else if(_0x58c47e[_0x0d59('0x38')][_0x0d59('0x55')]()==_0x0d59('0x66')){var _0x3db622=fs[_0x0d59('0x57')](path[_0x0d59('0x58')](config[_0x0d59('0x59')],_0x0d59('0x5e')),'utf8');var _0x6bec21=ejs[_0x0d59('0x65')](_0x3db622,{'networks':_0x4f34c7||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x6bec21);return respondWithRpcPromise(_0x0d59('0x60'),_0x0d59('0x30'),{'module':'res_stun_monitor.so'});}else{var _0x9ceb91=fs[_0x0d59('0x57')](path[_0x0d59('0x58')](config[_0x0d59('0x59')],_0x0d59('0x62')),'utf8');var _0x58e5a1=ejs['render'](_0x9ceb91,{'networks':_0x4f34c7||[]});fs[_0x0d59('0x5c')](util[_0x0d59('0x68')](_0x0d59('0x67'),_0x534ed0['body'][_0x0d59('0x38')][_0x0d59('0x63')]()),_0x58e5a1);return respondWithRpcPromise(_0x0d59('0x60'),_0x0d59('0x30'),{'module':_0x0d59('0x64')});}return null;})[_0x0d59('0x4c')](handleError(_0x539567,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 5b7ba34..c5c9efb 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 _0x3866=['Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','define'];(function(_0xc80b2e,_0x206b35){var _0x16754c=function(_0x43f22e){while(--_0x43f22e){_0xc80b2e['push'](_0xc80b2e['shift']());}};_0x16754c(++_0x206b35);}(_0x3866,0x1de));var _0x6386=function(_0x425e6a,_0x169c75){_0x425e6a=_0x425e6a-0x0;var _0x17f5e9=_0x3866[_0x425e6a];return _0x17f5e9;};'use strict';var _=require(_0x6386('0x0'));var util=require(_0x6386('0x1'));var logger=require(_0x6386('0x2'))(_0x6386('0x3'));var moment=require(_0x6386('0x4'));var BPromise=require(_0x6386('0x5'));var rp=require(_0x6386('0x6'));var fs=require('fs');var path=require(_0x6386('0x7'));var rimraf=require(_0x6386('0x8'));var config=require(_0x6386('0x9'));var attributes=require(_0x6386('0xa'));module['exports']=function(_0x237e40,_0x4446ad){return _0x237e40[_0x6386('0xb')](_0x6386('0xc'),attributes,{'tableName':_0x6386('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf17f=['bluebird','request-promise','path','rimraf','./network.attributes','define','lodash','util','../../config/logger','api'];(function(_0x52e519,_0x3af35a){var _0x2c27d9=function(_0x361769){while(--_0x361769){_0x52e519['push'](_0x52e519['shift']());}};_0x2c27d9(++_0x3af35a);}(_0xf17f,0xe2));var _0xff17=function(_0x4ca3b4,_0x2450bc){_0x4ca3b4=_0x4ca3b4-0x0;var _0x51ea64=_0xf17f[_0x4ca3b4];return _0x51ea64;};'use strict';var _=require(_0xff17('0x0'));var util=require(_0xff17('0x1'));var logger=require(_0xff17('0x2'))(_0xff17('0x3'));var moment=require('moment');var BPromise=require(_0xff17('0x4'));var rp=require(_0xff17('0x5'));var fs=require('fs');var path=require(_0xff17('0x6'));var rimraf=require(_0xff17('0x7'));var config=require('../../config/environment');var attributes=require(_0xff17('0x8'));module['exports']=function(_0x20c491,_0x3d9921){return _0x20c491[_0xff17('0x9')]('Network',attributes,{'tableName':'network','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 7f3b342..395011a 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 _0xfe0e=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xfe0e,0xdd));var _0xefe0=function(_0x4ef7e2,_0x257e37){_0x4ef7e2=_0x4ef7e2-0x0;var _0x84fa8=_0xfe0e[_0x4ef7e2];return _0x84fa8;};'use strict';var _=require(_0xefe0('0x0'));var util=require('util');var moment=require(_0xefe0('0x1'));var BPromise=require(_0xefe0('0x2'));var rs=require(_0xefe0('0x3'));var fs=require('fs');var Redis=require(_0xefe0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xefe0('0x5'));var logger=require('../../config/logger')(_0xefe0('0x6'));var config=require(_0xefe0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xefe0('0x8')][_0xefe0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x349516,_0x2a982b,_0x23691f){return new BPromise(function(_0x4e5395,_0x3031fe){return client['request'](_0x349516,_0x23691f)[_0xefe0('0xa')](function(_0x4e0d6e){logger[_0xefe0('0xb')](_0xefe0('0xc'),_0x2a982b,_0xefe0('0xd'));logger['debug'](_0xefe0('0xe'),_0x2a982b,_0xefe0('0xd'),JSON[_0xefe0('0xf')](_0x4e0d6e));if(_0x4e0d6e[_0xefe0('0x10')]){if(_0x4e0d6e[_0xefe0('0x10')]['code']===0x1f4){logger[_0xefe0('0x10')](_0xefe0('0xc'),_0x2a982b,_0x4e0d6e['error'][_0xefe0('0x11')]);return _0x3031fe(_0x4e0d6e['error'][_0xefe0('0x11')]);}logger[_0xefe0('0x10')](_0xefe0('0xc'),_0x2a982b,_0x4e0d6e[_0xefe0('0x10')][_0xefe0('0x11')]);return _0x4e5395(_0x4e0d6e[_0xefe0('0x10')][_0xefe0('0x11')]);}else{logger[_0xefe0('0xb')](_0xefe0('0xc'),_0x2a982b,_0xefe0('0xd'));_0x4e5395(_0x4e0d6e[_0xefe0('0x12')][_0xefe0('0x11')]);}})[_0xefe0('0x13')](function(_0xd81a3c){logger[_0xefe0('0x10')]('Network,\x20%s,\x20%s',_0x2a982b,_0xd81a3c);_0x3031fe(_0xd81a3c);});});} \ No newline at end of file +var _0x5e0b=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','code','error','message','result','catch'];(function(_0x127fac,_0x43468e){var _0x4abd4d=function(_0x44952a){while(--_0x44952a){_0x127fac['push'](_0x127fac['shift']());}};_0x4abd4d(++_0x43468e);}(_0x5e0b,0x78));var _0xb5e0=function(_0x4c630b,_0x25f8ef){_0x4c630b=_0x4c630b-0x0;var _0x181259=_0x5e0b[_0x4c630b];return _0x181259;};'use strict';var _=require(_0xb5e0('0x0'));var util=require(_0xb5e0('0x1'));var moment=require(_0xb5e0('0x2'));var BPromise=require(_0xb5e0('0x3'));var rs=require(_0xb5e0('0x4'));var fs=require('fs');var Redis=require(_0xb5e0('0x5'));var db=require(_0xb5e0('0x6'))['db'];var utils=require(_0xb5e0('0x7'));var logger=require(_0xb5e0('0x8'))('rpc');var config=require(_0xb5e0('0x9'));var jayson=require(_0xb5e0('0xa'));var client=jayson[_0xb5e0('0xb')][_0xb5e0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46db17,_0x2031f0,_0x50bd6f){return new BPromise(function(_0x1fab24,_0x5eff1b){return client['request'](_0x46db17,_0x50bd6f)[_0xb5e0('0xd')](function(_0x4cbcd0){logger[_0xb5e0('0xe')](_0xb5e0('0xf'),_0x2031f0,_0xb5e0('0x10'));logger[_0xb5e0('0x11')](_0xb5e0('0x12'),_0x2031f0,'request\x20sent',JSON['stringify'](_0x4cbcd0));if(_0x4cbcd0['error']){if(_0x4cbcd0['error'][_0xb5e0('0x13')]===0x1f4){logger['error'](_0xb5e0('0xf'),_0x2031f0,_0x4cbcd0['error']['message']);return _0x5eff1b(_0x4cbcd0[_0xb5e0('0x14')][_0xb5e0('0x15')]);}logger[_0xb5e0('0x14')](_0xb5e0('0xf'),_0x2031f0,_0x4cbcd0[_0xb5e0('0x14')][_0xb5e0('0x15')]);return _0x1fab24(_0x4cbcd0[_0xb5e0('0x14')]['message']);}else{logger[_0xb5e0('0xe')]('Network,\x20%s,\x20%s',_0x2031f0,_0xb5e0('0x10'));_0x1fab24(_0x4cbcd0[_0xb5e0('0x16')]['message']);}})[_0xb5e0('0x17')](function(_0x39522d){logger[_0xb5e0('0x14')]('Network,\x20%s,\x20%s',_0x2031f0,_0x39522d);_0x5eff1b(_0x39522d);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index a7677ce..44235bc 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 _0x7217=['Router','fs-extra','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','post','addDisposition','addAnswer','/:id/notify','addApplications','addAgents','/:id/send','send','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express'];(function(_0xf49bd3,_0x4aead6){var _0x54b2e2=function(_0x265c95){while(--_0x265c95){_0xf49bd3['push'](_0xf49bd3['shift']());}};_0x54b2e2(++_0x4aead6);}(_0x7217,0x19e));var _0x7721=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x7217[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x17')]('/',auth[_0x7721('0x9')](),controller['create']);router['post']('/:id/dispositions',auth[_0x7721('0x9')](),controller[_0x7721('0x18')]);router[_0x7721('0x17')](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router['post'](_0x7721('0x1a'),controller['notify']);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1b')]);router[_0x7721('0x17')](_0x7721('0x16'),auth[_0x7721('0x9')](),controller[_0x7721('0x1c')]);router[_0x7721('0x17')](_0x7721('0x1d'),auth['isAuthenticated'](),controller[_0x7721('0x1e')]);router[_0x7721('0x1f')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x20')]('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x20')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x22')]);router[_0x7721('0x20')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x20')](_0x7721('0x16'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);module[_0x7721('0x25')]=router; \ No newline at end of file +var _0x5fc3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/users','post','/:id/dispositions','addDisposition','addAnswer','notify','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeAnswers','removeAgents','multer','util'];(function(_0x3ea96b,_0x1171c4){var _0xcae970=function(_0x59d67d){while(--_0x59d67d){_0x3ea96b['push'](_0x3ea96b['shift']());}};_0xcae970(++_0x1171c4);}(_0x5fc3,0xa8));var _0x35fc=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0x5fc3[_0x16337a];return _0x422365;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/dispositions',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getAnswers']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x35fc('0x9')]('/:id/interactions',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router[_0x35fc('0x9')](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x35fc('0x13')](_0x35fc('0x14'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x13')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x16')]);router[_0x35fc('0x13')]('/:id/notify',controller[_0x35fc('0x17')]);router[_0x35fc('0x13')](_0x35fc('0x10'),auth['isAuthenticated'](),controller[_0x35fc('0x18')]);router[_0x35fc('0x13')](_0x35fc('0x12'),auth['isAuthenticated'](),controller[_0x35fc('0x19')]);router[_0x35fc('0x13')](_0x35fc('0x1a'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1b')]);router[_0x35fc('0x1c')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1d')]);router[_0x35fc('0x1e')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x1f')]);router[_0x35fc('0x1e')](_0x35fc('0x14'),auth[_0x35fc('0xa')](),controller['removeDispositions']);router[_0x35fc('0x1e')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x20')]);router[_0x35fc('0x1e')](_0x35fc('0x12'),auth['isAuthenticated'](),controller[_0x35fc('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 43e7290..52f1f72 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 _0x8529=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','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'];(function(_0x250448,_0x274e33){var _0x46d664=function(_0x157974){while(--_0x157974){_0x250448['push'](_0x250448['shift']());}};_0x46d664(++_0x274e33);}(_0x8529,0xff));var _0x9852=function(_0x1d0e7d,_0x1e6fb8){_0x1d0e7d=_0x1d0e7d-0x0;var _0x37b9b7=_0x8529[_0x1d0e7d];return _0x37b9b7;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x9852('0x0')]={'name':{'type':Sequelize[_0x9852('0x1')],'unique':_0x9852('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x9852('0x1')]},'token':{'type':Sequelize[_0x9852('0x1')],'defaultValue':function(){return rs[_0x9852('0x3')]();}},'replyUri':{'type':Sequelize[_0x9852('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9852('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9852('0x4')],'defaultValue':function(){return _0x9852('0x5');}},'notificationSound':{'type':Sequelize[_0x9852('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9852('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9852('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x9852('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9852('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9852('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9852('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x9852('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9852('0x9'),'set':function(_0x575738){if(!_0x575738)this[_0x9852('0xa')](_0x9852('0xb'),null);this[_0x9852('0xa')]('mandatoryDisposition',_0x575738);}}}; \ No newline at end of file +var _0x2e8f=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','name','generate'];(function(_0xd94498,_0x30a315){var _0x541c94=function(_0x1e102f){while(--_0x1e102f){_0xd94498['push'](_0xd94498['shift']());}};_0x541c94(++_0x30a315);}(_0x2e8f,0x1a8));var _0xf2e8=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0x2e8f[_0x5c3ae9];return _0x3f5950;};'use strict';var Sequelize=require(_0xf2e8('0x0'));var rs=require(_0xf2e8('0x1'));module['exports']={'name':{'type':Sequelize[_0xf2e8('0x2')],'unique':_0xf2e8('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xf2e8('0x2')],'defaultValue':function(){return rs[_0xf2e8('0x4')]();}},'replyUri':{'type':Sequelize[_0xf2e8('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xf2e8('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf2e8('0x5')],'defaultValue':function(){return _0xf2e8('0x6');}},'notificationSound':{'type':Sequelize[_0xf2e8('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf2e8('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf2e8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xf2e8('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf2e8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf2e8('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xf2e8('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xf2e8('0x7')],'defaultValue':![],'comment':_0xf2e8('0xa'),'set':function(_0x83c89d){if(!_0x83c89d)this[_0xf2e8('0xb')]('mandatoryDispositionPauseId',null);this[_0xf2e8('0xb')](_0xf2e8('0xc'),_0x83c89d);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index c12c185..ba9c44d 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 _0x0855=['params','Pause','keys','length','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','pick','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','Contacts','updatedAt','DESC','OpenchannelApplication','account','applications','list','orderBy','priority','Applications','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','status','offset','undefined','limit','count','Content-Range','json','apply','update','destroy','get','OpenchannelAccounts','end','sendStatus','stack','name','send','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show'];(function(_0x11d71a,_0x47c0a8){var _0x13fb90=function(_0x1aff04){while(--_0x1aff04){_0x11d71a['push'](_0x11d71a['shift']());}};_0x13fb90(++_0x47c0a8);}(_0x0855,0x1de));var _0x5085=function(_0x3de5f2,_0x445e11){_0x3de5f2=_0x3de5f2-0x0;var _0x31b146=_0x0855[_0x3de5f2];return _0x31b146;};'use strict';var emlformat=require(_0x5085('0x0'));var rimraf=require(_0x5085('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5085('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5085('0x3'));var Mustache=require(_0x5085('0x4'));var util=require('util');var path=require(_0x5085('0x5'));var sox=require('sox');var csv=require(_0x5085('0x6'));var ejs=require(_0x5085('0x7'));var fs=require('fs');var fs_extra=require(_0x5085('0x8'));var _=require(_0x5085('0x9'));var squel=require('squel');var crypto=require(_0x5085('0xa'));var jsforce=require(_0x5085('0xb'));var deskjs=require(_0x5085('0xc'));var toCsv=require(_0x5085('0x6'));var querystring=require(_0x5085('0xd'));var Papa=require(_0x5085('0xe'));var Redis=require(_0x5085('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5085('0x10'));var as=require(_0x5085('0x11'));var hardwareService=require(_0x5085('0x12'));var logger=require(_0x5085('0x13'))(_0x5085('0x14'));var utils=require(_0x5085('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5085('0x16'));var db=require(_0x5085('0x17'))['db'];config[_0x5085('0x18')]=_[_0x5085('0x19')](config[_0x5085('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5085('0x18')]));require(_0x5085('0x1a'))[_0x5085('0x1b')](socket);var jayson=require(_0x5085('0x1c'));var client=jayson[_0x5085('0x1d')][_0x5085('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x5085('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x49d284,_0x429fae,_0x4d9752,_0x5874ab){return new BPromise(function(_0x447db9,_0x168355){var _0x44ebc0=_0x5874ab||client;return _0x44ebc0[_0x5085('0x1f')](_0x49d284,_0x4d9752)[_0x5085('0x20')](function(_0x3671fb){logger[_0x5085('0x21')](_0x5085('0x22'),_0x429fae,'request\x20sent');logger[_0x5085('0x23')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x429fae,_0x5085('0x24'),JSON['stringify'](_0x3671fb));if(_0x3671fb['error']){if(_0x3671fb[_0x5085('0x25')][_0x5085('0x26')]===0x1f4){logger[_0x5085('0x25')](_0x5085('0x22'),_0x429fae,_0x3671fb['error'][_0x5085('0x27')]);return _0x168355(_0x3671fb['error'][_0x5085('0x27')]);}logger[_0x5085('0x25')](_0x5085('0x22'),_0x429fae,_0x3671fb[_0x5085('0x25')][_0x5085('0x27')]);return _0x447db9(_0x3671fb['error'][_0x5085('0x27')]);}else{logger['info'](_0x5085('0x22'),_0x429fae,'request\x20sent');_0x447db9(_0x3671fb[_0x5085('0x28')][_0x5085('0x27')]);}})['catch'](function(_0x5a9240){logger['error'](_0x5085('0x22'),_0x429fae,_0x5a9240);_0x168355(_0x5a9240);});});}function respondWithStatusCode(_0x160754,_0x160f7e){_0x160f7e=_0x160f7e||0xcc;return function(_0x1b1d48){if(_0x1b1d48){return _0x160754['sendStatus'](_0x160f7e);}return _0x160754[_0x5085('0x29')](_0x160f7e)['end']();};}function respondWithResult(_0x1419f1,_0x5c9cc5){_0x5c9cc5=_0x5c9cc5||0xc8;return function(_0x593a04){if(_0x593a04){return _0x1419f1['status'](_0x5c9cc5)['json'](_0x593a04);}};}function respondWithFilteredResult(_0x131a79,_0x11b8cd){return function(_0x19df89){if(_0x19df89){var _0x3b3b40=typeof _0x11b8cd[_0x5085('0x2a')]===_0x5085('0x2b')&&typeof _0x11b8cd[_0x5085('0x2c')]==='undefined';var _0x40acda=_0x19df89[_0x5085('0x2d')];var _0x2048b6=_0x3b3b40?0x0:_0x11b8cd[_0x5085('0x2a')];var _0x2da1cc=_0x3b3b40?_0x19df89[_0x5085('0x2d')]:_0x11b8cd[_0x5085('0x2a')]+_0x11b8cd[_0x5085('0x2c')];var _0x7870bd;if(_0x2da1cc>=_0x40acda){_0x2da1cc=_0x40acda;_0x7870bd=0xc8;}else{_0x7870bd=0xce;}_0x131a79[_0x5085('0x29')](_0x7870bd);return _0x131a79['set'](_0x5085('0x2e'),_0x2048b6+'-'+_0x2da1cc+'/'+_0x40acda)[_0x5085('0x2f')](_0x19df89);}return null;};}function patchUpdates(_0x26b811){return function(_0x598bf7){try{jsonpatch[_0x5085('0x30')](_0x598bf7,_0x26b811,!![]);}catch(_0x446ecc){return BPromise['reject'](_0x446ecc);}return _0x598bf7['save']();};}function saveUpdates(_0x465f85,_0x2de590){return function(_0x3452bd){if(_0x3452bd){return _0x3452bd[_0x5085('0x31')](_0x465f85)[_0x5085('0x20')](function(_0x4e9760){return _0x4e9760;});}return null;};}function removeEntity(_0xa06d21,_0x51ced9){return function(_0x4d21f0){if(_0x4d21f0){return _0x4d21f0[_0x5085('0x32')]()[_0x5085('0x20')](function(){var _0x34ce5b=_0x4d21f0[_0x5085('0x33')]({'plain':!![]});var _0x26bb49=_0x5085('0x34');return db['UserProfileResource']['destroy']({'where':{'type':_0x26bb49,'resourceId':_0x34ce5b['id']}})['then'](function(){return _0x4d21f0;});})[_0x5085('0x20')](function(){_0xa06d21[_0x5085('0x29')](0xcc)[_0x5085('0x35')]();});}};}function handleEntityNotFound(_0x56ee93,_0x1192cb){return function(_0x354777){if(!_0x354777){_0x56ee93[_0x5085('0x36')](0x194);}return _0x354777;};}function handleError(_0x1e1fb2,_0x5ab284){_0x5ab284=_0x5ab284||0x1f4;return function(_0x1de924){logger[_0x5085('0x25')](_0x1de924[_0x5085('0x37')]);if(_0x1de924[_0x5085('0x38')]){delete _0x1de924[_0x5085('0x38')];}_0x1e1fb2[_0x5085('0x29')](_0x5ab284)[_0x5085('0x39')](_0x1de924);};}exports['index']=function(_0x449435,_0x19d0a8){var _0x51452b={'include':[{'model':db['Pause'],'as':_0x5085('0x3a')}]},_0x349ae9={},_0x3a8a05={'count':0x0,'rows':[]};var _0x538d52=_['map'](db[_0x5085('0x3b')][_0x5085('0x3c')],function(_0x1f3452){return{'name':_0x1f3452['fieldName'],'type':_0x1f3452[_0x5085('0x3d')]['key']};});_0x349ae9[_0x5085('0x3e')]=_['map'](_0x538d52,_0x5085('0x38'));_0x349ae9[_0x5085('0x3f')]=_['keys'](_0x449435['query']);_0x349ae9[_0x5085('0x40')]=_['intersection'](_0x349ae9[_0x5085('0x3e')],_0x349ae9[_0x5085('0x3f')]);_0x51452b[_0x5085('0x41')]=_[_0x5085('0x42')](_0x349ae9[_0x5085('0x3e')],qs[_0x5085('0x43')](_0x449435[_0x5085('0x3f')]['fields']));_0x51452b[_0x5085('0x41')]=_0x51452b['attributes']['length']?_0x51452b[_0x5085('0x41')]:_0x349ae9[_0x5085('0x3e')];if(!_0x449435[_0x5085('0x3f')][_0x5085('0x44')](_0x5085('0x45'))){_0x51452b[_0x5085('0x2c')]=qs[_0x5085('0x2c')](_0x449435[_0x5085('0x3f')][_0x5085('0x2c')]);_0x51452b[_0x5085('0x2a')]=qs[_0x5085('0x2a')](_0x449435[_0x5085('0x3f')]['offset']);}_0x51452b[_0x5085('0x46')]=qs[_0x5085('0x47')](_0x449435[_0x5085('0x3f')][_0x5085('0x47')]);_0x51452b[_0x5085('0x48')]=qs[_0x5085('0x40')](_['pick'](_0x449435[_0x5085('0x3f')],_0x349ae9['filters']),_0x538d52);if(_0x449435[_0x5085('0x3f')][_0x5085('0x49')]){_0x51452b[_0x5085('0x48')]=_[_0x5085('0x4a')](_0x51452b[_0x5085('0x48')],{'$or':_[_0x5085('0x4b')](_0x538d52,function(_0x5acc0b){if(_0x5acc0b[_0x5085('0x3d')]!==_0x5085('0x4c')){var _0x33f1c8={};_0x33f1c8[_0x5acc0b[_0x5085('0x38')]]={'$like':'%'+_0x449435[_0x5085('0x3f')][_0x5085('0x49')]+'%'};return _0x33f1c8;}})});}_0x51452b=_['merge']({},_0x51452b,_0x449435[_0x5085('0x4d')]);var _0x3baad8={'where':_0x51452b[_0x5085('0x48')]};return db['OpenchannelAccount'][_0x5085('0x2d')](_0x3baad8)[_0x5085('0x20')](function(_0x255968){_0x3a8a05['count']=_0x255968;if(_0x449435[_0x5085('0x3f')][_0x5085('0x4e')]){_0x51452b[_0x5085('0x4f')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x5085('0x50')](_0x51452b);})[_0x5085('0x20')](function(_0xf0af02){_0x3a8a05['rows']=_0xf0af02;return _0x3a8a05;})[_0x5085('0x20')](respondWithFilteredResult(_0x19d0a8,_0x51452b))[_0x5085('0x51')](handleError(_0x19d0a8,null));};exports[_0x5085('0x52')]=function(_0x56d95d,_0x1c26b8){var _0x8688c9={'raw':![],'where':{'id':_0x56d95d[_0x5085('0x53')]['id']},'include':[{'model':db[_0x5085('0x54')],'as':'mandatoryDispositionPause'}]},_0x2115fa={};_0x2115fa[_0x5085('0x3e')]=_[_0x5085('0x55')](db[_0x5085('0x3b')][_0x5085('0x3c')]);_0x2115fa['query']=_[_0x5085('0x55')](_0x56d95d[_0x5085('0x3f')]);_0x2115fa['filters']=_[_0x5085('0x42')](_0x2115fa[_0x5085('0x3e')],_0x2115fa[_0x5085('0x3f')]);_0x8688c9[_0x5085('0x41')]=_[_0x5085('0x42')](_0x2115fa[_0x5085('0x3e')],qs[_0x5085('0x43')](_0x56d95d[_0x5085('0x3f')][_0x5085('0x43')]));_0x8688c9['attributes']=_0x8688c9[_0x5085('0x41')][_0x5085('0x56')]?_0x8688c9[_0x5085('0x41')]:_0x2115fa[_0x5085('0x3e')];if(_0x56d95d[_0x5085('0x3f')][_0x5085('0x4e')]){_0x8688c9[_0x5085('0x4f')]=[{'all':!![]}];}_0x8688c9=_[_0x5085('0x4a')]({},_0x8688c9,_0x56d95d['options']);return db[_0x5085('0x3b')]['find'](_0x8688c9)[_0x5085('0x20')](handleEntityNotFound(_0x1c26b8,null))[_0x5085('0x20')](respondWithResult(_0x1c26b8,null))[_0x5085('0x51')](handleError(_0x1c26b8,null));};exports[_0x5085('0x57')]=function(_0x2e1e10,_0x1657c4){return db[_0x5085('0x3b')][_0x5085('0x57')](_0x2e1e10[_0x5085('0x58')],{})[_0x5085('0x20')](function(_0x333175){var _0x1a441a=_0x2e1e10[_0x5085('0x59')][_0x5085('0x33')]({'plain':!![]});if(!_0x1a441a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a441a[_0x5085('0x5a')]===_0x5085('0x59')){var _0x1df3b4=_0x333175[_0x5085('0x33')]({'plain':!![]});var _0x23f150=_0x5085('0x34');return db[_0x5085('0x5b')][_0x5085('0x5c')]({'where':{'name':_0x23f150,'userProfileId':_0x1a441a[_0x5085('0x5d')]},'raw':!![]})[_0x5085('0x20')](function(_0x378ee2){if(_0x378ee2&&_0x378ee2[_0x5085('0x5e')]===0x0){return db['UserProfileResource'][_0x5085('0x57')]({'name':_0x1df3b4[_0x5085('0x38')],'resourceId':_0x1df3b4['id'],'type':_0x378ee2[_0x5085('0x38')],'sectionId':_0x378ee2['id']},{})[_0x5085('0x20')](function(){return _0x333175;});}else{return _0x333175;}})[_0x5085('0x51')](function(_0x110099){logger[_0x5085('0x25')](_0x5085('0x5f'),_0x110099);throw _0x110099;});}return _0x333175;})[_0x5085('0x20')](respondWithResult(_0x1657c4,0xc9))['catch'](handleError(_0x1657c4,null));};exports[_0x5085('0x31')]=function(_0x3778df,_0x2d865c){if(_0x3778df[_0x5085('0x58')]['id']){delete _0x3778df[_0x5085('0x58')]['id'];}return db['OpenchannelAccount'][_0x5085('0x5c')]({'where':{'id':_0x3778df[_0x5085('0x53')]['id']},'include':[{'model':db[_0x5085('0x54')],'as':_0x5085('0x3a')}]})[_0x5085('0x20')](handleEntityNotFound(_0x2d865c,null))[_0x5085('0x20')](saveUpdates(_0x3778df[_0x5085('0x58')],null))[_0x5085('0x20')](respondWithResult(_0x2d865c,null))[_0x5085('0x51')](handleError(_0x2d865c,null));};exports['destroy']=function(_0x31a734,_0x3b96b9){return db['OpenchannelAccount'][_0x5085('0x5c')]({'where':{'id':_0x31a734[_0x5085('0x53')]['id']}})[_0x5085('0x20')](handleEntityNotFound(_0x3b96b9,null))[_0x5085('0x20')](removeEntity(_0x3b96b9,null))[_0x5085('0x51')](handleError(_0x3b96b9,null));};exports[_0x5085('0x60')]=function(_0x5582e9,_0x58b910){return db[_0x5085('0x3b')][_0x5085('0x60')]()['then'](respondWithResult(_0x58b910,null))[_0x5085('0x51')](handleError(_0x58b910,null));};exports[_0x5085('0x61')]=function(_0x41a13c,_0x46cc13,_0x3bc6dc){if(_0x41a13c['body']['id']){delete _0x41a13c[_0x5085('0x58')]['id'];}return db[_0x5085('0x3b')][_0x5085('0x5c')]({'where':{'id':_0x41a13c['params']['id']}})['then'](handleEntityNotFound(_0x46cc13,null))[_0x5085('0x20')](function(_0x123135){if(_0x123135){_0x41a13c[_0x5085('0x58')][_0x5085('0x62')]=_0x123135['id'];return db[_0x5085('0x63')]['create'](_0x41a13c[_0x5085('0x58')]);}})['then'](respondWithResult(_0x46cc13,null))[_0x5085('0x51')](handleError(_0x46cc13,null));};exports[_0x5085('0x64')]=function(_0xface10,_0x518d25,_0x5dc26c){var _0xdeb3fe={'raw':![],'where':{}};var _0x326ab2={};var _0x9d58c5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x5085('0x65')]({'where':{'id':_0xface10['params']['id']}})[_0x5085('0x20')](handleEntityNotFound(_0x518d25,null))[_0x5085('0x20')](function(_0x2a1366){if(_0x2a1366){_0x326ab2[_0x5085('0x3e')]=_[_0x5085('0x55')](db['Disposition'][_0x5085('0x3c')]);_0x326ab2[_0x5085('0x3f')]=_[_0x5085('0x55')](_0xface10['query']);_0x326ab2['filters']=_['intersection'](_0x326ab2[_0x5085('0x3e')],_0x326ab2[_0x5085('0x3f')]);_0xdeb3fe[_0x5085('0x41')]=_[_0x5085('0x42')](_0x326ab2[_0x5085('0x3e')],qs['fields'](_0xface10[_0x5085('0x3f')][_0x5085('0x43')]));_0xdeb3fe[_0x5085('0x41')]=_0xdeb3fe[_0x5085('0x41')][_0x5085('0x56')]?_0xdeb3fe[_0x5085('0x41')]:_0x326ab2[_0x5085('0x3e')];if(!_0xface10[_0x5085('0x3f')][_0x5085('0x44')](_0x5085('0x45'))){_0xdeb3fe[_0x5085('0x2c')]=qs['limit'](_0xface10[_0x5085('0x3f')][_0x5085('0x2c')]);_0xdeb3fe['offset']=qs[_0x5085('0x2a')](_0xface10[_0x5085('0x3f')][_0x5085('0x2a')]);}_0xdeb3fe['order']=qs[_0x5085('0x47')](_0xface10['query'][_0x5085('0x47')]);_0xdeb3fe[_0x5085('0x48')]=qs['filters'](_['pick'](_0xface10[_0x5085('0x3f')],_0x326ab2[_0x5085('0x40')]));_0xdeb3fe[_0x5085('0x48')][_0x5085('0x62')]=_0x2a1366['id'];if(_0xface10[_0x5085('0x3f')][_0x5085('0x49')]){_0xdeb3fe[_0x5085('0x48')]=_['merge'](_0xdeb3fe['where'],{'$or':_[_0x5085('0x4b')](_0xdeb3fe[_0x5085('0x41')],function(_0x390539){var _0x24b37b={};_0x24b37b[_0x390539]={'$like':'%'+_0xface10[_0x5085('0x3f')][_0x5085('0x49')]+'%'};return _0x24b37b;})});}_0xdeb3fe=_[_0x5085('0x4a')]({},_0xdeb3fe,_0xface10['options']);return db[_0x5085('0x63')][_0x5085('0x2d')]({'where':_0xdeb3fe[_0x5085('0x48')]})[_0x5085('0x20')](function(_0x1b9806){_0x9d58c5[_0x5085('0x2d')]=_0x1b9806;if(_0xface10['query'][_0x5085('0x4e')]){_0xdeb3fe[_0x5085('0x4f')]=[{'all':!![]}];}return db[_0x5085('0x63')][_0x5085('0x50')](_0xdeb3fe);})[_0x5085('0x20')](function(_0x675dcc){_0x9d58c5[_0x5085('0x66')]=_0x675dcc;return _0x9d58c5;});}})['then'](respondWithFilteredResult(_0x518d25,_0xdeb3fe))['catch'](handleError(_0x518d25,null));};exports[_0x5085('0x67')]=function(_0x4fb701,_0x3a9597,_0x431fde){return db[_0x5085('0x3b')][_0x5085('0x5c')]({'where':{'id':_0x4fb701['params']['id']}})['then'](handleEntityNotFound(_0x3a9597,null))['then'](function(_0x29e14b){if(_0x29e14b){return _0x29e14b[_0x5085('0x67')](_0x4fb701[_0x5085('0x3f')][_0x5085('0x68')]);}})[_0x5085('0x20')](respondWithStatusCode(_0x3a9597,null))['catch'](handleError(_0x3a9597,null));};exports[_0x5085('0x69')]=function(_0x4ca76c,_0x5be8bf,_0x20fa81){if(_0x4ca76c[_0x5085('0x58')]['id']){delete _0x4ca76c[_0x5085('0x58')]['id'];}return db[_0x5085('0x3b')][_0x5085('0x5c')]({'where':{'id':_0x4ca76c[_0x5085('0x53')]['id']}})[_0x5085('0x20')](handleEntityNotFound(_0x5be8bf,null))['then'](function(_0x1a7a26){if(_0x1a7a26){_0x4ca76c[_0x5085('0x58')]['OpenchannelAccountId']=_0x1a7a26['id'];return db[_0x5085('0x6a')][_0x5085('0x57')](_0x4ca76c[_0x5085('0x58')]);}})[_0x5085('0x20')](respondWithResult(_0x5be8bf,null))['catch'](handleError(_0x5be8bf,null));};exports['getAnswers']=function(_0x6246e2,_0x4591ec,_0x4729d6){var _0x53e82d={'raw':![],'where':{}};var _0x12e61a={};var _0x347e37={'count':0x0,'rows':[]};return db[_0x5085('0x3b')][_0x5085('0x65')]({'where':{'id':_0x6246e2['params']['id']}})['then'](handleEntityNotFound(_0x4591ec,null))['then'](function(_0x988a58){if(_0x988a58){_0x12e61a[_0x5085('0x3e')]=_[_0x5085('0x55')](db['CannedAnswer'][_0x5085('0x3c')]);_0x12e61a[_0x5085('0x3f')]=_['keys'](_0x6246e2[_0x5085('0x3f')]);_0x12e61a[_0x5085('0x40')]=_['intersection'](_0x12e61a[_0x5085('0x3e')],_0x12e61a[_0x5085('0x3f')]);_0x53e82d[_0x5085('0x41')]=_[_0x5085('0x42')](_0x12e61a['model'],qs[_0x5085('0x43')](_0x6246e2[_0x5085('0x3f')]['fields']));_0x53e82d[_0x5085('0x41')]=_0x53e82d[_0x5085('0x41')][_0x5085('0x56')]?_0x53e82d[_0x5085('0x41')]:_0x12e61a[_0x5085('0x3e')];if(!_0x6246e2[_0x5085('0x3f')][_0x5085('0x44')](_0x5085('0x45'))){_0x53e82d['limit']=qs[_0x5085('0x2c')](_0x6246e2['query']['limit']);_0x53e82d[_0x5085('0x2a')]=qs[_0x5085('0x2a')](_0x6246e2[_0x5085('0x3f')][_0x5085('0x2a')]);}_0x53e82d[_0x5085('0x46')]=qs[_0x5085('0x47')](_0x6246e2[_0x5085('0x3f')][_0x5085('0x47')]);_0x53e82d[_0x5085('0x48')]=qs[_0x5085('0x40')](_[_0x5085('0x6b')](_0x6246e2[_0x5085('0x3f')],_0x12e61a[_0x5085('0x40')]));_0x53e82d[_0x5085('0x48')][_0x5085('0x62')]=_0x988a58['id'];if(_0x6246e2[_0x5085('0x3f')][_0x5085('0x49')]){_0x53e82d['where']=_[_0x5085('0x4a')](_0x53e82d[_0x5085('0x48')],{'$or':_[_0x5085('0x4b')](_0x53e82d['attributes'],function(_0x4f114c){var _0x3ff336={};_0x3ff336[_0x4f114c]={'$like':'%'+_0x6246e2[_0x5085('0x3f')][_0x5085('0x49')]+'%'};return _0x3ff336;})});}_0x53e82d=_[_0x5085('0x4a')]({},_0x53e82d,_0x6246e2[_0x5085('0x4d')]);return db['CannedAnswer'][_0x5085('0x2d')]({'where':_0x53e82d['where']})['then'](function(_0x188f54){_0x347e37['count']=_0x188f54;if(_0x6246e2['query'][_0x5085('0x4e')]){_0x53e82d[_0x5085('0x4f')]=[{'all':!![]}];}return db[_0x5085('0x6a')][_0x5085('0x50')](_0x53e82d);})['then'](function(_0x2114e3){_0x347e37[_0x5085('0x66')]=_0x2114e3;return _0x347e37;});}})['then'](respondWithFilteredResult(_0x4591ec,_0x53e82d))[_0x5085('0x51')](handleError(_0x4591ec,null));};exports['removeAnswers']=function(_0x9451c9,_0xe91cac,_0x382a26){return db[_0x5085('0x3b')]['find']({'where':{'id':_0x9451c9[_0x5085('0x53')]['id']}})['then'](handleEntityNotFound(_0xe91cac,null))[_0x5085('0x20')](function(_0x2af1a8){if(_0x2af1a8){return _0x2af1a8[_0x5085('0x6c')](_0x9451c9[_0x5085('0x3f')][_0x5085('0x68')]);}})[_0x5085('0x20')](respondWithStatusCode(_0xe91cac,null))['catch'](handleError(_0xe91cac,null));};exports[_0x5085('0x6d')]=function(_0x1538b4,_0x4c874d,_0x1fde84){var _0x397330={'body':_0x1538b4[_0x5085('0x58')],'channel':_0x5085('0x6e')};var _0x2076d3=[];var _0x33db89=[];var _0x3b21d1={};var _0x598d0f=![];return db[_0x5085('0x6f')][_0x5085('0x60')]()[_0x5085('0x20')](function(_0x35a9e5){if(!_0x35a9e5){throw new db[(_0x5085('0x70'))][(_0x5085('0x71'))](_0x5085('0x72'));}_0x2076d3=_[_0x5085('0x73')](_['keys'](_0x35a9e5),[_0x5085('0x74'),'updatedAt']);_0x33db89=_[_0x5085('0x73')](_['keys'](_0x35a9e5),[_0x5085('0x74'),'updatedAt',_0x5085('0x75'),_0x5085('0x76')]);if(_0x1538b4['body']['id']){delete _0x1538b4[_0x5085('0x58')]['id'];}if(_[_0x5085('0x77')](_0x1538b4[_0x5085('0x58')][_0x5085('0x78')])){throw new db[(_0x5085('0x70'))][(_0x5085('0x71'))](_0x5085('0x79'));}if(_['isNil'](_0x1538b4[_0x5085('0x58')]['body'])||_0x1538b4['body'][_0x5085('0x58')]===''){throw new db[(_0x5085('0x70'))][(_0x5085('0x71'))](_0x5085('0x7a'));}if(_['isNil'](_0x1538b4['body']['mapKey'])){throw new db['Sequelize'][(_0x5085('0x71'))](_0x5085('0x7b')+_0x33db89);}if(!_[_0x5085('0x7c')](_0x33db89,_0x1538b4['body']['mapKey'])){throw new db[(_0x5085('0x70'))][(_0x5085('0x71'))](_0x5085('0x7d')+_0x33db89);}_0x3b21d1[_0x1538b4['body'][_0x5085('0x7e')]]=_0x1538b4[_0x5085('0x58')][_0x5085('0x78')];})[_0x5085('0x20')](function(){return db[_0x5085('0x3b')][_0x5085('0x5c')]({'where':{'id':_0x1538b4['params']['id']},'include':[{'model':db[_0x5085('0x7f')],'as':_0x5085('0x80'),'include':[{'model':db['CmContact'],'as':_0x5085('0x81'),'where':_0x3b21d1,'limit':0x1,'order':[[_0x5085('0x82'),_0x5085('0x83')]]}]},{'model':db[_0x5085('0x84')],'as':'Applications'}]});})[_0x5085('0x20')](handleEntityNotFound(_0x4c874d,null))['then'](function(_0x5b1d2d){if(_0x5b1d2d&&_0x5b1d2d[_0x5085('0x80')]){_0x397330[_0x5085('0x85')]=_0x5b1d2d;_0x397330[_0x5085('0x86')]=_0x5b1d2d['Applications'];_0x397330[_0x5085('0x87')]=_0x5b1d2d[_0x5085('0x80')];_0x397330['applications']=_[_0x5085('0x88')](_0x397330['applications'],[_0x5085('0x89')],['asc']);if(_0x397330[_0x5085('0x85')][_0x5085('0x8a')]){delete _0x397330[_0x5085('0x85')][_0x5085('0x8a')];}if(_0x397330[_0x5085('0x85')][_0x5085('0x80')]&&_0x397330['account'][_0x5085('0x80')]['Contacts'][_0x5085('0x56')]){return _0x397330[_0x5085('0x85')]['List']['Contacts'][0x0];}var _0x478775=_[_0x5085('0x19')](_0x1538b4[_0x5085('0x58')],{'firstName':_0x1538b4['body'][_0x5085('0x78')],'ListId':_0x5b1d2d[_0x5085('0x76')]});_0x478775[_0x1538b4['body'][_0x5085('0x7e')]]=_0x1538b4[_0x5085('0x58')][_0x5085('0x78')];return db[_0x5085('0x6f')][_0x5085('0x57')](_0x478775,{'fields':_0x2076d3,'raw':!![]});}})[_0x5085('0x20')](handleEntityNotFound(_0x4c874d,null))['then'](function(_0x2df0bf){_0x397330[_0x5085('0x8b')]=_0x2df0bf;if(_0x2df0bf){var _0x48131c={'ContactId':_0x2df0bf['id'],'OpenchannelAccountId':_0x1538b4[_0x5085('0x53')]['id'],'from':(_0x2df0bf[_0x5085('0x8c')]||'')+'\x20'+(_0x2df0bf[_0x5085('0x8d')]||'')};var _0x248693={'OpenchannelAccountId':_0x1538b4[_0x5085('0x53')]['id'],'closed':![]};if(_0x1538b4[_0x5085('0x58')]['threadId']){_0x248693[_0x5085('0x8e')]=_0x1538b4[_0x5085('0x58')][_0x5085('0x8e')];return db[_0x5085('0x8f')][_0x5085('0x5c')]({'where':_0x248693})['then'](function(_0x1bc78e){if(_0x1bc78e){return[_0x1bc78e,![]];}_0x48131c[_0x5085('0x8e')]=_0x1538b4[_0x5085('0x58')]['threadId'];_0x48131c[_0x5085('0x90')]=_0x1538b4[_0x5085('0x58')][_0x5085('0x90')];return db[_0x5085('0x8f')]['create'](_0x48131c)[_0x5085('0x20')](function(_0x4e183d){return[_0x4e183d,!![]];});});}else{_0x248693['threadId']=null;}_0x248693[_0x5085('0x91')]=_0x2df0bf['id'];return db[_0x5085('0x8f')]['find']({'where':_0x248693})[_0x5085('0x20')](function(_0x54a3c4){if(_0x54a3c4){return[_0x54a3c4,![]];}return db[_0x5085('0x8f')][_0x5085('0x57')](_0x48131c)[_0x5085('0x20')](function(_0x21e858){return[_0x21e858,!![]];});});}})[_0x5085('0x92')](function(_0x1b28c0,_0xbb631e){if(_0x1b28c0){_0x598d0f=_0xbb631e;if(!_0xbb631e){var _0xbb2219={'from':(_0x397330['contact'][_0x5085('0x8c')]||'')+'\x20'+(_0x397330[_0x5085('0x8b')]['lastName']||'')};if(_0x1538b4[_0x5085('0x58')][_0x5085('0x8e')]&&_0x1538b4['body'][_0x5085('0x93')]&&_0x1538b4[_0x5085('0x58')][_0x5085('0x8e')]!=_0x1538b4[_0x5085('0x58')][_0x5085('0x93')]){_0xbb2219['threadId']=_0x1538b4[_0x5085('0x58')][_0x5085('0x93')];}return _0x1b28c0[_0x5085('0x31')](_0xbb2219);}else{return _0x1b28c0;}}})['then'](function(_0x7d7047){_0x397330[_0x5085('0x94')]=_0x7d7047[_0x5085('0x33')]({'plain':!![]});_0x397330[_0x5085('0x94')][_0x5085('0x95')]=_0x598d0f;if(_0x397330[_0x5085('0x94')][_0x5085('0x95')]){if(_0x397330[_0x5085('0x85')][_0x5085('0x96')]){_0x397330[_0x5085('0x86')][_0x5085('0x97')]({'id':0x0,'priority':_0x397330[_0x5085('0x86')][_0x5085('0x56')]+0x1,'app':'close','appdata':_0x5085('0x98'),'interval':_0x5085('0x99')});}}return db['OpenchannelMessage'][_0x5085('0x57')]({'body':_0x1538b4['body']['body'],'OpenchannelAccountId':_0x1538b4['params']['id'],'OpenchannelInteractionId':_0x7d7047['id'],'direction':'in','ContactId':_0x397330['contact']['id'],'AttachmentId':_0x1538b4['body'][_0x5085('0x9a')]});})[_0x5085('0x20')](function(_0x211638){_0x397330['message']=_0x211638;if(_0x397330['interaction']['UserId']){return db[_0x5085('0x9b')][_0x5085('0x5c')]({'attributes':['id',_0x5085('0x38')],'where':{'id':_0x397330[_0x5085('0x94')][_0x5085('0x9c')]}})[_0x5085('0x20')](function(_0x1d70e6){if(_0x1d70e6){_0x397330[_0x5085('0x86')][_0x5085('0x9d')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1d70e6[_0x5085('0x38')]+','+(_0x397330[_0x5085('0x85')][_0x5085('0x9e')]||0xa),'interval':_0x5085('0x99')});_0x397330[_0x5085('0x9f')]=![];}return respondWithRpcPromise('Start',_0x5085('0xa0'),_0x397330);});}return respondWithRpcPromise(_0x5085('0xa1'),_0x5085('0xa0'),_0x397330);})[_0x5085('0x20')](function(_0x158ec3){respondWithRpcPromise(_0x5085('0xa2'),_0x5085('0xa2'),{'event':'notify','message':_0x158ec3},client9002);return _0x158ec3;})[_0x5085('0x20')](respondWithResult(_0x4c874d,null))[_0x5085('0x51')](handleError(_0x4c874d,null));};exports[_0x5085('0xa3')]=function(_0x4aff43,_0x39dc38,_0x11fe9e){return db[_0x5085('0x3b')][_0x5085('0x65')]({'where':{'id':_0x4aff43[_0x5085('0x53')]['id']}})['then'](handleEntityNotFound(_0x39dc38,null))[_0x5085('0x20')](function(_0x3abadf){if(_0x3abadf){return db[_0x5085('0xa4')][_0x5085('0xa5')](function(_0x260ee9){return db[_0x5085('0x84')][_0x5085('0x32')]({'where':{'OpenchannelAccountId':_0x4aff43['params']['id']},'transaction':_0x260ee9})[_0x5085('0x20')](function(_0x3dcf23){var _0x2b4fde=_[_0x5085('0x4b')](_0x4aff43['body'],function(_0x3df8c8){_0x3df8c8['OpenchannelAccountId']=_0x4aff43[_0x5085('0x53')]['id'];return _0x3df8c8;});return db[_0x5085('0x84')][_0x5085('0xa6')](_0x2b4fde,{'transaction':_0x260ee9});});})[_0x5085('0x20')](function(){return db['OpenchannelApplication'][_0x5085('0xa7')]({'where':{'OpenchannelAccountId':_0x4aff43[_0x5085('0x53')]['id']},'order':_0x5085('0x89')});});}})[_0x5085('0x20')](respondWithResult(_0x39dc38,null))['catch'](handleError(_0x39dc38,null));};exports[_0x5085('0xa8')]=function(_0x232bb0,_0x14f8c2,_0x2edf1c){var _0x1b684d={};var _0x5c05a1={};var _0x12f4a4;var _0x596f5c;return db[_0x5085('0x3b')]['findOne']({'where':{'id':_0x232bb0['params']['id']}})[_0x5085('0x20')](handleEntityNotFound(_0x14f8c2,null))[_0x5085('0x20')](function(_0x265794){if(_0x265794){_0x12f4a4=_0x265794;_0x5c05a1[_0x5085('0x3e')]=_['keys'](db['OpenchannelApplication'][_0x5085('0x3c')]);_0x5c05a1[_0x5085('0x3f')]=_[_0x5085('0x55')](_0x232bb0[_0x5085('0x3f')]);_0x5c05a1[_0x5085('0x40')]=_[_0x5085('0x42')](_0x5c05a1['model'],_0x5c05a1[_0x5085('0x3f')]);_0x1b684d['attributes']=_[_0x5085('0x42')](_0x5c05a1[_0x5085('0x3e')],qs['fields'](_0x232bb0[_0x5085('0x3f')][_0x5085('0x43')]));_0x1b684d[_0x5085('0x41')]=_0x1b684d['attributes'][_0x5085('0x56')]?_0x1b684d['attributes']:_0x5c05a1[_0x5085('0x3e')];_0x1b684d[_0x5085('0x46')]=qs['sort'](_0x232bb0[_0x5085('0x3f')][_0x5085('0x47')]);_0x1b684d[_0x5085('0x48')]=qs[_0x5085('0x40')](_['pick'](_0x232bb0['query'],_0x5c05a1[_0x5085('0x40')]));if(_0x232bb0[_0x5085('0x3f')][_0x5085('0x49')]){_0x1b684d['where']=_[_0x5085('0x4a')](_0x1b684d[_0x5085('0x48')],{'$or':_['map'](_0x1b684d[_0x5085('0x41')],function(_0x2cc0a6){var _0x2f5135={};_0x2f5135[_0x2cc0a6]={'$like':'%'+_0x232bb0[_0x5085('0x3f')]['filter']+'%'};return _0x2f5135;})});}_0x1b684d=_['merge']({},_0x1b684d,_0x232bb0['options']);return _0x12f4a4['getApplications'](_0x1b684d);}})[_0x5085('0x20')](function(_0x123b1c){if(_0x123b1c){_0x596f5c=_0x123b1c[_0x5085('0x56')];if(!_0x232bb0[_0x5085('0x3f')]['hasOwnProperty']('nolimit')){_0x1b684d[_0x5085('0x2c')]=qs['limit'](_0x232bb0[_0x5085('0x3f')][_0x5085('0x2c')]);_0x1b684d[_0x5085('0x2a')]=qs[_0x5085('0x2a')](_0x232bb0[_0x5085('0x3f')][_0x5085('0x2a')]);}return _0x12f4a4[_0x5085('0xa8')](_0x1b684d);}})[_0x5085('0x20')](function(_0x2c4533){if(_0x2c4533){return _0x2c4533?{'count':_0x596f5c,'rows':_0x2c4533}:null;}})[_0x5085('0x20')](respondWithResult(_0x14f8c2,null))[_0x5085('0x51')](handleError(_0x14f8c2,null));};exports[_0x5085('0xa9')]=function(_0x353480,_0x6c3711,_0x59270c){var _0x2dc80f={'raw':![],'where':{}};var _0x19ddf4={};var _0x54d055={'count':0x0,'rows':[]};return db[_0x5085('0x3b')][_0x5085('0x65')]({'where':{'id':_0x353480[_0x5085('0x53')]['id']}})[_0x5085('0x20')](handleEntityNotFound(_0x6c3711,null))['then'](function(_0x1e2b10){if(_0x1e2b10){_0x19ddf4['model']=_[_0x5085('0x55')](db[_0x5085('0x8f')]['rawAttributes']);_0x19ddf4[_0x5085('0x3f')]=_[_0x5085('0x55')](_0x353480[_0x5085('0x3f')]);_0x19ddf4['filters']=_[_0x5085('0x42')](_0x19ddf4[_0x5085('0x3e')],_0x19ddf4[_0x5085('0x3f')]);_0x2dc80f[_0x5085('0x41')]=_[_0x5085('0x42')](_0x19ddf4[_0x5085('0x3e')],qs[_0x5085('0x43')](_0x353480[_0x5085('0x3f')]['fields']));_0x2dc80f[_0x5085('0x41')]=_0x2dc80f[_0x5085('0x41')]['length']?_0x2dc80f['attributes']:_0x19ddf4[_0x5085('0x3e')];if(!_0x353480['query'][_0x5085('0x44')](_0x5085('0x45'))){_0x2dc80f[_0x5085('0x2c')]=qs[_0x5085('0x2c')](_0x353480[_0x5085('0x3f')][_0x5085('0x2c')]);_0x2dc80f[_0x5085('0x2a')]=qs[_0x5085('0x2a')](_0x353480[_0x5085('0x3f')][_0x5085('0x2a')]);}_0x2dc80f['order']=qs[_0x5085('0x47')](_0x353480['query'][_0x5085('0x47')]);_0x2dc80f[_0x5085('0x48')]=qs['filters'](_[_0x5085('0x6b')](_0x353480[_0x5085('0x3f')],_0x19ddf4[_0x5085('0x40')]));_0x2dc80f['where'][_0x5085('0x62')]=_0x1e2b10['id'];if(_0x353480[_0x5085('0x3f')][_0x5085('0x49')]){_0x2dc80f[_0x5085('0x48')]=_[_0x5085('0x4a')](_0x2dc80f[_0x5085('0x48')],{'$or':_[_0x5085('0x4b')](_0x2dc80f[_0x5085('0x41')],function(_0x470a9e){var _0x340b1a={};_0x340b1a[_0x470a9e]={'$like':'%'+_0x353480[_0x5085('0x3f')][_0x5085('0x49')]+'%'};return _0x340b1a;})});}_0x2dc80f=_['merge']({},_0x2dc80f,_0x353480[_0x5085('0x4d')]);return db[_0x5085('0x8f')][_0x5085('0x2d')]({'where':_0x2dc80f[_0x5085('0x48')]})[_0x5085('0x20')](function(_0x234935){_0x54d055['count']=_0x234935;if(_0x353480[_0x5085('0x3f')][_0x5085('0x4e')]){_0x2dc80f[_0x5085('0x4f')]=[{'model':db['CmContact'],'as':_0x5085('0xaa'),'required':![]},{'model':db[_0x5085('0x9b')],'as':'Owner','attributes':[_0x5085('0x38'),_0x5085('0xab'),_0x5085('0xac')],'required':![]},{'model':db['Tag'],'as':_0x5085('0xad'),'attributes':['id',_0x5085('0x38'),_0x5085('0xae')],'where':_0x353480[_0x5085('0x3f')][_0x5085('0xaf')]?{'id':_0x353480[_0x5085('0x3f')][_0x5085('0xaf')]}:undefined,'required':_0x353480[_0x5085('0x3f')][_0x5085('0xaf')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x5085('0x50')](_0x2dc80f);})['then'](function(_0x5b11aa){_0x54d055[_0x5085('0x66')]=_0x5b11aa;return _0x54d055;});}})[_0x5085('0x20')](respondWithFilteredResult(_0x6c3711,_0x2dc80f))['catch'](handleError(_0x6c3711,null));};exports[_0x5085('0xb0')]=function(_0x5be50e,_0x19616b,_0x471546){return db['OpenchannelAccount'][_0x5085('0x5c')]({'where':{'id':_0x5be50e[_0x5085('0x53')]['id']}})[_0x5085('0x20')](handleEntityNotFound(_0x19616b,null))[_0x5085('0x20')](function(_0x441b00){if(_0x441b00){return _0x441b00[_0x5085('0xb0')](_0x5be50e[_0x5085('0x58')][_0x5085('0x68')],_['omit'](_0x5be50e[_0x5085('0x58')],[_0x5085('0x68'),'id'])||{})['spread'](function(_0x1b1011){for(var _0x2bd20c=0x0;_0x2bd20c<_0x5be50e[_0x5085('0x58')][_0x5085('0x68')]['length'];_0x2bd20c+=0x1){socket[_0x5085('0xb1')](_0x5085('0xb2'),{'UserId':_0x5be50e[_0x5085('0x58')][_0x5085('0x68')][_0x2bd20c],'OpenchannelAccountId':_0x5be50e[_0x5085('0x53')]['id']});}return _0x1b1011;});}})[_0x5085('0x20')](respondWithResult(_0x19616b,null))[_0x5085('0x51')](handleError(_0x19616b,null));};exports['removeAgents']=function(_0x38c23a,_0x3f615d,_0x2f043c){return db[_0x5085('0x3b')][_0x5085('0x5c')]({'where':{'id':_0x38c23a[_0x5085('0x53')]['id']}})[_0x5085('0x20')](handleEntityNotFound(_0x3f615d,null))[_0x5085('0x20')](function(_0x594d8e){if(_0x594d8e){return _0x594d8e[_0x5085('0xb3')](_0x38c23a[_0x5085('0x3f')][_0x5085('0x68')])[_0x5085('0x20')](function(){if(_[_0x5085('0xb4')](_0x38c23a[_0x5085('0x3f')][_0x5085('0x68')])){for(var _0x27569c=0x0;_0x27569c<_0x38c23a['query']['ids']['length'];_0x27569c+=0x1){socket[_0x5085('0xb1')](_0x5085('0xb5'),{'UserId':Number(_0x38c23a[_0x5085('0x3f')]['ids'][_0x27569c]),'OpenchannelAccountId':Number(_0x38c23a[_0x5085('0x53')]['id'])});}}else{socket[_0x5085('0xb1')](_0x5085('0xb5'),{'UserId':Number(_0x38c23a[_0x5085('0x3f')][_0x5085('0x68')]),'OpenchannelAccountId':Number(_0x38c23a[_0x5085('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x3f615d,null))[_0x5085('0x51')](handleError(_0x3f615d,null));};exports[_0x5085('0xb6')]=function(_0x1c904f,_0x3cfbd8,_0x182d9b){var _0x5638c8={};var _0x3a8b6b={};var _0x8ebd40;var _0x13c60d;return db[_0x5085('0x3b')][_0x5085('0x65')]({'where':{'id':_0x1c904f['params']['id']}})[_0x5085('0x20')](handleEntityNotFound(_0x3cfbd8,null))['then'](function(_0x22aca2){if(_0x22aca2){_0x8ebd40=_0x22aca2;_0x3a8b6b[_0x5085('0x3e')]=_[_0x5085('0x55')](db[_0x5085('0x9b')][_0x5085('0x3c')]);_0x3a8b6b[_0x5085('0x3f')]=_[_0x5085('0x55')](_0x1c904f[_0x5085('0x3f')]);_0x3a8b6b[_0x5085('0x40')]=_[_0x5085('0x42')](_0x3a8b6b[_0x5085('0x3e')],_0x3a8b6b[_0x5085('0x3f')]);_0x5638c8[_0x5085('0x41')]=_[_0x5085('0x42')](_0x3a8b6b[_0x5085('0x3e')],qs[_0x5085('0x43')](_0x1c904f['query'][_0x5085('0x43')]));_0x5638c8[_0x5085('0x41')]=_0x5638c8[_0x5085('0x41')][_0x5085('0x56')]?_0x5638c8[_0x5085('0x41')]:_0x3a8b6b[_0x5085('0x3e')];_0x5638c8[_0x5085('0x46')]=qs[_0x5085('0x47')](_0x1c904f[_0x5085('0x3f')][_0x5085('0x47')]);_0x5638c8['where']=qs[_0x5085('0x40')](_[_0x5085('0x6b')](_0x1c904f['query'],_0x3a8b6b['filters']));if(_0x1c904f[_0x5085('0x3f')][_0x5085('0x49')]){_0x5638c8[_0x5085('0x48')]=_['merge'](_0x5638c8['where'],{'$or':_[_0x5085('0x4b')](_0x5638c8[_0x5085('0x41')],function(_0x176dca){var _0x888bfd={};_0x888bfd[_0x176dca]={'$like':'%'+_0x1c904f[_0x5085('0x3f')]['filter']+'%'};return _0x888bfd;})});}_0x5638c8=_[_0x5085('0x4a')]({},_0x5638c8,_0x1c904f[_0x5085('0x4d')]);return _0x8ebd40[_0x5085('0xb6')](_0x5638c8);}})[_0x5085('0x20')](function(_0x10240e){if(_0x10240e){_0x13c60d=_0x10240e[_0x5085('0x56')];if(!_0x1c904f[_0x5085('0x3f')][_0x5085('0x44')](_0x5085('0x45'))){_0x5638c8[_0x5085('0x2c')]=qs[_0x5085('0x2c')](_0x1c904f['query'][_0x5085('0x2c')]);_0x5638c8[_0x5085('0x2a')]=qs[_0x5085('0x2a')](_0x1c904f[_0x5085('0x3f')][_0x5085('0x2a')]);}return _0x8ebd40['getAgents'](_0x5638c8);}})[_0x5085('0x20')](function(_0x449c9a){if(_0x449c9a){return _0x449c9a?{'count':_0x13c60d,'rows':_0x449c9a}:null;}})['then'](respondWithResult(_0x3cfbd8,null))[_0x5085('0x51')](handleError(_0x3cfbd8,null));};exports[_0x5085('0x39')]=function(_0x36017f,_0x38f841,_0x5d9e53){var _0x3c3543,_0x17f07e,_0x747724;if(_[_0x5085('0x77')](_0x36017f['body'][_0x5085('0x58')])||_0x36017f[_0x5085('0x58')]['body']===''){throw new db['Sequelize'][(_0x5085('0x71'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5085('0x77')](_0x36017f[_0x5085('0x58')]['to'])){}_0x3c3543=_0x36017f[_0x5085('0x58')]['to'];return db[_0x5085('0x3b')][_0x5085('0x65')]({'where':{'id':_0x36017f['params']['id']}})['then'](handleEntityNotFound(_0x38f841,null))[_0x5085('0x20')](function(_0x2a7346){if(_0x2a7346){return db[_0x5085('0x3b')][_0x5085('0x5c')]({'where':{'id':_0x2a7346['id']},'include':[{'model':db['CmList'],'as':_0x5085('0x80'),'include':[{'model':db[_0x5085('0x6f')],'as':_0x5085('0x81'),'where':{[_0x2a7346[_0x5085('0x7e')]]:_0x3c3543},'limit':0x1,'order':[[_0x5085('0x82'),_0x5085('0x83')]]}]}]})['then'](handleEntityNotFound(_0x38f841,null))['then'](function(_0x27ab14){if(_0x27ab14&&_0x27ab14[_0x5085('0x80')]){_0x17f07e=_0x27ab14[_0x5085('0x33')]({'plain':!![]});if(_0x17f07e[_0x5085('0x80')]&&_0x17f07e[_0x5085('0x80')]['Contacts'][_0x5085('0x56')]){return _0x17f07e[_0x5085('0x80')]['Contacts'][0x0];}return db[_0x5085('0x6f')][_0x5085('0x57')](_[_0x5085('0x19')](_0x36017f[_0x5085('0x58')],{'firstName':_0x3c3543,[_0x27ab14['mapKey']]:_0x3c3543,'phone':_0x3c3543,'ListId':_0x17f07e[_0x5085('0x76')]}));}})[_0x5085('0x20')](handleEntityNotFound(_0x38f841,null))[_0x5085('0x20')](function(_0x287069){if(_0x287069){_0x747724=_0x287069;return db['OpenchannelInteraction'][_0x5085('0x5c')]({'where':{'ContactId':_0x747724['id'],'closed':![],'OpenchannelAccountId':_0x17f07e['id']}})[_0x5085('0x20')](function(_0x295536){if(_0x295536){return[_0x295536,![]];}return db[_0x5085('0x8f')][_0x5085('0x57')]({'UserId':_0x36017f[_0x5085('0x59')]['id'],'ContactId':_0x747724['id'],'OpenchannelAccountId':_0x17f07e['id'],'lastMsgDirection':_0x5085('0xb7'),'Messages':[_[_0x5085('0x4a')](_0x36017f[_0x5085('0x58')],{'read':![],'body':_0x36017f[_0x5085('0x58')][_0x5085('0x58')],'OpenchannelAccountId':_0x17f07e['id'],'UserId':_0x36017f[_0x5085('0x59')]['id'],'ContactId':_0x747724['id']})]},{'include':[{'model':db[_0x5085('0xb8')],'as':_0x5085('0xb9')}]})[_0x5085('0x20')](function(_0x13280e){return[_0x13280e,!![]];});});}})[_0x5085('0x92')](function(_0x466326,_0x5a6c58){if(_0x5a6c58){return _0x466326;}return db[_0x5085('0xb8')][_0x5085('0x57')](_['merge'](_0x36017f[_0x5085('0x58')],{'read':![],'body':_0x36017f[_0x5085('0x58')][_0x5085('0x58')],'OpenchannelAccountId':_0x17f07e['id'],'OpenchannelInteractionId':_0x466326['id'],'UserId':_0x36017f[_0x5085('0x59')]['id'],'ContactId':_0x747724['id']}))[_0x5085('0x20')](function(_0x15447a){_0x466326['dataValues'][_0x5085('0xb9')]=[];_0x466326[_0x5085('0xba')][_0x5085('0xb9')][_0x5085('0x97')](_0x15447a[_0x5085('0xba')]);return _0x466326;});});}})[_0x5085('0x20')](respondWithResult(_0x38f841,null))['catch'](handleError(_0x38f841,null));}; \ No newline at end of file +var _0x692e=['where','pick','filter','VIRTUAL','merge','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','getDispositions','findOne','Disposition','OpenchannelAccountId','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','OpenchannelApplication','account','Applications','list','applications','orderBy','priority','asc','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','waitForTheAssignedAgent','Start','EventManager','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','Contact','Owner','fullname','Tag','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','out','OpenchannelMessage','Messages','dataValues','rimraf','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./openchannelAccount.socket','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','get','OpenchannelAccounts','UserProfileResource','destroy','stack','name','index','Pause','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x692e,0x6c));var _0xe692=function(_0x4c6653,_0x5522ef){_0x4c6653=_0x4c6653-0x0;var _0x14c3dd=_0x692e[_0x4c6653];return _0x14c3dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe692('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe692('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xe692('0x2'));var util=require('util');var path=require(_0xe692('0x3'));var sox=require(_0xe692('0x4'));var csv=require(_0xe692('0x5'));var ejs=require(_0xe692('0x6'));var fs=require('fs');var fs_extra=require(_0xe692('0x7'));var _=require(_0xe692('0x8'));var squel=require('squel');var crypto=require(_0xe692('0x9'));var jsforce=require(_0xe692('0xa'));var deskjs=require(_0xe692('0xb'));var toCsv=require(_0xe692('0x5'));var querystring=require(_0xe692('0xc'));var Papa=require(_0xe692('0xd'));var Redis=require(_0xe692('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe692('0xf'));var logger=require(_0xe692('0x10'))(_0xe692('0x11'));var utils=require(_0xe692('0x12'));var config=require(_0xe692('0x13'));var licenseUtil=require(_0xe692('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe692('0x15')](config[_0xe692('0x16')],{'host':_0xe692('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe692('0x16')]));require(_0xe692('0x18'))['register'](socket);var jayson=require(_0xe692('0x19'));var client=jayson[_0xe692('0x1a')][_0xe692('0x1b')]({'port':0x232c});var client9002=jayson[_0xe692('0x1a')][_0xe692('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x31d460,_0x3e7db2,_0x385e4b,_0x313fc3){return new BPromise(function(_0x1328a4,_0x470923){var _0x32bb2e=_0x313fc3||client;return _0x32bb2e[_0xe692('0x1c')](_0x31d460,_0x385e4b)[_0xe692('0x1d')](function(_0x5d87a8){logger[_0xe692('0x1e')](_0xe692('0x1f'),_0x3e7db2,'request\x20sent');logger[_0xe692('0x20')](_0xe692('0x21'),_0x3e7db2,_0xe692('0x22'),JSON[_0xe692('0x23')](_0x5d87a8));if(_0x5d87a8[_0xe692('0x24')]){if(_0x5d87a8[_0xe692('0x24')][_0xe692('0x25')]===0x1f4){logger[_0xe692('0x24')](_0xe692('0x1f'),_0x3e7db2,_0x5d87a8[_0xe692('0x24')][_0xe692('0x26')]);return _0x470923(_0x5d87a8[_0xe692('0x24')][_0xe692('0x26')]);}logger['error'](_0xe692('0x1f'),_0x3e7db2,_0x5d87a8[_0xe692('0x24')][_0xe692('0x26')]);return _0x1328a4(_0x5d87a8[_0xe692('0x24')][_0xe692('0x26')]);}else{logger['info'](_0xe692('0x1f'),_0x3e7db2,_0xe692('0x22'));_0x1328a4(_0x5d87a8[_0xe692('0x27')]['message']);}})[_0xe692('0x28')](function(_0x359567){logger[_0xe692('0x24')](_0xe692('0x1f'),_0x3e7db2,_0x359567);_0x470923(_0x359567);});});}function respondWithStatusCode(_0x2a32ea,_0x28ed5){_0x28ed5=_0x28ed5||0xcc;return function(_0xdd820f){if(_0xdd820f){return _0x2a32ea['sendStatus'](_0x28ed5);}return _0x2a32ea[_0xe692('0x29')](_0x28ed5)[_0xe692('0x2a')]();};}function respondWithResult(_0x173053,_0x5d438a){_0x5d438a=_0x5d438a||0xc8;return function(_0x56dd9c){if(_0x56dd9c){return _0x173053[_0xe692('0x29')](_0x5d438a)[_0xe692('0x2b')](_0x56dd9c);}};}function respondWithFilteredResult(_0x28da73,_0xecacae){return function(_0x57f060){if(_0x57f060){var _0x5a9fea=typeof _0xecacae['offset']===_0xe692('0x2c')&&typeof _0xecacae[_0xe692('0x2d')]===_0xe692('0x2c');var _0x12b416=_0x57f060[_0xe692('0x2e')];var _0x346a38=_0x5a9fea?0x0:_0xecacae[_0xe692('0x2f')];var _0xa061c6=_0x5a9fea?_0x57f060[_0xe692('0x2e')]:_0xecacae['offset']+_0xecacae['limit'];var _0x94467e;if(_0xa061c6>=_0x12b416){_0xa061c6=_0x12b416;_0x94467e=0xc8;}else{_0x94467e=0xce;}_0x28da73[_0xe692('0x29')](_0x94467e);return _0x28da73['set'](_0xe692('0x30'),_0x346a38+'-'+_0xa061c6+'/'+_0x12b416)[_0xe692('0x2b')](_0x57f060);}return null;};}function patchUpdates(_0x11f91a){return function(_0x5264de){try{jsonpatch[_0xe692('0x31')](_0x5264de,_0x11f91a,!![]);}catch(_0x392907){return BPromise[_0xe692('0x32')](_0x392907);}return _0x5264de['save']();};}function saveUpdates(_0x10b174,_0x15e666){return function(_0x266a8e){if(_0x266a8e){return _0x266a8e[_0xe692('0x33')](_0x10b174)[_0xe692('0x1d')](function(_0x5281ea){return _0x5281ea;});}return null;};}function removeEntity(_0x4c32ea,_0x1169c9){return function(_0x572e84){if(_0x572e84){return _0x572e84['destroy']()[_0xe692('0x1d')](function(){var _0x3d8ce8=_0x572e84[_0xe692('0x34')]({'plain':!![]});var _0x399cb2=_0xe692('0x35');return db[_0xe692('0x36')][_0xe692('0x37')]({'where':{'type':_0x399cb2,'resourceId':_0x3d8ce8['id']}})[_0xe692('0x1d')](function(){return _0x572e84;});})[_0xe692('0x1d')](function(){_0x4c32ea[_0xe692('0x29')](0xcc)[_0xe692('0x2a')]();});}};}function handleEntityNotFound(_0x583e5d,_0x5e071c){return function(_0x23d62d){if(!_0x23d62d){_0x583e5d['sendStatus'](0x194);}return _0x23d62d;};}function handleError(_0x5169f0,_0x1c40b0){_0x1c40b0=_0x1c40b0||0x1f4;return function(_0x5a0937){logger[_0xe692('0x24')](_0x5a0937[_0xe692('0x38')]);if(_0x5a0937[_0xe692('0x39')]){delete _0x5a0937[_0xe692('0x39')];}_0x5169f0[_0xe692('0x29')](_0x1c40b0)['send'](_0x5a0937);};}exports[_0xe692('0x3a')]=function(_0x47b2f0,_0x9d6add){var _0x37ac05={'include':[{'model':db[_0xe692('0x3b')],'as':'mandatoryDispositionPause'}]},_0xeb9350={},_0x5398ed={'count':0x0,'rows':[]};var _0x5dc2f5=_['map'](db['OpenchannelAccount']['rawAttributes'],function(_0x23eb46){return{'name':_0x23eb46['fieldName'],'type':_0x23eb46[_0xe692('0x3c')][_0xe692('0x3d')]};});_0xeb9350[_0xe692('0x3e')]=_[_0xe692('0x3f')](_0x5dc2f5,'name');_0xeb9350[_0xe692('0x40')]=_[_0xe692('0x41')](_0x47b2f0[_0xe692('0x40')]);_0xeb9350[_0xe692('0x42')]=_['intersection'](_0xeb9350[_0xe692('0x3e')],_0xeb9350[_0xe692('0x40')]);_0x37ac05[_0xe692('0x43')]=_[_0xe692('0x44')](_0xeb9350['model'],qs[_0xe692('0x45')](_0x47b2f0[_0xe692('0x40')][_0xe692('0x45')]));_0x37ac05[_0xe692('0x43')]=_0x37ac05[_0xe692('0x43')][_0xe692('0x46')]?_0x37ac05[_0xe692('0x43')]:_0xeb9350['model'];if(!_0x47b2f0[_0xe692('0x40')][_0xe692('0x47')](_0xe692('0x48'))){_0x37ac05[_0xe692('0x2d')]=qs[_0xe692('0x2d')](_0x47b2f0[_0xe692('0x40')][_0xe692('0x2d')]);_0x37ac05[_0xe692('0x2f')]=qs['offset'](_0x47b2f0['query'][_0xe692('0x2f')]);}_0x37ac05[_0xe692('0x49')]=qs[_0xe692('0x4a')](_0x47b2f0[_0xe692('0x40')]['sort']);_0x37ac05[_0xe692('0x4b')]=qs[_0xe692('0x42')](_[_0xe692('0x4c')](_0x47b2f0[_0xe692('0x40')],_0xeb9350['filters']),_0x5dc2f5);if(_0x47b2f0[_0xe692('0x40')][_0xe692('0x4d')]){_0x37ac05[_0xe692('0x4b')]=_['merge'](_0x37ac05[_0xe692('0x4b')],{'$or':_[_0xe692('0x3f')](_0x5dc2f5,function(_0x1ae891){if(_0x1ae891[_0xe692('0x3c')]!==_0xe692('0x4e')){var _0xa4b457={};_0xa4b457[_0x1ae891[_0xe692('0x39')]]={'$like':'%'+_0x47b2f0[_0xe692('0x40')][_0xe692('0x4d')]+'%'};return _0xa4b457;}})});}_0x37ac05=_[_0xe692('0x4f')]({},_0x37ac05,_0x47b2f0[_0xe692('0x50')]);var _0x42239e={'where':_0x37ac05[_0xe692('0x4b')]};return db[_0xe692('0x51')][_0xe692('0x2e')](_0x42239e)['then'](function(_0x5c8725){_0x5398ed['count']=_0x5c8725;if(_0x47b2f0['query'][_0xe692('0x52')]){_0x37ac05[_0xe692('0x53')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xe692('0x54')](_0x37ac05);})[_0xe692('0x1d')](function(_0x44b911){_0x5398ed[_0xe692('0x55')]=_0x44b911;return _0x5398ed;})['then'](respondWithFilteredResult(_0x9d6add,_0x37ac05))[_0xe692('0x28')](handleError(_0x9d6add,null));};exports[_0xe692('0x56')]=function(_0x440233,_0x20b3ea){var _0x485eb7={'raw':![],'where':{'id':_0x440233[_0xe692('0x57')]['id']},'include':[{'model':db[_0xe692('0x3b')],'as':'mandatoryDispositionPause'}]},_0x194324={};_0x194324[_0xe692('0x3e')]=_[_0xe692('0x41')](db[_0xe692('0x51')][_0xe692('0x58')]);_0x194324['query']=_[_0xe692('0x41')](_0x440233[_0xe692('0x40')]);_0x194324[_0xe692('0x42')]=_[_0xe692('0x44')](_0x194324[_0xe692('0x3e')],_0x194324[_0xe692('0x40')]);_0x485eb7[_0xe692('0x43')]=_[_0xe692('0x44')](_0x194324[_0xe692('0x3e')],qs['fields'](_0x440233[_0xe692('0x40')]['fields']));_0x485eb7['attributes']=_0x485eb7[_0xe692('0x43')]['length']?_0x485eb7[_0xe692('0x43')]:_0x194324[_0xe692('0x3e')];if(_0x440233[_0xe692('0x40')][_0xe692('0x52')]){_0x485eb7[_0xe692('0x53')]=[{'all':!![]}];}_0x485eb7=_[_0xe692('0x4f')]({},_0x485eb7,_0x440233['options']);return db[_0xe692('0x51')][_0xe692('0x59')](_0x485eb7)[_0xe692('0x1d')](handleEntityNotFound(_0x20b3ea,null))[_0xe692('0x1d')](respondWithResult(_0x20b3ea,null))[_0xe692('0x28')](handleError(_0x20b3ea,null));};exports['create']=function(_0x3b6c58,_0x317de0){return db[_0xe692('0x51')][_0xe692('0x5a')](_0x3b6c58[_0xe692('0x5b')],{})[_0xe692('0x1d')](function(_0x35a0bf){var _0x3d0635=_0x3b6c58[_0xe692('0x5c')][_0xe692('0x34')]({'plain':!![]});if(!_0x3d0635)throw new Error(_0xe692('0x5d'));if(_0x3d0635[_0xe692('0x5e')]===_0xe692('0x5c')){var _0x81d8f1=_0x35a0bf[_0xe692('0x34')]({'plain':!![]});var _0x1f72dc=_0xe692('0x35');return db[_0xe692('0x5f')]['find']({'where':{'name':_0x1f72dc,'userProfileId':_0x3d0635['userProfileId']},'raw':!![]})[_0xe692('0x1d')](function(_0x369fb5){if(_0x369fb5&&_0x369fb5[_0xe692('0x60')]===0x0){return db['UserProfileResource'][_0xe692('0x5a')]({'name':_0x81d8f1[_0xe692('0x39')],'resourceId':_0x81d8f1['id'],'type':_0x369fb5[_0xe692('0x39')],'sectionId':_0x369fb5['id']},{})[_0xe692('0x1d')](function(){return _0x35a0bf;});}else{return _0x35a0bf;}})[_0xe692('0x28')](function(_0x406142){logger[_0xe692('0x24')](_0xe692('0x61'),_0x406142);throw _0x406142;});}return _0x35a0bf;})[_0xe692('0x1d')](respondWithResult(_0x317de0,0xc9))[_0xe692('0x28')](handleError(_0x317de0,null));};exports[_0xe692('0x33')]=function(_0x303692,_0x4d6da5){if(_0x303692[_0xe692('0x5b')]['id']){delete _0x303692[_0xe692('0x5b')]['id'];}return db[_0xe692('0x51')][_0xe692('0x59')]({'where':{'id':_0x303692[_0xe692('0x57')]['id']},'include':[{'model':db[_0xe692('0x3b')],'as':_0xe692('0x62')}]})[_0xe692('0x1d')](handleEntityNotFound(_0x4d6da5,null))['then'](saveUpdates(_0x303692[_0xe692('0x5b')],null))[_0xe692('0x1d')](respondWithResult(_0x4d6da5,null))['catch'](handleError(_0x4d6da5,null));};exports['destroy']=function(_0x15cb77,_0x379cb9){return db[_0xe692('0x51')]['find']({'where':{'id':_0x15cb77[_0xe692('0x57')]['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x379cb9,null))[_0xe692('0x1d')](removeEntity(_0x379cb9,null))[_0xe692('0x28')](handleError(_0x379cb9,null));};exports['describe']=function(_0x2441eb,_0x3860af){return db[_0xe692('0x51')][_0xe692('0x63')]()[_0xe692('0x1d')](respondWithResult(_0x3860af,null))['catch'](handleError(_0x3860af,null));};exports['addDisposition']=function(_0x44e9be,_0x67d645,_0x168d9e){if(_0x44e9be[_0xe692('0x5b')]['id']){delete _0x44e9be[_0xe692('0x5b')]['id'];}return db[_0xe692('0x51')][_0xe692('0x59')]({'where':{'id':_0x44e9be['params']['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x67d645,null))[_0xe692('0x1d')](function(_0x3903a9){if(_0x3903a9){_0x44e9be[_0xe692('0x5b')]['OpenchannelAccountId']=_0x3903a9['id'];return db['Disposition'][_0xe692('0x5a')](_0x44e9be[_0xe692('0x5b')]);}})[_0xe692('0x1d')](respondWithResult(_0x67d645,null))[_0xe692('0x28')](handleError(_0x67d645,null));};exports[_0xe692('0x64')]=function(_0x17a3ea,_0x3ea6b0,_0x5a9544){var _0x5dc6ab={'raw':![],'where':{}};var _0x47120b={};var _0x339075={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe692('0x65')]({'where':{'id':_0x17a3ea[_0xe692('0x57')]['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x3ea6b0,null))[_0xe692('0x1d')](function(_0x135c83){if(_0x135c83){_0x47120b[_0xe692('0x3e')]=_[_0xe692('0x41')](db[_0xe692('0x66')][_0xe692('0x58')]);_0x47120b['query']=_[_0xe692('0x41')](_0x17a3ea[_0xe692('0x40')]);_0x47120b[_0xe692('0x42')]=_[_0xe692('0x44')](_0x47120b[_0xe692('0x3e')],_0x47120b[_0xe692('0x40')]);_0x5dc6ab['attributes']=_[_0xe692('0x44')](_0x47120b['model'],qs[_0xe692('0x45')](_0x17a3ea['query']['fields']));_0x5dc6ab[_0xe692('0x43')]=_0x5dc6ab['attributes'][_0xe692('0x46')]?_0x5dc6ab['attributes']:_0x47120b[_0xe692('0x3e')];if(!_0x17a3ea['query'][_0xe692('0x47')](_0xe692('0x48'))){_0x5dc6ab['limit']=qs[_0xe692('0x2d')](_0x17a3ea[_0xe692('0x40')]['limit']);_0x5dc6ab[_0xe692('0x2f')]=qs['offset'](_0x17a3ea[_0xe692('0x40')][_0xe692('0x2f')]);}_0x5dc6ab['order']=qs[_0xe692('0x4a')](_0x17a3ea['query'][_0xe692('0x4a')]);_0x5dc6ab[_0xe692('0x4b')]=qs[_0xe692('0x42')](_[_0xe692('0x4c')](_0x17a3ea[_0xe692('0x40')],_0x47120b[_0xe692('0x42')]));_0x5dc6ab[_0xe692('0x4b')][_0xe692('0x67')]=_0x135c83['id'];if(_0x17a3ea[_0xe692('0x40')]['filter']){_0x5dc6ab[_0xe692('0x4b')]=_[_0xe692('0x4f')](_0x5dc6ab[_0xe692('0x4b')],{'$or':_[_0xe692('0x3f')](_0x5dc6ab[_0xe692('0x43')],function(_0x13b4c2){var _0x3f1643={};_0x3f1643[_0x13b4c2]={'$like':'%'+_0x17a3ea[_0xe692('0x40')][_0xe692('0x4d')]+'%'};return _0x3f1643;})});}_0x5dc6ab=_[_0xe692('0x4f')]({},_0x5dc6ab,_0x17a3ea['options']);return db[_0xe692('0x66')]['count']({'where':_0x5dc6ab['where']})[_0xe692('0x1d')](function(_0x3b48d4){_0x339075[_0xe692('0x2e')]=_0x3b48d4;if(_0x17a3ea[_0xe692('0x40')][_0xe692('0x52')]){_0x5dc6ab[_0xe692('0x53')]=[{'all':!![]}];}return db[_0xe692('0x66')][_0xe692('0x54')](_0x5dc6ab);})[_0xe692('0x1d')](function(_0x549d27){_0x339075['rows']=_0x549d27;return _0x339075;});}})[_0xe692('0x1d')](respondWithFilteredResult(_0x3ea6b0,_0x5dc6ab))[_0xe692('0x28')](handleError(_0x3ea6b0,null));};exports[_0xe692('0x68')]=function(_0xba440d,_0x2b0b98,_0x5cb40a){return db[_0xe692('0x51')]['find']({'where':{'id':_0xba440d[_0xe692('0x57')]['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x2b0b98,null))[_0xe692('0x1d')](function(_0x237477){if(_0x237477){return _0x237477['removeDispositions'](_0xba440d[_0xe692('0x40')][_0xe692('0x69')]);}})[_0xe692('0x1d')](respondWithStatusCode(_0x2b0b98,null))[_0xe692('0x28')](handleError(_0x2b0b98,null));};exports['addAnswer']=function(_0x39127c,_0x393773,_0x1e69f2){if(_0x39127c[_0xe692('0x5b')]['id']){delete _0x39127c[_0xe692('0x5b')]['id'];}return db['OpenchannelAccount'][_0xe692('0x59')]({'where':{'id':_0x39127c[_0xe692('0x57')]['id']}})['then'](handleEntityNotFound(_0x393773,null))[_0xe692('0x1d')](function(_0x23dbf3){if(_0x23dbf3){_0x39127c[_0xe692('0x5b')][_0xe692('0x67')]=_0x23dbf3['id'];return db['CannedAnswer'][_0xe692('0x5a')](_0x39127c['body']);}})['then'](respondWithResult(_0x393773,null))[_0xe692('0x28')](handleError(_0x393773,null));};exports[_0xe692('0x6a')]=function(_0x1ae89d,_0x4f7458,_0x22b8ce){var _0x89f299={'raw':![],'where':{}};var _0x259fc1={};var _0x61df5f={'count':0x0,'rows':[]};return db[_0xe692('0x51')]['findOne']({'where':{'id':_0x1ae89d[_0xe692('0x57')]['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x4f7458,null))['then'](function(_0x3e431c){if(_0x3e431c){_0x259fc1[_0xe692('0x3e')]=_[_0xe692('0x41')](db['CannedAnswer'][_0xe692('0x58')]);_0x259fc1[_0xe692('0x40')]=_['keys'](_0x1ae89d[_0xe692('0x40')]);_0x259fc1['filters']=_[_0xe692('0x44')](_0x259fc1['model'],_0x259fc1[_0xe692('0x40')]);_0x89f299[_0xe692('0x43')]=_[_0xe692('0x44')](_0x259fc1[_0xe692('0x3e')],qs[_0xe692('0x45')](_0x1ae89d[_0xe692('0x40')]['fields']));_0x89f299[_0xe692('0x43')]=_0x89f299[_0xe692('0x43')][_0xe692('0x46')]?_0x89f299[_0xe692('0x43')]:_0x259fc1[_0xe692('0x3e')];if(!_0x1ae89d['query'][_0xe692('0x47')](_0xe692('0x48'))){_0x89f299['limit']=qs[_0xe692('0x2d')](_0x1ae89d[_0xe692('0x40')][_0xe692('0x2d')]);_0x89f299['offset']=qs[_0xe692('0x2f')](_0x1ae89d[_0xe692('0x40')]['offset']);}_0x89f299[_0xe692('0x49')]=qs[_0xe692('0x4a')](_0x1ae89d[_0xe692('0x40')]['sort']);_0x89f299[_0xe692('0x4b')]=qs[_0xe692('0x42')](_['pick'](_0x1ae89d[_0xe692('0x40')],_0x259fc1[_0xe692('0x42')]));_0x89f299[_0xe692('0x4b')][_0xe692('0x67')]=_0x3e431c['id'];if(_0x1ae89d['query'][_0xe692('0x4d')]){_0x89f299[_0xe692('0x4b')]=_[_0xe692('0x4f')](_0x89f299[_0xe692('0x4b')],{'$or':_[_0xe692('0x3f')](_0x89f299[_0xe692('0x43')],function(_0x4b1f4b){var _0x4a3c99={};_0x4a3c99[_0x4b1f4b]={'$like':'%'+_0x1ae89d['query'][_0xe692('0x4d')]+'%'};return _0x4a3c99;})});}_0x89f299=_[_0xe692('0x4f')]({},_0x89f299,_0x1ae89d[_0xe692('0x50')]);return db['CannedAnswer']['count']({'where':_0x89f299[_0xe692('0x4b')]})[_0xe692('0x1d')](function(_0x5871e2){_0x61df5f[_0xe692('0x2e')]=_0x5871e2;if(_0x1ae89d[_0xe692('0x40')][_0xe692('0x52')]){_0x89f299['include']=[{'all':!![]}];}return db[_0xe692('0x6b')][_0xe692('0x54')](_0x89f299);})[_0xe692('0x1d')](function(_0x17d51d){_0x61df5f[_0xe692('0x55')]=_0x17d51d;return _0x61df5f;});}})[_0xe692('0x1d')](respondWithFilteredResult(_0x4f7458,_0x89f299))[_0xe692('0x28')](handleError(_0x4f7458,null));};exports[_0xe692('0x6c')]=function(_0x29a8a1,_0x4d9be8,_0x5db4df){return db[_0xe692('0x51')][_0xe692('0x59')]({'where':{'id':_0x29a8a1[_0xe692('0x57')]['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x4d9be8,null))[_0xe692('0x1d')](function(_0x4d858d){if(_0x4d858d){return _0x4d858d[_0xe692('0x6c')](_0x29a8a1[_0xe692('0x40')][_0xe692('0x69')]);}})[_0xe692('0x1d')](respondWithStatusCode(_0x4d9be8,null))[_0xe692('0x28')](handleError(_0x4d9be8,null));};exports[_0xe692('0x6d')]=function(_0x25284f,_0x2fa818,_0x51b7b1){var _0x431453={'body':_0x25284f[_0xe692('0x5b')],'channel':_0xe692('0x6e')};var _0x14e400=[];var _0x18195f=[];var _0x3cfca3={};var _0x9d3b75=![];return db[_0xe692('0x6f')][_0xe692('0x63')]()[_0xe692('0x1d')](function(_0x31dd16){if(!_0x31dd16){throw new db['Sequelize'][(_0xe692('0x70'))](_0xe692('0x71'));}_0x14e400=_[_0xe692('0x72')](_['keys'](_0x31dd16),[_0xe692('0x73'),_0xe692('0x74')]);_0x18195f=_['difference'](_['keys'](_0x31dd16),[_0xe692('0x73'),_0xe692('0x74'),_0xe692('0x75'),'ListId']);if(_0x25284f[_0xe692('0x5b')]['id']){delete _0x25284f['body']['id'];}if(_['isNil'](_0x25284f[_0xe692('0x5b')]['from'])){throw new db[(_0xe692('0x76'))]['ValidationError'](_0xe692('0x77'));}if(_[_0xe692('0x78')](_0x25284f[_0xe692('0x5b')][_0xe692('0x5b')])||_0x25284f['body'][_0xe692('0x5b')]===''){throw new db['Sequelize'][(_0xe692('0x70'))](_0xe692('0x79'));}if(_['isNil'](_0x25284f[_0xe692('0x5b')][_0xe692('0x7a')])){throw new db[(_0xe692('0x76'))][(_0xe692('0x70'))](_0xe692('0x7b')+_0x18195f);}if(!_[_0xe692('0x7c')](_0x18195f,_0x25284f[_0xe692('0x5b')]['mapKey'])){throw new db[(_0xe692('0x76'))]['ValidationError'](_0xe692('0x7d')+_0x18195f);}_0x3cfca3[_0x25284f[_0xe692('0x5b')]['mapKey']]=_0x25284f[_0xe692('0x5b')][_0xe692('0x7e')];})['then'](function(){return db[_0xe692('0x51')][_0xe692('0x59')]({'where':{'id':_0x25284f[_0xe692('0x57')]['id']},'include':[{'model':db[_0xe692('0x7f')],'as':_0xe692('0x80'),'include':[{'model':db[_0xe692('0x6f')],'as':_0xe692('0x81'),'where':_0x3cfca3,'limit':0x1,'order':[[_0xe692('0x74'),_0xe692('0x82')]]}]},{'model':db[_0xe692('0x83')],'as':'Applications'}]});})[_0xe692('0x1d')](handleEntityNotFound(_0x2fa818,null))[_0xe692('0x1d')](function(_0x4aa7d4){if(_0x4aa7d4&&_0x4aa7d4[_0xe692('0x80')]){_0x431453[_0xe692('0x84')]=_0x4aa7d4;_0x431453['applications']=_0x4aa7d4[_0xe692('0x85')];_0x431453[_0xe692('0x86')]=_0x4aa7d4[_0xe692('0x80')];_0x431453[_0xe692('0x87')]=_[_0xe692('0x88')](_0x431453[_0xe692('0x87')],[_0xe692('0x89')],[_0xe692('0x8a')]);if(_0x431453[_0xe692('0x84')][_0xe692('0x85')]){delete _0x431453['account']['Applications'];}if(_0x431453['account'][_0xe692('0x80')]&&_0x431453[_0xe692('0x84')]['List'][_0xe692('0x81')]['length']){return _0x431453['account'][_0xe692('0x80')][_0xe692('0x81')][0x0];}var _0x49360b=_[_0xe692('0x15')](_0x25284f[_0xe692('0x5b')],{'firstName':_0x25284f[_0xe692('0x5b')][_0xe692('0x7e')],'ListId':_0x4aa7d4[_0xe692('0x8b')]});_0x49360b[_0x25284f[_0xe692('0x5b')][_0xe692('0x7a')]]=_0x25284f[_0xe692('0x5b')][_0xe692('0x7e')];return db[_0xe692('0x6f')]['create'](_0x49360b,{'fields':_0x14e400,'raw':!![]});}})[_0xe692('0x1d')](handleEntityNotFound(_0x2fa818,null))[_0xe692('0x1d')](function(_0x4fa5c5){_0x431453[_0xe692('0x8c')]=_0x4fa5c5;if(_0x4fa5c5){var _0x1d7d5f={'ContactId':_0x4fa5c5['id'],'OpenchannelAccountId':_0x25284f[_0xe692('0x57')]['id'],'from':(_0x4fa5c5[_0xe692('0x8d')]||'')+'\x20'+(_0x4fa5c5[_0xe692('0x8e')]||'')};var _0xefa762={'OpenchannelAccountId':_0x25284f[_0xe692('0x57')]['id'],'closed':![]};if(_0x25284f[_0xe692('0x5b')]['threadId']){_0xefa762[_0xe692('0x8f')]=_0x25284f[_0xe692('0x5b')]['threadId'];return db[_0xe692('0x90')][_0xe692('0x59')]({'where':_0xefa762})[_0xe692('0x1d')](function(_0x1c0071){if(_0x1c0071){return[_0x1c0071,![]];}_0x1d7d5f[_0xe692('0x8f')]=_0x25284f[_0xe692('0x5b')][_0xe692('0x8f')];_0x1d7d5f[_0xe692('0x91')]=_0x25284f['body']['externalUrl'];return db[_0xe692('0x90')][_0xe692('0x5a')](_0x1d7d5f)[_0xe692('0x1d')](function(_0xd38a65){return[_0xd38a65,!![]];});});}else{_0xefa762[_0xe692('0x8f')]=null;}_0xefa762[_0xe692('0x92')]=_0x4fa5c5['id'];return db[_0xe692('0x90')][_0xe692('0x59')]({'where':_0xefa762})['then'](function(_0x1cb1a1){if(_0x1cb1a1){return[_0x1cb1a1,![]];}return db[_0xe692('0x90')][_0xe692('0x5a')](_0x1d7d5f)[_0xe692('0x1d')](function(_0x3fe779){return[_0x3fe779,!![]];});});}})[_0xe692('0x93')](function(_0x4c9ba3,_0x41e2d7){if(_0x4c9ba3){_0x9d3b75=_0x41e2d7;if(!_0x41e2d7){var _0x7c7ab5={'from':(_0x431453[_0xe692('0x8c')][_0xe692('0x8d')]||'')+'\x20'+(_0x431453[_0xe692('0x8c')][_0xe692('0x8e')]||'')};if(_0x25284f[_0xe692('0x5b')][_0xe692('0x8f')]&&_0x25284f[_0xe692('0x5b')]['messageId']&&_0x25284f[_0xe692('0x5b')][_0xe692('0x8f')]!=_0x25284f[_0xe692('0x5b')]['messageId']){_0x7c7ab5[_0xe692('0x8f')]=_0x25284f['body'][_0xe692('0x94')];}return _0x4c9ba3['update'](_0x7c7ab5);}else{return _0x4c9ba3;}}})['then'](function(_0x573be6){_0x431453[_0xe692('0x95')]=_0x573be6['get']({'plain':!![]});_0x431453[_0xe692('0x95')]['created']=_0x9d3b75;if(_0x431453[_0xe692('0x95')][_0xe692('0x96')]){if(_0x431453[_0xe692('0x84')]['autoclose']){_0x431453[_0xe692('0x87')]['push']({'id':0x0,'priority':_0x431453[_0xe692('0x87')][_0xe692('0x46')]+0x1,'app':_0xe692('0x97'),'appdata':_0xe692('0x98'),'interval':_0xe692('0x99')});}}return db['OpenchannelMessage'][_0xe692('0x5a')]({'body':_0x25284f[_0xe692('0x5b')][_0xe692('0x5b')],'OpenchannelAccountId':_0x25284f[_0xe692('0x57')]['id'],'OpenchannelInteractionId':_0x573be6['id'],'direction':'in','ContactId':_0x431453[_0xe692('0x8c')]['id'],'AttachmentId':_0x25284f['body'][_0xe692('0x9a')]});})[_0xe692('0x1d')](function(_0x2a7a87){_0x431453[_0xe692('0x26')]=_0x2a7a87;if(_0x431453['interaction'][_0xe692('0x9b')]){return db[_0xe692('0x9c')][_0xe692('0x59')]({'attributes':['id',_0xe692('0x39')],'where':{'id':_0x431453[_0xe692('0x95')][_0xe692('0x9b')]}})[_0xe692('0x1d')](function(_0x169d54){if(_0x169d54){_0x431453[_0xe692('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x169d54['name']+','+(_0x431453['account'][_0xe692('0x9d')]||0xa),'interval':_0xe692('0x99')});_0x431453['forcedOwnership']=![];}return respondWithRpcPromise(_0xe692('0x9e'),'startRouting',_0x431453);});}return respondWithRpcPromise(_0xe692('0x9e'),'startRouting',_0x431453);})[_0xe692('0x1d')](function(_0x26c803){respondWithRpcPromise(_0xe692('0x9f'),'EventManager',{'event':'notify','message':_0x26c803},client9002);return _0x26c803;})[_0xe692('0x1d')](respondWithResult(_0x2fa818,null))[_0xe692('0x28')](handleError(_0x2fa818,null));};exports[_0xe692('0xa0')]=function(_0x8eb56f,_0x563c8b,_0x58a9dd){return db['OpenchannelAccount'][_0xe692('0x65')]({'where':{'id':_0x8eb56f[_0xe692('0x57')]['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x563c8b,null))[_0xe692('0x1d')](function(_0x105604){if(_0x105604){return db[_0xe692('0xa1')]['transaction'](function(_0x25c79f){return db[_0xe692('0x83')][_0xe692('0x37')]({'where':{'OpenchannelAccountId':_0x8eb56f[_0xe692('0x57')]['id']},'transaction':_0x25c79f})['then'](function(_0x2f5320){var _0x42b084=_['map'](_0x8eb56f[_0xe692('0x5b')],function(_0x314446){_0x314446[_0xe692('0x67')]=_0x8eb56f[_0xe692('0x57')]['id'];return _0x314446;});return db[_0xe692('0x83')][_0xe692('0xa2')](_0x42b084,{'transaction':_0x25c79f});});})[_0xe692('0x1d')](function(){return db[_0xe692('0x83')][_0xe692('0xa3')]({'where':{'OpenchannelAccountId':_0x8eb56f[_0xe692('0x57')]['id']},'order':_0xe692('0x89')});});}})[_0xe692('0x1d')](respondWithResult(_0x563c8b,null))[_0xe692('0x28')](handleError(_0x563c8b,null));};exports[_0xe692('0xa4')]=function(_0xdc5fd1,_0x421827,_0x2e9878){var _0x22c9b7={};var _0x519357={};var _0x301d6f;var _0xa2536c;return db[_0xe692('0x51')]['findOne']({'where':{'id':_0xdc5fd1[_0xe692('0x57')]['id']}})['then'](handleEntityNotFound(_0x421827,null))[_0xe692('0x1d')](function(_0x1f5d7){if(_0x1f5d7){_0x301d6f=_0x1f5d7;_0x519357[_0xe692('0x3e')]=_[_0xe692('0x41')](db[_0xe692('0x83')][_0xe692('0x58')]);_0x519357[_0xe692('0x40')]=_[_0xe692('0x41')](_0xdc5fd1['query']);_0x519357['filters']=_[_0xe692('0x44')](_0x519357['model'],_0x519357[_0xe692('0x40')]);_0x22c9b7[_0xe692('0x43')]=_[_0xe692('0x44')](_0x519357[_0xe692('0x3e')],qs['fields'](_0xdc5fd1['query'][_0xe692('0x45')]));_0x22c9b7[_0xe692('0x43')]=_0x22c9b7[_0xe692('0x43')][_0xe692('0x46')]?_0x22c9b7[_0xe692('0x43')]:_0x519357[_0xe692('0x3e')];_0x22c9b7[_0xe692('0x49')]=qs[_0xe692('0x4a')](_0xdc5fd1['query']['sort']);_0x22c9b7[_0xe692('0x4b')]=qs['filters'](_[_0xe692('0x4c')](_0xdc5fd1['query'],_0x519357[_0xe692('0x42')]));if(_0xdc5fd1[_0xe692('0x40')][_0xe692('0x4d')]){_0x22c9b7[_0xe692('0x4b')]=_['merge'](_0x22c9b7[_0xe692('0x4b')],{'$or':_[_0xe692('0x3f')](_0x22c9b7[_0xe692('0x43')],function(_0x4f7a1c){var _0x1b6d0f={};_0x1b6d0f[_0x4f7a1c]={'$like':'%'+_0xdc5fd1[_0xe692('0x40')][_0xe692('0x4d')]+'%'};return _0x1b6d0f;})});}_0x22c9b7=_[_0xe692('0x4f')]({},_0x22c9b7,_0xdc5fd1[_0xe692('0x50')]);return _0x301d6f[_0xe692('0xa4')](_0x22c9b7);}})[_0xe692('0x1d')](function(_0xc643b2){if(_0xc643b2){_0xa2536c=_0xc643b2[_0xe692('0x46')];if(!_0xdc5fd1['query'][_0xe692('0x47')](_0xe692('0x48'))){_0x22c9b7[_0xe692('0x2d')]=qs[_0xe692('0x2d')](_0xdc5fd1[_0xe692('0x40')][_0xe692('0x2d')]);_0x22c9b7[_0xe692('0x2f')]=qs['offset'](_0xdc5fd1[_0xe692('0x40')][_0xe692('0x2f')]);}return _0x301d6f[_0xe692('0xa4')](_0x22c9b7);}})[_0xe692('0x1d')](function(_0x2e3aac){if(_0x2e3aac){return _0x2e3aac?{'count':_0xa2536c,'rows':_0x2e3aac}:null;}})[_0xe692('0x1d')](respondWithResult(_0x421827,null))['catch'](handleError(_0x421827,null));};exports['getInteractions']=function(_0x42e3b6,_0x331095,_0x4cf42d){var _0x53a4ea={'raw':![],'where':{}};var _0x3e9b54={};var _0x1d1042={'count':0x0,'rows':[]};return db[_0xe692('0x51')][_0xe692('0x65')]({'where':{'id':_0x42e3b6[_0xe692('0x57')]['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x331095,null))[_0xe692('0x1d')](function(_0x102f12){if(_0x102f12){_0x3e9b54[_0xe692('0x3e')]=_['keys'](db[_0xe692('0x90')][_0xe692('0x58')]);_0x3e9b54[_0xe692('0x40')]=_['keys'](_0x42e3b6[_0xe692('0x40')]);_0x3e9b54[_0xe692('0x42')]=_[_0xe692('0x44')](_0x3e9b54[_0xe692('0x3e')],_0x3e9b54[_0xe692('0x40')]);_0x53a4ea[_0xe692('0x43')]=_[_0xe692('0x44')](_0x3e9b54['model'],qs['fields'](_0x42e3b6[_0xe692('0x40')]['fields']));_0x53a4ea[_0xe692('0x43')]=_0x53a4ea[_0xe692('0x43')][_0xe692('0x46')]?_0x53a4ea[_0xe692('0x43')]:_0x3e9b54[_0xe692('0x3e')];if(!_0x42e3b6[_0xe692('0x40')][_0xe692('0x47')](_0xe692('0x48'))){_0x53a4ea[_0xe692('0x2d')]=qs[_0xe692('0x2d')](_0x42e3b6['query'][_0xe692('0x2d')]);_0x53a4ea[_0xe692('0x2f')]=qs[_0xe692('0x2f')](_0x42e3b6['query']['offset']);}_0x53a4ea[_0xe692('0x49')]=qs[_0xe692('0x4a')](_0x42e3b6[_0xe692('0x40')][_0xe692('0x4a')]);_0x53a4ea['where']=qs[_0xe692('0x42')](_[_0xe692('0x4c')](_0x42e3b6['query'],_0x3e9b54[_0xe692('0x42')]));_0x53a4ea['where'][_0xe692('0x67')]=_0x102f12['id'];if(_0x42e3b6[_0xe692('0x40')]['filter']){_0x53a4ea[_0xe692('0x4b')]=_[_0xe692('0x4f')](_0x53a4ea['where'],{'$or':_['map'](_0x53a4ea['attributes'],function(_0x33e8c3){var _0x48ada9={};_0x48ada9[_0x33e8c3]={'$like':'%'+_0x42e3b6[_0xe692('0x40')][_0xe692('0x4d')]+'%'};return _0x48ada9;})});}_0x53a4ea=_[_0xe692('0x4f')]({},_0x53a4ea,_0x42e3b6[_0xe692('0x50')]);return db[_0xe692('0x90')][_0xe692('0x2e')]({'where':_0x53a4ea[_0xe692('0x4b')]})[_0xe692('0x1d')](function(_0x47b0c6){_0x1d1042[_0xe692('0x2e')]=_0x47b0c6;if(_0x42e3b6[_0xe692('0x40')]['includeAll']){_0x53a4ea[_0xe692('0x53')]=[{'model':db[_0xe692('0x6f')],'as':_0xe692('0xa5'),'required':![]},{'model':db['User'],'as':_0xe692('0xa6'),'attributes':[_0xe692('0x39'),_0xe692('0xa7'),'internal'],'required':![]},{'model':db[_0xe692('0xa8')],'as':'Tags','attributes':['id',_0xe692('0x39'),'color'],'where':_0x42e3b6[_0xe692('0x40')][_0xe692('0xa9')]?{'id':_0x42e3b6[_0xe692('0x40')][_0xe692('0xa9')]}:undefined,'required':_0x42e3b6[_0xe692('0x40')][_0xe692('0xa9')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x53a4ea);})['then'](function(_0x240801){_0x1d1042[_0xe692('0x55')]=_0x240801;return _0x1d1042;});}})[_0xe692('0x1d')](respondWithFilteredResult(_0x331095,_0x53a4ea))[_0xe692('0x28')](handleError(_0x331095,null));};exports[_0xe692('0xaa')]=function(_0x297dd8,_0x15e618,_0x13485b){return db['OpenchannelAccount'][_0xe692('0x59')]({'where':{'id':_0x297dd8[_0xe692('0x57')]['id']}})['then'](handleEntityNotFound(_0x15e618,null))[_0xe692('0x1d')](function(_0x27bb0c){if(_0x27bb0c){return _0x27bb0c[_0xe692('0xaa')](_0x297dd8[_0xe692('0x5b')][_0xe692('0x69')],_[_0xe692('0xab')](_0x297dd8[_0xe692('0x5b')],['ids','id'])||{})[_0xe692('0x93')](function(_0x1daaa1){for(var _0x37a49b=0x0;_0x37a49b<_0x297dd8[_0xe692('0x5b')][_0xe692('0x69')]['length'];_0x37a49b+=0x1){socket[_0xe692('0xac')](_0xe692('0xad'),{'UserId':_0x297dd8['body'][_0xe692('0x69')][_0x37a49b],'OpenchannelAccountId':_0x297dd8[_0xe692('0x57')]['id']});}return _0x1daaa1;});}})['then'](respondWithResult(_0x15e618,null))['catch'](handleError(_0x15e618,null));};exports[_0xe692('0xae')]=function(_0xed2dcd,_0x16cdb5,_0x3f950e){return db[_0xe692('0x51')]['find']({'where':{'id':_0xed2dcd[_0xe692('0x57')]['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x16cdb5,null))['then'](function(_0x59b070){if(_0x59b070){return _0x59b070['removeAgents'](_0xed2dcd[_0xe692('0x40')][_0xe692('0x69')])[_0xe692('0x1d')](function(){if(_[_0xe692('0xaf')](_0xed2dcd[_0xe692('0x40')][_0xe692('0x69')])){for(var _0x5170a9=0x0;_0x5170a9<_0xed2dcd[_0xe692('0x40')][_0xe692('0x69')][_0xe692('0x46')];_0x5170a9+=0x1){socket[_0xe692('0xac')](_0xe692('0xb0'),{'UserId':Number(_0xed2dcd['query'][_0xe692('0x69')][_0x5170a9]),'OpenchannelAccountId':Number(_0xed2dcd['params']['id'])});}}else{socket[_0xe692('0xac')](_0xe692('0xb0'),{'UserId':Number(_0xed2dcd[_0xe692('0x40')][_0xe692('0x69')]),'OpenchannelAccountId':Number(_0xed2dcd[_0xe692('0x57')]['id'])});}});}})[_0xe692('0x1d')](respondWithStatusCode(_0x16cdb5,null))[_0xe692('0x28')](handleError(_0x16cdb5,null));};exports[_0xe692('0xb1')]=function(_0xd11039,_0x3d6ca5,_0x593d25){var _0x3d556e={};var _0x3c46c8={};var _0x2e464c;var _0x32c850;return db['OpenchannelAccount'][_0xe692('0x65')]({'where':{'id':_0xd11039[_0xe692('0x57')]['id']}})['then'](handleEntityNotFound(_0x3d6ca5,null))['then'](function(_0x9267d){if(_0x9267d){_0x2e464c=_0x9267d;_0x3c46c8['model']=_[_0xe692('0x41')](db[_0xe692('0x9c')][_0xe692('0x58')]);_0x3c46c8[_0xe692('0x40')]=_[_0xe692('0x41')](_0xd11039['query']);_0x3c46c8[_0xe692('0x42')]=_[_0xe692('0x44')](_0x3c46c8[_0xe692('0x3e')],_0x3c46c8['query']);_0x3d556e[_0xe692('0x43')]=_[_0xe692('0x44')](_0x3c46c8[_0xe692('0x3e')],qs[_0xe692('0x45')](_0xd11039[_0xe692('0x40')][_0xe692('0x45')]));_0x3d556e[_0xe692('0x43')]=_0x3d556e['attributes'][_0xe692('0x46')]?_0x3d556e[_0xe692('0x43')]:_0x3c46c8[_0xe692('0x3e')];_0x3d556e[_0xe692('0x49')]=qs[_0xe692('0x4a')](_0xd11039[_0xe692('0x40')][_0xe692('0x4a')]);_0x3d556e[_0xe692('0x4b')]=qs[_0xe692('0x42')](_[_0xe692('0x4c')](_0xd11039['query'],_0x3c46c8[_0xe692('0x42')]));if(_0xd11039[_0xe692('0x40')][_0xe692('0x4d')]){_0x3d556e[_0xe692('0x4b')]=_['merge'](_0x3d556e['where'],{'$or':_[_0xe692('0x3f')](_0x3d556e[_0xe692('0x43')],function(_0x10945b){var _0x1fba46={};_0x1fba46[_0x10945b]={'$like':'%'+_0xd11039[_0xe692('0x40')][_0xe692('0x4d')]+'%'};return _0x1fba46;})});}_0x3d556e=_[_0xe692('0x4f')]({},_0x3d556e,_0xd11039[_0xe692('0x50')]);return _0x2e464c[_0xe692('0xb1')](_0x3d556e);}})[_0xe692('0x1d')](function(_0x524441){if(_0x524441){_0x32c850=_0x524441['length'];if(!_0xd11039[_0xe692('0x40')][_0xe692('0x47')](_0xe692('0x48'))){_0x3d556e[_0xe692('0x2d')]=qs[_0xe692('0x2d')](_0xd11039[_0xe692('0x40')][_0xe692('0x2d')]);_0x3d556e[_0xe692('0x2f')]=qs[_0xe692('0x2f')](_0xd11039[_0xe692('0x40')]['offset']);}return _0x2e464c[_0xe692('0xb1')](_0x3d556e);}})['then'](function(_0x1b464d){if(_0x1b464d){return _0x1b464d?{'count':_0x32c850,'rows':_0x1b464d}:null;}})[_0xe692('0x1d')](respondWithResult(_0x3d6ca5,null))[_0xe692('0x28')](handleError(_0x3d6ca5,null));};exports[_0xe692('0xb2')]=function(_0x4aac7c,_0x5747dc,_0x425c72){var _0x5ce9bc,_0x26ac46,_0x533676;if(_['isNil'](_0x4aac7c[_0xe692('0x5b')][_0xe692('0x5b')])||_0x4aac7c[_0xe692('0x5b')][_0xe692('0x5b')]===''){throw new db[(_0xe692('0x76'))][(_0xe692('0x70'))](_0xe692('0x79'));}if(_[_0xe692('0x78')](_0x4aac7c[_0xe692('0x5b')]['to'])){}_0x5ce9bc=_0x4aac7c[_0xe692('0x5b')]['to'];return db['OpenchannelAccount'][_0xe692('0x65')]({'where':{'id':_0x4aac7c[_0xe692('0x57')]['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x5747dc,null))['then'](function(_0x4e8810){if(_0x4e8810){return db['OpenchannelAccount'][_0xe692('0x59')]({'where':{'id':_0x4e8810['id']},'include':[{'model':db[_0xe692('0x7f')],'as':'List','include':[{'model':db[_0xe692('0x6f')],'as':_0xe692('0x81'),'where':{[_0x4e8810[_0xe692('0x7a')]]:_0x5ce9bc},'limit':0x1,'order':[[_0xe692('0x74'),_0xe692('0x82')]]}]}]})[_0xe692('0x1d')](handleEntityNotFound(_0x5747dc,null))['then'](function(_0x5802f8){if(_0x5802f8&&_0x5802f8[_0xe692('0x80')]){_0x26ac46=_0x5802f8['get']({'plain':!![]});if(_0x26ac46[_0xe692('0x80')]&&_0x26ac46['List']['Contacts']['length']){return _0x26ac46['List'][_0xe692('0x81')][0x0];}return db[_0xe692('0x6f')][_0xe692('0x5a')](_['defaults'](_0x4aac7c[_0xe692('0x5b')],{'firstName':_0x5ce9bc,[_0x5802f8[_0xe692('0x7a')]]:_0x5ce9bc,'phone':_0x5ce9bc,'ListId':_0x26ac46[_0xe692('0x8b')]}));}})['then'](handleEntityNotFound(_0x5747dc,null))['then'](function(_0x4ef5f3){if(_0x4ef5f3){_0x533676=_0x4ef5f3;return db[_0xe692('0x90')]['find']({'where':{'ContactId':_0x533676['id'],'closed':![],'OpenchannelAccountId':_0x26ac46['id']}})[_0xe692('0x1d')](function(_0x10f91c){if(_0x10f91c){return[_0x10f91c,![]];}return db['OpenchannelInteraction'][_0xe692('0x5a')]({'UserId':_0x4aac7c[_0xe692('0x5c')]['id'],'ContactId':_0x533676['id'],'OpenchannelAccountId':_0x26ac46['id'],'lastMsgDirection':_0xe692('0xb3'),'Messages':[_['merge'](_0x4aac7c['body'],{'read':![],'body':_0x4aac7c[_0xe692('0x5b')][_0xe692('0x5b')],'OpenchannelAccountId':_0x26ac46['id'],'UserId':_0x4aac7c['user']['id'],'ContactId':_0x533676['id']})]},{'include':[{'model':db[_0xe692('0xb4')],'as':_0xe692('0xb5')}]})[_0xe692('0x1d')](function(_0xc78f6f){return[_0xc78f6f,!![]];});});}})[_0xe692('0x93')](function(_0x4c33ed,_0x215b37){if(_0x215b37){return _0x4c33ed;}return db[_0xe692('0xb4')][_0xe692('0x5a')](_[_0xe692('0x4f')](_0x4aac7c['body'],{'read':![],'body':_0x4aac7c[_0xe692('0x5b')]['body'],'OpenchannelAccountId':_0x26ac46['id'],'OpenchannelInteractionId':_0x4c33ed['id'],'UserId':_0x4aac7c[_0xe692('0x5c')]['id'],'ContactId':_0x533676['id']}))['then'](function(_0xc9eede){_0x4c33ed[_0xe692('0xb6')][_0xe692('0xb5')]=[];_0x4c33ed['dataValues']['Messages']['push'](_0xc9eede[_0xe692('0xb6')]);return _0x4c33ed;});});}})['then'](respondWithResult(_0x5747dc,null))['catch'](handleError(_0x5747dc,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index d726060..36e7a91 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 _0xaeaf=['../../mysqldb','OpenchannelAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xd09c6b,_0x2a3b1a){var _0x46a69b=function(_0x2bbf74){while(--_0x2bbf74){_0xd09c6b['push'](_0xd09c6b['shift']());}};_0x46a69b(++_0x2a3b1a);}(_0xaeaf,0x153));var _0xfaea=function(_0x1e8f35,_0x3db390){_0x1e8f35=_0x1e8f35-0x0;var _0x446c13=_0xaeaf[_0x1e8f35];return _0x446c13;};'use strict';var EventEmitter=require(_0xfaea('0x0'));var OpenchannelAccount=require(_0xfaea('0x1'))['db'][_0xfaea('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfaea('0x3'),'afterUpdate':_0xfaea('0x4'),'afterDestroy':_0xfaea('0x5')};function emitEvent(_0x6a3b70){return function(_0x26d147,_0x391a47,_0x517843){OpenchannelAccountEvents[_0xfaea('0x6')](_0x6a3b70+':'+_0x26d147['id'],_0x26d147);OpenchannelAccountEvents[_0xfaea('0x6')](_0x6a3b70,_0x26d147);_0x517843(null);};}for(var e in events){if(events[_0xfaea('0x7')](e)){var event=events[e];OpenchannelAccount[_0xfaea('0x8')](e,emitEvent(event));}}module[_0xfaea('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x3094=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x21093d,_0x3d86b7){var _0xd6eb70=function(_0x48a380){while(--_0x48a380){_0x21093d['push'](_0x21093d['shift']());}};_0xd6eb70(++_0x3d86b7);}(_0x3094,0x10e));var _0x4309=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3094[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x4309('0x0'));var OpenchannelAccount=require(_0x4309('0x1'))['db'][_0x4309('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x4309('0x3')](0x0);var events={'afterCreate':_0x4309('0x4'),'afterUpdate':'update','afterDestroy':_0x4309('0x5')};function emitEvent(_0x593b3c){return function(_0x154398,_0x591d8a,_0x40fcc3){OpenchannelAccountEvents[_0x4309('0x6')](_0x593b3c+':'+_0x154398['id'],_0x154398);OpenchannelAccountEvents['emit'](_0x593b3c,_0x154398);_0x40fcc3(null);};}for(var e in events){if(events[_0x4309('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x4309('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 099d715..405e276 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 _0x6760=['moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util'];(function(_0x11f926,_0x26af58){var _0x355bf6=function(_0x2c2267){while(--_0x2c2267){_0x11f926['push'](_0x11f926['shift']());}};_0x355bf6(++_0x26af58);}(_0x6760,0x98));var _0x0676=function(_0x19bb4c,_0x1380c5){_0x19bb4c=_0x19bb4c-0x0;var _0x6bc86b=_0x6760[_0x19bb4c];return _0x6bc86b;};'use strict';var _=require(_0x0676('0x0'));var util=require(_0x0676('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0676('0x2'));var BPromise=require('bluebird');var rp=require(_0x0676('0x3'));var fs=require('fs');var path=require(_0x0676('0x4'));var rimraf=require(_0x0676('0x5'));var config=require(_0x0676('0x6'));var attributes=require('./openchannelAccount.attributes');module[_0x0676('0x7')]=function(_0x372255,_0x494f7b){return _0x372255[_0x0676('0x8')](_0x0676('0x9'),attributes,{'tableName':_0x0676('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81c1=['rimraf','../../config/environment','exports','define','openchannel_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x81c1,0xb9));var _0x181c=function(_0x5edc41,_0x127a1a){_0x5edc41=_0x5edc41-0x0;var _0x3bb9f8=_0x81c1[_0x5edc41];return _0x3bb9f8;};'use strict';var _=require('lodash');var util=require(_0x181c('0x0'));var logger=require(_0x181c('0x1'))(_0x181c('0x2'));var moment=require(_0x181c('0x3'));var BPromise=require(_0x181c('0x4'));var rp=require(_0x181c('0x5'));var fs=require('fs');var path=require(_0x181c('0x6'));var rimraf=require(_0x181c('0x7'));var config=require(_0x181c('0x8'));var attributes=require('./openchannelAccount.attributes');module[_0x181c('0x9')]=function(_0x36e52b,_0x13ab11){return _0x36e52b[_0x181c('0xa')]('OpenchannelAccount',attributes,{'tableName':_0x181c('0xb'),'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 978d50b..48acc2c 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 _0x2c70=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelAccount.socket','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5bbe4f,_0x57f4af){var _0x558711=function(_0x19bf57){while(--_0x19bf57){_0x5bbe4f['push'](_0x5bbe4f['shift']());}};_0x558711(++_0x57f4af);}(_0x2c70,0x87));var _0x02c7=function(_0x3dfe4b,_0x2bcfa9){_0x3dfe4b=_0x3dfe4b-0x0;var _0x579aff=_0x2c70[_0x3dfe4b];return _0x579aff;};'use strict';var _=require(_0x02c7('0x0'));var util=require(_0x02c7('0x1'));var moment=require(_0x02c7('0x2'));var BPromise=require(_0x02c7('0x3'));var rs=require(_0x02c7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02c7('0x5'))['db'];var utils=require(_0x02c7('0x6'));var logger=require(_0x02c7('0x7'))('rpc');var config=require(_0x02c7('0x8'));var jayson=require(_0x02c7('0x9'));var client=jayson[_0x02c7('0xa')][_0x02c7('0xb')]({'port':0x232a});config[_0x02c7('0xc')]=_[_0x02c7('0xd')](config[_0x02c7('0xc')],{'host':_0x02c7('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02c7('0xc')]));require(_0x02c7('0xf'))['register'](socket);function respondWithRpcPromise(_0x5b33b3,_0x571b37,_0x1d4acf){return new BPromise(function(_0x5117af,_0x239577){return client[_0x02c7('0x10')](_0x5b33b3,_0x1d4acf)['then'](function(_0x3c754e){logger[_0x02c7('0x11')](_0x02c7('0x12'),_0x571b37,_0x02c7('0x13'));logger[_0x02c7('0x14')](_0x02c7('0x15'),_0x571b37,_0x02c7('0x13'),JSON[_0x02c7('0x16')](_0x3c754e));if(_0x3c754e[_0x02c7('0x17')]){if(_0x3c754e[_0x02c7('0x17')][_0x02c7('0x18')]===0x1f4){logger[_0x02c7('0x17')](_0x02c7('0x12'),_0x571b37,_0x3c754e[_0x02c7('0x17')][_0x02c7('0x19')]);return _0x239577(_0x3c754e[_0x02c7('0x17')]['message']);}logger[_0x02c7('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x571b37,_0x3c754e[_0x02c7('0x17')]['message']);return _0x5117af(_0x3c754e['error'][_0x02c7('0x19')]);}else{logger[_0x02c7('0x11')](_0x02c7('0x12'),_0x571b37,'request\x20sent');_0x5117af(_0x3c754e[_0x02c7('0x1a')][_0x02c7('0x19')]);}})[_0x02c7('0x1b')](function(_0x102dfc){logger[_0x02c7('0x17')](_0x02c7('0x12'),_0x571b37,_0x102dfc);_0x239577(_0x102dfc);});});} \ No newline at end of file +var _0x7e2f=['http','defaults','localhost','redis','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1f7792,_0x298a54){var _0xa5a6cb=function(_0x379846){while(--_0x379846){_0x1f7792['push'](_0x1f7792['shift']());}};_0xa5a6cb(++_0x298a54);}(_0x7e2f,0x187));var _0xf7e2=function(_0x2c16ab,_0xaa3f47){_0x2c16ab=_0x2c16ab-0x0;var _0x50d50c=_0x7e2f[_0x2c16ab];return _0x50d50c;};'use strict';var _=require('lodash');var util=require(_0xf7e2('0x0'));var moment=require(_0xf7e2('0x1'));var BPromise=require(_0xf7e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7e2('0x3'));var db=require(_0xf7e2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7e2('0x5'))(_0xf7e2('0x6'));var config=require(_0xf7e2('0x7'));var jayson=require(_0xf7e2('0x8'));var client=jayson['client'][_0xf7e2('0x9')]({'port':0x232a});config['redis']=_[_0xf7e2('0xa')](config['redis'],{'host':_0xf7e2('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf7e2('0xc')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x4dd4f7,_0x4969b3,_0x391cb1){return new BPromise(function(_0x4819a7,_0x551ad7){return client[_0xf7e2('0xd')](_0x4dd4f7,_0x391cb1)[_0xf7e2('0xe')](function(_0xdedeb3){logger[_0xf7e2('0xf')](_0xf7e2('0x10'),_0x4969b3,_0xf7e2('0x11'));logger[_0xf7e2('0x12')](_0xf7e2('0x13'),_0x4969b3,_0xf7e2('0x11'),JSON[_0xf7e2('0x14')](_0xdedeb3));if(_0xdedeb3[_0xf7e2('0x15')]){if(_0xdedeb3[_0xf7e2('0x15')][_0xf7e2('0x16')]===0x1f4){logger[_0xf7e2('0x15')](_0xf7e2('0x10'),_0x4969b3,_0xdedeb3[_0xf7e2('0x15')][_0xf7e2('0x17')]);return _0x551ad7(_0xdedeb3['error'][_0xf7e2('0x17')]);}logger[_0xf7e2('0x15')](_0xf7e2('0x10'),_0x4969b3,_0xdedeb3[_0xf7e2('0x15')][_0xf7e2('0x17')]);return _0x4819a7(_0xdedeb3['error'][_0xf7e2('0x17')]);}else{logger[_0xf7e2('0xf')](_0xf7e2('0x10'),_0x4969b3,_0xf7e2('0x11'));_0x4819a7(_0xdedeb3['result'][_0xf7e2('0x17')]);}})[_0xf7e2('0x18')](function(_0x346417){logger[_0xf7e2('0x15')](_0xf7e2('0x10'),_0x4969b3,_0x346417);_0x551ad7(_0x346417);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 6dc8ee7..58d2025 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 _0x68f0=['register','length','openchannelAccount:','remove','update','removeListener'];(function(_0x3ab3a4,_0x3a015f){var _0x9c1628=function(_0x5a73f9){while(--_0x5a73f9){_0x3ab3a4['push'](_0x3ab3a4['shift']());}};_0x9c1628(++_0x3a015f);}(_0x68f0,0x17d));var _0x068f=function(_0x38b634,_0x4948a4){_0x38b634=_0x38b634-0x0;var _0x3b43dc=_0x68f0[_0x38b634];return _0x3b43dc;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x068f('0x0'),_0x068f('0x1')];function createListener(_0x3fd990,_0x14588a){return function(_0x2b1c91){_0x14588a['emit'](_0x3fd990,_0x2b1c91);};}function removeListener(_0x284c8a,_0x34de6c){return function(){OpenchannelAccountEvents[_0x068f('0x2')](_0x284c8a,_0x34de6c);};}exports[_0x068f('0x3')]=function(_0x244bb){for(var _0x3581d6=0x0,_0xfc3439=events[_0x068f('0x4')];_0x3581d6<_0xfc3439;_0x3581d6++){var _0x3075c8=events[_0x3581d6];var _0x1a916b=createListener(_0x068f('0x5')+_0x3075c8,_0x244bb);OpenchannelAccountEvents['on'](_0x3075c8,_0x1a916b);}}; \ No newline at end of file +var _0x78a9=['save','remove','emit','removeListener','./openchannelAccount.events'];(function(_0x254de6,_0x35160a){var _0xba633f=function(_0x292e26){while(--_0x292e26){_0x254de6['push'](_0x254de6['shift']());}};_0xba633f(++_0x35160a);}(_0x78a9,0xa9));var _0x978a=function(_0x10ee82,_0x23ea9d){_0x10ee82=_0x10ee82-0x0;var _0x7a4fa3=_0x78a9[_0x10ee82];return _0x7a4fa3;};'use strict';var OpenchannelAccountEvents=require(_0x978a('0x0'));var events=[_0x978a('0x1'),_0x978a('0x2'),'update'];function createListener(_0x372ec6,_0x125570){return function(_0x21a1e8){_0x125570[_0x978a('0x3')](_0x372ec6,_0x21a1e8);};}function removeListener(_0x1a559c,_0x3e767f){return function(){OpenchannelAccountEvents[_0x978a('0x4')](_0x1a559c,_0x3e767f);};}exports['register']=function(_0x452884){for(var _0x21863b=0x0,_0x32e946=events['length'];_0x21863b<_0x32e946;_0x21863b++){var _0x119f85=events[_0x21863b];var _0x24f9fc=createListener('openchannelAccount:'+_0x119f85,_0x452884);OpenchannelAccountEvents['on'](_0x119f85,_0x24f9fc);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 42f1c1d..f343ebe 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 _0xadab=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','multer','util'];(function(_0x3db23e,_0x5b21f0){var _0x5b24b2=function(_0x191991){while(--_0x191991){_0x3db23e['push'](_0x3db23e['shift']());}};_0x5b24b2(++_0x5b21f0);}(_0xadab,0x1e2));var _0xbada=function(_0x28ab1a,_0x41638e){_0x28ab1a=_0x28ab1a-0x0;var _0x2db742=_0xadab[_0x28ab1a];return _0x2db742;};'use strict';var multer=require(_0xbada('0x0'));var util=require(_0xbada('0x1'));var path=require(_0xbada('0x2'));var timeout=require(_0xbada('0x3'));var express=require(_0xbada('0x4'));var router=express[_0xbada('0x5')]();var fs_extra=require(_0xbada('0x6'));var auth=require(_0xbada('0x7'));var interaction=require(_0xbada('0x8'));var config=require(_0xbada('0x9'));var controller=require(_0xbada('0xa'));router[_0xbada('0xb')]('/',auth[_0xbada('0xc')](),controller[_0xbada('0xd')]);router['get']('/:id',auth[_0xbada('0xc')](),controller[_0xbada('0xe')]);router[_0xbada('0xf')]('/',auth[_0xbada('0xc')](),controller[_0xbada('0x10')]);router['put'](_0xbada('0x11'),auth['isAuthenticated'](),controller[_0xbada('0x12')]);router[_0xbada('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xbada('0x14')]);module[_0xbada('0x15')]=router; \ No newline at end of file +var _0x2d45=['/:id','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','index','post','isAuthenticated','put'];(function(_0x48ff9b,_0x516bca){var _0x216ae5=function(_0x9eb482){while(--_0x9eb482){_0x48ff9b['push'](_0x48ff9b['shift']());}};_0x216ae5(++_0x516bca);}(_0x2d45,0xb8));var _0x52d4=function(_0xe9ea64,_0x3b2a2b){_0xe9ea64=_0xe9ea64-0x0;var _0x53c70e=_0x2d45[_0xe9ea64];return _0x53c70e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x52d4('0x0'));var timeout=require(_0x52d4('0x1'));var express=require(_0x52d4('0x2'));var router=express[_0x52d4('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x52d4('0x4'));var config=require(_0x52d4('0x5'));var controller=require(_0x52d4('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x52d4('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x52d4('0x8')]('/',auth[_0x52d4('0x9')](),controller['create']);router[_0x52d4('0xa')](_0x52d4('0xb'),auth[_0x52d4('0x9')](),controller['update']);router['delete'](_0x52d4('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x52d4('0xc')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index ca0846f..b6ebb3d 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 _0xfb1b=['STRING','TEXT','sequelize','exports'];(function(_0xcca6e4,_0x250b8d){var _0x13ef13=function(_0x2ad989){while(--_0x2ad989){_0xcca6e4['push'](_0xcca6e4['shift']());}};_0x13ef13(++_0x250b8d);}(_0xfb1b,0x6a));var _0xbfb1=function(_0x5adbfe,_0x420fed){_0x5adbfe=_0x5adbfe-0x0;var _0x4ad6d0=_0xfb1b[_0x5adbfe];return _0x4ad6d0;};'use strict';var Sequelize=require(_0xbfb1('0x0'));module[_0xbfb1('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xbfb1('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbfb1('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x12bd=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x162048,_0x411f1b){var _0x2339bf=function(_0x4101a2){while(--_0x4101a2){_0x162048['push'](_0x162048['shift']());}};_0x2339bf(++_0x411f1b);}(_0x12bd,0x19f));var _0xd12b=function(_0xc471d2,_0x26ab16){_0xc471d2=_0xc471d2-0x0;var _0x334c68=_0x12bd[_0xc471d2];return _0x334c68;};'use strict';var Sequelize=require(_0xd12b('0x0'));module[_0xd12b('0x1')]={'priority':{'type':Sequelize[_0xd12b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd12b('0x3')],'allowNull':![],'defaultValue':_0xd12b('0x4')},'appdata':{'type':Sequelize[_0xd12b('0x5')]()},'description':{'type':Sequelize[_0xd12b('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd12b('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 05cc628..e907465 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 _0xb082=['../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','stack','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','OpenchannelApplication','includeAll','include','findAll','catch','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x4b784d,_0x5efb2f){var _0x2cdeaf=function(_0x106242){while(--_0x106242){_0x4b784d['push'](_0x4b784d['shift']());}};_0x2cdeaf(++_0x5efb2f);}(_0xb082,0x1b5));var _0x2b08=function(_0x2f8a69,_0x39cf08){_0x2f8a69=_0x2f8a69-0x0;var _0x21c719=_0xb082[_0x2f8a69];return _0x21c719;};'use strict';var emlformat=require(_0x2b08('0x0'));var rimraf=require(_0x2b08('0x1'));var zipdir=require(_0x2b08('0x2'));var jsonpatch=require(_0x2b08('0x3'));var rp=require(_0x2b08('0x4'));var moment=require(_0x2b08('0x5'));var BPromise=require(_0x2b08('0x6'));var Mustache=require(_0x2b08('0x7'));var util=require(_0x2b08('0x8'));var path=require(_0x2b08('0x9'));var sox=require(_0x2b08('0xa'));var csv=require(_0x2b08('0xb'));var ejs=require(_0x2b08('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b08('0xd'));var squel=require(_0x2b08('0xe'));var crypto=require('crypto');var jsforce=require(_0x2b08('0xf'));var deskjs=require(_0x2b08('0x10'));var toCsv=require(_0x2b08('0xb'));var querystring=require(_0x2b08('0x11'));var Papa=require(_0x2b08('0x12'));var Redis=require(_0x2b08('0x13'));var authService=require(_0x2b08('0x14'));var qs=require(_0x2b08('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b08('0x16'))(_0x2b08('0x17'));var utils=require(_0x2b08('0x18'));var config=require(_0x2b08('0x19'));var licenseUtil=require(_0x2b08('0x1a'));var db=require(_0x2b08('0x1b'))['db'];function respondWithStatusCode(_0x8760e0,_0xa19bc0){_0xa19bc0=_0xa19bc0||0xcc;return function(_0x49a322){if(_0x49a322){return _0x8760e0['sendStatus'](_0xa19bc0);}return _0x8760e0['status'](_0xa19bc0)[_0x2b08('0x1c')]();};}function respondWithResult(_0x7117a5,_0xd10156){_0xd10156=_0xd10156||0xc8;return function(_0x5b900f){if(_0x5b900f){return _0x7117a5[_0x2b08('0x1d')](_0xd10156)[_0x2b08('0x1e')](_0x5b900f);}};}function respondWithFilteredResult(_0x1b732f,_0x302bbf){return function(_0x47202d){if(_0x47202d){var _0x42952b=typeof _0x302bbf[_0x2b08('0x1f')]===_0x2b08('0x20')&&typeof _0x302bbf[_0x2b08('0x21')]===_0x2b08('0x20');var _0x2bcd4e=_0x47202d[_0x2b08('0x22')];var _0x1f4c6d=_0x42952b?0x0:_0x302bbf[_0x2b08('0x1f')];var _0x9a0a29=_0x42952b?_0x47202d['count']:_0x302bbf['offset']+_0x302bbf[_0x2b08('0x21')];var _0x36bf4b;if(_0x9a0a29>=_0x2bcd4e){_0x9a0a29=_0x2bcd4e;_0x36bf4b=0xc8;}else{_0x36bf4b=0xce;}_0x1b732f[_0x2b08('0x1d')](_0x36bf4b);return _0x1b732f[_0x2b08('0x23')](_0x2b08('0x24'),_0x1f4c6d+'-'+_0x9a0a29+'/'+_0x2bcd4e)[_0x2b08('0x1e')](_0x47202d);}return null;};}function patchUpdates(_0x7512b){return function(_0x4eb282){try{jsonpatch['apply'](_0x4eb282,_0x7512b,!![]);}catch(_0x276fc4){return BPromise[_0x2b08('0x25')](_0x276fc4);}return _0x4eb282[_0x2b08('0x26')]();};}function saveUpdates(_0x160f39,_0x2545cb){return function(_0x117178){if(_0x117178){return _0x117178['update'](_0x160f39)[_0x2b08('0x27')](function(_0x303212){return _0x303212;});}return null;};}function removeEntity(_0x3fb4c7,_0x55e524){return function(_0x35fcda){if(_0x35fcda){return _0x35fcda[_0x2b08('0x28')]()['then'](function(){_0x3fb4c7[_0x2b08('0x1d')](0xcc)[_0x2b08('0x1c')]();});}};}function handleEntityNotFound(_0x42e806,_0xcc4a59){return function(_0x43d06d){if(!_0x43d06d){_0x42e806[_0x2b08('0x29')](0x194);}return _0x43d06d;};}function handleError(_0x180471,_0x377208){_0x377208=_0x377208||0x1f4;return function(_0x1e73f0){logger['error'](_0x1e73f0[_0x2b08('0x2a')]);if(_0x1e73f0[_0x2b08('0x2b')]){delete _0x1e73f0[_0x2b08('0x2b')];}_0x180471[_0x2b08('0x1d')](_0x377208)[_0x2b08('0x2c')](_0x1e73f0);};}exports[_0x2b08('0x2d')]=function(_0x3b2656,_0x391a00){var _0x2518e3={},_0x337827={},_0x27c23c={'count':0x0,'rows':[]};var _0x2e8012=_[_0x2b08('0x2e')](db['OpenchannelApplication']['rawAttributes'],function(_0x2340ac){return{'name':_0x2340ac[_0x2b08('0x2f')],'type':_0x2340ac['type'][_0x2b08('0x30')]};});_0x337827[_0x2b08('0x31')]=_[_0x2b08('0x2e')](_0x2e8012,_0x2b08('0x2b'));_0x337827[_0x2b08('0x32')]=_['keys'](_0x3b2656[_0x2b08('0x32')]);_0x337827[_0x2b08('0x33')]=_[_0x2b08('0x34')](_0x337827['model'],_0x337827[_0x2b08('0x32')]);_0x2518e3[_0x2b08('0x35')]=_[_0x2b08('0x34')](_0x337827['model'],qs[_0x2b08('0x36')](_0x3b2656[_0x2b08('0x32')][_0x2b08('0x36')]));_0x2518e3[_0x2b08('0x35')]=_0x2518e3['attributes'][_0x2b08('0x37')]?_0x2518e3[_0x2b08('0x35')]:_0x337827['model'];if(!_0x3b2656[_0x2b08('0x32')][_0x2b08('0x38')](_0x2b08('0x39'))){_0x2518e3[_0x2b08('0x21')]=qs[_0x2b08('0x21')](_0x3b2656[_0x2b08('0x32')]['limit']);_0x2518e3[_0x2b08('0x1f')]=qs[_0x2b08('0x1f')](_0x3b2656[_0x2b08('0x32')][_0x2b08('0x1f')]);}_0x2518e3['order']=qs['sort'](_0x3b2656[_0x2b08('0x32')][_0x2b08('0x3a')]);_0x2518e3[_0x2b08('0x3b')]=qs[_0x2b08('0x33')](_[_0x2b08('0x3c')](_0x3b2656[_0x2b08('0x32')],_0x337827[_0x2b08('0x33')]),_0x2e8012);if(_0x3b2656[_0x2b08('0x32')][_0x2b08('0x3d')]){_0x2518e3[_0x2b08('0x3b')]=_[_0x2b08('0x3e')](_0x2518e3[_0x2b08('0x3b')],{'$or':_[_0x2b08('0x2e')](_0x2e8012,function(_0xe82288){if(_0xe82288[_0x2b08('0x3f')]!==_0x2b08('0x40')){var _0x30ea21={};_0x30ea21[_0xe82288['name']]={'$like':'%'+_0x3b2656[_0x2b08('0x32')]['filter']+'%'};return _0x30ea21;}})});}_0x2518e3=_[_0x2b08('0x3e')]({},_0x2518e3,_0x3b2656[_0x2b08('0x41')]);var _0x4ad85a={'where':_0x2518e3[_0x2b08('0x3b')]};return db[_0x2b08('0x42')][_0x2b08('0x22')](_0x4ad85a)['then'](function(_0x3f2fdb){_0x27c23c[_0x2b08('0x22')]=_0x3f2fdb;if(_0x3b2656[_0x2b08('0x32')][_0x2b08('0x43')]){_0x2518e3[_0x2b08('0x44')]=[{'all':!![]}];}return db[_0x2b08('0x42')][_0x2b08('0x45')](_0x2518e3);})[_0x2b08('0x27')](function(_0x4ee889){_0x27c23c['rows']=_0x4ee889;return _0x27c23c;})[_0x2b08('0x27')](respondWithFilteredResult(_0x391a00,_0x2518e3))[_0x2b08('0x46')](handleError(_0x391a00,null));};exports['show']=function(_0x51f894,_0x3c691b){var _0x100507={'raw':!![],'where':{'id':_0x51f894[_0x2b08('0x47')]['id']}},_0x52298f={};_0x52298f['model']=_[_0x2b08('0x48')](db[_0x2b08('0x42')]['rawAttributes']);_0x52298f[_0x2b08('0x32')]=_[_0x2b08('0x48')](_0x51f894[_0x2b08('0x32')]);_0x52298f[_0x2b08('0x33')]=_[_0x2b08('0x34')](_0x52298f[_0x2b08('0x31')],_0x52298f[_0x2b08('0x32')]);_0x100507[_0x2b08('0x35')]=_[_0x2b08('0x34')](_0x52298f['model'],qs[_0x2b08('0x36')](_0x51f894['query'][_0x2b08('0x36')]));_0x100507[_0x2b08('0x35')]=_0x100507['attributes']['length']?_0x100507['attributes']:_0x52298f['model'];if(_0x51f894['query'][_0x2b08('0x43')]){_0x100507[_0x2b08('0x44')]=[{'all':!![]}];}_0x100507=_[_0x2b08('0x3e')]({},_0x100507,_0x51f894[_0x2b08('0x41')]);return db[_0x2b08('0x42')][_0x2b08('0x49')](_0x100507)[_0x2b08('0x27')](handleEntityNotFound(_0x3c691b,null))['then'](respondWithResult(_0x3c691b,null))[_0x2b08('0x46')](handleError(_0x3c691b,null));};exports[_0x2b08('0x4a')]=function(_0x267299,_0x5e575f){return db[_0x2b08('0x42')]['create'](_0x267299[_0x2b08('0x4b')],{})['then'](respondWithResult(_0x5e575f,0xc9))[_0x2b08('0x46')](handleError(_0x5e575f,null));};exports[_0x2b08('0x4c')]=function(_0x371fd0,_0x5b0622){if(_0x371fd0[_0x2b08('0x4b')]['id']){delete _0x371fd0[_0x2b08('0x4b')]['id'];}return db[_0x2b08('0x42')][_0x2b08('0x49')]({'where':{'id':_0x371fd0['params']['id']}})[_0x2b08('0x27')](handleEntityNotFound(_0x5b0622,null))['then'](saveUpdates(_0x371fd0[_0x2b08('0x4b')],null))[_0x2b08('0x27')](respondWithResult(_0x5b0622,null))['catch'](handleError(_0x5b0622,null));};exports['destroy']=function(_0x1f74f7,_0x544e71){return db[_0x2b08('0x42')]['find']({'where':{'id':_0x1f74f7[_0x2b08('0x47')]['id']}})['then'](handleEntityNotFound(_0x544e71,null))['then'](removeEntity(_0x544e71,null))[_0x2b08('0x46')](handleError(_0x544e71,null));}; \ No newline at end of file +var _0xbd81=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4bea36,_0x5d946e){var _0x5f1bd5=function(_0x53f2ee){while(--_0x53f2ee){_0x4bea36['push'](_0x4bea36['shift']());}};_0x5f1bd5(++_0x5d946e);}(_0xbd81,0x123));var _0x1bd8=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xbd81[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0x1bd8('0x0'));var rimraf=require(_0x1bd8('0x1'));var zipdir=require(_0x1bd8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1bd8('0x3'));var moment=require(_0x1bd8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1bd8('0x5'));var util=require(_0x1bd8('0x6'));var path=require(_0x1bd8('0x7'));var sox=require(_0x1bd8('0x8'));var csv=require('to-csv');var ejs=require(_0x1bd8('0x9'));var fs=require('fs');var fs_extra=require(_0x1bd8('0xa'));var _=require(_0x1bd8('0xb'));var squel=require(_0x1bd8('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1bd8('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1bd8('0xe'));var Papa=require(_0x1bd8('0xf'));var Redis=require(_0x1bd8('0x10'));var authService=require(_0x1bd8('0x11'));var qs=require(_0x1bd8('0x12'));var as=require(_0x1bd8('0x13'));var hardwareService=require(_0x1bd8('0x14'));var logger=require(_0x1bd8('0x15'))(_0x1bd8('0x16'));var utils=require(_0x1bd8('0x17'));var config=require(_0x1bd8('0x18'));var licenseUtil=require(_0x1bd8('0x19'));var db=require(_0x1bd8('0x1a'))['db'];function respondWithStatusCode(_0x2d05f3,_0x518e97){_0x518e97=_0x518e97||0xcc;return function(_0x3c825){if(_0x3c825){return _0x2d05f3[_0x1bd8('0x1b')](_0x518e97);}return _0x2d05f3['status'](_0x518e97)['end']();};}function respondWithResult(_0x4a4c77,_0x3cb640){_0x3cb640=_0x3cb640||0xc8;return function(_0x2c0e08){if(_0x2c0e08){return _0x4a4c77[_0x1bd8('0x1c')](_0x3cb640)[_0x1bd8('0x1d')](_0x2c0e08);}};}function respondWithFilteredResult(_0x49f564,_0x5c4b2c){return function(_0x53bc3c){if(_0x53bc3c){var _0x4b0993=typeof _0x5c4b2c[_0x1bd8('0x1e')]==='undefined'&&typeof _0x5c4b2c[_0x1bd8('0x1f')]===_0x1bd8('0x20');var _0x49d963=_0x53bc3c[_0x1bd8('0x21')];var _0x4466b5=_0x4b0993?0x0:_0x5c4b2c['offset'];var _0x4eda38=_0x4b0993?_0x53bc3c[_0x1bd8('0x21')]:_0x5c4b2c['offset']+_0x5c4b2c['limit'];var _0xac0a34;if(_0x4eda38>=_0x49d963){_0x4eda38=_0x49d963;_0xac0a34=0xc8;}else{_0xac0a34=0xce;}_0x49f564['status'](_0xac0a34);return _0x49f564[_0x1bd8('0x22')](_0x1bd8('0x23'),_0x4466b5+'-'+_0x4eda38+'/'+_0x49d963)[_0x1bd8('0x1d')](_0x53bc3c);}return null;};}function patchUpdates(_0x1c27e8){return function(_0x1e03ec){try{jsonpatch[_0x1bd8('0x24')](_0x1e03ec,_0x1c27e8,!![]);}catch(_0x59d5ca){return BPromise[_0x1bd8('0x25')](_0x59d5ca);}return _0x1e03ec['save']();};}function saveUpdates(_0x4e53da,_0x117375){return function(_0x362e3b){if(_0x362e3b){return _0x362e3b[_0x1bd8('0x26')](_0x4e53da)[_0x1bd8('0x27')](function(_0x5a820d){return _0x5a820d;});}return null;};}function removeEntity(_0x16b3a2,_0x231a35){return function(_0x2d644e){if(_0x2d644e){return _0x2d644e[_0x1bd8('0x28')]()[_0x1bd8('0x27')](function(){_0x16b3a2['status'](0xcc)[_0x1bd8('0x29')]();});}};}function handleEntityNotFound(_0x3dd659,_0x3a18fc){return function(_0x2ea715){if(!_0x2ea715){_0x3dd659['sendStatus'](0x194);}return _0x2ea715;};}function handleError(_0x1f122b,_0x41942d){_0x41942d=_0x41942d||0x1f4;return function(_0x1a91a8){logger[_0x1bd8('0x2a')](_0x1a91a8[_0x1bd8('0x2b')]);if(_0x1a91a8[_0x1bd8('0x2c')]){delete _0x1a91a8[_0x1bd8('0x2c')];}_0x1f122b['status'](_0x41942d)[_0x1bd8('0x2d')](_0x1a91a8);};}exports[_0x1bd8('0x2e')]=function(_0x1b8569,_0x335937){var _0x5c87a1={},_0x549f6e={},_0x4c4b87={'count':0x0,'rows':[]};var _0x5a71e7=_['map'](db[_0x1bd8('0x2f')][_0x1bd8('0x30')],function(_0x297ac1){return{'name':_0x297ac1[_0x1bd8('0x31')],'type':_0x297ac1[_0x1bd8('0x32')][_0x1bd8('0x33')]};});_0x549f6e[_0x1bd8('0x34')]=_['map'](_0x5a71e7,_0x1bd8('0x2c'));_0x549f6e[_0x1bd8('0x35')]=_[_0x1bd8('0x36')](_0x1b8569[_0x1bd8('0x35')]);_0x549f6e[_0x1bd8('0x37')]=_[_0x1bd8('0x38')](_0x549f6e['model'],_0x549f6e['query']);_0x5c87a1[_0x1bd8('0x39')]=_[_0x1bd8('0x38')](_0x549f6e['model'],qs[_0x1bd8('0x3a')](_0x1b8569[_0x1bd8('0x35')]['fields']));_0x5c87a1[_0x1bd8('0x39')]=_0x5c87a1[_0x1bd8('0x39')][_0x1bd8('0x3b')]?_0x5c87a1[_0x1bd8('0x39')]:_0x549f6e[_0x1bd8('0x34')];if(!_0x1b8569[_0x1bd8('0x35')][_0x1bd8('0x3c')](_0x1bd8('0x3d'))){_0x5c87a1['limit']=qs[_0x1bd8('0x1f')](_0x1b8569[_0x1bd8('0x35')][_0x1bd8('0x1f')]);_0x5c87a1[_0x1bd8('0x1e')]=qs[_0x1bd8('0x1e')](_0x1b8569[_0x1bd8('0x35')][_0x1bd8('0x1e')]);}_0x5c87a1[_0x1bd8('0x3e')]=qs['sort'](_0x1b8569['query']['sort']);_0x5c87a1[_0x1bd8('0x3f')]=qs[_0x1bd8('0x37')](_[_0x1bd8('0x40')](_0x1b8569[_0x1bd8('0x35')],_0x549f6e['filters']),_0x5a71e7);if(_0x1b8569[_0x1bd8('0x35')]['filter']){_0x5c87a1[_0x1bd8('0x3f')]=_[_0x1bd8('0x41')](_0x5c87a1[_0x1bd8('0x3f')],{'$or':_['map'](_0x5a71e7,function(_0x3ce2c0){if(_0x3ce2c0[_0x1bd8('0x32')]!==_0x1bd8('0x42')){var _0x598c6c={};_0x598c6c[_0x3ce2c0['name']]={'$like':'%'+_0x1b8569[_0x1bd8('0x35')]['filter']+'%'};return _0x598c6c;}})});}_0x5c87a1=_[_0x1bd8('0x41')]({},_0x5c87a1,_0x1b8569[_0x1bd8('0x43')]);var _0x1280dc={'where':_0x5c87a1[_0x1bd8('0x3f')]};return db['OpenchannelApplication'][_0x1bd8('0x21')](_0x1280dc)[_0x1bd8('0x27')](function(_0x3de712){_0x4c4b87[_0x1bd8('0x21')]=_0x3de712;if(_0x1b8569['query'][_0x1bd8('0x44')]){_0x5c87a1[_0x1bd8('0x45')]=[{'all':!![]}];}return db[_0x1bd8('0x2f')][_0x1bd8('0x46')](_0x5c87a1);})[_0x1bd8('0x27')](function(_0xefc1b){_0x4c4b87[_0x1bd8('0x47')]=_0xefc1b;return _0x4c4b87;})[_0x1bd8('0x27')](respondWithFilteredResult(_0x335937,_0x5c87a1))['catch'](handleError(_0x335937,null));};exports[_0x1bd8('0x48')]=function(_0x57635a,_0x382271){var _0x16f3cd={'raw':!![],'where':{'id':_0x57635a[_0x1bd8('0x49')]['id']}},_0x31cf59={};_0x31cf59[_0x1bd8('0x34')]=_[_0x1bd8('0x36')](db[_0x1bd8('0x2f')][_0x1bd8('0x30')]);_0x31cf59['query']=_[_0x1bd8('0x36')](_0x57635a[_0x1bd8('0x35')]);_0x31cf59[_0x1bd8('0x37')]=_['intersection'](_0x31cf59[_0x1bd8('0x34')],_0x31cf59[_0x1bd8('0x35')]);_0x16f3cd[_0x1bd8('0x39')]=_[_0x1bd8('0x38')](_0x31cf59[_0x1bd8('0x34')],qs[_0x1bd8('0x3a')](_0x57635a[_0x1bd8('0x35')][_0x1bd8('0x3a')]));_0x16f3cd[_0x1bd8('0x39')]=_0x16f3cd[_0x1bd8('0x39')][_0x1bd8('0x3b')]?_0x16f3cd[_0x1bd8('0x39')]:_0x31cf59[_0x1bd8('0x34')];if(_0x57635a[_0x1bd8('0x35')][_0x1bd8('0x44')]){_0x16f3cd[_0x1bd8('0x45')]=[{'all':!![]}];}_0x16f3cd=_['merge']({},_0x16f3cd,_0x57635a[_0x1bd8('0x43')]);return db['OpenchannelApplication'][_0x1bd8('0x4a')](_0x16f3cd)[_0x1bd8('0x27')](handleEntityNotFound(_0x382271,null))[_0x1bd8('0x27')](respondWithResult(_0x382271,null))['catch'](handleError(_0x382271,null));};exports[_0x1bd8('0x4b')]=function(_0x3d10cd,_0x51f86e){return db[_0x1bd8('0x2f')]['create'](_0x3d10cd[_0x1bd8('0x4c')],{})[_0x1bd8('0x27')](respondWithResult(_0x51f86e,0xc9))[_0x1bd8('0x4d')](handleError(_0x51f86e,null));};exports[_0x1bd8('0x26')]=function(_0x1e1292,_0x581b93){if(_0x1e1292[_0x1bd8('0x4c')]['id']){delete _0x1e1292['body']['id'];}return db['OpenchannelApplication'][_0x1bd8('0x4a')]({'where':{'id':_0x1e1292[_0x1bd8('0x49')]['id']}})[_0x1bd8('0x27')](handleEntityNotFound(_0x581b93,null))[_0x1bd8('0x27')](saveUpdates(_0x1e1292[_0x1bd8('0x4c')],null))[_0x1bd8('0x27')](respondWithResult(_0x581b93,null))[_0x1bd8('0x4d')](handleError(_0x581b93,null));};exports[_0x1bd8('0x28')]=function(_0x4801c4,_0x241852){return db[_0x1bd8('0x2f')][_0x1bd8('0x4a')]({'where':{'id':_0x4801c4['params']['id']}})[_0x1bd8('0x27')](handleEntityNotFound(_0x241852,null))[_0x1bd8('0x27')](removeEntity(_0x241852,null))[_0x1bd8('0x4d')](handleError(_0x241852,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 984c3b7..36d1579 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 _0x2a4c=['exports','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes'];(function(_0x27c7fc,_0x57482b){var _0x5ef296=function(_0x105018){while(--_0x105018){_0x27c7fc['push'](_0x27c7fc['shift']());}};_0x5ef296(++_0x57482b);}(_0x2a4c,0x122));var _0xc2a4=function(_0x56d9d7,_0x41a050){_0x56d9d7=_0x56d9d7-0x0;var _0x1ff945=_0x2a4c[_0x56d9d7];return _0x1ff945;};'use strict';var _=require(_0xc2a4('0x0'));var util=require(_0xc2a4('0x1'));var logger=require(_0xc2a4('0x2'))(_0xc2a4('0x3'));var moment=require(_0xc2a4('0x4'));var BPromise=require(_0xc2a4('0x5'));var rp=require(_0xc2a4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc2a4('0x7'));var config=require(_0xc2a4('0x8'));var attributes=require(_0xc2a4('0x9'));module[_0xc2a4('0xa')]=function(_0xf39a3f,_0x22c3cf){return _0xf39a3f[_0xc2a4('0xb')]('OpenchannelApplication',attributes,{'tableName':_0xc2a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc2a4('0xd'),'collate':_0xc2a4('0xe')});}; \ No newline at end of file +var _0xc9eb=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications'];(function(_0x20b18f,_0xf29421){var _0x510ea8=function(_0x1b02f8){while(--_0x1b02f8){_0x20b18f['push'](_0x20b18f['shift']());}};_0x510ea8(++_0xf29421);}(_0xc9eb,0x1a6));var _0xbc9e=function(_0x44423d,_0x2e22f3){_0x44423d=_0x44423d-0x0;var _0x314791=_0xc9eb[_0x44423d];return _0x314791;};'use strict';var _=require(_0xbc9e('0x0'));var util=require('util');var logger=require(_0xbc9e('0x1'))(_0xbc9e('0x2'));var moment=require(_0xbc9e('0x3'));var BPromise=require(_0xbc9e('0x4'));var rp=require(_0xbc9e('0x5'));var fs=require('fs');var path=require(_0xbc9e('0x6'));var rimraf=require('rimraf');var config=require(_0xbc9e('0x7'));var attributes=require(_0xbc9e('0x8'));module[_0xbc9e('0x9')]=function(_0x30238b,_0x4799d2){return _0x30238b['define'](_0xbc9e('0xa'),attributes,{'tableName':_0xbc9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbc9e('0xc'),'collate':_0xbc9e('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index b9df7f6..d886046 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 _0xd8b0=['OpenchannelApplication','body','options','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x128bef,_0xc7a0af){var _0x1ba862=function(_0x4858e8){while(--_0x4858e8){_0x128bef['push'](_0x128bef['shift']());}};_0x1ba862(++_0xc7a0af);}(_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 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);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['update'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1b')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['attributes']||null:null,'limit':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['limit']||null:null})['then'](function(_0x238728){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON[_0x0d8b('0x10')](_0x238728));_0x18dd2d(_0x238728);})[_0x0d8b('0x15')](function(_0x4562cb){logger[_0x0d8b('0x11')]('UpdateOpenchannelApplication',_0x4562cb[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x4562cb['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(_0x5f26e0,_0x2fb8dd){var _0x70de5a=function(_0x16ed83){while(--_0x16ed83){_0x5f26e0['push'](_0x5f26e0['shift']());}};_0x70de5a(++_0x2fb8dd);}(_0xb10b,0x12a));var _0xbb10=function(_0x344e99,_0x530098){_0x344e99=_0x344e99-0x0;var _0x172d28=_0xb10b[_0x344e99];return _0x172d28;};'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 6b5cd98..b3e8ce1 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 _0xa9e0=['tracked','openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','show','/:id/messages','isAuthenticated','getMessages','create','post','addMessage','/:id/tags'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xf')]);router[_0x0a9e('0x10')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['post'](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0x13')](_0x0a9e('0x14'),_0x0a9e('0x15')),controller[_0x0a9e('0x16')]);router['put'](_0x0a9e('0x17'),auth['isAuthenticated'](),interaction[_0x0a9e('0x13')]('openchannel',_0x0a9e('0x18')),controller[_0x0a9e('0x19')]);router['delete'](_0x0a9e('0x17'),auth['isAuthenticated'](),interaction[_0x0a9e('0x13')](_0x0a9e('0x14'),_0x0a9e('0x1a')),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x1c')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);module[_0x0a9e('0x1e')]=router; \ No newline at end of file +var _0xa9e0=['tracked','openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','show','/:id/messages','isAuthenticated','getMessages','create','post','addMessage','/:id/tags'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xf')]);router[_0x0a9e('0x10')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['post'](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0x13')](_0x0a9e('0x14'),_0x0a9e('0x15')),controller[_0x0a9e('0x16')]);router['put'](_0x0a9e('0x17'),auth['isAuthenticated'](),interaction[_0x0a9e('0x13')]('openchannel',_0x0a9e('0x18')),controller[_0x0a9e('0x19')]);router['delete'](_0x0a9e('0x17'),auth['isAuthenticated'](),interaction[_0x0a9e('0x13')](_0x0a9e('0x14'),_0x0a9e('0x1a')),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x1c')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);module[_0x0a9e('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index f9dd508..079b727 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 _0x2b2d=['ENUM','out','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x5527b4,_0x4d9c93){var _0x2101da=function(_0x1b9067){while(--_0x1b9067){_0x5527b4['push'](_0x5527b4['shift']());}};_0x2101da(++_0x4d9c93);}(_0x2b2d,0x1ad));var _0xd2b2=function(_0x3b9bb7,_0x4e24df){_0x3b9bb7=_0x3b9bb7-0x0;var _0x4c0b9e=_0x2b2d[_0x3b9bb7];return _0x4c0b9e;};'use strict';var Sequelize=require(_0xd2b2('0x0'));module[_0xd2b2('0x1')]={'closed':{'type':Sequelize[_0xd2b2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd2b2('0x3')]},'secondDisposition':{'type':Sequelize[_0xd2b2('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd2b2('0x3')]},'note':{'type':Sequelize[_0xd2b2('0x3')]},'read1stAt':{'type':Sequelize[_0xd2b2('0x4')]},'threadId':{'type':Sequelize[_0xd2b2('0x3')]},'externalUrl':{'type':Sequelize[_0xd2b2('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xd2b2('0x5')]('in',_0xd2b2('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xd2b2('0x3')]}}; \ No newline at end of file +var _0x03bc=['exports','DATE','STRING','ENUM','sequelize'];(function(_0x30f0c5,_0x4d34e8){var _0x3b5e80=function(_0x5a5d30){while(--_0x5a5d30){_0x30f0c5['push'](_0x30f0c5['shift']());}};_0x3b5e80(++_0x4d34e8);}(_0x03bc,0x1a8));var _0xc03b=function(_0xf81547,_0x2be058){_0xf81547=_0xf81547-0x0;var _0x5fe859=_0x03bc[_0xf81547];return _0x5fe859;};'use strict';var Sequelize=require(_0xc03b('0x0'));module[_0xc03b('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc03b('0x2')]},'disposition':{'type':Sequelize[_0xc03b('0x3')]},'secondDisposition':{'type':Sequelize[_0xc03b('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc03b('0x3')]},'note':{'type':Sequelize[_0xc03b('0x3')]},'read1stAt':{'type':Sequelize[_0xc03b('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xc03b('0x3')]},'lastMsgAt':{'type':Sequelize[_0xc03b('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xc03b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc03b('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index ff81a03..6a9f6c3 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 _0xba10=['read','`unreadMessages`\x20=\x200','tag','isArray','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','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','rows','catch','show','params','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','format','addTags','setTags','spread','Tag','findAll','emit','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','User','CmContact','lastName','attachments','Attachment','Messages','direction','secret','OpenchannelAccount','Account','get','Openchannel','Owner','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','threadId','Public','Private','basename','createReadStream','pipe','createWriteStream','out','System','firstName','renderFile','downloadInteraction.html','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','end','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','Users','fullname','TagIds','Tags','split','forEach','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','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','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20=\x20?'];(function(_0x3998a7,_0x419600){var _0x447ae0=function(_0x72f283){while(--_0x72f283){_0x3998a7['push'](_0x3998a7['shift']());}};_0x447ae0(++_0x419600);}(_0xba10,0x70));var _0x0ba1=function(_0x10a556,_0x1997e5){_0x10a556=_0x10a556-0x0;var _0x4dea04=_0xba10[_0x10a556];return _0x4dea04;};'use strict';var emlformat=require(_0x0ba1('0x0'));var rimraf=require(_0x0ba1('0x1'));var zipdir=require(_0x0ba1('0x2'));var jsonpatch=require(_0x0ba1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0ba1('0x4'));var Mustache=require(_0x0ba1('0x5'));var util=require(_0x0ba1('0x6'));var path=require(_0x0ba1('0x7'));var sox=require(_0x0ba1('0x8'));var csv=require(_0x0ba1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ba1('0xa'));var _=require(_0x0ba1('0xb'));var squel=require(_0x0ba1('0xc'));var crypto=require(_0x0ba1('0xd'));var jsforce=require(_0x0ba1('0xe'));var deskjs=require(_0x0ba1('0xf'));var toCsv=require(_0x0ba1('0x9'));var querystring=require(_0x0ba1('0x10'));var Papa=require(_0x0ba1('0x11'));var Redis=require('ioredis');var authService=require(_0x0ba1('0x12'));var qs=require(_0x0ba1('0x13'));var as=require(_0x0ba1('0x14'));var pdf=require(_0x0ba1('0x15'));var hardwareService=require(_0x0ba1('0x16'));var logger=require('../../config/logger')(_0x0ba1('0x17'));var utils=require(_0x0ba1('0x18'));var config=require(_0x0ba1('0x19'));var licenseUtil=require(_0x0ba1('0x1a'));var db=require(_0x0ba1('0x1b'))['db'];config[_0x0ba1('0x1c')]=_['defaults'](config['redis'],{'host':_0x0ba1('0x1d'),'port':0x18eb});var socket=require(_0x0ba1('0x1e'))(new Redis(config[_0x0ba1('0x1c')]));require('./openchannelInteraction.socket')[_0x0ba1('0x1f')](socket);function respondWithStatusCode(_0x5f37d5,_0xce6ed1){_0xce6ed1=_0xce6ed1||0xcc;return function(_0x359cc8){if(_0x359cc8){return _0x5f37d5['sendStatus'](_0xce6ed1);}return _0x5f37d5['status'](_0xce6ed1)[_0x0ba1('0x20')]();};}function respondWithResult(_0x2e8f6f,_0x2ea0f8){_0x2ea0f8=_0x2ea0f8||0xc8;return function(_0x1c8a57){if(_0x1c8a57){return _0x2e8f6f['status'](_0x2ea0f8)['json'](_0x1c8a57);}};}function respondWithFilteredResult(_0x52c55e,_0x4917a5){return function(_0x352a14){if(_0x352a14){var _0x120b49=typeof _0x4917a5[_0x0ba1('0x21')]===_0x0ba1('0x22')&&typeof _0x4917a5['limit']===_0x0ba1('0x22');var _0x9cfafb=_0x352a14[_0x0ba1('0x23')];var _0x17e9b2=_0x120b49?0x0:_0x4917a5['offset'];var _0x131cc5=_0x120b49?_0x352a14['count']:_0x4917a5[_0x0ba1('0x21')]+_0x4917a5[_0x0ba1('0x24')];var _0x3111bd;if(_0x131cc5>=_0x9cfafb){_0x131cc5=_0x9cfafb;_0x3111bd=0xc8;}else{_0x3111bd=0xce;}_0x52c55e[_0x0ba1('0x25')](_0x3111bd);return _0x52c55e['set'](_0x0ba1('0x26'),_0x17e9b2+'-'+_0x131cc5+'/'+_0x9cfafb)['json'](_0x352a14);}return null;};}function patchUpdates(_0x2b49fa){return function(_0x2268f9){try{jsonpatch[_0x0ba1('0x27')](_0x2268f9,_0x2b49fa,!![]);}catch(_0x17fb1e){return BPromise[_0x0ba1('0x28')](_0x17fb1e);}return _0x2268f9[_0x0ba1('0x29')]();};}function saveUpdates(_0x501aac,_0x235bca){return function(_0x20484c){if(_0x20484c){return _0x20484c[_0x0ba1('0x2a')](_0x501aac)[_0x0ba1('0x2b')](function(_0x531c92){return _0x531c92;});}return null;};}function removeEntity(_0x48a90d,_0x57d1d6){return function(_0x37b719){if(_0x37b719){return _0x37b719[_0x0ba1('0x2c')]()[_0x0ba1('0x2b')](function(){_0x48a90d[_0x0ba1('0x25')](0xcc)[_0x0ba1('0x20')]();});}};}function handleEntityNotFound(_0x2f0317,_0x807740){return function(_0x137a42){if(!_0x137a42){_0x2f0317[_0x0ba1('0x2d')](0x194);}return _0x137a42;};}function handleError(_0x471c31,_0x1d65fa){_0x1d65fa=_0x1d65fa||0x1f4;return function(_0x50ecd7){logger[_0x0ba1('0x2e')](_0x50ecd7[_0x0ba1('0x2f')]);if(_0x50ecd7[_0x0ba1('0x30')]){delete _0x50ecd7[_0x0ba1('0x30')];}_0x471c31[_0x0ba1('0x25')](_0x1d65fa)['send'](_0x50ecd7);};}function getInteractionUsers(_0x3b6e38,_0xb8bacf){return new BPromise(function(_0x1ea577,_0x522c83){try{if(_0xb8bacf[_0x3b6e38['id']]){_0x3b6e38[_0x0ba1('0x31')]=_['map'](_0xb8bacf[_0x3b6e38['id']],function(_0xb349fe){return{'id':_0xb349fe['id'],'fullname':_0xb349fe[_0x0ba1('0x32')]};});}}catch(_0x49a657){_0x522c83(_0x49a657);}_0x1ea577(_0x3b6e38);});}function getInteractionTags(_0x2a09e5,_0x1a0513){return new BPromise(function(_0x17b9b5,_0x51655e){try{if(_0x2a09e5[_0x0ba1('0x33')]){_0x2a09e5[_0x0ba1('0x34')]=[];_0x2a09e5['TagIds'][_0x0ba1('0x35')](',')[_0x0ba1('0x36')](function(_0x3eeea8){_0x2a09e5[_0x0ba1('0x34')]['push'](_0x1a0513[_0x3eeea8]);});}delete _0x2a09e5[_0x0ba1('0x33')];}catch(_0x42ade9){_0x51655e(_0x42ade9);}_0x17b9b5(_0x2a09e5);});}function updateOpenchannelInteraction(_0x42276b,_0x336ea6,_0x3702e7){return new BPromise(function(_0x5d0fd1,_0x5be6d4){return getInteractionUsers(_0x42276b,_0x3702e7)[_0x0ba1('0x2b')](function(_0x5c8ca7){return getInteractionTags(_0x5c8ca7,_0x336ea6);})[_0x0ba1('0x2b')](function(_0x415291){_0x5d0fd1(_0x415291);})['catch'](function(_0x47b14b){_0x5be6d4(_0x47b14b);});});}exports['index']=function(_0x3a97bc,_0x1b11a7){var _0x43afad={},_0x23d940={},_0x2fc89d={'count':0x0,'rows':[]};var _0x51f43e=_[_0x0ba1('0x37')](db[_0x0ba1('0x38')][_0x0ba1('0x39')],function(_0x25b5f3){return{'name':_0x25b5f3[_0x0ba1('0x3a')],'type':_0x25b5f3[_0x0ba1('0x3b')][_0x0ba1('0x3c')]};});_0x23d940[_0x0ba1('0x3d')]=_[_0x0ba1('0x37')](_0x51f43e,_0x0ba1('0x30'));_0x23d940[_0x0ba1('0x3e')]=_['keys'](_0x3a97bc[_0x0ba1('0x3e')]);_0x23d940[_0x0ba1('0x3f')]=_[_0x0ba1('0x40')](_0x23d940[_0x0ba1('0x3d')],_0x23d940['query']);_0x43afad[_0x0ba1('0x41')]=_[_0x0ba1('0x40')](_0x23d940[_0x0ba1('0x3d')],qs[_0x0ba1('0x42')](_0x3a97bc['query'][_0x0ba1('0x42')]));_0x43afad[_0x0ba1('0x41')]=_0x43afad['attributes']['length']?_0x43afad[_0x0ba1('0x41')]:_0x23d940[_0x0ba1('0x3d')];if(!_0x3a97bc[_0x0ba1('0x3e')][_0x0ba1('0x43')](_0x0ba1('0x44'))){_0x43afad['limit']=qs['limit'](_0x3a97bc[_0x0ba1('0x3e')][_0x0ba1('0x24')]);_0x43afad[_0x0ba1('0x21')]=qs[_0x0ba1('0x21')](_0x3a97bc[_0x0ba1('0x3e')][_0x0ba1('0x21')]);}_0x43afad[_0x0ba1('0x45')]=qs[_0x0ba1('0x46')](_0x3a97bc[_0x0ba1('0x3e')][_0x0ba1('0x46')]);_0x43afad[_0x0ba1('0x47')]=qs[_0x0ba1('0x3f')](_[_0x0ba1('0x48')](_0x3a97bc[_0x0ba1('0x3e')],_0x23d940[_0x0ba1('0x3f')]),_0x51f43e);var _0x1e0640=[];var _0x583d94=squel[_0x0ba1('0x49')]()[_0x0ba1('0x4a')]('id')[_0x0ba1('0x4a')](_0x0ba1('0x30'))[_0x0ba1('0x4a')](_0x0ba1('0x4b'))['from']('tools_tags');var _0x213bb6=squel[_0x0ba1('0x49')]()[_0x0ba1('0x4a')](_0x0ba1('0x4c'))[_0x0ba1('0x4a')](_0x0ba1('0x4d'))[_0x0ba1('0x4a')](_0x0ba1('0x4e'))[_0x0ba1('0x4f')](_0x0ba1('0x50'),'ui')[_0x0ba1('0x51')]('users','u',_0x0ba1('0x52'));var _0xb36c11=squel[_0x0ba1('0x49')]()[_0x0ba1('0x4f')](_0x0ba1('0x53'),'i')[_0x0ba1('0x51')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x0ba1('0x54'))[_0x0ba1('0x51')](_0x0ba1('0x55'),'a',_0x0ba1('0x56'))['left_join'](_0x0ba1('0x57'),'me',_0x0ba1('0x58'))[_0x0ba1('0x51')](_0x0ba1('0x59'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0x0ba1('0x5a'),'t',_0x0ba1('0x5b'));var _0x259db2=squel[_0x0ba1('0x5c')]();var _0x5a200d=[];var _0x52befb=squel['expr']();var _0x2053d8;if(_0x3a97bc[_0x0ba1('0x3e')][_0x0ba1('0x5d')]){_0x2053d8=as[_0x0ba1('0x5e')](_0x3a97bc[_0x0ba1('0x3e')][_0x0ba1('0x5d')]);var _0x4ecb65=_0x2053d8[_0x0ba1('0x5f')];for(var _0x2c6b27=0x0;_0x2c6b27<_0x2053d8[_0x0ba1('0x60')][_0x0ba1('0x61')];_0x2c6b27++){var _0x24800e=_0x2053d8[_0x0ba1('0x60')][_0x2c6b27];var _0x1741ef='i';var _0x123a64=_[_0x0ba1('0x62')](_0x51f43e,[_0x0ba1('0x30'),_0x24800e[_0x0ba1('0x4a')]]);if(!_0x123a64){switch(_0x24800e['field']){case _0x0ba1('0x63'):if(_0x24800e['value']==0x1){_0xb36c11[_0x0ba1('0x64')]('`'+_0x24800e[_0x0ba1('0x4a')]+'`\x20=\x200');}else{_0xb36c11['having']('`'+_0x24800e['field']+'`\x20>\x200');}break;case _0x0ba1('0x65'):if(_0x24800e[_0x0ba1('0x66')]===_0x0ba1('0x67')){if(_0x24800e[_0x0ba1('0x68')]['split']('\x20')[_0x0ba1('0x61')]>0x1){_0x259db2[_0x4ecb65](_0x0ba1('0x69'),qs[_0x0ba1('0x6a')](_0x24800e[_0x0ba1('0x68')]),null);}else{var _0x6433bd='%'+_0x24800e[_0x0ba1('0x68')]+'%';_0x259db2[_0x4ecb65](_0x0ba1('0x6b'),_0x6433bd,_0x6433bd,_0x6433bd);}}else{_0x123a64=_[_0x0ba1('0x62')](_0x51f43e,[_0x0ba1('0x30'),_0x0ba1('0x6c')]);_0x24800e[_0x0ba1('0x4a')]=_0x0ba1('0x6c');_0x1b71a4=as['buildExpression'](_0x1741ef,_0x123a64[_0x0ba1('0x3b')],_0x24800e);_0x259db2[_0x4ecb65](_0x1b71a4[_0x0ba1('0x6d')],_0x1b71a4['value'][_0x0ba1('0x6e')],_0x1b71a4['value'][_0x0ba1('0x20')]);}break;case'Tag':var _0x523d4d=_0x24800e[_0x0ba1('0x68')][_0x0ba1('0x35')](',')['map'](function(_0x34a619){return Number(_0x34a619);});_0x523d4d['forEach'](function(_0x3079a3){_0x52befb['or'](_0x0ba1('0x6f'),'%,'+_0x3079a3+',%');});_0x5a200d=_['union'](_0x5a200d,_0x523d4d);break;case'User':if(_0x24800e[_0x0ba1('0x66')]==='$substring'){_0x259db2[_0x4ecb65](_0x0ba1('0x70'),'%'+_0x24800e[_0x0ba1('0x68')]+'%',null);}else{_0x123a64=_[_0x0ba1('0x62')](_0x51f43e,[_0x0ba1('0x30'),'UserId']);_0x24800e['field']=_0x0ba1('0x71');_0x1b71a4=as['buildExpression'](_0x1741ef,_0x123a64[_0x0ba1('0x3b')],_0x24800e);_0x259db2[_0x4ecb65](_0x1b71a4[_0x0ba1('0x6d')],_0x1b71a4[_0x0ba1('0x68')]['start'],_0x1b71a4[_0x0ba1('0x68')][_0x0ba1('0x20')]);}break;case'body':_0x1b71a4=as[_0x0ba1('0x72')]('me',null,_0x24800e);_0x259db2[_0x4ecb65](_0x1b71a4[_0x0ba1('0x6d')],_0x1b71a4[_0x0ba1('0x68')][_0x0ba1('0x6e')],_0x1b71a4[_0x0ba1('0x68')]['end']);break;}}else{var _0x1b71a4=as[_0x0ba1('0x72')](_0x1741ef,_0x123a64[_0x0ba1('0x3b')],_0x24800e);_0x259db2[_0x4ecb65](_0x1b71a4[_0x0ba1('0x6d')],_0x1b71a4[_0x0ba1('0x68')][_0x0ba1('0x6e')],_0x1b71a4[_0x0ba1('0x68')][_0x0ba1('0x20')]);}}}else{var _0x30f2b4=_(_0x3a97bc[_0x0ba1('0x3e')])[_0x0ba1('0x73')]()[_0x0ba1('0x37')](function(_0x20dd1b){return _[_0x0ba1('0x74')](_0x51f43e,[_0x0ba1('0x30'),_0x20dd1b])?_0x20dd1b:undefined;})[_0x0ba1('0x75')]()[_0x0ba1('0x68')]();if(!_[_0x0ba1('0x76')](_0x30f2b4)){_0x30f2b4['forEach'](function(_0x27378a){if(_0x27378a===_0x0ba1('0x77')){_0xb36c11[_0x0ba1('0x47')](_0x0ba1('0x78'),[][_0x0ba1('0x79')](_0x3a97bc[_0x0ba1('0x3e')][_0x27378a]));}else if(_0x27378a===_0x0ba1('0x7a')){var _0x34b982=JSON[_0x0ba1('0x7b')](_0x3a97bc[_0x0ba1('0x3e')][_0x27378a])[_0x0ba1('0x7c')];var _0x236a7a=JSON['parse'](_0x3a97bc[_0x0ba1('0x3e')][_0x27378a])[_0x0ba1('0x7d')];_0xb36c11['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x34b982,_0x236a7a);}else{if(_0x3a97bc[_0x0ba1('0x3e')][_0x27378a]===_0x0ba1('0x7e')){_0xb36c11[_0x0ba1('0x47')]('i.'+_0x27378a+'\x20IS\x20NULL');}else{_0xb36c11[_0x0ba1('0x47')]('i.'+_0x27378a+_0x0ba1('0x7f'),_0x3a97bc[_0x0ba1('0x3e')][_0x27378a]);}}});}if(_0x3a97bc[_0x0ba1('0x3e')][_0x0ba1('0x80')]){if(_0x3a97bc[_0x0ba1('0x3e')][_0x0ba1('0x80')]==0x1){_0xb36c11[_0x0ba1('0x64')](_0x0ba1('0x81'));}else{_0xb36c11[_0x0ba1('0x64')]('`unreadMessages`\x20>\x200');}}if(_0x3a97bc['query'][_0x0ba1('0x82')]){_0x5a200d=_[_0x0ba1('0x83')](_0x3a97bc[_0x0ba1('0x3e')][_0x0ba1('0x82')])?_0x3a97bc['query']['tag']:new Array(_0x3a97bc[_0x0ba1('0x3e')][_0x0ba1('0x82')]);_0x5a200d[_0x0ba1('0x36')](function(_0x4885b0){_0x52befb['or'](_0x0ba1('0x6f'),'%,'+_0x4885b0+',%');});}if(_0x3a97bc[_0x0ba1('0x3e')][_0x0ba1('0x84')]){var _0x5c20bf=_0x3a97bc['query'][_0x0ba1('0x84')]['replace']('\x5c','\x5c\x5c')[_0x0ba1('0x85')](/'/g,'\x27\x27');if(qs[_0x0ba1('0x86')](_0x5c20bf)){_0x259db2['or'](_0x0ba1('0x87'),_0x5c20bf+'%');}else{_0x259db2['or'](_0x0ba1('0x88'),qs[_0x0ba1('0x6a')](_0x5c20bf))['or'](_0x0ba1('0x89'),_0x5c20bf+'%')['or'](_0x0ba1('0x8a'),_0x5c20bf+'%');}}}_0xb36c11['where'](_0x259db2);_0xb36c11[_0x0ba1('0x8b')](_0x0ba1('0x8c'));var _0x159ede={'type':db[_0x0ba1('0x8d')]['QueryTypes'][_0x0ba1('0x8e')],'raw':!![]};var _0xc7a9a0=_0xb36c11[_0x0ba1('0x8f')]();_0xc7a9a0[_0x0ba1('0x4a')]('i.id');_0xc7a9a0[_0x0ba1('0x4a')](_0x0ba1('0x90'),_0x0ba1('0x63'));if(_0x43afad[_0x0ba1('0x45')]){_0x43afad[_0x0ba1('0x45')][_0x0ba1('0x36')](function(_0x42034a){var _0x30c52d=_0x42034a[0x0]===_0x0ba1('0x91')?_0x42034a[0x0]:'i.'+_0x42034a[0x0];_0xb36c11[_0x0ba1('0x45')](_0x30c52d,_0x42034a[0x1]===_0x0ba1('0x92')?![]:!![]);});}if(!_[_0x0ba1('0x76')](_0x5a200d)){_0xb36c11['having'](_0x52befb);_0xc7a9a0[_0x0ba1('0x47')](_0x0ba1('0x93'),_0x5a200d);}BPromise['resolve']()['then'](function(){if(!_0x2053d8){if(_0x3a97bc['query'][_0x0ba1('0x77')])return;_0xc7a9a0[_0x0ba1('0x47')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0xb36c11[_0x0ba1('0x47')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3a97bc['user'][_0x0ba1('0x94')]!==_0x0ba1('0x95'))return;return _0x3a97bc[_0x0ba1('0x96')][_0x0ba1('0x97')]({'attributes':['id'],'raw':!![]})[_0x0ba1('0x2b')](function(_0x3b4aa6){if(_[_0x0ba1('0x76')](_0x3b4aa6)){_0xc7a9a0[_0x0ba1('0x47')](_0x0ba1('0x98'));_0xb36c11[_0x0ba1('0x47')](_0x0ba1('0x98'));}else{_0xc7a9a0[_0x0ba1('0x47')](_0x0ba1('0x78'),_[_0x0ba1('0x37')](_0x3b4aa6,'id'));_0xb36c11[_0x0ba1('0x47')](_0x0ba1('0x78'),_[_0x0ba1('0x37')](_0x3b4aa6,'id'));}});})[_0x0ba1('0x2b')](function(){if(_0x3a97bc[_0x0ba1('0x96')][_0x0ba1('0x94')]===_0x0ba1('0x95')&&!_0x2053d8&&!_0x3a97bc[_0x0ba1('0x3e')][_0x0ba1('0x77')])return[];return db[_0x0ba1('0x99')]['query'](_0xc7a9a0[_0x0ba1('0x9a')](),_0x159ede);})['then'](function(_0x163ca3){_0x2fc89d['count']=_0x163ca3['length'];if(_0x2fc89d[_0x0ba1('0x23')]===0x0)return[];return db[_0x0ba1('0x99')][_0x0ba1('0x3e')](_0x583d94['toString'](),_0x159ede)[_0x0ba1('0x2b')](function(_0x2b0023){_0x1e0640=_[_0x0ba1('0x9b')](_0x2b0023,'id');_0x159ede=_['merge'](_0x159ede,{'model':db[_0x0ba1('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a97bc['query'][_0x0ba1('0x42')]){_0x43afad['attributes'][_0x0ba1('0x36')](function(_0x60667b){_0xb36c11['field']('i.'+_0x60667b);});}else{_0xb36c11[_0x0ba1('0x4a')](_0x0ba1('0x90'),_0x0ba1('0x63'));_0xb36c11[_0x0ba1('0x4a')]('a.key',_0x0ba1('0x9c'));_0xb36c11['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0xb36c11[_0x0ba1('0x4a')](_0x0ba1('0x9d'),_0x0ba1('0x91'));_0xb36c11['field'](_0x0ba1('0x9e'));_0xb36c11[_0x0ba1('0x4a')](_0x0ba1('0x9f'),'Contact.firstName');_0xb36c11[_0x0ba1('0x4a')](_0x0ba1('0xa0'),_0x0ba1('0xa1'));_0xb36c11[_0x0ba1('0x4a')]('c.email',_0x0ba1('0xa2'));_0xb36c11[_0x0ba1('0x4a')](_0x0ba1('0xa3'),_0x0ba1('0xa4'));_0xb36c11[_0x0ba1('0x4a')]('c.mobile',_0x0ba1('0xa5'));_0xb36c11['field'](_0x0ba1('0xa6'),'Contact.fax');_0xb36c11[_0x0ba1('0x4a')](_0x0ba1('0xa7'),'Owner.fullname');_0xb36c11[_0x0ba1('0x4a')](_0x0ba1('0xa8'),'Owner.internal');_0xb36c11[_0x0ba1('0x4a')](_0x0ba1('0xa9'),_0x0ba1('0x33'));}if(_0x43afad[_0x0ba1('0x24')])_0xb36c11[_0x0ba1('0x24')](_0x43afad[_0x0ba1('0x24')]);if(_0x43afad['offset'])_0xb36c11[_0x0ba1('0x21')](_0x43afad[_0x0ba1('0x21')]);return db['sequelize']['query'](_0xb36c11['toString'](),_0x159ede);})['then'](function(_0x2497cc){if(_0x2497cc[_0x0ba1('0x61')]>0x0)_0x213bb6[_0x0ba1('0x47')](_0x0ba1('0xaa'),_[_0x0ba1('0x37')](_0x2497cc,'id'));return db[_0x0ba1('0x99')]['query'](_0x213bb6[_0x0ba1('0x9a')](),_0x159ede)[_0x0ba1('0x2b')](function(_0x3de7bb){var _0x3e15c3=_[_0x0ba1('0xab')](_0x3de7bb,_0x0ba1('0xac'));var _0x39ee86=[];_0x2497cc['forEach'](function(_0x2e0408){_0x39ee86[_0x0ba1('0xad')](updateOpenchannelInteraction(_0x2e0408,_0x1e0640,_0x3e15c3));});return BPromise[_0x0ba1('0xae')](_0x39ee86);});});})[_0x0ba1('0x2b')](function(_0x4072f6){_0x2fc89d[_0x0ba1('0xaf')]=_0x4072f6;return _0x2fc89d;})[_0x0ba1('0x2b')](respondWithFilteredResult(_0x1b11a7,_0x43afad))[_0x0ba1('0xb0')](handleError(_0x1b11a7,null));};exports[_0x0ba1('0xb1')]=function(_0x5e9ca8,_0x35b98d){var _0x3d5eb7={};if(_0x5e9ca8[_0x0ba1('0x3e')][_0x0ba1('0x3b')]&&_0x5e9ca8[_0x0ba1('0x3e')][_0x0ba1('0x3b')]==='from'){_0x3d5eb7[_0x0ba1('0x4f')]=_0x5e9ca8['params']['id'];}else{_0x3d5eb7['id']=_0x5e9ca8[_0x0ba1('0xb2')]['id'];}var _0xd9a33e={'raw':![],'where':_0x3d5eb7},_0x25b7ef={};_0x25b7ef['model']=_[_0x0ba1('0x73')](db[_0x0ba1('0x38')][_0x0ba1('0x39')]);_0x25b7ef[_0x0ba1('0x3e')]=_['keys'](_0x5e9ca8['query']);_0x25b7ef[_0x0ba1('0x3f')]=_[_0x0ba1('0x40')](_0x25b7ef[_0x0ba1('0x3d')],_0x25b7ef[_0x0ba1('0x3e')]);_0xd9a33e[_0x0ba1('0x41')]=_[_0x0ba1('0x40')](_0x25b7ef[_0x0ba1('0x3d')],qs[_0x0ba1('0x42')](_0x5e9ca8[_0x0ba1('0x3e')]['fields']));_0xd9a33e[_0x0ba1('0x41')]=_0xd9a33e[_0x0ba1('0x41')][_0x0ba1('0x61')]?_0xd9a33e[_0x0ba1('0x41')]:_0x25b7ef[_0x0ba1('0x3d')];if(_0x5e9ca8['query'][_0x0ba1('0xb3')]){_0xd9a33e[_0x0ba1('0xb4')]=[{'all':!![]}];}_0xd9a33e=_[_0x0ba1('0xb5')]({},_0xd9a33e,_0x5e9ca8[_0x0ba1('0xb6')]);return db[_0x0ba1('0x38')][_0x0ba1('0x62')](_0xd9a33e)[_0x0ba1('0x2b')](handleEntityNotFound(_0x35b98d,null))['then'](respondWithResult(_0x35b98d,null))['catch'](handleError(_0x35b98d,null));};exports[_0x0ba1('0xb7')]=function(_0x302913,_0xfe8eb1){return db[_0x0ba1('0x38')][_0x0ba1('0xb7')](_0x302913[_0x0ba1('0xb8')],{})[_0x0ba1('0x2b')](respondWithResult(_0xfe8eb1,0xc9))[_0x0ba1('0xb0')](handleError(_0xfe8eb1,null));};exports[_0x0ba1('0x2a')]=function(_0x90f7f7,_0x430845){if(_0x90f7f7[_0x0ba1('0xb8')]['id']){delete _0x90f7f7['body']['id'];}return db['OpenchannelInteraction'][_0x0ba1('0x62')]({'where':{'id':_0x90f7f7[_0x0ba1('0xb2')]['id']}})['then'](handleEntityNotFound(_0x430845,null))[_0x0ba1('0x2b')](saveUpdates(_0x90f7f7[_0x0ba1('0xb8')],null))[_0x0ba1('0x2b')](respondWithResult(_0x430845,null))['catch'](handleError(_0x430845,null));};exports['destroy']=function(_0x3cbecd,_0x289f53){return db[_0x0ba1('0x38')][_0x0ba1('0x62')]({'where':{'id':_0x3cbecd[_0x0ba1('0xb2')]['id']}})[_0x0ba1('0x2b')](handleEntityNotFound(_0x289f53,null))[_0x0ba1('0x2b')](removeEntity(_0x289f53,null))[_0x0ba1('0xb0')](handleError(_0x289f53,null));};exports[_0x0ba1('0xb9')]=function(_0x17d2dc,_0x1081c0){return db[_0x0ba1('0x38')][_0x0ba1('0xb9')]()[_0x0ba1('0x2b')](respondWithResult(_0x1081c0,null))[_0x0ba1('0xb0')](handleError(_0x1081c0,null));};exports[_0x0ba1('0xba')]=function(_0x2b436e,_0x756a56,_0x4b9d5e){return db['OpenchannelMessage'][_0x0ba1('0x62')]({'where':{'id':_0x2b436e['params']['id']}})['then'](handleEntityNotFound(_0x756a56,null))['then'](function(_0x4944af){if(_0x4944af){return _0x4944af['addMessage'](_0x2b436e['body'][_0x0ba1('0xbb')],_[_0x0ba1('0xbc')](_0x2b436e[_0x0ba1('0xb8')],[_0x0ba1('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x756a56,null))['catch'](handleError(_0x756a56,null));};exports[_0x0ba1('0xbd')]=function(_0x511aa2,_0x51136d,_0x1d0477){var _0x302362={'raw':![],'where':{}};var _0x5d04df={};var _0xe94475={'count':0x0,'rows':[]};return db[_0x0ba1('0x38')][_0x0ba1('0xbe')]({'where':{'id':_0x511aa2[_0x0ba1('0xb2')]['id']}})[_0x0ba1('0x2b')](handleEntityNotFound(_0x51136d,null))[_0x0ba1('0x2b')](function(_0x49c5eb){if(_0x49c5eb){_0x5d04df[_0x0ba1('0x3d')]=_[_0x0ba1('0x73')](db[_0x0ba1('0xbf')]['rawAttributes']);_0x5d04df[_0x0ba1('0x3e')]=_['keys'](_0x511aa2[_0x0ba1('0x3e')]);_0x5d04df[_0x0ba1('0x3f')]=_[_0x0ba1('0x40')](_0x5d04df[_0x0ba1('0x3d')],_0x5d04df['query']);_0x302362[_0x0ba1('0x41')]=_['intersection'](_0x5d04df[_0x0ba1('0x3d')],qs[_0x0ba1('0x42')](_0x511aa2[_0x0ba1('0x3e')][_0x0ba1('0x42')]));_0x302362[_0x0ba1('0x41')]=_0x302362[_0x0ba1('0x41')][_0x0ba1('0x61')]?_0x302362['attributes']:_0x5d04df[_0x0ba1('0x3d')];if(!_0x511aa2[_0x0ba1('0x3e')][_0x0ba1('0x43')]('nolimit')){_0x302362['limit']=qs[_0x0ba1('0x24')](_0x511aa2[_0x0ba1('0x3e')][_0x0ba1('0x24')]);_0x302362[_0x0ba1('0x21')]=qs[_0x0ba1('0x21')](_0x511aa2[_0x0ba1('0x3e')][_0x0ba1('0x21')]);}_0x302362[_0x0ba1('0x45')]=qs['sort'](_0x511aa2[_0x0ba1('0x3e')][_0x0ba1('0x46')]);_0x302362[_0x0ba1('0x47')]=qs[_0x0ba1('0x3f')](_['pick'](_0x511aa2[_0x0ba1('0x3e')],_0x5d04df[_0x0ba1('0x3f')]));_0x302362[_0x0ba1('0x47')]['OpenchannelInteractionId']=_0x49c5eb['id'];if(_0x511aa2[_0x0ba1('0x3e')][_0x0ba1('0x84')]){_0x302362[_0x0ba1('0x47')]=_[_0x0ba1('0xb5')](_0x302362[_0x0ba1('0x47')],{'$or':_[_0x0ba1('0x37')](_0x302362[_0x0ba1('0x41')],function(_0x36f0f2){var _0x45ca77={};_0x45ca77[_0x36f0f2]={'$like':'%'+_0x511aa2['query'][_0x0ba1('0x84')]+'%'};return _0x45ca77;})});}if(_0x511aa2[_0x0ba1('0x3e')]['$gte']){var _0x234179=_0x511aa2['query'][_0x0ba1('0x7c')]['split'](',');var _0x248baa={};_0x248baa[_0x234179[0x0]]={'$gte':moment(_0x234179[0x1])[_0x0ba1('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x302362[_0x0ba1('0x47')]=_[_0x0ba1('0xb5')](_0x302362[_0x0ba1('0x47')],_0x248baa);}_0x302362=_[_0x0ba1('0xb5')]({},_0x302362,_0x511aa2['options']);return db[_0x0ba1('0xbf')][_0x0ba1('0x23')]({'where':_0x302362['where']})[_0x0ba1('0x2b')](function(_0x3047ea){_0xe94475[_0x0ba1('0x23')]=_0x3047ea;if(_0x511aa2[_0x0ba1('0x3e')][_0x0ba1('0xb3')]){_0x302362[_0x0ba1('0xb4')]=[{'all':!![]}];}return db[_0x0ba1('0xbf')]['findAll'](_0x302362);})[_0x0ba1('0x2b')](function(_0x3d804d){_0xe94475[_0x0ba1('0xaf')]=_0x3d804d;return _0xe94475;});}})[_0x0ba1('0x2b')](respondWithFilteredResult(_0x51136d,_0x302362))[_0x0ba1('0xb0')](handleError(_0x51136d,null));};exports[_0x0ba1('0xc1')]=function(_0x2dd4c8,_0xf9bc91,_0x3d37ef){return db[_0x0ba1('0x38')][_0x0ba1('0x62')]({'where':{'id':_0x2dd4c8[_0x0ba1('0xb2')]['id']}})[_0x0ba1('0x2b')](handleEntityNotFound(_0xf9bc91,null))[_0x0ba1('0x2b')](function(_0x313d81){if(_0x313d81){return _0x313d81[_0x0ba1('0xc2')](_0x2dd4c8[_0x0ba1('0xb8')][_0x0ba1('0xbb')],_['omit'](_0x2dd4c8['body'],['ids','id'])||{})[_0x0ba1('0xc3')](function(){return db[_0x0ba1('0xc4')][_0x0ba1('0xc5')]({'attributes':['id',_0x0ba1('0x30'),_0x0ba1('0x4b')],'where':{'id':_0x2dd4c8['body'][_0x0ba1('0xbb')]}});})['then'](function(_0x4c4135){socket[_0x0ba1('0xc6')]('openchannelInteractionTags:save',{'id':Number(_0x2dd4c8[_0x0ba1('0xb2')]['id']),'tags':_0x4c4135||[]});return{'id':Number(_0x2dd4c8['params']['id']),'tags':_0x4c4135||[]};});}})[_0x0ba1('0x2b')](respondWithResult(_0xf9bc91,null))[_0x0ba1('0xb0')](handleError(_0xf9bc91,null));};exports[_0x0ba1('0xc7')]=function(_0x724039,_0x575ec0,_0x432f05){return db[_0x0ba1('0x38')]['find']({'where':{'id':_0x724039[_0x0ba1('0xb2')]['id']}})[_0x0ba1('0x2b')](handleEntityNotFound(_0x575ec0,null))[_0x0ba1('0x2b')](function(_0x9bdabd){if(_0x9bdabd){return _0x9bdabd[_0x0ba1('0xc7')](_0x724039[_0x0ba1('0x3e')][_0x0ba1('0xbb')]);}})[_0x0ba1('0x2b')](respondWithStatusCode(_0x575ec0,null))[_0x0ba1('0xb0')](handleError(_0x575ec0,null));};exports[_0x0ba1('0xc8')]=function(_0x59e53d,_0x35d101){var _0x355ce4=moment()[_0x0ba1('0xc9')]()['toString']();var _0x2213d6=path[_0x0ba1('0xca')](config[_0x0ba1('0xcb')],_0x0ba1('0xcc'),_0x0ba1('0xcd'),_0x0ba1('0xce'));var _0x46df20=path[_0x0ba1('0xca')](config[_0x0ba1('0xcb')],_0x0ba1('0xcc'),_0x0ba1('0xcd'),'attachments');var _0x2e6b46=path[_0x0ba1('0xca')](_0x2213d6,_0x355ce4);var _0x1d912=util['format'](_0x0ba1('0xcf'),_0x59e53d[_0x0ba1('0xb2')]['id'],_0x355ce4);var _0x16c751=path[_0x0ba1('0xca')](_0x2213d6,_0x1d912);var _0xb0fef3=[];_0xb0fef3[_0x0ba1('0xad')]({'model':db['User'],'as':_0x0ba1('0xd0'),'attributes':['id','fullname'],'raw':!![]});_0xb0fef3[_0x0ba1('0xad')]({'model':db[_0x0ba1('0xd1')],'as':_0x0ba1('0x65'),'attributes':['id','firstName',_0x0ba1('0xd2')],'raw':!![]});if(_0x59e53d[_0x0ba1('0x3e')][_0x0ba1('0xd3')]){_0xb0fef3[_0x0ba1('0xad')]({'model':db[_0x0ba1('0xd4')],'as':'Attachment','raw':!![]});}var _0x14159b=[{'model':db['OpenchannelMessage'],'as':_0x0ba1('0xd5'),'attributes':['id',_0x0ba1('0xb8'),_0x0ba1('0x7a'),_0x0ba1('0xd6'),_0x0ba1('0xd7'),'read'],'include':_0xb0fef3}];_0x14159b['push']({'model':db[_0x0ba1('0xd8')],'as':_0x0ba1('0xd9'),'attributes':['id',_0x0ba1('0x30')]});_0x14159b[_0x0ba1('0xad')]({'model':db[_0x0ba1('0xd0')],'as':'Owner','attributes':['id',_0x0ba1('0x32')]});return db[_0x0ba1('0x38')][_0x0ba1('0x62')]({'where':{'id':_0x59e53d['params']['id']},'include':_0x14159b})[_0x0ba1('0x2b')](handleEntityNotFound(_0x35d101,null))[_0x0ba1('0x2b')](function(_0x546dc0){if(_0x546dc0){var _0x181917=_0x546dc0[_0x0ba1('0xda')]({'plain':!![]});fs['mkdirSync'](_0x2e6b46);var _0x17af6e={'channel':_0x0ba1('0xdb'),'account':_0x181917['Account'][_0x0ba1('0x30')],'agent':_0x181917[_0x0ba1('0xdc')]?_0x181917[_0x0ba1('0xdc')][_0x0ba1('0x32')]:'N.A.','createdAt':moment(_0x181917['createdAt'])[_0x0ba1('0xc0')](_0x0ba1('0xdd'))[_0x0ba1('0x9a')](),'closedAt':_0x181917[_0x0ba1('0xde')]?moment(_0x181917[_0x0ba1('0xdf')])['format'](_0x0ba1('0xdd'))[_0x0ba1('0x9a')]():'','disposition':_0x181917[_0x0ba1('0xe0')],'visibility':_0x181917[_0x0ba1('0xe1')]?_0x0ba1('0xe2'):_0x0ba1('0xe3'),'messages':_(_0x181917['Messages'])['filter']({'secret':![]})[_0x0ba1('0x37')](function(_0x21567f){if(_0x21567f[_0x0ba1('0xd4')]){var _0x170ea4=path['join'](_0x46df20,_0x21567f[_0x0ba1('0xd4')][_0x0ba1('0xe4')]);if(fs['existsSync'](_0x170ea4)){fs[_0x0ba1('0xe5')](_0x170ea4)[_0x0ba1('0xe6')](fs[_0x0ba1('0xe7')](path[_0x0ba1('0xca')](_0x2e6b46,_0x21567f[_0x0ba1('0xd4')][_0x0ba1('0xe4')])));}}return{'date':moment(_0x21567f[_0x0ba1('0x7a')])[_0x0ba1('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0ba1('0x9a')](),'sender':_0x21567f['direction']===_0x0ba1('0xe8')?_0x21567f['User']?_0x21567f[_0x0ba1('0xd0')][_0x0ba1('0x32')]:_0x0ba1('0xe9'):_0x21567f[_0x0ba1('0x65')][_0x0ba1('0xea')]+(_0x21567f[_0x0ba1('0x65')][_0x0ba1('0xd2')]?'\x20'+_0x21567f['Contact']['lastName']:''),'body':_0x21567f['Attachment']?_0x21567f[_0x0ba1('0xd4')]['basename']:_0x21567f[_0x0ba1('0xb8')],'direction':_0x21567f[_0x0ba1('0xd6')]===_0x0ba1('0xe8')?'A':'C','secret':_0x21567f[_0x0ba1('0xd7')],'read':_0x21567f[_0x0ba1('0x80')],'attachment':_0x21567f[_0x0ba1('0xd4')]};})[_0x0ba1('0x68')]()};return ejs[_0x0ba1('0xeb')](path['join'](config[_0x0ba1('0xcb')],_0x0ba1('0xcc'),'views',_0x0ba1('0xec')),{'interaction':_0x17af6e})[_0x0ba1('0x2b')](function(_0x3b9bfd){var _0x5c83e3=path[_0x0ba1('0xca')](_0x2e6b46,'transcript-'+_0x181917['id']+'-'+_0x355ce4+'.pdf');var _0x10c6d0={'path':_0x5c83e3,'channel':_0x0ba1('0xdb'),'interactionId':_0x181917['id']};return pdf[_0x0ba1('0xed')](_0x3b9bfd,_0x10c6d0);})[_0x0ba1('0x2b')](function(){return new BPromise(function(_0x553c48,_0x41e546){zipdir(_0x2e6b46,{'saveTo':_0x16c751},function(_0x21916d,_0x5a14fe){if(_0x21916d)return _0x41e546(_0x21916d);return _0x553c48(_0x5a14fe);});})['then'](function(){return new BPromise(function(_0xeca1b6,_0x3d3674){rimraf(_0x2e6b46,function(_0x1cc956){if(_0x1cc956)_0x3d3674(_0x1cc956);return _0xeca1b6();});});})[_0x0ba1('0x2b')](function(){return _0x35d101[_0x0ba1('0xc8')](_0x16c751,_0x1d912,function(_0x5f3b44){if(_0x5f3b44){console[_0x0ba1('0xee')]('err',_0x5f3b44);}else{fs[_0x0ba1('0xef')](_0x16c751);}});});});}else{return _0x35d101[_0x0ba1('0x2d')](0xc8);}})[_0x0ba1('0xb0')](handleError(_0x35d101,null));}; \ No newline at end of file +var _0x93bd=['field','u.id','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','having','`\x20>\x200','Contact','operator','value','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','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','compact','OpenchannelAccountId','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\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)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','catch','show','params','includeAll','include','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','pick','OpenchannelInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','unix','files','tmp','join','root','server','attachments','format','transcript-%d-%s.zip','User','CmContact','firstName','Messages','createdAt','direction','secret','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','closedAt','Public','Private','Attachment','createReadStream','createWriteStream','basename','out','System','lastName','views','downloadInteraction.html','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','index','OpenchannelInteraction','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','select'];(function(_0x230713,_0x5d135a){var _0x4bf129=function(_0x9db835){while(--_0x9db835){_0x230713['push'](_0x230713['shift']());}};_0x4bf129(++_0x5d135a);}(_0x93bd,0xa4));var _0xd93b=function(_0x5e3656,_0x3d2668){_0x5e3656=_0x5e3656-0x0;var _0x3e6661=_0x93bd[_0x5e3656];return _0x3e6661;};'use strict';var emlformat=require(_0xd93b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd93b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd93b('0x2'));var BPromise=require(_0xd93b('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd93b('0x4'));var sox=require(_0xd93b('0x5'));var csv=require(_0xd93b('0x6'));var ejs=require(_0xd93b('0x7'));var fs=require('fs');var fs_extra=require(_0xd93b('0x8'));var _=require('lodash');var squel=require(_0xd93b('0x9'));var crypto=require(_0xd93b('0xa'));var jsforce=require(_0xd93b('0xb'));var deskjs=require(_0xd93b('0xc'));var toCsv=require(_0xd93b('0x6'));var querystring=require(_0xd93b('0xd'));var Papa=require(_0xd93b('0xe'));var Redis=require(_0xd93b('0xf'));var authService=require(_0xd93b('0x10'));var qs=require(_0xd93b('0x11'));var as=require(_0xd93b('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xd93b('0x13'));var logger=require(_0xd93b('0x14'))(_0xd93b('0x15'));var utils=require(_0xd93b('0x16'));var config=require(_0xd93b('0x17'));var licenseUtil=require(_0xd93b('0x18'));var db=require(_0xd93b('0x19'))['db'];config[_0xd93b('0x1a')]=_[_0xd93b('0x1b')](config['redis'],{'host':_0xd93b('0x1c'),'port':0x18eb});var socket=require(_0xd93b('0x1d'))(new Redis(config[_0xd93b('0x1a')]));require(_0xd93b('0x1e'))[_0xd93b('0x1f')](socket);function respondWithStatusCode(_0x2f8ad6,_0x327c5c){_0x327c5c=_0x327c5c||0xcc;return function(_0xb92b1){if(_0xb92b1){return _0x2f8ad6['sendStatus'](_0x327c5c);}return _0x2f8ad6[_0xd93b('0x20')](_0x327c5c)[_0xd93b('0x21')]();};}function respondWithResult(_0xabd86,_0x1b4dfd){_0x1b4dfd=_0x1b4dfd||0xc8;return function(_0x43dbac){if(_0x43dbac){return _0xabd86[_0xd93b('0x20')](_0x1b4dfd)['json'](_0x43dbac);}};}function respondWithFilteredResult(_0x28e37d,_0x389552){return function(_0x542996){if(_0x542996){var _0xd50c03=typeof _0x389552['offset']===_0xd93b('0x22')&&typeof _0x389552[_0xd93b('0x23')]===_0xd93b('0x22');var _0xc1a763=_0x542996[_0xd93b('0x24')];var _0x2a7ce2=_0xd50c03?0x0:_0x389552[_0xd93b('0x25')];var _0x9eb919=_0xd50c03?_0x542996[_0xd93b('0x24')]:_0x389552[_0xd93b('0x25')]+_0x389552[_0xd93b('0x23')];var _0x421981;if(_0x9eb919>=_0xc1a763){_0x9eb919=_0xc1a763;_0x421981=0xc8;}else{_0x421981=0xce;}_0x28e37d[_0xd93b('0x20')](_0x421981);return _0x28e37d[_0xd93b('0x26')](_0xd93b('0x27'),_0x2a7ce2+'-'+_0x9eb919+'/'+_0xc1a763)['json'](_0x542996);}return null;};}function patchUpdates(_0x3388f6){return function(_0x23773e){try{jsonpatch[_0xd93b('0x28')](_0x23773e,_0x3388f6,!![]);}catch(_0x59cad4){return BPromise[_0xd93b('0x29')](_0x59cad4);}return _0x23773e[_0xd93b('0x2a')]();};}function saveUpdates(_0x5dc016,_0x22eefd){return function(_0x50dc34){if(_0x50dc34){return _0x50dc34[_0xd93b('0x2b')](_0x5dc016)[_0xd93b('0x2c')](function(_0x18a6db){return _0x18a6db;});}return null;};}function removeEntity(_0x598b45,_0xd73283){return function(_0x26597b){if(_0x26597b){return _0x26597b[_0xd93b('0x2d')]()['then'](function(){_0x598b45['status'](0xcc)[_0xd93b('0x21')]();});}};}function handleEntityNotFound(_0x5c34bb,_0x349eaf){return function(_0x587aa4){if(!_0x587aa4){_0x5c34bb[_0xd93b('0x2e')](0x194);}return _0x587aa4;};}function handleError(_0xda05f7,_0x575144){_0x575144=_0x575144||0x1f4;return function(_0x100e04){logger['error'](_0x100e04[_0xd93b('0x2f')]);if(_0x100e04[_0xd93b('0x30')]){delete _0x100e04[_0xd93b('0x30')];}_0xda05f7[_0xd93b('0x20')](_0x575144)[_0xd93b('0x31')](_0x100e04);};}function getInteractionUsers(_0x18ba46,_0x5a0b76){return new BPromise(function(_0x43e90a,_0x4acbfa){try{if(_0x5a0b76[_0x18ba46['id']]){_0x18ba46[_0xd93b('0x32')]=_[_0xd93b('0x33')](_0x5a0b76[_0x18ba46['id']],function(_0x5a9b47){return{'id':_0x5a9b47['id'],'fullname':_0x5a9b47[_0xd93b('0x34')]};});}}catch(_0x5692b0){_0x4acbfa(_0x5692b0);}_0x43e90a(_0x18ba46);});}function getInteractionTags(_0x5c78ef,_0x130566){return new BPromise(function(_0x2467bc,_0x2cdf1e){try{if(_0x5c78ef[_0xd93b('0x35')]){_0x5c78ef[_0xd93b('0x36')]=[];_0x5c78ef[_0xd93b('0x35')][_0xd93b('0x37')](',')[_0xd93b('0x38')](function(_0x4616a5){_0x5c78ef[_0xd93b('0x36')][_0xd93b('0x39')](_0x130566[_0x4616a5]);});}delete _0x5c78ef[_0xd93b('0x35')];}catch(_0x459c33){_0x2cdf1e(_0x459c33);}_0x2467bc(_0x5c78ef);});}function updateOpenchannelInteraction(_0x4c1804,_0x1c899d,_0x1ba758){return new BPromise(function(_0x412c5e,_0xb5be7f){return getInteractionUsers(_0x4c1804,_0x1ba758)[_0xd93b('0x2c')](function(_0xc18f07){return getInteractionTags(_0xc18f07,_0x1c899d);})[_0xd93b('0x2c')](function(_0x50f085){_0x412c5e(_0x50f085);})['catch'](function(_0x2b9a6a){_0xb5be7f(_0x2b9a6a);});});}exports[_0xd93b('0x3a')]=function(_0x322206,_0x1ba391){var _0x5db358={},_0xa1a283={},_0x67ccfc={'count':0x0,'rows':[]};var _0x369889=_[_0xd93b('0x33')](db[_0xd93b('0x3b')][_0xd93b('0x3c')],function(_0x36f21b){return{'name':_0x36f21b['fieldName'],'type':_0x36f21b[_0xd93b('0x3d')][_0xd93b('0x3e')]};});_0xa1a283[_0xd93b('0x3f')]=_['map'](_0x369889,_0xd93b('0x30'));_0xa1a283['query']=_[_0xd93b('0x40')](_0x322206[_0xd93b('0x41')]);_0xa1a283['filters']=_[_0xd93b('0x42')](_0xa1a283[_0xd93b('0x3f')],_0xa1a283[_0xd93b('0x41')]);_0x5db358[_0xd93b('0x43')]=_[_0xd93b('0x42')](_0xa1a283['model'],qs[_0xd93b('0x44')](_0x322206[_0xd93b('0x41')][_0xd93b('0x44')]));_0x5db358['attributes']=_0x5db358[_0xd93b('0x43')][_0xd93b('0x45')]?_0x5db358[_0xd93b('0x43')]:_0xa1a283[_0xd93b('0x3f')];if(!_0x322206[_0xd93b('0x41')][_0xd93b('0x46')](_0xd93b('0x47'))){_0x5db358[_0xd93b('0x23')]=qs['limit'](_0x322206[_0xd93b('0x41')]['limit']);_0x5db358['offset']=qs['offset'](_0x322206[_0xd93b('0x41')]['offset']);}_0x5db358[_0xd93b('0x48')]=qs[_0xd93b('0x49')](_0x322206[_0xd93b('0x41')]['sort']);_0x5db358[_0xd93b('0x4a')]=qs['filters'](_['pick'](_0x322206[_0xd93b('0x41')],_0xa1a283[_0xd93b('0x4b')]),_0x369889);var _0x21d697=[];var _0x1e8903=squel[_0xd93b('0x4c')]()[_0xd93b('0x4d')]('id')['field'](_0xd93b('0x30'))[_0xd93b('0x4d')]('color')['from']('tools_tags');var _0x9cb202=squel[_0xd93b('0x4c')]()[_0xd93b('0x4d')](_0xd93b('0x4e'))[_0xd93b('0x4d')]('u.fullname')[_0xd93b('0x4d')](_0xd93b('0x4f'))[_0xd93b('0x50')](_0xd93b('0x51'),'ui')[_0xd93b('0x52')](_0xd93b('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x383bde=squel[_0xd93b('0x4c')]()[_0xd93b('0x50')]('openchannel_interactions','i')[_0xd93b('0x52')](_0xd93b('0x54'),'c',_0xd93b('0x55'))['left_join'](_0xd93b('0x53'),'o','o.id\x20=\x20i.UserId')[_0xd93b('0x52')](_0xd93b('0x56'),'a',_0xd93b('0x57'))['left_join'](_0xd93b('0x58'),'me',_0xd93b('0x59'))[_0xd93b('0x52')](_0xd93b('0x5a'),'it',_0xd93b('0x5b'))[_0xd93b('0x52')](_0xd93b('0x5c'),'t',_0xd93b('0x5d'));var _0xd4081f=squel[_0xd93b('0x5e')]();var _0x43131d=[];var _0x1b3383=squel[_0xd93b('0x5e')]();var _0x90e487;if(_0x322206['query'][_0xd93b('0x5f')]){_0x90e487=as['parseSearch'](_0x322206[_0xd93b('0x41')][_0xd93b('0x5f')]);var _0x9399d2=_0x90e487[_0xd93b('0x60')];for(var _0x139c4e=0x0;_0x139c4e<_0x90e487[_0xd93b('0x61')]['length'];_0x139c4e++){var _0x5d722d=_0x90e487[_0xd93b('0x61')][_0x139c4e];var _0x5949d6='i';var _0x32bdb8=_['find'](_0x369889,[_0xd93b('0x30'),_0x5d722d[_0xd93b('0x4d')]]);if(!_0x32bdb8){switch(_0x5d722d[_0xd93b('0x4d')]){case _0xd93b('0x62'):if(_0x5d722d['value']==0x1){_0x383bde[_0xd93b('0x63')]('`'+_0x5d722d[_0xd93b('0x4d')]+'`\x20=\x200');}else{_0x383bde['having']('`'+_0x5d722d[_0xd93b('0x4d')]+_0xd93b('0x64'));}break;case _0xd93b('0x65'):if(_0x5d722d[_0xd93b('0x66')]==='$substring'){if(_0x5d722d[_0xd93b('0x67')][_0xd93b('0x37')]('\x20')[_0xd93b('0x45')]>0x1){_0xd4081f[_0x9399d2](_0xd93b('0x68'),qs[_0xd93b('0x69')](_0x5d722d[_0xd93b('0x67')]),null);}else{var _0x40eda0='%'+_0x5d722d['value']+'%';_0xd4081f[_0x9399d2](_0xd93b('0x6a'),_0x40eda0,_0x40eda0,_0x40eda0);}}else{_0x32bdb8=_[_0xd93b('0x6b')](_0x369889,[_0xd93b('0x30'),_0xd93b('0x6c')]);_0x5d722d[_0xd93b('0x4d')]=_0xd93b('0x6c');_0x40f91e=as[_0xd93b('0x6d')](_0x5949d6,_0x32bdb8['type'],_0x5d722d);_0xd4081f[_0x9399d2](_0x40f91e[_0xd93b('0x6e')],_0x40f91e['value'][_0xd93b('0x6f')],_0x40f91e[_0xd93b('0x67')][_0xd93b('0x21')]);}break;case _0xd93b('0x70'):var _0x268d61=_0x5d722d['value'][_0xd93b('0x37')](',')[_0xd93b('0x33')](function(_0x129e41){return Number(_0x129e41);});_0x268d61[_0xd93b('0x38')](function(_0x15b6a0){_0x1b3383['or'](_0xd93b('0x71'),'%,'+_0x15b6a0+',%');});_0x43131d=_['union'](_0x43131d,_0x268d61);break;case'User':if(_0x5d722d['operator']===_0xd93b('0x72')){_0xd4081f[_0x9399d2](_0xd93b('0x73'),'%'+_0x5d722d[_0xd93b('0x67')]+'%',null);}else{_0x32bdb8=_[_0xd93b('0x6b')](_0x369889,[_0xd93b('0x30'),_0xd93b('0x74')]);_0x5d722d['field']='UserId';_0x40f91e=as[_0xd93b('0x6d')](_0x5949d6,_0x32bdb8[_0xd93b('0x3d')],_0x5d722d);_0xd4081f[_0x9399d2](_0x40f91e[_0xd93b('0x6e')],_0x40f91e[_0xd93b('0x67')][_0xd93b('0x6f')],_0x40f91e['value'][_0xd93b('0x21')]);}break;case'body':_0x40f91e=as['buildExpression']('me',null,_0x5d722d);_0xd4081f[_0x9399d2](_0x40f91e[_0xd93b('0x6e')],_0x40f91e['value'][_0xd93b('0x6f')],_0x40f91e[_0xd93b('0x67')][_0xd93b('0x21')]);break;}}else{var _0x40f91e=as['buildExpression'](_0x5949d6,_0x32bdb8[_0xd93b('0x3d')],_0x5d722d);_0xd4081f[_0x9399d2](_0x40f91e[_0xd93b('0x6e')],_0x40f91e['value']['start'],_0x40f91e['value'][_0xd93b('0x21')]);}}}else{var _0x5c3abc=_(_0x322206[_0xd93b('0x41')])[_0xd93b('0x40')]()['map'](function(_0xc90624){return _['some'](_0x369889,[_0xd93b('0x30'),_0xc90624])?_0xc90624:undefined;})[_0xd93b('0x75')]()[_0xd93b('0x67')]();if(!_['isEmpty'](_0x5c3abc)){_0x5c3abc['forEach'](function(_0x3f698e){if(_0x3f698e===_0xd93b('0x76')){_0x383bde[_0xd93b('0x4a')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xd93b('0x77')](_0x322206['query'][_0x3f698e]));}else if(_0x3f698e==='createdAt'){var _0x4878a0=JSON[_0xd93b('0x78')](_0x322206['query'][_0x3f698e])[_0xd93b('0x79')];var _0x18106c=JSON[_0xd93b('0x78')](_0x322206['query'][_0x3f698e])[_0xd93b('0x7a')];_0x383bde[_0xd93b('0x4a')](_0xd93b('0x7b'),_0x4878a0,_0x18106c);}else{if(_0x322206[_0xd93b('0x41')][_0x3f698e]==='null'){_0x383bde['where']('i.'+_0x3f698e+_0xd93b('0x7c'));}else{_0x383bde[_0xd93b('0x4a')]('i.'+_0x3f698e+_0xd93b('0x7d'),_0x322206['query'][_0x3f698e]);}}});}if(_0x322206[_0xd93b('0x41')]['read']){if(_0x322206[_0xd93b('0x41')][_0xd93b('0x7e')]==0x1){_0x383bde[_0xd93b('0x63')](_0xd93b('0x7f'));}else{_0x383bde[_0xd93b('0x63')](_0xd93b('0x80'));}}if(_0x322206[_0xd93b('0x41')][_0xd93b('0x81')]){_0x43131d=_['isArray'](_0x322206[_0xd93b('0x41')][_0xd93b('0x81')])?_0x322206[_0xd93b('0x41')]['tag']:new Array(_0x322206[_0xd93b('0x41')]['tag']);_0x43131d[_0xd93b('0x38')](function(_0x41be64){_0x1b3383['or'](_0xd93b('0x71'),'%,'+_0x41be64+',%');});}if(_0x322206[_0xd93b('0x41')][_0xd93b('0x82')]){var _0x146106=_0x322206[_0xd93b('0x41')][_0xd93b('0x82')]['replace']('\x5c','\x5c\x5c')[_0xd93b('0x83')](/'/g,'\x27\x27');if(qs[_0xd93b('0x84')](_0x146106)){_0xd4081f['or'](_0xd93b('0x85'),_0x146106+'%');}else{_0xd4081f['or'](_0xd93b('0x86'),qs[_0xd93b('0x69')](_0x146106))['or']('i.from\x20LIKE\x20?',_0x146106+'%')['or'](_0xd93b('0x87'),_0x146106+'%');}}}_0x383bde['where'](_0xd4081f);_0x383bde['group']('i.id');var _0x4705c8={'type':db[_0xd93b('0x88')][_0xd93b('0x89')][_0xd93b('0x8a')],'raw':!![]};var _0x416859=_0x383bde[_0xd93b('0x8b')]();_0x416859[_0xd93b('0x4d')](_0xd93b('0x8c'));_0x416859[_0xd93b('0x4d')](_0xd93b('0x8d'),'unreadMessages');if(_0x5db358[_0xd93b('0x48')]){_0x5db358[_0xd93b('0x48')][_0xd93b('0x38')](function(_0x11a133){var _0x20b72e=_0x11a133[0x0]==='contactName'?_0x11a133[0x0]:'i.'+_0x11a133[0x0];_0x383bde[_0xd93b('0x48')](_0x20b72e,_0x11a133[0x1]===_0xd93b('0x8e')?![]:!![]);});}if(!_[_0xd93b('0x8f')](_0x43131d)){_0x383bde[_0xd93b('0x63')](_0x1b3383);_0x416859[_0xd93b('0x4a')]('t.id\x20IN\x20?',_0x43131d);}BPromise['resolve']()[_0xd93b('0x2c')](function(){if(!_0x90e487){if(_0x322206['query'][_0xd93b('0x76')])return;_0x416859['where'](_0xd93b('0x90'));_0x383bde['where'](_0xd93b('0x90'));return;}if(_0x322206[_0xd93b('0x91')][_0xd93b('0x92')]!=='agent')return;return _0x322206[_0xd93b('0x91')][_0xd93b('0x93')]({'attributes':['id'],'raw':!![]})[_0xd93b('0x2c')](function(_0x54f097){if(_[_0xd93b('0x8f')](_0x54f097)){_0x416859[_0xd93b('0x4a')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x383bde[_0xd93b('0x4a')](_0xd93b('0x94'));}else{_0x416859[_0xd93b('0x4a')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xd93b('0x33')](_0x54f097,'id'));_0x383bde[_0xd93b('0x4a')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xd93b('0x33')](_0x54f097,'id'));}});})[_0xd93b('0x2c')](function(){if(_0x322206['user'][_0xd93b('0x92')]===_0xd93b('0x95')&&!_0x90e487&&!_0x322206[_0xd93b('0x41')][_0xd93b('0x76')])return[];return db[_0xd93b('0x96')][_0xd93b('0x41')](_0x416859[_0xd93b('0x97')](),_0x4705c8);})[_0xd93b('0x2c')](function(_0x3498d7){_0x67ccfc[_0xd93b('0x24')]=_0x3498d7['length'];if(_0x67ccfc['count']===0x0)return[];return db[_0xd93b('0x96')]['query'](_0x1e8903[_0xd93b('0x97')](),_0x4705c8)[_0xd93b('0x2c')](function(_0x531ba0){_0x21d697=_[_0xd93b('0x98')](_0x531ba0,'id');_0x4705c8=_[_0xd93b('0x99')](_0x4705c8,{'model':db[_0xd93b('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x322206[_0xd93b('0x41')][_0xd93b('0x44')]){_0x5db358[_0xd93b('0x43')][_0xd93b('0x38')](function(_0x49e275){_0x383bde[_0xd93b('0x4d')]('i.'+_0x49e275);});}else{_0x383bde[_0xd93b('0x4d')](_0xd93b('0x8d'),_0xd93b('0x62'));_0x383bde[_0xd93b('0x4d')](_0xd93b('0x9a'),_0xd93b('0x9b'));_0x383bde[_0xd93b('0x4d')](_0xd93b('0x9c'),_0xd93b('0x9d'));_0x383bde[_0xd93b('0x4d')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x383bde[_0xd93b('0x4d')]('i.*');_0x383bde[_0xd93b('0x4d')](_0xd93b('0x9e'),_0xd93b('0x9f'));_0x383bde[_0xd93b('0x4d')]('c.lastName',_0xd93b('0xa0'));_0x383bde[_0xd93b('0x4d')](_0xd93b('0xa1'),_0xd93b('0xa2'));_0x383bde['field'](_0xd93b('0xa3'),_0xd93b('0xa4'));_0x383bde[_0xd93b('0x4d')](_0xd93b('0xa5'),_0xd93b('0xa6'));_0x383bde['field'](_0xd93b('0xa7'),'Contact.fax');_0x383bde[_0xd93b('0x4d')](_0xd93b('0xa8'),'Owner.fullname');_0x383bde[_0xd93b('0x4d')](_0xd93b('0xa9'),_0xd93b('0xaa'));_0x383bde['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xd93b('0x35'));}if(_0x5db358['limit'])_0x383bde['limit'](_0x5db358[_0xd93b('0x23')]);if(_0x5db358[_0xd93b('0x25')])_0x383bde[_0xd93b('0x25')](_0x5db358[_0xd93b('0x25')]);return db[_0xd93b('0x96')][_0xd93b('0x41')](_0x383bde[_0xd93b('0x97')](),_0x4705c8);})[_0xd93b('0x2c')](function(_0x50f64e){if(_0x50f64e[_0xd93b('0x45')]>0x0)_0x9cb202[_0xd93b('0x4a')](_0xd93b('0xab'),_[_0xd93b('0x33')](_0x50f64e,'id'));return db[_0xd93b('0x96')]['query'](_0x9cb202[_0xd93b('0x97')](),_0x4705c8)[_0xd93b('0x2c')](function(_0x571856){var _0x57259e=_[_0xd93b('0xac')](_0x571856,'OpenchannelInteractionId');var _0x1450a2=[];_0x50f64e[_0xd93b('0x38')](function(_0x5bd4c9){_0x1450a2[_0xd93b('0x39')](updateOpenchannelInteraction(_0x5bd4c9,_0x21d697,_0x57259e));});return BPromise[_0xd93b('0xad')](_0x1450a2);});});})[_0xd93b('0x2c')](function(_0x525422){_0x67ccfc['rows']=_0x525422;return _0x67ccfc;})[_0xd93b('0x2c')](respondWithFilteredResult(_0x1ba391,_0x5db358))[_0xd93b('0xae')](handleError(_0x1ba391,null));};exports[_0xd93b('0xaf')]=function(_0x4490a0,_0xad199){var _0xfbf01f={};if(_0x4490a0['query'][_0xd93b('0x3d')]&&_0x4490a0['query']['type']===_0xd93b('0x50')){_0xfbf01f['from']=_0x4490a0[_0xd93b('0xb0')]['id'];}else{_0xfbf01f['id']=_0x4490a0[_0xd93b('0xb0')]['id'];}var _0x4b0447={'raw':![],'where':_0xfbf01f},_0x5d108f={};_0x5d108f[_0xd93b('0x3f')]=_[_0xd93b('0x40')](db[_0xd93b('0x3b')]['rawAttributes']);_0x5d108f[_0xd93b('0x41')]=_[_0xd93b('0x40')](_0x4490a0['query']);_0x5d108f[_0xd93b('0x4b')]=_['intersection'](_0x5d108f['model'],_0x5d108f['query']);_0x4b0447[_0xd93b('0x43')]=_['intersection'](_0x5d108f[_0xd93b('0x3f')],qs['fields'](_0x4490a0['query'][_0xd93b('0x44')]));_0x4b0447['attributes']=_0x4b0447[_0xd93b('0x43')][_0xd93b('0x45')]?_0x4b0447[_0xd93b('0x43')]:_0x5d108f[_0xd93b('0x3f')];if(_0x4490a0[_0xd93b('0x41')][_0xd93b('0xb1')]){_0x4b0447[_0xd93b('0xb2')]=[{'all':!![]}];}_0x4b0447=_[_0xd93b('0x99')]({},_0x4b0447,_0x4490a0['options']);return db[_0xd93b('0x3b')]['find'](_0x4b0447)[_0xd93b('0x2c')](handleEntityNotFound(_0xad199,null))[_0xd93b('0x2c')](respondWithResult(_0xad199,null))['catch'](handleError(_0xad199,null));};exports[_0xd93b('0xb3')]=function(_0x30d09d,_0x1482b1){return db['OpenchannelInteraction'][_0xd93b('0xb3')](_0x30d09d[_0xd93b('0xb4')],{})[_0xd93b('0x2c')](respondWithResult(_0x1482b1,0xc9))[_0xd93b('0xae')](handleError(_0x1482b1,null));};exports['update']=function(_0x409de2,_0x1b5c0c){if(_0x409de2[_0xd93b('0xb4')]['id']){delete _0x409de2[_0xd93b('0xb4')]['id'];}return db['OpenchannelInteraction'][_0xd93b('0x6b')]({'where':{'id':_0x409de2['params']['id']}})[_0xd93b('0x2c')](handleEntityNotFound(_0x1b5c0c,null))['then'](saveUpdates(_0x409de2[_0xd93b('0xb4')],null))[_0xd93b('0x2c')](respondWithResult(_0x1b5c0c,null))['catch'](handleError(_0x1b5c0c,null));};exports['destroy']=function(_0x45ff1d,_0x48ca31){return db[_0xd93b('0x3b')][_0xd93b('0x6b')]({'where':{'id':_0x45ff1d[_0xd93b('0xb0')]['id']}})[_0xd93b('0x2c')](handleEntityNotFound(_0x48ca31,null))[_0xd93b('0x2c')](removeEntity(_0x48ca31,null))[_0xd93b('0xae')](handleError(_0x48ca31,null));};exports[_0xd93b('0xb5')]=function(_0x41465d,_0x1a5381){return db[_0xd93b('0x3b')][_0xd93b('0xb5')]()[_0xd93b('0x2c')](respondWithResult(_0x1a5381,null))['catch'](handleError(_0x1a5381,null));};exports[_0xd93b('0xb6')]=function(_0x1f14fb,_0x5f0cef,_0xefbaf0){return db[_0xd93b('0xb7')][_0xd93b('0x6b')]({'where':{'id':_0x1f14fb['params']['id']}})['then'](handleEntityNotFound(_0x5f0cef,null))[_0xd93b('0x2c')](function(_0x55c1d0){if(_0x55c1d0){return _0x55c1d0[_0xd93b('0xb6')](_0x1f14fb[_0xd93b('0xb4')][_0xd93b('0xb8')],_[_0xd93b('0xb9')](_0x1f14fb[_0xd93b('0xb4')],['ids','id'])||{});}})[_0xd93b('0x2c')](respondWithResult(_0x5f0cef,null))[_0xd93b('0xae')](handleError(_0x5f0cef,null));};exports[_0xd93b('0xba')]=function(_0x218e36,_0x58918e,_0x46612d){var _0x4c6a52={'raw':![],'where':{}};var _0x1697b4={};var _0x37911d={'count':0x0,'rows':[]};return db[_0xd93b('0x3b')][_0xd93b('0xbb')]({'where':{'id':_0x218e36['params']['id']}})[_0xd93b('0x2c')](handleEntityNotFound(_0x58918e,null))[_0xd93b('0x2c')](function(_0x56203f){if(_0x56203f){_0x1697b4[_0xd93b('0x3f')]=_[_0xd93b('0x40')](db['OpenchannelMessage'][_0xd93b('0x3c')]);_0x1697b4[_0xd93b('0x41')]=_[_0xd93b('0x40')](_0x218e36[_0xd93b('0x41')]);_0x1697b4[_0xd93b('0x4b')]=_['intersection'](_0x1697b4[_0xd93b('0x3f')],_0x1697b4['query']);_0x4c6a52[_0xd93b('0x43')]=_[_0xd93b('0x42')](_0x1697b4[_0xd93b('0x3f')],qs[_0xd93b('0x44')](_0x218e36[_0xd93b('0x41')][_0xd93b('0x44')]));_0x4c6a52[_0xd93b('0x43')]=_0x4c6a52[_0xd93b('0x43')]['length']?_0x4c6a52[_0xd93b('0x43')]:_0x1697b4[_0xd93b('0x3f')];if(!_0x218e36[_0xd93b('0x41')]['hasOwnProperty'](_0xd93b('0x47'))){_0x4c6a52[_0xd93b('0x23')]=qs['limit'](_0x218e36[_0xd93b('0x41')][_0xd93b('0x23')]);_0x4c6a52[_0xd93b('0x25')]=qs[_0xd93b('0x25')](_0x218e36[_0xd93b('0x41')][_0xd93b('0x25')]);}_0x4c6a52['order']=qs[_0xd93b('0x49')](_0x218e36['query'][_0xd93b('0x49')]);_0x4c6a52[_0xd93b('0x4a')]=qs[_0xd93b('0x4b')](_[_0xd93b('0xbc')](_0x218e36[_0xd93b('0x41')],_0x1697b4[_0xd93b('0x4b')]));_0x4c6a52['where'][_0xd93b('0xbd')]=_0x56203f['id'];if(_0x218e36[_0xd93b('0x41')]['filter']){_0x4c6a52[_0xd93b('0x4a')]=_[_0xd93b('0x99')](_0x4c6a52['where'],{'$or':_[_0xd93b('0x33')](_0x4c6a52[_0xd93b('0x43')],function(_0x4f4ac0){var _0x1351c3={};_0x1351c3[_0x4f4ac0]={'$like':'%'+_0x218e36['query'][_0xd93b('0x82')]+'%'};return _0x1351c3;})});}if(_0x218e36[_0xd93b('0x41')]['$gte']){var _0x27818b=_0x218e36[_0xd93b('0x41')]['$gte'][_0xd93b('0x37')](',');var _0x272c2f={};_0x272c2f[_0x27818b[0x0]]={'$gte':moment(_0x27818b[0x1])['format'](_0xd93b('0xbe'))};_0x4c6a52[_0xd93b('0x4a')]=_[_0xd93b('0x99')](_0x4c6a52[_0xd93b('0x4a')],_0x272c2f);}_0x4c6a52=_[_0xd93b('0x99')]({},_0x4c6a52,_0x218e36[_0xd93b('0xbf')]);return db[_0xd93b('0xb7')][_0xd93b('0x24')]({'where':_0x4c6a52[_0xd93b('0x4a')]})[_0xd93b('0x2c')](function(_0x11c91f){_0x37911d['count']=_0x11c91f;if(_0x218e36[_0xd93b('0x41')]['includeAll']){_0x4c6a52[_0xd93b('0xb2')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xd93b('0xc0')](_0x4c6a52);})[_0xd93b('0x2c')](function(_0x1e5ec9){_0x37911d['rows']=_0x1e5ec9;return _0x37911d;});}})[_0xd93b('0x2c')](respondWithFilteredResult(_0x58918e,_0x4c6a52))[_0xd93b('0xae')](handleError(_0x58918e,null));};exports[_0xd93b('0xc1')]=function(_0x48675b,_0x1839e2,_0x493d47){return db[_0xd93b('0x3b')]['find']({'where':{'id':_0x48675b['params']['id']}})[_0xd93b('0x2c')](handleEntityNotFound(_0x1839e2,null))[_0xd93b('0x2c')](function(_0x2368b7){if(_0x2368b7){return _0x2368b7[_0xd93b('0xc2')](_0x48675b['body']['ids'],_[_0xd93b('0xb9')](_0x48675b[_0xd93b('0xb4')],['ids','id'])||{})[_0xd93b('0xc3')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0xd93b('0xc4')],'where':{'id':_0x48675b['body']['ids']}});})[_0xd93b('0x2c')](function(_0x52767b){socket[_0xd93b('0xc5')](_0xd93b('0xc6'),{'id':Number(_0x48675b[_0xd93b('0xb0')]['id']),'tags':_0x52767b||[]});return{'id':Number(_0x48675b[_0xd93b('0xb0')]['id']),'tags':_0x52767b||[]};});}})[_0xd93b('0x2c')](respondWithResult(_0x1839e2,null))[_0xd93b('0xae')](handleError(_0x1839e2,null));};exports[_0xd93b('0xc7')]=function(_0x2d12a6,_0x2822f1,_0x242230){return db[_0xd93b('0x3b')][_0xd93b('0x6b')]({'where':{'id':_0x2d12a6[_0xd93b('0xb0')]['id']}})['then'](handleEntityNotFound(_0x2822f1,null))[_0xd93b('0x2c')](function(_0x102699){if(_0x102699){return _0x102699['removeTags'](_0x2d12a6[_0xd93b('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x2822f1,null))['catch'](handleError(_0x2822f1,null));};exports['download']=function(_0xcccd45,_0x3b2aa3){var _0x2f0099=moment()[_0xd93b('0xc8')]()[_0xd93b('0x97')]();var _0x46c833=path['join'](config['root'],'server',_0xd93b('0xc9'),_0xd93b('0xca'));var _0x197170=path[_0xd93b('0xcb')](config[_0xd93b('0xcc')],_0xd93b('0xcd'),_0xd93b('0xc9'),_0xd93b('0xce'));var _0x2f24b6=path['join'](_0x46c833,_0x2f0099);var _0x22e033=util[_0xd93b('0xcf')](_0xd93b('0xd0'),_0xcccd45[_0xd93b('0xb0')]['id'],_0x2f0099);var _0x1bb034=path['join'](_0x46c833,_0x22e033);var _0x54e1bc=[];_0x54e1bc[_0xd93b('0x39')]({'model':db[_0xd93b('0xd1')],'as':_0xd93b('0xd1'),'attributes':['id',_0xd93b('0x34')],'raw':!![]});_0x54e1bc[_0xd93b('0x39')]({'model':db[_0xd93b('0xd2')],'as':_0xd93b('0x65'),'attributes':['id',_0xd93b('0xd3'),'lastName'],'raw':!![]});if(_0xcccd45[_0xd93b('0x41')][_0xd93b('0xce')]){_0x54e1bc[_0xd93b('0x39')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x1b91e5=[{'model':db[_0xd93b('0xb7')],'as':_0xd93b('0xd4'),'attributes':['id',_0xd93b('0xb4'),_0xd93b('0xd5'),_0xd93b('0xd6'),_0xd93b('0xd7'),_0xd93b('0x7e')],'include':_0x54e1bc}];_0x1b91e5['push']({'model':db[_0xd93b('0xd8')],'as':_0xd93b('0xd9'),'attributes':['id',_0xd93b('0x30')]});_0x1b91e5[_0xd93b('0x39')]({'model':db[_0xd93b('0xd1')],'as':'Owner','attributes':['id',_0xd93b('0x34')]});return db[_0xd93b('0x3b')][_0xd93b('0x6b')]({'where':{'id':_0xcccd45[_0xd93b('0xb0')]['id']},'include':_0x1b91e5})[_0xd93b('0x2c')](handleEntityNotFound(_0x3b2aa3,null))['then'](function(_0xfc2184){if(_0xfc2184){var _0x566e2c=_0xfc2184[_0xd93b('0xda')]({'plain':!![]});fs[_0xd93b('0xdb')](_0x2f24b6);var _0x221fe4={'channel':_0xd93b('0xdc'),'account':_0x566e2c[_0xd93b('0xd9')]['name'],'agent':_0x566e2c[_0xd93b('0xdd')]?_0x566e2c[_0xd93b('0xdd')][_0xd93b('0x34')]:'N.A.','createdAt':moment(_0x566e2c[_0xd93b('0xd5')])[_0xd93b('0xcf')](_0xd93b('0xbe'))[_0xd93b('0x97')](),'closedAt':_0x566e2c['closed']?moment(_0x566e2c[_0xd93b('0xde')])[_0xd93b('0xcf')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd93b('0x97')]():'','disposition':_0x566e2c['disposition'],'visibility':_0x566e2c['threadId']?_0xd93b('0xdf'):_0xd93b('0xe0'),'messages':_(_0x566e2c[_0xd93b('0xd4')])[_0xd93b('0x82')]({'secret':![]})[_0xd93b('0x33')](function(_0x2f0868){if(_0x2f0868[_0xd93b('0xe1')]){var _0x3fb9dd=path['join'](_0x197170,_0x2f0868[_0xd93b('0xe1')]['basename']);if(fs['existsSync'](_0x3fb9dd)){fs[_0xd93b('0xe2')](_0x3fb9dd)['pipe'](fs[_0xd93b('0xe3')](path[_0xd93b('0xcb')](_0x2f24b6,_0x2f0868[_0xd93b('0xe1')][_0xd93b('0xe4')])));}}return{'date':moment(_0x2f0868[_0xd93b('0xd5')])[_0xd93b('0xcf')](_0xd93b('0xbe'))[_0xd93b('0x97')](),'sender':_0x2f0868[_0xd93b('0xd6')]===_0xd93b('0xe5')?_0x2f0868['User']?_0x2f0868['User'][_0xd93b('0x34')]:_0xd93b('0xe6'):_0x2f0868[_0xd93b('0x65')][_0xd93b('0xd3')]+(_0x2f0868[_0xd93b('0x65')][_0xd93b('0xe7')]?'\x20'+_0x2f0868[_0xd93b('0x65')]['lastName']:''),'body':_0x2f0868[_0xd93b('0xe1')]?_0x2f0868[_0xd93b('0xe1')]['basename']:_0x2f0868[_0xd93b('0xb4')],'direction':_0x2f0868[_0xd93b('0xd6')]===_0xd93b('0xe5')?'A':'C','secret':_0x2f0868[_0xd93b('0xd7')],'read':_0x2f0868[_0xd93b('0x7e')],'attachment':_0x2f0868[_0xd93b('0xe1')]};})[_0xd93b('0x67')]()};return ejs['renderFile'](path['join'](config[_0xd93b('0xcc')],_0xd93b('0xcd'),_0xd93b('0xe8'),_0xd93b('0xe9')),{'interaction':_0x221fe4})['then'](function(_0x55efc6){var _0x2af99d=path[_0xd93b('0xcb')](_0x2f24b6,_0xd93b('0xea')+_0x566e2c['id']+'-'+_0x2f0099+_0xd93b('0xeb'));var _0x310e20={'path':_0x2af99d,'channel':_0xd93b('0xdc'),'interactionId':_0x566e2c['id']};return pdf[_0xd93b('0xec')](_0x55efc6,_0x310e20);})[_0xd93b('0x2c')](function(){return new BPromise(function(_0x326490,_0x46f5c2){zipdir(_0x2f24b6,{'saveTo':_0x1bb034},function(_0x529695,_0x351219){if(_0x529695)return _0x46f5c2(_0x529695);return _0x326490(_0x351219);});})[_0xd93b('0x2c')](function(){return new BPromise(function(_0x5e7efb,_0x4bf355){rimraf(_0x2f24b6,function(_0x21f9ad){if(_0x21f9ad)_0x4bf355(_0x21f9ad);return _0x5e7efb();});});})['then'](function(){return _0x3b2aa3[_0xd93b('0xed')](_0x1bb034,_0x22e033,function(_0x109b08){if(_0x109b08){console[_0xd93b('0xee')](_0xd93b('0xef'),_0x109b08);}else{fs[_0xd93b('0xf0')](_0x1bb034);}});});});}else{return _0x3b2aa3['sendStatus'](0xc8);}})[_0xd93b('0xae')](handleError(_0x3b2aa3,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 8999b2a..e12972b 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 _0x68f0=['OpenchannelMessage','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction'];(function(_0x8170f9,_0x5df0d3){var _0x5d4297=function(_0xe46a94){while(--_0xe46a94){_0x8170f9['push'](_0x8170f9['shift']());}};_0x5d4297(++_0x5df0d3);}(_0x68f0,0x1a6));var _0x068f=function(_0x5a7676,_0x1dd3b9){_0x5a7676=_0x5a7676-0x0;var _0x140d86=_0x68f0[_0x5a7676];return _0x140d86;};'use strict';var EventEmitter=require(_0x068f('0x0'));var OpenchannelInteraction=require(_0x068f('0x1'))['db'][_0x068f('0x2')];var OpenchannelMessage=require(_0x068f('0x1'))['db'][_0x068f('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x068f('0x4'),'afterDestroy':_0x068f('0x5')};function emitEvent(_0x24b735){return function(_0x5e5b76,_0x2d8b37,_0x1ff324){_0x5e5b76[_0x068f('0x6')]({'attributes':['id'],'raw':!![]})[_0x068f('0x7')](function(_0x4f70bd){_0x5e5b76[_0x068f('0x8')](_0x068f('0x9'),_0x4f70bd[_0x068f('0xa')](function(_0x2cc599){return{'id':_0x2cc599['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x5e5b76['id'],'direction':'in','read':![]},'raw':!![]});})[_0x068f('0x7')](function(_0x479f3e){_0x5e5b76[_0x068f('0x8')](_0x068f('0xb'),_0x479f3e[_0x068f('0xc')]);OpenchannelInteractionEvents[_0x068f('0xd')](_0x24b735+':'+_0x5e5b76['id'],_0x5e5b76);OpenchannelInteractionEvents['emit'](_0x24b735,_0x5e5b76);_0x1ff324(null);})[_0x068f('0xe')](_0x1ff324(null));};}for(var e in events){if(events[_0x068f('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x068f('0x10')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x6e2f=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','Users','findAll'];(function(_0x4b173a,_0x5a557a){var _0x518cb1=function(_0x3a52a9){while(--_0x3a52a9){_0x4b173a['push'](_0x4b173a['shift']());}};_0x518cb1(++_0x5a557a);}(_0x6e2f,0xff));var _0xf6e2=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x6e2f[_0x1035c1];return _0x308d67;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xf6e2('0x0'))['db'][_0xf6e2('0x1')];var OpenchannelMessage=require(_0xf6e2('0x0'))['db'][_0xf6e2('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xf6e2('0x3')](0x0);var events={'afterCreate':_0xf6e2('0x4'),'afterUpdate':_0xf6e2('0x5'),'afterDestroy':_0xf6e2('0x6')};function emitEvent(_0x4e32f8){return function(_0x3af0b2,_0x24ee5d,_0x130528){_0x3af0b2[_0xf6e2('0x7')]({'attributes':['id'],'raw':!![]})[_0xf6e2('0x8')](function(_0x395bfc){_0x3af0b2['setDataValue'](_0xf6e2('0x9'),_0x395bfc['map'](function(_0x577820){return{'id':_0x577820['id']};}));return OpenchannelMessage[_0xf6e2('0xa')]({'where':{'OpenchannelInteractionId':_0x3af0b2['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf6e2('0x8')](function(_0xb568f9){_0x3af0b2[_0xf6e2('0xb')](_0xf6e2('0xc'),_0xb568f9[_0xf6e2('0xd')]);OpenchannelInteractionEvents['emit'](_0x4e32f8+':'+_0x3af0b2['id'],_0x3af0b2);OpenchannelInteractionEvents[_0xf6e2('0xe')](_0x4e32f8,_0x3af0b2);_0x130528(null);})[_0xf6e2('0xf')](_0x130528(null));};}for(var e in events){if(events[_0xf6e2('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xf6e2('0x11')](e,emitEvent(event));}}module[_0xf6e2('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index c1ca873..9e5e022 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 _0x8375=['closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelInteraction'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x8375,0xa8));var _0x5837=function(_0xee39bc,_0x3ec3e6){_0xee39bc=_0xee39bc-0x0;var _0x5f1b43=_0x8375[_0xee39bc];return _0x5f1b43;};'use strict';var _=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var logger=require(_0x5837('0x2'))('api');var moment=require(_0x5837('0x3'));var BPromise=require(_0x5837('0x4'));var rp=require(_0x5837('0x5'));var fs=require('fs');var path=require(_0x5837('0x6'));var rimraf=require(_0x5837('0x7'));var config=require(_0x5837('0x8'));var attributes=require('./openchannelInteraction.attributes');module[_0x5837('0x9')]=function(_0x19491e,_0x365da3){return _0x19491e[_0x5837('0xa')](_0x5837('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x508caf,_0x1e44c4,_0x6c5828){if(_0x508caf['changed'](_0x5837('0xc'))){_0x508caf['closedAt']=moment()[_0x5837('0xd')](_0x5837('0xe'));}_0x6c5828(null,_0x508caf);}}});}; \ No newline at end of file +var _0xd8b1=['api','moment','request-promise','path','../../config/environment','OpenchannelInteraction','openchannel_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8b1,0x105));var _0x1d8b=function(_0x5367b5,_0x5da04c){_0x5367b5=_0x5367b5-0x0;var _0x312928=_0xd8b1[_0x5367b5];return _0x312928;};'use strict';var _=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var logger=require(_0x1d8b('0x2'))(_0x1d8b('0x3'));var moment=require(_0x1d8b('0x4'));var BPromise=require('bluebird');var rp=require(_0x1d8b('0x5'));var fs=require('fs');var path=require(_0x1d8b('0x6'));var rimraf=require('rimraf');var config=require(_0x1d8b('0x7'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x4d5ba0,_0x27534c){return _0x4d5ba0['define'](_0x1d8b('0x8'),attributes,{'tableName':_0x1d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b28e2,_0x4480cf,_0x51438a){if(_0x2b28e2['changed'](_0x1d8b('0xa'))){_0x2b28e2['closedAt']=moment()['format'](_0x1d8b('0xb'));}_0x51438a(null,_0x2b28e2);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 614445f..bb8c8fe 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 _0xf577=['socket.io-emitter','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','OpenchannelInteraction','update','body','options','raw','where','limit','UpdateOpenchannelInteraction','debug','stringify','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf577,0x142));var _0x7f57=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xf577[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x7f57('0x0'));var util=require('util');var moment=require(_0x7f57('0x1'));var BPromise=require('bluebird');var rs=require(_0x7f57('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f57('0x3'))['db'];var utils=require(_0x7f57('0x4'));var logger=require(_0x7f57('0x5'))(_0x7f57('0x6'));var config=require(_0x7f57('0x7'));var jayson=require(_0x7f57('0x8'));var client=jayson[_0x7f57('0x9')][_0x7f57('0xa')]({'port':0x232a});config['redis']=_[_0x7f57('0xb')](config[_0x7f57('0xc')],{'host':_0x7f57('0xd'),'port':0x18eb});var socket=require(_0x7f57('0xe'))(new Redis(config[_0x7f57('0xc')]));require('./openchannelInteraction.socket')[_0x7f57('0xf')](socket);function respondWithRpcPromise(_0x2a5cf2,_0x3379d7,_0x146643){return new BPromise(function(_0x46efe7,_0x170170){return client[_0x7f57('0x10')](_0x2a5cf2,_0x146643)[_0x7f57('0x11')](function(_0x1e6e2f){logger['info'](_0x7f57('0x12'),_0x3379d7,_0x7f57('0x13'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x3379d7,'request\x20sent',JSON['stringify'](_0x1e6e2f));if(_0x1e6e2f['error']){if(_0x1e6e2f[_0x7f57('0x14')][_0x7f57('0x15')]===0x1f4){logger[_0x7f57('0x14')](_0x7f57('0x12'),_0x3379d7,_0x1e6e2f[_0x7f57('0x14')][_0x7f57('0x16')]);return _0x170170(_0x1e6e2f[_0x7f57('0x14')]['message']);}logger[_0x7f57('0x14')](_0x7f57('0x12'),_0x3379d7,_0x1e6e2f['error'][_0x7f57('0x16')]);return _0x46efe7(_0x1e6e2f[_0x7f57('0x14')]['message']);}else{logger[_0x7f57('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3379d7,_0x7f57('0x13'));_0x46efe7(_0x1e6e2f[_0x7f57('0x18')]['message']);}})[_0x7f57('0x19')](function(_0x168847){logger[_0x7f57('0x14')](_0x7f57('0x12'),_0x3379d7,_0x168847);_0x170170(_0x168847);});});}exports['UpdateOpenchannelInteraction']=function(_0x51e594){var _0x42d3ff=this;return new Promise(function(_0x2957e7,_0x95a1e2){return db[_0x7f57('0x1a')][_0x7f57('0x1b')](_0x51e594[_0x7f57('0x1c')],{'raw':_0x51e594['options']?_0x51e594[_0x7f57('0x1d')][_0x7f57('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51e594[_0x7f57('0x1d')]?_0x51e594['options'][_0x7f57('0x1f')]||null:null,'attributes':_0x51e594[_0x7f57('0x1d')]?_0x51e594[_0x7f57('0x1d')]['attributes']||null:null,'limit':_0x51e594[_0x7f57('0x1d')]?_0x51e594[_0x7f57('0x1d')][_0x7f57('0x20')]||null:null})[_0x7f57('0x11')](function(_0x37ff1b){logger[_0x7f57('0x17')](_0x7f57('0x21'),_0x51e594);logger[_0x7f57('0x22')](_0x7f57('0x21'),_0x51e594,JSON[_0x7f57('0x23')](_0x37ff1b));_0x2957e7(_0x37ff1b);})[_0x7f57('0x19')](function(_0x16376b){logger[_0x7f57('0x14')](_0x7f57('0x21'),_0x16376b['message'],_0x51e594);_0x95a1e2(_0x42d3ff[_0x7f57('0x14')](0x1f4,_0x16376b[_0x7f57('0x16')]));});});};exports[_0x7f57('0x24')]=function(_0x2bf2b0){return new Promise(function(_0x41cffc,_0x2d57a8){return db[_0x7f57('0x1a')][_0x7f57('0x25')]({'where':_0x2bf2b0[_0x7f57('0x1d')]?_0x2bf2b0[_0x7f57('0x1d')][_0x7f57('0x1f')]||null:null})[_0x7f57('0x11')](function(_0xa73712){if(_0xa73712){return _0xa73712[_0x7f57('0x26')](_0x2bf2b0[_0x7f57('0x1c')][_0x7f57('0x27')],_[_0x7f57('0x28')](_0x2bf2b0['body'],['ids','id'])||{});}})['spread'](function(_0x20502f){logger[_0x7f57('0x17')]('AddTags',_0x2bf2b0);logger[_0x7f57('0x22')](_0x7f57('0x29'),_0x2bf2b0,JSON[_0x7f57('0x23')](_0x20502f));_0x41cffc(_0x20502f);})[_0x7f57('0x19')](function(_0xc107ac){logger[_0x7f57('0x14')](_0x7f57('0x29'),_0xc107ac[_0x7f57('0x16')],_0x2bf2b0);_0x2d57a8(_this[_0x7f57('0x14')](0x1f4,_0xc107ac[_0x7f57('0x16')]));});});}; \ No newline at end of file +var _0xe72e=['stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x50f452,_0x14a00c){var _0x2804f3=function(_0x245cbe){while(--_0x245cbe){_0x50f452['push'](_0x50f452['shift']());}};_0x2804f3(++_0x14a00c);}(_0xe72e,0x1e3));var _0xee72=function(_0x6bd42c,_0x2e2373){_0x6bd42c=_0x6bd42c-0x0;var _0x49de77=_0xe72e[_0x6bd42c];return _0x49de77;};'use strict';var _=require('lodash');var util=require(_0xee72('0x0'));var moment=require(_0xee72('0x1'));var BPromise=require(_0xee72('0x2'));var rs=require(_0xee72('0x3'));var fs=require('fs');var Redis=require(_0xee72('0x4'));var db=require(_0xee72('0x5'))['db'];var utils=require(_0xee72('0x6'));var logger=require('../../config/logger')(_0xee72('0x7'));var config=require(_0xee72('0x8'));var jayson=require(_0xee72('0x9'));var client=jayson[_0xee72('0xa')][_0xee72('0xb')]({'port':0x232a});config[_0xee72('0xc')]=_[_0xee72('0xd')](config[_0xee72('0xc')],{'host':_0xee72('0xe'),'port':0x18eb});var socket=require(_0xee72('0xf'))(new Redis(config[_0xee72('0xc')]));require(_0xee72('0x10'))[_0xee72('0x11')](socket);function respondWithRpcPromise(_0xfb894a,_0x321ac1,_0xfc9594){return new BPromise(function(_0x12449f,_0x15341d){return client[_0xee72('0x12')](_0xfb894a,_0xfc9594)[_0xee72('0x13')](function(_0x3e5fdf){logger[_0xee72('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x321ac1,_0xee72('0x15'));logger['debug'](_0xee72('0x16'),_0x321ac1,'request\x20sent',JSON[_0xee72('0x17')](_0x3e5fdf));if(_0x3e5fdf[_0xee72('0x18')]){if(_0x3e5fdf[_0xee72('0x18')][_0xee72('0x19')]===0x1f4){logger[_0xee72('0x18')](_0xee72('0x1a'),_0x321ac1,_0x3e5fdf['error'][_0xee72('0x1b')]);return _0x15341d(_0x3e5fdf[_0xee72('0x18')][_0xee72('0x1b')]);}logger[_0xee72('0x18')](_0xee72('0x1a'),_0x321ac1,_0x3e5fdf[_0xee72('0x18')]['message']);return _0x12449f(_0x3e5fdf['error']['message']);}else{logger[_0xee72('0x14')](_0xee72('0x1a'),_0x321ac1,_0xee72('0x15'));_0x12449f(_0x3e5fdf[_0xee72('0x1c')][_0xee72('0x1b')]);}})[_0xee72('0x1d')](function(_0x369227){logger[_0xee72('0x18')](_0xee72('0x1a'),_0x321ac1,_0x369227);_0x15341d(_0x369227);});});}exports[_0xee72('0x1e')]=function(_0x2ea291){var _0x38b2c6=this;return new Promise(function(_0x3239cc,_0x545abd){return db['OpenchannelInteraction'][_0xee72('0x1f')](_0x2ea291[_0xee72('0x20')],{'raw':_0x2ea291[_0xee72('0x21')]?_0x2ea291['options'][_0xee72('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ea291[_0xee72('0x21')]?_0x2ea291['options'][_0xee72('0x23')]||null:null,'attributes':_0x2ea291[_0xee72('0x21')]?_0x2ea291[_0xee72('0x21')][_0xee72('0x24')]||null:null,'limit':_0x2ea291[_0xee72('0x21')]?_0x2ea291[_0xee72('0x21')][_0xee72('0x25')]||null:null})['then'](function(_0x27f030){logger[_0xee72('0x14')](_0xee72('0x1e'),_0x2ea291);logger[_0xee72('0x26')](_0xee72('0x1e'),_0x2ea291,JSON[_0xee72('0x17')](_0x27f030));_0x3239cc(_0x27f030);})[_0xee72('0x1d')](function(_0x50cfbe){logger[_0xee72('0x18')](_0xee72('0x1e'),_0x50cfbe[_0xee72('0x1b')],_0x2ea291);_0x545abd(_0x38b2c6['error'](0x1f4,_0x50cfbe['message']));});});};exports[_0xee72('0x27')]=function(_0x291bd2){return new Promise(function(_0x523b00,_0x4c23c2){return db[_0xee72('0x28')][_0xee72('0x29')]({'where':_0x291bd2[_0xee72('0x21')]?_0x291bd2['options']['where']||null:null})[_0xee72('0x13')](function(_0x34fd68){if(_0x34fd68){return _0x34fd68[_0xee72('0x2a')](_0x291bd2['body'][_0xee72('0x2b')],_['omit'](_0x291bd2[_0xee72('0x20')],[_0xee72('0x2b'),'id'])||{});}})[_0xee72('0x2c')](function(_0x10c15b){logger[_0xee72('0x14')]('AddTags',_0x291bd2);logger[_0xee72('0x26')]('AddTags',_0x291bd2,JSON['stringify'](_0x10c15b));_0x523b00(_0x10c15b);})[_0xee72('0x1d')](function(_0x438221){logger[_0xee72('0x18')](_0xee72('0x2d'),_0x438221[_0xee72('0x1b')],_0x291bd2);_0x4c23c2(_this['error'](0x1f4,_0x438221[_0xee72('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 68a1115..ff5ec6c 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 _0xd162=['update','emit','removeListener','register','length','openchannelInteraction:','save','remove'];(function(_0x460c04,_0x2ed2e2){var _0x51bd63=function(_0x4db764){while(--_0x4db764){_0x460c04['push'](_0x460c04['shift']());}};_0x51bd63(++_0x2ed2e2);}(_0xd162,0xd6));var _0x2d16=function(_0x1bf611,_0x5a169b){_0x1bf611=_0x1bf611-0x0;var _0x46c450=_0xd162[_0x1bf611];return _0x46c450;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x2d16('0x0'),_0x2d16('0x1'),_0x2d16('0x2')];function createListener(_0x1b591a,_0x3b4602){return function(_0x1a5ee4){_0x3b4602[_0x2d16('0x3')](_0x1b591a,_0x1a5ee4);};}function removeListener(_0x182355,_0x4718e4){return function(){OpenchannelInteractionEvents[_0x2d16('0x4')](_0x182355,_0x4718e4);};}exports[_0x2d16('0x5')]=function(_0x5552e8){for(var _0x117933=0x0,_0x4a594d=events[_0x2d16('0x6')];_0x117933<_0x4a594d;_0x117933++){var _0x41f083=events[_0x117933];var _0x2ce755=createListener(_0x2d16('0x7')+_0x41f083,_0x5552e8);OpenchannelInteractionEvents['on'](_0x41f083,_0x2ce755);}}; \ No newline at end of file +var _0x95b7=['register','length','openchannelInteraction:','./openchannelInteraction.events','remove','update','removeListener'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x95b7,0x1e6));var _0x795b=function(_0x284bc3,_0x22dffe){_0x284bc3=_0x284bc3-0x0;var _0x41ac81=_0x95b7[_0x284bc3];return _0x41ac81;};'use strict';var OpenchannelInteractionEvents=require(_0x795b('0x0'));var events=['save',_0x795b('0x1'),_0x795b('0x2')];function createListener(_0x2b6cc6,_0x3974d5){return function(_0x12bb6e){_0x3974d5['emit'](_0x2b6cc6,_0x12bb6e);};}function removeListener(_0x17d70e,_0x5ed154){return function(){OpenchannelInteractionEvents[_0x795b('0x3')](_0x17d70e,_0x5ed154);};}exports[_0x795b('0x4')]=function(_0x2c7637){for(var _0x17b7a3=0x0,_0x5d66ae=events[_0x795b('0x5')];_0x17b7a3<_0x5d66ae;_0x17b7a3++){var _0x5e369c=events[_0x17b7a3];var _0x181109=createListener(_0x795b('0x6')+_0x5e369c,_0x2c7637);OpenchannelInteractionEvents['on'](_0x5e369c,_0x181109);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index f26a1df..bfb6444 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 _0xfbd6=['connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','openchannelmessage:create','create','put','/:id/accept','accept','delete','exports','multer','util','path'];(function(_0x51e1bd,_0x351e1a){var _0x2e6401=function(_0x35fd1f){while(--_0x35fd1f){_0x51e1bd['push'](_0x51e1bd['shift']());}};_0x2e6401(++_0x351e1a);}(_0xfbd6,0x1b2));var _0x6fbd=function(_0x3f91a3,_0x1d07fc){_0x3f91a3=_0x3f91a3-0x0;var _0x534712=_0xfbd6[_0x3f91a3];return _0x534712;};'use strict';var multer=require(_0x6fbd('0x0'));var util=require(_0x6fbd('0x1'));var path=require(_0x6fbd('0x2'));var timeout=require(_0x6fbd('0x3'));var express=require('express');var router=express[_0x6fbd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6fbd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6fbd('0x6'));var controller=require(_0x6fbd('0x7'));router[_0x6fbd('0x8')]('/',auth[_0x6fbd('0x9')](),controller['index']);router[_0x6fbd('0x8')](_0x6fbd('0xa'),auth[_0x6fbd('0x9')](),controller[_0x6fbd('0xb')]);router[_0x6fbd('0x8')](_0x6fbd('0xc'),auth[_0x6fbd('0x9')](),controller[_0x6fbd('0xd')]);router[_0x6fbd('0xe')]('/',auth[_0x6fbd('0x9')](),interaction[_0x6fbd('0xf')]('openchannel',_0x6fbd('0x10')),controller[_0x6fbd('0x11')]);router[_0x6fbd('0x12')](_0x6fbd('0xc'),auth[_0x6fbd('0x9')](),controller['update']);router[_0x6fbd('0x12')](_0x6fbd('0x13'),auth[_0x6fbd('0x9')](),controller[_0x6fbd('0x14')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x6fbd('0x15')](_0x6fbd('0xc'),auth[_0x6fbd('0x9')](),controller['destroy']);module[_0x6fbd('0x16')]=router; \ No newline at end of file +var _0xb282=['accept','reject','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','show','post','tracked','openchannel','openchannelmessage:create','put','/:id','update','/:id/accept'];(function(_0x270c9e,_0x3c629f){var _0x5b3000=function(_0x20032e){while(--_0x20032e){_0x270c9e['push'](_0x270c9e['shift']());}};_0x5b3000(++_0x3c629f);}(_0xb282,0xad));var _0x2b28=function(_0x713076,_0x20c1e7){_0x713076=_0x713076-0x0;var _0x1dabdd=_0xb282[_0x713076];return _0x1dabdd;};'use strict';var multer=require(_0x2b28('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2b28('0x1'));var express=require(_0x2b28('0x2'));var router=express[_0x2b28('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2b28('0x4'));var interaction=require(_0x2b28('0x5'));var config=require(_0x2b28('0x6'));var controller=require('./openchannelMessage.controller');router[_0x2b28('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2b28('0x8'),auth[_0x2b28('0x9')](),controller['describe']);router[_0x2b28('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x2b28('0xa')]);router[_0x2b28('0xb')]('/',auth[_0x2b28('0x9')](),interaction[_0x2b28('0xc')](_0x2b28('0xd'),_0x2b28('0xe')),controller['create']);router[_0x2b28('0xf')](_0x2b28('0x10'),auth[_0x2b28('0x9')](),controller[_0x2b28('0x11')]);router[_0x2b28('0xf')](_0x2b28('0x12'),auth[_0x2b28('0x9')](),controller[_0x2b28('0x13')]);router['put']('/:id/reject',auth[_0x2b28('0x9')](),controller[_0x2b28('0x14')]);router[_0x2b28('0x15')]('/:id',auth[_0x2b28('0x9')](),controller[_0x2b28('0x16')]);module[_0x2b28('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 7c58174..a0ff4a1 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 _0x2c9f=['ENUM','out','STRING','TEXT','sequelize','medium','BOOLEAN'];(function(_0xd1f854,_0x532346){var _0x548294=function(_0x4be823){while(--_0x4be823){_0xd1f854['push'](_0xd1f854['shift']());}};_0x548294(++_0x532346);}(_0x2c9f,0x1ee));var _0xf2c9=function(_0x1d5292,_0x1d2c55){_0x1d5292=_0x1d5292-0x0;var _0xb24ca=_0x2c9f[_0x1d5292];return _0xb24ca;};'use strict';var Sequelize=require(_0xf2c9('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xf2c9('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf2c9('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf2c9('0x3')]('in','out'),'defaultValue':_0xf2c9('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xf2c9('0x5')]},'providerResponse':{'type':Sequelize[_0xf2c9('0x6')]}}; \ No newline at end of file +var _0x4d10=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x441db1,_0x584d2e){var _0x3a7957=function(_0x94b8e){while(--_0x94b8e){_0x441db1['push'](_0x441db1['shift']());}};_0x3a7957(++_0x584d2e);}(_0x4d10,0x14e));var _0x04d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d10[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x04d1('0x0'));module[_0x04d1('0x1')]={'body':{'type':Sequelize[_0x04d1('0x2')](_0x04d1('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x04d1('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x04d1('0x5')]('in',_0x04d1('0x6')),'defaultValue':_0x04d1('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x04d1('0x7')]},'providerName':{'type':Sequelize[_0x04d1('0x8')]},'providerResponse':{'type':Sequelize[_0x04d1('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 46f98c2..490be7b 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 _0xe706=['YYYY-MM-DD\x20HH:mm:ss','UserId','agent','CmContact','Contact','OpenchannelInteractionId','isNil','read1stAt','format','interaction','get','user','role','AcceptMessage','acceptMessage','push','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','manual','interface','SIP/%s','channel','event','EventManager','openchannel','rejectMessage','startsWith','cf_','SELECT','reject','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','end','stack','name','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','OpenchannelMessage','includeAll','findAll','rows','params','include','find','create','body','describe','openchannel-interactions','accept','read'];(function(_0x4850d6,_0x5864a2){var _0x489b7c=function(_0x9d0621){while(--_0x9d0621){_0x4850d6['push'](_0x4850d6['shift']());}};_0x489b7c(++_0x5864a2);}(_0xe706,0xa3));var _0x6e70=function(_0x48105b,_0x266487){_0x48105b=_0x48105b-0x0;var _0x1ca419=_0xe706[_0x48105b];return _0x1ca419;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));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('0xa'));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 licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];config[_0x6e70('0x1d')]=_[_0x6e70('0x1e')](config[_0x6e70('0x1d')],{'host':_0x6e70('0x1f'),'port':0x18eb});var socket=require(_0x6e70('0x20'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x6e70('0x21'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x6e70('0x22')][_0x6e70('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x5d9263,_0x24f3ac,_0x5c3fe7,_0x2efc0f){return new BPromise(function(_0x161f23,_0x4ca554){var _0x49029f=_0x2efc0f||client;return _0x49029f[_0x6e70('0x24')](_0x5d9263,_0x5c3fe7)['then'](function(_0x28a21f){logger[_0x6e70('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x24f3ac,'request\x20sent');logger[_0x6e70('0x26')](_0x6e70('0x27'),_0x24f3ac,_0x6e70('0x28'),JSON[_0x6e70('0x29')](_0x28a21f));if(_0x28a21f[_0x6e70('0x2a')]){if(_0x28a21f[_0x6e70('0x2a')][_0x6e70('0x2b')]===0x1f4){logger[_0x6e70('0x2a')](_0x6e70('0x2c'),_0x24f3ac,_0x28a21f[_0x6e70('0x2a')]['message']);return _0x4ca554(_0x28a21f[_0x6e70('0x2a')][_0x6e70('0x2d')]);}logger[_0x6e70('0x2a')]('OpenchannelMessage,\x20%s,\x20%s',_0x24f3ac,_0x28a21f[_0x6e70('0x2a')][_0x6e70('0x2d')]);return _0x161f23(_0x28a21f[_0x6e70('0x2a')]['message']);}else{logger[_0x6e70('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x24f3ac,'request\x20sent');_0x161f23(_0x28a21f['result'][_0x6e70('0x2d')]);}})[_0x6e70('0x2e')](function(_0x51d292){logger[_0x6e70('0x2a')](_0x6e70('0x2c'),_0x24f3ac,_0x51d292);_0x4ca554(_0x51d292);});});}function respondWithStatusCode(_0x5f268f,_0x338ad6){_0x338ad6=_0x338ad6||0xcc;return function(_0x67fb43){if(_0x67fb43){return _0x5f268f[_0x6e70('0x2f')](_0x338ad6);}return _0x5f268f['status'](_0x338ad6)['end']();};}function respondWithResult(_0x2c4d37,_0x3af17f){_0x3af17f=_0x3af17f||0xc8;return function(_0x83c836){if(_0x83c836){return _0x2c4d37[_0x6e70('0x30')](_0x3af17f)[_0x6e70('0x31')](_0x83c836);}};}function respondWithFilteredResult(_0x5d772a,_0x1952ea){return function(_0x406f29){if(_0x406f29){var _0xecf336=typeof _0x1952ea[_0x6e70('0x32')]===_0x6e70('0x33')&&typeof _0x1952ea[_0x6e70('0x34')]===_0x6e70('0x33');var _0x24114a=_0x406f29[_0x6e70('0x35')];var _0x3a5d30=_0xecf336?0x0:_0x1952ea['offset'];var _0x1b27d8=_0xecf336?_0x406f29['count']:_0x1952ea[_0x6e70('0x32')]+_0x1952ea['limit'];var _0xdd7cc1;if(_0x1b27d8>=_0x24114a){_0x1b27d8=_0x24114a;_0xdd7cc1=0xc8;}else{_0xdd7cc1=0xce;}_0x5d772a[_0x6e70('0x30')](_0xdd7cc1);return _0x5d772a[_0x6e70('0x36')]('Content-Range',_0x3a5d30+'-'+_0x1b27d8+'/'+_0x24114a)[_0x6e70('0x31')](_0x406f29);}return null;};}function patchUpdates(_0x42b094){return function(_0x5780a1){try{jsonpatch[_0x6e70('0x37')](_0x5780a1,_0x42b094,!![]);}catch(_0x154925){return BPromise['reject'](_0x154925);}return _0x5780a1[_0x6e70('0x38')]();};}function saveUpdates(_0x3665a1,_0x2d52bd){return function(_0x2723d7){if(_0x2723d7){return _0x2723d7[_0x6e70('0x39')](_0x3665a1)[_0x6e70('0x3a')](function(_0x44b19d){return _0x44b19d;});}return null;};}function removeEntity(_0x3f42bd,_0xf146fd){return function(_0x419a41){if(_0x419a41){return _0x419a41['destroy']()[_0x6e70('0x3a')](function(){_0x3f42bd['status'](0xcc)[_0x6e70('0x3b')]();});}};}function handleEntityNotFound(_0x3222a2,_0x98c683){return function(_0x32d12d){if(!_0x32d12d){_0x3222a2[_0x6e70('0x2f')](0x194);}return _0x32d12d;};}function handleError(_0x989b80,_0x2440be){_0x2440be=_0x2440be||0x1f4;return function(_0xdd0bee){logger[_0x6e70('0x2a')](_0xdd0bee[_0x6e70('0x3c')]);if(_0xdd0bee[_0x6e70('0x3d')]){delete _0xdd0bee[_0x6e70('0x3d')];}_0x989b80[_0x6e70('0x30')](_0x2440be)['send'](_0xdd0bee);};}exports['index']=function(_0x5424eb,_0x155a46){var _0x3841a0={},_0x2cb5b0={},_0x1f6955={'count':0x0,'rows':[]};var _0x1872e9=_[_0x6e70('0x3e')](db['OpenchannelMessage'][_0x6e70('0x3f')],function(_0x9e7ad2){return{'name':_0x9e7ad2[_0x6e70('0x40')],'type':_0x9e7ad2[_0x6e70('0x41')][_0x6e70('0x42')]};});_0x2cb5b0[_0x6e70('0x43')]=_[_0x6e70('0x3e')](_0x1872e9,_0x6e70('0x3d'));_0x2cb5b0['query']=_[_0x6e70('0x44')](_0x5424eb[_0x6e70('0x45')]);_0x2cb5b0[_0x6e70('0x46')]=_[_0x6e70('0x47')](_0x2cb5b0[_0x6e70('0x43')],_0x2cb5b0[_0x6e70('0x45')]);_0x3841a0[_0x6e70('0x48')]=_['intersection'](_0x2cb5b0['model'],qs['fields'](_0x5424eb[_0x6e70('0x45')][_0x6e70('0x49')]));_0x3841a0[_0x6e70('0x48')]=_0x3841a0[_0x6e70('0x48')][_0x6e70('0x4a')]?_0x3841a0['attributes']:_0x2cb5b0[_0x6e70('0x43')];if(!_0x5424eb[_0x6e70('0x45')][_0x6e70('0x4b')]('nolimit')){_0x3841a0['limit']=qs['limit'](_0x5424eb[_0x6e70('0x45')]['limit']);_0x3841a0[_0x6e70('0x32')]=qs[_0x6e70('0x32')](_0x5424eb[_0x6e70('0x45')][_0x6e70('0x32')]);}_0x3841a0['order']=qs[_0x6e70('0x4c')](_0x5424eb['query'][_0x6e70('0x4c')]);_0x3841a0[_0x6e70('0x4d')]=qs[_0x6e70('0x46')](_[_0x6e70('0x4e')](_0x5424eb['query'],_0x2cb5b0[_0x6e70('0x46')]),_0x1872e9);if(_0x5424eb[_0x6e70('0x45')][_0x6e70('0x4f')]){_0x3841a0[_0x6e70('0x4d')]=_[_0x6e70('0x50')](_0x3841a0[_0x6e70('0x4d')],{'$or':_[_0x6e70('0x3e')](_0x1872e9,function(_0x552e7e){if(_0x552e7e[_0x6e70('0x41')]!==_0x6e70('0x51')){var _0x10de2a={};_0x10de2a[_0x552e7e[_0x6e70('0x3d')]]={'$like':'%'+_0x5424eb[_0x6e70('0x45')][_0x6e70('0x4f')]+'%'};return _0x10de2a;}})});}_0x3841a0=_[_0x6e70('0x50')]({},_0x3841a0,_0x5424eb['options']);var _0x3f5c89={'where':_0x3841a0['where']};return db[_0x6e70('0x52')][_0x6e70('0x35')](_0x3f5c89)['then'](function(_0x53efc3){_0x1f6955[_0x6e70('0x35')]=_0x53efc3;if(_0x5424eb[_0x6e70('0x45')][_0x6e70('0x53')]){_0x3841a0['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x6e70('0x54')](_0x3841a0);})[_0x6e70('0x3a')](function(_0x22abc1){_0x1f6955[_0x6e70('0x55')]=_0x22abc1;return _0x1f6955;})[_0x6e70('0x3a')](respondWithFilteredResult(_0x155a46,_0x3841a0))[_0x6e70('0x2e')](handleError(_0x155a46,null));};exports['show']=function(_0x756a5b,_0x3aa1a6){var _0x219f4={'raw':!![],'where':{'id':_0x756a5b[_0x6e70('0x56')]['id']}},_0x6ed023={};_0x6ed023['model']=_['keys'](db[_0x6e70('0x52')][_0x6e70('0x3f')]);_0x6ed023[_0x6e70('0x45')]=_[_0x6e70('0x44')](_0x756a5b[_0x6e70('0x45')]);_0x6ed023['filters']=_[_0x6e70('0x47')](_0x6ed023[_0x6e70('0x43')],_0x6ed023[_0x6e70('0x45')]);_0x219f4[_0x6e70('0x48')]=_[_0x6e70('0x47')](_0x6ed023['model'],qs[_0x6e70('0x49')](_0x756a5b[_0x6e70('0x45')][_0x6e70('0x49')]));_0x219f4[_0x6e70('0x48')]=_0x219f4[_0x6e70('0x48')][_0x6e70('0x4a')]?_0x219f4['attributes']:_0x6ed023[_0x6e70('0x43')];if(_0x756a5b[_0x6e70('0x45')]['includeAll']){_0x219f4[_0x6e70('0x57')]=[{'all':!![]}];}_0x219f4=_[_0x6e70('0x50')]({},_0x219f4,_0x756a5b['options']);return db[_0x6e70('0x52')][_0x6e70('0x58')](_0x219f4)[_0x6e70('0x3a')](handleEntityNotFound(_0x3aa1a6,null))[_0x6e70('0x3a')](respondWithResult(_0x3aa1a6,null))[_0x6e70('0x2e')](handleError(_0x3aa1a6,null));};exports['create']=function(_0x385825,_0x2d1336){return db[_0x6e70('0x52')][_0x6e70('0x59')](_0x385825[_0x6e70('0x5a')],{})[_0x6e70('0x3a')](respondWithResult(_0x2d1336,0xc9))[_0x6e70('0x2e')](handleError(_0x2d1336,null));};exports[_0x6e70('0x39')]=function(_0x6043cd,_0x344676){if(_0x6043cd[_0x6e70('0x5a')]['id']){delete _0x6043cd[_0x6e70('0x5a')]['id'];}return db[_0x6e70('0x52')][_0x6e70('0x58')]({'where':{'id':_0x6043cd[_0x6e70('0x56')]['id']}})[_0x6e70('0x3a')](handleEntityNotFound(_0x344676,null))[_0x6e70('0x3a')](saveUpdates(_0x6043cd[_0x6e70('0x5a')],null))[_0x6e70('0x3a')](respondWithResult(_0x344676,null))[_0x6e70('0x2e')](handleError(_0x344676,null));};exports['destroy']=function(_0x28898a,_0x4434dd){return db[_0x6e70('0x52')][_0x6e70('0x58')]({'where':{'id':_0x28898a[_0x6e70('0x56')]['id']}})[_0x6e70('0x3a')](handleEntityNotFound(_0x4434dd,null))['then'](removeEntity(_0x4434dd,null))[_0x6e70('0x2e')](handleError(_0x4434dd,null));};exports[_0x6e70('0x5b')]=function(_0x4f813a,_0x246ea2){return db[_0x6e70('0x52')][_0x6e70('0x5b')]()['then'](respondWithResult(_0x246ea2,null))['catch'](handleError(_0x246ea2,null));};var interaction_log=require(_0x6e70('0x19'))(_0x6e70('0x5c'));exports[_0x6e70('0x5d')]=function(_0x41a861,_0x10d299,_0x739946){var _0x30cd88={'agent':{},'channel':'openchannel'};if(_0x41a861['body']['id']){delete _0x41a861[_0x6e70('0x5a')]['id'];}_0x41a861[_0x6e70('0x5a')][_0x6e70('0x5e')]=!![];_0x41a861[_0x6e70('0x5a')]['readAt']=moment()['format'](_0x6e70('0x5f'));_0x41a861[_0x6e70('0x5a')]['UserId']=_0x41a861['body'][_0x6e70('0x60')]||_0x41a861['user']['id'];_0x30cd88[_0x6e70('0x61')]['id']=_0x41a861[_0x6e70('0x5a')][_0x6e70('0x60')];return db[_0x6e70('0x52')][_0x6e70('0x58')]({'where':{'id':_0x41a861[_0x6e70('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x6e70('0x62')],'as':_0x6e70('0x63')}]})['then'](handleEntityNotFound(_0x10d299,null))[_0x6e70('0x3a')](saveUpdates(_0x41a861[_0x6e70('0x5a')],null))[_0x6e70('0x3a')](function(_0x346c79){if(_0x346c79){_0x30cd88[_0x6e70('0x2d')]=_0x346c79['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x346c79[_0x6e70('0x64')]}});}return null;})[_0x6e70('0x3a')](handleEntityNotFound(_0x10d299,null))[_0x6e70('0x3a')](function(_0x4ed5ad){if(_0x4ed5ad){return _0x4ed5ad['update']({'UserId':_0x41a861[_0x6e70('0x5a')][_0x6e70('0x60')],'read1stAt':_[_0x6e70('0x65')](_0x4ed5ad[_0x6e70('0x66')])?moment()[_0x6e70('0x67')](_0x6e70('0x5f')):undefined});}return null;})['then'](function(_0x2d2855){if(_0x2d2855){_0x30cd88[_0x6e70('0x68')]=_0x2d2855[_0x6e70('0x69')]({'plain':!![]});interaction_log[_0x6e70('0x25')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x41a861[_0x6e70('0x6a')]['id'],_0x41a861['user']['name'],_0x41a861[_0x6e70('0x6a')][_0x6e70('0x6b')],_0x30cd88[_0x6e70('0x68')]['id'],_0x41a861[_0x6e70('0x5a')]?JSON[_0x6e70('0x29')](_0x41a861[_0x6e70('0x5a')]):'null');return respondWithRpcPromise(_0x6e70('0x6c'),_0x6e70('0x6d'),_0x30cd88);}return null;})[_0x6e70('0x3a')](function(_0x18e64c){return db[_0x6e70('0x62')][_0x6e70('0x5b')]()[_0x6e70('0x3a')](function(_0xd9b4a9){var _0x2f1362=[];for(var _0x29621a=0x0;_0x29621a=_0x56ca3a){_0x16b4a2=_0x56ca3a;_0x179c90=0xc8;}else{_0x179c90=0xce;}_0x3c1549[_0xfda3('0x2a')](_0x179c90);return _0x3c1549[_0xfda3('0x2f')](_0xfda3('0x30'),_0x4fd277+'-'+_0x16b4a2+'/'+_0x56ca3a)[_0xfda3('0x31')](_0x301509);}return null;};}function patchUpdates(_0x5825bd){return function(_0x49f84c){try{jsonpatch[_0xfda3('0x32')](_0x49f84c,_0x5825bd,!![]);}catch(_0xacc8c){return BPromise[_0xfda3('0x33')](_0xacc8c);}return _0x49f84c[_0xfda3('0x34')]();};}function saveUpdates(_0xd6969e,_0x2b3afb){return function(_0x210763){if(_0x210763){return _0x210763[_0xfda3('0x35')](_0xd6969e)['then'](function(_0x51ecde){return _0x51ecde;});}return null;};}function removeEntity(_0x30e63e,_0x17cccb){return function(_0x58f805){if(_0x58f805){return _0x58f805[_0xfda3('0x36')]()[_0xfda3('0x1d')](function(){_0x30e63e[_0xfda3('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d92a9,_0x378bf0){return function(_0xb4eeb7){if(!_0xb4eeb7){_0x1d92a9[_0xfda3('0x28')](0x194);}return _0xb4eeb7;};}function handleError(_0x1ab9b1,_0x5ae650){_0x5ae650=_0x5ae650||0x1f4;return function(_0xc6dd4e){logger[_0xfda3('0x23')](_0xc6dd4e[_0xfda3('0x37')]);if(_0xc6dd4e['name']){delete _0xc6dd4e[_0xfda3('0x38')];}_0x1ab9b1['status'](_0x5ae650)[_0xfda3('0x39')](_0xc6dd4e);};}exports[_0xfda3('0x3a')]=function(_0x43a58a,_0x36a506){var _0x21c5cc={},_0x2074e7={},_0x151f32={'count':0x0,'rows':[]};var _0x3d1cb2=_['map'](db[_0xfda3('0x3b')][_0xfda3('0x3c')],function(_0xd2dde0){return{'name':_0xd2dde0[_0xfda3('0x3d')],'type':_0xd2dde0['type'][_0xfda3('0x3e')]};});_0x2074e7[_0xfda3('0x3f')]=_[_0xfda3('0x40')](_0x3d1cb2,'name');_0x2074e7['query']=_[_0xfda3('0x41')](_0x43a58a[_0xfda3('0x42')]);_0x2074e7[_0xfda3('0x43')]=_[_0xfda3('0x44')](_0x2074e7[_0xfda3('0x3f')],_0x2074e7[_0xfda3('0x42')]);_0x21c5cc[_0xfda3('0x45')]=_[_0xfda3('0x44')](_0x2074e7[_0xfda3('0x3f')],qs[_0xfda3('0x46')](_0x43a58a['query'][_0xfda3('0x46')]));_0x21c5cc[_0xfda3('0x45')]=_0x21c5cc['attributes'][_0xfda3('0x47')]?_0x21c5cc['attributes']:_0x2074e7['model'];if(!_0x43a58a['query'][_0xfda3('0x48')](_0xfda3('0x49'))){_0x21c5cc[_0xfda3('0x2d')]=qs[_0xfda3('0x2d')](_0x43a58a['query'][_0xfda3('0x2d')]);_0x21c5cc[_0xfda3('0x2b')]=qs[_0xfda3('0x2b')](_0x43a58a[_0xfda3('0x42')]['offset']);}_0x21c5cc[_0xfda3('0x4a')]=qs[_0xfda3('0x4b')](_0x43a58a[_0xfda3('0x42')]['sort']);_0x21c5cc['where']=qs[_0xfda3('0x43')](_[_0xfda3('0x4c')](_0x43a58a[_0xfda3('0x42')],_0x2074e7[_0xfda3('0x43')]),_0x3d1cb2);if(_0x43a58a[_0xfda3('0x42')][_0xfda3('0x4d')]){_0x21c5cc[_0xfda3('0x4e')]=_[_0xfda3('0x4f')](_0x21c5cc[_0xfda3('0x4e')],{'$or':_[_0xfda3('0x40')](_0x3d1cb2,function(_0x1749f7){if(_0x1749f7[_0xfda3('0x50')]!==_0xfda3('0x51')){var _0x46b297={};_0x46b297[_0x1749f7['name']]={'$like':'%'+_0x43a58a['query'][_0xfda3('0x4d')]+'%'};return _0x46b297;}})});}_0x21c5cc=_[_0xfda3('0x4f')]({},_0x21c5cc,_0x43a58a[_0xfda3('0x52')]);var _0x270b9a={'where':_0x21c5cc[_0xfda3('0x4e')]};return db[_0xfda3('0x3b')][_0xfda3('0x2e')](_0x270b9a)[_0xfda3('0x1d')](function(_0x1372ee){_0x151f32[_0xfda3('0x2e')]=_0x1372ee;if(_0x43a58a['query'][_0xfda3('0x53')]){_0x21c5cc[_0xfda3('0x54')]=[{'all':!![]}];}return db[_0xfda3('0x3b')][_0xfda3('0x55')](_0x21c5cc);})[_0xfda3('0x1d')](function(_0x5b4817){_0x151f32[_0xfda3('0x56')]=_0x5b4817;return _0x151f32;})[_0xfda3('0x1d')](respondWithFilteredResult(_0x36a506,_0x21c5cc))[_0xfda3('0x27')](handleError(_0x36a506,null));};exports['show']=function(_0x187402,_0x39c96f){var _0x11addf={'raw':!![],'where':{'id':_0x187402[_0xfda3('0x57')]['id']}},_0x4cd5cb={};_0x4cd5cb[_0xfda3('0x3f')]=_[_0xfda3('0x41')](db[_0xfda3('0x3b')][_0xfda3('0x3c')]);_0x4cd5cb['query']=_[_0xfda3('0x41')](_0x187402['query']);_0x4cd5cb[_0xfda3('0x43')]=_['intersection'](_0x4cd5cb[_0xfda3('0x3f')],_0x4cd5cb[_0xfda3('0x42')]);_0x11addf[_0xfda3('0x45')]=_[_0xfda3('0x44')](_0x4cd5cb['model'],qs[_0xfda3('0x46')](_0x187402[_0xfda3('0x42')][_0xfda3('0x46')]));_0x11addf[_0xfda3('0x45')]=_0x11addf[_0xfda3('0x45')][_0xfda3('0x47')]?_0x11addf[_0xfda3('0x45')]:_0x4cd5cb['model'];if(_0x187402['query'][_0xfda3('0x53')]){_0x11addf[_0xfda3('0x54')]=[{'all':!![]}];}_0x11addf=_[_0xfda3('0x4f')]({},_0x11addf,_0x187402['options']);return db['OpenchannelMessage'][_0xfda3('0x58')](_0x11addf)[_0xfda3('0x1d')](handleEntityNotFound(_0x39c96f,null))[_0xfda3('0x1d')](respondWithResult(_0x39c96f,null))[_0xfda3('0x27')](handleError(_0x39c96f,null));};exports[_0xfda3('0x59')]=function(_0x4bc976,_0xb3353b){return db[_0xfda3('0x3b')][_0xfda3('0x59')](_0x4bc976[_0xfda3('0x5a')],{})[_0xfda3('0x1d')](respondWithResult(_0xb3353b,0xc9))[_0xfda3('0x27')](handleError(_0xb3353b,null));};exports[_0xfda3('0x35')]=function(_0x1c5073,_0x3a8c51){if(_0x1c5073[_0xfda3('0x5a')]['id']){delete _0x1c5073[_0xfda3('0x5a')]['id'];}return db[_0xfda3('0x3b')]['find']({'where':{'id':_0x1c5073[_0xfda3('0x57')]['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0x3a8c51,null))[_0xfda3('0x1d')](saveUpdates(_0x1c5073[_0xfda3('0x5a')],null))[_0xfda3('0x1d')](respondWithResult(_0x3a8c51,null))[_0xfda3('0x27')](handleError(_0x3a8c51,null));};exports[_0xfda3('0x36')]=function(_0x4ce31c,_0x5a3a6f){return db[_0xfda3('0x3b')][_0xfda3('0x58')]({'where':{'id':_0x4ce31c['params']['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0x5a3a6f,null))[_0xfda3('0x1d')](removeEntity(_0x5a3a6f,null))[_0xfda3('0x27')](handleError(_0x5a3a6f,null));};exports[_0xfda3('0x5b')]=function(_0x58878c,_0x524155){return db[_0xfda3('0x3b')][_0xfda3('0x5b')]()[_0xfda3('0x1d')](respondWithResult(_0x524155,null))['catch'](handleError(_0x524155,null));};var interaction_log=require(_0xfda3('0x5c'))('openchannel-interactions');exports[_0xfda3('0x5d')]=function(_0x41d3c8,_0x1cc5b2,_0x2f72e0){var _0x3f54e8={'agent':{},'channel':_0xfda3('0x5e')};if(_0x41d3c8['body']['id']){delete _0x41d3c8[_0xfda3('0x5a')]['id'];}_0x41d3c8[_0xfda3('0x5a')][_0xfda3('0x5f')]=!![];_0x41d3c8[_0xfda3('0x5a')][_0xfda3('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x41d3c8[_0xfda3('0x5a')][_0xfda3('0x61')]=_0x41d3c8['body']['UserId']||_0x41d3c8['user']['id'];_0x3f54e8[_0xfda3('0x62')]['id']=_0x41d3c8[_0xfda3('0x5a')]['UserId'];return db[_0xfda3('0x3b')][_0xfda3('0x58')]({'where':{'id':_0x41d3c8[_0xfda3('0x57')]['id'],'UserId':null},'include':[{'model':db[_0xfda3('0x63')],'as':'Contact'}]})[_0xfda3('0x1d')](handleEntityNotFound(_0x1cc5b2,null))[_0xfda3('0x1d')](saveUpdates(_0x41d3c8[_0xfda3('0x5a')],null))[_0xfda3('0x1d')](function(_0x44e59e){if(_0x44e59e){_0x3f54e8[_0xfda3('0x24')]=_0x44e59e['get']({'plain':!![]});return db['OpenchannelInteraction'][_0xfda3('0x58')]({'where':{'id':_0x44e59e['OpenchannelInteractionId']}});}return null;})[_0xfda3('0x1d')](handleEntityNotFound(_0x1cc5b2,null))[_0xfda3('0x1d')](function(_0x20704a){if(_0x20704a){return _0x20704a[_0xfda3('0x35')]({'UserId':_0x41d3c8[_0xfda3('0x5a')][_0xfda3('0x61')],'read1stAt':_[_0xfda3('0x64')](_0x20704a[_0xfda3('0x65')])?moment()[_0xfda3('0x66')](_0xfda3('0x67')):undefined});}return null;})['then'](function(_0xee8462){if(_0xee8462){_0x3f54e8['interaction']=_0xee8462['get']({'plain':!![]});interaction_log[_0xfda3('0x25')](_0xfda3('0x68'),_0x41d3c8['user']['id'],_0x41d3c8[_0xfda3('0x69')][_0xfda3('0x38')],_0x41d3c8[_0xfda3('0x69')]['role'],_0x3f54e8[_0xfda3('0x6a')]['id'],_0x41d3c8[_0xfda3('0x5a')]?JSON[_0xfda3('0x22')](_0x41d3c8[_0xfda3('0x5a')]):_0xfda3('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3f54e8);}return null;})['then'](function(_0x1a278c){return db[_0xfda3('0x63')][_0xfda3('0x5b')]()[_0xfda3('0x1d')](function(_0x4407e8){var _0x21f9ae=[];for(var _0x47ebd6=0x0;_0x47ebd6=_0x3d1b4c){_0x1cabb7=_0x3d1b4c;_0x2c032d=0xc8;}else{_0x2c032d=0xce;}_0x2bb211['status'](_0x2c032d);return _0x2bb211[_0x0b1b('0x24')](_0x0b1b('0x25'),_0x1589a1+'-'+_0x1cabb7+'/'+_0x3d1b4c)[_0x0b1b('0x20')](_0x217ee6);}return null;};}function patchUpdates(_0x1eb1c7){return function(_0x557619){try{jsonpatch[_0x0b1b('0x26')](_0x557619,_0x1eb1c7,!![]);}catch(_0xe4f1df){return BPromise['reject'](_0xe4f1df);}return _0x557619[_0x0b1b('0x27')]();};}function saveUpdates(_0x540973,_0x3e444d){return function(_0x337496){if(_0x337496){return _0x337496[_0x0b1b('0x28')](_0x540973)[_0x0b1b('0x29')](function(_0x3d1706){return _0x3d1706;});}return null;};}function removeEntity(_0x114f05,_0x318609){return function(_0x1ab322){if(_0x1ab322){return _0x1ab322[_0x0b1b('0x2a')]()[_0x0b1b('0x29')](function(){var _0x2601f4=_0x1ab322['get']({'plain':!![]});var _0x1fe2cf=_0x0b1b('0x2b');return db[_0x0b1b('0x2c')][_0x0b1b('0x2a')]({'where':{'type':_0x1fe2cf,'resourceId':_0x2601f4['id']}})['then'](function(){return _0x1ab322;});})[_0x0b1b('0x29')](function(){_0x114f05[_0x0b1b('0x1e')](0xcc)[_0x0b1b('0x1f')]();});}};}function handleEntityNotFound(_0x43c151,_0x4db4cb){return function(_0x5aea20){if(!_0x5aea20){_0x43c151['sendStatus'](0x194);}return _0x5aea20;};}function handleError(_0x47b7cb,_0x287b72){_0x287b72=_0x287b72||0x1f4;return function(_0x49d241){logger[_0x0b1b('0x2d')](_0x49d241[_0x0b1b('0x2e')]);if(_0x49d241[_0x0b1b('0x2f')]){delete _0x49d241[_0x0b1b('0x2f')];}_0x47b7cb[_0x0b1b('0x1e')](_0x287b72)[_0x0b1b('0x30')](_0x49d241);};}exports[_0x0b1b('0x31')]=function(_0x1a0770,_0x5e17bc){var _0x2d69a3={},_0x11bff7={},_0x13353c={'count':0x0,'rows':[]};var _0xfef1ea=_['map'](db[_0x0b1b('0x32')][_0x0b1b('0x33')],function(_0x41ca72){return{'name':_0x41ca72['fieldName'],'type':_0x41ca72['type'][_0x0b1b('0x34')]};});_0x11bff7[_0x0b1b('0x35')]=_[_0x0b1b('0x36')](_0xfef1ea,'name');_0x11bff7[_0x0b1b('0x37')]=_[_0x0b1b('0x38')](_0x1a0770['query']);_0x11bff7[_0x0b1b('0x39')]=_[_0x0b1b('0x3a')](_0x11bff7[_0x0b1b('0x35')],_0x11bff7['query']);_0x2d69a3['attributes']=_[_0x0b1b('0x3a')](_0x11bff7[_0x0b1b('0x35')],qs['fields'](_0x1a0770['query'][_0x0b1b('0x3b')]));_0x2d69a3[_0x0b1b('0x3c')]=_0x2d69a3[_0x0b1b('0x3c')][_0x0b1b('0x3d')]?_0x2d69a3[_0x0b1b('0x3c')]:_0x11bff7['model'];if(!_0x1a0770[_0x0b1b('0x37')][_0x0b1b('0x3e')](_0x0b1b('0x3f'))){_0x2d69a3[_0x0b1b('0x40')]=qs[_0x0b1b('0x40')](_0x1a0770[_0x0b1b('0x37')]['limit']);_0x2d69a3[_0x0b1b('0x22')]=qs[_0x0b1b('0x22')](_0x1a0770['query'][_0x0b1b('0x22')]);}_0x2d69a3['order']=qs['sort'](_0x1a0770['query'][_0x0b1b('0x41')]);_0x2d69a3['where']=qs[_0x0b1b('0x39')](_[_0x0b1b('0x42')](_0x1a0770[_0x0b1b('0x37')],_0x11bff7[_0x0b1b('0x39')]),_0xfef1ea);if(_0x1a0770[_0x0b1b('0x37')][_0x0b1b('0x43')]){_0x2d69a3['where']=_[_0x0b1b('0x44')](_0x2d69a3[_0x0b1b('0x45')],{'$or':_['map'](_0xfef1ea,function(_0x15b850){if(_0x15b850[_0x0b1b('0x46')]!==_0x0b1b('0x47')){var _0x257ce7={};_0x257ce7[_0x15b850[_0x0b1b('0x2f')]]={'$like':'%'+_0x1a0770[_0x0b1b('0x37')][_0x0b1b('0x43')]+'%'};return _0x257ce7;}})});}_0x2d69a3=_[_0x0b1b('0x44')]({},_0x2d69a3,_0x1a0770['options']);var _0x35b5f0={'where':_0x2d69a3['where']};return db['OpenchannelQueue'][_0x0b1b('0x23')](_0x35b5f0)[_0x0b1b('0x29')](function(_0x4accab){_0x13353c[_0x0b1b('0x23')]=_0x4accab;if(_0x1a0770['query'][_0x0b1b('0x48')]){_0x2d69a3[_0x0b1b('0x49')]=[{'all':!![]}];}return db[_0x0b1b('0x32')][_0x0b1b('0x4a')](_0x2d69a3);})[_0x0b1b('0x29')](function(_0x4ff4ea){_0x13353c[_0x0b1b('0x4b')]=_0x4ff4ea;return _0x13353c;})[_0x0b1b('0x29')](respondWithFilteredResult(_0x5e17bc,_0x2d69a3))[_0x0b1b('0x4c')](handleError(_0x5e17bc,null));};exports['show']=function(_0x288789,_0xedfbc3){var _0x2c88f5={'raw':!![],'where':{'id':_0x288789[_0x0b1b('0x4d')]['id']}},_0x113617={};_0x113617[_0x0b1b('0x35')]=_[_0x0b1b('0x38')](db[_0x0b1b('0x32')][_0x0b1b('0x33')]);_0x113617[_0x0b1b('0x37')]=_[_0x0b1b('0x38')](_0x288789['query']);_0x113617[_0x0b1b('0x39')]=_['intersection'](_0x113617[_0x0b1b('0x35')],_0x113617['query']);_0x2c88f5[_0x0b1b('0x3c')]=_['intersection'](_0x113617[_0x0b1b('0x35')],qs[_0x0b1b('0x3b')](_0x288789['query'][_0x0b1b('0x3b')]));_0x2c88f5[_0x0b1b('0x3c')]=_0x2c88f5[_0x0b1b('0x3c')][_0x0b1b('0x3d')]?_0x2c88f5[_0x0b1b('0x3c')]:_0x113617[_0x0b1b('0x35')];if(_0x288789['query']['includeAll']){_0x2c88f5[_0x0b1b('0x49')]=[{'all':!![]}];}_0x2c88f5=_[_0x0b1b('0x44')]({},_0x2c88f5,_0x288789['options']);return db[_0x0b1b('0x32')]['find'](_0x2c88f5)[_0x0b1b('0x29')](handleEntityNotFound(_0xedfbc3,null))['then'](respondWithResult(_0xedfbc3,null))[_0x0b1b('0x4c')](handleError(_0xedfbc3,null));};exports[_0x0b1b('0x4e')]=function(_0x13bdac,_0x7553fe){return db['OpenchannelQueue'][_0x0b1b('0x4e')](_0x13bdac[_0x0b1b('0x4f')],{})[_0x0b1b('0x29')](function(_0x156397){var _0x15c68d=_0x13bdac[_0x0b1b('0x50')][_0x0b1b('0x51')]({'plain':!![]});if(!_0x15c68d)throw new Error(_0x0b1b('0x52'));if(_0x15c68d[_0x0b1b('0x53')]===_0x0b1b('0x50')){var _0x233dd2=_0x156397[_0x0b1b('0x51')]({'plain':!![]});var _0x5d6d11=_0x0b1b('0x2b');return db['UserProfileSection'][_0x0b1b('0x54')]({'where':{'name':_0x5d6d11,'userProfileId':_0x15c68d[_0x0b1b('0x55')]},'raw':!![]})[_0x0b1b('0x29')](function(_0x564499){if(_0x564499&&_0x564499[_0x0b1b('0x56')]===0x0){return db[_0x0b1b('0x2c')][_0x0b1b('0x4e')]({'name':_0x233dd2[_0x0b1b('0x2f')],'resourceId':_0x233dd2['id'],'type':_0x564499[_0x0b1b('0x2f')],'sectionId':_0x564499['id']},{})['then'](function(){return _0x156397;});}else{return _0x156397;}})[_0x0b1b('0x4c')](function(_0x59e52d){logger[_0x0b1b('0x2d')](_0x0b1b('0x57'),_0x59e52d);throw _0x59e52d;});}return _0x156397;})[_0x0b1b('0x29')](respondWithResult(_0x7553fe,0xc9))['catch'](handleError(_0x7553fe,null));};exports[_0x0b1b('0x28')]=function(_0x4e3e13,_0x4cdeb2){if(_0x4e3e13[_0x0b1b('0x4f')]['id']){delete _0x4e3e13[_0x0b1b('0x4f')]['id'];}return db[_0x0b1b('0x32')][_0x0b1b('0x54')]({'where':{'id':_0x4e3e13[_0x0b1b('0x4d')]['id']}})[_0x0b1b('0x29')](handleEntityNotFound(_0x4cdeb2,null))['then'](saveUpdates(_0x4e3e13[_0x0b1b('0x4f')],null))[_0x0b1b('0x29')](respondWithResult(_0x4cdeb2,null))['catch'](handleError(_0x4cdeb2,null));};exports[_0x0b1b('0x2a')]=function(_0x3cff1d,_0x2a8092){return db[_0x0b1b('0x32')]['find']({'where':{'id':_0x3cff1d['params']['id']}})[_0x0b1b('0x29')](handleEntityNotFound(_0x2a8092,null))[_0x0b1b('0x29')](removeEntity(_0x2a8092,null))[_0x0b1b('0x4c')](handleError(_0x2a8092,null));};exports[_0x0b1b('0x58')]=function(_0x1a2570,_0x28e760){return db[_0x0b1b('0x32')][_0x0b1b('0x58')]()['then'](respondWithResult(_0x28e760,null))[_0x0b1b('0x4c')](handleError(_0x28e760,null));};exports['getMembers']=function(_0x40fc70,_0x392aee,_0x121404){var _0x4d35e5={'raw':!![],'where':{}},_0x28a9b6={},_0x238564;return db[_0x0b1b('0x32')][_0x0b1b('0x59')]({'where':{'id':_0x40fc70[_0x0b1b('0x4d')]['id']}})[_0x0b1b('0x29')](handleEntityNotFound(_0x392aee,null))[_0x0b1b('0x29')](function(_0x4b302b){if(_0x4b302b){_0x238564=_0x4b302b[_0x0b1b('0x51')]({'plain':!![]});_0x28a9b6['model']=_[_0x0b1b('0x38')](db['UserOpenchannelQueue']['rawAttributes']);_0x28a9b6[_0x0b1b('0x37')]=_['keys'](_0x40fc70['query']);_0x28a9b6[_0x0b1b('0x39')]=_[_0x0b1b('0x3a')](_0x28a9b6['model'],_0x28a9b6[_0x0b1b('0x37')]);_0x4d35e5[_0x0b1b('0x3c')]=_[_0x0b1b('0x3a')](_0x28a9b6[_0x0b1b('0x35')],qs[_0x0b1b('0x3b')](_0x40fc70[_0x0b1b('0x37')][_0x0b1b('0x3b')]));_0x4d35e5[_0x0b1b('0x3c')]=_0x4d35e5['attributes'][_0x0b1b('0x3d')]?_0x4d35e5[_0x0b1b('0x3c')]:_0x28a9b6['model'];if(!_0x40fc70[_0x0b1b('0x37')]['hasOwnProperty'](_0x0b1b('0x3f'))){_0x4d35e5[_0x0b1b('0x40')]=qs['limit'](_0x40fc70['query'][_0x0b1b('0x40')]);_0x4d35e5[_0x0b1b('0x22')]=qs[_0x0b1b('0x22')](_0x40fc70[_0x0b1b('0x37')]['offset']);}_0x4d35e5[_0x0b1b('0x5a')]=qs[_0x0b1b('0x41')](_0x40fc70[_0x0b1b('0x37')]['sort']);_0x4d35e5[_0x0b1b('0x45')]=qs[_0x0b1b('0x39')](_['pick'](_0x40fc70[_0x0b1b('0x37')],_0x28a9b6['filters']));_0x4d35e5[_0x0b1b('0x45')]['OpenchannelQueueId']=_0x4b302b['id'];if(_0x40fc70[_0x0b1b('0x37')][_0x0b1b('0x43')]){_0x4d35e5[_0x0b1b('0x45')]=_['merge'](_0x4d35e5[_0x0b1b('0x45')],{'$or':_['map'](_0x4d35e5[_0x0b1b('0x3c')],function(_0x524e0e){var _0x16ec0d={};_0x16ec0d[_0x524e0e]={'$like':'%'+_0x40fc70[_0x0b1b('0x37')][_0x0b1b('0x43')]+'%'};return _0x16ec0d;})});}_0x4d35e5=_[_0x0b1b('0x44')]({},_0x4d35e5,_0x40fc70['options']);return db[_0x0b1b('0x5b')][_0x0b1b('0x4a')](_0x4d35e5);}})[_0x0b1b('0x29')](function(_0x2ee86f){if(_0x2ee86f){return db['User'][_0x0b1b('0x5c')]({'where':{'id':_[_0x0b1b('0x36')](_0x2ee86f,_0x0b1b('0x5d')),'role':_0x0b1b('0x5e')},'attributes':['id',_0x0b1b('0x2f'),_0x0b1b('0x5f'),_0x0b1b('0x60'),_0x0b1b('0x61')]});}})[_0x0b1b('0x29')](function(_0x35518f){if(_0x35518f){return{'count':_0x35518f['count'],'rows':_[_0x0b1b('0x36')](_0x35518f['rows'],function(_0xe2e367){return{'membername':_0xe2e367[_0x0b1b('0x2f')],'UserId':_0xe2e367['id'],'queue_name':_0x238564[_0x0b1b('0x2f')],'OpenchannelQueueId':_0x238564['id'],'interface':util[_0x0b1b('0x62')](_0x0b1b('0x63'),_0x0b1b('0x64'),_0xe2e367[_0x0b1b('0x2f')]),'penalty':0x0,'paused':_0xe2e367[_0x0b1b('0x5f')],'createdAt':_0xe2e367['createdAt'],'updatedAt':_0xe2e367[_0x0b1b('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0b1b('0x29')](respondWithFilteredResult(_0x392aee,_0x4d35e5))[_0x0b1b('0x4c')](handleError(_0x392aee,null));};exports[_0x0b1b('0x65')]=function(_0xf44f17,_0x4a57f8,_0x2aff4a){var _0x4f9361={};var _0x3b591a={};var _0x2afd65;var _0x4144db;return db[_0x0b1b('0x32')][_0x0b1b('0x59')]({'where':{'id':_0xf44f17['params']['id']}})[_0x0b1b('0x29')](handleEntityNotFound(_0x4a57f8,null))[_0x0b1b('0x29')](function(_0x5247dc){if(_0x5247dc){_0x2afd65=_0x5247dc;_0x3b591a[_0x0b1b('0x35')]=_[_0x0b1b('0x38')](db['Team'][_0x0b1b('0x33')]);_0x3b591a['query']=_[_0x0b1b('0x38')](_0xf44f17[_0x0b1b('0x37')]);_0x3b591a[_0x0b1b('0x39')]=_[_0x0b1b('0x3a')](_0x3b591a['model'],_0x3b591a['query']);_0x4f9361[_0x0b1b('0x3c')]=_[_0x0b1b('0x3a')](_0x3b591a[_0x0b1b('0x35')],qs[_0x0b1b('0x3b')](_0xf44f17['query'][_0x0b1b('0x3b')]));_0x4f9361[_0x0b1b('0x3c')]=_0x4f9361[_0x0b1b('0x3c')][_0x0b1b('0x3d')]?_0x4f9361[_0x0b1b('0x3c')]:_0x3b591a[_0x0b1b('0x35')];_0x4f9361['order']=qs[_0x0b1b('0x41')](_0xf44f17['query'][_0x0b1b('0x41')]);_0x4f9361['where']=qs['filters'](_[_0x0b1b('0x42')](_0xf44f17[_0x0b1b('0x37')],_0x3b591a['filters']));if(_0xf44f17[_0x0b1b('0x37')][_0x0b1b('0x43')]){_0x4f9361[_0x0b1b('0x45')]=_['merge'](_0x4f9361[_0x0b1b('0x45')],{'$or':_['map'](_0x4f9361['attributes'],function(_0x169218){var _0x43c76e={};_0x43c76e[_0x169218]={'$like':'%'+_0xf44f17[_0x0b1b('0x37')][_0x0b1b('0x43')]+'%'};return _0x43c76e;})});}_0x4f9361=_['merge']({},_0x4f9361,_0xf44f17['options']);return _0x2afd65[_0x0b1b('0x65')](_0x4f9361);}})[_0x0b1b('0x29')](function(_0x1046ef){if(_0x1046ef){_0x4144db=_0x1046ef['length'];if(!_0xf44f17[_0x0b1b('0x37')]['hasOwnProperty'](_0x0b1b('0x3f'))){_0x4f9361[_0x0b1b('0x40')]=qs[_0x0b1b('0x40')](_0xf44f17[_0x0b1b('0x37')][_0x0b1b('0x40')]);_0x4f9361[_0x0b1b('0x22')]=qs[_0x0b1b('0x22')](_0xf44f17['query']['offset']);}return _0x2afd65[_0x0b1b('0x65')](_0x4f9361);}})[_0x0b1b('0x29')](function(_0x5ecc95){if(_0x5ecc95){return _0x5ecc95?{'count':_0x4144db,'rows':_0x5ecc95}:null;}})[_0x0b1b('0x29')](respondWithResult(_0x4a57f8,null))[_0x0b1b('0x4c')](handleError(_0x4a57f8,null));};exports['addTeams']=function(_0x2a1f01,_0x534300,_0x572a9f){var _0x366f8e=_0x2a1f01['body'][_0x0b1b('0x66')];return db[_0x0b1b('0x67')][_0x0b1b('0x4a')]({'where':{'id':_0x366f8e},'attributes':['id'],'include':[{'model':db[_0x0b1b('0x68')],'as':_0x0b1b('0x69'),'attributes':['id','name',_0x0b1b('0x6a'),'voicePause',_0x0b1b('0x6b')],'raw':!![]}]})['then'](function(_0x55c1e2){if(_0x55c1e2){var _0x42f556=_['flatMap'](_0x55c1e2,function(_0x3bc96f){var _0x5473cf=_0x3bc96f[_0x0b1b('0x51')]({'plain':!![]});return _0x5473cf[_0x0b1b('0x69')];});return db['OpenchannelQueue'][_0x0b1b('0x54')]({'where':{'id':_0x2a1f01[_0x0b1b('0x4d')]['id']}})['then'](function(_0xbd44eb){return db[_0x0b1b('0x6c')][_0x0b1b('0x6d')](function(_0x2920f7){return _0xbd44eb[_0x0b1b('0x6e')](_0x366f8e,{'transaction':_0x2920f7})[_0x0b1b('0x29')](function(){return BPromise[_0x0b1b('0x6f')](_0x42f556,function(_0x3be6bd){return db[_0x0b1b('0x5b')][_0x0b1b('0x70')]({'where':{'UserId':_0x3be6bd['id'],'OpenchannelQueueId':_0x2a1f01['params']['id']},'transaction':_0x2920f7});});})[_0x0b1b('0x29')](function(){_0x42f556[_0x0b1b('0x71')](function(_0x1f11a2){socket[_0x0b1b('0x72')](_0x0b1b('0x73'),{'UserId':_0x1f11a2['id'],'OpenchannelQueueId':_0xbd44eb['id']});});});});});}})[_0x0b1b('0x29')](respondWithStatusCode(_0x534300,null))['catch'](handleError(_0x534300,null));};exports[_0x0b1b('0x74')]=function(_0x3028f0,_0x525bcd,_0x4f7916){return db[_0x0b1b('0x67')][_0x0b1b('0x4a')]({'where':{'id':_0x3028f0['query'][_0x0b1b('0x66')]},'attributes':['id'],'include':[{'model':db[_0x0b1b('0x68')],'as':_0x0b1b('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x525bcd,null))[_0x0b1b('0x29')](function(_0x1c880e){var _0x37831b=_[_0x0b1b('0x36')](_0x1c880e,'id');var _0x397bc1=[];var _0x38d6f5=[];var _0x12f0a2=squel[_0x0b1b('0x75')]();_0x12f0a2[_0x0b1b('0x76')](_0x0b1b('0x77'))['from'](_0x0b1b('0x78'),'tq')[_0x0b1b('0x79')]('user_has_teams','ut',_0x0b1b('0x7a'))[_0x0b1b('0x45')](_0x0b1b('0x7b'),_0x3028f0['params']['id']);for(var _0x2d5b89=0x0;_0x2d5b89<_0x1c880e[_0x0b1b('0x3d')];_0x2d5b89+=0x1){let _0x563d80=_0x1c880e[_0x2d5b89];for(var _0x1595db=0x0;_0x1595db<_0x563d80['Agents']['length'];_0x1595db+=0x1){let _0x4e05d0=_0x563d80[_0x0b1b('0x69')][_0x1595db];var _0x109b9a=_0x12f0a2[_0x0b1b('0x7c')]();_0x109b9a[_0x0b1b('0x45')](_0x0b1b('0x7d'),_0x4e05d0['id']);_0x38d6f5[_0x0b1b('0x7e')](db['sequelize'][_0x0b1b('0x37')](_0x109b9a[_0x0b1b('0x7f')](),{'type':db['sequelize']['QueryTypes']['SELECT']})['then'](function(_0x415117){if(_0x415117[_0x0b1b('0x3d')]===0x1){return _0x4e05d0['id'];}else{var _0x3aecd8=_[_0x0b1b('0x80')](_[_0x0b1b('0x36')](_0x415117,'TeamId'),function(_0x475ade){return _[_0x0b1b('0x81')](_0x37831b,_0x475ade);});if(_0x3aecd8){return _0x4e05d0['id'];}}}));}}return BPromise[_0x0b1b('0x82')](_0x38d6f5)[_0x0b1b('0x29')](function(_0x240e0d){_0x397bc1=_(_0x397bc1)[_0x0b1b('0x83')](_0x240e0d)[_0x0b1b('0x84')]()[_0x0b1b('0x85')]();return db[_0x0b1b('0x32')][_0x0b1b('0x54')]({'where':{'id':_0x3028f0['params']['id']}})[_0x0b1b('0x29')](function(_0x6aa7ad){return db[_0x0b1b('0x6c')]['transaction'](function(_0x21a797){return _0x6aa7ad[_0x0b1b('0x74')](_0x3028f0[_0x0b1b('0x37')][_0x0b1b('0x66')],{'transaction':_0x21a797})[_0x0b1b('0x29')](function(){if(!_[_0x0b1b('0x86')](_0x397bc1)){return _0x6aa7ad['removeAgents'](_0x397bc1,{'transaction':_0x21a797});}})[_0x0b1b('0x29')](function(){_0x397bc1[_0x0b1b('0x71')](function(_0x5126c2){socket[_0x0b1b('0x72')]('userOpenchannelQueue:remove',{'UserId':_0x5126c2,'OpenchannelQueueId':_0x6aa7ad['id']});});});});});});})['then'](respondWithStatusCode(_0x525bcd,null))[_0x0b1b('0x4c')](handleError(_0x525bcd,null));};exports[_0x0b1b('0x87')]=function(_0x90cfa5,_0x42ef7a,_0x1b2434){return db[_0x0b1b('0x32')][_0x0b1b('0x54')]({'where':{'id':_0x90cfa5[_0x0b1b('0x4d')]['id']}})[_0x0b1b('0x29')](handleEntityNotFound(_0x42ef7a,null))['then'](function(_0x1d27db){if(_0x1d27db){return _0x1d27db[_0x0b1b('0x87')](_0x90cfa5['body'][_0x0b1b('0x66')],_['omit'](_0x90cfa5[_0x0b1b('0x4f')],[_0x0b1b('0x66'),'id'])||{})[_0x0b1b('0x88')](function(_0x55d529){for(var _0x9dbd3f=0x0;_0x9dbd3f<_0x90cfa5['body'][_0x0b1b('0x66')][_0x0b1b('0x3d')];_0x9dbd3f+=0x1){socket[_0x0b1b('0x72')]('userOpenchannelQueue:save',{'UserId':_0x90cfa5['body'][_0x0b1b('0x66')][_0x9dbd3f],'OpenchannelQueueId':_0x90cfa5['params']['id']});}return _0x55d529;});}})[_0x0b1b('0x29')](respondWithResult(_0x42ef7a,null))['catch'](handleError(_0x42ef7a,null));};exports['removeAgents']=function(_0x3f7952,_0x3082d8,_0xebe9d8){return db[_0x0b1b('0x32')][_0x0b1b('0x54')]({'where':{'id':_0x3f7952[_0x0b1b('0x4d')]['id']}})[_0x0b1b('0x29')](handleEntityNotFound(_0x3082d8,null))['then'](function(_0x2f1cd1){if(_0x2f1cd1){return _0x2f1cd1[_0x0b1b('0x89')](_0x3f7952['query']['ids'])[_0x0b1b('0x29')](function(){if(_[_0x0b1b('0x8a')](_0x3f7952['query'][_0x0b1b('0x66')])){for(var _0x1b9c0b=0x0;_0x1b9c0b<_0x3f7952[_0x0b1b('0x37')]['ids']['length'];_0x1b9c0b+=0x1){socket[_0x0b1b('0x72')](_0x0b1b('0x8b'),{'UserId':Number(_0x3f7952['query'][_0x0b1b('0x66')][_0x1b9c0b]),'OpenchannelQueueId':Number(_0x3f7952[_0x0b1b('0x4d')]['id'])});}}else{socket['emit'](_0x0b1b('0x8b'),{'UserId':Number(_0x3f7952[_0x0b1b('0x37')][_0x0b1b('0x66')]),'OpenchannelQueueId':Number(_0x3f7952[_0x0b1b('0x4d')]['id'])});}});}})[_0x0b1b('0x29')](respondWithStatusCode(_0x3082d8,null))[_0x0b1b('0x4c')](handleError(_0x3082d8,null));};exports[_0x0b1b('0x8c')]=function(_0x26cbab,_0x10a9e1,_0x187b7d){var _0x2c02c7={};var _0x1c6a4c={};var _0x2ef78c;var _0x193ddd;return db[_0x0b1b('0x32')][_0x0b1b('0x59')]({'where':{'id':_0x26cbab['params']['id']}})[_0x0b1b('0x29')](handleEntityNotFound(_0x10a9e1,null))[_0x0b1b('0x29')](function(_0x367e1b){if(_0x367e1b){_0x2ef78c=_0x367e1b;_0x1c6a4c[_0x0b1b('0x35')]=_['keys'](db[_0x0b1b('0x68')][_0x0b1b('0x33')]);_0x1c6a4c[_0x0b1b('0x37')]=_[_0x0b1b('0x38')](_0x26cbab['query']);_0x1c6a4c[_0x0b1b('0x39')]=_['intersection'](_0x1c6a4c['model'],_0x1c6a4c[_0x0b1b('0x37')]);_0x2c02c7['attributes']=_[_0x0b1b('0x3a')](_0x1c6a4c[_0x0b1b('0x35')],qs[_0x0b1b('0x3b')](_0x26cbab[_0x0b1b('0x37')]['fields']));_0x2c02c7[_0x0b1b('0x3c')]=_0x2c02c7[_0x0b1b('0x3c')]['length']?_0x2c02c7[_0x0b1b('0x3c')]:_0x1c6a4c[_0x0b1b('0x35')];_0x2c02c7[_0x0b1b('0x5a')]=qs['sort'](_0x26cbab[_0x0b1b('0x37')][_0x0b1b('0x41')]);_0x2c02c7[_0x0b1b('0x45')]=qs[_0x0b1b('0x39')](_[_0x0b1b('0x42')](_0x26cbab['query'],_0x1c6a4c[_0x0b1b('0x39')]));if(_0x26cbab[_0x0b1b('0x37')]['filter']){_0x2c02c7[_0x0b1b('0x45')]=_[_0x0b1b('0x44')](_0x2c02c7[_0x0b1b('0x45')],{'$or':_[_0x0b1b('0x36')](_0x2c02c7[_0x0b1b('0x3c')],function(_0x58ab52){var _0x2a4a70={};_0x2a4a70[_0x58ab52]={'$like':'%'+_0x26cbab[_0x0b1b('0x37')][_0x0b1b('0x43')]+'%'};return _0x2a4a70;})});}_0x2c02c7=_[_0x0b1b('0x44')]({},_0x2c02c7,_0x26cbab[_0x0b1b('0x8d')]);return _0x2ef78c[_0x0b1b('0x8c')](_0x2c02c7);}})[_0x0b1b('0x29')](function(_0x2473cd){if(_0x2473cd){_0x193ddd=_0x2473cd[_0x0b1b('0x3d')];if(!_0x26cbab[_0x0b1b('0x37')][_0x0b1b('0x3e')](_0x0b1b('0x3f'))){_0x2c02c7[_0x0b1b('0x40')]=qs[_0x0b1b('0x40')](_0x26cbab[_0x0b1b('0x37')][_0x0b1b('0x40')]);_0x2c02c7['offset']=qs['offset'](_0x26cbab[_0x0b1b('0x37')][_0x0b1b('0x22')]);}return _0x2ef78c['getAgents'](_0x2c02c7);}})[_0x0b1b('0x29')](function(_0x32b26b){if(_0x32b26b){return _0x32b26b?{'count':_0x193ddd,'rows':_0x32b26b}:null;}})[_0x0b1b('0x29')](respondWithResult(_0x10a9e1,null))[_0x0b1b('0x4c')](handleError(_0x10a9e1,null));}; \ No newline at end of file +var _0x6ccc=['body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserOpenchannelQueue','keys','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','removeTeams','Team','select','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','isEmpty','emit','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','name','send','map','OpenchannelQueue','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x6ccc,0xc2));var _0xc6cc=function(_0x3198fd,_0x3729d8){_0x3198fd=_0x3198fd-0x0;var _0x2dd0b=_0x6ccc[_0x3198fd];return _0x2dd0b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc6cc('0x0'));var jsonpatch=require(_0xc6cc('0x1'));var rp=require(_0xc6cc('0x2'));var moment=require(_0xc6cc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc6cc('0x4'));var util=require(_0xc6cc('0x5'));var path=require(_0xc6cc('0x6'));var sox=require(_0xc6cc('0x7'));var csv=require('to-csv');var ejs=require(_0xc6cc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc6cc('0x9'));var crypto=require(_0xc6cc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc6cc('0xb'));var toCsv=require(_0xc6cc('0xc'));var querystring=require(_0xc6cc('0xd'));var Papa=require('papaparse');var Redis=require(_0xc6cc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc6cc('0xf'));var as=require(_0xc6cc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc6cc('0x11'))(_0xc6cc('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc6cc('0x13'));var db=require('../../mysqldb')['db'];config[_0xc6cc('0x14')]=_['defaults'](config[_0xc6cc('0x14')],{'host':_0xc6cc('0x15'),'port':0x18eb});var socket=require(_0xc6cc('0x16'))(new Redis(config['redis']));require(_0xc6cc('0x17'))['register'](socket);function respondWithStatusCode(_0x437aaa,_0x348943){_0x348943=_0x348943||0xcc;return function(_0x57aade){if(_0x57aade){return _0x437aaa[_0xc6cc('0x18')](_0x348943);}return _0x437aaa[_0xc6cc('0x19')](_0x348943)[_0xc6cc('0x1a')]();};}function respondWithResult(_0x167c52,_0x322207){_0x322207=_0x322207||0xc8;return function(_0x2518de){if(_0x2518de){return _0x167c52[_0xc6cc('0x19')](_0x322207)[_0xc6cc('0x1b')](_0x2518de);}};}function respondWithFilteredResult(_0x45a14b,_0x3a683f){return function(_0xeb5bc3){if(_0xeb5bc3){var _0x33cb30=typeof _0x3a683f[_0xc6cc('0x1c')]===_0xc6cc('0x1d')&&typeof _0x3a683f[_0xc6cc('0x1e')]===_0xc6cc('0x1d');var _0x1daff2=_0xeb5bc3['count'];var _0x810b78=_0x33cb30?0x0:_0x3a683f[_0xc6cc('0x1c')];var _0x48be43=_0x33cb30?_0xeb5bc3[_0xc6cc('0x1f')]:_0x3a683f[_0xc6cc('0x1c')]+_0x3a683f[_0xc6cc('0x1e')];var _0x578277;if(_0x48be43>=_0x1daff2){_0x48be43=_0x1daff2;_0x578277=0xc8;}else{_0x578277=0xce;}_0x45a14b[_0xc6cc('0x19')](_0x578277);return _0x45a14b[_0xc6cc('0x20')](_0xc6cc('0x21'),_0x810b78+'-'+_0x48be43+'/'+_0x1daff2)[_0xc6cc('0x1b')](_0xeb5bc3);}return null;};}function patchUpdates(_0x557799){return function(_0x117b27){try{jsonpatch['apply'](_0x117b27,_0x557799,!![]);}catch(_0x3790ca){return BPromise['reject'](_0x3790ca);}return _0x117b27[_0xc6cc('0x22')]();};}function saveUpdates(_0x3e8b41,_0x108fc7){return function(_0x5c2773){if(_0x5c2773){return _0x5c2773[_0xc6cc('0x23')](_0x3e8b41)[_0xc6cc('0x24')](function(_0x3c1965){return _0x3c1965;});}return null;};}function removeEntity(_0x39cefb,_0x2c0dc7){return function(_0x2f278d){if(_0x2f278d){return _0x2f278d['destroy']()[_0xc6cc('0x24')](function(){var _0x4ae12d=_0x2f278d[_0xc6cc('0x25')]({'plain':!![]});var _0x2016a4=_0xc6cc('0x26');return db[_0xc6cc('0x27')][_0xc6cc('0x28')]({'where':{'type':_0x2016a4,'resourceId':_0x4ae12d['id']}})[_0xc6cc('0x24')](function(){return _0x2f278d;});})[_0xc6cc('0x24')](function(){_0x39cefb[_0xc6cc('0x19')](0xcc)[_0xc6cc('0x1a')]();});}};}function handleEntityNotFound(_0x56f6fc,_0x7f2c1c){return function(_0x3ce246){if(!_0x3ce246){_0x56f6fc[_0xc6cc('0x18')](0x194);}return _0x3ce246;};}function handleError(_0x1ddb01,_0x5de4ec){_0x5de4ec=_0x5de4ec||0x1f4;return function(_0x509010){logger[_0xc6cc('0x29')](_0x509010[_0xc6cc('0x2a')]);if(_0x509010[_0xc6cc('0x2b')]){delete _0x509010[_0xc6cc('0x2b')];}_0x1ddb01[_0xc6cc('0x19')](_0x5de4ec)[_0xc6cc('0x2c')](_0x509010);};}exports['index']=function(_0xf3e378,_0x1db0ec){var _0x2f7d5d={},_0x54a410={},_0xbab5bf={'count':0x0,'rows':[]};var _0x42dafd=_[_0xc6cc('0x2d')](db[_0xc6cc('0x2e')][_0xc6cc('0x2f')],function(_0x372443){return{'name':_0x372443[_0xc6cc('0x30')],'type':_0x372443[_0xc6cc('0x31')]['key']};});_0x54a410['model']=_[_0xc6cc('0x2d')](_0x42dafd,_0xc6cc('0x2b'));_0x54a410[_0xc6cc('0x32')]=_['keys'](_0xf3e378[_0xc6cc('0x32')]);_0x54a410[_0xc6cc('0x33')]=_[_0xc6cc('0x34')](_0x54a410[_0xc6cc('0x35')],_0x54a410[_0xc6cc('0x32')]);_0x2f7d5d[_0xc6cc('0x36')]=_[_0xc6cc('0x34')](_0x54a410[_0xc6cc('0x35')],qs[_0xc6cc('0x37')](_0xf3e378[_0xc6cc('0x32')][_0xc6cc('0x37')]));_0x2f7d5d[_0xc6cc('0x36')]=_0x2f7d5d[_0xc6cc('0x36')][_0xc6cc('0x38')]?_0x2f7d5d[_0xc6cc('0x36')]:_0x54a410[_0xc6cc('0x35')];if(!_0xf3e378[_0xc6cc('0x32')][_0xc6cc('0x39')](_0xc6cc('0x3a'))){_0x2f7d5d['limit']=qs[_0xc6cc('0x1e')](_0xf3e378['query'][_0xc6cc('0x1e')]);_0x2f7d5d[_0xc6cc('0x1c')]=qs['offset'](_0xf3e378[_0xc6cc('0x32')][_0xc6cc('0x1c')]);}_0x2f7d5d[_0xc6cc('0x3b')]=qs[_0xc6cc('0x3c')](_0xf3e378[_0xc6cc('0x32')][_0xc6cc('0x3c')]);_0x2f7d5d['where']=qs['filters'](_[_0xc6cc('0x3d')](_0xf3e378[_0xc6cc('0x32')],_0x54a410[_0xc6cc('0x33')]),_0x42dafd);if(_0xf3e378[_0xc6cc('0x32')]['filter']){_0x2f7d5d['where']=_['merge'](_0x2f7d5d[_0xc6cc('0x3e')],{'$or':_[_0xc6cc('0x2d')](_0x42dafd,function(_0x457643){if(_0x457643['type']!=='VIRTUAL'){var _0x3f21c5={};_0x3f21c5[_0x457643[_0xc6cc('0x2b')]]={'$like':'%'+_0xf3e378[_0xc6cc('0x32')][_0xc6cc('0x3f')]+'%'};return _0x3f21c5;}})});}_0x2f7d5d=_[_0xc6cc('0x40')]({},_0x2f7d5d,_0xf3e378[_0xc6cc('0x41')]);var _0x118531={'where':_0x2f7d5d[_0xc6cc('0x3e')]};return db[_0xc6cc('0x2e')][_0xc6cc('0x1f')](_0x118531)[_0xc6cc('0x24')](function(_0x4c65fc){_0xbab5bf[_0xc6cc('0x1f')]=_0x4c65fc;if(_0xf3e378[_0xc6cc('0x32')][_0xc6cc('0x42')]){_0x2f7d5d[_0xc6cc('0x43')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xc6cc('0x44')](_0x2f7d5d);})[_0xc6cc('0x24')](function(_0x11a246){_0xbab5bf[_0xc6cc('0x45')]=_0x11a246;return _0xbab5bf;})[_0xc6cc('0x24')](respondWithFilteredResult(_0x1db0ec,_0x2f7d5d))[_0xc6cc('0x46')](handleError(_0x1db0ec,null));};exports['show']=function(_0x11cc75,_0x57d2b2){var _0x545c2f={'raw':!![],'where':{'id':_0x11cc75[_0xc6cc('0x47')]['id']}},_0x57dac7={};_0x57dac7[_0xc6cc('0x35')]=_['keys'](db[_0xc6cc('0x2e')]['rawAttributes']);_0x57dac7['query']=_['keys'](_0x11cc75['query']);_0x57dac7[_0xc6cc('0x33')]=_['intersection'](_0x57dac7[_0xc6cc('0x35')],_0x57dac7[_0xc6cc('0x32')]);_0x545c2f['attributes']=_[_0xc6cc('0x34')](_0x57dac7[_0xc6cc('0x35')],qs[_0xc6cc('0x37')](_0x11cc75['query'][_0xc6cc('0x37')]));_0x545c2f[_0xc6cc('0x36')]=_0x545c2f['attributes'][_0xc6cc('0x38')]?_0x545c2f[_0xc6cc('0x36')]:_0x57dac7['model'];if(_0x11cc75[_0xc6cc('0x32')][_0xc6cc('0x42')]){_0x545c2f['include']=[{'all':!![]}];}_0x545c2f=_[_0xc6cc('0x40')]({},_0x545c2f,_0x11cc75[_0xc6cc('0x41')]);return db[_0xc6cc('0x2e')][_0xc6cc('0x48')](_0x545c2f)[_0xc6cc('0x24')](handleEntityNotFound(_0x57d2b2,null))['then'](respondWithResult(_0x57d2b2,null))[_0xc6cc('0x46')](handleError(_0x57d2b2,null));};exports[_0xc6cc('0x49')]=function(_0x4bb9b8,_0x5c6503){return db[_0xc6cc('0x2e')]['create'](_0x4bb9b8[_0xc6cc('0x4a')],{})[_0xc6cc('0x24')](function(_0x43c646){var _0x58e4e4=_0x4bb9b8[_0xc6cc('0x4b')][_0xc6cc('0x25')]({'plain':!![]});if(!_0x58e4e4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58e4e4[_0xc6cc('0x4c')]===_0xc6cc('0x4b')){var _0x417392=_0x43c646[_0xc6cc('0x25')]({'plain':!![]});var _0x67ef0b='OpenchannelQueues';return db[_0xc6cc('0x4d')][_0xc6cc('0x48')]({'where':{'name':_0x67ef0b,'userProfileId':_0x58e4e4['userProfileId']},'raw':!![]})[_0xc6cc('0x24')](function(_0x2b78d7){if(_0x2b78d7&&_0x2b78d7['autoAssociation']===0x0){return db[_0xc6cc('0x27')]['create']({'name':_0x417392[_0xc6cc('0x2b')],'resourceId':_0x417392['id'],'type':_0x2b78d7[_0xc6cc('0x2b')],'sectionId':_0x2b78d7['id']},{})[_0xc6cc('0x24')](function(){return _0x43c646;});}else{return _0x43c646;}})[_0xc6cc('0x46')](function(_0x1bddb8){logger[_0xc6cc('0x29')](_0xc6cc('0x4e'),_0x1bddb8);throw _0x1bddb8;});}return _0x43c646;})[_0xc6cc('0x24')](respondWithResult(_0x5c6503,0xc9))[_0xc6cc('0x46')](handleError(_0x5c6503,null));};exports[_0xc6cc('0x23')]=function(_0x53e101,_0x1824a4){if(_0x53e101[_0xc6cc('0x4a')]['id']){delete _0x53e101[_0xc6cc('0x4a')]['id'];}return db[_0xc6cc('0x2e')][_0xc6cc('0x48')]({'where':{'id':_0x53e101['params']['id']}})[_0xc6cc('0x24')](handleEntityNotFound(_0x1824a4,null))[_0xc6cc('0x24')](saveUpdates(_0x53e101['body'],null))[_0xc6cc('0x24')](respondWithResult(_0x1824a4,null))[_0xc6cc('0x46')](handleError(_0x1824a4,null));};exports[_0xc6cc('0x28')]=function(_0x5eee34,_0x415fa2){return db[_0xc6cc('0x2e')]['find']({'where':{'id':_0x5eee34[_0xc6cc('0x47')]['id']}})['then'](handleEntityNotFound(_0x415fa2,null))[_0xc6cc('0x24')](removeEntity(_0x415fa2,null))['catch'](handleError(_0x415fa2,null));};exports['describe']=function(_0x4a8534,_0x21ea4a){return db[_0xc6cc('0x2e')]['describe']()['then'](respondWithResult(_0x21ea4a,null))[_0xc6cc('0x46')](handleError(_0x21ea4a,null));};exports[_0xc6cc('0x4f')]=function(_0x422a38,_0x28ab6b,_0x17a79e){var _0x5d52ee={'raw':!![],'where':{}},_0x2c292d={},_0x5ebfe6;return db[_0xc6cc('0x2e')][_0xc6cc('0x50')]({'where':{'id':_0x422a38['params']['id']}})[_0xc6cc('0x24')](handleEntityNotFound(_0x28ab6b,null))[_0xc6cc('0x24')](function(_0x2a2551){if(_0x2a2551){_0x5ebfe6=_0x2a2551[_0xc6cc('0x25')]({'plain':!![]});_0x2c292d[_0xc6cc('0x35')]=_['keys'](db[_0xc6cc('0x51')][_0xc6cc('0x2f')]);_0x2c292d[_0xc6cc('0x32')]=_[_0xc6cc('0x52')](_0x422a38[_0xc6cc('0x32')]);_0x2c292d['filters']=_[_0xc6cc('0x34')](_0x2c292d[_0xc6cc('0x35')],_0x2c292d[_0xc6cc('0x32')]);_0x5d52ee['attributes']=_[_0xc6cc('0x34')](_0x2c292d['model'],qs[_0xc6cc('0x37')](_0x422a38[_0xc6cc('0x32')][_0xc6cc('0x37')]));_0x5d52ee[_0xc6cc('0x36')]=_0x5d52ee[_0xc6cc('0x36')][_0xc6cc('0x38')]?_0x5d52ee[_0xc6cc('0x36')]:_0x2c292d[_0xc6cc('0x35')];if(!_0x422a38['query']['hasOwnProperty'](_0xc6cc('0x3a'))){_0x5d52ee[_0xc6cc('0x1e')]=qs[_0xc6cc('0x1e')](_0x422a38['query'][_0xc6cc('0x1e')]);_0x5d52ee[_0xc6cc('0x1c')]=qs[_0xc6cc('0x1c')](_0x422a38['query']['offset']);}_0x5d52ee[_0xc6cc('0x3b')]=qs[_0xc6cc('0x3c')](_0x422a38[_0xc6cc('0x32')][_0xc6cc('0x3c')]);_0x5d52ee['where']=qs[_0xc6cc('0x33')](_[_0xc6cc('0x3d')](_0x422a38[_0xc6cc('0x32')],_0x2c292d['filters']));_0x5d52ee[_0xc6cc('0x3e')][_0xc6cc('0x53')]=_0x2a2551['id'];if(_0x422a38[_0xc6cc('0x32')][_0xc6cc('0x3f')]){_0x5d52ee[_0xc6cc('0x3e')]=_[_0xc6cc('0x40')](_0x5d52ee[_0xc6cc('0x3e')],{'$or':_[_0xc6cc('0x2d')](_0x5d52ee[_0xc6cc('0x36')],function(_0xc5c057){var _0x2ec760={};_0x2ec760[_0xc5c057]={'$like':'%'+_0x422a38[_0xc6cc('0x32')][_0xc6cc('0x3f')]+'%'};return _0x2ec760;})});}_0x5d52ee=_['merge']({},_0x5d52ee,_0x422a38[_0xc6cc('0x41')]);return db[_0xc6cc('0x51')]['findAll'](_0x5d52ee);}})[_0xc6cc('0x24')](function(_0xf7390){if(_0xf7390){return db[_0xc6cc('0x54')][_0xc6cc('0x55')]({'where':{'id':_[_0xc6cc('0x2d')](_0xf7390,_0xc6cc('0x56')),'role':_0xc6cc('0x57')},'attributes':['id',_0xc6cc('0x2b'),_0xc6cc('0x58'),_0xc6cc('0x59'),_0xc6cc('0x5a')]});}})[_0xc6cc('0x24')](function(_0x43ac8e){if(_0x43ac8e){return{'count':_0x43ac8e['count'],'rows':_[_0xc6cc('0x2d')](_0x43ac8e[_0xc6cc('0x45')],function(_0x5d9156){return{'membername':_0x5d9156['name'],'UserId':_0x5d9156['id'],'queue_name':_0x5ebfe6[_0xc6cc('0x2b')],'OpenchannelQueueId':_0x5ebfe6['id'],'interface':util[_0xc6cc('0x5b')](_0xc6cc('0x5c'),_0xc6cc('0x5d'),_0x5d9156[_0xc6cc('0x2b')]),'penalty':0x0,'paused':_0x5d9156[_0xc6cc('0x58')],'createdAt':_0x5d9156[_0xc6cc('0x5a')],'updatedAt':_0x5d9156['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc6cc('0x24')](respondWithFilteredResult(_0x28ab6b,_0x5d52ee))[_0xc6cc('0x46')](handleError(_0x28ab6b,null));};exports[_0xc6cc('0x5e')]=function(_0x12b6ce,_0x551199,_0x5127de){var _0xa613={};var _0x339b84={};var _0x18d4d2;var _0x28b55e;return db['OpenchannelQueue'][_0xc6cc('0x50')]({'where':{'id':_0x12b6ce[_0xc6cc('0x47')]['id']}})[_0xc6cc('0x24')](handleEntityNotFound(_0x551199,null))[_0xc6cc('0x24')](function(_0x16c3c8){if(_0x16c3c8){_0x18d4d2=_0x16c3c8;_0x339b84[_0xc6cc('0x35')]=_[_0xc6cc('0x52')](db['Team'][_0xc6cc('0x2f')]);_0x339b84[_0xc6cc('0x32')]=_[_0xc6cc('0x52')](_0x12b6ce['query']);_0x339b84[_0xc6cc('0x33')]=_[_0xc6cc('0x34')](_0x339b84[_0xc6cc('0x35')],_0x339b84['query']);_0xa613['attributes']=_[_0xc6cc('0x34')](_0x339b84['model'],qs[_0xc6cc('0x37')](_0x12b6ce[_0xc6cc('0x32')][_0xc6cc('0x37')]));_0xa613['attributes']=_0xa613['attributes'][_0xc6cc('0x38')]?_0xa613[_0xc6cc('0x36')]:_0x339b84['model'];_0xa613[_0xc6cc('0x3b')]=qs['sort'](_0x12b6ce[_0xc6cc('0x32')]['sort']);_0xa613[_0xc6cc('0x3e')]=qs[_0xc6cc('0x33')](_[_0xc6cc('0x3d')](_0x12b6ce[_0xc6cc('0x32')],_0x339b84[_0xc6cc('0x33')]));if(_0x12b6ce[_0xc6cc('0x32')][_0xc6cc('0x3f')]){_0xa613[_0xc6cc('0x3e')]=_[_0xc6cc('0x40')](_0xa613[_0xc6cc('0x3e')],{'$or':_['map'](_0xa613['attributes'],function(_0x45118d){var _0x59a121={};_0x59a121[_0x45118d]={'$like':'%'+_0x12b6ce[_0xc6cc('0x32')][_0xc6cc('0x3f')]+'%'};return _0x59a121;})});}_0xa613=_['merge']({},_0xa613,_0x12b6ce[_0xc6cc('0x41')]);return _0x18d4d2[_0xc6cc('0x5e')](_0xa613);}})[_0xc6cc('0x24')](function(_0x3fd230){if(_0x3fd230){_0x28b55e=_0x3fd230['length'];if(!_0x12b6ce[_0xc6cc('0x32')][_0xc6cc('0x39')]('nolimit')){_0xa613['limit']=qs[_0xc6cc('0x1e')](_0x12b6ce['query'][_0xc6cc('0x1e')]);_0xa613[_0xc6cc('0x1c')]=qs['offset'](_0x12b6ce[_0xc6cc('0x32')]['offset']);}return _0x18d4d2[_0xc6cc('0x5e')](_0xa613);}})[_0xc6cc('0x24')](function(_0x12e77b){if(_0x12e77b){return _0x12e77b?{'count':_0x28b55e,'rows':_0x12e77b}:null;}})[_0xc6cc('0x24')](respondWithResult(_0x551199,null))[_0xc6cc('0x46')](handleError(_0x551199,null));};exports[_0xc6cc('0x5f')]=function(_0x1b6f67,_0x54592e,_0x1256bc){var _0x1792d2=_0x1b6f67[_0xc6cc('0x4a')][_0xc6cc('0x60')];return db['Team'][_0xc6cc('0x44')]({'where':{'id':_0x1792d2},'attributes':['id'],'include':[{'model':db[_0xc6cc('0x54')],'as':_0xc6cc('0x61'),'attributes':['id','name',_0xc6cc('0x62'),_0xc6cc('0x63'),_0xc6cc('0x64')],'raw':!![]}]})[_0xc6cc('0x24')](function(_0x36e687){if(_0x36e687){var _0x2ac22f=_[_0xc6cc('0x65')](_0x36e687,function(_0x1eedb1){var _0x4214ed=_0x1eedb1['get']({'plain':!![]});return _0x4214ed[_0xc6cc('0x61')];});return db[_0xc6cc('0x2e')][_0xc6cc('0x48')]({'where':{'id':_0x1b6f67['params']['id']}})[_0xc6cc('0x24')](function(_0x47e38a){return db['sequelize'][_0xc6cc('0x66')](function(_0x4655e3){return _0x47e38a[_0xc6cc('0x5f')](_0x1792d2,{'transaction':_0x4655e3})[_0xc6cc('0x24')](function(){return BPromise[_0xc6cc('0x67')](_0x2ac22f,function(_0x1622df){return db[_0xc6cc('0x51')]['findOrCreate']({'where':{'UserId':_0x1622df['id'],'OpenchannelQueueId':_0x1b6f67[_0xc6cc('0x47')]['id']},'transaction':_0x4655e3});});})[_0xc6cc('0x24')](function(){_0x2ac22f['forEach'](function(_0x152a13){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x152a13['id'],'OpenchannelQueueId':_0x47e38a['id']});});});});});}})[_0xc6cc('0x24')](respondWithStatusCode(_0x54592e,null))['catch'](handleError(_0x54592e,null));};exports[_0xc6cc('0x68')]=function(_0x2a156c,_0x100947,_0x170f9d){return db[_0xc6cc('0x69')][_0xc6cc('0x44')]({'where':{'id':_0x2a156c[_0xc6cc('0x32')][_0xc6cc('0x60')]},'attributes':['id'],'include':[{'model':db[_0xc6cc('0x54')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc6cc('0x24')](handleEntityNotFound(_0x100947,null))[_0xc6cc('0x24')](function(_0x11f3d2){var _0x1615b3=_[_0xc6cc('0x2d')](_0x11f3d2,'id');var _0x63fbe=[];var _0x7ea7ea=[];var _0x32f4f3=squel[_0xc6cc('0x6a')]();_0x32f4f3['field'](_0xc6cc('0x6b'))['from'](_0xc6cc('0x6c'),'tq')[_0xc6cc('0x6d')](_0xc6cc('0x6e'),'ut',_0xc6cc('0x6f'))['where'](_0xc6cc('0x70'),_0x2a156c[_0xc6cc('0x47')]['id']);for(var _0x29ce87=0x0;_0x29ce87<_0x11f3d2[_0xc6cc('0x38')];_0x29ce87+=0x1){let _0x4e31a3=_0x11f3d2[_0x29ce87];for(var _0x4d0b1a=0x0;_0x4d0b1a<_0x4e31a3[_0xc6cc('0x61')][_0xc6cc('0x38')];_0x4d0b1a+=0x1){let _0x13216b=_0x4e31a3[_0xc6cc('0x61')][_0x4d0b1a];var _0x2dc3fb=_0x32f4f3[_0xc6cc('0x71')]();_0x2dc3fb[_0xc6cc('0x3e')](_0xc6cc('0x72'),_0x13216b['id']);_0x7ea7ea[_0xc6cc('0x73')](db[_0xc6cc('0x74')]['query'](_0x2dc3fb['toString'](),{'type':db[_0xc6cc('0x74')][_0xc6cc('0x75')][_0xc6cc('0x76')]})[_0xc6cc('0x24')](function(_0x137bac){if(_0x137bac[_0xc6cc('0x38')]===0x1){return _0x13216b['id'];}else{var _0x1d2667=_['every'](_[_0xc6cc('0x2d')](_0x137bac,_0xc6cc('0x77')),function(_0x404d10){return _[_0xc6cc('0x78')](_0x1615b3,_0x404d10);});if(_0x1d2667){return _0x13216b['id'];}}}));}}return BPromise[_0xc6cc('0x79')](_0x7ea7ea)[_0xc6cc('0x24')](function(_0x164dd3){_0x63fbe=_(_0x63fbe)[_0xc6cc('0x7a')](_0x164dd3)[_0xc6cc('0x7b')]()['value']();return db['OpenchannelQueue'][_0xc6cc('0x48')]({'where':{'id':_0x2a156c[_0xc6cc('0x47')]['id']}})[_0xc6cc('0x24')](function(_0x200b92){return db[_0xc6cc('0x74')][_0xc6cc('0x66')](function(_0x4f0ca5){return _0x200b92[_0xc6cc('0x68')](_0x2a156c[_0xc6cc('0x32')][_0xc6cc('0x60')],{'transaction':_0x4f0ca5})[_0xc6cc('0x24')](function(){if(!_[_0xc6cc('0x7c')](_0x63fbe)){return _0x200b92['removeAgents'](_0x63fbe,{'transaction':_0x4f0ca5});}})[_0xc6cc('0x24')](function(){_0x63fbe['forEach'](function(_0x40470c){socket[_0xc6cc('0x7d')](_0xc6cc('0x7e'),{'UserId':_0x40470c,'OpenchannelQueueId':_0x200b92['id']});});});});});});})[_0xc6cc('0x24')](respondWithStatusCode(_0x100947,null))['catch'](handleError(_0x100947,null));};exports[_0xc6cc('0x7f')]=function(_0x50242c,_0x35b9ea,_0x552368){return db['OpenchannelQueue'][_0xc6cc('0x48')]({'where':{'id':_0x50242c[_0xc6cc('0x47')]['id']}})[_0xc6cc('0x24')](handleEntityNotFound(_0x35b9ea,null))[_0xc6cc('0x24')](function(_0x38a705){if(_0x38a705){return _0x38a705[_0xc6cc('0x7f')](_0x50242c[_0xc6cc('0x4a')][_0xc6cc('0x60')],_[_0xc6cc('0x80')](_0x50242c[_0xc6cc('0x4a')],['ids','id'])||{})[_0xc6cc('0x81')](function(_0x4d1b31){for(var _0x4e98f9=0x0;_0x4e98f9<_0x50242c[_0xc6cc('0x4a')][_0xc6cc('0x60')][_0xc6cc('0x38')];_0x4e98f9+=0x1){socket[_0xc6cc('0x7d')](_0xc6cc('0x82'),{'UserId':_0x50242c[_0xc6cc('0x4a')][_0xc6cc('0x60')][_0x4e98f9],'OpenchannelQueueId':_0x50242c[_0xc6cc('0x47')]['id']});}return _0x4d1b31;});}})['then'](respondWithResult(_0x35b9ea,null))['catch'](handleError(_0x35b9ea,null));};exports[_0xc6cc('0x83')]=function(_0x54cfe3,_0x7fdd48,_0x4dac32){return db[_0xc6cc('0x2e')][_0xc6cc('0x48')]({'where':{'id':_0x54cfe3['params']['id']}})[_0xc6cc('0x24')](handleEntityNotFound(_0x7fdd48,null))['then'](function(_0x5153fa){if(_0x5153fa){return _0x5153fa[_0xc6cc('0x83')](_0x54cfe3[_0xc6cc('0x32')][_0xc6cc('0x60')])[_0xc6cc('0x24')](function(){if(_[_0xc6cc('0x84')](_0x54cfe3[_0xc6cc('0x32')][_0xc6cc('0x60')])){for(var _0xec31e1=0x0;_0xec31e1<_0x54cfe3[_0xc6cc('0x32')][_0xc6cc('0x60')]['length'];_0xec31e1+=0x1){socket[_0xc6cc('0x7d')](_0xc6cc('0x7e'),{'UserId':Number(_0x54cfe3[_0xc6cc('0x32')][_0xc6cc('0x60')][_0xec31e1]),'OpenchannelQueueId':Number(_0x54cfe3[_0xc6cc('0x47')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x54cfe3[_0xc6cc('0x32')][_0xc6cc('0x60')]),'OpenchannelQueueId':Number(_0x54cfe3[_0xc6cc('0x47')]['id'])});}});}})[_0xc6cc('0x24')](respondWithStatusCode(_0x7fdd48,null))[_0xc6cc('0x46')](handleError(_0x7fdd48,null));};exports[_0xc6cc('0x85')]=function(_0x164626,_0x323a04,_0x426c03){var _0x37d8c5={};var _0x3d2501={};var _0x2a47d5;var _0x338a4d;return db[_0xc6cc('0x2e')][_0xc6cc('0x50')]({'where':{'id':_0x164626[_0xc6cc('0x47')]['id']}})[_0xc6cc('0x24')](handleEntityNotFound(_0x323a04,null))['then'](function(_0x1c4469){if(_0x1c4469){_0x2a47d5=_0x1c4469;_0x3d2501[_0xc6cc('0x35')]=_[_0xc6cc('0x52')](db['User']['rawAttributes']);_0x3d2501[_0xc6cc('0x32')]=_[_0xc6cc('0x52')](_0x164626[_0xc6cc('0x32')]);_0x3d2501[_0xc6cc('0x33')]=_['intersection'](_0x3d2501[_0xc6cc('0x35')],_0x3d2501['query']);_0x37d8c5[_0xc6cc('0x36')]=_[_0xc6cc('0x34')](_0x3d2501[_0xc6cc('0x35')],qs[_0xc6cc('0x37')](_0x164626['query'][_0xc6cc('0x37')]));_0x37d8c5[_0xc6cc('0x36')]=_0x37d8c5['attributes'][_0xc6cc('0x38')]?_0x37d8c5[_0xc6cc('0x36')]:_0x3d2501[_0xc6cc('0x35')];_0x37d8c5['order']=qs[_0xc6cc('0x3c')](_0x164626[_0xc6cc('0x32')]['sort']);_0x37d8c5[_0xc6cc('0x3e')]=qs[_0xc6cc('0x33')](_[_0xc6cc('0x3d')](_0x164626[_0xc6cc('0x32')],_0x3d2501['filters']));if(_0x164626[_0xc6cc('0x32')][_0xc6cc('0x3f')]){_0x37d8c5[_0xc6cc('0x3e')]=_[_0xc6cc('0x40')](_0x37d8c5[_0xc6cc('0x3e')],{'$or':_[_0xc6cc('0x2d')](_0x37d8c5[_0xc6cc('0x36')],function(_0x1fd1ec){var _0x18614d={};_0x18614d[_0x1fd1ec]={'$like':'%'+_0x164626[_0xc6cc('0x32')][_0xc6cc('0x3f')]+'%'};return _0x18614d;})});}_0x37d8c5=_[_0xc6cc('0x40')]({},_0x37d8c5,_0x164626['options']);return _0x2a47d5['getAgents'](_0x37d8c5);}})[_0xc6cc('0x24')](function(_0x2735a9){if(_0x2735a9){_0x338a4d=_0x2735a9[_0xc6cc('0x38')];if(!_0x164626[_0xc6cc('0x32')]['hasOwnProperty']('nolimit')){_0x37d8c5[_0xc6cc('0x1e')]=qs['limit'](_0x164626[_0xc6cc('0x32')]['limit']);_0x37d8c5[_0xc6cc('0x1c')]=qs['offset'](_0x164626['query'][_0xc6cc('0x1c')]);}return _0x2a47d5[_0xc6cc('0x85')](_0x37d8c5);}})['then'](function(_0x12716f){if(_0x12716f){return _0x12716f?{'count':_0x338a4d,'rows':_0x12716f}:null;}})[_0xc6cc('0x24')](respondWithResult(_0x323a04,null))['catch'](handleError(_0x323a04,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 4bc1fd4..7b68490 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 _0x1e60=['OpenchannelQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4ed4bf,_0x664e){var _0x26853f=function(_0x164078){while(--_0x164078){_0x4ed4bf['push'](_0x4ed4bf['shift']());}};_0x26853f(++_0x664e);}(_0x1e60,0xbc));var _0x01e6=function(_0x48188b,_0x1adcc5){_0x48188b=_0x48188b-0x0;var _0x24357c=_0x1e60[_0x48188b];return _0x24357c;};'use strict';var EventEmitter=require(_0x01e6('0x0'));var OpenchannelQueue=require(_0x01e6('0x1'))['db'][_0x01e6('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x01e6('0x3'),'afterUpdate':_0x01e6('0x4'),'afterDestroy':_0x01e6('0x5')};function emitEvent(_0x2a1cbc){return function(_0x17329a,_0x424f76,_0x5da506){OpenchannelQueueEvents[_0x01e6('0x6')](_0x2a1cbc+':'+_0x17329a['id'],_0x17329a);OpenchannelQueueEvents['emit'](_0x2a1cbc,_0x17329a);_0x5da506(null);};}for(var e in events){if(events[_0x01e6('0x7')](e)){var event=events[e];OpenchannelQueue[_0x01e6('0x8')](e,emitEvent(event));}}module[_0x01e6('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x5017=['remove','emit','hasOwnProperty','exports','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5017,0x1e0));var _0x7501=function(_0x1198e3,_0x317c4d){_0x1198e3=_0x1198e3-0x0;var _0x432dc2=_0x5017[_0x1198e3];return _0x432dc2;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x7501('0x0'))['db'][_0x7501('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x7501('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7501('0x3')};function emitEvent(_0x5f540c){return function(_0x3958dc,_0x177248,_0xf6c8e4){OpenchannelQueueEvents[_0x7501('0x4')](_0x5f540c+':'+_0x3958dc['id'],_0x3958dc);OpenchannelQueueEvents[_0x7501('0x4')](_0x5f540c,_0x3958dc);_0xf6c8e4(null);};}for(var e in events){if(events[_0x7501('0x5')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x7501('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 0731076..2ab53ad 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 _0x39cb=['openchannel_queues','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x169184,_0x389f12){var _0x34ae1a=function(_0x5f4fae){while(--_0x5f4fae){_0x169184['push'](_0x169184['shift']());}};_0x34ae1a(++_0x389f12);}(_0x39cb,0x1bd));var _0xb39c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x39cb[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var logger=require(_0xb39c('0x1'))('api');var moment=require(_0xb39c('0x2'));var BPromise=require(_0xb39c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb39c('0x4'));var rimraf=require(_0xb39c('0x5'));var config=require(_0xb39c('0x6'));var attributes=require(_0xb39c('0x7'));module[_0xb39c('0x8')]=function(_0x4ae4cf,_0x32cdcd){return _0x4ae4cf[_0xb39c('0x9')](_0xb39c('0xa'),attributes,{'tableName':_0xb39c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4a0=['OpenchannelQueue','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports','define'];(function(_0x5afff6,_0x3c2363){var _0x39adb1=function(_0x3768ef){while(--_0x3768ef){_0x5afff6['push'](_0x5afff6['shift']());}};_0x39adb1(++_0x3c2363);}(_0xd4a0,0x187));var _0x0d4a=function(_0x1122d7,_0x457e55){_0x1122d7=_0x1122d7-0x0;var _0x239667=_0xd4a0[_0x1122d7];return _0x239667;};'use strict';var _=require(_0x0d4a('0x0'));var util=require(_0x0d4a('0x1'));var logger=require(_0x0d4a('0x2'))(_0x0d4a('0x3'));var moment=require('moment');var BPromise=require(_0x0d4a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d4a('0x5'));var rimraf=require('rimraf');var config=require(_0x0d4a('0x6'));var attributes=require('./openchannelQueue.attributes');module[_0x0d4a('0x7')]=function(_0x41102a,_0x23cc89){return _0x41102a[_0x0d4a('0x8')](_0x0d4a('0x9'),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 4b806e0..af8fac8 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 _0xd947=['findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','request\x20sent','debug','error','code','OpenchannelQueue,\x20%s,\x20%s','message','info','catch','OpenchannelQueue'];(function(_0x5ce075,_0x20b649){var _0x595e7d=function(_0x4384dc){while(--_0x4384dc){_0x5ce075['push'](_0x5ce075['shift']());}};_0x595e7d(++_0x20b649);}(_0xd947,0xa9));var _0x7d94=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd947[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7d94('0x0'));var util=require('util');var moment=require(_0x7d94('0x1'));var BPromise=require(_0x7d94('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d94('0x3'));var db=require(_0x7d94('0x4'))['db'];var utils=require(_0x7d94('0x5'));var logger=require(_0x7d94('0x6'))(_0x7d94('0x7'));var config=require(_0x7d94('0x8'));var jayson=require(_0x7d94('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x7d94('0xa')](config['redis'],{'host':_0x7d94('0xb'),'port':0x18eb});var socket=require(_0x7d94('0xc'))(new Redis(config['redis']));require(_0x7d94('0xd'))[_0x7d94('0xe')](socket);function respondWithRpcPromise(_0x177b50,_0x4b984f,_0x539a03){return new BPromise(function(_0x33dde8,_0x18aa50){return client[_0x7d94('0xf')](_0x177b50,_0x539a03)[_0x7d94('0x10')](function(_0x21c1fa){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x4b984f,_0x7d94('0x11'));logger[_0x7d94('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4b984f,_0x7d94('0x11'),JSON['stringify'](_0x21c1fa));if(_0x21c1fa[_0x7d94('0x13')]){if(_0x21c1fa['error'][_0x7d94('0x14')]===0x1f4){logger['error'](_0x7d94('0x15'),_0x4b984f,_0x21c1fa[_0x7d94('0x13')]['message']);return _0x18aa50(_0x21c1fa[_0x7d94('0x13')]['message']);}logger[_0x7d94('0x13')](_0x7d94('0x15'),_0x4b984f,_0x21c1fa['error']['message']);return _0x33dde8(_0x21c1fa[_0x7d94('0x13')][_0x7d94('0x16')]);}else{logger[_0x7d94('0x17')](_0x7d94('0x15'),_0x4b984f,'request\x20sent');_0x33dde8(_0x21c1fa['result'][_0x7d94('0x16')]);}})[_0x7d94('0x18')](function(_0x1cad2f){logger[_0x7d94('0x13')](_0x7d94('0x15'),_0x4b984f,_0x1cad2f);_0x18aa50(_0x1cad2f);});});}exports['GetOpenchannelQueue']=function(_0xf389aa){var _0x378a63=this;return new Promise(function(_0x2c4d1c,_0x3f18ac){return db[_0x7d94('0x19')][_0x7d94('0x1a')]({'raw':_0xf389aa[_0x7d94('0x1b')]?_0xf389aa[_0x7d94('0x1b')][_0x7d94('0x1c')]===undefined?!![]:![]:!![],'where':_0xf389aa[_0x7d94('0x1b')]?_0xf389aa['options'][_0x7d94('0x1d')]||null:null,'attributes':_0xf389aa[_0x7d94('0x1b')]?_0xf389aa[_0x7d94('0x1b')][_0x7d94('0x1e')]||null:null,'limit':_0xf389aa['options']?_0xf389aa['options'][_0x7d94('0x1f')]||null:null,'include':_0xf389aa[_0x7d94('0x1b')]?_0xf389aa['options'][_0x7d94('0x20')]?_[_0x7d94('0x21')](_0xf389aa[_0x7d94('0x1b')][_0x7d94('0x20')],function(_0x1741d0){return{'model':db[_0x1741d0[_0x7d94('0x22')]],'as':_0x1741d0['as'],'attributes':_0x1741d0[_0x7d94('0x1e')],'include':_0x1741d0[_0x7d94('0x20')]?_[_0x7d94('0x21')](_0x1741d0[_0x7d94('0x20')],function(_0x1e70c2){return{'model':db[_0x1e70c2[_0x7d94('0x22')]],'as':_0x1e70c2['as'],'attributes':_0x1e70c2[_0x7d94('0x1e')],'include':_0x1e70c2[_0x7d94('0x20')]?_[_0x7d94('0x21')](_0x1e70c2[_0x7d94('0x20')],function(_0x8dfa9c){return{'model':db[_0x8dfa9c[_0x7d94('0x22')]],'as':_0x8dfa9c['as'],'attributes':_0x8dfa9c[_0x7d94('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x301ebe){logger['info'](_0x7d94('0x23'),_0xf389aa);logger[_0x7d94('0x12')](_0x7d94('0x23'),_0xf389aa,JSON[_0x7d94('0x24')](_0x301ebe));_0x2c4d1c(_0x301ebe);})[_0x7d94('0x18')](function(_0x3a0d28){logger[_0x7d94('0x13')]('GetOpenchannelQueue',_0x3a0d28[_0x7d94('0x16')],_0xf389aa);_0x3f18ac(_0x378a63[_0x7d94('0x13')](0x1f4,_0x3a0d28[_0x7d94('0x16')]));});});};exports[_0x7d94('0x25')]=function(_0x2030f5){var _0x138492=this;return new Promise(function(_0x5ee6fc,_0x4573fd){return db[_0x7d94('0x19')][_0x7d94('0x26')]({'raw':_0x2030f5[_0x7d94('0x1b')]?_0x2030f5[_0x7d94('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2030f5['options']?_0x2030f5[_0x7d94('0x1b')][_0x7d94('0x1d')]||null:null,'attributes':_0x2030f5[_0x7d94('0x1b')]?_0x2030f5[_0x7d94('0x1b')][_0x7d94('0x1e')]||null:null,'include':_0x2030f5[_0x7d94('0x1b')]?_0x2030f5['options'][_0x7d94('0x20')]?_['map'](_0x2030f5['options'][_0x7d94('0x20')],function(_0x5c2168){return{'model':db[_0x5c2168[_0x7d94('0x22')]],'as':_0x5c2168['as'],'attributes':_0x5c2168[_0x7d94('0x1e')],'include':_0x5c2168[_0x7d94('0x20')]?_[_0x7d94('0x21')](_0x5c2168[_0x7d94('0x20')],function(_0xd5b13f){return{'model':db[_0xd5b13f[_0x7d94('0x22')]],'as':_0xd5b13f['as'],'attributes':_0xd5b13f[_0x7d94('0x1e')],'include':_0xd5b13f[_0x7d94('0x20')]?_['map'](_0xd5b13f['include'],function(_0x422be3){return{'model':db[_0x422be3[_0x7d94('0x22')]],'as':_0x422be3['as'],'attributes':_0x422be3[_0x7d94('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7d94('0x10')](function(_0x3ad6d1){logger[_0x7d94('0x17')](_0x7d94('0x25'),_0x2030f5);logger[_0x7d94('0x12')](_0x7d94('0x25'),_0x2030f5,JSON[_0x7d94('0x24')](_0x3ad6d1));_0x5ee6fc(_0x3ad6d1);})['catch'](function(_0x413b54){logger[_0x7d94('0x13')]('ShowOpenchannelQueue',_0x413b54['message'],_0x2030f5);_0x4573fd(_0x138492['error'](0x1f4,_0x413b54[_0x7d94('0x16')]));});});}; \ No newline at end of file +var _0xdc72=['randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','include','model','ShowOpenchannelQueue','map','then','util','moment','bluebird'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0xdc72,0x165));var _0x2dc7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xdc72[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x2dc7('0x0'));var moment=require(_0x2dc7('0x1'));var BPromise=require(_0x2dc7('0x2'));var rs=require(_0x2dc7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2dc7('0x4'));var logger=require('../../config/logger')(_0x2dc7('0x5'));var config=require(_0x2dc7('0x6'));var jayson=require(_0x2dc7('0x7'));var client=jayson['client'][_0x2dc7('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2dc7('0x9')],{'host':_0x2dc7('0xa'),'port':0x18eb});var socket=require(_0x2dc7('0xb'))(new Redis(config[_0x2dc7('0x9')]));require(_0x2dc7('0xc'))['register'](socket);function respondWithRpcPromise(_0x9a6981,_0x20133a,_0x3ca24c){return new BPromise(function(_0x1de03c,_0x3df1b1){return client[_0x2dc7('0xd')](_0x9a6981,_0x3ca24c)['then'](function(_0x26cadc){logger[_0x2dc7('0xe')](_0x2dc7('0xf'),_0x20133a,_0x2dc7('0x10'));logger[_0x2dc7('0x11')](_0x2dc7('0x12'),_0x20133a,_0x2dc7('0x10'),JSON[_0x2dc7('0x13')](_0x26cadc));if(_0x26cadc['error']){if(_0x26cadc['error']['code']===0x1f4){logger[_0x2dc7('0x14')](_0x2dc7('0xf'),_0x20133a,_0x26cadc[_0x2dc7('0x14')][_0x2dc7('0x15')]);return _0x3df1b1(_0x26cadc['error'][_0x2dc7('0x15')]);}logger[_0x2dc7('0x14')](_0x2dc7('0xf'),_0x20133a,_0x26cadc[_0x2dc7('0x14')]['message']);return _0x1de03c(_0x26cadc[_0x2dc7('0x14')][_0x2dc7('0x15')]);}else{logger[_0x2dc7('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x20133a,_0x2dc7('0x10'));_0x1de03c(_0x26cadc[_0x2dc7('0x16')]['message']);}})[_0x2dc7('0x17')](function(_0x4fc42c){logger[_0x2dc7('0x14')](_0x2dc7('0xf'),_0x20133a,_0x4fc42c);_0x3df1b1(_0x4fc42c);});});}exports[_0x2dc7('0x18')]=function(_0x3f2da0){var _0x4fb5bd=this;return new Promise(function(_0x5c5f39,_0x16be37){return db[_0x2dc7('0x19')]['findAll']({'raw':_0x3f2da0[_0x2dc7('0x1a')]?_0x3f2da0[_0x2dc7('0x1a')][_0x2dc7('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f2da0['options']?_0x3f2da0[_0x2dc7('0x1a')][_0x2dc7('0x1c')]||null:null,'attributes':_0x3f2da0[_0x2dc7('0x1a')]?_0x3f2da0[_0x2dc7('0x1a')][_0x2dc7('0x1d')]||null:null,'limit':_0x3f2da0[_0x2dc7('0x1a')]?_0x3f2da0[_0x2dc7('0x1a')][_0x2dc7('0x1e')]||null:null,'include':_0x3f2da0['options']?_0x3f2da0[_0x2dc7('0x1a')][_0x2dc7('0x1f')]?_['map'](_0x3f2da0[_0x2dc7('0x1a')][_0x2dc7('0x1f')],function(_0x223202){return{'model':db[_0x223202[_0x2dc7('0x20')]],'as':_0x223202['as'],'attributes':_0x223202['attributes'],'include':_0x223202[_0x2dc7('0x1f')]?_['map'](_0x223202[_0x2dc7('0x1f')],function(_0x32c090){return{'model':db[_0x32c090[_0x2dc7('0x20')]],'as':_0x32c090['as'],'attributes':_0x32c090['attributes'],'include':_0x32c090[_0x2dc7('0x1f')]?_['map'](_0x32c090[_0x2dc7('0x1f')],function(_0x14e406){return{'model':db[_0x14e406[_0x2dc7('0x20')]],'as':_0x14e406['as'],'attributes':_0x14e406['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43f3ff){logger[_0x2dc7('0xe')](_0x2dc7('0x18'),_0x3f2da0);logger[_0x2dc7('0x11')]('GetOpenchannelQueue',_0x3f2da0,JSON[_0x2dc7('0x13')](_0x43f3ff));_0x5c5f39(_0x43f3ff);})[_0x2dc7('0x17')](function(_0x38d282){logger[_0x2dc7('0x14')](_0x2dc7('0x18'),_0x38d282[_0x2dc7('0x15')],_0x3f2da0);_0x16be37(_0x4fb5bd[_0x2dc7('0x14')](0x1f4,_0x38d282[_0x2dc7('0x15')]));});});};exports[_0x2dc7('0x21')]=function(_0x379bcf){var _0x427990=this;return new Promise(function(_0xa0cb1d,_0x896b39){return db[_0x2dc7('0x19')]['find']({'raw':_0x379bcf[_0x2dc7('0x1a')]?_0x379bcf[_0x2dc7('0x1a')][_0x2dc7('0x1b')]===undefined?!![]:![]:!![],'where':_0x379bcf[_0x2dc7('0x1a')]?_0x379bcf[_0x2dc7('0x1a')][_0x2dc7('0x1c')]||null:null,'attributes':_0x379bcf[_0x2dc7('0x1a')]?_0x379bcf[_0x2dc7('0x1a')][_0x2dc7('0x1d')]||null:null,'include':_0x379bcf[_0x2dc7('0x1a')]?_0x379bcf[_0x2dc7('0x1a')][_0x2dc7('0x1f')]?_[_0x2dc7('0x22')](_0x379bcf[_0x2dc7('0x1a')]['include'],function(_0x177498){return{'model':db[_0x177498[_0x2dc7('0x20')]],'as':_0x177498['as'],'attributes':_0x177498[_0x2dc7('0x1d')],'include':_0x177498[_0x2dc7('0x1f')]?_[_0x2dc7('0x22')](_0x177498[_0x2dc7('0x1f')],function(_0x20a5f4){return{'model':db[_0x20a5f4['model']],'as':_0x20a5f4['as'],'attributes':_0x20a5f4[_0x2dc7('0x1d')],'include':_0x20a5f4[_0x2dc7('0x1f')]?_[_0x2dc7('0x22')](_0x20a5f4[_0x2dc7('0x1f')],function(_0x158dce){return{'model':db[_0x158dce[_0x2dc7('0x20')]],'as':_0x158dce['as'],'attributes':_0x158dce[_0x2dc7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2dc7('0x23')](function(_0x130db5){logger[_0x2dc7('0xe')](_0x2dc7('0x21'),_0x379bcf);logger[_0x2dc7('0x11')]('ShowOpenchannelQueue',_0x379bcf,JSON[_0x2dc7('0x13')](_0x130db5));_0xa0cb1d(_0x130db5);})[_0x2dc7('0x17')](function(_0x197ccf){logger[_0x2dc7('0x14')](_0x2dc7('0x21'),_0x197ccf['message'],_0x379bcf);_0x896b39(_0x427990[_0x2dc7('0x14')](0x1f4,_0x197ccf['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 59595a9..fa6f952 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 _0x3ca1=['emit','removeListener','openchannelQueue:'];(function(_0x2ee4ae,_0x48d3fc){var _0x19f30d=function(_0x55c2f8){while(--_0x55c2f8){_0x2ee4ae['push'](_0x2ee4ae['shift']());}};_0x19f30d(++_0x48d3fc);}(_0x3ca1,0xa5));var _0x13ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ca1[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save','remove','update'];function createListener(_0x35fd16,_0x535d12){return function(_0x65a448){_0x535d12[_0x13ca('0x0')](_0x35fd16,_0x65a448);};}function removeListener(_0x2ee37f,_0x36ad3f){return function(){OpenchannelQueueEvents[_0x13ca('0x1')](_0x2ee37f,_0x36ad3f);};}exports['register']=function(_0x4e69cd){for(var _0x24194c=0x0,_0x47ad14=events['length'];_0x24194c<_0x47ad14;_0x24194c++){var _0x43566b=events[_0x24194c];var _0x27f2f6=createListener(_0x13ca('0x2')+_0x43566b,_0x4e69cd);OpenchannelQueueEvents['on'](_0x43566b,_0x27f2f6);}}; \ No newline at end of file +var _0x4dce=['remove','update','emit','removeListener','register','save'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x4dce,0xf5));var _0xe4dc=function(_0x1e8bea,_0x47bde9){_0x1e8bea=_0x1e8bea-0x0;var _0x29f756=_0x4dce[_0x1e8bea];return _0x29f756;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xe4dc('0x0'),_0xe4dc('0x1'),_0xe4dc('0x2')];function createListener(_0x6b7a57,_0x37825d){return function(_0x35c52a){_0x37825d[_0xe4dc('0x3')](_0x6b7a57,_0x35c52a);};}function removeListener(_0x1dd58d,_0x37b5f9){return function(){OpenchannelQueueEvents[_0xe4dc('0x4')](_0x1dd58d,_0x37b5f9);};}exports[_0xe4dc('0x5')]=function(_0xbc670e){for(var _0x3fa0ee=0x0,_0x30fb7e=events['length'];_0x3fa0ee<_0x30fb7e;_0x3fa0ee++){var _0x259ed5=events[_0x3fa0ee];var _0x480d3b=createListener('openchannelQueue:'+_0x259ed5,_0xbc670e);OpenchannelQueueEvents['on'](_0x259ed5,_0x480d3b);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index cbe55c5..d38b3e2 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 _0xb90b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x1b3f63,_0x5578c9){var _0x39005d=function(_0x3b99ff){while(--_0x3b99ff){_0x1b3f63['push'](_0x1b3f63['shift']());}};_0x39005d(++_0x5578c9);}(_0xb90b,0x14f));var _0xbb90=function(_0x4c1b08,_0x1bc47f){_0x4c1b08=_0x4c1b08-0x0;var _0x12e221=_0xb90b[_0x4c1b08];return _0x12e221;};'use strict';var multer=require(_0xbb90('0x0'));var util=require(_0xbb90('0x1'));var path=require(_0xbb90('0x2'));var timeout=require(_0xbb90('0x3'));var express=require(_0xbb90('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbb90('0x5'));var interaction=require(_0xbb90('0x6'));var config=require(_0xbb90('0x7'));var controller=require(_0xbb90('0x8'));router[_0xbb90('0x9')]('/',auth[_0xbb90('0xa')](),controller[_0xbb90('0xb')]);router[_0xbb90('0x9')](_0xbb90('0xc'),auth[_0xbb90('0xa')](),controller['describe']);router[_0xbb90('0x9')](_0xbb90('0xd'),auth[_0xbb90('0xa')](),controller[_0xbb90('0xe')]);router[_0xbb90('0xf')]('/',auth[_0xbb90('0xa')](),controller[_0xbb90('0x10')]);router['put']('/:id',auth[_0xbb90('0xa')](),controller[_0xbb90('0x11')]);router[_0xbb90('0x12')](_0xbb90('0xd'),auth[_0xbb90('0xa')](),controller[_0xbb90('0x13')]);module['exports']=router; \ No newline at end of file +var _0x780e=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x780e,0xc7));var _0xe780=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x780e[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xe780('0x0'));var util=require('util');var path=require(_0xe780('0x1'));var timeout=require(_0xe780('0x2'));var express=require('express');var router=express[_0xe780('0x3')]();var fs_extra=require(_0xe780('0x4'));var auth=require(_0xe780('0x5'));var interaction=require(_0xe780('0x6'));var config=require('../../config/environment');var controller=require(_0xe780('0x7'));router[_0xe780('0x8')]('/',auth[_0xe780('0x9')](),controller[_0xe780('0xa')]);router[_0xe780('0x8')]('/describe',auth[_0xe780('0x9')](),controller['describe']);router[_0xe780('0x8')](_0xe780('0xb'),auth[_0xe780('0x9')](),controller[_0xe780('0xc')]);router['post']('/',auth[_0xe780('0x9')](),controller['create']);router[_0xe780('0xd')](_0xe780('0xb'),auth[_0xe780('0x9')](),controller[_0xe780('0xe')]);router[_0xe780('0xf')](_0xe780('0xb'),auth[_0xe780('0x9')](),controller[_0xe780('0x10')]);module[_0xe780('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index fc0d4cc..14bd3e9 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 _0x6428=['sequelize','exports','STRING','DATE'];(function(_0x4132de,_0x5ef197){var _0x1df0eb=function(_0x1a13cc){while(--_0x1a13cc){_0x4132de['push'](_0x4132de['shift']());}};_0x1df0eb(++_0x5ef197);}(_0x6428,0x150));var _0x8642=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x6428[_0x28669c];return _0x4a3af6;};'use strict';var moment=require('moment');var Sequelize=require(_0x8642('0x0'));module[_0x8642('0x1')]={'uniqueid':{'type':Sequelize[_0x8642('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x8642('0x2')]},'joinAt':{'type':Sequelize[_0x8642('0x3')]},'leaveAt':{'type':Sequelize[_0x8642('0x3')]},'acceptAt':{'type':Sequelize[_0x8642('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x8642('0x2')]}}; \ No newline at end of file +var _0x82ad=['DATE','moment','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82ad,0x133));var _0xd82a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x82ad[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xd82a('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xd82a('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xd82a('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xd82a('0x2')]},'exitAt':{'type':Sequelize[_0xd82a('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 740a39d..f613b38 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 _0xf494=['create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','OpenchannelQueueReport','includeAll','include','findAll','rows','catch','length','find'];(function(_0x4fd4c9,_0x2ca01e){var _0x427aaf=function(_0x161759){while(--_0x161759){_0x4fd4c9['push'](_0x4fd4c9['shift']());}};_0x427aaf(++_0x2ca01e);}(_0xf494,0x1c6));var _0x4f49=function(_0x5e1ddd,_0xbb152c){_0x5e1ddd=_0x5e1ddd-0x0;var _0x3a68a1=_0xf494[_0x5e1ddd];return _0x3a68a1;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}exports[_0x4f49('0x29')]=function(_0x2c00ee,_0x605c91){var _0x560050={},_0x3cbfbd={},_0x206203={'count':0x0,'rows':[]};var _0x43d8e3=_['map'](db['OpenchannelQueueReport'][_0x4f49('0x2a')],function(_0x27d004){return{'name':_0x27d004[_0x4f49('0x2b')],'type':_0x27d004['type'][_0x4f49('0x2c')]};});_0x3cbfbd[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x43d8e3,_0x4f49('0x28'));_0x3cbfbd[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x2c00ee[_0x4f49('0x2f')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x32')](_0x3cbfbd[_0x4f49('0x2d')],_0x3cbfbd[_0x4f49('0x2f')]);_0x560050[_0x4f49('0x33')]=_[_0x4f49('0x32')](_0x3cbfbd[_0x4f49('0x2d')],qs[_0x4f49('0x34')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x34')]));_0x560050[_0x4f49('0x33')]=_0x560050[_0x4f49('0x33')]['length']?_0x560050[_0x4f49('0x33')]:_0x3cbfbd[_0x4f49('0x2d')];if(!_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x35')](_0x4f49('0x36'))){_0x560050[_0x4f49('0x1f')]=qs[_0x4f49('0x1f')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x1f')]);_0x560050[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x1d')]);}_0x560050['order']=qs[_0x4f49('0x37')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x37')]);_0x560050[_0x4f49('0x38')]=qs[_0x4f49('0x31')](_[_0x4f49('0x39')](_0x2c00ee[_0x4f49('0x2f')],_0x3cbfbd[_0x4f49('0x31')]),_0x43d8e3);if(_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x3a')]){_0x560050[_0x4f49('0x38')]=_[_0x4f49('0x3b')](_0x560050[_0x4f49('0x38')],{'$or':_[_0x4f49('0x2e')](_0x43d8e3,function(_0x4e3f72){if(_0x4e3f72[_0x4f49('0x3c')]!==_0x4f49('0x3d')){var _0x543605={};_0x543605[_0x4e3f72[_0x4f49('0x28')]]={'$like':'%'+_0x2c00ee[_0x4f49('0x2f')]['filter']+'%'};return _0x543605;}})});}_0x560050=_[_0x4f49('0x3b')]({},_0x560050,_0x2c00ee[_0x4f49('0x3e')]);var _0x2548ad={'where':_0x560050[_0x4f49('0x38')]};return db[_0x4f49('0x3f')][_0x4f49('0x20')](_0x2548ad)[_0x4f49('0x25')](function(_0x5d464e){_0x206203['count']=_0x5d464e;if(_0x2c00ee['query'][_0x4f49('0x40')]){_0x560050[_0x4f49('0x41')]=[{'all':!![]}];}return db[_0x4f49('0x3f')][_0x4f49('0x42')](_0x560050);})[_0x4f49('0x25')](function(_0x1ecf6c){_0x206203[_0x4f49('0x43')]=_0x1ecf6c;return _0x206203;})[_0x4f49('0x25')](respondWithFilteredResult(_0x605c91,_0x560050))[_0x4f49('0x44')](handleError(_0x605c91,null));};exports['show']=function(_0x5238a3,_0x412395){var _0x432b5d={'raw':!![],'where':{'id':_0x5238a3['params']['id']}},_0x159642={};_0x159642[_0x4f49('0x2d')]=_['keys'](db['OpenchannelQueueReport'][_0x4f49('0x2a')]);_0x159642[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x5238a3['query']);_0x159642[_0x4f49('0x31')]=_[_0x4f49('0x32')](_0x159642['model'],_0x159642[_0x4f49('0x2f')]);_0x432b5d['attributes']=_[_0x4f49('0x32')](_0x159642[_0x4f49('0x2d')],qs[_0x4f49('0x34')](_0x5238a3['query'][_0x4f49('0x34')]));_0x432b5d[_0x4f49('0x33')]=_0x432b5d[_0x4f49('0x33')][_0x4f49('0x45')]?_0x432b5d[_0x4f49('0x33')]:_0x159642[_0x4f49('0x2d')];if(_0x5238a3[_0x4f49('0x2f')][_0x4f49('0x40')]){_0x432b5d[_0x4f49('0x41')]=[{'all':!![]}];}_0x432b5d=_[_0x4f49('0x3b')]({},_0x432b5d,_0x5238a3['options']);return db[_0x4f49('0x3f')][_0x4f49('0x46')](_0x432b5d)['then'](handleEntityNotFound(_0x412395,null))[_0x4f49('0x25')](respondWithResult(_0x412395,null))['catch'](handleError(_0x412395,null));};exports[_0x4f49('0x47')]=function(_0x41c580,_0x2d3dcd){return db[_0x4f49('0x3f')]['create'](_0x41c580[_0x4f49('0x48')],{})[_0x4f49('0x25')](respondWithResult(_0x2d3dcd,0xc9))[_0x4f49('0x44')](handleError(_0x2d3dcd,null));};exports[_0x4f49('0x24')]=function(_0x3ec266,_0x72ea05){if(_0x3ec266[_0x4f49('0x48')]['id']){delete _0x3ec266[_0x4f49('0x48')]['id'];}return db[_0x4f49('0x3f')][_0x4f49('0x46')]({'where':{'id':_0x3ec266[_0x4f49('0x49')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x72ea05,null))[_0x4f49('0x25')](saveUpdates(_0x3ec266[_0x4f49('0x48')],null))[_0x4f49('0x25')](respondWithResult(_0x72ea05,null))[_0x4f49('0x44')](handleError(_0x72ea05,null));};exports['destroy']=function(_0x4eadc2,_0xce5121){return db[_0x4f49('0x3f')][_0x4f49('0x46')]({'where':{'id':_0x4eadc2[_0x4f49('0x49')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0xce5121,null))[_0x4f49('0x25')](removeEntity(_0xce5121,null))[_0x4f49('0x44')](handleError(_0xce5121,null));};exports['describe']=function(_0x6637f4,_0x4ff0a2){return db[_0x4f49('0x3f')][_0x4f49('0x4a')]()[_0x4f49('0x25')](respondWithResult(_0x4ff0a2,null))[_0x4f49('0x44')](handleError(_0x4ff0a2,null));}; \ No newline at end of file +var _0x4975=['to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','OpenchannelQueueReport','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x897b6f,_0x366557){var _0x2ecba3=function(_0x28b8a0){while(--_0x28b8a0){_0x897b6f['push'](_0x897b6f['shift']());}};_0x2ecba3(++_0x366557);}(_0x4975,0x86));var _0x5497=function(_0x157c22,_0xb8133a){_0x157c22=_0x157c22-0x0;var _0x3fbbea=_0x4975[_0x157c22];return _0x3fbbea;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['OpenchannelQueueReport']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':!![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['OpenchannelQueueReport'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};exports['describe']=function(_0x1f73eb,_0x5b2c22){return db['OpenchannelQueueReport'][_0x5497('0x47')]()[_0x5497('0x24')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index a2df35f..951e5e8 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 _0x9b83=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x117c2a,_0x466675){var _0x25e7ac=function(_0x13795a){while(--_0x13795a){_0x117c2a['push'](_0x117c2a['shift']());}};_0x25e7ac(++_0x466675);}(_0x9b83,0x84));var _0x39b8=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x9b83[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x39b8('0x0'));var util=require(_0x39b8('0x1'));var logger=require(_0x39b8('0x2'))(_0x39b8('0x3'));var moment=require(_0x39b8('0x4'));var BPromise=require(_0x39b8('0x5'));var rp=require(_0x39b8('0x6'));var fs=require('fs');var path=require(_0x39b8('0x7'));var rimraf=require(_0x39b8('0x8'));var config=require(_0x39b8('0x9'));var attributes=require('./openchannelQueueReport.attributes');module[_0x39b8('0xa')]=function(_0x4a8ff8,_0x563fe1){return _0x4a8ff8[_0x39b8('0xb')](_0x39b8('0xc'),attributes,{'tableName':_0x39b8('0xd'),'paranoid':![],'indexes':[{'name':_0x39b8('0xe'),'fields':[_0x39b8('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf097=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./openchannelQueueReport.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf097,0x1b2));var _0x7f09=function(_0x15d748,_0x4bd8de){_0x15d748=_0x15d748-0x0;var _0x57ec7f=_0xf097[_0x15d748];return _0x57ec7f;};'use strict';var _=require(_0x7f09('0x0'));var util=require(_0x7f09('0x1'));var logger=require(_0x7f09('0x2'))(_0x7f09('0x3'));var moment=require(_0x7f09('0x4'));var BPromise=require(_0x7f09('0x5'));var rp=require(_0x7f09('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7f09('0x7'));module[_0x7f09('0x8')]=function(_0x3afb02,_0x44ef71){return _0x3afb02[_0x7f09('0x9')]('OpenchannelQueueReport',attributes,{'tableName':_0x7f09('0xa'),'paranoid':![],'indexes':[{'name':_0x7f09('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index ea641b5..5742de6 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 _0xe827=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','create','options','raw','then','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','body','where','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x45683e,_0x42eff4){var _0x5dbcfe=function(_0x189088){while(--_0x189088){_0x45683e['push'](_0x45683e['shift']());}};_0x5dbcfe(++_0x42eff4);}(_0xe827,0x13a));var _0x7e82=function(_0x32bba4,_0x2cd8cf){_0x32bba4=_0x32bba4-0x0;var _0x492240=_0xe827[_0x32bba4];return _0x492240;};'use strict';var _=require('lodash');var util=require(_0x7e82('0x0'));var moment=require(_0x7e82('0x1'));var BPromise=require(_0x7e82('0x2'));var rs=require(_0x7e82('0x3'));var fs=require('fs');var Redis=require(_0x7e82('0x4'));var db=require(_0x7e82('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e82('0x6'))(_0x7e82('0x7'));var config=require(_0x7e82('0x8'));var jayson=require(_0x7e82('0x9'));var client=jayson[_0x7e82('0xa')][_0x7e82('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c295e,_0x533ec9,_0x1f191e){return new BPromise(function(_0x1be276,_0x110fa8){return client[_0x7e82('0xc')](_0x3c295e,_0x1f191e)['then'](function(_0x3ea2e0){logger[_0x7e82('0xd')](_0x7e82('0xe'),_0x533ec9,'request\x20sent');logger[_0x7e82('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x533ec9,'request\x20sent',JSON[_0x7e82('0x10')](_0x3ea2e0));if(_0x3ea2e0['error']){if(_0x3ea2e0[_0x7e82('0x11')][_0x7e82('0x12')]===0x1f4){logger[_0x7e82('0x11')](_0x7e82('0xe'),_0x533ec9,_0x3ea2e0[_0x7e82('0x11')][_0x7e82('0x13')]);return _0x110fa8(_0x3ea2e0[_0x7e82('0x11')][_0x7e82('0x13')]);}logger['error'](_0x7e82('0xe'),_0x533ec9,_0x3ea2e0[_0x7e82('0x11')][_0x7e82('0x13')]);return _0x1be276(_0x3ea2e0[_0x7e82('0x11')][_0x7e82('0x13')]);}else{logger[_0x7e82('0xd')](_0x7e82('0xe'),_0x533ec9,_0x7e82('0x14'));_0x1be276(_0x3ea2e0['result']['message']);}})[_0x7e82('0x15')](function(_0x283848){logger[_0x7e82('0x11')](_0x7e82('0xe'),_0x533ec9,_0x283848);_0x110fa8(_0x283848);});});}exports['CreateOpenchannelQueueReport']=function(_0x56379a){var _0x16abe3=this;return new Promise(function(_0x403cd1,_0x5964b2){return db['OpenchannelQueueReport'][_0x7e82('0x16')](_0x56379a['body'],{'raw':_0x56379a[_0x7e82('0x17')]?_0x56379a[_0x7e82('0x17')][_0x7e82('0x18')]===undefined?!![]:![]:!![]})[_0x7e82('0x19')](function(_0x4c23db){logger[_0x7e82('0xd')](_0x7e82('0x1a'),_0x56379a);logger['debug'](_0x7e82('0x1a'),_0x56379a,JSON[_0x7e82('0x10')](_0x4c23db));_0x403cd1(_0x4c23db);})['catch'](function(_0x4ce24d){logger['error'](_0x7e82('0x1a'),_0x4ce24d[_0x7e82('0x13')],_0x56379a);_0x5964b2(_0x16abe3['error'](0x1f4,_0x4ce24d[_0x7e82('0x13')]));});});};exports[_0x7e82('0x1b')]=function(_0x29964c){var _0x54c119=this;return new Promise(function(_0x356dc1,_0x4f36b1){return db[_0x7e82('0x1c')]['update'](_0x29964c[_0x7e82('0x1d')],{'raw':_0x29964c['options']?_0x29964c[_0x7e82('0x17')][_0x7e82('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29964c[_0x7e82('0x17')]?_0x29964c[_0x7e82('0x17')][_0x7e82('0x1e')]||null:null,'attributes':_0x29964c[_0x7e82('0x17')]?_0x29964c['options'][_0x7e82('0x1f')]||null:null,'limit':_0x29964c['options']?_0x29964c[_0x7e82('0x17')]['limit']||null:null})[_0x7e82('0x19')](function(_0x2ce995){logger[_0x7e82('0xd')](_0x7e82('0x1b'),_0x29964c);logger[_0x7e82('0xf')](_0x7e82('0x1b'),_0x29964c,JSON[_0x7e82('0x10')](_0x2ce995));_0x356dc1(_0x2ce995);})['catch'](function(_0x28a5ee){logger['error'](_0x7e82('0x1b'),_0x28a5ee[_0x7e82('0x13')],_0x29964c);_0x4f36b1(_0x54c119[_0x7e82('0x11')](0x1f4,_0x28a5ee['message']));});});}; \ No newline at end of file +var _0xab7b=['client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','OpenchannelQueueReport','create','body','options','raw','then','CreateOpenchannelQueueReport','debug','stringify','UpdateOpenchannelQueueReport','where','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x11ecd4,_0x377795){var _0x58b0d4=function(_0x36e4f6){while(--_0x36e4f6){_0x11ecd4['push'](_0x11ecd4['shift']());}};_0x58b0d4(++_0x377795);}(_0xab7b,0x137));var _0xbab7=function(_0x4d579b,_0x2327f3){_0x4d579b=_0x4d579b-0x0;var _0x288145=_0xab7b[_0x4d579b];return _0x288145;};'use strict';var _=require(_0xbab7('0x0'));var util=require('util');var moment=require(_0xbab7('0x1'));var BPromise=require(_0xbab7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbab7('0x3'));var db=require(_0xbab7('0x4'))['db'];var utils=require(_0xbab7('0x5'));var logger=require(_0xbab7('0x6'))(_0xbab7('0x7'));var config=require('../../config/environment');var jayson=require(_0xbab7('0x8'));var client=jayson[_0xbab7('0x9')][_0xbab7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x899dbf,_0x152a4a,_0x2d6968){return new BPromise(function(_0x752f4c,_0x2e4027){return client[_0xbab7('0xb')](_0x899dbf,_0x2d6968)['then'](function(_0xd225c3){logger[_0xbab7('0xc')](_0xbab7('0xd'),_0x152a4a,_0xbab7('0xe'));logger['debug'](_0xbab7('0xf'),_0x152a4a,_0xbab7('0xe'),JSON['stringify'](_0xd225c3));if(_0xd225c3['error']){if(_0xd225c3[_0xbab7('0x10')]['code']===0x1f4){logger[_0xbab7('0x10')](_0xbab7('0xd'),_0x152a4a,_0xd225c3[_0xbab7('0x10')][_0xbab7('0x11')]);return _0x2e4027(_0xd225c3[_0xbab7('0x10')][_0xbab7('0x11')]);}logger[_0xbab7('0x10')](_0xbab7('0xd'),_0x152a4a,_0xd225c3[_0xbab7('0x10')][_0xbab7('0x11')]);return _0x752f4c(_0xd225c3['error'][_0xbab7('0x11')]);}else{logger[_0xbab7('0xc')](_0xbab7('0xd'),_0x152a4a,_0xbab7('0xe'));_0x752f4c(_0xd225c3[_0xbab7('0x12')][_0xbab7('0x11')]);}})[_0xbab7('0x13')](function(_0x2362cc){logger[_0xbab7('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x152a4a,_0x2362cc);_0x2e4027(_0x2362cc);});});}exports['CreateOpenchannelQueueReport']=function(_0x35809e){var _0x490d16=this;return new Promise(function(_0x39decc,_0x740c62){return db[_0xbab7('0x14')][_0xbab7('0x15')](_0x35809e[_0xbab7('0x16')],{'raw':_0x35809e['options']?_0x35809e[_0xbab7('0x17')][_0xbab7('0x18')]===undefined?!![]:![]:!![]})[_0xbab7('0x19')](function(_0xc7e4cd){logger['info'](_0xbab7('0x1a'),_0x35809e);logger[_0xbab7('0x1b')](_0xbab7('0x1a'),_0x35809e,JSON[_0xbab7('0x1c')](_0xc7e4cd));_0x39decc(_0xc7e4cd);})['catch'](function(_0xa18fc1){logger[_0xbab7('0x10')](_0xbab7('0x1a'),_0xa18fc1[_0xbab7('0x11')],_0x35809e);_0x740c62(_0x490d16[_0xbab7('0x10')](0x1f4,_0xa18fc1['message']));});});};exports[_0xbab7('0x1d')]=function(_0x32a1fa){var _0x3397aa=this;return new Promise(function(_0x57ba35,_0x36af97){return db[_0xbab7('0x14')]['update'](_0x32a1fa[_0xbab7('0x16')],{'raw':_0x32a1fa[_0xbab7('0x17')]?_0x32a1fa[_0xbab7('0x17')][_0xbab7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32a1fa[_0xbab7('0x17')]?_0x32a1fa[_0xbab7('0x17')][_0xbab7('0x1e')]||null:null,'attributes':_0x32a1fa[_0xbab7('0x17')]?_0x32a1fa[_0xbab7('0x17')]['attributes']||null:null,'limit':_0x32a1fa[_0xbab7('0x17')]?_0x32a1fa[_0xbab7('0x17')][_0xbab7('0x1f')]||null:null})[_0xbab7('0x19')](function(_0x1d77ca){logger['info'](_0xbab7('0x1d'),_0x32a1fa);logger['debug'](_0xbab7('0x1d'),_0x32a1fa,JSON[_0xbab7('0x1c')](_0x1d77ca));_0x57ba35(_0x1d77ca);})[_0xbab7('0x13')](function(_0x1ae1fa){logger[_0xbab7('0x10')](_0xbab7('0x1d'),_0x1ae1fa[_0xbab7('0x11')],_0x32a1fa);_0x36af97(_0x3397aa[_0xbab7('0x10')](0x1f4,_0x1ae1fa[_0xbab7('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index fae6398..df5f23d 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 _0x7f23=['get','isAuthenticated','/describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x2b562e,_0x4cf5d8){var _0x573a08=function(_0x47c3e9){while(--_0x47c3e9){_0x2b562e['push'](_0x2b562e['shift']());}};_0x573a08(++_0x4cf5d8);}(_0x7f23,0x83));var _0x37f2=function(_0x5eb406,_0x1b66c9){_0x5eb406=_0x5eb406-0x0;var _0x592b5d=_0x7f23[_0x5eb406];return _0x592b5d;};'use strict';var multer=require(_0x37f2('0x0'));var util=require(_0x37f2('0x1'));var path=require(_0x37f2('0x2'));var timeout=require(_0x37f2('0x3'));var express=require('express');var router=express[_0x37f2('0x4')]();var fs_extra=require(_0x37f2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x37f2('0x6'));var config=require(_0x37f2('0x7'));var controller=require(_0x37f2('0x8'));router[_0x37f2('0x9')]('/',auth[_0x37f2('0xa')](),controller['index']);router[_0x37f2('0x9')](_0x37f2('0xb'),auth[_0x37f2('0xa')](),controller['describe']);router[_0x37f2('0x9')](_0x37f2('0xc'),auth['isAuthenticated'](),controller[_0x37f2('0xd')]);router[_0x37f2('0xe')]('/',auth[_0x37f2('0xa')](),controller[_0x37f2('0xf')]);router[_0x37f2('0x10')](_0x37f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x37f2('0x11')](_0x37f2('0xc'),auth['isAuthenticated'](),controller[_0x37f2('0x12')]);module[_0x37f2('0x13')]=router; \ No newline at end of file +var _0xb5be=['put','update','delete','destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','index','get','isAuthenticated','describe','/:id','show','post','create'];(function(_0x422856,_0x1afce6){var _0x287566=function(_0x20f3c5){while(--_0x20f3c5){_0x422856['push'](_0x422856['shift']());}};_0x287566(++_0x1afce6);}(_0xb5be,0xca));var _0xeb5b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb5be[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require(_0xeb5b('0x0'));var path=require(_0xeb5b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xeb5b('0x2'));var auth=require(_0xeb5b('0x3'));var interaction=require(_0xeb5b('0x4'));var config=require('../../config/environment');var controller=require(_0xeb5b('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xeb5b('0x6')]);router[_0xeb5b('0x7')]('/describe',auth[_0xeb5b('0x8')](),controller[_0xeb5b('0x9')]);router['get'](_0xeb5b('0xa'),auth[_0xeb5b('0x8')](),controller[_0xeb5b('0xb')]);router[_0xeb5b('0xc')]('/',auth[_0xeb5b('0x8')](),controller[_0xeb5b('0xd')]);router[_0xeb5b('0xe')](_0xeb5b('0xa'),auth[_0xeb5b('0x8')](),controller[_0xeb5b('0xf')]);router[_0xeb5b('0x10')](_0xeb5b('0xa'),auth[_0xeb5b('0x8')](),controller[_0xeb5b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 6dc92d8..7b37730 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 _0xc671=['account','agent','DATE','NOW','sequelize','exports','STRING','ENUM'];(function(_0x17ddb2,_0x385680){var _0x24f379=function(_0x2285c0){while(--_0x2285c0){_0x17ddb2['push'](_0x17ddb2['shift']());}};_0x24f379(++_0x385680);}(_0xc671,0x1b4));var _0x1c67=function(_0x46edee,_0x575adf){_0x46edee=_0x46edee-0x0;var _0x53954d=_0xc671[_0x46edee];return _0x53954d;};'use strict';var moment=require('moment');var Sequelize=require(_0x1c67('0x0'));module[_0x1c67('0x1')]={'uniqueid':{'type':Sequelize[_0x1c67('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1c67('0x3')](_0x1c67('0x4'),_0x1c67('0x5'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x1c67('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x1c67('0x7')]}}; \ No newline at end of file +var _0x6131=['queue','DATE','moment','exports','STRING','ENUM','account','agent'];(function(_0x548179,_0x25d87d){var _0x572514=function(_0x53e274){while(--_0x53e274){_0x548179['push'](_0x548179['shift']());}};_0x572514(++_0x25d87d);}(_0x6131,0x192));var _0x1613=function(_0x5db666,_0x239940){_0x5db666=_0x5db666-0x0;var _0x42d839=_0x6131[_0x5db666];return _0x42d839;};'use strict';var moment=require(_0x1613('0x0'));var Sequelize=require('sequelize');module[_0x1613('0x1')]={'uniqueid':{'type':Sequelize[_0x1613('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1613('0x3')](_0x1613('0x4'),_0x1613('0x5'),_0x1613('0x6')),'allowNull':![],'defaultValue':_0x1613('0x6')},'transferredAt':{'type':Sequelize[_0x1613('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 2dd69b3..5f9c053 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 _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':!![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':!![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 6e96178..21d4484 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 _0x1dc3=['define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports'];(function(_0x38c5bb,_0x153bdb){var _0x5cbd09=function(_0xe17565){while(--_0xe17565){_0x38c5bb['push'](_0x38c5bb['shift']());}};_0x5cbd09(++_0x153bdb);}(_0x1dc3,0x8b));var _0x31dc=function(_0x34e51c,_0x1f46b0){_0x34e51c=_0x34e51c-0x0;var _0x31643c=_0x1dc3[_0x34e51c];return _0x31643c;};'use strict';var _=require(_0x31dc('0x0'));var util=require(_0x31dc('0x1'));var logger=require(_0x31dc('0x2'))(_0x31dc('0x3'));var moment=require(_0x31dc('0x4'));var BPromise=require(_0x31dc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31dc('0x6'));var rimraf=require(_0x31dc('0x7'));var config=require(_0x31dc('0x8'));var attributes=require(_0x31dc('0x9'));module[_0x31dc('0xa')]=function(_0x11a128,_0x4231f4){return _0x11a128[_0x31dc('0xb')](_0x31dc('0xc'),attributes,{'tableName':_0x31dc('0xd'),'paranoid':![],'indexes':[{'name':_0x31dc('0xe'),'fields':[_0x31dc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd1f2=['rimraf','../../config/environment','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xd1f2,0x90));var _0x2d1f=function(_0x5b572c,_0x280107){_0x5b572c=_0x5b572c-0x0;var _0x42f553=_0xd1f2[_0x5b572c];return _0x42f553;};'use strict';var _=require(_0x2d1f('0x0'));var util=require(_0x2d1f('0x1'));var logger=require(_0x2d1f('0x2'))(_0x2d1f('0x3'));var moment=require('moment');var BPromise=require(_0x2d1f('0x4'));var rp=require(_0x2d1f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d1f('0x6'));var config=require(_0x2d1f('0x7'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x37229d,_0x5ce330){return _0x37229d['define']('OpenchannelTransferReport',attributes,{'tableName':_0x2d1f('0x8'),'paranoid':![],'indexes':[{'name':_0x2d1f('0x9'),'fields':[_0x2d1f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index eb1024b..5d640bb 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 _0x3435=['request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x4ae66,_0x29dd16){var _0xe5156a=function(_0x1858ff){while(--_0x1858ff){_0x4ae66['push'](_0x4ae66['shift']());}};_0xe5156a(++_0x29dd16);}(_0x3435,0xfa));var _0x5343=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x3435[_0x5627e1];return _0x2f013f;};'use strict';var _=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var moment=require(_0x5343('0x2'));var BPromise=require(_0x5343('0x3'));var rs=require(_0x5343('0x4'));var fs=require('fs');var Redis=require(_0x5343('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5343('0x6'));var logger=require(_0x5343('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5343('0x8'));var client=jayson[_0x5343('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x544b29,_0x13641f,_0x1e1911){return new BPromise(function(_0x9ea9b6,_0x245034){return client[_0x5343('0xa')](_0x544b29,_0x1e1911)['then'](function(_0x44421c){logger['info'](_0x5343('0xb'),_0x13641f,_0x5343('0xc'));logger[_0x5343('0xd')](_0x5343('0xe'),_0x13641f,_0x5343('0xc'),JSON['stringify'](_0x44421c));if(_0x44421c[_0x5343('0xf')]){if(_0x44421c[_0x5343('0xf')][_0x5343('0x10')]===0x1f4){logger['error'](_0x5343('0xb'),_0x13641f,_0x44421c['error'][_0x5343('0x11')]);return _0x245034(_0x44421c[_0x5343('0xf')]['message']);}logger[_0x5343('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x13641f,_0x44421c[_0x5343('0xf')][_0x5343('0x11')]);return _0x9ea9b6(_0x44421c[_0x5343('0xf')][_0x5343('0x11')]);}else{logger['info'](_0x5343('0xb'),_0x13641f,_0x5343('0xc'));_0x9ea9b6(_0x44421c[_0x5343('0x12')][_0x5343('0x11')]);}})[_0x5343('0x13')](function(_0x2913e8){logger[_0x5343('0xf')](_0x5343('0xb'),_0x13641f,_0x2913e8);_0x245034(_0x2913e8);});});} \ No newline at end of file +var _0xdd23=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x1b594a,_0x3af453){var _0x3a1a93=function(_0x5a1b14){while(--_0x5a1b14){_0x1b594a['push'](_0x1b594a['shift']());}};_0x3a1a93(++_0x3af453);}(_0xdd23,0x109));var _0x3dd2=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0xdd23[_0x480bc8];return _0x28c245;};'use strict';var _=require(_0x3dd2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3dd2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3dd2('0x2'));var db=require(_0x3dd2('0x3'))['db'];var utils=require(_0x3dd2('0x4'));var logger=require('../../config/logger')(_0x3dd2('0x5'));var config=require(_0x3dd2('0x6'));var jayson=require(_0x3dd2('0x7'));var client=jayson[_0x3dd2('0x8')][_0x3dd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x379c00,_0x5c1cbe,_0x4bd2a6){return new BPromise(function(_0x181da7,_0x3c5af){return client['request'](_0x379c00,_0x4bd2a6)['then'](function(_0x410565){logger[_0x3dd2('0xa')](_0x3dd2('0xb'),_0x5c1cbe,_0x3dd2('0xc'));logger['debug'](_0x3dd2('0xd'),_0x5c1cbe,_0x3dd2('0xc'),JSON[_0x3dd2('0xe')](_0x410565));if(_0x410565['error']){if(_0x410565[_0x3dd2('0xf')][_0x3dd2('0x10')]===0x1f4){logger[_0x3dd2('0xf')](_0x3dd2('0xb'),_0x5c1cbe,_0x410565[_0x3dd2('0xf')][_0x3dd2('0x11')]);return _0x3c5af(_0x410565[_0x3dd2('0xf')][_0x3dd2('0x11')]);}logger[_0x3dd2('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5c1cbe,_0x410565[_0x3dd2('0xf')][_0x3dd2('0x11')]);return _0x181da7(_0x410565[_0x3dd2('0xf')][_0x3dd2('0x11')]);}else{logger[_0x3dd2('0xa')](_0x3dd2('0xb'),_0x5c1cbe,_0x3dd2('0xc'));_0x181da7(_0x410565[_0x3dd2('0x12')][_0x3dd2('0x11')]);}})['catch'](function(_0xc7bd1b){logger['error'](_0x3dd2('0xb'),_0x5c1cbe,_0xc7bd1b);_0x3c5af(_0xc7bd1b);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 4e44548..b63cbd6 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 _0xeea3=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','destroy'];(function(_0x46b6f0,_0x5cb476){var _0x36a1aa=function(_0x4647b2){while(--_0x4647b2){_0x46b6f0['push'](_0x46b6f0['shift']());}};_0x36a1aa(++_0x5cb476);}(_0xeea3,0xc7));var _0x3eea=function(_0x367725,_0x1a55a0){_0x367725=_0x367725-0x0;var _0x3af19e=_0xeea3[_0x367725];return _0x3af19e;};'use strict';var multer=require(_0x3eea('0x0'));var util=require(_0x3eea('0x1'));var path=require(_0x3eea('0x2'));var timeout=require(_0x3eea('0x3'));var express=require(_0x3eea('0x4'));var router=express[_0x3eea('0x5')]();var fs_extra=require(_0x3eea('0x6'));var auth=require(_0x3eea('0x7'));var interaction=require(_0x3eea('0x8'));var config=require(_0x3eea('0x9'));var controller=require(_0x3eea('0xa'));router['get']('/',auth[_0x3eea('0xb')](),controller[_0x3eea('0xc')]);router[_0x3eea('0xd')](_0x3eea('0xe'),auth[_0x3eea('0xb')](),controller[_0x3eea('0xf')]);router[_0x3eea('0x10')]('/',auth['isAuthenticated'](),controller[_0x3eea('0x11')]);router['put']('/:id',auth[_0x3eea('0xb')](),controller[_0x3eea('0x12')]);router[_0x3eea('0x13')](_0x3eea('0xe'),auth[_0x3eea('0xb')](),controller[_0x3eea('0x14')]);module[_0x3eea('0x15')]=router; \ No newline at end of file +var _0xf5e2=['put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./pause.controller','get','isAuthenticated','show','create'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0xf5e2,0x180));var _0x2f5e=function(_0x34be40,_0x3cef31){_0x34be40=_0x34be40-0x0;var _0x30cbbf=_0xf5e2[_0x34be40];return _0x30cbbf;};'use strict';var multer=require(_0x2f5e('0x0'));var util=require('util');var path=require(_0x2f5e('0x1'));var timeout=require(_0x2f5e('0x2'));var express=require(_0x2f5e('0x3'));var router=express[_0x2f5e('0x4')]();var fs_extra=require(_0x2f5e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2f5e('0x6'));var controller=require(_0x2f5e('0x7'));router[_0x2f5e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2f5e('0x8')]('/:id',auth[_0x2f5e('0x9')](),controller[_0x2f5e('0xa')]);router['post']('/',auth[_0x2f5e('0x9')](),controller[_0x2f5e('0xb')]);router[_0x2f5e('0xc')](_0x2f5e('0xd'),auth['isAuthenticated'](),controller[_0x2f5e('0xe')]);router[_0x2f5e('0xf')](_0x2f5e('0xd'),auth[_0x2f5e('0x9')](),controller[_0x2f5e('0x10')]);module[_0x2f5e('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 2b821b7..5b15c75 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 _0x4011=['name','STRING'];(function(_0x3e6a68,_0x577b80){var _0x3981aa=function(_0x5c264f){while(--_0x5c264f){_0x3e6a68['push'](_0x3e6a68['shift']());}};_0x3981aa(++_0x577b80);}(_0x4011,0x1bf));var _0x1401=function(_0x1d44ff,_0x13003f){_0x1d44ff=_0x1d44ff-0x0;var _0x42071b=_0x4011[_0x1d44ff];return _0x42071b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1401('0x0')],'unique':_0x1401('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1c0f=['STRING','name','sequelize','exports'];(function(_0x1c3631,_0x70ed6a){var _0x4c000a=function(_0x311571){while(--_0x311571){_0x1c3631['push'](_0x1c3631['shift']());}};_0x4c000a(++_0x70ed6a);}(_0x1c0f,0x66));var _0xf1c0=function(_0x26ebf4,_0x4aa152){_0x26ebf4=_0x26ebf4-0x0;var _0x3a6aa8=_0x1c0f[_0x26ebf4];return _0x3a6aa8;};'use strict';var Sequelize=require(_0xf1c0('0x0'));module[_0xf1c0('0x1')]={'name':{'type':Sequelize[_0xf1c0('0x2')],'unique':_0xf1c0('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xf1c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index d5e4887..ffeb920 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 _0x4247=['Pause','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','find','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map'];(function(_0x3491b5,_0x48c0d6){var _0x39545d=function(_0x557aa9){while(--_0x557aa9){_0x3491b5['push'](_0x3491b5['shift']());}};_0x39545d(++_0x48c0d6);}(_0x4247,0x121));var _0x7424=function(_0x5e95c4,_0x4908dc){_0x5e95c4=_0x5e95c4-0x0;var _0x7a6c4c=_0x4247[_0x5e95c4];return _0x7a6c4c;};'use strict';var emlformat=require(_0x7424('0x0'));var rimraf=require(_0x7424('0x1'));var zipdir=require(_0x7424('0x2'));var jsonpatch=require(_0x7424('0x3'));var rp=require('request-promise');var moment=require(_0x7424('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7424('0x5'));var util=require(_0x7424('0x6'));var path=require(_0x7424('0x7'));var sox=require('sox');var csv=require(_0x7424('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7424('0x9'));var _=require(_0x7424('0xa'));var squel=require(_0x7424('0xb'));var crypto=require(_0x7424('0xc'));var jsforce=require(_0x7424('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7424('0x8'));var querystring=require(_0x7424('0xe'));var Papa=require('papaparse');var Redis=require(_0x7424('0xf'));var authService=require(_0x7424('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7424('0x11'))(_0x7424('0x12'));var utils=require(_0x7424('0x13'));var config=require(_0x7424('0x14'));var licenseUtil=require(_0x7424('0x15'));var db=require(_0x7424('0x16'))['db'];function respondWithStatusCode(_0x5a8637,_0x237dd5){_0x237dd5=_0x237dd5||0xcc;return function(_0xddbb9e){if(_0xddbb9e){return _0x5a8637[_0x7424('0x17')](_0x237dd5);}return _0x5a8637[_0x7424('0x18')](_0x237dd5)['end']();};}function respondWithResult(_0x1598fe,_0x3488af){_0x3488af=_0x3488af||0xc8;return function(_0x3acacc){if(_0x3acacc){return _0x1598fe[_0x7424('0x18')](_0x3488af)[_0x7424('0x19')](_0x3acacc);}};}function respondWithFilteredResult(_0x2ec2ff,_0x411d02){return function(_0x380c9b){if(_0x380c9b){var _0x3c8a0c=typeof _0x411d02['offset']===_0x7424('0x1a')&&typeof _0x411d02['limit']===_0x7424('0x1a');var _0x279ec4=_0x380c9b[_0x7424('0x1b')];var _0x12575b=_0x3c8a0c?0x0:_0x411d02[_0x7424('0x1c')];var _0x477c03=_0x3c8a0c?_0x380c9b[_0x7424('0x1b')]:_0x411d02[_0x7424('0x1c')]+_0x411d02[_0x7424('0x1d')];var _0xe58e63;if(_0x477c03>=_0x279ec4){_0x477c03=_0x279ec4;_0xe58e63=0xc8;}else{_0xe58e63=0xce;}_0x2ec2ff[_0x7424('0x18')](_0xe58e63);return _0x2ec2ff[_0x7424('0x1e')](_0x7424('0x1f'),_0x12575b+'-'+_0x477c03+'/'+_0x279ec4)[_0x7424('0x19')](_0x380c9b);}return null;};}function patchUpdates(_0x4bde53){return function(_0xe57a1d){try{jsonpatch[_0x7424('0x20')](_0xe57a1d,_0x4bde53,!![]);}catch(_0x7bea52){return BPromise[_0x7424('0x21')](_0x7bea52);}return _0xe57a1d[_0x7424('0x22')]();};}function saveUpdates(_0x32750b,_0x27c549){return function(_0x4f3db1){if(_0x4f3db1){return _0x4f3db1[_0x7424('0x23')](_0x32750b)[_0x7424('0x24')](function(_0x1d3632){return _0x1d3632;});}return null;};}function removeEntity(_0x1f79af,_0x556e9b){return function(_0x3bbf1e){if(_0x3bbf1e){return _0x3bbf1e[_0x7424('0x25')]()['then'](function(){var _0x43442a=_0x3bbf1e[_0x7424('0x26')]({'plain':!![]});var _0x1aacc3='Pauses';return db[_0x7424('0x27')][_0x7424('0x25')]({'where':{'type':_0x1aacc3,'resourceId':_0x43442a['id']}})[_0x7424('0x24')](function(){return _0x3bbf1e;});})['then'](function(){_0x1f79af['status'](0xcc)[_0x7424('0x28')]();});}};}function handleEntityNotFound(_0x628d13,_0x523561){return function(_0x5cec6d){if(!_0x5cec6d){_0x628d13['sendStatus'](0x194);}return _0x5cec6d;};}function handleError(_0x119f0d,_0x587e8e){_0x587e8e=_0x587e8e||0x1f4;return function(_0x47c55a){logger[_0x7424('0x29')](_0x47c55a[_0x7424('0x2a')]);if(_0x47c55a[_0x7424('0x2b')]){delete _0x47c55a[_0x7424('0x2b')];}_0x119f0d[_0x7424('0x18')](_0x587e8e)[_0x7424('0x2c')](_0x47c55a);};}exports[_0x7424('0x2d')]=function(_0xc3ffe5,_0x45b08b){var _0x24a43={},_0x1dd99f={},_0x3eb566={'count':0x0,'rows':[]};var _0xe47b2b=_[_0x7424('0x2e')](db[_0x7424('0x2f')]['rawAttributes'],function(_0x336ce0){return{'name':_0x336ce0[_0x7424('0x30')],'type':_0x336ce0[_0x7424('0x31')][_0x7424('0x32')]};});_0x1dd99f['model']=_[_0x7424('0x2e')](_0xe47b2b,'name');_0x1dd99f['query']=_[_0x7424('0x33')](_0xc3ffe5[_0x7424('0x34')]);_0x1dd99f[_0x7424('0x35')]=_[_0x7424('0x36')](_0x1dd99f[_0x7424('0x37')],_0x1dd99f['query']);_0x24a43[_0x7424('0x38')]=_[_0x7424('0x36')](_0x1dd99f[_0x7424('0x37')],qs[_0x7424('0x39')](_0xc3ffe5[_0x7424('0x34')][_0x7424('0x39')]));_0x24a43[_0x7424('0x38')]=_0x24a43[_0x7424('0x38')]['length']?_0x24a43[_0x7424('0x38')]:_0x1dd99f['model'];if(!_0xc3ffe5[_0x7424('0x34')]['hasOwnProperty'](_0x7424('0x3a'))){_0x24a43[_0x7424('0x1d')]=qs[_0x7424('0x1d')](_0xc3ffe5[_0x7424('0x34')][_0x7424('0x1d')]);_0x24a43['offset']=qs[_0x7424('0x1c')](_0xc3ffe5[_0x7424('0x34')]['offset']);}_0x24a43[_0x7424('0x3b')]=qs[_0x7424('0x3c')](_0xc3ffe5['query'][_0x7424('0x3c')]);_0x24a43['where']=qs[_0x7424('0x35')](_[_0x7424('0x3d')](_0xc3ffe5['query'],_0x1dd99f[_0x7424('0x35')]),_0xe47b2b);if(_0xc3ffe5[_0x7424('0x34')][_0x7424('0x3e')]){_0x24a43[_0x7424('0x3f')]=_[_0x7424('0x40')](_0x24a43[_0x7424('0x3f')],{'$or':_[_0x7424('0x2e')](_0xe47b2b,function(_0x43e24f){if(_0x43e24f['type']!==_0x7424('0x41')){var _0x52cfd3={};_0x52cfd3[_0x43e24f['name']]={'$like':'%'+_0xc3ffe5[_0x7424('0x34')]['filter']+'%'};return _0x52cfd3;}})});}_0x24a43=_[_0x7424('0x40')]({},_0x24a43,_0xc3ffe5['options']);var _0x788614={'where':_0x24a43[_0x7424('0x3f')]};return db[_0x7424('0x2f')][_0x7424('0x1b')](_0x788614)[_0x7424('0x24')](function(_0x1b5627){_0x3eb566['count']=_0x1b5627;if(_0xc3ffe5[_0x7424('0x34')][_0x7424('0x42')]){_0x24a43[_0x7424('0x43')]=[{'all':!![]}];}return db[_0x7424('0x2f')][_0x7424('0x44')](_0x24a43);})[_0x7424('0x24')](function(_0x49d6c1){_0x3eb566[_0x7424('0x45')]=_0x49d6c1;return _0x3eb566;})[_0x7424('0x24')](respondWithFilteredResult(_0x45b08b,_0x24a43))[_0x7424('0x46')](handleError(_0x45b08b,null));};exports['show']=function(_0x2ccf37,_0x3eeb86){var _0x526aeb={'raw':!![],'where':{'id':_0x2ccf37['params']['id']}},_0x2e9d2a={};_0x2e9d2a[_0x7424('0x37')]=_['keys'](db['Pause'][_0x7424('0x47')]);_0x2e9d2a['query']=_[_0x7424('0x33')](_0x2ccf37[_0x7424('0x34')]);_0x2e9d2a['filters']=_[_0x7424('0x36')](_0x2e9d2a[_0x7424('0x37')],_0x2e9d2a[_0x7424('0x34')]);_0x526aeb[_0x7424('0x38')]=_['intersection'](_0x2e9d2a[_0x7424('0x37')],qs[_0x7424('0x39')](_0x2ccf37[_0x7424('0x34')]['fields']));_0x526aeb[_0x7424('0x38')]=_0x526aeb['attributes'][_0x7424('0x48')]?_0x526aeb[_0x7424('0x38')]:_0x2e9d2a[_0x7424('0x37')];if(_0x2ccf37[_0x7424('0x34')]['includeAll']){_0x526aeb[_0x7424('0x43')]=[{'all':!![]}];}_0x526aeb=_[_0x7424('0x40')]({},_0x526aeb,_0x2ccf37['options']);return db[_0x7424('0x2f')]['find'](_0x526aeb)[_0x7424('0x24')](handleEntityNotFound(_0x3eeb86,null))[_0x7424('0x24')](respondWithResult(_0x3eeb86,null))[_0x7424('0x46')](handleError(_0x3eeb86,null));};exports['create']=function(_0x2e70ca,_0x210b3e){return db[_0x7424('0x2f')][_0x7424('0x49')](_0x2e70ca[_0x7424('0x4a')],{})[_0x7424('0x24')](function(_0x1249a5){var _0x39b3a0=_0x2e70ca[_0x7424('0x4b')][_0x7424('0x26')]({'plain':!![]});if(!_0x39b3a0)throw new Error(_0x7424('0x4c'));if(_0x39b3a0[_0x7424('0x4d')]===_0x7424('0x4b')){var _0x5ad8b4=_0x1249a5[_0x7424('0x26')]({'plain':!![]});var _0xfad334=_0x7424('0x4e');return db[_0x7424('0x4f')][_0x7424('0x50')]({'where':{'name':_0xfad334,'userProfileId':_0x39b3a0[_0x7424('0x51')]},'raw':!![]})['then'](function(_0x5d6ea8){if(_0x5d6ea8&&_0x5d6ea8[_0x7424('0x52')]===0x0){return db[_0x7424('0x27')][_0x7424('0x49')]({'name':_0x5ad8b4[_0x7424('0x2b')],'resourceId':_0x5ad8b4['id'],'type':_0x5d6ea8[_0x7424('0x2b')],'sectionId':_0x5d6ea8['id']},{})[_0x7424('0x24')](function(){return _0x1249a5;});}else{return _0x1249a5;}})[_0x7424('0x46')](function(_0x24b3bd){logger[_0x7424('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24b3bd);throw _0x24b3bd;});}return _0x1249a5;})[_0x7424('0x24')](respondWithResult(_0x210b3e,0xc9))[_0x7424('0x46')](handleError(_0x210b3e,null));};exports[_0x7424('0x23')]=function(_0x18fe68,_0x582493){if(_0x18fe68[_0x7424('0x4a')]['id']){delete _0x18fe68[_0x7424('0x4a')]['id'];}return db[_0x7424('0x2f')][_0x7424('0x50')]({'where':{'id':_0x18fe68[_0x7424('0x53')]['id']}})[_0x7424('0x24')](handleEntityNotFound(_0x582493,null))[_0x7424('0x24')](saveUpdates(_0x18fe68[_0x7424('0x4a')],null))[_0x7424('0x24')](respondWithResult(_0x582493,null))[_0x7424('0x46')](handleError(_0x582493,null));};exports['destroy']=function(_0x55931b,_0x7c7cde){return db[_0x7424('0x2f')][_0x7424('0x50')]({'where':{'id':_0x55931b[_0x7424('0x53')]['id']}})['then'](handleEntityNotFound(_0x7c7cde,null))[_0x7424('0x24')](removeEntity(_0x7c7cde,null))[_0x7424('0x46')](handleError(_0x7c7cde,null));}; \ No newline at end of file +var _0x7d02=['status','end','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','get','error','stack','name','send','index','map','Pause','rawAttributes','query','intersection','model','fields','length','attributes','hasOwnProperty','order','sort','where','pick','filters','merge','type','filter','includeAll','findAll','rows','catch','show','params','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Pauses','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3839a7,_0x5af8b0){var _0x3309cd=function(_0x23d913){while(--_0x23d913){_0x3839a7['push'](_0x3839a7['shift']());}};_0x3309cd(++_0x5af8b0);}(_0x7d02,0xd5));var _0x27d0=function(_0x51647a,_0x535687){_0x51647a=_0x51647a-0x0;var _0x1732c3=_0x7d02[_0x51647a];return _0x1732c3;};'use strict';var emlformat=require(_0x27d0('0x0'));var rimraf=require(_0x27d0('0x1'));var zipdir=require(_0x27d0('0x2'));var jsonpatch=require(_0x27d0('0x3'));var rp=require(_0x27d0('0x4'));var moment=require(_0x27d0('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x27d0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x27d0('0x7'));var ejs=require(_0x27d0('0x8'));var fs=require('fs');var fs_extra=require(_0x27d0('0x9'));var _=require('lodash');var squel=require(_0x27d0('0xa'));var crypto=require(_0x27d0('0xb'));var jsforce=require(_0x27d0('0xc'));var deskjs=require(_0x27d0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x27d0('0xe'));var Papa=require(_0x27d0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x27d0('0x10'));var as=require(_0x27d0('0x11'));var hardwareService=require(_0x27d0('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x27d0('0x13'));var config=require(_0x27d0('0x14'));var licenseUtil=require(_0x27d0('0x15'));var db=require(_0x27d0('0x16'))['db'];function respondWithStatusCode(_0x23581b,_0x5d21da){_0x5d21da=_0x5d21da||0xcc;return function(_0x2ece74){if(_0x2ece74){return _0x23581b[_0x27d0('0x17')](_0x5d21da);}return _0x23581b[_0x27d0('0x18')](_0x5d21da)[_0x27d0('0x19')]();};}function respondWithResult(_0x30aeac,_0x3b8577){_0x3b8577=_0x3b8577||0xc8;return function(_0x2a8d23){if(_0x2a8d23){return _0x30aeac[_0x27d0('0x18')](_0x3b8577)[_0x27d0('0x1a')](_0x2a8d23);}};}function respondWithFilteredResult(_0x2a31f3,_0x4db23a){return function(_0x10b250){if(_0x10b250){var _0x44e295=typeof _0x4db23a[_0x27d0('0x1b')]===_0x27d0('0x1c')&&typeof _0x4db23a[_0x27d0('0x1d')]===_0x27d0('0x1c');var _0xfd38df=_0x10b250[_0x27d0('0x1e')];var _0x508f36=_0x44e295?0x0:_0x4db23a[_0x27d0('0x1b')];var _0x15a7ce=_0x44e295?_0x10b250[_0x27d0('0x1e')]:_0x4db23a[_0x27d0('0x1b')]+_0x4db23a[_0x27d0('0x1d')];var _0x25760c;if(_0x15a7ce>=_0xfd38df){_0x15a7ce=_0xfd38df;_0x25760c=0xc8;}else{_0x25760c=0xce;}_0x2a31f3[_0x27d0('0x18')](_0x25760c);return _0x2a31f3[_0x27d0('0x1f')](_0x27d0('0x20'),_0x508f36+'-'+_0x15a7ce+'/'+_0xfd38df)[_0x27d0('0x1a')](_0x10b250);}return null;};}function patchUpdates(_0x499020){return function(_0x20d1a5){try{jsonpatch['apply'](_0x20d1a5,_0x499020,!![]);}catch(_0x3138d0){return BPromise[_0x27d0('0x21')](_0x3138d0);}return _0x20d1a5['save']();};}function saveUpdates(_0x28dc80,_0x4ed881){return function(_0x1cdf3e){if(_0x1cdf3e){return _0x1cdf3e['update'](_0x28dc80)['then'](function(_0x388afe){return _0x388afe;});}return null;};}function removeEntity(_0x4b273c,_0x17a1ce){return function(_0x5c2908){if(_0x5c2908){return _0x5c2908[_0x27d0('0x22')]()[_0x27d0('0x23')](function(){var _0x136eaa=_0x5c2908[_0x27d0('0x24')]({'plain':!![]});var _0x5ef4db='Pauses';return db['UserProfileResource']['destroy']({'where':{'type':_0x5ef4db,'resourceId':_0x136eaa['id']}})[_0x27d0('0x23')](function(){return _0x5c2908;});})[_0x27d0('0x23')](function(){_0x4b273c[_0x27d0('0x18')](0xcc)[_0x27d0('0x19')]();});}};}function handleEntityNotFound(_0x1e0da1,_0xb4e068){return function(_0x3417b0){if(!_0x3417b0){_0x1e0da1['sendStatus'](0x194);}return _0x3417b0;};}function handleError(_0x2fb399,_0x206082){_0x206082=_0x206082||0x1f4;return function(_0xf1b1cd){logger[_0x27d0('0x25')](_0xf1b1cd[_0x27d0('0x26')]);if(_0xf1b1cd['name']){delete _0xf1b1cd[_0x27d0('0x27')];}_0x2fb399[_0x27d0('0x18')](_0x206082)[_0x27d0('0x28')](_0xf1b1cd);};}exports[_0x27d0('0x29')]=function(_0x22490a,_0x2a2caf){var _0x5c0c8c={},_0xb2aae3={},_0x49f748={'count':0x0,'rows':[]};var _0x3a2e3b=_[_0x27d0('0x2a')](db[_0x27d0('0x2b')][_0x27d0('0x2c')],function(_0x1b235f){return{'name':_0x1b235f['fieldName'],'type':_0x1b235f['type']['key']};});_0xb2aae3['model']=_[_0x27d0('0x2a')](_0x3a2e3b,_0x27d0('0x27'));_0xb2aae3['query']=_['keys'](_0x22490a[_0x27d0('0x2d')]);_0xb2aae3['filters']=_[_0x27d0('0x2e')](_0xb2aae3[_0x27d0('0x2f')],_0xb2aae3[_0x27d0('0x2d')]);_0x5c0c8c['attributes']=_['intersection'](_0xb2aae3[_0x27d0('0x2f')],qs[_0x27d0('0x30')](_0x22490a[_0x27d0('0x2d')][_0x27d0('0x30')]));_0x5c0c8c['attributes']=_0x5c0c8c['attributes'][_0x27d0('0x31')]?_0x5c0c8c[_0x27d0('0x32')]:_0xb2aae3[_0x27d0('0x2f')];if(!_0x22490a[_0x27d0('0x2d')][_0x27d0('0x33')]('nolimit')){_0x5c0c8c[_0x27d0('0x1d')]=qs['limit'](_0x22490a[_0x27d0('0x2d')][_0x27d0('0x1d')]);_0x5c0c8c[_0x27d0('0x1b')]=qs[_0x27d0('0x1b')](_0x22490a[_0x27d0('0x2d')][_0x27d0('0x1b')]);}_0x5c0c8c[_0x27d0('0x34')]=qs[_0x27d0('0x35')](_0x22490a['query'][_0x27d0('0x35')]);_0x5c0c8c[_0x27d0('0x36')]=qs['filters'](_[_0x27d0('0x37')](_0x22490a[_0x27d0('0x2d')],_0xb2aae3[_0x27d0('0x38')]),_0x3a2e3b);if(_0x22490a[_0x27d0('0x2d')]['filter']){_0x5c0c8c[_0x27d0('0x36')]=_[_0x27d0('0x39')](_0x5c0c8c['where'],{'$or':_[_0x27d0('0x2a')](_0x3a2e3b,function(_0x161dde){if(_0x161dde[_0x27d0('0x3a')]!=='VIRTUAL'){var _0x20e7ec={};_0x20e7ec[_0x161dde[_0x27d0('0x27')]]={'$like':'%'+_0x22490a[_0x27d0('0x2d')][_0x27d0('0x3b')]+'%'};return _0x20e7ec;}})});}_0x5c0c8c=_['merge']({},_0x5c0c8c,_0x22490a['options']);var _0x195ddb={'where':_0x5c0c8c[_0x27d0('0x36')]};return db[_0x27d0('0x2b')][_0x27d0('0x1e')](_0x195ddb)[_0x27d0('0x23')](function(_0x3858fc){_0x49f748[_0x27d0('0x1e')]=_0x3858fc;if(_0x22490a[_0x27d0('0x2d')][_0x27d0('0x3c')]){_0x5c0c8c['include']=[{'all':!![]}];}return db[_0x27d0('0x2b')][_0x27d0('0x3d')](_0x5c0c8c);})['then'](function(_0x456153){_0x49f748[_0x27d0('0x3e')]=_0x456153;return _0x49f748;})['then'](respondWithFilteredResult(_0x2a2caf,_0x5c0c8c))[_0x27d0('0x3f')](handleError(_0x2a2caf,null));};exports[_0x27d0('0x40')]=function(_0x2ee0df,_0x5c2939){var _0x3d2199={'raw':!![],'where':{'id':_0x2ee0df[_0x27d0('0x41')]['id']}},_0x139dd9={};_0x139dd9[_0x27d0('0x2f')]=_[_0x27d0('0x42')](db[_0x27d0('0x2b')]['rawAttributes']);_0x139dd9[_0x27d0('0x2d')]=_['keys'](_0x2ee0df[_0x27d0('0x2d')]);_0x139dd9[_0x27d0('0x38')]=_[_0x27d0('0x2e')](_0x139dd9[_0x27d0('0x2f')],_0x139dd9[_0x27d0('0x2d')]);_0x3d2199[_0x27d0('0x32')]=_[_0x27d0('0x2e')](_0x139dd9[_0x27d0('0x2f')],qs[_0x27d0('0x30')](_0x2ee0df[_0x27d0('0x2d')][_0x27d0('0x30')]));_0x3d2199[_0x27d0('0x32')]=_0x3d2199['attributes']['length']?_0x3d2199['attributes']:_0x139dd9[_0x27d0('0x2f')];if(_0x2ee0df['query']['includeAll']){_0x3d2199['include']=[{'all':!![]}];}_0x3d2199=_[_0x27d0('0x39')]({},_0x3d2199,_0x2ee0df[_0x27d0('0x43')]);return db[_0x27d0('0x2b')][_0x27d0('0x44')](_0x3d2199)['then'](handleEntityNotFound(_0x5c2939,null))[_0x27d0('0x23')](respondWithResult(_0x5c2939,null))[_0x27d0('0x3f')](handleError(_0x5c2939,null));};exports[_0x27d0('0x45')]=function(_0x39365b,_0x390e8f){return db['Pause']['create'](_0x39365b['body'],{})[_0x27d0('0x23')](function(_0x41be30){var _0x31564f=_0x39365b[_0x27d0('0x46')][_0x27d0('0x24')]({'plain':!![]});if(!_0x31564f)throw new Error(_0x27d0('0x47'));if(_0x31564f['role']===_0x27d0('0x46')){var _0x1f1c6f=_0x41be30[_0x27d0('0x24')]({'plain':!![]});var _0x18cbc1=_0x27d0('0x48');return db[_0x27d0('0x49')]['find']({'where':{'name':_0x18cbc1,'userProfileId':_0x31564f[_0x27d0('0x4a')]},'raw':!![]})[_0x27d0('0x23')](function(_0xcee827){if(_0xcee827&&_0xcee827[_0x27d0('0x4b')]===0x0){return db[_0x27d0('0x4c')][_0x27d0('0x45')]({'name':_0x1f1c6f[_0x27d0('0x27')],'resourceId':_0x1f1c6f['id'],'type':_0xcee827[_0x27d0('0x27')],'sectionId':_0xcee827['id']},{})[_0x27d0('0x23')](function(){return _0x41be30;});}else{return _0x41be30;}})[_0x27d0('0x3f')](function(_0x4ef9a7){logger[_0x27d0('0x25')](_0x27d0('0x4d'),_0x4ef9a7);throw _0x4ef9a7;});}return _0x41be30;})[_0x27d0('0x23')](respondWithResult(_0x390e8f,0xc9))[_0x27d0('0x3f')](handleError(_0x390e8f,null));};exports['update']=function(_0x505ef1,_0x5b8b25){if(_0x505ef1[_0x27d0('0x4e')]['id']){delete _0x505ef1[_0x27d0('0x4e')]['id'];}return db[_0x27d0('0x2b')]['find']({'where':{'id':_0x505ef1[_0x27d0('0x41')]['id']}})[_0x27d0('0x23')](handleEntityNotFound(_0x5b8b25,null))[_0x27d0('0x23')](saveUpdates(_0x505ef1['body'],null))[_0x27d0('0x23')](respondWithResult(_0x5b8b25,null))[_0x27d0('0x3f')](handleError(_0x5b8b25,null));};exports[_0x27d0('0x22')]=function(_0x1e383d,_0x586a9f){return db[_0x27d0('0x2b')][_0x27d0('0x44')]({'where':{'id':_0x1e383d[_0x27d0('0x41')]['id']}})[_0x27d0('0x23')](handleEntityNotFound(_0x586a9f,null))[_0x27d0('0x23')](removeEntity(_0x586a9f,null))[_0x27d0('0x3f')](handleError(_0x586a9f,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 207762a..8713da8 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 _0xa3e8=['request-promise','path','rimraf','define','tools_pauses','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4985fb,_0x93b134){var _0x410e68=function(_0x222f8a){while(--_0x222f8a){_0x4985fb['push'](_0x4985fb['shift']());}};_0x410e68(++_0x93b134);}(_0xa3e8,0x127));var _0x8a3e=function(_0x87db26,_0x5dbffb){_0x87db26=_0x87db26-0x0;var _0x20454f=_0xa3e8[_0x87db26];return _0x20454f;};'use strict';var _=require(_0x8a3e('0x0'));var util=require(_0x8a3e('0x1'));var logger=require(_0x8a3e('0x2'))('api');var moment=require(_0x8a3e('0x3'));var BPromise=require(_0x8a3e('0x4'));var rp=require(_0x8a3e('0x5'));var fs=require('fs');var path=require(_0x8a3e('0x6'));var rimraf=require(_0x8a3e('0x7'));var config=require('../../config/environment');var attributes=require('./pause.attributes');module['exports']=function(_0x920901,_0xe682f5){return _0x920901[_0x8a3e('0x8')]('Pause',attributes,{'tableName':_0x8a3e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d5b=['exports','Pause','tools_pauses','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./pause.attributes'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x24ca44,_0x387c3b){_0x24ca44=_0x24ca44-0x0;var _0x23e66f=_0x9d5b[_0x24ca44];return _0x23e66f;};'use strict';var _=require('lodash');var util=require(_0xb9d5('0x0'));var logger=require(_0xb9d5('0x1'))(_0xb9d5('0x2'));var moment=require(_0xb9d5('0x3'));var BPromise=require(_0xb9d5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9d5('0x5'));var rimraf=require('rimraf');var config=require(_0xb9d5('0x6'));var attributes=require(_0xb9d5('0x7'));module[_0xb9d5('0x8')]=function(_0x39d8fe,_0x422a92){return _0x39d8fe['define'](_0xb9d5('0x9'),attributes,{'tableName':_0xb9d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index a18fa1e..88b52db 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 _0x6e8a=['error','code','message','result','catch','ShowPause','Pause','options','raw','where','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','Pause,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xea1570,_0x2f7856){var _0x579e74=function(_0x236bcc){while(--_0x236bcc){_0xea1570['push'](_0xea1570['shift']());}};_0x579e74(++_0x2f7856);}(_0x6e8a,0x8a));var _0xa6e8=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x6e8a[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0xa6e8('0x0'));var util=require(_0xa6e8('0x1'));var moment=require(_0xa6e8('0x2'));var BPromise=require(_0xa6e8('0x3'));var rs=require(_0xa6e8('0x4'));var fs=require('fs');var Redis=require(_0xa6e8('0x5'));var db=require(_0xa6e8('0x6'))['db'];var utils=require(_0xa6e8('0x7'));var logger=require('../../config/logger')(_0xa6e8('0x8'));var config=require(_0xa6e8('0x9'));var jayson=require(_0xa6e8('0xa'));var client=jayson[_0xa6e8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x966c16,_0x57678e,_0x368c90){return new BPromise(function(_0x4b6f16,_0xf3e3bd){return client['request'](_0x966c16,_0x368c90)[_0xa6e8('0xc')](function(_0xba7235){logger[_0xa6e8('0xd')](_0xa6e8('0xe'),_0x57678e,_0xa6e8('0xf'));logger['debug']('Pause,\x20%s,\x20%s,\x20%s',_0x57678e,'request\x20sent',JSON[_0xa6e8('0x10')](_0xba7235));if(_0xba7235[_0xa6e8('0x11')]){if(_0xba7235[_0xa6e8('0x11')][_0xa6e8('0x12')]===0x1f4){logger[_0xa6e8('0x11')](_0xa6e8('0xe'),_0x57678e,_0xba7235['error'][_0xa6e8('0x13')]);return _0xf3e3bd(_0xba7235[_0xa6e8('0x11')][_0xa6e8('0x13')]);}logger[_0xa6e8('0x11')](_0xa6e8('0xe'),_0x57678e,_0xba7235[_0xa6e8('0x11')][_0xa6e8('0x13')]);return _0x4b6f16(_0xba7235[_0xa6e8('0x11')][_0xa6e8('0x13')]);}else{logger['info'](_0xa6e8('0xe'),_0x57678e,_0xa6e8('0xf'));_0x4b6f16(_0xba7235[_0xa6e8('0x14')][_0xa6e8('0x13')]);}})[_0xa6e8('0x15')](function(_0x5ce0b5){logger[_0xa6e8('0x11')](_0xa6e8('0xe'),_0x57678e,_0x5ce0b5);_0xf3e3bd(_0x5ce0b5);});});}exports[_0xa6e8('0x16')]=function(_0x3766be){var _0x2c9e5d=this;return new Promise(function(_0x58a560,_0x210a84){return db[_0xa6e8('0x17')]['find']({'raw':_0x3766be['options']?_0x3766be[_0xa6e8('0x18')][_0xa6e8('0x19')]===undefined?!![]:![]:!![],'where':_0x3766be[_0xa6e8('0x18')]?_0x3766be['options'][_0xa6e8('0x1a')]||null:null,'attributes':_0x3766be[_0xa6e8('0x18')]?_0x3766be[_0xa6e8('0x18')][_0xa6e8('0x1b')]||null:null,'include':_0x3766be['options']?_0x3766be['options']['include']?_[_0xa6e8('0x1c')](_0x3766be['options'][_0xa6e8('0x1d')],function(_0x18b3d5){return{'model':db[_0x18b3d5[_0xa6e8('0x1e')]],'as':_0x18b3d5['as'],'attributes':_0x18b3d5['attributes'],'include':_0x18b3d5[_0xa6e8('0x1d')]?_[_0xa6e8('0x1c')](_0x18b3d5[_0xa6e8('0x1d')],function(_0x405390){return{'model':db[_0x405390['model']],'as':_0x405390['as'],'attributes':_0x405390[_0xa6e8('0x1b')],'include':_0x405390['include']?_['map'](_0x405390[_0xa6e8('0x1d')],function(_0x22091d){return{'model':db[_0x22091d[_0xa6e8('0x1e')]],'as':_0x22091d['as'],'attributes':_0x22091d[_0xa6e8('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cf928){logger['info'](_0xa6e8('0x16'),_0x3766be);logger['debug'](_0xa6e8('0x16'),_0x3766be,JSON[_0xa6e8('0x10')](_0x5cf928));_0x58a560(_0x5cf928);})[_0xa6e8('0x15')](function(_0x46cc6c){logger[_0xa6e8('0x11')](_0xa6e8('0x16'),_0x46cc6c[_0xa6e8('0x13')],_0x3766be);_0x210a84(_0x2c9e5d[_0xa6e8('0x11')](0x1f4,_0x46cc6c[_0xa6e8('0x13')]));});});}; \ No newline at end of file +var _0x4f32=['message','result','catch','Pause','find','options','raw','where','include','model','map','attributes','ShowPause','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x54e167,_0x2fb491){var _0x2ffddd=function(_0x13f80b){while(--_0x13f80b){_0x54e167['push'](_0x54e167['shift']());}};_0x2ffddd(++_0x2fb491);}(_0x4f32,0x11b));var _0x24f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4f32[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x24f3('0x0'));var moment=require(_0x24f3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24f3('0x2'));var db=require(_0x24f3('0x3'))['db'];var utils=require(_0x24f3('0x4'));var logger=require(_0x24f3('0x5'))('rpc');var config=require(_0x24f3('0x6'));var jayson=require(_0x24f3('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42ac07,_0x518b88,_0x13c9c8){return new BPromise(function(_0x39c9e8,_0x368ba){return client['request'](_0x42ac07,_0x13c9c8)[_0x24f3('0x8')](function(_0x244a5d){logger[_0x24f3('0x9')](_0x24f3('0xa'),_0x518b88,_0x24f3('0xb'));logger[_0x24f3('0xc')](_0x24f3('0xd'),_0x518b88,_0x24f3('0xb'),JSON[_0x24f3('0xe')](_0x244a5d));if(_0x244a5d[_0x24f3('0xf')]){if(_0x244a5d[_0x24f3('0xf')][_0x24f3('0x10')]===0x1f4){logger[_0x24f3('0xf')]('Pause,\x20%s,\x20%s',_0x518b88,_0x244a5d[_0x24f3('0xf')][_0x24f3('0x11')]);return _0x368ba(_0x244a5d[_0x24f3('0xf')][_0x24f3('0x11')]);}logger[_0x24f3('0xf')](_0x24f3('0xa'),_0x518b88,_0x244a5d[_0x24f3('0xf')][_0x24f3('0x11')]);return _0x39c9e8(_0x244a5d[_0x24f3('0xf')][_0x24f3('0x11')]);}else{logger['info'](_0x24f3('0xa'),_0x518b88,_0x24f3('0xb'));_0x39c9e8(_0x244a5d[_0x24f3('0x12')][_0x24f3('0x11')]);}})[_0x24f3('0x13')](function(_0x324ff2){logger[_0x24f3('0xf')](_0x24f3('0xa'),_0x518b88,_0x324ff2);_0x368ba(_0x324ff2);});});}exports['ShowPause']=function(_0x307d8d){var _0x4086fa=this;return new Promise(function(_0x5c215a,_0x10b4f1){return db[_0x24f3('0x14')][_0x24f3('0x15')]({'raw':_0x307d8d[_0x24f3('0x16')]?_0x307d8d[_0x24f3('0x16')][_0x24f3('0x17')]===undefined?!![]:![]:!![],'where':_0x307d8d[_0x24f3('0x16')]?_0x307d8d[_0x24f3('0x16')][_0x24f3('0x18')]||null:null,'attributes':_0x307d8d[_0x24f3('0x16')]?_0x307d8d[_0x24f3('0x16')]['attributes']||null:null,'include':_0x307d8d[_0x24f3('0x16')]?_0x307d8d[_0x24f3('0x16')][_0x24f3('0x19')]?_['map'](_0x307d8d[_0x24f3('0x16')][_0x24f3('0x19')],function(_0x1ffa69){return{'model':db[_0x1ffa69[_0x24f3('0x1a')]],'as':_0x1ffa69['as'],'attributes':_0x1ffa69['attributes'],'include':_0x1ffa69['include']?_[_0x24f3('0x1b')](_0x1ffa69[_0x24f3('0x19')],function(_0x3fb515){return{'model':db[_0x3fb515[_0x24f3('0x1a')]],'as':_0x3fb515['as'],'attributes':_0x3fb515[_0x24f3('0x1c')],'include':_0x3fb515[_0x24f3('0x19')]?_[_0x24f3('0x1b')](_0x3fb515['include'],function(_0x53ba43){return{'model':db[_0x53ba43[_0x24f3('0x1a')]],'as':_0x53ba43['as'],'attributes':_0x53ba43[_0x24f3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x24f3('0x8')](function(_0x23c260){logger[_0x24f3('0x9')](_0x24f3('0x1d'),_0x307d8d);logger[_0x24f3('0xc')](_0x24f3('0x1d'),_0x307d8d,JSON[_0x24f3('0xe')](_0x23c260));_0x5c215a(_0x23c260);})['catch'](function(_0x4a841f){logger[_0x24f3('0xf')](_0x24f3('0x1d'),_0x4a841f[_0x24f3('0x11')],_0x307d8d);_0x10b4f1(_0x4086fa[_0x24f3('0xf')](0x1f4,_0x4a841f['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 51c2ee6..afdd6dc 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 _0x43bd=['download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','/:id','delete','exports','multer','connect-timeout','../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download'];(function(_0x30cc1a,_0x162bbc){var _0xb3f18f=function(_0x26bdfe){while(--_0x26bdfe){_0x30cc1a['push'](_0x30cc1a['shift']());}};_0xb3f18f(++_0x162bbc);}(_0x43bd,0xf4));var _0xd43b=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x43bd[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0xd43b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd43b('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd43b('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xd43b('0x3'));var controller=require(_0xd43b('0x4'));router[_0xd43b('0x5')]('/',auth[_0xd43b('0x6')](),controller[_0xd43b('0x7')]);router[_0xd43b('0x5')](_0xd43b('0x8'),controller[_0xd43b('0x9')]);router[_0xd43b('0x5')]('/:id',auth[_0xd43b('0x6')](),controller[_0xd43b('0xa')]);router['get'](_0xd43b('0xb'),auth['isAuthenticated'](),controller[_0xd43b('0xc')]);var upload=multer({'storage':multer[_0xd43b('0xd')]({'destination':function(_0x378265,_0x2a5234,_0xed7239){_0xed7239(null,path[_0xd43b('0xe')](config[_0xd43b('0xf')],_0xd43b('0x10')));},'filename':function(_0x168b22,_0x38fb0a,_0x309318){_0x38fb0a[_0xd43b('0x11')]=_0x38fb0a['originalname'][_0xd43b('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x309318(null,util[_0xd43b('0x13')](_0xd43b('0x14'),path[_0xd43b('0x15')](_0x38fb0a[_0xd43b('0x11')],path[_0xd43b('0x16')](_0x38fb0a['originalname'])),Date[_0xd43b('0x17')](),path[_0xd43b('0x16')](_0x38fb0a[_0xd43b('0x11')])));}})});router[_0xd43b('0x18')]('/',upload[_0xd43b('0x19')](_0xd43b('0x1a')),controller[_0xd43b('0x1b')]);router[_0xd43b('0x18')](_0xd43b('0x8'),controller[_0xd43b('0x1c')]);router['put'](_0xd43b('0x1d'),auth[_0xd43b('0x6')](),controller['update']);router[_0xd43b('0x1e')](_0xd43b('0x1d'),auth['isAuthenticated'](),controller['delete']);module[_0xd43b('0x1f')]=router; \ No newline at end of file +var _0x0a93=['originalname','replace','format','%s-%s%s','basename','extname','now','post','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x0a93,0x1db));var _0x30a9=function(_0xd49f5,_0x6b33f3){_0xd49f5=_0xd49f5-0x0;var _0x2b14d3=_0x0a93[_0xd49f5];return _0x2b14d3;};'use strict';var multer=require(_0x30a9('0x0'));var util=require(_0x30a9('0x1'));var path=require(_0x30a9('0x2'));var timeout=require(_0x30a9('0x3'));var express=require(_0x30a9('0x4'));var router=express[_0x30a9('0x5')]();var fs_extra=require(_0x30a9('0x6'));var auth=require(_0x30a9('0x7'));var interaction=require(_0x30a9('0x8'));var config=require(_0x30a9('0x9'));var controller=require('./plugin.controller');router['get']('/',auth[_0x30a9('0xa')](),controller['index']);router['get'](_0x30a9('0xb'),controller[_0x30a9('0xc')]);router['get'](_0x30a9('0xd'),auth[_0x30a9('0xa')](),controller[_0x30a9('0xe')]);router['get'](_0x30a9('0xf'),auth[_0x30a9('0xa')](),controller[_0x30a9('0x10')]);var upload=multer({'storage':multer[_0x30a9('0x11')]({'destination':function(_0x51f330,_0x181be9,_0x324688){_0x324688(null,path[_0x30a9('0x12')](config[_0x30a9('0x13')],_0x30a9('0x14')));},'filename':function(_0x279f8f,_0x228376,_0x9039b3){_0x228376[_0x30a9('0x15')]=_0x228376['originalname'][_0x30a9('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x9039b3(null,util[_0x30a9('0x17')](_0x30a9('0x18'),path[_0x30a9('0x19')](_0x228376[_0x30a9('0x15')],path[_0x30a9('0x1a')](_0x228376[_0x30a9('0x15')])),Date[_0x30a9('0x1b')](),path[_0x30a9('0x1a')](_0x228376[_0x30a9('0x15')])));}})});router['post']('/',upload['single']('file'),controller['upload']);router[_0x30a9('0x1c')](_0x30a9('0xb'),controller['webhookPost']);router[_0x30a9('0x1d')](_0x30a9('0xd'),auth['isAuthenticated'](),controller[_0x30a9('0x1e')]);router['delete'](_0x30a9('0xd'),auth[_0x30a9('0xa')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index f4df358..853071f 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 _0x78b3=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','script'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x78b3,0x1b3));var _0x378b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x78b3[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x378b('0x0'));module[_0x378b('0x1')]={'name':{'type':Sequelize[_0x378b('0x2')]},'type':{'type':Sequelize['ENUM'](_0x378b('0x3'),_0x378b('0x4'))},'description':{'type':Sequelize[_0x378b('0x5')]},'version':{'type':Sequelize[_0x378b('0x5')]},'path':{'type':Sequelize[_0x378b('0x2')],'comment':_0x378b('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x378b('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x378b('0x8'),'agentOnly',_0x378b('0x9'),'never'),'defaultValue':_0x378b('0x9'),'comment':_0x378b('0xa')},'icon':{'type':Sequelize[_0x378b('0x2')]},'adminUrl':{'type':Sequelize[_0x378b('0x2')]},'agentUrl':{'type':Sequelize[_0x378b('0x2')]},'scriptName':{'type':Sequelize[_0x378b('0x2')]},'scriptPath':{'type':Sequelize[_0x378b('0x2')]}}; \ No newline at end of file +var _0xbc1a=['never','sequelize','exports','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','always'];(function(_0x52aae9,_0x638e63){var _0xd86a41=function(_0x466c59){while(--_0x466c59){_0x52aae9['push'](_0x52aae9['shift']());}};_0xd86a41(++_0x638e63);}(_0xbc1a,0x1e5));var _0xabc1=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0xbc1a[_0x4a3898];return _0x25ceb0;};'use strict';var Sequelize=require(_0xabc1('0x0'));module[_0xabc1('0x1')]={'name':{'type':Sequelize[_0xabc1('0x2')]},'type':{'type':Sequelize['ENUM']('html','script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xabc1('0x2')],'comment':_0xabc1('0x3')},'active':{'type':Sequelize[_0xabc1('0x4')],'defaultValue':0x0,'comment':_0xabc1('0x5')},'sidebar':{'type':Sequelize[_0xabc1('0x6')](_0xabc1('0x7'),_0xabc1('0x8'),_0xabc1('0x9'),_0xabc1('0xa')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xabc1('0x2')]},'agentUrl':{'type':Sequelize[_0xabc1('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xabc1('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 565794d..70b5767 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 _0xbd99=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','defaults','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','Plugins','UserProfileResource','end','error','stack','name','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','Plugin','include','findAll','rows','show','params','keys','includeAll','find','catch','download','format','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','dirname','basename','node_modules/**/*','close','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','root','server/files/plugins','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','readFileSync','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','admin','Warning:\x20admin\x20view\x20not\x20specified','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','destroy','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','archiver','ioredis'];(function(_0x4b5d93,_0x59980a){var _0x1db431=function(_0x486268){while(--_0x486268){_0x4b5d93['push'](_0x4b5d93['shift']());}};_0x1db431(++_0x59980a);}(_0xbd99,0x1df));var _0x9bd9=function(_0x2abb8b,_0xf155e0){_0x2abb8b=_0x2abb8b-0x0;var _0x38fd98=_0xbd99[_0x2abb8b];return _0x38fd98;};'use strict';var emlformat=require(_0x9bd9('0x0'));var rimraf=require(_0x9bd9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9bd9('0x2'));var rp=require(_0x9bd9('0x3'));var moment=require('moment');var BPromise=require(_0x9bd9('0x4'));var Mustache=require(_0x9bd9('0x5'));var util=require(_0x9bd9('0x6'));var path=require(_0x9bd9('0x7'));var sox=require(_0x9bd9('0x8'));var csv=require(_0x9bd9('0x9'));var ejs=require(_0x9bd9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9bd9('0xb'));var squel=require(_0x9bd9('0xc'));var crypto=require(_0x9bd9('0xd'));var jsforce=require(_0x9bd9('0xe'));var deskjs=require(_0x9bd9('0xf'));var toCsv=require(_0x9bd9('0x9'));var querystring=require('querystring');var Papa=require(_0x9bd9('0x10'));var extract=require('extract-zip');var rimraf=require(_0x9bd9('0x1'));var archiver=require(_0x9bd9('0x11'));var Redis=require(_0x9bd9('0x12'));var authService=require(_0x9bd9('0x13'));var qs=require(_0x9bd9('0x14'));var as=require(_0x9bd9('0x15'));var hardwareService=require(_0x9bd9('0x16'));var logger=require('../../config/logger')(_0x9bd9('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9bd9('0x18'));var db=require('../../mysqldb')['db'];config[_0x9bd9('0x19')]=_[_0x9bd9('0x1a')](config[_0x9bd9('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x9bd9('0x1b'))(new Redis(config['redis']));require(_0x9bd9('0x1c'))[_0x9bd9('0x1d')](socket);function respondWithStatusCode(_0x4bab02,_0x197bcc){_0x197bcc=_0x197bcc||0xcc;return function(_0xf3949c){if(_0xf3949c){return _0x4bab02[_0x9bd9('0x1e')](_0x197bcc);}return _0x4bab02[_0x9bd9('0x1f')](_0x197bcc)['end']();};}function respondWithResult(_0x57ffcb,_0x334927){_0x334927=_0x334927||0xc8;return function(_0x221d94){if(_0x221d94){return _0x57ffcb[_0x9bd9('0x1f')](_0x334927)[_0x9bd9('0x20')](_0x221d94);}};}function respondWithFilteredResult(_0x3cba37,_0x3e52ae){return function(_0x4bb159){if(_0x4bb159){var _0x4296aa=typeof _0x3e52ae[_0x9bd9('0x21')]===_0x9bd9('0x22')&&typeof _0x3e52ae['limit']===_0x9bd9('0x22');var _0x3a6e76=_0x4bb159[_0x9bd9('0x23')];var _0x1820e3=_0x4296aa?0x0:_0x3e52ae[_0x9bd9('0x21')];var _0x2f762e=_0x4296aa?_0x4bb159['count']:_0x3e52ae['offset']+_0x3e52ae['limit'];var _0x4f05dc;if(_0x2f762e>=_0x3a6e76){_0x2f762e=_0x3a6e76;_0x4f05dc=0xc8;}else{_0x4f05dc=0xce;}_0x3cba37[_0x9bd9('0x1f')](_0x4f05dc);return _0x3cba37[_0x9bd9('0x24')](_0x9bd9('0x25'),_0x1820e3+'-'+_0x2f762e+'/'+_0x3a6e76)[_0x9bd9('0x20')](_0x4bb159);}return null;};}function patchUpdates(_0x4506d3){return function(_0x50fd9e){try{jsonpatch[_0x9bd9('0x26')](_0x50fd9e,_0x4506d3,!![]);}catch(_0x4b6bec){return BPromise[_0x9bd9('0x27')](_0x4b6bec);}return _0x50fd9e['save']();};}function saveUpdates(_0x2a06e9,_0x2a39ba){return function(_0x4896d8){if(_0x4896d8){return _0x4896d8[_0x9bd9('0x28')](_0x2a06e9)[_0x9bd9('0x29')](function(_0x46a234){return _0x46a234;});}return null;};}function removeEntity(_0x1fbb40,_0x2ff274){return function(_0x439cb8){if(_0x439cb8){return _0x439cb8['destroy']()[_0x9bd9('0x29')](function(){var _0x2dd667=_0x439cb8['get']({'plain':!![]});var _0x2d9a99=_0x9bd9('0x2a');return db[_0x9bd9('0x2b')]['destroy']({'where':{'type':_0x2d9a99,'resourceId':_0x2dd667['id']}})['then'](function(){return _0x439cb8;});})['then'](function(){_0x1fbb40[_0x9bd9('0x1f')](0xcc)[_0x9bd9('0x2c')]();});}};}function handleEntityNotFound(_0x159eac,_0x2e025f){return function(_0x3d3968){if(!_0x3d3968){_0x159eac[_0x9bd9('0x1e')](0x194);}return _0x3d3968;};}function handleError(_0x4f50bd,_0x1e9450){_0x1e9450=_0x1e9450||0x1f4;return function(_0x3e311c){logger[_0x9bd9('0x2d')](_0x3e311c[_0x9bd9('0x2e')]);if(_0x3e311c[_0x9bd9('0x2f')]){delete _0x3e311c[_0x9bd9('0x2f')];}_0x4f50bd[_0x9bd9('0x1f')](_0x1e9450)['send'](_0x3e311c);};}exports['index']=function(_0x30141f,_0x4ec29b){var _0x595558={},_0x4c9a5a={},_0x324da3={'count':0x0,'rows':[]};var _0x5846f2=_['map'](db['Plugin'][_0x9bd9('0x30')],function(_0x2a4094){return{'name':_0x2a4094['fieldName'],'type':_0x2a4094['type'][_0x9bd9('0x31')]};});_0x4c9a5a[_0x9bd9('0x32')]=_['map'](_0x5846f2,'name');_0x4c9a5a[_0x9bd9('0x33')]=_['keys'](_0x30141f['query']);_0x4c9a5a[_0x9bd9('0x34')]=_[_0x9bd9('0x35')](_0x4c9a5a[_0x9bd9('0x32')],_0x4c9a5a[_0x9bd9('0x33')]);_0x595558[_0x9bd9('0x36')]=_['intersection'](_0x4c9a5a['model'],qs[_0x9bd9('0x37')](_0x30141f[_0x9bd9('0x33')][_0x9bd9('0x37')]));_0x595558[_0x9bd9('0x36')]=_0x595558[_0x9bd9('0x36')][_0x9bd9('0x38')]?_0x595558[_0x9bd9('0x36')]:_0x4c9a5a[_0x9bd9('0x32')];if(!_0x30141f[_0x9bd9('0x33')][_0x9bd9('0x39')](_0x9bd9('0x3a'))){_0x595558[_0x9bd9('0x3b')]=qs[_0x9bd9('0x3b')](_0x30141f[_0x9bd9('0x33')][_0x9bd9('0x3b')]);_0x595558[_0x9bd9('0x21')]=qs['offset'](_0x30141f['query'][_0x9bd9('0x21')]);}_0x595558[_0x9bd9('0x3c')]=qs['sort'](_0x30141f[_0x9bd9('0x33')][_0x9bd9('0x3d')]);_0x595558[_0x9bd9('0x3e')]=qs[_0x9bd9('0x34')](_[_0x9bd9('0x3f')](_0x30141f[_0x9bd9('0x33')],_0x4c9a5a[_0x9bd9('0x34')]),_0x5846f2);if(_0x30141f[_0x9bd9('0x33')]['filter']){_0x595558[_0x9bd9('0x3e')]=_[_0x9bd9('0x40')](_0x595558[_0x9bd9('0x3e')],{'$or':_['map'](_0x5846f2,function(_0x4b72f1){if(_0x4b72f1[_0x9bd9('0x41')]!==_0x9bd9('0x42')){var _0x3ed8bb={};_0x3ed8bb[_0x4b72f1['name']]={'$like':'%'+_0x30141f['query'][_0x9bd9('0x43')]+'%'};return _0x3ed8bb;}})});}_0x595558=_[_0x9bd9('0x40')]({},_0x595558,_0x30141f[_0x9bd9('0x44')]);var _0x3dc7f6={'where':_0x595558[_0x9bd9('0x3e')]};return db[_0x9bd9('0x45')][_0x9bd9('0x23')](_0x3dc7f6)[_0x9bd9('0x29')](function(_0x419552){_0x324da3['count']=_0x419552;if(_0x30141f['query']['includeAll']){_0x595558[_0x9bd9('0x46')]=[{'all':!![]}];}return db[_0x9bd9('0x45')][_0x9bd9('0x47')](_0x595558);})[_0x9bd9('0x29')](function(_0x540c54){_0x324da3[_0x9bd9('0x48')]=_0x540c54;return _0x324da3;})[_0x9bd9('0x29')](respondWithFilteredResult(_0x4ec29b,_0x595558))['catch'](handleError(_0x4ec29b,null));};exports[_0x9bd9('0x49')]=function(_0x32812b,_0x5a1f1a){var _0x4556c2={'raw':!![],'where':{'id':_0x32812b[_0x9bd9('0x4a')]['id']}},_0x571ae9={};_0x571ae9[_0x9bd9('0x32')]=_[_0x9bd9('0x4b')](db[_0x9bd9('0x45')]['rawAttributes']);_0x571ae9[_0x9bd9('0x33')]=_['keys'](_0x32812b[_0x9bd9('0x33')]);_0x571ae9[_0x9bd9('0x34')]=_[_0x9bd9('0x35')](_0x571ae9[_0x9bd9('0x32')],_0x571ae9[_0x9bd9('0x33')]);_0x4556c2[_0x9bd9('0x36')]=_[_0x9bd9('0x35')](_0x571ae9[_0x9bd9('0x32')],qs[_0x9bd9('0x37')](_0x32812b[_0x9bd9('0x33')]['fields']));_0x4556c2['attributes']=_0x4556c2[_0x9bd9('0x36')][_0x9bd9('0x38')]?_0x4556c2['attributes']:_0x571ae9[_0x9bd9('0x32')];if(_0x32812b['query'][_0x9bd9('0x4c')]){_0x4556c2[_0x9bd9('0x46')]=[{'all':!![]}];}_0x4556c2=_[_0x9bd9('0x40')]({},_0x4556c2,_0x32812b[_0x9bd9('0x44')]);return db[_0x9bd9('0x45')][_0x9bd9('0x4d')](_0x4556c2)[_0x9bd9('0x29')](handleEntityNotFound(_0x5a1f1a,null))[_0x9bd9('0x29')](respondWithResult(_0x5a1f1a,null))[_0x9bd9('0x4e')](handleError(_0x5a1f1a,null));};exports[_0x9bd9('0x4f')]=function(_0x29ccb7,_0x4056ab,_0x1d3705){return db['Plugin'][_0x9bd9('0x4d')]({'where':{'id':_0x29ccb7['params']['id']},'attributes':[_0x9bd9('0x2f'),_0x9bd9('0x7')],'raw':!![]})[_0x9bd9('0x29')](handleEntityNotFound(_0x4056ab,null))[_0x9bd9('0x29')](function(_0x39f4d2){if(_0x39f4d2){var _0x4dda2e=path['join'](config['root'],'server/files/plugins',util[_0x9bd9('0x50')]('%s.zip',path['basename'](_0x39f4d2[_0x9bd9('0x7')])));var _0x4d4c46=fs[_0x9bd9('0x51')](_0x4dda2e);var _0x990a16=archiver(_0x9bd9('0x52'),{'zlib':{'level':0x9}});_0x990a16['on'](_0x9bd9('0x53'),function(_0x5144ae){if(_0x5144ae[_0x9bd9('0x54')]===_0x9bd9('0x55')){logger[_0x9bd9('0x2d')](_0x5144ae);}else{throw new db[(_0x9bd9('0x56'))][(_0x9bd9('0x57'))](_0x9bd9('0x58'));}});_0x990a16['on']('error',function(_0x1c9f8a){throw new db['Sequelize'][(_0x9bd9('0x57'))](_0x9bd9('0x58'));});_0x990a16['pipe'](_0x4d4c46);_0x990a16[_0x9bd9('0x59')](_0x9bd9('0x5a'),{'cwd':path[_0x9bd9('0x5b')](config['root'],'server/files/plugins',path[_0x9bd9('0x5c')](_0x39f4d2[_0x9bd9('0x7')])),'ignore':[path[_0x9bd9('0x5b')](path[_0x9bd9('0x5d')](_0x39f4d2[_0x9bd9('0x7')]),_0x9bd9('0x5e')),path[_0x9bd9('0x5b')](path['basename'](_0x39f4d2[_0x9bd9('0x7')]),'attachments/**/*')],'nodir':!![]})['finalize']();_0x4d4c46['on'](_0x9bd9('0x5f'),function(){if(!fs['existsSync'](_0x4dda2e)){throw new db['Sequelize'][(_0x9bd9('0x57'))](_0x9bd9('0x60'));}return _0x4056ab[_0x9bd9('0x4f')](_0x4dda2e,util[_0x9bd9('0x50')](_0x9bd9('0x61'),path[_0x9bd9('0x5d')](_0x39f4d2['path'])),function(_0x3be836){if(_0x3be836){throw new db[(_0x9bd9('0x56'))][(_0x9bd9('0x57'))](_0x9bd9('0x62'));}fs[_0x9bd9('0x63')](_0x4dda2e);logger[_0x9bd9('0x64')]('Download\x20completed');logger['info'](_0x9bd9('0x65'));});});}return null;})[_0x9bd9('0x4e')](handleError(_0x4056ab,null));};exports[_0x9bd9('0x66')]=function(_0x3d5afa,_0x2df3b0,_0x4e9ab7){var _0x1b4cc3=path[_0x9bd9('0x5d')](_0x3d5afa[_0x9bd9('0x67')][_0x9bd9('0x68')],path['extname'](_0x3d5afa[_0x9bd9('0x67')]['filename']));var _0x7a0908=path['join'](config[_0x9bd9('0x69')],_0x9bd9('0x6a'),_0x3d5afa[_0x9bd9('0x67')][_0x9bd9('0x68')]);var _0x59df1e=path[_0x9bd9('0x5b')](config[_0x9bd9('0x69')],_0x9bd9('0x6a'),_0x1b4cc3);logger[_0x9bd9('0x64')]('Plugin\x20upload\x20filepath:\x20%s',_0x7a0908);logger['info'](_0x9bd9('0x6b'),_0x59df1e);try{fs['chmodSync'](_0x7a0908,parseInt(_0x9bd9('0x6c'),0x8));extract(_0x7a0908,{'dir':_0x59df1e},function(_0x44a002){if(_0x44a002){logger[_0x9bd9('0x2d')](_0x44a002);handleError(_0x44a002,!![]);};var _0x5290d4=fs[_0x9bd9('0x6d')](_0x59df1e);if(_0x5290d4[_0x9bd9('0x38')]>0x1){removeReferences(_0x7a0908,_0x59df1e);logger['error']('Invalid\x20plugin\x20structure');return _0x4e9ab7(new Error(_0x9bd9('0x6e')));}var _0x3f3387=fs['lstatSync'](path[_0x9bd9('0x5b')](_0x59df1e,_0x5290d4[0x0]));if(_0x3f3387[_0x9bd9('0x6f')]()){removeReferences(_0x7a0908,_0x59df1e);logger['error'](_0x9bd9('0x6e'));return _0x4e9ab7(new Error(_0x9bd9('0x6e')));}if(_0x3f3387[_0x9bd9('0x70')]()){var _0x5b87dd=fs[_0x9bd9('0x6d')](path[_0x9bd9('0x5b')](_0x59df1e,_0x5290d4[0x0]));if(_0x5b87dd[_0x9bd9('0x38')]===0x0){removeReferences(_0x7a0908,_0x59df1e);logger[_0x9bd9('0x2d')](_0x9bd9('0x6e'));return _0x4e9ab7(new Error('Invalid\x20plugin\x20structure'));}var _0x35f1fa=_0x5b87dd[_0x9bd9('0x71')](function(_0x4a9baf){return _0x4a9baf===_0x9bd9('0x72');});if(!_0x35f1fa){return _0x4e9ab7(new Error('Plugin\x20manifest\x20missing'));}var _0x22c1a6=fs[_0x9bd9('0x73')](path[_0x9bd9('0x5b')](_0x59df1e,_0x5290d4[0x0],_0x9bd9('0x72')));var _0x2134e1=JSON['parse'](_0x22c1a6);if('undefined'==typeof _0x2134e1[_0x9bd9('0x2f')]){return _0x4e9ab7(new Error(_0x9bd9('0x74')));}if('undefined'==typeof _0x2134e1[_0x9bd9('0x41')]){return _0x4e9ab7(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x2134e1[_0x9bd9('0x75')]){return _0x4e9ab7(new Error(_0x9bd9('0x76')));}if(_0x9bd9('0x22')==typeof _0x2134e1[_0x9bd9('0x77')]){return _0x4e9ab7(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x2134e1['type']===_0x9bd9('0x78')){if(_0x9bd9('0x22')==typeof _0x2134e1[_0x9bd9('0x77')][_0x9bd9('0x79')]){return _0x4e9ab7(new Error(_0x9bd9('0x7a')));}if('undefined'==typeof _0x2134e1['parameters'][_0x9bd9('0x79')]['admin']&&_0x9bd9('0x22')==typeof _0x2134e1[_0x9bd9('0x77')][_0x9bd9('0x79')][_0x9bd9('0x7b')]){return _0x4e9ab7(new Error(_0x9bd9('0x7c')));}}else if(_0x2134e1[_0x9bd9('0x41')]==='script'){if(_0x9bd9('0x22')==typeof _0x2134e1[_0x9bd9('0x77')]['scriptName']){return _0x4e9ab7(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x2134e1[_0x9bd9('0x77')][_0x9bd9('0x7d')]){return _0x4e9ab7(new Error(_0x9bd9('0x7e')));}}else{return _0x4e9ab7(new Error(_0x9bd9('0x7f')));}var _0x49017a=_0x2134e1['name'];var _0x10df9a=_0x2134e1['description'];var _0x3219e3=_0x2134e1[_0x9bd9('0x41')];var _0x279b74=_0x2134e1[_0x9bd9('0x80')]?_0x2134e1[_0x9bd9('0x80')]:_0x9bd9('0x81');var _0x5ddae9=_0x2134e1[_0x9bd9('0x82')]?_0x2134e1[_0x9bd9('0x82')]:_0x9bd9('0x83');var _0x17fab0='';var _0x42e5a2='';var _0x2ab4ea='';var _0x34aa92='';var _0x358e4c=_0x2134e1['version'];if(_0x3219e3===_0x9bd9('0x78')){if('undefined'!=typeof _0x2134e1['parameters'][_0x9bd9('0x79')][_0x9bd9('0x84')]){var _0x362e88=_0x2134e1['parameters'][_0x9bd9('0x79')][_0x9bd9('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0x362e88)){_0x17fab0=path['join']('plugins',_0x1b4cc3,_0x5290d4[0x0],_0x362e88);}else{_0x17fab0=_0x362e88;}}else{logger[_0x9bd9('0x64')](_0x9bd9('0x85'));}if('undefined'!=typeof _0x2134e1[_0x9bd9('0x77')][_0x9bd9('0x79')][_0x9bd9('0x7b')]){var _0xb687a2=_0x2134e1[_0x9bd9('0x77')]['views'][_0x9bd9('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0x9bd9('0x86')](_0xb687a2)){_0x42e5a2=path[_0x9bd9('0x5b')](_0x9bd9('0x87'),_0x1b4cc3,_0x5290d4[0x0],_0xb687a2);}else{_0x42e5a2=_0xb687a2;}}else{logger[_0x9bd9('0x64')](_0x9bd9('0x88'));}}else if(_0x3219e3===_0x9bd9('0x89')){_0x2ab4ea=_0x2134e1[_0x9bd9('0x77')][_0x9bd9('0x8a')];_0x34aa92=_0x2134e1[_0x9bd9('0x77')]['scriptPath'];if(_0x9bd9('0x22')!=typeof _0x2134e1[_0x9bd9('0x77')]['views']){if(_0x9bd9('0x22')!=typeof _0x2134e1[_0x9bd9('0x77')][_0x9bd9('0x79')][_0x9bd9('0x84')]){var _0x362e88=_0x2134e1[_0x9bd9('0x77')]['views'][_0x9bd9('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x9bd9('0x86')](_0x362e88)){_0x17fab0=path[_0x9bd9('0x5b')](_0x9bd9('0x87'),_0x1b4cc3,_0x5290d4[0x0],_0x362e88);}else{_0x17fab0=_0x362e88;}}if('undefined'!=typeof _0x2134e1[_0x9bd9('0x77')][_0x9bd9('0x79')][_0x9bd9('0x7b')]){var _0xb687a2=_0x2134e1[_0x9bd9('0x77')][_0x9bd9('0x79')][_0x9bd9('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0x9bd9('0x86')](_0xb687a2)){_0x42e5a2=path[_0x9bd9('0x5b')]('plugins',_0x1b4cc3,_0x5290d4[0x0],_0xb687a2);}else{_0x42e5a2=_0xb687a2;}}}}var _0x357ec9={'name':_0x49017a,'description':_0x10df9a,'path':path[_0x9bd9('0x5b')](_0x1b4cc3,_0x5290d4[0x0]),'type':_0x3219e3,'sidebar':_0x279b74,'icon':_0x5ddae9,'adminUrl':_0x17fab0,'agentUrl':_0x42e5a2,'scriptName':_0x2ab4ea,'scriptPath':_0x34aa92,'version':_0x358e4c};removeReferences(_0x7a0908,null);return db[_0x9bd9('0x45')][_0x9bd9('0x8b')](_0x357ec9)[_0x9bd9('0x29')](function(_0x555d51){var _0x5c73eb={'role':_0x3d5afa[_0x9bd9('0x8c')][_0x9bd9('0x8d')],'userProfileId':_0x3d5afa[_0x9bd9('0x8c')][_0x9bd9('0x8e')]};if(!_0x5c73eb)throw new Error(_0x9bd9('0x8f'));if(_0x5c73eb[_0x9bd9('0x8d')]===_0x9bd9('0x90')){var _0x55ad7a=_0x555d51['get']({'plain':!![]});return db[_0x9bd9('0x91')][_0x9bd9('0x4d')]({'where':{'name':_0x9bd9('0x2a'),'userProfileId':_0x5c73eb['userProfileId']},'raw':!![]})[_0x9bd9('0x29')](function(_0x6a8fbc){if(_0x6a8fbc&&_0x6a8fbc[_0x9bd9('0x92')]===0x0){return db[_0x9bd9('0x2b')][_0x9bd9('0x8b')]({'name':_0x55ad7a[_0x9bd9('0x2f')],'resourceId':_0x55ad7a['id'],'type':_0x6a8fbc[_0x9bd9('0x2f')],'sectionId':_0x6a8fbc['id']},{})[_0x9bd9('0x29')](function(){return _0x555d51;});}else{return _0x555d51;}})[_0x9bd9('0x4e')](function(_0x35bb91){logger[_0x9bd9('0x2d')](_0x9bd9('0x93'),_0x35bb91);throw _0x35bb91;});}return _0x555d51;})[_0x9bd9('0x29')](respondWithResult(_0x2df3b0,null))['catch'](handleError(_0x2df3b0,null));}});}catch(_0x324ef4){_0x2df3b0['status'](0x1f4)[_0x9bd9('0x94')](_0x324ef4);}};function removeReferences(_0x501c3f,_0x1ae361){try{if(_0x501c3f){fs[_0x9bd9('0x63')](_0x501c3f);logger[_0x9bd9('0x64')](_0x9bd9('0x95'));}if(_0x1ae361){rimraf(_0x1ae361,function(){});logger[_0x9bd9('0x64')](_0x9bd9('0x96'));}}catch(_0x568ef7){logger[_0x9bd9('0x2d')](_0x568ef7);}}exports[_0x9bd9('0x28')]=function(_0x4c86f4,_0x5baa3f,_0x397de3){return db[_0x9bd9('0x45')]['find']({'where':{'id':_0x4c86f4['params']['id']}})[_0x9bd9('0x29')](handleEntityNotFound(_0x5baa3f,null))[_0x9bd9('0x29')](saveUpdates(_0x4c86f4['body'],null))['then'](respondWithResult(_0x5baa3f,null))[_0x9bd9('0x4e')](handleError(_0x5baa3f,null));};exports['delete']=function(_0x3eff05,_0x3c49d2,_0x417f93){return db['Plugin'][_0x9bd9('0x4d')]({'where':{'id':_0x3eff05[_0x9bd9('0x4a')]['id']}})['then'](function(_0x13a54a){if(_0x13a54a){return _0x13a54a[_0x9bd9('0x97')]();}})[_0x9bd9('0x29')](function(_0x2e565e){rimraf(path[_0x9bd9('0x5b')](config[_0x9bd9('0x69')],_0x9bd9('0x6a'),path['dirname'](_0x2e565e['path'])),function(){});return _0x2e565e;})[_0x9bd9('0x29')](handleEntityNotFound(_0x3c49d2,null))[_0x9bd9('0x29')](respondWithStatusCode(_0x3c49d2,null))[_0x9bd9('0x4e')](handleError(_0x3c49d2,null));};exports['webhookGet']=function(_0x1b111b,_0x1fd8f2,_0x212183){return BPromise[_0x9bd9('0x98')]()[_0x9bd9('0x29')](function(){if(!_0x1b111b[_0x9bd9('0x33')][_0x9bd9('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1b111b['query'][_0x9bd9('0x99')]){throw new Error(_0x9bd9('0x9a'));}var _0x293779=_0x1b111b[_0x9bd9('0x33')]['hostname']?_0x1b111b[_0x9bd9('0x33')]['hostname']+':'+_0x1b111b[_0x9bd9('0x33')][_0x9bd9('0x99')]:'http://localhost:'+_0x1b111b[_0x9bd9('0x33')][_0x9bd9('0x99')];var _0x4bf631=_0x1b111b[_0x9bd9('0x33')]['json']?_0x1b111b[_0x9bd9('0x33')][_0x9bd9('0x20')]:!![];var _0x31e74a=_0x1b111b[_0x9bd9('0x33')]['encoding']?_0x1b111b[_0x9bd9('0x33')][_0x9bd9('0x9b')]:null;var _0x5b9ef0={'method':_0x1b111b[_0x9bd9('0x9c')],'uri':util[_0x9bd9('0x50')](_0x9bd9('0x9d'),_0x293779,_0x1b111b['query']['path']),'json':_0x4bf631,'resolveWithFullResponse':!![],'encoding':_0x31e74a,'qs':_0x1b111b[_0x9bd9('0x33')]};if(_0x1b111b[_0x9bd9('0x9e')]){_0x5b9ef0[_0x9bd9('0x9e')]=_0x1b111b[_0x9bd9('0x9e')];if(_0x5b9ef0['headers'][_0x9bd9('0x9f')]){delete _0x5b9ef0[_0x9bd9('0x9e')][_0x9bd9('0x9f')];}}if(_0x5b9ef0[_0x9bd9('0x9e')][_0x9bd9('0xa0')]){delete _0x5b9ef0['headers'][_0x9bd9('0xa0')];}return rp(_0x5b9ef0);})[_0x9bd9('0x29')](function(_0x568af2){if(_0x568af2){_0x1fd8f2[_0x9bd9('0x24')](_0x568af2[_0x9bd9('0x9e')]);logger[_0x9bd9('0x64')](_0x568af2[_0x9bd9('0x8c')]);if(_[_0x9bd9('0xa1')](_0x1b111b[_0x9bd9('0x33')]['path'],_0x9bd9('0x4f'))&&_0x568af2[_0x9bd9('0xa2')]==0x1f4){return _0x1fd8f2[_0x9bd9('0x1e')](_0x568af2[_0x9bd9('0xa2')]);}else{return _0x1fd8f2['status'](_0x568af2[_0x9bd9('0xa2')])[_0x9bd9('0x94')](_0x568af2[_0x9bd9('0x8c')]);}}else{return _0x1fd8f2[_0x9bd9('0x1e')](0xc8);}})[_0x9bd9('0x4e')](handleError(_0x1fd8f2,null));};exports['webhookPost']=function(_0x1f6676,_0x2a2b44,_0x3ae6c1){return BPromise[_0x9bd9('0x98')]()[_0x9bd9('0x29')](function(){if(!_0x1f6676['query'][_0x9bd9('0x7')]){throw new Error(_0x9bd9('0xa3'));}if(!_0x1f6676[_0x9bd9('0x33')][_0x9bd9('0x99')]){throw new Error(_0x9bd9('0x9a'));}var _0x32e923=_0x1f6676[_0x9bd9('0x33')][_0x9bd9('0xa4')]?_0x1f6676[_0x9bd9('0x33')][_0x9bd9('0xa4')]+':'+_0x1f6676['query'][_0x9bd9('0x99')]:_0x9bd9('0xa5')+_0x1f6676[_0x9bd9('0x33')][_0x9bd9('0x99')];var _0x3712f5=_0x1f6676[_0x9bd9('0x33')][_0x9bd9('0x20')]?_0x1f6676[_0x9bd9('0x33')][_0x9bd9('0x20')]:!![];var _0x46bd58=_0x1f6676[_0x9bd9('0x33')][_0x9bd9('0x9b')]?_0x1f6676[_0x9bd9('0x33')][_0x9bd9('0x9b')]:null;var _0x1da0e5={'method':_0x1f6676[_0x9bd9('0x9c')],'uri':util[_0x9bd9('0x50')](_0x9bd9('0x9d'),_0x32e923,_0x1f6676[_0x9bd9('0x33')][_0x9bd9('0x7')]),'json':_0x3712f5,'resolveWithFullResponse':!![],'encoding':_0x46bd58,'body':_0x1f6676[_0x9bd9('0x8c')]};if(_0x1f6676[_0x9bd9('0x9e')]){_0x1da0e5[_0x9bd9('0x9e')]=_0x1f6676[_0x9bd9('0x9e')];if(_0x1da0e5['headers'][_0x9bd9('0x9f')]){delete _0x1da0e5[_0x9bd9('0x9e')][_0x9bd9('0x9f')];}}if(_0x1da0e5[_0x9bd9('0x9e')][_0x9bd9('0xa0')]){delete _0x1da0e5[_0x9bd9('0x9e')][_0x9bd9('0xa0')];}return rp(_0x1da0e5);})[_0x9bd9('0x29')](function(_0x7906a9){if(_0x7906a9){_0x2a2b44['set'](_0x7906a9['headers']);logger[_0x9bd9('0x64')](_0x7906a9[_0x9bd9('0x8c')]);return _0x2a2b44[_0x9bd9('0x1f')](_0x7906a9[_0x9bd9('0xa2')])[_0x9bd9('0x94')](_0x7906a9[_0x9bd9('0x8c')]);}else{return _0x2a2b44[_0x9bd9('0x1e')](0xc8);}})[_0x9bd9('0x4e')](handleError(_0x2a2b44,null));}; \ No newline at end of file +var _0x98d8=['always','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','scriptName','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','find','delete','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','port','http://localhost:','encoding','method','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','resolve','hostname','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Plugins','UserProfileResource','sendStatus','name','send','Plugin','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','download','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','dirname','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','file','filename','chmodSync','0777','readdirSync','error','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20parameters\x20missing','Invalid\x20manifest:\x20views\x20missing','parameters','views','admin','script','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar'];(function(_0x76cd1d,_0x21d168){var _0x469d43=function(_0x2ca454){while(--_0x2ca454){_0x76cd1d['push'](_0x76cd1d['shift']());}};_0x469d43(++_0x21d168);}(_0x98d8,0xce));var _0x898d=function(_0x1ebc6c,_0x58a00b){_0x1ebc6c=_0x1ebc6c-0x0;var _0x3a826d=_0x98d8[_0x1ebc6c];return _0x3a826d;};'use strict';var emlformat=require(_0x898d('0x0'));var rimraf=require(_0x898d('0x1'));var zipdir=require(_0x898d('0x2'));var jsonpatch=require(_0x898d('0x3'));var rp=require(_0x898d('0x4'));var moment=require(_0x898d('0x5'));var BPromise=require(_0x898d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x898d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x898d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898d('0x9'));var squel=require('squel');var crypto=require(_0x898d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x898d('0xb'));var toCsv=require(_0x898d('0xc'));var querystring=require(_0x898d('0xd'));var Papa=require(_0x898d('0xe'));var extract=require(_0x898d('0xf'));var rimraf=require(_0x898d('0x1'));var archiver=require(_0x898d('0x10'));var Redis=require(_0x898d('0x11'));var authService=require(_0x898d('0x12'));var qs=require(_0x898d('0x13'));var as=require(_0x898d('0x14'));var hardwareService=require(_0x898d('0x15'));var logger=require(_0x898d('0x16'))(_0x898d('0x17'));var utils=require(_0x898d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x898d('0x19'));var db=require(_0x898d('0x1a'))['db'];config['redis']=_[_0x898d('0x1b')](config[_0x898d('0x1c')],{'host':_0x898d('0x1d'),'port':0x18eb});var socket=require(_0x898d('0x1e'))(new Redis(config[_0x898d('0x1c')]));require(_0x898d('0x1f'))[_0x898d('0x20')](socket);function respondWithStatusCode(_0x50634f,_0x15fafc){_0x15fafc=_0x15fafc||0xcc;return function(_0xccd1a9){if(_0xccd1a9){return _0x50634f['sendStatus'](_0x15fafc);}return _0x50634f['status'](_0x15fafc)[_0x898d('0x21')]();};}function respondWithResult(_0x42a098,_0x1ff50b){_0x1ff50b=_0x1ff50b||0xc8;return function(_0x4202f0){if(_0x4202f0){return _0x42a098[_0x898d('0x22')](_0x1ff50b)[_0x898d('0x23')](_0x4202f0);}};}function respondWithFilteredResult(_0x514c47,_0x47c188){return function(_0x26be5a){if(_0x26be5a){var _0x3d040a=typeof _0x47c188[_0x898d('0x24')]===_0x898d('0x25')&&typeof _0x47c188[_0x898d('0x26')]===_0x898d('0x25');var _0x3db3a7=_0x26be5a[_0x898d('0x27')];var _0x12e72c=_0x3d040a?0x0:_0x47c188[_0x898d('0x24')];var _0x220d7b=_0x3d040a?_0x26be5a['count']:_0x47c188[_0x898d('0x24')]+_0x47c188[_0x898d('0x26')];var _0x7113ca;if(_0x220d7b>=_0x3db3a7){_0x220d7b=_0x3db3a7;_0x7113ca=0xc8;}else{_0x7113ca=0xce;}_0x514c47['status'](_0x7113ca);return _0x514c47['set'](_0x898d('0x28'),_0x12e72c+'-'+_0x220d7b+'/'+_0x3db3a7)[_0x898d('0x23')](_0x26be5a);}return null;};}function patchUpdates(_0xa4fc71){return function(_0x10290f){try{jsonpatch[_0x898d('0x29')](_0x10290f,_0xa4fc71,!![]);}catch(_0x3fc201){return BPromise[_0x898d('0x2a')](_0x3fc201);}return _0x10290f[_0x898d('0x2b')]();};}function saveUpdates(_0x30c415,_0x493a60){return function(_0x543fc3){if(_0x543fc3){return _0x543fc3[_0x898d('0x2c')](_0x30c415)[_0x898d('0x2d')](function(_0x308b13){return _0x308b13;});}return null;};}function removeEntity(_0x39b61e,_0x244d3a){return function(_0xef200a){if(_0xef200a){return _0xef200a[_0x898d('0x2e')]()['then'](function(){var _0x7873=_0xef200a['get']({'plain':!![]});var _0xaa0054=_0x898d('0x2f');return db[_0x898d('0x30')][_0x898d('0x2e')]({'where':{'type':_0xaa0054,'resourceId':_0x7873['id']}})[_0x898d('0x2d')](function(){return _0xef200a;});})[_0x898d('0x2d')](function(){_0x39b61e['status'](0xcc)[_0x898d('0x21')]();});}};}function handleEntityNotFound(_0xfcae2d,_0x1baec7){return function(_0x47ea99){if(!_0x47ea99){_0xfcae2d[_0x898d('0x31')](0x194);}return _0x47ea99;};}function handleError(_0x15b0fb,_0x417c8e){_0x417c8e=_0x417c8e||0x1f4;return function(_0x8e2e5b){logger['error'](_0x8e2e5b['stack']);if(_0x8e2e5b['name']){delete _0x8e2e5b[_0x898d('0x32')];}_0x15b0fb[_0x898d('0x22')](_0x417c8e)[_0x898d('0x33')](_0x8e2e5b);};}exports['index']=function(_0x3325bc,_0x252d3a){var _0x1b8eb2={},_0xf520fa={},_0x5e6df7={'count':0x0,'rows':[]};var _0x1a5dc2=_['map'](db[_0x898d('0x34')][_0x898d('0x35')],function(_0x30b5b0){return{'name':_0x30b5b0[_0x898d('0x36')],'type':_0x30b5b0[_0x898d('0x37')]['key']};});_0xf520fa['model']=_[_0x898d('0x38')](_0x1a5dc2,_0x898d('0x32'));_0xf520fa['query']=_[_0x898d('0x39')](_0x3325bc[_0x898d('0x3a')]);_0xf520fa[_0x898d('0x3b')]=_[_0x898d('0x3c')](_0xf520fa[_0x898d('0x3d')],_0xf520fa[_0x898d('0x3a')]);_0x1b8eb2['attributes']=_[_0x898d('0x3c')](_0xf520fa[_0x898d('0x3d')],qs[_0x898d('0x3e')](_0x3325bc['query'][_0x898d('0x3e')]));_0x1b8eb2[_0x898d('0x3f')]=_0x1b8eb2[_0x898d('0x3f')]['length']?_0x1b8eb2[_0x898d('0x3f')]:_0xf520fa[_0x898d('0x3d')];if(!_0x3325bc[_0x898d('0x3a')][_0x898d('0x40')](_0x898d('0x41'))){_0x1b8eb2[_0x898d('0x26')]=qs[_0x898d('0x26')](_0x3325bc['query']['limit']);_0x1b8eb2[_0x898d('0x24')]=qs[_0x898d('0x24')](_0x3325bc['query'][_0x898d('0x24')]);}_0x1b8eb2[_0x898d('0x42')]=qs[_0x898d('0x43')](_0x3325bc[_0x898d('0x3a')][_0x898d('0x43')]);_0x1b8eb2[_0x898d('0x44')]=qs[_0x898d('0x3b')](_[_0x898d('0x45')](_0x3325bc[_0x898d('0x3a')],_0xf520fa[_0x898d('0x3b')]),_0x1a5dc2);if(_0x3325bc[_0x898d('0x3a')][_0x898d('0x46')]){_0x1b8eb2[_0x898d('0x44')]=_[_0x898d('0x47')](_0x1b8eb2['where'],{'$or':_[_0x898d('0x38')](_0x1a5dc2,function(_0x23e87b){if(_0x23e87b['type']!==_0x898d('0x48')){var _0x1e77b2={};_0x1e77b2[_0x23e87b['name']]={'$like':'%'+_0x3325bc[_0x898d('0x3a')][_0x898d('0x46')]+'%'};return _0x1e77b2;}})});}_0x1b8eb2=_[_0x898d('0x47')]({},_0x1b8eb2,_0x3325bc[_0x898d('0x49')]);var _0x413b18={'where':_0x1b8eb2['where']};return db[_0x898d('0x34')][_0x898d('0x27')](_0x413b18)[_0x898d('0x2d')](function(_0x233c71){_0x5e6df7[_0x898d('0x27')]=_0x233c71;if(_0x3325bc[_0x898d('0x3a')][_0x898d('0x4a')]){_0x1b8eb2[_0x898d('0x4b')]=[{'all':!![]}];}return db['Plugin'][_0x898d('0x4c')](_0x1b8eb2);})['then'](function(_0x3b6b69){_0x5e6df7[_0x898d('0x4d')]=_0x3b6b69;return _0x5e6df7;})['then'](respondWithFilteredResult(_0x252d3a,_0x1b8eb2))[_0x898d('0x4e')](handleError(_0x252d3a,null));};exports[_0x898d('0x4f')]=function(_0x43ee93,_0x4634f7){var _0x41a746={'raw':!![],'where':{'id':_0x43ee93[_0x898d('0x50')]['id']}},_0x2f834b={};_0x2f834b[_0x898d('0x3d')]=_[_0x898d('0x39')](db[_0x898d('0x34')][_0x898d('0x35')]);_0x2f834b[_0x898d('0x3a')]=_[_0x898d('0x39')](_0x43ee93[_0x898d('0x3a')]);_0x2f834b[_0x898d('0x3b')]=_[_0x898d('0x3c')](_0x2f834b['model'],_0x2f834b[_0x898d('0x3a')]);_0x41a746['attributes']=_[_0x898d('0x3c')](_0x2f834b[_0x898d('0x3d')],qs[_0x898d('0x3e')](_0x43ee93[_0x898d('0x3a')][_0x898d('0x3e')]));_0x41a746[_0x898d('0x3f')]=_0x41a746['attributes'][_0x898d('0x51')]?_0x41a746[_0x898d('0x3f')]:_0x2f834b[_0x898d('0x3d')];if(_0x43ee93[_0x898d('0x3a')][_0x898d('0x4a')]){_0x41a746[_0x898d('0x4b')]=[{'all':!![]}];}_0x41a746=_[_0x898d('0x47')]({},_0x41a746,_0x43ee93[_0x898d('0x49')]);return db[_0x898d('0x34')]['find'](_0x41a746)['then'](handleEntityNotFound(_0x4634f7,null))['then'](respondWithResult(_0x4634f7,null))[_0x898d('0x4e')](handleError(_0x4634f7,null));};exports[_0x898d('0x52')]=function(_0x1d0905,_0x3badbe,_0x5ec4d6){return db[_0x898d('0x34')]['find']({'where':{'id':_0x1d0905[_0x898d('0x50')]['id']},'attributes':['name',_0x898d('0x7')],'raw':!![]})[_0x898d('0x2d')](handleEntityNotFound(_0x3badbe,null))['then'](function(_0x2f3514){if(_0x2f3514){var _0x44cbea=path[_0x898d('0x53')](config['root'],_0x898d('0x54'),util[_0x898d('0x55')](_0x898d('0x56'),path[_0x898d('0x57')](_0x2f3514['path'])));var _0x48679e=fs[_0x898d('0x58')](_0x44cbea);var _0x1858e5=archiver(_0x898d('0x59'),{'zlib':{'level':0x9}});_0x1858e5['on'](_0x898d('0x5a'),function(_0x497c85){if(_0x497c85[_0x898d('0x5b')]==='ENOENT'){logger['error'](_0x497c85);}else{throw new db[(_0x898d('0x5c'))][(_0x898d('0x5d'))](_0x898d('0x5e'));}});_0x1858e5['on']('error',function(_0x582387){throw new db['Sequelize'][(_0x898d('0x5d'))](_0x898d('0x5e'));});_0x1858e5[_0x898d('0x5f')](_0x48679e);_0x1858e5[_0x898d('0x60')](_0x898d('0x61'),{'cwd':path['join'](config[_0x898d('0x62')],_0x898d('0x54'),path[_0x898d('0x63')](_0x2f3514[_0x898d('0x7')])),'ignore':[path[_0x898d('0x53')](path[_0x898d('0x57')](_0x2f3514[_0x898d('0x7')]),_0x898d('0x64')),path['join'](path[_0x898d('0x57')](_0x2f3514['path']),_0x898d('0x65'))],'nodir':!![]})['finalize']();_0x48679e['on'](_0x898d('0x66'),function(){if(!fs[_0x898d('0x67')](_0x44cbea)){throw new db[(_0x898d('0x5c'))][(_0x898d('0x5d'))](_0x898d('0x68'));}return _0x3badbe[_0x898d('0x52')](_0x44cbea,util[_0x898d('0x55')](_0x898d('0x56'),path[_0x898d('0x57')](_0x2f3514[_0x898d('0x7')])),function(_0x4d7c14){if(_0x4d7c14){throw new db[(_0x898d('0x5c'))][(_0x898d('0x5d'))](_0x898d('0x69'));}fs[_0x898d('0x6a')](_0x44cbea);logger['info']('Download\x20completed');logger[_0x898d('0x6b')](_0x898d('0x6c'));});});}return null;})[_0x898d('0x4e')](handleError(_0x3badbe,null));};exports['upload']=function(_0x207bf8,_0x5741ae,_0x58c6cb){var _0x231b24=path['basename'](_0x207bf8[_0x898d('0x6d')]['filename'],path['extname'](_0x207bf8['file'][_0x898d('0x6e')]));var _0x3f45d6=path['join'](config[_0x898d('0x62')],_0x898d('0x54'),_0x207bf8[_0x898d('0x6d')][_0x898d('0x6e')]);var _0xf054d0=path[_0x898d('0x53')](config['root'],_0x898d('0x54'),_0x231b24);logger[_0x898d('0x6b')]('Plugin\x20upload\x20filepath:\x20%s',_0x3f45d6);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0xf054d0);try{fs[_0x898d('0x6f')](_0x3f45d6,parseInt(_0x898d('0x70'),0x8));extract(_0x3f45d6,{'dir':_0xf054d0},function(_0x3d4b93){if(_0x3d4b93){logger['error'](_0x3d4b93);handleError(_0x3d4b93,!![]);};var _0x15b803=fs[_0x898d('0x71')](_0xf054d0);if(_0x15b803[_0x898d('0x51')]>0x1){removeReferences(_0x3f45d6,_0xf054d0);logger[_0x898d('0x72')](_0x898d('0x73'));return _0x58c6cb(new Error('Invalid\x20plugin\x20structure'));}var _0x25b19c=fs[_0x898d('0x74')](path['join'](_0xf054d0,_0x15b803[0x0]));if(_0x25b19c[_0x898d('0x75')]()){removeReferences(_0x3f45d6,_0xf054d0);logger[_0x898d('0x72')](_0x898d('0x73'));return _0x58c6cb(new Error(_0x898d('0x73')));}if(_0x25b19c[_0x898d('0x76')]()){var _0x5cfd65=fs['readdirSync'](path[_0x898d('0x53')](_0xf054d0,_0x15b803[0x0]));if(_0x5cfd65[_0x898d('0x51')]===0x0){removeReferences(_0x3f45d6,_0xf054d0);logger[_0x898d('0x72')](_0x898d('0x73'));return _0x58c6cb(new Error('Invalid\x20plugin\x20structure'));}var _0x3fc14b=_0x5cfd65['some'](function(_0x19d7a6){return _0x19d7a6===_0x898d('0x77');});if(!_0x3fc14b){return _0x58c6cb(new Error('Plugin\x20manifest\x20missing'));}var _0x2db22c=fs['readFileSync'](path[_0x898d('0x53')](_0xf054d0,_0x15b803[0x0],_0x898d('0x77')));var _0x3fc2ab=JSON[_0x898d('0x78')](_0x2db22c);if(_0x898d('0x25')==typeof _0x3fc2ab['name']){return _0x58c6cb(new Error(_0x898d('0x79')));}if(_0x898d('0x25')==typeof _0x3fc2ab[_0x898d('0x37')]){return _0x58c6cb(new Error(_0x898d('0x7a')));}if(_0x898d('0x25')==typeof _0x3fc2ab['version']){return _0x58c6cb(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x898d('0x25')==typeof _0x3fc2ab['parameters']){return _0x58c6cb(new Error(_0x898d('0x7b')));}if(_0x3fc2ab[_0x898d('0x37')]==='html'){if(_0x898d('0x25')==typeof _0x3fc2ab['parameters']['views']){return _0x58c6cb(new Error(_0x898d('0x7c')));}if('undefined'==typeof _0x3fc2ab[_0x898d('0x7d')][_0x898d('0x7e')][_0x898d('0x7f')]&&_0x898d('0x25')==typeof _0x3fc2ab['parameters']['views']['agent']){return _0x58c6cb(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x3fc2ab[_0x898d('0x37')]===_0x898d('0x80')){if('undefined'==typeof _0x3fc2ab['parameters']['scriptName']){return _0x58c6cb(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x898d('0x25')==typeof _0x3fc2ab['parameters']['scriptPath']){return _0x58c6cb(new Error(_0x898d('0x81')));}}else{return _0x58c6cb(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x552f48=_0x3fc2ab['name'];var _0x603c47=_0x3fc2ab[_0x898d('0x82')];var _0xa652fb=_0x3fc2ab[_0x898d('0x37')];var _0xe969ad=_0x3fc2ab[_0x898d('0x83')]?_0x3fc2ab[_0x898d('0x83')]:_0x898d('0x84');var _0x28f535=_0x3fc2ab['icon']?_0x3fc2ab[_0x898d('0x85')]:'icon-apps';var _0x3c4f8d='';var _0x25d0ab='';var _0x323566='';var _0xd8bd46='';var _0x4228a3=_0x3fc2ab['version'];if(_0xa652fb==='html'){if(_0x898d('0x25')!=typeof _0x3fc2ab[_0x898d('0x7d')][_0x898d('0x7e')][_0x898d('0x7f')]){var _0x1e6513=_0x3fc2ab[_0x898d('0x7d')][_0x898d('0x7e')][_0x898d('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x898d('0x86')](_0x1e6513)){_0x3c4f8d=path[_0x898d('0x53')](_0x898d('0x87'),_0x231b24,_0x15b803[0x0],_0x1e6513);}else{_0x3c4f8d=_0x1e6513;}}else{logger['info'](_0x898d('0x88'));}if('undefined'!=typeof _0x3fc2ab['parameters']['views'][_0x898d('0x89')]){var _0xfa807b=_0x3fc2ab['parameters'][_0x898d('0x7e')][_0x898d('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x898d('0x86')](_0xfa807b)){_0x25d0ab=path[_0x898d('0x53')]('plugins',_0x231b24,_0x15b803[0x0],_0xfa807b);}else{_0x25d0ab=_0xfa807b;}}else{logger[_0x898d('0x6b')](_0x898d('0x8a'));}}else if(_0xa652fb===_0x898d('0x80')){_0x323566=_0x3fc2ab[_0x898d('0x7d')][_0x898d('0x8b')];_0xd8bd46=_0x3fc2ab[_0x898d('0x7d')][_0x898d('0x8c')];if(_0x898d('0x25')!=typeof _0x3fc2ab[_0x898d('0x7d')]['views']){if(_0x898d('0x25')!=typeof _0x3fc2ab[_0x898d('0x7d')]['views']['admin']){var _0x1e6513=_0x3fc2ab['parameters'][_0x898d('0x7e')][_0x898d('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x898d('0x86')](_0x1e6513)){_0x3c4f8d=path[_0x898d('0x53')](_0x898d('0x87'),_0x231b24,_0x15b803[0x0],_0x1e6513);}else{_0x3c4f8d=_0x1e6513;}}if(_0x898d('0x25')!=typeof _0x3fc2ab['parameters'][_0x898d('0x7e')]['agent']){var _0xfa807b=_0x3fc2ab[_0x898d('0x7d')][_0x898d('0x7e')][_0x898d('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x898d('0x86')](_0xfa807b)){_0x25d0ab=path[_0x898d('0x53')](_0x898d('0x87'),_0x231b24,_0x15b803[0x0],_0xfa807b);}else{_0x25d0ab=_0xfa807b;}}}}var _0x901ee8={'name':_0x552f48,'description':_0x603c47,'path':path[_0x898d('0x53')](_0x231b24,_0x15b803[0x0]),'type':_0xa652fb,'sidebar':_0xe969ad,'icon':_0x28f535,'adminUrl':_0x3c4f8d,'agentUrl':_0x25d0ab,'scriptName':_0x323566,'scriptPath':_0xd8bd46,'version':_0x4228a3};removeReferences(_0x3f45d6,null);return db[_0x898d('0x34')][_0x898d('0x8d')](_0x901ee8)['then'](function(_0x8c5d60){var _0xdc42bd={'role':_0x207bf8[_0x898d('0x8e')][_0x898d('0x8f')],'userProfileId':_0x207bf8[_0x898d('0x8e')][_0x898d('0x90')]};if(!_0xdc42bd)throw new Error(_0x898d('0x91'));if(_0xdc42bd[_0x898d('0x8f')]===_0x898d('0x92')){var _0x272fcb=_0x8c5d60['get']({'plain':!![]});return db[_0x898d('0x93')]['find']({'where':{'name':_0x898d('0x2f'),'userProfileId':_0xdc42bd[_0x898d('0x90')]},'raw':!![]})[_0x898d('0x2d')](function(_0x5eda97){if(_0x5eda97&&_0x5eda97[_0x898d('0x94')]===0x0){return db[_0x898d('0x30')]['create']({'name':_0x272fcb[_0x898d('0x32')],'resourceId':_0x272fcb['id'],'type':_0x5eda97[_0x898d('0x32')],'sectionId':_0x5eda97['id']},{})[_0x898d('0x2d')](function(){return _0x8c5d60;});}else{return _0x8c5d60;}})[_0x898d('0x4e')](function(_0xd17946){logger[_0x898d('0x72')](_0x898d('0x95'),_0xd17946);throw _0xd17946;});}return _0x8c5d60;})[_0x898d('0x2d')](respondWithResult(_0x5741ae,null))[_0x898d('0x4e')](handleError(_0x5741ae,null));}});}catch(_0xd0e3f0){_0x5741ae[_0x898d('0x22')](0x1f4)[_0x898d('0x33')](_0xd0e3f0);}};function removeReferences(_0x54f698,_0x5d70dd){try{if(_0x54f698){fs[_0x898d('0x6a')](_0x54f698);logger[_0x898d('0x6b')]('Zip\x20archive\x20removed');}if(_0x5d70dd){rimraf(_0x5d70dd,function(){});logger[_0x898d('0x6b')](_0x898d('0x96'));}}catch(_0x3a3cf7){logger[_0x898d('0x72')](_0x3a3cf7);}}exports[_0x898d('0x2c')]=function(_0x46813d,_0x29e07a,_0x2b7998){return db[_0x898d('0x34')][_0x898d('0x97')]({'where':{'id':_0x46813d['params']['id']}})[_0x898d('0x2d')](handleEntityNotFound(_0x29e07a,null))[_0x898d('0x2d')](saveUpdates(_0x46813d[_0x898d('0x8e')],null))[_0x898d('0x2d')](respondWithResult(_0x29e07a,null))[_0x898d('0x4e')](handleError(_0x29e07a,null));};exports[_0x898d('0x98')]=function(_0x58fd21,_0x1e488b,_0xb4d6d4){return db[_0x898d('0x34')][_0x898d('0x97')]({'where':{'id':_0x58fd21[_0x898d('0x50')]['id']}})[_0x898d('0x2d')](function(_0x2d75ca){if(_0x2d75ca){return _0x2d75ca[_0x898d('0x2e')]();}})['then'](function(_0x300421){rimraf(path['join'](config[_0x898d('0x62')],_0x898d('0x54'),path['dirname'](_0x300421['path'])),function(){});return _0x300421;})[_0x898d('0x2d')](handleEntityNotFound(_0x1e488b,null))[_0x898d('0x2d')](respondWithStatusCode(_0x1e488b,null))[_0x898d('0x4e')](handleError(_0x1e488b,null));};exports['webhookGet']=function(_0xeabbe5,_0x214256,_0x19b6fb){return BPromise['resolve']()[_0x898d('0x2d')](function(){if(!_0xeabbe5[_0x898d('0x3a')][_0x898d('0x7')]){throw new Error(_0x898d('0x99'));}if(!_0xeabbe5[_0x898d('0x3a')]['port']){throw new Error(_0x898d('0x9a'));}var _0xe10947=_0xeabbe5[_0x898d('0x3a')]['hostname']?_0xeabbe5['query']['hostname']+':'+_0xeabbe5[_0x898d('0x3a')][_0x898d('0x9b')]:_0x898d('0x9c')+_0xeabbe5[_0x898d('0x3a')][_0x898d('0x9b')];var _0x3ffebf=_0xeabbe5[_0x898d('0x3a')][_0x898d('0x23')]?_0xeabbe5[_0x898d('0x3a')][_0x898d('0x23')]:!![];var _0x44b39f=_0xeabbe5[_0x898d('0x3a')][_0x898d('0x9d')]?_0xeabbe5['query'][_0x898d('0x9d')]:null;var _0x509130={'method':_0xeabbe5[_0x898d('0x9e')],'uri':util['format']('%s%s',_0xe10947,_0xeabbe5[_0x898d('0x3a')][_0x898d('0x7')]),'json':_0x3ffebf,'resolveWithFullResponse':!![],'encoding':_0x44b39f,'qs':_0xeabbe5['query']};if(_0xeabbe5[_0x898d('0x9f')]){_0x509130[_0x898d('0x9f')]=_0xeabbe5[_0x898d('0x9f')];if(_0x509130['headers'][_0x898d('0xa0')]){delete _0x509130[_0x898d('0x9f')][_0x898d('0xa0')];}}if(_0x509130['headers']['content-type']){delete _0x509130['headers'][_0x898d('0xa1')];}return rp(_0x509130);})['then'](function(_0x214457){if(_0x214457){_0x214256[_0x898d('0xa2')](_0x214457[_0x898d('0x9f')]);logger[_0x898d('0x6b')](_0x214457[_0x898d('0x8e')]);if(_[_0x898d('0xa3')](_0xeabbe5[_0x898d('0x3a')][_0x898d('0x7')],_0x898d('0x52'))&&_0x214457[_0x898d('0xa4')]==0x1f4){return _0x214256[_0x898d('0x31')](_0x214457[_0x898d('0xa4')]);}else{return _0x214256[_0x898d('0x22')](_0x214457[_0x898d('0xa4')])[_0x898d('0x33')](_0x214457[_0x898d('0x8e')]);}}else{return _0x214256['sendStatus'](0xc8);}})[_0x898d('0x4e')](handleError(_0x214256,null));};exports[_0x898d('0xa5')]=function(_0x14d5e6,_0x17b478,_0x5dbf67){return BPromise[_0x898d('0xa6')]()[_0x898d('0x2d')](function(){if(!_0x14d5e6[_0x898d('0x3a')][_0x898d('0x7')]){throw new Error(_0x898d('0x99'));}if(!_0x14d5e6[_0x898d('0x3a')][_0x898d('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2ff95b=_0x14d5e6[_0x898d('0x3a')][_0x898d('0xa7')]?_0x14d5e6['query'][_0x898d('0xa7')]+':'+_0x14d5e6[_0x898d('0x3a')]['port']:_0x898d('0x9c')+_0x14d5e6['query'][_0x898d('0x9b')];var _0x304eb6=_0x14d5e6[_0x898d('0x3a')]['json']?_0x14d5e6[_0x898d('0x3a')][_0x898d('0x23')]:!![];var _0x3ffb85=_0x14d5e6['query'][_0x898d('0x9d')]?_0x14d5e6['query'][_0x898d('0x9d')]:null;var _0x103b84={'method':_0x14d5e6[_0x898d('0x9e')],'uri':util['format'](_0x898d('0xa8'),_0x2ff95b,_0x14d5e6[_0x898d('0x3a')][_0x898d('0x7')]),'json':_0x304eb6,'resolveWithFullResponse':!![],'encoding':_0x3ffb85,'body':_0x14d5e6[_0x898d('0x8e')]};if(_0x14d5e6['headers']){_0x103b84[_0x898d('0x9f')]=_0x14d5e6[_0x898d('0x9f')];if(_0x103b84[_0x898d('0x9f')][_0x898d('0xa0')]){delete _0x103b84[_0x898d('0x9f')][_0x898d('0xa0')];}}if(_0x103b84[_0x898d('0x9f')][_0x898d('0xa1')]){delete _0x103b84[_0x898d('0x9f')][_0x898d('0xa1')];}return rp(_0x103b84);})[_0x898d('0x2d')](function(_0x479b51){if(_0x479b51){_0x17b478['set'](_0x479b51[_0x898d('0x9f')]);logger[_0x898d('0x6b')](_0x479b51[_0x898d('0x8e')]);return _0x17b478[_0x898d('0x22')](_0x479b51[_0x898d('0xa4')])[_0x898d('0x33')](_0x479b51['body']);}else{return _0x17b478[_0x898d('0x31')](0xc8);}})['catch'](handleError(_0x17b478,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 2d3d43d..3336519 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 _0x77e6=['../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x2c5d18,_0x2ad80e){var _0x3fe914=function(_0x17f67d){while(--_0x17f67d){_0x2c5d18['push'](_0x2c5d18['shift']());}};_0x3fe914(++_0x2ad80e);}(_0x77e6,0x1a6));var _0x677e=function(_0x288930,_0x20dbf4){_0x288930=_0x288930-0x0;var _0x3407a9=_0x77e6[_0x288930];return _0x3407a9;};'use strict';var EventEmitter=require(_0x677e('0x0'));var Plugin=require(_0x677e('0x1'))['db'][_0x677e('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x677e('0x3')](0x0);var events={'afterCreate':_0x677e('0x4'),'afterUpdate':_0x677e('0x5'),'afterDestroy':_0x677e('0x6')};function emitEvent(_0x186923){return function(_0x50231c,_0x2f0307,_0x2560a6){PluginEvents['emit'](_0x186923+':'+_0x50231c['id'],_0x50231c);PluginEvents[_0x677e('0x7')](_0x186923,_0x50231c);_0x2560a6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x677e('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x524e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','Plugin'];(function(_0x1955fa,_0x407016){var _0x23a5e4=function(_0x33b00d){while(--_0x33b00d){_0x1955fa['push'](_0x1955fa['shift']());}};_0x23a5e4(++_0x407016);}(_0x524e,0x15e));var _0xe524=function(_0x15f63e,_0x148e2e){_0x15f63e=_0x15f63e-0x0;var _0x3a6bf0=_0x524e[_0x15f63e];return _0x3a6bf0;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0xe524('0x0')];var PluginEvents=new EventEmitter();PluginEvents[_0xe524('0x1')](0x0);var events={'afterCreate':_0xe524('0x2'),'afterUpdate':_0xe524('0x3'),'afterDestroy':_0xe524('0x4')};function emitEvent(_0x379eb1){return function(_0xabd694,_0x32c90b,_0x10d37a){PluginEvents[_0xe524('0x5')](_0x379eb1+':'+_0xabd694['id'],_0xabd694);PluginEvents['emit'](_0x379eb1,_0xabd694);_0x10d37a(null);};}for(var e in events){if(events[_0xe524('0x6')](e)){var event=events[e];Plugin[_0xe524('0x7')](e,emitEvent(event));}}module[_0xe524('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 0bde42e..821b6dd 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 _0x9c5a=['define','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x2c6274,_0x3df7d8){var _0x4b2c24=function(_0x3a235c){while(--_0x3a235c){_0x2c6274['push'](_0x2c6274['shift']());}};_0x4b2c24(++_0x3df7d8);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x5eb388,_0x39738f){_0x5eb388=_0x5eb388-0x0;var _0x309b60=_0x9c5a[_0x5eb388];return _0x309b60;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./plugin.attributes');module[_0xa9c5('0x8')]=function(_0x4d9c7a,_0x394d84){return _0x4d9c7a[_0xa9c5('0x9')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81bd=['../../config/environment','./plugin.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x56b31d,_0x58b0f5){var _0x674191=function(_0x97944b){while(--_0x97944b){_0x56b31d['push'](_0x56b31d['shift']());}};_0x674191(++_0x58b0f5);}(_0x81bd,0x7c));var _0xd81b=function(_0x9ab282,_0x224526){_0x9ab282=_0x9ab282-0x0;var _0x3ae406=_0x81bd[_0x9ab282];return _0x3ae406;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var attributes=require(_0xd81b('0x9'));module['exports']=function(_0x42a0aa,_0x34eb73){return _0x42a0aa[_0xd81b('0xa')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 9e60fc2..7c5e229 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 _0xe488=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreatePlugin','Plugin','create','body','options','then','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe488,0x93));var _0x8e48=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe488[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x8e48('0x0'));var util=require(_0x8e48('0x1'));var moment=require('moment');var BPromise=require(_0x8e48('0x2'));var rs=require(_0x8e48('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e48('0x4'))['db'];var utils=require(_0x8e48('0x5'));var logger=require('../../config/logger')(_0x8e48('0x6'));var config=require(_0x8e48('0x7'));var jayson=require(_0x8e48('0x8'));var client=jayson[_0x8e48('0x9')][_0x8e48('0xa')]({'port':0x232a});config[_0x8e48('0xb')]=_[_0x8e48('0xc')](config['redis'],{'host':_0x8e48('0xd'),'port':0x18eb});var socket=require(_0x8e48('0xe'))(new Redis(config[_0x8e48('0xb')]));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x48137e,_0x42b0e3,_0x9a505b){return new BPromise(function(_0xcaa980,_0x4606b6){return client[_0x8e48('0xf')](_0x48137e,_0x9a505b)['then'](function(_0x3e1384){logger[_0x8e48('0x10')](_0x8e48('0x11'),_0x42b0e3,_0x8e48('0x12'));logger['debug'](_0x8e48('0x13'),_0x42b0e3,_0x8e48('0x12'),JSON['stringify'](_0x3e1384));if(_0x3e1384[_0x8e48('0x14')]){if(_0x3e1384[_0x8e48('0x14')]['code']===0x1f4){logger[_0x8e48('0x14')](_0x8e48('0x11'),_0x42b0e3,_0x3e1384[_0x8e48('0x14')][_0x8e48('0x15')]);return _0x4606b6(_0x3e1384[_0x8e48('0x14')][_0x8e48('0x15')]);}logger[_0x8e48('0x14')](_0x8e48('0x11'),_0x42b0e3,_0x3e1384[_0x8e48('0x14')][_0x8e48('0x15')]);return _0xcaa980(_0x3e1384[_0x8e48('0x14')][_0x8e48('0x15')]);}else{logger[_0x8e48('0x10')](_0x8e48('0x11'),_0x42b0e3,_0x8e48('0x12'));_0xcaa980(_0x3e1384[_0x8e48('0x16')][_0x8e48('0x15')]);}})[_0x8e48('0x17')](function(_0x3d0bbf){logger[_0x8e48('0x14')](_0x8e48('0x11'),_0x42b0e3,_0x3d0bbf);_0x4606b6(_0x3d0bbf);});});}exports[_0x8e48('0x18')]=function(_0xcf86d8){var _0x2fa7da=this;return new Promise(function(_0x4372c0,_0x5502f0){return db[_0x8e48('0x19')][_0x8e48('0x1a')](_0xcf86d8[_0x8e48('0x1b')],{'raw':_0xcf86d8[_0x8e48('0x1c')]?_0xcf86d8[_0x8e48('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x8e48('0x1d')](function(_0x212247){logger[_0x8e48('0x10')](_0x8e48('0x18'),_0xcf86d8);logger['debug'](_0x8e48('0x18'),_0xcf86d8,JSON[_0x8e48('0x1e')](_0x212247));_0x4372c0(_0x212247);})['catch'](function(_0x13aba1){logger[_0x8e48('0x14')]('CreatePlugin',_0x13aba1[_0x8e48('0x15')],_0xcf86d8);_0x5502f0(_0x2fa7da['error'](0x1f4,_0x13aba1[_0x8e48('0x15')]));});});}; \ No newline at end of file +var _0x805b=['body','raw','then','debug','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','info','Plugin,\x20%s,\x20%s','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreatePlugin','Plugin','create'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x805b,0x13b));var _0xb805=function(_0x218f12,_0xbf0194){_0x218f12=_0x218f12-0x0;var _0x3f5dd0=_0x805b[_0x218f12];return _0x3f5dd0;};'use strict';var _=require(_0xb805('0x0'));var util=require('util');var moment=require(_0xb805('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb805('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb805('0x3'));var logger=require(_0xb805('0x4'))(_0xb805('0x5'));var config=require(_0xb805('0x6'));var jayson=require(_0xb805('0x7'));var client=jayson[_0xb805('0x8')][_0xb805('0x9')]({'port':0x232a});config[_0xb805('0xa')]=_[_0xb805('0xb')](config['redis'],{'host':_0xb805('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0xb805('0xd')](socket);function respondWithRpcPromise(_0x55ca0e,_0x36932e,_0x24a042){return new BPromise(function(_0x329dee,_0x3fa655){return client[_0xb805('0xe')](_0x55ca0e,_0x24a042)['then'](function(_0x567a39){logger[_0xb805('0xf')](_0xb805('0x10'),_0x36932e,'request\x20sent');logger['debug'](_0xb805('0x11'),_0x36932e,_0xb805('0x12'),JSON[_0xb805('0x13')](_0x567a39));if(_0x567a39['error']){if(_0x567a39['error']['code']===0x1f4){logger[_0xb805('0x14')]('Plugin,\x20%s,\x20%s',_0x36932e,_0x567a39[_0xb805('0x14')][_0xb805('0x15')]);return _0x3fa655(_0x567a39['error'][_0xb805('0x15')]);}logger['error'](_0xb805('0x10'),_0x36932e,_0x567a39[_0xb805('0x14')][_0xb805('0x15')]);return _0x329dee(_0x567a39[_0xb805('0x14')][_0xb805('0x15')]);}else{logger[_0xb805('0xf')](_0xb805('0x10'),_0x36932e,_0xb805('0x12'));_0x329dee(_0x567a39[_0xb805('0x16')][_0xb805('0x15')]);}})['catch'](function(_0x3a990f){logger[_0xb805('0x14')](_0xb805('0x10'),_0x36932e,_0x3a990f);_0x3fa655(_0x3a990f);});});}exports[_0xb805('0x17')]=function(_0x10b690){var _0x5f3600=this;return new Promise(function(_0x105594,_0x43a9e0){return db[_0xb805('0x18')][_0xb805('0x19')](_0x10b690[_0xb805('0x1a')],{'raw':_0x10b690['options']?_0x10b690['options'][_0xb805('0x1b')]===undefined?!![]:![]:!![]})[_0xb805('0x1c')](function(_0x475a73){logger[_0xb805('0xf')](_0xb805('0x17'),_0x10b690);logger[_0xb805('0x1d')](_0xb805('0x17'),_0x10b690,JSON[_0xb805('0x13')](_0x475a73));_0x105594(_0x475a73);})[_0xb805('0x1e')](function(_0x46b34d){logger[_0xb805('0x14')](_0xb805('0x17'),_0x46b34d[_0xb805('0x15')],_0x10b690);_0x43a9e0(_0x5f3600[_0xb805('0x14')](0x1f4,_0x46b34d[_0xb805('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 0e41681..b2b21c3 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 _0x531a=['update','emit','register','length','./plugin.events','save','remove'];(function(_0x309afc,_0x440814){var _0x3081ef=function(_0x4b6033){while(--_0x4b6033){_0x309afc['push'](_0x309afc['shift']());}};_0x3081ef(++_0x440814);}(_0x531a,0x100));var _0xa531=function(_0x4caea4,_0x4f02e4){_0x4caea4=_0x4caea4-0x0;var _0x207c7c=_0x531a[_0x4caea4];return _0x207c7c;};'use strict';var PluginEvents=require(_0xa531('0x0'));var events=[_0xa531('0x1'),_0xa531('0x2'),_0xa531('0x3')];function createListener(_0x2a5348,_0x3ccd8f){return function(_0x3e8e4b){_0x3ccd8f[_0xa531('0x4')](_0x2a5348,_0x3e8e4b);};}function removeListener(_0x28af07,_0x27609d){return function(){PluginEvents['removeListener'](_0x28af07,_0x27609d);};}exports[_0xa531('0x5')]=function(_0x4ec419){for(var _0x266b43=0x0,_0x4446b9=events[_0xa531('0x6')];_0x266b43<_0x4446b9;_0x266b43++){var _0x286dc7=events[_0x266b43];var _0x3b68a7=createListener('plugin:'+_0x286dc7,_0x4ec419);PluginEvents['on'](_0x286dc7,_0x3b68a7);}}; \ No newline at end of file +var _0xe54c=['register','./plugin.events','save','remove','update','emit'];(function(_0x10443f,_0x26da3a){var _0x48efad=function(_0x13f3b1){while(--_0x13f3b1){_0x10443f['push'](_0x10443f['shift']());}};_0x48efad(++_0x26da3a);}(_0xe54c,0x79));var _0xce54=function(_0x20006a,_0x30e3a9){_0x20006a=_0x20006a-0x0;var _0x5e26ac=_0xe54c[_0x20006a];return _0x5e26ac;};'use strict';var PluginEvents=require(_0xce54('0x0'));var events=[_0xce54('0x1'),_0xce54('0x2'),_0xce54('0x3')];function createListener(_0x1aa88f,_0xbed9ae){return function(_0x259aa2){_0xbed9ae[_0xce54('0x4')](_0x1aa88f,_0x259aa2);};}function removeListener(_0x55213c,_0x4472f5){return function(){PluginEvents['removeListener'](_0x55213c,_0x4472f5);};}exports[_0xce54('0x5')]=function(_0x2f47e9){for(var _0x48e7bb=0x0,_0x50941=events['length'];_0x48e7bb<_0x50941;_0x48e7bb++){var _0x2b192d=events[_0x48e7bb];var _0x2d9821=createListener('plugin:'+_0x2b192d,_0x2f47e9);PluginEvents['on'](_0x2b192d,_0x2d9821);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index eb5a35c..e2ae728 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 _0x0cee=['update','destroy','exports','express','Router','./pm2.controller','get','isAuthenticated','/:id','show','put'];(function(_0x4d1b29,_0x14b6f5){var _0x5f3431=function(_0xd785cc){while(--_0xd785cc){_0x4d1b29['push'](_0x4d1b29['shift']());}};_0x5f3431(++_0x14b6f5);}(_0x0cee,0x163));var _0xe0ce=function(_0x3b149c,_0x23c09b){_0x3b149c=_0x3b149c-0x0;var _0x514965=_0x0cee[_0x3b149c];return _0x514965;};'use strict';var express=require(_0xe0ce('0x0'));var router=express[_0xe0ce('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xe0ce('0x2'));router[_0xe0ce('0x3')]('/',auth[_0xe0ce('0x4')](),controller['index']);router[_0xe0ce('0x3')](_0xe0ce('0x5'),auth[_0xe0ce('0x4')](),controller[_0xe0ce('0x6')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe0ce('0x7')](_0xe0ce('0x5'),auth['isAuthenticated'](),controller[_0xe0ce('0x8')]);router['delete'](_0xe0ce('0x5'),auth[_0xe0ce('0x4')](),controller[_0xe0ce('0x9')]);module[_0xe0ce('0xa')]=router; \ No newline at end of file +var _0xb2c9=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','express','Router','../../components/auth/service','./pm2.controller','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb2c9,0x145));var _0x9b2c=function(_0x3f4f3b,_0x2d7be2){_0x3f4f3b=_0x3f4f3b-0x0;var _0xfc6f02=_0xb2c9[_0x3f4f3b];return _0xfc6f02;};'use strict';var express=require(_0x9b2c('0x0'));var router=express[_0x9b2c('0x1')]();var auth=require(_0x9b2c('0x2'));var controller=require(_0x9b2c('0x3'));router[_0x9b2c('0x4')]('/',auth[_0x9b2c('0x5')](),controller[_0x9b2c('0x6')]);router[_0x9b2c('0x4')](_0x9b2c('0x7'),auth[_0x9b2c('0x5')](),controller[_0x9b2c('0x8')]);router[_0x9b2c('0x9')]('/',auth[_0x9b2c('0x5')](),controller[_0x9b2c('0xa')]);router[_0x9b2c('0xb')](_0x9b2c('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x9b2c('0xc')](_0x9b2c('0x7'),auth[_0x9b2c('0x5')](),controller[_0x9b2c('0xd')]);module[_0x9b2c('0xe')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index ce796dc..8556882 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 _0x8a40=['stack','name','send','npm\x20install','info','list','then','reject','express','length','params','catch','create','body','join','script','cwd','chdir','dirname','dump','restart','stop','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','status','json','error'];(function(_0x1aa503,_0x2a9e5f){var _0x14cc25=function(_0x223ccf){while(--_0x223ccf){_0x1aa503['push'](_0x1aa503['shift']());}};_0x14cc25(++_0x2a9e5f);}(_0x8a40,0x1b1));var _0x08a4=function(_0x120ee1,_0x4db58e){_0x120ee1=_0x120ee1-0x0;var _0x38f462=_0x8a40[_0x120ee1];return _0x38f462;};'use strict';var _=require(_0x08a4('0x0'));var pm2=require(_0x08a4('0x1'));var logger=require(_0x08a4('0x2'))(_0x08a4('0x3'));var path=require(_0x08a4('0x4'));var exec=require(_0x08a4('0x5'))[_0x08a4('0x6')];var BPromise=require(_0x08a4('0x7'));function handleEntityNotFound(_0x56d342,_0x549202){return function(_0x417503){if(!_0x417503){_0x56d342['sendStatus'](0x194);;}return _0x417503;};}function respondWithResult(_0x206ea6,_0x17c773){_0x17c773=_0x17c773||0xc8;return function(_0x34443f){if(_0x34443f){return _0x206ea6[_0x08a4('0x8')](_0x17c773)[_0x08a4('0x9')](_0x34443f);}return null;};}function handleError(_0x397589,_0x20595b){_0x20595b=_0x20595b||0x1f4;return function(_0x3e0303){logger[_0x08a4('0xa')](_0x3e0303[_0x08a4('0xb')]);if(_0x3e0303[_0x08a4('0xc')]){delete _0x3e0303[_0x08a4('0xc')];}_0x397589[_0x08a4('0x8')](_0x20595b)[_0x08a4('0xd')](_0x3e0303);};}function execChildProcess(){return new BPromise(function(_0x377b08,_0x204070){exec(_0x08a4('0xe'),function(_0x1d153d,_0x121686,_0x76110e){logger[_0x08a4('0xf')](_0x121686);logger['info'](_0x76110e);if(_0x1d153d){logger[_0x08a4('0xa')](_0x1d153d);return _0x204070(_0x1d153d);}return _0x377b08(_0x121686);});});}exports['index']=function(_0x48d5db,_0x2dfd0e){return pm2[_0x08a4('0x10')]()[_0x08a4('0x11')](function(_0x31b414){if(_0x31b414){var _0xefbc5e=_[_0x08a4('0x12')](_0x31b414,function(_0x57da72){return _0x57da72['name']===_0x08a4('0x13')||_0x57da72['name']==='motion2';});return{'rows':_0xefbc5e,'count':_0xefbc5e[_0x08a4('0x14')]};}return null;})[_0x08a4('0x11')](respondWithResult(_0x2dfd0e,null))['catch'](handleError(_0x2dfd0e,null));};exports['show']=function(_0x232cf6,_0x128141){return pm2['describe'](_0x232cf6[_0x08a4('0x15')]['id'])[_0x08a4('0x11')](respondWithResult(_0x128141,null))[_0x08a4('0x11')](handleEntityNotFound(_0x128141,null))[_0x08a4('0x16')](handleError(_0x128141,null));};exports[_0x08a4('0x17')]=function(_0x567f1e,_0x1ca1f7){if(_0x567f1e[_0x08a4('0x18')][_0x08a4('0xc')]&&_0x567f1e[_0x08a4('0x18')]['script']){var _0x258837=path[_0x08a4('0x19')](__dirname,'../../files/plugins',_0x567f1e[_0x08a4('0x18')][_0x08a4('0x1a')]);var _0xc756c8=process[_0x08a4('0x1b')]();process[_0x08a4('0x1c')](path[_0x08a4('0x1d')](_0x258837));return execChildProcess()[_0x08a4('0x11')](function(_0x1da345){process[_0x08a4('0x1c')](_0xc756c8);return pm2['start']({'name':_0x567f1e['body'][_0x08a4('0xc')],'script':_0x258837});})[_0x08a4('0x11')](function(_0x536d46){pm2[_0x08a4('0x1e')]();return _0x536d46[0x0];})[_0x08a4('0x11')](respondWithResult(_0x1ca1f7,0xc9))[_0x08a4('0x16')](handleError(_0x1ca1f7,null));}else{return _0x1ca1f7[_0x08a4('0x8')](0x1f4)[_0x08a4('0xd')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x1a9d14,_0x5adf81){if(_0x1a9d14[_0x08a4('0x18')]['id']){delete _0x1a9d14[_0x08a4('0x18')]['id'];}var _0x543500={'online':_0x08a4('0x1f'),'stopped':_0x08a4('0x20')};if(_0x543500['hasOwnProperty'](_0x1a9d14['body']['status'])){return pm2[_0x543500[_0x1a9d14[_0x08a4('0x18')][_0x08a4('0x8')]]](_0x1a9d14['params']['id'])[_0x08a4('0x11')](respondWithResult(_0x5adf81,0xc8))[_0x08a4('0x16')](handleError(_0x5adf81,null));}else{return _0x5adf81[_0x08a4('0x8')](0x1f4)[_0x08a4('0xd')]({'message':_0x08a4('0x21')});}};exports[_0x08a4('0x22')]=function(_0x4900b0,_0x55bd45){if(_0x4900b0['body']['id']){delete _0x4900b0['body']['id'];}if(_0x4900b0[_0x08a4('0x15')]['id']){return pm2[_0x08a4('0x23')](_0x4900b0[_0x08a4('0x15')]['id'])['then'](function(_0x50ce04){pm2['dump']();return _0x50ce04[0x0];})['then'](respondWithResult(_0x55bd45,null))['catch'](handleError(_0x55bd45,null));}else{return _0x55bd45[_0x08a4('0x8')](0x1f4)[_0x08a4('0xd')]({'message':_0x08a4('0x24')});}}; \ No newline at end of file +var _0x4a2f=['send','npm\x20install','info','index','list','then','reject','express','motion2','catch','show','describe','params','body','script','cwd','chdir','dirname','update','restart','stop','hasOwnProperty','Unknown\x20status','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','bluebird','status','json','error','name'];(function(_0x4906da,_0x1cac45){var _0x4c2510=function(_0x1c3bc9){while(--_0x1c3bc9){_0x4906da['push'](_0x4906da['shift']());}};_0x4c2510(++_0x1cac45);}(_0x4a2f,0x182));var _0xf4a2=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4a2f[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xf4a2('0x0'));var pm2=require(_0xf4a2('0x1'));var logger=require(_0xf4a2('0x2'))('api');var path=require(_0xf4a2('0x3'));var exec=require(_0xf4a2('0x4'))['exec'];var BPromise=require(_0xf4a2('0x5'));function handleEntityNotFound(_0x560713,_0x577454){return function(_0x10595b){if(!_0x10595b){_0x560713['sendStatus'](0x194);;}return _0x10595b;};}function respondWithResult(_0x17f5aa,_0x4b3373){_0x4b3373=_0x4b3373||0xc8;return function(_0x1736a3){if(_0x1736a3){return _0x17f5aa[_0xf4a2('0x6')](_0x4b3373)[_0xf4a2('0x7')](_0x1736a3);}return null;};}function handleError(_0x255f77,_0x6ed9b9){_0x6ed9b9=_0x6ed9b9||0x1f4;return function(_0x14f160){logger[_0xf4a2('0x8')](_0x14f160['stack']);if(_0x14f160[_0xf4a2('0x9')]){delete _0x14f160[_0xf4a2('0x9')];}_0x255f77[_0xf4a2('0x6')](_0x6ed9b9)[_0xf4a2('0xa')](_0x14f160);};}function execChildProcess(){return new BPromise(function(_0x2fa9ef,_0x53016d){exec(_0xf4a2('0xb'),function(_0x1295b3,_0x147271,_0x381a7f){logger[_0xf4a2('0xc')](_0x147271);logger[_0xf4a2('0xc')](_0x381a7f);if(_0x1295b3){logger['error'](_0x1295b3);return _0x53016d(_0x1295b3);}return _0x2fa9ef(_0x147271);});});}exports[_0xf4a2('0xd')]=function(_0x3c84b0,_0x16f15e){return pm2[_0xf4a2('0xe')]()[_0xf4a2('0xf')](function(_0x59b6cf){if(_0x59b6cf){var _0x52bba9=_[_0xf4a2('0x10')](_0x59b6cf,function(_0x2d639f){return _0x2d639f['name']===_0xf4a2('0x11')||_0x2d639f['name']===_0xf4a2('0x12');});return{'rows':_0x52bba9,'count':_0x52bba9['length']};}return null;})[_0xf4a2('0xf')](respondWithResult(_0x16f15e,null))[_0xf4a2('0x13')](handleError(_0x16f15e,null));};exports[_0xf4a2('0x14')]=function(_0x3efe51,_0xdf012){return pm2[_0xf4a2('0x15')](_0x3efe51[_0xf4a2('0x16')]['id'])[_0xf4a2('0xf')](respondWithResult(_0xdf012,null))[_0xf4a2('0xf')](handleEntityNotFound(_0xdf012,null))[_0xf4a2('0x13')](handleError(_0xdf012,null));};exports['create']=function(_0x358ec3,_0x3f951e){if(_0x358ec3[_0xf4a2('0x17')][_0xf4a2('0x9')]&&_0x358ec3['body'][_0xf4a2('0x18')]){var _0x5e42fa=path['join'](__dirname,'../../files/plugins',_0x358ec3['body'][_0xf4a2('0x18')]);var _0x2ece81=process[_0xf4a2('0x19')]();process[_0xf4a2('0x1a')](path[_0xf4a2('0x1b')](_0x5e42fa));return execChildProcess()[_0xf4a2('0xf')](function(_0x521746){process['chdir'](_0x2ece81);return pm2['start']({'name':_0x358ec3['body']['name'],'script':_0x5e42fa});})[_0xf4a2('0xf')](function(_0x3303af){pm2['dump']();return _0x3303af[0x0];})['then'](respondWithResult(_0x3f951e,0xc9))[_0xf4a2('0x13')](handleError(_0x3f951e,null));}else{return _0x3f951e[_0xf4a2('0x6')](0x1f4)[_0xf4a2('0xa')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xf4a2('0x1c')]=function(_0x42933b,_0x38fbf7){if(_0x42933b[_0xf4a2('0x17')]['id']){delete _0x42933b[_0xf4a2('0x17')]['id'];}var _0x193b54={'online':_0xf4a2('0x1d'),'stopped':_0xf4a2('0x1e')};if(_0x193b54[_0xf4a2('0x1f')](_0x42933b['body'][_0xf4a2('0x6')])){return pm2[_0x193b54[_0x42933b['body'][_0xf4a2('0x6')]]](_0x42933b[_0xf4a2('0x16')]['id'])[_0xf4a2('0xf')](respondWithResult(_0x38fbf7,0xc8))[_0xf4a2('0x13')](handleError(_0x38fbf7,null));}else{return _0x38fbf7['status'](0x1f4)[_0xf4a2('0xa')]({'message':_0xf4a2('0x20')});}};exports['destroy']=function(_0x4a3220,_0x2fcf03){if(_0x4a3220[_0xf4a2('0x17')]['id']){delete _0x4a3220[_0xf4a2('0x17')]['id'];}if(_0x4a3220[_0xf4a2('0x16')]['id']){return pm2[_0xf4a2('0x21')](_0x4a3220[_0xf4a2('0x16')]['id'])[_0xf4a2('0xf')](function(_0x4c0511){pm2[_0xf4a2('0x22')]();return _0x4c0511[0x0];})['then'](respondWithResult(_0x2fcf03,null))['catch'](handleError(_0x2fcf03,null));}else{return _0x2fcf03['status'](0x1f4)[_0xf4a2('0xa')]({'message':_0xf4a2('0x23')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 5425846..3f3b551 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 _0xa5dd=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0xa5dd,0x101));var _0xda5d=function(_0x1bbd44,_0x28cdb0){_0x1bbd44=_0x1bbd44-0x0;var _0x464a9f=_0xa5dd[_0x1bbd44];return _0x464a9f;};'use strict';var multer=require(_0xda5d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xda5d('0x1'));var express=require(_0xda5d('0x2'));var router=express[_0xda5d('0x3')]();var fs_extra=require(_0xda5d('0x4'));var auth=require(_0xda5d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xda5d('0x6'));module[_0xda5d('0x7')]=router; \ No newline at end of file +var _0xd547=['connect-timeout','express','Router','../../components/interaction/service','exports','path'];(function(_0x1256d1,_0xb3daf7){var _0x5c81b7=function(_0x1b4f16){while(--_0x1b4f16){_0x1256d1['push'](_0x1256d1['shift']());}};_0x5c81b7(++_0xb3daf7);}(_0xd547,0x1c1));var _0x7d54=function(_0x3e86d8,_0xaf6e5c){_0x3e86d8=_0x3e86d8-0x0;var _0x52daf1=_0xd547[_0x3e86d8];return _0x52daf1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7d54('0x0'));var timeout=require(_0x7d54('0x1'));var express=require(_0x7d54('0x2'));var router=express[_0x7d54('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7d54('0x4'));var config=require('../../config/environment');module[_0x7d54('0x5')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 98e058e..66eceb7 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 _0x222b=['STRING','sequelize','exports','DATE'];(function(_0x555169,_0x154642){var _0x10c19e=function(_0x2174e3){while(--_0x2174e3){_0x555169['push'](_0x555169['shift']());}};_0x10c19e(++_0x154642);}(_0x222b,0x1c9));var _0xb222=function(_0x26a810,_0x247776){_0x26a810=_0x26a810-0x0;var _0x4758a3=_0x222b[_0x26a810];return _0x4758a3;};'use strict';var Sequelize=require(_0xb222('0x0'));module[_0xb222('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xb222('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xb222('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xb222('0x3')]},'campaigntype':{'type':Sequelize[_0xb222('0x3')]},'membername':{'type':Sequelize[_0xb222('0x3')]}}; \ No newline at end of file +var _0x81a5=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x6609a7,_0x57c7f5){var _0x4e96c9=function(_0x9d5f8a){while(--_0x9d5f8a){_0x6609a7['push'](_0x6609a7['shift']());}};_0x4e96c9(++_0x57c7f5);}(_0x81a5,0x84));var _0x581a=function(_0xd14e18,_0x57a24a){_0xd14e18=_0xd14e18-0x0;var _0x346c62=_0x81a5[_0xd14e18];return _0x346c62;};'use strict';var Sequelize=require(_0x581a('0x0'));module[_0x581a('0x1')]={'state':{'type':Sequelize[_0x581a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x581a('0x3')]},'scheduledat':{'type':Sequelize[_0x581a('0x4')]},'uniqueid':{'type':Sequelize[_0x581a('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x581a('0x4')]},'ringtime':{'type':Sequelize[_0x581a('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x581a('0x3')]},'campaigntype':{'type':Sequelize[_0x581a('0x3')]},'membername':{'type':Sequelize[_0x581a('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 0b02ac8..55eb26f 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 _0x3faa=['path','../../config/environment','./reportAgentPreview.attributes','define','lodash','util','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3faa,0x8b));var _0xa3fa=function(_0xd1fba4,_0xace9f8){_0xd1fba4=_0xd1fba4-0x0;var _0x51a08f=_0x3faa[_0xd1fba4];return _0x51a08f;};'use strict';var _=require(_0xa3fa('0x0'));var util=require(_0xa3fa('0x1'));var logger=require('../../config/logger')(_0xa3fa('0x2'));var moment=require(_0xa3fa('0x3'));var BPromise=require(_0xa3fa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3fa('0x5'));var rimraf=require('rimraf');var config=require(_0xa3fa('0x6'));var attributes=require(_0xa3fa('0x7'));module['exports']=function(_0x1345f7,_0x302f74){return _0x1345f7[_0xa3fa('0x8')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0762=['./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x6a7aba,_0x224b7f){var _0x4d5644=function(_0x59bc54){while(--_0x59bc54){_0x6a7aba['push'](_0x6a7aba['shift']());}};_0x4d5644(++_0x224b7f);}(_0x0762,0x7a));var _0x2076=function(_0x1a1b9d,_0x570841){_0x1a1b9d=_0x1a1b9d-0x0;var _0x1bfb73=_0x0762[_0x1a1b9d];return _0x1bfb73;};'use strict';var _=require(_0x2076('0x0'));var util=require(_0x2076('0x1'));var logger=require(_0x2076('0x2'))(_0x2076('0x3'));var moment=require('moment');var BPromise=require(_0x2076('0x4'));var rp=require(_0x2076('0x5'));var fs=require('fs');var path=require(_0x2076('0x6'));var rimraf=require('rimraf');var config=require(_0x2076('0x7'));var attributes=require(_0x2076('0x8'));module[_0x2076('0x9')]=function(_0xf040fd,_0x5c7ae1){return _0xf040fd[_0x2076('0xa')](_0x2076('0xb'),attributes,{'tableName':_0x2076('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 4652201..6e6f163 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 _0x8712=['CreateReportAgentPreview','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','catch','ReportAgentPreview','body','options','raw'];(function(_0x42cf37,_0x594712){var _0x1cd995=function(_0x21716c){while(--_0x21716c){_0x42cf37['push'](_0x42cf37['shift']());}};_0x1cd995(++_0x594712);}(_0x8712,0x191));var _0x2871=function(_0x205d25,_0x6a807c){_0x205d25=_0x205d25-0x0;var _0x3ae7a3=_0x8712[_0x205d25];return _0x3ae7a3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2871('0x0'));var BPromise=require(_0x2871('0x1'));var rs=require(_0x2871('0x2'));var fs=require('fs');var Redis=require(_0x2871('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2871('0x4'));var logger=require(_0x2871('0x5'))(_0x2871('0x6'));var config=require(_0x2871('0x7'));var jayson=require(_0x2871('0x8'));var client=jayson['client'][_0x2871('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e8cd4,_0x4bcd6e,_0x3c4552){return new BPromise(function(_0x1999b7,_0x2bfafc){return client['request'](_0x5e8cd4,_0x3c4552)['then'](function(_0x18da55){logger[_0x2871('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x4bcd6e,_0x2871('0xb'));logger[_0x2871('0xc')](_0x2871('0xd'),_0x4bcd6e,_0x2871('0xb'),JSON[_0x2871('0xe')](_0x18da55));if(_0x18da55[_0x2871('0xf')]){if(_0x18da55[_0x2871('0xf')][_0x2871('0x10')]===0x1f4){logger['error'](_0x2871('0x11'),_0x4bcd6e,_0x18da55['error'][_0x2871('0x12')]);return _0x2bfafc(_0x18da55['error'][_0x2871('0x12')]);}logger[_0x2871('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x4bcd6e,_0x18da55[_0x2871('0xf')][_0x2871('0x12')]);return _0x1999b7(_0x18da55[_0x2871('0xf')][_0x2871('0x12')]);}else{logger['info'](_0x2871('0x11'),_0x4bcd6e,_0x2871('0xb'));_0x1999b7(_0x18da55['result'][_0x2871('0x12')]);}})[_0x2871('0x13')](function(_0x5f3298){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x4bcd6e,_0x5f3298);_0x2bfafc(_0x5f3298);});});}exports['CreateReportAgentPreview']=function(_0x469f01){var _0x1c266e=this;return new Promise(function(_0x3418e2,_0x326279){return db[_0x2871('0x14')]['create'](_0x469f01[_0x2871('0x15')],{'raw':_0x469f01[_0x2871('0x16')]?_0x469f01[_0x2871('0x16')][_0x2871('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0xfc63cd){logger[_0x2871('0xa')](_0x2871('0x18'),_0x469f01);logger[_0x2871('0xc')](_0x2871('0x18'),_0x469f01,JSON[_0x2871('0xe')](_0xfc63cd));_0x3418e2(_0xfc63cd);})[_0x2871('0x13')](function(_0x1f28bb){logger[_0x2871('0xf')](_0x2871('0x18'),_0x1f28bb[_0x2871('0x12')],_0x469f01);_0x326279(_0x1c266e[_0x2871('0xf')](0x1f4,_0x1f28bb['message']));});});}; \ No newline at end of file +var _0x86aa=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','debug','catch','util','bluebird','randomstring'];(function(_0x45baac,_0x19fda3){var _0x28102c=function(_0x57faab){while(--_0x57faab){_0x45baac['push'](_0x45baac['shift']());}};_0x28102c(++_0x19fda3);}(_0x86aa,0x1c8));var _0xa86a=function(_0x7f56a3,_0x2ac5d3){_0x7f56a3=_0x7f56a3-0x0;var _0x57afda=_0x86aa[_0x7f56a3];return _0x57afda;};'use strict';var _=require('lodash');var util=require(_0xa86a('0x0'));var moment=require('moment');var BPromise=require(_0xa86a('0x1'));var rs=require(_0xa86a('0x2'));var fs=require('fs');var Redis=require(_0xa86a('0x3'));var db=require(_0xa86a('0x4'))['db'];var utils=require(_0xa86a('0x5'));var logger=require(_0xa86a('0x6'))(_0xa86a('0x7'));var config=require('../../config/environment');var jayson=require(_0xa86a('0x8'));var client=jayson[_0xa86a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cbb16,_0x444d1e,_0x188f75){return new BPromise(function(_0x5a2d01,_0x4f1f76){return client['request'](_0x3cbb16,_0x188f75)[_0xa86a('0xa')](function(_0x1b5391){logger['info'](_0xa86a('0xb'),_0x444d1e,'request\x20sent');logger['debug'](_0xa86a('0xc'),_0x444d1e,_0xa86a('0xd'),JSON[_0xa86a('0xe')](_0x1b5391));if(_0x1b5391[_0xa86a('0xf')]){if(_0x1b5391['error'][_0xa86a('0x10')]===0x1f4){logger['error'](_0xa86a('0xb'),_0x444d1e,_0x1b5391[_0xa86a('0xf')][_0xa86a('0x11')]);return _0x4f1f76(_0x1b5391[_0xa86a('0xf')][_0xa86a('0x11')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x444d1e,_0x1b5391[_0xa86a('0xf')][_0xa86a('0x11')]);return _0x5a2d01(_0x1b5391['error'][_0xa86a('0x11')]);}else{logger[_0xa86a('0x12')](_0xa86a('0xb'),_0x444d1e,_0xa86a('0xd'));_0x5a2d01(_0x1b5391[_0xa86a('0x13')][_0xa86a('0x11')]);}})['catch'](function(_0x3491f3){logger[_0xa86a('0xf')](_0xa86a('0xb'),_0x444d1e,_0x3491f3);_0x4f1f76(_0x3491f3);});});}exports[_0xa86a('0x14')]=function(_0xcb9bd3){var _0x1619cc=this;return new Promise(function(_0x23f959,_0x5ab296){return db[_0xa86a('0x15')][_0xa86a('0x16')](_0xcb9bd3['body'],{'raw':_0xcb9bd3[_0xa86a('0x17')]?_0xcb9bd3['options'][_0xa86a('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4f1164){logger[_0xa86a('0x12')]('CreateReportAgentPreview',_0xcb9bd3);logger[_0xa86a('0x19')](_0xa86a('0x14'),_0xcb9bd3,JSON[_0xa86a('0xe')](_0x4f1164));_0x23f959(_0x4f1164);})[_0xa86a('0x1a')](function(_0x8ff4dd){logger[_0xa86a('0xf')]('CreateReportAgentPreview',_0x8ff4dd['message'],_0xcb9bd3);_0x5ab296(_0x1619cc[_0xa86a('0xf')](0x1f4,_0x8ff4dd[_0xa86a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 05bc16b..c4b55c1 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 _0x4861=['/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','path','../../components/auth/service','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/fax/queues/waitinginteractions','post','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues'];(function(_0x26dc96,_0x10c6f5){var _0x30b7be=function(_0x47de22){while(--_0x47de22){_0x26dc96['push'](_0x26dc96['shift']());}};_0x30b7be(++_0x10c6f5);}(_0x4861,0x102));var _0x1486=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x4861[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0x1486('0x0'));var util=require(_0x1486('0x1'));var path=require(_0x1486('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x1486('0x3'));var controller=require('./rpc.controller');router[_0x1486('0x4')]('/voice/channels',auth[_0x1486('0x5')](),controller[_0x1486('0x6')]);router[_0x1486('0x4')](_0x1486('0x7'),auth['isAuthenticated'](),controller[_0x1486('0x8')]);router[_0x1486('0x4')](_0x1486('0x9'),auth[_0x1486('0x5')](),controller[_0x1486('0xa')]);router['get'](_0x1486('0xb'),auth[_0x1486('0x5')](),controller[_0x1486('0xc')]);router[_0x1486('0x4')](_0x1486('0xd'),auth[_0x1486('0x5')](),controller['chatQueues']);router[_0x1486('0x4')](_0x1486('0xe'),auth[_0x1486('0x5')](),controller[_0x1486('0xf')]);router[_0x1486('0x4')](_0x1486('0x10'),auth[_0x1486('0x5')](),controller['mailAccounts']);router[_0x1486('0x4')](_0x1486('0x11'),auth[_0x1486('0x5')](),controller[_0x1486('0x12')]);router['get'](_0x1486('0x13'),auth['isAuthenticated'](),controller[_0x1486('0x14')]);router[_0x1486('0x4')](_0x1486('0x15'),auth[_0x1486('0x5')](),controller[_0x1486('0x16')]);router[_0x1486('0x4')](_0x1486('0x17'),auth[_0x1486('0x5')](),controller[_0x1486('0x18')]);router[_0x1486('0x4')]('/voice/queues/preview/:id',auth[_0x1486('0x5')](),controller[_0x1486('0x19')]);router['get']('/voice/queues/channels',auth[_0x1486('0x5')](),controller[_0x1486('0x1a')]);router[_0x1486('0x4')](_0x1486('0x1b'),auth[_0x1486('0x5')](),controller[_0x1486('0x1c')]);router[_0x1486('0x4')](_0x1486('0x1d'),auth[_0x1486('0x5')](),controller[_0x1486('0x1e')]);router[_0x1486('0x4')](_0x1486('0x1f'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router['get']('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x1486('0x20')]);router[_0x1486('0x21')](_0x1486('0x22'),auth[_0x1486('0x5')](),controller[_0x1486('0x23')]);router[_0x1486('0x4')](_0x1486('0x24'),auth[_0x1486('0x5')](),controller[_0x1486('0x25')]);router['get'](_0x1486('0x26'),auth[_0x1486('0x5')](),controller[_0x1486('0x27')]);router['get'](_0x1486('0x28'),auth[_0x1486('0x5')](),controller[_0x1486('0x29')]);router[_0x1486('0x21')](_0x1486('0x2a'),auth['isAuthenticated'](),controller[_0x1486('0x2b')]);router['get']('/telephones',auth['isAuthenticated'](),controller['telephones']);router['get'](_0x1486('0x2c'),auth[_0x1486('0x5')](),controller[_0x1486('0x2d')]);router[_0x1486('0x4')](_0x1486('0x2e'),auth['isAuthenticated'](),controller[_0x1486('0x2f')]);router[_0x1486('0x4')](_0x1486('0x30'),auth['isAuthenticated'](),controller[_0x1486('0x31')]);router[_0x1486('0x4')](_0x1486('0x32'),auth[_0x1486('0x5')](),controller[_0x1486('0x33')]);router[_0x1486('0x4')](_0x1486('0x34'),auth[_0x1486('0x5')](),controller[_0x1486('0x35')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0x1486('0x5')](),controller[_0x1486('0x36')]);router[_0x1486('0x4')](_0x1486('0x37'),auth[_0x1486('0x5')](),controller[_0x1486('0x38')]);router[_0x1486('0x4')](_0x1486('0x39'),auth[_0x1486('0x5')](),controller['smsQueuesWaitingInteractions']);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x1486('0x5')](),controller['whatsappQueuesWaitingInteractions']);router[_0x1486('0x4')](_0x1486('0x3a'),auth[_0x1486('0x5')](),controller['faxQueuesWaitingInteractions']);router[_0x1486('0x3b')]('/mail/queues/:id/notify',auth[_0x1486('0x5')](),controller[_0x1486('0x3c')](_0x1486('0x3d')));router[_0x1486('0x4')](_0x1486('0x3e'),auth[_0x1486('0x5')](),controller['showMailQueues']);router[_0x1486('0x3b')](_0x1486('0x3f'),auth[_0x1486('0x5')](),controller[_0x1486('0x3c')](_0x1486('0x40')));router[_0x1486('0x4')](_0x1486('0x41'),auth[_0x1486('0x5')](),controller[_0x1486('0x42')]);router['post']('/fax/queues/:id/notify',auth[_0x1486('0x5')](),controller[_0x1486('0x3c')](_0x1486('0x43')));router[_0x1486('0x4')](_0x1486('0x44'),auth[_0x1486('0x5')](),controller[_0x1486('0x45')]);router['post'](_0x1486('0x46'),auth[_0x1486('0x5')](),controller[_0x1486('0x3c')](_0x1486('0x47')));router['get'](_0x1486('0x48'),auth[_0x1486('0x5')](),controller['showOpenchannelQueues']);router['post'](_0x1486('0x49'),auth[_0x1486('0x5')](),controller[_0x1486('0x3c')](_0x1486('0x4a')));router['post'](_0x1486('0x4b'),auth[_0x1486('0x5')](),controller[_0x1486('0x3c')](_0x1486('0x4c')));router[_0x1486('0x4')]('/sms/queues/:id',auth[_0x1486('0x5')](),controller[_0x1486('0x4d')]);router[_0x1486('0x4')](_0x1486('0x4e'),auth[_0x1486('0x5')](),controller[_0x1486('0x4f')]);router[_0x1486('0x3b')](_0x1486('0x50'),auth['isAuthenticated'](),controller[_0x1486('0x51')]);module['exports']=router; \ No newline at end of file +var _0x8822=['/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','showVoiceQueues','/voice/queues/:id','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','path','express','Router','../../components/auth/service','./rpc.controller','isAuthenticated','get','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','smsQueues','/fax/queues','faxQueues'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x8822,0x131));var _0x2882=function(_0x130d61,_0x3bd66c){_0x130d61=_0x130d61-0x0;var _0xd362f0=_0x8822[_0x130d61];return _0xd362f0;};'use strict';var multer=require(_0x2882('0x0'));var util=require('util');var path=require(_0x2882('0x1'));var express=require(_0x2882('0x2'));var router=express[_0x2882('0x3')]();var auth=require(_0x2882('0x4'));var controller=require(_0x2882('0x5'));router['get']('/voice/channels',auth[_0x2882('0x6')](),controller['voiceChannels']);router[_0x2882('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x2882('0x6')](),controller[_0x2882('0x8')]);router[_0x2882('0x7')](_0x2882('0x9'),auth[_0x2882('0x6')](),controller[_0x2882('0xa')]);router['get'](_0x2882('0xb'),auth[_0x2882('0x6')](),controller[_0x2882('0xc')]);router[_0x2882('0x7')](_0x2882('0xd'),auth[_0x2882('0x6')](),controller[_0x2882('0xe')]);router[_0x2882('0x7')](_0x2882('0xf'),auth[_0x2882('0x6')](),controller[_0x2882('0x10')]);router[_0x2882('0x7')](_0x2882('0x11'),auth[_0x2882('0x6')](),controller[_0x2882('0x12')]);router[_0x2882('0x7')]('/openchannel/queues',auth['isAuthenticated'](),controller[_0x2882('0x13')]);router[_0x2882('0x7')]('/sms/queues',auth[_0x2882('0x6')](),controller[_0x2882('0x14')]);router[_0x2882('0x7')]('/whatsapp/queues',auth[_0x2882('0x6')](),controller['whatsappQueues']);router[_0x2882('0x7')](_0x2882('0x15'),auth[_0x2882('0x6')](),controller[_0x2882('0x16')]);router[_0x2882('0x7')](_0x2882('0x17'),auth[_0x2882('0x6')](),controller[_0x2882('0x18')]);router['get'](_0x2882('0x19'),auth[_0x2882('0x6')](),controller[_0x2882('0x1a')]);router[_0x2882('0x7')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x2882('0x1b')]);router[_0x2882('0x7')](_0x2882('0x1c'),auth['isAuthenticated'](),controller[_0x2882('0x1d')]);router[_0x2882('0x7')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x2882('0x6')](),controller[_0x2882('0x1e')]);router[_0x2882('0x7')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x2882('0x1f')]);router['put'](_0x2882('0x20'),auth['isAuthenticated'](),controller[_0x2882('0x21')]);router['get'](_0x2882('0x22'),auth[_0x2882('0x6')](),controller['outbound']);router[_0x2882('0x7')](_0x2882('0x23'),auth[_0x2882('0x6')](),controller[_0x2882('0x24')]);router['get'](_0x2882('0x25'),auth['isAuthenticated'](),controller[_0x2882('0x26')]);router[_0x2882('0x27')](_0x2882('0x28'),auth[_0x2882('0x6')](),controller['agentCapacity']);router[_0x2882('0x7')](_0x2882('0x29'),auth['isAuthenticated'](),controller[_0x2882('0x2a')]);router[_0x2882('0x7')](_0x2882('0x2b'),auth[_0x2882('0x6')](),controller[_0x2882('0x2c')]);router[_0x2882('0x7')](_0x2882('0x2d'),auth[_0x2882('0x6')](),controller[_0x2882('0x2e')]);router[_0x2882('0x7')](_0x2882('0x2f'),auth['isAuthenticated'](),controller[_0x2882('0x30')]);router['get']('/chat/queues/waitinginteractions',auth[_0x2882('0x6')](),controller['chatQueuesWaitingInteractions']);router[_0x2882('0x7')]('/mail/queues/waitinginteractions',auth[_0x2882('0x6')](),controller[_0x2882('0x31')]);router[_0x2882('0x7')](_0x2882('0x32'),auth[_0x2882('0x6')](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0x2882('0x33'),auth[_0x2882('0x6')](),controller[_0x2882('0x34')]);router[_0x2882('0x7')](_0x2882('0x35'),auth[_0x2882('0x6')](),controller[_0x2882('0x36')]);router[_0x2882('0x7')](_0x2882('0x37'),auth[_0x2882('0x6')](),controller[_0x2882('0x38')]);router['get'](_0x2882('0x39'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x2882('0x3a')](_0x2882('0x3b'),auth[_0x2882('0x6')](),controller[_0x2882('0x3c')]('mail'));router[_0x2882('0x7')](_0x2882('0x3d'),auth[_0x2882('0x6')](),controller[_0x2882('0x3e')]);router[_0x2882('0x3a')](_0x2882('0x3f'),auth[_0x2882('0x6')](),controller[_0x2882('0x3c')](_0x2882('0x40')));router[_0x2882('0x7')]('/chat/queues/:id',auth['isAuthenticated'](),controller[_0x2882('0x41')]);router[_0x2882('0x3a')](_0x2882('0x42'),auth['isAuthenticated'](),controller[_0x2882('0x3c')]('fax'));router['get'](_0x2882('0x43'),auth[_0x2882('0x6')](),controller[_0x2882('0x44')]);router[_0x2882('0x3a')](_0x2882('0x45'),auth[_0x2882('0x6')](),controller['queueNotify'](_0x2882('0x46')));router[_0x2882('0x7')](_0x2882('0x47'),auth[_0x2882('0x6')](),controller[_0x2882('0x48')]);router[_0x2882('0x3a')](_0x2882('0x49'),auth[_0x2882('0x6')](),controller['queueNotify'](_0x2882('0x4a')));router[_0x2882('0x3a')]('/whatsapp/queues/:id/notify',auth[_0x2882('0x6')](),controller[_0x2882('0x3c')]('whatsapp'));router['get'](_0x2882('0x4b'),auth['isAuthenticated'](),controller[_0x2882('0x4c')]);router[_0x2882('0x7')](_0x2882('0x4d'),auth[_0x2882('0x6')](),controller[_0x2882('0x4e')]);router[_0x2882('0x3a')](_0x2882('0x4f'),auth['isAuthenticated'](),controller[_0x2882('0x50')]);module[_0x2882('0x51')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 0188812..97291d1 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 _0xb348=['http','request','error','code','message','catch','json','sendStatus','stack','name','status','send','isNil','rows','find','query','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','Agents','interaction','user','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','INTERACTION','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showSmsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','type','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','update','queue','MessageId','InteractionId','From','QueueId','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','Website','User','Agent\x20not\x20found','TransferReport','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','jayson/promise','client'];(function(_0x606fe8,_0x10b084){var _0x28b517=function(_0x5e90f4){while(--_0x5e90f4){_0x606fe8['push'](_0x606fe8['shift']());}};_0x28b517(++_0x10b084);}(_0xb348,0x1d1));var _0x8b34=function(_0xc03b4a,_0x5d0e5d){_0xc03b4a=_0xc03b4a-0x0;var _0x5b1379=_0xb348[_0xc03b4a];return _0x5b1379;};'use strict';var BPromise=require(_0x8b34('0x0'));var moment=require(_0x8b34('0x1'));var _=require(_0x8b34('0x2'));var util=require(_0x8b34('0x3'));var db=require(_0x8b34('0x4'))['db'];var logger=require('../../config/logger')('api');var jayson=require(_0x8b34('0x5'));var amiClient=jayson[_0x8b34('0x6')][_0x8b34('0x7')]({'port':0x232a});var mailClient=jayson[_0x8b34('0x6')][_0x8b34('0x7')]({'port':0x232b});var routingClient=jayson[_0x8b34('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x140116,_0x3a3127,_0xcb1ff5){return new BPromise(function(_0x59a649,_0x41a129){var _0x59ca9f=_0xcb1ff5?_0xcb1ff5:amiClient;return _0x59ca9f[_0x8b34('0x8')](_0x140116,_0x3a3127)['then'](function(_0x5d13e5){if(_0x5d13e5[_0x8b34('0x9')]){if(_0x5d13e5['error'][_0x8b34('0xa')]===0x1f4){return _0x41a129(_0x5d13e5[_0x8b34('0x9')][_0x8b34('0xb')]);}return _0x59a649(_0x5d13e5['error']['message']);}else{_0x59a649(_0x5d13e5['result']);}})[_0x8b34('0xc')](function(_0x13e141){_0x41a129(_0x13e141);});});}function respondWithResult(_0x5ecd08,_0x28f459){_0x28f459=_0x28f459||0xc8;return function(_0x4a5f0c){if(_0x4a5f0c){return _0x5ecd08['status'](_0x28f459)[_0x8b34('0xd')](_0x4a5f0c);}return _0x5ecd08[_0x8b34('0xe')](0x194);};}function handleError(_0x499d6d,_0x4f3405){_0x4f3405=_0x4f3405||0x1f4;return function(_0x11599c){logger['error'](_0x11599c[_0x8b34('0xf')]);if(_0x11599c['name']){delete _0x11599c[_0x8b34('0x10')];}_0x499d6d[_0x8b34('0x11')](_0x4f3405)[_0x8b34('0x12')](_0x11599c);};}function findById(_0x5679a4){return function(_0x50988f){if(!_[_0x8b34('0x13')](_0x5679a4)&&!_['isNil'](_0x50988f)&&!_[_0x8b34('0x13')](_0x50988f[_0x8b34('0x14')])){return _[_0x8b34('0x15')](_0x50988f['rows'],function(_0x641c36){return _0x641c36['id']==_0x5679a4;});}return null;};}exports['voiceChannels']=function(_0x5d6333,_0x14045e){return respondWithRpcPromise('VoiceChannels',_0x5d6333[_0x8b34('0x16')])[_0x8b34('0x17')](respondWithResult(_0x14045e,null))[_0x8b34('0xc')](handleError(_0x14045e,null));};exports[_0x8b34('0x18')]=function(_0x428074,_0x2dbd8b){return respondWithRpcPromise(_0x8b34('0x19'),_['merge'](_0x428074[_0x8b34('0x16')],_0x428074[_0x8b34('0x1a')]))[_0x8b34('0x17')](respondWithResult(_0x2dbd8b,null))[_0x8b34('0xc')](handleError(_0x2dbd8b,null));};exports[_0x8b34('0x1b')]=function(_0x550961,_0xd56b33){return respondWithRpcPromise(_0x8b34('0x1c'),_[_0x8b34('0x1d')](_0x550961[_0x8b34('0x16')],_0x550961['params']))[_0x8b34('0x17')](respondWithResult(_0xd56b33,null))[_0x8b34('0xc')](handleError(_0xd56b33,null));};exports[_0x8b34('0x1e')]=function(_0xc19d87,_0x1fe75d){return respondWithRpcPromise('VoiceQueues',_0xc19d87[_0x8b34('0x16')])['then'](respondWithResult(_0x1fe75d,null))['catch'](handleError(_0x1fe75d,null));};exports['showVoiceQueues']=function(_0x397226,_0x2af39d){return respondWithRpcPromise(_0x8b34('0x1f'),_0x397226[_0x8b34('0x16')])[_0x8b34('0x17')](findById(_0x397226[_0x8b34('0x1a')]['id']))[_0x8b34('0x17')](respondWithResult(_0x2af39d,null))['catch'](handleError(_0x2af39d,null));};exports[_0x8b34('0x20')]=function(_0x247c0d,_0x13733e){return respondWithRpcPromise(_0x8b34('0x21'),_[_0x8b34('0x1d')](_0x247c0d[_0x8b34('0x22')],_0x247c0d['params']))[_0x8b34('0x17')](respondWithResult(_0x13733e,null))[_0x8b34('0xc')](handleError(_0x13733e,null));};exports[_0x8b34('0x23')]=function(_0x41c17d,_0x15739a){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x8b34('0x1d')](_0x41c17d[_0x8b34('0x16')],_0x41c17d['params']))[_0x8b34('0x17')](respondWithResult(_0x15739a,null))['catch'](handleError(_0x15739a,null));};exports[_0x8b34('0x24')]=function(_0x566539,_0x586b15){return respondWithRpcPromise('VoiceQueuesChannels',_0x566539['query'])[_0x8b34('0x17')](respondWithResult(_0x586b15,null))[_0x8b34('0xc')](handleError(_0x586b15,null));};exports[_0x8b34('0x25')]=function(_0x33b26f,_0x9eb88e){return respondWithRpcPromise(_0x8b34('0x26'),_[_0x8b34('0x1d')](_0x33b26f[_0x8b34('0x16')],_0x33b26f['params']))[_0x8b34('0x17')](respondWithResult(_0x9eb88e,null))[_0x8b34('0xc')](handleError(_0x9eb88e,null));};exports['voiceQueuesChannelHangup']=function(_0x175dcd,_0x1a46e2){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x175dcd[_0x8b34('0x16')],_0x175dcd[_0x8b34('0x1a')]))[_0x8b34('0x17')](respondWithResult(_0x1a46e2,null))[_0x8b34('0xc')](handleError(_0x1a46e2,null));};exports[_0x8b34('0x27')]=function(_0x5bc113,_0x63fd77){return respondWithRpcPromise(_0x8b34('0x28'),_[_0x8b34('0x1d')](_0x5bc113[_0x8b34('0x16')],_0x5bc113[_0x8b34('0x1a')]))[_0x8b34('0x17')](respondWithResult(_0x63fd77,null))[_0x8b34('0xc')](handleError(_0x63fd77,null));};exports[_0x8b34('0x29')]=function(_0x330ca5,_0xe50c29){return respondWithRpcPromise('Outbound',_0x330ca5[_0x8b34('0x16')])[_0x8b34('0x17')](respondWithResult(_0xe50c29,null))[_0x8b34('0xc')](handleError(_0xe50c29,null));};exports[_0x8b34('0x2a')]=function(_0x140042,_0x4faabe){return respondWithRpcPromise('OutboundChannels',_0x140042[_0x8b34('0x16')])[_0x8b34('0x17')](respondWithResult(_0x4faabe,null))[_0x8b34('0xc')](handleError(_0x4faabe,null));};exports['agents']=function(_0x1880f2,_0x1ff5c6){var _0x313ef1;return respondWithRpcPromise('Agents',_0x1880f2[_0x8b34('0x16')])[_0x8b34('0x17')](function(_0xa5eff7){_0x313ef1=_0xa5eff7;return respondWithRpcPromise(_0x8b34('0x2b'),_0x1880f2[_0x8b34('0x16')],routingClient);})['then'](function(_0x56d9e5){return _['merge']({},_0x56d9e5,_0x313ef1);})[_0x8b34('0x17')](respondWithResult(_0x1ff5c6,null))[_0x8b34('0xc')](handleError(_0x1ff5c6,null));};exports['agentCapacity']=function(_0x4ad5ec,_0x100727){if(_0x4ad5ec[_0x8b34('0x22')]&&_0x4ad5ec['body'][_0x8b34('0x2c')]&&_0x4ad5ec[_0x8b34('0x2d')]&&_0x4ad5ec['user']['name']){for(var _0x3a405c in _0x4ad5ec[_0x8b34('0x22')][_0x8b34('0x2c')]){if(_0x4ad5ec[_0x8b34('0x22')][_0x8b34('0x2c')]['hasOwnProperty'](_0x3a405c)){db['MemberReport'][_0x8b34('0x2e')]({'where':{'channel':_0x3a405c,'membername':_0x4ad5ec['user'][_0x8b34('0x10')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4ad5ec[_0x8b34('0x22')][_0x8b34('0x2c')][_0x3a405c]&&_0x4ad5ec[_0x8b34('0x22')][_0x8b34('0x2c')][_0x3a405c][_0x8b34('0x2f')]?{'$notIn':_0x4ad5ec[_0x8b34('0x22')]['interaction'][_0x3a405c]}:{'$ne':null}}})[_0x8b34('0x17')](function(_0x47899c){var _0xacde9=moment()[_0x8b34('0x30')](_0x8b34('0x31'));for(var _0x47a9eb=0x0,_0x41b8a5=_0x47899c[_0x8b34('0x2f')];_0x47a9eb<_0x41b8a5;_0x47a9eb+=0x1){_0x47899c[_0x47a9eb]['updateAttributes']({'exitAt':_0xacde9});}});for(var _0x5c0ad2=0x0;_0x5c0ad2<_0x4ad5ec[_0x8b34('0x22')]['interaction'][_0x3a405c][_0x8b34('0x2f')];_0x5c0ad2+=0x1){db['MemberReport'][_0x8b34('0x32')]({'where':{'channel':_0x3a405c,'membername':_0x4ad5ec[_0x8b34('0x2d')][_0x8b34('0x10')],'type':_0x8b34('0x33'),'uniqueid':_0x4ad5ec['body']['interaction'][_0x3a405c][_0x5c0ad2],'exitAt':null},'defaults':{'channel':_0x3a405c,'membername':_0x4ad5ec[_0x8b34('0x2d')][_0x8b34('0x10')],'interface':_[_0x8b34('0x13')](_0x4ad5ec['user']['interface'])?util[_0x8b34('0x30')]('SIP/%s',_0x4ad5ec[_0x8b34('0x2d')]['name']):_0x4ad5ec['user'][_0x8b34('0x34')],'type':_0x8b34('0x33'),'enterAt':moment()[_0x8b34('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x8b34('0x35'),'internal':_0x4ad5ec[_0x8b34('0x2d')][_0x8b34('0x36')],'uniqueid':_0x4ad5ec[_0x8b34('0x22')][_0x8b34('0x2c')][_0x3a405c][_0x5c0ad2]}});}}}}return respondWithRpcPromise(_0x8b34('0x37'),{'id':_0x4ad5ec[_0x8b34('0x1a')]['id'],'capacity':_0x4ad5ec[_0x8b34('0x22')][_0x8b34('0x38')]},routingClient)['then'](respondWithResult(_0x100727,null))[_0x8b34('0xc')](handleError(_0x100727,null));};exports[_0x8b34('0x39')]=function(_0x1d2a06,_0x4f619a){return respondWithRpcPromise(_0x8b34('0x3a'),_0x1d2a06[_0x8b34('0x16')])[_0x8b34('0x17')](respondWithResult(_0x4f619a,null))[_0x8b34('0xc')](handleError(_0x4f619a,null));};exports[_0x8b34('0x3b')]=function(_0x15d344,_0x1191bb){return respondWithRpcPromise('Trunks',_0x15d344[_0x8b34('0x16')])['then'](respondWithResult(_0x1191bb,null))[_0x8b34('0xc')](handleError(_0x1191bb,null));};exports[_0x8b34('0x3c')]=function(_0x54a137,_0x5993d0){return respondWithRpcPromise('Campaigns',_0x54a137[_0x8b34('0x16')])[_0x8b34('0x17')](respondWithResult(_0x5993d0,null))[_0x8b34('0xc')](handleError(_0x5993d0,null));};exports[_0x8b34('0x3d')]=function(_0x53c16d,_0x54f3dd){return respondWithRpcPromise(_0x8b34('0x3e'),_0x53c16d[_0x8b34('0x16')],routingClient)[_0x8b34('0x17')](respondWithResult(_0x54f3dd,null))['catch'](handleError(_0x54f3dd,null));};exports['showChatQueues']=function(_0xc6f509,_0x479959){return respondWithRpcPromise('ChatQueues',_0xc6f509[_0x8b34('0x16')],routingClient)[_0x8b34('0x17')](findById(_0xc6f509[_0x8b34('0x1a')]['id']))[_0x8b34('0x17')](respondWithResult(_0x479959,null))[_0x8b34('0xc')](handleError(_0x479959,null));};exports[_0x8b34('0x3f')]=function(_0x251f4a,_0x14c7ca){return respondWithRpcPromise(_0x8b34('0x40'),_0x251f4a['query'],routingClient)[_0x8b34('0x17')](respondWithResult(_0x14c7ca,null))[_0x8b34('0xc')](handleError(_0x14c7ca,null));};exports[_0x8b34('0x41')]=function(_0x5d15db,_0x24126a){return respondWithRpcPromise(_0x8b34('0x40'),_0x5d15db[_0x8b34('0x16')],routingClient)[_0x8b34('0x17')](findById(_0x5d15db[_0x8b34('0x1a')]['id']))[_0x8b34('0x17')](respondWithResult(_0x24126a,null))[_0x8b34('0xc')](handleError(_0x24126a,null));};exports[_0x8b34('0x42')]=function(_0x218343,_0x8fcf7a){return respondWithRpcPromise('MailAccounts',_0x218343[_0x8b34('0x16')],mailClient)[_0x8b34('0x17')](respondWithResult(_0x8fcf7a,null))['catch'](handleError(_0x8fcf7a,null));};exports['openchannelQueues']=function(_0xbe3335,_0x3de68f){return respondWithRpcPromise('OpenchannelQueues',_0xbe3335[_0x8b34('0x16')],routingClient)[_0x8b34('0x17')](respondWithResult(_0x3de68f,null))[_0x8b34('0xc')](handleError(_0x3de68f,null));};exports['showOpenchannelQueues']=function(_0x5c39e3,_0x8cb2b7){return respondWithRpcPromise(_0x8b34('0x43'),_0x5c39e3[_0x8b34('0x16')],routingClient)[_0x8b34('0x17')](findById(_0x5c39e3[_0x8b34('0x1a')]['id']))[_0x8b34('0x17')](respondWithResult(_0x8cb2b7,null))[_0x8b34('0xc')](handleError(_0x8cb2b7,null));};exports['smsQueues']=function(_0x246d89,_0x750136){return respondWithRpcPromise('SmsQueues',_0x246d89[_0x8b34('0x16')],routingClient)[_0x8b34('0x17')](respondWithResult(_0x750136,null))[_0x8b34('0xc')](handleError(_0x750136,null));};exports[_0x8b34('0x44')]=function(_0x3aaa60,_0x466e45){return respondWithRpcPromise(_0x8b34('0x45'),_0x3aaa60[_0x8b34('0x16')],routingClient)[_0x8b34('0x17')](findById(_0x3aaa60[_0x8b34('0x1a')]['id']))[_0x8b34('0x17')](respondWithResult(_0x466e45,null))[_0x8b34('0xc')](handleError(_0x466e45,null));};exports['whatsappQueues']=function(_0x5d8a05,_0x11f4a1){return respondWithRpcPromise(_0x8b34('0x46'),_0x5d8a05['query'],routingClient)[_0x8b34('0x17')](respondWithResult(_0x11f4a1,null))[_0x8b34('0xc')](handleError(_0x11f4a1,null));};exports[_0x8b34('0x47')]=function(_0xb89398,_0x706521){return respondWithRpcPromise(_0x8b34('0x46'),_0xb89398[_0x8b34('0x16')],routingClient)['then'](findById(_0xb89398[_0x8b34('0x1a')]['id']))[_0x8b34('0x17')](respondWithResult(_0x706521,null))['catch'](handleError(_0x706521,null));};exports[_0x8b34('0x48')]=function(_0x2a40fb,_0x33f744){return respondWithRpcPromise(_0x8b34('0x49'),_0x2a40fb[_0x8b34('0x16')],routingClient)['then'](respondWithResult(_0x33f744,null))[_0x8b34('0xc')](handleError(_0x33f744,null));};exports['showFaxQueues']=function(_0x50da99,_0xdb373c){return respondWithRpcPromise(_0x8b34('0x49'),_0x50da99['query'],routingClient)['then'](findById(_0x50da99[_0x8b34('0x1a')]['id']))[_0x8b34('0x17')](respondWithResult(_0xdb373c,null))['catch'](handleError(_0xdb373c,null));};exports['faxAccounts']=function(_0x13f5c6,_0x384b77){return respondWithRpcPromise(_0x8b34('0x4a'),_0x13f5c6[_0x8b34('0x16')])[_0x8b34('0x17')](respondWithResult(_0x384b77,null))[_0x8b34('0xc')](handleError(_0x384b77,null));};exports[_0x8b34('0x4b')]=function(_0x3030f1,_0x4cfc94){return respondWithRpcPromise(_0x8b34('0x4c'),_0x3030f1[_0x8b34('0x16')],routingClient)[_0x8b34('0x17')](respondWithResult(_0x4cfc94,null))[_0x8b34('0xc')](handleError(_0x4cfc94,null));};exports[_0x8b34('0x4d')]=function(_0x324a58,_0x34f961){return respondWithRpcPromise(_0x8b34('0x4e'),_0x324a58[_0x8b34('0x16')],routingClient)[_0x8b34('0x17')](respondWithResult(_0x34f961,null))[_0x8b34('0xc')](handleError(_0x34f961,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x287602,_0x16bf19){return respondWithRpcPromise(_0x8b34('0x4f'),_0x287602['query'],routingClient)[_0x8b34('0x17')](respondWithResult(_0x16bf19,null))[_0x8b34('0xc')](handleError(_0x16bf19,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4f2780,_0x38fa68){return respondWithRpcPromise(_0x8b34('0x4f'),_0x4f2780[_0x8b34('0x16')],routingClient)[_0x8b34('0x17')](function(_0x4c7b7a){if(_0x4f2780['query']['type']!==undefined){var _0x1e7de4=_(_0x4c7b7a[_0x8b34('0x14')])[_0x8b34('0x50')]([_0x4f2780['query'][_0x8b34('0x51')],_0x4f2780[_0x8b34('0x1a')]['id']])[_0x8b34('0x52')](_0x8b34('0x53'))[_0x8b34('0x54')]()[_0x8b34('0x55')]();return _0x4c7b7a['rows'][_0x8b34('0x50')](function(_0x1d5e83){return _0x1e7de4[_0x8b34('0x56')](_0x1d5e83[_0x8b34('0x53')])>-0x1;});}else{return _0x4c7b7a['rows'][_0x8b34('0x50')](function(_0x214347){return _0x214347[_0x8b34('0x53')]===parseInt(_0x4f2780[_0x8b34('0x1a')]['id']);});}})['then'](respondWithResult(_0x38fa68,null))[_0x8b34('0xc')](handleError(_0x38fa68,null));};exports[_0x8b34('0x57')]=function(_0x1669b2,_0x491e89){return respondWithRpcPromise(_0x8b34('0x58'),_0x1669b2[_0x8b34('0x16')],routingClient)[_0x8b34('0x17')](respondWithResult(_0x491e89,null))[_0x8b34('0xc')](handleError(_0x491e89,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3d7451,_0x208b82){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x3d7451[_0x8b34('0x16')],routingClient)['then'](respondWithResult(_0x208b82,null))[_0x8b34('0xc')](handleError(_0x208b82,null));};exports[_0x8b34('0x59')]=function(_0x5c1f74,_0x34885a){return respondWithRpcPromise(_0x8b34('0x5a'),_0x5c1f74[_0x8b34('0x16')],routingClient)[_0x8b34('0x17')](respondWithResult(_0x34885a,null))[_0x8b34('0xc')](handleError(_0x34885a,null));};exports[_0x8b34('0x5b')]=function(_0x73f189){return function(_0x14fbe0,_0x3b5781){var _0x3ac2f2,_0x1294b4;var _0x3f0622=_[_0x8b34('0x5c')](_0x73f189);var _0x3e24ae=_0x73f189==='chat'?'Website':'Account';return db[_0x3f0622+_0x8b34('0x5d')][_0x8b34('0x5e')]({'raw':!![],'where':{'id':_0x14fbe0[_0x8b34('0x1a')]['id']}})[_0x8b34('0x17')](function(_0x380597){if(_[_0x8b34('0x13')](_0x380597)){throw new Error(_0x3f0622+_0x8b34('0x5f'));}_0x3ac2f2=_0x380597;return db[_0x3f0622+_0x8b34('0x60')][_0x8b34('0x5e')]({'where':{'id':_0x14fbe0['body'][_0x8b34('0x61')]},'include':[{'model':db[_0x3f0622+_0x8b34('0x62')],'as':_0x8b34('0x62')},{'model':db[_0x3f0622+_0x3e24ae],'as':_0x8b34('0x63')}]});})['then'](function(_0x1e616b){if(_['isNil'](_0x1e616b)){throw new Error(_0x3f0622+'\x20Message\x20not\x20found');}_0x1294b4=_0x1e616b;return _0x1e616b[_0x8b34('0x64')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8b34('0x17')](function(){var _0xeb85d={'uniqueid':_0x73f189+'.'+_0x1294b4['id']+'.'+_0x1294b4[_0x8b34('0x62')]['id'],'FromUserId':_0x14fbe0[_0x8b34('0x2d')]['id'],'type':_0x8b34('0x65')};_0xeb85d[_0x3f0622+_0x8b34('0x66')]=_0x1294b4['id'];_0xeb85d[_0x3f0622+_0x8b34('0x67')]=_0x1294b4[_0x8b34('0x62')]['id'];_0xeb85d[_0x8b34('0x68')+_0x3f0622+_0x3e24ae+'Id']=_0x1294b4['Account']['id'];_0xeb85d['To'+_0x3f0622+_0x8b34('0x69')]=_0x3ac2f2['id'];return db[_0x3f0622+'TransferReport'][_0x8b34('0x6a')](_0xeb85d);})[_0x8b34('0x17')](function(){return respondWithRpcPromise('Start',{'channel':_0x73f189,'interaction':_0x1294b4[_0x8b34('0x62')],'message':_0x1294b4,'account':_0x1294b4[_0x8b34('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8b34('0x65'),'appdata':_0x3ac2f2['name']+','+(_0x1294b4['Account'][_0x8b34('0x6b')]||0x12c),'interval':_0x8b34('0x6c')}]},routingClient);})[_0x8b34('0x17')](respondWithResult(_0x3b5781,null))[_0x8b34('0xc')](handleError(_0x3b5781,null));};};exports[_0x8b34('0x6d')]=function(_0x2b8eb0,_0x2587ca){var _0x1a9da2,_0x34b2c4;if(_[_0x8b34('0x13')](_0x2b8eb0[_0x8b34('0x22')][_0x8b34('0x6e')])){throw new Error(_0x8b34('0x6f'));}var _0x4af150=_0x2b8eb0[_0x8b34('0x22')][_0x8b34('0x6e')];var _0x229a85=_[_0x8b34('0x5c')](_0x4af150);var _0x316597=_0x4af150===_0x8b34('0x70')?_0x8b34('0x71'):_0x8b34('0x63');return db[_0x8b34('0x72')]['findOne']({'raw':!![],'where':{'id':_0x2b8eb0['params']['id'],'role':'agent'}})[_0x8b34('0x17')](function(_0x15084b){if(_[_0x8b34('0x13')](_0x15084b)){throw new Error(_0x8b34('0x73'));}_0x1a9da2=_0x15084b;return db[_0x229a85+'Message']['findOne']({'where':{'id':_0x2b8eb0[_0x8b34('0x22')]['messageId']},'include':[{'model':db[_0x229a85+_0x8b34('0x62')],'as':_0x8b34('0x62')},{'model':db[_0x229a85+_0x316597],'as':'Account'}]});})[_0x8b34('0x17')](function(_0x1c9396){if(_['isNil'](_0x1c9396)){throw new Error(_0x229a85+'\x20Message\x20not\x20found');}_0x34b2c4=_0x1c9396;return _0x1c9396[_0x8b34('0x64')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x481048={'uniqueid':_0x4af150+'.'+_0x34b2c4['id']+'.'+_0x34b2c4['Interaction']['id'],'FromUserId':_0x2b8eb0['user']['id'],'type':_0x8b34('0x65'),'ToUserId':_0x1a9da2['id']};_0x481048[_0x229a85+_0x8b34('0x66')]=_0x34b2c4['id'];_0x481048[_0x229a85+_0x8b34('0x67')]=_0x34b2c4['Interaction']['id'];_0x481048[_0x8b34('0x68')+_0x229a85+_0x316597+'Id']=_0x34b2c4[_0x8b34('0x63')]['id'];return db[_0x229a85+_0x8b34('0x74')][_0x8b34('0x6a')](_0x481048);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x4af150,'interaction':_0x34b2c4['Interaction'],'message':_0x34b2c4,'account':_0x34b2c4[_0x8b34('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8b34('0x35'),'appdata':_0x1a9da2[_0x8b34('0x10')]+','+(_0x34b2c4[_0x8b34('0x63')][_0x8b34('0x75')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x8b34('0x17')](respondWithResult(_0x2587ca,null))[_0x8b34('0xc')](handleError(_0x2587ca,null));}; \ No newline at end of file +var _0xee65=['name','send','isNil','rows','find','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','format','YYYY-MM-DD\x20HH:mm:ss','length','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','trunks','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','map','queue_id','filter','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','From','Start','agentTransferTimeout','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','message','status','json'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xee65,0x72));var _0x5ee6=function(_0x30d18b,_0x52dd2c){_0x30d18b=_0x30d18b-0x0;var _0x4bcd4d=_0xee65[_0x30d18b];return _0x4bcd4d;};'use strict';var BPromise=require(_0x5ee6('0x0'));var moment=require(_0x5ee6('0x1'));var _=require(_0x5ee6('0x2'));var util=require(_0x5ee6('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('api');var jayson=require(_0x5ee6('0x4'));var amiClient=jayson[_0x5ee6('0x5')][_0x5ee6('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x5ee6('0x6')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2e81e7,_0x1ac6f4,_0x6435a9){return new BPromise(function(_0x31282a,_0x123c0c){var _0x41623e=_0x6435a9?_0x6435a9:amiClient;return _0x41623e[_0x5ee6('0x7')](_0x2e81e7,_0x1ac6f4)[_0x5ee6('0x8')](function(_0x32bf58){if(_0x32bf58[_0x5ee6('0x9')]){if(_0x32bf58[_0x5ee6('0x9')]['code']===0x1f4){return _0x123c0c(_0x32bf58['error'][_0x5ee6('0xa')]);}return _0x31282a(_0x32bf58['error'][_0x5ee6('0xa')]);}else{_0x31282a(_0x32bf58['result']);}})['catch'](function(_0x4e12a2){_0x123c0c(_0x4e12a2);});});}function respondWithResult(_0x246271,_0x564f7c){_0x564f7c=_0x564f7c||0xc8;return function(_0x74345c){if(_0x74345c){return _0x246271[_0x5ee6('0xb')](_0x564f7c)[_0x5ee6('0xc')](_0x74345c);}return _0x246271['sendStatus'](0x194);};}function handleError(_0x5a5f22,_0x5f3fcb){_0x5f3fcb=_0x5f3fcb||0x1f4;return function(_0x443d2b){logger[_0x5ee6('0x9')](_0x443d2b['stack']);if(_0x443d2b[_0x5ee6('0xd')]){delete _0x443d2b[_0x5ee6('0xd')];}_0x5a5f22[_0x5ee6('0xb')](_0x5f3fcb)[_0x5ee6('0xe')](_0x443d2b);};}function findById(_0x285850){return function(_0x4f765c){if(!_[_0x5ee6('0xf')](_0x285850)&&!_['isNil'](_0x4f765c)&&!_['isNil'](_0x4f765c[_0x5ee6('0x10')])){return _[_0x5ee6('0x11')](_0x4f765c[_0x5ee6('0x10')],function(_0x5e7e21){return _0x5e7e21['id']==_0x285850;});}return null;};}exports['voiceChannels']=function(_0x15bc47,_0x406c6d){return respondWithRpcPromise(_0x5ee6('0x12'),_0x15bc47[_0x5ee6('0x13')])[_0x5ee6('0x8')](respondWithResult(_0x406c6d,null))[_0x5ee6('0x14')](handleError(_0x406c6d,null));};exports[_0x5ee6('0x15')]=function(_0xfee59d,_0x4ac0){return respondWithRpcPromise(_0x5ee6('0x16'),_['merge'](_0xfee59d[_0x5ee6('0x13')],_0xfee59d[_0x5ee6('0x17')]))[_0x5ee6('0x8')](respondWithResult(_0x4ac0,null))[_0x5ee6('0x14')](handleError(_0x4ac0,null));};exports[_0x5ee6('0x18')]=function(_0x5c82a4,_0x3297ac){return respondWithRpcPromise(_0x5ee6('0x19'),_[_0x5ee6('0x1a')](_0x5c82a4['query'],_0x5c82a4[_0x5ee6('0x17')]))['then'](respondWithResult(_0x3297ac,null))['catch'](handleError(_0x3297ac,null));};exports[_0x5ee6('0x1b')]=function(_0x1ff5b3,_0x2b9dbf){return respondWithRpcPromise(_0x5ee6('0x1c'),_0x1ff5b3[_0x5ee6('0x13')])[_0x5ee6('0x8')](respondWithResult(_0x2b9dbf,null))[_0x5ee6('0x14')](handleError(_0x2b9dbf,null));};exports[_0x5ee6('0x1d')]=function(_0x11f4f2,_0x54da39){return respondWithRpcPromise(_0x5ee6('0x1c'),_0x11f4f2[_0x5ee6('0x13')])['then'](findById(_0x11f4f2['params']['id']))[_0x5ee6('0x8')](respondWithResult(_0x54da39,null))['catch'](handleError(_0x54da39,null));};exports['updateVoiceQueue']=function(_0x9c7893,_0xbd0dea){return respondWithRpcPromise(_0x5ee6('0x1e'),_['merge'](_0x9c7893['body'],_0x9c7893[_0x5ee6('0x17')]))[_0x5ee6('0x8')](respondWithResult(_0xbd0dea,null))[_0x5ee6('0x14')](handleError(_0xbd0dea,null));};exports[_0x5ee6('0x1f')]=function(_0x191321,_0x5b70d2){return respondWithRpcPromise(_0x5ee6('0x20'),_[_0x5ee6('0x1a')](_0x191321[_0x5ee6('0x13')],_0x191321[_0x5ee6('0x17')]))[_0x5ee6('0x8')](respondWithResult(_0x5b70d2,null))[_0x5ee6('0x14')](handleError(_0x5b70d2,null));};exports[_0x5ee6('0x21')]=function(_0x15597b,_0x291fb0){return respondWithRpcPromise('VoiceQueuesChannels',_0x15597b[_0x5ee6('0x13')])[_0x5ee6('0x8')](respondWithResult(_0x291fb0,null))['catch'](handleError(_0x291fb0,null));};exports[_0x5ee6('0x22')]=function(_0x3ef54a,_0x457aae){return respondWithRpcPromise(_0x5ee6('0x23'),_[_0x5ee6('0x1a')](_0x3ef54a[_0x5ee6('0x13')],_0x3ef54a[_0x5ee6('0x17')]))[_0x5ee6('0x8')](respondWithResult(_0x457aae,null))[_0x5ee6('0x14')](handleError(_0x457aae,null));};exports[_0x5ee6('0x24')]=function(_0x3cdf45,_0x56079d){return respondWithRpcPromise(_0x5ee6('0x25'),_['merge'](_0x3cdf45[_0x5ee6('0x13')],_0x3cdf45[_0x5ee6('0x17')]))['then'](respondWithResult(_0x56079d,null))[_0x5ee6('0x14')](handleError(_0x56079d,null));};exports[_0x5ee6('0x26')]=function(_0x15637d,_0x7a9c73){return respondWithRpcPromise(_0x5ee6('0x27'),_[_0x5ee6('0x1a')](_0x15637d[_0x5ee6('0x13')],_0x15637d[_0x5ee6('0x17')]))['then'](respondWithResult(_0x7a9c73,null))[_0x5ee6('0x14')](handleError(_0x7a9c73,null));};exports[_0x5ee6('0x28')]=function(_0x3ba4b2,_0x5eca5c){return respondWithRpcPromise(_0x5ee6('0x29'),_0x3ba4b2[_0x5ee6('0x13')])[_0x5ee6('0x8')](respondWithResult(_0x5eca5c,null))[_0x5ee6('0x14')](handleError(_0x5eca5c,null));};exports[_0x5ee6('0x2a')]=function(_0x2bdb6a,_0x32e1e1){return respondWithRpcPromise(_0x5ee6('0x2b'),_0x2bdb6a[_0x5ee6('0x13')])[_0x5ee6('0x8')](respondWithResult(_0x32e1e1,null))[_0x5ee6('0x14')](handleError(_0x32e1e1,null));};exports[_0x5ee6('0x2c')]=function(_0x2df6e3,_0x3622e2){var _0x4e5e14;return respondWithRpcPromise(_0x5ee6('0x2d'),_0x2df6e3[_0x5ee6('0x13')])[_0x5ee6('0x8')](function(_0x193418){_0x4e5e14=_0x193418;return respondWithRpcPromise(_0x5ee6('0x2d'),_0x2df6e3[_0x5ee6('0x13')],routingClient);})[_0x5ee6('0x8')](function(_0x34784c){return _[_0x5ee6('0x1a')]({},_0x34784c,_0x4e5e14);})['then'](respondWithResult(_0x3622e2,null))[_0x5ee6('0x14')](handleError(_0x3622e2,null));};exports[_0x5ee6('0x2e')]=function(_0x4b6077,_0x37f9cd){if(_0x4b6077[_0x5ee6('0x2f')]&&_0x4b6077[_0x5ee6('0x2f')]['interaction']&&_0x4b6077['user']&&_0x4b6077[_0x5ee6('0x30')][_0x5ee6('0xd')]){for(var _0x16a551 in _0x4b6077[_0x5ee6('0x2f')][_0x5ee6('0x31')]){if(_0x4b6077[_0x5ee6('0x2f')][_0x5ee6('0x31')][_0x5ee6('0x32')](_0x16a551)){db[_0x5ee6('0x33')][_0x5ee6('0x34')]({'where':{'channel':_0x16a551,'membername':_0x4b6077[_0x5ee6('0x30')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4b6077['body'][_0x5ee6('0x31')][_0x16a551]&&_0x4b6077[_0x5ee6('0x2f')][_0x5ee6('0x31')][_0x16a551]['length']?{'$notIn':_0x4b6077['body']['interaction'][_0x16a551]}:{'$ne':null}}})[_0x5ee6('0x8')](function(_0x3eaee2){var _0x43b098=moment()[_0x5ee6('0x35')](_0x5ee6('0x36'));for(var _0x35e317=0x0,_0x3c1207=_0x3eaee2[_0x5ee6('0x37')];_0x35e317<_0x3c1207;_0x35e317+=0x1){_0x3eaee2[_0x35e317]['updateAttributes']({'exitAt':_0x43b098});}});for(var _0x6d197=0x0;_0x6d197<_0x4b6077[_0x5ee6('0x2f')][_0x5ee6('0x31')][_0x16a551]['length'];_0x6d197+=0x1){db[_0x5ee6('0x33')][_0x5ee6('0x38')]({'where':{'channel':_0x16a551,'membername':_0x4b6077['user']['name'],'type':_0x5ee6('0x39'),'uniqueid':_0x4b6077['body'][_0x5ee6('0x31')][_0x16a551][_0x6d197],'exitAt':null},'defaults':{'channel':_0x16a551,'membername':_0x4b6077['user'][_0x5ee6('0xd')],'interface':_['isNil'](_0x4b6077[_0x5ee6('0x30')][_0x5ee6('0x3a')])?util[_0x5ee6('0x35')](_0x5ee6('0x3b'),_0x4b6077[_0x5ee6('0x30')][_0x5ee6('0xd')]):_0x4b6077[_0x5ee6('0x30')][_0x5ee6('0x3a')],'type':_0x5ee6('0x39'),'enterAt':moment()[_0x5ee6('0x35')](_0x5ee6('0x36')),'role':_0x5ee6('0x3c'),'internal':_0x4b6077['user'][_0x5ee6('0x3d')],'uniqueid':_0x4b6077[_0x5ee6('0x2f')][_0x5ee6('0x31')][_0x16a551][_0x6d197]}});}}}}return respondWithRpcPromise(_0x5ee6('0x3e'),{'id':_0x4b6077['params']['id'],'capacity':_0x4b6077[_0x5ee6('0x2f')][_0x5ee6('0x3f')]},routingClient)[_0x5ee6('0x8')](respondWithResult(_0x37f9cd,null))[_0x5ee6('0x14')](handleError(_0x37f9cd,null));};exports[_0x5ee6('0x40')]=function(_0x3105ed,_0x31ef37){return respondWithRpcPromise('Telephones',_0x3105ed[_0x5ee6('0x13')])[_0x5ee6('0x8')](respondWithResult(_0x31ef37,null))['catch'](handleError(_0x31ef37,null));};exports[_0x5ee6('0x41')]=function(_0x905bfd,_0x58e6b1){return respondWithRpcPromise(_0x5ee6('0x42'),_0x905bfd[_0x5ee6('0x13')])[_0x5ee6('0x8')](respondWithResult(_0x58e6b1,null))[_0x5ee6('0x14')](handleError(_0x58e6b1,null));};exports['campaigns']=function(_0x529b02,_0x42ca85){return respondWithRpcPromise(_0x5ee6('0x43'),_0x529b02[_0x5ee6('0x13')])['then'](respondWithResult(_0x42ca85,null))[_0x5ee6('0x14')](handleError(_0x42ca85,null));};exports[_0x5ee6('0x44')]=function(_0x3bf22e,_0x4f16ce){return respondWithRpcPromise(_0x5ee6('0x45'),_0x3bf22e[_0x5ee6('0x13')],routingClient)['then'](respondWithResult(_0x4f16ce,null))[_0x5ee6('0x14')](handleError(_0x4f16ce,null));};exports[_0x5ee6('0x46')]=function(_0x447738,_0x3aaa39){return respondWithRpcPromise('ChatQueues',_0x447738[_0x5ee6('0x13')],routingClient)[_0x5ee6('0x8')](findById(_0x447738[_0x5ee6('0x17')]['id']))[_0x5ee6('0x8')](respondWithResult(_0x3aaa39,null))[_0x5ee6('0x14')](handleError(_0x3aaa39,null));};exports['mailQueues']=function(_0x38c864,_0x2ef453){return respondWithRpcPromise(_0x5ee6('0x47'),_0x38c864[_0x5ee6('0x13')],routingClient)[_0x5ee6('0x8')](respondWithResult(_0x2ef453,null))[_0x5ee6('0x14')](handleError(_0x2ef453,null));};exports[_0x5ee6('0x48')]=function(_0x21f0b4,_0x1f90d1){return respondWithRpcPromise('MailQueues',_0x21f0b4[_0x5ee6('0x13')],routingClient)[_0x5ee6('0x8')](findById(_0x21f0b4[_0x5ee6('0x17')]['id']))['then'](respondWithResult(_0x1f90d1,null))[_0x5ee6('0x14')](handleError(_0x1f90d1,null));};exports[_0x5ee6('0x49')]=function(_0x182322,_0x18456e){return respondWithRpcPromise(_0x5ee6('0x4a'),_0x182322['query'],mailClient)[_0x5ee6('0x8')](respondWithResult(_0x18456e,null))['catch'](handleError(_0x18456e,null));};exports[_0x5ee6('0x4b')]=function(_0x587266,_0x2f5cbc){return respondWithRpcPromise('OpenchannelQueues',_0x587266[_0x5ee6('0x13')],routingClient)[_0x5ee6('0x8')](respondWithResult(_0x2f5cbc,null))['catch'](handleError(_0x2f5cbc,null));};exports[_0x5ee6('0x4c')]=function(_0x30e96c,_0x1893bd){return respondWithRpcPromise('OpenchannelQueues',_0x30e96c[_0x5ee6('0x13')],routingClient)[_0x5ee6('0x8')](findById(_0x30e96c[_0x5ee6('0x17')]['id']))[_0x5ee6('0x8')](respondWithResult(_0x1893bd,null))['catch'](handleError(_0x1893bd,null));};exports[_0x5ee6('0x4d')]=function(_0x4406fa,_0x23845e){return respondWithRpcPromise(_0x5ee6('0x4e'),_0x4406fa['query'],routingClient)[_0x5ee6('0x8')](respondWithResult(_0x23845e,null))[_0x5ee6('0x14')](handleError(_0x23845e,null));};exports[_0x5ee6('0x4f')]=function(_0xb86c4e,_0x254436){return respondWithRpcPromise(_0x5ee6('0x4e'),_0xb86c4e[_0x5ee6('0x13')],routingClient)[_0x5ee6('0x8')](findById(_0xb86c4e['params']['id']))[_0x5ee6('0x8')](respondWithResult(_0x254436,null))[_0x5ee6('0x14')](handleError(_0x254436,null));};exports[_0x5ee6('0x50')]=function(_0x549e60,_0xc98d79){return respondWithRpcPromise(_0x5ee6('0x51'),_0x549e60['query'],routingClient)[_0x5ee6('0x8')](respondWithResult(_0xc98d79,null))[_0x5ee6('0x14')](handleError(_0xc98d79,null));};exports['showWhatsappQueues']=function(_0x10cab6,_0x615226){return respondWithRpcPromise(_0x5ee6('0x51'),_0x10cab6[_0x5ee6('0x13')],routingClient)[_0x5ee6('0x8')](findById(_0x10cab6[_0x5ee6('0x17')]['id']))[_0x5ee6('0x8')](respondWithResult(_0x615226,null))['catch'](handleError(_0x615226,null));};exports['faxQueues']=function(_0x1dc729,_0x57ad4a){return respondWithRpcPromise(_0x5ee6('0x52'),_0x1dc729[_0x5ee6('0x13')],routingClient)['then'](respondWithResult(_0x57ad4a,null))[_0x5ee6('0x14')](handleError(_0x57ad4a,null));};exports[_0x5ee6('0x53')]=function(_0xfccf8c,_0x19b19a){return respondWithRpcPromise(_0x5ee6('0x52'),_0xfccf8c[_0x5ee6('0x13')],routingClient)[_0x5ee6('0x8')](findById(_0xfccf8c[_0x5ee6('0x17')]['id']))[_0x5ee6('0x8')](respondWithResult(_0x19b19a,null))[_0x5ee6('0x14')](handleError(_0x19b19a,null));};exports[_0x5ee6('0x54')]=function(_0x6d96a8,_0x4127f3){return respondWithRpcPromise(_0x5ee6('0x55'),_0x6d96a8[_0x5ee6('0x13')])[_0x5ee6('0x8')](respondWithResult(_0x4127f3,null))[_0x5ee6('0x14')](handleError(_0x4127f3,null));};exports[_0x5ee6('0x56')]=function(_0x5a0fd1,_0x14731d){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5a0fd1[_0x5ee6('0x13')],routingClient)[_0x5ee6('0x8')](respondWithResult(_0x14731d,null))[_0x5ee6('0x14')](handleError(_0x14731d,null));};exports[_0x5ee6('0x57')]=function(_0x253ae3,_0x328d42){return respondWithRpcPromise(_0x5ee6('0x58'),_0x253ae3[_0x5ee6('0x13')],routingClient)['then'](respondWithResult(_0x328d42,null))[_0x5ee6('0x14')](handleError(_0x328d42,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x609100,_0x36cbc2){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x609100['query'],routingClient)['then'](respondWithResult(_0x36cbc2,null))['catch'](handleError(_0x36cbc2,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x3117a7,_0x565b7a){return respondWithRpcPromise(_0x5ee6('0x59'),_0x3117a7['query'],routingClient)['then'](function(_0x1d0180){if(_0x3117a7[_0x5ee6('0x13')][_0x5ee6('0x5a')]!==undefined){var _0x4b430c=_(_0x1d0180[_0x5ee6('0x10')])['filter']([_0x3117a7[_0x5ee6('0x13')][_0x5ee6('0x5a')],_0x3117a7['params']['id']])[_0x5ee6('0x5b')](_0x5ee6('0x5c'))['uniq']()['value']();return _0x1d0180[_0x5ee6('0x10')][_0x5ee6('0x5d')](function(_0x3bc0be){return _0x4b430c[_0x5ee6('0x5e')](_0x3bc0be[_0x5ee6('0x5c')])>-0x1;});}else{return _0x1d0180[_0x5ee6('0x10')]['filter'](function(_0x3f55b4){return _0x3f55b4[_0x5ee6('0x5c')]===parseInt(_0x3117a7['params']['id']);});}})[_0x5ee6('0x8')](respondWithResult(_0x565b7a,null))[_0x5ee6('0x14')](handleError(_0x565b7a,null));};exports[_0x5ee6('0x5f')]=function(_0x53b09e,_0xfb19a4){return respondWithRpcPromise(_0x5ee6('0x60'),_0x53b09e[_0x5ee6('0x13')],routingClient)['then'](respondWithResult(_0xfb19a4,null))[_0x5ee6('0x14')](handleError(_0xfb19a4,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x218e0a,_0x373b20){return respondWithRpcPromise(_0x5ee6('0x61'),_0x218e0a[_0x5ee6('0x13')],routingClient)[_0x5ee6('0x8')](respondWithResult(_0x373b20,null))['catch'](handleError(_0x373b20,null));};exports[_0x5ee6('0x62')]=function(_0x37c8a8,_0x3d08eb){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x37c8a8[_0x5ee6('0x13')],routingClient)[_0x5ee6('0x8')](respondWithResult(_0x3d08eb,null))[_0x5ee6('0x14')](handleError(_0x3d08eb,null));};exports[_0x5ee6('0x63')]=function(_0x177b66){return function(_0xe718cf,_0x3babf8){var _0x4e5406,_0x5d98ba;var _0x548a05=_[_0x5ee6('0x64')](_0x177b66);var _0xe40a06=_0x177b66==='chat'?_0x5ee6('0x65'):'Account';return db[_0x548a05+_0x5ee6('0x66')]['findOne']({'raw':!![],'where':{'id':_0xe718cf[_0x5ee6('0x17')]['id']}})[_0x5ee6('0x8')](function(_0x179c08){if(_[_0x5ee6('0xf')](_0x179c08)){throw new Error(_0x548a05+_0x5ee6('0x67'));}_0x4e5406=_0x179c08;return db[_0x548a05+_0x5ee6('0x68')][_0x5ee6('0x69')]({'where':{'id':_0xe718cf[_0x5ee6('0x2f')][_0x5ee6('0x6a')]},'include':[{'model':db[_0x548a05+_0x5ee6('0x6b')],'as':_0x5ee6('0x6b')},{'model':db[_0x548a05+_0xe40a06],'as':_0x5ee6('0x6c')}]});})[_0x5ee6('0x8')](function(_0x22c2ea){if(_[_0x5ee6('0xf')](_0x22c2ea)){throw new Error(_0x548a05+_0x5ee6('0x6d'));}_0x5d98ba=_0x22c2ea;return _0x22c2ea[_0x5ee6('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x5ee6('0x8')](function(){var _0x108d2c={'uniqueid':_0x177b66+'.'+_0x5d98ba['id']+'.'+_0x5d98ba[_0x5ee6('0x6b')]['id'],'FromUserId':_0xe718cf[_0x5ee6('0x30')]['id'],'type':_0x5ee6('0x6f')};_0x108d2c[_0x548a05+_0x5ee6('0x70')]=_0x5d98ba['id'];_0x108d2c[_0x548a05+_0x5ee6('0x71')]=_0x5d98ba[_0x5ee6('0x6b')]['id'];_0x108d2c['From'+_0x548a05+_0xe40a06+'Id']=_0x5d98ba[_0x5ee6('0x6c')]['id'];_0x108d2c['To'+_0x548a05+_0x5ee6('0x72')]=_0x4e5406['id'];return db[_0x548a05+_0x5ee6('0x73')][_0x5ee6('0x74')](_0x108d2c);})[_0x5ee6('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x177b66,'interaction':_0x5d98ba[_0x5ee6('0x6b')],'message':_0x5d98ba,'account':_0x5d98ba[_0x5ee6('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5ee6('0x6f'),'appdata':_0x4e5406[_0x5ee6('0xd')]+','+(_0x5d98ba[_0x5ee6('0x6c')][_0x5ee6('0x75')]||0x12c),'interval':_0x5ee6('0x76')}]},routingClient);})[_0x5ee6('0x8')](respondWithResult(_0x3babf8,null))[_0x5ee6('0x14')](handleError(_0x3babf8,null));};};exports[_0x5ee6('0x77')]=function(_0xff207f,_0x4fd594){var _0x5eefdd,_0x735f82;if(_['isNil'](_0xff207f['body'][_0x5ee6('0x78')])){throw new Error(_0x5ee6('0x79'));}var _0x35dadb=_0xff207f[_0x5ee6('0x2f')][_0x5ee6('0x78')];var _0x1853f8=_['capitalize'](_0x35dadb);var _0x1e5efb=_0x35dadb==='chat'?_0x5ee6('0x65'):_0x5ee6('0x6c');return db[_0x5ee6('0x7a')][_0x5ee6('0x69')]({'raw':!![],'where':{'id':_0xff207f[_0x5ee6('0x17')]['id'],'role':_0x5ee6('0x3c')}})[_0x5ee6('0x8')](function(_0x410152){if(_[_0x5ee6('0xf')](_0x410152)){throw new Error(_0x5ee6('0x7b'));}_0x5eefdd=_0x410152;return db[_0x1853f8+_0x5ee6('0x68')][_0x5ee6('0x69')]({'where':{'id':_0xff207f[_0x5ee6('0x2f')]['messageId']},'include':[{'model':db[_0x1853f8+_0x5ee6('0x6b')],'as':_0x5ee6('0x6b')},{'model':db[_0x1853f8+_0x1e5efb],'as':'Account'}]});})[_0x5ee6('0x8')](function(_0x115311){if(_[_0x5ee6('0xf')](_0x115311)){throw new Error(_0x1853f8+_0x5ee6('0x6d'));}_0x735f82=_0x115311;return _0x115311['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x5ee6('0x8')](function(){var _0x5d8f1={'uniqueid':_0x35dadb+'.'+_0x735f82['id']+'.'+_0x735f82[_0x5ee6('0x6b')]['id'],'FromUserId':_0xff207f[_0x5ee6('0x30')]['id'],'type':'queue','ToUserId':_0x5eefdd['id']};_0x5d8f1[_0x1853f8+'MessageId']=_0x735f82['id'];_0x5d8f1[_0x1853f8+_0x5ee6('0x71')]=_0x735f82[_0x5ee6('0x6b')]['id'];_0x5d8f1[_0x5ee6('0x7c')+_0x1853f8+_0x1e5efb+'Id']=_0x735f82[_0x5ee6('0x6c')]['id'];return db[_0x1853f8+_0x5ee6('0x73')][_0x5ee6('0x74')](_0x5d8f1);})[_0x5ee6('0x8')](function(){return respondWithRpcPromise(_0x5ee6('0x7d'),{'channel':_0x35dadb,'interaction':_0x735f82[_0x5ee6('0x6b')],'message':_0x735f82,'account':_0x735f82['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x5ee6('0x3c'),'appdata':_0x5eefdd[_0x5ee6('0xd')]+','+(_0x735f82['Account'][_0x5ee6('0x7e')]||0x12c),'interval':_0x5ee6('0x76')}]},routingClient);})[_0x5ee6('0x8')](respondWithResult(_0x4fd594,null))[_0x5ee6('0x14')](handleError(_0x4fd594,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index e85a378..5da36c3 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 _0x2f1c=['multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','run','post','create','put','update','delete','destroy','exports'];(function(_0x288d33,_0x58ee36){var _0x1033bd=function(_0x2e22f1){while(--_0x2e22f1){_0x288d33['push'](_0x288d33['shift']());}};_0x1033bd(++_0x58ee36);}(_0x2f1c,0xf7));var _0xc2f1=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0x2f1c[_0x216d45];return _0xbaac0b;};'use strict';var multer=require(_0xc2f1('0x0'));var util=require(_0xc2f1('0x1'));var path=require('path');var timeout=require(_0xc2f1('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc2f1('0x3'));var auth=require(_0xc2f1('0x4'));var interaction=require(_0xc2f1('0x5'));var config=require(_0xc2f1('0x6'));var controller=require('./schedule.controller');router[_0xc2f1('0x7')]('/',auth[_0xc2f1('0x8')](),controller[_0xc2f1('0x9')]);router['get'](_0xc2f1('0xa'),auth[_0xc2f1('0x8')](),controller['show']);router[_0xc2f1('0x7')]('/:id/run',auth[_0xc2f1('0x8')](),controller[_0xc2f1('0xb')]);router[_0xc2f1('0xc')]('/',auth['isAuthenticated'](),controller[_0xc2f1('0xd')]);router[_0xc2f1('0xe')](_0xc2f1('0xa'),auth[_0xc2f1('0x8')](),controller[_0xc2f1('0xf')]);router[_0xc2f1('0x10')](_0xc2f1('0xa'),auth[_0xc2f1('0x8')](),controller[_0xc2f1('0x11')]);module[_0xc2f1('0x12')]=router; \ No newline at end of file +var _0x0646=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','run','put','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x4c76ad,_0x24bdab){var _0xde0a18=function(_0x575d21){while(--_0x575d21){_0x4c76ad['push'](_0x4c76ad['shift']());}};_0xde0a18(++_0x24bdab);}(_0x0646,0x82));var _0x6064=function(_0xef2860,_0x20dbaa){_0xef2860=_0xef2860-0x0;var _0x526018=_0x0646[_0xef2860];return _0x526018;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6064('0x0'));var timeout=require(_0x6064('0x1'));var express=require(_0x6064('0x2'));var router=express[_0x6064('0x3')]();var fs_extra=require(_0x6064('0x4'));var auth=require(_0x6064('0x5'));var interaction=require(_0x6064('0x6'));var config=require(_0x6064('0x7'));var controller=require('./schedule.controller');router[_0x6064('0x8')]('/',auth[_0x6064('0x9')](),controller[_0x6064('0xa')]);router['get'](_0x6064('0xb'),auth[_0x6064('0x9')](),controller[_0x6064('0xc')]);router[_0x6064('0x8')]('/:id/run',auth[_0x6064('0x9')](),controller[_0x6064('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6064('0xe')](_0x6064('0xb'),auth[_0x6064('0x9')](),controller[_0x6064('0xf')]);router[_0x6064('0x10')](_0x6064('0xb'),auth['isAuthenticated'](),controller[_0x6064('0x11')]);module[_0x6064('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 67f2a5a..e4393b3 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 _0x2d2c=['DATE','INTEGER','ENUM','years','quarters','months','hours','minutes','days','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN'];(function(_0x3cb98d,_0x2dc480){var _0x155eb6=function(_0x10c207){while(--_0x10c207){_0x3cb98d['push'](_0x3cb98d['shift']());}};_0x155eb6(++_0x2dc480);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0x2d2c[_0x39caaa];return _0x9b9c7d;};'use strict';var Sequelize=require(_0xc2d2('0x0'));module[_0xc2d2('0x1')]={'name':{'type':Sequelize[_0xc2d2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc2d2('0x2')]},'active':{'type':Sequelize[_0xc2d2('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xc2d2('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xc2d2('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xc2d2('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xc2d2('0x6')](_0xc2d2('0x7'),_0xc2d2('0x8'),_0xc2d2('0x9'),'weeks','days',_0xc2d2('0xa'),_0xc2d2('0xb')),'allowNull':![],'defaultValue':_0xc2d2('0xc')},'output':{'type':Sequelize[_0xc2d2('0x6')](_0xc2d2('0xd'),_0xc2d2('0xe'),_0xc2d2('0xf')),'allowNull':![],'defaultValue':_0xc2d2('0xd')},'type':{'type':Sequelize[_0xc2d2('0x6')](_0xc2d2('0x10'),_0xc2d2('0x11')),'allowNull':![],'defaultValue':_0xc2d2('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xc2d2('0x2')]},'cc':{'type':Sequelize[_0xc2d2('0x12')]},'bcc':{'type':Sequelize[_0xc2d2('0x12')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x446c=['BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','quarters','months','hours','minutes','days','ENUM','csv','xlsx','custom'];(function(_0x227518,_0x552a38){var _0x3aae94=function(_0x6866c4){while(--_0x6866c4){_0x227518['push'](_0x227518['shift']());}};_0x3aae94(++_0x552a38);}(_0x446c,0x156));var _0xc446=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0x446c[_0x246148];return _0x453d94;};'use strict';var Sequelize=require(_0xc446('0x0'));module[_0xc446('0x1')]={'name':{'type':Sequelize[_0xc446('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc446('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xc446('0x2')],'allowNull':![],'defaultValue':_0xc446('0x3')},'startAt':{'type':Sequelize[_0xc446('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xc446('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0xc446('0x6'),_0xc446('0x7'),'weeks','days',_0xc446('0x8'),_0xc446('0x9')),'allowNull':![],'defaultValue':_0xc446('0xa')},'output':{'type':Sequelize[_0xc446('0xb')](_0xc446('0xc'),'pdf',_0xc446('0xd')),'allowNull':![],'defaultValue':_0xc446('0xc')},'type':{'type':Sequelize[_0xc446('0xb')](_0xc446('0xe'),'default'),'allowNull':![],'defaultValue':_0xc446('0xe')},'sendMail':{'type':Sequelize[_0xc446('0xf')],'defaultValue':![]},'email':{'type':Sequelize[_0xc446('0x2')]},'cc':{'type':Sequelize[_0xc446('0x10')]},'bcc':{'type':Sequelize[_0xc446('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xc446('0xf')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 60afd96..2842a58 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 _0x53ec=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','Scheduler','UserProfileResource','destroy','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','Schedule','include','findAll','rows','show','params','includeAll','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce'];(function(_0x5abbea,_0x26c444){var _0xc80795=function(_0x5c5085){while(--_0x5c5085){_0x5abbea['push'](_0x5abbea['shift']());}};_0xc80795(++_0x26c444);}(_0x53ec,0x192));var _0xc53e=function(_0x37ff64,_0x37ebd9){_0x37ff64=_0x37ff64-0x0;var _0x1b4173=_0x53ec[_0x37ff64];return _0x1b4173;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];function respondWithStatusCode(_0x863fa,_0x4203aa){_0x4203aa=_0x4203aa||0xcc;return function(_0x56f0e5){if(_0x56f0e5){return _0x863fa['sendStatus'](_0x4203aa);}return _0x863fa[_0xc53e('0x18')](_0x4203aa)[_0xc53e('0x19')]();};}function respondWithResult(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xc8;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x18')](_0x3d2e17)[_0xc53e('0x1a')](_0x358ef3);}};}function respondWithFilteredResult(_0x19c0d1,_0x455e4d){return function(_0x2ad6eb){if(_0x2ad6eb){var _0x5b0a88=typeof _0x455e4d[_0xc53e('0x1b')]===_0xc53e('0x1c')&&typeof _0x455e4d[_0xc53e('0x1d')]===_0xc53e('0x1c');var _0x15333b=_0x2ad6eb[_0xc53e('0x1e')];var _0x164016=_0x5b0a88?0x0:_0x455e4d[_0xc53e('0x1b')];var _0x3b550e=_0x5b0a88?_0x2ad6eb['count']:_0x455e4d['offset']+_0x455e4d[_0xc53e('0x1d')];var _0x2a5bac;if(_0x3b550e>=_0x15333b){_0x3b550e=_0x15333b;_0x2a5bac=0xc8;}else{_0x2a5bac=0xce;}_0x19c0d1[_0xc53e('0x18')](_0x2a5bac);return _0x19c0d1[_0xc53e('0x1f')](_0xc53e('0x20'),_0x164016+'-'+_0x3b550e+'/'+_0x15333b)[_0xc53e('0x1a')](_0x2ad6eb);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x21')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x22')](_0x401af6);}return _0x25702b[_0xc53e('0x23')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x24')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){var _0xe06e42=_0x180811['get']({'plain':!![]});var _0x1ae55e=_0xc53e('0x25');return db[_0xc53e('0x26')][_0xc53e('0x27')]({'where':{'type':_0x1ae55e,'resourceId':_0xe06e42['id']}})[_0xc53e('0x24')](function(){return _0x180811;});})['then'](function(){_0x7591c1[_0xc53e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d9a68,_0x5c65d3){return function(_0x3c5056){if(!_0x3c5056){_0x4d9a68['sendStatus'](0x194);}return _0x3c5056;};}function handleError(_0x28240a,_0x4f203d){_0x4f203d=_0x4f203d||0x1f4;return function(_0x24a77e){logger['error'](_0x24a77e['stack']);if(_0x24a77e[_0xc53e('0x28')]){delete _0x24a77e[_0xc53e('0x28')];}_0x28240a[_0xc53e('0x18')](_0x4f203d)[_0xc53e('0x29')](_0x24a77e);};}exports[_0xc53e('0x2a')]=function(_0xf97d78,_0x3280fe){var _0x2a2ca9={},_0x4ace0b={},_0x437893={'count':0x0,'rows':[]};var _0x311835=_[_0xc53e('0x2b')](db['Schedule'][_0xc53e('0x2c')],function(_0x495756){return{'name':_0x495756[_0xc53e('0x2d')],'type':_0x495756[_0xc53e('0x2e')]['key']};});_0x4ace0b['model']=_[_0xc53e('0x2b')](_0x311835,_0xc53e('0x28'));_0x4ace0b[_0xc53e('0x2f')]=_[_0xc53e('0x30')](_0xf97d78[_0xc53e('0x2f')]);_0x4ace0b[_0xc53e('0x31')]=_[_0xc53e('0x32')](_0x4ace0b[_0xc53e('0x33')],_0x4ace0b['query']);_0x2a2ca9[_0xc53e('0x34')]=_[_0xc53e('0x32')](_0x4ace0b[_0xc53e('0x33')],qs[_0xc53e('0x35')](_0xf97d78[_0xc53e('0x2f')][_0xc53e('0x35')]));_0x2a2ca9[_0xc53e('0x34')]=_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x36')]?_0x2a2ca9['attributes']:_0x4ace0b[_0xc53e('0x33')];if(!_0xf97d78['query'][_0xc53e('0x37')](_0xc53e('0x38'))){_0x2a2ca9['limit']=qs[_0xc53e('0x1d')](_0xf97d78[_0xc53e('0x2f')][_0xc53e('0x1d')]);_0x2a2ca9['offset']=qs[_0xc53e('0x1b')](_0xf97d78[_0xc53e('0x2f')][_0xc53e('0x1b')]);}_0x2a2ca9[_0xc53e('0x39')]=qs[_0xc53e('0x3a')](_0xf97d78[_0xc53e('0x2f')][_0xc53e('0x3a')]);_0x2a2ca9['where']=qs[_0xc53e('0x31')](_[_0xc53e('0x3b')](_0xf97d78[_0xc53e('0x2f')],_0x4ace0b['filters']),_0x311835);if(_0xf97d78[_0xc53e('0x2f')]['filter']){_0x2a2ca9[_0xc53e('0x3c')]=_[_0xc53e('0x3d')](_0x2a2ca9[_0xc53e('0x3c')],{'$or':_[_0xc53e('0x2b')](_0x311835,function(_0x3036e7){if(_0x3036e7['type']!==_0xc53e('0x3e')){var _0x3c72b1={};_0x3c72b1[_0x3036e7['name']]={'$like':'%'+_0xf97d78['query']['filter']+'%'};return _0x3c72b1;}})});}_0x2a2ca9=_['merge']({},_0x2a2ca9,_0xf97d78[_0xc53e('0x3f')]);var _0x9c3816={'where':_0x2a2ca9['where']};return db[_0xc53e('0x40')]['count'](_0x9c3816)['then'](function(_0x53447e){_0x437893[_0xc53e('0x1e')]=_0x53447e;if(_0xf97d78['query']['includeAll']){_0x2a2ca9[_0xc53e('0x41')]=[{'all':!![]}];}return db['Schedule'][_0xc53e('0x42')](_0x2a2ca9);})[_0xc53e('0x24')](function(_0x49f204){_0x437893[_0xc53e('0x43')]=_0x49f204;return _0x437893;})[_0xc53e('0x24')](respondWithFilteredResult(_0x3280fe,_0x2a2ca9))['catch'](handleError(_0x3280fe,null));};exports[_0xc53e('0x44')]=function(_0x529254,_0x547be0){var _0x481e6d={'raw':![],'where':{'id':_0x529254[_0xc53e('0x45')]['id']}},_0x4efee5={};_0x4efee5[_0xc53e('0x33')]=_[_0xc53e('0x30')](db['Schedule'][_0xc53e('0x2c')]);_0x4efee5[_0xc53e('0x2f')]=_['keys'](_0x529254['query']);_0x4efee5[_0xc53e('0x31')]=_[_0xc53e('0x32')](_0x4efee5[_0xc53e('0x33')],_0x4efee5['query']);_0x481e6d[_0xc53e('0x34')]=_[_0xc53e('0x32')](_0x4efee5[_0xc53e('0x33')],qs[_0xc53e('0x35')](_0x529254[_0xc53e('0x2f')][_0xc53e('0x35')]));_0x481e6d[_0xc53e('0x34')]=_0x481e6d['attributes'][_0xc53e('0x36')]?_0x481e6d[_0xc53e('0x34')]:_0x4efee5[_0xc53e('0x33')];if(_0x529254['query'][_0xc53e('0x46')]){_0x481e6d[_0xc53e('0x41')]=[{'all':!![]}];}_0x481e6d=_[_0xc53e('0x3d')]({},_0x481e6d,_0x529254[_0xc53e('0x3f')]);return db[_0xc53e('0x40')][_0xc53e('0x47')](_0x481e6d)['then'](handleEntityNotFound(_0x547be0,null))[_0xc53e('0x24')](respondWithResult(_0x547be0,null))[_0xc53e('0x48')](handleError(_0x547be0,null));};exports[_0xc53e('0x49')]=function(_0x5a6e41,_0x33d45c){return db[_0xc53e('0x40')][_0xc53e('0x49')](_0x5a6e41[_0xc53e('0x4a')],{})[_0xc53e('0x24')](function(_0x1ac62e){var _0x1a5a8f=_0x5a6e41[_0xc53e('0x4b')][_0xc53e('0x4c')]({'plain':!![]});if(!_0x1a5a8f)throw new Error(_0xc53e('0x4d'));if(_0x1a5a8f['role']===_0xc53e('0x4b')){var _0x17cf13=_0x1ac62e[_0xc53e('0x4c')]({'plain':!![]});var _0x3d74ac=_0xc53e('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x3d74ac,'userProfileId':_0x1a5a8f[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x15c91b){if(_0x15c91b&&_0x15c91b['autoAssociation']===0x0){return db[_0xc53e('0x26')][_0xc53e('0x49')]({'name':_0x17cf13[_0xc53e('0x28')],'resourceId':_0x17cf13['id'],'type':_0x15c91b['name'],'sectionId':_0x15c91b['id']},{})[_0xc53e('0x24')](function(){return _0x1ac62e;});}else{return _0x1ac62e;}})[_0xc53e('0x48')](function(_0x395913){logger['error'](_0xc53e('0x4f'),_0x395913);throw _0x395913;});}return _0x1ac62e;})['then'](respondWithResult(_0x33d45c,0xc9))[_0xc53e('0x48')](handleError(_0x33d45c,null));};exports[_0xc53e('0x50')]=function(_0x5ce90c,_0x15a96a){if(_0x5ce90c[_0xc53e('0x4a')]['id']){delete _0x5ce90c['body']['id'];}return db[_0xc53e('0x40')][_0xc53e('0x47')]({'where':{'id':_0x5ce90c[_0xc53e('0x45')]['id']}})[_0xc53e('0x24')](handleEntityNotFound(_0x15a96a,null))[_0xc53e('0x24')](saveUpdates(_0x5ce90c[_0xc53e('0x4a')],null))[_0xc53e('0x24')](respondWithResult(_0x15a96a,null))[_0xc53e('0x48')](handleError(_0x15a96a,null));};exports[_0xc53e('0x27')]=function(_0x219ed4,_0x3559eb){return db['Schedule'][_0xc53e('0x47')]({'where':{'id':_0x219ed4['params']['id']}})[_0xc53e('0x24')](handleEntityNotFound(_0x3559eb,null))['then'](removeEntity(_0x3559eb,null))[_0xc53e('0x48')](handleError(_0x3559eb,null));};exports[_0xc53e('0x51')]=function(_0x5228e7,_0xfc2fab,_0x7f0bc0){var _0x9c0112=require(_0xc53e('0x52'));return db['Schedule'][_0xc53e('0x47')]({'where':{'id':_0x5228e7[_0xc53e('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xfc2fab,null))['then'](function(){_0x9c0112[_0xc53e('0x51')](_0x5228e7['params']['id']);})['then'](respondWithStatusCode(_0xfc2fab,null))['catch'](handleError(_0xfc2fab,null));}; \ No newline at end of file +var _0x46ed=['findAll','rows','params','keys','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','run','../../config/schedule','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','Scheduler','UserProfileResource','destroy','error','stack','name','send','index','Schedule','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','options','count','includeAll','include'];(function(_0x3303a5,_0x362dd6){var _0x343f07=function(_0x4c346e){while(--_0x4c346e){_0x3303a5['push'](_0x3303a5['shift']());}};_0x343f07(++_0x362dd6);}(_0x46ed,0x168));var _0xd46e=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x46ed[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){var _0x5424e5=_0x62dea5['get']({'plain':!![]});var _0x371054=_0xd46e('0x26');return db[_0xd46e('0x27')][_0xd46e('0x28')]({'where':{'type':_0x371054,'resourceId':_0x5424e5['id']}})[_0xd46e('0x25')](function(){return _0x62dea5;});})[_0xd46e('0x25')](function(){_0x33c2e0[_0xd46e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d789,_0x3c301a){return function(_0xddbce9){if(!_0xddbce9){_0x45d789[_0xd46e('0x1a')](0x194);}return _0xddbce9;};}function handleError(_0x96f15c,_0x16e941){_0x16e941=_0x16e941||0x1f4;return function(_0x58aeef){logger[_0xd46e('0x29')](_0x58aeef[_0xd46e('0x2a')]);if(_0x58aeef[_0xd46e('0x2b')]){delete _0x58aeef[_0xd46e('0x2b')];}_0x96f15c[_0xd46e('0x1b')](_0x16e941)[_0xd46e('0x2c')](_0x58aeef);};}exports[_0xd46e('0x2d')]=function(_0x2c5ec7,_0x18f060){var _0x45ea47={},_0x2ff785={},_0x504324={'count':0x0,'rows':[]};var _0x2f4a1b=_['map'](db[_0xd46e('0x2e')][_0xd46e('0x2f')],function(_0x4f5718){return{'name':_0x4f5718[_0xd46e('0x30')],'type':_0x4f5718['type'][_0xd46e('0x31')]};});_0x2ff785[_0xd46e('0x32')]=_['map'](_0x2f4a1b,_0xd46e('0x2b'));_0x2ff785[_0xd46e('0x33')]=_['keys'](_0x2c5ec7[_0xd46e('0x33')]);_0x2ff785[_0xd46e('0x34')]=_[_0xd46e('0x35')](_0x2ff785['model'],_0x2ff785['query']);_0x45ea47[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x2ff785[_0xd46e('0x32')],qs[_0xd46e('0x37')](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x37')]));_0x45ea47[_0xd46e('0x36')]=_0x45ea47[_0xd46e('0x36')]['length']?_0x45ea47[_0xd46e('0x36')]:_0x2ff785[_0xd46e('0x32')];if(!_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x45ea47[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x2c5ec7['query'][_0xd46e('0x1d')]);_0x45ea47[_0xd46e('0x1c')]=qs['offset'](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x1c')]);}_0x45ea47[_0xd46e('0x3a')]=qs[_0xd46e('0x3b')](_0x2c5ec7['query'][_0xd46e('0x3b')]);_0x45ea47[_0xd46e('0x3c')]=qs[_0xd46e('0x34')](_[_0xd46e('0x3d')](_0x2c5ec7[_0xd46e('0x33')],_0x2ff785[_0xd46e('0x34')]),_0x2f4a1b);if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x3e')]){_0x45ea47['where']=_[_0xd46e('0x3f')](_0x45ea47[_0xd46e('0x3c')],{'$or':_[_0xd46e('0x40')](_0x2f4a1b,function(_0x25657a){if(_0x25657a[_0xd46e('0x41')]!=='VIRTUAL'){var _0x964c66={};_0x964c66[_0x25657a['name']]={'$like':'%'+_0x2c5ec7['query']['filter']+'%'};return _0x964c66;}})});}_0x45ea47=_['merge']({},_0x45ea47,_0x2c5ec7[_0xd46e('0x42')]);var _0x54949f={'where':_0x45ea47[_0xd46e('0x3c')]};return db[_0xd46e('0x2e')]['count'](_0x54949f)[_0xd46e('0x25')](function(_0x4114e6){_0x504324[_0xd46e('0x43')]=_0x4114e6;if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x44')]){_0x45ea47[_0xd46e('0x45')]=[{'all':!![]}];}return db[_0xd46e('0x2e')][_0xd46e('0x46')](_0x45ea47);})[_0xd46e('0x25')](function(_0xec367d){_0x504324[_0xd46e('0x47')]=_0xec367d;return _0x504324;})['then'](respondWithFilteredResult(_0x18f060,_0x45ea47))['catch'](handleError(_0x18f060,null));};exports['show']=function(_0x2b4a5a,_0x4e1d94){var _0x168d35={'raw':![],'where':{'id':_0x2b4a5a[_0xd46e('0x48')]['id']}},_0x272f5f={};_0x272f5f[_0xd46e('0x32')]=_[_0xd46e('0x49')](db[_0xd46e('0x2e')][_0xd46e('0x2f')]);_0x272f5f[_0xd46e('0x33')]=_['keys'](_0x2b4a5a[_0xd46e('0x33')]);_0x272f5f['filters']=_[_0xd46e('0x35')](_0x272f5f[_0xd46e('0x32')],_0x272f5f[_0xd46e('0x33')]);_0x168d35[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x272f5f['model'],qs[_0xd46e('0x37')](_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x37')]));_0x168d35[_0xd46e('0x36')]=_0x168d35[_0xd46e('0x36')]['length']?_0x168d35[_0xd46e('0x36')]:_0x272f5f[_0xd46e('0x32')];if(_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x44')]){_0x168d35[_0xd46e('0x45')]=[{'all':!![]}];}_0x168d35=_['merge']({},_0x168d35,_0x2b4a5a[_0xd46e('0x42')]);return db[_0xd46e('0x2e')][_0xd46e('0x4a')](_0x168d35)[_0xd46e('0x25')](handleEntityNotFound(_0x4e1d94,null))[_0xd46e('0x25')](respondWithResult(_0x4e1d94,null))[_0xd46e('0x4b')](handleError(_0x4e1d94,null));};exports[_0xd46e('0x4c')]=function(_0x440dcc,_0x5188f6){return db[_0xd46e('0x2e')][_0xd46e('0x4c')](_0x440dcc[_0xd46e('0x4d')],{})[_0xd46e('0x25')](function(_0x1f1941){var _0x4e84c8=_0x440dcc['user'][_0xd46e('0x4e')]({'plain':!![]});if(!_0x4e84c8)throw new Error(_0xd46e('0x4f'));if(_0x4e84c8[_0xd46e('0x50')]==='user'){var _0x479711=_0x1f1941[_0xd46e('0x4e')]({'plain':!![]});var _0x9d8638='Scheduler';return db[_0xd46e('0x51')][_0xd46e('0x4a')]({'where':{'name':_0x9d8638,'userProfileId':_0x4e84c8[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x25')](function(_0x1bd8a5){if(_0x1bd8a5&&_0x1bd8a5[_0xd46e('0x53')]===0x0){return db[_0xd46e('0x27')][_0xd46e('0x4c')]({'name':_0x479711['name'],'resourceId':_0x479711['id'],'type':_0x1bd8a5[_0xd46e('0x2b')],'sectionId':_0x1bd8a5['id']},{})[_0xd46e('0x25')](function(){return _0x1f1941;});}else{return _0x1f1941;}})[_0xd46e('0x4b')](function(_0x63ee74){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x63ee74);throw _0x63ee74;});}return _0x1f1941;})[_0xd46e('0x25')](respondWithResult(_0x5188f6,0xc9))['catch'](handleError(_0x5188f6,null));};exports[_0xd46e('0x24')]=function(_0x2af20b,_0x393cb9){if(_0x2af20b[_0xd46e('0x4d')]['id']){delete _0x2af20b[_0xd46e('0x4d')]['id'];}return db[_0xd46e('0x2e')]['find']({'where':{'id':_0x2af20b[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x393cb9,null))[_0xd46e('0x25')](saveUpdates(_0x2af20b['body'],null))[_0xd46e('0x25')](respondWithResult(_0x393cb9,null))[_0xd46e('0x4b')](handleError(_0x393cb9,null));};exports[_0xd46e('0x28')]=function(_0x2042d4,_0x1886e6){return db[_0xd46e('0x2e')][_0xd46e('0x4a')]({'where':{'id':_0x2042d4[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x1886e6,null))[_0xd46e('0x25')](removeEntity(_0x1886e6,null))[_0xd46e('0x4b')](handleError(_0x1886e6,null));};exports[_0xd46e('0x54')]=function(_0x2bcb2b,_0x402df2,_0x47a86c){var _0x3ec709=require(_0xd46e('0x55'));return db[_0xd46e('0x2e')][_0xd46e('0x4a')]({'where':{'id':_0x2bcb2b['params']['id']},'raw':!![]})[_0xd46e('0x25')](handleEntityNotFound(_0x402df2,null))[_0xd46e('0x25')](function(){_0x3ec709[_0xd46e('0x54')](_0x2bcb2b[_0xd46e('0x48')]['id']);})['then'](respondWithStatusCode(_0x402df2,null))[_0xd46e('0x4b')](handleError(_0x402df2,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 8f924f4..95f91d3 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 _0x15df=['./schedule.attributes','exports','tools_schedules','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x15df,0x93));var _0xf15d=function(_0x3c4fac,_0x43e2f2){_0x3c4fac=_0x3c4fac-0x0;var _0x1c1885=_0x15df[_0x3c4fac];return _0x1c1885;};'use strict';var _=require(_0xf15d('0x0'));var util=require(_0xf15d('0x1'));var logger=require(_0xf15d('0x2'))(_0xf15d('0x3'));var moment=require('moment');var BPromise=require(_0xf15d('0x4'));var rp=require(_0xf15d('0x5'));var fs=require('fs');var path=require(_0xf15d('0x6'));var rimraf=require(_0xf15d('0x7'));var config=require(_0xf15d('0x8'));var attributes=require(_0xf15d('0x9'));module[_0xf15d('0xa')]=function(_0x5db297,_0x1b8ff8){return _0x5db297['define']('Schedule',attributes,{'tableName':_0xf15d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad33=['Schedule','tools_schedules','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./schedule.attributes','exports','define'];(function(_0x957739,_0x2785ef){var _0x11c46a=function(_0x2f2183){while(--_0x2f2183){_0x957739['push'](_0x957739['shift']());}};_0x11c46a(++_0x2785ef);}(_0xad33,0x154));var _0x3ad3=function(_0x53feda,_0x8d5d13){_0x53feda=_0x53feda-0x0;var _0x2c0b4f=_0xad33[_0x53feda];return _0x2c0b4f;};'use strict';var _=require(_0x3ad3('0x0'));var util=require(_0x3ad3('0x1'));var logger=require('../../config/logger')(_0x3ad3('0x2'));var moment=require(_0x3ad3('0x3'));var BPromise=require(_0x3ad3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ad3('0x5'));var rimraf=require(_0x3ad3('0x6'));var config=require(_0x3ad3('0x7'));var attributes=require(_0x3ad3('0x8'));module[_0x3ad3('0x9')]=function(_0x11b3a0,_0x4e5578){return _0x11b3a0[_0x3ad3('0xa')](_0x3ad3('0xb'),attributes,{'tableName':_0x3ad3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 08028c6..67b3deb 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 _0xcc0e=['stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x90bcb7,_0x95ca94){var _0x5a980d=function(_0x25b0c5){while(--_0x25b0c5){_0x90bcb7['push'](_0x90bcb7['shift']());}};_0x5a980d(++_0x95ca94);}(_0xcc0e,0x1bc));var _0xecc0=function(_0x437051,_0x1d79cf){_0x437051=_0x437051-0x0;var _0x29aaee=_0xcc0e[_0x437051];return _0x29aaee;};'use strict';var _=require(_0xecc0('0x0'));var util=require(_0xecc0('0x1'));var moment=require('moment');var BPromise=require(_0xecc0('0x2'));var rs=require(_0xecc0('0x3'));var fs=require('fs');var Redis=require(_0xecc0('0x4'));var db=require(_0xecc0('0x5'))['db'];var utils=require(_0xecc0('0x6'));var logger=require('../../config/logger')(_0xecc0('0x7'));var config=require(_0xecc0('0x8'));var jayson=require(_0xecc0('0x9'));var client=jayson['client'][_0xecc0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x449b73,_0x7bd603,_0x3d8602){return new BPromise(function(_0x2da686,_0x3713b1){return client['request'](_0x449b73,_0x3d8602)[_0xecc0('0xb')](function(_0x5f1804){logger['info'](_0xecc0('0xc'),_0x7bd603,_0xecc0('0xd'));logger[_0xecc0('0xe')](_0xecc0('0xf'),_0x7bd603,_0xecc0('0xd'),JSON[_0xecc0('0x10')](_0x5f1804));if(_0x5f1804['error']){if(_0x5f1804[_0xecc0('0x11')][_0xecc0('0x12')]===0x1f4){logger[_0xecc0('0x11')](_0xecc0('0xc'),_0x7bd603,_0x5f1804[_0xecc0('0x11')][_0xecc0('0x13')]);return _0x3713b1(_0x5f1804[_0xecc0('0x11')][_0xecc0('0x13')]);}logger[_0xecc0('0x11')](_0xecc0('0xc'),_0x7bd603,_0x5f1804[_0xecc0('0x11')][_0xecc0('0x13')]);return _0x2da686(_0x5f1804[_0xecc0('0x11')][_0xecc0('0x13')]);}else{logger[_0xecc0('0x14')](_0xecc0('0xc'),_0x7bd603,'request\x20sent');_0x2da686(_0x5f1804[_0xecc0('0x15')][_0xecc0('0x13')]);}})[_0xecc0('0x16')](function(_0x2712e0){logger[_0xecc0('0x11')](_0xecc0('0xc'),_0x7bd603,_0x2712e0);_0x3713b1(_0x2712e0);});});} \ No newline at end of file +var _0xbb02=['client','http','request','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0xbb02,0x98));var _0x2bb0=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbb02[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x2bb0('0x0'));var moment=require(_0x2bb0('0x1'));var BPromise=require(_0x2bb0('0x2'));var rs=require(_0x2bb0('0x3'));var fs=require('fs');var Redis=require(_0x2bb0('0x4'));var db=require(_0x2bb0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2bb0('0x6'));var config=require(_0x2bb0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2bb0('0x8')][_0x2bb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b4cc5,_0x256e4d,_0x48db70){return new BPromise(function(_0x4855ab,_0x3f93db){return client[_0x2bb0('0xa')](_0x5b4cc5,_0x48db70)['then'](function(_0x25a2c0){logger[_0x2bb0('0xb')](_0x2bb0('0xc'),_0x256e4d,'request\x20sent');logger[_0x2bb0('0xd')](_0x2bb0('0xe'),_0x256e4d,_0x2bb0('0xf'),JSON[_0x2bb0('0x10')](_0x25a2c0));if(_0x25a2c0['error']){if(_0x25a2c0[_0x2bb0('0x11')]['code']===0x1f4){logger['error'](_0x2bb0('0xc'),_0x256e4d,_0x25a2c0[_0x2bb0('0x11')][_0x2bb0('0x12')]);return _0x3f93db(_0x25a2c0['error'][_0x2bb0('0x12')]);}logger['error'](_0x2bb0('0xc'),_0x256e4d,_0x25a2c0['error']['message']);return _0x4855ab(_0x25a2c0[_0x2bb0('0x11')]['message']);}else{logger[_0x2bb0('0xb')](_0x2bb0('0xc'),_0x256e4d,_0x2bb0('0xf'));_0x4855ab(_0x25a2c0['result'][_0x2bb0('0x12')]);}})[_0x2bb0('0x13')](function(_0x49c887){logger['error'](_0x2bb0('0xc'),_0x256e4d,_0x49c887);_0x3f93db(_0x49c887);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 63d39d2..2fb6bb1 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 _0xc26e=['show','/:id/download','download','post','put','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x3c126c,_0x22f353){var _0x3b89e4=function(_0x1472c0){while(--_0x1472c0){_0x3c126c['push'](_0x3c126c['shift']());}};_0x3b89e4(++_0x22f353);}(_0xc26e,0x1ab));var _0xec26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xec26('0x0'));var util=require(_0xec26('0x1'));var path=require(_0xec26('0x2'));var timeout=require('connect-timeout');var express=require(_0xec26('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xec26('0x4'));var interaction=require(_0xec26('0x5'));var config=require(_0xec26('0x6'));var controller=require(_0xec26('0x7'));router[_0xec26('0x8')]('/',auth[_0xec26('0x9')](),controller[_0xec26('0xa')]);router[_0xec26('0x8')](_0xec26('0xb'),auth[_0xec26('0x9')](),controller['describe']);router['get'](_0xec26('0xc'),auth[_0xec26('0x9')](),controller[_0xec26('0xd')]);router['get'](_0xec26('0xe'),auth[_0xec26('0x9')](),controller[_0xec26('0xf')]);router[_0xec26('0x10')]('/',auth[_0xec26('0x9')](),controller['create']);router[_0xec26('0x11')](_0xec26('0xc'),auth[_0xec26('0x9')](),controller['update']);router[_0xec26('0x12')](_0xec26('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xec26('0x13')]=router; \ No newline at end of file +var _0x00b4=['../../config/environment','./screenRecording.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','create','put','update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x00b4,0x18a));var _0x400b=function(_0x21df39,_0x432f7b){_0x21df39=_0x21df39-0x0;var _0x11b500=_0x00b4[_0x21df39];return _0x11b500;};'use strict';var multer=require(_0x400b('0x0'));var util=require(_0x400b('0x1'));var path=require('path');var timeout=require(_0x400b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x400b('0x3'));var auth=require(_0x400b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x400b('0x5'));var controller=require(_0x400b('0x6'));router[_0x400b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x400b('0x7')](_0x400b('0x8'),auth[_0x400b('0x9')](),controller[_0x400b('0xa')]);router[_0x400b('0x7')](_0x400b('0xb'),auth[_0x400b('0x9')](),controller[_0x400b('0xc')]);router[_0x400b('0x7')](_0x400b('0xd'),auth[_0x400b('0x9')](),controller[_0x400b('0xe')]);router[_0x400b('0xf')]('/',auth[_0x400b('0x9')](),controller[_0x400b('0x10')]);router[_0x400b('0x11')](_0x400b('0xb'),auth[_0x400b('0x9')](),controller[_0x400b('0x12')]);router['delete'](_0x400b('0xb'),auth[_0x400b('0x9')](),controller[_0x400b('0x13')]);module[_0x400b('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 68047ce..8a3aa2b 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 _0x038b=['value','extname','STRING','replace','INTEGER','startedAt','subtract','closedAt','setDataValue','duration','DATE','getDataValue','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','moment','path','../../config/environment','VIRTUAL'];(function(_0x1cea3e,_0x384d0f){var _0x47154b=function(_0x4c7c7c){while(--_0x4c7c7c){_0x1cea3e['push'](_0x1cea3e['shift']());}};_0x47154b(++_0x384d0f);}(_0x038b,0x114));var _0xb038=function(_0x599999,_0x136f48){_0x599999=_0x599999-0x0;var _0x474277=_0x038b[_0x599999];return _0x474277;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var config=require(_0xb038('0x2'));module['exports']={'format':{'type':Sequelize[_0xb038('0x3')],'get':function(){return this['getDataValue'](_0xb038('0x4'))?path[_0xb038('0x5')](this['getDataValue'](_0xb038('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xb038('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x2e3e64){var _0x1b077a=_0x2e3e64[_0xb038('0x7')](/\\/g,'/');this['setDataValue']('value',_0x1b077a);}},'rating':{'type':Sequelize[_0xb038('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xb038('0x8')],'set':function(_0x4d85b4){this['setDataValue'](_0xb038('0x9'),moment()[_0xb038('0xa')](_0x4d85b4,'ms'));this['setDataValue'](_0xb038('0xb'),moment());this[_0xb038('0xc')](_0xb038('0xd'),_0x4d85b4);}},'startedAt':{'type':Sequelize[_0xb038('0xe')],'get':function(){return moment(this[_0xb038('0xf')](_0xb038('0x9')))[_0xb038('0x10')](_0xb038('0x11'))[_0xb038('0x12')]();}},'closedAt':{'type':Sequelize[_0xb038('0xe')],'get':function(){return moment(this[_0xb038('0xf')](_0xb038('0xb')))[_0xb038('0x10')](_0xb038('0x11'))[_0xb038('0x12')]();}},'createdAt':{'type':Sequelize[_0xb038('0xe')],'get':function(){return moment(this[_0xb038('0xf')]('createdAt'))[_0xb038('0x10')](_0xb038('0x11'))[_0xb038('0x12')]();}},'updatedAt':{'type':Sequelize[_0xb038('0xe')],'get':function(){return moment(this[_0xb038('0xf')](_0xb038('0x13')))['format'](_0xb038('0x11'))[_0xb038('0x12')]();}}}; \ No newline at end of file +var _0x7da7=['startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','VIRTUAL','getDataValue','extname','STRING','replace','setDataValue','value','INTEGER'];(function(_0x5e59d9,_0x550387){var _0x491f76=function(_0x445f9e){while(--_0x445f9e){_0x5e59d9['push'](_0x5e59d9['shift']());}};_0x491f76(++_0x550387);}(_0x7da7,0x10d));var _0x77da=function(_0x420d8d,_0x78b67f){_0x420d8d=_0x420d8d-0x0;var _0x4865d7=_0x7da7[_0x420d8d];return _0x4865d7;};'use strict';var Sequelize=require(_0x77da('0x0'));var moment=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x77da('0x3')],'get':function(){return this[_0x77da('0x4')]('value')?path[_0x77da('0x5')](this[_0x77da('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x77da('0x6')]},'channel':{'type':Sequelize[_0x77da('0x6')]},'value':{'type':Sequelize['STRING'],'set':function(_0x30afe0){var _0x47cf1d=_0x30afe0[_0x77da('0x7')](/\\/g,'/');this[_0x77da('0x8')](_0x77da('0x9'),_0x47cf1d);}},'rating':{'type':Sequelize[_0x77da('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x77da('0xa')],'set':function(_0x58f3fe){this[_0x77da('0x8')](_0x77da('0xb'),moment()[_0x77da('0xc')](_0x58f3fe,'ms'));this['setDataValue'](_0x77da('0xd'),moment());this[_0x77da('0x8')](_0x77da('0xe'),_0x58f3fe);}},'startedAt':{'type':Sequelize[_0x77da('0xf')],'get':function(){return moment(this['getDataValue'](_0x77da('0xb')))[_0x77da('0x10')](_0x77da('0x11'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x77da('0x4')](_0x77da('0xd')))['format'](_0x77da('0x11'))[_0x77da('0x12')]();}},'createdAt':{'type':Sequelize[_0x77da('0xf')],'get':function(){return moment(this[_0x77da('0x4')]('createdAt'))[_0x77da('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x77da('0x12')]();}},'updatedAt':{'type':Sequelize[_0x77da('0xf')],'get':function(){return moment(this[_0x77da('0x4')](_0x77da('0x13')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 8de8e81..2fe07c5 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 _0x5b44=['Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','create','body','duration','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','find','root','server/files/screen_recordings','existsSync','decryptFile','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','isNil','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x2245d7,_0x92dad1){var _0x32459e=function(_0xb0ce3){while(--_0xb0ce3){_0x2245d7['push'](_0x2245d7['shift']());}};_0x32459e(++_0x92dad1);}(_0x5b44,0x116));var _0x45b4=function(_0x50ea97,_0x5e3fd2){_0x50ea97=_0x50ea97-0x0;var _0x5453f8=_0x5b44[_0x50ea97];return _0x5453f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x45b4('0x0'));var zipdir=require(_0x45b4('0x1'));var jsonpatch=require(_0x45b4('0x2'));var rp=require(_0x45b4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x45b4('0x4'));var util=require(_0x45b4('0x5'));var path=require('path');var sox=require(_0x45b4('0x6'));var csv=require(_0x45b4('0x7'));var ejs=require(_0x45b4('0x8'));var fs=require('fs');var fs_extra=require(_0x45b4('0x9'));var _=require(_0x45b4('0xa'));var squel=require(_0x45b4('0xb'));var crypto=require(_0x45b4('0xc'));var jsforce=require(_0x45b4('0xd'));var deskjs=require(_0x45b4('0xe'));var toCsv=require(_0x45b4('0x7'));var querystring=require(_0x45b4('0xf'));var Papa=require(_0x45b4('0x10'));var Redis=require(_0x45b4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x45b4('0x12'));var as=require(_0x45b4('0x13'));var hardwareService=require(_0x45b4('0x14'));var logger=require('../../config/logger')(_0x45b4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x45b4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a2809,_0x469687){_0x469687=_0x469687||0xcc;return function(_0x2e94cd){if(_0x2e94cd){return _0x2a2809[_0x45b4('0x17')](_0x469687);}return _0x2a2809[_0x45b4('0x18')](_0x469687)[_0x45b4('0x19')]();};}function respondWithResult(_0x5be398,_0x76640e){_0x76640e=_0x76640e||0xc8;return function(_0xf0d021){if(_0xf0d021){return _0x5be398[_0x45b4('0x18')](_0x76640e)['json'](_0xf0d021);}};}function respondWithFilteredResult(_0x504e75,_0x27aa08){return function(_0xed8ab1){if(_0xed8ab1){var _0x3dbd6f=typeof _0x27aa08[_0x45b4('0x1a')]===_0x45b4('0x1b')&&typeof _0x27aa08[_0x45b4('0x1c')]===_0x45b4('0x1b');var _0x9fb24d=_0xed8ab1[_0x45b4('0x1d')];var _0x7a3edc=_0x3dbd6f?0x0:_0x27aa08[_0x45b4('0x1a')];var _0x5e8a84=_0x3dbd6f?_0xed8ab1[_0x45b4('0x1d')]:_0x27aa08[_0x45b4('0x1a')]+_0x27aa08[_0x45b4('0x1c')];var _0xad9b4d;if(_0x5e8a84>=_0x9fb24d){_0x5e8a84=_0x9fb24d;_0xad9b4d=0xc8;}else{_0xad9b4d=0xce;}_0x504e75[_0x45b4('0x18')](_0xad9b4d);return _0x504e75[_0x45b4('0x1e')](_0x45b4('0x1f'),_0x7a3edc+'-'+_0x5e8a84+'/'+_0x9fb24d)[_0x45b4('0x20')](_0xed8ab1);}return null;};}function patchUpdates(_0xd4129a){return function(_0x46eac){try{jsonpatch['apply'](_0x46eac,_0xd4129a,!![]);}catch(_0x1664b8){return BPromise[_0x45b4('0x21')](_0x1664b8);}return _0x46eac[_0x45b4('0x22')]();};}function saveUpdates(_0x33dd6c,_0x2fab51){return function(_0x5eda5e){if(_0x5eda5e){return _0x5eda5e['update'](_0x33dd6c)[_0x45b4('0x23')](function(_0x9150da){return _0x9150da;});}return null;};}function removeEntity(_0xc83448,_0x43a5c0){return function(_0x396e29){if(_0x396e29){return _0x396e29[_0x45b4('0x24')]()[_0x45b4('0x23')](function(){_0xc83448['status'](0xcc)[_0x45b4('0x19')]();});}};}function handleEntityNotFound(_0x1413c8,_0x5cdbf9){return function(_0x5a7d73){if(!_0x5a7d73){_0x1413c8[_0x45b4('0x17')](0x194);}return _0x5a7d73;};}function handleError(_0x15af91,_0x2be000){_0x2be000=_0x2be000||0x1f4;return function(_0x1c34e5){logger[_0x45b4('0x25')](_0x1c34e5[_0x45b4('0x26')]);if(_0x1c34e5['name']){delete _0x1c34e5[_0x45b4('0x27')];}_0x15af91[_0x45b4('0x18')](_0x2be000)[_0x45b4('0x28')](_0x1c34e5);};}exports[_0x45b4('0x29')]=function(_0x316b2a,_0x50c1db){var _0x3e4c40={},_0x5a7fe4={},_0x5e9a0b={'count':0x0,'rows':[]};var _0x42f6a6=_[_0x45b4('0x2a')](db[_0x45b4('0x2b')][_0x45b4('0x2c')],function(_0x4900b9){return{'name':_0x4900b9[_0x45b4('0x2d')],'type':_0x4900b9[_0x45b4('0x2e')][_0x45b4('0x2f')]};});_0x5a7fe4[_0x45b4('0x30')]=_[_0x45b4('0x31')](_['map'](_0x42f6a6,_0x45b4('0x27')),[_0x45b4('0x32')]);_0x5a7fe4[_0x45b4('0x33')]=_[_0x45b4('0x34')](_0x316b2a[_0x45b4('0x33')]);_0x5a7fe4[_0x45b4('0x35')]=_[_0x45b4('0x36')](_0x5a7fe4[_0x45b4('0x30')],_0x5a7fe4[_0x45b4('0x33')]);_0x3e4c40[_0x45b4('0x37')]=_[_0x45b4('0x36')](_0x5a7fe4[_0x45b4('0x30')],qs[_0x45b4('0x38')](_0x316b2a[_0x45b4('0x33')][_0x45b4('0x38')]));_0x3e4c40[_0x45b4('0x37')]=_0x3e4c40['attributes']['length']?_0x3e4c40['attributes']:_0x5a7fe4[_0x45b4('0x30')];if(!_0x316b2a[_0x45b4('0x33')][_0x45b4('0x39')]('nolimit')){_0x3e4c40[_0x45b4('0x1c')]=qs[_0x45b4('0x1c')](_0x316b2a['query']['limit']);_0x3e4c40[_0x45b4('0x1a')]=qs[_0x45b4('0x1a')](_0x316b2a[_0x45b4('0x33')]['offset']);}_0x3e4c40[_0x45b4('0x3a')]=qs[_0x45b4('0x3b')](_0x316b2a[_0x45b4('0x33')][_0x45b4('0x3b')]);_0x3e4c40[_0x45b4('0x3c')]=qs['filters'](_['pick'](_0x316b2a[_0x45b4('0x33')],_0x5a7fe4[_0x45b4('0x35')]),_0x42f6a6);if(_0x316b2a[_0x45b4('0x33')][_0x45b4('0x3d')]){_0x3e4c40[_0x45b4('0x3c')]=_[_0x45b4('0x3e')](_0x3e4c40['where'],{'$or':_[_0x45b4('0x2a')](_0x42f6a6,function(_0x37cb71){if(_0x37cb71['type']!==_0x45b4('0x3f')){var _0x5d0429={};_0x5d0429[_0x37cb71[_0x45b4('0x27')]]={'$like':'%'+_0x316b2a[_0x45b4('0x33')][_0x45b4('0x3d')]+'%'};return _0x5d0429;}})});}_0x3e4c40=_['merge']({},_0x3e4c40,_0x316b2a[_0x45b4('0x40')]);var _0x2039cc={'where':_0x3e4c40[_0x45b4('0x3c')]};return db[_0x45b4('0x2b')]['count'](_0x2039cc)[_0x45b4('0x23')](function(_0x58bc09){_0x5e9a0b[_0x45b4('0x1d')]=_0x58bc09;if(_0x316b2a[_0x45b4('0x33')][_0x45b4('0x41')]){_0x3e4c40['include']=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x3e4c40);})[_0x45b4('0x23')](function(_0x1c7887){_0x5e9a0b[_0x45b4('0x42')]=_0x1c7887;return _0x5e9a0b;})[_0x45b4('0x23')](respondWithFilteredResult(_0x50c1db,_0x3e4c40))[_0x45b4('0x43')](handleError(_0x50c1db,null));};exports[_0x45b4('0x44')]=function(_0xf402ca,_0x515d5f){var _0x1ac118={'raw':![],'where':{'id':_0xf402ca['params']['id']}},_0x166ca7={};_0x166ca7[_0x45b4('0x30')]=_[_0x45b4('0x34')](db[_0x45b4('0x2b')][_0x45b4('0x2c')]);_0x166ca7[_0x45b4('0x33')]=_[_0x45b4('0x34')](_0xf402ca[_0x45b4('0x33')]);_0x166ca7[_0x45b4('0x35')]=_[_0x45b4('0x36')](_0x166ca7[_0x45b4('0x30')],_0x166ca7[_0x45b4('0x33')]);_0x1ac118['attributes']=_[_0x45b4('0x36')](_0x166ca7[_0x45b4('0x30')],qs[_0x45b4('0x38')](_0xf402ca[_0x45b4('0x33')]['fields']));_0x1ac118[_0x45b4('0x37')]=_0x1ac118['attributes'][_0x45b4('0x45')]?_0x1ac118[_0x45b4('0x37')]:_0x166ca7['model'];if(_0xf402ca[_0x45b4('0x33')][_0x45b4('0x41')]){_0x1ac118[_0x45b4('0x46')]=[{'all':!![]}];}_0x1ac118=_['merge']({},_0x1ac118,_0xf402ca[_0x45b4('0x40')]);return db[_0x45b4('0x2b')]['find'](_0x1ac118)['then'](handleEntityNotFound(_0x515d5f,null))[_0x45b4('0x23')](respondWithResult(_0x515d5f,null))[_0x45b4('0x43')](handleError(_0x515d5f,null));};exports[_0x45b4('0x47')]=function(_0xdd2e97,_0x3ffc59){return db[_0x45b4('0x2b')][_0x45b4('0x47')](_0xdd2e97['body'],{})[_0x45b4('0x23')](respondWithResult(_0x3ffc59,0xc9))[_0x45b4('0x43')](handleError(_0x3ffc59,null));};exports['update']=function(_0x5102a5,_0x31a4d5){if(_0x5102a5[_0x45b4('0x48')]['id']){delete _0x5102a5['body']['id'];}delete _0x5102a5[_0x45b4('0x48')][_0x45b4('0x49')];delete _0x5102a5[_0x45b4('0x48')][_0x45b4('0x4a')];delete _0x5102a5[_0x45b4('0x48')][_0x45b4('0x4b')];delete _0x5102a5[_0x45b4('0x48')][_0x45b4('0x4c')];return db[_0x45b4('0x2b')]['find']({'where':{'id':_0x5102a5[_0x45b4('0x4d')]['id']}})[_0x45b4('0x23')](handleEntityNotFound(_0x31a4d5,null))[_0x45b4('0x23')](saveUpdates(_0x5102a5[_0x45b4('0x48')],null))['then'](respondWithResult(_0x31a4d5,null))['catch'](handleError(_0x31a4d5,null));};exports[_0x45b4('0x4e')]=function(_0x30e0e4,_0x1214fc){return db[_0x45b4('0x2b')][_0x45b4('0x4e')]()[_0x45b4('0x23')](respondWithResult(_0x1214fc,null))[_0x45b4('0x43')](handleError(_0x1214fc,null));};exports[_0x45b4('0x4f')]=function(_0x99d013,_0x4b3eb4,_0x2ba891){var _0x491f28=require(_0x45b4('0x50'));var _0x38c3be=![];var _0x5ba1de={};if(_0x99d013['query'][_0x45b4('0x2e')]&&_0x99d013['query']['type']===_0x45b4('0x51')){_0x5ba1de[_0x45b4('0x51')]=_0x99d013[_0x45b4('0x4d')]['id'];}else{_0x5ba1de['id']=_0x99d013['params']['id'];}return db[_0x45b4('0x2b')][_0x45b4('0x52')]({'where':_0x5ba1de,'attributes':['id',_0x45b4('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x4b3eb4,null))[_0x45b4('0x23')](function(_0x438994){if(_0x438994){var _0x257fd0=path['join'](config[_0x45b4('0x53')],_0x45b4('0x54'),_0x438994['value']);var _0x1456b3=util[_0x45b4('0x32')]('%s.cypher',_0x257fd0);if(fs[_0x45b4('0x55')](_0x1456b3)){_0x38c3be=!![];return _0x491f28[_0x45b4('0x56')](_0x1456b3,_0x257fd0,config['secrets'][_0x45b4('0x57')])[_0x45b4('0x23')](function(){return _0x438994;});}return _0x438994;}})['then'](function(_0x4e7710){if(_0x4e7710){var _0x5de485=path['join'](config[_0x45b4('0x53')],'server/files/screen_recordings',_0x4e7710['value']);if(!fs['existsSync'](_0x5de485)){throw new db[(_0x45b4('0x58'))][(_0x45b4('0x59'))](_0x45b4('0x5a'));}if(_0x4e7710['filename']){return _0x4b3eb4['download'](_0x5de485,_0x4e7710[_0x45b4('0x5b')]+path[_0x45b4('0x5c')](_0x5de485),function(){if(_0x38c3be){fs[_0x45b4('0x5d')](_0x5de485);}});}else{return _0x4b3eb4[_0x45b4('0x4f')](_0x5de485,function(_0x5b02cc){if(_0x38c3be){fs[_0x45b4('0x5d')](_0x5de485);}});}}})[_0x45b4('0x43')](function(_0x1c7ead){if(_0x1c7ead[_0x45b4('0x5e')]==='ScreenRecording\x20not\x20found'){_0x4b3eb4[_0x45b4('0x18')](0x194)[_0x45b4('0x28')]('Not\x20found');}else{return handleError(_0x4b3eb4,null);}});};exports[_0x45b4('0x24')]=function(_0x526d39,_0x1bfd42){return db[_0x45b4('0x2b')][_0x45b4('0x52')]({'where':{'id':_0x526d39[_0x45b4('0x4d')]['id']}})['then'](function(_0x100aaf){if(_['isNil'](_0x100aaf)){throw new ReferenceError(_0x45b4('0x5f'));}return _0x100aaf;})[_0x45b4('0x23')](function(_0xb5c64b){var _0x1728a1=path['join'](config['root'],_0x45b4('0x54'),_0xb5c64b[_0x45b4('0x4c')]);logger[_0x45b4('0x60')](_0x45b4('0x61'),_0x1728a1);if(!_['isNil'](_0xb5c64b[_0x45b4('0x4c')])&&fs[_0x45b4('0x55')](_0x1728a1)){logger[_0x45b4('0x60')](_0x45b4('0x62')+_0x1728a1+_0x45b4('0x63'));fs['unlinkSync'](_0x1728a1);}_0x1728a1=_0x1728a1+_0x45b4('0x64');if(!_[_0x45b4('0x65')](_0xb5c64b[_0x45b4('0x4c')])&&fs[_0x45b4('0x55')](_0x1728a1)){logger[_0x45b4('0x60')]('File:\x20\x22'+_0x1728a1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x45b4('0x66')](_0x1728a1);}return _0xb5c64b;})[_0x45b4('0x23')](function(_0x1cc950){if(!_0x1cc950)throw new InternalError();return _0x1cc950[_0x45b4('0x24')]();})[_0x45b4('0x23')](function(){_0x1bfd42[_0x45b4('0x18')](0xcc)[_0x45b4('0x19')]();})[_0x45b4('0x43')](handleError(_0x1bfd42,null));}; \ No newline at end of file +var _0x93dc=['send','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','show','params','create','body','createdAt','closedAt','value','find','describe','catch','../../components/encryptor','uniqueid','join','root','%s.cypher','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname','unlink','Not\x20found','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','eml-format','rimraf','zip-dir','request-promise','bluebird','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','update','then','destroy','error','stack','name'];(function(_0x47241a,_0x1907c6){var _0x4f5df5=function(_0x5221bf){while(--_0x5221bf){_0x47241a['push'](_0x47241a['shift']());}};_0x4f5df5(++_0x1907c6);}(_0x93dc,0xfc));var _0xc93d=function(_0x174fa8,_0x1c00c4){_0x174fa8=_0x174fa8-0x0;var _0x4da512=_0x93dc[_0x174fa8];return _0x4da512;};'use strict';var emlformat=require(_0xc93d('0x0'));var rimraf=require(_0xc93d('0x1'));var zipdir=require(_0xc93d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc93d('0x3'));var moment=require('moment');var BPromise=require(_0xc93d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc93d('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc93d('0x6'));var _=require(_0xc93d('0x7'));var squel=require(_0xc93d('0x8'));var crypto=require(_0xc93d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc93d('0xa'));var toCsv=require(_0xc93d('0x5'));var querystring=require(_0xc93d('0xb'));var Papa=require(_0xc93d('0xc'));var Redis=require(_0xc93d('0xd'));var authService=require(_0xc93d('0xe'));var qs=require(_0xc93d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc93d('0x10'));var logger=require(_0xc93d('0x11'))(_0xc93d('0x12'));var utils=require(_0xc93d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc93d('0x14'));var db=require(_0xc93d('0x15'))['db'];function respondWithStatusCode(_0x58233e,_0x33dd3c){_0x33dd3c=_0x33dd3c||0xcc;return function(_0x2b06aa){if(_0x2b06aa){return _0x58233e[_0xc93d('0x16')](_0x33dd3c);}return _0x58233e[_0xc93d('0x17')](_0x33dd3c)[_0xc93d('0x18')]();};}function respondWithResult(_0x5f1c7c,_0x395ca4){_0x395ca4=_0x395ca4||0xc8;return function(_0x3f7f0a){if(_0x3f7f0a){return _0x5f1c7c[_0xc93d('0x17')](_0x395ca4)['json'](_0x3f7f0a);}};}function respondWithFilteredResult(_0x36cfda,_0x2e5a7b){return function(_0x234a24){if(_0x234a24){var _0xb38f85=typeof _0x2e5a7b[_0xc93d('0x19')]==='undefined'&&typeof _0x2e5a7b[_0xc93d('0x1a')]===_0xc93d('0x1b');var _0x945f3a=_0x234a24[_0xc93d('0x1c')];var _0x149f5f=_0xb38f85?0x0:_0x2e5a7b[_0xc93d('0x19')];var _0x20342e=_0xb38f85?_0x234a24[_0xc93d('0x1c')]:_0x2e5a7b[_0xc93d('0x19')]+_0x2e5a7b[_0xc93d('0x1a')];var _0x5b0d2c;if(_0x20342e>=_0x945f3a){_0x20342e=_0x945f3a;_0x5b0d2c=0xc8;}else{_0x5b0d2c=0xce;}_0x36cfda[_0xc93d('0x17')](_0x5b0d2c);return _0x36cfda[_0xc93d('0x1d')]('Content-Range',_0x149f5f+'-'+_0x20342e+'/'+_0x945f3a)['json'](_0x234a24);}return null;};}function patchUpdates(_0x21150b){return function(_0x403d1c){try{jsonpatch['apply'](_0x403d1c,_0x21150b,!![]);}catch(_0x431393){return BPromise['reject'](_0x431393);}return _0x403d1c['save']();};}function saveUpdates(_0x3ef375,_0x9ba2bc){return function(_0x2d7c81){if(_0x2d7c81){return _0x2d7c81[_0xc93d('0x1e')](_0x3ef375)[_0xc93d('0x1f')](function(_0x1a03de){return _0x1a03de;});}return null;};}function removeEntity(_0x1b4eca,_0x1db0dc){return function(_0x1f2c1c){if(_0x1f2c1c){return _0x1f2c1c[_0xc93d('0x20')]()['then'](function(){_0x1b4eca['status'](0xcc)[_0xc93d('0x18')]();});}};}function handleEntityNotFound(_0x1f5838,_0x270b4a){return function(_0x35934d){if(!_0x35934d){_0x1f5838['sendStatus'](0x194);}return _0x35934d;};}function handleError(_0x3d767b,_0x103f52){_0x103f52=_0x103f52||0x1f4;return function(_0x3a1559){logger[_0xc93d('0x21')](_0x3a1559[_0xc93d('0x22')]);if(_0x3a1559['name']){delete _0x3a1559[_0xc93d('0x23')];}_0x3d767b['status'](_0x103f52)[_0xc93d('0x24')](_0x3a1559);};}exports['index']=function(_0x2caaa1,_0x242033){var _0x308159={},_0x574940={},_0x4f4af4={'count':0x0,'rows':[]};var _0x27b93b=_['map'](db[_0xc93d('0x25')]['rawAttributes'],function(_0x2d45e2){return{'name':_0x2d45e2['fieldName'],'type':_0x2d45e2[_0xc93d('0x26')][_0xc93d('0x27')]};});_0x574940[_0xc93d('0x28')]=_[_0xc93d('0x29')](_['map'](_0x27b93b,_0xc93d('0x23')),[_0xc93d('0x2a')]);_0x574940[_0xc93d('0x2b')]=_[_0xc93d('0x2c')](_0x2caaa1[_0xc93d('0x2b')]);_0x574940[_0xc93d('0x2d')]=_[_0xc93d('0x2e')](_0x574940[_0xc93d('0x28')],_0x574940[_0xc93d('0x2b')]);_0x308159[_0xc93d('0x2f')]=_['intersection'](_0x574940[_0xc93d('0x28')],qs[_0xc93d('0x30')](_0x2caaa1[_0xc93d('0x2b')][_0xc93d('0x30')]));_0x308159[_0xc93d('0x2f')]=_0x308159[_0xc93d('0x2f')][_0xc93d('0x31')]?_0x308159['attributes']:_0x574940[_0xc93d('0x28')];if(!_0x2caaa1[_0xc93d('0x2b')][_0xc93d('0x32')](_0xc93d('0x33'))){_0x308159[_0xc93d('0x1a')]=qs['limit'](_0x2caaa1[_0xc93d('0x2b')][_0xc93d('0x1a')]);_0x308159['offset']=qs['offset'](_0x2caaa1['query'][_0xc93d('0x19')]);}_0x308159[_0xc93d('0x34')]=qs[_0xc93d('0x35')](_0x2caaa1[_0xc93d('0x2b')][_0xc93d('0x35')]);_0x308159[_0xc93d('0x36')]=qs['filters'](_[_0xc93d('0x37')](_0x2caaa1['query'],_0x574940[_0xc93d('0x2d')]),_0x27b93b);if(_0x2caaa1[_0xc93d('0x2b')][_0xc93d('0x38')]){_0x308159['where']=_[_0xc93d('0x39')](_0x308159[_0xc93d('0x36')],{'$or':_[_0xc93d('0x3a')](_0x27b93b,function(_0x199134){if(_0x199134[_0xc93d('0x26')]!=='VIRTUAL'){var _0x130c04={};_0x130c04[_0x199134[_0xc93d('0x23')]]={'$like':'%'+_0x2caaa1['query'][_0xc93d('0x38')]+'%'};return _0x130c04;}})});}_0x308159=_[_0xc93d('0x39')]({},_0x308159,_0x2caaa1[_0xc93d('0x3b')]);var _0x3abed={'where':_0x308159[_0xc93d('0x36')]};return db[_0xc93d('0x25')][_0xc93d('0x1c')](_0x3abed)['then'](function(_0xda07ea){_0x4f4af4[_0xc93d('0x1c')]=_0xda07ea;if(_0x2caaa1[_0xc93d('0x2b')][_0xc93d('0x3c')]){_0x308159[_0xc93d('0x3d')]=[{'all':!![]}];}return db[_0xc93d('0x25')][_0xc93d('0x3e')](_0x308159);})['then'](function(_0xab6288){_0x4f4af4[_0xc93d('0x3f')]=_0xab6288;return _0x4f4af4;})['then'](respondWithFilteredResult(_0x242033,_0x308159))['catch'](handleError(_0x242033,null));};exports[_0xc93d('0x40')]=function(_0x4fe4b2,_0x5114dd){var _0x288b20={'raw':![],'where':{'id':_0x4fe4b2[_0xc93d('0x41')]['id']}},_0x5bbaa7={};_0x5bbaa7['model']=_[_0xc93d('0x2c')](db[_0xc93d('0x25')]['rawAttributes']);_0x5bbaa7['query']=_[_0xc93d('0x2c')](_0x4fe4b2[_0xc93d('0x2b')]);_0x5bbaa7[_0xc93d('0x2d')]=_['intersection'](_0x5bbaa7[_0xc93d('0x28')],_0x5bbaa7[_0xc93d('0x2b')]);_0x288b20[_0xc93d('0x2f')]=_[_0xc93d('0x2e')](_0x5bbaa7[_0xc93d('0x28')],qs[_0xc93d('0x30')](_0x4fe4b2[_0xc93d('0x2b')]['fields']));_0x288b20[_0xc93d('0x2f')]=_0x288b20['attributes'][_0xc93d('0x31')]?_0x288b20[_0xc93d('0x2f')]:_0x5bbaa7['model'];if(_0x4fe4b2['query'][_0xc93d('0x3c')]){_0x288b20[_0xc93d('0x3d')]=[{'all':!![]}];}_0x288b20=_['merge']({},_0x288b20,_0x4fe4b2[_0xc93d('0x3b')]);return db['ScreenRecording']['find'](_0x288b20)[_0xc93d('0x1f')](handleEntityNotFound(_0x5114dd,null))[_0xc93d('0x1f')](respondWithResult(_0x5114dd,null))['catch'](handleError(_0x5114dd,null));};exports[_0xc93d('0x42')]=function(_0x2d3c73,_0x3b0336){return db[_0xc93d('0x25')][_0xc93d('0x42')](_0x2d3c73[_0xc93d('0x43')],{})[_0xc93d('0x1f')](respondWithResult(_0x3b0336,0xc9))['catch'](handleError(_0x3b0336,null));};exports[_0xc93d('0x1e')]=function(_0x15d260,_0x5c875c){if(_0x15d260['body']['id']){delete _0x15d260[_0xc93d('0x43')]['id'];}delete _0x15d260['body']['duration'];delete _0x15d260['body'][_0xc93d('0x44')];delete _0x15d260[_0xc93d('0x43')][_0xc93d('0x45')];delete _0x15d260[_0xc93d('0x43')][_0xc93d('0x46')];return db[_0xc93d('0x25')][_0xc93d('0x47')]({'where':{'id':_0x15d260[_0xc93d('0x41')]['id']}})[_0xc93d('0x1f')](handleEntityNotFound(_0x5c875c,null))[_0xc93d('0x1f')](saveUpdates(_0x15d260[_0xc93d('0x43')],null))[_0xc93d('0x1f')](respondWithResult(_0x5c875c,null))['catch'](handleError(_0x5c875c,null));};exports[_0xc93d('0x48')]=function(_0x153885,_0x14862b){return db['ScreenRecording']['describe']()[_0xc93d('0x1f')](respondWithResult(_0x14862b,null))[_0xc93d('0x49')](handleError(_0x14862b,null));};exports['download']=function(_0x1789fa,_0x3a2927,_0x5b4b0e){var _0x2e4826=require(_0xc93d('0x4a'));var _0x450ca9=![];var _0x5d00b5={};if(_0x1789fa[_0xc93d('0x2b')][_0xc93d('0x26')]&&_0x1789fa[_0xc93d('0x2b')][_0xc93d('0x26')]===_0xc93d('0x4b')){_0x5d00b5[_0xc93d('0x4b')]=_0x1789fa[_0xc93d('0x41')]['id'];}else{_0x5d00b5['id']=_0x1789fa[_0xc93d('0x41')]['id'];}return db[_0xc93d('0x25')][_0xc93d('0x47')]({'where':_0x5d00b5,'attributes':['id','value'],'raw':!![]})[_0xc93d('0x1f')](handleEntityNotFound(_0x3a2927,null))['then'](function(_0x14fcb5){if(_0x14fcb5){var _0x3717e1=path[_0xc93d('0x4c')](config[_0xc93d('0x4d')],'server/files/screen_recordings',_0x14fcb5[_0xc93d('0x46')]);var _0x4fc8d4=util[_0xc93d('0x2a')](_0xc93d('0x4e'),_0x3717e1);if(fs[_0xc93d('0x4f')](_0x4fc8d4)){_0x450ca9=!![];return _0x2e4826[_0xc93d('0x50')](_0x4fc8d4,_0x3717e1,config[_0xc93d('0x51')][_0xc93d('0x52')])['then'](function(){return _0x14fcb5;});}return _0x14fcb5;}})['then'](function(_0x2b6132){if(_0x2b6132){var _0x3ff95d=path['join'](config[_0xc93d('0x4d')],_0xc93d('0x53'),_0x2b6132['value']);if(!fs['existsSync'](_0x3ff95d)){throw new db['Sequelize'][(_0xc93d('0x54'))](_0xc93d('0x55'));}if(_0x2b6132[_0xc93d('0x56')]){return _0x3a2927[_0xc93d('0x57')](_0x3ff95d,_0x2b6132[_0xc93d('0x56')]+path[_0xc93d('0x58')](_0x3ff95d),function(){if(_0x450ca9){fs[_0xc93d('0x59')](_0x3ff95d);}});}else{return _0x3a2927[_0xc93d('0x57')](_0x3ff95d,function(_0x4f21d0){if(_0x450ca9){fs[_0xc93d('0x59')](_0x3ff95d);}});}}})['catch'](function(_0x479a75){if(_0x479a75['message']===_0xc93d('0x55')){_0x3a2927['status'](0x194)[_0xc93d('0x24')](_0xc93d('0x5a'));}else{return handleError(_0x3a2927,null);}});};exports[_0xc93d('0x20')]=function(_0x22efbd,_0x1133e6){return db[_0xc93d('0x25')][_0xc93d('0x47')]({'where':{'id':_0x22efbd[_0xc93d('0x41')]['id']}})[_0xc93d('0x1f')](function(_0x9f6bfc){if(_[_0xc93d('0x5b')](_0x9f6bfc)){throw new ReferenceError('Entity\x20not\x20found');}return _0x9f6bfc;})[_0xc93d('0x1f')](function(_0x488ff5){var _0x29613c=path[_0xc93d('0x4c')](config[_0xc93d('0x4d')],_0xc93d('0x53'),_0x488ff5[_0xc93d('0x46')]);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x29613c);if(!_[_0xc93d('0x5b')](_0x488ff5[_0xc93d('0x46')])&&fs[_0xc93d('0x4f')](_0x29613c)){logger[_0xc93d('0x5c')]('File:\x20\x22'+_0x29613c+_0xc93d('0x5d'));fs[_0xc93d('0x5e')](_0x29613c);}_0x29613c=_0x29613c+'.cypher';if(!_['isNil'](_0x488ff5['value'])&&fs[_0xc93d('0x4f')](_0x29613c)){logger[_0xc93d('0x5c')](_0xc93d('0x5f')+_0x29613c+_0xc93d('0x5d'));fs[_0xc93d('0x5e')](_0x29613c);}return _0x488ff5;})[_0xc93d('0x1f')](function(_0x403bb3){if(!_0x403bb3)throw new InternalError();return _0x403bb3['destroy']();})[_0xc93d('0x1f')](function(){_0x1133e6[_0xc93d('0x17')](0xcc)[_0xc93d('0x18')]();})[_0xc93d('0x49')](handleError(_0x1133e6,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 5b48666..2b13d3b 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 _0x9859=['bluebird','request-promise','rimraf','../../config/environment','exports','screen_recordings','interactionid','lodash','../../config/logger','api','moment'];(function(_0x21db13,_0x2b2d48){var _0x57aa14=function(_0x53b54b){while(--_0x53b54b){_0x21db13['push'](_0x21db13['shift']());}};_0x57aa14(++_0x2b2d48);}(_0x9859,0x6a));var _0x9985=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x9859[_0xfa634c];return _0x73e478;};'use strict';var _=require(_0x9985('0x0'));var util=require('util');var logger=require(_0x9985('0x1'))(_0x9985('0x2'));var moment=require(_0x9985('0x3'));var BPromise=require(_0x9985('0x4'));var rp=require(_0x9985('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9985('0x6'));var config=require(_0x9985('0x7'));var attributes=require('./screenRecording.attributes');module[_0x9985('0x8')]=function(_0x19f427,_0x6c6a64){return _0x19f427['define']('ScreenRecording',attributes,{'tableName':_0x9985('0x9'),'paranoid':![],'indexes':[{'name':_0x9985('0xa'),'fields':[_0x9985('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ffe=['./screenRecording.attributes','exports','define','screen_recordings','interactionid','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x418c91,_0x4fcfbc){var _0x1bbf20=function(_0x91aeab){while(--_0x91aeab){_0x418c91['push'](_0x418c91['shift']());}};_0x1bbf20(++_0x4fcfbc);}(_0x8ffe,0x1cc));var _0xe8ff=function(_0x23444a,_0x58d93e){_0x23444a=_0x23444a-0x0;var _0x5185bf=_0x8ffe[_0x23444a];return _0x5185bf;};'use strict';var _=require('lodash');var util=require(_0xe8ff('0x0'));var logger=require('../../config/logger')(_0xe8ff('0x1'));var moment=require(_0xe8ff('0x2'));var BPromise=require(_0xe8ff('0x3'));var rp=require(_0xe8ff('0x4'));var fs=require('fs');var path=require(_0xe8ff('0x5'));var rimraf=require(_0xe8ff('0x6'));var config=require(_0xe8ff('0x7'));var attributes=require(_0xe8ff('0x8'));module[_0xe8ff('0x9')]=function(_0x15b7a9,_0x32c2a8){return _0x15b7a9[_0xe8ff('0xa')]('ScreenRecording',attributes,{'tableName':_0xe8ff('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xe8ff('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 8e64021..9e72cbc 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(_0x2e44d9,_0x5b8272){var _0x386c44=function(_0x18e9f0){while(--_0x18e9f0){_0x2e44d9['push'](_0x2e44d9['shift']());}};_0x386c44(++_0x5b8272);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x13b0cc,_0x118ff2){var _0x2c9dee=function(_0x4beaa4){while(--_0x4beaa4){_0x13b0cc['push'](_0x13b0cc['shift']());}};_0x2c9dee(++_0x118ff2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 ed3ca86..49a390b 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 _0xa9e0=['addFavicon','put','isAuthenticated','update','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','originalname','post','single','addLogo','logologin','extname','file','addLogoLogin','preferred','addPreferred','%s%s','favicon'];(function(_0x51ab83,_0x2721b9){var _0x14b6de=function(_0x243483){while(--_0x243483){_0x51ab83['push'](_0x51ab83['shift']());}};_0x14b6de(++_0x2721b9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),controller['getDate']);router['get'](_0x0a9e('0xb'),controller['show']);router['get'](_0x0a9e('0xc'),controller[_0x0a9e('0xd')]);router[_0x0a9e('0x8')](_0x0a9e('0xe'),controller[_0x0a9e('0xf')]);router[_0x0a9e('0x8')]('/:id/gdpr',controller['gdpr']);router['get']('/:id/preferred',controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),controller[_0x0a9e('0x12')]);var upload=multer({'storage':multer[_0x0a9e('0x13')]({'destination':function(_0x69aeb7,_0x5db4b0,_0x4283ce){_0x4283ce(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x44dcfd,_0x4d5611,_0x52a03d){_0x52a03d(null,util[_0x0a9e('0x17')]('%s%s',_0x0a9e('0x18'),path['extname'](_0x4d5611[_0x0a9e('0x19')])));}})});router[_0x0a9e('0x1a')]('/:id/logo',upload[_0x0a9e('0x1b')]('file'),controller[_0x0a9e('0x1c')]);var upload=multer({'storage':multer[_0x0a9e('0x13')]({'destination':function(_0x106033,_0x205fd6,_0x31b1ca){_0x31b1ca(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x1314ae,_0x112016,_0x1c696a){_0x1c696a(null,util[_0x0a9e('0x17')]('%s%s',_0x0a9e('0x1d'),path[_0x0a9e('0x1e')](_0x112016['originalname'])));}})});router[_0x0a9e('0x1a')]('/:id/logo_login',upload['single'](_0x0a9e('0x1f')),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer[_0x0a9e('0x13')]({'destination':function(_0x30bae6,_0x4abc77,_0xfb6e48){_0xfb6e48(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x370d86,_0x42ac8f,_0x16b1ca){_0x16b1ca(null,util['format']('%s%s',_0x0a9e('0x21'),path[_0x0a9e('0x1e')](_0x42ac8f[_0x0a9e('0x19')])));}})});router[_0x0a9e('0x1a')]('/:id/preferred',upload[_0x0a9e('0x1b')]('file'),controller[_0x0a9e('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1dc186,_0x34dc65,_0x25fba9){_0x25fba9(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x11c3b6,_0x14de77,_0x5a101a){_0x5a101a(null,util[_0x0a9e('0x17')](_0x0a9e('0x23'),_0x0a9e('0x24'),path[_0x0a9e('0x1e')](_0x14de77['originalname'])));}})});router[_0x0a9e('0x1a')](_0x0a9e('0x11'),upload[_0x0a9e('0x1b')](_0x0a9e('0x1f')),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x26')](_0x0a9e('0xb'),auth[_0x0a9e('0x27')](),controller[_0x0a9e('0x28')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['addFavicon','put','isAuthenticated','update','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','originalname','post','single','addLogo','logologin','extname','file','addLogoLogin','preferred','addPreferred','%s%s','favicon'];(function(_0x3dc274,_0x46be09){var _0x1672f4=function(_0x4da3b5){while(--_0x4da3b5){_0x3dc274['push'](_0x3dc274['shift']());}};_0x1672f4(++_0x46be09);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),controller['getDate']);router['get'](_0x0a9e('0xb'),controller['show']);router['get'](_0x0a9e('0xc'),controller[_0x0a9e('0xd')]);router[_0x0a9e('0x8')](_0x0a9e('0xe'),controller[_0x0a9e('0xf')]);router[_0x0a9e('0x8')]('/:id/gdpr',controller['gdpr']);router['get']('/:id/preferred',controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),controller[_0x0a9e('0x12')]);var upload=multer({'storage':multer[_0x0a9e('0x13')]({'destination':function(_0x69aeb7,_0x5db4b0,_0x4283ce){_0x4283ce(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x44dcfd,_0x4d5611,_0x52a03d){_0x52a03d(null,util[_0x0a9e('0x17')]('%s%s',_0x0a9e('0x18'),path['extname'](_0x4d5611[_0x0a9e('0x19')])));}})});router[_0x0a9e('0x1a')]('/:id/logo',upload[_0x0a9e('0x1b')]('file'),controller[_0x0a9e('0x1c')]);var upload=multer({'storage':multer[_0x0a9e('0x13')]({'destination':function(_0x106033,_0x205fd6,_0x31b1ca){_0x31b1ca(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x1314ae,_0x112016,_0x1c696a){_0x1c696a(null,util[_0x0a9e('0x17')]('%s%s',_0x0a9e('0x1d'),path[_0x0a9e('0x1e')](_0x112016['originalname'])));}})});router[_0x0a9e('0x1a')]('/:id/logo_login',upload['single'](_0x0a9e('0x1f')),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer[_0x0a9e('0x13')]({'destination':function(_0x30bae6,_0x4abc77,_0xfb6e48){_0xfb6e48(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x370d86,_0x42ac8f,_0x16b1ca){_0x16b1ca(null,util['format']('%s%s',_0x0a9e('0x21'),path[_0x0a9e('0x1e')](_0x42ac8f[_0x0a9e('0x19')])));}})});router[_0x0a9e('0x1a')]('/:id/preferred',upload[_0x0a9e('0x1b')]('file'),controller[_0x0a9e('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1dc186,_0x34dc65,_0x25fba9){_0x25fba9(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x11c3b6,_0x14de77,_0x5a101a){_0x5a101a(null,util[_0x0a9e('0x17')](_0x0a9e('0x23'),_0x0a9e('0x24'),path[_0x0a9e('0x1e')](_0x14de77['originalname'])));}})});router[_0x0a9e('0x1a')](_0x0a9e('0x11'),upload[_0x0a9e('0x1b')](_0x0a9e('0x1f')),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x26')](_0x0a9e('0xb'),auth[_0x0a9e('0x27')](),controller[_0x0a9e('0x28')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 663bf7b..a114ae9 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 _0xe574=['/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED','exports','min_internal','INTEGER','min_mailbox','STRING'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0xe574,0x13f));var _0x4e57=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xe574[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require('sequelize');module[_0x4e57('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x4e57('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x4e57('0x2')](0xb),'unique':_0x4e57('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x4e57('0x4')],'defaultValue':_0x4e57('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x4e57('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x4e57('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x4e57('0x4')]},'turnaddr':{'type':Sequelize[_0x4e57('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x4e57('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x4e57('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x4e57('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x4e57('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x4e57('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x4e57('0x4')],'defaultValue':_0x4e57('0x7')},'chatTimeout':{'type':Sequelize[_0x4e57('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x4e57('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x4e57('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x4e57('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x4e57('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x4e57('0x4')]},'defaultFavicon':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x4e57('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x4e57('0x2')]},'transcribeRegion':{'type':Sequelize[_0x4e57('0x4')]},'sentiment':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x4e57('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x4e57('0x4')]},'bucket':{'type':Sequelize[_0x4e57('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x4e57('0x2')](0x2)[_0x4e57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x4e57('0x2')](0x2)[_0x4e57('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x4e57('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x4e57('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x4e57('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x4e57('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x4e57('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x0438=['alternate','UNSIGNED','sequelize','exports','min_internal','INTEGER','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN'];(function(_0x4ca536,_0x57c8de){var _0x3bd35f=function(_0x26d91d){while(--_0x26d91d){_0x4ca536['push'](_0x4ca536['shift']());}};_0x3bd35f(++_0x57c8de);}(_0x0438,0xb6));var _0x8043=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x0438[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0x8043('0x0'));module[_0x8043('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x8043('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x8043('0x3')](0xb),'unique':_0x8043('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x8043('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x8043('0x5')},'logo':{'type':Sequelize[_0x8043('0x6')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x8043('0x6')]},'defaultLoginLogo':{'type':Sequelize[_0x8043('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x8043('0x6')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x8043('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x8043('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x8043('0x6')]},'turnaddr':{'type':Sequelize[_0x8043('0x6')]},'turnusername':{'type':Sequelize[_0x8043('0x6')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x8043('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x8043('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x8043('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x8043('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x8043('0x6')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x8043('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x8043('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x8043('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x8043('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x8043('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x8043('0x6')],'defaultValue':_0x8043('0x8')},'chatTimeout':{'type':Sequelize[_0x8043('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x8043('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x8043('0x6')]},'defaultPreferred':{'type':Sequelize[_0x8043('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x8043('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x8043('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x8043('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x8043('0x6')]},'defaultFavicon':{'type':Sequelize[_0x8043('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x8043('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x8043('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x8043('0x3')]},'transcribeRegion':{'type':Sequelize[_0x8043('0x6')]},'sentiment':{'type':Sequelize[_0x8043('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x8043('0x6')]},'language':{'type':Sequelize[_0x8043('0x6')]},'bucket':{'type':Sequelize[_0x8043('0x6')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x8043('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x8043('0x3')](0x2)[_0x8043('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x8043('0x3')](0x2)[_0x8043('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x8043('0x3')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x8043('0x3')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x8043('0x3')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x8043('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x8043('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x8043('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x8043('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 6096c85..54c50e9 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 _0xf775=['join','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','defaultLoginLogo','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','preferred','default_preferred.png','default','addFavicon','getFavicon','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','then','info','request\x20sent','stringify','error','code','Setting,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','destroy','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','Setting','includeAll','include','rows','catch','show','params','options','find','body','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultPreferred','existsSync','root','toLower'];(function(_0x2db267,_0x4f43ff){var _0x194da3=function(_0x1d1728){while(--_0x1d1728){_0x2db267['push'](_0x2db267['shift']());}};_0x194da3(++_0x4f43ff);}(_0xf775,0x107));var _0x5f77=function(_0x3fcc8d,_0x1f0e71){_0x3fcc8d=_0x3fcc8d-0x0;var _0x238edb=_0xf775[_0x3fcc8d];return _0x238edb;};'use strict';var emlformat=require(_0x5f77('0x0'));var rimraf=require(_0x5f77('0x1'));var zipdir=require(_0x5f77('0x2'));var jsonpatch=require(_0x5f77('0x3'));var rp=require(_0x5f77('0x4'));var moment=require(_0x5f77('0x5'));var BPromise=require(_0x5f77('0x6'));var Mustache=require(_0x5f77('0x7'));var util=require(_0x5f77('0x8'));var path=require(_0x5f77('0x9'));var sox=require('sox');var csv=require(_0x5f77('0xa'));var ejs=require(_0x5f77('0xb'));var fs=require('fs');var fs_extra=require(_0x5f77('0xc'));var _=require(_0x5f77('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5f77('0xe'));var toCsv=require(_0x5f77('0xa'));var querystring=require(_0x5f77('0xf'));var Papa=require('papaparse');var Redis=require(_0x5f77('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5f77('0x11'));var as=require(_0x5f77('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f77('0x13'));var utils=require(_0x5f77('0x14'));var config=require(_0x5f77('0x15'));var licenseUtil=require(_0x5f77('0x16'));var db=require(_0x5f77('0x17'))['db'];var jayson=require(_0x5f77('0x18'));var client=jayson['client'][_0x5f77('0x19')]({'port':0x232a});function respondWithRpcPromise(_0xbbda5,_0x2e557a,_0x5bf4be,_0x183a20){return new BPromise(function(_0xb1d759,_0x2ff04b){var _0x5d2edf=_0x183a20||client;return _0x5d2edf['request'](_0xbbda5,_0x5bf4be)[_0x5f77('0x1a')](function(_0x2f0920){logger[_0x5f77('0x1b')]('Setting,\x20%s,\x20%s',_0x2e557a,_0x5f77('0x1c'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x2e557a,_0x5f77('0x1c'),JSON[_0x5f77('0x1d')](_0x2f0920));if(_0x2f0920[_0x5f77('0x1e')]){if(_0x2f0920['error'][_0x5f77('0x1f')]===0x1f4){logger[_0x5f77('0x1e')](_0x5f77('0x20'),_0x2e557a,_0x2f0920['error'][_0x5f77('0x21')]);return _0x2ff04b(_0x2f0920[_0x5f77('0x1e')]['message']);}logger[_0x5f77('0x1e')]('Setting,\x20%s,\x20%s',_0x2e557a,_0x2f0920[_0x5f77('0x1e')]['message']);return _0xb1d759(_0x2f0920[_0x5f77('0x1e')][_0x5f77('0x21')]);}else{logger['info'](_0x5f77('0x20'),_0x2e557a,_0x5f77('0x1c'));_0xb1d759(_0x2f0920[_0x5f77('0x22')]['message']);}})['catch'](function(_0x1161c9){logger[_0x5f77('0x1e')]('Setting,\x20%s,\x20%s',_0x2e557a,_0x1161c9);_0x2ff04b(_0x1161c9);});});}function respondWithStatusCode(_0x3abc5f,_0xe81153){_0xe81153=_0xe81153||0xcc;return function(_0x29db37){if(_0x29db37){return _0x3abc5f[_0x5f77('0x23')](_0xe81153);}return _0x3abc5f[_0x5f77('0x24')](_0xe81153)[_0x5f77('0x25')]();};}function respondWithResult(_0x475ed2,_0x531b96){_0x531b96=_0x531b96||0xc8;return function(_0x43fb52){if(_0x43fb52){return _0x475ed2[_0x5f77('0x24')](_0x531b96)[_0x5f77('0x26')](_0x43fb52);}};}function respondWithFilteredResult(_0x101f0e,_0x3a10d5){return function(_0x391859){if(_0x391859){var _0x4a8fbb=typeof _0x3a10d5[_0x5f77('0x27')]===_0x5f77('0x28')&&typeof _0x3a10d5[_0x5f77('0x29')]===_0x5f77('0x28');var _0x568ddb=_0x391859['count'];var _0x49d75e=_0x4a8fbb?0x0:_0x3a10d5[_0x5f77('0x27')];var _0x27b39d=_0x4a8fbb?_0x391859[_0x5f77('0x2a')]:_0x3a10d5['offset']+_0x3a10d5[_0x5f77('0x29')];var _0x3e1f4b;if(_0x27b39d>=_0x568ddb){_0x27b39d=_0x568ddb;_0x3e1f4b=0xc8;}else{_0x3e1f4b=0xce;}_0x101f0e[_0x5f77('0x24')](_0x3e1f4b);return _0x101f0e['set']('Content-Range',_0x49d75e+'-'+_0x27b39d+'/'+_0x568ddb)['json'](_0x391859);}return null;};}function patchUpdates(_0x573bf9){return function(_0x25104a){try{jsonpatch[_0x5f77('0x2b')](_0x25104a,_0x573bf9,!![]);}catch(_0x2f6bfe){return BPromise[_0x5f77('0x2c')](_0x2f6bfe);}return _0x25104a['save']();};}function saveUpdates(_0x58b9d9,_0x4428f0){return function(_0x497995){if(_0x497995){return _0x497995[_0x5f77('0x2d')](_0x58b9d9)[_0x5f77('0x1a')](function(_0x5f084d){return _0x5f084d;});}return null;};}function removeEntity(_0x46a5d8,_0x4af49b){return function(_0x30197c){if(_0x30197c){return _0x30197c[_0x5f77('0x2e')]()[_0x5f77('0x1a')](function(){_0x46a5d8['status'](0xcc)[_0x5f77('0x25')]();});}};}function handleEntityNotFound(_0x2f8afb,_0x5697d7){return function(_0x3446a8){if(!_0x3446a8){_0x2f8afb['sendStatus'](0x194);}return _0x3446a8;};}function handleError(_0x46db09,_0x4a294e){_0x4a294e=_0x4a294e||0x1f4;return function(_0x4f54c6){logger[_0x5f77('0x1e')](_0x4f54c6[_0x5f77('0x2f')]);if(_0x4f54c6[_0x5f77('0x30')]){delete _0x4f54c6[_0x5f77('0x30')];}_0x46db09[_0x5f77('0x24')](_0x4a294e)[_0x5f77('0x31')](_0x4f54c6);};}exports['index']=function(_0xd753ad,_0x3d9b5a){var _0x5b72e5={},_0x1a4d7e={},_0x58c62b={'count':0x0,'rows':[]};var _0x33e24b=_[_0x5f77('0x32')](db['Setting'][_0x5f77('0x33')],function(_0x30f717){return{'name':_0x30f717[_0x5f77('0x34')],'type':_0x30f717['type'][_0x5f77('0x35')]};});_0x1a4d7e[_0x5f77('0x36')]=_[_0x5f77('0x32')](_0x33e24b,'name');_0x1a4d7e[_0x5f77('0x37')]=_[_0x5f77('0x38')](_0xd753ad[_0x5f77('0x37')]);_0x1a4d7e[_0x5f77('0x39')]=_[_0x5f77('0x3a')](_0x1a4d7e[_0x5f77('0x36')],_0x1a4d7e[_0x5f77('0x37')]);_0x5b72e5[_0x5f77('0x3b')]=_[_0x5f77('0x3a')](_0x1a4d7e[_0x5f77('0x36')],qs[_0x5f77('0x3c')](_0xd753ad[_0x5f77('0x37')][_0x5f77('0x3c')]));_0x5b72e5['attributes']=_0x5b72e5[_0x5f77('0x3b')][_0x5f77('0x3d')]?_0x5b72e5['attributes']:_0x1a4d7e['model'];if(!_0xd753ad['query'][_0x5f77('0x3e')](_0x5f77('0x3f'))){_0x5b72e5[_0x5f77('0x29')]=qs['limit'](_0xd753ad[_0x5f77('0x37')][_0x5f77('0x29')]);_0x5b72e5[_0x5f77('0x27')]=qs[_0x5f77('0x27')](_0xd753ad[_0x5f77('0x37')][_0x5f77('0x27')]);}_0x5b72e5[_0x5f77('0x40')]=qs[_0x5f77('0x41')](_0xd753ad[_0x5f77('0x37')][_0x5f77('0x41')]);_0x5b72e5[_0x5f77('0x42')]=qs['filters'](_[_0x5f77('0x43')](_0xd753ad[_0x5f77('0x37')],_0x1a4d7e[_0x5f77('0x39')]),_0x33e24b);if(_0xd753ad['query'][_0x5f77('0x44')]){_0x5b72e5[_0x5f77('0x42')]=_['merge'](_0x5b72e5['where'],{'$or':_[_0x5f77('0x32')](_0x33e24b,function(_0x2fcfae){if(_0x2fcfae['type']!=='VIRTUAL'){var _0x3149d3={};_0x3149d3[_0x2fcfae[_0x5f77('0x30')]]={'$like':'%'+_0xd753ad['query']['filter']+'%'};return _0x3149d3;}})});}_0x5b72e5=_[_0x5f77('0x45')]({},_0x5b72e5,_0xd753ad['options']);var _0x3d4344={'where':_0x5b72e5['where']};return db[_0x5f77('0x46')][_0x5f77('0x2a')](_0x3d4344)[_0x5f77('0x1a')](function(_0x3b8673){_0x58c62b['count']=_0x3b8673;if(_0xd753ad[_0x5f77('0x37')][_0x5f77('0x47')]){_0x5b72e5[_0x5f77('0x48')]=[{'all':!![]}];}return db[_0x5f77('0x46')]['findAll'](_0x5b72e5);})['then'](function(_0x420d51){_0x58c62b[_0x5f77('0x49')]=_0x420d51;return _0x58c62b;})[_0x5f77('0x1a')](respondWithFilteredResult(_0x3d9b5a,_0x5b72e5))[_0x5f77('0x4a')](handleError(_0x3d9b5a,null));};exports[_0x5f77('0x4b')]=function(_0x30acc1,_0x59c8bb){var _0x4b19a3={'raw':![],'where':{'id':_0x30acc1[_0x5f77('0x4c')]['id']}},_0x1515e8={};_0x1515e8[_0x5f77('0x36')]=_['keys'](db['Setting']['rawAttributes']);_0x1515e8[_0x5f77('0x37')]=_[_0x5f77('0x38')](_0x30acc1['query']);_0x1515e8[_0x5f77('0x39')]=_['intersection'](_0x1515e8[_0x5f77('0x36')],_0x1515e8[_0x5f77('0x37')]);_0x4b19a3[_0x5f77('0x3b')]=_[_0x5f77('0x3a')](_0x1515e8[_0x5f77('0x36')],qs['fields'](_0x30acc1[_0x5f77('0x37')][_0x5f77('0x3c')]));_0x4b19a3[_0x5f77('0x3b')]=_0x4b19a3[_0x5f77('0x3b')][_0x5f77('0x3d')]?_0x4b19a3[_0x5f77('0x3b')]:_0x1515e8[_0x5f77('0x36')];if(_0x30acc1['query'][_0x5f77('0x47')]){_0x4b19a3[_0x5f77('0x48')]=[{'all':!![]}];}_0x4b19a3=_[_0x5f77('0x45')]({},_0x4b19a3,_0x30acc1[_0x5f77('0x4d')]);return db[_0x5f77('0x46')][_0x5f77('0x4e')](_0x4b19a3)[_0x5f77('0x1a')](handleEntityNotFound(_0x59c8bb,null))['then'](respondWithResult(_0x59c8bb,null))['catch'](handleError(_0x59c8bb,null));};exports[_0x5f77('0x2d')]=function(_0x110b3c,_0x1d0075){if(_0x110b3c[_0x5f77('0x4f')]['id']){delete _0x110b3c['body']['id'];}return db[_0x5f77('0x46')][_0x5f77('0x4e')]({'where':{'id':_0x110b3c['params']['id']}})[_0x5f77('0x1a')](handleEntityNotFound(_0x1d0075,null))[_0x5f77('0x1a')](saveUpdates(_0x110b3c[_0x5f77('0x4f')],null))['then'](respondWithResult(_0x1d0075,null))[_0x5f77('0x4a')](handleError(_0x1d0075,null));};exports['addLogo']=function(_0x22c754,_0x1ace2c,_0x1b0cce){if(_0x22c754[_0x5f77('0x50')]&&_0x22c754[_0x5f77('0x50')][_0x5f77('0x51')]){_0x22c754[_0x5f77('0x4f')][_0x5f77('0x52')]=_0x22c754['file']['filename'];}return db[_0x5f77('0x46')][_0x5f77('0x4e')]({'where':{'id':_0x22c754['params']['id']}})['then'](handleEntityNotFound(_0x1ace2c,null))[_0x5f77('0x1a')](saveUpdates(_0x22c754[_0x5f77('0x4f')],null))[_0x5f77('0x1a')](respondWithResult(_0x1ace2c,null))['catch'](handleError(_0x1ace2c,null));};exports[_0x5f77('0x53')]=function(_0x38419f,_0x3061e1,_0x23426f){if(_0x38419f[_0x5f77('0x50')]&&_0x38419f[_0x5f77('0x50')][_0x5f77('0x51')]){_0x38419f['body'][_0x5f77('0x54')]=_0x38419f[_0x5f77('0x50')]['filename'];}return db[_0x5f77('0x46')]['find']({'where':{'id':_0x38419f[_0x5f77('0x4c')]['id']}})[_0x5f77('0x1a')](handleEntityNotFound(_0x3061e1,null))[_0x5f77('0x1a')](saveUpdates(_0x38419f['body'],null))[_0x5f77('0x1a')](respondWithResult(_0x3061e1,null))[_0x5f77('0x4a')](handleError(_0x3061e1,null));};var utilLicense=require(_0x5f77('0x16'));exports[_0x5f77('0x55')]=function(_0x4413d8,_0x2670b0,_0x58908b){var _0x11bebe=_0x5f77('0x56');var _0x507e30={'custom':![]};return utilLicense[_0x5f77('0x57')]()[_0x5f77('0x1a')](function(_0x28b3b0){if(_0x28b3b0){_0x507e30=_0x28b3b0;}return db[_0x5f77('0x46')][_0x5f77('0x4e')]({'where':{'id':_0x4413d8[_0x5f77('0x4c')]['id']},'attributes':[_0x5f77('0x52'),_0x5f77('0x54'),'preferred',_0x5f77('0x58'),_0x5f77('0x59'),'defaultLoginLogo',_0x5f77('0x5a'),'defaultFavicon'],'raw':!![]});})[_0x5f77('0x1a')](handleEntityNotFound(_0x2670b0,null))['then'](function(_0x309d24){if(_0x309d24){var _0x25b881=_0x309d24['logo']&&fs[_0x5f77('0x5b')](path['join'](config[_0x5f77('0x5c')],_0x11bebe,_[_0x5f77('0x5d')](_0x309d24[_0x5f77('0x52')])))?path[_0x5f77('0x5e')](config[_0x5f77('0x5c')],_0x11bebe,_[_0x5f77('0x5d')](_0x309d24[_0x5f77('0x52')])):path[_0x5f77('0x5e')](config[_0x5f77('0x5c')],_0x11bebe,_['toLower']('default_logo.svg'));var _0x102620='default'+_[_0x5f77('0x5f')]('logo');if(_0x309d24[_0x102620]||!_0x507e30[_0x5f77('0x60')]){_0x25b881=path[_0x5f77('0x5e')](config[_0x5f77('0x5c')],_0x11bebe,_[_0x5f77('0x5d')](_0x5f77('0x61')));}if(!fs[_0x5f77('0x5b')](_0x25b881)){throw new db[(_0x5f77('0x62'))][(_0x5f77('0x63'))](_[_0x5f77('0x5f')](_0x5f77('0x52'))+_0x5f77('0x64'));}return _0x2670b0[_0x5f77('0x65')](_0x25b881);}})['catch'](handleError(_0x2670b0,null));};var utilLicense=require(_0x5f77('0x16'));exports['getLogoLogin']=function(_0x4a3e1a,_0x5e18c1,_0x1263ef){var _0x3a50d2=_0x5f77('0x56');var _0x297650={'custom':![]};return utilLicense['getLicense']()[_0x5f77('0x1a')](function(_0x415b97){if(_0x415b97){_0x297650=_0x415b97;}return db[_0x5f77('0x46')][_0x5f77('0x4e')]({'where':{'id':_0x4a3e1a['params']['id']},'attributes':[_0x5f77('0x52'),_0x5f77('0x54'),'preferred','favicon','defaultLogo',_0x5f77('0x66'),_0x5f77('0x5a'),_0x5f77('0x67')],'raw':!![]});})[_0x5f77('0x1a')](handleEntityNotFound(_0x5e18c1,null))[_0x5f77('0x1a')](function(_0x1c6004){if(_0x1c6004){var _0x5436cd=_0x1c6004[_0x5f77('0x54')]&&fs['existsSync'](path[_0x5f77('0x5e')](config[_0x5f77('0x5c')],_0x3a50d2,_[_0x5f77('0x5d')](_0x1c6004['loginLogo'])))?path[_0x5f77('0x5e')](config[_0x5f77('0x5c')],_0x3a50d2,_[_0x5f77('0x5d')](_0x1c6004[_0x5f77('0x54')])):path[_0x5f77('0x5e')](config[_0x5f77('0x5c')],_0x3a50d2,_['toLower'](_0x5f77('0x68')));var _0x2e5bf5='default'+_['upperFirst'](_0x5f77('0x54'));if(_0x1c6004[_0x2e5bf5]||!_0x297650[_0x5f77('0x60')]){_0x5436cd=path[_0x5f77('0x5e')](config[_0x5f77('0x5c')],_0x3a50d2,_[_0x5f77('0x5d')](_0x5f77('0x68')));}if(!fs[_0x5f77('0x5b')](_0x5436cd)){throw new db[(_0x5f77('0x62'))][(_0x5f77('0x63'))](_[_0x5f77('0x5f')](_0x5f77('0x54'))+_0x5f77('0x64'));}return _0x5e18c1[_0x5f77('0x65')](_0x5436cd);}})[_0x5f77('0x4a')](handleError(_0x5e18c1,null));};exports[_0x5f77('0x69')]=function(_0x2edbc1,_0x4e64fd){return db['Setting'][_0x5f77('0x4e')]({'where':{'id':_0x2edbc1[_0x5f77('0x4c')]['id']},'attributes':[_0x5f77('0x6a')]})['then'](respondWithResult(_0x4e64fd,null))[_0x5f77('0x4a')](handleError(_0x4e64fd,null));};exports[_0x5f77('0x6b')]=function(_0x2628fd,_0xcdc405,_0x4e44dd){if(_0x2628fd[_0x5f77('0x50')]&&_0x2628fd['file'][_0x5f77('0x51')]){_0x2628fd[_0x5f77('0x4f')]['preferred']=_0x2628fd[_0x5f77('0x50')][_0x5f77('0x51')];}return db[_0x5f77('0x46')][_0x5f77('0x4e')]({'where':{'id':_0x2628fd['params']['id']}})[_0x5f77('0x1a')](handleEntityNotFound(_0xcdc405,null))[_0x5f77('0x1a')](saveUpdates(_0x2628fd['body'],null))[_0x5f77('0x1a')](respondWithResult(_0xcdc405,null))[_0x5f77('0x4a')](handleError(_0xcdc405,null));};var utilLicense=require(_0x5f77('0x16'));exports[_0x5f77('0x6c')]=function(_0x341ed0,_0x57cbbe,_0x2164d4){var _0x4994ac='server/files/images/logos';var _0x3b28b7={'custom':![]};return utilLicense['getLicense']()[_0x5f77('0x1a')](function(_0x21e7da){if(_0x21e7da){_0x3b28b7=_0x21e7da;}return db[_0x5f77('0x46')][_0x5f77('0x4e')]({'where':{'id':_0x341ed0[_0x5f77('0x4c')]['id']},'attributes':[_0x5f77('0x52'),_0x5f77('0x54'),_0x5f77('0x6d'),'favicon',_0x5f77('0x59'),_0x5f77('0x66'),_0x5f77('0x5a'),_0x5f77('0x67')],'raw':!![]});})[_0x5f77('0x1a')](handleEntityNotFound(_0x57cbbe,null))[_0x5f77('0x1a')](function(_0x19d556){if(_0x19d556){var _0x433bed=_0x19d556[_0x5f77('0x6d')]&&fs[_0x5f77('0x5b')](path[_0x5f77('0x5e')](config[_0x5f77('0x5c')],_0x4994ac,_['toLower'](_0x19d556[_0x5f77('0x6d')])))?path[_0x5f77('0x5e')](config[_0x5f77('0x5c')],_0x4994ac,_[_0x5f77('0x5d')](_0x19d556[_0x5f77('0x6d')])):path['join'](config[_0x5f77('0x5c')],_0x4994ac,_[_0x5f77('0x5d')](_0x5f77('0x6e')));var _0xc56f5d=_0x5f77('0x6f')+_[_0x5f77('0x5f')]('preferred');if(_0x19d556[_0xc56f5d]||!_0x3b28b7[_0x5f77('0x60')]||!_0x3b28b7['preferred']){_0x433bed=path[_0x5f77('0x5e')](config[_0x5f77('0x5c')],_0x4994ac,_['toLower'](_0x5f77('0x6e')));}if(!fs['existsSync'](_0x433bed)){throw new db[(_0x5f77('0x62'))][(_0x5f77('0x63'))](_['upperFirst'](_0x5f77('0x6d'))+_0x5f77('0x64'));}return _0x57cbbe[_0x5f77('0x65')](_0x433bed);}})[_0x5f77('0x4a')](handleError(_0x57cbbe,null));};exports[_0x5f77('0x70')]=function(_0x4b05a2,_0x5c5d5a,_0x24c23b){if(_0x4b05a2[_0x5f77('0x50')]&&_0x4b05a2['file']['filename']){_0x4b05a2[_0x5f77('0x4f')][_0x5f77('0x58')]=_0x4b05a2['file'][_0x5f77('0x51')];}return db[_0x5f77('0x46')]['find']({'where':{'id':_0x4b05a2[_0x5f77('0x4c')]['id']}})[_0x5f77('0x1a')](handleEntityNotFound(_0x5c5d5a,null))[_0x5f77('0x1a')](saveUpdates(_0x4b05a2[_0x5f77('0x4f')],null))['then'](respondWithResult(_0x5c5d5a,null))['catch'](handleError(_0x5c5d5a,null));};var utilLicense=require(_0x5f77('0x16'));exports[_0x5f77('0x71')]=function(_0x120e08,_0x307166,_0x39fca6){var _0x5c6355=_0x5f77('0x56');var _0x4ba062={'custom':![]};return utilLicense[_0x5f77('0x57')]()[_0x5f77('0x1a')](function(_0x2cff1a){if(_0x2cff1a){_0x4ba062=_0x2cff1a;}return db['Setting'][_0x5f77('0x4e')]({'where':{'id':_0x120e08[_0x5f77('0x4c')]['id']},'attributes':['logo','loginLogo',_0x5f77('0x6d'),'favicon',_0x5f77('0x59'),_0x5f77('0x66'),_0x5f77('0x5a'),_0x5f77('0x67')],'raw':!![]});})[_0x5f77('0x1a')](handleEntityNotFound(_0x307166,null))[_0x5f77('0x1a')](function(_0x5dc498){if(_0x5dc498){var _0x93c7c6=_0x5dc498[_0x5f77('0x58')]&&fs[_0x5f77('0x5b')](path[_0x5f77('0x5e')](config[_0x5f77('0x5c')],_0x5c6355,_[_0x5f77('0x5d')](_0x5dc498[_0x5f77('0x58')])))?path[_0x5f77('0x5e')](config[_0x5f77('0x5c')],_0x5c6355,_[_0x5f77('0x5d')](_0x5dc498['favicon'])):path[_0x5f77('0x5e')](config[_0x5f77('0x5c')],_0x5c6355,_['toLower']('default_favicon.ico'));var _0x5b425b=_0x5f77('0x6f')+_[_0x5f77('0x5f')](_0x5f77('0x58'));if(_0x5dc498[_0x5b425b]||!_0x4ba062[_0x5f77('0x60')]){_0x93c7c6=path['join'](config[_0x5f77('0x5c')],_0x5c6355,_['toLower']('default_favicon.ico'));}if(!fs[_0x5f77('0x5b')](_0x93c7c6)){throw new db[(_0x5f77('0x62'))][(_0x5f77('0x63'))](_['upperFirst'](_0x5f77('0x58'))+_0x5f77('0x64'));}return _0x307166[_0x5f77('0x65')](_0x93c7c6);}})['catch'](handleError(_0x307166,null));};exports[_0x5f77('0x72')]=function(_0x127fae,_0x244249){var _0x1c2791={'offset':moment()['utcOffset']()};_0x1c2791[_0x5f77('0x73')]=moment()[_0x5f77('0x74')](_0x1c2791[_0x5f77('0x27')])[_0x5f77('0x75')](_0x5f77('0x76'));return _0x244249[_0x5f77('0x24')](0xc8)['send'](_0x1c2791);}; \ No newline at end of file +var _0xd6c1=['download','getLogoLogin','defaultLoginLogo','defaultPreferred','existsSync','default_loginLogo.svg','gdpr','securePassword','addPreferred','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Setting,\x20%s,\x20%s','message','result','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','save','update','destroy','stack','name','send','map','Setting','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','merge','find','body','params','file','logo','filename','../../config/license/util','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd6c1,0x178));var _0x1d6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd6c1[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1d6c('0x0'));var jsonpatch=require(_0x1d6c('0x1'));var rp=require(_0x1d6c('0x2'));var moment=require('moment');var BPromise=require(_0x1d6c('0x3'));var Mustache=require(_0x1d6c('0x4'));var util=require('util');var path=require(_0x1d6c('0x5'));var sox=require(_0x1d6c('0x6'));var csv=require(_0x1d6c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d6c('0x8'));var _=require(_0x1d6c('0x9'));var squel=require('squel');var crypto=require(_0x1d6c('0xa'));var jsforce=require(_0x1d6c('0xb'));var deskjs=require(_0x1d6c('0xc'));var toCsv=require(_0x1d6c('0x7'));var querystring=require('querystring');var Papa=require(_0x1d6c('0xd'));var Redis=require(_0x1d6c('0xe'));var authService=require(_0x1d6c('0xf'));var qs=require(_0x1d6c('0x10'));var as=require(_0x1d6c('0x11'));var hardwareService=require(_0x1d6c('0x12'));var logger=require(_0x1d6c('0x13'))(_0x1d6c('0x14'));var utils=require(_0x1d6c('0x15'));var config=require(_0x1d6c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x1d6c('0x17'));var client=jayson[_0x1d6c('0x18')][_0x1d6c('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4de9eb,_0x3f74bf,_0x55e416,_0xe0f699){return new BPromise(function(_0x4cd6dd,_0x5124af){var _0x36e914=_0xe0f699||client;return _0x36e914[_0x1d6c('0x1a')](_0x4de9eb,_0x55e416)[_0x1d6c('0x1b')](function(_0x173108){logger['info']('Setting,\x20%s,\x20%s',_0x3f74bf,'request\x20sent');logger[_0x1d6c('0x1c')](_0x1d6c('0x1d'),_0x3f74bf,_0x1d6c('0x1e'),JSON[_0x1d6c('0x1f')](_0x173108));if(_0x173108[_0x1d6c('0x20')]){if(_0x173108['error'][_0x1d6c('0x21')]===0x1f4){logger['error'](_0x1d6c('0x22'),_0x3f74bf,_0x173108[_0x1d6c('0x20')]['message']);return _0x5124af(_0x173108[_0x1d6c('0x20')][_0x1d6c('0x23')]);}logger[_0x1d6c('0x20')](_0x1d6c('0x22'),_0x3f74bf,_0x173108[_0x1d6c('0x20')][_0x1d6c('0x23')]);return _0x4cd6dd(_0x173108[_0x1d6c('0x20')][_0x1d6c('0x23')]);}else{logger['info'](_0x1d6c('0x22'),_0x3f74bf,_0x1d6c('0x1e'));_0x4cd6dd(_0x173108[_0x1d6c('0x24')][_0x1d6c('0x23')]);}})['catch'](function(_0xf0e48d){logger[_0x1d6c('0x20')](_0x1d6c('0x22'),_0x3f74bf,_0xf0e48d);_0x5124af(_0xf0e48d);});});}function respondWithStatusCode(_0x5348b,_0x1c8565){_0x1c8565=_0x1c8565||0xcc;return function(_0x1873bc){if(_0x1873bc){return _0x5348b[_0x1d6c('0x25')](_0x1c8565);}return _0x5348b[_0x1d6c('0x26')](_0x1c8565)['end']();};}function respondWithResult(_0x37d976,_0x41dfde){_0x41dfde=_0x41dfde||0xc8;return function(_0x312543){if(_0x312543){return _0x37d976[_0x1d6c('0x26')](_0x41dfde)['json'](_0x312543);}};}function respondWithFilteredResult(_0x5185d2,_0x368c7c){return function(_0x5ef533){if(_0x5ef533){var _0x1b7915=typeof _0x368c7c['offset']===_0x1d6c('0x27')&&typeof _0x368c7c[_0x1d6c('0x28')]===_0x1d6c('0x27');var _0x27cbe7=_0x5ef533[_0x1d6c('0x29')];var _0xc41048=_0x1b7915?0x0:_0x368c7c[_0x1d6c('0x2a')];var _0x542ff0=_0x1b7915?_0x5ef533[_0x1d6c('0x29')]:_0x368c7c['offset']+_0x368c7c['limit'];var _0x1c24f4;if(_0x542ff0>=_0x27cbe7){_0x542ff0=_0x27cbe7;_0x1c24f4=0xc8;}else{_0x1c24f4=0xce;}_0x5185d2['status'](_0x1c24f4);return _0x5185d2[_0x1d6c('0x2b')](_0x1d6c('0x2c'),_0xc41048+'-'+_0x542ff0+'/'+_0x27cbe7)[_0x1d6c('0x2d')](_0x5ef533);}return null;};}function patchUpdates(_0x21e08b){return function(_0x40f4b0){try{jsonpatch['apply'](_0x40f4b0,_0x21e08b,!![]);}catch(_0x194726){return BPromise['reject'](_0x194726);}return _0x40f4b0[_0x1d6c('0x2e')]();};}function saveUpdates(_0x3dda64,_0x59f4df){return function(_0x37f006){if(_0x37f006){return _0x37f006[_0x1d6c('0x2f')](_0x3dda64)[_0x1d6c('0x1b')](function(_0x48802a){return _0x48802a;});}return null;};}function removeEntity(_0x1c411f,_0x3735c5){return function(_0x44c921){if(_0x44c921){return _0x44c921[_0x1d6c('0x30')]()[_0x1d6c('0x1b')](function(){_0x1c411f[_0x1d6c('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36fa43,_0x4521e7){return function(_0x21f173){if(!_0x21f173){_0x36fa43['sendStatus'](0x194);}return _0x21f173;};}function handleError(_0x4c386a,_0x1b7816){_0x1b7816=_0x1b7816||0x1f4;return function(_0x24b7e5){logger['error'](_0x24b7e5[_0x1d6c('0x31')]);if(_0x24b7e5['name']){delete _0x24b7e5[_0x1d6c('0x32')];}_0x4c386a['status'](_0x1b7816)[_0x1d6c('0x33')](_0x24b7e5);};}exports['index']=function(_0x1e1039,_0x42254){var _0x35a42d={},_0x32c3d9={},_0x2535c3={'count':0x0,'rows':[]};var _0x4012fd=_[_0x1d6c('0x34')](db[_0x1d6c('0x35')][_0x1d6c('0x36')],function(_0x5d145f){return{'name':_0x5d145f[_0x1d6c('0x37')],'type':_0x5d145f['type'][_0x1d6c('0x38')]};});_0x32c3d9[_0x1d6c('0x39')]=_[_0x1d6c('0x34')](_0x4012fd,_0x1d6c('0x32'));_0x32c3d9[_0x1d6c('0x3a')]=_[_0x1d6c('0x3b')](_0x1e1039['query']);_0x32c3d9['filters']=_[_0x1d6c('0x3c')](_0x32c3d9[_0x1d6c('0x39')],_0x32c3d9[_0x1d6c('0x3a')]);_0x35a42d[_0x1d6c('0x3d')]=_[_0x1d6c('0x3c')](_0x32c3d9[_0x1d6c('0x39')],qs['fields'](_0x1e1039[_0x1d6c('0x3a')][_0x1d6c('0x3e')]));_0x35a42d[_0x1d6c('0x3d')]=_0x35a42d[_0x1d6c('0x3d')][_0x1d6c('0x3f')]?_0x35a42d[_0x1d6c('0x3d')]:_0x32c3d9[_0x1d6c('0x39')];if(!_0x1e1039[_0x1d6c('0x3a')][_0x1d6c('0x40')](_0x1d6c('0x41'))){_0x35a42d['limit']=qs[_0x1d6c('0x28')](_0x1e1039['query'][_0x1d6c('0x28')]);_0x35a42d['offset']=qs[_0x1d6c('0x2a')](_0x1e1039[_0x1d6c('0x3a')][_0x1d6c('0x2a')]);}_0x35a42d[_0x1d6c('0x42')]=qs['sort'](_0x1e1039[_0x1d6c('0x3a')]['sort']);_0x35a42d[_0x1d6c('0x43')]=qs[_0x1d6c('0x44')](_[_0x1d6c('0x45')](_0x1e1039[_0x1d6c('0x3a')],_0x32c3d9[_0x1d6c('0x44')]),_0x4012fd);if(_0x1e1039[_0x1d6c('0x3a')][_0x1d6c('0x46')]){_0x35a42d[_0x1d6c('0x43')]=_['merge'](_0x35a42d[_0x1d6c('0x43')],{'$or':_[_0x1d6c('0x34')](_0x4012fd,function(_0x470eac){if(_0x470eac['type']!==_0x1d6c('0x47')){var _0x3f6681={};_0x3f6681[_0x470eac[_0x1d6c('0x32')]]={'$like':'%'+_0x1e1039[_0x1d6c('0x3a')][_0x1d6c('0x46')]+'%'};return _0x3f6681;}})});}_0x35a42d=_['merge']({},_0x35a42d,_0x1e1039[_0x1d6c('0x48')]);var _0x564fc6={'where':_0x35a42d['where']};return db[_0x1d6c('0x35')]['count'](_0x564fc6)[_0x1d6c('0x1b')](function(_0x23d236){_0x2535c3['count']=_0x23d236;if(_0x1e1039['query']['includeAll']){_0x35a42d[_0x1d6c('0x49')]=[{'all':!![]}];}return db['Setting'][_0x1d6c('0x4a')](_0x35a42d);})[_0x1d6c('0x1b')](function(_0x190b1e){_0x2535c3[_0x1d6c('0x4b')]=_0x190b1e;return _0x2535c3;})['then'](respondWithFilteredResult(_0x42254,_0x35a42d))[_0x1d6c('0x4c')](handleError(_0x42254,null));};exports[_0x1d6c('0x4d')]=function(_0x198933,_0x2f0e5f){var _0x1adadd={'raw':![],'where':{'id':_0x198933['params']['id']}},_0x4f6116={};_0x4f6116['model']=_[_0x1d6c('0x3b')](db[_0x1d6c('0x35')][_0x1d6c('0x36')]);_0x4f6116['query']=_[_0x1d6c('0x3b')](_0x198933[_0x1d6c('0x3a')]);_0x4f6116['filters']=_['intersection'](_0x4f6116[_0x1d6c('0x39')],_0x4f6116[_0x1d6c('0x3a')]);_0x1adadd[_0x1d6c('0x3d')]=_['intersection'](_0x4f6116[_0x1d6c('0x39')],qs[_0x1d6c('0x3e')](_0x198933[_0x1d6c('0x3a')][_0x1d6c('0x3e')]));_0x1adadd[_0x1d6c('0x3d')]=_0x1adadd[_0x1d6c('0x3d')][_0x1d6c('0x3f')]?_0x1adadd['attributes']:_0x4f6116[_0x1d6c('0x39')];if(_0x198933[_0x1d6c('0x3a')][_0x1d6c('0x4e')]){_0x1adadd[_0x1d6c('0x49')]=[{'all':!![]}];}_0x1adadd=_[_0x1d6c('0x4f')]({},_0x1adadd,_0x198933[_0x1d6c('0x48')]);return db[_0x1d6c('0x35')][_0x1d6c('0x50')](_0x1adadd)[_0x1d6c('0x1b')](handleEntityNotFound(_0x2f0e5f,null))[_0x1d6c('0x1b')](respondWithResult(_0x2f0e5f,null))['catch'](handleError(_0x2f0e5f,null));};exports[_0x1d6c('0x2f')]=function(_0x1bb444,_0x188fc0){if(_0x1bb444[_0x1d6c('0x51')]['id']){delete _0x1bb444[_0x1d6c('0x51')]['id'];}return db[_0x1d6c('0x35')][_0x1d6c('0x50')]({'where':{'id':_0x1bb444[_0x1d6c('0x52')]['id']}})[_0x1d6c('0x1b')](handleEntityNotFound(_0x188fc0,null))[_0x1d6c('0x1b')](saveUpdates(_0x1bb444[_0x1d6c('0x51')],null))['then'](respondWithResult(_0x188fc0,null))[_0x1d6c('0x4c')](handleError(_0x188fc0,null));};exports['addLogo']=function(_0xe549ce,_0x1be057,_0x2b11f4){if(_0xe549ce[_0x1d6c('0x53')]&&_0xe549ce['file']['filename']){_0xe549ce['body'][_0x1d6c('0x54')]=_0xe549ce[_0x1d6c('0x53')]['filename'];}return db[_0x1d6c('0x35')][_0x1d6c('0x50')]({'where':{'id':_0xe549ce[_0x1d6c('0x52')]['id']}})['then'](handleEntityNotFound(_0x1be057,null))['then'](saveUpdates(_0xe549ce['body'],null))['then'](respondWithResult(_0x1be057,null))[_0x1d6c('0x4c')](handleError(_0x1be057,null));};exports['addLogoLogin']=function(_0x39b43c,_0x3a0e77,_0x791261){if(_0x39b43c['file']&&_0x39b43c['file'][_0x1d6c('0x55')]){_0x39b43c[_0x1d6c('0x51')]['loginLogo']=_0x39b43c[_0x1d6c('0x53')][_0x1d6c('0x55')];}return db[_0x1d6c('0x35')][_0x1d6c('0x50')]({'where':{'id':_0x39b43c[_0x1d6c('0x52')]['id']}})['then'](handleEntityNotFound(_0x3a0e77,null))['then'](saveUpdates(_0x39b43c[_0x1d6c('0x51')],null))['then'](respondWithResult(_0x3a0e77,null))[_0x1d6c('0x4c')](handleError(_0x3a0e77,null));};var utilLicense=require(_0x1d6c('0x56'));exports['getLogo']=function(_0x4821be,_0x8b9aa5,_0x4f909a){var _0x5af9cc=_0x1d6c('0x57');var _0x14a56b={'custom':![]};return utilLicense[_0x1d6c('0x58')]()['then'](function(_0x68035d){if(_0x68035d){_0x14a56b=_0x68035d;}return db[_0x1d6c('0x35')][_0x1d6c('0x50')]({'where':{'id':_0x4821be[_0x1d6c('0x52')]['id']},'attributes':['logo',_0x1d6c('0x59'),_0x1d6c('0x5a'),_0x1d6c('0x5b'),_0x1d6c('0x5c'),'defaultLoginLogo','defaultPreferred',_0x1d6c('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x8b9aa5,null))[_0x1d6c('0x1b')](function(_0x2b0a60){if(_0x2b0a60){var _0x46765c=_0x2b0a60[_0x1d6c('0x54')]&&fs['existsSync'](path[_0x1d6c('0x5e')](config[_0x1d6c('0x5f')],_0x5af9cc,_[_0x1d6c('0x60')](_0x2b0a60[_0x1d6c('0x54')])))?path['join'](config[_0x1d6c('0x5f')],_0x5af9cc,_[_0x1d6c('0x60')](_0x2b0a60[_0x1d6c('0x54')])):path[_0x1d6c('0x5e')](config['root'],_0x5af9cc,_[_0x1d6c('0x60')](_0x1d6c('0x61')));var _0x46bee5=_0x1d6c('0x62')+_[_0x1d6c('0x63')]('logo');if(_0x2b0a60[_0x46bee5]||!_0x14a56b[_0x1d6c('0x64')]){_0x46765c=path[_0x1d6c('0x5e')](config[_0x1d6c('0x5f')],_0x5af9cc,_[_0x1d6c('0x60')](_0x1d6c('0x61')));}if(!fs['existsSync'](_0x46765c)){throw new db[(_0x1d6c('0x65'))][(_0x1d6c('0x66'))](_[_0x1d6c('0x63')](_0x1d6c('0x54'))+_0x1d6c('0x67'));}return _0x8b9aa5[_0x1d6c('0x68')](_0x46765c);}})[_0x1d6c('0x4c')](handleError(_0x8b9aa5,null));};var utilLicense=require(_0x1d6c('0x56'));exports[_0x1d6c('0x69')]=function(_0x229fd5,_0x1c3ef2,_0x49856e){var _0x265415='server/files/images/logos';var _0x48eefc={'custom':![]};return utilLicense[_0x1d6c('0x58')]()[_0x1d6c('0x1b')](function(_0x15eb53){if(_0x15eb53){_0x48eefc=_0x15eb53;}return db[_0x1d6c('0x35')][_0x1d6c('0x50')]({'where':{'id':_0x229fd5[_0x1d6c('0x52')]['id']},'attributes':[_0x1d6c('0x54'),_0x1d6c('0x59'),'preferred',_0x1d6c('0x5b'),'defaultLogo',_0x1d6c('0x6a'),_0x1d6c('0x6b'),_0x1d6c('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x1c3ef2,null))[_0x1d6c('0x1b')](function(_0x44ecee){if(_0x44ecee){var _0x109bf3=_0x44ecee[_0x1d6c('0x59')]&&fs[_0x1d6c('0x6c')](path[_0x1d6c('0x5e')](config['root'],_0x265415,_[_0x1d6c('0x60')](_0x44ecee[_0x1d6c('0x59')])))?path[_0x1d6c('0x5e')](config[_0x1d6c('0x5f')],_0x265415,_[_0x1d6c('0x60')](_0x44ecee[_0x1d6c('0x59')])):path[_0x1d6c('0x5e')](config[_0x1d6c('0x5f')],_0x265415,_[_0x1d6c('0x60')](_0x1d6c('0x6d')));var _0x3ffab4=_0x1d6c('0x62')+_[_0x1d6c('0x63')](_0x1d6c('0x59'));if(_0x44ecee[_0x3ffab4]||!_0x48eefc['custom']){_0x109bf3=path[_0x1d6c('0x5e')](config['root'],_0x265415,_['toLower'](_0x1d6c('0x6d')));}if(!fs[_0x1d6c('0x6c')](_0x109bf3)){throw new db[(_0x1d6c('0x65'))]['ValidationError'](_[_0x1d6c('0x63')](_0x1d6c('0x59'))+'\x20not\x20found');}return _0x1c3ef2[_0x1d6c('0x68')](_0x109bf3);}})[_0x1d6c('0x4c')](handleError(_0x1c3ef2,null));};exports[_0x1d6c('0x6e')]=function(_0x178468,_0x4068b7){return db[_0x1d6c('0x35')]['find']({'where':{'id':_0x178468['params']['id']},'attributes':[_0x1d6c('0x6f')]})[_0x1d6c('0x1b')](respondWithResult(_0x4068b7,null))[_0x1d6c('0x4c')](handleError(_0x4068b7,null));};exports[_0x1d6c('0x70')]=function(_0xf56ac1,_0x390bd2,_0x49d75a){if(_0xf56ac1[_0x1d6c('0x53')]&&_0xf56ac1[_0x1d6c('0x53')][_0x1d6c('0x55')]){_0xf56ac1[_0x1d6c('0x51')][_0x1d6c('0x5a')]=_0xf56ac1['file'][_0x1d6c('0x55')];}return db[_0x1d6c('0x35')]['find']({'where':{'id':_0xf56ac1[_0x1d6c('0x52')]['id']}})[_0x1d6c('0x1b')](handleEntityNotFound(_0x390bd2,null))[_0x1d6c('0x1b')](saveUpdates(_0xf56ac1[_0x1d6c('0x51')],null))[_0x1d6c('0x1b')](respondWithResult(_0x390bd2,null))[_0x1d6c('0x4c')](handleError(_0x390bd2,null));};var utilLicense=require(_0x1d6c('0x56'));exports['getPreferred']=function(_0x238d9b,_0x24143c,_0xc639aa){var _0x6d2186=_0x1d6c('0x57');var _0x5ca8d0={'custom':![]};return utilLicense['getLicense']()[_0x1d6c('0x1b')](function(_0x42bf28){if(_0x42bf28){_0x5ca8d0=_0x42bf28;}return db[_0x1d6c('0x35')][_0x1d6c('0x50')]({'where':{'id':_0x238d9b['params']['id']},'attributes':[_0x1d6c('0x54'),_0x1d6c('0x59'),_0x1d6c('0x5a'),_0x1d6c('0x5b'),_0x1d6c('0x5c'),'defaultLoginLogo',_0x1d6c('0x6b'),_0x1d6c('0x5d')],'raw':!![]});})[_0x1d6c('0x1b')](handleEntityNotFound(_0x24143c,null))[_0x1d6c('0x1b')](function(_0x232807){if(_0x232807){var _0x4003bb=_0x232807[_0x1d6c('0x5a')]&&fs[_0x1d6c('0x6c')](path[_0x1d6c('0x5e')](config['root'],_0x6d2186,_[_0x1d6c('0x60')](_0x232807[_0x1d6c('0x5a')])))?path['join'](config[_0x1d6c('0x5f')],_0x6d2186,_[_0x1d6c('0x60')](_0x232807[_0x1d6c('0x5a')])):path[_0x1d6c('0x5e')](config[_0x1d6c('0x5f')],_0x6d2186,_[_0x1d6c('0x60')]('default_preferred.png'));var _0x3bcbdd='default'+_[_0x1d6c('0x63')](_0x1d6c('0x5a'));if(_0x232807[_0x3bcbdd]||!_0x5ca8d0[_0x1d6c('0x64')]||!_0x5ca8d0[_0x1d6c('0x5a')]){_0x4003bb=path['join'](config[_0x1d6c('0x5f')],_0x6d2186,_[_0x1d6c('0x60')]('default_preferred.png'));}if(!fs[_0x1d6c('0x6c')](_0x4003bb)){throw new db[(_0x1d6c('0x65'))]['ValidationError'](_[_0x1d6c('0x63')]('preferred')+_0x1d6c('0x67'));}return _0x24143c[_0x1d6c('0x68')](_0x4003bb);}})[_0x1d6c('0x4c')](handleError(_0x24143c,null));};exports['addFavicon']=function(_0x2e19ef,_0x56da3b,_0x491c06){if(_0x2e19ef[_0x1d6c('0x53')]&&_0x2e19ef[_0x1d6c('0x53')][_0x1d6c('0x55')]){_0x2e19ef['body']['favicon']=_0x2e19ef[_0x1d6c('0x53')][_0x1d6c('0x55')];}return db['Setting'][_0x1d6c('0x50')]({'where':{'id':_0x2e19ef['params']['id']}})[_0x1d6c('0x1b')](handleEntityNotFound(_0x56da3b,null))[_0x1d6c('0x1b')](saveUpdates(_0x2e19ef[_0x1d6c('0x51')],null))[_0x1d6c('0x1b')](respondWithResult(_0x56da3b,null))[_0x1d6c('0x4c')](handleError(_0x56da3b,null));};var utilLicense=require(_0x1d6c('0x56'));exports[_0x1d6c('0x71')]=function(_0x31479b,_0x2ed0c3,_0x4a5a5c){var _0x27bfa5=_0x1d6c('0x57');var _0x598b23={'custom':![]};return utilLicense[_0x1d6c('0x58')]()[_0x1d6c('0x1b')](function(_0x11e578){if(_0x11e578){_0x598b23=_0x11e578;}return db['Setting'][_0x1d6c('0x50')]({'where':{'id':_0x31479b[_0x1d6c('0x52')]['id']},'attributes':[_0x1d6c('0x54'),_0x1d6c('0x59'),_0x1d6c('0x5a'),'favicon',_0x1d6c('0x5c'),'defaultLoginLogo',_0x1d6c('0x6b'),_0x1d6c('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x2ed0c3,null))['then'](function(_0x488c0c){if(_0x488c0c){var _0x29367c=_0x488c0c[_0x1d6c('0x5b')]&&fs[_0x1d6c('0x6c')](path['join'](config[_0x1d6c('0x5f')],_0x27bfa5,_[_0x1d6c('0x60')](_0x488c0c[_0x1d6c('0x5b')])))?path[_0x1d6c('0x5e')](config[_0x1d6c('0x5f')],_0x27bfa5,_['toLower'](_0x488c0c[_0x1d6c('0x5b')])):path[_0x1d6c('0x5e')](config[_0x1d6c('0x5f')],_0x27bfa5,_[_0x1d6c('0x60')](_0x1d6c('0x72')));var _0xdcc2e7=_0x1d6c('0x62')+_[_0x1d6c('0x63')]('favicon');if(_0x488c0c[_0xdcc2e7]||!_0x598b23['custom']){_0x29367c=path['join'](config['root'],_0x27bfa5,_[_0x1d6c('0x60')](_0x1d6c('0x72')));}if(!fs['existsSync'](_0x29367c)){throw new db[(_0x1d6c('0x65'))][(_0x1d6c('0x66'))](_[_0x1d6c('0x63')]('favicon')+_0x1d6c('0x67'));}return _0x2ed0c3[_0x1d6c('0x68')](_0x29367c);}})['catch'](handleError(_0x2ed0c3,null));};exports[_0x1d6c('0x73')]=function(_0x6b420f,_0x23af1e){var _0x33524a={'offset':moment()[_0x1d6c('0x74')]()};_0x33524a[_0x1d6c('0x75')]=moment()['utcOffset'](_0x33524a[_0x1d6c('0x2a')])[_0x1d6c('0x76')](_0x1d6c('0x77'));return _0x23af1e[_0x1d6c('0x26')](0xc8)[_0x1d6c('0x33')](_0x33524a);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index cdd653b..588f55f 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 _0x592f=['define','settings','util','../../config/logger','api','moment','request-promise','../../config/environment','./setting.attributes','exports'];(function(_0x51070b,_0x39c85d){var _0x153240=function(_0x7c02f2){while(--_0x7c02f2){_0x51070b['push'](_0x51070b['shift']());}};_0x153240(++_0x39c85d);}(_0x592f,0x1a6));var _0xf592=function(_0x9e3610,_0x8f6c81){_0x9e3610=_0x9e3610-0x0;var _0x4e72ff=_0x592f[_0x9e3610];return _0x4e72ff;};'use strict';var _=require('lodash');var util=require(_0xf592('0x0'));var logger=require(_0xf592('0x1'))(_0xf592('0x2'));var moment=require(_0xf592('0x3'));var BPromise=require('bluebird');var rp=require(_0xf592('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf592('0x5'));var attributes=require(_0xf592('0x6'));module[_0xf592('0x7')]=function(_0x168aa8,_0x482ad6){return _0x168aa8[_0xf592('0x8')]('Setting',attributes,{'tableName':_0xf592('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdabb=['exports','Setting','settings','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1e4535,_0x37cf32){var _0x4d8658=function(_0x15509a){while(--_0x15509a){_0x1e4535['push'](_0x1e4535['shift']());}};_0x4d8658(++_0x37cf32);}(_0xdabb,0x19a));var _0xbdab=function(_0x262548,_0x15dc38){_0x262548=_0x262548-0x0;var _0x4d16aa=_0xdabb[_0x262548];return _0x4d16aa;};'use strict';var _=require(_0xbdab('0x0'));var util=require('util');var logger=require(_0xbdab('0x1'))(_0xbdab('0x2'));var moment=require('moment');var BPromise=require(_0xbdab('0x3'));var rp=require(_0xbdab('0x4'));var fs=require('fs');var path=require(_0xbdab('0x5'));var rimraf=require(_0xbdab('0x6'));var config=require(_0xbdab('0x7'));var attributes=require('./setting.attributes');module[_0xbdab('0x8')]=function(_0x43f238,_0x5d5221){return _0x43f238['define'](_0xbdab('0x9'),attributes,{'tableName':_0xbdab('0xa'),'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 d310616..6d13ada 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 _0xf6b3=['error','code','message','result','catch','Setting','find','options','raw','where','include','map','model','attributes','ShowSetting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x795265,_0x41e6d5){var _0x13c33b=function(_0x15dabb){while(--_0x15dabb){_0x795265['push'](_0x795265['shift']());}};_0x13c33b(++_0x41e6d5);}(_0xf6b3,0x104));var _0x3f6b=function(_0x26013b,_0x23d44e){_0x26013b=_0x26013b-0x0;var _0x16a91f=_0xf6b3[_0x26013b];return _0x16a91f;};'use strict';var _=require('lodash');var util=require(_0x3f6b('0x0'));var moment=require(_0x3f6b('0x1'));var BPromise=require(_0x3f6b('0x2'));var rs=require(_0x3f6b('0x3'));var fs=require('fs');var Redis=require(_0x3f6b('0x4'));var db=require(_0x3f6b('0x5'))['db'];var utils=require(_0x3f6b('0x6'));var logger=require(_0x3f6b('0x7'))(_0x3f6b('0x8'));var config=require(_0x3f6b('0x9'));var jayson=require(_0x3f6b('0xa'));var client=jayson['client'][_0x3f6b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7177b,_0x257b0c,_0x532ca1){return new BPromise(function(_0x5d109a,_0x24c391){return client[_0x3f6b('0xc')](_0x7177b,_0x532ca1)[_0x3f6b('0xd')](function(_0x132904){logger[_0x3f6b('0xe')](_0x3f6b('0xf'),_0x257b0c,_0x3f6b('0x10'));logger[_0x3f6b('0x11')](_0x3f6b('0x12'),_0x257b0c,'request\x20sent',JSON[_0x3f6b('0x13')](_0x132904));if(_0x132904[_0x3f6b('0x14')]){if(_0x132904[_0x3f6b('0x14')][_0x3f6b('0x15')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x257b0c,_0x132904[_0x3f6b('0x14')][_0x3f6b('0x16')]);return _0x24c391(_0x132904[_0x3f6b('0x14')][_0x3f6b('0x16')]);}logger[_0x3f6b('0x14')](_0x3f6b('0xf'),_0x257b0c,_0x132904['error'][_0x3f6b('0x16')]);return _0x5d109a(_0x132904[_0x3f6b('0x14')][_0x3f6b('0x16')]);}else{logger[_0x3f6b('0xe')](_0x3f6b('0xf'),_0x257b0c,_0x3f6b('0x10'));_0x5d109a(_0x132904[_0x3f6b('0x17')][_0x3f6b('0x16')]);}})[_0x3f6b('0x18')](function(_0x249e37){logger['error']('Setting,\x20%s,\x20%s',_0x257b0c,_0x249e37);_0x24c391(_0x249e37);});});}exports['ShowSetting']=function(_0x1613f5){var _0x40c92b=this;return new Promise(function(_0x3d3c09,_0x5c796b){return db[_0x3f6b('0x19')][_0x3f6b('0x1a')]({'raw':_0x1613f5['options']?_0x1613f5[_0x3f6b('0x1b')][_0x3f6b('0x1c')]===undefined?!![]:![]:!![],'where':_0x1613f5[_0x3f6b('0x1b')]?_0x1613f5['options'][_0x3f6b('0x1d')]||null:null,'attributes':_0x1613f5['options']?_0x1613f5[_0x3f6b('0x1b')]['attributes']||null:null,'include':_0x1613f5['options']?_0x1613f5[_0x3f6b('0x1b')][_0x3f6b('0x1e')]?_[_0x3f6b('0x1f')](_0x1613f5['options']['include'],function(_0x524ea4){return{'model':db[_0x524ea4[_0x3f6b('0x20')]],'as':_0x524ea4['as'],'attributes':_0x524ea4['attributes'],'include':_0x524ea4['include']?_[_0x3f6b('0x1f')](_0x524ea4[_0x3f6b('0x1e')],function(_0x2bd2f6){return{'model':db[_0x2bd2f6[_0x3f6b('0x20')]],'as':_0x2bd2f6['as'],'attributes':_0x2bd2f6[_0x3f6b('0x21')],'include':_0x2bd2f6[_0x3f6b('0x1e')]?_['map'](_0x2bd2f6[_0x3f6b('0x1e')],function(_0x4e8715){return{'model':db[_0x4e8715['model']],'as':_0x4e8715['as'],'attributes':_0x4e8715[_0x3f6b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3f6b('0xd')](function(_0x5467a5){logger[_0x3f6b('0xe')](_0x3f6b('0x22'),_0x1613f5);logger[_0x3f6b('0x11')](_0x3f6b('0x22'),_0x1613f5,JSON[_0x3f6b('0x13')](_0x5467a5));_0x3d3c09(_0x5467a5);})['catch'](function(_0x3f5a83){logger[_0x3f6b('0x14')](_0x3f6b('0x22'),_0x3f5a83['message'],_0x1613f5);_0x5c796b(_0x40c92b[_0x3f6b('0x14')](0x1f4,_0x3f5a83[_0x3f6b('0x16')]));});});}; \ No newline at end of file +var _0x5f1a=['info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','then','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x593111,_0x3b62bf){var _0x1ee3bb=function(_0x53be4d){while(--_0x53be4d){_0x593111['push'](_0x593111['shift']());}};_0x1ee3bb(++_0x3b62bf);}(_0x5f1a,0xda));var _0xa5f1=function(_0x31a35e,_0x55f4b1){_0x31a35e=_0x31a35e-0x0;var _0x5abea4=_0x5f1a[_0x31a35e];return _0x5abea4;};'use strict';var _=require(_0xa5f1('0x0'));var util=require(_0xa5f1('0x1'));var moment=require(_0xa5f1('0x2'));var BPromise=require(_0xa5f1('0x3'));var rs=require(_0xa5f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5f1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa5f1('0x6'))(_0xa5f1('0x7'));var config=require(_0xa5f1('0x8'));var jayson=require(_0xa5f1('0x9'));var client=jayson[_0xa5f1('0xa')][_0xa5f1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5825c8,_0x23cd0b,_0x45fd40){return new BPromise(function(_0x842254,_0x50518b){return client[_0xa5f1('0xc')](_0x5825c8,_0x45fd40)['then'](function(_0xf7eafc){logger[_0xa5f1('0xd')](_0xa5f1('0xe'),_0x23cd0b,_0xa5f1('0xf'));logger['debug'](_0xa5f1('0x10'),_0x23cd0b,_0xa5f1('0xf'),JSON['stringify'](_0xf7eafc));if(_0xf7eafc['error']){if(_0xf7eafc[_0xa5f1('0x11')]['code']===0x1f4){logger[_0xa5f1('0x11')](_0xa5f1('0xe'),_0x23cd0b,_0xf7eafc[_0xa5f1('0x11')][_0xa5f1('0x12')]);return _0x50518b(_0xf7eafc[_0xa5f1('0x11')][_0xa5f1('0x12')]);}logger[_0xa5f1('0x11')](_0xa5f1('0xe'),_0x23cd0b,_0xf7eafc[_0xa5f1('0x11')][_0xa5f1('0x12')]);return _0x842254(_0xf7eafc[_0xa5f1('0x11')][_0xa5f1('0x12')]);}else{logger[_0xa5f1('0xd')](_0xa5f1('0xe'),_0x23cd0b,_0xa5f1('0xf'));_0x842254(_0xf7eafc[_0xa5f1('0x13')][_0xa5f1('0x12')]);}})[_0xa5f1('0x14')](function(_0x5932da){logger[_0xa5f1('0x11')](_0xa5f1('0xe'),_0x23cd0b,_0x5932da);_0x50518b(_0x5932da);});});}exports[_0xa5f1('0x15')]=function(_0x444869){var _0x5956c2=this;return new Promise(function(_0x18ca8f,_0xafe572){return db[_0xa5f1('0x16')][_0xa5f1('0x17')]({'raw':_0x444869[_0xa5f1('0x18')]?_0x444869[_0xa5f1('0x18')][_0xa5f1('0x19')]===undefined?!![]:![]:!![],'where':_0x444869[_0xa5f1('0x18')]?_0x444869['options'][_0xa5f1('0x1a')]||null:null,'attributes':_0x444869[_0xa5f1('0x18')]?_0x444869['options'][_0xa5f1('0x1b')]||null:null,'include':_0x444869[_0xa5f1('0x18')]?_0x444869[_0xa5f1('0x18')][_0xa5f1('0x1c')]?_[_0xa5f1('0x1d')](_0x444869[_0xa5f1('0x18')][_0xa5f1('0x1c')],function(_0x52f88b){return{'model':db[_0x52f88b['model']],'as':_0x52f88b['as'],'attributes':_0x52f88b[_0xa5f1('0x1b')],'include':_0x52f88b[_0xa5f1('0x1c')]?_[_0xa5f1('0x1d')](_0x52f88b[_0xa5f1('0x1c')],function(_0x2e5668){return{'model':db[_0x2e5668[_0xa5f1('0x1e')]],'as':_0x2e5668['as'],'attributes':_0x2e5668['attributes'],'include':_0x2e5668['include']?_[_0xa5f1('0x1d')](_0x2e5668[_0xa5f1('0x1c')],function(_0x40aaae){return{'model':db[_0x40aaae['model']],'as':_0x40aaae['as'],'attributes':_0x40aaae[_0xa5f1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa5f1('0x1f')](function(_0x2f3c0f){logger[_0xa5f1('0xd')]('ShowSetting',_0x444869);logger['debug'](_0xa5f1('0x15'),_0x444869,JSON[_0xa5f1('0x20')](_0x2f3c0f));_0x18ca8f(_0x2f3c0f);})[_0xa5f1('0x14')](function(_0x3644a3){logger[_0xa5f1('0x11')](_0xa5f1('0x15'),_0x3644a3[_0xa5f1('0x12')],_0x444869);_0xafe572(_0x5956c2[_0xa5f1('0x11')](0x1f4,_0x3644a3[_0xa5f1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 5bca5a8..98c3ab4 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 _0x9b2c=['send','status','update','destroy','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/status','statusGet','/:id/users','getAgents','post','create','/:id/dispositions','addAnswer','notify','addApplications','/:id/send'];(function(_0x1589c5,_0x4c499b){var _0x2c85fd=function(_0x3ba55a){while(--_0x3ba55a){_0x1589c5['push'](_0x1589c5['shift']());}};_0x2c85fd(++_0x4c499b);}(_0x9b2c,0x1dc));var _0xc9b2=function(_0x5cb367,_0x27ec9d){_0x5cb367=_0x5cb367-0x0;var _0x279365=_0x9b2c[_0x5cb367];return _0x279365;};'use strict';var multer=require(_0xc9b2('0x0'));var util=require(_0xc9b2('0x1'));var path=require('path');var timeout=require(_0xc9b2('0x2'));var express=require(_0xc9b2('0x3'));var router=express[_0xc9b2('0x4')]();var fs_extra=require(_0xc9b2('0x5'));var auth=require(_0xc9b2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc9b2('0x7'));var controller=require(_0xc9b2('0x8'));router[_0xc9b2('0x9')]('/',auth[_0xc9b2('0xa')](),controller[_0xc9b2('0xb')]);router['get']('/describe',auth[_0xc9b2('0xa')](),controller[_0xc9b2('0xc')]);router[_0xc9b2('0x9')](_0xc9b2('0xd'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0xe')]);router['get']('/:id/dispositions',auth[_0xc9b2('0xa')](),controller[_0xc9b2('0xf')]);router[_0xc9b2('0x9')](_0xc9b2('0x10'),auth['isAuthenticated'](),controller[_0xc9b2('0x11')]);router[_0xc9b2('0x9')](_0xc9b2('0x12'),auth['isAuthenticated'](),controller[_0xc9b2('0x13')]);router[_0xc9b2('0x9')]('/:id/interactions',auth[_0xc9b2('0xa')](),controller['getInteractions']);router[_0xc9b2('0x9')](_0xc9b2('0x14'),controller[_0xc9b2('0x15')]);router['get'](_0xc9b2('0x16'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x17')]);router[_0xc9b2('0x18')]('/',auth['isAuthenticated'](),controller[_0xc9b2('0x19')]);router[_0xc9b2('0x18')](_0xc9b2('0x1a'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xc9b2('0x18')](_0xc9b2('0x10'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x1b')]);router[_0xc9b2('0x18')]('/:id/notify',controller[_0xc9b2('0x1c')]);router['post'](_0xc9b2('0x12'),auth['isAuthenticated'](),controller[_0xc9b2('0x1d')]);router[_0xc9b2('0x18')](_0xc9b2('0x1e'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x1f')]);router[_0xc9b2('0x18')](_0xc9b2('0x14'),controller[_0xc9b2('0x20')]);router[_0xc9b2('0x18')](_0xc9b2('0x16'),auth[_0xc9b2('0xa')](),controller['addAgents']);router['put'](_0xc9b2('0xd'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x21')]);router['delete'](_0xc9b2('0xd'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x22')]);router[_0xc9b2('0x23')]('/:id/dispositions',auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x24')]);router[_0xc9b2('0x23')](_0xc9b2('0x10'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x25')]);router[_0xc9b2('0x23')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc9b2('0x26')]=router; \ No newline at end of file +var _0xa1d3=['status','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send'];(function(_0xfbcaf5,_0x4c4d1d){var _0x57f9f5=function(_0x619e6d){while(--_0x619e6d){_0xfbcaf5['push'](_0xfbcaf5['shift']());}};_0x57f9f5(++_0x4c4d1d);}(_0xa1d3,0x179));var _0x3a1d=function(_0x245d40,_0x455ece){_0x245d40=_0x245d40-0x0;var _0x245534=_0xa1d3[_0x245d40];return _0x245534;};'use strict';var multer=require(_0x3a1d('0x0'));var util=require(_0x3a1d('0x1'));var path=require(_0x3a1d('0x2'));var timeout=require(_0x3a1d('0x3'));var express=require(_0x3a1d('0x4'));var router=express[_0x3a1d('0x5')]();var fs_extra=require(_0x3a1d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3a1d('0x7'));var config=require(_0x3a1d('0x8'));var controller=require(_0x3a1d('0x9'));router[_0x3a1d('0xa')]('/',auth[_0x3a1d('0xb')](),controller[_0x3a1d('0xc')]);router['get'](_0x3a1d('0xd'),auth['isAuthenticated'](),controller[_0x3a1d('0xe')]);router['get'](_0x3a1d('0xf'),auth[_0x3a1d('0xb')](),controller['show']);router[_0x3a1d('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3a1d('0x10')]);router[_0x3a1d('0xa')](_0x3a1d('0x11'),auth[_0x3a1d('0xb')](),controller[_0x3a1d('0x12')]);router['get'](_0x3a1d('0x13'),auth[_0x3a1d('0xb')](),controller[_0x3a1d('0x14')]);router[_0x3a1d('0xa')](_0x3a1d('0x15'),auth['isAuthenticated'](),controller[_0x3a1d('0x16')]);router['get'](_0x3a1d('0x17'),controller[_0x3a1d('0x18')]);router[_0x3a1d('0xa')](_0x3a1d('0x19'),auth['isAuthenticated'](),controller[_0x3a1d('0x1a')]);router[_0x3a1d('0x1b')]('/',auth[_0x3a1d('0xb')](),controller[_0x3a1d('0x1c')]);router[_0x3a1d('0x1b')](_0x3a1d('0x1d'),auth['isAuthenticated'](),controller[_0x3a1d('0x1e')]);router[_0x3a1d('0x1b')](_0x3a1d('0x11'),auth[_0x3a1d('0xb')](),controller[_0x3a1d('0x1f')]);router[_0x3a1d('0x1b')](_0x3a1d('0x20'),controller[_0x3a1d('0x21')]);router[_0x3a1d('0x1b')](_0x3a1d('0x13'),auth[_0x3a1d('0xb')](),controller[_0x3a1d('0x22')]);router['post'](_0x3a1d('0x23'),auth[_0x3a1d('0xb')](),controller[_0x3a1d('0x24')]);router[_0x3a1d('0x1b')](_0x3a1d('0x17'),controller[_0x3a1d('0x25')]);router[_0x3a1d('0x1b')](_0x3a1d('0x19'),auth[_0x3a1d('0xb')](),controller[_0x3a1d('0x26')]);router[_0x3a1d('0x27')](_0x3a1d('0xf'),auth[_0x3a1d('0xb')](),controller[_0x3a1d('0x28')]);router[_0x3a1d('0x29')]('/:id',auth[_0x3a1d('0xb')](),controller[_0x3a1d('0x2a')]);router[_0x3a1d('0x29')](_0x3a1d('0x1d'),auth['isAuthenticated'](),controller[_0x3a1d('0x2b')]);router[_0x3a1d('0x29')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x3a1d('0x29')](_0x3a1d('0x19'),auth['isAuthenticated'](),controller[_0x3a1d('0x2c')]);module[_0x3a1d('0x2d')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index a57b977..245ed06 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 _0xd21b=['twilio','skebby','clicksend','plivo','bandwidth','csc','ENUM','BOOLEAN','TEXT','INTEGER','setDataValue','mandatoryDispositionPauseId','exports','STRING','name'];(function(_0x36856d,_0x24e1d4){var _0x260525=function(_0x27f3ef){while(--_0x27f3ef){_0x36856d['push'](_0x36856d['shift']());}};_0x260525(++_0x24e1d4);}(_0xd21b,0xcf));var _0xbd21=function(_0x349915,_0x124261){_0x349915=_0x349915-0x0;var _0x8be4f3=_0xd21b[_0x349915];return _0x8be4f3;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xbd21('0x0')]={'name':{'type':Sequelize[_0xbd21('0x1')],'unique':_0xbd21('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xbd21('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xbd21('0x1')]},'type':{'type':Sequelize['ENUM'](_0xbd21('0x3'),_0xbd21('0x4'),'connectel',_0xbd21('0x5'),_0xbd21('0x6'),'clickatell',_0xbd21('0x7'),_0xbd21('0x8'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0xbd21('0x1')]},'authId':{'type':Sequelize[_0xbd21('0x1')]},'authToken':{'type':Sequelize[_0xbd21('0x1')]},'smsMethod':{'type':Sequelize[_0xbd21('0x9')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xbd21('0x1')]},'applicationId':{'type':Sequelize[_0xbd21('0x1')]},'accountId':{'type':Sequelize[_0xbd21('0x1')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xbd21('0xa')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xbd21('0xb')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbd21('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbd21('0xc')],'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[_0xbd21('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbd21('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbd21('0xc')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbd21('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x33d70b){if(!_0x33d70b)this[_0xbd21('0xd')](_0xbd21('0xe'),null);this[_0xbd21('0xd')]('mandatoryDisposition',_0x33d70b);}}}; \ No newline at end of file +var _0x0936=['setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','ENUM','twilio','skebby','connectel','clicksend','plivo','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x2c00b3,_0x29b200){var _0x595512=function(_0x33401e){while(--_0x33401e){_0x2c00b3['push'](_0x2c00b3['shift']());}};_0x595512(++_0x29b200);}(_0x0936,0xde));var _0x6093=function(_0x1fadc1,_0xc0f9d9){_0x1fadc1=_0x1fadc1-0x0;var _0x246526=_0x0936[_0x1fadc1];return _0x246526;};'use strict';var Sequelize=require(_0x6093('0x0'));var rs=require(_0x6093('0x1'));module[_0x6093('0x2')]={'name':{'type':Sequelize[_0x6093('0x3')],'unique':_0x6093('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x6093('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x6093('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x6093('0x3')]},'type':{'type':Sequelize[_0x6093('0x5')](_0x6093('0x6'),_0x6093('0x7'),_0x6093('0x8'),_0x6093('0x9'),_0x6093('0xa'),'clickatell','bandwidth',_0x6093('0xb'),_0x6093('0xc'),_0x6093('0xd'))},'accountSid':{'type':Sequelize[_0x6093('0x3')]},'authId':{'type':Sequelize[_0x6093('0x3')]},'authToken':{'type':Sequelize[_0x6093('0x3')]},'smsMethod':{'type':Sequelize[_0x6093('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x6093('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x6093('0x3')]},'accountId':{'type':Sequelize[_0x6093('0x3')]},'senderString':{'type':Sequelize[_0x6093('0x3')]},'deliveryReport':{'type':Sequelize[_0x6093('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x6093('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6093('0xf')],'defaultValue':function(){return _0x6093('0x10');}},'notificationSound':{'type':Sequelize[_0x6093('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6093('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6093('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6093('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6093('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6093('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6093('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x6093('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6093('0x11')],'comment':_0x6093('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x6093('0xe')],'defaultValue':![],'comment':_0x6093('0x13'),'set':function(_0x214118){if(!_0x214118)this[_0x6093('0x14')](_0x6093('0x15'),null);this['setDataValue']('mandatoryDisposition',_0x214118);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 5ccc209..0d01aae 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 _0x1343=['length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','mandatoryDispositionPause','keys','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','SmsAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','MessageSid','text','from','message_id','plivo','Text','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','created','close','unmanaged','SmsMessage','ContactId','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','send','addApplications','transaction','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','List','dataValues','Messages','push','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','connectel','statusInt','clicksend','status_code','groupName','redif','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','state','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','name','index','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','attributes','fields'];(function(_0x4e41c4,_0x4fa440){var _0x3c510d=function(_0x4ae3cb){while(--_0x4ae3cb){_0x4e41c4['push'](_0x4e41c4['shift']());}};_0x3c510d(++_0x4fa440);}(_0x1343,0x180));var _0x3134=function(_0x1739ec,_0x297362){_0x1739ec=_0x1739ec-0x0;var _0x5cf0ca=_0x1343[_0x1739ec];return _0x5cf0ca;};'use strict';var emlformat=require(_0x3134('0x0'));var rimraf=require(_0x3134('0x1'));var zipdir=require(_0x3134('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3134('0x3'));var moment=require(_0x3134('0x4'));var BPromise=require(_0x3134('0x5'));var Mustache=require('mustache');var util=require(_0x3134('0x6'));var path=require(_0x3134('0x7'));var sox=require('sox');var csv=require(_0x3134('0x8'));var ejs=require(_0x3134('0x9'));var fs=require('fs');var fs_extra=require(_0x3134('0xa'));var _=require(_0x3134('0xb'));var squel=require(_0x3134('0xc'));var crypto=require(_0x3134('0xd'));var jsforce=require(_0x3134('0xe'));var deskjs=require(_0x3134('0xf'));var toCsv=require(_0x3134('0x8'));var querystring=require(_0x3134('0x10'));var Papa=require(_0x3134('0x11'));var Redis=require(_0x3134('0x12'));var authService=require(_0x3134('0x13'));var qs=require(_0x3134('0x14'));var as=require(_0x3134('0x15'));var hardwareService=require(_0x3134('0x16'));var logger=require('../../config/logger')(_0x3134('0x17'));var utils=require(_0x3134('0x18'));var config=require(_0x3134('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3134('0x1a'))['db'];config[_0x3134('0x1b')]=_[_0x3134('0x1c')](config[_0x3134('0x1b')],{'host':_0x3134('0x1d'),'port':0x18eb});var socket=require(_0x3134('0x1e'))(new Redis(config[_0x3134('0x1b')]));require(_0x3134('0x1f'))[_0x3134('0x20')](socket);var jayson=require(_0x3134('0x21'));var client=jayson[_0x3134('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x52e07f,_0x34fd89,_0x280ed7,_0x5d7bc0){return new BPromise(function(_0x426db4,_0x121332){var _0x37ad28=_0x5d7bc0||client;return _0x37ad28[_0x3134('0x23')](_0x52e07f,_0x280ed7)[_0x3134('0x24')](function(_0xb5afd){logger[_0x3134('0x25')](_0x3134('0x26'),_0x34fd89,_0x3134('0x27'));logger[_0x3134('0x28')](_0x3134('0x29'),_0x34fd89,_0x3134('0x27'),JSON[_0x3134('0x2a')](_0xb5afd));if(_0xb5afd['error']){if(_0xb5afd[_0x3134('0x2b')]['code']===0x1f4){logger[_0x3134('0x2b')](_0x3134('0x26'),_0x34fd89,_0xb5afd[_0x3134('0x2b')]['message']);return _0x121332(_0xb5afd[_0x3134('0x2b')][_0x3134('0x2c')]);}logger[_0x3134('0x2b')](_0x3134('0x26'),_0x34fd89,_0xb5afd['error'][_0x3134('0x2c')]);return _0x426db4(_0xb5afd[_0x3134('0x2b')][_0x3134('0x2c')]);}else{logger['info'](_0x3134('0x26'),_0x34fd89,_0x3134('0x27'));_0x426db4(_0xb5afd[_0x3134('0x2d')][_0x3134('0x2c')]);}})['catch'](function(_0x3586a6){logger[_0x3134('0x2b')]('SmsAccount,\x20%s,\x20%s',_0x34fd89,_0x3586a6);_0x121332(_0x3586a6);});});}function respondWithStatusCode(_0x2ea955,_0xfd3a5e){_0xfd3a5e=_0xfd3a5e||0xcc;return function(_0x2a0735){if(_0x2a0735){return _0x2ea955[_0x3134('0x2e')](_0xfd3a5e);}return _0x2ea955['status'](_0xfd3a5e)[_0x3134('0x2f')]();};}function respondWithResult(_0x4acf1a,_0x450137){_0x450137=_0x450137||0xc8;return function(_0x1dfe0d){if(_0x1dfe0d){return _0x4acf1a[_0x3134('0x30')](_0x450137)[_0x3134('0x31')](_0x1dfe0d);}};}function respondWithFilteredResult(_0x42f764,_0x329579){return function(_0x42d7de){if(_0x42d7de){var _0xcdbe95=typeof _0x329579[_0x3134('0x32')]===_0x3134('0x33')&&typeof _0x329579[_0x3134('0x34')]===_0x3134('0x33');var _0x2462fd=_0x42d7de['count'];var _0x20f75f=_0xcdbe95?0x0:_0x329579[_0x3134('0x32')];var _0x80cf5b=_0xcdbe95?_0x42d7de[_0x3134('0x35')]:_0x329579[_0x3134('0x32')]+_0x329579['limit'];var _0x565704;if(_0x80cf5b>=_0x2462fd){_0x80cf5b=_0x2462fd;_0x565704=0xc8;}else{_0x565704=0xce;}_0x42f764[_0x3134('0x30')](_0x565704);return _0x42f764[_0x3134('0x36')](_0x3134('0x37'),_0x20f75f+'-'+_0x80cf5b+'/'+_0x2462fd)['json'](_0x42d7de);}return null;};}function patchUpdates(_0x3828dd){return function(_0x4cd926){try{jsonpatch['apply'](_0x4cd926,_0x3828dd,!![]);}catch(_0x15ecf4){return BPromise[_0x3134('0x38')](_0x15ecf4);}return _0x4cd926[_0x3134('0x39')]();};}function saveUpdates(_0x5bc834,_0x1e8340){return function(_0x131b54){if(_0x131b54){return _0x131b54[_0x3134('0x3a')](_0x5bc834)[_0x3134('0x24')](function(_0x5c4f59){return _0x5c4f59;});}return null;};}function removeEntity(_0x25a21c,_0x1be100){return function(_0x3a632c){if(_0x3a632c){return _0x3a632c[_0x3134('0x3b')]()[_0x3134('0x24')](function(){var _0x1175b1=_0x3a632c[_0x3134('0x3c')]({'plain':!![]});var _0x2bf8cf=_0x3134('0x3d');return db[_0x3134('0x3e')][_0x3134('0x3b')]({'where':{'type':_0x2bf8cf,'resourceId':_0x1175b1['id']}})[_0x3134('0x24')](function(){return _0x3a632c;});})[_0x3134('0x24')](function(){_0x25a21c[_0x3134('0x30')](0xcc)[_0x3134('0x2f')]();});}};}function handleEntityNotFound(_0xdaf4c0,_0x4ec856){return function(_0x2e5c48){if(!_0x2e5c48){_0xdaf4c0[_0x3134('0x2e')](0x194);}return _0x2e5c48;};}function handleError(_0x4d67d1,_0x5258b9){_0x5258b9=_0x5258b9||0x1f4;return function(_0x25fb67){logger[_0x3134('0x2b')](_0x25fb67['stack']);if(_0x25fb67[_0x3134('0x3f')]){delete _0x25fb67[_0x3134('0x3f')];}_0x4d67d1[_0x3134('0x30')](_0x5258b9)['send'](_0x25fb67);};}exports[_0x3134('0x40')]=function(_0x3d4041,_0xd5bf0a){var _0x1e8317={'include':[{'model':db[_0x3134('0x41')],'as':'mandatoryDispositionPause'}]},_0x37249d={},_0x283d1a={'count':0x0,'rows':[]};var _0x2f4357=_[_0x3134('0x42')](db[_0x3134('0x43')][_0x3134('0x44')],function(_0x3dcda6){return{'name':_0x3dcda6[_0x3134('0x45')],'type':_0x3dcda6[_0x3134('0x46')][_0x3134('0x47')]};});_0x37249d[_0x3134('0x48')]=_['map'](_0x2f4357,_0x3134('0x3f'));_0x37249d[_0x3134('0x49')]=_['keys'](_0x3d4041[_0x3134('0x49')]);_0x37249d['filters']=_['intersection'](_0x37249d[_0x3134('0x48')],_0x37249d[_0x3134('0x49')]);_0x1e8317[_0x3134('0x4a')]=_['intersection'](_0x37249d[_0x3134('0x48')],qs[_0x3134('0x4b')](_0x3d4041[_0x3134('0x49')][_0x3134('0x4b')]));_0x1e8317[_0x3134('0x4a')]=_0x1e8317[_0x3134('0x4a')][_0x3134('0x4c')]?_0x1e8317[_0x3134('0x4a')]:_0x37249d[_0x3134('0x48')];if(!_0x3d4041[_0x3134('0x49')][_0x3134('0x4d')](_0x3134('0x4e'))){_0x1e8317[_0x3134('0x34')]=qs[_0x3134('0x34')](_0x3d4041['query'][_0x3134('0x34')]);_0x1e8317[_0x3134('0x32')]=qs['offset'](_0x3d4041['query'][_0x3134('0x32')]);}_0x1e8317[_0x3134('0x4f')]=qs['sort'](_0x3d4041['query'][_0x3134('0x50')]);_0x1e8317[_0x3134('0x51')]=qs['filters'](_[_0x3134('0x52')](_0x3d4041['query'],_0x37249d[_0x3134('0x53')]),_0x2f4357);if(_0x3d4041[_0x3134('0x49')][_0x3134('0x54')]){_0x1e8317[_0x3134('0x51')]=_[_0x3134('0x55')](_0x1e8317[_0x3134('0x51')],{'$or':_[_0x3134('0x42')](_0x2f4357,function(_0x1729d8){if(_0x1729d8[_0x3134('0x46')]!==_0x3134('0x56')){var _0x189087={};_0x189087[_0x1729d8[_0x3134('0x3f')]]={'$like':'%'+_0x3d4041['query'][_0x3134('0x54')]+'%'};return _0x189087;}})});}_0x1e8317=_[_0x3134('0x55')]({},_0x1e8317,_0x3d4041[_0x3134('0x57')]);var _0xce9930={'where':_0x1e8317[_0x3134('0x51')]};return db[_0x3134('0x43')][_0x3134('0x35')](_0xce9930)[_0x3134('0x24')](function(_0x166c38){_0x283d1a[_0x3134('0x35')]=_0x166c38;if(_0x3d4041[_0x3134('0x49')][_0x3134('0x58')]){_0x1e8317[_0x3134('0x59')]=[{'all':!![]}];}return db[_0x3134('0x43')]['findAll'](_0x1e8317);})[_0x3134('0x24')](function(_0x3eff52){_0x283d1a[_0x3134('0x5a')]=_0x3eff52;return _0x283d1a;})[_0x3134('0x24')](respondWithFilteredResult(_0xd5bf0a,_0x1e8317))[_0x3134('0x5b')](handleError(_0xd5bf0a,null));};exports[_0x3134('0x5c')]=function(_0x5e1b6a,_0xc4b2aa){var _0x515a88={'raw':![],'where':{'id':_0x5e1b6a[_0x3134('0x5d')]['id']},'include':[{'model':db[_0x3134('0x41')],'as':_0x3134('0x5e')}]},_0x56fa1c={};_0x56fa1c['model']=_[_0x3134('0x5f')](db[_0x3134('0x43')][_0x3134('0x44')]);_0x56fa1c[_0x3134('0x49')]=_[_0x3134('0x5f')](_0x5e1b6a[_0x3134('0x49')]);_0x56fa1c['filters']=_[_0x3134('0x60')](_0x56fa1c[_0x3134('0x48')],_0x56fa1c[_0x3134('0x49')]);_0x515a88[_0x3134('0x4a')]=_[_0x3134('0x60')](_0x56fa1c[_0x3134('0x48')],qs[_0x3134('0x4b')](_0x5e1b6a['query']['fields']));_0x515a88[_0x3134('0x4a')]=_0x515a88['attributes'][_0x3134('0x4c')]?_0x515a88[_0x3134('0x4a')]:_0x56fa1c[_0x3134('0x48')];if(_0x5e1b6a['query']['includeAll']){_0x515a88[_0x3134('0x59')]=[{'all':!![]}];}_0x515a88=_[_0x3134('0x55')]({},_0x515a88,_0x5e1b6a[_0x3134('0x57')]);return db[_0x3134('0x43')][_0x3134('0x61')](_0x515a88)[_0x3134('0x24')](handleEntityNotFound(_0xc4b2aa,null))[_0x3134('0x24')](respondWithResult(_0xc4b2aa,null))[_0x3134('0x5b')](handleError(_0xc4b2aa,null));};exports[_0x3134('0x62')]=function(_0x457aef,_0x5b2008){return db[_0x3134('0x43')]['create'](_0x457aef['body'],{})[_0x3134('0x24')](function(_0x2d30d1){var _0x327a5c=_0x457aef[_0x3134('0x63')]['get']({'plain':!![]});if(!_0x327a5c)throw new Error(_0x3134('0x64'));if(_0x327a5c[_0x3134('0x65')]===_0x3134('0x63')){var _0x57b580=_0x2d30d1[_0x3134('0x3c')]({'plain':!![]});var _0x538ded=_0x3134('0x3d');return db[_0x3134('0x66')][_0x3134('0x61')]({'where':{'name':_0x538ded,'userProfileId':_0x327a5c[_0x3134('0x67')]},'raw':!![]})[_0x3134('0x24')](function(_0x350bde){if(_0x350bde&&_0x350bde[_0x3134('0x68')]===0x0){return db[_0x3134('0x3e')][_0x3134('0x62')]({'name':_0x57b580['name'],'resourceId':_0x57b580['id'],'type':_0x350bde[_0x3134('0x3f')],'sectionId':_0x350bde['id']},{})[_0x3134('0x24')](function(){return _0x2d30d1;});}else{return _0x2d30d1;}})[_0x3134('0x5b')](function(_0x350ef7){logger['error'](_0x3134('0x69'),_0x350ef7);throw _0x350ef7;});}return _0x2d30d1;})[_0x3134('0x24')](respondWithResult(_0x5b2008,0xc9))['catch'](handleError(_0x5b2008,null));};exports[_0x3134('0x3a')]=function(_0x16bee8,_0x485488){if(_0x16bee8[_0x3134('0x6a')]['id']){delete _0x16bee8['body']['id'];}return db[_0x3134('0x43')][_0x3134('0x61')]({'where':{'id':_0x16bee8[_0x3134('0x5d')]['id']},'include':[{'model':db[_0x3134('0x41')],'as':_0x3134('0x5e')}]})['then'](handleEntityNotFound(_0x485488,null))[_0x3134('0x24')](saveUpdates(_0x16bee8['body'],null))[_0x3134('0x24')](respondWithResult(_0x485488,null))['catch'](handleError(_0x485488,null));};exports['destroy']=function(_0xdc35bb,_0x10a3eb){return db[_0x3134('0x43')][_0x3134('0x61')]({'where':{'id':_0xdc35bb['params']['id']}})[_0x3134('0x24')](handleEntityNotFound(_0x10a3eb,null))['then'](removeEntity(_0x10a3eb,null))['catch'](handleError(_0x10a3eb,null));};exports[_0x3134('0x6b')]=function(_0x47e5ea,_0x2f0d16){return db[_0x3134('0x43')][_0x3134('0x6b')]()[_0x3134('0x24')](respondWithResult(_0x2f0d16,null))['catch'](handleError(_0x2f0d16,null));};exports['addDisposition']=function(_0x5309ff,_0x43229a,_0x454972){if(_0x5309ff[_0x3134('0x6a')]['id']){delete _0x5309ff['body']['id'];}return db[_0x3134('0x43')]['find']({'where':{'id':_0x5309ff[_0x3134('0x5d')]['id']}})['then'](handleEntityNotFound(_0x43229a,null))[_0x3134('0x24')](function(_0x353b24){if(_0x353b24){_0x5309ff[_0x3134('0x6a')][_0x3134('0x6c')]=_0x353b24['id'];return db[_0x3134('0x6d')][_0x3134('0x62')](_0x5309ff[_0x3134('0x6a')]);}})[_0x3134('0x24')](respondWithResult(_0x43229a,null))['catch'](handleError(_0x43229a,null));};exports[_0x3134('0x6e')]=function(_0x2a5634,_0x56a9a9,_0x11ff05){var _0x15b14f={'raw':![],'where':{}};var _0x25a895={};var _0x422be7={'count':0x0,'rows':[]};return db[_0x3134('0x43')][_0x3134('0x6f')]({'where':{'id':_0x2a5634['params']['id']}})[_0x3134('0x24')](handleEntityNotFound(_0x56a9a9,null))[_0x3134('0x24')](function(_0x523387){if(_0x523387){_0x25a895[_0x3134('0x48')]=_['keys'](db[_0x3134('0x6d')][_0x3134('0x44')]);_0x25a895['query']=_[_0x3134('0x5f')](_0x2a5634['query']);_0x25a895[_0x3134('0x53')]=_[_0x3134('0x60')](_0x25a895[_0x3134('0x48')],_0x25a895[_0x3134('0x49')]);_0x15b14f['attributes']=_[_0x3134('0x60')](_0x25a895[_0x3134('0x48')],qs[_0x3134('0x4b')](_0x2a5634[_0x3134('0x49')][_0x3134('0x4b')]));_0x15b14f[_0x3134('0x4a')]=_0x15b14f[_0x3134('0x4a')][_0x3134('0x4c')]?_0x15b14f[_0x3134('0x4a')]:_0x25a895['model'];if(!_0x2a5634[_0x3134('0x49')][_0x3134('0x4d')](_0x3134('0x4e'))){_0x15b14f['limit']=qs[_0x3134('0x34')](_0x2a5634[_0x3134('0x49')][_0x3134('0x34')]);_0x15b14f[_0x3134('0x32')]=qs[_0x3134('0x32')](_0x2a5634['query']['offset']);}_0x15b14f[_0x3134('0x4f')]=qs[_0x3134('0x50')](_0x2a5634[_0x3134('0x49')][_0x3134('0x50')]);_0x15b14f[_0x3134('0x51')]=qs['filters'](_[_0x3134('0x52')](_0x2a5634['query'],_0x25a895[_0x3134('0x53')]));_0x15b14f['where'][_0x3134('0x6c')]=_0x523387['id'];if(_0x2a5634['query']['filter']){_0x15b14f[_0x3134('0x51')]=_[_0x3134('0x55')](_0x15b14f[_0x3134('0x51')],{'$or':_[_0x3134('0x42')](_0x15b14f[_0x3134('0x4a')],function(_0x3057d3){var _0x2aeb7c={};_0x2aeb7c[_0x3057d3]={'$like':'%'+_0x2a5634[_0x3134('0x49')][_0x3134('0x54')]+'%'};return _0x2aeb7c;})});}_0x15b14f=_[_0x3134('0x55')]({},_0x15b14f,_0x2a5634['options']);return db['Disposition']['count']({'where':_0x15b14f['where']})['then'](function(_0x35be8e){_0x422be7['count']=_0x35be8e;if(_0x2a5634['query'][_0x3134('0x58')]){_0x15b14f[_0x3134('0x59')]=[{'all':!![]}];}return db[_0x3134('0x6d')][_0x3134('0x70')](_0x15b14f);})[_0x3134('0x24')](function(_0x55c332){_0x422be7[_0x3134('0x5a')]=_0x55c332;return _0x422be7;});}})[_0x3134('0x24')](respondWithFilteredResult(_0x56a9a9,_0x15b14f))[_0x3134('0x5b')](handleError(_0x56a9a9,null));};exports[_0x3134('0x71')]=function(_0x1d6bcf,_0xfec4c8,_0x28497f){return db['SmsAccount'][_0x3134('0x61')]({'where':{'id':_0x1d6bcf[_0x3134('0x5d')]['id']}})[_0x3134('0x24')](handleEntityNotFound(_0xfec4c8,null))['then'](function(_0x534919){if(_0x534919){return _0x534919[_0x3134('0x71')](_0x1d6bcf[_0x3134('0x49')][_0x3134('0x72')]);}})[_0x3134('0x24')](respondWithStatusCode(_0xfec4c8,null))[_0x3134('0x5b')](handleError(_0xfec4c8,null));};exports[_0x3134('0x73')]=function(_0x3ddcfb,_0x27065c,_0x33ae3a){if(_0x3ddcfb[_0x3134('0x6a')]['id']){delete _0x3ddcfb['body']['id'];}return db[_0x3134('0x43')][_0x3134('0x61')]({'where':{'id':_0x3ddcfb[_0x3134('0x5d')]['id']}})[_0x3134('0x24')](handleEntityNotFound(_0x27065c,null))[_0x3134('0x24')](function(_0x25955d){if(_0x25955d){_0x3ddcfb[_0x3134('0x6a')]['SmsAccountId']=_0x25955d['id'];return db['CannedAnswer'][_0x3134('0x62')](_0x3ddcfb['body']);}})[_0x3134('0x24')](respondWithResult(_0x27065c,null))['catch'](handleError(_0x27065c,null));};exports[_0x3134('0x74')]=function(_0x19d0d3,_0x1c9cc7,_0x917c0d){var _0x511bf7={'raw':![],'where':{}};var _0x2f880e={};var _0x1cc60b={'count':0x0,'rows':[]};return db[_0x3134('0x43')][_0x3134('0x6f')]({'where':{'id':_0x19d0d3[_0x3134('0x5d')]['id']}})[_0x3134('0x24')](handleEntityNotFound(_0x1c9cc7,null))['then'](function(_0x4d4133){if(_0x4d4133){_0x2f880e[_0x3134('0x48')]=_[_0x3134('0x5f')](db['CannedAnswer'][_0x3134('0x44')]);_0x2f880e[_0x3134('0x49')]=_[_0x3134('0x5f')](_0x19d0d3[_0x3134('0x49')]);_0x2f880e[_0x3134('0x53')]=_['intersection'](_0x2f880e['model'],_0x2f880e['query']);_0x511bf7['attributes']=_['intersection'](_0x2f880e[_0x3134('0x48')],qs[_0x3134('0x4b')](_0x19d0d3[_0x3134('0x49')]['fields']));_0x511bf7['attributes']=_0x511bf7[_0x3134('0x4a')]['length']?_0x511bf7[_0x3134('0x4a')]:_0x2f880e[_0x3134('0x48')];if(!_0x19d0d3[_0x3134('0x49')]['hasOwnProperty'](_0x3134('0x4e'))){_0x511bf7[_0x3134('0x34')]=qs[_0x3134('0x34')](_0x19d0d3['query']['limit']);_0x511bf7['offset']=qs[_0x3134('0x32')](_0x19d0d3['query'][_0x3134('0x32')]);}_0x511bf7[_0x3134('0x4f')]=qs['sort'](_0x19d0d3[_0x3134('0x49')]['sort']);_0x511bf7[_0x3134('0x51')]=qs[_0x3134('0x53')](_[_0x3134('0x52')](_0x19d0d3[_0x3134('0x49')],_0x2f880e[_0x3134('0x53')]));_0x511bf7[_0x3134('0x51')][_0x3134('0x6c')]=_0x4d4133['id'];if(_0x19d0d3[_0x3134('0x49')]['filter']){_0x511bf7[_0x3134('0x51')]=_[_0x3134('0x55')](_0x511bf7[_0x3134('0x51')],{'$or':_[_0x3134('0x42')](_0x511bf7[_0x3134('0x4a')],function(_0x377b39){var _0x2215c2={};_0x2215c2[_0x377b39]={'$like':'%'+_0x19d0d3[_0x3134('0x49')][_0x3134('0x54')]+'%'};return _0x2215c2;})});}_0x511bf7=_['merge']({},_0x511bf7,_0x19d0d3[_0x3134('0x57')]);return db[_0x3134('0x75')][_0x3134('0x35')]({'where':_0x511bf7['where']})[_0x3134('0x24')](function(_0x269294){_0x1cc60b[_0x3134('0x35')]=_0x269294;if(_0x19d0d3[_0x3134('0x49')]['includeAll']){_0x511bf7['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x3134('0x70')](_0x511bf7);})['then'](function(_0x593ecf){_0x1cc60b[_0x3134('0x5a')]=_0x593ecf;return _0x1cc60b;});}})[_0x3134('0x24')](respondWithFilteredResult(_0x1c9cc7,_0x511bf7))['catch'](handleError(_0x1c9cc7,null));};exports[_0x3134('0x76')]=function(_0x57e5ae,_0x182844,_0x59a8ba){return db[_0x3134('0x43')][_0x3134('0x61')]({'where':{'id':_0x57e5ae['params']['id']}})[_0x3134('0x24')](handleEntityNotFound(_0x182844,null))[_0x3134('0x24')](function(_0x1f7323){if(_0x1f7323){return _0x1f7323[_0x3134('0x76')](_0x57e5ae[_0x3134('0x49')][_0x3134('0x72')]);}})[_0x3134('0x24')](respondWithStatusCode(_0x182844,null))[_0x3134('0x5b')](handleError(_0x182844,null));};exports[_0x3134('0x77')]=function(_0x5b8e87,_0x5f154d,_0xaead4e){var _0xfd9544={'channel':_0x3134('0x78')};var _0x99e302=[];var _0x2773c8=[];var _0x2a5690={};return db['SmsAccount'][_0x3134('0x61')]({'where':{'id':_0x5b8e87[_0x3134('0x5d')]['id']},'include':[{'model':db[_0x3134('0x79')],'as':_0x3134('0x7a')}]})[_0x3134('0x24')](handleEntityNotFound(_0x5f154d,null))[_0x3134('0x24')](function(_0x5720ea){_0xfd9544[_0x3134('0x7b')]=_0x5720ea;_0xfd9544[_0x3134('0x7c')]=_[_0x3134('0x7d')](_0x5720ea[_0x3134('0x7a')],[_0x3134('0x7e')],[_0x3134('0x7f')]);if(_0xfd9544[_0x3134('0x7b')][_0x3134('0x7a')]){delete _0xfd9544[_0x3134('0x7b')][_0x3134('0x7a')];}return db[_0x3134('0x80')][_0x3134('0x6b')]();})[_0x3134('0x24')](function(_0x255a56){if(!_0x255a56){throw new db[(_0x3134('0x81'))][(_0x3134('0x82'))]('no\x20available\x20attributes');}_0x99e302=_[_0x3134('0x83')](_[_0x3134('0x5f')](_0x255a56),[_0x3134('0x84'),_0x3134('0x85')]);_0x2773c8=_[_0x3134('0x83')](_['keys'](_0x255a56),[_0x3134('0x84'),'updatedAt',_0x3134('0x86'),_0x3134('0x87')]);_0xfd9544[_0x3134('0x6a')]={'mapKey':_0x3134('0x88')};if(_0xfd9544[_0x3134('0x7b')][_0x3134('0x46')]){switch(_0xfd9544[_0x3134('0x7b')][_0x3134('0x46')]){case _0x3134('0x89'):_0xfd9544[_0x3134('0x6a')]['from']=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x8a')];_0xfd9544[_0x3134('0x6a')][_0x3134('0x6a')]=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x8b')];_0xfd9544[_0x3134('0x6a')][_0x3134('0x8c')]=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x8d')];break;case'skebby':_0xfd9544[_0x3134('0x6a')]['from']='+'+_0x5b8e87['body']['sender'];_0xfd9544['body'][_0x3134('0x6a')]=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x8e')];break;case'connectel':_0xfd9544[_0x3134('0x6a')]['from']=_0x5b8e87[_0x3134('0x6a')]['from'];_0xfd9544[_0x3134('0x6a')]['body']=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x2c')];break;case'clicksend':_0xfd9544['body']['from']=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x8f')];_0xfd9544[_0x3134('0x6a')][_0x3134('0x6a')]=_0x5b8e87[_0x3134('0x6a')]['body'];_0xfd9544[_0x3134('0x6a')][_0x3134('0x8c')]=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x90')];break;case _0x3134('0x91'):_0xfd9544[_0x3134('0x6a')][_0x3134('0x8f')]=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x8a')];_0xfd9544[_0x3134('0x6a')]['body']=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x92')];_0xfd9544[_0x3134('0x6a')][_0x3134('0x8c')]=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x93')];break;case _0x3134('0x94'):_0xfd9544['body'][_0x3134('0x8f')]='+'+_0x5b8e87['body'][_0x3134('0x95')][0x0][_0x3134('0x8f')];_0xfd9544[_0x3134('0x6a')][_0x3134('0x6a')]=_0x5b8e87['body'][_0x3134('0x95')][0x0]['text'];_0xfd9544[_0x3134('0x6a')][_0x3134('0x8c')]=_0x5b8e87['body'][_0x3134('0x95')][0x0]['messageId'];break;case _0x3134('0x96'):_0xfd9544[_0x3134('0x6a')][_0x3134('0x8f')]=_0x5b8e87[_0x3134('0x6a')]['originatingAddress'];_0xfd9544[_0x3134('0x6a')][_0x3134('0x6a')]=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x97')]['message'];break;case _0x3134('0x98'):_0xfd9544['body'][_0x3134('0x8f')]=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x99')];_0xfd9544[_0x3134('0x6a')][_0x3134('0x6a')]=_0x5b8e87['body'][_0x3134('0x8e')];_0xfd9544[_0x3134('0x6a')][_0x3134('0x8c')]=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x9a')];break;case _0x3134('0x9b'):_0xfd9544['body'][_0x3134('0x8c')]=_0x5b8e87[_0x3134('0x6a')][0x0][_0x3134('0x2c')]['id'];_0xfd9544[_0x3134('0x6a')]['from']=_0x5b8e87['body'][0x0][_0x3134('0x2c')]['from'];_0xfd9544[_0x3134('0x6a')]['body']=_0x5b8e87[_0x3134('0x6a')][0x0][_0x3134('0x2c')]['text'];break;case _0x3134('0x9c'):_0xfd9544[_0x3134('0x6a')][_0x3134('0x8f')]=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x8f')];_0xfd9544[_0x3134('0x6a')][_0x3134('0x6a')]=_0x5b8e87[_0x3134('0x6a')]['message'];_0xfd9544['body']['messageId']=_0x5b8e87[_0x3134('0x6a')][_0x3134('0x9d')];break;}}if(_0xfd9544[_0x3134('0x6a')]['id']){delete _0xfd9544[_0x3134('0x6a')]['id'];}if(_[_0x3134('0x9e')](_0xfd9544[_0x3134('0x6a')]['from'])){throw new db[(_0x3134('0x81'))][(_0x3134('0x82'))](_0x3134('0x9f'));}if(_[_0x3134('0x9e')](_0xfd9544[_0x3134('0x6a')]['body'])||_0xfd9544['body'][_0x3134('0x6a')]===''){throw new db['Sequelize'][(_0x3134('0x82'))](_0x3134('0xa0'));}if(_[_0x3134('0x9e')](_0xfd9544[_0x3134('0x6a')]['mapKey'])){throw new db[(_0x3134('0x81'))]['ValidationError'](_0x3134('0xa1')+_0x2773c8);}if(!_[_0x3134('0xa2')](_0x2773c8,_0xfd9544[_0x3134('0x6a')]['mapKey'])){throw new db[(_0x3134('0x81'))][(_0x3134('0x82'))](_0x3134('0xa3')+_0x2773c8);}_0x2a5690[_0xfd9544[_0x3134('0x6a')][_0x3134('0xa4')]]=_0xfd9544['body'][_0x3134('0x8f')];return db['CmList'][_0x3134('0x61')]({'where':{'id':_0xfd9544[_0x3134('0x7b')][_0x3134('0x87')]},'include':[{'model':db[_0x3134('0x80')],'as':_0x3134('0xa5'),'where':_0x2a5690,'limit':0x1,'order':[['updatedAt',_0x3134('0xa6')]]}]});})[_0x3134('0x24')](handleEntityNotFound(_0x5f154d,null))[_0x3134('0x24')](function(_0x5ed52e){if(_0x5ed52e){_0xfd9544[_0x3134('0xa7')]=_[_0x3134('0xa8')](_0x5ed52e,[_0x3134('0xa5')]);if(_0x5ed52e[_0x3134('0xa5')][_0x3134('0x4c')]){return _0x5ed52e[_0x3134('0xa5')][0x0];}var _0x49005a=_['defaults'](_0xfd9544['body'],{'firstName':_0xfd9544[_0x3134('0x6a')][_0x3134('0x8f')],'ListId':_0x5ed52e['id']});_0x49005a[_0xfd9544[_0x3134('0x6a')][_0x3134('0xa4')]]=_0xfd9544[_0x3134('0x6a')][_0x3134('0x8f')];return db[_0x3134('0x80')][_0x3134('0x62')](_0x49005a,{'fields':_0x99e302,'raw':!![]});}})[_0x3134('0x24')](handleEntityNotFound(_0x5f154d,null))['then'](function(_0x5a96e1){if(_0x5a96e1){_0xfd9544['contact']=_0x5a96e1;var _0x64b228={'ContactId':_0x5a96e1['id'],'phone':_0xfd9544['body'][_0x3134('0x8f')],'SmsAccountId':_0x5b8e87[_0x3134('0x5d')]['id']};var _0x3959ce={'ContactId':_0x5a96e1['id'],'SmsAccountId':_0x5b8e87[_0x3134('0x5d')]['id'],'closed':![]};return db[_0x3134('0xa9')][_0x3134('0x61')]({'where':_0x3959ce})[_0x3134('0x24')](function(_0x56a891){if(_0x56a891){return[_0x56a891,![]];}return db[_0x3134('0xa9')][_0x3134('0x62')](_0x64b228)[_0x3134('0x24')](function(_0x54c263){return[_0x54c263,!![]];});});}})[_0x3134('0xaa')](function(_0x569413,_0x36fe73){_0xfd9544['interaction']=_0x569413[_0x3134('0x3c')]({'plain':!![]});_0xfd9544[_0x3134('0xab')][_0x3134('0xac')]=![];if(_0x36fe73){if(_0xfd9544[_0x3134('0x7b')]['autoclose']){_0xfd9544['applications']['push']({'id':0x0,'priority':_0xfd9544[_0x3134('0x7c')][_0x3134('0x4c')]+0x1,'app':_0x3134('0xad'),'appdata':_0x3134('0xae'),'interval':'*,*,*,*'});}_0xfd9544[_0x3134('0xab')][_0x3134('0xac')]=!![];}return db[_0x3134('0xaf')][_0x3134('0x62')]({'phone':_0xfd9544[_0x3134('0x6a')][_0x3134('0x8f')],'messageId':_0xfd9544[_0x3134('0x6a')][_0x3134('0x8c')],'body':_0xfd9544[_0x3134('0x6a')]['body'],'SmsAccountId':_0x5b8e87['params']['id'],'SmsInteractionId':_0x569413['id'],'direction':'in','ContactId':_0x569413[_0x3134('0xb0')],'AttachmentId':_0xfd9544[_0x3134('0x6a')][_0x3134('0xb1')]});})[_0x3134('0x24')](function(_0xc64d58){_0xfd9544[_0x3134('0x2c')]=_0xc64d58;if(_0xfd9544[_0x3134('0xab')]['UserId']){return db[_0x3134('0xb2')][_0x3134('0x61')]({'attributes':['id',_0x3134('0x3f')],'where':{'id':_0xfd9544[_0x3134('0xab')][_0x3134('0xb3')]}})[_0x3134('0x24')](function(_0x4009bc){if(_0x4009bc){_0xfd9544['applications'][_0x3134('0xb4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4009bc[_0x3134('0x3f')]+','+(_0xfd9544[_0x3134('0x7b')][_0x3134('0xb5')]||0xa),'interval':_0x3134('0xb6')});}return respondWithRpcPromise(_0x3134('0xb7'),_0x3134('0xb8'),_0xfd9544);});}return respondWithRpcPromise(_0x3134('0xb7'),'startRouting',_0xfd9544);})[_0x3134('0x24')](function(_0x3ac5d2){if(_0x3ac5d2){var _0x5a0a9f=0xc8;var _0x486a5f=_0x3134('0xb9');logger[_0x3134('0x25')](_0x3134('0x29'),_0x486a5f,_0x5a0a9f,_0x3134('0xba'));logger[_0x3134('0x28')](_0x3134('0xbb'),_0x486a5f,_0x5a0a9f,_0x3134('0xba'),JSON[_0x3134('0x2a')](_0x3ac5d2));if(_0xfd9544['account'][_0x3134('0x46')]===_0x3134('0x89')){return _0x5f154d['status'](_0x5a0a9f)[_0x3134('0x36')]('Content-Type',_0x3134('0xbc'))[_0x3134('0xbd')]('\x0a');}else{return _0x5f154d['status'](_0x5a0a9f)[_0x3134('0x31')](_0x3ac5d2);}}})['catch'](handleError(_0x5f154d,null));};exports[_0x3134('0xbe')]=function(_0xadf742,_0x27b05b,_0x758d79){return db[_0x3134('0x43')][_0x3134('0x6f')]({'where':{'id':_0xadf742[_0x3134('0x5d')]['id']}})['then'](handleEntityNotFound(_0x27b05b,null))[_0x3134('0x24')](function(_0x30151e){if(_0x30151e){return db['sequelize'][_0x3134('0xbf')](function(_0x4b38dd){return db[_0x3134('0x79')]['destroy']({'where':{'SmsAccountId':_0xadf742['params']['id']},'transaction':_0x4b38dd})[_0x3134('0x24')](function(_0x6ee744){var _0x270e1a=_['map'](_0xadf742[_0x3134('0x6a')],function(_0x2c273b){_0x2c273b['SmsAccountId']=_0xadf742[_0x3134('0x5d')]['id'];return _0x2c273b;});return db[_0x3134('0x79')][_0x3134('0xc0')](_0x270e1a,{'transaction':_0x4b38dd});});})[_0x3134('0x24')](function(){return db[_0x3134('0x79')]['findAndCountAll']({'where':{'SmsAccountId':_0xadf742['params']['id']},'order':'priority'});});}})[_0x3134('0x24')](respondWithResult(_0x27b05b,null))[_0x3134('0x5b')](handleError(_0x27b05b,null));};exports[_0x3134('0xc1')]=function(_0x52f5e7,_0x588c32,_0x14b474){var _0x46778f={};var _0xdf2018={};var _0x391aea;var _0x3cad48;return db[_0x3134('0x43')][_0x3134('0x6f')]({'where':{'id':_0x52f5e7[_0x3134('0x5d')]['id']}})[_0x3134('0x24')](handleEntityNotFound(_0x588c32,null))[_0x3134('0x24')](function(_0x2a1790){if(_0x2a1790){_0x391aea=_0x2a1790;_0xdf2018[_0x3134('0x48')]=_[_0x3134('0x5f')](db[_0x3134('0x79')]['rawAttributes']);_0xdf2018[_0x3134('0x49')]=_[_0x3134('0x5f')](_0x52f5e7[_0x3134('0x49')]);_0xdf2018[_0x3134('0x53')]=_[_0x3134('0x60')](_0xdf2018[_0x3134('0x48')],_0xdf2018[_0x3134('0x49')]);_0x46778f['attributes']=_[_0x3134('0x60')](_0xdf2018[_0x3134('0x48')],qs[_0x3134('0x4b')](_0x52f5e7[_0x3134('0x49')][_0x3134('0x4b')]));_0x46778f[_0x3134('0x4a')]=_0x46778f[_0x3134('0x4a')][_0x3134('0x4c')]?_0x46778f[_0x3134('0x4a')]:_0xdf2018['model'];_0x46778f[_0x3134('0x4f')]=qs['sort'](_0x52f5e7[_0x3134('0x49')][_0x3134('0x50')]);_0x46778f['where']=qs[_0x3134('0x53')](_[_0x3134('0x52')](_0x52f5e7[_0x3134('0x49')],_0xdf2018['filters']));if(_0x52f5e7[_0x3134('0x49')][_0x3134('0x54')]){_0x46778f[_0x3134('0x51')]=_[_0x3134('0x55')](_0x46778f[_0x3134('0x51')],{'$or':_[_0x3134('0x42')](_0x46778f['attributes'],function(_0x4a8dee){var _0x297b8d={};_0x297b8d[_0x4a8dee]={'$like':'%'+_0x52f5e7[_0x3134('0x49')]['filter']+'%'};return _0x297b8d;})});}_0x46778f=_[_0x3134('0x55')]({},_0x46778f,_0x52f5e7[_0x3134('0x57')]);return _0x391aea['getApplications'](_0x46778f);}})[_0x3134('0x24')](function(_0xabb6c){if(_0xabb6c){_0x3cad48=_0xabb6c[_0x3134('0x4c')];if(!_0x52f5e7[_0x3134('0x49')][_0x3134('0x4d')](_0x3134('0x4e'))){_0x46778f[_0x3134('0x34')]=qs[_0x3134('0x34')](_0x52f5e7[_0x3134('0x49')][_0x3134('0x34')]);_0x46778f[_0x3134('0x32')]=qs[_0x3134('0x32')](_0x52f5e7[_0x3134('0x49')]['offset']);}return _0x391aea[_0x3134('0xc1')](_0x46778f);}})[_0x3134('0x24')](function(_0xd4587f){if(_0xd4587f){return _0xd4587f?{'count':_0x3cad48,'rows':_0xd4587f}:null;}})[_0x3134('0x24')](respondWithResult(_0x588c32,null))[_0x3134('0x5b')](handleError(_0x588c32,null));};exports[_0x3134('0xc2')]=function(_0x46b0cb,_0x51bda9,_0x27bab8){var _0x2d1b7f={'raw':![],'where':{}};var _0x2ce037={};var _0x54a273={'count':0x0,'rows':[]};return db['SmsAccount'][_0x3134('0x6f')]({'where':{'id':_0x46b0cb[_0x3134('0x5d')]['id']}})[_0x3134('0x24')](handleEntityNotFound(_0x51bda9,null))[_0x3134('0x24')](function(_0x131121){if(_0x131121){_0x2ce037[_0x3134('0x48')]=_[_0x3134('0x5f')](db['SmsInteraction']['rawAttributes']);_0x2ce037[_0x3134('0x49')]=_['keys'](_0x46b0cb['query']);_0x2ce037[_0x3134('0x53')]=_[_0x3134('0x60')](_0x2ce037[_0x3134('0x48')],_0x2ce037[_0x3134('0x49')]);_0x2d1b7f[_0x3134('0x4a')]=_[_0x3134('0x60')](_0x2ce037[_0x3134('0x48')],qs[_0x3134('0x4b')](_0x46b0cb['query']['fields']));_0x2d1b7f[_0x3134('0x4a')]=_0x2d1b7f[_0x3134('0x4a')]['length']?_0x2d1b7f[_0x3134('0x4a')]:_0x2ce037['model'];if(!_0x46b0cb[_0x3134('0x49')][_0x3134('0x4d')](_0x3134('0x4e'))){_0x2d1b7f['limit']=qs[_0x3134('0x34')](_0x46b0cb['query'][_0x3134('0x34')]);_0x2d1b7f[_0x3134('0x32')]=qs[_0x3134('0x32')](_0x46b0cb[_0x3134('0x49')][_0x3134('0x32')]);}_0x2d1b7f[_0x3134('0x4f')]=qs['sort'](_0x46b0cb['query'][_0x3134('0x50')]);_0x2d1b7f[_0x3134('0x51')]=qs['filters'](_[_0x3134('0x52')](_0x46b0cb[_0x3134('0x49')],_0x2ce037[_0x3134('0x53')]));_0x2d1b7f[_0x3134('0x51')][_0x3134('0x6c')]=_0x131121['id'];if(_0x46b0cb['query'][_0x3134('0x54')]){_0x2d1b7f['where']=_[_0x3134('0x55')](_0x2d1b7f[_0x3134('0x51')],{'$or':_[_0x3134('0x42')](_0x2d1b7f[_0x3134('0x4a')],function(_0x4bc1db){var _0x57885c={};_0x57885c[_0x4bc1db]={'$like':'%'+_0x46b0cb[_0x3134('0x49')][_0x3134('0x54')]+'%'};return _0x57885c;})});}_0x2d1b7f=_[_0x3134('0x55')]({},_0x2d1b7f,_0x46b0cb[_0x3134('0x57')]);return db[_0x3134('0xa9')][_0x3134('0x35')]({'where':_0x2d1b7f['where']})[_0x3134('0x24')](function(_0x13086f){_0x54a273[_0x3134('0x35')]=_0x13086f;if(_0x46b0cb['query'][_0x3134('0x58')]){_0x2d1b7f[_0x3134('0x59')]=[{'model':db[_0x3134('0x80')],'as':_0x3134('0xc3'),'required':![]},{'model':db[_0x3134('0xb2')],'as':_0x3134('0xc4'),'attributes':[_0x3134('0x3f'),_0x3134('0xc5'),_0x3134('0xc6')],'required':![]},{'model':db[_0x3134('0xc7')],'as':_0x3134('0xc8'),'attributes':['id',_0x3134('0x3f'),'color'],'where':_0x46b0cb[_0x3134('0x49')][_0x3134('0xc9')]?{'id':_0x46b0cb[_0x3134('0x49')][_0x3134('0xc9')]}:undefined,'required':_0x46b0cb[_0x3134('0x49')][_0x3134('0xc9')]?!![]:![]}];}return db[_0x3134('0xa9')][_0x3134('0x70')](_0x2d1b7f);})[_0x3134('0x24')](function(_0x37e308){_0x54a273[_0x3134('0x5a')]=_0x37e308;return _0x54a273;});}})['then'](respondWithFilteredResult(_0x51bda9,_0x2d1b7f))[_0x3134('0x5b')](handleError(_0x51bda9,null));};exports['send']=function(_0x3f96d7,_0xc96edb,_0x3504ec){var _0x323e0a,_0x562021,_0x41df74;if(_['isNil'](_0x3f96d7[_0x3134('0x6a')]['body'])||_0x3f96d7[_0x3134('0x6a')][_0x3134('0x6a')]===''){throw new db[(_0x3134('0x81'))][(_0x3134('0x82'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3134('0x9e')](_0x3f96d7[_0x3134('0x6a')]['to'])){throw new db[(_0x3134('0x81'))][(_0x3134('0x82'))]('to\x20is\x20mandatory');}_0x323e0a=_0x3f96d7[_0x3134('0x6a')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x3f96d7[_0x3134('0x5d')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x3134('0x80')],'as':_0x3134('0xa5'),'where':{'mobile':_0x323e0a},'limit':0x1,'order':[[_0x3134('0x85'),'DESC']]}]}]})[_0x3134('0x24')](handleEntityNotFound(_0xc96edb,null))[_0x3134('0x24')](function(_0x310a04){if(_0x310a04&&_0x310a04['List']){_0x562021=_0x310a04[_0x3134('0x3c')]({'plain':!![]});if(_0x562021[_0x3134('0xca')]&&_0x562021['List'][_0x3134('0xa5')][_0x3134('0x4c')]){return _0x562021[_0x3134('0xca')][_0x3134('0xa5')][0x0];}return db[_0x3134('0x80')][_0x3134('0x62')](_[_0x3134('0x1c')](_0x3f96d7[_0x3134('0x6a')],{'firstName':_0x323e0a,'mobile':_0x323e0a,'phone':_0x323e0a,'ListId':_0x562021[_0x3134('0x87')]}));}})['then'](handleEntityNotFound(_0xc96edb,null))[_0x3134('0x24')](function(_0x2a0051){if(_0x2a0051){_0x41df74=_0x2a0051;return db['SmsInteraction'][_0x3134('0x61')]({'where':{'ContactId':_0x41df74['id'],'closed':![],'SmsAccountId':_0x562021['id']}})[_0x3134('0x24')](function(_0x56a037){if(_0x56a037){return[_0x56a037,![]];}return db[_0x3134('0xa9')][_0x3134('0x62')]({'UserId':_0x3f96d7[_0x3134('0x63')]['id'],'ContactId':_0x41df74['id'],'SmsAccountId':_0x562021['id'],'phone':_0x323e0a,'firstMsgDirection':'out','Messages':[_['merge'](_0x3f96d7['body'],{'read':![],'body':_0x3f96d7[_0x3134('0x6a')][_0x3134('0x6a')],'phone':_0x323e0a,'SmsAccountId':_0x562021['id'],'UserId':_0x3f96d7['user']['id'],'ContactId':_0x41df74['id']})]},{'include':[{'model':db[_0x3134('0xaf')],'as':'Messages'}]})[_0x3134('0x24')](function(_0x2f6556){return[_0x2f6556,!![]];});});}})[_0x3134('0xaa')](function(_0x363891,_0x5a598b){if(_0x5a598b){return _0x363891;}return db[_0x3134('0xaf')][_0x3134('0x62')](_[_0x3134('0x55')](_0x3f96d7['body'],{'read':![],'body':_0x3f96d7['body'][_0x3134('0x6a')],'phone':_0x323e0a,'SmsAccountId':_0x562021['id'],'SmsInteractionId':_0x363891['id'],'UserId':_0x3f96d7[_0x3134('0x63')]['id'],'ContactId':_0x41df74['id']}))[_0x3134('0x24')](function(_0x2aa4c4){_0x363891[_0x3134('0xcb')][_0x3134('0xcc')]=[];_0x363891[_0x3134('0xcb')][_0x3134('0xcc')][_0x3134('0xcd')](_0x2aa4c4[_0x3134('0xcb')]);return _0x363891;});})[_0x3134('0x24')](respondWithResult(_0xc96edb,null))[_0x3134('0x5b')](handleError(_0xc96edb,null));};exports[_0x3134('0x30')]=function(_0x5ea4f3,_0x1d5fda,_0x39988c){if(_0x5ea4f3[_0x3134('0x6a')]['id']){delete _0x5ea4f3[_0x3134('0x6a')]['id'];}var _0x190c4f,_0x1221bd,_0x41d2a2;return db[_0x3134('0x43')][_0x3134('0x61')]({'where':{'id':_0x5ea4f3[_0x3134('0x5d')]['id']}})[_0x3134('0x24')](handleEntityNotFound(_0x1d5fda,null))['then'](function(_0x12ad67){if(_0x12ad67){_0x41d2a2=_0x12ad67;logger[_0x3134('0x28')](_0x3134('0x29'),'status',_0x3134('0xce'),_0x12ad67[_0x3134('0x46')],util[_0x3134('0xcf')](_0x5ea4f3[_0x3134('0x6a')],{'showHidden':![],'depth':null}));switch(_0x12ad67[_0x3134('0x46')]){case _0x3134('0xd0'):if(_0x5ea4f3[_0x3134('0x6a')]['skebby_dispatch_id']&&_0x5ea4f3[_0x3134('0x6a')][_0x3134('0x30')]){_0x1221bd=_0x5ea4f3[_0x3134('0x6a')]['status'];return db[_0x3134('0xaf')][_0x3134('0x61')]({'where':{'messageId':_0x5ea4f3[_0x3134('0x6a')][_0x3134('0xd1')]}});}break;case _0x3134('0xd2'):if(_0x5ea4f3[_0x3134('0x6a')]['requestid']&&_0x5ea4f3[_0x3134('0x6a')][_0x3134('0xd3')]){_0x1221bd=_0x5ea4f3[_0x3134('0x6a')][_0x3134('0xd3')];return db[_0x3134('0xaf')]['find']({'where':{'messageId':_0x5ea4f3[_0x3134('0x6a')]['requestid']}});}break;case _0x3134('0xd4'):if(_0x5ea4f3[_0x3134('0x6a')]['message_id']&&_0x5ea4f3['body'][_0x3134('0xd5')]){_0x1221bd=_0x5ea4f3[_0x3134('0x6a')][_0x3134('0xd5')];return db[_0x3134('0xaf')][_0x3134('0x61')]({'where':{'messageId':_0x5ea4f3[_0x3134('0x6a')][_0x3134('0x90')]}});}break;case _0x3134('0x94'):var _0x45987b=_0x5ea4f3[_0x3134('0x6a')][_0x3134('0x95')][0x0];if(_0x45987b[_0x3134('0x8c')]&&_0x45987b[_0x3134('0x30')][_0x3134('0xd6')]==='DELIVERED'){_0x1221bd=_0x45987b[_0x3134('0x30')]['groupName'];return db[_0x3134('0xaf')][_0x3134('0x61')]({'where':{'messageId':_0x45987b[_0x3134('0x8c')]}});}break;case'clickatell':if(_0x5ea4f3[_0x3134('0x6a')][_0x3134('0x8c')]&&_0x5ea4f3[_0x3134('0x6a')][_0x3134('0x30')]){_0x1221bd=_0x5ea4f3['body']['status'];return db[_0x3134('0xaf')]['find']({'where':{'messageId':_0x5ea4f3['body'][_0x3134('0x8c')]}});}break;case _0x3134('0x9b'):if(_0x5ea4f3[_0x3134('0x6a')][0x0][_0x3134('0x2c')]['id']){_0x1221bd=_0x5ea4f3[_0x3134('0x6a')][0x0]['type'];return db['SmsMessage'][_0x3134('0x61')]({'where':{'messageId':_0x5ea4f3[_0x3134('0x6a')][0x0][_0x3134('0x2c')]['id']}});}break;case _0x3134('0x9c'):if(_0x5ea4f3[_0x3134('0x6a')][_0x3134('0xd7')]&&_0x5ea4f3[_0x3134('0x6a')]['status']){_0x1221bd=_0x5ea4f3['body'][_0x3134('0x30')];return db[_0x3134('0xaf')][_0x3134('0x61')]({'where':{'messageId':_0x5ea4f3['body'][_0x3134('0xd7')]}});}break;}}})[_0x3134('0x24')](handleEntityNotFound(_0x1d5fda,null))[_0x3134('0x24')](function(_0x2f2fe1){if(_0x2f2fe1){_0x190c4f=_0x2f2fe1;switch(_0x41d2a2['type']){case _0x3134('0xd0'):if(_0x1221bd===_0x3134('0xd8')){return _0x190c4f[_0x3134('0x3a')]({'read':!![]});}else{logger[_0x3134('0x2b')](_0x3134('0x29'),_0x3134('0x30'),'skebby',util['inspect'](_0x5ea4f3[_0x3134('0x6a')],{'showHidden':![],'depth':null}));}break;case _0x3134('0xd2'):if(_0x1221bd==='1'){return _0x190c4f[_0x3134('0x3a')]({'read':!![]});}else{logger[_0x3134('0x2b')](_0x3134('0x29'),'status',_0x3134('0xd0'),util['inspect'](_0x5ea4f3['body'],{'showHidden':![],'depth':null}));}break;case _0x3134('0xd4'):if(!_0x5ea4f3['body'][_0x3134('0xd9')]&&_0x1221bd>=0xc8&&_0x1221bd<=0xce){return _0x190c4f[_0x3134('0x3a')]({'read':!![]});}else{logger[_0x3134('0x2b')](_0x3134('0x29'),'status',_0x3134('0xd4'),util[_0x3134('0xcf')](_0x5ea4f3['body'],{'showHidden':![],'depth':null}));}break;case _0x3134('0x94'):var _0x1270a5=_0x5ea4f3[_0x3134('0x6a')]['results'][0x0];if(_0x1270a5['status'][_0x3134('0xd6')]===_0x3134('0xd8')){return _0x190c4f['update']({'read':!![]});}else{logger[_0x3134('0x2b')](_0x3134('0x29'),_0x3134('0x30'),'infobip',util[_0x3134('0xcf')](_0x5ea4f3[_0x3134('0x6a')],{'showHidden':![],'depth':null}));}break;case _0x3134('0x98'):if(_0x1221bd==_0x3134('0xda')||_0x1221bd==_0x3134('0xdb')){return _0x190c4f[_0x3134('0x3a')]({'read':!![]});}else{logger[_0x3134('0x2b')](_0x3134('0x29'),_0x3134('0x30'),_0x3134('0x98'),util[_0x3134('0xcf')](_0x5ea4f3[_0x3134('0x6a')],{'showHidden':![],'depth':null}));}break;case _0x3134('0x9b'):if(_0x1221bd==_0x3134('0xdc')){return _0x190c4f['update']({'read':!![]});}else{logger[_0x3134('0x2b')](_0x3134('0x29'),'status',_0x3134('0x9b'),util[_0x3134('0xcf')](_0x5ea4f3['body'],{'showHidden':![],'depth':null}));}break;case _0x3134('0x9c'):if(_0x1221bd==='DELIVRD'||_0x1221bd===_0x3134('0xdd')){return _0x190c4f[_0x3134('0x3a')]({'read':!![]});}else{logger[_0x3134('0x2b')](_0x3134('0x29'),'status','intelepeer',util[_0x3134('0xcf')](_0x5ea4f3[_0x3134('0x6a')],{'showHidden':![],'depth':null}));}break;}return _0x190c4f;}})['then'](respondWithResult(_0x1d5fda,null))[_0x3134('0x5b')](handleError(_0x1d5fda,null));};exports[_0x3134('0xde')]=function(_0x30ac05,_0x1cd3ea,_0xb3b734){var _0x295256,_0x54374c,_0x14d579;return db['SmsAccount']['find']({'where':{'id':_0x30ac05[_0x3134('0x5d')]['id']}})[_0x3134('0x24')](handleEntityNotFound(_0x1cd3ea,null))[_0x3134('0x24')](function(_0x52f357){if(_0x52f357){_0x14d579=_0x52f357;logger[_0x3134('0x28')](_0x3134('0x29'),_0x3134('0x30'),'received\x20delivery\x20report\x20from',_0x52f357[_0x3134('0x46')],util[_0x3134('0xcf')](_0x30ac05[_0x3134('0x49')],{'showHidden':![],'depth':null}));switch(_0x52f357['type']){case _0x3134('0x96'):if(_0x30ac05[_0x3134('0x49')]['message-id']&&_0x30ac05[_0x3134('0x49')][_0x3134('0xdf')]){_0x54374c=_0x30ac05[_0x3134('0x49')]['state'];return db['SmsMessage'][_0x3134('0x61')]({'where':{'messageId':_0x30ac05[_0x3134('0x49')]['message-id']}});}break;}}})[_0x3134('0x24')](handleEntityNotFound(_0x1cd3ea,null))[_0x3134('0x24')](function(_0x34fd93){if(_0x34fd93){_0x295256=_0x34fd93;switch(_0x14d579[_0x3134('0x46')]){case _0x3134('0x96'):if(_0x54374c==='2'||_0x54374c==='6'){return _0x295256[_0x3134('0x3a')]({'read':!![]});}else{logger['error'](_0x3134('0x29'),_0x3134('0x30'),_0x3134('0x96'),util[_0x3134('0xcf')](_0x30ac05[_0x3134('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x295256;}})[_0x3134('0x24')](respondWithResult(_0x1cd3ea,null))[_0x3134('0x5b')](handleError(_0x1cd3ea,null));};exports[_0x3134('0xe0')]=function(_0x3762c2,_0xfd0b57,_0x1d6389){return db[_0x3134('0x43')]['find']({'where':{'id':_0x3762c2[_0x3134('0x5d')]['id']}})[_0x3134('0x24')](handleEntityNotFound(_0xfd0b57,null))[_0x3134('0x24')](function(_0x2d5ba8){if(_0x2d5ba8){return _0x2d5ba8['addAgents'](_0x3762c2[_0x3134('0x6a')][_0x3134('0x72')],_[_0x3134('0xa8')](_0x3762c2[_0x3134('0x6a')],[_0x3134('0x72'),'id'])||{})[_0x3134('0xaa')](function(_0xa9ce28){for(var _0xb169a5=0x0;_0xb169a5<_0x3762c2['body'][_0x3134('0x72')][_0x3134('0x4c')];_0xb169a5+=0x1){socket['emit']('userSmsAccount:save',{'UserId':_0x3762c2[_0x3134('0x6a')][_0x3134('0x72')][_0xb169a5],'SmsAccountId':_0x3762c2[_0x3134('0x5d')]['id']});}return _0xa9ce28;});}})[_0x3134('0x24')](respondWithResult(_0xfd0b57,null))[_0x3134('0x5b')](handleError(_0xfd0b57,null));};exports[_0x3134('0xe1')]=function(_0x38f3aa,_0x25ea41,_0x531f54){return db[_0x3134('0x43')][_0x3134('0x61')]({'where':{'id':_0x38f3aa[_0x3134('0x5d')]['id']}})[_0x3134('0x24')](handleEntityNotFound(_0x25ea41,null))['then'](function(_0x7e1181){if(_0x7e1181){return _0x7e1181[_0x3134('0xe1')](_0x38f3aa[_0x3134('0x49')]['ids'])[_0x3134('0x24')](function(){if(_[_0x3134('0xe2')](_0x38f3aa[_0x3134('0x49')]['ids'])){for(var _0x41d884=0x0;_0x41d884<_0x38f3aa[_0x3134('0x49')][_0x3134('0x72')]['length'];_0x41d884+=0x1){socket[_0x3134('0xe3')](_0x3134('0xe4'),{'UserId':Number(_0x38f3aa[_0x3134('0x49')][_0x3134('0x72')][_0x41d884]),'SmsAccountId':Number(_0x38f3aa[_0x3134('0x5d')]['id'])});}}else{socket['emit'](_0x3134('0xe4'),{'UserId':Number(_0x38f3aa[_0x3134('0x49')][_0x3134('0x72')]),'SmsAccountId':Number(_0x38f3aa[_0x3134('0x5d')]['id'])});}});}})[_0x3134('0x24')](respondWithStatusCode(_0x25ea41,null))[_0x3134('0x5b')](handleError(_0x25ea41,null));};exports[_0x3134('0xe5')]=function(_0x23cba9,_0x4b979b,_0x237f62){var _0x3206fa={};var _0x2e87e4={};var _0x319a21;var _0x44a550;return db[_0x3134('0x43')]['findOne']({'where':{'id':_0x23cba9['params']['id']}})[_0x3134('0x24')](handleEntityNotFound(_0x4b979b,null))[_0x3134('0x24')](function(_0x5b5088){if(_0x5b5088){_0x319a21=_0x5b5088;_0x2e87e4[_0x3134('0x48')]=_[_0x3134('0x5f')](db['User'][_0x3134('0x44')]);_0x2e87e4[_0x3134('0x49')]=_[_0x3134('0x5f')](_0x23cba9[_0x3134('0x49')]);_0x2e87e4['filters']=_[_0x3134('0x60')](_0x2e87e4[_0x3134('0x48')],_0x2e87e4[_0x3134('0x49')]);_0x3206fa[_0x3134('0x4a')]=_[_0x3134('0x60')](_0x2e87e4[_0x3134('0x48')],qs[_0x3134('0x4b')](_0x23cba9[_0x3134('0x49')][_0x3134('0x4b')]));_0x3206fa['attributes']=_0x3206fa['attributes']['length']?_0x3206fa[_0x3134('0x4a')]:_0x2e87e4[_0x3134('0x48')];_0x3206fa[_0x3134('0x4f')]=qs[_0x3134('0x50')](_0x23cba9[_0x3134('0x49')]['sort']);_0x3206fa[_0x3134('0x51')]=qs['filters'](_['pick'](_0x23cba9[_0x3134('0x49')],_0x2e87e4[_0x3134('0x53')]));if(_0x23cba9[_0x3134('0x49')]['filter']){_0x3206fa[_0x3134('0x51')]=_['merge'](_0x3206fa[_0x3134('0x51')],{'$or':_[_0x3134('0x42')](_0x3206fa[_0x3134('0x4a')],function(_0x518fd0){var _0x3960dd={};_0x3960dd[_0x518fd0]={'$like':'%'+_0x23cba9[_0x3134('0x49')][_0x3134('0x54')]+'%'};return _0x3960dd;})});}_0x3206fa=_[_0x3134('0x55')]({},_0x3206fa,_0x23cba9[_0x3134('0x57')]);return _0x319a21['getAgents'](_0x3206fa);}})[_0x3134('0x24')](function(_0x667119){if(_0x667119){_0x44a550=_0x667119[_0x3134('0x4c')];if(!_0x23cba9[_0x3134('0x49')][_0x3134('0x4d')](_0x3134('0x4e'))){_0x3206fa['limit']=qs[_0x3134('0x34')](_0x23cba9['query'][_0x3134('0x34')]);_0x3206fa[_0x3134('0x32')]=qs[_0x3134('0x32')](_0x23cba9[_0x3134('0x49')][_0x3134('0x32')]);}return _0x319a21[_0x3134('0xe5')](_0x3206fa);}})[_0x3134('0x24')](function(_0x13848f){if(_0x13848f){return _0x13848f?{'count':_0x44a550,'rows':_0x13848f}:null;}})[_0x3134('0x24')](respondWithResult(_0x4b979b,null))[_0x3134('0x5b')](handleError(_0x4b979b,null));}; \ No newline at end of file +var _0xfcc7=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','json','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','get','role','user','SmsAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','SmsAccountId','Disposition','getDispositions','nolimit','rows','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','pick','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','sender','text','clicksend','message_id','Text','MessageUUID','infobip','results','csc','segmentedMessage','fromNumber','replyMessageId','bandwidth','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','addApplications','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','Tag','Tags','color','tag','List','Messages','dataValues','SmsAccount,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','connectel','status_code','groupName','DELIVERED','clickatell','redif','error_code','intelepeer','DELIVRD','ACCEPTD','statusGet','debug','message-id','state','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xfcc7,0x1af));var _0x7fcc=function(_0x3cc05d,_0x4b8f88){_0x3cc05d=_0x3cc05d-0x0;var _0x28b736=_0xfcc7[_0x3cc05d];return _0x28b736;};'use strict';var emlformat=require(_0x7fcc('0x0'));var rimraf=require(_0x7fcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7fcc('0x2'));var rp=require(_0x7fcc('0x3'));var moment=require(_0x7fcc('0x4'));var BPromise=require(_0x7fcc('0x5'));var Mustache=require('mustache');var util=require(_0x7fcc('0x6'));var path=require(_0x7fcc('0x7'));var sox=require(_0x7fcc('0x8'));var csv=require('to-csv');var ejs=require(_0x7fcc('0x9'));var fs=require('fs');var fs_extra=require(_0x7fcc('0xa'));var _=require(_0x7fcc('0xb'));var squel=require(_0x7fcc('0xc'));var crypto=require('crypto');var jsforce=require(_0x7fcc('0xd'));var deskjs=require(_0x7fcc('0xe'));var toCsv=require(_0x7fcc('0xf'));var querystring=require(_0x7fcc('0x10'));var Papa=require(_0x7fcc('0x11'));var Redis=require(_0x7fcc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7fcc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7fcc('0x14'));var logger=require('../../config/logger')(_0x7fcc('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7fcc('0x16'))['db'];config[_0x7fcc('0x17')]=_[_0x7fcc('0x18')](config['redis'],{'host':_0x7fcc('0x19'),'port':0x18eb});var socket=require(_0x7fcc('0x1a'))(new Redis(config[_0x7fcc('0x17')]));require('./smsAccount.socket')[_0x7fcc('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7fcc('0x1c')][_0x7fcc('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x17d5df,_0xddd647,_0x5bd493,_0x40a505){return new BPromise(function(_0x53114a,_0x2f06ab){var _0x302a02=_0x40a505||client;return _0x302a02[_0x7fcc('0x1e')](_0x17d5df,_0x5bd493)[_0x7fcc('0x1f')](function(_0xba9bb9){logger[_0x7fcc('0x20')](_0x7fcc('0x21'),_0xddd647,_0x7fcc('0x22'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xddd647,_0x7fcc('0x22'),JSON[_0x7fcc('0x23')](_0xba9bb9));if(_0xba9bb9['error']){if(_0xba9bb9[_0x7fcc('0x24')]['code']===0x1f4){logger[_0x7fcc('0x24')](_0x7fcc('0x21'),_0xddd647,_0xba9bb9[_0x7fcc('0x24')][_0x7fcc('0x25')]);return _0x2f06ab(_0xba9bb9[_0x7fcc('0x24')][_0x7fcc('0x25')]);}logger[_0x7fcc('0x24')]('SmsAccount,\x20%s,\x20%s',_0xddd647,_0xba9bb9[_0x7fcc('0x24')][_0x7fcc('0x25')]);return _0x53114a(_0xba9bb9[_0x7fcc('0x24')][_0x7fcc('0x25')]);}else{logger[_0x7fcc('0x20')]('SmsAccount,\x20%s,\x20%s',_0xddd647,'request\x20sent');_0x53114a(_0xba9bb9[_0x7fcc('0x26')][_0x7fcc('0x25')]);}})[_0x7fcc('0x27')](function(_0x645b0){logger[_0x7fcc('0x24')](_0x7fcc('0x21'),_0xddd647,_0x645b0);_0x2f06ab(_0x645b0);});});}function respondWithStatusCode(_0x2887f9,_0x46d159){_0x46d159=_0x46d159||0xcc;return function(_0xadc584){if(_0xadc584){return _0x2887f9[_0x7fcc('0x28')](_0x46d159);}return _0x2887f9['status'](_0x46d159)[_0x7fcc('0x29')]();};}function respondWithResult(_0x4cc2af,_0x1a6ecb){_0x1a6ecb=_0x1a6ecb||0xc8;return function(_0x5f34dd){if(_0x5f34dd){return _0x4cc2af['status'](_0x1a6ecb)[_0x7fcc('0x2a')](_0x5f34dd);}};}function respondWithFilteredResult(_0x32ad48,_0xafff96){return function(_0x4c185f){if(_0x4c185f){var _0x5c5e78=typeof _0xafff96['offset']===_0x7fcc('0x2b')&&typeof _0xafff96['limit']===_0x7fcc('0x2b');var _0x458487=_0x4c185f[_0x7fcc('0x2c')];var _0x54a9bc=_0x5c5e78?0x0:_0xafff96[_0x7fcc('0x2d')];var _0x758b6d=_0x5c5e78?_0x4c185f[_0x7fcc('0x2c')]:_0xafff96[_0x7fcc('0x2d')]+_0xafff96['limit'];var _0x42cf12;if(_0x758b6d>=_0x458487){_0x758b6d=_0x458487;_0x42cf12=0xc8;}else{_0x42cf12=0xce;}_0x32ad48[_0x7fcc('0x2e')](_0x42cf12);return _0x32ad48[_0x7fcc('0x2f')](_0x7fcc('0x30'),_0x54a9bc+'-'+_0x758b6d+'/'+_0x458487)[_0x7fcc('0x2a')](_0x4c185f);}return null;};}function patchUpdates(_0x4abc21){return function(_0xa497ef){try{jsonpatch[_0x7fcc('0x31')](_0xa497ef,_0x4abc21,!![]);}catch(_0x227346){return BPromise[_0x7fcc('0x32')](_0x227346);}return _0xa497ef[_0x7fcc('0x33')]();};}function saveUpdates(_0x28da15,_0x3a6c8b){return function(_0x3878fe){if(_0x3878fe){return _0x3878fe[_0x7fcc('0x34')](_0x28da15)[_0x7fcc('0x1f')](function(_0x3777){return _0x3777;});}return null;};}function removeEntity(_0x57ddaa,_0xd842f){return function(_0xf1fb4a){if(_0xf1fb4a){return _0xf1fb4a['destroy']()[_0x7fcc('0x1f')](function(){var _0x66e14a=_0xf1fb4a['get']({'plain':!![]});var _0x4a9b74='SmsAccounts';return db[_0x7fcc('0x35')]['destroy']({'where':{'type':_0x4a9b74,'resourceId':_0x66e14a['id']}})[_0x7fcc('0x1f')](function(){return _0xf1fb4a;});})[_0x7fcc('0x1f')](function(){_0x57ddaa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37830a,_0xf6df28){return function(_0x23ff6a){if(!_0x23ff6a){_0x37830a[_0x7fcc('0x28')](0x194);}return _0x23ff6a;};}function handleError(_0xc27a7d,_0x1e77a7){_0x1e77a7=_0x1e77a7||0x1f4;return function(_0x3cd85f){logger['error'](_0x3cd85f['stack']);if(_0x3cd85f[_0x7fcc('0x36')]){delete _0x3cd85f['name'];}_0xc27a7d['status'](_0x1e77a7)[_0x7fcc('0x37')](_0x3cd85f);};}exports['index']=function(_0x430626,_0x5f183f){var _0xc1de7={'include':[{'model':db[_0x7fcc('0x38')],'as':_0x7fcc('0x39')}]},_0x30b2ee={},_0x2b970f={'count':0x0,'rows':[]};var _0x14dcb7=_[_0x7fcc('0x3a')](db[_0x7fcc('0x3b')][_0x7fcc('0x3c')],function(_0x22bdf1){return{'name':_0x22bdf1['fieldName'],'type':_0x22bdf1[_0x7fcc('0x3d')]['key']};});_0x30b2ee[_0x7fcc('0x3e')]=_[_0x7fcc('0x3a')](_0x14dcb7,_0x7fcc('0x36'));_0x30b2ee[_0x7fcc('0x3f')]=_[_0x7fcc('0x40')](_0x430626[_0x7fcc('0x3f')]);_0x30b2ee[_0x7fcc('0x41')]=_[_0x7fcc('0x42')](_0x30b2ee[_0x7fcc('0x3e')],_0x30b2ee[_0x7fcc('0x3f')]);_0xc1de7[_0x7fcc('0x43')]=_[_0x7fcc('0x42')](_0x30b2ee['model'],qs[_0x7fcc('0x44')](_0x430626['query'][_0x7fcc('0x44')]));_0xc1de7[_0x7fcc('0x43')]=_0xc1de7[_0x7fcc('0x43')][_0x7fcc('0x45')]?_0xc1de7[_0x7fcc('0x43')]:_0x30b2ee[_0x7fcc('0x3e')];if(!_0x430626[_0x7fcc('0x3f')][_0x7fcc('0x46')]('nolimit')){_0xc1de7['limit']=qs[_0x7fcc('0x47')](_0x430626[_0x7fcc('0x3f')][_0x7fcc('0x47')]);_0xc1de7[_0x7fcc('0x2d')]=qs[_0x7fcc('0x2d')](_0x430626[_0x7fcc('0x3f')][_0x7fcc('0x2d')]);}_0xc1de7[_0x7fcc('0x48')]=qs[_0x7fcc('0x49')](_0x430626[_0x7fcc('0x3f')][_0x7fcc('0x49')]);_0xc1de7[_0x7fcc('0x4a')]=qs[_0x7fcc('0x41')](_['pick'](_0x430626[_0x7fcc('0x3f')],_0x30b2ee[_0x7fcc('0x41')]),_0x14dcb7);if(_0x430626[_0x7fcc('0x3f')][_0x7fcc('0x4b')]){_0xc1de7['where']=_[_0x7fcc('0x4c')](_0xc1de7[_0x7fcc('0x4a')],{'$or':_[_0x7fcc('0x3a')](_0x14dcb7,function(_0x1c3413){if(_0x1c3413[_0x7fcc('0x3d')]!==_0x7fcc('0x4d')){var _0x167582={};_0x167582[_0x1c3413[_0x7fcc('0x36')]]={'$like':'%'+_0x430626[_0x7fcc('0x3f')]['filter']+'%'};return _0x167582;}})});}_0xc1de7=_[_0x7fcc('0x4c')]({},_0xc1de7,_0x430626[_0x7fcc('0x4e')]);var _0x39edfb={'where':_0xc1de7[_0x7fcc('0x4a')]};return db[_0x7fcc('0x3b')][_0x7fcc('0x2c')](_0x39edfb)[_0x7fcc('0x1f')](function(_0x38f93f){_0x2b970f['count']=_0x38f93f;if(_0x430626[_0x7fcc('0x3f')][_0x7fcc('0x4f')]){_0xc1de7[_0x7fcc('0x50')]=[{'all':!![]}];}return db[_0x7fcc('0x3b')][_0x7fcc('0x51')](_0xc1de7);})[_0x7fcc('0x1f')](function(_0x4035ed){_0x2b970f['rows']=_0x4035ed;return _0x2b970f;})[_0x7fcc('0x1f')](respondWithFilteredResult(_0x5f183f,_0xc1de7))[_0x7fcc('0x27')](handleError(_0x5f183f,null));};exports[_0x7fcc('0x52')]=function(_0x3e8f8c,_0x41d498){var _0x5ef29a={'raw':![],'where':{'id':_0x3e8f8c[_0x7fcc('0x53')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2750ce={};_0x2750ce[_0x7fcc('0x3e')]=_[_0x7fcc('0x40')](db[_0x7fcc('0x3b')][_0x7fcc('0x3c')]);_0x2750ce['query']=_[_0x7fcc('0x40')](_0x3e8f8c[_0x7fcc('0x3f')]);_0x2750ce[_0x7fcc('0x41')]=_[_0x7fcc('0x42')](_0x2750ce[_0x7fcc('0x3e')],_0x2750ce[_0x7fcc('0x3f')]);_0x5ef29a[_0x7fcc('0x43')]=_[_0x7fcc('0x42')](_0x2750ce['model'],qs[_0x7fcc('0x44')](_0x3e8f8c['query'][_0x7fcc('0x44')]));_0x5ef29a[_0x7fcc('0x43')]=_0x5ef29a['attributes'][_0x7fcc('0x45')]?_0x5ef29a[_0x7fcc('0x43')]:_0x2750ce[_0x7fcc('0x3e')];if(_0x3e8f8c[_0x7fcc('0x3f')][_0x7fcc('0x4f')]){_0x5ef29a[_0x7fcc('0x50')]=[{'all':!![]}];}_0x5ef29a=_[_0x7fcc('0x4c')]({},_0x5ef29a,_0x3e8f8c['options']);return db[_0x7fcc('0x3b')][_0x7fcc('0x54')](_0x5ef29a)[_0x7fcc('0x1f')](handleEntityNotFound(_0x41d498,null))[_0x7fcc('0x1f')](respondWithResult(_0x41d498,null))[_0x7fcc('0x27')](handleError(_0x41d498,null));};exports[_0x7fcc('0x55')]=function(_0x496e9e,_0x4fb4cf){return db[_0x7fcc('0x3b')]['create'](_0x496e9e[_0x7fcc('0x56')],{})[_0x7fcc('0x1f')](function(_0x54a8b6){var _0x11ea84=_0x496e9e['user'][_0x7fcc('0x57')]({'plain':!![]});if(!_0x11ea84)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11ea84[_0x7fcc('0x58')]===_0x7fcc('0x59')){var _0x5d32e0=_0x54a8b6[_0x7fcc('0x57')]({'plain':!![]});var _0x40a99a=_0x7fcc('0x5a');return db['UserProfileSection'][_0x7fcc('0x54')]({'where':{'name':_0x40a99a,'userProfileId':_0x11ea84[_0x7fcc('0x5b')]},'raw':!![]})[_0x7fcc('0x1f')](function(_0x4f5a0f){if(_0x4f5a0f&&_0x4f5a0f[_0x7fcc('0x5c')]===0x0){return db[_0x7fcc('0x35')][_0x7fcc('0x55')]({'name':_0x5d32e0[_0x7fcc('0x36')],'resourceId':_0x5d32e0['id'],'type':_0x4f5a0f['name'],'sectionId':_0x4f5a0f['id']},{})[_0x7fcc('0x1f')](function(){return _0x54a8b6;});}else{return _0x54a8b6;}})[_0x7fcc('0x27')](function(_0x1f2c55){logger[_0x7fcc('0x24')](_0x7fcc('0x5d'),_0x1f2c55);throw _0x1f2c55;});}return _0x54a8b6;})[_0x7fcc('0x1f')](respondWithResult(_0x4fb4cf,0xc9))['catch'](handleError(_0x4fb4cf,null));};exports[_0x7fcc('0x34')]=function(_0x423417,_0x13b12e){if(_0x423417[_0x7fcc('0x56')]['id']){delete _0x423417['body']['id'];}return db[_0x7fcc('0x3b')]['find']({'where':{'id':_0x423417[_0x7fcc('0x53')]['id']},'include':[{'model':db[_0x7fcc('0x38')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x13b12e,null))['then'](saveUpdates(_0x423417['body'],null))[_0x7fcc('0x1f')](respondWithResult(_0x13b12e,null))[_0x7fcc('0x27')](handleError(_0x13b12e,null));};exports[_0x7fcc('0x5e')]=function(_0x4eb60a,_0x3ea22e){return db[_0x7fcc('0x3b')][_0x7fcc('0x54')]({'where':{'id':_0x4eb60a[_0x7fcc('0x53')]['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x3ea22e,null))['then'](removeEntity(_0x3ea22e,null))['catch'](handleError(_0x3ea22e,null));};exports[_0x7fcc('0x5f')]=function(_0x511797,_0x4c5729){return db[_0x7fcc('0x3b')][_0x7fcc('0x5f')]()[_0x7fcc('0x1f')](respondWithResult(_0x4c5729,null))[_0x7fcc('0x27')](handleError(_0x4c5729,null));};exports['addDisposition']=function(_0x1505e5,_0x4530fe,_0x1e4cea){if(_0x1505e5[_0x7fcc('0x56')]['id']){delete _0x1505e5[_0x7fcc('0x56')]['id'];}return db[_0x7fcc('0x3b')][_0x7fcc('0x54')]({'where':{'id':_0x1505e5[_0x7fcc('0x53')]['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x4530fe,null))[_0x7fcc('0x1f')](function(_0x265350){if(_0x265350){_0x1505e5[_0x7fcc('0x56')][_0x7fcc('0x60')]=_0x265350['id'];return db[_0x7fcc('0x61')]['create'](_0x1505e5[_0x7fcc('0x56')]);}})[_0x7fcc('0x1f')](respondWithResult(_0x4530fe,null))[_0x7fcc('0x27')](handleError(_0x4530fe,null));};exports[_0x7fcc('0x62')]=function(_0x2360e2,_0x148df1,_0x552112){var _0x554bb2={'raw':![],'where':{}};var _0x348a4b={};var _0x31b7bb={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x2360e2[_0x7fcc('0x53')]['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x148df1,null))[_0x7fcc('0x1f')](function(_0x3e8c58){if(_0x3e8c58){_0x348a4b['model']=_[_0x7fcc('0x40')](db['Disposition']['rawAttributes']);_0x348a4b['query']=_['keys'](_0x2360e2[_0x7fcc('0x3f')]);_0x348a4b[_0x7fcc('0x41')]=_[_0x7fcc('0x42')](_0x348a4b[_0x7fcc('0x3e')],_0x348a4b['query']);_0x554bb2[_0x7fcc('0x43')]=_['intersection'](_0x348a4b[_0x7fcc('0x3e')],qs[_0x7fcc('0x44')](_0x2360e2[_0x7fcc('0x3f')][_0x7fcc('0x44')]));_0x554bb2[_0x7fcc('0x43')]=_0x554bb2[_0x7fcc('0x43')][_0x7fcc('0x45')]?_0x554bb2[_0x7fcc('0x43')]:_0x348a4b['model'];if(!_0x2360e2[_0x7fcc('0x3f')][_0x7fcc('0x46')](_0x7fcc('0x63'))){_0x554bb2[_0x7fcc('0x47')]=qs[_0x7fcc('0x47')](_0x2360e2[_0x7fcc('0x3f')][_0x7fcc('0x47')]);_0x554bb2['offset']=qs[_0x7fcc('0x2d')](_0x2360e2[_0x7fcc('0x3f')]['offset']);}_0x554bb2[_0x7fcc('0x48')]=qs[_0x7fcc('0x49')](_0x2360e2[_0x7fcc('0x3f')][_0x7fcc('0x49')]);_0x554bb2['where']=qs['filters'](_['pick'](_0x2360e2[_0x7fcc('0x3f')],_0x348a4b['filters']));_0x554bb2[_0x7fcc('0x4a')][_0x7fcc('0x60')]=_0x3e8c58['id'];if(_0x2360e2['query'][_0x7fcc('0x4b')]){_0x554bb2[_0x7fcc('0x4a')]=_['merge'](_0x554bb2[_0x7fcc('0x4a')],{'$or':_['map'](_0x554bb2[_0x7fcc('0x43')],function(_0x549073){var _0x17d643={};_0x17d643[_0x549073]={'$like':'%'+_0x2360e2[_0x7fcc('0x3f')][_0x7fcc('0x4b')]+'%'};return _0x17d643;})});}_0x554bb2=_[_0x7fcc('0x4c')]({},_0x554bb2,_0x2360e2['options']);return db[_0x7fcc('0x61')][_0x7fcc('0x2c')]({'where':_0x554bb2['where']})[_0x7fcc('0x1f')](function(_0x384c90){_0x31b7bb['count']=_0x384c90;if(_0x2360e2[_0x7fcc('0x3f')]['includeAll']){_0x554bb2['include']=[{'all':!![]}];}return db[_0x7fcc('0x61')][_0x7fcc('0x51')](_0x554bb2);})[_0x7fcc('0x1f')](function(_0x2fbae9){_0x31b7bb[_0x7fcc('0x64')]=_0x2fbae9;return _0x31b7bb;});}})[_0x7fcc('0x1f')](respondWithFilteredResult(_0x148df1,_0x554bb2))[_0x7fcc('0x27')](handleError(_0x148df1,null));};exports[_0x7fcc('0x65')]=function(_0x262ff5,_0x12eb26,_0x5a78e0){return db['SmsAccount']['find']({'where':{'id':_0x262ff5[_0x7fcc('0x53')]['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x12eb26,null))['then'](function(_0x5de723){if(_0x5de723){return _0x5de723[_0x7fcc('0x65')](_0x262ff5['query']['ids']);}})[_0x7fcc('0x1f')](respondWithStatusCode(_0x12eb26,null))[_0x7fcc('0x27')](handleError(_0x12eb26,null));};exports[_0x7fcc('0x66')]=function(_0x2041aa,_0x1b848f,_0x3a31b8){if(_0x2041aa[_0x7fcc('0x56')]['id']){delete _0x2041aa[_0x7fcc('0x56')]['id'];}return db[_0x7fcc('0x3b')][_0x7fcc('0x54')]({'where':{'id':_0x2041aa[_0x7fcc('0x53')]['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x1b848f,null))['then'](function(_0x5878c3){if(_0x5878c3){_0x2041aa[_0x7fcc('0x56')][_0x7fcc('0x60')]=_0x5878c3['id'];return db['CannedAnswer'][_0x7fcc('0x55')](_0x2041aa['body']);}})['then'](respondWithResult(_0x1b848f,null))[_0x7fcc('0x27')](handleError(_0x1b848f,null));};exports[_0x7fcc('0x67')]=function(_0x298e99,_0x472b71,_0x4996f4){var _0x1015e8={'raw':![],'where':{}};var _0xf58954={};var _0x20c0bd={'count':0x0,'rows':[]};return db[_0x7fcc('0x3b')][_0x7fcc('0x68')]({'where':{'id':_0x298e99[_0x7fcc('0x53')]['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x472b71,null))[_0x7fcc('0x1f')](function(_0x9855d2){if(_0x9855d2){_0xf58954['model']=_[_0x7fcc('0x40')](db[_0x7fcc('0x69')][_0x7fcc('0x3c')]);_0xf58954[_0x7fcc('0x3f')]=_[_0x7fcc('0x40')](_0x298e99[_0x7fcc('0x3f')]);_0xf58954[_0x7fcc('0x41')]=_['intersection'](_0xf58954['model'],_0xf58954[_0x7fcc('0x3f')]);_0x1015e8[_0x7fcc('0x43')]=_[_0x7fcc('0x42')](_0xf58954[_0x7fcc('0x3e')],qs['fields'](_0x298e99[_0x7fcc('0x3f')]['fields']));_0x1015e8[_0x7fcc('0x43')]=_0x1015e8[_0x7fcc('0x43')][_0x7fcc('0x45')]?_0x1015e8[_0x7fcc('0x43')]:_0xf58954[_0x7fcc('0x3e')];if(!_0x298e99[_0x7fcc('0x3f')][_0x7fcc('0x46')]('nolimit')){_0x1015e8[_0x7fcc('0x47')]=qs[_0x7fcc('0x47')](_0x298e99[_0x7fcc('0x3f')][_0x7fcc('0x47')]);_0x1015e8[_0x7fcc('0x2d')]=qs['offset'](_0x298e99[_0x7fcc('0x3f')][_0x7fcc('0x2d')]);}_0x1015e8[_0x7fcc('0x48')]=qs['sort'](_0x298e99[_0x7fcc('0x3f')][_0x7fcc('0x49')]);_0x1015e8['where']=qs[_0x7fcc('0x41')](_[_0x7fcc('0x6a')](_0x298e99[_0x7fcc('0x3f')],_0xf58954[_0x7fcc('0x41')]));_0x1015e8[_0x7fcc('0x4a')][_0x7fcc('0x60')]=_0x9855d2['id'];if(_0x298e99['query'][_0x7fcc('0x4b')]){_0x1015e8['where']=_[_0x7fcc('0x4c')](_0x1015e8[_0x7fcc('0x4a')],{'$or':_[_0x7fcc('0x3a')](_0x1015e8['attributes'],function(_0x5f9f58){var _0x4ca482={};_0x4ca482[_0x5f9f58]={'$like':'%'+_0x298e99[_0x7fcc('0x3f')][_0x7fcc('0x4b')]+'%'};return _0x4ca482;})});}_0x1015e8=_['merge']({},_0x1015e8,_0x298e99['options']);return db[_0x7fcc('0x69')]['count']({'where':_0x1015e8[_0x7fcc('0x4a')]})[_0x7fcc('0x1f')](function(_0x25a7c0){_0x20c0bd[_0x7fcc('0x2c')]=_0x25a7c0;if(_0x298e99[_0x7fcc('0x3f')]['includeAll']){_0x1015e8[_0x7fcc('0x50')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1015e8);})[_0x7fcc('0x1f')](function(_0x2f1b1e){_0x20c0bd['rows']=_0x2f1b1e;return _0x20c0bd;});}})[_0x7fcc('0x1f')](respondWithFilteredResult(_0x472b71,_0x1015e8))[_0x7fcc('0x27')](handleError(_0x472b71,null));};exports[_0x7fcc('0x6b')]=function(_0x57b116,_0x29cb33,_0xb0fdfa){return db['SmsAccount'][_0x7fcc('0x54')]({'where':{'id':_0x57b116[_0x7fcc('0x53')]['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x29cb33,null))[_0x7fcc('0x1f')](function(_0x5f3daa){if(_0x5f3daa){return _0x5f3daa['removeAnswers'](_0x57b116['query'][_0x7fcc('0x6c')]);}})[_0x7fcc('0x1f')](respondWithStatusCode(_0x29cb33,null))[_0x7fcc('0x27')](handleError(_0x29cb33,null));};exports[_0x7fcc('0x6d')]=function(_0x3a96ad,_0x21debf,_0xf95147){var _0x28d7a1={'channel':_0x7fcc('0x6e')};var _0x34f120=[];var _0x287805=[];var _0x2a58bf={};return db['SmsAccount'][_0x7fcc('0x54')]({'where':{'id':_0x3a96ad[_0x7fcc('0x53')]['id']},'include':[{'model':db[_0x7fcc('0x6f')],'as':_0x7fcc('0x70')}]})['then'](handleEntityNotFound(_0x21debf,null))[_0x7fcc('0x1f')](function(_0x35496e){_0x28d7a1[_0x7fcc('0x71')]=_0x35496e;_0x28d7a1['applications']=_[_0x7fcc('0x72')](_0x35496e[_0x7fcc('0x70')],[_0x7fcc('0x73')],[_0x7fcc('0x74')]);if(_0x28d7a1[_0x7fcc('0x71')]['Applications']){delete _0x28d7a1['account'][_0x7fcc('0x70')];}return db[_0x7fcc('0x75')][_0x7fcc('0x5f')]();})['then'](function(_0x1e2233){if(!_0x1e2233){throw new db[(_0x7fcc('0x76'))][(_0x7fcc('0x77'))](_0x7fcc('0x78'));}_0x34f120=_[_0x7fcc('0x79')](_[_0x7fcc('0x40')](_0x1e2233),[_0x7fcc('0x7a'),_0x7fcc('0x7b')]);_0x287805=_['difference'](_['keys'](_0x1e2233),[_0x7fcc('0x7a'),_0x7fcc('0x7b'),_0x7fcc('0x7c'),_0x7fcc('0x7d')]);_0x28d7a1['body']={'mapKey':_0x7fcc('0x7e')};if(_0x28d7a1[_0x7fcc('0x71')][_0x7fcc('0x3d')]){switch(_0x28d7a1[_0x7fcc('0x71')][_0x7fcc('0x3d')]){case _0x7fcc('0x7f'):_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x80')]=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x81')];_0x28d7a1['body'][_0x7fcc('0x56')]=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x82')];_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x83')]=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x84')];break;case'skebby':_0x28d7a1['body']['from']='+'+_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x85')];_0x28d7a1['body'][_0x7fcc('0x56')]=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x86')];break;case'connectel':_0x28d7a1['body']['from']=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x80')];_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x56')]=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x25')];break;case _0x7fcc('0x87'):_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x80')]=_0x3a96ad['body'][_0x7fcc('0x80')];_0x28d7a1['body'][_0x7fcc('0x56')]=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x56')];_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x83')]=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x88')];break;case'plivo':_0x28d7a1['body'][_0x7fcc('0x80')]=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x81')];_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x56')]=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x89')];_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x83')]=_0x3a96ad['body'][_0x7fcc('0x8a')];break;case _0x7fcc('0x8b'):_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x80')]='+'+_0x3a96ad[_0x7fcc('0x56')]['results'][0x0][_0x7fcc('0x80')];_0x28d7a1[_0x7fcc('0x56')]['body']=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x8c')][0x0][_0x7fcc('0x86')];_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x83')]=_0x3a96ad['body'][_0x7fcc('0x8c')][0x0][_0x7fcc('0x83')];break;case _0x7fcc('0x8d'):_0x28d7a1['body']['from']=_0x3a96ad[_0x7fcc('0x56')]['originatingAddress'];_0x28d7a1['body']['body']=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x8e')][_0x7fcc('0x25')];break;case'clickatell':_0x28d7a1[_0x7fcc('0x56')]['from']=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x8f')];_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x56')]=_0x3a96ad['body']['text'];_0x28d7a1['body'][_0x7fcc('0x83')]=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x90')];break;case _0x7fcc('0x91'):_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x83')]=_0x3a96ad[_0x7fcc('0x56')][0x0][_0x7fcc('0x25')]['id'];_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x80')]=_0x3a96ad[_0x7fcc('0x56')][0x0]['message'][_0x7fcc('0x80')];_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x56')]=_0x3a96ad[_0x7fcc('0x56')][0x0][_0x7fcc('0x25')][_0x7fcc('0x86')];break;case'intelepeer':_0x28d7a1['body'][_0x7fcc('0x80')]=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x80')];_0x28d7a1['body'][_0x7fcc('0x56')]=_0x3a96ad[_0x7fcc('0x56')][_0x7fcc('0x25')];_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x83')]=_0x3a96ad[_0x7fcc('0x56')]['refid'];break;}}if(_0x28d7a1[_0x7fcc('0x56')]['id']){delete _0x28d7a1[_0x7fcc('0x56')]['id'];}if(_[_0x7fcc('0x92')](_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x80')])){throw new db[(_0x7fcc('0x76'))][(_0x7fcc('0x77'))](_0x7fcc('0x93'));}if(_['isNil'](_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x56')])||_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x56')]===''){throw new db[(_0x7fcc('0x76'))][(_0x7fcc('0x77'))](_0x7fcc('0x94'));}if(_['isNil'](_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x95')])){throw new db['Sequelize'][(_0x7fcc('0x77'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x287805);}if(!_[_0x7fcc('0x96')](_0x287805,_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x95')])){throw new db['Sequelize'][(_0x7fcc('0x77'))](_0x7fcc('0x97')+_0x287805);}_0x2a58bf[_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x95')]]=_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x80')];return db[_0x7fcc('0x98')][_0x7fcc('0x54')]({'where':{'id':_0x28d7a1[_0x7fcc('0x71')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x7fcc('0x99'),'where':_0x2a58bf,'limit':0x1,'order':[[_0x7fcc('0x7b'),_0x7fcc('0x9a')]]}]});})[_0x7fcc('0x1f')](handleEntityNotFound(_0x21debf,null))[_0x7fcc('0x1f')](function(_0x241728){if(_0x241728){_0x28d7a1[_0x7fcc('0x9b')]=_[_0x7fcc('0x9c')](_0x241728,['Contacts']);if(_0x241728['Contacts'][_0x7fcc('0x45')]){return _0x241728[_0x7fcc('0x99')][0x0];}var _0x21291e=_['defaults'](_0x28d7a1['body'],{'firstName':_0x28d7a1['body'][_0x7fcc('0x80')],'ListId':_0x241728['id']});_0x21291e[_0x28d7a1[_0x7fcc('0x56')]['mapKey']]=_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x80')];return db[_0x7fcc('0x75')][_0x7fcc('0x55')](_0x21291e,{'fields':_0x34f120,'raw':!![]});}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x21debf,null))[_0x7fcc('0x1f')](function(_0x5e32b8){if(_0x5e32b8){_0x28d7a1[_0x7fcc('0x9d')]=_0x5e32b8;var _0x54a097={'ContactId':_0x5e32b8['id'],'phone':_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x80')],'SmsAccountId':_0x3a96ad[_0x7fcc('0x53')]['id']};var _0x26ee27={'ContactId':_0x5e32b8['id'],'SmsAccountId':_0x3a96ad[_0x7fcc('0x53')]['id'],'closed':![]};return db[_0x7fcc('0x9e')][_0x7fcc('0x54')]({'where':_0x26ee27})[_0x7fcc('0x1f')](function(_0xe8452d){if(_0xe8452d){return[_0xe8452d,![]];}return db['SmsInteraction'][_0x7fcc('0x55')](_0x54a097)[_0x7fcc('0x1f')](function(_0x4bedcd){return[_0x4bedcd,!![]];});});}})[_0x7fcc('0x9f')](function(_0x9d0e8e,_0x8b1fae){_0x28d7a1[_0x7fcc('0xa0')]=_0x9d0e8e['get']({'plain':!![]});_0x28d7a1[_0x7fcc('0xa0')][_0x7fcc('0xa1')]=![];if(_0x8b1fae){if(_0x28d7a1['account'][_0x7fcc('0xa2')]){_0x28d7a1[_0x7fcc('0xa3')][_0x7fcc('0xa4')]({'id':0x0,'priority':_0x28d7a1[_0x7fcc('0xa3')][_0x7fcc('0x45')]+0x1,'app':_0x7fcc('0xa5'),'appdata':_0x7fcc('0xa6'),'interval':_0x7fcc('0xa7')});}_0x28d7a1[_0x7fcc('0xa0')][_0x7fcc('0xa1')]=!![];}return db[_0x7fcc('0xa8')]['create']({'phone':_0x28d7a1['body'][_0x7fcc('0x80')],'messageId':_0x28d7a1['body'][_0x7fcc('0x83')],'body':_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0x56')],'SmsAccountId':_0x3a96ad[_0x7fcc('0x53')]['id'],'SmsInteractionId':_0x9d0e8e['id'],'direction':'in','ContactId':_0x9d0e8e[_0x7fcc('0xa9')],'AttachmentId':_0x28d7a1[_0x7fcc('0x56')][_0x7fcc('0xaa')]});})['then'](function(_0x1020a5){_0x28d7a1[_0x7fcc('0x25')]=_0x1020a5;if(_0x28d7a1[_0x7fcc('0xa0')][_0x7fcc('0xab')]){return db[_0x7fcc('0xac')][_0x7fcc('0x54')]({'attributes':['id',_0x7fcc('0x36')],'where':{'id':_0x28d7a1[_0x7fcc('0xa0')][_0x7fcc('0xab')]}})[_0x7fcc('0x1f')](function(_0x406fd5){if(_0x406fd5){_0x28d7a1['applications'][_0x7fcc('0xad')]({'id':0x0,'priority':0x0,'app':_0x7fcc('0xae'),'appdata':_0x406fd5[_0x7fcc('0x36')]+','+(_0x28d7a1[_0x7fcc('0x71')][_0x7fcc('0xaf')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x7fcc('0xb0'),_0x7fcc('0xb1'),_0x28d7a1);});}return respondWithRpcPromise(_0x7fcc('0xb0'),'startRouting',_0x28d7a1);})[_0x7fcc('0x1f')](function(_0x420001){if(_0x420001){var _0x1fb954=0xc8;var _0x4460e1=_0x7fcc('0xb2');logger[_0x7fcc('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4460e1,_0x1fb954,'entity\x20found');logger['debug'](_0x7fcc('0xb3'),_0x4460e1,_0x1fb954,_0x7fcc('0xb4'),JSON[_0x7fcc('0x23')](_0x420001));if(_0x28d7a1[_0x7fcc('0x71')][_0x7fcc('0x3d')]===_0x7fcc('0x7f')){return _0x21debf[_0x7fcc('0x2e')](_0x1fb954)['set'](_0x7fcc('0xb5'),_0x7fcc('0xb6'))['send']('\x0a');}else{return _0x21debf['status'](_0x1fb954)['json'](_0x420001);}}})['catch'](handleError(_0x21debf,null));};exports[_0x7fcc('0xb7')]=function(_0x294dca,_0x383731,_0x1b75b2){return db['SmsAccount'][_0x7fcc('0x68')]({'where':{'id':_0x294dca['params']['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x383731,null))['then'](function(_0x230194){if(_0x230194){return db['sequelize']['transaction'](function(_0x448871){return db[_0x7fcc('0x6f')]['destroy']({'where':{'SmsAccountId':_0x294dca[_0x7fcc('0x53')]['id']},'transaction':_0x448871})[_0x7fcc('0x1f')](function(_0x30618f){var _0x1ab44f=_[_0x7fcc('0x3a')](_0x294dca['body'],function(_0x444100){_0x444100['SmsAccountId']=_0x294dca['params']['id'];return _0x444100;});return db[_0x7fcc('0x6f')][_0x7fcc('0xb8')](_0x1ab44f,{'transaction':_0x448871});});})[_0x7fcc('0x1f')](function(){return db[_0x7fcc('0x6f')][_0x7fcc('0xb9')]({'where':{'SmsAccountId':_0x294dca[_0x7fcc('0x53')]['id']},'order':_0x7fcc('0x73')});});}})['then'](respondWithResult(_0x383731,null))[_0x7fcc('0x27')](handleError(_0x383731,null));};exports['getApplications']=function(_0x2d9ff6,_0x24efc0,_0x25eb96){var _0x27e196={};var _0x33340f={};var _0x27e42f;var _0x112e49;return db['SmsAccount'][_0x7fcc('0x68')]({'where':{'id':_0x2d9ff6[_0x7fcc('0x53')]['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x24efc0,null))[_0x7fcc('0x1f')](function(_0x208ec0){if(_0x208ec0){_0x27e42f=_0x208ec0;_0x33340f[_0x7fcc('0x3e')]=_[_0x7fcc('0x40')](db['SmsApplication'][_0x7fcc('0x3c')]);_0x33340f[_0x7fcc('0x3f')]=_['keys'](_0x2d9ff6[_0x7fcc('0x3f')]);_0x33340f[_0x7fcc('0x41')]=_[_0x7fcc('0x42')](_0x33340f[_0x7fcc('0x3e')],_0x33340f[_0x7fcc('0x3f')]);_0x27e196[_0x7fcc('0x43')]=_[_0x7fcc('0x42')](_0x33340f['model'],qs[_0x7fcc('0x44')](_0x2d9ff6[_0x7fcc('0x3f')][_0x7fcc('0x44')]));_0x27e196['attributes']=_0x27e196[_0x7fcc('0x43')][_0x7fcc('0x45')]?_0x27e196['attributes']:_0x33340f[_0x7fcc('0x3e')];_0x27e196[_0x7fcc('0x48')]=qs[_0x7fcc('0x49')](_0x2d9ff6[_0x7fcc('0x3f')]['sort']);_0x27e196[_0x7fcc('0x4a')]=qs[_0x7fcc('0x41')](_[_0x7fcc('0x6a')](_0x2d9ff6[_0x7fcc('0x3f')],_0x33340f[_0x7fcc('0x41')]));if(_0x2d9ff6[_0x7fcc('0x3f')]['filter']){_0x27e196[_0x7fcc('0x4a')]=_[_0x7fcc('0x4c')](_0x27e196['where'],{'$or':_['map'](_0x27e196['attributes'],function(_0x1daa4d){var _0x4c0763={};_0x4c0763[_0x1daa4d]={'$like':'%'+_0x2d9ff6[_0x7fcc('0x3f')][_0x7fcc('0x4b')]+'%'};return _0x4c0763;})});}_0x27e196=_[_0x7fcc('0x4c')]({},_0x27e196,_0x2d9ff6[_0x7fcc('0x4e')]);return _0x27e42f[_0x7fcc('0xba')](_0x27e196);}})[_0x7fcc('0x1f')](function(_0x6ebd18){if(_0x6ebd18){_0x112e49=_0x6ebd18[_0x7fcc('0x45')];if(!_0x2d9ff6[_0x7fcc('0x3f')][_0x7fcc('0x46')](_0x7fcc('0x63'))){_0x27e196[_0x7fcc('0x47')]=qs['limit'](_0x2d9ff6[_0x7fcc('0x3f')]['limit']);_0x27e196[_0x7fcc('0x2d')]=qs[_0x7fcc('0x2d')](_0x2d9ff6['query'][_0x7fcc('0x2d')]);}return _0x27e42f[_0x7fcc('0xba')](_0x27e196);}})[_0x7fcc('0x1f')](function(_0x43849c){if(_0x43849c){return _0x43849c?{'count':_0x112e49,'rows':_0x43849c}:null;}})[_0x7fcc('0x1f')](respondWithResult(_0x24efc0,null))['catch'](handleError(_0x24efc0,null));};exports[_0x7fcc('0xbb')]=function(_0x435553,_0x414675,_0x25ebc8){var _0x45083e={'raw':![],'where':{}};var _0x33de54={};var _0x22b980={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x435553[_0x7fcc('0x53')]['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x414675,null))[_0x7fcc('0x1f')](function(_0x46e5db){if(_0x46e5db){_0x33de54[_0x7fcc('0x3e')]=_['keys'](db[_0x7fcc('0x9e')][_0x7fcc('0x3c')]);_0x33de54[_0x7fcc('0x3f')]=_[_0x7fcc('0x40')](_0x435553['query']);_0x33de54[_0x7fcc('0x41')]=_[_0x7fcc('0x42')](_0x33de54[_0x7fcc('0x3e')],_0x33de54['query']);_0x45083e[_0x7fcc('0x43')]=_[_0x7fcc('0x42')](_0x33de54['model'],qs[_0x7fcc('0x44')](_0x435553['query'][_0x7fcc('0x44')]));_0x45083e['attributes']=_0x45083e[_0x7fcc('0x43')][_0x7fcc('0x45')]?_0x45083e[_0x7fcc('0x43')]:_0x33de54[_0x7fcc('0x3e')];if(!_0x435553[_0x7fcc('0x3f')][_0x7fcc('0x46')](_0x7fcc('0x63'))){_0x45083e[_0x7fcc('0x47')]=qs[_0x7fcc('0x47')](_0x435553['query'][_0x7fcc('0x47')]);_0x45083e[_0x7fcc('0x2d')]=qs[_0x7fcc('0x2d')](_0x435553[_0x7fcc('0x3f')]['offset']);}_0x45083e[_0x7fcc('0x48')]=qs['sort'](_0x435553[_0x7fcc('0x3f')][_0x7fcc('0x49')]);_0x45083e[_0x7fcc('0x4a')]=qs[_0x7fcc('0x41')](_[_0x7fcc('0x6a')](_0x435553[_0x7fcc('0x3f')],_0x33de54[_0x7fcc('0x41')]));_0x45083e[_0x7fcc('0x4a')]['SmsAccountId']=_0x46e5db['id'];if(_0x435553[_0x7fcc('0x3f')][_0x7fcc('0x4b')]){_0x45083e[_0x7fcc('0x4a')]=_['merge'](_0x45083e['where'],{'$or':_[_0x7fcc('0x3a')](_0x45083e[_0x7fcc('0x43')],function(_0x2d9ec1){var _0x54ad0d={};_0x54ad0d[_0x2d9ec1]={'$like':'%'+_0x435553[_0x7fcc('0x3f')][_0x7fcc('0x4b')]+'%'};return _0x54ad0d;})});}_0x45083e=_[_0x7fcc('0x4c')]({},_0x45083e,_0x435553[_0x7fcc('0x4e')]);return db[_0x7fcc('0x9e')][_0x7fcc('0x2c')]({'where':_0x45083e[_0x7fcc('0x4a')]})['then'](function(_0x31025d){_0x22b980[_0x7fcc('0x2c')]=_0x31025d;if(_0x435553[_0x7fcc('0x3f')][_0x7fcc('0x4f')]){_0x45083e[_0x7fcc('0x50')]=[{'model':db[_0x7fcc('0x75')],'as':_0x7fcc('0xbc'),'required':![]},{'model':db[_0x7fcc('0xac')],'as':'Owner','attributes':[_0x7fcc('0x36'),_0x7fcc('0xbd'),'internal'],'required':![]},{'model':db[_0x7fcc('0xbe')],'as':_0x7fcc('0xbf'),'attributes':['id',_0x7fcc('0x36'),_0x7fcc('0xc0')],'where':_0x435553[_0x7fcc('0x3f')][_0x7fcc('0xc1')]?{'id':_0x435553[_0x7fcc('0x3f')][_0x7fcc('0xc1')]}:undefined,'required':_0x435553['query'][_0x7fcc('0xc1')]?!![]:![]}];}return db['SmsInteraction'][_0x7fcc('0x51')](_0x45083e);})[_0x7fcc('0x1f')](function(_0x1be37d){_0x22b980[_0x7fcc('0x64')]=_0x1be37d;return _0x22b980;});}})[_0x7fcc('0x1f')](respondWithFilteredResult(_0x414675,_0x45083e))[_0x7fcc('0x27')](handleError(_0x414675,null));};exports[_0x7fcc('0x37')]=function(_0x5de8be,_0xa3a65e,_0x5325eb){var _0x2052de,_0x1d3727,_0x25b678;if(_['isNil'](_0x5de8be[_0x7fcc('0x56')][_0x7fcc('0x56')])||_0x5de8be[_0x7fcc('0x56')][_0x7fcc('0x56')]===''){throw new db[(_0x7fcc('0x76'))][(_0x7fcc('0x77'))](_0x7fcc('0x94'));}if(_['isNil'](_0x5de8be[_0x7fcc('0x56')]['to'])){throw new db[(_0x7fcc('0x76'))][(_0x7fcc('0x77'))]('to\x20is\x20mandatory');}_0x2052de=_0x5de8be['body']['to'];return db[_0x7fcc('0x3b')][_0x7fcc('0x54')]({'where':{'id':_0x5de8be['params']['id']},'include':[{'model':db['CmList'],'as':_0x7fcc('0xc2'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x2052de},'limit':0x1,'order':[['updatedAt',_0x7fcc('0x9a')]]}]}]})[_0x7fcc('0x1f')](handleEntityNotFound(_0xa3a65e,null))['then'](function(_0x48a40c){if(_0x48a40c&&_0x48a40c[_0x7fcc('0xc2')]){_0x1d3727=_0x48a40c[_0x7fcc('0x57')]({'plain':!![]});if(_0x1d3727['List']&&_0x1d3727[_0x7fcc('0xc2')]['Contacts']['length']){return _0x1d3727[_0x7fcc('0xc2')][_0x7fcc('0x99')][0x0];}return db[_0x7fcc('0x75')][_0x7fcc('0x55')](_[_0x7fcc('0x18')](_0x5de8be['body'],{'firstName':_0x2052de,'mobile':_0x2052de,'phone':_0x2052de,'ListId':_0x1d3727['ListId']}));}})['then'](handleEntityNotFound(_0xa3a65e,null))[_0x7fcc('0x1f')](function(_0xc652c7){if(_0xc652c7){_0x25b678=_0xc652c7;return db['SmsInteraction'][_0x7fcc('0x54')]({'where':{'ContactId':_0x25b678['id'],'closed':![],'SmsAccountId':_0x1d3727['id']}})['then'](function(_0x4a6e65){if(_0x4a6e65){return[_0x4a6e65,![]];}return db[_0x7fcc('0x9e')][_0x7fcc('0x55')]({'UserId':_0x5de8be[_0x7fcc('0x59')]['id'],'ContactId':_0x25b678['id'],'SmsAccountId':_0x1d3727['id'],'phone':_0x2052de,'firstMsgDirection':'out','Messages':[_['merge'](_0x5de8be[_0x7fcc('0x56')],{'read':![],'body':_0x5de8be[_0x7fcc('0x56')][_0x7fcc('0x56')],'phone':_0x2052de,'SmsAccountId':_0x1d3727['id'],'UserId':_0x5de8be[_0x7fcc('0x59')]['id'],'ContactId':_0x25b678['id']})]},{'include':[{'model':db[_0x7fcc('0xa8')],'as':_0x7fcc('0xc3')}]})[_0x7fcc('0x1f')](function(_0x17a73a){return[_0x17a73a,!![]];});});}})[_0x7fcc('0x9f')](function(_0x56be84,_0x2a4fc4){if(_0x2a4fc4){return _0x56be84;}return db[_0x7fcc('0xa8')]['create'](_[_0x7fcc('0x4c')](_0x5de8be[_0x7fcc('0x56')],{'read':![],'body':_0x5de8be[_0x7fcc('0x56')][_0x7fcc('0x56')],'phone':_0x2052de,'SmsAccountId':_0x1d3727['id'],'SmsInteractionId':_0x56be84['id'],'UserId':_0x5de8be[_0x7fcc('0x59')]['id'],'ContactId':_0x25b678['id']}))[_0x7fcc('0x1f')](function(_0x1b0cff){_0x56be84[_0x7fcc('0xc4')]['Messages']=[];_0x56be84['dataValues'][_0x7fcc('0xc3')][_0x7fcc('0xa4')](_0x1b0cff[_0x7fcc('0xc4')]);return _0x56be84;});})[_0x7fcc('0x1f')](respondWithResult(_0xa3a65e,null))[_0x7fcc('0x27')](handleError(_0xa3a65e,null));};exports[_0x7fcc('0x2e')]=function(_0x3fbc20,_0x3bc903,_0xb54074){if(_0x3fbc20[_0x7fcc('0x56')]['id']){delete _0x3fbc20[_0x7fcc('0x56')]['id'];}var _0x182a56,_0x416633,_0x5a470a;return db[_0x7fcc('0x3b')][_0x7fcc('0x54')]({'where':{'id':_0x3fbc20['params']['id']}})['then'](handleEntityNotFound(_0x3bc903,null))['then'](function(_0x17404f){if(_0x17404f){_0x5a470a=_0x17404f;logger['debug'](_0x7fcc('0xc5'),_0x7fcc('0x2e'),_0x7fcc('0xc6'),_0x17404f[_0x7fcc('0x3d')],util[_0x7fcc('0xc7')](_0x3fbc20[_0x7fcc('0x56')],{'showHidden':![],'depth':null}));switch(_0x17404f[_0x7fcc('0x3d')]){case _0x7fcc('0xc8'):if(_0x3fbc20[_0x7fcc('0x56')]['skebby_dispatch_id']&&_0x3fbc20[_0x7fcc('0x56')][_0x7fcc('0x2e')]){_0x416633=_0x3fbc20['body']['status'];return db[_0x7fcc('0xa8')]['find']({'where':{'messageId':_0x3fbc20[_0x7fcc('0x56')][_0x7fcc('0xc9')]}});}break;case _0x7fcc('0xca'):if(_0x3fbc20[_0x7fcc('0x56')]['requestid']&&_0x3fbc20[_0x7fcc('0x56')]['statusInt']){_0x416633=_0x3fbc20['body']['statusInt'];return db[_0x7fcc('0xa8')][_0x7fcc('0x54')]({'where':{'messageId':_0x3fbc20['body']['requestid']}});}break;case'clicksend':if(_0x3fbc20['body'][_0x7fcc('0x88')]&&_0x3fbc20[_0x7fcc('0x56')][_0x7fcc('0xcb')]){_0x416633=_0x3fbc20[_0x7fcc('0x56')][_0x7fcc('0xcb')];return db['SmsMessage']['find']({'where':{'messageId':_0x3fbc20[_0x7fcc('0x56')][_0x7fcc('0x88')]}});}break;case _0x7fcc('0x8b'):var _0xda140f=_0x3fbc20['body']['results'][0x0];if(_0xda140f['messageId']&&_0xda140f['status'][_0x7fcc('0xcc')]===_0x7fcc('0xcd')){_0x416633=_0xda140f[_0x7fcc('0x2e')][_0x7fcc('0xcc')];return db['SmsMessage'][_0x7fcc('0x54')]({'where':{'messageId':_0xda140f['messageId']}});}break;case _0x7fcc('0xce'):if(_0x3fbc20[_0x7fcc('0x56')][_0x7fcc('0x83')]&&_0x3fbc20[_0x7fcc('0x56')][_0x7fcc('0x2e')]){_0x416633=_0x3fbc20[_0x7fcc('0x56')]['status'];return db[_0x7fcc('0xa8')]['find']({'where':{'messageId':_0x3fbc20['body'][_0x7fcc('0x83')]}});}break;case _0x7fcc('0x91'):if(_0x3fbc20[_0x7fcc('0x56')][0x0][_0x7fcc('0x25')]['id']){_0x416633=_0x3fbc20[_0x7fcc('0x56')][0x0][_0x7fcc('0x3d')];return db[_0x7fcc('0xa8')]['find']({'where':{'messageId':_0x3fbc20[_0x7fcc('0x56')][0x0][_0x7fcc('0x25')]['id']}});}break;case'intelepeer':if(_0x3fbc20[_0x7fcc('0x56')][_0x7fcc('0xcf')]&&_0x3fbc20[_0x7fcc('0x56')][_0x7fcc('0x2e')]){_0x416633=_0x3fbc20[_0x7fcc('0x56')][_0x7fcc('0x2e')];return db['SmsMessage'][_0x7fcc('0x54')]({'where':{'messageId':_0x3fbc20['body'][_0x7fcc('0xcf')]}});}break;}}})['then'](handleEntityNotFound(_0x3bc903,null))[_0x7fcc('0x1f')](function(_0x562826){if(_0x562826){_0x182a56=_0x562826;switch(_0x5a470a[_0x7fcc('0x3d')]){case _0x7fcc('0xc8'):if(_0x416633==='DELIVERED'){return _0x182a56[_0x7fcc('0x34')]({'read':!![]});}else{logger[_0x7fcc('0x24')](_0x7fcc('0xc5'),_0x7fcc('0x2e'),_0x7fcc('0xc8'),util[_0x7fcc('0xc7')](_0x3fbc20[_0x7fcc('0x56')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x416633==='1'){return _0x182a56[_0x7fcc('0x34')]({'read':!![]});}else{logger[_0x7fcc('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7fcc('0x2e'),_0x7fcc('0xc8'),util[_0x7fcc('0xc7')](_0x3fbc20['body'],{'showHidden':![],'depth':null}));}break;case _0x7fcc('0x87'):if(!_0x3fbc20[_0x7fcc('0x56')][_0x7fcc('0xd0')]&&_0x416633>=0xc8&&_0x416633<=0xce){return _0x182a56[_0x7fcc('0x34')]({'read':!![]});}else{logger[_0x7fcc('0x24')](_0x7fcc('0xc5'),_0x7fcc('0x2e'),_0x7fcc('0x87'),util[_0x7fcc('0xc7')](_0x3fbc20['body'],{'showHidden':![],'depth':null}));}break;case _0x7fcc('0x8b'):var _0xbcfaf9=_0x3fbc20[_0x7fcc('0x56')][_0x7fcc('0x8c')][0x0];if(_0xbcfaf9[_0x7fcc('0x2e')][_0x7fcc('0xcc')]===_0x7fcc('0xcd')){return _0x182a56[_0x7fcc('0x34')]({'read':!![]});}else{logger['error'](_0x7fcc('0xc5'),_0x7fcc('0x2e'),_0x7fcc('0x8b'),util[_0x7fcc('0xc7')](_0x3fbc20[_0x7fcc('0x56')],{'showHidden':![],'depth':null}));}break;case _0x7fcc('0xce'):if(_0x416633=='DELIVERED_TO_GATEWAY'||_0x416633=='RECEIVED_BY_RECIPIENT'){return _0x182a56[_0x7fcc('0x34')]({'read':!![]});}else{logger[_0x7fcc('0x24')](_0x7fcc('0xc5'),_0x7fcc('0x2e'),_0x7fcc('0xce'),util['inspect'](_0x3fbc20[_0x7fcc('0x56')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x416633=='message-delivered'){return _0x182a56[_0x7fcc('0x34')]({'read':!![]});}else{logger[_0x7fcc('0x24')](_0x7fcc('0xc5'),_0x7fcc('0x2e'),_0x7fcc('0x91'),util[_0x7fcc('0xc7')](_0x3fbc20[_0x7fcc('0x56')],{'showHidden':![],'depth':null}));}break;case _0x7fcc('0xd1'):if(_0x416633===_0x7fcc('0xd2')||_0x416633===_0x7fcc('0xd3')){return _0x182a56['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7fcc('0x2e'),_0x7fcc('0xd1'),util[_0x7fcc('0xc7')](_0x3fbc20[_0x7fcc('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x182a56;}})['then'](respondWithResult(_0x3bc903,null))[_0x7fcc('0x27')](handleError(_0x3bc903,null));};exports[_0x7fcc('0xd4')]=function(_0xd234c0,_0x582b87,_0x52e004){var _0x2de87c,_0x2efa57,_0x4f9f1a;return db['SmsAccount']['find']({'where':{'id':_0xd234c0['params']['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x582b87,null))[_0x7fcc('0x1f')](function(_0x44ced5){if(_0x44ced5){_0x4f9f1a=_0x44ced5;logger[_0x7fcc('0xd5')](_0x7fcc('0xc5'),_0x7fcc('0x2e'),_0x7fcc('0xc6'),_0x44ced5[_0x7fcc('0x3d')],util[_0x7fcc('0xc7')](_0xd234c0[_0x7fcc('0x3f')],{'showHidden':![],'depth':null}));switch(_0x44ced5['type']){case'csc':if(_0xd234c0[_0x7fcc('0x3f')][_0x7fcc('0xd6')]&&_0xd234c0['query'][_0x7fcc('0xd7')]){_0x2efa57=_0xd234c0[_0x7fcc('0x3f')][_0x7fcc('0xd7')];return db[_0x7fcc('0xa8')][_0x7fcc('0x54')]({'where':{'messageId':_0xd234c0[_0x7fcc('0x3f')][_0x7fcc('0xd6')]}});}break;}}})['then'](handleEntityNotFound(_0x582b87,null))[_0x7fcc('0x1f')](function(_0x5670ca){if(_0x5670ca){_0x2de87c=_0x5670ca;switch(_0x4f9f1a[_0x7fcc('0x3d')]){case _0x7fcc('0x8d'):if(_0x2efa57==='2'||_0x2efa57==='6'){return _0x2de87c[_0x7fcc('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7fcc('0x2e'),_0x7fcc('0x8d'),util['inspect'](_0xd234c0[_0x7fcc('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x2de87c;}})[_0x7fcc('0x1f')](respondWithResult(_0x582b87,null))['catch'](handleError(_0x582b87,null));};exports['addAgents']=function(_0x38469a,_0x246227,_0x55dada){return db[_0x7fcc('0x3b')]['find']({'where':{'id':_0x38469a['params']['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x246227,null))['then'](function(_0x19e9eb){if(_0x19e9eb){return _0x19e9eb['addAgents'](_0x38469a[_0x7fcc('0x56')][_0x7fcc('0x6c')],_['omit'](_0x38469a[_0x7fcc('0x56')],['ids','id'])||{})[_0x7fcc('0x9f')](function(_0x557aba){for(var _0x335ae1=0x0;_0x335ae1<_0x38469a[_0x7fcc('0x56')][_0x7fcc('0x6c')][_0x7fcc('0x45')];_0x335ae1+=0x1){socket[_0x7fcc('0xd8')](_0x7fcc('0xd9'),{'UserId':_0x38469a['body'][_0x7fcc('0x6c')][_0x335ae1],'SmsAccountId':_0x38469a[_0x7fcc('0x53')]['id']});}return _0x557aba;});}})[_0x7fcc('0x1f')](respondWithResult(_0x246227,null))[_0x7fcc('0x27')](handleError(_0x246227,null));};exports[_0x7fcc('0xda')]=function(_0x1021ca,_0x3dfc2e,_0x1c1276){return db['SmsAccount']['find']({'where':{'id':_0x1021ca['params']['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x3dfc2e,null))[_0x7fcc('0x1f')](function(_0x1cbbd8){if(_0x1cbbd8){return _0x1cbbd8[_0x7fcc('0xda')](_0x1021ca[_0x7fcc('0x3f')]['ids'])['then'](function(){if(_[_0x7fcc('0xdb')](_0x1021ca[_0x7fcc('0x3f')]['ids'])){for(var _0x2c0875=0x0;_0x2c0875<_0x1021ca[_0x7fcc('0x3f')][_0x7fcc('0x6c')]['length'];_0x2c0875+=0x1){socket['emit'](_0x7fcc('0xdc'),{'UserId':Number(_0x1021ca[_0x7fcc('0x3f')][_0x7fcc('0x6c')][_0x2c0875]),'SmsAccountId':Number(_0x1021ca['params']['id'])});}}else{socket[_0x7fcc('0xd8')](_0x7fcc('0xdc'),{'UserId':Number(_0x1021ca[_0x7fcc('0x3f')][_0x7fcc('0x6c')]),'SmsAccountId':Number(_0x1021ca[_0x7fcc('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x3dfc2e,null))['catch'](handleError(_0x3dfc2e,null));};exports['getAgents']=function(_0x3dd21e,_0x52d10c,_0x10dfdc){var _0x683f87={};var _0xde303f={};var _0x30da97;var _0xde1147;return db[_0x7fcc('0x3b')][_0x7fcc('0x68')]({'where':{'id':_0x3dd21e[_0x7fcc('0x53')]['id']}})[_0x7fcc('0x1f')](handleEntityNotFound(_0x52d10c,null))[_0x7fcc('0x1f')](function(_0xf14698){if(_0xf14698){_0x30da97=_0xf14698;_0xde303f[_0x7fcc('0x3e')]=_[_0x7fcc('0x40')](db['User']['rawAttributes']);_0xde303f[_0x7fcc('0x3f')]=_['keys'](_0x3dd21e['query']);_0xde303f['filters']=_[_0x7fcc('0x42')](_0xde303f[_0x7fcc('0x3e')],_0xde303f['query']);_0x683f87[_0x7fcc('0x43')]=_[_0x7fcc('0x42')](_0xde303f[_0x7fcc('0x3e')],qs[_0x7fcc('0x44')](_0x3dd21e[_0x7fcc('0x3f')][_0x7fcc('0x44')]));_0x683f87[_0x7fcc('0x43')]=_0x683f87[_0x7fcc('0x43')][_0x7fcc('0x45')]?_0x683f87[_0x7fcc('0x43')]:_0xde303f[_0x7fcc('0x3e')];_0x683f87[_0x7fcc('0x48')]=qs[_0x7fcc('0x49')](_0x3dd21e[_0x7fcc('0x3f')][_0x7fcc('0x49')]);_0x683f87[_0x7fcc('0x4a')]=qs[_0x7fcc('0x41')](_[_0x7fcc('0x6a')](_0x3dd21e[_0x7fcc('0x3f')],_0xde303f[_0x7fcc('0x41')]));if(_0x3dd21e['query'][_0x7fcc('0x4b')]){_0x683f87[_0x7fcc('0x4a')]=_[_0x7fcc('0x4c')](_0x683f87['where'],{'$or':_[_0x7fcc('0x3a')](_0x683f87[_0x7fcc('0x43')],function(_0x407c46){var _0x3e9d6b={};_0x3e9d6b[_0x407c46]={'$like':'%'+_0x3dd21e[_0x7fcc('0x3f')][_0x7fcc('0x4b')]+'%'};return _0x3e9d6b;})});}_0x683f87=_[_0x7fcc('0x4c')]({},_0x683f87,_0x3dd21e['options']);return _0x30da97[_0x7fcc('0xdd')](_0x683f87);}})[_0x7fcc('0x1f')](function(_0xf09156){if(_0xf09156){_0xde1147=_0xf09156[_0x7fcc('0x45')];if(!_0x3dd21e[_0x7fcc('0x3f')][_0x7fcc('0x46')](_0x7fcc('0x63'))){_0x683f87[_0x7fcc('0x47')]=qs['limit'](_0x3dd21e['query']['limit']);_0x683f87[_0x7fcc('0x2d')]=qs[_0x7fcc('0x2d')](_0x3dd21e['query'][_0x7fcc('0x2d')]);}return _0x30da97['getAgents'](_0x683f87);}})[_0x7fcc('0x1f')](function(_0x1e4d21){if(_0x1e4d21){return _0x1e4d21?{'count':_0xde1147,'rows':_0x1e4d21}:null;}})['then'](respondWithResult(_0x52d10c,null))['catch'](handleError(_0x52d10c,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index f508628..8468f27 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 _0x64ad=['events','../../mysqldb','SmsAccount','save','emit','hook'];(function(_0x5445b5,_0xada1fc){var _0x496492=function(_0x1bba84){while(--_0x1bba84){_0x5445b5['push'](_0x5445b5['shift']());}};_0x496492(++_0xada1fc);}(_0x64ad,0x96));var _0xd64a=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x64ad[_0xc4001c];return _0x49f7bc;};'use strict';var EventEmitter=require(_0xd64a('0x0'));var SmsAccount=require(_0xd64a('0x1'))['db'][_0xd64a('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd64a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1dcd10){return function(_0x4dad58,_0x2eb35b,_0x1b5612){SmsAccountEvents['emit'](_0x1dcd10+':'+_0x4dad58['id'],_0x4dad58);SmsAccountEvents[_0xd64a('0x4')](_0x1dcd10,_0x4dad58);_0x1b5612(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xd64a('0x5')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x608e=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','SmsAccount'];(function(_0x39daa5,_0x5e9e53){var _0x347722=function(_0x2d1817){while(--_0x2d1817){_0x39daa5['push'](_0x39daa5['shift']());}};_0x347722(++_0x5e9e53);}(_0x608e,0x16e));var _0xe608=function(_0x26768d,_0x21107a){_0x26768d=_0x26768d-0x0;var _0x4cc6a3=_0x608e[_0x26768d];return _0x4cc6a3;};'use strict';var EventEmitter=require(_0xe608('0x0'));var SmsAccount=require(_0xe608('0x1'))['db'][_0xe608('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe608('0x3')](0x0);var events={'afterCreate':_0xe608('0x4'),'afterUpdate':_0xe608('0x5'),'afterDestroy':'remove'};function emitEvent(_0x50d7e2){return function(_0x434485,_0x3628a3,_0x55d885){SmsAccountEvents[_0xe608('0x6')](_0x50d7e2+':'+_0x434485['id'],_0x434485);SmsAccountEvents['emit'](_0x50d7e2,_0x434485);_0x55d885(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xe608('0x7')](e,emitEvent(event));}}module[_0xe608('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 98ce25a..06e5546 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 _0xd521=['path','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','../../config/logger','moment','request-promise'];(function(_0x46f370,_0x3f1dd3){var _0x46147f=function(_0x58d771){while(--_0x58d771){_0x46f370['push'](_0x46f370['shift']());}};_0x46147f(++_0x3f1dd3);}(_0xd521,0xf9));var _0x1d52=function(_0x96f54d,_0x5e5d21){_0x96f54d=_0x96f54d-0x0;var _0xdb885c=_0xd521[_0x96f54d];return _0xdb885c;};'use strict';var _=require(_0x1d52('0x0'));var util=require('util');var logger=require(_0x1d52('0x1'))('api');var moment=require(_0x1d52('0x2'));var BPromise=require('bluebird');var rp=require(_0x1d52('0x3'));var fs=require('fs');var path=require(_0x1d52('0x4'));var rimraf=require(_0x1d52('0x5'));var config=require(_0x1d52('0x6'));var attributes=require(_0x1d52('0x7'));module[_0x1d52('0x8')]=function(_0x527e96,_0x35f276){return _0x527e96['define'](_0x1d52('0x9'),attributes,{'tableName':_0x1d52('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66e6=['util','../../config/logger','api','moment','path','rimraf','./smsAccount.attributes','SmsAccount','sms_accounts','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66e6,0x77));var _0x666e=function(_0x3331da,_0x5d58b4){_0x3331da=_0x3331da-0x0;var _0x2df004=_0x66e6[_0x3331da];return _0x2df004;};'use strict';var _=require(_0x666e('0x0'));var util=require(_0x666e('0x1'));var logger=require(_0x666e('0x2'))(_0x666e('0x3'));var moment=require(_0x666e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x666e('0x5'));var rimraf=require(_0x666e('0x6'));var config=require('../../config/environment');var attributes=require(_0x666e('0x7'));module['exports']=function(_0x5932c0,_0x4ba02e){return _0x5932c0['define'](_0x666e('0x8'),attributes,{'tableName':_0x666e('0x9'),'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 e93f14d..3b9f41a 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 _0xe89f=['SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSmsAccount','find','options','raw','where','attributes','model','include','map','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','socket.io-emitter','redis','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe89f,0x14e));var _0xfe89=function(_0x2ff4c3,_0x4ae43a){_0x2ff4c3=_0x2ff4c3-0x0;var _0x458e77=_0xe89f[_0x2ff4c3];return _0x458e77;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfe89('0x0'));var BPromise=require('bluebird');var rs=require(_0xfe89('0x1'));var fs=require('fs');var Redis=require(_0xfe89('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe89('0x3'));var logger=require(_0xfe89('0x4'))(_0xfe89('0x5'));var config=require(_0xfe89('0x6'));var jayson=require(_0xfe89('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xfe89('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfe89('0x9'))(new Redis(config[_0xfe89('0xa')]));require(_0xfe89('0xb'))[_0xfe89('0xc')](socket);function respondWithRpcPromise(_0x4ab596,_0x5137e0,_0x31c142){return new BPromise(function(_0x4efb9f,_0x95ee6c){return client['request'](_0x4ab596,_0x31c142)[_0xfe89('0xd')](function(_0x584294){logger[_0xfe89('0xe')](_0xfe89('0xf'),_0x5137e0,_0xfe89('0x10'));logger[_0xfe89('0x11')](_0xfe89('0x12'),_0x5137e0,_0xfe89('0x10'),JSON['stringify'](_0x584294));if(_0x584294[_0xfe89('0x13')]){if(_0x584294[_0xfe89('0x13')][_0xfe89('0x14')]===0x1f4){logger[_0xfe89('0x13')]('SmsAccount,\x20%s,\x20%s',_0x5137e0,_0x584294[_0xfe89('0x13')][_0xfe89('0x15')]);return _0x95ee6c(_0x584294['error'][_0xfe89('0x15')]);}logger[_0xfe89('0x13')](_0xfe89('0xf'),_0x5137e0,_0x584294[_0xfe89('0x13')]['message']);return _0x4efb9f(_0x584294[_0xfe89('0x13')][_0xfe89('0x15')]);}else{logger['info'](_0xfe89('0xf'),_0x5137e0,_0xfe89('0x10'));_0x4efb9f(_0x584294['result'][_0xfe89('0x15')]);}})[_0xfe89('0x16')](function(_0x50a48f){logger['error']('SmsAccount,\x20%s,\x20%s',_0x5137e0,_0x50a48f);_0x95ee6c(_0x50a48f);});});}exports[_0xfe89('0x17')]=function(_0x1e21b9){var _0x430b60=this;return new Promise(function(_0x13fc16,_0x20cd70){return db['SmsAccount'][_0xfe89('0x18')]({'raw':_0x1e21b9[_0xfe89('0x19')]?_0x1e21b9[_0xfe89('0x19')][_0xfe89('0x1a')]===undefined?!![]:![]:!![],'where':_0x1e21b9[_0xfe89('0x19')]?_0x1e21b9[_0xfe89('0x19')][_0xfe89('0x1b')]||null:null,'attributes':_0x1e21b9[_0xfe89('0x19')]?_0x1e21b9[_0xfe89('0x19')][_0xfe89('0x1c')]||null:null,'include':_0x1e21b9[_0xfe89('0x19')]?_0x1e21b9[_0xfe89('0x19')]['include']?_['map'](_0x1e21b9[_0xfe89('0x19')]['include'],function(_0x49ebd8){return{'model':db[_0x49ebd8[_0xfe89('0x1d')]],'as':_0x49ebd8['as'],'attributes':_0x49ebd8[_0xfe89('0x1c')],'include':_0x49ebd8[_0xfe89('0x1e')]?_['map'](_0x49ebd8['include'],function(_0x4cf419){return{'model':db[_0x4cf419[_0xfe89('0x1d')]],'as':_0x4cf419['as'],'attributes':_0x4cf419[_0xfe89('0x1c')],'include':_0x4cf419['include']?_[_0xfe89('0x1f')](_0x4cf419[_0xfe89('0x1e')],function(_0x9dcb18){return{'model':db[_0x9dcb18[_0xfe89('0x1d')]],'as':_0x9dcb18['as'],'attributes':_0x9dcb18[_0xfe89('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fe400){logger[_0xfe89('0xe')]('ShowSmsAccount',_0x1e21b9);logger[_0xfe89('0x11')](_0xfe89('0x17'),_0x1e21b9,JSON['stringify'](_0x1fe400));_0x13fc16(_0x1fe400);})['catch'](function(_0x6a492d){logger[_0xfe89('0x13')]('ShowSmsAccount',_0x6a492d[_0xfe89('0x15')],_0x1e21b9);_0x20cd70(_0x430b60[_0xfe89('0x13')](0x1f4,_0x6a492d[_0xfe89('0x15')]));});});}; \ No newline at end of file +var _0x0416=['then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','find','options','raw','attributes','model','map','include','debug','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','http','defaults','localhost','socket.io-emitter','redis','register','request'];(function(_0x561f29,_0x465d8a){var _0x498c76=function(_0x556c30){while(--_0x556c30){_0x561f29['push'](_0x561f29['shift']());}};_0x498c76(++_0x465d8a);}(_0x0416,0x15d));var _0x6041=function(_0x452de8,_0x5a7fe7){_0x452de8=_0x452de8-0x0;var _0x3dd306=_0x0416[_0x452de8];return _0x3dd306;};'use strict';var _=require('lodash');var util=require(_0x6041('0x0'));var moment=require(_0x6041('0x1'));var BPromise=require(_0x6041('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6041('0x3'));var db=require(_0x6041('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6041('0x5'));var config=require(_0x6041('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6041('0x7')]({'port':0x232a});config['redis']=_[_0x6041('0x8')](config['redis'],{'host':_0x6041('0x9'),'port':0x18eb});var socket=require(_0x6041('0xa'))(new Redis(config[_0x6041('0xb')]));require('./smsAccount.socket')[_0x6041('0xc')](socket);function respondWithRpcPromise(_0x14369b,_0x443d5c,_0x30007e){return new BPromise(function(_0x42817c,_0x1403a5){return client[_0x6041('0xd')](_0x14369b,_0x30007e)[_0x6041('0xe')](function(_0xcc7465){logger[_0x6041('0xf')](_0x6041('0x10'),_0x443d5c,_0x6041('0x11'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x443d5c,_0x6041('0x11'),JSON[_0x6041('0x12')](_0xcc7465));if(_0xcc7465[_0x6041('0x13')]){if(_0xcc7465[_0x6041('0x13')][_0x6041('0x14')]===0x1f4){logger[_0x6041('0x13')]('SmsAccount,\x20%s,\x20%s',_0x443d5c,_0xcc7465[_0x6041('0x13')]['message']);return _0x1403a5(_0xcc7465[_0x6041('0x13')][_0x6041('0x15')]);}logger[_0x6041('0x13')](_0x6041('0x10'),_0x443d5c,_0xcc7465[_0x6041('0x13')][_0x6041('0x15')]);return _0x42817c(_0xcc7465[_0x6041('0x13')][_0x6041('0x15')]);}else{logger[_0x6041('0xf')](_0x6041('0x10'),_0x443d5c,_0x6041('0x11'));_0x42817c(_0xcc7465[_0x6041('0x16')][_0x6041('0x15')]);}})[_0x6041('0x17')](function(_0x42ba7b){logger[_0x6041('0x13')](_0x6041('0x10'),_0x443d5c,_0x42ba7b);_0x1403a5(_0x42ba7b);});});}exports[_0x6041('0x18')]=function(_0x5a94d7){var _0x5d3d20=this;return new Promise(function(_0x394b97,_0x1e71ff){return db['SmsAccount'][_0x6041('0x19')]({'raw':_0x5a94d7[_0x6041('0x1a')]?_0x5a94d7['options'][_0x6041('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a94d7[_0x6041('0x1a')]?_0x5a94d7['options']['where']||null:null,'attributes':_0x5a94d7[_0x6041('0x1a')]?_0x5a94d7['options'][_0x6041('0x1c')]||null:null,'include':_0x5a94d7[_0x6041('0x1a')]?_0x5a94d7[_0x6041('0x1a')]['include']?_['map'](_0x5a94d7['options']['include'],function(_0x1a061e){return{'model':db[_0x1a061e[_0x6041('0x1d')]],'as':_0x1a061e['as'],'attributes':_0x1a061e[_0x6041('0x1c')],'include':_0x1a061e['include']?_[_0x6041('0x1e')](_0x1a061e[_0x6041('0x1f')],function(_0x14a89d){return{'model':db[_0x14a89d[_0x6041('0x1d')]],'as':_0x14a89d['as'],'attributes':_0x14a89d['attributes'],'include':_0x14a89d['include']?_[_0x6041('0x1e')](_0x14a89d[_0x6041('0x1f')],function(_0x535bf3){return{'model':db[_0x535bf3['model']],'as':_0x535bf3['as'],'attributes':_0x535bf3[_0x6041('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6041('0xe')](function(_0x256b21){logger[_0x6041('0xf')](_0x6041('0x18'),_0x5a94d7);logger[_0x6041('0x20')]('ShowSmsAccount',_0x5a94d7,JSON[_0x6041('0x12')](_0x256b21));_0x394b97(_0x256b21);})[_0x6041('0x17')](function(_0x317c36){logger[_0x6041('0x13')]('ShowSmsAccount',_0x317c36[_0x6041('0x15')],_0x5a94d7);_0x1e71ff(_0x5d3d20[_0x6041('0x13')](0x1f4,_0x317c36[_0x6041('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index a9151ee..12521e0 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 _0x1850=['./smsAccount.events','save','remove','update','emit','removeListener','length'];(function(_0x1d955a,_0x18f200){var _0xff3b8=function(_0x47c2c3){while(--_0x47c2c3){_0x1d955a['push'](_0x1d955a['shift']());}};_0xff3b8(++_0x18f200);}(_0x1850,0xe7));var _0x0185=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1850[_0x3dd15e];return _0x231fd0;};'use strict';var SmsAccountEvents=require(_0x0185('0x0'));var events=[_0x0185('0x1'),_0x0185('0x2'),_0x0185('0x3')];function createListener(_0x27f4a8,_0x37b0ad){return function(_0x169e9e){_0x37b0ad[_0x0185('0x4')](_0x27f4a8,_0x169e9e);};}function removeListener(_0x29fc43,_0x3bfb59){return function(){SmsAccountEvents[_0x0185('0x5')](_0x29fc43,_0x3bfb59);};}exports['register']=function(_0x3da220){for(var _0x58a852=0x0,_0x26c6cf=events[_0x0185('0x6')];_0x58a852<_0x26c6cf;_0x58a852++){var _0x1f7ec6=events[_0x58a852];var _0x1ac477=createListener('smsAccount:'+_0x1f7ec6,_0x3da220);SmsAccountEvents['on'](_0x1f7ec6,_0x1ac477);}}; \ No newline at end of file +var _0x4dfc=['emit','smsAccount:','update'];(function(_0xcf3ff1,_0x2dcb3d){var _0x2cc0ce=function(_0x5378e4){while(--_0x5378e4){_0xcf3ff1['push'](_0xcf3ff1['shift']());}};_0x2cc0ce(++_0x2dcb3d);}(_0x4dfc,0xda));var _0xc4df=function(_0x502ca3,_0x36be36){_0x502ca3=_0x502ca3-0x0;var _0x27f42c=_0x4dfc[_0x502ca3];return _0x27f42c;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=['save','remove',_0xc4df('0x0')];function createListener(_0x161fcd,_0x3571ba){return function(_0x18ec70){_0x3571ba[_0xc4df('0x1')](_0x161fcd,_0x18ec70);};}function removeListener(_0x254490,_0x29c2ba){return function(){SmsAccountEvents['removeListener'](_0x254490,_0x29c2ba);};}exports['register']=function(_0x5814de){for(var _0x27d2b2=0x0,_0x269c26=events['length'];_0x27d2b2<_0x269c26;_0x27d2b2++){var _0x430aee=events[_0x27d2b2];var _0xfa8c5c=createListener(_0xc4df('0x2')+_0x430aee,_0x5814de);SmsAccountEvents['on'](_0x430aee,_0xfa8c5c);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index b25d36f..0e468a5 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 _0xb218=['/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index'];(function(_0x5a3bae,_0x163f0e){var _0x1dd9c7=function(_0x28de5a){while(--_0x28de5a){_0x5a3bae['push'](_0x5a3bae['shift']());}};_0x1dd9c7(++_0x163f0e);}(_0xb218,0x7a));var _0x8b21=function(_0xc56d79,_0x1ad8d2){_0xc56d79=_0xc56d79-0x0;var _0x23c02=_0xb218[_0xc56d79];return _0x23c02;};'use strict';var multer=require(_0x8b21('0x0'));var util=require(_0x8b21('0x1'));var path=require(_0x8b21('0x2'));var timeout=require(_0x8b21('0x3'));var express=require(_0x8b21('0x4'));var router=express[_0x8b21('0x5')]();var fs_extra=require(_0x8b21('0x6'));var auth=require(_0x8b21('0x7'));var interaction=require(_0x8b21('0x8'));var config=require('../../config/environment');var controller=require('./smsApplication.controller');router['get']('/',auth[_0x8b21('0x9')](),controller[_0x8b21('0xa')]);router['get'](_0x8b21('0xb'),auth[_0x8b21('0x9')](),controller[_0x8b21('0xc')]);router[_0x8b21('0xd')]('/',auth[_0x8b21('0x9')](),controller['create']);router[_0x8b21('0xe')](_0x8b21('0xb'),auth['isAuthenticated'](),controller[_0x8b21('0xf')]);router[_0x8b21('0x10')]('/:id',auth[_0x8b21('0x9')](),controller[_0x8b21('0x11')]);module[_0x8b21('0x12')]=router; \ No newline at end of file +var _0x82e6=['create','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post'];(function(_0x3aa5df,_0x336f31){var _0x1effe0=function(_0x39218e){while(--_0x39218e){_0x3aa5df['push'](_0x3aa5df['shift']());}};_0x1effe0(++_0x336f31);}(_0x82e6,0x94));var _0x682e=function(_0x4cfa2e,_0x5752b5){_0x4cfa2e=_0x4cfa2e-0x0;var _0x279b50=_0x82e6[_0x4cfa2e];return _0x279b50;};'use strict';var multer=require('multer');var util=require(_0x682e('0x0'));var path=require(_0x682e('0x1'));var timeout=require(_0x682e('0x2'));var express=require('express');var router=express[_0x682e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x682e('0x4'));var interaction=require(_0x682e('0x5'));var config=require(_0x682e('0x6'));var controller=require('./smsApplication.controller');router[_0x682e('0x7')]('/',auth[_0x682e('0x8')](),controller[_0x682e('0x9')]);router['get'](_0x682e('0xa'),auth[_0x682e('0x8')](),controller['show']);router[_0x682e('0xb')]('/',auth[_0x682e('0x8')](),controller[_0x682e('0xc')]);router['put'](_0x682e('0xa'),auth[_0x682e('0x8')](),controller['update']);router[_0x682e('0xd')]('/:id',auth[_0x682e('0x8')](),controller[_0x682e('0xe')]);module[_0x682e('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 37a2cf2..d543140 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 _0x4538=['noop','TEXT','sequelize','INTEGER','STRING'];(function(_0x48cf09,_0x3b5f6c){var _0x203b57=function(_0x359da1){while(--_0x359da1){_0x48cf09['push'](_0x48cf09['shift']());}};_0x203b57(++_0x3b5f6c);}(_0x4538,0x1ba));var _0x8453=function(_0x27e1d1,_0x2c86ca){_0x27e1d1=_0x27e1d1-0x0;var _0x805710=_0x4538[_0x27e1d1];return _0x805710;};'use strict';var Sequelize=require(_0x8453('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8453('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8453('0x2')],'allowNull':![],'defaultValue':_0x8453('0x3')},'appdata':{'type':Sequelize[_0x8453('0x4')]()},'description':{'type':Sequelize[_0x8453('0x2')]},'interval':{'type':Sequelize[_0x8453('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x653f=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x5f0ea6,_0x4245c7){var _0x324271=function(_0x443494){while(--_0x443494){_0x5f0ea6['push'](_0x5f0ea6['shift']());}};_0x324271(++_0x4245c7);}(_0x653f,0x113));var _0xf653=function(_0x554426,_0x1c6d02){_0x554426=_0x554426-0x0;var _0x56d296=_0x653f[_0x554426];return _0x56d296;};'use strict';var Sequelize=require(_0xf653('0x0'));module[_0xf653('0x1')]={'priority':{'type':Sequelize[_0xf653('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf653('0x3')],'allowNull':![],'defaultValue':_0xf653('0x4')},'appdata':{'type':Sequelize[_0xf653('0x5')]()},'description':{'type':Sequelize[_0xf653('0x3')]},'interval':{'type':Sequelize[_0xf653('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 6f68470..67605f5 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 _0xaa34=['merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xaa34,0xa6));var _0x4aa3=function(_0x3d3f70,_0x1f759e){_0x3d3f70=_0x3d3f70-0x0;var _0x448f82=_0xaa34[_0x3d3f70];return _0x448f82;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4aa3('0x0'));var zipdir=require(_0x4aa3('0x1'));var jsonpatch=require(_0x4aa3('0x2'));var rp=require(_0x4aa3('0x3'));var moment=require(_0x4aa3('0x4'));var BPromise=require(_0x4aa3('0x5'));var Mustache=require(_0x4aa3('0x6'));var util=require(_0x4aa3('0x7'));var path=require(_0x4aa3('0x8'));var sox=require(_0x4aa3('0x9'));var csv=require(_0x4aa3('0xa'));var ejs=require(_0x4aa3('0xb'));var fs=require('fs');var fs_extra=require(_0x4aa3('0xc'));var _=require(_0x4aa3('0xd'));var squel=require('squel');var crypto=require(_0x4aa3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4aa3('0xa'));var querystring=require(_0x4aa3('0xf'));var Papa=require(_0x4aa3('0x10'));var Redis=require(_0x4aa3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4aa3('0x12'));var as=require(_0x4aa3('0x13'));var hardwareService=require(_0x4aa3('0x14'));var logger=require(_0x4aa3('0x15'))(_0x4aa3('0x16'));var utils=require(_0x4aa3('0x17'));var config=require(_0x4aa3('0x18'));var licenseUtil=require(_0x4aa3('0x19'));var db=require(_0x4aa3('0x1a'))['db'];function respondWithStatusCode(_0x2456ee,_0x2e301a){_0x2e301a=_0x2e301a||0xcc;return function(_0x212f2b){if(_0x212f2b){return _0x2456ee[_0x4aa3('0x1b')](_0x2e301a);}return _0x2456ee['status'](_0x2e301a)[_0x4aa3('0x1c')]();};}function respondWithResult(_0x256f27,_0x24f3b3){_0x24f3b3=_0x24f3b3||0xc8;return function(_0x32b198){if(_0x32b198){return _0x256f27[_0x4aa3('0x1d')](_0x24f3b3)[_0x4aa3('0x1e')](_0x32b198);}};}function respondWithFilteredResult(_0x1120f4,_0x574247){return function(_0x4c5c58){if(_0x4c5c58){var _0x5b9f56=typeof _0x574247[_0x4aa3('0x1f')]==='undefined'&&typeof _0x574247[_0x4aa3('0x20')]===_0x4aa3('0x21');var _0x2b2a1e=_0x4c5c58[_0x4aa3('0x22')];var _0x1e5a02=_0x5b9f56?0x0:_0x574247[_0x4aa3('0x1f')];var _0x177cc8=_0x5b9f56?_0x4c5c58['count']:_0x574247[_0x4aa3('0x1f')]+_0x574247['limit'];var _0x758e93;if(_0x177cc8>=_0x2b2a1e){_0x177cc8=_0x2b2a1e;_0x758e93=0xc8;}else{_0x758e93=0xce;}_0x1120f4[_0x4aa3('0x1d')](_0x758e93);return _0x1120f4[_0x4aa3('0x23')]('Content-Range',_0x1e5a02+'-'+_0x177cc8+'/'+_0x2b2a1e)[_0x4aa3('0x1e')](_0x4c5c58);}return null;};}function patchUpdates(_0x39ddca){return function(_0x3b401b){try{jsonpatch[_0x4aa3('0x24')](_0x3b401b,_0x39ddca,!![]);}catch(_0x546196){return BPromise[_0x4aa3('0x25')](_0x546196);}return _0x3b401b[_0x4aa3('0x26')]();};}function saveUpdates(_0x3b25d2,_0x4e27fb){return function(_0x3bb196){if(_0x3bb196){return _0x3bb196[_0x4aa3('0x27')](_0x3b25d2)[_0x4aa3('0x28')](function(_0x1ac129){return _0x1ac129;});}return null;};}function removeEntity(_0x3ca7eb,_0x3e7634){return function(_0x4e4748){if(_0x4e4748){return _0x4e4748[_0x4aa3('0x29')]()[_0x4aa3('0x28')](function(){_0x3ca7eb[_0x4aa3('0x1d')](0xcc)[_0x4aa3('0x1c')]();});}};}function handleEntityNotFound(_0x246e8f,_0x44e50f){return function(_0x389b23){if(!_0x389b23){_0x246e8f['sendStatus'](0x194);}return _0x389b23;};}function handleError(_0x5e8efc,_0x2d064c){_0x2d064c=_0x2d064c||0x1f4;return function(_0x4558f2){logger[_0x4aa3('0x2a')](_0x4558f2['stack']);if(_0x4558f2[_0x4aa3('0x2b')]){delete _0x4558f2[_0x4aa3('0x2b')];}_0x5e8efc[_0x4aa3('0x1d')](_0x2d064c)[_0x4aa3('0x2c')](_0x4558f2);};}exports[_0x4aa3('0x2d')]=function(_0x4b33ed,_0x5b277c){var _0x46ecf5={},_0x162013={},_0x40b8f8={'count':0x0,'rows':[]};var _0x533ec4=_[_0x4aa3('0x2e')](db[_0x4aa3('0x2f')][_0x4aa3('0x30')],function(_0x3bcf1f){return{'name':_0x3bcf1f[_0x4aa3('0x31')],'type':_0x3bcf1f[_0x4aa3('0x32')][_0x4aa3('0x33')]};});_0x162013['model']=_[_0x4aa3('0x2e')](_0x533ec4,_0x4aa3('0x2b'));_0x162013[_0x4aa3('0x34')]=_[_0x4aa3('0x35')](_0x4b33ed[_0x4aa3('0x34')]);_0x162013[_0x4aa3('0x36')]=_[_0x4aa3('0x37')](_0x162013[_0x4aa3('0x38')],_0x162013[_0x4aa3('0x34')]);_0x46ecf5[_0x4aa3('0x39')]=_[_0x4aa3('0x37')](_0x162013[_0x4aa3('0x38')],qs[_0x4aa3('0x3a')](_0x4b33ed[_0x4aa3('0x34')][_0x4aa3('0x3a')]));_0x46ecf5['attributes']=_0x46ecf5[_0x4aa3('0x39')][_0x4aa3('0x3b')]?_0x46ecf5[_0x4aa3('0x39')]:_0x162013[_0x4aa3('0x38')];if(!_0x4b33ed[_0x4aa3('0x34')]['hasOwnProperty']('nolimit')){_0x46ecf5['limit']=qs[_0x4aa3('0x20')](_0x4b33ed[_0x4aa3('0x34')][_0x4aa3('0x20')]);_0x46ecf5[_0x4aa3('0x1f')]=qs[_0x4aa3('0x1f')](_0x4b33ed[_0x4aa3('0x34')][_0x4aa3('0x1f')]);}_0x46ecf5[_0x4aa3('0x3c')]=qs[_0x4aa3('0x3d')](_0x4b33ed['query']['sort']);_0x46ecf5[_0x4aa3('0x3e')]=qs[_0x4aa3('0x36')](_[_0x4aa3('0x3f')](_0x4b33ed[_0x4aa3('0x34')],_0x162013[_0x4aa3('0x36')]),_0x533ec4);if(_0x4b33ed[_0x4aa3('0x34')][_0x4aa3('0x40')]){_0x46ecf5[_0x4aa3('0x3e')]=_[_0x4aa3('0x41')](_0x46ecf5['where'],{'$or':_[_0x4aa3('0x2e')](_0x533ec4,function(_0x377e19){if(_0x377e19[_0x4aa3('0x32')]!==_0x4aa3('0x42')){var _0x442b85={};_0x442b85[_0x377e19[_0x4aa3('0x2b')]]={'$like':'%'+_0x4b33ed[_0x4aa3('0x34')][_0x4aa3('0x40')]+'%'};return _0x442b85;}})});}_0x46ecf5=_[_0x4aa3('0x41')]({},_0x46ecf5,_0x4b33ed['options']);var _0x1d76fa={'where':_0x46ecf5['where']};return db['SmsApplication']['count'](_0x1d76fa)[_0x4aa3('0x28')](function(_0x374a88){_0x40b8f8['count']=_0x374a88;if(_0x4b33ed[_0x4aa3('0x34')][_0x4aa3('0x43')]){_0x46ecf5[_0x4aa3('0x44')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x46ecf5);})[_0x4aa3('0x28')](function(_0x39d92e){_0x40b8f8[_0x4aa3('0x45')]=_0x39d92e;return _0x40b8f8;})[_0x4aa3('0x28')](respondWithFilteredResult(_0x5b277c,_0x46ecf5))[_0x4aa3('0x46')](handleError(_0x5b277c,null));};exports[_0x4aa3('0x47')]=function(_0x44a4b0,_0x5d9f72){var _0x3562a3={'raw':!![],'where':{'id':_0x44a4b0[_0x4aa3('0x48')]['id']}},_0x852287={};_0x852287['model']=_[_0x4aa3('0x35')](db[_0x4aa3('0x2f')]['rawAttributes']);_0x852287[_0x4aa3('0x34')]=_[_0x4aa3('0x35')](_0x44a4b0[_0x4aa3('0x34')]);_0x852287['filters']=_[_0x4aa3('0x37')](_0x852287['model'],_0x852287[_0x4aa3('0x34')]);_0x3562a3[_0x4aa3('0x39')]=_['intersection'](_0x852287[_0x4aa3('0x38')],qs[_0x4aa3('0x3a')](_0x44a4b0[_0x4aa3('0x34')][_0x4aa3('0x3a')]));_0x3562a3[_0x4aa3('0x39')]=_0x3562a3[_0x4aa3('0x39')][_0x4aa3('0x3b')]?_0x3562a3[_0x4aa3('0x39')]:_0x852287[_0x4aa3('0x38')];if(_0x44a4b0[_0x4aa3('0x34')][_0x4aa3('0x43')]){_0x3562a3[_0x4aa3('0x44')]=[{'all':!![]}];}_0x3562a3=_[_0x4aa3('0x41')]({},_0x3562a3,_0x44a4b0[_0x4aa3('0x49')]);return db['SmsApplication'][_0x4aa3('0x4a')](_0x3562a3)['then'](handleEntityNotFound(_0x5d9f72,null))[_0x4aa3('0x28')](respondWithResult(_0x5d9f72,null))[_0x4aa3('0x46')](handleError(_0x5d9f72,null));};exports[_0x4aa3('0x4b')]=function(_0xceb501,_0x52e2b3){return db['SmsApplication'][_0x4aa3('0x4b')](_0xceb501[_0x4aa3('0x4c')],{})[_0x4aa3('0x28')](respondWithResult(_0x52e2b3,0xc9))[_0x4aa3('0x46')](handleError(_0x52e2b3,null));};exports[_0x4aa3('0x27')]=function(_0xed72ea,_0xe07184){if(_0xed72ea[_0x4aa3('0x4c')]['id']){delete _0xed72ea[_0x4aa3('0x4c')]['id'];}return db['SmsApplication'][_0x4aa3('0x4a')]({'where':{'id':_0xed72ea['params']['id']}})[_0x4aa3('0x28')](handleEntityNotFound(_0xe07184,null))[_0x4aa3('0x28')](saveUpdates(_0xed72ea[_0x4aa3('0x4c')],null))[_0x4aa3('0x28')](respondWithResult(_0xe07184,null))['catch'](handleError(_0xe07184,null));};exports[_0x4aa3('0x29')]=function(_0x415a4a,_0x367357){return db[_0x4aa3('0x2f')]['find']({'where':{'id':_0x415a4a[_0x4aa3('0x48')]['id']}})['then'](handleEntityNotFound(_0x367357,null))[_0x4aa3('0x28')](removeEntity(_0x367357,null))[_0x4aa3('0x46')](handleError(_0x367357,null));}; \ No newline at end of file +var _0xd05d=['fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','options','find','catch','create','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','offset','limit','undefined','count','set','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xd05d,0xe6));var _0xdd05=function(_0x234677,_0x19baec){_0x234677=_0x234677-0x0;var _0x47ec4f=_0xd05d[_0x234677];return _0x47ec4f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd05('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd05('0x1'));var rp=require(_0xdd05('0x2'));var moment=require(_0xdd05('0x3'));var BPromise=require(_0xdd05('0x4'));var Mustache=require(_0xdd05('0x5'));var util=require(_0xdd05('0x6'));var path=require(_0xdd05('0x7'));var sox=require('sox');var csv=require(_0xdd05('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd05('0x9'));var crypto=require(_0xdd05('0xa'));var jsforce=require(_0xdd05('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdd05('0x8'));var querystring=require(_0xdd05('0xc'));var Papa=require(_0xdd05('0xd'));var Redis=require('ioredis');var authService=require(_0xdd05('0xe'));var qs=require(_0xdd05('0xf'));var as=require(_0xdd05('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd05('0x11'))(_0xdd05('0x12'));var utils=require(_0xdd05('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e1e14,_0x18a792){_0x18a792=_0x18a792||0xcc;return function(_0x271042){if(_0x271042){return _0x5e1e14[_0xdd05('0x14')](_0x18a792);}return _0x5e1e14[_0xdd05('0x15')](_0x18a792)['end']();};}function respondWithResult(_0x17fca0,_0x437ed3){_0x437ed3=_0x437ed3||0xc8;return function(_0x3f1c65){if(_0x3f1c65){return _0x17fca0[_0xdd05('0x15')](_0x437ed3)['json'](_0x3f1c65);}};}function respondWithFilteredResult(_0x22d835,_0x48335c){return function(_0xa4248d){if(_0xa4248d){var _0x4ae8db=typeof _0x48335c[_0xdd05('0x16')]==='undefined'&&typeof _0x48335c[_0xdd05('0x17')]===_0xdd05('0x18');var _0x279990=_0xa4248d['count'];var _0xaf2ac5=_0x4ae8db?0x0:_0x48335c['offset'];var _0x44b8e5=_0x4ae8db?_0xa4248d[_0xdd05('0x19')]:_0x48335c[_0xdd05('0x16')]+_0x48335c[_0xdd05('0x17')];var _0x1beb3a;if(_0x44b8e5>=_0x279990){_0x44b8e5=_0x279990;_0x1beb3a=0xc8;}else{_0x1beb3a=0xce;}_0x22d835['status'](_0x1beb3a);return _0x22d835[_0xdd05('0x1a')]('Content-Range',_0xaf2ac5+'-'+_0x44b8e5+'/'+_0x279990)['json'](_0xa4248d);}return null;};}function patchUpdates(_0x5e4ab4){return function(_0x240f9a){try{jsonpatch['apply'](_0x240f9a,_0x5e4ab4,!![]);}catch(_0x1ef291){return BPromise[_0xdd05('0x1b')](_0x1ef291);}return _0x240f9a[_0xdd05('0x1c')]();};}function saveUpdates(_0x491cde,_0x2ef844){return function(_0x26cfd3){if(_0x26cfd3){return _0x26cfd3[_0xdd05('0x1d')](_0x491cde)[_0xdd05('0x1e')](function(_0x2d6b77){return _0x2d6b77;});}return null;};}function removeEntity(_0x19f822,_0x4f8c9a){return function(_0x11a8f3){if(_0x11a8f3){return _0x11a8f3[_0xdd05('0x1f')]()[_0xdd05('0x1e')](function(){_0x19f822['status'](0xcc)[_0xdd05('0x20')]();});}};}function handleEntityNotFound(_0x4c6047,_0x32b2b9){return function(_0x1620c4){if(!_0x1620c4){_0x4c6047['sendStatus'](0x194);}return _0x1620c4;};}function handleError(_0x43796d,_0x1213d8){_0x1213d8=_0x1213d8||0x1f4;return function(_0x1a66dd){logger[_0xdd05('0x21')](_0x1a66dd[_0xdd05('0x22')]);if(_0x1a66dd['name']){delete _0x1a66dd[_0xdd05('0x23')];}_0x43796d[_0xdd05('0x15')](_0x1213d8)[_0xdd05('0x24')](_0x1a66dd);};}exports[_0xdd05('0x25')]=function(_0x5c4f8d,_0x1eceea){var _0x4bc484={},_0x116a65={},_0x3d7d95={'count':0x0,'rows':[]};var _0x3d3844=_[_0xdd05('0x26')](db[_0xdd05('0x27')][_0xdd05('0x28')],function(_0x3a689c){return{'name':_0x3a689c[_0xdd05('0x29')],'type':_0x3a689c[_0xdd05('0x2a')][_0xdd05('0x2b')]};});_0x116a65['model']=_[_0xdd05('0x26')](_0x3d3844,_0xdd05('0x23'));_0x116a65['query']=_[_0xdd05('0x2c')](_0x5c4f8d[_0xdd05('0x2d')]);_0x116a65[_0xdd05('0x2e')]=_[_0xdd05('0x2f')](_0x116a65[_0xdd05('0x30')],_0x116a65[_0xdd05('0x2d')]);_0x4bc484[_0xdd05('0x31')]=_[_0xdd05('0x2f')](_0x116a65[_0xdd05('0x30')],qs[_0xdd05('0x32')](_0x5c4f8d[_0xdd05('0x2d')][_0xdd05('0x32')]));_0x4bc484[_0xdd05('0x31')]=_0x4bc484[_0xdd05('0x31')]['length']?_0x4bc484[_0xdd05('0x31')]:_0x116a65[_0xdd05('0x30')];if(!_0x5c4f8d[_0xdd05('0x2d')]['hasOwnProperty'](_0xdd05('0x33'))){_0x4bc484[_0xdd05('0x17')]=qs['limit'](_0x5c4f8d['query'][_0xdd05('0x17')]);_0x4bc484[_0xdd05('0x16')]=qs[_0xdd05('0x16')](_0x5c4f8d['query'][_0xdd05('0x16')]);}_0x4bc484[_0xdd05('0x34')]=qs[_0xdd05('0x35')](_0x5c4f8d[_0xdd05('0x2d')][_0xdd05('0x35')]);_0x4bc484[_0xdd05('0x36')]=qs[_0xdd05('0x2e')](_[_0xdd05('0x37')](_0x5c4f8d[_0xdd05('0x2d')],_0x116a65[_0xdd05('0x2e')]),_0x3d3844);if(_0x5c4f8d['query'][_0xdd05('0x38')]){_0x4bc484['where']=_[_0xdd05('0x39')](_0x4bc484['where'],{'$or':_[_0xdd05('0x26')](_0x3d3844,function(_0x584a7f){if(_0x584a7f[_0xdd05('0x2a')]!==_0xdd05('0x3a')){var _0x520a68={};_0x520a68[_0x584a7f[_0xdd05('0x23')]]={'$like':'%'+_0x5c4f8d['query'][_0xdd05('0x38')]+'%'};return _0x520a68;}})});}_0x4bc484=_[_0xdd05('0x39')]({},_0x4bc484,_0x5c4f8d['options']);var _0x3f17aa={'where':_0x4bc484[_0xdd05('0x36')]};return db[_0xdd05('0x27')][_0xdd05('0x19')](_0x3f17aa)[_0xdd05('0x1e')](function(_0xbc8e4b){_0x3d7d95[_0xdd05('0x19')]=_0xbc8e4b;if(_0x5c4f8d['query'][_0xdd05('0x3b')]){_0x4bc484[_0xdd05('0x3c')]=[{'all':!![]}];}return db[_0xdd05('0x27')][_0xdd05('0x3d')](_0x4bc484);})[_0xdd05('0x1e')](function(_0x4e5b0f){_0x3d7d95[_0xdd05('0x3e')]=_0x4e5b0f;return _0x3d7d95;})[_0xdd05('0x1e')](respondWithFilteredResult(_0x1eceea,_0x4bc484))['catch'](handleError(_0x1eceea,null));};exports[_0xdd05('0x3f')]=function(_0x5eb0b8,_0x1eee3e){var _0xa425d7={'raw':!![],'where':{'id':_0x5eb0b8['params']['id']}},_0x4e563b={};_0x4e563b[_0xdd05('0x30')]=_[_0xdd05('0x2c')](db[_0xdd05('0x27')][_0xdd05('0x28')]);_0x4e563b[_0xdd05('0x2d')]=_[_0xdd05('0x2c')](_0x5eb0b8[_0xdd05('0x2d')]);_0x4e563b['filters']=_[_0xdd05('0x2f')](_0x4e563b['model'],_0x4e563b['query']);_0xa425d7[_0xdd05('0x31')]=_[_0xdd05('0x2f')](_0x4e563b['model'],qs[_0xdd05('0x32')](_0x5eb0b8['query'][_0xdd05('0x32')]));_0xa425d7['attributes']=_0xa425d7['attributes']['length']?_0xa425d7[_0xdd05('0x31')]:_0x4e563b['model'];if(_0x5eb0b8[_0xdd05('0x2d')]['includeAll']){_0xa425d7[_0xdd05('0x3c')]=[{'all':!![]}];}_0xa425d7=_[_0xdd05('0x39')]({},_0xa425d7,_0x5eb0b8[_0xdd05('0x40')]);return db[_0xdd05('0x27')][_0xdd05('0x41')](_0xa425d7)[_0xdd05('0x1e')](handleEntityNotFound(_0x1eee3e,null))[_0xdd05('0x1e')](respondWithResult(_0x1eee3e,null))[_0xdd05('0x42')](handleError(_0x1eee3e,null));};exports['create']=function(_0x3af54c,_0x23c453){return db[_0xdd05('0x27')][_0xdd05('0x43')](_0x3af54c['body'],{})[_0xdd05('0x1e')](respondWithResult(_0x23c453,0xc9))['catch'](handleError(_0x23c453,null));};exports[_0xdd05('0x1d')]=function(_0x2582df,_0x15861e){if(_0x2582df[_0xdd05('0x44')]['id']){delete _0x2582df[_0xdd05('0x44')]['id'];}return db[_0xdd05('0x27')]['find']({'where':{'id':_0x2582df['params']['id']}})[_0xdd05('0x1e')](handleEntityNotFound(_0x15861e,null))[_0xdd05('0x1e')](saveUpdates(_0x2582df[_0xdd05('0x44')],null))[_0xdd05('0x1e')](respondWithResult(_0x15861e,null))[_0xdd05('0x42')](handleError(_0x15861e,null));};exports[_0xdd05('0x1f')]=function(_0x14c1fc,_0x25ae8e){return db['SmsApplication'][_0xdd05('0x41')]({'where':{'id':_0x14c1fc[_0xdd05('0x45')]['id']}})['then'](handleEntityNotFound(_0x25ae8e,null))['then'](removeEntity(_0x25ae8e,null))['catch'](handleError(_0x25ae8e,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 8e773df..11197f3 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 _0x4acd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x1b887c,_0x50005b){var _0x3d6210=function(_0x1797a1){while(--_0x1797a1){_0x1b887c['push'](_0x1b887c['shift']());}};_0x3d6210(++_0x50005b);}(_0x4acd,0x137));var _0xd4ac=function(_0xa8b370,_0x2b77db){_0xa8b370=_0xa8b370-0x0;var _0x643e37=_0x4acd[_0xa8b370];return _0x643e37;};'use strict';var _=require(_0xd4ac('0x0'));var util=require(_0xd4ac('0x1'));var logger=require(_0xd4ac('0x2'))(_0xd4ac('0x3'));var moment=require(_0xd4ac('0x4'));var BPromise=require(_0xd4ac('0x5'));var rp=require(_0xd4ac('0x6'));var fs=require('fs');var path=require(_0xd4ac('0x7'));var rimraf=require(_0xd4ac('0x8'));var config=require(_0xd4ac('0x9'));var attributes=require(_0xd4ac('0xa'));module[_0xd4ac('0xb')]=function(_0x1cefbf,_0x45fe5f){return _0x1cefbf['define']('SmsApplication',attributes,{'tableName':_0xd4ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd4ac('0xd'),'collate':_0xd4ac('0xe')});}; \ No newline at end of file +var _0xcb26=['define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xcb26,0x95));var _0x6cb2=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xcb26[_0x28aea5];return _0x6a55f9;};'use strict';var _=require('lodash');var util=require(_0x6cb2('0x0'));var logger=require(_0x6cb2('0x1'))(_0x6cb2('0x2'));var moment=require(_0x6cb2('0x3'));var BPromise=require(_0x6cb2('0x4'));var rp=require(_0x6cb2('0x5'));var fs=require('fs');var path=require(_0x6cb2('0x6'));var rimraf=require(_0x6cb2('0x7'));var config=require(_0x6cb2('0x8'));var attributes=require(_0x6cb2('0x9'));module[_0x6cb2('0xa')]=function(_0x4c606c,_0x47eb5a){return _0x4c606c[_0x6cb2('0xb')](_0x6cb2('0xc'),attributes,{'tableName':_0x6cb2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6cb2('0xe'),'collate':_0x6cb2('0xf')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 9d9e23d..47bef7c 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 _0x5b20=['SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\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','http','request','then','info'];(function(_0x513597,_0x1641d2){var _0x46c6f9=function(_0x51187d){while(--_0x51187d){_0x513597['push'](_0x513597['shift']());}};_0x46c6f9(++_0x1641d2);}(_0x5b20,0x86));var _0x05b2=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x5b20[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x05b2('0x0'));var util=require(_0x05b2('0x1'));var moment=require(_0x05b2('0x2'));var BPromise=require(_0x05b2('0x3'));var rs=require(_0x05b2('0x4'));var fs=require('fs');var Redis=require(_0x05b2('0x5'));var db=require(_0x05b2('0x6'))['db'];var utils=require(_0x05b2('0x7'));var logger=require(_0x05b2('0x8'))(_0x05b2('0x9'));var config=require(_0x05b2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x05b2('0xb')][_0x05b2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x541855,_0x24f11f,_0x43cd94){return new BPromise(function(_0x3be69a,_0x1b66e4){return client[_0x05b2('0xd')](_0x541855,_0x43cd94)[_0x05b2('0xe')](function(_0xfe6680){logger[_0x05b2('0xf')](_0x05b2('0x10'),_0x24f11f,_0x05b2('0x11'));logger[_0x05b2('0x12')](_0x05b2('0x13'),_0x24f11f,_0x05b2('0x11'),JSON[_0x05b2('0x14')](_0xfe6680));if(_0xfe6680[_0x05b2('0x15')]){if(_0xfe6680[_0x05b2('0x15')]['code']===0x1f4){logger[_0x05b2('0x15')](_0x05b2('0x10'),_0x24f11f,_0xfe6680[_0x05b2('0x15')][_0x05b2('0x16')]);return _0x1b66e4(_0xfe6680['error'][_0x05b2('0x16')]);}logger[_0x05b2('0x15')](_0x05b2('0x10'),_0x24f11f,_0xfe6680['error']['message']);return _0x3be69a(_0xfe6680[_0x05b2('0x15')][_0x05b2('0x16')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x24f11f,_0x05b2('0x11'));_0x3be69a(_0xfe6680[_0x05b2('0x17')][_0x05b2('0x16')]);}})[_0x05b2('0x18')](function(_0x234843){logger[_0x05b2('0x15')](_0x05b2('0x10'),_0x24f11f,_0x234843);_0x1b66e4(_0x234843);});});} \ No newline at end of file +var _0x0cd6=['../../config/utils','../../config/environment','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x418060,_0xd3b3b7){var _0x21f56b=function(_0x1fd89e){while(--_0x1fd89e){_0x418060['push'](_0x418060['shift']());}};_0x21f56b(++_0xd3b3b7);}(_0x0cd6,0x113));var _0x60cd=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0x0cd6[_0x2cd1fb];return _0x48fd2b;};'use strict';var _=require(_0x60cd('0x0'));var util=require(_0x60cd('0x1'));var moment=require('moment');var BPromise=require(_0x60cd('0x2'));var rs=require(_0x60cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x60cd('0x4'))['db'];var utils=require(_0x60cd('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x60cd('0x6'));var jayson=require(_0x60cd('0x7'));var client=jayson[_0x60cd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x381044,_0x4b66cd,_0x1249cb){return new BPromise(function(_0x2c973,_0x160a7f){return client[_0x60cd('0x9')](_0x381044,_0x1249cb)[_0x60cd('0xa')](function(_0x3f2991){logger[_0x60cd('0xb')](_0x60cd('0xc'),_0x4b66cd,_0x60cd('0xd'));logger['debug'](_0x60cd('0xe'),_0x4b66cd,_0x60cd('0xd'),JSON['stringify'](_0x3f2991));if(_0x3f2991[_0x60cd('0xf')]){if(_0x3f2991['error'][_0x60cd('0x10')]===0x1f4){logger[_0x60cd('0xf')]('SmsApplication,\x20%s,\x20%s',_0x4b66cd,_0x3f2991[_0x60cd('0xf')][_0x60cd('0x11')]);return _0x160a7f(_0x3f2991[_0x60cd('0xf')]['message']);}logger[_0x60cd('0xf')](_0x60cd('0xc'),_0x4b66cd,_0x3f2991['error'][_0x60cd('0x11')]);return _0x2c973(_0x3f2991['error'][_0x60cd('0x11')]);}else{logger[_0x60cd('0xb')]('SmsApplication,\x20%s,\x20%s',_0x4b66cd,'request\x20sent');_0x2c973(_0x3f2991[_0x60cd('0x12')][_0x60cd('0x11')]);}})[_0x60cd('0x13')](function(_0x5d0125){logger[_0x60cd('0xf')](_0x60cd('0xc'),_0x4b66cd,_0x5d0125);_0x160a7f(_0x5d0125);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index ca866ae..311b66c 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 _0x3c8e=['smsinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete'];(function(_0x238736,_0x14b2f9){var _0x2ef382=function(_0x529441){while(--_0x529441){_0x238736['push'](_0x238736['shift']());}};_0x2ef382(++_0x14b2f9);}(_0x3c8e,0x89));var _0xe3c8=function(_0x55565e,_0x16eb3e){_0x55565e=_0x55565e-0x0;var _0x377d97=_0x3c8e[_0x55565e];return _0x377d97;};'use strict';var multer=require(_0xe3c8('0x0'));var util=require(_0xe3c8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe3c8('0x2'));var router=express[_0xe3c8('0x3')]();var fs_extra=require(_0xe3c8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe3c8('0x5'));var config=require(_0xe3c8('0x6'));var controller=require(_0xe3c8('0x7'));router[_0xe3c8('0x8')]('/',auth['isAuthenticated'](),controller[_0xe3c8('0x9')]);router[_0xe3c8('0x8')](_0xe3c8('0xa'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0xc')]);router['get'](_0xe3c8('0xd'),auth['isAuthenticated'](),controller[_0xe3c8('0xe')]);router[_0xe3c8('0x8')](_0xe3c8('0xf'),auth[_0xe3c8('0xb')](),controller['getMessages']);router[_0xe3c8('0x8')](_0xe3c8('0x10'),auth[_0xe3c8('0xb')](),controller['download']);router[_0xe3c8('0x11')]('/',auth['isAuthenticated'](),controller[_0xe3c8('0x12')]);router['post']('/:id/messages',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x13')]);router[_0xe3c8('0x11')]('/:id/tags',auth[_0xe3c8('0xb')](),interaction[_0xe3c8('0x14')](_0xe3c8('0x15'),_0xe3c8('0x16')),controller[_0xe3c8('0x17')]);router[_0xe3c8('0x18')]('/:id',auth[_0xe3c8('0xb')](),interaction[_0xe3c8('0x14')]('sms',_0xe3c8('0x19')),controller[_0xe3c8('0x1a')]);router[_0xe3c8('0x1b')]('/:id',auth[_0xe3c8('0xb')](),interaction[_0xe3c8('0x14')](_0xe3c8('0x15'),_0xe3c8('0x1c')),controller[_0xe3c8('0x1d')]);router[_0xe3c8('0x1b')](_0xe3c8('0x1e'),auth['isAuthenticated'](),controller[_0xe3c8('0x1f')]);module[_0xe3c8('0x20')]=router; \ No newline at end of file +var _0x7da6=['get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','smsinteraction:addtags','addTags','sms','smsinteraction:update','update','delete','smsinteraction:destroy','removeTags','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller'];(function(_0x2e1ca6,_0x18faa7){var _0x584380=function(_0x4d5048){while(--_0x4d5048){_0x2e1ca6['push'](_0x2e1ca6['shift']());}};_0x584380(++_0x18faa7);}(_0x7da6,0x124));var _0x67da=function(_0xdc356f,_0x3003d0){_0xdc356f=_0xdc356f-0x0;var _0x339eaa=_0x7da6[_0xdc356f];return _0x339eaa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x67da('0x0'));var timeout=require(_0x67da('0x1'));var express=require(_0x67da('0x2'));var router=express[_0x67da('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x67da('0x4'));var interaction=require(_0x67da('0x5'));var config=require(_0x67da('0x6'));var controller=require(_0x67da('0x7'));router[_0x67da('0x8')]('/',auth[_0x67da('0x9')](),controller['index']);router[_0x67da('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x67da('0xa')]);router['get'](_0x67da('0xb'),auth['isAuthenticated'](),controller[_0x67da('0xc')]);router[_0x67da('0x8')](_0x67da('0xd'),auth[_0x67da('0x9')](),controller[_0x67da('0xe')]);router[_0x67da('0x8')](_0x67da('0xf'),auth['isAuthenticated'](),controller[_0x67da('0x10')]);router[_0x67da('0x11')]('/',auth[_0x67da('0x9')](),controller[_0x67da('0x12')]);router[_0x67da('0x11')](_0x67da('0xd'),auth['isAuthenticated'](),controller[_0x67da('0x13')]);router[_0x67da('0x11')](_0x67da('0x14'),auth[_0x67da('0x9')](),interaction[_0x67da('0x15')]('sms',_0x67da('0x16')),controller[_0x67da('0x17')]);router['put'](_0x67da('0xb'),auth[_0x67da('0x9')](),interaction[_0x67da('0x15')](_0x67da('0x18'),_0x67da('0x19')),controller[_0x67da('0x1a')]);router[_0x67da('0x1b')](_0x67da('0xb'),auth['isAuthenticated'](),interaction[_0x67da('0x15')]('sms',_0x67da('0x1c')),controller['destroy']);router[_0x67da('0x1b')](_0x67da('0x14'),auth[_0x67da('0x9')](),controller[_0x67da('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 6b63ae5..ff92033 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 _0x56f9=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x41f813,_0x730a37){var _0x223a5f=function(_0x310907){while(--_0x310907){_0x41f813['push'](_0x41f813['shift']());}};_0x223a5f(++_0x730a37);}(_0x56f9,0x109));var _0x956f=function(_0x52b1a7,_0x5b4f4f){_0x52b1a7=_0x52b1a7-0x0;var _0x2165d2=_0x56f9[_0x52b1a7];return _0x2165d2;};'use strict';var Sequelize=require(_0x956f('0x0'));var moment=require(_0x956f('0x1'));module[_0x956f('0x2')]={'closed':{'type':Sequelize[_0x956f('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x956f('0x4')]},'disposition':{'type':Sequelize[_0x956f('0x5')]},'secondDisposition':{'type':Sequelize[_0x956f('0x5')]},'thirdDisposition':{'type':Sequelize[_0x956f('0x5')]},'note':{'type':Sequelize[_0x956f('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x956f('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x956f('0x6')]('in',_0x956f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x956f('0x6')]('in',_0x956f('0x7')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x1f35=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x316af1,_0x13757a){var _0x450661=function(_0x2774f8){while(--_0x2774f8){_0x316af1['push'](_0x316af1['shift']());}};_0x450661(++_0x13757a);}(_0x1f35,0x189));var _0x51f3=function(_0x59b65f,_0x1c9a24){_0x59b65f=_0x59b65f-0x0;var _0x4d8b76=_0x1f35[_0x59b65f];return _0x4d8b76;};'use strict';var Sequelize=require(_0x51f3('0x0'));var moment=require(_0x51f3('0x1'));module[_0x51f3('0x2')]={'closed':{'type':Sequelize[_0x51f3('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x51f3('0x4')]},'disposition':{'type':Sequelize[_0x51f3('0x5')]},'secondDisposition':{'type':Sequelize[_0x51f3('0x5')]},'thirdDisposition':{'type':Sequelize[_0x51f3('0x5')]},'note':{'type':Sequelize[_0x51f3('0x5')]},'phone':{'type':Sequelize[_0x51f3('0x5')]},'read1stAt':{'type':Sequelize[_0x51f3('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x51f3('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x51f3('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x51f3('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 fff13cf..06474e1 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 _0xb7ae=['Account','Owner','N.A.','closedAt','out','System','renderFile','views','downloadInteraction.html','transcript-','.pdf','Sms','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','status','json','limit','undefined','count','offset','Content-Range','apply','reject','then','destroy','end','sendStatus','error','stack','name','send','Users','map','fullname','Tags','TagIds','split','forEach','index','SmsInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','field','color','from','tools_tags','select','u.id','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','isEmpty','SmsAccountId','concat','createdAt','parse','$lte','where','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.mobile','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','all','catch','params','includeAll','options','create','body','describe','SmsMessage','addMessage','ids','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','addTags','omit','spread','emit','smsInteractionTags:save','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','direction','secret'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xb7ae,0xf3));var _0xeb7a=function(_0x59426c,_0x24dd51){_0x59426c=_0x59426c-0x0;var _0x16d54f=_0xb7ae[_0x59426c];return _0x16d54f;};'use strict';var emlformat=require(_0xeb7a('0x0'));var rimraf=require(_0xeb7a('0x1'));var zipdir=require(_0xeb7a('0x2'));var jsonpatch=require(_0xeb7a('0x3'));var rp=require(_0xeb7a('0x4'));var moment=require('moment');var BPromise=require(_0xeb7a('0x5'));var Mustache=require(_0xeb7a('0x6'));var util=require(_0xeb7a('0x7'));var path=require('path');var sox=require(_0xeb7a('0x8'));var csv=require(_0xeb7a('0x9'));var ejs=require(_0xeb7a('0xa'));var fs=require('fs');var fs_extra=require(_0xeb7a('0xb'));var _=require(_0xeb7a('0xc'));var squel=require('squel');var crypto=require(_0xeb7a('0xd'));var jsforce=require(_0xeb7a('0xe'));var deskjs=require(_0xeb7a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xeb7a('0x10'));var Papa=require(_0xeb7a('0x11'));var Redis=require(_0xeb7a('0x12'));var authService=require(_0xeb7a('0x13'));var qs=require(_0xeb7a('0x14'));var as=require(_0xeb7a('0x15'));var pdf=require(_0xeb7a('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb7a('0x17'));var utils=require(_0xeb7a('0x18'));var config=require(_0xeb7a('0x19'));var licenseUtil=require(_0xeb7a('0x1a'));var db=require(_0xeb7a('0x1b'))['db'];config[_0xeb7a('0x1c')]=_[_0xeb7a('0x1d')](config['redis'],{'host':_0xeb7a('0x1e'),'port':0x18eb});var socket=require(_0xeb7a('0x1f'))(new Redis(config['redis']));require(_0xeb7a('0x20'))[_0xeb7a('0x21')](socket);function respondWithStatusCode(_0x5f41f4,_0x2bf77e){_0x2bf77e=_0x2bf77e||0xcc;return function(_0x5db84f){if(_0x5db84f){return _0x5f41f4['sendStatus'](_0x2bf77e);}return _0x5f41f4[_0xeb7a('0x22')](_0x2bf77e)['end']();};}function respondWithResult(_0x5782e6,_0x394208){_0x394208=_0x394208||0xc8;return function(_0x38f5cc){if(_0x38f5cc){return _0x5782e6[_0xeb7a('0x22')](_0x394208)[_0xeb7a('0x23')](_0x38f5cc);}};}function respondWithFilteredResult(_0x540b6c,_0x4be13e){return function(_0x34ade5){if(_0x34ade5){var _0x26bd85=typeof _0x4be13e['offset']==='undefined'&&typeof _0x4be13e[_0xeb7a('0x24')]===_0xeb7a('0x25');var _0x47b62c=_0x34ade5[_0xeb7a('0x26')];var _0x302e41=_0x26bd85?0x0:_0x4be13e[_0xeb7a('0x27')];var _0x29fa3f=_0x26bd85?_0x34ade5[_0xeb7a('0x26')]:_0x4be13e['offset']+_0x4be13e[_0xeb7a('0x24')];var _0x1c26f7;if(_0x29fa3f>=_0x47b62c){_0x29fa3f=_0x47b62c;_0x1c26f7=0xc8;}else{_0x1c26f7=0xce;}_0x540b6c['status'](_0x1c26f7);return _0x540b6c['set'](_0xeb7a('0x28'),_0x302e41+'-'+_0x29fa3f+'/'+_0x47b62c)[_0xeb7a('0x23')](_0x34ade5);}return null;};}function patchUpdates(_0x46a305){return function(_0x4023e2){try{jsonpatch[_0xeb7a('0x29')](_0x4023e2,_0x46a305,!![]);}catch(_0x44cefc){return BPromise[_0xeb7a('0x2a')](_0x44cefc);}return _0x4023e2['save']();};}function saveUpdates(_0x1f0135,_0xcf0f77){return function(_0xc240b3){if(_0xc240b3){return _0xc240b3['update'](_0x1f0135)[_0xeb7a('0x2b')](function(_0x1cf8f6){return _0x1cf8f6;});}return null;};}function removeEntity(_0x182335,_0x9b80f5){return function(_0x53ade4){if(_0x53ade4){return _0x53ade4[_0xeb7a('0x2c')]()['then'](function(){_0x182335[_0xeb7a('0x22')](0xcc)[_0xeb7a('0x2d')]();});}};}function handleEntityNotFound(_0x4d24bc,_0x189e2a){return function(_0x820418){if(!_0x820418){_0x4d24bc[_0xeb7a('0x2e')](0x194);}return _0x820418;};}function handleError(_0x39738e,_0x3917eb){_0x3917eb=_0x3917eb||0x1f4;return function(_0x2a492f){logger[_0xeb7a('0x2f')](_0x2a492f[_0xeb7a('0x30')]);if(_0x2a492f['name']){delete _0x2a492f[_0xeb7a('0x31')];}_0x39738e[_0xeb7a('0x22')](_0x3917eb)[_0xeb7a('0x32')](_0x2a492f);};}function getInteractionUsers(_0x203993,_0x14e2e1){return new BPromise(function(_0x202d22,_0x1662ee){try{if(_0x14e2e1[_0x203993['id']]){_0x203993[_0xeb7a('0x33')]=_[_0xeb7a('0x34')](_0x14e2e1[_0x203993['id']],function(_0x1c2238){return{'id':_0x1c2238['id'],'fullname':_0x1c2238[_0xeb7a('0x35')]};});}}catch(_0x4a72bc){_0x1662ee(_0x4a72bc);}_0x202d22(_0x203993);});}function getInteractionTags(_0x3b94f5,_0x2887c6){return new BPromise(function(_0x3e8490,_0x203e5f){try{if(_0x3b94f5['TagIds']){_0x3b94f5[_0xeb7a('0x36')]=[];_0x3b94f5[_0xeb7a('0x37')][_0xeb7a('0x38')](',')[_0xeb7a('0x39')](function(_0x3a67de){_0x3b94f5[_0xeb7a('0x36')]['push'](_0x2887c6[_0x3a67de]);});}delete _0x3b94f5[_0xeb7a('0x37')];}catch(_0xaad2bc){_0x203e5f(_0xaad2bc);}_0x3e8490(_0x3b94f5);});}function updateSmsInteraction(_0x39981b,_0x3d879c,_0x285943){return new BPromise(function(_0x37c26e,_0x47ba59){return getInteractionUsers(_0x39981b,_0x285943)[_0xeb7a('0x2b')](function(_0x4b226f){return getInteractionTags(_0x4b226f,_0x3d879c);})[_0xeb7a('0x2b')](function(_0x3ac6f4){_0x37c26e(_0x3ac6f4);})['catch'](function(_0x14705a){_0x47ba59(_0x14705a);});});}exports[_0xeb7a('0x3a')]=function(_0x7b5806,_0x226a7e){var _0x348be5={},_0x19bbf0={},_0x2aaf7f={'count':0x0,'rows':[]};var _0x3324e4=_['map'](db[_0xeb7a('0x3b')][_0xeb7a('0x3c')],function(_0x573370){return{'name':_0x573370[_0xeb7a('0x3d')],'type':_0x573370[_0xeb7a('0x3e')][_0xeb7a('0x3f')]};});_0x19bbf0[_0xeb7a('0x40')]=_[_0xeb7a('0x34')](_0x3324e4,_0xeb7a('0x31'));_0x19bbf0[_0xeb7a('0x41')]=_['keys'](_0x7b5806[_0xeb7a('0x41')]);_0x19bbf0[_0xeb7a('0x42')]=_[_0xeb7a('0x43')](_0x19bbf0[_0xeb7a('0x40')],_0x19bbf0[_0xeb7a('0x41')]);_0x348be5[_0xeb7a('0x44')]=_[_0xeb7a('0x43')](_0x19bbf0[_0xeb7a('0x40')],qs[_0xeb7a('0x45')](_0x7b5806[_0xeb7a('0x41')][_0xeb7a('0x45')]));_0x348be5[_0xeb7a('0x44')]=_0x348be5['attributes'][_0xeb7a('0x46')]?_0x348be5[_0xeb7a('0x44')]:_0x19bbf0[_0xeb7a('0x40')];if(!_0x7b5806[_0xeb7a('0x41')]['hasOwnProperty'](_0xeb7a('0x47'))){_0x348be5[_0xeb7a('0x24')]=qs[_0xeb7a('0x24')](_0x7b5806[_0xeb7a('0x41')][_0xeb7a('0x24')]);_0x348be5[_0xeb7a('0x27')]=qs['offset'](_0x7b5806[_0xeb7a('0x41')][_0xeb7a('0x27')]);}_0x348be5['order']=qs[_0xeb7a('0x48')](_0x7b5806['query']['sort']);_0x348be5['where']=qs[_0xeb7a('0x42')](_[_0xeb7a('0x49')](_0x7b5806[_0xeb7a('0x41')],_0x19bbf0[_0xeb7a('0x42')]),_0x3324e4);var _0x34177c=[];var _0x28621a=squel['select']()['field']('id')[_0xeb7a('0x4a')]('name')[_0xeb7a('0x4a')](_0xeb7a('0x4b'))[_0xeb7a('0x4c')](_0xeb7a('0x4d'));var _0x4d0302=squel[_0xeb7a('0x4e')]()[_0xeb7a('0x4a')](_0xeb7a('0x4f'))[_0xeb7a('0x4a')]('u.fullname')[_0xeb7a('0x4a')]('ui.SmsInteractionId')[_0xeb7a('0x4c')](_0xeb7a('0x50'),'ui')[_0xeb7a('0x51')](_0xeb7a('0x52'),'u',_0xeb7a('0x53'));var _0x248f29=squel[_0xeb7a('0x4e')]()['from']('sms_interactions','i')[_0xeb7a('0x51')](_0xeb7a('0x54'),'c',_0xeb7a('0x55'))[_0xeb7a('0x51')](_0xeb7a('0x52'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xeb7a('0x56'),'a','a.id\x20=\x20i.SmsAccountId')[_0xeb7a('0x51')](_0xeb7a('0x57'),'me',_0xeb7a('0x58'))[_0xeb7a('0x51')](_0xeb7a('0x59'),'it',_0xeb7a('0x5a'))[_0xeb7a('0x51')](_0xeb7a('0x4d'),'t',_0xeb7a('0x5b'));var _0x36b645=squel[_0xeb7a('0x5c')]();var _0x2876bb=[];var _0x2af84b=squel[_0xeb7a('0x5c')]();var _0x55eb50;if(_0x7b5806[_0xeb7a('0x41')][_0xeb7a('0x5d')]){_0x55eb50=as[_0xeb7a('0x5e')](_0x7b5806[_0xeb7a('0x41')][_0xeb7a('0x5d')]);var _0x160f6c=_0x55eb50[_0xeb7a('0x5f')];for(var _0x2c1670=0x0;_0x2c1670<_0x55eb50[_0xeb7a('0x60')][_0xeb7a('0x46')];_0x2c1670++){var _0x1b5e4e=_0x55eb50[_0xeb7a('0x60')][_0x2c1670];var _0x3e4c00='i';var _0x34898f=_[_0xeb7a('0x61')](_0x3324e4,[_0xeb7a('0x31'),_0x1b5e4e[_0xeb7a('0x4a')]]);if(!_0x34898f){switch(_0x1b5e4e[_0xeb7a('0x4a')]){case _0xeb7a('0x62'):if(_0x1b5e4e[_0xeb7a('0x63')]==0x1){_0x248f29[_0xeb7a('0x64')]('`'+_0x1b5e4e[_0xeb7a('0x4a')]+_0xeb7a('0x65'));}else{_0x248f29['having']('`'+_0x1b5e4e[_0xeb7a('0x4a')]+'`\x20>\x200');}break;case _0xeb7a('0x66'):if(_0x1b5e4e['operator']===_0xeb7a('0x67')){if(_0x1b5e4e[_0xeb7a('0x63')][_0xeb7a('0x38')]('\x20')[_0xeb7a('0x46')]>0x1){_0x36b645[_0x160f6c](_0xeb7a('0x68'),qs[_0xeb7a('0x69')](_0x1b5e4e['value']),null);}else{var _0x31e96f='%'+_0x1b5e4e[_0xeb7a('0x63')]+'%';_0x36b645[_0x160f6c](_0xeb7a('0x6a'),_0x31e96f,_0x31e96f,_0x31e96f);}}else{_0x34898f=_[_0xeb7a('0x61')](_0x3324e4,['name',_0xeb7a('0x6b')]);_0x1b5e4e[_0xeb7a('0x4a')]=_0xeb7a('0x6b');_0x3aa4f2=as[_0xeb7a('0x6c')](_0x3e4c00,_0x34898f[_0xeb7a('0x3e')],_0x1b5e4e);_0x36b645[_0x160f6c](_0x3aa4f2[_0xeb7a('0x6d')],_0x3aa4f2[_0xeb7a('0x63')][_0xeb7a('0x6e')],_0x3aa4f2[_0xeb7a('0x63')][_0xeb7a('0x2d')]);}break;case _0xeb7a('0x6f'):var _0x32b162=_0x1b5e4e[_0xeb7a('0x63')]['split'](',')[_0xeb7a('0x34')](function(_0x1633ef){return Number(_0x1633ef);});_0x32b162[_0xeb7a('0x39')](function(_0x440502){_0x2af84b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x440502+',%');});_0x2876bb=_[_0xeb7a('0x70')](_0x2876bb,_0x32b162);break;case _0xeb7a('0x71'):if(_0x1b5e4e[_0xeb7a('0x72')]===_0xeb7a('0x67')){_0x36b645[_0x160f6c](_0xeb7a('0x73'),'%'+_0x1b5e4e[_0xeb7a('0x63')]+'%',null);}else{_0x34898f=_[_0xeb7a('0x61')](_0x3324e4,[_0xeb7a('0x31'),'UserId']);_0x1b5e4e[_0xeb7a('0x4a')]=_0xeb7a('0x74');_0x3aa4f2=as[_0xeb7a('0x6c')](_0x3e4c00,_0x34898f[_0xeb7a('0x3e')],_0x1b5e4e);_0x36b645[_0x160f6c](_0x3aa4f2['text'],_0x3aa4f2[_0xeb7a('0x63')][_0xeb7a('0x6e')],_0x3aa4f2[_0xeb7a('0x63')][_0xeb7a('0x2d')]);}break;case'body':_0x3aa4f2=as[_0xeb7a('0x6c')]('me',null,_0x1b5e4e);_0x36b645[_0x160f6c](_0x3aa4f2['text'],_0x3aa4f2['value'][_0xeb7a('0x6e')],_0x3aa4f2[_0xeb7a('0x63')][_0xeb7a('0x2d')]);break;}}else{var _0x3aa4f2=as[_0xeb7a('0x6c')](_0x3e4c00,_0x34898f[_0xeb7a('0x3e')],_0x1b5e4e);_0x36b645[_0x160f6c](_0x3aa4f2[_0xeb7a('0x6d')],_0x3aa4f2[_0xeb7a('0x63')][_0xeb7a('0x6e')],_0x3aa4f2[_0xeb7a('0x63')][_0xeb7a('0x2d')]);}}}else{var _0x2adcb9=_(_0x7b5806['query'])[_0xeb7a('0x75')]()[_0xeb7a('0x34')](function(_0x480bff){return _[_0xeb7a('0x76')](_0x3324e4,['name',_0x480bff])?_0x480bff:undefined;})['compact']()[_0xeb7a('0x63')]();if(!_[_0xeb7a('0x77')](_0x2adcb9)){_0x2adcb9[_0xeb7a('0x39')](function(_0x10a624){if(_0x10a624===_0xeb7a('0x78')){_0x248f29['where']('i.SmsAccountId\x20IN\x20?',[][_0xeb7a('0x79')](_0x7b5806[_0xeb7a('0x41')][_0x10a624]));}else if(_0x10a624===_0xeb7a('0x7a')){var _0x3e7618=JSON[_0xeb7a('0x7b')](_0x7b5806[_0xeb7a('0x41')][_0x10a624])['$gte'];var _0x5a30a4=JSON[_0xeb7a('0x7b')](_0x7b5806[_0xeb7a('0x41')][_0x10a624])[_0xeb7a('0x7c')];_0x248f29[_0xeb7a('0x7d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3e7618,_0x5a30a4);}else{if(_0x7b5806[_0xeb7a('0x41')][_0x10a624]===_0xeb7a('0x7e')){_0x248f29['where']('i.'+_0x10a624+'\x20IS\x20NULL');}else{_0x248f29['where']('i.'+_0x10a624+'\x20=\x20?',_0x7b5806[_0xeb7a('0x41')][_0x10a624]);}}});}if(_0x7b5806[_0xeb7a('0x41')]['read']){if(_0x7b5806[_0xeb7a('0x41')][_0xeb7a('0x7f')]==0x1){_0x248f29[_0xeb7a('0x64')](_0xeb7a('0x80'));}else{_0x248f29[_0xeb7a('0x64')](_0xeb7a('0x81'));}}if(_0x7b5806[_0xeb7a('0x41')][_0xeb7a('0x82')]){_0x2876bb=_[_0xeb7a('0x83')](_0x7b5806['query'][_0xeb7a('0x82')])?_0x7b5806[_0xeb7a('0x41')]['tag']:new Array(_0x7b5806[_0xeb7a('0x41')][_0xeb7a('0x82')]);_0x2876bb[_0xeb7a('0x39')](function(_0x2fe024){_0x2af84b['or'](_0xeb7a('0x84'),'%,'+_0x2fe024+',%');});}if(_0x7b5806['query'][_0xeb7a('0x85')]){var _0x6a72d0=_0x7b5806['query'][_0xeb7a('0x85')][_0xeb7a('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xeb7a('0x87')](_0x6a72d0)){_0x36b645['or']('i.id\x20LIKE\x20?',_0x6a72d0+'%')['or'](_0xeb7a('0x88'),_0x6a72d0+'%');}else{_0x36b645['or'](_0xeb7a('0x89'),qs[_0xeb7a('0x69')](_0x6a72d0))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x6a72d0+'%');}}}_0x248f29[_0xeb7a('0x7d')](_0x36b645);_0x248f29[_0xeb7a('0x8a')](_0xeb7a('0x8b'));var _0x487e8d={'type':db['Sequelize'][_0xeb7a('0x8c')]['SELECT'],'raw':!![]};var _0x1997bc=_0x248f29['clone']();_0x1997bc[_0xeb7a('0x4a')](_0xeb7a('0x8b'));_0x1997bc[_0xeb7a('0x4a')](_0xeb7a('0x8d'),_0xeb7a('0x62'));if(_0x348be5[_0xeb7a('0x8e')]){_0x348be5['order']['forEach'](function(_0x3e6247){var _0x21c538=_0x3e6247[0x0]==='contactName'?_0x3e6247[0x0]:'i.'+_0x3e6247[0x0];_0x248f29[_0xeb7a('0x8e')](_0x21c538,_0x3e6247[0x1]==='DESC'?![]:!![]);});}if(!_[_0xeb7a('0x77')](_0x2876bb)){_0x248f29[_0xeb7a('0x64')](_0x2af84b);_0x1997bc[_0xeb7a('0x7d')](_0xeb7a('0x8f'),_0x2876bb);}BPromise[_0xeb7a('0x90')]()[_0xeb7a('0x2b')](function(){if(!_0x55eb50){if(_0x7b5806[_0xeb7a('0x41')]['SmsAccountId'])return;_0x1997bc[_0xeb7a('0x7d')](_0xeb7a('0x91'));_0x248f29['where'](_0xeb7a('0x91'));return;}if(_0x7b5806[_0xeb7a('0x92')][_0xeb7a('0x93')]!==_0xeb7a('0x94'))return;return _0x7b5806[_0xeb7a('0x92')][_0xeb7a('0x95')]({'attributes':['id'],'raw':!![]})[_0xeb7a('0x2b')](function(_0x3ea1f5){if(_['isEmpty'](_0x3ea1f5)){_0x1997bc[_0xeb7a('0x7d')](_0xeb7a('0x96'));_0x248f29[_0xeb7a('0x7d')](_0xeb7a('0x96'));}else{_0x1997bc[_0xeb7a('0x7d')](_0xeb7a('0x97'),_['map'](_0x3ea1f5,'id'));_0x248f29['where'](_0xeb7a('0x97'),_[_0xeb7a('0x34')](_0x3ea1f5,'id'));}});})['then'](function(){if(_0x7b5806[_0xeb7a('0x92')][_0xeb7a('0x93')]===_0xeb7a('0x94')&&!_0x55eb50&&!_0x7b5806[_0xeb7a('0x41')][_0xeb7a('0x78')])return[];return db[_0xeb7a('0x98')][_0xeb7a('0x41')](_0x1997bc['toString'](),_0x487e8d);})[_0xeb7a('0x2b')](function(_0x404d8f){_0x2aaf7f['count']=_0x404d8f[_0xeb7a('0x46')];if(_0x2aaf7f[_0xeb7a('0x26')]===0x0)return[];return db[_0xeb7a('0x98')][_0xeb7a('0x41')](_0x28621a[_0xeb7a('0x99')](),_0x487e8d)[_0xeb7a('0x2b')](function(_0x34a7d6){_0x34177c=_[_0xeb7a('0x9a')](_0x34a7d6,'id');_0x487e8d=_[_0xeb7a('0x9b')](_0x487e8d,{'model':db[_0xeb7a('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x7b5806[_0xeb7a('0x41')]['fields']){_0x348be5[_0xeb7a('0x44')]['forEach'](function(_0x28299b){_0x248f29[_0xeb7a('0x4a')]('i.'+_0x28299b);});}else{_0x248f29['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xeb7a('0x62'));_0x248f29['field'](_0xeb7a('0x9c'),_0xeb7a('0x9d'));_0x248f29[_0xeb7a('0x4a')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x248f29[_0xeb7a('0x4a')](_0xeb7a('0x9e'),_0xeb7a('0x9f'));_0x248f29[_0xeb7a('0x4a')](_0xeb7a('0xa0'));_0x248f29[_0xeb7a('0x4a')]('c.firstName',_0xeb7a('0xa1'));_0x248f29['field'](_0xeb7a('0xa2'),_0xeb7a('0xa3'));_0x248f29[_0xeb7a('0x4a')](_0xeb7a('0xa4'),'Contact.email');_0x248f29['field'](_0xeb7a('0xa5'),'Contact.phone');_0x248f29['field']('c.mobile',_0xeb7a('0xa6'));_0x248f29['field']('c.fax','Contact.fax');_0x248f29['field']('o.fullname',_0xeb7a('0xa7'));_0x248f29[_0xeb7a('0x4a')](_0xeb7a('0xa8'),_0xeb7a('0xa9'));_0x248f29['field'](_0xeb7a('0xaa'),_0xeb7a('0x37'));}if(_0x348be5[_0xeb7a('0x24')])_0x248f29[_0xeb7a('0x24')](_0x348be5[_0xeb7a('0x24')]);if(_0x348be5[_0xeb7a('0x27')])_0x248f29[_0xeb7a('0x27')](_0x348be5[_0xeb7a('0x27')]);return db[_0xeb7a('0x98')][_0xeb7a('0x41')](_0x248f29[_0xeb7a('0x99')](),_0x487e8d);})[_0xeb7a('0x2b')](function(_0x3fa850){if(_0x3fa850[_0xeb7a('0x46')]>0x0)_0x4d0302['where'](_0xeb7a('0xab'),_['map'](_0x3fa850,'id'));return db[_0xeb7a('0x98')]['query'](_0x4d0302[_0xeb7a('0x99')](),_0x487e8d)[_0xeb7a('0x2b')](function(_0x4248b5){var _0x46887c=_[_0xeb7a('0xac')](_0x4248b5,_0xeb7a('0xad'));var _0x55f352=[];_0x3fa850[_0xeb7a('0x39')](function(_0x1dff0d){_0x55f352[_0xeb7a('0xae')](updateSmsInteraction(_0x1dff0d,_0x34177c,_0x46887c));});return BPromise[_0xeb7a('0xaf')](_0x55f352);});});})[_0xeb7a('0x2b')](function(_0x1ea217){_0x2aaf7f['rows']=_0x1ea217;return _0x2aaf7f;})[_0xeb7a('0x2b')](respondWithFilteredResult(_0x226a7e,_0x348be5))[_0xeb7a('0xb0')](handleError(_0x226a7e,null));};exports['show']=function(_0x1b22d6,_0x15c0a1){var _0x19b7f4={'raw':![],'where':{'id':_0x1b22d6[_0xeb7a('0xb1')]['id']}},_0x5736bc={};_0x5736bc['model']=_[_0xeb7a('0x75')](db['SmsInteraction'][_0xeb7a('0x3c')]);_0x5736bc[_0xeb7a('0x41')]=_['keys'](_0x1b22d6[_0xeb7a('0x41')]);_0x5736bc[_0xeb7a('0x42')]=_[_0xeb7a('0x43')](_0x5736bc[_0xeb7a('0x40')],_0x5736bc[_0xeb7a('0x41')]);_0x19b7f4[_0xeb7a('0x44')]=_['intersection'](_0x5736bc[_0xeb7a('0x40')],qs['fields'](_0x1b22d6[_0xeb7a('0x41')][_0xeb7a('0x45')]));_0x19b7f4['attributes']=_0x19b7f4[_0xeb7a('0x44')][_0xeb7a('0x46')]?_0x19b7f4[_0xeb7a('0x44')]:_0x5736bc['model'];if(_0x1b22d6[_0xeb7a('0x41')][_0xeb7a('0xb2')]){_0x19b7f4['include']=[{'all':!![]}];}_0x19b7f4=_[_0xeb7a('0x9b')]({},_0x19b7f4,_0x1b22d6[_0xeb7a('0xb3')]);return db[_0xeb7a('0x3b')][_0xeb7a('0x61')](_0x19b7f4)[_0xeb7a('0x2b')](handleEntityNotFound(_0x15c0a1,null))[_0xeb7a('0x2b')](respondWithResult(_0x15c0a1,null))[_0xeb7a('0xb0')](handleError(_0x15c0a1,null));};exports[_0xeb7a('0xb4')]=function(_0x452f33,_0x201a5e){return db['SmsInteraction'][_0xeb7a('0xb4')](_0x452f33['body'],{})[_0xeb7a('0x2b')](respondWithResult(_0x201a5e,0xc9))[_0xeb7a('0xb0')](handleError(_0x201a5e,null));};exports['update']=function(_0x443834,_0x2d819e){if(_0x443834['body']['id']){delete _0x443834['body']['id'];}return db[_0xeb7a('0x3b')]['find']({'where':{'id':_0x443834[_0xeb7a('0xb1')]['id']}})[_0xeb7a('0x2b')](handleEntityNotFound(_0x2d819e,null))[_0xeb7a('0x2b')](saveUpdates(_0x443834[_0xeb7a('0xb5')],null))[_0xeb7a('0x2b')](respondWithResult(_0x2d819e,null))[_0xeb7a('0xb0')](handleError(_0x2d819e,null));};exports['destroy']=function(_0xd56344,_0x3815eb){return db[_0xeb7a('0x3b')][_0xeb7a('0x61')]({'where':{'id':_0xd56344[_0xeb7a('0xb1')]['id']}})[_0xeb7a('0x2b')](handleEntityNotFound(_0x3815eb,null))[_0xeb7a('0x2b')](removeEntity(_0x3815eb,null))['catch'](handleError(_0x3815eb,null));};exports[_0xeb7a('0xb6')]=function(_0x38c20d,_0x156151){return db['SmsInteraction']['describe']()['then'](respondWithResult(_0x156151,null))[_0xeb7a('0xb0')](handleError(_0x156151,null));};exports['addMessage']=function(_0x21c8e5,_0x285c61,_0x3947f0){return db[_0xeb7a('0xb7')]['find']({'where':{'id':_0x21c8e5[_0xeb7a('0xb1')]['id']}})[_0xeb7a('0x2b')](handleEntityNotFound(_0x285c61,null))[_0xeb7a('0x2b')](function(_0x5390f6){if(_0x5390f6){return _0x5390f6[_0xeb7a('0xb8')](_0x21c8e5[_0xeb7a('0xb5')][_0xeb7a('0xb9')],_['omit'](_0x21c8e5['body'],[_0xeb7a('0xb9'),'id'])||{});}})['then'](respondWithResult(_0x285c61,null))[_0xeb7a('0xb0')](handleError(_0x285c61,null));};exports[_0xeb7a('0xba')]=function(_0x914cfe,_0x31d56a,_0x5e8ec0){var _0x2fae16={'raw':![],'where':{}};var _0x27f1dc={};var _0x4c8b3a={'count':0x0,'rows':[]};return db[_0xeb7a('0x3b')][_0xeb7a('0xbb')]({'where':{'id':_0x914cfe['params']['id']}})[_0xeb7a('0x2b')](handleEntityNotFound(_0x31d56a,null))[_0xeb7a('0x2b')](function(_0x5f3690){if(_0x5f3690){_0x27f1dc[_0xeb7a('0x40')]=_['keys'](db[_0xeb7a('0xb7')]['rawAttributes']);_0x27f1dc[_0xeb7a('0x41')]=_['keys'](_0x914cfe[_0xeb7a('0x41')]);_0x27f1dc[_0xeb7a('0x42')]=_['intersection'](_0x27f1dc['model'],_0x27f1dc['query']);_0x2fae16[_0xeb7a('0x44')]=_[_0xeb7a('0x43')](_0x27f1dc[_0xeb7a('0x40')],qs['fields'](_0x914cfe['query']['fields']));_0x2fae16[_0xeb7a('0x44')]=_0x2fae16['attributes']['length']?_0x2fae16['attributes']:_0x27f1dc['model'];if(!_0x914cfe[_0xeb7a('0x41')]['hasOwnProperty'](_0xeb7a('0x47'))){_0x2fae16[_0xeb7a('0x24')]=qs[_0xeb7a('0x24')](_0x914cfe[_0xeb7a('0x41')][_0xeb7a('0x24')]);_0x2fae16['offset']=qs[_0xeb7a('0x27')](_0x914cfe['query'][_0xeb7a('0x27')]);}_0x2fae16[_0xeb7a('0x8e')]=qs[_0xeb7a('0x48')](_0x914cfe[_0xeb7a('0x41')][_0xeb7a('0x48')]);_0x2fae16['where']=qs[_0xeb7a('0x42')](_[_0xeb7a('0x49')](_0x914cfe[_0xeb7a('0x41')],_0x27f1dc['filters']));_0x2fae16[_0xeb7a('0x7d')][_0xeb7a('0xad')]=_0x5f3690['id'];if(_0x914cfe['query'][_0xeb7a('0x85')]){_0x2fae16[_0xeb7a('0x7d')]=_[_0xeb7a('0x9b')](_0x2fae16[_0xeb7a('0x7d')],{'$or':_[_0xeb7a('0x34')](_0x2fae16[_0xeb7a('0x44')],function(_0x2de674){var _0x8931e4={};_0x8931e4[_0x2de674]={'$like':'%'+_0x914cfe[_0xeb7a('0x41')][_0xeb7a('0x85')]+'%'};return _0x8931e4;})});}if(_0x914cfe[_0xeb7a('0x41')]['$gte']){var _0x2390c5=_0x914cfe['query'][_0xeb7a('0xbc')][_0xeb7a('0x38')](',');var _0xd440be={};_0xd440be[_0x2390c5[0x0]]={'$gte':moment(_0x2390c5[0x1])[_0xeb7a('0xbd')](_0xeb7a('0xbe'))};_0x2fae16[_0xeb7a('0x7d')]=_[_0xeb7a('0x9b')](_0x2fae16['where'],_0xd440be);}_0x2fae16=_[_0xeb7a('0x9b')]({},_0x2fae16,_0x914cfe[_0xeb7a('0xb3')]);return db[_0xeb7a('0xb7')]['count']({'where':_0x2fae16['where']})[_0xeb7a('0x2b')](function(_0x3a82bc){_0x4c8b3a[_0xeb7a('0x26')]=_0x3a82bc;if(_0x914cfe[_0xeb7a('0x41')][_0xeb7a('0xb2')]){_0x2fae16[_0xeb7a('0xbf')]=[{'all':!![]}];}return db[_0xeb7a('0xb7')][_0xeb7a('0xc0')](_0x2fae16);})[_0xeb7a('0x2b')](function(_0x5b7c24){_0x4c8b3a[_0xeb7a('0xc1')]=_0x5b7c24;return _0x4c8b3a;});}})['then'](respondWithFilteredResult(_0x31d56a,_0x2fae16))[_0xeb7a('0xb0')](handleError(_0x31d56a,null));};exports[_0xeb7a('0xc2')]=function(_0x2a436a,_0x281502,_0x4c8f00){return db[_0xeb7a('0x3b')][_0xeb7a('0x61')]({'where':{'id':_0x2a436a['params']['id']}})[_0xeb7a('0x2b')](handleEntityNotFound(_0x281502,null))[_0xeb7a('0x2b')](function(_0x4993c5){if(_0x4993c5){return _0x4993c5['setTags'](_0x2a436a[_0xeb7a('0xb5')][_0xeb7a('0xb9')],_[_0xeb7a('0xc3')](_0x2a436a[_0xeb7a('0xb5')],['ids','id'])||{})[_0xeb7a('0xc4')](function(){return db[_0xeb7a('0x6f')][_0xeb7a('0xc0')]({'attributes':['id',_0xeb7a('0x31'),_0xeb7a('0x4b')],'where':{'id':_0x2a436a[_0xeb7a('0xb5')]['ids']}});})[_0xeb7a('0x2b')](function(_0x251aaf){socket[_0xeb7a('0xc5')](_0xeb7a('0xc6'),{'id':Number(_0x2a436a[_0xeb7a('0xb1')]['id']),'tags':_0x251aaf||[]});return{'id':Number(_0x2a436a[_0xeb7a('0xb1')]['id']),'tags':_0x251aaf||[]};});}})[_0xeb7a('0x2b')](respondWithResult(_0x281502,null))[_0xeb7a('0xb0')](handleError(_0x281502,null));};exports['removeTags']=function(_0x2f6ba9,_0x121461,_0x3c166a){return db[_0xeb7a('0x3b')][_0xeb7a('0x61')]({'where':{'id':_0x2f6ba9['params']['id']}})[_0xeb7a('0x2b')](handleEntityNotFound(_0x121461,null))['then'](function(_0xc45b79){if(_0xc45b79){return _0xc45b79[_0xeb7a('0xc7')](_0x2f6ba9[_0xeb7a('0x41')][_0xeb7a('0xb9')]);}})[_0xeb7a('0x2b')](respondWithStatusCode(_0x121461,null))[_0xeb7a('0xb0')](handleError(_0x121461,null));};exports['download']=function(_0x3ee99f,_0x3545e5){var _0x27a258=moment()[_0xeb7a('0xc8')]()[_0xeb7a('0x99')]();var _0x46ad6e=path[_0xeb7a('0xc9')](config[_0xeb7a('0xca')],_0xeb7a('0xcb'),_0xeb7a('0xcc'),'tmp');var _0x2bb626=path[_0xeb7a('0xc9')](config[_0xeb7a('0xca')],_0xeb7a('0xcb'),_0xeb7a('0xcc'),_0xeb7a('0xcd'));var _0x2c29a5=path[_0xeb7a('0xc9')](_0x46ad6e,_0x27a258);var _0x9efc73=util[_0xeb7a('0xbd')](_0xeb7a('0xce'),_0x3ee99f[_0xeb7a('0xb1')]['id'],_0x27a258);var _0x437b4c=path['join'](_0x46ad6e,_0x9efc73);var _0x3b17d4=[];_0x3b17d4[_0xeb7a('0xae')]({'model':db['User'],'as':_0xeb7a('0x71'),'attributes':['id','fullname'],'raw':!![]});_0x3b17d4['push']({'model':db[_0xeb7a('0xcf')],'as':'Contact','attributes':['id',_0xeb7a('0xd0'),_0xeb7a('0xd1')],'raw':!![]});var _0x1670df=[{'model':db['SmsMessage'],'as':_0xeb7a('0xd2'),'attributes':['id',_0xeb7a('0xb5'),_0xeb7a('0x7a'),_0xeb7a('0xd3'),_0xeb7a('0xd4'),_0xeb7a('0x7f')],'include':_0x3b17d4}];_0x1670df[_0xeb7a('0xae')]({'model':db['SmsAccount'],'as':_0xeb7a('0xd5'),'attributes':['id',_0xeb7a('0x31')]});_0x1670df[_0xeb7a('0xae')]({'model':db[_0xeb7a('0x71')],'as':_0xeb7a('0xd6'),'attributes':['id','fullname']});return db[_0xeb7a('0x3b')][_0xeb7a('0x61')]({'where':{'id':_0x3ee99f['params']['id']},'include':_0x1670df})[_0xeb7a('0x2b')](handleEntityNotFound(_0x3545e5,null))[_0xeb7a('0x2b')](function(_0x32f8a2){if(_0x32f8a2){var _0x1bfd1e=_0x32f8a2['get']({'plain':!![]});fs['mkdirSync'](_0x2c29a5);var _0x560293={'channel':'Sms','account':_0x1bfd1e[_0xeb7a('0xd5')][_0xeb7a('0x31')],'agent':_0x1bfd1e[_0xeb7a('0xd6')]?_0x1bfd1e[_0xeb7a('0xd6')][_0xeb7a('0x35')]:_0xeb7a('0xd7'),'createdAt':moment(_0x1bfd1e[_0xeb7a('0x7a')])[_0xeb7a('0xbd')](_0xeb7a('0xbe'))[_0xeb7a('0x99')](),'closedAt':_0x1bfd1e['closed']?moment(_0x1bfd1e[_0xeb7a('0xd8')])[_0xeb7a('0xbd')](_0xeb7a('0xbe'))[_0xeb7a('0x99')]():'','disposition':_0x1bfd1e['disposition'],'messages':_(_0x1bfd1e[_0xeb7a('0xd2')])[_0xeb7a('0x85')]({'secret':![]})[_0xeb7a('0x34')](function(_0x6c1642){return{'date':moment(_0x6c1642[_0xeb7a('0x7a')])[_0xeb7a('0xbd')](_0xeb7a('0xbe'))[_0xeb7a('0x99')](),'sender':_0x6c1642[_0xeb7a('0xd3')]===_0xeb7a('0xd9')?_0x6c1642[_0xeb7a('0x71')]?_0x6c1642[_0xeb7a('0x71')]['fullname']:_0xeb7a('0xda'):_0x6c1642['Contact'][_0xeb7a('0xd0')]+(_0x6c1642[_0xeb7a('0x66')][_0xeb7a('0xd1')]?'\x20'+_0x6c1642['Contact']['lastName']:''),'body':_0x6c1642[_0xeb7a('0xb5')],'direction':_0x6c1642[_0xeb7a('0xd3')]===_0xeb7a('0xd9')?'A':'C','secret':_0x6c1642[_0xeb7a('0xd4')],'read':_0x6c1642[_0xeb7a('0x7f')]};})[_0xeb7a('0x63')]()};return ejs[_0xeb7a('0xdb')](path[_0xeb7a('0xc9')](config[_0xeb7a('0xca')],'server',_0xeb7a('0xdc'),_0xeb7a('0xdd')),{'interaction':_0x560293})[_0xeb7a('0x2b')](function(_0x5e5bde){var _0x5d4a9c=path[_0xeb7a('0xc9')](_0x2c29a5,_0xeb7a('0xde')+_0x1bfd1e['id']+'-'+_0x27a258+_0xeb7a('0xdf'));var _0x2eefec={'path':_0x5d4a9c,'channel':_0xeb7a('0xe0'),'interactionId':_0x1bfd1e['id']};return pdf[_0xeb7a('0xe1')](_0x5e5bde,_0x2eefec);})[_0xeb7a('0x2b')](function(){return new BPromise(function(_0x7f3eec,_0x3c7083){zipdir(_0x2c29a5,{'saveTo':_0x437b4c},function(_0x5d1c24,_0x1060c7){if(_0x5d1c24)return _0x3c7083(_0x5d1c24);return _0x7f3eec(_0x1060c7);});})['then'](function(){return new BPromise(function(_0x3b9fc4,_0x45d9c1){rimraf(_0x2c29a5,function(_0x57ad5d){if(_0x57ad5d)_0x45d9c1(_0x57ad5d);return _0x3b9fc4();});});})[_0xeb7a('0x2b')](function(){return _0x3545e5['download'](_0x437b4c,_0x9efc73,function(_0x306ba6){if(_0x306ba6){console[_0xeb7a('0xe2')]('err',_0x306ba6);}else{fs[_0xeb7a('0xe3')](_0x437b4c);}});});});}else{return _0x3545e5[_0xeb7a('0x2e')](0xc8);}})[_0xeb7a('0xb0')](handleError(_0x3545e5,null));}; \ No newline at end of file +var _0x0eeb=['limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','send','Users','map','TagIds','Tags','forEach','push','catch','SmsInteraction','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','then','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','role','toString','keyBy','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','rows','show','params','fields','includeAll','merge','options','create','describe','addMessage','SmsMessage','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','omit','spread','emit','smsInteractionTags:save','removeTags','download','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','User','fullname','Contact','firstName','Messages','createdAt','direction','secret','SmsAccount','Owner','get','mkdirSync','N.A.','closed','closedAt','disposition','out','System','lastName','renderFile','views','downloadInteraction.html','transcript-','Sms','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./smsInteraction.socket','sendStatus','status','end','json','undefined'];(function(_0x245ba1,_0x5b1fd3){var _0x4840f1=function(_0x4de2ad){while(--_0x4de2ad){_0x245ba1['push'](_0x245ba1['shift']());}};_0x4840f1(++_0x5b1fd3);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0eeb[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xb0ee('0x0'));var rimraf=require(_0xb0ee('0x1'));var zipdir=require(_0xb0ee('0x2'));var jsonpatch=require(_0xb0ee('0x3'));var rp=require(_0xb0ee('0x4'));var moment=require(_0xb0ee('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb0ee('0x6'));var path=require(_0xb0ee('0x7'));var sox=require(_0xb0ee('0x8'));var csv=require(_0xb0ee('0x9'));var ejs=require(_0xb0ee('0xa'));var fs=require('fs');var fs_extra=require(_0xb0ee('0xb'));var _=require(_0xb0ee('0xc'));var squel=require('squel');var crypto=require(_0xb0ee('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb0ee('0xe'));var toCsv=require(_0xb0ee('0x9'));var querystring=require(_0xb0ee('0xf'));var Papa=require(_0xb0ee('0x10'));var Redis=require(_0xb0ee('0x11'));var authService=require(_0xb0ee('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xb0ee('0x13'));var hardwareService=require(_0xb0ee('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb0ee('0x15'));var config=require(_0xb0ee('0x16'));var licenseUtil=require(_0xb0ee('0x17'));var db=require(_0xb0ee('0x18'))['db'];config['redis']=_[_0xb0ee('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb0ee('0x1a')]));require(_0xb0ee('0x1b'))['register'](socket);function respondWithStatusCode(_0x3f206f,_0x5fb11b){_0x5fb11b=_0x5fb11b||0xcc;return function(_0x347c18){if(_0x347c18){return _0x3f206f[_0xb0ee('0x1c')](_0x5fb11b);}return _0x3f206f[_0xb0ee('0x1d')](_0x5fb11b)[_0xb0ee('0x1e')]();};}function respondWithResult(_0xca0c6f,_0x265a86){_0x265a86=_0x265a86||0xc8;return function(_0x549e64){if(_0x549e64){return _0xca0c6f['status'](_0x265a86)[_0xb0ee('0x1f')](_0x549e64);}};}function respondWithFilteredResult(_0x5702d8,_0x1a2018){return function(_0x35ec11){if(_0x35ec11){var _0x480e51=typeof _0x1a2018['offset']===_0xb0ee('0x20')&&typeof _0x1a2018[_0xb0ee('0x21')]===_0xb0ee('0x20');var _0x4ce528=_0x35ec11[_0xb0ee('0x22')];var _0x3b4c19=_0x480e51?0x0:_0x1a2018[_0xb0ee('0x23')];var _0x723146=_0x480e51?_0x35ec11['count']:_0x1a2018[_0xb0ee('0x23')]+_0x1a2018[_0xb0ee('0x21')];var _0x26a3ee;if(_0x723146>=_0x4ce528){_0x723146=_0x4ce528;_0x26a3ee=0xc8;}else{_0x26a3ee=0xce;}_0x5702d8[_0xb0ee('0x1d')](_0x26a3ee);return _0x5702d8[_0xb0ee('0x24')](_0xb0ee('0x25'),_0x3b4c19+'-'+_0x723146+'/'+_0x4ce528)[_0xb0ee('0x1f')](_0x35ec11);}return null;};}function patchUpdates(_0x2b19f2){return function(_0x3acb4f){try{jsonpatch[_0xb0ee('0x26')](_0x3acb4f,_0x2b19f2,!![]);}catch(_0x9f1455){return BPromise[_0xb0ee('0x27')](_0x9f1455);}return _0x3acb4f[_0xb0ee('0x28')]();};}function saveUpdates(_0x2a0c1b,_0x9197cb){return function(_0x5a1197){if(_0x5a1197){return _0x5a1197[_0xb0ee('0x29')](_0x2a0c1b)['then'](function(_0x53bccd){return _0x53bccd;});}return null;};}function removeEntity(_0x3442b7,_0x18b1d7){return function(_0x18935b){if(_0x18935b){return _0x18935b[_0xb0ee('0x2a')]()['then'](function(){_0x3442b7[_0xb0ee('0x1d')](0xcc)[_0xb0ee('0x1e')]();});}};}function handleEntityNotFound(_0x1e5e62,_0xd556e6){return function(_0x4b5308){if(!_0x4b5308){_0x1e5e62['sendStatus'](0x194);}return _0x4b5308;};}function handleError(_0x9fbe95,_0x40e38d){_0x40e38d=_0x40e38d||0x1f4;return function(_0x224c3b){logger[_0xb0ee('0x2b')](_0x224c3b[_0xb0ee('0x2c')]);if(_0x224c3b['name']){delete _0x224c3b['name'];}_0x9fbe95[_0xb0ee('0x1d')](_0x40e38d)[_0xb0ee('0x2d')](_0x224c3b);};}function getInteractionUsers(_0x1a32dc,_0x88ec6){return new BPromise(function(_0x1f0db8,_0x34bb9d){try{if(_0x88ec6[_0x1a32dc['id']]){_0x1a32dc[_0xb0ee('0x2e')]=_[_0xb0ee('0x2f')](_0x88ec6[_0x1a32dc['id']],function(_0x21d3ae){return{'id':_0x21d3ae['id'],'fullname':_0x21d3ae['fullname']};});}}catch(_0x698d9f){_0x34bb9d(_0x698d9f);}_0x1f0db8(_0x1a32dc);});}function getInteractionTags(_0x450f5b,_0x1a4b5e){return new BPromise(function(_0x5aa0d4,_0x43c9aa){try{if(_0x450f5b[_0xb0ee('0x30')]){_0x450f5b[_0xb0ee('0x31')]=[];_0x450f5b[_0xb0ee('0x30')]['split'](',')[_0xb0ee('0x32')](function(_0x49d019){_0x450f5b[_0xb0ee('0x31')][_0xb0ee('0x33')](_0x1a4b5e[_0x49d019]);});}delete _0x450f5b[_0xb0ee('0x30')];}catch(_0x59de20){_0x43c9aa(_0x59de20);}_0x5aa0d4(_0x450f5b);});}function updateSmsInteraction(_0x49e5a6,_0x4bb33e,_0x4b2a0c){return new BPromise(function(_0x17ba9c,_0xe0daaa){return getInteractionUsers(_0x49e5a6,_0x4b2a0c)['then'](function(_0xe4b1cc){return getInteractionTags(_0xe4b1cc,_0x4bb33e);})['then'](function(_0x57d80a){_0x17ba9c(_0x57d80a);})[_0xb0ee('0x34')](function(_0x4bbf6d){_0xe0daaa(_0x4bbf6d);});});}exports['index']=function(_0x5402ca,_0x3b21b7){var _0x3ee12c={},_0x4dd04b={},_0x354bdc={'count':0x0,'rows':[]};var _0x1ab2d0=_[_0xb0ee('0x2f')](db[_0xb0ee('0x35')][_0xb0ee('0x36')],function(_0x12be86){return{'name':_0x12be86[_0xb0ee('0x37')],'type':_0x12be86[_0xb0ee('0x38')][_0xb0ee('0x39')]};});_0x4dd04b[_0xb0ee('0x3a')]=_[_0xb0ee('0x2f')](_0x1ab2d0,_0xb0ee('0x3b'));_0x4dd04b[_0xb0ee('0x3c')]=_[_0xb0ee('0x3d')](_0x5402ca[_0xb0ee('0x3c')]);_0x4dd04b[_0xb0ee('0x3e')]=_[_0xb0ee('0x3f')](_0x4dd04b[_0xb0ee('0x3a')],_0x4dd04b[_0xb0ee('0x3c')]);_0x3ee12c[_0xb0ee('0x40')]=_[_0xb0ee('0x3f')](_0x4dd04b['model'],qs['fields'](_0x5402ca[_0xb0ee('0x3c')]['fields']));_0x3ee12c[_0xb0ee('0x40')]=_0x3ee12c[_0xb0ee('0x40')][_0xb0ee('0x41')]?_0x3ee12c[_0xb0ee('0x40')]:_0x4dd04b[_0xb0ee('0x3a')];if(!_0x5402ca['query'][_0xb0ee('0x42')](_0xb0ee('0x43'))){_0x3ee12c['limit']=qs[_0xb0ee('0x21')](_0x5402ca[_0xb0ee('0x3c')][_0xb0ee('0x21')]);_0x3ee12c[_0xb0ee('0x23')]=qs[_0xb0ee('0x23')](_0x5402ca[_0xb0ee('0x3c')][_0xb0ee('0x23')]);}_0x3ee12c['order']=qs[_0xb0ee('0x44')](_0x5402ca[_0xb0ee('0x3c')]['sort']);_0x3ee12c[_0xb0ee('0x45')]=qs['filters'](_[_0xb0ee('0x46')](_0x5402ca['query'],_0x4dd04b[_0xb0ee('0x3e')]),_0x1ab2d0);var _0x5328a9=[];var _0x265a29=squel[_0xb0ee('0x47')]()[_0xb0ee('0x48')]('id')[_0xb0ee('0x48')](_0xb0ee('0x3b'))[_0xb0ee('0x48')](_0xb0ee('0x49'))[_0xb0ee('0x4a')](_0xb0ee('0x4b'));var _0x203db5=squel[_0xb0ee('0x47')]()[_0xb0ee('0x48')](_0xb0ee('0x4c'))[_0xb0ee('0x48')](_0xb0ee('0x4d'))[_0xb0ee('0x48')]('ui.SmsInteractionId')['from'](_0xb0ee('0x4e'),'ui')[_0xb0ee('0x4f')]('users','u',_0xb0ee('0x50'));var _0x524e15=squel[_0xb0ee('0x47')]()[_0xb0ee('0x4a')](_0xb0ee('0x51'),'i')[_0xb0ee('0x4f')](_0xb0ee('0x52'),'c',_0xb0ee('0x53'))[_0xb0ee('0x4f')](_0xb0ee('0x54'),'o',_0xb0ee('0x55'))[_0xb0ee('0x4f')](_0xb0ee('0x56'),'a','a.id\x20=\x20i.SmsAccountId')['left_join']('sms_messages','me',_0xb0ee('0x57'))[_0xb0ee('0x4f')]('sms_interaction_has_tags','it',_0xb0ee('0x58'))[_0xb0ee('0x4f')](_0xb0ee('0x4b'),'t',_0xb0ee('0x59'));var _0x26be18=squel[_0xb0ee('0x5a')]();var _0x4a12d6=[];var _0x1d0e42=squel[_0xb0ee('0x5a')]();var _0x56620c;if(_0x5402ca[_0xb0ee('0x3c')]['search']){_0x56620c=as[_0xb0ee('0x5b')](_0x5402ca[_0xb0ee('0x3c')][_0xb0ee('0x5c')]);var _0x599412=_0x56620c['sqlOperator'];for(var _0x324110=0x0;_0x324110<_0x56620c['conditions'][_0xb0ee('0x41')];_0x324110++){var _0xfd2f60=_0x56620c[_0xb0ee('0x5d')][_0x324110];var _0x204c70='i';var _0x8e55dc=_[_0xb0ee('0x5e')](_0x1ab2d0,['name',_0xfd2f60[_0xb0ee('0x48')]]);if(!_0x8e55dc){switch(_0xfd2f60[_0xb0ee('0x48')]){case'unreadMessages':if(_0xfd2f60[_0xb0ee('0x5f')]==0x1){_0x524e15[_0xb0ee('0x60')]('`'+_0xfd2f60[_0xb0ee('0x48')]+_0xb0ee('0x61'));}else{_0x524e15[_0xb0ee('0x60')]('`'+_0xfd2f60[_0xb0ee('0x48')]+_0xb0ee('0x62'));}break;case'Contact':if(_0xfd2f60[_0xb0ee('0x63')]===_0xb0ee('0x64')){if(_0xfd2f60[_0xb0ee('0x5f')]['split']('\x20')[_0xb0ee('0x41')]>0x1){_0x26be18[_0x599412](_0xb0ee('0x65'),qs[_0xb0ee('0x66')](_0xfd2f60[_0xb0ee('0x5f')]),null);}else{var _0x4a51b6='%'+_0xfd2f60[_0xb0ee('0x5f')]+'%';_0x26be18[_0x599412](_0xb0ee('0x67'),_0x4a51b6,_0x4a51b6,_0x4a51b6);}}else{_0x8e55dc=_[_0xb0ee('0x5e')](_0x1ab2d0,['name',_0xb0ee('0x68')]);_0xfd2f60[_0xb0ee('0x48')]=_0xb0ee('0x68');_0x37dc12=as[_0xb0ee('0x69')](_0x204c70,_0x8e55dc[_0xb0ee('0x38')],_0xfd2f60);_0x26be18[_0x599412](_0x37dc12[_0xb0ee('0x6a')],_0x37dc12[_0xb0ee('0x5f')][_0xb0ee('0x6b')],_0x37dc12['value']['end']);}break;case _0xb0ee('0x6c'):var _0x40b4e4=_0xfd2f60[_0xb0ee('0x5f')][_0xb0ee('0x6d')](',')[_0xb0ee('0x2f')](function(_0x540461){return Number(_0x540461);});_0x40b4e4[_0xb0ee('0x32')](function(_0x5d1361){_0x1d0e42['or'](_0xb0ee('0x6e'),'%,'+_0x5d1361+',%');});_0x4a12d6=_['union'](_0x4a12d6,_0x40b4e4);break;case'User':if(_0xfd2f60[_0xb0ee('0x63')]===_0xb0ee('0x64')){_0x26be18[_0x599412](_0xb0ee('0x6f'),'%'+_0xfd2f60[_0xb0ee('0x5f')]+'%',null);}else{_0x8e55dc=_[_0xb0ee('0x5e')](_0x1ab2d0,[_0xb0ee('0x3b'),_0xb0ee('0x70')]);_0xfd2f60[_0xb0ee('0x48')]=_0xb0ee('0x70');_0x37dc12=as[_0xb0ee('0x69')](_0x204c70,_0x8e55dc[_0xb0ee('0x38')],_0xfd2f60);_0x26be18[_0x599412](_0x37dc12['text'],_0x37dc12['value']['start'],_0x37dc12[_0xb0ee('0x5f')]['end']);}break;case _0xb0ee('0x71'):_0x37dc12=as['buildExpression']('me',null,_0xfd2f60);_0x26be18[_0x599412](_0x37dc12['text'],_0x37dc12[_0xb0ee('0x5f')][_0xb0ee('0x6b')],_0x37dc12['value'][_0xb0ee('0x1e')]);break;}}else{var _0x37dc12=as[_0xb0ee('0x69')](_0x204c70,_0x8e55dc['type'],_0xfd2f60);_0x26be18[_0x599412](_0x37dc12[_0xb0ee('0x6a')],_0x37dc12[_0xb0ee('0x5f')][_0xb0ee('0x6b')],_0x37dc12[_0xb0ee('0x5f')][_0xb0ee('0x1e')]);}}}else{var _0x285499=_(_0x5402ca[_0xb0ee('0x3c')])['keys']()['map'](function(_0x10a542){return _[_0xb0ee('0x72')](_0x1ab2d0,[_0xb0ee('0x3b'),_0x10a542])?_0x10a542:undefined;})[_0xb0ee('0x73')]()[_0xb0ee('0x5f')]();if(!_[_0xb0ee('0x74')](_0x285499)){_0x285499['forEach'](function(_0x2ceeac){if(_0x2ceeac==='SmsAccountId'){_0x524e15[_0xb0ee('0x45')](_0xb0ee('0x75'),[][_0xb0ee('0x76')](_0x5402ca['query'][_0x2ceeac]));}else if(_0x2ceeac==='createdAt'){var _0x337aba=JSON[_0xb0ee('0x77')](_0x5402ca[_0xb0ee('0x3c')][_0x2ceeac])[_0xb0ee('0x78')];var _0x1865b7=JSON[_0xb0ee('0x77')](_0x5402ca[_0xb0ee('0x3c')][_0x2ceeac])[_0xb0ee('0x79')];_0x524e15[_0xb0ee('0x45')](_0xb0ee('0x7a'),_0x337aba,_0x1865b7);}else{if(_0x5402ca[_0xb0ee('0x3c')][_0x2ceeac]==='null'){_0x524e15[_0xb0ee('0x45')]('i.'+_0x2ceeac+'\x20IS\x20NULL');}else{_0x524e15[_0xb0ee('0x45')]('i.'+_0x2ceeac+_0xb0ee('0x7b'),_0x5402ca[_0xb0ee('0x3c')][_0x2ceeac]);}}});}if(_0x5402ca[_0xb0ee('0x3c')][_0xb0ee('0x7c')]){if(_0x5402ca[_0xb0ee('0x3c')][_0xb0ee('0x7c')]==0x1){_0x524e15['having'](_0xb0ee('0x7d'));}else{_0x524e15[_0xb0ee('0x60')](_0xb0ee('0x7e'));}}if(_0x5402ca['query'][_0xb0ee('0x7f')]){_0x4a12d6=_[_0xb0ee('0x80')](_0x5402ca[_0xb0ee('0x3c')][_0xb0ee('0x7f')])?_0x5402ca['query'][_0xb0ee('0x7f')]:new Array(_0x5402ca[_0xb0ee('0x3c')]['tag']);_0x4a12d6[_0xb0ee('0x32')](function(_0x59caab){_0x1d0e42['or'](_0xb0ee('0x6e'),'%,'+_0x59caab+',%');});}if(_0x5402ca[_0xb0ee('0x3c')][_0xb0ee('0x81')]){var _0x24aebf=_0x5402ca[_0xb0ee('0x3c')][_0xb0ee('0x81')][_0xb0ee('0x82')]('\x5c','\x5c\x5c')[_0xb0ee('0x82')](/'/g,'\x27\x27');if(qs[_0xb0ee('0x83')](_0x24aebf)){_0x26be18['or'](_0xb0ee('0x84'),_0x24aebf+'%')['or'](_0xb0ee('0x85'),_0x24aebf+'%');}else{_0x26be18['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb0ee('0x66')](_0x24aebf))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x24aebf+'%');}}}_0x524e15[_0xb0ee('0x45')](_0x26be18);_0x524e15['group'](_0xb0ee('0x86'));var _0x3b52b0={'type':db[_0xb0ee('0x87')][_0xb0ee('0x88')]['SELECT'],'raw':!![]};var _0x3d2cf3=_0x524e15['clone']();_0x3d2cf3['field'](_0xb0ee('0x86'));_0x3d2cf3['field'](_0xb0ee('0x89'),_0xb0ee('0x8a'));if(_0x3ee12c[_0xb0ee('0x8b')]){_0x3ee12c['order'][_0xb0ee('0x32')](function(_0x12219d){var _0xd22729=_0x12219d[0x0]===_0xb0ee('0x8c')?_0x12219d[0x0]:'i.'+_0x12219d[0x0];_0x524e15[_0xb0ee('0x8b')](_0xd22729,_0x12219d[0x1]===_0xb0ee('0x8d')?![]:!![]);});}if(!_[_0xb0ee('0x74')](_0x4a12d6)){_0x524e15[_0xb0ee('0x60')](_0x1d0e42);_0x3d2cf3[_0xb0ee('0x45')](_0xb0ee('0x8e'),_0x4a12d6);}BPromise[_0xb0ee('0x8f')]()[_0xb0ee('0x90')](function(){if(!_0x56620c){if(_0x5402ca['query']['SmsAccountId'])return;_0x3d2cf3[_0xb0ee('0x45')](_0xb0ee('0x91'));_0x524e15[_0xb0ee('0x45')](_0xb0ee('0x91'));return;}if(_0x5402ca[_0xb0ee('0x92')]['role']!==_0xb0ee('0x93'))return;return _0x5402ca[_0xb0ee('0x92')][_0xb0ee('0x94')]({'attributes':['id'],'raw':!![]})[_0xb0ee('0x90')](function(_0x40b397){if(_[_0xb0ee('0x74')](_0x40b397)){_0x3d2cf3[_0xb0ee('0x45')](_0xb0ee('0x95'));_0x524e15['where'](_0xb0ee('0x95'));}else{_0x3d2cf3[_0xb0ee('0x45')]('i.SmsAccountId\x20IN\x20?',_[_0xb0ee('0x2f')](_0x40b397,'id'));_0x524e15[_0xb0ee('0x45')]('i.SmsAccountId\x20IN\x20?',_[_0xb0ee('0x2f')](_0x40b397,'id'));}});})[_0xb0ee('0x90')](function(){if(_0x5402ca['user'][_0xb0ee('0x96')]===_0xb0ee('0x93')&&!_0x56620c&&!_0x5402ca[_0xb0ee('0x3c')]['SmsAccountId'])return[];return db['sequelize'][_0xb0ee('0x3c')](_0x3d2cf3[_0xb0ee('0x97')](),_0x3b52b0);})[_0xb0ee('0x90')](function(_0x4cc458){_0x354bdc[_0xb0ee('0x22')]=_0x4cc458[_0xb0ee('0x41')];if(_0x354bdc['count']===0x0)return[];return db['sequelize']['query'](_0x265a29['toString'](),_0x3b52b0)[_0xb0ee('0x90')](function(_0x3066b6){_0x5328a9=_[_0xb0ee('0x98')](_0x3066b6,'id');_0x3b52b0=_['merge'](_0x3b52b0,{'model':db[_0xb0ee('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5402ca['query']['fields']){_0x3ee12c['attributes']['forEach'](function(_0x2b2597){_0x524e15[_0xb0ee('0x48')]('i.'+_0x2b2597);});}else{_0x524e15['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb0ee('0x8a'));_0x524e15[_0xb0ee('0x48')]('a.key','Account.key');_0x524e15[_0xb0ee('0x48')](_0xb0ee('0x99'),'Account.mandatoryDisposition');_0x524e15['field'](_0xb0ee('0x9a'),'contactName');_0x524e15['field'](_0xb0ee('0x9b'));_0x524e15[_0xb0ee('0x48')](_0xb0ee('0x9c'),_0xb0ee('0x9d'));_0x524e15[_0xb0ee('0x48')](_0xb0ee('0x9e'),'Contact.lastName');_0x524e15[_0xb0ee('0x48')](_0xb0ee('0x9f'),_0xb0ee('0xa0'));_0x524e15['field'](_0xb0ee('0xa1'),'Contact.phone');_0x524e15[_0xb0ee('0x48')]('c.mobile','Contact.mobile');_0x524e15[_0xb0ee('0x48')](_0xb0ee('0xa2'),'Contact.fax');_0x524e15[_0xb0ee('0x48')](_0xb0ee('0xa3'),_0xb0ee('0xa4'));_0x524e15[_0xb0ee('0x48')](_0xb0ee('0xa5'),_0xb0ee('0xa6'));_0x524e15[_0xb0ee('0x48')](_0xb0ee('0xa7'),_0xb0ee('0x30'));}if(_0x3ee12c[_0xb0ee('0x21')])_0x524e15[_0xb0ee('0x21')](_0x3ee12c[_0xb0ee('0x21')]);if(_0x3ee12c[_0xb0ee('0x23')])_0x524e15[_0xb0ee('0x23')](_0x3ee12c['offset']);return db[_0xb0ee('0xa8')][_0xb0ee('0x3c')](_0x524e15['toString'](),_0x3b52b0);})[_0xb0ee('0x90')](function(_0x554405){if(_0x554405[_0xb0ee('0x41')]>0x0)_0x203db5['where'](_0xb0ee('0xa9'),_['map'](_0x554405,'id'));return db[_0xb0ee('0xa8')][_0xb0ee('0x3c')](_0x203db5[_0xb0ee('0x97')](),_0x3b52b0)[_0xb0ee('0x90')](function(_0x96d5c6){var _0xf74391=_['groupBy'](_0x96d5c6,_0xb0ee('0xaa'));var _0x186894=[];_0x554405[_0xb0ee('0x32')](function(_0x11b60e){_0x186894['push'](updateSmsInteraction(_0x11b60e,_0x5328a9,_0xf74391));});return BPromise[_0xb0ee('0xab')](_0x186894);});});})['then'](function(_0x469490){_0x354bdc[_0xb0ee('0xac')]=_0x469490;return _0x354bdc;})['then'](respondWithFilteredResult(_0x3b21b7,_0x3ee12c))[_0xb0ee('0x34')](handleError(_0x3b21b7,null));};exports[_0xb0ee('0xad')]=function(_0x52366b,_0x249c57){var _0x5c2d8e={'raw':![],'where':{'id':_0x52366b[_0xb0ee('0xae')]['id']}},_0x20c8cc={};_0x20c8cc['model']=_['keys'](db[_0xb0ee('0x35')][_0xb0ee('0x36')]);_0x20c8cc[_0xb0ee('0x3c')]=_[_0xb0ee('0x3d')](_0x52366b['query']);_0x20c8cc[_0xb0ee('0x3e')]=_[_0xb0ee('0x3f')](_0x20c8cc[_0xb0ee('0x3a')],_0x20c8cc[_0xb0ee('0x3c')]);_0x5c2d8e[_0xb0ee('0x40')]=_['intersection'](_0x20c8cc['model'],qs[_0xb0ee('0xaf')](_0x52366b['query'][_0xb0ee('0xaf')]));_0x5c2d8e[_0xb0ee('0x40')]=_0x5c2d8e[_0xb0ee('0x40')][_0xb0ee('0x41')]?_0x5c2d8e['attributes']:_0x20c8cc[_0xb0ee('0x3a')];if(_0x52366b[_0xb0ee('0x3c')][_0xb0ee('0xb0')]){_0x5c2d8e['include']=[{'all':!![]}];}_0x5c2d8e=_[_0xb0ee('0xb1')]({},_0x5c2d8e,_0x52366b[_0xb0ee('0xb2')]);return db[_0xb0ee('0x35')][_0xb0ee('0x5e')](_0x5c2d8e)[_0xb0ee('0x90')](handleEntityNotFound(_0x249c57,null))[_0xb0ee('0x90')](respondWithResult(_0x249c57,null))['catch'](handleError(_0x249c57,null));};exports[_0xb0ee('0xb3')]=function(_0x2bd6a7,_0x5bcb81){return db[_0xb0ee('0x35')][_0xb0ee('0xb3')](_0x2bd6a7[_0xb0ee('0x71')],{})[_0xb0ee('0x90')](respondWithResult(_0x5bcb81,0xc9))[_0xb0ee('0x34')](handleError(_0x5bcb81,null));};exports['update']=function(_0x57a102,_0x34658d){if(_0x57a102[_0xb0ee('0x71')]['id']){delete _0x57a102[_0xb0ee('0x71')]['id'];}return db['SmsInteraction'][_0xb0ee('0x5e')]({'where':{'id':_0x57a102[_0xb0ee('0xae')]['id']}})[_0xb0ee('0x90')](handleEntityNotFound(_0x34658d,null))[_0xb0ee('0x90')](saveUpdates(_0x57a102['body'],null))['then'](respondWithResult(_0x34658d,null))['catch'](handleError(_0x34658d,null));};exports[_0xb0ee('0x2a')]=function(_0x350949,_0x4c810c){return db[_0xb0ee('0x35')][_0xb0ee('0x5e')]({'where':{'id':_0x350949[_0xb0ee('0xae')]['id']}})[_0xb0ee('0x90')](handleEntityNotFound(_0x4c810c,null))[_0xb0ee('0x90')](removeEntity(_0x4c810c,null))['catch'](handleError(_0x4c810c,null));};exports[_0xb0ee('0xb4')]=function(_0x5e8e2f,_0x21c451){return db[_0xb0ee('0x35')]['describe']()[_0xb0ee('0x90')](respondWithResult(_0x21c451,null))[_0xb0ee('0x34')](handleError(_0x21c451,null));};exports[_0xb0ee('0xb5')]=function(_0x4503b0,_0x39ed3d,_0x503c0b){return db[_0xb0ee('0xb6')][_0xb0ee('0x5e')]({'where':{'id':_0x4503b0['params']['id']}})[_0xb0ee('0x90')](handleEntityNotFound(_0x39ed3d,null))[_0xb0ee('0x90')](function(_0x2b1239){if(_0x2b1239){return _0x2b1239[_0xb0ee('0xb5')](_0x4503b0[_0xb0ee('0x71')]['ids'],_['omit'](_0x4503b0['body'],[_0xb0ee('0xb7'),'id'])||{});}})[_0xb0ee('0x90')](respondWithResult(_0x39ed3d,null))[_0xb0ee('0x34')](handleError(_0x39ed3d,null));};exports[_0xb0ee('0xb8')]=function(_0xa0443c,_0x565643,_0x512c2a){var _0xd85328={'raw':![],'where':{}};var _0x4e7b39={};var _0x11e848={'count':0x0,'rows':[]};return db[_0xb0ee('0x35')][_0xb0ee('0xb9')]({'where':{'id':_0xa0443c[_0xb0ee('0xae')]['id']}})['then'](handleEntityNotFound(_0x565643,null))[_0xb0ee('0x90')](function(_0x23ba46){if(_0x23ba46){_0x4e7b39[_0xb0ee('0x3a')]=_[_0xb0ee('0x3d')](db[_0xb0ee('0xb6')][_0xb0ee('0x36')]);_0x4e7b39[_0xb0ee('0x3c')]=_[_0xb0ee('0x3d')](_0xa0443c['query']);_0x4e7b39[_0xb0ee('0x3e')]=_[_0xb0ee('0x3f')](_0x4e7b39[_0xb0ee('0x3a')],_0x4e7b39[_0xb0ee('0x3c')]);_0xd85328[_0xb0ee('0x40')]=_['intersection'](_0x4e7b39['model'],qs[_0xb0ee('0xaf')](_0xa0443c['query'][_0xb0ee('0xaf')]));_0xd85328[_0xb0ee('0x40')]=_0xd85328[_0xb0ee('0x40')][_0xb0ee('0x41')]?_0xd85328['attributes']:_0x4e7b39[_0xb0ee('0x3a')];if(!_0xa0443c[_0xb0ee('0x3c')][_0xb0ee('0x42')](_0xb0ee('0x43'))){_0xd85328['limit']=qs[_0xb0ee('0x21')](_0xa0443c[_0xb0ee('0x3c')][_0xb0ee('0x21')]);_0xd85328[_0xb0ee('0x23')]=qs[_0xb0ee('0x23')](_0xa0443c[_0xb0ee('0x3c')][_0xb0ee('0x23')]);}_0xd85328['order']=qs[_0xb0ee('0x44')](_0xa0443c[_0xb0ee('0x3c')][_0xb0ee('0x44')]);_0xd85328['where']=qs[_0xb0ee('0x3e')](_['pick'](_0xa0443c[_0xb0ee('0x3c')],_0x4e7b39[_0xb0ee('0x3e')]));_0xd85328['where']['SmsInteractionId']=_0x23ba46['id'];if(_0xa0443c[_0xb0ee('0x3c')][_0xb0ee('0x81')]){_0xd85328[_0xb0ee('0x45')]=_['merge'](_0xd85328[_0xb0ee('0x45')],{'$or':_['map'](_0xd85328[_0xb0ee('0x40')],function(_0x23025b){var _0x251aa2={};_0x251aa2[_0x23025b]={'$like':'%'+_0xa0443c['query']['filter']+'%'};return _0x251aa2;})});}if(_0xa0443c['query'][_0xb0ee('0x78')]){var _0x27a748=_0xa0443c['query'][_0xb0ee('0x78')][_0xb0ee('0x6d')](',');var _0x2d7da0={};_0x2d7da0[_0x27a748[0x0]]={'$gte':moment(_0x27a748[0x1])[_0xb0ee('0xba')](_0xb0ee('0xbb'))};_0xd85328[_0xb0ee('0x45')]=_[_0xb0ee('0xb1')](_0xd85328['where'],_0x2d7da0);}_0xd85328=_[_0xb0ee('0xb1')]({},_0xd85328,_0xa0443c[_0xb0ee('0xb2')]);return db[_0xb0ee('0xb6')][_0xb0ee('0x22')]({'where':_0xd85328[_0xb0ee('0x45')]})[_0xb0ee('0x90')](function(_0x3a73d9){_0x11e848[_0xb0ee('0x22')]=_0x3a73d9;if(_0xa0443c[_0xb0ee('0x3c')]['includeAll']){_0xd85328['include']=[{'all':!![]}];}return db[_0xb0ee('0xb6')][_0xb0ee('0xbc')](_0xd85328);})[_0xb0ee('0x90')](function(_0x4da46b){_0x11e848[_0xb0ee('0xac')]=_0x4da46b;return _0x11e848;});}})[_0xb0ee('0x90')](respondWithFilteredResult(_0x565643,_0xd85328))[_0xb0ee('0x34')](handleError(_0x565643,null));};exports['addTags']=function(_0x13a646,_0x3134b6,_0x1ad0bf){return db[_0xb0ee('0x35')][_0xb0ee('0x5e')]({'where':{'id':_0x13a646[_0xb0ee('0xae')]['id']}})[_0xb0ee('0x90')](handleEntityNotFound(_0x3134b6,null))[_0xb0ee('0x90')](function(_0x3a0989){if(_0x3a0989){return _0x3a0989[_0xb0ee('0xbd')](_0x13a646[_0xb0ee('0x71')][_0xb0ee('0xb7')],_[_0xb0ee('0xbe')](_0x13a646[_0xb0ee('0x71')],[_0xb0ee('0xb7'),'id'])||{})[_0xb0ee('0xbf')](function(){return db[_0xb0ee('0x6c')]['findAll']({'attributes':['id',_0xb0ee('0x3b'),_0xb0ee('0x49')],'where':{'id':_0x13a646['body']['ids']}});})[_0xb0ee('0x90')](function(_0x5053f8){socket[_0xb0ee('0xc0')](_0xb0ee('0xc1'),{'id':Number(_0x13a646['params']['id']),'tags':_0x5053f8||[]});return{'id':Number(_0x13a646[_0xb0ee('0xae')]['id']),'tags':_0x5053f8||[]};});}})[_0xb0ee('0x90')](respondWithResult(_0x3134b6,null))[_0xb0ee('0x34')](handleError(_0x3134b6,null));};exports[_0xb0ee('0xc2')]=function(_0x5d3190,_0x644ace,_0x596464){return db[_0xb0ee('0x35')][_0xb0ee('0x5e')]({'where':{'id':_0x5d3190[_0xb0ee('0xae')]['id']}})[_0xb0ee('0x90')](handleEntityNotFound(_0x644ace,null))['then'](function(_0x9d060d){if(_0x9d060d){return _0x9d060d[_0xb0ee('0xc2')](_0x5d3190[_0xb0ee('0x3c')]['ids']);}})[_0xb0ee('0x90')](respondWithStatusCode(_0x644ace,null))['catch'](handleError(_0x644ace,null));};exports[_0xb0ee('0xc3')]=function(_0x658140,_0x24104e){var _0x2d2622=moment()['unix']()[_0xb0ee('0x97')]();var _0x132187=path[_0xb0ee('0xc4')](config[_0xb0ee('0xc5')],'server',_0xb0ee('0xc6'),_0xb0ee('0xc7'));var _0x3ad553=path[_0xb0ee('0xc4')](config['root'],_0xb0ee('0xc8'),_0xb0ee('0xc6'),_0xb0ee('0xc9'));var _0x47673e=path[_0xb0ee('0xc4')](_0x132187,_0x2d2622);var _0xd603b2=util[_0xb0ee('0xba')](_0xb0ee('0xca'),_0x658140[_0xb0ee('0xae')]['id'],_0x2d2622);var _0x5669ba=path[_0xb0ee('0xc4')](_0x132187,_0xd603b2);var _0x480743=[];_0x480743['push']({'model':db[_0xb0ee('0xcb')],'as':_0xb0ee('0xcb'),'attributes':['id',_0xb0ee('0xcc')],'raw':!![]});_0x480743['push']({'model':db['CmContact'],'as':_0xb0ee('0xcd'),'attributes':['id',_0xb0ee('0xce'),'lastName'],'raw':!![]});var _0x5b8d50=[{'model':db[_0xb0ee('0xb6')],'as':_0xb0ee('0xcf'),'attributes':['id',_0xb0ee('0x71'),_0xb0ee('0xd0'),_0xb0ee('0xd1'),_0xb0ee('0xd2'),_0xb0ee('0x7c')],'include':_0x480743}];_0x5b8d50['push']({'model':db[_0xb0ee('0xd3')],'as':'Account','attributes':['id','name']});_0x5b8d50[_0xb0ee('0x33')]({'model':db[_0xb0ee('0xcb')],'as':_0xb0ee('0xd4'),'attributes':['id',_0xb0ee('0xcc')]});return db[_0xb0ee('0x35')][_0xb0ee('0x5e')]({'where':{'id':_0x658140[_0xb0ee('0xae')]['id']},'include':_0x5b8d50})[_0xb0ee('0x90')](handleEntityNotFound(_0x24104e,null))[_0xb0ee('0x90')](function(_0x173cc0){if(_0x173cc0){var _0x140853=_0x173cc0[_0xb0ee('0xd5')]({'plain':!![]});fs[_0xb0ee('0xd6')](_0x47673e);var _0x1f1f60={'channel':'Sms','account':_0x140853['Account'][_0xb0ee('0x3b')],'agent':_0x140853[_0xb0ee('0xd4')]?_0x140853[_0xb0ee('0xd4')][_0xb0ee('0xcc')]:_0xb0ee('0xd7'),'createdAt':moment(_0x140853[_0xb0ee('0xd0')])[_0xb0ee('0xba')](_0xb0ee('0xbb'))[_0xb0ee('0x97')](),'closedAt':_0x140853[_0xb0ee('0xd8')]?moment(_0x140853[_0xb0ee('0xd9')])['format'](_0xb0ee('0xbb'))[_0xb0ee('0x97')]():'','disposition':_0x140853[_0xb0ee('0xda')],'messages':_(_0x140853[_0xb0ee('0xcf')])[_0xb0ee('0x81')]({'secret':![]})[_0xb0ee('0x2f')](function(_0x2b0df7){return{'date':moment(_0x2b0df7[_0xb0ee('0xd0')])[_0xb0ee('0xba')](_0xb0ee('0xbb'))[_0xb0ee('0x97')](),'sender':_0x2b0df7[_0xb0ee('0xd1')]===_0xb0ee('0xdb')?_0x2b0df7[_0xb0ee('0xcb')]?_0x2b0df7[_0xb0ee('0xcb')][_0xb0ee('0xcc')]:_0xb0ee('0xdc'):_0x2b0df7[_0xb0ee('0xcd')][_0xb0ee('0xce')]+(_0x2b0df7['Contact'][_0xb0ee('0xdd')]?'\x20'+_0x2b0df7[_0xb0ee('0xcd')][_0xb0ee('0xdd')]:''),'body':_0x2b0df7[_0xb0ee('0x71')],'direction':_0x2b0df7[_0xb0ee('0xd1')]==='out'?'A':'C','secret':_0x2b0df7[_0xb0ee('0xd2')],'read':_0x2b0df7[_0xb0ee('0x7c')]};})[_0xb0ee('0x5f')]()};return ejs[_0xb0ee('0xde')](path[_0xb0ee('0xc4')](config[_0xb0ee('0xc5')],'server',_0xb0ee('0xdf'),_0xb0ee('0xe0')),{'interaction':_0x1f1f60})[_0xb0ee('0x90')](function(_0xacdd40){var _0x4fda44=path['join'](_0x47673e,_0xb0ee('0xe1')+_0x140853['id']+'-'+_0x2d2622+'.pdf');var _0x449f1b={'path':_0x4fda44,'channel':_0xb0ee('0xe2'),'interactionId':_0x140853['id']};return pdf[_0xb0ee('0xe3')](_0xacdd40,_0x449f1b);})['then'](function(){return new BPromise(function(_0x481226,_0x1d8c5a){zipdir(_0x47673e,{'saveTo':_0x5669ba},function(_0x2a3851,_0x2fe46d){if(_0x2a3851)return _0x1d8c5a(_0x2a3851);return _0x481226(_0x2fe46d);});})[_0xb0ee('0x90')](function(){return new BPromise(function(_0x440213,_0x546ea6){rimraf(_0x47673e,function(_0x2f7afa){if(_0x2f7afa)_0x546ea6(_0x2f7afa);return _0x440213();});});})[_0xb0ee('0x90')](function(){return _0x24104e['download'](_0x5669ba,_0xd603b2,function(_0x58ae57){if(_0x58ae57){console[_0xb0ee('0xe4')]('err',_0x58ae57);}else{fs[_0xb0ee('0xe5')](_0x5669ba);}});});});}else{return _0x24104e['sendStatus'](0xc8);}})['catch'](handleError(_0x24104e,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index be62a26..af1de7e 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 _0xd13e=['catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','update','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0xd13e,0x193));var _0xed13=function(_0x2d80b2,_0x574be8){_0x2d80b2=_0x2d80b2-0x0;var _0x2ffbea=_0xd13e[_0x2d80b2];return _0x2ffbea;};'use strict';var EventEmitter=require(_0xed13('0x0'));var SmsInteraction=require(_0xed13('0x1'))['db'][_0xed13('0x2')];var SmsMessage=require(_0xed13('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xed13('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xed13('0x4'),'afterDestroy':'remove'};function emitEvent(_0x46158d){return function(_0xcba1c4,_0x5e3571,_0x50de44){_0xcba1c4['getUsers']({'attributes':['id'],'raw':!![]})[_0xed13('0x5')](function(_0x134929){_0xcba1c4[_0xed13('0x6')](_0xed13('0x7'),_0x134929[_0xed13('0x8')](function(_0x2ba0d2){return{'id':_0x2ba0d2['id']};}));return SmsMessage[_0xed13('0x9')]({'where':{'SmsInteractionId':_0xcba1c4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xed13('0x5')](function(_0x8543ad){_0xcba1c4['setDataValue'](_0xed13('0xa'),_0x8543ad[_0xed13('0xb')]);SmsInteractionEvents[_0xed13('0xc')](_0x46158d+':'+_0xcba1c4['id'],_0xcba1c4);SmsInteractionEvents[_0xed13('0xc')](_0x46158d,_0xcba1c4);_0x50de44(null);})[_0xed13('0xd')](_0x50de44(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xed13('0xe')](e,emitEvent(event));}}module[_0xed13('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0xf767=['findAll','length','emit','catch','hasOwnProperty','hook','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','map'];(function(_0xd5b7b7,_0x2a1c58){var _0x919156=function(_0x2d4d7d){while(--_0x2d4d7d){_0xd5b7b7['push'](_0xd5b7b7['shift']());}};_0x919156(++_0x2a1c58);}(_0xf767,0x76));var _0x7f76=function(_0x343e44,_0x519af9){_0x343e44=_0x343e44-0x0;var _0xa5130e=_0xf767[_0x343e44];return _0xa5130e;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x7f76('0x0'))['db'][_0x7f76('0x1')];var SmsMessage=require(_0x7f76('0x0'))['db'][_0x7f76('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x7f76('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7f76('0x4'),'afterDestroy':_0x7f76('0x5')};function emitEvent(_0x40ba50){return function(_0x25cd62,_0x5922e5,_0x23c243){_0x25cd62[_0x7f76('0x6')]({'attributes':['id'],'raw':!![]})[_0x7f76('0x7')](function(_0x1eeb08){_0x25cd62[_0x7f76('0x8')]('Users',_0x1eeb08[_0x7f76('0x9')](function(_0x109950){return{'id':_0x109950['id']};}));return SmsMessage[_0x7f76('0xa')]({'where':{'SmsInteractionId':_0x25cd62['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7f76('0x7')](function(_0x4c5f88){_0x25cd62[_0x7f76('0x8')]('unreadMessages',_0x4c5f88[_0x7f76('0xb')]);SmsInteractionEvents[_0x7f76('0xc')](_0x40ba50+':'+_0x25cd62['id'],_0x25cd62);SmsInteractionEvents[_0x7f76('0xc')](_0x40ba50,_0x25cd62);_0x23c243(null);})[_0x7f76('0xd')](_0x23c243(null));};}for(var e in events){if(events[_0x7f76('0xe')](e)){var event=events[e];SmsInteraction[_0x7f76('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index eda2a3e..decb48e 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 _0xefa2=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed'];(function(_0x362ef9,_0x8b4a52){var _0x12d7de=function(_0x5f3c5d){while(--_0x5f3c5d){_0x362ef9['push'](_0x362ef9['shift']());}};_0x12d7de(++_0x8b4a52);}(_0xefa2,0x154));var _0x2efa=function(_0x4589a8,_0x187d4b){_0x4589a8=_0x4589a8-0x0;var _0x4f8dd9=_0xefa2[_0x4589a8];return _0x4f8dd9;};'use strict';var _=require(_0x2efa('0x0'));var util=require(_0x2efa('0x1'));var logger=require('../../config/logger')(_0x2efa('0x2'));var moment=require(_0x2efa('0x3'));var BPromise=require(_0x2efa('0x4'));var rp=require(_0x2efa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2efa('0x6'));module[_0x2efa('0x7')]=function(_0x288bfb,_0x49be13){return _0x288bfb[_0x2efa('0x8')](_0x2efa('0x9'),attributes,{'tableName':_0x2efa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xcbb94e,_0x3bf131,_0x4e178c){if(_0xcbb94e[_0x2efa('0xb')](_0x2efa('0xc'))){_0xcbb94e[_0x2efa('0xd')]=moment()[_0x2efa('0xe')](_0x2efa('0xf'));}_0x4e178c(null,_0xcbb94e);}}});}; \ No newline at end of file +var _0xd55c=['../../config/logger','moment','bluebird','../../config/environment','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','format','util'];(function(_0x1f530d,_0x18a19e){var _0x22103f=function(_0x2664c5){while(--_0x2664c5){_0x1f530d['push'](_0x1f530d['shift']());}};_0x22103f(++_0x18a19e);}(_0xd55c,0x17f));var _0xcd55=function(_0x30a3ac,_0x4da7d2){_0x30a3ac=_0x30a3ac-0x0;var _0x31e5b0=_0xd55c[_0x30a3ac];return _0x31e5b0;};'use strict';var _=require('lodash');var util=require(_0xcd55('0x0'));var logger=require(_0xcd55('0x1'))('api');var moment=require(_0xcd55('0x2'));var BPromise=require(_0xcd55('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcd55('0x4'));var attributes=require('./smsInteraction.attributes');module[_0xcd55('0x5')]=function(_0x396a14,_0x4130d5){return _0x396a14['define'](_0xcd55('0x6'),attributes,{'tableName':_0xcd55('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e78e9,_0x45e56e,_0x46732f){if(_0x1e78e9[_0xcd55('0x8')](_0xcd55('0x9'))){_0x1e78e9[_0xcd55('0xa')]=moment()[_0xcd55('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x46732f(null,_0x1e78e9);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 4da23ec..67019f5 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 _0x9451=['debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_0x9451,0x1cd));var _0x1945=function(_0x5aba6e,_0x3769bb){_0x5aba6e=_0x5aba6e-0x0;var _0x201933=_0x9451[_0x5aba6e];return _0x201933;};'use strict';var _=require(_0x1945('0x0'));var util=require(_0x1945('0x1'));var moment=require(_0x1945('0x2'));var BPromise=require(_0x1945('0x3'));var rs=require(_0x1945('0x4'));var fs=require('fs');var Redis=require(_0x1945('0x5'));var db=require(_0x1945('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1945('0x7'))(_0x1945('0x8'));var config=require(_0x1945('0x9'));var jayson=require(_0x1945('0xa'));var client=jayson[_0x1945('0xb')][_0x1945('0xc')]({'port':0x232a});config[_0x1945('0xd')]=_['defaults'](config[_0x1945('0xd')],{'host':_0x1945('0xe'),'port':0x18eb});var socket=require(_0x1945('0xf'))(new Redis(config['redis']));require(_0x1945('0x10'))[_0x1945('0x11')](socket);function respondWithRpcPromise(_0x3252e0,_0x525d87,_0x2fb3fd){return new BPromise(function(_0xc0cfdc,_0x4ad667){return client[_0x1945('0x12')](_0x3252e0,_0x2fb3fd)[_0x1945('0x13')](function(_0x5e3ceb){logger[_0x1945('0x14')](_0x1945('0x15'),_0x525d87,_0x1945('0x16'));logger[_0x1945('0x17')](_0x1945('0x18'),_0x525d87,'request\x20sent',JSON['stringify'](_0x5e3ceb));if(_0x5e3ceb['error']){if(_0x5e3ceb[_0x1945('0x19')][_0x1945('0x1a')]===0x1f4){logger[_0x1945('0x19')](_0x1945('0x15'),_0x525d87,_0x5e3ceb[_0x1945('0x19')][_0x1945('0x1b')]);return _0x4ad667(_0x5e3ceb[_0x1945('0x19')][_0x1945('0x1b')]);}logger[_0x1945('0x19')](_0x1945('0x15'),_0x525d87,_0x5e3ceb['error']['message']);return _0xc0cfdc(_0x5e3ceb['error'][_0x1945('0x1b')]);}else{logger['info'](_0x1945('0x15'),_0x525d87,'request\x20sent');_0xc0cfdc(_0x5e3ceb[_0x1945('0x1c')]['message']);}})[_0x1945('0x1d')](function(_0x30fc7c){logger[_0x1945('0x19')](_0x1945('0x15'),_0x525d87,_0x30fc7c);_0x4ad667(_0x30fc7c);});});}exports[_0x1945('0x1e')]=function(_0x502c30){var _0x28c320=this;return new Promise(function(_0x126310,_0xf0463d){return db[_0x1945('0x1f')]['update'](_0x502c30[_0x1945('0x20')],{'raw':_0x502c30[_0x1945('0x21')]?_0x502c30[_0x1945('0x21')][_0x1945('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x502c30[_0x1945('0x21')]?_0x502c30[_0x1945('0x21')][_0x1945('0x23')]||null:null,'attributes':_0x502c30[_0x1945('0x21')]?_0x502c30[_0x1945('0x21')][_0x1945('0x24')]||null:null,'limit':_0x502c30[_0x1945('0x21')]?_0x502c30[_0x1945('0x21')][_0x1945('0x25')]||null:null})[_0x1945('0x13')](function(_0x549f95){logger[_0x1945('0x14')]('UpdateSmsInteraction',_0x502c30);logger[_0x1945('0x17')](_0x1945('0x1e'),_0x502c30,JSON['stringify'](_0x549f95));_0x126310(_0x549f95);})[_0x1945('0x1d')](function(_0x49a870){logger[_0x1945('0x19')](_0x1945('0x1e'),_0x49a870[_0x1945('0x1b')],_0x502c30);_0xf0463d(_0x28c320[_0x1945('0x19')](0x1f4,_0x49a870[_0x1945('0x1b')]));});});};exports[_0x1945('0x26')]=function(_0x4d2723){return new Promise(function(_0x3e038c,_0x1b3fa6){return db[_0x1945('0x1f')][_0x1945('0x27')]({'where':_0x4d2723[_0x1945('0x21')]?_0x4d2723['options']['where']||null:null})['then'](function(_0x5e8dc2){if(_0x5e8dc2){return _0x5e8dc2[_0x1945('0x28')](_0x4d2723['body']['ids'],_[_0x1945('0x29')](_0x4d2723['body'],[_0x1945('0x2a'),'id'])||{});}})['spread'](function(_0x500ee5){logger['info'](_0x1945('0x2b'),_0x4d2723);logger['debug']('AddTags',_0x4d2723,JSON['stringify'](_0x500ee5));_0x3e038c(_0x500ee5);})[_0x1945('0x1d')](function(_0x29d90f){logger[_0x1945('0x19')](_0x1945('0x2b'),_0x29d90f[_0x1945('0x1b')],_0x4d2723);_0x1b3fa6(_this[_0x1945('0x19')](0x1f4,_0x29d90f[_0x1945('0x1b')]));});});}; \ No newline at end of file +var _0x289d=['socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','AddTagsToSmsInteraction','addTags','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults'];(function(_0x30d849,_0x3c9499){var _0x9422d2=function(_0x353fcc){while(--_0x353fcc){_0x30d849['push'](_0x30d849['shift']());}};_0x9422d2(++_0x3c9499);}(_0x289d,0x1ac));var _0xd289=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x289d[_0x12d033];return _0x3b4e80;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd289('0x0'));var BPromise=require(_0xd289('0x1'));var rs=require(_0xd289('0x2'));var fs=require('fs');var Redis=require(_0xd289('0x3'));var db=require(_0xd289('0x4'))['db'];var utils=require(_0xd289('0x5'));var logger=require(_0xd289('0x6'))(_0xd289('0x7'));var config=require('../../config/environment');var jayson=require(_0xd289('0x8'));var client=jayson[_0xd289('0x9')]['http']({'port':0x232a});config[_0xd289('0xa')]=_[_0xd289('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd289('0xc'))(new Redis(config[_0xd289('0xa')]));require(_0xd289('0xd'))[_0xd289('0xe')](socket);function respondWithRpcPromise(_0x1cabc0,_0x99320c,_0x5484ef){return new BPromise(function(_0x6e86f0,_0x2b26d9){return client[_0xd289('0xf')](_0x1cabc0,_0x5484ef)[_0xd289('0x10')](function(_0x5091d1){logger[_0xd289('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x99320c,_0xd289('0x12'));logger['debug'](_0xd289('0x13'),_0x99320c,_0xd289('0x12'),JSON[_0xd289('0x14')](_0x5091d1));if(_0x5091d1[_0xd289('0x15')]){if(_0x5091d1[_0xd289('0x15')][_0xd289('0x16')]===0x1f4){logger[_0xd289('0x15')](_0xd289('0x17'),_0x99320c,_0x5091d1['error'][_0xd289('0x18')]);return _0x2b26d9(_0x5091d1[_0xd289('0x15')][_0xd289('0x18')]);}logger[_0xd289('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x99320c,_0x5091d1[_0xd289('0x15')][_0xd289('0x18')]);return _0x6e86f0(_0x5091d1[_0xd289('0x15')][_0xd289('0x18')]);}else{logger['info'](_0xd289('0x17'),_0x99320c,_0xd289('0x12'));_0x6e86f0(_0x5091d1[_0xd289('0x19')]['message']);}})[_0xd289('0x1a')](function(_0xbe579d){logger[_0xd289('0x15')](_0xd289('0x17'),_0x99320c,_0xbe579d);_0x2b26d9(_0xbe579d);});});}exports[_0xd289('0x1b')]=function(_0xf02abb){var _0x4c8e9f=this;return new Promise(function(_0x3855c2,_0x3dbc43){return db[_0xd289('0x1c')][_0xd289('0x1d')](_0xf02abb[_0xd289('0x1e')],{'raw':_0xf02abb[_0xd289('0x1f')]?_0xf02abb[_0xd289('0x1f')][_0xd289('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf02abb[_0xd289('0x1f')]?_0xf02abb[_0xd289('0x1f')][_0xd289('0x21')]||null:null,'attributes':_0xf02abb[_0xd289('0x1f')]?_0xf02abb[_0xd289('0x1f')][_0xd289('0x22')]||null:null,'limit':_0xf02abb['options']?_0xf02abb['options']['limit']||null:null})['then'](function(_0x3cc63a){logger[_0xd289('0x11')]('UpdateSmsInteraction',_0xf02abb);logger['debug'](_0xd289('0x1b'),_0xf02abb,JSON[_0xd289('0x14')](_0x3cc63a));_0x3855c2(_0x3cc63a);})[_0xd289('0x1a')](function(_0x420276){logger['error']('UpdateSmsInteraction',_0x420276[_0xd289('0x18')],_0xf02abb);_0x3dbc43(_0x4c8e9f[_0xd289('0x15')](0x1f4,_0x420276[_0xd289('0x18')]));});});};exports[_0xd289('0x23')]=function(_0x2c1f63){return new Promise(function(_0x25d3ec,_0x30b51e){return db[_0xd289('0x1c')]['find']({'where':_0x2c1f63[_0xd289('0x1f')]?_0x2c1f63[_0xd289('0x1f')][_0xd289('0x21')]||null:null})[_0xd289('0x10')](function(_0x239b23){if(_0x239b23){return _0x239b23[_0xd289('0x24')](_0x2c1f63['body']['ids'],_[_0xd289('0x25')](_0x2c1f63[_0xd289('0x1e')],['ids','id'])||{});}})[_0xd289('0x26')](function(_0x50ca1b){logger[_0xd289('0x11')]('AddTags',_0x2c1f63);logger['debug'](_0xd289('0x27'),_0x2c1f63,JSON[_0xd289('0x14')](_0x50ca1b));_0x25d3ec(_0x50ca1b);})[_0xd289('0x1a')](function(_0x66618b){logger[_0xd289('0x15')](_0xd289('0x27'),_0x66618b[_0xd289('0x18')],_0x2c1f63);_0x30b51e(_this[_0xd289('0x15')](0x1f4,_0x66618b[_0xd289('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index d7473de..bfbb861 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 _0xbaf0=['removeListener','register','length','smsInteraction:','save','remove','update'];(function(_0x371d7a,_0x499c1e){var _0x4d4024=function(_0x20d867){while(--_0x20d867){_0x371d7a['push'](_0x371d7a['shift']());}};_0x4d4024(++_0x499c1e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x0baf('0x0'),_0x0baf('0x1'),_0x0baf('0x2')];function createListener(_0x263f79,_0x1688bc){return function(_0x4d2e72){_0x1688bc['emit'](_0x263f79,_0x4d2e72);};}function removeListener(_0x232cc7,_0x1c383e){return function(){SmsInteractionEvents[_0x0baf('0x3')](_0x232cc7,_0x1c383e);};}exports[_0x0baf('0x4')]=function(_0xe4c3c4){for(var _0x335e24=0x0,_0x1a10b1=events[_0x0baf('0x5')];_0x335e24<_0x1a10b1;_0x335e24++){var _0x1d0a0d=events[_0x335e24];var _0x5f5030=createListener(_0x0baf('0x6')+_0x1d0a0d,_0xe4c3c4);SmsInteractionEvents['on'](_0x1d0a0d,_0x5f5030);}}; \ No newline at end of file +var _0x5f66=['length','smsInteraction:','save','update','emit','register'];(function(_0x4b373f,_0x28cc1f){var _0x3204bc=function(_0x3b08be){while(--_0x3b08be){_0x4b373f['push'](_0x4b373f['shift']());}};_0x3204bc(++_0x28cc1f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'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 70c4a3e..19e5fe4 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 _0x20c8=['update','accept','reject','delete','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','sms','create','post','/:id/status','status','put'];(function(_0x191918,_0x637515){var _0x431776=function(_0x21e250){while(--_0x21e250){_0x191918['push'](_0x191918['shift']());}};_0x431776(++_0x637515);}(_0x20c8,0x13d));var _0x820c=function(_0x2e2b6f,_0xeb0ef4){_0x2e2b6f=_0x2e2b6f-0x0;var _0x5e4be4=_0x20c8[_0x2e2b6f];return _0x5e4be4;};'use strict';var multer=require(_0x820c('0x0'));var util=require(_0x820c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x820c('0x2')]();var fs_extra=require(_0x820c('0x3'));var auth=require(_0x820c('0x4'));var interaction=require(_0x820c('0x5'));var config=require(_0x820c('0x6'));var controller=require(_0x820c('0x7'));router[_0x820c('0x8')]('/',auth[_0x820c('0x9')](),controller[_0x820c('0xa')]);router[_0x820c('0x8')](_0x820c('0xb'),auth['isAuthenticated'](),controller[_0x820c('0xc')]);router['get'](_0x820c('0xd'),auth[_0x820c('0x9')](),controller[_0x820c('0xe')]);router['post']('/',auth[_0x820c('0x9')](),interaction['tracked'](_0x820c('0xf'),'smsmessage:create'),controller[_0x820c('0x10')]);router[_0x820c('0x11')](_0x820c('0x12'),controller[_0x820c('0x13')]);router[_0x820c('0x14')](_0x820c('0xd'),auth[_0x820c('0x9')](),controller[_0x820c('0x15')]);router[_0x820c('0x14')]('/:id/accept',auth[_0x820c('0x9')](),controller[_0x820c('0x16')]);router[_0x820c('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x820c('0x17')]);router[_0x820c('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x820c('0x19')]=router; \ No newline at end of file +var _0x0bf3=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','sms','smsmessage:create','status','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','path'];(function(_0x1ad9a6,_0x17dc8e){var _0x3f836e=function(_0x10fd71){while(--_0x10fd71){_0x1ad9a6['push'](_0x1ad9a6['shift']());}};_0x3f836e(++_0x17dc8e);}(_0x0bf3,0x1a7));var _0x30bf=function(_0x20d629,_0x465e33){_0x20d629=_0x20d629-0x0;var _0x4322b0=_0x0bf3[_0x20d629];return _0x4322b0;};'use strict';var multer=require(_0x30bf('0x0'));var util=require('util');var path=require(_0x30bf('0x1'));var timeout=require(_0x30bf('0x2'));var express=require(_0x30bf('0x3'));var router=express['Router']();var fs_extra=require(_0x30bf('0x4'));var auth=require(_0x30bf('0x5'));var interaction=require(_0x30bf('0x6'));var config=require(_0x30bf('0x7'));var controller=require(_0x30bf('0x8'));router[_0x30bf('0x9')]('/',auth[_0x30bf('0xa')](),controller[_0x30bf('0xb')]);router[_0x30bf('0x9')](_0x30bf('0xc'),auth[_0x30bf('0xa')](),controller[_0x30bf('0xd')]);router['get'](_0x30bf('0xe'),auth[_0x30bf('0xa')](),controller['show']);router[_0x30bf('0xf')]('/',auth[_0x30bf('0xa')](),interaction['tracked'](_0x30bf('0x10'),_0x30bf('0x11')),controller['create']);router[_0x30bf('0xf')]('/:id/status',controller[_0x30bf('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x30bf('0x13')]);router['put'](_0x30bf('0x14'),auth[_0x30bf('0xa')](),controller[_0x30bf('0x15')]);router['put'](_0x30bf('0x16'),auth[_0x30bf('0xa')](),controller['reject']);router[_0x30bf('0x17')](_0x30bf('0xe'),auth['isAuthenticated'](),controller[_0x30bf('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 2e70fde..d83fc94 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 _0xe89e=['STRING','DATE','TEXT','BOOLEAN','ENUM','out'];(function(_0x183682,_0x5caf5c){var _0x2258ba=function(_0x259cfc){while(--_0x259cfc){_0x183682['push'](_0x183682['shift']());}};_0x2258ba(++_0x5caf5c);}(_0xe89e,0xec));var _0xee89=function(_0x2e028c,_0x3ad050){_0x2e028c=_0x2e028c-0x0;var _0x218636=_0xe89e[_0x2e028c];return _0x218636;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xee89('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xee89('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xee89('0x2')]('in','out'),'defaultValue':_0xee89('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xee89('0x4')](0xbe)},'phone':{'type':Sequelize[_0xee89('0x4')]},'readAt':{'type':Sequelize[_0xee89('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xee89('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x6085=['ENUM','out','STRING','BOOLEAN','exports','TEXT','medium'];(function(_0x57cf92,_0x2c6f80){var _0x20b0d3=function(_0x544076){while(--_0x544076){_0x57cf92['push'](_0x57cf92['shift']());}};_0x20b0d3(++_0x2c6f80);}(_0x6085,0xba));var _0x5608=function(_0x529f36,_0x537390){_0x529f36=_0x529f36-0x0;var _0x36e904=_0x6085[_0x529f36];return _0x36e904;};'use strict';var Sequelize=require('sequelize');module[_0x5608('0x0')]={'body':{'type':Sequelize[_0x5608('0x1')](_0x5608('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5608('0x3')]('in',_0x5608('0x4')),'defaultValue':_0x5608('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5608('0x5')](0xbe)},'phone':{'type':Sequelize[_0x5608('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x5608('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5608('0x5')]},'providerResponse':{'type':Sequelize[_0x5608('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 207eed3..fcd5d08 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 _0x29d3=['body','update','find','params','describe','accept','sms','read','readAt','format','UserId','user','agent','SmsInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','role','AcceptMessage','acceptMessage','startsWith','cf_','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','SIP/%s','channel','event','EventManager','acceptmessage','sms-interactions','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','CmContact','push','SELECT','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','sent','delivered','plivio','infobip','results','groupName','DELIVERED','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','reject','save','destroy','stack','send','index','SmsMessage','rawAttributes','fieldName','map','name','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create'];(function(_0x4be5df,_0x4834da){var _0x4006bc=function(_0x48e082){while(--_0x48e082){_0x4be5df['push'](_0x4be5df['shift']());}};_0x4006bc(++_0x4834da);}(_0x29d3,0x163));var _0x329d=function(_0x34b4d5,_0x55e994){_0x34b4d5=_0x34b4d5-0x0;var _0x483f5d=_0x29d3[_0x34b4d5];return _0x483f5d;};'use strict';var emlformat=require(_0x329d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x329d('0x1'));var rp=require(_0x329d('0x2'));var moment=require(_0x329d('0x3'));var BPromise=require(_0x329d('0x4'));var Mustache=require(_0x329d('0x5'));var util=require('util');var path=require(_0x329d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x329d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x329d('0x8'));var jsforce=require(_0x329d('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x329d('0xa'));var querystring=require(_0x329d('0xb'));var Papa=require(_0x329d('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x329d('0xd'));var hardwareService=require(_0x329d('0xe'));var logger=require(_0x329d('0xf'))(_0x329d('0x10'));var utils=require(_0x329d('0x11'));var config=require(_0x329d('0x12'));var licenseUtil=require(_0x329d('0x13'));var db=require(_0x329d('0x14'))['db'];config[_0x329d('0x15')]=_[_0x329d('0x16')](config['redis'],{'host':_0x329d('0x17'),'port':0x18eb});var socket=require(_0x329d('0x18'))(new Redis(config[_0x329d('0x15')]));require(_0x329d('0x19'))[_0x329d('0x1a')](socket);var jayson=require(_0x329d('0x1b'));var client=jayson[_0x329d('0x1c')][_0x329d('0x1d')]({'port':0x232c});var client9002=jayson[_0x329d('0x1c')][_0x329d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5bdaf2,_0x3f169f,_0x50c4ec,_0x48e039){return new BPromise(function(_0x269e85,_0x267cbf){var _0x44e1ef=_0x48e039||client;return _0x44e1ef[_0x329d('0x1e')](_0x5bdaf2,_0x50c4ec)[_0x329d('0x1f')](function(_0x58c351){logger[_0x329d('0x20')](_0x329d('0x21'),_0x3f169f,_0x329d('0x22'));logger[_0x329d('0x23')](_0x329d('0x24'),_0x3f169f,_0x329d('0x22'),JSON['stringify'](_0x58c351));if(_0x58c351[_0x329d('0x25')]){if(_0x58c351[_0x329d('0x25')][_0x329d('0x26')]===0x1f4){logger['error'](_0x329d('0x21'),_0x3f169f,_0x58c351['error'][_0x329d('0x27')]);return _0x267cbf(_0x58c351['error'][_0x329d('0x27')]);}logger[_0x329d('0x25')]('SmsMessage,\x20%s,\x20%s',_0x3f169f,_0x58c351[_0x329d('0x25')]['message']);return _0x269e85(_0x58c351[_0x329d('0x25')][_0x329d('0x27')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x3f169f,_0x329d('0x22'));_0x269e85(_0x58c351[_0x329d('0x28')][_0x329d('0x27')]);}})['catch'](function(_0x1ad9d3){logger['error'](_0x329d('0x21'),_0x3f169f,_0x1ad9d3);_0x267cbf(_0x1ad9d3);});});}function respondWithStatusCode(_0x487eb8,_0x1a6878){_0x1a6878=_0x1a6878||0xcc;return function(_0x2b83bf){if(_0x2b83bf){return _0x487eb8[_0x329d('0x29')](_0x1a6878);}return _0x487eb8[_0x329d('0x2a')](_0x1a6878)[_0x329d('0x2b')]();};}function respondWithResult(_0x5e8412,_0x3a8e5b){_0x3a8e5b=_0x3a8e5b||0xc8;return function(_0x1555b0){if(_0x1555b0){return _0x5e8412[_0x329d('0x2a')](_0x3a8e5b)['json'](_0x1555b0);}};}function respondWithFilteredResult(_0x58868b,_0xac4482){return function(_0xc39a96){if(_0xc39a96){var _0x44e429=typeof _0xac4482[_0x329d('0x2c')]===_0x329d('0x2d')&&typeof _0xac4482[_0x329d('0x2e')]==='undefined';var _0xfb0801=_0xc39a96[_0x329d('0x2f')];var _0x457ee7=_0x44e429?0x0:_0xac4482[_0x329d('0x2c')];var _0x16fb91=_0x44e429?_0xc39a96[_0x329d('0x2f')]:_0xac4482[_0x329d('0x2c')]+_0xac4482[_0x329d('0x2e')];var _0x200fe1;if(_0x16fb91>=_0xfb0801){_0x16fb91=_0xfb0801;_0x200fe1=0xc8;}else{_0x200fe1=0xce;}_0x58868b['status'](_0x200fe1);return _0x58868b[_0x329d('0x30')]('Content-Range',_0x457ee7+'-'+_0x16fb91+'/'+_0xfb0801)['json'](_0xc39a96);}return null;};}function patchUpdates(_0x53ed64){return function(_0xa0a461){try{jsonpatch['apply'](_0xa0a461,_0x53ed64,!![]);}catch(_0x20f36c){return BPromise[_0x329d('0x31')](_0x20f36c);}return _0xa0a461[_0x329d('0x32')]();};}function saveUpdates(_0x299e7a,_0x22b22f){return function(_0x4bf62d){if(_0x4bf62d){return _0x4bf62d['update'](_0x299e7a)[_0x329d('0x1f')](function(_0x5070a2){return _0x5070a2;});}return null;};}function removeEntity(_0x52cf4e,_0x4ee6e5){return function(_0x3fe26b){if(_0x3fe26b){return _0x3fe26b[_0x329d('0x33')]()[_0x329d('0x1f')](function(){_0x52cf4e[_0x329d('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b503,_0x7da73c){return function(_0x1baa64){if(!_0x1baa64){_0x16b503['sendStatus'](0x194);}return _0x1baa64;};}function handleError(_0x1fec94,_0x2d7d17){_0x2d7d17=_0x2d7d17||0x1f4;return function(_0x5a109b){logger[_0x329d('0x25')](_0x5a109b[_0x329d('0x34')]);if(_0x5a109b['name']){delete _0x5a109b['name'];}_0x1fec94['status'](_0x2d7d17)[_0x329d('0x35')](_0x5a109b);};}exports[_0x329d('0x36')]=function(_0xa4fa99,_0x4b7daa){var _0x46aa4f={},_0x3c6d86={},_0x5841b3={'count':0x0,'rows':[]};var _0x315e8f=_['map'](db[_0x329d('0x37')][_0x329d('0x38')],function(_0x51b25){return{'name':_0x51b25[_0x329d('0x39')],'type':_0x51b25['type']['key']};});_0x3c6d86['model']=_[_0x329d('0x3a')](_0x315e8f,_0x329d('0x3b'));_0x3c6d86['query']=_[_0x329d('0x3c')](_0xa4fa99[_0x329d('0x3d')]);_0x3c6d86['filters']=_[_0x329d('0x3e')](_0x3c6d86[_0x329d('0x3f')],_0x3c6d86['query']);_0x46aa4f[_0x329d('0x40')]=_[_0x329d('0x3e')](_0x3c6d86[_0x329d('0x3f')],qs[_0x329d('0x41')](_0xa4fa99[_0x329d('0x3d')][_0x329d('0x41')]));_0x46aa4f[_0x329d('0x40')]=_0x46aa4f[_0x329d('0x40')][_0x329d('0x42')]?_0x46aa4f['attributes']:_0x3c6d86['model'];if(!_0xa4fa99['query'][_0x329d('0x43')](_0x329d('0x44'))){_0x46aa4f['limit']=qs['limit'](_0xa4fa99[_0x329d('0x3d')][_0x329d('0x2e')]);_0x46aa4f[_0x329d('0x2c')]=qs['offset'](_0xa4fa99['query']['offset']);}_0x46aa4f[_0x329d('0x45')]=qs[_0x329d('0x46')](_0xa4fa99['query']['sort']);_0x46aa4f['where']=qs['filters'](_[_0x329d('0x47')](_0xa4fa99['query'],_0x3c6d86[_0x329d('0x48')]),_0x315e8f);if(_0xa4fa99[_0x329d('0x3d')][_0x329d('0x49')]){_0x46aa4f[_0x329d('0x4a')]=_[_0x329d('0x4b')](_0x46aa4f[_0x329d('0x4a')],{'$or':_['map'](_0x315e8f,function(_0x5a792e){if(_0x5a792e[_0x329d('0x4c')]!==_0x329d('0x4d')){var _0x6722dc={};_0x6722dc[_0x5a792e[_0x329d('0x3b')]]={'$like':'%'+_0xa4fa99['query'][_0x329d('0x49')]+'%'};return _0x6722dc;}})});}_0x46aa4f=_[_0x329d('0x4b')]({},_0x46aa4f,_0xa4fa99[_0x329d('0x4e')]);var _0x2b2141={'where':_0x46aa4f[_0x329d('0x4a')]};return db['SmsMessage'][_0x329d('0x2f')](_0x2b2141)[_0x329d('0x1f')](function(_0x54e7e1){_0x5841b3[_0x329d('0x2f')]=_0x54e7e1;if(_0xa4fa99['query'][_0x329d('0x4f')]){_0x46aa4f[_0x329d('0x50')]=[{'all':!![]}];}return db['SmsMessage'][_0x329d('0x51')](_0x46aa4f);})['then'](function(_0x4b2770){_0x5841b3[_0x329d('0x52')]=_0x4b2770;return _0x5841b3;})[_0x329d('0x1f')](respondWithFilteredResult(_0x4b7daa,_0x46aa4f))[_0x329d('0x53')](handleError(_0x4b7daa,null));};exports[_0x329d('0x54')]=function(_0x4da48c,_0x526a98){var _0x33f286={'raw':!![],'where':{'id':_0x4da48c['params']['id']}},_0xed0ac5={};_0xed0ac5['model']=_[_0x329d('0x3c')](db['SmsMessage'][_0x329d('0x38')]);_0xed0ac5[_0x329d('0x3d')]=_['keys'](_0x4da48c[_0x329d('0x3d')]);_0xed0ac5[_0x329d('0x48')]=_['intersection'](_0xed0ac5[_0x329d('0x3f')],_0xed0ac5[_0x329d('0x3d')]);_0x33f286[_0x329d('0x40')]=_[_0x329d('0x3e')](_0xed0ac5[_0x329d('0x3f')],qs[_0x329d('0x41')](_0x4da48c[_0x329d('0x3d')][_0x329d('0x41')]));_0x33f286[_0x329d('0x40')]=_0x33f286[_0x329d('0x40')][_0x329d('0x42')]?_0x33f286[_0x329d('0x40')]:_0xed0ac5['model'];if(_0x4da48c[_0x329d('0x3d')][_0x329d('0x4f')]){_0x33f286[_0x329d('0x50')]=[{'all':!![]}];}_0x33f286=_[_0x329d('0x4b')]({},_0x33f286,_0x4da48c[_0x329d('0x4e')]);return db[_0x329d('0x37')]['find'](_0x33f286)[_0x329d('0x1f')](handleEntityNotFound(_0x526a98,null))['then'](respondWithResult(_0x526a98,null))[_0x329d('0x53')](handleError(_0x526a98,null));};exports[_0x329d('0x55')]=function(_0x2c4122,_0x92b65f){return db[_0x329d('0x37')]['create'](_0x2c4122[_0x329d('0x56')],{})[_0x329d('0x1f')](respondWithResult(_0x92b65f,0xc9))[_0x329d('0x53')](handleError(_0x92b65f,null));};exports[_0x329d('0x57')]=function(_0x54990e,_0x2819f8){if(_0x54990e[_0x329d('0x56')]['id']){delete _0x54990e['body']['id'];}return db[_0x329d('0x37')][_0x329d('0x58')]({'where':{'id':_0x54990e[_0x329d('0x59')]['id']}})[_0x329d('0x1f')](handleEntityNotFound(_0x2819f8,null))['then'](saveUpdates(_0x54990e[_0x329d('0x56')],null))[_0x329d('0x1f')](respondWithResult(_0x2819f8,null))['catch'](handleError(_0x2819f8,null));};exports[_0x329d('0x33')]=function(_0x5ead24,_0x2d64fe){return db[_0x329d('0x37')][_0x329d('0x58')]({'where':{'id':_0x5ead24[_0x329d('0x59')]['id']}})[_0x329d('0x1f')](handleEntityNotFound(_0x2d64fe,null))[_0x329d('0x1f')](removeEntity(_0x2d64fe,null))[_0x329d('0x53')](handleError(_0x2d64fe,null));};exports['describe']=function(_0x345c8e,_0xaed9e0){return db['SmsMessage'][_0x329d('0x5a')]()[_0x329d('0x1f')](respondWithResult(_0xaed9e0,null))['catch'](handleError(_0xaed9e0,null));};var interaction_log=require(_0x329d('0xf'))('sms-interactions');exports[_0x329d('0x5b')]=function(_0x3584db,_0x109623,_0x3b79f2){var _0x2c5240={'agent':{},'channel':_0x329d('0x5c')};if(_0x3584db[_0x329d('0x56')]['id']){delete _0x3584db['body']['id'];}_0x3584db['body'][_0x329d('0x5d')]=!![];_0x3584db['body'][_0x329d('0x5e')]=moment()[_0x329d('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3584db[_0x329d('0x56')][_0x329d('0x60')]=_0x3584db[_0x329d('0x56')]['UserId']||_0x3584db[_0x329d('0x61')]['id'];_0x2c5240[_0x329d('0x62')]['id']=_0x3584db[_0x329d('0x56')][_0x329d('0x60')];return db[_0x329d('0x37')][_0x329d('0x58')]({'where':{'id':_0x3584db[_0x329d('0x59')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x329d('0x1f')](handleEntityNotFound(_0x109623,null))['then'](saveUpdates(_0x3584db['body'],null))[_0x329d('0x1f')](function(_0x4fd499){if(_0x4fd499){_0x2c5240[_0x329d('0x27')]=_0x4fd499['get']({'plain':!![]});return db[_0x329d('0x63')][_0x329d('0x58')]({'where':{'id':_0x4fd499['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x109623,null))[_0x329d('0x1f')](function(_0x2a51d9){if(_0x2a51d9){return _0x2a51d9['update']({'UserId':_0x3584db[_0x329d('0x56')][_0x329d('0x60')],'read1stAt':_[_0x329d('0x64')](_0x2a51d9['read1stAt'])?moment()[_0x329d('0x5f')](_0x329d('0x65')):undefined});}return null;})[_0x329d('0x1f')](function(_0x1541fa){if(_0x1541fa){_0x2c5240[_0x329d('0x66')]=_0x1541fa[_0x329d('0x67')]({'plain':!![]});interaction_log[_0x329d('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3584db[_0x329d('0x61')]['id'],_0x3584db[_0x329d('0x61')][_0x329d('0x3b')],_0x3584db[_0x329d('0x61')][_0x329d('0x68')],_0x2c5240[_0x329d('0x66')]['id'],_0x3584db[_0x329d('0x56')]?JSON['stringify'](_0x3584db[_0x329d('0x56')]):'null');return respondWithRpcPromise(_0x329d('0x69'),_0x329d('0x6a'),_0x2c5240);}return null;})[_0x329d('0x1f')](function(_0x5f442f){return db['CmContact']['describe']()[_0x329d('0x1f')](function(_0x3b4f12){var _0x51fb77=[];for(var _0x483431=0x0;_0x483431=0x0){return _0x4484d4[_0x329d('0x57')]({'read':!![]});}else{logger[_0x329d('0x25')](_0x329d('0x87'),_0x329d('0x2a'),_0x329d('0x8e'),util[_0x329d('0x85')](_0x442778[_0x329d('0x56')],{'showHidden':![],'depth':null}));}break;case _0x329d('0x8f'):var _0x4ac045=_0x442778[_0x329d('0x56')][_0x329d('0x90')][0x0];if(_0x4ac045[_0x329d('0x2a')][_0x329d('0x91')]===_0x329d('0x92')){return _0x4484d4[_0x329d('0x57')]({'read':!![]});}else{logger[_0x329d('0x25')](_0x329d('0x87'),_0x329d('0x2a'),_0x329d('0x8f'),util[_0x329d('0x85')](_0x442778[_0x329d('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x4484d4;}})[_0x329d('0x1f')](respondWithResult(_0x560577,null))[_0x329d('0x53')](handleError(_0x560577,null));}; \ No newline at end of file +var _0x5d12=['acceptMessage','startsWith','cf_','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','push','contact','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','delivered','Status','infobip','results','DELIVERED','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','jayson/promise','client','request','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','stack','name','send','index','map','SmsMessage','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','create','body','find','describe','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','CmContact','Contact','isNil','read1stAt','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage'];(function(_0x2052e5,_0x3d0371){var _0x1d02de=function(_0x2eb52d){while(--_0x2eb52d){_0x2052e5['push'](_0x2052e5['shift']());}};_0x1d02de(++_0x3d0371);}(_0x5d12,0x1d1));var _0x25d1=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x5d12[_0x599e60];return _0x468e19;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x25d1('0x0'));var jsonpatch=require(_0x25d1('0x1'));var rp=require(_0x25d1('0x2'));var moment=require(_0x25d1('0x3'));var BPromise=require(_0x25d1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x25d1('0x5'));var sox=require('sox');var csv=require(_0x25d1('0x6'));var ejs=require(_0x25d1('0x7'));var fs=require('fs');var fs_extra=require(_0x25d1('0x8'));var _=require('lodash');var squel=require(_0x25d1('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x25d1('0x6'));var querystring=require(_0x25d1('0xa'));var Papa=require(_0x25d1('0xb'));var Redis=require(_0x25d1('0xc'));var authService=require(_0x25d1('0xd'));var qs=require(_0x25d1('0xe'));var as=require(_0x25d1('0xf'));var hardwareService=require(_0x25d1('0x10'));var logger=require(_0x25d1('0x11'))(_0x25d1('0x12'));var utils=require('../../config/utils');var config=require(_0x25d1('0x13'));var licenseUtil=require(_0x25d1('0x14'));var db=require(_0x25d1('0x15'))['db'];config[_0x25d1('0x16')]=_[_0x25d1('0x17')](config[_0x25d1('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x25d1('0x16')]));require('./smsMessage.socket')[_0x25d1('0x18')](socket);var jayson=require(_0x25d1('0x19'));var client=jayson[_0x25d1('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0x25d1('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f4b4b,_0x4132a6,_0x336186,_0x245fc8){return new BPromise(function(_0x58cc52,_0x504edb){var _0x2864b1=_0x245fc8||client;return _0x2864b1[_0x25d1('0x1b')](_0x3f4b4b,_0x336186)['then'](function(_0x36218c){logger[_0x25d1('0x1c')]('SmsMessage,\x20%s,\x20%s',_0x4132a6,'request\x20sent');logger[_0x25d1('0x1d')](_0x25d1('0x1e'),_0x4132a6,_0x25d1('0x1f'),JSON[_0x25d1('0x20')](_0x36218c));if(_0x36218c[_0x25d1('0x21')]){if(_0x36218c['error']['code']===0x1f4){logger[_0x25d1('0x21')](_0x25d1('0x22'),_0x4132a6,_0x36218c[_0x25d1('0x21')][_0x25d1('0x23')]);return _0x504edb(_0x36218c[_0x25d1('0x21')][_0x25d1('0x23')]);}logger[_0x25d1('0x21')](_0x25d1('0x22'),_0x4132a6,_0x36218c[_0x25d1('0x21')][_0x25d1('0x23')]);return _0x58cc52(_0x36218c[_0x25d1('0x21')][_0x25d1('0x23')]);}else{logger['info'](_0x25d1('0x22'),_0x4132a6,'request\x20sent');_0x58cc52(_0x36218c[_0x25d1('0x24')][_0x25d1('0x23')]);}})[_0x25d1('0x25')](function(_0xe39a58){logger['error'](_0x25d1('0x22'),_0x4132a6,_0xe39a58);_0x504edb(_0xe39a58);});});}function respondWithStatusCode(_0x2bed60,_0x312652){_0x312652=_0x312652||0xcc;return function(_0x16e7c4){if(_0x16e7c4){return _0x2bed60[_0x25d1('0x26')](_0x312652);}return _0x2bed60[_0x25d1('0x27')](_0x312652)['end']();};}function respondWithResult(_0x232ae1,_0x1332ba){_0x1332ba=_0x1332ba||0xc8;return function(_0x532868){if(_0x532868){return _0x232ae1[_0x25d1('0x27')](_0x1332ba)[_0x25d1('0x28')](_0x532868);}};}function respondWithFilteredResult(_0x4bb438,_0x4e2f09){return function(_0x1d61b2){if(_0x1d61b2){var _0x3a675e=typeof _0x4e2f09[_0x25d1('0x29')]===_0x25d1('0x2a')&&typeof _0x4e2f09[_0x25d1('0x2b')]===_0x25d1('0x2a');var _0x2c419f=_0x1d61b2[_0x25d1('0x2c')];var _0x127de8=_0x3a675e?0x0:_0x4e2f09[_0x25d1('0x29')];var _0x4a2d30=_0x3a675e?_0x1d61b2['count']:_0x4e2f09['offset']+_0x4e2f09[_0x25d1('0x2b')];var _0x2116be;if(_0x4a2d30>=_0x2c419f){_0x4a2d30=_0x2c419f;_0x2116be=0xc8;}else{_0x2116be=0xce;}_0x4bb438[_0x25d1('0x27')](_0x2116be);return _0x4bb438[_0x25d1('0x2d')](_0x25d1('0x2e'),_0x127de8+'-'+_0x4a2d30+'/'+_0x2c419f)[_0x25d1('0x28')](_0x1d61b2);}return null;};}function patchUpdates(_0x336979){return function(_0x3caf91){try{jsonpatch['apply'](_0x3caf91,_0x336979,!![]);}catch(_0x5e001b){return BPromise[_0x25d1('0x2f')](_0x5e001b);}return _0x3caf91[_0x25d1('0x30')]();};}function saveUpdates(_0x45b8e8,_0x3c9de0){return function(_0x577f02){if(_0x577f02){return _0x577f02[_0x25d1('0x31')](_0x45b8e8)[_0x25d1('0x32')](function(_0x2d8bed){return _0x2d8bed;});}return null;};}function removeEntity(_0x436b2d,_0x57e036){return function(_0x553296){if(_0x553296){return _0x553296[_0x25d1('0x33')]()[_0x25d1('0x32')](function(){_0x436b2d[_0x25d1('0x27')](0xcc)[_0x25d1('0x34')]();});}};}function handleEntityNotFound(_0x2f679d,_0x47d7bb){return function(_0x324995){if(!_0x324995){_0x2f679d[_0x25d1('0x26')](0x194);}return _0x324995;};}function handleError(_0xd2bce1,_0x17deec){_0x17deec=_0x17deec||0x1f4;return function(_0x4b9281){logger['error'](_0x4b9281[_0x25d1('0x35')]);if(_0x4b9281[_0x25d1('0x36')]){delete _0x4b9281[_0x25d1('0x36')];}_0xd2bce1[_0x25d1('0x27')](_0x17deec)[_0x25d1('0x37')](_0x4b9281);};}exports[_0x25d1('0x38')]=function(_0x364e07,_0x4b9ac4){var _0x43d527={},_0x5469d8={},_0xe74bfd={'count':0x0,'rows':[]};var _0x1f8bdf=_[_0x25d1('0x39')](db[_0x25d1('0x3a')][_0x25d1('0x3b')],function(_0x3add5f){return{'name':_0x3add5f['fieldName'],'type':_0x3add5f[_0x25d1('0x3c')]['key']};});_0x5469d8[_0x25d1('0x3d')]=_[_0x25d1('0x39')](_0x1f8bdf,_0x25d1('0x36'));_0x5469d8[_0x25d1('0x3e')]=_[_0x25d1('0x3f')](_0x364e07[_0x25d1('0x3e')]);_0x5469d8[_0x25d1('0x40')]=_['intersection'](_0x5469d8[_0x25d1('0x3d')],_0x5469d8[_0x25d1('0x3e')]);_0x43d527[_0x25d1('0x41')]=_['intersection'](_0x5469d8[_0x25d1('0x3d')],qs['fields'](_0x364e07[_0x25d1('0x3e')][_0x25d1('0x42')]));_0x43d527[_0x25d1('0x41')]=_0x43d527[_0x25d1('0x41')][_0x25d1('0x43')]?_0x43d527[_0x25d1('0x41')]:_0x5469d8[_0x25d1('0x3d')];if(!_0x364e07['query'][_0x25d1('0x44')]('nolimit')){_0x43d527[_0x25d1('0x2b')]=qs[_0x25d1('0x2b')](_0x364e07[_0x25d1('0x3e')][_0x25d1('0x2b')]);_0x43d527['offset']=qs[_0x25d1('0x29')](_0x364e07[_0x25d1('0x3e')][_0x25d1('0x29')]);}_0x43d527[_0x25d1('0x45')]=qs[_0x25d1('0x46')](_0x364e07['query'][_0x25d1('0x46')]);_0x43d527[_0x25d1('0x47')]=qs[_0x25d1('0x40')](_[_0x25d1('0x48')](_0x364e07[_0x25d1('0x3e')],_0x5469d8[_0x25d1('0x40')]),_0x1f8bdf);if(_0x364e07[_0x25d1('0x3e')][_0x25d1('0x49')]){_0x43d527['where']=_[_0x25d1('0x4a')](_0x43d527[_0x25d1('0x47')],{'$or':_[_0x25d1('0x39')](_0x1f8bdf,function(_0x204806){if(_0x204806[_0x25d1('0x3c')]!==_0x25d1('0x4b')){var _0x2e575c={};_0x2e575c[_0x204806[_0x25d1('0x36')]]={'$like':'%'+_0x364e07[_0x25d1('0x3e')][_0x25d1('0x49')]+'%'};return _0x2e575c;}})});}_0x43d527=_[_0x25d1('0x4a')]({},_0x43d527,_0x364e07[_0x25d1('0x4c')]);var _0x419b28={'where':_0x43d527[_0x25d1('0x47')]};return db[_0x25d1('0x3a')][_0x25d1('0x2c')](_0x419b28)[_0x25d1('0x32')](function(_0xcf9d10){_0xe74bfd[_0x25d1('0x2c')]=_0xcf9d10;if(_0x364e07[_0x25d1('0x3e')][_0x25d1('0x4d')]){_0x43d527[_0x25d1('0x4e')]=[{'all':!![]}];}return db['SmsMessage'][_0x25d1('0x4f')](_0x43d527);})[_0x25d1('0x32')](function(_0x3cb360){_0xe74bfd[_0x25d1('0x50')]=_0x3cb360;return _0xe74bfd;})[_0x25d1('0x32')](respondWithFilteredResult(_0x4b9ac4,_0x43d527))[_0x25d1('0x25')](handleError(_0x4b9ac4,null));};exports[_0x25d1('0x51')]=function(_0x2ba9d4,_0x1b90a5){var _0x3c0052={'raw':!![],'where':{'id':_0x2ba9d4[_0x25d1('0x52')]['id']}},_0x5eebde={};_0x5eebde[_0x25d1('0x3d')]=_[_0x25d1('0x3f')](db[_0x25d1('0x3a')]['rawAttributes']);_0x5eebde[_0x25d1('0x3e')]=_[_0x25d1('0x3f')](_0x2ba9d4[_0x25d1('0x3e')]);_0x5eebde[_0x25d1('0x40')]=_[_0x25d1('0x53')](_0x5eebde[_0x25d1('0x3d')],_0x5eebde[_0x25d1('0x3e')]);_0x3c0052['attributes']=_['intersection'](_0x5eebde['model'],qs[_0x25d1('0x42')](_0x2ba9d4[_0x25d1('0x3e')][_0x25d1('0x42')]));_0x3c0052[_0x25d1('0x41')]=_0x3c0052[_0x25d1('0x41')][_0x25d1('0x43')]?_0x3c0052[_0x25d1('0x41')]:_0x5eebde['model'];if(_0x2ba9d4[_0x25d1('0x3e')][_0x25d1('0x4d')]){_0x3c0052[_0x25d1('0x4e')]=[{'all':!![]}];}_0x3c0052=_[_0x25d1('0x4a')]({},_0x3c0052,_0x2ba9d4[_0x25d1('0x4c')]);return db[_0x25d1('0x3a')]['find'](_0x3c0052)['then'](handleEntityNotFound(_0x1b90a5,null))[_0x25d1('0x32')](respondWithResult(_0x1b90a5,null))['catch'](handleError(_0x1b90a5,null));};exports[_0x25d1('0x54')]=function(_0x4ee458,_0x3c66a7){return db[_0x25d1('0x3a')][_0x25d1('0x54')](_0x4ee458['body'],{})['then'](respondWithResult(_0x3c66a7,0xc9))[_0x25d1('0x25')](handleError(_0x3c66a7,null));};exports[_0x25d1('0x31')]=function(_0x509da3,_0x1a4c6f){if(_0x509da3[_0x25d1('0x55')]['id']){delete _0x509da3[_0x25d1('0x55')]['id'];}return db['SmsMessage'][_0x25d1('0x56')]({'where':{'id':_0x509da3[_0x25d1('0x52')]['id']}})[_0x25d1('0x32')](handleEntityNotFound(_0x1a4c6f,null))['then'](saveUpdates(_0x509da3[_0x25d1('0x55')],null))[_0x25d1('0x32')](respondWithResult(_0x1a4c6f,null))['catch'](handleError(_0x1a4c6f,null));};exports[_0x25d1('0x33')]=function(_0x3f422a,_0x4a590d){return db[_0x25d1('0x3a')][_0x25d1('0x56')]({'where':{'id':_0x3f422a['params']['id']}})[_0x25d1('0x32')](handleEntityNotFound(_0x4a590d,null))[_0x25d1('0x32')](removeEntity(_0x4a590d,null))[_0x25d1('0x25')](handleError(_0x4a590d,null));};exports[_0x25d1('0x57')]=function(_0x4f9a2d,_0x3adec4){return db[_0x25d1('0x3a')][_0x25d1('0x57')]()[_0x25d1('0x32')](respondWithResult(_0x3adec4,null))['catch'](handleError(_0x3adec4,null));};var interaction_log=require(_0x25d1('0x11'))('sms-interactions');exports[_0x25d1('0x58')]=function(_0x1f394a,_0x5cfe4b,_0x2019eb){var _0x7fa7e8={'agent':{},'channel':_0x25d1('0x59')};if(_0x1f394a['body']['id']){delete _0x1f394a['body']['id'];}_0x1f394a[_0x25d1('0x55')][_0x25d1('0x5a')]=!![];_0x1f394a[_0x25d1('0x55')][_0x25d1('0x5b')]=moment()[_0x25d1('0x5c')](_0x25d1('0x5d'));_0x1f394a[_0x25d1('0x55')][_0x25d1('0x5e')]=_0x1f394a[_0x25d1('0x55')][_0x25d1('0x5e')]||_0x1f394a['user']['id'];_0x7fa7e8[_0x25d1('0x5f')]['id']=_0x1f394a[_0x25d1('0x55')][_0x25d1('0x5e')];return db[_0x25d1('0x3a')]['find']({'where':{'id':_0x1f394a[_0x25d1('0x52')]['id'],'UserId':null},'include':[{'model':db[_0x25d1('0x60')],'as':_0x25d1('0x61')}]})[_0x25d1('0x32')](handleEntityNotFound(_0x5cfe4b,null))[_0x25d1('0x32')](saveUpdates(_0x1f394a[_0x25d1('0x55')],null))[_0x25d1('0x32')](function(_0x49855d){if(_0x49855d){_0x7fa7e8['message']=_0x49855d['get']({'plain':!![]});return db['SmsInteraction'][_0x25d1('0x56')]({'where':{'id':_0x49855d['SmsInteractionId']}});}return null;})[_0x25d1('0x32')](handleEntityNotFound(_0x5cfe4b,null))['then'](function(_0x4ff3d4){if(_0x4ff3d4){return _0x4ff3d4[_0x25d1('0x31')]({'UserId':_0x1f394a['body'][_0x25d1('0x5e')],'read1stAt':_[_0x25d1('0x62')](_0x4ff3d4[_0x25d1('0x63')])?moment()[_0x25d1('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x25d1('0x32')](function(_0x20ce2a){if(_0x20ce2a){_0x7fa7e8['interaction']=_0x20ce2a[_0x25d1('0x64')]({'plain':!![]});interaction_log[_0x25d1('0x1c')](_0x25d1('0x65'),_0x1f394a['user']['id'],_0x1f394a['user'][_0x25d1('0x36')],_0x1f394a[_0x25d1('0x66')][_0x25d1('0x67')],_0x7fa7e8[_0x25d1('0x68')]['id'],_0x1f394a['body']?JSON['stringify'](_0x1f394a[_0x25d1('0x55')]):_0x25d1('0x69'));return respondWithRpcPromise(_0x25d1('0x6a'),_0x25d1('0x6b'),_0x7fa7e8);}return null;})['then'](function(_0x5c1b04){return db[_0x25d1('0x60')][_0x25d1('0x57')]()[_0x25d1('0x32')](function(_0x21a062){var _0x2fc664=[];for(var _0x467575=0x0;_0x467575=0x0){return _0x275326['update']({'read':!![]});}else{logger[_0x25d1('0x21')](_0x25d1('0x86'),_0x25d1('0x27'),'plivio',util[_0x25d1('0x82')](_0x2b6590[_0x25d1('0x55')],{'showHidden':![],'depth':null}));}break;case _0x25d1('0x8c'):var _0x28ad32=_0x2b6590['body'][_0x25d1('0x8d')][0x0];if(_0x28ad32[_0x25d1('0x27')]['groupName']===_0x25d1('0x8e')){return _0x275326[_0x25d1('0x31')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x25d1('0x27'),_0x25d1('0x8c'),util[_0x25d1('0x82')](_0x2b6590[_0x25d1('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x275326;}})['then'](respondWithResult(_0x1a3f58,null))[_0x25d1('0x25')](handleError(_0x1a3f58,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index faea2cb..84ac99f 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 _0x5155=['SmsMessage','update','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x11bda3,_0x2e9e0f){var _0x228f7f=function(_0x4c4093){while(--_0x4c4093){_0x11bda3['push'](_0x11bda3['shift']());}};_0x228f7f(++_0x2e9e0f);}(_0x5155,0x12a));var _0x5515=function(_0x4b94b9,_0x190691){_0x4b94b9=_0x4b94b9-0x0;var _0x4882f7=_0x5155[_0x4b94b9];return _0x4882f7;};'use strict';var EventEmitter=require(_0x5515('0x0'));var SmsMessage=require(_0x5515('0x1'))['db'][_0x5515('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5515('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4176ec){return function(_0x1cfb03,_0x4c7732,_0x5a05be){SmsMessageEvents[_0x5515('0x4')](_0x4176ec+':'+_0x1cfb03['id'],_0x1cfb03);SmsMessageEvents['emit'](_0x4176ec,_0x1cfb03);_0x5a05be(null);};}for(var e in events){if(events[_0x5515('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x287f=['save','update','remove','emit','hook','exports','../../mysqldb','SmsMessage'];(function(_0x593cad,_0x2770de){var _0x348b4e=function(_0x5664cd){while(--_0x5664cd){_0x593cad['push'](_0x593cad['shift']());}};_0x348b4e(++_0x2770de);}(_0x287f,0x1d6));var _0xf287=function(_0x7977a1,_0xebeea8){_0x7977a1=_0x7977a1-0x0;var _0x3588e3=_0x287f[_0x7977a1];return _0x3588e3;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xf287('0x0'))['db'][_0xf287('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf287('0x2'),'afterUpdate':_0xf287('0x3'),'afterDestroy':_0xf287('0x4')};function emitEvent(_0x4a84ee){return function(_0x45e35b,_0x1efd61,_0xab8178){SmsMessageEvents[_0xf287('0x5')](_0x4a84ee+':'+_0x45e35b['id'],_0x45e35b);SmsMessageEvents[_0xf287('0x5')](_0x4a84ee,_0x45e35b);_0xab8178(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xf287('0x6')](e,emitEvent(event));}}module[_0xf287('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index f79e4eb..74af695 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 _0x6999=['path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','toLowerCase','direction','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','catch','error','out','find','SmsAccountId','type','twilio','authToken','phone','accountSid','create','body','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','login?username=','&password=','GET','user_key','session_key','internal_order_id','deliveryReport','read','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','head','messages','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','timestamp','keys','sort','length','createHash','md5','digest','signature=','id_sms','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','status','refid','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird'];(function(_0x208419,_0x399c3f){var _0x345021=function(_0x54ee1e){while(--_0x54ee1e){_0x208419['push'](_0x208419['shift']());}};_0x345021(++_0x399c3f);}(_0x6999,0x16b));var _0x9699=function(_0x5e3bfd,_0x498d53){_0x5e3bfd=_0x5e3bfd-0x0;var _0x39bdd8=_0x6999[_0x5e3bfd];return _0x39bdd8;};'use strict';var _=require('lodash');var util=require(_0x9699('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9699('0x1'));var BPromise=require(_0x9699('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9699('0x3'));var rimraf=require(_0x9699('0x4'));var config=require(_0x9699('0x5'));var attributes=require(_0x9699('0x6'));module[_0x9699('0x7')]=function(_0x17ebc5,_0x3c642f){return _0x17ebc5[_0x9699('0x8')]('SmsMessage',attributes,{'tableName':_0x9699('0x9'),'paranoid':![],'indexes':[{'name':_0x9699('0xa'),'fields':[_0x9699('0xa')]},{'name':_0x9699('0xb'),'fields':['body'],'type':_0x9699('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x838ae,_0x3d2b90,_0x4a480f){var _0x37d779=_0x17ebc5[_0x9699('0xd')];var _0xc0737f=_0x838ae['get']({'plain':!![]});if(_0xc0737f['direction'][_0x9699('0xe')]()==='in'||_0xc0737f[_0x9699('0xf')]['toLowerCase']()==='out'&&!_0xc0737f[_0x9699('0x10')]&&!_[_0x9699('0x11')](_0xc0737f[_0x9699('0x12')])){_0x37d779[_0x9699('0x13')]['findOne']({'where':{'id':_0xc0737f[_0x9699('0x14')]}})[_0x9699('0x15')](function(_0x43b7a8){if(_0x43b7a8){_0x43b7a8[_0x9699('0x16')]({'lastMsgAt':_0xc0737f['createdAt'],'lastMsgDirection':_0xc0737f[_0x9699('0xf')]['toLowerCase']()});}})[_0x9699('0x17')](function(_0x52be6b){console[_0x9699('0x18')](_0x52be6b);});}if(_0xc0737f[_0x9699('0xf')]===_0x9699('0x19')&&!_0xc0737f['secret']){var _0x4a9da6;_0x37d779['SmsAccount'][_0x9699('0x1a')]({'where':{'id':_0xc0737f[_0x9699('0x1b')]},'raw':!![]})[_0x9699('0x15')](function(_0x1d9f1a){_0x4a9da6=_0x1d9f1a;if(_0x4a9da6&&_0x4a9da6['type']){switch(_0x4a9da6[_0x9699('0x1c')]){case _0x9699('0x1d'):var _0x3180fe=require('twilio');if(_0x4a9da6['accountSid']&&_0x4a9da6[_0x9699('0x1e')]&&_0x4a9da6[_0x9699('0x1f')]){var _0x3dad29=new _0x3180fe(_0x4a9da6[_0x9699('0x20')],_0x4a9da6[_0x9699('0x1e')]);_0x3dad29['messages'][_0x9699('0x21')]({'body':_0xc0737f[_0x9699('0x22')],'to':_0xc0737f['phone'],'from':_0x4a9da6[_0x9699('0x1f')],'statusCallback':_0x4a9da6['remote']+_0x9699('0x23')+_0xc0737f['id']+_0x9699('0x24')+_0x4a9da6[_0x9699('0x25')]})[_0x9699('0x15')](function(_0x16266d){if(_0x16266d['sid']){return _0x838ae['update']({'messageId':_0x16266d[_0x9699('0x26')]});}})[_0x9699('0x17')](function(_0x21ee9d){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9699('0x27'),_0x9699('0x1d'),util[_0x9699('0x28')](_0x21ee9d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x1d'),_0x9699('0x2a'));}break;case _0x9699('0x2b'):var _0x35eafc='https://api.skebby.it/API/v1.0/REST/';if(_0x4a9da6[_0x9699('0x2c')]&&_0x4a9da6[_0x9699('0x2d')]){var _0x3ec2b5={'recipient':[_0xc0737f[_0x9699('0x1f')]],'message':_0xc0737f[_0x9699('0x22')],'message_type':_0x4a9da6['smsMethod']};if(_0x4a9da6[_0x9699('0x2e')]&&_0x4a9da6[_0x9699('0x2e')]!=='SI'){_0x3ec2b5['sender']=_0x4a9da6[_0x9699('0x1f')];}var _0x4bc7c8={'url':_0x35eafc+_0x9699('0x2f')+_0x4a9da6['username']+_0x9699('0x30')+_0x4a9da6[_0x9699('0x2d')],'method':_0x9699('0x31')};rp(_0x4bc7c8)['then'](function(_0x2ca062){var _0x1c63b0=_0x2ca062['split'](';');var _0x207fa6={'user_key':_0x1c63b0[0x0],'session_key':_0x1c63b0[0x1]};_0x4bc7c8={'url':_0x35eafc+'sms','method':'POST','headers':{'user_key':_0x207fa6[_0x9699('0x32')],'Session_key':_0x207fa6[_0x9699('0x33')]},'json':!![],'body':_0x3ec2b5};return rp(_0x4bc7c8);})['then'](function(_0x439eff){if(_0x439eff['total_sent']>=0x1){var _0x501d47={'messageId':_0x439eff[_0x9699('0x34')]};if(_0x4a9da6['smsMethod']!=='GP'||!_0x4a9da6[_0x9699('0x35')]){_0x501d47[_0x9699('0x36')]=!![];}return _0x838ae[_0x9699('0x16')](_0x501d47);}else{return logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x2b'),util['inspect'](_0x439eff,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4bd4d7){return logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x2b'),util[_0x9699('0x28')](_0x4bd4d7,{'showHidden':![],'depth':null}));});}else{logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x2b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x9699('0x37'):if(_0x4a9da6[_0x9699('0x1e')]){var _0x264f1d={'recipient':_0xc0737f[_0x9699('0x1f')],'message':_0xc0737f[_0x9699('0x22')],'sender':_0x4a9da6[_0x9699('0x38')]||_0x4a9da6['phone'],'authorization':_0x4a9da6[_0x9699('0x1e')]};var _0x3d2b90={'method':_0x9699('0x39'),'uri':_0x9699('0x3a'),'body':_0x264f1d,'json':!![]};rp(_0x3d2b90)[_0x9699('0x15')](function(_0xe20e12){var _0xf217c4={'messageId':_0xe20e12[_0x9699('0x3b')]};if(!_0x4a9da6[_0x9699('0x35')]){_0xf217c4['read']=!![];}return _0x838ae[_0x9699('0x16')](_0xf217c4);})[_0x9699('0x17')](function(_0x271ca9){logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x37'),util[_0x9699('0x28')](_0x271ca9,{'showHidden':![],'depth':null}));});}else{logger[_0x9699('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9699('0x27'),_0x9699('0x37'),'Missing\x20parameters:\x20authToken');}break;case _0x9699('0x3c'):if(_0x4a9da6['username']&&_0x4a9da6[_0x9699('0x2d')]){var _0x264f1d={'messages':[{'source':_0x9699('0x3d'),'to':_0xc0737f['phone'],'body':_0xc0737f[_0x9699('0x22')],'from':_0x4a9da6[_0x9699('0x38')]||_0x4a9da6[_0x9699('0x1f')]}]};var _0x4198c0=util[_0x9699('0x3e')](_0x9699('0x3f'),_0x4a9da6[_0x9699('0x2c')],_0x4a9da6[_0x9699('0x2d')]);var _0x3d2b90={'method':'POST','uri':_0x9699('0x40'),'body':_0x264f1d,'headers':{'Authorization':util[_0x9699('0x3e')](_0x9699('0x41'),new Buffer(_0x4198c0)[_0x9699('0x42')](_0x9699('0x43')))},'json':!![]};rp(_0x3d2b90)[_0x9699('0x15')](function(_0x35f221){if(_0x35f221[_0x9699('0x44')]>=0xc8&&_0x35f221['http_code']<=0xce){if(_0x35f221['data']&&_0x35f221[_0x9699('0x45')]['queued_count']>0x0){var _0x8557cf=_[_0x9699('0x46')](_0x35f221[_0x9699('0x45')][_0x9699('0x47')]);var _0x21dad9={'messageId':_0x8557cf['message_id']};if(!_0x4a9da6[_0x9699('0x35')]){_0x21dad9['read']=!![];}return _0x838ae[_0x9699('0x16')](_0x21dad9);}else{logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x48'),util['inspect'](_0x35f221,{'showHidden':![],'depth':null}));}}else{logger[_0x9699('0x18')](_0x9699('0x29'),'afterCreate','clickSend',util[_0x9699('0x28')](_0x35f221,{'showHidden':![],'depth':null}));}})['catch'](function(_0x64a0dd){logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x48'),util['inspect'](_0x64a0dd,{'showHidden':![],'depth':null}));});}else{logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x48'),_0x9699('0x49'));}break;case _0x9699('0x4a'):if(_0x4a9da6[_0x9699('0x4b')]&&_0x4a9da6['authToken']){var _0x264f1d={'dst':_0xc0737f[_0x9699('0x1f')],'text':_0xc0737f[_0x9699('0x22')],'src':_0x4a9da6['senderString']||_0x4a9da6[_0x9699('0x1f')],'url':_0x4a9da6[_0x9699('0x4c')]+'/api/sms/messages/'+_0xc0737f['id']+_0x9699('0x24')+_0x4a9da6[_0x9699('0x25')]};var _0x4198c0=util[_0x9699('0x3e')](_0x9699('0x3f'),_0x4a9da6[_0x9699('0x4b')],_0x4a9da6[_0x9699('0x1e')]);var _0x3d2b90={'method':'POST','uri':util['format'](_0x9699('0x4d'),_0x4a9da6[_0x9699('0x4b')]),'body':_0x264f1d,'headers':{'Authorization':util['format'](_0x9699('0x41'),new Buffer(_0x4198c0)[_0x9699('0x42')]('base64'))},'json':!![]};rp(_0x3d2b90)[_0x9699('0x15')](function(_0x4dec43){var _0x44ff00={'messageId':_0x4dec43[_0x9699('0x4e')][0x0]};return _0x838ae[_0x9699('0x16')](_0x44ff00);})[_0x9699('0x17')](function(_0x3f35cd){logger['error'](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x4a'),util[_0x9699('0x28')](_0x3f35cd,{'showHidden':![],'depth':null}));});}else{logger[_0x9699('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9699('0x27'),_0x9699('0x4a'),_0x9699('0x4f'));}break;case _0x9699('0x50'):if(_0x4a9da6[_0x9699('0x2c')]&&_0x4a9da6[_0x9699('0x2d')]){if(_0x4a9da6[_0x9699('0x51')]){var _0x80f8c1={'method':_0x9699('0x39'),'uri':_0x4a9da6[_0x9699('0x51')]+_0x9699('0x52'),'body':{'username':_0x4a9da6[_0x9699('0x2c')],'password':_0x4a9da6[_0x9699('0x2d')]},'json':!![]};return rp(_0x80f8c1)['then'](function(_0x1f6294){var _0x13ddb4={'method':_0x9699('0x39'),'uri':_0x4a9da6['baseUrl']+_0x9699('0x53'),'body':{'messages':[{'from':_0x4a9da6[_0x9699('0x1f')],'destinations':[{'to':_0xc0737f[_0x9699('0x1f')]}],'text':_0xc0737f[_0x9699('0x22')],'notifyUrl':_0x4a9da6[_0x9699('0x4c')]+'/api/sms/messages/'+_0xc0737f['id']+'/status?token='+_0x4a9da6['token'],'notifyContentType':'application/json','callbackData':_0x4a9da6[_0x9699('0x1f')]+';'+_0xc0737f[_0x9699('0x22')]}]},'headers':{'Authorization':_0x9699('0x54')+_0x1f6294[_0x9699('0x25')]},'json':!![]};return rp(_0x13ddb4)['then'](function(_0x31f9f2){if(_0x31f9f2[_0x9699('0x47')]){var _0x4a702a={'messageId':_0x31f9f2[_0x9699('0x47')][0x0][_0x9699('0xa')]};if(!_0x4a9da6['deliveryReport']){_0x4a702a[_0x9699('0x36')]=!![];}return _0x838ae[_0x9699('0x16')](_0x4a702a);}else{return logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x50'),util[_0x9699('0x28')](_0x31f9f2,{'showHidden':![],'depth':null}));}});})[_0x9699('0x17')](function(_0xbe0647){return logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x50'),util[_0x9699('0x28')](_0xbe0647,{'showHidden':![],'depth':null}));});}else{logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x50'),_0x9699('0x55'));}}else{logger['error'](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x50'),_0x9699('0x49'));}break;case _0x9699('0x56'):var _0x19849d=require(_0x9699('0x57'));if(_0x4a9da6[_0x9699('0x58')]){var _0xbf4fbc={};_0xbf4fbc[_0x9699('0x59')]=_0x4a9da6[_0x9699('0x2c')];_0xbf4fbc[_0x9699('0x1f')]=_0xc0737f[_0x9699('0x1f')];_0xbf4fbc[_0x9699('0x5a')]=_0x4a9da6['phone'];_0xbf4fbc[_0x9699('0x5b')]=_0xc0737f['body'];_0xbf4fbc[_0x9699('0x5c')]=+new Date();var _0x442b54='';var _0x4fb44a='';var _0x31a422=Object[_0x9699('0x5d')](_0xbf4fbc);_0x31a422[_0x9699('0x5e')]();for(var _0x1f0bb4=0x0;_0x1f0bb4<_0x31a422[_0x9699('0x5f')];_0x1f0bb4++){if(_0x442b54!=''){_0x442b54+='&';}_0x442b54+=_0x31a422[_0x1f0bb4]+'='+encodeURIComponent(_0xbf4fbc[_0x31a422[_0x1f0bb4]]);_0x4fb44a+=_0xbf4fbc[_0x31a422[_0x1f0bb4]];}_0x4fb44a+=_0x4a9da6[_0x9699('0x58')];_0x4fb44a=_0x19849d[_0x9699('0x60')](_0x9699('0x61'))[_0x9699('0x16')](_0x4fb44a)[_0x9699('0x62')]('hex');if(_0x442b54!==''){_0x442b54+='&';}_0x442b54+=_0x9699('0x63')+_0x4fb44a;var _0x4bc7c8={'method':_0x9699('0x31'),'uri':_0x4a9da6[_0x9699('0x51')]+'/external/get/send.php?'+_0x442b54,'json':!![]};return rp(_0x4bc7c8)[_0x9699('0x15')](function(_0x2add61){var _0x5fdf9e=Object['keys'](_0x2add61);if(_0x2add61[_0x5fdf9e[0x0]][_0x9699('0x18')]&&parseInt(_0x2add61[_0x5fdf9e[0x0]][_0x9699('0x18')])===0x0){var _0x3e8a6f={'messageId':_0x2add61[_0x5fdf9e[0x0]][_0x9699('0x64')]};if(!_0x4a9da6[_0x9699('0x35')]){_0x3e8a6f[_0x9699('0x36')]=!![];}return _0x838ae['update'](_0x3e8a6f);}else{return logger[_0x9699('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9699('0x27'),_0x9699('0x56'),util['inspect'](_0x2add61[_0x9699('0x18')],{'showHidden':![],'depth':null}));}})[_0x9699('0x17')](function(_0xa0555e){return logger['error'](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x56'),util['inspect'](_0xa0555e,{'showHidden':![],'depth':null}));});}else{logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x56'),'Missing\x20parameters:\x20apiKey');}break;case _0x9699('0x65'):if(_0x4a9da6[_0x9699('0x58')]){var _0x6498bc={'method':'POST','uri':_0x9699('0x66'),'headers':{'Authorization':_0x4a9da6[_0x9699('0x58')]},'body':{'content':_0xc0737f[_0x9699('0x22')],'to':[_0xc0737f['phone']],'from':_0x4a9da6[_0x9699('0x1f')],'binary':![],'clientMessageId':'uuid','charset':_0x9699('0x67')},'json':!![]};rp(_0x6498bc)[_0x9699('0x15')](function(_0x442aa0){if(!_0x442aa0[_0x9699('0x18')]){var _0x13f457={'messageId':_0x442aa0[_0x9699('0x47')][0x0][_0x9699('0x68')]};if(!_0x4a9da6[_0x9699('0x35')]){_0x13f457[_0x9699('0x36')]=!![];}return _0x838ae[_0x9699('0x16')](_0x13f457);}else{return logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),'clickatell',util[_0x9699('0x28')](_0x442aa0[_0x9699('0x18')],{'showHidden':![],'depth':null}));}})[_0x9699('0x17')](function(_0x2a332f){return logger[_0x9699('0x18')](_0x9699('0x29'),'afterCreate',_0x9699('0x65'),util[_0x9699('0x28')](_0x2a332f,{'showHidden':![],'depth':null}));});}else{logger[_0x9699('0x18')](_0x9699('0x29'),'afterCreate',_0x9699('0x65'),_0x9699('0x69'));}break;case'bandwidth':if(_0x4a9da6['username']&&_0x4a9da6['password']){var _0x4198c0=util[_0x9699('0x3e')](_0x9699('0x3f'),_0x4a9da6['username'],_0x4a9da6['password']);var _0x3d2b90={'method':_0x9699('0x39'),'uri':_0x9699('0x6a')+_0x4a9da6['accountId']+_0x9699('0x6b'),'body':{'to':[_0xc0737f[_0x9699('0x1f')]],'text':_0xc0737f[_0x9699('0x22')],'from':_0x4a9da6[_0x9699('0x1f')],'applicationId':_0x4a9da6[_0x9699('0x6c')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x4198c0)[_0x9699('0x42')](_0x9699('0x43')))},'json':!![]};rp(_0x3d2b90)[_0x9699('0x15')](function(_0x25b784){if(_0x25b784['id']){var _0x3a1de3={'messageId':_0x25b784['id']};return _0x838ae[_0x9699('0x16')](_0x3a1de3);}else{logger['error'](_0x9699('0x29'),'afterCreate',_0x9699('0x6d'),util[_0x9699('0x28')](_0x25b784,{'showHidden':![],'depth':null}));}})['catch'](function(_0x26a730){logger['error'](_0x9699('0x29'),'afterCreate','bandwidth',util[_0x9699('0x28')](_0x26a730,{'showHidden':![],'depth':null}));});}else{logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x6d'),_0x9699('0x49'));}break;case'intelepeer':if(_0x4a9da6[_0x9699('0x58')]){var _0x4739c0={};var _0x4bc7c8={'method':'POST','uri':_0x9699('0x6e'),'headers':{'Authorization':'Bearer\x20'+_0x4a9da6[_0x9699('0x58')],'Content-Type':_0x9699('0x6f')},'body':{'from':_0x4a9da6[_0x9699('0x1f')],'to':_0xc0737f[_0x9699('0x1f')],'text':_0xc0737f[_0x9699('0x22')]},'json':!![]};return rp(_0x4bc7c8)[_0x9699('0x15')](function(_0x2d65a5){if(_0x2d65a5[_0x9699('0x70')]==0xca){_0x4739c0[_0x9699('0x71')]=_0x2d65a5;var _0x5633b8={'method':_0x9699('0x39'),'uri':_0x9699('0x72'),'headers':{'Authorization':_0x9699('0x73')+_0x4a9da6[_0x9699('0x58')],'Content-Type':_0x9699('0x6f')},'body':{'refid':_0x4739c0['message']['refid']},'json':!![]};return rp(_0x5633b8)[_0x9699('0x15')](function(_0x192062){_0x4739c0[_0x9699('0x74')]=_0x192062;var _0x4fddf9={'messageId':_0x4739c0[_0x9699('0x71')][_0x9699('0x75')],'read':!![]};return _0x838ae[_0x9699('0x16')](_0x4fddf9);});}else{return logger[_0x9699('0x18')](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x76'),util['inspect'](_0x2d65a5,{'showHidden':![],'depth':null}));}})[_0x9699('0x17')](function(_0x589b06){return logger[_0x9699('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x9699('0x76'),util[_0x9699('0x28')](_0x589b06,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x9699('0x29'),_0x9699('0x27'),_0x9699('0x76'),_0x9699('0x77'));}break;}}})['finally'](function(){_0x4a480f();});}else{_0x4a480f();}}},'charset':_0x9699('0x78'),'collate':_0x9699('0x79')});}; \ No newline at end of file +var _0x3489=['deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','clickSend','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','sort','length','createHash','hex','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','bandwidth','/messages','applicationId','intelepeer','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','message','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','update','out','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','catch','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id'];(function(_0xeea930,_0x5433c9){var _0x3eab89=function(_0x1a8fc6){while(--_0x1a8fc6){_0xeea930['push'](_0xeea930['shift']());}};_0x3eab89(++_0x5433c9);}(_0x3489,0x1ac));var _0x9348=function(_0x488a47,_0x21d367){_0x488a47=_0x488a47-0x0;var _0x120fe0=_0x3489[_0x488a47];return _0x120fe0;};'use strict';var _=require('lodash');var util=require(_0x9348('0x0'));var logger=require('../../config/logger')(_0x9348('0x1'));var moment=require('moment');var BPromise=require(_0x9348('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9348('0x3'));var rimraf=require(_0x9348('0x4'));var config=require(_0x9348('0x5'));var attributes=require(_0x9348('0x6'));module['exports']=function(_0x2a1e5b,_0x13d914){return _0x2a1e5b['define']('SmsMessage',attributes,{'tableName':_0x9348('0x7'),'paranoid':![],'indexes':[{'name':_0x9348('0x8'),'fields':[_0x9348('0x8')]},{'name':_0x9348('0x9'),'fields':[_0x9348('0xa')],'type':_0x9348('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x416542,_0x187f86,_0x478912){var _0x44eba7=_0x2a1e5b[_0x9348('0xc')];var _0x24e4f6=_0x416542[_0x9348('0xd')]({'plain':!![]});if(_0x24e4f6[_0x9348('0xe')][_0x9348('0xf')]()==='in'||_0x24e4f6[_0x9348('0xe')]['toLowerCase']()==='out'&&!_0x24e4f6[_0x9348('0x10')]&&!_[_0x9348('0x11')](_0x24e4f6[_0x9348('0x12')])){_0x44eba7[_0x9348('0x13')][_0x9348('0x14')]({'where':{'id':_0x24e4f6[_0x9348('0x15')]}})['then'](function(_0x414ce3){if(_0x414ce3){_0x414ce3[_0x9348('0x16')]({'lastMsgAt':_0x24e4f6['createdAt'],'lastMsgDirection':_0x24e4f6[_0x9348('0xe')]['toLowerCase']()});}})['catch'](function(_0x9ea209){console['error'](_0x9ea209);});}if(_0x24e4f6[_0x9348('0xe')]===_0x9348('0x17')&&!_0x24e4f6['secret']){var _0x3b4c48;_0x44eba7[_0x9348('0x18')][_0x9348('0x19')]({'where':{'id':_0x24e4f6[_0x9348('0x1a')]},'raw':!![]})[_0x9348('0x1b')](function(_0x5df2b1){_0x3b4c48=_0x5df2b1;if(_0x3b4c48&&_0x3b4c48[_0x9348('0x1c')]){switch(_0x3b4c48[_0x9348('0x1c')]){case'twilio':var _0x348ee4=require(_0x9348('0x1d'));if(_0x3b4c48[_0x9348('0x1e')]&&_0x3b4c48[_0x9348('0x1f')]&&_0x3b4c48['phone']){var _0x1ac977=new _0x348ee4(_0x3b4c48[_0x9348('0x1e')],_0x3b4c48[_0x9348('0x1f')]);_0x1ac977[_0x9348('0x20')][_0x9348('0x21')]({'body':_0x24e4f6[_0x9348('0xa')],'to':_0x24e4f6[_0x9348('0x22')],'from':_0x3b4c48[_0x9348('0x22')],'statusCallback':_0x3b4c48[_0x9348('0x23')]+_0x9348('0x24')+_0x24e4f6['id']+_0x9348('0x25')+_0x3b4c48[_0x9348('0x26')]})['then'](function(_0x6c4a18){if(_0x6c4a18[_0x9348('0x27')]){return _0x416542[_0x9348('0x16')]({'messageId':_0x6c4a18[_0x9348('0x27')]});}})[_0x9348('0x28')](function(_0x3d77e4){logger[_0x9348('0x29')](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x1d'),util[_0x9348('0x2c')](_0x3d77e4,{'showHidden':![],'depth':null}));});}else{logger[_0x9348('0x29')](_0x9348('0x2a'),_0x9348('0x2b'),'twilio',_0x9348('0x2d'));}break;case'skebby':var _0x53ed55=_0x9348('0x2e');if(_0x3b4c48[_0x9348('0x2f')]&&_0x3b4c48[_0x9348('0x30')]){var _0x4ac2fc={'recipient':[_0x24e4f6['phone']],'message':_0x24e4f6[_0x9348('0xa')],'message_type':_0x3b4c48['smsMethod']};if(_0x3b4c48[_0x9348('0x31')]&&_0x3b4c48[_0x9348('0x31')]!=='SI'){_0x4ac2fc[_0x9348('0x32')]=_0x3b4c48['phone'];}var _0x29a8da={'url':_0x53ed55+_0x9348('0x33')+_0x3b4c48[_0x9348('0x2f')]+'&password='+_0x3b4c48[_0x9348('0x30')],'method':_0x9348('0x34')};rp(_0x29a8da)[_0x9348('0x1b')](function(_0x300e88){var _0x5da137=_0x300e88[_0x9348('0x35')](';');var _0x4bca73={'user_key':_0x5da137[0x0],'session_key':_0x5da137[0x1]};_0x29a8da={'url':_0x53ed55+_0x9348('0x36'),'method':_0x9348('0x37'),'headers':{'user_key':_0x4bca73[_0x9348('0x38')],'Session_key':_0x4bca73[_0x9348('0x39')]},'json':!![],'body':_0x4ac2fc};return rp(_0x29a8da);})['then'](function(_0x1c3825){if(_0x1c3825[_0x9348('0x3a')]>=0x1){var _0x877237={'messageId':_0x1c3825[_0x9348('0x3b')]};if(_0x3b4c48[_0x9348('0x31')]!=='GP'||!_0x3b4c48[_0x9348('0x3c')]){_0x877237[_0x9348('0x3d')]=!![];}return _0x416542[_0x9348('0x16')](_0x877237);}else{return logger[_0x9348('0x29')](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x3e'),util[_0x9348('0x2c')](_0x1c3825,{'showHidden':![],'depth':null}));}})[_0x9348('0x28')](function(_0x34bb5a){return logger[_0x9348('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9348('0x2b'),_0x9348('0x3e'),util[_0x9348('0x2c')](_0x34bb5a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9348('0x2a'),_0x9348('0x2b'),'skebby',_0x9348('0x3f'));}break;case _0x9348('0x40'):if(_0x3b4c48[_0x9348('0x1f')]){var _0x182bf2={'recipient':_0x24e4f6['phone'],'message':_0x24e4f6[_0x9348('0xa')],'sender':_0x3b4c48[_0x9348('0x41')]||_0x3b4c48[_0x9348('0x22')],'authorization':_0x3b4c48[_0x9348('0x1f')]};var _0x187f86={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x182bf2,'json':!![]};rp(_0x187f86)[_0x9348('0x1b')](function(_0x46a7c9){var _0x5deef9={'messageId':_0x46a7c9[_0x9348('0x42')]};if(!_0x3b4c48[_0x9348('0x3c')]){_0x5deef9[_0x9348('0x3d')]=!![];}return _0x416542[_0x9348('0x16')](_0x5deef9);})[_0x9348('0x28')](function(_0x250eeb){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x9348('0x40'),util[_0x9348('0x2c')](_0x250eeb,{'showHidden':![],'depth':null}));});}else{logger[_0x9348('0x29')](_0x9348('0x2a'),'afterCreate',_0x9348('0x40'),_0x9348('0x43'));}break;case _0x9348('0x44'):if(_0x3b4c48[_0x9348('0x2f')]&&_0x3b4c48[_0x9348('0x30')]){var _0x182bf2={'messages':[{'source':_0x9348('0x45'),'to':_0x24e4f6[_0x9348('0x22')],'body':_0x24e4f6['body'],'from':_0x3b4c48[_0x9348('0x41')]||_0x3b4c48[_0x9348('0x22')]}]};var _0x3295fc=util[_0x9348('0x46')]('%s:%s',_0x3b4c48[_0x9348('0x2f')],_0x3b4c48['password']);var _0x187f86={'method':_0x9348('0x37'),'uri':_0x9348('0x47'),'body':_0x182bf2,'headers':{'Authorization':util['format'](_0x9348('0x48'),new Buffer(_0x3295fc)[_0x9348('0x49')](_0x9348('0x4a')))},'json':!![]};rp(_0x187f86)[_0x9348('0x1b')](function(_0x1523c5){if(_0x1523c5[_0x9348('0x4b')]>=0xc8&&_0x1523c5[_0x9348('0x4b')]<=0xce){if(_0x1523c5['data']&&_0x1523c5['data']['queued_count']>0x0){var _0xe2ccda=_['head'](_0x1523c5[_0x9348('0x4c')][_0x9348('0x20')]);var _0x18a5ed={'messageId':_0xe2ccda['message_id']};if(!_0x3b4c48['deliveryReport']){_0x18a5ed[_0x9348('0x3d')]=!![];}return _0x416542['update'](_0x18a5ed);}else{logger[_0x9348('0x29')](_0x9348('0x2a'),_0x9348('0x2b'),'clickSend',util[_0x9348('0x2c')](_0x1523c5,{'showHidden':![],'depth':null}));}}else{logger[_0x9348('0x29')](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x4d'),util[_0x9348('0x2c')](_0x1523c5,{'showHidden':![],'depth':null}));}})[_0x9348('0x28')](function(_0x439d9f){logger[_0x9348('0x29')](_0x9348('0x2a'),_0x9348('0x2b'),'clickSend',util['inspect'](_0x439d9f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x4d'),_0x9348('0x3f'));}break;case'plivo':if(_0x3b4c48[_0x9348('0x4e')]&&_0x3b4c48['authToken']){var _0x182bf2={'dst':_0x24e4f6[_0x9348('0x22')],'text':_0x24e4f6[_0x9348('0xa')],'src':_0x3b4c48[_0x9348('0x41')]||_0x3b4c48[_0x9348('0x22')],'url':_0x3b4c48['remote']+_0x9348('0x24')+_0x24e4f6['id']+_0x9348('0x25')+_0x3b4c48[_0x9348('0x26')]};var _0x3295fc=util['format'](_0x9348('0x4f'),_0x3b4c48[_0x9348('0x4e')],_0x3b4c48['authToken']);var _0x187f86={'method':_0x9348('0x37'),'uri':util[_0x9348('0x46')](_0x9348('0x50'),_0x3b4c48[_0x9348('0x4e')]),'body':_0x182bf2,'headers':{'Authorization':util['format'](_0x9348('0x48'),new Buffer(_0x3295fc)['toString'](_0x9348('0x4a')))},'json':!![]};rp(_0x187f86)[_0x9348('0x1b')](function(_0xa8f9fc){var _0x1651b4={'messageId':_0xa8f9fc[_0x9348('0x51')][0x0]};return _0x416542[_0x9348('0x16')](_0x1651b4);})['catch'](function(_0x556222){logger['error'](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x52'),util['inspect'](_0x556222,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x52'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x9348('0x53'):if(_0x3b4c48['username']&&_0x3b4c48[_0x9348('0x30')]){if(_0x3b4c48[_0x9348('0x54')]){var _0x3edd74={'method':'POST','uri':_0x3b4c48[_0x9348('0x54')]+_0x9348('0x55'),'body':{'username':_0x3b4c48['username'],'password':_0x3b4c48[_0x9348('0x30')]},'json':!![]};return rp(_0x3edd74)[_0x9348('0x1b')](function(_0x2962c0){var _0x663d79={'method':_0x9348('0x37'),'uri':_0x3b4c48[_0x9348('0x54')]+_0x9348('0x56'),'body':{'messages':[{'from':_0x3b4c48[_0x9348('0x22')],'destinations':[{'to':_0x24e4f6[_0x9348('0x22')]}],'text':_0x24e4f6[_0x9348('0xa')],'notifyUrl':_0x3b4c48[_0x9348('0x23')]+_0x9348('0x24')+_0x24e4f6['id']+_0x9348('0x25')+_0x3b4c48[_0x9348('0x26')],'notifyContentType':_0x9348('0x57'),'callbackData':_0x3b4c48['phone']+';'+_0x24e4f6['body']}]},'headers':{'Authorization':_0x9348('0x58')+_0x2962c0[_0x9348('0x26')]},'json':!![]};return rp(_0x663d79)[_0x9348('0x1b')](function(_0x2976f4){if(_0x2976f4[_0x9348('0x20')]){var _0x14ba2b={'messageId':_0x2976f4[_0x9348('0x20')][0x0]['messageId']};if(!_0x3b4c48[_0x9348('0x3c')]){_0x14ba2b['read']=!![];}return _0x416542['update'](_0x14ba2b);}else{return logger[_0x9348('0x29')](_0x9348('0x2a'),'afterCreate',_0x9348('0x53'),util[_0x9348('0x2c')](_0x2976f4,{'showHidden':![],'depth':null}));}});})[_0x9348('0x28')](function(_0x44ab46){return logger[_0x9348('0x29')](_0x9348('0x2a'),_0x9348('0x2b'),'infobip',util[_0x9348('0x2c')](_0x44ab46,{'showHidden':![],'depth':null}));});}else{logger[_0x9348('0x29')](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x53'),_0x9348('0x59'));}}else{logger[_0x9348('0x29')](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x53'),_0x9348('0x3f'));}break;case _0x9348('0x5a'):var _0x24a5fa=require(_0x9348('0x5b'));if(_0x3b4c48[_0x9348('0x5c')]){var _0x27168e={};_0x27168e[_0x9348('0x5d')]=_0x3b4c48[_0x9348('0x2f')];_0x27168e['phone']=_0x24e4f6[_0x9348('0x22')];_0x27168e['sender']=_0x3b4c48[_0x9348('0x22')];_0x27168e['text']=_0x24e4f6['body'];_0x27168e[_0x9348('0x5e')]=+new Date();var _0x52fd68='';var _0x47965c='';var _0x59847c=Object['keys'](_0x27168e);_0x59847c[_0x9348('0x5f')]();for(var _0x467b21=0x0;_0x467b21<_0x59847c[_0x9348('0x60')];_0x467b21++){if(_0x52fd68!=''){_0x52fd68+='&';}_0x52fd68+=_0x59847c[_0x467b21]+'='+encodeURIComponent(_0x27168e[_0x59847c[_0x467b21]]);_0x47965c+=_0x27168e[_0x59847c[_0x467b21]];}_0x47965c+=_0x3b4c48[_0x9348('0x5c')];_0x47965c=_0x24a5fa[_0x9348('0x61')]('md5')[_0x9348('0x16')](_0x47965c)['digest'](_0x9348('0x62'));if(_0x52fd68!==''){_0x52fd68+='&';}_0x52fd68+=_0x9348('0x63')+_0x47965c;var _0x29a8da={'method':_0x9348('0x34'),'uri':_0x3b4c48[_0x9348('0x54')]+_0x9348('0x64')+_0x52fd68,'json':!![]};return rp(_0x29a8da)[_0x9348('0x1b')](function(_0x516adf){var _0x13a735=Object[_0x9348('0x65')](_0x516adf);if(_0x516adf[_0x13a735[0x0]]['error']&&parseInt(_0x516adf[_0x13a735[0x0]][_0x9348('0x29')])===0x0){var _0x69a92e={'messageId':_0x516adf[_0x13a735[0x0]][_0x9348('0x66')]};if(!_0x3b4c48[_0x9348('0x3c')]){_0x69a92e['read']=!![];}return _0x416542[_0x9348('0x16')](_0x69a92e);}else{return logger[_0x9348('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9348('0x2b'),_0x9348('0x5a'),util[_0x9348('0x2c')](_0x516adf['error'],{'showHidden':![],'depth':null}));}})[_0x9348('0x28')](function(_0x18a674){return logger[_0x9348('0x29')](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x5a'),util['inspect'](_0x18a674,{'showHidden':![],'depth':null}));});}else{logger[_0x9348('0x29')](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x5a'),_0x9348('0x67'));}break;case _0x9348('0x68'):if(_0x3b4c48[_0x9348('0x5c')]){var _0x2171e1={'method':_0x9348('0x37'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3b4c48[_0x9348('0x5c')]},'body':{'content':_0x24e4f6[_0x9348('0xa')],'to':[_0x24e4f6[_0x9348('0x22')]],'from':_0x3b4c48[_0x9348('0x22')],'binary':![],'clientMessageId':_0x9348('0x69'),'charset':_0x9348('0x6a')},'json':!![]};rp(_0x2171e1)[_0x9348('0x1b')](function(_0x22c581){if(!_0x22c581[_0x9348('0x29')]){var _0xcaea87={'messageId':_0x22c581['messages'][0x0][_0x9348('0x6b')]};if(!_0x3b4c48[_0x9348('0x3c')]){_0xcaea87[_0x9348('0x3d')]=!![];}return _0x416542[_0x9348('0x16')](_0xcaea87);}else{return logger[_0x9348('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9348('0x2b'),_0x9348('0x68'),util['inspect'](_0x22c581['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x34d91b){return logger[_0x9348('0x29')](_0x9348('0x2a'),'afterCreate',_0x9348('0x68'),util['inspect'](_0x34d91b,{'showHidden':![],'depth':null}));});}else{logger[_0x9348('0x29')](_0x9348('0x2a'),'afterCreate',_0x9348('0x68'),_0x9348('0x67'));}break;case _0x9348('0x6c'):if(_0x3b4c48[_0x9348('0x2f')]&&_0x3b4c48['password']){var _0x3295fc=util[_0x9348('0x46')](_0x9348('0x4f'),_0x3b4c48[_0x9348('0x2f')],_0x3b4c48[_0x9348('0x30')]);var _0x187f86={'method':_0x9348('0x37'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x3b4c48['accountId']+_0x9348('0x6d'),'body':{'to':[_0x24e4f6[_0x9348('0x22')]],'text':_0x24e4f6[_0x9348('0xa')],'from':_0x3b4c48['phone'],'applicationId':_0x3b4c48[_0x9348('0x6e')]},'headers':{'Authorization':util['format'](_0x9348('0x48'),new Buffer(_0x3295fc)[_0x9348('0x49')]('base64'))},'json':!![]};rp(_0x187f86)[_0x9348('0x1b')](function(_0x4a5dc0){if(_0x4a5dc0['id']){var _0x339e34={'messageId':_0x4a5dc0['id']};return _0x416542[_0x9348('0x16')](_0x339e34);}else{logger['error'](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x6c'),util['inspect'](_0x4a5dc0,{'showHidden':![],'depth':null}));}})[_0x9348('0x28')](function(_0x3c5905){logger['error'](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x6c'),util['inspect'](_0x3c5905,{'showHidden':![],'depth':null}));});}else{logger[_0x9348('0x29')](_0x9348('0x2a'),'afterCreate',_0x9348('0x6c'),_0x9348('0x3f'));}break;case _0x9348('0x6f'):if(_0x3b4c48[_0x9348('0x5c')]){var _0x533d7e={};var _0x29a8da={'method':_0x9348('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x3b4c48[_0x9348('0x5c')],'Content-Type':_0x9348('0x57')},'body':{'from':_0x3b4c48[_0x9348('0x22')],'to':_0x24e4f6[_0x9348('0x22')],'text':_0x24e4f6[_0x9348('0xa')]},'json':!![]};return rp(_0x29a8da)[_0x9348('0x1b')](function(_0x1c05e3){if(_0x1c05e3[_0x9348('0x70')]==0xca){_0x533d7e['message']=_0x1c05e3;var _0x33cc2c={'method':_0x9348('0x37'),'uri':_0x9348('0x71'),'headers':{'Authorization':_0x9348('0x72')+_0x3b4c48[_0x9348('0x5c')],'Content-Type':_0x9348('0x57')},'body':{'refid':_0x533d7e[_0x9348('0x73')][_0x9348('0x74')]},'json':!![]};return rp(_0x33cc2c)[_0x9348('0x1b')](function(_0x56559e){_0x533d7e[_0x9348('0x75')]=_0x56559e;var _0x9d1567={'messageId':_0x533d7e['message'][_0x9348('0x74')],'read':!![]};return _0x416542['update'](_0x9d1567);});}else{return logger['error'](_0x9348('0x2a'),'afterCreate',_0x9348('0x6f'),util[_0x9348('0x2c')](_0x1c05e3,{'showHidden':![],'depth':null}));}})[_0x9348('0x28')](function(_0x55e7fd){return logger[_0x9348('0x29')](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x6f'),util['inspect'](_0x55e7fd,{'showHidden':![],'depth':null}));});}else{return logger[_0x9348('0x29')](_0x9348('0x2a'),_0x9348('0x2b'),_0x9348('0x6f'),_0x9348('0x76'));}break;}}})[_0x9348('0x77')](function(){_0x478912();});}else{_0x478912();}}},'charset':_0x9348('0x78'),'collate':_0x9348('0x79')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 6ad2449..14b711d 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 _0x5736=['http','redis','defaults','localhost','./smsMessage.socket','register','then','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','info','result','CreateSmsMessage','create','options','raw','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5736,0x11e));var _0x6573=function(_0x96dae7,_0x48ccdb){_0x96dae7=_0x96dae7-0x0;var _0x45b23f=_0x5736[_0x96dae7];return _0x45b23f;};'use strict';var _=require('lodash');var util=require(_0x6573('0x0'));var moment=require(_0x6573('0x1'));var BPromise=require(_0x6573('0x2'));var rs=require(_0x6573('0x3'));var fs=require('fs');var Redis=require(_0x6573('0x4'));var db=require(_0x6573('0x5'))['db'];var utils=require(_0x6573('0x6'));var logger=require(_0x6573('0x7'))('rpc');var config=require(_0x6573('0x8'));var jayson=require(_0x6573('0x9'));var client=jayson[_0x6573('0xa')][_0x6573('0xb')]({'port':0x232a});config[_0x6573('0xc')]=_[_0x6573('0xd')](config[_0x6573('0xc')],{'host':_0x6573('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6573('0xc')]));require(_0x6573('0xf'))[_0x6573('0x10')](socket);function respondWithRpcPromise(_0x1f433e,_0x7a8999,_0x55da75){return new BPromise(function(_0x641e11,_0x2c9694){return client['request'](_0x1f433e,_0x55da75)[_0x6573('0x11')](function(_0x3bc036){logger['info']('SmsMessage,\x20%s,\x20%s',_0x7a8999,'request\x20sent');logger['debug'](_0x6573('0x12'),_0x7a8999,_0x6573('0x13'),JSON[_0x6573('0x14')](_0x3bc036));if(_0x3bc036[_0x6573('0x15')]){if(_0x3bc036[_0x6573('0x15')][_0x6573('0x16')]===0x1f4){logger[_0x6573('0x15')](_0x6573('0x17'),_0x7a8999,_0x3bc036['error'][_0x6573('0x18')]);return _0x2c9694(_0x3bc036[_0x6573('0x15')][_0x6573('0x18')]);}logger['error'](_0x6573('0x17'),_0x7a8999,_0x3bc036[_0x6573('0x15')][_0x6573('0x18')]);return _0x641e11(_0x3bc036[_0x6573('0x15')][_0x6573('0x18')]);}else{logger[_0x6573('0x19')](_0x6573('0x17'),_0x7a8999,'request\x20sent');_0x641e11(_0x3bc036[_0x6573('0x1a')][_0x6573('0x18')]);}})['catch'](function(_0x502c9b){logger[_0x6573('0x15')](_0x6573('0x17'),_0x7a8999,_0x502c9b);_0x2c9694(_0x502c9b);});});}exports[_0x6573('0x1b')]=function(_0x47d1ff){var _0xff4034=this;return new Promise(function(_0x6d7adc,_0x2ca61a){return db['SmsMessage'][_0x6573('0x1c')](_0x47d1ff['body'],{'raw':_0x47d1ff[_0x6573('0x1d')]?_0x47d1ff[_0x6573('0x1d')][_0x6573('0x1e')]===undefined?!![]:![]:!![]})[_0x6573('0x11')](function(_0x15a0a0){logger['info'](_0x6573('0x1b'),_0x47d1ff);logger[_0x6573('0x1f')]('CreateSmsMessage',_0x47d1ff,JSON['stringify'](_0x15a0a0));_0x6d7adc(_0x15a0a0);})[_0x6573('0x20')](function(_0x468003){logger[_0x6573('0x15')](_0x6573('0x1b'),_0x468003[_0x6573('0x18')],_0x47d1ff);_0x2ca61a(_0xff4034['error'](0x1f4,_0x468003[_0x6573('0x18')]));});});}; \ No newline at end of file +var _0x18b4=['stringify','error','code','message','catch','CreateSmsMessage','SmsMessage','create','body','options','util','moment','randomstring','ioredis','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x449a4a,_0x34fcf8){var _0x49dca3=function(_0x261d82){while(--_0x261d82){_0x449a4a['push'](_0x449a4a['shift']());}};_0x49dca3(++_0x34fcf8);}(_0x18b4,0x12c));var _0x418b=function(_0x1d0b4c,_0x2ef766){_0x1d0b4c=_0x1d0b4c-0x0;var _0x57a6f4=_0x18b4[_0x1d0b4c];return _0x57a6f4;};'use strict';var _=require('lodash');var util=require(_0x418b('0x0'));var moment=require(_0x418b('0x1'));var BPromise=require('bluebird');var rs=require(_0x418b('0x2'));var fs=require('fs');var Redis=require(_0x418b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x418b('0x4'));var config=require(_0x418b('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x418b('0x6')]({'port':0x232a});config[_0x418b('0x7')]=_[_0x418b('0x8')](config[_0x418b('0x7')],{'host':_0x418b('0x9'),'port':0x18eb});var socket=require(_0x418b('0xa'))(new Redis(config[_0x418b('0x7')]));require(_0x418b('0xb'))[_0x418b('0xc')](socket);function respondWithRpcPromise(_0x2f9df7,_0x56cc03,_0x29a1e2){return new BPromise(function(_0x1ec678,_0x424886){return client['request'](_0x2f9df7,_0x29a1e2)[_0x418b('0xd')](function(_0x5ba1ab){logger[_0x418b('0xe')](_0x418b('0xf'),_0x56cc03,_0x418b('0x10'));logger[_0x418b('0x11')](_0x418b('0x12'),_0x56cc03,_0x418b('0x10'),JSON[_0x418b('0x13')](_0x5ba1ab));if(_0x5ba1ab[_0x418b('0x14')]){if(_0x5ba1ab['error'][_0x418b('0x15')]===0x1f4){logger['error'](_0x418b('0xf'),_0x56cc03,_0x5ba1ab[_0x418b('0x14')]['message']);return _0x424886(_0x5ba1ab[_0x418b('0x14')][_0x418b('0x16')]);}logger[_0x418b('0x14')](_0x418b('0xf'),_0x56cc03,_0x5ba1ab[_0x418b('0x14')][_0x418b('0x16')]);return _0x1ec678(_0x5ba1ab['error'][_0x418b('0x16')]);}else{logger[_0x418b('0xe')](_0x418b('0xf'),_0x56cc03,_0x418b('0x10'));_0x1ec678(_0x5ba1ab['result']['message']);}})[_0x418b('0x17')](function(_0x436dba){logger[_0x418b('0x14')](_0x418b('0xf'),_0x56cc03,_0x436dba);_0x424886(_0x436dba);});});}exports[_0x418b('0x18')]=function(_0x56db48){var _0x326c95=this;return new Promise(function(_0x3b1f25,_0x21fe81){return db[_0x418b('0x19')][_0x418b('0x1a')](_0x56db48[_0x418b('0x1b')],{'raw':_0x56db48['options']?_0x56db48[_0x418b('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x418b('0xd')](function(_0x24b5e6){logger[_0x418b('0xe')](_0x418b('0x18'),_0x56db48);logger[_0x418b('0x11')]('CreateSmsMessage',_0x56db48,JSON[_0x418b('0x13')](_0x24b5e6));_0x3b1f25(_0x24b5e6);})[_0x418b('0x17')](function(_0x115c9f){logger[_0x418b('0x14')](_0x418b('0x18'),_0x115c9f[_0x418b('0x16')],_0x56db48);_0x21fe81(_0x326c95[_0x418b('0x14')](0x1f4,_0x115c9f[_0x418b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d9aaa57..e3b9d2d 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 _0x8a23=['remove','removeListener','register','length','save'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x8a23,0x1b2));var _0x38a2=function(_0x2ef8c1,_0x2f72f4){_0x2ef8c1=_0x2ef8c1-0x0;var _0x288305=_0x8a23[_0x2ef8c1];return _0x288305;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x38a2('0x0'),_0x38a2('0x1'),'update'];function createListener(_0x368eab,_0x528aea){return function(_0x19a0b5){_0x528aea['emit'](_0x368eab,_0x19a0b5);};}function removeListener(_0x5995d3,_0x2730ee){return function(){SmsMessageEvents[_0x38a2('0x2')](_0x5995d3,_0x2730ee);};}exports[_0x38a2('0x3')]=function(_0x2f9740){for(var _0x3283e8=0x0,_0x571127=events[_0x38a2('0x4')];_0x3283e8<_0x571127;_0x3283e8++){var _0x6ef221=events[_0x3283e8];var _0x3d0505=createListener('smsMessage:'+_0x6ef221,_0x2f9740);SmsMessageEvents['on'](_0x6ef221,_0x3d0505);}}; \ No newline at end of file +var _0x62ac=['update','emit','removeListener','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x4eeca3,_0x12a5de){var _0x23a397=function(_0x1cf25d){while(--_0x1cf25d){_0x4eeca3['push'](_0x4eeca3['shift']());}};_0x23a397(++_0x12a5de);}(_0x62ac,0x1c8));var _0xc62a=function(_0x3df186,_0x12592c){_0x3df186=_0x3df186-0x0;var _0x5440fc=_0x62ac[_0x3df186];return _0x5440fc;};'use strict';var SmsMessageEvents=require(_0xc62a('0x0'));var events=[_0xc62a('0x1'),_0xc62a('0x2'),_0xc62a('0x3')];function createListener(_0x531d52,_0xec325d){return function(_0x19dd58){_0xec325d[_0xc62a('0x4')](_0x531d52,_0x19dd58);};}function removeListener(_0xddf32d,_0x69070){return function(){SmsMessageEvents[_0xc62a('0x5')](_0xddf32d,_0x69070);};}exports[_0xc62a('0x6')]=function(_0x299b23){for(var _0x1ddb87=0x0,_0x1518a5=events[_0xc62a('0x7')];_0x1ddb87<_0x1518a5;_0x1ddb87++){var _0x215bd7=events[_0x1ddb87];var _0x5ca070=createListener(_0xc62a('0x8')+_0x215bd7,_0x299b23);SmsMessageEvents['on'](_0x215bd7,_0x5ca070);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 4568070..0790443 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 _0x6f9a=['isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','destroy','removeTeams','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./smsQueue.controller','get','index'];(function(_0x3e208a,_0x324b09){var _0x33a065=function(_0x499018){while(--_0x499018){_0x3e208a['push'](_0x3e208a['shift']());}};_0x33a065(++_0x324b09);}(_0x6f9a,0x147));var _0xa6f9=function(_0x4e15f8,_0x3044d6){_0x4e15f8=_0x4e15f8-0x0;var _0x18db20=_0x6f9a[_0x4e15f8];return _0x18db20;};'use strict';var multer=require('multer');var util=require(_0xa6f9('0x0'));var path=require(_0xa6f9('0x1'));var timeout=require(_0xa6f9('0x2'));var express=require(_0xa6f9('0x3'));var router=express[_0xa6f9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa6f9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa6f9('0x6'));router[_0xa6f9('0x7')]('/',auth['isAuthenticated'](),controller[_0xa6f9('0x8')]);router[_0xa6f9('0x7')]('/describe',auth[_0xa6f9('0x9')](),controller[_0xa6f9('0xa')]);router[_0xa6f9('0x7')](_0xa6f9('0xb'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0xc')]);router[_0xa6f9('0x7')](_0xa6f9('0xd'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0xe')]);router[_0xa6f9('0x7')](_0xa6f9('0xf'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0x10')]);router[_0xa6f9('0x7')](_0xa6f9('0x11'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0x12')]);router[_0xa6f9('0x13')]('/',auth[_0xa6f9('0x9')](),controller[_0xa6f9('0x14')]);router[_0xa6f9('0x13')](_0xa6f9('0xf'),auth['isAuthenticated'](),controller[_0xa6f9('0x15')]);router[_0xa6f9('0x13')](_0xa6f9('0x11'),auth[_0xa6f9('0x9')](),controller['addAgents']);router[_0xa6f9('0x16')](_0xa6f9('0xb'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0x17')]);router[_0xa6f9('0x18')](_0xa6f9('0xb'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0x19')]);router['delete'](_0xa6f9('0xf'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0x1a')]);router['delete'](_0xa6f9('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xa6f9('0x1b')]=router; \ No newline at end of file +var _0x141c=['/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers'];(function(_0x3299c7,_0x493783){var _0x32e0e8=function(_0xcc75df){while(--_0xcc75df){_0x3299c7['push'](_0x3299c7['shift']());}};_0x32e0e8(++_0x493783);}(_0x141c,0x143));var _0xc141=function(_0x40175a,_0x531800){_0x40175a=_0x40175a-0x0;var _0x3dd77d=_0x141c[_0x40175a];return _0x3dd77d;};'use strict';var multer=require(_0xc141('0x0'));var util=require(_0xc141('0x1'));var path=require(_0xc141('0x2'));var timeout=require('connect-timeout');var express=require(_0xc141('0x3'));var router=express[_0xc141('0x4')]();var fs_extra=require(_0xc141('0x5'));var auth=require(_0xc141('0x6'));var interaction=require(_0xc141('0x7'));var config=require(_0xc141('0x8'));var controller=require(_0xc141('0x9'));router[_0xc141('0xa')]('/',auth[_0xc141('0xb')](),controller[_0xc141('0xc')]);router[_0xc141('0xa')](_0xc141('0xd'),auth['isAuthenticated'](),controller[_0xc141('0xe')]);router[_0xc141('0xa')]('/:id',auth[_0xc141('0xb')](),controller[_0xc141('0xf')]);router[_0xc141('0xa')](_0xc141('0x10'),auth[_0xc141('0xb')](),controller[_0xc141('0x11')]);router['get'](_0xc141('0x12'),auth['isAuthenticated'](),controller[_0xc141('0x13')]);router['get'](_0xc141('0x14'),auth['isAuthenticated'](),controller[_0xc141('0x15')]);router['post']('/',auth[_0xc141('0xb')](),controller[_0xc141('0x16')]);router[_0xc141('0x17')]('/:id/teams',auth[_0xc141('0xb')](),controller[_0xc141('0x18')]);router[_0xc141('0x17')](_0xc141('0x14'),auth[_0xc141('0xb')](),controller['addAgents']);router[_0xc141('0x19')](_0xc141('0x1a'),auth[_0xc141('0xb')](),controller[_0xc141('0x1b')]);router[_0xc141('0x1c')](_0xc141('0x1a'),auth[_0xc141('0xb')](),controller[_0xc141('0x1d')]);router['delete'](_0xc141('0x12'),auth[_0xc141('0xb')](),controller['removeTeams']);router[_0xc141('0x1c')](_0xc141('0x14'),auth[_0xc141('0xb')](),controller['removeAgents']);module[_0xc141('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 85a608a..07eac88 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 _0xee4d=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x17fe05,_0x527c52){var _0x2a0b42=function(_0xf000ed){while(--_0xf000ed){_0x17fe05['push'](_0x17fe05['shift']());}};_0x2a0b42(++_0x527c52);}(_0xee4d,0x110));var _0xdee4=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xee4d[_0x5a79e2];return _0x266c45;};'use strict';var Sequelize=require(_0xdee4('0x0'));module[_0xdee4('0x1')]={'name':{'type':Sequelize[_0xdee4('0x2')],'unique':_0xdee4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xdee4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdee4('0x5')](_0xdee4('0x6'),_0xdee4('0x7'),_0xdee4('0x8'))}}; \ No newline at end of file +var _0x7a97=['rrmemory','roundrobin','exports','name','INTEGER','ENUM'];(function(_0x11f457,_0x502026){var _0x3e78e9=function(_0x320d11){while(--_0x320d11){_0x11f457['push'](_0x11f457['shift']());}};_0x3e78e9(++_0x502026);}(_0x7a97,0x7a));var _0x77a9=function(_0x57b00b,_0x23d168){_0x57b00b=_0x57b00b-0x0;var _0x4c0d6a=_0x7a97[_0x57b00b];return _0x4c0d6a;};'use strict';var Sequelize=require('sequelize');module[_0x77a9('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x77a9('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x77a9('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x77a9('0x3')](_0x77a9('0x4'),'beepall',_0x77a9('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index d16c2f0..5c07727 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 _0x454d=['SmsQueue','rawAttributes','fieldName','type','model','name','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','merge','User','findAndCountAll','smsPause','updatedAt','createdAt','format','%s/%s','SIP','Team','pick','getTeams','addTeams','ids','interface','Agents','transaction','findOrCreate','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./smsQueue.socket','register','sendStatus','status','end','offset','undefined','count','set','Content-Range','apply','save','update','then','get','SmsQueues','UserProfileResource','destroy','error','stack','send','index','map'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x454d,0xe2));var _0xd454=function(_0x571852,_0x34ae1f){_0x571852=_0x571852-0x0;var _0x1ec365=_0x454d[_0x571852];return _0x1ec365;};'use strict';var emlformat=require(_0xd454('0x0'));var rimraf=require(_0xd454('0x1'));var zipdir=require(_0xd454('0x2'));var jsonpatch=require(_0xd454('0x3'));var rp=require('request-promise');var moment=require(_0xd454('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd454('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xd454('0x6'));var ejs=require(_0xd454('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd454('0x8'));var squel=require(_0xd454('0x9'));var crypto=require(_0xd454('0xa'));var jsforce=require(_0xd454('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd454('0xc'));var authService=require(_0xd454('0xd'));var qs=require(_0xd454('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd454('0xf'))(_0xd454('0x10'));var utils=require(_0xd454('0x11'));var config=require(_0xd454('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xd454('0x13'))['db'];config['redis']=_[_0xd454('0x14')](config[_0xd454('0x15')],{'host':_0xd454('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd454('0x15')]));require(_0xd454('0x17'))[_0xd454('0x18')](socket);function respondWithStatusCode(_0xcee377,_0x5eca44){_0x5eca44=_0x5eca44||0xcc;return function(_0x26ff6e){if(_0x26ff6e){return _0xcee377[_0xd454('0x19')](_0x5eca44);}return _0xcee377[_0xd454('0x1a')](_0x5eca44)[_0xd454('0x1b')]();};}function respondWithResult(_0x1dd487,_0x512c31){_0x512c31=_0x512c31||0xc8;return function(_0x4e380d){if(_0x4e380d){return _0x1dd487[_0xd454('0x1a')](_0x512c31)['json'](_0x4e380d);}};}function respondWithFilteredResult(_0x2fd27f,_0x1fd9d5){return function(_0x1dbc9d){if(_0x1dbc9d){var _0x252df4=typeof _0x1fd9d5[_0xd454('0x1c')]==='undefined'&&typeof _0x1fd9d5['limit']===_0xd454('0x1d');var _0x1a519d=_0x1dbc9d[_0xd454('0x1e')];var _0x4889dd=_0x252df4?0x0:_0x1fd9d5['offset'];var _0x595bd4=_0x252df4?_0x1dbc9d[_0xd454('0x1e')]:_0x1fd9d5['offset']+_0x1fd9d5['limit'];var _0x5b0ea3;if(_0x595bd4>=_0x1a519d){_0x595bd4=_0x1a519d;_0x5b0ea3=0xc8;}else{_0x5b0ea3=0xce;}_0x2fd27f[_0xd454('0x1a')](_0x5b0ea3);return _0x2fd27f[_0xd454('0x1f')](_0xd454('0x20'),_0x4889dd+'-'+_0x595bd4+'/'+_0x1a519d)['json'](_0x1dbc9d);}return null;};}function patchUpdates(_0x12ce55){return function(_0x123454){try{jsonpatch[_0xd454('0x21')](_0x123454,_0x12ce55,!![]);}catch(_0x5a19c8){return BPromise['reject'](_0x5a19c8);}return _0x123454[_0xd454('0x22')]();};}function saveUpdates(_0x50e653,_0x555ac0){return function(_0x368e47){if(_0x368e47){return _0x368e47[_0xd454('0x23')](_0x50e653)[_0xd454('0x24')](function(_0x3f59ae){return _0x3f59ae;});}return null;};}function removeEntity(_0x5c7108,_0x11d521){return function(_0x37c7cd){if(_0x37c7cd){return _0x37c7cd['destroy']()[_0xd454('0x24')](function(){var _0x530888=_0x37c7cd[_0xd454('0x25')]({'plain':!![]});var _0x245294=_0xd454('0x26');return db[_0xd454('0x27')][_0xd454('0x28')]({'where':{'type':_0x245294,'resourceId':_0x530888['id']}})['then'](function(){return _0x37c7cd;});})[_0xd454('0x24')](function(){_0x5c7108[_0xd454('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c62e6,_0x27f435){return function(_0xbc4b8e){if(!_0xbc4b8e){_0x4c62e6['sendStatus'](0x194);}return _0xbc4b8e;};}function handleError(_0x3ed788,_0x39e16d){_0x39e16d=_0x39e16d||0x1f4;return function(_0x585bbc){logger[_0xd454('0x29')](_0x585bbc[_0xd454('0x2a')]);if(_0x585bbc['name']){delete _0x585bbc['name'];}_0x3ed788[_0xd454('0x1a')](_0x39e16d)[_0xd454('0x2b')](_0x585bbc);};}exports[_0xd454('0x2c')]=function(_0x1d5fae,_0x3c0215){var _0x866297={},_0x130a35={},_0x27afb6={'count':0x0,'rows':[]};var _0x446f1b=_[_0xd454('0x2d')](db[_0xd454('0x2e')][_0xd454('0x2f')],function(_0x2cbda9){return{'name':_0x2cbda9[_0xd454('0x30')],'type':_0x2cbda9[_0xd454('0x31')]['key']};});_0x130a35[_0xd454('0x32')]=_['map'](_0x446f1b,_0xd454('0x33'));_0x130a35['query']=_['keys'](_0x1d5fae['query']);_0x130a35['filters']=_[_0xd454('0x34')](_0x130a35[_0xd454('0x32')],_0x130a35['query']);_0x866297[_0xd454('0x35')]=_[_0xd454('0x34')](_0x130a35[_0xd454('0x32')],qs[_0xd454('0x36')](_0x1d5fae[_0xd454('0x37')][_0xd454('0x36')]));_0x866297['attributes']=_0x866297[_0xd454('0x35')][_0xd454('0x38')]?_0x866297[_0xd454('0x35')]:_0x130a35['model'];if(!_0x1d5fae[_0xd454('0x37')][_0xd454('0x39')](_0xd454('0x3a'))){_0x866297[_0xd454('0x3b')]=qs[_0xd454('0x3b')](_0x1d5fae[_0xd454('0x37')][_0xd454('0x3b')]);_0x866297[_0xd454('0x1c')]=qs['offset'](_0x1d5fae[_0xd454('0x37')][_0xd454('0x1c')]);}_0x866297[_0xd454('0x3c')]=qs[_0xd454('0x3d')](_0x1d5fae[_0xd454('0x37')][_0xd454('0x3d')]);_0x866297[_0xd454('0x3e')]=qs[_0xd454('0x3f')](_['pick'](_0x1d5fae[_0xd454('0x37')],_0x130a35[_0xd454('0x3f')]),_0x446f1b);if(_0x1d5fae[_0xd454('0x37')][_0xd454('0x40')]){_0x866297[_0xd454('0x3e')]=_['merge'](_0x866297[_0xd454('0x3e')],{'$or':_['map'](_0x446f1b,function(_0x3dac02){if(_0x3dac02[_0xd454('0x31')]!=='VIRTUAL'){var _0x5e318b={};_0x5e318b[_0x3dac02[_0xd454('0x33')]]={'$like':'%'+_0x1d5fae[_0xd454('0x37')][_0xd454('0x40')]+'%'};return _0x5e318b;}})});}_0x866297=_['merge']({},_0x866297,_0x1d5fae['options']);var _0x92d6a1={'where':_0x866297['where']};return db['SmsQueue'][_0xd454('0x1e')](_0x92d6a1)['then'](function(_0x3efccf){_0x27afb6[_0xd454('0x1e')]=_0x3efccf;if(_0x1d5fae[_0xd454('0x37')][_0xd454('0x41')]){_0x866297[_0xd454('0x42')]=[{'all':!![]}];}return db[_0xd454('0x2e')][_0xd454('0x43')](_0x866297);})[_0xd454('0x24')](function(_0x22f90b){_0x27afb6[_0xd454('0x44')]=_0x22f90b;return _0x27afb6;})[_0xd454('0x24')](respondWithFilteredResult(_0x3c0215,_0x866297))[_0xd454('0x45')](handleError(_0x3c0215,null));};exports[_0xd454('0x46')]=function(_0x487b9b,_0x4c3c6c){var _0x5f448f={'raw':!![],'where':{'id':_0x487b9b[_0xd454('0x47')]['id']}},_0xa24f79={};_0xa24f79[_0xd454('0x32')]=_[_0xd454('0x48')](db[_0xd454('0x2e')][_0xd454('0x2f')]);_0xa24f79[_0xd454('0x37')]=_['keys'](_0x487b9b[_0xd454('0x37')]);_0xa24f79[_0xd454('0x3f')]=_[_0xd454('0x34')](_0xa24f79[_0xd454('0x32')],_0xa24f79[_0xd454('0x37')]);_0x5f448f[_0xd454('0x35')]=_[_0xd454('0x34')](_0xa24f79['model'],qs[_0xd454('0x36')](_0x487b9b[_0xd454('0x37')][_0xd454('0x36')]));_0x5f448f[_0xd454('0x35')]=_0x5f448f[_0xd454('0x35')]['length']?_0x5f448f[_0xd454('0x35')]:_0xa24f79[_0xd454('0x32')];if(_0x487b9b[_0xd454('0x37')][_0xd454('0x41')]){_0x5f448f[_0xd454('0x42')]=[{'all':!![]}];}_0x5f448f=_['merge']({},_0x5f448f,_0x487b9b[_0xd454('0x49')]);return db[_0xd454('0x2e')][_0xd454('0x4a')](_0x5f448f)[_0xd454('0x24')](handleEntityNotFound(_0x4c3c6c,null))[_0xd454('0x24')](respondWithResult(_0x4c3c6c,null))[_0xd454('0x45')](handleError(_0x4c3c6c,null));};exports[_0xd454('0x4b')]=function(_0x53a47e,_0x5aa328){return db[_0xd454('0x2e')][_0xd454('0x4b')](_0x53a47e[_0xd454('0x4c')],{})[_0xd454('0x24')](function(_0x48ab76){var _0x4b84a1=_0x53a47e[_0xd454('0x4d')][_0xd454('0x25')]({'plain':!![]});if(!_0x4b84a1)throw new Error(_0xd454('0x4e'));if(_0x4b84a1[_0xd454('0x4f')]===_0xd454('0x4d')){var _0x586f0e=_0x48ab76[_0xd454('0x25')]({'plain':!![]});var _0x1310cc='SmsQueues';return db['UserProfileSection'][_0xd454('0x4a')]({'where':{'name':_0x1310cc,'userProfileId':_0x4b84a1[_0xd454('0x50')]},'raw':!![]})[_0xd454('0x24')](function(_0x3b4c34){if(_0x3b4c34&&_0x3b4c34[_0xd454('0x51')]===0x0){return db[_0xd454('0x27')][_0xd454('0x4b')]({'name':_0x586f0e['name'],'resourceId':_0x586f0e['id'],'type':_0x3b4c34['name'],'sectionId':_0x3b4c34['id']},{})['then'](function(){return _0x48ab76;});}else{return _0x48ab76;}})['catch'](function(_0x541b73){logger[_0xd454('0x29')](_0xd454('0x52'),_0x541b73);throw _0x541b73;});}return _0x48ab76;})[_0xd454('0x24')](respondWithResult(_0x5aa328,0xc9))[_0xd454('0x45')](handleError(_0x5aa328,null));};exports['update']=function(_0x1fad6b,_0x30de48){if(_0x1fad6b[_0xd454('0x4c')]['id']){delete _0x1fad6b[_0xd454('0x4c')]['id'];}return db['SmsQueue'][_0xd454('0x4a')]({'where':{'id':_0x1fad6b[_0xd454('0x47')]['id']}})[_0xd454('0x24')](handleEntityNotFound(_0x30de48,null))[_0xd454('0x24')](saveUpdates(_0x1fad6b['body'],null))['then'](respondWithResult(_0x30de48,null))[_0xd454('0x45')](handleError(_0x30de48,null));};exports[_0xd454('0x28')]=function(_0x48eb92,_0x23dbca){return db[_0xd454('0x2e')]['find']({'where':{'id':_0x48eb92[_0xd454('0x47')]['id']}})[_0xd454('0x24')](handleEntityNotFound(_0x23dbca,null))[_0xd454('0x24')](removeEntity(_0x23dbca,null))[_0xd454('0x45')](handleError(_0x23dbca,null));};exports[_0xd454('0x53')]=function(_0x4504b5,_0x1fadf4){return db[_0xd454('0x2e')][_0xd454('0x53')]()[_0xd454('0x24')](respondWithResult(_0x1fadf4,null))[_0xd454('0x45')](handleError(_0x1fadf4,null));};exports[_0xd454('0x54')]=function(_0x149ba2,_0x32e3bc,_0x4278dd){var _0x2ea1ce={'raw':!![],'where':{}},_0x51870a={},_0x57ac57;return db[_0xd454('0x2e')][_0xd454('0x55')]({'where':{'id':_0x149ba2[_0xd454('0x47')]['id']}})[_0xd454('0x24')](handleEntityNotFound(_0x32e3bc,null))['then'](function(_0x21152a){if(_0x21152a){_0x57ac57=_0x21152a[_0xd454('0x25')]({'plain':!![]});_0x51870a[_0xd454('0x32')]=_[_0xd454('0x48')](db[_0xd454('0x56')][_0xd454('0x2f')]);_0x51870a['query']=_[_0xd454('0x48')](_0x149ba2['query']);_0x51870a[_0xd454('0x3f')]=_[_0xd454('0x34')](_0x51870a[_0xd454('0x32')],_0x51870a[_0xd454('0x37')]);_0x2ea1ce['attributes']=_[_0xd454('0x34')](_0x51870a[_0xd454('0x32')],qs[_0xd454('0x36')](_0x149ba2[_0xd454('0x37')]['fields']));_0x2ea1ce['attributes']=_0x2ea1ce['attributes'][_0xd454('0x38')]?_0x2ea1ce[_0xd454('0x35')]:_0x51870a['model'];if(!_0x149ba2[_0xd454('0x37')][_0xd454('0x39')](_0xd454('0x3a'))){_0x2ea1ce['limit']=qs[_0xd454('0x3b')](_0x149ba2[_0xd454('0x37')]['limit']);_0x2ea1ce['offset']=qs['offset'](_0x149ba2[_0xd454('0x37')]['offset']);}_0x2ea1ce[_0xd454('0x3c')]=qs[_0xd454('0x3d')](_0x149ba2[_0xd454('0x37')][_0xd454('0x3d')]);_0x2ea1ce[_0xd454('0x3e')]=qs['filters'](_['pick'](_0x149ba2[_0xd454('0x37')],_0x51870a[_0xd454('0x3f')]));_0x2ea1ce[_0xd454('0x3e')][_0xd454('0x57')]=_0x21152a['id'];if(_0x149ba2[_0xd454('0x37')][_0xd454('0x40')]){_0x2ea1ce[_0xd454('0x3e')]=_[_0xd454('0x58')](_0x2ea1ce['where'],{'$or':_[_0xd454('0x2d')](_0x2ea1ce['attributes'],function(_0x7d5be4){var _0x40d500={};_0x40d500[_0x7d5be4]={'$like':'%'+_0x149ba2['query']['filter']+'%'};return _0x40d500;})});}_0x2ea1ce=_[_0xd454('0x58')]({},_0x2ea1ce,_0x149ba2[_0xd454('0x49')]);return db[_0xd454('0x56')][_0xd454('0x43')](_0x2ea1ce);}})[_0xd454('0x24')](function(_0x4a52b1){if(_0x4a52b1){return db[_0xd454('0x59')][_0xd454('0x5a')]({'where':{'id':_[_0xd454('0x2d')](_0x4a52b1,'UserId'),'role':'agent'},'attributes':['id',_0xd454('0x33'),_0xd454('0x5b'),_0xd454('0x5c'),_0xd454('0x5d')]});}})['then'](function(_0x3170db){if(_0x3170db){return{'count':_0x3170db['count'],'rows':_['map'](_0x3170db[_0xd454('0x44')],function(_0x274d54){return{'membername':_0x274d54[_0xd454('0x33')],'UserId':_0x274d54['id'],'queue_name':_0x57ac57[_0xd454('0x33')],'SmsQueueId':_0x57ac57['id'],'interface':util[_0xd454('0x5e')](_0xd454('0x5f'),_0xd454('0x60'),_0x274d54[_0xd454('0x33')]),'penalty':0x0,'paused':_0x274d54['smsPause'],'createdAt':_0x274d54[_0xd454('0x5d')],'updatedAt':_0x274d54[_0xd454('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd454('0x24')](respondWithFilteredResult(_0x32e3bc,_0x2ea1ce))[_0xd454('0x45')](handleError(_0x32e3bc,null));};exports['getTeams']=function(_0x1f46e7,_0x506162,_0x1a6f3a){var _0x435910={};var _0xec0cb1={};var _0x24a857;var _0x383634;return db[_0xd454('0x2e')][_0xd454('0x55')]({'where':{'id':_0x1f46e7[_0xd454('0x47')]['id']}})[_0xd454('0x24')](handleEntityNotFound(_0x506162,null))[_0xd454('0x24')](function(_0x2809f5){if(_0x2809f5){_0x24a857=_0x2809f5;_0xec0cb1[_0xd454('0x32')]=_[_0xd454('0x48')](db[_0xd454('0x61')][_0xd454('0x2f')]);_0xec0cb1[_0xd454('0x37')]=_['keys'](_0x1f46e7[_0xd454('0x37')]);_0xec0cb1[_0xd454('0x3f')]=_[_0xd454('0x34')](_0xec0cb1[_0xd454('0x32')],_0xec0cb1[_0xd454('0x37')]);_0x435910[_0xd454('0x35')]=_[_0xd454('0x34')](_0xec0cb1[_0xd454('0x32')],qs[_0xd454('0x36')](_0x1f46e7[_0xd454('0x37')]['fields']));_0x435910['attributes']=_0x435910[_0xd454('0x35')]['length']?_0x435910[_0xd454('0x35')]:_0xec0cb1['model'];_0x435910[_0xd454('0x3c')]=qs[_0xd454('0x3d')](_0x1f46e7[_0xd454('0x37')]['sort']);_0x435910[_0xd454('0x3e')]=qs['filters'](_[_0xd454('0x62')](_0x1f46e7[_0xd454('0x37')],_0xec0cb1['filters']));if(_0x1f46e7['query'][_0xd454('0x40')]){_0x435910[_0xd454('0x3e')]=_['merge'](_0x435910[_0xd454('0x3e')],{'$or':_[_0xd454('0x2d')](_0x435910[_0xd454('0x35')],function(_0x4e1047){var _0x2c9e2b={};_0x2c9e2b[_0x4e1047]={'$like':'%'+_0x1f46e7[_0xd454('0x37')][_0xd454('0x40')]+'%'};return _0x2c9e2b;})});}_0x435910=_[_0xd454('0x58')]({},_0x435910,_0x1f46e7[_0xd454('0x49')]);return _0x24a857[_0xd454('0x63')](_0x435910);}})[_0xd454('0x24')](function(_0x501654){if(_0x501654){_0x383634=_0x501654[_0xd454('0x38')];if(!_0x1f46e7[_0xd454('0x37')]['hasOwnProperty']('nolimit')){_0x435910[_0xd454('0x3b')]=qs[_0xd454('0x3b')](_0x1f46e7[_0xd454('0x37')]['limit']);_0x435910[_0xd454('0x1c')]=qs['offset'](_0x1f46e7['query'][_0xd454('0x1c')]);}return _0x24a857[_0xd454('0x63')](_0x435910);}})[_0xd454('0x24')](function(_0x3747eb){if(_0x3747eb){return _0x3747eb?{'count':_0x383634,'rows':_0x3747eb}:null;}})[_0xd454('0x24')](respondWithResult(_0x506162,null))['catch'](handleError(_0x506162,null));};exports[_0xd454('0x64')]=function(_0x15dd4b,_0x38f6ae,_0x4e80b5){var _0x3021dd=_0x15dd4b[_0xd454('0x4c')][_0xd454('0x65')];return db[_0xd454('0x61')][_0xd454('0x43')]({'where':{'id':_0x3021dd},'attributes':['id'],'include':[{'model':db[_0xd454('0x59')],'as':'Agents','attributes':['id',_0xd454('0x33'),'online','voicePause',_0xd454('0x66')],'raw':!![]}]})[_0xd454('0x24')](function(_0x20eb13){if(_0x20eb13){var _0x145333=_['flatMap'](_0x20eb13,function(_0x28e041){var _0x39b3ef=_0x28e041['get']({'plain':!![]});return _0x39b3ef[_0xd454('0x67')];});return db[_0xd454('0x2e')][_0xd454('0x4a')]({'where':{'id':_0x15dd4b['params']['id']}})[_0xd454('0x24')](function(_0x30c2ba){return db['sequelize'][_0xd454('0x68')](function(_0x2cc7d9){return _0x30c2ba[_0xd454('0x64')](_0x3021dd,{'transaction':_0x2cc7d9})['then'](function(){return BPromise['each'](_0x145333,function(_0x3d2ba1){return db[_0xd454('0x56')][_0xd454('0x69')]({'where':{'UserId':_0x3d2ba1['id'],'SmsQueueId':_0x15dd4b[_0xd454('0x47')]['id']},'transaction':_0x2cc7d9});});})['then'](function(){_0x145333[_0xd454('0x6a')](function(_0x25b382){socket[_0xd454('0x6b')](_0xd454('0x6c'),{'UserId':_0x25b382['id'],'SmsQueueId':_0x30c2ba['id']});});});});});}})[_0xd454('0x24')](respondWithStatusCode(_0x38f6ae,null))[_0xd454('0x45')](handleError(_0x38f6ae,null));};exports['removeTeams']=function(_0x22b261,_0x2276a9,_0x5d7ba2){return db['Team'][_0xd454('0x43')]({'where':{'id':_0x22b261[_0xd454('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd454('0x59')],'as':_0xd454('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2276a9,null))[_0xd454('0x24')](function(_0x18cb9d){var _0x15eae8=_[_0xd454('0x2d')](_0x18cb9d,'id');var _0x37f7fa=[];var _0x2f2bc5=[];var _0x482178=squel[_0xd454('0x6d')]();_0x482178[_0xd454('0x6e')](_0xd454('0x6f'))[_0xd454('0x70')](_0xd454('0x71'),'tq')[_0xd454('0x72')](_0xd454('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xd454('0x74'),_0x22b261[_0xd454('0x47')]['id']);for(var _0x270259=0x0;_0x270259<_0x18cb9d['length'];_0x270259+=0x1){let _0x49f066=_0x18cb9d[_0x270259];for(var _0xdff3f8=0x0;_0xdff3f8<_0x49f066[_0xd454('0x67')][_0xd454('0x38')];_0xdff3f8+=0x1){let _0xe9aa0a=_0x49f066[_0xd454('0x67')][_0xdff3f8];var _0x4e9f7e=_0x482178[_0xd454('0x75')]();_0x4e9f7e[_0xd454('0x3e')]('ut.UserId\x20=\x20?',_0xe9aa0a['id']);_0x2f2bc5[_0xd454('0x76')](db[_0xd454('0x77')][_0xd454('0x37')](_0x4e9f7e[_0xd454('0x78')](),{'type':db[_0xd454('0x77')][_0xd454('0x79')]['SELECT']})[_0xd454('0x24')](function(_0x15e64c){if(_0x15e64c[_0xd454('0x38')]===0x1){return _0xe9aa0a['id'];}else{var _0x854011=_[_0xd454('0x7a')](_['map'](_0x15e64c,_0xd454('0x7b')),function(_0x4e7482){return _[_0xd454('0x7c')](_0x15eae8,_0x4e7482);});if(_0x854011){return _0xe9aa0a['id'];}}}));}}return BPromise[_0xd454('0x7d')](_0x2f2bc5)[_0xd454('0x24')](function(_0x5d6e61){_0x37f7fa=_(_0x37f7fa)[_0xd454('0x7e')](_0x5d6e61)[_0xd454('0x7f')]()[_0xd454('0x80')]();return db[_0xd454('0x2e')][_0xd454('0x4a')]({'where':{'id':_0x22b261[_0xd454('0x47')]['id']}})[_0xd454('0x24')](function(_0xc96f82){return db[_0xd454('0x77')][_0xd454('0x68')](function(_0x488b80){return _0xc96f82[_0xd454('0x81')](_0x22b261[_0xd454('0x37')][_0xd454('0x65')],{'transaction':_0x488b80})[_0xd454('0x24')](function(){if(!_[_0xd454('0x82')](_0x37f7fa)){return _0xc96f82[_0xd454('0x83')](_0x37f7fa,{'transaction':_0x488b80});}})[_0xd454('0x24')](function(){_0x37f7fa[_0xd454('0x6a')](function(_0x98bbb5){socket['emit'](_0xd454('0x84'),{'UserId':_0x98bbb5,'SmsQueueId':_0xc96f82['id']});});});});});});})[_0xd454('0x24')](respondWithStatusCode(_0x2276a9,null))[_0xd454('0x45')](handleError(_0x2276a9,null));};exports[_0xd454('0x85')]=function(_0xcfc97f,_0x544313,_0x77870c){return db['SmsQueue'][_0xd454('0x4a')]({'where':{'id':_0xcfc97f['params']['id']}})[_0xd454('0x24')](handleEntityNotFound(_0x544313,null))[_0xd454('0x24')](function(_0x3e3cc2){if(_0x3e3cc2){return _0x3e3cc2[_0xd454('0x85')](_0xcfc97f[_0xd454('0x4c')][_0xd454('0x65')],_['omit'](_0xcfc97f['body'],['ids','id'])||{})['spread'](function(_0x556d3e){for(var _0x34430f=0x0;_0x34430f<_0xcfc97f[_0xd454('0x4c')][_0xd454('0x65')][_0xd454('0x38')];_0x34430f+=0x1){socket[_0xd454('0x6b')](_0xd454('0x6c'),{'UserId':_0xcfc97f[_0xd454('0x4c')][_0xd454('0x65')][_0x34430f],'SmsQueueId':_0xcfc97f[_0xd454('0x47')]['id']});}return _0x556d3e;});}})[_0xd454('0x24')](respondWithResult(_0x544313,null))['catch'](handleError(_0x544313,null));};exports[_0xd454('0x83')]=function(_0x343f63,_0x4d7a39,_0xedb37a){return db[_0xd454('0x2e')]['find']({'where':{'id':_0x343f63['params']['id']}})[_0xd454('0x24')](handleEntityNotFound(_0x4d7a39,null))[_0xd454('0x24')](function(_0x119ade){if(_0x119ade){return _0x119ade['removeAgents'](_0x343f63['query']['ids'])[_0xd454('0x24')](function(){if(_[_0xd454('0x86')](_0x343f63[_0xd454('0x37')][_0xd454('0x65')])){for(var _0x5f3239=0x0;_0x5f3239<_0x343f63[_0xd454('0x37')]['ids'][_0xd454('0x38')];_0x5f3239+=0x1){socket[_0xd454('0x6b')](_0xd454('0x84'),{'UserId':Number(_0x343f63[_0xd454('0x37')][_0xd454('0x65')][_0x5f3239]),'SmsQueueId':Number(_0x343f63['params']['id'])});}}else{socket['emit'](_0xd454('0x84'),{'UserId':Number(_0x343f63['query'][_0xd454('0x65')]),'SmsQueueId':Number(_0x343f63[_0xd454('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x4d7a39,null))[_0xd454('0x45')](handleError(_0x4d7a39,null));};exports[_0xd454('0x87')]=function(_0x5c85ea,_0x3cb545,_0x5dcf61){var _0x34cb05={};var _0x3e4093={};var _0x275b23;var _0x57627c;return db[_0xd454('0x2e')]['findOne']({'where':{'id':_0x5c85ea[_0xd454('0x47')]['id']}})[_0xd454('0x24')](handleEntityNotFound(_0x3cb545,null))[_0xd454('0x24')](function(_0x496aa1){if(_0x496aa1){_0x275b23=_0x496aa1;_0x3e4093[_0xd454('0x32')]=_[_0xd454('0x48')](db[_0xd454('0x59')][_0xd454('0x2f')]);_0x3e4093[_0xd454('0x37')]=_[_0xd454('0x48')](_0x5c85ea[_0xd454('0x37')]);_0x3e4093[_0xd454('0x3f')]=_['intersection'](_0x3e4093[_0xd454('0x32')],_0x3e4093['query']);_0x34cb05['attributes']=_[_0xd454('0x34')](_0x3e4093[_0xd454('0x32')],qs[_0xd454('0x36')](_0x5c85ea[_0xd454('0x37')]['fields']));_0x34cb05[_0xd454('0x35')]=_0x34cb05['attributes'][_0xd454('0x38')]?_0x34cb05[_0xd454('0x35')]:_0x3e4093[_0xd454('0x32')];_0x34cb05['order']=qs[_0xd454('0x3d')](_0x5c85ea[_0xd454('0x37')][_0xd454('0x3d')]);_0x34cb05['where']=qs['filters'](_[_0xd454('0x62')](_0x5c85ea[_0xd454('0x37')],_0x3e4093[_0xd454('0x3f')]));if(_0x5c85ea['query']['filter']){_0x34cb05[_0xd454('0x3e')]=_[_0xd454('0x58')](_0x34cb05['where'],{'$or':_['map'](_0x34cb05[_0xd454('0x35')],function(_0xb0494f){var _0x232a21={};_0x232a21[_0xb0494f]={'$like':'%'+_0x5c85ea[_0xd454('0x37')][_0xd454('0x40')]+'%'};return _0x232a21;})});}_0x34cb05=_[_0xd454('0x58')]({},_0x34cb05,_0x5c85ea[_0xd454('0x49')]);return _0x275b23[_0xd454('0x87')](_0x34cb05);}})[_0xd454('0x24')](function(_0x2abb81){if(_0x2abb81){_0x57627c=_0x2abb81['length'];if(!_0x5c85ea['query'][_0xd454('0x39')](_0xd454('0x3a'))){_0x34cb05[_0xd454('0x3b')]=qs[_0xd454('0x3b')](_0x5c85ea[_0xd454('0x37')][_0xd454('0x3b')]);_0x34cb05[_0xd454('0x1c')]=qs['offset'](_0x5c85ea[_0xd454('0x37')][_0xd454('0x1c')]);}return _0x275b23['getAgents'](_0x34cb05);}})[_0xd454('0x24')](function(_0x1a4652){if(_0x1a4652){return _0x1a4652?{'count':_0x57627c,'rows':_0x1a4652}:null;}})[_0xd454('0x24')](respondWithResult(_0x3cb545,null))[_0xd454('0x45')](handleError(_0x3cb545,null));}; \ No newline at end of file +var _0x59b1=['fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','include','rows','catch','show','params','rawAttributes','includeAll','find','create','user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','options','findAll','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','body','online','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userSmsQueue:save','ids','User','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','value','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','json','undefined','count','offset','limit','set','apply','reject','update','then','get','SmsQueues','destroy','sendStatus','stack','name','SmsQueue','fieldName','map','query','keys','model','attributes','intersection'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0x59b1,0xda));var _0x159b=function(_0x338bcb,_0x4e3ba3){_0x338bcb=_0x338bcb-0x0;var _0x2e6ab7=_0x59b1[_0x338bcb];return _0x2e6ab7;};'use strict';var emlformat=require(_0x159b('0x0'));var rimraf=require(_0x159b('0x1'));var zipdir=require(_0x159b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x159b('0x3'));var moment=require(_0x159b('0x4'));var BPromise=require(_0x159b('0x5'));var Mustache=require(_0x159b('0x6'));var util=require(_0x159b('0x7'));var path=require(_0x159b('0x8'));var sox=require(_0x159b('0x9'));var csv=require(_0x159b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x159b('0xb'));var _=require('lodash');var squel=require(_0x159b('0xc'));var crypto=require(_0x159b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x159b('0xe'));var toCsv=require(_0x159b('0xa'));var querystring=require('querystring');var Papa=require(_0x159b('0xf'));var Redis=require(_0x159b('0x10'));var authService=require(_0x159b('0x11'));var qs=require(_0x159b('0x12'));var as=require(_0x159b('0x13'));var hardwareService=require(_0x159b('0x14'));var logger=require('../../config/logger')(_0x159b('0x15'));var utils=require(_0x159b('0x16'));var config=require(_0x159b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x159b('0x18')](config[_0x159b('0x19')],{'host':_0x159b('0x1a'),'port':0x18eb});var socket=require(_0x159b('0x1b'))(new Redis(config[_0x159b('0x19')]));require(_0x159b('0x1c'))[_0x159b('0x1d')](socket);function respondWithStatusCode(_0x508bb5,_0x26ab4d){_0x26ab4d=_0x26ab4d||0xcc;return function(_0x35c88c){if(_0x35c88c){return _0x508bb5['sendStatus'](_0x26ab4d);}return _0x508bb5[_0x159b('0x1e')](_0x26ab4d)[_0x159b('0x1f')]();};}function respondWithResult(_0x1ee5ea,_0x4aa3a0){_0x4aa3a0=_0x4aa3a0||0xc8;return function(_0x4db4a9){if(_0x4db4a9){return _0x1ee5ea[_0x159b('0x1e')](_0x4aa3a0)[_0x159b('0x20')](_0x4db4a9);}};}function respondWithFilteredResult(_0x62a8c,_0x16d148){return function(_0x1c40f2){if(_0x1c40f2){var _0x2eccd0=typeof _0x16d148['offset']==='undefined'&&typeof _0x16d148['limit']===_0x159b('0x21');var _0xf15bbd=_0x1c40f2[_0x159b('0x22')];var _0x492ef5=_0x2eccd0?0x0:_0x16d148[_0x159b('0x23')];var _0x3ec10a=_0x2eccd0?_0x1c40f2[_0x159b('0x22')]:_0x16d148['offset']+_0x16d148[_0x159b('0x24')];var _0x5af34c;if(_0x3ec10a>=_0xf15bbd){_0x3ec10a=_0xf15bbd;_0x5af34c=0xc8;}else{_0x5af34c=0xce;}_0x62a8c[_0x159b('0x1e')](_0x5af34c);return _0x62a8c[_0x159b('0x25')]('Content-Range',_0x492ef5+'-'+_0x3ec10a+'/'+_0xf15bbd)[_0x159b('0x20')](_0x1c40f2);}return null;};}function patchUpdates(_0xae4cf8){return function(_0xad803c){try{jsonpatch[_0x159b('0x26')](_0xad803c,_0xae4cf8,!![]);}catch(_0x127683){return BPromise[_0x159b('0x27')](_0x127683);}return _0xad803c['save']();};}function saveUpdates(_0x1abb9b,_0x598edd){return function(_0x3d177d){if(_0x3d177d){return _0x3d177d[_0x159b('0x28')](_0x1abb9b)[_0x159b('0x29')](function(_0x3c8af7){return _0x3c8af7;});}return null;};}function removeEntity(_0x5f49ea,_0x1941c1){return function(_0x20fd60){if(_0x20fd60){return _0x20fd60['destroy']()[_0x159b('0x29')](function(){var _0x37158a=_0x20fd60[_0x159b('0x2a')]({'plain':!![]});var _0x1c6fca=_0x159b('0x2b');return db['UserProfileResource'][_0x159b('0x2c')]({'where':{'type':_0x1c6fca,'resourceId':_0x37158a['id']}})[_0x159b('0x29')](function(){return _0x20fd60;});})['then'](function(){_0x5f49ea[_0x159b('0x1e')](0xcc)[_0x159b('0x1f')]();});}};}function handleEntityNotFound(_0xce5f20,_0x5dab4b){return function(_0x2592f4){if(!_0x2592f4){_0xce5f20[_0x159b('0x2d')](0x194);}return _0x2592f4;};}function handleError(_0x8ee29c,_0x5b164c){_0x5b164c=_0x5b164c||0x1f4;return function(_0x2e653d){logger['error'](_0x2e653d[_0x159b('0x2e')]);if(_0x2e653d[_0x159b('0x2f')]){delete _0x2e653d[_0x159b('0x2f')];}_0x8ee29c['status'](_0x5b164c)['send'](_0x2e653d);};}exports['index']=function(_0x3e677d,_0x518f18){var _0x372577={},_0x4d2772={},_0x2fe6ea={'count':0x0,'rows':[]};var _0x2e1424=_['map'](db[_0x159b('0x30')]['rawAttributes'],function(_0xe92ec4){return{'name':_0xe92ec4[_0x159b('0x31')],'type':_0xe92ec4['type']['key']};});_0x4d2772['model']=_[_0x159b('0x32')](_0x2e1424,_0x159b('0x2f'));_0x4d2772[_0x159b('0x33')]=_[_0x159b('0x34')](_0x3e677d[_0x159b('0x33')]);_0x4d2772['filters']=_['intersection'](_0x4d2772[_0x159b('0x35')],_0x4d2772[_0x159b('0x33')]);_0x372577[_0x159b('0x36')]=_[_0x159b('0x37')](_0x4d2772[_0x159b('0x35')],qs[_0x159b('0x38')](_0x3e677d[_0x159b('0x33')]['fields']));_0x372577[_0x159b('0x36')]=_0x372577[_0x159b('0x36')][_0x159b('0x39')]?_0x372577[_0x159b('0x36')]:_0x4d2772[_0x159b('0x35')];if(!_0x3e677d[_0x159b('0x33')][_0x159b('0x3a')](_0x159b('0x3b'))){_0x372577[_0x159b('0x24')]=qs['limit'](_0x3e677d[_0x159b('0x33')]['limit']);_0x372577['offset']=qs[_0x159b('0x23')](_0x3e677d[_0x159b('0x33')][_0x159b('0x23')]);}_0x372577[_0x159b('0x3c')]=qs[_0x159b('0x3d')](_0x3e677d[_0x159b('0x33')][_0x159b('0x3d')]);_0x372577['where']=qs[_0x159b('0x3e')](_[_0x159b('0x3f')](_0x3e677d[_0x159b('0x33')],_0x4d2772['filters']),_0x2e1424);if(_0x3e677d[_0x159b('0x33')][_0x159b('0x40')]){_0x372577[_0x159b('0x41')]=_[_0x159b('0x42')](_0x372577['where'],{'$or':_['map'](_0x2e1424,function(_0x13c5eb){if(_0x13c5eb['type']!==_0x159b('0x43')){var _0xe40f38={};_0xe40f38[_0x13c5eb[_0x159b('0x2f')]]={'$like':'%'+_0x3e677d[_0x159b('0x33')][_0x159b('0x40')]+'%'};return _0xe40f38;}})});}_0x372577=_[_0x159b('0x42')]({},_0x372577,_0x3e677d['options']);var _0x17fa3d={'where':_0x372577[_0x159b('0x41')]};return db[_0x159b('0x30')][_0x159b('0x22')](_0x17fa3d)[_0x159b('0x29')](function(_0x3a601d){_0x2fe6ea[_0x159b('0x22')]=_0x3a601d;if(_0x3e677d['query']['includeAll']){_0x372577[_0x159b('0x44')]=[{'all':!![]}];}return db[_0x159b('0x30')]['findAll'](_0x372577);})['then'](function(_0x444abf){_0x2fe6ea[_0x159b('0x45')]=_0x444abf;return _0x2fe6ea;})['then'](respondWithFilteredResult(_0x518f18,_0x372577))[_0x159b('0x46')](handleError(_0x518f18,null));};exports[_0x159b('0x47')]=function(_0x5ac09c,_0x3522e6){var _0x21ffdb={'raw':!![],'where':{'id':_0x5ac09c[_0x159b('0x48')]['id']}},_0x5e28f9={};_0x5e28f9[_0x159b('0x35')]=_[_0x159b('0x34')](db[_0x159b('0x30')][_0x159b('0x49')]);_0x5e28f9[_0x159b('0x33')]=_['keys'](_0x5ac09c[_0x159b('0x33')]);_0x5e28f9[_0x159b('0x3e')]=_[_0x159b('0x37')](_0x5e28f9[_0x159b('0x35')],_0x5e28f9['query']);_0x21ffdb['attributes']=_[_0x159b('0x37')](_0x5e28f9[_0x159b('0x35')],qs[_0x159b('0x38')](_0x5ac09c[_0x159b('0x33')]['fields']));_0x21ffdb[_0x159b('0x36')]=_0x21ffdb[_0x159b('0x36')][_0x159b('0x39')]?_0x21ffdb['attributes']:_0x5e28f9[_0x159b('0x35')];if(_0x5ac09c[_0x159b('0x33')][_0x159b('0x4a')]){_0x21ffdb['include']=[{'all':!![]}];}_0x21ffdb=_['merge']({},_0x21ffdb,_0x5ac09c['options']);return db['SmsQueue'][_0x159b('0x4b')](_0x21ffdb)[_0x159b('0x29')](handleEntityNotFound(_0x3522e6,null))[_0x159b('0x29')](respondWithResult(_0x3522e6,null))[_0x159b('0x46')](handleError(_0x3522e6,null));};exports[_0x159b('0x4c')]=function(_0x52ed83,_0x3ae3fa){return db['SmsQueue'][_0x159b('0x4c')](_0x52ed83['body'],{})[_0x159b('0x29')](function(_0x2a762b){var _0x24c77e=_0x52ed83[_0x159b('0x4d')][_0x159b('0x2a')]({'plain':!![]});if(!_0x24c77e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24c77e[_0x159b('0x4e')]===_0x159b('0x4d')){var _0x921742=_0x2a762b[_0x159b('0x2a')]({'plain':!![]});var _0x3a4dff=_0x159b('0x2b');return db[_0x159b('0x4f')][_0x159b('0x4b')]({'where':{'name':_0x3a4dff,'userProfileId':_0x24c77e['userProfileId']},'raw':!![]})[_0x159b('0x29')](function(_0x5ca8fd){if(_0x5ca8fd&&_0x5ca8fd[_0x159b('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x921742['name'],'resourceId':_0x921742['id'],'type':_0x5ca8fd[_0x159b('0x2f')],'sectionId':_0x5ca8fd['id']},{})[_0x159b('0x29')](function(){return _0x2a762b;});}else{return _0x2a762b;}})[_0x159b('0x46')](function(_0x44b259){logger[_0x159b('0x51')](_0x159b('0x52'),_0x44b259);throw _0x44b259;});}return _0x2a762b;})[_0x159b('0x29')](respondWithResult(_0x3ae3fa,0xc9))[_0x159b('0x46')](handleError(_0x3ae3fa,null));};exports[_0x159b('0x28')]=function(_0x217fca,_0x46169c){if(_0x217fca['body']['id']){delete _0x217fca['body']['id'];}return db[_0x159b('0x30')][_0x159b('0x4b')]({'where':{'id':_0x217fca['params']['id']}})[_0x159b('0x29')](handleEntityNotFound(_0x46169c,null))[_0x159b('0x29')](saveUpdates(_0x217fca['body'],null))[_0x159b('0x29')](respondWithResult(_0x46169c,null))['catch'](handleError(_0x46169c,null));};exports['destroy']=function(_0x26da23,_0x2e7e12){return db[_0x159b('0x30')][_0x159b('0x4b')]({'where':{'id':_0x26da23[_0x159b('0x48')]['id']}})[_0x159b('0x29')](handleEntityNotFound(_0x2e7e12,null))['then'](removeEntity(_0x2e7e12,null))[_0x159b('0x46')](handleError(_0x2e7e12,null));};exports[_0x159b('0x53')]=function(_0x185c62,_0x41b70b){return db[_0x159b('0x30')]['describe']()[_0x159b('0x29')](respondWithResult(_0x41b70b,null))[_0x159b('0x46')](handleError(_0x41b70b,null));};exports[_0x159b('0x54')]=function(_0x2c1fa7,_0x4e119f,_0x2ee1d0){var _0xc82e1c={'raw':!![],'where':{}},_0x347df9={},_0x25dc79;return db[_0x159b('0x30')][_0x159b('0x55')]({'where':{'id':_0x2c1fa7[_0x159b('0x48')]['id']}})[_0x159b('0x29')](handleEntityNotFound(_0x4e119f,null))[_0x159b('0x29')](function(_0x2bc4c2){if(_0x2bc4c2){_0x25dc79=_0x2bc4c2[_0x159b('0x2a')]({'plain':!![]});_0x347df9[_0x159b('0x35')]=_[_0x159b('0x34')](db[_0x159b('0x56')][_0x159b('0x49')]);_0x347df9['query']=_[_0x159b('0x34')](_0x2c1fa7['query']);_0x347df9['filters']=_[_0x159b('0x37')](_0x347df9[_0x159b('0x35')],_0x347df9[_0x159b('0x33')]);_0xc82e1c[_0x159b('0x36')]=_['intersection'](_0x347df9[_0x159b('0x35')],qs[_0x159b('0x38')](_0x2c1fa7[_0x159b('0x33')]['fields']));_0xc82e1c[_0x159b('0x36')]=_0xc82e1c[_0x159b('0x36')][_0x159b('0x39')]?_0xc82e1c[_0x159b('0x36')]:_0x347df9[_0x159b('0x35')];if(!_0x2c1fa7['query'][_0x159b('0x3a')](_0x159b('0x3b'))){_0xc82e1c[_0x159b('0x24')]=qs[_0x159b('0x24')](_0x2c1fa7[_0x159b('0x33')][_0x159b('0x24')]);_0xc82e1c[_0x159b('0x23')]=qs['offset'](_0x2c1fa7[_0x159b('0x33')][_0x159b('0x23')]);}_0xc82e1c[_0x159b('0x3c')]=qs[_0x159b('0x3d')](_0x2c1fa7[_0x159b('0x33')][_0x159b('0x3d')]);_0xc82e1c[_0x159b('0x41')]=qs[_0x159b('0x3e')](_[_0x159b('0x3f')](_0x2c1fa7[_0x159b('0x33')],_0x347df9[_0x159b('0x3e')]));_0xc82e1c[_0x159b('0x41')][_0x159b('0x57')]=_0x2bc4c2['id'];if(_0x2c1fa7['query'][_0x159b('0x40')]){_0xc82e1c['where']=_[_0x159b('0x42')](_0xc82e1c[_0x159b('0x41')],{'$or':_[_0x159b('0x32')](_0xc82e1c[_0x159b('0x36')],function(_0x2278f3){var _0x1e2503={};_0x1e2503[_0x2278f3]={'$like':'%'+_0x2c1fa7['query'][_0x159b('0x40')]+'%'};return _0x1e2503;})});}_0xc82e1c=_[_0x159b('0x42')]({},_0xc82e1c,_0x2c1fa7[_0x159b('0x58')]);return db[_0x159b('0x56')][_0x159b('0x59')](_0xc82e1c);}})[_0x159b('0x29')](function(_0x1f9883){if(_0x1f9883){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x1f9883,'UserId'),'role':'agent'},'attributes':['id',_0x159b('0x2f'),_0x159b('0x5a'),_0x159b('0x5b'),_0x159b('0x5c')]});}})[_0x159b('0x29')](function(_0x241da4){if(_0x241da4){return{'count':_0x241da4[_0x159b('0x22')],'rows':_[_0x159b('0x32')](_0x241da4['rows'],function(_0x417d12){return{'membername':_0x417d12['name'],'UserId':_0x417d12['id'],'queue_name':_0x25dc79[_0x159b('0x2f')],'SmsQueueId':_0x25dc79['id'],'interface':util[_0x159b('0x5d')](_0x159b('0x5e'),_0x159b('0x5f'),_0x417d12[_0x159b('0x2f')]),'penalty':0x0,'paused':_0x417d12[_0x159b('0x5a')],'createdAt':_0x417d12['createdAt'],'updatedAt':_0x417d12['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x159b('0x29')](respondWithFilteredResult(_0x4e119f,_0xc82e1c))[_0x159b('0x46')](handleError(_0x4e119f,null));};exports[_0x159b('0x60')]=function(_0xf41a1c,_0x7eac8a,_0x21faa0){var _0x2347df={};var _0x5e9a7d={};var _0x482130;var _0x9a9a87;return db[_0x159b('0x30')]['findOne']({'where':{'id':_0xf41a1c[_0x159b('0x48')]['id']}})[_0x159b('0x29')](handleEntityNotFound(_0x7eac8a,null))[_0x159b('0x29')](function(_0x128090){if(_0x128090){_0x482130=_0x128090;_0x5e9a7d['model']=_[_0x159b('0x34')](db[_0x159b('0x61')]['rawAttributes']);_0x5e9a7d[_0x159b('0x33')]=_[_0x159b('0x34')](_0xf41a1c[_0x159b('0x33')]);_0x5e9a7d[_0x159b('0x3e')]=_['intersection'](_0x5e9a7d[_0x159b('0x35')],_0x5e9a7d[_0x159b('0x33')]);_0x2347df[_0x159b('0x36')]=_[_0x159b('0x37')](_0x5e9a7d[_0x159b('0x35')],qs[_0x159b('0x38')](_0xf41a1c[_0x159b('0x33')][_0x159b('0x38')]));_0x2347df[_0x159b('0x36')]=_0x2347df['attributes'][_0x159b('0x39')]?_0x2347df[_0x159b('0x36')]:_0x5e9a7d['model'];_0x2347df[_0x159b('0x3c')]=qs[_0x159b('0x3d')](_0xf41a1c['query'][_0x159b('0x3d')]);_0x2347df['where']=qs[_0x159b('0x3e')](_[_0x159b('0x3f')](_0xf41a1c['query'],_0x5e9a7d[_0x159b('0x3e')]));if(_0xf41a1c[_0x159b('0x33')][_0x159b('0x40')]){_0x2347df[_0x159b('0x41')]=_[_0x159b('0x42')](_0x2347df['where'],{'$or':_[_0x159b('0x32')](_0x2347df['attributes'],function(_0x1b674c){var _0x366c4a={};_0x366c4a[_0x1b674c]={'$like':'%'+_0xf41a1c[_0x159b('0x33')][_0x159b('0x40')]+'%'};return _0x366c4a;})});}_0x2347df=_[_0x159b('0x42')]({},_0x2347df,_0xf41a1c['options']);return _0x482130[_0x159b('0x60')](_0x2347df);}})['then'](function(_0x211863){if(_0x211863){_0x9a9a87=_0x211863[_0x159b('0x39')];if(!_0xf41a1c[_0x159b('0x33')][_0x159b('0x3a')](_0x159b('0x3b'))){_0x2347df[_0x159b('0x24')]=qs[_0x159b('0x24')](_0xf41a1c[_0x159b('0x33')][_0x159b('0x24')]);_0x2347df[_0x159b('0x23')]=qs[_0x159b('0x23')](_0xf41a1c['query'][_0x159b('0x23')]);}return _0x482130[_0x159b('0x60')](_0x2347df);}})[_0x159b('0x29')](function(_0x5fa3f9){if(_0x5fa3f9){return _0x5fa3f9?{'count':_0x9a9a87,'rows':_0x5fa3f9}:null;}})[_0x159b('0x29')](respondWithResult(_0x7eac8a,null))[_0x159b('0x46')](handleError(_0x7eac8a,null));};exports['addTeams']=function(_0x23d9d3,_0xd8fd9d,_0x148e27){var _0x44ceef=_0x23d9d3[_0x159b('0x62')]['ids'];return db[_0x159b('0x61')][_0x159b('0x59')]({'where':{'id':_0x44ceef},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x159b('0x2f'),_0x159b('0x63'),_0x159b('0x64'),_0x159b('0x65')],'raw':!![]}]})[_0x159b('0x29')](function(_0x3b4d64){if(_0x3b4d64){var _0x28a6dd=_[_0x159b('0x66')](_0x3b4d64,function(_0x50dcf5){var _0x3a7027=_0x50dcf5['get']({'plain':!![]});return _0x3a7027[_0x159b('0x67')];});return db['SmsQueue'][_0x159b('0x4b')]({'where':{'id':_0x23d9d3[_0x159b('0x48')]['id']}})[_0x159b('0x29')](function(_0x44c724){return db[_0x159b('0x68')][_0x159b('0x69')](function(_0x52d7c9){return _0x44c724[_0x159b('0x6a')](_0x44ceef,{'transaction':_0x52d7c9})[_0x159b('0x29')](function(){return BPromise['each'](_0x28a6dd,function(_0x352895){return db['UserSmsQueue'][_0x159b('0x6b')]({'where':{'UserId':_0x352895['id'],'SmsQueueId':_0x23d9d3[_0x159b('0x48')]['id']},'transaction':_0x52d7c9});});})['then'](function(){_0x28a6dd[_0x159b('0x6c')](function(_0x24f78d){socket[_0x159b('0x6d')](_0x159b('0x6e'),{'UserId':_0x24f78d['id'],'SmsQueueId':_0x44c724['id']});});});});});}})[_0x159b('0x29')](respondWithStatusCode(_0xd8fd9d,null))[_0x159b('0x46')](handleError(_0xd8fd9d,null));};exports['removeTeams']=function(_0xc33bc5,_0x2f309e,_0x1e8af7){return db[_0x159b('0x61')][_0x159b('0x59')]({'where':{'id':_0xc33bc5[_0x159b('0x33')][_0x159b('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x159b('0x70')],'as':_0x159b('0x67'),'attributes':['id'],'raw':!![]}]})[_0x159b('0x29')](handleEntityNotFound(_0x2f309e,null))[_0x159b('0x29')](function(_0x4bd1f9){var _0x3d91aa=_['map'](_0x4bd1f9,'id');var _0x29e46b=[];var _0x954cfd=[];var _0x4230bc=squel['select']();_0x4230bc[_0x159b('0x71')]('tq.TeamId')[_0x159b('0x72')]('team_has_sms_queues','tq')[_0x159b('0x73')](_0x159b('0x74'),'ut',_0x159b('0x75'))['where'](_0x159b('0x76'),_0xc33bc5[_0x159b('0x48')]['id']);for(var _0x3645cc=0x0;_0x3645cc<_0x4bd1f9[_0x159b('0x39')];_0x3645cc+=0x1){let _0x3a8f9f=_0x4bd1f9[_0x3645cc];for(var _0x2b8047=0x0;_0x2b8047<_0x3a8f9f[_0x159b('0x67')][_0x159b('0x39')];_0x2b8047+=0x1){let _0x2fb2c1=_0x3a8f9f['Agents'][_0x2b8047];var _0x5327a9=_0x4230bc[_0x159b('0x77')]();_0x5327a9['where'](_0x159b('0x78'),_0x2fb2c1['id']);_0x954cfd[_0x159b('0x79')](db[_0x159b('0x68')]['query'](_0x5327a9[_0x159b('0x7a')](),{'type':db[_0x159b('0x68')][_0x159b('0x7b')][_0x159b('0x7c')]})[_0x159b('0x29')](function(_0x2d8a0d){if(_0x2d8a0d[_0x159b('0x39')]===0x1){return _0x2fb2c1['id'];}else{var _0x1fd4fd=_[_0x159b('0x7d')](_[_0x159b('0x32')](_0x2d8a0d,'TeamId'),function(_0x47c935){return _['includes'](_0x3d91aa,_0x47c935);});if(_0x1fd4fd){return _0x2fb2c1['id'];}}}));}}return BPromise[_0x159b('0x7e')](_0x954cfd)['then'](function(_0x52b83e){_0x29e46b=_(_0x29e46b)['union'](_0x52b83e)['compact']()[_0x159b('0x7f')]();return db['SmsQueue']['find']({'where':{'id':_0xc33bc5[_0x159b('0x48')]['id']}})['then'](function(_0xa39111){return db[_0x159b('0x68')][_0x159b('0x69')](function(_0x2656d6){return _0xa39111[_0x159b('0x80')](_0xc33bc5[_0x159b('0x33')][_0x159b('0x6f')],{'transaction':_0x2656d6})[_0x159b('0x29')](function(){if(!_[_0x159b('0x81')](_0x29e46b)){return _0xa39111[_0x159b('0x82')](_0x29e46b,{'transaction':_0x2656d6});}})['then'](function(){_0x29e46b[_0x159b('0x6c')](function(_0x5e7b80){socket[_0x159b('0x6d')](_0x159b('0x83'),{'UserId':_0x5e7b80,'SmsQueueId':_0xa39111['id']});});});});});});})[_0x159b('0x29')](respondWithStatusCode(_0x2f309e,null))[_0x159b('0x46')](handleError(_0x2f309e,null));};exports[_0x159b('0x84')]=function(_0x5daada,_0x37c272,_0x18eeed){return db['SmsQueue'][_0x159b('0x4b')]({'where':{'id':_0x5daada['params']['id']}})[_0x159b('0x29')](handleEntityNotFound(_0x37c272,null))[_0x159b('0x29')](function(_0x6a6f0a){if(_0x6a6f0a){return _0x6a6f0a['addAgents'](_0x5daada['body'][_0x159b('0x6f')],_[_0x159b('0x85')](_0x5daada[_0x159b('0x62')],[_0x159b('0x6f'),'id'])||{})[_0x159b('0x86')](function(_0x174a47){for(var _0x18f72d=0x0;_0x18f72d<_0x5daada[_0x159b('0x62')][_0x159b('0x6f')][_0x159b('0x39')];_0x18f72d+=0x1){socket[_0x159b('0x6d')](_0x159b('0x6e'),{'UserId':_0x5daada[_0x159b('0x62')][_0x159b('0x6f')][_0x18f72d],'SmsQueueId':_0x5daada[_0x159b('0x48')]['id']});}return _0x174a47;});}})['then'](respondWithResult(_0x37c272,null))['catch'](handleError(_0x37c272,null));};exports[_0x159b('0x82')]=function(_0x2d1973,_0x4635a0,_0x20d2b0){return db[_0x159b('0x30')][_0x159b('0x4b')]({'where':{'id':_0x2d1973[_0x159b('0x48')]['id']}})[_0x159b('0x29')](handleEntityNotFound(_0x4635a0,null))['then'](function(_0x5bcfb1){if(_0x5bcfb1){return _0x5bcfb1['removeAgents'](_0x2d1973[_0x159b('0x33')]['ids'])[_0x159b('0x29')](function(){if(_[_0x159b('0x87')](_0x2d1973['query'][_0x159b('0x6f')])){for(var _0x409ed7=0x0;_0x409ed7<_0x2d1973[_0x159b('0x33')][_0x159b('0x6f')][_0x159b('0x39')];_0x409ed7+=0x1){socket[_0x159b('0x6d')](_0x159b('0x83'),{'UserId':Number(_0x2d1973[_0x159b('0x33')][_0x159b('0x6f')][_0x409ed7]),'SmsQueueId':Number(_0x2d1973[_0x159b('0x48')]['id'])});}}else{socket['emit'](_0x159b('0x83'),{'UserId':Number(_0x2d1973[_0x159b('0x33')]['ids']),'SmsQueueId':Number(_0x2d1973['params']['id'])});}});}})[_0x159b('0x29')](respondWithStatusCode(_0x4635a0,null))['catch'](handleError(_0x4635a0,null));};exports[_0x159b('0x88')]=function(_0x464d74,_0x1b2f6e,_0x39c533){var _0x295aea={};var _0x154f58={};var _0x38e5d1;var _0x20dd6b;return db[_0x159b('0x30')][_0x159b('0x55')]({'where':{'id':_0x464d74['params']['id']}})[_0x159b('0x29')](handleEntityNotFound(_0x1b2f6e,null))[_0x159b('0x29')](function(_0x445259){if(_0x445259){_0x38e5d1=_0x445259;_0x154f58['model']=_[_0x159b('0x34')](db[_0x159b('0x70')]['rawAttributes']);_0x154f58[_0x159b('0x33')]=_[_0x159b('0x34')](_0x464d74[_0x159b('0x33')]);_0x154f58[_0x159b('0x3e')]=_[_0x159b('0x37')](_0x154f58[_0x159b('0x35')],_0x154f58['query']);_0x295aea['attributes']=_[_0x159b('0x37')](_0x154f58[_0x159b('0x35')],qs[_0x159b('0x38')](_0x464d74[_0x159b('0x33')][_0x159b('0x38')]));_0x295aea[_0x159b('0x36')]=_0x295aea['attributes'][_0x159b('0x39')]?_0x295aea[_0x159b('0x36')]:_0x154f58['model'];_0x295aea[_0x159b('0x3c')]=qs['sort'](_0x464d74[_0x159b('0x33')]['sort']);_0x295aea['where']=qs[_0x159b('0x3e')](_['pick'](_0x464d74[_0x159b('0x33')],_0x154f58[_0x159b('0x3e')]));if(_0x464d74[_0x159b('0x33')][_0x159b('0x40')]){_0x295aea[_0x159b('0x41')]=_[_0x159b('0x42')](_0x295aea[_0x159b('0x41')],{'$or':_[_0x159b('0x32')](_0x295aea['attributes'],function(_0x26c83c){var _0x17a58b={};_0x17a58b[_0x26c83c]={'$like':'%'+_0x464d74[_0x159b('0x33')]['filter']+'%'};return _0x17a58b;})});}_0x295aea=_['merge']({},_0x295aea,_0x464d74['options']);return _0x38e5d1[_0x159b('0x88')](_0x295aea);}})['then'](function(_0x5cf5a9){if(_0x5cf5a9){_0x20dd6b=_0x5cf5a9[_0x159b('0x39')];if(!_0x464d74[_0x159b('0x33')]['hasOwnProperty'](_0x159b('0x3b'))){_0x295aea[_0x159b('0x24')]=qs[_0x159b('0x24')](_0x464d74[_0x159b('0x33')]['limit']);_0x295aea['offset']=qs[_0x159b('0x23')](_0x464d74[_0x159b('0x33')][_0x159b('0x23')]);}return _0x38e5d1[_0x159b('0x88')](_0x295aea);}})[_0x159b('0x29')](function(_0x34014b){if(_0x34014b){return _0x34014b?{'count':_0x20dd6b,'rows':_0x34014b}:null;}})[_0x159b('0x29')](respondWithResult(_0x1b2f6e,null))[_0x159b('0x46')](handleError(_0x1b2f6e,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 7f7a944..0e5d969 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 _0x3713=['hasOwnProperty','hook','exports','events','../../mysqldb','update','remove','emit'];(function(_0x46a40b,_0x13feab){var _0x18a262=function(_0x3134e7){while(--_0x3134e7){_0x46a40b['push'](_0x46a40b['shift']());}};_0x18a262(++_0x13feab);}(_0x3713,0xb3));var _0x3371=function(_0x1a76e3,_0x1a8858){_0x1a76e3=_0x1a76e3-0x0;var _0x42cee6=_0x3713[_0x1a76e3];return _0x42cee6;};'use strict';var EventEmitter=require(_0x3371('0x0'));var SmsQueue=require(_0x3371('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3371('0x2'),'afterDestroy':_0x3371('0x3')};function emitEvent(_0x4de86e){return function(_0xb42003,_0x4a3458,_0x9f729e){SmsQueueEvents[_0x3371('0x4')](_0x4de86e+':'+_0xb42003['id'],_0xb42003);SmsQueueEvents[_0x3371('0x4')](_0x4de86e,_0xb42003);_0x9f729e(null);};}for(var e in events){if(events[_0x3371('0x5')](e)){var event=events[e];SmsQueue[_0x3371('0x6')](e,emitEvent(event));}}module[_0x3371('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0xebec=['update','remove','emit','hasOwnProperty','hook','SmsQueue','save'];(function(_0x128cea,_0x615e4b){var _0x358597=function(_0x561acb){while(--_0x561acb){_0x128cea['push'](_0x128cea['shift']());}};_0x358597(++_0x615e4b);}(_0xebec,0xc2));var _0xcebe=function(_0x5880d4,_0x58c5e9){_0x5880d4=_0x5880d4-0x0;var _0x2d41c4=_0xebec[_0x5880d4];return _0x2d41c4;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0xcebe('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcebe('0x1'),'afterUpdate':_0xcebe('0x2'),'afterDestroy':_0xcebe('0x3')};function emitEvent(_0x97c16){return function(_0x494ac3,_0xf75577,_0x4da0ea){SmsQueueEvents[_0xcebe('0x4')](_0x97c16+':'+_0x494ac3['id'],_0x494ac3);SmsQueueEvents[_0xcebe('0x4')](_0x97c16,_0x494ac3);_0x4da0ea(null);};}for(var e in events){if(events[_0xcebe('0x5')](e)){var event=events[e];SmsQueue[_0xcebe('0x6')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 06014df..46fdd4b 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 _0xf3ba=['exports','define','SmsQueue','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x3fa518,_0x431cbe){var _0x269c91=function(_0x26d242){while(--_0x26d242){_0x3fa518['push'](_0x3fa518['shift']());}};_0x269c91(++_0x431cbe);}(_0xf3ba,0x7b));var _0xaf3b=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0xf3ba[_0x1d1d09];return _0x8827e;};'use strict';var _=require('lodash');var util=require(_0xaf3b('0x0'));var logger=require('../../config/logger')(_0xaf3b('0x1'));var moment=require(_0xaf3b('0x2'));var BPromise=require(_0xaf3b('0x3'));var rp=require(_0xaf3b('0x4'));var fs=require('fs');var path=require(_0xaf3b('0x5'));var rimraf=require(_0xaf3b('0x6'));var config=require(_0xaf3b('0x7'));var attributes=require(_0xaf3b('0x8'));module[_0xaf3b('0x9')]=function(_0xcaba5c,_0x5eac4f){return _0xcaba5c[_0xaf3b('0xa')](_0xaf3b('0xb'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3cf=['util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','lodash'];(function(_0x45e21a,_0x384a52){var _0x3b021e=function(_0x4a6708){while(--_0x4a6708){_0x45e21a['push'](_0x45e21a['shift']());}};_0x3b021e(++_0x384a52);}(_0xa3cf,0xc5));var _0xfa3c=function(_0x228295,_0x57d2ec){_0x228295=_0x228295-0x0;var _0x1a8da0=_0xa3cf[_0x228295];return _0x1a8da0;};'use strict';var _=require(_0xfa3c('0x0'));var util=require(_0xfa3c('0x1'));var logger=require(_0xfa3c('0x2'))('api');var moment=require(_0xfa3c('0x3'));var BPromise=require(_0xfa3c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfa3c('0x5'));var config=require(_0xfa3c('0x6'));var attributes=require(_0xfa3c('0x7'));module[_0xfa3c('0x8')]=function(_0x30519f,_0x345423){return _0x30519f[_0xfa3c('0x9')](_0xfa3c('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index b91ed10..1a21e58 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 _0x4f26=['attributes','include','map','model','ShowSmsQueue','find','raw','lodash','util','moment','ioredis','../../config/logger','jayson/promise','http','redis','defaults','localhost','./smsQueue.socket','register','request','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueue,\x20%s,\x20%s','message','catch','GetSmsQueue','SmsQueue','findAll','options'];(function(_0x370d43,_0x13e04d){var _0x4f552f=function(_0x2be8d0){while(--_0x2be8d0){_0x370d43['push'](_0x370d43['shift']());}};_0x4f552f(++_0x13e04d);}(_0x4f26,0x139));var _0x64f2=function(_0x5bdb19,_0x30372e){_0x5bdb19=_0x5bdb19-0x0;var _0x5f23d7=_0x4f26[_0x5bdb19];return _0x5f23d7;};'use strict';var _=require(_0x64f2('0x0'));var util=require(_0x64f2('0x1'));var moment=require(_0x64f2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x64f2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x64f2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x64f2('0x5'));var client=jayson['client'][_0x64f2('0x6')]({'port':0x232a});config[_0x64f2('0x7')]=_[_0x64f2('0x8')](config['redis'],{'host':_0x64f2('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x64f2('0x7')]));require(_0x64f2('0xa'))[_0x64f2('0xb')](socket);function respondWithRpcPromise(_0x214187,_0x254844,_0x7d6ee7){return new BPromise(function(_0x59ecd2,_0x2dc01b){return client[_0x64f2('0xc')](_0x214187,_0x7d6ee7)[_0x64f2('0xd')](function(_0x3f25ec){logger[_0x64f2('0xe')]('SmsQueue,\x20%s,\x20%s',_0x254844,_0x64f2('0xf'));logger[_0x64f2('0x10')](_0x64f2('0x11'),_0x254844,_0x64f2('0xf'),JSON[_0x64f2('0x12')](_0x3f25ec));if(_0x3f25ec[_0x64f2('0x13')]){if(_0x3f25ec['error']['code']===0x1f4){logger['error'](_0x64f2('0x14'),_0x254844,_0x3f25ec[_0x64f2('0x13')][_0x64f2('0x15')]);return _0x2dc01b(_0x3f25ec['error'][_0x64f2('0x15')]);}logger[_0x64f2('0x13')](_0x64f2('0x14'),_0x254844,_0x3f25ec[_0x64f2('0x13')][_0x64f2('0x15')]);return _0x59ecd2(_0x3f25ec[_0x64f2('0x13')]['message']);}else{logger[_0x64f2('0xe')](_0x64f2('0x14'),_0x254844,'request\x20sent');_0x59ecd2(_0x3f25ec['result']['message']);}})[_0x64f2('0x16')](function(_0x4e3b25){logger[_0x64f2('0x13')]('SmsQueue,\x20%s,\x20%s',_0x254844,_0x4e3b25);_0x2dc01b(_0x4e3b25);});});}exports[_0x64f2('0x17')]=function(_0x422974){var _0x3e8e5b=this;return new Promise(function(_0x419cf3,_0x537695){return db[_0x64f2('0x18')][_0x64f2('0x19')]({'raw':_0x422974[_0x64f2('0x1a')]?_0x422974['options']['raw']===undefined?!![]:![]:!![],'where':_0x422974[_0x64f2('0x1a')]?_0x422974['options']['where']||null:null,'attributes':_0x422974[_0x64f2('0x1a')]?_0x422974[_0x64f2('0x1a')][_0x64f2('0x1b')]||null:null,'limit':_0x422974[_0x64f2('0x1a')]?_0x422974[_0x64f2('0x1a')]['limit']||null:null,'include':_0x422974[_0x64f2('0x1a')]?_0x422974['options']['include']?_['map'](_0x422974['options'][_0x64f2('0x1c')],function(_0xe29cad){return{'model':db[_0xe29cad['model']],'as':_0xe29cad['as'],'attributes':_0xe29cad[_0x64f2('0x1b')],'include':_0xe29cad[_0x64f2('0x1c')]?_[_0x64f2('0x1d')](_0xe29cad[_0x64f2('0x1c')],function(_0x43991b){return{'model':db[_0x43991b[_0x64f2('0x1e')]],'as':_0x43991b['as'],'attributes':_0x43991b[_0x64f2('0x1b')],'include':_0x43991b[_0x64f2('0x1c')]?_[_0x64f2('0x1d')](_0x43991b[_0x64f2('0x1c')],function(_0x44a951){return{'model':db[_0x44a951['model']],'as':_0x44a951['as'],'attributes':_0x44a951[_0x64f2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x64f2('0xd')](function(_0x3f2f52){logger[_0x64f2('0xe')]('GetSmsQueue',_0x422974);logger[_0x64f2('0x10')](_0x64f2('0x17'),_0x422974,JSON['stringify'](_0x3f2f52));_0x419cf3(_0x3f2f52);})[_0x64f2('0x16')](function(_0x2c42fd){logger[_0x64f2('0x13')](_0x64f2('0x17'),_0x2c42fd[_0x64f2('0x15')],_0x422974);_0x537695(_0x3e8e5b[_0x64f2('0x13')](0x1f4,_0x2c42fd[_0x64f2('0x15')]));});});};exports[_0x64f2('0x1f')]=function(_0x52fc48){var _0x347152=this;return new Promise(function(_0x1b6c71,_0x3f36f9){return db[_0x64f2('0x18')][_0x64f2('0x20')]({'raw':_0x52fc48['options']?_0x52fc48[_0x64f2('0x1a')][_0x64f2('0x21')]===undefined?!![]:![]:!![],'where':_0x52fc48['options']?_0x52fc48[_0x64f2('0x1a')]['where']||null:null,'attributes':_0x52fc48[_0x64f2('0x1a')]?_0x52fc48['options'][_0x64f2('0x1b')]||null:null,'include':_0x52fc48[_0x64f2('0x1a')]?_0x52fc48[_0x64f2('0x1a')][_0x64f2('0x1c')]?_[_0x64f2('0x1d')](_0x52fc48['options'][_0x64f2('0x1c')],function(_0x1c09cf){return{'model':db[_0x1c09cf['model']],'as':_0x1c09cf['as'],'attributes':_0x1c09cf[_0x64f2('0x1b')],'include':_0x1c09cf['include']?_['map'](_0x1c09cf[_0x64f2('0x1c')],function(_0x3da234){return{'model':db[_0x3da234[_0x64f2('0x1e')]],'as':_0x3da234['as'],'attributes':_0x3da234[_0x64f2('0x1b')],'include':_0x3da234[_0x64f2('0x1c')]?_[_0x64f2('0x1d')](_0x3da234[_0x64f2('0x1c')],function(_0x3e8011){return{'model':db[_0x3e8011[_0x64f2('0x1e')]],'as':_0x3e8011['as'],'attributes':_0x3e8011[_0x64f2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x64f2('0xd')](function(_0x497830){logger[_0x64f2('0xe')](_0x64f2('0x1f'),_0x52fc48);logger[_0x64f2('0x10')](_0x64f2('0x1f'),_0x52fc48,JSON['stringify'](_0x497830));_0x1b6c71(_0x497830);})[_0x64f2('0x16')](function(_0x43fae6){logger[_0x64f2('0x13')](_0x64f2('0x1f'),_0x43fae6[_0x64f2('0x15')],_0x52fc48);_0x3f36f9(_0x347152[_0x64f2('0x13')](0x1f4,_0x43fae6[_0x64f2('0x15')]));});});}; \ No newline at end of file +var _0xff1a=['jayson/promise','http','redis','localhost','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include','map','ShowSmsQueue','find','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff1a,0x13d));var _0xaff1=function(_0x4ec099,_0x27e8cc){_0x4ec099=_0x4ec099-0x0;var _0x47d097=_0xff1a[_0x4ec099];return _0x47d097;};'use strict';var _=require(_0xaff1('0x0'));var util=require(_0xaff1('0x1'));var moment=require('moment');var BPromise=require(_0xaff1('0x2'));var rs=require(_0xaff1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaff1('0x4'))['db'];var utils=require(_0xaff1('0x5'));var logger=require(_0xaff1('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaff1('0x7'));var client=jayson['client'][_0xaff1('0x8')]({'port':0x232a});config[_0xaff1('0x9')]=_['defaults'](config[_0xaff1('0x9')],{'host':_0xaff1('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaff1('0x9')]));require(_0xaff1('0xb'))['register'](socket);function respondWithRpcPromise(_0x438ab4,_0x1ab260,_0x132f0c){return new BPromise(function(_0x381340,_0x167f46){return client[_0xaff1('0xc')](_0x438ab4,_0x132f0c)[_0xaff1('0xd')](function(_0x17cbb1){logger[_0xaff1('0xe')](_0xaff1('0xf'),_0x1ab260,_0xaff1('0x10'));logger[_0xaff1('0x11')](_0xaff1('0x12'),_0x1ab260,'request\x20sent',JSON[_0xaff1('0x13')](_0x17cbb1));if(_0x17cbb1[_0xaff1('0x14')]){if(_0x17cbb1['error']['code']===0x1f4){logger[_0xaff1('0x14')](_0xaff1('0xf'),_0x1ab260,_0x17cbb1[_0xaff1('0x14')]['message']);return _0x167f46(_0x17cbb1[_0xaff1('0x14')]['message']);}logger[_0xaff1('0x14')](_0xaff1('0xf'),_0x1ab260,_0x17cbb1[_0xaff1('0x14')][_0xaff1('0x15')]);return _0x381340(_0x17cbb1['error'][_0xaff1('0x15')]);}else{logger[_0xaff1('0xe')](_0xaff1('0xf'),_0x1ab260,_0xaff1('0x10'));_0x381340(_0x17cbb1[_0xaff1('0x16')][_0xaff1('0x15')]);}})[_0xaff1('0x17')](function(_0xec0a85){logger[_0xaff1('0x14')](_0xaff1('0xf'),_0x1ab260,_0xec0a85);_0x167f46(_0xec0a85);});});}exports[_0xaff1('0x18')]=function(_0x3b67c5){var _0x59ec96=this;return new Promise(function(_0x300a0,_0x5bc558){return db[_0xaff1('0x19')][_0xaff1('0x1a')]({'raw':_0x3b67c5['options']?_0x3b67c5[_0xaff1('0x1b')][_0xaff1('0x1c')]===undefined?!![]:![]:!![],'where':_0x3b67c5[_0xaff1('0x1b')]?_0x3b67c5['options'][_0xaff1('0x1d')]||null:null,'attributes':_0x3b67c5['options']?_0x3b67c5['options'][_0xaff1('0x1e')]||null:null,'limit':_0x3b67c5[_0xaff1('0x1b')]?_0x3b67c5[_0xaff1('0x1b')]['limit']||null:null,'include':_0x3b67c5[_0xaff1('0x1b')]?_0x3b67c5[_0xaff1('0x1b')][_0xaff1('0x1f')]?_[_0xaff1('0x20')](_0x3b67c5[_0xaff1('0x1b')][_0xaff1('0x1f')],function(_0x11db90){return{'model':db[_0x11db90['model']],'as':_0x11db90['as'],'attributes':_0x11db90[_0xaff1('0x1e')],'include':_0x11db90[_0xaff1('0x1f')]?_[_0xaff1('0x20')](_0x11db90[_0xaff1('0x1f')],function(_0x5b8e5d){return{'model':db[_0x5b8e5d['model']],'as':_0x5b8e5d['as'],'attributes':_0x5b8e5d['attributes'],'include':_0x5b8e5d[_0xaff1('0x1f')]?_[_0xaff1('0x20')](_0x5b8e5d[_0xaff1('0x1f')],function(_0x53ed93){return{'model':db[_0x53ed93['model']],'as':_0x53ed93['as'],'attributes':_0x53ed93[_0xaff1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaff1('0xd')](function(_0x258809){logger[_0xaff1('0xe')]('GetSmsQueue',_0x3b67c5);logger['debug']('GetSmsQueue',_0x3b67c5,JSON['stringify'](_0x258809));_0x300a0(_0x258809);})[_0xaff1('0x17')](function(_0x30c0df){logger[_0xaff1('0x14')](_0xaff1('0x18'),_0x30c0df[_0xaff1('0x15')],_0x3b67c5);_0x5bc558(_0x59ec96[_0xaff1('0x14')](0x1f4,_0x30c0df[_0xaff1('0x15')]));});});};exports[_0xaff1('0x21')]=function(_0x5c02ef){var _0x585bc3=this;return new Promise(function(_0x2cc209,_0x3d2533){return db[_0xaff1('0x19')][_0xaff1('0x22')]({'raw':_0x5c02ef[_0xaff1('0x1b')]?_0x5c02ef[_0xaff1('0x1b')][_0xaff1('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c02ef[_0xaff1('0x1b')]?_0x5c02ef[_0xaff1('0x1b')][_0xaff1('0x1d')]||null:null,'attributes':_0x5c02ef[_0xaff1('0x1b')]?_0x5c02ef[_0xaff1('0x1b')]['attributes']||null:null,'include':_0x5c02ef[_0xaff1('0x1b')]?_0x5c02ef[_0xaff1('0x1b')][_0xaff1('0x1f')]?_[_0xaff1('0x20')](_0x5c02ef['options']['include'],function(_0x32e52b){return{'model':db[_0x32e52b[_0xaff1('0x23')]],'as':_0x32e52b['as'],'attributes':_0x32e52b['attributes'],'include':_0x32e52b[_0xaff1('0x1f')]?_[_0xaff1('0x20')](_0x32e52b[_0xaff1('0x1f')],function(_0x5329b6){return{'model':db[_0x5329b6[_0xaff1('0x23')]],'as':_0x5329b6['as'],'attributes':_0x5329b6['attributes'],'include':_0x5329b6['include']?_[_0xaff1('0x20')](_0x5329b6[_0xaff1('0x1f')],function(_0x1a62be){return{'model':db[_0x1a62be[_0xaff1('0x23')]],'as':_0x1a62be['as'],'attributes':_0x1a62be[_0xaff1('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x222a3d){logger[_0xaff1('0xe')](_0xaff1('0x21'),_0x5c02ef);logger['debug'](_0xaff1('0x21'),_0x5c02ef,JSON[_0xaff1('0x13')](_0x222a3d));_0x2cc209(_0x222a3d);})[_0xaff1('0x17')](function(_0x536a83){logger[_0xaff1('0x14')](_0xaff1('0x21'),_0x536a83['message'],_0x5c02ef);_0x3d2533(_0x585bc3[_0xaff1('0x14')](0x1f4,_0x536a83[_0xaff1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 78895ff..d13d597 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 _0xa38b=['register','length','smsQueue:','./smsQueue.events','save','remove','update','emit'];(function(_0x371549,_0x2eb3f7){var _0x3df89a=function(_0x6d30f7){while(--_0x6d30f7){_0x371549['push'](_0x371549['shift']());}};_0x3df89a(++_0x2eb3f7);}(_0xa38b,0xbb));var _0xba38=function(_0x49b9f2,_0x14f2e4){_0x49b9f2=_0x49b9f2-0x0;var _0x1de0f1=_0xa38b[_0x49b9f2];return _0x1de0f1;};'use strict';var SmsQueueEvents=require(_0xba38('0x0'));var events=[_0xba38('0x1'),_0xba38('0x2'),_0xba38('0x3')];function createListener(_0x57bc37,_0x3db103){return function(_0x11b5dd){_0x3db103[_0xba38('0x4')](_0x57bc37,_0x11b5dd);};}function removeListener(_0x4473e5,_0xcd3f00){return function(){SmsQueueEvents['removeListener'](_0x4473e5,_0xcd3f00);};}exports[_0xba38('0x5')]=function(_0x1e41f6){for(var _0x17ff5a=0x0,_0x232a96=events[_0xba38('0x6')];_0x17ff5a<_0x232a96;_0x17ff5a++){var _0x53ad78=events[_0x17ff5a];var _0xb1abb7=createListener(_0xba38('0x7')+_0x53ad78,_0x1e41f6);SmsQueueEvents['on'](_0x53ad78,_0xb1abb7);}}; \ No newline at end of file +var _0xae79=['emit','removeListener','register','length','smsQueue:','save','update'];(function(_0x81972,_0x40e911){var _0x8608e8=function(_0x799332){while(--_0x799332){_0x81972['push'](_0x81972['shift']());}};_0x8608e8(++_0x40e911);}(_0xae79,0x1a2));var _0x9ae7=function(_0x2d4245,_0x556774){_0x2d4245=_0x2d4245-0x0;var _0x29f6d8=_0xae79[_0x2d4245];return _0x29f6d8;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x9ae7('0x0'),'remove',_0x9ae7('0x1')];function createListener(_0x4f6e94,_0x4be40e){return function(_0x4126bf){_0x4be40e[_0x9ae7('0x2')](_0x4f6e94,_0x4126bf);};}function removeListener(_0x5be6f7,_0x1f80e5){return function(){SmsQueueEvents[_0x9ae7('0x3')](_0x5be6f7,_0x1f80e5);};}exports[_0x9ae7('0x4')]=function(_0x4aecd8){for(var _0x4481e8=0x0,_0x346d77=events[_0x9ae7('0x5')];_0x4481e8<_0x346d77;_0x4481e8++){var _0x2abb28=events[_0x4481e8];var _0x6d7347=createListener(_0x9ae7('0x6')+_0x2abb28,_0x4aecd8);SmsQueueEvents['on'](_0x2abb28,_0x6d7347);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 225fd73..229b46a 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 _0x61d9=['update','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x61d9,0x193));var _0x961d=function(_0x317034,_0x192fa8){_0x317034=_0x317034-0x0;var _0x4e331a=_0x61d9[_0x317034];return _0x4e331a;};'use strict';var multer=require('multer');var util=require(_0x961d('0x0'));var path=require(_0x961d('0x1'));var timeout=require(_0x961d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x961d('0x3'));var auth=require(_0x961d('0x4'));var interaction=require(_0x961d('0x5'));var config=require(_0x961d('0x6'));var controller=require(_0x961d('0x7'));router['get']('/',auth[_0x961d('0x8')](),controller[_0x961d('0x9')]);router[_0x961d('0xa')](_0x961d('0xb'),auth[_0x961d('0x8')](),controller[_0x961d('0xc')]);router['get'](_0x961d('0xd'),auth[_0x961d('0x8')](),controller[_0x961d('0xe')]);router[_0x961d('0xf')]('/',auth[_0x961d('0x8')](),controller[_0x961d('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x961d('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x961d('0x12')]);module[_0x961d('0x13')]=router; \ No newline at end of file +var _0x506e=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','create'];(function(_0x1dc174,_0x501282){var _0x5b627c=function(_0xf40264){while(--_0xf40264){_0x1dc174['push'](_0x1dc174['shift']());}};_0x5b627c(++_0x501282);}(_0x506e,0x68));var _0xe506=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x506e[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0xe506('0x0'));var util=require(_0xe506('0x1'));var path=require(_0xe506('0x2'));var timeout=require(_0xe506('0x3'));var express=require(_0xe506('0x4'));var router=express[_0xe506('0x5')]();var fs_extra=require(_0xe506('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe506('0x7'));var config=require(_0xe506('0x8'));var controller=require(_0xe506('0x9'));router[_0xe506('0xa')]('/',auth[_0xe506('0xb')](),controller[_0xe506('0xc')]);router[_0xe506('0xa')]('/describe',auth[_0xe506('0xb')](),controller[_0xe506('0xd')]);router[_0xe506('0xa')](_0xe506('0xe'),auth[_0xe506('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xe506('0xf')]);router[_0xe506('0x10')]('/:id',auth[_0xe506('0xb')](),controller[_0xe506('0x11')]);router[_0xe506('0x12')]('/:id',auth[_0xe506('0xb')](),controller[_0xe506('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 2adcb39..96704d6 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 _0x7be0=['sequelize','exports','STRING','DATE','moment'];(function(_0x2c3ff2,_0x49c652){var _0x2dbf25=function(_0x1ec583){while(--_0x1ec583){_0x2c3ff2['push'](_0x2c3ff2['shift']());}};_0x2dbf25(++_0x49c652);}(_0x7be0,0x77));var _0x07be=function(_0x3eb19a,_0x50c488){_0x3eb19a=_0x3eb19a-0x0;var _0x47510c=_0x7be0[_0x3eb19a];return _0x47510c;};'use strict';var moment=require(_0x07be('0x0'));var Sequelize=require(_0x07be('0x1'));module[_0x07be('0x2')]={'uniqueid':{'type':Sequelize[_0x07be('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x07be('0x3')]},'joinAt':{'type':Sequelize[_0x07be('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x07be('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x07be('0x3')]}}; \ No newline at end of file +var _0xe119=['sequelize','exports','STRING','DATE'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe119,0x10c));var _0x9e11=function(_0x3a86a7,_0x12ade0){_0x3a86a7=_0x3a86a7-0x0;var _0x19b1b6=_0xe119[_0x3a86a7];return _0x19b1b6;};'use strict';var moment=require('moment');var Sequelize=require(_0x9e11('0x0'));module[_0x9e11('0x1')]={'uniqueid':{'type':Sequelize[_0x9e11('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9e11('0x2')]},'joinAt':{'type':Sequelize[_0x9e11('0x3')]},'leaveAt':{'type':Sequelize[_0x9e11('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9e11('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 628627b..cd49081 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 _0x49f1=['undefined','limit','set','Content-Range','apply','save','update','destroy','end','stack','name','send','SmsQueueReport','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','type','count','includeAll','rows','then','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x63ce6d,_0x329e70){var _0x3d2b1a=function(_0x129ae6){while(--_0x129ae6){_0x63ce6d['push'](_0x63ce6d['shift']());}};_0x3d2b1a(++_0x329e70);}(_0x49f1,0x153));var _0x149f=function(_0x211397,_0x52b103){_0x211397=_0x211397-0x0;var _0x3df56c=_0x49f1[_0x211397];return _0x3df56c;};'use strict';var emlformat=require(_0x149f('0x0'));var rimraf=require(_0x149f('0x1'));var zipdir=require(_0x149f('0x2'));var jsonpatch=require(_0x149f('0x3'));var rp=require(_0x149f('0x4'));var moment=require(_0x149f('0x5'));var BPromise=require(_0x149f('0x6'));var Mustache=require('mustache');var util=require(_0x149f('0x7'));var path=require('path');var sox=require(_0x149f('0x8'));var csv=require('to-csv');var ejs=require(_0x149f('0x9'));var fs=require('fs');var fs_extra=require(_0x149f('0xa'));var _=require(_0x149f('0xb'));var squel=require(_0x149f('0xc'));var crypto=require(_0x149f('0xd'));var jsforce=require(_0x149f('0xe'));var deskjs=require(_0x149f('0xf'));var toCsv=require(_0x149f('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x149f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x149f('0x12'));var as=require(_0x149f('0x13'));var hardwareService=require(_0x149f('0x14'));var logger=require(_0x149f('0x15'))(_0x149f('0x16'));var utils=require(_0x149f('0x17'));var config=require(_0x149f('0x18'));var licenseUtil=require(_0x149f('0x19'));var db=require(_0x149f('0x1a'))['db'];function respondWithStatusCode(_0x52487d,_0x70d2a9){_0x70d2a9=_0x70d2a9||0xcc;return function(_0x134c4d){if(_0x134c4d){return _0x52487d[_0x149f('0x1b')](_0x70d2a9);}return _0x52487d['status'](_0x70d2a9)['end']();};}function respondWithResult(_0x550aa2,_0x3a8cf0){_0x3a8cf0=_0x3a8cf0||0xc8;return function(_0x365946){if(_0x365946){return _0x550aa2[_0x149f('0x1c')](_0x3a8cf0)[_0x149f('0x1d')](_0x365946);}};}function respondWithFilteredResult(_0x4546d7,_0x23d6f9){return function(_0x55d256){if(_0x55d256){var _0x5cb101=typeof _0x23d6f9[_0x149f('0x1e')]===_0x149f('0x1f')&&typeof _0x23d6f9[_0x149f('0x20')]===_0x149f('0x1f');var _0x419083=_0x55d256['count'];var _0x909fc0=_0x5cb101?0x0:_0x23d6f9[_0x149f('0x1e')];var _0x5ce63e=_0x5cb101?_0x55d256['count']:_0x23d6f9['offset']+_0x23d6f9[_0x149f('0x20')];var _0x50d107;if(_0x5ce63e>=_0x419083){_0x5ce63e=_0x419083;_0x50d107=0xc8;}else{_0x50d107=0xce;}_0x4546d7[_0x149f('0x1c')](_0x50d107);return _0x4546d7[_0x149f('0x21')](_0x149f('0x22'),_0x909fc0+'-'+_0x5ce63e+'/'+_0x419083)[_0x149f('0x1d')](_0x55d256);}return null;};}function patchUpdates(_0x18e450){return function(_0xdc966e){try{jsonpatch[_0x149f('0x23')](_0xdc966e,_0x18e450,!![]);}catch(_0x5a48e2){return BPromise['reject'](_0x5a48e2);}return _0xdc966e[_0x149f('0x24')]();};}function saveUpdates(_0x44bab1,_0x2793f9){return function(_0x3b60da){if(_0x3b60da){return _0x3b60da[_0x149f('0x25')](_0x44bab1)['then'](function(_0x2ecb81){return _0x2ecb81;});}return null;};}function removeEntity(_0xc96f43,_0x25307a){return function(_0x362f46){if(_0x362f46){return _0x362f46[_0x149f('0x26')]()['then'](function(){_0xc96f43['status'](0xcc)[_0x149f('0x27')]();});}};}function handleEntityNotFound(_0x9d84b5,_0x564701){return function(_0x491274){if(!_0x491274){_0x9d84b5[_0x149f('0x1b')](0x194);}return _0x491274;};}function handleError(_0x406cb2,_0x2d286f){_0x2d286f=_0x2d286f||0x1f4;return function(_0x191698){logger['error'](_0x191698[_0x149f('0x28')]);if(_0x191698[_0x149f('0x29')]){delete _0x191698['name'];}_0x406cb2[_0x149f('0x1c')](_0x2d286f)[_0x149f('0x2a')](_0x191698);};}exports['index']=function(_0xb30924,_0x10534b){var _0x33b519={},_0x4fb7eb={},_0xaf82f2={'count':0x0,'rows':[]};var _0x1219df=_['map'](db[_0x149f('0x2b')][_0x149f('0x2c')],function(_0x144899){return{'name':_0x144899[_0x149f('0x2d')],'type':_0x144899['type']['key']};});_0x4fb7eb[_0x149f('0x2e')]=_[_0x149f('0x2f')](_0x1219df,_0x149f('0x29'));_0x4fb7eb[_0x149f('0x30')]=_[_0x149f('0x31')](_0xb30924[_0x149f('0x30')]);_0x4fb7eb[_0x149f('0x32')]=_[_0x149f('0x33')](_0x4fb7eb[_0x149f('0x2e')],_0x4fb7eb[_0x149f('0x30')]);_0x33b519[_0x149f('0x34')]=_[_0x149f('0x33')](_0x4fb7eb[_0x149f('0x2e')],qs[_0x149f('0x35')](_0xb30924[_0x149f('0x30')][_0x149f('0x35')]));_0x33b519[_0x149f('0x34')]=_0x33b519[_0x149f('0x34')]['length']?_0x33b519[_0x149f('0x34')]:_0x4fb7eb[_0x149f('0x2e')];if(!_0xb30924['query'][_0x149f('0x36')]('nolimit')){_0x33b519[_0x149f('0x20')]=qs[_0x149f('0x20')](_0xb30924[_0x149f('0x30')][_0x149f('0x20')]);_0x33b519[_0x149f('0x1e')]=qs[_0x149f('0x1e')](_0xb30924[_0x149f('0x30')][_0x149f('0x1e')]);}_0x33b519[_0x149f('0x37')]=qs[_0x149f('0x38')](_0xb30924['query'][_0x149f('0x38')]);_0x33b519[_0x149f('0x39')]=qs[_0x149f('0x32')](_['pick'](_0xb30924[_0x149f('0x30')],_0x4fb7eb[_0x149f('0x32')]),_0x1219df);if(_0xb30924['query'][_0x149f('0x3a')]){_0x33b519['where']=_[_0x149f('0x3b')](_0x33b519[_0x149f('0x39')],{'$or':_[_0x149f('0x2f')](_0x1219df,function(_0x4c7864){if(_0x4c7864[_0x149f('0x3c')]!=='VIRTUAL'){var _0x28fbfd={};_0x28fbfd[_0x4c7864['name']]={'$like':'%'+_0xb30924[_0x149f('0x30')][_0x149f('0x3a')]+'%'};return _0x28fbfd;}})});}_0x33b519=_[_0x149f('0x3b')]({},_0x33b519,_0xb30924['options']);var _0x3c4c47={'where':_0x33b519[_0x149f('0x39')]};return db[_0x149f('0x2b')][_0x149f('0x3d')](_0x3c4c47)['then'](function(_0x4af994){_0xaf82f2[_0x149f('0x3d')]=_0x4af994;if(_0xb30924[_0x149f('0x30')][_0x149f('0x3e')]){_0x33b519['include']=[{'all':!![]}];}return db[_0x149f('0x2b')]['findAll'](_0x33b519);})['then'](function(_0xf64290){_0xaf82f2[_0x149f('0x3f')]=_0xf64290;return _0xaf82f2;})[_0x149f('0x40')](respondWithFilteredResult(_0x10534b,_0x33b519))[_0x149f('0x41')](handleError(_0x10534b,null));};exports[_0x149f('0x42')]=function(_0x45a6ec,_0x904985){var _0x3906fa={'raw':!![],'where':{'id':_0x45a6ec[_0x149f('0x43')]['id']}},_0x59a7cc={};_0x59a7cc[_0x149f('0x2e')]=_[_0x149f('0x31')](db[_0x149f('0x2b')]['rawAttributes']);_0x59a7cc[_0x149f('0x30')]=_[_0x149f('0x31')](_0x45a6ec['query']);_0x59a7cc[_0x149f('0x32')]=_[_0x149f('0x33')](_0x59a7cc[_0x149f('0x2e')],_0x59a7cc[_0x149f('0x30')]);_0x3906fa[_0x149f('0x34')]=_[_0x149f('0x33')](_0x59a7cc[_0x149f('0x2e')],qs['fields'](_0x45a6ec[_0x149f('0x30')][_0x149f('0x35')]));_0x3906fa[_0x149f('0x34')]=_0x3906fa[_0x149f('0x34')]['length']?_0x3906fa[_0x149f('0x34')]:_0x59a7cc[_0x149f('0x2e')];if(_0x45a6ec[_0x149f('0x30')]['includeAll']){_0x3906fa[_0x149f('0x44')]=[{'all':!![]}];}_0x3906fa=_[_0x149f('0x3b')]({},_0x3906fa,_0x45a6ec[_0x149f('0x45')]);return db[_0x149f('0x2b')][_0x149f('0x46')](_0x3906fa)[_0x149f('0x40')](handleEntityNotFound(_0x904985,null))['then'](respondWithResult(_0x904985,null))['catch'](handleError(_0x904985,null));};exports['create']=function(_0x48bbe3,_0x271656){return db['SmsQueueReport'][_0x149f('0x47')](_0x48bbe3[_0x149f('0x48')],{})[_0x149f('0x40')](respondWithResult(_0x271656,0xc9))['catch'](handleError(_0x271656,null));};exports[_0x149f('0x25')]=function(_0x45b80c,_0x3e4170){if(_0x45b80c[_0x149f('0x48')]['id']){delete _0x45b80c[_0x149f('0x48')]['id'];}return db[_0x149f('0x2b')]['find']({'where':{'id':_0x45b80c[_0x149f('0x43')]['id']}})[_0x149f('0x40')](handleEntityNotFound(_0x3e4170,null))['then'](saveUpdates(_0x45b80c['body'],null))[_0x149f('0x40')](respondWithResult(_0x3e4170,null))[_0x149f('0x41')](handleError(_0x3e4170,null));};exports[_0x149f('0x26')]=function(_0x3b0cca,_0x291352){return db['SmsQueueReport'][_0x149f('0x46')]({'where':{'id':_0x3b0cca[_0x149f('0x43')]['id']}})['then'](handleEntityNotFound(_0x291352,null))[_0x149f('0x40')](removeEntity(_0x291352,null))[_0x149f('0x41')](handleError(_0x291352,null));};exports[_0x149f('0x49')]=function(_0x133f1c,_0x494799){return db[_0x149f('0x2b')][_0x149f('0x49')]()[_0x149f('0x40')](respondWithResult(_0x494799,null))[_0x149f('0x41')](handleError(_0x494799,null));}; \ No newline at end of file +var _0xe713=['catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','set','Content-Range','json','save','then','destroy','error','stack','name','index','map','SmsQueueReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','limit','offset','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','find'];(function(_0x481a0f,_0x37e86b){var _0x4cfb39=function(_0xa62b76){while(--_0xa62b76){_0x481a0f['push'](_0x481a0f['shift']());}};_0x4cfb39(++_0x37e86b);}(_0xe713,0x125));var _0x3e71=function(_0x1035eb,_0x4023d7){_0x1035eb=_0x1035eb-0x0;var _0x35a2db=_0xe713[_0x1035eb];return _0x35a2db;};'use strict';var emlformat=require(_0x3e71('0x0'));var rimraf=require(_0x3e71('0x1'));var zipdir=require(_0x3e71('0x2'));var jsonpatch=require(_0x3e71('0x3'));var rp=require(_0x3e71('0x4'));var moment=require('moment');var BPromise=require(_0x3e71('0x5'));var Mustache=require(_0x3e71('0x6'));var util=require(_0x3e71('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3e71('0x8'));var fs=require('fs');var fs_extra=require(_0x3e71('0x9'));var _=require(_0x3e71('0xa'));var squel=require(_0x3e71('0xb'));var crypto=require(_0x3e71('0xc'));var jsforce=require(_0x3e71('0xd'));var deskjs=require(_0x3e71('0xe'));var toCsv=require(_0x3e71('0xf'));var querystring=require('querystring');var Papa=require(_0x3e71('0x10'));var Redis=require('ioredis');var authService=require(_0x3e71('0x11'));var qs=require(_0x3e71('0x12'));var as=require(_0x3e71('0x13'));var hardwareService=require(_0x3e71('0x14'));var logger=require('../../config/logger')(_0x3e71('0x15'));var utils=require(_0x3e71('0x16'));var config=require(_0x3e71('0x17'));var licenseUtil=require(_0x3e71('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b5585,_0xd7c005){_0xd7c005=_0xd7c005||0xcc;return function(_0x2a2511){if(_0x2a2511){return _0x2b5585[_0x3e71('0x19')](_0xd7c005);}return _0x2b5585[_0x3e71('0x1a')](_0xd7c005)[_0x3e71('0x1b')]();};}function respondWithResult(_0x57dabc,_0x26f194){_0x26f194=_0x26f194||0xc8;return function(_0x36459b){if(_0x36459b){return _0x57dabc[_0x3e71('0x1a')](_0x26f194)['json'](_0x36459b);}};}function respondWithFilteredResult(_0x169e26,_0x7e22bc){return function(_0x219172){if(_0x219172){var _0x2865bb=typeof _0x7e22bc['offset']===_0x3e71('0x1c')&&typeof _0x7e22bc['limit']===_0x3e71('0x1c');var _0x49df03=_0x219172['count'];var _0xa8e2ba=_0x2865bb?0x0:_0x7e22bc['offset'];var _0x499c60=_0x2865bb?_0x219172[_0x3e71('0x1d')]:_0x7e22bc['offset']+_0x7e22bc['limit'];var _0x4d466c;if(_0x499c60>=_0x49df03){_0x499c60=_0x49df03;_0x4d466c=0xc8;}else{_0x4d466c=0xce;}_0x169e26['status'](_0x4d466c);return _0x169e26[_0x3e71('0x1e')](_0x3e71('0x1f'),_0xa8e2ba+'-'+_0x499c60+'/'+_0x49df03)[_0x3e71('0x20')](_0x219172);}return null;};}function patchUpdates(_0x3ab46b){return function(_0x4895f0){try{jsonpatch['apply'](_0x4895f0,_0x3ab46b,!![]);}catch(_0x135af4){return BPromise['reject'](_0x135af4);}return _0x4895f0[_0x3e71('0x21')]();};}function saveUpdates(_0xc33b85,_0x554c5b){return function(_0x5680ea){if(_0x5680ea){return _0x5680ea['update'](_0xc33b85)[_0x3e71('0x22')](function(_0x364e56){return _0x364e56;});}return null;};}function removeEntity(_0x3b7325,_0x453ae3){return function(_0x5de725){if(_0x5de725){return _0x5de725[_0x3e71('0x23')]()[_0x3e71('0x22')](function(){_0x3b7325[_0x3e71('0x1a')](0xcc)[_0x3e71('0x1b')]();});}};}function handleEntityNotFound(_0xb98668,_0x2de4a5){return function(_0x1cb161){if(!_0x1cb161){_0xb98668['sendStatus'](0x194);}return _0x1cb161;};}function handleError(_0x57b6c1,_0x27e355){_0x27e355=_0x27e355||0x1f4;return function(_0x454012){logger[_0x3e71('0x24')](_0x454012[_0x3e71('0x25')]);if(_0x454012[_0x3e71('0x26')]){delete _0x454012[_0x3e71('0x26')];}_0x57b6c1[_0x3e71('0x1a')](_0x27e355)['send'](_0x454012);};}exports[_0x3e71('0x27')]=function(_0x21ff3c,_0x577b93){var _0xb7f549={},_0x282d82={},_0x2fa571={'count':0x0,'rows':[]};var _0x13fcc0=_[_0x3e71('0x28')](db[_0x3e71('0x29')][_0x3e71('0x2a')],function(_0x4cea84){return{'name':_0x4cea84['fieldName'],'type':_0x4cea84[_0x3e71('0x2b')]['key']};});_0x282d82[_0x3e71('0x2c')]=_[_0x3e71('0x28')](_0x13fcc0,_0x3e71('0x26'));_0x282d82[_0x3e71('0x2d')]=_[_0x3e71('0x2e')](_0x21ff3c[_0x3e71('0x2d')]);_0x282d82['filters']=_[_0x3e71('0x2f')](_0x282d82[_0x3e71('0x2c')],_0x282d82[_0x3e71('0x2d')]);_0xb7f549[_0x3e71('0x30')]=_['intersection'](_0x282d82[_0x3e71('0x2c')],qs[_0x3e71('0x31')](_0x21ff3c['query']['fields']));_0xb7f549[_0x3e71('0x30')]=_0xb7f549[_0x3e71('0x30')][_0x3e71('0x32')]?_0xb7f549['attributes']:_0x282d82[_0x3e71('0x2c')];if(!_0x21ff3c[_0x3e71('0x2d')]['hasOwnProperty']('nolimit')){_0xb7f549['limit']=qs[_0x3e71('0x33')](_0x21ff3c[_0x3e71('0x2d')]['limit']);_0xb7f549['offset']=qs[_0x3e71('0x34')](_0x21ff3c[_0x3e71('0x2d')]['offset']);}_0xb7f549[_0x3e71('0x35')]=qs[_0x3e71('0x36')](_0x21ff3c[_0x3e71('0x2d')]['sort']);_0xb7f549[_0x3e71('0x37')]=qs['filters'](_[_0x3e71('0x38')](_0x21ff3c['query'],_0x282d82[_0x3e71('0x39')]),_0x13fcc0);if(_0x21ff3c[_0x3e71('0x2d')]['filter']){_0xb7f549[_0x3e71('0x37')]=_[_0x3e71('0x3a')](_0xb7f549['where'],{'$or':_[_0x3e71('0x28')](_0x13fcc0,function(_0x3a120b){if(_0x3a120b[_0x3e71('0x2b')]!==_0x3e71('0x3b')){var _0x19677c={};_0x19677c[_0x3a120b[_0x3e71('0x26')]]={'$like':'%'+_0x21ff3c[_0x3e71('0x2d')][_0x3e71('0x3c')]+'%'};return _0x19677c;}})});}_0xb7f549=_[_0x3e71('0x3a')]({},_0xb7f549,_0x21ff3c[_0x3e71('0x3d')]);var _0x482a5a={'where':_0xb7f549[_0x3e71('0x37')]};return db[_0x3e71('0x29')][_0x3e71('0x1d')](_0x482a5a)[_0x3e71('0x22')](function(_0x4f3f14){_0x2fa571[_0x3e71('0x1d')]=_0x4f3f14;if(_0x21ff3c[_0x3e71('0x2d')][_0x3e71('0x3e')]){_0xb7f549[_0x3e71('0x3f')]=[{'all':!![]}];}return db[_0x3e71('0x29')][_0x3e71('0x40')](_0xb7f549);})[_0x3e71('0x22')](function(_0x28487b){_0x2fa571['rows']=_0x28487b;return _0x2fa571;})[_0x3e71('0x22')](respondWithFilteredResult(_0x577b93,_0xb7f549))['catch'](handleError(_0x577b93,null));};exports['show']=function(_0xb6811f,_0x58e480){var _0x2e6510={'raw':!![],'where':{'id':_0xb6811f[_0x3e71('0x41')]['id']}},_0x1cc916={};_0x1cc916['model']=_[_0x3e71('0x2e')](db[_0x3e71('0x29')][_0x3e71('0x2a')]);_0x1cc916[_0x3e71('0x2d')]=_[_0x3e71('0x2e')](_0xb6811f[_0x3e71('0x2d')]);_0x1cc916['filters']=_[_0x3e71('0x2f')](_0x1cc916['model'],_0x1cc916['query']);_0x2e6510[_0x3e71('0x30')]=_[_0x3e71('0x2f')](_0x1cc916[_0x3e71('0x2c')],qs[_0x3e71('0x31')](_0xb6811f['query'][_0x3e71('0x31')]));_0x2e6510[_0x3e71('0x30')]=_0x2e6510['attributes'][_0x3e71('0x32')]?_0x2e6510['attributes']:_0x1cc916[_0x3e71('0x2c')];if(_0xb6811f['query'][_0x3e71('0x3e')]){_0x2e6510['include']=[{'all':!![]}];}_0x2e6510=_[_0x3e71('0x3a')]({},_0x2e6510,_0xb6811f['options']);return db[_0x3e71('0x29')][_0x3e71('0x42')](_0x2e6510)[_0x3e71('0x22')](handleEntityNotFound(_0x58e480,null))[_0x3e71('0x22')](respondWithResult(_0x58e480,null))[_0x3e71('0x43')](handleError(_0x58e480,null));};exports[_0x3e71('0x44')]=function(_0xf22e4d,_0x4388d2){return db['SmsQueueReport']['create'](_0xf22e4d[_0x3e71('0x45')],{})['then'](respondWithResult(_0x4388d2,0xc9))['catch'](handleError(_0x4388d2,null));};exports[_0x3e71('0x46')]=function(_0x3d46ae,_0x344915){if(_0x3d46ae[_0x3e71('0x45')]['id']){delete _0x3d46ae[_0x3e71('0x45')]['id'];}return db[_0x3e71('0x29')][_0x3e71('0x42')]({'where':{'id':_0x3d46ae[_0x3e71('0x41')]['id']}})[_0x3e71('0x22')](handleEntityNotFound(_0x344915,null))[_0x3e71('0x22')](saveUpdates(_0x3d46ae[_0x3e71('0x45')],null))[_0x3e71('0x22')](respondWithResult(_0x344915,null))[_0x3e71('0x43')](handleError(_0x344915,null));};exports[_0x3e71('0x23')]=function(_0x3086a0,_0x1eab4e){return db[_0x3e71('0x29')]['find']({'where':{'id':_0x3086a0[_0x3e71('0x41')]['id']}})['then'](handleEntityNotFound(_0x1eab4e,null))[_0x3e71('0x22')](removeEntity(_0x1eab4e,null))['catch'](handleError(_0x1eab4e,null));};exports['describe']=function(_0x1d90bb,_0xf59df5){return db['SmsQueueReport'][_0x3e71('0x47')]()[_0x3e71('0x22')](respondWithResult(_0xf59df5,null))['catch'](handleError(_0xf59df5,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index a272d1c..f027d25 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 _0xaa0c=['api','moment','request-promise','path','rimraf','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','../../config/logger'];(function(_0x28dc10,_0x1ed705){var _0x5c1fd6=function(_0x1d1ee1){while(--_0x1d1ee1){_0x28dc10['push'](_0x28dc10['shift']());}};_0x5c1fd6(++_0x1ed705);}(_0xaa0c,0xfa));var _0xcaa0=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xaa0c[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0xcaa0('0x0'));var util=require('util');var logger=require(_0xcaa0('0x1'))(_0xcaa0('0x2'));var moment=require(_0xcaa0('0x3'));var BPromise=require('bluebird');var rp=require(_0xcaa0('0x4'));var fs=require('fs');var path=require(_0xcaa0('0x5'));var rimraf=require(_0xcaa0('0x6'));var config=require('../../config/environment');var attributes=require('./smsQueueReport.attributes');module[_0xcaa0('0x7')]=function(_0x1cf755,_0x1ef798){return _0x1cf755[_0xcaa0('0x8')](_0xcaa0('0x9'),attributes,{'tableName':_0xcaa0('0xa'),'paranoid':![],'indexes':[{'name':_0xcaa0('0xb'),'fields':[_0xcaa0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc507=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','exports','SmsQueueReport','report_sms_queue'];(function(_0x5dc409,_0x2255db){var _0x3cdbfd=function(_0x34e2e0){while(--_0x34e2e0){_0x5dc409['push'](_0x5dc409['shift']());}};_0x3cdbfd(++_0x2255db);}(_0xc507,0x8d));var _0x7c50=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0xc507[_0x1bf809];return _0x1caa4e;};'use strict';var _=require(_0x7c50('0x0'));var util=require(_0x7c50('0x1'));var logger=require(_0x7c50('0x2'))(_0x7c50('0x3'));var moment=require(_0x7c50('0x4'));var BPromise=require(_0x7c50('0x5'));var rp=require(_0x7c50('0x6'));var fs=require('fs');var path=require(_0x7c50('0x7'));var rimraf=require(_0x7c50('0x8'));var config=require('../../config/environment');var attributes=require(_0x7c50('0x9'));module[_0x7c50('0xa')]=function(_0x16af99,_0x44c8cf){return _0x16af99['define'](_0x7c50('0xb'),attributes,{'tableName':_0x7c50('0xc'),'paranoid':![],'indexes':[{'name':_0x7c50('0xd'),'fields':[_0x7c50('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 5871a5d..9222999 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 _0x4ef7=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update','attributes','limit','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4ef7,0x11b));var _0x74ef=function(_0x2b600c,_0x5ea350){_0x2b600c=_0x2b600c-0x0;var _0xc016b5=_0x4ef7[_0x2b600c];return _0xc016b5;};'use strict';var _=require(_0x74ef('0x0'));var util=require(_0x74ef('0x1'));var moment=require('moment');var BPromise=require(_0x74ef('0x2'));var rs=require(_0x74ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74ef('0x4'))['db'];var utils=require(_0x74ef('0x5'));var logger=require(_0x74ef('0x6'))(_0x74ef('0x7'));var config=require('../../config/environment');var jayson=require(_0x74ef('0x8'));var client=jayson[_0x74ef('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8ed50b,_0x55af06,_0x5eb589){return new BPromise(function(_0xaff0de,_0xc95975){return client[_0x74ef('0xa')](_0x8ed50b,_0x5eb589)[_0x74ef('0xb')](function(_0xac97c7){logger['info'](_0x74ef('0xc'),_0x55af06,_0x74ef('0xd'));logger[_0x74ef('0xe')](_0x74ef('0xf'),_0x55af06,_0x74ef('0xd'),JSON[_0x74ef('0x10')](_0xac97c7));if(_0xac97c7[_0x74ef('0x11')]){if(_0xac97c7[_0x74ef('0x11')][_0x74ef('0x12')]===0x1f4){logger[_0x74ef('0x11')](_0x74ef('0xc'),_0x55af06,_0xac97c7['error'][_0x74ef('0x13')]);return _0xc95975(_0xac97c7[_0x74ef('0x11')]['message']);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x55af06,_0xac97c7[_0x74ef('0x11')][_0x74ef('0x13')]);return _0xaff0de(_0xac97c7[_0x74ef('0x11')][_0x74ef('0x13')]);}else{logger[_0x74ef('0x14')](_0x74ef('0xc'),_0x55af06,_0x74ef('0xd'));_0xaff0de(_0xac97c7['result']['message']);}})['catch'](function(_0x490d58){logger[_0x74ef('0x11')](_0x74ef('0xc'),_0x55af06,_0x490d58);_0xc95975(_0x490d58);});});}exports[_0x74ef('0x15')]=function(_0x2a24df){var _0x48e2de=this;return new Promise(function(_0x2afbce,_0x367e42){return db[_0x74ef('0x16')][_0x74ef('0x17')](_0x2a24df[_0x74ef('0x18')],{'raw':_0x2a24df[_0x74ef('0x19')]?_0x2a24df[_0x74ef('0x19')][_0x74ef('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xb709ea){logger[_0x74ef('0x14')]('CreateSmsQueueReport',_0x2a24df);logger[_0x74ef('0xe')](_0x74ef('0x15'),_0x2a24df,JSON['stringify'](_0xb709ea));_0x2afbce(_0xb709ea);})['catch'](function(_0x42d886){logger['error'](_0x74ef('0x15'),_0x42d886[_0x74ef('0x13')],_0x2a24df);_0x367e42(_0x48e2de[_0x74ef('0x11')](0x1f4,_0x42d886[_0x74ef('0x13')]));});});};exports[_0x74ef('0x1b')]=function(_0x4c616f){var _0x26b51f=this;return new Promise(function(_0x1a5a9c,_0xd369ff){return db[_0x74ef('0x16')][_0x74ef('0x1c')](_0x4c616f[_0x74ef('0x18')],{'raw':_0x4c616f[_0x74ef('0x19')]?_0x4c616f[_0x74ef('0x19')][_0x74ef('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c616f[_0x74ef('0x19')]?_0x4c616f['options']['where']||null:null,'attributes':_0x4c616f['options']?_0x4c616f[_0x74ef('0x19')][_0x74ef('0x1d')]||null:null,'limit':_0x4c616f[_0x74ef('0x19')]?_0x4c616f[_0x74ef('0x19')][_0x74ef('0x1e')]||null:null})['then'](function(_0x1e0639){logger[_0x74ef('0x14')](_0x74ef('0x1b'),_0x4c616f);logger['debug'](_0x74ef('0x1b'),_0x4c616f,JSON['stringify'](_0x1e0639));_0x1a5a9c(_0x1e0639);})[_0x74ef('0x1f')](function(_0x4c3e0c){logger[_0x74ef('0x11')](_0x74ef('0x1b'),_0x4c3e0c[_0x74ef('0x13')],_0x4c616f);_0xd369ff(_0x26b51f[_0x74ef('0x11')](0x1f4,_0x4c3e0c[_0x74ef('0x13')]));});});}; \ No newline at end of file +var _0xb756=['attributes','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','SmsQueueReport,\x20%s,\x20%s','message','request\x20sent','catch','create','body','options','raw','then','CreateSmsQueueReport','UpdateSmsQueueReport','SmsQueueReport','update','where'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xb756,0x1c2));var _0x6b75=function(_0x300424,_0x160dd5){_0x300424=_0x300424-0x0;var _0x2e6d05=_0xb756[_0x300424];return _0x2e6d05;};'use strict';var _=require(_0x6b75('0x0'));var util=require('util');var moment=require(_0x6b75('0x1'));var BPromise=require(_0x6b75('0x2'));var rs=require(_0x6b75('0x3'));var fs=require('fs');var Redis=require(_0x6b75('0x4'));var db=require(_0x6b75('0x5'))['db'];var utils=require(_0x6b75('0x6'));var logger=require(_0x6b75('0x7'))(_0x6b75('0x8'));var config=require(_0x6b75('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6b75('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8313d1,_0x4fe3bf,_0xd5ec0e){return new BPromise(function(_0x54a401,_0x49bd4c){return client['request'](_0x8313d1,_0xd5ec0e)['then'](function(_0x2587a2){logger[_0x6b75('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x4fe3bf,'request\x20sent');logger[_0x6b75('0xc')](_0x6b75('0xd'),_0x4fe3bf,'request\x20sent',JSON['stringify'](_0x2587a2));if(_0x2587a2[_0x6b75('0xe')]){if(_0x2587a2['error'][_0x6b75('0xf')]===0x1f4){logger['error'](_0x6b75('0x10'),_0x4fe3bf,_0x2587a2['error'][_0x6b75('0x11')]);return _0x49bd4c(_0x2587a2[_0x6b75('0xe')][_0x6b75('0x11')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x4fe3bf,_0x2587a2[_0x6b75('0xe')][_0x6b75('0x11')]);return _0x54a401(_0x2587a2[_0x6b75('0xe')][_0x6b75('0x11')]);}else{logger[_0x6b75('0xb')](_0x6b75('0x10'),_0x4fe3bf,_0x6b75('0x12'));_0x54a401(_0x2587a2['result'][_0x6b75('0x11')]);}})[_0x6b75('0x13')](function(_0x431223){logger[_0x6b75('0xe')](_0x6b75('0x10'),_0x4fe3bf,_0x431223);_0x49bd4c(_0x431223);});});}exports['CreateSmsQueueReport']=function(_0x35c9f1){var _0x805c71=this;return new Promise(function(_0x39eab4,_0x2fdc8e){return db['SmsQueueReport'][_0x6b75('0x14')](_0x35c9f1[_0x6b75('0x15')],{'raw':_0x35c9f1[_0x6b75('0x16')]?_0x35c9f1[_0x6b75('0x16')][_0x6b75('0x17')]===undefined?!![]:![]:!![]})[_0x6b75('0x18')](function(_0x20e5da){logger['info']('CreateSmsQueueReport',_0x35c9f1);logger['debug']('CreateSmsQueueReport',_0x35c9f1,JSON['stringify'](_0x20e5da));_0x39eab4(_0x20e5da);})['catch'](function(_0x59ee16){logger['error'](_0x6b75('0x19'),_0x59ee16[_0x6b75('0x11')],_0x35c9f1);_0x2fdc8e(_0x805c71[_0x6b75('0xe')](0x1f4,_0x59ee16['message']));});});};exports[_0x6b75('0x1a')]=function(_0x5a71ba){var _0x1c2852=this;return new Promise(function(_0x2e278a,_0x134578){return db[_0x6b75('0x1b')][_0x6b75('0x1c')](_0x5a71ba['body'],{'raw':_0x5a71ba[_0x6b75('0x16')]?_0x5a71ba['options'][_0x6b75('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a71ba[_0x6b75('0x16')]?_0x5a71ba[_0x6b75('0x16')][_0x6b75('0x1d')]||null:null,'attributes':_0x5a71ba[_0x6b75('0x16')]?_0x5a71ba[_0x6b75('0x16')][_0x6b75('0x1e')]||null:null,'limit':_0x5a71ba[_0x6b75('0x16')]?_0x5a71ba[_0x6b75('0x16')]['limit']||null:null})[_0x6b75('0x18')](function(_0x336846){logger[_0x6b75('0xb')](_0x6b75('0x1a'),_0x5a71ba);logger[_0x6b75('0xc')]('UpdateSmsQueueReport',_0x5a71ba,JSON[_0x6b75('0x1f')](_0x336846));_0x2e278a(_0x336846);})[_0x6b75('0x13')](function(_0x122a85){logger[_0x6b75('0xe')](_0x6b75('0x1a'),_0x122a85[_0x6b75('0x11')],_0x5a71ba);_0x134578(_0x1c2852[_0x6b75('0xe')](0x1f4,_0x122a85[_0x6b75('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index a48c93b..a77176f 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 _0x1e5c=['isAuthenticated','index','get','/:id','post','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller'];(function(_0x1dd82f,_0x52acb7){var _0x353ca4=function(_0x5ee4c9){while(--_0x5ee4c9){_0x1dd82f['push'](_0x1dd82f['shift']());}};_0x353ca4(++_0x52acb7);}(_0x1e5c,0x191));var _0xc1e5=function(_0x47750d,_0x1101ef){_0x47750d=_0x47750d-0x0;var _0x5d8e7c=_0x1e5c[_0x47750d];return _0x5d8e7c;};'use strict';var multer=require(_0xc1e5('0x0'));var util=require(_0xc1e5('0x1'));var path=require('path');var timeout=require(_0xc1e5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc1e5('0x3'));var auth=require(_0xc1e5('0x4'));var interaction=require(_0xc1e5('0x5'));var config=require('../../config/environment');var controller=require(_0xc1e5('0x6'));router['get']('/',auth[_0xc1e5('0x7')](),controller[_0xc1e5('0x8')]);router[_0xc1e5('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc1e5('0x9')](_0xc1e5('0xa'),auth[_0xc1e5('0x7')](),controller['show']);router[_0xc1e5('0xb')]('/',auth[_0xc1e5('0x7')](),controller['create']);router[_0xc1e5('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xc1e5('0xd')]);router[_0xc1e5('0xe')](_0xc1e5('0xa'),auth[_0xc1e5('0x7')](),controller[_0xc1e5('0xf')]);module[_0xc1e5('0x10')]=router; \ No newline at end of file +var _0x810d=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','post','put','delete','destroy','exports'];(function(_0x64790e,_0x1cf04c){var _0xcb06cb=function(_0x3e6fc6){while(--_0x3e6fc6){_0x64790e['push'](_0x64790e['shift']());}};_0xcb06cb(++_0x1cf04c);}(_0x810d,0xc6));var _0xd810=function(_0x4e2515,_0x5a755b){_0x4e2515=_0x4e2515-0x0;var _0xc6b1de=_0x810d[_0x4e2515];return _0xc6b1de;};'use strict';var multer=require(_0xd810('0x0'));var util=require(_0xd810('0x1'));var path=require('path');var timeout=require(_0xd810('0x2'));var express=require(_0xd810('0x3'));var router=express['Router']();var fs_extra=require(_0xd810('0x4'));var auth=require(_0xd810('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd810('0x6'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0xd810('0x7')](),controller[_0xd810('0x8')]);router[_0xd810('0x9')](_0xd810('0xa'),auth[_0xd810('0x7')](),controller['describe']);router[_0xd810('0x9')](_0xd810('0xb'),auth[_0xd810('0x7')](),controller[_0xd810('0xc')]);router[_0xd810('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd810('0xe')](_0xd810('0xb'),auth[_0xd810('0x7')](),controller['update']);router[_0xd810('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd810('0x10')]);module[_0xd810('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 6f88611..8738f47 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 _0xa31c=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x17e54a,_0x15c0d1){var _0x321cfc=function(_0x303b69){while(--_0x303b69){_0x17e54a['push'](_0x17e54a['shift']());}};_0x321cfc(++_0x15c0d1);}(_0xa31c,0x8d));var _0xca31=function(_0x320626,_0x3cc862){_0x320626=_0x320626-0x0;var _0x757d40=_0xa31c[_0x320626];return _0x757d40;};'use strict';var moment=require(_0xca31('0x0'));var Sequelize=require(_0xca31('0x1'));module[_0xca31('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xca31('0x3'),_0xca31('0x4'),_0xca31('0x5')),'allowNull':![],'defaultValue':_0xca31('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xca31('0x6')]}}; \ No newline at end of file +var _0x8cf6=['NOW','moment','sequelize','account','queue','DATE'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0x8cf6,0x17b));var _0x68cf=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0x8cf6[_0x810e4d];return _0x13f01c;};'use strict';var moment=require(_0x68cf('0x0'));var Sequelize=require(_0x68cf('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x68cf('0x2'),'agent',_0x68cf('0x3')),'allowNull':![],'defaultValue':_0x68cf('0x3')},'transferredAt':{'type':Sequelize[_0x68cf('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x68cf('0x5')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 7cbb354..66a277f 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 _0xb848=['limit','count','offset','set','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','merge','type','VIRTUAL','filter','options','SmsTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined'];(function(_0x24a9a0,_0x5c3122){var _0x601aab=function(_0x3de2cb){while(--_0x3de2cb){_0x24a9a0['push'](_0x24a9a0['shift']());}};_0x601aab(++_0x5c3122);}(_0xb848,0x1ad));var _0x8b84=function(_0x599914,_0x26e295){_0x599914=_0x599914-0x0;var _0xa197ab=_0xb848[_0x599914];return _0xa197ab;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8b84('0x0'));var jsonpatch=require(_0x8b84('0x1'));var rp=require(_0x8b84('0x2'));var moment=require('moment');var BPromise=require(_0x8b84('0x3'));var Mustache=require('mustache');var util=require(_0x8b84('0x4'));var path=require(_0x8b84('0x5'));var sox=require(_0x8b84('0x6'));var csv=require('to-csv');var ejs=require(_0x8b84('0x7'));var fs=require('fs');var fs_extra=require(_0x8b84('0x8'));var _=require(_0x8b84('0x9'));var squel=require(_0x8b84('0xa'));var crypto=require(_0x8b84('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8b84('0xc'));var toCsv=require(_0x8b84('0xd'));var querystring=require(_0x8b84('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b84('0xf'));var qs=require(_0x8b84('0x10'));var as=require(_0x8b84('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b84('0x12'))(_0x8b84('0x13'));var utils=require(_0x8b84('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8b84('0x15'));var db=require(_0x8b84('0x16'))['db'];function respondWithStatusCode(_0x1ef114,_0x5d44a4){_0x5d44a4=_0x5d44a4||0xcc;return function(_0x185da8){if(_0x185da8){return _0x1ef114['sendStatus'](_0x5d44a4);}return _0x1ef114[_0x8b84('0x17')](_0x5d44a4)[_0x8b84('0x18')]();};}function respondWithResult(_0x1d6f5e,_0x3167eb){_0x3167eb=_0x3167eb||0xc8;return function(_0x48cdca){if(_0x48cdca){return _0x1d6f5e['status'](_0x3167eb)[_0x8b84('0x19')](_0x48cdca);}};}function respondWithFilteredResult(_0x232f7d,_0x2cd853){return function(_0x102c8b){if(_0x102c8b){var _0x11c78f=typeof _0x2cd853['offset']===_0x8b84('0x1a')&&typeof _0x2cd853[_0x8b84('0x1b')]===_0x8b84('0x1a');var _0x46edaa=_0x102c8b[_0x8b84('0x1c')];var _0x540498=_0x11c78f?0x0:_0x2cd853[_0x8b84('0x1d')];var _0x1f8f64=_0x11c78f?_0x102c8b[_0x8b84('0x1c')]:_0x2cd853[_0x8b84('0x1d')]+_0x2cd853[_0x8b84('0x1b')];var _0xf2f5b1;if(_0x1f8f64>=_0x46edaa){_0x1f8f64=_0x46edaa;_0xf2f5b1=0xc8;}else{_0xf2f5b1=0xce;}_0x232f7d[_0x8b84('0x17')](_0xf2f5b1);return _0x232f7d[_0x8b84('0x1e')]('Content-Range',_0x540498+'-'+_0x1f8f64+'/'+_0x46edaa)[_0x8b84('0x19')](_0x102c8b);}return null;};}function patchUpdates(_0x4a7c40){return function(_0x2b9347){try{jsonpatch[_0x8b84('0x1f')](_0x2b9347,_0x4a7c40,!![]);}catch(_0x4585ce){return BPromise[_0x8b84('0x20')](_0x4585ce);}return _0x2b9347[_0x8b84('0x21')]();};}function saveUpdates(_0x562c6e,_0x274dda){return function(_0x3a5e03){if(_0x3a5e03){return _0x3a5e03[_0x8b84('0x22')](_0x562c6e)[_0x8b84('0x23')](function(_0x2ddc58){return _0x2ddc58;});}return null;};}function removeEntity(_0x23adfd,_0x117f70){return function(_0x134921){if(_0x134921){return _0x134921['destroy']()['then'](function(){_0x23adfd[_0x8b84('0x17')](0xcc)[_0x8b84('0x18')]();});}};}function handleEntityNotFound(_0x1b23d3,_0x4d86fc){return function(_0x369341){if(!_0x369341){_0x1b23d3[_0x8b84('0x24')](0x194);}return _0x369341;};}function handleError(_0x614feb,_0xa2f3e0){_0xa2f3e0=_0xa2f3e0||0x1f4;return function(_0x4c82eb){logger[_0x8b84('0x25')](_0x4c82eb['stack']);if(_0x4c82eb[_0x8b84('0x26')]){delete _0x4c82eb[_0x8b84('0x26')];}_0x614feb[_0x8b84('0x17')](_0xa2f3e0)[_0x8b84('0x27')](_0x4c82eb);};}exports[_0x8b84('0x28')]=function(_0x2c1b17,_0x5951bc){var _0xb3c68e={},_0x50979a={},_0x29f613={'count':0x0,'rows':[]};var _0x1603b5=_[_0x8b84('0x29')](db['SmsTransferReport'][_0x8b84('0x2a')],function(_0x4f89fe){return{'name':_0x4f89fe[_0x8b84('0x2b')],'type':_0x4f89fe['type'][_0x8b84('0x2c')]};});_0x50979a[_0x8b84('0x2d')]=_['map'](_0x1603b5,_0x8b84('0x26'));_0x50979a[_0x8b84('0x2e')]=_[_0x8b84('0x2f')](_0x2c1b17[_0x8b84('0x2e')]);_0x50979a['filters']=_[_0x8b84('0x30')](_0x50979a[_0x8b84('0x2d')],_0x50979a[_0x8b84('0x2e')]);_0xb3c68e['attributes']=_[_0x8b84('0x30')](_0x50979a['model'],qs[_0x8b84('0x31')](_0x2c1b17[_0x8b84('0x2e')]['fields']));_0xb3c68e['attributes']=_0xb3c68e[_0x8b84('0x32')][_0x8b84('0x33')]?_0xb3c68e[_0x8b84('0x32')]:_0x50979a[_0x8b84('0x2d')];if(!_0x2c1b17[_0x8b84('0x2e')]['hasOwnProperty'](_0x8b84('0x34'))){_0xb3c68e[_0x8b84('0x1b')]=qs[_0x8b84('0x1b')](_0x2c1b17[_0x8b84('0x2e')][_0x8b84('0x1b')]);_0xb3c68e['offset']=qs[_0x8b84('0x1d')](_0x2c1b17[_0x8b84('0x2e')][_0x8b84('0x1d')]);}_0xb3c68e[_0x8b84('0x35')]=qs[_0x8b84('0x36')](_0x2c1b17[_0x8b84('0x2e')][_0x8b84('0x36')]);_0xb3c68e[_0x8b84('0x37')]=qs['filters'](_[_0x8b84('0x38')](_0x2c1b17[_0x8b84('0x2e')],_0x50979a[_0x8b84('0x39')]),_0x1603b5);if(_0x2c1b17[_0x8b84('0x2e')]['filter']){_0xb3c68e[_0x8b84('0x37')]=_[_0x8b84('0x3a')](_0xb3c68e[_0x8b84('0x37')],{'$or':_[_0x8b84('0x29')](_0x1603b5,function(_0xbef2eb){if(_0xbef2eb[_0x8b84('0x3b')]!==_0x8b84('0x3c')){var _0x4b4dcc={};_0x4b4dcc[_0xbef2eb[_0x8b84('0x26')]]={'$like':'%'+_0x2c1b17[_0x8b84('0x2e')][_0x8b84('0x3d')]+'%'};return _0x4b4dcc;}})});}_0xb3c68e=_[_0x8b84('0x3a')]({},_0xb3c68e,_0x2c1b17[_0x8b84('0x3e')]);var _0x55b2ec={'where':_0xb3c68e[_0x8b84('0x37')]};return db[_0x8b84('0x3f')][_0x8b84('0x1c')](_0x55b2ec)[_0x8b84('0x23')](function(_0x1a4be6){_0x29f613[_0x8b84('0x1c')]=_0x1a4be6;if(_0x2c1b17[_0x8b84('0x2e')][_0x8b84('0x40')]){_0xb3c68e[_0x8b84('0x41')]=[{'all':!![]}];}return db[_0x8b84('0x3f')][_0x8b84('0x42')](_0xb3c68e);})[_0x8b84('0x23')](function(_0x3d8271){_0x29f613[_0x8b84('0x43')]=_0x3d8271;return _0x29f613;})[_0x8b84('0x23')](respondWithFilteredResult(_0x5951bc,_0xb3c68e))[_0x8b84('0x44')](handleError(_0x5951bc,null));};exports[_0x8b84('0x45')]=function(_0x5a28ce,_0x294af0){var _0x310eb5={'raw':!![],'where':{'id':_0x5a28ce[_0x8b84('0x46')]['id']}},_0x4aabfc={};_0x4aabfc[_0x8b84('0x2d')]=_[_0x8b84('0x2f')](db['SmsTransferReport'][_0x8b84('0x2a')]);_0x4aabfc[_0x8b84('0x2e')]=_[_0x8b84('0x2f')](_0x5a28ce[_0x8b84('0x2e')]);_0x4aabfc[_0x8b84('0x39')]=_[_0x8b84('0x30')](_0x4aabfc[_0x8b84('0x2d')],_0x4aabfc[_0x8b84('0x2e')]);_0x310eb5[_0x8b84('0x32')]=_[_0x8b84('0x30')](_0x4aabfc['model'],qs[_0x8b84('0x31')](_0x5a28ce['query'][_0x8b84('0x31')]));_0x310eb5[_0x8b84('0x32')]=_0x310eb5[_0x8b84('0x32')][_0x8b84('0x33')]?_0x310eb5['attributes']:_0x4aabfc[_0x8b84('0x2d')];if(_0x5a28ce[_0x8b84('0x2e')][_0x8b84('0x40')]){_0x310eb5['include']=[{'all':!![]}];}_0x310eb5=_[_0x8b84('0x3a')]({},_0x310eb5,_0x5a28ce[_0x8b84('0x3e')]);return db[_0x8b84('0x3f')][_0x8b84('0x47')](_0x310eb5)[_0x8b84('0x23')](handleEntityNotFound(_0x294af0,null))['then'](respondWithResult(_0x294af0,null))[_0x8b84('0x44')](handleError(_0x294af0,null));};exports[_0x8b84('0x48')]=function(_0x38eda5,_0x16f1e4){return db['SmsTransferReport'][_0x8b84('0x48')](_0x38eda5[_0x8b84('0x49')],{})[_0x8b84('0x23')](respondWithResult(_0x16f1e4,0xc9))[_0x8b84('0x44')](handleError(_0x16f1e4,null));};exports[_0x8b84('0x22')]=function(_0x57dafb,_0x3eca0c){if(_0x57dafb[_0x8b84('0x49')]['id']){delete _0x57dafb[_0x8b84('0x49')]['id'];}return db[_0x8b84('0x3f')]['find']({'where':{'id':_0x57dafb['params']['id']}})[_0x8b84('0x23')](handleEntityNotFound(_0x3eca0c,null))[_0x8b84('0x23')](saveUpdates(_0x57dafb[_0x8b84('0x49')],null))[_0x8b84('0x23')](respondWithResult(_0x3eca0c,null))['catch'](handleError(_0x3eca0c,null));};exports[_0x8b84('0x4a')]=function(_0xd824ec,_0x4bccf8){return db[_0x8b84('0x3f')][_0x8b84('0x47')]({'where':{'id':_0xd824ec['params']['id']}})[_0x8b84('0x23')](handleEntityNotFound(_0x4bccf8,null))[_0x8b84('0x23')](removeEntity(_0x4bccf8,null))[_0x8b84('0x44')](handleError(_0x4bccf8,null));};exports[_0x8b84('0x4b')]=function(_0x53c65d,_0x4b0d1e){return db[_0x8b84('0x3f')]['describe']()['then'](respondWithResult(_0x4b0d1e,null))[_0x8b84('0x44')](handleError(_0x4b0d1e,null));}; \ No newline at end of file +var _0xcf30=['catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','findAll','rows','show','params','include','options'];(function(_0x15f529,_0x40098b){var _0x2a2839=function(_0x35ac5f){while(--_0x35ac5f){_0x15f529['push'](_0x15f529['shift']());}};_0x2a2839(++_0x40098b);}(_0xcf30,0x128));var _0x0cf3=function(_0xb7d17,_0x463270){_0xb7d17=_0xb7d17-0x0;var _0x5da76a=_0xcf30[_0xb7d17];return _0x5da76a;};'use strict';var emlformat=require(_0x0cf3('0x0'));var rimraf=require(_0x0cf3('0x1'));var zipdir=require(_0x0cf3('0x2'));var jsonpatch=require(_0x0cf3('0x3'));var rp=require('request-promise');var moment=require(_0x0cf3('0x4'));var BPromise=require(_0x0cf3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0cf3('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0cf3('0x7'));var squel=require(_0x0cf3('0x8'));var crypto=require(_0x0cf3('0x9'));var jsforce=require(_0x0cf3('0xa'));var deskjs=require(_0x0cf3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0cf3('0xc'));var Papa=require('papaparse');var Redis=require(_0x0cf3('0xd'));var authService=require(_0x0cf3('0xe'));var qs=require(_0x0cf3('0xf'));var as=require(_0x0cf3('0x10'));var hardwareService=require(_0x0cf3('0x11'));var logger=require(_0x0cf3('0x12'))(_0x0cf3('0x13'));var utils=require(_0x0cf3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0cf3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50df01,_0x5ecbe5){_0x5ecbe5=_0x5ecbe5||0xcc;return function(_0x24d1d4){if(_0x24d1d4){return _0x50df01[_0x0cf3('0x16')](_0x5ecbe5);}return _0x50df01['status'](_0x5ecbe5)['end']();};}function respondWithResult(_0x4d145c,_0x33a7a3){_0x33a7a3=_0x33a7a3||0xc8;return function(_0x20b7b0){if(_0x20b7b0){return _0x4d145c[_0x0cf3('0x17')](_0x33a7a3)[_0x0cf3('0x18')](_0x20b7b0);}};}function respondWithFilteredResult(_0x41d672,_0x4a5b42){return function(_0xdcaf22){if(_0xdcaf22){var _0x86f0d5=typeof _0x4a5b42['offset']===_0x0cf3('0x19')&&typeof _0x4a5b42[_0x0cf3('0x1a')]===_0x0cf3('0x19');var _0x431fde=_0xdcaf22[_0x0cf3('0x1b')];var _0x2ab930=_0x86f0d5?0x0:_0x4a5b42[_0x0cf3('0x1c')];var _0x139325=_0x86f0d5?_0xdcaf22['count']:_0x4a5b42[_0x0cf3('0x1c')]+_0x4a5b42[_0x0cf3('0x1a')];var _0x4e06f6;if(_0x139325>=_0x431fde){_0x139325=_0x431fde;_0x4e06f6=0xc8;}else{_0x4e06f6=0xce;}_0x41d672[_0x0cf3('0x17')](_0x4e06f6);return _0x41d672[_0x0cf3('0x1d')](_0x0cf3('0x1e'),_0x2ab930+'-'+_0x139325+'/'+_0x431fde)[_0x0cf3('0x18')](_0xdcaf22);}return null;};}function patchUpdates(_0x327694){return function(_0x5bb14e){try{jsonpatch[_0x0cf3('0x1f')](_0x5bb14e,_0x327694,!![]);}catch(_0x5cf070){return BPromise[_0x0cf3('0x20')](_0x5cf070);}return _0x5bb14e[_0x0cf3('0x21')]();};}function saveUpdates(_0x306307,_0x5ed4ba){return function(_0x267c28){if(_0x267c28){return _0x267c28[_0x0cf3('0x22')](_0x306307)['then'](function(_0x46d85a){return _0x46d85a;});}return null;};}function removeEntity(_0x5b9024,_0x45ae4f){return function(_0x4a6ed1){if(_0x4a6ed1){return _0x4a6ed1[_0x0cf3('0x23')]()[_0x0cf3('0x24')](function(){_0x5b9024['status'](0xcc)[_0x0cf3('0x25')]();});}};}function handleEntityNotFound(_0x3205c0,_0x57dc10){return function(_0x28c81){if(!_0x28c81){_0x3205c0[_0x0cf3('0x16')](0x194);}return _0x28c81;};}function handleError(_0x5be8c9,_0x5aed05){_0x5aed05=_0x5aed05||0x1f4;return function(_0x2ce8d9){logger[_0x0cf3('0x26')](_0x2ce8d9[_0x0cf3('0x27')]);if(_0x2ce8d9[_0x0cf3('0x28')]){delete _0x2ce8d9['name'];}_0x5be8c9[_0x0cf3('0x17')](_0x5aed05)[_0x0cf3('0x29')](_0x2ce8d9);};}exports['index']=function(_0x1a1e94,_0x19f1cf){var _0x4b78a0={},_0x1c2c1c={},_0x38a3c9={'count':0x0,'rows':[]};var _0x23707d=_[_0x0cf3('0x2a')](db[_0x0cf3('0x2b')][_0x0cf3('0x2c')],function(_0x4bd471){return{'name':_0x4bd471[_0x0cf3('0x2d')],'type':_0x4bd471[_0x0cf3('0x2e')][_0x0cf3('0x2f')]};});_0x1c2c1c[_0x0cf3('0x30')]=_['map'](_0x23707d,_0x0cf3('0x28'));_0x1c2c1c[_0x0cf3('0x31')]=_[_0x0cf3('0x32')](_0x1a1e94[_0x0cf3('0x31')]);_0x1c2c1c[_0x0cf3('0x33')]=_[_0x0cf3('0x34')](_0x1c2c1c[_0x0cf3('0x30')],_0x1c2c1c[_0x0cf3('0x31')]);_0x4b78a0['attributes']=_[_0x0cf3('0x34')](_0x1c2c1c[_0x0cf3('0x30')],qs['fields'](_0x1a1e94[_0x0cf3('0x31')][_0x0cf3('0x35')]));_0x4b78a0['attributes']=_0x4b78a0[_0x0cf3('0x36')]['length']?_0x4b78a0['attributes']:_0x1c2c1c['model'];if(!_0x1a1e94[_0x0cf3('0x31')][_0x0cf3('0x37')]('nolimit')){_0x4b78a0['limit']=qs[_0x0cf3('0x1a')](_0x1a1e94['query']['limit']);_0x4b78a0[_0x0cf3('0x1c')]=qs[_0x0cf3('0x1c')](_0x1a1e94[_0x0cf3('0x31')][_0x0cf3('0x1c')]);}_0x4b78a0[_0x0cf3('0x38')]=qs['sort'](_0x1a1e94['query'][_0x0cf3('0x39')]);_0x4b78a0[_0x0cf3('0x3a')]=qs['filters'](_[_0x0cf3('0x3b')](_0x1a1e94['query'],_0x1c2c1c[_0x0cf3('0x33')]),_0x23707d);if(_0x1a1e94['query'][_0x0cf3('0x3c')]){_0x4b78a0[_0x0cf3('0x3a')]=_['merge'](_0x4b78a0[_0x0cf3('0x3a')],{'$or':_[_0x0cf3('0x2a')](_0x23707d,function(_0x21dd80){if(_0x21dd80[_0x0cf3('0x2e')]!=='VIRTUAL'){var _0x2c3c89={};_0x2c3c89[_0x21dd80[_0x0cf3('0x28')]]={'$like':'%'+_0x1a1e94['query'][_0x0cf3('0x3c')]+'%'};return _0x2c3c89;}})});}_0x4b78a0=_[_0x0cf3('0x3d')]({},_0x4b78a0,_0x1a1e94['options']);var _0x15ee24={'where':_0x4b78a0['where']};return db['SmsTransferReport']['count'](_0x15ee24)[_0x0cf3('0x24')](function(_0x4dac1b){_0x38a3c9[_0x0cf3('0x1b')]=_0x4dac1b;if(_0x1a1e94[_0x0cf3('0x31')][_0x0cf3('0x3e')]){_0x4b78a0['include']=[{'all':!![]}];}return db[_0x0cf3('0x2b')][_0x0cf3('0x3f')](_0x4b78a0);})[_0x0cf3('0x24')](function(_0xc6da07){_0x38a3c9[_0x0cf3('0x40')]=_0xc6da07;return _0x38a3c9;})[_0x0cf3('0x24')](respondWithFilteredResult(_0x19f1cf,_0x4b78a0))['catch'](handleError(_0x19f1cf,null));};exports[_0x0cf3('0x41')]=function(_0x434158,_0x2b29eb){var _0x4198ec={'raw':!![],'where':{'id':_0x434158[_0x0cf3('0x42')]['id']}},_0x3a487c={};_0x3a487c[_0x0cf3('0x30')]=_[_0x0cf3('0x32')](db['SmsTransferReport'][_0x0cf3('0x2c')]);_0x3a487c['query']=_['keys'](_0x434158['query']);_0x3a487c[_0x0cf3('0x33')]=_[_0x0cf3('0x34')](_0x3a487c[_0x0cf3('0x30')],_0x3a487c[_0x0cf3('0x31')]);_0x4198ec[_0x0cf3('0x36')]=_[_0x0cf3('0x34')](_0x3a487c['model'],qs[_0x0cf3('0x35')](_0x434158[_0x0cf3('0x31')][_0x0cf3('0x35')]));_0x4198ec[_0x0cf3('0x36')]=_0x4198ec[_0x0cf3('0x36')]['length']?_0x4198ec[_0x0cf3('0x36')]:_0x3a487c[_0x0cf3('0x30')];if(_0x434158[_0x0cf3('0x31')]['includeAll']){_0x4198ec[_0x0cf3('0x43')]=[{'all':!![]}];}_0x4198ec=_[_0x0cf3('0x3d')]({},_0x4198ec,_0x434158[_0x0cf3('0x44')]);return db['SmsTransferReport']['find'](_0x4198ec)['then'](handleEntityNotFound(_0x2b29eb,null))[_0x0cf3('0x24')](respondWithResult(_0x2b29eb,null))[_0x0cf3('0x45')](handleError(_0x2b29eb,null));};exports[_0x0cf3('0x46')]=function(_0x2c4819,_0xafeb5){return db['SmsTransferReport'][_0x0cf3('0x46')](_0x2c4819[_0x0cf3('0x47')],{})[_0x0cf3('0x24')](respondWithResult(_0xafeb5,0xc9))[_0x0cf3('0x45')](handleError(_0xafeb5,null));};exports['update']=function(_0x533f94,_0x1a3ef1){if(_0x533f94[_0x0cf3('0x47')]['id']){delete _0x533f94[_0x0cf3('0x47')]['id'];}return db[_0x0cf3('0x2b')][_0x0cf3('0x48')]({'where':{'id':_0x533f94['params']['id']}})[_0x0cf3('0x24')](handleEntityNotFound(_0x1a3ef1,null))[_0x0cf3('0x24')](saveUpdates(_0x533f94[_0x0cf3('0x47')],null))['then'](respondWithResult(_0x1a3ef1,null))[_0x0cf3('0x45')](handleError(_0x1a3ef1,null));};exports[_0x0cf3('0x23')]=function(_0x270a59,_0x4eb29a){return db[_0x0cf3('0x2b')][_0x0cf3('0x48')]({'where':{'id':_0x270a59[_0x0cf3('0x42')]['id']}})[_0x0cf3('0x24')](handleEntityNotFound(_0x4eb29a,null))['then'](removeEntity(_0x4eb29a,null))[_0x0cf3('0x45')](handleError(_0x4eb29a,null));};exports['describe']=function(_0x5cecc2,_0x513f88){return db[_0x0cf3('0x2b')]['describe']()[_0x0cf3('0x24')](respondWithResult(_0x513f88,null))[_0x0cf3('0x45')](handleError(_0x513f88,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 97c6e00..1e3b734 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 _0x7278=['rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0x7278,0x161));var _0x8727=function(_0x105cf1,_0x2a09dc){_0x105cf1=_0x105cf1-0x0;var _0x46f092=_0x7278[_0x105cf1];return _0x46f092;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var logger=require(_0x8727('0x2'))(_0x8727('0x3'));var moment=require(_0x8727('0x4'));var BPromise=require('bluebird');var rp=require(_0x8727('0x5'));var fs=require('fs');var path=require(_0x8727('0x6'));var rimraf=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var attributes=require(_0x8727('0x9'));module[_0x8727('0xa')]=function(_0x180b71,_0x5549d5){return _0x180b71[_0x8727('0xb')](_0x8727('0xc'),attributes,{'tableName':_0x8727('0xd'),'paranoid':![],'indexes':[{'name':_0x8727('0xe'),'fields':[_0x8727('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xafb9=['moment','bluebird','request-promise','path','rimraf','exports','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x34933a,_0x327378){var _0x36abb4=function(_0x2d6814){while(--_0x2d6814){_0x34933a['push'](_0x34933a['shift']());}};_0x36abb4(++_0x327378);}(_0xafb9,0x68));var _0x9afb=function(_0x18dda4,_0x4ac941){_0x18dda4=_0x18dda4-0x0;var _0x5d74b7=_0xafb9[_0x18dda4];return _0x5d74b7;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var logger=require(_0x9afb('0x2'))(_0x9afb('0x3'));var moment=require(_0x9afb('0x4'));var BPromise=require(_0x9afb('0x5'));var rp=require(_0x9afb('0x6'));var fs=require('fs');var path=require(_0x9afb('0x7'));var rimraf=require(_0x9afb('0x8'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module[_0x9afb('0x9')]=function(_0x56a139,_0x1ccf93){return _0x56a139['define']('SmsTransferReport',attributes,{'tableName':_0x9afb('0xa'),'paranoid':![],'indexes':[{'name':_0x9afb('0xb'),'fields':[_0x9afb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 38c4143..74b3e87 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 _0x560c=['message','info','result','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1b09e8,_0x5c9627){var _0x158835=function(_0x5017ba){while(--_0x5017ba){_0x1b09e8['push'](_0x1b09e8['shift']());}};_0x158835(++_0x5c9627);}(_0x560c,0x121));var _0xc560=function(_0xc02cd2,_0x4d87c6){_0xc02cd2=_0xc02cd2-0x0;var _0xf16a5d=_0x560c[_0xc02cd2];return _0xf16a5d;};'use strict';var _=require(_0xc560('0x0'));var util=require(_0xc560('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc560('0x2'));var fs=require('fs');var Redis=require(_0xc560('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc560('0x4'));var logger=require('../../config/logger')(_0xc560('0x5'));var config=require(_0xc560('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc560('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x121337,_0x484521,_0x39b3dd){return new BPromise(function(_0x28828d,_0x41e804){return client[_0xc560('0x8')](_0x121337,_0x39b3dd)[_0xc560('0x9')](function(_0xafb06){logger['info'](_0xc560('0xa'),_0x484521,_0xc560('0xb'));logger['debug'](_0xc560('0xc'),_0x484521,_0xc560('0xb'),JSON[_0xc560('0xd')](_0xafb06));if(_0xafb06[_0xc560('0xe')]){if(_0xafb06[_0xc560('0xe')]['code']===0x1f4){logger['error'](_0xc560('0xa'),_0x484521,_0xafb06[_0xc560('0xe')][_0xc560('0xf')]);return _0x41e804(_0xafb06['error'][_0xc560('0xf')]);}logger[_0xc560('0xe')](_0xc560('0xa'),_0x484521,_0xafb06[_0xc560('0xe')][_0xc560('0xf')]);return _0x28828d(_0xafb06[_0xc560('0xe')]['message']);}else{logger[_0xc560('0x10')](_0xc560('0xa'),_0x484521,_0xc560('0xb'));_0x28828d(_0xafb06[_0xc560('0x11')]['message']);}})[_0xc560('0x12')](function(_0xacc01a){logger[_0xc560('0xe')](_0xc560('0xa'),_0x484521,_0xacc01a);_0x41e804(_0xacc01a);});});} \ No newline at end of file +var _0x497c=['code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x55fd40,_0x225b77){var _0x7979f1=function(_0x1d21c1){while(--_0x1d21c1){_0x55fd40['push'](_0x55fd40['shift']());}};_0x7979f1(++_0x225b77);}(_0x497c,0x155));var _0xc497=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x497c[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0xc497('0x0'));var util=require(_0xc497('0x1'));var moment=require('moment');var BPromise=require(_0xc497('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc497('0x3'));var db=require(_0xc497('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc497('0x5'))(_0xc497('0x6'));var config=require(_0xc497('0x7'));var jayson=require(_0xc497('0x8'));var client=jayson[_0xc497('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a0b30,_0x2dec4b,_0x55410a){return new BPromise(function(_0x34df36,_0x379929){return client[_0xc497('0xa')](_0x1a0b30,_0x55410a)['then'](function(_0x83a7e8){logger['info'](_0xc497('0xb'),_0x2dec4b,_0xc497('0xc'));logger['debug'](_0xc497('0xd'),_0x2dec4b,_0xc497('0xc'),JSON[_0xc497('0xe')](_0x83a7e8));if(_0x83a7e8[_0xc497('0xf')]){if(_0x83a7e8[_0xc497('0xf')][_0xc497('0x10')]===0x1f4){logger['error'](_0xc497('0xb'),_0x2dec4b,_0x83a7e8[_0xc497('0xf')][_0xc497('0x11')]);return _0x379929(_0x83a7e8['error']['message']);}logger[_0xc497('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x2dec4b,_0x83a7e8[_0xc497('0xf')][_0xc497('0x11')]);return _0x34df36(_0x83a7e8[_0xc497('0xf')][_0xc497('0x11')]);}else{logger[_0xc497('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x2dec4b,_0xc497('0xc'));_0x34df36(_0x83a7e8[_0xc497('0x13')][_0xc497('0x11')]);}})[_0xc497('0x14')](function(_0x2f245c){logger['error'](_0xc497('0xb'),_0x2dec4b,_0x2f245c);_0x379929(_0x2f245c);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 73cbc91..9c275dc 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 _0x4ede=['get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','file','create','put','update','delete','multer','util','connect-timeout','fs-extra','../../components/interaction/service'];(function(_0x4c0a16,_0x101fe2){var _0x121724=function(_0x28507d){while(--_0x28507d){_0x4c0a16['push'](_0x4c0a16['shift']());}};_0x121724(++_0x101fe2);}(_0x4ede,0x14d));var _0xe4ed=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4ede[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xe4ed('0x0'));var util=require(_0xe4ed('0x1'));var path=require('path');var timeout=require(_0xe4ed('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe4ed('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe4ed('0x4'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0xe4ed('0x5')]('/',auth[_0xe4ed('0x6')](),controller[_0xe4ed('0x7')]);router[_0xe4ed('0x5')](_0xe4ed('0x8'),auth[_0xe4ed('0x6')](),controller[_0xe4ed('0x9')]);router[_0xe4ed('0x5')](_0xe4ed('0xa'),auth[_0xe4ed('0x6')](),controller[_0xe4ed('0xb')]);var upload=multer({'storage':multer[_0xe4ed('0xc')]({'destination':function(_0xfcd2b4,_0x5c8af5,_0x2e4b54){_0x2e4b54(null,path[_0xe4ed('0xd')](config['root'],_0xe4ed('0xe')));},'filename':function(_0x13d551,_0x2b78f5,_0x7da897){_0x2b78f5[_0xe4ed('0xf')]=_0x2b78f5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x7da897(null,util[_0xe4ed('0x10')](_0xe4ed('0x11'),path[_0xe4ed('0x12')](_0x2b78f5[_0xe4ed('0xf')],path[_0xe4ed('0x13')](_0x2b78f5[_0xe4ed('0xf')])),Date[_0xe4ed('0x14')](),path[_0xe4ed('0x13')](_0x2b78f5[_0xe4ed('0xf')])));}})});router['post']('/',upload['single'](_0xe4ed('0x15')),controller[_0xe4ed('0x16')]);router[_0xe4ed('0x17')](_0xe4ed('0x8'),auth[_0xe4ed('0x6')](),controller[_0xe4ed('0x18')]);router[_0xe4ed('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xe4ed('0x19')]);module['exports']=router; \ No newline at end of file +var _0x7c86=['isAuthenticated','index','download','diskStorage','join','root','originalname','format','extname','now','post','single','file','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get'];(function(_0xe1c87f,_0x35000d){var _0x2960ae=function(_0x440103){while(--_0x440103){_0xe1c87f['push'](_0xe1c87f['shift']());}};_0x2960ae(++_0x35000d);}(_0x7c86,0x1a7));var _0x67c8=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x7c86[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0x67c8('0x0'));var util=require(_0x67c8('0x1'));var path=require(_0x67c8('0x2'));var timeout=require(_0x67c8('0x3'));var express=require(_0x67c8('0x4'));var router=express[_0x67c8('0x5')]();var fs_extra=require(_0x67c8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x67c8('0x7'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x67c8('0x8')]('/',auth[_0x67c8('0x9')](),controller[_0x67c8('0xa')]);router[_0x67c8('0x8')]('/:id',auth[_0x67c8('0x9')](),controller['show']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x67c8('0xb')]);var upload=multer({'storage':multer[_0x67c8('0xc')]({'destination':function(_0x14da37,_0x257e78,_0x3e15cc){_0x3e15cc(null,path[_0x67c8('0xd')](config[_0x67c8('0xe')],'server/files/sounds/original/'));},'filename':function(_0x37aebf,_0x43f0e0,_0x443570){_0x43f0e0[_0x67c8('0xf')]=_0x43f0e0[_0x67c8('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x443570(null,util[_0x67c8('0x10')]('%s-%s%s',path['basename'](_0x43f0e0[_0x67c8('0xf')],path[_0x67c8('0x11')](_0x43f0e0[_0x67c8('0xf')])),Date[_0x67c8('0x12')](),path[_0x67c8('0x11')](_0x43f0e0[_0x67c8('0xf')])));}})});router[_0x67c8('0x13')]('/',upload[_0x67c8('0x14')](_0x67c8('0x15')),controller[_0x67c8('0x16')]);router['put'](_0x67c8('0x17'),auth[_0x67c8('0x9')](),controller[_0x67c8('0x18')]);router['delete'](_0x67c8('0x17'),auth[_0x67c8('0x9')](),controller[_0x67c8('0x19')]);module[_0x67c8('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 1bc304e..c0f8eea 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 _0x8831=['exports','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x4d1408,_0x340e4b){var _0x3a3f58=function(_0x7c5584){while(--_0x7c5584){_0x4d1408['push'](_0x4d1408['shift']());}};_0x3a3f58(++_0x340e4b);}(_0x8831,0x126));var _0x1883=function(_0x2197bb,_0x2d7033){_0x2197bb=_0x2197bb-0x0;var _0x255158=_0x8831[_0x2197bb];return _0x255158;};'use strict';var Sequelize=require('sequelize');module[_0x1883('0x0')]={'name':{'type':Sequelize[_0x1883('0x1')],'unique':_0x1883('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x1883('0x1')]},'display_name':{'type':Sequelize[_0x1883('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x1883('0x1')]},'original_format':{'type':Sequelize[_0x1883('0x1')]},'original_duration':{'type':Sequelize[_0x1883('0x3')]},'original_sampleCount':{'type':Sequelize[_0x1883('0x4')]},'original_channelCount':{'type':Sequelize[_0x1883('0x5')]},'original_bitRate':{'type':Sequelize[_0x1883('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x1883('0x1')]},'converted_duration':{'type':Sequelize[_0x1883('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x1883('0x4')]},'converted_channelCount':{'type':Sequelize[_0x1883('0x5')]},'converted_bitRate':{'type':Sequelize[_0x1883('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x1883('0x5')]}}; \ No newline at end of file +var _0x55cc=['INTEGER','sequelize','exports','STRING','FLOAT','BIGINT'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x55cc,0x1f3));var _0xc55c=function(_0x5ccfb9,_0x5d4a9d){_0x5ccfb9=_0x5ccfb9-0x0;var _0x1f127d=_0x55cc[_0x5ccfb9];return _0x1f127d;};'use strict';var Sequelize=require(_0xc55c('0x0'));module[_0xc55c('0x1')]={'name':{'type':Sequelize[_0xc55c('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xc55c('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xc55c('0x2')]},'original_format':{'type':Sequelize[_0xc55c('0x2')]},'original_duration':{'type':Sequelize[_0xc55c('0x3')]},'original_sampleCount':{'type':Sequelize[_0xc55c('0x4')]},'original_channelCount':{'type':Sequelize[_0xc55c('0x5')]},'original_bitRate':{'type':Sequelize[_0xc55c('0x4')]},'original_sampleRate':{'type':Sequelize[_0xc55c('0x5')]},'converted_format':{'type':Sequelize[_0xc55c('0x2')]},'converted_duration':{'type':Sequelize[_0xc55c('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xc55c('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xc55c('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 6a877d8..37fb4a7 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 _0xfbbd=['sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','create','body','userProfileId','role','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','server/files/sounds/original','original_format','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','Sounds','UserProfileResource','error','name','send','Sound','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','pick','filter','where','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','include','find','download','save_name','converted_format','existsSync','join','root','ValidationError','Sound\x20not\x20found','format','%s.%s','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/converted','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate'];(function(_0x4278b4,_0x440117){var _0x3bed4c=function(_0x50a2ef){while(--_0x50a2ef){_0x4278b4['push'](_0x4278b4['shift']());}};_0x3bed4c(++_0x440117);}(_0xfbbd,0x10b));var _0xdfbb=function(_0x1e421a,_0x240544){_0x1e421a=_0x1e421a-0x0;var _0x4292c4=_0xfbbd[_0x1e421a];return _0x4292c4;};'use strict';var emlformat=require(_0xdfbb('0x0'));var rimraf=require(_0xdfbb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdfbb('0x2'));var moment=require(_0xdfbb('0x3'));var BPromise=require(_0xdfbb('0x4'));var Mustache=require(_0xdfbb('0x5'));var util=require(_0xdfbb('0x6'));var path=require(_0xdfbb('0x7'));var sox=require(_0xdfbb('0x8'));var csv=require(_0xdfbb('0x9'));var ejs=require(_0xdfbb('0xa'));var fs=require('fs');var fs_extra=require(_0xdfbb('0xb'));var _=require(_0xdfbb('0xc'));var squel=require(_0xdfbb('0xd'));var crypto=require(_0xdfbb('0xe'));var jsforce=require(_0xdfbb('0xf'));var deskjs=require(_0xdfbb('0x10'));var toCsv=require(_0xdfbb('0x9'));var querystring=require('querystring');var Papa=require(_0xdfbb('0x11'));var Redis=require(_0xdfbb('0x12'));var authService=require(_0xdfbb('0x13'));var qs=require(_0xdfbb('0x14'));var as=require(_0xdfbb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfbb('0x16'))('api');var utils=require(_0xdfbb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdfbb('0x18'));var db=require(_0xdfbb('0x19'))['db'];function respondWithStatusCode(_0x1ac2a6,_0x50226f){_0x50226f=_0x50226f||0xcc;return function(_0x1cbbef){if(_0x1cbbef){return _0x1ac2a6[_0xdfbb('0x1a')](_0x50226f);}return _0x1ac2a6[_0xdfbb('0x1b')](_0x50226f)[_0xdfbb('0x1c')]();};}function respondWithResult(_0x5b0596,_0x1a7531){_0x1a7531=_0x1a7531||0xc8;return function(_0x44b7d3){if(_0x44b7d3){return _0x5b0596[_0xdfbb('0x1b')](_0x1a7531)[_0xdfbb('0x1d')](_0x44b7d3);}};}function respondWithFilteredResult(_0x5da002,_0x97db39){return function(_0x140628){if(_0x140628){var _0x4db8b0=typeof _0x97db39['offset']===_0xdfbb('0x1e')&&typeof _0x97db39['limit']===_0xdfbb('0x1e');var _0x1febce=_0x140628[_0xdfbb('0x1f')];var _0x3fea04=_0x4db8b0?0x0:_0x97db39['offset'];var _0x9279bb=_0x4db8b0?_0x140628['count']:_0x97db39[_0xdfbb('0x20')]+_0x97db39['limit'];var _0x2f0f1d;if(_0x9279bb>=_0x1febce){_0x9279bb=_0x1febce;_0x2f0f1d=0xc8;}else{_0x2f0f1d=0xce;}_0x5da002[_0xdfbb('0x1b')](_0x2f0f1d);return _0x5da002[_0xdfbb('0x21')](_0xdfbb('0x22'),_0x3fea04+'-'+_0x9279bb+'/'+_0x1febce)[_0xdfbb('0x1d')](_0x140628);}return null;};}function patchUpdates(_0x179d1d){return function(_0x37d0ef){try{jsonpatch[_0xdfbb('0x23')](_0x37d0ef,_0x179d1d,!![]);}catch(_0x4b3e0a){return BPromise[_0xdfbb('0x24')](_0x4b3e0a);}return _0x37d0ef[_0xdfbb('0x25')]();};}function saveUpdates(_0x4fd684,_0x285185){return function(_0x4c8008){if(_0x4c8008){return _0x4c8008[_0xdfbb('0x26')](_0x4fd684)[_0xdfbb('0x27')](function(_0xadde41){return _0xadde41;});}return null;};}function removeEntity(_0x33343c,_0x4b4ccd){return function(_0x1993ca){if(_0x1993ca){return _0x1993ca['destroy']()['then'](function(){var _0x53facb=_0x1993ca['get']({'plain':!![]});var _0xd60fec=_0xdfbb('0x28');return db[_0xdfbb('0x29')]['destroy']({'where':{'type':_0xd60fec,'resourceId':_0x53facb['id']}})[_0xdfbb('0x27')](function(){return _0x1993ca;});})[_0xdfbb('0x27')](function(){_0x33343c[_0xdfbb('0x1b')](0xcc)[_0xdfbb('0x1c')]();});}};}function handleEntityNotFound(_0x37994d,_0x517f1b){return function(_0x38635f){if(!_0x38635f){_0x37994d[_0xdfbb('0x1a')](0x194);}return _0x38635f;};}function handleError(_0x27c096,_0x4576de){_0x4576de=_0x4576de||0x1f4;return function(_0x8aa7d3){logger[_0xdfbb('0x2a')](_0x8aa7d3['stack']);if(_0x8aa7d3[_0xdfbb('0x2b')]){delete _0x8aa7d3['name'];}_0x27c096['status'](_0x4576de)[_0xdfbb('0x2c')](_0x8aa7d3);};}exports['index']=function(_0x4c8209,_0x161a98){var _0x47949e={},_0x5b8f7b={},_0x5ef737={'count':0x0,'rows':[]};var _0x5c8068=_['map'](db[_0xdfbb('0x2d')][_0xdfbb('0x2e')],function(_0x3bccca){return{'name':_0x3bccca['fieldName'],'type':_0x3bccca['type'][_0xdfbb('0x2f')]};});_0x5b8f7b[_0xdfbb('0x30')]=_[_0xdfbb('0x31')](_0x5c8068,_0xdfbb('0x2b'));_0x5b8f7b[_0xdfbb('0x32')]=_[_0xdfbb('0x33')](_0x4c8209[_0xdfbb('0x32')]);_0x5b8f7b[_0xdfbb('0x34')]=_[_0xdfbb('0x35')](_0x5b8f7b[_0xdfbb('0x30')],_0x5b8f7b[_0xdfbb('0x32')]);_0x47949e['attributes']=_['intersection'](_0x5b8f7b[_0xdfbb('0x30')],qs['fields'](_0x4c8209[_0xdfbb('0x32')][_0xdfbb('0x36')]));_0x47949e[_0xdfbb('0x37')]=_0x47949e[_0xdfbb('0x37')][_0xdfbb('0x38')]?_0x47949e[_0xdfbb('0x37')]:_0x5b8f7b[_0xdfbb('0x30')];if(!_0x4c8209[_0xdfbb('0x32')][_0xdfbb('0x39')](_0xdfbb('0x3a'))){_0x47949e['limit']=qs[_0xdfbb('0x3b')](_0x4c8209[_0xdfbb('0x32')][_0xdfbb('0x3b')]);_0x47949e[_0xdfbb('0x20')]=qs['offset'](_0x4c8209[_0xdfbb('0x32')][_0xdfbb('0x20')]);}_0x47949e['order']=qs['sort'](_0x4c8209[_0xdfbb('0x32')]['sort']);_0x47949e['where']=qs[_0xdfbb('0x34')](_[_0xdfbb('0x3c')](_0x4c8209[_0xdfbb('0x32')],_0x5b8f7b[_0xdfbb('0x34')]),_0x5c8068);if(_0x4c8209[_0xdfbb('0x32')][_0xdfbb('0x3d')]){_0x47949e[_0xdfbb('0x3e')]=_[_0xdfbb('0x3f')](_0x47949e[_0xdfbb('0x3e')],{'$or':_['map'](_0x5c8068,function(_0x25a09b){if(_0x25a09b[_0xdfbb('0x40')]!==_0xdfbb('0x41')){var _0x2e4925={};_0x2e4925[_0x25a09b[_0xdfbb('0x2b')]]={'$like':'%'+_0x4c8209['query'][_0xdfbb('0x3d')]+'%'};return _0x2e4925;}})});}_0x47949e=_['merge']({},_0x47949e,_0x4c8209[_0xdfbb('0x42')]);var _0x3eb63b={'where':_0x47949e[_0xdfbb('0x3e')]};return db[_0xdfbb('0x2d')][_0xdfbb('0x1f')](_0x3eb63b)[_0xdfbb('0x27')](function(_0x483d57){_0x5ef737[_0xdfbb('0x1f')]=_0x483d57;if(_0x4c8209['query']['includeAll']){_0x47949e['include']=[{'all':!![]}];}return db['Sound'][_0xdfbb('0x43')](_0x47949e);})[_0xdfbb('0x27')](function(_0x1fac86){_0x5ef737[_0xdfbb('0x44')]=_0x1fac86;return _0x5ef737;})[_0xdfbb('0x27')](respondWithFilteredResult(_0x161a98,_0x47949e))[_0xdfbb('0x45')](handleError(_0x161a98,null));};exports[_0xdfbb('0x46')]=function(_0x26bf87,_0x29ca05){var _0x3d83cf={'raw':!![],'where':{'id':_0x26bf87[_0xdfbb('0x47')]['id']}},_0x336ae3={};_0x336ae3[_0xdfbb('0x30')]=_[_0xdfbb('0x33')](db['Sound']['rawAttributes']);_0x336ae3[_0xdfbb('0x32')]=_[_0xdfbb('0x33')](_0x26bf87[_0xdfbb('0x32')]);_0x336ae3[_0xdfbb('0x34')]=_['intersection'](_0x336ae3[_0xdfbb('0x30')],_0x336ae3[_0xdfbb('0x32')]);_0x3d83cf[_0xdfbb('0x37')]=_[_0xdfbb('0x35')](_0x336ae3[_0xdfbb('0x30')],qs[_0xdfbb('0x36')](_0x26bf87['query'][_0xdfbb('0x36')]));_0x3d83cf['attributes']=_0x3d83cf['attributes'][_0xdfbb('0x38')]?_0x3d83cf[_0xdfbb('0x37')]:_0x336ae3[_0xdfbb('0x30')];if(_0x26bf87[_0xdfbb('0x32')]['includeAll']){_0x3d83cf[_0xdfbb('0x48')]=[{'all':!![]}];}_0x3d83cf=_[_0xdfbb('0x3f')]({},_0x3d83cf,_0x26bf87[_0xdfbb('0x42')]);return db[_0xdfbb('0x2d')][_0xdfbb('0x49')](_0x3d83cf)['then'](handleEntityNotFound(_0x29ca05,null))['then'](respondWithResult(_0x29ca05,null))[_0xdfbb('0x45')](handleError(_0x29ca05,null));};exports[_0xdfbb('0x4a')]=function(_0x4307d9,_0x3b65e8,_0x9bd8a9){return db['Sound'][_0xdfbb('0x49')]({'where':{'id':_0x4307d9[_0xdfbb('0x47')]['id']},'attributes':[_0xdfbb('0x2b'),_0xdfbb('0x4b'),_0xdfbb('0x4c')],'raw':!![]})[_0xdfbb('0x27')](handleEntityNotFound(_0x3b65e8,null))[_0xdfbb('0x27')](function(_0x4f79d9){if(_0x4f79d9){if(!fs[_0xdfbb('0x4d')](path[_0xdfbb('0x4e')](config[_0xdfbb('0x4f')],'server/files/sounds/converted',_0x4f79d9['save_name']+'.'+_0x4f79d9[_0xdfbb('0x4c')]))){throw new db['Sequelize'][(_0xdfbb('0x50'))](_0xdfbb('0x51'));}return _0x3b65e8[_0xdfbb('0x4a')](path[_0xdfbb('0x4e')](config[_0xdfbb('0x4f')],'server/files/sounds/converted',util[_0xdfbb('0x52')](_0xdfbb('0x53'),_0x4f79d9['save_name'],_0x4f79d9[_0xdfbb('0x4c')])),util[_0xdfbb('0x52')]('%s.%s',_0x4f79d9[_0xdfbb('0x2b')],_0x4f79d9['converted_format']));}return null;})[_0xdfbb('0x45')](handleError(_0x3b65e8,null));};exports['create']=function(_0x2fbcdb,_0x3e1648,_0x40d5c8){var _0x4d3519={'name':path[_0xdfbb('0x54')](_0x2fbcdb[_0xdfbb('0x55')][_0xdfbb('0x56')],path[_0xdfbb('0x57')](_0x2fbcdb[_0xdfbb('0x55')][_0xdfbb('0x56')])),'save_name':path[_0xdfbb('0x54')](_0x2fbcdb[_0xdfbb('0x55')][_0xdfbb('0x58')],path[_0xdfbb('0x57')](_0x2fbcdb[_0xdfbb('0x55')][_0xdfbb('0x58')])),'original_format':path['extname'](_0x2fbcdb[_0xdfbb('0x55')][_0xdfbb('0x56')])[_0xdfbb('0x59')](0x1),'converted_format':_0xdfbb('0x5a')};var _0x412436=path[_0xdfbb('0x4e')](config[_0xdfbb('0x4f')],'server/files/sounds/original',_0x2fbcdb[_0xdfbb('0x55')]['filename']);var _0x36bc37=path[_0xdfbb('0x4e')](config[_0xdfbb('0x4f')],_0xdfbb('0x5b'),util[_0xdfbb('0x52')]('%s.%s',path[_0xdfbb('0x54')](_0x2fbcdb[_0xdfbb('0x55')][_0xdfbb('0x58')],path[_0xdfbb('0x57')](_0x2fbcdb[_0xdfbb('0x55')][_0xdfbb('0x58')])),_0x4d3519[_0xdfbb('0x4c')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x412436);logger[_0xdfbb('0x5c')](_0xdfbb('0x5d'),_0x36bc37);try{fs[_0xdfbb('0x5e')](_0x412436,parseInt(_0xdfbb('0x5f'),0x8));var _0x51b052=sox[_0xdfbb('0x60')](_0x412436,_0x36bc37,{'sampleRate':0x1f40,'format':_0xdfbb('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x51b052['on'](_0xdfbb('0x2a'),function(_0x54e021){fs[_0xdfbb('0x61')](_0x412436);_0x3e1648[_0xdfbb('0x1b')](0x1f4)['send'](_0x54e021);});_0x51b052['on'](_0xdfbb('0x62'),function(_0x3ccbc2){_0x4d3519[_0xdfbb('0x63')]=isNaN(_0x3ccbc2[_0xdfbb('0x64')])?null:_0x3ccbc2[_0xdfbb('0x64')]*0x3e8;_0x4d3519[_0xdfbb('0x65')]=isNaN(_0x3ccbc2['sampleCount'])?null:_0x3ccbc2[_0xdfbb('0x66')];_0x4d3519[_0xdfbb('0x67')]=isNaN(_0x3ccbc2[_0xdfbb('0x68')])?null:_0x3ccbc2[_0xdfbb('0x68')];_0x4d3519[_0xdfbb('0x69')]=isNaN(_0x3ccbc2[_0xdfbb('0x6a')])?null:_0x3ccbc2['bitRate'];_0x4d3519[_0xdfbb('0x6b')]=isNaN(_0x3ccbc2['sampleRate'])?null:_0x3ccbc2[_0xdfbb('0x6c')];});_0x51b052['on'](_0xdfbb('0x6d'),function(_0x2d3aec){_0x4d3519[_0xdfbb('0x6e')]=isNaN(_0x2d3aec[_0xdfbb('0x64')])?null:_0x2d3aec[_0xdfbb('0x64')]*0x3e8;_0x4d3519[_0xdfbb('0x6f')]=isNaN(_0x2d3aec[_0xdfbb('0x66')])?null:_0x2d3aec[_0xdfbb('0x66')];_0x4d3519['converted_channelCount']=isNaN(_0x2d3aec[_0xdfbb('0x68')])?null:_0x2d3aec['channelCount'];_0x4d3519[_0xdfbb('0x70')]=isNaN(_0x2d3aec[_0xdfbb('0x6a')])?null:_0x2d3aec[_0xdfbb('0x6a')];_0x4d3519['converted_sampleRate']=isNaN(_0x2d3aec[_0xdfbb('0x6c')])?null:_0x2d3aec['sampleRate'];});_0x51b052['on']('end',function(){fs[_0xdfbb('0x5e')](_0x36bc37,parseInt('0777',0x8));return db[_0xdfbb('0x2d')][_0xdfbb('0x71')](_0x4d3519)[_0xdfbb('0x27')](function(_0x4e0da2){var _0xd9cfce={'role':_0x2fbcdb['body']['role'],'userProfileId':_0x2fbcdb[_0xdfbb('0x72')][_0xdfbb('0x73')]};if(!_0xd9cfce)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd9cfce[_0xdfbb('0x74')]===_0xdfbb('0x75')){var _0x2de7b1=_0x4e0da2[_0xdfbb('0x76')]({'plain':!![]});return db[_0xdfbb('0x77')]['find']({'where':{'name':_0xdfbb('0x28'),'userProfileId':_0xd9cfce[_0xdfbb('0x73')]},'raw':!![]})[_0xdfbb('0x27')](function(_0x6f06a7){if(_0x6f06a7&&_0x6f06a7[_0xdfbb('0x78')]===0x0){return db[_0xdfbb('0x29')]['create']({'name':_0x2de7b1[_0xdfbb('0x2b')],'resourceId':_0x2de7b1['id'],'type':_0x6f06a7['name'],'sectionId':_0x6f06a7['id']},{})['then'](function(){return _0x4e0da2;});}else{return _0x4e0da2;}})[_0xdfbb('0x45')](function(_0x310274){logger[_0xdfbb('0x2a')](_0xdfbb('0x79'),_0x310274);throw _0x310274;});}return _0x4e0da2;})[_0xdfbb('0x27')](respondWithResult(_0x3e1648,null))[_0xdfbb('0x45')](handleError(_0x3e1648,null));});_0x51b052[_0xdfbb('0x7a')]();}catch(_0x97013b){_0x3e1648['status'](0x1f4)[_0xdfbb('0x2c')](_0x97013b);}};exports[_0xdfbb('0x26')]=function(_0x5c1416,_0x203249,_0x357b09){return db['Sound'][_0xdfbb('0x49')]({'where':{'id':_0x5c1416[_0xdfbb('0x47')]['id']}})[_0xdfbb('0x27')](handleEntityNotFound(_0x203249,null))[_0xdfbb('0x27')](saveUpdates(_[_0xdfbb('0x3c')](_0x5c1416[_0xdfbb('0x72')],[_0xdfbb('0x2b'),'description']),null))['then'](respondWithResult(_0x203249,null))[_0xdfbb('0x45')](handleError(_0x203249,null));};exports['delete']=function(_0x1c3f3d,_0x3c4daf,_0x276c7f){return db[_0xdfbb('0x2d')][_0xdfbb('0x49')]({'where':{'id':_0x1c3f3d[_0xdfbb('0x47')]['id']}})[_0xdfbb('0x27')](function(_0x32a6cf){if(_0x32a6cf){return _0x32a6cf['destroy']();}})[_0xdfbb('0x27')](function(_0x24aecf){var _0x37c863=path['join'](config[_0xdfbb('0x4f')],_0xdfbb('0x7b'),util[_0xdfbb('0x52')](_0xdfbb('0x53'),_0x24aecf['save_name'],_0x24aecf[_0xdfbb('0x7c')]));var _0x31edce=path[_0xdfbb('0x4e')](config['root'],_0xdfbb('0x5b'),util['format'](_0xdfbb('0x53'),_0x24aecf[_0xdfbb('0x4b')],_0x24aecf[_0xdfbb('0x4c')]));fs[_0xdfbb('0x61')](_0x37c863);fs[_0xdfbb('0x61')](_0x31edce);return _0x24aecf;})['then'](function(_0x22b523){if(_0x22b523){return _0x3c4daf[_0xdfbb('0x1b')](0xcc)[_0xdfbb('0x1c')]();}})['then'](handleEntityNotFound(_0x3c4daf,null))[_0xdfbb('0x45')](handleError(_0x3c4daf,null));}; \ No newline at end of file +var _0x5d42=['root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','create','basename','file','originalname','extname','filename','substring','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','bitRate','converted_sampleRate','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','original_format','unlinkSync','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','index','Sound','fieldName','type','model','map','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','download','save_name','converted_format','join'];(function(_0xdbdae5,_0x379f60){var _0x5b09b2=function(_0x2b9cfd){while(--_0x2b9cfd){_0xdbdae5['push'](_0xdbdae5['shift']());}};_0x5b09b2(++_0x379f60);}(_0x5d42,0xa3));var _0x25d4=function(_0x347cc4,_0x1967e2){_0x347cc4=_0x347cc4-0x0;var _0x3002c3=_0x5d42[_0x347cc4];return _0x3002c3;};'use strict';var emlformat=require(_0x25d4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x25d4('0x1'));var rp=require(_0x25d4('0x2'));var moment=require('moment');var BPromise=require(_0x25d4('0x3'));var Mustache=require(_0x25d4('0x4'));var util=require('util');var path=require(_0x25d4('0x5'));var sox=require(_0x25d4('0x6'));var csv=require(_0x25d4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25d4('0x8'));var _=require(_0x25d4('0x9'));var squel=require(_0x25d4('0xa'));var crypto=require('crypto');var jsforce=require(_0x25d4('0xb'));var deskjs=require(_0x25d4('0xc'));var toCsv=require(_0x25d4('0x7'));var querystring=require('querystring');var Papa=require(_0x25d4('0xd'));var Redis=require('ioredis');var authService=require(_0x25d4('0xe'));var qs=require(_0x25d4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x25d4('0x10'));var logger=require(_0x25d4('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x25d4('0x12'));var licenseUtil=require(_0x25d4('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c7e38,_0x43d864){_0x43d864=_0x43d864||0xcc;return function(_0x40b448){if(_0x40b448){return _0x5c7e38[_0x25d4('0x14')](_0x43d864);}return _0x5c7e38['status'](_0x43d864)[_0x25d4('0x15')]();};}function respondWithResult(_0x3e6f87,_0x53fbb5){_0x53fbb5=_0x53fbb5||0xc8;return function(_0xde41c3){if(_0xde41c3){return _0x3e6f87[_0x25d4('0x16')](_0x53fbb5)['json'](_0xde41c3);}};}function respondWithFilteredResult(_0x5078a9,_0x3e7321){return function(_0x376160){if(_0x376160){var _0x7839bf=typeof _0x3e7321[_0x25d4('0x17')]==='undefined'&&typeof _0x3e7321[_0x25d4('0x18')]==='undefined';var _0x8e962b=_0x376160[_0x25d4('0x19')];var _0x507914=_0x7839bf?0x0:_0x3e7321['offset'];var _0x2d3338=_0x7839bf?_0x376160[_0x25d4('0x19')]:_0x3e7321['offset']+_0x3e7321[_0x25d4('0x18')];var _0x138ab2;if(_0x2d3338>=_0x8e962b){_0x2d3338=_0x8e962b;_0x138ab2=0xc8;}else{_0x138ab2=0xce;}_0x5078a9[_0x25d4('0x16')](_0x138ab2);return _0x5078a9[_0x25d4('0x1a')](_0x25d4('0x1b'),_0x507914+'-'+_0x2d3338+'/'+_0x8e962b)[_0x25d4('0x1c')](_0x376160);}return null;};}function patchUpdates(_0x1c0a2e){return function(_0xdf0e79){try{jsonpatch['apply'](_0xdf0e79,_0x1c0a2e,!![]);}catch(_0x2e7358){return BPromise[_0x25d4('0x1d')](_0x2e7358);}return _0xdf0e79[_0x25d4('0x1e')]();};}function saveUpdates(_0x30e429,_0x42880b){return function(_0x1a2086){if(_0x1a2086){return _0x1a2086[_0x25d4('0x1f')](_0x30e429)[_0x25d4('0x20')](function(_0x43e291){return _0x43e291;});}return null;};}function removeEntity(_0x4708a3,_0x2302b2){return function(_0x5bf9f4){if(_0x5bf9f4){return _0x5bf9f4[_0x25d4('0x21')]()['then'](function(){var _0x5f2706=_0x5bf9f4[_0x25d4('0x22')]({'plain':!![]});var _0x52808b=_0x25d4('0x23');return db[_0x25d4('0x24')][_0x25d4('0x21')]({'where':{'type':_0x52808b,'resourceId':_0x5f2706['id']}})[_0x25d4('0x20')](function(){return _0x5bf9f4;});})[_0x25d4('0x20')](function(){_0x4708a3[_0x25d4('0x16')](0xcc)[_0x25d4('0x15')]();});}};}function handleEntityNotFound(_0x17f9d4,_0x4c849e){return function(_0x3af26e){if(!_0x3af26e){_0x17f9d4[_0x25d4('0x14')](0x194);}return _0x3af26e;};}function handleError(_0x58a20c,_0x1384a6){_0x1384a6=_0x1384a6||0x1f4;return function(_0x2715ee){logger[_0x25d4('0x25')](_0x2715ee[_0x25d4('0x26')]);if(_0x2715ee[_0x25d4('0x27')]){delete _0x2715ee['name'];}_0x58a20c[_0x25d4('0x16')](_0x1384a6)[_0x25d4('0x28')](_0x2715ee);};}exports[_0x25d4('0x29')]=function(_0x34eb6f,_0x13a3ea){var _0x2dbfe3={},_0x201261={},_0x37344e={'count':0x0,'rows':[]};var _0x158e5b=_['map'](db[_0x25d4('0x2a')]['rawAttributes'],function(_0x11f48c){return{'name':_0x11f48c[_0x25d4('0x2b')],'type':_0x11f48c[_0x25d4('0x2c')]['key']};});_0x201261[_0x25d4('0x2d')]=_[_0x25d4('0x2e')](_0x158e5b,_0x25d4('0x27'));_0x201261[_0x25d4('0x2f')]=_[_0x25d4('0x30')](_0x34eb6f[_0x25d4('0x2f')]);_0x201261[_0x25d4('0x31')]=_['intersection'](_0x201261[_0x25d4('0x2d')],_0x201261[_0x25d4('0x2f')]);_0x2dbfe3[_0x25d4('0x32')]=_[_0x25d4('0x33')](_0x201261[_0x25d4('0x2d')],qs['fields'](_0x34eb6f[_0x25d4('0x2f')]['fields']));_0x2dbfe3['attributes']=_0x2dbfe3[_0x25d4('0x32')]['length']?_0x2dbfe3[_0x25d4('0x32')]:_0x201261[_0x25d4('0x2d')];if(!_0x34eb6f[_0x25d4('0x2f')][_0x25d4('0x34')](_0x25d4('0x35'))){_0x2dbfe3[_0x25d4('0x18')]=qs['limit'](_0x34eb6f[_0x25d4('0x2f')]['limit']);_0x2dbfe3[_0x25d4('0x17')]=qs['offset'](_0x34eb6f[_0x25d4('0x2f')][_0x25d4('0x17')]);}_0x2dbfe3['order']=qs[_0x25d4('0x36')](_0x34eb6f[_0x25d4('0x2f')][_0x25d4('0x36')]);_0x2dbfe3[_0x25d4('0x37')]=qs[_0x25d4('0x31')](_[_0x25d4('0x38')](_0x34eb6f[_0x25d4('0x2f')],_0x201261[_0x25d4('0x31')]),_0x158e5b);if(_0x34eb6f[_0x25d4('0x2f')][_0x25d4('0x39')]){_0x2dbfe3[_0x25d4('0x37')]=_[_0x25d4('0x3a')](_0x2dbfe3[_0x25d4('0x37')],{'$or':_[_0x25d4('0x2e')](_0x158e5b,function(_0x5bbd77){if(_0x5bbd77[_0x25d4('0x2c')]!==_0x25d4('0x3b')){var _0x4dba52={};_0x4dba52[_0x5bbd77[_0x25d4('0x27')]]={'$like':'%'+_0x34eb6f[_0x25d4('0x2f')][_0x25d4('0x39')]+'%'};return _0x4dba52;}})});}_0x2dbfe3=_['merge']({},_0x2dbfe3,_0x34eb6f[_0x25d4('0x3c')]);var _0x263fa3={'where':_0x2dbfe3['where']};return db['Sound']['count'](_0x263fa3)[_0x25d4('0x20')](function(_0x3831ad){_0x37344e[_0x25d4('0x19')]=_0x3831ad;if(_0x34eb6f['query'][_0x25d4('0x3d')]){_0x2dbfe3[_0x25d4('0x3e')]=[{'all':!![]}];}return db[_0x25d4('0x2a')][_0x25d4('0x3f')](_0x2dbfe3);})[_0x25d4('0x20')](function(_0x21d00e){_0x37344e[_0x25d4('0x40')]=_0x21d00e;return _0x37344e;})['then'](respondWithFilteredResult(_0x13a3ea,_0x2dbfe3))[_0x25d4('0x41')](handleError(_0x13a3ea,null));};exports[_0x25d4('0x42')]=function(_0x5e5326,_0x17413e){var _0x18afb1={'raw':!![],'where':{'id':_0x5e5326[_0x25d4('0x43')]['id']}},_0x1e94e2={};_0x1e94e2['model']=_[_0x25d4('0x30')](db[_0x25d4('0x2a')][_0x25d4('0x44')]);_0x1e94e2[_0x25d4('0x2f')]=_[_0x25d4('0x30')](_0x5e5326['query']);_0x1e94e2[_0x25d4('0x31')]=_[_0x25d4('0x33')](_0x1e94e2[_0x25d4('0x2d')],_0x1e94e2[_0x25d4('0x2f')]);_0x18afb1['attributes']=_[_0x25d4('0x33')](_0x1e94e2[_0x25d4('0x2d')],qs[_0x25d4('0x45')](_0x5e5326[_0x25d4('0x2f')]['fields']));_0x18afb1[_0x25d4('0x32')]=_0x18afb1[_0x25d4('0x32')]['length']?_0x18afb1[_0x25d4('0x32')]:_0x1e94e2[_0x25d4('0x2d')];if(_0x5e5326[_0x25d4('0x2f')][_0x25d4('0x3d')]){_0x18afb1[_0x25d4('0x3e')]=[{'all':!![]}];}_0x18afb1=_[_0x25d4('0x3a')]({},_0x18afb1,_0x5e5326[_0x25d4('0x3c')]);return db[_0x25d4('0x2a')][_0x25d4('0x46')](_0x18afb1)[_0x25d4('0x20')](handleEntityNotFound(_0x17413e,null))[_0x25d4('0x20')](respondWithResult(_0x17413e,null))['catch'](handleError(_0x17413e,null));};exports[_0x25d4('0x47')]=function(_0x4cc42c,_0x3aaa0d,_0x459ed4){return db[_0x25d4('0x2a')][_0x25d4('0x46')]({'where':{'id':_0x4cc42c[_0x25d4('0x43')]['id']},'attributes':[_0x25d4('0x27'),_0x25d4('0x48'),_0x25d4('0x49')],'raw':!![]})[_0x25d4('0x20')](handleEntityNotFound(_0x3aaa0d,null))[_0x25d4('0x20')](function(_0x212e2d){if(_0x212e2d){if(!fs['existsSync'](path[_0x25d4('0x4a')](config[_0x25d4('0x4b')],_0x25d4('0x4c'),_0x212e2d[_0x25d4('0x48')]+'.'+_0x212e2d['converted_format']))){throw new db[(_0x25d4('0x4d'))][(_0x25d4('0x4e'))](_0x25d4('0x4f'));}return _0x3aaa0d[_0x25d4('0x47')](path[_0x25d4('0x4a')](config[_0x25d4('0x4b')],'server/files/sounds/converted',util[_0x25d4('0x50')]('%s.%s',_0x212e2d[_0x25d4('0x48')],_0x212e2d[_0x25d4('0x49')])),util[_0x25d4('0x50')]('%s.%s',_0x212e2d[_0x25d4('0x27')],_0x212e2d[_0x25d4('0x49')]));}return null;})[_0x25d4('0x41')](handleError(_0x3aaa0d,null));};exports[_0x25d4('0x51')]=function(_0x4304e8,_0x23e1ff,_0x25a236){var _0x251e8d={'name':path[_0x25d4('0x52')](_0x4304e8[_0x25d4('0x53')][_0x25d4('0x54')],path[_0x25d4('0x55')](_0x4304e8[_0x25d4('0x53')][_0x25d4('0x54')])),'save_name':path[_0x25d4('0x52')](_0x4304e8[_0x25d4('0x53')][_0x25d4('0x56')],path[_0x25d4('0x55')](_0x4304e8[_0x25d4('0x53')]['filename'])),'original_format':path[_0x25d4('0x55')](_0x4304e8['file']['originalname'])[_0x25d4('0x57')](0x1),'converted_format':'wav'};var _0x10c4c5=path['join'](config['root'],_0x25d4('0x58'),_0x4304e8['file']['filename']);var _0x1a9c66=path[_0x25d4('0x4a')](config[_0x25d4('0x4b')],'server/files/sounds/converted',util[_0x25d4('0x50')](_0x25d4('0x59'),path['basename'](_0x4304e8['file'][_0x25d4('0x56')],path[_0x25d4('0x55')](_0x4304e8[_0x25d4('0x53')][_0x25d4('0x56')])),_0x251e8d[_0x25d4('0x49')]));logger[_0x25d4('0x5a')]('Sound\x20upload\x20filepath:\x20%s',_0x10c4c5);logger['info'](_0x25d4('0x5b'),_0x1a9c66);try{fs[_0x25d4('0x5c')](_0x10c4c5,parseInt(_0x25d4('0x5d'),0x8));var _0x2431c4=sox[_0x25d4('0x5e')](_0x10c4c5,_0x1a9c66,{'sampleRate':0x1f40,'format':_0x25d4('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2431c4['on'](_0x25d4('0x25'),function(_0x4ad5e7){fs['unlinkSync'](_0x10c4c5);_0x23e1ff[_0x25d4('0x16')](0x1f4)[_0x25d4('0x28')](_0x4ad5e7);});_0x2431c4['on']('src',function(_0x1765aa){_0x251e8d[_0x25d4('0x60')]=isNaN(_0x1765aa['duration'])?null:_0x1765aa[_0x25d4('0x61')]*0x3e8;_0x251e8d[_0x25d4('0x62')]=isNaN(_0x1765aa[_0x25d4('0x63')])?null:_0x1765aa[_0x25d4('0x63')];_0x251e8d[_0x25d4('0x64')]=isNaN(_0x1765aa[_0x25d4('0x65')])?null:_0x1765aa[_0x25d4('0x65')];_0x251e8d[_0x25d4('0x66')]=isNaN(_0x1765aa['bitRate'])?null:_0x1765aa['bitRate'];_0x251e8d[_0x25d4('0x67')]=isNaN(_0x1765aa[_0x25d4('0x68')])?null:_0x1765aa[_0x25d4('0x68')];});_0x2431c4['on'](_0x25d4('0x69'),function(_0x33f7a3){_0x251e8d[_0x25d4('0x6a')]=isNaN(_0x33f7a3['duration'])?null:_0x33f7a3[_0x25d4('0x61')]*0x3e8;_0x251e8d[_0x25d4('0x6b')]=isNaN(_0x33f7a3[_0x25d4('0x63')])?null:_0x33f7a3[_0x25d4('0x63')];_0x251e8d['converted_channelCount']=isNaN(_0x33f7a3[_0x25d4('0x65')])?null:_0x33f7a3[_0x25d4('0x65')];_0x251e8d[_0x25d4('0x6c')]=isNaN(_0x33f7a3[_0x25d4('0x6d')])?null:_0x33f7a3[_0x25d4('0x6d')];_0x251e8d[_0x25d4('0x6e')]=isNaN(_0x33f7a3['sampleRate'])?null:_0x33f7a3[_0x25d4('0x68')];});_0x2431c4['on']('end',function(){fs[_0x25d4('0x5c')](_0x1a9c66,parseInt('0777',0x8));return db[_0x25d4('0x2a')]['create'](_0x251e8d)[_0x25d4('0x20')](function(_0x553e72){var _0x483ca1={'role':_0x4304e8[_0x25d4('0x6f')]['role'],'userProfileId':_0x4304e8[_0x25d4('0x6f')]['userProfileId']};if(!_0x483ca1)throw new Error(_0x25d4('0x70'));if(_0x483ca1['role']==='user'){var _0x2b9e3a=_0x553e72[_0x25d4('0x22')]({'plain':!![]});return db[_0x25d4('0x71')]['find']({'where':{'name':'Sounds','userProfileId':_0x483ca1['userProfileId']},'raw':!![]})[_0x25d4('0x20')](function(_0x53d339){if(_0x53d339&&_0x53d339[_0x25d4('0x72')]===0x0){return db['UserProfileResource'][_0x25d4('0x51')]({'name':_0x2b9e3a[_0x25d4('0x27')],'resourceId':_0x2b9e3a['id'],'type':_0x53d339['name'],'sectionId':_0x53d339['id']},{})['then'](function(){return _0x553e72;});}else{return _0x553e72;}})[_0x25d4('0x41')](function(_0x3e83f1){logger[_0x25d4('0x25')](_0x25d4('0x73'),_0x3e83f1);throw _0x3e83f1;});}return _0x553e72;})[_0x25d4('0x20')](respondWithResult(_0x23e1ff,null))[_0x25d4('0x41')](handleError(_0x23e1ff,null));});_0x2431c4['start']();}catch(_0x85597a){_0x23e1ff[_0x25d4('0x16')](0x1f4)['send'](_0x85597a);}};exports[_0x25d4('0x1f')]=function(_0xd5d55c,_0x180db8,_0x5a61c1){return db[_0x25d4('0x2a')][_0x25d4('0x46')]({'where':{'id':_0xd5d55c[_0x25d4('0x43')]['id']}})[_0x25d4('0x20')](handleEntityNotFound(_0x180db8,null))[_0x25d4('0x20')](saveUpdates(_[_0x25d4('0x38')](_0xd5d55c[_0x25d4('0x6f')],['name',_0x25d4('0x74')]),null))[_0x25d4('0x20')](respondWithResult(_0x180db8,null))[_0x25d4('0x41')](handleError(_0x180db8,null));};exports['delete']=function(_0x628f0f,_0x178539,_0x5b7510){return db[_0x25d4('0x2a')][_0x25d4('0x46')]({'where':{'id':_0x628f0f['params']['id']}})['then'](function(_0x891fff){if(_0x891fff){return _0x891fff[_0x25d4('0x21')]();}})[_0x25d4('0x20')](function(_0x3d4a9d){var _0x5c7d81=path[_0x25d4('0x4a')](config[_0x25d4('0x4b')],_0x25d4('0x58'),util[_0x25d4('0x50')](_0x25d4('0x59'),_0x3d4a9d[_0x25d4('0x48')],_0x3d4a9d[_0x25d4('0x75')]));var _0x7aece0=path[_0x25d4('0x4a')](config[_0x25d4('0x4b')],_0x25d4('0x4c'),util['format'](_0x25d4('0x59'),_0x3d4a9d['save_name'],_0x3d4a9d[_0x25d4('0x49')]));fs[_0x25d4('0x76')](_0x5c7d81);fs[_0x25d4('0x76')](_0x7aece0);return _0x3d4a9d;})[_0x25d4('0x20')](function(_0x58ab6f){if(_0x58ab6f){return _0x178539[_0x25d4('0x16')](0xcc)[_0x25d4('0x15')]();}})[_0x25d4('0x20')](handleEntityNotFound(_0x178539,null))[_0x25d4('0x41')](handleError(_0x178539,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 1449825..a8bfe7a 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 _0xd4ef=['api','moment','path','define','util','../../config/logger'];(function(_0x59ba4e,_0x4369b1){var _0x6a0fd6=function(_0x2c3734){while(--_0x2c3734){_0x59ba4e['push'](_0x59ba4e['shift']());}};_0x6a0fd6(++_0x4369b1);}(_0xd4ef,0x1d2));var _0xfd4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xfd4e('0x0'));var logger=require(_0xfd4e('0x1'))(_0xfd4e('0x2'));var moment=require(_0xfd4e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd4e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./sound.attributes');module['exports']=function(_0x4ef2c3,_0x412096){return _0x4ef2c3[_0xfd4e('0x5')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7454=['exports','define','Sound','tools_sounds','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes'];(function(_0x39554a,_0x94a3b1){var _0x1378a5=function(_0x4670d6){while(--_0x4670d6){_0x39554a['push'](_0x39554a['shift']());}};_0x1378a5(++_0x94a3b1);}(_0x7454,0x1d8));var _0x4745=function(_0x2584bc,_0x35d9f5){_0x2584bc=_0x2584bc-0x0;var _0x405f2c=_0x7454[_0x2584bc];return _0x405f2c;};'use strict';var _=require(_0x4745('0x0'));var util=require(_0x4745('0x1'));var logger=require('../../config/logger')(_0x4745('0x2'));var moment=require(_0x4745('0x3'));var BPromise=require(_0x4745('0x4'));var rp=require(_0x4745('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4745('0x6'));var config=require(_0x4745('0x7'));var attributes=require(_0x4745('0x8'));module[_0x4745('0x9')]=function(_0x5e6dc8,_0x4ccc2a){return _0x5e6dc8[_0x4745('0xa')](_0x4745('0xb'),attributes,{'tableName':_0x4745('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 079979c..9d8246c 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 _0x98be=['options','where','attributes','include','map','model','ShowSound','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','find','raw'];(function(_0x73a6b3,_0x8afc2b){var _0x5b6290=function(_0x40e2d9){while(--_0x40e2d9){_0x73a6b3['push'](_0x73a6b3['shift']());}};_0x5b6290(++_0x8afc2b);}(_0x98be,0x15c));var _0xe98b=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x98be[_0x166742];return _0xb7814a;};'use strict';var _=require('lodash');var util=require(_0xe98b('0x0'));var moment=require(_0xe98b('0x1'));var BPromise=require('bluebird');var rs=require(_0xe98b('0x2'));var fs=require('fs');var Redis=require(_0xe98b('0x3'));var db=require(_0xe98b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe98b('0x5'))(_0xe98b('0x6'));var config=require(_0xe98b('0x7'));var jayson=require(_0xe98b('0x8'));var client=jayson[_0xe98b('0x9')][_0xe98b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e9a7e,_0x45ebdf,_0x4a5aae){return new BPromise(function(_0x24098f,_0x520626){return client[_0xe98b('0xb')](_0x4e9a7e,_0x4a5aae)[_0xe98b('0xc')](function(_0x5465f6){logger[_0xe98b('0xd')]('Sound,\x20%s,\x20%s',_0x45ebdf,_0xe98b('0xe'));logger[_0xe98b('0xf')](_0xe98b('0x10'),_0x45ebdf,_0xe98b('0xe'),JSON[_0xe98b('0x11')](_0x5465f6));if(_0x5465f6[_0xe98b('0x12')]){if(_0x5465f6[_0xe98b('0x12')][_0xe98b('0x13')]===0x1f4){logger[_0xe98b('0x12')](_0xe98b('0x14'),_0x45ebdf,_0x5465f6[_0xe98b('0x12')][_0xe98b('0x15')]);return _0x520626(_0x5465f6[_0xe98b('0x12')][_0xe98b('0x15')]);}logger['error'](_0xe98b('0x14'),_0x45ebdf,_0x5465f6['error'][_0xe98b('0x15')]);return _0x24098f(_0x5465f6[_0xe98b('0x12')][_0xe98b('0x15')]);}else{logger[_0xe98b('0xd')](_0xe98b('0x14'),_0x45ebdf,'request\x20sent');_0x24098f(_0x5465f6['result'][_0xe98b('0x15')]);}})['catch'](function(_0x135cf9){logger['error'](_0xe98b('0x14'),_0x45ebdf,_0x135cf9);_0x520626(_0x135cf9);});});}exports['ShowSound']=function(_0x4e3df9){var _0x54a72b=this;return new Promise(function(_0x3977dd,_0x56800f){return db['Sound'][_0xe98b('0x16')]({'raw':_0x4e3df9['options']?_0x4e3df9['options'][_0xe98b('0x17')]===undefined?!![]:![]:!![],'where':_0x4e3df9[_0xe98b('0x18')]?_0x4e3df9[_0xe98b('0x18')][_0xe98b('0x19')]||null:null,'attributes':_0x4e3df9[_0xe98b('0x18')]?_0x4e3df9['options'][_0xe98b('0x1a')]||null:null,'include':_0x4e3df9[_0xe98b('0x18')]?_0x4e3df9[_0xe98b('0x18')][_0xe98b('0x1b')]?_[_0xe98b('0x1c')](_0x4e3df9[_0xe98b('0x18')][_0xe98b('0x1b')],function(_0x4a387f){return{'model':db[_0x4a387f['model']],'as':_0x4a387f['as'],'attributes':_0x4a387f[_0xe98b('0x1a')],'include':_0x4a387f['include']?_['map'](_0x4a387f[_0xe98b('0x1b')],function(_0x39d489){return{'model':db[_0x39d489[_0xe98b('0x1d')]],'as':_0x39d489['as'],'attributes':_0x39d489[_0xe98b('0x1a')],'include':_0x39d489[_0xe98b('0x1b')]?_[_0xe98b('0x1c')](_0x39d489[_0xe98b('0x1b')],function(_0x5b66b5){return{'model':db[_0x5b66b5[_0xe98b('0x1d')]],'as':_0x5b66b5['as'],'attributes':_0x5b66b5['attributes']};}):[]};}):[]};}):[]:[]})[_0xe98b('0xc')](function(_0xbda2da){logger[_0xe98b('0xd')](_0xe98b('0x1e'),_0x4e3df9);logger[_0xe98b('0xf')](_0xe98b('0x1e'),_0x4e3df9,JSON[_0xe98b('0x11')](_0xbda2da));_0x3977dd(_0xbda2da);})['catch'](function(_0x538110){logger['error']('ShowSound',_0x538110[_0xe98b('0x15')],_0x4e3df9);_0x56800f(_0x54a72b[_0xe98b('0x12')](0x1f4,_0x538110[_0xe98b('0x15')]));});});}; \ No newline at end of file +var _0x4579=['../../config/logger','rpc','jayson/promise','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','ShowSound','Sound','options','raw','where','map','include','model','attributes','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1fae9d,_0x1bde38){var _0x345c5e=function(_0x25fa69){while(--_0x25fa69){_0x1fae9d['push'](_0x1fae9d['shift']());}};_0x345c5e(++_0x1bde38);}(_0x4579,0xd8));var _0x9457=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4579[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9457('0x0'));var util=require(_0x9457('0x1'));var moment=require(_0x9457('0x2'));var BPromise=require(_0x9457('0x3'));var rs=require(_0x9457('0x4'));var fs=require('fs');var Redis=require(_0x9457('0x5'));var db=require(_0x9457('0x6'))['db'];var utils=require(_0x9457('0x7'));var logger=require(_0x9457('0x8'))(_0x9457('0x9'));var config=require('../../config/environment');var jayson=require(_0x9457('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2fad0b,_0x1d2374,_0x18d36e){return new BPromise(function(_0x579a0f,_0x55f88b){return client[_0x9457('0xb')](_0x2fad0b,_0x18d36e)[_0x9457('0xc')](function(_0x40494b){logger[_0x9457('0xd')](_0x9457('0xe'),_0x1d2374,_0x9457('0xf'));logger[_0x9457('0x10')](_0x9457('0x11'),_0x1d2374,_0x9457('0xf'),JSON['stringify'](_0x40494b));if(_0x40494b['error']){if(_0x40494b[_0x9457('0x12')][_0x9457('0x13')]===0x1f4){logger[_0x9457('0x12')]('Sound,\x20%s,\x20%s',_0x1d2374,_0x40494b[_0x9457('0x12')][_0x9457('0x14')]);return _0x55f88b(_0x40494b['error'][_0x9457('0x14')]);}logger['error']('Sound,\x20%s,\x20%s',_0x1d2374,_0x40494b[_0x9457('0x12')][_0x9457('0x14')]);return _0x579a0f(_0x40494b[_0x9457('0x12')][_0x9457('0x14')]);}else{logger['info'](_0x9457('0xe'),_0x1d2374,_0x9457('0xf'));_0x579a0f(_0x40494b['result'][_0x9457('0x14')]);}})['catch'](function(_0x10df2c){logger[_0x9457('0x12')]('Sound,\x20%s,\x20%s',_0x1d2374,_0x10df2c);_0x55f88b(_0x10df2c);});});}exports[_0x9457('0x15')]=function(_0x3b532a){var _0x590eca=this;return new Promise(function(_0x463eb4,_0x1372bc){return db[_0x9457('0x16')]['find']({'raw':_0x3b532a['options']?_0x3b532a[_0x9457('0x17')][_0x9457('0x18')]===undefined?!![]:![]:!![],'where':_0x3b532a[_0x9457('0x17')]?_0x3b532a[_0x9457('0x17')][_0x9457('0x19')]||null:null,'attributes':_0x3b532a['options']?_0x3b532a[_0x9457('0x17')]['attributes']||null:null,'include':_0x3b532a[_0x9457('0x17')]?_0x3b532a['options']['include']?_[_0x9457('0x1a')](_0x3b532a[_0x9457('0x17')][_0x9457('0x1b')],function(_0x4ef816){return{'model':db[_0x4ef816[_0x9457('0x1c')]],'as':_0x4ef816['as'],'attributes':_0x4ef816[_0x9457('0x1d')],'include':_0x4ef816[_0x9457('0x1b')]?_[_0x9457('0x1a')](_0x4ef816['include'],function(_0x4d9c16){return{'model':db[_0x4d9c16['model']],'as':_0x4d9c16['as'],'attributes':_0x4d9c16['attributes'],'include':_0x4d9c16[_0x9457('0x1b')]?_['map'](_0x4d9c16[_0x9457('0x1b')],function(_0x4668c9){return{'model':db[_0x4668c9[_0x9457('0x1c')]],'as':_0x4668c9['as'],'attributes':_0x4668c9[_0x9457('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5996bf){logger[_0x9457('0xd')](_0x9457('0x15'),_0x3b532a);logger[_0x9457('0x10')](_0x9457('0x15'),_0x3b532a,JSON[_0x9457('0x1e')](_0x5996bf));_0x463eb4(_0x5996bf);})[_0x9457('0x1f')](function(_0x24c10e){logger[_0x9457('0x12')](_0x9457('0x15'),_0x24c10e[_0x9457('0x14')],_0x3b532a);_0x1372bc(_0x590eca[_0x9457('0x12')](0x1f4,_0x24c10e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 2f27d70..b1464d6 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 _0x6383=['create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x6453b,_0xd44754){var _0x2fd18c=function(_0x2ad7e6){while(--_0x2ad7e6){_0x6453b['push'](_0x6453b['shift']());}};_0x2fd18c(++_0xd44754);}(_0x6383,0xa8));var _0x3638=function(_0x24d8fc,_0x18b3f8){_0x24d8fc=_0x24d8fc-0x0;var _0x2dd4fb=_0x6383[_0x24d8fc];return _0x2dd4fb;};'use strict';var multer=require('multer');var util=require(_0x3638('0x0'));var path=require(_0x3638('0x1'));var timeout=require('connect-timeout');var express=require(_0x3638('0x2'));var router=express[_0x3638('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3638('0x4'));var interaction=require(_0x3638('0x5'));var config=require(_0x3638('0x6'));var controller=require('./squareMessage.controller');router[_0x3638('0x7')]('/',auth[_0x3638('0x8')](),controller[_0x3638('0x9')]);router[_0x3638('0x7')](_0x3638('0xa'),auth[_0x3638('0x8')](),controller[_0x3638('0xb')]);router['post']('/',auth[_0x3638('0x8')](),controller[_0x3638('0xc')]);router[_0x3638('0xd')](_0x3638('0xa'),auth[_0x3638('0x8')](),controller[_0x3638('0xe')]);router[_0x3638('0xf')](_0x3638('0xa'),auth['isAuthenticated'](),controller[_0x3638('0x10')]);module[_0x3638('0x11')]=router; \ No newline at end of file +var _0xa40b=['/:id','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','get','show','create','put'];(function(_0x147d3f,_0x225534){var _0x111112=function(_0x4a0553){while(--_0x4a0553){_0x147d3f['push'](_0x147d3f['shift']());}};_0x111112(++_0x225534);}(_0xa40b,0x147));var _0xba40=function(_0x55e0cf,_0x5ee531){_0x55e0cf=_0x55e0cf-0x0;var _0x1a94fc=_0xa40b[_0x55e0cf];return _0x1a94fc;};'use strict';var multer=require(_0xba40('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba40('0x1'));var express=require(_0xba40('0x2'));var router=express[_0xba40('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xba40('0x4'));var interaction=require(_0xba40('0x5'));var config=require(_0xba40('0x6'));var controller=require(_0xba40('0x7'));router['get']('/',auth[_0xba40('0x8')](),controller['index']);router[_0xba40('0x9')]('/:id',auth[_0xba40('0x8')](),controller[_0xba40('0xa')]);router['post']('/',auth[_0xba40('0x8')](),controller[_0xba40('0xb')]);router[_0xba40('0xc')](_0xba40('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xba40('0xe')](_0xba40('0xd'),auth['isAuthenticated'](),controller[_0xba40('0xf')]);module[_0xba40('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 31c60be..c54a17a 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 _0xa41a=['out','STRING','sequelize','exports','TEXT','medium','ENUM'];(function(_0x47fa4f,_0x313dea){var _0x2227cf=function(_0x540734){while(--_0x540734){_0x47fa4f['push'](_0x47fa4f['shift']());}};_0x2227cf(++_0x313dea);}(_0xa41a,0x6b));var _0xaa41=function(_0x36b65f,_0x9e2994){_0x36b65f=_0x36b65f-0x0;var _0x42c1c0=_0xa41a[_0x36b65f];return _0x42c1c0;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xaa41('0x2')](_0xaa41('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xaa41('0x4')]('in',_0xaa41('0x5')),'defaultValue':_0xaa41('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xaa41('0x6')]},'providerResponse':{'type':Sequelize[_0xaa41('0x2')]}}; \ No newline at end of file +var _0x277c=['medium','ENUM','out','sequelize','STRING','TEXT'];(function(_0x2cedce,_0x27a0f7){var _0xfcffb6=function(_0x18aba0){while(--_0x18aba0){_0x2cedce['push'](_0x2cedce['shift']());}};_0xfcffb6(++_0x27a0f7);}(_0x277c,0x153));var _0xc277=function(_0x419835,_0x1a3f77){_0x419835=_0x419835-0x0;var _0xace1f6=_0x277c[_0x419835];return _0xace1f6;};'use strict';var Sequelize=require(_0xc277('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc277('0x1')]},'body':{'type':Sequelize[_0xc277('0x2')](_0xc277('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xc277('0x4')]('in',_0xc277('0x5')),'defaultValue':_0xc277('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xc277('0x1')]},'providerResponse':{'type':Sequelize[_0xc277('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index b36b70e..0cbaabb 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 _0x33fc=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','index','SquareMessage','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','catch','create','body','update','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x2383cc,_0xd5a4a7){var _0x43faeb=function(_0x507f13){while(--_0x507f13){_0x2383cc['push'](_0x2383cc['shift']());}};_0x43faeb(++_0xd5a4a7);}(_0x33fc,0x1ad));var _0xc33f=function(_0x56278e,_0x5083c5){_0x56278e=_0x56278e-0x0;var _0x46d37e=_0x33fc[_0x56278e];return _0x46d37e;};'use strict';var emlformat=require(_0xc33f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc33f('0x1'));var jsonpatch=require(_0xc33f('0x2'));var rp=require(_0xc33f('0x3'));var moment=require(_0xc33f('0x4'));var BPromise=require(_0xc33f('0x5'));var Mustache=require(_0xc33f('0x6'));var util=require(_0xc33f('0x7'));var path=require(_0xc33f('0x8'));var sox=require(_0xc33f('0x9'));var csv=require(_0xc33f('0xa'));var ejs=require(_0xc33f('0xb'));var fs=require('fs');var fs_extra=require(_0xc33f('0xc'));var _=require(_0xc33f('0xd'));var squel=require('squel');var crypto=require(_0xc33f('0xe'));var jsforce=require(_0xc33f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc33f('0xa'));var querystring=require(_0xc33f('0x10'));var Papa=require(_0xc33f('0x11'));var Redis=require('ioredis');var authService=require(_0xc33f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc33f('0x13'));var logger=require(_0xc33f('0x14'))(_0xc33f('0x15'));var utils=require('../../config/utils');var config=require(_0xc33f('0x16'));var licenseUtil=require(_0xc33f('0x17'));var db=require(_0xc33f('0x18'))['db'];function respondWithStatusCode(_0x5758b0,_0x2c4796){_0x2c4796=_0x2c4796||0xcc;return function(_0x2946e5){if(_0x2946e5){return _0x5758b0[_0xc33f('0x19')](_0x2c4796);}return _0x5758b0['status'](_0x2c4796)[_0xc33f('0x1a')]();};}function respondWithResult(_0x5653b1,_0x2f599f){_0x2f599f=_0x2f599f||0xc8;return function(_0x1126e1){if(_0x1126e1){return _0x5653b1[_0xc33f('0x1b')](_0x2f599f)[_0xc33f('0x1c')](_0x1126e1);}};}function respondWithFilteredResult(_0x249ace,_0x22b19c){return function(_0x3fcceb){if(_0x3fcceb){var _0x30c8e3=typeof _0x22b19c[_0xc33f('0x1d')]===_0xc33f('0x1e')&&typeof _0x22b19c[_0xc33f('0x1f')]===_0xc33f('0x1e');var _0x509f4d=_0x3fcceb[_0xc33f('0x20')];var _0x5808ad=_0x30c8e3?0x0:_0x22b19c[_0xc33f('0x1d')];var _0x49910c=_0x30c8e3?_0x3fcceb[_0xc33f('0x20')]:_0x22b19c[_0xc33f('0x1d')]+_0x22b19c[_0xc33f('0x1f')];var _0x3e94af;if(_0x49910c>=_0x509f4d){_0x49910c=_0x509f4d;_0x3e94af=0xc8;}else{_0x3e94af=0xce;}_0x249ace[_0xc33f('0x1b')](_0x3e94af);return _0x249ace[_0xc33f('0x21')](_0xc33f('0x22'),_0x5808ad+'-'+_0x49910c+'/'+_0x509f4d)[_0xc33f('0x1c')](_0x3fcceb);}return null;};}function patchUpdates(_0x5db46e){return function(_0x598a67){try{jsonpatch['apply'](_0x598a67,_0x5db46e,!![]);}catch(_0x26e37f){return BPromise['reject'](_0x26e37f);}return _0x598a67[_0xc33f('0x23')]();};}function saveUpdates(_0x2d82bd,_0x128311){return function(_0x29ad6e){if(_0x29ad6e){return _0x29ad6e['update'](_0x2d82bd)[_0xc33f('0x24')](function(_0x10f448){return _0x10f448;});}return null;};}function removeEntity(_0x1be448,_0x1810ca){return function(_0x43a223){if(_0x43a223){return _0x43a223[_0xc33f('0x25')]()[_0xc33f('0x24')](function(){_0x1be448[_0xc33f('0x1b')](0xcc)[_0xc33f('0x1a')]();});}};}function handleEntityNotFound(_0x496cff,_0x316a27){return function(_0x5c390f){if(!_0x5c390f){_0x496cff[_0xc33f('0x19')](0x194);}return _0x5c390f;};}function handleError(_0x1e2f1a,_0x2daa5f){_0x2daa5f=_0x2daa5f||0x1f4;return function(_0x32b43f){logger[_0xc33f('0x26')](_0x32b43f[_0xc33f('0x27')]);if(_0x32b43f[_0xc33f('0x28')]){delete _0x32b43f[_0xc33f('0x28')];}_0x1e2f1a[_0xc33f('0x1b')](_0x2daa5f)[_0xc33f('0x29')](_0x32b43f);};}exports[_0xc33f('0x2a')]=function(_0x5e8e8c,_0x583c98){var _0x476b54={},_0x4e4e68={},_0x5e0a88={'count':0x0,'rows':[]};var _0x1d2d64=_['map'](db[_0xc33f('0x2b')][_0xc33f('0x2c')],function(_0x19e2e){return{'name':_0x19e2e[_0xc33f('0x2d')],'type':_0x19e2e[_0xc33f('0x2e')]['key']};});_0x4e4e68[_0xc33f('0x2f')]=_[_0xc33f('0x30')](_0x1d2d64,'name');_0x4e4e68['query']=_['keys'](_0x5e8e8c[_0xc33f('0x31')]);_0x4e4e68[_0xc33f('0x32')]=_[_0xc33f('0x33')](_0x4e4e68['model'],_0x4e4e68[_0xc33f('0x31')]);_0x476b54['attributes']=_[_0xc33f('0x33')](_0x4e4e68['model'],qs['fields'](_0x5e8e8c[_0xc33f('0x31')][_0xc33f('0x34')]));_0x476b54[_0xc33f('0x35')]=_0x476b54[_0xc33f('0x35')][_0xc33f('0x36')]?_0x476b54[_0xc33f('0x35')]:_0x4e4e68['model'];if(!_0x5e8e8c[_0xc33f('0x31')]['hasOwnProperty'](_0xc33f('0x37'))){_0x476b54[_0xc33f('0x1f')]=qs[_0xc33f('0x1f')](_0x5e8e8c[_0xc33f('0x31')]['limit']);_0x476b54[_0xc33f('0x1d')]=qs[_0xc33f('0x1d')](_0x5e8e8c[_0xc33f('0x31')][_0xc33f('0x1d')]);}_0x476b54[_0xc33f('0x38')]=qs['sort'](_0x5e8e8c[_0xc33f('0x31')][_0xc33f('0x39')]);_0x476b54[_0xc33f('0x3a')]=qs[_0xc33f('0x32')](_[_0xc33f('0x3b')](_0x5e8e8c[_0xc33f('0x31')],_0x4e4e68['filters']),_0x1d2d64);if(_0x5e8e8c[_0xc33f('0x31')][_0xc33f('0x3c')]){_0x476b54[_0xc33f('0x3a')]=_[_0xc33f('0x3d')](_0x476b54['where'],{'$or':_['map'](_0x1d2d64,function(_0x1b03d9){if(_0x1b03d9[_0xc33f('0x2e')]!==_0xc33f('0x3e')){var _0x319208={};_0x319208[_0x1b03d9[_0xc33f('0x28')]]={'$like':'%'+_0x5e8e8c[_0xc33f('0x31')][_0xc33f('0x3c')]+'%'};return _0x319208;}})});}_0x476b54=_[_0xc33f('0x3d')]({},_0x476b54,_0x5e8e8c[_0xc33f('0x3f')]);var _0x4feb49={'where':_0x476b54[_0xc33f('0x3a')]};return db[_0xc33f('0x2b')][_0xc33f('0x20')](_0x4feb49)[_0xc33f('0x24')](function(_0xb99222){_0x5e0a88[_0xc33f('0x20')]=_0xb99222;if(_0x5e8e8c['query'][_0xc33f('0x40')]){_0x476b54[_0xc33f('0x41')]=[{'all':!![]}];}return db[_0xc33f('0x2b')][_0xc33f('0x42')](_0x476b54);})[_0xc33f('0x24')](function(_0x574770){_0x5e0a88[_0xc33f('0x43')]=_0x574770;return _0x5e0a88;})[_0xc33f('0x24')](respondWithFilteredResult(_0x583c98,_0x476b54))['catch'](handleError(_0x583c98,null));};exports[_0xc33f('0x44')]=function(_0x3f9848,_0x152552){var _0x5480fa={'raw':!![],'where':{'id':_0x3f9848['params']['id']}},_0x54ff3e={};_0x54ff3e[_0xc33f('0x2f')]=_[_0xc33f('0x45')](db['SquareMessage'][_0xc33f('0x2c')]);_0x54ff3e[_0xc33f('0x31')]=_['keys'](_0x3f9848[_0xc33f('0x31')]);_0x54ff3e[_0xc33f('0x32')]=_['intersection'](_0x54ff3e[_0xc33f('0x2f')],_0x54ff3e[_0xc33f('0x31')]);_0x5480fa[_0xc33f('0x35')]=_[_0xc33f('0x33')](_0x54ff3e[_0xc33f('0x2f')],qs[_0xc33f('0x34')](_0x3f9848['query'][_0xc33f('0x34')]));_0x5480fa[_0xc33f('0x35')]=_0x5480fa[_0xc33f('0x35')]['length']?_0x5480fa[_0xc33f('0x35')]:_0x54ff3e['model'];if(_0x3f9848[_0xc33f('0x31')][_0xc33f('0x40')]){_0x5480fa[_0xc33f('0x41')]=[{'all':!![]}];}_0x5480fa=_[_0xc33f('0x3d')]({},_0x5480fa,_0x3f9848[_0xc33f('0x3f')]);return db['SquareMessage']['find'](_0x5480fa)[_0xc33f('0x24')](handleEntityNotFound(_0x152552,null))['then'](respondWithResult(_0x152552,null))[_0xc33f('0x46')](handleError(_0x152552,null));};exports[_0xc33f('0x47')]=function(_0x3158c7,_0x1401c9){return db[_0xc33f('0x2b')][_0xc33f('0x47')](_0x3158c7[_0xc33f('0x48')],{})['then'](respondWithResult(_0x1401c9,0xc9))[_0xc33f('0x46')](handleError(_0x1401c9,null));};exports[_0xc33f('0x49')]=function(_0x161efb,_0x153e4c){if(_0x161efb[_0xc33f('0x48')]['id']){delete _0x161efb[_0xc33f('0x48')]['id'];}return db[_0xc33f('0x2b')][_0xc33f('0x4a')]({'where':{'id':_0x161efb['params']['id']}})[_0xc33f('0x24')](handleEntityNotFound(_0x153e4c,null))[_0xc33f('0x24')](saveUpdates(_0x161efb[_0xc33f('0x48')],null))[_0xc33f('0x24')](respondWithResult(_0x153e4c,null))['catch'](handleError(_0x153e4c,null));};exports[_0xc33f('0x25')]=function(_0x52a6e2,_0x5318b0){return db[_0xc33f('0x2b')][_0xc33f('0x4a')]({'where':{'id':_0x52a6e2['params']['id']}})[_0xc33f('0x24')](handleEntityNotFound(_0x5318b0,null))['then'](removeEntity(_0x5318b0,null))[_0xc33f('0x46')](handleError(_0x5318b0,null));}; \ No newline at end of file +var _0xafe9=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','include','rows','catch','show','params','includeAll','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xafe9,0x163));var _0x9afe=function(_0x463555,_0x286ee6){_0x463555=_0x463555-0x0;var _0x1e696b=_0xafe9[_0x463555];return _0x1e696b;};'use strict';var emlformat=require(_0x9afe('0x0'));var rimraf=require(_0x9afe('0x1'));var zipdir=require(_0x9afe('0x2'));var jsonpatch=require(_0x9afe('0x3'));var rp=require(_0x9afe('0x4'));var moment=require(_0x9afe('0x5'));var BPromise=require(_0x9afe('0x6'));var Mustache=require(_0x9afe('0x7'));var util=require(_0x9afe('0x8'));var path=require(_0x9afe('0x9'));var sox=require(_0x9afe('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9afe('0xb'));var _=require(_0x9afe('0xc'));var squel=require(_0x9afe('0xd'));var crypto=require(_0x9afe('0xe'));var jsforce=require(_0x9afe('0xf'));var deskjs=require(_0x9afe('0x10'));var toCsv=require(_0x9afe('0x11'));var querystring=require('querystring');var Papa=require(_0x9afe('0x12'));var Redis=require('ioredis');var authService=require(_0x9afe('0x13'));var qs=require(_0x9afe('0x14'));var as=require(_0x9afe('0x15'));var hardwareService=require(_0x9afe('0x16'));var logger=require('../../config/logger')(_0x9afe('0x17'));var utils=require(_0x9afe('0x18'));var config=require(_0x9afe('0x19'));var licenseUtil=require(_0x9afe('0x1a'));var db=require(_0x9afe('0x1b'))['db'];function respondWithStatusCode(_0x33092c,_0x34adbe){_0x34adbe=_0x34adbe||0xcc;return function(_0x485851){if(_0x485851){return _0x33092c[_0x9afe('0x1c')](_0x34adbe);}return _0x33092c[_0x9afe('0x1d')](_0x34adbe)['end']();};}function respondWithResult(_0x3b74c7,_0x278334){_0x278334=_0x278334||0xc8;return function(_0x2ec260){if(_0x2ec260){return _0x3b74c7[_0x9afe('0x1d')](_0x278334)[_0x9afe('0x1e')](_0x2ec260);}};}function respondWithFilteredResult(_0x89d01c,_0x629a89){return function(_0x54a051){if(_0x54a051){var _0x1b3909=typeof _0x629a89[_0x9afe('0x1f')]===_0x9afe('0x20')&&typeof _0x629a89[_0x9afe('0x21')]===_0x9afe('0x20');var _0x8a3a56=_0x54a051['count'];var _0x1fe59c=_0x1b3909?0x0:_0x629a89['offset'];var _0x3008f=_0x1b3909?_0x54a051[_0x9afe('0x22')]:_0x629a89[_0x9afe('0x1f')]+_0x629a89['limit'];var _0x5dfbc3;if(_0x3008f>=_0x8a3a56){_0x3008f=_0x8a3a56;_0x5dfbc3=0xc8;}else{_0x5dfbc3=0xce;}_0x89d01c['status'](_0x5dfbc3);return _0x89d01c['set'](_0x9afe('0x23'),_0x1fe59c+'-'+_0x3008f+'/'+_0x8a3a56)[_0x9afe('0x1e')](_0x54a051);}return null;};}function patchUpdates(_0x30731f){return function(_0x15a98c){try{jsonpatch[_0x9afe('0x24')](_0x15a98c,_0x30731f,!![]);}catch(_0x13447a){return BPromise['reject'](_0x13447a);}return _0x15a98c[_0x9afe('0x25')]();};}function saveUpdates(_0x371edb,_0x3335bc){return function(_0x4d47f9){if(_0x4d47f9){return _0x4d47f9[_0x9afe('0x26')](_0x371edb)[_0x9afe('0x27')](function(_0x4d5988){return _0x4d5988;});}return null;};}function removeEntity(_0xcdcdb9,_0xc233cd){return function(_0x116e73){if(_0x116e73){return _0x116e73['destroy']()['then'](function(){_0xcdcdb9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x427e71,_0x55f766){return function(_0x464855){if(!_0x464855){_0x427e71[_0x9afe('0x1c')](0x194);}return _0x464855;};}function handleError(_0x3e0b71,_0x96bd9e){_0x96bd9e=_0x96bd9e||0x1f4;return function(_0x225e9b){logger[_0x9afe('0x28')](_0x225e9b['stack']);if(_0x225e9b['name']){delete _0x225e9b[_0x9afe('0x29')];}_0x3e0b71[_0x9afe('0x1d')](_0x96bd9e)[_0x9afe('0x2a')](_0x225e9b);};}exports['index']=function(_0xcbaf5d,_0x262aca){var _0x5155a2={},_0x266682={},_0x406939={'count':0x0,'rows':[]};var _0x1f725c=_[_0x9afe('0x2b')](db[_0x9afe('0x2c')][_0x9afe('0x2d')],function(_0x56e542){return{'name':_0x56e542[_0x9afe('0x2e')],'type':_0x56e542[_0x9afe('0x2f')][_0x9afe('0x30')]};});_0x266682[_0x9afe('0x31')]=_[_0x9afe('0x2b')](_0x1f725c,_0x9afe('0x29'));_0x266682[_0x9afe('0x32')]=_[_0x9afe('0x33')](_0xcbaf5d[_0x9afe('0x32')]);_0x266682[_0x9afe('0x34')]=_[_0x9afe('0x35')](_0x266682[_0x9afe('0x31')],_0x266682[_0x9afe('0x32')]);_0x5155a2[_0x9afe('0x36')]=_['intersection'](_0x266682[_0x9afe('0x31')],qs[_0x9afe('0x37')](_0xcbaf5d[_0x9afe('0x32')][_0x9afe('0x37')]));_0x5155a2[_0x9afe('0x36')]=_0x5155a2[_0x9afe('0x36')][_0x9afe('0x38')]?_0x5155a2[_0x9afe('0x36')]:_0x266682[_0x9afe('0x31')];if(!_0xcbaf5d[_0x9afe('0x32')][_0x9afe('0x39')]('nolimit')){_0x5155a2[_0x9afe('0x21')]=qs[_0x9afe('0x21')](_0xcbaf5d[_0x9afe('0x32')][_0x9afe('0x21')]);_0x5155a2[_0x9afe('0x1f')]=qs[_0x9afe('0x1f')](_0xcbaf5d[_0x9afe('0x32')][_0x9afe('0x1f')]);}_0x5155a2[_0x9afe('0x3a')]=qs['sort'](_0xcbaf5d[_0x9afe('0x32')][_0x9afe('0x3b')]);_0x5155a2[_0x9afe('0x3c')]=qs[_0x9afe('0x34')](_[_0x9afe('0x3d')](_0xcbaf5d[_0x9afe('0x32')],_0x266682['filters']),_0x1f725c);if(_0xcbaf5d[_0x9afe('0x32')]['filter']){_0x5155a2[_0x9afe('0x3c')]=_[_0x9afe('0x3e')](_0x5155a2[_0x9afe('0x3c')],{'$or':_['map'](_0x1f725c,function(_0x3c9bfd){if(_0x3c9bfd['type']!==_0x9afe('0x3f')){var _0x1cd53e={};_0x1cd53e[_0x3c9bfd['name']]={'$like':'%'+_0xcbaf5d['query'][_0x9afe('0x40')]+'%'};return _0x1cd53e;}})});}_0x5155a2=_[_0x9afe('0x3e')]({},_0x5155a2,_0xcbaf5d['options']);var _0x5aac24={'where':_0x5155a2[_0x9afe('0x3c')]};return db[_0x9afe('0x2c')][_0x9afe('0x22')](_0x5aac24)[_0x9afe('0x27')](function(_0x578e6b){_0x406939[_0x9afe('0x22')]=_0x578e6b;if(_0xcbaf5d['query']['includeAll']){_0x5155a2[_0x9afe('0x41')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x5155a2);})[_0x9afe('0x27')](function(_0x30c1a2){_0x406939[_0x9afe('0x42')]=_0x30c1a2;return _0x406939;})[_0x9afe('0x27')](respondWithFilteredResult(_0x262aca,_0x5155a2))[_0x9afe('0x43')](handleError(_0x262aca,null));};exports[_0x9afe('0x44')]=function(_0x5656a9,_0x504bc1){var _0x108ff7={'raw':!![],'where':{'id':_0x5656a9[_0x9afe('0x45')]['id']}},_0x26842a={};_0x26842a[_0x9afe('0x31')]=_[_0x9afe('0x33')](db[_0x9afe('0x2c')]['rawAttributes']);_0x26842a[_0x9afe('0x32')]=_[_0x9afe('0x33')](_0x5656a9[_0x9afe('0x32')]);_0x26842a[_0x9afe('0x34')]=_[_0x9afe('0x35')](_0x26842a['model'],_0x26842a[_0x9afe('0x32')]);_0x108ff7['attributes']=_['intersection'](_0x26842a[_0x9afe('0x31')],qs['fields'](_0x5656a9[_0x9afe('0x32')][_0x9afe('0x37')]));_0x108ff7['attributes']=_0x108ff7['attributes'][_0x9afe('0x38')]?_0x108ff7[_0x9afe('0x36')]:_0x26842a[_0x9afe('0x31')];if(_0x5656a9[_0x9afe('0x32')][_0x9afe('0x46')]){_0x108ff7['include']=[{'all':!![]}];}_0x108ff7=_[_0x9afe('0x3e')]({},_0x108ff7,_0x5656a9[_0x9afe('0x47')]);return db[_0x9afe('0x2c')][_0x9afe('0x48')](_0x108ff7)['then'](handleEntityNotFound(_0x504bc1,null))['then'](respondWithResult(_0x504bc1,null))[_0x9afe('0x43')](handleError(_0x504bc1,null));};exports[_0x9afe('0x49')]=function(_0x24a7eb,_0x3ecf15){return db[_0x9afe('0x2c')][_0x9afe('0x49')](_0x24a7eb[_0x9afe('0x4a')],{})[_0x9afe('0x27')](respondWithResult(_0x3ecf15,0xc9))[_0x9afe('0x43')](handleError(_0x3ecf15,null));};exports[_0x9afe('0x26')]=function(_0x125c27,_0x2bf41d){if(_0x125c27[_0x9afe('0x4a')]['id']){delete _0x125c27[_0x9afe('0x4a')]['id'];}return db[_0x9afe('0x2c')]['find']({'where':{'id':_0x125c27[_0x9afe('0x45')]['id']}})['then'](handleEntityNotFound(_0x2bf41d,null))[_0x9afe('0x27')](saveUpdates(_0x125c27['body'],null))[_0x9afe('0x27')](respondWithResult(_0x2bf41d,null))[_0x9afe('0x43')](handleError(_0x2bf41d,null));};exports['destroy']=function(_0xc8ed6d,_0x45626d){return db[_0x9afe('0x2c')]['find']({'where':{'id':_0xc8ed6d['params']['id']}})['then'](handleEntityNotFound(_0x45626d,null))[_0x9afe('0x27')](removeEntity(_0x45626d,null))['catch'](handleError(_0x45626d,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 1d1790f..f6df2eb 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 _0x42c3=['exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','path','./squareMessage.attributes'];(function(_0x23e544,_0x44b5d8){var _0x141be7=function(_0x1c3af6){while(--_0x1c3af6){_0x23e544['push'](_0x23e544['shift']());}};_0x141be7(++_0x44b5d8);}(_0x42c3,0x1e4));var _0x342c=function(_0x18a412,_0x38f607){_0x18a412=_0x18a412-0x0;var _0x50b676=_0x42c3[_0x18a412];return _0x50b676;};'use strict';var _=require(_0x342c('0x0'));var util=require(_0x342c('0x1'));var logger=require(_0x342c('0x2'))(_0x342c('0x3'));var moment=require(_0x342c('0x4'));var BPromise=require(_0x342c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x342c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x342c('0x7'));module[_0x342c('0x8')]=function(_0x3d2bc8,_0x156f09){return _0x3d2bc8[_0x342c('0x9')](_0x342c('0xa'),attributes,{'tableName':_0x342c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdac5=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','define','square_messages','lodash'];(function(_0x52c277,_0x1c33a3){var _0x595bd2=function(_0x51335b){while(--_0x51335b){_0x52c277['push'](_0x52c277['shift']());}};_0x595bd2(++_0x1c33a3);}(_0xdac5,0x17b));var _0x5dac=function(_0x2facf5,_0x1e0a03){_0x2facf5=_0x2facf5-0x0;var _0x10c3b1=_0xdac5[_0x2facf5];return _0x10c3b1;};'use strict';var _=require(_0x5dac('0x0'));var util=require(_0x5dac('0x1'));var logger=require(_0x5dac('0x2'))(_0x5dac('0x3'));var moment=require('moment');var BPromise=require(_0x5dac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5dac('0x5'));var rimraf=require(_0x5dac('0x6'));var config=require(_0x5dac('0x7'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x47be86,_0xae53f2){return _0x47be86[_0x5dac('0x8')]('SquareMessage',attributes,{'tableName':_0x5dac('0x9'),'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 bddcded..84becdc 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 _0xa9e0=['message','result','catch','SquareMessage','create','body','options','raw','then','CreateSquareMessage','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x410b05,_0x257a4c){var _0x343ced=function(_0x41cda6){while(--_0x41cda6){_0x410b05['push'](_0x410b05['shift']());}};_0x343ced(++_0x257a4c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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['CreateSquareMessage']=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?!![]:![]:!![]})[_0x0a9e('0x19')](function(_0x105080){logger['info'](_0x0a9e('0x1a'),_0x459eb1);logger[_0x0a9e('0xd')]('CreateSquareMessage',_0x459eb1,JSON[_0x0a9e('0x1b')](_0x105080));_0x106033(_0x105080);})['catch'](function(_0x588269){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x588269[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x588269['message']));});});}; \ No newline at end of file +var _0xa9e0=['message','result','catch','SquareMessage','create','body','options','raw','then','CreateSquareMessage','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x10eb6c,_0x1d2a80){var _0x38a740=function(_0x503465){while(--_0x503465){_0x10eb6c['push'](_0x10eb6c['shift']());}};_0x38a740(++_0x1d2a80);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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['CreateSquareMessage']=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?!![]:![]:!![]})[_0x0a9e('0x19')](function(_0x105080){logger['info'](_0x0a9e('0x1a'),_0x459eb1);logger[_0x0a9e('0xd')]('CreateSquareMessage',_0x459eb1,JSON[_0x0a9e('0x1b')](_0x105080));_0x106033(_0x105080);})['catch'](function(_0x588269){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x588269[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x588269['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 4971c3e..68a8b40 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 _0xe58e=['put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','test','post'];(function(_0x47e8ec,_0x403570){var _0x58410b=function(_0x682907){while(--_0x682907){_0x47e8ec['push'](_0x47e8ec['shift']());}};_0x58410b(++_0x403570);}(_0xe58e,0x131));var _0xee58=function(_0x15eee8,_0x597fd2){_0x15eee8=_0x15eee8-0x0;var _0x54ebed=_0xe58e[_0x15eee8];return _0x54ebed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee58('0x0'));var timeout=require(_0xee58('0x1'));var express=require(_0xee58('0x2'));var router=express[_0xee58('0x3')]();var fs_extra=require(_0xee58('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xee58('0x5'));var controller=require(_0xee58('0x6'));router[_0xee58('0x7')]('/',auth[_0xee58('0x8')](),controller[_0xee58('0x9')]);router[_0xee58('0x7')](_0xee58('0xa'),auth[_0xee58('0x8')](),controller['show']);router[_0xee58('0x7')](_0xee58('0xb'),auth[_0xee58('0x8')](),timeout(_0xee58('0xc')),controller[_0xee58('0xd')]);router[_0xee58('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xee58('0xf')](_0xee58('0xa'),auth['isAuthenticated'](),controller[_0xee58('0x10')]);router[_0xee58('0x11')]('/:id',auth[_0xee58('0x8')](),controller[_0xee58('0x12')]);module[_0xee58('0x13')]=router; \ No newline at end of file +var _0x2f7e=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','/:id','show','/:id/test','15s','post','create','put','destroy','exports','multer'];(function(_0x49f213,_0x1d72e8){var _0x37c489=function(_0x2daf3a){while(--_0x2daf3a){_0x49f213['push'](_0x49f213['shift']());}};_0x37c489(++_0x1d72e8);}(_0x2f7e,0xc7));var _0xe2f7=function(_0x2301f2,_0x252f65){_0x2301f2=_0x2301f2-0x0;var _0xc2e9ef=_0x2f7e[_0x2301f2];return _0xc2e9ef;};'use strict';var multer=require(_0xe2f7('0x0'));var util=require(_0xe2f7('0x1'));var path=require(_0xe2f7('0x2'));var timeout=require('connect-timeout');var express=require(_0xe2f7('0x3'));var router=express[_0xe2f7('0x4')]();var fs_extra=require(_0xe2f7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2f7('0x6'));var config=require(_0xe2f7('0x7'));var controller=require(_0xe2f7('0x8'));router[_0xe2f7('0x9')]('/',auth[_0xe2f7('0xa')](),controller['index']);router['get'](_0xe2f7('0xb'),auth[_0xe2f7('0xa')](),controller[_0xe2f7('0xc')]);router[_0xe2f7('0x9')](_0xe2f7('0xd'),auth[_0xe2f7('0xa')](),timeout(_0xe2f7('0xe')),controller['test']);router[_0xe2f7('0xf')]('/',auth[_0xe2f7('0xa')](),controller[_0xe2f7('0x10')]);router[_0xe2f7('0x11')](_0xe2f7('0xb'),auth[_0xe2f7('0xa')](),controller['update']);router['delete'](_0xe2f7('0xb'),auth[_0xe2f7('0xa')](),controller[_0xe2f7('0x12')]);module[_0xe2f7('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index be370fb..bfea999 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 _0x7b54=['exports','STRING','name'];(function(_0x571e5c,_0x5e7639){var _0x2bd76e=function(_0x2ddda4){while(--_0x2ddda4){_0x571e5c['push'](_0x571e5c['shift']());}};_0x2bd76e(++_0x5e7639);}(_0x7b54,0x84));var _0x47b5=function(_0x29af39,_0x343c56){_0x29af39=_0x29af39-0x0;var _0x3ab715=_0x7b54[_0x29af39];return _0x3ab715;};'use strict';var Sequelize=require('sequelize');module[_0x47b5('0x0')]={'name':{'type':Sequelize[_0x47b5('0x1')],'unique':_0x47b5('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x47b5('0x1')]}}; \ No newline at end of file +var _0xa477=['name','sequelize','exports','STRING'];(function(_0x6262fd,_0x343a3d){var _0x256b20=function(_0x39f6c4){while(--_0x39f6c4){_0x6262fd['push'](_0x6262fd['shift']());}};_0x256b20(++_0x343a3d);}(_0xa477,0x191));var _0x7a47=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xa477[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0x7a47('0x0'));module[_0x7a47('0x1')]={'name':{'type':Sequelize[_0x7a47('0x2')],'unique':_0x7a47('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7a47('0x2')]},'description':{'type':Sequelize[_0x7a47('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 41ee8c3..8e09be6 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 _0xfaca=['util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','SquareOdbc','findAll','catch','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','test','odbc','openSync','dsn','closeSync','eml-format','rimraf','request-promise','moment','bluebird','mustache'];(function(_0x54d3a3,_0x35b2d7){var _0x456ba7=function(_0x80f5f7){while(--_0x80f5f7){_0x54d3a3['push'](_0x54d3a3['shift']());}};_0x456ba7(++_0x35b2d7);}(_0xfaca,0x152));var _0xafac=function(_0xf81fcf,_0x4cfe28){_0xf81fcf=_0xf81fcf-0x0;var _0x5eae31=_0xfaca[_0xf81fcf];return _0x5eae31;};'use strict';var emlformat=require(_0xafac('0x0'));var rimraf=require(_0xafac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xafac('0x2'));var moment=require(_0xafac('0x3'));var BPromise=require(_0xafac('0x4'));var Mustache=require(_0xafac('0x5'));var util=require(_0xafac('0x6'));var path=require(_0xafac('0x7'));var sox=require(_0xafac('0x8'));var csv=require(_0xafac('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xafac('0xa'));var _=require(_0xafac('0xb'));var squel=require(_0xafac('0xc'));var crypto=require('crypto');var jsforce=require(_0xafac('0xd'));var deskjs=require(_0xafac('0xe'));var toCsv=require('to-csv');var querystring=require(_0xafac('0xf'));var Papa=require(_0xafac('0x10'));var Redis=require(_0xafac('0x11'));var authService=require(_0xafac('0x12'));var qs=require(_0xafac('0x13'));var as=require(_0xafac('0x14'));var hardwareService=require(_0xafac('0x15'));var logger=require('../../config/logger')(_0xafac('0x16'));var utils=require('../../config/utils');var config=require(_0xafac('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xafac('0x18'))['db'];function respondWithStatusCode(_0x285341,_0x1343bd){_0x1343bd=_0x1343bd||0xcc;return function(_0xe54898){if(_0xe54898){return _0x285341[_0xafac('0x19')](_0x1343bd);}return _0x285341[_0xafac('0x1a')](_0x1343bd)[_0xafac('0x1b')]();};}function respondWithResult(_0x1ba5c1,_0x425c8b){_0x425c8b=_0x425c8b||0xc8;return function(_0xba0e43){if(_0xba0e43){return _0x1ba5c1[_0xafac('0x1a')](_0x425c8b)[_0xafac('0x1c')](_0xba0e43);}};}function respondWithFilteredResult(_0x1070ed,_0x59026f){return function(_0x134ebd){if(_0x134ebd){var _0x142265=typeof _0x59026f[_0xafac('0x1d')]===_0xafac('0x1e')&&typeof _0x59026f[_0xafac('0x1f')]==='undefined';var _0x30198c=_0x134ebd[_0xafac('0x20')];var _0x4797b1=_0x142265?0x0:_0x59026f[_0xafac('0x1d')];var _0x1bc85a=_0x142265?_0x134ebd[_0xafac('0x20')]:_0x59026f['offset']+_0x59026f['limit'];var _0x212da8;if(_0x1bc85a>=_0x30198c){_0x1bc85a=_0x30198c;_0x212da8=0xc8;}else{_0x212da8=0xce;}_0x1070ed[_0xafac('0x1a')](_0x212da8);return _0x1070ed[_0xafac('0x21')](_0xafac('0x22'),_0x4797b1+'-'+_0x1bc85a+'/'+_0x30198c)[_0xafac('0x1c')](_0x134ebd);}return null;};}function patchUpdates(_0x5127cd){return function(_0xacf40e){try{jsonpatch[_0xafac('0x23')](_0xacf40e,_0x5127cd,!![]);}catch(_0x50e743){return BPromise['reject'](_0x50e743);}return _0xacf40e[_0xafac('0x24')]();};}function saveUpdates(_0x132e23,_0xd881ef){return function(_0x9d005d){if(_0x9d005d){return _0x9d005d[_0xafac('0x25')](_0x132e23)[_0xafac('0x26')](function(_0x236d75){return _0x236d75;});}return null;};}function removeEntity(_0x16352e,_0x55b0ab){return function(_0x1c57f8){if(_0x1c57f8){return _0x1c57f8[_0xafac('0x27')]()['then'](function(){var _0x3bcbdd=_0x1c57f8[_0xafac('0x28')]({'plain':!![]});var _0x15f95f=_0xafac('0x29');return db[_0xafac('0x2a')][_0xafac('0x27')]({'where':{'type':_0x15f95f,'resourceId':_0x3bcbdd['id']}})[_0xafac('0x26')](function(){return _0x1c57f8;});})[_0xafac('0x26')](function(){_0x16352e[_0xafac('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x304c90,_0x5a5ef0){return function(_0x524edb){if(!_0x524edb){_0x304c90[_0xafac('0x19')](0x194);}return _0x524edb;};}function handleError(_0x5248b5,_0x30b1d5){_0x30b1d5=_0x30b1d5||0x1f4;return function(_0x3056c9){logger[_0xafac('0x2b')](_0x3056c9[_0xafac('0x2c')]);if(_0x3056c9[_0xafac('0x2d')]){delete _0x3056c9['name'];}_0x5248b5[_0xafac('0x1a')](_0x30b1d5)[_0xafac('0x2e')](_0x3056c9);};}exports['index']=function(_0x599fba,_0x18b00a){var _0xbade1={},_0xbeb190={},_0x3a1157={'count':0x0,'rows':[]};var _0x166478=_[_0xafac('0x2f')](db['SquareOdbc'][_0xafac('0x30')],function(_0x2be897){return{'name':_0x2be897[_0xafac('0x31')],'type':_0x2be897['type'][_0xafac('0x32')]};});_0xbeb190['model']=_[_0xafac('0x2f')](_0x166478,'name');_0xbeb190[_0xafac('0x33')]=_[_0xafac('0x34')](_0x599fba['query']);_0xbeb190[_0xafac('0x35')]=_[_0xafac('0x36')](_0xbeb190[_0xafac('0x37')],_0xbeb190['query']);_0xbade1[_0xafac('0x38')]=_[_0xafac('0x36')](_0xbeb190[_0xafac('0x37')],qs[_0xafac('0x39')](_0x599fba[_0xafac('0x33')]['fields']));_0xbade1[_0xafac('0x38')]=_0xbade1[_0xafac('0x38')][_0xafac('0x3a')]?_0xbade1[_0xafac('0x38')]:_0xbeb190['model'];if(!_0x599fba[_0xafac('0x33')][_0xafac('0x3b')](_0xafac('0x3c'))){_0xbade1[_0xafac('0x1f')]=qs[_0xafac('0x1f')](_0x599fba[_0xafac('0x33')]['limit']);_0xbade1[_0xafac('0x1d')]=qs['offset'](_0x599fba['query'][_0xafac('0x1d')]);}_0xbade1['order']=qs[_0xafac('0x3d')](_0x599fba[_0xafac('0x33')][_0xafac('0x3d')]);_0xbade1[_0xafac('0x3e')]=qs[_0xafac('0x35')](_[_0xafac('0x3f')](_0x599fba[_0xafac('0x33')],_0xbeb190[_0xafac('0x35')]),_0x166478);if(_0x599fba[_0xafac('0x33')][_0xafac('0x40')]){_0xbade1['where']=_[_0xafac('0x41')](_0xbade1[_0xafac('0x3e')],{'$or':_['map'](_0x166478,function(_0x536d6d){if(_0x536d6d[_0xafac('0x42')]!=='VIRTUAL'){var _0x45ab11={};_0x45ab11[_0x536d6d[_0xafac('0x2d')]]={'$like':'%'+_0x599fba['query'][_0xafac('0x40')]+'%'};return _0x45ab11;}})});}_0xbade1=_[_0xafac('0x41')]({},_0xbade1,_0x599fba[_0xafac('0x43')]);var _0x561033={'where':_0xbade1[_0xafac('0x3e')]};return db[_0xafac('0x44')][_0xafac('0x20')](_0x561033)[_0xafac('0x26')](function(_0x30f846){_0x3a1157['count']=_0x30f846;if(_0x599fba[_0xafac('0x33')]['includeAll']){_0xbade1['include']=[{'all':!![]}];}return db[_0xafac('0x44')][_0xafac('0x45')](_0xbade1);})[_0xafac('0x26')](function(_0x356fe7){_0x3a1157['rows']=_0x356fe7;return _0x3a1157;})[_0xafac('0x26')](respondWithFilteredResult(_0x18b00a,_0xbade1))[_0xafac('0x46')](handleError(_0x18b00a,null));};exports['show']=function(_0x4c7415,_0x3ad299){var _0x557cf7={'raw':!![],'where':{'id':_0x4c7415['params']['id']}},_0x15ff20={};_0x15ff20[_0xafac('0x37')]=_[_0xafac('0x34')](db[_0xafac('0x44')]['rawAttributes']);_0x15ff20['query']=_[_0xafac('0x34')](_0x4c7415[_0xafac('0x33')]);_0x15ff20[_0xafac('0x35')]=_[_0xafac('0x36')](_0x15ff20[_0xafac('0x37')],_0x15ff20[_0xafac('0x33')]);_0x557cf7[_0xafac('0x38')]=_[_0xafac('0x36')](_0x15ff20[_0xafac('0x37')],qs[_0xafac('0x39')](_0x4c7415[_0xafac('0x33')][_0xafac('0x39')]));_0x557cf7[_0xafac('0x38')]=_0x557cf7[_0xafac('0x38')][_0xafac('0x3a')]?_0x557cf7[_0xafac('0x38')]:_0x15ff20['model'];if(_0x4c7415[_0xafac('0x33')][_0xafac('0x47')]){_0x557cf7['include']=[{'all':!![]}];}_0x557cf7=_['merge']({},_0x557cf7,_0x4c7415[_0xafac('0x43')]);return db[_0xafac('0x44')]['find'](_0x557cf7)[_0xafac('0x26')](handleEntityNotFound(_0x3ad299,null))[_0xafac('0x26')](respondWithResult(_0x3ad299,null))[_0xafac('0x46')](handleError(_0x3ad299,null));};exports[_0xafac('0x48')]=function(_0x31a426,_0x4e8abd){return db['SquareOdbc'][_0xafac('0x48')](_0x31a426['body'],{})[_0xafac('0x26')](function(_0x476625){var _0x15df26=_0x31a426[_0xafac('0x49')][_0xafac('0x28')]({'plain':!![]});if(!_0x15df26)throw new Error(_0xafac('0x4a'));if(_0x15df26['role']==='user'){var _0x14466b=_0x476625[_0xafac('0x28')]({'plain':!![]});var _0x40a8aa=_0xafac('0x29');return db['UserProfileSection'][_0xafac('0x4b')]({'where':{'name':_0x40a8aa,'userProfileId':_0x15df26[_0xafac('0x4c')]},'raw':!![]})[_0xafac('0x26')](function(_0x474897){if(_0x474897&&_0x474897[_0xafac('0x4d')]===0x0){return db[_0xafac('0x2a')][_0xafac('0x48')]({'name':_0x14466b[_0xafac('0x2d')],'resourceId':_0x14466b['id'],'type':_0x474897[_0xafac('0x2d')],'sectionId':_0x474897['id']},{})[_0xafac('0x26')](function(){return _0x476625;});}else{return _0x476625;}})['catch'](function(_0x3940b5){logger[_0xafac('0x2b')](_0xafac('0x4e'),_0x3940b5);throw _0x3940b5;});}return _0x476625;})['then'](respondWithResult(_0x4e8abd,0xc9))[_0xafac('0x46')](handleError(_0x4e8abd,null));};exports[_0xafac('0x25')]=function(_0x7b703d,_0x21da00){if(_0x7b703d[_0xafac('0x4f')]['id']){delete _0x7b703d[_0xafac('0x4f')]['id'];}return db[_0xafac('0x44')][_0xafac('0x4b')]({'where':{'id':_0x7b703d[_0xafac('0x50')]['id']}})['then'](handleEntityNotFound(_0x21da00,null))[_0xafac('0x26')](saveUpdates(_0x7b703d['body'],null))[_0xafac('0x26')](respondWithResult(_0x21da00,null))['catch'](handleError(_0x21da00,null));};exports[_0xafac('0x27')]=function(_0x563684,_0x3a8bfe){return db[_0xafac('0x44')][_0xafac('0x4b')]({'where':{'id':_0x563684[_0xafac('0x50')]['id']}})[_0xafac('0x26')](handleEntityNotFound(_0x3a8bfe,null))[_0xafac('0x26')](removeEntity(_0x3a8bfe,null))[_0xafac('0x46')](handleError(_0x3a8bfe,null));};exports[_0xafac('0x51')]=function(_0xf37927,_0x57a03e,_0x5ca0f2){var _0x39a72a;return db[_0xafac('0x44')][_0xafac('0x4b')]({'where':{'id':_0xf37927[_0xafac('0x50')]['id']},'attributes':['id','dsn']})[_0xafac('0x26')](handleEntityNotFound(_0x57a03e,null))['then'](function(_0x42b96c){if(_0x42b96c){var _0x579994=require(_0xafac('0x52'))();_0x579994[_0xafac('0x53')](_0x42b96c[_0xafac('0x54')]);_0x579994[_0xafac('0x55')]();return _0x42b96c;}})[_0xafac('0x26')](respondWithResult(_0x57a03e,null))['catch'](handleError(_0x57a03e,null));}; \ No newline at end of file +var _0x5f5d=['type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','rows','catch','show','params','keys','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','ODBC','UserProfileResource','sendStatus','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName'];(function(_0x40c611,_0x13febe){var _0x126bc0=function(_0x671904){while(--_0x671904){_0x40c611['push'](_0x40c611['shift']());}};_0x126bc0(++_0x13febe);}(_0x5f5d,0xd5));var _0xd5f5=function(_0x1cbe27,_0x39d008){_0x1cbe27=_0x1cbe27-0x0;var _0x1bb6bc=_0x5f5d[_0x1cbe27];return _0x1bb6bc;};'use strict';var emlformat=require(_0xd5f5('0x0'));var rimraf=require(_0xd5f5('0x1'));var zipdir=require(_0xd5f5('0x2'));var jsonpatch=require(_0xd5f5('0x3'));var rp=require('request-promise');var moment=require(_0xd5f5('0x4'));var BPromise=require(_0xd5f5('0x5'));var Mustache=require(_0xd5f5('0x6'));var util=require(_0xd5f5('0x7'));var path=require('path');var sox=require(_0xd5f5('0x8'));var csv=require(_0xd5f5('0x9'));var ejs=require(_0xd5f5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd5f5('0xb'));var squel=require(_0xd5f5('0xc'));var crypto=require(_0xd5f5('0xd'));var jsforce=require(_0xd5f5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd5f5('0x9'));var querystring=require(_0xd5f5('0xf'));var Papa=require(_0xd5f5('0x10'));var Redis=require('ioredis');var authService=require(_0xd5f5('0x11'));var qs=require(_0xd5f5('0x12'));var as=require(_0xd5f5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5f5('0x14'))(_0xd5f5('0x15'));var utils=require(_0xd5f5('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd5f5('0x17'))['db'];function respondWithStatusCode(_0x4ff006,_0x5717fc){_0x5717fc=_0x5717fc||0xcc;return function(_0x581f12){if(_0x581f12){return _0x4ff006['sendStatus'](_0x5717fc);}return _0x4ff006[_0xd5f5('0x18')](_0x5717fc)[_0xd5f5('0x19')]();};}function respondWithResult(_0x2991ed,_0x56a7b1){_0x56a7b1=_0x56a7b1||0xc8;return function(_0xe5ec83){if(_0xe5ec83){return _0x2991ed[_0xd5f5('0x18')](_0x56a7b1)[_0xd5f5('0x1a')](_0xe5ec83);}};}function respondWithFilteredResult(_0x1bb516,_0x474fcc){return function(_0x3eb49a){if(_0x3eb49a){var _0x16bf5b=typeof _0x474fcc[_0xd5f5('0x1b')]===_0xd5f5('0x1c')&&typeof _0x474fcc[_0xd5f5('0x1d')]===_0xd5f5('0x1c');var _0x2b0d2b=_0x3eb49a[_0xd5f5('0x1e')];var _0x1e3eae=_0x16bf5b?0x0:_0x474fcc[_0xd5f5('0x1b')];var _0x31720a=_0x16bf5b?_0x3eb49a[_0xd5f5('0x1e')]:_0x474fcc[_0xd5f5('0x1b')]+_0x474fcc[_0xd5f5('0x1d')];var _0x14ad33;if(_0x31720a>=_0x2b0d2b){_0x31720a=_0x2b0d2b;_0x14ad33=0xc8;}else{_0x14ad33=0xce;}_0x1bb516['status'](_0x14ad33);return _0x1bb516[_0xd5f5('0x1f')](_0xd5f5('0x20'),_0x1e3eae+'-'+_0x31720a+'/'+_0x2b0d2b)[_0xd5f5('0x1a')](_0x3eb49a);}return null;};}function patchUpdates(_0x16ef2d){return function(_0x57cee3){try{jsonpatch[_0xd5f5('0x21')](_0x57cee3,_0x16ef2d,!![]);}catch(_0x1e8e90){return BPromise[_0xd5f5('0x22')](_0x1e8e90);}return _0x57cee3[_0xd5f5('0x23')]();};}function saveUpdates(_0x314a42,_0x42afa){return function(_0x547bdf){if(_0x547bdf){return _0x547bdf[_0xd5f5('0x24')](_0x314a42)['then'](function(_0x252a82){return _0x252a82;});}return null;};}function removeEntity(_0x23a1e3,_0x503163){return function(_0x4383da){if(_0x4383da){return _0x4383da[_0xd5f5('0x25')]()[_0xd5f5('0x26')](function(){var _0x28ed51=_0x4383da['get']({'plain':!![]});var _0x2d49e4=_0xd5f5('0x27');return db[_0xd5f5('0x28')]['destroy']({'where':{'type':_0x2d49e4,'resourceId':_0x28ed51['id']}})[_0xd5f5('0x26')](function(){return _0x4383da;});})[_0xd5f5('0x26')](function(){_0x23a1e3['status'](0xcc)[_0xd5f5('0x19')]();});}};}function handleEntityNotFound(_0x524f60,_0x15d486){return function(_0x196fbd){if(!_0x196fbd){_0x524f60[_0xd5f5('0x29')](0x194);}return _0x196fbd;};}function handleError(_0x22fe01,_0x5a6032){_0x5a6032=_0x5a6032||0x1f4;return function(_0xe81a8e){logger[_0xd5f5('0x2a')](_0xe81a8e[_0xd5f5('0x2b')]);if(_0xe81a8e[_0xd5f5('0x2c')]){delete _0xe81a8e['name'];}_0x22fe01['status'](_0x5a6032)[_0xd5f5('0x2d')](_0xe81a8e);};}exports[_0xd5f5('0x2e')]=function(_0x535aa2,_0x5432b1){var _0x283156={},_0x1eb182={},_0x31f9a6={'count':0x0,'rows':[]};var _0x25423f=_[_0xd5f5('0x2f')](db[_0xd5f5('0x30')][_0xd5f5('0x31')],function(_0x393e8b){return{'name':_0x393e8b[_0xd5f5('0x32')],'type':_0x393e8b[_0xd5f5('0x33')][_0xd5f5('0x34')]};});_0x1eb182[_0xd5f5('0x35')]=_[_0xd5f5('0x2f')](_0x25423f,_0xd5f5('0x2c'));_0x1eb182[_0xd5f5('0x36')]=_['keys'](_0x535aa2[_0xd5f5('0x36')]);_0x1eb182[_0xd5f5('0x37')]=_['intersection'](_0x1eb182[_0xd5f5('0x35')],_0x1eb182['query']);_0x283156['attributes']=_[_0xd5f5('0x38')](_0x1eb182[_0xd5f5('0x35')],qs[_0xd5f5('0x39')](_0x535aa2[_0xd5f5('0x36')][_0xd5f5('0x39')]));_0x283156['attributes']=_0x283156[_0xd5f5('0x3a')][_0xd5f5('0x3b')]?_0x283156[_0xd5f5('0x3a')]:_0x1eb182[_0xd5f5('0x35')];if(!_0x535aa2[_0xd5f5('0x36')][_0xd5f5('0x3c')](_0xd5f5('0x3d'))){_0x283156[_0xd5f5('0x1d')]=qs[_0xd5f5('0x1d')](_0x535aa2[_0xd5f5('0x36')][_0xd5f5('0x1d')]);_0x283156['offset']=qs[_0xd5f5('0x1b')](_0x535aa2[_0xd5f5('0x36')][_0xd5f5('0x1b')]);}_0x283156[_0xd5f5('0x3e')]=qs[_0xd5f5('0x3f')](_0x535aa2[_0xd5f5('0x36')]['sort']);_0x283156[_0xd5f5('0x40')]=qs['filters'](_[_0xd5f5('0x41')](_0x535aa2[_0xd5f5('0x36')],_0x1eb182[_0xd5f5('0x37')]),_0x25423f);if(_0x535aa2['query'][_0xd5f5('0x42')]){_0x283156[_0xd5f5('0x40')]=_[_0xd5f5('0x43')](_0x283156['where'],{'$or':_[_0xd5f5('0x2f')](_0x25423f,function(_0x1fb363){if(_0x1fb363['type']!=='VIRTUAL'){var _0x5d471d={};_0x5d471d[_0x1fb363[_0xd5f5('0x2c')]]={'$like':'%'+_0x535aa2[_0xd5f5('0x36')][_0xd5f5('0x42')]+'%'};return _0x5d471d;}})});}_0x283156=_[_0xd5f5('0x43')]({},_0x283156,_0x535aa2['options']);var _0x1594c9={'where':_0x283156['where']};return db[_0xd5f5('0x30')][_0xd5f5('0x1e')](_0x1594c9)[_0xd5f5('0x26')](function(_0x1f24db){_0x31f9a6['count']=_0x1f24db;if(_0x535aa2[_0xd5f5('0x36')][_0xd5f5('0x44')]){_0x283156['include']=[{'all':!![]}];}return db[_0xd5f5('0x30')]['findAll'](_0x283156);})['then'](function(_0x7ff9f0){_0x31f9a6[_0xd5f5('0x45')]=_0x7ff9f0;return _0x31f9a6;})[_0xd5f5('0x26')](respondWithFilteredResult(_0x5432b1,_0x283156))[_0xd5f5('0x46')](handleError(_0x5432b1,null));};exports[_0xd5f5('0x47')]=function(_0xcb417c,_0x322658){var _0x4bb521={'raw':!![],'where':{'id':_0xcb417c[_0xd5f5('0x48')]['id']}},_0x172171={};_0x172171[_0xd5f5('0x35')]=_['keys'](db[_0xd5f5('0x30')]['rawAttributes']);_0x172171['query']=_[_0xd5f5('0x49')](_0xcb417c['query']);_0x172171[_0xd5f5('0x37')]=_[_0xd5f5('0x38')](_0x172171['model'],_0x172171[_0xd5f5('0x36')]);_0x4bb521[_0xd5f5('0x3a')]=_[_0xd5f5('0x38')](_0x172171[_0xd5f5('0x35')],qs[_0xd5f5('0x39')](_0xcb417c[_0xd5f5('0x36')][_0xd5f5('0x39')]));_0x4bb521[_0xd5f5('0x3a')]=_0x4bb521[_0xd5f5('0x3a')][_0xd5f5('0x3b')]?_0x4bb521[_0xd5f5('0x3a')]:_0x172171['model'];if(_0xcb417c['query'][_0xd5f5('0x44')]){_0x4bb521[_0xd5f5('0x4a')]=[{'all':!![]}];}_0x4bb521=_['merge']({},_0x4bb521,_0xcb417c['options']);return db[_0xd5f5('0x30')][_0xd5f5('0x4b')](_0x4bb521)[_0xd5f5('0x26')](handleEntityNotFound(_0x322658,null))[_0xd5f5('0x26')](respondWithResult(_0x322658,null))[_0xd5f5('0x46')](handleError(_0x322658,null));};exports[_0xd5f5('0x4c')]=function(_0x10bd7e,_0x1466d8){return db['SquareOdbc']['create'](_0x10bd7e['body'],{})[_0xd5f5('0x26')](function(_0x4377f6){var _0x479190=_0x10bd7e[_0xd5f5('0x4d')][_0xd5f5('0x4e')]({'plain':!![]});if(!_0x479190)throw new Error(_0xd5f5('0x4f'));if(_0x479190[_0xd5f5('0x50')]==='user'){var _0x4bdc5c=_0x4377f6[_0xd5f5('0x4e')]({'plain':!![]});var _0x3c1a1e='ODBC';return db['UserProfileSection']['find']({'where':{'name':_0x3c1a1e,'userProfileId':_0x479190['userProfileId']},'raw':!![]})['then'](function(_0x3ee0d4){if(_0x3ee0d4&&_0x3ee0d4[_0xd5f5('0x51')]===0x0){return db[_0xd5f5('0x28')]['create']({'name':_0x4bdc5c[_0xd5f5('0x2c')],'resourceId':_0x4bdc5c['id'],'type':_0x3ee0d4[_0xd5f5('0x2c')],'sectionId':_0x3ee0d4['id']},{})[_0xd5f5('0x26')](function(){return _0x4377f6;});}else{return _0x4377f6;}})[_0xd5f5('0x46')](function(_0x39767b){logger[_0xd5f5('0x2a')](_0xd5f5('0x52'),_0x39767b);throw _0x39767b;});}return _0x4377f6;})[_0xd5f5('0x26')](respondWithResult(_0x1466d8,0xc9))['catch'](handleError(_0x1466d8,null));};exports[_0xd5f5('0x24')]=function(_0x334e9d,_0xf2bb40){if(_0x334e9d[_0xd5f5('0x53')]['id']){delete _0x334e9d['body']['id'];}return db[_0xd5f5('0x30')][_0xd5f5('0x4b')]({'where':{'id':_0x334e9d[_0xd5f5('0x48')]['id']}})[_0xd5f5('0x26')](handleEntityNotFound(_0xf2bb40,null))[_0xd5f5('0x26')](saveUpdates(_0x334e9d[_0xd5f5('0x53')],null))[_0xd5f5('0x26')](respondWithResult(_0xf2bb40,null))['catch'](handleError(_0xf2bb40,null));};exports['destroy']=function(_0x1fd29c,_0x189960){return db[_0xd5f5('0x30')][_0xd5f5('0x4b')]({'where':{'id':_0x1fd29c[_0xd5f5('0x48')]['id']}})[_0xd5f5('0x26')](handleEntityNotFound(_0x189960,null))['then'](removeEntity(_0x189960,null))[_0xd5f5('0x46')](handleError(_0x189960,null));};exports[_0xd5f5('0x54')]=function(_0x5fdbec,_0x36865c,_0x31a3ae){var _0x97cd92;return db[_0xd5f5('0x30')][_0xd5f5('0x4b')]({'where':{'id':_0x5fdbec['params']['id']},'attributes':['id',_0xd5f5('0x55')]})[_0xd5f5('0x26')](handleEntityNotFound(_0x36865c,null))[_0xd5f5('0x26')](function(_0x4ccd8d){if(_0x4ccd8d){var _0x4916c8=require('odbc')();_0x4916c8[_0xd5f5('0x56')](_0x4ccd8d[_0xd5f5('0x55')]);_0x4916c8[_0xd5f5('0x57')]();return _0x4ccd8d;}})[_0xd5f5('0x26')](respondWithResult(_0x36865c,null))['catch'](handleError(_0x36865c,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 58e1630..63a2811 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 _0x8469=['request-promise','path','rimraf','../../config/environment','exports','define','SquareOdbc','square_odbc','util','moment','bluebird'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x8469,0xd9));var _0x9846=function(_0x13ff53,_0x5e1424){_0x13ff53=_0x13ff53-0x0;var _0x290228=_0x8469[_0x13ff53];return _0x290228;};'use strict';var _=require('lodash');var util=require(_0x9846('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9846('0x1'));var BPromise=require(_0x9846('0x2'));var rp=require(_0x9846('0x3'));var fs=require('fs');var path=require(_0x9846('0x4'));var rimraf=require(_0x9846('0x5'));var config=require(_0x9846('0x6'));var attributes=require('./squareOdbc.attributes');module[_0x9846('0x7')]=function(_0x38e089,_0x5c4557){return _0x38e089[_0x9846('0x8')](_0x9846('0x9'),attributes,{'tableName':_0x9846('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1fa=['./squareOdbc.attributes','define','square_odbc','../../config/logger','moment'];(function(_0x399cb9,_0x93301f){var _0x1f196c=function(_0x48eb20){while(--_0x48eb20){_0x399cb9['push'](_0x399cb9['shift']());}};_0x1f196c(++_0x93301f);}(_0xb1fa,0x9e));var _0xab1f=function(_0x2d48a2,_0x99032b){_0x2d48a2=_0x2d48a2-0x0;var _0x4d768e=_0xb1fa[_0x2d48a2];return _0x4d768e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab1f('0x0'))('api');var moment=require(_0xab1f('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xab1f('0x2'));module['exports']=function(_0x50ada8,_0x4ee73b){return _0x50ada8[_0xab1f('0x3')]('SquareOdbc',attributes,{'tableName':_0xab1f('0x4'),'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 adb82e5..a745d05 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 _0x008c=['stringify','ShowSquareOdbc','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SquareOdbc,\x20%s,\x20%s','message','catch','find','options','include','map','attributes','model','then'];(function(_0x515640,_0x27b10e){var _0x5328b=function(_0x25bb4a){while(--_0x25bb4a){_0x515640['push'](_0x515640['shift']());}};_0x5328b(++_0x27b10e);}(_0x008c,0x188));var _0xc008=function(_0x161ac3,_0x142e49){_0x161ac3=_0x161ac3-0x0;var _0x3bb837=_0x008c[_0x161ac3];return _0x3bb837;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});}exports['ShowSquareOdbc']=function(_0x540e45){var _0x5c2668=this;return new Promise(function(_0x46042b,_0x462af5){return db['SquareOdbc'][_0xc008('0x15')]({'raw':_0x540e45['options']?_0x540e45['options']['raw']===undefined?!![]:![]:!![],'where':_0x540e45['options']?_0x540e45[_0xc008('0x16')]['where']||null:null,'attributes':_0x540e45['options']?_0x540e45['options']['attributes']||null:null,'include':_0x540e45['options']?_0x540e45[_0xc008('0x16')][_0xc008('0x17')]?_[_0xc008('0x18')](_0x540e45[_0xc008('0x16')][_0xc008('0x17')],function(_0x110128){return{'model':db[_0x110128['model']],'as':_0x110128['as'],'attributes':_0x110128[_0xc008('0x19')],'include':_0x110128['include']?_['map'](_0x110128[_0xc008('0x17')],function(_0x36f358){return{'model':db[_0x36f358[_0xc008('0x1a')]],'as':_0x36f358['as'],'attributes':_0x36f358[_0xc008('0x19')],'include':_0x36f358['include']?_['map'](_0x36f358['include'],function(_0x3f7b07){return{'model':db[_0x3f7b07[_0xc008('0x1a')]],'as':_0x3f7b07['as'],'attributes':_0x3f7b07[_0xc008('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc008('0x1b')](function(_0x5bebd9){logger['info']('ShowSquareOdbc',_0x540e45);logger['debug']('ShowSquareOdbc',_0x540e45,JSON[_0xc008('0x1c')](_0x5bebd9));_0x46042b(_0x5bebd9);})[_0xc008('0x14')](function(_0x25eae4){logger['error'](_0xc008('0x1d'),_0x25eae4[_0xc008('0x13')],_0x540e45);_0x462af5(_0x5c2668[_0xc008('0x10')](0x1f4,_0x25eae4[_0xc008('0x13')]));});});}; \ No newline at end of file +var _0x7217=['where','attributes','map','include','model','ShowSquareOdbc','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareOdbc','find','options','raw'];(function(_0x10a578,_0x581165){var _0x5d991b=function(_0x4c7758){while(--_0x4c7758){_0x10a578['push'](_0x10a578['shift']());}};_0x5d991b(++_0x581165);}(_0x7217,0x19e));var _0x7721=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x7217[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowSquareOdbc']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowSquareOdbc',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 334e26b..86ed05e 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 _0x3fe2=['getUsers','post','create','/:id/users','addUsers','put','update','delete','destroy','removeUsers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','/:id','isAuthenticated'];(function(_0x3211b7,_0x4b7e04){var _0xd4fea2=function(_0x4e9e05){while(--_0x4e9e05){_0x3211b7['push'](_0x3211b7['shift']());}};_0xd4fea2(++_0x4b7e04);}(_0x3fe2,0x173));var _0x23fe=function(_0x3b8fc3,_0x2ae5ff){_0x3b8fc3=_0x3b8fc3-0x0;var _0x4d7512=_0x3fe2[_0x3b8fc3];return _0x4d7512;};'use strict';var multer=require(_0x23fe('0x0'));var util=require('util');var path=require(_0x23fe('0x1'));var timeout=require(_0x23fe('0x2'));var express=require(_0x23fe('0x3'));var router=express[_0x23fe('0x4')]();var fs_extra=require(_0x23fe('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x23fe('0x6'));var config=require(_0x23fe('0x7'));var controller=require(_0x23fe('0x8'));router[_0x23fe('0x9')]('/',auth['isAuthenticated'](),controller[_0x23fe('0xa')]);router[_0x23fe('0x9')](_0x23fe('0xb'),auth[_0x23fe('0xc')](),controller['show']);router[_0x23fe('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x23fe('0xd')]);router[_0x23fe('0xe')]('/',auth['isAuthenticated'](),controller[_0x23fe('0xf')]);router[_0x23fe('0xe')](_0x23fe('0x10'),auth[_0x23fe('0xc')](),controller[_0x23fe('0x11')]);router[_0x23fe('0x12')](_0x23fe('0xb'),auth['isAuthenticated'](),controller[_0x23fe('0x13')]);router[_0x23fe('0x14')]('/:id',auth[_0x23fe('0xc')](),controller[_0x23fe('0x15')]);router[_0x23fe('0x14')](_0x23fe('0x10'),auth[_0x23fe('0xc')](),controller[_0x23fe('0x16')]);module[_0x23fe('0x17')]=router; \ No newline at end of file +var _0x087e=['getUsers','post','create','addUsers','update','delete','removeUsers','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x087e,0x18f));var _0xe087=function(_0x5b32d9,_0x59b4a7){_0x5b32d9=_0x5b32d9-0x0;var _0x136cb7=_0x087e[_0x5b32d9];return _0x136cb7;};'use strict';var multer=require('multer');var util=require(_0xe087('0x0'));var path=require(_0xe087('0x1'));var timeout=require(_0xe087('0x2'));var express=require('express');var router=express[_0xe087('0x3')]();var fs_extra=require(_0xe087('0x4'));var auth=require(_0xe087('0x5'));var interaction=require(_0xe087('0x6'));var config=require(_0xe087('0x7'));var controller=require(_0xe087('0x8'));router[_0xe087('0x9')]('/',auth[_0xe087('0xa')](),controller[_0xe087('0xb')]);router[_0xe087('0x9')](_0xe087('0xc'),auth['isAuthenticated'](),controller[_0xe087('0xd')]);router['get'](_0xe087('0xe'),auth[_0xe087('0xa')](),controller[_0xe087('0xf')]);router[_0xe087('0x10')]('/',auth[_0xe087('0xa')](),controller[_0xe087('0x11')]);router[_0xe087('0x10')](_0xe087('0xe'),auth[_0xe087('0xa')](),controller[_0xe087('0x12')]);router['put'](_0xe087('0xc'),auth[_0xe087('0xa')](),controller[_0xe087('0x13')]);router[_0xe087('0x14')](_0xe087('0xc'),auth[_0xe087('0xa')](),controller['destroy']);router[_0xe087('0x14')](_0xe087('0xe'),auth[_0xe087('0xa')](),controller[_0xe087('0x15')]);module[_0xe087('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index a4461bf..c8dce3a 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 _0xa25d=['DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production'];(function(_0x4cbfbb,_0x12dccf){var _0x1d0435=function(_0x61d82f){while(--_0x61d82f){_0x4cbfbb['push'](_0x4cbfbb['shift']());}};_0x1d0435(++_0x12dccf);}(_0xa25d,0x194));var _0xda25=function(_0x6b23f3,_0x4189c9){_0x6b23f3=_0x6b23f3-0x0;var _0x473e8f=_0xa25d[_0x6b23f3];return _0x473e8f;};'use strict';var Sequelize=require(_0xda25('0x0'));module[_0xda25('0x1')]={'name':{'type':Sequelize[_0xda25('0x2')],'unique':_0xda25('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xda25('0x2')]},'notes':{'type':Sequelize[_0xda25('0x4')]},'preproduction':{'type':Sequelize[_0xda25('0x5')](_0xda25('0x6')),'get':function(){if(this[_0xda25('0x7')](_0xda25('0x8'))){return this[_0xda25('0x7')](_0xda25('0x8'))[_0xda25('0x9')](_0xda25('0xa'));}}},'production':{'type':Sequelize[_0xda25('0x5')](_0xda25('0x6')),'get':function(){if(this[_0xda25('0x7')](_0xda25('0xb'))){return this[_0xda25('0x7')]('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0xda25('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xe493=['preproduction','toString','utf8','getDataValue','DATE','sequelize','exports','STRING','name','BLOB','long'];(function(_0x468027,_0x2b07b3){var _0x36821e=function(_0x188bc8){while(--_0x188bc8){_0x468027['push'](_0x468027['shift']());}};_0x36821e(++_0x2b07b3);}(_0xe493,0x7e));var _0x3e49=function(_0x3f20d3,_0x4d0a10){_0x3f20d3=_0x3f20d3-0x0;var _0x5d1fa4=_0xe493[_0x3f20d3];return _0x5d1fa4;};'use strict';var Sequelize=require(_0x3e49('0x0'));module[_0x3e49('0x1')]={'name':{'type':Sequelize[_0x3e49('0x2')],'unique':_0x3e49('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3e49('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x3e49('0x4')](_0x3e49('0x5')),'get':function(){if(this['getDataValue'](_0x3e49('0x6'))){return this['getDataValue'](_0x3e49('0x6'))[_0x3e49('0x7')](_0x3e49('0x8'));}}},'production':{'type':Sequelize[_0x3e49('0x4')](_0x3e49('0x5')),'get':function(){if(this[_0x3e49('0x9')]('production')){return this['getDataValue']('production')[_0x3e49('0x7')](_0x3e49('0x8'));}}},'savedAt':{'type':Sequelize[_0x3e49('0xa')]},'publishedAt':{'type':Sequelize[_0x3e49('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 2529f40..fbb5ebb 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 _0x509f=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','SquareProjects','UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','fieldName','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','SquareProject','includeAll','findAll','show','params','keys','include','find','catch','create','body','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','pick','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x4f50cc,_0xb95ef4){var _0xb188b1=function(_0x1addd4){while(--_0x1addd4){_0x4f50cc['push'](_0x4f50cc['shift']());}};_0xb188b1(++_0xb95ef4);}(_0x509f,0xb8));var _0xf509=function(_0x506803,_0x5dd8d2){_0x506803=_0x506803-0x0;var _0x32f805=_0x509f[_0x506803];return _0x32f805;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf509('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf509('0x1'));var rp=require('request-promise');var moment=require(_0xf509('0x2'));var BPromise=require(_0xf509('0x3'));var Mustache=require(_0xf509('0x4'));var util=require(_0xf509('0x5'));var path=require(_0xf509('0x6'));var sox=require(_0xf509('0x7'));var csv=require(_0xf509('0x8'));var ejs=require(_0xf509('0x9'));var fs=require('fs');var fs_extra=require(_0xf509('0xa'));var _=require(_0xf509('0xb'));var squel=require(_0xf509('0xc'));var crypto=require(_0xf509('0xd'));var jsforce=require(_0xf509('0xe'));var deskjs=require(_0xf509('0xf'));var toCsv=require(_0xf509('0x8'));var querystring=require(_0xf509('0x10'));var Papa=require(_0xf509('0x11'));var Redis=require('ioredis');var authService=require(_0xf509('0x12'));var qs=require(_0xf509('0x13'));var as=require(_0xf509('0x14'));var hardwareService=require(_0xf509('0x15'));var logger=require(_0xf509('0x16'))('api');var utils=require(_0xf509('0x17'));var config=require(_0xf509('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf509('0x19'))['db'];config[_0xf509('0x1a')]=_['defaults'](config['redis'],{'host':_0xf509('0x1b'),'port':0x18eb});var socket=require(_0xf509('0x1c'))(new Redis(config[_0xf509('0x1a')]));require(_0xf509('0x1d'))[_0xf509('0x1e')](socket);function respondWithStatusCode(_0x35d5bd,_0xc9ff18){_0xc9ff18=_0xc9ff18||0xcc;return function(_0x5ef5fa){if(_0x5ef5fa){return _0x35d5bd[_0xf509('0x1f')](_0xc9ff18);}return _0x35d5bd[_0xf509('0x20')](_0xc9ff18)[_0xf509('0x21')]();};}function respondWithResult(_0x476f79,_0x2d91d7){_0x2d91d7=_0x2d91d7||0xc8;return function(_0x548404){if(_0x548404){return _0x476f79[_0xf509('0x20')](_0x2d91d7)[_0xf509('0x22')](_0x548404);}};}function respondWithFilteredResult(_0x4f2d11,_0x58990f){return function(_0x498d8d){if(_0x498d8d){var _0xc53010=typeof _0x58990f[_0xf509('0x23')]===_0xf509('0x24')&&typeof _0x58990f[_0xf509('0x25')]===_0xf509('0x24');var _0x2cf849=_0x498d8d[_0xf509('0x26')];var _0xde2c8f=_0xc53010?0x0:_0x58990f[_0xf509('0x23')];var _0x15b194=_0xc53010?_0x498d8d[_0xf509('0x26')]:_0x58990f['offset']+_0x58990f[_0xf509('0x25')];var _0x5b1b4b;if(_0x15b194>=_0x2cf849){_0x15b194=_0x2cf849;_0x5b1b4b=0xc8;}else{_0x5b1b4b=0xce;}_0x4f2d11[_0xf509('0x20')](_0x5b1b4b);return _0x4f2d11[_0xf509('0x27')](_0xf509('0x28'),_0xde2c8f+'-'+_0x15b194+'/'+_0x2cf849)['json'](_0x498d8d);}return null;};}function patchUpdates(_0x29c7c8){return function(_0x2243c4){try{jsonpatch[_0xf509('0x29')](_0x2243c4,_0x29c7c8,!![]);}catch(_0x419c7f){return BPromise[_0xf509('0x2a')](_0x419c7f);}return _0x2243c4['save']();};}function saveUpdates(_0x556c12,_0x499e75){return function(_0x3cdfec){if(_0x3cdfec){return _0x3cdfec['update'](_0x556c12)['then'](function(_0x296f5f){return _0x296f5f;});}return null;};}function removeEntity(_0x5c4ceb,_0x3f0552){return function(_0x2d13d7){if(_0x2d13d7){return _0x2d13d7['destroy']()[_0xf509('0x2b')](function(){var _0x5db789=_0x2d13d7['get']({'plain':!![]});var _0xcffde6=_0xf509('0x2c');return db[_0xf509('0x2d')][_0xf509('0x2e')]({'where':{'type':_0xcffde6,'resourceId':_0x5db789['id']}})[_0xf509('0x2b')](function(){return _0x2d13d7;});})[_0xf509('0x2b')](function(){_0x5c4ceb[_0xf509('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2416f6,_0x1489fb){return function(_0x162047){if(!_0x162047){_0x2416f6[_0xf509('0x1f')](0x194);}return _0x162047;};}function handleError(_0x29b5d5,_0x4c3be1){_0x4c3be1=_0x4c3be1||0x1f4;return function(_0x3dbc61){logger[_0xf509('0x2f')](_0x3dbc61[_0xf509('0x30')]);if(_0x3dbc61['name']){delete _0x3dbc61[_0xf509('0x31')];}_0x29b5d5[_0xf509('0x20')](_0x4c3be1)[_0xf509('0x32')](_0x3dbc61);};}exports[_0xf509('0x33')]=function(_0x1cbaa7,_0x9b0f96){var _0x534b91={},_0x18d7a1={},_0x426f1c={'count':0x0,'rows':[]};var _0xb49ed4=_['map'](db['SquareProject'][_0xf509('0x34')],function(_0x5b629f){return{'name':_0x5b629f[_0xf509('0x35')],'type':_0x5b629f['type']['key']};});_0x18d7a1[_0xf509('0x36')]=_[_0xf509('0x37')](_0xb49ed4,_0xf509('0x31'));_0x18d7a1[_0xf509('0x38')]=_['keys'](_0x1cbaa7[_0xf509('0x38')]);_0x18d7a1[_0xf509('0x39')]=_[_0xf509('0x3a')](_0x18d7a1[_0xf509('0x36')],_0x18d7a1[_0xf509('0x38')]);_0x534b91['attributes']=_[_0xf509('0x3a')](_0x18d7a1['model'],qs[_0xf509('0x3b')](_0x1cbaa7[_0xf509('0x38')][_0xf509('0x3b')]));_0x534b91[_0xf509('0x3c')]=_0x534b91['attributes'][_0xf509('0x3d')]?_0x534b91[_0xf509('0x3c')]:_0x18d7a1[_0xf509('0x36')];if(!_0x1cbaa7[_0xf509('0x38')][_0xf509('0x3e')](_0xf509('0x3f'))){_0x534b91[_0xf509('0x25')]=qs[_0xf509('0x25')](_0x1cbaa7[_0xf509('0x38')]['limit']);_0x534b91['offset']=qs[_0xf509('0x23')](_0x1cbaa7['query'][_0xf509('0x23')]);}_0x534b91[_0xf509('0x40')]=qs['sort'](_0x1cbaa7['query'][_0xf509('0x41')]);_0x534b91['where']=qs[_0xf509('0x39')](_['pick'](_0x1cbaa7[_0xf509('0x38')],_0x18d7a1[_0xf509('0x39')]),_0xb49ed4);if(_0x1cbaa7[_0xf509('0x38')]['filter']){_0x534b91[_0xf509('0x42')]=_[_0xf509('0x43')](_0x534b91[_0xf509('0x42')],{'$or':_[_0xf509('0x37')](_0xb49ed4,function(_0x10e495){if(_0x10e495[_0xf509('0x44')]!=='VIRTUAL'){var _0x982274={};_0x982274[_0x10e495['name']]={'$like':'%'+_0x1cbaa7[_0xf509('0x38')][_0xf509('0x45')]+'%'};return _0x982274;}})});}_0x534b91=_[_0xf509('0x43')]({},_0x534b91,_0x1cbaa7[_0xf509('0x46')]);var _0x28a846={'where':_0x534b91[_0xf509('0x42')]};return db[_0xf509('0x47')][_0xf509('0x26')](_0x28a846)[_0xf509('0x2b')](function(_0x58be36){_0x426f1c[_0xf509('0x26')]=_0x58be36;if(_0x1cbaa7[_0xf509('0x38')][_0xf509('0x48')]){_0x534b91['include']=[{'all':!![]}];}return db[_0xf509('0x47')][_0xf509('0x49')](_0x534b91);})[_0xf509('0x2b')](function(_0x2b00c4){_0x426f1c['rows']=_0x2b00c4;return _0x426f1c;})[_0xf509('0x2b')](respondWithFilteredResult(_0x9b0f96,_0x534b91))['catch'](handleError(_0x9b0f96,null));};exports[_0xf509('0x4a')]=function(_0x536268,_0xb9320e){var _0x277c4b={'raw':![],'where':{'id':_0x536268[_0xf509('0x4b')]['id']}},_0x45de8b={};_0x45de8b['model']=_[_0xf509('0x4c')](db[_0xf509('0x47')][_0xf509('0x34')]);_0x45de8b[_0xf509('0x38')]=_[_0xf509('0x4c')](_0x536268[_0xf509('0x38')]);_0x45de8b['filters']=_[_0xf509('0x3a')](_0x45de8b[_0xf509('0x36')],_0x45de8b[_0xf509('0x38')]);_0x277c4b['attributes']=_['intersection'](_0x45de8b[_0xf509('0x36')],qs[_0xf509('0x3b')](_0x536268[_0xf509('0x38')]['fields']));_0x277c4b[_0xf509('0x3c')]=_0x277c4b[_0xf509('0x3c')][_0xf509('0x3d')]?_0x277c4b['attributes']:_0x45de8b['model'];if(_0x536268[_0xf509('0x38')][_0xf509('0x48')]){_0x277c4b[_0xf509('0x4d')]=[{'all':!![]}];}_0x277c4b=_[_0xf509('0x43')]({},_0x277c4b,_0x536268[_0xf509('0x46')]);return db[_0xf509('0x47')][_0xf509('0x4e')](_0x277c4b)[_0xf509('0x2b')](handleEntityNotFound(_0xb9320e,null))['then'](respondWithResult(_0xb9320e,null))[_0xf509('0x4f')](handleError(_0xb9320e,null));};exports[_0xf509('0x50')]=function(_0x2e2761,_0x32feb3){return db[_0xf509('0x47')][_0xf509('0x50')](_0x2e2761[_0xf509('0x51')],{})[_0xf509('0x2b')](function(_0x3a0cc5){var _0x2d9128=_0x2e2761[_0xf509('0x52')][_0xf509('0x53')]({'plain':!![]});if(!_0x2d9128)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d9128[_0xf509('0x54')]===_0xf509('0x52')){var _0x2751e2=_0x3a0cc5[_0xf509('0x53')]({'plain':!![]});var _0x1fa9a8=_0xf509('0x2c');return db[_0xf509('0x55')]['find']({'where':{'name':_0x1fa9a8,'userProfileId':_0x2d9128[_0xf509('0x56')]},'raw':!![]})[_0xf509('0x2b')](function(_0x538f0b){if(_0x538f0b&&_0x538f0b['autoAssociation']===0x0){return db[_0xf509('0x2d')][_0xf509('0x50')]({'name':_0x2751e2[_0xf509('0x31')],'resourceId':_0x2751e2['id'],'type':_0x538f0b[_0xf509('0x31')],'sectionId':_0x538f0b['id']},{})[_0xf509('0x2b')](function(){return _0x3a0cc5;});}else{return _0x3a0cc5;}})[_0xf509('0x4f')](function(_0x1f40a0){logger[_0xf509('0x2f')](_0xf509('0x57'),_0x1f40a0);throw _0x1f40a0;});}return _0x3a0cc5;})[_0xf509('0x2b')](respondWithResult(_0x32feb3,0xc9))['catch'](handleError(_0x32feb3,null));};exports[_0xf509('0x58')]=function(_0x166cb4,_0x24e435){if(_0x166cb4['body']['id']){delete _0x166cb4[_0xf509('0x51')]['id'];}return db[_0xf509('0x47')][_0xf509('0x4e')]({'where':{'id':_0x166cb4[_0xf509('0x4b')]['id']}})[_0xf509('0x2b')](handleEntityNotFound(_0x24e435,null))['then'](saveUpdates(_0x166cb4[_0xf509('0x51')],null))[_0xf509('0x2b')](respondWithResult(_0x24e435,null))[_0xf509('0x4f')](handleError(_0x24e435,null));};exports[_0xf509('0x2e')]=function(_0x4c9e3e,_0x4dfb38){return db['SquareProject'][_0xf509('0x4e')]({'where':{'id':_0x4c9e3e['params']['id']}})[_0xf509('0x2b')](handleEntityNotFound(_0x4dfb38,null))[_0xf509('0x2b')](removeEntity(_0x4dfb38,null))[_0xf509('0x4f')](handleError(_0x4dfb38,null));};exports[_0xf509('0x59')]=function(_0x1675d7,_0x1a31f0,_0x1ec08c){return db[_0xf509('0x47')][_0xf509('0x4e')]({'where':{'id':_0x1675d7['params']['id']}})[_0xf509('0x2b')](handleEntityNotFound(_0x1a31f0,null))[_0xf509('0x2b')](function(_0xe5090b){if(_0xe5090b){return _0xe5090b[_0xf509('0x59')](_0x1675d7[_0xf509('0x51')]['ids'],_['omit'](_0x1675d7[_0xf509('0x51')],[_0xf509('0x5a'),'id'])||{});}})[_0xf509('0x2b')](respondWithResult(_0x1a31f0,null))[_0xf509('0x4f')](handleError(_0x1a31f0,null));};exports[_0xf509('0x5b')]=function(_0x20842f,_0x13ebe5,_0x4e100c){return db[_0xf509('0x47')]['find']({'where':{'id':_0x20842f[_0xf509('0x4b')]['id']}})['then'](handleEntityNotFound(_0x13ebe5,null))[_0xf509('0x2b')](function(_0x457a43){if(_0x457a43){return _0x457a43[_0xf509('0x5b')](_0x20842f[_0xf509('0x38')][_0xf509('0x5a')])['then'](function(){if(_[_0xf509('0x5c')](_0x20842f['query'][_0xf509('0x5a')])){for(var _0x24b59e=0x0;_0x24b59e<_0x20842f[_0xf509('0x38')][_0xf509('0x5a')][_0xf509('0x3d')];_0x24b59e+=0x1){socket[_0xf509('0x5d')](_0xf509('0x5e'),{'UserId':Number(_0x20842f[_0xf509('0x38')][_0xf509('0x5a')][_0x24b59e]),'SquareProjectId':Number(_0x20842f[_0xf509('0x4b')]['id'])});}}else{socket[_0xf509('0x5d')]('userSquareProject:remove',{'UserId':Number(_0x20842f['query'][_0xf509('0x5a')]),'SquareProjectId':Number(_0x20842f[_0xf509('0x4b')]['id'])});}});}})[_0xf509('0x2b')](respondWithStatusCode(_0x13ebe5,null))['catch'](handleError(_0x13ebe5,null));};exports[_0xf509('0x5f')]=function(_0x174c10,_0x3062e2,_0x428c32){var _0x61bbde={};var _0x2e7ed3={};var _0x40338c;var _0x329f9e;return db[_0xf509('0x47')]['findOne']({'where':{'id':_0x174c10[_0xf509('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3062e2,null))[_0xf509('0x2b')](function(_0xe80f2d){if(_0xe80f2d){_0x40338c=_0xe80f2d;_0x2e7ed3['model']=_[_0xf509('0x4c')](db[_0xf509('0x60')]['rawAttributes']);_0x2e7ed3[_0xf509('0x38')]=_[_0xf509('0x4c')](_0x174c10[_0xf509('0x38')]);_0x2e7ed3['filters']=_['intersection'](_0x2e7ed3[_0xf509('0x36')],_0x2e7ed3[_0xf509('0x38')]);_0x61bbde['attributes']=_['intersection'](_0x2e7ed3[_0xf509('0x36')],qs[_0xf509('0x3b')](_0x174c10[_0xf509('0x38')]['fields']));_0x61bbde[_0xf509('0x3c')]=_0x61bbde[_0xf509('0x3c')][_0xf509('0x3d')]?_0x61bbde[_0xf509('0x3c')]:_0x2e7ed3[_0xf509('0x36')];_0x61bbde[_0xf509('0x40')]=qs['sort'](_0x174c10['query']['sort']);_0x61bbde[_0xf509('0x42')]=qs[_0xf509('0x39')](_[_0xf509('0x61')](_0x174c10[_0xf509('0x38')],_0x2e7ed3[_0xf509('0x39')]));if(_0x174c10['query'][_0xf509('0x45')]){_0x61bbde['where']=_['merge'](_0x61bbde['where'],{'$or':_[_0xf509('0x37')](_0x61bbde['attributes'],function(_0x4c35b3){var _0x1bf52a={};_0x1bf52a[_0x4c35b3]={'$like':'%'+_0x174c10[_0xf509('0x38')][_0xf509('0x45')]+'%'};return _0x1bf52a;})});}_0x61bbde=_[_0xf509('0x43')]({},_0x61bbde,_0x174c10['options']);return _0x40338c[_0xf509('0x5f')](_0x61bbde);}})[_0xf509('0x2b')](function(_0x4ae6d9){if(_0x4ae6d9){_0x329f9e=_0x4ae6d9[_0xf509('0x3d')];if(!_0x174c10['query'][_0xf509('0x3e')](_0xf509('0x3f'))){_0x61bbde['limit']=qs['limit'](_0x174c10[_0xf509('0x38')]['limit']);_0x61bbde[_0xf509('0x23')]=qs[_0xf509('0x23')](_0x174c10['query']['offset']);}return _0x40338c['getUsers'](_0x61bbde);}})[_0xf509('0x2b')](function(_0x12b567){if(_0x12b567){return _0x12b567?{'count':_0x329f9e,'rows':_0x12b567}:null;}})[_0xf509('0x2b')](respondWithResult(_0x3062e2,null))[_0xf509('0x4f')](handleError(_0x3062e2,null));}; \ No newline at end of file +var _0x50a6=['register','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','SquareProject','rawAttributes','model','map','query','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','fields','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','removeUsers','isArray','length','userSquareProject:remove','getUsers','findOne','User','pick','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./squareProject.socket'];(function(_0x1aa748,_0x22617e){var _0x4f885a=function(_0x12f73d){while(--_0x12f73d){_0x1aa748['push'](_0x1aa748['shift']());}};_0x4f885a(++_0x22617e);}(_0x50a6,0xa4));var _0x650a=function(_0x13a913,_0x400d93){_0x13a913=_0x13a913-0x0;var _0xbf71de=_0x50a6[_0x13a913];return _0xbf71de;};'use strict';var emlformat=require(_0x650a('0x0'));var rimraf=require(_0x650a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x650a('0x2'));var moment=require('moment');var BPromise=require(_0x650a('0x3'));var Mustache=require(_0x650a('0x4'));var util=require(_0x650a('0x5'));var path=require('path');var sox=require(_0x650a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x650a('0x7'));var _=require(_0x650a('0x8'));var squel=require(_0x650a('0x9'));var crypto=require(_0x650a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x650a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x650a('0xc'));var Papa=require(_0x650a('0xd'));var Redis=require('ioredis');var authService=require(_0x650a('0xe'));var qs=require(_0x650a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x650a('0x10'));var logger=require('../../config/logger')(_0x650a('0x11'));var utils=require('../../config/utils');var config=require(_0x650a('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x650a('0x13'))['db'];config['redis']=_[_0x650a('0x14')](config[_0x650a('0x15')],{'host':_0x650a('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x650a('0x15')]));require(_0x650a('0x17'))[_0x650a('0x18')](socket);function respondWithStatusCode(_0x15f2fd,_0x35c6dc){_0x35c6dc=_0x35c6dc||0xcc;return function(_0x24f11f){if(_0x24f11f){return _0x15f2fd['sendStatus'](_0x35c6dc);}return _0x15f2fd[_0x650a('0x19')](_0x35c6dc)['end']();};}function respondWithResult(_0x1f94ab,_0x3c2206){_0x3c2206=_0x3c2206||0xc8;return function(_0x348fda){if(_0x348fda){return _0x1f94ab['status'](_0x3c2206)['json'](_0x348fda);}};}function respondWithFilteredResult(_0x5285e0,_0x52e5bb){return function(_0x2ad2d7){if(_0x2ad2d7){var _0x359314=typeof _0x52e5bb[_0x650a('0x1a')]===_0x650a('0x1b')&&typeof _0x52e5bb[_0x650a('0x1c')]==='undefined';var _0x4eba86=_0x2ad2d7[_0x650a('0x1d')];var _0x1c65f6=_0x359314?0x0:_0x52e5bb['offset'];var _0x2e2761=_0x359314?_0x2ad2d7[_0x650a('0x1d')]:_0x52e5bb['offset']+_0x52e5bb[_0x650a('0x1c')];var _0x1ceedd;if(_0x2e2761>=_0x4eba86){_0x2e2761=_0x4eba86;_0x1ceedd=0xc8;}else{_0x1ceedd=0xce;}_0x5285e0[_0x650a('0x19')](_0x1ceedd);return _0x5285e0[_0x650a('0x1e')](_0x650a('0x1f'),_0x1c65f6+'-'+_0x2e2761+'/'+_0x4eba86)['json'](_0x2ad2d7);}return null;};}function patchUpdates(_0x88531d){return function(_0x5d547f){try{jsonpatch[_0x650a('0x20')](_0x5d547f,_0x88531d,!![]);}catch(_0x1d471d){return BPromise[_0x650a('0x21')](_0x1d471d);}return _0x5d547f[_0x650a('0x22')]();};}function saveUpdates(_0x2ed256,_0x326d60){return function(_0x40117a){if(_0x40117a){return _0x40117a[_0x650a('0x23')](_0x2ed256)[_0x650a('0x24')](function(_0x2761a8){return _0x2761a8;});}return null;};}function removeEntity(_0xa902e6,_0x234fce){return function(_0xd89a9e){if(_0xd89a9e){return _0xd89a9e[_0x650a('0x25')]()[_0x650a('0x24')](function(){var _0x39a155=_0xd89a9e[_0x650a('0x26')]({'plain':!![]});var _0x12fdb4='SquareProjects';return db[_0x650a('0x27')][_0x650a('0x25')]({'where':{'type':_0x12fdb4,'resourceId':_0x39a155['id']}})[_0x650a('0x24')](function(){return _0xd89a9e;});})['then'](function(){_0xa902e6[_0x650a('0x19')](0xcc)[_0x650a('0x28')]();});}};}function handleEntityNotFound(_0x454ff8,_0x783509){return function(_0x3c5bd4){if(!_0x3c5bd4){_0x454ff8[_0x650a('0x29')](0x194);}return _0x3c5bd4;};}function handleError(_0x4d0848,_0x190a65){_0x190a65=_0x190a65||0x1f4;return function(_0x1c8621){logger[_0x650a('0x2a')](_0x1c8621[_0x650a('0x2b')]);if(_0x1c8621[_0x650a('0x2c')]){delete _0x1c8621[_0x650a('0x2c')];}_0x4d0848[_0x650a('0x19')](_0x190a65)[_0x650a('0x2d')](_0x1c8621);};}exports['index']=function(_0x614b0e,_0x3c2eda){var _0x2e0370={},_0x5123c9={},_0x12d846={'count':0x0,'rows':[]};var _0x1c0770=_['map'](db[_0x650a('0x2e')][_0x650a('0x2f')],function(_0x41cdc6){return{'name':_0x41cdc6['fieldName'],'type':_0x41cdc6['type']['key']};});_0x5123c9[_0x650a('0x30')]=_[_0x650a('0x31')](_0x1c0770,_0x650a('0x2c'));_0x5123c9[_0x650a('0x32')]=_['keys'](_0x614b0e[_0x650a('0x32')]);_0x5123c9[_0x650a('0x33')]=_['intersection'](_0x5123c9[_0x650a('0x30')],_0x5123c9[_0x650a('0x32')]);_0x2e0370[_0x650a('0x34')]=_[_0x650a('0x35')](_0x5123c9[_0x650a('0x30')],qs['fields'](_0x614b0e[_0x650a('0x32')]['fields']));_0x2e0370[_0x650a('0x34')]=_0x2e0370[_0x650a('0x34')]['length']?_0x2e0370[_0x650a('0x34')]:_0x5123c9[_0x650a('0x30')];if(!_0x614b0e['query'][_0x650a('0x36')](_0x650a('0x37'))){_0x2e0370[_0x650a('0x1c')]=qs['limit'](_0x614b0e[_0x650a('0x32')][_0x650a('0x1c')]);_0x2e0370[_0x650a('0x1a')]=qs[_0x650a('0x1a')](_0x614b0e['query'][_0x650a('0x1a')]);}_0x2e0370[_0x650a('0x38')]=qs[_0x650a('0x39')](_0x614b0e['query']['sort']);_0x2e0370[_0x650a('0x3a')]=qs[_0x650a('0x33')](_['pick'](_0x614b0e[_0x650a('0x32')],_0x5123c9['filters']),_0x1c0770);if(_0x614b0e[_0x650a('0x32')][_0x650a('0x3b')]){_0x2e0370[_0x650a('0x3a')]=_[_0x650a('0x3c')](_0x2e0370[_0x650a('0x3a')],{'$or':_['map'](_0x1c0770,function(_0x20ba76){if(_0x20ba76['type']!==_0x650a('0x3d')){var _0x1d65b4={};_0x1d65b4[_0x20ba76[_0x650a('0x2c')]]={'$like':'%'+_0x614b0e[_0x650a('0x32')][_0x650a('0x3b')]+'%'};return _0x1d65b4;}})});}_0x2e0370=_[_0x650a('0x3c')]({},_0x2e0370,_0x614b0e[_0x650a('0x3e')]);var _0x4c75fe={'where':_0x2e0370['where']};return db[_0x650a('0x2e')]['count'](_0x4c75fe)['then'](function(_0x1e0868){_0x12d846['count']=_0x1e0868;if(_0x614b0e[_0x650a('0x32')]['includeAll']){_0x2e0370[_0x650a('0x3f')]=[{'all':!![]}];}return db[_0x650a('0x2e')][_0x650a('0x40')](_0x2e0370);})[_0x650a('0x24')](function(_0x409495){_0x12d846[_0x650a('0x41')]=_0x409495;return _0x12d846;})[_0x650a('0x24')](respondWithFilteredResult(_0x3c2eda,_0x2e0370))[_0x650a('0x42')](handleError(_0x3c2eda,null));};exports[_0x650a('0x43')]=function(_0x25c0a2,_0x205dfe){var _0x381632={'raw':![],'where':{'id':_0x25c0a2[_0x650a('0x44')]['id']}},_0x4ac78e={};_0x4ac78e[_0x650a('0x30')]=_[_0x650a('0x45')](db[_0x650a('0x2e')][_0x650a('0x2f')]);_0x4ac78e[_0x650a('0x32')]=_['keys'](_0x25c0a2[_0x650a('0x32')]);_0x4ac78e[_0x650a('0x33')]=_[_0x650a('0x35')](_0x4ac78e[_0x650a('0x30')],_0x4ac78e[_0x650a('0x32')]);_0x381632[_0x650a('0x34')]=_['intersection'](_0x4ac78e['model'],qs[_0x650a('0x46')](_0x25c0a2[_0x650a('0x32')][_0x650a('0x46')]));_0x381632['attributes']=_0x381632[_0x650a('0x34')]['length']?_0x381632[_0x650a('0x34')]:_0x4ac78e[_0x650a('0x30')];if(_0x25c0a2['query'][_0x650a('0x47')]){_0x381632[_0x650a('0x3f')]=[{'all':!![]}];}_0x381632=_[_0x650a('0x3c')]({},_0x381632,_0x25c0a2['options']);return db[_0x650a('0x2e')][_0x650a('0x48')](_0x381632)[_0x650a('0x24')](handleEntityNotFound(_0x205dfe,null))['then'](respondWithResult(_0x205dfe,null))[_0x650a('0x42')](handleError(_0x205dfe,null));};exports[_0x650a('0x49')]=function(_0x34fa7a,_0x11bb6b){return db[_0x650a('0x2e')]['create'](_0x34fa7a['body'],{})[_0x650a('0x24')](function(_0x34fdcf){var _0x5b2907=_0x34fa7a[_0x650a('0x4a')][_0x650a('0x26')]({'plain':!![]});if(!_0x5b2907)throw new Error(_0x650a('0x4b'));if(_0x5b2907[_0x650a('0x4c')]===_0x650a('0x4a')){var _0x8bef2c=_0x34fdcf['get']({'plain':!![]});var _0x1e1996=_0x650a('0x4d');return db[_0x650a('0x4e')][_0x650a('0x48')]({'where':{'name':_0x1e1996,'userProfileId':_0x5b2907[_0x650a('0x4f')]},'raw':!![]})['then'](function(_0x45346f){if(_0x45346f&&_0x45346f[_0x650a('0x50')]===0x0){return db[_0x650a('0x27')][_0x650a('0x49')]({'name':_0x8bef2c['name'],'resourceId':_0x8bef2c['id'],'type':_0x45346f['name'],'sectionId':_0x45346f['id']},{})[_0x650a('0x24')](function(){return _0x34fdcf;});}else{return _0x34fdcf;}})[_0x650a('0x42')](function(_0x5c2be4){logger[_0x650a('0x2a')](_0x650a('0x51'),_0x5c2be4);throw _0x5c2be4;});}return _0x34fdcf;})[_0x650a('0x24')](respondWithResult(_0x11bb6b,0xc9))[_0x650a('0x42')](handleError(_0x11bb6b,null));};exports[_0x650a('0x23')]=function(_0x459f29,_0x36c517){if(_0x459f29[_0x650a('0x52')]['id']){delete _0x459f29[_0x650a('0x52')]['id'];}return db[_0x650a('0x2e')][_0x650a('0x48')]({'where':{'id':_0x459f29[_0x650a('0x44')]['id']}})[_0x650a('0x24')](handleEntityNotFound(_0x36c517,null))[_0x650a('0x24')](saveUpdates(_0x459f29[_0x650a('0x52')],null))['then'](respondWithResult(_0x36c517,null))['catch'](handleError(_0x36c517,null));};exports[_0x650a('0x25')]=function(_0x2abb94,_0x4ff3da){return db['SquareProject'][_0x650a('0x48')]({'where':{'id':_0x2abb94['params']['id']}})[_0x650a('0x24')](handleEntityNotFound(_0x4ff3da,null))['then'](removeEntity(_0x4ff3da,null))['catch'](handleError(_0x4ff3da,null));};exports[_0x650a('0x53')]=function(_0x508e45,_0x449dbf,_0x308419){return db['SquareProject'][_0x650a('0x48')]({'where':{'id':_0x508e45[_0x650a('0x44')]['id']}})[_0x650a('0x24')](handleEntityNotFound(_0x449dbf,null))[_0x650a('0x24')](function(_0x22d6eb){if(_0x22d6eb){return _0x22d6eb[_0x650a('0x53')](_0x508e45['body'][_0x650a('0x54')],_[_0x650a('0x55')](_0x508e45[_0x650a('0x52')],['ids','id'])||{});}})[_0x650a('0x24')](respondWithResult(_0x449dbf,null))[_0x650a('0x42')](handleError(_0x449dbf,null));};exports[_0x650a('0x56')]=function(_0x5920a6,_0x581ead,_0x1cf56e){return db[_0x650a('0x2e')]['find']({'where':{'id':_0x5920a6[_0x650a('0x44')]['id']}})[_0x650a('0x24')](handleEntityNotFound(_0x581ead,null))[_0x650a('0x24')](function(_0x3624ee){if(_0x3624ee){return _0x3624ee[_0x650a('0x56')](_0x5920a6[_0x650a('0x32')]['ids'])[_0x650a('0x24')](function(){if(_[_0x650a('0x57')](_0x5920a6[_0x650a('0x32')]['ids'])){for(var _0x436531=0x0;_0x436531<_0x5920a6[_0x650a('0x32')]['ids'][_0x650a('0x58')];_0x436531+=0x1){socket['emit'](_0x650a('0x59'),{'UserId':Number(_0x5920a6['query'][_0x650a('0x54')][_0x436531]),'SquareProjectId':Number(_0x5920a6[_0x650a('0x44')]['id'])});}}else{socket['emit'](_0x650a('0x59'),{'UserId':Number(_0x5920a6[_0x650a('0x32')][_0x650a('0x54')]),'SquareProjectId':Number(_0x5920a6[_0x650a('0x44')]['id'])});}});}})[_0x650a('0x24')](respondWithStatusCode(_0x581ead,null))[_0x650a('0x42')](handleError(_0x581ead,null));};exports[_0x650a('0x5a')]=function(_0x338841,_0x5a08d9,_0x180854){var _0x1eb780={};var _0x34cfb0={};var _0xba1b88;var _0x4bbccd;return db['SquareProject'][_0x650a('0x5b')]({'where':{'id':_0x338841['params']['id']}})[_0x650a('0x24')](handleEntityNotFound(_0x5a08d9,null))[_0x650a('0x24')](function(_0x42689c){if(_0x42689c){_0xba1b88=_0x42689c;_0x34cfb0[_0x650a('0x30')]=_[_0x650a('0x45')](db[_0x650a('0x5c')]['rawAttributes']);_0x34cfb0[_0x650a('0x32')]=_['keys'](_0x338841[_0x650a('0x32')]);_0x34cfb0[_0x650a('0x33')]=_[_0x650a('0x35')](_0x34cfb0[_0x650a('0x30')],_0x34cfb0[_0x650a('0x32')]);_0x1eb780['attributes']=_[_0x650a('0x35')](_0x34cfb0[_0x650a('0x30')],qs[_0x650a('0x46')](_0x338841[_0x650a('0x32')][_0x650a('0x46')]));_0x1eb780[_0x650a('0x34')]=_0x1eb780[_0x650a('0x34')][_0x650a('0x58')]?_0x1eb780[_0x650a('0x34')]:_0x34cfb0[_0x650a('0x30')];_0x1eb780['order']=qs['sort'](_0x338841['query'][_0x650a('0x39')]);_0x1eb780[_0x650a('0x3a')]=qs['filters'](_[_0x650a('0x5d')](_0x338841[_0x650a('0x32')],_0x34cfb0[_0x650a('0x33')]));if(_0x338841['query'][_0x650a('0x3b')]){_0x1eb780['where']=_[_0x650a('0x3c')](_0x1eb780[_0x650a('0x3a')],{'$or':_[_0x650a('0x31')](_0x1eb780[_0x650a('0x34')],function(_0x434456){var _0x5245f5={};_0x5245f5[_0x434456]={'$like':'%'+_0x338841['query'][_0x650a('0x3b')]+'%'};return _0x5245f5;})});}_0x1eb780=_[_0x650a('0x3c')]({},_0x1eb780,_0x338841[_0x650a('0x3e')]);return _0xba1b88['getUsers'](_0x1eb780);}})[_0x650a('0x24')](function(_0x5dc433){if(_0x5dc433){_0x4bbccd=_0x5dc433['length'];if(!_0x338841[_0x650a('0x32')][_0x650a('0x36')](_0x650a('0x37'))){_0x1eb780[_0x650a('0x1c')]=qs[_0x650a('0x1c')](_0x338841['query'][_0x650a('0x1c')]);_0x1eb780[_0x650a('0x1a')]=qs[_0x650a('0x1a')](_0x338841['query']['offset']);}return _0xba1b88[_0x650a('0x5a')](_0x1eb780);}})['then'](function(_0x50f277){if(_0x50f277){return _0x50f277?{'count':_0x4bbccd,'rows':_0x50f277}:null;}})['then'](respondWithResult(_0x5a08d9,null))[_0x650a('0x42')](handleError(_0x5a08d9,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 1e0b503..743877f 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 _0xd4cc=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','SquareProject','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4cc,0x114));var _0xcd4c=function(_0x141772,_0x896a5e){_0x141772=_0x141772-0x0;var _0x398925=_0xd4cc[_0x141772];return _0x398925;};'use strict';var EventEmitter=require(_0xcd4c('0x0'));var SquareProject=require(_0xcd4c('0x1'))['db'][_0xcd4c('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcd4c('0x3'),'afterUpdate':'update','afterDestroy':_0xcd4c('0x4')};function emitEvent(_0x8bb6d8){return function(_0x115f6c,_0x2c95e5,_0x1aa948){SquareProjectEvents[_0xcd4c('0x5')](_0x8bb6d8+':'+_0x115f6c['id'],_0x115f6c);SquareProjectEvents[_0xcd4c('0x5')](_0x8bb6d8,_0x115f6c);_0x1aa948(null);};}for(var e in events){if(events[_0xcd4c('0x6')](e)){var event=events[e];SquareProject[_0xcd4c('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x9d92=['setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x322522,_0x4db288){var _0x293bcf=function(_0xf108b8){while(--_0xf108b8){_0x322522['push'](_0x322522['shift']());}};_0x293bcf(++_0x4db288);}(_0x9d92,0xdf));var _0x29d9=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0x9d92[_0x57014b];return _0x2b258a;};'use strict';var EventEmitter=require(_0x29d9('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x29d9('0x1')](0x0);var events={'afterCreate':_0x29d9('0x2'),'afterUpdate':'update','afterDestroy':_0x29d9('0x3')};function emitEvent(_0x1664bf){return function(_0x18371b,_0x6e12eb,_0x19f284){SquareProjectEvents[_0x29d9('0x4')](_0x1664bf+':'+_0x18371b['id'],_0x18371b);SquareProjectEvents[_0x29d9('0x4')](_0x1664bf,_0x18371b);_0x19f284(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x29d9('0x5')](e,emitEvent(event));}}module[_0x29d9('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 4f1d46e..440bf62 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 _0xf0cc=['production','publishedAt','lodash','api','request-promise','path','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','changed'];(function(_0x387784,_0x29fcee){var _0x5010cc=function(_0x2956e4){while(--_0x2956e4){_0x387784['push'](_0x387784['shift']());}};_0x5010cc(++_0x29fcee);}(_0xf0cc,0xa7));var _0xcf0c=function(_0x38d2ba,_0xa38905){_0x38d2ba=_0x38d2ba-0x0;var _0x1189c3=_0xf0cc[_0x38d2ba];return _0x1189c3;};'use strict';var _=require(_0xcf0c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcf0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcf0c('0x2'));var fs=require('fs');var path=require(_0xcf0c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf0c('0x4'));module[_0xcf0c('0x5')]=function(_0x1a6003,_0x497363){return _0x1a6003[_0xcf0c('0x6')](_0xcf0c('0x7'),attributes,{'tableName':_0xcf0c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d4cdb,_0x54cef0,_0x3cf3cb){if(_0x5d4cdb['changed'](_0xcf0c('0x9'))){_0x5d4cdb['savedAt']=moment()[_0xcf0c('0xa')](_0xcf0c('0xb'));}if(_0x5d4cdb[_0xcf0c('0xc')](_0xcf0c('0xd'))){_0x5d4cdb[_0xcf0c('0xe')]=moment()[_0xcf0c('0xa')](_0xcf0c('0xb'));}_0x3cf3cb(null,_0x5d4cdb);}}});}; \ No newline at end of file +var _0x37a4=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./squareProject.attributes','exports','define','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x37a4,0xcb));var _0x437a=function(_0x164101,_0x2b31af){_0x164101=_0x164101-0x0;var _0x35a9b4=_0x37a4[_0x164101];return _0x35a9b4;};'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':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x36270b,_0x15ac16,_0x2fe1a5){if(_0x36270b[_0x437a('0xa')](_0x437a('0xb'))){_0x36270b[_0x437a('0xc')]=moment()[_0x437a('0xd')](_0x437a('0xe'));}if(_0x36270b[_0x437a('0xa')](_0x437a('0xf'))){_0x36270b[_0x437a('0x10')]=moment()['format'](_0x437a('0xe'));}_0x2fe1a5(null,_0x36270b);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index eab0cd0..45749f5 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 _0xc77b=['http','redis','localhost','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowSquareProject','SquareProject','find','options','where','include','map','attributes','model','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xc216fb,_0x9b517a){var _0x1442cc=function(_0x301f1f){while(--_0x301f1f){_0xc216fb['push'](_0xc216fb['shift']());}};_0x1442cc(++_0x9b517a);}(_0xc77b,0x89));var _0xbc77=function(_0x588a49,_0x55c74e){_0x588a49=_0x588a49-0x0;var _0x48cd50=_0xc77b[_0x588a49];return _0x48cd50;};'use strict';var _=require(_0xbc77('0x0'));var util=require(_0xbc77('0x1'));var moment=require(_0xbc77('0x2'));var BPromise=require(_0xbc77('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc77('0x4'));var db=require(_0xbc77('0x5'))['db'];var utils=require(_0xbc77('0x6'));var logger=require(_0xbc77('0x7'))(_0xbc77('0x8'));var config=require(_0xbc77('0x9'));var jayson=require(_0xbc77('0xa'));var client=jayson['client'][_0xbc77('0xb')]({'port':0x232a});config[_0xbc77('0xc')]=_['defaults'](config[_0xbc77('0xc')],{'host':_0xbc77('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbc77('0xc')]));require(_0xbc77('0xe'))[_0xbc77('0xf')](socket);function respondWithRpcPromise(_0x5b19f3,_0x30066b,_0x271614){return new BPromise(function(_0x4ddd68,_0x7a3a02){return client[_0xbc77('0x10')](_0x5b19f3,_0x271614)[_0xbc77('0x11')](function(_0xe88a30){logger[_0xbc77('0x12')](_0xbc77('0x13'),_0x30066b,_0xbc77('0x14'));logger['debug'](_0xbc77('0x15'),_0x30066b,_0xbc77('0x14'),JSON[_0xbc77('0x16')](_0xe88a30));if(_0xe88a30[_0xbc77('0x17')]){if(_0xe88a30['error']['code']===0x1f4){logger['error'](_0xbc77('0x13'),_0x30066b,_0xe88a30[_0xbc77('0x17')]['message']);return _0x7a3a02(_0xe88a30[_0xbc77('0x17')]['message']);}logger['error'](_0xbc77('0x13'),_0x30066b,_0xe88a30[_0xbc77('0x17')][_0xbc77('0x18')]);return _0x4ddd68(_0xe88a30[_0xbc77('0x17')][_0xbc77('0x18')]);}else{logger['info'](_0xbc77('0x13'),_0x30066b,_0xbc77('0x14'));_0x4ddd68(_0xe88a30[_0xbc77('0x19')]['message']);}})['catch'](function(_0x1755c5){logger[_0xbc77('0x17')](_0xbc77('0x13'),_0x30066b,_0x1755c5);_0x7a3a02(_0x1755c5);});});}exports[_0xbc77('0x1a')]=function(_0x10ff0d){var _0x4ba85c=this;return new Promise(function(_0x349084,_0x4af58f){return db[_0xbc77('0x1b')][_0xbc77('0x1c')]({'raw':_0x10ff0d[_0xbc77('0x1d')]?_0x10ff0d[_0xbc77('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x10ff0d[_0xbc77('0x1d')]?_0x10ff0d['options'][_0xbc77('0x1e')]||null:null,'attributes':_0x10ff0d[_0xbc77('0x1d')]?_0x10ff0d[_0xbc77('0x1d')]['attributes']||null:null,'include':_0x10ff0d['options']?_0x10ff0d[_0xbc77('0x1d')][_0xbc77('0x1f')]?_[_0xbc77('0x20')](_0x10ff0d[_0xbc77('0x1d')][_0xbc77('0x1f')],function(_0x2ba3d8){return{'model':db[_0x2ba3d8['model']],'as':_0x2ba3d8['as'],'attributes':_0x2ba3d8[_0xbc77('0x21')],'include':_0x2ba3d8[_0xbc77('0x1f')]?_['map'](_0x2ba3d8[_0xbc77('0x1f')],function(_0x545255){return{'model':db[_0x545255[_0xbc77('0x22')]],'as':_0x545255['as'],'attributes':_0x545255[_0xbc77('0x21')],'include':_0x545255[_0xbc77('0x1f')]?_[_0xbc77('0x20')](_0x545255[_0xbc77('0x1f')],function(_0x118287){return{'model':db[_0x118287[_0xbc77('0x22')]],'as':_0x118287['as'],'attributes':_0x118287[_0xbc77('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x580b26){logger['info']('ShowSquareProject',_0x10ff0d);logger[_0xbc77('0x23')]('ShowSquareProject',_0x10ff0d,JSON[_0xbc77('0x16')](_0x580b26));_0x349084(_0x580b26);})[_0xbc77('0x24')](function(_0x16202e){logger[_0xbc77('0x17')]('ShowSquareProject',_0x16202e[_0xbc77('0x18')],_0x10ff0d);_0x4af58f(_0x4ba85c['error'](0x1f4,_0x16202e[_0xbc77('0x18')]));});});}; \ No newline at end of file +var _0x4055=['ShowSquareProject','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./squareProject.socket','then','info','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','SquareProject,\x20%s,\x20%s','message','result','catch','SquareProject','find','options','raw','where','attributes','include','model','map'];(function(_0x187c30,_0x2bc154){var _0x3b0cf3=function(_0x77cd03){while(--_0x77cd03){_0x187c30['push'](_0x187c30['shift']());}};_0x3b0cf3(++_0x2bc154);}(_0x4055,0x8e));var _0x5405=function(_0x5cc3d4,_0xbcbf9b){_0x5cc3d4=_0x5cc3d4-0x0;var _0x17ca31=_0x4055[_0x5cc3d4];return _0x17ca31;};'use strict';var _=require(_0x5405('0x0'));var util=require('util');var moment=require(_0x5405('0x1'));var BPromise=require(_0x5405('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5405('0x3'));var db=require(_0x5405('0x4'))['db'];var utils=require(_0x5405('0x5'));var logger=require(_0x5405('0x6'))(_0x5405('0x7'));var config=require(_0x5405('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5405('0x9')][_0x5405('0xa')]({'port':0x232a});config[_0x5405('0xb')]=_[_0x5405('0xc')](config[_0x5405('0xb')],{'host':_0x5405('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5405('0xe'))['register'](socket);function respondWithRpcPromise(_0xa06108,_0x178183,_0x9f8111){return new BPromise(function(_0x5ecda1,_0x3c84b8){return client['request'](_0xa06108,_0x9f8111)[_0x5405('0xf')](function(_0x5a7d1d){logger[_0x5405('0x10')]('SquareProject,\x20%s,\x20%s',_0x178183,'request\x20sent');logger[_0x5405('0x11')](_0x5405('0x12'),_0x178183,'request\x20sent',JSON['stringify'](_0x5a7d1d));if(_0x5a7d1d[_0x5405('0x13')]){if(_0x5a7d1d[_0x5405('0x13')]['code']===0x1f4){logger[_0x5405('0x13')](_0x5405('0x14'),_0x178183,_0x5a7d1d[_0x5405('0x13')][_0x5405('0x15')]);return _0x3c84b8(_0x5a7d1d['error'][_0x5405('0x15')]);}logger[_0x5405('0x13')](_0x5405('0x14'),_0x178183,_0x5a7d1d['error']['message']);return _0x5ecda1(_0x5a7d1d[_0x5405('0x13')][_0x5405('0x15')]);}else{logger['info']('SquareProject,\x20%s,\x20%s',_0x178183,'request\x20sent');_0x5ecda1(_0x5a7d1d[_0x5405('0x16')]['message']);}})[_0x5405('0x17')](function(_0x58adba){logger[_0x5405('0x13')](_0x5405('0x14'),_0x178183,_0x58adba);_0x3c84b8(_0x58adba);});});}exports['ShowSquareProject']=function(_0x3ceba4){var _0x14b08a=this;return new Promise(function(_0x23e922,_0x455cd8){return db[_0x5405('0x18')][_0x5405('0x19')]({'raw':_0x3ceba4[_0x5405('0x1a')]?_0x3ceba4[_0x5405('0x1a')][_0x5405('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ceba4[_0x5405('0x1a')]?_0x3ceba4[_0x5405('0x1a')][_0x5405('0x1c')]||null:null,'attributes':_0x3ceba4[_0x5405('0x1a')]?_0x3ceba4[_0x5405('0x1a')][_0x5405('0x1d')]||null:null,'include':_0x3ceba4['options']?_0x3ceba4[_0x5405('0x1a')][_0x5405('0x1e')]?_['map'](_0x3ceba4[_0x5405('0x1a')]['include'],function(_0x1d00fc){return{'model':db[_0x1d00fc[_0x5405('0x1f')]],'as':_0x1d00fc['as'],'attributes':_0x1d00fc[_0x5405('0x1d')],'include':_0x1d00fc['include']?_[_0x5405('0x20')](_0x1d00fc['include'],function(_0x3a3c09){return{'model':db[_0x3a3c09[_0x5405('0x1f')]],'as':_0x3a3c09['as'],'attributes':_0x3a3c09[_0x5405('0x1d')],'include':_0x3a3c09['include']?_[_0x5405('0x20')](_0x3a3c09[_0x5405('0x1e')],function(_0x5b2e0d){return{'model':db[_0x5b2e0d[_0x5405('0x1f')]],'as':_0x5b2e0d['as'],'attributes':_0x5b2e0d[_0x5405('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5405('0xf')](function(_0x4f6550){logger[_0x5405('0x10')](_0x5405('0x21'),_0x3ceba4);logger[_0x5405('0x11')](_0x5405('0x21'),_0x3ceba4,JSON[_0x5405('0x22')](_0x4f6550));_0x23e922(_0x4f6550);})[_0x5405('0x17')](function(_0x212d9a){logger[_0x5405('0x13')](_0x5405('0x21'),_0x212d9a[_0x5405('0x15')],_0x3ceba4);_0x455cd8(_0x14b08a['error'](0x1f4,_0x212d9a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 63b968e..47126fd 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 _0xfcf0=['removeListener','register','length','squareProject:','./squareProject.events','save','update'];(function(_0x368c42,_0x903dc4){var _0x11fd4c=function(_0x223a8a){while(--_0x223a8a){_0x368c42['push'](_0x368c42['shift']());}};_0x11fd4c(++_0x903dc4);}(_0xfcf0,0x138));var _0x0fcf=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0xfcf0[_0x1fc1f9];return _0x4987ca;};'use strict';var SquareProjectEvents=require(_0x0fcf('0x0'));var events=[_0x0fcf('0x1'),'remove',_0x0fcf('0x2')];function createListener(_0x3d8e0f,_0x366cfa){return function(_0xd744d1){_0x366cfa['emit'](_0x3d8e0f,_0xd744d1);};}function removeListener(_0x2fe6d8,_0x265968){return function(){SquareProjectEvents[_0x0fcf('0x3')](_0x2fe6d8,_0x265968);};}exports[_0x0fcf('0x4')]=function(_0x1bace8){for(var _0x1a7b03=0x0,_0x61bbb9=events[_0x0fcf('0x5')];_0x1a7b03<_0x61bbb9;_0x1a7b03++){var _0x50c575=events[_0x1a7b03];var _0x1388d1=createListener(_0x0fcf('0x6')+_0x50c575,_0x1bace8);SquareProjectEvents['on'](_0x50c575,_0x1388d1);}}; \ No newline at end of file +var _0x2a07=['save','remove','update','emit','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x40ad2a,_0x4518cc){var _0x40423a=function(_0x730081){while(--_0x730081){_0x40ad2a['push'](_0x40ad2a['shift']());}};_0x40423a(++_0x4518cc);}(_0x2a07,0x74));var _0x72a0=function(_0x4944f1,_0x482a52){_0x4944f1=_0x4944f1-0x0;var _0x433494=_0x2a07[_0x4944f1];return _0x433494;};'use strict';var SquareProjectEvents=require(_0x72a0('0x0'));var events=[_0x72a0('0x1'),_0x72a0('0x2'),_0x72a0('0x3')];function createListener(_0x1cad29,_0x548164){return function(_0x335b7c){_0x548164[_0x72a0('0x4')](_0x1cad29,_0x335b7c);};}function removeListener(_0x135982,_0x45b155){return function(){SquareProjectEvents[_0x72a0('0x5')](_0x135982,_0x45b155);};}exports[_0x72a0('0x6')]=function(_0x3ccf6d){for(var _0x20dab9=0x0,_0x193e3b=events[_0x72a0('0x7')];_0x20dab9<_0x193e3b;_0x20dab9++){var _0x21c819=events[_0x20dab9];var _0x2c04eb=createListener(_0x72a0('0x8')+_0x21c819,_0x3ccf6d);SquareProjectEvents['on'](_0x21c819,_0x2c04eb);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index bddf171..f3e6ee0 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 _0x531a=['create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/download','post'];(function(_0x276446,_0x580ed8){var _0x28ebee=function(_0x25824c){while(--_0x25824c){_0x276446['push'](_0x276446['shift']());}};_0x28ebee(++_0x580ed8);}(_0x531a,0x100));var _0xa531=function(_0x30e0f5,_0x5e4826){_0x30e0f5=_0x30e0f5-0x0;var _0x3b5800=_0x531a[_0x30e0f5];return _0x3b5800;};'use strict';var multer=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var path=require(_0xa531('0x2'));var timeout=require(_0xa531('0x3'));var express=require(_0xa531('0x4'));var router=express[_0xa531('0x5')]();var fs_extra=require(_0xa531('0x6'));var auth=require(_0xa531('0x7'));var interaction=require(_0xa531('0x8'));var config=require(_0xa531('0x9'));var controller=require('./squareRecording.controller');router[_0xa531('0xa')]('/',auth['isAuthenticated'](),controller[_0xa531('0xb')]);router[_0xa531('0xa')](_0xa531('0xc'),auth[_0xa531('0xd')](),controller[_0xa531('0xe')]);router['get'](_0xa531('0xf'),auth[_0xa531('0xd')](),controller['download']);router[_0xa531('0x10')]('/',auth[_0xa531('0xd')](),controller[_0xa531('0x11')]);router[_0xa531('0x12')](_0xa531('0xc'),auth['isAuthenticated'](),controller[_0xa531('0x13')]);router['delete'](_0xa531('0xc'),auth[_0xa531('0xd')](),controller[_0xa531('0x14')]);module['exports']=router; \ No newline at end of file +var _0xcefd=['index','get','/:id','show','/:id/download','post','create','put','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareRecording.controller','isAuthenticated'];(function(_0x22df4d,_0xa4790a){var _0x6a2020=function(_0x215c88){while(--_0x215c88){_0x22df4d['push'](_0x22df4d['shift']());}};_0x6a2020(++_0xa4790a);}(_0xcefd,0x126));var _0xdcef=function(_0xfd49ed,_0x1272e1){_0xfd49ed=_0xfd49ed-0x0;var _0x355f54=_0xcefd[_0xfd49ed];return _0x355f54;};'use strict';var multer=require(_0xdcef('0x0'));var util=require(_0xdcef('0x1'));var path=require(_0xdcef('0x2'));var timeout=require('connect-timeout');var express=require(_0xdcef('0x3'));var router=express[_0xdcef('0x4')]();var fs_extra=require(_0xdcef('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdcef('0x6'));var config=require(_0xdcef('0x7'));var controller=require(_0xdcef('0x8'));router['get']('/',auth[_0xdcef('0x9')](),controller[_0xdcef('0xa')]);router[_0xdcef('0xb')](_0xdcef('0xc'),auth['isAuthenticated'](),controller[_0xdcef('0xd')]);router[_0xdcef('0xb')](_0xdcef('0xe'),auth[_0xdcef('0x9')](),controller['download']);router[_0xdcef('0xf')]('/',auth[_0xdcef('0x9')](),controller[_0xdcef('0x10')]);router[_0xdcef('0x11')](_0xdcef('0xc'),auth[_0xdcef('0x9')](),controller['update']);router['delete'](_0xdcef('0xc'),auth[_0xdcef('0x9')](),controller['destroy']);module[_0xdcef('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 301b3e5..a447a16 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 _0xa0c1=['exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize'];(function(_0x23a627,_0x5e79b6){var _0x2914d1=function(_0x5e027f){while(--_0x5e027f){_0x23a627['push'](_0x23a627['shift']());}};_0x2914d1(++_0x5e79b6);}(_0xa0c1,0x8f));var _0x1a0c=function(_0x579942,_0x52aa4b){_0x579942=_0x579942-0x0;var _0xc30e5=_0xa0c1[_0x579942];return _0xc30e5;};'use strict';var Sequelize=require(_0x1a0c('0x0'));module[_0x1a0c('0x1')]={'uniqueid':{'type':Sequelize[_0x1a0c('0x2')]},'callerid':{'type':Sequelize[_0x1a0c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x1a0c('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x1a0c('0x2')]},'filename':{'type':Sequelize[_0x1a0c('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x1a0c('0x3')],'get':function(){var _0x5430ac='';var _0x1943e6=this[_0x1a0c('0x4')](_0x1a0c('0x5'));if(_0x1943e6){_0x5430ac=_0x1943e6[_0x1a0c('0x6')](_0x1943e6[_0x1a0c('0x7')]('.'));}return _0x5430ac;}}}; \ No newline at end of file +var _0x0ecc=['savePath','exports','STRING','VIRTUAL','getDataValue'];(function(_0x15c6db,_0x553328){var _0x500851=function(_0x548623){while(--_0x548623){_0x15c6db['push'](_0x15c6db['shift']());}};_0x500851(++_0x553328);}(_0x0ecc,0x146));var _0xc0ec=function(_0x4066b0,_0x525523){_0x4066b0=_0x4066b0-0x0;var _0x558d83=_0x0ecc[_0x4066b0];return _0x558d83;};'use strict';var Sequelize=require('sequelize');module[_0xc0ec('0x0')]={'uniqueid':{'type':Sequelize[_0xc0ec('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc0ec('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc0ec('0x1')]},'dnid':{'type':Sequelize[_0xc0ec('0x1')]},'projectName':{'type':Sequelize[_0xc0ec('0x1')]},'saveName':{'type':Sequelize[_0xc0ec('0x1')]},'filename':{'type':Sequelize[_0xc0ec('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xc0ec('0x2')],'get':function(){var _0x22142c='';var _0x14404=this[_0xc0ec('0x3')](_0xc0ec('0x4'));if(_0x14404){_0x22142c=_0x14404['substring'](_0x14404['lastIndexOf']('.'));}return _0x22142c;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index c9e3400..2f3d2e5 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 _0xfbf5=['send','index','map','SquareRecording','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','find','create','body','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','recording','Sequelize','ValidationError','download','extname','unlink','message','SquareRecording\x20not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','end','eml-format','rimraf','fast-json-patch','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name'];(function(_0x598b6f,_0x55690f){var _0x40959f=function(_0x5b23af){while(--_0x5b23af){_0x598b6f['push'](_0x598b6f['shift']());}};_0x40959f(++_0x55690f);}(_0xfbf5,0x149));var _0x5fbf=function(_0x36958a,_0x632cfa){_0x36958a=_0x36958a-0x0;var _0x4427ea=_0xfbf5[_0x36958a];return _0x4427ea;};'use strict';var emlformat=require(_0x5fbf('0x0'));var rimraf=require(_0x5fbf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5fbf('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5fbf('0x3'));var util=require('util');var path=require(_0x5fbf('0x4'));var sox=require(_0x5fbf('0x5'));var csv=require(_0x5fbf('0x6'));var ejs=require(_0x5fbf('0x7'));var fs=require('fs');var fs_extra=require(_0x5fbf('0x8'));var _=require(_0x5fbf('0x9'));var squel=require(_0x5fbf('0xa'));var crypto=require('crypto');var jsforce=require(_0x5fbf('0xb'));var deskjs=require(_0x5fbf('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5fbf('0xd'));var Papa=require(_0x5fbf('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5fbf('0xf'));var hardwareService=require(_0x5fbf('0x10'));var logger=require(_0x5fbf('0x11'))('api');var utils=require(_0x5fbf('0x12'));var config=require(_0x5fbf('0x13'));var licenseUtil=require(_0x5fbf('0x14'));var db=require(_0x5fbf('0x15'))['db'];function respondWithStatusCode(_0xcda3b,_0xf902cc){_0xf902cc=_0xf902cc||0xcc;return function(_0x3df72a){if(_0x3df72a){return _0xcda3b['sendStatus'](_0xf902cc);}return _0xcda3b[_0x5fbf('0x16')](_0xf902cc)['end']();};}function respondWithResult(_0x673e10,_0x1acad4){_0x1acad4=_0x1acad4||0xc8;return function(_0x2e31b7){if(_0x2e31b7){return _0x673e10[_0x5fbf('0x16')](_0x1acad4)[_0x5fbf('0x17')](_0x2e31b7);}};}function respondWithFilteredResult(_0x2027bf,_0x349f77){return function(_0x563bb5){if(_0x563bb5){var _0x495df1=typeof _0x349f77['offset']===_0x5fbf('0x18')&&typeof _0x349f77[_0x5fbf('0x19')]==='undefined';var _0x261f70=_0x563bb5[_0x5fbf('0x1a')];var _0x47a139=_0x495df1?0x0:_0x349f77[_0x5fbf('0x1b')];var _0x5bc217=_0x495df1?_0x563bb5[_0x5fbf('0x1a')]:_0x349f77[_0x5fbf('0x1b')]+_0x349f77['limit'];var _0x3a05bd;if(_0x5bc217>=_0x261f70){_0x5bc217=_0x261f70;_0x3a05bd=0xc8;}else{_0x3a05bd=0xce;}_0x2027bf[_0x5fbf('0x16')](_0x3a05bd);return _0x2027bf[_0x5fbf('0x1c')](_0x5fbf('0x1d'),_0x47a139+'-'+_0x5bc217+'/'+_0x261f70)[_0x5fbf('0x17')](_0x563bb5);}return null;};}function patchUpdates(_0x301816){return function(_0x31c639){try{jsonpatch['apply'](_0x31c639,_0x301816,!![]);}catch(_0x2cdc8c){return BPromise[_0x5fbf('0x1e')](_0x2cdc8c);}return _0x31c639[_0x5fbf('0x1f')]();};}function saveUpdates(_0x6b61ca,_0x341bcc){return function(_0x5e3ec6){if(_0x5e3ec6){return _0x5e3ec6[_0x5fbf('0x20')](_0x6b61ca)['then'](function(_0x317c4a){return _0x317c4a;});}return null;};}function removeEntity(_0x1b685a,_0x83f53a){return function(_0x5befea){if(_0x5befea){return _0x5befea[_0x5fbf('0x21')]()[_0x5fbf('0x22')](function(){_0x1b685a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1daea9,_0x3610ba){return function(_0x42820a){if(!_0x42820a){_0x1daea9[_0x5fbf('0x23')](0x194);}return _0x42820a;};}function handleError(_0x630f67,_0x3b120d){_0x3b120d=_0x3b120d||0x1f4;return function(_0x3c6b9f){logger[_0x5fbf('0x24')](_0x3c6b9f[_0x5fbf('0x25')]);if(_0x3c6b9f[_0x5fbf('0x26')]){delete _0x3c6b9f[_0x5fbf('0x26')];}_0x630f67['status'](_0x3b120d)[_0x5fbf('0x27')](_0x3c6b9f);};}exports[_0x5fbf('0x28')]=function(_0x9ad46d,_0xedc230){var _0x3f120={},_0x4eea1b={},_0x303b4c={'count':0x0,'rows':[]};var _0x1602c8=_[_0x5fbf('0x29')](db[_0x5fbf('0x2a')]['rawAttributes'],function(_0x10a32d){return{'name':_0x10a32d[_0x5fbf('0x2b')],'type':_0x10a32d[_0x5fbf('0x2c')][_0x5fbf('0x2d')]};});_0x4eea1b[_0x5fbf('0x2e')]=_[_0x5fbf('0x29')](_0x1602c8,_0x5fbf('0x26'));_0x4eea1b['query']=_[_0x5fbf('0x2f')](_0x9ad46d[_0x5fbf('0x30')]);_0x4eea1b[_0x5fbf('0x31')]=_['intersection'](_0x4eea1b[_0x5fbf('0x2e')],_0x4eea1b[_0x5fbf('0x30')]);_0x3f120[_0x5fbf('0x32')]=_[_0x5fbf('0x33')](_0x4eea1b[_0x5fbf('0x2e')],qs['fields'](_0x9ad46d[_0x5fbf('0x30')][_0x5fbf('0x34')]));_0x3f120[_0x5fbf('0x32')]=_0x3f120[_0x5fbf('0x32')][_0x5fbf('0x35')]?_0x3f120[_0x5fbf('0x32')]:_0x4eea1b[_0x5fbf('0x2e')];if(!_0x9ad46d[_0x5fbf('0x30')][_0x5fbf('0x36')](_0x5fbf('0x37'))){_0x3f120[_0x5fbf('0x19')]=qs[_0x5fbf('0x19')](_0x9ad46d[_0x5fbf('0x30')]['limit']);_0x3f120[_0x5fbf('0x1b')]=qs[_0x5fbf('0x1b')](_0x9ad46d[_0x5fbf('0x30')][_0x5fbf('0x1b')]);}_0x3f120['order']=qs[_0x5fbf('0x38')](_0x9ad46d[_0x5fbf('0x30')][_0x5fbf('0x38')]);_0x3f120[_0x5fbf('0x39')]=qs[_0x5fbf('0x31')](_[_0x5fbf('0x3a')](_0x9ad46d['query'],_0x4eea1b['filters']),_0x1602c8);if(_0x9ad46d[_0x5fbf('0x30')][_0x5fbf('0x3b')]){_0x3f120[_0x5fbf('0x39')]=_[_0x5fbf('0x3c')](_0x3f120[_0x5fbf('0x39')],{'$or':_[_0x5fbf('0x29')](_0x1602c8,function(_0x13457d){if(_0x13457d['type']!==_0x5fbf('0x3d')){var _0xdc0e31={};_0xdc0e31[_0x13457d[_0x5fbf('0x26')]]={'$like':'%'+_0x9ad46d[_0x5fbf('0x30')][_0x5fbf('0x3b')]+'%'};return _0xdc0e31;}})});}_0x3f120=_[_0x5fbf('0x3c')]({},_0x3f120,_0x9ad46d['options']);var _0x5cc7dc={'where':_0x3f120[_0x5fbf('0x39')]};return db[_0x5fbf('0x2a')][_0x5fbf('0x1a')](_0x5cc7dc)[_0x5fbf('0x22')](function(_0x2f3b05){_0x303b4c[_0x5fbf('0x1a')]=_0x2f3b05;if(_0x9ad46d[_0x5fbf('0x30')][_0x5fbf('0x3e')]){_0x3f120[_0x5fbf('0x3f')]=[{'all':!![]}];}return db[_0x5fbf('0x2a')][_0x5fbf('0x40')](_0x3f120);})[_0x5fbf('0x22')](function(_0x20cc9b){_0x303b4c[_0x5fbf('0x41')]=_0x20cc9b;return _0x303b4c;})[_0x5fbf('0x22')](respondWithFilteredResult(_0xedc230,_0x3f120))[_0x5fbf('0x42')](handleError(_0xedc230,null));};exports['show']=function(_0x5a674a,_0x3a9487){var _0x2c8e66={'raw':!![],'where':{'id':_0x5a674a['params']['id']}},_0x1a036b={};_0x1a036b[_0x5fbf('0x2e')]=_[_0x5fbf('0x2f')](db[_0x5fbf('0x2a')]['rawAttributes']);_0x1a036b[_0x5fbf('0x30')]=_[_0x5fbf('0x2f')](_0x5a674a[_0x5fbf('0x30')]);_0x1a036b[_0x5fbf('0x31')]=_[_0x5fbf('0x33')](_0x1a036b[_0x5fbf('0x2e')],_0x1a036b[_0x5fbf('0x30')]);_0x2c8e66[_0x5fbf('0x32')]=_[_0x5fbf('0x33')](_0x1a036b[_0x5fbf('0x2e')],qs[_0x5fbf('0x34')](_0x5a674a[_0x5fbf('0x30')]['fields']));_0x2c8e66['attributes']=_0x2c8e66[_0x5fbf('0x32')]['length']?_0x2c8e66[_0x5fbf('0x32')]:_0x1a036b[_0x5fbf('0x2e')];if(_0x5a674a[_0x5fbf('0x30')]['includeAll']){_0x2c8e66[_0x5fbf('0x3f')]=[{'all':!![]}];}_0x2c8e66=_[_0x5fbf('0x3c')]({},_0x2c8e66,_0x5a674a['options']);return db['SquareRecording'][_0x5fbf('0x43')](_0x2c8e66)['then'](handleEntityNotFound(_0x3a9487,null))[_0x5fbf('0x22')](respondWithResult(_0x3a9487,null))[_0x5fbf('0x42')](handleError(_0x3a9487,null));};exports[_0x5fbf('0x44')]=function(_0x440246,_0x8415e3){return db[_0x5fbf('0x2a')][_0x5fbf('0x44')](_0x440246[_0x5fbf('0x45')],{})[_0x5fbf('0x22')](respondWithResult(_0x8415e3,0xc9))['catch'](handleError(_0x8415e3,null));};exports[_0x5fbf('0x20')]=function(_0x5064ff,_0x1ed57a){if(_0x5064ff[_0x5fbf('0x45')]['id']){delete _0x5064ff[_0x5fbf('0x45')]['id'];}return db[_0x5fbf('0x2a')]['find']({'where':{'id':_0x5064ff['params']['id']}})['then'](handleEntityNotFound(_0x1ed57a,null))[_0x5fbf('0x22')](saveUpdates(_0x5064ff[_0x5fbf('0x45')],null))[_0x5fbf('0x22')](respondWithResult(_0x1ed57a,null))['catch'](handleError(_0x1ed57a,null));};exports['download']=function(_0x10ec47,_0x425521,_0xb10d73){var _0x4def88=require(_0x5fbf('0x46'));var _0x212756=![];var _0x559291={};if(_0x10ec47[_0x5fbf('0x30')][_0x5fbf('0x2c')]&&_0x10ec47[_0x5fbf('0x30')][_0x5fbf('0x2c')]===_0x5fbf('0x47')){_0x559291[_0x5fbf('0x47')]=_0x10ec47['params']['id'];}else{_0x559291['id']=_0x10ec47['params']['id'];}return db[_0x5fbf('0x2a')][_0x5fbf('0x43')]({'where':_0x559291,'attributes':['id',_0x5fbf('0x48'),_0x5fbf('0x49')],'raw':!![]})[_0x5fbf('0x22')](handleEntityNotFound(_0x425521,null))[_0x5fbf('0x22')](function(_0x2eb304){if(_0x2eb304){var _0x31d3e3=_0x2eb304[_0x5fbf('0x48')];var _0x1b5fe7=util[_0x5fbf('0x4a')]('%s.cypher',_0x31d3e3);if(fs[_0x5fbf('0x4b')](_0x1b5fe7)){_0x212756=!![];return _0x4def88['decryptFile'](_0x1b5fe7,_0x31d3e3,config['secrets'][_0x5fbf('0x4c')])[_0x5fbf('0x22')](function(){return _0x2eb304;});}return _0x2eb304;}})[_0x5fbf('0x22')](function(_0x38fc10){if(_0x38fc10){var _0x584e9f=_0x38fc10[_0x5fbf('0x48')];if(!fs[_0x5fbf('0x4b')](_0x584e9f)){throw new db[(_0x5fbf('0x4d'))][(_0x5fbf('0x4e'))]('SquareRecording\x20not\x20found');}if(_0x38fc10[_0x5fbf('0x49')]){return _0x425521[_0x5fbf('0x4f')](_0x584e9f,_0x38fc10[_0x5fbf('0x49')]+path[_0x5fbf('0x50')](_0x584e9f),function(){if(_0x212756){fs[_0x5fbf('0x51')](_0x584e9f);}});}else{return _0x425521[_0x5fbf('0x4f')](_0x584e9f,function(_0x4f56a8){if(_0x212756){fs[_0x5fbf('0x51')](_0x584e9f);}});}}})[_0x5fbf('0x42')](function(_0x2546a1){if(_0x2546a1[_0x5fbf('0x52')]===_0x5fbf('0x53')){_0x425521['status'](0x194)[_0x5fbf('0x27')]('Not\x20found');}else{return handleError(_0x425521,null);}});};exports[_0x5fbf('0x21')]=function(_0x4331e1,_0x1940e9){return db['SquareRecording'][_0x5fbf('0x43')]({'where':{'id':_0x4331e1['params']['id']}})[_0x5fbf('0x22')](function(_0x2d3023){if(_[_0x5fbf('0x54')](_0x2d3023)){throw new ReferenceError(_0x5fbf('0x55'));}return _0x2d3023;})[_0x5fbf('0x22')](function(_0xa2d150){var _0x1b1748=_0xa2d150['savePath'];logger[_0x5fbf('0x56')]('cancellazione\x20fisica\x20documento\x20%s',_0x1b1748);if(!_['isNil'](_0xa2d150['savePath'])&&fs[_0x5fbf('0x4b')](_0x1b1748)){logger['info'](_0x5fbf('0x57')+_0x1b1748+_0x5fbf('0x58'));fs[_0x5fbf('0x59')](_0x1b1748);}_0x1b1748=_0x1b1748+_0x5fbf('0x5a');if(!_[_0x5fbf('0x54')](_0xa2d150[_0x5fbf('0x48')])&&fs[_0x5fbf('0x4b')](_0x1b1748)){logger[_0x5fbf('0x56')]('File:\x20\x22'+_0x1b1748+_0x5fbf('0x58'));fs[_0x5fbf('0x59')](_0x1b1748);}return _0xa2d150;})['then'](function(_0x4bb781){if(!_0x4bb781)throw new InternalError();return _0x4bb781[_0x5fbf('0x21')]();})[_0x5fbf('0x22')](function(){_0x1940e9['status'](0xcc)[_0x5fbf('0x5b')]();})['catch'](handleError(_0x1940e9,null));}; \ No newline at end of file +var _0x4f55=['model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','keys','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','send','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','apply','reject','save','update','then','destroy','error','stack','name','index','SquareRecording','rawAttributes','fieldName','type'];(function(_0x37dc5a,_0x595680){var _0x10c64b=function(_0x82f055){while(--_0x82f055){_0x37dc5a['push'](_0x37dc5a['shift']());}};_0x10c64b(++_0x595680);}(_0x4f55,0x95));var _0x54f5=function(_0x53be43,_0x4b2430){_0x53be43=_0x53be43-0x0;var _0x1ac27b=_0x4f55[_0x53be43];return _0x1ac27b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54f5('0x0'));var zipdir=require(_0x54f5('0x1'));var jsonpatch=require(_0x54f5('0x2'));var rp=require(_0x54f5('0x3'));var moment=require('moment');var BPromise=require(_0x54f5('0x4'));var Mustache=require(_0x54f5('0x5'));var util=require(_0x54f5('0x6'));var path=require(_0x54f5('0x7'));var sox=require(_0x54f5('0x8'));var csv=require('to-csv');var ejs=require(_0x54f5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54f5('0xa'));var squel=require('squel');var crypto=require(_0x54f5('0xb'));var jsforce=require(_0x54f5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x54f5('0xd'));var querystring=require(_0x54f5('0xe'));var Papa=require(_0x54f5('0xf'));var Redis=require(_0x54f5('0x10'));var authService=require(_0x54f5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x54f5('0x12'));var hardwareService=require(_0x54f5('0x13'));var logger=require(_0x54f5('0x14'))(_0x54f5('0x15'));var utils=require(_0x54f5('0x16'));var config=require(_0x54f5('0x17'));var licenseUtil=require(_0x54f5('0x18'));var db=require(_0x54f5('0x19'))['db'];function respondWithStatusCode(_0x1746bd,_0x1b54ba){_0x1b54ba=_0x1b54ba||0xcc;return function(_0x27902f){if(_0x27902f){return _0x1746bd[_0x54f5('0x1a')](_0x1b54ba);}return _0x1746bd['status'](_0x1b54ba)[_0x54f5('0x1b')]();};}function respondWithResult(_0x274827,_0x502d13){_0x502d13=_0x502d13||0xc8;return function(_0x54e963){if(_0x54e963){return _0x274827[_0x54f5('0x1c')](_0x502d13)[_0x54f5('0x1d')](_0x54e963);}};}function respondWithFilteredResult(_0x15e215,_0x198c4f){return function(_0x203fd8){if(_0x203fd8){var _0x2140fd=typeof _0x198c4f[_0x54f5('0x1e')]==='undefined'&&typeof _0x198c4f['limit']===_0x54f5('0x1f');var _0x176f4d=_0x203fd8['count'];var _0x220c4e=_0x2140fd?0x0:_0x198c4f[_0x54f5('0x1e')];var _0x46abd7=_0x2140fd?_0x203fd8['count']:_0x198c4f['offset']+_0x198c4f[_0x54f5('0x20')];var _0x408792;if(_0x46abd7>=_0x176f4d){_0x46abd7=_0x176f4d;_0x408792=0xc8;}else{_0x408792=0xce;}_0x15e215[_0x54f5('0x1c')](_0x408792);return _0x15e215['set']('Content-Range',_0x220c4e+'-'+_0x46abd7+'/'+_0x176f4d)[_0x54f5('0x1d')](_0x203fd8);}return null;};}function patchUpdates(_0x2ad9e3){return function(_0x56506a){try{jsonpatch[_0x54f5('0x21')](_0x56506a,_0x2ad9e3,!![]);}catch(_0x40e147){return BPromise[_0x54f5('0x22')](_0x40e147);}return _0x56506a[_0x54f5('0x23')]();};}function saveUpdates(_0x46f18c,_0x334a1b){return function(_0x3e6412){if(_0x3e6412){return _0x3e6412[_0x54f5('0x24')](_0x46f18c)[_0x54f5('0x25')](function(_0x1800da){return _0x1800da;});}return null;};}function removeEntity(_0x579cff,_0x7a065f){return function(_0x3ab1e0){if(_0x3ab1e0){return _0x3ab1e0[_0x54f5('0x26')]()[_0x54f5('0x25')](function(){_0x579cff[_0x54f5('0x1c')](0xcc)[_0x54f5('0x1b')]();});}};}function handleEntityNotFound(_0x45347d,_0x428dbc){return function(_0x222136){if(!_0x222136){_0x45347d[_0x54f5('0x1a')](0x194);}return _0x222136;};}function handleError(_0x4ac681,_0x5a7b87){_0x5a7b87=_0x5a7b87||0x1f4;return function(_0x26f16d){logger[_0x54f5('0x27')](_0x26f16d[_0x54f5('0x28')]);if(_0x26f16d[_0x54f5('0x29')]){delete _0x26f16d[_0x54f5('0x29')];}_0x4ac681[_0x54f5('0x1c')](_0x5a7b87)['send'](_0x26f16d);};}exports[_0x54f5('0x2a')]=function(_0x1a1c40,_0x5d9c86){var _0xb101ca={},_0x487599={},_0x5f61d8={'count':0x0,'rows':[]};var _0x1b9602=_['map'](db[_0x54f5('0x2b')][_0x54f5('0x2c')],function(_0x2a7ac1){return{'name':_0x2a7ac1[_0x54f5('0x2d')],'type':_0x2a7ac1[_0x54f5('0x2e')]['key']};});_0x487599[_0x54f5('0x2f')]=_[_0x54f5('0x30')](_0x1b9602,_0x54f5('0x29'));_0x487599[_0x54f5('0x31')]=_['keys'](_0x1a1c40[_0x54f5('0x31')]);_0x487599[_0x54f5('0x32')]=_[_0x54f5('0x33')](_0x487599[_0x54f5('0x2f')],_0x487599[_0x54f5('0x31')]);_0xb101ca[_0x54f5('0x34')]=_['intersection'](_0x487599[_0x54f5('0x2f')],qs[_0x54f5('0x35')](_0x1a1c40[_0x54f5('0x31')][_0x54f5('0x35')]));_0xb101ca[_0x54f5('0x34')]=_0xb101ca[_0x54f5('0x34')][_0x54f5('0x36')]?_0xb101ca['attributes']:_0x487599[_0x54f5('0x2f')];if(!_0x1a1c40[_0x54f5('0x31')]['hasOwnProperty'](_0x54f5('0x37'))){_0xb101ca[_0x54f5('0x20')]=qs[_0x54f5('0x20')](_0x1a1c40['query']['limit']);_0xb101ca[_0x54f5('0x1e')]=qs['offset'](_0x1a1c40[_0x54f5('0x31')][_0x54f5('0x1e')]);}_0xb101ca[_0x54f5('0x38')]=qs[_0x54f5('0x39')](_0x1a1c40[_0x54f5('0x31')][_0x54f5('0x39')]);_0xb101ca[_0x54f5('0x3a')]=qs[_0x54f5('0x32')](_[_0x54f5('0x3b')](_0x1a1c40['query'],_0x487599[_0x54f5('0x32')]),_0x1b9602);if(_0x1a1c40[_0x54f5('0x31')][_0x54f5('0x3c')]){_0xb101ca[_0x54f5('0x3a')]=_[_0x54f5('0x3d')](_0xb101ca[_0x54f5('0x3a')],{'$or':_[_0x54f5('0x30')](_0x1b9602,function(_0x2744cb){if(_0x2744cb[_0x54f5('0x2e')]!==_0x54f5('0x3e')){var _0xe65cbb={};_0xe65cbb[_0x2744cb[_0x54f5('0x29')]]={'$like':'%'+_0x1a1c40['query'][_0x54f5('0x3c')]+'%'};return _0xe65cbb;}})});}_0xb101ca=_['merge']({},_0xb101ca,_0x1a1c40[_0x54f5('0x3f')]);var _0x1e010c={'where':_0xb101ca[_0x54f5('0x3a')]};return db['SquareRecording'][_0x54f5('0x40')](_0x1e010c)[_0x54f5('0x25')](function(_0x310ce9){_0x5f61d8[_0x54f5('0x40')]=_0x310ce9;if(_0x1a1c40[_0x54f5('0x31')][_0x54f5('0x41')]){_0xb101ca['include']=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0xb101ca);})[_0x54f5('0x25')](function(_0x3cba75){_0x5f61d8[_0x54f5('0x42')]=_0x3cba75;return _0x5f61d8;})[_0x54f5('0x25')](respondWithFilteredResult(_0x5d9c86,_0xb101ca))[_0x54f5('0x43')](handleError(_0x5d9c86,null));};exports[_0x54f5('0x44')]=function(_0x4caccc,_0x26b6ba){var _0x3b51b5={'raw':!![],'where':{'id':_0x4caccc[_0x54f5('0x45')]['id']}},_0x114d2e={};_0x114d2e[_0x54f5('0x2f')]=_[_0x54f5('0x46')](db[_0x54f5('0x2b')][_0x54f5('0x2c')]);_0x114d2e[_0x54f5('0x31')]=_[_0x54f5('0x46')](_0x4caccc[_0x54f5('0x31')]);_0x114d2e[_0x54f5('0x32')]=_[_0x54f5('0x33')](_0x114d2e[_0x54f5('0x2f')],_0x114d2e['query']);_0x3b51b5['attributes']=_[_0x54f5('0x33')](_0x114d2e['model'],qs[_0x54f5('0x35')](_0x4caccc['query'][_0x54f5('0x35')]));_0x3b51b5[_0x54f5('0x34')]=_0x3b51b5['attributes']['length']?_0x3b51b5[_0x54f5('0x34')]:_0x114d2e['model'];if(_0x4caccc['query'][_0x54f5('0x41')]){_0x3b51b5['include']=[{'all':!![]}];}_0x3b51b5=_[_0x54f5('0x3d')]({},_0x3b51b5,_0x4caccc[_0x54f5('0x3f')]);return db['SquareRecording'][_0x54f5('0x47')](_0x3b51b5)['then'](handleEntityNotFound(_0x26b6ba,null))[_0x54f5('0x25')](respondWithResult(_0x26b6ba,null))[_0x54f5('0x43')](handleError(_0x26b6ba,null));};exports[_0x54f5('0x48')]=function(_0x3d9405,_0x37c8ed){return db[_0x54f5('0x2b')]['create'](_0x3d9405['body'],{})[_0x54f5('0x25')](respondWithResult(_0x37c8ed,0xc9))[_0x54f5('0x43')](handleError(_0x37c8ed,null));};exports['update']=function(_0x433ea1,_0x54d1aa){if(_0x433ea1[_0x54f5('0x49')]['id']){delete _0x433ea1[_0x54f5('0x49')]['id'];}return db[_0x54f5('0x2b')][_0x54f5('0x47')]({'where':{'id':_0x433ea1['params']['id']}})[_0x54f5('0x25')](handleEntityNotFound(_0x54d1aa,null))['then'](saveUpdates(_0x433ea1[_0x54f5('0x49')],null))[_0x54f5('0x25')](respondWithResult(_0x54d1aa,null))[_0x54f5('0x43')](handleError(_0x54d1aa,null));};exports[_0x54f5('0x4a')]=function(_0x54bbc8,_0x58c152,_0x2313a7){var _0x2fae81=require(_0x54f5('0x4b'));var _0x53bfe7=![];var _0x16f4ae={};if(_0x54bbc8[_0x54f5('0x31')]['type']&&_0x54bbc8['query'][_0x54f5('0x2e')]===_0x54f5('0x4c')){_0x16f4ae[_0x54f5('0x4c')]=_0x54bbc8[_0x54f5('0x45')]['id'];}else{_0x16f4ae['id']=_0x54bbc8[_0x54f5('0x45')]['id'];}return db[_0x54f5('0x2b')]['find']({'where':_0x16f4ae,'attributes':['id',_0x54f5('0x4d'),_0x54f5('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x58c152,null))[_0x54f5('0x25')](function(_0x21bfcb){if(_0x21bfcb){var _0x11a4bb=_0x21bfcb[_0x54f5('0x4d')];var _0x4aa836=util[_0x54f5('0x4f')](_0x54f5('0x50'),_0x11a4bb);if(fs[_0x54f5('0x51')](_0x4aa836)){_0x53bfe7=!![];return _0x2fae81[_0x54f5('0x52')](_0x4aa836,_0x11a4bb,config[_0x54f5('0x53')][_0x54f5('0x54')])['then'](function(){return _0x21bfcb;});}return _0x21bfcb;}})[_0x54f5('0x25')](function(_0x5b9cac){if(_0x5b9cac){var _0x1a8af1=_0x5b9cac[_0x54f5('0x4d')];if(!fs[_0x54f5('0x51')](_0x1a8af1)){throw new db[(_0x54f5('0x55'))][(_0x54f5('0x56'))](_0x54f5('0x57'));}if(_0x5b9cac['filename']){return _0x58c152[_0x54f5('0x4a')](_0x1a8af1,_0x5b9cac[_0x54f5('0x4e')]+path[_0x54f5('0x58')](_0x1a8af1),function(){if(_0x53bfe7){fs[_0x54f5('0x59')](_0x1a8af1);}});}else{return _0x58c152[_0x54f5('0x4a')](_0x1a8af1,function(_0x15d3ce){if(_0x53bfe7){fs[_0x54f5('0x59')](_0x1a8af1);}});}}})['catch'](function(_0x382e09){if(_0x382e09['message']===_0x54f5('0x57')){_0x58c152['status'](0x194)[_0x54f5('0x5a')]('Not\x20found');}else{return handleError(_0x58c152,null);}});};exports[_0x54f5('0x26')]=function(_0x1f0413,_0x4fa629){return db[_0x54f5('0x2b')][_0x54f5('0x47')]({'where':{'id':_0x1f0413[_0x54f5('0x45')]['id']}})[_0x54f5('0x25')](function(_0x598b04){if(_['isNil'](_0x598b04)){throw new ReferenceError(_0x54f5('0x5b'));}return _0x598b04;})[_0x54f5('0x25')](function(_0x28f0ac){var _0x4e31da=_0x28f0ac['savePath'];logger[_0x54f5('0x5c')]('cancellazione\x20fisica\x20documento\x20%s',_0x4e31da);if(!_[_0x54f5('0x5d')](_0x28f0ac[_0x54f5('0x4d')])&&fs['existsSync'](_0x4e31da)){logger[_0x54f5('0x5c')](_0x54f5('0x5e')+_0x4e31da+_0x54f5('0x5f'));fs[_0x54f5('0x60')](_0x4e31da);}_0x4e31da=_0x4e31da+_0x54f5('0x61');if(!_[_0x54f5('0x5d')](_0x28f0ac[_0x54f5('0x4d')])&&fs[_0x54f5('0x51')](_0x4e31da)){logger[_0x54f5('0x5c')](_0x54f5('0x5e')+_0x4e31da+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x4e31da);}return _0x28f0ac;})[_0x54f5('0x25')](function(_0x91ebca){if(!_0x91ebca)throw new InternalError();return _0x91ebca[_0x54f5('0x26')]();})['then'](function(){_0x4fa629[_0x54f5('0x1c')](0xcc)[_0x54f5('0x1b')]();})[_0x54f5('0x43')](handleError(_0x4fa629,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index eccb3b0..c15d977 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 _0x8227=['request-promise','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','util','api','moment','bluebird'];(function(_0x9eb367,_0x31ae6d){var _0x26f71f=function(_0x49f27f){while(--_0x49f27f){_0x9eb367['push'](_0x9eb367['shift']());}};_0x26f71f(++_0x31ae6d);}(_0x8227,0x146));var _0x7822=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8227[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7822('0x0'));var logger=require('../../config/logger')(_0x7822('0x1'));var moment=require(_0x7822('0x2'));var BPromise=require(_0x7822('0x3'));var rp=require(_0x7822('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7822('0x5'));var config=require(_0x7822('0x6'));var attributes=require(_0x7822('0x7'));module[_0x7822('0x8')]=function(_0x38f333,_0x1ae126){return _0x38f333[_0x7822('0x9')](_0x7822('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x117c=['../../config/environment','./squareRecording.attributes','exports','define','square_recordings','api','request-promise','path','rimraf'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x117c,0x71));var _0xc117=function(_0x5807d4,_0x29306b){_0x5807d4=_0x5807d4-0x0;var _0x5ddf9b=_0x117c[_0x5807d4];return _0x5ddf9b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc117('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc117('0x1'));var fs=require('fs');var path=require(_0xc117('0x2'));var rimraf=require(_0xc117('0x3'));var config=require(_0xc117('0x4'));var attributes=require(_0xc117('0x5'));module[_0xc117('0x6')]=function(_0x52d09e,_0x3bb859){return _0x52d09e[_0xc117('0x7')]('SquareRecording',attributes,{'tableName':_0xc117('0x8'),'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 f9367b8..4144a32 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 _0x80cd=['http','request','then','info','request\x20sent','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','SquareRecording','create','body','options','CreateSquareRecording','debug','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x2bb1bd,_0x4a7df1){var _0x216550=function(_0x2f1e03){while(--_0x2f1e03){_0x2bb1bd['push'](_0x2bb1bd['shift']());}};_0x216550(++_0x4a7df1);}(_0x80cd,0xf3));var _0xd80c=function(_0x3048ea,_0x3838c2){_0x3048ea=_0x3048ea-0x0;var _0x1a13c4=_0x80cd[_0x3048ea];return _0x1a13c4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd80c('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd80c('0x1'));var db=require(_0xd80c('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd80c('0x3'));var config=require(_0xd80c('0x4'));var jayson=require(_0xd80c('0x5'));var client=jayson[_0xd80c('0x6')][_0xd80c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x203ae3,_0x380d23,_0x49bec9){return new BPromise(function(_0x4c0443,_0x942841){return client[_0xd80c('0x8')](_0x203ae3,_0x49bec9)[_0xd80c('0x9')](function(_0x2b7464){logger[_0xd80c('0xa')]('SquareRecording,\x20%s,\x20%s',_0x380d23,_0xd80c('0xb'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x380d23,_0xd80c('0xb'),JSON[_0xd80c('0xc')](_0x2b7464));if(_0x2b7464[_0xd80c('0xd')]){if(_0x2b7464[_0xd80c('0xd')][_0xd80c('0xe')]===0x1f4){logger[_0xd80c('0xd')](_0xd80c('0xf'),_0x380d23,_0x2b7464['error'][_0xd80c('0x10')]);return _0x942841(_0x2b7464['error'][_0xd80c('0x10')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x380d23,_0x2b7464[_0xd80c('0xd')]['message']);return _0x4c0443(_0x2b7464[_0xd80c('0xd')][_0xd80c('0x10')]);}else{logger[_0xd80c('0xa')]('SquareRecording,\x20%s,\x20%s',_0x380d23,_0xd80c('0xb'));_0x4c0443(_0x2b7464[_0xd80c('0x11')][_0xd80c('0x10')]);}})[_0xd80c('0x12')](function(_0x482837){logger[_0xd80c('0xd')](_0xd80c('0xf'),_0x380d23,_0x482837);_0x942841(_0x482837);});});}exports['CreateSquareRecording']=function(_0x1a79f3){var _0x5009c9=this;return new Promise(function(_0x5306cd,_0x20685b){return db[_0xd80c('0x13')][_0xd80c('0x14')](_0x1a79f3[_0xd80c('0x15')],{'raw':_0x1a79f3[_0xd80c('0x16')]?_0x1a79f3['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x352ff0){logger[_0xd80c('0xa')](_0xd80c('0x17'),_0x1a79f3);logger[_0xd80c('0x18')]('CreateSquareRecording',_0x1a79f3,JSON[_0xd80c('0xc')](_0x352ff0));_0x5306cd(_0x352ff0);})['catch'](function(_0x4d3ef5){logger[_0xd80c('0xd')](_0xd80c('0x17'),_0x4d3ef5[_0xd80c('0x10')],_0x1a79f3);_0x20685b(_0x5009c9[_0xd80c('0xd')](0x1f4,_0x4d3ef5[_0xd80c('0x10')]));});});}; \ No newline at end of file +var _0x3def=['result','catch','CreateSquareRecording','SquareRecording','create','options','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x90ae53,_0x36ca18){var _0x329ac6=function(_0x2165a4){while(--_0x2165a4){_0x90ae53['push'](_0x90ae53['shift']());}};_0x329ac6(++_0x36ca18);}(_0x3def,0x101));var _0xf3de=function(_0x30ea12,_0x519177){_0x30ea12=_0x30ea12-0x0;var _0xbe4fc2=_0x3def[_0x30ea12];return _0xbe4fc2;};'use strict';var _=require(_0xf3de('0x0'));var util=require(_0xf3de('0x1'));var moment=require(_0xf3de('0x2'));var BPromise=require(_0xf3de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3de('0x4'));var db=require(_0xf3de('0x5'))['db'];var utils=require(_0xf3de('0x6'));var logger=require(_0xf3de('0x7'))('rpc');var config=require(_0xf3de('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf3de('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53775f,_0x5833cd,_0x2e3002){return new BPromise(function(_0x4776ab,_0x1c7bab){return client['request'](_0x53775f,_0x2e3002)[_0xf3de('0xa')](function(_0x18d670){logger[_0xf3de('0xb')](_0xf3de('0xc'),_0x5833cd,_0xf3de('0xd'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x5833cd,_0xf3de('0xd'),JSON[_0xf3de('0xe')](_0x18d670));if(_0x18d670[_0xf3de('0xf')]){if(_0x18d670[_0xf3de('0xf')][_0xf3de('0x10')]===0x1f4){logger[_0xf3de('0xf')](_0xf3de('0xc'),_0x5833cd,_0x18d670['error'][_0xf3de('0x11')]);return _0x1c7bab(_0x18d670['error'][_0xf3de('0x11')]);}logger[_0xf3de('0xf')](_0xf3de('0xc'),_0x5833cd,_0x18d670[_0xf3de('0xf')]['message']);return _0x4776ab(_0x18d670['error'][_0xf3de('0x11')]);}else{logger[_0xf3de('0xb')](_0xf3de('0xc'),_0x5833cd,_0xf3de('0xd'));_0x4776ab(_0x18d670[_0xf3de('0x12')]['message']);}})[_0xf3de('0x13')](function(_0xed47d1){logger[_0xf3de('0xf')]('SquareRecording,\x20%s,\x20%s',_0x5833cd,_0xed47d1);_0x1c7bab(_0xed47d1);});});}exports[_0xf3de('0x14')]=function(_0x905efd){var _0x4c04e0=this;return new Promise(function(_0x1330ed,_0x36e392){return db[_0xf3de('0x15')][_0xf3de('0x16')](_0x905efd['body'],{'raw':_0x905efd[_0xf3de('0x17')]?_0x905efd[_0xf3de('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5b29ff){logger[_0xf3de('0xb')](_0xf3de('0x14'),_0x905efd);logger[_0xf3de('0x18')](_0xf3de('0x14'),_0x905efd,JSON[_0xf3de('0xe')](_0x5b29ff));_0x1330ed(_0x5b29ff);})[_0xf3de('0x13')](function(_0x4f1ade){logger[_0xf3de('0xf')](_0xf3de('0x14'),_0x4f1ade['message'],_0x905efd);_0x36e392(_0x4c04e0[_0xf3de('0xf')](0x1f4,_0x4f1ade[_0xf3de('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 12bdcef..0d79164 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 _0x29a5=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReport.controller','get','index','/describe','isAuthenticated','describe','show','post','/:id','update'];(function(_0x1ddc20,_0x344515){var _0x273539=function(_0x3c3770){while(--_0x3c3770){_0x1ddc20['push'](_0x1ddc20['shift']());}};_0x273539(++_0x344515);}(_0x29a5,0x6d));var _0x529a=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x29a5[_0x4a7631];return _0x1a5a6f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x529a('0x0'));var timeout=require(_0x529a('0x1'));var express=require(_0x529a('0x2'));var router=express[_0x529a('0x3')]();var fs_extra=require(_0x529a('0x4'));var auth=require(_0x529a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x529a('0x6'));var controller=require(_0x529a('0x7'));router[_0x529a('0x8')]('/',auth['isAuthenticated'](),controller[_0x529a('0x9')]);router[_0x529a('0x8')](_0x529a('0xa'),auth[_0x529a('0xb')](),controller[_0x529a('0xc')]);router[_0x529a('0x8')]('/:id',auth[_0x529a('0xb')](),controller[_0x529a('0xd')]);router[_0x529a('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x529a('0xf'),auth[_0x529a('0xb')](),controller[_0x529a('0x10')]);router['delete']('/:id',auth[_0x529a('0xb')](),controller['destroy']);module[_0x529a('0x11')]=router; \ No newline at end of file +var _0x2c9b=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReport.controller','isAuthenticated','index','get','/describe','show','post','create','put','/:id','update','destroy'];(function(_0x20feae,_0x31e753){var _0x5c3dd2=function(_0x114638){while(--_0x114638){_0x20feae['push'](_0x20feae['shift']());}};_0x5c3dd2(++_0x31e753);}(_0x2c9b,0x141));var _0xb2c9=function(_0x34d15a,_0x2a2853){_0x34d15a=_0x34d15a-0x0;var _0x557a19=_0x2c9b[_0x34d15a];return _0x557a19;};'use strict';var multer=require(_0xb2c9('0x0'));var util=require(_0xb2c9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb2c9('0x2'));var router=express[_0xb2c9('0x3')]();var fs_extra=require(_0xb2c9('0x4'));var auth=require(_0xb2c9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb2c9('0x6'));var controller=require(_0xb2c9('0x7'));router['get']('/',auth[_0xb2c9('0x8')](),controller[_0xb2c9('0x9')]);router[_0xb2c9('0xa')](_0xb2c9('0xb'),auth[_0xb2c9('0x8')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb2c9('0xc')]);router[_0xb2c9('0xd')]('/',auth[_0xb2c9('0x8')](),controller[_0xb2c9('0xe')]);router[_0xb2c9('0xf')](_0xb2c9('0x10'),auth[_0xb2c9('0x8')](),controller[_0xb2c9('0x11')]);router['delete']('/:id',auth[_0xb2c9('0x8')](),controller[_0xb2c9('0x12')]);module[_0xb2c9('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index e4318db..6f4eb50 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 _0x5c51=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x5c51,0x1cb));var _0x15c5=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0x5c51[_0x448f8];return _0xa73126;};'use strict';var Sequelize=require(_0x15c5('0x0'));module[_0x15c5('0x1')]={'network':{'type':Sequelize[_0x15c5('0x2')]},'network_script':{'type':Sequelize[_0x15c5('0x2')]},'request':{'type':Sequelize[_0x15c5('0x2')]},'channel':{'type':Sequelize[_0x15c5('0x2')]},'language':{'type':Sequelize[_0x15c5('0x2')]},'type':{'type':Sequelize[_0x15c5('0x2')]},'uniqueid':{'type':Sequelize[_0x15c5('0x2')]},'version':{'type':Sequelize[_0x15c5('0x2')]},'callerid':{'type':Sequelize[_0x15c5('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x15c5('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x15c5('0x2')]},'rdnis':{'type':Sequelize[_0x15c5('0x2')]},'context':{'type':Sequelize[_0x15c5('0x2')]},'extension':{'type':Sequelize[_0x15c5('0x2')]},'priority':{'type':Sequelize[_0x15c5('0x2')]},'enhanced':{'type':Sequelize[_0x15c5('0x2')]},'accountcode':{'type':Sequelize[_0x15c5('0x2')]},'threadid':{'type':Sequelize[_0x15c5('0x2')]},'project_name':{'type':Sequelize[_0x15c5('0x2')]},'joinAt':{'type':Sequelize[_0x15c5('0x3')]},'leaveAt':{'type':Sequelize[_0x15c5('0x3')]},'bot':{'type':Sequelize[_0x15c5('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x052b=['STRING','DATE','BOOLEAN','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x052b,0x117));var _0xb052=function(_0x214dfa,_0x302b9f){_0x214dfa=_0x214dfa-0x0;var _0xb30951=_0x052b[_0x214dfa];return _0xb30951;};'use strict';var Sequelize=require('sequelize');module[_0xb052('0x0')]={'network':{'type':Sequelize[_0xb052('0x1')]},'network_script':{'type':Sequelize[_0xb052('0x1')]},'request':{'type':Sequelize[_0xb052('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb052('0x1')]},'uniqueid':{'type':Sequelize[_0xb052('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb052('0x1')]},'calleridname':{'type':Sequelize[_0xb052('0x1')]},'callingpres':{'type':Sequelize[_0xb052('0x1')]},'callingani2':{'type':Sequelize[_0xb052('0x1')]},'callington':{'type':Sequelize[_0xb052('0x1')]},'callingtns':{'type':Sequelize[_0xb052('0x1')]},'dnid':{'type':Sequelize[_0xb052('0x1')]},'rdnis':{'type':Sequelize[_0xb052('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xb052('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xb052('0x1')]},'project_name':{'type':Sequelize[_0xb052('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb052('0x2')]},'bot':{'type':Sequelize[_0xb052('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index bfa8ad2..cd2a294 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 _0x7bd0=['model','name','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','SquareReport','findAll','rows','show','keys','length','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x5b94aa,_0x8bf6c0){var _0x1fd610=function(_0x3d2bb7){while(--_0x3d2bb7){_0x5b94aa['push'](_0x5b94aa['shift']());}};_0x1fd610(++_0x8bf6c0);}(_0x7bd0,0x111));var _0x07bd=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x7bd0[_0x3fba9f];return _0x192cf1;};'use strict';var emlformat=require(_0x07bd('0x0'));var rimraf=require(_0x07bd('0x1'));var zipdir=require(_0x07bd('0x2'));var jsonpatch=require(_0x07bd('0x3'));var rp=require(_0x07bd('0x4'));var moment=require(_0x07bd('0x5'));var BPromise=require(_0x07bd('0x6'));var Mustache=require(_0x07bd('0x7'));var util=require('util');var path=require(_0x07bd('0x8'));var sox=require(_0x07bd('0x9'));var csv=require(_0x07bd('0xa'));var ejs=require(_0x07bd('0xb'));var fs=require('fs');var fs_extra=require(_0x07bd('0xc'));var _=require(_0x07bd('0xd'));var squel=require(_0x07bd('0xe'));var crypto=require('crypto');var jsforce=require(_0x07bd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x07bd('0xa'));var querystring=require(_0x07bd('0x10'));var Papa=require(_0x07bd('0x11'));var Redis=require('ioredis');var authService=require(_0x07bd('0x12'));var qs=require(_0x07bd('0x13'));var as=require(_0x07bd('0x14'));var hardwareService=require(_0x07bd('0x15'));var logger=require('../../config/logger')(_0x07bd('0x16'));var utils=require(_0x07bd('0x17'));var config=require(_0x07bd('0x18'));var licenseUtil=require(_0x07bd('0x19'));var db=require(_0x07bd('0x1a'))['db'];function respondWithStatusCode(_0x1eff6c,_0x10aa2e){_0x10aa2e=_0x10aa2e||0xcc;return function(_0x2b8409){if(_0x2b8409){return _0x1eff6c['sendStatus'](_0x10aa2e);}return _0x1eff6c['status'](_0x10aa2e)[_0x07bd('0x1b')]();};}function respondWithResult(_0x3fe523,_0x1c59c2){_0x1c59c2=_0x1c59c2||0xc8;return function(_0x247f3f){if(_0x247f3f){return _0x3fe523[_0x07bd('0x1c')](_0x1c59c2)[_0x07bd('0x1d')](_0x247f3f);}};}function respondWithFilteredResult(_0x2c9166,_0x49d962){return function(_0x418444){if(_0x418444){var _0x505839=typeof _0x49d962[_0x07bd('0x1e')]===_0x07bd('0x1f')&&typeof _0x49d962[_0x07bd('0x20')]===_0x07bd('0x1f');var _0x8aa645=_0x418444['count'];var _0x3f9f0b=_0x505839?0x0:_0x49d962[_0x07bd('0x1e')];var _0x4948f4=_0x505839?_0x418444[_0x07bd('0x21')]:_0x49d962[_0x07bd('0x1e')]+_0x49d962[_0x07bd('0x20')];var _0x2fcc59;if(_0x4948f4>=_0x8aa645){_0x4948f4=_0x8aa645;_0x2fcc59=0xc8;}else{_0x2fcc59=0xce;}_0x2c9166[_0x07bd('0x1c')](_0x2fcc59);return _0x2c9166[_0x07bd('0x22')](_0x07bd('0x23'),_0x3f9f0b+'-'+_0x4948f4+'/'+_0x8aa645)[_0x07bd('0x1d')](_0x418444);}return null;};}function patchUpdates(_0x29a52e){return function(_0x50109f){try{jsonpatch[_0x07bd('0x24')](_0x50109f,_0x29a52e,!![]);}catch(_0x227807){return BPromise[_0x07bd('0x25')](_0x227807);}return _0x50109f[_0x07bd('0x26')]();};}function saveUpdates(_0x16d0e6,_0x47bd50){return function(_0x4c673a){if(_0x4c673a){return _0x4c673a[_0x07bd('0x27')](_0x16d0e6)['then'](function(_0x2b0dee){return _0x2b0dee;});}return null;};}function removeEntity(_0x480c9c,_0x50bd12){return function(_0x4165bc){if(_0x4165bc){return _0x4165bc[_0x07bd('0x28')]()[_0x07bd('0x29')](function(){_0x480c9c[_0x07bd('0x1c')](0xcc)[_0x07bd('0x1b')]();});}};}function handleEntityNotFound(_0x43cbc8,_0x557042){return function(_0x180b43){if(!_0x180b43){_0x43cbc8[_0x07bd('0x2a')](0x194);}return _0x180b43;};}function handleError(_0x3db9d0,_0x2a7202){_0x2a7202=_0x2a7202||0x1f4;return function(_0x12ce26){logger[_0x07bd('0x2b')](_0x12ce26['stack']);if(_0x12ce26['name']){delete _0x12ce26['name'];}_0x3db9d0[_0x07bd('0x1c')](_0x2a7202)[_0x07bd('0x2c')](_0x12ce26);};}exports[_0x07bd('0x2d')]=function(_0x51efa8,_0x1a3aa9){var _0x400cc0={},_0x253dc0={},_0x46ed12={'count':0x0,'rows':[]};var _0x3f9424=_[_0x07bd('0x2e')](db['SquareReport'][_0x07bd('0x2f')],function(_0x20cc94){return{'name':_0x20cc94[_0x07bd('0x30')],'type':_0x20cc94[_0x07bd('0x31')][_0x07bd('0x32')]};});_0x253dc0[_0x07bd('0x33')]=_[_0x07bd('0x2e')](_0x3f9424,_0x07bd('0x34'));_0x253dc0['query']=_['keys'](_0x51efa8[_0x07bd('0x35')]);_0x253dc0[_0x07bd('0x36')]=_[_0x07bd('0x37')](_0x253dc0['model'],_0x253dc0[_0x07bd('0x35')]);_0x400cc0[_0x07bd('0x38')]=_[_0x07bd('0x37')](_0x253dc0['model'],qs['fields'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x39')]));_0x400cc0[_0x07bd('0x38')]=_0x400cc0[_0x07bd('0x38')]['length']?_0x400cc0[_0x07bd('0x38')]:_0x253dc0[_0x07bd('0x33')];if(!_0x51efa8[_0x07bd('0x35')]['hasOwnProperty'](_0x07bd('0x3a'))){_0x400cc0[_0x07bd('0x20')]=qs['limit'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x20')]);_0x400cc0[_0x07bd('0x1e')]=qs[_0x07bd('0x1e')](_0x51efa8['query']['offset']);}_0x400cc0[_0x07bd('0x3b')]=qs['sort'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x3c')]);_0x400cc0[_0x07bd('0x3d')]=qs[_0x07bd('0x36')](_[_0x07bd('0x3e')](_0x51efa8[_0x07bd('0x35')],_0x253dc0[_0x07bd('0x36')]),_0x3f9424);if(_0x51efa8[_0x07bd('0x35')][_0x07bd('0x3f')]){_0x400cc0[_0x07bd('0x3d')]=_[_0x07bd('0x40')](_0x400cc0[_0x07bd('0x3d')],{'$or':_[_0x07bd('0x2e')](_0x3f9424,function(_0x51e8e2){if(_0x51e8e2[_0x07bd('0x31')]!==_0x07bd('0x41')){var _0x220a8e={};_0x220a8e[_0x51e8e2[_0x07bd('0x34')]]={'$like':'%'+_0x51efa8['query'][_0x07bd('0x3f')]+'%'};return _0x220a8e;}})});}_0x400cc0=_[_0x07bd('0x40')]({},_0x400cc0,_0x51efa8[_0x07bd('0x42')]);var _0x408a0a={'where':_0x400cc0[_0x07bd('0x3d')]};return db['SquareReport']['count'](_0x408a0a)[_0x07bd('0x29')](function(_0x88e174){_0x46ed12[_0x07bd('0x21')]=_0x88e174;if(_0x51efa8[_0x07bd('0x35')]['includeAll']){_0x400cc0[_0x07bd('0x43')]=[{'all':!![]}];}return db[_0x07bd('0x44')][_0x07bd('0x45')](_0x400cc0);})[_0x07bd('0x29')](function(_0x318b7c){_0x46ed12[_0x07bd('0x46')]=_0x318b7c;return _0x46ed12;})[_0x07bd('0x29')](respondWithFilteredResult(_0x1a3aa9,_0x400cc0))['catch'](handleError(_0x1a3aa9,null));};exports[_0x07bd('0x47')]=function(_0x7b1042,_0x33389b){var _0x3a5827={'raw':!![],'where':{'id':_0x7b1042['params']['id']}},_0x418f26={};_0x418f26[_0x07bd('0x33')]=_[_0x07bd('0x48')](db[_0x07bd('0x44')][_0x07bd('0x2f')]);_0x418f26[_0x07bd('0x35')]=_['keys'](_0x7b1042[_0x07bd('0x35')]);_0x418f26[_0x07bd('0x36')]=_[_0x07bd('0x37')](_0x418f26[_0x07bd('0x33')],_0x418f26['query']);_0x3a5827['attributes']=_[_0x07bd('0x37')](_0x418f26[_0x07bd('0x33')],qs[_0x07bd('0x39')](_0x7b1042[_0x07bd('0x35')][_0x07bd('0x39')]));_0x3a5827[_0x07bd('0x38')]=_0x3a5827[_0x07bd('0x38')][_0x07bd('0x49')]?_0x3a5827[_0x07bd('0x38')]:_0x418f26['model'];if(_0x7b1042['query'][_0x07bd('0x4a')]){_0x3a5827[_0x07bd('0x43')]=[{'all':!![]}];}_0x3a5827=_[_0x07bd('0x40')]({},_0x3a5827,_0x7b1042[_0x07bd('0x42')]);return db[_0x07bd('0x44')][_0x07bd('0x4b')](_0x3a5827)['then'](handleEntityNotFound(_0x33389b,null))[_0x07bd('0x29')](respondWithResult(_0x33389b,null))[_0x07bd('0x4c')](handleError(_0x33389b,null));};exports[_0x07bd('0x4d')]=function(_0x39823e,_0x7755e2){return db[_0x07bd('0x44')]['create'](_0x39823e[_0x07bd('0x4e')],{})[_0x07bd('0x29')](respondWithResult(_0x7755e2,0xc9))[_0x07bd('0x4c')](handleError(_0x7755e2,null));};exports[_0x07bd('0x27')]=function(_0x1d05ad,_0xc96a7d){if(_0x1d05ad[_0x07bd('0x4e')]['id']){delete _0x1d05ad[_0x07bd('0x4e')]['id'];}return db[_0x07bd('0x44')][_0x07bd('0x4b')]({'where':{'id':_0x1d05ad[_0x07bd('0x4f')]['id']}})[_0x07bd('0x29')](handleEntityNotFound(_0xc96a7d,null))['then'](saveUpdates(_0x1d05ad[_0x07bd('0x4e')],null))[_0x07bd('0x29')](respondWithResult(_0xc96a7d,null))[_0x07bd('0x4c')](handleError(_0xc96a7d,null));};exports['destroy']=function(_0x51c9f4,_0x1e7a6e){return db['SquareReport'][_0x07bd('0x4b')]({'where':{'id':_0x51c9f4[_0x07bd('0x4f')]['id']}})[_0x07bd('0x29')](handleEntityNotFound(_0x1e7a6e,null))[_0x07bd('0x29')](removeEntity(_0x1e7a6e,null))[_0x07bd('0x4c')](handleError(_0x1e7a6e,null));};exports[_0x07bd('0x50')]=function(_0x2cadbb,_0x157eb4){return db['SquareReport'][_0x07bd('0x50')]()[_0x07bd('0x29')](respondWithResult(_0x157eb4,null))[_0x07bd('0x4c')](handleError(_0x157eb4,null));}; \ No newline at end of file +var _0xa30a=['destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','apply','save','update','then','error','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','includeAll','find','body'];(function(_0x2eee62,_0x170242){var _0x26467b=function(_0x8018f){while(--_0x8018f){_0x2eee62['push'](_0x2eee62['shift']());}};_0x26467b(++_0x170242);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec992f,_0x3de2d1){_0x3de2d1=_0x3de2d1||0xcc;return function(_0xcd1d3b){if(_0xcd1d3b){return _0xec992f['sendStatus'](_0x3de2d1);}return _0xec992f[_0xaa30('0x19')](_0x3de2d1)[_0xaa30('0x1a')]();};}function respondWithResult(_0x25c02e,_0x14de74){_0x14de74=_0x14de74||0xc8;return function(_0x41f1d9){if(_0x41f1d9){return _0x25c02e[_0xaa30('0x19')](_0x14de74)[_0xaa30('0x1b')](_0x41f1d9);}};}function respondWithFilteredResult(_0x3b8095,_0x2e37af){return function(_0xfae724){if(_0xfae724){var _0x519518=typeof _0x2e37af[_0xaa30('0x1c')]==='undefined'&&typeof _0x2e37af['limit']===_0xaa30('0x1d');var _0x153939=_0xfae724[_0xaa30('0x1e')];var _0x540e36=_0x519518?0x0:_0x2e37af['offset'];var _0x53f9fd=_0x519518?_0xfae724[_0xaa30('0x1e')]:_0x2e37af['offset']+_0x2e37af[_0xaa30('0x1f')];var _0x332a0a;if(_0x53f9fd>=_0x153939){_0x53f9fd=_0x153939;_0x332a0a=0xc8;}else{_0x332a0a=0xce;}_0x3b8095['status'](_0x332a0a);return _0x3b8095['set']('Content-Range',_0x540e36+'-'+_0x53f9fd+'/'+_0x153939)[_0xaa30('0x1b')](_0xfae724);}return null;};}function patchUpdates(_0x3e4f1d){return function(_0x61b85){try{jsonpatch[_0xaa30('0x20')](_0x61b85,_0x3e4f1d,!![]);}catch(_0x43a526){return BPromise['reject'](_0x43a526);}return _0x61b85[_0xaa30('0x21')]();};}function saveUpdates(_0x24bb25,_0x2e16e7){return function(_0x2d9e35){if(_0x2d9e35){return _0x2d9e35[_0xaa30('0x22')](_0x24bb25)['then'](function(_0x325b42){return _0x325b42;});}return null;};}function removeEntity(_0x13128a,_0x2fecdd){return function(_0x326f84){if(_0x326f84){return _0x326f84['destroy']()[_0xaa30('0x23')](function(){_0x13128a[_0xaa30('0x19')](0xcc)[_0xaa30('0x1a')]();});}};}function handleEntityNotFound(_0x12da2f,_0x97b038){return function(_0x2a59ce){if(!_0x2a59ce){_0x12da2f['sendStatus'](0x194);}return _0x2a59ce;};}function handleError(_0x467850,_0x465701){_0x465701=_0x465701||0x1f4;return function(_0x5d4da8){logger[_0xaa30('0x24')](_0x5d4da8['stack']);if(_0x5d4da8[_0xaa30('0x25')]){delete _0x5d4da8[_0xaa30('0x25')];}_0x467850[_0xaa30('0x19')](_0x465701)[_0xaa30('0x26')](_0x5d4da8);};}exports[_0xaa30('0x27')]=function(_0xc10b8f,_0x6ff09a){var _0x39f708={},_0x1f288c={},_0x43fb30={'count':0x0,'rows':[]};var _0x44aa9b=_[_0xaa30('0x28')](db[_0xaa30('0x29')][_0xaa30('0x2a')],function(_0x40e4ee){return{'name':_0x40e4ee[_0xaa30('0x2b')],'type':_0x40e4ee[_0xaa30('0x2c')][_0xaa30('0x2d')]};});_0x1f288c['model']=_[_0xaa30('0x28')](_0x44aa9b,_0xaa30('0x25'));_0x1f288c[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0xc10b8f[_0xaa30('0x2e')]);_0x1f288c[_0xaa30('0x30')]=_['intersection'](_0x1f288c['model'],_0x1f288c['query']);_0x39f708[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x1f288c[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0xc10b8f[_0xaa30('0x2e')]['fields']));_0x39f708['attributes']=_0x39f708[_0xaa30('0x31')][_0xaa30('0x35')]?_0x39f708['attributes']:_0x1f288c[_0xaa30('0x33')];if(!_0xc10b8f['query'][_0xaa30('0x36')]('nolimit')){_0x39f708[_0xaa30('0x1f')]=qs[_0xaa30('0x1f')](_0xc10b8f['query'][_0xaa30('0x1f')]);_0x39f708[_0xaa30('0x1c')]=qs[_0xaa30('0x1c')](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x1c')]);}_0x39f708[_0xaa30('0x37')]=qs['sort'](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x38')]);_0x39f708['where']=qs[_0xaa30('0x30')](_[_0xaa30('0x39')](_0xc10b8f[_0xaa30('0x2e')],_0x1f288c['filters']),_0x44aa9b);if(_0xc10b8f['query'][_0xaa30('0x3a')]){_0x39f708[_0xaa30('0x3b')]=_[_0xaa30('0x3c')](_0x39f708[_0xaa30('0x3b')],{'$or':_[_0xaa30('0x28')](_0x44aa9b,function(_0x291854){if(_0x291854['type']!=='VIRTUAL'){var _0x120c43={};_0x120c43[_0x291854[_0xaa30('0x25')]]={'$like':'%'+_0xc10b8f[_0xaa30('0x2e')]['filter']+'%'};return _0x120c43;}})});}_0x39f708=_[_0xaa30('0x3c')]({},_0x39f708,_0xc10b8f[_0xaa30('0x3d')]);var _0x8fb95e={'where':_0x39f708[_0xaa30('0x3b')]};return db['SquareReport'][_0xaa30('0x1e')](_0x8fb95e)[_0xaa30('0x23')](function(_0x2c5ddb){_0x43fb30[_0xaa30('0x1e')]=_0x2c5ddb;if(_0xc10b8f[_0xaa30('0x2e')]['includeAll']){_0x39f708[_0xaa30('0x3e')]=[{'all':!![]}];}return db[_0xaa30('0x29')][_0xaa30('0x3f')](_0x39f708);})[_0xaa30('0x23')](function(_0x13f08f){_0x43fb30[_0xaa30('0x40')]=_0x13f08f;return _0x43fb30;})[_0xaa30('0x23')](respondWithFilteredResult(_0x6ff09a,_0x39f708))[_0xaa30('0x41')](handleError(_0x6ff09a,null));};exports['show']=function(_0x59ef25,_0x18771d){var _0x4a170a={'raw':!![],'where':{'id':_0x59ef25['params']['id']}},_0x5208f8={};_0x5208f8[_0xaa30('0x33')]=_['keys'](db[_0xaa30('0x29')]['rawAttributes']);_0x5208f8[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0x59ef25[_0xaa30('0x2e')]);_0x5208f8[_0xaa30('0x30')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],_0x5208f8[_0xaa30('0x2e')]);_0x4a170a[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0x59ef25['query'][_0xaa30('0x34')]));_0x4a170a[_0xaa30('0x31')]=_0x4a170a[_0xaa30('0x31')][_0xaa30('0x35')]?_0x4a170a[_0xaa30('0x31')]:_0x5208f8['model'];if(_0x59ef25['query'][_0xaa30('0x42')]){_0x4a170a['include']=[{'all':!![]}];}_0x4a170a=_[_0xaa30('0x3c')]({},_0x4a170a,_0x59ef25[_0xaa30('0x3d')]);return db[_0xaa30('0x29')][_0xaa30('0x43')](_0x4a170a)[_0xaa30('0x23')](handleEntityNotFound(_0x18771d,null))[_0xaa30('0x23')](respondWithResult(_0x18771d,null))[_0xaa30('0x41')](handleError(_0x18771d,null));};exports['create']=function(_0x3cf0bb,_0x6c9da6){return db[_0xaa30('0x29')]['create'](_0x3cf0bb[_0xaa30('0x44')],{})[_0xaa30('0x23')](respondWithResult(_0x6c9da6,0xc9))['catch'](handleError(_0x6c9da6,null));};exports[_0xaa30('0x22')]=function(_0x4a8fcc,_0x25d227){if(_0x4a8fcc['body']['id']){delete _0x4a8fcc['body']['id'];}return db[_0xaa30('0x29')]['find']({'where':{'id':_0x4a8fcc['params']['id']}})[_0xaa30('0x23')](handleEntityNotFound(_0x25d227,null))[_0xaa30('0x23')](saveUpdates(_0x4a8fcc[_0xaa30('0x44')],null))[_0xaa30('0x23')](respondWithResult(_0x25d227,null))[_0xaa30('0x41')](handleError(_0x25d227,null));};exports[_0xaa30('0x45')]=function(_0x5616cd,_0x17d75d){return db[_0xaa30('0x29')][_0xaa30('0x43')]({'where':{'id':_0x5616cd['params']['id']}})['then'](handleEntityNotFound(_0x17d75d,null))['then'](removeEntity(_0x17d75d,null))['catch'](handleError(_0x17d75d,null));};exports[_0xaa30('0x46')]=function(_0x1ba164,_0xdc32bc){return db[_0xaa30('0x29')][_0xaa30('0x46')]()[_0xaa30('0x23')](respondWithResult(_0xdc32bc,null))['catch'](handleError(_0xdc32bc,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index aa5a4ba..81d788e 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 _0xa467=['uid_pname','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareReport','report_square'];(function(_0x48e0e4,_0x112c32){var _0x1658e3=function(_0x50da2f){while(--_0x50da2f){_0x48e0e4['push'](_0x48e0e4['shift']());}};_0x1658e3(++_0x112c32);}(_0xa467,0x19b));var _0x7a46=function(_0x11bccb,_0xe4e019){_0x11bccb=_0x11bccb-0x0;var _0x1e36e2=_0xa467[_0x11bccb];return _0x1e36e2;};'use strict';var _=require(_0x7a46('0x0'));var util=require(_0x7a46('0x1'));var logger=require(_0x7a46('0x2'))(_0x7a46('0x3'));var moment=require(_0x7a46('0x4'));var BPromise=require(_0x7a46('0x5'));var rp=require(_0x7a46('0x6'));var fs=require('fs');var path=require(_0x7a46('0x7'));var rimraf=require(_0x7a46('0x8'));var config=require(_0x7a46('0x9'));var attributes=require('./squareReport.attributes');module[_0x7a46('0xa')]=function(_0x253812,_0x164ff9){return _0x253812[_0x7a46('0xb')](_0x7a46('0xc'),attributes,{'tableName':_0x7a46('0xd'),'paranoid':![],'indexes':[{'name':_0x7a46('0xe'),'fields':['uniqueid',_0x7a46('0xf')]},{'name':_0x7a46('0x10'),'fields':[_0x7a46('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd5f2=['leaveAt','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./squareReport.attributes','define','SquareReport','report_square','uid_pname'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd5f2,0xb7));var _0x2d5f=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xd5f2[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0x2d5f('0x0'));var util=require(_0x2d5f('0x1'));var logger=require(_0x2d5f('0x2'))(_0x2d5f('0x3'));var moment=require(_0x2d5f('0x4'));var BPromise=require('bluebird');var rp=require(_0x2d5f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d5f('0x6'));var config=require('../../config/environment');var attributes=require(_0x2d5f('0x7'));module['exports']=function(_0x15dce2,_0x3880fc){return _0x15dce2[_0x2d5f('0x8')](_0x2d5f('0x9'),attributes,{'tableName':_0x2d5f('0xa'),'paranoid':![],'indexes':[{'name':_0x2d5f('0xb'),'fields':['uniqueid','project_name']},{'name':_0x2d5f('0xc'),'fields':[_0x2d5f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 1783d54..ca987cd 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 _0x55ca=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareReport','SquareReport','create','body','options','update','raw','where','limit','UpdateSquareReport','lodash','util','ioredis'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x55ca,0x126));var _0xa55c=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x55ca[_0x3e5086];return _0xfeb102;};'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')]('SquareReport,\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')]('SquareReport,\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')](_0x24783b[_0xa55c('0x1a')],{'raw':_0x24783b[_0xa55c('0x1b')]?_0x24783b['options']['raw']===undefined?!![]:![]:!![]})[_0xa55c('0xb')](function(_0x3776ac){logger[_0xa55c('0x14')]('CreateSquareReport',_0x24783b);logger[_0xa55c('0xe')](_0xa55c('0x17'),_0x24783b,JSON['stringify'](_0x3776ac));_0x3d4c9e(_0x3776ac);})[_0xa55c('0x16')](function(_0x133096){logger[_0xa55c('0x11')](_0xa55c('0x17'),_0x133096[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c['error'](0x1f4,_0x133096[_0xa55c('0x13')]));});});};exports['UpdateSquareReport']=function(_0x5ba836){var _0x59d89a=this;return new Promise(function(_0x19ae88,_0x54b038){return db[_0xa55c('0x18')][_0xa55c('0x1c')](_0x5ba836[_0xa55c('0x1a')],{'raw':_0x5ba836[_0xa55c('0x1b')]?_0x5ba836[_0xa55c('0x1b')][_0xa55c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ba836[_0xa55c('0x1b')]?_0x5ba836[_0xa55c('0x1b')][_0xa55c('0x1e')]||null:null,'attributes':_0x5ba836[_0xa55c('0x1b')]?_0x5ba836[_0xa55c('0x1b')]['attributes']||null:null,'limit':_0x5ba836[_0xa55c('0x1b')]?_0x5ba836[_0xa55c('0x1b')][_0xa55c('0x1f')]||null:null})[_0xa55c('0xb')](function(_0x5d940d){logger[_0xa55c('0x14')](_0xa55c('0x20'),_0x5ba836);logger[_0xa55c('0xe')](_0xa55c('0x20'),_0x5ba836,JSON[_0xa55c('0x10')](_0x5d940d));_0x19ae88(_0x5d940d);})[_0xa55c('0x16')](function(_0x52d37f){logger[_0xa55c('0x11')]('UpdateSquareReport',_0x52d37f[_0xa55c('0x13')],_0x5ba836);_0x54b038(_0x59d89a[_0xa55c('0x11')](0x1f4,_0x52d37f[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _0x7fbe=['stringify','error','code','message','result','catch','SquareReport','create','options','raw','CreateSquareReport','update','where','limit','info','UpdateSquareReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x299721,_0x2f27c4){_0x299721=_0x299721-0x0;var _0x50a594=_0x7fbe[_0x299721];return _0x50a594;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}exports['CreateSquareReport']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')](_0x293a47['body'],{'raw':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x15f7a4){logger['info'](_0xe7fb('0x1c'),_0x293a47);logger[_0xe7fb('0x10')]('CreateSquareReport',_0x293a47,JSON[_0xe7fb('0x12')](_0x15f7a4));_0x1e77fd(_0x15f7a4);})[_0xe7fb('0x17')](function(_0x3ae8f1){logger['error'](_0xe7fb('0x1c'),_0x3ae8f1[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463['error'](0x1f4,_0x3ae8f1['message']));});});};exports['UpdateSquareReport']=function(_0x35e4db){var _0x53c43a=this;return new Promise(function(_0x49b219,_0x4026b1){return db[_0xe7fb('0x18')][_0xe7fb('0x1d')](_0x35e4db['body'],{'raw':_0x35e4db[_0xe7fb('0x1a')]?_0x35e4db[_0xe7fb('0x1a')][_0xe7fb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35e4db[_0xe7fb('0x1a')]?_0x35e4db[_0xe7fb('0x1a')][_0xe7fb('0x1e')]||null:null,'attributes':_0x35e4db[_0xe7fb('0x1a')]?_0x35e4db['options']['attributes']||null:null,'limit':_0x35e4db[_0xe7fb('0x1a')]?_0x35e4db[_0xe7fb('0x1a')][_0xe7fb('0x1f')]||null:null})['then'](function(_0xb1f2f4){logger[_0xe7fb('0x20')](_0xe7fb('0x21'),_0x35e4db);logger[_0xe7fb('0x10')](_0xe7fb('0x21'),_0x35e4db,JSON[_0xe7fb('0x12')](_0xb1f2f4));_0x49b219(_0xb1f2f4);})[_0xe7fb('0x17')](function(_0x3dd0be){logger['error'](_0xe7fb('0x21'),_0x3dd0be[_0xe7fb('0x15')],_0x35e4db);_0x4026b1(_0x53c43a[_0xe7fb('0x13')](0x1f4,_0x3dd0be['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index ad2ab8d..dabc315 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 _0xfc22=['fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','path','connect-timeout','Router'];(function(_0x469850,_0x3357a1){var _0x326907=function(_0x2e0cde){while(--_0x2e0cde){_0x469850['push'](_0x469850['shift']());}};_0x326907(++_0x3357a1);}(_0xfc22,0x13d));var _0x2fc2=function(_0x3e33b5,_0x55b234){_0x3e33b5=_0x3e33b5-0x0;var _0x5787f7=_0xfc22[_0x3e33b5];return _0x5787f7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2fc2('0x0'));var timeout=require(_0x2fc2('0x1'));var express=require('express');var router=express[_0x2fc2('0x2')]();var fs_extra=require(_0x2fc2('0x3'));var auth=require(_0x2fc2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2fc2('0x5'));var controller=require(_0x2fc2('0x6'));router[_0x2fc2('0x7')]('/',auth[_0x2fc2('0x8')](),controller[_0x2fc2('0x9')]);router[_0x2fc2('0x7')](_0x2fc2('0xa'),auth[_0x2fc2('0x8')](),controller[_0x2fc2('0xb')]);router['get'](_0x2fc2('0xc'),auth[_0x2fc2('0x8')](),controller[_0x2fc2('0xd')]);router[_0x2fc2('0xe')]('/',auth[_0x2fc2('0x8')](),controller[_0x2fc2('0xf')]);router['put'](_0x2fc2('0xc'),auth[_0x2fc2('0x8')](),controller[_0x2fc2('0x10')]);router[_0x2fc2('0x11')](_0x2fc2('0xc'),auth[_0x2fc2('0x8')](),controller[_0x2fc2('0x12')]);module[_0x2fc2('0x13')]=router; \ No newline at end of file +var _0x2baf=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','delete','exports','util','path'];(function(_0x581152,_0x5b383c){var _0x478434=function(_0x138374){while(--_0x138374){_0x581152['push'](_0x581152['shift']());}};_0x478434(++_0x5b383c);}(_0x2baf,0xbc));var _0xf2ba=function(_0x38ce4c,_0xfdbe8c){_0x38ce4c=_0x38ce4c-0x0;var _0x5d4544=_0x2baf[_0x38ce4c];return _0x5d4544;};'use strict';var multer=require('multer');var util=require(_0xf2ba('0x0'));var path=require(_0xf2ba('0x1'));var timeout=require(_0xf2ba('0x2'));var express=require(_0xf2ba('0x3'));var router=express[_0xf2ba('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf2ba('0x5'));var interaction=require(_0xf2ba('0x6'));var config=require(_0xf2ba('0x7'));var controller=require(_0xf2ba('0x8'));router[_0xf2ba('0x9')]('/',auth[_0xf2ba('0xa')](),controller[_0xf2ba('0xb')]);router[_0xf2ba('0x9')](_0xf2ba('0xc'),auth[_0xf2ba('0xa')](),controller['describe']);router[_0xf2ba('0x9')](_0xf2ba('0xd'),auth[_0xf2ba('0xa')](),controller['show']);router[_0xf2ba('0xe')]('/',auth[_0xf2ba('0xa')](),controller[_0xf2ba('0xf')]);router['put'](_0xf2ba('0xd'),auth['isAuthenticated'](),controller[_0xf2ba('0x10')]);router[_0xf2ba('0x11')](_0xf2ba('0xd'),auth[_0xf2ba('0xa')](),controller['destroy']);module[_0xf2ba('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index cd3d21e..7f7f37c 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 _0x1bdf=['sequelize','exports','STRING','TEXT'];(function(_0x3b1efb,_0x505b7e){var _0x56db82=function(_0x18123e){while(--_0x18123e){_0x3b1efb['push'](_0x3b1efb['shift']());}};_0x56db82(++_0x505b7e);}(_0x1bdf,0x90));var _0xf1bd=function(_0x58f7d5,_0x589856){_0x58f7d5=_0x58f7d5-0x0;var _0x4df35b=_0x1bdf[_0x58f7d5];return _0x4df35b;};'use strict';var Sequelize=require(_0xf1bd('0x0'));module[_0xf1bd('0x1')]={'uniqueid':{'type':Sequelize[_0xf1bd('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xf1bd('0x3')]},'project_name':{'type':Sequelize[_0xf1bd('0x2')]},'callerid':{'type':Sequelize[_0xf1bd('0x2')]}}; \ No newline at end of file +var _0x2a28=['exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a28,0xf6));var _0x82a2=function(_0x17a9fd,_0x11d581){_0x17a9fd=_0x17a9fd-0x0;var _0x59ce89=_0x2a28[_0x17a9fd];return _0x59ce89;};'use strict';var Sequelize=require('sequelize');module[_0x82a2('0x0')]={'uniqueid':{'type':Sequelize[_0x82a2('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x82a2('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x82a2('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index ae8962c..ab09a64 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 _0x7d4d=['index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','findAll','show','keys','includeAll','options','catch','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','name','send'];(function(_0x37785e,_0x114d42){var _0x27aa58=function(_0x5b61b0){while(--_0x5b61b0){_0x37785e['push'](_0x37785e['shift']());}};_0x27aa58(++_0x114d42);}(_0x7d4d,0x188));var _0xd7d4=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x7d4d[_0x8b8564];return _0x360c61;};'use strict';var emlformat=require(_0xd7d4('0x0'));var rimraf=require(_0xd7d4('0x1'));var zipdir=require(_0xd7d4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd7d4('0x3'));var BPromise=require(_0xd7d4('0x4'));var Mustache=require(_0xd7d4('0x5'));var util=require('util');var path=require(_0xd7d4('0x6'));var sox=require(_0xd7d4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd7d4('0x8'));var crypto=require(_0xd7d4('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xd7d4('0xa'));var toCsv=require(_0xd7d4('0xb'));var querystring=require(_0xd7d4('0xc'));var Papa=require(_0xd7d4('0xd'));var Redis=require(_0xd7d4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd7d4('0xf'));var as=require(_0xd7d4('0x10'));var hardwareService=require(_0xd7d4('0x11'));var logger=require(_0xd7d4('0x12'))('api');var utils=require(_0xd7d4('0x13'));var config=require(_0xd7d4('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd7d4('0x15'))['db'];function respondWithStatusCode(_0x3f2938,_0x14167f){_0x14167f=_0x14167f||0xcc;return function(_0x4d482c){if(_0x4d482c){return _0x3f2938[_0xd7d4('0x16')](_0x14167f);}return _0x3f2938[_0xd7d4('0x17')](_0x14167f)[_0xd7d4('0x18')]();};}function respondWithResult(_0x265f83,_0x152236){_0x152236=_0x152236||0xc8;return function(_0x409e4b){if(_0x409e4b){return _0x265f83['status'](_0x152236)['json'](_0x409e4b);}};}function respondWithFilteredResult(_0x28d288,_0xd6a0a7){return function(_0x2652dd){if(_0x2652dd){var _0x5b4390=typeof _0xd6a0a7[_0xd7d4('0x19')]===_0xd7d4('0x1a')&&typeof _0xd6a0a7[_0xd7d4('0x1b')]==='undefined';var _0x52814b=_0x2652dd[_0xd7d4('0x1c')];var _0x223d96=_0x5b4390?0x0:_0xd6a0a7['offset'];var _0x143ba7=_0x5b4390?_0x2652dd[_0xd7d4('0x1c')]:_0xd6a0a7['offset']+_0xd6a0a7[_0xd7d4('0x1b')];var _0x4f216b;if(_0x143ba7>=_0x52814b){_0x143ba7=_0x52814b;_0x4f216b=0xc8;}else{_0x4f216b=0xce;}_0x28d288[_0xd7d4('0x17')](_0x4f216b);return _0x28d288[_0xd7d4('0x1d')](_0xd7d4('0x1e'),_0x223d96+'-'+_0x143ba7+'/'+_0x52814b)[_0xd7d4('0x1f')](_0x2652dd);}return null;};}function patchUpdates(_0x489154){return function(_0x10b9b5){try{jsonpatch[_0xd7d4('0x20')](_0x10b9b5,_0x489154,!![]);}catch(_0x1cc441){return BPromise[_0xd7d4('0x21')](_0x1cc441);}return _0x10b9b5[_0xd7d4('0x22')]();};}function saveUpdates(_0x3fc267,_0x2c7ab0){return function(_0x3004e4){if(_0x3004e4){return _0x3004e4[_0xd7d4('0x23')](_0x3fc267)['then'](function(_0x20d5e4){return _0x20d5e4;});}return null;};}function removeEntity(_0x13abf5,_0x299863){return function(_0x55a7b2){if(_0x55a7b2){return _0x55a7b2['destroy']()[_0xd7d4('0x24')](function(){_0x13abf5[_0xd7d4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1863a0,_0x4cb990){return function(_0x1b9160){if(!_0x1b9160){_0x1863a0[_0xd7d4('0x16')](0x194);}return _0x1b9160;};}function handleError(_0x2f5d05,_0x450448){_0x450448=_0x450448||0x1f4;return function(_0x5dcfc8){logger[_0xd7d4('0x25')](_0x5dcfc8['stack']);if(_0x5dcfc8[_0xd7d4('0x26')]){delete _0x5dcfc8[_0xd7d4('0x26')];}_0x2f5d05[_0xd7d4('0x17')](_0x450448)[_0xd7d4('0x27')](_0x5dcfc8);};}exports[_0xd7d4('0x28')]=function(_0x1d818f,_0x4c64af){var _0x4f96db={},_0x347274={},_0x231f10={'count':0x0,'rows':[]};var _0x4a778c=_[_0xd7d4('0x29')](db[_0xd7d4('0x2a')][_0xd7d4('0x2b')],function(_0x245b48){return{'name':_0x245b48[_0xd7d4('0x2c')],'type':_0x245b48[_0xd7d4('0x2d')][_0xd7d4('0x2e')]};});_0x347274[_0xd7d4('0x2f')]=_['map'](_0x4a778c,_0xd7d4('0x26'));_0x347274[_0xd7d4('0x30')]=_['keys'](_0x1d818f[_0xd7d4('0x30')]);_0x347274['filters']=_[_0xd7d4('0x31')](_0x347274[_0xd7d4('0x2f')],_0x347274[_0xd7d4('0x30')]);_0x4f96db[_0xd7d4('0x32')]=_[_0xd7d4('0x31')](_0x347274[_0xd7d4('0x2f')],qs['fields'](_0x1d818f[_0xd7d4('0x30')][_0xd7d4('0x33')]));_0x4f96db['attributes']=_0x4f96db[_0xd7d4('0x32')]['length']?_0x4f96db['attributes']:_0x347274[_0xd7d4('0x2f')];if(!_0x1d818f[_0xd7d4('0x30')][_0xd7d4('0x34')](_0xd7d4('0x35'))){_0x4f96db['limit']=qs[_0xd7d4('0x1b')](_0x1d818f[_0xd7d4('0x30')][_0xd7d4('0x1b')]);_0x4f96db[_0xd7d4('0x19')]=qs[_0xd7d4('0x19')](_0x1d818f[_0xd7d4('0x30')][_0xd7d4('0x19')]);}_0x4f96db['order']=qs['sort'](_0x1d818f['query'][_0xd7d4('0x36')]);_0x4f96db['where']=qs[_0xd7d4('0x37')](_[_0xd7d4('0x38')](_0x1d818f['query'],_0x347274[_0xd7d4('0x37')]),_0x4a778c);if(_0x1d818f[_0xd7d4('0x30')][_0xd7d4('0x39')]){_0x4f96db[_0xd7d4('0x3a')]=_[_0xd7d4('0x3b')](_0x4f96db[_0xd7d4('0x3a')],{'$or':_['map'](_0x4a778c,function(_0x39b4f9){if(_0x39b4f9[_0xd7d4('0x2d')]!==_0xd7d4('0x3c')){var _0x3c3d6e={};_0x3c3d6e[_0x39b4f9[_0xd7d4('0x26')]]={'$like':'%'+_0x1d818f[_0xd7d4('0x30')]['filter']+'%'};return _0x3c3d6e;}})});}_0x4f96db=_[_0xd7d4('0x3b')]({},_0x4f96db,_0x1d818f['options']);var _0x508289={'where':_0x4f96db[_0xd7d4('0x3a')]};return db[_0xd7d4('0x2a')][_0xd7d4('0x1c')](_0x508289)[_0xd7d4('0x24')](function(_0x1dc789){_0x231f10[_0xd7d4('0x1c')]=_0x1dc789;if(_0x1d818f[_0xd7d4('0x30')]['includeAll']){_0x4f96db['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0xd7d4('0x3d')](_0x4f96db);})['then'](function(_0x1766be){_0x231f10['rows']=_0x1766be;return _0x231f10;})[_0xd7d4('0x24')](respondWithFilteredResult(_0x4c64af,_0x4f96db))['catch'](handleError(_0x4c64af,null));};exports[_0xd7d4('0x3e')]=function(_0x33ac03,_0x1657b0){var _0x204995={'raw':!![],'where':{'id':_0x33ac03['params']['id']}},_0x1e40fb={};_0x1e40fb[_0xd7d4('0x2f')]=_[_0xd7d4('0x3f')](db[_0xd7d4('0x2a')][_0xd7d4('0x2b')]);_0x1e40fb[_0xd7d4('0x30')]=_[_0xd7d4('0x3f')](_0x33ac03[_0xd7d4('0x30')]);_0x1e40fb['filters']=_[_0xd7d4('0x31')](_0x1e40fb[_0xd7d4('0x2f')],_0x1e40fb['query']);_0x204995['attributes']=_[_0xd7d4('0x31')](_0x1e40fb['model'],qs[_0xd7d4('0x33')](_0x33ac03[_0xd7d4('0x30')]['fields']));_0x204995['attributes']=_0x204995[_0xd7d4('0x32')]['length']?_0x204995['attributes']:_0x1e40fb[_0xd7d4('0x2f')];if(_0x33ac03[_0xd7d4('0x30')][_0xd7d4('0x40')]){_0x204995['include']=[{'all':!![]}];}_0x204995=_[_0xd7d4('0x3b')]({},_0x204995,_0x33ac03[_0xd7d4('0x41')]);return db['SquareDetailsReport']['find'](_0x204995)['then'](handleEntityNotFound(_0x1657b0,null))['then'](respondWithResult(_0x1657b0,null))[_0xd7d4('0x42')](handleError(_0x1657b0,null));};exports[_0xd7d4('0x43')]=function(_0x13ce63,_0x31d21f){return db[_0xd7d4('0x2a')][_0xd7d4('0x43')](_0x13ce63['body'],{})[_0xd7d4('0x24')](respondWithResult(_0x31d21f,0xc9))[_0xd7d4('0x42')](handleError(_0x31d21f,null));};exports[_0xd7d4('0x23')]=function(_0x3cbbad,_0x370e35){if(_0x3cbbad[_0xd7d4('0x44')]['id']){delete _0x3cbbad[_0xd7d4('0x44')]['id'];}return db[_0xd7d4('0x2a')]['find']({'where':{'id':_0x3cbbad[_0xd7d4('0x45')]['id']}})[_0xd7d4('0x24')](handleEntityNotFound(_0x370e35,null))[_0xd7d4('0x24')](saveUpdates(_0x3cbbad[_0xd7d4('0x44')],null))[_0xd7d4('0x24')](respondWithResult(_0x370e35,null))[_0xd7d4('0x42')](handleError(_0x370e35,null));};exports[_0xd7d4('0x46')]=function(_0x2b5b40,_0x471b8c){return db[_0xd7d4('0x2a')]['find']({'where':{'id':_0x2b5b40[_0xd7d4('0x45')]['id']}})[_0xd7d4('0x24')](handleEntityNotFound(_0x471b8c,null))[_0xd7d4('0x24')](removeEntity(_0x471b8c,null))[_0xd7d4('0x42')](handleError(_0x471b8c,null));};exports[_0xd7d4('0x47')]=function(_0x334de2,_0x33ba7b){return db[_0xd7d4('0x2a')]['describe']()['then'](respondWithResult(_0x33ba7b,null))[_0xd7d4('0x42')](handleError(_0x33ba7b,null));}; \ No newline at end of file +var _0x27ac=['where','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','describe','rimraf','fast-json-patch','request-promise','util','path','sox','lodash','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','SquareDetailsReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort'];(function(_0x18b176,_0x3a4ffb){var _0x4a0d26=function(_0x2e2b89){while(--_0x2e2b89){_0x18b176['push'](_0x18b176['shift']());}};_0x4a0d26(++_0x3a4ffb);}(_0x27ac,0x112));var _0xc27a=function(_0x2fa2d6,_0x5d7dc8){_0x2fa2d6=_0x2fa2d6-0x0;var _0x3eb8ab=_0x27ac[_0x2fa2d6];return _0x3eb8ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc27a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc27a('0x1'));var rp=require(_0xc27a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc27a('0x3'));var path=require(_0xc27a('0x4'));var sox=require(_0xc27a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc27a('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc27a('0x7'));var querystring=require(_0xc27a('0x8'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc27a('0x9'));var qs=require(_0xc27a('0xa'));var as=require(_0xc27a('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc27a('0xc'))(_0xc27a('0xd'));var utils=require(_0xc27a('0xe'));var config=require(_0xc27a('0xf'));var licenseUtil=require(_0xc27a('0x10'));var db=require(_0xc27a('0x11'))['db'];function respondWithStatusCode(_0x7e1f5d,_0x437846){_0x437846=_0x437846||0xcc;return function(_0x37bb57){if(_0x37bb57){return _0x7e1f5d[_0xc27a('0x12')](_0x437846);}return _0x7e1f5d[_0xc27a('0x13')](_0x437846)['end']();};}function respondWithResult(_0x52515c,_0x1dcc67){_0x1dcc67=_0x1dcc67||0xc8;return function(_0x46c95f){if(_0x46c95f){return _0x52515c[_0xc27a('0x13')](_0x1dcc67)[_0xc27a('0x14')](_0x46c95f);}};}function respondWithFilteredResult(_0x338d56,_0x4c4aae){return function(_0x342ee6){if(_0x342ee6){var _0x464e84=typeof _0x4c4aae['offset']===_0xc27a('0x15')&&typeof _0x4c4aae['limit']===_0xc27a('0x15');var _0x189ae5=_0x342ee6[_0xc27a('0x16')];var _0x22c5dd=_0x464e84?0x0:_0x4c4aae[_0xc27a('0x17')];var _0x215de9=_0x464e84?_0x342ee6['count']:_0x4c4aae['offset']+_0x4c4aae[_0xc27a('0x18')];var _0x4f2a88;if(_0x215de9>=_0x189ae5){_0x215de9=_0x189ae5;_0x4f2a88=0xc8;}else{_0x4f2a88=0xce;}_0x338d56[_0xc27a('0x13')](_0x4f2a88);return _0x338d56['set'](_0xc27a('0x19'),_0x22c5dd+'-'+_0x215de9+'/'+_0x189ae5)['json'](_0x342ee6);}return null;};}function patchUpdates(_0x381787){return function(_0x435672){try{jsonpatch[_0xc27a('0x1a')](_0x435672,_0x381787,!![]);}catch(_0x305880){return BPromise[_0xc27a('0x1b')](_0x305880);}return _0x435672[_0xc27a('0x1c')]();};}function saveUpdates(_0x1db294,_0x452510){return function(_0x586887){if(_0x586887){return _0x586887[_0xc27a('0x1d')](_0x1db294)[_0xc27a('0x1e')](function(_0x2c2e60){return _0x2c2e60;});}return null;};}function removeEntity(_0x599897,_0x38a4f8){return function(_0x5aee02){if(_0x5aee02){return _0x5aee02[_0xc27a('0x1f')]()[_0xc27a('0x1e')](function(){_0x599897['status'](0xcc)[_0xc27a('0x20')]();});}};}function handleEntityNotFound(_0x2d8989,_0x187546){return function(_0x5d01e4){if(!_0x5d01e4){_0x2d8989['sendStatus'](0x194);}return _0x5d01e4;};}function handleError(_0x28a2b4,_0x303d44){_0x303d44=_0x303d44||0x1f4;return function(_0x41c2f3){logger['error'](_0x41c2f3[_0xc27a('0x21')]);if(_0x41c2f3[_0xc27a('0x22')]){delete _0x41c2f3[_0xc27a('0x22')];}_0x28a2b4[_0xc27a('0x13')](_0x303d44)[_0xc27a('0x23')](_0x41c2f3);};}exports['index']=function(_0x661e96,_0x7d7a2c){var _0x5935e5={},_0x3f65f5={},_0x4cdf94={'count':0x0,'rows':[]};var _0x27ed3a=_['map'](db[_0xc27a('0x24')][_0xc27a('0x25')],function(_0x5373f1){return{'name':_0x5373f1[_0xc27a('0x26')],'type':_0x5373f1[_0xc27a('0x27')]['key']};});_0x3f65f5[_0xc27a('0x28')]=_[_0xc27a('0x29')](_0x27ed3a,_0xc27a('0x22'));_0x3f65f5[_0xc27a('0x2a')]=_[_0xc27a('0x2b')](_0x661e96[_0xc27a('0x2a')]);_0x3f65f5[_0xc27a('0x2c')]=_[_0xc27a('0x2d')](_0x3f65f5['model'],_0x3f65f5[_0xc27a('0x2a')]);_0x5935e5[_0xc27a('0x2e')]=_[_0xc27a('0x2d')](_0x3f65f5[_0xc27a('0x28')],qs[_0xc27a('0x2f')](_0x661e96['query'][_0xc27a('0x2f')]));_0x5935e5['attributes']=_0x5935e5[_0xc27a('0x2e')][_0xc27a('0x30')]?_0x5935e5[_0xc27a('0x2e')]:_0x3f65f5['model'];if(!_0x661e96[_0xc27a('0x2a')]['hasOwnProperty']('nolimit')){_0x5935e5[_0xc27a('0x18')]=qs['limit'](_0x661e96['query']['limit']);_0x5935e5['offset']=qs[_0xc27a('0x17')](_0x661e96[_0xc27a('0x2a')][_0xc27a('0x17')]);}_0x5935e5[_0xc27a('0x31')]=qs[_0xc27a('0x32')](_0x661e96[_0xc27a('0x2a')]['sort']);_0x5935e5[_0xc27a('0x33')]=qs[_0xc27a('0x2c')](_['pick'](_0x661e96[_0xc27a('0x2a')],_0x3f65f5[_0xc27a('0x2c')]),_0x27ed3a);if(_0x661e96[_0xc27a('0x2a')][_0xc27a('0x34')]){_0x5935e5[_0xc27a('0x33')]=_['merge'](_0x5935e5['where'],{'$or':_[_0xc27a('0x29')](_0x27ed3a,function(_0xed7630){if(_0xed7630[_0xc27a('0x27')]!==_0xc27a('0x35')){var _0x2c2e9d={};_0x2c2e9d[_0xed7630['name']]={'$like':'%'+_0x661e96['query']['filter']+'%'};return _0x2c2e9d;}})});}_0x5935e5=_[_0xc27a('0x36')]({},_0x5935e5,_0x661e96[_0xc27a('0x37')]);var _0x53df53={'where':_0x5935e5[_0xc27a('0x33')]};return db[_0xc27a('0x24')][_0xc27a('0x16')](_0x53df53)[_0xc27a('0x1e')](function(_0x2cf754){_0x4cdf94['count']=_0x2cf754;if(_0x661e96[_0xc27a('0x2a')][_0xc27a('0x38')]){_0x5935e5[_0xc27a('0x39')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x5935e5);})[_0xc27a('0x1e')](function(_0x24f6d1){_0x4cdf94['rows']=_0x24f6d1;return _0x4cdf94;})[_0xc27a('0x1e')](respondWithFilteredResult(_0x7d7a2c,_0x5935e5))[_0xc27a('0x3a')](handleError(_0x7d7a2c,null));};exports[_0xc27a('0x3b')]=function(_0x3a11e1,_0x8fe041){var _0x585a98={'raw':!![],'where':{'id':_0x3a11e1[_0xc27a('0x3c')]['id']}},_0x40af5b={};_0x40af5b[_0xc27a('0x28')]=_[_0xc27a('0x2b')](db[_0xc27a('0x24')][_0xc27a('0x25')]);_0x40af5b[_0xc27a('0x2a')]=_['keys'](_0x3a11e1[_0xc27a('0x2a')]);_0x40af5b[_0xc27a('0x2c')]=_[_0xc27a('0x2d')](_0x40af5b[_0xc27a('0x28')],_0x40af5b[_0xc27a('0x2a')]);_0x585a98[_0xc27a('0x2e')]=_[_0xc27a('0x2d')](_0x40af5b[_0xc27a('0x28')],qs[_0xc27a('0x2f')](_0x3a11e1[_0xc27a('0x2a')]['fields']));_0x585a98['attributes']=_0x585a98[_0xc27a('0x2e')][_0xc27a('0x30')]?_0x585a98[_0xc27a('0x2e')]:_0x40af5b[_0xc27a('0x28')];if(_0x3a11e1[_0xc27a('0x2a')]['includeAll']){_0x585a98['include']=[{'all':!![]}];}_0x585a98=_[_0xc27a('0x36')]({},_0x585a98,_0x3a11e1['options']);return db[_0xc27a('0x24')][_0xc27a('0x3d')](_0x585a98)[_0xc27a('0x1e')](handleEntityNotFound(_0x8fe041,null))[_0xc27a('0x1e')](respondWithResult(_0x8fe041,null))['catch'](handleError(_0x8fe041,null));};exports[_0xc27a('0x3e')]=function(_0x1ff71f,_0x395c37){return db[_0xc27a('0x24')]['create'](_0x1ff71f[_0xc27a('0x3f')],{})[_0xc27a('0x1e')](respondWithResult(_0x395c37,0xc9))[_0xc27a('0x3a')](handleError(_0x395c37,null));};exports[_0xc27a('0x1d')]=function(_0x56bb26,_0x61d19f){if(_0x56bb26[_0xc27a('0x3f')]['id']){delete _0x56bb26[_0xc27a('0x3f')]['id'];}return db[_0xc27a('0x24')][_0xc27a('0x3d')]({'where':{'id':_0x56bb26['params']['id']}})[_0xc27a('0x1e')](handleEntityNotFound(_0x61d19f,null))[_0xc27a('0x1e')](saveUpdates(_0x56bb26[_0xc27a('0x3f')],null))['then'](respondWithResult(_0x61d19f,null))['catch'](handleError(_0x61d19f,null));};exports[_0xc27a('0x1f')]=function(_0x3bcf65,_0x4b8e0b){return db[_0xc27a('0x24')]['find']({'where':{'id':_0x3bcf65[_0xc27a('0x3c')]['id']}})[_0xc27a('0x1e')](handleEntityNotFound(_0x4b8e0b,null))[_0xc27a('0x1e')](removeEntity(_0x4b8e0b,null))[_0xc27a('0x3a')](handleError(_0x4b8e0b,null));};exports[_0xc27a('0x40')]=function(_0x473821,_0x42c8e7){return db[_0xc27a('0x24')][_0xc27a('0x40')]()[_0xc27a('0x1e')](respondWithResult(_0x42c8e7,null))[_0xc27a('0x3a')](handleError(_0x42c8e7,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 0b6da95..b2579c5 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 _0xd2ae=['SquareDetailsReport','report_square_details','util','../../config/logger','moment','request-promise','path','rimraf','./squareReportDetail.attributes','exports','define'];(function(_0x5e58b2,_0x1b7ed4){var _0x4facd0=function(_0x58d136){while(--_0x58d136){_0x5e58b2['push'](_0x5e58b2['shift']());}};_0x4facd0(++_0x1b7ed4);}(_0xd2ae,0x91));var _0xed2a=function(_0x90a2a2,_0x535804){_0x90a2a2=_0x90a2a2-0x0;var _0x2b848b=_0xd2ae[_0x90a2a2];return _0x2b848b;};'use strict';var _=require('lodash');var util=require(_0xed2a('0x0'));var logger=require(_0xed2a('0x1'))('api');var moment=require(_0xed2a('0x2'));var BPromise=require('bluebird');var rp=require(_0xed2a('0x3'));var fs=require('fs');var path=require(_0xed2a('0x4'));var rimraf=require(_0xed2a('0x5'));var config=require('../../config/environment');var attributes=require(_0xed2a('0x6'));module[_0xed2a('0x7')]=function(_0xbcc416,_0xb1d3a4){return _0xbcc416[_0xed2a('0x8')](_0xed2a('0x9'),attributes,{'tableName':_0xed2a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd73f=['exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x32c3bc,_0x255ccc){var _0xa0d288=function(_0xc13ee7){while(--_0xc13ee7){_0x32c3bc['push'](_0x32c3bc['shift']());}};_0xa0d288(++_0x255ccc);}(_0xd73f,0x199));var _0xfd73=function(_0x154940,_0x1b13bb){_0x154940=_0x154940-0x0;var _0x3741af=_0xd73f[_0x154940];return _0x3741af;};'use strict';var _=require(_0xfd73('0x0'));var util=require(_0xfd73('0x1'));var logger=require(_0xfd73('0x2'))(_0xfd73('0x3'));var moment=require(_0xfd73('0x4'));var BPromise=require(_0xfd73('0x5'));var rp=require(_0xfd73('0x6'));var fs=require('fs');var path=require(_0xfd73('0x7'));var rimraf=require(_0xfd73('0x8'));var config=require(_0xfd73('0x9'));var attributes=require(_0xfd73('0xa'));module[_0xfd73('0xb')]=function(_0x4c26e0,_0x227079){return _0x4c26e0[_0xfd73('0xc')](_0xfd73('0xd'),attributes,{'tableName':_0xfd73('0xe'),'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 1618ae6..12796b9 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 _0x8d1d=['info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8d1d,0x14e));var _0xd8d1=function(_0x4b99f5,_0x28a598){_0x4b99f5=_0x4b99f5-0x0;var _0x5ce432=_0x8d1d[_0x4b99f5];return _0x5ce432;};'use strict';var _=require(_0xd8d1('0x0'));var util=require(_0xd8d1('0x1'));var moment=require(_0xd8d1('0x2'));var BPromise=require(_0xd8d1('0x3'));var rs=require(_0xd8d1('0x4'));var fs=require('fs');var Redis=require(_0xd8d1('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd8d1('0x6'))(_0xd8d1('0x7'));var config=require(_0xd8d1('0x8'));var jayson=require(_0xd8d1('0x9'));var client=jayson[_0xd8d1('0xa')][_0xd8d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11d936,_0x7405fe,_0x2b705e){return new BPromise(function(_0xd06478,_0x2a0b16){return client[_0xd8d1('0xc')](_0x11d936,_0x2b705e)[_0xd8d1('0xd')](function(_0x4be814){logger[_0xd8d1('0xe')](_0xd8d1('0xf'),_0x7405fe,_0xd8d1('0x10'));logger['debug'](_0xd8d1('0x11'),_0x7405fe,_0xd8d1('0x10'),JSON[_0xd8d1('0x12')](_0x4be814));if(_0x4be814[_0xd8d1('0x13')]){if(_0x4be814[_0xd8d1('0x13')][_0xd8d1('0x14')]===0x1f4){logger[_0xd8d1('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x7405fe,_0x4be814['error']['message']);return _0x2a0b16(_0x4be814[_0xd8d1('0x13')][_0xd8d1('0x15')]);}logger[_0xd8d1('0x13')](_0xd8d1('0xf'),_0x7405fe,_0x4be814['error'][_0xd8d1('0x15')]);return _0xd06478(_0x4be814['error']['message']);}else{logger[_0xd8d1('0xe')](_0xd8d1('0xf'),_0x7405fe,_0xd8d1('0x10'));_0xd06478(_0x4be814[_0xd8d1('0x16')][_0xd8d1('0x15')]);}})[_0xd8d1('0x17')](function(_0x3cc1cd){logger[_0xd8d1('0x13')](_0xd8d1('0xf'),_0x7405fe,_0x3cc1cd);_0x2a0b16(_0x3cc1cd);});});}exports[_0xd8d1('0x18')]=function(_0x59ba83){var _0x329cc7=this;return new Promise(function(_0x2b254a,_0x4a00ae){return db[_0xd8d1('0x19')][_0xd8d1('0x1a')](_0x59ba83['body'],{'raw':_0x59ba83[_0xd8d1('0x1b')]?_0x59ba83[_0xd8d1('0x1b')][_0xd8d1('0x1c')]===undefined?!![]:![]:!![]})[_0xd8d1('0xd')](function(_0x13c739){logger[_0xd8d1('0xe')]('CreateSquareDetailsReport',_0x59ba83);logger['debug'](_0xd8d1('0x18'),_0x59ba83,JSON[_0xd8d1('0x12')](_0x13c739));_0x2b254a(_0x13c739);})[_0xd8d1('0x17')](function(_0x4fcd02){logger[_0xd8d1('0x13')]('CreateSquareDetailsReport',_0x4fcd02[_0xd8d1('0x15')],_0x59ba83);_0x4a00ae(_0x329cc7[_0xd8d1('0x13')](0x1f4,_0x4fcd02[_0xd8d1('0x15')]));});});}; \ No newline at end of file +var _0xdf05=['../../config/logger','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','util','moment','bluebird','ioredis'];(function(_0x5a9853,_0x1e4923){var _0x2ee1eb=function(_0x501fbc){while(--_0x501fbc){_0x5a9853['push'](_0x5a9853['shift']());}};_0x2ee1eb(++_0x1e4923);}(_0xdf05,0x1be));var _0x5df0=function(_0x265003,_0xf0f023){_0x265003=_0x265003-0x0;var _0x33c743=_0xdf05[_0x265003];return _0x33c743;};'use strict';var _=require('lodash');var util=require(_0x5df0('0x0'));var moment=require(_0x5df0('0x1'));var BPromise=require(_0x5df0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5df0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5df0('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5df0('0x5'));var client=jayson[_0x5df0('0x6')][_0x5df0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x195d2b,_0x290dc5,_0x514969){return new BPromise(function(_0x160f21,_0x582f40){return client[_0x5df0('0x8')](_0x195d2b,_0x514969)[_0x5df0('0x9')](function(_0x5c4c15){logger[_0x5df0('0xa')](_0x5df0('0xb'),_0x290dc5,'request\x20sent');logger[_0x5df0('0xc')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x290dc5,'request\x20sent',JSON[_0x5df0('0xd')](_0x5c4c15));if(_0x5c4c15['error']){if(_0x5c4c15[_0x5df0('0xe')][_0x5df0('0xf')]===0x1f4){logger['error'](_0x5df0('0xb'),_0x290dc5,_0x5c4c15['error']['message']);return _0x582f40(_0x5c4c15[_0x5df0('0xe')][_0x5df0('0x10')]);}logger['error'](_0x5df0('0xb'),_0x290dc5,_0x5c4c15[_0x5df0('0xe')]['message']);return _0x160f21(_0x5c4c15['error']['message']);}else{logger[_0x5df0('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x290dc5,_0x5df0('0x11'));_0x160f21(_0x5c4c15[_0x5df0('0x12')]['message']);}})[_0x5df0('0x13')](function(_0xc6841){logger[_0x5df0('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x290dc5,_0xc6841);_0x582f40(_0xc6841);});});}exports[_0x5df0('0x14')]=function(_0x17522c){var _0x5ac404=this;return new Promise(function(_0x3574ce,_0x13b1fd){return db[_0x5df0('0x15')][_0x5df0('0x16')](_0x17522c['body'],{'raw':_0x17522c[_0x5df0('0x17')]?_0x17522c['options'][_0x5df0('0x18')]===undefined?!![]:![]:!![]})[_0x5df0('0x9')](function(_0x5488ed){logger[_0x5df0('0xa')](_0x5df0('0x14'),_0x17522c);logger[_0x5df0('0xc')](_0x5df0('0x14'),_0x17522c,JSON['stringify'](_0x5488ed));_0x3574ce(_0x5488ed);})[_0x5df0('0x13')](function(_0x1c8bb2){logger['error'](_0x5df0('0x14'),_0x1c8bb2[_0x5df0('0x10')],_0x17522c);_0x13b1fd(_0x5ac404[_0x5df0('0xe')](0x1f4,_0x1c8bb2[_0x5df0('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index b2ca2f5..2994c6b 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 _0x822f=['/process/:pid/kill','killProcess','express','../../components/auth/service','get','isAuthenticated','index'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0x822f,0x79));var _0xf822=function(_0xf6a4f3,_0x4c5796){_0xf6a4f3=_0xf6a4f3-0x0;var _0x30d969=_0x822f[_0xf6a4f3];return _0x30d969;};'use strict';var express=require(_0xf822('0x0'));var router=express['Router']();var auth=require(_0xf822('0x1'));var controller=require('./system.controller');router[_0xf822('0x2')]('/',auth[_0xf822('0x3')](),controller[_0xf822('0x4')]);router[_0xf822('0x2')](_0xf822('0x5'),auth[_0xf822('0x3')](),controller[_0xf822('0x6')]);module['exports']=router; \ No newline at end of file +var _0xc9a3=['get','isAuthenticated','/process/:pid/kill','killProcess','exports','express','Router','./system.controller'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xc9a3,0x155));var _0x3c9a=function(_0x5d386d,_0x4b99f4){_0x5d386d=_0x5d386d-0x0;var _0x5891b5=_0xc9a3[_0x5d386d];return _0x5891b5;};'use strict';var express=require(_0x3c9a('0x0'));var router=express[_0x3c9a('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x3c9a('0x2'));router[_0x3c9a('0x3')]('/',auth[_0x3c9a('0x4')](),controller['index']);router[_0x3c9a('0x3')](_0x3c9a('0x5'),auth[_0x3c9a('0x4')](),controller[_0x3c9a('0x6')]);module[_0x3c9a('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 8ff91ad..8955cf0 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 _0xd68c=['systeminformation','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','json','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','catch'];(function(_0x300e96,_0x329b01){var _0x3a4fe6=function(_0x558e83){while(--_0x558e83){_0x300e96['push'](_0x300e96['shift']());}};_0x3a4fe6(++_0x329b01);}(_0xd68c,0x113));var _0xcd68=function(_0x10d07b,_0xa771c5){_0x10d07b=_0x10d07b-0x0;var _0x2c880e=_0xd68c[_0x10d07b];return _0x2c880e;};'use strict';var info=require(_0xcd68('0x0'));var exec=require('child_process')['exec'];var logger=require(_0xcd68('0x1'))(_0xcd68('0x2'));var util=require(_0xcd68('0x3'));var BPromise=require(_0xcd68('0x4'));var _=require('lodash');function handleError(_0x25f7db,_0x3d8727,_0x30e2aa){_0x3d8727=_0x3d8727||0x1f4;return function(_0x34d1ad){logger[_0xcd68('0x5')](_0xcd68('0x6'),_0x30e2aa,_0x3d8727,util[_0xcd68('0x7')](_0x34d1ad,{'showHidden':![],'depth':null}));delete _0x34d1ad[_0xcd68('0x8')];_0x25f7db[_0xcd68('0x9')](_0x3d8727)['send'](_0x34d1ad);};}exports[_0xcd68('0xa')]=function(_0x20c9d7,_0x2ae41d){return info[_0xcd68('0xb')]()[_0xcd68('0xc')](function(_0x5d9622){return _0x2ae41d[_0xcd68('0x9')](0xc8)[_0xcd68('0xd')](_0x5d9622);})['catch'](function(_0x3a639d){return _0x2ae41d['status'](0x1f4)[_0xcd68('0xd')](_0x3a639d);});};exports[_0xcd68('0xe')]=function(_0x4b3015,_0x112219){var _0x28f35a=['components/import/cm'];return new BPromise(function(_0x591c2d,_0x320d21){return exec(util[_0xcd68('0xf')](_0xcd68('0x10'),_0x4b3015[_0xcd68('0x11')]['pid']),function(_0x419f7a,_0x4f3fd0,_0x374071){if(_0x419f7a){return _0x320d21(_0x419f7a);}return _0x591c2d(_0x4f3fd0);});})[_0xcd68('0xc')](function(_0x197da1){var _0x43053a=![];var _0x20c156=_0x197da1[_0xcd68('0x12')](/\n/);for(var _0x4f21a2=0x0,_0x23bac4=_0x28f35a[_0xcd68('0x13')];_0x4f21a2<_0x23bac4,_0x43053a===![];_0x4f21a2+=0x1){if(_0x197da1[_0xcd68('0x14')](_0x28f35a[_0x4f21a2])>=0x0){_0x43053a=!![];}}if(!_0x43053a){throw new Error(util[_0xcd68('0xf')](_0xcd68('0x15'),_0x4b3015['params'][_0xcd68('0x16')]));}process[_0xcd68('0x17')](_0x4b3015['params']['pid'],'SIGINT');return _0x112219['status'](0xc8)[_0xcd68('0xd')]({'message':util[_0xcd68('0xf')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x4b3015[_0xcd68('0x11')]['pid'])});})[_0xcd68('0x18')](handleError(_0x112219,null,_0xcd68('0xe')));}; \ No newline at end of file +var _0x9147=['format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','kill','SIGINT','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','error','inspect','status','getAllData','catch','json','killProcess','components/import/cm'];(function(_0x15f449,_0x2f1388){var _0x517ab6=function(_0x1b6b27){while(--_0x1b6b27){_0x15f449['push'](_0x15f449['shift']());}};_0x517ab6(++_0x2f1388);}(_0x9147,0x81));var _0x7914=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9147[_0x2dafbe];return _0x58a45a;};'use strict';var info=require(_0x7914('0x0'));var exec=require(_0x7914('0x1'))[_0x7914('0x2')];var logger=require(_0x7914('0x3'))(_0x7914('0x4'));var util=require(_0x7914('0x5'));var BPromise=require(_0x7914('0x6'));var _=require('lodash');function handleError(_0x21cae6,_0x1de2bc,_0x1f8716){_0x1de2bc=_0x1de2bc||0x1f4;return function(_0x280cdb){logger[_0x7914('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x1f8716,_0x1de2bc,util[_0x7914('0x8')](_0x280cdb,{'showHidden':![],'depth':null}));delete _0x280cdb['name'];_0x21cae6[_0x7914('0x9')](_0x1de2bc)['send'](_0x280cdb);};}exports['index']=function(_0xa22f08,_0x8ce32){return info[_0x7914('0xa')]()['then'](function(_0x104e12){return _0x8ce32[_0x7914('0x9')](0xc8)['json'](_0x104e12);})[_0x7914('0xb')](function(_0x48d5c9){return _0x8ce32[_0x7914('0x9')](0x1f4)[_0x7914('0xc')](_0x48d5c9);});};exports[_0x7914('0xd')]=function(_0x417299,_0x502d5e){var _0x58a902=[_0x7914('0xe')];return new BPromise(function(_0x2fc465,_0x555924){return exec(util[_0x7914('0xf')](_0x7914('0x10'),_0x417299[_0x7914('0x11')][_0x7914('0x12')]),function(_0x42a5a0,_0xefbdbb,_0x43c791){if(_0x42a5a0){return _0x555924(_0x42a5a0);}return _0x2fc465(_0xefbdbb);});})['then'](function(_0x289740){var _0x26561a=![];var _0x590e1e=_0x289740[_0x7914('0x13')](/\n/);for(var _0x228e33=0x0,_0xb62f5f=_0x58a902[_0x7914('0x14')];_0x228e33<_0xb62f5f,_0x26561a===![];_0x228e33+=0x1){if(_0x289740[_0x7914('0x15')](_0x58a902[_0x228e33])>=0x0){_0x26561a=!![];}}if(!_0x26561a){throw new Error(util[_0x7914('0xf')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x417299[_0x7914('0x11')][_0x7914('0x12')]));}process[_0x7914('0x16')](_0x417299[_0x7914('0x11')][_0x7914('0x12')],_0x7914('0x17'));return _0x502d5e['status'](0xc8)[_0x7914('0xc')]({'message':util[_0x7914('0xf')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x417299[_0x7914('0x11')][_0x7914('0x12')])});})[_0x7914('0xb')](handleError(_0x502d5e,null,_0x7914('0xd')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index edb8777..bb660b5 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 _0xdc39=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','get','show','post','create','update','delete','destroy','exports'];(function(_0x25914e,_0x41030e){var _0xbc0de9=function(_0x5abcf3){while(--_0x5abcf3){_0x25914e['push'](_0x25914e['shift']());}};_0xbc0de9(++_0x41030e);}(_0xdc39,0x169));var _0x9dc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc39[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x9dc3('0x0'));var path=require(_0x9dc3('0x1'));var timeout=require(_0x9dc3('0x2'));var express=require(_0x9dc3('0x3'));var router=express[_0x9dc3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9dc3('0x5'));var interaction=require(_0x9dc3('0x6'));var config=require(_0x9dc3('0x7'));var controller=require(_0x9dc3('0x8'));router['get']('/',auth[_0x9dc3('0x9')](),controller[_0x9dc3('0xa')]);router[_0x9dc3('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x9dc3('0xc')]);router[_0x9dc3('0xd')]('/',auth[_0x9dc3('0x9')](),controller[_0x9dc3('0xe')]);router['put']('/:id',auth[_0x9dc3('0x9')](),controller[_0x9dc3('0xf')]);router[_0x9dc3('0x10')]('/:id',auth[_0x9dc3('0x9')](),controller[_0x9dc3('0x11')]);module[_0x9dc3('0x12')]=router; \ No newline at end of file +var _0x4c58=['isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','get'];(function(_0x3abe6a,_0xdd7b1a){var _0x2fc39e=function(_0x13911e){while(--_0x13911e){_0x3abe6a['push'](_0x3abe6a['shift']());}};_0x2fc39e(++_0xdd7b1a);}(_0x4c58,0xed));var _0x84c5=function(_0x39aae5,_0xfd2f27){_0x39aae5=_0x39aae5-0x0;var _0x266f9f=_0x4c58[_0x39aae5];return _0x266f9f;};'use strict';var multer=require(_0x84c5('0x0'));var util=require('util');var path=require(_0x84c5('0x1'));var timeout=require(_0x84c5('0x2'));var express=require(_0x84c5('0x3'));var router=express[_0x84c5('0x4')]();var fs_extra=require(_0x84c5('0x5'));var auth=require(_0x84c5('0x6'));var interaction=require(_0x84c5('0x7'));var config=require('../../config/environment');var controller=require(_0x84c5('0x8'));router[_0x84c5('0x9')]('/',auth[_0x84c5('0xa')](),controller[_0x84c5('0xb')]);router[_0x84c5('0x9')](_0x84c5('0xc'),auth[_0x84c5('0xa')](),controller[_0x84c5('0xd')]);router[_0x84c5('0xe')]('/',auth[_0x84c5('0xa')](),controller[_0x84c5('0xf')]);router[_0x84c5('0x10')](_0x84c5('0xc'),auth[_0x84c5('0xa')](),controller[_0x84c5('0x11')]);router['delete'](_0x84c5('0xc'),auth[_0x84c5('0xa')](),controller[_0x84c5('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 5931ee8..6564134 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 _0x4483=['exports','STRING','#0091EA','sequelize'];(function(_0x4b6f63,_0x4c2790){var _0x265b16=function(_0x278f19){while(--_0x278f19){_0x4b6f63['push'](_0x4b6f63['shift']());}};_0x265b16(++_0x4c2790);}(_0x4483,0x1a3));var _0x3448=function(_0x5c98b6,_0x1a4b3a){_0x5c98b6=_0x5c98b6-0x0;var _0xfdd6ed=_0x4483[_0x5c98b6];return _0xfdd6ed;};'use strict';var Sequelize=require(_0x3448('0x0'));module[_0x3448('0x1')]={'name':{'type':Sequelize[_0x3448('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3448('0x2')],'defaultValue':_0x3448('0x3')},'description':{'type':Sequelize[_0x3448('0x2')]}}; \ No newline at end of file +var _0x2032=['#0091EA','exports','STRING','name'];(function(_0x5b935a,_0x38a394){var _0x14c17b=function(_0x4e9d5b){while(--_0x4e9d5b){_0x5b935a['push'](_0x5b935a['shift']());}};_0x14c17b(++_0x38a394);}(_0x2032,0xd9));var _0x2203=function(_0x5e64fa,_0x166961){_0x5e64fa=_0x5e64fa-0x0;var _0x4cb39a=_0x2032[_0x5e64fa];return _0x4cb39a;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'unique':_0x2203('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x2203('0x3')},'description':{'type':Sequelize[_0x2203('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 59b77cf..e718740 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 _0xf9a2=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','get','Tags','destroy','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','Tag','include','findAll','rows','catch','params','keys','length','includeAll','options','create','body','user'];(function(_0x1bc508,_0x136af6){var _0x34554c=function(_0x3ea65){while(--_0x3ea65){_0x1bc508['push'](_0x1bc508['shift']());}};_0x34554c(++_0x136af6);}(_0xf9a2,0x10b));var _0x2f9a=function(_0x53fc51,_0x1eebc4){_0x53fc51=_0x53fc51-0x0;var _0x1d8c4c=_0xf9a2[_0x53fc51];return _0x1d8c4c;};'use strict';var emlformat=require(_0x2f9a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2f9a('0x1'));var rp=require(_0x2f9a('0x2'));var moment=require(_0x2f9a('0x3'));var BPromise=require(_0x2f9a('0x4'));var Mustache=require(_0x2f9a('0x5'));var util=require(_0x2f9a('0x6'));var path=require(_0x2f9a('0x7'));var sox=require(_0x2f9a('0x8'));var csv=require(_0x2f9a('0x9'));var ejs=require(_0x2f9a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f9a('0xb'));var squel=require(_0x2f9a('0xc'));var crypto=require('crypto');var jsforce=require(_0x2f9a('0xd'));var deskjs=require(_0x2f9a('0xe'));var toCsv=require(_0x2f9a('0x9'));var querystring=require(_0x2f9a('0xf'));var Papa=require(_0x2f9a('0x10'));var Redis=require(_0x2f9a('0x11'));var authService=require(_0x2f9a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f9a('0x13'));var logger=require(_0x2f9a('0x14'))(_0x2f9a('0x15'));var utils=require('../../config/utils');var config=require(_0x2f9a('0x16'));var licenseUtil=require(_0x2f9a('0x17'));var db=require(_0x2f9a('0x18'))['db'];function respondWithStatusCode(_0x81e632,_0x51171b){_0x51171b=_0x51171b||0xcc;return function(_0x5415c9){if(_0x5415c9){return _0x81e632[_0x2f9a('0x19')](_0x51171b);}return _0x81e632['status'](_0x51171b)[_0x2f9a('0x1a')]();};}function respondWithResult(_0x321db0,_0x379dff){_0x379dff=_0x379dff||0xc8;return function(_0x3454f2){if(_0x3454f2){return _0x321db0[_0x2f9a('0x1b')](_0x379dff)[_0x2f9a('0x1c')](_0x3454f2);}};}function respondWithFilteredResult(_0xa9fcef,_0xab1212){return function(_0x4a5c23){if(_0x4a5c23){var _0x1ae590=typeof _0xab1212['offset']==='undefined'&&typeof _0xab1212[_0x2f9a('0x1d')]===_0x2f9a('0x1e');var _0x462057=_0x4a5c23[_0x2f9a('0x1f')];var _0x171eee=_0x1ae590?0x0:_0xab1212[_0x2f9a('0x20')];var _0x2fedf8=_0x1ae590?_0x4a5c23[_0x2f9a('0x1f')]:_0xab1212['offset']+_0xab1212[_0x2f9a('0x1d')];var _0x3b07f2;if(_0x2fedf8>=_0x462057){_0x2fedf8=_0x462057;_0x3b07f2=0xc8;}else{_0x3b07f2=0xce;}_0xa9fcef[_0x2f9a('0x1b')](_0x3b07f2);return _0xa9fcef['set'](_0x2f9a('0x21'),_0x171eee+'-'+_0x2fedf8+'/'+_0x462057)[_0x2f9a('0x1c')](_0x4a5c23);}return null;};}function patchUpdates(_0x190032){return function(_0x3ba5ad){try{jsonpatch[_0x2f9a('0x22')](_0x3ba5ad,_0x190032,!![]);}catch(_0x327902){return BPromise[_0x2f9a('0x23')](_0x327902);}return _0x3ba5ad[_0x2f9a('0x24')]();};}function saveUpdates(_0xa0d627,_0x265063){return function(_0x36c666){if(_0x36c666){return _0x36c666[_0x2f9a('0x25')](_0xa0d627)['then'](function(_0x277859){return _0x277859;});}return null;};}function removeEntity(_0x503d23,_0x2a8df1){return function(_0x39958f){if(_0x39958f){return _0x39958f['destroy']()[_0x2f9a('0x26')](function(){var _0x23717a=_0x39958f[_0x2f9a('0x27')]({'plain':!![]});var _0x35b019=_0x2f9a('0x28');return db['UserProfileResource'][_0x2f9a('0x29')]({'where':{'type':_0x35b019,'resourceId':_0x23717a['id']}})[_0x2f9a('0x26')](function(){return _0x39958f;});})['then'](function(){_0x503d23[_0x2f9a('0x1b')](0xcc)[_0x2f9a('0x1a')]();});}};}function handleEntityNotFound(_0x5edbdb,_0x485245){return function(_0x3130b9){if(!_0x3130b9){_0x5edbdb['sendStatus'](0x194);}return _0x3130b9;};}function handleError(_0x36e2a0,_0x4d0db8){_0x4d0db8=_0x4d0db8||0x1f4;return function(_0x5f317e){logger['error'](_0x5f317e['stack']);if(_0x5f317e[_0x2f9a('0x2a')]){delete _0x5f317e[_0x2f9a('0x2a')];}_0x36e2a0[_0x2f9a('0x1b')](_0x4d0db8)[_0x2f9a('0x2b')](_0x5f317e);};}exports[_0x2f9a('0x2c')]=function(_0x1cfdba,_0x12edf3){var _0x6d9542={},_0x2f30b8={},_0x5e4ebc={'count':0x0,'rows':[]};var _0x3f8e1e=_[_0x2f9a('0x2d')](db['Tag'][_0x2f9a('0x2e')],function(_0x125491){return{'name':_0x125491[_0x2f9a('0x2f')],'type':_0x125491['type'][_0x2f9a('0x30')]};});_0x2f30b8[_0x2f9a('0x31')]=_[_0x2f9a('0x2d')](_0x3f8e1e,_0x2f9a('0x2a'));_0x2f30b8[_0x2f9a('0x32')]=_['keys'](_0x1cfdba[_0x2f9a('0x32')]);_0x2f30b8[_0x2f9a('0x33')]=_[_0x2f9a('0x34')](_0x2f30b8[_0x2f9a('0x31')],_0x2f30b8[_0x2f9a('0x32')]);_0x6d9542[_0x2f9a('0x35')]=_[_0x2f9a('0x34')](_0x2f30b8[_0x2f9a('0x31')],qs[_0x2f9a('0x36')](_0x1cfdba[_0x2f9a('0x32')][_0x2f9a('0x36')]));_0x6d9542['attributes']=_0x6d9542[_0x2f9a('0x35')]['length']?_0x6d9542[_0x2f9a('0x35')]:_0x2f30b8[_0x2f9a('0x31')];if(!_0x1cfdba['query'][_0x2f9a('0x37')](_0x2f9a('0x38'))){_0x6d9542[_0x2f9a('0x1d')]=qs[_0x2f9a('0x1d')](_0x1cfdba[_0x2f9a('0x32')]['limit']);_0x6d9542[_0x2f9a('0x20')]=qs[_0x2f9a('0x20')](_0x1cfdba[_0x2f9a('0x32')][_0x2f9a('0x20')]);}_0x6d9542['order']=qs['sort'](_0x1cfdba['query'][_0x2f9a('0x39')]);_0x6d9542['where']=qs[_0x2f9a('0x33')](_[_0x2f9a('0x3a')](_0x1cfdba['query'],_0x2f30b8[_0x2f9a('0x33')]),_0x3f8e1e);if(_0x1cfdba[_0x2f9a('0x32')][_0x2f9a('0x3b')]){_0x6d9542[_0x2f9a('0x3c')]=_[_0x2f9a('0x3d')](_0x6d9542[_0x2f9a('0x3c')],{'$or':_['map'](_0x3f8e1e,function(_0x3349a9){if(_0x3349a9[_0x2f9a('0x3e')]!==_0x2f9a('0x3f')){var _0x1b3238={};_0x1b3238[_0x3349a9['name']]={'$like':'%'+_0x1cfdba[_0x2f9a('0x32')][_0x2f9a('0x3b')]+'%'};return _0x1b3238;}})});}_0x6d9542=_['merge']({},_0x6d9542,_0x1cfdba['options']);var _0x4df8ad={'where':_0x6d9542[_0x2f9a('0x3c')]};return db[_0x2f9a('0x40')][_0x2f9a('0x1f')](_0x4df8ad)['then'](function(_0x122050){_0x5e4ebc['count']=_0x122050;if(_0x1cfdba['query']['includeAll']){_0x6d9542[_0x2f9a('0x41')]=[{'all':!![]}];}return db[_0x2f9a('0x40')][_0x2f9a('0x42')](_0x6d9542);})['then'](function(_0x94b302){_0x5e4ebc[_0x2f9a('0x43')]=_0x94b302;return _0x5e4ebc;})[_0x2f9a('0x26')](respondWithFilteredResult(_0x12edf3,_0x6d9542))[_0x2f9a('0x44')](handleError(_0x12edf3,null));};exports['show']=function(_0x39f1e0,_0x1239b7){var _0x5c1c58={'raw':!![],'where':{'id':_0x39f1e0[_0x2f9a('0x45')]['id']}},_0x372710={};_0x372710[_0x2f9a('0x31')]=_[_0x2f9a('0x46')](db[_0x2f9a('0x40')][_0x2f9a('0x2e')]);_0x372710['query']=_['keys'](_0x39f1e0[_0x2f9a('0x32')]);_0x372710[_0x2f9a('0x33')]=_[_0x2f9a('0x34')](_0x372710[_0x2f9a('0x31')],_0x372710[_0x2f9a('0x32')]);_0x5c1c58[_0x2f9a('0x35')]=_[_0x2f9a('0x34')](_0x372710['model'],qs[_0x2f9a('0x36')](_0x39f1e0[_0x2f9a('0x32')][_0x2f9a('0x36')]));_0x5c1c58['attributes']=_0x5c1c58[_0x2f9a('0x35')][_0x2f9a('0x47')]?_0x5c1c58[_0x2f9a('0x35')]:_0x372710[_0x2f9a('0x31')];if(_0x39f1e0[_0x2f9a('0x32')][_0x2f9a('0x48')]){_0x5c1c58[_0x2f9a('0x41')]=[{'all':!![]}];}_0x5c1c58=_[_0x2f9a('0x3d')]({},_0x5c1c58,_0x39f1e0[_0x2f9a('0x49')]);return db[_0x2f9a('0x40')]['find'](_0x5c1c58)[_0x2f9a('0x26')](handleEntityNotFound(_0x1239b7,null))[_0x2f9a('0x26')](respondWithResult(_0x1239b7,null))[_0x2f9a('0x44')](handleError(_0x1239b7,null));};exports[_0x2f9a('0x4a')]=function(_0xd5204a,_0x36695d){return db[_0x2f9a('0x40')]['create'](_0xd5204a[_0x2f9a('0x4b')],{})[_0x2f9a('0x26')](function(_0x31cf6b){var _0x3051d3=_0xd5204a[_0x2f9a('0x4c')][_0x2f9a('0x27')]({'plain':!![]});if(!_0x3051d3)throw new Error(_0x2f9a('0x4d'));if(_0x3051d3[_0x2f9a('0x4e')]===_0x2f9a('0x4c')){var _0x5b7e80=_0x31cf6b['get']({'plain':!![]});var _0x51c514=_0x2f9a('0x28');return db[_0x2f9a('0x4f')]['find']({'where':{'name':_0x51c514,'userProfileId':_0x3051d3[_0x2f9a('0x50')]},'raw':!![]})[_0x2f9a('0x26')](function(_0x103401){if(_0x103401&&_0x103401[_0x2f9a('0x51')]===0x0){return db[_0x2f9a('0x52')][_0x2f9a('0x4a')]({'name':_0x5b7e80['name'],'resourceId':_0x5b7e80['id'],'type':_0x103401['name'],'sectionId':_0x103401['id']},{})[_0x2f9a('0x26')](function(){return _0x31cf6b;});}else{return _0x31cf6b;}})[_0x2f9a('0x44')](function(_0x1bf7b6){logger[_0x2f9a('0x53')](_0x2f9a('0x54'),_0x1bf7b6);throw _0x1bf7b6;});}return _0x31cf6b;})[_0x2f9a('0x26')](respondWithResult(_0x36695d,0xc9))[_0x2f9a('0x44')](handleError(_0x36695d,null));};exports[_0x2f9a('0x25')]=function(_0x1f4b06,_0x4e314a){if(_0x1f4b06[_0x2f9a('0x4b')]['id']){delete _0x1f4b06[_0x2f9a('0x4b')]['id'];}return db[_0x2f9a('0x40')][_0x2f9a('0x55')]({'where':{'id':_0x1f4b06[_0x2f9a('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e314a,null))[_0x2f9a('0x26')](saveUpdates(_0x1f4b06['body'],null))[_0x2f9a('0x26')](respondWithResult(_0x4e314a,null))['catch'](handleError(_0x4e314a,null));};exports['destroy']=function(_0x34399b,_0x3d4085){return db['Tag']['find']({'where':{'id':_0x34399b[_0x2f9a('0x45')]['id']}})[_0x2f9a('0x26')](handleEntityNotFound(_0x3d4085,null))[_0x2f9a('0x26')](removeEntity(_0x3d4085,null))[_0x2f9a('0x44')](handleError(_0x3d4085,null));}; \ No newline at end of file +var _0x54e9=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','end','error','name','send','index','map','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','Tag','findAll','rows','catch','show','rawAttributes','include','user','get','role','Tags','UserProfileSection','find','userProfileId','autoAssociation','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs'];(function(_0x58497a,_0x5be5f8){var _0x399810=function(_0x3e5b5b){while(--_0x3e5b5b){_0x58497a['push'](_0x58497a['shift']());}};_0x399810(++_0x5be5f8);}(_0x54e9,0x1d5));var _0x954e=function(_0xa20d3d,_0x26685c){_0xa20d3d=_0xa20d3d-0x0;var _0x292aed=_0x54e9[_0xa20d3d];return _0x292aed;};'use strict';var emlformat=require(_0x954e('0x0'));var rimraf=require(_0x954e('0x1'));var zipdir=require(_0x954e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x954e('0x3'));var BPromise=require(_0x954e('0x4'));var Mustache=require(_0x954e('0x5'));var util=require(_0x954e('0x6'));var path=require('path');var sox=require(_0x954e('0x7'));var csv=require(_0x954e('0x8'));var ejs=require(_0x954e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x954e('0xa'));var squel=require(_0x954e('0xb'));var crypto=require(_0x954e('0xc'));var jsforce=require(_0x954e('0xd'));var deskjs=require(_0x954e('0xe'));var toCsv=require(_0x954e('0x8'));var querystring=require('querystring');var Papa=require(_0x954e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x954e('0x10'));var as=require(_0x954e('0x11'));var hardwareService=require(_0x954e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x954e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x954e('0x14'));var db=require(_0x954e('0x15'))['db'];function respondWithStatusCode(_0x26c8aa,_0x15d557){_0x15d557=_0x15d557||0xcc;return function(_0x2345b9){if(_0x2345b9){return _0x26c8aa[_0x954e('0x16')](_0x15d557);}return _0x26c8aa[_0x954e('0x17')](_0x15d557)['end']();};}function respondWithResult(_0x106e72,_0x477ea9){_0x477ea9=_0x477ea9||0xc8;return function(_0x52e736){if(_0x52e736){return _0x106e72['status'](_0x477ea9)[_0x954e('0x18')](_0x52e736);}};}function respondWithFilteredResult(_0x3fa0e1,_0x1f4bf4){return function(_0x441c9a){if(_0x441c9a){var _0x52bfcb=typeof _0x1f4bf4['offset']===_0x954e('0x19')&&typeof _0x1f4bf4[_0x954e('0x1a')]===_0x954e('0x19');var _0x4e584a=_0x441c9a['count'];var _0x6a2b3c=_0x52bfcb?0x0:_0x1f4bf4['offset'];var _0xcdbbf6=_0x52bfcb?_0x441c9a['count']:_0x1f4bf4[_0x954e('0x1b')]+_0x1f4bf4[_0x954e('0x1a')];var _0x2ae0f2;if(_0xcdbbf6>=_0x4e584a){_0xcdbbf6=_0x4e584a;_0x2ae0f2=0xc8;}else{_0x2ae0f2=0xce;}_0x3fa0e1['status'](_0x2ae0f2);return _0x3fa0e1[_0x954e('0x1c')](_0x954e('0x1d'),_0x6a2b3c+'-'+_0xcdbbf6+'/'+_0x4e584a)[_0x954e('0x18')](_0x441c9a);}return null;};}function patchUpdates(_0x2880d3){return function(_0x51638a){try{jsonpatch[_0x954e('0x1e')](_0x51638a,_0x2880d3,!![]);}catch(_0x4490ec){return BPromise[_0x954e('0x1f')](_0x4490ec);}return _0x51638a[_0x954e('0x20')]();};}function saveUpdates(_0xd4166a,_0x1993bf){return function(_0x19bfaa){if(_0x19bfaa){return _0x19bfaa[_0x954e('0x21')](_0xd4166a)['then'](function(_0x4187d2){return _0x4187d2;});}return null;};}function removeEntity(_0xd3787e,_0x48d5da){return function(_0x5844ce){if(_0x5844ce){return _0x5844ce[_0x954e('0x22')]()[_0x954e('0x23')](function(){var _0x358522=_0x5844ce['get']({'plain':!![]});var _0x3d09e1='Tags';return db[_0x954e('0x24')]['destroy']({'where':{'type':_0x3d09e1,'resourceId':_0x358522['id']}})[_0x954e('0x23')](function(){return _0x5844ce;});})[_0x954e('0x23')](function(){_0xd3787e[_0x954e('0x17')](0xcc)[_0x954e('0x25')]();});}};}function handleEntityNotFound(_0x474a01,_0x57a3af){return function(_0x4fbbe2){if(!_0x4fbbe2){_0x474a01[_0x954e('0x16')](0x194);}return _0x4fbbe2;};}function handleError(_0xe925a5,_0x170f07){_0x170f07=_0x170f07||0x1f4;return function(_0x49f27f){logger[_0x954e('0x26')](_0x49f27f['stack']);if(_0x49f27f['name']){delete _0x49f27f[_0x954e('0x27')];}_0xe925a5['status'](_0x170f07)[_0x954e('0x28')](_0x49f27f);};}exports[_0x954e('0x29')]=function(_0x1cc09b,_0x4ff121){var _0x2c618c={},_0x4d0429={},_0x49da77={'count':0x0,'rows':[]};var _0x10728d=_[_0x954e('0x2a')](db['Tag']['rawAttributes'],function(_0x223d55){return{'name':_0x223d55['fieldName'],'type':_0x223d55[_0x954e('0x2b')][_0x954e('0x2c')]};});_0x4d0429[_0x954e('0x2d')]=_[_0x954e('0x2a')](_0x10728d,_0x954e('0x27'));_0x4d0429[_0x954e('0x2e')]=_[_0x954e('0x2f')](_0x1cc09b['query']);_0x4d0429[_0x954e('0x30')]=_['intersection'](_0x4d0429[_0x954e('0x2d')],_0x4d0429[_0x954e('0x2e')]);_0x2c618c[_0x954e('0x31')]=_[_0x954e('0x32')](_0x4d0429[_0x954e('0x2d')],qs['fields'](_0x1cc09b['query'][_0x954e('0x33')]));_0x2c618c[_0x954e('0x31')]=_0x2c618c[_0x954e('0x31')][_0x954e('0x34')]?_0x2c618c[_0x954e('0x31')]:_0x4d0429[_0x954e('0x2d')];if(!_0x1cc09b[_0x954e('0x2e')][_0x954e('0x35')](_0x954e('0x36'))){_0x2c618c[_0x954e('0x1a')]=qs['limit'](_0x1cc09b[_0x954e('0x2e')][_0x954e('0x1a')]);_0x2c618c[_0x954e('0x1b')]=qs[_0x954e('0x1b')](_0x1cc09b[_0x954e('0x2e')][_0x954e('0x1b')]);}_0x2c618c['order']=qs[_0x954e('0x37')](_0x1cc09b[_0x954e('0x2e')][_0x954e('0x37')]);_0x2c618c[_0x954e('0x38')]=qs['filters'](_[_0x954e('0x39')](_0x1cc09b[_0x954e('0x2e')],_0x4d0429[_0x954e('0x30')]),_0x10728d);if(_0x1cc09b[_0x954e('0x2e')][_0x954e('0x3a')]){_0x2c618c['where']=_[_0x954e('0x3b')](_0x2c618c[_0x954e('0x38')],{'$or':_['map'](_0x10728d,function(_0xdd6774){if(_0xdd6774[_0x954e('0x2b')]!=='VIRTUAL'){var _0x3278ea={};_0x3278ea[_0xdd6774[_0x954e('0x27')]]={'$like':'%'+_0x1cc09b[_0x954e('0x2e')][_0x954e('0x3a')]+'%'};return _0x3278ea;}})});}_0x2c618c=_[_0x954e('0x3b')]({},_0x2c618c,_0x1cc09b[_0x954e('0x3c')]);var _0x3e4b47={'where':_0x2c618c['where']};return db['Tag'][_0x954e('0x3d')](_0x3e4b47)['then'](function(_0xe6e245){_0x49da77['count']=_0xe6e245;if(_0x1cc09b['query'][_0x954e('0x3e')]){_0x2c618c['include']=[{'all':!![]}];}return db[_0x954e('0x3f')][_0x954e('0x40')](_0x2c618c);})['then'](function(_0xd8ab6c){_0x49da77[_0x954e('0x41')]=_0xd8ab6c;return _0x49da77;})['then'](respondWithFilteredResult(_0x4ff121,_0x2c618c))[_0x954e('0x42')](handleError(_0x4ff121,null));};exports[_0x954e('0x43')]=function(_0xde0235,_0x1a9184){var _0x532331={'raw':!![],'where':{'id':_0xde0235['params']['id']}},_0x545384={};_0x545384[_0x954e('0x2d')]=_[_0x954e('0x2f')](db['Tag'][_0x954e('0x44')]);_0x545384['query']=_['keys'](_0xde0235[_0x954e('0x2e')]);_0x545384[_0x954e('0x30')]=_['intersection'](_0x545384[_0x954e('0x2d')],_0x545384[_0x954e('0x2e')]);_0x532331[_0x954e('0x31')]=_[_0x954e('0x32')](_0x545384[_0x954e('0x2d')],qs['fields'](_0xde0235[_0x954e('0x2e')]['fields']));_0x532331[_0x954e('0x31')]=_0x532331['attributes'][_0x954e('0x34')]?_0x532331['attributes']:_0x545384['model'];if(_0xde0235['query'][_0x954e('0x3e')]){_0x532331[_0x954e('0x45')]=[{'all':!![]}];}_0x532331=_['merge']({},_0x532331,_0xde0235[_0x954e('0x3c')]);return db[_0x954e('0x3f')]['find'](_0x532331)[_0x954e('0x23')](handleEntityNotFound(_0x1a9184,null))[_0x954e('0x23')](respondWithResult(_0x1a9184,null))[_0x954e('0x42')](handleError(_0x1a9184,null));};exports['create']=function(_0x3644b7,_0x5c3542){return db[_0x954e('0x3f')]['create'](_0x3644b7['body'],{})[_0x954e('0x23')](function(_0x51b109){var _0x47be70=_0x3644b7[_0x954e('0x46')][_0x954e('0x47')]({'plain':!![]});if(!_0x47be70)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47be70[_0x954e('0x48')]==='user'){var _0x1d5fd3=_0x51b109[_0x954e('0x47')]({'plain':!![]});var _0x2c6f63=_0x954e('0x49');return db[_0x954e('0x4a')][_0x954e('0x4b')]({'where':{'name':_0x2c6f63,'userProfileId':_0x47be70[_0x954e('0x4c')]},'raw':!![]})['then'](function(_0x52b0f4){if(_0x52b0f4&&_0x52b0f4[_0x954e('0x4d')]===0x0){return db[_0x954e('0x24')][_0x954e('0x4e')]({'name':_0x1d5fd3[_0x954e('0x27')],'resourceId':_0x1d5fd3['id'],'type':_0x52b0f4[_0x954e('0x27')],'sectionId':_0x52b0f4['id']},{})[_0x954e('0x23')](function(){return _0x51b109;});}else{return _0x51b109;}})['catch'](function(_0x430cde){logger[_0x954e('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x430cde);throw _0x430cde;});}return _0x51b109;})[_0x954e('0x23')](respondWithResult(_0x5c3542,0xc9))[_0x954e('0x42')](handleError(_0x5c3542,null));};exports[_0x954e('0x21')]=function(_0x528a5b,_0x4e5b5b){if(_0x528a5b['body']['id']){delete _0x528a5b[_0x954e('0x4f')]['id'];}return db['Tag'][_0x954e('0x4b')]({'where':{'id':_0x528a5b[_0x954e('0x50')]['id']}})['then'](handleEntityNotFound(_0x4e5b5b,null))[_0x954e('0x23')](saveUpdates(_0x528a5b['body'],null))[_0x954e('0x23')](respondWithResult(_0x4e5b5b,null))[_0x954e('0x42')](handleError(_0x4e5b5b,null));};exports[_0x954e('0x22')]=function(_0x553a06,_0x20ac96){return db[_0x954e('0x3f')]['find']({'where':{'id':_0x553a06[_0x954e('0x50')]['id']}})['then'](handleEntityNotFound(_0x20ac96,null))['then'](removeEntity(_0x20ac96,null))['catch'](handleError(_0x20ac96,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index b5d5392..f9643e2 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 _0xcaab=['exports','Tag','tools_tags','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x1e2556,_0xf14698){var _0x2d4f35=function(_0x270d70){while(--_0x270d70){_0x1e2556['push'](_0x1e2556['shift']());}};_0x2d4f35(++_0xf14698);}(_0xcaab,0x1a7));var _0xbcaa=function(_0x5234e2,_0x310c1e){_0x5234e2=_0x5234e2-0x0;var _0xd1c743=_0xcaab[_0x5234e2];return _0xd1c743;};'use strict';var _=require(_0xbcaa('0x0'));var util=require(_0xbcaa('0x1'));var logger=require(_0xbcaa('0x2'))(_0xbcaa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbcaa('0x4'));var fs=require('fs');var path=require(_0xbcaa('0x5'));var rimraf=require(_0xbcaa('0x6'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0xbcaa('0x7')]=function(_0x3837e2,_0x3c1408){return _0x3837e2['define'](_0xbcaa('0x8'),attributes,{'tableName':_0xbcaa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f8b=['rimraf','./tag.attributes','exports','define','tools_tags','lodash','util','moment','bluebird','request-promise','path'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x4f8b,0x12e));var _0xb4f8=function(_0x424568,_0x5982f4){_0x424568=_0x424568-0x0;var _0x9aed1b=_0x4f8b[_0x424568];return _0x9aed1b;};'use strict';var _=require(_0xb4f8('0x0'));var util=require(_0xb4f8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb4f8('0x2'));var BPromise=require(_0xb4f8('0x3'));var rp=require(_0xb4f8('0x4'));var fs=require('fs');var path=require(_0xb4f8('0x5'));var rimraf=require(_0xb4f8('0x6'));var config=require('../../config/environment');var attributes=require(_0xb4f8('0x7'));module[_0xb4f8('0x8')]=function(_0x4851f2,_0x2768ba){return _0x4851f2[_0xb4f8('0x9')]('Tag',attributes,{'tableName':_0xb4f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 01e7c91..4b725d5 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 _0xe13a=['code','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xeb13b2,_0x12cafd){var _0x999066=function(_0x796acc){while(--_0x796acc){_0xeb13b2['push'](_0xeb13b2['shift']());}};_0x999066(++_0x12cafd);}(_0xe13a,0x178));var _0xae13=function(_0x519d1a,_0x16970a){_0x519d1a=_0x519d1a-0x0;var _0x281001=_0xe13a[_0x519d1a];return _0x281001;};'use strict';var _=require('lodash');var util=require(_0xae13('0x0'));var moment=require(_0xae13('0x1'));var BPromise=require(_0xae13('0x2'));var rs=require(_0xae13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae13('0x4'))['db'];var utils=require(_0xae13('0x5'));var logger=require(_0xae13('0x6'))(_0xae13('0x7'));var config=require(_0xae13('0x8'));var jayson=require(_0xae13('0x9'));var client=jayson[_0xae13('0xa')][_0xae13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x341ba4,_0x4ae51f,_0x2f6d10){return new BPromise(function(_0x2b2e1f,_0x27fefd){return client[_0xae13('0xc')](_0x341ba4,_0x2f6d10)[_0xae13('0xd')](function(_0x41bf44){logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));logger['debug'](_0xae13('0x11'),_0x4ae51f,_0xae13('0x10'),JSON[_0xae13('0x12')](_0x41bf44));if(_0x41bf44[_0xae13('0x13')]){if(_0x41bf44[_0xae13('0x13')][_0xae13('0x14')]===0x1f4){logger[_0xae13('0x13')]('Tag,\x20%s,\x20%s',_0x4ae51f,_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);return _0x27fefd(_0x41bf44['error']['message']);}logger['error']('Tag,\x20%s,\x20%s',_0x4ae51f,_0x41bf44['error'][_0xae13('0x15')]);return _0x2b2e1f(_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);}else{logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));_0x2b2e1f(_0x41bf44['result'][_0xae13('0x15')]);}})['catch'](function(_0xe10aab){logger[_0xae13('0x13')](_0xae13('0xf'),_0x4ae51f,_0xe10aab);_0x27fefd(_0xe10aab);});});} \ No newline at end of file +var _0x2bc6=['../../config/environment','client','http','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','lodash','util','moment','../../config/utils','rpc'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0x2bc6,0x163));var _0x62bc=function(_0x77add,_0x2016b8){_0x77add=_0x77add-0x0;var _0xa1b62d=_0x2bc6[_0x77add];return _0xa1b62d;};'use strict';var _=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var moment=require(_0x62bc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x62bc('0x3'));var logger=require('../../config/logger')(_0x62bc('0x4'));var config=require(_0x62bc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x62bc('0x6')][_0x62bc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40af10,_0x3f3dc9,_0x3ed6ad){return new BPromise(function(_0x3f625c,_0x5bedeb){return client[_0x62bc('0x8')](_0x40af10,_0x3ed6ad)[_0x62bc('0x9')](function(_0x1917e1){logger[_0x62bc('0xa')]('Tag,\x20%s,\x20%s',_0x3f3dc9,_0x62bc('0xb'));logger[_0x62bc('0xc')](_0x62bc('0xd'),_0x3f3dc9,'request\x20sent',JSON[_0x62bc('0xe')](_0x1917e1));if(_0x1917e1[_0x62bc('0xf')]){if(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x10')]===0x1f4){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')]['message']);return _0x5bedeb(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);}logger['error'](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);return _0x3f625c(_0x1917e1['error'][_0x62bc('0x12')]);}else{logger[_0x62bc('0xa')]('Tag,\x20%s,\x20%s',_0x3f3dc9,'request\x20sent');_0x3f625c(_0x1917e1[_0x62bc('0x13')][_0x62bc('0x12')]);}})['catch'](function(_0x278893){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x278893);_0x5bedeb(_0x278893);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 70b6e98..2385329 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 _0x7d90=['addQueues','/:id/users','addAgents','delete','destroy','removeQueues','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/queues','getAgents','post','create'];(function(_0x41f3c9,_0x322ad9){var _0x3fd476=function(_0x2d8648){while(--_0x2d8648){_0x41f3c9['push'](_0x41f3c9['shift']());}};_0x3fd476(++_0x322ad9);}(_0x7d90,0x104));var _0x07d9=function(_0xc16558,_0x26c021){_0xc16558=_0xc16558-0x0;var _0x2bf902=_0x7d90[_0xc16558];return _0x2bf902;};'use strict';var multer=require(_0x07d9('0x0'));var util=require(_0x07d9('0x1'));var path=require('path');var timeout=require(_0x07d9('0x2'));var express=require(_0x07d9('0x3'));var router=express['Router']();var fs_extra=require(_0x07d9('0x4'));var auth=require(_0x07d9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x07d9('0x6'));var controller=require('./team.controller');router[_0x07d9('0x7')]('/',auth[_0x07d9('0x8')](),controller[_0x07d9('0x9')]);router[_0x07d9('0x7')](_0x07d9('0xa'),auth['isAuthenticated'](),controller[_0x07d9('0xb')]);router[_0x07d9('0x7')](_0x07d9('0xc'),auth[_0x07d9('0x8')](),controller['getQueues']);router['get']('/:id/users',auth[_0x07d9('0x8')](),controller[_0x07d9('0xd')]);router[_0x07d9('0xe')]('/',auth[_0x07d9('0x8')](),controller[_0x07d9('0xf')]);router[_0x07d9('0xe')](_0x07d9('0xc'),auth[_0x07d9('0x8')](),controller[_0x07d9('0x10')]);router[_0x07d9('0xe')](_0x07d9('0x11'),auth[_0x07d9('0x8')](),controller[_0x07d9('0x12')]);router['put'](_0x07d9('0xa'),auth[_0x07d9('0x8')](),controller['update']);router[_0x07d9('0x13')]('/:id',auth[_0x07d9('0x8')](),controller[_0x07d9('0x14')]);router[_0x07d9('0x13')]('/:id/queues',auth[_0x07d9('0x8')](),controller[_0x07d9('0x15')]);router[_0x07d9('0x13')](_0x07d9('0x11'),auth[_0x07d9('0x8')](),controller['removeAgents']);module[_0x07d9('0x16')]=router; \ No newline at end of file +var _0xa819=['isAuthenticated','/:id','show','/:id/queues','getQueues','/:id/users','getAgents','post','create','addQueues','addAgents','put','update','delete','removeQueues','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./team.controller','get'];(function(_0x1d8f23,_0x1d4573){var _0x9499d7=function(_0x32af9b){while(--_0x32af9b){_0x1d8f23['push'](_0x1d8f23['shift']());}};_0x9499d7(++_0x1d4573);}(_0xa819,0x93));var _0x9a81=function(_0x4c0b35,_0x33eaed){_0x4c0b35=_0x4c0b35-0x0;var _0x232467=_0xa819[_0x4c0b35];return _0x232467;};'use strict';var multer=require(_0x9a81('0x0'));var util=require(_0x9a81('0x1'));var path=require(_0x9a81('0x2'));var timeout=require(_0x9a81('0x3'));var express=require(_0x9a81('0x4'));var router=express[_0x9a81('0x5')]();var fs_extra=require(_0x9a81('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9a81('0x7'));router[_0x9a81('0x8')]('/',auth[_0x9a81('0x9')](),controller['index']);router[_0x9a81('0x8')](_0x9a81('0xa'),auth[_0x9a81('0x9')](),controller[_0x9a81('0xb')]);router[_0x9a81('0x8')](_0x9a81('0xc'),auth[_0x9a81('0x9')](),controller[_0x9a81('0xd')]);router[_0x9a81('0x8')](_0x9a81('0xe'),auth[_0x9a81('0x9')](),controller[_0x9a81('0xf')]);router[_0x9a81('0x10')]('/',auth[_0x9a81('0x9')](),controller[_0x9a81('0x11')]);router[_0x9a81('0x10')]('/:id/queues',auth[_0x9a81('0x9')](),controller[_0x9a81('0x12')]);router[_0x9a81('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0x9a81('0x13')]);router[_0x9a81('0x14')](_0x9a81('0xa'),auth[_0x9a81('0x9')](),controller[_0x9a81('0x15')]);router[_0x9a81('0x16')](_0x9a81('0xa'),auth[_0x9a81('0x9')](),controller['destroy']);router['delete'](_0x9a81('0xc'),auth['isAuthenticated'](),controller[_0x9a81('0x17')]);router[_0x9a81('0x16')](_0x9a81('0xe'),auth[_0x9a81('0x9')](),controller[_0x9a81('0x18')]);module[_0x9a81('0x19')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 30f857e..0db47f4 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 _0xabeb=['exports','name','STRING','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xabeb,0x15b));var _0xbabe=function(_0xf7224d,_0x2b8c21){_0xf7224d=_0xf7224d-0x0;var _0x525740=_0xabeb[_0xf7224d];return _0x525740;};'use strict';var Sequelize=require(_0xbabe('0x0'));module[_0xbabe('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbabe('0x2')},'description':{'type':Sequelize[_0xbabe('0x3')]}}; \ No newline at end of file +var _0x19d1=['exports','STRING'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x19d1,0x1bc));var _0x119d=function(_0x552946,_0x52167d){_0x552946=_0x552946-0x0;var _0x5e38cc=_0x19d1[_0x552946];return _0x5e38cc;};'use strict';var Sequelize=require('sequelize');module[_0x119d('0x0')]={'name':{'type':Sequelize[_0x119d('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x119d('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 56e0863..a3126c7 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 _0x57ca=['sequelize','transaction','through','ids','QueueId','Voice','emit','User','voicePause','interface','upsert','isNil','format','SIP/%s','penalty','all','removeAgents','UserVoiceQueueRt','getAgents','hasOwnProperty','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Teams','UserProfileResource','error','name','index','map','Team','type','key','model','keys','filters','query','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','options','findAll','rows','catch','params','rawAttributes','merge','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','add','removeQueues','remove','addAgents','Chat','Mail','Sms','Openchannel','Whatsapp'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57ca,0x108));var _0xa57c=function(_0x14fce6,_0x3232b0){_0x14fce6=_0x14fce6-0x0;var _0x5697d5=_0x57ca[_0x14fce6];return _0x5697d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];config[_0xa57c('0x17')]=_[_0xa57c('0x18')](config[_0xa57c('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xa57c('0x19'))(new Redis(config['redis']));require(_0xa57c('0x1a'))[_0xa57c('0x1b')](socket);function respondWithStatusCode(_0x30940d,_0x3821d2){_0x3821d2=_0x3821d2||0xcc;return function(_0x3238ff){if(_0x3238ff){return _0x30940d[_0xa57c('0x1c')](_0x3821d2);}return _0x30940d[_0xa57c('0x1d')](_0x3821d2)['end']();};}function respondWithResult(_0x26607a,_0xdf7ff6){_0xdf7ff6=_0xdf7ff6||0xc8;return function(_0x261725){if(_0x261725){return _0x26607a['status'](_0xdf7ff6)[_0xa57c('0x1e')](_0x261725);}};}function respondWithFilteredResult(_0x5f33f1,_0x3e7afa){return function(_0x3d781d){if(_0x3d781d){var _0x93462c=typeof _0x3e7afa[_0xa57c('0x1f')]===_0xa57c('0x20')&&typeof _0x3e7afa[_0xa57c('0x21')]===_0xa57c('0x20');var _0x595c7a=_0x3d781d['count'];var _0x8a8856=_0x93462c?0x0:_0x3e7afa['offset'];var _0x4a35bb=_0x93462c?_0x3d781d[_0xa57c('0x22')]:_0x3e7afa[_0xa57c('0x1f')]+_0x3e7afa[_0xa57c('0x21')];var _0x23bec0;if(_0x4a35bb>=_0x595c7a){_0x4a35bb=_0x595c7a;_0x23bec0=0xc8;}else{_0x23bec0=0xce;}_0x5f33f1['status'](_0x23bec0);return _0x5f33f1[_0xa57c('0x23')](_0xa57c('0x24'),_0x8a8856+'-'+_0x4a35bb+'/'+_0x595c7a)[_0xa57c('0x1e')](_0x3d781d);}return null;};}function patchUpdates(_0x2213b2){return function(_0x3bb969){try{jsonpatch[_0xa57c('0x25')](_0x3bb969,_0x2213b2,!![]);}catch(_0x1e0192){return BPromise[_0xa57c('0x26')](_0x1e0192);}return _0x3bb969[_0xa57c('0x27')]();};}function saveUpdates(_0xdf65dd,_0x382a26){return function(_0x1e7f7a){if(_0x1e7f7a){return _0x1e7f7a[_0xa57c('0x28')](_0xdf65dd)[_0xa57c('0x29')](function(_0x431bec){return _0x431bec;});}return null;};}function removeEntity(_0x511a26,_0x2db443){return function(_0x5226d0){if(_0x5226d0){return _0x5226d0[_0xa57c('0x2a')]()[_0xa57c('0x29')](function(){var _0x315ad7=_0x5226d0[_0xa57c('0x2b')]({'plain':!![]});var _0x8ee1c0=_0xa57c('0x2c');return db[_0xa57c('0x2d')][_0xa57c('0x2a')]({'where':{'type':_0x8ee1c0,'resourceId':_0x315ad7['id']}})['then'](function(){return _0x5226d0;});})[_0xa57c('0x29')](function(){_0x511a26['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x257661,_0x7d10ec){return function(_0x5a3e03){if(!_0x5a3e03){_0x257661[_0xa57c('0x1c')](0x194);}return _0x5a3e03;};}function handleError(_0x1ef331,_0x3eb9e9){_0x3eb9e9=_0x3eb9e9||0x1f4;return function(_0x57565b){logger[_0xa57c('0x2e')](_0x57565b['stack']);if(_0x57565b[_0xa57c('0x2f')]){delete _0x57565b['name'];}_0x1ef331[_0xa57c('0x1d')](_0x3eb9e9)['send'](_0x57565b);};}exports[_0xa57c('0x30')]=function(_0x532164,_0x9e02bb){var _0x1d82d9={},_0x43c8f3={},_0x304f56={'count':0x0,'rows':[]};var _0xfd0f66=_[_0xa57c('0x31')](db[_0xa57c('0x32')]['rawAttributes'],function(_0x10cc39){return{'name':_0x10cc39['fieldName'],'type':_0x10cc39[_0xa57c('0x33')][_0xa57c('0x34')]};});_0x43c8f3[_0xa57c('0x35')]=_['map'](_0xfd0f66,_0xa57c('0x2f'));_0x43c8f3['query']=_[_0xa57c('0x36')](_0x532164['query']);_0x43c8f3[_0xa57c('0x37')]=_['intersection'](_0x43c8f3[_0xa57c('0x35')],_0x43c8f3[_0xa57c('0x38')]);_0x1d82d9['attributes']=_[_0xa57c('0x39')](_0x43c8f3['model'],qs[_0xa57c('0x3a')](_0x532164['query'][_0xa57c('0x3a')]));_0x1d82d9[_0xa57c('0x3b')]=_0x1d82d9[_0xa57c('0x3b')][_0xa57c('0x3c')]?_0x1d82d9[_0xa57c('0x3b')]:_0x43c8f3[_0xa57c('0x35')];if(!_0x532164['query']['hasOwnProperty'](_0xa57c('0x3d'))){_0x1d82d9[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x532164['query'][_0xa57c('0x21')]);_0x1d82d9['offset']=qs[_0xa57c('0x1f')](_0x532164[_0xa57c('0x38')]['offset']);}_0x1d82d9['order']=qs['sort'](_0x532164[_0xa57c('0x38')][_0xa57c('0x3e')]);_0x1d82d9[_0xa57c('0x3f')]=qs[_0xa57c('0x37')](_[_0xa57c('0x40')](_0x532164[_0xa57c('0x38')],_0x43c8f3['filters']),_0xfd0f66);if(_0x532164[_0xa57c('0x38')][_0xa57c('0x41')]){_0x1d82d9['where']=_['merge'](_0x1d82d9[_0xa57c('0x3f')],{'$or':_[_0xa57c('0x31')](_0xfd0f66,function(_0x5af5e9){if(_0x5af5e9[_0xa57c('0x33')]!==_0xa57c('0x42')){var _0x2112b7={};_0x2112b7[_0x5af5e9[_0xa57c('0x2f')]]={'$like':'%'+_0x532164[_0xa57c('0x38')][_0xa57c('0x41')]+'%'};return _0x2112b7;}})});}_0x1d82d9=_['merge']({},_0x1d82d9,_0x532164[_0xa57c('0x43')]);var _0x527c0f={'where':_0x1d82d9['where']};return db['Team']['count'](_0x527c0f)['then'](function(_0x39b20f){_0x304f56[_0xa57c('0x22')]=_0x39b20f;if(_0x532164[_0xa57c('0x38')]['includeAll']){_0x1d82d9['include']=[{'all':!![]}];}return db['Team'][_0xa57c('0x44')](_0x1d82d9);})[_0xa57c('0x29')](function(_0x44e38f){_0x304f56[_0xa57c('0x45')]=_0x44e38f;return _0x304f56;})[_0xa57c('0x29')](respondWithFilteredResult(_0x9e02bb,_0x1d82d9))[_0xa57c('0x46')](handleError(_0x9e02bb,null));};exports['show']=function(_0xaf0402,_0x22ea97){var _0x34e8f2={'raw':![],'where':{'id':_0xaf0402[_0xa57c('0x47')]['id']}},_0x3a3a4a={};_0x3a3a4a[_0xa57c('0x35')]=_['keys'](db[_0xa57c('0x32')][_0xa57c('0x48')]);_0x3a3a4a[_0xa57c('0x38')]=_[_0xa57c('0x36')](_0xaf0402[_0xa57c('0x38')]);_0x3a3a4a['filters']=_[_0xa57c('0x39')](_0x3a3a4a[_0xa57c('0x35')],_0x3a3a4a[_0xa57c('0x38')]);_0x34e8f2[_0xa57c('0x3b')]=_[_0xa57c('0x39')](_0x3a3a4a[_0xa57c('0x35')],qs['fields'](_0xaf0402[_0xa57c('0x38')][_0xa57c('0x3a')]));_0x34e8f2[_0xa57c('0x3b')]=_0x34e8f2[_0xa57c('0x3b')][_0xa57c('0x3c')]?_0x34e8f2[_0xa57c('0x3b')]:_0x3a3a4a['model'];if(_0xaf0402['query']['includeAll']){_0x34e8f2['include']=[{'all':!![]}];}_0x34e8f2=_[_0xa57c('0x49')]({},_0x34e8f2,_0xaf0402['options']);return db[_0xa57c('0x32')][_0xa57c('0x4a')](_0x34e8f2)['then'](handleEntityNotFound(_0x22ea97,null))[_0xa57c('0x29')](respondWithResult(_0x22ea97,null))[_0xa57c('0x46')](handleError(_0x22ea97,null));};exports[_0xa57c('0x4b')]=function(_0x128ea2,_0x3ef77c){return db['Team'][_0xa57c('0x4b')](_0x128ea2[_0xa57c('0x4c')],{})[_0xa57c('0x29')](function(_0xd57bac){var _0x2e4b84=_0x128ea2['user'][_0xa57c('0x2b')]({'plain':!![]});if(!_0x2e4b84)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e4b84['role']===_0xa57c('0x4d')){var _0x2c706f=_0xd57bac[_0xa57c('0x2b')]({'plain':!![]});var _0x5bf336='Teams';return db[_0xa57c('0x4e')][_0xa57c('0x4a')]({'where':{'name':_0x5bf336,'userProfileId':_0x2e4b84[_0xa57c('0x4f')]},'raw':!![]})[_0xa57c('0x29')](function(_0x4d2899){if(_0x4d2899&&_0x4d2899[_0xa57c('0x50')]===0x0){return db[_0xa57c('0x2d')][_0xa57c('0x4b')]({'name':_0x2c706f['name'],'resourceId':_0x2c706f['id'],'type':_0x4d2899['name'],'sectionId':_0x4d2899['id']},{})[_0xa57c('0x29')](function(){return _0xd57bac;});}else{return _0xd57bac;}})[_0xa57c('0x46')](function(_0x4d5d46){logger[_0xa57c('0x2e')](_0xa57c('0x51'),_0x4d5d46);throw _0x4d5d46;});}return _0xd57bac;})[_0xa57c('0x29')](respondWithResult(_0x3ef77c,0xc9))[_0xa57c('0x46')](handleError(_0x3ef77c,null));};exports[_0xa57c('0x28')]=function(_0xe0572f,_0x4fc413){if(_0xe0572f['body']['id']){delete _0xe0572f['body']['id'];}return db[_0xa57c('0x32')][_0xa57c('0x4a')]({'where':{'id':_0xe0572f[_0xa57c('0x47')]['id']}})[_0xa57c('0x29')](handleEntityNotFound(_0x4fc413,null))[_0xa57c('0x29')](saveUpdates(_0xe0572f[_0xa57c('0x4c')],null))[_0xa57c('0x29')](respondWithResult(_0x4fc413,null))[_0xa57c('0x46')](handleError(_0x4fc413,null));};exports['destroy']=function(_0x4da028,_0x28997e){return db['Team'][_0xa57c('0x4a')]({'where':{'id':_0x4da028[_0xa57c('0x47')]['id']}})[_0xa57c('0x29')](handleEntityNotFound(_0x28997e,null))['then'](removeEntity(_0x28997e,null))[_0xa57c('0x46')](handleError(_0x28997e,null));};exports['getQueues']=function(_0x21b00a,_0x4b3416,_0x39484d){return db[_0xa57c('0x32')][_0xa57c('0x52')]({'where':{'id':_0x21b00a[_0xa57c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b3416,null))[_0xa57c('0x29')](function(_0x2f8d23){if(!_0x21b00a[_0xa57c('0x38')][_0xa57c('0x53')]||!utils[_0xa57c('0x54')](_0x21b00a['query'][_0xa57c('0x53')])){throw new db[(_0xa57c('0x55'))][(_0xa57c('0x56'))](_0xa57c('0x57'));}var _0x2adcf6={};var _0xe5e63={};_0xe5e63[_0xa57c('0x35')]=_[_0xa57c('0x36')](db[_[_0xa57c('0x58')](_0x21b00a[_0xa57c('0x38')]['channel'][_0xa57c('0x59')]())+_0xa57c('0x5a')][_0xa57c('0x48')]);_0xe5e63[_0xa57c('0x38')]=_[_0xa57c('0x36')](_0x21b00a[_0xa57c('0x38')]);_0xe5e63['filters']=_[_0xa57c('0x39')](_0xe5e63[_0xa57c('0x35')],_0xe5e63['query']);_0x2adcf6[_0xa57c('0x3b')]=_[_0xa57c('0x39')](_0xe5e63[_0xa57c('0x35')],qs[_0xa57c('0x3a')](_0x21b00a[_0xa57c('0x38')][_0xa57c('0x3a')]));_0x2adcf6[_0xa57c('0x3b')]=_0x2adcf6['attributes'][_0xa57c('0x3c')]?_0x2adcf6['attributes']:_0xe5e63[_0xa57c('0x35')];_0x2adcf6['limit']=qs[_0xa57c('0x21')](_0x21b00a['query'][_0xa57c('0x21')]);_0x2adcf6[_0xa57c('0x1f')]=qs['offset'](_0x21b00a[_0xa57c('0x38')][_0xa57c('0x1f')]);_0x2adcf6[_0xa57c('0x5b')]=qs[_0xa57c('0x3e')](_0x21b00a['query'][_0xa57c('0x3e')]);_0x2adcf6[_0xa57c('0x3f')]=qs[_0xa57c('0x37')](_[_0xa57c('0x40')](_0x21b00a[_0xa57c('0x38')],_0xe5e63[_0xa57c('0x37')]));_0x2adcf6=_[_0xa57c('0x49')]({},_0x2adcf6,_0x21b00a[_0xa57c('0x43')]);return _0x2f8d23[_0xa57c('0x2b')+_[_0xa57c('0x58')](_0x21b00a[_0xa57c('0x38')][_0xa57c('0x53')][_0xa57c('0x59')]())+_0xa57c('0x5c')](_0x2adcf6);})[_0xa57c('0x29')](respondWithResult(_0x4b3416,null))[_0xa57c('0x46')](handleError(_0x4b3416,null));};exports['addQueues']=function(_0x393119,_0x521503,_0xd6762d){return db[_0xa57c('0x32')][_0xa57c('0x52')]({'where':{'id':_0x393119['params']['id']}})[_0xa57c('0x29')](function(_0x2ccc4d){if(_0x2ccc4d){if(!_0x393119[_0xa57c('0x4c')]['channel']||!utils['isValidChannel'](_0x393119[_0xa57c('0x4c')][_0xa57c('0x53')])){throw new db[(_0xa57c('0x55'))][(_0xa57c('0x56'))](_0xa57c('0x57'));}return _0x2ccc4d[_0xa57c('0x5d')+_[_0xa57c('0x58')](_0x393119[_0xa57c('0x4c')][_0xa57c('0x53')]['toLowerCase']())+_0xa57c('0x5c')](_0x393119[_0xa57c('0x4c')]['ids']);}return null;})[_0xa57c('0x29')](handleEntityNotFound(_0x521503,null))[_0xa57c('0x29')](respondWithStatusCode(_0x521503,null))[_0xa57c('0x46')](handleError(_0x521503,null));};exports[_0xa57c('0x5e')]=function(_0x1bb561,_0x28ec46,_0x42763b){return db[_0xa57c('0x32')]['findOne']({'where':{'id':_0x1bb561[_0xa57c('0x47')]['id']}})[_0xa57c('0x29')](function(_0x4da5bf){if(_0x4da5bf){if(!_0x1bb561[_0xa57c('0x38')][_0xa57c('0x53')]||!utils['isValidChannel'](_0x1bb561['query'][_0xa57c('0x53')])){throw new db[(_0xa57c('0x55'))][(_0xa57c('0x56'))](_0xa57c('0x57'));}return _0x4da5bf[_0xa57c('0x5f')+_['capitalize'](_0x1bb561[_0xa57c('0x38')][_0xa57c('0x53')][_0xa57c('0x59')]())+'Queues'](_0x1bb561[_0xa57c('0x38')]['ids']);}return null;})[_0xa57c('0x29')](handleEntityNotFound(_0x28ec46,null))[_0xa57c('0x29')](respondWithStatusCode(_0x28ec46,null))[_0xa57c('0x46')](handleError(_0x28ec46,null));};exports[_0xa57c('0x60')]=function(_0x4cf28c,_0x3740e9){return db[_0xa57c('0x32')][_0xa57c('0x4a')]({'where':{'id':_0x4cf28c[_0xa57c('0x47')]['id']}})['then'](handleEntityNotFound(_0x3740e9,null))[_0xa57c('0x29')](function(_0x1807ee){if(_0x1807ee){var _0x44e547=['Voice',_0xa57c('0x61'),_0xa57c('0x62'),_0xa57c('0x63'),'Fax',_0xa57c('0x64'),_0xa57c('0x65')];return db[_0xa57c('0x66')][_0xa57c('0x67')](function(_0x59227d){var _0x2a58b5=_[_0xa57c('0x31')](_0x44e547,function(_0x5c92ec){var _0x2dac12={'attributes':['id',_0xa57c('0x2f')]};if(_0x5c92ec==='Voice'){_0x2dac12[_0xa57c('0x68')]={'attributes':['penalty']};}return _0x1807ee[_0xa57c('0x2b')+_0x5c92ec+_0xa57c('0x5c')](_0x2dac12)[_0xa57c('0x29')](function(_0x37c00d){var _0x599408=_[_0xa57c('0x31')](_0x37c00d,function(_0x2288c2){var _0x224a5d=_[_0xa57c('0x31')](_0x4cf28c[_0xa57c('0x4c')][_0xa57c('0x69')],function(_0x18b36e){var _0x390710={'where':{'UserId':_0x18b36e,[_0x5c92ec+_0xa57c('0x6a')]:_0x2288c2['id']},'transaction':_0x59227d};if(_0x5c92ec===_0xa57c('0x6b')){_0x390710[_0xa57c('0x18')]={'penalty':_0x2288c2['TeamVoiceQueue']['penalty']};}return db['User'+_0x5c92ec+_0xa57c('0x5a')]['findOrCreate'](_0x390710)[_0xa57c('0x29')](function(){socket[_0xa57c('0x6c')](_0xa57c('0x4d')+_0x5c92ec+'Queue:save',{'UserId':_0x18b36e,[_0x5c92ec+_0xa57c('0x6a')]:_0x2288c2['id']});if(_0x5c92ec!==_0xa57c('0x6b'))return;return db[_0xa57c('0x6d')][_0xa57c('0x44')]({'where':{'id':_0x4cf28c[_0xa57c('0x4c')][_0xa57c('0x69')],'online':0x1},'attributes':['id',_0xa57c('0x2f'),'online',_0xa57c('0x6e'),_0xa57c('0x6f')],'raw':!![]})['then'](function(_0x4e5292){var _0x1d0d13=_[_0xa57c('0x31')](_0x4e5292,function(_0x4fc97e){return db['UserVoiceQueueRt'][_0xa57c('0x70')]({'membername':_0x4fc97e['name'],'UserId':_0x4fc97e['id'],'queue_name':_0x2288c2[_0xa57c('0x2f')],'VoiceQueueId':_0x2288c2['id'],'interface':_[_0xa57c('0x71')](_0x4fc97e['interface'])?util[_0xa57c('0x72')](_0xa57c('0x73'),_0x4fc97e[_0xa57c('0x2f')]):_0x4fc97e[_0xa57c('0x6f')],'paused':_0x4fc97e[_0xa57c('0x6e')]||![],'penalty':_0x2288c2['TeamVoiceQueue'][_0xa57c('0x74')]},{'transaction':_0x59227d});});return Promise['all'](_0x1d0d13);});});});return Promise[_0xa57c('0x75')](_0x224a5d);});return Promise[_0xa57c('0x75')](_0x599408);});});return Promise['all'](_0x2a58b5)['then'](function(){return _0x1807ee['addAgents'](_0x4cf28c[_0xa57c('0x4c')]['ids'],{'transaction':_0x59227d})['spread'](function(_0x175253){return _0x175253;});});});}})[_0xa57c('0x29')](respondWithResult(_0x3740e9,null))[_0xa57c('0x46')](handleError(_0x3740e9,null));};exports['removeAgents']=function(_0x3d360a,_0x1f28e9){return db[_0xa57c('0x32')]['find']({'where':{'id':_0x3d360a['params']['id']}})[_0xa57c('0x29')](handleEntityNotFound(_0x1f28e9,null))['then'](function(_0x377a8b){if(_0x377a8b){var _0x41d535=['Voice',_0xa57c('0x61'),'Mail','Sms','Fax',_0xa57c('0x64'),'Whatsapp'];return db['sequelize']['transaction'](function(_0x3e12e5){var _0x23c39b=_['map'](_0x41d535,function(_0x3d80ba){var _0x22b4ef={'attributes':['id',_0xa57c('0x2f')]};return _0x377a8b['get'+_0x3d80ba+_0xa57c('0x5c')](_0x22b4ef)[_0xa57c('0x29')](function(_0x997b84){var _0x16b727=_['map'](_0x997b84,function(_0x5e0db8){return _0x5e0db8[_0xa57c('0x76')](_0x3d360a['query'][_0xa57c('0x69')],{'transaction':_0x3e12e5})[_0xa57c('0x29')](function(){var _0x2cc12b=JSON['parse']('['+_0x3d360a[_0xa57c('0x38')]['ids']+']');var _0x521e63=_[_0xa57c('0x31')](_0x2cc12b,function(_0x58b935){socket[_0xa57c('0x6c')](_0xa57c('0x4d')+_0x3d80ba+'Queue:remove',{'UserId':Number(_0x58b935),[_0x3d80ba+'QueueId']:_0x5e0db8['id']});if(_0x3d80ba!==_0xa57c('0x6b'))return;return db[_0xa57c('0x77')]['destroy']({'where':{'VoiceQueueId':_0x5e0db8['id'],'UserId':_0x58b935},'transaction':_0x3e12e5});});return Promise['all'](_0x521e63);});});return Promise[_0xa57c('0x75')](_0x16b727);});});return Promise[_0xa57c('0x75')](_0x23c39b)[_0xa57c('0x29')](function(){return _0x377a8b['removeAgents'](_0x3d360a[_0xa57c('0x38')][_0xa57c('0x69')],{'transaction':_0x3e12e5});});});}})[_0xa57c('0x29')](respondWithStatusCode(_0x1f28e9,null))[_0xa57c('0x46')](handleError(_0x1f28e9,null));};exports[_0xa57c('0x78')]=function(_0x1f0c78,_0x10f1b5,_0x4133f7){var _0x39e5d6={};var _0x75888e={};var _0x46b223;var _0x2fa5fe;return db[_0xa57c('0x32')]['findOne']({'where':{'id':_0x1f0c78[_0xa57c('0x47')]['id']}})[_0xa57c('0x29')](handleEntityNotFound(_0x10f1b5,null))[_0xa57c('0x29')](function(_0x107ebd){if(_0x107ebd){_0x46b223=_0x107ebd;_0x75888e[_0xa57c('0x35')]=_[_0xa57c('0x36')](db['User']['rawAttributes']);_0x75888e[_0xa57c('0x38')]=_['keys'](_0x1f0c78['query']);_0x75888e[_0xa57c('0x37')]=_[_0xa57c('0x39')](_0x75888e[_0xa57c('0x35')],_0x75888e['query']);_0x39e5d6[_0xa57c('0x3b')]=_[_0xa57c('0x39')](_0x75888e[_0xa57c('0x35')],qs[_0xa57c('0x3a')](_0x1f0c78[_0xa57c('0x38')]['fields']));_0x39e5d6['attributes']=_0x39e5d6[_0xa57c('0x3b')][_0xa57c('0x3c')]?_0x39e5d6[_0xa57c('0x3b')]:_0x75888e['model'];_0x39e5d6[_0xa57c('0x5b')]=qs['sort'](_0x1f0c78[_0xa57c('0x38')][_0xa57c('0x3e')]);_0x39e5d6[_0xa57c('0x3f')]=qs[_0xa57c('0x37')](_[_0xa57c('0x40')](_0x1f0c78[_0xa57c('0x38')],_0x75888e[_0xa57c('0x37')]));if(_0x1f0c78['query']['filter']){_0x39e5d6[_0xa57c('0x3f')]=_[_0xa57c('0x49')](_0x39e5d6[_0xa57c('0x3f')],{'$or':_['map'](_0x39e5d6['attributes'],function(_0x137489){var _0xfff76a={};_0xfff76a[_0x137489]={'$like':'%'+_0x1f0c78[_0xa57c('0x38')][_0xa57c('0x41')]+'%'};return _0xfff76a;})});}_0x39e5d6=_[_0xa57c('0x49')]({},_0x39e5d6,_0x1f0c78['options']);return _0x46b223[_0xa57c('0x78')](_0x39e5d6);}})[_0xa57c('0x29')](function(_0x79f5f8){if(_0x79f5f8){_0x2fa5fe=_0x79f5f8['length'];if(!_0x1f0c78[_0xa57c('0x38')][_0xa57c('0x79')]('nolimit')){_0x39e5d6[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x1f0c78[_0xa57c('0x38')][_0xa57c('0x21')]);_0x39e5d6[_0xa57c('0x1f')]=qs[_0xa57c('0x1f')](_0x1f0c78[_0xa57c('0x38')][_0xa57c('0x1f')]);}return _0x46b223[_0xa57c('0x78')](_0x39e5d6);}})['then'](function(_0x347814){if(_0x347814){return _0x347814?{'count':_0x2fa5fe,'rows':_0x347814}:null;}})[_0xa57c('0x29')](respondWithResult(_0x10f1b5,null))[_0xa57c('0x46')](handleError(_0x10f1b5,null));}; \ No newline at end of file +var _0x1a85=['squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','Teams','UserProfileResource','sendStatus','error','stack','name','index','map','Team','rawAttributes','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','addQueues','isValidChannel','add','removeQueues','findOne','remove','ids','addAgents','Mail','Sms','Fax','Whatsapp','sequelize','transaction','Voice','through','penalty','TeamVoiceQueue','findOrCreate','emit','Queue:save','QueueId','online','interface','isNil','format','SIP/%s','voicePause','all','spread','removeAgents','Openchannel','parse','Queue:remove','UserVoiceQueueRt','getAgents','User','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra'];(function(_0x4e0db4,_0x5e58bf){var _0x5d0c7e=function(_0x4dbb13){while(--_0x4dbb13){_0x4e0db4['push'](_0x4e0db4['shift']());}};_0x5d0c7e(++_0x5e58bf);}(_0x1a85,0x178));var _0x51a8=function(_0x2947d1,_0x5e70b0){_0x2947d1=_0x2947d1-0x0;var _0x2b36a5=_0x1a85[_0x2947d1];return _0x2b36a5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];config[_0x51a8('0x17')]=_[_0x51a8('0x18')](config[_0x51a8('0x17')],{'host':_0x51a8('0x19'),'port':0x18eb});var socket=require(_0x51a8('0x1a'))(new Redis(config['redis']));require(_0x51a8('0x1b'))[_0x51a8('0x1c')](socket);function respondWithStatusCode(_0xaec066,_0x50d992){_0x50d992=_0x50d992||0xcc;return function(_0xf4eb6e){if(_0xf4eb6e){return _0xaec066['sendStatus'](_0x50d992);}return _0xaec066[_0x51a8('0x1d')](_0x50d992)[_0x51a8('0x1e')]();};}function respondWithResult(_0x39cd45,_0x2b0521){_0x2b0521=_0x2b0521||0xc8;return function(_0x3fbd02){if(_0x3fbd02){return _0x39cd45[_0x51a8('0x1d')](_0x2b0521)[_0x51a8('0x1f')](_0x3fbd02);}};}function respondWithFilteredResult(_0x516abc,_0x1c2f25){return function(_0x45a433){if(_0x45a433){var _0xd52230=typeof _0x1c2f25[_0x51a8('0x20')]===_0x51a8('0x21')&&typeof _0x1c2f25[_0x51a8('0x22')]==='undefined';var _0x1df8c2=_0x45a433[_0x51a8('0x23')];var _0x2217ce=_0xd52230?0x0:_0x1c2f25[_0x51a8('0x20')];var _0x2a4c4c=_0xd52230?_0x45a433[_0x51a8('0x23')]:_0x1c2f25[_0x51a8('0x20')]+_0x1c2f25[_0x51a8('0x22')];var _0x5ac1c0;if(_0x2a4c4c>=_0x1df8c2){_0x2a4c4c=_0x1df8c2;_0x5ac1c0=0xc8;}else{_0x5ac1c0=0xce;}_0x516abc[_0x51a8('0x1d')](_0x5ac1c0);return _0x516abc['set'](_0x51a8('0x24'),_0x2217ce+'-'+_0x2a4c4c+'/'+_0x1df8c2)[_0x51a8('0x1f')](_0x45a433);}return null;};}function patchUpdates(_0x8bda40){return function(_0x3759d6){try{jsonpatch['apply'](_0x3759d6,_0x8bda40,!![]);}catch(_0xae3588){return BPromise['reject'](_0xae3588);}return _0x3759d6['save']();};}function saveUpdates(_0x23d26a,_0x52e503){return function(_0x384d25){if(_0x384d25){return _0x384d25[_0x51a8('0x25')](_0x23d26a)[_0x51a8('0x26')](function(_0x18e2f3){return _0x18e2f3;});}return null;};}function removeEntity(_0x157554,_0x2f2f05){return function(_0x291ed6){if(_0x291ed6){return _0x291ed6[_0x51a8('0x27')]()['then'](function(){var _0x273ce2=_0x291ed6[_0x51a8('0x28')]({'plain':!![]});var _0xca5746=_0x51a8('0x29');return db[_0x51a8('0x2a')][_0x51a8('0x27')]({'where':{'type':_0xca5746,'resourceId':_0x273ce2['id']}})[_0x51a8('0x26')](function(){return _0x291ed6;});})[_0x51a8('0x26')](function(){_0x157554[_0x51a8('0x1d')](0xcc)[_0x51a8('0x1e')]();});}};}function handleEntityNotFound(_0x20c6b5,_0x347a02){return function(_0x4a1548){if(!_0x4a1548){_0x20c6b5[_0x51a8('0x2b')](0x194);}return _0x4a1548;};}function handleError(_0x58cba0,_0x276424){_0x276424=_0x276424||0x1f4;return function(_0x3bc19a){logger[_0x51a8('0x2c')](_0x3bc19a[_0x51a8('0x2d')]);if(_0x3bc19a[_0x51a8('0x2e')]){delete _0x3bc19a['name'];}_0x58cba0[_0x51a8('0x1d')](_0x276424)['send'](_0x3bc19a);};}exports[_0x51a8('0x2f')]=function(_0x24b39a,_0x253a59){var _0x4b19c8={},_0x2080a1={},_0x499a43={'count':0x0,'rows':[]};var _0x25a858=_[_0x51a8('0x30')](db[_0x51a8('0x31')][_0x51a8('0x32')],function(_0x193e0f){return{'name':_0x193e0f['fieldName'],'type':_0x193e0f[_0x51a8('0x33')]['key']};});_0x2080a1[_0x51a8('0x34')]=_[_0x51a8('0x30')](_0x25a858,_0x51a8('0x2e'));_0x2080a1['query']=_[_0x51a8('0x35')](_0x24b39a[_0x51a8('0x36')]);_0x2080a1[_0x51a8('0x37')]=_[_0x51a8('0x38')](_0x2080a1[_0x51a8('0x34')],_0x2080a1['query']);_0x4b19c8['attributes']=_['intersection'](_0x2080a1[_0x51a8('0x34')],qs[_0x51a8('0x39')](_0x24b39a['query'][_0x51a8('0x39')]));_0x4b19c8['attributes']=_0x4b19c8[_0x51a8('0x3a')][_0x51a8('0x3b')]?_0x4b19c8[_0x51a8('0x3a')]:_0x2080a1[_0x51a8('0x34')];if(!_0x24b39a[_0x51a8('0x36')][_0x51a8('0x3c')]('nolimit')){_0x4b19c8['limit']=qs[_0x51a8('0x22')](_0x24b39a['query']['limit']);_0x4b19c8['offset']=qs[_0x51a8('0x20')](_0x24b39a[_0x51a8('0x36')][_0x51a8('0x20')]);}_0x4b19c8['order']=qs[_0x51a8('0x3d')](_0x24b39a[_0x51a8('0x36')][_0x51a8('0x3d')]);_0x4b19c8[_0x51a8('0x3e')]=qs['filters'](_[_0x51a8('0x3f')](_0x24b39a[_0x51a8('0x36')],_0x2080a1[_0x51a8('0x37')]),_0x25a858);if(_0x24b39a['query'][_0x51a8('0x40')]){_0x4b19c8['where']=_[_0x51a8('0x41')](_0x4b19c8[_0x51a8('0x3e')],{'$or':_[_0x51a8('0x30')](_0x25a858,function(_0x37d50b){if(_0x37d50b['type']!==_0x51a8('0x42')){var _0x3da2cf={};_0x3da2cf[_0x37d50b[_0x51a8('0x2e')]]={'$like':'%'+_0x24b39a[_0x51a8('0x36')][_0x51a8('0x40')]+'%'};return _0x3da2cf;}})});}_0x4b19c8=_[_0x51a8('0x41')]({},_0x4b19c8,_0x24b39a[_0x51a8('0x43')]);var _0x1cdec6={'where':_0x4b19c8[_0x51a8('0x3e')]};return db['Team'][_0x51a8('0x23')](_0x1cdec6)[_0x51a8('0x26')](function(_0x4c7c67){_0x499a43['count']=_0x4c7c67;if(_0x24b39a[_0x51a8('0x36')][_0x51a8('0x44')]){_0x4b19c8[_0x51a8('0x45')]=[{'all':!![]}];}return db[_0x51a8('0x31')][_0x51a8('0x46')](_0x4b19c8);})[_0x51a8('0x26')](function(_0x28f5b3){_0x499a43[_0x51a8('0x47')]=_0x28f5b3;return _0x499a43;})[_0x51a8('0x26')](respondWithFilteredResult(_0x253a59,_0x4b19c8))[_0x51a8('0x48')](handleError(_0x253a59,null));};exports['show']=function(_0x416988,_0x218ae0){var _0x190d52={'raw':![],'where':{'id':_0x416988[_0x51a8('0x49')]['id']}},_0x444b0b={};_0x444b0b[_0x51a8('0x34')]=_['keys'](db[_0x51a8('0x31')]['rawAttributes']);_0x444b0b[_0x51a8('0x36')]=_[_0x51a8('0x35')](_0x416988[_0x51a8('0x36')]);_0x444b0b[_0x51a8('0x37')]=_[_0x51a8('0x38')](_0x444b0b['model'],_0x444b0b['query']);_0x190d52[_0x51a8('0x3a')]=_[_0x51a8('0x38')](_0x444b0b[_0x51a8('0x34')],qs[_0x51a8('0x39')](_0x416988[_0x51a8('0x36')]['fields']));_0x190d52['attributes']=_0x190d52[_0x51a8('0x3a')][_0x51a8('0x3b')]?_0x190d52[_0x51a8('0x3a')]:_0x444b0b[_0x51a8('0x34')];if(_0x416988[_0x51a8('0x36')][_0x51a8('0x44')]){_0x190d52[_0x51a8('0x45')]=[{'all':!![]}];}_0x190d52=_[_0x51a8('0x41')]({},_0x190d52,_0x416988[_0x51a8('0x43')]);return db['Team']['find'](_0x190d52)['then'](handleEntityNotFound(_0x218ae0,null))[_0x51a8('0x26')](respondWithResult(_0x218ae0,null))[_0x51a8('0x48')](handleError(_0x218ae0,null));};exports[_0x51a8('0x4a')]=function(_0x5259f3,_0x3bd492){return db[_0x51a8('0x31')]['create'](_0x5259f3[_0x51a8('0x4b')],{})['then'](function(_0x50a2f8){var _0xbf828b=_0x5259f3[_0x51a8('0x4c')][_0x51a8('0x28')]({'plain':!![]});if(!_0xbf828b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbf828b['role']===_0x51a8('0x4c')){var _0x5b0398=_0x50a2f8[_0x51a8('0x28')]({'plain':!![]});var _0xc89617=_0x51a8('0x29');return db[_0x51a8('0x4d')][_0x51a8('0x4e')]({'where':{'name':_0xc89617,'userProfileId':_0xbf828b[_0x51a8('0x4f')]},'raw':!![]})[_0x51a8('0x26')](function(_0x406a87){if(_0x406a87&&_0x406a87[_0x51a8('0x50')]===0x0){return db['UserProfileResource'][_0x51a8('0x4a')]({'name':_0x5b0398[_0x51a8('0x2e')],'resourceId':_0x5b0398['id'],'type':_0x406a87[_0x51a8('0x2e')],'sectionId':_0x406a87['id']},{})[_0x51a8('0x26')](function(){return _0x50a2f8;});}else{return _0x50a2f8;}})['catch'](function(_0x13b7ba){logger['error'](_0x51a8('0x51'),_0x13b7ba);throw _0x13b7ba;});}return _0x50a2f8;})[_0x51a8('0x26')](respondWithResult(_0x3bd492,0xc9))['catch'](handleError(_0x3bd492,null));};exports['update']=function(_0x2628d4,_0x16f124){if(_0x2628d4[_0x51a8('0x4b')]['id']){delete _0x2628d4[_0x51a8('0x4b')]['id'];}return db[_0x51a8('0x31')]['find']({'where':{'id':_0x2628d4[_0x51a8('0x49')]['id']}})[_0x51a8('0x26')](handleEntityNotFound(_0x16f124,null))[_0x51a8('0x26')](saveUpdates(_0x2628d4[_0x51a8('0x4b')],null))[_0x51a8('0x26')](respondWithResult(_0x16f124,null))['catch'](handleError(_0x16f124,null));};exports[_0x51a8('0x27')]=function(_0x3f37f9,_0x3656ac){return db[_0x51a8('0x31')][_0x51a8('0x4e')]({'where':{'id':_0x3f37f9[_0x51a8('0x49')]['id']}})['then'](handleEntityNotFound(_0x3656ac,null))['then'](removeEntity(_0x3656ac,null))['catch'](handleError(_0x3656ac,null));};exports['getQueues']=function(_0x2048c6,_0x1df9cc,_0x51f9f7){return db[_0x51a8('0x31')]['findOne']({'where':{'id':_0x2048c6[_0x51a8('0x49')]['id']}})['then'](handleEntityNotFound(_0x1df9cc,null))[_0x51a8('0x26')](function(_0x472fdb){if(!_0x2048c6['query']['channel']||!utils['isValidChannel'](_0x2048c6[_0x51a8('0x36')][_0x51a8('0x52')])){throw new db[(_0x51a8('0x53'))][(_0x51a8('0x54'))](_0x51a8('0x55'));}var _0x21c8e0={};var _0x3fd347={};_0x3fd347[_0x51a8('0x34')]=_['keys'](db[_[_0x51a8('0x56')](_0x2048c6[_0x51a8('0x36')]['channel'][_0x51a8('0x57')]())+_0x51a8('0x58')][_0x51a8('0x32')]);_0x3fd347[_0x51a8('0x36')]=_[_0x51a8('0x35')](_0x2048c6[_0x51a8('0x36')]);_0x3fd347['filters']=_['intersection'](_0x3fd347[_0x51a8('0x34')],_0x3fd347['query']);_0x21c8e0['attributes']=_['intersection'](_0x3fd347['model'],qs['fields'](_0x2048c6[_0x51a8('0x36')]['fields']));_0x21c8e0[_0x51a8('0x3a')]=_0x21c8e0[_0x51a8('0x3a')][_0x51a8('0x3b')]?_0x21c8e0[_0x51a8('0x3a')]:_0x3fd347[_0x51a8('0x34')];_0x21c8e0[_0x51a8('0x22')]=qs[_0x51a8('0x22')](_0x2048c6[_0x51a8('0x36')][_0x51a8('0x22')]);_0x21c8e0[_0x51a8('0x20')]=qs['offset'](_0x2048c6[_0x51a8('0x36')][_0x51a8('0x20')]);_0x21c8e0[_0x51a8('0x59')]=qs['sort'](_0x2048c6['query']['sort']);_0x21c8e0[_0x51a8('0x3e')]=qs[_0x51a8('0x37')](_[_0x51a8('0x3f')](_0x2048c6[_0x51a8('0x36')],_0x3fd347[_0x51a8('0x37')]));_0x21c8e0=_[_0x51a8('0x41')]({},_0x21c8e0,_0x2048c6[_0x51a8('0x43')]);return _0x472fdb[_0x51a8('0x28')+_[_0x51a8('0x56')](_0x2048c6[_0x51a8('0x36')][_0x51a8('0x52')][_0x51a8('0x57')]())+_0x51a8('0x5a')](_0x21c8e0);})['then'](respondWithResult(_0x1df9cc,null))[_0x51a8('0x48')](handleError(_0x1df9cc,null));};exports[_0x51a8('0x5b')]=function(_0x52077e,_0x2dc9cb,_0x5140b8){return db['Team']['findOne']({'where':{'id':_0x52077e[_0x51a8('0x49')]['id']}})[_0x51a8('0x26')](function(_0xb480ec){if(_0xb480ec){if(!_0x52077e[_0x51a8('0x4b')][_0x51a8('0x52')]||!utils[_0x51a8('0x5c')](_0x52077e[_0x51a8('0x4b')]['channel'])){throw new db['Sequelize']['ValidationError'](_0x51a8('0x55'));}return _0xb480ec[_0x51a8('0x5d')+_[_0x51a8('0x56')](_0x52077e[_0x51a8('0x4b')][_0x51a8('0x52')][_0x51a8('0x57')]())+'Queues'](_0x52077e[_0x51a8('0x4b')]['ids']);}return null;})[_0x51a8('0x26')](handleEntityNotFound(_0x2dc9cb,null))[_0x51a8('0x26')](respondWithStatusCode(_0x2dc9cb,null))[_0x51a8('0x48')](handleError(_0x2dc9cb,null));};exports[_0x51a8('0x5e')]=function(_0x149a40,_0x3aca4a,_0x895b42){return db[_0x51a8('0x31')][_0x51a8('0x5f')]({'where':{'id':_0x149a40[_0x51a8('0x49')]['id']}})[_0x51a8('0x26')](function(_0x55b9a0){if(_0x55b9a0){if(!_0x149a40['query'][_0x51a8('0x52')]||!utils[_0x51a8('0x5c')](_0x149a40[_0x51a8('0x36')][_0x51a8('0x52')])){throw new db['Sequelize'][(_0x51a8('0x54'))]('Unknown\x20channel');}return _0x55b9a0[_0x51a8('0x60')+_[_0x51a8('0x56')](_0x149a40[_0x51a8('0x36')][_0x51a8('0x52')][_0x51a8('0x57')]())+_0x51a8('0x5a')](_0x149a40[_0x51a8('0x36')][_0x51a8('0x61')]);}return null;})[_0x51a8('0x26')](handleEntityNotFound(_0x3aca4a,null))['then'](respondWithStatusCode(_0x3aca4a,null))[_0x51a8('0x48')](handleError(_0x3aca4a,null));};exports[_0x51a8('0x62')]=function(_0x3e80db,_0x353e90){return db['Team']['find']({'where':{'id':_0x3e80db[_0x51a8('0x49')]['id']}})['then'](handleEntityNotFound(_0x353e90,null))['then'](function(_0x58acce){if(_0x58acce){var _0xeb5d67=['Voice','Chat',_0x51a8('0x63'),_0x51a8('0x64'),_0x51a8('0x65'),'Openchannel',_0x51a8('0x66')];return db[_0x51a8('0x67')][_0x51a8('0x68')](function(_0x5f20f7){var _0x3ac9c8=_[_0x51a8('0x30')](_0xeb5d67,function(_0x24838b){var _0x16e90a={'attributes':['id',_0x51a8('0x2e')]};if(_0x24838b===_0x51a8('0x69')){_0x16e90a[_0x51a8('0x6a')]={'attributes':[_0x51a8('0x6b')]};}return _0x58acce[_0x51a8('0x28')+_0x24838b+'Queues'](_0x16e90a)[_0x51a8('0x26')](function(_0x3be132){var _0x4e2c5d=_[_0x51a8('0x30')](_0x3be132,function(_0x43112c){var _0x5d9e3b=_[_0x51a8('0x30')](_0x3e80db[_0x51a8('0x4b')][_0x51a8('0x61')],function(_0x17fd0a){var _0x398fb2={'where':{'UserId':_0x17fd0a,[_0x24838b+'QueueId']:_0x43112c['id']},'transaction':_0x5f20f7};if(_0x24838b===_0x51a8('0x69')){_0x398fb2[_0x51a8('0x18')]={'penalty':_0x43112c[_0x51a8('0x6c')][_0x51a8('0x6b')]};}return db['User'+_0x24838b+_0x51a8('0x58')][_0x51a8('0x6d')](_0x398fb2)[_0x51a8('0x26')](function(){socket[_0x51a8('0x6e')](_0x51a8('0x4c')+_0x24838b+_0x51a8('0x6f'),{'UserId':_0x17fd0a,[_0x24838b+_0x51a8('0x70')]:_0x43112c['id']});if(_0x24838b!==_0x51a8('0x69'))return;return db['User'][_0x51a8('0x46')]({'where':{'id':_0x3e80db[_0x51a8('0x4b')]['ids'],'online':0x1},'attributes':['id',_0x51a8('0x2e'),_0x51a8('0x71'),'voicePause',_0x51a8('0x72')],'raw':!![]})['then'](function(_0x48ad09){var _0x337ab2=_[_0x51a8('0x30')](_0x48ad09,function(_0x41e0b9){return db['UserVoiceQueueRt']['upsert']({'membername':_0x41e0b9[_0x51a8('0x2e')],'UserId':_0x41e0b9['id'],'queue_name':_0x43112c['name'],'VoiceQueueId':_0x43112c['id'],'interface':_[_0x51a8('0x73')](_0x41e0b9[_0x51a8('0x72')])?util[_0x51a8('0x74')](_0x51a8('0x75'),_0x41e0b9[_0x51a8('0x2e')]):_0x41e0b9[_0x51a8('0x72')],'paused':_0x41e0b9[_0x51a8('0x76')]||![],'penalty':_0x43112c[_0x51a8('0x6c')][_0x51a8('0x6b')]},{'transaction':_0x5f20f7});});return Promise[_0x51a8('0x77')](_0x337ab2);});});});return Promise[_0x51a8('0x77')](_0x5d9e3b);});return Promise[_0x51a8('0x77')](_0x4e2c5d);});});return Promise[_0x51a8('0x77')](_0x3ac9c8)[_0x51a8('0x26')](function(){return _0x58acce[_0x51a8('0x62')](_0x3e80db['body']['ids'],{'transaction':_0x5f20f7})[_0x51a8('0x78')](function(_0x4e25d7){return _0x4e25d7;});});});}})['then'](respondWithResult(_0x353e90,null))['catch'](handleError(_0x353e90,null));};exports[_0x51a8('0x79')]=function(_0x4cac59,_0xbc0075){return db[_0x51a8('0x31')]['find']({'where':{'id':_0x4cac59[_0x51a8('0x49')]['id']}})[_0x51a8('0x26')](handleEntityNotFound(_0xbc0075,null))['then'](function(_0x41819c){if(_0x41819c){var _0x37a542=['Voice','Chat',_0x51a8('0x63'),_0x51a8('0x64'),_0x51a8('0x65'),_0x51a8('0x7a'),_0x51a8('0x66')];return db[_0x51a8('0x67')]['transaction'](function(_0x13dab3){var _0x1c6e75=_[_0x51a8('0x30')](_0x37a542,function(_0x566d62){var _0x315802={'attributes':['id',_0x51a8('0x2e')]};return _0x41819c[_0x51a8('0x28')+_0x566d62+'Queues'](_0x315802)[_0x51a8('0x26')](function(_0x1821a8){var _0x5cf149=_[_0x51a8('0x30')](_0x1821a8,function(_0x529916){return _0x529916[_0x51a8('0x79')](_0x4cac59[_0x51a8('0x36')][_0x51a8('0x61')],{'transaction':_0x13dab3})[_0x51a8('0x26')](function(){var _0x41621c=JSON[_0x51a8('0x7b')]('['+_0x4cac59[_0x51a8('0x36')][_0x51a8('0x61')]+']');var _0x59561f=_[_0x51a8('0x30')](_0x41621c,function(_0x2c9723){socket[_0x51a8('0x6e')](_0x51a8('0x4c')+_0x566d62+_0x51a8('0x7c'),{'UserId':Number(_0x2c9723),[_0x566d62+'QueueId']:_0x529916['id']});if(_0x566d62!=='Voice')return;return db[_0x51a8('0x7d')][_0x51a8('0x27')]({'where':{'VoiceQueueId':_0x529916['id'],'UserId':_0x2c9723},'transaction':_0x13dab3});});return Promise[_0x51a8('0x77')](_0x59561f);});});return Promise[_0x51a8('0x77')](_0x5cf149);});});return Promise[_0x51a8('0x77')](_0x1c6e75)['then'](function(){return _0x41819c[_0x51a8('0x79')](_0x4cac59['query'][_0x51a8('0x61')],{'transaction':_0x13dab3});});});}})[_0x51a8('0x26')](respondWithStatusCode(_0xbc0075,null))['catch'](handleError(_0xbc0075,null));};exports[_0x51a8('0x7e')]=function(_0x5ca2b6,_0x3b7e30,_0x3cf33c){var _0x149091={};var _0x29563a={};var _0x35b703;var _0x5243fd;return db[_0x51a8('0x31')][_0x51a8('0x5f')]({'where':{'id':_0x5ca2b6['params']['id']}})[_0x51a8('0x26')](handleEntityNotFound(_0x3b7e30,null))[_0x51a8('0x26')](function(_0x54e006){if(_0x54e006){_0x35b703=_0x54e006;_0x29563a['model']=_[_0x51a8('0x35')](db[_0x51a8('0x7f')][_0x51a8('0x32')]);_0x29563a['query']=_[_0x51a8('0x35')](_0x5ca2b6[_0x51a8('0x36')]);_0x29563a[_0x51a8('0x37')]=_[_0x51a8('0x38')](_0x29563a[_0x51a8('0x34')],_0x29563a[_0x51a8('0x36')]);_0x149091[_0x51a8('0x3a')]=_['intersection'](_0x29563a[_0x51a8('0x34')],qs[_0x51a8('0x39')](_0x5ca2b6[_0x51a8('0x36')][_0x51a8('0x39')]));_0x149091['attributes']=_0x149091['attributes'][_0x51a8('0x3b')]?_0x149091[_0x51a8('0x3a')]:_0x29563a['model'];_0x149091['order']=qs['sort'](_0x5ca2b6[_0x51a8('0x36')]['sort']);_0x149091['where']=qs['filters'](_[_0x51a8('0x3f')](_0x5ca2b6['query'],_0x29563a[_0x51a8('0x37')]));if(_0x5ca2b6[_0x51a8('0x36')]['filter']){_0x149091['where']=_[_0x51a8('0x41')](_0x149091['where'],{'$or':_[_0x51a8('0x30')](_0x149091[_0x51a8('0x3a')],function(_0x4bf480){var _0x39938f={};_0x39938f[_0x4bf480]={'$like':'%'+_0x5ca2b6[_0x51a8('0x36')]['filter']+'%'};return _0x39938f;})});}_0x149091=_[_0x51a8('0x41')]({},_0x149091,_0x5ca2b6[_0x51a8('0x43')]);return _0x35b703[_0x51a8('0x7e')](_0x149091);}})['then'](function(_0x2af315){if(_0x2af315){_0x5243fd=_0x2af315[_0x51a8('0x3b')];if(!_0x5ca2b6[_0x51a8('0x36')]['hasOwnProperty']('nolimit')){_0x149091[_0x51a8('0x22')]=qs[_0x51a8('0x22')](_0x5ca2b6[_0x51a8('0x36')][_0x51a8('0x22')]);_0x149091[_0x51a8('0x20')]=qs[_0x51a8('0x20')](_0x5ca2b6[_0x51a8('0x36')][_0x51a8('0x20')]);}return _0x35b703[_0x51a8('0x7e')](_0x149091);}})[_0x51a8('0x26')](function(_0x2a8aa1){if(_0x2a8aa1){return _0x2a8aa1?{'count':_0x5243fd,'rows':_0x2a8aa1}:null;}})[_0x51a8('0x26')](respondWithResult(_0x3b7e30,null))[_0x51a8('0x48')](handleError(_0x3b7e30,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 152b0f3..938f5e3 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 _0xcbee=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x44d3d3,_0x30dbe6){var _0x5c828e=function(_0x3b4cf1){while(--_0x3b4cf1){_0x44d3d3['push'](_0x44d3d3['shift']());}};_0x5c828e(++_0x30dbe6);}(_0xcbee,0xcd));var _0xecbe=function(_0x5d9e80,_0x2defaa){_0x5d9e80=_0x5d9e80-0x0;var _0x5635dd=_0xcbee[_0x5d9e80];return _0x5635dd;};'use strict';var EventEmitter=require(_0xecbe('0x0'));var Team=require(_0xecbe('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xecbe('0x2')](0x0);var events={'afterCreate':_0xecbe('0x3'),'afterUpdate':_0xecbe('0x4'),'afterDestroy':_0xecbe('0x5')};function emitEvent(_0x10710d){return function(_0x5a9317,_0x16c130,_0x53c857){TeamEvents[_0xecbe('0x6')](_0x10710d+':'+_0x5a9317['id'],_0x5a9317);TeamEvents[_0xecbe('0x6')](_0x10710d,_0x5a9317);_0x53c857(null);};}for(var e in events){if(events[_0xecbe('0x7')](e)){var event=events[e];Team[_0xecbe('0x8')](e,emitEvent(event));}}module[_0xecbe('0x9')]=TeamEvents; \ No newline at end of file +var _0x7e07=['hook','exports','../../mysqldb','Team','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x438c51,_0x184c33){var _0x27913e=function(_0x33362f){while(--_0x33362f){_0x438c51['push'](_0x438c51['shift']());}};_0x27913e(++_0x184c33);}(_0x7e07,0x162));var _0x77e0=function(_0x269407,_0x1b8f48){_0x269407=_0x269407-0x0;var _0x24aab2=_0x7e07[_0x269407];return _0x24aab2;};'use strict';var EventEmitter=require('events');var Team=require(_0x77e0('0x0'))['db'][_0x77e0('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x77e0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x77e0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1f2827){return function(_0x5b821b,_0x25a67a,_0x3ebdcb){TeamEvents[_0x77e0('0x4')](_0x1f2827+':'+_0x5b821b['id'],_0x5b821b);TeamEvents['emit'](_0x1f2827,_0x5b821b);_0x3ebdcb(null);};}for(var e in events){if(events[_0x77e0('0x5')](e)){var event=events[e];Team[_0x77e0('0x6')](e,emitEvent(event));}}module[_0x77e0('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 6dc4b28..96d06b7 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 _0x13bf=['teams','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define','Team'];(function(_0x2c23b4,_0x3266c3){var _0x513817=function(_0x30d160){while(--_0x30d160){_0x2c23b4['push'](_0x2c23b4['shift']());}};_0x513817(++_0x3266c3);}(_0x13bf,0x189));var _0xf13b=function(_0x33a84f,_0x436c88){_0x33a84f=_0x33a84f-0x0;var _0x351ecb=_0x13bf[_0x33a84f];return _0x351ecb;};'use strict';var _=require(_0xf13b('0x0'));var util=require(_0xf13b('0x1'));var logger=require('../../config/logger')(_0xf13b('0x2'));var moment=require(_0xf13b('0x3'));var BPromise=require(_0xf13b('0x4'));var rp=require(_0xf13b('0x5'));var fs=require('fs');var path=require(_0xf13b('0x6'));var rimraf=require(_0xf13b('0x7'));var config=require(_0xf13b('0x8'));var attributes=require(_0xf13b('0x9'));module[_0xf13b('0xa')]=function(_0x4405f4,_0x26dec){return _0x4405f4[_0xf13b('0xb')](_0xf13b('0xc'),attributes,{'tableName':_0xf13b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1ff=['./team.attributes','Team','teams','lodash','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa1ff,0x150));var _0xfa1f=function(_0x3c4847,_0x63a94e){_0x3c4847=_0x3c4847-0x0;var _0x4eede2=_0xa1ff[_0x3c4847];return _0x4eede2;};'use strict';var _=require(_0xfa1f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfa1f('0x1'));var moment=require('moment');var BPromise=require(_0xfa1f('0x2'));var rp=require(_0xfa1f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa1f('0x4'));var config=require(_0xfa1f('0x5'));var attributes=require(_0xfa1f('0x6'));module['exports']=function(_0x37486f,_0x7f3b64){return _0x37486f['define'](_0xfa1f('0x7'),attributes,{'tableName':_0xfa1f('0x8'),'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 166f462..21f96f5 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 _0x1ccf=['./team.socket','register','then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x53f28e,_0x4d290f){var _0x26d65a=function(_0x57de83){while(--_0x57de83){_0x53f28e['push'](_0x53f28e['shift']());}};_0x26d65a(++_0x4d290f);}(_0x1ccf,0x187));var _0xf1cc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1ccf[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xf1cc('0x0'));var moment=require(_0xf1cc('0x1'));var BPromise=require(_0xf1cc('0x2'));var rs=require(_0xf1cc('0x3'));var fs=require('fs');var Redis=require(_0xf1cc('0x4'));var db=require(_0xf1cc('0x5'))['db'];var utils=require(_0xf1cc('0x6'));var logger=require(_0xf1cc('0x7'))('rpc');var config=require(_0xf1cc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf1cc('0x9')][_0xf1cc('0xa')]({'port':0x232a});config[_0xf1cc('0xb')]=_[_0xf1cc('0xc')](config['redis'],{'host':_0xf1cc('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf1cc('0xe'))[_0xf1cc('0xf')](socket);function respondWithRpcPromise(_0x2a1f72,_0x3b28b7,_0x4eee50){return new BPromise(function(_0x1baae5,_0x376d05){return client['request'](_0x2a1f72,_0x4eee50)[_0xf1cc('0x10')](function(_0x1f7925){logger['info'](_0xf1cc('0x11'),_0x3b28b7,_0xf1cc('0x12'));logger['debug'](_0xf1cc('0x13'),_0x3b28b7,_0xf1cc('0x12'),JSON[_0xf1cc('0x14')](_0x1f7925));if(_0x1f7925['error']){if(_0x1f7925['error'][_0xf1cc('0x15')]===0x1f4){logger['error'](_0xf1cc('0x11'),_0x3b28b7,_0x1f7925['error'][_0xf1cc('0x16')]);return _0x376d05(_0x1f7925[_0xf1cc('0x17')]['message']);}logger[_0xf1cc('0x17')](_0xf1cc('0x11'),_0x3b28b7,_0x1f7925['error'][_0xf1cc('0x16')]);return _0x1baae5(_0x1f7925[_0xf1cc('0x17')][_0xf1cc('0x16')]);}else{logger[_0xf1cc('0x18')](_0xf1cc('0x11'),_0x3b28b7,_0xf1cc('0x12'));_0x1baae5(_0x1f7925[_0xf1cc('0x19')][_0xf1cc('0x16')]);}})[_0xf1cc('0x1a')](function(_0xcde376){logger[_0xf1cc('0x17')](_0xf1cc('0x11'),_0x3b28b7,_0xcde376);_0x376d05(_0xcde376);});});} \ No newline at end of file +var _0x2485=['request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s'];(function(_0x2f548b,_0x56844a){var _0x2fac1a=function(_0x529aad){while(--_0x529aad){_0x2f548b['push'](_0x2f548b['shift']());}};_0x2fac1a(++_0x56844a);}(_0x2485,0x180));var _0x5248=function(_0xd25da3,_0x2a7b4f){_0xd25da3=_0xd25da3-0x0;var _0x531cab=_0x2485[_0xd25da3];return _0x531cab;};'use strict';var _=require(_0x5248('0x0'));var util=require(_0x5248('0x1'));var moment=require(_0x5248('0x2'));var BPromise=require(_0x5248('0x3'));var rs=require(_0x5248('0x4'));var fs=require('fs');var Redis=require(_0x5248('0x5'));var db=require(_0x5248('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5248('0x7'))(_0x5248('0x8'));var config=require(_0x5248('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5248('0xa')][_0x5248('0xb')]({'port':0x232a});config[_0x5248('0xc')]=_[_0x5248('0xd')](config[_0x5248('0xc')],{'host':_0x5248('0xe'),'port':0x18eb});var socket=require(_0x5248('0xf'))(new Redis(config[_0x5248('0xc')]));require(_0x5248('0x10'))[_0x5248('0x11')](socket);function respondWithRpcPromise(_0x59f01c,_0x232ad2,_0x10244e){return new BPromise(function(_0x1a2c3c,_0x1705cb){return client[_0x5248('0x12')](_0x59f01c,_0x10244e)[_0x5248('0x13')](function(_0x178a7c){logger[_0x5248('0x14')](_0x5248('0x15'),_0x232ad2,_0x5248('0x16'));logger[_0x5248('0x17')]('Team,\x20%s,\x20%s,\x20%s',_0x232ad2,'request\x20sent',JSON[_0x5248('0x18')](_0x178a7c));if(_0x178a7c['error']){if(_0x178a7c[_0x5248('0x19')]['code']===0x1f4){logger[_0x5248('0x19')](_0x5248('0x15'),_0x232ad2,_0x178a7c[_0x5248('0x19')]['message']);return _0x1705cb(_0x178a7c['error']['message']);}logger[_0x5248('0x19')]('Team,\x20%s,\x20%s',_0x232ad2,_0x178a7c[_0x5248('0x19')][_0x5248('0x1a')]);return _0x1a2c3c(_0x178a7c[_0x5248('0x19')][_0x5248('0x1a')]);}else{logger[_0x5248('0x14')](_0x5248('0x15'),_0x232ad2,'request\x20sent');_0x1a2c3c(_0x178a7c[_0x5248('0x1b')][_0x5248('0x1a')]);}})[_0x5248('0x1c')](function(_0x4b47fb){logger['error'](_0x5248('0x15'),_0x232ad2,_0x4b47fb);_0x1705cb(_0x4b47fb);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index acd3821..ac1624b 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 _0x13f5=['register','length','team:','./team.events','save','remove','update','removeListener'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x13f5,0xc3));var _0x513f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x13f5[_0x122ef9];return _0x42fba0;};'use strict';var TeamEvents=require(_0x513f('0x0'));var events=[_0x513f('0x1'),_0x513f('0x2'),_0x513f('0x3')];function createListener(_0x55acec,_0x22a388){return function(_0x5795eb){_0x22a388['emit'](_0x55acec,_0x5795eb);};}function removeListener(_0xd61dcf,_0x10ae9e){return function(){TeamEvents[_0x513f('0x4')](_0xd61dcf,_0x10ae9e);};}exports[_0x513f('0x5')]=function(_0x8d019b){for(var _0x579681=0x0,_0x2be368=events[_0x513f('0x6')];_0x579681<_0x2be368;_0x579681++){var _0x2c75a3=events[_0x579681];var _0x42951f=createListener(_0x513f('0x7')+_0x2c75a3,_0x8d019b);TeamEvents['on'](_0x2c75a3,_0x42951f);}}; \ No newline at end of file +var _0x1893=['remove','update','emit','removeListener','register','length'];(function(_0x47bb02,_0x4f230b){var _0x59ca95=function(_0x2d556b){while(--_0x2d556b){_0x47bb02['push'](_0x47bb02['shift']());}};_0x59ca95(++_0x4f230b);}(_0x1893,0xa2));var _0x3189=function(_0x128641,_0x1ec4c1){_0x128641=_0x128641-0x0;var _0x228d4c=_0x1893[_0x128641];return _0x228d4c;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x3189('0x0'),_0x3189('0x1')];function createListener(_0x1b12ad,_0x106df4){return function(_0x10c189){_0x106df4[_0x3189('0x2')](_0x1b12ad,_0x10c189);};}function removeListener(_0x3953a2,_0x5371db){return function(){TeamEvents[_0x3189('0x3')](_0x3953a2,_0x5371db);};}exports[_0x3189('0x4')]=function(_0x2333e6){for(var _0x4080a9=0x0,_0x77c566=events[_0x3189('0x5')];_0x4080a9<_0x77c566;_0x4080a9++){var _0x14d84b=events[_0x4080a9];var _0x1f6764=createListener('team:'+_0x14d84b,_0x2333e6);TeamEvents['on'](_0x14d84b,_0x1f6764);}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 957bbaf..a08ae68 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c1d=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x37e92e,_0x483639){var _0x22a6a8=function(_0x5c7e3d){while(--_0x5c7e3d){_0x37e92e['push'](_0x37e92e['shift']());}};_0x22a6a8(++_0x483639);}(_0x9c1d,0x1a9));var _0xd9c1=function(_0x233fcc,_0x5359d5){_0x233fcc=_0x233fcc-0x0;var _0x4233f9=_0x9c1d[_0x233fcc];return _0x4233f9;};'use strict';var multer=require(_0xd9c1('0x0'));var util=require(_0xd9c1('0x1'));var path=require(_0xd9c1('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9c1('0x3'));var router=express[_0xd9c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd9c1('0x5'));var interaction=require(_0xd9c1('0x6'));var config=require('../../config/environment');module[_0xd9c1('0x7')]=router; \ No newline at end of file +var _0x1ebd=['Router','fs-extra','../../components/auth/service','exports','multer','util','path','express'];(function(_0x1e900d,_0x526f4a){var _0x155a82=function(_0x590a61){while(--_0x590a61){_0x1e900d['push'](_0x1e900d['shift']());}};_0x155a82(++_0x526f4a);}(_0x1ebd,0x64));var _0xd1eb=function(_0x3a7f1f,_0x18f8b6){_0x3a7f1f=_0x3a7f1f-0x0;var _0x581ba4=_0x1ebd[_0x3a7f1f];return _0x581ba4;};'use strict';var multer=require(_0xd1eb('0x0'));var util=require(_0xd1eb('0x1'));var path=require(_0xd1eb('0x2'));var timeout=require('connect-timeout');var express=require(_0xd1eb('0x3'));var router=express[_0xd1eb('0x4')]();var fs_extra=require(_0xd1eb('0x5'));var auth=require(_0xd1eb('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0xd1eb('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index c6dd24e..1e4c899 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['INTEGER','sequelize','exports'];(function(_0x13cb3d,_0x398f09){var _0x2f58e2=function(_0x43b603){while(--_0x43b603){_0x13cb3d['push'](_0x13cb3d['shift']());}};_0x2f58e2(++_0x398f09);}(_0xe706,0xa3));var _0x6e70=function(_0x582d0b,_0x28f609){_0x582d0b=_0x582d0b-0x0;var _0x2e93e1=_0xe706[_0x582d0b];return _0x2e93e1;};'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(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'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/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 42067ad..af93c99 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9aab=['util','api','moment','bluebird','request-promise','path','../../config/environment','define','lodash'];(function(_0x96691d,_0x544a9d){var _0x5a79ca=function(_0x48421a){while(--_0x48421a){_0x96691d['push'](_0x96691d['shift']());}};_0x5a79ca(++_0x544a9d);}(_0x9aab,0x131));var _0xb9aa=function(_0x50b704,_0x1b37de){_0x50b704=_0x50b704-0x0;var _0x3687ca=_0x9aab[_0x50b704];return _0x3687ca;};'use strict';var _=require(_0xb9aa('0x0'));var util=require(_0xb9aa('0x1'));var logger=require('../../config/logger')(_0xb9aa('0x2'));var moment=require(_0xb9aa('0x3'));var BPromise=require(_0xb9aa('0x4'));var rp=require(_0xb9aa('0x5'));var fs=require('fs');var path=require(_0xb9aa('0x6'));var rimraf=require('rimraf');var config=require(_0xb9aa('0x7'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x2b0743,_0x362b19){return _0x2b0743[_0xb9aa('0x8')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfec=['team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue'];(function(_0x1de030,_0x21aa36){var _0x2fd96e=function(_0x3480c5){while(--_0x3480c5){_0x1de030['push'](_0x1de030['shift']());}};_0x2fd96e(++_0x21aa36);}(_0xcfec,0x1a5));var _0xccfe=function(_0x1519ec,_0x26ab64){_0x1519ec=_0x1519ec-0x0;var _0x4ebabc=_0xcfec[_0x1519ec];return _0x4ebabc;};'use strict';var _=require(_0xccfe('0x0'));var util=require(_0xccfe('0x1'));var logger=require(_0xccfe('0x2'))(_0xccfe('0x3'));var moment=require(_0xccfe('0x4'));var BPromise=require(_0xccfe('0x5'));var rp=require(_0xccfe('0x6'));var fs=require('fs');var path=require(_0xccfe('0x7'));var rimraf=require(_0xccfe('0x8'));var config=require(_0xccfe('0x9'));var attributes=require(_0xccfe('0xa'));module[_0xccfe('0xb')]=function(_0x2c6027,_0x5ccce1){return _0x2c6027[_0xccfe('0xc')](_0xccfe('0xd'),attributes,{'tableName':_0xccfe('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 8dcc8d3..a449f12 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b15=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','TeamVoiceQueue,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x2edc88,_0x5f4bb5){var _0x192365=function(_0x573915){while(--_0x573915){_0x2edc88['push'](_0x2edc88['shift']());}};_0x192365(++_0x5f4bb5);}(_0x4b15,0x83));var _0x54b1=function(_0x3b0335,_0x5e8c77){_0x3b0335=_0x3b0335-0x0;var _0x112555=_0x4b15[_0x3b0335];return _0x112555;};'use strict';var _=require(_0x54b1('0x0'));var util=require(_0x54b1('0x1'));var moment=require(_0x54b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x54b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x54b1('0x4'))['db'];var utils=require(_0x54b1('0x5'));var logger=require(_0x54b1('0x6'))(_0x54b1('0x7'));var config=require(_0x54b1('0x8'));var jayson=require(_0x54b1('0x9'));var client=jayson[_0x54b1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e0e53,_0x453bd2,_0x32db6e){return new BPromise(function(_0xc65d4a,_0x1d8fe7){return client[_0x54b1('0xb')](_0x2e0e53,_0x32db6e)['then'](function(_0x10806a){logger[_0x54b1('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x453bd2,_0x54b1('0xd'));logger['debug'](_0x54b1('0xe'),_0x453bd2,_0x54b1('0xd'),JSON['stringify'](_0x10806a));if(_0x10806a['error']){if(_0x10806a[_0x54b1('0xf')]['code']===0x1f4){logger['error'](_0x54b1('0x10'),_0x453bd2,_0x10806a[_0x54b1('0xf')]['message']);return _0x1d8fe7(_0x10806a[_0x54b1('0xf')][_0x54b1('0x11')]);}logger[_0x54b1('0xf')](_0x54b1('0x10'),_0x453bd2,_0x10806a[_0x54b1('0xf')][_0x54b1('0x11')]);return _0xc65d4a(_0x10806a[_0x54b1('0xf')][_0x54b1('0x11')]);}else{logger['info'](_0x54b1('0x10'),_0x453bd2,_0x54b1('0xd'));_0xc65d4a(_0x10806a[_0x54b1('0x12')]['message']);}})['catch'](function(_0x4ea7d2){logger[_0x54b1('0xf')](_0x54b1('0x10'),_0x453bd2,_0x4ea7d2);_0x1d8fe7(_0x4ea7d2);});});} \ No newline at end of file +var _0xf1ff=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3a627e,_0x597c2e){var _0xec24a7=function(_0x4d4393){while(--_0x4d4393){_0x3a627e['push'](_0x3a627e['shift']());}};_0xec24a7(++_0x597c2e);}(_0xf1ff,0xda));var _0xff1f=function(_0x57c4ec,_0xfb1ad0){_0x57c4ec=_0x57c4ec-0x0;var _0x157f3c=_0xf1ff[_0x57c4ec];return _0x157f3c;};'use strict';var _=require(_0xff1f('0x0'));var util=require(_0xff1f('0x1'));var moment=require(_0xff1f('0x2'));var BPromise=require(_0xff1f('0x3'));var rs=require(_0xff1f('0x4'));var fs=require('fs');var Redis=require(_0xff1f('0x5'));var db=require(_0xff1f('0x6'))['db'];var utils=require(_0xff1f('0x7'));var logger=require(_0xff1f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xff1f('0x9'));var client=jayson[_0xff1f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34b711,_0x3ac00c,_0x5d1ad7){return new BPromise(function(_0x1123a1,_0x588989){return client[_0xff1f('0xb')](_0x34b711,_0x5d1ad7)[_0xff1f('0xc')](function(_0x58bf26){logger[_0xff1f('0xd')](_0xff1f('0xe'),_0x3ac00c,_0xff1f('0xf'));logger[_0xff1f('0x10')](_0xff1f('0x11'),_0x3ac00c,_0xff1f('0xf'),JSON[_0xff1f('0x12')](_0x58bf26));if(_0x58bf26[_0xff1f('0x13')]){if(_0x58bf26['error'][_0xff1f('0x14')]===0x1f4){logger['error'](_0xff1f('0xe'),_0x3ac00c,_0x58bf26['error'][_0xff1f('0x15')]);return _0x588989(_0x58bf26[_0xff1f('0x13')][_0xff1f('0x15')]);}logger[_0xff1f('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3ac00c,_0x58bf26[_0xff1f('0x13')][_0xff1f('0x15')]);return _0x1123a1(_0x58bf26[_0xff1f('0x13')][_0xff1f('0x15')]);}else{logger[_0xff1f('0xd')](_0xff1f('0xe'),_0x3ac00c,_0xff1f('0xf'));_0x1123a1(_0x58bf26[_0xff1f('0x16')][_0xff1f('0x15')]);}})[_0xff1f('0x17')](function(_0xb67965){logger[_0xff1f('0x13')](_0xff1f('0xe'),_0x3ac00c,_0xb67965);_0x588989(_0xb67965);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index e544ac8..9a62163 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 _0xee14=['get','/:id','show','post','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated'];(function(_0x5618c4,_0x4e8f57){var _0xdf390f=function(_0x1406cb){while(--_0x1406cb){_0x5618c4['push'](_0x5618c4['shift']());}};_0xdf390f(++_0x4e8f57);}(_0xee14,0x13a));var _0x4ee1=function(_0x3d948f,_0x2ceab5){_0x3d948f=_0x3d948f-0x0;var _0x4d5a21=_0xee14[_0x3d948f];return _0x4d5a21;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var timeout=require(_0x4ee1('0x1'));var express=require(_0x4ee1('0x2'));var router=express[_0x4ee1('0x3')]();var fs_extra=require(_0x4ee1('0x4'));var auth=require(_0x4ee1('0x5'));var interaction=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var controller=require(_0x4ee1('0x8'));router['get']('/',auth[_0x4ee1('0x9')](),controller['index']);router[_0x4ee1('0xa')](_0x4ee1('0xb'),auth[_0x4ee1('0x9')](),controller[_0x4ee1('0xc')]);router[_0x4ee1('0xd')]('/',auth[_0x4ee1('0x9')](),controller['create']);router[_0x4ee1('0xe')](_0x4ee1('0xb'),auth['isAuthenticated'](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0x10')](_0x4ee1('0xb'),auth[_0x4ee1('0x9')](),controller['destroy']);module[_0x4ee1('0x11')]=router; \ No newline at end of file +var _0xda19=['isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xda19,0xd5));var _0x9da1=function(_0x160918,_0x59a227){_0x160918=_0x160918-0x0;var _0x22d127=_0xda19[_0x160918];return _0x22d127;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var fs_extra=require(_0x9da1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var controller=require(_0x9da1('0x6'));router[_0x9da1('0x7')]('/',auth[_0x9da1('0x8')](),controller[_0x9da1('0x9')]);router[_0x9da1('0x7')](_0x9da1('0xa'),auth[_0x9da1('0x8')](),controller[_0x9da1('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9da1('0xc')]('/:id',auth[_0x9da1('0x8')](),controller[_0x9da1('0xd')]);router[_0x9da1('0xe')](_0x9da1('0xa'),auth[_0x9da1('0x8')](),controller[_0x9da1('0xf')]);module[_0x9da1('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 1beb158..d2cac13 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 _0x4729=['STRING','sequelize'];(function(_0x3cbb59,_0x4168ca){var _0x4f09fc=function(_0xea219c){while(--_0xea219c){_0x3cbb59['push'](_0x3cbb59['shift']());}};_0x4f09fc(++_0x4168ca);}(_0x4729,0x123));var _0x9472=function(_0x3551d2,_0x16d66c){_0x3551d2=_0x3551d2-0x0;var _0x51c099=_0x4729[_0x3551d2];return _0x51c099;};'use strict';var Sequelize=require(_0x9472('0x0'));module['exports']={'name':{'type':Sequelize[_0x9472('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xe2a4=['exports','STRING','TEXT','sequelize'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xe2a4,0x193));var _0x4e2a=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0xe2a4[_0x2742db];return _0x18659e;};'use strict';var Sequelize=require(_0x4e2a('0x0'));module[_0x4e2a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4e2a('0x2')]},'html':{'type':Sequelize[_0x4e2a('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index cfcd53d..1effa72 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 _0x1ac8=['type','query','filters','intersection','attributes','model','fields','length','nolimit','limit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','Content-Range','json','reject','update','then','destroy','get','Templates','UserProfileResource','sendStatus','error','name','send','index','Template','rawAttributes','fieldName'];(function(_0x46b0ba,_0x5a767c){var _0x2e53e0=function(_0x124fb2){while(--_0x124fb2){_0x46b0ba['push'](_0x46b0ba['shift']());}};_0x2e53e0(++_0x5a767c);}(_0x1ac8,0xc2));var _0x81ac=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1ac8[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x81ac('0x0'));var rimraf=require(_0x81ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x81ac('0x2'));var rp=require(_0x81ac('0x3'));var moment=require(_0x81ac('0x4'));var BPromise=require(_0x81ac('0x5'));var Mustache=require('mustache');var util=require(_0x81ac('0x6'));var path=require(_0x81ac('0x7'));var sox=require(_0x81ac('0x8'));var csv=require(_0x81ac('0x9'));var ejs=require(_0x81ac('0xa'));var fs=require('fs');var fs_extra=require(_0x81ac('0xb'));var _=require(_0x81ac('0xc'));var squel=require(_0x81ac('0xd'));var crypto=require('crypto');var jsforce=require(_0x81ac('0xe'));var deskjs=require(_0x81ac('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x81ac('0x10'));var Redis=require(_0x81ac('0x11'));var authService=require(_0x81ac('0x12'));var qs=require(_0x81ac('0x13'));var as=require(_0x81ac('0x14'));var hardwareService=require(_0x81ac('0x15'));var logger=require(_0x81ac('0x16'))('api');var utils=require(_0x81ac('0x17'));var config=require(_0x81ac('0x18'));var licenseUtil=require(_0x81ac('0x19'));var db=require(_0x81ac('0x1a'))['db'];function respondWithStatusCode(_0x2d1651,_0x2cc8a9){_0x2cc8a9=_0x2cc8a9||0xcc;return function(_0x50f6e2){if(_0x50f6e2){return _0x2d1651['sendStatus'](_0x2cc8a9);}return _0x2d1651[_0x81ac('0x1b')](_0x2cc8a9)[_0x81ac('0x1c')]();};}function respondWithResult(_0xf2d6b3,_0x96f498){_0x96f498=_0x96f498||0xc8;return function(_0x3c60e0){if(_0x3c60e0){return _0xf2d6b3[_0x81ac('0x1b')](_0x96f498)['json'](_0x3c60e0);}};}function respondWithFilteredResult(_0x210784,_0x16a355){return function(_0x54ef74){if(_0x54ef74){var _0x32e7dc=typeof _0x16a355[_0x81ac('0x1d')]===_0x81ac('0x1e')&&typeof _0x16a355['limit']===_0x81ac('0x1e');var _0x6a8ca6=_0x54ef74[_0x81ac('0x1f')];var _0x1ea8f4=_0x32e7dc?0x0:_0x16a355[_0x81ac('0x1d')];var _0x51c1c1=_0x32e7dc?_0x54ef74['count']:_0x16a355[_0x81ac('0x1d')]+_0x16a355['limit'];var _0x4e2b1b;if(_0x51c1c1>=_0x6a8ca6){_0x51c1c1=_0x6a8ca6;_0x4e2b1b=0xc8;}else{_0x4e2b1b=0xce;}_0x210784['status'](_0x4e2b1b);return _0x210784['set'](_0x81ac('0x20'),_0x1ea8f4+'-'+_0x51c1c1+'/'+_0x6a8ca6)[_0x81ac('0x21')](_0x54ef74);}return null;};}function patchUpdates(_0x26c366){return function(_0x678734){try{jsonpatch['apply'](_0x678734,_0x26c366,!![]);}catch(_0x4de27e){return BPromise[_0x81ac('0x22')](_0x4de27e);}return _0x678734['save']();};}function saveUpdates(_0x515614,_0x1efd30){return function(_0x57d2eb){if(_0x57d2eb){return _0x57d2eb[_0x81ac('0x23')](_0x515614)[_0x81ac('0x24')](function(_0x331e8b){return _0x331e8b;});}return null;};}function removeEntity(_0x202e31,_0x204733){return function(_0xfbe6da){if(_0xfbe6da){return _0xfbe6da[_0x81ac('0x25')]()[_0x81ac('0x24')](function(){var _0x41f9f1=_0xfbe6da[_0x81ac('0x26')]({'plain':!![]});var _0x513500=_0x81ac('0x27');return db[_0x81ac('0x28')][_0x81ac('0x25')]({'where':{'type':_0x513500,'resourceId':_0x41f9f1['id']}})[_0x81ac('0x24')](function(){return _0xfbe6da;});})['then'](function(){_0x202e31[_0x81ac('0x1b')](0xcc)[_0x81ac('0x1c')]();});}};}function handleEntityNotFound(_0x5bfa68,_0xb8d5af){return function(_0xd7b9ef){if(!_0xd7b9ef){_0x5bfa68[_0x81ac('0x29')](0x194);}return _0xd7b9ef;};}function handleError(_0xe456df,_0x6a0f25){_0x6a0f25=_0x6a0f25||0x1f4;return function(_0x51d581){logger[_0x81ac('0x2a')](_0x51d581['stack']);if(_0x51d581[_0x81ac('0x2b')]){delete _0x51d581[_0x81ac('0x2b')];}_0xe456df[_0x81ac('0x1b')](_0x6a0f25)[_0x81ac('0x2c')](_0x51d581);};}exports[_0x81ac('0x2d')]=function(_0x499936,_0x479fab){var _0x17a467={},_0x11c614={},_0x10dbfd={'count':0x0,'rows':[]};var _0x6bc317=_['map'](db[_0x81ac('0x2e')][_0x81ac('0x2f')],function(_0x576262){return{'name':_0x576262[_0x81ac('0x30')],'type':_0x576262[_0x81ac('0x31')]['key']};});_0x11c614['model']=_['map'](_0x6bc317,_0x81ac('0x2b'));_0x11c614[_0x81ac('0x32')]=_['keys'](_0x499936['query']);_0x11c614[_0x81ac('0x33')]=_[_0x81ac('0x34')](_0x11c614['model'],_0x11c614[_0x81ac('0x32')]);_0x17a467[_0x81ac('0x35')]=_['intersection'](_0x11c614[_0x81ac('0x36')],qs[_0x81ac('0x37')](_0x499936[_0x81ac('0x32')][_0x81ac('0x37')]));_0x17a467[_0x81ac('0x35')]=_0x17a467['attributes'][_0x81ac('0x38')]?_0x17a467[_0x81ac('0x35')]:_0x11c614[_0x81ac('0x36')];if(!_0x499936[_0x81ac('0x32')]['hasOwnProperty'](_0x81ac('0x39'))){_0x17a467[_0x81ac('0x3a')]=qs[_0x81ac('0x3a')](_0x499936['query']['limit']);_0x17a467[_0x81ac('0x1d')]=qs[_0x81ac('0x1d')](_0x499936[_0x81ac('0x32')][_0x81ac('0x1d')]);}_0x17a467['order']=qs[_0x81ac('0x3b')](_0x499936[_0x81ac('0x32')][_0x81ac('0x3b')]);_0x17a467[_0x81ac('0x3c')]=qs[_0x81ac('0x33')](_['pick'](_0x499936[_0x81ac('0x32')],_0x11c614['filters']),_0x6bc317);if(_0x499936[_0x81ac('0x32')][_0x81ac('0x3d')]){_0x17a467[_0x81ac('0x3c')]=_[_0x81ac('0x3e')](_0x17a467[_0x81ac('0x3c')],{'$or':_['map'](_0x6bc317,function(_0x5dcffb){if(_0x5dcffb[_0x81ac('0x31')]!==_0x81ac('0x3f')){var _0x4cdee8={};_0x4cdee8[_0x5dcffb[_0x81ac('0x2b')]]={'$like':'%'+_0x499936[_0x81ac('0x32')][_0x81ac('0x3d')]+'%'};return _0x4cdee8;}})});}_0x17a467=_[_0x81ac('0x3e')]({},_0x17a467,_0x499936['options']);var _0x5ee383={'where':_0x17a467[_0x81ac('0x3c')]};return db[_0x81ac('0x2e')][_0x81ac('0x1f')](_0x5ee383)[_0x81ac('0x24')](function(_0x5c720f){_0x10dbfd[_0x81ac('0x1f')]=_0x5c720f;if(_0x499936[_0x81ac('0x32')][_0x81ac('0x40')]){_0x17a467[_0x81ac('0x41')]=[{'all':!![]}];}return db['Template'][_0x81ac('0x42')](_0x17a467);})['then'](function(_0x4f33b2){_0x10dbfd[_0x81ac('0x43')]=_0x4f33b2;return _0x10dbfd;})[_0x81ac('0x24')](respondWithFilteredResult(_0x479fab,_0x17a467))[_0x81ac('0x44')](handleError(_0x479fab,null));};exports[_0x81ac('0x45')]=function(_0x594bfc,_0x1fb990){var _0x430780={'raw':!![],'where':{'id':_0x594bfc[_0x81ac('0x46')]['id']}},_0x298b6f={};_0x298b6f['model']=_[_0x81ac('0x47')](db[_0x81ac('0x2e')][_0x81ac('0x2f')]);_0x298b6f[_0x81ac('0x32')]=_[_0x81ac('0x47')](_0x594bfc[_0x81ac('0x32')]);_0x298b6f['filters']=_[_0x81ac('0x34')](_0x298b6f[_0x81ac('0x36')],_0x298b6f['query']);_0x430780[_0x81ac('0x35')]=_[_0x81ac('0x34')](_0x298b6f['model'],qs[_0x81ac('0x37')](_0x594bfc[_0x81ac('0x32')][_0x81ac('0x37')]));_0x430780['attributes']=_0x430780[_0x81ac('0x35')][_0x81ac('0x38')]?_0x430780[_0x81ac('0x35')]:_0x298b6f[_0x81ac('0x36')];if(_0x594bfc[_0x81ac('0x32')]['includeAll']){_0x430780[_0x81ac('0x41')]=[{'all':!![]}];}_0x430780=_['merge']({},_0x430780,_0x594bfc['options']);return db[_0x81ac('0x2e')][_0x81ac('0x48')](_0x430780)[_0x81ac('0x24')](handleEntityNotFound(_0x1fb990,null))[_0x81ac('0x24')](respondWithResult(_0x1fb990,null))[_0x81ac('0x44')](handleError(_0x1fb990,null));};exports['create']=function(_0x25aac0,_0x1a4f12){return db[_0x81ac('0x2e')][_0x81ac('0x49')](_0x25aac0['body'],{})['then'](function(_0xcf7e9d){var _0xd88b80=_0x25aac0['user']['get']({'plain':!![]});if(!_0xd88b80)throw new Error(_0x81ac('0x4a'));if(_0xd88b80['role']===_0x81ac('0x4b')){var _0x2ef18c=_0xcf7e9d['get']({'plain':!![]});var _0x54921b=_0x81ac('0x27');return db[_0x81ac('0x4c')][_0x81ac('0x48')]({'where':{'name':_0x54921b,'userProfileId':_0xd88b80[_0x81ac('0x4d')]},'raw':!![]})[_0x81ac('0x24')](function(_0x585e97){if(_0x585e97&&_0x585e97[_0x81ac('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x2ef18c['name'],'resourceId':_0x2ef18c['id'],'type':_0x585e97[_0x81ac('0x2b')],'sectionId':_0x585e97['id']},{})[_0x81ac('0x24')](function(){return _0xcf7e9d;});}else{return _0xcf7e9d;}})['catch'](function(_0x447826){logger[_0x81ac('0x2a')](_0x81ac('0x4f'),_0x447826);throw _0x447826;});}return _0xcf7e9d;})['then'](respondWithResult(_0x1a4f12,0xc9))[_0x81ac('0x44')](handleError(_0x1a4f12,null));};exports['update']=function(_0x45a3bb,_0x5d421b){if(_0x45a3bb[_0x81ac('0x50')]['id']){delete _0x45a3bb['body']['id'];}return db[_0x81ac('0x2e')]['find']({'where':{'id':_0x45a3bb[_0x81ac('0x46')]['id']}})[_0x81ac('0x24')](handleEntityNotFound(_0x5d421b,null))['then'](saveUpdates(_0x45a3bb['body'],null))[_0x81ac('0x24')](respondWithResult(_0x5d421b,null))[_0x81ac('0x44')](handleError(_0x5d421b,null));};exports['destroy']=function(_0x574283,_0x289851){return db['Template'][_0x81ac('0x48')]({'where':{'id':_0x574283[_0x81ac('0x46')]['id']}})[_0x81ac('0x24')](handleEntityNotFound(_0x289851,null))[_0x81ac('0x24')](removeEntity(_0x289851,null))[_0x81ac('0x44')](handleError(_0x289851,null));}; \ No newline at end of file +var _0x794d=['moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','Template','fieldName','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','fast-json-patch'];(function(_0x233277,_0x2568a0){var _0x5d215e=function(_0x419752){while(--_0x419752){_0x233277['push'](_0x233277['shift']());}};_0x5d215e(++_0x2568a0);}(_0x794d,0x143));var _0xd794=function(_0x26478e,_0xa4ba6c){_0x26478e=_0x26478e-0x0;var _0x342471=_0x794d[_0x26478e];return _0x342471;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd794('0x0'));var rp=require('request-promise');var moment=require(_0xd794('0x1'));var BPromise=require(_0xd794('0x2'));var Mustache=require(_0xd794('0x3'));var util=require(_0xd794('0x4'));var path=require('path');var sox=require(_0xd794('0x5'));var csv=require(_0xd794('0x6'));var ejs=require(_0xd794('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd794('0x8'));var squel=require(_0xd794('0x9'));var crypto=require(_0xd794('0xa'));var jsforce=require(_0xd794('0xb'));var deskjs=require(_0xd794('0xc'));var toCsv=require(_0xd794('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd794('0xd'));var authService=require(_0xd794('0xe'));var qs=require(_0xd794('0xf'));var as=require(_0xd794('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd794('0x11'));var utils=require(_0xd794('0x12'));var config=require(_0xd794('0x13'));var licenseUtil=require(_0xd794('0x14'));var db=require(_0xd794('0x15'))['db'];function respondWithStatusCode(_0x346c7a,_0x54204c){_0x54204c=_0x54204c||0xcc;return function(_0x5aa2f4){if(_0x5aa2f4){return _0x346c7a[_0xd794('0x16')](_0x54204c);}return _0x346c7a[_0xd794('0x17')](_0x54204c)[_0xd794('0x18')]();};}function respondWithResult(_0x6e086c,_0x1c4170){_0x1c4170=_0x1c4170||0xc8;return function(_0x1ecf9c){if(_0x1ecf9c){return _0x6e086c['status'](_0x1c4170)[_0xd794('0x19')](_0x1ecf9c);}};}function respondWithFilteredResult(_0x555a7c,_0xd41b9e){return function(_0x37dd08){if(_0x37dd08){var _0x551c3a=typeof _0xd41b9e[_0xd794('0x1a')]===_0xd794('0x1b')&&typeof _0xd41b9e[_0xd794('0x1c')]===_0xd794('0x1b');var _0x5f00a2=_0x37dd08[_0xd794('0x1d')];var _0x1b5d3c=_0x551c3a?0x0:_0xd41b9e[_0xd794('0x1a')];var _0x369758=_0x551c3a?_0x37dd08[_0xd794('0x1d')]:_0xd41b9e[_0xd794('0x1a')]+_0xd41b9e[_0xd794('0x1c')];var _0x315508;if(_0x369758>=_0x5f00a2){_0x369758=_0x5f00a2;_0x315508=0xc8;}else{_0x315508=0xce;}_0x555a7c[_0xd794('0x17')](_0x315508);return _0x555a7c[_0xd794('0x1e')]('Content-Range',_0x1b5d3c+'-'+_0x369758+'/'+_0x5f00a2)[_0xd794('0x19')](_0x37dd08);}return null;};}function patchUpdates(_0x3e3732){return function(_0x176320){try{jsonpatch[_0xd794('0x1f')](_0x176320,_0x3e3732,!![]);}catch(_0x4ae1fa){return BPromise['reject'](_0x4ae1fa);}return _0x176320[_0xd794('0x20')]();};}function saveUpdates(_0x4e7bd7,_0x15fa00){return function(_0x5285c0){if(_0x5285c0){return _0x5285c0[_0xd794('0x21')](_0x4e7bd7)[_0xd794('0x22')](function(_0x2ad3d7){return _0x2ad3d7;});}return null;};}function removeEntity(_0x541199,_0x1b2bfb){return function(_0x482f98){if(_0x482f98){return _0x482f98[_0xd794('0x23')]()[_0xd794('0x22')](function(){var _0x470e4a=_0x482f98[_0xd794('0x24')]({'plain':!![]});var _0x12345b=_0xd794('0x25');return db[_0xd794('0x26')][_0xd794('0x23')]({'where':{'type':_0x12345b,'resourceId':_0x470e4a['id']}})['then'](function(){return _0x482f98;});})[_0xd794('0x22')](function(){_0x541199[_0xd794('0x17')](0xcc)[_0xd794('0x18')]();});}};}function handleEntityNotFound(_0x343fe3,_0x573444){return function(_0x30bde1){if(!_0x30bde1){_0x343fe3[_0xd794('0x16')](0x194);}return _0x30bde1;};}function handleError(_0x2b3b7c,_0x173e7e){_0x173e7e=_0x173e7e||0x1f4;return function(_0x3f6d9b){logger[_0xd794('0x27')](_0x3f6d9b[_0xd794('0x28')]);if(_0x3f6d9b['name']){delete _0x3f6d9b[_0xd794('0x29')];}_0x2b3b7c[_0xd794('0x17')](_0x173e7e)[_0xd794('0x2a')](_0x3f6d9b);};}exports['index']=function(_0x18216c,_0x406ff1){var _0x24ca5d={},_0x2e3806={},_0x56d1f6={'count':0x0,'rows':[]};var _0x53b4f0=_['map'](db[_0xd794('0x2b')]['rawAttributes'],function(_0x20f2a3){return{'name':_0x20f2a3[_0xd794('0x2c')],'type':_0x20f2a3[_0xd794('0x2d')][_0xd794('0x2e')]};});_0x2e3806[_0xd794('0x2f')]=_[_0xd794('0x30')](_0x53b4f0,_0xd794('0x29'));_0x2e3806[_0xd794('0x31')]=_['keys'](_0x18216c[_0xd794('0x31')]);_0x2e3806[_0xd794('0x32')]=_['intersection'](_0x2e3806[_0xd794('0x2f')],_0x2e3806[_0xd794('0x31')]);_0x24ca5d[_0xd794('0x33')]=_['intersection'](_0x2e3806[_0xd794('0x2f')],qs[_0xd794('0x34')](_0x18216c[_0xd794('0x31')][_0xd794('0x34')]));_0x24ca5d[_0xd794('0x33')]=_0x24ca5d[_0xd794('0x33')][_0xd794('0x35')]?_0x24ca5d[_0xd794('0x33')]:_0x2e3806[_0xd794('0x2f')];if(!_0x18216c[_0xd794('0x31')][_0xd794('0x36')]('nolimit')){_0x24ca5d[_0xd794('0x1c')]=qs[_0xd794('0x1c')](_0x18216c[_0xd794('0x31')][_0xd794('0x1c')]);_0x24ca5d[_0xd794('0x1a')]=qs[_0xd794('0x1a')](_0x18216c[_0xd794('0x31')][_0xd794('0x1a')]);}_0x24ca5d[_0xd794('0x37')]=qs[_0xd794('0x38')](_0x18216c[_0xd794('0x31')]['sort']);_0x24ca5d['where']=qs['filters'](_['pick'](_0x18216c[_0xd794('0x31')],_0x2e3806[_0xd794('0x32')]),_0x53b4f0);if(_0x18216c[_0xd794('0x31')]['filter']){_0x24ca5d[_0xd794('0x39')]=_['merge'](_0x24ca5d[_0xd794('0x39')],{'$or':_[_0xd794('0x30')](_0x53b4f0,function(_0x13baff){if(_0x13baff['type']!==_0xd794('0x3a')){var _0x4741b7={};_0x4741b7[_0x13baff['name']]={'$like':'%'+_0x18216c[_0xd794('0x31')][_0xd794('0x3b')]+'%'};return _0x4741b7;}})});}_0x24ca5d=_[_0xd794('0x3c')]({},_0x24ca5d,_0x18216c['options']);var _0x42eaa0={'where':_0x24ca5d[_0xd794('0x39')]};return db['Template']['count'](_0x42eaa0)[_0xd794('0x22')](function(_0xa45b4a){_0x56d1f6['count']=_0xa45b4a;if(_0x18216c[_0xd794('0x31')][_0xd794('0x3d')]){_0x24ca5d[_0xd794('0x3e')]=[{'all':!![]}];}return db[_0xd794('0x2b')][_0xd794('0x3f')](_0x24ca5d);})[_0xd794('0x22')](function(_0x382d57){_0x56d1f6[_0xd794('0x40')]=_0x382d57;return _0x56d1f6;})[_0xd794('0x22')](respondWithFilteredResult(_0x406ff1,_0x24ca5d))[_0xd794('0x41')](handleError(_0x406ff1,null));};exports[_0xd794('0x42')]=function(_0x592b38,_0x503c87){var _0x4676e8={'raw':!![],'where':{'id':_0x592b38[_0xd794('0x43')]['id']}},_0xb7b538={};_0xb7b538[_0xd794('0x2f')]=_[_0xd794('0x44')](db[_0xd794('0x2b')][_0xd794('0x45')]);_0xb7b538[_0xd794('0x31')]=_[_0xd794('0x44')](_0x592b38[_0xd794('0x31')]);_0xb7b538[_0xd794('0x32')]=_[_0xd794('0x46')](_0xb7b538[_0xd794('0x2f')],_0xb7b538['query']);_0x4676e8['attributes']=_[_0xd794('0x46')](_0xb7b538[_0xd794('0x2f')],qs[_0xd794('0x34')](_0x592b38['query'][_0xd794('0x34')]));_0x4676e8[_0xd794('0x33')]=_0x4676e8[_0xd794('0x33')][_0xd794('0x35')]?_0x4676e8['attributes']:_0xb7b538[_0xd794('0x2f')];if(_0x592b38[_0xd794('0x31')]['includeAll']){_0x4676e8[_0xd794('0x3e')]=[{'all':!![]}];}_0x4676e8=_[_0xd794('0x3c')]({},_0x4676e8,_0x592b38[_0xd794('0x47')]);return db[_0xd794('0x2b')][_0xd794('0x48')](_0x4676e8)[_0xd794('0x22')](handleEntityNotFound(_0x503c87,null))[_0xd794('0x22')](respondWithResult(_0x503c87,null))[_0xd794('0x41')](handleError(_0x503c87,null));};exports['create']=function(_0x1cf514,_0x76a805){return db['Template'][_0xd794('0x49')](_0x1cf514['body'],{})[_0xd794('0x22')](function(_0x13df76){var _0x585249=_0x1cf514[_0xd794('0x4a')][_0xd794('0x24')]({'plain':!![]});if(!_0x585249)throw new Error(_0xd794('0x4b'));if(_0x585249[_0xd794('0x4c')]==='user'){var _0x59a0c5=_0x13df76[_0xd794('0x24')]({'plain':!![]});var _0x4115c6=_0xd794('0x25');return db[_0xd794('0x4d')]['find']({'where':{'name':_0x4115c6,'userProfileId':_0x585249[_0xd794('0x4e')]},'raw':!![]})['then'](function(_0x50dfbd){if(_0x50dfbd&&_0x50dfbd['autoAssociation']===0x0){return db[_0xd794('0x26')][_0xd794('0x49')]({'name':_0x59a0c5[_0xd794('0x29')],'resourceId':_0x59a0c5['id'],'type':_0x50dfbd[_0xd794('0x29')],'sectionId':_0x50dfbd['id']},{})[_0xd794('0x22')](function(){return _0x13df76;});}else{return _0x13df76;}})[_0xd794('0x41')](function(_0x532b20){logger[_0xd794('0x27')](_0xd794('0x4f'),_0x532b20);throw _0x532b20;});}return _0x13df76;})[_0xd794('0x22')](respondWithResult(_0x76a805,0xc9))['catch'](handleError(_0x76a805,null));};exports[_0xd794('0x21')]=function(_0x48150e,_0x49c0b1){if(_0x48150e[_0xd794('0x50')]['id']){delete _0x48150e[_0xd794('0x50')]['id'];}return db['Template'][_0xd794('0x48')]({'where':{'id':_0x48150e[_0xd794('0x43')]['id']}})[_0xd794('0x22')](handleEntityNotFound(_0x49c0b1,null))['then'](saveUpdates(_0x48150e[_0xd794('0x50')],null))[_0xd794('0x22')](respondWithResult(_0x49c0b1,null))['catch'](handleError(_0x49c0b1,null));};exports[_0xd794('0x23')]=function(_0x59bd91,_0x40d2e9){return db['Template'][_0xd794('0x48')]({'where':{'id':_0x59bd91[_0xd794('0x43')]['id']}})['then'](handleEntityNotFound(_0x40d2e9,null))['then'](removeEntity(_0x40d2e9,null))[_0xd794('0x41')](handleError(_0x40d2e9,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 1af954c..5231bb2 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 _0xd89b=['exports','Template','tools_templates','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./template.attributes'];(function(_0x370b19,_0x123cdc){var _0x4f1d70=function(_0x10509c){while(--_0x10509c){_0x370b19['push'](_0x370b19['shift']());}};_0x4f1d70(++_0x123cdc);}(_0xd89b,0x1f2));var _0xbd89=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xd89b[_0x363ef8];return _0x148822;};'use strict';var _=require(_0xbd89('0x0'));var util=require(_0xbd89('0x1'));var logger=require(_0xbd89('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbd89('0x3'));var rp=require(_0xbd89('0x4'));var fs=require('fs');var path=require(_0xbd89('0x5'));var rimraf=require('rimraf');var config=require(_0xbd89('0x6'));var attributes=require(_0xbd89('0x7'));module[_0xbd89('0x8')]=function(_0x45845b,_0x5dd94b){return _0x45845b['define'](_0xbd89('0x9'),attributes,{'tableName':_0xbd89('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d26=['moment','path','rimraf','./template.attributes','Template','tools_templates','lodash','util','../../config/logger','api'];(function(_0x281fd1,_0x5da85d){var _0x568df1=function(_0x417862){while(--_0x417862){_0x281fd1['push'](_0x281fd1['shift']());}};_0x568df1(++_0x5da85d);}(_0x2d26,0x88));var _0x62d2=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x2d26[_0x521929];return _0x632436;};'use strict';var _=require(_0x62d2('0x0'));var util=require(_0x62d2('0x1'));var logger=require(_0x62d2('0x2'))(_0x62d2('0x3'));var moment=require(_0x62d2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x62d2('0x5'));var rimraf=require(_0x62d2('0x6'));var config=require('../../config/environment');var attributes=require(_0x62d2('0x7'));module['exports']=function(_0x5750b7,_0x1b9129){return _0x5750b7['define'](_0x62d2('0x8'),attributes,{'tableName':_0x62d2('0x9'),'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 6779667..f0cd5ef 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 _0xf65b=['info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Template','findAll','options','raw','where','limit','include','map','model','attributes','GetTemplate','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x4f4126,_0x3ab2de){var _0xf5693=function(_0x5bdb6b){while(--_0x5bdb6b){_0x4f4126['push'](_0x4f4126['shift']());}};_0xf5693(++_0x3ab2de);}(_0xf65b,0x1d5));var _0xbf65=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf65b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xbf65('0x0'));var moment=require(_0xbf65('0x1'));var BPromise=require(_0xbf65('0x2'));var rs=require(_0xbf65('0x3'));var fs=require('fs');var Redis=require(_0xbf65('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbf65('0x5'));var config=require(_0xbf65('0x6'));var jayson=require(_0xbf65('0x7'));var client=jayson[_0xbf65('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cc2f0,_0x56b976,_0x8dd860){return new BPromise(function(_0x18a0cc,_0x1a92aa){return client[_0xbf65('0x9')](_0x3cc2f0,_0x8dd860)[_0xbf65('0xa')](function(_0x2008a2){logger[_0xbf65('0xb')](_0xbf65('0xc'),_0x56b976,_0xbf65('0xd'));logger[_0xbf65('0xe')](_0xbf65('0xf'),_0x56b976,_0xbf65('0xd'),JSON[_0xbf65('0x10')](_0x2008a2));if(_0x2008a2[_0xbf65('0x11')]){if(_0x2008a2['error'][_0xbf65('0x12')]===0x1f4){logger[_0xbf65('0x11')](_0xbf65('0xc'),_0x56b976,_0x2008a2[_0xbf65('0x11')][_0xbf65('0x13')]);return _0x1a92aa(_0x2008a2[_0xbf65('0x11')][_0xbf65('0x13')]);}logger[_0xbf65('0x11')]('Template,\x20%s,\x20%s',_0x56b976,_0x2008a2[_0xbf65('0x11')][_0xbf65('0x13')]);return _0x18a0cc(_0x2008a2[_0xbf65('0x11')]['message']);}else{logger[_0xbf65('0xb')]('Template,\x20%s,\x20%s',_0x56b976,'request\x20sent');_0x18a0cc(_0x2008a2['result']['message']);}})[_0xbf65('0x14')](function(_0x13e2e6){logger[_0xbf65('0x11')](_0xbf65('0xc'),_0x56b976,_0x13e2e6);_0x1a92aa(_0x13e2e6);});});}exports['GetTemplate']=function(_0x573c7d){var _0x33c92b=this;return new Promise(function(_0x266c61,_0xf0a63a){return db[_0xbf65('0x15')][_0xbf65('0x16')]({'raw':_0x573c7d[_0xbf65('0x17')]?_0x573c7d['options'][_0xbf65('0x18')]===undefined?!![]:![]:!![],'where':_0x573c7d[_0xbf65('0x17')]?_0x573c7d[_0xbf65('0x17')][_0xbf65('0x19')]||null:null,'attributes':_0x573c7d[_0xbf65('0x17')]?_0x573c7d[_0xbf65('0x17')]['attributes']||null:null,'limit':_0x573c7d[_0xbf65('0x17')]?_0x573c7d['options'][_0xbf65('0x1a')]||null:null,'include':_0x573c7d[_0xbf65('0x17')]?_0x573c7d[_0xbf65('0x17')][_0xbf65('0x1b')]?_[_0xbf65('0x1c')](_0x573c7d[_0xbf65('0x17')]['include'],function(_0x3c7c92){return{'model':db[_0x3c7c92[_0xbf65('0x1d')]],'as':_0x3c7c92['as'],'attributes':_0x3c7c92[_0xbf65('0x1e')],'include':_0x3c7c92[_0xbf65('0x1b')]?_[_0xbf65('0x1c')](_0x3c7c92['include'],function(_0x40096f){return{'model':db[_0x40096f[_0xbf65('0x1d')]],'as':_0x40096f['as'],'attributes':_0x40096f[_0xbf65('0x1e')],'include':_0x40096f[_0xbf65('0x1b')]?_[_0xbf65('0x1c')](_0x40096f['include'],function(_0x50fea0){return{'model':db[_0x50fea0[_0xbf65('0x1d')]],'as':_0x50fea0['as'],'attributes':_0x50fea0[_0xbf65('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbf65('0xa')](function(_0x14d3eb){logger[_0xbf65('0xb')](_0xbf65('0x1f'),_0x573c7d);logger[_0xbf65('0xe')](_0xbf65('0x1f'),_0x573c7d,JSON[_0xbf65('0x10')](_0x14d3eb));_0x266c61(_0x14d3eb);})['catch'](function(_0x49077e){logger[_0xbf65('0x11')]('GetTemplate',_0x49077e[_0xbf65('0x13')],_0x573c7d);_0xf0a63a(_0x33c92b[_0xbf65('0x11')](0x1f4,_0x49077e[_0xbf65('0x13')]));});});}; \ No newline at end of file +var _0xa22a=['map','GetTemplate','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','options','raw','attributes','limit','include','model'];(function(_0x44427f,_0x4d5cff){var _0xd54970=function(_0x1286ea){while(--_0x1286ea){_0x44427f['push'](_0x44427f['shift']());}};_0xd54970(++_0x4d5cff);}(_0xa22a,0x1e3));var _0xaa22=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa22a[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xaa22('0x0'));var moment=require(_0xaa22('0x1'));var BPromise=require(_0xaa22('0x2'));var rs=require(_0xaa22('0x3'));var fs=require('fs');var Redis=require(_0xaa22('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa22('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xaa22('0x6'));var jayson=require(_0xaa22('0x7'));var client=jayson[_0xaa22('0x8')][_0xaa22('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47b9c4,_0x1111db,_0x5f3421){return new BPromise(function(_0x163673,_0x4ca56e){return client[_0xaa22('0xa')](_0x47b9c4,_0x5f3421)[_0xaa22('0xb')](function(_0x467c59){logger['info'](_0xaa22('0xc'),_0x1111db,'request\x20sent');logger[_0xaa22('0xd')](_0xaa22('0xe'),_0x1111db,_0xaa22('0xf'),JSON['stringify'](_0x467c59));if(_0x467c59[_0xaa22('0x10')]){if(_0x467c59[_0xaa22('0x10')]['code']===0x1f4){logger[_0xaa22('0x10')]('Template,\x20%s,\x20%s',_0x1111db,_0x467c59['error'][_0xaa22('0x11')]);return _0x4ca56e(_0x467c59[_0xaa22('0x10')][_0xaa22('0x11')]);}logger[_0xaa22('0x10')]('Template,\x20%s,\x20%s',_0x1111db,_0x467c59[_0xaa22('0x10')][_0xaa22('0x11')]);return _0x163673(_0x467c59[_0xaa22('0x10')]['message']);}else{logger[_0xaa22('0x12')](_0xaa22('0xc'),_0x1111db,'request\x20sent');_0x163673(_0x467c59[_0xaa22('0x13')]['message']);}})[_0xaa22('0x14')](function(_0x547fd6){logger[_0xaa22('0x10')]('Template,\x20%s,\x20%s',_0x1111db,_0x547fd6);_0x4ca56e(_0x547fd6);});});}exports['GetTemplate']=function(_0x216fc4){var _0x47caad=this;return new Promise(function(_0x53742b,_0x5646fa){return db['Template']['findAll']({'raw':_0x216fc4['options']?_0x216fc4[_0xaa22('0x15')][_0xaa22('0x16')]===undefined?!![]:![]:!![],'where':_0x216fc4[_0xaa22('0x15')]?_0x216fc4[_0xaa22('0x15')]['where']||null:null,'attributes':_0x216fc4[_0xaa22('0x15')]?_0x216fc4[_0xaa22('0x15')][_0xaa22('0x17')]||null:null,'limit':_0x216fc4['options']?_0x216fc4['options'][_0xaa22('0x18')]||null:null,'include':_0x216fc4[_0xaa22('0x15')]?_0x216fc4[_0xaa22('0x15')][_0xaa22('0x19')]?_['map'](_0x216fc4[_0xaa22('0x15')]['include'],function(_0x30a02d){return{'model':db[_0x30a02d[_0xaa22('0x1a')]],'as':_0x30a02d['as'],'attributes':_0x30a02d[_0xaa22('0x17')],'include':_0x30a02d['include']?_[_0xaa22('0x1b')](_0x30a02d[_0xaa22('0x19')],function(_0x5179d3){return{'model':db[_0x5179d3[_0xaa22('0x1a')]],'as':_0x5179d3['as'],'attributes':_0x5179d3[_0xaa22('0x17')],'include':_0x5179d3[_0xaa22('0x19')]?_[_0xaa22('0x1b')](_0x5179d3[_0xaa22('0x19')],function(_0xd07c93){return{'model':db[_0xd07c93['model']],'as':_0xd07c93['as'],'attributes':_0xd07c93[_0xaa22('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b417a){logger[_0xaa22('0x12')](_0xaa22('0x1c'),_0x216fc4);logger[_0xaa22('0xd')](_0xaa22('0x1c'),_0x216fc4,JSON[_0xaa22('0x1d')](_0x1b417a));_0x53742b(_0x1b417a);})[_0xaa22('0x14')](function(_0x39d633){logger[_0xaa22('0x10')](_0xaa22('0x1c'),_0x39d633['message'],_0x216fc4);_0x5646fa(_0x47caad[_0xaa22('0x10')](0x1f4,_0x39d633[_0xaa22('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 00a26f2..64e7c3e 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 _0x3033=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','show','/:id/all_conditions','getAllConditions','getAnyConditions','getActions','post','/:id/any_conditions','addAnyCondition','/:id/actions','addAction','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3033,0x9c));var _0x3303=function(_0x47f06c,_0x520352){_0x47f06c=_0x47f06c-0x0;var _0xe7376=_0x3033[_0x47f06c];return _0xe7376;};'use strict';var multer=require(_0x3303('0x0'));var util=require('util');var path=require(_0x3303('0x1'));var timeout=require(_0x3303('0x2'));var express=require(_0x3303('0x3'));var router=express[_0x3303('0x4')]();var fs_extra=require(_0x3303('0x5'));var auth=require(_0x3303('0x6'));var interaction=require(_0x3303('0x7'));var config=require(_0x3303('0x8'));var controller=require(_0x3303('0x9'));router[_0x3303('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x3303('0xb')](),controller[_0x3303('0xc')]);router[_0x3303('0xa')](_0x3303('0xd'),auth['isAuthenticated'](),controller[_0x3303('0xe')]);router[_0x3303('0xa')]('/:id/any_conditions',auth[_0x3303('0xb')](),controller[_0x3303('0xf')]);router[_0x3303('0xa')]('/:id/actions',auth[_0x3303('0xb')](),controller[_0x3303('0x10')]);router[_0x3303('0x11')]('/',auth[_0x3303('0xb')](),controller['create']);router[_0x3303('0x11')](_0x3303('0xd'),auth[_0x3303('0xb')](),controller['addAllCondition']);router[_0x3303('0x11')](_0x3303('0x12'),auth['isAuthenticated'](),controller[_0x3303('0x13')]);router[_0x3303('0x11')](_0x3303('0x14'),auth[_0x3303('0xb')](),controller[_0x3303('0x15')]);router[_0x3303('0x16')](_0x3303('0x17'),auth[_0x3303('0xb')](),controller[_0x3303('0x18')]);router[_0x3303('0x19')](_0x3303('0x17'),auth['isAuthenticated'](),controller['destroy']);module[_0x3303('0x1a')]=router; \ No newline at end of file +var _0xcb86=['isAuthenticated','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','/:id','show','/:id/all_conditions'];(function(_0x804d17,_0x32c4a7){var _0x24cc4b=function(_0x109402){while(--_0x109402){_0x804d17['push'](_0x804d17['shift']());}};_0x24cc4b(++_0x32c4a7);}(_0xcb86,0x1c3));var _0x6cb8=function(_0x3239fd,_0x30b89a){_0x3239fd=_0x3239fd-0x0;var _0x5b76d3=_0xcb86[_0x3239fd];return _0x5b76d3;};'use strict';var multer=require(_0x6cb8('0x0'));var util=require(_0x6cb8('0x1'));var path=require('path');var timeout=require(_0x6cb8('0x2'));var express=require('express');var router=express[_0x6cb8('0x3')]();var fs_extra=require(_0x6cb8('0x4'));var auth=require(_0x6cb8('0x5'));var interaction=require(_0x6cb8('0x6'));var config=require(_0x6cb8('0x7'));var controller=require(_0x6cb8('0x8'));router[_0x6cb8('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6cb8('0x9')](_0x6cb8('0xa'),auth['isAuthenticated'](),controller[_0x6cb8('0xb')]);router[_0x6cb8('0x9')](_0x6cb8('0xc'),auth[_0x6cb8('0xd')](),controller[_0x6cb8('0xe')]);router[_0x6cb8('0x9')](_0x6cb8('0xf'),auth['isAuthenticated'](),controller[_0x6cb8('0x10')]);router[_0x6cb8('0x9')](_0x6cb8('0x11'),auth[_0x6cb8('0xd')](),controller[_0x6cb8('0x12')]);router[_0x6cb8('0x13')]('/',auth['isAuthenticated'](),controller[_0x6cb8('0x14')]);router['post'](_0x6cb8('0xc'),auth[_0x6cb8('0xd')](),controller[_0x6cb8('0x15')]);router['post'](_0x6cb8('0xf'),auth[_0x6cb8('0xd')](),controller[_0x6cb8('0x16')]);router[_0x6cb8('0x13')](_0x6cb8('0x11'),auth['isAuthenticated'](),controller[_0x6cb8('0x17')]);router[_0x6cb8('0x18')](_0x6cb8('0xa'),auth[_0x6cb8('0xd')](),controller[_0x6cb8('0x19')]);router[_0x6cb8('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x6cb8('0x1b')]);module[_0x6cb8('0x1c')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index ea436b6..a629c59 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 _0x4df2=['sequelize','STRING'];(function(_0x409c15,_0x11b3ac){var _0x241a33=function(_0x52c5ab){while(--_0x52c5ab){_0x409c15['push'](_0x409c15['shift']());}};_0x241a33(++_0x11b3ac);}(_0x4df2,0x190));var _0x24df=function(_0x42f4db,_0x560a6f){_0x42f4db=_0x42f4db-0x0;var _0x1f8949=_0x4df2[_0x42f4db];return _0x1f8949;};'use strict';var Sequelize=require(_0x24df('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x24df('0x1')]},'description':{'type':Sequelize[_0x24df('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x70a7=['STRING','sequelize','exports'];(function(_0x59f33b,_0x5efafd){var _0x4124cf=function(_0x5c1ce4){while(--_0x5c1ce4){_0x59f33b['push'](_0x59f33b['shift']());}};_0x4124cf(++_0x5efafd);}(_0x70a7,0x187));var _0x770a=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x70a7[_0x496738];return _0xee1381;};'use strict';var Sequelize=require(_0x770a('0x0'));module[_0x770a('0x1')]={'name':{'type':Sequelize[_0x770a('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index cffd26b..7f08416 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 _0x1f81=['TriggerAnyId','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition'];(function(_0x3accbf,_0x521148){var _0x5ae57f=function(_0x5e3082){while(--_0x5e3082){_0x3accbf['push'](_0x3accbf['shift']());}};_0x5ae57f(++_0x521148);}(_0x1f81,0x65));var _0x11f8=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x1f81[_0x5959c9];return _0x4ffcbc;};'use strict';var emlformat=require(_0x11f8('0x0'));var rimraf=require(_0x11f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x11f8('0x2'));var rp=require(_0x11f8('0x3'));var moment=require(_0x11f8('0x4'));var BPromise=require(_0x11f8('0x5'));var Mustache=require('mustache');var util=require(_0x11f8('0x6'));var path=require(_0x11f8('0x7'));var sox=require(_0x11f8('0x8'));var csv=require(_0x11f8('0x9'));var ejs=require(_0x11f8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11f8('0xb'));var squel=require(_0x11f8('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x11f8('0xd'));var toCsv=require(_0x11f8('0x9'));var querystring=require(_0x11f8('0xe'));var Papa=require('papaparse');var Redis=require(_0x11f8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x11f8('0x10'));var as=require(_0x11f8('0x11'));var hardwareService=require(_0x11f8('0x12'));var logger=require('../../config/logger')(_0x11f8('0x13'));var utils=require(_0x11f8('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x11f8('0x15'))['db'];function respondWithStatusCode(_0x352141,_0x36b69f){_0x36b69f=_0x36b69f||0xcc;return function(_0x2c23e2){if(_0x2c23e2){return _0x352141[_0x11f8('0x16')](_0x36b69f);}return _0x352141[_0x11f8('0x17')](_0x36b69f)[_0x11f8('0x18')]();};}function respondWithResult(_0x5388ee,_0xbeb7f2){_0xbeb7f2=_0xbeb7f2||0xc8;return function(_0x266df2){if(_0x266df2){return _0x5388ee[_0x11f8('0x17')](_0xbeb7f2)[_0x11f8('0x19')](_0x266df2);}};}function respondWithFilteredResult(_0xec778,_0x2a5645){return function(_0x42f795){if(_0x42f795){var _0x3d8cc8=typeof _0x2a5645[_0x11f8('0x1a')]===_0x11f8('0x1b')&&typeof _0x2a5645[_0x11f8('0x1c')]===_0x11f8('0x1b');var _0x4fd513=_0x42f795[_0x11f8('0x1d')];var _0x375a89=_0x3d8cc8?0x0:_0x2a5645[_0x11f8('0x1a')];var _0x30273f=_0x3d8cc8?_0x42f795[_0x11f8('0x1d')]:_0x2a5645[_0x11f8('0x1a')]+_0x2a5645[_0x11f8('0x1c')];var _0x3403bf;if(_0x30273f>=_0x4fd513){_0x30273f=_0x4fd513;_0x3403bf=0xc8;}else{_0x3403bf=0xce;}_0xec778[_0x11f8('0x17')](_0x3403bf);return _0xec778['set'](_0x11f8('0x1e'),_0x375a89+'-'+_0x30273f+'/'+_0x4fd513)['json'](_0x42f795);}return null;};}function patchUpdates(_0xedd819){return function(_0x5f5596){try{jsonpatch[_0x11f8('0x1f')](_0x5f5596,_0xedd819,!![]);}catch(_0x545b97){return BPromise[_0x11f8('0x20')](_0x545b97);}return _0x5f5596[_0x11f8('0x21')]();};}function saveUpdates(_0x4d0321,_0x2be49d){return function(_0x3005cb){if(_0x3005cb){return _0x3005cb[_0x11f8('0x22')](_0x4d0321)['then'](function(_0x4ec8dd){return _0x4ec8dd;});}return null;};}function removeEntity(_0x5ed290,_0x29813f){return function(_0x4c4cbb){if(_0x4c4cbb){return _0x4c4cbb[_0x11f8('0x23')]()[_0x11f8('0x24')](function(){var _0x42f7d9=_0x4c4cbb[_0x11f8('0x25')]({'plain':!![]});var _0x428a27=_0x11f8('0x26');return db[_0x11f8('0x27')]['destroy']({'where':{'type':_0x428a27,'resourceId':_0x42f7d9['id']}})[_0x11f8('0x24')](function(){return _0x4c4cbb;});})[_0x11f8('0x24')](function(){_0x5ed290['status'](0xcc)[_0x11f8('0x18')]();});}};}function handleEntityNotFound(_0x20de1a,_0x11a560){return function(_0x399a71){if(!_0x399a71){_0x20de1a[_0x11f8('0x16')](0x194);}return _0x399a71;};}function handleError(_0x3aad90,_0x2a66b3){_0x2a66b3=_0x2a66b3||0x1f4;return function(_0x6c2be0){logger[_0x11f8('0x28')](_0x6c2be0[_0x11f8('0x29')]);if(_0x6c2be0[_0x11f8('0x2a')]){delete _0x6c2be0['name'];}_0x3aad90[_0x11f8('0x17')](_0x2a66b3)[_0x11f8('0x2b')](_0x6c2be0);};}exports[_0x11f8('0x2c')]=function(_0x44370e,_0x31b3a4){var _0x144aa2={},_0x154f97={},_0x32cb13={'count':0x0,'rows':[]};var _0x2e1a61=_[_0x11f8('0x2d')](db[_0x11f8('0x2e')][_0x11f8('0x2f')],function(_0x584af2){return{'name':_0x584af2['fieldName'],'type':_0x584af2[_0x11f8('0x30')][_0x11f8('0x31')]};});_0x154f97[_0x11f8('0x32')]=_[_0x11f8('0x2d')](_0x2e1a61,_0x11f8('0x2a'));_0x154f97['query']=_['keys'](_0x44370e[_0x11f8('0x33')]);_0x154f97[_0x11f8('0x34')]=_['intersection'](_0x154f97['model'],_0x154f97[_0x11f8('0x33')]);_0x144aa2[_0x11f8('0x35')]=_[_0x11f8('0x36')](_0x154f97[_0x11f8('0x32')],qs[_0x11f8('0x37')](_0x44370e['query'][_0x11f8('0x37')]));_0x144aa2['attributes']=_0x144aa2['attributes'][_0x11f8('0x38')]?_0x144aa2[_0x11f8('0x35')]:_0x154f97['model'];if(!_0x44370e[_0x11f8('0x33')][_0x11f8('0x39')](_0x11f8('0x3a'))){_0x144aa2[_0x11f8('0x1c')]=qs[_0x11f8('0x1c')](_0x44370e[_0x11f8('0x33')][_0x11f8('0x1c')]);_0x144aa2[_0x11f8('0x1a')]=qs['offset'](_0x44370e[_0x11f8('0x33')][_0x11f8('0x1a')]);}_0x144aa2[_0x11f8('0x3b')]=qs[_0x11f8('0x3c')](_0x44370e['query'][_0x11f8('0x3c')]);_0x144aa2['where']=qs[_0x11f8('0x34')](_[_0x11f8('0x3d')](_0x44370e[_0x11f8('0x33')],_0x154f97[_0x11f8('0x34')]),_0x2e1a61);if(_0x44370e['query']['filter']){_0x144aa2[_0x11f8('0x3e')]=_[_0x11f8('0x3f')](_0x144aa2['where'],{'$or':_['map'](_0x2e1a61,function(_0x28eab8){if(_0x28eab8[_0x11f8('0x30')]!=='VIRTUAL'){var _0x8263ff={};_0x8263ff[_0x28eab8[_0x11f8('0x2a')]]={'$like':'%'+_0x44370e[_0x11f8('0x33')][_0x11f8('0x40')]+'%'};return _0x8263ff;}})});}_0x144aa2=_['merge']({},_0x144aa2,_0x44370e['options']);var _0x425e04={'where':_0x144aa2[_0x11f8('0x3e')]};return db['Trigger'][_0x11f8('0x1d')](_0x425e04)[_0x11f8('0x24')](function(_0x5a201d){_0x32cb13['count']=_0x5a201d;if(_0x44370e[_0x11f8('0x33')][_0x11f8('0x41')]){_0x144aa2['include']=[{'all':!![]}];}return db['Trigger'][_0x11f8('0x42')](_0x144aa2);})[_0x11f8('0x24')](function(_0x1fe706){_0x32cb13[_0x11f8('0x43')]=_0x1fe706;return _0x32cb13;})[_0x11f8('0x24')](respondWithFilteredResult(_0x31b3a4,_0x144aa2))[_0x11f8('0x44')](handleError(_0x31b3a4,null));};exports[_0x11f8('0x45')]=function(_0x2924be,_0x2939c1){var _0x46914f={'raw':![],'where':{'id':_0x2924be[_0x11f8('0x46')]['id']}},_0x332522={};_0x332522['model']=_[_0x11f8('0x47')](db[_0x11f8('0x2e')][_0x11f8('0x2f')]);_0x332522['query']=_[_0x11f8('0x47')](_0x2924be[_0x11f8('0x33')]);_0x332522[_0x11f8('0x34')]=_[_0x11f8('0x36')](_0x332522[_0x11f8('0x32')],_0x332522[_0x11f8('0x33')]);_0x46914f['attributes']=_[_0x11f8('0x36')](_0x332522[_0x11f8('0x32')],qs[_0x11f8('0x37')](_0x2924be[_0x11f8('0x33')]['fields']));_0x46914f[_0x11f8('0x35')]=_0x46914f[_0x11f8('0x35')]['length']?_0x46914f['attributes']:_0x332522[_0x11f8('0x32')];if(_0x2924be[_0x11f8('0x33')][_0x11f8('0x41')]){_0x46914f[_0x11f8('0x48')]=[{'all':!![]}];}_0x46914f=_[_0x11f8('0x3f')]({},_0x46914f,_0x2924be[_0x11f8('0x49')]);return db['Trigger'][_0x11f8('0x4a')](_0x46914f)[_0x11f8('0x24')](handleEntityNotFound(_0x2939c1,null))[_0x11f8('0x24')](respondWithResult(_0x2939c1,null))[_0x11f8('0x44')](handleError(_0x2939c1,null));};exports[_0x11f8('0x4b')]=function(_0x4e18b5,_0x77603e){return db[_0x11f8('0x2e')][_0x11f8('0x4b')](_0x4e18b5[_0x11f8('0x4c')],{})['then'](function(_0x657541){var _0x140add=_0x4e18b5['user'][_0x11f8('0x25')]({'plain':!![]});if(!_0x140add)throw new Error(_0x11f8('0x4d'));if(_0x140add['role']===_0x11f8('0x4e')){var _0x16a0a7=_0x657541[_0x11f8('0x25')]({'plain':!![]});var _0xeb10d1=_0x11f8('0x26');return db['UserProfileSection'][_0x11f8('0x4a')]({'where':{'name':_0xeb10d1,'userProfileId':_0x140add[_0x11f8('0x4f')]},'raw':!![]})[_0x11f8('0x24')](function(_0xc47a12){if(_0xc47a12&&_0xc47a12[_0x11f8('0x50')]===0x0){return db['UserProfileResource'][_0x11f8('0x4b')]({'name':_0x16a0a7['name'],'resourceId':_0x16a0a7['id'],'type':_0xc47a12[_0x11f8('0x2a')],'sectionId':_0xc47a12['id']},{})[_0x11f8('0x24')](function(){return _0x657541;});}else{return _0x657541;}})['catch'](function(_0x265afa){logger[_0x11f8('0x28')](_0x11f8('0x51'),_0x265afa);throw _0x265afa;});}return _0x657541;})[_0x11f8('0x24')](respondWithResult(_0x77603e,0xc9))[_0x11f8('0x44')](handleError(_0x77603e,null));};exports[_0x11f8('0x22')]=function(_0x14aad1,_0x5a3887){if(_0x14aad1[_0x11f8('0x4c')]['id']){delete _0x14aad1[_0x11f8('0x4c')]['id'];}return db[_0x11f8('0x2e')][_0x11f8('0x4a')]({'where':{'id':_0x14aad1[_0x11f8('0x46')]['id']}})[_0x11f8('0x24')](handleEntityNotFound(_0x5a3887,null))[_0x11f8('0x24')](saveUpdates(_0x14aad1[_0x11f8('0x4c')],null))['then'](respondWithResult(_0x5a3887,null))[_0x11f8('0x44')](handleError(_0x5a3887,null));};exports[_0x11f8('0x23')]=function(_0x4320ae,_0xe6c409){return db['Trigger']['find']({'where':{'id':_0x4320ae[_0x11f8('0x46')]['id']}})[_0x11f8('0x24')](handleEntityNotFound(_0xe6c409,null))[_0x11f8('0x24')](removeEntity(_0xe6c409,null))[_0x11f8('0x44')](handleError(_0xe6c409,null));};exports[_0x11f8('0x52')]=function(_0xc4a09d,_0x10e70b,_0x4c0286){if(_0xc4a09d[_0x11f8('0x4c')]['id']){delete _0xc4a09d[_0x11f8('0x4c')]['id'];}return db[_0x11f8('0x2e')]['find']({'where':{'id':_0xc4a09d[_0x11f8('0x46')]['id']}})[_0x11f8('0x24')](handleEntityNotFound(_0x10e70b,null))[_0x11f8('0x24')](function(_0x51da74){if(_0x51da74){_0xc4a09d[_0x11f8('0x4c')][_0x11f8('0x53')]=_0x51da74['id'];return db[_0x11f8('0x54')][_0x11f8('0x4b')](_0xc4a09d[_0x11f8('0x4c')]);}})[_0x11f8('0x24')](respondWithResult(_0x10e70b,null))[_0x11f8('0x44')](handleError(_0x10e70b,null));};exports['addAnyCondition']=function(_0x4811c5,_0x59bc29,_0x508a63){if(_0x4811c5[_0x11f8('0x4c')]['id']){delete _0x4811c5[_0x11f8('0x4c')]['id'];}return db[_0x11f8('0x2e')][_0x11f8('0x4a')]({'where':{'id':_0x4811c5['params']['id']}})['then'](handleEntityNotFound(_0x59bc29,null))[_0x11f8('0x24')](function(_0x50ba0c){if(_0x50ba0c){_0x4811c5[_0x11f8('0x4c')][_0x11f8('0x55')]=_0x50ba0c['id'];return db[_0x11f8('0x54')][_0x11f8('0x4b')](_0x4811c5[_0x11f8('0x4c')]);}})[_0x11f8('0x24')](respondWithResult(_0x59bc29,null))['catch'](handleError(_0x59bc29,null));};exports[_0x11f8('0x56')]=function(_0x52ce8d,_0x47689c,_0x16d9a1){var _0x2960c0={};var _0x304892={};var _0x2e0192;var _0x596ea3;return db[_0x11f8('0x2e')]['findOne']({'where':{'id':_0x52ce8d[_0x11f8('0x46')]['id']}})[_0x11f8('0x24')](handleEntityNotFound(_0x47689c,null))[_0x11f8('0x24')](function(_0x2f1ca7){if(_0x2f1ca7){_0x2e0192=_0x2f1ca7;_0x304892[_0x11f8('0x32')]=_[_0x11f8('0x47')](db[_0x11f8('0x54')][_0x11f8('0x2f')]);_0x304892[_0x11f8('0x33')]=_[_0x11f8('0x47')](_0x52ce8d['query']);_0x304892[_0x11f8('0x34')]=_[_0x11f8('0x36')](_0x304892[_0x11f8('0x32')],_0x304892[_0x11f8('0x33')]);_0x2960c0[_0x11f8('0x35')]=_['intersection'](_0x304892[_0x11f8('0x32')],qs['fields'](_0x52ce8d[_0x11f8('0x33')][_0x11f8('0x37')]));_0x2960c0[_0x11f8('0x35')]=_0x2960c0[_0x11f8('0x35')][_0x11f8('0x38')]?_0x2960c0['attributes']:_0x304892[_0x11f8('0x32')];_0x2960c0['order']=qs['sort'](_0x52ce8d[_0x11f8('0x33')][_0x11f8('0x3c')]);_0x2960c0['where']=qs[_0x11f8('0x34')](_[_0x11f8('0x3d')](_0x52ce8d['query'],_0x304892[_0x11f8('0x34')]));if(_0x52ce8d[_0x11f8('0x33')][_0x11f8('0x40')]){_0x2960c0[_0x11f8('0x3e')]=_['merge'](_0x2960c0[_0x11f8('0x3e')],{'$or':_[_0x11f8('0x2d')](_0x2960c0[_0x11f8('0x35')],function(_0x38c55e){var _0x385ddc={};_0x385ddc[_0x38c55e]={'$like':'%'+_0x52ce8d['query'][_0x11f8('0x40')]+'%'};return _0x385ddc;})});}_0x2960c0=_[_0x11f8('0x3f')]({},_0x2960c0,_0x52ce8d[_0x11f8('0x49')]);return _0x2e0192[_0x11f8('0x56')](_0x2960c0);}})['then'](function(_0x13c0ca){if(_0x13c0ca){_0x596ea3=_0x13c0ca[_0x11f8('0x38')];if(!_0x52ce8d['query'][_0x11f8('0x39')](_0x11f8('0x3a'))){_0x2960c0[_0x11f8('0x1c')]=qs[_0x11f8('0x1c')](_0x52ce8d[_0x11f8('0x33')][_0x11f8('0x1c')]);_0x2960c0[_0x11f8('0x1a')]=qs[_0x11f8('0x1a')](_0x52ce8d[_0x11f8('0x33')][_0x11f8('0x1a')]);}return _0x2e0192[_0x11f8('0x56')](_0x2960c0);}})[_0x11f8('0x24')](function(_0x1039dd){if(_0x1039dd){return _0x1039dd?{'count':_0x596ea3,'rows':_0x1039dd}:null;}})[_0x11f8('0x24')](respondWithResult(_0x47689c,null))['catch'](handleError(_0x47689c,null));};exports['getAnyConditions']=function(_0x19b950,_0x569b67,_0x4ebdea){var _0x38738f={};var _0x5ad753={};var _0x1e6725;var _0x5ab5cc;return db[_0x11f8('0x2e')]['findOne']({'where':{'id':_0x19b950[_0x11f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x569b67,null))[_0x11f8('0x24')](function(_0x33c43e){if(_0x33c43e){_0x1e6725=_0x33c43e;_0x5ad753[_0x11f8('0x32')]=_['keys'](db[_0x11f8('0x54')][_0x11f8('0x2f')]);_0x5ad753[_0x11f8('0x33')]=_[_0x11f8('0x47')](_0x19b950['query']);_0x5ad753[_0x11f8('0x34')]=_['intersection'](_0x5ad753['model'],_0x5ad753[_0x11f8('0x33')]);_0x38738f[_0x11f8('0x35')]=_['intersection'](_0x5ad753[_0x11f8('0x32')],qs[_0x11f8('0x37')](_0x19b950[_0x11f8('0x33')]['fields']));_0x38738f[_0x11f8('0x35')]=_0x38738f['attributes'][_0x11f8('0x38')]?_0x38738f['attributes']:_0x5ad753[_0x11f8('0x32')];_0x38738f[_0x11f8('0x3b')]=qs['sort'](_0x19b950[_0x11f8('0x33')][_0x11f8('0x3c')]);_0x38738f[_0x11f8('0x3e')]=qs[_0x11f8('0x34')](_[_0x11f8('0x3d')](_0x19b950['query'],_0x5ad753[_0x11f8('0x34')]));if(_0x19b950[_0x11f8('0x33')][_0x11f8('0x40')]){_0x38738f[_0x11f8('0x3e')]=_[_0x11f8('0x3f')](_0x38738f[_0x11f8('0x3e')],{'$or':_[_0x11f8('0x2d')](_0x38738f[_0x11f8('0x35')],function(_0x5f7d6){var _0x21940e={};_0x21940e[_0x5f7d6]={'$like':'%'+_0x19b950[_0x11f8('0x33')][_0x11f8('0x40')]+'%'};return _0x21940e;})});}_0x38738f=_[_0x11f8('0x3f')]({},_0x38738f,_0x19b950[_0x11f8('0x49')]);return _0x1e6725['getAnyConditions'](_0x38738f);}})[_0x11f8('0x24')](function(_0x968aaf){if(_0x968aaf){_0x5ab5cc=_0x968aaf[_0x11f8('0x38')];if(!_0x19b950[_0x11f8('0x33')]['hasOwnProperty'](_0x11f8('0x3a'))){_0x38738f[_0x11f8('0x1c')]=qs[_0x11f8('0x1c')](_0x19b950[_0x11f8('0x33')][_0x11f8('0x1c')]);_0x38738f[_0x11f8('0x1a')]=qs[_0x11f8('0x1a')](_0x19b950[_0x11f8('0x33')]['offset']);}return _0x1e6725[_0x11f8('0x57')](_0x38738f);}})[_0x11f8('0x24')](function(_0x5bb910){if(_0x5bb910){return _0x5bb910?{'count':_0x5ab5cc,'rows':_0x5bb910}:null;}})['then'](respondWithResult(_0x569b67,null))['catch'](handleError(_0x569b67,null));};exports[_0x11f8('0x58')]=function(_0x3cc321,_0xb4c7c5,_0x327512){if(_0x3cc321[_0x11f8('0x4c')]['id']){delete _0x3cc321[_0x11f8('0x4c')]['id'];}return db['Trigger'][_0x11f8('0x4a')]({'where':{'id':_0x3cc321[_0x11f8('0x46')]['id']}})[_0x11f8('0x24')](handleEntityNotFound(_0xb4c7c5,null))['then'](function(_0x12486d){if(_0x12486d){_0x3cc321[_0x11f8('0x4c')][_0x11f8('0x59')]=_0x12486d['id'];return db[_0x11f8('0x5a')][_0x11f8('0x4b')](_0x3cc321[_0x11f8('0x4c')]);}})[_0x11f8('0x24')](respondWithResult(_0xb4c7c5,null))[_0x11f8('0x44')](handleError(_0xb4c7c5,null));};exports[_0x11f8('0x5b')]=function(_0xc992d7,_0x2adc44,_0x1d3ea7){var _0xce91d8={};var _0x1769db={};var _0x5f05f0;var _0xa6417c;return db[_0x11f8('0x2e')][_0x11f8('0x5c')]({'where':{'id':_0xc992d7[_0x11f8('0x46')]['id']}})[_0x11f8('0x24')](handleEntityNotFound(_0x2adc44,null))['then'](function(_0x312e17){if(_0x312e17){_0x5f05f0=_0x312e17;_0x1769db['model']=_['keys'](db[_0x11f8('0x5a')]['rawAttributes']);_0x1769db[_0x11f8('0x33')]=_['keys'](_0xc992d7['query']);_0x1769db[_0x11f8('0x34')]=_[_0x11f8('0x36')](_0x1769db[_0x11f8('0x32')],_0x1769db[_0x11f8('0x33')]);_0xce91d8[_0x11f8('0x35')]=_[_0x11f8('0x36')](_0x1769db[_0x11f8('0x32')],qs[_0x11f8('0x37')](_0xc992d7[_0x11f8('0x33')]['fields']));_0xce91d8['attributes']=_0xce91d8[_0x11f8('0x35')]['length']?_0xce91d8[_0x11f8('0x35')]:_0x1769db[_0x11f8('0x32')];_0xce91d8[_0x11f8('0x3b')]=qs[_0x11f8('0x3c')](_0xc992d7[_0x11f8('0x33')][_0x11f8('0x3c')]);_0xce91d8[_0x11f8('0x3e')]=qs[_0x11f8('0x34')](_[_0x11f8('0x3d')](_0xc992d7[_0x11f8('0x33')],_0x1769db['filters']));if(_0xc992d7[_0x11f8('0x33')][_0x11f8('0x40')]){_0xce91d8[_0x11f8('0x3e')]=_[_0x11f8('0x3f')](_0xce91d8[_0x11f8('0x3e')],{'$or':_['map'](_0xce91d8[_0x11f8('0x35')],function(_0x593288){var _0x25beef={};_0x25beef[_0x593288]={'$like':'%'+_0xc992d7[_0x11f8('0x33')][_0x11f8('0x40')]+'%'};return _0x25beef;})});}_0xce91d8=_['merge']({},_0xce91d8,_0xc992d7[_0x11f8('0x49')]);return _0x5f05f0[_0x11f8('0x5b')](_0xce91d8);}})['then'](function(_0x447680){if(_0x447680){_0xa6417c=_0x447680[_0x11f8('0x38')];if(!_0xc992d7[_0x11f8('0x33')][_0x11f8('0x39')](_0x11f8('0x3a'))){_0xce91d8[_0x11f8('0x1c')]=qs['limit'](_0xc992d7['query'][_0x11f8('0x1c')]);_0xce91d8[_0x11f8('0x1a')]=qs[_0x11f8('0x1a')](_0xc992d7['query']['offset']);}return _0x5f05f0['getActions'](_0xce91d8);}})[_0x11f8('0x24')](function(_0x4f3e34){if(_0x4f3e34){return _0x4f3e34?{'count':_0xa6417c,'rows':_0x4f3e34}:null;}})['then'](respondWithResult(_0x2adc44,null))['catch'](handleError(_0x2adc44,null));}; \ No newline at end of file +var _0x90b7=['then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','TriggerAnyId','findOne','length','order','getAllConditions','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update'];(function(_0x560d5d,_0x4f9fc6){var _0x20a655=function(_0xdac46c){while(--_0xdac46c){_0x560d5d['push'](_0x560d5d['shift']());}};_0x20a655(++_0x4f9fc6);}(_0x90b7,0x95));var _0x790b=function(_0x3710b5,_0x3cdf91){_0x3710b5=_0x3710b5-0x0;var _0x20acb1=_0x90b7[_0x3710b5];return _0x20acb1;};'use strict';var emlformat=require(_0x790b('0x0'));var rimraf=require(_0x790b('0x1'));var zipdir=require(_0x790b('0x2'));var jsonpatch=require(_0x790b('0x3'));var rp=require(_0x790b('0x4'));var moment=require(_0x790b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x790b('0x6'));var util=require('util');var path=require(_0x790b('0x7'));var sox=require(_0x790b('0x8'));var csv=require(_0x790b('0x9'));var ejs=require(_0x790b('0xa'));var fs=require('fs');var fs_extra=require(_0x790b('0xb'));var _=require(_0x790b('0xc'));var squel=require(_0x790b('0xd'));var crypto=require(_0x790b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x790b('0xf'));var toCsv=require(_0x790b('0x9'));var querystring=require('querystring');var Papa=require(_0x790b('0x10'));var Redis=require(_0x790b('0x11'));var authService=require(_0x790b('0x12'));var qs=require(_0x790b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x790b('0x14'))(_0x790b('0x15'));var utils=require(_0x790b('0x16'));var config=require(_0x790b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d0251,_0x4acd50){_0x4acd50=_0x4acd50||0xcc;return function(_0x4aa1b9){if(_0x4aa1b9){return _0x4d0251[_0x790b('0x18')](_0x4acd50);}return _0x4d0251[_0x790b('0x19')](_0x4acd50)[_0x790b('0x1a')]();};}function respondWithResult(_0x14dd80,_0x3056fd){_0x3056fd=_0x3056fd||0xc8;return function(_0x391c5e){if(_0x391c5e){return _0x14dd80[_0x790b('0x19')](_0x3056fd)[_0x790b('0x1b')](_0x391c5e);}};}function respondWithFilteredResult(_0xae3434,_0x1bfcb1){return function(_0x427c37){if(_0x427c37){var _0x459f66=typeof _0x1bfcb1[_0x790b('0x1c')]===_0x790b('0x1d')&&typeof _0x1bfcb1[_0x790b('0x1e')]===_0x790b('0x1d');var _0x2b7ced=_0x427c37[_0x790b('0x1f')];var _0x2adf58=_0x459f66?0x0:_0x1bfcb1[_0x790b('0x1c')];var _0xc02f4c=_0x459f66?_0x427c37['count']:_0x1bfcb1[_0x790b('0x1c')]+_0x1bfcb1['limit'];var _0x5d87b5;if(_0xc02f4c>=_0x2b7ced){_0xc02f4c=_0x2b7ced;_0x5d87b5=0xc8;}else{_0x5d87b5=0xce;}_0xae3434[_0x790b('0x19')](_0x5d87b5);return _0xae3434[_0x790b('0x20')](_0x790b('0x21'),_0x2adf58+'-'+_0xc02f4c+'/'+_0x2b7ced)[_0x790b('0x1b')](_0x427c37);}return null;};}function patchUpdates(_0x411423){return function(_0x4bbb5e){try{jsonpatch[_0x790b('0x22')](_0x4bbb5e,_0x411423,!![]);}catch(_0x5f2824){return BPromise[_0x790b('0x23')](_0x5f2824);}return _0x4bbb5e['save']();};}function saveUpdates(_0x57ed07,_0x2b258f){return function(_0x1488f5){if(_0x1488f5){return _0x1488f5[_0x790b('0x24')](_0x57ed07)[_0x790b('0x25')](function(_0x34c3bc){return _0x34c3bc;});}return null;};}function removeEntity(_0x8ae900,_0x53a18f){return function(_0x4eb27a){if(_0x4eb27a){return _0x4eb27a[_0x790b('0x26')]()[_0x790b('0x25')](function(){var _0x2e1700=_0x4eb27a[_0x790b('0x27')]({'plain':!![]});var _0x88d710=_0x790b('0x28');return db[_0x790b('0x29')]['destroy']({'where':{'type':_0x88d710,'resourceId':_0x2e1700['id']}})[_0x790b('0x25')](function(){return _0x4eb27a;});})[_0x790b('0x25')](function(){_0x8ae900[_0x790b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a7c24,_0x50ad59){return function(_0x383249){if(!_0x383249){_0x4a7c24[_0x790b('0x18')](0x194);}return _0x383249;};}function handleError(_0x1022c7,_0x34bf4f){_0x34bf4f=_0x34bf4f||0x1f4;return function(_0x2776ed){logger[_0x790b('0x2a')](_0x2776ed[_0x790b('0x2b')]);if(_0x2776ed['name']){delete _0x2776ed[_0x790b('0x2c')];}_0x1022c7['status'](_0x34bf4f)[_0x790b('0x2d')](_0x2776ed);};}exports[_0x790b('0x2e')]=function(_0x1af566,_0x2c8816){var _0x4c3b48={},_0x521423={},_0x7ee25c={'count':0x0,'rows':[]};var _0x5a4234=_[_0x790b('0x2f')](db[_0x790b('0x30')][_0x790b('0x31')],function(_0x5160f0){return{'name':_0x5160f0[_0x790b('0x32')],'type':_0x5160f0['type'][_0x790b('0x33')]};});_0x521423[_0x790b('0x34')]=_[_0x790b('0x2f')](_0x5a4234,_0x790b('0x2c'));_0x521423['query']=_['keys'](_0x1af566[_0x790b('0x35')]);_0x521423['filters']=_[_0x790b('0x36')](_0x521423['model'],_0x521423['query']);_0x4c3b48[_0x790b('0x37')]=_[_0x790b('0x36')](_0x521423[_0x790b('0x34')],qs[_0x790b('0x38')](_0x1af566[_0x790b('0x35')][_0x790b('0x38')]));_0x4c3b48['attributes']=_0x4c3b48[_0x790b('0x37')]['length']?_0x4c3b48['attributes']:_0x521423[_0x790b('0x34')];if(!_0x1af566[_0x790b('0x35')][_0x790b('0x39')](_0x790b('0x3a'))){_0x4c3b48['limit']=qs[_0x790b('0x1e')](_0x1af566[_0x790b('0x35')][_0x790b('0x1e')]);_0x4c3b48[_0x790b('0x1c')]=qs[_0x790b('0x1c')](_0x1af566[_0x790b('0x35')][_0x790b('0x1c')]);}_0x4c3b48['order']=qs['sort'](_0x1af566[_0x790b('0x35')][_0x790b('0x3b')]);_0x4c3b48[_0x790b('0x3c')]=qs[_0x790b('0x3d')](_[_0x790b('0x3e')](_0x1af566[_0x790b('0x35')],_0x521423['filters']),_0x5a4234);if(_0x1af566[_0x790b('0x35')][_0x790b('0x3f')]){_0x4c3b48[_0x790b('0x3c')]=_[_0x790b('0x40')](_0x4c3b48[_0x790b('0x3c')],{'$or':_[_0x790b('0x2f')](_0x5a4234,function(_0x4d60f9){if(_0x4d60f9[_0x790b('0x41')]!==_0x790b('0x42')){var _0x3f5dba={};_0x3f5dba[_0x4d60f9['name']]={'$like':'%'+_0x1af566[_0x790b('0x35')][_0x790b('0x3f')]+'%'};return _0x3f5dba;}})});}_0x4c3b48=_[_0x790b('0x40')]({},_0x4c3b48,_0x1af566[_0x790b('0x43')]);var _0x3fb8ca={'where':_0x4c3b48[_0x790b('0x3c')]};return db[_0x790b('0x30')][_0x790b('0x1f')](_0x3fb8ca)[_0x790b('0x25')](function(_0x433a70){_0x7ee25c['count']=_0x433a70;if(_0x1af566['query'][_0x790b('0x44')]){_0x4c3b48[_0x790b('0x45')]=[{'all':!![]}];}return db[_0x790b('0x30')]['findAll'](_0x4c3b48);})['then'](function(_0x283162){_0x7ee25c[_0x790b('0x46')]=_0x283162;return _0x7ee25c;})['then'](respondWithFilteredResult(_0x2c8816,_0x4c3b48))[_0x790b('0x47')](handleError(_0x2c8816,null));};exports['show']=function(_0x5522ed,_0x54ca6b){var _0x22b9a2={'raw':![],'where':{'id':_0x5522ed[_0x790b('0x48')]['id']}},_0x495244={};_0x495244[_0x790b('0x34')]=_[_0x790b('0x49')](db['Trigger'][_0x790b('0x31')]);_0x495244[_0x790b('0x35')]=_[_0x790b('0x49')](_0x5522ed[_0x790b('0x35')]);_0x495244[_0x790b('0x3d')]=_['intersection'](_0x495244[_0x790b('0x34')],_0x495244['query']);_0x22b9a2[_0x790b('0x37')]=_[_0x790b('0x36')](_0x495244['model'],qs['fields'](_0x5522ed[_0x790b('0x35')][_0x790b('0x38')]));_0x22b9a2[_0x790b('0x37')]=_0x22b9a2[_0x790b('0x37')]['length']?_0x22b9a2[_0x790b('0x37')]:_0x495244['model'];if(_0x5522ed[_0x790b('0x35')][_0x790b('0x44')]){_0x22b9a2[_0x790b('0x45')]=[{'all':!![]}];}_0x22b9a2=_[_0x790b('0x40')]({},_0x22b9a2,_0x5522ed['options']);return db[_0x790b('0x30')][_0x790b('0x4a')](_0x22b9a2)[_0x790b('0x25')](handleEntityNotFound(_0x54ca6b,null))['then'](respondWithResult(_0x54ca6b,null))[_0x790b('0x47')](handleError(_0x54ca6b,null));};exports[_0x790b('0x4b')]=function(_0x1c6d56,_0x566bee){return db[_0x790b('0x30')][_0x790b('0x4b')](_0x1c6d56[_0x790b('0x4c')],{})[_0x790b('0x25')](function(_0x545d32){var _0x3247e6=_0x1c6d56['user']['get']({'plain':!![]});if(!_0x3247e6)throw new Error(_0x790b('0x4d'));if(_0x3247e6['role']==='user'){var _0x2c8385=_0x545d32[_0x790b('0x27')]({'plain':!![]});var _0x359aa4=_0x790b('0x28');return db['UserProfileSection'][_0x790b('0x4a')]({'where':{'name':_0x359aa4,'userProfileId':_0x3247e6[_0x790b('0x4e')]},'raw':!![]})[_0x790b('0x25')](function(_0x3bee98){if(_0x3bee98&&_0x3bee98[_0x790b('0x4f')]===0x0){return db[_0x790b('0x29')][_0x790b('0x4b')]({'name':_0x2c8385[_0x790b('0x2c')],'resourceId':_0x2c8385['id'],'type':_0x3bee98['name'],'sectionId':_0x3bee98['id']},{})[_0x790b('0x25')](function(){return _0x545d32;});}else{return _0x545d32;}})[_0x790b('0x47')](function(_0xfe0433){logger[_0x790b('0x2a')](_0x790b('0x50'),_0xfe0433);throw _0xfe0433;});}return _0x545d32;})[_0x790b('0x25')](respondWithResult(_0x566bee,0xc9))[_0x790b('0x47')](handleError(_0x566bee,null));};exports[_0x790b('0x24')]=function(_0x4877c7,_0x52fad5){if(_0x4877c7['body']['id']){delete _0x4877c7[_0x790b('0x4c')]['id'];}return db[_0x790b('0x30')][_0x790b('0x4a')]({'where':{'id':_0x4877c7[_0x790b('0x48')]['id']}})[_0x790b('0x25')](handleEntityNotFound(_0x52fad5,null))[_0x790b('0x25')](saveUpdates(_0x4877c7['body'],null))['then'](respondWithResult(_0x52fad5,null))[_0x790b('0x47')](handleError(_0x52fad5,null));};exports[_0x790b('0x26')]=function(_0x19601d,_0x3fb911){return db[_0x790b('0x30')][_0x790b('0x4a')]({'where':{'id':_0x19601d[_0x790b('0x48')]['id']}})[_0x790b('0x25')](handleEntityNotFound(_0x3fb911,null))[_0x790b('0x25')](removeEntity(_0x3fb911,null))[_0x790b('0x47')](handleError(_0x3fb911,null));};exports[_0x790b('0x51')]=function(_0x153d1c,_0x564ce6,_0x31d2c7){if(_0x153d1c[_0x790b('0x4c')]['id']){delete _0x153d1c[_0x790b('0x4c')]['id'];}return db[_0x790b('0x30')][_0x790b('0x4a')]({'where':{'id':_0x153d1c[_0x790b('0x48')]['id']}})[_0x790b('0x25')](handleEntityNotFound(_0x564ce6,null))[_0x790b('0x25')](function(_0x9517b7){if(_0x9517b7){_0x153d1c[_0x790b('0x4c')][_0x790b('0x52')]=_0x9517b7['id'];return db[_0x790b('0x53')][_0x790b('0x4b')](_0x153d1c[_0x790b('0x4c')]);}})[_0x790b('0x25')](respondWithResult(_0x564ce6,null))['catch'](handleError(_0x564ce6,null));};exports['addAnyCondition']=function(_0x925517,_0x4b9ec1,_0x1bd17b){if(_0x925517[_0x790b('0x4c')]['id']){delete _0x925517[_0x790b('0x4c')]['id'];}return db['Trigger'][_0x790b('0x4a')]({'where':{'id':_0x925517[_0x790b('0x48')]['id']}})[_0x790b('0x25')](handleEntityNotFound(_0x4b9ec1,null))['then'](function(_0x3894e9){if(_0x3894e9){_0x925517[_0x790b('0x4c')][_0x790b('0x54')]=_0x3894e9['id'];return db[_0x790b('0x53')][_0x790b('0x4b')](_0x925517[_0x790b('0x4c')]);}})[_0x790b('0x25')](respondWithResult(_0x4b9ec1,null))['catch'](handleError(_0x4b9ec1,null));};exports['getAllConditions']=function(_0x414cae,_0x55ca95,_0x1acc91){var _0x426f2d={};var _0x4e20ab={};var _0x53777e;var _0x47fc0d;return db[_0x790b('0x30')][_0x790b('0x55')]({'where':{'id':_0x414cae['params']['id']}})['then'](handleEntityNotFound(_0x55ca95,null))[_0x790b('0x25')](function(_0x3c27b9){if(_0x3c27b9){_0x53777e=_0x3c27b9;_0x4e20ab[_0x790b('0x34')]=_[_0x790b('0x49')](db[_0x790b('0x53')][_0x790b('0x31')]);_0x4e20ab[_0x790b('0x35')]=_[_0x790b('0x49')](_0x414cae[_0x790b('0x35')]);_0x4e20ab[_0x790b('0x3d')]=_['intersection'](_0x4e20ab[_0x790b('0x34')],_0x4e20ab[_0x790b('0x35')]);_0x426f2d[_0x790b('0x37')]=_[_0x790b('0x36')](_0x4e20ab[_0x790b('0x34')],qs['fields'](_0x414cae[_0x790b('0x35')][_0x790b('0x38')]));_0x426f2d[_0x790b('0x37')]=_0x426f2d[_0x790b('0x37')][_0x790b('0x56')]?_0x426f2d[_0x790b('0x37')]:_0x4e20ab[_0x790b('0x34')];_0x426f2d[_0x790b('0x57')]=qs[_0x790b('0x3b')](_0x414cae[_0x790b('0x35')][_0x790b('0x3b')]);_0x426f2d['where']=qs['filters'](_[_0x790b('0x3e')](_0x414cae[_0x790b('0x35')],_0x4e20ab[_0x790b('0x3d')]));if(_0x414cae[_0x790b('0x35')][_0x790b('0x3f')]){_0x426f2d[_0x790b('0x3c')]=_['merge'](_0x426f2d[_0x790b('0x3c')],{'$or':_[_0x790b('0x2f')](_0x426f2d['attributes'],function(_0x312297){var _0x28878a={};_0x28878a[_0x312297]={'$like':'%'+_0x414cae[_0x790b('0x35')][_0x790b('0x3f')]+'%'};return _0x28878a;})});}_0x426f2d=_[_0x790b('0x40')]({},_0x426f2d,_0x414cae[_0x790b('0x43')]);return _0x53777e[_0x790b('0x58')](_0x426f2d);}})[_0x790b('0x25')](function(_0x4961ae){if(_0x4961ae){_0x47fc0d=_0x4961ae[_0x790b('0x56')];if(!_0x414cae[_0x790b('0x35')]['hasOwnProperty']('nolimit')){_0x426f2d[_0x790b('0x1e')]=qs[_0x790b('0x1e')](_0x414cae[_0x790b('0x35')][_0x790b('0x1e')]);_0x426f2d[_0x790b('0x1c')]=qs[_0x790b('0x1c')](_0x414cae[_0x790b('0x35')][_0x790b('0x1c')]);}return _0x53777e[_0x790b('0x58')](_0x426f2d);}})['then'](function(_0x154867){if(_0x154867){return _0x154867?{'count':_0x47fc0d,'rows':_0x154867}:null;}})[_0x790b('0x25')](respondWithResult(_0x55ca95,null))[_0x790b('0x47')](handleError(_0x55ca95,null));};exports[_0x790b('0x59')]=function(_0x166f71,_0x106396,_0x2acd97){var _0x565484={};var _0xe663e2={};var _0x467e3f;var _0x4982ab;return db[_0x790b('0x30')][_0x790b('0x55')]({'where':{'id':_0x166f71['params']['id']}})[_0x790b('0x25')](handleEntityNotFound(_0x106396,null))[_0x790b('0x25')](function(_0x124d1a){if(_0x124d1a){_0x467e3f=_0x124d1a;_0xe663e2[_0x790b('0x34')]=_['keys'](db[_0x790b('0x53')][_0x790b('0x31')]);_0xe663e2[_0x790b('0x35')]=_[_0x790b('0x49')](_0x166f71[_0x790b('0x35')]);_0xe663e2[_0x790b('0x3d')]=_['intersection'](_0xe663e2[_0x790b('0x34')],_0xe663e2[_0x790b('0x35')]);_0x565484['attributes']=_[_0x790b('0x36')](_0xe663e2[_0x790b('0x34')],qs['fields'](_0x166f71[_0x790b('0x35')]['fields']));_0x565484[_0x790b('0x37')]=_0x565484['attributes'][_0x790b('0x56')]?_0x565484[_0x790b('0x37')]:_0xe663e2[_0x790b('0x34')];_0x565484[_0x790b('0x57')]=qs[_0x790b('0x3b')](_0x166f71[_0x790b('0x35')][_0x790b('0x3b')]);_0x565484[_0x790b('0x3c')]=qs[_0x790b('0x3d')](_['pick'](_0x166f71['query'],_0xe663e2[_0x790b('0x3d')]));if(_0x166f71[_0x790b('0x35')]['filter']){_0x565484[_0x790b('0x3c')]=_[_0x790b('0x40')](_0x565484[_0x790b('0x3c')],{'$or':_[_0x790b('0x2f')](_0x565484['attributes'],function(_0x463167){var _0x2f11c5={};_0x2f11c5[_0x463167]={'$like':'%'+_0x166f71[_0x790b('0x35')][_0x790b('0x3f')]+'%'};return _0x2f11c5;})});}_0x565484=_[_0x790b('0x40')]({},_0x565484,_0x166f71[_0x790b('0x43')]);return _0x467e3f[_0x790b('0x59')](_0x565484);}})[_0x790b('0x25')](function(_0x3ebdd4){if(_0x3ebdd4){_0x4982ab=_0x3ebdd4[_0x790b('0x56')];if(!_0x166f71[_0x790b('0x35')][_0x790b('0x39')]('nolimit')){_0x565484[_0x790b('0x1e')]=qs[_0x790b('0x1e')](_0x166f71[_0x790b('0x35')][_0x790b('0x1e')]);_0x565484[_0x790b('0x1c')]=qs[_0x790b('0x1c')](_0x166f71['query'][_0x790b('0x1c')]);}return _0x467e3f[_0x790b('0x59')](_0x565484);}})[_0x790b('0x25')](function(_0x10ec6e){if(_0x10ec6e){return _0x10ec6e?{'count':_0x4982ab,'rows':_0x10ec6e}:null;}})['then'](respondWithResult(_0x106396,null))[_0x790b('0x47')](handleError(_0x106396,null));};exports[_0x790b('0x5a')]=function(_0x562147,_0x34ae15,_0x10a70b){if(_0x562147[_0x790b('0x4c')]['id']){delete _0x562147['body']['id'];}return db['Trigger'][_0x790b('0x4a')]({'where':{'id':_0x562147[_0x790b('0x48')]['id']}})['then'](handleEntityNotFound(_0x34ae15,null))[_0x790b('0x25')](function(_0x4a5a8f){if(_0x4a5a8f){_0x562147[_0x790b('0x4c')]['TriggerId']=_0x4a5a8f['id'];return db[_0x790b('0x5b')][_0x790b('0x4b')](_0x562147[_0x790b('0x4c')]);}})[_0x790b('0x25')](respondWithResult(_0x34ae15,null))[_0x790b('0x47')](handleError(_0x34ae15,null));};exports[_0x790b('0x5c')]=function(_0x15c262,_0x3f7bf5,_0x6dfe63){var _0x2e3479={};var _0x5f1113={};var _0x27b8a8;var _0xd7f3b0;return db['Trigger'][_0x790b('0x55')]({'where':{'id':_0x15c262[_0x790b('0x48')]['id']}})[_0x790b('0x25')](handleEntityNotFound(_0x3f7bf5,null))[_0x790b('0x25')](function(_0xe48867){if(_0xe48867){_0x27b8a8=_0xe48867;_0x5f1113[_0x790b('0x34')]=_[_0x790b('0x49')](db[_0x790b('0x5b')]['rawAttributes']);_0x5f1113[_0x790b('0x35')]=_[_0x790b('0x49')](_0x15c262[_0x790b('0x35')]);_0x5f1113[_0x790b('0x3d')]=_[_0x790b('0x36')](_0x5f1113['model'],_0x5f1113[_0x790b('0x35')]);_0x2e3479[_0x790b('0x37')]=_[_0x790b('0x36')](_0x5f1113[_0x790b('0x34')],qs['fields'](_0x15c262[_0x790b('0x35')][_0x790b('0x38')]));_0x2e3479[_0x790b('0x37')]=_0x2e3479['attributes']['length']?_0x2e3479[_0x790b('0x37')]:_0x5f1113[_0x790b('0x34')];_0x2e3479['order']=qs[_0x790b('0x3b')](_0x15c262[_0x790b('0x35')][_0x790b('0x3b')]);_0x2e3479['where']=qs[_0x790b('0x3d')](_[_0x790b('0x3e')](_0x15c262['query'],_0x5f1113['filters']));if(_0x15c262[_0x790b('0x35')]['filter']){_0x2e3479['where']=_[_0x790b('0x40')](_0x2e3479[_0x790b('0x3c')],{'$or':_['map'](_0x2e3479[_0x790b('0x37')],function(_0x39a81a){var _0x13db31={};_0x13db31[_0x39a81a]={'$like':'%'+_0x15c262[_0x790b('0x35')]['filter']+'%'};return _0x13db31;})});}_0x2e3479=_['merge']({},_0x2e3479,_0x15c262[_0x790b('0x43')]);return _0x27b8a8['getActions'](_0x2e3479);}})['then'](function(_0x4207e3){if(_0x4207e3){_0xd7f3b0=_0x4207e3[_0x790b('0x56')];if(!_0x15c262['query'][_0x790b('0x39')]('nolimit')){_0x2e3479[_0x790b('0x1e')]=qs[_0x790b('0x1e')](_0x15c262[_0x790b('0x35')][_0x790b('0x1e')]);_0x2e3479[_0x790b('0x1c')]=qs['offset'](_0x15c262[_0x790b('0x35')][_0x790b('0x1c')]);}return _0x27b8a8['getActions'](_0x2e3479);}})[_0x790b('0x25')](function(_0x508e2d){if(_0x508e2d){return _0x508e2d?{'count':_0xd7f3b0,'rows':_0x508e2d}:null;}})[_0x790b('0x25')](respondWithResult(_0x3f7bf5,null))[_0x790b('0x47')](handleError(_0x3f7bf5,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 0e4eddb..a3b2218 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 _0x1405=['./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1e09ef,_0x17e23f){var _0x2d1254=function(_0x5935f1){while(--_0x5935f1){_0x1e09ef['push'](_0x1e09ef['shift']());}};_0x2d1254(++_0x17e23f);}(_0x1405,0x1ef));var _0x5140=function(_0x182f46,_0x87fef4){_0x182f46=_0x182f46-0x0;var _0xe95cf4=_0x1405[_0x182f46];return _0xe95cf4;};'use strict';var _=require(_0x5140('0x0'));var util=require(_0x5140('0x1'));var logger=require(_0x5140('0x2'))(_0x5140('0x3'));var moment=require(_0x5140('0x4'));var BPromise=require('bluebird');var rp=require(_0x5140('0x5'));var fs=require('fs');var path=require(_0x5140('0x6'));var rimraf=require(_0x5140('0x7'));var config=require(_0x5140('0x8'));var attributes=require(_0x5140('0x9'));module[_0x5140('0xa')]=function(_0xbbf607,_0x1c6467){return _0xbbf607[_0x5140('0xb')](_0x5140('0xc'),attributes,{'tableName':_0x5140('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8913=['exports','define','Trigger','tools_triggers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5b1551,_0x4ad506){var _0x266298=function(_0x2b73c8){while(--_0x2b73c8){_0x5b1551['push'](_0x5b1551['shift']());}};_0x266298(++_0x4ad506);}(_0x8913,0x148));var _0x3891=function(_0x176e15,_0x33a5a8){_0x176e15=_0x176e15-0x0;var _0x4fca7f=_0x8913[_0x176e15];return _0x4fca7f;};'use strict';var _=require(_0x3891('0x0'));var util=require('util');var logger=require(_0x3891('0x1'))(_0x3891('0x2'));var moment=require('moment');var BPromise=require(_0x3891('0x3'));var rp=require(_0x3891('0x4'));var fs=require('fs');var path=require(_0x3891('0x5'));var rimraf=require(_0x3891('0x6'));var config=require(_0x3891('0x7'));var attributes=require('./trigger.attributes');module[_0x3891('0x8')]=function(_0x474bae,_0x15a223){return _0x474bae[_0x3891('0x9')](_0x3891('0xa'),attributes,{'tableName':_0x3891('0xb'),'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 3b08399..32f2760 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 _0x5423=['options','raw','where','limit','include','attributes','map','model','then','ShowTrigger','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll'];(function(_0x438625,_0x2238ef){var _0x2c1ab2=function(_0x40b819){while(--_0x40b819){_0x438625['push'](_0x438625['shift']());}};_0x2c1ab2(++_0x2238ef);}(_0x5423,0xe3));var _0x3542=function(_0x48b9bf,_0x4fdbda){_0x48b9bf=_0x48b9bf-0x0;var _0xa2fe0d=_0x5423[_0x48b9bf];return _0xa2fe0d;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var moment=require('moment');var BPromise=require(_0x3542('0x2'));var rs=require(_0x3542('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3542('0x4'))['db'];var utils=require(_0x3542('0x5'));var logger=require(_0x3542('0x6'))(_0x3542('0x7'));var config=require('../../config/environment');var jayson=require(_0x3542('0x8'));var client=jayson[_0x3542('0x9')][_0x3542('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29c3fa,_0x2e1a62,_0x55413c){return new BPromise(function(_0x4cdc86,_0xbc51ab){return client[_0x3542('0xb')](_0x29c3fa,_0x55413c)['then'](function(_0x681195){logger[_0x3542('0xc')]('Trigger,\x20%s,\x20%s',_0x2e1a62,_0x3542('0xd'));logger[_0x3542('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x2e1a62,_0x3542('0xd'),JSON[_0x3542('0xf')](_0x681195));if(_0x681195[_0x3542('0x10')]){if(_0x681195[_0x3542('0x10')][_0x3542('0x11')]===0x1f4){logger[_0x3542('0x10')](_0x3542('0x12'),_0x2e1a62,_0x681195[_0x3542('0x10')][_0x3542('0x13')]);return _0xbc51ab(_0x681195[_0x3542('0x10')][_0x3542('0x13')]);}logger[_0x3542('0x10')](_0x3542('0x12'),_0x2e1a62,_0x681195['error'][_0x3542('0x13')]);return _0x4cdc86(_0x681195['error'][_0x3542('0x13')]);}else{logger[_0x3542('0xc')](_0x3542('0x12'),_0x2e1a62,'request\x20sent');_0x4cdc86(_0x681195[_0x3542('0x14')][_0x3542('0x13')]);}})[_0x3542('0x15')](function(_0x5726af){logger[_0x3542('0x10')](_0x3542('0x12'),_0x2e1a62,_0x5726af);_0xbc51ab(_0x5726af);});});}exports[_0x3542('0x16')]=function(_0x3d5199){var _0x493d95=this;return new Promise(function(_0x32df3f,_0x53d4aa){return db[_0x3542('0x17')][_0x3542('0x18')]({'raw':_0x3d5199['options']?_0x3d5199[_0x3542('0x19')][_0x3542('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d5199[_0x3542('0x19')]?_0x3d5199[_0x3542('0x19')][_0x3542('0x1b')]||null:null,'attributes':_0x3d5199['options']?_0x3d5199['options']['attributes']||null:null,'limit':_0x3d5199[_0x3542('0x19')]?_0x3d5199['options'][_0x3542('0x1c')]||null:null,'include':_0x3d5199['options']?_0x3d5199[_0x3542('0x19')]['include']?_['map'](_0x3d5199[_0x3542('0x19')][_0x3542('0x1d')],function(_0x5ae097){return{'model':db[_0x5ae097['model']],'as':_0x5ae097['as'],'attributes':_0x5ae097[_0x3542('0x1e')],'include':_0x5ae097['include']?_[_0x3542('0x1f')](_0x5ae097[_0x3542('0x1d')],function(_0x1e0723){return{'model':db[_0x1e0723[_0x3542('0x20')]],'as':_0x1e0723['as'],'attributes':_0x1e0723[_0x3542('0x1e')],'include':_0x1e0723[_0x3542('0x1d')]?_[_0x3542('0x1f')](_0x1e0723[_0x3542('0x1d')],function(_0x18dc6c){return{'model':db[_0x18dc6c[_0x3542('0x20')]],'as':_0x18dc6c['as'],'attributes':_0x18dc6c[_0x3542('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3542('0x21')](function(_0x220021){logger[_0x3542('0xc')](_0x3542('0x16'),_0x3d5199);logger[_0x3542('0xe')](_0x3542('0x16'),_0x3d5199,JSON[_0x3542('0xf')](_0x220021));_0x32df3f(_0x220021);})[_0x3542('0x15')](function(_0x5590a2){logger[_0x3542('0x10')](_0x3542('0x16'),_0x5590a2[_0x3542('0x13')],_0x3d5199);_0x53d4aa(_0x493d95['error'](0x1f4,_0x5590a2[_0x3542('0x13')]));});});};exports[_0x3542('0x22')]=function(_0x2e883a){var _0x30b5e8=this;return new Promise(function(_0x5c882f,_0x5a274b){return db[_0x3542('0x17')][_0x3542('0x23')]({'raw':_0x2e883a[_0x3542('0x19')]?_0x2e883a[_0x3542('0x19')][_0x3542('0x1a')]===undefined?!![]:![]:!![],'where':_0x2e883a[_0x3542('0x19')]?_0x2e883a[_0x3542('0x19')]['where']||null:null,'attributes':_0x2e883a['options']?_0x2e883a[_0x3542('0x19')]['attributes']||null:null,'include':_0x2e883a['options']?_0x2e883a[_0x3542('0x19')]['include']?_['map'](_0x2e883a[_0x3542('0x19')][_0x3542('0x1d')],function(_0x1bf178){return{'model':db[_0x1bf178['model']],'as':_0x1bf178['as'],'attributes':_0x1bf178[_0x3542('0x1e')],'include':_0x1bf178['include']?_[_0x3542('0x1f')](_0x1bf178[_0x3542('0x1d')],function(_0x561fd0){return{'model':db[_0x561fd0[_0x3542('0x20')]],'as':_0x561fd0['as'],'attributes':_0x561fd0['attributes'],'include':_0x561fd0[_0x3542('0x1d')]?_[_0x3542('0x1f')](_0x561fd0[_0x3542('0x1d')],function(_0x4cfb8f){return{'model':db[_0x4cfb8f[_0x3542('0x20')]],'as':_0x4cfb8f['as'],'attributes':_0x4cfb8f['attributes']};}):[]};}):[]};}):[]:[]})[_0x3542('0x21')](function(_0x1fe5c6){logger[_0x3542('0xc')](_0x3542('0x22'),_0x2e883a);logger[_0x3542('0xe')](_0x3542('0x22'),_0x2e883a,JSON[_0x3542('0xf')](_0x1fe5c6));_0x5c882f(_0x1fe5c6);})[_0x3542('0x15')](function(_0x110aa8){logger[_0x3542('0x10')](_0x3542('0x22'),_0x110aa8[_0x3542('0x13')],_0x2e883a);_0x5a274b(_0x30b5e8[_0x3542('0x10')](0x1f4,_0x110aa8['message']));});});}; \ No newline at end of file +var _0x065e=['request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','findAll','options','attributes','limit','include','map','model','find','ShowTrigger','catch','lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info'];(function(_0x38f3c8,_0x166d00){var _0x24d35f=function(_0x2bca36){while(--_0x2bca36){_0x38f3c8['push'](_0x38f3c8['shift']());}};_0x24d35f(++_0x166d00);}(_0x065e,0x1a7));var _0xe065=function(_0x2f42d3,_0x362e7a){_0x2f42d3=_0x2f42d3-0x0;var _0x25a67e=_0x065e[_0x2f42d3];return _0x25a67e;};'use strict';var _=require(_0xe065('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe065('0x1'));var fs=require('fs');var Redis=require(_0xe065('0x2'));var db=require(_0xe065('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe065('0x4'));var config=require(_0xe065('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe065('0x6')][_0xe065('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x189d72,_0x52403a,_0x267122){return new BPromise(function(_0x5afbd4,_0x273e22){return client[_0xe065('0x8')](_0x189d72,_0x267122)[_0xe065('0x9')](function(_0x114497){logger[_0xe065('0xa')]('Trigger,\x20%s,\x20%s',_0x52403a,_0xe065('0xb'));logger[_0xe065('0xc')](_0xe065('0xd'),_0x52403a,_0xe065('0xb'),JSON[_0xe065('0xe')](_0x114497));if(_0x114497[_0xe065('0xf')]){if(_0x114497['error']['code']===0x1f4){logger[_0xe065('0xf')](_0xe065('0x10'),_0x52403a,_0x114497[_0xe065('0xf')]['message']);return _0x273e22(_0x114497[_0xe065('0xf')][_0xe065('0x11')]);}logger[_0xe065('0xf')](_0xe065('0x10'),_0x52403a,_0x114497[_0xe065('0xf')]['message']);return _0x5afbd4(_0x114497[_0xe065('0xf')][_0xe065('0x11')]);}else{logger[_0xe065('0xa')](_0xe065('0x10'),_0x52403a,_0xe065('0xb'));_0x5afbd4(_0x114497[_0xe065('0x12')][_0xe065('0x11')]);}})['catch'](function(_0x1ba88d){logger[_0xe065('0xf')]('Trigger,\x20%s,\x20%s',_0x52403a,_0x1ba88d);_0x273e22(_0x1ba88d);});});}exports[_0xe065('0x13')]=function(_0x1d2f7a){var _0x397f05=this;return new Promise(function(_0x14c97c,_0x1e7177){return db[_0xe065('0x14')][_0xe065('0x15')]({'raw':_0x1d2f7a['options']?_0x1d2f7a[_0xe065('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a[_0xe065('0x16')]['where']||null:null,'attributes':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a['options'][_0xe065('0x17')]||null:null,'limit':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a[_0xe065('0x16')][_0xe065('0x18')]||null:null,'include':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a[_0xe065('0x16')][_0xe065('0x19')]?_[_0xe065('0x1a')](_0x1d2f7a[_0xe065('0x16')]['include'],function(_0x7208af){return{'model':db[_0x7208af[_0xe065('0x1b')]],'as':_0x7208af['as'],'attributes':_0x7208af[_0xe065('0x17')],'include':_0x7208af[_0xe065('0x19')]?_['map'](_0x7208af['include'],function(_0x164965){return{'model':db[_0x164965['model']],'as':_0x164965['as'],'attributes':_0x164965[_0xe065('0x17')],'include':_0x164965[_0xe065('0x19')]?_[_0xe065('0x1a')](_0x164965[_0xe065('0x19')],function(_0x418731){return{'model':db[_0x418731[_0xe065('0x1b')]],'as':_0x418731['as'],'attributes':_0x418731[_0xe065('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe065('0x9')](function(_0x52cd9c){logger['info'](_0xe065('0x13'),_0x1d2f7a);logger[_0xe065('0xc')](_0xe065('0x13'),_0x1d2f7a,JSON[_0xe065('0xe')](_0x52cd9c));_0x14c97c(_0x52cd9c);})['catch'](function(_0x23f573){logger['error']('GetTrigger',_0x23f573[_0xe065('0x11')],_0x1d2f7a);_0x1e7177(_0x397f05[_0xe065('0xf')](0x1f4,_0x23f573[_0xe065('0x11')]));});});};exports['ShowTrigger']=function(_0x883747){var _0x59b915=this;return new Promise(function(_0x12679d,_0x46db7e){return db[_0xe065('0x14')][_0xe065('0x1c')]({'raw':_0x883747['options']?_0x883747[_0xe065('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x883747[_0xe065('0x16')]?_0x883747[_0xe065('0x16')]['where']||null:null,'attributes':_0x883747[_0xe065('0x16')]?_0x883747['options'][_0xe065('0x17')]||null:null,'include':_0x883747['options']?_0x883747[_0xe065('0x16')][_0xe065('0x19')]?_[_0xe065('0x1a')](_0x883747[_0xe065('0x16')]['include'],function(_0x1fe1dc){return{'model':db[_0x1fe1dc[_0xe065('0x1b')]],'as':_0x1fe1dc['as'],'attributes':_0x1fe1dc[_0xe065('0x17')],'include':_0x1fe1dc[_0xe065('0x19')]?_[_0xe065('0x1a')](_0x1fe1dc[_0xe065('0x19')],function(_0x4b822a){return{'model':db[_0x4b822a[_0xe065('0x1b')]],'as':_0x4b822a['as'],'attributes':_0x4b822a[_0xe065('0x17')],'include':_0x4b822a['include']?_[_0xe065('0x1a')](_0x4b822a[_0xe065('0x19')],function(_0x5afc23){return{'model':db[_0x5afc23[_0xe065('0x1b')]],'as':_0x5afc23['as'],'attributes':_0x5afc23[_0xe065('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe065('0x9')](function(_0x35135f){logger['info'](_0xe065('0x1d'),_0x883747);logger['debug'](_0xe065('0x1d'),_0x883747,JSON[_0xe065('0xe')](_0x35135f));_0x12679d(_0x35135f);})[_0xe065('0x1e')](function(_0xcceb12){logger[_0xe065('0xf')](_0xe065('0x1d'),_0xcceb12['message'],_0x883747);_0x46db7e(_0x59b915[_0xe065('0xf')](0x1f4,_0xcceb12[_0xe065('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index fa874de..f38d450 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 _0x7393=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','post','clone','create','put','update','/:id','destroy'];(function(_0x59ae66,_0xd77e84){var _0x27202e=function(_0x5908bf){while(--_0x5908bf){_0x59ae66['push'](_0x59ae66['shift']());}};_0x27202e(++_0xd77e84);}(_0x7393,0x1dc));var _0x3739=function(_0x4ba9bc,_0x20ac9a){_0x4ba9bc=_0x4ba9bc-0x0;var _0xee218a=_0x7393[_0x4ba9bc];return _0xee218a;};'use strict';var multer=require(_0x3739('0x0'));var util=require(_0x3739('0x1'));var path=require(_0x3739('0x2'));var timeout=require(_0x3739('0x3'));var express=require(_0x3739('0x4'));var router=express['Router']();var fs_extra=require(_0x3739('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3739('0x6'));var config=require('../../config/environment');var controller=require(_0x3739('0x7'));router[_0x3739('0x8')]('/',auth[_0x3739('0x9')](),controller[_0x3739('0xa')]);router[_0x3739('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3739('0xb')]('/:id/clone',auth[_0x3739('0x9')](),controller[_0x3739('0xc')]);router[_0x3739('0xb')]('/',auth[_0x3739('0x9')](),controller[_0x3739('0xd')]);router[_0x3739('0xe')]('/:id',auth[_0x3739('0x9')](),controller[_0x3739('0xf')]);router['delete'](_0x3739('0x10'),auth[_0x3739('0x9')](),controller[_0x3739('0x11')]);module[_0x3739('0x12')]=router; \ No newline at end of file +var _0xc878=['delete','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','show','post','clone','create','put','update'];(function(_0x223b03,_0x131346){var _0x4ae0b1=function(_0x140034){while(--_0x140034){_0x223b03['push'](_0x223b03['shift']());}};_0x4ae0b1(++_0x131346);}(_0xc878,0x10f));var _0x8c87=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0xc878[_0x57975f];return _0x4793b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8c87('0x0'));var timeout=require(_0x8c87('0x1'));var express=require(_0x8c87('0x2'));var router=express['Router']();var fs_extra=require(_0x8c87('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8c87('0x4'));var config=require(_0x8c87('0x5'));var controller=require(_0x8c87('0x6'));router[_0x8c87('0x7')]('/',auth['isAuthenticated'](),controller[_0x8c87('0x8')]);router[_0x8c87('0x7')](_0x8c87('0x9'),auth[_0x8c87('0xa')](),controller[_0x8c87('0xb')]);router[_0x8c87('0xc')]('/:id/clone',auth[_0x8c87('0xa')](),controller[_0x8c87('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8c87('0xe')]);router[_0x8c87('0xf')]('/:id',auth[_0x8c87('0xa')](),controller[_0x8c87('0x10')]);router[_0x8c87('0x11')](_0x8c87('0x9'),auth[_0x8c87('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 1a3d677..8c3a407 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 _0x3f0f=['BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','always','INTEGER','accept','originate','pai','fingerprint','certificate','active','actpass','dynamic','update,nonat'];(function(_0x80fed2,_0x5e02e4){var _0x3c1a70=function(_0x4621a9){while(--_0x4621a9){_0x80fed2['push'](_0x80fed2['shift']());}};_0x3c1a70(++_0x5e02e4);}(_0x3f0f,0x67));var _0xf3f0=function(_0x3c58e8,_0x901ef1){_0x3c58e8=_0x3c58e8-0x0;var _0x43eed8=_0x3f0f[_0x3c58e8];return _0x43eed8;};'use strict';var Sequelize=require(_0xf3f0('0x0'));module[_0xf3f0('0x1')]={'name':{'type':Sequelize[_0xf3f0('0x2')],'allowNull':![],'unique':_0xf3f0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x5'),_0xf3f0('0x6'),_0xf3f0('0x7')),'allowNull':![],'defaultValue':_0xf3f0('0x5')},'context':{'type':Sequelize[_0xf3f0('0x2')],'allowNull':![],'defaultValue':_0xf3f0('0x8')},'callingpres':{'type':Sequelize['ENUM'](_0xf3f0('0x9'),_0xf3f0('0xa'),_0xf3f0('0xb'),_0xf3f0('0xc'),_0xf3f0('0xd'),_0xf3f0('0xe'),_0xf3f0('0xf'),'PROHIB')},'deny':{'type':Sequelize[_0xf3f0('0x2')]},'permit':{'type':Sequelize[_0xf3f0('0x2')]},'secret':{'type':Sequelize[_0xf3f0('0x2')]},'md5secret':{'type':Sequelize[_0xf3f0('0x2')]},'remotesecret':{'type':Sequelize[_0xf3f0('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xf3f0('0x10'),'set':function(_0x2c37b6){this[_0xf3f0('0x11')](_0xf3f0('0x12'),_0x2c37b6?_0x2c37b6[_0xf3f0('0x13')](','):null);},'get':function(){return this[_0xf3f0('0x14')](_0xf3f0('0x12'))?this[_0xf3f0('0x14')](_0xf3f0('0x12'))[_0xf3f0('0x15')](','):null;},'comment':_0xf3f0('0x16')},'dtmfmode':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x17'),_0xf3f0('0x18'),_0xf3f0('0x19'),'inband',_0xf3f0('0x1a')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no',_0xf3f0('0x1c'),_0xf3f0('0x1d'),_0xf3f0('0x1e')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xf3f0('0x2')],'defaultValue':_0xf3f0('0x1f'),'set':function(_0x26b71d){this[_0xf3f0('0x11')](_0xf3f0('0x20'),_0x26b71d?_0x26b71d[_0xf3f0('0x13')](','):null);},'get':function(){return this[_0xf3f0('0x14')](_0xf3f0('0x20'))?this[_0xf3f0('0x14')](_0xf3f0('0x20'))[_0xf3f0('0x15')](','):null;},'comment':_0xf3f0('0x21')},'callgroup':{'type':Sequelize[_0xf3f0('0x2')]},'namedcallgroup':{'type':Sequelize[_0xf3f0('0x2')]},'pickupgroup':{'type':Sequelize[_0xf3f0('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xf3f0('0x2')]},'language':{'type':Sequelize[_0xf3f0('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0xf3f0('0x2')],'allowNull':![],'defaultValue':_0xf3f0('0x22'),'set':function(_0xd9c896){this[_0xf3f0('0x11')](_0xf3f0('0x23'),_0xd9c896?_0xd9c896[_0xf3f0('0x13')](';'):_0xf3f0('0x22'));},'get':function(){return this[_0xf3f0('0x14')](_0xf3f0('0x23'))?this[_0xf3f0('0x14')](_0xf3f0('0x23'))[_0xf3f0('0x15')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no')},'insecure':{'type':Sequelize[_0xf3f0('0x2')],'defaultValue':_0xf3f0('0x24'),'set':function(_0x575606){this['setDataValue']('insecure',_0x575606?_0x575606[_0xf3f0('0x13')](','):null);},'get':function(){return this[_0xf3f0('0x14')](_0xf3f0('0x25'))?this[_0xf3f0('0x14')](_0xf3f0('0x25'))[_0xf3f0('0x15')](','):null;},'comment':_0xf3f0('0x26')},'trustrpid':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf3f0('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xf3f0('0x1b'),'no','never')},'promiscredir':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0xf3f0('0x4')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xf3f0('0x2')]},'callcounter':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no'),'defaultValue':_0xf3f0('0x1b')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no')},'allowsubscribe':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no')},'allowtransfer':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xf3f0('0x1b'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xf3f0('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0xf3f0('0x1b'),'no',_0xf3f0('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf3f0('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0xf3f0('0x2')]},'session_timers':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x29'),'refuse',_0xf3f0('0x2a'))},'session_expires':{'type':Sequelize[_0xf3f0('0x28')](0xb)},'session_minse':{'type':Sequelize[_0xf3f0('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0xf3f0('0x4')]('uac','uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xf3f0('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xf3f0('0x2')]},'port':{'type':Sequelize[_0xf3f0('0x28')](0x5)},'qualify':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no'),'defaultValue':_0xf3f0('0x1b')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xf3f0('0x2')]},'defaultuser':{'type':Sequelize[_0xf3f0('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xf3f0('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xf3f0('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no',_0xf3f0('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xf3f0('0x28')](0xb)},'timerb':{'type':Sequelize[_0xf3f0('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0xf3f0('0x28')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xf3f0('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xf3f0('0x2')]},'use_q850_reason':{'type':Sequelize[_0xf3f0('0x2')]},'maxforwards':{'type':Sequelize[_0xf3f0('0x28')](0xb)},'encryption':{'type':Sequelize[_0xf3f0('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no')},'force_avp':{'type':Sequelize[_0xf3f0('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xf3f0('0x1b'),'no',_0xf3f0('0x2c'),_0xf3f0('0x2d'))},'dtlsrekey':{'type':Sequelize[_0xf3f0('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0xf3f0('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xf3f0('0x2')]},'dtlscipher':{'type':Sequelize[_0xf3f0('0x2')]},'dtlscafile':{'type':Sequelize[_0xf3f0('0x2')]},'dtlscapath':{'type':Sequelize[_0xf3f0('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xf3f0('0x2e'),'passive',_0xf3f0('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf3f0('0x2')]},'usereqphone':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf3f0('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xf3f0('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf3f0('0x2')]},'host':{'type':Sequelize[_0xf3f0('0x2')],'defaultValue':_0xf3f0('0x30')},'canreinvite':{'type':Sequelize[_0xf3f0('0x4')](_0xf3f0('0x1b'),'no','nonat','update',_0xf3f0('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xf3f0('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xf3f0('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x7d15=['originate','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','nonat','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse'];(function(_0x3ed76b,_0x33f24b){var _0x1d501c=function(_0x30d36a){while(--_0x30d36a){_0x3ed76b['push'](_0x3ed76b['shift']());}};_0x1d501c(++_0x33f24b);}(_0x7d15,0x17f));var _0x57d1=function(_0x2c58b1,_0x37784a){_0x2c58b1=_0x2c58b1-0x0;var _0x1a64db=_0x7d15[_0x2c58b1];return _0x1a64db;};'use strict';var Sequelize=require(_0x57d1('0x0'));module['exports']={'name':{'type':Sequelize[_0x57d1('0x1')],'allowNull':![],'unique':_0x57d1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x57d1('0x3')]('friend',_0x57d1('0x4'),_0x57d1('0x5')),'allowNull':![],'defaultValue':_0x57d1('0x6')},'context':{'type':Sequelize[_0x57d1('0x1')],'allowNull':![],'defaultValue':_0x57d1('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x57d1('0x8'),_0x57d1('0x9'),'ALLOWED_FAILED_SCREEN',_0x57d1('0xa'),_0x57d1('0xb'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x57d1('0xc'))},'deny':{'type':Sequelize[_0x57d1('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x57d1('0x1')]},'remotesecret':{'type':Sequelize[_0x57d1('0x1')]},'transport':{'type':Sequelize[_0x57d1('0x1')],'defaultValue':'udp','set':function(_0x4b8571){this[_0x57d1('0xd')]('transport',_0x4b8571?_0x4b8571[_0x57d1('0xe')](','):null);},'get':function(){return this[_0x57d1('0xf')](_0x57d1('0x10'))?this[_0x57d1('0xf')](_0x57d1('0x10'))[_0x57d1('0x11')](','):null;},'comment':_0x57d1('0x12')},'dtmfmode':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x13'),_0x57d1('0x14'),_0x57d1('0x15'),_0x57d1('0x16'),'auto'),'defaultValue':_0x57d1('0x13')},'directmedia':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no','nonat',_0x57d1('0x18'),_0x57d1('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x57d1('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x57d1('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x57d1('0x1')],'defaultValue':_0x57d1('0x1a'),'set':function(_0x5c96c3){this[_0x57d1('0xd')](_0x57d1('0x1b'),_0x5c96c3?_0x5c96c3[_0x57d1('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x57d1('0x1b'))?this['getDataValue'](_0x57d1('0x1b'))['split'](','):null;},'comment':_0x57d1('0x1c')},'callgroup':{'type':Sequelize[_0x57d1('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x57d1('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x57d1('0x1')]},'language':{'type':Sequelize[_0x57d1('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x57d1('0x1')],'defaultValue':_0x57d1('0x1d')},'allow':{'type':Sequelize[_0x57d1('0x1')],'allowNull':![],'defaultValue':_0x57d1('0x1e'),'set':function(_0x232f88){this['setDataValue']('allow',_0x232f88?_0x232f88['join'](';'):_0x57d1('0x1e'));},'get':function(){return this['getDataValue']('allow')?this[_0x57d1('0xf')](_0x57d1('0x1f'))[_0x57d1('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no')},'insecure':{'type':Sequelize[_0x57d1('0x1')],'defaultValue':_0x57d1('0x20'),'set':function(_0x2d67ff){this['setDataValue'](_0x57d1('0x21'),_0x2d67ff?_0x2d67ff[_0x57d1('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x57d1('0x21'))?this[_0x57d1('0xf')]('insecure')[_0x57d1('0x11')](','):null;},'comment':_0x57d1('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x57d1('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no',_0x57d1('0x23'))},'promiscredir':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no')},'accountcode':{'type':Sequelize[_0x57d1('0x24')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x57d1('0x25')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0x57d1('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x57d1('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x57d1('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x57d1('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x57d1('0x1')]},'template':{'type':Sequelize[_0x57d1('0x1')]},'videosupport':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no',_0x57d1('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x27'),_0x57d1('0x28'),_0x57d1('0x29'))},'session_expires':{'type':Sequelize[_0x57d1('0x24')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x2a'),_0x57d1('0x2b')),'defaultValue':_0x57d1('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x57d1('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x57d1('0x1')]},'fromuser':{'type':Sequelize[_0x57d1('0x1')]},'port':{'type':Sequelize[_0x57d1('0x24')](0x5)},'qualify':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x57d1('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x57d1('0x1')]},'defaultuser':{'type':Sequelize[_0x57d1('0x1')]},'rtptimeout':{'type':Sequelize[_0x57d1('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x57d1('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x57d1('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no',_0x57d1('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x57d1('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x57d1('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x57d1('0x1')]},'contactdeny':{'type':Sequelize[_0x57d1('0x1')]},'contactacl':{'type':Sequelize[_0x57d1('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x57d1('0x1')]},'maxforwards':{'type':Sequelize[_0x57d1('0x24')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x57d1('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no')},'force_avp':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no')},'icesupport':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x57d1('0x3')]('yes','no',_0x57d1('0x2d'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x57d1('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x57d1('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x57d1('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0x57d1('0x2e'),_0x57d1('0x2f'),_0x57d1('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x57d1('0x1')]},'usereqphone':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x57d1('0x1')]},'call_limit':{'type':Sequelize[_0x57d1('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x57d1('0x1')]},'mohsuggest':{'type':Sequelize[_0x57d1('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x57d1('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x57d1('0x31')},'canreinvite':{'type':Sequelize[_0x57d1('0x3')](_0x57d1('0x17'),'no',_0x57d1('0x32'),_0x57d1('0x18'),_0x57d1('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x57d1('0x1')]},'otherFields':{'type':Sequelize[_0x57d1('0x1')]},'active':{'type':Sequelize[_0x57d1('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x57d1('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 77b181a..2b20638 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 _0x3d2d=['fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','params','include','find','clone','omit','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','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','jayson/promise','client','request','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','type','model','keys','query','filters','intersection','attributes'];(function(_0x20399d,_0x419e2a){var _0xc1510e=function(_0x58fd09){while(--_0x58fd09){_0x20399d['push'](_0x20399d['shift']());}};_0xc1510e(++_0x419e2a);}(_0x3d2d,0x9f));var _0xd3d2=function(_0x5a7112,_0x1f9492){_0x5a7112=_0x5a7112-0x0;var _0x3147f7=_0x3d2d[_0x5a7112];return _0x3147f7;};'use strict';var emlformat=require(_0xd3d2('0x0'));var rimraf=require(_0xd3d2('0x1'));var zipdir=require(_0xd3d2('0x2'));var jsonpatch=require(_0xd3d2('0x3'));var rp=require(_0xd3d2('0x4'));var moment=require(_0xd3d2('0x5'));var BPromise=require(_0xd3d2('0x6'));var Mustache=require(_0xd3d2('0x7'));var util=require(_0xd3d2('0x8'));var path=require('path');var sox=require(_0xd3d2('0x9'));var csv=require(_0xd3d2('0xa'));var ejs=require(_0xd3d2('0xb'));var fs=require('fs');var fs_extra=require(_0xd3d2('0xc'));var _=require('lodash');var squel=require(_0xd3d2('0xd'));var crypto=require(_0xd3d2('0xe'));var jsforce=require(_0xd3d2('0xf'));var deskjs=require(_0xd3d2('0x10'));var toCsv=require(_0xd3d2('0xa'));var querystring=require('querystring');var Papa=require(_0xd3d2('0x11'));var Redis=require(_0xd3d2('0x12'));var authService=require(_0xd3d2('0x13'));var qs=require(_0xd3d2('0x14'));var as=require(_0xd3d2('0x15'));var hardwareService=require(_0xd3d2('0x16'));var logger=require(_0xd3d2('0x17'))(_0xd3d2('0x18'));var utils=require('../../config/utils');var config=require(_0xd3d2('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd3d2('0x1a'))['db'];var jayson=require(_0xd3d2('0x1b'));var client=jayson[_0xd3d2('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x582506,_0x5a8359,_0x84861,_0x2e6575){return new BPromise(function(_0x46bea1,_0x9c169e){var _0x1e22a9=_0x2e6575||client;return _0x1e22a9[_0xd3d2('0x1d')](_0x582506,_0x84861)['then'](function(_0xc6d827){logger[_0xd3d2('0x1e')]('Trunk,\x20%s,\x20%s',_0x5a8359,_0xd3d2('0x1f'));logger[_0xd3d2('0x20')](_0xd3d2('0x21'),_0x5a8359,_0xd3d2('0x1f'),JSON[_0xd3d2('0x22')](_0xc6d827));if(_0xc6d827[_0xd3d2('0x23')]){if(_0xc6d827[_0xd3d2('0x23')][_0xd3d2('0x24')]===0x1f4){logger[_0xd3d2('0x23')](_0xd3d2('0x25'),_0x5a8359,_0xc6d827[_0xd3d2('0x23')][_0xd3d2('0x26')]);return _0x9c169e(_0xc6d827[_0xd3d2('0x23')][_0xd3d2('0x26')]);}logger[_0xd3d2('0x23')](_0xd3d2('0x25'),_0x5a8359,_0xc6d827[_0xd3d2('0x23')][_0xd3d2('0x26')]);return _0x46bea1(_0xc6d827['error'][_0xd3d2('0x26')]);}else{logger[_0xd3d2('0x1e')](_0xd3d2('0x25'),_0x5a8359,'request\x20sent');_0x46bea1(_0xc6d827[_0xd3d2('0x27')][_0xd3d2('0x26')]);}})[_0xd3d2('0x28')](function(_0x59029e){logger[_0xd3d2('0x23')]('Trunk,\x20%s,\x20%s',_0x5a8359,_0x59029e);_0x9c169e(_0x59029e);});});}function respondWithStatusCode(_0x303e63,_0x1cbc30){_0x1cbc30=_0x1cbc30||0xcc;return function(_0xcc1639){if(_0xcc1639){return _0x303e63[_0xd3d2('0x29')](_0x1cbc30);}return _0x303e63[_0xd3d2('0x2a')](_0x1cbc30)[_0xd3d2('0x2b')]();};}function respondWithResult(_0x124eda,_0x8dcb6){_0x8dcb6=_0x8dcb6||0xc8;return function(_0x44b02b){if(_0x44b02b){return _0x124eda[_0xd3d2('0x2a')](_0x8dcb6)[_0xd3d2('0x2c')](_0x44b02b);}};}function respondWithFilteredResult(_0x24b368,_0x43b5c6){return function(_0x441653){if(_0x441653){var _0x2959eb=typeof _0x43b5c6[_0xd3d2('0x2d')]===_0xd3d2('0x2e')&&typeof _0x43b5c6[_0xd3d2('0x2f')]===_0xd3d2('0x2e');var _0x1114b5=_0x441653[_0xd3d2('0x30')];var _0x26c33a=_0x2959eb?0x0:_0x43b5c6[_0xd3d2('0x2d')];var _0x484dd6=_0x2959eb?_0x441653[_0xd3d2('0x30')]:_0x43b5c6[_0xd3d2('0x2d')]+_0x43b5c6[_0xd3d2('0x2f')];var _0x3afb86;if(_0x484dd6>=_0x1114b5){_0x484dd6=_0x1114b5;_0x3afb86=0xc8;}else{_0x3afb86=0xce;}_0x24b368[_0xd3d2('0x2a')](_0x3afb86);return _0x24b368[_0xd3d2('0x31')](_0xd3d2('0x32'),_0x26c33a+'-'+_0x484dd6+'/'+_0x1114b5)[_0xd3d2('0x2c')](_0x441653);}return null;};}function patchUpdates(_0x3bb47c){return function(_0xd7fe17){try{jsonpatch[_0xd3d2('0x33')](_0xd7fe17,_0x3bb47c,!![]);}catch(_0x747eec){return BPromise[_0xd3d2('0x34')](_0x747eec);}return _0xd7fe17[_0xd3d2('0x35')]();};}function saveUpdates(_0xb043fb,_0x25e54f){return function(_0x589a08){if(_0x589a08){return _0x589a08[_0xd3d2('0x36')](_0xb043fb)['then'](function(_0x585947){return _0x585947;});}return null;};}function removeEntity(_0x37f7b7,_0x2f1824){return function(_0x503b37){if(_0x503b37){return _0x503b37[_0xd3d2('0x37')]()[_0xd3d2('0x38')](function(){var _0x1a95e2=_0x503b37[_0xd3d2('0x39')]({'plain':!![]});var _0x388c63=_0xd3d2('0x3a');return db[_0xd3d2('0x3b')][_0xd3d2('0x37')]({'where':{'type':_0x388c63,'resourceId':_0x1a95e2['id']}})[_0xd3d2('0x38')](function(){return _0x503b37;});})[_0xd3d2('0x38')](function(){_0x37f7b7[_0xd3d2('0x2a')](0xcc)[_0xd3d2('0x2b')]();});}};}function handleEntityNotFound(_0x38b216,_0x2017cf){return function(_0x153b63){if(!_0x153b63){_0x38b216['sendStatus'](0x194);}return _0x153b63;};}function handleError(_0x37bf07,_0x4f0c8d){_0x4f0c8d=_0x4f0c8d||0x1f4;return function(_0xc5b2a3){logger[_0xd3d2('0x23')](_0xc5b2a3[_0xd3d2('0x3c')]);if(_0xc5b2a3['name']){delete _0xc5b2a3[_0xd3d2('0x3d')];}_0x37bf07[_0xd3d2('0x2a')](_0x4f0c8d)['send'](_0xc5b2a3);};}exports[_0xd3d2('0x3e')]=function(_0x18fd19,_0x37b4d1){var _0x4db4a2={},_0x4bd11f={},_0x445195={'count':0x0,'rows':[]};var _0x142a01=_[_0xd3d2('0x3f')](db[_0xd3d2('0x40')][_0xd3d2('0x41')],function(_0x22590c){return{'name':_0x22590c['fieldName'],'type':_0x22590c[_0xd3d2('0x42')]['key']};});_0x4bd11f[_0xd3d2('0x43')]=_['map'](_0x142a01,_0xd3d2('0x3d'));_0x4bd11f['query']=_[_0xd3d2('0x44')](_0x18fd19[_0xd3d2('0x45')]);_0x4bd11f[_0xd3d2('0x46')]=_[_0xd3d2('0x47')](_0x4bd11f['model'],_0x4bd11f[_0xd3d2('0x45')]);_0x4db4a2[_0xd3d2('0x48')]=_[_0xd3d2('0x47')](_0x4bd11f[_0xd3d2('0x43')],qs[_0xd3d2('0x49')](_0x18fd19[_0xd3d2('0x45')][_0xd3d2('0x49')]));_0x4db4a2[_0xd3d2('0x48')]=_0x4db4a2[_0xd3d2('0x48')][_0xd3d2('0x4a')]?_0x4db4a2[_0xd3d2('0x48')]:_0x4bd11f['model'];if(!_0x18fd19[_0xd3d2('0x45')]['hasOwnProperty'](_0xd3d2('0x4b'))){_0x4db4a2['limit']=qs[_0xd3d2('0x2f')](_0x18fd19['query'][_0xd3d2('0x2f')]);_0x4db4a2[_0xd3d2('0x2d')]=qs['offset'](_0x18fd19[_0xd3d2('0x45')][_0xd3d2('0x2d')]);}_0x4db4a2[_0xd3d2('0x4c')]=qs['sort'](_0x18fd19[_0xd3d2('0x45')][_0xd3d2('0x4d')]);_0x4db4a2[_0xd3d2('0x4e')]=qs[_0xd3d2('0x46')](_[_0xd3d2('0x4f')](_0x18fd19[_0xd3d2('0x45')],_0x4bd11f[_0xd3d2('0x46')]),_0x142a01);if(_0x18fd19['query'][_0xd3d2('0x50')]){_0x4db4a2[_0xd3d2('0x4e')]=_['merge'](_0x4db4a2[_0xd3d2('0x4e')],{'$or':_[_0xd3d2('0x3f')](_0x142a01,function(_0x31becf){if(_0x31becf[_0xd3d2('0x42')]!==_0xd3d2('0x51')){var _0x21e417={};_0x21e417[_0x31becf[_0xd3d2('0x3d')]]={'$like':'%'+_0x18fd19['query']['filter']+'%'};return _0x21e417;}})});}_0x4db4a2=_[_0xd3d2('0x52')]({},_0x4db4a2,_0x18fd19[_0xd3d2('0x53')]);var _0x13e700={'where':_0x4db4a2[_0xd3d2('0x4e')]};return db[_0xd3d2('0x40')]['count'](_0x13e700)['then'](function(_0x1e55e4){_0x445195[_0xd3d2('0x30')]=_0x1e55e4;if(_0x18fd19['query'][_0xd3d2('0x54')]){_0x4db4a2['include']=[{'all':!![]}];}return db[_0xd3d2('0x40')]['findAll'](_0x4db4a2);})[_0xd3d2('0x38')](function(_0x21139b){_0x445195[_0xd3d2('0x55')]=_0x21139b;return _0x445195;})[_0xd3d2('0x38')](respondWithFilteredResult(_0x37b4d1,_0x4db4a2))['catch'](handleError(_0x37b4d1,null));};exports['show']=function(_0xa36f9b,_0x14698c){var _0xdb51a7={'raw':![],'where':{'id':_0xa36f9b[_0xd3d2('0x56')]['id']}},_0x5a8eb8={};_0x5a8eb8[_0xd3d2('0x43')]=_[_0xd3d2('0x44')](db['Trunk'][_0xd3d2('0x41')]);_0x5a8eb8['query']=_[_0xd3d2('0x44')](_0xa36f9b[_0xd3d2('0x45')]);_0x5a8eb8[_0xd3d2('0x46')]=_[_0xd3d2('0x47')](_0x5a8eb8[_0xd3d2('0x43')],_0x5a8eb8[_0xd3d2('0x45')]);_0xdb51a7[_0xd3d2('0x48')]=_[_0xd3d2('0x47')](_0x5a8eb8['model'],qs[_0xd3d2('0x49')](_0xa36f9b[_0xd3d2('0x45')][_0xd3d2('0x49')]));_0xdb51a7[_0xd3d2('0x48')]=_0xdb51a7[_0xd3d2('0x48')][_0xd3d2('0x4a')]?_0xdb51a7[_0xd3d2('0x48')]:_0x5a8eb8[_0xd3d2('0x43')];if(_0xa36f9b[_0xd3d2('0x45')][_0xd3d2('0x54')]){_0xdb51a7[_0xd3d2('0x57')]=[{'all':!![]}];}_0xdb51a7=_[_0xd3d2('0x52')]({},_0xdb51a7,_0xa36f9b['options']);return db[_0xd3d2('0x40')][_0xd3d2('0x58')](_0xdb51a7)[_0xd3d2('0x38')](handleEntityNotFound(_0x14698c,null))[_0xd3d2('0x38')](respondWithResult(_0x14698c,null))['catch'](handleError(_0x14698c,null));};exports[_0xd3d2('0x59')]=function(_0x3b8f31,_0x551904){var _0x18d9fd={'where':{'id':_0x3b8f31[_0xd3d2('0x56')]['id']}},_0x49f54c={};_0x49f54c[_0xd3d2('0x43')]=_['keys'](db[_0xd3d2('0x40')][_0xd3d2('0x41')]);_0x18d9fd[_0xd3d2('0x48')]=_['intersection'](_0x49f54c[_0xd3d2('0x43')],qs['fields'](_0x3b8f31[_0xd3d2('0x45')][_0xd3d2('0x49')]));_0x18d9fd['attributes']=_0x18d9fd[_0xd3d2('0x48')][_0xd3d2('0x4a')]?_0x18d9fd[_0xd3d2('0x48')]:_0x49f54c[_0xd3d2('0x43')];if(_0x3b8f31[_0xd3d2('0x45')][_0xd3d2('0x54')]){_0x18d9fd[_0xd3d2('0x57')]=[{'all':!![]}];}_0x18d9fd=_['merge']({},_0x18d9fd,_0x3b8f31[_0xd3d2('0x53')]);return db[_0xd3d2('0x40')][_0xd3d2('0x58')](_0x18d9fd)['then'](handleEntityNotFound(_0x551904,null))[_0xd3d2('0x38')](function(_0x16db0b){if(_0x16db0b){var _0x349773=_0x16db0b['get']({'plain':!![]});_0x349773=qs[_0xd3d2('0x5a')](_0x349773,['id',_0xd3d2('0x5b'),'updatedAt']);_0x3b8f31[_0xd3d2('0x5c')]=_['omit'](_0x3b8f31[_0xd3d2('0x5c')],['id',_0xd3d2('0x5b'),_0xd3d2('0x5d')]);return db[_0xd3d2('0x40')][_0xd3d2('0x5e')](_['merge'](_0x349773,_0x3b8f31['body']),{'include':_0x3b8f31[_0xd3d2('0x45')]['includeAll']?[{'all':!![]}]:undefined})[_0xd3d2('0x38')](function(_0x5a91dd){var _0x1958c8=_0x3b8f31[_0xd3d2('0x5f')][_0xd3d2('0x39')]({'plain':!![]});if(!_0x1958c8)throw new Error(_0xd3d2('0x60'));if(_0x1958c8[_0xd3d2('0x61')]===_0xd3d2('0x5f')){var _0x1154a5=_0x5a91dd[_0xd3d2('0x39')]({'plain':!![]});var _0x3800df=_0xd3d2('0x3a');return db[_0xd3d2('0x62')][_0xd3d2('0x58')]({'where':{'name':_0x3800df,'userProfileId':_0x1958c8[_0xd3d2('0x63')]},'raw':!![]})[_0xd3d2('0x38')](function(_0x36b38c){if(_0x36b38c&&_0x36b38c[_0xd3d2('0x64')]===0x0){return db[_0xd3d2('0x3b')]['create']({'name':_0x1154a5[_0xd3d2('0x3d')],'resourceId':_0x1154a5['id'],'type':_0x36b38c[_0xd3d2('0x3d')],'sectionId':_0x36b38c['id']},{})['then'](function(){return _0x5a91dd;});}else{return _0x5a91dd;}})[_0xd3d2('0x28')](function(_0x5ae800){logger[_0xd3d2('0x23')](_0xd3d2('0x65'),_0x5ae800);throw _0x5ae800;});}return _0x5a91dd;});}})[_0xd3d2('0x38')](respondWithResult(_0x551904,0xc9))[_0xd3d2('0x28')](handleError(_0x551904,null));};exports[_0xd3d2('0x5e')]=function(_0x2f947a,_0x30a20a,_0x4f05aa){var _0x52f223;return db[_0xd3d2('0x40')]['create'](_0x2f947a[_0xd3d2('0x5c')],{'raw':!![]})[_0xd3d2('0x38')](function(_0x375f8b){_0x52f223=_0x375f8b;return db[_0xd3d2('0x40')][_0xd3d2('0x66')]({'raw':!![]});})['then'](function(_0x29a32b){var _0x4fc7f6=fs[_0xd3d2('0x67')](path[_0xd3d2('0x68')](config[_0xd3d2('0x69')],_0xd3d2('0x6a')),_0xd3d2('0x6b'));var _0x4319c8=fs[_0xd3d2('0x67')](path[_0xd3d2('0x68')](config[_0xd3d2('0x69')],_0xd3d2('0x6c')),_0xd3d2('0x6b'));var _0x3a1f6e=ejs[_0xd3d2('0x6d')](_0x4fc7f6,{'trunks':_0x29a32b||[]});fs[_0xd3d2('0x6e')](_0xd3d2('0x6f'),_0x3a1f6e);if(_0x52f223[_0xd3d2('0x70')]){var _0x5d2fe5=ejs[_0xd3d2('0x6d')](_0x4319c8,{'trunks':_0x29a32b||[]});fs[_0xd3d2('0x6e')](_0xd3d2('0x71'),_0x5d2fe5);}})[_0xd3d2('0x38')](function(){return respondWithRpcPromise(_0xd3d2('0x72'),'create',{'module':_0xd3d2('0x73')});})[_0xd3d2('0x38')](function(){var _0x2f6518=_0x2f947a[_0xd3d2('0x5f')][_0xd3d2('0x39')]({'plain':!![]});if(!_0x2f6518)throw new Error(_0xd3d2('0x60'));if(_0x2f6518[_0xd3d2('0x61')]==='user'){var _0x41f464=_0x52f223[_0xd3d2('0x39')]({'plain':!![]});return db[_0xd3d2('0x62')]['find']({'where':{'name':_0xd3d2('0x3a'),'userProfileId':_0x2f6518[_0xd3d2('0x63')]},'raw':!![]})[_0xd3d2('0x38')](function(_0x576e3d){if(_0x576e3d&&_0x576e3d[_0xd3d2('0x64')]===0x0){return db[_0xd3d2('0x3b')][_0xd3d2('0x5e')]({'name':_0x41f464[_0xd3d2('0x3d')],'resourceId':_0x41f464['id'],'type':_0x576e3d[_0xd3d2('0x3d')],'sectionId':_0x576e3d['id']},{})[_0xd3d2('0x38')](function(){return _0x52f223;});}else{return _0x52f223;}})[_0xd3d2('0x28')](function(_0x5f4bfe){logger[_0xd3d2('0x23')](_0xd3d2('0x65'),_0x5f4bfe);throw _0x5f4bfe;});}return _0x52f223;})[_0xd3d2('0x38')](respondWithResult(_0x30a20a,0xc9))[_0xd3d2('0x28')](handleError(_0x30a20a,null));};exports[_0xd3d2('0x36')]=function(_0x3cb44b,_0x596473,_0x90678f){var _0xcac54d;return db['Trunk']['find']({'where':{'id':_0x3cb44b[_0xd3d2('0x56')]['id']}})[_0xd3d2('0x38')](handleEntityNotFound(_0x596473,null))[_0xd3d2('0x38')](saveUpdates(_0x3cb44b[_0xd3d2('0x5c')],null))[_0xd3d2('0x38')](function(_0x54a9ed){if(_0x54a9ed){_0xcac54d=_0x54a9ed;return db['Trunk'][_0xd3d2('0x66')]({'raw':!![]});}})['then'](function(_0x5b5810){if(_0x5b5810){var _0x266038=fs[_0xd3d2('0x67')](path['join'](config[_0xd3d2('0x69')],'server/files/templates/trunk.ejs'),'utf8');var _0x5ad8e0=fs[_0xd3d2('0x67')](path[_0xd3d2('0x68')](config[_0xd3d2('0x69')],_0xd3d2('0x6c')),_0xd3d2('0x6b'));var _0xbaf177=ejs['render'](_0x266038,{'trunks':_0x5b5810||[]});fs[_0xd3d2('0x6e')](_0xd3d2('0x6f'),_0xbaf177);var _0x4f8604=ejs['render'](_0x5ad8e0,{'trunks':_0x5b5810||[]});fs[_0xd3d2('0x6e')]('/etc/asterisk/sip_xcally_registers.conf',_0x4f8604);return respondWithRpcPromise('Reload',_0xd3d2('0x36'),{'module':'chan_sip.so'});}return null;})[_0xd3d2('0x38')](function(_0x475f01){if(_0x475f01){return _0xcac54d;}})[_0xd3d2('0x38')](respondWithResult(_0x596473,null))[_0xd3d2('0x28')](handleError(_0x596473,null));};exports[_0xd3d2('0x37')]=function(_0x32755a,_0x52603f,_0x2f80c5){var _0x382bd0;return db[_0xd3d2('0x40')][_0xd3d2('0x58')]({'where':{'id':_0x32755a[_0xd3d2('0x56')]['id']}})[_0xd3d2('0x38')](handleEntityNotFound(_0x52603f,null))['then'](removeEntity(_0x52603f,null))[_0xd3d2('0x38')](function(){return db[_0xd3d2('0x40')]['findAll']({'raw':!![]});})[_0xd3d2('0x38')](function(_0x3aadda){var _0x4f223b=fs[_0xd3d2('0x67')](path[_0xd3d2('0x68')](config[_0xd3d2('0x69')],_0xd3d2('0x6a')),'utf8');var _0x6b03ac=fs[_0xd3d2('0x67')](path[_0xd3d2('0x68')](config[_0xd3d2('0x69')],_0xd3d2('0x6c')),'utf8');var _0x52dc06=ejs[_0xd3d2('0x6d')](_0x4f223b,{'trunks':_0x3aadda});var _0x61850c=ejs['render'](_0x6b03ac,{'trunks':_0x3aadda});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x52dc06);fs['writeFileSync'](_0xd3d2('0x71'),_0x61850c);return respondWithRpcPromise('Reload',_0xd3d2('0x37'),{'module':'chan_sip.so'});})[_0xd3d2('0x28')](handleError(_0x52603f,null));}; \ No newline at end of file +var _0x9b70=['createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','server/files/templates/trunk.ejs','/etc/asterisk/sip_xcally_trunks.conf','eml-format','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','Trunks','UserProfileResource','stack','name','send','index','Trunk','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','params','rawAttributes','find','clone','keys','options','omit'];(function(_0x316c90,_0x4399f3){var _0x60428f=function(_0x38f3ba){while(--_0x38f3ba){_0x316c90['push'](_0x316c90['shift']());}};_0x60428f(++_0x4399f3);}(_0x9b70,0x8a));var _0x09b7=function(_0x2653ac,_0x338212){_0x2653ac=_0x2653ac-0x0;var _0x14a4ba=_0x9b70[_0x2653ac];return _0x14a4ba;};'use strict';var emlformat=require(_0x09b7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09b7('0x1'));var moment=require(_0x09b7('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x09b7('0x3'));var util=require(_0x09b7('0x4'));var path=require(_0x09b7('0x5'));var sox=require(_0x09b7('0x6'));var csv=require('to-csv');var ejs=require(_0x09b7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09b7('0x8'));var squel=require(_0x09b7('0x9'));var crypto=require('crypto');var jsforce=require(_0x09b7('0xa'));var deskjs=require(_0x09b7('0xb'));var toCsv=require('to-csv');var querystring=require(_0x09b7('0xc'));var Papa=require('papaparse');var Redis=require(_0x09b7('0xd'));var authService=require(_0x09b7('0xe'));var qs=require(_0x09b7('0xf'));var as=require(_0x09b7('0x10'));var hardwareService=require(_0x09b7('0x11'));var logger=require(_0x09b7('0x12'))(_0x09b7('0x13'));var utils=require(_0x09b7('0x14'));var config=require(_0x09b7('0x15'));var licenseUtil=require(_0x09b7('0x16'));var db=require(_0x09b7('0x17'))['db'];var jayson=require(_0x09b7('0x18'));var client=jayson[_0x09b7('0x19')][_0x09b7('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2f66e0,_0x17f6fd,_0x37441b,_0x415254){return new BPromise(function(_0x1a6c41,_0x84dc79){var _0x1ee345=_0x415254||client;return _0x1ee345[_0x09b7('0x1b')](_0x2f66e0,_0x37441b)[_0x09b7('0x1c')](function(_0x40daa9){logger[_0x09b7('0x1d')](_0x09b7('0x1e'),_0x17f6fd,_0x09b7('0x1f'));logger[_0x09b7('0x20')](_0x09b7('0x21'),_0x17f6fd,_0x09b7('0x1f'),JSON['stringify'](_0x40daa9));if(_0x40daa9[_0x09b7('0x22')]){if(_0x40daa9[_0x09b7('0x22')]['code']===0x1f4){logger[_0x09b7('0x22')](_0x09b7('0x1e'),_0x17f6fd,_0x40daa9[_0x09b7('0x22')][_0x09b7('0x23')]);return _0x84dc79(_0x40daa9[_0x09b7('0x22')][_0x09b7('0x23')]);}logger[_0x09b7('0x22')]('Trunk,\x20%s,\x20%s',_0x17f6fd,_0x40daa9[_0x09b7('0x22')]['message']);return _0x1a6c41(_0x40daa9[_0x09b7('0x22')][_0x09b7('0x23')]);}else{logger[_0x09b7('0x1d')]('Trunk,\x20%s,\x20%s',_0x17f6fd,'request\x20sent');_0x1a6c41(_0x40daa9[_0x09b7('0x24')][_0x09b7('0x23')]);}})[_0x09b7('0x25')](function(_0x26145b){logger[_0x09b7('0x22')](_0x09b7('0x1e'),_0x17f6fd,_0x26145b);_0x84dc79(_0x26145b);});});}function respondWithStatusCode(_0x544350,_0x5f4aa5){_0x5f4aa5=_0x5f4aa5||0xcc;return function(_0xb49258){if(_0xb49258){return _0x544350[_0x09b7('0x26')](_0x5f4aa5);}return _0x544350[_0x09b7('0x27')](_0x5f4aa5)[_0x09b7('0x28')]();};}function respondWithResult(_0x16cdc4,_0xd34a2d){_0xd34a2d=_0xd34a2d||0xc8;return function(_0x3d16e4){if(_0x3d16e4){return _0x16cdc4[_0x09b7('0x27')](_0xd34a2d)[_0x09b7('0x29')](_0x3d16e4);}};}function respondWithFilteredResult(_0x1a4b7d,_0x528de9){return function(_0x2fb92b){if(_0x2fb92b){var _0x2eb906=typeof _0x528de9[_0x09b7('0x2a')]===_0x09b7('0x2b')&&typeof _0x528de9[_0x09b7('0x2c')]===_0x09b7('0x2b');var _0x2c6226=_0x2fb92b[_0x09b7('0x2d')];var _0x396780=_0x2eb906?0x0:_0x528de9['offset'];var _0x2c1ea4=_0x2eb906?_0x2fb92b[_0x09b7('0x2d')]:_0x528de9[_0x09b7('0x2a')]+_0x528de9[_0x09b7('0x2c')];var _0x19e30f;if(_0x2c1ea4>=_0x2c6226){_0x2c1ea4=_0x2c6226;_0x19e30f=0xc8;}else{_0x19e30f=0xce;}_0x1a4b7d['status'](_0x19e30f);return _0x1a4b7d[_0x09b7('0x2e')](_0x09b7('0x2f'),_0x396780+'-'+_0x2c1ea4+'/'+_0x2c6226)[_0x09b7('0x29')](_0x2fb92b);}return null;};}function patchUpdates(_0x4efee4){return function(_0x43eeab){try{jsonpatch[_0x09b7('0x30')](_0x43eeab,_0x4efee4,!![]);}catch(_0xded92){return BPromise[_0x09b7('0x31')](_0xded92);}return _0x43eeab['save']();};}function saveUpdates(_0x3c7174,_0x3122a4){return function(_0x4c53ec){if(_0x4c53ec){return _0x4c53ec[_0x09b7('0x32')](_0x3c7174)[_0x09b7('0x1c')](function(_0x3f3da9){return _0x3f3da9;});}return null;};}function removeEntity(_0x282672,_0x1899a6){return function(_0xed7bb5){if(_0xed7bb5){return _0xed7bb5[_0x09b7('0x33')]()[_0x09b7('0x1c')](function(){var _0x4001d1=_0xed7bb5[_0x09b7('0x34')]({'plain':!![]});var _0x617362=_0x09b7('0x35');return db[_0x09b7('0x36')][_0x09b7('0x33')]({'where':{'type':_0x617362,'resourceId':_0x4001d1['id']}})[_0x09b7('0x1c')](function(){return _0xed7bb5;});})[_0x09b7('0x1c')](function(){_0x282672[_0x09b7('0x27')](0xcc)[_0x09b7('0x28')]();});}};}function handleEntityNotFound(_0x5a3510,_0x1ddfb6){return function(_0x251cf8){if(!_0x251cf8){_0x5a3510[_0x09b7('0x26')](0x194);}return _0x251cf8;};}function handleError(_0x3f4480,_0x150608){_0x150608=_0x150608||0x1f4;return function(_0x1534ed){logger[_0x09b7('0x22')](_0x1534ed[_0x09b7('0x37')]);if(_0x1534ed[_0x09b7('0x38')]){delete _0x1534ed['name'];}_0x3f4480[_0x09b7('0x27')](_0x150608)[_0x09b7('0x39')](_0x1534ed);};}exports[_0x09b7('0x3a')]=function(_0x239b71,_0x4890c6){var _0x5ca970={},_0x41b9fc={},_0x4fb3d6={'count':0x0,'rows':[]};var _0x2b72d7=_['map'](db[_0x09b7('0x3b')]['rawAttributes'],function(_0x4a4e89){return{'name':_0x4a4e89[_0x09b7('0x3c')],'type':_0x4a4e89['type'][_0x09b7('0x3d')]};});_0x41b9fc[_0x09b7('0x3e')]=_['map'](_0x2b72d7,_0x09b7('0x38'));_0x41b9fc[_0x09b7('0x3f')]=_['keys'](_0x239b71[_0x09b7('0x3f')]);_0x41b9fc[_0x09b7('0x40')]=_[_0x09b7('0x41')](_0x41b9fc[_0x09b7('0x3e')],_0x41b9fc['query']);_0x5ca970[_0x09b7('0x42')]=_['intersection'](_0x41b9fc[_0x09b7('0x3e')],qs[_0x09b7('0x43')](_0x239b71['query'][_0x09b7('0x43')]));_0x5ca970[_0x09b7('0x42')]=_0x5ca970[_0x09b7('0x42')][_0x09b7('0x44')]?_0x5ca970['attributes']:_0x41b9fc['model'];if(!_0x239b71[_0x09b7('0x3f')]['hasOwnProperty'](_0x09b7('0x45'))){_0x5ca970[_0x09b7('0x2c')]=qs[_0x09b7('0x2c')](_0x239b71['query']['limit']);_0x5ca970[_0x09b7('0x2a')]=qs['offset'](_0x239b71[_0x09b7('0x3f')][_0x09b7('0x2a')]);}_0x5ca970[_0x09b7('0x46')]=qs[_0x09b7('0x47')](_0x239b71[_0x09b7('0x3f')][_0x09b7('0x47')]);_0x5ca970[_0x09b7('0x48')]=qs[_0x09b7('0x40')](_[_0x09b7('0x49')](_0x239b71[_0x09b7('0x3f')],_0x41b9fc['filters']),_0x2b72d7);if(_0x239b71[_0x09b7('0x3f')][_0x09b7('0x4a')]){_0x5ca970[_0x09b7('0x48')]=_[_0x09b7('0x4b')](_0x5ca970[_0x09b7('0x48')],{'$or':_[_0x09b7('0x4c')](_0x2b72d7,function(_0x375bc1){if(_0x375bc1[_0x09b7('0x4d')]!==_0x09b7('0x4e')){var _0x3eb722={};_0x3eb722[_0x375bc1[_0x09b7('0x38')]]={'$like':'%'+_0x239b71['query'][_0x09b7('0x4a')]+'%'};return _0x3eb722;}})});}_0x5ca970=_[_0x09b7('0x4b')]({},_0x5ca970,_0x239b71['options']);var _0x20455d={'where':_0x5ca970[_0x09b7('0x48')]};return db[_0x09b7('0x3b')][_0x09b7('0x2d')](_0x20455d)[_0x09b7('0x1c')](function(_0x21e89d){_0x4fb3d6[_0x09b7('0x2d')]=_0x21e89d;if(_0x239b71[_0x09b7('0x3f')][_0x09b7('0x4f')]){_0x5ca970[_0x09b7('0x50')]=[{'all':!![]}];}return db['Trunk'][_0x09b7('0x51')](_0x5ca970);})[_0x09b7('0x1c')](function(_0x1acb71){_0x4fb3d6[_0x09b7('0x52')]=_0x1acb71;return _0x4fb3d6;})['then'](respondWithFilteredResult(_0x4890c6,_0x5ca970))[_0x09b7('0x25')](handleError(_0x4890c6,null));};exports['show']=function(_0x10a5fa,_0x625b14){var _0x4ac6eb={'raw':![],'where':{'id':_0x10a5fa[_0x09b7('0x53')]['id']}},_0x5500d7={};_0x5500d7[_0x09b7('0x3e')]=_['keys'](db[_0x09b7('0x3b')][_0x09b7('0x54')]);_0x5500d7[_0x09b7('0x3f')]=_['keys'](_0x10a5fa[_0x09b7('0x3f')]);_0x5500d7['filters']=_[_0x09b7('0x41')](_0x5500d7[_0x09b7('0x3e')],_0x5500d7['query']);_0x4ac6eb[_0x09b7('0x42')]=_[_0x09b7('0x41')](_0x5500d7[_0x09b7('0x3e')],qs['fields'](_0x10a5fa[_0x09b7('0x3f')][_0x09b7('0x43')]));_0x4ac6eb['attributes']=_0x4ac6eb[_0x09b7('0x42')][_0x09b7('0x44')]?_0x4ac6eb[_0x09b7('0x42')]:_0x5500d7[_0x09b7('0x3e')];if(_0x10a5fa[_0x09b7('0x3f')][_0x09b7('0x4f')]){_0x4ac6eb[_0x09b7('0x50')]=[{'all':!![]}];}_0x4ac6eb=_['merge']({},_0x4ac6eb,_0x10a5fa['options']);return db['Trunk'][_0x09b7('0x55')](_0x4ac6eb)[_0x09b7('0x1c')](handleEntityNotFound(_0x625b14,null))[_0x09b7('0x1c')](respondWithResult(_0x625b14,null))[_0x09b7('0x25')](handleError(_0x625b14,null));};exports[_0x09b7('0x56')]=function(_0xca94f,_0x551fc3){var _0xaf9042={'where':{'id':_0xca94f[_0x09b7('0x53')]['id']}},_0x19d7b5={};_0x19d7b5[_0x09b7('0x3e')]=_[_0x09b7('0x57')](db['Trunk'][_0x09b7('0x54')]);_0xaf9042[_0x09b7('0x42')]=_['intersection'](_0x19d7b5[_0x09b7('0x3e')],qs['fields'](_0xca94f['query']['fields']));_0xaf9042[_0x09b7('0x42')]=_0xaf9042[_0x09b7('0x42')][_0x09b7('0x44')]?_0xaf9042[_0x09b7('0x42')]:_0x19d7b5[_0x09b7('0x3e')];if(_0xca94f[_0x09b7('0x3f')]['includeAll']){_0xaf9042[_0x09b7('0x50')]=[{'all':!![]}];}_0xaf9042=_['merge']({},_0xaf9042,_0xca94f[_0x09b7('0x58')]);return db[_0x09b7('0x3b')][_0x09b7('0x55')](_0xaf9042)[_0x09b7('0x1c')](handleEntityNotFound(_0x551fc3,null))[_0x09b7('0x1c')](function(_0x4fef5a){if(_0x4fef5a){var _0x2b8fbc=_0x4fef5a[_0x09b7('0x34')]({'plain':!![]});_0x2b8fbc=qs[_0x09b7('0x59')](_0x2b8fbc,['id',_0x09b7('0x5a'),_0x09b7('0x5b')]);_0xca94f[_0x09b7('0x5c')]=_[_0x09b7('0x59')](_0xca94f[_0x09b7('0x5c')],['id',_0x09b7('0x5a'),_0x09b7('0x5b')]);return db[_0x09b7('0x3b')]['create'](_[_0x09b7('0x4b')](_0x2b8fbc,_0xca94f[_0x09b7('0x5c')]),{'include':_0xca94f[_0x09b7('0x3f')][_0x09b7('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x37dbe4){var _0x3bc211=_0xca94f[_0x09b7('0x5d')][_0x09b7('0x34')]({'plain':!![]});if(!_0x3bc211)throw new Error(_0x09b7('0x5e'));if(_0x3bc211[_0x09b7('0x5f')]==='user'){var _0x500dc9=_0x37dbe4[_0x09b7('0x34')]({'plain':!![]});var _0x2ef3b8=_0x09b7('0x35');return db[_0x09b7('0x60')][_0x09b7('0x55')]({'where':{'name':_0x2ef3b8,'userProfileId':_0x3bc211[_0x09b7('0x61')]},'raw':!![]})[_0x09b7('0x1c')](function(_0x190d81){if(_0x190d81&&_0x190d81[_0x09b7('0x62')]===0x0){return db[_0x09b7('0x36')][_0x09b7('0x63')]({'name':_0x500dc9[_0x09b7('0x38')],'resourceId':_0x500dc9['id'],'type':_0x190d81[_0x09b7('0x38')],'sectionId':_0x190d81['id']},{})['then'](function(){return _0x37dbe4;});}else{return _0x37dbe4;}})['catch'](function(_0x56bcd7){logger['error'](_0x09b7('0x64'),_0x56bcd7);throw _0x56bcd7;});}return _0x37dbe4;});}})['then'](respondWithResult(_0x551fc3,0xc9))['catch'](handleError(_0x551fc3,null));};exports[_0x09b7('0x63')]=function(_0xd34ad0,_0x509d30,_0x399a99){var _0x4fae4c;return db['Trunk'][_0x09b7('0x63')](_0xd34ad0[_0x09b7('0x5c')],{'raw':!![]})[_0x09b7('0x1c')](function(_0x49fdc9){_0x4fae4c=_0x49fdc9;return db[_0x09b7('0x3b')]['findAll']({'raw':!![]});})[_0x09b7('0x1c')](function(_0x2ae058){var _0x207b7d=fs[_0x09b7('0x65')](path['join'](config[_0x09b7('0x66')],'server/files/templates/trunk.ejs'),'utf8');var _0x12e8f6=fs['readFileSync'](path[_0x09b7('0x67')](config[_0x09b7('0x66')],_0x09b7('0x68')),_0x09b7('0x69'));var _0x34d043=ejs[_0x09b7('0x6a')](_0x207b7d,{'trunks':_0x2ae058||[]});fs[_0x09b7('0x6b')]('/etc/asterisk/sip_xcally_trunks.conf',_0x34d043);if(_0x4fae4c[_0x09b7('0x6c')]){var _0x281610=ejs[_0x09b7('0x6a')](_0x12e8f6,{'trunks':_0x2ae058||[]});fs[_0x09b7('0x6b')](_0x09b7('0x6d'),_0x281610);}})[_0x09b7('0x1c')](function(){return respondWithRpcPromise(_0x09b7('0x6e'),_0x09b7('0x63'),{'module':_0x09b7('0x6f')});})[_0x09b7('0x1c')](function(){var _0x1201ba=_0xd34ad0[_0x09b7('0x5d')][_0x09b7('0x34')]({'plain':!![]});if(!_0x1201ba)throw new Error(_0x09b7('0x5e'));if(_0x1201ba['role']==='user'){var _0x2bcdd0=_0x4fae4c[_0x09b7('0x34')]({'plain':!![]});return db[_0x09b7('0x60')]['find']({'where':{'name':_0x09b7('0x35'),'userProfileId':_0x1201ba[_0x09b7('0x61')]},'raw':!![]})[_0x09b7('0x1c')](function(_0x36f6e1){if(_0x36f6e1&&_0x36f6e1[_0x09b7('0x62')]===0x0){return db[_0x09b7('0x36')][_0x09b7('0x63')]({'name':_0x2bcdd0['name'],'resourceId':_0x2bcdd0['id'],'type':_0x36f6e1['name'],'sectionId':_0x36f6e1['id']},{})[_0x09b7('0x1c')](function(){return _0x4fae4c;});}else{return _0x4fae4c;}})[_0x09b7('0x25')](function(_0x2a5a62){logger[_0x09b7('0x22')](_0x09b7('0x64'),_0x2a5a62);throw _0x2a5a62;});}return _0x4fae4c;})[_0x09b7('0x1c')](respondWithResult(_0x509d30,0xc9))[_0x09b7('0x25')](handleError(_0x509d30,null));};exports[_0x09b7('0x32')]=function(_0x4bc346,_0x545b92,_0x2eb420){var _0x1e0870;return db[_0x09b7('0x3b')]['find']({'where':{'id':_0x4bc346[_0x09b7('0x53')]['id']}})[_0x09b7('0x1c')](handleEntityNotFound(_0x545b92,null))[_0x09b7('0x1c')](saveUpdates(_0x4bc346['body'],null))[_0x09b7('0x1c')](function(_0x8685fd){if(_0x8685fd){_0x1e0870=_0x8685fd;return db[_0x09b7('0x3b')][_0x09b7('0x51')]({'raw':!![]});}})['then'](function(_0x531605){if(_0x531605){var _0x4ef86a=fs[_0x09b7('0x65')](path['join'](config[_0x09b7('0x66')],_0x09b7('0x70')),_0x09b7('0x69'));var _0x540ca3=fs['readFileSync'](path[_0x09b7('0x67')](config[_0x09b7('0x66')],'server/files/templates/registry.ejs'),_0x09b7('0x69'));var _0x218795=ejs[_0x09b7('0x6a')](_0x4ef86a,{'trunks':_0x531605||[]});fs[_0x09b7('0x6b')](_0x09b7('0x71'),_0x218795);var _0x2680fc=ejs[_0x09b7('0x6a')](_0x540ca3,{'trunks':_0x531605||[]});fs['writeFileSync'](_0x09b7('0x6d'),_0x2680fc);return respondWithRpcPromise(_0x09b7('0x6e'),'update',{'module':_0x09b7('0x6f')});}return null;})[_0x09b7('0x1c')](function(_0x1d9d2d){if(_0x1d9d2d){return _0x1e0870;}})[_0x09b7('0x1c')](respondWithResult(_0x545b92,null))[_0x09b7('0x25')](handleError(_0x545b92,null));};exports['destroy']=function(_0x386aac,_0x260914,_0x317a9b){var _0xfce168;return db[_0x09b7('0x3b')][_0x09b7('0x55')]({'where':{'id':_0x386aac[_0x09b7('0x53')]['id']}})[_0x09b7('0x1c')](handleEntityNotFound(_0x260914,null))[_0x09b7('0x1c')](removeEntity(_0x260914,null))[_0x09b7('0x1c')](function(){return db[_0x09b7('0x3b')][_0x09b7('0x51')]({'raw':!![]});})[_0x09b7('0x1c')](function(_0x1b0627){var _0x13e2d2=fs[_0x09b7('0x65')](path[_0x09b7('0x67')](config[_0x09b7('0x66')],_0x09b7('0x70')),_0x09b7('0x69'));var _0x48a04d=fs[_0x09b7('0x65')](path['join'](config[_0x09b7('0x66')],_0x09b7('0x68')),_0x09b7('0x69'));var _0x264ea0=ejs[_0x09b7('0x6a')](_0x13e2d2,{'trunks':_0x1b0627});var _0x5e46ce=ejs[_0x09b7('0x6a')](_0x48a04d,{'trunks':_0x1b0627});fs[_0x09b7('0x6b')](_0x09b7('0x71'),_0x264ea0);fs['writeFileSync'](_0x09b7('0x6d'),_0x5e46ce);return respondWithRpcPromise(_0x09b7('0x6e'),_0x09b7('0x33'),{'module':_0x09b7('0x6f')});})[_0x09b7('0x25')](handleError(_0x260914,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index d1af597..cbf700b 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 _0xe6cb=['path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1f535b,_0xc42523){var _0x5bb329=function(_0xcaa78d){while(--_0xcaa78d){_0x1f535b['push'](_0x1f535b['shift']());}};_0x5bb329(++_0xc42523);}(_0xe6cb,0x158));var _0xbe6c=function(_0xc754da,_0x33c76c){_0xc754da=_0xc754da-0x0;var _0x46c9f6=_0xe6cb[_0xc754da];return _0x46c9f6;};'use strict';var _=require(_0xbe6c('0x0'));var util=require('util');var logger=require(_0xbe6c('0x1'))(_0xbe6c('0x2'));var moment=require(_0xbe6c('0x3'));var BPromise=require(_0xbe6c('0x4'));var rp=require(_0xbe6c('0x5'));var fs=require('fs');var path=require(_0xbe6c('0x6'));var rimraf=require(_0xbe6c('0x7'));var config=require(_0xbe6c('0x8'));var attributes=require(_0xbe6c('0x9'));module[_0xbe6c('0xa')]=function(_0x21cb16,_0x5e7e86){return _0x21cb16[_0xbe6c('0xb')](_0xbe6c('0xc'),attributes,{'tableName':_0xbe6c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c09=['exports','define','Trunk','tools_trunks','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./trunk.attributes'];(function(_0x331054,_0x3bd4d1){var _0x422008=function(_0x393924){while(--_0x393924){_0x331054['push'](_0x331054['shift']());}};_0x422008(++_0x3bd4d1);}(_0x7c09,0x1cc));var _0x97c0=function(_0x45571a,_0x533f9e){_0x45571a=_0x45571a-0x0;var _0x179692=_0x7c09[_0x45571a];return _0x179692;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x97c0('0x0'))(_0x97c0('0x1'));var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require('../../config/environment');var attributes=require(_0x97c0('0x7'));module[_0x97c0('0x8')]=function(_0x2c1f51,_0x14d095){return _0x2c1f51[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'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 5235322..ba8dd91 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 _0x5eb8=['where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','message','catch','Trunk','findAll','options','raw','limit','include','model','attributes','map','then','GetTrunk','stringify','ShowTrunk'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5eb8,0xb0));var _0x85eb=function(_0x139b85,_0x5e0691){_0x139b85=_0x139b85-0x0;var _0x1e833f=_0x5eb8[_0x139b85];return _0x1e833f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('Trunk,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('Trunk,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('Trunk,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['GetTrunk']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')]({'raw':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8['options'][_0x85eb('0x18')]===undefined?!![]:![]:!![],'where':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')]['where']||null:null,'attributes':_0x50d2a8['options']?_0x50d2a8['options']['attributes']||null:null,'limit':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x19')]||null:null,'include':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x1a')]?_['map'](_0x50d2a8['options']['include'],function(_0x298e84){return{'model':db[_0x298e84[_0x85eb('0x1b')]],'as':_0x298e84['as'],'attributes':_0x298e84[_0x85eb('0x1c')],'include':_0x298e84[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x298e84[_0x85eb('0x1a')],function(_0x5dfc96){return{'model':db[_0x5dfc96[_0x85eb('0x1b')]],'as':_0x5dfc96['as'],'attributes':_0x5dfc96[_0x85eb('0x1c')],'include':_0x5dfc96[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x5dfc96[_0x85eb('0x1a')],function(_0x57a03c){return{'model':db[_0x57a03c[_0x85eb('0x1b')]],'as':_0x57a03c['as'],'attributes':_0x57a03c[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x3e7eb9){logger[_0x85eb('0xd')](_0x85eb('0x1f'),_0x50d2a8);logger['debug']('GetTrunk',_0x50d2a8,JSON[_0x85eb('0x20')](_0x3e7eb9));_0x39ca96(_0x3e7eb9);})['catch'](function(_0xa9b14f){logger['error'](_0x85eb('0x1f'),_0xa9b14f[_0x85eb('0x13')],_0x50d2a8);_0x10cf2f(_0xe198ca[_0x85eb('0x12')](0x1f4,_0xa9b14f[_0x85eb('0x13')]));});});};exports[_0x85eb('0x21')]=function(_0xf4ac13){var _0x41ed76=this;return new Promise(function(_0x5decd5,_0x237f19){return db[_0x85eb('0x15')]['find']({'raw':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13['options']['raw']===undefined?!![]:![]:!![],'where':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x22')]||null:null,'attributes':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1c')]||null:null,'include':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0xf4ac13['options'][_0x85eb('0x1a')],function(_0x3a5b87){return{'model':db[_0x3a5b87['model']],'as':_0x3a5b87['as'],'attributes':_0x3a5b87['attributes'],'include':_0x3a5b87[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x3a5b87[_0x85eb('0x1a')],function(_0x12cb4c){return{'model':db[_0x12cb4c[_0x85eb('0x1b')]],'as':_0x12cb4c['as'],'attributes':_0x12cb4c[_0x85eb('0x1c')],'include':_0x12cb4c[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x12cb4c[_0x85eb('0x1a')],function(_0x373e5f){return{'model':db[_0x373e5f[_0x85eb('0x1b')]],'as':_0x373e5f['as'],'attributes':_0x373e5f[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x33605a){logger['info'](_0x85eb('0x21'),_0xf4ac13);logger[_0x85eb('0x10')]('ShowTrunk',_0xf4ac13,JSON['stringify'](_0x33605a));_0x5decd5(_0x33605a);})[_0x85eb('0x14')](function(_0xe22d16){logger['error'](_0x85eb('0x21'),_0xe22d16['message'],_0xf4ac13);_0x237f19(_0x41ed76[_0x85eb('0x12')](0x1f4,_0xe22d16['message']));});});}; \ No newline at end of file +var _0x5f66=['debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','GetTrunk','findAll','options','attributes','limit','include','model','map','ShowTrunk','Trunk','raw','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','Trunk,\x20%s,\x20%s','request\x20sent'];(function(_0x2f41ba,_0x34789b){var _0x142b0a=function(_0x37951b){while(--_0x37951b){_0x2f41ba['push'](_0x2f41ba['shift']());}};_0x142b0a(++_0x34789b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('Trunk,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}exports[_0x65f6('0x15')]=function(_0x1f974c){var _0xc8660c=this;return new Promise(function(_0x18380e,_0x495dd6){return db['Trunk'][_0x65f6('0x16')]({'raw':_0x1f974c['options']?_0x1f974c['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')]['where']||null:null,'attributes':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')][_0x65f6('0x18')]||null:null,'limit':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')][_0x65f6('0x19')]||null:null,'include':_0x1f974c['options']?_0x1f974c[_0x65f6('0x17')]['include']?_['map'](_0x1f974c[_0x65f6('0x17')][_0x65f6('0x1a')],function(_0x524e42){return{'model':db[_0x524e42[_0x65f6('0x1b')]],'as':_0x524e42['as'],'attributes':_0x524e42[_0x65f6('0x18')],'include':_0x524e42[_0x65f6('0x1a')]?_[_0x65f6('0x1c')](_0x524e42['include'],function(_0x9d7bb0){return{'model':db[_0x9d7bb0[_0x65f6('0x1b')]],'as':_0x9d7bb0['as'],'attributes':_0x9d7bb0[_0x65f6('0x18')],'include':_0x9d7bb0['include']?_['map'](_0x9d7bb0['include'],function(_0x29abdb){return{'model':db[_0x29abdb[_0x65f6('0x1b')]],'as':_0x29abdb['as'],'attributes':_0x29abdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x65f6('0xa')](function(_0x28f710){logger['info'](_0x65f6('0x15'),_0x1f974c);logger[_0x65f6('0xd')](_0x65f6('0x15'),_0x1f974c,JSON['stringify'](_0x28f710));_0x18380e(_0x28f710);})['catch'](function(_0x488d36){logger[_0x65f6('0x12')](_0x65f6('0x15'),_0x488d36[_0x65f6('0x11')],_0x1f974c);_0x495dd6(_0xc8660c[_0x65f6('0x12')](0x1f4,_0x488d36[_0x65f6('0x11')]));});});};exports[_0x65f6('0x1d')]=function(_0x144e55){var _0x4ace4c=this;return new Promise(function(_0x4ea23d,_0x154cbd){return db[_0x65f6('0x1e')]['find']({'raw':_0x144e55['options']?_0x144e55[_0x65f6('0x17')][_0x65f6('0x1f')]===undefined?!![]:![]:!![],'where':_0x144e55[_0x65f6('0x17')]?_0x144e55[_0x65f6('0x17')][_0x65f6('0x20')]||null:null,'attributes':_0x144e55[_0x65f6('0x17')]?_0x144e55['options'][_0x65f6('0x18')]||null:null,'include':_0x144e55[_0x65f6('0x17')]?_0x144e55[_0x65f6('0x17')]['include']?_[_0x65f6('0x1c')](_0x144e55[_0x65f6('0x17')][_0x65f6('0x1a')],function(_0x45510a){return{'model':db[_0x45510a[_0x65f6('0x1b')]],'as':_0x45510a['as'],'attributes':_0x45510a[_0x65f6('0x18')],'include':_0x45510a['include']?_[_0x65f6('0x1c')](_0x45510a[_0x65f6('0x1a')],function(_0x4f3e22){return{'model':db[_0x4f3e22[_0x65f6('0x1b')]],'as':_0x4f3e22['as'],'attributes':_0x4f3e22['attributes'],'include':_0x4f3e22[_0x65f6('0x1a')]?_['map'](_0x4f3e22[_0x65f6('0x1a')],function(_0x24f7fd){return{'model':db[_0x24f7fd['model']],'as':_0x24f7fd['as'],'attributes':_0x24f7fd[_0x65f6('0x18')]};}):[]};}):[]};}):[]:[]})[_0x65f6('0xa')](function(_0x3b261d){logger['info']('ShowTrunk',_0x144e55);logger[_0x65f6('0xd')]('ShowTrunk',_0x144e55,JSON[_0x65f6('0xf')](_0x3b261d));_0x4ea23d(_0x3b261d);})['catch'](function(_0x22d760){logger[_0x65f6('0x12')]('ShowTrunk',_0x22d760[_0x65f6('0x11')],_0x144e55);_0x154cbd(_0x4ace4c['error'](0x1f4,_0x22d760['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index f34445f..6118ada 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 _0x7d55=['removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','whoami','/:id','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues_rt','getVoiceQueuesRt','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','post','addContacts','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','file','/:id/login','login','logout','/:id/pause','/:id/unpause','unpause','addTeams','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','update','put','/:id/password','changePassword','delete','removeQueues','destroy','/:id/chat_interactions','removeChatInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeSmsAccounts'];(function(_0x1bcc0d,_0x159cea){var _0x4adde9=function(_0x260d34){while(--_0x260d34){_0x1bcc0d['push'](_0x1bcc0d['shift']());}};_0x4adde9(++_0x159cea);}(_0x7d55,0x1bc));var _0x57d5=function(_0x252221,_0x2e5dbf){_0x252221=_0x252221-0x0;var _0x4ce7c6=_0x7d55[_0x252221];return _0x4ce7c6;};'use strict';var multer=require(_0x57d5('0x0'));var util=require(_0x57d5('0x1'));var path=require(_0x57d5('0x2'));var timeout=require(_0x57d5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x57d5('0x4'));var auth=require(_0x57d5('0x5'));var interaction=require(_0x57d5('0x6'));var config=require('../../config/environment');var controller=require(_0x57d5('0x7'));router[_0x57d5('0x8')]('/',auth[_0x57d5('0x9')](),controller[_0x57d5('0xa')]);router[_0x57d5('0x8')](_0x57d5('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/whoami',auth[_0x57d5('0x9')](),controller[_0x57d5('0xc')]);router['get']('/presence',auth[_0x57d5('0x9')](),controller['getPresence']);router[_0x57d5('0x8')](_0x57d5('0xd'),auth[_0x57d5('0x9')](),controller['show']);router['get'](_0x57d5('0xe'),controller['getAvatar']);router[_0x57d5('0x8')](_0x57d5('0xf'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x10')]);router[_0x57d5('0x8')](_0x57d5('0x11'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x12')]);router['get']('/:id/queues',auth[_0x57d5('0x9')](),controller['getQueues']);router[_0x57d5('0x8')](_0x57d5('0x13'),auth['isAuthenticated'](),controller[_0x57d5('0x14')]);router['get']('/:id/groups',auth[_0x57d5('0x9')](),controller[_0x57d5('0x15')]);router['get']('/:id/recordings',auth[_0x57d5('0x9')](),controller[_0x57d5('0x16')]);router[_0x57d5('0x8')](_0x57d5('0x17'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x18')]);router['get'](_0x57d5('0x19'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x1a')]);router[_0x57d5('0x8')](_0x57d5('0x1b'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x1c')]);router['get']('/:id/mail/interactions',auth[_0x57d5('0x9')](),controller['getMailInteractions']);router[_0x57d5('0x8')](_0x57d5('0x1d'),auth['isAuthenticated'](),controller[_0x57d5('0x1e')]);router['get'](_0x57d5('0x1f'),auth['isAuthenticated'](),controller[_0x57d5('0x20')]);router[_0x57d5('0x8')](_0x57d5('0x21'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router['get'](_0x57d5('0x22'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x23')]);router[_0x57d5('0x8')](_0x57d5('0x24'),auth[_0x57d5('0x9')](),controller['getLists']);router[_0x57d5('0x8')](_0x57d5('0x25'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x26')]);router[_0x57d5('0x8')](_0x57d5('0x27'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x28')]);router['get'](_0x57d5('0x29'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x2a')]);router[_0x57d5('0x8')](_0x57d5('0x2b'),auth['isAuthenticated'](),controller[_0x57d5('0x2c')]);router[_0x57d5('0x8')]('/:id/openchannel_accounts',auth[_0x57d5('0x9')](),controller[_0x57d5('0x2d')]);router['get'](_0x57d5('0x2e'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x2f')]);router[_0x57d5('0x8')](_0x57d5('0x30'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x57d5('0x8')](_0x57d5('0x31'),auth['isAuthenticated'](),controller[_0x57d5('0x32')]);router[_0x57d5('0x8')](_0x57d5('0x33'),auth['isAuthenticated'](),controller[_0x57d5('0x34')]);router[_0x57d5('0x8')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0x57d5('0x35')]);router[_0x57d5('0x8')](_0x57d5('0x36'),auth[_0x57d5('0x9')](),controller['getApiKey']);router[_0x57d5('0x37')]('/:id/contacts',auth[_0x57d5('0x9')](),controller[_0x57d5('0x38')]);router[_0x57d5('0x37')]('/',auth[_0x57d5('0x9')](),controller['create']);router[_0x57d5('0x37')](_0x57d5('0x39'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x3a')]);router[_0x57d5('0x37')](_0x57d5('0x3b'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x3c')]);var upload=multer({'storage':multer[_0x57d5('0x3d')]({'destination':function(_0x530958,_0x373421,_0xbaebba){_0xbaebba(null,path['join'](config[_0x57d5('0x3e')],_0x57d5('0x3f')));},'filename':function(_0x201992,_0xeba720,_0x208ec3){_0x208ec3(null,util[_0x57d5('0x40')](_0x57d5('0x41'),Date[_0x57d5('0x42')](),_0xeba720[_0x57d5('0x43')]));}})});router[_0x57d5('0x37')](_0x57d5('0xe'),upload['single'](_0x57d5('0x44')),controller['addAvatar']);router[_0x57d5('0x37')](_0x57d5('0x45'),auth['isAuthenticated'](),controller[_0x57d5('0x46')]);router[_0x57d5('0x37')]('/:id/logout',auth[_0x57d5('0x9')](),controller[_0x57d5('0x47')]);router[_0x57d5('0x37')](_0x57d5('0x48'),auth[_0x57d5('0x9')](),controller['pause']);router[_0x57d5('0x37')](_0x57d5('0x49'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x4a')]);router['post'](_0x57d5('0x22'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x4b')]);router[_0x57d5('0x37')]('/:id/chat_interactions',auth[_0x57d5('0x9')](),controller['addChatInteractions']);router[_0x57d5('0x37')](_0x57d5('0x4c'),auth[_0x57d5('0x9')](),controller['addMailInteractions']);router['post'](_0x57d5('0x4d'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x4e')]);router['post'](_0x57d5('0x4f'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x50')]);router[_0x57d5('0x37')](_0x57d5('0x51'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x52')]);router[_0x57d5('0x37')](_0x57d5('0x53'),auth['isAuthenticated'](),controller[_0x57d5('0x54')]);router[_0x57d5('0x37')](_0x57d5('0x29'),auth[_0x57d5('0x9')](),controller['addFaxAccounts']);router[_0x57d5('0x37')]('/:id/mail_accounts',auth[_0x57d5('0x9')](),controller[_0x57d5('0x55')]);router[_0x57d5('0x37')](_0x57d5('0x56'),auth['isAuthenticated'](),controller[_0x57d5('0x57')]);router[_0x57d5('0x37')](_0x57d5('0x2e'),auth['isAuthenticated'](),controller[_0x57d5('0x58')]);router['post'](_0x57d5('0x30'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x59')]);router[_0x57d5('0x37')](_0x57d5('0x31'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x5a')]);router[_0x57d5('0x37')](_0x57d5('0x33'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x5b')]);router[_0x57d5('0x37')](_0x57d5('0x36'),auth['isAuthenticated'](),controller['createApiKey']);router['put']('/:id',auth[_0x57d5('0x9')](),controller[_0x57d5('0x5c')]);router[_0x57d5('0x5d')](_0x57d5('0x5e'),auth['isAuthenticated'](),controller[_0x57d5('0x5f')]);router[_0x57d5('0x60')](_0x57d5('0x3b'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x61')]);router[_0x57d5('0x60')]('/:id/teams',auth[_0x57d5('0x9')](),controller['removeTeams']);router['delete'](_0x57d5('0xd'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x62')]);router[_0x57d5('0x60')](_0x57d5('0x63'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x64')]);router['delete'](_0x57d5('0x4c'),auth[_0x57d5('0x9')](),controller['removeMailInteractions']);router[_0x57d5('0x60')](_0x57d5('0x4d'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x65')]);router['delete'](_0x57d5('0x4f'),auth[_0x57d5('0x9')](),controller['removeSmsInteractions']);router['delete'](_0x57d5('0x51'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x66')]);router[_0x57d5('0x60')](_0x57d5('0x53'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x67')]);router[_0x57d5('0x60')](_0x57d5('0x29'),auth['isAuthenticated'](),controller[_0x57d5('0x68')]);router[_0x57d5('0x60')](_0x57d5('0x2b'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x57d5('0x60')](_0x57d5('0x56'),auth[_0x57d5('0x9')](),controller['removeOpenchannelAccounts']);router[_0x57d5('0x60')](_0x57d5('0x2e'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x69')]);router[_0x57d5('0x60')](_0x57d5('0x30'),auth['isAuthenticated'](),controller[_0x57d5('0x6a')]);router['delete'](_0x57d5('0x31'),auth[_0x57d5('0x9')](),controller['removeWhatsappAccounts']);router[_0x57d5('0x60')](_0x57d5('0x33'),auth[_0x57d5('0x9')](),controller[_0x57d5('0x6b')]);router[_0x57d5('0x60')](_0x57d5('0x36'),auth['isAuthenticated'](),controller[_0x57d5('0x6c')]);module[_0x57d5('0x6d')]=router; \ No newline at end of file +var _0x871e=['./user.controller','get','isAuthenticated','index','/describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','join','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/pause','pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','/:id/sms_accounts','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id/password','changePassword','delete','/:id/queues','removeQueues','removeTeams','destroy','removeChatInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/openchannel_accounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2ee218,_0x172bb5){var _0x352554=function(_0xad54ce){while(--_0xad54ce){_0x2ee218['push'](_0x2ee218['shift']());}};_0x352554(++_0x172bb5);}(_0x871e,0x1b0));var _0xe871=function(_0xd3dc6f,_0x1473cf){_0xd3dc6f=_0xd3dc6f-0x0;var _0x5aa539=_0x871e[_0xd3dc6f];return _0x5aa539;};'use strict';var multer=require(_0xe871('0x0'));var util=require('util');var path=require(_0xe871('0x1'));var timeout=require(_0xe871('0x2'));var express=require(_0xe871('0x3'));var router=express[_0xe871('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe871('0x5'));var interaction=require(_0xe871('0x6'));var config=require(_0xe871('0x7'));var controller=require(_0xe871('0x8'));router[_0xe871('0x9')]('/',auth[_0xe871('0xa')](),controller[_0xe871('0xb')]);router[_0xe871('0x9')](_0xe871('0xc'),auth[_0xe871('0xa')](),controller['describe']);router[_0xe871('0x9')]('/whoami',auth['isAuthenticated'](),controller[_0xe871('0xd')]);router[_0xe871('0x9')](_0xe871('0xe'),auth['isAuthenticated'](),controller[_0xe871('0xf')]);router[_0xe871('0x9')](_0xe871('0x10'),auth[_0xe871('0xa')](),controller[_0xe871('0x11')]);router[_0xe871('0x9')](_0xe871('0x12'),controller['getAvatar']);router[_0xe871('0x9')](_0xe871('0x13'),auth[_0xe871('0xa')](),controller[_0xe871('0x14')]);router[_0xe871('0x9')](_0xe871('0x15'),auth[_0xe871('0xa')](),controller[_0xe871('0x16')]);router[_0xe871('0x9')]('/:id/queues',auth[_0xe871('0xa')](),controller['getQueues']);router['get'](_0xe871('0x17'),auth[_0xe871('0xa')](),controller[_0xe871('0x18')]);router[_0xe871('0x9')](_0xe871('0x19'),auth[_0xe871('0xa')](),controller[_0xe871('0x1a')]);router[_0xe871('0x9')](_0xe871('0x1b'),auth['isAuthenticated'](),controller[_0xe871('0x1c')]);router['get'](_0xe871('0x1d'),auth[_0xe871('0xa')](),controller['getScreenRecordings']);router[_0xe871('0x9')](_0xe871('0x1e'),auth[_0xe871('0xa')](),controller[_0xe871('0x1f')]);router[_0xe871('0x9')](_0xe871('0x20'),auth[_0xe871('0xa')](),controller[_0xe871('0x21')]);router[_0xe871('0x9')](_0xe871('0x22'),auth[_0xe871('0xa')](),controller[_0xe871('0x23')]);router[_0xe871('0x9')](_0xe871('0x24'),auth[_0xe871('0xa')](),controller[_0xe871('0x25')]);router[_0xe871('0x9')](_0xe871('0x26'),auth[_0xe871('0xa')](),controller[_0xe871('0x27')]);router[_0xe871('0x9')](_0xe871('0x28'),auth[_0xe871('0xa')](),controller[_0xe871('0x29')]);router[_0xe871('0x9')](_0xe871('0x2a'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xe871('0x2b'),auth[_0xe871('0xa')](),controller[_0xe871('0x2c')]);router[_0xe871('0x9')]('/:id/agents',auth[_0xe871('0xa')](),controller['getAgents']);router['get']('/:id/prefixes',auth[_0xe871('0xa')](),controller[_0xe871('0x2d')]);router[_0xe871('0x9')](_0xe871('0x2e'),auth[_0xe871('0xa')](),controller[_0xe871('0x2f')]);router[_0xe871('0x9')](_0xe871('0x30'),auth[_0xe871('0xa')](),controller[_0xe871('0x31')]);router[_0xe871('0x9')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xe871('0x9')]('/:id/sms_accounts',auth[_0xe871('0xa')](),controller['getSmsAccounts']);router['get'](_0xe871('0x32'),auth[_0xe871('0xa')](),controller[_0xe871('0x33')]);router[_0xe871('0x9')](_0xe871('0x34'),auth[_0xe871('0xa')](),controller[_0xe871('0x35')]);router[_0xe871('0x9')](_0xe871('0x36'),auth['isAuthenticated'](),controller[_0xe871('0x37')]);router[_0xe871('0x9')](_0xe871('0x38'),auth[_0xe871('0xa')](),controller[_0xe871('0x39')]);router[_0xe871('0x9')](_0xe871('0x3a'),auth['isAuthenticated'](),controller[_0xe871('0x3b')]);router[_0xe871('0x3c')](_0xe871('0x15'),auth[_0xe871('0xa')](),controller[_0xe871('0x3d')]);router[_0xe871('0x3c')]('/',auth[_0xe871('0xa')](),controller[_0xe871('0x3e')]);router[_0xe871('0x3c')]('/create_many',auth[_0xe871('0xa')](),controller['bulkCreate']);router['post']('/:id/queues',auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x304f18,_0x4dbcab,_0x2e4cbf){_0x2e4cbf(null,path[_0xe871('0x3f')](config['root'],'server/files/images/'));},'filename':function(_0x58ebe9,_0x2df7d0,_0x222397){_0x222397(null,util['format'](_0xe871('0x40'),Date[_0xe871('0x41')](),_0x2df7d0[_0xe871('0x42')]));}})});router['post'](_0xe871('0x12'),upload[_0xe871('0x43')](_0xe871('0x44')),controller[_0xe871('0x45')]);router[_0xe871('0x3c')](_0xe871('0x46'),auth['isAuthenticated'](),controller[_0xe871('0x47')]);router['post']('/:id/logout',auth[_0xe871('0xa')](),controller['logout']);router[_0xe871('0x3c')](_0xe871('0x48'),auth[_0xe871('0xa')](),controller[_0xe871('0x49')]);router[_0xe871('0x3c')]('/:id/unpause',auth[_0xe871('0xa')](),controller[_0xe871('0x4a')]);router[_0xe871('0x3c')](_0xe871('0x2a'),auth['isAuthenticated'](),controller[_0xe871('0x4b')]);router[_0xe871('0x3c')](_0xe871('0x4c'),auth[_0xe871('0xa')](),controller[_0xe871('0x4d')]);router['post'](_0xe871('0x4e'),auth[_0xe871('0xa')](),controller[_0xe871('0x4f')]);router[_0xe871('0x3c')](_0xe871('0x50'),auth[_0xe871('0xa')](),controller[_0xe871('0x51')]);router[_0xe871('0x3c')](_0xe871('0x52'),auth[_0xe871('0xa')](),controller['addSmsInteractions']);router[_0xe871('0x3c')](_0xe871('0x53'),auth[_0xe871('0xa')](),controller[_0xe871('0x54')]);router[_0xe871('0x3c')](_0xe871('0x55'),auth[_0xe871('0xa')](),controller['addWhatsappInteractions']);router['post'](_0xe871('0x2e'),auth['isAuthenticated'](),controller[_0xe871('0x56')]);router[_0xe871('0x3c')]('/:id/mail_accounts',auth[_0xe871('0xa')](),controller[_0xe871('0x57')]);router[_0xe871('0x3c')]('/:id/openchannel_accounts',auth[_0xe871('0xa')](),controller['addOpenchannelAccounts']);router[_0xe871('0x3c')](_0xe871('0x58'),auth[_0xe871('0xa')](),controller['addSmsAccounts']);router[_0xe871('0x3c')](_0xe871('0x32'),auth[_0xe871('0xa')](),controller['addChatWebsites']);router[_0xe871('0x3c')]('/:id/whatsapp_accounts',auth[_0xe871('0xa')](),controller[_0xe871('0x59')]);router[_0xe871('0x3c')](_0xe871('0x36'),auth[_0xe871('0xa')](),controller[_0xe871('0x5a')]);router[_0xe871('0x3c')](_0xe871('0x3a'),auth[_0xe871('0xa')](),controller[_0xe871('0x5b')]);router[_0xe871('0x5c')](_0xe871('0x10'),auth[_0xe871('0xa')](),controller['update']);router[_0xe871('0x5c')](_0xe871('0x5d'),auth[_0xe871('0xa')](),controller[_0xe871('0x5e')]);router[_0xe871('0x5f')](_0xe871('0x60'),auth[_0xe871('0xa')](),controller[_0xe871('0x61')]);router[_0xe871('0x5f')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe871('0x62')]);router[_0xe871('0x5f')]('/:id',auth[_0xe871('0xa')](),controller[_0xe871('0x63')]);router['delete']('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0xe871('0x64')]);router[_0xe871('0x5f')]('/:id/mail_interactions',auth['isAuthenticated'](),controller['removeMailInteractions']);router['delete']('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0xe871('0x65')]);router[_0xe871('0x5f')](_0xe871('0x52'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router[_0xe871('0x5f')](_0xe871('0x53'),auth[_0xe871('0xa')](),controller[_0xe871('0x66')]);router[_0xe871('0x5f')](_0xe871('0x55'),auth[_0xe871('0xa')](),controller[_0xe871('0x67')]);router[_0xe871('0x5f')](_0xe871('0x2e'),auth[_0xe871('0xa')](),controller['removeFaxAccounts']);router[_0xe871('0x5f')](_0xe871('0x30'),auth[_0xe871('0xa')](),controller['removeMailAccounts']);router[_0xe871('0x5f')](_0xe871('0x68'),auth[_0xe871('0xa')](),controller[_0xe871('0x69')]);router['delete'](_0xe871('0x58'),auth['isAuthenticated'](),controller[_0xe871('0x6a')]);router[_0xe871('0x5f')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xe871('0x6b')]);router[_0xe871('0x5f')](_0xe871('0x34'),auth[_0xe871('0xa')](),controller[_0xe871('0x6c')]);router[_0xe871('0x5f')](_0xe871('0x36'),auth['isAuthenticated'](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth['isAuthenticated'](),controller['removeApiKey']);module[_0xe871('0x6d')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index ab052b9..1824855 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 _0x61e1=['ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','nonat','update','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','always','accept','refuse','uac','uas','fingerprint','active','actpass','update,nonat','TEXT','showWebBar','get','wss','avpf','force_avp','icesupport','dtlssetup','dtlscertfile','encryption','dtlsenable','dtlsverify','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','lodash','name','setDataValue','The\x20name\x20of\x20the\x20user','STRING','fullname','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','user','telephone','local','INTEGER','accountcode','format','BOOLEAN','DATE','dynamic','ENUM','peer','friend','from-sip','ALLOWED_FAILED_SCREEN'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0x61e1,0x19b));var _0x161e=function(_0x3f7177,_0x3c7b79){_0x3f7177=_0x3f7177-0x0;var _0x5889ff=_0x61e1[_0x3f7177];return _0x5889ff;};'use strict';var Sequelize=require(_0x161e('0x0'));var moment=require(_0x161e('0x1'));var util=require(_0x161e('0x2'));var _=require(_0x161e('0x3'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x161e('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x133dc2){this[_0x161e('0x5')](_0x161e('0x4'),_0x133dc2);this[_0x161e('0x5')]('defaultuser',_0x133dc2);},'comment':_0x161e('0x6')},'fullname':{'type':Sequelize[_0x161e('0x7')],'allowNull':![],'set':function(_0x4ca962){this[_0x161e('0x5')](_0x161e('0x8'),_0x4ca962);this[_0x161e('0x5')]('callerid',util['format'](_0x161e('0x9'),_0x4ca962,this[_0x161e('0xa')](_0x161e('0xb'))));}},'alias':{'type':Sequelize[_0x161e('0x7')]},'email':{'type':Sequelize[_0x161e('0x7')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x5a4af9){if(_0x5a4af9){this[_0x161e('0x5')](_0x161e('0xc'),_0x5a4af9[_0x161e('0xd')]());}}},'role':{'type':Sequelize['ENUM'](_0x161e('0xe'),_0x161e('0xf'),'agent',_0x161e('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x161e('0x7')],'defaultValue':_0x161e('0x11')},'internal':{'type':Sequelize[_0x161e('0x12')](0xb),'allowNull':![],'unique':_0x161e('0xb'),'set':function(_0x47d7f0){this['setDataValue'](_0x161e('0xb'),_0x47d7f0);this[_0x161e('0x5')](_0x161e('0x13'),_0x47d7f0);this[_0x161e('0x5')]('callerid',util[_0x161e('0x14')](_0x161e('0x9'),this[_0x161e('0xa')](_0x161e('0x8')),_0x47d7f0));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x161e('0x7')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x161e('0x7')]},'zipcode':{'type':Sequelize[_0x161e('0x7')]},'userpic':{'type':Sequelize[_0x161e('0x7')]},'city':{'type':Sequelize[_0x161e('0x7')]},'country':{'type':Sequelize[_0x161e('0x7')]},'online':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x161e('0x16')]},'voicePause':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x161e('0x7')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x161e('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x161e('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x161e('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x161e('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x161e('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x161e('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x161e('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x161e('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x161e('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x161e('0x17')},'ipaddr':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'port':{'type':Sequelize[_0x161e('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x161e('0x18')]('friend',_0x161e('0xf'),_0x161e('0x19')),'allowNull':!![],'defaultValue':_0x161e('0x1a')},'context':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![],'defaultValue':_0x161e('0x1b')},'callingpres':{'type':Sequelize[_0x161e('0x18')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x161e('0x1c'),_0x161e('0x1d'),'PROHIB_NOT_SCREENED',_0x161e('0x1e'),_0x161e('0x1f'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'permit':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'secret':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'transport':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![],'defaultValue':_0x161e('0x20'),'set':function(_0x330a88){this[_0x161e('0x5')]('transport',_0x330a88?_0x330a88[_0x161e('0x21')](','):null);},'get':function(){return this['getDataValue'](_0x161e('0x22'))?this['getDataValue'](_0x161e('0x22'))['split'](','):null;},'comment':_0x161e('0x23')},'dtmfmode':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x24'),_0x161e('0x25'),_0x161e('0x26'),'inband',_0x161e('0x27')),'allowNull':!![],'defaultValue':_0x161e('0x24')},'directmedia':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no',_0x161e('0x29'),_0x161e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'nat':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![],'defaultValue':_0x161e('0x2b'),'set':function(_0x3aca07){this[_0x161e('0x5')](_0x161e('0x2c'),_0x3aca07?_0x3aca07[_0x161e('0x21')](','):null);},'get':function(){return this[_0x161e('0xa')]('nat')?this[_0x161e('0xa')](_0x161e('0x2c'))[_0x161e('0x2d')](','):null;},'comment':_0x161e('0x2e')},'callgroup':{'type':Sequelize[_0x161e('0x7')]},'namedcallgroup':{'type':Sequelize[_0x161e('0x7')]},'pickupgroup':{'type':Sequelize[_0x161e('0x7')]},'namedpickupgroup':{'type':Sequelize[_0x161e('0x7')]},'language':{'type':Sequelize[_0x161e('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x161e('0x7')]},'disallow':{'type':Sequelize[_0x161e('0x7')],'allowNull':![],'defaultValue':_0x161e('0x2f')},'allow':{'type':Sequelize[_0x161e('0x7')],'allowNull':![],'defaultValue':_0x161e('0x30'),'set':function(_0x59e4fa){this[_0x161e('0x5')](_0x161e('0x31'),_0x59e4fa?_0x59e4fa[_0x161e('0x21')](';'):_0x161e('0x30'));},'get':function(){return this[_0x161e('0xa')](_0x161e('0x31'))?this[_0x161e('0xa')]('allow')[_0x161e('0x2d')](';'):null;},'comment':_0x161e('0x32')},'autoframing':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![],'set':function(_0x45cd75){this[_0x161e('0x5')]('insecure',_0x45cd75?_0x45cd75[_0x161e('0x21')](','):null);},'get':function(){return this[_0x161e('0xa')](_0x161e('0x33'))?this['getDataValue'](_0x161e('0x33'))[_0x161e('0x2d')](','):null;},'comment':_0x161e('0x34')},'trustrpid':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x161e('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x161e('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x161e('0x28')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x161e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'template':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x161e('0x28'),'no',_0x161e('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x161e('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x36'),_0x161e('0x37'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x161e('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x161e('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x38'),_0x161e('0x39')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x161e('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x161e('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x161e('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x161e('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x161e('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x161e('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x161e('0x28'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x161e('0x18')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x161e('0x28'),'no',_0x161e('0x3a'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x161e('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x3b'),'passive',_0x161e('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x161e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x161e('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x161e('0x18')](_0x161e('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x161e('0x29'),'update',_0x161e('0x3d')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x161e('0x7')]},'resetPasswordExpires':{'type':Sequelize[_0x161e('0x16')]},'passwordResetAt':{'type':Sequelize[_0x161e('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x161e('0x3e')]},'showWebBar':{'type':Sequelize[_0x161e('0x12')],'defaultValue':0x0,'set':function(_0x436fa8){this['setDataValue'](_0x161e('0x3f'),_0x436fa8);var _0x1aaff5=this[_0x161e('0x40')]({'plain':!![]});switch(_0x436fa8){case 0x0:case 0x1:var _0x4f8cd3=_0x1aaff5[_0x161e('0x22')]?_['isArray'](_0x1aaff5[_0x161e('0x22')])?_0x1aaff5[_0x161e('0x22')][_0x161e('0x21')]():_0x1aaff5[_0x161e('0x22')]:_0x161e('0x20');if(_0x4f8cd3===_0x161e('0x41')){_0x4f8cd3=_0x161e('0x20');}this[_0x161e('0x5')](_0x161e('0x22'),_0x4f8cd3);this[_0x161e('0x5')]('encryption','no');this['setDataValue'](_0x161e('0x42'),null);this['setDataValue'](_0x161e('0x43'),null);this[_0x161e('0x5')](_0x161e('0x44'),null);this[_0x161e('0x5')]('dtlsenable',null);this[_0x161e('0x5')]('dtlsverify',null);this['setDataValue'](_0x161e('0x45'),null);this[_0x161e('0x5')](_0x161e('0x46'),null);this[_0x161e('0x5')]('dtlsprivatekey',null);this[_0x161e('0x5')]('rtcp_mux','no');break;case 0x2:this[_0x161e('0x5')](_0x161e('0x22'),_0x161e('0x41'));this[_0x161e('0x5')](_0x161e('0x47'),_0x161e('0x28'));this['setDataValue'](_0x161e('0x42'),_0x161e('0x28'));this['setDataValue'](_0x161e('0x43'),_0x161e('0x28'));this['setDataValue']('icesupport','yes');this[_0x161e('0x5')](_0x161e('0x48'),'yes');this[_0x161e('0x5')](_0x161e('0x49'),'no');this[_0x161e('0x5')](_0x161e('0x45'),_0x161e('0x3c'));this['setDataValue']('dtlscertfile',_0x1aaff5[_0x161e('0x46')]||_0x161e('0x4a'));this[_0x161e('0x5')]('dtlsprivatekey',_0x1aaff5[_0x161e('0x4b')]||_0x161e('0x4c'));this['setDataValue'](_0x161e('0x4d'),_0x161e('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x161e('0x3e')],'set':function(_0x2d87d1){this[_0x161e('0x5')](_0x161e('0x4e'),_0x2d87d1?_0x2d87d1[_0x161e('0x21')](','):[]);},'get':function(){return this['getDataValue'](_0x161e('0x4e'))?_[_0x161e('0x4f')](this[_0x161e('0xa')](_0x161e('0x4e'))[_0x161e('0x2d')](','),function(_0x313a41){return parseInt(_0x313a41,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x161e('0x7')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x161e('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x161e('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x161e('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x161e('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x161e('0x18')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x161e('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x161e('0x7')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x161e('0x50')],'get':function(){return this[_0x161e('0xa')](_0x161e('0x51'))?this[_0x161e('0xa')](_0x161e('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x161e('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x161e('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![],'set':function(_0x4b3958){if(typeof _0x4b3958==='string'){var _0xef4fcb=_0x4b3958==='1'?!![]:_0x4b3958==='0'?![]:_0x4b3958===_0x161e('0x52')?!![]:_0x4b3958===_0x161e('0x53')?![]:![];this[_0x161e('0x5')](_0x161e('0x54'),_0xef4fcb);}else{this['setDataValue'](_0x161e('0x54'),_0x4b3958);}}},'blocked':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![],'set':function(_0x5f5b88){this['setDataValue'](_0x161e('0x55'),_0x5f5b88);if(_0x5f5b88===!![]){this['setDataValue'](_0x161e('0x56'),moment());this[_0x161e('0x5')](_0x161e('0x57'),0x0);}else{this[_0x161e('0x5')](_0x161e('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0x161e('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x161e('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x161e('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x161e('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x161e('0x12')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x161e('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x161e('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x161e('0x15')],'defaultValue':!![]}}; \ No newline at end of file +var _0x89d4=['dtlscertfile','dtlsprivatekey','rtcp_mux','avpf','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','phoneBarEnableScreenRecordingByAgent','false','blocked','blockedAt','loginAttempts','sequelize','moment','util','lodash','exports','name','setDataValue','The\x20name\x20of\x20the\x20user','STRING','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','agent','telephone','INTEGER','internal','accountcode','fullname','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','never','always','accept','refuse','uac','uas','fingerprint','certificate','active','passive','update,nonat','showWebBar','get','wss','encryption','force_avp','icesupport','dtlsenable'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0x89d4,0xc1));var _0x489d=function(_0x4320ce,_0x49f5f5){_0x4320ce=_0x4320ce-0x0;var _0x537dae=_0x89d4[_0x4320ce];return _0x537dae;};'use strict';var Sequelize=require(_0x489d('0x0'));var moment=require(_0x489d('0x1'));var util=require(_0x489d('0x2'));var _=require(_0x489d('0x3'));module[_0x489d('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x489d('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x579ad2){this[_0x489d('0x6')](_0x489d('0x5'),_0x579ad2);this['setDataValue']('defaultuser',_0x579ad2);},'comment':_0x489d('0x7')},'fullname':{'type':Sequelize[_0x489d('0x8')],'allowNull':![],'set':function(_0x3501a8){this[_0x489d('0x6')]('fullname',_0x3501a8);this[_0x489d('0x6')](_0x489d('0x9'),util[_0x489d('0xa')](_0x489d('0xb'),_0x3501a8,this[_0x489d('0xc')]('internal')));}},'alias':{'type':Sequelize[_0x489d('0x8')]},'email':{'type':Sequelize[_0x489d('0x8')],'allowNull':![],'unique':_0x489d('0xd'),'validate':{'isEmail':!![]},'set':function(_0x1624ae){if(_0x1624ae){this[_0x489d('0x6')](_0x489d('0xd'),_0x1624ae['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x489d('0xe'),_0x489d('0xf'),_0x489d('0x10'),_0x489d('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x489d('0x8')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':![],'unique':_0x489d('0x13'),'set':function(_0x52526d){this['setDataValue'](_0x489d('0x13'),_0x52526d);this[_0x489d('0x6')](_0x489d('0x14'),_0x52526d);this[_0x489d('0x6')](_0x489d('0x9'),util[_0x489d('0xa')](_0x489d('0xb'),this[_0x489d('0xc')](_0x489d('0x15')),_0x52526d));}},'salt':{'type':Sequelize[_0x489d('0x8')]},'phone':{'type':Sequelize[_0x489d('0x8')]},'mobile':{'type':Sequelize[_0x489d('0x8')]},'address':{'type':Sequelize[_0x489d('0x8')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x489d('0x8')]},'city':{'type':Sequelize[_0x489d('0x8')]},'country':{'type':Sequelize[_0x489d('0x8')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x489d('0x8')],'defaultValue':_0x489d('0x17')},'lastPauseAt':{'type':Sequelize[_0x489d('0x18')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x489d('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x489d('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x489d('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x489d('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x489d('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x489d('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x489d('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x489d('0x19')},'ipaddr':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x1b'),_0x489d('0xf'),_0x489d('0x1c')),'allowNull':!![],'defaultValue':_0x489d('0x1b')},'context':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![],'defaultValue':_0x489d('0x1d')},'callingpres':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x1e'),_0x489d('0x1f'),_0x489d('0x20'),_0x489d('0x21'),'PROHIB_NOT_SCREENED',_0x489d('0x22'),_0x489d('0x23'),_0x489d('0x24')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'secret':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x489d('0x25'),'set':function(_0x3f48f3){this[_0x489d('0x6')](_0x489d('0x26'),_0x3f48f3?_0x3f48f3[_0x489d('0x27')](','):null);},'get':function(){return this[_0x489d('0xc')](_0x489d('0x26'))?this[_0x489d('0xc')](_0x489d('0x26'))[_0x489d('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x29'),_0x489d('0x2a'),'shortinfo',_0x489d('0x2b'),_0x489d('0x2c')),'allowNull':!![],'defaultValue':_0x489d('0x29')},'directmedia':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no',_0x489d('0x2e'),_0x489d('0x2f'),_0x489d('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x489d('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'nat':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![],'defaultValue':_0x489d('0x31'),'set':function(_0x1c7024){this[_0x489d('0x6')](_0x489d('0x32'),_0x1c7024?_0x1c7024[_0x489d('0x27')](','):null);},'get':function(){return this[_0x489d('0xc')](_0x489d('0x32'))?this[_0x489d('0xc')](_0x489d('0x32'))[_0x489d('0x28')](','):null;},'comment':_0x489d('0x33')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x489d('0x8')]},'pickupgroup':{'type':Sequelize[_0x489d('0x8')]},'namedpickupgroup':{'type':Sequelize[_0x489d('0x8')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x489d('0x8')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x489d('0x34')},'allow':{'type':Sequelize[_0x489d('0x8')],'allowNull':![],'defaultValue':_0x489d('0x35'),'set':function(_0x4c8257){this['setDataValue'](_0x489d('0x36'),_0x4c8257?_0x4c8257[_0x489d('0x27')](';'):_0x489d('0x35'));},'get':function(){return this['getDataValue'](_0x489d('0x36'))?this['getDataValue'](_0x489d('0x36'))[_0x489d('0x28')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![],'set':function(_0x565979){this[_0x489d('0x6')](_0x489d('0x37'),_0x565979?_0x565979['join'](','):null);},'get':function(){return this['getDataValue'](_0x489d('0x37'))?this[_0x489d('0xc')]('insecure')[_0x489d('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x489d('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x489d('0x2d'),'no',_0x489d('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x489d('0x1a')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x489d('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x489d('0x2d')},'busylevel':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x489d('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x489d('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'template':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no',_0x489d('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x489d('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x3a'),_0x489d('0x3b'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x3c'),_0x489d('0x3d')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x489d('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x489d('0x2d')},'keepalive':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x489d('0x1a')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x489d('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no',_0x489d('0x3e'),_0x489d('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x40'),_0x489d('0x41'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x489d('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x489d('0x1a')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x489d('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no',_0x489d('0x2e'),_0x489d('0x2f'),_0x489d('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x489d('0x8')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x489d('0x12')],'defaultValue':0x0,'set':function(_0x5f73df){this[_0x489d('0x6')](_0x489d('0x43'),_0x5f73df);var _0x3cef55=this[_0x489d('0x44')]({'plain':!![]});switch(_0x5f73df){case 0x0:case 0x1:var _0x3389eb=_0x3cef55['transport']?_['isArray'](_0x3cef55['transport'])?_0x3cef55['transport']['join']():_0x3cef55[_0x489d('0x26')]:_0x489d('0x25');if(_0x3389eb===_0x489d('0x45')){_0x3389eb=_0x489d('0x25');}this[_0x489d('0x6')]('transport',_0x3389eb);this[_0x489d('0x6')](_0x489d('0x46'),'no');this[_0x489d('0x6')]('avpf',null);this[_0x489d('0x6')](_0x489d('0x47'),null);this['setDataValue'](_0x489d('0x48'),null);this['setDataValue'](_0x489d('0x49'),null);this[_0x489d('0x6')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this[_0x489d('0x6')](_0x489d('0x4a'),null);this[_0x489d('0x6')](_0x489d('0x4b'),null);this[_0x489d('0x6')](_0x489d('0x4c'),'no');break;case 0x2:this[_0x489d('0x6')](_0x489d('0x26'),_0x489d('0x45'));this['setDataValue'](_0x489d('0x46'),'yes');this['setDataValue'](_0x489d('0x4d'),_0x489d('0x2d'));this['setDataValue'](_0x489d('0x47'),_0x489d('0x2d'));this[_0x489d('0x6')]('icesupport',_0x489d('0x2d'));this['setDataValue']('dtlsenable',_0x489d('0x2d'));this[_0x489d('0x6')]('dtlsverify','no');this['setDataValue']('dtlssetup',_0x489d('0x4e'));this[_0x489d('0x6')](_0x489d('0x4a'),_0x3cef55[_0x489d('0x4a')]||_0x489d('0x4f'));this['setDataValue']('dtlsprivatekey',_0x3cef55[_0x489d('0x4b')]||_0x489d('0x50'));this[_0x489d('0x6')](_0x489d('0x4c'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x489d('0x51')],'set':function(_0x5025e3){this[_0x489d('0x6')](_0x489d('0x52'),_0x5025e3?_0x5025e3['join'](','):[]);},'get':function(){return this[_0x489d('0xc')]('permissions')?_[_0x489d('0x53')](this[_0x489d('0xc')]('permissions')[_0x489d('0x28')](','),function(_0xeeddec){return parseInt(_0xeeddec,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x489d('0x8')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x489d('0x8')]},'phoneBarBusyNumber':{'type':Sequelize[_0x489d('0x8')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x489d('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x489d('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x489d('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x489d('0x8')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x489d('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x489d('0x1a')](_0x489d('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x489d('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x489d('0x8')]},'phoneBarEnableJaws':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x489d('0xc')](_0x489d('0x54'))?this[_0x489d('0xc')](_0x489d('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x489d('0x8')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x489d('0x8')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x489d('0x16')],'defaultValue':![],'set':function(_0x2065a8){if(typeof _0x2065a8==='string'){var _0x542ec5=_0x2065a8==='1'?!![]:_0x2065a8==='0'?![]:_0x2065a8==='true'?!![]:_0x2065a8===_0x489d('0x55')?![]:![];this['setDataValue']('screenrecording',_0x542ec5);}else{this['setDataValue']('screenrecording',_0x2065a8);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x1dbbdc){this['setDataValue'](_0x489d('0x56'),_0x1dbbdc);if(_0x1dbbdc===!![]){this[_0x489d('0x6')](_0x489d('0x57'),moment());this[_0x489d('0x6')](_0x489d('0x58'),0x0);}else{this[_0x489d('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x489d('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x489d('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x489d('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x489d('0x16')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index aa3d715..f2d44f3 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 _0x81ff=['userpic','download','existsSync','server/files/images/','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','CmList','List','Tag','Tags','color','tag','getQueues','Queue','get','getVoiceQueuesRt','ChatGroup','getGroups','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','phone','mobile','format','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','concat','isMiddleware','resolve','logout','MemberReport','forEach','QueuePause','pause','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','smsPause','lastPauseAt','manual','%s%s','Pause','getTeams','addTeams','omit','Team','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','setDataValue','Sms','Whatsapp','getFaxQueues','getOpenchannelQueues','flatten','transaction','addAgent','getDataValue','QueueId','removeTeams','getWhatsappQueues','Fax','Openchannel','removeAgent','getLists','values','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','isArray','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$or','$gt','$gte','$lte','$eq','$not','$in','$like','$iLike','$contains','$any','CmHopper','firstName','Contact','dialActive','VoiceQueue','getApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','removeApiKey','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','getAgents','toString','asc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','offline','idle','unknown','unavailable','ringing','busy','slice','charAt','toUpperCase','ui.','InteractionId','field','ui.createdAt','_interactions','ui.UserId\x20=\x20?','OpenTabs','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./user.socket','register','jayson/promise','http','request','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','role','admin','user','agent','telephone','filter','ignore','map','includes','find','value','name','UserProfileResource','sendStatus','stack','send','index','rawAttributes','fieldName','type','differenceBy','salt','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','sequelize','col','lower','options','includeAll','push','findAll','rows','true','length','chat','dataValues','sms','fax','mail','whatsapp','all','User','include','openchannel','body','params','describe','addContacts','ids','internal','findById','securePassword','validatePasswordPattern','password','max','isNil','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','email','permissions','102','103','110','104','105','107','108','109','100','111','114','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','Telephones','autoAssociation','bulkCreate','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','UserProfileSection','Agents','isEmpty','compact','changePassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','Sequelize','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','loginInPause','voicePause','isValidChannel','capitalize','toLowerCase','Queues','spread','emit','Queue:save','voice','online','interface','SIP/%s','penalty','each','UserVoiceQueueRt','upsert','removeQueues','Unknown\x20channel','remove','Queue:remove','addAvatar','file','getAvatar','join','root'];(function(_0x4a71b6,_0x23120f){var _0x290de9=function(_0x53eabc){while(--_0x53eabc){_0x4a71b6['push'](_0x4a71b6['shift']());}};_0x290de9(++_0x23120f);}(_0x81ff,0xcf));var _0xf81f=function(_0xfa27c3,_0x46387b){_0xfa27c3=_0xfa27c3-0x0;var _0x42d632=_0x81ff[_0xfa27c3];return _0x42d632;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf81f('0x0'));var zipdir=require(_0xf81f('0x1'));var jsonpatch=require(_0xf81f('0x2'));var rp=require(_0xf81f('0x3'));var moment=require('moment');var BPromise=require(_0xf81f('0x4'));var Mustache=require(_0xf81f('0x5'));var util=require(_0xf81f('0x6'));var path=require(_0xf81f('0x7'));var sox=require(_0xf81f('0x8'));var csv=require(_0xf81f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf81f('0xa'));var _=require(_0xf81f('0xb'));var squel=require('squel');var crypto=require(_0xf81f('0xc'));var jsforce=require(_0xf81f('0xd'));var deskjs=require(_0xf81f('0xe'));var toCsv=require(_0xf81f('0x9'));var querystring=require(_0xf81f('0xf'));var Papa=require(_0xf81f('0x10'));var Redis=require(_0xf81f('0x11'));var values;var authService=require('../../components/auth/service');var qs=require(_0xf81f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf81f('0x13'));var logger=require(_0xf81f('0x14'))(_0xf81f('0x15'));var utils=require(_0xf81f('0x16'));var config=require(_0xf81f('0x17'));var licenseUtil=require(_0xf81f('0x18'));var db=require(_0xf81f('0x19'))['db'];config[_0xf81f('0x1a')]=_['defaults'](config[_0xf81f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xf81f('0x1b'))(new Redis(config[_0xf81f('0x1a')]));require(_0xf81f('0x1c'))[_0xf81f('0x1d')](socket);var jayson=require(_0xf81f('0x1e'));var client=jayson['client'][_0xf81f('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x23d1bb,_0x5989ed,_0x436052,_0x3e0229){return new BPromise(function(_0x2f6264,_0x59ce41){var _0x5abaad=_0x3e0229||client;return _0x5abaad[_0xf81f('0x20')](_0x23d1bb,_0x436052)['then'](function(_0x54358b){logger[_0xf81f('0x21')](_0xf81f('0x22'),_0x5989ed,'request\x20sent');logger[_0xf81f('0x23')](_0xf81f('0x24'),_0x5989ed,_0xf81f('0x25'),JSON['stringify'](_0x54358b));if(_0x54358b['error']){if(_0x54358b[_0xf81f('0x26')]['code']===0x1f4){logger[_0xf81f('0x26')](_0xf81f('0x22'),_0x5989ed,_0x54358b[_0xf81f('0x26')][_0xf81f('0x27')]);return _0x59ce41(_0x54358b[_0xf81f('0x26')][_0xf81f('0x27')]);}logger[_0xf81f('0x26')]('User,\x20%s,\x20%s',_0x5989ed,_0x54358b[_0xf81f('0x26')][_0xf81f('0x27')]);return _0x2f6264(_0x54358b['error'][_0xf81f('0x27')]);}else{logger[_0xf81f('0x21')]('User,\x20%s,\x20%s',_0x5989ed,_0xf81f('0x25'));_0x2f6264(_0x54358b['result'][_0xf81f('0x27')]);}})[_0xf81f('0x28')](function(_0x89c6ae){logger[_0xf81f('0x26')]('User,\x20%s,\x20%s',_0x5989ed,_0x89c6ae);_0x59ce41(_0x89c6ae);});});}function respondWithStatusCode(_0x2b59cf,_0x477ff0){_0x477ff0=_0x477ff0||0xcc;return function(_0x575072){if(_0x575072){return _0x2b59cf['sendStatus'](_0x477ff0);}return _0x2b59cf[_0xf81f('0x29')](_0x477ff0)[_0xf81f('0x2a')]();};}function respondWithResult(_0x5d2edf,_0x501b15){_0x501b15=_0x501b15||0xc8;return function(_0x85ce74){if(_0x85ce74){return _0x5d2edf['status'](_0x501b15)[_0xf81f('0x2b')](_0x85ce74);}};}function respondWithFilteredResult(_0x48e0bd,_0x2d65eb){return function(_0x4f7acc){if(_0x4f7acc){var _0xfa3c21=typeof _0x2d65eb[_0xf81f('0x2c')]===_0xf81f('0x2d')&&typeof _0x2d65eb[_0xf81f('0x2e')]===_0xf81f('0x2d');var _0x4612f7=_0x4f7acc['count'];var _0x27ee15=_0xfa3c21?0x0:_0x2d65eb[_0xf81f('0x2c')];var _0x5232ae=_0xfa3c21?_0x4f7acc[_0xf81f('0x2f')]:_0x2d65eb['offset']+_0x2d65eb[_0xf81f('0x2e')];var _0x2cdb30;if(_0x5232ae>=_0x4612f7){_0x5232ae=_0x4612f7;_0x2cdb30=0xc8;}else{_0x2cdb30=0xce;}_0x48e0bd[_0xf81f('0x29')](_0x2cdb30);return _0x48e0bd[_0xf81f('0x30')]('Content-Range',_0x27ee15+'-'+_0x5232ae+'/'+_0x4612f7)[_0xf81f('0x2b')](_0x4f7acc);}return null;};}function patchUpdates(_0x12d485){return function(_0x57600e){try{jsonpatch[_0xf81f('0x31')](_0x57600e,_0x12d485,!![]);}catch(_0x253f95){return BPromise['reject'](_0x253f95);}return _0x57600e[_0xf81f('0x32')]();};}function saveUpdates(_0x3e58c6,_0x177520){return function(_0x1d2ddd){if(_0x1d2ddd){return _0x1d2ddd[_0xf81f('0x33')](_0x3e58c6)['then'](function(_0x1ebba1){return _0x1ebba1;});}return null;};}function removeEntity(_0x4481ac,_0x5174b4){return function(_0x14194c){if(_0x14194c){return _0x14194c[_0xf81f('0x34')]()[_0xf81f('0x35')](function(){var _0x483bb4=_0x14194c['get']({'plain':!![]});if(_0x483bb4[_0xf81f('0x36')]===_0xf81f('0x37'))return;var _0x32dd54=[{'name':'Users','value':_0xf81f('0x38'),'ignore':!![]},{'name':'Agents','value':_0xf81f('0x39'),'ignore':![]},{'name':'Telephones','value':_0xf81f('0x3a'),'ignore':![]}];var _0x3574c2=_(_0x32dd54)[_0xf81f('0x3b')](_0xf81f('0x3c'))[_0xf81f('0x3d')]('value')['value']();if(_[_0xf81f('0x3e')](_0x3574c2,_0x483bb4[_0xf81f('0x36')])){return;}var _0x4c5598=_[_0xf81f('0x3f')](_0x32dd54,[_0xf81f('0x40'),_0x483bb4[_0xf81f('0x36')]])[_0xf81f('0x41')];return db[_0xf81f('0x42')]['destroy']({'where':{'type':_0x4c5598,'resourceId':_0x483bb4['id']}})['then'](function(){return _0x14194c;});})[_0xf81f('0x35')](function(){_0x4481ac[_0xf81f('0x29')](0xcc)[_0xf81f('0x2a')]();});}};}function handleEntityNotFound(_0x5afe29,_0x3c8e21){return function(_0x3e5d4a){if(!_0x3e5d4a){_0x5afe29[_0xf81f('0x43')](0x194);}return _0x3e5d4a;};}function handleError(_0x34b85a,_0x19068b){_0x19068b=_0x19068b||0x1f4;return function(_0x4ae1c8){logger['error'](_0x4ae1c8[_0xf81f('0x44')]);if(_0x4ae1c8['name']){delete _0x4ae1c8[_0xf81f('0x41')];}_0x34b85a['status'](_0x19068b)[_0xf81f('0x45')](_0x4ae1c8);};}exports[_0xf81f('0x46')]=function(_0x2ba49f,_0x37febb){var _0x322dcd={},_0x4dcece={},_0x2efd2f={'count':0x0,'rows':[]};var _0x1c47be=_[_0xf81f('0x3d')](db['User'][_0xf81f('0x47')],function(_0x2689ba){return{'name':_0x2689ba[_0xf81f('0x48')],'type':_0x2689ba[_0xf81f('0x49')]['key']};});_0x4dcece['model']=_[_0xf81f('0x4a')](_[_0xf81f('0x3d')](_0x1c47be,_0xf81f('0x41')),['password',_0xf81f('0x4b')]);_0x4dcece[_0xf81f('0x4c')]=_[_0xf81f('0x4d')](_0x2ba49f[_0xf81f('0x4c')]);_0x4dcece['filters']=_[_0xf81f('0x4e')](_0x4dcece[_0xf81f('0x4f')],_0x4dcece[_0xf81f('0x4c')]);_0x322dcd['attributes']=_[_0xf81f('0x4e')](_0x4dcece['model'],qs[_0xf81f('0x50')](_0x2ba49f[_0xf81f('0x4c')][_0xf81f('0x50')]));_0x322dcd[_0xf81f('0x51')]=_0x322dcd[_0xf81f('0x51')]['length']?_0x322dcd[_0xf81f('0x51')]:_0x4dcece[_0xf81f('0x4f')];if(!_0x2ba49f[_0xf81f('0x4c')][_0xf81f('0x52')](_0xf81f('0x53'))){_0x322dcd[_0xf81f('0x2e')]=qs[_0xf81f('0x2e')](_0x2ba49f['query'][_0xf81f('0x2e')]);_0x322dcd[_0xf81f('0x2c')]=qs['offset'](_0x2ba49f[_0xf81f('0x4c')]['offset']);}_0x322dcd[_0xf81f('0x54')]=qs['sort'](_0x2ba49f[_0xf81f('0x4c')][_0xf81f('0x55')]);_0x322dcd[_0xf81f('0x56')]=qs[_0xf81f('0x57')](_[_0xf81f('0x58')](_0x2ba49f[_0xf81f('0x4c')],_0x4dcece['filters']),_0x1c47be);if(_0x2ba49f[_0xf81f('0x4c')]['filter']){_0x322dcd[_0xf81f('0x56')]=_[_0xf81f('0x59')](_0x322dcd['where'],{'$or':_[_0xf81f('0x3d')](_0x1c47be,function(_0x3c4bb9){if(_0x3c4bb9[_0xf81f('0x49')]!=='VIRTUAL'){return db['sequelize'][_0xf81f('0x56')](db['sequelize']['fn']('lower',db[_0xf81f('0x5a')][_0xf81f('0x5b')](_0x3c4bb9[_0xf81f('0x41')])),{'$like':db['sequelize']['fn'](_0xf81f('0x5c'),'%'+_0x2ba49f[_0xf81f('0x4c')][_0xf81f('0x3b')]+'%')});}})});}_0x322dcd=_[_0xf81f('0x59')]({},_0x322dcd,_0x2ba49f[_0xf81f('0x5d')]);var _0x10430c={'where':_0x322dcd[_0xf81f('0x56')]};return db['User'][_0xf81f('0x2f')](_0x10430c)[_0xf81f('0x35')](function(_0x30d9f7){_0x2efd2f[_0xf81f('0x2f')]=_0x30d9f7;if(_0x2ba49f[_0xf81f('0x4c')][_0xf81f('0x5e')]){_0x322dcd['include']=[{'all':!![]}];}if(!_[_0xf81f('0x3e')](_0x322dcd['attributes'],'id')){_0x322dcd[_0xf81f('0x51')][_0xf81f('0x5f')]('id');}return db['User'][_0xf81f('0x60')](_0x322dcd);})[_0xf81f('0x35')](function(_0x46f6f9){_0x2efd2f[_0xf81f('0x61')]=_0x46f6f9;if(_0x2ba49f['query']['openTabs']===_0xf81f('0x62')){var _0x4ef748=[];for(var _0x8c42f3=0x0;_0x8c42f3<_0x2efd2f[_0xf81f('0x61')][_0xf81f('0x63')];_0x8c42f3++){_0x4ef748['push'](get_open_tabs(_0xf81f('0x64'),_0x2efd2f[_0xf81f('0x61')][_0x8c42f3][_0xf81f('0x65')]));_0x4ef748[_0xf81f('0x5f')](get_open_tabs(_0xf81f('0x66'),_0x2efd2f['rows'][_0x8c42f3]['dataValues']));_0x4ef748[_0xf81f('0x5f')](get_open_tabs(_0xf81f('0x67'),_0x2efd2f[_0xf81f('0x61')][_0x8c42f3][_0xf81f('0x65')]));_0x4ef748[_0xf81f('0x5f')](get_open_tabs(_0xf81f('0x68'),_0x2efd2f[_0xf81f('0x61')][_0x8c42f3][_0xf81f('0x65')]));_0x4ef748[_0xf81f('0x5f')](get_open_tabs('openchannel',_0x2efd2f['rows'][_0x8c42f3]['dataValues']));_0x4ef748[_0xf81f('0x5f')](get_open_tabs(_0xf81f('0x69'),_0x2efd2f[_0xf81f('0x61')][_0x8c42f3][_0xf81f('0x65')]));}return BPromise[_0xf81f('0x6a')](_0x4ef748)[_0xf81f('0x35')](function(_0x42e5fc){return _0x2efd2f;});}else{return _0x2efd2f;}})[_0xf81f('0x35')](respondWithFilteredResult(_0x37febb,_0x322dcd))[_0xf81f('0x28')](handleError(_0x37febb,null));};exports['show']=function(_0x43f840,_0x574451){var _0x4986dc={'raw':![],'where':{'id':_0x43f840['params']['id']}},_0x5ea292={};_0x5ea292['model']=_[_0xf81f('0x4a')](_['keys'](db[_0xf81f('0x6b')][_0xf81f('0x47')]),['password',_0xf81f('0x4b')]);_0x5ea292[_0xf81f('0x4c')]=_[_0xf81f('0x4d')](_0x43f840[_0xf81f('0x4c')]);_0x5ea292[_0xf81f('0x57')]=_[_0xf81f('0x4e')](_0x5ea292[_0xf81f('0x4f')],_0x5ea292[_0xf81f('0x4c')]);_0x4986dc[_0xf81f('0x51')]=_[_0xf81f('0x4e')](_0x5ea292[_0xf81f('0x4f')],qs[_0xf81f('0x50')](_0x43f840[_0xf81f('0x4c')]['fields']));_0x4986dc['attributes']=_0x4986dc['attributes']['length']?_0x4986dc[_0xf81f('0x51')]:_0x5ea292[_0xf81f('0x4f')];if(_0x43f840[_0xf81f('0x4c')][_0xf81f('0x5e')]){_0x4986dc[_0xf81f('0x6c')]=[{'all':!![]}];}_0x4986dc=_[_0xf81f('0x59')]({},_0x4986dc,_0x43f840[_0xf81f('0x5d')]);if(!_[_0xf81f('0x3e')](_0x4986dc[_0xf81f('0x51')],'id')){_0x4986dc['attributes'][_0xf81f('0x5f')]('id');}return db['User'][_0xf81f('0x3f')](_0x4986dc)[_0xf81f('0x35')](handleEntityNotFound(_0x574451,null))[_0xf81f('0x35')](function(_0x57fe6f){var _0x58a129=[];values=_0x57fe6f;if(_0x43f840[_0xf81f('0x4c')]['openTabs']==='true'){_0x58a129[_0xf81f('0x5f')](get_open_tabs('chat',_0x57fe6f['dataValues']));_0x58a129[_0xf81f('0x5f')](get_open_tabs(_0xf81f('0x66'),_0x57fe6f[_0xf81f('0x65')]));_0x58a129[_0xf81f('0x5f')](get_open_tabs(_0xf81f('0x6d'),_0x57fe6f['dataValues']));_0x58a129[_0xf81f('0x5f')](get_open_tabs(_0xf81f('0x69'),_0x57fe6f[_0xf81f('0x65')]));_0x58a129[_0xf81f('0x5f')](get_open_tabs(_0xf81f('0x67'),_0x57fe6f[_0xf81f('0x65')]));_0x58a129[_0xf81f('0x5f')](get_open_tabs(_0xf81f('0x68'),_0x57fe6f[_0xf81f('0x65')]));return BPromise[_0xf81f('0x6a')](_0x58a129);}else{return values;}})['then'](function(_0x15c461){return values;})[_0xf81f('0x35')](respondWithResult(_0x574451,null))[_0xf81f('0x28')](handleError(_0x574451,null));};exports[_0xf81f('0x33')]=function(_0x2612cd,_0x380e3f){if(_0x2612cd['body']['id']){delete _0x2612cd[_0xf81f('0x6e')]['id'];}delete _0x2612cd[_0xf81f('0x6e')][_0xf81f('0x36')];return db[_0xf81f('0x6b')][_0xf81f('0x3f')]({'where':{'id':_0x2612cd[_0xf81f('0x6f')]['id']}})[_0xf81f('0x35')](handleEntityNotFound(_0x380e3f,null))[_0xf81f('0x35')](saveUpdates(_0x2612cd[_0xf81f('0x6e')],null))['then'](respondWithResult(_0x380e3f,null))[_0xf81f('0x28')](handleError(_0x380e3f,null));};exports[_0xf81f('0x70')]=function(_0x37ce3e,_0x492cc8){return db[_0xf81f('0x6b')][_0xf81f('0x70')]()[_0xf81f('0x35')](respondWithResult(_0x492cc8,null))[_0xf81f('0x28')](handleError(_0x492cc8,null));};exports[_0xf81f('0x71')]=function(_0x596e91,_0xead667,_0x3efc88){return db[_0xf81f('0x6b')][_0xf81f('0x3f')]({'where':{'id':_0x596e91[_0xf81f('0x6f')]['id']}})['then'](handleEntityNotFound(_0xead667,null))[_0xf81f('0x35')](function(_0x4284dc){if(_0x4284dc){return _0x4284dc[_0xf81f('0x71')](_0x596e91[_0xf81f('0x6e')]['ids'],_['omit'](_0x596e91[_0xf81f('0x6e')],[_0xf81f('0x72'),'id'])||{});}})[_0xf81f('0x35')](respondWithResult(_0xead667,null))['catch'](handleError(_0xead667,null));};function validateUser(_0x41a55d){return new BPromise(function(_0x25dcd1,_0x7ca784){if(_0x41a55d[_0xf81f('0x73')])return _0x25dcd1(_0x41a55d);return db['Setting'][_0xf81f('0x74')](0x1)[_0xf81f('0x35')](function(_0x85a790){if(_0x85a790[_0xf81f('0x75')])authService[_0xf81f('0x76')](_0x41a55d[_0xf81f('0x77')]);db['User'][_0xf81f('0x78')](_0xf81f('0x73'))[_0xf81f('0x35')](function(_0x921e42){if(_[_0xf81f('0x79')](_0x921e42)){_0x41a55d[_0xf81f('0x73')]=_0x85a790[_0xf81f('0x7a')]||0x1;return;}if(_[_0xf81f('0x79')](_0x85a790[_0xf81f('0x7a')])||_0x85a790[_0xf81f('0x7a')]===_0x921e42){_0x41a55d['internal']=_0x921e42+0x1;return;}if(_0x85a790[_0xf81f('0x7a')]>_0x921e42){_0x41a55d[_0xf81f('0x73')]=_0x85a790[_0xf81f('0x7a')];return;}return db[_0xf81f('0x5a')]['query'](_0xf81f('0x7b'),{'type':db['sequelize'][_0xf81f('0x7c')][_0xf81f('0x7d')]})[_0xf81f('0x35')](function(_0x259362){if(_0x259362&&_0x259362[_0xf81f('0x63')]){for(var _0x499aac=0x0,_0x5e8c15=_0x259362[_0xf81f('0x63')];_0x499aac<_0x5e8c15&&_[_0xf81f('0x79')](_0x41a55d[_0xf81f('0x73')]);_0x499aac++){if(_0x85a790[_0xf81f('0x7a')]<=_0x259362[_0x499aac][_0xf81f('0x7e')]){_0x41a55d[_0xf81f('0x73')]=_0x259362[_0x499aac][_0xf81f('0x7e')];}else if(_0x85a790['min_internal']>_0x259362[_0x499aac][_0xf81f('0x7e')]&&_0x85a790[_0xf81f('0x7a')]<=_0x259362[_0x499aac]['to']){_0x41a55d[_0xf81f('0x73')]=_0x85a790[_0xf81f('0x7a')];}}}if(_[_0xf81f('0x79')](_0x41a55d[_0xf81f('0x73')])){_0x41a55d[_0xf81f('0x73')]=_0x921e42+0x1;}return _0x25dcd1(_0x41a55d);});});})[_0xf81f('0x28')](function(_0x1ff805){_0x7ca784(_0x1ff805);});});}function updateUser(_0x2c278a){return new BPromise(function(_0x1b3750,_0x353a17){try{if(_0x2c278a[_0xf81f('0x7f')]){_0x2c278a[_0xf81f('0x80')]=_0x2c278a[_0xf81f('0x73')];_0x2c278a[_0xf81f('0x81')]={'mailbox':_0x2c278a['internal'],'password':_0x2c278a[_0xf81f('0x77')],'fullname':_0x2c278a['fullname'],'email':_0x2c278a[_0xf81f('0x82')]};}if(_0x2c278a[_0xf81f('0x36')]===_0xf81f('0x39')){if(!_0x2c278a[_0xf81f('0x83')])_0x2c278a[_0xf81f('0x83')]=['101',_0xf81f('0x84'),_0xf81f('0x85'),'113',_0xf81f('0x86'),_0xf81f('0x87'),_0xf81f('0x88'),'106',_0xf81f('0x89'),_0xf81f('0x8a'),_0xf81f('0x8b'),_0xf81f('0x8c'),_0xf81f('0x8d'),_0xf81f('0x8e'),'115'];}_0x1b3750(_0x2c278a);}catch(_0x3495cf){_0x353a17(_0x3495cf);}});}exports[_0xf81f('0x8f')]=function(_0x28759d,_0x2a29aa){if(_0x28759d[_0xf81f('0x38')][_0xf81f('0x36')]==='agent')throw new Error('Unauthorized');if(_0x28759d[_0xf81f('0x6e')][_0xf81f('0x36')]===_0xf81f('0x38')&&_0x28759d['user'][_0xf81f('0x36')]!=='admin'){throw new Error(_0xf81f('0x90'));}if(_0x28759d[_0xf81f('0x6e')][_0xf81f('0x36')]===_0xf81f('0x37')&&_0x28759d[_0xf81f('0x38')][_0xf81f('0x36')]!=='admin'){throw new Error(_0xf81f('0x91'));}return licenseUtil[_0xf81f('0x92')]([_0x28759d[_0xf81f('0x6e')]])[_0xf81f('0x35')](function(){return validateUser(_0x28759d[_0xf81f('0x6e')]);})[_0xf81f('0x35')](function(_0xa29f1a){return updateUser(_0xa29f1a)[_0xf81f('0x35')](function(_0x5ab917){if(_0x5ab917[_0xf81f('0x36')]==='admin'){_0x5ab917[_0xf81f('0x93')]=_0x28759d[_0xf81f('0x38')]['settingsEnabled'];delete _0x5ab917[_0xf81f('0x94')];}return _0x5ab917;});})[_0xf81f('0x35')](function(_0x4abb68){return db[_0xf81f('0x6b')][_0xf81f('0x8f')](_0x4abb68,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0xf81f('0x35')](function(_0x45f3b3){if(_0x28759d['body']['role']===_0xf81f('0x38'))return _0x45f3b3;if(_0x28759d[_0xf81f('0x38')][_0xf81f('0x36')]!=='user')return _0x45f3b3;return db['UserProfileSection'][_0xf81f('0x3f')]({'where':{'name':_0x45f3b3['role']===_0xf81f('0x39')?'Agents':_0xf81f('0x95'),'userProfileId':_0x28759d[_0xf81f('0x38')][_0xf81f('0x94')]},'raw':!![]})[_0xf81f('0x35')](function(_0x1e0cf3){if(!_0x1e0cf3||_0x1e0cf3[_0xf81f('0x96')]!=0x0)return _0x45f3b3;return db[_0xf81f('0x42')][_0xf81f('0x8f')]({'name':_0x45f3b3[_0xf81f('0x41')],'resourceId':_0x45f3b3['id'],'type':_0x1e0cf3[_0xf81f('0x41')],'sectionId':_0x1e0cf3['id']},{})[_0xf81f('0x35')](function(){return _0x45f3b3;});})[_0xf81f('0x28')](function(_0x3f04b5){logger[_0xf81f('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f04b5);throw _0x3f04b5;});})[_0xf81f('0x35')](respondWithResult(_0x2a29aa,0xc9))['catch'](handleError(_0x2a29aa,null));};exports[_0xf81f('0x97')]=function(_0x1c6bcb,_0x4605f3){var _0x1faf01=_0x1c6bcb[_0xf81f('0x6e')];var _0x8ba4bc=[];if(_0x1c6bcb[_0xf81f('0x38')]['role']===_0xf81f('0x39'))throw new Error(_0xf81f('0x98'));if(_[_0xf81f('0x99')](_0x1faf01,['role',_0xf81f('0x38')])&&_0x1c6bcb[_0xf81f('0x38')][_0xf81f('0x36')]!==_0xf81f('0x37')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xf81f('0x99')](_0x1faf01,[_0xf81f('0x36'),_0xf81f('0x37')])&&_0x1c6bcb[_0xf81f('0x38')]['role']!==_0xf81f('0x37')){throw new Error(_0xf81f('0x9a'));}return licenseUtil[_0xf81f('0x92')](_0x1faf01)[_0xf81f('0x35')](function(){return validateUser(_0x1faf01[0x0]);})[_0xf81f('0x35')](function(){for(var _0x30a1dc=0x1;_0x30a1dc<_0x1faf01['length'];_0x30a1dc++){var _0x2cb314=_0x1faf01[_0x30a1dc-0x1][_0xf81f('0x73')];if(!_0x1faf01[_0x30a1dc][_0xf81f('0x73')])_0x1faf01[_0x30a1dc][_0xf81f('0x73')]=_0x2cb314+0x1;_0x8ba4bc[_0xf81f('0x5f')](validateUser(_0x1faf01[_0x30a1dc]));}return BPromise[_0xf81f('0x6a')](_0x8ba4bc);})[_0xf81f('0x35')](function(){_0x8ba4bc=[];for(var _0x10599a=0x0;_0x10599a<_0x1faf01[_0xf81f('0x63')];_0x10599a++){_0x8ba4bc[_0xf81f('0x5f')](updateUser(_0x1faf01[_0x10599a]));}return BPromise[_0xf81f('0x6a')](_0x8ba4bc);})[_0xf81f('0x35')](function(){return BPromise['each'](_0x1faf01,function(_0x166909){return db[_0xf81f('0x6b')][_0xf81f('0x8f')](_0x166909,{'include':[{'model':db[_0xf81f('0x81')],'as':'VoiceMail'}]})['then'](function(_0x25faba){_0x166909['id']=_0x25faba['id'];return _0x166909;});});})[_0xf81f('0x35')](function(_0x5029dd){if(_0x1c6bcb[_0xf81f('0x6e')][_0xf81f('0x36')]===_0xf81f('0x38'))return _0x5029dd;if(_0x1c6bcb[_0xf81f('0x38')][_0xf81f('0x36')]!=='user')return _0x5029dd;var _0x1f8189=_[_0xf81f('0x99')](_0x5029dd,function(_0x31c5db){return _0x31c5db[_0xf81f('0x36')]===_0xf81f('0x39')||_0x31c5db[_0xf81f('0x36')]===_0xf81f('0x3a');});if(!_0x1f8189)return _0x5029dd;return db[_0xf81f('0x9b')][_0xf81f('0x60')]({'where':{'name':{'$or':[_0xf81f('0x9c'),_0xf81f('0x95')]},'userProfileId':_0x1c6bcb[_0xf81f('0x38')]['userProfileId']},'raw':!![]})[_0xf81f('0x35')](function(_0x4563c6){if(_[_0xf81f('0x9d')](_0x4563c6)||!_[_0xf81f('0x99')](_0x4563c6,[_0xf81f('0x96'),0x0]))return _0x5029dd;_0x8ba4bc=[];var _0x407b27=_(_0x4563c6)[_0xf81f('0x3d')](function(_0x349da7){if(_0x349da7[_0xf81f('0x96')]===0x1)return;return _0x349da7[_0xf81f('0x41')]===_0xf81f('0x9c')?_0xf81f('0x39'):_0xf81f('0x3a');})[_0xf81f('0x9e')]()[_0xf81f('0x40')]();for(var _0x42ebac=0x0;_0x42ebac<_0x5029dd['length'];_0x42ebac++){if(!_[_0xf81f('0x3e')](_0x407b27,_0x5029dd[_0x42ebac][_0xf81f('0x36')]))return;var _0x52f2c7=_0x5029dd[_0x42ebac][_0xf81f('0x36')]==='agent'?_0xf81f('0x9c'):'Telephones';_0x8ba4bc[_0xf81f('0x5f')](db['UserProfileResource'][_0xf81f('0x8f')]({'name':_0x5029dd[_0x42ebac]['name'],'resourceId':_0x5029dd[_0x42ebac]['id'],'type':_0x52f2c7,'sectionId':_[_0xf81f('0x3f')](_0x4563c6,['name',_0x52f2c7])['id']},{}));}return BPromise['all'](_0x8ba4bc);});})[_0xf81f('0x35')](respondWithResult(_0x4605f3,0xc9))[_0xf81f('0x28')](handleError(_0x4605f3,null));};exports[_0xf81f('0x9f')]=function(_0x3d94d9,_0xc4137f,_0x51a031){if(_0x3d94d9['body']['id']){delete _0x3d94d9['body']['id'];}return db[_0xf81f('0x6b')]['find']({'where':{'id':_0x3d94d9[_0xf81f('0x6f')]['id']}})[_0xf81f('0x35')](function(_0x147e74){if(!_0x147e74)return null;if(_0x147e74['id']===_0x3d94d9[_0xf81f('0x38')]['id']){if(!_0x3d94d9['body']['oldPassword']||!_0x3d94d9['body'][_0xf81f('0xa0')]){throw new db['Sequelize'][(_0xf81f('0xa1'))](_0xf81f('0xa2'));}if(!_0x147e74[_0xf81f('0xa3')](_0x3d94d9['body'][_0xf81f('0xa4')])){throw new db[(_0xf81f('0xa5'))][(_0xf81f('0xa1'))]('Wrong\x20credentials');}if(_0x3d94d9['body'][_0xf81f('0xa4')]===_0x3d94d9['body'][_0xf81f('0xa0')]){throw new db[(_0xf81f('0xa5'))]['ValidationError'](_0xf81f('0xa6'));}}else if(_0x3d94d9[_0xf81f('0x38')][_0xf81f('0x36')]==='admin'){if(!_0x3d94d9[_0xf81f('0x6e')][_0xf81f('0xa0')]){throw new db[(_0xf81f('0xa5'))]['ValidationError'](_0xf81f('0xa7'));}}else if(_0x3d94d9[_0xf81f('0x38')][_0xf81f('0x36')]===_0xf81f('0x38')){if(!_0x3d94d9[_0xf81f('0x6e')][_0xf81f('0xa0')]){throw new db['Sequelize'][(_0xf81f('0xa1'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x147e74[_0xf81f('0x36')]!=='agent'){throw new db[(_0xf81f('0xa5'))][(_0xf81f('0xa1'))]('Unauthorized');}}else{throw new db[(_0xf81f('0xa5'))]['ValidationError']('Unauthorized');}return _0x147e74;})[_0xf81f('0x35')](handleEntityNotFound(_0xc4137f,null))['then'](function(_0x47cd6a){return db[_0xf81f('0xa8')][_0xf81f('0xa9')]({'attributes':['id',_0xf81f('0x75'),'enforcePasswordHistory',_0xf81f('0xaa')]})['then'](function(_0x70b7e1){if(_0x70b7e1[_0xf81f('0x75')])authService[_0xf81f('0x76')](_0x3d94d9[_0xf81f('0x6e')][_0xf81f('0xa0')]);if(!_0x70b7e1[_0xf81f('0xab')]||!_0x47cd6a[_0xf81f('0xac')])return _0x47cd6a;authService[_0xf81f('0xad')](_0x3d94d9[_0xf81f('0x6e')]['newPassword'],_0x47cd6a[_0xf81f('0xac')],_0x70b7e1['passwordHistoryLimit']);return _0x47cd6a;})['then'](saveUpdates({'password':_0x3d94d9[_0xf81f('0x6e')][_0xf81f('0xa0')],'passwordResetAt':_0x3d94d9[_0xf81f('0x38')]['id']==_0x3d94d9[_0xf81f('0x6f')]['id']?moment():null,'previousPasswords':authService[_0xf81f('0xae')](_0x3d94d9[_0xf81f('0x6e')]['newPassword'],_0x47cd6a[_0xf81f('0xac')])},null));})[_0xf81f('0x35')](respondWithResult(_0xc4137f,null))[_0xf81f('0x28')](handleError(_0xc4137f,null));};exports[_0xf81f('0xaf')]=function(_0x39b441,_0x48dc0b,_0x3567ec){var _0x15b1dd=_0x39b441['body'][_0xf81f('0xb0')];return db['User'][_0xf81f('0x3f')]({'where':{'id':_0x39b441[_0xf81f('0x6f')]['id']},'attributes':['id',_0xf81f('0x41'),_0xf81f('0x36'),'online',_0xf81f('0xb1'),_0xf81f('0xb2'),'interface']})[_0xf81f('0x35')](handleEntityNotFound(_0x48dc0b,null))[_0xf81f('0x35')](function(_0x1d6c2f){if(_0x1d6c2f){if(!utils[_0xf81f('0xb3')](_0x15b1dd)){throw new db['Sequelize'][(_0xf81f('0xa1'))]('Unknown\x20channel');}return _0x1d6c2f['add'+_[_0xf81f('0xb4')](_0x15b1dd[_0xf81f('0xb5')]())+_0xf81f('0xb6')](_0x39b441[_0xf81f('0x6e')]['ids'],{'penalty':_0x39b441['body']['penalty']||0x0})[_0xf81f('0xb7')](function(_0x4605ac){for(var _0xb1f7b2=0x0;_0xb1f7b2<_0x39b441['body']['ids'][_0xf81f('0x63')];_0xb1f7b2+=0x1){var _0x535943={'UserId':_0x39b441[_0xf81f('0x6f')]['id']};_0x535943[_['capitalize'](_0x15b1dd[_0xf81f('0xb5')]())+'QueueId']=_0x39b441[_0xf81f('0x6e')][_0xf81f('0x72')][_0xb1f7b2];socket[_0xf81f('0xb8')]('user'+_[_0xf81f('0xb4')](_0x15b1dd[_0xf81f('0xb5')]())+_0xf81f('0xb9'),_0x535943);}return _0x4605ac;})[_0xf81f('0x35')](function(){if(_0x15b1dd===_0xf81f('0xba')){return db['VoiceQueue'][_0xf81f('0x60')]({'where':{'id':_0x39b441[_0xf81f('0x6e')][_0xf81f('0x72')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xf81f('0x35')](function(_0x3bdd8a){var _0x26546d=_0x1d6c2f['get']({'plain':!![]});var _0x1276e4=[];if(_0x15b1dd==='voice'&&_0x26546d[_0xf81f('0x36')]===_0xf81f('0x39')&&_0x26546d[_0xf81f('0xbb')]){for(var _0x45403b=0x0;_0x45403b<_0x3bdd8a[_0xf81f('0x63')];_0x45403b+=0x1){_0x1276e4['push']({'membername':_0x26546d[_0xf81f('0x41')],'UserId':_0x26546d['id'],'queue_name':_0x3bdd8a[_0x45403b][_0xf81f('0x41')],'VoiceQueueId':_0x3bdd8a[_0x45403b]['id'],'interface':_[_0xf81f('0x79')](_0x26546d[_0xf81f('0xbc')])?util['format'](_0xf81f('0xbd'),_0x26546d[_0xf81f('0x41')]):_0x26546d[_0xf81f('0xbc')],'paused':_0x26546d['voicePause']||![],'penalty':_0x39b441[_0xf81f('0x6e')][_0xf81f('0xbe')]||0x0});}return BPromise[_0xf81f('0xbf')](_0x1276e4,function(_0x417006){return db[_0xf81f('0xc0')][_0xf81f('0xc1')](_0x417006);});}return _0x1d6c2f;});}})[_0xf81f('0x35')](respondWithStatusCode(_0x48dc0b,null))[_0xf81f('0x28')](handleError(_0x48dc0b,null));};exports[_0xf81f('0xc2')]=function(_0xc2fa71,_0x7e4659,_0x44dc5e){var _0x904503;return db['User'][_0xf81f('0x3f')]({'where':{'id':_0xc2fa71[_0xf81f('0x6f')]['id']},'attributes':['id',_0xf81f('0x41'),_0xf81f('0x36')]})[_0xf81f('0x35')](handleEntityNotFound(_0x7e4659,null))[_0xf81f('0x35')](function(_0x324213){if(_0x324213){_0x904503=_0x324213;if(!_0xc2fa71['query'][_0xf81f('0xb0')]||!utils[_0xf81f('0xb3')](_0xc2fa71['query']['channel'])){throw new db[(_0xf81f('0xa5'))][(_0xf81f('0xa1'))](_0xf81f('0xc3'));}return _0x324213[_0xf81f('0xc4')+_[_0xf81f('0xb4')](_0xc2fa71['query'][_0xf81f('0xb0')][_0xf81f('0xb5')]())+_0xf81f('0xb6')](_0xc2fa71[_0xf81f('0x4c')][_0xf81f('0x72')]);}})[_0xf81f('0x35')](function(_0x14895a){for(var _0x144b23=0x0;_0x144b23<_0xc2fa71[_0xf81f('0x4c')][_0xf81f('0x72')]['length'];_0x144b23+=0x1){var _0x32e0c0={'UserId':_0xc2fa71[_0xf81f('0x6f')]['id']};_0x32e0c0[_[_0xf81f('0xb4')](_0xc2fa71[_0xf81f('0x4c')][_0xf81f('0xb0')][_0xf81f('0xb5')]())+'QueueId']=_0xc2fa71[_0xf81f('0x4c')][_0xf81f('0x72')][_0x144b23];socket[_0xf81f('0xb8')](_0xf81f('0x38')+_[_0xf81f('0xb4')](_0xc2fa71[_0xf81f('0x4c')][_0xf81f('0xb0')]['toLowerCase']())+_0xf81f('0xc5'),_0x32e0c0);}return _0x14895a;})['then'](function(){if(_0xc2fa71[_0xf81f('0x4c')]['channel']===_0xf81f('0xba')){return db[_0xf81f('0xc0')][_0xf81f('0x34')]({'where':{'UserId':_0xc2fa71[_0xf81f('0x6f')]['id'],'VoiceQueueId':_0xc2fa71[_0xf81f('0x4c')][_0xf81f('0x72')]},'individualHooks':!![]})[_0xf81f('0x35')](function(){return _0x904503;});}return _0x904503;})[_0xf81f('0x35')](respondWithStatusCode(_0x7e4659,null))[_0xf81f('0x28')](handleError(_0x7e4659,null));};exports[_0xf81f('0xc6')]=function(_0x13ca89,_0x5c761c,_0x5f2fae){_0x13ca89[_0xf81f('0x6e')]['userpic']=_0x13ca89[_0xf81f('0xc7')]['filename'];return db['User'][_0xf81f('0x3f')]({'where':{'id':_0x13ca89[_0xf81f('0x6f')]['id']}})['then'](handleEntityNotFound(_0x5c761c,null))['then'](saveUpdates(_0x13ca89[_0xf81f('0x6e')],null))[_0xf81f('0x35')](respondWithResult(_0x5c761c,null))[_0xf81f('0x28')](handleError(_0x5c761c,null));};exports[_0xf81f('0xc8')]=function(_0x240202,_0x292f79,_0x5f407e){var _0x523a0a=path[_0xf81f('0xc9')](config[_0xf81f('0xca')],'server/files/images/logos/default_profile.png');return db[_0xf81f('0x6b')][_0xf81f('0x3f')]({'where':{'id':_0x240202[_0xf81f('0x6f')]['id']},'attributes':['id',_0xf81f('0xcb')],'raw':!![]})[_0xf81f('0x35')](handleEntityNotFound(_0x292f79,null))[_0xf81f('0x35')](function(_0xfbdf4b){if(_0xfbdf4b){if(_[_0xf81f('0x79')](_0xfbdf4b[_0xf81f('0xcb')])){return _0x292f79[_0xf81f('0xcc')](_0x523a0a);}else{if(!fs[_0xf81f('0xcd')](path[_0xf81f('0xc9')](config['root'],_0xf81f('0xce'),_0xfbdf4b['userpic']))){return _0x292f79[_0xf81f('0xcc')](_0x523a0a);}return _0x292f79[_0xf81f('0xcc')](path['join'](config['root'],_0xf81f('0xce'),_0xfbdf4b[_0xf81f('0xcb')]));}}})[_0xf81f('0x28')](handleError(_0x292f79,null));};exports['getOpenTabs']=function(_0x3b06af,_0x4de326,_0x1a118c){return db[_0xf81f('0x6b')][_0xf81f('0x3f')]({'where':{'id':_0x3b06af['params']['id']},'attributes':['id']})[_0xf81f('0x35')](handleEntityNotFound(_0x4de326,null))[_0xf81f('0x35')](function(_0x3b75be){var _0x6b2e25=[];values=_0x3b75be[_0xf81f('0x65')];_0x6b2e25[_0xf81f('0x5f')](get_open_tabs(_0xf81f('0x64'),_0x3b75be[_0xf81f('0x65')]));_0x6b2e25['push'](get_open_tabs('sms',_0x3b75be[_0xf81f('0x65')]));_0x6b2e25[_0xf81f('0x5f')](get_open_tabs(_0xf81f('0x6d'),_0x3b75be[_0xf81f('0x65')]));_0x6b2e25[_0xf81f('0x5f')](get_open_tabs(_0xf81f('0x69'),_0x3b75be[_0xf81f('0x65')]));_0x6b2e25[_0xf81f('0x5f')](get_open_tabs('fax',_0x3b75be[_0xf81f('0x65')]));_0x6b2e25[_0xf81f('0x5f')](get_open_tabs(_0xf81f('0x68'),_0x3b75be[_0xf81f('0x65')]));return BPromise[_0xf81f('0x6a')](_0x6b2e25);})[_0xf81f('0x35')](function(_0x574900){var _0x41b44b=[];if(_0x574900){for(var _0x412d93=0x0;_0x412d93=_0x48873d){_0x3ab70b=_0x48873d;_0x164231=0xc8;}else{_0x164231=0xce;}_0x483ee3[_0x20b7('0x32')](_0x164231);return _0x483ee3[_0x20b7('0x33')]('Content-Range',_0x403375+'-'+_0x3ab70b+'/'+_0x48873d)[_0x20b7('0x2e')](_0x5a4c85);}return null;};}function patchUpdates(_0x3c1aa4){return function(_0x1806e3){try{jsonpatch[_0x20b7('0x34')](_0x1806e3,_0x3c1aa4,!![]);}catch(_0x312817){return BPromise[_0x20b7('0x35')](_0x312817);}return _0x1806e3['save']();};}function saveUpdates(_0x49ab41,_0x231feb){return function(_0x22c08e){if(_0x22c08e){return _0x22c08e[_0x20b7('0x36')](_0x49ab41)[_0x20b7('0x21')](function(_0x173ff7){return _0x173ff7;});}return null;};}function removeEntity(_0x208098,_0x1eb260){return function(_0x522a6c){if(_0x522a6c){return _0x522a6c[_0x20b7('0x37')]()[_0x20b7('0x21')](function(){var _0x36468c=_0x522a6c[_0x20b7('0x38')]({'plain':!![]});if(_0x36468c[_0x20b7('0x39')]===_0x20b7('0x3a'))return;var _0x55304b=[{'name':_0x20b7('0x3b'),'value':_0x20b7('0x3c'),'ignore':!![]},{'name':_0x20b7('0x3d'),'value':_0x20b7('0x3e'),'ignore':![]},{'name':_0x20b7('0x3f'),'value':'telephone','ignore':![]}];var _0x34a7b8=_(_0x55304b)[_0x20b7('0x40')](_0x20b7('0x41'))[_0x20b7('0x42')](_0x20b7('0x43'))[_0x20b7('0x43')]();if(_[_0x20b7('0x44')](_0x34a7b8,_0x36468c[_0x20b7('0x39')])){return;}var _0x1ab79a=_[_0x20b7('0x45')](_0x55304b,[_0x20b7('0x43'),_0x36468c['role']])[_0x20b7('0x46')];return db[_0x20b7('0x47')][_0x20b7('0x37')]({'where':{'type':_0x1ab79a,'resourceId':_0x36468c['id']}})[_0x20b7('0x21')](function(){return _0x522a6c;});})['then'](function(){_0x208098[_0x20b7('0x32')](0xcc)[_0x20b7('0x2d')]();});}};}function handleEntityNotFound(_0x17fde0,_0x168aea){return function(_0x3df70b){if(!_0x3df70b){_0x17fde0[_0x20b7('0x2c')](0x194);}return _0x3df70b;};}function handleError(_0x56a366,_0x4f0ce2){_0x4f0ce2=_0x4f0ce2||0x1f4;return function(_0x281b2){logger[_0x20b7('0x28')](_0x281b2[_0x20b7('0x48')]);if(_0x281b2[_0x20b7('0x46')]){delete _0x281b2['name'];}_0x56a366[_0x20b7('0x32')](_0x4f0ce2)['send'](_0x281b2);};}exports['index']=function(_0x45d700,_0x5ae127){var _0x1e8176={},_0x89ab60={},_0x5f899d={'count':0x0,'rows':[]};var _0x2a48b4=_['map'](db[_0x20b7('0x49')]['rawAttributes'],function(_0x10833e){return{'name':_0x10833e[_0x20b7('0x4a')],'type':_0x10833e[_0x20b7('0x4b')][_0x20b7('0x4c')]};});_0x89ab60[_0x20b7('0x4d')]=_[_0x20b7('0x4e')](_[_0x20b7('0x42')](_0x2a48b4,_0x20b7('0x46')),[_0x20b7('0x4f'),_0x20b7('0x50')]);_0x89ab60[_0x20b7('0x51')]=_[_0x20b7('0x52')](_0x45d700[_0x20b7('0x51')]);_0x89ab60[_0x20b7('0x53')]=_[_0x20b7('0x54')](_0x89ab60[_0x20b7('0x4d')],_0x89ab60['query']);_0x1e8176['attributes']=_[_0x20b7('0x54')](_0x89ab60['model'],qs[_0x20b7('0x55')](_0x45d700['query'][_0x20b7('0x55')]));_0x1e8176[_0x20b7('0x56')]=_0x1e8176[_0x20b7('0x56')]['length']?_0x1e8176[_0x20b7('0x56')]:_0x89ab60[_0x20b7('0x4d')];if(!_0x45d700[_0x20b7('0x51')][_0x20b7('0x57')]('nolimit')){_0x1e8176[_0x20b7('0x2f')]=qs[_0x20b7('0x2f')](_0x45d700[_0x20b7('0x51')][_0x20b7('0x2f')]);_0x1e8176[_0x20b7('0x31')]=qs['offset'](_0x45d700['query'][_0x20b7('0x31')]);}_0x1e8176['order']=qs['sort'](_0x45d700[_0x20b7('0x51')][_0x20b7('0x58')]);_0x1e8176['where']=qs[_0x20b7('0x53')](_['pick'](_0x45d700[_0x20b7('0x51')],_0x89ab60[_0x20b7('0x53')]),_0x2a48b4);if(_0x45d700[_0x20b7('0x51')][_0x20b7('0x40')]){_0x1e8176[_0x20b7('0x59')]=_[_0x20b7('0x5a')](_0x1e8176[_0x20b7('0x59')],{'$or':_[_0x20b7('0x42')](_0x2a48b4,function(_0x3c88e6){if(_0x3c88e6[_0x20b7('0x4b')]!=='VIRTUAL'){return db['sequelize'][_0x20b7('0x59')](db['sequelize']['fn'](_0x20b7('0x5b'),db[_0x20b7('0x5c')][_0x20b7('0x5d')](_0x3c88e6[_0x20b7('0x46')])),{'$like':db[_0x20b7('0x5c')]['fn']('lower','%'+_0x45d700[_0x20b7('0x51')][_0x20b7('0x40')]+'%')});}})});}_0x1e8176=_['merge']({},_0x1e8176,_0x45d700[_0x20b7('0x5e')]);var _0x49d1d5={'where':_0x1e8176[_0x20b7('0x59')]};return db[_0x20b7('0x49')][_0x20b7('0x5f')](_0x49d1d5)[_0x20b7('0x21')](function(_0xc20da){_0x5f899d[_0x20b7('0x5f')]=_0xc20da;if(_0x45d700['query']['includeAll']){_0x1e8176['include']=[{'all':!![]}];}if(!_[_0x20b7('0x44')](_0x1e8176['attributes'],'id')){_0x1e8176[_0x20b7('0x56')][_0x20b7('0x60')]('id');}return db[_0x20b7('0x49')][_0x20b7('0x61')](_0x1e8176);})[_0x20b7('0x21')](function(_0x409e93){_0x5f899d[_0x20b7('0x62')]=_0x409e93;if(_0x45d700[_0x20b7('0x51')][_0x20b7('0x63')]==='true'){var _0x5e84b1=[];for(var _0x29b998=0x0;_0x29b998<_0x5f899d[_0x20b7('0x62')]['length'];_0x29b998++){_0x5e84b1[_0x20b7('0x60')](get_open_tabs(_0x20b7('0x64'),_0x5f899d['rows'][_0x29b998][_0x20b7('0x65')]));_0x5e84b1[_0x20b7('0x60')](get_open_tabs(_0x20b7('0x66'),_0x5f899d[_0x20b7('0x62')][_0x29b998][_0x20b7('0x65')]));_0x5e84b1[_0x20b7('0x60')](get_open_tabs('fax',_0x5f899d[_0x20b7('0x62')][_0x29b998]['dataValues']));_0x5e84b1[_0x20b7('0x60')](get_open_tabs(_0x20b7('0x67'),_0x5f899d[_0x20b7('0x62')][_0x29b998][_0x20b7('0x65')]));_0x5e84b1['push'](get_open_tabs(_0x20b7('0x68'),_0x5f899d[_0x20b7('0x62')][_0x29b998][_0x20b7('0x65')]));_0x5e84b1['push'](get_open_tabs(_0x20b7('0x69'),_0x5f899d[_0x20b7('0x62')][_0x29b998]['dataValues']));}return BPromise[_0x20b7('0x6a')](_0x5e84b1)['then'](function(_0x42eb6f){return _0x5f899d;});}else{return _0x5f899d;}})[_0x20b7('0x21')](respondWithFilteredResult(_0x5ae127,_0x1e8176))['catch'](handleError(_0x5ae127,null));};exports[_0x20b7('0x6b')]=function(_0x566060,_0x212a66){var _0x30d2a7={'raw':![],'where':{'id':_0x566060[_0x20b7('0x6c')]['id']}},_0x4947a0={};_0x4947a0[_0x20b7('0x4d')]=_['differenceBy'](_[_0x20b7('0x52')](db[_0x20b7('0x49')][_0x20b7('0x6d')]),[_0x20b7('0x4f'),_0x20b7('0x50')]);_0x4947a0['query']=_[_0x20b7('0x52')](_0x566060['query']);_0x4947a0[_0x20b7('0x53')]=_[_0x20b7('0x54')](_0x4947a0[_0x20b7('0x4d')],_0x4947a0[_0x20b7('0x51')]);_0x30d2a7['attributes']=_[_0x20b7('0x54')](_0x4947a0['model'],qs['fields'](_0x566060[_0x20b7('0x51')]['fields']));_0x30d2a7[_0x20b7('0x56')]=_0x30d2a7[_0x20b7('0x56')][_0x20b7('0x6e')]?_0x30d2a7['attributes']:_0x4947a0[_0x20b7('0x4d')];if(_0x566060[_0x20b7('0x51')]['includeAll']){_0x30d2a7['include']=[{'all':!![]}];}_0x30d2a7=_[_0x20b7('0x5a')]({},_0x30d2a7,_0x566060[_0x20b7('0x5e')]);if(!_[_0x20b7('0x44')](_0x30d2a7[_0x20b7('0x56')],'id')){_0x30d2a7['attributes'][_0x20b7('0x60')]('id');}return db['User'][_0x20b7('0x45')](_0x30d2a7)['then'](handleEntityNotFound(_0x212a66,null))[_0x20b7('0x21')](function(_0x42c9d4){var _0x2c69d5=[];values=_0x42c9d4;if(_0x566060[_0x20b7('0x51')][_0x20b7('0x63')]===_0x20b7('0x6f')){_0x2c69d5['push'](get_open_tabs('chat',_0x42c9d4[_0x20b7('0x65')]));_0x2c69d5['push'](get_open_tabs(_0x20b7('0x66'),_0x42c9d4['dataValues']));_0x2c69d5[_0x20b7('0x60')](get_open_tabs(_0x20b7('0x68'),_0x42c9d4['dataValues']));_0x2c69d5[_0x20b7('0x60')](get_open_tabs(_0x20b7('0x69'),_0x42c9d4[_0x20b7('0x65')]));_0x2c69d5['push'](get_open_tabs(_0x20b7('0x70'),_0x42c9d4[_0x20b7('0x65')]));_0x2c69d5[_0x20b7('0x60')](get_open_tabs(_0x20b7('0x67'),_0x42c9d4[_0x20b7('0x65')]));return BPromise[_0x20b7('0x6a')](_0x2c69d5);}else{return values;}})[_0x20b7('0x21')](function(_0x2ef4e4){return values;})[_0x20b7('0x21')](respondWithResult(_0x212a66,null))[_0x20b7('0x2b')](handleError(_0x212a66,null));};exports[_0x20b7('0x36')]=function(_0x37c6ad,_0x513d52){if(_0x37c6ad[_0x20b7('0x71')]['id']){delete _0x37c6ad[_0x20b7('0x71')]['id'];}delete _0x37c6ad[_0x20b7('0x71')][_0x20b7('0x39')];return db[_0x20b7('0x49')][_0x20b7('0x45')]({'where':{'id':_0x37c6ad[_0x20b7('0x6c')]['id']}})[_0x20b7('0x21')](handleEntityNotFound(_0x513d52,null))[_0x20b7('0x21')](saveUpdates(_0x37c6ad[_0x20b7('0x71')],null))['then'](respondWithResult(_0x513d52,null))['catch'](handleError(_0x513d52,null));};exports['describe']=function(_0x4c13ff,_0x450d0e){return db[_0x20b7('0x49')]['describe']()[_0x20b7('0x21')](respondWithResult(_0x450d0e,null))[_0x20b7('0x2b')](handleError(_0x450d0e,null));};exports[_0x20b7('0x72')]=function(_0x1bedda,_0x2aff2d,_0x575b23){return db[_0x20b7('0x49')]['find']({'where':{'id':_0x1bedda[_0x20b7('0x6c')]['id']}})[_0x20b7('0x21')](handleEntityNotFound(_0x2aff2d,null))[_0x20b7('0x21')](function(_0x23bb6a){if(_0x23bb6a){return _0x23bb6a[_0x20b7('0x72')](_0x1bedda[_0x20b7('0x71')][_0x20b7('0x73')],_[_0x20b7('0x74')](_0x1bedda[_0x20b7('0x71')],['ids','id'])||{});}})[_0x20b7('0x21')](respondWithResult(_0x2aff2d,null))[_0x20b7('0x2b')](handleError(_0x2aff2d,null));};function validateUser(_0x3a24d3){return new BPromise(function(_0x26d5c6,_0x2d4554){if(_0x3a24d3['internal'])return _0x26d5c6(_0x3a24d3);return db[_0x20b7('0x75')]['findById'](0x1)[_0x20b7('0x21')](function(_0x1a61b9){if(_0x1a61b9[_0x20b7('0x76')])authService[_0x20b7('0x77')](_0x3a24d3[_0x20b7('0x4f')]);db[_0x20b7('0x49')][_0x20b7('0x78')](_0x20b7('0x79'))[_0x20b7('0x21')](function(_0x5ed089){if(_['isNil'](_0x5ed089)){_0x3a24d3[_0x20b7('0x79')]=_0x1a61b9[_0x20b7('0x7a')]||0x1;return;}if(_[_0x20b7('0x7b')](_0x1a61b9[_0x20b7('0x7a')])||_0x1a61b9['min_internal']===_0x5ed089){_0x3a24d3[_0x20b7('0x79')]=_0x5ed089+0x1;return;}if(_0x1a61b9[_0x20b7('0x7a')]>_0x5ed089){_0x3a24d3['internal']=_0x1a61b9[_0x20b7('0x7a')];return;}return db[_0x20b7('0x5c')][_0x20b7('0x51')]('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[_0x20b7('0x5c')]['QueryTypes'][_0x20b7('0x7c')]})['then'](function(_0x134a6d){if(_0x134a6d&&_0x134a6d[_0x20b7('0x6e')]){for(var _0x17001c=0x0,_0x1d056b=_0x134a6d['length'];_0x17001c<_0x1d056b&&_['isNil'](_0x3a24d3['internal']);_0x17001c++){if(_0x1a61b9[_0x20b7('0x7a')]<=_0x134a6d[_0x17001c][_0x20b7('0x7d')]){_0x3a24d3[_0x20b7('0x79')]=_0x134a6d[_0x17001c][_0x20b7('0x7d')];}else if(_0x1a61b9[_0x20b7('0x7a')]>_0x134a6d[_0x17001c][_0x20b7('0x7d')]&&_0x1a61b9[_0x20b7('0x7a')]<=_0x134a6d[_0x17001c]['to']){_0x3a24d3[_0x20b7('0x79')]=_0x1a61b9[_0x20b7('0x7a')];}}}if(_[_0x20b7('0x7b')](_0x3a24d3['internal'])){_0x3a24d3[_0x20b7('0x79')]=_0x5ed089+0x1;}return _0x26d5c6(_0x3a24d3);});});})[_0x20b7('0x2b')](function(_0x42f7ed){_0x2d4554(_0x42f7ed);});});}function updateUser(_0x2da92a){return new BPromise(function(_0x541cc5,_0x5c5ea5){try{if(_0x2da92a['voicemail']){_0x2da92a[_0x20b7('0x7e')]=_0x2da92a[_0x20b7('0x79')];_0x2da92a[_0x20b7('0x7f')]={'mailbox':_0x2da92a[_0x20b7('0x79')],'password':_0x2da92a[_0x20b7('0x4f')],'fullname':_0x2da92a[_0x20b7('0x80')],'email':_0x2da92a['email']};}if(_0x2da92a['role']==='agent'){if(!_0x2da92a[_0x20b7('0x81')])_0x2da92a[_0x20b7('0x81')]=[_0x20b7('0x82'),_0x20b7('0x83'),_0x20b7('0x84'),_0x20b7('0x85'),_0x20b7('0x86'),_0x20b7('0x87'),_0x20b7('0x88'),_0x20b7('0x89'),_0x20b7('0x8a'),_0x20b7('0x8b'),_0x20b7('0x8c'),_0x20b7('0x8d'),'111',_0x20b7('0x8e'),'115'];}_0x541cc5(_0x2da92a);}catch(_0x100cf4){_0x5c5ea5(_0x100cf4);}});}exports['create']=function(_0x41153e,_0x177b44){if(_0x41153e[_0x20b7('0x3c')][_0x20b7('0x39')]==='agent')throw new Error(_0x20b7('0x8f'));if(_0x41153e[_0x20b7('0x71')][_0x20b7('0x39')]===_0x20b7('0x3c')&&_0x41153e['user'][_0x20b7('0x39')]!==_0x20b7('0x3a')){throw new Error(_0x20b7('0x90'));}if(_0x41153e['body'][_0x20b7('0x39')]===_0x20b7('0x3a')&&_0x41153e[_0x20b7('0x3c')]['role']!==_0x20b7('0x3a')){throw new Error(_0x20b7('0x91'));}return licenseUtil['checkUserLimits']([_0x41153e[_0x20b7('0x71')]])[_0x20b7('0x21')](function(){return validateUser(_0x41153e[_0x20b7('0x71')]);})[_0x20b7('0x21')](function(_0x31e6fa){return updateUser(_0x31e6fa)[_0x20b7('0x21')](function(_0x1454c2){if(_0x1454c2['role']===_0x20b7('0x3a')){_0x1454c2['settingsEnabled']=_0x41153e['user'][_0x20b7('0x92')];delete _0x1454c2[_0x20b7('0x93')];}return _0x1454c2;});})[_0x20b7('0x21')](function(_0x3bae35){return db['User'][_0x20b7('0x94')](_0x3bae35,{'include':[{'model':db[_0x20b7('0x7f')],'as':_0x20b7('0x7f')}]});})[_0x20b7('0x21')](function(_0xf8bc1b){if(_0x41153e['body'][_0x20b7('0x39')]==='user')return _0xf8bc1b;if(_0x41153e[_0x20b7('0x3c')][_0x20b7('0x39')]!=='user')return _0xf8bc1b;return db[_0x20b7('0x95')][_0x20b7('0x45')]({'where':{'name':_0xf8bc1b['role']===_0x20b7('0x3e')?_0x20b7('0x3d'):_0x20b7('0x3f'),'userProfileId':_0x41153e['user']['userProfileId']},'raw':!![]})['then'](function(_0x5660ca){if(!_0x5660ca||_0x5660ca[_0x20b7('0x96')]!=0x0)return _0xf8bc1b;return db['UserProfileResource']['create']({'name':_0xf8bc1b[_0x20b7('0x46')],'resourceId':_0xf8bc1b['id'],'type':_0x5660ca[_0x20b7('0x46')],'sectionId':_0x5660ca['id']},{})[_0x20b7('0x21')](function(){return _0xf8bc1b;});})['catch'](function(_0x39305b){logger[_0x20b7('0x28')](_0x20b7('0x97'),_0x39305b);throw _0x39305b;});})['then'](respondWithResult(_0x177b44,0xc9))[_0x20b7('0x2b')](handleError(_0x177b44,null));};exports[_0x20b7('0x98')]=function(_0x4db362,_0x4f819d){var _0xe3af7d=_0x4db362[_0x20b7('0x71')];var _0xd9fa8d=[];if(_0x4db362[_0x20b7('0x3c')][_0x20b7('0x39')]===_0x20b7('0x3e'))throw new Error(_0x20b7('0x8f'));if(_[_0x20b7('0x99')](_0xe3af7d,[_0x20b7('0x39'),_0x20b7('0x3c')])&&_0x4db362[_0x20b7('0x3c')][_0x20b7('0x39')]!==_0x20b7('0x3a')){throw new Error(_0x20b7('0x90'));}if(_[_0x20b7('0x99')](_0xe3af7d,[_0x20b7('0x39'),_0x20b7('0x3a')])&&_0x4db362[_0x20b7('0x3c')][_0x20b7('0x39')]!==_0x20b7('0x3a')){throw new Error(_0x20b7('0x9a'));}return licenseUtil[_0x20b7('0x9b')](_0xe3af7d)[_0x20b7('0x21')](function(){return validateUser(_0xe3af7d[0x0]);})[_0x20b7('0x21')](function(){for(var _0x33f86d=0x1;_0x33f86d<_0xe3af7d[_0x20b7('0x6e')];_0x33f86d++){var _0x37a2e0=_0xe3af7d[_0x33f86d-0x1][_0x20b7('0x79')];if(!_0xe3af7d[_0x33f86d][_0x20b7('0x79')])_0xe3af7d[_0x33f86d][_0x20b7('0x79')]=_0x37a2e0+0x1;_0xd9fa8d[_0x20b7('0x60')](validateUser(_0xe3af7d[_0x33f86d]));}return BPromise[_0x20b7('0x6a')](_0xd9fa8d);})[_0x20b7('0x21')](function(){_0xd9fa8d=[];for(var _0x340eb9=0x0;_0x340eb9<_0xe3af7d[_0x20b7('0x6e')];_0x340eb9++){_0xd9fa8d[_0x20b7('0x60')](updateUser(_0xe3af7d[_0x340eb9]));}return BPromise[_0x20b7('0x6a')](_0xd9fa8d);})[_0x20b7('0x21')](function(){return BPromise[_0x20b7('0x9c')](_0xe3af7d,function(_0x2748fd){return db['User']['create'](_0x2748fd,{'include':[{'model':db[_0x20b7('0x7f')],'as':_0x20b7('0x7f')}]})[_0x20b7('0x21')](function(_0x3f974e){_0x2748fd['id']=_0x3f974e['id'];return _0x2748fd;});});})['then'](function(_0x1521e6){if(_0x4db362[_0x20b7('0x71')]['role']===_0x20b7('0x3c'))return _0x1521e6;if(_0x4db362['user']['role']!==_0x20b7('0x3c'))return _0x1521e6;var _0x1c043c=_[_0x20b7('0x99')](_0x1521e6,function(_0x5d50a9){return _0x5d50a9[_0x20b7('0x39')]===_0x20b7('0x3e')||_0x5d50a9[_0x20b7('0x39')]===_0x20b7('0x9d');});if(!_0x1c043c)return _0x1521e6;return db[_0x20b7('0x95')]['findAll']({'where':{'name':{'$or':[_0x20b7('0x3d'),_0x20b7('0x3f')]},'userProfileId':_0x4db362[_0x20b7('0x3c')][_0x20b7('0x93')]},'raw':!![]})['then'](function(_0x5bf915){if(_[_0x20b7('0x9e')](_0x5bf915)||!_[_0x20b7('0x99')](_0x5bf915,[_0x20b7('0x96'),0x0]))return _0x1521e6;_0xd9fa8d=[];var _0x3fe7b4=_(_0x5bf915)[_0x20b7('0x42')](function(_0x78595b){if(_0x78595b['autoAssociation']===0x1)return;return _0x78595b[_0x20b7('0x46')]===_0x20b7('0x3d')?_0x20b7('0x3e'):_0x20b7('0x9d');})[_0x20b7('0x9f')]()[_0x20b7('0x43')]();for(var _0x233f53=0x0;_0x233f53<_0x1521e6[_0x20b7('0x6e')];_0x233f53++){if(!_[_0x20b7('0x44')](_0x3fe7b4,_0x1521e6[_0x233f53][_0x20b7('0x39')]))return;var _0x286f35=_0x1521e6[_0x233f53]['role']===_0x20b7('0x3e')?_0x20b7('0x3d'):_0x20b7('0x3f');_0xd9fa8d['push'](db['UserProfileResource'][_0x20b7('0x94')]({'name':_0x1521e6[_0x233f53][_0x20b7('0x46')],'resourceId':_0x1521e6[_0x233f53]['id'],'type':_0x286f35,'sectionId':_[_0x20b7('0x45')](_0x5bf915,['name',_0x286f35])['id']},{}));}return BPromise[_0x20b7('0x6a')](_0xd9fa8d);});})['then'](respondWithResult(_0x4f819d,0xc9))['catch'](handleError(_0x4f819d,null));};exports[_0x20b7('0xa0')]=function(_0x5f54c8,_0x4ae5c7,_0x48bc68){if(_0x5f54c8[_0x20b7('0x71')]['id']){delete _0x5f54c8[_0x20b7('0x71')]['id'];}return db[_0x20b7('0x49')][_0x20b7('0x45')]({'where':{'id':_0x5f54c8['params']['id']}})[_0x20b7('0x21')](function(_0x5cbd42){if(!_0x5cbd42)return null;if(_0x5cbd42['id']===_0x5f54c8['user']['id']){if(!_0x5f54c8[_0x20b7('0x71')][_0x20b7('0xa1')]||!_0x5f54c8[_0x20b7('0x71')][_0x20b7('0xa2')]){throw new db['Sequelize'][(_0x20b7('0xa3'))](_0x20b7('0xa4'));}if(!_0x5cbd42[_0x20b7('0xa5')](_0x5f54c8[_0x20b7('0x71')]['oldPassword'])){throw new db[(_0x20b7('0xa6'))][(_0x20b7('0xa3'))](_0x20b7('0xa7'));}if(_0x5f54c8[_0x20b7('0x71')][_0x20b7('0xa1')]===_0x5f54c8[_0x20b7('0x71')][_0x20b7('0xa2')]){throw new db['Sequelize'][(_0x20b7('0xa3'))](_0x20b7('0xa8'));}}else if(_0x5f54c8[_0x20b7('0x3c')]['role']===_0x20b7('0x3a')){if(!_0x5f54c8[_0x20b7('0x71')][_0x20b7('0xa2')]){throw new db[(_0x20b7('0xa6'))][(_0x20b7('0xa3'))](_0x20b7('0xa9'));}}else if(_0x5f54c8[_0x20b7('0x3c')][_0x20b7('0x39')]===_0x20b7('0x3c')){if(!_0x5f54c8[_0x20b7('0x71')][_0x20b7('0xa2')]){throw new db['Sequelize'][(_0x20b7('0xa3'))](_0x20b7('0xa9'));}if(_0x5cbd42[_0x20b7('0x39')]!==_0x20b7('0x3e')){throw new db['Sequelize'][(_0x20b7('0xa3'))](_0x20b7('0x8f'));}}else{throw new db[(_0x20b7('0xa6'))][(_0x20b7('0xa3'))](_0x20b7('0x8f'));}return _0x5cbd42;})[_0x20b7('0x21')](handleEntityNotFound(_0x4ae5c7,null))[_0x20b7('0x21')](function(_0x43225c){return db[_0x20b7('0x75')][_0x20b7('0xaa')]({'attributes':['id','securePassword',_0x20b7('0xab'),_0x20b7('0xac')]})[_0x20b7('0x21')](function(_0xb50ccc){if(_0xb50ccc[_0x20b7('0x76')])authService[_0x20b7('0x77')](_0x5f54c8[_0x20b7('0x71')]['newPassword']);if(!_0xb50ccc['enforcePasswordHistory']||!_0x43225c[_0x20b7('0xad')])return _0x43225c;authService[_0x20b7('0xae')](_0x5f54c8[_0x20b7('0x71')][_0x20b7('0xa2')],_0x43225c[_0x20b7('0xad')],_0xb50ccc['passwordHistoryLimit']);return _0x43225c;})[_0x20b7('0x21')](saveUpdates({'password':_0x5f54c8[_0x20b7('0x71')][_0x20b7('0xa2')],'passwordResetAt':_0x5f54c8['user']['id']==_0x5f54c8[_0x20b7('0x6c')]['id']?moment():null,'previousPasswords':authService[_0x20b7('0xaf')](_0x5f54c8['body']['newPassword'],_0x43225c[_0x20b7('0xad')])},null));})[_0x20b7('0x21')](respondWithResult(_0x4ae5c7,null))[_0x20b7('0x2b')](handleError(_0x4ae5c7,null));};exports[_0x20b7('0xb0')]=function(_0x4f5a71,_0x56af0c,_0x4d5763){var _0x3580d3=_0x4f5a71['body']['channel'];return db[_0x20b7('0x49')][_0x20b7('0x45')]({'where':{'id':_0x4f5a71['params']['id']},'attributes':['id',_0x20b7('0x46'),_0x20b7('0x39'),_0x20b7('0xb1'),_0x20b7('0xb2'),_0x20b7('0xb3'),_0x20b7('0xb4')]})[_0x20b7('0x21')](handleEntityNotFound(_0x56af0c,null))[_0x20b7('0x21')](function(_0x23ddb8){if(_0x23ddb8){if(!utils[_0x20b7('0xb5')](_0x3580d3)){throw new db[(_0x20b7('0xa6'))][(_0x20b7('0xa3'))](_0x20b7('0xb6'));}return _0x23ddb8[_0x20b7('0xb7')+_[_0x20b7('0xb8')](_0x3580d3[_0x20b7('0xb9')]())+'Queues'](_0x4f5a71[_0x20b7('0x71')][_0x20b7('0x73')],{'penalty':_0x4f5a71[_0x20b7('0x71')][_0x20b7('0xba')]||0x0})[_0x20b7('0xbb')](function(_0x2c9377){for(var _0x46ebc5=0x0;_0x46ebc5<_0x4f5a71['body'][_0x20b7('0x73')][_0x20b7('0x6e')];_0x46ebc5+=0x1){var _0x39d7b8={'UserId':_0x4f5a71['params']['id']};_0x39d7b8[_[_0x20b7('0xb8')](_0x3580d3[_0x20b7('0xb9')]())+_0x20b7('0xbc')]=_0x4f5a71[_0x20b7('0x71')]['ids'][_0x46ebc5];socket[_0x20b7('0xbd')]('user'+_[_0x20b7('0xb8')](_0x3580d3[_0x20b7('0xb9')]())+_0x20b7('0xbe'),_0x39d7b8);}return _0x2c9377;})[_0x20b7('0x21')](function(){if(_0x3580d3==='voice'){return db[_0x20b7('0xbf')][_0x20b7('0x61')]({'where':{'id':_0x4f5a71['body'][_0x20b7('0x73')]||[]},'raw':!![],'attributes':['id',_0x20b7('0x46')]});}})[_0x20b7('0x21')](function(_0x5398c9){var _0x2b1b3f=_0x23ddb8[_0x20b7('0x38')]({'plain':!![]});var _0x1c0893=[];if(_0x3580d3===_0x20b7('0xc0')&&_0x2b1b3f[_0x20b7('0x39')]==='agent'&&_0x2b1b3f['online']){for(var _0x69d556=0x0;_0x69d556<_0x5398c9[_0x20b7('0x6e')];_0x69d556+=0x1){_0x1c0893['push']({'membername':_0x2b1b3f[_0x20b7('0x46')],'UserId':_0x2b1b3f['id'],'queue_name':_0x5398c9[_0x69d556][_0x20b7('0x46')],'VoiceQueueId':_0x5398c9[_0x69d556]['id'],'interface':_['isNil'](_0x2b1b3f[_0x20b7('0xb4')])?util[_0x20b7('0xc1')]('SIP/%s',_0x2b1b3f[_0x20b7('0x46')]):_0x2b1b3f['interface'],'paused':_0x2b1b3f[_0x20b7('0xb3')]||![],'penalty':_0x4f5a71[_0x20b7('0x71')][_0x20b7('0xba')]||0x0});}return BPromise['each'](_0x1c0893,function(_0x57d1f4){return db[_0x20b7('0xc2')]['upsert'](_0x57d1f4);});}return _0x23ddb8;});}})['then'](respondWithStatusCode(_0x56af0c,null))['catch'](handleError(_0x56af0c,null));};exports['removeQueues']=function(_0xc4a88f,_0x1cfd5a,_0x37ae24){var _0x4d9062;return db[_0x20b7('0x49')][_0x20b7('0x45')]({'where':{'id':_0xc4a88f[_0x20b7('0x6c')]['id']},'attributes':['id','name',_0x20b7('0x39')]})[_0x20b7('0x21')](handleEntityNotFound(_0x1cfd5a,null))[_0x20b7('0x21')](function(_0x453469){if(_0x453469){_0x4d9062=_0x453469;if(!_0xc4a88f[_0x20b7('0x51')][_0x20b7('0xc3')]||!utils[_0x20b7('0xb5')](_0xc4a88f['query'][_0x20b7('0xc3')])){throw new db[(_0x20b7('0xa6'))]['ValidationError'](_0x20b7('0xb6'));}return _0x453469[_0x20b7('0xc4')+_['capitalize'](_0xc4a88f[_0x20b7('0x51')][_0x20b7('0xc3')][_0x20b7('0xb9')]())+'Queues'](_0xc4a88f[_0x20b7('0x51')][_0x20b7('0x73')]);}})[_0x20b7('0x21')](function(_0x61bb0f){for(var _0x14f07e=0x0;_0x14f07e<_0xc4a88f[_0x20b7('0x51')][_0x20b7('0x73')][_0x20b7('0x6e')];_0x14f07e+=0x1){var _0x7dd0f7={'UserId':_0xc4a88f[_0x20b7('0x6c')]['id']};_0x7dd0f7[_[_0x20b7('0xb8')](_0xc4a88f[_0x20b7('0x51')]['channel'][_0x20b7('0xb9')]())+_0x20b7('0xbc')]=_0xc4a88f['query'][_0x20b7('0x73')][_0x14f07e];socket[_0x20b7('0xbd')](_0x20b7('0x3c')+_[_0x20b7('0xb8')](_0xc4a88f[_0x20b7('0x51')]['channel'][_0x20b7('0xb9')]())+_0x20b7('0xc5'),_0x7dd0f7);}return _0x61bb0f;})[_0x20b7('0x21')](function(){if(_0xc4a88f['query'][_0x20b7('0xc3')]===_0x20b7('0xc0')){return db[_0x20b7('0xc2')]['destroy']({'where':{'UserId':_0xc4a88f[_0x20b7('0x6c')]['id'],'VoiceQueueId':_0xc4a88f[_0x20b7('0x51')][_0x20b7('0x73')]},'individualHooks':!![]})[_0x20b7('0x21')](function(){return _0x4d9062;});}return _0x4d9062;})[_0x20b7('0x21')](respondWithStatusCode(_0x1cfd5a,null))['catch'](handleError(_0x1cfd5a,null));};exports[_0x20b7('0xc6')]=function(_0x50ceac,_0x2ff747,_0x269c7f){_0x50ceac[_0x20b7('0x71')]['userpic']=_0x50ceac[_0x20b7('0xc7')][_0x20b7('0xc8')];return db['User'][_0x20b7('0x45')]({'where':{'id':_0x50ceac[_0x20b7('0x6c')]['id']}})[_0x20b7('0x21')](handleEntityNotFound(_0x2ff747,null))[_0x20b7('0x21')](saveUpdates(_0x50ceac['body'],null))['then'](respondWithResult(_0x2ff747,null))['catch'](handleError(_0x2ff747,null));};exports['getAvatar']=function(_0x940bd9,_0x35c228,_0x518635){var _0x15b565=path['join'](config[_0x20b7('0xc9')],_0x20b7('0xca'));return db['User']['find']({'where':{'id':_0x940bd9[_0x20b7('0x6c')]['id']},'attributes':['id',_0x20b7('0xcb')],'raw':!![]})[_0x20b7('0x21')](handleEntityNotFound(_0x35c228,null))[_0x20b7('0x21')](function(_0x3938e7){if(_0x3938e7){if(_[_0x20b7('0x7b')](_0x3938e7['userpic'])){return _0x35c228['download'](_0x15b565);}else{if(!fs[_0x20b7('0xcc')](path[_0x20b7('0xcd')](config['root'],_0x20b7('0xce'),_0x3938e7[_0x20b7('0xcb')]))){return _0x35c228[_0x20b7('0xcf')](_0x15b565);}return _0x35c228[_0x20b7('0xcf')](path['join'](config[_0x20b7('0xc9')],_0x20b7('0xce'),_0x3938e7[_0x20b7('0xcb')]));}}})['catch'](handleError(_0x35c228,null));};exports[_0x20b7('0xd0')]=function(_0x1c1ca4,_0x9924a7,_0x26929b){return db[_0x20b7('0x49')][_0x20b7('0x45')]({'where':{'id':_0x1c1ca4[_0x20b7('0x6c')]['id']},'attributes':['id']})[_0x20b7('0x21')](handleEntityNotFound(_0x9924a7,null))['then'](function(_0x50fd89){var _0x1a357f=[];values=_0x50fd89[_0x20b7('0x65')];_0x1a357f[_0x20b7('0x60')](get_open_tabs(_0x20b7('0x64'),_0x50fd89[_0x20b7('0x65')]));_0x1a357f['push'](get_open_tabs('sms',_0x50fd89[_0x20b7('0x65')]));_0x1a357f[_0x20b7('0x60')](get_open_tabs('openchannel',_0x50fd89[_0x20b7('0x65')]));_0x1a357f[_0x20b7('0x60')](get_open_tabs('whatsapp',_0x50fd89[_0x20b7('0x65')]));_0x1a357f['push'](get_open_tabs(_0x20b7('0x70'),_0x50fd89[_0x20b7('0x65')]));_0x1a357f[_0x20b7('0x60')](get_open_tabs(_0x20b7('0x67'),_0x50fd89[_0x20b7('0x65')]));return BPromise[_0x20b7('0x6a')](_0x1a357f);})[_0x20b7('0x21')](function(_0x3500e9){var _0x58e8d3=[];if(_0x3500e9){for(var _0x547b24=0x0;_0x547b24=_0x10f13b[_0x2465('0x59')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x2465('0x14')](function(){if(_0x5da235){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x5da235[_0x2465('0x2e')]},'individualHooks':!![]});}})['then'](function(){if(_0x5da235){return _0x5da235['getVoiceQueues']({'raw':!![]});}})[_0x2465('0x14')](function(_0xc3fff4){if(_0x5da235){if(_0xc3fff4){var _0x48dc88=[];_0x445ea3=_0xc3fff4;if(_0x445ea3['length']){for(var _0x1c1cbc=0x0;_0x1c1cbc<_0x445ea3[_0x2465('0x34')];_0x1c1cbc++){_0x48dc88[_0x2465('0x4e')](db['UserVoiceQueueRt'][_0x2465('0x5a')]({'membername':_0x5da235[_0x2465('0x2e')],'UserId':_0x5da235['id'],'queue_name':_0x445ea3[_0x1c1cbc]['name'],'VoiceQueueId':_0x445ea3[_0x1c1cbc]['id'],'interface':_0x12a62c,'paused':_0x5da235[_0x2465('0x55')]||![],'penalty':_0x445ea3[_0x1c1cbc]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x2465('0x4f')](_0x48dc88);}}}})[_0x2465('0x14')](function(){if(_0x5da235){return db[_0x2465('0x45')][_0x2465('0x21')]({'where':{'membername':_0x5da235[_0x2465('0x2e')],'exitAt':null}});}})['then'](function(_0x47a422){if(_0x5da235){if(_0x47a422&&_0x47a422[_0x2465('0x34')]){var _0x3df8c9=[];_0x47a422['forEach'](function(_0x27c103){_0x3df8c9['push'](_0x27c103[_0x2465('0x32')]({'exitAt':moment()['format'](_0x2465('0x36'))}));});return BPromise[_0x2465('0x4f')](_0x3df8c9);}}})[_0x2465('0x14')](function(_0x303360){if(_0x5da235){var _0x2a4b90=[];var _0x433a21=[];var _0x5dd984=utils[_0x2465('0x38')]();var _0x54dd02={'membername':_0x5da235[_0x2465('0x2e')],'interface':_0x12a62c,'enterAt':moment()[_0x2465('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x5da235[_0x2465('0x5b')],'internal':_0x5da235['internal']};_0x5dd984['forEach'](function(_0x5a9361){_0x2a4b90[_0x2465('0x4e')](_['merge']({'channel':_0x5a9361,'type':_0x2465('0x5c'),'data1':_0x2465('0x5d'),'data2':_0x12a62c},_0x54dd02));if(_0x5da235[_0x2465('0x55')]){_0x433a21[_0x2465('0x4e')](_[_0x2465('0x5e')]({'channel':_0x5a9361,'type':_0x2465('0x33'),'data1':_0x2465('0x5f')},_0x54dd02));}});return db[_0x2465('0x45')][_0x2465('0x3e')](_0x2a4b90[_0x2465('0x60')](_0x433a21),{'individualHooks':!![]});}})[_0x2465('0x14')](function(){if(_0x5da235){return _0x5da235[_0x2465('0x32')]({'online':!![],'lastLoginAt':moment()[_0x2465('0x35')](_0x2465('0x36')),'voicePause':_0x5da235[_0x2465('0x55')]||![],'mailPause':_0x5da235[_0x2465('0x55')]||![],'chatPause':_0x5da235[_0x2465('0x55')]||![],'faxPause':_0x5da235['loginInPause']||![],'smsPause':_0x5da235[_0x2465('0x55')]||![],'openchannelPause':_0x5da235['loginInPause']||![],'pauseType':_0x5da235[_0x2465('0x55')]?_0x2465('0x5f'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x12a62c});}})['then'](function(_0x384098){_0x55a2d3(_0x384098);})[_0x2465('0x29')](function(_0x6a060f){_0x251636(_0x431ed8[_0x2465('0x1b')](0x1f4,_0x6a060f[_0x2465('0x1d')]));});});}; \ No newline at end of file +var _0x11fe=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','defaults','localhost','redis','./user.socket','register','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetUser','User','options','raw','where','limit','include','map','attributes','model','then','ShowUser','PauseUser','find','name','role','internal','MemberReport','findAll','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','interface','SIP/%s','type','DEFAULT\x20PAUSE','body','uniqueid','bulkCreate','update','findOne','channel','isValidChannel','voice','UserVoiceQueueRt','system','mail','chat','fax','sms','whatsapp','%s%s','Pause','all','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','LOGIN','callysquare','merge','LOGININPAUSE','concat','util','moment','bluebird','randomstring'];(function(_0x8344f3,_0x280f9d){var _0x56dcc8=function(_0x3cde69){while(--_0x3cde69){_0x8344f3['push'](_0x8344f3['shift']());}};_0x56dcc8(++_0x280f9d);}(_0x11fe,0xb8));var _0xe11f=function(_0x4009df,_0x3b5815){_0x4009df=_0x4009df-0x0;var _0x2985f3=_0x11fe[_0x4009df];return _0x2985f3;};'use strict';var _=require('lodash');var util=require(_0xe11f('0x0'));var moment=require(_0xe11f('0x1'));var BPromise=require(_0xe11f('0x2'));var rs=require(_0xe11f('0x3'));var fs=require('fs');var Redis=require(_0xe11f('0x4'));var db=require(_0xe11f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe11f('0x6'))(_0xe11f('0x7'));var config=require('../../config/environment');var jayson=require(_0xe11f('0x8'));var client=jayson['client'][_0xe11f('0x9')]({'port':0x232a});config['redis']=_[_0xe11f('0xa')](config['redis'],{'host':_0xe11f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe11f('0xc')]));require(_0xe11f('0xd'))[_0xe11f('0xe')](socket);function respondWithRpcPromise(_0xe8ede5,_0x2708c9,_0x101745){return new BPromise(function(_0x48c6b2,_0x4eb626){return client['request'](_0xe8ede5,_0x101745)['then'](function(_0x2dd116){logger[_0xe11f('0xf')](_0xe11f('0x10'),_0x2708c9,_0xe11f('0x11'));logger[_0xe11f('0x12')](_0xe11f('0x13'),_0x2708c9,'request\x20sent',JSON['stringify'](_0x2dd116));if(_0x2dd116[_0xe11f('0x14')]){if(_0x2dd116['error']['code']===0x1f4){logger[_0xe11f('0x14')](_0xe11f('0x10'),_0x2708c9,_0x2dd116[_0xe11f('0x14')][_0xe11f('0x15')]);return _0x4eb626(_0x2dd116[_0xe11f('0x14')]['message']);}logger['error']('User,\x20%s,\x20%s',_0x2708c9,_0x2dd116[_0xe11f('0x14')][_0xe11f('0x15')]);return _0x48c6b2(_0x2dd116[_0xe11f('0x14')][_0xe11f('0x15')]);}else{logger[_0xe11f('0xf')](_0xe11f('0x10'),_0x2708c9,_0xe11f('0x11'));_0x48c6b2(_0x2dd116[_0xe11f('0x16')][_0xe11f('0x15')]);}})[_0xe11f('0x17')](function(_0x4c22c7){logger[_0xe11f('0x14')]('User,\x20%s,\x20%s',_0x2708c9,_0x4c22c7);_0x4eb626(_0x4c22c7);});});}exports[_0xe11f('0x18')]=function(_0x5dfd13){var _0x55d5af=this;return new Promise(function(_0x39baca,_0x3e6412){return db[_0xe11f('0x19')]['findAll']({'raw':_0x5dfd13[_0xe11f('0x1a')]?_0x5dfd13[_0xe11f('0x1a')][_0xe11f('0x1b')]===undefined?!![]:![]:!![],'where':_0x5dfd13[_0xe11f('0x1a')]?_0x5dfd13[_0xe11f('0x1a')][_0xe11f('0x1c')]||null:null,'attributes':_0x5dfd13[_0xe11f('0x1a')]?_0x5dfd13[_0xe11f('0x1a')]['attributes']||null:null,'limit':_0x5dfd13[_0xe11f('0x1a')]?_0x5dfd13[_0xe11f('0x1a')][_0xe11f('0x1d')]||null:null,'include':_0x5dfd13[_0xe11f('0x1a')]?_0x5dfd13[_0xe11f('0x1a')][_0xe11f('0x1e')]?_[_0xe11f('0x1f')](_0x5dfd13['options'][_0xe11f('0x1e')],function(_0xb32596){return{'model':db[_0xb32596['model']],'as':_0xb32596['as'],'attributes':_0xb32596[_0xe11f('0x20')],'include':_0xb32596[_0xe11f('0x1e')]?_['map'](_0xb32596[_0xe11f('0x1e')],function(_0x543182){return{'model':db[_0x543182['model']],'as':_0x543182['as'],'attributes':_0x543182[_0xe11f('0x20')],'include':_0x543182[_0xe11f('0x1e')]?_[_0xe11f('0x1f')](_0x543182[_0xe11f('0x1e')],function(_0x4da857){return{'model':db[_0x4da857[_0xe11f('0x21')]],'as':_0x4da857['as'],'attributes':_0x4da857['attributes']};}):[]};}):[]};}):[]:[]})[_0xe11f('0x22')](function(_0x51e358){logger[_0xe11f('0xf')](_0xe11f('0x18'),_0x5dfd13);logger[_0xe11f('0x12')](_0xe11f('0x18'),_0x5dfd13,JSON['stringify'](_0x51e358));_0x39baca(_0x51e358);})[_0xe11f('0x17')](function(_0x5ace12){logger[_0xe11f('0x14')](_0xe11f('0x18'),_0x5ace12[_0xe11f('0x15')],_0x5dfd13);_0x3e6412(_0x55d5af[_0xe11f('0x14')](0x1f4,_0x5ace12[_0xe11f('0x15')]));});});};exports[_0xe11f('0x23')]=function(_0x4f6fea){var _0x5b2126=this;return new Promise(function(_0x2d98dc,_0x55808a){return db[_0xe11f('0x19')]['find']({'raw':_0x4f6fea[_0xe11f('0x1a')]?_0x4f6fea[_0xe11f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4f6fea[_0xe11f('0x1a')]?_0x4f6fea[_0xe11f('0x1a')][_0xe11f('0x1c')]||null:null,'attributes':_0x4f6fea[_0xe11f('0x1a')]?_0x4f6fea[_0xe11f('0x1a')][_0xe11f('0x20')]||null:null,'include':_0x4f6fea[_0xe11f('0x1a')]?_0x4f6fea['options'][_0xe11f('0x1e')]?_[_0xe11f('0x1f')](_0x4f6fea['options']['include'],function(_0x161729){return{'model':db[_0x161729[_0xe11f('0x21')]],'as':_0x161729['as'],'attributes':_0x161729[_0xe11f('0x20')],'include':_0x161729[_0xe11f('0x1e')]?_['map'](_0x161729[_0xe11f('0x1e')],function(_0x1f5800){return{'model':db[_0x1f5800[_0xe11f('0x21')]],'as':_0x1f5800['as'],'attributes':_0x1f5800[_0xe11f('0x20')],'include':_0x1f5800[_0xe11f('0x1e')]?_[_0xe11f('0x1f')](_0x1f5800['include'],function(_0x3ab1d4){return{'model':db[_0x3ab1d4[_0xe11f('0x21')]],'as':_0x3ab1d4['as'],'attributes':_0x3ab1d4[_0xe11f('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9c3802){logger[_0xe11f('0xf')](_0xe11f('0x23'),_0x4f6fea);logger['debug'](_0xe11f('0x23'),_0x4f6fea,JSON['stringify'](_0x9c3802));_0x2d98dc(_0x9c3802);})[_0xe11f('0x17')](function(_0x25f7ff){logger[_0xe11f('0x14')]('ShowUser',_0x25f7ff[_0xe11f('0x15')],_0x4f6fea);_0x55808a(_0x5b2126[_0xe11f('0x14')](0x1f4,_0x25f7ff['message']));});});};exports[_0xe11f('0x24')]=function(_0x4438bf){var _0x133195=this;return new Promise(function(_0x35294f,_0x7a0474){var _0x2ae8b9;return db[_0xe11f('0x19')][_0xe11f('0x25')]({'where':_0x4438bf['options'][_0xe11f('0x1c')]||{},'attributes':['id',_0xe11f('0x26'),_0xe11f('0x27'),_0xe11f('0x28'),'interface']})['then'](function(_0x5d521c){if(_0x5d521c){_0x2ae8b9=_0x5d521c;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x2ae8b9['id']},'individualHooks':!![]});}})[_0xe11f('0x22')](function(){if(_0x2ae8b9){return db[_0xe11f('0x29')][_0xe11f('0x2a')]({'where':{'membername':_0x2ae8b9[_0xe11f('0x26')],'type':_0xe11f('0x2b'),'exitAt':null}});}})['then'](function(_0x531a55){if(_0x2ae8b9){if(_0x531a55&&_0x531a55[_0xe11f('0x2c')]){var _0x22b118=moment()[_0xe11f('0x2d')](_0xe11f('0x2e'));for(var _0x3ca4f4=0x0,_0x1b05ba=_0x531a55[_0xe11f('0x2c')];_0x3ca4f4<_0x1b05ba;_0x3ca4f4++){_0x531a55[_0x3ca4f4][_0xe11f('0x2f')]({'exitAt':_0x22b118});}}}})[_0xe11f('0x22')](function(){if(_0x2ae8b9){var _0x85fdfd=[];var _0x1d0104=utils[_0xe11f('0x30')]();_0x1d0104[_0xe11f('0x31')](function(_0x48d73f){_0x85fdfd[_0xe11f('0x32')]({'channel':_0x48d73f,'membername':_0x2ae8b9[_0xe11f('0x26')],'interface':_[_0xe11f('0x33')](_0x2ae8b9[_0xe11f('0x34')])?util[_0xe11f('0x2d')](_0xe11f('0x35'),_0x2ae8b9['name']):_0x2ae8b9[_0xe11f('0x34')],'type':_0xe11f('0x2b'),'enterAt':moment()['format'](_0xe11f('0x2e')),'data1':_0x4438bf['body'][_0xe11f('0x36')]||_0xe11f('0x37'),'role':_0x2ae8b9[_0xe11f('0x27')],'internal':_0x2ae8b9[_0xe11f('0x28')],'uniqueid':_0x4438bf[_0xe11f('0x38')][_0xe11f('0x39')]||null});});return db[_0xe11f('0x29')][_0xe11f('0x3a')](_0x85fdfd,{'individualHooks':!![]});}})[_0xe11f('0x22')](function(){if(_0x2ae8b9){return _0x2ae8b9[_0xe11f('0x3b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4438bf['body'][_0xe11f('0x36')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xe11f('0x2d')](_0xe11f('0x2e'))});}})[_0xe11f('0x22')](function(_0x549c0b){_0x35294f(_0x549c0b);})[_0xe11f('0x17')](function(_0x4b50ab){_0x7a0474(_0x133195[_0xe11f('0x14')](0x1f4,_0x4b50ab['message']));});});};exports['UnpauseUser']=function(_0x5f51d3){var _0x2a5357=this;return new Promise(function(_0x1c162a,_0x5a2d5f){var _0x57d1d3;return db[_0xe11f('0x19')][_0xe11f('0x3c')]({'where':_0x5f51d3[_0xe11f('0x1a')][_0xe11f('0x1c')]||{},'attributes':['id',_0xe11f('0x26')]})[_0xe11f('0x22')](function(_0x13b1bd){if(_0x13b1bd){_0x57d1d3=_0x13b1bd;if(_0x5f51d3[_0xe11f('0x38')][_0xe11f('0x3d')]&&!utils[_0xe11f('0x3e')](_0x5f51d3[_0xe11f('0x38')]['channel'])){throw new Error('Unknown\x20channel');}switch(_0x5f51d3[_0xe11f('0x38')][_0xe11f('0x3d')]){case _0xe11f('0x3f'):return db[_0xe11f('0x40')][_0xe11f('0x3b')]({'paused':0x0},{'where':{'UserId':_0x57d1d3['id']}})[_0xe11f('0x22')](function(){return db['MemberReport'][_0xe11f('0x25')]({'where':{'channel':_0x5f51d3[_0xe11f('0x38')][_0xe11f('0x3d')],'membername':_0x57d1d3[_0xe11f('0x26')],'type':_0xe11f('0x2b'),'exitAt':null}});})[_0xe11f('0x22')](function(_0x4d1e71){if(_0x4d1e71){return _0x4d1e71[_0xe11f('0x3b')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xe11f('0x41')},{'individualHooks':!![]});}return null;})[_0xe11f('0x22')](function(){return _0x57d1d3[_0xe11f('0x3b')]({'voicePause':![]});});case _0xe11f('0x42'):case _0xe11f('0x43'):case _0xe11f('0x44'):case _0xe11f('0x45'):case'openchannel':case _0xe11f('0x46'):return db['MemberReport'][_0xe11f('0x25')]({'where':{'channel':_0x5f51d3[_0xe11f('0x38')][_0xe11f('0x3d')],'membername':_0x57d1d3[_0xe11f('0x26')],'type':_0xe11f('0x2b'),'exitAt':null}})['then'](function(_0x428e67){return _0x428e67[_0xe11f('0x3b')]({'exitAt':moment()[_0xe11f('0x2d')](_0xe11f('0x2e')),'data2':_0xe11f('0x41')},{'individualHooks':!![]});})['then'](function(){var _0x1e1824={};_['set'](_0x1e1824,util['format'](_0xe11f('0x47'),_0x5f51d3[_0xe11f('0x38')][_0xe11f('0x3d')],_0xe11f('0x48')),![]);return _0x57d1d3[_0xe11f('0x3b')](_0x1e1824);});default:return db['UserVoiceQueueRt'][_0xe11f('0x3b')]({'paused':0x0},{'where':{'UserId':_0x57d1d3['id']}})['then'](function(){return db[_0xe11f('0x29')]['findAll']({'where':{'membername':_0x57d1d3[_0xe11f('0x26')],'type':_0xe11f('0x2b'),'exitAt':null}});})[_0xe11f('0x22')](function(_0x43f87d){var _0x10fa2c=[];_0x43f87d['forEach'](function(_0x3c2431){_0x10fa2c['push'](_0x3c2431[_0xe11f('0x3b')]({'exitAt':moment()[_0xe11f('0x2d')](_0xe11f('0x2e')),'data2':_0xe11f('0x41')}));});return BPromise[_0xe11f('0x49')](_0x10fa2c);})[_0xe11f('0x22')](function(){return _0x57d1d3[_0xe11f('0x3b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x16f7bb){_0x1c162a(_0x16f7bb);})[_0xe11f('0x17')](function(_0x444715){_0x5a2d5f(_0x2a5357[_0xe11f('0x14')](0x1f4,_0x444715['message']));});});};exports[_0xe11f('0x4a')]=function(_0x4e9531){var _0x512736=this;return new Promise(function(_0x3ffb07,_0x2ea545){var _0x214dd2;return db[_0xe11f('0x19')][_0xe11f('0x3c')]({'where':_0x4e9531[_0xe11f('0x1a')][_0xe11f('0x1c')]||{},'attributes':['id',_0xe11f('0x26')]})['then'](function(_0x4405eb){if(_0x4405eb){_0x214dd2=_0x4405eb;return db['UserVoiceQueueRt'][_0xe11f('0x4b')]({'where':{'membername':_0x214dd2['name']},'individualHooks':!![]});}})['then'](function(){if(_0x214dd2){return db[_0xe11f('0x29')][_0xe11f('0x2a')]({'where':{'membername':_0x214dd2[_0xe11f('0x26')],'exitAt':null}});}})[_0xe11f('0x22')](function(_0x1efe4b){if(_0x214dd2){if(_0x1efe4b&&_0x1efe4b[_0xe11f('0x2c')]){var _0x482e02=[];_0x1efe4b[_0xe11f('0x31')](function(_0x41511a){_0x482e02['push'](_0x41511a[_0xe11f('0x3b')]({'exitAt':moment()[_0xe11f('0x2d')](_0xe11f('0x2e'))}));});return BPromise['all'](_0x482e02);}}})['then'](function(){if(_0x214dd2){return _0x214dd2[_0xe11f('0x3b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xe11f('0x22')](function(_0x1defdb){_0x3ffb07(_0x1defdb);})[_0xe11f('0x17')](function(_0x4ace1a){_0x2ea545(_0x512736[_0xe11f('0x14')](0x1f4,_0x4ace1a[_0xe11f('0x15')]));});});};exports[_0xe11f('0x4c')]=function(_0x7a1f71){var _0x46a36a=this;return new Promise(function(_0x2730d7,_0x24158f){var _0x3aa0e6;var _0x13b6fc;var _0x13d168;var _0x48c856;return db[_0xe11f('0x19')][_0xe11f('0x3c')]({'where':_0x7a1f71['options'][_0xe11f('0x1c')]||{},'attributes':['id','name',_0xe11f('0x27'),_0xe11f('0x4d'),_0xe11f('0x4e'),_0xe11f('0x28'),_0xe11f('0x4f'),_0xe11f('0x34')]})['then'](function(_0x4119e7){if(_0x4119e7){_0x3aa0e6=_0x4119e7;_0x48c856=_0x7a1f71['body'][_0xe11f('0x34')]?_0x7a1f71[_0xe11f('0x38')][_0xe11f('0x34')]:util['format'](_0xe11f('0x35'),_0x3aa0e6[_0xe11f('0x26')]);return db[_0xe11f('0x19')][_0xe11f('0x50')]({'where':{'role':_0xe11f('0x51'),'online':!![],'id':{'$ne':_0x3aa0e6['id']}}});}})[_0xe11f('0x22')](function(_0xe728cd){if(_0xe728cd){_0x13d168=_0xe728cd;return require(_0xe11f('0x52'))[_0xe11f('0x53')]();}})[_0xe11f('0x22')](function(_0x3f1c2a){if(_0x3f1c2a&&_0x3f1c2a[_0xe11f('0x54')]&&_0x13d168>=_0x3f1c2a[_0xe11f('0x54')]){throw new Error(_0xe11f('0x55'));}})[_0xe11f('0x22')](function(){if(_0x3aa0e6){return db[_0xe11f('0x40')][_0xe11f('0x4b')]({'where':{'membername':_0x3aa0e6[_0xe11f('0x26')]},'individualHooks':!![]});}})['then'](function(){if(_0x3aa0e6){return _0x3aa0e6[_0xe11f('0x56')]({'raw':!![]});}})[_0xe11f('0x22')](function(_0x37db51){if(_0x3aa0e6){if(_0x37db51){var _0x21c872=[];_0x13b6fc=_0x37db51;if(_0x13b6fc['length']){for(var _0x38cbc7=0x0;_0x38cbc7<_0x13b6fc[_0xe11f('0x2c')];_0x38cbc7++){_0x21c872[_0xe11f('0x32')](db[_0xe11f('0x40')][_0xe11f('0x57')]({'membername':_0x3aa0e6[_0xe11f('0x26')],'UserId':_0x3aa0e6['id'],'queue_name':_0x13b6fc[_0x38cbc7][_0xe11f('0x26')],'VoiceQueueId':_0x13b6fc[_0x38cbc7]['id'],'interface':_0x48c856,'paused':_0x3aa0e6['loginInPause']||![],'penalty':_0x13b6fc[_0x38cbc7][_0xe11f('0x58')]||0x0}));}return BPromise['all'](_0x21c872);}}}})['then'](function(){if(_0x3aa0e6){return db[_0xe11f('0x29')][_0xe11f('0x2a')]({'where':{'membername':_0x3aa0e6[_0xe11f('0x26')],'exitAt':null}});}})[_0xe11f('0x22')](function(_0x36b8a8){if(_0x3aa0e6){if(_0x36b8a8&&_0x36b8a8[_0xe11f('0x2c')]){var _0x5826bb=[];_0x36b8a8[_0xe11f('0x31')](function(_0x23bcce){_0x5826bb[_0xe11f('0x32')](_0x23bcce['update']({'exitAt':moment()[_0xe11f('0x2d')](_0xe11f('0x2e'))}));});return BPromise[_0xe11f('0x49')](_0x5826bb);}}})['then'](function(_0x2be7d6){if(_0x3aa0e6){var _0x3f6d53=[];var _0x1ab29f=[];var _0x24301e=utils['getChannels']();var _0x5b0421={'membername':_0x3aa0e6['name'],'interface':_0x48c856,'enterAt':moment()[_0xe11f('0x2d')](_0xe11f('0x2e')),'role':_0x3aa0e6[_0xe11f('0x27')],'internal':_0x3aa0e6[_0xe11f('0x28')]};_0x24301e[_0xe11f('0x31')](function(_0x32e388){_0x3f6d53[_0xe11f('0x32')](_['merge']({'channel':_0x32e388,'type':_0xe11f('0x59'),'data1':_0xe11f('0x5a'),'data2':_0x48c856},_0x5b0421));if(_0x3aa0e6[_0xe11f('0x4f')]){_0x1ab29f[_0xe11f('0x32')](_[_0xe11f('0x5b')]({'channel':_0x32e388,'type':_0xe11f('0x2b'),'data1':_0xe11f('0x5c')},_0x5b0421));}});return db[_0xe11f('0x29')][_0xe11f('0x3a')](_0x3f6d53[_0xe11f('0x5d')](_0x1ab29f),{'individualHooks':!![]});}})[_0xe11f('0x22')](function(){if(_0x3aa0e6){return _0x3aa0e6[_0xe11f('0x3b')]({'online':!![],'lastLoginAt':moment()[_0xe11f('0x2d')](_0xe11f('0x2e')),'voicePause':_0x3aa0e6['loginInPause']||![],'mailPause':_0x3aa0e6[_0xe11f('0x4f')]||![],'chatPause':_0x3aa0e6[_0xe11f('0x4f')]||![],'faxPause':_0x3aa0e6[_0xe11f('0x4f')]||![],'smsPause':_0x3aa0e6[_0xe11f('0x4f')]||![],'openchannelPause':_0x3aa0e6['loginInPause']||![],'pauseType':_0x3aa0e6[_0xe11f('0x4f')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xe11f('0x2d')](_0xe11f('0x2e')),'interface':_0x48c856});}})[_0xe11f('0x22')](function(_0x242406){_0x2730d7(_0x242406);})[_0xe11f('0x17')](function(_0x3cca00){_0x24158f(_0x46a36a['error'](0x1f4,_0x3cca00['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 9cbc98b..373e8ac 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 _0xaf98=['./user.events','save','remove','update','emit','register','length','user:'];(function(_0x15d452,_0xf01b1d){var _0x2d226b=function(_0x47e1d4){while(--_0x47e1d4){_0x15d452['push'](_0x15d452['shift']());}};_0x2d226b(++_0xf01b1d);}(_0xaf98,0xa8));var _0x8af9=function(_0x5aa7df,_0x5d1e4c){_0x5aa7df=_0x5aa7df-0x0;var _0x2287be=_0xaf98[_0x5aa7df];return _0x2287be;};'use strict';var UserEvents=require(_0x8af9('0x0'));var events=[_0x8af9('0x1'),_0x8af9('0x2'),_0x8af9('0x3')];function createListener(_0x391d2a,_0x54c6fe){return function(_0x5656fb){_0x54c6fe[_0x8af9('0x4')](_0x391d2a,_0x5656fb);};}function removeListener(_0x2a5ba1,_0x4b91ed){return function(){UserEvents['removeListener'](_0x2a5ba1,_0x4b91ed);};}exports[_0x8af9('0x5')]=function(_0x157f9f){for(var _0x4e34d2=0x0,_0x30aaa2=events[_0x8af9('0x6')];_0x4e34d2<_0x30aaa2;_0x4e34d2++){var _0x215be5=events[_0x4e34d2];var _0x5ebf83=createListener(_0x8af9('0x7')+_0x215be5,_0x157f9f);UserEvents['on'](_0x215be5,_0x5ebf83);}}; \ No newline at end of file +var _0x9dbf=['save','remove','emit','removeListener','register','length'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0x9dbf,0x72));var _0xf9db=function(_0x40e437,_0x808574){_0x40e437=_0x40e437-0x0;var _0x1bb5d6=_0x9dbf[_0x40e437];return _0x1bb5d6;};'use strict';var UserEvents=require('./user.events');var events=[_0xf9db('0x0'),_0xf9db('0x1'),'update'];function createListener(_0x435caa,_0x1ed3b9){return function(_0x30f937){_0x1ed3b9[_0xf9db('0x2')](_0x435caa,_0x30f937);};}function removeListener(_0x31c1be,_0x4bcf24){return function(){UserEvents[_0xf9db('0x3')](_0x31c1be,_0x4bcf24);};}exports[_0xf9db('0x4')]=function(_0x5278c2){for(var _0x4c2783=0x0,_0x239a86=events[_0xf9db('0x5')];_0x4c2783<_0x239a86;_0x4c2783++){var _0x4c52d1=events[_0x4c2783];var _0x5e3c52=createListener('user:'+_0x4c52d1,_0x5278c2);UserEvents['on'](_0x4c52d1,_0x5e3c52);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 182a15f..d8560b7 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 _0xd983=['../../config/environment','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x425a74,_0x205822){var _0x191e87=function(_0x307bb5){while(--_0x307bb5){_0x425a74['push'](_0x425a74['shift']());}};_0x191e87(++_0x205822);}(_0xd983,0x1df));var _0x3d98=function(_0xd508cf,_0x308f24){_0xd508cf=_0xd508cf-0x0;var _0x1fd7f8=_0xd983[_0xd508cf];return _0x1fd7f8;};'use strict';var multer=require(_0x3d98('0x0'));var util=require(_0x3d98('0x1'));var path=require(_0x3d98('0x2'));var timeout=require(_0x3d98('0x3'));var express=require(_0x3d98('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3d98('0x5'));var interaction=require(_0x3d98('0x6'));var config=require(_0x3d98('0x7'));module[_0x3d98('0x8')]=router; \ No newline at end of file +var _0xcb10=['fs-extra','../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout','express'];(function(_0x20f5ae,_0xb1470a){var _0x23750d=function(_0x430a64){while(--_0x430a64){_0x20f5ae['push'](_0x20f5ae['shift']());}};_0x23750d(++_0xb1470a);}(_0xcb10,0x104));var _0x0cb1=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xcb10[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x0cb1('0x0'));var util=require(_0x0cb1('0x1'));var path=require('path');var timeout=require(_0x0cb1('0x2'));var express=require(_0x0cb1('0x3'));var router=express['Router']();var fs_extra=require(_0x0cb1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0cb1('0x5'));var config=require(_0x0cb1('0x6'));module[_0x0cb1('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index c26ddc4..04c7494 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 _0xbaf0=['exports','INTEGER'];(function(_0x3df1e9,_0x3cd30e){var _0xd6b371=function(_0x4b5457){while(--_0x4b5457){_0x3df1e9['push'](_0x3df1e9['shift']());}};_0xd6b371(++_0x3cd30e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x1e8b1e,_0x407bbd){var _0x4a0fde=function(_0x4fd2be){while(--_0x4fd2be){_0x1e8b1e['push'](_0x1e8b1e['shift']());}};_0x4a0fde(++_0x407bbd);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'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/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 0651af9..70f972b 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 _0x9960=['exports','define','user_has_chat_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x9960,0x147));var _0x0996=function(_0x12bd33,_0x5c1cf8){_0x12bd33=_0x12bd33-0x0;var _0x4f294b=_0x9960[_0x12bd33];return _0x4f294b;};'use strict';var _=require(_0x0996('0x0'));var util=require(_0x0996('0x1'));var logger=require(_0x0996('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0996('0x3'));var rp=require(_0x0996('0x4'));var fs=require('fs');var path=require(_0x0996('0x5'));var rimraf=require(_0x0996('0x6'));var config=require(_0x0996('0x7'));var attributes=require(_0x0996('0x8'));module[_0x0996('0x9')]=function(_0x499b2f,_0x5718e4){return _0x499b2f[_0x0996('0xa')]('UserChatQueue',attributes,{'tableName':_0x0996('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd90f=['define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes','exports'];(function(_0xf0a713,_0x2a1926){var _0x126655=function(_0xafaa9f){while(--_0xafaa9f){_0xf0a713['push'](_0xf0a713['shift']());}};_0x126655(++_0x2a1926);}(_0xd90f,0xf5));var _0xfd90=function(_0xad314b,_0x214404){_0xad314b=_0xad314b-0x0;var _0x42971a=_0xd90f[_0xad314b];return _0x42971a;};'use strict';var _=require(_0xfd90('0x0'));var util=require('util');var logger=require(_0xfd90('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfd90('0x2'));var rp=require(_0xfd90('0x3'));var fs=require('fs');var path=require(_0xfd90('0x4'));var rimraf=require('rimraf');var config=require(_0xfd90('0x5'));var attributes=require(_0xfd90('0x6'));module[_0xfd90('0x7')]=function(_0x2ff796,_0x501d10){return _0x2ff796[_0xfd90('0x8')](_0xfd90('0x9'),attributes,{'tableName':_0xfd90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index d86a0a0..d20b5c8 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 _0xd265=['UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd265,0x9b));var _0x5d26=function(_0x29b96f,_0x54b5ed){_0x29b96f=_0x29b96f-0x0;var _0x9e7496=_0xd265[_0x29b96f];return _0x9e7496;};'use strict';var _=require(_0x5d26('0x0'));var util=require(_0x5d26('0x1'));var moment=require('moment');var BPromise=require(_0x5d26('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d26('0x3'));var db=require(_0x5d26('0x4'))['db'];var utils=require(_0x5d26('0x5'));var logger=require('../../config/logger')(_0x5d26('0x6'));var config=require(_0x5d26('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d26('0x8')][_0x5d26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20d245,_0x3bcbd0,_0x24ca7f){return new BPromise(function(_0x8577c2,_0x2e363b){return client[_0x5d26('0xa')](_0x20d245,_0x24ca7f)[_0x5d26('0xb')](function(_0x1a187b){logger[_0x5d26('0xc')](_0x5d26('0xd'),_0x3bcbd0,_0x5d26('0xe'));logger['debug'](_0x5d26('0xf'),_0x3bcbd0,'request\x20sent',JSON[_0x5d26('0x10')](_0x1a187b));if(_0x1a187b[_0x5d26('0x11')]){if(_0x1a187b[_0x5d26('0x11')]['code']===0x1f4){logger[_0x5d26('0x11')](_0x5d26('0xd'),_0x3bcbd0,_0x1a187b[_0x5d26('0x11')][_0x5d26('0x12')]);return _0x2e363b(_0x1a187b['error'][_0x5d26('0x12')]);}logger[_0x5d26('0x11')](_0x5d26('0xd'),_0x3bcbd0,_0x1a187b['error'][_0x5d26('0x12')]);return _0x8577c2(_0x1a187b[_0x5d26('0x11')][_0x5d26('0x12')]);}else{logger[_0x5d26('0xc')](_0x5d26('0xd'),_0x3bcbd0,_0x5d26('0xe'));_0x8577c2(_0x1a187b[_0x5d26('0x13')][_0x5d26('0x12')]);}})[_0x5d26('0x14')](function(_0x508267){logger[_0x5d26('0x11')](_0x5d26('0xd'),_0x3bcbd0,_0x508267);_0x2e363b(_0x508267);});});} \ No newline at end of file +var _0x4305=['randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','UserChatQueue,\x20%s,\x20%s','message','result','lodash','moment','bluebird'];(function(_0x332232,_0x2d62ec){var _0xe2594d=function(_0x3d606d){while(--_0x3d606d){_0x332232['push'](_0x332232['shift']());}};_0xe2594d(++_0x2d62ec);}(_0x4305,0x6f));var _0x5430=function(_0x526786,_0x105cbf){_0x526786=_0x526786-0x0;var _0x3a512d=_0x4305[_0x526786];return _0x3a512d;};'use strict';var _=require(_0x5430('0x0'));var util=require('util');var moment=require(_0x5430('0x1'));var BPromise=require(_0x5430('0x2'));var rs=require(_0x5430('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5430('0x4'));var logger=require('../../config/logger')(_0x5430('0x5'));var config=require(_0x5430('0x6'));var jayson=require(_0x5430('0x7'));var client=jayson['client'][_0x5430('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5591f4,_0x4f27c1,_0x1ab4fc){return new BPromise(function(_0x181d8f,_0x22f8b8){return client[_0x5430('0x9')](_0x5591f4,_0x1ab4fc)[_0x5430('0xa')](function(_0x22a566){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x4f27c1,_0x5430('0xb'));logger[_0x5430('0xc')](_0x5430('0xd'),_0x4f27c1,'request\x20sent',JSON['stringify'](_0x22a566));if(_0x22a566[_0x5430('0xe')]){if(_0x22a566[_0x5430('0xe')][_0x5430('0xf')]===0x1f4){logger['error'](_0x5430('0x10'),_0x4f27c1,_0x22a566[_0x5430('0xe')][_0x5430('0x11')]);return _0x22f8b8(_0x22a566[_0x5430('0xe')]['message']);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x4f27c1,_0x22a566[_0x5430('0xe')]['message']);return _0x181d8f(_0x22a566[_0x5430('0xe')][_0x5430('0x11')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x4f27c1,_0x5430('0xb'));_0x181d8f(_0x22a566[_0x5430('0x12')][_0x5430('0x11')]);}})['catch'](function(_0x171b77){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x4f27c1,_0x171b77);_0x22f8b8(_0x171b77);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index c2c561b..d1fd6cd 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 _0x74fd=['../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x368585,_0x14a760){var _0x2fc865=function(_0x58d12c){while(--_0x58d12c){_0x368585['push'](_0x368585['shift']());}};_0x2fc865(++_0x14a760);}(_0x74fd,0x8f));var _0xd74f=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0x74fd[_0x2bcb75];return _0x175345;};'use strict';var multer=require(_0xd74f('0x0'));var util=require('util');var path=require(_0xd74f('0x1'));var timeout=require(_0xd74f('0x2'));var express=require(_0xd74f('0x3'));var router=express[_0xd74f('0x4')]();var fs_extra=require(_0xd74f('0x5'));var auth=require(_0xd74f('0x6'));var interaction=require(_0xd74f('0x7'));var config=require(_0xd74f('0x8'));module[_0xd74f('0x9')]=router; \ No newline at end of file +var _0x75ea=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x1b8c71,_0x41d8ab){var _0x539905=function(_0x395edd){while(--_0x395edd){_0x1b8c71['push'](_0x1b8c71['shift']());}};_0x539905(++_0x41d8ab);}(_0x75ea,0x7d));var _0xa75e=function(_0x1521a8,_0x512e06){_0x1521a8=_0x1521a8-0x0;var _0x4b07ad=_0x75ea[_0x1521a8];return _0x4b07ad;};'use strict';var multer=require(_0xa75e('0x0'));var util=require(_0xa75e('0x1'));var path=require('path');var timeout=require(_0xa75e('0x2'));var express=require(_0xa75e('0x3'));var router=express['Router']();var fs_extra=require(_0xa75e('0x4'));var auth=require(_0xa75e('0x5'));var interaction=require(_0xa75e('0x6'));var config=require(_0xa75e('0x7'));module[_0xa75e('0x8')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 46b2ad6..8dbe466 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 _0x7916=['sequelize','INTEGER'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x7916,0x128));var _0x6791=function(_0x2be8ef,_0x329f58){_0x2be8ef=_0x2be8ef-0x0;var _0x3e6c53=_0x7916[_0x2be8ef];return _0x3e6c53;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6791('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6791('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0abf=['sequelize','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0abf,0xe8));var _0xf0ab=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0abf[_0x6131cd];return _0x47e916;};'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 efa1a1e..50cd3f6 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 _0x2dca=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util'];(function(_0x11b0e9,_0x3af9bd){var _0x56de6a=function(_0x12bfa7){while(--_0x12bfa7){_0x11b0e9['push'](_0x11b0e9['shift']());}};_0x56de6a(++_0x3af9bd);}(_0x2dca,0xdb));var _0xa2dc=function(_0x493a51,_0x45128c){_0x493a51=_0x493a51-0x0;var _0xc85756=_0x2dca[_0x493a51];return _0xc85756;};'use strict';var _=require(_0xa2dc('0x0'));var util=require(_0xa2dc('0x1'));var logger=require(_0xa2dc('0x2'))('api');var moment=require(_0xa2dc('0x3'));var BPromise=require(_0xa2dc('0x4'));var rp=require(_0xa2dc('0x5'));var fs=require('fs');var path=require(_0xa2dc('0x6'));var rimraf=require('rimraf');var config=require(_0xa2dc('0x7'));var attributes=require(_0xa2dc('0x8'));module[_0xa2dc('0x9')]=function(_0x50c3b5,_0x37ba2a){return _0x50c3b5[_0xa2dc('0xa')](_0xa2dc('0xb'),attributes,{'tableName':_0xa2dc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff1e=['UserFaxQueue','user_has_fax_queues','util','api','bluebird','request-promise','./userFaxQueue.attributes','exports','define'];(function(_0x4dd7bb,_0x409176){var _0xbc91e8=function(_0x28690e){while(--_0x28690e){_0x4dd7bb['push'](_0x4dd7bb['shift']());}};_0xbc91e8(++_0x409176);}(_0xff1e,0x146));var _0xeff1=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xff1e[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0xeff1('0x0'));var logger=require('../../config/logger')(_0xeff1('0x1'));var moment=require('moment');var BPromise=require(_0xeff1('0x2'));var rp=require(_0xeff1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeff1('0x4'));module[_0xeff1('0x5')]=function(_0x1ed4cc,_0x7fa0fc){return _0x1ed4cc[_0xeff1('0x6')](_0xeff1('0x7'),attributes,{'tableName':_0xeff1('0x8'),'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 7987d37..1ee0792 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 _0xd7f6=['ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x2a6ba5,_0x265fcd){var _0x22b1c5=function(_0xbcbbaf){while(--_0xbcbbaf){_0x2a6ba5['push'](_0x2a6ba5['shift']());}};_0x22b1c5(++_0x265fcd);}(_0xd7f6,0x154));var _0x6d7f=function(_0x13a0c6,_0x39f6c0){_0x13a0c6=_0x13a0c6-0x0;var _0x424ed8=_0xd7f6[_0x13a0c6];return _0x424ed8;};'use strict';var _=require(_0x6d7f('0x0'));var util=require(_0x6d7f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d7f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d7f('0x3'));var logger=require(_0x6d7f('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6d7f('0x5'));var client=jayson['client'][_0x6d7f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2c3c60,_0x791713,_0x24cd09){return new BPromise(function(_0xab05bf,_0x564832){return client[_0x6d7f('0x7')](_0x2c3c60,_0x24cd09)[_0x6d7f('0x8')](function(_0x2c57c5){logger[_0x6d7f('0x9')]('UserFaxQueue,\x20%s,\x20%s',_0x791713,'request\x20sent');logger['debug'](_0x6d7f('0xa'),_0x791713,_0x6d7f('0xb'),JSON[_0x6d7f('0xc')](_0x2c57c5));if(_0x2c57c5[_0x6d7f('0xd')]){if(_0x2c57c5[_0x6d7f('0xd')]['code']===0x1f4){logger[_0x6d7f('0xd')](_0x6d7f('0xe'),_0x791713,_0x2c57c5['error'][_0x6d7f('0xf')]);return _0x564832(_0x2c57c5[_0x6d7f('0xd')]['message']);}logger[_0x6d7f('0xd')](_0x6d7f('0xe'),_0x791713,_0x2c57c5[_0x6d7f('0xd')][_0x6d7f('0xf')]);return _0xab05bf(_0x2c57c5[_0x6d7f('0xd')][_0x6d7f('0xf')]);}else{logger[_0x6d7f('0x9')](_0x6d7f('0xe'),_0x791713,'request\x20sent');_0xab05bf(_0x2c57c5[_0x6d7f('0x10')]['message']);}})[_0x6d7f('0x11')](function(_0x4439be){logger[_0x6d7f('0xd')](_0x6d7f('0xe'),_0x791713,_0x4439be);_0x564832(_0x4439be);});});} \ No newline at end of file +var _0x9a8f=['ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a8f,0x1df));var _0xf9a8=function(_0x316b26,_0x2b1bc8){_0x316b26=_0x316b26-0x0;var _0xb88872=_0x9a8f[_0x316b26];return _0xb88872;};'use strict';var _=require('lodash');var util=require(_0xf9a8('0x0'));var moment=require(_0xf9a8('0x1'));var BPromise=require(_0xf9a8('0x2'));var rs=require(_0xf9a8('0x3'));var fs=require('fs');var Redis=require(_0xf9a8('0x4'));var db=require(_0xf9a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf9a8('0x6'));var jayson=require(_0xf9a8('0x7'));var client=jayson[_0xf9a8('0x8')][_0xf9a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48237d,_0x221b25,_0x39696c){return new BPromise(function(_0x48c2a5,_0x30ba3f){return client['request'](_0x48237d,_0x39696c)[_0xf9a8('0xa')](function(_0x5efb07){logger[_0xf9a8('0xb')](_0xf9a8('0xc'),_0x221b25,'request\x20sent');logger[_0xf9a8('0xd')](_0xf9a8('0xe'),_0x221b25,_0xf9a8('0xf'),JSON[_0xf9a8('0x10')](_0x5efb07));if(_0x5efb07['error']){if(_0x5efb07['error']['code']===0x1f4){logger[_0xf9a8('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x221b25,_0x5efb07['error'][_0xf9a8('0x12')]);return _0x30ba3f(_0x5efb07['error'][_0xf9a8('0x12')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x221b25,_0x5efb07[_0xf9a8('0x11')][_0xf9a8('0x12')]);return _0x48c2a5(_0x5efb07[_0xf9a8('0x11')]['message']);}else{logger[_0xf9a8('0xb')](_0xf9a8('0xc'),_0x221b25,_0xf9a8('0xf'));_0x48c2a5(_0x5efb07[_0xf9a8('0x13')][_0xf9a8('0x12')]);}})[_0xf9a8('0x14')](function(_0x27e1db){logger[_0xf9a8('0x11')](_0xf9a8('0xc'),_0x221b25,_0x27e1db);_0x30ba3f(_0x27e1db);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 7a35ded..fc03dd3 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 _0xdb94=['fs-extra','../../components/auth/service','exports','multer','util','path','connect-timeout','express'];(function(_0x2dbce1,_0x1fb9c6){var _0x477017=function(_0x447baf){while(--_0x447baf){_0x2dbce1['push'](_0x2dbce1['shift']());}};_0x477017(++_0x1fb9c6);}(_0xdb94,0xab));var _0x4db9=function(_0x24a01c,_0x1f84fc){_0x24a01c=_0x24a01c-0x0;var _0x2920a8=_0xdb94[_0x24a01c];return _0x2920a8;};'use strict';var multer=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var path=require(_0x4db9('0x2'));var timeout=require(_0x4db9('0x3'));var express=require(_0x4db9('0x4'));var router=express['Router']();var fs_extra=require(_0x4db9('0x5'));var auth=require(_0x4db9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x4db9('0x7')]=router; \ No newline at end of file +var _0x49db=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x4e9e46,_0x4f49cf){var _0x5de19c=function(_0x414b1d){while(--_0x414b1d){_0x4e9e46['push'](_0x4e9e46['shift']());}};_0x5de19c(++_0x4f49cf);}(_0x49db,0xc5));var _0xb49d=function(_0x410d61,_0x12ea99){_0x410d61=_0x410d61-0x0;var _0x57e20f=_0x49db[_0x410d61];return _0x57e20f;};'use strict';var multer=require(_0xb49d('0x0'));var util=require(_0xb49d('0x1'));var path=require(_0xb49d('0x2'));var timeout=require(_0xb49d('0x3'));var express=require(_0xb49d('0x4'));var router=express['Router']();var fs_extra=require(_0xb49d('0x5'));var auth=require(_0xb49d('0x6'));var interaction=require(_0xb49d('0x7'));var config=require('../../config/environment');module[_0xb49d('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 805f244..132d645 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x23535e,_0x4de969){var _0x50f005=function(_0x161077){while(--_0x161077){_0x23535e['push'](_0x23535e['shift']());}};_0x50f005(++_0x4de969);}(_0xe706,0xa3));var _0x6e70=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0xe706[_0x58afd5];return _0x3e503b;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x3accf9,_0x3e22b2){var _0x5ba536=function(_0x2a4cf4){while(--_0x2a4cf4){_0x3accf9['push'](_0x3accf9['shift']());}};_0x5ba536(++_0x3e22b2);}(_0xe706,0xa3));var _0x6e70=function(_0x2563e4,_0x456262){_0x2563e4=_0x2563e4-0x0;var _0x53e6d8=_0xe706[_0x2563e4];return _0x53e6d8;};'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 9efe991..78eb54c 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','../../config/logger'];(function(_0x4c3ece,_0x57053e){var _0x409c1d=function(_0x411a3b){while(--_0x411a3b){_0x4c3ece['push'](_0x4c3ece['shift']());}};_0x409c1d(++_0x57053e);}(_0xb10b,0x12a));var _0xbb10=function(_0x1de4b8,_0x529b41){_0x1de4b8=_0x1de4b8-0x0;var _0x557699=_0xb10b[_0x1de4b8];return _0x557699;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('UserMailQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5d5660,_0x55f04d){var _0x5348c8=function(_0x59b416){while(--_0x59b416){_0x5d5660['push'](_0x5d5660['shift']());}};_0x5348c8(++_0x55f04d);}(_0xe706,0xa3));var _0x6e70=function(_0x5991d7,_0x3ca7f8){_0x5991d7=_0x5991d7-0x0;var _0x5b299d=_0xe706[_0x5991d7];return _0x5b299d;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 5589d5e..021f889 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 _0xee87=['message','result','catch','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xee87,0x193));var _0x7ee8=function(_0x437fc4,_0x46ac1e){_0x437fc4=_0x437fc4-0x0;var _0x5ef891=_0xee87[_0x437fc4];return _0x5ef891;};'use strict';var _=require('lodash');var util=require(_0x7ee8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ee8('0x1'));var db=require(_0x7ee8('0x2'))['db'];var utils=require(_0x7ee8('0x3'));var logger=require('../../config/logger')(_0x7ee8('0x4'));var config=require(_0x7ee8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7ee8('0x6')][_0x7ee8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2fe0fb,_0x3ac05f,_0x43df79){return new BPromise(function(_0x346771,_0x2d26bd){return client[_0x7ee8('0x8')](_0x2fe0fb,_0x43df79)[_0x7ee8('0x9')](function(_0x4d193a){logger[_0x7ee8('0xa')](_0x7ee8('0xb'),_0x3ac05f,_0x7ee8('0xc'));logger['debug'](_0x7ee8('0xd'),_0x3ac05f,_0x7ee8('0xc'),JSON[_0x7ee8('0xe')](_0x4d193a));if(_0x4d193a[_0x7ee8('0xf')]){if(_0x4d193a['error'][_0x7ee8('0x10')]===0x1f4){logger[_0x7ee8('0xf')](_0x7ee8('0xb'),_0x3ac05f,_0x4d193a[_0x7ee8('0xf')][_0x7ee8('0x11')]);return _0x2d26bd(_0x4d193a[_0x7ee8('0xf')][_0x7ee8('0x11')]);}logger[_0x7ee8('0xf')](_0x7ee8('0xb'),_0x3ac05f,_0x4d193a[_0x7ee8('0xf')][_0x7ee8('0x11')]);return _0x346771(_0x4d193a[_0x7ee8('0xf')][_0x7ee8('0x11')]);}else{logger[_0x7ee8('0xa')](_0x7ee8('0xb'),_0x3ac05f,_0x7ee8('0xc'));_0x346771(_0x4d193a[_0x7ee8('0x12')][_0x7ee8('0x11')]);}})[_0x7ee8('0x13')](function(_0x3b2c7e){logger['error'](_0x7ee8('0xb'),_0x3ac05f,_0x3b2c7e);_0x2d26bd(_0x3b2c7e);});});} \ No newline at end of file +var _0x3981=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x14afa3,_0xc86e65){var _0x5008ef=function(_0x4bfe25){while(--_0x4bfe25){_0x14afa3['push'](_0x14afa3['shift']());}};_0x5008ef(++_0xc86e65);}(_0x3981,0x144));var _0x1398=function(_0x39fba7,_0x11268c){_0x39fba7=_0x39fba7-0x0;var _0x488ed2=_0x3981[_0x39fba7];return _0x488ed2;};'use strict';var _=require(_0x1398('0x0'));var util=require('util');var moment=require(_0x1398('0x1'));var BPromise=require(_0x1398('0x2'));var rs=require(_0x1398('0x3'));var fs=require('fs');var Redis=require(_0x1398('0x4'));var db=require(_0x1398('0x5'))['db'];var utils=require(_0x1398('0x6'));var logger=require(_0x1398('0x7'))(_0x1398('0x8'));var config=require(_0x1398('0x9'));var jayson=require(_0x1398('0xa'));var client=jayson[_0x1398('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x216064,_0xdc7d88,_0x40e860){return new BPromise(function(_0x51dd7f,_0x3bb7c7){return client[_0x1398('0xc')](_0x216064,_0x40e860)[_0x1398('0xd')](function(_0x2c1da9){logger[_0x1398('0xe')](_0x1398('0xf'),_0xdc7d88,'request\x20sent');logger[_0x1398('0x10')](_0x1398('0x11'),_0xdc7d88,_0x1398('0x12'),JSON[_0x1398('0x13')](_0x2c1da9));if(_0x2c1da9[_0x1398('0x14')]){if(_0x2c1da9[_0x1398('0x14')][_0x1398('0x15')]===0x1f4){logger[_0x1398('0x14')](_0x1398('0xf'),_0xdc7d88,_0x2c1da9[_0x1398('0x14')]['message']);return _0x3bb7c7(_0x2c1da9[_0x1398('0x14')][_0x1398('0x16')]);}logger[_0x1398('0x14')](_0x1398('0xf'),_0xdc7d88,_0x2c1da9['error']['message']);return _0x51dd7f(_0x2c1da9['error'][_0x1398('0x16')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xdc7d88,'request\x20sent');_0x51dd7f(_0x2c1da9[_0x1398('0x17')]['message']);}})[_0x1398('0x18')](function(_0x255a40){logger[_0x1398('0x14')](_0x1398('0xf'),_0xdc7d88,_0x255a40);_0x3bb7c7(_0x255a40);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index b450fd4..8c0aca7 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9350=['../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2782c1,_0xcd0398){var _0x43c822=function(_0x23e452){while(--_0x23e452){_0x2782c1['push'](_0x2782c1['shift']());}};_0x43c822(++_0xcd0398);}(_0x9350,0x199));var _0x0935=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0x9350[_0x1e48d3];return _0x2852b1;};'use strict';var multer=require('multer');var util=require(_0x0935('0x0'));var path=require('path');var timeout=require(_0x0935('0x1'));var express=require(_0x0935('0x2'));var router=express[_0x0935('0x3')]();var fs_extra=require(_0x0935('0x4'));var auth=require(_0x0935('0x5'));var interaction=require(_0x0935('0x6'));var config=require(_0x0935('0x7'));var controller=require(_0x0935('0x8'));router[_0x0935('0x9')]('/',auth[_0x0935('0xa')](),controller[_0x0935('0xb')]);module[_0x0935('0xc')]=router; \ No newline at end of file +var _0x596b=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports'];(function(_0x1e5bc9,_0x38d171){var _0x20a1ad=function(_0x24a35c){while(--_0x24a35c){_0x1e5bc9['push'](_0x1e5bc9['shift']());}};_0x20a1ad(++_0x38d171);}(_0x596b,0x1b0));var _0xb596=function(_0x38cb06,_0x3e397c){_0x38cb06=_0x38cb06-0x0;var _0x23e537=_0x596b[_0x38cb06];return _0x23e537;};'use strict';var multer=require(_0xb596('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb596('0x1'));var express=require(_0xb596('0x2'));var router=express[_0xb596('0x3')]();var fs_extra=require(_0xb596('0x4'));var auth=require(_0xb596('0x5'));var interaction=require(_0xb596('0x6'));var config=require('../../config/environment');var controller=require(_0xb596('0x7'));router[_0xb596('0x8')]('/',auth[_0xb596('0x9')](),controller[_0xb596('0xa')]);module[_0xb596('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index cca9b52..cbef6ff 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcdd2=['TEXT','STRING','BOOLEAN','exports'];(function(_0xda8188,_0x1729aa){var _0x14815c=function(_0x296496){while(--_0x296496){_0xda8188['push'](_0xda8188['shift']());}};_0x14815c(++_0x1729aa);}(_0xcdd2,0xef));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x2cdd('0x0')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x2cdd('0x1')]},'recipientsDescription':{'type':Sequelize[_0x2cdd('0x2')]},'beep':{'type':Sequelize[_0x2cdd('0x3')]}}; \ No newline at end of file +var _0x1aaf=['STRING','sequelize','exports','TEXT'];(function(_0x589017,_0x2274ac){var _0x3cc411=function(_0x2d75c4){while(--_0x2d75c4){_0x589017['push'](_0x589017['shift']());}};_0x3cc411(++_0x2274ac);}(_0x1aaf,0x1c1));var _0xf1aa=function(_0x4ee663,_0x228cb3){_0x4ee663=_0x4ee663-0x0;var _0x5bf953=_0x1aaf[_0x4ee663];return _0x5bf953;};'use strict';var Sequelize=require(_0xf1aa('0x0'));module[_0xf1aa('0x1')]={'body':{'type':Sequelize[_0xf1aa('0x2')]},'senderName':{'type':Sequelize[_0xf1aa('0x3')]},'recipientsId':{'type':Sequelize[_0xf1aa('0x2')]},'recipientsDescription':{'type':Sequelize[_0xf1aa('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 5b27a7d..1490514 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7f4=['./userNotification.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','name','send','sendUserNotification','body','hasOwnProperty','text','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','faxqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','startCase','User','union','queue','replace','Queue','push','all','map','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0x6caa3e,_0x14cafc){var _0x58176d=function(_0xd61861){while(--_0xd61861){_0x6caa3e['push'](_0x6caa3e['shift']());}};_0x58176d(++_0x14cafc);}(_0xa7f4,0xa7));var _0x4a7f=function(_0x562817,_0x399b2e){_0x562817=_0x562817-0x0;var _0x2fa3e8=_0xa7f4[_0x562817];return _0x2fa3e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a7f('0x0'));var zipdir=require(_0x4a7f('0x1'));var jsonpatch=require(_0x4a7f('0x2'));var rp=require(_0x4a7f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4a7f('0x4'));var util=require(_0x4a7f('0x5'));var path=require(_0x4a7f('0x6'));var sox=require(_0x4a7f('0x7'));var csv=require(_0x4a7f('0x8'));var ejs=require(_0x4a7f('0x9'));var fs=require('fs');var fs_extra=require(_0x4a7f('0xa'));var _=require(_0x4a7f('0xb'));var squel=require(_0x4a7f('0xc'));var crypto=require(_0x4a7f('0xd'));var jsforce=require(_0x4a7f('0xe'));var deskjs=require(_0x4a7f('0xf'));var toCsv=require(_0x4a7f('0x8'));var querystring=require(_0x4a7f('0x10'));var Papa=require(_0x4a7f('0x11'));var Redis=require(_0x4a7f('0x12'));var authService=require(_0x4a7f('0x13'));var qs=require(_0x4a7f('0x14'));var as=require(_0x4a7f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a7f('0x16'))(_0x4a7f('0x17'));var utils=require(_0x4a7f('0x18'));var config=require(_0x4a7f('0x19'));var licenseUtil=require(_0x4a7f('0x1a'));var db=require(_0x4a7f('0x1b'))['db'];config[_0x4a7f('0x1c')]=_['defaults'](config[_0x4a7f('0x1c')],{'host':_0x4a7f('0x1d'),'port':0x18eb});var socket=require(_0x4a7f('0x1e'))(new Redis(config[_0x4a7f('0x1c')]));require(_0x4a7f('0x1f'))['register'](socket);function respondWithStatusCode(_0x13d210,_0x4fdc84){_0x4fdc84=_0x4fdc84||0xcc;return function(_0x48d086){if(_0x48d086){return _0x13d210[_0x4a7f('0x20')](_0x4fdc84);}return _0x13d210[_0x4a7f('0x21')](_0x4fdc84)[_0x4a7f('0x22')]();};}function respondWithResult(_0x21022f,_0x5f2054){_0x5f2054=_0x5f2054||0xc8;return function(_0x19404a){if(_0x19404a){return _0x21022f[_0x4a7f('0x21')](_0x5f2054)[_0x4a7f('0x23')](_0x19404a);}};}function respondWithFilteredResult(_0x330c04,_0x512298){return function(_0x215c2f){if(_0x215c2f){var _0x186cfb=typeof _0x512298[_0x4a7f('0x24')]===_0x4a7f('0x25')&&typeof _0x512298[_0x4a7f('0x26')]===_0x4a7f('0x25');var _0x228a1f=_0x215c2f[_0x4a7f('0x27')];var _0x432cf4=_0x186cfb?0x0:_0x512298['offset'];var _0x49d9e7=_0x186cfb?_0x215c2f[_0x4a7f('0x27')]:_0x512298[_0x4a7f('0x24')]+_0x512298['limit'];var _0x3175a7;if(_0x49d9e7>=_0x228a1f){_0x49d9e7=_0x228a1f;_0x3175a7=0xc8;}else{_0x3175a7=0xce;}_0x330c04['status'](_0x3175a7);return _0x330c04['set'](_0x4a7f('0x28'),_0x432cf4+'-'+_0x49d9e7+'/'+_0x228a1f)['json'](_0x215c2f);}return null;};}function patchUpdates(_0x1031b4){return function(_0x4f3a7c){try{jsonpatch['apply'](_0x4f3a7c,_0x1031b4,!![]);}catch(_0x462e70){return BPromise['reject'](_0x462e70);}return _0x4f3a7c['save']();};}function saveUpdates(_0x22cf47,_0x45ecf1){return function(_0x48f59d){if(_0x48f59d){return _0x48f59d[_0x4a7f('0x29')](_0x22cf47)[_0x4a7f('0x2a')](function(_0x533ddf){return _0x533ddf;});}return null;};}function removeEntity(_0x5daa69,_0x1f5f49){return function(_0x153042){if(_0x153042){return _0x153042[_0x4a7f('0x2b')]()[_0x4a7f('0x2a')](function(){_0x5daa69[_0x4a7f('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b4944,_0x8dcfbd){return function(_0xcc037e){if(!_0xcc037e){_0x2b4944['sendStatus'](0x194);}return _0xcc037e;};}function handleError(_0xc5af92,_0x2ed9ea){_0x2ed9ea=_0x2ed9ea||0x1f4;return function(_0x458c6b){logger[_0x4a7f('0x2c')](_0x458c6b['stack']);if(_0x458c6b['name']){delete _0x458c6b[_0x4a7f('0x2d')];}_0xc5af92['status'](_0x2ed9ea)[_0x4a7f('0x2e')](_0x458c6b);};}exports[_0x4a7f('0x2f')]=function(_0x29e563,_0x411c28,_0x3fc859){if(!_0x29e563[_0x4a7f('0x30')][_0x4a7f('0x31')](_0x4a7f('0x32'))&&!_0x29e563[_0x4a7f('0x30')][_0x4a7f('0x31')]('TemplateId')){throw new db['Sequelize']['ValidationError'](_0x4a7f('0x33'));}else{if(_0x29e563[_0x4a7f('0x30')][_0x4a7f('0x31')](_0x4a7f('0x34'))&&!_0x29e563['body'][_0x4a7f('0x31')](_0x4a7f('0x35'))){throw new db[(_0x4a7f('0x36'))][(_0x4a7f('0x37'))](_0x4a7f('0x38'));}if(!_0x29e563[_0x4a7f('0x30')][_0x4a7f('0x31')]('recipients')){throw new db['Sequelize'][(_0x4a7f('0x37'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x11e604=JSON[_0x4a7f('0x39')](_0x29e563[_0x4a7f('0x30')][_0x4a7f('0x3a')]);}catch(_0x5a15e6){logger[_0x4a7f('0x2c')](_0x5a15e6);throw new db[(_0x4a7f('0x36'))]['ValidationError'](_0x4a7f('0x3b'));}var _0x2b3c4a=['chatqueue',_0x4a7f('0x3c'),'mailqueue','openchannelqueue',_0x4a7f('0x3d'),_0x4a7f('0x3e'),_0x4a7f('0x3f'),_0x4a7f('0x40'),'user'];if(_[_0x4a7f('0x41')](_0x11e604,function(_0x302378){return!_[_0x4a7f('0x42')](_0x2b3c4a,_0x302378['model'][_0x4a7f('0x43')]());})){throw new db[(_0x4a7f('0x36'))]['ValidationError'](_0x4a7f('0x44'));}}}var _0x160720={};_0x160720[_0x4a7f('0x45')]=_0x29e563[_0x4a7f('0x30')][_0x4a7f('0x31')](_0x4a7f('0x45'))?_0x29e563['body'][_0x4a7f('0x45')]:_0x29e563['user'][_0x4a7f('0x46')];_0x160720[_0x4a7f('0x47')]=_[_0x4a7f('0x48')](_0x29e563[_0x4a7f('0x30')]['recipientsDescription'])?null:_0x29e563[_0x4a7f('0x30')][_0x4a7f('0x47')];_0x160720[_0x4a7f('0x49')]=_0x29e563['body'][_0x4a7f('0x49')]||![];_0x160720['SenderId']=_0x29e563['user']['id'];return getContent(_0x29e563[_0x4a7f('0x30')])[_0x4a7f('0x2a')](function(_0x4c901a){_0x160720[_0x4a7f('0x30')]=_0x4c901a;return getRecipients(_0x11e604);})['then'](function(_0x18353e){_0x160720[_0x4a7f('0x4a')]=_[_0x4a7f('0x4b')](_0x18353e)[_0x4a7f('0x4c')](',');return db[_0x4a7f('0x4d')][_0x4a7f('0x4e')](function(_0x1da2b5){return db[_0x4a7f('0x4f')][_0x4a7f('0x50')](_0x160720,{'raw':!![],'transaction':_0x1da2b5})[_0x4a7f('0x2a')](function(_0x361b64){var _0x4ea521={'sender':_0x160720[_0x4a7f('0x45')],'description':_0x160720['recipientsDescription'],'content':_0x160720['body'],'beep':_0x160720[_0x4a7f('0x49')]};_0x18353e['forEach'](function(_0x392636){_0x4ea521['recipient']=_0x392636;socket[_0x4a7f('0x51')](_0x4a7f('0x52'),_0x4ea521);});return _0x361b64;});});})[_0x4a7f('0x2a')](respondWithResult(_0x411c28,0xc9))[_0x4a7f('0x53')](handleError(_0x411c28,null));};function getContent(_0x22bd53){return new BPromise(function(_0x21285d,_0x3ec446){if(_0x22bd53['text']){_0x21285d(_0x22bd53[_0x4a7f('0x32')]);return;}return db[_0x4a7f('0x54')][_0x4a7f('0x55')]({'attributes':[_0x4a7f('0x56')],'where':{'id':_0x22bd53[_0x4a7f('0x34')]},'raw':!![]})[_0x4a7f('0x2a')](function(_0xab1bd){if(!_0xab1bd)throw new db[(_0x4a7f('0x36'))]['ValidationError'](_0x4a7f('0x57'));var _0x124419=Mustache[_0x4a7f('0x58')](_0xab1bd[_0x4a7f('0x56')],_0x22bd53[_0x4a7f('0x35')]);_0x21285d(_0x124419);})['catch'](function(_0x3fb22c){_0x3ec446(_0x3fb22c);});});}function getRecipients(_0x526150){return new BPromise(function(_0x754899,_0x3c5aac){var _0x2317d1=[];var _0x22893e=[];_0x526150[_0x4a7f('0x59')](function(_0x545262){var _0x12d5bf=_[_0x4a7f('0x5a')](_0x545262['model'][_0x4a7f('0x43')]());if(_0x12d5bf===_0x4a7f('0x5b')){_0x2317d1=_[_0x4a7f('0x5c')](_0x2317d1,_0x545262['ids']);}else{if(_[_0x4a7f('0x42')](_0x12d5bf,_0x4a7f('0x5d')))_0x12d5bf=_0x12d5bf[_0x4a7f('0x5e')]('queue',_0x4a7f('0x5f'));_0x545262['ids'][_0x4a7f('0x59')](function(_0x4fe353){_0x22893e[_0x4a7f('0x60')](getAgents(_0x12d5bf,_0x4fe353));});}});return BPromise[_0x4a7f('0x61')](_0x22893e)[_0x4a7f('0x2a')](function(_0x2a591f){_0x2317d1=_[_0x4a7f('0x5c')](_0x2317d1,_['flatten'](_0x2a591f));_0x754899(_0x2317d1);})[_0x4a7f('0x53')](function(_0x4f34e8){_0x3c5aac(_0x4f34e8);});});}function getAgents(_0xd97e9f,_0x4542d1){return new BPromise(function(_0x409c2c,_0x3f69f4){return db[_0xd97e9f][_0x4a7f('0x55')]({'where':{'id':_0x4542d1}})[_0x4a7f('0x2a')](function(_0xd9a6a6){return _0xd9a6a6['getAgents']({'attributes':['id'],'raw':!![]})[_0x4a7f('0x2a')](function(_0x1bf8fa){var _0x49e2b0=_[_0x4a7f('0x62')](_0x1bf8fa,'id');_0x409c2c(_0x49e2b0);});})[_0x4a7f('0x53')](function(_0x3e3961){_0x3f69f4(_0x3e3961);});});} \ No newline at end of file +var _0x461c=['findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','toLowerCase','User','ids','queue','replace','Queue','push','all','union','flatten','eml-format','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','update','then','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','sequelize','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x461c,0x134));var _0xc461=function(_0x39881f,_0x1503fd){_0x39881f=_0x39881f-0x0;var _0x942a8b=_0x461c[_0x39881f];return _0x942a8b;};'use strict';var emlformat=require(_0xc461('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc461('0x1'));var rp=require(_0xc461('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc461('0x3'));var path=require(_0xc461('0x4'));var sox=require(_0xc461('0x5'));var csv=require(_0xc461('0x6'));var ejs=require(_0xc461('0x7'));var fs=require('fs');var fs_extra=require(_0xc461('0x8'));var _=require(_0xc461('0x9'));var squel=require(_0xc461('0xa'));var crypto=require('crypto');var jsforce=require(_0xc461('0xb'));var deskjs=require(_0xc461('0xc'));var toCsv=require(_0xc461('0x6'));var querystring=require(_0xc461('0xd'));var Papa=require(_0xc461('0xe'));var Redis=require(_0xc461('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc461('0x10'));var logger=require('../../config/logger')(_0xc461('0x11'));var utils=require('../../config/utils');var config=require(_0xc461('0x12'));var licenseUtil=require(_0xc461('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc461('0x14')](config['redis'],{'host':_0xc461('0x15'),'port':0x18eb});var socket=require(_0xc461('0x16'))(new Redis(config[_0xc461('0x17')]));require('./userNotification.socket')[_0xc461('0x18')](socket);function respondWithStatusCode(_0x25d67e,_0x2b8be4){_0x2b8be4=_0x2b8be4||0xcc;return function(_0x308bfa){if(_0x308bfa){return _0x25d67e[_0xc461('0x19')](_0x2b8be4);}return _0x25d67e[_0xc461('0x1a')](_0x2b8be4)[_0xc461('0x1b')]();};}function respondWithResult(_0x1ca478,_0x1ead16){_0x1ead16=_0x1ead16||0xc8;return function(_0x48e996){if(_0x48e996){return _0x1ca478['status'](_0x1ead16)[_0xc461('0x1c')](_0x48e996);}};}function respondWithFilteredResult(_0x3b853b,_0x5034d9){return function(_0xc34825){if(_0xc34825){var _0x1a0974=typeof _0x5034d9['offset']==='undefined'&&typeof _0x5034d9[_0xc461('0x1d')]==='undefined';var _0x5ab6d5=_0xc34825[_0xc461('0x1e')];var _0x12922f=_0x1a0974?0x0:_0x5034d9['offset'];var _0x33deff=_0x1a0974?_0xc34825['count']:_0x5034d9[_0xc461('0x1f')]+_0x5034d9[_0xc461('0x1d')];var _0x5d8859;if(_0x33deff>=_0x5ab6d5){_0x33deff=_0x5ab6d5;_0x5d8859=0xc8;}else{_0x5d8859=0xce;}_0x3b853b[_0xc461('0x1a')](_0x5d8859);return _0x3b853b[_0xc461('0x20')](_0xc461('0x21'),_0x12922f+'-'+_0x33deff+'/'+_0x5ab6d5)[_0xc461('0x1c')](_0xc34825);}return null;};}function patchUpdates(_0x542373){return function(_0x1dbfc2){try{jsonpatch['apply'](_0x1dbfc2,_0x542373,!![]);}catch(_0x55e6fc){return BPromise[_0xc461('0x22')](_0x55e6fc);}return _0x1dbfc2['save']();};}function saveUpdates(_0x2f81c7,_0x168b2a){return function(_0x3d8e51){if(_0x3d8e51){return _0x3d8e51[_0xc461('0x23')](_0x2f81c7)[_0xc461('0x24')](function(_0x162dd9){return _0x162dd9;});}return null;};}function removeEntity(_0x548bb4,_0xbb12c6){return function(_0x451aad){if(_0x451aad){return _0x451aad['destroy']()[_0xc461('0x24')](function(){_0x548bb4[_0xc461('0x1a')](0xcc)[_0xc461('0x1b')]();});}};}function handleEntityNotFound(_0x5b287b,_0x40f4f5){return function(_0x27932c){if(!_0x27932c){_0x5b287b[_0xc461('0x19')](0x194);}return _0x27932c;};}function handleError(_0x5ec8c7,_0x48d224){_0x48d224=_0x48d224||0x1f4;return function(_0x5ed808){logger[_0xc461('0x25')](_0x5ed808[_0xc461('0x26')]);if(_0x5ed808[_0xc461('0x27')]){delete _0x5ed808[_0xc461('0x27')];}_0x5ec8c7[_0xc461('0x1a')](_0x48d224)[_0xc461('0x28')](_0x5ed808);};}exports[_0xc461('0x29')]=function(_0x47bd63,_0x1ebf4f,_0x3aea3f){if(!_0x47bd63[_0xc461('0x2a')][_0xc461('0x2b')](_0xc461('0x2c'))&&!_0x47bd63[_0xc461('0x2a')]['hasOwnProperty'](_0xc461('0x2d'))){throw new db[(_0xc461('0x2e'))][(_0xc461('0x2f'))](_0xc461('0x30'));}else{if(_0x47bd63[_0xc461('0x2a')]['hasOwnProperty']('TemplateId')&&!_0x47bd63[_0xc461('0x2a')][_0xc461('0x2b')](_0xc461('0x31'))){throw new db[(_0xc461('0x2e'))]['ValidationError'](_0xc461('0x32'));}if(!_0x47bd63[_0xc461('0x2a')]['hasOwnProperty'](_0xc461('0x33'))){throw new db[(_0xc461('0x2e'))]['ValidationError'](_0xc461('0x34'));}else{try{var _0x23ae3d=JSON[_0xc461('0x35')](_0x47bd63['body']['recipients']);}catch(_0x44303f){logger[_0xc461('0x25')](_0x44303f);throw new db[(_0xc461('0x2e'))][(_0xc461('0x2f'))](_0xc461('0x36'));}var _0x565ae7=[_0xc461('0x37'),_0xc461('0x38'),_0xc461('0x39'),_0xc461('0x3a'),_0xc461('0x3b'),_0xc461('0x3c'),_0xc461('0x3d'),_0xc461('0x3e'),_0xc461('0x3f')];if(_[_0xc461('0x40')](_0x23ae3d,function(_0x2fb35e){return!_[_0xc461('0x41')](_0x565ae7,_0x2fb35e[_0xc461('0x42')]['toLowerCase']());})){throw new db[(_0xc461('0x2e'))][(_0xc461('0x2f'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x1c5a4f={};_0x1c5a4f[_0xc461('0x43')]=_0x47bd63[_0xc461('0x2a')]['hasOwnProperty'](_0xc461('0x43'))?_0x47bd63[_0xc461('0x2a')][_0xc461('0x43')]:_0x47bd63[_0xc461('0x3f')][_0xc461('0x44')];_0x1c5a4f[_0xc461('0x45')]=_[_0xc461('0x46')](_0x47bd63[_0xc461('0x2a')][_0xc461('0x45')])?null:_0x47bd63[_0xc461('0x2a')][_0xc461('0x45')];_0x1c5a4f[_0xc461('0x47')]=_0x47bd63[_0xc461('0x2a')][_0xc461('0x47')]||![];_0x1c5a4f[_0xc461('0x48')]=_0x47bd63['user']['id'];return getContent(_0x47bd63['body'])['then'](function(_0x1d295e){_0x1c5a4f[_0xc461('0x2a')]=_0x1d295e;return getRecipients(_0x23ae3d);})[_0xc461('0x24')](function(_0x1ba8ed){_0x1c5a4f[_0xc461('0x49')]=_[_0xc461('0x4a')](_0x1ba8ed)['join'](',');return db[_0xc461('0x4b')]['transaction'](function(_0x375537){return db[_0xc461('0x4c')][_0xc461('0x4d')](_0x1c5a4f,{'raw':!![],'transaction':_0x375537})[_0xc461('0x24')](function(_0x2b8b53){var _0x43856d={'sender':_0x1c5a4f[_0xc461('0x43')],'description':_0x1c5a4f[_0xc461('0x45')],'content':_0x1c5a4f[_0xc461('0x2a')],'beep':_0x1c5a4f[_0xc461('0x47')]};_0x1ba8ed[_0xc461('0x4e')](function(_0x349177){_0x43856d[_0xc461('0x4f')]=_0x349177;socket[_0xc461('0x50')](_0xc461('0x51'),_0x43856d);});return _0x2b8b53;});});})['then'](respondWithResult(_0x1ebf4f,0xc9))[_0xc461('0x52')](handleError(_0x1ebf4f,null));};function getContent(_0x5d6193){return new BPromise(function(_0x58f08b,_0x16da43){if(_0x5d6193[_0xc461('0x2c')]){_0x58f08b(_0x5d6193[_0xc461('0x2c')]);return;}return db[_0xc461('0x53')][_0xc461('0x54')]({'attributes':[_0xc461('0x55')],'where':{'id':_0x5d6193['TemplateId']},'raw':!![]})['then'](function(_0x51e058){if(!_0x51e058)throw new db['Sequelize'][(_0xc461('0x2f'))](_0xc461('0x56'));var _0x505abf=Mustache['render'](_0x51e058[_0xc461('0x55')],_0x5d6193[_0xc461('0x31')]);_0x58f08b(_0x505abf);})[_0xc461('0x52')](function(_0x138426){_0x16da43(_0x138426);});});}function getRecipients(_0x386954){return new BPromise(function(_0x307a12,_0x5b8c9f){var _0x3e3f8e=[];var _0xd4aadd=[];_0x386954[_0xc461('0x4e')](function(_0x258d1b){var _0x28cbff=_[_0xc461('0x57')](_0x258d1b[_0xc461('0x42')][_0xc461('0x58')]());if(_0x28cbff===_0xc461('0x59')){_0x3e3f8e=_['union'](_0x3e3f8e,_0x258d1b[_0xc461('0x5a')]);}else{if(_[_0xc461('0x41')](_0x28cbff,_0xc461('0x5b')))_0x28cbff=_0x28cbff[_0xc461('0x5c')](_0xc461('0x5b'),_0xc461('0x5d'));_0x258d1b[_0xc461('0x5a')][_0xc461('0x4e')](function(_0x29f36d){_0xd4aadd[_0xc461('0x5e')](getAgents(_0x28cbff,_0x29f36d));});}});return BPromise[_0xc461('0x5f')](_0xd4aadd)[_0xc461('0x24')](function(_0x1eefa4){_0x3e3f8e=_[_0xc461('0x60')](_0x3e3f8e,_[_0xc461('0x61')](_0x1eefa4));_0x307a12(_0x3e3f8e);})[_0xc461('0x52')](function(_0x55f880){_0x5b8c9f(_0x55f880);});});}function getAgents(_0x38093a,_0x44ab1c){return new BPromise(function(_0x5155b4,_0x2ee2a9){return db[_0x38093a][_0xc461('0x54')]({'where':{'id':_0x44ab1c}})[_0xc461('0x24')](function(_0x3ed982){return _0x3ed982['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x1f89b1){var _0x38f193=_['map'](_0x1f89b1,'id');_0x5155b4(_0x38f193);});})['catch'](function(_0x1b31a8){_0x2ee2a9(_0x1b31a8);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 1007cd4..c47b509 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3937=['UserNotification','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x2112fd,_0x2d6ea5){var _0x47ed92=function(_0x1fc0bf){while(--_0x1fc0bf){_0x2112fd['push'](_0x2112fd['shift']());}};_0x47ed92(++_0x2d6ea5);}(_0x3937,0xbf));var _0x7393=function(_0x290a5c,_0x32b3d0){_0x290a5c=_0x290a5c-0x0;var _0x1e0bf6=_0x3937[_0x290a5c];return _0x1e0bf6;};'use strict';var EventEmitter=require(_0x7393('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x7393('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x7393('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7393('0x3'),'afterDestroy':'remove'};function emitEvent(_0x224468){return function(_0x4c9c71,_0x992b15,_0x2790e6){UserNotificationEvents[_0x7393('0x4')](_0x224468+':'+_0x4c9c71['id'],_0x4c9c71);UserNotificationEvents[_0x7393('0x4')](_0x224468,_0x4c9c71);_0x2790e6(null);};}for(var e in events){if(events[_0x7393('0x5')](e)){var event=events[e];UserNotification[_0x7393('0x6')](e,emitEvent(event));}}module[_0x7393('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification'];(function(_0x1d60af,_0x137d17){var _0x745a12=function(_0x54bac7){while(--_0x54bac7){_0x1d60af['push'](_0x1d60af['shift']());}};_0x745a12(++_0x137d17);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0x7995('0x0'));var UserNotification=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){UserNotificationEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);UserNotificationEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];UserNotification[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index d1b6b2d..1e8bd69 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58d6=['./userNotification.attributes','define','UserNotification','userNotifications','utf8mb4_unicode_ci','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0xb6ed9e,_0x50b747){var _0xd2b30f=function(_0x3bd02b){while(--_0x3bd02b){_0xb6ed9e['push'](_0xb6ed9e['shift']());}};_0xd2b30f(++_0x50b747);}(_0x58d6,0x1d3));var _0x658d=function(_0x22dd2b,_0x3b116a){_0x22dd2b=_0x22dd2b-0x0;var _0x2c816c=_0x58d6[_0x22dd2b];return _0x2c816c;};'use strict';var _=require('lodash');var util=require(_0x658d('0x0'));var logger=require(_0x658d('0x1'))('api');var moment=require(_0x658d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x658d('0x3'));var rimraf=require(_0x658d('0x4'));var config=require(_0x658d('0x5'));var attributes=require(_0x658d('0x6'));module['exports']=function(_0x513562,_0x48f5e3){return _0x513562[_0x658d('0x7')](_0x658d('0x8'),attributes,{'tableName':_0x658d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x658d('0xa')});}; \ No newline at end of file +var _0x4213=['rimraf','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x4213,0x77));var _0x3421=function(_0x314ead,_0x13ec06){_0x314ead=_0x314ead-0x0;var _0x1e36a0=_0x4213[_0x314ead];return _0x1e36a0;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var logger=require(_0x3421('0x2'))(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var BPromise=require(_0x3421('0x5'));var rp=require(_0x3421('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3421('0x7'));var config=require('../../config/environment');var attributes=require(_0x3421('0x8'));module[_0x3421('0x9')]=function(_0x2155f8,_0x2a04e0){return _0x2155f8['define'](_0x3421('0xa'),attributes,{'tableName':_0x3421('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3421('0xc'),'collate':_0x3421('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 97d3922..9693b22 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0cb0=['then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','request'];(function(_0x5ea364,_0x5cab78){var _0x191e57=function(_0x39a0ca){while(--_0x39a0ca){_0x5ea364['push'](_0x5ea364['shift']());}};_0x191e57(++_0x5cab78);}(_0x0cb0,0x107));var _0x00cb=function(_0xdc5a31,_0x119706){_0xdc5a31=_0xdc5a31-0x0;var _0x309f7e=_0x0cb0[_0xdc5a31];return _0x309f7e;};'use strict';var _=require(_0x00cb('0x0'));var util=require(_0x00cb('0x1'));var moment=require(_0x00cb('0x2'));var BPromise=require(_0x00cb('0x3'));var rs=require(_0x00cb('0x4'));var fs=require('fs');var Redis=require(_0x00cb('0x5'));var db=require(_0x00cb('0x6'))['db'];var utils=require(_0x00cb('0x7'));var logger=require(_0x00cb('0x8'))(_0x00cb('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x00cb('0xa')][_0x00cb('0xb')]({'port':0x232a});config[_0x00cb('0xc')]=_[_0x00cb('0xd')](config[_0x00cb('0xc')],{'host':_0x00cb('0xe'),'port':0x18eb});var socket=require(_0x00cb('0xf'))(new Redis(config[_0x00cb('0xc')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x4cc560,_0x257cc4,_0x444cc8){return new BPromise(function(_0x23408e,_0x107ca3){return client[_0x00cb('0x10')](_0x4cc560,_0x444cc8)[_0x00cb('0x11')](function(_0x2cddae){logger[_0x00cb('0x12')](_0x00cb('0x13'),_0x257cc4,_0x00cb('0x14'));logger[_0x00cb('0x15')](_0x00cb('0x16'),_0x257cc4,'request\x20sent',JSON['stringify'](_0x2cddae));if(_0x2cddae[_0x00cb('0x17')]){if(_0x2cddae[_0x00cb('0x17')][_0x00cb('0x18')]===0x1f4){logger[_0x00cb('0x17')]('UserNotification,\x20%s,\x20%s',_0x257cc4,_0x2cddae[_0x00cb('0x17')][_0x00cb('0x19')]);return _0x107ca3(_0x2cddae[_0x00cb('0x17')]['message']);}logger[_0x00cb('0x17')](_0x00cb('0x13'),_0x257cc4,_0x2cddae['error'][_0x00cb('0x19')]);return _0x23408e(_0x2cddae['error'][_0x00cb('0x19')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x257cc4,_0x00cb('0x14'));_0x23408e(_0x2cddae[_0x00cb('0x1a')]['message']);}})[_0x00cb('0x1b')](function(_0x5253a5){logger[_0x00cb('0x17')]('UserNotification,\x20%s,\x20%s',_0x257cc4,_0x5253a5);_0x107ca3(_0x5253a5);});});} \ No newline at end of file +var _0x00a6=['redis','localhost','socket.io-emitter','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x00a6,0x96));var _0x600a=function(_0x4394fb,_0x248f84){_0x4394fb=_0x4394fb-0x0;var _0x368e22=_0x00a6[_0x4394fb];return _0x368e22;};'use strict';var _=require('lodash');var util=require(_0x600a('0x0'));var moment=require(_0x600a('0x1'));var BPromise=require(_0x600a('0x2'));var rs=require(_0x600a('0x3'));var fs=require('fs');var Redis=require(_0x600a('0x4'));var db=require(_0x600a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x600a('0x6'))(_0x600a('0x7'));var config=require(_0x600a('0x8'));var jayson=require(_0x600a('0x9'));var client=jayson[_0x600a('0xa')]['http']({'port':0x232a});config[_0x600a('0xb')]=_['defaults'](config[_0x600a('0xb')],{'host':_0x600a('0xc'),'port':0x18eb});var socket=require(_0x600a('0xd'))(new Redis(config['redis']));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x459032,_0x262c48,_0x46f352){return new BPromise(function(_0x195876,_0x87d62c){return client[_0x600a('0xe')](_0x459032,_0x46f352)['then'](function(_0x4900d2){logger[_0x600a('0xf')](_0x600a('0x10'),_0x262c48,_0x600a('0x11'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x262c48,_0x600a('0x11'),JSON[_0x600a('0x12')](_0x4900d2));if(_0x4900d2[_0x600a('0x13')]){if(_0x4900d2[_0x600a('0x13')]['code']===0x1f4){logger['error'](_0x600a('0x10'),_0x262c48,_0x4900d2[_0x600a('0x13')][_0x600a('0x14')]);return _0x87d62c(_0x4900d2[_0x600a('0x13')]['message']);}logger[_0x600a('0x13')](_0x600a('0x10'),_0x262c48,_0x4900d2[_0x600a('0x13')][_0x600a('0x14')]);return _0x195876(_0x4900d2[_0x600a('0x13')][_0x600a('0x14')]);}else{logger[_0x600a('0xf')](_0x600a('0x10'),_0x262c48,_0x600a('0x11'));_0x195876(_0x4900d2[_0x600a('0x15')][_0x600a('0x14')]);}})[_0x600a('0x16')](function(_0x51dcc5){logger[_0x600a('0x13')](_0x600a('0x10'),_0x262c48,_0x51dcc5);_0x87d62c(_0x51dcc5);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 279315c..17234ce 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb8b=['removeListener','register','length','userNotification:','save','remove','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x5ee2d0,_0x50acd3){_0x5ee2d0=_0x5ee2d0-0x0;var _0x1d71cb=_0xdb8b[_0x5ee2d0];return _0x1d71cb;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xbdb8('0x0'),_0xbdb8('0x1'),_0xbdb8('0x2')];function createListener(_0x553ab3,_0x4ece48){return function(_0x1cc1b9){_0x4ece48['emit'](_0x553ab3,_0x1cc1b9);};}function removeListener(_0x3149c6,_0x2ec8cc){return function(){UserNotificationEvents[_0xbdb8('0x3')](_0x3149c6,_0x2ec8cc);};}exports[_0xbdb8('0x4')]=function(_0x4c6bdb){for(var _0x7affe8=0x0,_0x482c12=events[_0xbdb8('0x5')];_0x7affe8<_0x482c12;_0x7affe8++){var _0x2f2825=events[_0x7affe8];var _0x444d6=createListener(_0xbdb8('0x6')+_0x2f2825,_0x4c6bdb);UserNotificationEvents['on'](_0x2f2825,_0x444d6);}}; \ No newline at end of file +var _0x7676=['./userNotification.events','save','remove','emit','removeListener','register','length','userNotification:'];(function(_0x2bd3f7,_0xb9be42){var _0x74cfa7=function(_0x227dc0){while(--_0x227dc0){_0x2bd3f7['push'](_0x2bd3f7['shift']());}};_0x74cfa7(++_0xb9be42);}(_0x7676,0xb8));var _0x6767=function(_0x2efcd3,_0x216cc0){_0x2efcd3=_0x2efcd3-0x0;var _0x45e02e=_0x7676[_0x2efcd3];return _0x45e02e;};'use strict';var UserNotificationEvents=require(_0x6767('0x0'));var events=[_0x6767('0x1'),_0x6767('0x2'),'update'];function createListener(_0x38ffba,_0x478b23){return function(_0x51f099){_0x478b23[_0x6767('0x3')](_0x38ffba,_0x51f099);};}function removeListener(_0x4bd37b,_0x4005ff){return function(){UserNotificationEvents[_0x6767('0x4')](_0x4bd37b,_0x4005ff);};}exports[_0x6767('0x5')]=function(_0x4d0c08){for(var _0x24d747=0x0,_0x3f61f5=events[_0x6767('0x6')];_0x24d747<_0x3f61f5;_0x24d747++){var _0x54d2c7=events[_0x24d747];var _0xb81431=createListener(_0x6767('0x7')+_0x54d2c7,_0x4d0c08);UserNotificationEvents['on'](_0x54d2c7,_0xb81431);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index ef41bc0..49778a5 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 _0xafcd=['../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x31fcb9,_0x350d71){var _0xb1eee9=function(_0x47226f){while(--_0x47226f){_0x31fcb9['push'](_0x31fcb9['shift']());}};_0xb1eee9(++_0x350d71);}(_0xafcd,0x157));var _0xdafc=function(_0x36284b,_0x2b7436){_0x36284b=_0x36284b-0x0;var _0x23c34a=_0xafcd[_0x36284b];return _0x23c34a;};'use strict';var multer=require(_0xdafc('0x0'));var util=require(_0xdafc('0x1'));var path=require(_0xdafc('0x2'));var timeout=require(_0xdafc('0x3'));var express=require(_0xdafc('0x4'));var router=express[_0xdafc('0x5')]();var fs_extra=require(_0xdafc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdafc('0x7'));var config=require(_0xdafc('0x8'));module[_0xdafc('0x9')]=router; \ No newline at end of file +var _0xc2af=['../../components/interaction/service','../../config/environment','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1d1f09,_0x55e377){var _0x55a7c7=function(_0xfbc7de){while(--_0xfbc7de){_0x1d1f09['push'](_0x1d1f09['shift']());}};_0x55a7c7(++_0x55e377);}(_0xc2af,0x1bc));var _0xfc2a=function(_0x463a14,_0x16a7c7){_0x463a14=_0x463a14-0x0;var _0x794caf=_0xc2af[_0x463a14];return _0x794caf;};'use strict';var multer=require(_0xfc2a('0x0'));var util=require('util');var path=require(_0xfc2a('0x1'));var timeout=require('connect-timeout');var express=require(_0xfc2a('0x2'));var router=express[_0xfc2a('0x3')]();var fs_extra=require(_0xfc2a('0x4'));var auth=require(_0xfc2a('0x5'));var interaction=require(_0xfc2a('0x6'));var config=require(_0xfc2a('0x7'));module[_0xfc2a('0x8')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 2cf9b3a..76caa36 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 _0xd8b0=['exports','sequelize'];(function(_0x5482f4,_0x150cac){var _0x42d1ec=function(_0x2d3af5){while(--_0x2d3af5){_0x5482f4['push'](_0x5482f4['shift']());}};_0x42d1ec(++_0x150cac);}(_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 _0xbaf0=['exports','INTEGER'];(function(_0x40d5cc,_0xf9d2c7){var _0x6950af=function(_0x295221){while(--_0x295221){_0x40d5cc['push'](_0x40d5cc['shift']());}};_0x6950af(++_0xf9d2c7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'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 25ca8d8..0f98f8f 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 _0xb526=['util','../../config/logger','api','moment','bluebird','path','rimraf','./userOpenchannelQueue.attributes','user_has_openchannel_queues'];(function(_0x2c42a5,_0x2d1b8f){var _0x50ef99=function(_0x1415f4){while(--_0x1415f4){_0x2c42a5['push'](_0x2c42a5['shift']());}};_0x50ef99(++_0x2d1b8f);}(_0xb526,0x1e6));var _0x6b52=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0xb526[_0x5756c6];return _0x4b5806;};'use strict';var _=require('lodash');var util=require(_0x6b52('0x0'));var logger=require(_0x6b52('0x1'))(_0x6b52('0x2'));var moment=require(_0x6b52('0x3'));var BPromise=require(_0x6b52('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b52('0x5'));var rimraf=require(_0x6b52('0x6'));var config=require('../../config/environment');var attributes=require(_0x6b52('0x7'));module['exports']=function(_0x4a8ae0,_0x1ed722){return _0x4a8ae0['define']('UserOpenchannelQueue',attributes,{'tableName':_0x6b52('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x705c=['request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','moment'];(function(_0x19c038,_0x175394){var _0x3e4fc9=function(_0x8887cb){while(--_0x8887cb){_0x19c038['push'](_0x19c038['shift']());}};_0x3e4fc9(++_0x175394);}(_0x705c,0x69));var _0xc705=function(_0x24fbf3,_0x55045a){_0x24fbf3=_0x24fbf3-0x0;var _0x778b60=_0x705c[_0x24fbf3];return _0x778b60;};'use strict';var _=require(_0xc705('0x0'));var util=require('util');var logger=require(_0xc705('0x1'))('api');var moment=require(_0xc705('0x2'));var BPromise=require('bluebird');var rp=require(_0xc705('0x3'));var fs=require('fs');var path=require(_0xc705('0x4'));var rimraf=require(_0xc705('0x5'));var config=require(_0xc705('0x6'));var attributes=require(_0xc705('0x7'));module[_0xc705('0x8')]=function(_0x3671fc,_0x40eb0b){return _0x3671fc[_0xc705('0x9')](_0xc705('0xa'),attributes,{'tableName':_0xc705('0xb'),'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 af11458..c31c030 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 _0x12c4=['client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0xca877,_0x1ad358){var _0x3d7691=function(_0x57bc76){while(--_0x57bc76){_0xca877['push'](_0xca877['shift']());}};_0x3d7691(++_0x1ad358);}(_0x12c4,0xea));var _0x412c=function(_0xbef0b5,_0x148a0e){_0xbef0b5=_0xbef0b5-0x0;var _0x4be9f2=_0x12c4[_0xbef0b5];return _0x4be9f2;};'use strict';var _=require('lodash');var util=require(_0x412c('0x0'));var moment=require(_0x412c('0x1'));var BPromise=require(_0x412c('0x2'));var rs=require(_0x412c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x412c('0x4'))['db'];var utils=require(_0x412c('0x5'));var logger=require('../../config/logger')(_0x412c('0x6'));var config=require(_0x412c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x412c('0x8')][_0x412c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47287d,_0x6564f2,_0x1c465a){return new BPromise(function(_0x2bc635,_0x1df331){return client[_0x412c('0xa')](_0x47287d,_0x1c465a)[_0x412c('0xb')](function(_0x385420){logger[_0x412c('0xc')](_0x412c('0xd'),_0x6564f2,'request\x20sent');logger[_0x412c('0xe')](_0x412c('0xf'),_0x6564f2,_0x412c('0x10'),JSON[_0x412c('0x11')](_0x385420));if(_0x385420['error']){if(_0x385420[_0x412c('0x12')][_0x412c('0x13')]===0x1f4){logger['error'](_0x412c('0xd'),_0x6564f2,_0x385420[_0x412c('0x12')][_0x412c('0x14')]);return _0x1df331(_0x385420[_0x412c('0x12')][_0x412c('0x14')]);}logger[_0x412c('0x12')](_0x412c('0xd'),_0x6564f2,_0x385420[_0x412c('0x12')]['message']);return _0x2bc635(_0x385420[_0x412c('0x12')][_0x412c('0x14')]);}else{logger[_0x412c('0xc')](_0x412c('0xd'),_0x6564f2,'request\x20sent');_0x2bc635(_0x385420[_0x412c('0x15')]['message']);}})['catch'](function(_0x364078){logger[_0x412c('0x12')](_0x412c('0xd'),_0x6564f2,_0x364078);_0x1df331(_0x364078);});});} \ No newline at end of file +var _0xabf7=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird'];(function(_0x2d9f45,_0x474eaa){var _0x433b84=function(_0x471ded){while(--_0x471ded){_0x2d9f45['push'](_0x2d9f45['shift']());}};_0x433b84(++_0x474eaa);}(_0xabf7,0x19e));var _0x7abf=function(_0x1c4951,_0x2038ee){_0x1c4951=_0x1c4951-0x0;var _0x345e1b=_0xabf7[_0x1c4951];return _0x345e1b;};'use strict';var _=require(_0x7abf('0x0'));var util=require(_0x7abf('0x1'));var moment=require(_0x7abf('0x2'));var BPromise=require(_0x7abf('0x3'));var rs=require(_0x7abf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7abf('0x5'))['db'];var utils=require(_0x7abf('0x6'));var logger=require(_0x7abf('0x7'))(_0x7abf('0x8'));var config=require('../../config/environment');var jayson=require(_0x7abf('0x9'));var client=jayson[_0x7abf('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bd1c1,_0x41be78,_0x207a0c){return new BPromise(function(_0x3a045e,_0x4b1a1b){return client['request'](_0x2bd1c1,_0x207a0c)['then'](function(_0x5624a1){logger[_0x7abf('0xb')](_0x7abf('0xc'),_0x41be78,_0x7abf('0xd'));logger['debug'](_0x7abf('0xe'),_0x41be78,_0x7abf('0xd'),JSON[_0x7abf('0xf')](_0x5624a1));if(_0x5624a1['error']){if(_0x5624a1['error']['code']===0x1f4){logger[_0x7abf('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x41be78,_0x5624a1[_0x7abf('0x10')][_0x7abf('0x11')]);return _0x4b1a1b(_0x5624a1['error']['message']);}logger[_0x7abf('0x10')](_0x7abf('0xc'),_0x41be78,_0x5624a1[_0x7abf('0x10')][_0x7abf('0x11')]);return _0x3a045e(_0x5624a1[_0x7abf('0x10')][_0x7abf('0x11')]);}else{logger[_0x7abf('0xb')](_0x7abf('0xc'),_0x41be78,_0x7abf('0xd'));_0x3a045e(_0x5624a1[_0x7abf('0x12')][_0x7abf('0x11')]);}})['catch'](function(_0x1a8c57){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x41be78,_0x1a8c57);_0x4b1a1b(_0x1a8c57);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index d53b29e..52c46cd 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 _0xcd4e=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','getSections','getResources','post','/:id/clone','clone','addSections','/:id/resources','addResources','put','delete','destroy','/:id/sections','removeSections','removeResources','exports','multer'];(function(_0x33c195,_0xf8e46d){var _0x4c6b24=function(_0x420d01){while(--_0x420d01){_0x33c195['push'](_0x33c195['shift']());}};_0x4c6b24(++_0xf8e46d);}(_0xcd4e,0x187));var _0xecd4=function(_0x3f6a7b,_0x1a537b){_0x3f6a7b=_0x3f6a7b-0x0;var _0x4f3967=_0xcd4e[_0x3f6a7b];return _0x4f3967;};'use strict';var multer=require(_0xecd4('0x0'));var util=require(_0xecd4('0x1'));var path=require(_0xecd4('0x2'));var timeout=require(_0xecd4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xecd4('0x4'));var auth=require(_0xecd4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xecd4('0x6'));var controller=require('./userProfile.controller');router[_0xecd4('0x7')]('/',auth['isAuthenticated'](),controller[_0xecd4('0x8')]);router[_0xecd4('0x7')](_0xecd4('0x9'),auth[_0xecd4('0xa')](),controller[_0xecd4('0xb')]);router['get'](_0xecd4('0xc'),auth[_0xecd4('0xa')](),controller['show']);router[_0xecd4('0x7')]('/:id/sections',auth[_0xecd4('0xa')](),controller[_0xecd4('0xd')]);router[_0xecd4('0x7')]('/:id/resources',auth[_0xecd4('0xa')](),controller[_0xecd4('0xe')]);router['post']('/',auth[_0xecd4('0xa')](),controller['create']);router[_0xecd4('0xf')](_0xecd4('0x10'),auth[_0xecd4('0xa')](),controller[_0xecd4('0x11')]);router[_0xecd4('0xf')]('/:id/sections',auth[_0xecd4('0xa')](),controller[_0xecd4('0x12')]);router[_0xecd4('0xf')](_0xecd4('0x13'),auth[_0xecd4('0xa')](),controller[_0xecd4('0x14')]);router[_0xecd4('0x15')](_0xecd4('0xc'),auth[_0xecd4('0xa')](),controller['update']);router[_0xecd4('0x16')](_0xecd4('0xc'),auth[_0xecd4('0xa')](),controller[_0xecd4('0x17')]);router[_0xecd4('0x16')](_0xecd4('0x18'),auth['isAuthenticated'](),controller[_0xecd4('0x19')]);router['delete'](_0xecd4('0x13'),auth[_0xecd4('0xa')](),controller[_0xecd4('0x1a')]);module[_0xecd4('0x1b')]=router; \ No newline at end of file +var _0x5b20=['getResources','post','create','/:id/clone','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/sections','getSections','/:id/resources'];(function(_0x70fd53,_0x2a95a6){var _0x4b71c5=function(_0x4b349d){while(--_0x4b349d){_0x70fd53['push'](_0x70fd53['shift']());}};_0x4b71c5(++_0x2a95a6);}(_0x5b20,0x86));var _0x05b2=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x5b20[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x05b2('0x0'));var util=require(_0x05b2('0x1'));var path=require(_0x05b2('0x2'));var timeout=require(_0x05b2('0x3'));var express=require(_0x05b2('0x4'));var router=express[_0x05b2('0x5')]();var fs_extra=require(_0x05b2('0x6'));var auth=require(_0x05b2('0x7'));var interaction=require(_0x05b2('0x8'));var config=require(_0x05b2('0x9'));var controller=require(_0x05b2('0xa'));router['get']('/',auth[_0x05b2('0xb')](),controller[_0x05b2('0xc')]);router['get'](_0x05b2('0xd'),auth[_0x05b2('0xb')](),controller[_0x05b2('0xe')]);router[_0x05b2('0xf')](_0x05b2('0x10'),auth[_0x05b2('0xb')](),controller[_0x05b2('0x11')]);router[_0x05b2('0xf')](_0x05b2('0x12'),auth[_0x05b2('0xb')](),controller[_0x05b2('0x13')]);router[_0x05b2('0xf')](_0x05b2('0x14'),auth[_0x05b2('0xb')](),controller[_0x05b2('0x15')]);router[_0x05b2('0x16')]('/',auth['isAuthenticated'](),controller[_0x05b2('0x17')]);router[_0x05b2('0x16')](_0x05b2('0x18'),auth[_0x05b2('0xb')](),controller['clone']);router[_0x05b2('0x16')](_0x05b2('0x12'),auth[_0x05b2('0xb')](),controller['addSections']);router['post'](_0x05b2('0x14'),auth[_0x05b2('0xb')](),controller['addResources']);router['put'](_0x05b2('0x10'),auth[_0x05b2('0xb')](),controller[_0x05b2('0x19')]);router[_0x05b2('0x1a')](_0x05b2('0x10'),auth[_0x05b2('0xb')](),controller[_0x05b2('0x1b')]);router[_0x05b2('0x1a')](_0x05b2('0x12'),auth[_0x05b2('0xb')](),controller[_0x05b2('0x1c')]);router[_0x05b2('0x1a')](_0x05b2('0x14'),auth[_0x05b2('0xb')](),controller[_0x05b2('0x1d')]);module[_0x05b2('0x1e')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index d11b384..fa0aaf8 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 _0xae87=['split','BOOLEAN','STRING','crudPermissions','getDataValue'];(function(_0x4d8331,_0x1b852a){var _0x2c0c78=function(_0x1100c6){while(--_0x1100c6){_0x4d8331['push'](_0x4d8331['shift']());}};_0x2c0c78(++_0x1b852a);}(_0xae87,0x1ce));var _0x7ae8=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0xae87[_0x3042c5];return _0x7cd140;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x7ae8('0x0')],'set':function(_0x27b5e6){this['setDataValue'](_0x7ae8('0x1'),_0x27b5e6?_0x27b5e6['join'](''):[]);},'get':function(){return this['getDataValue'](_0x7ae8('0x1'))?this[_0x7ae8('0x2')](_0x7ae8('0x1'))[_0x7ae8('0x3')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x7ae8('0x4')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x7ae8('0x4')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x7ae8('0x4')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x7ae8('0x4')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x7ae8('0x4')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7ae8('0x4')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x7ae8('0x4')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x063c=['split','BOOLEAN','exports','STRING','name','setDataValue','join','crudPermissions'];(function(_0x3613a6,_0x15e8bd){var _0x113319=function(_0x37170e){while(--_0x37170e){_0x3613a6['push'](_0x3613a6['shift']());}};_0x113319(++_0x15e8bd);}(_0x063c,0xba));var _0xc063=function(_0x34148d,_0x21f607){_0x34148d=_0x34148d-0x0;var _0x195f8c=_0x063c[_0x34148d];return _0x195f8c;};'use strict';var Sequelize=require('sequelize');module[_0xc063('0x0')]={'name':{'type':Sequelize[_0xc063('0x1')],'allowNull':![],'unique':_0xc063('0x2')},'crudPermissions':{'type':Sequelize[_0xc063('0x1')],'set':function(_0x314f1b){this[_0xc063('0x3')]('crudPermissions',_0x314f1b?_0x314f1b[_0xc063('0x4')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue'](_0xc063('0x5'))[_0xc063('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xc063('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xc063('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xc063('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xc063('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc063('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xc063('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 451fe44..6f96a44 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 _0x8013=['SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','Team','voicequeues','queuecampaigns','VoiceQueue','agents','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','Disposition','customdashboards','intervals','Interval','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','trunks','Trunk','Variable','plugins','extractedreports','Reports','metrics','whatsappaccounts','WhatsappAccount','screenrecordings','UserId','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','UserProfile','includeAll','rows','catch','create','body','clone','params','include','find','omit','updatedAt','crudPermissions','createdAt','transaction','UserProfileSection','findAll','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','describe','addSections','sequelize','push','get','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','ids','getResources','Sequelize','mergeResources','ValidationError','all','ignore','isEmpty','union','childModel','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','Agents','openTabs','true','chat','sms','dataValues','fax','mail','toUpperCase','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','toString','OpenTabs','value','SquareProject','odbc','SquareRecording','parentSections','SquareProjects','projectName','contacts','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues'];(function(_0x56196c,_0x55bf95){var _0x33d519=function(_0x377501){while(--_0x377501){_0x56196c['push'](_0x56196c['shift']());}};_0x33d519(++_0x55bf95);}(_0x8013,0x12e));var _0x3801=function(_0x1c9f10,_0x4b3783){_0x1c9f10=_0x1c9f10-0x0;var _0x4e2c1e=_0x8013[_0x1c9f10];return _0x4e2c1e;};'use strict';var emlformat=require(_0x3801('0x0'));var rimraf=require(_0x3801('0x1'));var zipdir=require(_0x3801('0x2'));var jsonpatch=require(_0x3801('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3801('0x4'));var Mustache=require(_0x3801('0x5'));var util=require('util');var path=require(_0x3801('0x6'));var sox=require(_0x3801('0x7'));var csv=require(_0x3801('0x8'));var ejs=require(_0x3801('0x9'));var fs=require('fs');var fs_extra=require(_0x3801('0xa'));var _=require(_0x3801('0xb'));var squel=require(_0x3801('0xc'));var crypto=require('crypto');var jsforce=require(_0x3801('0xd'));var deskjs=require(_0x3801('0xe'));var toCsv=require(_0x3801('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3801('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3801('0x10'));var logger=require(_0x3801('0x11'))('api');var utils=require(_0x3801('0x12'));var config=require(_0x3801('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3801('0x14'))['db'];config[_0x3801('0x15')]=_[_0x3801('0x16')](config['redis'],{'host':_0x3801('0x17'),'port':0x18eb});var socket=require(_0x3801('0x18'))(new Redis(config[_0x3801('0x15')]));require(_0x3801('0x19'))[_0x3801('0x1a')](socket);function respondWithStatusCode(_0x4ad5c3,_0x13cabe){_0x13cabe=_0x13cabe||0xcc;return function(_0x2749dd){if(_0x2749dd){return _0x4ad5c3[_0x3801('0x1b')](_0x13cabe);}return _0x4ad5c3[_0x3801('0x1c')](_0x13cabe)[_0x3801('0x1d')]();};}function respondWithResult(_0x2cc143,_0x150552){_0x150552=_0x150552||0xc8;return function(_0x297c20){if(_0x297c20){return _0x2cc143[_0x3801('0x1c')](_0x150552)[_0x3801('0x1e')](_0x297c20);}};}function respondWithFilteredResult(_0x28ca07,_0x5d82e7){return function(_0x323dce){if(_0x323dce){var _0x32b63b=typeof _0x5d82e7[_0x3801('0x1f')]==='undefined'&&typeof _0x5d82e7[_0x3801('0x20')]===_0x3801('0x21');var _0x74a53b=_0x323dce['count'];var _0x494bc7=_0x32b63b?0x0:_0x5d82e7[_0x3801('0x1f')];var _0x5bf645=_0x32b63b?_0x323dce[_0x3801('0x22')]:_0x5d82e7['offset']+_0x5d82e7[_0x3801('0x20')];var _0x416ed0;if(_0x5bf645>=_0x74a53b){_0x5bf645=_0x74a53b;_0x416ed0=0xc8;}else{_0x416ed0=0xce;}_0x28ca07['status'](_0x416ed0);return _0x28ca07[_0x3801('0x23')](_0x3801('0x24'),_0x494bc7+'-'+_0x5bf645+'/'+_0x74a53b)[_0x3801('0x1e')](_0x323dce);}return null;};}function patchUpdates(_0x17a921){return function(_0x29fecf){try{jsonpatch['apply'](_0x29fecf,_0x17a921,!![]);}catch(_0x4b5b2d){return BPromise[_0x3801('0x25')](_0x4b5b2d);}return _0x29fecf[_0x3801('0x26')]();};}function saveUpdates(_0x4b338a,_0x83c478){return function(_0x5b972f){if(_0x5b972f){return _0x5b972f[_0x3801('0x27')](_0x4b338a)[_0x3801('0x28')](function(_0x10c015){return _0x10c015;});}return null;};}function removeEntity(_0x477e45,_0x46417a){return function(_0x59660c){if(_0x59660c){return _0x59660c[_0x3801('0x29')]()[_0x3801('0x28')](function(){_0x477e45[_0x3801('0x1c')](0xcc)[_0x3801('0x1d')]();});}};}function handleEntityNotFound(_0x568d1b,_0x1eba5f){return function(_0x50c010){if(!_0x50c010){_0x568d1b[_0x3801('0x1b')](0x194);}return _0x50c010;};}function handleError(_0x43ad73,_0x22aa00){_0x22aa00=_0x22aa00||0x1f4;return function(_0x5750ad){logger[_0x3801('0x2a')](_0x5750ad[_0x3801('0x2b')]);if(_0x5750ad[_0x3801('0x2c')]){delete _0x5750ad[_0x3801('0x2c')];}_0x43ad73[_0x3801('0x1c')](_0x22aa00)['send'](_0x5750ad);};}exports[_0x3801('0x2d')]=function(_0x58533a,_0xca4f57){var _0x828e14={},_0x590e47={},_0xf569a3={'count':0x0,'rows':[]};var _0xc1be93=_[_0x3801('0x2e')](db['UserProfile'][_0x3801('0x2f')],function(_0x42128c){return{'name':_0x42128c[_0x3801('0x30')],'type':_0x42128c['type'][_0x3801('0x31')]};});_0x590e47[_0x3801('0x32')]=_['map'](_0xc1be93,_0x3801('0x2c'));_0x590e47[_0x3801('0x33')]=_[_0x3801('0x34')](_0x58533a[_0x3801('0x33')]);_0x590e47[_0x3801('0x35')]=_['intersection'](_0x590e47[_0x3801('0x32')],_0x590e47[_0x3801('0x33')]);_0x828e14[_0x3801('0x36')]=_[_0x3801('0x37')](_0x590e47['model'],qs[_0x3801('0x38')](_0x58533a[_0x3801('0x33')][_0x3801('0x38')]));_0x828e14[_0x3801('0x36')]=_0x828e14[_0x3801('0x36')][_0x3801('0x39')]?_0x828e14[_0x3801('0x36')]:_0x590e47[_0x3801('0x32')];if(!_0x58533a[_0x3801('0x33')][_0x3801('0x3a')](_0x3801('0x3b'))){_0x828e14['limit']=qs[_0x3801('0x20')](_0x58533a['query'][_0x3801('0x20')]);_0x828e14[_0x3801('0x1f')]=qs['offset'](_0x58533a[_0x3801('0x33')][_0x3801('0x1f')]);}_0x828e14[_0x3801('0x3c')]=qs[_0x3801('0x3d')](_0x58533a['query'][_0x3801('0x3d')]);_0x828e14[_0x3801('0x3e')]=qs[_0x3801('0x35')](_[_0x3801('0x3f')](_0x58533a[_0x3801('0x33')],_0x590e47[_0x3801('0x35')]),_0xc1be93);if(_0x58533a[_0x3801('0x33')]['filter']){_0x828e14[_0x3801('0x3e')]=_[_0x3801('0x40')](_0x828e14[_0x3801('0x3e')],{'$or':_[_0x3801('0x2e')](_0xc1be93,function(_0x3cb339){if(_0x3cb339[_0x3801('0x41')]!==_0x3801('0x42')){var _0x56b080={};_0x56b080[_0x3cb339[_0x3801('0x2c')]]={'$like':'%'+_0x58533a[_0x3801('0x33')][_0x3801('0x43')]+'%'};return _0x56b080;}})});}_0x828e14=_[_0x3801('0x40')]({},_0x828e14,_0x58533a[_0x3801('0x44')]);var _0x3f085d={'where':_0x828e14[_0x3801('0x3e')]};return db[_0x3801('0x45')][_0x3801('0x22')](_0x3f085d)[_0x3801('0x28')](function(_0x14efe3){_0xf569a3[_0x3801('0x22')]=_0x14efe3;if(_0x58533a[_0x3801('0x33')][_0x3801('0x46')]){_0x828e14['include']=[{'all':!![]}];}return db[_0x3801('0x45')]['findAll'](_0x828e14);})['then'](function(_0x38ddeb){_0xf569a3[_0x3801('0x47')]=_0x38ddeb;return _0xf569a3;})['then'](respondWithFilteredResult(_0xca4f57,_0x828e14))[_0x3801('0x48')](handleError(_0xca4f57,null));};exports['show']=function(_0x536f8a,_0x5abdb2){var _0x42fe7c={'raw':![],'where':{'id':_0x536f8a['params']['id']}},_0x40e798={};_0x40e798[_0x3801('0x32')]=_[_0x3801('0x34')](db[_0x3801('0x45')][_0x3801('0x2f')]);_0x40e798[_0x3801('0x33')]=_[_0x3801('0x34')](_0x536f8a[_0x3801('0x33')]);_0x40e798['filters']=_[_0x3801('0x37')](_0x40e798[_0x3801('0x32')],_0x40e798[_0x3801('0x33')]);_0x42fe7c[_0x3801('0x36')]=_['intersection'](_0x40e798[_0x3801('0x32')],qs[_0x3801('0x38')](_0x536f8a[_0x3801('0x33')][_0x3801('0x38')]));_0x42fe7c['attributes']=_0x42fe7c[_0x3801('0x36')]['length']?_0x42fe7c[_0x3801('0x36')]:_0x40e798[_0x3801('0x32')];if(_0x536f8a[_0x3801('0x33')][_0x3801('0x46')]){_0x42fe7c['include']=[{'all':!![]}];}_0x42fe7c=_[_0x3801('0x40')]({},_0x42fe7c,_0x536f8a[_0x3801('0x44')]);return db[_0x3801('0x45')]['find'](_0x42fe7c)['then'](handleEntityNotFound(_0x5abdb2,null))[_0x3801('0x28')](respondWithResult(_0x5abdb2,null))[_0x3801('0x48')](handleError(_0x5abdb2,null));};exports['create']=function(_0x388b6a,_0x2e058d){return db[_0x3801('0x45')][_0x3801('0x49')](_0x388b6a[_0x3801('0x4a')],{})[_0x3801('0x28')](respondWithResult(_0x2e058d,0xc9))[_0x3801('0x48')](handleError(_0x2e058d,null));};exports[_0x3801('0x4b')]=function(_0xcc047c,_0x34402b){var _0x2bb0fc={'where':{'id':_0xcc047c[_0x3801('0x4c')]['id']}},_0x2e355b={};_0x2e355b[_0x3801('0x32')]=_['keys'](db[_0x3801('0x45')][_0x3801('0x2f')]);_0x2bb0fc[_0x3801('0x36')]=_[_0x3801('0x37')](_0x2e355b['model'],qs[_0x3801('0x38')](_0xcc047c[_0x3801('0x33')][_0x3801('0x38')]));_0x2bb0fc[_0x3801('0x36')]=_0x2bb0fc[_0x3801('0x36')][_0x3801('0x39')]?_0x2bb0fc[_0x3801('0x36')]:_0x2e355b['model'];if(_0xcc047c['query']['includeAll']){_0x2bb0fc[_0x3801('0x4d')]=[{'all':!![]}];}_0x2bb0fc=_[_0x3801('0x40')]({},_0x2bb0fc,_0xcc047c[_0x3801('0x44')]);return db[_0x3801('0x45')][_0x3801('0x4e')](_0x2bb0fc)[_0x3801('0x28')](handleEntityNotFound(_0x34402b,null))[_0x3801('0x28')](function(_0x316f3e){if(_0x316f3e){var _0xa8cb9=_0x316f3e['get']({'plain':!![]});_0xa8cb9=qs[_0x3801('0x4f')](_0xa8cb9,['id','createdAt',_0x3801('0x50'),_0x3801('0x51')]);_0xcc047c[_0x3801('0x4a')]=_[_0x3801('0x4f')](_0xcc047c[_0x3801('0x4a')],['id',_0x3801('0x52'),_0x3801('0x50')]);return db['sequelize'][_0x3801('0x53')](function(_0x1e8340){return db[_0x3801('0x45')]['create'](_[_0x3801('0x40')](_0xa8cb9,_0xcc047c[_0x3801('0x4a')]),{'include':_0xcc047c['query'][_0x3801('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x1e8340})[_0x3801('0x28')](function(_0x2d1d81){var _0x1a79d3=_0x2d1d81['get']({'plain':!![]});return db[_0x3801('0x54')][_0x3801('0x55')]({'where':{'userProfileId':_0xcc047c[_0x3801('0x4c')]['id']},'raw':!![]})[_0x3801('0x28')](function(_0x3618ea){if(_0x3618ea){return BPromise[_0x3801('0x56')](_0x3618ea,function(_0x47d339){return new BPromise(function(_0x34a9da,_0x3fb1a0){if(_0x47d339['autoAssociation']===null||_0x47d339[_0x3801('0x57')]===0x1)_0x34a9da(null);return db['UserProfileResource'][_0x3801('0x55')]({'where':{'sectionId':_0x47d339['id']},'raw':!![]})[_0x3801('0x28')](function(_0x5343da){var _0x54954a=_[_0x3801('0x2e')](_0x5343da,function(_0x5158be){return qs[_0x3801('0x4f')](_0x5158be,['id',_0x3801('0x52'),_0x3801('0x50'),_0x3801('0x58')]);});_0x34a9da(_0x54954a);})[_0x3801('0x48')](function(_0xb8f412){_0x3fb1a0(_0xb8f412);});})[_0x3801('0x28')](function(_0x5b0154){var _0x1c9e6b=qs[_0x3801('0x4f')](_0x47d339,['id',_0x3801('0x52'),_0x3801('0x50')]);_0x1c9e6b[_0x3801('0x59')]=_0x1a79d3['id'];if(_0x5b0154)_0x1c9e6b[_0x3801('0x5a')]=_0x5b0154;return _0x1c9e6b;})[_0x3801('0x28')](function(_0x1819dc){return db[_0x3801('0x54')][_0x3801('0x49')](_0x1819dc,{'include':[{'model':db[_0x3801('0x5b')],'as':'Resources'}],'raw':!![],'transaction':_0x1e8340});});})['then'](function(){return _0x1a79d3;});}});});});}})['then'](respondWithResult(_0x34402b,0xc9))[_0x3801('0x48')](handleError(_0x34402b,null));};exports['update']=function(_0xa8d65a,_0x401ddc){if(_0xa8d65a[_0x3801('0x4a')]['id']){delete _0xa8d65a[_0x3801('0x4a')]['id'];}return db[_0x3801('0x45')]['find']({'where':{'id':_0xa8d65a['params']['id']}})[_0x3801('0x28')](handleEntityNotFound(_0x401ddc,null))[_0x3801('0x28')](saveUpdates(_0xa8d65a['body'],null))[_0x3801('0x28')](respondWithResult(_0x401ddc,null))[_0x3801('0x48')](handleError(_0x401ddc,null));};exports['destroy']=function(_0x196602,_0x26ba9b){return db[_0x3801('0x45')][_0x3801('0x4e')]({'where':{'id':_0x196602[_0x3801('0x4c')]['id']}})[_0x3801('0x28')](handleEntityNotFound(_0x26ba9b,null))[_0x3801('0x28')](removeEntity(_0x26ba9b,null))[_0x3801('0x48')](handleError(_0x26ba9b,null));};exports[_0x3801('0x5c')]=function(_0x287384,_0x535028){return db['UserProfile'][_0x3801('0x5c')]()[_0x3801('0x28')](respondWithResult(_0x535028,null))[_0x3801('0x48')](handleError(_0x535028,null));};exports[_0x3801('0x5d')]=function(_0x3c7916,_0x3d6ce3){var _0x22c2c6=_0x3c7916[_0x3801('0x4a')];return db[_0x3801('0x45')]['find']({'where':{'id':_0x3c7916['params']['id']}})[_0x3801('0x28')](handleEntityNotFound(_0x3d6ce3,null))[_0x3801('0x28')](function(_0x2ecbab){if(_0x2ecbab){return db[_0x3801('0x5e')]['transaction'](function(_0x2403d6){return db[_0x3801('0x54')][_0x3801('0x29')]({'where':{'userProfileId':_0x3c7916['params']['id'],'sectionId':_[_0x3801('0x2e')](_0x22c2c6,function(_0x30ac99){return _0x30ac99['sectionId'];})},'transaction':_0x2403d6})['then'](function(){var _0x1e393c=_[_0x3801('0x2e')](_0x22c2c6,function(_0x18fbc6){_0x18fbc6['userProfileId']=_0x3c7916[_0x3801('0x4c')]['id'];return _0x18fbc6;});var _0x1edb61=[];return BPromise[_0x3801('0x56')](_0x1e393c,function(_0x4744aa){return db[_0x3801('0x54')][_0x3801('0x49')](_0x4744aa,{'include':[{'model':db[_0x3801('0x5b')],'as':_0x3801('0x5a')}],'raw':!![],'transaction':_0x2403d6})[_0x3801('0x28')](function(_0x31f678){_0x1edb61[_0x3801('0x5f')](_0x31f678[_0x3801('0x60')]({'plain':!![]}));});})[_0x3801('0x28')](function(){return _0x1edb61;});});});}})[_0x3801('0x28')](function(_0x463a60){return _0x463a60;})['then'](respondWithResult(_0x3d6ce3,null))[_0x3801('0x48')](handleError(_0x3d6ce3,null));};exports['removeSections']=function(_0x795418,_0x510f17){var _0x3b7eed;return db[_0x3801('0x45')][_0x3801('0x4e')]({'where':{'id':_0x795418[_0x3801('0x4c')]['id']},'attributes':['id',_0x3801('0x2c')]})[_0x3801('0x28')](handleEntityNotFound(_0x510f17,null))[_0x3801('0x28')](function(_0x12629b){if(_0x12629b){_0x3b7eed=_0x12629b;return db['UserProfileSection'][_0x3801('0x29')]({'where':{'userProfileId':_0x795418['params']['id'],'sectionId':_0x795418['query']['ids']}});}})[_0x3801('0x28')](function(){return _0x3b7eed;})[_0x3801('0x28')](respondWithStatusCode(_0x510f17,null))[_0x3801('0x48')](handleError(_0x510f17,null));};exports[_0x3801('0x61')]=function(_0x5c9c35,_0x44ba3b){var _0x19eb48=[];var _0x4d93ce=[];return db[_0x3801('0x54')][_0x3801('0x55')]({'where':{'userProfileId':_0x5c9c35[_0x3801('0x4c')]['id']},'raw':!![]})[_0x3801('0x28')](function(_0x4ec947){_0x19eb48=_[_0x3801('0x43')](_0x4ec947,function(_0x20dce6){return _0x20dce6[_0x3801('0x62')]===0x1||_[_0x3801('0x63')]([0x3eb,0x709],_0x20dce6[_0x3801('0x58')]);});if(!_['isEmpty'](_0x19eb48)){return _[_0x3801('0x2e')](_0x19eb48,function(_0x4fd277){return _0x4fd277[_0x3801('0x58')];});}else{return;}})['then'](function(_0x20e7dd){if(_0x20e7dd)_0x4d93ce=_0x20e7dd;if(_[_0x3801('0x63')](_0x4d93ce,0x64)){var _0x576c44=_[_0x3801('0x4e')](_0x19eb48,{'sectionId':0x64});return hasDefaultDashboard(_0x576c44)[_0x3801('0x28')](function(_0x29d2f9){return _[_0x3801('0x2e')](_0x19eb48,function(_0x593e87){if(_0x593e87[_0x3801('0x58')]===0x64){_0x593e87[_0x3801('0x64')]=_0x29d2f9;}return _0x593e87;});});}else{return;}})[_0x3801('0x28')](function(_0x52b14a){if(_0x52b14a)_0x19eb48=_0x52b14a;if(_[_0x3801('0x63')](_0x4d93ce,0x3eb)){var _0x5e76d3=_[_0x3801('0x4e')](_0x19eb48,{'sectionId':0x3eb});return getCustomDashboards(_0x5e76d3)['then'](function(_0x11e575){return _[_0x3801('0x2e')](_0x19eb48,function(_0x4f1df0){if(_0x5e76d3[_0x3801('0x62')]){if(_0x4f1df0[_0x3801('0x58')]===0x3eb){_0x4f1df0[_0x3801('0x64')]=_0x11e575;}}else{if(_0x4f1df0['sectionId']===0x64){_0x4f1df0[_0x3801('0x64')]=_0x11e575;}}return _0x4f1df0;});});}else{return;}})[_0x3801('0x28')](function(_0x2d10db){if(_0x2d10db)_0x19eb48=_0x2d10db;if(_[_0x3801('0x63')](_0x4d93ce,0x709)){var _0x37a383=_['find'](_0x19eb48,{'sectionId':0x709});return getPlugins(_0x37a383)[_0x3801('0x28')](function(_0x573309){if(_0x37a383[_0x3801('0x62')]){return _[_0x3801('0x2e')](_0x19eb48,function(_0x19af5f){if(_0x19af5f[_0x3801('0x58')]===0x709){_0x19af5f[_0x3801('0x64')]=_0x573309;}return _0x19af5f;});}else{var _0x2a1a46={'sectionId':0x76c,'enabled':0x1,'subsections':_0x573309};var _0x580b97=_[_0x3801('0x2e')](_0x19eb48);_0x580b97[_0x3801('0x5f')](_0x2a1a46);return _0x580b97;}});}else{return;}})[_0x3801('0x28')](function(_0x2db815){if(_0x2db815)_0x19eb48=_0x2db815;return _[_0x3801('0x43')](_0x19eb48,[_0x3801('0x62'),0x1]);})[_0x3801('0x28')](respondWithResult(_0x44ba3b,null))['catch'](handleError(_0x44ba3b,null));};function hasDefaultDashboard(_0x39afaf){var _0x850269=[0x65];return new BPromise(function(_0x4b5660,_0x4b459a){try{if(_0x39afaf[_0x3801('0x57')]){_0x4b5660(_0x850269);}else{return db['UserProfileResource'][_0x3801('0x65')]({'where':{'sectionId':_0x39afaf['id']},'raw':!![]})[_0x3801('0x28')](function(_0x9d920c){_0x9d920c?_0x4b5660(_0x850269):_0x4b5660();});}}catch(_0x297a61){_0x4b459a(_0x297a61);}});}function getCustomDashboards(_0x1b7745){var _0x5269d3=[];return new BPromise(function(_0x45511c,_0xf5b816){try{if(_0x1b7745[_0x3801('0x57')]){return db[_0x3801('0x66')]['findAll']({'raw':!![]})[_0x3801('0x28')](function(_0x1f6c2c){_0x1f6c2c[_0x3801('0x67')](function(_0x26b5aa){_0x5269d3[_0x3801('0x5f')](_0x26b5aa['id']+0x1869f);});_0x45511c(_0x5269d3);});}else{return db['UserProfileResource'][_0x3801('0x55')]({'where':{'sectionId':_0x1b7745['id']},'raw':!![]})[_0x3801('0x28')](function(_0x359e24){_0x359e24[_0x3801('0x67')](function(_0x545c36){_0x5269d3[_0x3801('0x5f')](_0x545c36[_0x3801('0x68')]+0x1869f);});_0x45511c(_0x5269d3);});}}catch(_0x2047fd){_0xf5b816(_0x2047fd);}});}function getPlugins(_0x36f0d0){var _0x213054=[];return new BPromise(function(_0x286552,_0x1a5125){try{if(_0x36f0d0[_0x3801('0x57')]){return db['Plugin'][_0x3801('0x55')]({'raw':!![]})['then'](function(_0x2ce2bf){_0x2ce2bf[_0x3801('0x67')](function(_0x4119b0){_0x213054['push'](_0x4119b0['id']+0x15b38);});_0x286552(_0x213054);});}else{return db[_0x3801('0x5b')]['findAll']({'where':{'sectionId':_0x36f0d0['id']},'raw':!![]})['then'](function(_0x3f757a){_0x3f757a[_0x3801('0x67')](function(_0x3b6ad0){_0x213054[_0x3801('0x5f')](_0x3b6ad0[_0x3801('0x68')]+0x15b38);});_0x286552(_0x213054);});}}catch(_0x19f3a4){_0x1a5125(_0x19f3a4);}});}exports[_0x3801('0x69')]=function(_0x1a381c,_0x3590ab){return db[_0x3801('0x45')][_0x3801('0x4e')]({'where':{'id':_0x1a381c[_0x3801('0x4c')]['id']}})[_0x3801('0x28')](handleEntityNotFound(_0x3590ab,null))[_0x3801('0x28')](function(_0x5c1eeb){if(_0x5c1eeb){return db[_0x3801('0x5e')][_0x3801('0x53')](function(_0x407fd8){return db[_0x3801('0x54')][_0x3801('0x55')]({'where':{'userProfileId':_0x1a381c[_0x3801('0x4c')]['id']},'attributes':['id'],'raw':!![]})[_0x3801('0x28')](function(_0xe9b586){if(_0xe9b586){return db[_0x3801('0x54')]['destroy']({'where':{'userProfileId':_0x1a381c[_0x3801('0x4c')]['id'],'id':_[_0x3801('0x2e')](_0xe9b586,function(_0x2b45f7){return _0x2b45f7['id'];})},'transaction':_0x407fd8});}})[_0x3801('0x28')](function(_0x48f49c){var _0x16b614=_['map'](_0x1a381c[_0x3801('0x4a')],function(_0x38d5f4){_0x38d5f4[_0x3801('0x59')]=_0x1a381c[_0x3801('0x4c')]['id'];return _0x38d5f4;});return db[_0x3801('0x54')]['bulkCreate'](_0x16b614,{'raw':!![],'transaction':_0x407fd8});})[_0x3801('0x28')](function(_0x4b6fea){var _0x377604=_[_0x3801('0x43')](_[_0x3801('0x2e')](_0x4b6fea,function(_0x12137c){return _0x12137c[_0x3801('0x60')]({'plain':!![]});}),{'includeAll':![]});if(_0x377604){return db[_0x3801('0x54')][_0x3801('0x55')]({'where':{'userProfileId':_0x1a381c[_0x3801('0x4c')]['id'],'sectionId':_[_0x3801('0x2e')](_0x377604,function(_0x328314){return _0x328314[_0x3801('0x58')];})},'attributes':['id',_0x3801('0x58')],'raw':!![]})[_0x3801('0x28')](function(_0x4b3063){var _0x5375fa=_[_0x3801('0x2e')](_0x1a381c['body'],function(_0x3625f6){_0x3625f6['userProfileId']=_0x1a381c[_0x3801('0x4c')]['id'];return _0x3625f6;});return db['UserProfileResource'][_0x3801('0x6a')](_0x5375fa,{'raw':!![],'transaction':_0x407fd8});});}})['catch'](handleError(_0x3590ab,null));});}})[_0x3801('0x28')](function(_0x565504){var _0x19e085=_[_0x3801('0x2e')](_0x565504,function(_0x119239){return _0x119239['get']({'plain':!![]});});})['then'](respondWithResult(_0x3590ab,null))[_0x3801('0x48')](handleError(_0x3590ab,null));};exports[_0x3801('0x6b')]=function(_0x37f526,_0x47223a,_0x4263fa){return db[_0x3801('0x45')][_0x3801('0x4e')]({'where':{'id':_0x37f526['params']['id']}})[_0x3801('0x28')](handleEntityNotFound(_0x47223a,null))[_0x3801('0x28')](function(_0x10d95b){if(_0x10d95b){return _0x10d95b[_0x3801('0x6b')](_0x37f526[_0x3801('0x33')][_0x3801('0x6c')]);}})['then'](respondWithStatusCode(_0x47223a,null))['catch'](handleError(_0x47223a,null));};exports[_0x3801('0x6d')]=function(_0x114e52,_0x525c0c){var _0x25dc6a={'raw':![],'where':{}};var _0xef3634={};var _0x201317={'count':0x0,'rows':[]};var _0x2eceb8=_0x114e52[_0x3801('0x33')]['section'];if(typeof _0x2eceb8===_0x3801('0x21')){throw new db[(_0x3801('0x6e'))]['ValidationError']('Unknown\x20section');}var _0x6d0554=_0x114e52['query'][_0x3801('0x6f')]||![];var _0x3b1fa6=getQueryModels(_0x2eceb8,_0x6d0554);if(typeof _0x3b1fa6['childModel']==='undefined'){throw new db[(_0x3801('0x6e'))][(_0x3801('0x70'))]('Invalid\x20section\x20\x27'+_0x2eceb8+'\x27');}var _0x1a5316=[];if(!_['isEmpty'](_0x3b1fa6['parentSections'])){_0x1a5316=_0x3b1fa6['parentSections'];}else{_0x1a5316=[{'name':_0x2eceb8}];}return db[_0x3801('0x45')][_0x3801('0x65')]({'where':{'id':_0x114e52['params']['id']}})[_0x3801('0x28')](handleEntityNotFound(_0x525c0c,null))[_0x3801('0x28')](function(_0x28d9b6){if(_0x28d9b6){var _0x5a448a=[];for(var _0x1e26ac=0x0;_0x1e26ac<_0x1a5316[_0x3801('0x39')];_0x1e26ac++){_0x5a448a['push'](db[_0x3801('0x54')][_0x3801('0x65')]({'where':{'userProfileId':_0x28d9b6['id'],'name':_0x1a5316[_0x1e26ac][_0x3801('0x2c')]},'raw':!![]}));}return BPromise[_0x3801('0x71')](_0x5a448a);}})[_0x3801('0x28')](function(_0x87bd9){var _0x30455b=_['filter'](_0x87bd9,function(_0x398e2b){return _0x398e2b?_0x398e2b:undefined;});var _0x4fa8ff=_['filter'](_0x1a5316,[_0x3801('0x72'),!![]]);var _0x1d11a7=_[_0x3801('0x73')](_0x30455b)&&_[_0x3801('0x73')](_0x4fa8ff)?null:_[_0x3801('0x74')](_0x4fa8ff,_0x30455b);if(_0x1d11a7){var _0x374f70=[];for(var _0x4765d3=0x0;_0x4765d3<_0x1d11a7[_0x3801('0x39')];_0x4765d3++){var _0x16a6b5=_[_0x3801('0x4e')](_0x1a5316,function(_0x6425e4){return _0x1d11a7[_0x4765d3]?_0x6425e4['name']===_0x1d11a7[_0x4765d3]['name']:null;});if(_0x16a6b5){if(_0x1d11a7[_0x4765d3][_0x3801('0x72')]){_0x374f70['push'](getAllResources(_0x3b1fa6[_0x3801('0x75')],_0x1d11a7[_0x4765d3]));}else{if(!_0x1d11a7[_0x4765d3][_0x3801('0x57')]){_0x374f70[_0x3801('0x5f')](getAllowedResources(_0x16a6b5,_0x1d11a7[_0x4765d3],_0x3b1fa6['childModel']));}else{if(_0x16a6b5['model']){_0x374f70[_0x3801('0x5f')](getAllFilteredResources(_0x16a6b5,_0x1d11a7[_0x4765d3]));}}}}}return BPromise['all'](_0x374f70);}else{return null;}})[_0x3801('0x28')](function(_0x278563){var _0x3cc65e=_0x278563;var _0x481fd7=null;if(_0x3cc65e){_0x481fd7=_0x3cc65e[_0x3801('0x39')]===0x1?_0x3cc65e[0x0]:null;}if(_0x481fd7||_0x3cc65e){var _0xb71bc5=db[_0x3b1fa6[_0x3801('0x75')]][_0x3801('0x2f')];_0xef3634[_0x3801('0x32')]=_['keys'](_0xb71bc5);_0xef3634[_0x3801('0x33')]=_[_0x3801('0x34')](_0x114e52['query']);_0xef3634[_0x3801('0x35')]=_[_0x3801('0x37')](_0xef3634[_0x3801('0x32')],_0xef3634[_0x3801('0x33')]);_0x25dc6a['attributes']=_[_0x3801('0x37')](_0xef3634[_0x3801('0x32')],qs[_0x3801('0x38')](_0x114e52[_0x3801('0x33')][_0x3801('0x38')]));_0x25dc6a[_0x3801('0x36')]=_0x25dc6a['attributes'][_0x3801('0x39')]?_0x25dc6a['attributes']:_0xef3634['model'];if(!_0x114e52[_0x3801('0x33')][_0x3801('0x3a')](_0x3801('0x3b'))){_0x25dc6a['limit']=qs[_0x3801('0x20')](_0x114e52[_0x3801('0x33')][_0x3801('0x20')]);_0x25dc6a[_0x3801('0x1f')]=qs[_0x3801('0x1f')](_0x114e52['query']['offset']);}_0x25dc6a[_0x3801('0x3c')]=qs[_0x3801('0x3d')](_0x114e52[_0x3801('0x33')]['sort']);_0x25dc6a[_0x3801('0x3e')]=qs[_0x3801('0x35')](_['pick'](_0x114e52['query'],_0xef3634[_0x3801('0x35')]));if(_0x114e52[_0x3801('0x33')][_0x3801('0x43')]){_0x25dc6a[_0x3801('0x3e')]=_['merge'](_0x25dc6a[_0x3801('0x3e')],{'$or':_[_0x3801('0x2e')](_0xb71bc5,function(_0x21c635){if(_0x21c635[_0x3801('0x41')][_0x3801('0x31')]!=='VIRTUAL'){var _0x2f3baa={};_0x2f3baa[_0x21c635[_0x3801('0x76')]]={'$like':'%'+_0x114e52[_0x3801('0x33')][_0x3801('0x43')]+'%'};return _0x2f3baa;}})});}var _0x29a47b=[];if(_0x481fd7){var _0x3ccf54=_[_0x3801('0x4e')](_0x1a5316,[_0x3801('0x2c'),_0x481fd7[_0x3801('0x2c')]]);if(_0x3ccf54[_0x3801('0x76')]){var _0x460b9e={};if(_0x3b1fa6['childModel']===_0x3801('0x77')){_0x460b9e[_0x3ccf54[_0x3801('0x78')]]=_[_0x3801('0x2e')](_0x481fd7[_0x3801('0x79')],'id');}else{_0x460b9e[_0x3ccf54[_0x3801('0x78')]]=_0x481fd7[_0x3801('0x79')];}_0x29a47b[_0x3801('0x5f')](_0x460b9e);}else{_0x25dc6a[_0x3801('0x3e')]['id']=_0x481fd7[_0x3801('0x79')];}}else{for(var _0x5da06e=0x0;_0x5da06e<_0x3cc65e[_0x3801('0x39')];_0x5da06e++){var _0x3ccf54=_[_0x3801('0x4e')](_0x1a5316,['name',_0x3cc65e[_0x5da06e][_0x3801('0x2c')]]);if(_0x3ccf54[_0x3801('0x76')]){var _0x460b9e={};_0x460b9e[_0x3ccf54['foreignKey']]=_0x3cc65e[_0x5da06e]['associatedResources'];_0x29a47b[_0x3801('0x5f')](_0x460b9e);}else{if(!_0x25dc6a[_0x3801('0x3e')]['id'])_0x25dc6a['where']['id']=[];_0x3cc65e[_0x5da06e][_0x3801('0x79')][_0x3801('0x67')](function(_0x3ad815){_0x25dc6a[_0x3801('0x3e')]['id']['push'](_0x3ad815);});}}}if(!_['isEmpty'](_0x29a47b)){_0x25dc6a[_0x3801('0x3e')]=_[_0x3801('0x40')](_0x25dc6a['where'],{'$and':{'$or':_0x29a47b}});}_0x25dc6a=_[_0x3801('0x40')]({},_0x25dc6a,_0x114e52[_0x3801('0x44')]);if(_0x481fd7&&!_0x481fd7[_0x3801('0x57')]&&_0x3b1fa6[_0x3801('0x75')]===_0x3801('0x77')){if(_0x114e52[_0x3801('0x33')][_0x3801('0x46')]){_0x25dc6a['include']=[{'all':!![]}];}return db[_0x3b1fa6[_0x3801('0x75')]][_0x3801('0x55')](_0x25dc6a)['then'](function(_0x137d58){var _0x1edd7d=[];_0x137d58[_0x3801('0x67')](function(_0x455068){var _0x59d11a;switch(_0x455068[_0x3801('0x7a')]){case _0x3801('0x7b'):_0x59d11a=_[_0x3801('0x4e')](_0x481fd7[_0x3801('0x79')],function(_0x199e8f){return _0x199e8f['id']===_0x455068[_0x3801('0x7c')]&&_0x199e8f[_0x3801('0x41')]===_0x3801('0x7d');});break;case _0x3801('0x7e'):_0x59d11a=_['find'](_0x481fd7['associatedResources'],function(_0x30c52e){return _0x30c52e['id']===_0x455068[_0x3801('0x7c')]&&_0x30c52e[_0x3801('0x41')]===_0x3801('0x7f');});break;}if(_0x59d11a)_0x1edd7d['push'](_0x455068);});_0x201317['count']=_0x1edd7d['length'];_0x201317[_0x3801('0x47')]=_0x1edd7d;return _0x201317;});}else{return db[_0x3b1fa6[_0x3801('0x75')]][_0x3801('0x22')]({'where':_0x25dc6a[_0x3801('0x3e')]})[_0x3801('0x28')](function(_0x526b57){_0x201317[_0x3801('0x22')]=_0x526b57;if(_0x114e52['query'][_0x3801('0x46')]){if(_0x3b1fa6[_0x3801('0x75')]===_0x3801('0x80')){_0x25dc6a[_0x3801('0x4d')]=[{'model':db[_0x3801('0x81')],'as':_0x3801('0x82'),'attributes':['id',_0x3801('0x2c'),_0x3801('0x83')],'required':_0x114e52[_0x3801('0x33')][_0x3801('0x84')]?!![]:![]},{'model':db['Tag'],'as':_0x3801('0x85'),'attributes':['id',_0x3801('0x2c'),_0x3801('0x83')],'through':_0x114e52[_0x3801('0x33')][_0x3801('0x84')]?{'attributes':[],'where':{'TagId':_0x114e52['query'][_0x3801('0x84')]||undefined}}:{},'required':_0x114e52[_0x3801('0x33')][_0x3801('0x84')]?!![]:![]}];}else{_0x25dc6a[_0x3801('0x4d')]=[{'all':!![]}];}}return db[_0x3b1fa6[_0x3801('0x75')]][_0x3801('0x55')](_0x25dc6a);})[_0x3801('0x28')](function(_0x10120c){_0x201317['rows']=_0x10120c;if(_0x2eceb8===_0x3801('0x86')&&_0x114e52[_0x3801('0x33')][_0x3801('0x87')]===_0x3801('0x88')){var _0x2484fe=[];for(var _0x11dfd4=0x0;_0x11dfd4<_0x201317['rows'][_0x3801('0x39')];_0x11dfd4++){_0x2484fe['push'](getOpenTabs(_0x3801('0x89'),_0x201317[_0x3801('0x47')][_0x11dfd4]['dataValues']));_0x2484fe[_0x3801('0x5f')](getOpenTabs(_0x3801('0x8a'),_0x201317['rows'][_0x11dfd4][_0x3801('0x8b')]));_0x2484fe[_0x3801('0x5f')](getOpenTabs(_0x3801('0x8c'),_0x201317['rows'][_0x11dfd4][_0x3801('0x8b')]));_0x2484fe[_0x3801('0x5f')](getOpenTabs(_0x3801('0x8d'),_0x201317[_0x3801('0x47')][_0x11dfd4][_0x3801('0x8b')]));_0x2484fe[_0x3801('0x5f')](getOpenTabs('openchannel',_0x201317[_0x3801('0x47')][_0x11dfd4][_0x3801('0x8b')]));_0x2484fe[_0x3801('0x5f')](getOpenTabs('whatsapp',_0x201317[_0x3801('0x47')][_0x11dfd4][_0x3801('0x8b')]));}return Promise['all'](_0x2484fe)[_0x3801('0x28')](function(){return _0x201317;});}return _0x201317;});}}else{return _0x201317;}})[_0x3801('0x28')](respondWithFilteredResult(_0x525c0c,_0x25dc6a))[_0x3801('0x48')](handleError(_0x525c0c,null));};function getOpenTabs(_0x21cf0b,_0xeff1eb){var _0x41ac75=_0x21cf0b['charAt'](0x0)[_0x3801('0x8e')]()+_0x21cf0b['slice'](0x1);var _0x4e27b2={'type':db[_0x3801('0x6e')][_0x3801('0x8f')][_0x3801('0x90')],'raw':!![]};return new BPromise(function(_0x2b9ab8,_0x58e691){var _0x4355a6=squel[_0x3801('0x91')]()[_0x3801('0x76')](_0x3801('0x92')+_0x41ac75+_0x3801('0x93'),'id')[_0x3801('0x76')](_0x3801('0x94'))[_0x3801('0x95')](_0x3801('0x96')+_0x21cf0b+_0x3801('0x97'),'ui')[_0x3801('0x3e')]('ui.UserId\x20=\x20?',_0xeff1eb['id']);return db[_0x3801('0x5e')][_0x3801('0x33')](_0x4355a6[_0x3801('0x98')](),_0x4e27b2)[_0x3801('0x28')](function(_0xddf13c){_0xeff1eb[_0x41ac75+_0x3801('0x99')]=_0xddf13c;_0x2b9ab8(_0xddf13c);})[_0x3801('0x48')](function(_0x3464e5){_0x58e691(_0x3464e5);});});}function getAllResources(_0x590ddb,_0x4f7927){return new BPromise(function(_0xdee7d2,_0x473d75){if(_0x4f7927){var _0x2ae49b=_0x4f7927[_0x3801('0x43')]?{[_0x4f7927[_0x3801('0x43')]['field']]:_0x4f7927[_0x3801('0x43')][_0x3801('0x9a')]}:undefined;return db[_0x590ddb][_0x3801('0x55')]({'where':_0x2ae49b,'raw':!![]})['then'](function(_0x4f16a0){_0x4f7927[_0x3801('0x79')]=_[_0x3801('0x2e')](_0x4f16a0,'id');_0xdee7d2(_0x4f7927);})[_0x3801('0x48')](function(_0x3ed777){_0x473d75(_0x3ed777);});}else{_0xdee7d2(null);}});}function getAllFilteredResources(_0x584020,_0x54a0e4){return new BPromise(function(_0x175b8e,_0x5e0acc){var _0x2040f8=_0x584020[_0x3801('0x43')]?{[_0x584020[_0x3801('0x43')]['field']]:_0x584020[_0x3801('0x43')][_0x3801('0x9a')]}:undefined;return db[_0x584020[_0x3801('0x32')]][_0x3801('0x55')]({'where':_0x2040f8,'raw':!![]})[_0x3801('0x28')](function(_0x554039){_0x54a0e4['associatedResources']=_[_0x3801('0x2e')](_0x554039,function(_0x32b31c){return _0x584020['field']?_0x32b31c[_0x584020[_0x3801('0x76')]]:_0x32b31c[_0x3801('0x2c')];});_0x175b8e(_0x54a0e4);})['catch'](function(_0x118176){_0x5e0acc(_0x118176);});});}function getAllowedResources(_0x1b001e,_0x3e6402,_0x48ea51){return new BPromise(function(_0x57382f,_0x30e4dd){if(_0x3e6402){return db[_0x3801('0x5b')][_0x3801('0x55')]({'where':{'sectionId':_0x3e6402['id']},'raw':!![]})['then'](function(_0x108484){if(_0x1b001e[_0x3801('0x76')]&&_0x1b001e[_0x3801('0x76')]!=='id'){_0x3e6402[_0x3801('0x79')]=_[_0x3801('0x2e')](_0x108484,function(_0x451687){return _0x451687[_0x1b001e[_0x3801('0x76')]];});}else{if(_0x48ea51===_0x3801('0x77')){_0x3e6402['associatedResources']=_[_0x3801('0x2e')](_0x108484,function(_0x9221d1){return{'id':_0x9221d1['resourceId'],'type':_0x9221d1[_0x3801('0x41')]};});}else{_0x3e6402[_0x3801('0x79')]=_[_0x3801('0x2e')](_0x108484,function(_0x498490){return _0x498490[_0x3801('0x68')];});}}_0x57382f(_0x3e6402);})[_0x3801('0x48')](function(_0x2bdb8f){_0x30e4dd(_0x2bdb8f);});}else{_0x57382f(null);}});}function getQueryModels(_0x200fc8,_0x3dd684){var _0x2ee79a=_0x200fc8['toLowerCase']();var _0x3490d5={'childModel':undefined,'parentSections':[]};switch(_0x2ee79a){case'squareprojects':_0x3490d5[_0x3801('0x75')]=_0x3801('0x9b');break;case _0x3801('0x9c'):_0x3490d5[_0x3801('0x75')]='SquareOdbc';break;case'squarerecordings':_0x3490d5[_0x3801('0x75')]=_0x3801('0x9d');_0x3490d5[_0x3801('0x9e')]=[{'name':_0x3801('0x9f'),'field':_0x3801('0x2c'),'foreignKey':_0x3801('0xa0')}];break;case'projects':_0x3490d5[_0x3801('0x75')]='JscriptyProject';break;case _0x3801('0xa1'):_0x3490d5[_0x3801('0x75')]=_0x3801('0x80');_0x3490d5[_0x3801('0x9e')]=[{'name':_0x3801('0xa2'),'field':'id','foreignKey':'ListId'}];break;case _0x3801('0xa3'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xa4');break;case _0x3801('0xa5'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xa6');break;case _0x3801('0xa7'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xa8');break;case _0x3801('0xa9'):_0x3490d5['childModel']=_0x3801('0xaa');break;case'chatwebsites':_0x3490d5[_0x3801('0x75')]='ChatWebsite';break;case'faxqueues':_0x3490d5[_0x3801('0x75')]=_0x3801('0xab');break;case _0x3801('0xac'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xad');break;case'inboundroutes':case _0x3801('0xae'):case _0x3801('0xaf'):_0x3490d5['childModel']=_0x3801('0xb0');break;case _0x3801('0xb1'):_0x3490d5[_0x3801('0x75')]='VoiceContext';break;case _0x3801('0xb2'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xb3');break;case _0x3801('0xb4'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xb5');_0x3490d5[_0x3801('0x9e')]=[{'name':_0x3801('0x86'),'field':_0x3801('0x2c'),'foreignKey':_0x3801('0xb6'),'model':_0x3801('0xb7'),'filter':{'field':_0x3801('0xb8'),'value':[_0x3801('0xb9')]}},{'name':_0x3801('0xba'),'field':_0x3801('0x2c'),'foreignKey':_0x3801('0xb6'),'model':'User','filter':{'field':'role','value':[_0x3801('0xbb')]}},{'name':_0x3801('0xbc'),'field':'name','foreignKey':_0x3801('0xbd'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x3801('0xbe')]}},{'name':_0x3801('0xbf'),'field':_0x3801('0x2c'),'foreignKey':_0x3801('0xbd'),'model':'VoiceQueue','filter':{'field':_0x3801('0x41'),'value':['outbound']}}];break;case _0x3801('0xc0'):_0x3490d5['childModel']=_0x3801('0xc1');break;case'chanspies':_0x3490d5[_0x3801('0x75')]=_0x3801('0xc2');break;case _0x3801('0xc3'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xc4');break;case'ivrcampaigns':_0x3490d5['childModel']=_0x3801('0xc5');break;case _0x3801('0xc6'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xc7');break;case'mailaccounts':_0x3490d5[_0x3801('0x75')]=_0x3801('0xc8');break;case _0x3801('0xc9'):_0x3490d5[_0x3801('0x75')]='MailSubstatus';break;case _0x3801('0xca'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xcb');break;case _0x3801('0xcc'):_0x3490d5[_0x3801('0x75')]='OpenchannelAccount';break;case _0x3801('0xcd'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xce');break;case _0x3801('0xcf'):_0x3490d5['childModel']=_0x3801('0xd0');break;case'whatsappqueues':_0x3490d5[_0x3801('0x75')]=_0x3801('0xd1');break;case'teams':_0x3490d5[_0x3801('0x75')]=_0x3801('0xd2');break;case _0x3801('0xd3'):case _0x3801('0xd4'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xd5');if(_0x3dd684){_0x3490d5[_0x3801('0x9e')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case'users':case _0x3801('0xd6'):case'telephones':_0x3490d5['childModel']='User';if(_0x3dd684){_0x3490d5[_0x3801('0x9e')]=[{'name':_0x3801('0xd7'),'filter':{'field':_0x3801('0xb8'),'value':[_0x3801('0xd8'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x3801('0xba')}];}break;case _0x3801('0xd9'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xda');break;case _0x3801('0xdb'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xdc');break;case _0x3801('0xdd'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xde');break;case _0x3801('0xdf'):_0x3490d5['childModel']=_0x3801('0xe0');break;case _0x3801('0xe1'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xe2');break;case'zohoaccounts':_0x3490d5[_0x3801('0x75')]=_0x3801('0xe3');break;case _0x3801('0xe4'):_0x3490d5['childModel']=_0x3801('0xb7');break;case _0x3801('0xe5'):_0x3490d5['childModel']='CannedAnswer';break;case'dispositions':_0x3490d5['childModel']=_0x3801('0xe6');break;case _0x3801('0xe7'):_0x3490d5['childModel']='Dashboard';break;case _0x3801('0xe8'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xe9');break;case'pauses':_0x3490d5['childModel']=_0x3801('0xea');break;case _0x3801('0xeb'):_0x3490d5['childModel']=_0x3801('0xec');break;case _0x3801('0xed'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xee');break;case _0x3801('0xef'):_0x3490d5[_0x3801('0x75')]=_0x3801('0x81');break;case _0x3801('0xf0'):_0x3490d5['childModel']=_0x3801('0xf1');break;case _0x3801('0xf2'):_0x3490d5[_0x3801('0x75')]='Trigger';break;case _0x3801('0xf3'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xf4');break;case'variables':_0x3490d5['childModel']=_0x3801('0xf5');break;case _0x3801('0xf6'):_0x3490d5[_0x3801('0x75')]='Plugin';break;case _0x3801('0xf7'):_0x3490d5['childModel']=_0x3801('0x77');_0x3490d5['parentSections']=[{'name':_0x3801('0xf8'),'field':'id','foreignKey':'reportId'}];break;case _0x3801('0xf9'):_0x3490d5[_0x3801('0x75')]='AnalyticMetric';break;case _0x3801('0xfa'):_0x3490d5[_0x3801('0x75')]=_0x3801('0xfb');break;case _0x3801('0xfc'):_0x3490d5['childModel']='ScreenRecording';_0x3490d5['parentSections']=[{'name':_0x3801('0x86'),'field':'id','foreignKey':'UserId','model':_0x3801('0xb7'),'filter':{'field':_0x3801('0xb8'),'value':[_0x3801('0xb9')]}},{'name':_0x3801('0xba'),'field':'id','foreignKey':_0x3801('0xfd'),'model':_0x3801('0xb7'),'filter':{'field':_0x3801('0xb8'),'value':[_0x3801('0xbb')]}}];break;default:return _0x3490d5;}return _0x3490d5;} \ No newline at end of file +var _0xfe9b=['Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','contexts','VoiceMail','voicerecordings','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','teams','voicequeues','queuecampaigns','agents','telephones','Users','admin','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','intervals','scheduler','Schedule','Sound','templates','Template','triggers','Trunk','variables','Variable','plugins','Plugin','metrics','AnalyticMetric','whatsappaccounts','WhatsappAccount','UserId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','include','rows','show','includeAll','options','catch','create','body','clone','params','find','get','omit','createdAt','updatedAt','crudPermissions','sequelize','UserProfileSection','findAll','autoAssociation','UserProfileResource','userProfileId','Resources','describe','addSections','transaction','each','removeSections','ids','getSections','enabled','isEmpty','sectionId','includes','subsections','findOne','forEach','push','resourceId','addResources','bulkCreate','removeResources','getResources','section','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','ignore','all','order','pick','field','AnalyticExtractedReport','foreignKey','associatedResources','reportId','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','Agents','openTabs','chat','dataValues','fax','mail','openchannel','whatsapp','toUpperCase','slice','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','OpenTabs','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','projectName','JscriptyProject','contacts'];(function(_0x4f283a,_0x1495c1){var _0x2e81fa=function(_0x20efef){while(--_0x20efef){_0x4f283a['push'](_0x4f283a['shift']());}};_0x2e81fa(++_0x1495c1);}(_0xfe9b,0x159));var _0xbfe9=function(_0x25eb5e,_0x161649){_0x25eb5e=_0x25eb5e-0x0;var _0xa6b70e=_0xfe9b[_0x25eb5e];return _0xa6b70e;};'use strict';var emlformat=require(_0xbfe9('0x0'));var rimraf=require(_0xbfe9('0x1'));var zipdir=require(_0xbfe9('0x2'));var jsonpatch=require(_0xbfe9('0x3'));var rp=require(_0xbfe9('0x4'));var moment=require(_0xbfe9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbfe9('0x6'));var util=require(_0xbfe9('0x7'));var path=require(_0xbfe9('0x8'));var sox=require(_0xbfe9('0x9'));var csv=require(_0xbfe9('0xa'));var ejs=require(_0xbfe9('0xb'));var fs=require('fs');var fs_extra=require(_0xbfe9('0xc'));var _=require(_0xbfe9('0xd'));var squel=require(_0xbfe9('0xe'));var crypto=require(_0xbfe9('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xbfe9('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbfe9('0x11'));var Papa=require('papaparse');var Redis=require(_0xbfe9('0x12'));var authService=require(_0xbfe9('0x13'));var qs=require(_0xbfe9('0x14'));var as=require(_0xbfe9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbfe9('0x16'))('api');var utils=require(_0xbfe9('0x17'));var config=require(_0xbfe9('0x18'));var licenseUtil=require(_0xbfe9('0x19'));var db=require(_0xbfe9('0x1a'))['db'];config[_0xbfe9('0x1b')]=_[_0xbfe9('0x1c')](config[_0xbfe9('0x1b')],{'host':_0xbfe9('0x1d'),'port':0x18eb});var socket=require(_0xbfe9('0x1e'))(new Redis(config[_0xbfe9('0x1b')]));require(_0xbfe9('0x1f'))[_0xbfe9('0x20')](socket);function respondWithStatusCode(_0x21fa85,_0x195958){_0x195958=_0x195958||0xcc;return function(_0x4faaa4){if(_0x4faaa4){return _0x21fa85[_0xbfe9('0x21')](_0x195958);}return _0x21fa85['status'](_0x195958)[_0xbfe9('0x22')]();};}function respondWithResult(_0x6de7f3,_0x5b398d){_0x5b398d=_0x5b398d||0xc8;return function(_0x3bd5fd){if(_0x3bd5fd){return _0x6de7f3[_0xbfe9('0x23')](_0x5b398d)[_0xbfe9('0x24')](_0x3bd5fd);}};}function respondWithFilteredResult(_0x279065,_0x349eee){return function(_0x1ab799){if(_0x1ab799){var _0x18c6f6=typeof _0x349eee[_0xbfe9('0x25')]===_0xbfe9('0x26')&&typeof _0x349eee['limit']===_0xbfe9('0x26');var _0x511859=_0x1ab799[_0xbfe9('0x27')];var _0xdcf55=_0x18c6f6?0x0:_0x349eee[_0xbfe9('0x25')];var _0x54e275=_0x18c6f6?_0x1ab799[_0xbfe9('0x27')]:_0x349eee[_0xbfe9('0x25')]+_0x349eee[_0xbfe9('0x28')];var _0x5791b9;if(_0x54e275>=_0x511859){_0x54e275=_0x511859;_0x5791b9=0xc8;}else{_0x5791b9=0xce;}_0x279065[_0xbfe9('0x23')](_0x5791b9);return _0x279065[_0xbfe9('0x29')](_0xbfe9('0x2a'),_0xdcf55+'-'+_0x54e275+'/'+_0x511859)[_0xbfe9('0x24')](_0x1ab799);}return null;};}function patchUpdates(_0x17a1af){return function(_0x16d49d){try{jsonpatch[_0xbfe9('0x2b')](_0x16d49d,_0x17a1af,!![]);}catch(_0x2b2a64){return BPromise[_0xbfe9('0x2c')](_0x2b2a64);}return _0x16d49d[_0xbfe9('0x2d')]();};}function saveUpdates(_0x2ded8c,_0x14d8a9){return function(_0x4d23a9){if(_0x4d23a9){return _0x4d23a9[_0xbfe9('0x2e')](_0x2ded8c)[_0xbfe9('0x2f')](function(_0x476ab7){return _0x476ab7;});}return null;};}function removeEntity(_0x16bd91,_0x199e60){return function(_0x4fa4f4){if(_0x4fa4f4){return _0x4fa4f4[_0xbfe9('0x30')]()['then'](function(){_0x16bd91['status'](0xcc)[_0xbfe9('0x22')]();});}};}function handleEntityNotFound(_0x393fee,_0x11f610){return function(_0xec5488){if(!_0xec5488){_0x393fee[_0xbfe9('0x21')](0x194);}return _0xec5488;};}function handleError(_0x19d6fa,_0x4345ac){_0x4345ac=_0x4345ac||0x1f4;return function(_0x1f0910){logger[_0xbfe9('0x31')](_0x1f0910[_0xbfe9('0x32')]);if(_0x1f0910[_0xbfe9('0x33')]){delete _0x1f0910['name'];}_0x19d6fa[_0xbfe9('0x23')](_0x4345ac)[_0xbfe9('0x34')](_0x1f0910);};}exports['index']=function(_0x5d011b,_0x4a7bd2){var _0x2538d0={},_0x4029c4={},_0x4ec70d={'count':0x0,'rows':[]};var _0x4967ed=_[_0xbfe9('0x35')](db[_0xbfe9('0x36')][_0xbfe9('0x37')],function(_0x1fff51){return{'name':_0x1fff51[_0xbfe9('0x38')],'type':_0x1fff51[_0xbfe9('0x39')][_0xbfe9('0x3a')]};});_0x4029c4['model']=_['map'](_0x4967ed,_0xbfe9('0x33'));_0x4029c4[_0xbfe9('0x3b')]=_[_0xbfe9('0x3c')](_0x5d011b[_0xbfe9('0x3b')]);_0x4029c4[_0xbfe9('0x3d')]=_[_0xbfe9('0x3e')](_0x4029c4[_0xbfe9('0x3f')],_0x4029c4[_0xbfe9('0x3b')]);_0x2538d0['attributes']=_['intersection'](_0x4029c4[_0xbfe9('0x3f')],qs[_0xbfe9('0x40')](_0x5d011b[_0xbfe9('0x3b')][_0xbfe9('0x40')]));_0x2538d0[_0xbfe9('0x41')]=_0x2538d0[_0xbfe9('0x41')][_0xbfe9('0x42')]?_0x2538d0[_0xbfe9('0x41')]:_0x4029c4[_0xbfe9('0x3f')];if(!_0x5d011b[_0xbfe9('0x3b')][_0xbfe9('0x43')](_0xbfe9('0x44'))){_0x2538d0[_0xbfe9('0x28')]=qs[_0xbfe9('0x28')](_0x5d011b[_0xbfe9('0x3b')][_0xbfe9('0x28')]);_0x2538d0['offset']=qs[_0xbfe9('0x25')](_0x5d011b[_0xbfe9('0x3b')][_0xbfe9('0x25')]);}_0x2538d0['order']=qs[_0xbfe9('0x45')](_0x5d011b[_0xbfe9('0x3b')][_0xbfe9('0x45')]);_0x2538d0[_0xbfe9('0x46')]=qs[_0xbfe9('0x3d')](_['pick'](_0x5d011b[_0xbfe9('0x3b')],_0x4029c4['filters']),_0x4967ed);if(_0x5d011b[_0xbfe9('0x3b')][_0xbfe9('0x47')]){_0x2538d0[_0xbfe9('0x46')]=_['merge'](_0x2538d0[_0xbfe9('0x46')],{'$or':_[_0xbfe9('0x35')](_0x4967ed,function(_0x5dcc54){if(_0x5dcc54[_0xbfe9('0x39')]!==_0xbfe9('0x48')){var _0x1dbcd8={};_0x1dbcd8[_0x5dcc54[_0xbfe9('0x33')]]={'$like':'%'+_0x5d011b[_0xbfe9('0x3b')]['filter']+'%'};return _0x1dbcd8;}})});}_0x2538d0=_[_0xbfe9('0x49')]({},_0x2538d0,_0x5d011b['options']);var _0x3735a7={'where':_0x2538d0[_0xbfe9('0x46')]};return db[_0xbfe9('0x36')][_0xbfe9('0x27')](_0x3735a7)[_0xbfe9('0x2f')](function(_0x297b09){_0x4ec70d['count']=_0x297b09;if(_0x5d011b[_0xbfe9('0x3b')]['includeAll']){_0x2538d0[_0xbfe9('0x4a')]=[{'all':!![]}];}return db[_0xbfe9('0x36')]['findAll'](_0x2538d0);})['then'](function(_0x4b478a){_0x4ec70d[_0xbfe9('0x4b')]=_0x4b478a;return _0x4ec70d;})[_0xbfe9('0x2f')](respondWithFilteredResult(_0x4a7bd2,_0x2538d0))['catch'](handleError(_0x4a7bd2,null));};exports[_0xbfe9('0x4c')]=function(_0x3912e4,_0x40971d){var _0x589bcd={'raw':![],'where':{'id':_0x3912e4['params']['id']}},_0x48724f={};_0x48724f['model']=_['keys'](db[_0xbfe9('0x36')][_0xbfe9('0x37')]);_0x48724f['query']=_[_0xbfe9('0x3c')](_0x3912e4[_0xbfe9('0x3b')]);_0x48724f[_0xbfe9('0x3d')]=_[_0xbfe9('0x3e')](_0x48724f[_0xbfe9('0x3f')],_0x48724f['query']);_0x589bcd['attributes']=_[_0xbfe9('0x3e')](_0x48724f[_0xbfe9('0x3f')],qs['fields'](_0x3912e4[_0xbfe9('0x3b')][_0xbfe9('0x40')]));_0x589bcd[_0xbfe9('0x41')]=_0x589bcd['attributes'][_0xbfe9('0x42')]?_0x589bcd['attributes']:_0x48724f[_0xbfe9('0x3f')];if(_0x3912e4[_0xbfe9('0x3b')][_0xbfe9('0x4d')]){_0x589bcd['include']=[{'all':!![]}];}_0x589bcd=_['merge']({},_0x589bcd,_0x3912e4[_0xbfe9('0x4e')]);return db[_0xbfe9('0x36')]['find'](_0x589bcd)[_0xbfe9('0x2f')](handleEntityNotFound(_0x40971d,null))[_0xbfe9('0x2f')](respondWithResult(_0x40971d,null))[_0xbfe9('0x4f')](handleError(_0x40971d,null));};exports['create']=function(_0x1e70c4,_0x185a90){return db[_0xbfe9('0x36')][_0xbfe9('0x50')](_0x1e70c4[_0xbfe9('0x51')],{})[_0xbfe9('0x2f')](respondWithResult(_0x185a90,0xc9))[_0xbfe9('0x4f')](handleError(_0x185a90,null));};exports[_0xbfe9('0x52')]=function(_0x2d6ea2,_0x4328e1){var _0x3fe868={'where':{'id':_0x2d6ea2[_0xbfe9('0x53')]['id']}},_0x29d149={};_0x29d149[_0xbfe9('0x3f')]=_[_0xbfe9('0x3c')](db[_0xbfe9('0x36')][_0xbfe9('0x37')]);_0x3fe868[_0xbfe9('0x41')]=_['intersection'](_0x29d149['model'],qs[_0xbfe9('0x40')](_0x2d6ea2['query']['fields']));_0x3fe868[_0xbfe9('0x41')]=_0x3fe868[_0xbfe9('0x41')][_0xbfe9('0x42')]?_0x3fe868[_0xbfe9('0x41')]:_0x29d149['model'];if(_0x2d6ea2[_0xbfe9('0x3b')][_0xbfe9('0x4d')]){_0x3fe868[_0xbfe9('0x4a')]=[{'all':!![]}];}_0x3fe868=_['merge']({},_0x3fe868,_0x2d6ea2[_0xbfe9('0x4e')]);return db[_0xbfe9('0x36')][_0xbfe9('0x54')](_0x3fe868)[_0xbfe9('0x2f')](handleEntityNotFound(_0x4328e1,null))[_0xbfe9('0x2f')](function(_0x31ea32){if(_0x31ea32){var _0x1bca86=_0x31ea32[_0xbfe9('0x55')]({'plain':!![]});_0x1bca86=qs[_0xbfe9('0x56')](_0x1bca86,['id',_0xbfe9('0x57'),_0xbfe9('0x58'),_0xbfe9('0x59')]);_0x2d6ea2[_0xbfe9('0x51')]=_[_0xbfe9('0x56')](_0x2d6ea2['body'],['id','createdAt',_0xbfe9('0x58')]);return db[_0xbfe9('0x5a')]['transaction'](function(_0x4bde37){return db[_0xbfe9('0x36')]['create'](_[_0xbfe9('0x49')](_0x1bca86,_0x2d6ea2[_0xbfe9('0x51')]),{'include':_0x2d6ea2['query'][_0xbfe9('0x4d')]?[{'all':!![]}]:undefined,'transaction':_0x4bde37})[_0xbfe9('0x2f')](function(_0x1332be){var _0x221ef2=_0x1332be[_0xbfe9('0x55')]({'plain':!![]});return db[_0xbfe9('0x5b')][_0xbfe9('0x5c')]({'where':{'userProfileId':_0x2d6ea2['params']['id']},'raw':!![]})[_0xbfe9('0x2f')](function(_0x354dc1){if(_0x354dc1){return BPromise['each'](_0x354dc1,function(_0x296f1e){return new BPromise(function(_0x22a0a7,_0x346461){if(_0x296f1e[_0xbfe9('0x5d')]===null||_0x296f1e[_0xbfe9('0x5d')]===0x1)_0x22a0a7(null);return db[_0xbfe9('0x5e')][_0xbfe9('0x5c')]({'where':{'sectionId':_0x296f1e['id']},'raw':!![]})[_0xbfe9('0x2f')](function(_0x38f7fe){var _0x27f6ca=_['map'](_0x38f7fe,function(_0x46533f){return qs[_0xbfe9('0x56')](_0x46533f,['id',_0xbfe9('0x57'),_0xbfe9('0x58'),'sectionId']);});_0x22a0a7(_0x27f6ca);})[_0xbfe9('0x4f')](function(_0x41a5e7){_0x346461(_0x41a5e7);});})[_0xbfe9('0x2f')](function(_0x44dc9f){var _0x3ecc2a=qs[_0xbfe9('0x56')](_0x296f1e,['id','createdAt',_0xbfe9('0x58')]);_0x3ecc2a[_0xbfe9('0x5f')]=_0x221ef2['id'];if(_0x44dc9f)_0x3ecc2a[_0xbfe9('0x60')]=_0x44dc9f;return _0x3ecc2a;})[_0xbfe9('0x2f')](function(_0x654418){return db['UserProfileSection'][_0xbfe9('0x50')](_0x654418,{'include':[{'model':db[_0xbfe9('0x5e')],'as':'Resources'}],'raw':!![],'transaction':_0x4bde37});});})[_0xbfe9('0x2f')](function(){return _0x221ef2;});}});});});}})['then'](respondWithResult(_0x4328e1,0xc9))[_0xbfe9('0x4f')](handleError(_0x4328e1,null));};exports['update']=function(_0x66d6a2,_0x5580f4){if(_0x66d6a2[_0xbfe9('0x51')]['id']){delete _0x66d6a2['body']['id'];}return db[_0xbfe9('0x36')][_0xbfe9('0x54')]({'where':{'id':_0x66d6a2[_0xbfe9('0x53')]['id']}})[_0xbfe9('0x2f')](handleEntityNotFound(_0x5580f4,null))[_0xbfe9('0x2f')](saveUpdates(_0x66d6a2[_0xbfe9('0x51')],null))[_0xbfe9('0x2f')](respondWithResult(_0x5580f4,null))[_0xbfe9('0x4f')](handleError(_0x5580f4,null));};exports['destroy']=function(_0x29d224,_0x3caba3){return db[_0xbfe9('0x36')]['find']({'where':{'id':_0x29d224['params']['id']}})[_0xbfe9('0x2f')](handleEntityNotFound(_0x3caba3,null))['then'](removeEntity(_0x3caba3,null))[_0xbfe9('0x4f')](handleError(_0x3caba3,null));};exports[_0xbfe9('0x61')]=function(_0x15ebc3,_0x38fd53){return db[_0xbfe9('0x36')]['describe']()[_0xbfe9('0x2f')](respondWithResult(_0x38fd53,null))['catch'](handleError(_0x38fd53,null));};exports[_0xbfe9('0x62')]=function(_0x4a7e18,_0x5ec9af){var _0x328410=_0x4a7e18['body'];return db[_0xbfe9('0x36')][_0xbfe9('0x54')]({'where':{'id':_0x4a7e18[_0xbfe9('0x53')]['id']}})[_0xbfe9('0x2f')](handleEntityNotFound(_0x5ec9af,null))[_0xbfe9('0x2f')](function(_0x23f56a){if(_0x23f56a){return db[_0xbfe9('0x5a')][_0xbfe9('0x63')](function(_0xb86ad6){return db[_0xbfe9('0x5b')]['destroy']({'where':{'userProfileId':_0x4a7e18[_0xbfe9('0x53')]['id'],'sectionId':_[_0xbfe9('0x35')](_0x328410,function(_0x2da18f){return _0x2da18f['sectionId'];})},'transaction':_0xb86ad6})[_0xbfe9('0x2f')](function(){var _0x55f4b4=_[_0xbfe9('0x35')](_0x328410,function(_0x48fef4){_0x48fef4[_0xbfe9('0x5f')]=_0x4a7e18[_0xbfe9('0x53')]['id'];return _0x48fef4;});var _0x485585=[];return BPromise[_0xbfe9('0x64')](_0x55f4b4,function(_0x4f90c0){return db['UserProfileSection'][_0xbfe9('0x50')](_0x4f90c0,{'include':[{'model':db[_0xbfe9('0x5e')],'as':'Resources'}],'raw':!![],'transaction':_0xb86ad6})[_0xbfe9('0x2f')](function(_0x3361db){_0x485585['push'](_0x3361db[_0xbfe9('0x55')]({'plain':!![]}));});})[_0xbfe9('0x2f')](function(){return _0x485585;});});});}})[_0xbfe9('0x2f')](function(_0x11a98a){return _0x11a98a;})[_0xbfe9('0x2f')](respondWithResult(_0x5ec9af,null))[_0xbfe9('0x4f')](handleError(_0x5ec9af,null));};exports[_0xbfe9('0x65')]=function(_0x1fa7eb,_0x22372f){var _0x31084f;return db[_0xbfe9('0x36')]['find']({'where':{'id':_0x1fa7eb[_0xbfe9('0x53')]['id']},'attributes':['id','name']})[_0xbfe9('0x2f')](handleEntityNotFound(_0x22372f,null))[_0xbfe9('0x2f')](function(_0x4d0aac){if(_0x4d0aac){_0x31084f=_0x4d0aac;return db[_0xbfe9('0x5b')][_0xbfe9('0x30')]({'where':{'userProfileId':_0x1fa7eb['params']['id'],'sectionId':_0x1fa7eb[_0xbfe9('0x3b')][_0xbfe9('0x66')]}});}})[_0xbfe9('0x2f')](function(){return _0x31084f;})[_0xbfe9('0x2f')](respondWithStatusCode(_0x22372f,null))[_0xbfe9('0x4f')](handleError(_0x22372f,null));};exports[_0xbfe9('0x67')]=function(_0x31a0b4,_0x6183e3){var _0x526616=[];var _0x1c7fd0=[];return db[_0xbfe9('0x5b')][_0xbfe9('0x5c')]({'where':{'userProfileId':_0x31a0b4[_0xbfe9('0x53')]['id']},'raw':!![]})[_0xbfe9('0x2f')](function(_0x13db4d){_0x526616=_[_0xbfe9('0x47')](_0x13db4d,function(_0x54da5d){return _0x54da5d[_0xbfe9('0x68')]===0x1||_['includes']([0x3eb,0x709],_0x54da5d['sectionId']);});if(!_[_0xbfe9('0x69')](_0x526616)){return _[_0xbfe9('0x35')](_0x526616,function(_0x4f0a18){return _0x4f0a18[_0xbfe9('0x6a')];});}else{return;}})[_0xbfe9('0x2f')](function(_0x4e6f85){if(_0x4e6f85)_0x1c7fd0=_0x4e6f85;if(_[_0xbfe9('0x6b')](_0x1c7fd0,0x64)){var _0x524532=_['find'](_0x526616,{'sectionId':0x64});return hasDefaultDashboard(_0x524532)[_0xbfe9('0x2f')](function(_0x24f30c){return _[_0xbfe9('0x35')](_0x526616,function(_0x4b7f97){if(_0x4b7f97[_0xbfe9('0x6a')]===0x64){_0x4b7f97[_0xbfe9('0x6c')]=_0x24f30c;}return _0x4b7f97;});});}else{return;}})[_0xbfe9('0x2f')](function(_0x4d5895){if(_0x4d5895)_0x526616=_0x4d5895;if(_[_0xbfe9('0x6b')](_0x1c7fd0,0x3eb)){var _0xb43a8c=_[_0xbfe9('0x54')](_0x526616,{'sectionId':0x3eb});return getCustomDashboards(_0xb43a8c)[_0xbfe9('0x2f')](function(_0x28df43){return _['map'](_0x526616,function(_0x34f163){if(_0xb43a8c[_0xbfe9('0x68')]){if(_0x34f163[_0xbfe9('0x6a')]===0x3eb){_0x34f163['subsections']=_0x28df43;}}else{if(_0x34f163[_0xbfe9('0x6a')]===0x64){_0x34f163['subsections']=_0x28df43;}}return _0x34f163;});});}else{return;}})[_0xbfe9('0x2f')](function(_0x50ca2){if(_0x50ca2)_0x526616=_0x50ca2;if(_[_0xbfe9('0x6b')](_0x1c7fd0,0x709)){var _0x559eec=_[_0xbfe9('0x54')](_0x526616,{'sectionId':0x709});return getPlugins(_0x559eec)[_0xbfe9('0x2f')](function(_0x27eb22){if(_0x559eec[_0xbfe9('0x68')]){return _[_0xbfe9('0x35')](_0x526616,function(_0x431825){if(_0x431825[_0xbfe9('0x6a')]===0x709){_0x431825[_0xbfe9('0x6c')]=_0x27eb22;}return _0x431825;});}else{var _0x532bb9={'sectionId':0x76c,'enabled':0x1,'subsections':_0x27eb22};var _0x365218=_['map'](_0x526616);_0x365218['push'](_0x532bb9);return _0x365218;}});}else{return;}})[_0xbfe9('0x2f')](function(_0x2dce06){if(_0x2dce06)_0x526616=_0x2dce06;return _[_0xbfe9('0x47')](_0x526616,['enabled',0x1]);})['then'](respondWithResult(_0x6183e3,null))[_0xbfe9('0x4f')](handleError(_0x6183e3,null));};function hasDefaultDashboard(_0x2b17cf){var _0x1372a6=[0x65];return new BPromise(function(_0x2db760,_0x100168){try{if(_0x2b17cf[_0xbfe9('0x5d')]){_0x2db760(_0x1372a6);}else{return db[_0xbfe9('0x5e')][_0xbfe9('0x6d')]({'where':{'sectionId':_0x2b17cf['id']},'raw':!![]})['then'](function(_0x22fff5){_0x22fff5?_0x2db760(_0x1372a6):_0x2db760();});}}catch(_0x26e3af){_0x100168(_0x26e3af);}});}function getCustomDashboards(_0x432a90){var _0x328206=[];return new BPromise(function(_0x280cfb,_0x194136){try{if(_0x432a90[_0xbfe9('0x5d')]){return db['Dashboard'][_0xbfe9('0x5c')]({'raw':!![]})[_0xbfe9('0x2f')](function(_0x4fae54){_0x4fae54[_0xbfe9('0x6e')](function(_0x3b82a9){_0x328206[_0xbfe9('0x6f')](_0x3b82a9['id']+0x1869f);});_0x280cfb(_0x328206);});}else{return db[_0xbfe9('0x5e')][_0xbfe9('0x5c')]({'where':{'sectionId':_0x432a90['id']},'raw':!![]})[_0xbfe9('0x2f')](function(_0x23885f){_0x23885f[_0xbfe9('0x6e')](function(_0x3a40a3){_0x328206[_0xbfe9('0x6f')](_0x3a40a3['resourceId']+0x1869f);});_0x280cfb(_0x328206);});}}catch(_0x42fe3e){_0x194136(_0x42fe3e);}});}function getPlugins(_0x31f47e){var _0x202c17=[];return new BPromise(function(_0x48adb8,_0x2d0ddc){try{if(_0x31f47e['autoAssociation']){return db['Plugin'][_0xbfe9('0x5c')]({'raw':!![]})[_0xbfe9('0x2f')](function(_0x1ddb52){_0x1ddb52[_0xbfe9('0x6e')](function(_0x23c45e){_0x202c17[_0xbfe9('0x6f')](_0x23c45e['id']+0x15b38);});_0x48adb8(_0x202c17);});}else{return db[_0xbfe9('0x5e')][_0xbfe9('0x5c')]({'where':{'sectionId':_0x31f47e['id']},'raw':!![]})[_0xbfe9('0x2f')](function(_0x213c58){_0x213c58[_0xbfe9('0x6e')](function(_0x4c0e18){_0x202c17[_0xbfe9('0x6f')](_0x4c0e18[_0xbfe9('0x70')]+0x15b38);});_0x48adb8(_0x202c17);});}}catch(_0x25db3d){_0x2d0ddc(_0x25db3d);}});}exports[_0xbfe9('0x71')]=function(_0x244923,_0x4e6d2e){return db[_0xbfe9('0x36')]['find']({'where':{'id':_0x244923['params']['id']}})[_0xbfe9('0x2f')](handleEntityNotFound(_0x4e6d2e,null))[_0xbfe9('0x2f')](function(_0x25658b){if(_0x25658b){return db['sequelize']['transaction'](function(_0x1a7610){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x244923[_0xbfe9('0x53')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x3a2016){if(_0x3a2016){return db[_0xbfe9('0x5b')][_0xbfe9('0x30')]({'where':{'userProfileId':_0x244923[_0xbfe9('0x53')]['id'],'id':_[_0xbfe9('0x35')](_0x3a2016,function(_0x54230e){return _0x54230e['id'];})},'transaction':_0x1a7610});}})['then'](function(_0x43d91f){var _0x57eb17=_[_0xbfe9('0x35')](_0x244923[_0xbfe9('0x51')],function(_0x177dea){_0x177dea[_0xbfe9('0x5f')]=_0x244923['params']['id'];return _0x177dea;});return db[_0xbfe9('0x5b')]['bulkCreate'](_0x57eb17,{'raw':!![],'transaction':_0x1a7610});})[_0xbfe9('0x2f')](function(_0x41def2){var _0xea30fb=_[_0xbfe9('0x47')](_['map'](_0x41def2,function(_0x10aa75){return _0x10aa75['get']({'plain':!![]});}),{'includeAll':![]});if(_0xea30fb){return db['UserProfileSection'][_0xbfe9('0x5c')]({'where':{'userProfileId':_0x244923['params']['id'],'sectionId':_['map'](_0xea30fb,function(_0x14b58f){return _0x14b58f[_0xbfe9('0x6a')];})},'attributes':['id',_0xbfe9('0x6a')],'raw':!![]})['then'](function(_0x1d9cc0){var _0x3a6f43=_[_0xbfe9('0x35')](_0x244923[_0xbfe9('0x51')],function(_0x32ae1e){_0x32ae1e[_0xbfe9('0x5f')]=_0x244923['params']['id'];return _0x32ae1e;});return db['UserProfileResource'][_0xbfe9('0x72')](_0x3a6f43,{'raw':!![],'transaction':_0x1a7610});});}})['catch'](handleError(_0x4e6d2e,null));});}})[_0xbfe9('0x2f')](function(_0x4a1485){var _0x2de861=_[_0xbfe9('0x35')](_0x4a1485,function(_0x1d225c){return _0x1d225c[_0xbfe9('0x55')]({'plain':!![]});});})['then'](respondWithResult(_0x4e6d2e,null))[_0xbfe9('0x4f')](handleError(_0x4e6d2e,null));};exports[_0xbfe9('0x73')]=function(_0x24641b,_0x4f544a,_0xe892fd){return db[_0xbfe9('0x36')]['find']({'where':{'id':_0x24641b[_0xbfe9('0x53')]['id']}})['then'](handleEntityNotFound(_0x4f544a,null))[_0xbfe9('0x2f')](function(_0x4502eb){if(_0x4502eb){return _0x4502eb[_0xbfe9('0x73')](_0x24641b[_0xbfe9('0x3b')][_0xbfe9('0x66')]);}})[_0xbfe9('0x2f')](respondWithStatusCode(_0x4f544a,null))['catch'](handleError(_0x4f544a,null));};exports[_0xbfe9('0x74')]=function(_0x3bd703,_0x308d12){var _0x4bada4={'raw':![],'where':{}};var _0x325a65={};var _0x4aa7d1={'count':0x0,'rows':[]};var _0x362caf=_0x3bd703['query'][_0xbfe9('0x75')];if(typeof _0x362caf===_0xbfe9('0x26')){throw new db[(_0xbfe9('0x76'))][(_0xbfe9('0x77'))](_0xbfe9('0x78'));}var _0x57b716=_0x3bd703[_0xbfe9('0x3b')][_0xbfe9('0x79')]||![];var _0x4916f2=getQueryModels(_0x362caf,_0x57b716);if(typeof _0x4916f2[_0xbfe9('0x7a')]===_0xbfe9('0x26')){throw new db[(_0xbfe9('0x76'))][(_0xbfe9('0x77'))](_0xbfe9('0x7b')+_0x362caf+'\x27');}var _0x2ad5cc=[];if(!_[_0xbfe9('0x69')](_0x4916f2['parentSections'])){_0x2ad5cc=_0x4916f2[_0xbfe9('0x7c')];}else{_0x2ad5cc=[{'name':_0x362caf}];}return db[_0xbfe9('0x36')][_0xbfe9('0x6d')]({'where':{'id':_0x3bd703['params']['id']}})[_0xbfe9('0x2f')](handleEntityNotFound(_0x308d12,null))[_0xbfe9('0x2f')](function(_0x5eb1d8){if(_0x5eb1d8){var _0x2b9671=[];for(var _0x5d9cef=0x0;_0x5d9cef<_0x2ad5cc['length'];_0x5d9cef++){_0x2b9671[_0xbfe9('0x6f')](db[_0xbfe9('0x5b')]['findOne']({'where':{'userProfileId':_0x5eb1d8['id'],'name':_0x2ad5cc[_0x5d9cef][_0xbfe9('0x33')]},'raw':!![]}));}return BPromise['all'](_0x2b9671);}})['then'](function(_0x5bd038){var _0x13ccec=_[_0xbfe9('0x47')](_0x5bd038,function(_0x7557ed){return _0x7557ed?_0x7557ed:undefined;});var _0x3ff2a7=_[_0xbfe9('0x47')](_0x2ad5cc,[_0xbfe9('0x7d'),!![]]);var _0x50ba7f=_[_0xbfe9('0x69')](_0x13ccec)&&_[_0xbfe9('0x69')](_0x3ff2a7)?null:_['union'](_0x3ff2a7,_0x13ccec);if(_0x50ba7f){var _0x32d5b1=[];for(var _0x2c4dff=0x0;_0x2c4dff<_0x50ba7f[_0xbfe9('0x42')];_0x2c4dff++){var _0x532d8e=_['find'](_0x2ad5cc,function(_0x3c995a){return _0x50ba7f[_0x2c4dff]?_0x3c995a[_0xbfe9('0x33')]===_0x50ba7f[_0x2c4dff][_0xbfe9('0x33')]:null;});if(_0x532d8e){if(_0x50ba7f[_0x2c4dff][_0xbfe9('0x7d')]){_0x32d5b1[_0xbfe9('0x6f')](getAllResources(_0x4916f2['childModel'],_0x50ba7f[_0x2c4dff]));}else{if(!_0x50ba7f[_0x2c4dff][_0xbfe9('0x5d')]){_0x32d5b1['push'](getAllowedResources(_0x532d8e,_0x50ba7f[_0x2c4dff],_0x4916f2[_0xbfe9('0x7a')]));}else{if(_0x532d8e[_0xbfe9('0x3f')]){_0x32d5b1[_0xbfe9('0x6f')](getAllFilteredResources(_0x532d8e,_0x50ba7f[_0x2c4dff]));}}}}}return BPromise[_0xbfe9('0x7e')](_0x32d5b1);}else{return null;}})[_0xbfe9('0x2f')](function(_0x1ec76a){var _0x122905=_0x1ec76a;var _0xc36dd5=null;if(_0x122905){_0xc36dd5=_0x122905[_0xbfe9('0x42')]===0x1?_0x122905[0x0]:null;}if(_0xc36dd5||_0x122905){var _0x272c04=db[_0x4916f2[_0xbfe9('0x7a')]][_0xbfe9('0x37')];_0x325a65[_0xbfe9('0x3f')]=_[_0xbfe9('0x3c')](_0x272c04);_0x325a65[_0xbfe9('0x3b')]=_[_0xbfe9('0x3c')](_0x3bd703[_0xbfe9('0x3b')]);_0x325a65[_0xbfe9('0x3d')]=_[_0xbfe9('0x3e')](_0x325a65[_0xbfe9('0x3f')],_0x325a65[_0xbfe9('0x3b')]);_0x4bada4[_0xbfe9('0x41')]=_[_0xbfe9('0x3e')](_0x325a65['model'],qs[_0xbfe9('0x40')](_0x3bd703[_0xbfe9('0x3b')][_0xbfe9('0x40')]));_0x4bada4[_0xbfe9('0x41')]=_0x4bada4['attributes'][_0xbfe9('0x42')]?_0x4bada4[_0xbfe9('0x41')]:_0x325a65[_0xbfe9('0x3f')];if(!_0x3bd703[_0xbfe9('0x3b')]['hasOwnProperty'](_0xbfe9('0x44'))){_0x4bada4[_0xbfe9('0x28')]=qs[_0xbfe9('0x28')](_0x3bd703[_0xbfe9('0x3b')][_0xbfe9('0x28')]);_0x4bada4[_0xbfe9('0x25')]=qs[_0xbfe9('0x25')](_0x3bd703[_0xbfe9('0x3b')][_0xbfe9('0x25')]);}_0x4bada4[_0xbfe9('0x7f')]=qs[_0xbfe9('0x45')](_0x3bd703[_0xbfe9('0x3b')][_0xbfe9('0x45')]);_0x4bada4[_0xbfe9('0x46')]=qs[_0xbfe9('0x3d')](_[_0xbfe9('0x80')](_0x3bd703[_0xbfe9('0x3b')],_0x325a65['filters']));if(_0x3bd703['query'][_0xbfe9('0x47')]){_0x4bada4[_0xbfe9('0x46')]=_[_0xbfe9('0x49')](_0x4bada4['where'],{'$or':_[_0xbfe9('0x35')](_0x272c04,function(_0xea60ba){if(_0xea60ba[_0xbfe9('0x39')]['key']!==_0xbfe9('0x48')){var _0x1d2908={};_0x1d2908[_0xea60ba[_0xbfe9('0x81')]]={'$like':'%'+_0x3bd703[_0xbfe9('0x3b')]['filter']+'%'};return _0x1d2908;}})});}var _0xb9ad62=[];if(_0xc36dd5){var _0x41acd5=_[_0xbfe9('0x54')](_0x2ad5cc,['name',_0xc36dd5[_0xbfe9('0x33')]]);if(_0x41acd5[_0xbfe9('0x81')]){var _0xd6e42={};if(_0x4916f2[_0xbfe9('0x7a')]===_0xbfe9('0x82')){_0xd6e42[_0x41acd5[_0xbfe9('0x83')]]=_[_0xbfe9('0x35')](_0xc36dd5['associatedResources'],'id');}else{_0xd6e42[_0x41acd5[_0xbfe9('0x83')]]=_0xc36dd5['associatedResources'];}_0xb9ad62[_0xbfe9('0x6f')](_0xd6e42);}else{_0x4bada4['where']['id']=_0xc36dd5[_0xbfe9('0x84')];}}else{for(var _0x4b9673=0x0;_0x4b9673<_0x122905[_0xbfe9('0x42')];_0x4b9673++){var _0x41acd5=_['find'](_0x2ad5cc,[_0xbfe9('0x33'),_0x122905[_0x4b9673][_0xbfe9('0x33')]]);if(_0x41acd5['field']){var _0xd6e42={};_0xd6e42[_0x41acd5[_0xbfe9('0x83')]]=_0x122905[_0x4b9673][_0xbfe9('0x84')];_0xb9ad62[_0xbfe9('0x6f')](_0xd6e42);}else{if(!_0x4bada4['where']['id'])_0x4bada4['where']['id']=[];_0x122905[_0x4b9673][_0xbfe9('0x84')][_0xbfe9('0x6e')](function(_0x420eb1){_0x4bada4[_0xbfe9('0x46')]['id'][_0xbfe9('0x6f')](_0x420eb1);});}}}if(!_[_0xbfe9('0x69')](_0xb9ad62)){_0x4bada4[_0xbfe9('0x46')]=_['merge'](_0x4bada4[_0xbfe9('0x46')],{'$and':{'$or':_0xb9ad62}});}_0x4bada4=_[_0xbfe9('0x49')]({},_0x4bada4,_0x3bd703[_0xbfe9('0x4e')]);if(_0xc36dd5&&!_0xc36dd5[_0xbfe9('0x5d')]&&_0x4916f2[_0xbfe9('0x7a')]===_0xbfe9('0x82')){if(_0x3bd703[_0xbfe9('0x3b')]['includeAll']){_0x4bada4[_0xbfe9('0x4a')]=[{'all':!![]}];}return db[_0x4916f2[_0xbfe9('0x7a')]][_0xbfe9('0x5c')](_0x4bada4)[_0xbfe9('0x2f')](function(_0x2ba0a0){var _0x44d42d=[];_0x2ba0a0['forEach'](function(_0x40dfe3){var _0x1d6dea;switch(_0x40dfe3['reportType']){case'default':_0x1d6dea=_[_0xbfe9('0x54')](_0xc36dd5[_0xbfe9('0x84')],function(_0x2d56e2){return _0x2d56e2['id']===_0x40dfe3[_0xbfe9('0x85')]&&_0x2d56e2['type']===_0xbfe9('0x86');});break;case _0xbfe9('0x87'):_0x1d6dea=_['find'](_0xc36dd5['associatedResources'],function(_0x231623){return _0x231623['id']===_0x40dfe3[_0xbfe9('0x85')]&&_0x231623[_0xbfe9('0x39')]===_0xbfe9('0x88');});break;}if(_0x1d6dea)_0x44d42d[_0xbfe9('0x6f')](_0x40dfe3);});_0x4aa7d1[_0xbfe9('0x27')]=_0x44d42d['length'];_0x4aa7d1[_0xbfe9('0x4b')]=_0x44d42d;return _0x4aa7d1;});}else{return db[_0x4916f2[_0xbfe9('0x7a')]]['count']({'where':_0x4bada4[_0xbfe9('0x46')]})['then'](function(_0x1c6019){_0x4aa7d1[_0xbfe9('0x27')]=_0x1c6019;if(_0x3bd703[_0xbfe9('0x3b')][_0xbfe9('0x4d')]){if(_0x4916f2[_0xbfe9('0x7a')]===_0xbfe9('0x89')){_0x4bada4['include']=[{'model':db[_0xbfe9('0x8a')],'as':_0xbfe9('0x8b'),'attributes':['id',_0xbfe9('0x33'),_0xbfe9('0x8c')],'required':_0x3bd703['query'][_0xbfe9('0x8d')]?!![]:![]},{'model':db[_0xbfe9('0x8a')],'as':_0xbfe9('0x8e'),'attributes':['id',_0xbfe9('0x33'),'color'],'through':_0x3bd703[_0xbfe9('0x3b')][_0xbfe9('0x8d')]?{'attributes':[],'where':{'TagId':_0x3bd703[_0xbfe9('0x3b')][_0xbfe9('0x8d')]||undefined}}:{},'required':_0x3bd703[_0xbfe9('0x3b')][_0xbfe9('0x8d')]?!![]:![]}];}else{_0x4bada4[_0xbfe9('0x4a')]=[{'all':!![]}];}}return db[_0x4916f2[_0xbfe9('0x7a')]][_0xbfe9('0x5c')](_0x4bada4);})[_0xbfe9('0x2f')](function(_0x4af5b3){_0x4aa7d1[_0xbfe9('0x4b')]=_0x4af5b3;if(_0x362caf===_0xbfe9('0x8f')&&_0x3bd703[_0xbfe9('0x3b')][_0xbfe9('0x90')]==='true'){var _0x54cb8e=[];for(var _0x590032=0x0;_0x590032<_0x4aa7d1[_0xbfe9('0x4b')]['length'];_0x590032++){_0x54cb8e[_0xbfe9('0x6f')](getOpenTabs(_0xbfe9('0x91'),_0x4aa7d1[_0xbfe9('0x4b')][_0x590032]['dataValues']));_0x54cb8e[_0xbfe9('0x6f')](getOpenTabs('sms',_0x4aa7d1[_0xbfe9('0x4b')][_0x590032][_0xbfe9('0x92')]));_0x54cb8e[_0xbfe9('0x6f')](getOpenTabs(_0xbfe9('0x93'),_0x4aa7d1[_0xbfe9('0x4b')][_0x590032][_0xbfe9('0x92')]));_0x54cb8e[_0xbfe9('0x6f')](getOpenTabs(_0xbfe9('0x94'),_0x4aa7d1['rows'][_0x590032][_0xbfe9('0x92')]));_0x54cb8e[_0xbfe9('0x6f')](getOpenTabs(_0xbfe9('0x95'),_0x4aa7d1[_0xbfe9('0x4b')][_0x590032][_0xbfe9('0x92')]));_0x54cb8e['push'](getOpenTabs(_0xbfe9('0x96'),_0x4aa7d1[_0xbfe9('0x4b')][_0x590032]['dataValues']));}return Promise['all'](_0x54cb8e)['then'](function(){return _0x4aa7d1;});}return _0x4aa7d1;});}}else{return _0x4aa7d1;}})[_0xbfe9('0x2f')](respondWithFilteredResult(_0x308d12,_0x4bada4))[_0xbfe9('0x4f')](handleError(_0x308d12,null));};function getOpenTabs(_0x27713e,_0xdaf078){var _0x4dce90=_0x27713e['charAt'](0x0)[_0xbfe9('0x97')]()+_0x27713e[_0xbfe9('0x98')](0x1);var _0x37a22c={'type':db[_0xbfe9('0x76')][_0xbfe9('0x99')][_0xbfe9('0x9a')],'raw':!![]};return new BPromise(function(_0x1b3899,_0x19763c){var _0x4ec811=squel['select']()[_0xbfe9('0x81')](_0xbfe9('0x9b')+_0x4dce90+_0xbfe9('0x9c'),'id')[_0xbfe9('0x81')](_0xbfe9('0x9d'))[_0xbfe9('0x9e')](_0xbfe9('0x9f')+_0x27713e+_0xbfe9('0xa0'),'ui')[_0xbfe9('0x46')]('ui.UserId\x20=\x20?',_0xdaf078['id']);return db[_0xbfe9('0x5a')][_0xbfe9('0x3b')](_0x4ec811['toString'](),_0x37a22c)['then'](function(_0x814918){_0xdaf078[_0x4dce90+_0xbfe9('0xa1')]=_0x814918;_0x1b3899(_0x814918);})[_0xbfe9('0x4f')](function(_0x456243){_0x19763c(_0x456243);});});}function getAllResources(_0x5a1d3a,_0x45b4b4){return new BPromise(function(_0x222385,_0x3af5d4){if(_0x45b4b4){var _0x5bbb83=_0x45b4b4[_0xbfe9('0x47')]?{[_0x45b4b4[_0xbfe9('0x47')][_0xbfe9('0x81')]]:_0x45b4b4[_0xbfe9('0x47')][_0xbfe9('0xa2')]}:undefined;return db[_0x5a1d3a][_0xbfe9('0x5c')]({'where':_0x5bbb83,'raw':!![]})[_0xbfe9('0x2f')](function(_0x948c9b){_0x45b4b4[_0xbfe9('0x84')]=_[_0xbfe9('0x35')](_0x948c9b,'id');_0x222385(_0x45b4b4);})[_0xbfe9('0x4f')](function(_0x1f38dd){_0x3af5d4(_0x1f38dd);});}else{_0x222385(null);}});}function getAllFilteredResources(_0x3bb609,_0x71f113){return new BPromise(function(_0x1c622b,_0x2b726e){var _0x4d2f71=_0x3bb609[_0xbfe9('0x47')]?{[_0x3bb609[_0xbfe9('0x47')][_0xbfe9('0x81')]]:_0x3bb609[_0xbfe9('0x47')][_0xbfe9('0xa2')]}:undefined;return db[_0x3bb609[_0xbfe9('0x3f')]][_0xbfe9('0x5c')]({'where':_0x4d2f71,'raw':!![]})[_0xbfe9('0x2f')](function(_0x4a170f){_0x71f113[_0xbfe9('0x84')]=_[_0xbfe9('0x35')](_0x4a170f,function(_0x310f7c){return _0x3bb609['field']?_0x310f7c[_0x3bb609['field']]:_0x310f7c[_0xbfe9('0x33')];});_0x1c622b(_0x71f113);})[_0xbfe9('0x4f')](function(_0x3ba3b9){_0x2b726e(_0x3ba3b9);});});}function getAllowedResources(_0xf705ad,_0x39315e,_0x2cafa8){return new BPromise(function(_0xe8d691,_0x521915){if(_0x39315e){return db[_0xbfe9('0x5e')][_0xbfe9('0x5c')]({'where':{'sectionId':_0x39315e['id']},'raw':!![]})[_0xbfe9('0x2f')](function(_0x34bf72){if(_0xf705ad[_0xbfe9('0x81')]&&_0xf705ad[_0xbfe9('0x81')]!=='id'){_0x39315e['associatedResources']=_[_0xbfe9('0x35')](_0x34bf72,function(_0x4cd709){return _0x4cd709[_0xf705ad[_0xbfe9('0x81')]];});}else{if(_0x2cafa8===_0xbfe9('0x82')){_0x39315e[_0xbfe9('0x84')]=_[_0xbfe9('0x35')](_0x34bf72,function(_0x30a777){return{'id':_0x30a777[_0xbfe9('0x70')],'type':_0x30a777[_0xbfe9('0x39')]};});}else{_0x39315e[_0xbfe9('0x84')]=_[_0xbfe9('0x35')](_0x34bf72,function(_0x26582e){return _0x26582e['resourceId'];});}}_0xe8d691(_0x39315e);})['catch'](function(_0x3f0bde){_0x521915(_0x3f0bde);});}else{_0xe8d691(null);}});}function getQueryModels(_0x54ee1f,_0x4ce30e){var _0x3872e8=_0x54ee1f[_0xbfe9('0xa3')]();var _0x5ff606={'childModel':undefined,'parentSections':[]};switch(_0x3872e8){case _0xbfe9('0xa4'):_0x5ff606['childModel']=_0xbfe9('0xa5');break;case _0xbfe9('0xa6'):_0x5ff606['childModel']=_0xbfe9('0xa7');break;case _0xbfe9('0xa8'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xa9');_0x5ff606[_0xbfe9('0x7c')]=[{'name':'SquareProjects','field':_0xbfe9('0x33'),'foreignKey':_0xbfe9('0xaa')}];break;case'projects':_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xab');break;case _0xbfe9('0xac'):_0x5ff606[_0xbfe9('0x7a')]='CmContact';_0x5ff606[_0xbfe9('0x7c')]=[{'name':_0xbfe9('0xad'),'field':'id','foreignKey':_0xbfe9('0xae')}];break;case _0xbfe9('0xaf'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xb0');break;case _0xbfe9('0xb1'):_0x5ff606['childModel']=_0xbfe9('0xb2');break;case _0xbfe9('0xb3'):_0x5ff606['childModel']=_0xbfe9('0xb4');break;case _0xbfe9('0xb5'):_0x5ff606[_0xbfe9('0x7a')]='ChatQueue';break;case'chatwebsites':_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xb6');break;case _0xbfe9('0xb7'):_0x5ff606['childModel']=_0xbfe9('0xb8');break;case _0xbfe9('0xb9'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xba');break;case'inboundroutes':case _0xbfe9('0xbb'):case _0xbfe9('0xbc'):_0x5ff606[_0xbfe9('0x7a')]='VoiceExtension';break;case _0xbfe9('0xbd'):_0x5ff606[_0xbfe9('0x7a')]='VoiceContext';break;case'voicemails':_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xbe');break;case _0xbfe9('0xbf'):_0x5ff606[_0xbfe9('0x7a')]='VoiceRecording';_0x5ff606[_0xbfe9('0x7c')]=[{'name':_0xbfe9('0x8f'),'field':_0xbfe9('0x33'),'foreignKey':_0xbfe9('0xc0'),'model':_0xbfe9('0xc1'),'filter':{'field':_0xbfe9('0xc2'),'value':[_0xbfe9('0xc3')]}},{'name':_0xbfe9('0xc4'),'field':_0xbfe9('0x33'),'foreignKey':_0xbfe9('0xc0'),'model':_0xbfe9('0xc1'),'filter':{'field':_0xbfe9('0xc2'),'value':[_0xbfe9('0xc5')]}},{'name':_0xbfe9('0xc6'),'field':'name','foreignKey':_0xbfe9('0xc7'),'model':_0xbfe9('0xc8'),'filter':{'field':_0xbfe9('0x39'),'value':[_0xbfe9('0xc9')]}},{'name':_0xbfe9('0xca'),'field':_0xbfe9('0x33'),'foreignKey':_0xbfe9('0xc7'),'model':_0xbfe9('0xc8'),'filter':{'field':_0xbfe9('0x39'),'value':['outbound']}}];break;case _0xbfe9('0xcb'):_0x5ff606[_0xbfe9('0x7a')]='VoiceMusicOnHold';break;case'chanspies':_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xcc');break;case'voiceprefixes':_0x5ff606['childModel']=_0xbfe9('0xcd');break;case _0xbfe9('0xce'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xcf');break;case'mailqueues':_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xd0');break;case _0xbfe9('0xd1'):_0x5ff606[_0xbfe9('0x7a')]='MailAccount';break;case _0xbfe9('0xd2'):_0x5ff606[_0xbfe9('0x7a')]='MailSubstatus';break;case _0xbfe9('0xd3'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xd4');break;case _0xbfe9('0xd5'):_0x5ff606[_0xbfe9('0x7a')]='OpenchannelAccount';break;case _0xbfe9('0xd6'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xd7');break;case _0xbfe9('0xd8'):_0x5ff606[_0xbfe9('0x7a')]='SmsAccount';break;case _0xbfe9('0xd9'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xda');break;case _0xbfe9('0xdb'):_0x5ff606['childModel']='Team';break;case _0xbfe9('0xdc'):case _0xbfe9('0xdd'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xc8');if(_0x4ce30e){_0x5ff606['parentSections']=[{'name':_0xbfe9('0xc6')},{'name':_0xbfe9('0xca')}];}break;case'users':case _0xbfe9('0xde'):case _0xbfe9('0xdf'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xc1');if(_0x4ce30e){_0x5ff606[_0xbfe9('0x7c')]=[{'name':_0xbfe9('0xe0'),'filter':{'field':_0xbfe9('0xc2'),'value':[_0xbfe9('0xe1'),_0xbfe9('0xe2')]},'ignore':!![]},{'name':'Agents'},{'name':_0xbfe9('0xc4')}];}break;case'zendeskaccounts':_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xe3');break;case _0xbfe9('0xe4'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xe5');break;case _0xbfe9('0xe6'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xe7');break;case _0xbfe9('0xe8'):_0x5ff606[_0xbfe9('0x7a')]='SugarcrmAccount';break;case _0xbfe9('0xe9'):_0x5ff606['childModel']=_0xbfe9('0xea');break;case _0xbfe9('0xeb'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xec');break;case'vtigeraccounts':_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xc1');break;case _0xbfe9('0xed'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xee');break;case _0xbfe9('0xef'):_0x5ff606['childModel']='Disposition';break;case _0xbfe9('0xf0'):_0x5ff606['childModel']=_0xbfe9('0xf1');break;case _0xbfe9('0xf2'):_0x5ff606['childModel']='Interval';break;case'pauses':_0x5ff606[_0xbfe9('0x7a')]='Pause';break;case _0xbfe9('0xf3'):_0x5ff606['childModel']=_0xbfe9('0xf4');break;case'sounds':_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xf5');break;case'tags':_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0x8a');break;case _0xbfe9('0xf6'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xf7');break;case _0xbfe9('0xf8'):_0x5ff606[_0xbfe9('0x7a')]='Trigger';break;case'trunks':_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xf9');break;case _0xbfe9('0xfa'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xfb');break;case _0xbfe9('0xfc'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xfd');break;case'extractedreports':_0x5ff606['childModel']=_0xbfe9('0x82');_0x5ff606['parentSections']=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0xbfe9('0xfe'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0xff');break;case _0xbfe9('0x100'):_0x5ff606[_0xbfe9('0x7a')]=_0xbfe9('0x101');break;case'screenrecordings':_0x5ff606[_0xbfe9('0x7a')]='ScreenRecording';_0x5ff606[_0xbfe9('0x7c')]=[{'name':_0xbfe9('0x8f'),'field':'id','foreignKey':'UserId','model':_0xbfe9('0xc1'),'filter':{'field':_0xbfe9('0xc2'),'value':[_0xbfe9('0xc3')]}},{'name':'Telephones','field':'id','foreignKey':_0xbfe9('0x102'),'model':_0xbfe9('0xc1'),'filter':{'field':'role','value':[_0xbfe9('0xc5')]}}];break;default:return _0x5ff606;}return _0x5ff606;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index f7a66ed..9bc7cd2 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 _0x5a6e=['hasOwnProperty','hook','exports','../../mysqldb','UserProfile','save','update','remove','emit'];(function(_0x35f1e7,_0x50f26e){var _0xefc085=function(_0x359cd5){while(--_0x359cd5){_0x35f1e7['push'](_0x35f1e7['shift']());}};_0xefc085(++_0x50f26e);}(_0x5a6e,0x17d));var _0xe5a6=function(_0x215393,_0x4c406d){_0x215393=_0x215393-0x0;var _0x595198=_0x5a6e[_0x215393];return _0x595198;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xe5a6('0x0'))['db'][_0xe5a6('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe5a6('0x2'),'afterUpdate':_0xe5a6('0x3'),'afterDestroy':_0xe5a6('0x4')};function emitEvent(_0x1653de){return function(_0x1adfb7,_0x113b1f,_0x38bbe6){UserProfileEvents[_0xe5a6('0x5')](_0x1653de+':'+_0x1adfb7['id'],_0x1adfb7);UserProfileEvents[_0xe5a6('0x5')](_0x1653de,_0x1adfb7);_0x38bbe6(null);};}for(var e in events){if(events[_0xe5a6('0x6')](e)){var event=events[e];UserProfile[_0xe5a6('0x7')](e,emitEvent(event));}}module[_0xe5a6('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x9689=['emit','hasOwnProperty','exports','events','../../mysqldb','update','remove'];(function(_0x4114dd,_0x2ad862){var _0x26f44c=function(_0xad2246){while(--_0xad2246){_0x4114dd['push'](_0x4114dd['shift']());}};_0x26f44c(++_0x2ad862);}(_0x9689,0x1d8));var _0x9968=function(_0xc9f7b8,_0x2a9a32){_0xc9f7b8=_0xc9f7b8-0x0;var _0x4b0270=_0x9689[_0xc9f7b8];return _0x4b0270;};'use strict';var EventEmitter=require(_0x9968('0x0'));var UserProfile=require(_0x9968('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9968('0x2'),'afterDestroy':_0x9968('0x3')};function emitEvent(_0x2f90a3){return function(_0x193a76,_0x8d4340,_0x13d238){UserProfileEvents[_0x9968('0x4')](_0x2f90a3+':'+_0x193a76['id'],_0x193a76);UserProfileEvents[_0x9968('0x4')](_0x2f90a3,_0x193a76);_0x13d238(null);};}for(var e in events){if(events[_0x9968('0x5')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x9968('0x6')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index aaeb026..ae2ce6b 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 _0x8aa7=['./userProfile.attributes','exports','define','UserProfile','user_profiles','models','User','update','privacyEnabled','then','catch','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x216d9d,_0x4e9708){var _0x3fbfb6=function(_0x5e88d6){while(--_0x5e88d6){_0x216d9d['push'](_0x216d9d['shift']());}};_0x3fbfb6(++_0x4e9708);}(_0x8aa7,0xb6));var _0x78aa=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x8aa7[_0x1992f1];return _0x413dfe;};'use strict';var _=require('lodash');var util=require(_0x78aa('0x0'));var logger=require(_0x78aa('0x1'))(_0x78aa('0x2'));var moment=require(_0x78aa('0x3'));var BPromise=require(_0x78aa('0x4'));var rp=require(_0x78aa('0x5'));var fs=require('fs');var path=require(_0x78aa('0x6'));var rimraf=require('rimraf');var config=require(_0x78aa('0x7'));var attributes=require(_0x78aa('0x8'));module[_0x78aa('0x9')]=function(_0x229075,_0x2d17c2){return _0x229075[_0x78aa('0xa')](_0x78aa('0xb'),attributes,{'tableName':_0x78aa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x2368ac,_0x460488,_0x1da0ad){var _0x116a77=_0x229075[_0x78aa('0xd')];_0x116a77[_0x78aa('0xe')][_0x78aa('0xf')]({'privacyEnabled':_0x2368ac[_0x78aa('0x10')]},{'where':{'UserProfileId':_0x2368ac['id']}})[_0x78aa('0x11')](function(){_0x1da0ad();})[_0x78aa('0x12')](function(_0x4168a2){_0x1da0ad(_0x4168a2);});}}});}; \ No newline at end of file +var _0x087b=['./userProfile.attributes','exports','define','UserProfile','user_profiles','models','User','privacyEnabled','then','catch','lodash','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x331117,_0x396493){var _0x3a1498=function(_0x3cedc5){while(--_0x3cedc5){_0x331117['push'](_0x331117['shift']());}};_0x3a1498(++_0x396493);}(_0x087b,0x11a));var _0xb087=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x087b[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb087('0x2'));var BPromise=require('bluebird');var rp=require(_0xb087('0x3'));var fs=require('fs');var path=require(_0xb087('0x4'));var rimraf=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var attributes=require(_0xb087('0x7'));module[_0xb087('0x8')]=function(_0x40156d,_0x17d6e8){return _0x40156d[_0xb087('0x9')](_0xb087('0xa'),attributes,{'tableName':_0xb087('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x6d83fb,_0x1dbe9f,_0x80e4da){var _0x2f14bc=_0x40156d[_0xb087('0xc')];_0x2f14bc[_0xb087('0xd')]['update']({'privacyEnabled':_0x6d83fb[_0xb087('0xe')]},{'where':{'UserProfileId':_0x6d83fb['id']}})[_0xb087('0xf')](function(){_0x80e4da();})[_0xb087('0x10')](function(_0x3bce7a){_0x80e4da(_0x3bce7a);});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index a8fb85a..21088d3 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 _0x98a8=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./userProfile.socket','register','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','UserProfile,\x20%s,\x20%s'];(function(_0x3e7213,_0xac260){var _0x3f1315=function(_0x44a38a){while(--_0x44a38a){_0x3e7213['push'](_0x3e7213['shift']());}};_0x3f1315(++_0xac260);}(_0x98a8,0x12c));var _0x898a=function(_0x5aa0a3,_0x197bf9){_0x5aa0a3=_0x5aa0a3-0x0;var _0x4d15f=_0x98a8[_0x5aa0a3];return _0x4d15f;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var moment=require(_0x898a('0x2'));var BPromise=require(_0x898a('0x3'));var rs=require(_0x898a('0x4'));var fs=require('fs');var Redis=require(_0x898a('0x5'));var db=require(_0x898a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x898a('0x7'))(_0x898a('0x8'));var config=require(_0x898a('0x9'));var jayson=require(_0x898a('0xa'));var client=jayson[_0x898a('0xb')]['http']({'port':0x232a});config[_0x898a('0xc')]=_['defaults'](config[_0x898a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x898a('0xd'))(new Redis(config[_0x898a('0xc')]));require(_0x898a('0xe'))[_0x898a('0xf')](socket);function respondWithRpcPromise(_0x3150df,_0x388a47,_0x42faa4){return new BPromise(function(_0x1a92de,_0x3806cb){return client['request'](_0x3150df,_0x42faa4)[_0x898a('0x10')](function(_0x502e95){logger[_0x898a('0x11')]('UserProfile,\x20%s,\x20%s',_0x388a47,_0x898a('0x12'));logger[_0x898a('0x13')](_0x898a('0x14'),_0x388a47,'request\x20sent',JSON['stringify'](_0x502e95));if(_0x502e95['error']){if(_0x502e95[_0x898a('0x15')][_0x898a('0x16')]===0x1f4){logger[_0x898a('0x15')](_0x898a('0x17'),_0x388a47,_0x502e95[_0x898a('0x15')][_0x898a('0x18')]);return _0x3806cb(_0x502e95['error'][_0x898a('0x18')]);}logger['error'](_0x898a('0x17'),_0x388a47,_0x502e95['error'][_0x898a('0x18')]);return _0x1a92de(_0x502e95['error'][_0x898a('0x18')]);}else{logger['info'](_0x898a('0x17'),_0x388a47,_0x898a('0x12'));_0x1a92de(_0x502e95[_0x898a('0x19')]['message']);}})[_0x898a('0x1a')](function(_0x5960e0){logger['error'](_0x898a('0x17'),_0x388a47,_0x5960e0);_0x3806cb(_0x5960e0);});});} \ No newline at end of file +var _0x2eb2=['../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','info','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1424e1,_0x2e6315){var _0x1866e8=function(_0x5d6440){while(--_0x5d6440){_0x1424e1['push'](_0x1424e1['shift']());}};_0x1866e8(++_0x2e6315);}(_0x2eb2,0x19f));var _0x22eb=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x2eb2[_0x618414];return _0x21c19a;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var moment=require(_0x22eb('0x1'));var BPromise=require(_0x22eb('0x2'));var rs=require(_0x22eb('0x3'));var fs=require('fs');var Redis=require(_0x22eb('0x4'));var db=require(_0x22eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x22eb('0x7'));var client=jayson[_0x22eb('0x8')][_0x22eb('0x9')]({'port':0x232a});config[_0x22eb('0xa')]=_[_0x22eb('0xb')](config[_0x22eb('0xa')],{'host':_0x22eb('0xc'),'port':0x18eb});var socket=require(_0x22eb('0xd'))(new Redis(config[_0x22eb('0xa')]));require(_0x22eb('0xe'))[_0x22eb('0xf')](socket);function respondWithRpcPromise(_0x3008e0,_0x489260,_0x46c197){return new BPromise(function(_0x54342e,_0x4ce9fb){return client[_0x22eb('0x10')](_0x3008e0,_0x46c197)['then'](function(_0x17b668){logger[_0x22eb('0x11')]('UserProfile,\x20%s,\x20%s',_0x489260,'request\x20sent');logger[_0x22eb('0x12')](_0x22eb('0x13'),_0x489260,_0x22eb('0x14'),JSON[_0x22eb('0x15')](_0x17b668));if(_0x17b668[_0x22eb('0x16')]){if(_0x17b668['error'][_0x22eb('0x17')]===0x1f4){logger['error'](_0x22eb('0x18'),_0x489260,_0x17b668['error'][_0x22eb('0x19')]);return _0x4ce9fb(_0x17b668[_0x22eb('0x16')]['message']);}logger['error']('UserProfile,\x20%s,\x20%s',_0x489260,_0x17b668[_0x22eb('0x16')]['message']);return _0x54342e(_0x17b668['error'][_0x22eb('0x19')]);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x489260,_0x22eb('0x14'));_0x54342e(_0x17b668[_0x22eb('0x1a')][_0x22eb('0x19')]);}})[_0x22eb('0x1b')](function(_0x3b0940){logger['error'](_0x22eb('0x18'),_0x489260,_0x3b0940);_0x4ce9fb(_0x3b0940);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 2f2cb46..68efeb0 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 _0x34bf=['removeListener','register','length','save','remove','update'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x34bf,0xdb));var _0xf34b=function(_0x2e04b6,_0xd8ff75){_0x2e04b6=_0x2e04b6-0x0;var _0x3ef5cc=_0x34bf[_0x2e04b6];return _0x3ef5cc;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xf34b('0x0'),_0xf34b('0x1'),_0xf34b('0x2')];function createListener(_0x547832,_0x5139da){return function(_0x1aeb04){_0x5139da['emit'](_0x547832,_0x1aeb04);};}function removeListener(_0x39dfeb,_0x3d4886){return function(){UserProfileEvents[_0xf34b('0x3')](_0x39dfeb,_0x3d4886);};}exports[_0xf34b('0x4')]=function(_0x48b1ce){for(var _0x407f82=0x0,_0x32693d=events[_0xf34b('0x5')];_0x407f82<_0x32693d;_0x407f82++){var _0x2f7e22=events[_0x407f82];var _0x5af06e=createListener('userProfile:'+_0x2f7e22,_0x48b1ce);UserProfileEvents['on'](_0x2f7e22,_0x5af06e);}}; \ No newline at end of file +var _0x63ec=['length','userProfile:','save','emit','removeListener','register'];(function(_0x3841cc,_0x34c50d){var _0x4bd9f3=function(_0x5c6de8){while(--_0x5c6de8){_0x3841cc['push'](_0x3841cc['shift']());}};_0x4bd9f3(++_0x34c50d);}(_0x63ec,0xaa));var _0xc63e=function(_0x598029,_0x157845){_0x598029=_0x598029-0x0;var _0x13a226=_0x63ec[_0x598029];return _0x13a226;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xc63e('0x0'),'remove','update'];function createListener(_0x3f06d6,_0x4b8f09){return function(_0x32bcfc){_0x4b8f09[_0xc63e('0x1')](_0x3f06d6,_0x32bcfc);};}function removeListener(_0x1e53a0,_0x3d7316){return function(){UserProfileEvents[_0xc63e('0x2')](_0x1e53a0,_0x3d7316);};}exports[_0xc63e('0x3')]=function(_0x5e3d14){for(var _0x5b32d6=0x0,_0x17a7c6=events[_0xc63e('0x4')];_0x5b32d6<_0x17a7c6;_0x5b32d6++){var _0x5520ed=events[_0x5b32d6];var _0x51f5e8=createListener(_0xc63e('0x5')+_0x5520ed,_0x5e3d14);UserProfileEvents['on'](_0x5520ed,_0x51f5e8);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 5fd988d..c04c674 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 _0x426a=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put','update','destroy','exports','multer'];(function(_0x24a78a,_0x162cf4){var _0x46d95a=function(_0x1193be){while(--_0x1193be){_0x24a78a['push'](_0x24a78a['shift']());}};_0x46d95a(++_0x162cf4);}(_0x426a,0xdb));var _0xa426=function(_0x5d3545,_0x2746b5){_0x5d3545=_0x5d3545-0x0;var _0x50fe9c=_0x426a[_0x5d3545];return _0x50fe9c;};'use strict';var multer=require(_0xa426('0x0'));var util=require(_0xa426('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa426('0x2'));var router=express[_0xa426('0x3')]();var fs_extra=require(_0xa426('0x4'));var auth=require(_0xa426('0x5'));var interaction=require(_0xa426('0x6'));var config=require(_0xa426('0x7'));var controller=require(_0xa426('0x8'));router['get']('/',auth[_0xa426('0x9')](),controller[_0xa426('0xa')]);router[_0xa426('0xb')](_0xa426('0xc'),auth['isAuthenticated'](),controller[_0xa426('0xd')]);router[_0xa426('0xb')](_0xa426('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xa426('0x9')](),controller[_0xa426('0xf')]);router[_0xa426('0x10')](_0xa426('0xe'),auth[_0xa426('0x9')](),controller[_0xa426('0x11')]);router['delete'](_0xa426('0xe'),auth[_0xa426('0x9')](),controller[_0xa426('0x12')]);module[_0xa426('0x13')]=router; \ No newline at end of file +var _0xfad5=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3ed0ec,_0x44ece7){var _0x4b32f4=function(_0x3bf38e){while(--_0x3bf38e){_0x3ed0ec['push'](_0x3ed0ec['shift']());}};_0x4b32f4(++_0x44ece7);}(_0xfad5,0xd8));var _0x5fad=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0xfad5[_0x58965a];return _0x254efc;};'use strict';var multer=require(_0x5fad('0x0'));var util=require(_0x5fad('0x1'));var path=require(_0x5fad('0x2'));var timeout=require(_0x5fad('0x3'));var express=require(_0x5fad('0x4'));var router=express[_0x5fad('0x5')]();var fs_extra=require(_0x5fad('0x6'));var auth=require(_0x5fad('0x7'));var interaction=require(_0x5fad('0x8'));var config=require(_0x5fad('0x9'));var controller=require(_0x5fad('0xa'));router['get']('/',auth[_0x5fad('0xb')](),controller[_0x5fad('0xc')]);router[_0x5fad('0xd')]('/describe',auth[_0x5fad('0xb')](),controller['describe']);router['get'](_0x5fad('0xe'),auth[_0x5fad('0xb')](),controller['show']);router[_0x5fad('0xf')]('/',auth[_0x5fad('0xb')](),controller[_0x5fad('0x10')]);router[_0x5fad('0x11')]('/:id',auth[_0x5fad('0xb')](),controller[_0x5fad('0x12')]);router[_0x5fad('0x13')](_0x5fad('0xe'),auth[_0x5fad('0xb')](),controller[_0x5fad('0x14')]);module[_0x5fad('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 449c4c9..0be648c 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 _0x730c=['INTEGER','sequelize','exports','STRING'];(function(_0x5153ca,_0x4b3b43){var _0x5e5f47=function(_0xbfc0b5){while(--_0xbfc0b5){_0x5153ca['push'](_0x5153ca['shift']());}};_0x5e5f47(++_0x4b3b43);}(_0x730c,0x13d));var _0xc730=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x730c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc730('0x0'));module[_0xc730('0x1')]={'name':{'type':Sequelize[_0xc730('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xc730('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xca49=['STRING','sequelize','exports'];(function(_0x2bf089,_0x51b8df){var _0x2808ab=function(_0x48bee0){while(--_0x48bee0){_0x2bf089['push'](_0x2bf089['shift']());}};_0x2808ab(++_0x51b8df);}(_0xca49,0xbb));var _0x9ca4=function(_0x415603,_0x21320c){_0x415603=_0x415603-0x0;var _0x131e72=_0xca49[_0x415603];return _0x131e72;};'use strict';var Sequelize=require(_0x9ca4('0x0'));module[_0x9ca4('0x1')]={'name':{'type':Sequelize[_0x9ca4('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x9ca4('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 93d0fe4..0e634d6 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 _0xc224=['options','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','name','send','map','UserProfileResource','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xc224,0x1af));var _0x4c22=function(_0x20566e,_0x3a922e){_0x20566e=_0x20566e-0x0;var _0x453391=_0xc224[_0x20566e];return _0x453391;};'use strict';var emlformat=require(_0x4c22('0x0'));var rimraf=require(_0x4c22('0x1'));var zipdir=require(_0x4c22('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c22('0x3'));var moment=require(_0x4c22('0x4'));var BPromise=require(_0x4c22('0x5'));var Mustache=require(_0x4c22('0x6'));var util=require(_0x4c22('0x7'));var path=require(_0x4c22('0x8'));var sox=require(_0x4c22('0x9'));var csv=require(_0x4c22('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4c22('0xb'));var crypto=require(_0x4c22('0xc'));var jsforce=require(_0x4c22('0xd'));var deskjs=require(_0x4c22('0xe'));var toCsv=require(_0x4c22('0xa'));var querystring=require(_0x4c22('0xf'));var Papa=require(_0x4c22('0x10'));var Redis=require('ioredis');var authService=require(_0x4c22('0x11'));var qs=require(_0x4c22('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c22('0x13'))(_0x4c22('0x14'));var utils=require(_0x4c22('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4c22('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x578baf,_0x503b18){_0x503b18=_0x503b18||0xcc;return function(_0x535c47){if(_0x535c47){return _0x578baf[_0x4c22('0x17')](_0x503b18);}return _0x578baf[_0x4c22('0x18')](_0x503b18)[_0x4c22('0x19')]();};}function respondWithResult(_0x4196ce,_0x480d97){_0x480d97=_0x480d97||0xc8;return function(_0x284441){if(_0x284441){return _0x4196ce[_0x4c22('0x18')](_0x480d97)[_0x4c22('0x1a')](_0x284441);}};}function respondWithFilteredResult(_0x31bbd0,_0x401089){return function(_0x5affbb){if(_0x5affbb){var _0x517d9a=typeof _0x401089[_0x4c22('0x1b')]===_0x4c22('0x1c')&&typeof _0x401089[_0x4c22('0x1d')]===_0x4c22('0x1c');var _0x32a9c4=_0x5affbb[_0x4c22('0x1e')];var _0x408f6f=_0x517d9a?0x0:_0x401089[_0x4c22('0x1b')];var _0x629d81=_0x517d9a?_0x5affbb['count']:_0x401089[_0x4c22('0x1b')]+_0x401089['limit'];var _0x5bce40;if(_0x629d81>=_0x32a9c4){_0x629d81=_0x32a9c4;_0x5bce40=0xc8;}else{_0x5bce40=0xce;}_0x31bbd0[_0x4c22('0x18')](_0x5bce40);return _0x31bbd0[_0x4c22('0x1f')](_0x4c22('0x20'),_0x408f6f+'-'+_0x629d81+'/'+_0x32a9c4)[_0x4c22('0x1a')](_0x5affbb);}return null;};}function patchUpdates(_0x373a46){return function(_0x28422d){try{jsonpatch['apply'](_0x28422d,_0x373a46,!![]);}catch(_0x152923){return BPromise['reject'](_0x152923);}return _0x28422d['save']();};}function saveUpdates(_0x3c5819,_0x335317){return function(_0x3eda16){if(_0x3eda16){return _0x3eda16[_0x4c22('0x21')](_0x3c5819)[_0x4c22('0x22')](function(_0x45cba2){return _0x45cba2;});}return null;};}function removeEntity(_0x351824,_0x38e6d5){return function(_0x29aedf){if(_0x29aedf){return _0x29aedf[_0x4c22('0x23')]()[_0x4c22('0x22')](function(){_0x351824[_0x4c22('0x18')](0xcc)[_0x4c22('0x19')]();});}};}function handleEntityNotFound(_0x2fa3d8,_0x365856){return function(_0x47ec7f){if(!_0x47ec7f){_0x2fa3d8[_0x4c22('0x17')](0x194);}return _0x47ec7f;};}function handleError(_0x17c6bc,_0x563336){_0x563336=_0x563336||0x1f4;return function(_0x3d15b9){logger[_0x4c22('0x24')](_0x3d15b9['stack']);if(_0x3d15b9[_0x4c22('0x25')]){delete _0x3d15b9[_0x4c22('0x25')];}_0x17c6bc[_0x4c22('0x18')](_0x563336)[_0x4c22('0x26')](_0x3d15b9);};}exports['index']=function(_0x2de117,_0x10e36a){var _0x254de7={},_0x55ca00={},_0x4ca3f4={'count':0x0,'rows':[]};var _0x24f42e=_[_0x4c22('0x27')](db[_0x4c22('0x28')][_0x4c22('0x29')],function(_0x875822){return{'name':_0x875822['fieldName'],'type':_0x875822[_0x4c22('0x2a')]['key']};});_0x55ca00['model']=_['map'](_0x24f42e,_0x4c22('0x25'));_0x55ca00[_0x4c22('0x2b')]=_[_0x4c22('0x2c')](_0x2de117[_0x4c22('0x2b')]);_0x55ca00[_0x4c22('0x2d')]=_[_0x4c22('0x2e')](_0x55ca00[_0x4c22('0x2f')],_0x55ca00[_0x4c22('0x2b')]);_0x254de7[_0x4c22('0x30')]=_[_0x4c22('0x2e')](_0x55ca00[_0x4c22('0x2f')],qs[_0x4c22('0x31')](_0x2de117['query']['fields']));_0x254de7[_0x4c22('0x30')]=_0x254de7[_0x4c22('0x30')][_0x4c22('0x32')]?_0x254de7[_0x4c22('0x30')]:_0x55ca00[_0x4c22('0x2f')];if(!_0x2de117[_0x4c22('0x2b')][_0x4c22('0x33')](_0x4c22('0x34'))){_0x254de7['limit']=qs['limit'](_0x2de117['query']['limit']);_0x254de7[_0x4c22('0x1b')]=qs[_0x4c22('0x1b')](_0x2de117[_0x4c22('0x2b')][_0x4c22('0x1b')]);}_0x254de7[_0x4c22('0x35')]=qs['sort'](_0x2de117[_0x4c22('0x2b')]['sort']);_0x254de7[_0x4c22('0x36')]=qs[_0x4c22('0x2d')](_[_0x4c22('0x37')](_0x2de117[_0x4c22('0x2b')],_0x55ca00[_0x4c22('0x2d')]),_0x24f42e);if(_0x2de117[_0x4c22('0x2b')][_0x4c22('0x38')]){_0x254de7[_0x4c22('0x36')]=_[_0x4c22('0x39')](_0x254de7[_0x4c22('0x36')],{'$or':_['map'](_0x24f42e,function(_0x4685f9){if(_0x4685f9[_0x4c22('0x2a')]!==_0x4c22('0x3a')){var _0x260879={};_0x260879[_0x4685f9[_0x4c22('0x25')]]={'$like':'%'+_0x2de117[_0x4c22('0x2b')][_0x4c22('0x38')]+'%'};return _0x260879;}})});}_0x254de7=_[_0x4c22('0x39')]({},_0x254de7,_0x2de117[_0x4c22('0x3b')]);var _0x5122e0={'where':_0x254de7[_0x4c22('0x36')]};return db[_0x4c22('0x28')][_0x4c22('0x1e')](_0x5122e0)[_0x4c22('0x22')](function(_0x499d41){_0x4ca3f4[_0x4c22('0x1e')]=_0x499d41;if(_0x2de117['query']['includeAll']){_0x254de7[_0x4c22('0x3c')]=[{'all':!![]}];}return db[_0x4c22('0x28')][_0x4c22('0x3d')](_0x254de7);})[_0x4c22('0x22')](function(_0x1afb4b){_0x4ca3f4[_0x4c22('0x3e')]=_0x1afb4b;return _0x4ca3f4;})['then'](respondWithFilteredResult(_0x10e36a,_0x254de7))[_0x4c22('0x3f')](handleError(_0x10e36a,null));};exports[_0x4c22('0x40')]=function(_0x8869b9,_0x18bb1f){var _0x572086={'raw':![],'where':{'id':_0x8869b9[_0x4c22('0x41')]['id']}},_0x575bbb={};_0x575bbb['model']=_[_0x4c22('0x2c')](db[_0x4c22('0x28')]['rawAttributes']);_0x575bbb['query']=_[_0x4c22('0x2c')](_0x8869b9['query']);_0x575bbb[_0x4c22('0x2d')]=_[_0x4c22('0x2e')](_0x575bbb['model'],_0x575bbb[_0x4c22('0x2b')]);_0x572086[_0x4c22('0x30')]=_[_0x4c22('0x2e')](_0x575bbb[_0x4c22('0x2f')],qs['fields'](_0x8869b9[_0x4c22('0x2b')]['fields']));_0x572086[_0x4c22('0x30')]=_0x572086[_0x4c22('0x30')][_0x4c22('0x32')]?_0x572086['attributes']:_0x575bbb[_0x4c22('0x2f')];if(_0x8869b9[_0x4c22('0x2b')]['includeAll']){_0x572086[_0x4c22('0x3c')]=[{'all':!![]}];}_0x572086=_['merge']({},_0x572086,_0x8869b9[_0x4c22('0x3b')]);return db[_0x4c22('0x28')][_0x4c22('0x42')](_0x572086)[_0x4c22('0x22')](handleEntityNotFound(_0x18bb1f,null))[_0x4c22('0x22')](respondWithResult(_0x18bb1f,null))['catch'](handleError(_0x18bb1f,null));};exports[_0x4c22('0x43')]=function(_0x44703a,_0x2c24cf){return db['UserProfileResource']['create'](_0x44703a[_0x4c22('0x44')],{})['then'](respondWithResult(_0x2c24cf,0xc9))[_0x4c22('0x3f')](handleError(_0x2c24cf,null));};exports[_0x4c22('0x21')]=function(_0xcd0034,_0x5e4802){if(_0xcd0034[_0x4c22('0x44')]['id']){delete _0xcd0034['body']['id'];}return db['UserProfileResource'][_0x4c22('0x42')]({'where':{'id':_0xcd0034[_0x4c22('0x41')]['id']}})['then'](handleEntityNotFound(_0x5e4802,null))[_0x4c22('0x22')](saveUpdates(_0xcd0034[_0x4c22('0x44')],null))[_0x4c22('0x22')](respondWithResult(_0x5e4802,null))[_0x4c22('0x3f')](handleError(_0x5e4802,null));};exports['destroy']=function(_0x1c4f9f,_0x8102d7){return db[_0x4c22('0x28')][_0x4c22('0x42')]({'where':{'id':_0x1c4f9f[_0x4c22('0x41')]['id']}})[_0x4c22('0x22')](handleEntityNotFound(_0x8102d7,null))[_0x4c22('0x22')](removeEntity(_0x8102d7,null))['catch'](handleError(_0x8102d7,null));};exports[_0x4c22('0x45')]=function(_0x143dad,_0x25a9a5){return db[_0x4c22('0x28')][_0x4c22('0x45')]()['then'](respondWithResult(_0x25a9a5,null))[_0x4c22('0x3f')](handleError(_0x25a9a5,null));}; \ No newline at end of file +var _0xc4e1=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','UserProfileResource','include','findAll','catch','show','keys','includeAll','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','query','filters','model'];(function(_0x394481,_0x5c5321){var _0x28355c=function(_0x50bbe2){while(--_0x50bbe2){_0x394481['push'](_0x394481['shift']());}};_0x28355c(++_0x5c5321);}(_0xc4e1,0x172));var _0x1c4e=function(_0x124a1d,_0x3424ba){_0x124a1d=_0x124a1d-0x0;var _0x374640=_0xc4e1[_0x124a1d];return _0x374640;};'use strict';var emlformat=require(_0x1c4e('0x0'));var rimraf=require(_0x1c4e('0x1'));var zipdir=require(_0x1c4e('0x2'));var jsonpatch=require(_0x1c4e('0x3'));var rp=require('request-promise');var moment=require(_0x1c4e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1c4e('0x5'));var util=require('util');var path=require(_0x1c4e('0x6'));var sox=require('sox');var csv=require(_0x1c4e('0x7'));var ejs=require(_0x1c4e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c4e('0x9'));var squel=require(_0x1c4e('0xa'));var crypto=require('crypto');var jsforce=require(_0x1c4e('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1c4e('0xc'));var Papa=require('papaparse');var Redis=require(_0x1c4e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1c4e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c4e('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1c4e('0x10'));var licenseUtil=require(_0x1c4e('0x11'));var db=require(_0x1c4e('0x12'))['db'];function respondWithStatusCode(_0x4f4eec,_0x275b90){_0x275b90=_0x275b90||0xcc;return function(_0x2eb80a){if(_0x2eb80a){return _0x4f4eec['sendStatus'](_0x275b90);}return _0x4f4eec['status'](_0x275b90)['end']();};}function respondWithResult(_0x119d51,_0x2b6459){_0x2b6459=_0x2b6459||0xc8;return function(_0x5889db){if(_0x5889db){return _0x119d51[_0x1c4e('0x13')](_0x2b6459)[_0x1c4e('0x14')](_0x5889db);}};}function respondWithFilteredResult(_0x10555f,_0x31708b){return function(_0x2d55bb){if(_0x2d55bb){var _0x4b12b3=typeof _0x31708b[_0x1c4e('0x15')]===_0x1c4e('0x16')&&typeof _0x31708b['limit']==='undefined';var _0x572737=_0x2d55bb['count'];var _0x285d65=_0x4b12b3?0x0:_0x31708b[_0x1c4e('0x15')];var _0x4faa6a=_0x4b12b3?_0x2d55bb[_0x1c4e('0x17')]:_0x31708b[_0x1c4e('0x15')]+_0x31708b[_0x1c4e('0x18')];var _0x3ae385;if(_0x4faa6a>=_0x572737){_0x4faa6a=_0x572737;_0x3ae385=0xc8;}else{_0x3ae385=0xce;}_0x10555f[_0x1c4e('0x13')](_0x3ae385);return _0x10555f[_0x1c4e('0x19')](_0x1c4e('0x1a'),_0x285d65+'-'+_0x4faa6a+'/'+_0x572737)[_0x1c4e('0x14')](_0x2d55bb);}return null;};}function patchUpdates(_0x24a1c7){return function(_0x491fdb){try{jsonpatch[_0x1c4e('0x1b')](_0x491fdb,_0x24a1c7,!![]);}catch(_0x4bfc35){return BPromise[_0x1c4e('0x1c')](_0x4bfc35);}return _0x491fdb[_0x1c4e('0x1d')]();};}function saveUpdates(_0x300b16,_0x1353e4){return function(_0xb79c5){if(_0xb79c5){return _0xb79c5['update'](_0x300b16)[_0x1c4e('0x1e')](function(_0xa9714b){return _0xa9714b;});}return null;};}function removeEntity(_0x20f93d,_0x41bbe6){return function(_0x18ee91){if(_0x18ee91){return _0x18ee91[_0x1c4e('0x1f')]()['then'](function(){_0x20f93d[_0x1c4e('0x13')](0xcc)[_0x1c4e('0x20')]();});}};}function handleEntityNotFound(_0x1b235d,_0x1ec251){return function(_0x2bf026){if(!_0x2bf026){_0x1b235d[_0x1c4e('0x21')](0x194);}return _0x2bf026;};}function handleError(_0x57364b,_0x133b6a){_0x133b6a=_0x133b6a||0x1f4;return function(_0x2e2d32){logger['error'](_0x2e2d32[_0x1c4e('0x22')]);if(_0x2e2d32[_0x1c4e('0x23')]){delete _0x2e2d32[_0x1c4e('0x23')];}_0x57364b[_0x1c4e('0x13')](_0x133b6a)['send'](_0x2e2d32);};}exports[_0x1c4e('0x24')]=function(_0xd843da,_0x2ae1d1){var _0x536e52={},_0x111bec={},_0x2c48c2={'count':0x0,'rows':[]};var _0x160afa=_[_0x1c4e('0x25')](db['UserProfileResource'][_0x1c4e('0x26')],function(_0x37f50b){return{'name':_0x37f50b[_0x1c4e('0x27')],'type':_0x37f50b[_0x1c4e('0x28')]['key']};});_0x111bec['model']=_[_0x1c4e('0x25')](_0x160afa,_0x1c4e('0x23'));_0x111bec[_0x1c4e('0x29')]=_['keys'](_0xd843da[_0x1c4e('0x29')]);_0x111bec[_0x1c4e('0x2a')]=_['intersection'](_0x111bec[_0x1c4e('0x2b')],_0x111bec[_0x1c4e('0x29')]);_0x536e52[_0x1c4e('0x2c')]=_[_0x1c4e('0x2d')](_0x111bec[_0x1c4e('0x2b')],qs['fields'](_0xd843da[_0x1c4e('0x29')][_0x1c4e('0x2e')]));_0x536e52[_0x1c4e('0x2c')]=_0x536e52[_0x1c4e('0x2c')][_0x1c4e('0x2f')]?_0x536e52['attributes']:_0x111bec[_0x1c4e('0x2b')];if(!_0xd843da['query'][_0x1c4e('0x30')](_0x1c4e('0x31'))){_0x536e52[_0x1c4e('0x18')]=qs[_0x1c4e('0x18')](_0xd843da[_0x1c4e('0x29')]['limit']);_0x536e52[_0x1c4e('0x15')]=qs[_0x1c4e('0x15')](_0xd843da[_0x1c4e('0x29')][_0x1c4e('0x15')]);}_0x536e52[_0x1c4e('0x32')]=qs[_0x1c4e('0x33')](_0xd843da[_0x1c4e('0x29')][_0x1c4e('0x33')]);_0x536e52[_0x1c4e('0x34')]=qs[_0x1c4e('0x2a')](_[_0x1c4e('0x35')](_0xd843da[_0x1c4e('0x29')],_0x111bec[_0x1c4e('0x2a')]),_0x160afa);if(_0xd843da['query'][_0x1c4e('0x36')]){_0x536e52[_0x1c4e('0x34')]=_[_0x1c4e('0x37')](_0x536e52[_0x1c4e('0x34')],{'$or':_[_0x1c4e('0x25')](_0x160afa,function(_0x597a22){if(_0x597a22[_0x1c4e('0x28')]!=='VIRTUAL'){var _0x5edd4c={};_0x5edd4c[_0x597a22[_0x1c4e('0x23')]]={'$like':'%'+_0xd843da['query'][_0x1c4e('0x36')]+'%'};return _0x5edd4c;}})});}_0x536e52=_[_0x1c4e('0x37')]({},_0x536e52,_0xd843da['options']);var _0x4aff8b={'where':_0x536e52[_0x1c4e('0x34')]};return db[_0x1c4e('0x38')][_0x1c4e('0x17')](_0x4aff8b)[_0x1c4e('0x1e')](function(_0x536836){_0x2c48c2['count']=_0x536836;if(_0xd843da['query']['includeAll']){_0x536e52[_0x1c4e('0x39')]=[{'all':!![]}];}return db[_0x1c4e('0x38')][_0x1c4e('0x3a')](_0x536e52);})[_0x1c4e('0x1e')](function(_0x3c19af){_0x2c48c2['rows']=_0x3c19af;return _0x2c48c2;})['then'](respondWithFilteredResult(_0x2ae1d1,_0x536e52))[_0x1c4e('0x3b')](handleError(_0x2ae1d1,null));};exports[_0x1c4e('0x3c')]=function(_0x1b5314,_0x1036e0){var _0x5179d9={'raw':![],'where':{'id':_0x1b5314['params']['id']}},_0xb1102d={};_0xb1102d['model']=_[_0x1c4e('0x3d')](db[_0x1c4e('0x38')]['rawAttributes']);_0xb1102d[_0x1c4e('0x29')]=_[_0x1c4e('0x3d')](_0x1b5314[_0x1c4e('0x29')]);_0xb1102d[_0x1c4e('0x2a')]=_[_0x1c4e('0x2d')](_0xb1102d['model'],_0xb1102d[_0x1c4e('0x29')]);_0x5179d9['attributes']=_[_0x1c4e('0x2d')](_0xb1102d['model'],qs[_0x1c4e('0x2e')](_0x1b5314[_0x1c4e('0x29')][_0x1c4e('0x2e')]));_0x5179d9[_0x1c4e('0x2c')]=_0x5179d9[_0x1c4e('0x2c')][_0x1c4e('0x2f')]?_0x5179d9[_0x1c4e('0x2c')]:_0xb1102d[_0x1c4e('0x2b')];if(_0x1b5314[_0x1c4e('0x29')][_0x1c4e('0x3e')]){_0x5179d9[_0x1c4e('0x39')]=[{'all':!![]}];}_0x5179d9=_['merge']({},_0x5179d9,_0x1b5314['options']);return db[_0x1c4e('0x38')]['find'](_0x5179d9)['then'](handleEntityNotFound(_0x1036e0,null))[_0x1c4e('0x1e')](respondWithResult(_0x1036e0,null))[_0x1c4e('0x3b')](handleError(_0x1036e0,null));};exports[_0x1c4e('0x3f')]=function(_0xfd9b0e,_0x1cceb9){return db[_0x1c4e('0x38')][_0x1c4e('0x3f')](_0xfd9b0e[_0x1c4e('0x40')],{})[_0x1c4e('0x1e')](respondWithResult(_0x1cceb9,0xc9))[_0x1c4e('0x3b')](handleError(_0x1cceb9,null));};exports[_0x1c4e('0x41')]=function(_0x54ac0f,_0x219b6b){if(_0x54ac0f[_0x1c4e('0x40')]['id']){delete _0x54ac0f[_0x1c4e('0x40')]['id'];}return db[_0x1c4e('0x38')][_0x1c4e('0x42')]({'where':{'id':_0x54ac0f[_0x1c4e('0x43')]['id']}})[_0x1c4e('0x1e')](handleEntityNotFound(_0x219b6b,null))[_0x1c4e('0x1e')](saveUpdates(_0x54ac0f['body'],null))[_0x1c4e('0x1e')](respondWithResult(_0x219b6b,null))[_0x1c4e('0x3b')](handleError(_0x219b6b,null));};exports['destroy']=function(_0x65c265,_0x36ad9d){return db[_0x1c4e('0x38')]['find']({'where':{'id':_0x65c265['params']['id']}})['then'](handleEntityNotFound(_0x36ad9d,null))[_0x1c4e('0x1e')](removeEntity(_0x36ad9d,null))[_0x1c4e('0x3b')](handleError(_0x36ad9d,null));};exports[_0x1c4e('0x44')]=function(_0x353f90,_0x5349f3){return db['UserProfileResource'][_0x1c4e('0x44')]()[_0x1c4e('0x1e')](respondWithResult(_0x5349f3,null))[_0x1c4e('0x3b')](handleError(_0x5349f3,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 300cbb0..59564b5 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 _0x4f1e=['resourceId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex'];(function(_0x14f75f,_0x51d74d){var _0x55074a=function(_0x37df6b){while(--_0x37df6b){_0x14f75f['push'](_0x14f75f['shift']());}};_0x55074a(++_0x51d74d);}(_0x4f1e,0x1a5));var _0xe4f1=function(_0x2526b6,_0x5272bd){_0x2526b6=_0x2526b6-0x0;var _0x168b4e=_0x4f1e[_0x2526b6];return _0x168b4e;};'use strict';var _=require(_0xe4f1('0x0'));var util=require(_0xe4f1('0x1'));var logger=require('../../config/logger')(_0xe4f1('0x2'));var moment=require(_0xe4f1('0x3'));var BPromise=require(_0xe4f1('0x4'));var rp=require(_0xe4f1('0x5'));var fs=require('fs');var path=require(_0xe4f1('0x6'));var rimraf=require(_0xe4f1('0x7'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0xe4f1('0x8')]=function(_0x28573d,_0x7b58f8){return _0x28573d[_0xe4f1('0x9')](_0xe4f1('0xa'),attributes,{'tableName':_0xe4f1('0xb'),'paranoid':![],'indexes':[{'name':_0xe4f1('0xc'),'fields':[_0xe4f1('0xd'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x46e1=['compositeIndex','resourceId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define'];(function(_0x44d3d3,_0x30dbe6){var _0x5c828e=function(_0x3b4cf1){while(--_0x3b4cf1){_0x44d3d3['push'](_0x44d3d3['shift']());}};_0x5c828e(++_0x30dbe6);}(_0x46e1,0x144));var _0x146e=function(_0x35a188,_0x5d97ad){_0x35a188=_0x35a188-0x0;var _0x3c0014=_0x46e1[_0x35a188];return _0x3c0014;};'use strict';var _=require(_0x146e('0x0'));var util=require(_0x146e('0x1'));var logger=require(_0x146e('0x2'))('api');var moment=require(_0x146e('0x3'));var BPromise=require(_0x146e('0x4'));var rp=require(_0x146e('0x5'));var fs=require('fs');var path=require(_0x146e('0x6'));var rimraf=require(_0x146e('0x7'));var config=require(_0x146e('0x8'));var attributes=require(_0x146e('0x9'));module[_0x146e('0xa')]=function(_0x5b0487,_0x5a0fb7){return _0x5b0487[_0x146e('0xb')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x146e('0xc'),'fields':[_0x146e('0xd'),'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 0299dc7..e6d1383 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 _0x7c3d=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x59e050,_0x18f598){var _0x42da63=function(_0x4ab386){while(--_0x4ab386){_0x59e050['push'](_0x59e050['shift']());}};_0x42da63(++_0x18f598);}(_0x7c3d,0x13d));var _0xd7c3=function(_0x3b2c6f,_0xa9f35c){_0x3b2c6f=_0x3b2c6f-0x0;var _0x22e219=_0x7c3d[_0x3b2c6f];return _0x22e219;};'use strict';var _=require(_0xd7c3('0x0'));var util=require('util');var moment=require(_0xd7c3('0x1'));var BPromise=require(_0xd7c3('0x2'));var rs=require(_0xd7c3('0x3'));var fs=require('fs');var Redis=require(_0xd7c3('0x4'));var db=require(_0xd7c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd7c3('0x6'))(_0xd7c3('0x7'));var config=require(_0xd7c3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd7c3('0x9')][_0xd7c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x420144,_0x1807a0,_0x1c0c9e){return new BPromise(function(_0x1b5051,_0x316de6){return client[_0xd7c3('0xb')](_0x420144,_0x1c0c9e)[_0xd7c3('0xc')](function(_0x5c862a){logger[_0xd7c3('0xd')](_0xd7c3('0xe'),_0x1807a0,_0xd7c3('0xf'));logger[_0xd7c3('0x10')](_0xd7c3('0x11'),_0x1807a0,'request\x20sent',JSON[_0xd7c3('0x12')](_0x5c862a));if(_0x5c862a[_0xd7c3('0x13')]){if(_0x5c862a[_0xd7c3('0x13')][_0xd7c3('0x14')]===0x1f4){logger[_0xd7c3('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x1807a0,_0x5c862a[_0xd7c3('0x13')][_0xd7c3('0x15')]);return _0x316de6(_0x5c862a['error'][_0xd7c3('0x15')]);}logger['error'](_0xd7c3('0xe'),_0x1807a0,_0x5c862a['error'][_0xd7c3('0x15')]);return _0x1b5051(_0x5c862a[_0xd7c3('0x13')][_0xd7c3('0x15')]);}else{logger['info'](_0xd7c3('0xe'),_0x1807a0,_0xd7c3('0xf'));_0x1b5051(_0x5c862a[_0xd7c3('0x16')][_0xd7c3('0x15')]);}})['catch'](function(_0x578625){logger[_0xd7c3('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x1807a0,_0x578625);_0x316de6(_0x578625);});});} \ No newline at end of file +var _0x426b=['then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0x426b,0x1d8));var _0xb426=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0x426b[_0x2ddfd9];return _0x2668f0;};'use strict';var _=require(_0xb426('0x0'));var util=require(_0xb426('0x1'));var moment=require('moment');var BPromise=require(_0xb426('0x2'));var rs=require(_0xb426('0x3'));var fs=require('fs');var Redis=require(_0xb426('0x4'));var db=require(_0xb426('0x5'))['db'];var utils=require(_0xb426('0x6'));var logger=require('../../config/logger')(_0xb426('0x7'));var config=require(_0xb426('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb426('0x9')][_0xb426('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45565d,_0x3628dd,_0x27c2a0){return new BPromise(function(_0x3ec6b7,_0x34633b){return client['request'](_0x45565d,_0x27c2a0)[_0xb426('0xb')](function(_0xa6e69b){logger[_0xb426('0xc')](_0xb426('0xd'),_0x3628dd,_0xb426('0xe'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x3628dd,_0xb426('0xe'),JSON[_0xb426('0xf')](_0xa6e69b));if(_0xa6e69b['error']){if(_0xa6e69b[_0xb426('0x10')][_0xb426('0x11')]===0x1f4){logger[_0xb426('0x10')](_0xb426('0xd'),_0x3628dd,_0xa6e69b[_0xb426('0x10')][_0xb426('0x12')]);return _0x34633b(_0xa6e69b['error'][_0xb426('0x12')]);}logger['error'](_0xb426('0xd'),_0x3628dd,_0xa6e69b[_0xb426('0x10')][_0xb426('0x12')]);return _0x3ec6b7(_0xa6e69b[_0xb426('0x10')]['message']);}else{logger[_0xb426('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x3628dd,'request\x20sent');_0x3ec6b7(_0xa6e69b[_0xb426('0x13')][_0xb426('0x12')]);}})[_0xb426('0x14')](function(_0x197408){logger[_0xb426('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x3628dd,_0x197408);_0x34633b(_0x197408);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index a12e954..e950cbd 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 _0x316e=['describe','/:id','isAuthenticated','show','post','create','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','/describe'];(function(_0xb84195,_0x4d2bb5){var _0x42e759=function(_0x1e28a6){while(--_0x1e28a6){_0xb84195['push'](_0xb84195['shift']());}};_0x42e759(++_0x4d2bb5);}(_0x316e,0xcd));var _0xe316=function(_0x6c24e6,_0x4b4f7c){_0x6c24e6=_0x6c24e6-0x0;var _0x231b02=_0x316e[_0x6c24e6];return _0x231b02;};'use strict';var multer=require(_0xe316('0x0'));var util=require(_0xe316('0x1'));var path=require(_0xe316('0x2'));var timeout=require(_0xe316('0x3'));var express=require(_0xe316('0x4'));var router=express[_0xe316('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe316('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe316('0x7'));var controller=require(_0xe316('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe316('0x9')](_0xe316('0xa'),auth['isAuthenticated'](),controller[_0xe316('0xb')]);router[_0xe316('0x9')](_0xe316('0xc'),auth[_0xe316('0xd')](),controller[_0xe316('0xe')]);router[_0xe316('0xf')]('/',auth[_0xe316('0xd')](),controller[_0xe316('0x10')]);router['put'](_0xe316('0xc'),auth[_0xe316('0xd')](),controller[_0xe316('0x11')]);router['delete']('/:id',auth[_0xe316('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0949=['exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe','isAuthenticated','/:id','show','put','delete','destroy'];(function(_0x1adb1d,_0x799f9b){var _0x23d39c=function(_0xbd8f16){while(--_0xbd8f16){_0x1adb1d['push'](_0x1adb1d['shift']());}};_0x23d39c(++_0x799f9b);}(_0x0949,0x157));var _0x9094=function(_0x56968c,_0x1e4877){_0x56968c=_0x56968c-0x0;var _0x3e3524=_0x0949[_0x56968c];return _0x3e3524;};'use strict';var multer=require('multer');var util=require(_0x9094('0x0'));var path=require(_0x9094('0x1'));var timeout=require('connect-timeout');var express=require(_0x9094('0x2'));var router=express[_0x9094('0x3')]();var fs_extra=require(_0x9094('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9094('0x5'));var config=require(_0x9094('0x6'));var controller=require(_0x9094('0x7'));router[_0x9094('0x8')]('/',auth['isAuthenticated'](),controller[_0x9094('0x9')]);router[_0x9094('0x8')](_0x9094('0xa'),auth[_0x9094('0xb')](),controller['describe']);router[_0x9094('0x8')](_0x9094('0xc'),auth['isAuthenticated'](),controller[_0x9094('0xd')]);router['post']('/',auth[_0x9094('0xb')](),controller['create']);router[_0x9094('0xe')](_0x9094('0xc'),auth[_0x9094('0xb')](),controller['update']);router[_0x9094('0xf')](_0x9094('0xc'),auth['isAuthenticated'](),controller[_0x9094('0x10')]);module[_0x9094('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 c7afb84..68665d9 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 _0x833b=['split','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x4dd747,_0x2c1d03){var _0x36890e=function(_0x569e66){while(--_0x569e66){_0x4dd747['push'](_0x4dd747['shift']());}};_0x36890e(++_0x2c1d03);}(_0x833b,0x131));var _0xb833=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x833b[_0x486f4a];return _0x135d99;};'use strict';var Sequelize=require('sequelize');module[_0xb833('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xb833('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xb833('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xb833('0x1')],'set':function(_0x37ea87){this[_0xb833('0x3')](_0xb833('0x4'),_0x37ea87?_0x37ea87[_0xb833('0x5')](''):[]);},'get':function(){return this[_0xb833('0x6')](_0xb833('0x4'))?this['getDataValue'](_0xb833('0x4'))[_0xb833('0x7')](''):[];}}}; \ No newline at end of file +var _0xb7fc=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','STRING','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x29caf2,_0x21e2fb){_0x29caf2=_0x29caf2-0x0;var _0x31d5f4=_0xb7fc[_0x29caf2];return _0x31d5f4;};'use strict';var Sequelize=require(_0xcb7f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xcb7f('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xcb7f('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xcb7f('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x23c877){this[_0xcb7f('0x4')](_0xcb7f('0x5'),_0x23c877?_0x23c877[_0xcb7f('0x6')](''):[]);},'get':function(){return this[_0xcb7f('0x7')](_0xcb7f('0x5'))?this['getDataValue'](_0xcb7f('0x5'))[_0xcb7f('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index a3a514e..2a9f122 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 _0x0d93=['query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','save','update','then','destroy','error','stack','send','index','map','UserProfileSection','rawAttributes','fieldName','type','name'];(function(_0x3ef36b,_0x577f59){var _0x45b5e1=function(_0x3db5e2){while(--_0x3db5e2){_0x3ef36b['push'](_0x3ef36b['shift']());}};_0x45b5e1(++_0x577f59);}(_0x0d93,0x67));var _0x30d9=function(_0x4dd479,_0x26d87a){_0x4dd479=_0x4dd479-0x0;var _0x1b6807=_0x0d93[_0x4dd479];return _0x1b6807;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x30d9('0x0'));var zipdir=require(_0x30d9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x30d9('0x2'));var moment=require(_0x30d9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x30d9('0x4'));var util=require(_0x30d9('0x5'));var path=require(_0x30d9('0x6'));var sox=require(_0x30d9('0x7'));var csv=require(_0x30d9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x30d9('0x9'));var _=require('lodash');var squel=require(_0x30d9('0xa'));var crypto=require(_0x30d9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x30d9('0xc'));var toCsv=require(_0x30d9('0x8'));var querystring=require(_0x30d9('0xd'));var Papa=require(_0x30d9('0xe'));var Redis=require(_0x30d9('0xf'));var authService=require(_0x30d9('0x10'));var qs=require(_0x30d9('0x11'));var as=require(_0x30d9('0x12'));var hardwareService=require(_0x30d9('0x13'));var logger=require(_0x30d9('0x14'))(_0x30d9('0x15'));var utils=require('../../config/utils');var config=require(_0x30d9('0x16'));var licenseUtil=require(_0x30d9('0x17'));var db=require(_0x30d9('0x18'))['db'];function respondWithStatusCode(_0xedd99d,_0x3c5873){_0x3c5873=_0x3c5873||0xcc;return function(_0x5ed680){if(_0x5ed680){return _0xedd99d[_0x30d9('0x19')](_0x3c5873);}return _0xedd99d[_0x30d9('0x1a')](_0x3c5873)[_0x30d9('0x1b')]();};}function respondWithResult(_0x16cb7e,_0x5e0909){_0x5e0909=_0x5e0909||0xc8;return function(_0x5b32ed){if(_0x5b32ed){return _0x16cb7e[_0x30d9('0x1a')](_0x5e0909)['json'](_0x5b32ed);}};}function respondWithFilteredResult(_0x4ce497,_0x31793d){return function(_0x127aad){if(_0x127aad){var _0x6df11e=typeof _0x31793d['offset']===_0x30d9('0x1c')&&typeof _0x31793d[_0x30d9('0x1d')]==='undefined';var _0x58442c=_0x127aad[_0x30d9('0x1e')];var _0x2d6a3d=_0x6df11e?0x0:_0x31793d[_0x30d9('0x1f')];var _0x22cca1=_0x6df11e?_0x127aad[_0x30d9('0x1e')]:_0x31793d[_0x30d9('0x1f')]+_0x31793d[_0x30d9('0x1d')];var _0x43317c;if(_0x22cca1>=_0x58442c){_0x22cca1=_0x58442c;_0x43317c=0xc8;}else{_0x43317c=0xce;}_0x4ce497[_0x30d9('0x1a')](_0x43317c);return _0x4ce497[_0x30d9('0x20')](_0x30d9('0x21'),_0x2d6a3d+'-'+_0x22cca1+'/'+_0x58442c)[_0x30d9('0x22')](_0x127aad);}return null;};}function patchUpdates(_0x428998){return function(_0xe0852){try{jsonpatch['apply'](_0xe0852,_0x428998,!![]);}catch(_0x356f5b){return BPromise['reject'](_0x356f5b);}return _0xe0852[_0x30d9('0x23')]();};}function saveUpdates(_0x577cbe,_0x3f942f){return function(_0x4fdd5e){if(_0x4fdd5e){return _0x4fdd5e[_0x30d9('0x24')](_0x577cbe)[_0x30d9('0x25')](function(_0x320636){return _0x320636;});}return null;};}function removeEntity(_0x78cc6,_0x553c6d){return function(_0x2dd8dc){if(_0x2dd8dc){return _0x2dd8dc[_0x30d9('0x26')]()[_0x30d9('0x25')](function(){_0x78cc6[_0x30d9('0x1a')](0xcc)[_0x30d9('0x1b')]();});}};}function handleEntityNotFound(_0x361dc4,_0x8cde3d){return function(_0x3d3534){if(!_0x3d3534){_0x361dc4[_0x30d9('0x19')](0x194);}return _0x3d3534;};}function handleError(_0x1eaca6,_0x5995e7){_0x5995e7=_0x5995e7||0x1f4;return function(_0x4cd073){logger[_0x30d9('0x27')](_0x4cd073[_0x30d9('0x28')]);if(_0x4cd073['name']){delete _0x4cd073['name'];}_0x1eaca6[_0x30d9('0x1a')](_0x5995e7)[_0x30d9('0x29')](_0x4cd073);};}exports[_0x30d9('0x2a')]=function(_0x45ed06,_0x4510e8){var _0x4ef96c={},_0x1a6943={},_0x1e4725={'count':0x0,'rows':[]};var _0x428b50=_[_0x30d9('0x2b')](db[_0x30d9('0x2c')][_0x30d9('0x2d')],function(_0x3756d4){return{'name':_0x3756d4[_0x30d9('0x2e')],'type':_0x3756d4[_0x30d9('0x2f')]['key']};});_0x1a6943['model']=_['map'](_0x428b50,_0x30d9('0x30'));_0x1a6943[_0x30d9('0x31')]=_['keys'](_0x45ed06[_0x30d9('0x31')]);_0x1a6943['filters']=_['intersection'](_0x1a6943[_0x30d9('0x32')],_0x1a6943[_0x30d9('0x31')]);_0x4ef96c[_0x30d9('0x33')]=_[_0x30d9('0x34')](_0x1a6943[_0x30d9('0x32')],qs[_0x30d9('0x35')](_0x45ed06[_0x30d9('0x31')][_0x30d9('0x35')]));_0x4ef96c[_0x30d9('0x33')]=_0x4ef96c['attributes'][_0x30d9('0x36')]?_0x4ef96c[_0x30d9('0x33')]:_0x1a6943[_0x30d9('0x32')];if(!_0x45ed06[_0x30d9('0x31')][_0x30d9('0x37')]('nolimit')){_0x4ef96c['limit']=qs[_0x30d9('0x1d')](_0x45ed06[_0x30d9('0x31')][_0x30d9('0x1d')]);_0x4ef96c[_0x30d9('0x1f')]=qs[_0x30d9('0x1f')](_0x45ed06['query'][_0x30d9('0x1f')]);}_0x4ef96c[_0x30d9('0x38')]=qs[_0x30d9('0x39')](_0x45ed06[_0x30d9('0x31')][_0x30d9('0x39')]);_0x4ef96c[_0x30d9('0x3a')]=qs[_0x30d9('0x3b')](_['pick'](_0x45ed06[_0x30d9('0x31')],_0x1a6943[_0x30d9('0x3b')]),_0x428b50);if(_0x45ed06[_0x30d9('0x31')][_0x30d9('0x3c')]){_0x4ef96c[_0x30d9('0x3a')]=_[_0x30d9('0x3d')](_0x4ef96c[_0x30d9('0x3a')],{'$or':_[_0x30d9('0x2b')](_0x428b50,function(_0x5c1ca){if(_0x5c1ca[_0x30d9('0x2f')]!==_0x30d9('0x3e')){var _0x4d6b86={};_0x4d6b86[_0x5c1ca[_0x30d9('0x30')]]={'$like':'%'+_0x45ed06[_0x30d9('0x31')][_0x30d9('0x3c')]+'%'};return _0x4d6b86;}})});}_0x4ef96c=_[_0x30d9('0x3d')]({},_0x4ef96c,_0x45ed06[_0x30d9('0x3f')]);var _0xad7988={'where':_0x4ef96c[_0x30d9('0x3a')]};return db[_0x30d9('0x2c')][_0x30d9('0x1e')](_0xad7988)['then'](function(_0x37cb55){_0x1e4725[_0x30d9('0x1e')]=_0x37cb55;if(_0x45ed06[_0x30d9('0x31')]['includeAll']){_0x4ef96c[_0x30d9('0x40')]=[{'all':!![]}];}return db['UserProfileSection'][_0x30d9('0x41')](_0x4ef96c);})['then'](function(_0x1b166f){_0x1e4725[_0x30d9('0x42')]=_0x1b166f;return _0x1e4725;})[_0x30d9('0x25')](respondWithFilteredResult(_0x4510e8,_0x4ef96c))[_0x30d9('0x43')](handleError(_0x4510e8,null));};exports[_0x30d9('0x44')]=function(_0x5226bd,_0x1df6a9){var _0x235c28={'raw':![],'where':{'id':_0x5226bd[_0x30d9('0x45')]['id']}},_0x557aa2={};_0x557aa2['model']=_['keys'](db[_0x30d9('0x2c')][_0x30d9('0x2d')]);_0x557aa2['query']=_[_0x30d9('0x46')](_0x5226bd[_0x30d9('0x31')]);_0x557aa2['filters']=_[_0x30d9('0x34')](_0x557aa2['model'],_0x557aa2[_0x30d9('0x31')]);_0x235c28[_0x30d9('0x33')]=_['intersection'](_0x557aa2['model'],qs[_0x30d9('0x35')](_0x5226bd[_0x30d9('0x31')][_0x30d9('0x35')]));_0x235c28[_0x30d9('0x33')]=_0x235c28[_0x30d9('0x33')][_0x30d9('0x36')]?_0x235c28[_0x30d9('0x33')]:_0x557aa2['model'];if(_0x5226bd[_0x30d9('0x31')][_0x30d9('0x47')]){_0x235c28[_0x30d9('0x40')]=[{'all':!![]}];}_0x235c28=_[_0x30d9('0x3d')]({},_0x235c28,_0x5226bd[_0x30d9('0x3f')]);return db[_0x30d9('0x2c')][_0x30d9('0x48')](_0x235c28)[_0x30d9('0x25')](handleEntityNotFound(_0x1df6a9,null))['then'](respondWithResult(_0x1df6a9,null))[_0x30d9('0x43')](handleError(_0x1df6a9,null));};exports[_0x30d9('0x49')]=function(_0x346af6,_0x1c60bd){return db[_0x30d9('0x2c')]['create'](_0x346af6[_0x30d9('0x4a')],{})['then'](respondWithResult(_0x1c60bd,0xc9))[_0x30d9('0x43')](handleError(_0x1c60bd,null));};exports[_0x30d9('0x24')]=function(_0x36f699,_0x3bf36e){if(_0x36f699[_0x30d9('0x4a')]['id']){delete _0x36f699[_0x30d9('0x4a')]['id'];}return db['UserProfileSection'][_0x30d9('0x48')]({'where':{'id':_0x36f699['params']['id']}})[_0x30d9('0x25')](handleEntityNotFound(_0x3bf36e,null))[_0x30d9('0x25')](saveUpdates(_0x36f699[_0x30d9('0x4a')],null))[_0x30d9('0x25')](respondWithResult(_0x3bf36e,null))[_0x30d9('0x43')](handleError(_0x3bf36e,null));};exports['destroy']=function(_0x1e860d,_0x55dfe9){return db[_0x30d9('0x2c')][_0x30d9('0x48')]({'where':{'id':_0x1e860d[_0x30d9('0x45')]['id']}})[_0x30d9('0x25')](handleEntityNotFound(_0x55dfe9,null))[_0x30d9('0x25')](removeEntity(_0x55dfe9,null))[_0x30d9('0x43')](handleError(_0x55dfe9,null));};exports[_0x30d9('0x4b')]=function(_0x10fe63,_0x1de10f){return db[_0x30d9('0x2c')][_0x30d9('0x4b')]()[_0x30d9('0x25')](respondWithResult(_0x1de10f,null))[_0x30d9('0x43')](handleError(_0x1de10f,null));}; \ No newline at end of file +var _0x6f82=['filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','include','options','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x6f82,0x13b));var _0x26f8=function(_0x3f8a03,_0x319b9c){_0x3f8a03=_0x3f8a03-0x0;var _0x147fb2=_0x6f82[_0x3f8a03];return _0x147fb2;};'use strict';var emlformat=require(_0x26f8('0x0'));var rimraf=require(_0x26f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x26f8('0x2'));var rp=require(_0x26f8('0x3'));var moment=require(_0x26f8('0x4'));var BPromise=require(_0x26f8('0x5'));var Mustache=require(_0x26f8('0x6'));var util=require(_0x26f8('0x7'));var path=require(_0x26f8('0x8'));var sox=require(_0x26f8('0x9'));var csv=require(_0x26f8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x26f8('0xb'));var _=require(_0x26f8('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x26f8('0xd'));var toCsv=require(_0x26f8('0xa'));var querystring=require(_0x26f8('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x26f8('0xf'));var as=require(_0x26f8('0x10'));var hardwareService=require(_0x26f8('0x11'));var logger=require(_0x26f8('0x12'))(_0x26f8('0x13'));var utils=require(_0x26f8('0x14'));var config=require(_0x26f8('0x15'));var licenseUtil=require(_0x26f8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x534a65,_0x31a78a){_0x31a78a=_0x31a78a||0xcc;return function(_0x4dfba4){if(_0x4dfba4){return _0x534a65[_0x26f8('0x17')](_0x31a78a);}return _0x534a65[_0x26f8('0x18')](_0x31a78a)[_0x26f8('0x19')]();};}function respondWithResult(_0x12a06b,_0x1d0c2d){_0x1d0c2d=_0x1d0c2d||0xc8;return function(_0x21b72b){if(_0x21b72b){return _0x12a06b[_0x26f8('0x18')](_0x1d0c2d)[_0x26f8('0x1a')](_0x21b72b);}};}function respondWithFilteredResult(_0x404f88,_0x11c402){return function(_0x5ba71e){if(_0x5ba71e){var _0x5afa4c=typeof _0x11c402[_0x26f8('0x1b')]===_0x26f8('0x1c')&&typeof _0x11c402[_0x26f8('0x1d')]===_0x26f8('0x1c');var _0x3b510e=_0x5ba71e[_0x26f8('0x1e')];var _0xce9b87=_0x5afa4c?0x0:_0x11c402['offset'];var _0x445c5b=_0x5afa4c?_0x5ba71e['count']:_0x11c402[_0x26f8('0x1b')]+_0x11c402[_0x26f8('0x1d')];var _0x2cc58a;if(_0x445c5b>=_0x3b510e){_0x445c5b=_0x3b510e;_0x2cc58a=0xc8;}else{_0x2cc58a=0xce;}_0x404f88[_0x26f8('0x18')](_0x2cc58a);return _0x404f88[_0x26f8('0x1f')](_0x26f8('0x20'),_0xce9b87+'-'+_0x445c5b+'/'+_0x3b510e)[_0x26f8('0x1a')](_0x5ba71e);}return null;};}function patchUpdates(_0x339d5c){return function(_0x307bfe){try{jsonpatch[_0x26f8('0x21')](_0x307bfe,_0x339d5c,!![]);}catch(_0x299762){return BPromise[_0x26f8('0x22')](_0x299762);}return _0x307bfe['save']();};}function saveUpdates(_0x32a63e,_0x455cc5){return function(_0x266b4a){if(_0x266b4a){return _0x266b4a[_0x26f8('0x23')](_0x32a63e)[_0x26f8('0x24')](function(_0x32eb5e){return _0x32eb5e;});}return null;};}function removeEntity(_0x521140,_0x470b60){return function(_0x172d82){if(_0x172d82){return _0x172d82[_0x26f8('0x25')]()[_0x26f8('0x24')](function(){_0x521140['status'](0xcc)[_0x26f8('0x19')]();});}};}function handleEntityNotFound(_0x29cf0d,_0x912ad6){return function(_0x58337e){if(!_0x58337e){_0x29cf0d['sendStatus'](0x194);}return _0x58337e;};}function handleError(_0x504b9f,_0x186855){_0x186855=_0x186855||0x1f4;return function(_0x237f10){logger[_0x26f8('0x26')](_0x237f10[_0x26f8('0x27')]);if(_0x237f10[_0x26f8('0x28')]){delete _0x237f10[_0x26f8('0x28')];}_0x504b9f['status'](_0x186855)['send'](_0x237f10);};}exports[_0x26f8('0x29')]=function(_0x415382,_0x5baa49){var _0x4436b5={},_0x7fd66a={},_0x3a5ff4={'count':0x0,'rows':[]};var _0x432103=_[_0x26f8('0x2a')](db[_0x26f8('0x2b')][_0x26f8('0x2c')],function(_0x5ba92d){return{'name':_0x5ba92d[_0x26f8('0x2d')],'type':_0x5ba92d[_0x26f8('0x2e')][_0x26f8('0x2f')]};});_0x7fd66a[_0x26f8('0x30')]=_[_0x26f8('0x2a')](_0x432103,_0x26f8('0x28'));_0x7fd66a[_0x26f8('0x31')]=_[_0x26f8('0x32')](_0x415382[_0x26f8('0x31')]);_0x7fd66a[_0x26f8('0x33')]=_[_0x26f8('0x34')](_0x7fd66a[_0x26f8('0x30')],_0x7fd66a['query']);_0x4436b5[_0x26f8('0x35')]=_[_0x26f8('0x34')](_0x7fd66a[_0x26f8('0x30')],qs[_0x26f8('0x36')](_0x415382['query'][_0x26f8('0x36')]));_0x4436b5[_0x26f8('0x35')]=_0x4436b5[_0x26f8('0x35')][_0x26f8('0x37')]?_0x4436b5['attributes']:_0x7fd66a[_0x26f8('0x30')];if(!_0x415382[_0x26f8('0x31')]['hasOwnProperty'](_0x26f8('0x38'))){_0x4436b5['limit']=qs['limit'](_0x415382[_0x26f8('0x31')][_0x26f8('0x1d')]);_0x4436b5[_0x26f8('0x1b')]=qs['offset'](_0x415382[_0x26f8('0x31')][_0x26f8('0x1b')]);}_0x4436b5[_0x26f8('0x39')]=qs[_0x26f8('0x3a')](_0x415382['query'][_0x26f8('0x3a')]);_0x4436b5['where']=qs['filters'](_[_0x26f8('0x3b')](_0x415382['query'],_0x7fd66a[_0x26f8('0x33')]),_0x432103);if(_0x415382[_0x26f8('0x31')][_0x26f8('0x3c')]){_0x4436b5[_0x26f8('0x3d')]=_[_0x26f8('0x3e')](_0x4436b5[_0x26f8('0x3d')],{'$or':_[_0x26f8('0x2a')](_0x432103,function(_0x7a2b09){if(_0x7a2b09['type']!==_0x26f8('0x3f')){var _0x3472f5={};_0x3472f5[_0x7a2b09[_0x26f8('0x28')]]={'$like':'%'+_0x415382['query'][_0x26f8('0x3c')]+'%'};return _0x3472f5;}})});}_0x4436b5=_[_0x26f8('0x3e')]({},_0x4436b5,_0x415382['options']);var _0x22ea28={'where':_0x4436b5[_0x26f8('0x3d')]};return db[_0x26f8('0x2b')][_0x26f8('0x1e')](_0x22ea28)[_0x26f8('0x24')](function(_0x2da41d){_0x3a5ff4[_0x26f8('0x1e')]=_0x2da41d;if(_0x415382[_0x26f8('0x31')][_0x26f8('0x40')]){_0x4436b5['include']=[{'all':!![]}];}return db[_0x26f8('0x2b')][_0x26f8('0x41')](_0x4436b5);})[_0x26f8('0x24')](function(_0x10598b){_0x3a5ff4[_0x26f8('0x42')]=_0x10598b;return _0x3a5ff4;})[_0x26f8('0x24')](respondWithFilteredResult(_0x5baa49,_0x4436b5))[_0x26f8('0x43')](handleError(_0x5baa49,null));};exports['show']=function(_0x53c4c7,_0x41702c){var _0x3f581d={'raw':![],'where':{'id':_0x53c4c7['params']['id']}},_0x130d92={};_0x130d92[_0x26f8('0x30')]=_[_0x26f8('0x32')](db['UserProfileSection'][_0x26f8('0x2c')]);_0x130d92[_0x26f8('0x31')]=_[_0x26f8('0x32')](_0x53c4c7[_0x26f8('0x31')]);_0x130d92[_0x26f8('0x33')]=_[_0x26f8('0x34')](_0x130d92[_0x26f8('0x30')],_0x130d92[_0x26f8('0x31')]);_0x3f581d['attributes']=_['intersection'](_0x130d92[_0x26f8('0x30')],qs[_0x26f8('0x36')](_0x53c4c7[_0x26f8('0x31')][_0x26f8('0x36')]));_0x3f581d[_0x26f8('0x35')]=_0x3f581d[_0x26f8('0x35')][_0x26f8('0x37')]?_0x3f581d[_0x26f8('0x35')]:_0x130d92[_0x26f8('0x30')];if(_0x53c4c7[_0x26f8('0x31')][_0x26f8('0x40')]){_0x3f581d[_0x26f8('0x44')]=[{'all':!![]}];}_0x3f581d=_['merge']({},_0x3f581d,_0x53c4c7[_0x26f8('0x45')]);return db[_0x26f8('0x2b')][_0x26f8('0x46')](_0x3f581d)[_0x26f8('0x24')](handleEntityNotFound(_0x41702c,null))['then'](respondWithResult(_0x41702c,null))[_0x26f8('0x43')](handleError(_0x41702c,null));};exports[_0x26f8('0x47')]=function(_0x336c3a,_0x213209){return db[_0x26f8('0x2b')][_0x26f8('0x47')](_0x336c3a[_0x26f8('0x48')],{})[_0x26f8('0x24')](respondWithResult(_0x213209,0xc9))[_0x26f8('0x43')](handleError(_0x213209,null));};exports['update']=function(_0x4e894d,_0x56d1a2){if(_0x4e894d[_0x26f8('0x48')]['id']){delete _0x4e894d[_0x26f8('0x48')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x4e894d['params']['id']}})[_0x26f8('0x24')](handleEntityNotFound(_0x56d1a2,null))[_0x26f8('0x24')](saveUpdates(_0x4e894d[_0x26f8('0x48')],null))[_0x26f8('0x24')](respondWithResult(_0x56d1a2,null))[_0x26f8('0x43')](handleError(_0x56d1a2,null));};exports[_0x26f8('0x25')]=function(_0x354791,_0x37d22d){return db['UserProfileSection'][_0x26f8('0x46')]({'where':{'id':_0x354791[_0x26f8('0x49')]['id']}})[_0x26f8('0x24')](handleEntityNotFound(_0x37d22d,null))[_0x26f8('0x24')](removeEntity(_0x37d22d,null))['catch'](handleError(_0x37d22d,null));};exports['describe']=function(_0x47e3ea,_0x4e6900){return db['UserProfileSection'][_0x26f8('0x4a')]()[_0x26f8('0x24')](respondWithResult(_0x4e6900,null))[_0x26f8('0x43')](handleError(_0x4e6900,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 5eee4f2..4618c12 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 _0x7f91=['moment','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7f91,0x172));var _0x17f9=function(_0x499ca5,_0x4986cf){_0x499ca5=_0x499ca5-0x0;var _0x7bfd9c=_0x7f91[_0x499ca5];return _0x7bfd9c;};'use strict';var _=require(_0x17f9('0x0'));var util=require(_0x17f9('0x1'));var logger=require(_0x17f9('0x2'))(_0x17f9('0x3'));var moment=require(_0x17f9('0x4'));var BPromise=require('bluebird');var rp=require(_0x17f9('0x5'));var fs=require('fs');var path=require(_0x17f9('0x6'));var rimraf=require(_0x17f9('0x7'));var config=require(_0x17f9('0x8'));var attributes=require(_0x17f9('0x9'));module[_0x17f9('0xa')]=function(_0x40fa3e,_0x59e5d3){return _0x40fa3e[_0x17f9('0xb')](_0x17f9('0xc'),attributes,{'tableName':_0x17f9('0xd'),'paranoid':![],'indexes':[{'name':_0x17f9('0xe'),'fields':[_0x17f9('0xf'),_0x17f9('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf4ae=['userProfileId','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','sectionId'];(function(_0x269def,_0xb166d9){var _0x4a5882=function(_0x2d1016){while(--_0x2d1016){_0x269def['push'](_0x269def['shift']());}};_0x4a5882(++_0xb166d9);}(_0xf4ae,0x69));var _0xef4a=function(_0x146a85,_0x529b52){_0x146a85=_0x146a85-0x0;var _0x1b59bf=_0xf4ae[_0x146a85];return _0x1b59bf;};'use strict';var _=require(_0xef4a('0x0'));var util=require('util');var logger=require(_0xef4a('0x1'))(_0xef4a('0x2'));var moment=require(_0xef4a('0x3'));var BPromise=require('bluebird');var rp=require(_0xef4a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef4a('0x5'));var config=require(_0xef4a('0x6'));var attributes=require(_0xef4a('0x7'));module['exports']=function(_0x50e532,_0x5cb368){return _0x50e532[_0xef4a('0x8')](_0xef4a('0x9'),attributes,{'tableName':_0xef4a('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xef4a('0xb'),_0xef4a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index fd6707b..01f61e4 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 _0xac20=['../../config/logger','rpc','../../config/environment','http','request','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xac20,0x9a));var _0x0ac2=function(_0x4c6e2b,_0x381bb3){_0x4c6e2b=_0x4c6e2b-0x0;var _0x318b02=_0xac20[_0x4c6e2b];return _0x318b02;};'use strict';var _=require(_0x0ac2('0x0'));var util=require(_0x0ac2('0x1'));var moment=require(_0x0ac2('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ac2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ac2('0x4'))['db'];var utils=require(_0x0ac2('0x5'));var logger=require(_0x0ac2('0x6'))(_0x0ac2('0x7'));var config=require(_0x0ac2('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0ac2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x84bdac,_0x259717,_0x16a9b6){return new BPromise(function(_0x14c023,_0x3a1c71){return client[_0x0ac2('0xa')](_0x84bdac,_0x16a9b6)['then'](function(_0xd64c79){logger[_0x0ac2('0xb')](_0x0ac2('0xc'),_0x259717,'request\x20sent');logger[_0x0ac2('0xd')](_0x0ac2('0xe'),_0x259717,_0x0ac2('0xf'),JSON[_0x0ac2('0x10')](_0xd64c79));if(_0xd64c79[_0x0ac2('0x11')]){if(_0xd64c79[_0x0ac2('0x11')]['code']===0x1f4){logger[_0x0ac2('0x11')](_0x0ac2('0xc'),_0x259717,_0xd64c79[_0x0ac2('0x11')][_0x0ac2('0x12')]);return _0x3a1c71(_0xd64c79[_0x0ac2('0x11')][_0x0ac2('0x12')]);}logger[_0x0ac2('0x11')](_0x0ac2('0xc'),_0x259717,_0xd64c79[_0x0ac2('0x11')][_0x0ac2('0x12')]);return _0x14c023(_0xd64c79[_0x0ac2('0x11')][_0x0ac2('0x12')]);}else{logger['info'](_0x0ac2('0xc'),_0x259717,_0x0ac2('0xf'));_0x14c023(_0xd64c79['result'][_0x0ac2('0x12')]);}})[_0x0ac2('0x13')](function(_0x20b23f){logger[_0x0ac2('0x11')](_0x0ac2('0xc'),_0x259717,_0x20b23f);_0x3a1c71(_0x20b23f);});});} \ No newline at end of file +var _0x5150=['message','UserProfileSection,\x20%s,\x20%s','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x48051b,_0x339115){var _0x2a4f6e=function(_0x5b7756){while(--_0x5b7756){_0x48051b['push'](_0x48051b['shift']());}};_0x2a4f6e(++_0x339115);}(_0x5150,0xff));var _0x0515=function(_0x3f2d02,_0x2c7deb){_0x3f2d02=_0x3f2d02-0x0;var _0x54092b=_0x5150[_0x3f2d02];return _0x54092b;};'use strict';var _=require(_0x0515('0x0'));var util=require('util');var moment=require(_0x0515('0x1'));var BPromise=require(_0x0515('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0515('0x3'));var db=require(_0x0515('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0515('0x5'))(_0x0515('0x6'));var config=require(_0x0515('0x7'));var jayson=require(_0x0515('0x8'));var client=jayson[_0x0515('0x9')][_0x0515('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e454c,_0x1c6208,_0x37c0b4){return new BPromise(function(_0x3aa9e8,_0x5c697a){return client[_0x0515('0xb')](_0x3e454c,_0x37c0b4)['then'](function(_0x1578ec){logger[_0x0515('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x1c6208,_0x0515('0xd'));logger[_0x0515('0xe')](_0x0515('0xf'),_0x1c6208,'request\x20sent',JSON['stringify'](_0x1578ec));if(_0x1578ec[_0x0515('0x10')]){if(_0x1578ec[_0x0515('0x10')][_0x0515('0x11')]===0x1f4){logger[_0x0515('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x1c6208,_0x1578ec[_0x0515('0x10')][_0x0515('0x12')]);return _0x5c697a(_0x1578ec['error'][_0x0515('0x12')]);}logger[_0x0515('0x10')](_0x0515('0x13'),_0x1c6208,_0x1578ec[_0x0515('0x10')]['message']);return _0x3aa9e8(_0x1578ec[_0x0515('0x10')][_0x0515('0x12')]);}else{logger['info'](_0x0515('0x13'),_0x1c6208,'request\x20sent');_0x3aa9e8(_0x1578ec['result'][_0x0515('0x12')]);}})[_0x0515('0x14')](function(_0x2d7311){logger[_0x0515('0x10')](_0x0515('0x13'),_0x1c6208,_0x2d7311);_0x5c697a(_0x2d7311);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c9303b4..cd570e7 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 _0x9c1d=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1bc155,_0xb1dbdd){var _0x45ca88=function(_0x16d218){while(--_0x16d218){_0x1bc155['push'](_0x1bc155['shift']());}};_0x45ca88(++_0xb1dbdd);}(_0x9c1d,0x1a9));var _0xd9c1=function(_0x3a3e93,_0x2c1de2){_0x3a3e93=_0x3a3e93-0x0;var _0x2e9436=_0x9c1d[_0x3a3e93];return _0x2e9436;};'use strict';var multer=require(_0xd9c1('0x0'));var util=require(_0xd9c1('0x1'));var path=require(_0xd9c1('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9c1('0x3'));var router=express[_0xd9c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd9c1('0x5'));var interaction=require(_0xd9c1('0x6'));var config=require('../../config/environment');module[_0xd9c1('0x7')]=router; \ No newline at end of file +var _0xcaa3=['express','Router','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x214377,_0x5d8d2a){var _0x275dbd=function(_0x15aac3){while(--_0x15aac3){_0x214377['push'](_0x214377['shift']());}};_0x275dbd(++_0x5d8d2a);}(_0xcaa3,0xcb));var _0x3caa=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0xcaa3[_0x55821d];return _0x58ea8a;};'use strict';var multer=require(_0x3caa('0x0'));var util=require(_0x3caa('0x1'));var path=require(_0x3caa('0x2'));var timeout=require(_0x3caa('0x3'));var express=require(_0x3caa('0x4'));var router=express[_0x3caa('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3caa('0x6'));var config=require(_0x3caa('0x7'));module[_0x3caa('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 f4be045..89c9ff1 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x43ab3c,_0x4d003a){var _0x3580b1=function(_0x5cba61){while(--_0x5cba61){_0x43ab3c['push'](_0x43ab3c['shift']());}};_0x3580b1(++_0x4d003a);}(_0xe706,0xa3));var _0x6e70=function(_0x3bf957,_0x168c65){_0x3bf957=_0x3bf957-0x0;var _0x551cc=_0xe706[_0x3bf957];return _0x551cc;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x28473b,_0x499a7a){var _0x40b410=function(_0x5c5947){while(--_0x5c5947){_0x28473b['push'](_0x28473b['shift']());}};_0x40b410(++_0x499a7a);}(_0xe706,0xa3));var _0x6e70=function(_0xf25c17,_0x288f2c){_0xf25c17=_0xf25c17-0x0;var _0x429736=_0xe706[_0xf25c17];return _0x429736;};'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/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 633f1fa..f354e90 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 _0x0815=['user_has_sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','define'];(function(_0x16c1c9,_0x3e2b7f){var _0x5801be=function(_0x5bc0f3){while(--_0x5bc0f3){_0x16c1c9['push'](_0x16c1c9['shift']());}};_0x5801be(++_0x3e2b7f);}(_0x0815,0x177));var _0x5081=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0815[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5081('0x0'));var util=require(_0x5081('0x1'));var logger=require(_0x5081('0x2'))('api');var moment=require(_0x5081('0x3'));var BPromise=require(_0x5081('0x4'));var rp=require(_0x5081('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5081('0x6'));var config=require(_0x5081('0x7'));var attributes=require(_0x5081('0x8'));module['exports']=function(_0x44c402,_0x535b20){return _0x44c402[_0x5081('0x9')]('UserSmsQueue',attributes,{'tableName':_0x5081('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd159=['moment','bluebird','request-promise','rimraf','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api'];(function(_0x1a10c1,_0x462974){var _0x26022a=function(_0x150789){while(--_0x150789){_0x1a10c1['push'](_0x1a10c1['shift']());}};_0x26022a(++_0x462974);}(_0xd159,0x140));var _0x9d15=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd159[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x9d15('0x0'));var util=require(_0x9d15('0x1'));var logger=require(_0x9d15('0x2'))(_0x9d15('0x3'));var moment=require(_0x9d15('0x4'));var BPromise=require(_0x9d15('0x5'));var rp=require(_0x9d15('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d15('0x7'));var config=require('../../config/environment');var attributes=require(_0x9d15('0x8'));module[_0x9d15('0x9')]=function(_0x657e06,_0x17256b){return _0x657e06['define'](_0x9d15('0xa'),attributes,{'tableName':_0x9d15('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 682644c..6b85498 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 _0xd480=['UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x263721,_0x10ce8e){var _0x5d503b=function(_0x10972a){while(--_0x10972a){_0x263721['push'](_0x263721['shift']());}};_0x5d503b(++_0x10ce8e);}(_0xd480,0x125));var _0x0d48=function(_0x51fa5a,_0x27091a){_0x51fa5a=_0x51fa5a-0x0;var _0x356211=_0xd480[_0x51fa5a];return _0x356211;};'use strict';var _=require(_0x0d48('0x0'));var util=require(_0x0d48('0x1'));var moment=require(_0x0d48('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d48('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d48('0x4'));var logger=require(_0x0d48('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0d48('0x6'));var client=jayson[_0x0d48('0x7')][_0x0d48('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d93c5,_0x3570bf,_0x14a069){return new BPromise(function(_0x1c6a7d,_0x433554){return client[_0x0d48('0x9')](_0x5d93c5,_0x14a069)[_0x0d48('0xa')](function(_0x1758ef){logger[_0x0d48('0xb')](_0x0d48('0xc'),_0x3570bf,_0x0d48('0xd'));logger[_0x0d48('0xe')](_0x0d48('0xf'),_0x3570bf,'request\x20sent',JSON[_0x0d48('0x10')](_0x1758ef));if(_0x1758ef[_0x0d48('0x11')]){if(_0x1758ef[_0x0d48('0x11')][_0x0d48('0x12')]===0x1f4){logger[_0x0d48('0x11')](_0x0d48('0xc'),_0x3570bf,_0x1758ef[_0x0d48('0x11')][_0x0d48('0x13')]);return _0x433554(_0x1758ef[_0x0d48('0x11')][_0x0d48('0x13')]);}logger['error'](_0x0d48('0xc'),_0x3570bf,_0x1758ef[_0x0d48('0x11')][_0x0d48('0x13')]);return _0x1c6a7d(_0x1758ef[_0x0d48('0x11')][_0x0d48('0x13')]);}else{logger[_0x0d48('0xb')](_0x0d48('0xc'),_0x3570bf,_0x0d48('0xd'));_0x1c6a7d(_0x1758ef[_0x0d48('0x14')][_0x0d48('0x13')]);}})[_0x0d48('0x15')](function(_0x43812b){logger[_0x0d48('0x11')](_0x0d48('0xc'),_0x3570bf,_0x43812b);_0x433554(_0x43812b);});});} \ No newline at end of file +var _0x7353=['then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','UserSmsQueue,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x14339e,_0x1c8fb3){var _0x1d7568=function(_0x54f443){while(--_0x54f443){_0x14339e['push'](_0x14339e['shift']());}};_0x1d7568(++_0x1c8fb3);}(_0x7353,0x12b));var _0x3735=function(_0x5e5ceb,_0x32b8d7){_0x5e5ceb=_0x5e5ceb-0x0;var _0xd9d5bd=_0x7353[_0x5e5ceb];return _0xd9d5bd;};'use strict';var _=require(_0x3735('0x0'));var util=require(_0x3735('0x1'));var moment=require(_0x3735('0x2'));var BPromise=require(_0x3735('0x3'));var rs=require(_0x3735('0x4'));var fs=require('fs');var Redis=require(_0x3735('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3735('0x6'));var logger=require(_0x3735('0x7'))(_0x3735('0x8'));var config=require(_0x3735('0x9'));var jayson=require(_0x3735('0xa'));var client=jayson[_0x3735('0xb')][_0x3735('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b844d,_0x2b7c3b,_0x1405b0){return new BPromise(function(_0x54a9c1,_0x9e1275){return client['request'](_0x5b844d,_0x1405b0)[_0x3735('0xd')](function(_0x1a6e88){logger[_0x3735('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x2b7c3b,_0x3735('0xf'));logger[_0x3735('0x10')](_0x3735('0x11'),_0x2b7c3b,'request\x20sent',JSON[_0x3735('0x12')](_0x1a6e88));if(_0x1a6e88['error']){if(_0x1a6e88['error'][_0x3735('0x13')]===0x1f4){logger[_0x3735('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x2b7c3b,_0x1a6e88[_0x3735('0x14')][_0x3735('0x15')]);return _0x9e1275(_0x1a6e88['error'][_0x3735('0x15')]);}logger[_0x3735('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x2b7c3b,_0x1a6e88['error'][_0x3735('0x15')]);return _0x54a9c1(_0x1a6e88[_0x3735('0x14')][_0x3735('0x15')]);}else{logger[_0x3735('0xe')](_0x3735('0x16'),_0x2b7c3b,_0x3735('0xf'));_0x54a9c1(_0x1a6e88[_0x3735('0x17')][_0x3735('0x15')]);}})['catch'](function(_0xaeb541){logger[_0x3735('0x14')](_0x3735('0x16'),_0x2b7c3b,_0xaeb541);_0x9e1275(_0xaeb541);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 43fdf4b..ce9f8b0 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 _0xd3f5=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout'];(function(_0x528736,_0x209104){var _0x26f3b3=function(_0x307922){while(--_0x307922){_0x528736['push'](_0x528736['shift']());}};_0x26f3b3(++_0x209104);}(_0xd3f5,0x147));var _0x5d3f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd3f5[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x5d3f('0x0'));var util=require(_0x5d3f('0x1'));var path=require('path');var timeout=require(_0x5d3f('0x2'));var express=require(_0x5d3f('0x3'));var router=express[_0x5d3f('0x4')]();var fs_extra=require(_0x5d3f('0x5'));var auth=require(_0x5d3f('0x6'));var interaction=require(_0x5d3f('0x7'));var config=require(_0x5d3f('0x8'));module[_0x5d3f('0x9')]=router; \ No newline at end of file +var _0x851a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','path','connect-timeout'];(function(_0x3bdd25,_0x47234c){var _0x3b74bd=function(_0x5b5283){while(--_0x5b5283){_0x3bdd25['push'](_0x3bdd25['shift']());}};_0x3b74bd(++_0x47234c);}(_0x851a,0x19b));var _0xa851=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x851a[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xa851('0x0'));var util=require('util');var path=require(_0xa851('0x1'));var timeout=require(_0xa851('0x2'));var express=require(_0xa851('0x3'));var router=express[_0xa851('0x4')]();var fs_extra=require(_0xa851('0x5'));var auth=require(_0xa851('0x6'));var interaction=require(_0xa851('0x7'));var config=require(_0xa851('0x8'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 4457cbe..d789c7d 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0xcb21d2,_0x509f98){var _0x3cccd5=function(_0x144608){while(--_0x144608){_0xcb21d2['push'](_0xcb21d2['shift']());}};_0x3cccd5(++_0x509f98);}(_0xe706,0xa3));var _0x6e70=function(_0x6287b6,_0x5682e7){_0x6287b6=_0x6287b6-0x0;var _0x5d6be4=_0xe706[_0x6287b6];return _0x5d6be4;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x5b405c,_0x379166){var _0x2d0b28=function(_0x2b569a){while(--_0x2b569a){_0x5b405c['push'](_0x5b405c['shift']());}};_0x2d0b28(++_0x379166);}(_0xe706,0xa3));var _0x6e70=function(_0x26b308,_0x397dfc){_0x26b308=_0x26b308-0x0;var _0x59478d=_0xe706[_0x26b308];return _0x59478d;};'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/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 1160732..ee8d3d8 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 _0x2123=['request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x12fe9b,_0x2ce346){var _0x176236=function(_0x181cd6){while(--_0x181cd6){_0x12fe9b['push'](_0x12fe9b['shift']());}};_0x176236(++_0x2ce346);}(_0x2123,0x190));var _0x3212=function(_0x2f4173,_0x1f5d89){_0x2f4173=_0x2f4173-0x0;var _0x1f9f8d=_0x2123[_0x2f4173];return _0x1f9f8d;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var logger=require(_0x3212('0x2'))(_0x3212('0x3'));var moment=require(_0x3212('0x4'));var BPromise=require(_0x3212('0x5'));var rp=require(_0x3212('0x6'));var fs=require('fs');var path=require(_0x3212('0x7'));var rimraf=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var attributes=require(_0x3212('0xa'));module[_0x3212('0xb')]=function(_0x5d9d36,_0x3859e4){return _0x5d9d36[_0x3212('0xc')](_0x3212('0xd'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81bd=['../../config/environment','./userVoiceQueue.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xcd2c9a,_0x3c1626){var _0xd032b6=function(_0x495116){while(--_0x495116){_0xcd2c9a['push'](_0xcd2c9a['shift']());}};_0xd032b6(++_0x3c1626);}(_0x81bd,0x7c));var _0xd81b=function(_0x32e7d6,_0x682bc5){_0x32e7d6=_0x32e7d6-0x0;var _0x5427cf=_0x81bd[_0x32e7d6];return _0x5427cf;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var attributes=require(_0xd81b('0x9'));module['exports']=function(_0x42a0aa,_0x34eb73){return _0x42a0aa[_0xd81b('0xa')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 36b968f..e425c83 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 _0xc388=['randomstring','ioredis','../../config/utils','../../config/environment','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x1b63bd,_0x347ec0){var _0x109ce1=function(_0x525978){while(--_0x525978){_0x1b63bd['push'](_0x1b63bd['shift']());}};_0x109ce1(++_0x347ec0);}(_0xc388,0xe4));var _0x8c38=function(_0x5d0a40,_0x3dcb66){_0x5d0a40=_0x5d0a40-0x0;var _0x368fd2=_0xc388[_0x5d0a40];return _0x368fd2;};'use strict';var _=require(_0x8c38('0x0'));var util=require(_0x8c38('0x1'));var moment=require(_0x8c38('0x2'));var BPromise=require('bluebird');var rs=require(_0x8c38('0x3'));var fs=require('fs');var Redis=require(_0x8c38('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c38('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8c38('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8c38('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x319cf2,_0xcc4434,_0x31605e){return new BPromise(function(_0xfe9fc0,_0x4253d6){return client[_0x8c38('0x8')](_0x319cf2,_0x31605e)[_0x8c38('0x9')](function(_0x11c204){logger[_0x8c38('0xa')](_0x8c38('0xb'),_0xcc4434,_0x8c38('0xc'));logger[_0x8c38('0xd')](_0x8c38('0xe'),_0xcc4434,_0x8c38('0xc'),JSON[_0x8c38('0xf')](_0x11c204));if(_0x11c204[_0x8c38('0x10')]){if(_0x11c204[_0x8c38('0x10')][_0x8c38('0x11')]===0x1f4){logger[_0x8c38('0x10')](_0x8c38('0xb'),_0xcc4434,_0x11c204['error'][_0x8c38('0x12')]);return _0x4253d6(_0x11c204[_0x8c38('0x10')][_0x8c38('0x12')]);}logger[_0x8c38('0x10')](_0x8c38('0xb'),_0xcc4434,_0x11c204[_0x8c38('0x10')][_0x8c38('0x12')]);return _0xfe9fc0(_0x11c204[_0x8c38('0x10')][_0x8c38('0x12')]);}else{logger[_0x8c38('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0xcc4434,_0x8c38('0xc'));_0xfe9fc0(_0x11c204[_0x8c38('0x13')][_0x8c38('0x12')]);}})[_0x8c38('0x14')](function(_0x395d41){logger['error'](_0x8c38('0xb'),_0xcc4434,_0x395d41);_0x4253d6(_0x395d41);});});} \ No newline at end of file +var _0xde75=['../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1576fa,_0x5ba64e){var _0x1304ca=function(_0x1912ef){while(--_0x1912ef){_0x1576fa['push'](_0x1576fa['shift']());}};_0x1304ca(++_0x5ba64e);}(_0xde75,0x123));var _0x5de7=function(_0x274c58,_0x2f79eb){_0x274c58=_0x274c58-0x0;var _0x2fe236=_0xde75[_0x274c58];return _0x2fe236;};'use strict';var _=require(_0x5de7('0x0'));var util=require(_0x5de7('0x1'));var moment=require(_0x5de7('0x2'));var BPromise=require(_0x5de7('0x3'));var rs=require(_0x5de7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5de7('0x5'))['db'];var utils=require(_0x5de7('0x6'));var logger=require(_0x5de7('0x7'))(_0x5de7('0x8'));var config=require(_0x5de7('0x9'));var jayson=require(_0x5de7('0xa'));var client=jayson[_0x5de7('0xb')][_0x5de7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x49eeb3,_0x1e22b1,_0x3f978f){return new BPromise(function(_0x1bb3e3,_0x13e80c){return client[_0x5de7('0xd')](_0x49eeb3,_0x3f978f)[_0x5de7('0xe')](function(_0x346901){logger[_0x5de7('0xf')](_0x5de7('0x10'),_0x1e22b1,'request\x20sent');logger[_0x5de7('0x11')](_0x5de7('0x12'),_0x1e22b1,_0x5de7('0x13'),JSON[_0x5de7('0x14')](_0x346901));if(_0x346901[_0x5de7('0x15')]){if(_0x346901[_0x5de7('0x15')]['code']===0x1f4){logger['error'](_0x5de7('0x10'),_0x1e22b1,_0x346901[_0x5de7('0x15')][_0x5de7('0x16')]);return _0x13e80c(_0x346901[_0x5de7('0x15')][_0x5de7('0x16')]);}logger[_0x5de7('0x15')](_0x5de7('0x10'),_0x1e22b1,_0x346901['error']['message']);return _0x1bb3e3(_0x346901['error']['message']);}else{logger[_0x5de7('0xf')](_0x5de7('0x10'),_0x1e22b1,_0x5de7('0x13'));_0x1bb3e3(_0x346901[_0x5de7('0x17')]['message']);}})[_0x5de7('0x18')](function(_0x57d96d){logger[_0x5de7('0x15')](_0x5de7('0x10'),_0x1e22b1,_0x57d96d);_0x13e80c(_0x57d96d);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 2582f53..396205a 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 _0x0e21=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x4e61cd,_0x5e544b){var _0x404157=function(_0x9f6ca8){while(--_0x9f6ca8){_0x4e61cd['push'](_0x4e61cd['shift']());}};_0x404157(++_0x5e544b);}(_0x0e21,0xe8));var _0x10e2=function(_0x418796,_0x52de9c){_0x418796=_0x418796-0x0;var _0x2cf200=_0x0e21[_0x418796];return _0x2cf200;};'use strict';var multer=require('multer');var util=require(_0x10e2('0x0'));var path=require(_0x10e2('0x1'));var timeout=require(_0x10e2('0x2'));var express=require('express');var router=express[_0x10e2('0x3')]();var fs_extra=require(_0x10e2('0x4'));var auth=require(_0x10e2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x10e2('0x6')]=router; \ No newline at end of file +var _0x02f7=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer'];(function(_0x4cfd4d,_0x135ab4){var _0x5c7a28=function(_0x562665){while(--_0x562665){_0x4cfd4d['push'](_0x4cfd4d['shift']());}};_0x5c7a28(++_0x135ab4);}(_0x02f7,0x1d3));var _0x702f=function(_0x4b40a2,_0x4a8b83){_0x4b40a2=_0x4b40a2-0x0;var _0x5d2478=_0x02f7[_0x4b40a2];return _0x5d2478;};'use strict';var multer=require(_0x702f('0x0'));var util=require(_0x702f('0x1'));var path=require(_0x702f('0x2'));var timeout=require('connect-timeout');var express=require(_0x702f('0x3'));var router=express[_0x702f('0x4')]();var fs_extra=require(_0x702f('0x5'));var auth=require(_0x702f('0x6'));var interaction=require(_0x702f('0x7'));var config=require(_0x702f('0x8'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 49c7dd9..6685a56 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 _0x78e8=['queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x14c2df,_0x3d010f){var _0x579fcd=function(_0xf5c929){while(--_0xf5c929){_0x14c2df['push'](_0x14c2df['shift']());}};_0x579fcd(++_0x3d010f);}(_0x78e8,0x92));var _0x878e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x78e8[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x878e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x878e('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x878e('0x2')},'membername':{'type':Sequelize[_0x878e('0x3')],'allowNull':![],'comment':_0x878e('0x2')},'UserId':{'type':Sequelize[_0x878e('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x878e('0x3')],'allowNull':![],'unique':_0x878e('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x878e('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x878e('0x3')],'allowNull':![],'unique':_0x878e('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x878e('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x878e('0x1')](0xb),'defaultValue':0x0,'comment':_0x878e('0x2')}}; \ No newline at end of file +var _0xe0d6=['STRING','queue_interface','INTEGER','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0xe0d6,0x1a7));var _0x6e0d=function(_0x563764,_0x5673c7){_0x563764=_0x563764-0x0;var _0x13b7b3=_0xe0d6[_0x563764];return _0x13b7b3;};'use strict';var Sequelize=require(_0x6e0d('0x0'));module[_0x6e0d('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x6e0d('0x2')},'membername':{'type':Sequelize[_0x6e0d('0x3')],'allowNull':![],'comment':_0x6e0d('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x6e0d('0x3')],'allowNull':![],'unique':_0x6e0d('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x6e0d('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x6e0d('0x2')},'penalty':{'type':Sequelize[_0x6e0d('0x5')](0xb),'defaultValue':0x0,'comment':_0x6e0d('0x2')},'paused':{'type':Sequelize[_0x6e0d('0x5')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 38676ad..0b0a2dd 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 _0x3734=['UserVoiceQueueRt','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x1c64f0,_0x571699){var _0x27a137=function(_0x32ffab){while(--_0x32ffab){_0x1c64f0['push'](_0x1c64f0['shift']());}};_0x27a137(++_0x571699);}(_0x3734,0x15e));var _0x4373=function(_0x2e4008,_0x450740){_0x2e4008=_0x2e4008-0x0;var _0x3a611b=_0x3734[_0x2e4008];return _0x3a611b;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x4373('0x0'))['db'][_0x4373('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4373('0x2')](0x0);var events={'afterCreate':_0x4373('0x3'),'afterUpdate':_0x4373('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4a0ee8){return function(_0x582277,_0x40f792,_0x511020){UserVoiceQueueRtEvents['emit'](_0x4a0ee8+':'+_0x582277['id'],_0x582277);UserVoiceQueueRtEvents[_0x4373('0x5')](_0x4a0ee8,_0x582277);_0x511020(null);};}for(var e in events){if(events[_0x4373('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x4373('0x7')](e,emitEvent(event));}}module[_0x4373('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xbc25=['update','emit','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x5231e5,_0x36e009){var _0x274de0=function(_0x351f2f){while(--_0x351f2f){_0x5231e5['push'](_0x5231e5['shift']());}};_0x274de0(++_0x36e009);}(_0xbc25,0x88));var _0x5bc2=function(_0x36d7a6,_0x242da1){_0x36d7a6=_0x36d7a6-0x0;var _0x5a5c41=_0xbc25[_0x36d7a6];return _0x5a5c41;};'use strict';var EventEmitter=require(_0x5bc2('0x0'));var UserVoiceQueueRt=require(_0x5bc2('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5bc2('0x2')](0x0);var events={'afterCreate':_0x5bc2('0x3'),'afterUpdate':_0x5bc2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x305085){return function(_0x37a2ef,_0xfaa9f6,_0x35a254){UserVoiceQueueRtEvents[_0x5bc2('0x5')](_0x305085+':'+_0x37a2ef['id'],_0x37a2ef);UserVoiceQueueRtEvents[_0x5bc2('0x5')](_0x305085,_0x37a2ef);_0x35a254(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x5bc2('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 963886d..c475a6a 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 _0xcfd3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0x5090a1,_0x98150f){var _0x2c0cdd=function(_0x167df3){while(--_0x167df3){_0x5090a1['push'](_0x5090a1['shift']());}};_0x2c0cdd(++_0x98150f);}(_0xcfd3,0x13f));var _0x3cfd=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0xcfd3[_0x14a862];return _0x245eb5;};'use strict';var _=require(_0x3cfd('0x0'));var util=require(_0x3cfd('0x1'));var logger=require(_0x3cfd('0x2'))(_0x3cfd('0x3'));var moment=require(_0x3cfd('0x4'));var BPromise=require(_0x3cfd('0x5'));var rp=require(_0x3cfd('0x6'));var fs=require('fs');var path=require(_0x3cfd('0x7'));var rimraf=require(_0x3cfd('0x8'));var config=require(_0x3cfd('0x9'));var attributes=require(_0x3cfd('0xa'));module[_0x3cfd('0xb')]=function(_0xa4c6d6,_0x311888){return _0xa4c6d6[_0x3cfd('0xc')]('UserVoiceQueueRt',attributes,{'tableName':_0x3cfd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf90d=['request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1f8f32,_0x353852){var _0x5c35fd=function(_0x3437db){while(--_0x3437db){_0x1f8f32['push'](_0x1f8f32['shift']());}};_0x5c35fd(++_0x353852);}(_0xf90d,0xbe));var _0xdf90=function(_0x2a19b5,_0x450ffc){_0x2a19b5=_0x2a19b5-0x0;var _0x255489=_0xf90d[_0x2a19b5];return _0x255489;};'use strict';var _=require(_0xdf90('0x0'));var util=require(_0xdf90('0x1'));var logger=require(_0xdf90('0x2'))(_0xdf90('0x3'));var moment=require(_0xdf90('0x4'));var BPromise=require(_0xdf90('0x5'));var rp=require(_0xdf90('0x6'));var fs=require('fs');var path=require(_0xdf90('0x7'));var rimraf=require(_0xdf90('0x8'));var config=require(_0xdf90('0x9'));var attributes=require(_0xdf90('0xa'));module['exports']=function(_0xaaa57b,_0x182d34){return _0xaaa57b[_0xdf90('0xb')](_0xdf90('0xc'),attributes,{'tableName':_0xdf90('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 9dcacad..6d42a48 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 _0x699f=['where','sequelize','COUNT','outboundQueuePauses','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw'];(function(_0x1c55f1,_0x3669ca){var _0x44dd27=function(_0x531d3e){while(--_0x531d3e){_0x1c55f1['push'](_0x1c55f1['shift']());}};_0x44dd27(++_0x3669ca);}(_0x699f,0x80));var _0xf699=function(_0x5cbd7b,_0x207439){_0x5cbd7b=_0x5cbd7b-0x0;var _0x3fdfb8=_0x699f[_0x5cbd7b];return _0x3fdfb8;};'use strict';var _=require(_0xf699('0x0'));var util=require(_0xf699('0x1'));var moment=require(_0xf699('0x2'));var BPromise=require(_0xf699('0x3'));var rs=require(_0xf699('0x4'));var fs=require('fs');var Redis=require(_0xf699('0x5'));var db=require(_0xf699('0x6'))['db'];var utils=require(_0xf699('0x7'));var logger=require(_0xf699('0x8'))(_0xf699('0x9'));var config=require(_0xf699('0xa'));var jayson=require(_0xf699('0xb'));var client=jayson[_0xf699('0xc')][_0xf699('0xd')]({'port':0x232a});config[_0xf699('0xe')]=_[_0xf699('0xf')](config[_0xf699('0xe')],{'host':_0xf699('0x10'),'port':0x18eb});var socket=require(_0xf699('0x11'))(new Redis(config['redis']));require(_0xf699('0x12'))[_0xf699('0x13')](socket);function respondWithRpcPromise(_0x3e3232,_0x1c7725,_0x33a3d2){return new BPromise(function(_0x5f15a3,_0x2a6800){return client[_0xf699('0x14')](_0x3e3232,_0x33a3d2)[_0xf699('0x15')](function(_0x4a2784){logger[_0xf699('0x16')](_0xf699('0x17'),_0x1c7725,_0xf699('0x18'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x1c7725,'request\x20sent',JSON[_0xf699('0x19')](_0x4a2784));if(_0x4a2784[_0xf699('0x1a')]){if(_0x4a2784[_0xf699('0x1a')][_0xf699('0x1b')]===0x1f4){logger['error'](_0xf699('0x17'),_0x1c7725,_0x4a2784[_0xf699('0x1a')][_0xf699('0x1c')]);return _0x2a6800(_0x4a2784[_0xf699('0x1a')]['message']);}logger['error'](_0xf699('0x17'),_0x1c7725,_0x4a2784[_0xf699('0x1a')]['message']);return _0x5f15a3(_0x4a2784[_0xf699('0x1a')][_0xf699('0x1c')]);}else{logger[_0xf699('0x16')](_0xf699('0x17'),_0x1c7725,_0xf699('0x18'));_0x5f15a3(_0x4a2784[_0xf699('0x1d')]['message']);}})[_0xf699('0x1e')](function(_0x258e7c){logger[_0xf699('0x1a')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1c7725,_0x258e7c);_0x2a6800(_0x258e7c);});});}exports[_0xf699('0x1f')]=function(_0x389aa3){var _0x49d43f=this;return new Promise(function(_0xf42726,_0xc05449){return db[_0xf699('0x20')][_0xf699('0x21')]({'raw':_0x389aa3['options']?_0x389aa3[_0xf699('0x22')][_0xf699('0x23')]===undefined?!![]:![]:!![],'where':_0x389aa3[_0xf699('0x22')]?_0x389aa3['options'][_0xf699('0x24')]||null:null,'attributes':[[db[_0xf699('0x25')]['fn'](_0xf699('0x26'),db[_0xf699('0x25')]['fn']('IF',db[_0xf699('0x25')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0xf699('0x27')]]})['then'](function(_0x1bf948){logger[_0xf699('0x16')](_0xf699('0x1f'),_0x389aa3);logger[_0xf699('0x28')]('GetVoiceQueueRtPauses',_0x389aa3,JSON[_0xf699('0x19')](_0x1bf948));_0xf42726(_0x1bf948);})[_0xf699('0x1e')](function(_0x89076c){logger[_0xf699('0x1a')](_0xf699('0x1f'),_0x89076c[_0xf699('0x1c')],_0x389aa3);_0xc05449(_0x49d43f[_0xf699('0x1a')](0x1f4,_0x89076c[_0xf699('0x1c')]));});});}; \ No newline at end of file +var _0xaa78=['./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x51bfcf,_0x415320){var _0x3abe14=function(_0x21af13){while(--_0x21af13){_0x51bfcf['push'](_0x51bfcf['shift']());}};_0x3abe14(++_0x415320);}(_0xaa78,0x13f));var _0x8aa7=function(_0x134192,_0x36adc5){_0x134192=_0x134192-0x0;var _0x3cd080=_0xaa78[_0x134192];return _0x3cd080;};'use strict';var _=require(_0x8aa7('0x0'));var util=require(_0x8aa7('0x1'));var moment=require(_0x8aa7('0x2'));var BPromise=require(_0x8aa7('0x3'));var rs=require(_0x8aa7('0x4'));var fs=require('fs');var Redis=require(_0x8aa7('0x5'));var db=require(_0x8aa7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8aa7('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8aa7('0x8')][_0x8aa7('0x9')]({'port':0x232a});config[_0x8aa7('0xa')]=_[_0x8aa7('0xb')](config[_0x8aa7('0xa')],{'host':_0x8aa7('0xc'),'port':0x18eb});var socket=require(_0x8aa7('0xd'))(new Redis(config['redis']));require(_0x8aa7('0xe'))[_0x8aa7('0xf')](socket);function respondWithRpcPromise(_0x371655,_0x394a60,_0x57d8e1){return new BPromise(function(_0x381102,_0x117281){return client['request'](_0x371655,_0x57d8e1)[_0x8aa7('0x10')](function(_0x4af0b2){logger[_0x8aa7('0x11')](_0x8aa7('0x12'),_0x394a60,_0x8aa7('0x13'));logger[_0x8aa7('0x14')](_0x8aa7('0x15'),_0x394a60,_0x8aa7('0x13'),JSON[_0x8aa7('0x16')](_0x4af0b2));if(_0x4af0b2['error']){if(_0x4af0b2[_0x8aa7('0x17')][_0x8aa7('0x18')]===0x1f4){logger[_0x8aa7('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x394a60,_0x4af0b2[_0x8aa7('0x17')][_0x8aa7('0x19')]);return _0x117281(_0x4af0b2[_0x8aa7('0x17')][_0x8aa7('0x19')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x394a60,_0x4af0b2[_0x8aa7('0x17')][_0x8aa7('0x19')]);return _0x381102(_0x4af0b2['error'][_0x8aa7('0x19')]);}else{logger[_0x8aa7('0x11')](_0x8aa7('0x12'),_0x394a60,'request\x20sent');_0x381102(_0x4af0b2[_0x8aa7('0x1a')][_0x8aa7('0x19')]);}})[_0x8aa7('0x1b')](function(_0x1c0e7f){logger[_0x8aa7('0x17')](_0x8aa7('0x12'),_0x394a60,_0x1c0e7f);_0x117281(_0x1c0e7f);});});}exports[_0x8aa7('0x1c')]=function(_0x33ee54){var _0xf1a3de=this;return new Promise(function(_0x5a9da0,_0x782ffa){return db[_0x8aa7('0x1d')][_0x8aa7('0x1e')]({'raw':_0x33ee54[_0x8aa7('0x1f')]?_0x33ee54[_0x8aa7('0x1f')][_0x8aa7('0x20')]===undefined?!![]:![]:!![],'where':_0x33ee54['options']?_0x33ee54[_0x8aa7('0x1f')][_0x8aa7('0x21')]||null:null,'attributes':[[db[_0x8aa7('0x22')]['fn']('COUNT',db[_0x8aa7('0x22')]['fn']('IF',db[_0x8aa7('0x22')][_0x8aa7('0x23')]('`paused`\x20=\x201,\x201,\x20null'))),_0x8aa7('0x24')]]})[_0x8aa7('0x10')](function(_0x5720ae){logger[_0x8aa7('0x11')](_0x8aa7('0x1c'),_0x33ee54);logger[_0x8aa7('0x14')](_0x8aa7('0x1c'),_0x33ee54,JSON[_0x8aa7('0x16')](_0x5720ae));_0x5a9da0(_0x5720ae);})['catch'](function(_0x1fbcfd){logger['error']('GetVoiceQueueRtPauses',_0x1fbcfd[_0x8aa7('0x19')],_0x33ee54);_0x782ffa(_0xf1a3de[_0x8aa7('0x17')](0x1f4,_0x1fbcfd[_0x8aa7('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 558f6b2..368413e 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 _0x55a2=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','register','length'];(function(_0x33276d,_0x46ad0a){var _0x17d78d=function(_0x561da6){while(--_0x561da6){_0x33276d['push'](_0x33276d['shift']());}};_0x17d78d(++_0x46ad0a);}(_0x55a2,0x109));var _0x255a=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0x55a2[_0x4226d6];return _0x19655b;};'use strict';var UserVoiceQueueRtEvents=require(_0x255a('0x0'));var events=[_0x255a('0x1'),_0x255a('0x2'),_0x255a('0x3')];function createListener(_0x20bf3b,_0x2cbc25){return function(_0x1e6bba){_0x2cbc25[_0x255a('0x4')](_0x20bf3b,_0x1e6bba);};}function removeListener(_0x6a73b8,_0x43ffee){return function(){UserVoiceQueueRtEvents['removeListener'](_0x6a73b8,_0x43ffee);};}exports[_0x255a('0x5')]=function(_0x4d4aa5){for(var _0xe31717=0x0,_0x305dd9=events[_0x255a('0x6')];_0xe31717<_0x305dd9;_0xe31717++){var _0x80f262=events[_0xe31717];var _0x1e6fd8=createListener(_0x255a('0x7')+_0x80f262,_0x4d4aa5);UserVoiceQueueRtEvents['on'](_0x80f262,_0x1e6fd8);}}; \ No newline at end of file +var _0xf321=['update','emit','removeListener','register','length','userVoiceQueueRt:','save','remove'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf321,0x136));var _0x1f32=function(_0x58023c,_0x5db893){_0x58023c=_0x58023c-0x0;var _0x415ed9=_0xf321[_0x58023c];return _0x415ed9;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x1f32('0x0'),_0x1f32('0x1'),_0x1f32('0x2')];function createListener(_0x5a0cb4,_0x18a266){return function(_0x27ac10){_0x18a266[_0x1f32('0x3')](_0x5a0cb4,_0x27ac10);};}function removeListener(_0x2e5bd8,_0x3f2e58){return function(){UserVoiceQueueRtEvents[_0x1f32('0x4')](_0x2e5bd8,_0x3f2e58);};}exports[_0x1f32('0x5')]=function(_0x3bf810){for(var _0x1df230=0x0,_0x4307f8=events[_0x1f32('0x6')];_0x1df230<_0x4307f8;_0x1df230++){var _0x9acf12=events[_0x1df230];var _0x159a0d=createListener(_0x1f32('0x7')+_0x9acf12,_0x3bf810);UserVoiceQueueRtEvents['on'](_0x9acf12,_0x159a0d);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 3071613..1331835 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39c4=['util','express','Router','../../components/interaction/service','../../config/environment','exports'];(function(_0xb79080,_0x324ba4){var _0x5a611e=function(_0x2f15a9){while(--_0x2f15a9){_0xb79080['push'](_0xb79080['shift']());}};_0x5a611e(++_0x324ba4);}(_0x39c4,0x174));var _0x439c=function(_0x48c5f4,_0x2a7f17){_0x48c5f4=_0x48c5f4-0x0;var _0x4f5c05=_0x39c4[_0x48c5f4];return _0x4f5c05;};'use strict';var multer=require('multer');var util=require(_0x439c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x439c('0x1'));var router=express[_0x439c('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x439c('0x3'));var config=require(_0x439c('0x4'));module[_0x439c('0x5')]=router; \ No newline at end of file +var _0x5423=['../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','connect-timeout','express','fs-extra'];(function(_0x385900,_0x40f4fa){var _0x48dace=function(_0x26bddf){while(--_0x26bddf){_0x385900['push'](_0x385900['shift']());}};_0x48dace(++_0x40f4fa);}(_0x5423,0xe3));var _0x3542=function(_0xdded02,_0x385f97){_0xdded02=_0xdded02-0x0;var _0x132d3f=_0x5423[_0xdded02];return _0x132d3f;};'use strict';var multer=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var path=require('path');var timeout=require(_0x3542('0x2'));var express=require(_0x3542('0x3'));var router=express['Router']();var fs_extra=require(_0x3542('0x4'));var auth=require(_0x3542('0x5'));var interaction=require(_0x3542('0x6'));var config=require(_0x3542('0x7'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index bac3a34..71999cd 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x30fd67,_0x52521d){var _0xed6b3c=function(_0x437096){while(--_0x437096){_0x30fd67['push'](_0x30fd67['shift']());}};_0xed6b3c(++_0x52521d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x295c8a,_0x768dbe){var _0x50ccc0=function(_0x341add){while(--_0x341add){_0x295c8a['push'](_0x295c8a['shift']());}};_0x50ccc0(++_0x768dbe);}(_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 diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 43cf681..2b7bef6 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4024=['define','user_has_whatsapp_queues','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x297e13,_0xa2a279){var _0x37cd19=function(_0x26200b){while(--_0x26200b){_0x297e13['push'](_0x297e13['shift']());}};_0x37cd19(++_0xa2a279);}(_0x4024,0x89));var _0x4402=function(_0x34ee96,_0x425584){_0x34ee96=_0x34ee96-0x0;var _0x343899=_0x4024[_0x34ee96];return _0x343899;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var logger=require('../../config/logger')(_0x4402('0x2'));var moment=require(_0x4402('0x3'));var BPromise=require('bluebird');var rp=require(_0x4402('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x17699b,_0x346ddc){return _0x17699b[_0x4402('0x7')]('UserWhatsappQueue',attributes,{'tableName':_0x4402('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e81=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x27c068,_0x342981){var _0xe5a67f=function(_0x20658a){while(--_0x20658a){_0x27c068['push'](_0x27c068['shift']());}};_0xe5a67f(++_0x342981);}(_0x4e81,0x1bc));var _0x14e8=function(_0x1b745b,_0x3e2d40){_0x1b745b=_0x1b745b-0x0;var _0x120a9d=_0x4e81[_0x1b745b];return _0x120a9d;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var logger=require(_0x14e8('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x14e8('0x3'));var fs=require('fs');var path=require(_0x14e8('0x4'));var rimraf=require(_0x14e8('0x5'));var config=require(_0x14e8('0x6'));var attributes=require(_0x14e8('0x7'));module[_0x14e8('0x8')]=function(_0x56a266,_0x57c79b){return _0x56a266[_0x14e8('0x9')](_0x14e8('0xa'),attributes,{'tableName':_0x14e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index cbc1b3c..dd35ce5 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\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(_0x2e9211,_0x565cd0){var _0x2886f9=function(_0x24e568){while(--_0x24e568){_0x2e9211['push'](_0x2e9211['shift']());}};_0x2886f9(++_0x565cd0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\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(_0x145ac9,_0x332cae){var _0x3e56c0=function(_0x58ff43){while(--_0x58ff43){_0x145ac9['push'](_0x145ac9['shift']());}};_0x3e56c0(++_0x332cae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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/variable/index.js b/server/api/variable/index.js index e6862be..c6095ed 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 _0xb44d=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x3005ed,_0x4a5340){var _0x9429e=function(_0x498c79){while(--_0x498c79){_0x3005ed['push'](_0x3005ed['shift']());}};_0x9429e(++_0x4a5340);}(_0xb44d,0x1eb));var _0xdb44=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb44d[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0xdb44('0x0'));var path=require(_0xdb44('0x1'));var timeout=require(_0xdb44('0x2'));var express=require(_0xdb44('0x3'));var router=express[_0xdb44('0x4')]();var fs_extra=require(_0xdb44('0x5'));var auth=require(_0xdb44('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdb44('0x7'));var controller=require(_0xdb44('0x8'));router[_0xdb44('0x9')]('/',auth[_0xdb44('0xa')](),controller['index']);router[_0xdb44('0x9')](_0xdb44('0xb'),auth[_0xdb44('0xa')](),controller[_0xdb44('0xc')]);router[_0xdb44('0xd')]('/',auth[_0xdb44('0xa')](),controller['create']);router[_0xdb44('0xe')](_0xdb44('0xb'),auth[_0xdb44('0xa')](),controller[_0xdb44('0xf')]);router[_0xdb44('0x10')](_0xdb44('0xb'),auth['isAuthenticated'](),controller[_0xdb44('0x11')]);module[_0xdb44('0x12')]=router; \ No newline at end of file +var _0xdae5=['put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x47078c,_0x2dd424){var _0x2a7dd2=function(_0x188b34){while(--_0x188b34){_0x47078c['push'](_0x47078c['shift']());}};_0x2a7dd2(++_0x2dd424);}(_0xdae5,0x180));var _0x5dae=function(_0x8d3d4f,_0x57d4f6){_0x8d3d4f=_0x8d3d4f-0x0;var _0x328a35=_0xdae5[_0x8d3d4f];return _0x328a35;};'use strict';var multer=require('multer');var util=require(_0x5dae('0x0'));var path=require(_0x5dae('0x1'));var timeout=require(_0x5dae('0x2'));var express=require('express');var router=express[_0x5dae('0x3')]();var fs_extra=require(_0x5dae('0x4'));var auth=require(_0x5dae('0x5'));var interaction=require(_0x5dae('0x6'));var config=require('../../config/environment');var controller=require(_0x5dae('0x7'));router[_0x5dae('0x8')]('/',auth[_0x5dae('0x9')](),controller[_0x5dae('0xa')]);router['get'](_0x5dae('0xb'),auth[_0x5dae('0x9')](),controller[_0x5dae('0xc')]);router[_0x5dae('0xd')]('/',auth[_0x5dae('0x9')](),controller[_0x5dae('0xe')]);router[_0x5dae('0xf')](_0x5dae('0xb'),auth[_0x5dae('0x9')](),controller[_0x5dae('0x10')]);router[_0x5dae('0x11')]('/:id',auth[_0x5dae('0x9')](),controller['destroy']);module[_0x5dae('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index ca72cce..6e0a993 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 _0x3c77=['sequelize','exports','STRING','name'];(function(_0x3c57fe,_0x17b067){var _0x500f79=function(_0x503806){while(--_0x503806){_0x3c57fe['push'](_0x3c57fe['shift']());}};_0x500f79(++_0x17b067);}(_0x3c77,0xc8));var _0x73c7=function(_0x5f4618,_0x488d5b){_0x5f4618=_0x5f4618-0x0;var _0x2a500c=_0x3c77[_0x5f4618];return _0x2a500c;};'use strict';var Sequelize=require(_0x73c7('0x0'));module[_0x73c7('0x1')]={'name':{'type':Sequelize[_0x73c7('0x2')],'unique':_0x73c7('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x73c7('0x2')]}}; \ No newline at end of file +var _0xb6de=['sequelize','STRING','name'];(function(_0x490100,_0x4c4ae6){var _0x26d3e5=function(_0x54412a){while(--_0x54412a){_0x490100['push'](_0x490100['shift']());}};_0x26d3e5(++_0x4c4ae6);}(_0xb6de,0x195));var _0xeb6d=function(_0x458020,_0x5073bf){_0x458020=_0x458020-0x0;var _0x3bc2ac=_0xb6de[_0x458020];return _0x3bc2ac;};'use strict';var Sequelize=require(_0xeb6d('0x0'));module['exports']={'name':{'type':Sequelize[_0xeb6d('0x1')],'unique':_0xeb6d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeb6d('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 0086b4a..95b930d 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 _0x297f=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','get','Variables','error','stack','name','index','map','Variable','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','include','create','body','user'];(function(_0x31e175,_0x4dbb72){var _0x4b8a11=function(_0x3e95ee){while(--_0x3e95ee){_0x31e175['push'](_0x31e175['shift']());}};_0x4b8a11(++_0x4dbb72);}(_0x297f,0x1f0));var _0xf297=function(_0x4b420d,_0x172f49){_0x4b420d=_0x4b420d-0x0;var _0x52ee0a=_0x297f[_0x4b420d];return _0x52ee0a;};'use strict';var emlformat=require(_0xf297('0x0'));var rimraf=require(_0xf297('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf297('0x2'));var moment=require(_0xf297('0x3'));var BPromise=require(_0xf297('0x4'));var Mustache=require(_0xf297('0x5'));var util=require('util');var path=require(_0xf297('0x6'));var sox=require('sox');var csv=require(_0xf297('0x7'));var ejs=require(_0xf297('0x8'));var fs=require('fs');var fs_extra=require(_0xf297('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf297('0xa'));var jsforce=require(_0xf297('0xb'));var deskjs=require(_0xf297('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf297('0xd'));var Papa=require(_0xf297('0xe'));var Redis=require('ioredis');var authService=require(_0xf297('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf297('0x10'));var hardwareService=require(_0xf297('0x11'));var logger=require(_0xf297('0x12'))('api');var utils=require(_0xf297('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf297('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5534f1,_0x395101){_0x395101=_0x395101||0xcc;return function(_0x3554b1){if(_0x3554b1){return _0x5534f1[_0xf297('0x15')](_0x395101);}return _0x5534f1[_0xf297('0x16')](_0x395101)[_0xf297('0x17')]();};}function respondWithResult(_0x3b7941,_0x5c5e7c){_0x5c5e7c=_0x5c5e7c||0xc8;return function(_0xb7647b){if(_0xb7647b){return _0x3b7941[_0xf297('0x16')](_0x5c5e7c)['json'](_0xb7647b);}};}function respondWithFilteredResult(_0x42fd50,_0x5eed15){return function(_0x2dd842){if(_0x2dd842){var _0x12c499=typeof _0x5eed15[_0xf297('0x18')]==='undefined'&&typeof _0x5eed15['limit']===_0xf297('0x19');var _0x1e2a77=_0x2dd842['count'];var _0x47d584=_0x12c499?0x0:_0x5eed15[_0xf297('0x18')];var _0x1932df=_0x12c499?_0x2dd842['count']:_0x5eed15[_0xf297('0x18')]+_0x5eed15[_0xf297('0x1a')];var _0x3ccb7;if(_0x1932df>=_0x1e2a77){_0x1932df=_0x1e2a77;_0x3ccb7=0xc8;}else{_0x3ccb7=0xce;}_0x42fd50['status'](_0x3ccb7);return _0x42fd50[_0xf297('0x1b')](_0xf297('0x1c'),_0x47d584+'-'+_0x1932df+'/'+_0x1e2a77)[_0xf297('0x1d')](_0x2dd842);}return null;};}function patchUpdates(_0x556c15){return function(_0x5f96ba){try{jsonpatch[_0xf297('0x1e')](_0x5f96ba,_0x556c15,!![]);}catch(_0x13ec1d){return BPromise['reject'](_0x13ec1d);}return _0x5f96ba[_0xf297('0x1f')]();};}function saveUpdates(_0x10830f,_0x4023a3){return function(_0x4cf7f7){if(_0x4cf7f7){return _0x4cf7f7[_0xf297('0x20')](_0x10830f)[_0xf297('0x21')](function(_0x6721c2){return _0x6721c2;});}return null;};}function removeEntity(_0x18d62b,_0x5335ca){return function(_0x27265c){if(_0x27265c){return _0x27265c['destroy']()[_0xf297('0x21')](function(){var _0x2ad8fe=_0x27265c[_0xf297('0x22')]({'plain':!![]});var _0x3064dc=_0xf297('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x3064dc,'resourceId':_0x2ad8fe['id']}})[_0xf297('0x21')](function(){return _0x27265c;});})[_0xf297('0x21')](function(){_0x18d62b[_0xf297('0x16')](0xcc)[_0xf297('0x17')]();});}};}function handleEntityNotFound(_0x1b9bcd,_0x456573){return function(_0x55db2a){if(!_0x55db2a){_0x1b9bcd[_0xf297('0x15')](0x194);}return _0x55db2a;};}function handleError(_0x5cf2c9,_0x572c86){_0x572c86=_0x572c86||0x1f4;return function(_0x58f5f3){logger[_0xf297('0x24')](_0x58f5f3[_0xf297('0x25')]);if(_0x58f5f3[_0xf297('0x26')]){delete _0x58f5f3[_0xf297('0x26')];}_0x5cf2c9[_0xf297('0x16')](_0x572c86)['send'](_0x58f5f3);};}exports[_0xf297('0x27')]=function(_0x1f0eef,_0x566743){var _0x41a427={},_0x38a4f6={},_0x47044f={'count':0x0,'rows':[]};var _0x4e7c69=_[_0xf297('0x28')](db[_0xf297('0x29')][_0xf297('0x2a')],function(_0x4d320b){return{'name':_0x4d320b[_0xf297('0x2b')],'type':_0x4d320b[_0xf297('0x2c')]['key']};});_0x38a4f6[_0xf297('0x2d')]=_[_0xf297('0x28')](_0x4e7c69,_0xf297('0x26'));_0x38a4f6[_0xf297('0x2e')]=_[_0xf297('0x2f')](_0x1f0eef[_0xf297('0x2e')]);_0x38a4f6['filters']=_[_0xf297('0x30')](_0x38a4f6[_0xf297('0x2d')],_0x38a4f6['query']);_0x41a427[_0xf297('0x31')]=_[_0xf297('0x30')](_0x38a4f6[_0xf297('0x2d')],qs[_0xf297('0x32')](_0x1f0eef['query'][_0xf297('0x32')]));_0x41a427[_0xf297('0x31')]=_0x41a427[_0xf297('0x31')]['length']?_0x41a427[_0xf297('0x31')]:_0x38a4f6[_0xf297('0x2d')];if(!_0x1f0eef[_0xf297('0x2e')][_0xf297('0x33')](_0xf297('0x34'))){_0x41a427[_0xf297('0x1a')]=qs[_0xf297('0x1a')](_0x1f0eef[_0xf297('0x2e')]['limit']);_0x41a427[_0xf297('0x18')]=qs[_0xf297('0x18')](_0x1f0eef[_0xf297('0x2e')][_0xf297('0x18')]);}_0x41a427[_0xf297('0x35')]=qs[_0xf297('0x36')](_0x1f0eef[_0xf297('0x2e')][_0xf297('0x36')]);_0x41a427[_0xf297('0x37')]=qs[_0xf297('0x38')](_[_0xf297('0x39')](_0x1f0eef[_0xf297('0x2e')],_0x38a4f6[_0xf297('0x38')]),_0x4e7c69);if(_0x1f0eef[_0xf297('0x2e')][_0xf297('0x3a')]){_0x41a427['where']=_[_0xf297('0x3b')](_0x41a427[_0xf297('0x37')],{'$or':_['map'](_0x4e7c69,function(_0x3bb0a7){if(_0x3bb0a7[_0xf297('0x2c')]!==_0xf297('0x3c')){var _0x2106d4={};_0x2106d4[_0x3bb0a7[_0xf297('0x26')]]={'$like':'%'+_0x1f0eef[_0xf297('0x2e')]['filter']+'%'};return _0x2106d4;}})});}_0x41a427=_['merge']({},_0x41a427,_0x1f0eef[_0xf297('0x3d')]);var _0x1d8f65={'where':_0x41a427[_0xf297('0x37')]};return db[_0xf297('0x29')][_0xf297('0x3e')](_0x1d8f65)['then'](function(_0x53be11){_0x47044f['count']=_0x53be11;if(_0x1f0eef[_0xf297('0x2e')][_0xf297('0x3f')]){_0x41a427['include']=[{'all':!![]}];}return db[_0xf297('0x29')]['findAll'](_0x41a427);})[_0xf297('0x21')](function(_0x1503cd){_0x47044f[_0xf297('0x40')]=_0x1503cd;return _0x47044f;})['then'](respondWithFilteredResult(_0x566743,_0x41a427))[_0xf297('0x41')](handleError(_0x566743,null));};exports[_0xf297('0x42')]=function(_0x124c53,_0x41ddb8){var _0x294650={'raw':!![],'where':{'id':_0x124c53['params']['id']}},_0x3817de={};_0x3817de[_0xf297('0x2d')]=_[_0xf297('0x2f')](db[_0xf297('0x29')]['rawAttributes']);_0x3817de['query']=_[_0xf297('0x2f')](_0x124c53['query']);_0x3817de[_0xf297('0x38')]=_[_0xf297('0x30')](_0x3817de[_0xf297('0x2d')],_0x3817de['query']);_0x294650['attributes']=_['intersection'](_0x3817de[_0xf297('0x2d')],qs[_0xf297('0x32')](_0x124c53['query'][_0xf297('0x32')]));_0x294650['attributes']=_0x294650[_0xf297('0x31')]['length']?_0x294650[_0xf297('0x31')]:_0x3817de['model'];if(_0x124c53[_0xf297('0x2e')]['includeAll']){_0x294650[_0xf297('0x43')]=[{'all':!![]}];}_0x294650=_[_0xf297('0x3b')]({},_0x294650,_0x124c53['options']);return db['Variable']['find'](_0x294650)[_0xf297('0x21')](handleEntityNotFound(_0x41ddb8,null))[_0xf297('0x21')](respondWithResult(_0x41ddb8,null))[_0xf297('0x41')](handleError(_0x41ddb8,null));};exports[_0xf297('0x44')]=function(_0x528887,_0x4d1215){return db[_0xf297('0x29')][_0xf297('0x44')](_0x528887[_0xf297('0x45')],{})[_0xf297('0x21')](function(_0xe72d68){var _0x545e19=_0x528887[_0xf297('0x46')][_0xf297('0x22')]({'plain':!![]});if(!_0x545e19)throw new Error(_0xf297('0x47'));if(_0x545e19[_0xf297('0x48')]==='user'){var _0x23efc6=_0xe72d68[_0xf297('0x22')]({'plain':!![]});var _0x18c01b='Variables';return db[_0xf297('0x49')][_0xf297('0x4a')]({'where':{'name':_0x18c01b,'userProfileId':_0x545e19[_0xf297('0x4b')]},'raw':!![]})[_0xf297('0x21')](function(_0x41f400){if(_0x41f400&&_0x41f400[_0xf297('0x4c')]===0x0){return db[_0xf297('0x4d')][_0xf297('0x44')]({'name':_0x23efc6[_0xf297('0x26')],'resourceId':_0x23efc6['id'],'type':_0x41f400['name'],'sectionId':_0x41f400['id']},{})['then'](function(){return _0xe72d68;});}else{return _0xe72d68;}})[_0xf297('0x41')](function(_0xaf4b7){logger[_0xf297('0x24')](_0xf297('0x4e'),_0xaf4b7);throw _0xaf4b7;});}return _0xe72d68;})[_0xf297('0x21')](respondWithResult(_0x4d1215,0xc9))[_0xf297('0x41')](handleError(_0x4d1215,null));};exports[_0xf297('0x20')]=function(_0xa233ab,_0x3416ff){if(_0xa233ab['body']['id']){delete _0xa233ab[_0xf297('0x45')]['id'];}return db[_0xf297('0x29')][_0xf297('0x4a')]({'where':{'id':_0xa233ab[_0xf297('0x4f')]['id']}})[_0xf297('0x21')](handleEntityNotFound(_0x3416ff,null))[_0xf297('0x21')](saveUpdates(_0xa233ab[_0xf297('0x45')],null))['then'](respondWithResult(_0x3416ff,null))[_0xf297('0x41')](handleError(_0x3416ff,null));};exports[_0xf297('0x50')]=function(_0x56a6f3,_0x5d54c9){return db[_0xf297('0x29')][_0xf297('0x4a')]({'where':{'id':_0x56a6f3[_0xf297('0x4f')]['id']}})[_0xf297('0x21')](handleEntityNotFound(_0x5d54c9,null))[_0xf297('0x21')](removeEntity(_0x5d54c9,null))[_0xf297('0x41')](handleError(_0x5d54c9,null));}; \ No newline at end of file +var _0x1fa9=['../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','Variables','UserProfileResource','end','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','pick','where','merge','map','VIRTUAL','filter','options','Variable','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2dba68,_0xb7d48){var _0x3a12a7=function(_0x14cef4){while(--_0x14cef4){_0x2dba68['push'](_0x2dba68['shift']());}};_0x3a12a7(++_0xb7d48);}(_0x1fa9,0x136));var _0x91fa=function(_0x56a497,_0x3c3b9f){_0x56a497=_0x56a497-0x0;var _0x2d134b=_0x1fa9[_0x56a497];return _0x2d134b;};'use strict';var emlformat=require(_0x91fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91fa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x91fa('0x2'));var moment=require(_0x91fa('0x3'));var BPromise=require(_0x91fa('0x4'));var Mustache=require('mustache');var util=require(_0x91fa('0x5'));var path=require(_0x91fa('0x6'));var sox=require(_0x91fa('0x7'));var csv=require(_0x91fa('0x8'));var ejs=require(_0x91fa('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x91fa('0xa'));var squel=require(_0x91fa('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x91fa('0xc'));var toCsv=require(_0x91fa('0x8'));var querystring=require(_0x91fa('0xd'));var Papa=require(_0x91fa('0xe'));var Redis=require(_0x91fa('0xf'));var authService=require(_0x91fa('0x10'));var qs=require(_0x91fa('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x91fa('0x12'))(_0x91fa('0x13'));var utils=require(_0x91fa('0x14'));var config=require(_0x91fa('0x15'));var licenseUtil=require(_0x91fa('0x16'));var db=require(_0x91fa('0x17'))['db'];function respondWithStatusCode(_0x1bdb51,_0x578035){_0x578035=_0x578035||0xcc;return function(_0x5a904d){if(_0x5a904d){return _0x1bdb51['sendStatus'](_0x578035);}return _0x1bdb51[_0x91fa('0x18')](_0x578035)['end']();};}function respondWithResult(_0x5f215d,_0x4d95f5){_0x4d95f5=_0x4d95f5||0xc8;return function(_0x4650bf){if(_0x4650bf){return _0x5f215d[_0x91fa('0x18')](_0x4d95f5)['json'](_0x4650bf);}};}function respondWithFilteredResult(_0x308812,_0x252ec7){return function(_0x74c75d){if(_0x74c75d){var _0x2667da=typeof _0x252ec7[_0x91fa('0x19')]===_0x91fa('0x1a')&&typeof _0x252ec7['limit']===_0x91fa('0x1a');var _0x17c4d4=_0x74c75d[_0x91fa('0x1b')];var _0x3916cc=_0x2667da?0x0:_0x252ec7[_0x91fa('0x19')];var _0x4dcbcf=_0x2667da?_0x74c75d[_0x91fa('0x1b')]:_0x252ec7[_0x91fa('0x19')]+_0x252ec7[_0x91fa('0x1c')];var _0x1e3d6f;if(_0x4dcbcf>=_0x17c4d4){_0x4dcbcf=_0x17c4d4;_0x1e3d6f=0xc8;}else{_0x1e3d6f=0xce;}_0x308812[_0x91fa('0x18')](_0x1e3d6f);return _0x308812[_0x91fa('0x1d')](_0x91fa('0x1e'),_0x3916cc+'-'+_0x4dcbcf+'/'+_0x17c4d4)[_0x91fa('0x1f')](_0x74c75d);}return null;};}function patchUpdates(_0xba1e97){return function(_0x274d6f){try{jsonpatch[_0x91fa('0x20')](_0x274d6f,_0xba1e97,!![]);}catch(_0x4a8f08){return BPromise[_0x91fa('0x21')](_0x4a8f08);}return _0x274d6f[_0x91fa('0x22')]();};}function saveUpdates(_0x4ac68d,_0x1a6480){return function(_0x50596c){if(_0x50596c){return _0x50596c[_0x91fa('0x23')](_0x4ac68d)['then'](function(_0x4e619c){return _0x4e619c;});}return null;};}function removeEntity(_0x5d89f9,_0x2ed86d){return function(_0x6d4e53){if(_0x6d4e53){return _0x6d4e53[_0x91fa('0x24')]()[_0x91fa('0x25')](function(){var _0x1fd482=_0x6d4e53['get']({'plain':!![]});var _0x3048c4=_0x91fa('0x26');return db[_0x91fa('0x27')][_0x91fa('0x24')]({'where':{'type':_0x3048c4,'resourceId':_0x1fd482['id']}})['then'](function(){return _0x6d4e53;});})['then'](function(){_0x5d89f9[_0x91fa('0x18')](0xcc)[_0x91fa('0x28')]();});}};}function handleEntityNotFound(_0x26a9b3,_0x44af0b){return function(_0x1224ef){if(!_0x1224ef){_0x26a9b3['sendStatus'](0x194);}return _0x1224ef;};}function handleError(_0x1c2a60,_0x404bbc){_0x404bbc=_0x404bbc||0x1f4;return function(_0x402884){logger['error'](_0x402884['stack']);if(_0x402884[_0x91fa('0x29')]){delete _0x402884[_0x91fa('0x29')];}_0x1c2a60[_0x91fa('0x18')](_0x404bbc)[_0x91fa('0x2a')](_0x402884);};}exports[_0x91fa('0x2b')]=function(_0x17bba2,_0x27ed0e){var _0x33198a={},_0x455e8c={},_0x1ebc7c={'count':0x0,'rows':[]};var _0x115b09=_['map'](db['Variable'][_0x91fa('0x2c')],function(_0x242640){return{'name':_0x242640[_0x91fa('0x2d')],'type':_0x242640[_0x91fa('0x2e')][_0x91fa('0x2f')]};});_0x455e8c[_0x91fa('0x30')]=_['map'](_0x115b09,_0x91fa('0x29'));_0x455e8c[_0x91fa('0x31')]=_[_0x91fa('0x32')](_0x17bba2[_0x91fa('0x31')]);_0x455e8c[_0x91fa('0x33')]=_[_0x91fa('0x34')](_0x455e8c[_0x91fa('0x30')],_0x455e8c[_0x91fa('0x31')]);_0x33198a['attributes']=_['intersection'](_0x455e8c[_0x91fa('0x30')],qs[_0x91fa('0x35')](_0x17bba2['query'][_0x91fa('0x35')]));_0x33198a['attributes']=_0x33198a['attributes'][_0x91fa('0x36')]?_0x33198a[_0x91fa('0x37')]:_0x455e8c[_0x91fa('0x30')];if(!_0x17bba2['query'][_0x91fa('0x38')](_0x91fa('0x39'))){_0x33198a[_0x91fa('0x1c')]=qs[_0x91fa('0x1c')](_0x17bba2[_0x91fa('0x31')][_0x91fa('0x1c')]);_0x33198a[_0x91fa('0x19')]=qs['offset'](_0x17bba2[_0x91fa('0x31')][_0x91fa('0x19')]);}_0x33198a['order']=qs['sort'](_0x17bba2[_0x91fa('0x31')][_0x91fa('0x3a')]);_0x33198a['where']=qs[_0x91fa('0x33')](_[_0x91fa('0x3b')](_0x17bba2['query'],_0x455e8c[_0x91fa('0x33')]),_0x115b09);if(_0x17bba2['query']['filter']){_0x33198a[_0x91fa('0x3c')]=_[_0x91fa('0x3d')](_0x33198a['where'],{'$or':_[_0x91fa('0x3e')](_0x115b09,function(_0x60465f){if(_0x60465f['type']!==_0x91fa('0x3f')){var _0x501e3c={};_0x501e3c[_0x60465f[_0x91fa('0x29')]]={'$like':'%'+_0x17bba2['query'][_0x91fa('0x40')]+'%'};return _0x501e3c;}})});}_0x33198a=_['merge']({},_0x33198a,_0x17bba2[_0x91fa('0x41')]);var _0x988e5={'where':_0x33198a[_0x91fa('0x3c')]};return db[_0x91fa('0x42')]['count'](_0x988e5)[_0x91fa('0x25')](function(_0x337c8b){_0x1ebc7c[_0x91fa('0x1b')]=_0x337c8b;if(_0x17bba2[_0x91fa('0x31')][_0x91fa('0x43')]){_0x33198a[_0x91fa('0x44')]=[{'all':!![]}];}return db['Variable'][_0x91fa('0x45')](_0x33198a);})['then'](function(_0x4cdd67){_0x1ebc7c[_0x91fa('0x46')]=_0x4cdd67;return _0x1ebc7c;})[_0x91fa('0x25')](respondWithFilteredResult(_0x27ed0e,_0x33198a))[_0x91fa('0x47')](handleError(_0x27ed0e,null));};exports[_0x91fa('0x48')]=function(_0x3ec29e,_0x897db7){var _0x414259={'raw':!![],'where':{'id':_0x3ec29e[_0x91fa('0x49')]['id']}},_0x5d01d2={};_0x5d01d2['model']=_[_0x91fa('0x32')](db[_0x91fa('0x42')][_0x91fa('0x2c')]);_0x5d01d2[_0x91fa('0x31')]=_[_0x91fa('0x32')](_0x3ec29e[_0x91fa('0x31')]);_0x5d01d2[_0x91fa('0x33')]=_[_0x91fa('0x34')](_0x5d01d2[_0x91fa('0x30')],_0x5d01d2[_0x91fa('0x31')]);_0x414259[_0x91fa('0x37')]=_[_0x91fa('0x34')](_0x5d01d2[_0x91fa('0x30')],qs[_0x91fa('0x35')](_0x3ec29e[_0x91fa('0x31')]['fields']));_0x414259[_0x91fa('0x37')]=_0x414259[_0x91fa('0x37')][_0x91fa('0x36')]?_0x414259[_0x91fa('0x37')]:_0x5d01d2[_0x91fa('0x30')];if(_0x3ec29e[_0x91fa('0x31')][_0x91fa('0x43')]){_0x414259[_0x91fa('0x44')]=[{'all':!![]}];}_0x414259=_[_0x91fa('0x3d')]({},_0x414259,_0x3ec29e[_0x91fa('0x41')]);return db[_0x91fa('0x42')][_0x91fa('0x4a')](_0x414259)[_0x91fa('0x25')](handleEntityNotFound(_0x897db7,null))['then'](respondWithResult(_0x897db7,null))[_0x91fa('0x47')](handleError(_0x897db7,null));};exports[_0x91fa('0x4b')]=function(_0x27645d,_0x3f8ad7){return db[_0x91fa('0x42')]['create'](_0x27645d[_0x91fa('0x4c')],{})['then'](function(_0x3aac77){var _0x389ea9=_0x27645d[_0x91fa('0x4d')][_0x91fa('0x4e')]({'plain':!![]});if(!_0x389ea9)throw new Error(_0x91fa('0x4f'));if(_0x389ea9[_0x91fa('0x50')]===_0x91fa('0x4d')){var _0x6c02b9=_0x3aac77[_0x91fa('0x4e')]({'plain':!![]});var _0xed80bb=_0x91fa('0x26');return db['UserProfileSection'][_0x91fa('0x4a')]({'where':{'name':_0xed80bb,'userProfileId':_0x389ea9['userProfileId']},'raw':!![]})['then'](function(_0x5c9949){if(_0x5c9949&&_0x5c9949['autoAssociation']===0x0){return db['UserProfileResource'][_0x91fa('0x4b')]({'name':_0x6c02b9[_0x91fa('0x29')],'resourceId':_0x6c02b9['id'],'type':_0x5c9949[_0x91fa('0x29')],'sectionId':_0x5c9949['id']},{})[_0x91fa('0x25')](function(){return _0x3aac77;});}else{return _0x3aac77;}})[_0x91fa('0x47')](function(_0x6c76db){logger[_0x91fa('0x51')](_0x91fa('0x52'),_0x6c76db);throw _0x6c76db;});}return _0x3aac77;})['then'](respondWithResult(_0x3f8ad7,0xc9))['catch'](handleError(_0x3f8ad7,null));};exports['update']=function(_0x1ad7f9,_0x3797e4){if(_0x1ad7f9['body']['id']){delete _0x1ad7f9[_0x91fa('0x4c')]['id'];}return db[_0x91fa('0x42')][_0x91fa('0x4a')]({'where':{'id':_0x1ad7f9['params']['id']}})[_0x91fa('0x25')](handleEntityNotFound(_0x3797e4,null))['then'](saveUpdates(_0x1ad7f9[_0x91fa('0x4c')],null))[_0x91fa('0x25')](respondWithResult(_0x3797e4,null))[_0x91fa('0x47')](handleError(_0x3797e4,null));};exports[_0x91fa('0x24')]=function(_0x439b4b,_0x38121e){return db['Variable']['find']({'where':{'id':_0x439b4b[_0x91fa('0x49')]['id']}})[_0x91fa('0x25')](handleEntityNotFound(_0x38121e,null))[_0x91fa('0x25')](removeEntity(_0x38121e,null))[_0x91fa('0x47')](handleError(_0x38121e,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 4f110a6..5d889ee 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 _0xfa20=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','Variable','tools_variables','lodash','util','../../config/logger','api'];(function(_0xc94ae4,_0x32d2aa){var _0x547636=function(_0x1fe9e9){while(--_0x1fe9e9){_0xc94ae4['push'](_0xc94ae4['shift']());}};_0x547636(++_0x32d2aa);}(_0xfa20,0x141));var _0x0fa2=function(_0x3590a4,_0x2eea94){_0x3590a4=_0x3590a4-0x0;var _0x17a579=_0xfa20[_0x3590a4];return _0x17a579;};'use strict';var _=require(_0x0fa2('0x0'));var util=require(_0x0fa2('0x1'));var logger=require(_0x0fa2('0x2'))(_0x0fa2('0x3'));var moment=require(_0x0fa2('0x4'));var BPromise=require(_0x0fa2('0x5'));var rp=require(_0x0fa2('0x6'));var fs=require('fs');var path=require(_0x0fa2('0x7'));var rimraf=require(_0x0fa2('0x8'));var config=require(_0x0fa2('0x9'));var attributes=require(_0x0fa2('0xa'));module['exports']=function(_0x19387c,_0x2247e9){return _0x19387c['define'](_0x0fa2('0xb'),attributes,{'tableName':_0x0fa2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe205=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./variable.attributes','exports','tools_variables','lodash'];(function(_0x34421e,_0xf309a2){var _0x5725d7=function(_0x367fbf){while(--_0x367fbf){_0x34421e['push'](_0x34421e['shift']());}};_0x5725d7(++_0xf309a2);}(_0xe205,0xa7));var _0x5e20=function(_0x193d09,_0x129093){_0x193d09=_0x193d09-0x0;var _0x39c4ec=_0xe205[_0x193d09];return _0x39c4ec;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var logger=require(_0x5e20('0x2'))(_0x5e20('0x3'));var moment=require(_0x5e20('0x4'));var BPromise=require(_0x5e20('0x5'));var rp=require(_0x5e20('0x6'));var fs=require('fs');var path=require(_0x5e20('0x7'));var rimraf=require(_0x5e20('0x8'));var config=require('../../config/environment');var attributes=require(_0x5e20('0x9'));module[_0x5e20('0xa')]=function(_0x44dbb3,_0x3c4203){return _0x44dbb3['define']('Variable',attributes,{'tableName':_0x5e20('0xb'),'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 61ab689..135fb0c 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 _0x071a=['ShowVariable','Variable','find','options','raw','where','include','map','model','attributes','debug','stringify','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','code','Variable,\x20%s,\x20%s','message','result','catch'];(function(_0x5096d7,_0x41e360){var _0x454438=function(_0x3f9a7d){while(--_0x3f9a7d){_0x5096d7['push'](_0x5096d7['shift']());}};_0x454438(++_0x41e360);}(_0x071a,0xc0));var _0xa071=function(_0x3b0515,_0x1fa41d){_0x3b0515=_0x3b0515-0x0;var _0x198d7a=_0x071a[_0x3b0515];return _0x198d7a;};'use strict';var _=require(_0xa071('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa071('0x1'));var fs=require('fs');var Redis=require(_0xa071('0x2'));var db=require(_0xa071('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa071('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa071('0x5'));var client=jayson[_0xa071('0x6')][_0xa071('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3f9f7d,_0x267d34,_0x3d5d6b){return new BPromise(function(_0x10302c,_0xc6c2be){return client[_0xa071('0x8')](_0x3f9f7d,_0x3d5d6b)['then'](function(_0x223595){logger[_0xa071('0x9')]('Variable,\x20%s,\x20%s',_0x267d34,_0xa071('0xa'));logger['debug'](_0xa071('0xb'),_0x267d34,_0xa071('0xa'),JSON['stringify'](_0x223595));if(_0x223595[_0xa071('0xc')]){if(_0x223595[_0xa071('0xc')][_0xa071('0xd')]===0x1f4){logger[_0xa071('0xc')](_0xa071('0xe'),_0x267d34,_0x223595['error'][_0xa071('0xf')]);return _0xc6c2be(_0x223595['error'][_0xa071('0xf')]);}logger[_0xa071('0xc')]('Variable,\x20%s,\x20%s',_0x267d34,_0x223595[_0xa071('0xc')][_0xa071('0xf')]);return _0x10302c(_0x223595['error'][_0xa071('0xf')]);}else{logger[_0xa071('0x9')](_0xa071('0xe'),_0x267d34,_0xa071('0xa'));_0x10302c(_0x223595[_0xa071('0x10')]['message']);}})[_0xa071('0x11')](function(_0xd0dcad){logger['error'](_0xa071('0xe'),_0x267d34,_0xd0dcad);_0xc6c2be(_0xd0dcad);});});}exports[_0xa071('0x12')]=function(_0x399f08){var _0x4f4799=this;return new Promise(function(_0x3161fd,_0xef5bdf){return db[_0xa071('0x13')][_0xa071('0x14')]({'raw':_0x399f08[_0xa071('0x15')]?_0x399f08['options'][_0xa071('0x16')]===undefined?!![]:![]:!![],'where':_0x399f08[_0xa071('0x15')]?_0x399f08[_0xa071('0x15')][_0xa071('0x17')]||null:null,'attributes':_0x399f08[_0xa071('0x15')]?_0x399f08['options']['attributes']||null:null,'include':_0x399f08[_0xa071('0x15')]?_0x399f08[_0xa071('0x15')][_0xa071('0x18')]?_[_0xa071('0x19')](_0x399f08[_0xa071('0x15')]['include'],function(_0x4ce5e5){return{'model':db[_0x4ce5e5[_0xa071('0x1a')]],'as':_0x4ce5e5['as'],'attributes':_0x4ce5e5[_0xa071('0x1b')],'include':_0x4ce5e5[_0xa071('0x18')]?_[_0xa071('0x19')](_0x4ce5e5[_0xa071('0x18')],function(_0x152f5a){return{'model':db[_0x152f5a[_0xa071('0x1a')]],'as':_0x152f5a['as'],'attributes':_0x152f5a[_0xa071('0x1b')],'include':_0x152f5a[_0xa071('0x18')]?_[_0xa071('0x19')](_0x152f5a[_0xa071('0x18')],function(_0x2f1865){return{'model':db[_0x2f1865[_0xa071('0x1a')]],'as':_0x2f1865['as'],'attributes':_0x2f1865[_0xa071('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x321aad){logger['info'](_0xa071('0x12'),_0x399f08);logger[_0xa071('0x1c')]('ShowVariable',_0x399f08,JSON[_0xa071('0x1d')](_0x321aad));_0x3161fd(_0x321aad);})[_0xa071('0x11')](function(_0xdd5b55){logger[_0xa071('0xc')]('ShowVariable',_0xdd5b55[_0xa071('0xf')],_0x399f08);_0xef5bdf(_0x4f4799[_0xa071('0xc')](0x1f4,_0xdd5b55['message']));});});}; \ No newline at end of file +var _0xd913=['then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','code','error','message','ShowVariable','Variable','options','where','attributes','include','model','map','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0xd7e544,_0x4811bf){var _0x3dbcf7=function(_0x1641e0){while(--_0x1641e0){_0xd7e544['push'](_0xd7e544['shift']());}};_0x3dbcf7(++_0x4811bf);}(_0xd913,0x6c));var _0x3d91=function(_0x4566db,_0x5da9a1){_0x4566db=_0x4566db-0x0;var _0x3167e6=_0xd913[_0x4566db];return _0x3167e6;};'use strict';var _=require('lodash');var util=require(_0x3d91('0x0'));var moment=require(_0x3d91('0x1'));var BPromise=require(_0x3d91('0x2'));var rs=require(_0x3d91('0x3'));var fs=require('fs');var Redis=require(_0x3d91('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d91('0x5'));var logger=require(_0x3d91('0x6'))('rpc');var config=require(_0x3d91('0x7'));var jayson=require(_0x3d91('0x8'));var client=jayson[_0x3d91('0x9')][_0x3d91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ae971,_0x40ef0d,_0x31b89c){return new BPromise(function(_0x2cda66,_0x4d06dc){return client[_0x3d91('0xb')](_0x3ae971,_0x31b89c)[_0x3d91('0xc')](function(_0x58137b){logger[_0x3d91('0xd')](_0x3d91('0xe'),_0x40ef0d,_0x3d91('0xf'));logger[_0x3d91('0x10')](_0x3d91('0x11'),_0x40ef0d,'request\x20sent',JSON['stringify'](_0x58137b));if(_0x58137b['error']){if(_0x58137b['error'][_0x3d91('0x12')]===0x1f4){logger[_0x3d91('0x13')](_0x3d91('0xe'),_0x40ef0d,_0x58137b[_0x3d91('0x13')][_0x3d91('0x14')]);return _0x4d06dc(_0x58137b['error']['message']);}logger['error']('Variable,\x20%s,\x20%s',_0x40ef0d,_0x58137b[_0x3d91('0x13')][_0x3d91('0x14')]);return _0x2cda66(_0x58137b[_0x3d91('0x13')][_0x3d91('0x14')]);}else{logger[_0x3d91('0xd')](_0x3d91('0xe'),_0x40ef0d,'request\x20sent');_0x2cda66(_0x58137b['result'][_0x3d91('0x14')]);}})['catch'](function(_0x510c4c){logger[_0x3d91('0x13')](_0x3d91('0xe'),_0x40ef0d,_0x510c4c);_0x4d06dc(_0x510c4c);});});}exports[_0x3d91('0x15')]=function(_0x4aca66){var _0x53e9c0=this;return new Promise(function(_0x36fbd0,_0xa1c13e){return db[_0x3d91('0x16')]['find']({'raw':_0x4aca66[_0x3d91('0x17')]?_0x4aca66[_0x3d91('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4aca66[_0x3d91('0x17')]?_0x4aca66[_0x3d91('0x17')][_0x3d91('0x18')]||null:null,'attributes':_0x4aca66[_0x3d91('0x17')]?_0x4aca66[_0x3d91('0x17')][_0x3d91('0x19')]||null:null,'include':_0x4aca66[_0x3d91('0x17')]?_0x4aca66[_0x3d91('0x17')][_0x3d91('0x1a')]?_['map'](_0x4aca66[_0x3d91('0x17')][_0x3d91('0x1a')],function(_0x5f56de){return{'model':db[_0x5f56de[_0x3d91('0x1b')]],'as':_0x5f56de['as'],'attributes':_0x5f56de[_0x3d91('0x19')],'include':_0x5f56de['include']?_[_0x3d91('0x1c')](_0x5f56de[_0x3d91('0x1a')],function(_0xfed527){return{'model':db[_0xfed527[_0x3d91('0x1b')]],'as':_0xfed527['as'],'attributes':_0xfed527[_0x3d91('0x19')],'include':_0xfed527[_0x3d91('0x1a')]?_[_0x3d91('0x1c')](_0xfed527[_0x3d91('0x1a')],function(_0x22e8c9){return{'model':db[_0x22e8c9[_0x3d91('0x1b')]],'as':_0x22e8c9['as'],'attributes':_0x22e8c9[_0x3d91('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3d91('0xc')](function(_0x35effc){logger['info'](_0x3d91('0x15'),_0x4aca66);logger[_0x3d91('0x10')](_0x3d91('0x15'),_0x4aca66,JSON['stringify'](_0x35effc));_0x36fbd0(_0x35effc);})[_0x3d91('0x1d')](function(_0x6d8299){logger[_0x3d91('0x13')]('ShowVariable',_0x6d8299['message'],_0x4aca66);_0xa1c13e(_0x53e9c0['error'](0x1f4,_0x6d8299[_0x3d91('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index ab1d9e5..666f10c 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 _0xcae6=['/migrations','migrations','exports','express','Router','./version.controller','/fetch','isAuthenticated','canUpdate','fetch','get','/reset','reset','/pull','pull','/restart','restart'];(function(_0x38b6fc,_0x59aaeb){var _0x11780b=function(_0x3e9c86){while(--_0x3e9c86){_0x38b6fc['push'](_0x38b6fc['shift']());}};_0x11780b(++_0x59aaeb);}(_0xcae6,0x146));var _0x6cae=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0xcae6[_0x487496];return _0x539dc8;};'use strict';var express=require(_0x6cae('0x0'));var router=express[_0x6cae('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x6cae('0x2'));router['get']('/',controller['index']);router['get'](_0x6cae('0x3'),auth[_0x6cae('0x4')](),auth[_0x6cae('0x5')](),controller[_0x6cae('0x6')]);router[_0x6cae('0x7')](_0x6cae('0x8'),auth[_0x6cae('0x4')](),auth[_0x6cae('0x5')](),controller[_0x6cae('0x9')]);router[_0x6cae('0x7')](_0x6cae('0xa'),auth[_0x6cae('0x4')](),auth[_0x6cae('0x5')](),controller[_0x6cae('0xb')]);router[_0x6cae('0x7')](_0x6cae('0xc'),auth['isAuthenticated'](),controller[_0x6cae('0xd')]);router[_0x6cae('0x7')](_0x6cae('0xe'),controller[_0x6cae('0xf')]);module[_0x6cae('0x10')]=router; \ No newline at end of file +var _0x455f=['canUpdate','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','fetch','/reset'];(function(_0x1ae04a,_0x18ee45){var _0x126c5e=function(_0x47e070){while(--_0x47e070){_0x1ae04a['push'](_0x1ae04a['shift']());}};_0x126c5e(++_0x18ee45);}(_0x455f,0x118));var _0xf455=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x455f[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xf455('0x0'));var router=express[_0xf455('0x1')]();var auth=require(_0xf455('0x2'));var controller=require(_0xf455('0x3'));router['get']('/',controller['index']);router[_0xf455('0x4')](_0xf455('0x5'),auth[_0xf455('0x6')](),auth['canUpdate'](),controller[_0xf455('0x7')]);router[_0xf455('0x4')](_0xf455('0x8'),auth[_0xf455('0x6')](),auth[_0xf455('0x9')](),controller['reset']);router[_0xf455('0x4')](_0xf455('0xa'),auth[_0xf455('0x6')](),auth[_0xf455('0x9')](),controller[_0xf455('0xb')]);router['get'](_0xf455('0xc'),auth['isAuthenticated'](),controller[_0xf455('0xd')]);router[_0xf455('0x4')](_0xf455('0xe'),controller[_0xf455('0xf')]);module[_0xf455('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index af411ea..7e54bf2 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 _0xb6a6=['git\x20reset\x20--hard\x20FETCH_HEAD','error','restart','then','pm2\x20restart\x20motion\x20%s','readdirSync','join','server','migrations','length','exports','push','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','update','root','index','query','latest','fetch','2.0.0','json','status','origin','master','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','info'];(function(_0x6e803d,_0x2a323b){var _0x40415e=function(_0x162c27){while(--_0x162c27){_0x6e803d['push'](_0x6e803d['shift']());}};_0x40415e(++_0x2a323b);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x19637f,_0x4b2d87){_0x19637f=_0x19637f-0x0;var _0x2fcf0b=_0xb6a6[_0x19637f];return _0x2fcf0b;};'use strict';var Umzug=require(_0x6b6a('0x0'));var path=require(_0x6b6a('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0x6b6a('0x2'));var compareVersions=require(_0x6b6a('0x3'));var exec=require(_0x6b6a('0x4'))[_0x6b6a('0x5')];var db=require(_0x6b6a('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x6b6a('0x7'));var logger=require(_0x6b6a('0x8'))(_0x6b6a('0x9'));var git=require('simple-git')(config[_0x6b6a('0xa')]);exports[_0x6b6a('0xb')]=function(_0x59e90c,_0x43f878){var _0x15ccc9={'current':module['exports'][_0x6b6a('0x2')],'phonebar':0x2};if(_0x59e90c['query']&&_0x59e90c[_0x6b6a('0xc')][_0x6b6a('0xd')]){return git[_0x6b6a('0xe')]()['tags'](function(_0x519b68,_0x1d3ce3){_0x15ccc9[_0x6b6a('0xd')]=(_0x519b68?module['exports']['version']:_0x1d3ce3[_0x6b6a('0xd')])||_0x6b6a('0xf');return _0x43f878['status'](0xc8)[_0x6b6a('0x10')](_0x15ccc9);});}else{return _0x43f878[_0x6b6a('0x11')](0xc8)['json'](_0x15ccc9);}};exports[_0x6b6a('0xe')]=function(_0x3d74e7,_0x57ac41){return git[_0x6b6a('0xe')]([_0x6b6a('0x12'),_0x6b6a('0x13')],function(_0x3739bb){if(_0x3739bb){logger['error'](_0x3739bb);return _0x57ac41[_0x6b6a('0x11')](0x1f4)[_0x6b6a('0x10')](_0x3739bb);}logger['info'](_0x6b6a('0x14'));return _0x57ac41[_0x6b6a('0x11')](0xc8)[_0x6b6a('0x10')]({'output':_0x6b6a('0x15')});});};exports[_0x6b6a('0x16')]=function(_0x4dbcee,_0x36c02e){return git[_0x6b6a('0x16')]([_0x6b6a('0x17'),'FETCH_HEAD'],function(_0x2a577c){if(_0x2a577c){logger['error'](_0x2a577c);return _0x36c02e[_0x6b6a('0x11')](0x1f4)[_0x6b6a('0x10')](_0x2a577c);}logger[_0x6b6a('0x18')](_0x6b6a('0x19'));return _0x36c02e[_0x6b6a('0x11')](0xc8)[_0x6b6a('0x10')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x3a7e48,_0x53bc97){exec('npm\x20install\x20--production',function(_0x1edaf0,_0x4c29eb,_0x7f44b1){logger[_0x6b6a('0x18')](_0x4c29eb);logger[_0x6b6a('0x18')](_0x7f44b1);if(_0x1edaf0){logger[_0x6b6a('0x1a')](_0x1edaf0);return _0x53bc97[_0x6b6a('0x11')](0x1f4)[_0x6b6a('0x10')](_0x1edaf0);}return _0x53bc97[_0x6b6a('0x11')](0xc8)[_0x6b6a('0x10')]({'output':_0x4c29eb});});};exports['restart']=function(_0x565a9c,_0x4d0f5d){return pm2[_0x6b6a('0x1b')]('motion2')[_0x6b6a('0x1c')](function(_0x4c4ca5){logger['info'](_0x6b6a('0x1d'),_0x4c4ca5);return _0x4d0f5d['status'](0xc8)[_0x6b6a('0x10')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x5ce125){logger[_0x6b6a('0x1a')](_0x5ce125);return _0x4d0f5d[_0x6b6a('0x11')](0x1f4)[_0x6b6a('0x10')](_0x5ce125);});};exports['migrations']=function(_0xa6ce4b,_0x5170a5){var _0x12a4d2=fs[_0x6b6a('0x1e')](path[_0x6b6a('0x1f')](config[_0x6b6a('0xa')],_0x6b6a('0x20'),_0x6b6a('0x21')));var _0x56a89e=[];for(var _0x484f6d=0x0;_0x484f6d<_0x12a4d2[_0x6b6a('0x22')];_0x484f6d++){var _0x5edac0=_0x12a4d2[_0x484f6d]['replace']('.js','');if(compareVersions(module[_0x6b6a('0x23')][_0x6b6a('0x2')],_0x5edac0)===-0x1){_0x56a89e[_0x6b6a('0x24')](_0x5edac0);}}if(_0x56a89e[_0x6b6a('0x22')]){var _0x31384d=_0x56a89e[_0x6b6a('0x25')](compareVersions);var _0x274158=new Umzug({'storage':_0x6b6a('0x26'),'storageOptions':{'model':db[_0x6b6a('0x27')],'modelName':_0x6b6a('0x27'),'columnName':_0x6b6a('0x2')},'migrations':{'params':[db[_0x6b6a('0x26')]['getQueryInterface'](),db[_0x6b6a('0x26')][_0x6b6a('0x28')],function(){throw new Error(_0x6b6a('0x29'));}],'path':path[_0x6b6a('0x1f')](config[_0x6b6a('0xa')],_0x6b6a('0x20'),'migrations'),'pattern':/\.js$/}});_0x274158['up']({'migrations':_[_0x6b6a('0x2a')](_0x31384d,function(_0x134c77){return _0x134c77+_0x6b6a('0x2b');})})['then'](function(){return _0x5170a5[_0x6b6a('0x11')](0xc8)[_0x6b6a('0x10')]({'output':_0x6b6a('0x2c')+module[_0x6b6a('0x23')][_0x6b6a('0x2')]+'\x20to\x20'+_[_0x6b6a('0x2d')](_0x31384d),'migrations':_['join'](_0x31384d)});})[_0x6b6a('0x2e')](function(_0x392da1){if(_0x392da1 instanceof db[_0x6b6a('0x26')][_0x6b6a('0x2f')]){return _0x5170a5[_0x6b6a('0x11')](0xc8)[_0x6b6a('0x10')]({'output':_0x6b6a('0x30')});}else{return _0x5170a5[_0x6b6a('0x11')](0x1f4)[_0x6b6a('0x10')](_0x392da1);}});}else{return _0x5170a5['status'](0xc8)[_0x6b6a('0x10')]({'output':_0x6b6a('0x30')});}}; \ No newline at end of file +var _0x6a55=['restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','replace','.js','exports','push','sort','sequelize','Migration','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','version','exec','../../config/environment','../../config/logger','update','simple-git','root','index','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x6a55,0xdb));var _0x56a5=function(_0x1663ae,_0x10484a){_0x1663ae=_0x1663ae-0x0;var _0x30ffb8=_0x6a55[_0x1663ae];return _0x30ffb8;};'use strict';var Umzug=require(_0x56a5('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0x56a5('0x1'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x56a5('0x2')];var db=require('../../mysqldb')['db'];var config=require(_0x56a5('0x3'));var pm2=require('../../config/pm2');var logger=require(_0x56a5('0x4'))(_0x56a5('0x5'));var git=require(_0x56a5('0x6'))(config[_0x56a5('0x7')]);exports[_0x56a5('0x8')]=function(_0x2272d9,_0x2b8f57){var _0x387dcb={'current':module['exports'][_0x56a5('0x1')],'phonebar':0x2};if(_0x2272d9[_0x56a5('0x9')]&&_0x2272d9[_0x56a5('0x9')][_0x56a5('0xa')]){return git[_0x56a5('0xb')]()[_0x56a5('0xc')](function(_0x2ad997,_0x258c20){_0x387dcb[_0x56a5('0xa')]=(_0x2ad997?module['exports']['version']:_0x258c20[_0x56a5('0xa')])||_0x56a5('0xd');return _0x2b8f57[_0x56a5('0xe')](0xc8)[_0x56a5('0xf')](_0x387dcb);});}else{return _0x2b8f57[_0x56a5('0xe')](0xc8)[_0x56a5('0xf')](_0x387dcb);}};exports['fetch']=function(_0x4a6dc5,_0x3e3ff6){return git[_0x56a5('0xb')]([_0x56a5('0x10'),_0x56a5('0x11')],function(_0x310c32){if(_0x310c32){logger[_0x56a5('0x12')](_0x310c32);return _0x3e3ff6[_0x56a5('0xe')](0x1f4)['json'](_0x310c32);}logger[_0x56a5('0x13')]('git\x20fetch');return _0x3e3ff6[_0x56a5('0xe')](0xc8)['json']({'output':_0x56a5('0x14')});});};exports[_0x56a5('0x15')]=function(_0x173c65,_0x28fe74){return git[_0x56a5('0x15')]([_0x56a5('0x16'),_0x56a5('0x17')],function(_0x5d6c25){if(_0x5d6c25){logger[_0x56a5('0x12')](_0x5d6c25);return _0x28fe74[_0x56a5('0xe')](0x1f4)[_0x56a5('0xf')](_0x5d6c25);}logger[_0x56a5('0x13')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x28fe74[_0x56a5('0xe')](0xc8)[_0x56a5('0xf')]({'output':_0x56a5('0x18')});});};exports[_0x56a5('0x19')]=function(_0x155d3b,_0x529711){exec('npm\x20install\x20--production',function(_0x29f181,_0x1c4ab8,_0x487505){logger[_0x56a5('0x13')](_0x1c4ab8);logger[_0x56a5('0x13')](_0x487505);if(_0x29f181){logger[_0x56a5('0x12')](_0x29f181);return _0x529711[_0x56a5('0xe')](0x1f4)[_0x56a5('0xf')](_0x29f181);}return _0x529711[_0x56a5('0xe')](0xc8)[_0x56a5('0xf')]({'output':_0x1c4ab8});});};exports[_0x56a5('0x1a')]=function(_0x2f4514,_0x2035c7){return pm2[_0x56a5('0x1a')](_0x56a5('0x1b'))[_0x56a5('0x1c')](function(_0x4f68b9){logger[_0x56a5('0x13')](_0x56a5('0x1d'),_0x4f68b9);return _0x2035c7[_0x56a5('0xe')](0xc8)[_0x56a5('0xf')]({'output':_0x56a5('0x1e')});})['catch'](function(_0x18e863){logger['error'](_0x18e863);return _0x2035c7[_0x56a5('0xe')](0x1f4)[_0x56a5('0xf')](_0x18e863);});};exports[_0x56a5('0x1f')]=function(_0x284ee5,_0x4e7afd){var _0x3b55e6=fs[_0x56a5('0x20')](path[_0x56a5('0x21')](config['root'],_0x56a5('0x22'),_0x56a5('0x1f')));var _0xeb4378=[];for(var _0x214649=0x0;_0x214649<_0x3b55e6[_0x56a5('0x23')];_0x214649++){var _0x4e1a6b=_0x3b55e6[_0x214649][_0x56a5('0x24')](_0x56a5('0x25'),'');if(compareVersions(module[_0x56a5('0x26')][_0x56a5('0x1')],_0x4e1a6b)===-0x1){_0xeb4378[_0x56a5('0x27')](_0x4e1a6b);}}if(_0xeb4378['length']){var _0x516b38=_0xeb4378[_0x56a5('0x28')](compareVersions);var _0xe17c5e=new Umzug({'storage':_0x56a5('0x29'),'storageOptions':{'model':db['Migration'],'modelName':_0x56a5('0x2a'),'columnName':_0x56a5('0x1')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize']['constructor'],function(){throw new Error(_0x56a5('0x2b'));}],'path':path[_0x56a5('0x21')](config[_0x56a5('0x7')],'server',_0x56a5('0x1f')),'pattern':/\.js$/}});_0xe17c5e['up']({'migrations':_['map'](_0x516b38,function(_0x1f46b9){return _0x1f46b9+_0x56a5('0x25');})})['then'](function(){return _0x4e7afd[_0x56a5('0xe')](0xc8)['json']({'output':_0x56a5('0x2c')+module[_0x56a5('0x26')][_0x56a5('0x1')]+'\x20to\x20'+_[_0x56a5('0x2d')](_0x516b38),'migrations':_[_0x56a5('0x21')](_0x516b38)});})[_0x56a5('0x2e')](function(_0x5de387){if(_0x5de387 instanceof db[_0x56a5('0x29')][_0x56a5('0x2f')]){return _0x4e7afd[_0x56a5('0xe')](0xc8)[_0x56a5('0xf')]({'output':_0x56a5('0x30')});}else{return _0x4e7afd['status'](0x1f4)['json'](_0x5de387);}});}else{return _0x4e7afd[_0x56a5('0xe')](0xc8)[_0x56a5('0xf')]({'output':_0x56a5('0x30')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index f71857d..a4b47ea 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 _0x757a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','isAuthenticated','describe','/:id','post','create','put','update','util','path'];(function(_0x2f2ba2,_0x1fe227){var _0x3e265c=function(_0x40c87d){while(--_0x40c87d){_0x2f2ba2['push'](_0x2f2ba2['shift']());}};_0x3e265c(++_0x1fe227);}(_0x757a,0xde));var _0xa757=function(_0x2e4afb,_0x515a54){_0x2e4afb=_0x2e4afb-0x0;var _0x5f0ed0=_0x757a[_0x2e4afb];return _0x5f0ed0;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/describe',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['show']);router[_0xa757('0xc')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0xe')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller[_0xa757('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0b0e=['get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x4aab6f,_0x2894a9){var _0x1b8106=function(_0xefd254){while(--_0xefd254){_0x4aab6f['push'](_0x4aab6f['shift']());}};_0x1b8106(++_0x2894a9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x548503,_0x1aa00c){_0x548503=_0x548503-0x0;var _0xf8f05f=_0x0b0e[_0x548503];return _0xf8f05f;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0xe')]('/',auth[_0xe0b0('0xa')](),controller['create']);router[_0xe0b0('0xf')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);module[_0xe0b0('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 35b07ae..5f428f3 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 _0xda19=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE'];(function(_0x3d4e31,_0x40d41d){var _0x454daf=function(_0x505836){while(--_0x505836){_0x3d4e31['push'](_0x3d4e31['shift']());}};_0x454daf(++_0x40d41d);}(_0xda19,0xd5));var _0x9da1=function(_0x573822,_0x32b38d){_0x573822=_0x573822-0x0;var _0x1318f3=_0xda19[_0x573822];return _0x1318f3;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'type':{'type':Sequelize[_0x9da1('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9da1('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9da1('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9da1('0x1')]},'agentcalledAt':{'type':Sequelize[_0x9da1('0x2')]},'agentconnectAt':{'type':Sequelize[_0x9da1('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x9da1('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x9da1('0x2')]},'agentdumpAt':{'type':Sequelize[_0x9da1('0x2')]},'holdtime':{'type':Sequelize[_0x9da1('0x3')]},'agentcomplete':{'type':Sequelize[_0x9da1('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9da1('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9da1('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x9da1('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9da1('0x1')]},'channelstate':{'type':Sequelize[_0x9da1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x9da1('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9da1('0x1')]},'connectedlinename':{'type':Sequelize[_0x9da1('0x1')]},'language':{'type':Sequelize[_0x9da1('0x1')]},'accountcode':{'type':Sequelize[_0x9da1('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9da1('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x9da1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x9da1('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9da1('0x1')]},'destcalleridname':{'type':Sequelize[_0x9da1('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x9da1('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x9da1('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9da1('0x1')]},'destuniqueid':{'type':Sequelize[_0x9da1('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9da1('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x9da1('0x1')]},'transfer':{'type':Sequelize[_0x9da1('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9da1('0x5')},'transferexten':{'type':Sequelize[_0x9da1('0x1')]},'transferuniqueid':{'type':Sequelize[_0x9da1('0x1')]},'agententerreason':{'type':Sequelize[_0x9da1('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4819=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4819,0xcd));var _0x9481=function(_0x5df780,_0x3460c8){_0x5df780=_0x5df780-0x0;var _0x535f5b=_0x4819[_0x5df780];return _0x535f5b;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'type':{'type':Sequelize[_0x9481('0x1')]},'uniqueid':{'type':Sequelize[_0x9481('0x1')]},'calleridnum':{'type':Sequelize[_0x9481('0x1')]},'calleridname':{'type':Sequelize[_0x9481('0x1')]},'queue':{'type':Sequelize[_0x9481('0x1')]},'interface':{'type':Sequelize[_0x9481('0x1')]},'membername':{'type':Sequelize[_0x9481('0x1')]},'agentcalledAt':{'type':Sequelize[_0x9481('0x2')]},'agentconnectAt':{'type':Sequelize[_0x9481('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x9481('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9481('0x4')]},'agentacw':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x9481('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9481('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9481('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9481('0x1')]},'connectedlinename':{'type':Sequelize[_0x9481('0x1')]},'language':{'type':Sequelize[_0x9481('0x1')]},'accountcode':{'type':Sequelize[_0x9481('0x1')]},'context':{'type':Sequelize[_0x9481('0x1')]},'exten':{'type':Sequelize[_0x9481('0x1')]},'priority':{'type':Sequelize[_0x9481('0x1')]},'destchannel':{'type':Sequelize[_0x9481('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x9481('0x1')]},'destcalleridname':{'type':Sequelize[_0x9481('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x9481('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x9481('0x1')]},'destlanguage':{'type':Sequelize[_0x9481('0x1')]},'destaccountcode':{'type':Sequelize[_0x9481('0x1')]},'destcontext':{'type':Sequelize[_0x9481('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9481('0x1')]},'destuniqueid':{'type':Sequelize[_0x9481('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x9481('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9481('0x1')],'comment':_0x9481('0x5')},'transferexten':{'type':Sequelize[_0x9481('0x1')]},'transferuniqueid':{'type':Sequelize[_0x9481('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 83e3124..35da764 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 _0x3379=['../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','status','set','json','save','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','count','VoiceAgentReport','findAll','rows','catch','params','includeAll','options','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x32005b,_0x24b894){var _0x1dc31f=function(_0xade624){while(--_0xade624){_0x32005b['push'](_0x32005b['shift']());}};_0x1dc31f(++_0x24b894);}(_0x3379,0x115));var _0x9337=function(_0x28b2da,_0x540b55){_0x28b2da=_0x28b2da-0x0;var _0x27026a=_0x3379[_0x28b2da];return _0x27026a;};'use strict';var emlformat=require(_0x9337('0x0'));var rimraf=require(_0x9337('0x1'));var zipdir=require(_0x9337('0x2'));var jsonpatch=require(_0x9337('0x3'));var rp=require('request-promise');var moment=require(_0x9337('0x4'));var BPromise=require(_0x9337('0x5'));var Mustache=require(_0x9337('0x6'));var util=require(_0x9337('0x7'));var path=require('path');var sox=require(_0x9337('0x8'));var csv=require(_0x9337('0x9'));var ejs=require(_0x9337('0xa'));var fs=require('fs');var fs_extra=require(_0x9337('0xb'));var _=require('lodash');var squel=require(_0x9337('0xc'));var crypto=require('crypto');var jsforce=require(_0x9337('0xd'));var deskjs=require(_0x9337('0xe'));var toCsv=require(_0x9337('0x9'));var querystring=require(_0x9337('0xf'));var Papa=require(_0x9337('0x10'));var Redis=require('ioredis');var authService=require(_0x9337('0x11'));var qs=require(_0x9337('0x12'));var as=require(_0x9337('0x13'));var hardwareService=require(_0x9337('0x14'));var logger=require(_0x9337('0x15'))('api');var utils=require(_0x9337('0x16'));var config=require(_0x9337('0x17'));var licenseUtil=require(_0x9337('0x18'));var db=require(_0x9337('0x19'))['db'];function respondWithStatusCode(_0x3303f6,_0x32c1f6){_0x32c1f6=_0x32c1f6||0xcc;return function(_0x324e54){if(_0x324e54){return _0x3303f6['sendStatus'](_0x32c1f6);}return _0x3303f6['status'](_0x32c1f6)[_0x9337('0x1a')]();};}function respondWithResult(_0xedb2b6,_0x12f1f1){_0x12f1f1=_0x12f1f1||0xc8;return function(_0x14e7a0){if(_0x14e7a0){return _0xedb2b6['status'](_0x12f1f1)['json'](_0x14e7a0);}};}function respondWithFilteredResult(_0x13515e,_0x594b51){return function(_0x513263){if(_0x513263){var _0x35e805=typeof _0x594b51[_0x9337('0x1b')]===_0x9337('0x1c')&&typeof _0x594b51['limit']===_0x9337('0x1c');var _0x25633f=_0x513263['count'];var _0x5e49e7=_0x35e805?0x0:_0x594b51[_0x9337('0x1b')];var _0x462196=_0x35e805?_0x513263['count']:_0x594b51[_0x9337('0x1b')]+_0x594b51[_0x9337('0x1d')];var _0x4e9802;if(_0x462196>=_0x25633f){_0x462196=_0x25633f;_0x4e9802=0xc8;}else{_0x4e9802=0xce;}_0x13515e[_0x9337('0x1e')](_0x4e9802);return _0x13515e[_0x9337('0x1f')]('Content-Range',_0x5e49e7+'-'+_0x462196+'/'+_0x25633f)[_0x9337('0x20')](_0x513263);}return null;};}function patchUpdates(_0x7c334f){return function(_0x55e225){try{jsonpatch['apply'](_0x55e225,_0x7c334f,!![]);}catch(_0x28a237){return BPromise['reject'](_0x28a237);}return _0x55e225[_0x9337('0x21')]();};}function saveUpdates(_0x55601a,_0x29e989){return function(_0x5768d5){if(_0x5768d5){return _0x5768d5['update'](_0x55601a)[_0x9337('0x22')](function(_0x4fd485){return _0x4fd485;});}return null;};}function removeEntity(_0xe4b053,_0x543cfc){return function(_0x1e8d80){if(_0x1e8d80){return _0x1e8d80[_0x9337('0x23')]()[_0x9337('0x22')](function(){_0xe4b053[_0x9337('0x1e')](0xcc)[_0x9337('0x1a')]();});}};}function handleEntityNotFound(_0xb49ff1,_0x523b64){return function(_0x55cdd6){if(!_0x55cdd6){_0xb49ff1[_0x9337('0x24')](0x194);}return _0x55cdd6;};}function handleError(_0x3eb4c4,_0x2a87e7){_0x2a87e7=_0x2a87e7||0x1f4;return function(_0x178ed5){logger['error'](_0x178ed5[_0x9337('0x25')]);if(_0x178ed5['name']){delete _0x178ed5[_0x9337('0x26')];}_0x3eb4c4[_0x9337('0x1e')](_0x2a87e7)[_0x9337('0x27')](_0x178ed5);};}exports[_0x9337('0x28')]=function(_0x4da717,_0x5bca1e){var _0x33dc88={},_0x1bcb04={},_0x118972={'count':0x0,'rows':[]};var _0x263ff1=_[_0x9337('0x29')](db['VoiceAgentReport'][_0x9337('0x2a')],function(_0x590b04){return{'name':_0x590b04[_0x9337('0x2b')],'type':_0x590b04['type']['key']};});_0x1bcb04['model']=_['map'](_0x263ff1,_0x9337('0x26'));_0x1bcb04[_0x9337('0x2c')]=_[_0x9337('0x2d')](_0x4da717[_0x9337('0x2c')]);_0x1bcb04[_0x9337('0x2e')]=_['intersection'](_0x1bcb04['model'],_0x1bcb04[_0x9337('0x2c')]);_0x33dc88[_0x9337('0x2f')]=_[_0x9337('0x30')](_0x1bcb04[_0x9337('0x31')],qs[_0x9337('0x32')](_0x4da717[_0x9337('0x2c')]['fields']));_0x33dc88[_0x9337('0x2f')]=_0x33dc88[_0x9337('0x2f')][_0x9337('0x33')]?_0x33dc88['attributes']:_0x1bcb04[_0x9337('0x31')];if(!_0x4da717['query'][_0x9337('0x34')](_0x9337('0x35'))){_0x33dc88[_0x9337('0x1d')]=qs[_0x9337('0x1d')](_0x4da717[_0x9337('0x2c')][_0x9337('0x1d')]);_0x33dc88[_0x9337('0x1b')]=qs[_0x9337('0x1b')](_0x4da717[_0x9337('0x2c')][_0x9337('0x1b')]);}_0x33dc88[_0x9337('0x36')]=qs[_0x9337('0x37')](_0x4da717[_0x9337('0x2c')][_0x9337('0x37')]);_0x33dc88['where']=qs[_0x9337('0x2e')](_[_0x9337('0x38')](_0x4da717['query'],_0x1bcb04[_0x9337('0x2e')]),_0x263ff1);if(_0x4da717[_0x9337('0x2c')][_0x9337('0x39')]){_0x33dc88[_0x9337('0x3a')]=_['merge'](_0x33dc88[_0x9337('0x3a')],{'$or':_['map'](_0x263ff1,function(_0x20cbd1){if(_0x20cbd1[_0x9337('0x3b')]!==_0x9337('0x3c')){var _0x59f06f={};_0x59f06f[_0x20cbd1[_0x9337('0x26')]]={'$like':'%'+_0x4da717['query']['filter']+'%'};return _0x59f06f;}})});}_0x33dc88=_[_0x9337('0x3d')]({},_0x33dc88,_0x4da717['options']);var _0x58c033={'where':_0x33dc88[_0x9337('0x3a')]};return db['VoiceAgentReport'][_0x9337('0x3e')](_0x58c033)['then'](function(_0x5b9ee8){_0x118972[_0x9337('0x3e')]=_0x5b9ee8;if(_0x4da717['query']['includeAll']){_0x33dc88['include']=[{'all':!![]}];}return db[_0x9337('0x3f')][_0x9337('0x40')](_0x33dc88);})['then'](function(_0x2f266e){_0x118972[_0x9337('0x41')]=_0x2f266e;return _0x118972;})[_0x9337('0x22')](respondWithFilteredResult(_0x5bca1e,_0x33dc88))[_0x9337('0x42')](handleError(_0x5bca1e,null));};exports['show']=function(_0x39d4b0,_0x2f457d){var _0x36f3bc={'raw':![],'where':{'id':_0x39d4b0[_0x9337('0x43')]['id']}},_0xd7e495={};_0xd7e495[_0x9337('0x31')]=_[_0x9337('0x2d')](db[_0x9337('0x3f')]['rawAttributes']);_0xd7e495[_0x9337('0x2c')]=_[_0x9337('0x2d')](_0x39d4b0[_0x9337('0x2c')]);_0xd7e495[_0x9337('0x2e')]=_[_0x9337('0x30')](_0xd7e495[_0x9337('0x31')],_0xd7e495[_0x9337('0x2c')]);_0x36f3bc[_0x9337('0x2f')]=_['intersection'](_0xd7e495['model'],qs[_0x9337('0x32')](_0x39d4b0[_0x9337('0x2c')][_0x9337('0x32')]));_0x36f3bc['attributes']=_0x36f3bc[_0x9337('0x2f')][_0x9337('0x33')]?_0x36f3bc[_0x9337('0x2f')]:_0xd7e495[_0x9337('0x31')];if(_0x39d4b0[_0x9337('0x2c')][_0x9337('0x44')]){_0x36f3bc['include']=[{'all':!![]}];}_0x36f3bc=_[_0x9337('0x3d')]({},_0x36f3bc,_0x39d4b0[_0x9337('0x45')]);return db['VoiceAgentReport']['find'](_0x36f3bc)[_0x9337('0x22')](handleEntityNotFound(_0x2f457d,null))[_0x9337('0x22')](respondWithResult(_0x2f457d,null))[_0x9337('0x42')](handleError(_0x2f457d,null));};exports[_0x9337('0x46')]=function(_0x23f319,_0x56bfe7){return db[_0x9337('0x3f')][_0x9337('0x46')](_0x23f319[_0x9337('0x47')],{})[_0x9337('0x22')](respondWithResult(_0x56bfe7,0xc9))[_0x9337('0x42')](handleError(_0x56bfe7,null));};exports[_0x9337('0x48')]=function(_0x9f57ab,_0x32efcd){if(_0x9f57ab[_0x9337('0x47')]['id']){delete _0x9f57ab[_0x9337('0x47')]['id'];}return db[_0x9337('0x3f')][_0x9337('0x49')]({'where':{'id':_0x9f57ab[_0x9337('0x43')]['id']}})[_0x9337('0x22')](handleEntityNotFound(_0x32efcd,null))[_0x9337('0x22')](saveUpdates(_0x9f57ab['body'],null))['then'](respondWithResult(_0x32efcd,null))[_0x9337('0x42')](handleError(_0x32efcd,null));};exports[_0x9337('0x23')]=function(_0x56a23a,_0x2b094b){return db[_0x9337('0x3f')]['find']({'where':{'id':_0x56a23a[_0x9337('0x43')]['id']}})[_0x9337('0x22')](handleEntityNotFound(_0x2b094b,null))[_0x9337('0x22')](removeEntity(_0x2b094b,null))[_0x9337('0x42')](handleError(_0x2b094b,null));};exports[_0x9337('0x4a')]=function(_0x2e2c84,_0x3686dc){return db[_0x9337('0x3f')][_0x9337('0x4a')]()['then'](respondWithResult(_0x3686dc,null))[_0x9337('0x42')](handleError(_0x3686dc,null));}; \ No newline at end of file +var _0x0e12=['describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','Content-Range','reject','save','update','then','sendStatus','error','name','index','map','type','model','query','filters','intersection','attributes','fields','order','sort','pick','filter','merge','where','VIRTUAL','options','VoiceAgentReport','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','body','destroy'];(function(_0xe8c687,_0x33f35a){var _0x343c0e=function(_0x4a5637){while(--_0x4a5637){_0xe8c687['push'](_0xe8c687['shift']());}};_0x343c0e(++_0x33f35a);}(_0x0e12,0x169));var _0x20e1=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0x0e12[_0x30cc1a];return _0xb3f18f;};'use strict';var emlformat=require(_0x20e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x20e1('0x1'));var jsonpatch=require(_0x20e1('0x2'));var rp=require(_0x20e1('0x3'));var moment=require(_0x20e1('0x4'));var BPromise=require(_0x20e1('0x5'));var Mustache=require(_0x20e1('0x6'));var util=require(_0x20e1('0x7'));var path=require('path');var sox=require(_0x20e1('0x8'));var csv=require(_0x20e1('0x9'));var ejs=require(_0x20e1('0xa'));var fs=require('fs');var fs_extra=require(_0x20e1('0xb'));var _=require(_0x20e1('0xc'));var squel=require(_0x20e1('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x20e1('0x9'));var querystring=require('querystring');var Papa=require(_0x20e1('0xe'));var Redis=require(_0x20e1('0xf'));var authService=require(_0x20e1('0x10'));var qs=require(_0x20e1('0x11'));var as=require(_0x20e1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x20e1('0x13'))(_0x20e1('0x14'));var utils=require(_0x20e1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x20e1('0x16'));var db=require(_0x20e1('0x17'))['db'];function respondWithStatusCode(_0x4607da,_0x2e1609){_0x2e1609=_0x2e1609||0xcc;return function(_0xae91f4){if(_0xae91f4){return _0x4607da['sendStatus'](_0x2e1609);}return _0x4607da['status'](_0x2e1609)[_0x20e1('0x18')]();};}function respondWithResult(_0x466967,_0x2c7f4f){_0x2c7f4f=_0x2c7f4f||0xc8;return function(_0x52afc4){if(_0x52afc4){return _0x466967['status'](_0x2c7f4f)[_0x20e1('0x19')](_0x52afc4);}};}function respondWithFilteredResult(_0x15f41c,_0x4f6275){return function(_0x520b78){if(_0x520b78){var _0x7a8eeb=typeof _0x4f6275[_0x20e1('0x1a')]===_0x20e1('0x1b')&&typeof _0x4f6275[_0x20e1('0x1c')]===_0x20e1('0x1b');var _0x4aa9b1=_0x520b78[_0x20e1('0x1d')];var _0x5cafd4=_0x7a8eeb?0x0:_0x4f6275[_0x20e1('0x1a')];var _0x5d979e=_0x7a8eeb?_0x520b78[_0x20e1('0x1d')]:_0x4f6275[_0x20e1('0x1a')]+_0x4f6275['limit'];var _0x4fe818;if(_0x5d979e>=_0x4aa9b1){_0x5d979e=_0x4aa9b1;_0x4fe818=0xc8;}else{_0x4fe818=0xce;}_0x15f41c[_0x20e1('0x1e')](_0x4fe818);return _0x15f41c['set'](_0x20e1('0x1f'),_0x5cafd4+'-'+_0x5d979e+'/'+_0x4aa9b1)[_0x20e1('0x19')](_0x520b78);}return null;};}function patchUpdates(_0x52e73f){return function(_0x59b753){try{jsonpatch['apply'](_0x59b753,_0x52e73f,!![]);}catch(_0x21e033){return BPromise[_0x20e1('0x20')](_0x21e033);}return _0x59b753[_0x20e1('0x21')]();};}function saveUpdates(_0x172695,_0x3aeca0){return function(_0x1107bf){if(_0x1107bf){return _0x1107bf[_0x20e1('0x22')](_0x172695)[_0x20e1('0x23')](function(_0x1d6088){return _0x1d6088;});}return null;};}function removeEntity(_0x3ecabc,_0x4aaf8e){return function(_0x51ddcc){if(_0x51ddcc){return _0x51ddcc['destroy']()[_0x20e1('0x23')](function(){_0x3ecabc[_0x20e1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11afcf,_0x36df5c){return function(_0x589488){if(!_0x589488){_0x11afcf[_0x20e1('0x24')](0x194);}return _0x589488;};}function handleError(_0x32fbb8,_0x267c21){_0x267c21=_0x267c21||0x1f4;return function(_0x560385){logger[_0x20e1('0x25')](_0x560385['stack']);if(_0x560385[_0x20e1('0x26')]){delete _0x560385[_0x20e1('0x26')];}_0x32fbb8[_0x20e1('0x1e')](_0x267c21)['send'](_0x560385);};}exports[_0x20e1('0x27')]=function(_0x13ae61,_0x34c3f3){var _0x2448d4={},_0xe9289e={},_0x58ef50={'count':0x0,'rows':[]};var _0x290522=_[_0x20e1('0x28')](db['VoiceAgentReport']['rawAttributes'],function(_0x35f842){return{'name':_0x35f842['fieldName'],'type':_0x35f842[_0x20e1('0x29')]['key']};});_0xe9289e[_0x20e1('0x2a')]=_[_0x20e1('0x28')](_0x290522,_0x20e1('0x26'));_0xe9289e['query']=_['keys'](_0x13ae61[_0x20e1('0x2b')]);_0xe9289e[_0x20e1('0x2c')]=_[_0x20e1('0x2d')](_0xe9289e['model'],_0xe9289e[_0x20e1('0x2b')]);_0x2448d4[_0x20e1('0x2e')]=_['intersection'](_0xe9289e[_0x20e1('0x2a')],qs[_0x20e1('0x2f')](_0x13ae61[_0x20e1('0x2b')]['fields']));_0x2448d4['attributes']=_0x2448d4[_0x20e1('0x2e')]['length']?_0x2448d4[_0x20e1('0x2e')]:_0xe9289e[_0x20e1('0x2a')];if(!_0x13ae61['query']['hasOwnProperty']('nolimit')){_0x2448d4[_0x20e1('0x1c')]=qs[_0x20e1('0x1c')](_0x13ae61['query'][_0x20e1('0x1c')]);_0x2448d4[_0x20e1('0x1a')]=qs[_0x20e1('0x1a')](_0x13ae61[_0x20e1('0x2b')]['offset']);}_0x2448d4[_0x20e1('0x30')]=qs['sort'](_0x13ae61['query'][_0x20e1('0x31')]);_0x2448d4['where']=qs['filters'](_[_0x20e1('0x32')](_0x13ae61[_0x20e1('0x2b')],_0xe9289e[_0x20e1('0x2c')]),_0x290522);if(_0x13ae61[_0x20e1('0x2b')][_0x20e1('0x33')]){_0x2448d4['where']=_[_0x20e1('0x34')](_0x2448d4[_0x20e1('0x35')],{'$or':_[_0x20e1('0x28')](_0x290522,function(_0x840915){if(_0x840915[_0x20e1('0x29')]!==_0x20e1('0x36')){var _0x273c9c={};_0x273c9c[_0x840915['name']]={'$like':'%'+_0x13ae61[_0x20e1('0x2b')][_0x20e1('0x33')]+'%'};return _0x273c9c;}})});}_0x2448d4=_[_0x20e1('0x34')]({},_0x2448d4,_0x13ae61[_0x20e1('0x37')]);var _0xb5dcdc={'where':_0x2448d4[_0x20e1('0x35')]};return db[_0x20e1('0x38')][_0x20e1('0x1d')](_0xb5dcdc)[_0x20e1('0x23')](function(_0x57bfc6){_0x58ef50[_0x20e1('0x1d')]=_0x57bfc6;if(_0x13ae61['query'][_0x20e1('0x39')]){_0x2448d4[_0x20e1('0x3a')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x20e1('0x3b')](_0x2448d4);})[_0x20e1('0x23')](function(_0xb138fe){_0x58ef50[_0x20e1('0x3c')]=_0xb138fe;return _0x58ef50;})['then'](respondWithFilteredResult(_0x34c3f3,_0x2448d4))[_0x20e1('0x3d')](handleError(_0x34c3f3,null));};exports[_0x20e1('0x3e')]=function(_0x23113c,_0x2a825d){var _0x37a845={'raw':![],'where':{'id':_0x23113c[_0x20e1('0x3f')]['id']}},_0x7fa3c={};_0x7fa3c[_0x20e1('0x2a')]=_[_0x20e1('0x40')](db['VoiceAgentReport'][_0x20e1('0x41')]);_0x7fa3c[_0x20e1('0x2b')]=_[_0x20e1('0x40')](_0x23113c[_0x20e1('0x2b')]);_0x7fa3c[_0x20e1('0x2c')]=_[_0x20e1('0x2d')](_0x7fa3c[_0x20e1('0x2a')],_0x7fa3c[_0x20e1('0x2b')]);_0x37a845[_0x20e1('0x2e')]=_[_0x20e1('0x2d')](_0x7fa3c[_0x20e1('0x2a')],qs[_0x20e1('0x2f')](_0x23113c[_0x20e1('0x2b')][_0x20e1('0x2f')]));_0x37a845['attributes']=_0x37a845['attributes'][_0x20e1('0x42')]?_0x37a845[_0x20e1('0x2e')]:_0x7fa3c['model'];if(_0x23113c['query'][_0x20e1('0x39')]){_0x37a845[_0x20e1('0x3a')]=[{'all':!![]}];}_0x37a845=_['merge']({},_0x37a845,_0x23113c[_0x20e1('0x37')]);return db['VoiceAgentReport'][_0x20e1('0x43')](_0x37a845)[_0x20e1('0x23')](handleEntityNotFound(_0x2a825d,null))[_0x20e1('0x23')](respondWithResult(_0x2a825d,null))[_0x20e1('0x3d')](handleError(_0x2a825d,null));};exports[_0x20e1('0x44')]=function(_0x47bacf,_0x31d920){return db[_0x20e1('0x38')][_0x20e1('0x44')](_0x47bacf[_0x20e1('0x45')],{})['then'](respondWithResult(_0x31d920,0xc9))[_0x20e1('0x3d')](handleError(_0x31d920,null));};exports[_0x20e1('0x22')]=function(_0x44e9e4,_0x433739){if(_0x44e9e4[_0x20e1('0x45')]['id']){delete _0x44e9e4['body']['id'];}return db[_0x20e1('0x38')]['find']({'where':{'id':_0x44e9e4[_0x20e1('0x3f')]['id']}})[_0x20e1('0x23')](handleEntityNotFound(_0x433739,null))[_0x20e1('0x23')](saveUpdates(_0x44e9e4[_0x20e1('0x45')],null))[_0x20e1('0x23')](respondWithResult(_0x433739,null))[_0x20e1('0x3d')](handleError(_0x433739,null));};exports[_0x20e1('0x46')]=function(_0x1f8229,_0x48184){return db[_0x20e1('0x38')]['find']({'where':{'id':_0x1f8229[_0x20e1('0x3f')]['id']}})[_0x20e1('0x23')](handleEntityNotFound(_0x48184,null))['then'](removeEntity(_0x48184,null))[_0x20e1('0x3d')](handleError(_0x48184,null));};exports['describe']=function(_0x493717,_0x51098b){return db[_0x20e1('0x38')][_0x20e1('0x47')]()['then'](respondWithResult(_0x51098b,null))['catch'](handleError(_0x51098b,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index b8b3fe7..c8ae66d 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 _0x6546=['uniqueid','destuniqueid','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent'];(function(_0x54059d,_0x7776f3){var _0x1bc9f0=function(_0x32a325){while(--_0x32a325){_0x54059d['push'](_0x54059d['shift']());}};_0x1bc9f0(++_0x7776f3);}(_0x6546,0x1e2));var _0x6654=function(_0x21381a,_0x3dce0d){_0x21381a=_0x21381a-0x0;var _0x399bb3=_0x6546[_0x21381a];return _0x399bb3;};'use strict';var _=require(_0x6654('0x0'));var util=require(_0x6654('0x1'));var logger=require('../../config/logger')(_0x6654('0x2'));var moment=require(_0x6654('0x3'));var BPromise=require(_0x6654('0x4'));var rp=require(_0x6654('0x5'));var fs=require('fs');var path=require(_0x6654('0x6'));var rimraf=require('rimraf');var config=require(_0x6654('0x7'));var attributes=require(_0x6654('0x8'));module[_0x6654('0x9')]=function(_0x9dcfde,_0x2b84c0){return _0x9dcfde[_0x6654('0xa')](_0x6654('0xb'),attributes,{'tableName':_0x6654('0xc'),'paranoid':![],'indexes':[{'fields':[_0x6654('0xd'),_0x6654('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x20ef=['uniqueid','destuniqueid','util','../../config/logger','moment','bluebird','request-promise','path','./voiceAgentReport.attributes','exports','define','report_agent'];(function(_0x13a9cf,_0x3e6c7b){var _0x4d92bd=function(_0x3fc0de){while(--_0x3fc0de){_0x13a9cf['push'](_0x13a9cf['shift']());}};_0x4d92bd(++_0x3e6c7b);}(_0x20ef,0x9e));var _0xf20e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf20e('0x0'));var logger=require(_0xf20e('0x1'))('api');var moment=require(_0xf20e('0x2'));var BPromise=require(_0xf20e('0x3'));var rp=require(_0xf20e('0x4'));var fs=require('fs');var path=require(_0xf20e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf20e('0x6'));module[_0xf20e('0x7')]=function(_0x141d2b,_0x26b003){return _0x141d2b[_0xf20e('0x8')]('VoiceAgentReport',attributes,{'tableName':_0xf20e('0x9'),'paranoid':![],'indexes':[{'fields':[_0xf20e('0xa'),_0xf20e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 2de1163..1825b89 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 _0x978a=['options','raw','UpdateVoiceAgentReport','VoiceAgentReport','update','where','limit','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateVoiceAgentReport','create','body'];(function(_0x7a6aed,_0x335e68){var _0x9dbabf=function(_0x453c9c){while(--_0x453c9c){_0x7a6aed['push'](_0x7a6aed['shift']());}};_0x9dbabf(++_0x335e68);}(_0x978a,0x16f));var _0xa978=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x978a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa978('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa978('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa978('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa978('0x3'));var logger=require(_0xa978('0x4'))(_0xa978('0x5'));var config=require(_0xa978('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa978('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c603e,_0x128111,_0x2bd711){return new BPromise(function(_0x510522,_0x3b657d){return client[_0xa978('0x8')](_0x2c603e,_0x2bd711)[_0xa978('0x9')](function(_0x3d6116){logger[_0xa978('0xa')](_0xa978('0xb'),_0x128111,'request\x20sent');logger[_0xa978('0xc')](_0xa978('0xd'),_0x128111,_0xa978('0xe'),JSON[_0xa978('0xf')](_0x3d6116));if(_0x3d6116[_0xa978('0x10')]){if(_0x3d6116['error']['code']===0x1f4){logger[_0xa978('0x10')](_0xa978('0xb'),_0x128111,_0x3d6116[_0xa978('0x10')][_0xa978('0x11')]);return _0x3b657d(_0x3d6116[_0xa978('0x10')][_0xa978('0x11')]);}logger['error'](_0xa978('0xb'),_0x128111,_0x3d6116[_0xa978('0x10')][_0xa978('0x11')]);return _0x510522(_0x3d6116['error'][_0xa978('0x11')]);}else{logger['info'](_0xa978('0xb'),_0x128111,_0xa978('0xe'));_0x510522(_0x3d6116[_0xa978('0x12')][_0xa978('0x11')]);}})[_0xa978('0x13')](function(_0x16c9d6){logger[_0xa978('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x128111,_0x16c9d6);_0x3b657d(_0x16c9d6);});});}exports[_0xa978('0x14')]=function(_0x400d3e){var _0x1cfd4c=this;return new Promise(function(_0x46bc8b,_0x31e8e0){return db['VoiceAgentReport'][_0xa978('0x15')](_0x400d3e[_0xa978('0x16')],{'raw':_0x400d3e[_0xa978('0x17')]?_0x400d3e[_0xa978('0x17')][_0xa978('0x18')]===undefined?!![]:![]:!![]})[_0xa978('0x9')](function(_0x741468){logger[_0xa978('0xa')]('CreateVoiceAgentReport',_0x400d3e);logger[_0xa978('0xc')](_0xa978('0x14'),_0x400d3e,JSON[_0xa978('0xf')](_0x741468));_0x46bc8b(_0x741468);})[_0xa978('0x13')](function(_0x2bf3e3){logger[_0xa978('0x10')](_0xa978('0x14'),_0x2bf3e3['message'],_0x400d3e);_0x31e8e0(_0x1cfd4c[_0xa978('0x10')](0x1f4,_0x2bf3e3[_0xa978('0x11')]));});});};exports[_0xa978('0x19')]=function(_0x22afd2){var _0x1cad38=this;return new Promise(function(_0x28a334,_0x56e126){return db[_0xa978('0x1a')][_0xa978('0x1b')](_0x22afd2[_0xa978('0x16')],{'raw':_0x22afd2['options']?_0x22afd2['options'][_0xa978('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22afd2[_0xa978('0x17')]?_0x22afd2[_0xa978('0x17')][_0xa978('0x1c')]||null:null,'attributes':_0x22afd2[_0xa978('0x17')]?_0x22afd2[_0xa978('0x17')]['attributes']||null:null,'limit':_0x22afd2[_0xa978('0x17')]?_0x22afd2[_0xa978('0x17')][_0xa978('0x1d')]||null:null})[_0xa978('0x9')](function(_0x49287f){logger[_0xa978('0xa')](_0xa978('0x19'),_0x22afd2);logger[_0xa978('0xc')]('UpdateVoiceAgentReport',_0x22afd2,JSON['stringify'](_0x49287f));_0x28a334(_0x49287f);})[_0xa978('0x13')](function(_0x53569d){logger['error'](_0xa978('0x19'),_0x53569d[_0xa978('0x11')],_0x22afd2);_0x56e126(_0x1cad38[_0xa978('0x10')](0x1f4,_0x53569d['message']));});});}; \ No newline at end of file +var _0xae7c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','CreateVoiceAgentReport','create','body','raw','update','options','where','UpdateVoiceAgentReport','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1d6505,_0x2f62f7){var _0x45e9a4=function(_0x3cda3f){while(--_0x3cda3f){_0x1d6505['push'](_0x1d6505['shift']());}};_0x45e9a4(++_0x2f62f7);}(_0xae7c,0x10a));var _0xcae7=function(_0x1f4d1a,_0x2af6c4){_0x1f4d1a=_0x1f4d1a-0x0;var _0x2efebd=_0xae7c[_0x1f4d1a];return _0x2efebd;};'use strict';var _=require(_0xcae7('0x0'));var util=require(_0xcae7('0x1'));var moment=require(_0xcae7('0x2'));var BPromise=require(_0xcae7('0x3'));var rs=require(_0xcae7('0x4'));var fs=require('fs');var Redis=require(_0xcae7('0x5'));var db=require(_0xcae7('0x6'))['db'];var utils=require(_0xcae7('0x7'));var logger=require(_0xcae7('0x8'))(_0xcae7('0x9'));var config=require(_0xcae7('0xa'));var jayson=require(_0xcae7('0xb'));var client=jayson[_0xcae7('0xc')][_0xcae7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xa7c1c,_0x1df7d3,_0x1a7717){return new BPromise(function(_0x14e6b9,_0xc6b853){return client[_0xcae7('0xe')](_0xa7c1c,_0x1a7717)[_0xcae7('0xf')](function(_0x13745c){logger['info'](_0xcae7('0x10'),_0x1df7d3,_0xcae7('0x11'));logger['debug'](_0xcae7('0x12'),_0x1df7d3,_0xcae7('0x11'),JSON[_0xcae7('0x13')](_0x13745c));if(_0x13745c['error']){if(_0x13745c['error'][_0xcae7('0x14')]===0x1f4){logger['error'](_0xcae7('0x10'),_0x1df7d3,_0x13745c[_0xcae7('0x15')]['message']);return _0xc6b853(_0x13745c[_0xcae7('0x15')][_0xcae7('0x16')]);}logger[_0xcae7('0x15')](_0xcae7('0x10'),_0x1df7d3,_0x13745c[_0xcae7('0x15')]['message']);return _0x14e6b9(_0x13745c[_0xcae7('0x15')]['message']);}else{logger[_0xcae7('0x17')](_0xcae7('0x10'),_0x1df7d3,'request\x20sent');_0x14e6b9(_0x13745c['result'][_0xcae7('0x16')]);}})[_0xcae7('0x18')](function(_0x246478){logger[_0xcae7('0x15')](_0xcae7('0x10'),_0x1df7d3,_0x246478);_0xc6b853(_0x246478);});});}exports[_0xcae7('0x19')]=function(_0x189441){var _0x54763f=this;return new Promise(function(_0x1e9a57,_0x359b4b){return db['VoiceAgentReport'][_0xcae7('0x1a')](_0x189441[_0xcae7('0x1b')],{'raw':_0x189441['options']?_0x189441['options'][_0xcae7('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5ca79b){logger[_0xcae7('0x17')](_0xcae7('0x19'),_0x189441);logger['debug'](_0xcae7('0x19'),_0x189441,JSON[_0xcae7('0x13')](_0x5ca79b));_0x1e9a57(_0x5ca79b);})[_0xcae7('0x18')](function(_0x5d6d5b){logger[_0xcae7('0x15')](_0xcae7('0x19'),_0x5d6d5b[_0xcae7('0x16')],_0x189441);_0x359b4b(_0x54763f[_0xcae7('0x15')](0x1f4,_0x5d6d5b['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x1e01c5){var _0x13d325=this;return new Promise(function(_0x443154,_0x1af50b){return db['VoiceAgentReport'][_0xcae7('0x1d')](_0x1e01c5[_0xcae7('0x1b')],{'raw':_0x1e01c5[_0xcae7('0x1e')]?_0x1e01c5[_0xcae7('0x1e')][_0xcae7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e01c5['options']?_0x1e01c5[_0xcae7('0x1e')][_0xcae7('0x1f')]||null:null,'attributes':_0x1e01c5[_0xcae7('0x1e')]?_0x1e01c5[_0xcae7('0x1e')]['attributes']||null:null,'limit':_0x1e01c5[_0xcae7('0x1e')]?_0x1e01c5[_0xcae7('0x1e')]['limit']||null:null})[_0xcae7('0xf')](function(_0xe97c2b){logger[_0xcae7('0x17')](_0xcae7('0x20'),_0x1e01c5);logger[_0xcae7('0x21')](_0xcae7('0x20'),_0x1e01c5,JSON['stringify'](_0xe97c2b));_0x443154(_0xe97c2b);})['catch'](function(_0x54c9ee){logger[_0xcae7('0x15')](_0xcae7('0x20'),_0x54c9ee['message'],_0x1e01c5);_0x1af50b(_0x13d325[_0xcae7('0x15')](0x1f4,_0x54c9ee[_0xcae7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index c5ce6d8..8d3b4ba 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','show','post'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','show','post'];(function(_0x53b8e0,_0x55d46e){var _0x10630c=function(_0x3189aa){while(--_0x3189aa){_0x53b8e0['push'](_0x53b8e0['shift']());}};_0x10630c(++_0x55d46e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 24e11b8..d9950e7 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 _0xdb94=['STRING','inbound','internal','outbound','inbound-fax','outbound-fax','TEXT','DATE','INTEGER','exports'];(function(_0x253694,_0x1177cf){var _0x39d218=function(_0x22c086){while(--_0x22c086){_0x253694['push'](_0x253694['shift']());}};_0x39d218(++_0x1177cf);}(_0xdb94,0xe5));var _0x4db9=function(_0x562094,_0x1a40a8){_0x562094=_0x562094-0x0;var _0x2119ee=_0xdb94[_0x562094];return _0x2119ee;};'use strict';var Sequelize=require('sequelize');module[_0x4db9('0x0')]={'uniqueid':{'type':Sequelize[_0x4db9('0x1')]},'type':{'type':Sequelize['ENUM'](_0x4db9('0x2'),_0x4db9('0x3'),_0x4db9('0x4'),_0x4db9('0x5'),_0x4db9('0x6'),'dialer')},'tag':{'type':Sequelize[_0x4db9('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x4db9('0x1')]},'destination':{'type':Sequelize[_0x4db9('0x1')]},'destinationcontext':{'type':Sequelize[_0x4db9('0x1')]},'callerid':{'type':Sequelize[_0x4db9('0x1')]},'channel':{'type':Sequelize[_0x4db9('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x4db9('0x1')]},'lastdata':{'type':Sequelize[_0x4db9('0x7')]},'starttime':{'type':Sequelize[_0x4db9('0x8')]},'systemanswertime':{'type':Sequelize[_0x4db9('0x8')]},'answertime':{'type':Sequelize[_0x4db9('0x8')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x4db9('0x9')]},'billableseconds':{'type':Sequelize[_0x4db9('0x9')]},'mohtime':{'type':Sequelize[_0x4db9('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4db9('0x1')]},'amaflags':{'type':Sequelize[_0x4db9('0x1')]},'userfield':{'type':Sequelize[_0x4db9('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x4db9('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x4db9('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x4db9('0x9')]},'sipcallid':{'type':Sequelize[_0x4db9('0x1')]}}; \ No newline at end of file +var _0x6c7b=['inbound-fax','outbound-fax','STRING','TEXT','DATE','INTEGER','sequelize','inbound','outbound'];(function(_0x836672,_0x1b61bf){var _0x283627=function(_0x338483){while(--_0x338483){_0x836672['push'](_0x836672['shift']());}};_0x283627(++_0x1b61bf);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x524bf9,_0x47462b){_0x524bf9=_0x524bf9-0x0;var _0x550148=_0x6c7b[_0x524bf9];return _0x550148;};'use strict';var Sequelize=require(_0xb6c7('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xb6c7('0x1'),'internal',_0xb6c7('0x2'),_0xb6c7('0x3'),_0xb6c7('0x4'),'dialer')},'tag':{'type':Sequelize[_0xb6c7('0x5')]},'accountcode':{'type':Sequelize[_0xb6c7('0x5')]},'source':{'type':Sequelize[_0xb6c7('0x5')]},'destination':{'type':Sequelize[_0xb6c7('0x5')]},'destinationcontext':{'type':Sequelize[_0xb6c7('0x5')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb6c7('0x5')]},'destinationchannel':{'type':Sequelize[_0xb6c7('0x5')]},'lastapplication':{'type':Sequelize[_0xb6c7('0x5')]},'lastdata':{'type':Sequelize[_0xb6c7('0x6')]},'starttime':{'type':Sequelize[_0xb6c7('0x7')]},'systemanswertime':{'type':Sequelize[_0xb6c7('0x7')]},'answertime':{'type':Sequelize[_0xb6c7('0x7')]},'endtime':{'type':Sequelize[_0xb6c7('0x7')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xb6c7('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb6c7('0x5')]},'amaflags':{'type':Sequelize[_0xb6c7('0x5')]},'userfield':{'type':Sequelize[_0xb6c7('0x5')]},'userDisposition':{'type':Sequelize[_0xb6c7('0x5')]},'userSecondDisposition':{'type':Sequelize[_0xb6c7('0x5')]},'userThirdDisposition':{'type':Sequelize[_0xb6c7('0x5')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xb6c7('0x5')]},'routeid':{'type':Sequelize[_0xb6c7('0x8')]},'sipcallid':{'type':Sequelize[_0xb6c7('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index f0a080f..6a350fb 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 _0x70e0=['rimraf','zip-dir','moment','bluebird','mustache','util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','include','alias','User','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','destroy','describe','uniqueid','eml-format'];(function(_0x593cbd,_0x141c5b){var _0x1ea4aa=function(_0x5d42ba){while(--_0x5d42ba){_0x593cbd['push'](_0x593cbd['shift']());}};_0x1ea4aa(++_0x141c5b);}(_0x70e0,0x17b));var _0x070e=function(_0x31b2d8,_0x585992){_0x31b2d8=_0x31b2d8-0x0;var _0x4cea83=_0x70e0[_0x31b2d8];return _0x4cea83;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={},_0x26373b={},_0x5e8326={'count':0x0,'rows':[]};var _0x282344=_[_0x070e('0x29')](db[_0x070e('0x2a')]['rawAttributes'],function(_0x5c5f0d){return{'name':_0x5c5f0d[_0x070e('0x2b')],'type':_0x5c5f0d[_0x070e('0x2c')][_0x070e('0x2d')]};});_0x26373b['model']=_[_0x070e('0x29')](_0x282344,_0x070e('0x26'));_0x26373b[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x43dd96['query']);_0x26373b['filters']=_['intersection'](_0x26373b['model'],_0x26373b[_0x070e('0x2e')]);_0x1a1892['attributes']=_[_0x070e('0x30')](_0x26373b[_0x070e('0x31')],qs['fields'](_0x43dd96['query'][_0x070e('0x32')]));_0x1a1892[_0x070e('0x33')]=_0x1a1892['attributes']['length']?_0x1a1892[_0x070e('0x33')]:_0x26373b[_0x070e('0x31')];if(!_0x43dd96[_0x070e('0x2e')][_0x070e('0x34')](_0x070e('0x35'))){_0x1a1892['limit']=qs['limit'](_0x43dd96[_0x070e('0x2e')][_0x070e('0x1e')]);_0x1a1892[_0x070e('0x1b')]=qs[_0x070e('0x1b')](_0x43dd96[_0x070e('0x2e')]['offset']);}_0x1a1892[_0x070e('0x36')]=qs[_0x070e('0x37')](_0x43dd96['query'][_0x070e('0x37')]);_0x1a1892[_0x070e('0x38')]=qs['filters'](_['pick'](_0x43dd96['query'],_0x26373b[_0x070e('0x39')]),_0x282344);if(_0x43dd96[_0x070e('0x2e')][_0x070e('0x3a')]){_0x1a1892[_0x070e('0x38')]=_[_0x070e('0x3b')](_0x1a1892['where'],{'$or':_[_0x070e('0x29')](_0x282344,function(_0xa1bb20){if(_0xa1bb20[_0x070e('0x2c')]!=='VIRTUAL'){var _0x268c5d={};_0x268c5d[_0xa1bb20[_0x070e('0x26')]]={'$like':'%'+_0x43dd96[_0x070e('0x2e')]['filter']+'%'};return _0x268c5d;}})});}_0x1a1892=_[_0x070e('0x3b')]({},_0x1a1892,_0x43dd96[_0x070e('0x3c')]);var _0x4800a9={'where':_0x1a1892[_0x070e('0x38')]};return db['VoiceCallReport'][_0x070e('0x1d')](_0x4800a9)[_0x070e('0x23')](function(_0x3462d3){_0x5e8326[_0x070e('0x1d')]=_0x3462d3;if(_0x43dd96[_0x070e('0x2e')]['includeAll']){_0x1a1892[_0x070e('0x3d')]=[{'attributes':['id','name','fullname',_0x070e('0x3e')],'model':db[_0x070e('0x3f')],'as':_0x070e('0x3f')}];}return db['VoiceCallReport'][_0x070e('0x40')](_0x1a1892);})[_0x070e('0x23')](function(_0x556bf3){_0x5e8326[_0x070e('0x41')]=_0x556bf3;return _0x5e8326;})['then'](respondWithFilteredResult(_0x28d7f2,_0x1a1892))[_0x070e('0x42')](handleError(_0x28d7f2,null));};exports['show']=function(_0x544b53,_0x5d77d9){var _0x3feb83={'raw':!![],'where':{'id':_0x544b53[_0x070e('0x43')]['id']}},_0x926533={};_0x926533[_0x070e('0x31')]=_[_0x070e('0x2f')](db['VoiceCallReport'][_0x070e('0x44')]);_0x926533['query']=_[_0x070e('0x2f')](_0x544b53[_0x070e('0x2e')]);_0x926533[_0x070e('0x39')]=_['intersection'](_0x926533['model'],_0x926533[_0x070e('0x2e')]);_0x3feb83['attributes']=_[_0x070e('0x30')](_0x926533[_0x070e('0x31')],qs[_0x070e('0x32')](_0x544b53['query'][_0x070e('0x32')]));_0x3feb83[_0x070e('0x33')]=_0x3feb83['attributes']['length']?_0x3feb83[_0x070e('0x33')]:_0x926533[_0x070e('0x31')];if(_0x544b53[_0x070e('0x2e')][_0x070e('0x45')]){_0x3feb83[_0x070e('0x3d')]=[{'all':!![]}];}_0x3feb83=_['merge']({},_0x3feb83,_0x544b53[_0x070e('0x3c')]);return db[_0x070e('0x2a')][_0x070e('0x46')](_0x3feb83)[_0x070e('0x23')](handleEntityNotFound(_0x5d77d9,null))[_0x070e('0x23')](respondWithResult(_0x5d77d9,null))[_0x070e('0x42')](handleError(_0x5d77d9,null));};exports[_0x070e('0x47')]=function(_0x1b5374,_0xd67987){return db[_0x070e('0x2a')][_0x070e('0x47')](_0x1b5374[_0x070e('0x48')],{})[_0x070e('0x23')](respondWithResult(_0xd67987,0xc9))[_0x070e('0x42')](handleError(_0xd67987,null));};exports[_0x070e('0x49')]=function(_0x5e051a,_0x171621){return db[_0x070e('0x2a')][_0x070e('0x46')]({'where':{'id':_0x5e051a[_0x070e('0x43')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x171621,null))[_0x070e('0x23')](removeEntity(_0x171621,null))[_0x070e('0x42')](handleError(_0x171621,null));};exports[_0x070e('0x4a')]=function(_0x1c64d2,_0x5744c5){return db[_0x070e('0x2a')]['describe']()[_0x070e('0x23')](respondWithResult(_0x5744c5,null))[_0x070e('0x42')](handleError(_0x5744c5,null));};exports['update']=function(_0x991d23,_0x130a50){if(_0x991d23[_0x070e('0x48')][_0x070e('0x4b')]){delete _0x991d23[_0x070e('0x48')][_0x070e('0x4b')];}return db[_0x070e('0x2a')]['find']({'where':{'uniqueid':_0x991d23[_0x070e('0x43')]['id'],'UserId':{'$or':[null,_0x991d23['user']['id']]}}})['then'](handleEntityNotFound(_0x130a50,null))[_0x070e('0x23')](saveUpdates(_0x991d23[_0x070e('0x48')],null))[_0x070e('0x23')](respondWithResult(_0x130a50,null))[_0x070e('0x42')](handleError(_0x130a50,null));}; \ No newline at end of file +var _0x9c44=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','create','body','find','describe','uniqueid','user','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'attributes':['id',_0x49c4('0x26'),_0x49c4('0x42'),_0x49c4('0x43')],'model':db[_0x49c4('0x44')],'as':_0x49c4('0x44')}];}return db['VoiceCallReport'][_0x49c4('0x45')](_0x2b2793);})['then'](function(_0x104efb){_0x4f28a2[_0x49c4('0x46')]=_0x104efb;return _0x4f28a2;})[_0x49c4('0x3f')](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x47')](handleError(_0x889909,null));};exports[_0x49c4('0x48')]=function(_0x281b83,_0x4cbd0d){var _0x4d628a={'raw':!![],'where':{'id':_0x281b83[_0x49c4('0x49')]['id']}},_0x20490b={};_0x20490b[_0x49c4('0x31')]=_[_0x49c4('0x2f')](db['VoiceCallReport'][_0x49c4('0x2b')]);_0x20490b[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x281b83[_0x49c4('0x2e')]);_0x20490b[_0x49c4('0x30')]=_[_0x49c4('0x33')](_0x20490b[_0x49c4('0x31')],_0x20490b[_0x49c4('0x2e')]);_0x4d628a[_0x49c4('0x32')]=_['intersection'](_0x20490b[_0x49c4('0x31')],qs['fields'](_0x281b83[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x4d628a[_0x49c4('0x32')]=_0x4d628a[_0x49c4('0x32')][_0x49c4('0x35')]?_0x4d628a['attributes']:_0x20490b[_0x49c4('0x31')];if(_0x281b83[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x4d628a[_0x49c4('0x41')]=[{'all':!![]}];}_0x4d628a=_[_0x49c4('0x3c')]({},_0x4d628a,_0x281b83[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')]['find'](_0x4d628a)[_0x49c4('0x3f')](handleEntityNotFound(_0x4cbd0d,null))['then'](respondWithResult(_0x4cbd0d,null))[_0x49c4('0x47')](handleError(_0x4cbd0d,null));};exports[_0x49c4('0x4a')]=function(_0x29fe65,_0x27adfe){return db[_0x49c4('0x2a')][_0x49c4('0x4a')](_0x29fe65[_0x49c4('0x4b')],{})['then'](respondWithResult(_0x27adfe,0xc9))[_0x49c4('0x47')](handleError(_0x27adfe,null));};exports[_0x49c4('0x23')]=function(_0x4a5c34,_0x1e1ac4){return db[_0x49c4('0x2a')][_0x49c4('0x4c')]({'where':{'id':_0x4a5c34[_0x49c4('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e1ac4,null))['then'](removeEntity(_0x1e1ac4,null))[_0x49c4('0x47')](handleError(_0x1e1ac4,null));};exports['describe']=function(_0x4597c3,_0x1f941f){return db[_0x49c4('0x2a')][_0x49c4('0x4d')]()[_0x49c4('0x3f')](respondWithResult(_0x1f941f,null))[_0x49c4('0x47')](handleError(_0x1f941f,null));};exports[_0x49c4('0x22')]=function(_0x563f0b,_0x1f26c2){if(_0x563f0b[_0x49c4('0x4b')][_0x49c4('0x4e')]){delete _0x563f0b[_0x49c4('0x4b')][_0x49c4('0x4e')];}return db[_0x49c4('0x2a')][_0x49c4('0x4c')]({'where':{'uniqueid':_0x563f0b[_0x49c4('0x49')]['id'],'UserId':{'$or':[null,_0x563f0b[_0x49c4('0x4f')]['id']]}}})[_0x49c4('0x3f')](handleEntityNotFound(_0x1f26c2,null))['then'](saveUpdates(_0x563f0b['body'],null))[_0x49c4('0x3f')](respondWithResult(_0x1f26c2,null))[_0x49c4('0x47')](handleError(_0x1f26c2,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 3643071..4ec6d60 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 _0xcaa6=['define','VoiceCallReport','report_call','uniqueid','util','../../config/logger','api','moment','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0xcaa6,0x10c));var _0x6caa=function(_0x47506e,_0x4bc003){_0x47506e=_0x47506e-0x0;var _0x29061c=_0xcaa6[_0x47506e];return _0x29061c;};'use strict';var _=require('lodash');var util=require(_0x6caa('0x0'));var logger=require(_0x6caa('0x1'))(_0x6caa('0x2'));var moment=require(_0x6caa('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6caa('0x4'));var config=require(_0x6caa('0x5'));var attributes=require(_0x6caa('0x6'));module[_0x6caa('0x7')]=function(_0x2da03a,_0x3d25f3){return _0x2da03a[_0x6caa('0x8')](_0x6caa('0x9'),attributes,{'tableName':_0x6caa('0xa'),'paranoid':![],'indexes':[{'fields':[_0x6caa('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x71e5=['path','rimraf','../../config/environment','exports','define','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x5ccb78,_0x5ddd51){var _0x4fe34c=function(_0x1c608e){while(--_0x1c608e){_0x5ccb78['push'](_0x5ccb78['shift']());}};_0x4fe34c(++_0x5ddd51);}(_0x71e5,0x194));var _0x571e=function(_0x25fa5c,_0x421141){_0x25fa5c=_0x25fa5c-0x0;var _0x1bade2=_0x71e5[_0x25fa5c];return _0x1bade2;};'use strict';var _=require(_0x571e('0x0'));var util=require('util');var logger=require(_0x571e('0x1'))(_0x571e('0x2'));var moment=require(_0x571e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x571e('0x4'));var rimraf=require(_0x571e('0x5'));var config=require(_0x571e('0x6'));var attributes=require('./voiceCallReport.attributes');module[_0x571e('0x7')]=function(_0x9564cc,_0x4907a9){return _0x9564cc[_0x571e('0x8')](_0x571e('0x9'),attributes,{'tableName':_0x571e('0xa'),'paranoid':![],'indexes':[{'fields':[_0x571e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 944ff1b..16815bb 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 _0xc305=['debug','GetVoiceCallReport','CreateVoiceCallReport','create','UpdateVoiceCallReport','body','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','VoiceCallReport','findAll','options','where','attributes','limit','include','model','map'];(function(_0x5e8559,_0x38eea9){var _0x42506f=function(_0x2d3bcc){while(--_0x2d3bcc){_0x5e8559['push'](_0x5e8559['shift']());}};_0x42506f(++_0x38eea9);}(_0xc305,0x7c));var _0x5c30=function(_0x5e8eae,_0x4f81e0){_0x5e8eae=_0x5e8eae-0x0;var _0xdd09cd=_0xc305[_0x5e8eae];return _0xdd09cd;};'use strict';var _=require(_0x5c30('0x0'));var util=require(_0x5c30('0x1'));var moment=require(_0x5c30('0x2'));var BPromise=require(_0x5c30('0x3'));var rs=require(_0x5c30('0x4'));var fs=require('fs');var Redis=require(_0x5c30('0x5'));var db=require(_0x5c30('0x6'))['db'];var utils=require(_0x5c30('0x7'));var logger=require(_0x5c30('0x8'))(_0x5c30('0x9'));var config=require(_0x5c30('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5c30('0xb')][_0x5c30('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193d18,_0x431490,_0x54f159){return new BPromise(function(_0x1d99a3,_0x19062a){return client['request'](_0x193d18,_0x54f159)[_0x5c30('0xd')](function(_0x2d48b3){logger[_0x5c30('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x431490,_0x5c30('0xf'));logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x431490,_0x5c30('0xf'),JSON[_0x5c30('0x10')](_0x2d48b3));if(_0x2d48b3['error']){if(_0x2d48b3[_0x5c30('0x11')][_0x5c30('0x12')]===0x1f4){logger[_0x5c30('0x11')](_0x5c30('0x13'),_0x431490,_0x2d48b3[_0x5c30('0x11')][_0x5c30('0x14')]);return _0x19062a(_0x2d48b3['error']['message']);}logger['error'](_0x5c30('0x13'),_0x431490,_0x2d48b3['error']['message']);return _0x1d99a3(_0x2d48b3['error'][_0x5c30('0x14')]);}else{logger[_0x5c30('0xe')](_0x5c30('0x13'),_0x431490,_0x5c30('0xf'));_0x1d99a3(_0x2d48b3[_0x5c30('0x15')][_0x5c30('0x14')]);}})[_0x5c30('0x16')](function(_0x4fdc11){logger[_0x5c30('0x11')](_0x5c30('0x13'),_0x431490,_0x4fdc11);_0x19062a(_0x4fdc11);});});}exports['GetVoiceCallReport']=function(_0x35beb3){var _0x351380=this;return new Promise(function(_0x2f61a1,_0x2b3430){return db[_0x5c30('0x17')][_0x5c30('0x18')]({'raw':_0x35beb3[_0x5c30('0x19')]?_0x35beb3[_0x5c30('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x35beb3['options']?_0x35beb3[_0x5c30('0x19')][_0x5c30('0x1a')]||null:null,'attributes':_0x35beb3[_0x5c30('0x19')]?_0x35beb3[_0x5c30('0x19')][_0x5c30('0x1b')]||null:null,'limit':_0x35beb3[_0x5c30('0x19')]?_0x35beb3[_0x5c30('0x19')][_0x5c30('0x1c')]||null:null,'include':_0x35beb3[_0x5c30('0x19')]?_0x35beb3[_0x5c30('0x19')][_0x5c30('0x1d')]?_['map'](_0x35beb3['options'][_0x5c30('0x1d')],function(_0x2de776){return{'model':db[_0x2de776[_0x5c30('0x1e')]],'as':_0x2de776['as'],'attributes':_0x2de776[_0x5c30('0x1b')],'include':_0x2de776['include']?_[_0x5c30('0x1f')](_0x2de776[_0x5c30('0x1d')],function(_0x2cf3b5){return{'model':db[_0x2cf3b5[_0x5c30('0x1e')]],'as':_0x2cf3b5['as'],'attributes':_0x2cf3b5[_0x5c30('0x1b')],'include':_0x2cf3b5['include']?_[_0x5c30('0x1f')](_0x2cf3b5[_0x5c30('0x1d')],function(_0x257475){return{'model':db[_0x257475['model']],'as':_0x257475['as'],'attributes':_0x257475[_0x5c30('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16d00a){logger[_0x5c30('0xe')]('GetVoiceCallReport',_0x35beb3);logger[_0x5c30('0x20')](_0x5c30('0x21'),_0x35beb3,JSON[_0x5c30('0x10')](_0x16d00a));_0x2f61a1(_0x16d00a);})[_0x5c30('0x16')](function(_0x2865ab){logger[_0x5c30('0x11')](_0x5c30('0x21'),_0x2865ab[_0x5c30('0x14')],_0x35beb3);_0x2b3430(_0x351380[_0x5c30('0x11')](0x1f4,_0x2865ab[_0x5c30('0x14')]));});});};exports[_0x5c30('0x22')]=function(_0x2da1f9){var _0x2c0c51=this;return new Promise(function(_0x145275,_0x4e26f8){return db['VoiceCallReport'][_0x5c30('0x23')](_0x2da1f9['body'],{'raw':_0x2da1f9[_0x5c30('0x19')]?_0x2da1f9[_0x5c30('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x5c30('0xd')](function(_0x347412){logger[_0x5c30('0xe')](_0x5c30('0x22'),_0x2da1f9);logger[_0x5c30('0x20')](_0x5c30('0x22'),_0x2da1f9,JSON[_0x5c30('0x10')](_0x347412));_0x145275(_0x347412);})[_0x5c30('0x16')](function(_0x1885b3){logger[_0x5c30('0x11')](_0x5c30('0x22'),_0x1885b3[_0x5c30('0x14')],_0x2da1f9);_0x4e26f8(_0x2c0c51[_0x5c30('0x11')](0x1f4,_0x1885b3[_0x5c30('0x14')]));});});};exports[_0x5c30('0x24')]=function(_0x41f268){var _0x12a780=this;return new Promise(function(_0x2a7d5f,_0x35f498){return db['VoiceCallReport']['update'](_0x41f268[_0x5c30('0x25')],{'raw':_0x41f268[_0x5c30('0x19')]?_0x41f268[_0x5c30('0x19')][_0x5c30('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41f268[_0x5c30('0x19')]?_0x41f268[_0x5c30('0x19')][_0x5c30('0x1a')]||null:null,'attributes':_0x41f268[_0x5c30('0x19')]?_0x41f268[_0x5c30('0x19')]['attributes']||null:null,'limit':_0x41f268['options']?_0x41f268[_0x5c30('0x19')][_0x5c30('0x1c')]||null:null})[_0x5c30('0xd')](function(_0x175117){logger[_0x5c30('0xe')]('UpdateVoiceCallReport',_0x41f268);logger[_0x5c30('0x20')](_0x5c30('0x24'),_0x41f268,JSON[_0x5c30('0x10')](_0x175117));_0x2a7d5f(_0x175117);})[_0x5c30('0x16')](function(_0x2638f6){logger[_0x5c30('0x11')](_0x5c30('0x24'),_0x2638f6['message'],_0x41f268);_0x35f498(_0x12a780[_0x5c30('0x11')](0x1f4,_0x2638f6[_0x5c30('0x14')]));});});}; \ No newline at end of file +var _0x977e=['GetVoiceCallReport','VoiceCallReport','options','where','limit','include','attributes','map','model','CreateVoiceCallReport','create','raw','update','UpdateVoiceCallReport','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','catch'];(function(_0x330aea,_0x2890bf){var _0x2fc360=function(_0x330701){while(--_0x330701){_0x330aea['push'](_0x330aea['shift']());}};_0x2fc360(++_0x2890bf);}(_0x977e,0x1c8));var _0xe977=function(_0x8c4b53,_0x52cace){_0x8c4b53=_0x8c4b53-0x0;var _0x164404=_0x977e[_0x8c4b53];return _0x164404;};'use strict';var _=require(_0xe977('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe977('0x1'));var rs=require(_0xe977('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe977('0x3'))['db'];var utils=require(_0xe977('0x4'));var logger=require(_0xe977('0x5'))(_0xe977('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe977('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x919d31,_0x1b816c,_0x572470){return new BPromise(function(_0x262d33,_0x5d30a8){return client[_0xe977('0x8')](_0x919d31,_0x572470)[_0xe977('0x9')](function(_0xafa46e){logger[_0xe977('0xa')]('VoiceCallReport,\x20%s,\x20%s',_0x1b816c,_0xe977('0xb'));logger[_0xe977('0xc')](_0xe977('0xd'),_0x1b816c,_0xe977('0xb'),JSON[_0xe977('0xe')](_0xafa46e));if(_0xafa46e[_0xe977('0xf')]){if(_0xafa46e[_0xe977('0xf')]['code']===0x1f4){logger[_0xe977('0xf')](_0xe977('0x10'),_0x1b816c,_0xafa46e['error']['message']);return _0x5d30a8(_0xafa46e[_0xe977('0xf')]['message']);}logger[_0xe977('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x1b816c,_0xafa46e['error'][_0xe977('0x11')]);return _0x262d33(_0xafa46e[_0xe977('0xf')][_0xe977('0x11')]);}else{logger['info'](_0xe977('0x10'),_0x1b816c,_0xe977('0xb'));_0x262d33(_0xafa46e[_0xe977('0x12')][_0xe977('0x11')]);}})[_0xe977('0x13')](function(_0x18152c){logger[_0xe977('0xf')](_0xe977('0x10'),_0x1b816c,_0x18152c);_0x5d30a8(_0x18152c);});});}exports[_0xe977('0x14')]=function(_0xccf31){var _0x1bb7c7=this;return new Promise(function(_0xa365e4,_0x1a8c02){return db[_0xe977('0x15')]['findAll']({'raw':_0xccf31[_0xe977('0x16')]?_0xccf31[_0xe977('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xccf31[_0xe977('0x16')]?_0xccf31[_0xe977('0x16')][_0xe977('0x17')]||null:null,'attributes':_0xccf31[_0xe977('0x16')]?_0xccf31[_0xe977('0x16')]['attributes']||null:null,'limit':_0xccf31[_0xe977('0x16')]?_0xccf31[_0xe977('0x16')][_0xe977('0x18')]||null:null,'include':_0xccf31[_0xe977('0x16')]?_0xccf31[_0xe977('0x16')][_0xe977('0x19')]?_['map'](_0xccf31[_0xe977('0x16')][_0xe977('0x19')],function(_0x255b90){return{'model':db[_0x255b90['model']],'as':_0x255b90['as'],'attributes':_0x255b90[_0xe977('0x1a')],'include':_0x255b90[_0xe977('0x19')]?_[_0xe977('0x1b')](_0x255b90[_0xe977('0x19')],function(_0x32ad99){return{'model':db[_0x32ad99[_0xe977('0x1c')]],'as':_0x32ad99['as'],'attributes':_0x32ad99[_0xe977('0x1a')],'include':_0x32ad99[_0xe977('0x19')]?_['map'](_0x32ad99[_0xe977('0x19')],function(_0x18bdf3){return{'model':db[_0x18bdf3[_0xe977('0x1c')]],'as':_0x18bdf3['as'],'attributes':_0x18bdf3[_0xe977('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe977('0x9')](function(_0x4d7b18){logger[_0xe977('0xa')]('GetVoiceCallReport',_0xccf31);logger[_0xe977('0xc')](_0xe977('0x14'),_0xccf31,JSON['stringify'](_0x4d7b18));_0xa365e4(_0x4d7b18);})[_0xe977('0x13')](function(_0x275e7e){logger[_0xe977('0xf')](_0xe977('0x14'),_0x275e7e['message'],_0xccf31);_0x1a8c02(_0x1bb7c7[_0xe977('0xf')](0x1f4,_0x275e7e[_0xe977('0x11')]));});});};exports[_0xe977('0x1d')]=function(_0x193ff7){var _0x3c0ec9=this;return new Promise(function(_0x417c37,_0x38deec){return db['VoiceCallReport'][_0xe977('0x1e')](_0x193ff7['body'],{'raw':_0x193ff7[_0xe977('0x16')]?_0x193ff7[_0xe977('0x16')][_0xe977('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x3a5c69){logger[_0xe977('0xa')](_0xe977('0x1d'),_0x193ff7);logger[_0xe977('0xc')](_0xe977('0x1d'),_0x193ff7,JSON['stringify'](_0x3a5c69));_0x417c37(_0x3a5c69);})[_0xe977('0x13')](function(_0x23cfb5){logger[_0xe977('0xf')](_0xe977('0x1d'),_0x23cfb5[_0xe977('0x11')],_0x193ff7);_0x38deec(_0x3c0ec9['error'](0x1f4,_0x23cfb5[_0xe977('0x11')]));});});};exports['UpdateVoiceCallReport']=function(_0x15577e){var _0x4e8255=this;return new Promise(function(_0x19b915,_0x41c581){return db['VoiceCallReport'][_0xe977('0x20')](_0x15577e['body'],{'raw':_0x15577e[_0xe977('0x16')]?_0x15577e[_0xe977('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15577e['options']?_0x15577e[_0xe977('0x16')]['where']||null:null,'attributes':_0x15577e[_0xe977('0x16')]?_0x15577e[_0xe977('0x16')][_0xe977('0x1a')]||null:null,'limit':_0x15577e[_0xe977('0x16')]?_0x15577e[_0xe977('0x16')][_0xe977('0x18')]||null:null})[_0xe977('0x9')](function(_0x3f0e00){logger[_0xe977('0xa')]('UpdateVoiceCallReport',_0x15577e);logger[_0xe977('0xc')](_0xe977('0x21'),_0x15577e,JSON['stringify'](_0x3f0e00));_0x19b915(_0x3f0e00);})[_0xe977('0x13')](function(_0x229692){logger[_0xe977('0xf')](_0xe977('0x21'),_0x229692[_0xe977('0x11')],_0x15577e);_0x41c581(_0x4e8255[_0xe977('0xf')](0x1f4,_0x229692['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 560aa15..efcef4d 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 _0x4843=['isAuthenticated','create','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','index','/:id','show','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4843,0x138));var _0x3484=function(_0x29f641,_0x1fa806){_0x29f641=_0x29f641-0x0;var _0x7130a1=_0x4843[_0x29f641];return _0x7130a1;};'use strict';var multer=require(_0x3484('0x0'));var util=require('util');var path=require(_0x3484('0x1'));var timeout=require(_0x3484('0x2'));var express=require(_0x3484('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3484('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3484('0x5'));var controller=require(_0x3484('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x3484('0x7')]);router['get'](_0x3484('0x8'),auth['isAuthenticated'](),controller[_0x3484('0x9')]);router[_0x3484('0xa')]('/',auth[_0x3484('0xb')](),controller[_0x3484('0xc')]);router[_0x3484('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3484('0xe')]);router['delete'](_0x3484('0x8'),auth[_0x3484('0xb')](),controller[_0x3484('0xf')]);module[_0x3484('0x10')]=router; \ No newline at end of file +var _0x441f=['update','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','create'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x441f,0x16a));var _0xf441=function(_0x2fa457,_0x7021df){_0x2fa457=_0x2fa457-0x0;var _0x4f250a=_0x441f[_0x2fa457];return _0x4f250a;};'use strict';var multer=require(_0xf441('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf441('0x1'));var router=express[_0xf441('0x2')]();var fs_extra=require(_0xf441('0x3'));var auth=require(_0xf441('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf441('0x5'));var controller=require(_0xf441('0x6'));router[_0xf441('0x7')]('/',auth['isAuthenticated'](),controller[_0xf441('0x8')]);router['get'](_0xf441('0x9'),auth[_0xf441('0xa')](),controller[_0xf441('0xb')]);router['post']('/',auth[_0xf441('0xa')](),controller[_0xf441('0xc')]);router['put'](_0xf441('0x9'),auth['isAuthenticated'](),controller[_0xf441('0xd')]);router['delete'](_0xf441('0x9'),auth[_0xf441('0xa')](),controller[_0xf441('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 3bbe6d4..6e2133f 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 _0xd417=['BOOLEAN','exports','STRING','setDataValue','options','join','getDataValue','split'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd417,0x91));var _0x7d41=function(_0x1d5c7f,_0x103ea4){_0x1d5c7f=_0x1d5c7f-0x0;var _0x446be7=_0xd417[_0x1d5c7f];return _0x446be7;};'use strict';var Sequelize=require('sequelize');module[_0x7d41('0x0')]={'name':{'type':Sequelize[_0x7d41('0x1')]},'prefix':{'type':Sequelize[_0x7d41('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x7d41('0x1')],'set':function(_0xe204f6){this[_0x7d41('0x2')](_0x7d41('0x3'),_0xe204f6?_0xe204f6[_0x7d41('0x4')](''):[]);},'get':function(){return this[_0x7d41('0x5')]('options')?this[_0x7d41('0x5')](_0x7d41('0x3'))[_0x7d41('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x7d41('0x1')]},'record':{'type':Sequelize[_0x7d41('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x7d41('0x1')]},'description':{'type':Sequelize[_0x7d41('0x1')]}}; \ No newline at end of file +var _0x218e=['options','join','getDataValue','BOOLEAN','exports','STRING','setDataValue'];(function(_0x1a4091,_0x4c0128){var _0x44af29=function(_0xddaa44){while(--_0xddaa44){_0x1a4091['push'](_0x1a4091['shift']());}};_0x44af29(++_0x4c0128);}(_0x218e,0xd6));var _0xe218=function(_0x66e968,_0x2dcbbd){_0x66e968=_0x66e968-0x0;var _0x35fb35=_0x218e[_0x66e968];return _0x35fb35;};'use strict';var Sequelize=require('sequelize');module[_0xe218('0x0')]={'name':{'type':Sequelize[_0xe218('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x4eabb7){this[_0xe218('0x2')](_0xe218('0x3'),_0x4eabb7?_0x4eabb7[_0xe218('0x4')](''):[]);},'get':function(){return this[_0xe218('0x5')](_0xe218('0x3'))?this[_0xe218('0x5')](_0xe218('0x3'))['split'](''):[];}},'auth':{'type':Sequelize[_0xe218('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0xe218('0x1')]},'record':{'type':Sequelize[_0xe218('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe218('0x1')]},'description':{'type':Sequelize[_0xe218('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 3ae99d8..09697df 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 _0xa92a=['apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','params','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit'];(function(_0x13e79a,_0x305aaa){var _0x24f0ec=function(_0x2bd331){while(--_0x2bd331){_0x13e79a['push'](_0x13e79a['shift']());}};_0x24f0ec(++_0x305aaa);}(_0xa92a,0x1da));var _0xaa92=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0xa92a[_0x36909d];return _0x1fd29d;};'use strict';var emlformat=require(_0xaa92('0x0'));var rimraf=require(_0xaa92('0x1'));var zipdir=require(_0xaa92('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa92('0x3'));var moment=require(_0xaa92('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaa92('0x5'));var util=require(_0xaa92('0x6'));var path=require(_0xaa92('0x7'));var sox=require(_0xaa92('0x8'));var csv=require('to-csv');var ejs=require(_0xaa92('0x9'));var fs=require('fs');var fs_extra=require(_0xaa92('0xa'));var _=require('lodash');var squel=require(_0xaa92('0xb'));var crypto=require(_0xaa92('0xc'));var jsforce=require(_0xaa92('0xd'));var deskjs=require(_0xaa92('0xe'));var toCsv=require(_0xaa92('0xf'));var querystring=require(_0xaa92('0x10'));var Papa=require(_0xaa92('0x11'));var Redis=require(_0xaa92('0x12'));var authService=require(_0xaa92('0x13'));var qs=require(_0xaa92('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa92('0x15'));var logger=require(_0xaa92('0x16'))(_0xaa92('0x17'));var utils=require(_0xaa92('0x18'));var config=require(_0xaa92('0x19'));var licenseUtil=require(_0xaa92('0x1a'));var db=require(_0xaa92('0x1b'))['db'];function respondWithStatusCode(_0x575064,_0x553045){_0x553045=_0x553045||0xcc;return function(_0x11c200){if(_0x11c200){return _0x575064[_0xaa92('0x1c')](_0x553045);}return _0x575064['status'](_0x553045)[_0xaa92('0x1d')]();};}function respondWithResult(_0x2bbee5,_0x5d0046){_0x5d0046=_0x5d0046||0xc8;return function(_0x41df73){if(_0x41df73){return _0x2bbee5[_0xaa92('0x1e')](_0x5d0046)[_0xaa92('0x1f')](_0x41df73);}};}function respondWithFilteredResult(_0x50ba24,_0x2b487e){return function(_0xf61e5a){if(_0xf61e5a){var _0x5bd459=typeof _0x2b487e[_0xaa92('0x20')]==='undefined'&&typeof _0x2b487e['limit']===_0xaa92('0x21');var _0xc00c81=_0xf61e5a[_0xaa92('0x22')];var _0x433887=_0x5bd459?0x0:_0x2b487e[_0xaa92('0x20')];var _0x37c663=_0x5bd459?_0xf61e5a[_0xaa92('0x22')]:_0x2b487e[_0xaa92('0x20')]+_0x2b487e[_0xaa92('0x23')];var _0x26075b;if(_0x37c663>=_0xc00c81){_0x37c663=_0xc00c81;_0x26075b=0xc8;}else{_0x26075b=0xce;}_0x50ba24[_0xaa92('0x1e')](_0x26075b);return _0x50ba24['set']('Content-Range',_0x433887+'-'+_0x37c663+'/'+_0xc00c81)[_0xaa92('0x1f')](_0xf61e5a);}return null;};}function patchUpdates(_0x204229){return function(_0x36994a){try{jsonpatch[_0xaa92('0x24')](_0x36994a,_0x204229,!![]);}catch(_0x24d4a0){return BPromise[_0xaa92('0x25')](_0x24d4a0);}return _0x36994a[_0xaa92('0x26')]();};}function saveUpdates(_0x100d53,_0x40b124){return function(_0x220518){if(_0x220518){return _0x220518['update'](_0x100d53)[_0xaa92('0x27')](function(_0x355534){return _0x355534;});}return null;};}function removeEntity(_0x5b0aca,_0x3d047b){return function(_0x3dcb12){if(_0x3dcb12){return _0x3dcb12[_0xaa92('0x28')]()[_0xaa92('0x27')](function(){var _0x16c518=_0x3dcb12[_0xaa92('0x29')]({'plain':!![]});var _0x11bd4f=_0xaa92('0x2a');return db[_0xaa92('0x2b')]['destroy']({'where':{'type':_0x11bd4f,'resourceId':_0x16c518['id']}})[_0xaa92('0x27')](function(){return _0x3dcb12;});})[_0xaa92('0x27')](function(){_0x5b0aca['status'](0xcc)[_0xaa92('0x1d')]();});}};}function handleEntityNotFound(_0x2c0b2d,_0x4e8362){return function(_0x461040){if(!_0x461040){_0x2c0b2d['sendStatus'](0x194);}return _0x461040;};}function handleError(_0x1c9c51,_0x44d5df){_0x44d5df=_0x44d5df||0x1f4;return function(_0x1b3ec6){logger[_0xaa92('0x2c')](_0x1b3ec6[_0xaa92('0x2d')]);if(_0x1b3ec6[_0xaa92('0x2e')]){delete _0x1b3ec6['name'];}_0x1c9c51[_0xaa92('0x1e')](_0x44d5df)[_0xaa92('0x2f')](_0x1b3ec6);};}exports[_0xaa92('0x30')]=function(_0x36b8e3,_0xfdccf9){var _0xb57b9a={},_0x2c4a8e={},_0x52aa5c={'count':0x0,'rows':[]};var _0x47efee=_[_0xaa92('0x31')](db[_0xaa92('0x32')][_0xaa92('0x33')],function(_0x715332){return{'name':_0x715332[_0xaa92('0x34')],'type':_0x715332['type']['key']};});_0x2c4a8e[_0xaa92('0x35')]=_[_0xaa92('0x31')](_0x47efee,_0xaa92('0x2e'));_0x2c4a8e[_0xaa92('0x36')]=_[_0xaa92('0x37')](_0x36b8e3[_0xaa92('0x36')]);_0x2c4a8e[_0xaa92('0x38')]=_[_0xaa92('0x39')](_0x2c4a8e[_0xaa92('0x35')],_0x2c4a8e[_0xaa92('0x36')]);_0xb57b9a['attributes']=_[_0xaa92('0x39')](_0x2c4a8e[_0xaa92('0x35')],qs['fields'](_0x36b8e3[_0xaa92('0x36')]['fields']));_0xb57b9a['attributes']=_0xb57b9a[_0xaa92('0x3a')][_0xaa92('0x3b')]?_0xb57b9a['attributes']:_0x2c4a8e[_0xaa92('0x35')];if(!_0x36b8e3[_0xaa92('0x36')][_0xaa92('0x3c')](_0xaa92('0x3d'))){_0xb57b9a[_0xaa92('0x23')]=qs['limit'](_0x36b8e3['query'][_0xaa92('0x23')]);_0xb57b9a[_0xaa92('0x20')]=qs[_0xaa92('0x20')](_0x36b8e3[_0xaa92('0x36')]['offset']);}_0xb57b9a[_0xaa92('0x3e')]=qs[_0xaa92('0x3f')](_0x36b8e3[_0xaa92('0x36')][_0xaa92('0x3f')]);_0xb57b9a['where']=qs[_0xaa92('0x38')](_['pick'](_0x36b8e3['query'],_0x2c4a8e[_0xaa92('0x38')]),_0x47efee);if(_0x36b8e3[_0xaa92('0x36')][_0xaa92('0x40')]){_0xb57b9a['where']=_[_0xaa92('0x41')](_0xb57b9a[_0xaa92('0x42')],{'$or':_[_0xaa92('0x31')](_0x47efee,function(_0x5a9cbe){if(_0x5a9cbe['type']!==_0xaa92('0x43')){var _0x3ac993={};_0x3ac993[_0x5a9cbe[_0xaa92('0x2e')]]={'$like':'%'+_0x36b8e3[_0xaa92('0x36')]['filter']+'%'};return _0x3ac993;}})});}_0xb57b9a=_[_0xaa92('0x41')]({},_0xb57b9a,_0x36b8e3[_0xaa92('0x44')]);var _0x3d2428={'where':_0xb57b9a['where']};return db[_0xaa92('0x32')][_0xaa92('0x22')](_0x3d2428)[_0xaa92('0x27')](function(_0x4f2bb8){_0x52aa5c[_0xaa92('0x22')]=_0x4f2bb8;if(_0x36b8e3[_0xaa92('0x36')][_0xaa92('0x45')]){_0xb57b9a[_0xaa92('0x46')]=[{'all':!![]}];}return db[_0xaa92('0x32')]['findAll'](_0xb57b9a);})[_0xaa92('0x27')](function(_0x825ec8){_0x52aa5c[_0xaa92('0x47')]=_0x825ec8;return _0x52aa5c;})[_0xaa92('0x27')](respondWithFilteredResult(_0xfdccf9,_0xb57b9a))[_0xaa92('0x48')](handleError(_0xfdccf9,null));};exports['show']=function(_0xad233a,_0x33be0e){var _0x451372={'raw':![],'where':{'id':_0xad233a[_0xaa92('0x49')]['id']}},_0x442d0f={};_0x442d0f[_0xaa92('0x35')]=_[_0xaa92('0x37')](db[_0xaa92('0x32')][_0xaa92('0x33')]);_0x442d0f[_0xaa92('0x36')]=_[_0xaa92('0x37')](_0xad233a[_0xaa92('0x36')]);_0x442d0f[_0xaa92('0x38')]=_['intersection'](_0x442d0f['model'],_0x442d0f[_0xaa92('0x36')]);_0x451372[_0xaa92('0x3a')]=_[_0xaa92('0x39')](_0x442d0f['model'],qs[_0xaa92('0x4a')](_0xad233a[_0xaa92('0x36')][_0xaa92('0x4a')]));_0x451372[_0xaa92('0x3a')]=_0x451372['attributes'][_0xaa92('0x3b')]?_0x451372[_0xaa92('0x3a')]:_0x442d0f[_0xaa92('0x35')];if(_0xad233a[_0xaa92('0x36')][_0xaa92('0x45')]){_0x451372['include']=[{'all':!![]}];}_0x451372=_[_0xaa92('0x41')]({},_0x451372,_0xad233a[_0xaa92('0x44')]);return db['VoiceChanSpy'][_0xaa92('0x4b')](_0x451372)['then'](handleEntityNotFound(_0x33be0e,null))[_0xaa92('0x27')](respondWithResult(_0x33be0e,null))['catch'](handleError(_0x33be0e,null));};exports['create']=function(_0x46fa57,_0x301ad3){return db[_0xaa92('0x32')][_0xaa92('0x4c')](_0x46fa57['body'],{})[_0xaa92('0x27')](function(_0x765ad8){var _0x33e3d0=_0x46fa57['user']['get']({'plain':!![]});if(!_0x33e3d0)throw new Error(_0xaa92('0x4d'));if(_0x33e3d0[_0xaa92('0x4e')]==='user'){var _0x2f5a32=_0x765ad8['get']({'plain':!![]});var _0x5ddc29='ChanSpies';return db[_0xaa92('0x4f')]['find']({'where':{'name':_0x5ddc29,'userProfileId':_0x33e3d0[_0xaa92('0x50')]},'raw':!![]})[_0xaa92('0x27')](function(_0x47dae5){if(_0x47dae5&&_0x47dae5[_0xaa92('0x51')]===0x0){return db[_0xaa92('0x2b')][_0xaa92('0x4c')]({'name':_0x2f5a32[_0xaa92('0x2e')],'resourceId':_0x2f5a32['id'],'type':_0x47dae5[_0xaa92('0x2e')],'sectionId':_0x47dae5['id']},{})['then'](function(){return _0x765ad8;});}else{return _0x765ad8;}})[_0xaa92('0x48')](function(_0x1b61ba){logger[_0xaa92('0x2c')](_0xaa92('0x52'),_0x1b61ba);throw _0x1b61ba;});}return _0x765ad8;})['then'](respondWithResult(_0x301ad3,0xc9))[_0xaa92('0x48')](handleError(_0x301ad3,null));};exports[_0xaa92('0x53')]=function(_0x503847,_0x32632b){if(_0x503847[_0xaa92('0x54')]['id']){delete _0x503847['body']['id'];}return db[_0xaa92('0x32')]['find']({'where':{'id':_0x503847[_0xaa92('0x49')]['id']}})['then'](handleEntityNotFound(_0x32632b,null))[_0xaa92('0x27')](saveUpdates(_0x503847[_0xaa92('0x54')],null))[_0xaa92('0x27')](respondWithResult(_0x32632b,null))[_0xaa92('0x48')](handleError(_0x32632b,null));};exports['destroy']=function(_0x15828a,_0xacefe1){return db[_0xaa92('0x32')]['find']({'where':{'id':_0x15828a[_0xaa92('0x49')]['id']}})[_0xaa92('0x27')](handleEntityNotFound(_0xacefe1,null))[_0xaa92('0x27')](removeEntity(_0xacefe1,null))[_0xaa92('0x48')](handleError(_0xacefe1,null));}; \ No newline at end of file +var _0xd7fd=['query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','rawAttributes','length','catch','create','body','user','role','get','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','apply','reject','save','then','UserProfileResource','end','error','name','index','VoiceChanSpy','fieldName','type','key','model','map'];(function(_0x48f485,_0x4c5aea){var _0x46cb65=function(_0x12bb60){while(--_0x12bb60){_0x48f485['push'](_0x48f485['shift']());}};_0x46cb65(++_0x4c5aea);}(_0xd7fd,0x161));var _0xdd7f=function(_0x1ebb10,_0x156b3e){_0x1ebb10=_0x1ebb10-0x0;var _0x20d709=_0xd7fd[_0x1ebb10];return _0x20d709;};'use strict';var emlformat=require(_0xdd7f('0x0'));var rimraf=require(_0xdd7f('0x1'));var zipdir=require(_0xdd7f('0x2'));var jsonpatch=require(_0xdd7f('0x3'));var rp=require(_0xdd7f('0x4'));var moment=require(_0xdd7f('0x5'));var BPromise=require(_0xdd7f('0x6'));var Mustache=require(_0xdd7f('0x7'));var util=require(_0xdd7f('0x8'));var path=require(_0xdd7f('0x9'));var sox=require('sox');var csv=require(_0xdd7f('0xa'));var ejs=require(_0xdd7f('0xb'));var fs=require('fs');var fs_extra=require(_0xdd7f('0xc'));var _=require(_0xdd7f('0xd'));var squel=require(_0xdd7f('0xe'));var crypto=require(_0xdd7f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xdd7f('0x10'));var toCsv=require('to-csv');var querystring=require(_0xdd7f('0x11'));var Papa=require(_0xdd7f('0x12'));var Redis=require(_0xdd7f('0x13'));var authService=require(_0xdd7f('0x14'));var qs=require(_0xdd7f('0x15'));var as=require(_0xdd7f('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdd7f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdd7f('0x18'));var db=require(_0xdd7f('0x19'))['db'];function respondWithStatusCode(_0x39d441,_0xe06002){_0xe06002=_0xe06002||0xcc;return function(_0x35ca4c){if(_0x35ca4c){return _0x39d441[_0xdd7f('0x1a')](_0xe06002);}return _0x39d441['status'](_0xe06002)['end']();};}function respondWithResult(_0x5bf7bd,_0x209482){_0x209482=_0x209482||0xc8;return function(_0x1a4253){if(_0x1a4253){return _0x5bf7bd[_0xdd7f('0x1b')](_0x209482)['json'](_0x1a4253);}};}function respondWithFilteredResult(_0x162e39,_0x389d0c){return function(_0x28ad76){if(_0x28ad76){var _0x42b5d7=typeof _0x389d0c[_0xdd7f('0x1c')]==='undefined'&&typeof _0x389d0c[_0xdd7f('0x1d')]==='undefined';var _0x332e3e=_0x28ad76[_0xdd7f('0x1e')];var _0xc0b934=_0x42b5d7?0x0:_0x389d0c[_0xdd7f('0x1c')];var _0x4268de=_0x42b5d7?_0x28ad76[_0xdd7f('0x1e')]:_0x389d0c[_0xdd7f('0x1c')]+_0x389d0c[_0xdd7f('0x1d')];var _0x2cd644;if(_0x4268de>=_0x332e3e){_0x4268de=_0x332e3e;_0x2cd644=0xc8;}else{_0x2cd644=0xce;}_0x162e39['status'](_0x2cd644);return _0x162e39[_0xdd7f('0x1f')]('Content-Range',_0xc0b934+'-'+_0x4268de+'/'+_0x332e3e)['json'](_0x28ad76);}return null;};}function patchUpdates(_0x4746b2){return function(_0x5dc600){try{jsonpatch[_0xdd7f('0x20')](_0x5dc600,_0x4746b2,!![]);}catch(_0x25f34c){return BPromise[_0xdd7f('0x21')](_0x25f34c);}return _0x5dc600[_0xdd7f('0x22')]();};}function saveUpdates(_0x1062a2,_0xf787f4){return function(_0x4326a1){if(_0x4326a1){return _0x4326a1['update'](_0x1062a2)[_0xdd7f('0x23')](function(_0x6d9b0b){return _0x6d9b0b;});}return null;};}function removeEntity(_0x156684,_0x249a92){return function(_0x299864){if(_0x299864){return _0x299864['destroy']()[_0xdd7f('0x23')](function(){var _0xe55936=_0x299864['get']({'plain':!![]});var _0x13082e='ChanSpies';return db[_0xdd7f('0x24')]['destroy']({'where':{'type':_0x13082e,'resourceId':_0xe55936['id']}})['then'](function(){return _0x299864;});})['then'](function(){_0x156684[_0xdd7f('0x1b')](0xcc)[_0xdd7f('0x25')]();});}};}function handleEntityNotFound(_0x211857,_0xd4a41b){return function(_0x25a560){if(!_0x25a560){_0x211857['sendStatus'](0x194);}return _0x25a560;};}function handleError(_0x74b20,_0x31a835){_0x31a835=_0x31a835||0x1f4;return function(_0x259cf2){logger[_0xdd7f('0x26')](_0x259cf2['stack']);if(_0x259cf2[_0xdd7f('0x27')]){delete _0x259cf2['name'];}_0x74b20[_0xdd7f('0x1b')](_0x31a835)['send'](_0x259cf2);};}exports[_0xdd7f('0x28')]=function(_0x32dae8,_0x1373a7){var _0x5e6d6c={},_0x1003c5={},_0x1c58fe={'count':0x0,'rows':[]};var _0x361845=_['map'](db[_0xdd7f('0x29')]['rawAttributes'],function(_0x1b7db5){return{'name':_0x1b7db5[_0xdd7f('0x2a')],'type':_0x1b7db5[_0xdd7f('0x2b')][_0xdd7f('0x2c')]};});_0x1003c5[_0xdd7f('0x2d')]=_[_0xdd7f('0x2e')](_0x361845,_0xdd7f('0x27'));_0x1003c5[_0xdd7f('0x2f')]=_[_0xdd7f('0x30')](_0x32dae8[_0xdd7f('0x2f')]);_0x1003c5['filters']=_[_0xdd7f('0x31')](_0x1003c5['model'],_0x1003c5[_0xdd7f('0x2f')]);_0x5e6d6c[_0xdd7f('0x32')]=_[_0xdd7f('0x31')](_0x1003c5[_0xdd7f('0x2d')],qs[_0xdd7f('0x33')](_0x32dae8[_0xdd7f('0x2f')][_0xdd7f('0x33')]));_0x5e6d6c[_0xdd7f('0x32')]=_0x5e6d6c[_0xdd7f('0x32')]['length']?_0x5e6d6c[_0xdd7f('0x32')]:_0x1003c5[_0xdd7f('0x2d')];if(!_0x32dae8[_0xdd7f('0x2f')][_0xdd7f('0x34')]('nolimit')){_0x5e6d6c[_0xdd7f('0x1d')]=qs[_0xdd7f('0x1d')](_0x32dae8[_0xdd7f('0x2f')]['limit']);_0x5e6d6c[_0xdd7f('0x1c')]=qs['offset'](_0x32dae8[_0xdd7f('0x2f')]['offset']);}_0x5e6d6c[_0xdd7f('0x35')]=qs[_0xdd7f('0x36')](_0x32dae8['query'][_0xdd7f('0x36')]);_0x5e6d6c[_0xdd7f('0x37')]=qs['filters'](_[_0xdd7f('0x38')](_0x32dae8[_0xdd7f('0x2f')],_0x1003c5[_0xdd7f('0x39')]),_0x361845);if(_0x32dae8[_0xdd7f('0x2f')]['filter']){_0x5e6d6c[_0xdd7f('0x37')]=_[_0xdd7f('0x3a')](_0x5e6d6c[_0xdd7f('0x37')],{'$or':_[_0xdd7f('0x2e')](_0x361845,function(_0x2e0b49){if(_0x2e0b49['type']!==_0xdd7f('0x3b')){var _0x46de54={};_0x46de54[_0x2e0b49['name']]={'$like':'%'+_0x32dae8['query'][_0xdd7f('0x3c')]+'%'};return _0x46de54;}})});}_0x5e6d6c=_['merge']({},_0x5e6d6c,_0x32dae8[_0xdd7f('0x3d')]);var _0x13c3b5={'where':_0x5e6d6c[_0xdd7f('0x37')]};return db[_0xdd7f('0x29')][_0xdd7f('0x1e')](_0x13c3b5)[_0xdd7f('0x23')](function(_0x245459){_0x1c58fe[_0xdd7f('0x1e')]=_0x245459;if(_0x32dae8[_0xdd7f('0x2f')][_0xdd7f('0x3e')]){_0x5e6d6c[_0xdd7f('0x3f')]=[{'all':!![]}];}return db[_0xdd7f('0x29')][_0xdd7f('0x40')](_0x5e6d6c);})['then'](function(_0x57f2a6){_0x1c58fe[_0xdd7f('0x41')]=_0x57f2a6;return _0x1c58fe;})[_0xdd7f('0x23')](respondWithFilteredResult(_0x1373a7,_0x5e6d6c))['catch'](handleError(_0x1373a7,null));};exports['show']=function(_0x3c54b5,_0x1c528b){var _0x10f739={'raw':![],'where':{'id':_0x3c54b5[_0xdd7f('0x42')]['id']}},_0x384ced={};_0x384ced[_0xdd7f('0x2d')]=_[_0xdd7f('0x30')](db[_0xdd7f('0x29')][_0xdd7f('0x43')]);_0x384ced[_0xdd7f('0x2f')]=_[_0xdd7f('0x30')](_0x3c54b5[_0xdd7f('0x2f')]);_0x384ced[_0xdd7f('0x39')]=_[_0xdd7f('0x31')](_0x384ced[_0xdd7f('0x2d')],_0x384ced['query']);_0x10f739[_0xdd7f('0x32')]=_['intersection'](_0x384ced[_0xdd7f('0x2d')],qs[_0xdd7f('0x33')](_0x3c54b5['query'][_0xdd7f('0x33')]));_0x10f739[_0xdd7f('0x32')]=_0x10f739[_0xdd7f('0x32')][_0xdd7f('0x44')]?_0x10f739[_0xdd7f('0x32')]:_0x384ced[_0xdd7f('0x2d')];if(_0x3c54b5[_0xdd7f('0x2f')][_0xdd7f('0x3e')]){_0x10f739['include']=[{'all':!![]}];}_0x10f739=_['merge']({},_0x10f739,_0x3c54b5['options']);return db[_0xdd7f('0x29')]['find'](_0x10f739)[_0xdd7f('0x23')](handleEntityNotFound(_0x1c528b,null))[_0xdd7f('0x23')](respondWithResult(_0x1c528b,null))[_0xdd7f('0x45')](handleError(_0x1c528b,null));};exports[_0xdd7f('0x46')]=function(_0x31db93,_0x1502c7){return db[_0xdd7f('0x29')][_0xdd7f('0x46')](_0x31db93[_0xdd7f('0x47')],{})[_0xdd7f('0x23')](function(_0x3278eb){var _0x4a053b=_0x31db93[_0xdd7f('0x48')]['get']({'plain':!![]});if(!_0x4a053b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a053b[_0xdd7f('0x49')]===_0xdd7f('0x48')){var _0x3ed433=_0x3278eb[_0xdd7f('0x4a')]({'plain':!![]});var _0x39fe51='ChanSpies';return db[_0xdd7f('0x4b')][_0xdd7f('0x4c')]({'where':{'name':_0x39fe51,'userProfileId':_0x4a053b['userProfileId']},'raw':!![]})[_0xdd7f('0x23')](function(_0x4ecfcf){if(_0x4ecfcf&&_0x4ecfcf['autoAssociation']===0x0){return db[_0xdd7f('0x24')][_0xdd7f('0x46')]({'name':_0x3ed433['name'],'resourceId':_0x3ed433['id'],'type':_0x4ecfcf[_0xdd7f('0x27')],'sectionId':_0x4ecfcf['id']},{})[_0xdd7f('0x23')](function(){return _0x3278eb;});}else{return _0x3278eb;}})[_0xdd7f('0x45')](function(_0x1561db){logger[_0xdd7f('0x26')](_0xdd7f('0x4d'),_0x1561db);throw _0x1561db;});}return _0x3278eb;})[_0xdd7f('0x23')](respondWithResult(_0x1502c7,0xc9))[_0xdd7f('0x45')](handleError(_0x1502c7,null));};exports[_0xdd7f('0x4e')]=function(_0x55ee87,_0x1ed176){if(_0x55ee87[_0xdd7f('0x47')]['id']){delete _0x55ee87[_0xdd7f('0x47')]['id'];}return db[_0xdd7f('0x29')]['find']({'where':{'id':_0x55ee87[_0xdd7f('0x42')]['id']}})[_0xdd7f('0x23')](handleEntityNotFound(_0x1ed176,null))[_0xdd7f('0x23')](saveUpdates(_0x55ee87[_0xdd7f('0x47')],null))['then'](respondWithResult(_0x1ed176,null))['catch'](handleError(_0x1ed176,null));};exports[_0xdd7f('0x4f')]=function(_0x2b2fac,_0x18dc4c){return db[_0xdd7f('0x29')]['find']({'where':{'id':_0x2b2fac[_0xdd7f('0x42')]['id']}})['then'](handleEntityNotFound(_0x18dc4c,null))[_0xdd7f('0x23')](removeEntity(_0x18dc4c,null))['catch'](handleError(_0x18dc4c,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 59b0d14..afcc64d 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 _0x8d97=['password','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','concat','internal','User','findAll','agent','then','catch','exports','models','define','length','VoiceExtension','bulkCreate','destroy','util','bluebird','context','from-sip','format','push','merge','Set','CDR(type)=%s','chanspy','MixMonitor','recordingFormat','auth','Authenticate'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8d97,0x82));var _0x78d9=function(_0x765824,_0x26a2f8){_0x765824=_0x765824-0x0;var _0xcb9e18=_0x8d97[_0x765824];return _0xcb9e18;};'use strict';var _=require('lodash');var util=require(_0x78d9('0x0'));var BPromise=require(_0x78d9('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x323f54,_0x1cbdd1,_0x17bfab){var _0xba5b3=0x1;var _0x1b690f=[];var _0x5f4582={'context':_0x1cbdd1[_0x78d9('0x2')]||_0x78d9('0x3'),'exten':util[_0x78d9('0x4')]('%s%s',_0x323f54['prefix'],_0x17bfab),'type':'system','isApp':![],'ChanSpyId':_0x323f54['id'],'UserId':_0x1cbdd1['id']};_0x1b690f[_0x78d9('0x5')](_[_0x78d9('0x6')]({'app':_0x78d9('0x7'),'appdata':util[_0x78d9('0x4')](_0x78d9('0x8'),_0x78d9('0x9')),'priority':_0xba5b3++},_0x5f4582));if(_0x323f54['record']){_0x1b690f[_0x78d9('0x5')](_[_0x78d9('0x6')]({'app':_0x78d9('0xa'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x323f54[_0x78d9('0xb')]),'priority':_0xba5b3++},_0x5f4582));}if(_0x323f54[_0x78d9('0xc')]){_0x1b690f[_0x78d9('0x5')](_[_0x78d9('0x6')]({'app':_0x78d9('0xd'),'appdata':_0x323f54[_0x78d9('0xe')],'priority':_0xba5b3++},_0x5f4582));}_0x1b690f['push'](_[_0x78d9('0x6')]({'app':_0x78d9('0xf'),'appdata':util[_0x78d9('0x4')](_0x78d9('0x10'),_0x1cbdd1[_0x78d9('0x11')],_0x323f54[_0x78d9('0x12')]?_0x323f54[_0x78d9('0x12')][_0x78d9('0x13')](''):''),'priority':_0xba5b3++},_0x5f4582));if(_0x323f54[_0x78d9('0x14')]){_0x1b690f[_0x78d9('0x5')](_[_0x78d9('0x6')]({'app':_0x78d9('0x15'),'priority':_0xba5b3++},_0x5f4582));}return _0x1b690f;};var getChanSpyApplications=function(_0x45934d,_0x3501b5){var _0xf2a81c=[];for(var _0x156981=0x0,_0x1b2f6c=0x1;_0x156981<_0x3501b5['length'];_0x156981++,_0x1b2f6c=0x1){_0xf2a81c=_0xf2a81c[_0x78d9('0x16')](getUserApplications(_0x45934d,_0x3501b5[_0x156981],_0x3501b5[_0x156981][_0x78d9('0x17')]));if(_0x3501b5[_0x156981][_0x78d9('0x17')]!=_0x3501b5[_0x156981][_0x78d9('0x11')]){_0xf2a81c=_0xf2a81c[_0x78d9('0x16')](getUserApplications(_0x45934d,_0x3501b5[_0x156981],_0x3501b5[_0x156981][_0x78d9('0x11')]));}}return _0xf2a81c;};var getChanSpyPromise=function(_0x2d1db8,_0x2969fa){return new BPromise(function(_0x3fc3c2,_0x1e6791){return _0x2d1db8[_0x78d9('0x18')][_0x78d9('0x19')]({'attributes':['id',_0x78d9('0x11'),_0x78d9('0x17')],'where':{'role':_0x78d9('0x1a'),'chanspy':!![]},'raw':!![]})[_0x78d9('0x1b')](function(_0x4df145){if(_0x4df145){return _0x3fc3c2(getChanSpyApplications(_0x2969fa,_0x4df145));}return _0x3fc3c2([]);})[_0x78d9('0x1c')](function(_0x4285d4){_0x1e6791(_0x4285d4);});});};module[_0x78d9('0x1d')]=function(_0x18bb18,_0x4d571f){var _0x34e581=_0x18bb18[_0x78d9('0x1e')];return _0x18bb18[_0x78d9('0x1f')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x30e434,_0x4946a5,_0x47a331){return getChanSpyPromise(_0x34e581,_0x30e434)['then'](function(_0x28b7e1){if(_0x28b7e1&&_0x28b7e1[_0x78d9('0x20')]){return _0x34e581[_0x78d9('0x21')][_0x78d9('0x22')](_0x28b7e1);}})[_0x78d9('0x1b')](function(){_0x47a331();})[_0x78d9('0x1c')](function(_0x4e87cf){_0x47a331(_0x4e87cf);});},'afterUpdate':function(_0x17b928,_0x53a0ab,_0x145c0c){return _0x34e581[_0x78d9('0x21')][_0x78d9('0x23')]({'where':{'ChanSpyId':_0x17b928['id']}})['then'](function(){return getChanSpyPromise(_0x34e581,_0x17b928);})[_0x78d9('0x1b')](function(_0x337816){if(_0x337816&&_0x337816['length']){return _0x34e581['VoiceExtension']['bulkCreate'](_0x337816);}})['then'](function(){_0x145c0c();})[_0x78d9('0x1c')](function(_0xcbb803){_0x145c0c(_0xcbb803);});},'afterDestroy':function(_0x146396,_0x45002a,_0x40a789){return _0x34e581[_0x78d9('0x21')][_0x78d9('0x23')]({'where':{'ChanSpyId':_0x146396['id']}})[_0x78d9('0x1b')](function(){_0x40a789();})[_0x78d9('0x1c')](function(_0x3cb9a9){_0x40a789(_0x3cb9a9);});}}});}; \ No newline at end of file +var _0xf6fb=['Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','bulkCreate','VoiceExtension','destroy','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xf6fb,0x111));var _0xbf6f=function(_0x1423b2,_0x37c23a){_0x1423b2=_0x1423b2-0x0;var _0x3641e5=_0xf6fb[_0x1423b2];return _0x3641e5;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0xbf6f('0x0'));var attributes=require(_0xbf6f('0x1'));var getUserApplications=function(_0x48adc3,_0x270dda,_0x7191f2){var _0x5709b7=0x1;var _0xa3eb6=[];var _0x4f7bc9={'context':_0x270dda[_0xbf6f('0x2')]||_0xbf6f('0x3'),'exten':util[_0xbf6f('0x4')](_0xbf6f('0x5'),_0x48adc3[_0xbf6f('0x6')],_0x7191f2),'type':_0xbf6f('0x7'),'isApp':![],'ChanSpyId':_0x48adc3['id'],'UserId':_0x270dda['id']};_0xa3eb6[_0xbf6f('0x8')](_[_0xbf6f('0x9')]({'app':'Set','appdata':util[_0xbf6f('0x4')](_0xbf6f('0xa'),_0xbf6f('0xb')),'priority':_0x5709b7++},_0x4f7bc9));if(_0x48adc3[_0xbf6f('0xc')]){_0xa3eb6[_0xbf6f('0x8')](_['merge']({'app':'MixMonitor','appdata':util[_0xbf6f('0x4')](_0xbf6f('0xd'),_0x48adc3[_0xbf6f('0xe')]),'priority':_0x5709b7++},_0x4f7bc9));}if(_0x48adc3['auth']){_0xa3eb6[_0xbf6f('0x8')](_['merge']({'app':_0xbf6f('0xf'),'appdata':_0x48adc3[_0xbf6f('0x10')],'priority':_0x5709b7++},_0x4f7bc9));}_0xa3eb6[_0xbf6f('0x8')](_['merge']({'app':_0xbf6f('0x11'),'appdata':util[_0xbf6f('0x4')](_0xbf6f('0x12'),_0x270dda[_0xbf6f('0x13')],_0x48adc3[_0xbf6f('0x14')]?_0x48adc3[_0xbf6f('0x14')]['join'](''):''),'priority':_0x5709b7++},_0x4f7bc9));if(_0x48adc3[_0xbf6f('0xc')]){_0xa3eb6[_0xbf6f('0x8')](_[_0xbf6f('0x9')]({'app':_0xbf6f('0x15'),'priority':_0x5709b7++},_0x4f7bc9));}return _0xa3eb6;};var getChanSpyApplications=function(_0x270ec6,_0x2abe87){var _0x27f90f=[];for(var _0x586f33=0x0,_0x4b2006=0x1;_0x586f33<_0x2abe87[_0xbf6f('0x16')];_0x586f33++,_0x4b2006=0x1){_0x27f90f=_0x27f90f[_0xbf6f('0x17')](getUserApplications(_0x270ec6,_0x2abe87[_0x586f33],_0x2abe87[_0x586f33][_0xbf6f('0x18')]));if(_0x2abe87[_0x586f33]['internal']!=_0x2abe87[_0x586f33]['name']){_0x27f90f=_0x27f90f[_0xbf6f('0x17')](getUserApplications(_0x270ec6,_0x2abe87[_0x586f33],_0x2abe87[_0x586f33][_0xbf6f('0x13')]));}}return _0x27f90f;};var getChanSpyPromise=function(_0x1056f7,_0x22e1e9){return new BPromise(function(_0x18fc9d,_0x527407){return _0x1056f7['User'][_0xbf6f('0x19')]({'attributes':['id','name',_0xbf6f('0x18')],'where':{'role':_0xbf6f('0x1a'),'chanspy':!![]},'raw':!![]})[_0xbf6f('0x1b')](function(_0x4e71e9){if(_0x4e71e9){return _0x18fc9d(getChanSpyApplications(_0x22e1e9,_0x4e71e9));}return _0x18fc9d([]);})[_0xbf6f('0x1c')](function(_0x21b547){_0x527407(_0x21b547);});});};module[_0xbf6f('0x1d')]=function(_0x528bf0,_0x446857){var _0x4a370f=_0x528bf0[_0xbf6f('0x1e')];return _0x528bf0[_0xbf6f('0x1f')](_0xbf6f('0x20'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x28d8f6,_0x406320,_0x29415d){return getChanSpyPromise(_0x4a370f,_0x28d8f6)[_0xbf6f('0x1b')](function(_0x44d47f){if(_0x44d47f&&_0x44d47f[_0xbf6f('0x16')]){return _0x4a370f['VoiceExtension'][_0xbf6f('0x21')](_0x44d47f);}})[_0xbf6f('0x1b')](function(){_0x29415d();})['catch'](function(_0x506302){_0x29415d(_0x506302);});},'afterUpdate':function(_0x527284,_0x246473,_0x588fbe){return _0x4a370f[_0xbf6f('0x22')][_0xbf6f('0x23')]({'where':{'ChanSpyId':_0x527284['id']}})[_0xbf6f('0x1b')](function(){return getChanSpyPromise(_0x4a370f,_0x527284);})[_0xbf6f('0x1b')](function(_0xb440e8){if(_0xb440e8&&_0xb440e8[_0xbf6f('0x16')]){return _0x4a370f[_0xbf6f('0x22')]['bulkCreate'](_0xb440e8);}})['then'](function(){_0x588fbe();})[_0xbf6f('0x1c')](function(_0x12897f){_0x588fbe(_0x12897f);});},'afterDestroy':function(_0x5db6ba,_0x1fa67c,_0x4f2430){return _0x4a370f[_0xbf6f('0x22')][_0xbf6f('0x23')]({'where':{'ChanSpyId':_0x5db6ba['id']}})[_0xbf6f('0x1b')](function(){_0x4f2430();})[_0xbf6f('0x1c')](function(_0x37bf96){_0x4f2430(_0x37bf96);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 101f754..597c676 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 _0xcb14=['then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x11fa8c,_0x7b21af){var _0x59b5d7=function(_0xe0337f){while(--_0xe0337f){_0x11fa8c['push'](_0x11fa8c['shift']());}};_0x59b5d7(++_0x7b21af);}(_0xcb14,0x68));var _0x4cb1=function(_0x722103,_0x5732f3){_0x722103=_0x722103-0x0;var _0x3e2435=_0xcb14[_0x722103];return _0x3e2435;};'use strict';var _=require(_0x4cb1('0x0'));var util=require(_0x4cb1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4cb1('0x2'));var db=require(_0x4cb1('0x3'))['db'];var utils=require(_0x4cb1('0x4'));var logger=require(_0x4cb1('0x5'))(_0x4cb1('0x6'));var config=require('../../config/environment');var jayson=require(_0x4cb1('0x7'));var client=jayson[_0x4cb1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53a5fa,_0x558be6,_0x4dac8d){return new BPromise(function(_0x28f970,_0x3cb0ea){return client[_0x4cb1('0x9')](_0x53a5fa,_0x4dac8d)[_0x4cb1('0xa')](function(_0x466daa){logger[_0x4cb1('0xb')](_0x4cb1('0xc'),_0x558be6,'request\x20sent');logger[_0x4cb1('0xd')](_0x4cb1('0xe'),_0x558be6,_0x4cb1('0xf'),JSON['stringify'](_0x466daa));if(_0x466daa[_0x4cb1('0x10')]){if(_0x466daa[_0x4cb1('0x10')]['code']===0x1f4){logger[_0x4cb1('0x10')](_0x4cb1('0xc'),_0x558be6,_0x466daa['error']['message']);return _0x3cb0ea(_0x466daa['error'][_0x4cb1('0x11')]);}logger[_0x4cb1('0x10')](_0x4cb1('0xc'),_0x558be6,_0x466daa[_0x4cb1('0x10')][_0x4cb1('0x11')]);return _0x28f970(_0x466daa[_0x4cb1('0x10')][_0x4cb1('0x11')]);}else{logger[_0x4cb1('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x558be6,_0x4cb1('0xf'));_0x28f970(_0x466daa[_0x4cb1('0x12')][_0x4cb1('0x11')]);}})['catch'](function(_0x236a24){logger[_0x4cb1('0x10')](_0x4cb1('0xc'),_0x558be6,_0x236a24);_0x3cb0ea(_0x236a24);});});} \ No newline at end of file +var _0x96b7=['request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s'];(function(_0x684928,_0x4aa42b){var _0xfd7f5d=function(_0x19d3f7){while(--_0x19d3f7){_0x684928['push'](_0x684928['shift']());}};_0xfd7f5d(++_0x4aa42b);}(_0x96b7,0x103));var _0x796b=function(_0x4eb662,_0x540e40){_0x4eb662=_0x4eb662-0x0;var _0x2d7889=_0x96b7[_0x4eb662];return _0x2d7889;};'use strict';var _=require(_0x796b('0x0'));var util=require(_0x796b('0x1'));var moment=require(_0x796b('0x2'));var BPromise=require(_0x796b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x796b('0x4'));var db=require(_0x796b('0x5'))['db'];var utils=require(_0x796b('0x6'));var logger=require(_0x796b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x796b('0x8'));var client=jayson[_0x796b('0x9')][_0x796b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4af00f,_0x503da1,_0x50f4dd){return new BPromise(function(_0x5cb44b,_0x3db398){return client[_0x796b('0xb')](_0x4af00f,_0x50f4dd)['then'](function(_0x258b48){logger[_0x796b('0xc')](_0x796b('0xd'),_0x503da1,_0x796b('0xe'));logger[_0x796b('0xf')](_0x796b('0x10'),_0x503da1,_0x796b('0xe'),JSON[_0x796b('0x11')](_0x258b48));if(_0x258b48[_0x796b('0x12')]){if(_0x258b48[_0x796b('0x12')]['code']===0x1f4){logger[_0x796b('0x12')](_0x796b('0xd'),_0x503da1,_0x258b48[_0x796b('0x12')][_0x796b('0x13')]);return _0x3db398(_0x258b48[_0x796b('0x12')][_0x796b('0x13')]);}logger[_0x796b('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x503da1,_0x258b48[_0x796b('0x12')][_0x796b('0x13')]);return _0x5cb44b(_0x258b48['error'][_0x796b('0x13')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x503da1,_0x796b('0xe'));_0x5cb44b(_0x258b48[_0x796b('0x14')][_0x796b('0x13')]);}})['catch'](function(_0x555cdb){logger[_0x796b('0x12')](_0x796b('0xd'),_0x503da1,_0x555cdb);_0x3db398(_0x555cdb);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 72170b6..6a30ab8 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 _0x0fc8=['create','put','update','destroy','exports','multer','util','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x407a24,_0x2b13ce){var _0x5651bb=function(_0x559186){while(--_0x559186){_0x407a24['push'](_0x407a24['shift']());}};_0x5651bb(++_0x2b13ce);}(_0x0fc8,0x145));var _0x80fc=function(_0x3f5010,_0x1c0d58){_0x3f5010=_0x3f5010-0x0;var _0xb9c239=_0x0fc8[_0x3f5010];return _0xb9c239;};'use strict';var multer=require(_0x80fc('0x0'));var util=require(_0x80fc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x80fc('0x2')]();var fs_extra=require(_0x80fc('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x80fc('0x4'));var controller=require('./voiceContext.controller');router[_0x80fc('0x5')]('/',auth[_0x80fc('0x6')](),controller[_0x80fc('0x7')]);router[_0x80fc('0x5')](_0x80fc('0x8'),auth['isAuthenticated'](),controller[_0x80fc('0x9')]);router[_0x80fc('0xa')]('/',auth['isAuthenticated'](),controller[_0x80fc('0xb')]);router[_0x80fc('0xc')](_0x80fc('0x8'),auth['isAuthenticated'](),controller[_0x80fc('0xd')]);router['delete']('/:id',auth[_0x80fc('0x6')](),controller[_0x80fc('0xe')]);module[_0x80fc('0xf')]=router; \ No newline at end of file +var _0x85b5=['show','post','put','/:id','update','delete','exports','multer','util','connect-timeout','Router','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x85b5,0x7f));var _0x585b=function(_0x355082,_0xcc6bdc){_0x355082=_0x355082-0x0;var _0x4b9246=_0x85b5[_0x355082];return _0x4b9246;};'use strict';var multer=require(_0x585b('0x0'));var util=require(_0x585b('0x1'));var path=require('path');var timeout=require(_0x585b('0x2'));var express=require('express');var router=express[_0x585b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x585b('0x4'));var config=require('../../config/environment');var controller=require(_0x585b('0x5'));router[_0x585b('0x6')]('/',auth[_0x585b('0x7')](),controller['index']);router[_0x585b('0x6')]('/:id',auth[_0x585b('0x7')](),controller[_0x585b('0x8')]);router[_0x585b('0x9')]('/',auth[_0x585b('0x7')](),controller['create']);router[_0x585b('0xa')](_0x585b('0xb'),auth[_0x585b('0x7')](),controller[_0x585b('0xc')]);router[_0x585b('0xd')](_0x585b('0xb'),auth[_0x585b('0x7')](),controller['destroy']);module[_0x585b('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 7558a6d..91891a4 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(_0xda4682,_0x361238){var _0x109241=function(_0x5ecba6){while(--_0x5ecba6){_0xda4682['push'](_0xda4682['shift']());}};_0x109241(++_0x361238);}(_0xe14b,0x93));var _0xbe14=function(_0x25e9de,_0x4a1674){_0x25e9de=_0x25e9de-0x0;var _0x797945=_0xe14b[_0x25e9de];return _0x797945;};'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 _0xe14b=['exports','STRING','BOOLEAN','sequelize'];(function(_0x25ad49,_0x2a6ef7){var _0x4fea17=function(_0x5dcb01){while(--_0x5dcb01){_0x25ad49['push'](_0x25ad49['shift']());}};_0x4fea17(++_0x2a6ef7);}(_0xe14b,0x93));var _0xbe14=function(_0x591d70,_0xe828c2){_0x591d70=_0x591d70-0x0;var _0x217d3f=_0xe14b[_0x591d70];return _0x217d3f;};'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 diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index e244f07..f49c2e2 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 _0xa5c1=['eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','get','Contexts','UserProfileResource','destroy','stack','name','index','map','VoiceContext','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so'];(function(_0x51d276,_0x518cb6){var _0x1c1e5b=function(_0x38f909){while(--_0x38f909){_0x51d276['push'](_0x51d276['shift']());}};_0x1c1e5b(++_0x518cb6);}(_0xa5c1,0x188));var _0x1a5c=function(_0x450368,_0x2fe2d3){_0x450368=_0x450368-0x0;var _0x4fce06=_0xa5c1[_0x450368];return _0x4fce06;};'use strict';var emlformat=require(_0x1a5c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a5c('0x1'));var jsonpatch=require(_0x1a5c('0x2'));var rp=require(_0x1a5c('0x3'));var moment=require(_0x1a5c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a5c('0x5'));var util=require(_0x1a5c('0x6'));var path=require('path');var sox=require(_0x1a5c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1a5c('0x8'));var squel=require(_0x1a5c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1a5c('0xa'));var toCsv=require(_0x1a5c('0xb'));var querystring=require(_0x1a5c('0xc'));var Papa=require(_0x1a5c('0xd'));var Redis=require(_0x1a5c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1a5c('0xf'));var as=require(_0x1a5c('0x10'));var hardwareService=require(_0x1a5c('0x11'));var logger=require(_0x1a5c('0x12'))(_0x1a5c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a5c('0x14'))['db'];var jayson=require(_0x1a5c('0x15'));var client=jayson[_0x1a5c('0x16')][_0x1a5c('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x184aec,_0x41e838,_0x3c551c,_0x57c747){return new BPromise(function(_0x5c5c71,_0x3ca87b){var _0x5cb334=_0x57c747||client;return _0x5cb334[_0x1a5c('0x18')](_0x184aec,_0x3c551c)[_0x1a5c('0x19')](function(_0x59bb9b){logger['info'](_0x1a5c('0x1a'),_0x41e838,'request\x20sent');logger[_0x1a5c('0x1b')](_0x1a5c('0x1c'),_0x41e838,'request\x20sent',JSON[_0x1a5c('0x1d')](_0x59bb9b));if(_0x59bb9b[_0x1a5c('0x1e')]){if(_0x59bb9b[_0x1a5c('0x1e')][_0x1a5c('0x1f')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x41e838,_0x59bb9b[_0x1a5c('0x1e')][_0x1a5c('0x20')]);return _0x3ca87b(_0x59bb9b[_0x1a5c('0x1e')][_0x1a5c('0x20')]);}logger[_0x1a5c('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x41e838,_0x59bb9b[_0x1a5c('0x1e')]['message']);return _0x5c5c71(_0x59bb9b['error'][_0x1a5c('0x20')]);}else{logger['info'](_0x1a5c('0x1a'),_0x41e838,'request\x20sent');_0x5c5c71(_0x59bb9b['result']['message']);}})['catch'](function(_0x4fc4ed){logger[_0x1a5c('0x1e')](_0x1a5c('0x1a'),_0x41e838,_0x4fc4ed);_0x3ca87b(_0x4fc4ed);});});}function respondWithStatusCode(_0x4e93cb,_0x16b03b){_0x16b03b=_0x16b03b||0xcc;return function(_0x4e0727){if(_0x4e0727){return _0x4e93cb[_0x1a5c('0x21')](_0x16b03b);}return _0x4e93cb[_0x1a5c('0x22')](_0x16b03b)[_0x1a5c('0x23')]();};}function respondWithResult(_0x2570db,_0x4c4271){_0x4c4271=_0x4c4271||0xc8;return function(_0x22726f){if(_0x22726f){return _0x2570db[_0x1a5c('0x22')](_0x4c4271)[_0x1a5c('0x24')](_0x22726f);}};}function respondWithFilteredResult(_0x18b637,_0x159bd8){return function(_0x10bd10){if(_0x10bd10){var _0x2675bc=typeof _0x159bd8[_0x1a5c('0x25')]===_0x1a5c('0x26')&&typeof _0x159bd8['limit']==='undefined';var _0x5e5618=_0x10bd10['count'];var _0xd3a6f3=_0x2675bc?0x0:_0x159bd8[_0x1a5c('0x25')];var _0x541eb9=_0x2675bc?_0x10bd10[_0x1a5c('0x27')]:_0x159bd8['offset']+_0x159bd8[_0x1a5c('0x28')];var _0x2047a0;if(_0x541eb9>=_0x5e5618){_0x541eb9=_0x5e5618;_0x2047a0=0xc8;}else{_0x2047a0=0xce;}_0x18b637[_0x1a5c('0x22')](_0x2047a0);return _0x18b637['set'](_0x1a5c('0x29'),_0xd3a6f3+'-'+_0x541eb9+'/'+_0x5e5618)[_0x1a5c('0x24')](_0x10bd10);}return null;};}function patchUpdates(_0x554630){return function(_0x300297){try{jsonpatch['apply'](_0x300297,_0x554630,!![]);}catch(_0x31e3ab){return BPromise[_0x1a5c('0x2a')](_0x31e3ab);}return _0x300297[_0x1a5c('0x2b')]();};}function saveUpdates(_0x331007,_0x13bba5){return function(_0x3e4a97){if(_0x3e4a97){return _0x3e4a97['update'](_0x331007)[_0x1a5c('0x19')](function(_0x302860){return _0x302860;});}return null;};}function removeEntity(_0x19a8ba,_0x4e4ad8){return function(_0x470a6a){if(_0x470a6a){return _0x470a6a['destroy']()[_0x1a5c('0x19')](function(){var _0x306847=_0x470a6a[_0x1a5c('0x2c')]({'plain':!![]});var _0x44a4b0=_0x1a5c('0x2d');return db[_0x1a5c('0x2e')][_0x1a5c('0x2f')]({'where':{'type':_0x44a4b0,'resourceId':_0x306847['id']}})[_0x1a5c('0x19')](function(){return _0x470a6a;});})[_0x1a5c('0x19')](function(){_0x19a8ba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x249350,_0x356b76){return function(_0x5d1529){if(!_0x5d1529){_0x249350['sendStatus'](0x194);}return _0x5d1529;};}function handleError(_0x578852,_0x1e35b2){_0x1e35b2=_0x1e35b2||0x1f4;return function(_0x4bb8c6){logger[_0x1a5c('0x1e')](_0x4bb8c6[_0x1a5c('0x30')]);if(_0x4bb8c6[_0x1a5c('0x31')]){delete _0x4bb8c6['name'];}_0x578852['status'](_0x1e35b2)['send'](_0x4bb8c6);};}exports[_0x1a5c('0x32')]=function(_0x511ba6,_0x309608){var _0x52bdaa={},_0xdee818={},_0x5e2541={'count':0x0,'rows':[]};var _0x4495d3=_[_0x1a5c('0x33')](db[_0x1a5c('0x34')][_0x1a5c('0x35')],function(_0x5d18a9){return{'name':_0x5d18a9[_0x1a5c('0x36')],'type':_0x5d18a9[_0x1a5c('0x37')]['key']};});_0xdee818[_0x1a5c('0x38')]=_[_0x1a5c('0x33')](_0x4495d3,'name');_0xdee818['query']=_[_0x1a5c('0x39')](_0x511ba6[_0x1a5c('0x3a')]);_0xdee818[_0x1a5c('0x3b')]=_[_0x1a5c('0x3c')](_0xdee818[_0x1a5c('0x38')],_0xdee818[_0x1a5c('0x3a')]);_0x52bdaa[_0x1a5c('0x3d')]=_[_0x1a5c('0x3c')](_0xdee818['model'],qs[_0x1a5c('0x3e')](_0x511ba6[_0x1a5c('0x3a')][_0x1a5c('0x3e')]));_0x52bdaa[_0x1a5c('0x3d')]=_0x52bdaa['attributes'][_0x1a5c('0x3f')]?_0x52bdaa[_0x1a5c('0x3d')]:_0xdee818[_0x1a5c('0x38')];if(!_0x511ba6[_0x1a5c('0x3a')][_0x1a5c('0x40')]('nolimit')){_0x52bdaa[_0x1a5c('0x28')]=qs[_0x1a5c('0x28')](_0x511ba6[_0x1a5c('0x3a')][_0x1a5c('0x28')]);_0x52bdaa['offset']=qs[_0x1a5c('0x25')](_0x511ba6[_0x1a5c('0x3a')][_0x1a5c('0x25')]);}_0x52bdaa[_0x1a5c('0x41')]=qs[_0x1a5c('0x42')](_0x511ba6[_0x1a5c('0x3a')][_0x1a5c('0x42')]);_0x52bdaa[_0x1a5c('0x43')]=qs['filters'](_['pick'](_0x511ba6[_0x1a5c('0x3a')],_0xdee818['filters']),_0x4495d3);if(_0x511ba6['query'][_0x1a5c('0x44')]){_0x52bdaa['where']=_[_0x1a5c('0x45')](_0x52bdaa[_0x1a5c('0x43')],{'$or':_[_0x1a5c('0x33')](_0x4495d3,function(_0x137966){if(_0x137966[_0x1a5c('0x37')]!==_0x1a5c('0x46')){var _0x3c5191={};_0x3c5191[_0x137966[_0x1a5c('0x31')]]={'$like':'%'+_0x511ba6[_0x1a5c('0x3a')][_0x1a5c('0x44')]+'%'};return _0x3c5191;}})});}_0x52bdaa=_[_0x1a5c('0x45')]({},_0x52bdaa,_0x511ba6[_0x1a5c('0x47')]);var _0x4cb95b={'where':_0x52bdaa[_0x1a5c('0x43')]};return db[_0x1a5c('0x34')][_0x1a5c('0x27')](_0x4cb95b)['then'](function(_0x35864a){_0x5e2541[_0x1a5c('0x27')]=_0x35864a;if(_0x511ba6[_0x1a5c('0x3a')][_0x1a5c('0x48')]){_0x52bdaa[_0x1a5c('0x49')]=[{'all':!![]}];}return db[_0x1a5c('0x34')][_0x1a5c('0x4a')](_0x52bdaa);})['then'](function(_0xfbe84a){_0x5e2541['rows']=_0xfbe84a;return _0x5e2541;})['then'](respondWithFilteredResult(_0x309608,_0x52bdaa))[_0x1a5c('0x4b')](handleError(_0x309608,null));};exports[_0x1a5c('0x4c')]=function(_0x5bf285,_0x5557cc){var _0x46ac5e={'raw':![],'where':{'id':_0x5bf285[_0x1a5c('0x4d')]['id']}},_0x164818={};_0x164818['model']=_['keys'](db['VoiceContext'][_0x1a5c('0x35')]);_0x164818[_0x1a5c('0x3a')]=_['keys'](_0x5bf285[_0x1a5c('0x3a')]);_0x164818[_0x1a5c('0x3b')]=_['intersection'](_0x164818[_0x1a5c('0x38')],_0x164818[_0x1a5c('0x3a')]);_0x46ac5e[_0x1a5c('0x3d')]=_[_0x1a5c('0x3c')](_0x164818['model'],qs['fields'](_0x5bf285['query']['fields']));_0x46ac5e[_0x1a5c('0x3d')]=_0x46ac5e[_0x1a5c('0x3d')][_0x1a5c('0x3f')]?_0x46ac5e[_0x1a5c('0x3d')]:_0x164818['model'];if(_0x5bf285[_0x1a5c('0x3a')]['includeAll']){_0x46ac5e[_0x1a5c('0x49')]=[{'all':!![]}];}_0x46ac5e=_[_0x1a5c('0x45')]({},_0x46ac5e,_0x5bf285[_0x1a5c('0x47')]);return db['VoiceContext'][_0x1a5c('0x4e')](_0x46ac5e)['then'](handleEntityNotFound(_0x5557cc,null))[_0x1a5c('0x19')](respondWithResult(_0x5557cc,null))[_0x1a5c('0x4b')](handleError(_0x5557cc,null));};exports['create']=function(_0x15e0a2,_0x271c30,_0x750718){var _0x1cc1c7;return db[_0x1a5c('0x34')][_0x1a5c('0x4f')](_0x15e0a2[_0x1a5c('0x50')],{'raw':!![]})[_0x1a5c('0x19')](function(_0x2acf16){_0x1cc1c7=_0x2acf16;return db[_0x1a5c('0x34')][_0x1a5c('0x4a')]({'raw':!![]});})['then'](function(_0x21bbd3){var _0x447582=fs[_0x1a5c('0x51')](path[_0x1a5c('0x52')](config[_0x1a5c('0x53')],_0x1a5c('0x54')),_0x1a5c('0x55'));var _0x598b8f=ejs[_0x1a5c('0x56')](_0x447582,{'contexts':_0x21bbd3||[]});fs[_0x1a5c('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x598b8f);})[_0x1a5c('0x19')](function(){return respondWithRpcPromise(_0x1a5c('0x58'),_0x1a5c('0x4f'),{'module':'chan_sip.so'});})[_0x1a5c('0x19')](function(){var _0x436cc8=_0x15e0a2[_0x1a5c('0x59')][_0x1a5c('0x2c')]({'plain':!![]});if(!_0x436cc8)throw new Error(_0x1a5c('0x5a'));if(_0x436cc8[_0x1a5c('0x5b')]===_0x1a5c('0x59')){var _0x585d66=_0x1cc1c7[_0x1a5c('0x2c')]({'plain':!![]});return db[_0x1a5c('0x5c')][_0x1a5c('0x4e')]({'where':{'name':_0x1a5c('0x2d'),'userProfileId':_0x436cc8[_0x1a5c('0x5d')]},'raw':!![]})[_0x1a5c('0x19')](function(_0x505e0d){if(_0x505e0d&&_0x505e0d[_0x1a5c('0x5e')]===0x0){return db[_0x1a5c('0x2e')]['create']({'name':_0x585d66['name'],'resourceId':_0x585d66['id'],'type':_0x505e0d[_0x1a5c('0x31')],'sectionId':_0x505e0d['id']},{})[_0x1a5c('0x19')](function(){return _0x1cc1c7;});}else{return _0x1cc1c7;}})[_0x1a5c('0x4b')](function(_0xb6a9a9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb6a9a9);throw _0xb6a9a9;});}return _0x1cc1c7;})['then'](respondWithResult(_0x271c30,0xc9))[_0x1a5c('0x4b')](handleError(_0x271c30,null));};exports[_0x1a5c('0x5f')]=function(_0x3fa7e5,_0x1e12cc,_0x32e03a){var _0x2242e0;return db[_0x1a5c('0x34')][_0x1a5c('0x4e')]({'where':{'id':_0x3fa7e5[_0x1a5c('0x4d')]['id']}})[_0x1a5c('0x19')](handleEntityNotFound(_0x1e12cc,null))[_0x1a5c('0x19')](saveUpdates(_0x3fa7e5[_0x1a5c('0x50')],null))['then'](function(_0x310f0a){if(_0x310f0a){_0x2242e0=_0x310f0a;return db[_0x1a5c('0x34')][_0x1a5c('0x4a')]({'raw':!![]});}})[_0x1a5c('0x19')](function(_0x52efca){var _0x24e650=fs[_0x1a5c('0x51')](path[_0x1a5c('0x52')](config['root'],_0x1a5c('0x54')),_0x1a5c('0x55'));var _0x5af2aa=ejs[_0x1a5c('0x56')](_0x24e650,{'contexts':_0x52efca||[]});fs[_0x1a5c('0x57')](_0x1a5c('0x60'),_0x5af2aa);})[_0x1a5c('0x19')](function(){return respondWithRpcPromise(_0x1a5c('0x58'),_0x1a5c('0x5f'),{'module':'chan_sip.so'});})[_0x1a5c('0x19')](function(){return _0x2242e0;})[_0x1a5c('0x19')](respondWithResult(_0x1e12cc,null))[_0x1a5c('0x4b')](handleError(_0x1e12cc,null));};exports[_0x1a5c('0x2f')]=function(_0x215fa4,_0x1bc42f,_0x27bb0d){var _0x17513c;return db['VoiceContext']['find']({'where':{'id':_0x215fa4[_0x1a5c('0x4d')]['id']}})[_0x1a5c('0x19')](handleEntityNotFound(_0x1bc42f,null))[_0x1a5c('0x19')](removeEntity(_0x1bc42f,null))[_0x1a5c('0x19')](function(){return db['VoiceContext'][_0x1a5c('0x4a')]({'raw':!![]});})[_0x1a5c('0x19')](function(_0x5167b1){var _0x5b9e1b=fs['readFileSync'](path[_0x1a5c('0x52')](config[_0x1a5c('0x53')],'server/files/templates/context.ejs'),'utf8');var _0x356b69=ejs[_0x1a5c('0x56')](_0x5b9e1b,{'contexts':_0x5167b1});fs[_0x1a5c('0x57')](_0x1a5c('0x60'),_0x356b69);return respondWithRpcPromise('Reload','destroy',{'module':_0x1a5c('0x61')});})[_0x1a5c('0x4b')](handleError(_0x1bc42f,null));}; \ No newline at end of file +var _0xcba2=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','update','destroy','Contexts','UserProfileResource','name','send','index','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','writeFileSync','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcba2,0xab));var _0x2cba=function(_0x1e8478,_0x1f93fb){_0x1e8478=_0x1e8478-0x0;var _0xdd6e84=_0xcba2[_0x1e8478];return _0xdd6e84;};'use strict';var emlformat=require(_0x2cba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2cba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cba('0x2'));var moment=require(_0x2cba('0x3'));var BPromise=require(_0x2cba('0x4'));var Mustache=require(_0x2cba('0x5'));var util=require('util');var path=require(_0x2cba('0x6'));var sox=require('sox');var csv=require(_0x2cba('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2cba('0x8'));var _=require(_0x2cba('0x9'));var squel=require(_0x2cba('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2cba('0xb'));var toCsv=require(_0x2cba('0x7'));var querystring=require('querystring');var Papa=require(_0x2cba('0xc'));var Redis=require(_0x2cba('0xd'));var authService=require(_0x2cba('0xe'));var qs=require(_0x2cba('0xf'));var as=require(_0x2cba('0x10'));var hardwareService=require(_0x2cba('0x11'));var logger=require(_0x2cba('0x12'))(_0x2cba('0x13'));var utils=require(_0x2cba('0x14'));var config=require(_0x2cba('0x15'));var licenseUtil=require(_0x2cba('0x16'));var db=require(_0x2cba('0x17'))['db'];var jayson=require(_0x2cba('0x18'));var client=jayson[_0x2cba('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20f886,_0x4681e3,_0x1bd2e7,_0x391ed4){return new BPromise(function(_0x38e4af,_0x22fe2c){var _0x17b7ac=_0x391ed4||client;return _0x17b7ac[_0x2cba('0x1a')](_0x20f886,_0x1bd2e7)[_0x2cba('0x1b')](function(_0x42a07d){logger[_0x2cba('0x1c')](_0x2cba('0x1d'),_0x4681e3,_0x2cba('0x1e'));logger[_0x2cba('0x1f')](_0x2cba('0x20'),_0x4681e3,_0x2cba('0x1e'),JSON['stringify'](_0x42a07d));if(_0x42a07d[_0x2cba('0x21')]){if(_0x42a07d[_0x2cba('0x21')]['code']===0x1f4){logger[_0x2cba('0x21')]('VoiceContext,\x20%s,\x20%s',_0x4681e3,_0x42a07d[_0x2cba('0x21')][_0x2cba('0x22')]);return _0x22fe2c(_0x42a07d[_0x2cba('0x21')][_0x2cba('0x22')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x4681e3,_0x42a07d[_0x2cba('0x21')]['message']);return _0x38e4af(_0x42a07d[_0x2cba('0x21')][_0x2cba('0x22')]);}else{logger[_0x2cba('0x1c')](_0x2cba('0x1d'),_0x4681e3,_0x2cba('0x1e'));_0x38e4af(_0x42a07d[_0x2cba('0x23')][_0x2cba('0x22')]);}})['catch'](function(_0x55ad0a){logger[_0x2cba('0x21')]('VoiceContext,\x20%s,\x20%s',_0x4681e3,_0x55ad0a);_0x22fe2c(_0x55ad0a);});});}function respondWithStatusCode(_0x3d9353,_0x540a24){_0x540a24=_0x540a24||0xcc;return function(_0x443657){if(_0x443657){return _0x3d9353[_0x2cba('0x24')](_0x540a24);}return _0x3d9353[_0x2cba('0x25')](_0x540a24)[_0x2cba('0x26')]();};}function respondWithResult(_0x28c4b4,_0x2cd0b4){_0x2cd0b4=_0x2cd0b4||0xc8;return function(_0xebfd4b){if(_0xebfd4b){return _0x28c4b4['status'](_0x2cd0b4)[_0x2cba('0x27')](_0xebfd4b);}};}function respondWithFilteredResult(_0x2f7080,_0xda25fe){return function(_0x33d50f){if(_0x33d50f){var _0x5bdd1a=typeof _0xda25fe['offset']===_0x2cba('0x28')&&typeof _0xda25fe[_0x2cba('0x29')]===_0x2cba('0x28');var _0x17620b=_0x33d50f['count'];var _0x735d36=_0x5bdd1a?0x0:_0xda25fe[_0x2cba('0x2a')];var _0x3c74bc=_0x5bdd1a?_0x33d50f[_0x2cba('0x2b')]:_0xda25fe[_0x2cba('0x2a')]+_0xda25fe[_0x2cba('0x29')];var _0x255772;if(_0x3c74bc>=_0x17620b){_0x3c74bc=_0x17620b;_0x255772=0xc8;}else{_0x255772=0xce;}_0x2f7080[_0x2cba('0x25')](_0x255772);return _0x2f7080[_0x2cba('0x2c')]('Content-Range',_0x735d36+'-'+_0x3c74bc+'/'+_0x17620b)['json'](_0x33d50f);}return null;};}function patchUpdates(_0x2abe64){return function(_0x5370c2){try{jsonpatch['apply'](_0x5370c2,_0x2abe64,!![]);}catch(_0x226324){return BPromise[_0x2cba('0x2d')](_0x226324);}return _0x5370c2['save']();};}function saveUpdates(_0x5eea4f,_0x558f46){return function(_0x23f13f){if(_0x23f13f){return _0x23f13f[_0x2cba('0x2e')](_0x5eea4f)['then'](function(_0x1c3f8f){return _0x1c3f8f;});}return null;};}function removeEntity(_0x1a5340,_0x25bea7){return function(_0x4a9782){if(_0x4a9782){return _0x4a9782[_0x2cba('0x2f')]()[_0x2cba('0x1b')](function(){var _0x30867f=_0x4a9782['get']({'plain':!![]});var _0x2eb86b=_0x2cba('0x30');return db[_0x2cba('0x31')][_0x2cba('0x2f')]({'where':{'type':_0x2eb86b,'resourceId':_0x30867f['id']}})['then'](function(){return _0x4a9782;});})[_0x2cba('0x1b')](function(){_0x1a5340['status'](0xcc)[_0x2cba('0x26')]();});}};}function handleEntityNotFound(_0x2a6979,_0x464d5d){return function(_0x93886d){if(!_0x93886d){_0x2a6979[_0x2cba('0x24')](0x194);}return _0x93886d;};}function handleError(_0x312e4a,_0x2ae982){_0x2ae982=_0x2ae982||0x1f4;return function(_0x304abd){logger['error'](_0x304abd['stack']);if(_0x304abd[_0x2cba('0x32')]){delete _0x304abd[_0x2cba('0x32')];}_0x312e4a[_0x2cba('0x25')](_0x2ae982)[_0x2cba('0x33')](_0x304abd);};}exports[_0x2cba('0x34')]=function(_0x27efbf,_0x4f4da5){var _0xc49d53={},_0x33c675={},_0x2cd2e0={'count':0x0,'rows':[]};var _0x4857e7=_['map'](db[_0x2cba('0x35')][_0x2cba('0x36')],function(_0x54a02f){return{'name':_0x54a02f[_0x2cba('0x37')],'type':_0x54a02f[_0x2cba('0x38')][_0x2cba('0x39')]};});_0x33c675[_0x2cba('0x3a')]=_[_0x2cba('0x3b')](_0x4857e7,'name');_0x33c675[_0x2cba('0x3c')]=_[_0x2cba('0x3d')](_0x27efbf[_0x2cba('0x3c')]);_0x33c675[_0x2cba('0x3e')]=_[_0x2cba('0x3f')](_0x33c675[_0x2cba('0x3a')],_0x33c675[_0x2cba('0x3c')]);_0xc49d53[_0x2cba('0x40')]=_['intersection'](_0x33c675[_0x2cba('0x3a')],qs[_0x2cba('0x41')](_0x27efbf[_0x2cba('0x3c')][_0x2cba('0x41')]));_0xc49d53[_0x2cba('0x40')]=_0xc49d53[_0x2cba('0x40')][_0x2cba('0x42')]?_0xc49d53[_0x2cba('0x40')]:_0x33c675['model'];if(!_0x27efbf[_0x2cba('0x3c')]['hasOwnProperty'](_0x2cba('0x43'))){_0xc49d53['limit']=qs[_0x2cba('0x29')](_0x27efbf['query'][_0x2cba('0x29')]);_0xc49d53[_0x2cba('0x2a')]=qs[_0x2cba('0x2a')](_0x27efbf['query'][_0x2cba('0x2a')]);}_0xc49d53[_0x2cba('0x44')]=qs[_0x2cba('0x45')](_0x27efbf[_0x2cba('0x3c')][_0x2cba('0x45')]);_0xc49d53[_0x2cba('0x46')]=qs['filters'](_[_0x2cba('0x47')](_0x27efbf[_0x2cba('0x3c')],_0x33c675[_0x2cba('0x3e')]),_0x4857e7);if(_0x27efbf[_0x2cba('0x3c')][_0x2cba('0x48')]){_0xc49d53[_0x2cba('0x46')]=_[_0x2cba('0x49')](_0xc49d53['where'],{'$or':_['map'](_0x4857e7,function(_0x45cfa4){if(_0x45cfa4[_0x2cba('0x38')]!=='VIRTUAL'){var _0x3c89aa={};_0x3c89aa[_0x45cfa4['name']]={'$like':'%'+_0x27efbf[_0x2cba('0x3c')]['filter']+'%'};return _0x3c89aa;}})});}_0xc49d53=_['merge']({},_0xc49d53,_0x27efbf[_0x2cba('0x4a')]);var _0x5e9fb2={'where':_0xc49d53[_0x2cba('0x46')]};return db[_0x2cba('0x35')][_0x2cba('0x2b')](_0x5e9fb2)['then'](function(_0x5cc036){_0x2cd2e0[_0x2cba('0x2b')]=_0x5cc036;if(_0x27efbf['query'][_0x2cba('0x4b')]){_0xc49d53['include']=[{'all':!![]}];}return db['VoiceContext'][_0x2cba('0x4c')](_0xc49d53);})[_0x2cba('0x1b')](function(_0x13f9c8){_0x2cd2e0[_0x2cba('0x4d')]=_0x13f9c8;return _0x2cd2e0;})[_0x2cba('0x1b')](respondWithFilteredResult(_0x4f4da5,_0xc49d53))[_0x2cba('0x4e')](handleError(_0x4f4da5,null));};exports[_0x2cba('0x4f')]=function(_0xe01a95,_0x182805){var _0x4fd060={'raw':![],'where':{'id':_0xe01a95[_0x2cba('0x50')]['id']}},_0x390e34={};_0x390e34[_0x2cba('0x3a')]=_[_0x2cba('0x3d')](db[_0x2cba('0x35')]['rawAttributes']);_0x390e34['query']=_[_0x2cba('0x3d')](_0xe01a95['query']);_0x390e34[_0x2cba('0x3e')]=_['intersection'](_0x390e34[_0x2cba('0x3a')],_0x390e34['query']);_0x4fd060[_0x2cba('0x40')]=_[_0x2cba('0x3f')](_0x390e34[_0x2cba('0x3a')],qs[_0x2cba('0x41')](_0xe01a95[_0x2cba('0x3c')][_0x2cba('0x41')]));_0x4fd060[_0x2cba('0x40')]=_0x4fd060[_0x2cba('0x40')][_0x2cba('0x42')]?_0x4fd060[_0x2cba('0x40')]:_0x390e34[_0x2cba('0x3a')];if(_0xe01a95[_0x2cba('0x3c')][_0x2cba('0x4b')]){_0x4fd060[_0x2cba('0x51')]=[{'all':!![]}];}_0x4fd060=_['merge']({},_0x4fd060,_0xe01a95[_0x2cba('0x4a')]);return db[_0x2cba('0x35')][_0x2cba('0x52')](_0x4fd060)[_0x2cba('0x1b')](handleEntityNotFound(_0x182805,null))[_0x2cba('0x1b')](respondWithResult(_0x182805,null))[_0x2cba('0x4e')](handleError(_0x182805,null));};exports[_0x2cba('0x53')]=function(_0x13ac00,_0x3ec405,_0x33030a){var _0x306ac0;return db[_0x2cba('0x35')][_0x2cba('0x53')](_0x13ac00[_0x2cba('0x54')],{'raw':!![]})[_0x2cba('0x1b')](function(_0x5db609){_0x306ac0=_0x5db609;return db[_0x2cba('0x35')][_0x2cba('0x4c')]({'raw':!![]});})[_0x2cba('0x1b')](function(_0x57266d){var _0x5c49a2=fs[_0x2cba('0x55')](path[_0x2cba('0x56')](config[_0x2cba('0x57')],_0x2cba('0x58')),_0x2cba('0x59'));var _0x4537ea=ejs['render'](_0x5c49a2,{'contexts':_0x57266d||[]});fs['writeFileSync'](_0x2cba('0x5a'),_0x4537ea);})['then'](function(){return respondWithRpcPromise(_0x2cba('0x5b'),_0x2cba('0x53'),{'module':_0x2cba('0x5c')});})['then'](function(){var _0x49dfaf=_0x13ac00['user'][_0x2cba('0x5d')]({'plain':!![]});if(!_0x49dfaf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49dfaf[_0x2cba('0x5e')]==='user'){var _0x3bb625=_0x306ac0['get']({'plain':!![]});return db[_0x2cba('0x5f')][_0x2cba('0x52')]({'where':{'name':_0x2cba('0x30'),'userProfileId':_0x49dfaf[_0x2cba('0x60')]},'raw':!![]})[_0x2cba('0x1b')](function(_0x491afe){if(_0x491afe&&_0x491afe[_0x2cba('0x61')]===0x0){return db[_0x2cba('0x31')]['create']({'name':_0x3bb625[_0x2cba('0x32')],'resourceId':_0x3bb625['id'],'type':_0x491afe[_0x2cba('0x32')],'sectionId':_0x491afe['id']},{})[_0x2cba('0x1b')](function(){return _0x306ac0;});}else{return _0x306ac0;}})['catch'](function(_0x896e62){logger[_0x2cba('0x21')](_0x2cba('0x62'),_0x896e62);throw _0x896e62;});}return _0x306ac0;})[_0x2cba('0x1b')](respondWithResult(_0x3ec405,0xc9))[_0x2cba('0x4e')](handleError(_0x3ec405,null));};exports[_0x2cba('0x2e')]=function(_0x221f08,_0x3282f9,_0x83309a){var _0x4f141d;return db[_0x2cba('0x35')][_0x2cba('0x52')]({'where':{'id':_0x221f08['params']['id']}})['then'](handleEntityNotFound(_0x3282f9,null))[_0x2cba('0x1b')](saveUpdates(_0x221f08[_0x2cba('0x54')],null))[_0x2cba('0x1b')](function(_0x5f562c){if(_0x5f562c){_0x4f141d=_0x5f562c;return db['VoiceContext']['findAll']({'raw':!![]});}})['then'](function(_0x3069c9){var _0x2bb303=fs[_0x2cba('0x55')](path[_0x2cba('0x56')](config[_0x2cba('0x57')],_0x2cba('0x58')),_0x2cba('0x59'));var _0x30de1c=ejs['render'](_0x2bb303,{'contexts':_0x3069c9||[]});fs[_0x2cba('0x63')](_0x2cba('0x5a'),_0x30de1c);})[_0x2cba('0x1b')](function(){return respondWithRpcPromise('Reload',_0x2cba('0x2e'),{'module':_0x2cba('0x5c')});})['then'](function(){return _0x4f141d;})[_0x2cba('0x1b')](respondWithResult(_0x3282f9,null))[_0x2cba('0x4e')](handleError(_0x3282f9,null));};exports['destroy']=function(_0x4375d6,_0x127bcd,_0x444f2a){var _0x1567b0;return db['VoiceContext'][_0x2cba('0x52')]({'where':{'id':_0x4375d6[_0x2cba('0x50')]['id']}})[_0x2cba('0x1b')](handleEntityNotFound(_0x127bcd,null))[_0x2cba('0x1b')](removeEntity(_0x127bcd,null))[_0x2cba('0x1b')](function(){return db[_0x2cba('0x35')][_0x2cba('0x4c')]({'raw':!![]});})[_0x2cba('0x1b')](function(_0x2a5f1a){var _0x6c698a=fs['readFileSync'](path[_0x2cba('0x56')](config[_0x2cba('0x57')],_0x2cba('0x58')),_0x2cba('0x59'));var _0x4a6d5a=ejs['render'](_0x6c698a,{'contexts':_0x2a5f1a});fs[_0x2cba('0x63')](_0x2cba('0x5a'),_0x4a6d5a);return respondWithRpcPromise(_0x2cba('0x5b'),_0x2cba('0x2f'),{'module':_0x2cba('0x5c')});})[_0x2cba('0x4e')](handleError(_0x127bcd,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 82e8ed2..519132d 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 _0xacfe=['rimraf','../../config/environment','exports','define','VoiceContext','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xacfe,0x123));var _0xeacf=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xacfe[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xeacf('0x0'));var util=require(_0xeacf('0x1'));var logger=require(_0xeacf('0x2'))(_0xeacf('0x3'));var moment=require(_0xeacf('0x4'));var BPromise=require('bluebird');var rp=require(_0xeacf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeacf('0x6'));var config=require(_0xeacf('0x7'));var attributes=require('./voiceContext.attributes');module[_0xeacf('0x8')]=function(_0x3a3f44,_0x414b9d){return _0x3a3f44[_0xeacf('0x9')](_0xeacf('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1370=['path','rimraf','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash','util','api','moment','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1370,0x7f));var _0x0137=function(_0x48e921,_0x20cf98){_0x48e921=_0x48e921-0x0;var _0x4986fe=_0x1370[_0x48e921];return _0x4986fe;};'use strict';var _=require(_0x0137('0x0'));var util=require(_0x0137('0x1'));var logger=require('../../config/logger')(_0x0137('0x2'));var moment=require(_0x0137('0x3'));var BPromise=require(_0x0137('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0137('0x5'));var rimraf=require(_0x0137('0x6'));var config=require(_0x0137('0x7'));var attributes=require('./voiceContext.attributes');module[_0x0137('0x8')]=function(_0x33afbf,_0x1c9d9d){return _0x33afbf[_0x0137('0x9')](_0x0137('0xa'),attributes,{'tableName':_0x0137('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 15fa659..88e9546 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 _0x9910=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util'];(function(_0x311825,_0x40d25f){var _0x178115=function(_0x42b995){while(--_0x42b995){_0x311825['push'](_0x311825['shift']());}};_0x178115(++_0x40d25f);}(_0x9910,0xfa));var _0x0991=function(_0x1f446d,_0x8a6599){_0x1f446d=_0x1f446d-0x0;var _0x4bd3e9=_0x9910[_0x1f446d];return _0x4bd3e9;};'use strict';var _=require(_0x0991('0x0'));var util=require(_0x0991('0x1'));var moment=require(_0x0991('0x2'));var BPromise=require(_0x0991('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0991('0x4'));var db=require(_0x0991('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0991('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0991('0x7'));var client=jayson[_0x0991('0x8')][_0x0991('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d0545,_0x24a994,_0x52177d){return new BPromise(function(_0x31d70f,_0x3910e2){return client['request'](_0x5d0545,_0x52177d)[_0x0991('0xa')](function(_0x25d041){logger['info'](_0x0991('0xb'),_0x24a994,'request\x20sent');logger[_0x0991('0xc')](_0x0991('0xd'),_0x24a994,_0x0991('0xe'),JSON[_0x0991('0xf')](_0x25d041));if(_0x25d041[_0x0991('0x10')]){if(_0x25d041[_0x0991('0x10')][_0x0991('0x11')]===0x1f4){logger[_0x0991('0x10')]('VoiceContext,\x20%s,\x20%s',_0x24a994,_0x25d041[_0x0991('0x10')]['message']);return _0x3910e2(_0x25d041['error'][_0x0991('0x12')]);}logger[_0x0991('0x10')](_0x0991('0xb'),_0x24a994,_0x25d041['error']['message']);return _0x31d70f(_0x25d041[_0x0991('0x10')][_0x0991('0x12')]);}else{logger[_0x0991('0x13')](_0x0991('0xb'),_0x24a994,_0x0991('0xe'));_0x31d70f(_0x25d041['result'][_0x0991('0x12')]);}})[_0x0991('0x14')](function(_0x5178db){logger[_0x0991('0x10')](_0x0991('0xb'),_0x24a994,_0x5178db);_0x3910e2(_0x5178db);});});} \ No newline at end of file +var _0xcf92=['debug','stringify','code','error','message','request\x20sent','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s'];(function(_0x2e8439,_0x495d09){var _0x59aa31=function(_0x2e4b73){while(--_0x2e4b73){_0x2e8439['push'](_0x2e8439['shift']());}};_0x59aa31(++_0x495d09);}(_0xcf92,0x182));var _0x2cf9=function(_0x3111fe,_0xf74d28){_0x3111fe=_0x3111fe-0x0;var _0x93887c=_0xcf92[_0x3111fe];return _0x93887c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2cf9('0x0'));var BPromise=require('bluebird');var rs=require(_0x2cf9('0x1'));var fs=require('fs');var Redis=require(_0x2cf9('0x2'));var db=require(_0x2cf9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cf9('0x4'))('rpc');var config=require(_0x2cf9('0x5'));var jayson=require(_0x2cf9('0x6'));var client=jayson[_0x2cf9('0x7')][_0x2cf9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a1d51,_0x3dc6c2,_0x4cf34c){return new BPromise(function(_0x271834,_0x422411){return client[_0x2cf9('0x9')](_0x5a1d51,_0x4cf34c)[_0x2cf9('0xa')](function(_0x322f7a){logger[_0x2cf9('0xb')](_0x2cf9('0xc'),_0x3dc6c2,'request\x20sent');logger[_0x2cf9('0xd')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3dc6c2,'request\x20sent',JSON[_0x2cf9('0xe')](_0x322f7a));if(_0x322f7a['error']){if(_0x322f7a['error'][_0x2cf9('0xf')]===0x1f4){logger['error'](_0x2cf9('0xc'),_0x3dc6c2,_0x322f7a[_0x2cf9('0x10')][_0x2cf9('0x11')]);return _0x422411(_0x322f7a[_0x2cf9('0x10')][_0x2cf9('0x11')]);}logger[_0x2cf9('0x10')](_0x2cf9('0xc'),_0x3dc6c2,_0x322f7a[_0x2cf9('0x10')][_0x2cf9('0x11')]);return _0x271834(_0x322f7a[_0x2cf9('0x10')][_0x2cf9('0x11')]);}else{logger[_0x2cf9('0xb')](_0x2cf9('0xc'),_0x3dc6c2,_0x2cf9('0x12'));_0x271834(_0x322f7a['result'][_0x2cf9('0x11')]);}})['catch'](function(_0x5e9713){logger[_0x2cf9('0x10')](_0x2cf9('0xc'),_0x3dc6c2,_0x5e9713);_0x422411(_0x5e9713);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 989baf4..27dd4cd 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 _0xb458=['./voiceDialReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x23945f,_0x9d3e4e){var _0xa38592=function(_0x406b83){while(--_0x406b83){_0x23945f['push'](_0x23945f['shift']());}};_0xa38592(++_0x9d3e4e);}(_0xb458,0x103));var _0x8b45=function(_0x3c9c06,_0x4e0395){_0x3c9c06=_0x3c9c06-0x0;var _0x32cd7d=_0xb458[_0x3c9c06];return _0x32cd7d;};'use strict';var multer=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var path=require(_0x8b45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8b45('0x3')]();var fs_extra=require(_0x8b45('0x4'));var auth=require(_0x8b45('0x5'));var interaction=require(_0x8b45('0x6'));var config=require('../../config/environment');var controller=require(_0x8b45('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8b45('0x8')]);router[_0x8b45('0x9')](_0x8b45('0xa'),auth[_0x8b45('0xb')](),controller[_0x8b45('0xc')]);router['get'](_0x8b45('0xd'),auth[_0x8b45('0xb')](),controller[_0x8b45('0xe')]);router[_0x8b45('0xf')]('/',auth[_0x8b45('0xb')](),controller['create']);router[_0x8b45('0x10')](_0x8b45('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8b45('0xb')](),controller[_0x8b45('0x11')]);module[_0x8b45('0x12')]=router; \ No newline at end of file +var _0xcb99=['create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x295c11,_0x54b9e0){var _0xe56efc=function(_0x56d07d){while(--_0x56d07d){_0x295c11['push'](_0x295c11['shift']());}};_0xe56efc(++_0x54b9e0);}(_0xcb99,0x8b));var _0x9cb9=function(_0x3a23c1,_0x495d49){_0x3a23c1=_0x3a23c1-0x0;var _0x286863=_0xcb99[_0x3a23c1];return _0x286863;};'use strict';var multer=require(_0x9cb9('0x0'));var util=require('util');var path=require(_0x9cb9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cb9('0x2')]();var fs_extra=require(_0x9cb9('0x3'));var auth=require(_0x9cb9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9cb9('0x5'));var controller=require(_0x9cb9('0x6'));router['get']('/',auth[_0x9cb9('0x7')](),controller['index']);router[_0x9cb9('0x8')](_0x9cb9('0x9'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xa')]);router[_0x9cb9('0x8')](_0x9cb9('0xb'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9cb9('0xd')]);router[_0x9cb9('0xe')](_0x9cb9('0xb'),auth['isAuthenticated'](),controller[_0x9cb9('0xf')]);router[_0x9cb9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x11')]);module[_0x9cb9('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index e4abf6b..8c115b4 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 _0x8331=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x11c24c,_0x6514){var _0x398ccc=function(_0x46d538){while(--_0x46d538){_0x11c24c['push'](_0x11c24c['shift']());}};_0x398ccc(++_0x6514);}(_0x8331,0xe9));var _0x1833=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0x8331[_0x3aaf0a];return _0x33e6bc;};'use strict';var Sequelize=require(_0x1833('0x0'));module[_0x1833('0x1')]={'privilege':{'type':Sequelize[_0x1833('0x2')]},'channel':{'type':Sequelize[_0x1833('0x2')]},'channelstate':{'type':Sequelize[_0x1833('0x3')]},'channelstatedesc':{'type':Sequelize[_0x1833('0x2')]},'calleridnum':{'type':Sequelize[_0x1833('0x2')]},'calleridname':{'type':Sequelize[_0x1833('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1833('0x2')]},'connectedlinename':{'type':Sequelize[_0x1833('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x1833('0x2')]},'exten':{'type':Sequelize[_0x1833('0x2')]},'priority':{'type':Sequelize[_0x1833('0x3')]},'uniqueid':{'type':Sequelize[_0x1833('0x2')]},'linkedid':{'type':Sequelize[_0x1833('0x2')]},'destchannel':{'type':Sequelize[_0x1833('0x2')]},'destchannelstate':{'type':Sequelize[_0x1833('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x1833('0x2')]},'destcalleridname':{'type':Sequelize[_0x1833('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x1833('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x1833('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x1833('0x2')]},'destexten':{'type':Sequelize[_0x1833('0x2')]},'destpriority':{'type':Sequelize[_0x1833('0x3')]},'destuniqueid':{'type':Sequelize[_0x1833('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x1833('0x2')]},'dialstatus':{'type':Sequelize[_0x1833('0x2')]},'starttime':{'type':Sequelize[_0x1833('0x4')]},'answertime':{'type':Sequelize[_0x1833('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x1833('0x2')],'comment':_0x1833('0x5')},'routeId':{'type':Sequelize[_0x1833('0x3')]},'duration':{'type':Sequelize[_0x1833('0x3')]},'holdtime':{'type':Sequelize[_0x1833('0x3')]},'billableseconds':{'type':Sequelize[_0x1833('0x3')]}}; \ No newline at end of file +var _0x0397=['DATE','sequelize','exports','STRING','INTEGER'];(function(_0x2a9a95,_0x27b730){var _0x12e03b=function(_0x194548){while(--_0x194548){_0x2a9a95['push'](_0x2a9a95['shift']());}};_0x12e03b(++_0x27b730);}(_0x0397,0x169));var _0x7039=function(_0x28d231,_0x55888a){_0x28d231=_0x28d231-0x0;var _0x3814c5=_0x0397[_0x28d231];return _0x3814c5;};'use strict';var Sequelize=require(_0x7039('0x0'));module[_0x7039('0x1')]={'privilege':{'type':Sequelize[_0x7039('0x2')]},'channel':{'type':Sequelize[_0x7039('0x2')]},'channelstate':{'type':Sequelize[_0x7039('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7039('0x2')]},'calleridname':{'type':Sequelize[_0x7039('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7039('0x2')]},'connectedlinename':{'type':Sequelize[_0x7039('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7039('0x2')]},'context':{'type':Sequelize[_0x7039('0x2')]},'exten':{'type':Sequelize[_0x7039('0x2')]},'priority':{'type':Sequelize[_0x7039('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x7039('0x2')]},'destchannel':{'type':Sequelize[_0x7039('0x2')]},'destchannelstate':{'type':Sequelize[_0x7039('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x7039('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7039('0x2')]},'destcalleridname':{'type':Sequelize[_0x7039('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7039('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7039('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x7039('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7039('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7039('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x7039('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x7039('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x7039('0x3')]},'duration':{'type':Sequelize[_0x7039('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x7039('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index add60f5..90b30f2 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 _0xbbe0=['merge','VIRTUAL','includeAll','include','findAll','then','show','params','keys','rawAttributes','options','find','create','body','catch','update','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','destroy','sendStatus','stack','name','send','index','VoiceDialReport','type','key','model','map','filters','query','attributes','intersection','fields','length','nolimit','order','sort','filter','where'];(function(_0x1da572,_0x215d8f){var _0x2a94bc=function(_0x2e03fc){while(--_0x2e03fc){_0x1da572['push'](_0x1da572['shift']());}};_0x2a94bc(++_0x215d8f);}(_0xbbe0,0x1b5));var _0x0bbe=function(_0x7fe816,_0x38b3d8){_0x7fe816=_0x7fe816-0x0;var _0x1a27d8=_0xbbe0[_0x7fe816];return _0x1a27d8;};'use strict';var emlformat=require(_0x0bbe('0x0'));var rimraf=require(_0x0bbe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0bbe('0x2'));var rp=require('request-promise');var moment=require(_0x0bbe('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0bbe('0x4'));var util=require(_0x0bbe('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0bbe('0x6'));var ejs=require(_0x0bbe('0x7'));var fs=require('fs');var fs_extra=require(_0x0bbe('0x8'));var _=require(_0x0bbe('0x9'));var squel=require(_0x0bbe('0xa'));var crypto=require(_0x0bbe('0xb'));var jsforce=require(_0x0bbe('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0bbe('0x6'));var querystring=require('querystring');var Papa=require(_0x0bbe('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0bbe('0xe'));var as=require(_0x0bbe('0xf'));var hardwareService=require(_0x0bbe('0x10'));var logger=require(_0x0bbe('0x11'))(_0x0bbe('0x12'));var utils=require(_0x0bbe('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0bbe('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x410b52,_0x453202){_0x453202=_0x453202||0xcc;return function(_0x1dc3c5){if(_0x1dc3c5){return _0x410b52['sendStatus'](_0x453202);}return _0x410b52[_0x0bbe('0x15')](_0x453202)[_0x0bbe('0x16')]();};}function respondWithResult(_0x3627e4,_0x54af67){_0x54af67=_0x54af67||0xc8;return function(_0x2f4449){if(_0x2f4449){return _0x3627e4[_0x0bbe('0x15')](_0x54af67)['json'](_0x2f4449);}};}function respondWithFilteredResult(_0x514f92,_0x1fa031){return function(_0x147d4f){if(_0x147d4f){var _0x1a223d=typeof _0x1fa031[_0x0bbe('0x17')]===_0x0bbe('0x18')&&typeof _0x1fa031[_0x0bbe('0x19')]==='undefined';var _0x418945=_0x147d4f[_0x0bbe('0x1a')];var _0x376364=_0x1a223d?0x0:_0x1fa031[_0x0bbe('0x17')];var _0x38a045=_0x1a223d?_0x147d4f['count']:_0x1fa031[_0x0bbe('0x17')]+_0x1fa031[_0x0bbe('0x19')];var _0x3ab56f;if(_0x38a045>=_0x418945){_0x38a045=_0x418945;_0x3ab56f=0xc8;}else{_0x3ab56f=0xce;}_0x514f92[_0x0bbe('0x15')](_0x3ab56f);return _0x514f92[_0x0bbe('0x1b')](_0x0bbe('0x1c'),_0x376364+'-'+_0x38a045+'/'+_0x418945)[_0x0bbe('0x1d')](_0x147d4f);}return null;};}function patchUpdates(_0x5135c1){return function(_0x498ce9){try{jsonpatch['apply'](_0x498ce9,_0x5135c1,!![]);}catch(_0x458061){return BPromise[_0x0bbe('0x1e')](_0x458061);}return _0x498ce9['save']();};}function saveUpdates(_0x2975fb,_0x437adc){return function(_0x3fccfd){if(_0x3fccfd){return _0x3fccfd['update'](_0x2975fb)['then'](function(_0x116b3f){return _0x116b3f;});}return null;};}function removeEntity(_0x4836aa,_0x2dd872){return function(_0x154231){if(_0x154231){return _0x154231[_0x0bbe('0x1f')]()['then'](function(){_0x4836aa[_0x0bbe('0x15')](0xcc)[_0x0bbe('0x16')]();});}};}function handleEntityNotFound(_0x3fc17b,_0x525e16){return function(_0x2cfd3c){if(!_0x2cfd3c){_0x3fc17b[_0x0bbe('0x20')](0x194);}return _0x2cfd3c;};}function handleError(_0x771cc7,_0xe879e){_0xe879e=_0xe879e||0x1f4;return function(_0x22e0c3){logger['error'](_0x22e0c3[_0x0bbe('0x21')]);if(_0x22e0c3[_0x0bbe('0x22')]){delete _0x22e0c3[_0x0bbe('0x22')];}_0x771cc7[_0x0bbe('0x15')](_0xe879e)[_0x0bbe('0x23')](_0x22e0c3);};}exports[_0x0bbe('0x24')]=function(_0xf19aa8,_0x293343){var _0x5e1294={},_0x30357f={},_0x72784f={'count':0x0,'rows':[]};var _0x211095=_['map'](db[_0x0bbe('0x25')]['rawAttributes'],function(_0x27e9e5){return{'name':_0x27e9e5['fieldName'],'type':_0x27e9e5[_0x0bbe('0x26')][_0x0bbe('0x27')]};});_0x30357f[_0x0bbe('0x28')]=_[_0x0bbe('0x29')](_0x211095,_0x0bbe('0x22'));_0x30357f['query']=_['keys'](_0xf19aa8['query']);_0x30357f[_0x0bbe('0x2a')]=_['intersection'](_0x30357f['model'],_0x30357f[_0x0bbe('0x2b')]);_0x5e1294[_0x0bbe('0x2c')]=_[_0x0bbe('0x2d')](_0x30357f[_0x0bbe('0x28')],qs[_0x0bbe('0x2e')](_0xf19aa8[_0x0bbe('0x2b')][_0x0bbe('0x2e')]));_0x5e1294[_0x0bbe('0x2c')]=_0x5e1294[_0x0bbe('0x2c')][_0x0bbe('0x2f')]?_0x5e1294[_0x0bbe('0x2c')]:_0x30357f[_0x0bbe('0x28')];if(!_0xf19aa8[_0x0bbe('0x2b')]['hasOwnProperty'](_0x0bbe('0x30'))){_0x5e1294[_0x0bbe('0x19')]=qs[_0x0bbe('0x19')](_0xf19aa8[_0x0bbe('0x2b')]['limit']);_0x5e1294[_0x0bbe('0x17')]=qs[_0x0bbe('0x17')](_0xf19aa8[_0x0bbe('0x2b')][_0x0bbe('0x17')]);}_0x5e1294[_0x0bbe('0x31')]=qs[_0x0bbe('0x32')](_0xf19aa8[_0x0bbe('0x2b')][_0x0bbe('0x32')]);_0x5e1294['where']=qs[_0x0bbe('0x2a')](_['pick'](_0xf19aa8[_0x0bbe('0x2b')],_0x30357f[_0x0bbe('0x2a')]),_0x211095);if(_0xf19aa8[_0x0bbe('0x2b')][_0x0bbe('0x33')]){_0x5e1294[_0x0bbe('0x34')]=_[_0x0bbe('0x35')](_0x5e1294[_0x0bbe('0x34')],{'$or':_[_0x0bbe('0x29')](_0x211095,function(_0x45105e){if(_0x45105e['type']!==_0x0bbe('0x36')){var _0x231d10={};_0x231d10[_0x45105e['name']]={'$like':'%'+_0xf19aa8['query'][_0x0bbe('0x33')]+'%'};return _0x231d10;}})});}_0x5e1294=_[_0x0bbe('0x35')]({},_0x5e1294,_0xf19aa8['options']);var _0x2d50f3={'where':_0x5e1294[_0x0bbe('0x34')]};return db['VoiceDialReport']['count'](_0x2d50f3)['then'](function(_0xa64a94){_0x72784f[_0x0bbe('0x1a')]=_0xa64a94;if(_0xf19aa8['query'][_0x0bbe('0x37')]){_0x5e1294[_0x0bbe('0x38')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x0bbe('0x39')](_0x5e1294);})[_0x0bbe('0x3a')](function(_0x597e1e){_0x72784f['rows']=_0x597e1e;return _0x72784f;})['then'](respondWithFilteredResult(_0x293343,_0x5e1294))['catch'](handleError(_0x293343,null));};exports[_0x0bbe('0x3b')]=function(_0x3af3cf,_0x189d01){var _0x575a44={'raw':!![],'where':{'id':_0x3af3cf[_0x0bbe('0x3c')]['id']}},_0x32f311={};_0x32f311[_0x0bbe('0x28')]=_[_0x0bbe('0x3d')](db[_0x0bbe('0x25')][_0x0bbe('0x3e')]);_0x32f311[_0x0bbe('0x2b')]=_[_0x0bbe('0x3d')](_0x3af3cf[_0x0bbe('0x2b')]);_0x32f311[_0x0bbe('0x2a')]=_[_0x0bbe('0x2d')](_0x32f311[_0x0bbe('0x28')],_0x32f311[_0x0bbe('0x2b')]);_0x575a44[_0x0bbe('0x2c')]=_[_0x0bbe('0x2d')](_0x32f311['model'],qs['fields'](_0x3af3cf['query'][_0x0bbe('0x2e')]));_0x575a44[_0x0bbe('0x2c')]=_0x575a44['attributes'][_0x0bbe('0x2f')]?_0x575a44[_0x0bbe('0x2c')]:_0x32f311[_0x0bbe('0x28')];if(_0x3af3cf[_0x0bbe('0x2b')]['includeAll']){_0x575a44[_0x0bbe('0x38')]=[{'all':!![]}];}_0x575a44=_[_0x0bbe('0x35')]({},_0x575a44,_0x3af3cf[_0x0bbe('0x3f')]);return db[_0x0bbe('0x25')][_0x0bbe('0x40')](_0x575a44)[_0x0bbe('0x3a')](handleEntityNotFound(_0x189d01,null))['then'](respondWithResult(_0x189d01,null))['catch'](handleError(_0x189d01,null));};exports[_0x0bbe('0x41')]=function(_0x424355,_0x57e3e8){return db[_0x0bbe('0x25')]['create'](_0x424355[_0x0bbe('0x42')],{})[_0x0bbe('0x3a')](respondWithResult(_0x57e3e8,0xc9))[_0x0bbe('0x43')](handleError(_0x57e3e8,null));};exports[_0x0bbe('0x44')]=function(_0x2224b0,_0x38c80c){if(_0x2224b0['body']['id']){delete _0x2224b0[_0x0bbe('0x42')]['id'];}return db[_0x0bbe('0x25')][_0x0bbe('0x40')]({'where':{'id':_0x2224b0['params']['id']}})[_0x0bbe('0x3a')](handleEntityNotFound(_0x38c80c,null))[_0x0bbe('0x3a')](saveUpdates(_0x2224b0[_0x0bbe('0x42')],null))['then'](respondWithResult(_0x38c80c,null))[_0x0bbe('0x43')](handleError(_0x38c80c,null));};exports[_0x0bbe('0x1f')]=function(_0x1991ad,_0x40db6b){return db['VoiceDialReport'][_0x0bbe('0x40')]({'where':{'id':_0x1991ad[_0x0bbe('0x3c')]['id']}})[_0x0bbe('0x3a')](handleEntityNotFound(_0x40db6b,null))[_0x0bbe('0x3a')](removeEntity(_0x40db6b,null))[_0x0bbe('0x43')](handleError(_0x40db6b,null));};exports['describe']=function(_0x4d4c2b,_0x2b5c50){return db[_0x0bbe('0x25')][_0x0bbe('0x45')]()[_0x0bbe('0x3a')](respondWithResult(_0x2b5c50,null))[_0x0bbe('0x43')](handleError(_0x2b5c50,null));}; \ No newline at end of file +var _0x9393=['find','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll'];(function(_0x2207ef,_0x15d0b8){var _0x55a34c=function(_0x1fc912){while(--_0x1fc912){_0x2207ef['push'](_0x2207ef['shift']());}};_0x55a34c(++_0x15d0b8);}(_0x9393,0x9c));var _0x3939=function(_0x466388,_0x4a43c4){_0x466388=_0x466388-0x0;var _0x27da38=_0x9393[_0x466388];return _0x27da38;};'use strict';var emlformat=require(_0x3939('0x0'));var rimraf=require(_0x3939('0x1'));var zipdir=require(_0x3939('0x2'));var jsonpatch=require(_0x3939('0x3'));var rp=require(_0x3939('0x4'));var moment=require(_0x3939('0x5'));var BPromise=require(_0x3939('0x6'));var Mustache=require(_0x3939('0x7'));var util=require('util');var path=require(_0x3939('0x8'));var sox=require(_0x3939('0x9'));var csv=require(_0x3939('0xa'));var ejs=require(_0x3939('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3939('0xc'));var squel=require(_0x3939('0xd'));var crypto=require(_0x3939('0xe'));var jsforce=require(_0x3939('0xf'));var deskjs=require(_0x3939('0x10'));var toCsv=require(_0x3939('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3939('0x11'));var authService=require(_0x3939('0x12'));var qs=require(_0x3939('0x13'));var as=require(_0x3939('0x14'));var hardwareService=require(_0x3939('0x15'));var logger=require('../../config/logger')(_0x3939('0x16'));var utils=require(_0x3939('0x17'));var config=require(_0x3939('0x18'));var licenseUtil=require(_0x3939('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d2507,_0x326bf1){_0x326bf1=_0x326bf1||0xcc;return function(_0x4f9330){if(_0x4f9330){return _0x2d2507[_0x3939('0x1a')](_0x326bf1);}return _0x2d2507[_0x3939('0x1b')](_0x326bf1)['end']();};}function respondWithResult(_0x3c2ec3,_0x18a3f0){_0x18a3f0=_0x18a3f0||0xc8;return function(_0x150928){if(_0x150928){return _0x3c2ec3[_0x3939('0x1b')](_0x18a3f0)[_0x3939('0x1c')](_0x150928);}};}function respondWithFilteredResult(_0x27cb21,_0x560c09){return function(_0x27da2c){if(_0x27da2c){var _0x313486=typeof _0x560c09[_0x3939('0x1d')]===_0x3939('0x1e')&&typeof _0x560c09[_0x3939('0x1f')]==='undefined';var _0x1d5722=_0x27da2c[_0x3939('0x20')];var _0x1560e2=_0x313486?0x0:_0x560c09['offset'];var _0x5e57eb=_0x313486?_0x27da2c[_0x3939('0x20')]:_0x560c09[_0x3939('0x1d')]+_0x560c09[_0x3939('0x1f')];var _0x871123;if(_0x5e57eb>=_0x1d5722){_0x5e57eb=_0x1d5722;_0x871123=0xc8;}else{_0x871123=0xce;}_0x27cb21[_0x3939('0x1b')](_0x871123);return _0x27cb21[_0x3939('0x21')]('Content-Range',_0x1560e2+'-'+_0x5e57eb+'/'+_0x1d5722)['json'](_0x27da2c);}return null;};}function patchUpdates(_0x175aee){return function(_0x58b71e){try{jsonpatch[_0x3939('0x22')](_0x58b71e,_0x175aee,!![]);}catch(_0x37b628){return BPromise[_0x3939('0x23')](_0x37b628);}return _0x58b71e[_0x3939('0x24')]();};}function saveUpdates(_0x577c56,_0xdcb916){return function(_0x1f0af6){if(_0x1f0af6){return _0x1f0af6['update'](_0x577c56)[_0x3939('0x25')](function(_0x37992d){return _0x37992d;});}return null;};}function removeEntity(_0x3a9d08,_0x3f0ecd){return function(_0x1a1cab){if(_0x1a1cab){return _0x1a1cab[_0x3939('0x26')]()['then'](function(){_0x3a9d08[_0x3939('0x1b')](0xcc)[_0x3939('0x27')]();});}};}function handleEntityNotFound(_0x14f668,_0x58c53a){return function(_0x124dae){if(!_0x124dae){_0x14f668['sendStatus'](0x194);}return _0x124dae;};}function handleError(_0x357e7a,_0x252687){_0x252687=_0x252687||0x1f4;return function(_0x380cda){logger[_0x3939('0x28')](_0x380cda['stack']);if(_0x380cda[_0x3939('0x29')]){delete _0x380cda[_0x3939('0x29')];}_0x357e7a['status'](_0x252687)[_0x3939('0x2a')](_0x380cda);};}exports[_0x3939('0x2b')]=function(_0x45b95c,_0x9e943a){var _0x48d548={},_0x56177b={},_0x421ef5={'count':0x0,'rows':[]};var _0x32b77e=_[_0x3939('0x2c')](db[_0x3939('0x2d')][_0x3939('0x2e')],function(_0x44df0d){return{'name':_0x44df0d[_0x3939('0x2f')],'type':_0x44df0d[_0x3939('0x30')]['key']};});_0x56177b[_0x3939('0x31')]=_['map'](_0x32b77e,_0x3939('0x29'));_0x56177b[_0x3939('0x32')]=_['keys'](_0x45b95c[_0x3939('0x32')]);_0x56177b[_0x3939('0x33')]=_[_0x3939('0x34')](_0x56177b[_0x3939('0x31')],_0x56177b[_0x3939('0x32')]);_0x48d548[_0x3939('0x35')]=_[_0x3939('0x34')](_0x56177b[_0x3939('0x31')],qs[_0x3939('0x36')](_0x45b95c[_0x3939('0x32')][_0x3939('0x36')]));_0x48d548[_0x3939('0x35')]=_0x48d548[_0x3939('0x35')]['length']?_0x48d548[_0x3939('0x35')]:_0x56177b[_0x3939('0x31')];if(!_0x45b95c[_0x3939('0x32')][_0x3939('0x37')](_0x3939('0x38'))){_0x48d548['limit']=qs[_0x3939('0x1f')](_0x45b95c['query'][_0x3939('0x1f')]);_0x48d548[_0x3939('0x1d')]=qs[_0x3939('0x1d')](_0x45b95c[_0x3939('0x32')][_0x3939('0x1d')]);}_0x48d548[_0x3939('0x39')]=qs[_0x3939('0x3a')](_0x45b95c[_0x3939('0x32')][_0x3939('0x3a')]);_0x48d548[_0x3939('0x3b')]=qs['filters'](_[_0x3939('0x3c')](_0x45b95c[_0x3939('0x32')],_0x56177b['filters']),_0x32b77e);if(_0x45b95c[_0x3939('0x32')][_0x3939('0x3d')]){_0x48d548[_0x3939('0x3b')]=_[_0x3939('0x3e')](_0x48d548[_0x3939('0x3b')],{'$or':_['map'](_0x32b77e,function(_0x1c28bc){if(_0x1c28bc[_0x3939('0x30')]!==_0x3939('0x3f')){var _0x10ff45={};_0x10ff45[_0x1c28bc[_0x3939('0x29')]]={'$like':'%'+_0x45b95c[_0x3939('0x32')][_0x3939('0x3d')]+'%'};return _0x10ff45;}})});}_0x48d548=_[_0x3939('0x3e')]({},_0x48d548,_0x45b95c[_0x3939('0x40')]);var _0x2ef80d={'where':_0x48d548[_0x3939('0x3b')]};return db[_0x3939('0x2d')][_0x3939('0x20')](_0x2ef80d)[_0x3939('0x25')](function(_0x45cc33){_0x421ef5[_0x3939('0x20')]=_0x45cc33;if(_0x45b95c[_0x3939('0x32')]['includeAll']){_0x48d548[_0x3939('0x41')]=[{'all':!![]}];}return db[_0x3939('0x2d')]['findAll'](_0x48d548);})['then'](function(_0x52c4c3){_0x421ef5[_0x3939('0x42')]=_0x52c4c3;return _0x421ef5;})['then'](respondWithFilteredResult(_0x9e943a,_0x48d548))[_0x3939('0x43')](handleError(_0x9e943a,null));};exports[_0x3939('0x44')]=function(_0x1404d2,_0x1721dc){var _0xc79158={'raw':!![],'where':{'id':_0x1404d2[_0x3939('0x45')]['id']}},_0x3996fd={};_0x3996fd[_0x3939('0x31')]=_[_0x3939('0x46')](db[_0x3939('0x2d')][_0x3939('0x2e')]);_0x3996fd['query']=_[_0x3939('0x46')](_0x1404d2[_0x3939('0x32')]);_0x3996fd[_0x3939('0x33')]=_['intersection'](_0x3996fd[_0x3939('0x31')],_0x3996fd[_0x3939('0x32')]);_0xc79158[_0x3939('0x35')]=_[_0x3939('0x34')](_0x3996fd['model'],qs[_0x3939('0x36')](_0x1404d2['query'][_0x3939('0x36')]));_0xc79158[_0x3939('0x35')]=_0xc79158[_0x3939('0x35')]['length']?_0xc79158[_0x3939('0x35')]:_0x3996fd[_0x3939('0x31')];if(_0x1404d2['query'][_0x3939('0x47')]){_0xc79158['include']=[{'all':!![]}];}_0xc79158=_[_0x3939('0x3e')]({},_0xc79158,_0x1404d2['options']);return db[_0x3939('0x2d')][_0x3939('0x48')](_0xc79158)[_0x3939('0x25')](handleEntityNotFound(_0x1721dc,null))[_0x3939('0x25')](respondWithResult(_0x1721dc,null))[_0x3939('0x43')](handleError(_0x1721dc,null));};exports['create']=function(_0xaadac2,_0x353929){return db[_0x3939('0x2d')]['create'](_0xaadac2[_0x3939('0x49')],{})[_0x3939('0x25')](respondWithResult(_0x353929,0xc9))[_0x3939('0x43')](handleError(_0x353929,null));};exports[_0x3939('0x4a')]=function(_0x28b8bd,_0x4dd46a){if(_0x28b8bd[_0x3939('0x49')]['id']){delete _0x28b8bd[_0x3939('0x49')]['id'];}return db[_0x3939('0x2d')][_0x3939('0x48')]({'where':{'id':_0x28b8bd['params']['id']}})[_0x3939('0x25')](handleEntityNotFound(_0x4dd46a,null))[_0x3939('0x25')](saveUpdates(_0x28b8bd[_0x3939('0x49')],null))[_0x3939('0x25')](respondWithResult(_0x4dd46a,null))[_0x3939('0x43')](handleError(_0x4dd46a,null));};exports[_0x3939('0x26')]=function(_0x283c26,_0x3d4b86){return db[_0x3939('0x2d')][_0x3939('0x48')]({'where':{'id':_0x283c26[_0x3939('0x45')]['id']}})[_0x3939('0x25')](handleEntityNotFound(_0x3d4b86,null))['then'](removeEntity(_0x3d4b86,null))[_0x3939('0x43')](handleError(_0x3d4b86,null));};exports[_0x3939('0x4b')]=function(_0x18659e,_0x1d941d){return db[_0x3939('0x2d')][_0x3939('0x4b')]()[_0x3939('0x25')](respondWithResult(_0x1d941d,null))[_0x3939('0x43')](handleError(_0x1d941d,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 6a28bb7..94adb1e 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 _0x105e=['bluebird','path','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger','api'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x105e,0x1dd));var _0xe105=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x105e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe105('0x0'));var util=require('util');var logger=require(_0xe105('0x1'))(_0xe105('0x2'));var moment=require('moment');var BPromise=require(_0xe105('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe105('0x4'));var rimraf=require('rimraf');var config=require(_0xe105('0x5'));var attributes=require(_0xe105('0x6'));module[_0xe105('0x7')]=function(_0xb9601c,_0x4cbc83){return _0xb9601c[_0xe105('0x8')](_0xe105('0x9'),attributes,{'tableName':_0xe105('0xa'),'paranoid':![],'indexes':[{'fields':[_0xe105('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x12c9=['./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0x12c9,0x131));var _0x912c=function(_0x26e098,_0x4515aa){_0x26e098=_0x26e098-0x0;var _0x53f6a6=_0x12c9[_0x26e098];return _0x53f6a6;};'use strict';var _=require(_0x912c('0x0'));var util=require(_0x912c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x912c('0x2'));var BPromise=require(_0x912c('0x3'));var rp=require(_0x912c('0x4'));var fs=require('fs');var path=require(_0x912c('0x5'));var rimraf=require(_0x912c('0x6'));var config=require('../../config/environment');var attributes=require(_0x912c('0x7'));module[_0x912c('0x8')]=function(_0x4d843,_0xe764d1){return _0x4d843[_0x912c('0x9')](_0x912c('0xa'),attributes,{'tableName':_0x912c('0xb'),'paranoid':![],'indexes':[{'fields':[_0x912c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 5964335..365bf6f 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 _0x07f0=['error','code','message','catch','CreateVoiceDialReport','VoiceDialReport','create','options','UpdateVoiceDialReport','update','body','raw','where','attributes','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4f9d3c,_0x23d6e0){var _0x3ab489=function(_0x1d8f3e){while(--_0x1d8f3e){_0x4f9d3c['push'](_0x4f9d3c['shift']());}};_0x3ab489(++_0x23d6e0);}(_0x07f0,0xfd));var _0x007f=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x07f0[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x007f('0x0'));var util=require(_0x007f('0x1'));var moment=require(_0x007f('0x2'));var BPromise=require(_0x007f('0x3'));var rs=require(_0x007f('0x4'));var fs=require('fs');var Redis=require(_0x007f('0x5'));var db=require(_0x007f('0x6'))['db'];var utils=require(_0x007f('0x7'));var logger=require(_0x007f('0x8'))(_0x007f('0x9'));var config=require('../../config/environment');var jayson=require(_0x007f('0xa'));var client=jayson[_0x007f('0xb')][_0x007f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x260ce3,_0x2d7dcd,_0xca7e57){return new BPromise(function(_0xccc612,_0x3539f0){return client[_0x007f('0xd')](_0x260ce3,_0xca7e57)[_0x007f('0xe')](function(_0x47e23a){logger[_0x007f('0xf')](_0x007f('0x10'),_0x2d7dcd,_0x007f('0x11'));logger[_0x007f('0x12')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x2d7dcd,_0x007f('0x11'),JSON['stringify'](_0x47e23a));if(_0x47e23a[_0x007f('0x13')]){if(_0x47e23a[_0x007f('0x13')][_0x007f('0x14')]===0x1f4){logger[_0x007f('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x2d7dcd,_0x47e23a[_0x007f('0x13')][_0x007f('0x15')]);return _0x3539f0(_0x47e23a[_0x007f('0x13')][_0x007f('0x15')]);}logger[_0x007f('0x13')](_0x007f('0x10'),_0x2d7dcd,_0x47e23a[_0x007f('0x13')][_0x007f('0x15')]);return _0xccc612(_0x47e23a[_0x007f('0x13')]['message']);}else{logger['info'](_0x007f('0x10'),_0x2d7dcd,_0x007f('0x11'));_0xccc612(_0x47e23a['result'][_0x007f('0x15')]);}})[_0x007f('0x16')](function(_0x11cfd8){logger[_0x007f('0x13')](_0x007f('0x10'),_0x2d7dcd,_0x11cfd8);_0x3539f0(_0x11cfd8);});});}exports[_0x007f('0x17')]=function(_0x53e40b){var _0x6966ad=this;return new Promise(function(_0x10cc86,_0x4b30fa){return db[_0x007f('0x18')][_0x007f('0x19')](_0x53e40b['body'],{'raw':_0x53e40b[_0x007f('0x1a')]?_0x53e40b[_0x007f('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x007f('0xe')](function(_0x54da2c){logger[_0x007f('0xf')]('CreateVoiceDialReport',_0x53e40b);logger[_0x007f('0x12')](_0x007f('0x17'),_0x53e40b,JSON['stringify'](_0x54da2c));_0x10cc86(_0x54da2c);})['catch'](function(_0x3aef30){logger['error'](_0x007f('0x17'),_0x3aef30[_0x007f('0x15')],_0x53e40b);_0x4b30fa(_0x6966ad[_0x007f('0x13')](0x1f4,_0x3aef30['message']));});});};exports[_0x007f('0x1b')]=function(_0x143fca){var _0x4c0ead=this;return new Promise(function(_0x27682a,_0x2901cd){return db['VoiceDialReport'][_0x007f('0x1c')](_0x143fca[_0x007f('0x1d')],{'raw':_0x143fca[_0x007f('0x1a')]?_0x143fca[_0x007f('0x1a')][_0x007f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x143fca[_0x007f('0x1a')]?_0x143fca['options'][_0x007f('0x1f')]||null:null,'attributes':_0x143fca[_0x007f('0x1a')]?_0x143fca[_0x007f('0x1a')][_0x007f('0x20')]||null:null,'limit':_0x143fca['options']?_0x143fca[_0x007f('0x1a')]['limit']||null:null})[_0x007f('0xe')](function(_0x5c270a){logger['info'](_0x007f('0x1b'),_0x143fca);logger['debug'](_0x007f('0x1b'),_0x143fca,JSON[_0x007f('0x21')](_0x5c270a));_0x27682a(_0x5c270a);})[_0x007f('0x16')](function(_0x1853b4){logger[_0x007f('0x13')](_0x007f('0x1b'),_0x1853b4['message'],_0x143fca);_0x2901cd(_0x4c0ead['error'](0x1f4,_0x1853b4[_0x007f('0x15')]));});});}; \ No newline at end of file +var _0x696b=['update','body','where','then','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceDialReport','create','options','CreateVoiceDialReport','UpdateVoiceDialReport'];(function(_0x58c010,_0x413a4a){var _0x344f41=function(_0x809bd8){while(--_0x809bd8){_0x58c010['push'](_0x58c010['shift']());}};_0x344f41(++_0x413a4a);}(_0x696b,0xc8));var _0xb696=function(_0xf39cab,_0x6e0d72){_0xf39cab=_0xf39cab-0x0;var _0x55a588=_0x696b[_0xf39cab];return _0x55a588;};'use strict';var _=require(_0xb696('0x0'));var util=require(_0xb696('0x1'));var moment=require(_0xb696('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb696('0x3'));var db=require(_0xb696('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb696('0x5'));var config=require(_0xb696('0x6'));var jayson=require(_0xb696('0x7'));var client=jayson['client'][_0xb696('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa4081d,_0x5eff93,_0x2dd391){return new BPromise(function(_0x5e3fa9,_0x379edf){return client['request'](_0xa4081d,_0x2dd391)['then'](function(_0x50f1c7){logger[_0xb696('0x9')](_0xb696('0xa'),_0x5eff93,_0xb696('0xb'));logger[_0xb696('0xc')](_0xb696('0xd'),_0x5eff93,_0xb696('0xb'),JSON[_0xb696('0xe')](_0x50f1c7));if(_0x50f1c7[_0xb696('0xf')]){if(_0x50f1c7['error'][_0xb696('0x10')]===0x1f4){logger[_0xb696('0xf')](_0xb696('0xa'),_0x5eff93,_0x50f1c7['error'][_0xb696('0x11')]);return _0x379edf(_0x50f1c7[_0xb696('0xf')][_0xb696('0x11')]);}logger[_0xb696('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x5eff93,_0x50f1c7[_0xb696('0xf')][_0xb696('0x11')]);return _0x5e3fa9(_0x50f1c7['error'][_0xb696('0x11')]);}else{logger['info'](_0xb696('0xa'),_0x5eff93,_0xb696('0xb'));_0x5e3fa9(_0x50f1c7['result'][_0xb696('0x11')]);}})[_0xb696('0x12')](function(_0x4e994c){logger[_0xb696('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x5eff93,_0x4e994c);_0x379edf(_0x4e994c);});});}exports['CreateVoiceDialReport']=function(_0x399dda){var _0x49d5ca=this;return new Promise(function(_0x14af44,_0x11859e){return db[_0xb696('0x13')][_0xb696('0x14')](_0x399dda['body'],{'raw':_0x399dda[_0xb696('0x15')]?_0x399dda[_0xb696('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4c7f88){logger[_0xb696('0x9')](_0xb696('0x16'),_0x399dda);logger[_0xb696('0xc')](_0xb696('0x16'),_0x399dda,JSON[_0xb696('0xe')](_0x4c7f88));_0x14af44(_0x4c7f88);})[_0xb696('0x12')](function(_0x2c42d5){logger[_0xb696('0xf')]('CreateVoiceDialReport',_0x2c42d5[_0xb696('0x11')],_0x399dda);_0x11859e(_0x49d5ca[_0xb696('0xf')](0x1f4,_0x2c42d5[_0xb696('0x11')]));});});};exports[_0xb696('0x17')]=function(_0x5b065f){var _0x86d64f=this;return new Promise(function(_0x197e14,_0x1a7dcd){return db[_0xb696('0x13')][_0xb696('0x18')](_0x5b065f[_0xb696('0x19')],{'raw':_0x5b065f[_0xb696('0x15')]?_0x5b065f[_0xb696('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b065f['options']?_0x5b065f[_0xb696('0x15')][_0xb696('0x1a')]||null:null,'attributes':_0x5b065f[_0xb696('0x15')]?_0x5b065f[_0xb696('0x15')]['attributes']||null:null,'limit':_0x5b065f['options']?_0x5b065f[_0xb696('0x15')]['limit']||null:null})[_0xb696('0x1b')](function(_0x50fc61){logger[_0xb696('0x9')](_0xb696('0x17'),_0x5b065f);logger[_0xb696('0xc')](_0xb696('0x17'),_0x5b065f,JSON[_0xb696('0xe')](_0x50fc61));_0x197e14(_0x50fc61);})[_0xb696('0x12')](function(_0x2eeb6f){logger['error']('UpdateVoiceDialReport',_0x2eeb6f[_0xb696('0x11')],_0x5b065f);_0x1a7dcd(_0x86d64f[_0xb696('0xf')](0x1f4,_0x2eeb6f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index f829d04..7806524 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 _0xe0bd=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','update','destroy','exports','multer','util'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0xe0bd,0x17a));var _0xde0b=function(_0x5a4400,_0xfae3b6){_0x5a4400=_0x5a4400-0x0;var _0xf9b532=_0xe0bd[_0x5a4400];return _0xf9b532;};'use strict';var multer=require(_0xde0b('0x0'));var util=require(_0xde0b('0x1'));var path=require(_0xde0b('0x2'));var timeout=require(_0xde0b('0x3'));var express=require(_0xde0b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xde0b('0x5'));var interaction=require(_0xde0b('0x6'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0xde0b('0x7')]('/',auth[_0xde0b('0x8')](),controller[_0xde0b('0x9')]);router[_0xde0b('0x7')](_0xde0b('0xa'),auth[_0xde0b('0x8')](),controller[_0xde0b('0xb')]);router[_0xde0b('0xc')]('/',auth[_0xde0b('0x8')](),controller[_0xde0b('0xd')]);router[_0xde0b('0xc')](_0xde0b('0xe'),auth[_0xde0b('0x8')](),controller[_0xde0b('0xf')]);router['put'](_0xde0b('0xa'),auth[_0xde0b('0x8')](),controller[_0xde0b('0x10')]);router['delete'](_0xde0b('0xa'),auth[_0xde0b('0x8')](),controller[_0xde0b('0x11')]);module[_0xde0b('0x12')]=router; \ No newline at end of file +var _0x07c3=['../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x07c3,0x1a8));var _0x307c=function(_0x2c69a1,_0x201903){_0x2c69a1=_0x2c69a1-0x0;var _0x24bb91=_0x07c3[_0x2c69a1];return _0x24bb91;};'use strict';var multer=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var path=require(_0x307c('0x2'));var timeout=require(_0x307c('0x3'));var express=require('express');var router=express[_0x307c('0x4')]();var fs_extra=require(_0x307c('0x5'));var auth=require(_0x307c('0x6'));var interaction=require(_0x307c('0x7'));var config=require(_0x307c('0x8'));var controller=require(_0x307c('0x9'));router[_0x307c('0xa')]('/',auth[_0x307c('0xb')](),controller[_0x307c('0xc')]);router['get'](_0x307c('0xd'),auth[_0x307c('0xb')](),controller[_0x307c('0xe')]);router[_0x307c('0xf')]('/',auth[_0x307c('0xb')](),controller[_0x307c('0x10')]);router[_0x307c('0xf')](_0x307c('0x11'),auth[_0x307c('0xb')](),controller[_0x307c('0x12')]);router[_0x307c('0x13')](_0x307c('0xd'),auth['isAuthenticated'](),controller[_0x307c('0x14')]);router[_0x307c('0x15')](_0x307c('0xd'),auth['isAuthenticated'](),controller[_0x307c('0x16')]);module[_0x307c('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 65aea50..240f91a 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(_0x34d71a,_0x4a0328){var _0xf7a535=function(_0x1b5a1e){while(--_0x1b5a1e){_0x34d71a['push'](_0x34d71a['shift']());}};_0xf7a535(++_0x4a0328);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x2f8249,_0xb849cc){var _0x874c3d=function(_0x51b803){while(--_0x51b803){_0x2f8249['push'](_0x2f8249['shift']());}};_0x874c3d(++_0xb849cc);}(_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')]={'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 b5fab4d..beaf823 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 _0x084d=['recordingFormat','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','./voiceExtension.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','get','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','type','name','destroy','error','stack','send','index','VoiceExtension','rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','InboundRoutes','InternalRoutes','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description'];(function(_0x431c0a,_0x477641){var _0x388514=function(_0x32bdc1){while(--_0x32bdc1){_0x431c0a['push'](_0x431c0a['shift']());}};_0x388514(++_0x477641);}(_0x084d,0x147));var _0xd084=function(_0x3b24f3,_0x236a66){_0x3b24f3=_0x3b24f3-0x0;var _0x4828af=_0x084d[_0x3b24f3];return _0x4828af;};'use strict';var emlformat=require(_0xd084('0x0'));var rimraf=require(_0xd084('0x1'));var zipdir=require(_0xd084('0x2'));var jsonpatch=require(_0xd084('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd084('0x4'));var Mustache=require(_0xd084('0x5'));var util=require(_0xd084('0x6'));var path=require(_0xd084('0x7'));var sox=require(_0xd084('0x8'));var csv=require(_0xd084('0x9'));var ejs=require(_0xd084('0xa'));var fs=require('fs');var fs_extra=require(_0xd084('0xb'));var _=require(_0xd084('0xc'));var squel=require(_0xd084('0xd'));var crypto=require(_0xd084('0xe'));var jsforce=require(_0xd084('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd084('0x9'));var querystring=require(_0xd084('0x10'));var Papa=require('papaparse');var Redis=require(_0xd084('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd084('0x12'));var as=require(_0xd084('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd084('0x14'))(_0xd084('0x15'));var utils=require(_0xd084('0x16'));var config=require(_0xd084('0x17'));var licenseUtil=require(_0xd084('0x18'));var db=require(_0xd084('0x19'))['db'];config['redis']=_[_0xd084('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd084('0x1b'))[_0xd084('0x1c')](socket);function respondWithStatusCode(_0x5bef50,_0x4aebfe){_0x4aebfe=_0x4aebfe||0xcc;return function(_0x2ee62d){if(_0x2ee62d){return _0x5bef50['sendStatus'](_0x4aebfe);}return _0x5bef50[_0xd084('0x1d')](_0x4aebfe)[_0xd084('0x1e')]();};}function respondWithResult(_0x54e748,_0x380843){_0x380843=_0x380843||0xc8;return function(_0x44a705){if(_0x44a705){return _0x54e748[_0xd084('0x1d')](_0x380843)[_0xd084('0x1f')](_0x44a705);}};}function respondWithFilteredResult(_0x2c2447,_0x4218a0){return function(_0x477a14){if(_0x477a14){var _0x415a04=typeof _0x4218a0['offset']===_0xd084('0x20')&&typeof _0x4218a0[_0xd084('0x21')]==='undefined';var _0x333ba3=_0x477a14[_0xd084('0x22')];var _0x1f82fc=_0x415a04?0x0:_0x4218a0[_0xd084('0x23')];var _0x2860fb=_0x415a04?_0x477a14[_0xd084('0x22')]:_0x4218a0[_0xd084('0x23')]+_0x4218a0['limit'];var _0x4c4cb5;if(_0x2860fb>=_0x333ba3){_0x2860fb=_0x333ba3;_0x4c4cb5=0xc8;}else{_0x4c4cb5=0xce;}_0x2c2447[_0xd084('0x1d')](_0x4c4cb5);return _0x2c2447[_0xd084('0x24')](_0xd084('0x25'),_0x1f82fc+'-'+_0x2860fb+'/'+_0x333ba3)[_0xd084('0x1f')](_0x477a14);}return null;};}function patchUpdates(_0x501b49){return function(_0x210a16){try{jsonpatch['apply'](_0x210a16,_0x501b49,!![]);}catch(_0x2f4c65){return BPromise['reject'](_0x2f4c65);}return _0x210a16[_0xd084('0x26')]();};}function saveUpdates(_0x16bc12,_0x51c4cd){return function(_0x5e2a3f){if(_0x5e2a3f){return _0x5e2a3f[_0xd084('0x27')](_0x16bc12)[_0xd084('0x28')](function(_0xf7f500){return _0xf7f500;});}return null;};}function removeEntity(_0xeb48cc,_0x58a7cf){return function(_0x1f8f6b){if(_0x1f8f6b){return _0x1f8f6b['destroy']()[_0xd084('0x28')](function(){var _0x1204cc=_0x1f8f6b[_0xd084('0x29')]({'plain':!![]});var _0x148397=[{'name':'InboundRoutes','value':_0xd084('0x2a'),'ignore':![]},{'name':_0xd084('0x2b'),'value':_0xd084('0x2c'),'ignore':![]},{'name':'InternalRoutes','value':_0xd084('0x2d'),'ignore':![]}];var _0x3800e1=_(_0x148397)[_0xd084('0x2e')](_0xd084('0x2f'))[_0xd084('0x30')](_0xd084('0x31'))[_0xd084('0x31')]();if(_[_0xd084('0x32')](_0x3800e1,_0x1204cc['type'])){return;}var _0x371efc=_['find'](_0x148397,[_0xd084('0x31'),_0x1204cc[_0xd084('0x33')]])[_0xd084('0x34')];return db['UserProfileResource'][_0xd084('0x35')]({'where':{'type':_0x371efc,'resourceId':_0x1204cc['id']}})[_0xd084('0x28')](function(){return _0x1f8f6b;});})[_0xd084('0x28')](function(){_0xeb48cc['status'](0xcc)[_0xd084('0x1e')]();});}};}function handleEntityNotFound(_0x5d5252,_0x25386a){return function(_0x39c739){if(!_0x39c739){_0x5d5252['sendStatus'](0x194);}return _0x39c739;};}function handleError(_0x238d96,_0x1a8ca4){_0x1a8ca4=_0x1a8ca4||0x1f4;return function(_0x11d5b5){logger[_0xd084('0x36')](_0x11d5b5[_0xd084('0x37')]);if(_0x11d5b5[_0xd084('0x34')]){delete _0x11d5b5['name'];}_0x238d96[_0xd084('0x1d')](_0x1a8ca4)[_0xd084('0x38')](_0x11d5b5);};}exports[_0xd084('0x39')]=function(_0x2812c3,_0x29855b){var _0x5445ee={},_0x5d28e3={},_0x42a29a={'count':0x0,'rows':[]};var _0x286cd7=_[_0xd084('0x30')](db[_0xd084('0x3a')][_0xd084('0x3b')],function(_0x42fc1e){return{'name':_0x42fc1e['fieldName'],'type':_0x42fc1e[_0xd084('0x33')]['key']};});_0x5d28e3['model']=_[_0xd084('0x30')](_0x286cd7,_0xd084('0x34'));_0x5d28e3[_0xd084('0x3c')]=_['keys'](_0x2812c3[_0xd084('0x3c')]);_0x5d28e3[_0xd084('0x3d')]=_[_0xd084('0x3e')](_0x5d28e3[_0xd084('0x3f')],_0x5d28e3[_0xd084('0x3c')]);_0x5445ee[_0xd084('0x40')]=_[_0xd084('0x3e')](_0x5d28e3[_0xd084('0x3f')],qs[_0xd084('0x41')](_0x2812c3['query'][_0xd084('0x41')]));_0x5445ee['attributes']=_0x5445ee[_0xd084('0x40')]['length']?_0x5445ee['attributes']:_0x5d28e3[_0xd084('0x3f')];if(!_0x2812c3[_0xd084('0x3c')][_0xd084('0x42')]('nolimit')){_0x5445ee[_0xd084('0x21')]=qs[_0xd084('0x21')](_0x2812c3[_0xd084('0x3c')]['limit']);_0x5445ee['offset']=qs[_0xd084('0x23')](_0x2812c3[_0xd084('0x3c')][_0xd084('0x23')]);}_0x5445ee[_0xd084('0x43')]=qs['sort'](_0x2812c3['query'][_0xd084('0x44')]);_0x5445ee['where']=qs[_0xd084('0x3d')](_[_0xd084('0x45')](_0x2812c3[_0xd084('0x3c')],_0x5d28e3[_0xd084('0x3d')]),_0x286cd7);if(_0x2812c3[_0xd084('0x3c')][_0xd084('0x2e')]){_0x5445ee['where']=_[_0xd084('0x46')](_0x5445ee[_0xd084('0x47')],{'$or':_['map'](_0x286cd7,function(_0x3c07a3){if(_0x3c07a3[_0xd084('0x33')]!==_0xd084('0x48')){var _0xb89919={};_0xb89919[_0x3c07a3[_0xd084('0x34')]]={'$like':'%'+_0x2812c3[_0xd084('0x3c')][_0xd084('0x2e')]+'%'};return _0xb89919;}})});}_0x5445ee=_['merge']({},_0x5445ee,_0x2812c3[_0xd084('0x49')]);var _0x2f9f66={'where':_0x5445ee[_0xd084('0x47')]};return db[_0xd084('0x3a')][_0xd084('0x22')](_0x2f9f66)[_0xd084('0x28')](function(_0xc6fc3){_0x42a29a[_0xd084('0x22')]=_0xc6fc3;if(_0x2812c3[_0xd084('0x3c')][_0xd084('0x4a')]){_0x5445ee[_0xd084('0x4b')]=[{'all':!![]}];}return db[_0xd084('0x3a')][_0xd084('0x4c')](_0x5445ee);})[_0xd084('0x28')](function(_0x39bbad){_0x42a29a[_0xd084('0x4d')]=_0x39bbad;return _0x42a29a;})[_0xd084('0x28')](respondWithFilteredResult(_0x29855b,_0x5445ee))[_0xd084('0x4e')](handleError(_0x29855b,null));};exports['show']=function(_0x265288,_0x29ba0b){var _0xc1b983={'raw':![],'where':{'id':_0x265288['params']['id']}},_0xf7606e={};_0xf7606e[_0xd084('0x3f')]=_['keys'](db[_0xd084('0x3a')][_0xd084('0x3b')]);_0xf7606e[_0xd084('0x3c')]=_[_0xd084('0x4f')](_0x265288[_0xd084('0x3c')]);_0xf7606e[_0xd084('0x3d')]=_['intersection'](_0xf7606e['model'],_0xf7606e[_0xd084('0x3c')]);_0xc1b983[_0xd084('0x40')]=_[_0xd084('0x3e')](_0xf7606e[_0xd084('0x3f')],qs[_0xd084('0x41')](_0x265288[_0xd084('0x3c')][_0xd084('0x41')]));_0xc1b983[_0xd084('0x40')]=_0xc1b983['attributes']['length']?_0xc1b983[_0xd084('0x40')]:_0xf7606e[_0xd084('0x3f')];if(_0x265288[_0xd084('0x3c')][_0xd084('0x4a')]){_0xc1b983[_0xd084('0x4b')]=[{'all':!![]}];}_0xc1b983=_[_0xd084('0x46')]({},_0xc1b983,_0x265288[_0xd084('0x49')]);return db[_0xd084('0x3a')][_0xd084('0x50')](_0xc1b983)[_0xd084('0x28')](handleEntityNotFound(_0x29ba0b,null))[_0xd084('0x28')](respondWithResult(_0x29ba0b,null))[_0xd084('0x4e')](handleError(_0x29ba0b,null));};exports[_0xd084('0x35')]=function(_0xbbb03c,_0x3c5d62){return db['VoiceExtension'][_0xd084('0x50')]({'where':{'id':_0xbbb03c[_0xd084('0x51')]['id']}})[_0xd084('0x28')](handleEntityNotFound(_0x3c5d62,null))[_0xd084('0x28')](removeEntity(_0x3c5d62,null))[_0xd084('0x4e')](handleError(_0x3c5d62,null));};exports[_0xd084('0x52')]=function(_0x2aab19,_0x3690de){if(_0x2aab19[_0xd084('0x53')]['type']===_0xd084('0x2c')&&!_[_0xd084('0x54')](_0x2aab19['body'][_0xd084('0x55')],'_')){_0x2aab19[_0xd084('0x53')][_0xd084('0x55')]='_'[_0xd084('0x56')](_0x2aab19[_0xd084('0x53')][_0xd084('0x55')]);}return db['VoiceExtension'][_0xd084('0x52')](_0x2aab19[_0xd084('0x53')],{'raw':![]})['then'](function(_0x3e854e){var _0x5af9df=_0x2aab19[_0xd084('0x57')][_0xd084('0x29')]({'plain':!![]});if(!_0x5af9df)throw new Error(_0xd084('0x58'));if(_0x5af9df['role']===_0xd084('0x57')){var _0x54d99e=_0x3e854e['get']({'plain':!![]});var _0x3f7534=[{'name':_0xd084('0x59'),'value':'inbound'},{'name':'OutboundRoutes','value':_0xd084('0x2c')},{'name':_0xd084('0x5a'),'value':_0xd084('0x2d')}];var _0x52cbf3=_[_0xd084('0x50')](_0x3f7534,['value',_0x54d99e[_0xd084('0x33')]])[_0xd084('0x34')];return db[_0xd084('0x5b')][_0xd084('0x50')]({'where':{'name':_0x52cbf3,'userProfileId':_0x5af9df['userProfileId']},'raw':!![]})[_0xd084('0x28')](function(_0x5a952b){if(_0x5a952b&&_0x5a952b[_0xd084('0x5c')]===0x0){return db[_0xd084('0x5d')]['create']({'name':_0x54d99e['name'],'resourceId':_0x54d99e['id'],'type':_0x5a952b[_0xd084('0x34')],'sectionId':_0x5a952b['id']},{})[_0xd084('0x28')](function(){return _0x3e854e;});}else{return _0x3e854e;}})['catch'](function(_0x38473e){logger['error'](_0xd084('0x5e'),_0x38473e);throw _0x38473e;});}return _0x3e854e;})[_0xd084('0x28')](respondWithResult(_0x3690de,0xc9))[_0xd084('0x4e')](handleError(_0x3690de,null));};exports[_0xd084('0x27')]=function(_0x205fa6,_0x3b8b98){if(_0x205fa6[_0xd084('0x53')]['id']){delete _0x205fa6[_0xd084('0x53')]['id'];}return db['VoiceExtension'][_0xd084('0x50')]({'where':{'id':_0x205fa6[_0xd084('0x51')]['id']}})[_0xd084('0x28')](handleEntityNotFound(_0x3b8b98,null))['then'](function(_0x1222be){if(_0x1222be){return db[_0xd084('0x3a')][_0xd084('0x27')](_[_0xd084('0x45')](_0x205fa6[_0xd084('0x53')],[_0xd084('0x55'),_0xd084('0x5f'),_0xd084('0x60'),_0xd084('0x61'),'cutdigits',_0xd084('0x62')]),{'where':{'context':_0x1222be[_0xd084('0x5f')],'exten':_0x1222be[_0xd084('0x55')]},'individualHooks':!![]})[_0xd084('0x28')](function(_0x524f60){return _0x524f60;});}return null;})[_0xd084('0x28')](respondWithStatusCode(_0x3b8b98,null))[_0xd084('0x4e')](handleError(_0x3b8b98,null));};exports[_0xd084('0x63')]=function(_0x189b2f,_0x41b53d,_0x888240){return db[_0xd084('0x3a')][_0xd084('0x64')]({'where':{'id':_0x189b2f[_0xd084('0x51')]['id']}})[_0xd084('0x28')](handleEntityNotFound(_0x41b53d,null))['then'](function(_0x56c229){if(_0x56c229){return db[_0xd084('0x65')][_0xd084('0x66')](function(_0xeed999){return db[_0xd084('0x3a')]['destroy']({'where':{'VoiceExtensionId':_0x189b2f['params']['id']},'transaction':_0xeed999})[_0xd084('0x28')](function(_0x1db089){var _0x2fe161=_[_0xd084('0x30')](_0x189b2f[_0xd084('0x53')],function(_0xc2fdce){_0xc2fdce[_0xd084('0x67')]=_0x189b2f[_0xd084('0x51')]['id'];return _0xc2fdce;});return db[_0xd084('0x3a')][_0xd084('0x68')](_0x2fe161,{'transaction':_0xeed999});});})[_0xd084('0x28')](function(){return db[_0xd084('0x3a')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x189b2f[_0xd084('0x51')]['id']},'order':_0xd084('0x69')});});}})[_0xd084('0x28')](respondWithResult(_0x41b53d,null))[_0xd084('0x4e')](handleError(_0x41b53d,null));}; \ No newline at end of file +var _0xd663=['update','context','description','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','value','includes','type','find','UserProfileResource','error','stack','name','send','index','map','VoiceExtension','rawAttributes','fieldName','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','startsWith','exten','concat','role','user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x51995b,_0x3f5a93){var _0x4ddcd4=function(_0x7ba3b2){while(--_0x7ba3b2){_0x51995b['push'](_0x51995b['shift']());}};_0x4ddcd4(++_0x3f5a93);}(_0xd663,0xf0));var _0x3d66=function(_0x5968cf,_0x55a45f){_0x5968cf=_0x5968cf-0x0;var _0x115f7a=_0xd663[_0x5968cf];return _0x115f7a;};'use strict';var emlformat=require(_0x3d66('0x0'));var rimraf=require(_0x3d66('0x1'));var zipdir=require(_0x3d66('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3d66('0x3'));var moment=require(_0x3d66('0x4'));var BPromise=require(_0x3d66('0x5'));var Mustache=require('mustache');var util=require(_0x3d66('0x6'));var path=require(_0x3d66('0x7'));var sox=require(_0x3d66('0x8'));var csv=require('to-csv');var ejs=require(_0x3d66('0x9'));var fs=require('fs');var fs_extra=require(_0x3d66('0xa'));var _=require(_0x3d66('0xb'));var squel=require(_0x3d66('0xc'));var crypto=require('crypto');var jsforce=require(_0x3d66('0xd'));var deskjs=require(_0x3d66('0xe'));var toCsv=require(_0x3d66('0xf'));var querystring=require(_0x3d66('0x10'));var Papa=require('papaparse');var Redis=require(_0x3d66('0x11'));var authService=require(_0x3d66('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3d66('0x13'));var hardwareService=require(_0x3d66('0x14'));var logger=require(_0x3d66('0x15'))(_0x3d66('0x16'));var utils=require(_0x3d66('0x17'));var config=require(_0x3d66('0x18'));var licenseUtil=require(_0x3d66('0x19'));var db=require(_0x3d66('0x1a'))['db'];config['redis']=_[_0x3d66('0x1b')](config[_0x3d66('0x1c')],{'host':_0x3d66('0x1d'),'port':0x18eb});var socket=require(_0x3d66('0x1e'))(new Redis(config[_0x3d66('0x1c')]));require(_0x3d66('0x1f'))[_0x3d66('0x20')](socket);function respondWithStatusCode(_0x1c0d13,_0x139835){_0x139835=_0x139835||0xcc;return function(_0xa089ea){if(_0xa089ea){return _0x1c0d13[_0x3d66('0x21')](_0x139835);}return _0x1c0d13[_0x3d66('0x22')](_0x139835)[_0x3d66('0x23')]();};}function respondWithResult(_0x5b2396,_0x2a16b8){_0x2a16b8=_0x2a16b8||0xc8;return function(_0x272ca5){if(_0x272ca5){return _0x5b2396[_0x3d66('0x22')](_0x2a16b8)[_0x3d66('0x24')](_0x272ca5);}};}function respondWithFilteredResult(_0x47d8eb,_0x5e992b){return function(_0x26fd8e){if(_0x26fd8e){var _0x350528=typeof _0x5e992b[_0x3d66('0x25')]==='undefined'&&typeof _0x5e992b['limit']==='undefined';var _0x2095af=_0x26fd8e[_0x3d66('0x26')];var _0x5e7d24=_0x350528?0x0:_0x5e992b[_0x3d66('0x25')];var _0x295063=_0x350528?_0x26fd8e[_0x3d66('0x26')]:_0x5e992b[_0x3d66('0x25')]+_0x5e992b[_0x3d66('0x27')];var _0x2fe665;if(_0x295063>=_0x2095af){_0x295063=_0x2095af;_0x2fe665=0xc8;}else{_0x2fe665=0xce;}_0x47d8eb[_0x3d66('0x22')](_0x2fe665);return _0x47d8eb[_0x3d66('0x28')](_0x3d66('0x29'),_0x5e7d24+'-'+_0x295063+'/'+_0x2095af)[_0x3d66('0x24')](_0x26fd8e);}return null;};}function patchUpdates(_0x5b2466){return function(_0x3ef125){try{jsonpatch[_0x3d66('0x2a')](_0x3ef125,_0x5b2466,!![]);}catch(_0x17d223){return BPromise[_0x3d66('0x2b')](_0x17d223);}return _0x3ef125[_0x3d66('0x2c')]();};}function saveUpdates(_0x271d52,_0x305ecd){return function(_0x5aacaf){if(_0x5aacaf){return _0x5aacaf['update'](_0x271d52)[_0x3d66('0x2d')](function(_0x4ad0cd){return _0x4ad0cd;});}return null;};}function removeEntity(_0x44b455,_0x3e9e23){return function(_0x480b3f){if(_0x480b3f){return _0x480b3f[_0x3d66('0x2e')]()[_0x3d66('0x2d')](function(){var _0x207b8d=_0x480b3f[_0x3d66('0x2f')]({'plain':!![]});var _0x54e9d4=[{'name':_0x3d66('0x30'),'value':_0x3d66('0x31'),'ignore':![]},{'name':_0x3d66('0x32'),'value':_0x3d66('0x33'),'ignore':![]},{'name':_0x3d66('0x34'),'value':_0x3d66('0x35'),'ignore':![]}];var _0x3d350a=_(_0x54e9d4)['filter'](_0x3d66('0x36'))['map'](_0x3d66('0x37'))[_0x3d66('0x37')]();if(_[_0x3d66('0x38')](_0x3d350a,_0x207b8d[_0x3d66('0x39')])){return;}var _0x53fe6f=_[_0x3d66('0x3a')](_0x54e9d4,['value',_0x207b8d[_0x3d66('0x39')]])['name'];return db[_0x3d66('0x3b')]['destroy']({'where':{'type':_0x53fe6f,'resourceId':_0x207b8d['id']}})[_0x3d66('0x2d')](function(){return _0x480b3f;});})[_0x3d66('0x2d')](function(){_0x44b455[_0x3d66('0x22')](0xcc)[_0x3d66('0x23')]();});}};}function handleEntityNotFound(_0x53770c,_0xe394bb){return function(_0x462942){if(!_0x462942){_0x53770c[_0x3d66('0x21')](0x194);}return _0x462942;};}function handleError(_0x1a6f31,_0x40d8ea){_0x40d8ea=_0x40d8ea||0x1f4;return function(_0x14fca3){logger[_0x3d66('0x3c')](_0x14fca3[_0x3d66('0x3d')]);if(_0x14fca3[_0x3d66('0x3e')]){delete _0x14fca3['name'];}_0x1a6f31['status'](_0x40d8ea)[_0x3d66('0x3f')](_0x14fca3);};}exports[_0x3d66('0x40')]=function(_0x338374,_0x5b700b){var _0x4c7ef5={},_0x22f699={},_0x4ec440={'count':0x0,'rows':[]};var _0x1753ae=_[_0x3d66('0x41')](db[_0x3d66('0x42')][_0x3d66('0x43')],function(_0x436f99){return{'name':_0x436f99[_0x3d66('0x44')],'type':_0x436f99[_0x3d66('0x39')]['key']};});_0x22f699['model']=_[_0x3d66('0x41')](_0x1753ae,_0x3d66('0x3e'));_0x22f699[_0x3d66('0x45')]=_['keys'](_0x338374[_0x3d66('0x45')]);_0x22f699[_0x3d66('0x46')]=_[_0x3d66('0x47')](_0x22f699[_0x3d66('0x48')],_0x22f699[_0x3d66('0x45')]);_0x4c7ef5['attributes']=_['intersection'](_0x22f699[_0x3d66('0x48')],qs['fields'](_0x338374[_0x3d66('0x45')][_0x3d66('0x49')]));_0x4c7ef5[_0x3d66('0x4a')]=_0x4c7ef5['attributes'][_0x3d66('0x4b')]?_0x4c7ef5[_0x3d66('0x4a')]:_0x22f699[_0x3d66('0x48')];if(!_0x338374[_0x3d66('0x45')]['hasOwnProperty'](_0x3d66('0x4c'))){_0x4c7ef5[_0x3d66('0x27')]=qs['limit'](_0x338374[_0x3d66('0x45')][_0x3d66('0x27')]);_0x4c7ef5[_0x3d66('0x25')]=qs[_0x3d66('0x25')](_0x338374[_0x3d66('0x45')][_0x3d66('0x25')]);}_0x4c7ef5[_0x3d66('0x4d')]=qs[_0x3d66('0x4e')](_0x338374[_0x3d66('0x45')][_0x3d66('0x4e')]);_0x4c7ef5[_0x3d66('0x4f')]=qs[_0x3d66('0x46')](_[_0x3d66('0x50')](_0x338374[_0x3d66('0x45')],_0x22f699[_0x3d66('0x46')]),_0x1753ae);if(_0x338374[_0x3d66('0x45')][_0x3d66('0x51')]){_0x4c7ef5[_0x3d66('0x4f')]=_[_0x3d66('0x52')](_0x4c7ef5[_0x3d66('0x4f')],{'$or':_['map'](_0x1753ae,function(_0x2ec9dd){if(_0x2ec9dd['type']!==_0x3d66('0x53')){var _0x54a6ce={};_0x54a6ce[_0x2ec9dd[_0x3d66('0x3e')]]={'$like':'%'+_0x338374['query'][_0x3d66('0x51')]+'%'};return _0x54a6ce;}})});}_0x4c7ef5=_[_0x3d66('0x52')]({},_0x4c7ef5,_0x338374[_0x3d66('0x54')]);var _0x501f39={'where':_0x4c7ef5['where']};return db[_0x3d66('0x42')][_0x3d66('0x26')](_0x501f39)[_0x3d66('0x2d')](function(_0x2010f7){_0x4ec440[_0x3d66('0x26')]=_0x2010f7;if(_0x338374['query'][_0x3d66('0x55')]){_0x4c7ef5[_0x3d66('0x56')]=[{'all':!![]}];}return db[_0x3d66('0x42')][_0x3d66('0x57')](_0x4c7ef5);})['then'](function(_0x378373){_0x4ec440[_0x3d66('0x58')]=_0x378373;return _0x4ec440;})[_0x3d66('0x2d')](respondWithFilteredResult(_0x5b700b,_0x4c7ef5))[_0x3d66('0x59')](handleError(_0x5b700b,null));};exports['show']=function(_0x5b520f,_0x3179a4){var _0x3aa3a1={'raw':![],'where':{'id':_0x5b520f[_0x3d66('0x5a')]['id']}},_0x3aa439={};_0x3aa439['model']=_[_0x3d66('0x5b')](db[_0x3d66('0x42')][_0x3d66('0x43')]);_0x3aa439[_0x3d66('0x45')]=_[_0x3d66('0x5b')](_0x5b520f['query']);_0x3aa439[_0x3d66('0x46')]=_[_0x3d66('0x47')](_0x3aa439[_0x3d66('0x48')],_0x3aa439[_0x3d66('0x45')]);_0x3aa3a1[_0x3d66('0x4a')]=_[_0x3d66('0x47')](_0x3aa439[_0x3d66('0x48')],qs[_0x3d66('0x49')](_0x5b520f[_0x3d66('0x45')][_0x3d66('0x49')]));_0x3aa3a1['attributes']=_0x3aa3a1['attributes'][_0x3d66('0x4b')]?_0x3aa3a1[_0x3d66('0x4a')]:_0x3aa439[_0x3d66('0x48')];if(_0x5b520f['query'][_0x3d66('0x55')]){_0x3aa3a1['include']=[{'all':!![]}];}_0x3aa3a1=_[_0x3d66('0x52')]({},_0x3aa3a1,_0x5b520f[_0x3d66('0x54')]);return db[_0x3d66('0x42')][_0x3d66('0x3a')](_0x3aa3a1)[_0x3d66('0x2d')](handleEntityNotFound(_0x3179a4,null))[_0x3d66('0x2d')](respondWithResult(_0x3179a4,null))['catch'](handleError(_0x3179a4,null));};exports['destroy']=function(_0x475d2b,_0x32c015){return db[_0x3d66('0x42')][_0x3d66('0x3a')]({'where':{'id':_0x475d2b[_0x3d66('0x5a')]['id']}})[_0x3d66('0x2d')](handleEntityNotFound(_0x32c015,null))[_0x3d66('0x2d')](removeEntity(_0x32c015,null))[_0x3d66('0x59')](handleError(_0x32c015,null));};exports[_0x3d66('0x5c')]=function(_0x450136,_0x66ecd){if(_0x450136[_0x3d66('0x5d')][_0x3d66('0x39')]===_0x3d66('0x33')&&!_[_0x3d66('0x5e')](_0x450136[_0x3d66('0x5d')][_0x3d66('0x5f')],'_')){_0x450136[_0x3d66('0x5d')]['exten']='_'[_0x3d66('0x60')](_0x450136[_0x3d66('0x5d')][_0x3d66('0x5f')]);}return db[_0x3d66('0x42')]['create'](_0x450136['body'],{'raw':![]})[_0x3d66('0x2d')](function(_0x5cb252){var _0x501af6=_0x450136['user'][_0x3d66('0x2f')]({'plain':!![]});if(!_0x501af6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x501af6[_0x3d66('0x61')]===_0x3d66('0x62')){var _0x3da33c=_0x5cb252[_0x3d66('0x2f')]({'plain':!![]});var _0x2231d4=[{'name':_0x3d66('0x30'),'value':'inbound'},{'name':_0x3d66('0x32'),'value':_0x3d66('0x33')},{'name':_0x3d66('0x34'),'value':'internal'}];var _0x5e685c=_[_0x3d66('0x3a')](_0x2231d4,[_0x3d66('0x37'),_0x3da33c[_0x3d66('0x39')]])[_0x3d66('0x3e')];return db[_0x3d66('0x63')][_0x3d66('0x3a')]({'where':{'name':_0x5e685c,'userProfileId':_0x501af6[_0x3d66('0x64')]},'raw':!![]})[_0x3d66('0x2d')](function(_0x1aa55c){if(_0x1aa55c&&_0x1aa55c[_0x3d66('0x65')]===0x0){return db[_0x3d66('0x3b')][_0x3d66('0x5c')]({'name':_0x3da33c[_0x3d66('0x3e')],'resourceId':_0x3da33c['id'],'type':_0x1aa55c[_0x3d66('0x3e')],'sectionId':_0x1aa55c['id']},{})['then'](function(){return _0x5cb252;});}else{return _0x5cb252;}})[_0x3d66('0x59')](function(_0x2835a6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2835a6);throw _0x2835a6;});}return _0x5cb252;})[_0x3d66('0x2d')](respondWithResult(_0x66ecd,0xc9))[_0x3d66('0x59')](handleError(_0x66ecd,null));};exports['update']=function(_0x17dc6d,_0x35e8c7){if(_0x17dc6d[_0x3d66('0x5d')]['id']){delete _0x17dc6d[_0x3d66('0x5d')]['id'];}return db[_0x3d66('0x42')][_0x3d66('0x3a')]({'where':{'id':_0x17dc6d[_0x3d66('0x5a')]['id']}})[_0x3d66('0x2d')](handleEntityNotFound(_0x35e8c7,null))[_0x3d66('0x2d')](function(_0x1b57c8){if(_0x1b57c8){return db[_0x3d66('0x42')][_0x3d66('0x66')](_[_0x3d66('0x50')](_0x17dc6d[_0x3d66('0x5d')],[_0x3d66('0x5f'),_0x3d66('0x67'),_0x3d66('0x68'),'recordingFormat',_0x3d66('0x69'),_0x3d66('0x6a')]),{'where':{'context':_0x1b57c8[_0x3d66('0x67')],'exten':_0x1b57c8[_0x3d66('0x5f')]},'individualHooks':!![]})[_0x3d66('0x2d')](function(_0x53622a){return _0x53622a;});}return null;})[_0x3d66('0x2d')](respondWithStatusCode(_0x35e8c7,null))[_0x3d66('0x59')](handleError(_0x35e8c7,null));};exports[_0x3d66('0x6b')]=function(_0xa9bda7,_0x5c4a76,_0x2c48b3){return db[_0x3d66('0x42')][_0x3d66('0x6c')]({'where':{'id':_0xa9bda7[_0x3d66('0x5a')]['id']}})[_0x3d66('0x2d')](handleEntityNotFound(_0x5c4a76,null))[_0x3d66('0x2d')](function(_0x23de89){if(_0x23de89){return db[_0x3d66('0x6d')][_0x3d66('0x6e')](function(_0x1e91fe){return db[_0x3d66('0x42')][_0x3d66('0x2e')]({'where':{'VoiceExtensionId':_0xa9bda7[_0x3d66('0x5a')]['id']},'transaction':_0x1e91fe})[_0x3d66('0x2d')](function(_0x3929d1){var _0x1477b5=_[_0x3d66('0x41')](_0xa9bda7['body'],function(_0x50e742){_0x50e742[_0x3d66('0x6f')]=_0xa9bda7[_0x3d66('0x5a')]['id'];return _0x50e742;});return db[_0x3d66('0x42')][_0x3d66('0x70')](_0x1477b5,{'transaction':_0x1e91fe});});})[_0x3d66('0x2d')](function(){return db[_0x3d66('0x42')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0xa9bda7[_0x3d66('0x5a')]['id']},'order':_0x3d66('0x71')});});}})['then'](respondWithResult(_0x5c4a76,null))['catch'](handleError(_0x5c4a76,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index e3a2b89..0d1d860 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 _0x96fd=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x29f10f,_0x59cb8a){var _0x2e4928=function(_0x23ad54){while(--_0x23ad54){_0x29f10f['push'](_0x29f10f['shift']());}};_0x2e4928(++_0x59cb8a);}(_0x96fd,0x147));var _0xd96f=function(_0x2c5ee9,_0x3e7989){_0x2c5ee9=_0x2c5ee9-0x0;var _0x4566af=_0x96fd[_0x2c5ee9];return _0x4566af;};'use strict';var EventEmitter=require(_0xd96f('0x0'));var VoiceExtension=require(_0xd96f('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xd96f('0x2')](0x0);var events={'afterCreate':_0xd96f('0x3'),'afterUpdate':_0xd96f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x330969){return function(_0x3f64f5,_0xc424c3,_0x1ec8d6){VoiceExtensionEvents['emit'](_0x330969+':'+_0x3f64f5['id'],_0x3f64f5);VoiceExtensionEvents[_0xd96f('0x5')](_0x330969,_0x3f64f5);_0x1ec8d6(null);};}for(var e in events){if(events[_0xd96f('0x6')](e)){var event=events[e];VoiceExtension[_0xd96f('0x7')](e,emitEvent(event));}}module[_0xd96f('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xd6a2=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1c579b,_0x2fc27e){var _0x1e5999=function(_0x288dc2){while(--_0x288dc2){_0x1c579b['push'](_0x1c579b['shift']());}};_0x1e5999(++_0x2fc27e);}(_0xd6a2,0x115));var _0x2d6a=function(_0x53be6f,_0x294424){_0x53be6f=_0x53be6f-0x0;var _0x63abd5=_0xd6a2[_0x53be6f];return _0x63abd5;};'use strict';var EventEmitter=require(_0x2d6a('0x0'));var VoiceExtension=require(_0x2d6a('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2d6a('0x2')](0x0);var events={'afterCreate':_0x2d6a('0x3'),'afterUpdate':_0x2d6a('0x4'),'afterDestroy':_0x2d6a('0x5')};function emitEvent(_0x58b1ca){return function(_0x1913dc,_0x27376f,_0x1fc087){VoiceExtensionEvents[_0x2d6a('0x6')](_0x58b1ca+':'+_0x1913dc['id'],_0x1913dc);VoiceExtensionEvents[_0x2d6a('0x6')](_0x58b1ca,_0x1913dc);_0x1fc087(null);};}for(var e in events){if(events[_0x2d6a('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x2d6a('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index d6c0a63..928f668 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 _0x2693=['./voiceExtension.attributes','exports','define','VoiceExtension','voice_extensions','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x117b18,_0x41ce7a){var _0x574ac0=function(_0x265080){while(--_0x265080){_0x117b18['push'](_0x117b18['shift']());}};_0x574ac0(++_0x41ce7a);}(_0x2693,0xf7));var _0x3269=function(_0x8a5df2,_0x43ab1b){_0x8a5df2=_0x8a5df2-0x0;var _0x2ee2b1=_0x2693[_0x8a5df2];return _0x2ee2b1;};'use strict';var _=require('lodash');var util=require(_0x3269('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3269('0x1'));var BPromise=require('bluebird');var rp=require(_0x3269('0x2'));var fs=require('fs');var path=require(_0x3269('0x3'));var rimraf=require(_0x3269('0x4'));var config=require(_0x3269('0x5'));var attributes=require(_0x3269('0x6'));module[_0x3269('0x7')]=function(_0x50256a,_0x4fa4d7){return _0x50256a[_0x3269('0x8')](_0x3269('0x9'),attributes,{'tableName':_0x3269('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b48=['request-promise','path','rimraf','../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','voice_extensions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xb12c0a,_0x42b9f1){var _0x4a05b3=function(_0x342bc8){while(--_0x342bc8){_0xb12c0a['push'](_0xb12c0a['shift']());}};_0x4a05b3(++_0x42b9f1);}(_0x4b48,0x171));var _0x84b4=function(_0x2705af,_0x10a7b5){_0x2705af=_0x2705af-0x0;var _0x1a4ac8=_0x4b48[_0x2705af];return _0x1a4ac8;};'use strict';var _=require(_0x84b4('0x0'));var util=require(_0x84b4('0x1'));var logger=require(_0x84b4('0x2'))(_0x84b4('0x3'));var moment=require(_0x84b4('0x4'));var BPromise=require(_0x84b4('0x5'));var rp=require(_0x84b4('0x6'));var fs=require('fs');var path=require(_0x84b4('0x7'));var rimraf=require(_0x84b4('0x8'));var config=require(_0x84b4('0x9'));var attributes=require(_0x84b4('0xa'));module[_0x84b4('0xb')]=function(_0x375e9f,_0x3cdaf0){return _0x375e9f[_0x84b4('0xc')](_0x84b4('0xd'),attributes,{'tableName':_0x84b4('0xe'),'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 22ce0fd..8c9a9b3 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 _0x231a=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','limit','include','model','map','attributes','moment'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x231a,0x6e));var _0xa231=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x231a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa231('0x0'));var BPromise=require(_0xa231('0x1'));var rs=require(_0xa231('0x2'));var fs=require('fs');var Redis=require(_0xa231('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa231('0x4'));var logger=require(_0xa231('0x5'))(_0xa231('0x6'));var config=require(_0xa231('0x7'));var jayson=require(_0xa231('0x8'));var client=jayson[_0xa231('0x9')][_0xa231('0xa')]({'port':0x232a});config[_0xa231('0xb')]=_['defaults'](config[_0xa231('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa231('0xc'))(new Redis(config[_0xa231('0xb')]));require(_0xa231('0xd'))[_0xa231('0xe')](socket);function respondWithRpcPromise(_0x3d56d2,_0x2ace99,_0x1f9565){return new BPromise(function(_0x4e210f,_0x554362){return client[_0xa231('0xf')](_0x3d56d2,_0x1f9565)[_0xa231('0x10')](function(_0x2a32d9){logger['info'](_0xa231('0x11'),_0x2ace99,_0xa231('0x12'));logger['debug'](_0xa231('0x13'),_0x2ace99,_0xa231('0x12'),JSON[_0xa231('0x14')](_0x2a32d9));if(_0x2a32d9[_0xa231('0x15')]){if(_0x2a32d9[_0xa231('0x15')][_0xa231('0x16')]===0x1f4){logger['error'](_0xa231('0x11'),_0x2ace99,_0x2a32d9[_0xa231('0x15')]['message']);return _0x554362(_0x2a32d9[_0xa231('0x15')][_0xa231('0x17')]);}logger[_0xa231('0x15')](_0xa231('0x11'),_0x2ace99,_0x2a32d9[_0xa231('0x15')]['message']);return _0x4e210f(_0x2a32d9[_0xa231('0x15')][_0xa231('0x17')]);}else{logger[_0xa231('0x18')](_0xa231('0x11'),_0x2ace99,_0xa231('0x12'));_0x4e210f(_0x2a32d9[_0xa231('0x19')]['message']);}})[_0xa231('0x1a')](function(_0x38896a){logger[_0xa231('0x15')](_0xa231('0x11'),_0x2ace99,_0x38896a);_0x554362(_0x38896a);});});}exports[_0xa231('0x1b')]=function(_0x336345){var _0x208060=this;return new Promise(function(_0x7a4dd3,_0x5571a5){return db[_0xa231('0x1c')][_0xa231('0x1d')]({'raw':_0x336345['options']?_0x336345[_0xa231('0x1e')][_0xa231('0x1f')]===undefined?!![]:![]:!![],'where':_0x336345[_0xa231('0x1e')]?_0x336345['options']['where']||null:null,'attributes':_0x336345[_0xa231('0x1e')]?_0x336345[_0xa231('0x1e')]['attributes']||null:null,'limit':_0x336345['options']?_0x336345[_0xa231('0x1e')][_0xa231('0x20')]||null:null,'include':_0x336345[_0xa231('0x1e')]?_0x336345[_0xa231('0x1e')]['include']?_['map'](_0x336345[_0xa231('0x1e')][_0xa231('0x21')],function(_0x1daaa1){return{'model':db[_0x1daaa1[_0xa231('0x22')]],'as':_0x1daaa1['as'],'attributes':_0x1daaa1['attributes'],'include':_0x1daaa1['include']?_[_0xa231('0x23')](_0x1daaa1[_0xa231('0x21')],function(_0x5baf9f){return{'model':db[_0x5baf9f[_0xa231('0x22')]],'as':_0x5baf9f['as'],'attributes':_0x5baf9f[_0xa231('0x24')],'include':_0x5baf9f[_0xa231('0x21')]?_[_0xa231('0x23')](_0x5baf9f[_0xa231('0x21')],function(_0x5ad205){return{'model':db[_0x5ad205['model']],'as':_0x5ad205['as'],'attributes':_0x5ad205[_0xa231('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa231('0x10')](function(_0x9320ed){logger[_0xa231('0x18')](_0xa231('0x1b'),_0x336345);logger['debug'](_0xa231('0x1b'),_0x336345,JSON[_0xa231('0x14')](_0x9320ed));_0x7a4dd3(_0x9320ed);})[_0xa231('0x1a')](function(_0x1ed8e0){logger[_0xa231('0x15')](_0xa231('0x1b'),_0x1ed8e0[_0xa231('0x17')],_0x336345);_0x5571a5(_0x208060[_0xa231('0x15')](0x1f4,_0x1ed8e0[_0xa231('0x17')]));});});}; \ No newline at end of file +var _0xbc14=['../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','info','result','catch','VoiceExtension','findAll','options','raw','where','attributes','map','include','model','GetVoiceExtension','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2a73c4,_0x1ec1be){var _0x1f5583=function(_0x2b14d6){while(--_0x2b14d6){_0x2a73c4['push'](_0x2a73c4['shift']());}};_0x1f5583(++_0x1ec1be);}(_0xbc14,0x1e6));var _0x4bc1=function(_0x3a980f,_0x49e4d6){_0x3a980f=_0x3a980f-0x0;var _0x36010f=_0xbc14[_0x3a980f];return _0x36010f;};'use strict';var _=require(_0x4bc1('0x0'));var util=require(_0x4bc1('0x1'));var moment=require('moment');var BPromise=require(_0x4bc1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4bc1('0x3'));var db=require(_0x4bc1('0x4'))['db'];var utils=require(_0x4bc1('0x5'));var logger=require(_0x4bc1('0x6'))(_0x4bc1('0x7'));var config=require(_0x4bc1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4bc1('0x9')][_0x4bc1('0xa')]({'port':0x232a});config[_0x4bc1('0xb')]=_['defaults'](config[_0x4bc1('0xb')],{'host':_0x4bc1('0xc'),'port':0x18eb});var socket=require(_0x4bc1('0xd'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x4bc1('0xe')](socket);function respondWithRpcPromise(_0xcb03fe,_0x263546,_0x5ad962){return new BPromise(function(_0x5dc771,_0x2ef1ca){return client[_0x4bc1('0xf')](_0xcb03fe,_0x5ad962)[_0x4bc1('0x10')](function(_0x4f2e3f){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x263546,_0x4bc1('0x11'));logger[_0x4bc1('0x12')](_0x4bc1('0x13'),_0x263546,_0x4bc1('0x11'),JSON[_0x4bc1('0x14')](_0x4f2e3f));if(_0x4f2e3f['error']){if(_0x4f2e3f[_0x4bc1('0x15')][_0x4bc1('0x16')]===0x1f4){logger[_0x4bc1('0x15')](_0x4bc1('0x17'),_0x263546,_0x4f2e3f[_0x4bc1('0x15')][_0x4bc1('0x18')]);return _0x2ef1ca(_0x4f2e3f[_0x4bc1('0x15')]['message']);}logger[_0x4bc1('0x15')](_0x4bc1('0x17'),_0x263546,_0x4f2e3f['error'][_0x4bc1('0x18')]);return _0x5dc771(_0x4f2e3f[_0x4bc1('0x15')][_0x4bc1('0x18')]);}else{logger[_0x4bc1('0x19')](_0x4bc1('0x17'),_0x263546,'request\x20sent');_0x5dc771(_0x4f2e3f[_0x4bc1('0x1a')][_0x4bc1('0x18')]);}})[_0x4bc1('0x1b')](function(_0x34f3de){logger[_0x4bc1('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x263546,_0x34f3de);_0x2ef1ca(_0x34f3de);});});}exports['GetVoiceExtension']=function(_0x18e2ab){var _0x12f624=this;return new Promise(function(_0x1e1cf3,_0x5b73e1){return db[_0x4bc1('0x1c')][_0x4bc1('0x1d')]({'raw':_0x18e2ab['options']?_0x18e2ab[_0x4bc1('0x1e')][_0x4bc1('0x1f')]===undefined?!![]:![]:!![],'where':_0x18e2ab[_0x4bc1('0x1e')]?_0x18e2ab[_0x4bc1('0x1e')][_0x4bc1('0x20')]||null:null,'attributes':_0x18e2ab[_0x4bc1('0x1e')]?_0x18e2ab[_0x4bc1('0x1e')][_0x4bc1('0x21')]||null:null,'limit':_0x18e2ab[_0x4bc1('0x1e')]?_0x18e2ab['options']['limit']||null:null,'include':_0x18e2ab[_0x4bc1('0x1e')]?_0x18e2ab['options']['include']?_[_0x4bc1('0x22')](_0x18e2ab[_0x4bc1('0x1e')][_0x4bc1('0x23')],function(_0xd97418){return{'model':db[_0xd97418[_0x4bc1('0x24')]],'as':_0xd97418['as'],'attributes':_0xd97418[_0x4bc1('0x21')],'include':_0xd97418[_0x4bc1('0x23')]?_[_0x4bc1('0x22')](_0xd97418[_0x4bc1('0x23')],function(_0x262f9f){return{'model':db[_0x262f9f['model']],'as':_0x262f9f['as'],'attributes':_0x262f9f[_0x4bc1('0x21')],'include':_0x262f9f['include']?_[_0x4bc1('0x22')](_0x262f9f[_0x4bc1('0x23')],function(_0x5bcf78){return{'model':db[_0x5bcf78[_0x4bc1('0x24')]],'as':_0x5bcf78['as'],'attributes':_0x5bcf78[_0x4bc1('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f8a6d){logger[_0x4bc1('0x19')](_0x4bc1('0x25'),_0x18e2ab);logger['debug'](_0x4bc1('0x25'),_0x18e2ab,JSON[_0x4bc1('0x14')](_0x3f8a6d));_0x1e1cf3(_0x3f8a6d);})['catch'](function(_0x4bb292){logger['error'](_0x4bc1('0x25'),_0x4bb292[_0x4bc1('0x18')],_0x18e2ab);_0x5b73e1(_0x12f624[_0x4bc1('0x15')](0x1f4,_0x4bb292[_0x4bc1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 03022d3..8b4affb 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 _0xd372=['save','remove','update','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events'];(function(_0x21cb7f,_0x48cd16){var _0x5a079a=function(_0x569a4f){while(--_0x569a4f){_0x21cb7f['push'](_0x21cb7f['shift']());}};_0x5a079a(++_0x48cd16);}(_0xd372,0xfb));var _0x2d37=function(_0x31a83b,_0x5e3243){_0x31a83b=_0x31a83b-0x0;var _0x14710a=_0xd372[_0x31a83b];return _0x14710a;};'use strict';var VoiceExtensionEvents=require(_0x2d37('0x0'));var events=[_0x2d37('0x1'),_0x2d37('0x2'),_0x2d37('0x3')];function createListener(_0xba49e5,_0x2ca8ae){return function(_0x21f832){_0x2ca8ae[_0x2d37('0x4')](_0xba49e5,_0x21f832);};}function removeListener(_0x3509fb,_0x7342c7){return function(){VoiceExtensionEvents[_0x2d37('0x5')](_0x3509fb,_0x7342c7);};}exports[_0x2d37('0x6')]=function(_0x1f0808){for(var _0x1e1fa3=0x0,_0x4c6114=events[_0x2d37('0x7')];_0x1e1fa3<_0x4c6114;_0x1e1fa3++){var _0x254cef=events[_0x1e1fa3];var _0x54ae34=createListener(_0x2d37('0x8')+_0x254cef,_0x1f0808);VoiceExtensionEvents['on'](_0x254cef,_0x54ae34);}}; \ No newline at end of file +var _0xf8c7=['length','voiceExtension:','save','update','emit','removeListener','register'];(function(_0x5a75f7,_0x1bdb5b){var _0x3619da=function(_0x55402a){while(--_0x55402a){_0x5a75f7['push'](_0x5a75f7['shift']());}};_0x3619da(++_0x1bdb5b);}(_0xf8c7,0x1d7));var _0x7f8c=function(_0x198666,_0x472745){_0x198666=_0x198666-0x0;var _0x502ce5=_0xf8c7[_0x198666];return _0x502ce5;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x7f8c('0x0'),'remove',_0x7f8c('0x1')];function createListener(_0x15109f,_0xf2b17d){return function(_0x17fc5b){_0xf2b17d[_0x7f8c('0x2')](_0x15109f,_0x17fc5b);};}function removeListener(_0x348b87,_0x3d64e2){return function(){VoiceExtensionEvents[_0x7f8c('0x3')](_0x348b87,_0x3d64e2);};}exports[_0x7f8c('0x4')]=function(_0x5b030a){for(var _0x462ca9=0x0,_0x1ad27b=events[_0x7f8c('0x5')];_0x462ca9<_0x1ad27b;_0x462ca9++){var _0x4e2d34=events[_0x462ca9];var _0x2f3755=createListener(_0x7f8c('0x6')+_0x4e2d34,_0x5b030a);VoiceExtensionEvents['on'](_0x4e2d34,_0x2f3755);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 14e9ba1..bf2e017 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 _0x9efc=['getMessages','post','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/messages'];(function(_0x31ab0c,_0x86235b){var _0x23130c=function(_0x49aa3b){while(--_0x49aa3b){_0x31ab0c['push'](_0x31ab0c['shift']());}};_0x23130c(++_0x86235b);}(_0x9efc,0x19c));var _0xc9ef=function(_0x10edeb,_0x1b93b8){_0x10edeb=_0x10edeb-0x0;var _0x1c5fea=_0x9efc[_0x10edeb];return _0x1c5fea;};'use strict';var multer=require(_0xc9ef('0x0'));var util=require(_0xc9ef('0x1'));var path=require(_0xc9ef('0x2'));var timeout=require(_0xc9ef('0x3'));var express=require(_0xc9ef('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc9ef('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc9ef('0x6'));var controller=require('./voiceMail.controller');router[_0xc9ef('0x7')]('/',auth['isAuthenticated'](),controller[_0xc9ef('0x8')]);router[_0xc9ef('0x7')](_0xc9ef('0x9'),auth[_0xc9ef('0xa')](),controller[_0xc9ef('0xb')]);router[_0xc9ef('0x7')](_0xc9ef('0xc'),auth[_0xc9ef('0xa')](),controller[_0xc9ef('0xd')]);router[_0xc9ef('0xe')]('/',auth[_0xc9ef('0xa')](),controller['create']);router['put'](_0xc9ef('0x9'),auth['isAuthenticated'](),controller[_0xc9ef('0xf')]);router['delete'](_0xc9ef('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xc9ef('0x10')]=router; \ No newline at end of file +var _0xa149=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','index','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4aa174,_0x4270f3){var _0x376f7e=function(_0x2d42d5){while(--_0x2d42d5){_0x4aa174['push'](_0x4aa174['shift']());}};_0x376f7e(++_0x4270f3);}(_0xa149,0x18c));var _0x9a14=function(_0x3ea2f4,_0x58f806){_0x3ea2f4=_0x3ea2f4-0x0;var _0x384245=_0xa149[_0x3ea2f4];return _0x384245;};'use strict';var multer=require(_0x9a14('0x0'));var util=require(_0x9a14('0x1'));var path=require(_0x9a14('0x2'));var timeout=require(_0x9a14('0x3'));var express=require(_0x9a14('0x4'));var router=express[_0x9a14('0x5')]();var fs_extra=require(_0x9a14('0x6'));var auth=require(_0x9a14('0x7'));var interaction=require(_0x9a14('0x8'));var config=require('../../config/environment');var controller=require(_0x9a14('0x9'));router[_0x9a14('0xa')]('/',auth['isAuthenticated'](),controller[_0x9a14('0xb')]);router[_0x9a14('0xa')](_0x9a14('0xc'),auth[_0x9a14('0xd')](),controller[_0x9a14('0xe')]);router[_0x9a14('0xa')]('/:id/messages',auth[_0x9a14('0xd')](),controller['getMessages']);router[_0x9a14('0xf')]('/',auth[_0x9a14('0xd')](),controller[_0x9a14('0x10')]);router[_0x9a14('0x11')](_0x9a14('0xc'),auth[_0x9a14('0xd')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9a14('0x12')]);module[_0x9a14('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index fd7dfe6..9d661d3 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 _0x34b7=['TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','yes','ENUM','TINYINT(4)'];(function(_0x18a2ab,_0x1f1a6f){var _0x47b3be=function(_0x5ef450){while(--_0x5ef450){_0x18a2ab['push'](_0x18a2ab['shift']());}};_0x47b3be(++_0x1f1a6f);}(_0x34b7,0x196));var _0x734b=function(_0x863840,_0x2387fe){_0x863840=_0x863840-0x0;var _0x5183b0=_0x34b7[_0x863840];return _0x5183b0;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x734b('0x0')]},'context':{'type':Sequelize[_0x734b('0x0')],'defaultValue':_0x734b('0x1'),'unique':_0x734b('0x2')},'mailbox':{'type':Sequelize[_0x734b('0x0')],'defaultValue':'','allowNull':![],'unique':_0x734b('0x2')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x734b('0x0')],'validate':{'isEmail':!![]},'set':function(_0x2fde69){this[_0x734b('0x3')](_0x734b('0x4'),typeof _0x2fde69===_0x734b('0x5')&&_0x2fde69[_0x734b('0x6')]()?_0x2fde69['trim']():null);}},'pager':{'type':Sequelize[_0x734b('0x0')]},'tz':{'type':Sequelize[_0x734b('0x0')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x734b('0x7'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x734b('0x7'),'no'),'defaultValue':_0x734b('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x734b('0x0')]},'callback':{'type':Sequelize[_0x734b('0x0')]},'review':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x734b('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x734b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':_0x734b('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x734b('0xa')},'emailsubject':{'type':Sequelize[_0x734b('0x0')]},'emailbody':{'type':Sequelize[_0x734b('0x0')]},'maxsecs':{'type':Sequelize[_0x734b('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x734b('0xc')](_0x734b('0xd'))+_0x734b('0xe')+this[_0x734b('0xc')](_0x734b('0xf'));}}}; \ No newline at end of file +var _0xac4a=['contest_mailbox','setDataValue','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail'];(function(_0x188a0a,_0x4ad3bb){var _0x3cc66d=function(_0x5eba09){while(--_0x5eba09){_0x188a0a['push'](_0x188a0a['shift']());}};_0x3cc66d(++_0x4ad3bb);}(_0xac4a,0x13f));var _0xaac4=function(_0x2a3f19,_0xa4969c){_0x2a3f19=_0x2a3f19-0x0;var _0x51f9db=_0xac4a[_0x2a3f19];return _0x51f9db;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'customer_id':{'type':Sequelize[_0xaac4('0x2')]},'context':{'type':Sequelize[_0xaac4('0x2')],'defaultValue':_0xaac4('0x3'),'unique':_0xaac4('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xaac4('0x2')]},'fullname':{'type':Sequelize[_0xaac4('0x2')]},'email':{'type':Sequelize[_0xaac4('0x2')],'validate':{'isEmail':!![]},'set':function(_0x58ae95){this[_0xaac4('0x5')]('email',typeof _0x58ae95===_0xaac4('0x6')&&_0x58ae95['trim']()?_0x58ae95[_0xaac4('0x7')]():null);}},'pager':{'type':Sequelize[_0xaac4('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0xaac4('0x8')]('yes','no'),'defaultValue':_0xaac4('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xaac4('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xaac4('0x2')]},'callback':{'type':Sequelize[_0xaac4('0x2')]},'review':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xaac4('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xaac4('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xaac4('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':_0xaac4('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':_0xaac4('0x9'),'allowNull':![]},'stamp':{'type':_0xaac4('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xaac4('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xaac4('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xaac4('0xd')](_0xaac4('0xe'))+_0xaac4('0xf')+this[_0xaac4('0xd')](_0xaac4('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 6e27ffd..14d415c 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 _0xc0c4=['util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','error','stack','name','send','index','VoiceMail','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','map','type','VIRTUAL','filter','then','includeAll','include','rows','catch','show','params','find','create','body','get','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','findOne','VoiceMailMessage','length','options','findAndCountAll','eml-format','rimraf','request-promise','moment','mustache'];(function(_0x3c706f,_0x24b2b6){var _0x914b=function(_0x372ccc){while(--_0x372ccc){_0x3c706f['push'](_0x3c706f['shift']());}};_0x914b(++_0x24b2b6);}(_0xc0c4,0x1b3));var _0x4c0c=function(_0x2c7c69,_0x3079ee){_0x2c7c69=_0x2c7c69-0x0;var _0x55fdaf=_0xc0c4[_0x2c7c69];return _0x55fdaf;};'use strict';var emlformat=require(_0x4c0c('0x0'));var rimraf=require(_0x4c0c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4c0c('0x2'));var moment=require(_0x4c0c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4c0c('0x4'));var util=require(_0x4c0c('0x5'));var path=require(_0x4c0c('0x6'));var sox=require(_0x4c0c('0x7'));var csv=require(_0x4c0c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c0c('0x9'));var _=require(_0x4c0c('0xa'));var squel=require(_0x4c0c('0xb'));var crypto=require(_0x4c0c('0xc'));var jsforce=require(_0x4c0c('0xd'));var deskjs=require(_0x4c0c('0xe'));var toCsv=require(_0x4c0c('0x8'));var querystring=require('querystring');var Papa=require(_0x4c0c('0xf'));var Redis=require(_0x4c0c('0x10'));var authService=require(_0x4c0c('0x11'));var qs=require(_0x4c0c('0x12'));var as=require(_0x4c0c('0x13'));var hardwareService=require(_0x4c0c('0x14'));var logger=require(_0x4c0c('0x15'))('api');var utils=require(_0x4c0c('0x16'));var config=require(_0x4c0c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c0c('0x18'))['db'];function respondWithStatusCode(_0x46e79e,_0x1ad9e2){_0x1ad9e2=_0x1ad9e2||0xcc;return function(_0x1a5dde){if(_0x1a5dde){return _0x46e79e[_0x4c0c('0x19')](_0x1ad9e2);}return _0x46e79e[_0x4c0c('0x1a')](_0x1ad9e2)[_0x4c0c('0x1b')]();};}function respondWithResult(_0x1cb8a6,_0x4ec70a){_0x4ec70a=_0x4ec70a||0xc8;return function(_0x56bd51){if(_0x56bd51){return _0x1cb8a6['status'](_0x4ec70a)[_0x4c0c('0x1c')](_0x56bd51);}};}function respondWithFilteredResult(_0x2dac69,_0x3a6542){return function(_0x148bb){if(_0x148bb){var _0x33a216=typeof _0x3a6542[_0x4c0c('0x1d')]===_0x4c0c('0x1e')&&typeof _0x3a6542[_0x4c0c('0x1f')]===_0x4c0c('0x1e');var _0x40c5ba=_0x148bb[_0x4c0c('0x20')];var _0x38d864=_0x33a216?0x0:_0x3a6542[_0x4c0c('0x1d')];var _0x313e5f=_0x33a216?_0x148bb['count']:_0x3a6542[_0x4c0c('0x1d')]+_0x3a6542[_0x4c0c('0x1f')];var _0x302e19;if(_0x313e5f>=_0x40c5ba){_0x313e5f=_0x40c5ba;_0x302e19=0xc8;}else{_0x302e19=0xce;}_0x2dac69['status'](_0x302e19);return _0x2dac69[_0x4c0c('0x21')](_0x4c0c('0x22'),_0x38d864+'-'+_0x313e5f+'/'+_0x40c5ba)[_0x4c0c('0x1c')](_0x148bb);}return null;};}function patchUpdates(_0x414da4){return function(_0x37646c){try{jsonpatch[_0x4c0c('0x23')](_0x37646c,_0x414da4,!![]);}catch(_0x1b6e9f){return BPromise['reject'](_0x1b6e9f);}return _0x37646c[_0x4c0c('0x24')]();};}function saveUpdates(_0x5f11ab,_0x2e731b){return function(_0x461f56){if(_0x461f56){return _0x461f56['update'](_0x5f11ab)['then'](function(_0x2f7e3d){return _0x2f7e3d;});}return null;};}function removeEntity(_0x461c73,_0x5d1716){return function(_0x4b3d08){if(_0x4b3d08){return _0x4b3d08['destroy']()['then'](function(){var _0x2f9d8b=_0x4b3d08['get']({'plain':!![]});var _0x261ece='Voicemails';return db['UserProfileResource'][_0x4c0c('0x25')]({'where':{'type':_0x261ece,'resourceId':_0x2f9d8b['id']}})['then'](function(){return _0x4b3d08;});})['then'](function(){_0x461c73[_0x4c0c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f481d,_0xd02e74){return function(_0x1062c7){if(!_0x1062c7){_0x4f481d[_0x4c0c('0x19')](0x194);}return _0x1062c7;};}function handleError(_0x3c9f46,_0x18a473){_0x18a473=_0x18a473||0x1f4;return function(_0x250fe1){logger[_0x4c0c('0x26')](_0x250fe1[_0x4c0c('0x27')]);if(_0x250fe1[_0x4c0c('0x28')]){delete _0x250fe1['name'];}_0x3c9f46[_0x4c0c('0x1a')](_0x18a473)[_0x4c0c('0x29')](_0x250fe1);};}exports[_0x4c0c('0x2a')]=function(_0x317fa4,_0x43d9c8){var _0x2ea7a5={},_0x4e95a5={},_0x44fb3d={'count':0x0,'rows':[]};var _0x48aa93=_['map'](db[_0x4c0c('0x2b')][_0x4c0c('0x2c')],function(_0x7ff3cd){return{'name':_0x7ff3cd['fieldName'],'type':_0x7ff3cd['type'][_0x4c0c('0x2d')]};});_0x4e95a5[_0x4c0c('0x2e')]=_['map'](_0x48aa93,_0x4c0c('0x28'));_0x4e95a5[_0x4c0c('0x2f')]=_[_0x4c0c('0x30')](_0x317fa4['query']);_0x4e95a5[_0x4c0c('0x31')]=_[_0x4c0c('0x32')](_0x4e95a5[_0x4c0c('0x2e')],_0x4e95a5[_0x4c0c('0x2f')]);_0x2ea7a5['attributes']=_[_0x4c0c('0x32')](_0x4e95a5['model'],qs['fields'](_0x317fa4[_0x4c0c('0x2f')][_0x4c0c('0x33')]));_0x2ea7a5[_0x4c0c('0x34')]=_0x2ea7a5[_0x4c0c('0x34')]['length']?_0x2ea7a5['attributes']:_0x4e95a5[_0x4c0c('0x2e')];if(!_0x317fa4[_0x4c0c('0x2f')][_0x4c0c('0x35')]('nolimit')){_0x2ea7a5[_0x4c0c('0x1f')]=qs[_0x4c0c('0x1f')](_0x317fa4[_0x4c0c('0x2f')][_0x4c0c('0x1f')]);_0x2ea7a5[_0x4c0c('0x1d')]=qs[_0x4c0c('0x1d')](_0x317fa4['query']['offset']);}_0x2ea7a5[_0x4c0c('0x36')]=qs[_0x4c0c('0x37')](_0x317fa4[_0x4c0c('0x2f')][_0x4c0c('0x37')]);_0x2ea7a5[_0x4c0c('0x38')]=qs[_0x4c0c('0x31')](_[_0x4c0c('0x39')](_0x317fa4[_0x4c0c('0x2f')],_0x4e95a5['filters']),_0x48aa93);if(_0x317fa4[_0x4c0c('0x2f')]['filter']){_0x2ea7a5[_0x4c0c('0x38')]=_[_0x4c0c('0x3a')](_0x2ea7a5[_0x4c0c('0x38')],{'$or':_[_0x4c0c('0x3b')](_0x48aa93,function(_0x33778f){if(_0x33778f[_0x4c0c('0x3c')]!==_0x4c0c('0x3d')){var _0x1b39de={};_0x1b39de[_0x33778f[_0x4c0c('0x28')]]={'$like':'%'+_0x317fa4[_0x4c0c('0x2f')][_0x4c0c('0x3e')]+'%'};return _0x1b39de;}})});}_0x2ea7a5=_[_0x4c0c('0x3a')]({},_0x2ea7a5,_0x317fa4['options']);var _0x2081c8={'where':_0x2ea7a5[_0x4c0c('0x38')]};return db[_0x4c0c('0x2b')]['count'](_0x2081c8)[_0x4c0c('0x3f')](function(_0x525236){_0x44fb3d[_0x4c0c('0x20')]=_0x525236;if(_0x317fa4['query'][_0x4c0c('0x40')]){_0x2ea7a5[_0x4c0c('0x41')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x2ea7a5);})['then'](function(_0x4caaa0){_0x44fb3d[_0x4c0c('0x42')]=_0x4caaa0;return _0x44fb3d;})['then'](respondWithFilteredResult(_0x43d9c8,_0x2ea7a5))[_0x4c0c('0x43')](handleError(_0x43d9c8,null));};exports[_0x4c0c('0x44')]=function(_0x38d991,_0x48498b){var _0x55c62f={'raw':!![],'where':{'id':_0x38d991[_0x4c0c('0x45')]['id']}},_0x59751c={};_0x59751c['model']=_[_0x4c0c('0x30')](db['VoiceMail'][_0x4c0c('0x2c')]);_0x59751c[_0x4c0c('0x2f')]=_['keys'](_0x38d991['query']);_0x59751c[_0x4c0c('0x31')]=_[_0x4c0c('0x32')](_0x59751c[_0x4c0c('0x2e')],_0x59751c['query']);_0x55c62f[_0x4c0c('0x34')]=_[_0x4c0c('0x32')](_0x59751c[_0x4c0c('0x2e')],qs['fields'](_0x38d991[_0x4c0c('0x2f')]['fields']));_0x55c62f[_0x4c0c('0x34')]=_0x55c62f[_0x4c0c('0x34')]['length']?_0x55c62f[_0x4c0c('0x34')]:_0x59751c[_0x4c0c('0x2e')];if(_0x38d991[_0x4c0c('0x2f')][_0x4c0c('0x40')]){_0x55c62f[_0x4c0c('0x41')]=[{'all':!![]}];}_0x55c62f=_['merge']({},_0x55c62f,_0x38d991['options']);return db[_0x4c0c('0x2b')][_0x4c0c('0x46')](_0x55c62f)[_0x4c0c('0x3f')](handleEntityNotFound(_0x48498b,null))[_0x4c0c('0x3f')](respondWithResult(_0x48498b,null))[_0x4c0c('0x43')](handleError(_0x48498b,null));};exports[_0x4c0c('0x47')]=function(_0x1689d3,_0x1cb5bb){return db[_0x4c0c('0x2b')][_0x4c0c('0x47')](_0x1689d3[_0x4c0c('0x48')],{})[_0x4c0c('0x3f')](function(_0x5dc3dd){var _0x4e46d8=_0x1689d3['user'][_0x4c0c('0x49')]({'plain':!![]});if(!_0x4e46d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e46d8[_0x4c0c('0x4a')]==='user'){var _0x4ef3f5=_0x5dc3dd[_0x4c0c('0x49')]({'plain':!![]});var _0x41092d=_0x4c0c('0x4b');return db[_0x4c0c('0x4c')][_0x4c0c('0x46')]({'where':{'name':_0x41092d,'userProfileId':_0x4e46d8[_0x4c0c('0x4d')]},'raw':!![]})[_0x4c0c('0x3f')](function(_0x5d1e68){if(_0x5d1e68&&_0x5d1e68[_0x4c0c('0x4e')]===0x0){return db[_0x4c0c('0x4f')][_0x4c0c('0x47')]({'name':_0x4ef3f5[_0x4c0c('0x28')],'resourceId':_0x4ef3f5['id'],'type':_0x5d1e68[_0x4c0c('0x28')],'sectionId':_0x5d1e68['id']},{})['then'](function(){return _0x5dc3dd;});}else{return _0x5dc3dd;}})[_0x4c0c('0x43')](function(_0x2476b7){logger['error'](_0x4c0c('0x50'),_0x2476b7);throw _0x2476b7;});}return _0x5dc3dd;})[_0x4c0c('0x3f')](respondWithResult(_0x1cb5bb,0xc9))['catch'](handleError(_0x1cb5bb,null));};exports[_0x4c0c('0x51')]=function(_0x156973,_0x406690){if(_0x156973[_0x4c0c('0x48')]['id']){delete _0x156973[_0x4c0c('0x48')]['id'];}return db[_0x4c0c('0x2b')]['find']({'where':{'id':_0x156973[_0x4c0c('0x45')]['id']}})[_0x4c0c('0x3f')](handleEntityNotFound(_0x406690,null))[_0x4c0c('0x3f')](saveUpdates(_0x156973[_0x4c0c('0x48')],null))['then'](respondWithResult(_0x406690,null))[_0x4c0c('0x43')](handleError(_0x406690,null));};exports[_0x4c0c('0x25')]=function(_0x329a8e,_0x2c232a){return db[_0x4c0c('0x2b')][_0x4c0c('0x46')]({'where':{'id':_0x329a8e[_0x4c0c('0x45')]['id']}})[_0x4c0c('0x3f')](handleEntityNotFound(_0x2c232a,null))[_0x4c0c('0x3f')](removeEntity(_0x2c232a,null))[_0x4c0c('0x43')](handleError(_0x2c232a,null));};exports[_0x4c0c('0x52')]=function(_0x191385,_0x394e7c,_0x13faf0){return db[_0x4c0c('0x2b')][_0x4c0c('0x53')]({'where':{'id':_0x191385['params']['id']}})[_0x4c0c('0x3f')](handleEntityNotFound(_0x394e7c,null))[_0x4c0c('0x3f')](function(_0x305087){var _0x19fe7d;var _0xfbe24={},_0x523401={};_0x523401[_0x4c0c('0x2e')]=_[_0x4c0c('0x30')](db[_0x4c0c('0x54')][_0x4c0c('0x2c')]);_0x523401[_0x4c0c('0x2f')]=_[_0x4c0c('0x30')](_0x191385['query']);_0x523401[_0x4c0c('0x31')]=_[_0x4c0c('0x32')](_0x523401['model'],_0x523401[_0x4c0c('0x2f')]);_0xfbe24[_0x4c0c('0x34')]=_['intersection'](_0x523401[_0x4c0c('0x2e')],qs[_0x4c0c('0x33')](_0x191385['query'][_0x4c0c('0x33')]));_0xfbe24[_0x4c0c('0x34')]=_0xfbe24['attributes'][_0x4c0c('0x55')]?_0xfbe24[_0x4c0c('0x34')]:_0x523401[_0x4c0c('0x2e')];if(!_0x191385['query'][_0x4c0c('0x35')]('nolimit')){_0xfbe24[_0x4c0c('0x1f')]=qs[_0x4c0c('0x1f')](_0x191385[_0x4c0c('0x2f')][_0x4c0c('0x1f')]);_0xfbe24['offset']=qs['offset'](_0x191385[_0x4c0c('0x2f')][_0x4c0c('0x1d')]);}_0xfbe24['order']=qs[_0x4c0c('0x37')](_0x191385[_0x4c0c('0x2f')][_0x4c0c('0x37')]);_0xfbe24[_0x4c0c('0x38')]=qs[_0x4c0c('0x31')](_[_0x4c0c('0x39')](_0x191385[_0x4c0c('0x2f')],_0x523401['filters']));if(_0x191385[_0x4c0c('0x2f')][_0x4c0c('0x3e')]){_0xfbe24[_0x4c0c('0x38')]=_['merge'](_0xfbe24['where'],{'$or':_[_0x4c0c('0x3b')](_0xfbe24[_0x4c0c('0x34')],function(_0x101680){var _0x5b9d33={};_0x5b9d33[_0x101680]={'$like':'%'+_0x191385['query'][_0x4c0c('0x3e')]+'%'};return _0x5b9d33;})});}_0xfbe24[_0x4c0c('0x38')]=_[_0x4c0c('0x3a')](_0xfbe24['where'],{'mailboxuser':_0x305087['mailbox']});_0xfbe24=_['merge']({},_0xfbe24,_0x191385[_0x4c0c('0x56')]);return db[_0x4c0c('0x54')][_0x4c0c('0x57')](_0xfbe24)['then'](respondWithFilteredResult(_0x394e7c,_0xfbe24));})['catch'](handleError(_0x394e7c,null));}; \ No newline at end of file +var _0xae2a=['rows','catch','show','params','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','hasOwnProperty','pick','mailbox','VoiceMailMessage','findAndCountAll','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','apply','reject','save','then','destroy','get','Voicemails','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0xae2a,0xc8));var _0xaae2=function(_0xd8bae9,_0x50c977){_0xd8bae9=_0xd8bae9-0x0;var _0x115306=_0xae2a[_0xd8bae9];return _0x115306;};'use strict';var emlformat=require(_0xaae2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaae2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaae2('0x2'));var moment=require(_0xaae2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xaae2('0x4'));var util=require(_0xaae2('0x5'));var path=require(_0xaae2('0x6'));var sox=require('sox');var csv=require(_0xaae2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaae2('0x8'));var _=require(_0xaae2('0x9'));var squel=require('squel');var crypto=require(_0xaae2('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xaae2('0xb'));var toCsv=require(_0xaae2('0x7'));var querystring=require('querystring');var Papa=require(_0xaae2('0xc'));var Redis=require(_0xaae2('0xd'));var authService=require(_0xaae2('0xe'));var qs=require(_0xaae2('0xf'));var as=require(_0xaae2('0x10'));var hardwareService=require(_0xaae2('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xaae2('0x12'));var config=require(_0xaae2('0x13'));var licenseUtil=require(_0xaae2('0x14'));var db=require(_0xaae2('0x15'))['db'];function respondWithStatusCode(_0x30b34b,_0x246f01){_0x246f01=_0x246f01||0xcc;return function(_0x452805){if(_0x452805){return _0x30b34b['sendStatus'](_0x246f01);}return _0x30b34b[_0xaae2('0x16')](_0x246f01)[_0xaae2('0x17')]();};}function respondWithResult(_0x5bb199,_0x4d90cc){_0x4d90cc=_0x4d90cc||0xc8;return function(_0x769283){if(_0x769283){return _0x5bb199[_0xaae2('0x16')](_0x4d90cc)[_0xaae2('0x18')](_0x769283);}};}function respondWithFilteredResult(_0x2b2f09,_0x184112){return function(_0x2d671e){if(_0x2d671e){var _0x350dee=typeof _0x184112[_0xaae2('0x19')]===_0xaae2('0x1a')&&typeof _0x184112['limit']===_0xaae2('0x1a');var _0x27c6d3=_0x2d671e[_0xaae2('0x1b')];var _0x495567=_0x350dee?0x0:_0x184112[_0xaae2('0x19')];var _0x48c279=_0x350dee?_0x2d671e[_0xaae2('0x1b')]:_0x184112[_0xaae2('0x19')]+_0x184112[_0xaae2('0x1c')];var _0x467428;if(_0x48c279>=_0x27c6d3){_0x48c279=_0x27c6d3;_0x467428=0xc8;}else{_0x467428=0xce;}_0x2b2f09[_0xaae2('0x16')](_0x467428);return _0x2b2f09['set']('Content-Range',_0x495567+'-'+_0x48c279+'/'+_0x27c6d3)[_0xaae2('0x18')](_0x2d671e);}return null;};}function patchUpdates(_0x24e978){return function(_0x4a0f1d){try{jsonpatch[_0xaae2('0x1d')](_0x4a0f1d,_0x24e978,!![]);}catch(_0x48d28f){return BPromise[_0xaae2('0x1e')](_0x48d28f);}return _0x4a0f1d[_0xaae2('0x1f')]();};}function saveUpdates(_0x198ced,_0x473a3f){return function(_0x2e7493){if(_0x2e7493){return _0x2e7493['update'](_0x198ced)[_0xaae2('0x20')](function(_0x19dd13){return _0x19dd13;});}return null;};}function removeEntity(_0x3fa80f,_0x1761b6){return function(_0x37dc20){if(_0x37dc20){return _0x37dc20[_0xaae2('0x21')]()[_0xaae2('0x20')](function(){var _0x5c3513=_0x37dc20[_0xaae2('0x22')]({'plain':!![]});var _0x16b5ad=_0xaae2('0x23');return db[_0xaae2('0x24')]['destroy']({'where':{'type':_0x16b5ad,'resourceId':_0x5c3513['id']}})['then'](function(){return _0x37dc20;});})[_0xaae2('0x20')](function(){_0x3fa80f[_0xaae2('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420c00,_0x5b9c08){return function(_0x28a42c){if(!_0x28a42c){_0x420c00[_0xaae2('0x25')](0x194);}return _0x28a42c;};}function handleError(_0x2cba10,_0x56fa36){_0x56fa36=_0x56fa36||0x1f4;return function(_0x16da81){logger['error'](_0x16da81[_0xaae2('0x26')]);if(_0x16da81[_0xaae2('0x27')]){delete _0x16da81[_0xaae2('0x27')];}_0x2cba10[_0xaae2('0x16')](_0x56fa36)[_0xaae2('0x28')](_0x16da81);};}exports[_0xaae2('0x29')]=function(_0x32d13d,_0x18c3cf){var _0x1c032f={},_0x471628={},_0xfbadb5={'count':0x0,'rows':[]};var _0x24c00d=_[_0xaae2('0x2a')](db[_0xaae2('0x2b')][_0xaae2('0x2c')],function(_0x3ed41f){return{'name':_0x3ed41f[_0xaae2('0x2d')],'type':_0x3ed41f[_0xaae2('0x2e')][_0xaae2('0x2f')]};});_0x471628[_0xaae2('0x30')]=_[_0xaae2('0x2a')](_0x24c00d,_0xaae2('0x27'));_0x471628[_0xaae2('0x31')]=_[_0xaae2('0x32')](_0x32d13d[_0xaae2('0x31')]);_0x471628['filters']=_['intersection'](_0x471628[_0xaae2('0x30')],_0x471628[_0xaae2('0x31')]);_0x1c032f[_0xaae2('0x33')]=_[_0xaae2('0x34')](_0x471628[_0xaae2('0x30')],qs[_0xaae2('0x35')](_0x32d13d['query']['fields']));_0x1c032f[_0xaae2('0x33')]=_0x1c032f['attributes']['length']?_0x1c032f[_0xaae2('0x33')]:_0x471628[_0xaae2('0x30')];if(!_0x32d13d['query']['hasOwnProperty'](_0xaae2('0x36'))){_0x1c032f[_0xaae2('0x1c')]=qs['limit'](_0x32d13d['query'][_0xaae2('0x1c')]);_0x1c032f['offset']=qs['offset'](_0x32d13d[_0xaae2('0x31')][_0xaae2('0x19')]);}_0x1c032f[_0xaae2('0x37')]=qs[_0xaae2('0x38')](_0x32d13d[_0xaae2('0x31')][_0xaae2('0x38')]);_0x1c032f[_0xaae2('0x39')]=qs[_0xaae2('0x3a')](_['pick'](_0x32d13d[_0xaae2('0x31')],_0x471628['filters']),_0x24c00d);if(_0x32d13d[_0xaae2('0x31')][_0xaae2('0x3b')]){_0x1c032f['where']=_[_0xaae2('0x3c')](_0x1c032f[_0xaae2('0x39')],{'$or':_[_0xaae2('0x2a')](_0x24c00d,function(_0xf869be){if(_0xf869be[_0xaae2('0x2e')]!==_0xaae2('0x3d')){var _0x517374={};_0x517374[_0xf869be[_0xaae2('0x27')]]={'$like':'%'+_0x32d13d[_0xaae2('0x31')][_0xaae2('0x3b')]+'%'};return _0x517374;}})});}_0x1c032f=_[_0xaae2('0x3c')]({},_0x1c032f,_0x32d13d[_0xaae2('0x3e')]);var _0x43579a={'where':_0x1c032f[_0xaae2('0x39')]};return db[_0xaae2('0x2b')][_0xaae2('0x1b')](_0x43579a)[_0xaae2('0x20')](function(_0x38d634){_0xfbadb5[_0xaae2('0x1b')]=_0x38d634;if(_0x32d13d[_0xaae2('0x31')]['includeAll']){_0x1c032f[_0xaae2('0x3f')]=[{'all':!![]}];}return db[_0xaae2('0x2b')]['findAll'](_0x1c032f);})[_0xaae2('0x20')](function(_0x37277d){_0xfbadb5[_0xaae2('0x40')]=_0x37277d;return _0xfbadb5;})[_0xaae2('0x20')](respondWithFilteredResult(_0x18c3cf,_0x1c032f))[_0xaae2('0x41')](handleError(_0x18c3cf,null));};exports[_0xaae2('0x42')]=function(_0x2aa0c9,_0xbee0c0){var _0x426954={'raw':!![],'where':{'id':_0x2aa0c9[_0xaae2('0x43')]['id']}},_0x1f74ff={};_0x1f74ff[_0xaae2('0x30')]=_[_0xaae2('0x32')](db[_0xaae2('0x2b')][_0xaae2('0x2c')]);_0x1f74ff[_0xaae2('0x31')]=_[_0xaae2('0x32')](_0x2aa0c9[_0xaae2('0x31')]);_0x1f74ff['filters']=_[_0xaae2('0x34')](_0x1f74ff['model'],_0x1f74ff[_0xaae2('0x31')]);_0x426954[_0xaae2('0x33')]=_['intersection'](_0x1f74ff[_0xaae2('0x30')],qs[_0xaae2('0x35')](_0x2aa0c9['query'][_0xaae2('0x35')]));_0x426954[_0xaae2('0x33')]=_0x426954[_0xaae2('0x33')][_0xaae2('0x44')]?_0x426954[_0xaae2('0x33')]:_0x1f74ff[_0xaae2('0x30')];if(_0x2aa0c9['query'][_0xaae2('0x45')]){_0x426954['include']=[{'all':!![]}];}_0x426954=_[_0xaae2('0x3c')]({},_0x426954,_0x2aa0c9[_0xaae2('0x3e')]);return db[_0xaae2('0x2b')][_0xaae2('0x46')](_0x426954)[_0xaae2('0x20')](handleEntityNotFound(_0xbee0c0,null))[_0xaae2('0x20')](respondWithResult(_0xbee0c0,null))[_0xaae2('0x41')](handleError(_0xbee0c0,null));};exports[_0xaae2('0x47')]=function(_0x50d31b,_0x4b85a6){return db[_0xaae2('0x2b')][_0xaae2('0x47')](_0x50d31b[_0xaae2('0x48')],{})[_0xaae2('0x20')](function(_0x238da6){var _0x13fb86=_0x50d31b['user'][_0xaae2('0x22')]({'plain':!![]});if(!_0x13fb86)throw new Error(_0xaae2('0x49'));if(_0x13fb86[_0xaae2('0x4a')]===_0xaae2('0x4b')){var _0xf914a0=_0x238da6['get']({'plain':!![]});var _0x2e1e6b=_0xaae2('0x23');return db[_0xaae2('0x4c')][_0xaae2('0x46')]({'where':{'name':_0x2e1e6b,'userProfileId':_0x13fb86[_0xaae2('0x4d')]},'raw':!![]})[_0xaae2('0x20')](function(_0x32a58e){if(_0x32a58e&&_0x32a58e[_0xaae2('0x4e')]===0x0){return db[_0xaae2('0x24')][_0xaae2('0x47')]({'name':_0xf914a0[_0xaae2('0x27')],'resourceId':_0xf914a0['id'],'type':_0x32a58e['name'],'sectionId':_0x32a58e['id']},{})[_0xaae2('0x20')](function(){return _0x238da6;});}else{return _0x238da6;}})['catch'](function(_0x197acd){logger[_0xaae2('0x4f')](_0xaae2('0x50'),_0x197acd);throw _0x197acd;});}return _0x238da6;})['then'](respondWithResult(_0x4b85a6,0xc9))[_0xaae2('0x41')](handleError(_0x4b85a6,null));};exports[_0xaae2('0x51')]=function(_0x52a95f,_0x45346b){if(_0x52a95f[_0xaae2('0x48')]['id']){delete _0x52a95f[_0xaae2('0x48')]['id'];}return db[_0xaae2('0x2b')][_0xaae2('0x46')]({'where':{'id':_0x52a95f[_0xaae2('0x43')]['id']}})['then'](handleEntityNotFound(_0x45346b,null))['then'](saveUpdates(_0x52a95f['body'],null))[_0xaae2('0x20')](respondWithResult(_0x45346b,null))[_0xaae2('0x41')](handleError(_0x45346b,null));};exports[_0xaae2('0x21')]=function(_0x5c6d70,_0x367273){return db[_0xaae2('0x2b')][_0xaae2('0x46')]({'where':{'id':_0x5c6d70['params']['id']}})[_0xaae2('0x20')](handleEntityNotFound(_0x367273,null))['then'](removeEntity(_0x367273,null))[_0xaae2('0x41')](handleError(_0x367273,null));};exports[_0xaae2('0x52')]=function(_0x32ec57,_0xe38780,_0x32b5d1){return db[_0xaae2('0x2b')]['findOne']({'where':{'id':_0x32ec57['params']['id']}})[_0xaae2('0x20')](handleEntityNotFound(_0xe38780,null))['then'](function(_0x1e7c6c){var _0x46ec83;var _0x4903b5={},_0x9eef0a={};_0x9eef0a[_0xaae2('0x30')]=_[_0xaae2('0x32')](db['VoiceMailMessage'][_0xaae2('0x2c')]);_0x9eef0a[_0xaae2('0x31')]=_[_0xaae2('0x32')](_0x32ec57[_0xaae2('0x31')]);_0x9eef0a[_0xaae2('0x3a')]=_[_0xaae2('0x34')](_0x9eef0a[_0xaae2('0x30')],_0x9eef0a[_0xaae2('0x31')]);_0x4903b5[_0xaae2('0x33')]=_[_0xaae2('0x34')](_0x9eef0a[_0xaae2('0x30')],qs['fields'](_0x32ec57[_0xaae2('0x31')][_0xaae2('0x35')]));_0x4903b5[_0xaae2('0x33')]=_0x4903b5[_0xaae2('0x33')]['length']?_0x4903b5['attributes']:_0x9eef0a[_0xaae2('0x30')];if(!_0x32ec57[_0xaae2('0x31')][_0xaae2('0x53')]('nolimit')){_0x4903b5[_0xaae2('0x1c')]=qs[_0xaae2('0x1c')](_0x32ec57['query'][_0xaae2('0x1c')]);_0x4903b5[_0xaae2('0x19')]=qs['offset'](_0x32ec57['query']['offset']);}_0x4903b5['order']=qs[_0xaae2('0x38')](_0x32ec57[_0xaae2('0x31')][_0xaae2('0x38')]);_0x4903b5['where']=qs['filters'](_[_0xaae2('0x54')](_0x32ec57['query'],_0x9eef0a[_0xaae2('0x3a')]));if(_0x32ec57[_0xaae2('0x31')][_0xaae2('0x3b')]){_0x4903b5[_0xaae2('0x39')]=_[_0xaae2('0x3c')](_0x4903b5[_0xaae2('0x39')],{'$or':_[_0xaae2('0x2a')](_0x4903b5[_0xaae2('0x33')],function(_0x4382ee){var _0x419930={};_0x419930[_0x4382ee]={'$like':'%'+_0x32ec57[_0xaae2('0x31')][_0xaae2('0x3b')]+'%'};return _0x419930;})});}_0x4903b5['where']=_[_0xaae2('0x3c')](_0x4903b5[_0xaae2('0x39')],{'mailboxuser':_0x1e7c6c[_0xaae2('0x55')]});_0x4903b5=_['merge']({},_0x4903b5,_0x32ec57[_0xaae2('0x3e')]);return db[_0xaae2('0x56')][_0xaae2('0x57')](_0x4903b5)['then'](respondWithFilteredResult(_0xe38780,_0x4903b5));})[_0xaae2('0x41')](handleError(_0xe38780,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index af04136..a472e61 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 _0x1437=['moment','request-promise','path','rimraf','./voiceMail.attributes','exports','voice_voicemail','mailbox_context','mailbox','lodash','util','api'];(function(_0xb0bbc1,_0x3f67f4){var _0x3aede9=function(_0xcca029){while(--_0xcca029){_0xb0bbc1['push'](_0xb0bbc1['shift']());}};_0x3aede9(++_0x3f67f4);}(_0x1437,0x1c5));var _0x7143=function(_0x453eb6,_0x4cbdbb){_0x453eb6=_0x453eb6-0x0;var _0x5c4c0a=_0x1437[_0x453eb6];return _0x5c4c0a;};'use strict';var _=require(_0x7143('0x0'));var util=require(_0x7143('0x1'));var logger=require('../../config/logger')(_0x7143('0x2'));var moment=require(_0x7143('0x3'));var BPromise=require('bluebird');var rp=require(_0x7143('0x4'));var fs=require('fs');var path=require(_0x7143('0x5'));var rimraf=require(_0x7143('0x6'));var config=require('../../config/environment');var attributes=require(_0x7143('0x7'));module[_0x7143('0x8')]=function(_0x2ab1c7,_0x24b4f6){return _0x2ab1c7['define']('VoiceMail',attributes,{'tableName':_0x7143('0x9'),'paranoid':![],'indexes':[{'name':_0x7143('0xa'),'fields':[_0x7143('0xb'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x133d=['moment','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','api'];(function(_0x2a0c52,_0x58cc82){var _0x18fba7=function(_0xe83949){while(--_0xe83949){_0x2a0c52['push'](_0x2a0c52['shift']());}};_0x18fba7(++_0x58cc82);}(_0x133d,0x193));var _0xd133=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x133d[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0xd133('0x0'));var util=require(_0xd133('0x1'));var logger=require('../../config/logger')(_0xd133('0x2'));var moment=require(_0xd133('0x3'));var BPromise=require('bluebird');var rp=require(_0xd133('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd133('0x5'));var config=require(_0xd133('0x6'));var attributes=require(_0xd133('0x7'));module[_0xd133('0x8')]=function(_0x7865f0,_0x3e7f6b){return _0x7865f0[_0xd133('0x9')](_0xd133('0xa'),attributes,{'tableName':_0xd133('0xb'),'paranoid':![],'indexes':[{'name':_0xd133('0xc'),'fields':['mailbox',_0xd133('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index e4df234..4e54e82 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 _0x8c12=['message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error'];(function(_0x75e338,_0x5dbfe9){var _0x367cb2=function(_0xb116d3){while(--_0xb116d3){_0x75e338['push'](_0x75e338['shift']());}};_0x367cb2(++_0x5dbfe9);}(_0x8c12,0xd5));var _0x28c1=function(_0x2a069a,_0x217880){_0x2a069a=_0x2a069a-0x0;var _0x53ed38=_0x8c12[_0x2a069a];return _0x53ed38;};'use strict';var _=require(_0x28c1('0x0'));var util=require(_0x28c1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x28c1('0x2'));var fs=require('fs');var Redis=require(_0x28c1('0x3'));var db=require(_0x28c1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x28c1('0x5'))(_0x28c1('0x6'));var config=require(_0x28c1('0x7'));var jayson=require(_0x28c1('0x8'));var client=jayson[_0x28c1('0x9')][_0x28c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26882f,_0x2f3308,_0x523e8a){return new BPromise(function(_0x4232ec,_0x3b12fb){return client['request'](_0x26882f,_0x523e8a)[_0x28c1('0xb')](function(_0xc3d3c3){logger[_0x28c1('0xc')](_0x28c1('0xd'),_0x2f3308,_0x28c1('0xe'));logger[_0x28c1('0xf')](_0x28c1('0x10'),_0x2f3308,_0x28c1('0xe'),JSON['stringify'](_0xc3d3c3));if(_0xc3d3c3['error']){if(_0xc3d3c3['error']['code']===0x1f4){logger[_0x28c1('0x11')](_0x28c1('0xd'),_0x2f3308,_0xc3d3c3[_0x28c1('0x11')]['message']);return _0x3b12fb(_0xc3d3c3[_0x28c1('0x11')]['message']);}logger[_0x28c1('0x11')](_0x28c1('0xd'),_0x2f3308,_0xc3d3c3[_0x28c1('0x11')][_0x28c1('0x12')]);return _0x4232ec(_0xc3d3c3[_0x28c1('0x11')]['message']);}else{logger[_0x28c1('0xc')]('VoiceMail,\x20%s,\x20%s',_0x2f3308,_0x28c1('0xe'));_0x4232ec(_0xc3d3c3[_0x28c1('0x13')][_0x28c1('0x12')]);}})[_0x28c1('0x14')](function(_0x36113d){logger[_0x28c1('0x11')](_0x28c1('0xd'),_0x2f3308,_0x36113d);_0x3b12fb(_0x36113d);});});} \ No newline at end of file +var _0x65f8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring'];(function(_0x1bd2eb,_0x46267a){var _0x1b1768=function(_0x2a49b0){while(--_0x2a49b0){_0x1bd2eb['push'](_0x1bd2eb['shift']());}};_0x1b1768(++_0x46267a);}(_0x65f8,0x194));var _0x865f=function(_0x398fbb,_0x43220d){_0x398fbb=_0x398fbb-0x0;var _0x132e5c=_0x65f8[_0x398fbb];return _0x132e5c;};'use strict';var _=require(_0x865f('0x0'));var util=require(_0x865f('0x1'));var moment=require('moment');var BPromise=require(_0x865f('0x2'));var rs=require(_0x865f('0x3'));var fs=require('fs');var Redis=require(_0x865f('0x4'));var db=require(_0x865f('0x5'))['db'];var utils=require(_0x865f('0x6'));var logger=require(_0x865f('0x7'))('rpc');var config=require(_0x865f('0x8'));var jayson=require(_0x865f('0x9'));var client=jayson[_0x865f('0xa')][_0x865f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bb751,_0x38ec88,_0x2aa96b){return new BPromise(function(_0x169229,_0x17445f){return client['request'](_0x3bb751,_0x2aa96b)[_0x865f('0xc')](function(_0x1f6635){logger['info'](_0x865f('0xd'),_0x38ec88,'request\x20sent');logger[_0x865f('0xe')](_0x865f('0xf'),_0x38ec88,_0x865f('0x10'),JSON[_0x865f('0x11')](_0x1f6635));if(_0x1f6635[_0x865f('0x12')]){if(_0x1f6635[_0x865f('0x12')][_0x865f('0x13')]===0x1f4){logger[_0x865f('0x12')](_0x865f('0xd'),_0x38ec88,_0x1f6635[_0x865f('0x12')][_0x865f('0x14')]);return _0x17445f(_0x1f6635[_0x865f('0x12')][_0x865f('0x14')]);}logger[_0x865f('0x12')]('VoiceMail,\x20%s,\x20%s',_0x38ec88,_0x1f6635['error'][_0x865f('0x14')]);return _0x169229(_0x1f6635[_0x865f('0x12')][_0x865f('0x14')]);}else{logger[_0x865f('0x15')](_0x865f('0xd'),_0x38ec88,_0x865f('0x10'));_0x169229(_0x1f6635[_0x865f('0x16')][_0x865f('0x14')]);}})[_0x865f('0x17')](function(_0x2f8451){logger['error']('VoiceMail,\x20%s,\x20%s',_0x38ec88,_0x2f8451);_0x17445f(_0x2f8451);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 6b93009..2d4eecd 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 _0xc8b0=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id/download','create','put','update','delete','/:id','exports','multer','util'];(function(_0x3a83fc,_0x2e8cda){var _0x5c8bd2=function(_0x31a9b7){while(--_0x31a9b7){_0x3a83fc['push'](_0x3a83fc['shift']());}};_0x5c8bd2(++_0x2e8cda);}(_0xc8b0,0x1cc));var _0x0c8b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc8b0[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x0c8b('0x0'));var util=require(_0x0c8b('0x1'));var path=require(_0x0c8b('0x2'));var timeout=require(_0x0c8b('0x3'));var express=require(_0x0c8b('0x4'));var router=express[_0x0c8b('0x5')]();var fs_extra=require(_0x0c8b('0x6'));var auth=require(_0x0c8b('0x7'));var interaction=require(_0x0c8b('0x8'));var config=require(_0x0c8b('0x9'));var controller=require(_0x0c8b('0xa'));router[_0x0c8b('0xb')]('/',auth[_0x0c8b('0xc')](),controller[_0x0c8b('0xd')]);router[_0x0c8b('0xb')]('/:id',auth[_0x0c8b('0xc')](),controller['show']);router[_0x0c8b('0xb')](_0x0c8b('0xe'),auth[_0x0c8b('0xc')](),controller['download']);router['post']('/',auth[_0x0c8b('0xc')](),controller[_0x0c8b('0xf')]);router[_0x0c8b('0x10')]('/:id',auth[_0x0c8b('0xc')](),controller[_0x0c8b('0x11')]);router[_0x0c8b('0x12')](_0x0c8b('0x13'),auth[_0x0c8b('0xc')](),controller['destroy']);module[_0x0c8b('0x14')]=router; \ No newline at end of file +var _0xbfa7=['index','show','/:id/download','isAuthenticated','post','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xbfa7,0x1b0));var _0x7bfa=function(_0x24f1d0,_0x51e9a6){_0x24f1d0=_0x24f1d0-0x0;var _0x427dd4=_0xbfa7[_0x24f1d0];return _0x427dd4;};'use strict';var multer=require(_0x7bfa('0x0'));var util=require(_0x7bfa('0x1'));var path=require(_0x7bfa('0x2'));var timeout=require(_0x7bfa('0x3'));var express=require(_0x7bfa('0x4'));var router=express[_0x7bfa('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7bfa('0x6'));var config=require(_0x7bfa('0x7'));var controller=require(_0x7bfa('0x8'));router[_0x7bfa('0x9')]('/',auth['isAuthenticated'](),controller[_0x7bfa('0xa')]);router[_0x7bfa('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7bfa('0xb')]);router[_0x7bfa('0x9')](_0x7bfa('0xc'),auth[_0x7bfa('0xd')](),controller['download']);router[_0x7bfa('0xe')]('/',auth[_0x7bfa('0xd')](),controller['create']);router['put'](_0x7bfa('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7bfa('0xf'),auth[_0x7bfa('0xd')](),controller['destroy']);module[_0x7bfa('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index e92e41c..dadc3ab 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 _0x64d9=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','long','TIMESTAMP'];(function(_0x4b6c5d,_0x3cbbdf){var _0x4e4d47=function(_0x311028){while(--_0x311028){_0x4b6c5d['push'](_0x4b6c5d['shift']());}};_0x4e4d47(++_0x3cbbdf);}(_0x64d9,0x12e));var _0x964d=function(_0x532c95,_0x54bae9){_0x532c95=_0x532c95-0x0;var _0x1e8ea8=_0x64d9[_0x532c95];return _0x1e8ea8;};'use strict';var Sequelize=require(_0x964d('0x0'));module[_0x964d('0x1')]={'name':{'type':Sequelize[_0x964d('0x2')],'get':function(_0x282d85){return this[_0x964d('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x964d('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x964d('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x964d('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x964d('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x964d('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x964d('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x964d('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x964d('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x964d('0x5')](_0x964d('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x964d('0x4')],'defaultValue':''},'stamp':{'type':_0x964d('0x7'),'defaultValue':Sequelize[_0x964d('0x8')](_0x964d('0x9'))}}; \ No newline at end of file +var _0x10e7=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER','STRING','long'];(function(_0x3d887,_0x405d7d){var _0x423d5b=function(_0x178bf7){while(--_0x178bf7){_0x3d887['push'](_0x3d887['shift']());}};_0x423d5b(++_0x405d7d);}(_0x10e7,0x1ba));var _0x710e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x10e7[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x710e('0x0'));module['exports']={'name':{'type':Sequelize[_0x710e('0x1')],'get':function(_0x124e2d){return this[_0x710e('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x710e('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x710e('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x710e('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x710e('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x710e('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x710e('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x710e('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x710e('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x710e('0x6')](_0x710e('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index b38d42d..7e78632 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 _0x0ef2=['fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceMailMessage','fieldName','type','key','differenceBy','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','find','download','recording','msg_id','Sequelize','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0ef2,0x1ea));var _0x20ef=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x0ef2[_0x16629d];return _0x56ccee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20ef('0x0'));var zipdir=require(_0x20ef('0x1'));var jsonpatch=require(_0x20ef('0x2'));var rp=require('request-promise');var moment=require(_0x20ef('0x3'));var BPromise=require(_0x20ef('0x4'));var Mustache=require(_0x20ef('0x5'));var util=require('util');var path=require(_0x20ef('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x20ef('0x7'));var fs=require('fs');var fs_extra=require(_0x20ef('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x20ef('0x9'));var jsforce=require(_0x20ef('0xa'));var deskjs=require(_0x20ef('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x20ef('0xc'));var Redis=require(_0x20ef('0xd'));var authService=require(_0x20ef('0xe'));var qs=require(_0x20ef('0xf'));var as=require(_0x20ef('0x10'));var hardwareService=require(_0x20ef('0x11'));var logger=require(_0x20ef('0x12'))(_0x20ef('0x13'));var utils=require(_0x20ef('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x20ef('0x15'));var db=require(_0x20ef('0x16'))['db'];function respondWithStatusCode(_0x1f6559,_0x1c6e58){_0x1c6e58=_0x1c6e58||0xcc;return function(_0x19893b){if(_0x19893b){return _0x1f6559['sendStatus'](_0x1c6e58);}return _0x1f6559[_0x20ef('0x17')](_0x1c6e58)['end']();};}function respondWithResult(_0x362234,_0x3cf837){_0x3cf837=_0x3cf837||0xc8;return function(_0x14ef54){if(_0x14ef54){return _0x362234[_0x20ef('0x17')](_0x3cf837)[_0x20ef('0x18')](_0x14ef54);}};}function respondWithFilteredResult(_0x4b024b,_0xc8b2e){return function(_0x241822){if(_0x241822){var _0x52919a=typeof _0xc8b2e[_0x20ef('0x19')]===_0x20ef('0x1a')&&typeof _0xc8b2e[_0x20ef('0x1b')]===_0x20ef('0x1a');var _0x5f4ce3=_0x241822[_0x20ef('0x1c')];var _0x3d1d78=_0x52919a?0x0:_0xc8b2e[_0x20ef('0x19')];var _0x9246d9=_0x52919a?_0x241822[_0x20ef('0x1c')]:_0xc8b2e[_0x20ef('0x19')]+_0xc8b2e[_0x20ef('0x1b')];var _0x4af7e1;if(_0x9246d9>=_0x5f4ce3){_0x9246d9=_0x5f4ce3;_0x4af7e1=0xc8;}else{_0x4af7e1=0xce;}_0x4b024b[_0x20ef('0x17')](_0x4af7e1);return _0x4b024b[_0x20ef('0x1d')](_0x20ef('0x1e'),_0x3d1d78+'-'+_0x9246d9+'/'+_0x5f4ce3)[_0x20ef('0x18')](_0x241822);}return null;};}function patchUpdates(_0x70d581){return function(_0x15ebe3){try{jsonpatch[_0x20ef('0x1f')](_0x15ebe3,_0x70d581,!![]);}catch(_0x53c001){return BPromise[_0x20ef('0x20')](_0x53c001);}return _0x15ebe3['save']();};}function saveUpdates(_0x3a1ca8,_0x9a95f8){return function(_0x146578){if(_0x146578){return _0x146578[_0x20ef('0x21')](_0x3a1ca8)[_0x20ef('0x22')](function(_0x51f13e){return _0x51f13e;});}return null;};}function removeEntity(_0x31f333,_0x35c433){return function(_0x57a969){if(_0x57a969){return _0x57a969[_0x20ef('0x23')]()[_0x20ef('0x22')](function(){_0x31f333[_0x20ef('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ae059,_0x5dc8ed){return function(_0xf2f32c){if(!_0xf2f32c){_0x2ae059[_0x20ef('0x24')](0x194);}return _0xf2f32c;};}function handleError(_0x376e75,_0x3849fe){_0x3849fe=_0x3849fe||0x1f4;return function(_0x313494){logger[_0x20ef('0x25')](_0x313494[_0x20ef('0x26')]);if(_0x313494[_0x20ef('0x27')]){delete _0x313494[_0x20ef('0x27')];}_0x376e75[_0x20ef('0x17')](_0x3849fe)[_0x20ef('0x28')](_0x313494);};}exports[_0x20ef('0x29')]=function(_0x46472d,_0x72ba1b){var _0x2d5c13={},_0x32c1c2={},_0x5c731c={'count':0x0,'rows':[]};var _0x5ab814=_[_0x20ef('0x2a')](db[_0x20ef('0x2b')]['rawAttributes'],function(_0x107870){return{'name':_0x107870[_0x20ef('0x2c')],'type':_0x107870[_0x20ef('0x2d')][_0x20ef('0x2e')]};});_0x32c1c2['model']=_[_0x20ef('0x2f')](_['map'](_0x5ab814,_0x20ef('0x27')),[_0x20ef('0x27')]);_0x32c1c2[_0x20ef('0x30')]=_[_0x20ef('0x31')](_0x46472d[_0x20ef('0x30')]);_0x32c1c2[_0x20ef('0x32')]=_[_0x20ef('0x33')](_0x32c1c2['model'],_0x32c1c2[_0x20ef('0x30')]);_0x2d5c13[_0x20ef('0x34')]=_[_0x20ef('0x33')](_0x32c1c2[_0x20ef('0x35')],qs[_0x20ef('0x36')](_0x46472d[_0x20ef('0x30')][_0x20ef('0x36')]));_0x2d5c13[_0x20ef('0x34')]=_0x2d5c13[_0x20ef('0x34')][_0x20ef('0x37')]?_0x2d5c13[_0x20ef('0x34')]:_0x32c1c2['model'];if(!_0x46472d[_0x20ef('0x30')]['hasOwnProperty'](_0x20ef('0x38'))){_0x2d5c13[_0x20ef('0x1b')]=qs['limit'](_0x46472d[_0x20ef('0x30')][_0x20ef('0x1b')]);_0x2d5c13[_0x20ef('0x19')]=qs[_0x20ef('0x19')](_0x46472d[_0x20ef('0x30')][_0x20ef('0x19')]);}_0x2d5c13[_0x20ef('0x39')]=qs['sort'](_0x46472d[_0x20ef('0x30')][_0x20ef('0x3a')]);_0x2d5c13[_0x20ef('0x3b')]=qs[_0x20ef('0x32')](_[_0x20ef('0x3c')](_0x46472d[_0x20ef('0x30')],_0x32c1c2['filters']),_0x5ab814);if(_0x46472d[_0x20ef('0x30')][_0x20ef('0x3d')]){_0x2d5c13[_0x20ef('0x3b')]=_[_0x20ef('0x3e')](_0x2d5c13[_0x20ef('0x3b')],{'$or':_[_0x20ef('0x2a')](_0x5ab814,function(_0x598f16){if(_0x598f16['type']!==_0x20ef('0x3f')){var _0x2da889={};_0x2da889[_0x598f16[_0x20ef('0x27')]]={'$like':'%'+_0x46472d['query'][_0x20ef('0x3d')]+'%'};return _0x2da889;}})});}_0x2d5c13=_['merge']({},_0x2d5c13,_0x46472d[_0x20ef('0x40')]);var _0x3b3be1={'where':_0x2d5c13[_0x20ef('0x3b')]};return db[_0x20ef('0x2b')]['count'](_0x3b3be1)[_0x20ef('0x22')](function(_0x4f273c){_0x5c731c['count']=_0x4f273c;if(_0x46472d['query'][_0x20ef('0x41')]){_0x2d5c13['include']=[{'all':!![]}];}return db[_0x20ef('0x2b')][_0x20ef('0x42')](_0x2d5c13);})[_0x20ef('0x22')](function(_0x2c189f){_0x5c731c[_0x20ef('0x43')]=_0x2c189f;return _0x5c731c;})[_0x20ef('0x22')](respondWithFilteredResult(_0x72ba1b,_0x2d5c13))[_0x20ef('0x44')](handleError(_0x72ba1b,null));};exports[_0x20ef('0x45')]=function(_0x122833,_0xdbdeb){var _0xc523eb={'raw':!![],'where':{'id':_0x122833[_0x20ef('0x46')]['id']}},_0x29d4ab={};_0x29d4ab[_0x20ef('0x35')]=_[_0x20ef('0x31')](db[_0x20ef('0x2b')][_0x20ef('0x47')]);_0x29d4ab[_0x20ef('0x30')]=_[_0x20ef('0x31')](_0x122833[_0x20ef('0x30')]);_0x29d4ab[_0x20ef('0x32')]=_[_0x20ef('0x33')](_0x29d4ab[_0x20ef('0x35')],_0x29d4ab['query']);_0xc523eb['attributes']=_['intersection'](_0x29d4ab[_0x20ef('0x35')],qs[_0x20ef('0x36')](_0x122833[_0x20ef('0x30')][_0x20ef('0x36')]));_0xc523eb[_0x20ef('0x34')]=_0xc523eb[_0x20ef('0x34')][_0x20ef('0x37')]?_0xc523eb[_0x20ef('0x34')]:_0x29d4ab[_0x20ef('0x35')];if(_0x122833[_0x20ef('0x30')][_0x20ef('0x41')]){_0xc523eb[_0x20ef('0x48')]=[{'all':!![]}];}_0xc523eb=_[_0x20ef('0x3e')]({},_0xc523eb,_0x122833[_0x20ef('0x40')]);return db[_0x20ef('0x2b')]['find'](_0xc523eb)[_0x20ef('0x22')](handleEntityNotFound(_0xdbdeb,null))[_0x20ef('0x22')](respondWithResult(_0xdbdeb,null))[_0x20ef('0x44')](handleError(_0xdbdeb,null));};exports[_0x20ef('0x49')]=function(_0x540944,_0x4e921b){return db[_0x20ef('0x2b')][_0x20ef('0x49')](_0x540944[_0x20ef('0x4a')],{})['then'](respondWithResult(_0x4e921b,0xc9))[_0x20ef('0x44')](handleError(_0x4e921b,null));};exports[_0x20ef('0x21')]=function(_0x54edf8,_0x5a8a97){if(_0x54edf8['body']['id']){delete _0x54edf8[_0x20ef('0x4a')]['id'];}return db['VoiceMailMessage'][_0x20ef('0x4b')]({'where':{'id':_0x54edf8[_0x20ef('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a8a97,null))['then'](saveUpdates(_0x54edf8[_0x20ef('0x4a')],null))['then'](respondWithResult(_0x5a8a97,null))['catch'](handleError(_0x5a8a97,null));};exports[_0x20ef('0x23')]=function(_0x519b1f,_0x268e8a){return db['VoiceMailMessage']['find']({'where':{'id':_0x519b1f[_0x20ef('0x46')]['id']}})[_0x20ef('0x22')](handleEntityNotFound(_0x268e8a,null))[_0x20ef('0x22')](removeEntity(_0x268e8a,null))[_0x20ef('0x44')](handleError(_0x268e8a,null));};exports[_0x20ef('0x4c')]=function(_0xac71bf,_0x5363ee,_0x3c430c){return db[_0x20ef('0x2b')]['find']({'where':{'id':_0xac71bf['params']['id']},'attributes':['id',_0x20ef('0x4d'),_0x20ef('0x4e')]})[_0x20ef('0x22')](handleEntityNotFound(_0x5363ee,null))[_0x20ef('0x22')](function(_0x250644){if(_0x250644){if(!_0x250644['recording']){throw new db[(_0x20ef('0x4f'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x4fc2f3={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x250644['msg_id']){_0x4fc2f3['Content-Disposition']=_0x20ef('0x50')+_0x250644[_0x20ef('0x4e')]+_0x20ef('0x51');}_0x5363ee['set'](_0x4fc2f3);return _0x5363ee[_0x20ef('0x28')](new Buffer(_0x250644[_0x20ef('0x4d')]));}})['catch'](handleError(_0x5363ee,null));}; \ No newline at end of file +var _0x5e79=['sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','VoiceMailMessage','rawAttributes','model','differenceBy','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','download','recording','Sequelize','ValidationError','attachment','msg_id','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x5e79,0x1f2));var _0x95e7=function(_0x1543a2,_0x5970a0){_0x1543a2=_0x1543a2-0x0;var _0x4d6cda=_0x5e79[_0x1543a2];return _0x4d6cda;};'use strict';var emlformat=require(_0x95e7('0x0'));var rimraf=require(_0x95e7('0x1'));var zipdir=require(_0x95e7('0x2'));var jsonpatch=require(_0x95e7('0x3'));var rp=require(_0x95e7('0x4'));var moment=require(_0x95e7('0x5'));var BPromise=require(_0x95e7('0x6'));var Mustache=require(_0x95e7('0x7'));var util=require(_0x95e7('0x8'));var path=require(_0x95e7('0x9'));var sox=require(_0x95e7('0xa'));var csv=require(_0x95e7('0xb'));var ejs=require(_0x95e7('0xc'));var fs=require('fs');var fs_extra=require(_0x95e7('0xd'));var _=require('lodash');var squel=require(_0x95e7('0xe'));var crypto=require('crypto');var jsforce=require(_0x95e7('0xf'));var deskjs=require(_0x95e7('0x10'));var toCsv=require(_0x95e7('0xb'));var querystring=require(_0x95e7('0x11'));var Papa=require(_0x95e7('0x12'));var Redis=require(_0x95e7('0x13'));var authService=require(_0x95e7('0x14'));var qs=require(_0x95e7('0x15'));var as=require(_0x95e7('0x16'));var hardwareService=require(_0x95e7('0x17'));var logger=require(_0x95e7('0x18'))(_0x95e7('0x19'));var utils=require(_0x95e7('0x1a'));var config=require(_0x95e7('0x1b'));var licenseUtil=require(_0x95e7('0x1c'));var db=require(_0x95e7('0x1d'))['db'];function respondWithStatusCode(_0x544512,_0x515b95){_0x515b95=_0x515b95||0xcc;return function(_0x109da2){if(_0x109da2){return _0x544512[_0x95e7('0x1e')](_0x515b95);}return _0x544512[_0x95e7('0x1f')](_0x515b95)[_0x95e7('0x20')]();};}function respondWithResult(_0x9535b,_0x5a8d84){_0x5a8d84=_0x5a8d84||0xc8;return function(_0x35dc92){if(_0x35dc92){return _0x9535b[_0x95e7('0x1f')](_0x5a8d84)[_0x95e7('0x21')](_0x35dc92);}};}function respondWithFilteredResult(_0x22b53a,_0x2373b1){return function(_0x5080bc){if(_0x5080bc){var _0x13d60a=typeof _0x2373b1[_0x95e7('0x22')]==='undefined'&&typeof _0x2373b1[_0x95e7('0x23')]==='undefined';var _0x590616=_0x5080bc['count'];var _0x48d7d5=_0x13d60a?0x0:_0x2373b1['offset'];var _0x2bcc89=_0x13d60a?_0x5080bc[_0x95e7('0x24')]:_0x2373b1[_0x95e7('0x22')]+_0x2373b1[_0x95e7('0x23')];var _0x5d40bc;if(_0x2bcc89>=_0x590616){_0x2bcc89=_0x590616;_0x5d40bc=0xc8;}else{_0x5d40bc=0xce;}_0x22b53a['status'](_0x5d40bc);return _0x22b53a[_0x95e7('0x25')](_0x95e7('0x26'),_0x48d7d5+'-'+_0x2bcc89+'/'+_0x590616)[_0x95e7('0x21')](_0x5080bc);}return null;};}function patchUpdates(_0x8c6639){return function(_0x19c76f){try{jsonpatch[_0x95e7('0x27')](_0x19c76f,_0x8c6639,!![]);}catch(_0x2c683f){return BPromise[_0x95e7('0x28')](_0x2c683f);}return _0x19c76f[_0x95e7('0x29')]();};}function saveUpdates(_0x58788a,_0xc6a2cc){return function(_0x190105){if(_0x190105){return _0x190105['update'](_0x58788a)[_0x95e7('0x2a')](function(_0x157e9c){return _0x157e9c;});}return null;};}function removeEntity(_0x127d0a,_0x4fbd74){return function(_0x4bc955){if(_0x4bc955){return _0x4bc955[_0x95e7('0x2b')]()[_0x95e7('0x2a')](function(){_0x127d0a[_0x95e7('0x1f')](0xcc)[_0x95e7('0x20')]();});}};}function handleEntityNotFound(_0x5a128f,_0x3be619){return function(_0x4dcea0){if(!_0x4dcea0){_0x5a128f['sendStatus'](0x194);}return _0x4dcea0;};}function handleError(_0x3c96ae,_0x54b61d){_0x54b61d=_0x54b61d||0x1f4;return function(_0x30da89){logger[_0x95e7('0x2c')](_0x30da89[_0x95e7('0x2d')]);if(_0x30da89[_0x95e7('0x2e')]){delete _0x30da89[_0x95e7('0x2e')];}_0x3c96ae[_0x95e7('0x1f')](_0x54b61d)[_0x95e7('0x2f')](_0x30da89);};}exports['index']=function(_0x2fa8bf,_0x20ada3){var _0x58f6a3={},_0x34b414={},_0x31579b={'count':0x0,'rows':[]};var _0x32275f=_[_0x95e7('0x30')](db[_0x95e7('0x31')][_0x95e7('0x32')],function(_0x362d07){return{'name':_0x362d07['fieldName'],'type':_0x362d07['type']['key']};});_0x34b414[_0x95e7('0x33')]=_[_0x95e7('0x34')](_[_0x95e7('0x30')](_0x32275f,'name'),[_0x95e7('0x2e')]);_0x34b414[_0x95e7('0x35')]=_[_0x95e7('0x36')](_0x2fa8bf[_0x95e7('0x35')]);_0x34b414[_0x95e7('0x37')]=_['intersection'](_0x34b414['model'],_0x34b414['query']);_0x58f6a3[_0x95e7('0x38')]=_[_0x95e7('0x39')](_0x34b414[_0x95e7('0x33')],qs[_0x95e7('0x3a')](_0x2fa8bf[_0x95e7('0x35')][_0x95e7('0x3a')]));_0x58f6a3['attributes']=_0x58f6a3['attributes']['length']?_0x58f6a3[_0x95e7('0x38')]:_0x34b414[_0x95e7('0x33')];if(!_0x2fa8bf[_0x95e7('0x35')][_0x95e7('0x3b')](_0x95e7('0x3c'))){_0x58f6a3[_0x95e7('0x23')]=qs[_0x95e7('0x23')](_0x2fa8bf[_0x95e7('0x35')][_0x95e7('0x23')]);_0x58f6a3['offset']=qs[_0x95e7('0x22')](_0x2fa8bf[_0x95e7('0x35')][_0x95e7('0x22')]);}_0x58f6a3[_0x95e7('0x3d')]=qs[_0x95e7('0x3e')](_0x2fa8bf[_0x95e7('0x35')][_0x95e7('0x3e')]);_0x58f6a3[_0x95e7('0x3f')]=qs['filters'](_[_0x95e7('0x40')](_0x2fa8bf[_0x95e7('0x35')],_0x34b414[_0x95e7('0x37')]),_0x32275f);if(_0x2fa8bf['query'][_0x95e7('0x41')]){_0x58f6a3[_0x95e7('0x3f')]=_[_0x95e7('0x42')](_0x58f6a3[_0x95e7('0x3f')],{'$or':_['map'](_0x32275f,function(_0x14d2d0){if(_0x14d2d0[_0x95e7('0x43')]!=='VIRTUAL'){var _0x370217={};_0x370217[_0x14d2d0[_0x95e7('0x2e')]]={'$like':'%'+_0x2fa8bf[_0x95e7('0x35')][_0x95e7('0x41')]+'%'};return _0x370217;}})});}_0x58f6a3=_['merge']({},_0x58f6a3,_0x2fa8bf[_0x95e7('0x44')]);var _0xd7f91c={'where':_0x58f6a3[_0x95e7('0x3f')]};return db[_0x95e7('0x31')][_0x95e7('0x24')](_0xd7f91c)[_0x95e7('0x2a')](function(_0x2aeccc){_0x31579b['count']=_0x2aeccc;if(_0x2fa8bf[_0x95e7('0x35')][_0x95e7('0x45')]){_0x58f6a3[_0x95e7('0x46')]=[{'all':!![]}];}return db[_0x95e7('0x31')][_0x95e7('0x47')](_0x58f6a3);})[_0x95e7('0x2a')](function(_0x2bca77){_0x31579b[_0x95e7('0x48')]=_0x2bca77;return _0x31579b;})[_0x95e7('0x2a')](respondWithFilteredResult(_0x20ada3,_0x58f6a3))[_0x95e7('0x49')](handleError(_0x20ada3,null));};exports[_0x95e7('0x4a')]=function(_0x4a6508,_0x7c15f4){var _0x3b871f={'raw':!![],'where':{'id':_0x4a6508[_0x95e7('0x4b')]['id']}},_0x5f4e28={};_0x5f4e28[_0x95e7('0x33')]=_['keys'](db['VoiceMailMessage'][_0x95e7('0x32')]);_0x5f4e28[_0x95e7('0x35')]=_[_0x95e7('0x36')](_0x4a6508['query']);_0x5f4e28[_0x95e7('0x37')]=_[_0x95e7('0x39')](_0x5f4e28[_0x95e7('0x33')],_0x5f4e28[_0x95e7('0x35')]);_0x3b871f[_0x95e7('0x38')]=_['intersection'](_0x5f4e28[_0x95e7('0x33')],qs['fields'](_0x4a6508[_0x95e7('0x35')][_0x95e7('0x3a')]));_0x3b871f[_0x95e7('0x38')]=_0x3b871f['attributes'][_0x95e7('0x4c')]?_0x3b871f[_0x95e7('0x38')]:_0x5f4e28['model'];if(_0x4a6508[_0x95e7('0x35')][_0x95e7('0x45')]){_0x3b871f['include']=[{'all':!![]}];}_0x3b871f=_[_0x95e7('0x42')]({},_0x3b871f,_0x4a6508[_0x95e7('0x44')]);return db[_0x95e7('0x31')][_0x95e7('0x4d')](_0x3b871f)[_0x95e7('0x2a')](handleEntityNotFound(_0x7c15f4,null))[_0x95e7('0x2a')](respondWithResult(_0x7c15f4,null))[_0x95e7('0x49')](handleError(_0x7c15f4,null));};exports[_0x95e7('0x4e')]=function(_0x104364,_0xc2b93f){return db[_0x95e7('0x31')]['create'](_0x104364[_0x95e7('0x4f')],{})[_0x95e7('0x2a')](respondWithResult(_0xc2b93f,0xc9))[_0x95e7('0x49')](handleError(_0xc2b93f,null));};exports['update']=function(_0x3d6790,_0x2ccba4){if(_0x3d6790[_0x95e7('0x4f')]['id']){delete _0x3d6790[_0x95e7('0x4f')]['id'];}return db[_0x95e7('0x31')][_0x95e7('0x4d')]({'where':{'id':_0x3d6790['params']['id']}})[_0x95e7('0x2a')](handleEntityNotFound(_0x2ccba4,null))[_0x95e7('0x2a')](saveUpdates(_0x3d6790[_0x95e7('0x4f')],null))[_0x95e7('0x2a')](respondWithResult(_0x2ccba4,null))[_0x95e7('0x49')](handleError(_0x2ccba4,null));};exports[_0x95e7('0x2b')]=function(_0x48db4e,_0x21a275){return db['VoiceMailMessage'][_0x95e7('0x4d')]({'where':{'id':_0x48db4e[_0x95e7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x21a275,null))[_0x95e7('0x2a')](removeEntity(_0x21a275,null))['catch'](handleError(_0x21a275,null));};exports[_0x95e7('0x50')]=function(_0x748d3a,_0x20b7a8,_0x3c3540){return db['VoiceMailMessage'][_0x95e7('0x4d')]({'where':{'id':_0x748d3a['params']['id']},'attributes':['id',_0x95e7('0x51'),'msg_id']})[_0x95e7('0x2a')](handleEntityNotFound(_0x20b7a8,null))['then'](function(_0x2f0583){if(_0x2f0583){if(!_0x2f0583[_0x95e7('0x51')]){throw new db[(_0x95e7('0x52'))][(_0x95e7('0x53'))]('VoiceMailMessage\x20not\x20found');}var _0x3dee89={'Content-Type':'audio/wav','Content-Disposition':_0x95e7('0x54')};if(_0x2f0583[_0x95e7('0x55')]){_0x3dee89[_0x95e7('0x56')]='attachment;\x20filename=\x22'+_0x2f0583[_0x95e7('0x55')]+_0x95e7('0x57');}_0x20b7a8['set'](_0x3dee89);return _0x20b7a8[_0x95e7('0x2f')](new Buffer(_0x2f0583['recording']));}})[_0x95e7('0x49')](handleError(_0x20b7a8,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 40985f9..1a9a8cb 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 _0xcf53=['../../config/logger','api','moment','path','rimraf','./voiceMailMessage.attributes','exports','VoiceMailMessage','dir','lodash','util'];(function(_0x521293,_0x5500d3){var _0x4ac782=function(_0x33aedf){while(--_0x33aedf){_0x521293['push'](_0x521293['shift']());}};_0x4ac782(++_0x5500d3);}(_0xcf53,0xa3));var _0x3cf5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcf53[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3cf5('0x0'));var util=require(_0x3cf5('0x1'));var logger=require(_0x3cf5('0x2'))(_0x3cf5('0x3'));var moment=require(_0x3cf5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3cf5('0x5'));var rimraf=require(_0x3cf5('0x6'));var config=require('../../config/environment');var attributes=require(_0x3cf5('0x7'));module[_0x3cf5('0x8')]=function(_0xe1534c,_0x3668f2){return _0xe1534c['define'](_0x3cf5('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x3cf5('0xa'),'fields':[_0x3cf5('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe4ec=['VoiceMailMessage','voice_voicemail_messages','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x27194b,_0x28acaf){var _0x5eb373=function(_0xdea401){while(--_0xdea401){_0x27194b['push'](_0x27194b['shift']());}};_0x5eb373(++_0x28acaf);}(_0xe4ec,0x7b));var _0xce4e=function(_0x1f98a2,_0x21cb4a){_0x1f98a2=_0x1f98a2-0x0;var _0x47706a=_0xe4ec[_0x1f98a2];return _0x47706a;};'use strict';var _=require(_0xce4e('0x0'));var util=require(_0xce4e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xce4e('0x2'));var BPromise=require(_0xce4e('0x3'));var rp=require(_0xce4e('0x4'));var fs=require('fs');var path=require(_0xce4e('0x5'));var rimraf=require(_0xce4e('0x6'));var config=require(_0xce4e('0x7'));var attributes=require('./voiceMailMessage.attributes');module[_0xce4e('0x8')]=function(_0x31d0d2,_0xef38a0){return _0x31d0d2['define'](_0xce4e('0x9'),attributes,{'tableName':_0xce4e('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 4e0d9b4..477d323 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x154003,_0x4672a9){var _0x11172c=function(_0x2d1cd1){while(--_0x2d1cd1){_0x154003['push'](_0x154003['shift']());}};_0x11172c(++_0x4672a9);}(_0xdb28,0x106));var _0x8db2=function(_0x2b672c,_0x34b98f){_0x2b672c=_0x2b672c-0x0;var _0x46d96c=_0xdb28[_0x2b672c];return _0x46d96c;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x1967=['then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x1967,0x173));var _0x7196=function(_0x15f03e,_0x1c87a8){_0x15f03e=_0x15f03e-0x0;var _0x8dcd63=_0x1967[_0x15f03e];return _0x8dcd63;};'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});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 7e5a4e3..4f0b88e 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 _0x8830=['post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','/:id','/:id/sounds','isAuthenticated'];(function(_0xa2485c,_0x12158b){var _0x313b49=function(_0x195618){while(--_0x195618){_0xa2485c['push'](_0xa2485c['shift']());}};_0x313b49(++_0x12158b);}(_0x8830,0x16e));var _0x0883=function(_0x197c10,_0x38b2d2){_0x197c10=_0x197c10-0x0;var _0x30f785=_0x8830[_0x197c10];return _0x30f785;};'use strict';var multer=require(_0x0883('0x0'));var util=require(_0x0883('0x1'));var path=require('path');var timeout=require(_0x0883('0x2'));var express=require(_0x0883('0x3'));var router=express[_0x0883('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0883('0x5'));var interaction=require(_0x0883('0x6'));var config=require('../../config/environment');var controller=require(_0x0883('0x7'));router[_0x0883('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0883('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x0883('0x8')](_0x0883('0xa'),auth[_0x0883('0xb')](),controller['getSounds']);router[_0x0883('0xc')]('/',auth[_0x0883('0xb')](),controller[_0x0883('0xd')]);router['post'](_0x0883('0xa'),auth['isAuthenticated'](),controller[_0x0883('0xe')]);router[_0x0883('0xf')](_0x0883('0x9'),auth[_0x0883('0xb')](),controller[_0x0883('0x10')]);router[_0x0883('0x11')]('/:id',auth[_0x0883('0xb')](),controller[_0x0883('0x12')]);router[_0x0883('0x11')](_0x0883('0x13'),auth[_0x0883('0xb')](),controller[_0x0883('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd5a0=['create','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceMusicOnHold.controller','get','/:id','isAuthenticated','show','getSounds'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0xd5a0,0x1c1));var _0x0d5a=function(_0x1548a0,_0x4bd793){_0x1548a0=_0x1548a0-0x0;var _0x27d824=_0xd5a0[_0x1548a0];return _0x27d824;};'use strict';var multer=require(_0x0d5a('0x0'));var util=require(_0x0d5a('0x1'));var path=require('path');var timeout=require(_0x0d5a('0x2'));var express=require(_0x0d5a('0x3'));var router=express[_0x0d5a('0x4')]();var fs_extra=require(_0x0d5a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0d5a('0x6'));var controller=require(_0x0d5a('0x7'));router[_0x0d5a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0d5a('0x8')](_0x0d5a('0x9'),auth[_0x0d5a('0xa')](),controller[_0x0d5a('0xb')]);router[_0x0d5a('0x8')]('/:id/sounds',auth[_0x0d5a('0xa')](),controller[_0x0d5a('0xc')]);router['post']('/',auth[_0x0d5a('0xa')](),controller[_0x0d5a('0xd')]);router['post']('/:id/sounds',auth['isAuthenticated'](),controller[_0x0d5a('0xe')]);router[_0x0d5a('0xf')](_0x0d5a('0x9'),auth[_0x0d5a('0xa')](),controller[_0x0d5a('0x10')]);router[_0x0d5a('0x11')](_0x0d5a('0x9'),auth['isAuthenticated'](),controller[_0x0d5a('0x12')]);router['delete'](_0x0d5a('0x13'),auth[_0x0d5a('0xa')](),controller[_0x0d5a('0x14')]);module[_0x0d5a('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 5e16eef..b6d73c5 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 _0x33a6=['custom','mp3nb','quietmp3nb','quietmp3','files','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','ENUM'];(function(_0x1843b3,_0x10995a){var _0x3c7de0=function(_0xe28643){while(--_0xe28643){_0x1843b3['push'](_0x1843b3['shift']());}};_0x3c7de0(++_0x10995a);}(_0x33a6,0x1c5));var _0x633a=function(_0x7b470b,_0x142f59){_0x7b470b=_0x7b470b-0x0;var _0x5e5a6c=_0x33a6[_0x7b470b];return _0x5e5a6c;};'use strict';var Sequelize=require(_0x633a('0x0'));module[_0x633a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x633a('0x2')](_0x633a('0x3'),'files',_0x633a('0x4'),_0x633a('0x5'),_0x633a('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0x633a('0x7')},'directory':{'type':Sequelize[_0x633a('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0x633a('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0x633a('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0x633a('0x8')],'allowNull':!![],'defaultValue':_0x633a('0x9')},'format':{'type':Sequelize[_0x633a('0x8')],'allowNull':!![]},'stamp':{'type':_0x633a('0xa')},'defaultEntry':{'type':Sequelize[_0x633a('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7ad6=['quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','mp3nb'];(function(_0x39be62,_0xe8fbd9){var _0x57f227=function(_0xf244e6){while(--_0xf244e6){_0x39be62['push'](_0x39be62['shift']());}};_0x57f227(++_0xe8fbd9);}(_0x7ad6,0x1a7));var _0x67ad=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7ad6[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x67ad('0x0'));module[_0x67ad('0x1')]={'name':{'type':Sequelize[_0x67ad('0x2')],'allowNull':![],'unique':_0x67ad('0x3')},'mode':{'type':Sequelize[_0x67ad('0x4')]('custom','files',_0x67ad('0x5'),_0x67ad('0x6'),'quietmp3',_0x67ad('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x67ad('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x67ad('0x2')],'allowNull':!![],'defaultValue':_0x67ad('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x67ad('0x9')},'defaultEntry':{'type':Sequelize[_0x67ad('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 30ca43d..43dc4ec 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 _0xd0ff=['rmdirSync','Sequelize','ValidationError','message','addSound','Sound','converted_format','createdAt','server/files/sounds/converted','format','save_name','server/files/moh','symlinkSync','removeSound','findOne','id2','%s.%s','length','getSounds','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','then','destroy','error','name','send','map','VoiceMusicOnHold','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','findAll','rows','catch','show','rawAttributes','includeAll','update','body','find','params','create','sequelize','transaction','files','directory','join','root','mode','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','autoAssociation','UserProfileResource','forEach','unlinkSync'];(function(_0xf20b59,_0x4202fc){var _0xca4ecd=function(_0x4af0e2){while(--_0x4af0e2){_0xf20b59['push'](_0xf20b59['shift']());}};_0xca4ecd(++_0x4202fc);}(_0xd0ff,0x160));var _0xfd0f=function(_0x2096b2,_0x53c8bd){_0x2096b2=_0x2096b2-0x0;var _0x540b16=_0xd0ff[_0x2096b2];return _0x540b16;};'use strict';var emlformat=require(_0xfd0f('0x0'));var rimraf=require(_0xfd0f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfd0f('0x2'));var rp=require(_0xfd0f('0x3'));var moment=require('moment');var BPromise=require(_0xfd0f('0x4'));var Mustache=require(_0xfd0f('0x5'));var util=require(_0xfd0f('0x6'));var path=require(_0xfd0f('0x7'));var sox=require(_0xfd0f('0x8'));var csv=require(_0xfd0f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd0f('0xa'));var _=require(_0xfd0f('0xb'));var squel=require(_0xfd0f('0xc'));var crypto=require(_0xfd0f('0xd'));var jsforce=require(_0xfd0f('0xe'));var deskjs=require(_0xfd0f('0xf'));var toCsv=require(_0xfd0f('0x9'));var querystring=require(_0xfd0f('0x10'));var Papa=require('papaparse');var Redis=require(_0xfd0f('0x11'));var authService=require(_0xfd0f('0x12'));var qs=require(_0xfd0f('0x13'));var as=require(_0xfd0f('0x14'));var hardwareService=require(_0xfd0f('0x15'));var logger=require('../../config/logger')(_0xfd0f('0x16'));var utils=require('../../config/utils');var config=require(_0xfd0f('0x17'));var licenseUtil=require(_0xfd0f('0x18'));var db=require(_0xfd0f('0x19'))['db'];function respondWithStatusCode(_0x227b0c,_0x595d25){_0x595d25=_0x595d25||0xcc;return function(_0x4e9914){if(_0x4e9914){return _0x227b0c[_0xfd0f('0x1a')](_0x595d25);}return _0x227b0c[_0xfd0f('0x1b')](_0x595d25)[_0xfd0f('0x1c')]();};}function respondWithResult(_0x596d86,_0x3e8e8e){_0x3e8e8e=_0x3e8e8e||0xc8;return function(_0x4732da){if(_0x4732da){return _0x596d86[_0xfd0f('0x1b')](_0x3e8e8e)[_0xfd0f('0x1d')](_0x4732da);}};}function respondWithFilteredResult(_0x4e0b55,_0x1b02fe){return function(_0x35c6f4){if(_0x35c6f4){var _0x4c66de=typeof _0x1b02fe[_0xfd0f('0x1e')]==='undefined'&&typeof _0x1b02fe[_0xfd0f('0x1f')]===_0xfd0f('0x20');var _0x469dec=_0x35c6f4[_0xfd0f('0x21')];var _0xec8972=_0x4c66de?0x0:_0x1b02fe[_0xfd0f('0x1e')];var _0x597909=_0x4c66de?_0x35c6f4[_0xfd0f('0x21')]:_0x1b02fe[_0xfd0f('0x1e')]+_0x1b02fe[_0xfd0f('0x1f')];var _0x3b5d70;if(_0x597909>=_0x469dec){_0x597909=_0x469dec;_0x3b5d70=0xc8;}else{_0x3b5d70=0xce;}_0x4e0b55['status'](_0x3b5d70);return _0x4e0b55[_0xfd0f('0x22')]('Content-Range',_0xec8972+'-'+_0x597909+'/'+_0x469dec)['json'](_0x35c6f4);}return null;};}function patchUpdates(_0x31a793){return function(_0x33c984){try{jsonpatch[_0xfd0f('0x23')](_0x33c984,_0x31a793,!![]);}catch(_0x2431d3){return BPromise['reject'](_0x2431d3);}return _0x33c984[_0xfd0f('0x24')]();};}function saveUpdates(_0x2b9644,_0x1e0a1e){return function(_0x4fbe15){if(_0x4fbe15){return _0x4fbe15['update'](_0x2b9644)[_0xfd0f('0x25')](function(_0x48bcde){return _0x48bcde;});}return null;};}function removeEntity(_0x22989d,_0x48dd81){return function(_0x37f1e7){if(_0x37f1e7){return _0x37f1e7['destroy']()[_0xfd0f('0x25')](function(){var _0x5f0607=_0x37f1e7['get']({'plain':!![]});var _0x4346b3='MusicOnHolds';return db['UserProfileResource'][_0xfd0f('0x26')]({'where':{'type':_0x4346b3,'resourceId':_0x5f0607['id']}})[_0xfd0f('0x25')](function(){return _0x37f1e7;});})['then'](function(){_0x22989d['status'](0xcc)[_0xfd0f('0x1c')]();});}};}function handleEntityNotFound(_0x1427e0,_0x34bf6b){return function(_0x3ecc7f){if(!_0x3ecc7f){_0x1427e0[_0xfd0f('0x1a')](0x194);}return _0x3ecc7f;};}function handleError(_0x56a331,_0x249c67){_0x249c67=_0x249c67||0x1f4;return function(_0x2f6995){logger[_0xfd0f('0x27')](_0x2f6995['stack']);if(_0x2f6995[_0xfd0f('0x28')]){delete _0x2f6995[_0xfd0f('0x28')];}_0x56a331[_0xfd0f('0x1b')](_0x249c67)[_0xfd0f('0x29')](_0x2f6995);};}exports['index']=function(_0x3fabcd,_0x4b47f5){var _0x4d6872={},_0x48365e={},_0x23c4ab={'count':0x0,'rows':[]};var _0x17c0ca=_[_0xfd0f('0x2a')](db[_0xfd0f('0x2b')]['rawAttributes'],function(_0x31565a){return{'name':_0x31565a['fieldName'],'type':_0x31565a['type'][_0xfd0f('0x2c')]};});_0x48365e['model']=_[_0xfd0f('0x2a')](_0x17c0ca,_0xfd0f('0x28'));_0x48365e[_0xfd0f('0x2d')]=_[_0xfd0f('0x2e')](_0x3fabcd[_0xfd0f('0x2d')]);_0x48365e[_0xfd0f('0x2f')]=_[_0xfd0f('0x30')](_0x48365e[_0xfd0f('0x31')],_0x48365e[_0xfd0f('0x2d')]);_0x4d6872[_0xfd0f('0x32')]=_[_0xfd0f('0x30')](_0x48365e[_0xfd0f('0x31')],qs['fields'](_0x3fabcd[_0xfd0f('0x2d')][_0xfd0f('0x33')]));_0x4d6872[_0xfd0f('0x32')]=_0x4d6872[_0xfd0f('0x32')]['length']?_0x4d6872[_0xfd0f('0x32')]:_0x48365e['model'];if(!_0x3fabcd[_0xfd0f('0x2d')][_0xfd0f('0x34')](_0xfd0f('0x35'))){_0x4d6872[_0xfd0f('0x1f')]=qs[_0xfd0f('0x1f')](_0x3fabcd[_0xfd0f('0x2d')][_0xfd0f('0x1f')]);_0x4d6872['offset']=qs['offset'](_0x3fabcd[_0xfd0f('0x2d')][_0xfd0f('0x1e')]);}_0x4d6872[_0xfd0f('0x36')]=qs['sort'](_0x3fabcd[_0xfd0f('0x2d')][_0xfd0f('0x37')]);delete _0x3fabcd[_0xfd0f('0x2d')][_0xfd0f('0x37')];_0x4d6872[_0xfd0f('0x38')]=qs[_0xfd0f('0x2f')](_[_0xfd0f('0x39')](_0x3fabcd[_0xfd0f('0x2d')],_0x48365e[_0xfd0f('0x2f')]),_0x17c0ca);if(_0x3fabcd[_0xfd0f('0x2d')][_0xfd0f('0x3a')]){_0x4d6872['where']=_[_0xfd0f('0x3b')](_0x4d6872['where'],{'$or':_['map'](_0x17c0ca,function(_0x599353){if(_0x599353[_0xfd0f('0x3c')]!=='VIRTUAL'){var _0x5f2740={};_0x5f2740[_0x599353['name']]={'$like':'%'+_0x3fabcd[_0xfd0f('0x2d')][_0xfd0f('0x3a')]+'%'};return _0x5f2740;}})});}_0x4d6872=_[_0xfd0f('0x3b')]({},_0x4d6872,_0x3fabcd[_0xfd0f('0x3d')]);var _0x180a8e={'where':_0x4d6872[_0xfd0f('0x38')]};return db['VoiceMusicOnHold'][_0xfd0f('0x21')](_0x180a8e)['then'](function(_0x9e4449){_0x23c4ab['count']=_0x9e4449;if(_0x3fabcd[_0xfd0f('0x2d')]['includeAll']){_0x4d6872['include']=[{'all':!![]}];}return db[_0xfd0f('0x2b')][_0xfd0f('0x3e')](_0x4d6872);})[_0xfd0f('0x25')](function(_0x1733fc){_0x23c4ab[_0xfd0f('0x3f')]=_0x1733fc;return _0x23c4ab;})['then'](respondWithFilteredResult(_0x4b47f5,_0x4d6872))[_0xfd0f('0x40')](handleError(_0x4b47f5,null));};exports[_0xfd0f('0x41')]=function(_0x1e4e9a,_0x572526){var _0x4649b1={'raw':![],'where':{'id':_0x1e4e9a['params']['id']}},_0x41b581={};_0x41b581[_0xfd0f('0x31')]=_[_0xfd0f('0x2e')](db['VoiceMusicOnHold'][_0xfd0f('0x42')]);_0x41b581[_0xfd0f('0x2d')]=_['keys'](_0x1e4e9a[_0xfd0f('0x2d')]);_0x41b581[_0xfd0f('0x2f')]=_[_0xfd0f('0x30')](_0x41b581[_0xfd0f('0x31')],_0x41b581['query']);_0x4649b1[_0xfd0f('0x32')]=_['intersection'](_0x41b581['model'],qs[_0xfd0f('0x33')](_0x1e4e9a[_0xfd0f('0x2d')][_0xfd0f('0x33')]));_0x4649b1[_0xfd0f('0x32')]=_0x4649b1[_0xfd0f('0x32')]['length']?_0x4649b1[_0xfd0f('0x32')]:_0x41b581[_0xfd0f('0x31')];if(_0x1e4e9a['query'][_0xfd0f('0x43')]){_0x4649b1['include']=[{'all':!![]}];}_0x4649b1=_['merge']({},_0x4649b1,_0x1e4e9a[_0xfd0f('0x3d')]);return db[_0xfd0f('0x2b')]['find'](_0x4649b1)[_0xfd0f('0x25')](handleEntityNotFound(_0x572526,null))[_0xfd0f('0x25')](respondWithResult(_0x572526,null))[_0xfd0f('0x40')](handleError(_0x572526,null));};exports[_0xfd0f('0x44')]=function(_0x4b33e0,_0x31a08b){if(_0x4b33e0['body']['id']){delete _0x4b33e0[_0xfd0f('0x45')]['id'];}return db[_0xfd0f('0x2b')][_0xfd0f('0x46')]({'where':{'id':_0x4b33e0[_0xfd0f('0x47')]['id']}})[_0xfd0f('0x25')](handleEntityNotFound(_0x31a08b,null))[_0xfd0f('0x25')](saveUpdates(_0x4b33e0[_0xfd0f('0x45')],null))[_0xfd0f('0x25')](respondWithResult(_0x31a08b,null))[_0xfd0f('0x40')](handleError(_0x31a08b,null));};exports[_0xfd0f('0x48')]=function(_0x198d15,_0x5f07a2,_0x26bd99){return db[_0xfd0f('0x49')][_0xfd0f('0x4a')](function(_0x1029ec){if(_0x198d15[_0xfd0f('0x45')]['mode']===_0xfd0f('0x4b')){_0x198d15[_0xfd0f('0x45')][_0xfd0f('0x4c')]=path[_0xfd0f('0x4d')](config[_0xfd0f('0x4e')],'server/files/moh',_0x198d15[_0xfd0f('0x45')][_0xfd0f('0x28')]);}return db[_0xfd0f('0x2b')][_0xfd0f('0x48')](_0x198d15[_0xfd0f('0x45')],{'transaction':_0x1029ec})[_0xfd0f('0x25')](function(_0x5b6cdf){if(_0x198d15['body'][_0xfd0f('0x4f')]===_0xfd0f('0x4b')){fs[_0xfd0f('0x50')](_0x5b6cdf[_0xfd0f('0x4c')],parseInt(_0xfd0f('0x51'),0x8));}var _0x3b75bc=_0x198d15[_0xfd0f('0x52')][_0xfd0f('0x53')]({'plain':!![]});if(!_0x3b75bc)throw new Error(_0xfd0f('0x54'));if(_0x3b75bc[_0xfd0f('0x55')]===_0xfd0f('0x52')){var _0x679a72=_0x5b6cdf[_0xfd0f('0x53')]({'plain':!![]});return db[_0xfd0f('0x56')][_0xfd0f('0x46')]({'where':{'name':_0xfd0f('0x57'),'userProfileId':_0x3b75bc['userProfileId']},'raw':!![]})['then'](function(_0x13272e){if(_0x13272e&&_0x13272e[_0xfd0f('0x58')]===0x0){return db[_0xfd0f('0x59')]['create']({'name':_0x679a72[_0xfd0f('0x28')],'resourceId':_0x679a72['id'],'type':_0x13272e[_0xfd0f('0x28')],'sectionId':_0x13272e['id']},{})[_0xfd0f('0x25')](function(){return _0x5b6cdf;});}else{return _0x5b6cdf;}})[_0xfd0f('0x40')](function(_0xe63493){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe63493);});}return _0x5b6cdf;});})[_0xfd0f('0x25')](respondWithResult(_0x5f07a2,0xc9))['catch'](handleError(_0x5f07a2,null));};exports[_0xfd0f('0x26')]=function(_0x7cf022,_0x3aabcb,_0x3737aa){var _0x9e6823;return db[_0xfd0f('0x2b')][_0xfd0f('0x46')]({'where':{'id':_0x7cf022['params']['id']}})[_0xfd0f('0x25')](function(_0x35a072){if(_0x35a072){return db[_0xfd0f('0x49')][_0xfd0f('0x4a')](function(_0x2c212f){return _0x35a072[_0xfd0f('0x26')]({'transaction':_0x2c212f,'raw':!![]})[_0xfd0f('0x25')](function(_0x4e09cf){if(_0x4e09cf[_0xfd0f('0x4c')]){fs['readdirSync'](_0x4e09cf['directory'])[_0xfd0f('0x5a')](function(_0x486b0d){fs[_0xfd0f('0x5b')](path['join'](_0x4e09cf[_0xfd0f('0x4c')],_0x486b0d));});fs[_0xfd0f('0x5c')](_0x4e09cf[_0xfd0f('0x4c')]);}return _0x4e09cf;});})['catch'](function(_0x2f4b38){throw new db[(_0xfd0f('0x5d'))][(_0xfd0f('0x5e'))](_0x2f4b38[_0xfd0f('0x5f')]);});}})[_0xfd0f('0x25')](handleEntityNotFound(_0x3aabcb,null))[_0xfd0f('0x25')](removeEntity(_0x3aabcb,null))[_0xfd0f('0x40')](handleError(_0x3aabcb,null));};exports['addSound']=function(_0x27c22d,_0x28b9d3,_0x28e43a){return db[_0xfd0f('0x49')][_0xfd0f('0x4a')](function(_0x25940e){var _0x5ba275;return db['VoiceMusicOnHold'][_0xfd0f('0x46')]({'where':{'id':_0x27c22d['params']['id']}})[_0xfd0f('0x25')](function(_0x2a27ca){if(_0x2a27ca){_0x5ba275=_0x2a27ca;return _0x2a27ca[_0xfd0f('0x60')](_0x27c22d[_0xfd0f('0x45')]['id'],{'transaction':_0x25940e});}})[_0xfd0f('0x25')](function(_0x1cdd38){if(_0x1cdd38){return db[_0xfd0f('0x61')]['findOne']({'where':{'id':_0x27c22d[_0xfd0f('0x45')]['id']},'attributes':['id',_0xfd0f('0x28'),'save_name',_0xfd0f('0x62'),_0xfd0f('0x63')],'raw':!![]});}})[_0xfd0f('0x25')](function(_0x401b0a){if(_0x401b0a){var _0x3e13be=path[_0xfd0f('0x4d')](config['root'],_0xfd0f('0x64'),util[_0xfd0f('0x65')]('%s.%s',path['basename'](_0x401b0a[_0xfd0f('0x66')],path['extname'](_0x401b0a[_0xfd0f('0x66')])),_0x401b0a[_0xfd0f('0x62')]));var _0x479c4a=path[_0xfd0f('0x4d')](config['root'],_0xfd0f('0x67'),_0x5ba275[_0xfd0f('0x28')],util['format']('%s.%s',_0x401b0a[_0xfd0f('0x28')],_0x401b0a[_0xfd0f('0x62')]));fs[_0xfd0f('0x68')](_0x3e13be,_0x479c4a);return _0x401b0a;}})['catch'](function(_0x4dd17a){throw new db['Sequelize']['ValidationError'](_0x4dd17a[_0xfd0f('0x5f')]);});})[_0xfd0f('0x25')](handleEntityNotFound(_0x28b9d3,null))[_0xfd0f('0x25')](respondWithResult(_0x28b9d3,0xc9))[_0xfd0f('0x40')](handleError(_0x28b9d3,null));};exports[_0xfd0f('0x69')]=function(_0xc4f4f7,_0x401f6e,_0x2811b2){return db[_0xfd0f('0x49')][_0xfd0f('0x4a')](function(_0x464932){var _0x3c15bd;return db['VoiceMusicOnHold'][_0xfd0f('0x6a')]({'where':{'id':_0xc4f4f7[_0xfd0f('0x47')]['id']}})[_0xfd0f('0x25')](handleEntityNotFound(_0x401f6e,null))[_0xfd0f('0x25')](function(_0x110df0){if(_0x110df0){_0x3c15bd=_0x110df0;return _0x110df0[_0xfd0f('0x69')](_0xc4f4f7[_0xfd0f('0x47')]['id2']);}})[_0xfd0f('0x25')](function(_0x2c1cf6){if(_0x2c1cf6){return db[_0xfd0f('0x61')][_0xfd0f('0x6a')]({'where':{'id':_0xc4f4f7[_0xfd0f('0x47')][_0xfd0f('0x6b')]},'attributes':['id',_0xfd0f('0x28'),'save_name',_0xfd0f('0x62'),'createdAt'],'raw':!![]});}})[_0xfd0f('0x25')](function(_0x3c5e27){if(_0x3c5e27){fs[_0xfd0f('0x5b')](path[_0xfd0f('0x4d')](_0x3c15bd[_0xfd0f('0x4c')],util[_0xfd0f('0x65')](_0xfd0f('0x6c'),_0x3c5e27[_0xfd0f('0x28')],_0x3c5e27[_0xfd0f('0x62')])));return _0x3c5e27;}})[_0xfd0f('0x40')](function(_0x1ff0f6){throw new db['Sequelize'][(_0xfd0f('0x5e'))](_0x1ff0f6['message']);});})[_0xfd0f('0x25')](handleEntityNotFound(_0x401f6e,null))[_0xfd0f('0x25')](respondWithStatusCode(_0x401f6e,0xcc))[_0xfd0f('0x40')](handleError(_0x401f6e,null));};exports['getSounds']=function(_0x2d1ff7,_0x4730a3,_0xf52c7b){var _0xc9a76f={};var _0x38a1ce={};var _0x2c2805;var _0x16b2ff;return db[_0xfd0f('0x2b')][_0xfd0f('0x6a')]({'where':{'id':_0x2d1ff7[_0xfd0f('0x47')]['id']}})['then'](handleEntityNotFound(_0x4730a3,null))[_0xfd0f('0x25')](function(_0x1a8e8b){if(_0x1a8e8b){_0x2c2805=_0x1a8e8b;_0x38a1ce[_0xfd0f('0x31')]=_[_0xfd0f('0x2e')](db['Sound']['rawAttributes']);_0x38a1ce[_0xfd0f('0x2d')]=_[_0xfd0f('0x2e')](_0x2d1ff7[_0xfd0f('0x2d')]);_0x38a1ce[_0xfd0f('0x2f')]=_[_0xfd0f('0x30')](_0x38a1ce['model'],_0x38a1ce[_0xfd0f('0x2d')]);_0xc9a76f[_0xfd0f('0x32')]=_[_0xfd0f('0x30')](_0x38a1ce['model'],qs[_0xfd0f('0x33')](_0x2d1ff7[_0xfd0f('0x2d')][_0xfd0f('0x33')]));_0xc9a76f[_0xfd0f('0x32')]=_0xc9a76f[_0xfd0f('0x32')]['length']?_0xc9a76f[_0xfd0f('0x32')]:_0x38a1ce[_0xfd0f('0x31')];_0xc9a76f[_0xfd0f('0x36')]=qs[_0xfd0f('0x37')](_0x2d1ff7['query']['sort']);_0xc9a76f[_0xfd0f('0x38')]=qs[_0xfd0f('0x2f')](_[_0xfd0f('0x39')](_0x2d1ff7[_0xfd0f('0x2d')],_0x38a1ce[_0xfd0f('0x2f')]));if(_0x2d1ff7[_0xfd0f('0x2d')]['filter']){_0xc9a76f[_0xfd0f('0x38')]=_[_0xfd0f('0x3b')](_0xc9a76f[_0xfd0f('0x38')],{'$or':_[_0xfd0f('0x2a')](_0xc9a76f['attributes'],function(_0x13da3f){var _0x15f44a={};_0x15f44a[_0x13da3f]={'$like':'%'+_0x2d1ff7['query'][_0xfd0f('0x3a')]+'%'};return _0x15f44a;})});}_0xc9a76f=_['merge']({},_0xc9a76f,_0x2d1ff7[_0xfd0f('0x3d')]);return _0x2c2805['getSounds'](_0xc9a76f);}})[_0xfd0f('0x25')](function(_0x4ebf76){if(_0x4ebf76){_0x16b2ff=_0x4ebf76[_0xfd0f('0x6d')];if(!_0x2d1ff7[_0xfd0f('0x2d')][_0xfd0f('0x34')]('nolimit')){_0xc9a76f['limit']=qs[_0xfd0f('0x1f')](_0x2d1ff7['query'][_0xfd0f('0x1f')]);_0xc9a76f[_0xfd0f('0x1e')]=qs[_0xfd0f('0x1e')](_0x2d1ff7[_0xfd0f('0x2d')]['offset']);}return _0x2c2805[_0xfd0f('0x6e')](_0xc9a76f);}})[_0xfd0f('0x25')](function(_0xa4266a){if(_0xa4266a){return _0xa4266a?{'count':_0x16b2ff,'rows':_0xa4266a}:null;}})[_0xfd0f('0x25')](respondWithResult(_0x4730a3,null))[_0xfd0f('0x40')](handleError(_0x4730a3,null));}; \ No newline at end of file +var _0x0b52=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','update','body','create','transaction','mode','directory','join','root','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','addSound','Sound','findOne','converted_format','createdAt','format','%s.%s','basename','extname','server/files/moh','symlinkSync','removeSound','id2','save_name','ValidationError','getSounds','eml-format','rimraf'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0x0b52,0xe8));var _0x20b5=function(_0x199d40,_0x1be032){_0x199d40=_0x199d40-0x0;var _0x428fbb=_0x0b52[_0x199d40];return _0x428fbb;};'use strict';var emlformat=require(_0x20b5('0x0'));var rimraf=require(_0x20b5('0x1'));var zipdir=require(_0x20b5('0x2'));var jsonpatch=require(_0x20b5('0x3'));var rp=require(_0x20b5('0x4'));var moment=require(_0x20b5('0x5'));var BPromise=require(_0x20b5('0x6'));var Mustache=require(_0x20b5('0x7'));var util=require('util');var path=require('path');var sox=require(_0x20b5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x20b5('0x9'));var _=require(_0x20b5('0xa'));var squel=require(_0x20b5('0xb'));var crypto=require(_0x20b5('0xc'));var jsforce=require(_0x20b5('0xd'));var deskjs=require(_0x20b5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x20b5('0xf'));var authService=require(_0x20b5('0x10'));var qs=require(_0x20b5('0x11'));var as=require(_0x20b5('0x12'));var hardwareService=require(_0x20b5('0x13'));var logger=require('../../config/logger')(_0x20b5('0x14'));var utils=require(_0x20b5('0x15'));var config=require(_0x20b5('0x16'));var licenseUtil=require(_0x20b5('0x17'));var db=require(_0x20b5('0x18'))['db'];function respondWithStatusCode(_0x1d3fac,_0x239b35){_0x239b35=_0x239b35||0xcc;return function(_0x1aa9dd){if(_0x1aa9dd){return _0x1d3fac[_0x20b5('0x19')](_0x239b35);}return _0x1d3fac['status'](_0x239b35)[_0x20b5('0x1a')]();};}function respondWithResult(_0x2a5936,_0x33e1b5){_0x33e1b5=_0x33e1b5||0xc8;return function(_0x4701dc){if(_0x4701dc){return _0x2a5936[_0x20b5('0x1b')](_0x33e1b5)['json'](_0x4701dc);}};}function respondWithFilteredResult(_0x4edca1,_0x4e1f30){return function(_0xb5b0d3){if(_0xb5b0d3){var _0x1dc2f5=typeof _0x4e1f30[_0x20b5('0x1c')]===_0x20b5('0x1d')&&typeof _0x4e1f30[_0x20b5('0x1e')]==='undefined';var _0x22a523=_0xb5b0d3['count'];var _0x45da28=_0x1dc2f5?0x0:_0x4e1f30['offset'];var _0x3dfd1d=_0x1dc2f5?_0xb5b0d3[_0x20b5('0x1f')]:_0x4e1f30[_0x20b5('0x1c')]+_0x4e1f30['limit'];var _0x2ef2f1;if(_0x3dfd1d>=_0x22a523){_0x3dfd1d=_0x22a523;_0x2ef2f1=0xc8;}else{_0x2ef2f1=0xce;}_0x4edca1[_0x20b5('0x1b')](_0x2ef2f1);return _0x4edca1[_0x20b5('0x20')](_0x20b5('0x21'),_0x45da28+'-'+_0x3dfd1d+'/'+_0x22a523)[_0x20b5('0x22')](_0xb5b0d3);}return null;};}function patchUpdates(_0x4aab18){return function(_0x1bdb34){try{jsonpatch[_0x20b5('0x23')](_0x1bdb34,_0x4aab18,!![]);}catch(_0xc8a64a){return BPromise[_0x20b5('0x24')](_0xc8a64a);}return _0x1bdb34[_0x20b5('0x25')]();};}function saveUpdates(_0x1d72f3,_0x1091aa){return function(_0x614566){if(_0x614566){return _0x614566['update'](_0x1d72f3)[_0x20b5('0x26')](function(_0x11e2d0){return _0x11e2d0;});}return null;};}function removeEntity(_0x335e93,_0x28914b){return function(_0x3d42bb){if(_0x3d42bb){return _0x3d42bb[_0x20b5('0x27')]()[_0x20b5('0x26')](function(){var _0x1c0f94=_0x3d42bb[_0x20b5('0x28')]({'plain':!![]});var _0x5a84f8=_0x20b5('0x29');return db[_0x20b5('0x2a')]['destroy']({'where':{'type':_0x5a84f8,'resourceId':_0x1c0f94['id']}})[_0x20b5('0x26')](function(){return _0x3d42bb;});})[_0x20b5('0x26')](function(){_0x335e93[_0x20b5('0x1b')](0xcc)[_0x20b5('0x1a')]();});}};}function handleEntityNotFound(_0x23e92e,_0x56ec5b){return function(_0x216974){if(!_0x216974){_0x23e92e[_0x20b5('0x19')](0x194);}return _0x216974;};}function handleError(_0x20ff66,_0x4fdc6e){_0x4fdc6e=_0x4fdc6e||0x1f4;return function(_0x597159){logger[_0x20b5('0x2b')](_0x597159[_0x20b5('0x2c')]);if(_0x597159[_0x20b5('0x2d')]){delete _0x597159[_0x20b5('0x2d')];}_0x20ff66['status'](_0x4fdc6e)[_0x20b5('0x2e')](_0x597159);};}exports[_0x20b5('0x2f')]=function(_0x35835a,_0x2c9fc0){var _0x1e0766={},_0x150014={},_0x363f98={'count':0x0,'rows':[]};var _0x39ed24=_[_0x20b5('0x30')](db[_0x20b5('0x31')][_0x20b5('0x32')],function(_0x5ae7d7){return{'name':_0x5ae7d7[_0x20b5('0x33')],'type':_0x5ae7d7[_0x20b5('0x34')][_0x20b5('0x35')]};});_0x150014[_0x20b5('0x36')]=_['map'](_0x39ed24,_0x20b5('0x2d'));_0x150014['query']=_['keys'](_0x35835a[_0x20b5('0x37')]);_0x150014['filters']=_[_0x20b5('0x38')](_0x150014[_0x20b5('0x36')],_0x150014['query']);_0x1e0766['attributes']=_[_0x20b5('0x38')](_0x150014['model'],qs[_0x20b5('0x39')](_0x35835a[_0x20b5('0x37')][_0x20b5('0x39')]));_0x1e0766[_0x20b5('0x3a')]=_0x1e0766[_0x20b5('0x3a')][_0x20b5('0x3b')]?_0x1e0766['attributes']:_0x150014['model'];if(!_0x35835a['query'][_0x20b5('0x3c')](_0x20b5('0x3d'))){_0x1e0766['limit']=qs[_0x20b5('0x1e')](_0x35835a['query'][_0x20b5('0x1e')]);_0x1e0766[_0x20b5('0x1c')]=qs[_0x20b5('0x1c')](_0x35835a[_0x20b5('0x37')][_0x20b5('0x1c')]);}_0x1e0766[_0x20b5('0x3e')]=qs[_0x20b5('0x3f')](_0x35835a[_0x20b5('0x37')]['sort']);delete _0x35835a[_0x20b5('0x37')][_0x20b5('0x3f')];_0x1e0766[_0x20b5('0x40')]=qs[_0x20b5('0x41')](_[_0x20b5('0x42')](_0x35835a[_0x20b5('0x37')],_0x150014[_0x20b5('0x41')]),_0x39ed24);if(_0x35835a['query'][_0x20b5('0x43')]){_0x1e0766[_0x20b5('0x40')]=_[_0x20b5('0x44')](_0x1e0766[_0x20b5('0x40')],{'$or':_['map'](_0x39ed24,function(_0x490dcb){if(_0x490dcb[_0x20b5('0x34')]!==_0x20b5('0x45')){var _0x9ff453={};_0x9ff453[_0x490dcb[_0x20b5('0x2d')]]={'$like':'%'+_0x35835a[_0x20b5('0x37')][_0x20b5('0x43')]+'%'};return _0x9ff453;}})});}_0x1e0766=_[_0x20b5('0x44')]({},_0x1e0766,_0x35835a[_0x20b5('0x46')]);var _0x2c5bf1={'where':_0x1e0766[_0x20b5('0x40')]};return db[_0x20b5('0x31')][_0x20b5('0x1f')](_0x2c5bf1)[_0x20b5('0x26')](function(_0x3e3cfa){_0x363f98[_0x20b5('0x1f')]=_0x3e3cfa;if(_0x35835a[_0x20b5('0x37')][_0x20b5('0x47')]){_0x1e0766[_0x20b5('0x48')]=[{'all':!![]}];}return db[_0x20b5('0x31')][_0x20b5('0x49')](_0x1e0766);})['then'](function(_0x2f3602){_0x363f98['rows']=_0x2f3602;return _0x363f98;})[_0x20b5('0x26')](respondWithFilteredResult(_0x2c9fc0,_0x1e0766))[_0x20b5('0x4a')](handleError(_0x2c9fc0,null));};exports[_0x20b5('0x4b')]=function(_0x15db1c,_0x1cb79e){var _0x556fa6={'raw':![],'where':{'id':_0x15db1c[_0x20b5('0x4c')]['id']}},_0x2f2f69={};_0x2f2f69[_0x20b5('0x36')]=_[_0x20b5('0x4d')](db[_0x20b5('0x31')]['rawAttributes']);_0x2f2f69[_0x20b5('0x37')]=_['keys'](_0x15db1c[_0x20b5('0x37')]);_0x2f2f69[_0x20b5('0x41')]=_[_0x20b5('0x38')](_0x2f2f69[_0x20b5('0x36')],_0x2f2f69[_0x20b5('0x37')]);_0x556fa6[_0x20b5('0x3a')]=_[_0x20b5('0x38')](_0x2f2f69[_0x20b5('0x36')],qs[_0x20b5('0x39')](_0x15db1c[_0x20b5('0x37')][_0x20b5('0x39')]));_0x556fa6[_0x20b5('0x3a')]=_0x556fa6[_0x20b5('0x3a')]['length']?_0x556fa6[_0x20b5('0x3a')]:_0x2f2f69[_0x20b5('0x36')];if(_0x15db1c[_0x20b5('0x37')][_0x20b5('0x47')]){_0x556fa6[_0x20b5('0x48')]=[{'all':!![]}];}_0x556fa6=_[_0x20b5('0x44')]({},_0x556fa6,_0x15db1c['options']);return db[_0x20b5('0x31')][_0x20b5('0x4e')](_0x556fa6)[_0x20b5('0x26')](handleEntityNotFound(_0x1cb79e,null))[_0x20b5('0x26')](respondWithResult(_0x1cb79e,null))['catch'](handleError(_0x1cb79e,null));};exports[_0x20b5('0x4f')]=function(_0x3b923b,_0x9134df){if(_0x3b923b[_0x20b5('0x50')]['id']){delete _0x3b923b[_0x20b5('0x50')]['id'];}return db[_0x20b5('0x31')]['find']({'where':{'id':_0x3b923b[_0x20b5('0x4c')]['id']}})[_0x20b5('0x26')](handleEntityNotFound(_0x9134df,null))[_0x20b5('0x26')](saveUpdates(_0x3b923b[_0x20b5('0x50')],null))[_0x20b5('0x26')](respondWithResult(_0x9134df,null))[_0x20b5('0x4a')](handleError(_0x9134df,null));};exports[_0x20b5('0x51')]=function(_0x2007df,_0x84bc62,_0x11666c){return db['sequelize'][_0x20b5('0x52')](function(_0x5e0bf1){if(_0x2007df['body'][_0x20b5('0x53')]==='files'){_0x2007df[_0x20b5('0x50')][_0x20b5('0x54')]=path[_0x20b5('0x55')](config[_0x20b5('0x56')],'server/files/moh',_0x2007df[_0x20b5('0x50')][_0x20b5('0x2d')]);}return db[_0x20b5('0x31')]['create'](_0x2007df[_0x20b5('0x50')],{'transaction':_0x5e0bf1})[_0x20b5('0x26')](function(_0x3ab412){if(_0x2007df[_0x20b5('0x50')][_0x20b5('0x53')]==='files'){fs[_0x20b5('0x57')](_0x3ab412['directory'],parseInt('0777',0x8));}var _0x566c72=_0x2007df[_0x20b5('0x58')][_0x20b5('0x28')]({'plain':!![]});if(!_0x566c72)throw new Error(_0x20b5('0x59'));if(_0x566c72[_0x20b5('0x5a')]===_0x20b5('0x58')){var _0x103e25=_0x3ab412[_0x20b5('0x28')]({'plain':!![]});return db[_0x20b5('0x5b')][_0x20b5('0x4e')]({'where':{'name':_0x20b5('0x29'),'userProfileId':_0x566c72[_0x20b5('0x5c')]},'raw':!![]})[_0x20b5('0x26')](function(_0x509385){if(_0x509385&&_0x509385[_0x20b5('0x5d')]===0x0){return db[_0x20b5('0x2a')]['create']({'name':_0x103e25[_0x20b5('0x2d')],'resourceId':_0x103e25['id'],'type':_0x509385[_0x20b5('0x2d')],'sectionId':_0x509385['id']},{})['then'](function(){return _0x3ab412;});}else{return _0x3ab412;}})[_0x20b5('0x4a')](function(_0x36b7b2){logger['error'](_0x20b5('0x5e'),_0x36b7b2);});}return _0x3ab412;});})['then'](respondWithResult(_0x84bc62,0xc9))[_0x20b5('0x4a')](handleError(_0x84bc62,null));};exports[_0x20b5('0x27')]=function(_0x486468,_0x488edd,_0xd2d388){var _0xde56a2;return db[_0x20b5('0x31')][_0x20b5('0x4e')]({'where':{'id':_0x486468[_0x20b5('0x4c')]['id']}})['then'](function(_0x3cb31d){if(_0x3cb31d){return db[_0x20b5('0x5f')][_0x20b5('0x52')](function(_0x5e3a72){return _0x3cb31d[_0x20b5('0x27')]({'transaction':_0x5e3a72,'raw':!![]})['then'](function(_0x1db5a4){if(_0x1db5a4[_0x20b5('0x54')]){fs[_0x20b5('0x60')](_0x1db5a4[_0x20b5('0x54')])[_0x20b5('0x61')](function(_0x295668){fs[_0x20b5('0x62')](path[_0x20b5('0x55')](_0x1db5a4['directory'],_0x295668));});fs[_0x20b5('0x63')](_0x1db5a4[_0x20b5('0x54')]);}return _0x1db5a4;});})[_0x20b5('0x4a')](function(_0x3900bc){throw new db[(_0x20b5('0x64'))]['ValidationError'](_0x3900bc['message']);});}})[_0x20b5('0x26')](handleEntityNotFound(_0x488edd,null))['then'](removeEntity(_0x488edd,null))['catch'](handleError(_0x488edd,null));};exports[_0x20b5('0x65')]=function(_0xca92d1,_0xfff366,_0x2bacd9){return db['sequelize'][_0x20b5('0x52')](function(_0x459276){var _0xcd6e85;return db['VoiceMusicOnHold']['find']({'where':{'id':_0xca92d1[_0x20b5('0x4c')]['id']}})[_0x20b5('0x26')](function(_0x3e8540){if(_0x3e8540){_0xcd6e85=_0x3e8540;return _0x3e8540[_0x20b5('0x65')](_0xca92d1[_0x20b5('0x50')]['id'],{'transaction':_0x459276});}})[_0x20b5('0x26')](function(_0x355a01){if(_0x355a01){return db[_0x20b5('0x66')][_0x20b5('0x67')]({'where':{'id':_0xca92d1['body']['id']},'attributes':['id',_0x20b5('0x2d'),'save_name',_0x20b5('0x68'),_0x20b5('0x69')],'raw':!![]});}})[_0x20b5('0x26')](function(_0x4c8d51){if(_0x4c8d51){var _0x2fc50a=path[_0x20b5('0x55')](config['root'],'server/files/sounds/converted',util[_0x20b5('0x6a')](_0x20b5('0x6b'),path[_0x20b5('0x6c')](_0x4c8d51['save_name'],path[_0x20b5('0x6d')](_0x4c8d51['save_name'])),_0x4c8d51[_0x20b5('0x68')]));var _0x42e7ff=path[_0x20b5('0x55')](config[_0x20b5('0x56')],_0x20b5('0x6e'),_0xcd6e85[_0x20b5('0x2d')],util[_0x20b5('0x6a')]('%s.%s',_0x4c8d51[_0x20b5('0x2d')],_0x4c8d51[_0x20b5('0x68')]));fs[_0x20b5('0x6f')](_0x2fc50a,_0x42e7ff);return _0x4c8d51;}})['catch'](function(_0x49e813){throw new db[(_0x20b5('0x64'))]['ValidationError'](_0x49e813['message']);});})[_0x20b5('0x26')](handleEntityNotFound(_0xfff366,null))[_0x20b5('0x26')](respondWithResult(_0xfff366,0xc9))[_0x20b5('0x4a')](handleError(_0xfff366,null));};exports[_0x20b5('0x70')]=function(_0x4c4781,_0x4605a4,_0x35a576){return db[_0x20b5('0x5f')]['transaction'](function(_0x9176){var _0x48d220;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x4c4781[_0x20b5('0x4c')]['id']}})[_0x20b5('0x26')](handleEntityNotFound(_0x4605a4,null))['then'](function(_0x304c95){if(_0x304c95){_0x48d220=_0x304c95;return _0x304c95[_0x20b5('0x70')](_0x4c4781[_0x20b5('0x4c')]['id2']);}})[_0x20b5('0x26')](function(_0x519462){if(_0x519462){return db[_0x20b5('0x66')][_0x20b5('0x67')]({'where':{'id':_0x4c4781[_0x20b5('0x4c')][_0x20b5('0x71')]},'attributes':['id',_0x20b5('0x2d'),_0x20b5('0x72'),_0x20b5('0x68'),_0x20b5('0x69')],'raw':!![]});}})[_0x20b5('0x26')](function(_0x5f5408){if(_0x5f5408){fs[_0x20b5('0x62')](path[_0x20b5('0x55')](_0x48d220['directory'],util[_0x20b5('0x6a')](_0x20b5('0x6b'),_0x5f5408[_0x20b5('0x2d')],_0x5f5408[_0x20b5('0x68')])));return _0x5f5408;}})[_0x20b5('0x4a')](function(_0x217003){throw new db['Sequelize'][(_0x20b5('0x73'))](_0x217003['message']);});})['then'](handleEntityNotFound(_0x4605a4,null))[_0x20b5('0x26')](respondWithStatusCode(_0x4605a4,0xcc))[_0x20b5('0x4a')](handleError(_0x4605a4,null));};exports[_0x20b5('0x74')]=function(_0x465aa4,_0x35060b,_0x5afee7){var _0x4ca82f={};var _0x526be2={};var _0x51d164;var _0x91245b;return db[_0x20b5('0x31')][_0x20b5('0x67')]({'where':{'id':_0x465aa4['params']['id']}})[_0x20b5('0x26')](handleEntityNotFound(_0x35060b,null))[_0x20b5('0x26')](function(_0x2b9f95){if(_0x2b9f95){_0x51d164=_0x2b9f95;_0x526be2[_0x20b5('0x36')]=_[_0x20b5('0x4d')](db['Sound'][_0x20b5('0x32')]);_0x526be2['query']=_[_0x20b5('0x4d')](_0x465aa4[_0x20b5('0x37')]);_0x526be2[_0x20b5('0x41')]=_[_0x20b5('0x38')](_0x526be2['model'],_0x526be2[_0x20b5('0x37')]);_0x4ca82f['attributes']=_[_0x20b5('0x38')](_0x526be2[_0x20b5('0x36')],qs[_0x20b5('0x39')](_0x465aa4['query'][_0x20b5('0x39')]));_0x4ca82f[_0x20b5('0x3a')]=_0x4ca82f[_0x20b5('0x3a')][_0x20b5('0x3b')]?_0x4ca82f[_0x20b5('0x3a')]:_0x526be2[_0x20b5('0x36')];_0x4ca82f[_0x20b5('0x3e')]=qs[_0x20b5('0x3f')](_0x465aa4['query'][_0x20b5('0x3f')]);_0x4ca82f[_0x20b5('0x40')]=qs[_0x20b5('0x41')](_[_0x20b5('0x42')](_0x465aa4[_0x20b5('0x37')],_0x526be2[_0x20b5('0x41')]));if(_0x465aa4[_0x20b5('0x37')]['filter']){_0x4ca82f[_0x20b5('0x40')]=_['merge'](_0x4ca82f[_0x20b5('0x40')],{'$or':_['map'](_0x4ca82f['attributes'],function(_0x410ebb){var _0x1743da={};_0x1743da[_0x410ebb]={'$like':'%'+_0x465aa4[_0x20b5('0x37')][_0x20b5('0x43')]+'%'};return _0x1743da;})});}_0x4ca82f=_[_0x20b5('0x44')]({},_0x4ca82f,_0x465aa4[_0x20b5('0x46')]);return _0x51d164[_0x20b5('0x74')](_0x4ca82f);}})['then'](function(_0x5b4308){if(_0x5b4308){_0x91245b=_0x5b4308['length'];if(!_0x465aa4['query'][_0x20b5('0x3c')](_0x20b5('0x3d'))){_0x4ca82f[_0x20b5('0x1e')]=qs['limit'](_0x465aa4[_0x20b5('0x37')][_0x20b5('0x1e')]);_0x4ca82f['offset']=qs[_0x20b5('0x1c')](_0x465aa4[_0x20b5('0x37')][_0x20b5('0x1c')]);}return _0x51d164[_0x20b5('0x74')](_0x4ca82f);}})[_0x20b5('0x26')](function(_0x57c408){if(_0x57c408){return _0x57c408?{'count':_0x91245b,'rows':_0x57c408}:null;}})[_0x20b5('0x26')](respondWithResult(_0x35060b,null))['catch'](handleError(_0x35060b,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index c55e301..2b79433 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 _0x3e67=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','VoiceMusicOnHold','lodash','util'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x3e67,0x169));var _0x73e6=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x3e67[_0x4629ee];return _0x47fb5b;};'use strict';var _=require(_0x73e6('0x0'));var util=require(_0x73e6('0x1'));var logger=require(_0x73e6('0x2'))(_0x73e6('0x3'));var moment=require(_0x73e6('0x4'));var BPromise=require(_0x73e6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x73e6('0x6'));var config=require(_0x73e6('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x73e6('0x8')]=function(_0x34b53a,_0x550718){return _0x34b53a[_0x73e6('0x9')](_0x73e6('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e57=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger'];(function(_0x50450d,_0x314c15){var _0x1c391b=function(_0x3d5c86){while(--_0x3d5c86){_0x50450d['push'](_0x50450d['shift']());}};_0x1c391b(++_0x314c15);}(_0x5e57,0x19e));var _0x75e5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5e57[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x75e5('0x0'));var logger=require(_0x75e5('0x1'))('api');var moment=require(_0x75e5('0x2'));var BPromise=require(_0x75e5('0x3'));var rp=require(_0x75e5('0x4'));var fs=require('fs');var path=require(_0x75e5('0x5'));var rimraf=require(_0x75e5('0x6'));var config=require(_0x75e5('0x7'));var attributes=require(_0x75e5('0x8'));module[_0x75e5('0x9')]=function(_0x57d33d,_0x4e5ab3){return _0x57d33d[_0x75e5('0xa')](_0x75e5('0xb'),attributes,{'tableName':_0x75e5('0xc'),'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 006299c..5b33d60 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 _0x018d=['stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3f288e,_0x8cdada){var _0x271e04=function(_0x28621a){while(--_0x28621a){_0x3f288e['push'](_0x3f288e['shift']());}};_0x271e04(++_0x8cdada);}(_0x018d,0xe1));var _0xd018=function(_0x1f1170,_0x3b5783){_0x1f1170=_0x1f1170-0x0;var _0x127b7b=_0x018d[_0x1f1170];return _0x127b7b;};'use strict';var _=require(_0xd018('0x0'));var util=require(_0xd018('0x1'));var moment=require(_0xd018('0x2'));var BPromise=require('bluebird');var rs=require(_0xd018('0x3'));var fs=require('fs');var Redis=require(_0xd018('0x4'));var db=require(_0xd018('0x5'))['db'];var utils=require(_0xd018('0x6'));var logger=require('../../config/logger')(_0xd018('0x7'));var config=require(_0xd018('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd018('0x9')][_0xd018('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44564e,_0x35e41e,_0x95540){return new BPromise(function(_0x3b9330,_0x231028){return client[_0xd018('0xb')](_0x44564e,_0x95540)[_0xd018('0xc')](function(_0x59771d){logger[_0xd018('0xd')](_0xd018('0xe'),_0x35e41e,'request\x20sent');logger[_0xd018('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x35e41e,_0xd018('0x10'),JSON[_0xd018('0x11')](_0x59771d));if(_0x59771d[_0xd018('0x12')]){if(_0x59771d[_0xd018('0x12')][_0xd018('0x13')]===0x1f4){logger['error'](_0xd018('0xe'),_0x35e41e,_0x59771d[_0xd018('0x12')][_0xd018('0x14')]);return _0x231028(_0x59771d[_0xd018('0x12')][_0xd018('0x14')]);}logger[_0xd018('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x35e41e,_0x59771d[_0xd018('0x12')][_0xd018('0x14')]);return _0x3b9330(_0x59771d[_0xd018('0x12')][_0xd018('0x14')]);}else{logger[_0xd018('0xd')](_0xd018('0xe'),_0x35e41e,_0xd018('0x10'));_0x3b9330(_0x59771d[_0xd018('0x15')]['message']);}})['catch'](function(_0x15867c){logger[_0xd018('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x35e41e,_0x15867c);_0x231028(_0x15867c);});});} \ No newline at end of file +var _0xe18c=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','result'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xe18c,0x1a4));var _0xce18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe18c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xce18('0x0'));var util=require(_0xce18('0x1'));var moment=require(_0xce18('0x2'));var BPromise=require('bluebird');var rs=require(_0xce18('0x3'));var fs=require('fs');var Redis=require(_0xce18('0x4'));var db=require(_0xce18('0x5'))['db'];var utils=require(_0xce18('0x6'));var logger=require(_0xce18('0x7'))(_0xce18('0x8'));var config=require('../../config/environment');var jayson=require(_0xce18('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x185a42,_0x23600f,_0x5df735){return new BPromise(function(_0x42cb53,_0x57be88){return client[_0xce18('0xa')](_0x185a42,_0x5df735)[_0xce18('0xb')](function(_0x29cb5b){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x23600f,'request\x20sent');logger[_0xce18('0xc')](_0xce18('0xd'),_0x23600f,_0xce18('0xe'),JSON['stringify'](_0x29cb5b));if(_0x29cb5b[_0xce18('0xf')]){if(_0x29cb5b[_0xce18('0xf')][_0xce18('0x10')]===0x1f4){logger[_0xce18('0xf')](_0xce18('0x11'),_0x23600f,_0x29cb5b[_0xce18('0xf')][_0xce18('0x12')]);return _0x57be88(_0x29cb5b['error'][_0xce18('0x12')]);}logger[_0xce18('0xf')](_0xce18('0x11'),_0x23600f,_0x29cb5b[_0xce18('0xf')]['message']);return _0x42cb53(_0x29cb5b[_0xce18('0xf')][_0xce18('0x12')]);}else{logger['info'](_0xce18('0x11'),_0x23600f,_0xce18('0xe'));_0x42cb53(_0x29cb5b[_0xce18('0x13')][_0xce18('0x12')]);}})['catch'](function(_0x576cb3){logger[_0xce18('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x23600f,_0x576cb3);_0x57be88(_0x576cb3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index e081e5f..78508bc 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 _0x7046=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','show','/:id/users','getAgents','post','create','put','/:id','update','delete','destroy','removeAgents','exports','multer'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x7046,0x144));var _0x6704=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7046[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var fs_extra=require(_0x6704('0x5'));var auth=require(_0x6704('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6704('0x7'));var controller=require(_0x6704('0x8'));router[_0x6704('0x9')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0xb')]);router['get'](_0x6704('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x6704('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6704('0xd')]);router[_0x6704('0x9')](_0x6704('0xe'),auth[_0x6704('0xa')](),controller[_0x6704('0xf')]);router[_0x6704('0x10')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0x11')]);router['post'](_0x6704('0xe'),auth[_0x6704('0xa')](),controller['addAgents']);router[_0x6704('0x12')](_0x6704('0x13'),auth[_0x6704('0xa')](),controller[_0x6704('0x14')]);router[_0x6704('0x15')](_0x6704('0x13'),auth[_0x6704('0xa')](),controller[_0x6704('0x16')]);router[_0x6704('0x15')]('/:id/users',auth[_0x6704('0xa')](),controller[_0x6704('0x17')]);module[_0x6704('0x18')]=router; \ No newline at end of file +var _0xabce=['post','create','addAgents','put','/:id','delete','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','/:id/users','getAgents'];(function(_0x81e1b6,_0x350b6a){var _0x48d1ca=function(_0x26b6d5){while(--_0x26b6d5){_0x81e1b6['push'](_0x81e1b6['shift']());}};_0x48d1ca(++_0x350b6a);}(_0xabce,0x103));var _0xeabc=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xabce[_0xae7c2f];return _0x5d7001;};'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 fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x9')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0xe')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0x12'),auth[_0xeabc('0x8')](),controller['update']);router[_0xeabc('0x13')](_0xeabc('0x12'),auth[_0xeabc('0x8')](),controller['destroy']);router['delete'](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 05b4730..ad79ec5 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 _0xca66=['INTEGER','sequelize','name','VIRTUAL','getDataValue','STRING'];(function(_0x45b0d8,_0x4bb477){var _0x8cb514=function(_0x5020c9){while(--_0x5020c9){_0x45b0d8['push'](_0x45b0d8['shift']());}};_0x8cb514(++_0x4bb477);}(_0xca66,0x8b));var _0x6ca6=function(_0x53630d,_0x11ca08){_0x53630d=_0x53630d-0x0;var _0x4f63c4=_0xca66[_0x53630d];return _0x4f63c4;};'use strict';var Sequelize=require(_0x6ca6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6ca6('0x1')},'prefix':{'type':Sequelize[_0x6ca6('0x2')],'get':function(_0x44d1de){return'system-'+this[_0x6ca6('0x3')]('name')+'-';}},'description':{'type':Sequelize[_0x6ca6('0x4')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x6ca6('0x5')]}}; \ No newline at end of file +var _0x835a=['INTEGER','STRING','name','VIRTUAL','system-'];(function(_0x3ffd27,_0x24a889){var _0x376083=function(_0xad4ae0){while(--_0xad4ae0){_0x3ffd27['push'](_0x3ffd27['shift']());}};_0x376083(++_0x24a889);}(_0x835a,0x8d));var _0xa835=function(_0x37abeb,_0x5e19b5){_0x37abeb=_0x37abeb-0x0;var _0x2008d2=_0x835a[_0x37abeb];return _0x2008d2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa835('0x0')],'allowNull':![],'unique':_0xa835('0x1')},'prefix':{'type':Sequelize[_0xa835('0x2')],'get':function(_0x50eedc){return _0xa835('0x3')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize[_0xa835('0x0')]},'callerIdAll':{'type':Sequelize[_0xa835('0x0')]},'VoiceExtensionId':{'type':Sequelize[_0xa835('0x4')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 76093e7..5470f9f 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 _0x5d40=['userVoicePrefix:save','removeAgents','getAgents','findOne','User','pick','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','status','offset','undefined','count','json','apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','type','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','describe','sequelize','transaction','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','spread','emit'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x5d40,0x192));var _0x05d4=function(_0x12bfb8,_0x3ebcac){_0x12bfb8=_0x12bfb8-0x0;var _0x42b1cf=_0x5d40[_0x12bfb8];return _0x42b1cf;};'use strict';var emlformat=require(_0x05d4('0x0'));var rimraf=require(_0x05d4('0x1'));var zipdir=require(_0x05d4('0x2'));var jsonpatch=require(_0x05d4('0x3'));var rp=require('request-promise');var moment=require(_0x05d4('0x4'));var BPromise=require(_0x05d4('0x5'));var Mustache=require(_0x05d4('0x6'));var util=require(_0x05d4('0x7'));var path=require(_0x05d4('0x8'));var sox=require(_0x05d4('0x9'));var csv=require(_0x05d4('0xa'));var ejs=require(_0x05d4('0xb'));var fs=require('fs');var fs_extra=require(_0x05d4('0xc'));var _=require(_0x05d4('0xd'));var squel=require(_0x05d4('0xe'));var crypto=require(_0x05d4('0xf'));var jsforce=require(_0x05d4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x05d4('0xa'));var querystring=require(_0x05d4('0x11'));var Papa=require(_0x05d4('0x12'));var Redis=require(_0x05d4('0x13'));var authService=require(_0x05d4('0x14'));var qs=require(_0x05d4('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05d4('0x16'));var logger=require(_0x05d4('0x17'))(_0x05d4('0x18'));var utils=require(_0x05d4('0x19'));var config=require(_0x05d4('0x1a'));var licenseUtil=require(_0x05d4('0x1b'));var db=require(_0x05d4('0x1c'))['db'];config[_0x05d4('0x1d')]=_[_0x05d4('0x1e')](config['redis'],{'host':_0x05d4('0x1f'),'port':0x18eb});var socket=require(_0x05d4('0x20'))(new Redis(config['redis']));require(_0x05d4('0x21'))['register'](socket);function respondWithStatusCode(_0x4e1395,_0x313516){_0x313516=_0x313516||0xcc;return function(_0x5f1477){if(_0x5f1477){return _0x4e1395['sendStatus'](_0x313516);}return _0x4e1395[_0x05d4('0x22')](_0x313516)['end']();};}function respondWithResult(_0x781b17,_0x1316a7){_0x1316a7=_0x1316a7||0xc8;return function(_0x47188c){if(_0x47188c){return _0x781b17[_0x05d4('0x22')](_0x1316a7)['json'](_0x47188c);}};}function respondWithFilteredResult(_0x127e56,_0x350cb2){return function(_0x6c652b){if(_0x6c652b){var _0x2dcddb=typeof _0x350cb2[_0x05d4('0x23')]===_0x05d4('0x24')&&typeof _0x350cb2['limit']===_0x05d4('0x24');var _0x5635ee=_0x6c652b['count'];var _0x507b15=_0x2dcddb?0x0:_0x350cb2['offset'];var _0x4a5fb6=_0x2dcddb?_0x6c652b[_0x05d4('0x25')]:_0x350cb2[_0x05d4('0x23')]+_0x350cb2['limit'];var _0x2fbdc9;if(_0x4a5fb6>=_0x5635ee){_0x4a5fb6=_0x5635ee;_0x2fbdc9=0xc8;}else{_0x2fbdc9=0xce;}_0x127e56[_0x05d4('0x22')](_0x2fbdc9);return _0x127e56['set']('Content-Range',_0x507b15+'-'+_0x4a5fb6+'/'+_0x5635ee)[_0x05d4('0x26')](_0x6c652b);}return null;};}function patchUpdates(_0x4f44a8){return function(_0x403d13){try{jsonpatch[_0x05d4('0x27')](_0x403d13,_0x4f44a8,!![]);}catch(_0x25bc46){return BPromise[_0x05d4('0x28')](_0x25bc46);}return _0x403d13[_0x05d4('0x29')]();};}function saveUpdates(_0xc414ad,_0x17b283){return function(_0x2e20e9){if(_0x2e20e9){return _0x2e20e9[_0x05d4('0x2a')](_0xc414ad)['then'](function(_0x456c7d){return _0x456c7d;});}return null;};}function removeEntity(_0x232ed8,_0x4f1555){return function(_0x5ed280){if(_0x5ed280){return _0x5ed280[_0x05d4('0x2b')]()[_0x05d4('0x2c')](function(){var _0x2a605e=_0x5ed280[_0x05d4('0x2d')]({'plain':!![]});var _0x530193='VoicePrefixes';return db[_0x05d4('0x2e')][_0x05d4('0x2b')]({'where':{'type':_0x530193,'resourceId':_0x2a605e['id']}})['then'](function(){return _0x5ed280;});})[_0x05d4('0x2c')](function(){_0x232ed8[_0x05d4('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e0a23,_0x5371c6){return function(_0x471709){if(!_0x471709){_0x3e0a23[_0x05d4('0x2f')](0x194);}return _0x471709;};}function handleError(_0x3dfb8b,_0x346f5a){_0x346f5a=_0x346f5a||0x1f4;return function(_0x2dbd92){logger[_0x05d4('0x30')](_0x2dbd92[_0x05d4('0x31')]);if(_0x2dbd92['name']){delete _0x2dbd92[_0x05d4('0x32')];}_0x3dfb8b[_0x05d4('0x22')](_0x346f5a)[_0x05d4('0x33')](_0x2dbd92);};}exports[_0x05d4('0x34')]=function(_0x80ce55,_0x4c0b53){var _0x5b583d={},_0xfbe2a9={},_0x26b599={'count':0x0,'rows':[]};var _0x326012=_[_0x05d4('0x35')](db[_0x05d4('0x36')][_0x05d4('0x37')],function(_0x5eb0e5){return{'name':_0x5eb0e5[_0x05d4('0x38')],'type':_0x5eb0e5['type']['key']};});_0xfbe2a9[_0x05d4('0x39')]=_['map'](_0x326012,_0x05d4('0x32'));_0xfbe2a9[_0x05d4('0x3a')]=_['keys'](_0x80ce55[_0x05d4('0x3a')]);_0xfbe2a9[_0x05d4('0x3b')]=_[_0x05d4('0x3c')](_0xfbe2a9[_0x05d4('0x39')],_0xfbe2a9[_0x05d4('0x3a')]);_0x5b583d[_0x05d4('0x3d')]=_['intersection'](_0xfbe2a9['model'],qs[_0x05d4('0x3e')](_0x80ce55['query'][_0x05d4('0x3e')]));_0x5b583d[_0x05d4('0x3d')]=_0x5b583d[_0x05d4('0x3d')][_0x05d4('0x3f')]?_0x5b583d[_0x05d4('0x3d')]:_0xfbe2a9[_0x05d4('0x39')];if(!_0x80ce55['query'][_0x05d4('0x40')](_0x05d4('0x41'))){_0x5b583d['limit']=qs[_0x05d4('0x42')](_0x80ce55[_0x05d4('0x3a')][_0x05d4('0x42')]);_0x5b583d[_0x05d4('0x23')]=qs[_0x05d4('0x23')](_0x80ce55['query'][_0x05d4('0x23')]);}_0x5b583d[_0x05d4('0x43')]=qs[_0x05d4('0x44')](_0x80ce55[_0x05d4('0x3a')]['sort']);_0x5b583d[_0x05d4('0x45')]=qs[_0x05d4('0x3b')](_['pick'](_0x80ce55['query'],_0xfbe2a9[_0x05d4('0x3b')]),_0x326012);if(_0x80ce55[_0x05d4('0x3a')][_0x05d4('0x46')]){_0x5b583d['where']=_['merge'](_0x5b583d['where'],{'$or':_[_0x05d4('0x35')](_0x326012,function(_0x268a1a){if(_0x268a1a[_0x05d4('0x47')]!=='VIRTUAL'){var _0x20b2b0={};_0x20b2b0[_0x268a1a[_0x05d4('0x32')]]={'$like':'%'+_0x80ce55[_0x05d4('0x3a')][_0x05d4('0x46')]+'%'};return _0x20b2b0;}})});}_0x5b583d=_[_0x05d4('0x48')]({},_0x5b583d,_0x80ce55[_0x05d4('0x49')]);var _0xc58aa1={'where':_0x5b583d[_0x05d4('0x45')]};return db[_0x05d4('0x36')][_0x05d4('0x25')](_0xc58aa1)[_0x05d4('0x2c')](function(_0x1278c4){_0x26b599[_0x05d4('0x25')]=_0x1278c4;if(_0x80ce55['query'][_0x05d4('0x4a')]){_0x5b583d[_0x05d4('0x4b')]=[{'all':!![]}];}return db[_0x05d4('0x36')][_0x05d4('0x4c')](_0x5b583d);})['then'](function(_0x508a55){_0x26b599[_0x05d4('0x4d')]=_0x508a55;return _0x26b599;})['then'](respondWithFilteredResult(_0x4c0b53,_0x5b583d))['catch'](handleError(_0x4c0b53,null));};exports[_0x05d4('0x4e')]=function(_0x2a82d0,_0x3a9ea6){var _0x2cfb88={'raw':![],'where':{'id':_0x2a82d0[_0x05d4('0x4f')]['id']}},_0x164c36={};_0x164c36[_0x05d4('0x39')]=_[_0x05d4('0x50')](db[_0x05d4('0x36')][_0x05d4('0x37')]);_0x164c36[_0x05d4('0x3a')]=_[_0x05d4('0x50')](_0x2a82d0[_0x05d4('0x3a')]);_0x164c36['filters']=_[_0x05d4('0x3c')](_0x164c36['model'],_0x164c36[_0x05d4('0x3a')]);_0x2cfb88['attributes']=_['intersection'](_0x164c36[_0x05d4('0x39')],qs[_0x05d4('0x3e')](_0x2a82d0[_0x05d4('0x3a')][_0x05d4('0x3e')]));_0x2cfb88[_0x05d4('0x3d')]=_0x2cfb88[_0x05d4('0x3d')][_0x05d4('0x3f')]?_0x2cfb88[_0x05d4('0x3d')]:_0x164c36['model'];if(_0x2a82d0['query'][_0x05d4('0x4a')]){_0x2cfb88[_0x05d4('0x4b')]=[{'all':!![]}];}_0x2cfb88=_[_0x05d4('0x48')]({},_0x2cfb88,_0x2a82d0[_0x05d4('0x49')]);return db[_0x05d4('0x36')][_0x05d4('0x51')](_0x2cfb88)[_0x05d4('0x2c')](handleEntityNotFound(_0x3a9ea6,null))[_0x05d4('0x2c')](respondWithResult(_0x3a9ea6,null))['catch'](handleError(_0x3a9ea6,null));};exports[_0x05d4('0x2b')]=function(_0x1dc688,_0x4b62d2){return db['VoicePrefix']['find']({'where':{'id':_0x1dc688[_0x05d4('0x4f')]['id']}})[_0x05d4('0x2c')](handleEntityNotFound(_0x4b62d2,null))['then'](removeEntity(_0x4b62d2,null))[_0x05d4('0x52')](handleError(_0x4b62d2,null));};exports[_0x05d4('0x53')]=function(_0x6d4c84,_0x482cda){return db[_0x05d4('0x36')]['describe']()['then'](respondWithResult(_0x482cda,null))['catch'](handleError(_0x482cda,null));};exports['create']=function(_0x1a23a8,_0x1050e0){var _0x4c38d4;return db[_0x05d4('0x54')][_0x05d4('0x55')](function(_0x446ffb){return db['VoicePrefix'][_0x05d4('0x56')](_0x1a23a8[_0x05d4('0x57')],{'transaction':_0x446ffb})[_0x05d4('0x2c')](function(_0x436ed5){_0x4c38d4=_0x436ed5[_0x05d4('0x2d')]({'plain':!![]});return db[_0x05d4('0x58')][_0x05d4('0x51')]({'where':{'id':_0x4c38d4[_0x05d4('0x59')]},'raw':!![]})[_0x05d4('0x2c')](function(_0x23f725){return createVoicePrefixExtensions(_0x4c38d4,_0x23f725,_0x446ffb);});});})[_0x05d4('0x2c')](function(){var _0x2ec891=_0x1a23a8[_0x05d4('0x5a')][_0x05d4('0x2d')]({'plain':!![]});if(!_0x2ec891)throw new Error(_0x05d4('0x5b'));if(_0x2ec891[_0x05d4('0x5c')]===_0x05d4('0x5a')){var _0x4ef8ae=_0x4c38d4;return db[_0x05d4('0x5d')][_0x05d4('0x51')]({'where':{'name':_0x05d4('0x5e'),'userProfileId':_0x2ec891[_0x05d4('0x5f')]},'raw':!![]})[_0x05d4('0x2c')](function(_0x5e0528){if(_0x5e0528&&_0x5e0528['autoAssociation']===0x0){return db[_0x05d4('0x2e')][_0x05d4('0x56')]({'name':_0x4ef8ae[_0x05d4('0x32')],'resourceId':_0x4ef8ae['id'],'type':_0x5e0528[_0x05d4('0x32')],'sectionId':_0x5e0528['id']},{})['then'](function(){return _0x4c38d4;});}else{return _0x4c38d4;}})['catch'](function(_0x796fdb){logger['error'](_0x05d4('0x60'),_0x796fdb);throw _0x796fdb;});}return _0x4c38d4;})[_0x05d4('0x2c')](respondWithResult(_0x1050e0,null))[_0x05d4('0x52')](handleError(_0x1050e0,null));};function Extension(_0x87e996,_0x451309,_0x4e608d,_0x31dedb){this[_0x05d4('0x61')]=_0x05d4('0x62');this[_0x05d4('0x63')]=_0x87e996;this[_0x05d4('0x64')]=_0x4e608d;this[_0x05d4('0x47')]=_0x05d4('0x65');this['description']=_0x05d4('0x66');this[_0x05d4('0x67')]=_0x451309;this[_0x05d4('0x68')]=_0x31dedb;}function createVoicePrefixExtensions(_0x2c0367,_0x6ce2d5,_0x37c38f){return new BPromise(function(_0x39c6ae,_0x4d1d81){var _0xf5cc83=new Extension(formatPrefixName(_0x2c0367[_0x05d4('0x69')]),0x1,_0x05d4('0x6a'),_0x05d4('0x6b'));_0xf5cc83[_0x05d4('0x6c')]=_0x2c0367['id'];return db[_0x05d4('0x58')]['create'](_0xf5cc83,{'transaction':_0x37c38f})[_0x05d4('0x2c')](function(_0x5344f6){var _0x5dd58c=_0x5344f6[_0x05d4('0x2d')]({'plain':!![]});var _0x2b06ae=_[_0x05d4('0x35')](addVoicePrefixExtensions(_0x2c0367,_0x6ce2d5),function(_0x26370c){_0x26370c['VoiceExtensionId']=_0x5dd58c['id'];_0x26370c[_0x05d4('0x6c')]=_0x2c0367['id'];return _0x26370c;});return db['VoiceExtension'][_0x05d4('0x6d')](_0x2b06ae,{'transaction':_0x37c38f})[_0x05d4('0x2c')](function(_0x2225ba){if(!_0x2225ba){return _0x4d1d81(_0x05d4('0x6e'));}else{return _0x39c6ae(_0x2225ba);}})['catch'](function(_0x4f964a){return _0x4d1d81(_0x4f964a);});});;});};function addVoicePrefixExtensions(_0x3358db,_0x2dd659){var _0xb75625=[];var _0x1b480f=formatPrefixName(_0x3358db['prefix']);_0xb75625[_0x05d4('0x6f')](new Extension(_0x1b480f,0x2,_0x05d4('0x70'),_0x05d4('0x71')+_0x3358db[_0x05d4('0x32')]));if(_0x3358db['callerIdAll']){_0xb75625[_0x05d4('0x6f')](new Extension(_0x1b480f,0x3,_0x05d4('0x70'),_0x05d4('0x72')+_0x3358db[_0x05d4('0x73')]));}else{_0xb75625['push'](new Extension(_0x1b480f,0x3,_0x05d4('0x6a'),'No\x20callerid\x20available'));}_0xb75625[_0x05d4('0x6f')](new Extension(_0x1b480f,0x4,_0x05d4('0x74'),_0x2dd659[_0x05d4('0x61')]+','+_0x05d4('0x75')+(0x8+_0x3358db['name'][_0x05d4('0x3f')])+'}'+','+0x1));return _0xb75625;}function formatPrefixName(_0x2f0581){var _0x32f87f='_';for(var _0x13b323=0x0;_0x13b323<_0x2f0581['length'];_0x13b323++){if(_0x2f0581[_0x05d4('0x76')](_0x13b323)=='-'){_0x32f87f+=_0x2f0581[_0x05d4('0x76')](_0x13b323);}else{_0x32f87f+='['+_0x2f0581[_0x05d4('0x76')](_0x13b323)+']';}}_0x32f87f+='.';return _0x32f87f;}exports['update']=function(_0x4e3ff4,_0x3ab1be,_0x34e36b){var _0x4b22d0=_0x4e3ff4[_0x05d4('0x57')];_0x4b22d0[_0x05d4('0x69')]=_0x05d4('0x77')+_0x4b22d0['name']+'-';return db[_0x05d4('0x54')][_0x05d4('0x55')](function(_0x2a0018){return db[_0x05d4('0x36')][_0x05d4('0x2a')](_0x4b22d0,{'where':{'id':_0x4b22d0['id']},'transaction':_0x2a0018})[_0x05d4('0x2c')](function(){return db['VoiceExtension'][_0x05d4('0x2b')]({'where':{'VoicePrefixId':_0x4b22d0['id']},'transaction':_0x2a0018})['then'](function(){return db['VoiceExtension']['find']({'where':{'id':_0x4b22d0[_0x05d4('0x59')]},'raw':!![]})[_0x05d4('0x2c')](function(_0xf1ebcd){return createVoicePrefixExtensions(_0x4b22d0,_0xf1ebcd,_0x2a0018);});});});})['then'](function(){return db[_0x05d4('0x36')][_0x05d4('0x78')](_0x4b22d0['id']);})[_0x05d4('0x2c')](respondWithResult(_0x3ab1be,null))[_0x05d4('0x52')](handleError(_0x3ab1be,null));};exports[_0x05d4('0x79')]=function(_0x2b972b,_0x3a9a1e,_0x6b0707){return db[_0x05d4('0x36')][_0x05d4('0x51')]({'where':{'id':_0x2b972b['params']['id']}})[_0x05d4('0x2c')](handleEntityNotFound(_0x3a9a1e,null))[_0x05d4('0x2c')](function(_0x1bc8b9){if(_0x1bc8b9){return _0x1bc8b9[_0x05d4('0x79')](_0x2b972b[_0x05d4('0x57')][_0x05d4('0x7a')],_[_0x05d4('0x7b')](_0x2b972b[_0x05d4('0x57')],[_0x05d4('0x7a'),'id'])||{})[_0x05d4('0x7c')](function(_0x3a4a52){for(var _0x5e3b9d=0x0;_0x5e3b9d<_0x2b972b['body'][_0x05d4('0x7a')]['length'];_0x5e3b9d+=0x1){socket[_0x05d4('0x7d')](_0x05d4('0x7e'),{'UserId':_0x2b972b[_0x05d4('0x57')]['ids'][_0x5e3b9d],'VoicePrefixId':_0x2b972b[_0x05d4('0x4f')]['id']});}return _0x3a4a52;});}})[_0x05d4('0x2c')](respondWithResult(_0x3a9a1e,null))[_0x05d4('0x52')](handleError(_0x3a9a1e,null));};exports['removeAgents']=function(_0x22a872,_0x1a6d1b,_0x6d2739){return db[_0x05d4('0x36')][_0x05d4('0x51')]({'where':{'id':_0x22a872[_0x05d4('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1a6d1b,null))['then'](function(_0x3aaca3){if(_0x3aaca3){return _0x3aaca3[_0x05d4('0x7f')](_0x22a872[_0x05d4('0x3a')][_0x05d4('0x7a')])[_0x05d4('0x2c')](function(){if(_['isArray'](_0x22a872['query'][_0x05d4('0x7a')])){for(var _0xea4639=0x0;_0xea4639<_0x22a872[_0x05d4('0x3a')][_0x05d4('0x7a')][_0x05d4('0x3f')];_0xea4639+=0x1){socket[_0x05d4('0x7d')]('userVoicePrefix:remove',{'UserId':Number(_0x22a872[_0x05d4('0x3a')][_0x05d4('0x7a')][_0xea4639]),'VoicePrefixId':Number(_0x22a872[_0x05d4('0x4f')]['id'])});}}else{socket[_0x05d4('0x7d')]('userVoicePrefix:remove',{'UserId':Number(_0x22a872['query'][_0x05d4('0x7a')]),'VoicePrefixId':Number(_0x22a872[_0x05d4('0x4f')]['id'])});}});}})[_0x05d4('0x2c')](respondWithStatusCode(_0x1a6d1b,null))[_0x05d4('0x52')](handleError(_0x1a6d1b,null));};exports[_0x05d4('0x80')]=function(_0x344f71,_0x122542,_0x4f3c93){var _0x29999={};var _0x2755f1={};var _0x13f1f1;var _0x3999d7;return db[_0x05d4('0x36')][_0x05d4('0x81')]({'where':{'id':_0x344f71['params']['id']}})['then'](handleEntityNotFound(_0x122542,null))['then'](function(_0x1e8822){if(_0x1e8822){_0x13f1f1=_0x1e8822;_0x2755f1[_0x05d4('0x39')]=_[_0x05d4('0x50')](db[_0x05d4('0x82')]['rawAttributes']);_0x2755f1[_0x05d4('0x3a')]=_[_0x05d4('0x50')](_0x344f71[_0x05d4('0x3a')]);_0x2755f1['filters']=_[_0x05d4('0x3c')](_0x2755f1['model'],_0x2755f1[_0x05d4('0x3a')]);_0x29999[_0x05d4('0x3d')]=_[_0x05d4('0x3c')](_0x2755f1[_0x05d4('0x39')],qs['fields'](_0x344f71[_0x05d4('0x3a')][_0x05d4('0x3e')]));_0x29999[_0x05d4('0x3d')]=_0x29999[_0x05d4('0x3d')][_0x05d4('0x3f')]?_0x29999['attributes']:_0x2755f1[_0x05d4('0x39')];_0x29999[_0x05d4('0x43')]=qs['sort'](_0x344f71['query']['sort']);_0x29999[_0x05d4('0x45')]=qs[_0x05d4('0x3b')](_[_0x05d4('0x83')](_0x344f71[_0x05d4('0x3a')],_0x2755f1['filters']));if(_0x344f71['query']['filter']){_0x29999[_0x05d4('0x45')]=_[_0x05d4('0x48')](_0x29999[_0x05d4('0x45')],{'$or':_[_0x05d4('0x35')](_0x29999[_0x05d4('0x3d')],function(_0x1a51a3){var _0x233c47={};_0x233c47[_0x1a51a3]={'$like':'%'+_0x344f71[_0x05d4('0x3a')][_0x05d4('0x46')]+'%'};return _0x233c47;})});}_0x29999=_[_0x05d4('0x48')]({},_0x29999,_0x344f71[_0x05d4('0x49')]);return _0x13f1f1[_0x05d4('0x80')](_0x29999);}})[_0x05d4('0x2c')](function(_0x857bcf){if(_0x857bcf){_0x3999d7=_0x857bcf[_0x05d4('0x3f')];if(!_0x344f71[_0x05d4('0x3a')][_0x05d4('0x40')](_0x05d4('0x41'))){_0x29999[_0x05d4('0x42')]=qs[_0x05d4('0x42')](_0x344f71[_0x05d4('0x3a')]['limit']);_0x29999[_0x05d4('0x23')]=qs['offset'](_0x344f71['query'][_0x05d4('0x23')]);}return _0x13f1f1[_0x05d4('0x80')](_0x29999);}})[_0x05d4('0x2c')](function(_0x5ed189){if(_0x5ed189){return _0x5ed189?{'count':_0x3999d7,'rows':_0x5ed189}:null;}})[_0x05d4('0x2c')](respondWithResult(_0x122542,null))['catch'](handleError(_0x122542,null));}; \ No newline at end of file +var _0x497f=['create','sequelize','transaction','body','VoiceExtensionId','get','role','user','autoAssociation','error','context','exten','app','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','params','ids','emit','removeAgents','userVoicePrefix:remove','findOne','User','pick','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','undefined','limit','offset','Content-Range','save','update','then','destroy','VoicePrefixes','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','VoicePrefix','count','includeAll','rows','show','include','options','find','catch','describe'];(function(_0x3b4c88,_0x51ab49){var _0x47cce1=function(_0x121b4c){while(--_0x121b4c){_0x3b4c88['push'](_0x3b4c88['shift']());}};_0x47cce1(++_0x51ab49);}(_0x497f,0x118));var _0xf497=function(_0x119629,_0x246787){_0x119629=_0x119629-0x0;var _0x49a771=_0x497f[_0x119629];return _0x49a771;};'use strict';var emlformat=require(_0xf497('0x0'));var rimraf=require(_0xf497('0x1'));var zipdir=require(_0xf497('0x2'));var jsonpatch=require(_0xf497('0x3'));var rp=require(_0xf497('0x4'));var moment=require(_0xf497('0x5'));var BPromise=require(_0xf497('0x6'));var Mustache=require(_0xf497('0x7'));var util=require('util');var path=require(_0xf497('0x8'));var sox=require('sox');var csv=require(_0xf497('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf497('0xa'));var _=require(_0xf497('0xb'));var squel=require(_0xf497('0xc'));var crypto=require(_0xf497('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf497('0xe'));var toCsv=require(_0xf497('0x9'));var querystring=require(_0xf497('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf497('0x10'));var qs=require(_0xf497('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf497('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf497('0x13'));var db=require('../../mysqldb')['db'];config[_0xf497('0x14')]=_[_0xf497('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf497('0x16'))(new Redis(config['redis']));require(_0xf497('0x17'))[_0xf497('0x18')](socket);function respondWithStatusCode(_0x3f2496,_0x5da6f5){_0x5da6f5=_0x5da6f5||0xcc;return function(_0x2c7c1a){if(_0x2c7c1a){return _0x3f2496[_0xf497('0x19')](_0x5da6f5);}return _0x3f2496['status'](_0x5da6f5)[_0xf497('0x1a')]();};}function respondWithResult(_0x561611,_0x2ab4ba){_0x2ab4ba=_0x2ab4ba||0xc8;return function(_0x5206aa){if(_0x5206aa){return _0x561611[_0xf497('0x1b')](_0x2ab4ba)[_0xf497('0x1c')](_0x5206aa);}};}function respondWithFilteredResult(_0x372616,_0x610cc){return function(_0x1d216d){if(_0x1d216d){var _0x595ca7=typeof _0x610cc['offset']===_0xf497('0x1d')&&typeof _0x610cc[_0xf497('0x1e')]===_0xf497('0x1d');var _0x1d505b=_0x1d216d['count'];var _0x3fc74b=_0x595ca7?0x0:_0x610cc[_0xf497('0x1f')];var _0x50a42e=_0x595ca7?_0x1d216d['count']:_0x610cc['offset']+_0x610cc[_0xf497('0x1e')];var _0x290342;if(_0x50a42e>=_0x1d505b){_0x50a42e=_0x1d505b;_0x290342=0xc8;}else{_0x290342=0xce;}_0x372616['status'](_0x290342);return _0x372616['set'](_0xf497('0x20'),_0x3fc74b+'-'+_0x50a42e+'/'+_0x1d505b)['json'](_0x1d216d);}return null;};}function patchUpdates(_0x343e13){return function(_0x240968){try{jsonpatch['apply'](_0x240968,_0x343e13,!![]);}catch(_0x294dc5){return BPromise['reject'](_0x294dc5);}return _0x240968[_0xf497('0x21')]();};}function saveUpdates(_0xd2f9d2,_0xa9f992){return function(_0x44081f){if(_0x44081f){return _0x44081f[_0xf497('0x22')](_0xd2f9d2)[_0xf497('0x23')](function(_0x4445f7){return _0x4445f7;});}return null;};}function removeEntity(_0x19f76f,_0x1c79d2){return function(_0xc3cda7){if(_0xc3cda7){return _0xc3cda7[_0xf497('0x24')]()[_0xf497('0x23')](function(){var _0x1e9087=_0xc3cda7['get']({'plain':!![]});var _0x7750e5=_0xf497('0x25');return db[_0xf497('0x26')][_0xf497('0x24')]({'where':{'type':_0x7750e5,'resourceId':_0x1e9087['id']}})[_0xf497('0x23')](function(){return _0xc3cda7;});})[_0xf497('0x23')](function(){_0x19f76f[_0xf497('0x1b')](0xcc)[_0xf497('0x1a')]();});}};}function handleEntityNotFound(_0x407d1f,_0x24b450){return function(_0x17f291){if(!_0x17f291){_0x407d1f[_0xf497('0x19')](0x194);}return _0x17f291;};}function handleError(_0x1b97f2,_0x54b5fa){_0x54b5fa=_0x54b5fa||0x1f4;return function(_0x268692){logger['error'](_0x268692[_0xf497('0x27')]);if(_0x268692[_0xf497('0x28')]){delete _0x268692[_0xf497('0x28')];}_0x1b97f2[_0xf497('0x1b')](_0x54b5fa)[_0xf497('0x29')](_0x268692);};}exports[_0xf497('0x2a')]=function(_0x1a1136,_0xb96efb){var _0x32dfc0={},_0x3160f2={},_0x5998fb={'count':0x0,'rows':[]};var _0x388dc4=_['map'](db['VoicePrefix'][_0xf497('0x2b')],function(_0x493663){return{'name':_0x493663[_0xf497('0x2c')],'type':_0x493663[_0xf497('0x2d')][_0xf497('0x2e')]};});_0x3160f2['model']=_[_0xf497('0x2f')](_0x388dc4,_0xf497('0x28'));_0x3160f2[_0xf497('0x30')]=_[_0xf497('0x31')](_0x1a1136[_0xf497('0x30')]);_0x3160f2[_0xf497('0x32')]=_[_0xf497('0x33')](_0x3160f2[_0xf497('0x34')],_0x3160f2['query']);_0x32dfc0[_0xf497('0x35')]=_[_0xf497('0x33')](_0x3160f2[_0xf497('0x34')],qs[_0xf497('0x36')](_0x1a1136[_0xf497('0x30')][_0xf497('0x36')]));_0x32dfc0[_0xf497('0x35')]=_0x32dfc0[_0xf497('0x35')][_0xf497('0x37')]?_0x32dfc0['attributes']:_0x3160f2[_0xf497('0x34')];if(!_0x1a1136[_0xf497('0x30')][_0xf497('0x38')](_0xf497('0x39'))){_0x32dfc0[_0xf497('0x1e')]=qs[_0xf497('0x1e')](_0x1a1136['query'][_0xf497('0x1e')]);_0x32dfc0['offset']=qs['offset'](_0x1a1136[_0xf497('0x30')][_0xf497('0x1f')]);}_0x32dfc0[_0xf497('0x3a')]=qs[_0xf497('0x3b')](_0x1a1136[_0xf497('0x30')][_0xf497('0x3b')]);_0x32dfc0[_0xf497('0x3c')]=qs[_0xf497('0x32')](_['pick'](_0x1a1136[_0xf497('0x30')],_0x3160f2[_0xf497('0x32')]),_0x388dc4);if(_0x1a1136[_0xf497('0x30')][_0xf497('0x3d')]){_0x32dfc0[_0xf497('0x3c')]=_[_0xf497('0x3e')](_0x32dfc0[_0xf497('0x3c')],{'$or':_['map'](_0x388dc4,function(_0x112357){if(_0x112357['type']!==_0xf497('0x3f')){var _0x156ebe={};_0x156ebe[_0x112357['name']]={'$like':'%'+_0x1a1136[_0xf497('0x30')]['filter']+'%'};return _0x156ebe;}})});}_0x32dfc0=_[_0xf497('0x3e')]({},_0x32dfc0,_0x1a1136['options']);var _0x3d0085={'where':_0x32dfc0['where']};return db[_0xf497('0x40')][_0xf497('0x41')](_0x3d0085)['then'](function(_0x32190b){_0x5998fb[_0xf497('0x41')]=_0x32190b;if(_0x1a1136[_0xf497('0x30')][_0xf497('0x42')]){_0x32dfc0['include']=[{'all':!![]}];}return db[_0xf497('0x40')]['findAll'](_0x32dfc0);})['then'](function(_0x4ca38d){_0x5998fb[_0xf497('0x43')]=_0x4ca38d;return _0x5998fb;})[_0xf497('0x23')](respondWithFilteredResult(_0xb96efb,_0x32dfc0))['catch'](handleError(_0xb96efb,null));};exports[_0xf497('0x44')]=function(_0x14175e,_0x31f6a1){var _0xd7cc90={'raw':![],'where':{'id':_0x14175e['params']['id']}},_0x5bb8d5={};_0x5bb8d5[_0xf497('0x34')]=_[_0xf497('0x31')](db[_0xf497('0x40')][_0xf497('0x2b')]);_0x5bb8d5['query']=_[_0xf497('0x31')](_0x14175e['query']);_0x5bb8d5['filters']=_[_0xf497('0x33')](_0x5bb8d5[_0xf497('0x34')],_0x5bb8d5[_0xf497('0x30')]);_0xd7cc90[_0xf497('0x35')]=_[_0xf497('0x33')](_0x5bb8d5[_0xf497('0x34')],qs[_0xf497('0x36')](_0x14175e['query'][_0xf497('0x36')]));_0xd7cc90['attributes']=_0xd7cc90[_0xf497('0x35')]['length']?_0xd7cc90[_0xf497('0x35')]:_0x5bb8d5[_0xf497('0x34')];if(_0x14175e[_0xf497('0x30')][_0xf497('0x42')]){_0xd7cc90[_0xf497('0x45')]=[{'all':!![]}];}_0xd7cc90=_[_0xf497('0x3e')]({},_0xd7cc90,_0x14175e[_0xf497('0x46')]);return db[_0xf497('0x40')][_0xf497('0x47')](_0xd7cc90)[_0xf497('0x23')](handleEntityNotFound(_0x31f6a1,null))[_0xf497('0x23')](respondWithResult(_0x31f6a1,null))[_0xf497('0x48')](handleError(_0x31f6a1,null));};exports[_0xf497('0x24')]=function(_0x220169,_0xf0618f){return db[_0xf497('0x40')][_0xf497('0x47')]({'where':{'id':_0x220169['params']['id']}})[_0xf497('0x23')](handleEntityNotFound(_0xf0618f,null))['then'](removeEntity(_0xf0618f,null))[_0xf497('0x48')](handleError(_0xf0618f,null));};exports[_0xf497('0x49')]=function(_0x54d724,_0x43f6a6){return db['VoicePrefix'][_0xf497('0x49')]()[_0xf497('0x23')](respondWithResult(_0x43f6a6,null))['catch'](handleError(_0x43f6a6,null));};exports[_0xf497('0x4a')]=function(_0x18a4f9,_0x94f749){var _0x30ea07;return db[_0xf497('0x4b')][_0xf497('0x4c')](function(_0x45aece){return db[_0xf497('0x40')]['create'](_0x18a4f9[_0xf497('0x4d')],{'transaction':_0x45aece})[_0xf497('0x23')](function(_0x583b49){_0x30ea07=_0x583b49['get']({'plain':!![]});return db['VoiceExtension'][_0xf497('0x47')]({'where':{'id':_0x30ea07[_0xf497('0x4e')]},'raw':!![]})[_0xf497('0x23')](function(_0x5028bc){return createVoicePrefixExtensions(_0x30ea07,_0x5028bc,_0x45aece);});});})[_0xf497('0x23')](function(){var _0xbfb5af=_0x18a4f9['user'][_0xf497('0x4f')]({'plain':!![]});if(!_0xbfb5af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbfb5af[_0xf497('0x50')]===_0xf497('0x51')){var _0x341539=_0x30ea07;return db['UserProfileSection']['find']({'where':{'name':_0xf497('0x25'),'userProfileId':_0xbfb5af['userProfileId']},'raw':!![]})[_0xf497('0x23')](function(_0x298b76){if(_0x298b76&&_0x298b76[_0xf497('0x52')]===0x0){return db['UserProfileResource'][_0xf497('0x4a')]({'name':_0x341539[_0xf497('0x28')],'resourceId':_0x341539['id'],'type':_0x298b76[_0xf497('0x28')],'sectionId':_0x298b76['id']},{})[_0xf497('0x23')](function(){return _0x30ea07;});}else{return _0x30ea07;}})[_0xf497('0x48')](function(_0x34a232){logger[_0xf497('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34a232);throw _0x34a232;});}return _0x30ea07;})[_0xf497('0x23')](respondWithResult(_0x94f749,null))['catch'](handleError(_0x94f749,null));};function Extension(_0x4a7ead,_0x154e58,_0x4593d8,_0x30d95c){this[_0xf497('0x54')]='from-sip';this[_0xf497('0x55')]=_0x4a7ead;this[_0xf497('0x56')]=_0x4593d8;this[_0xf497('0x2d')]=_0xf497('0x57');this[_0xf497('0x58')]=_0xf497('0x59');this['priority']=_0x154e58;this[_0xf497('0x5a')]=_0x30d95c;}function createVoicePrefixExtensions(_0x4a6348,_0x16abaa,_0x5df3eb){return new BPromise(function(_0x36a5db,_0x23f0a0){var _0x4dd4b6=new Extension(formatPrefixName(_0x4a6348[_0xf497('0x5b')]),0x1,_0xf497('0x5c'),_0xf497('0x5d'));_0x4dd4b6[_0xf497('0x5e')]=_0x4a6348['id'];return db[_0xf497('0x5f')]['create'](_0x4dd4b6,{'transaction':_0x5df3eb})[_0xf497('0x23')](function(_0x507d1e){var _0x10100b=_0x507d1e['get']({'plain':!![]});var _0x13720c=_[_0xf497('0x2f')](addVoicePrefixExtensions(_0x4a6348,_0x16abaa),function(_0x375f7){_0x375f7[_0xf497('0x4e')]=_0x10100b['id'];_0x375f7[_0xf497('0x5e')]=_0x4a6348['id'];return _0x375f7;});return db[_0xf497('0x5f')][_0xf497('0x60')](_0x13720c,{'transaction':_0x5df3eb})['then'](function(_0x4f9e7b){if(!_0x4f9e7b){return _0x23f0a0(_0xf497('0x61'));}else{return _0x36a5db(_0x4f9e7b);}})[_0xf497('0x48')](function(_0x42a84e){return _0x23f0a0(_0x42a84e);});});;});};function addVoicePrefixExtensions(_0x4023f5,_0x2ddd72){var _0x38aa8b=[];var _0x410593=formatPrefixName(_0x4023f5[_0xf497('0x5b')]);_0x38aa8b[_0xf497('0x62')](new Extension(_0x410593,0x2,'Set',_0xf497('0x63')+_0x4023f5[_0xf497('0x28')]));if(_0x4023f5[_0xf497('0x64')]){_0x38aa8b[_0xf497('0x62')](new Extension(_0x410593,0x3,_0xf497('0x65'),'PREFIX-CALLERIDALL='+_0x4023f5[_0xf497('0x64')]));}else{_0x38aa8b['push'](new Extension(_0x410593,0x3,_0xf497('0x5c'),_0xf497('0x66')));}_0x38aa8b[_0xf497('0x62')](new Extension(_0x410593,0x4,_0xf497('0x67'),_0x2ddd72['context']+','+_0xf497('0x68')+(0x8+_0x4023f5[_0xf497('0x28')]['length'])+'}'+','+0x1));return _0x38aa8b;}function formatPrefixName(_0x194348){var _0x5baea6='_';for(var _0x2ec424=0x0;_0x2ec424<_0x194348[_0xf497('0x37')];_0x2ec424++){if(_0x194348[_0xf497('0x69')](_0x2ec424)=='-'){_0x5baea6+=_0x194348[_0xf497('0x69')](_0x2ec424);}else{_0x5baea6+='['+_0x194348[_0xf497('0x69')](_0x2ec424)+']';}}_0x5baea6+='.';return _0x5baea6;}exports['update']=function(_0x10ab9e,_0x2aba80,_0x2fcd03){var _0x2673a3=_0x10ab9e[_0xf497('0x4d')];_0x2673a3[_0xf497('0x5b')]=_0xf497('0x6a')+_0x2673a3[_0xf497('0x28')]+'-';return db[_0xf497('0x4b')][_0xf497('0x4c')](function(_0x98dfee){return db['VoicePrefix'][_0xf497('0x22')](_0x2673a3,{'where':{'id':_0x2673a3['id']},'transaction':_0x98dfee})['then'](function(){return db['VoiceExtension'][_0xf497('0x24')]({'where':{'VoicePrefixId':_0x2673a3['id']},'transaction':_0x98dfee})[_0xf497('0x23')](function(){return db['VoiceExtension'][_0xf497('0x47')]({'where':{'id':_0x2673a3['VoiceExtensionId']},'raw':!![]})[_0xf497('0x23')](function(_0x38deaa){return createVoicePrefixExtensions(_0x2673a3,_0x38deaa,_0x98dfee);});});});})['then'](function(){return db[_0xf497('0x40')][_0xf497('0x6b')](_0x2673a3['id']);})['then'](respondWithResult(_0x2aba80,null))['catch'](handleError(_0x2aba80,null));};exports[_0xf497('0x6c')]=function(_0x205bff,_0x5c1f97,_0x37dca2){return db[_0xf497('0x40')]['find']({'where':{'id':_0x205bff[_0xf497('0x6d')]['id']}})[_0xf497('0x23')](handleEntityNotFound(_0x5c1f97,null))[_0xf497('0x23')](function(_0x376930){if(_0x376930){return _0x376930[_0xf497('0x6c')](_0x205bff['body'][_0xf497('0x6e')],_['omit'](_0x205bff['body'],[_0xf497('0x6e'),'id'])||{})['spread'](function(_0x1cf4b0){for(var _0x47be48=0x0;_0x47be48<_0x205bff[_0xf497('0x4d')][_0xf497('0x6e')][_0xf497('0x37')];_0x47be48+=0x1){socket[_0xf497('0x6f')]('userVoicePrefix:save',{'UserId':_0x205bff[_0xf497('0x4d')]['ids'][_0x47be48],'VoicePrefixId':_0x205bff[_0xf497('0x6d')]['id']});}return _0x1cf4b0;});}})[_0xf497('0x23')](respondWithResult(_0x5c1f97,null))['catch'](handleError(_0x5c1f97,null));};exports['removeAgents']=function(_0x5f50ab,_0x373e2f,_0xb99d2b){return db[_0xf497('0x40')][_0xf497('0x47')]({'where':{'id':_0x5f50ab[_0xf497('0x6d')]['id']}})['then'](handleEntityNotFound(_0x373e2f,null))[_0xf497('0x23')](function(_0x22681a){if(_0x22681a){return _0x22681a[_0xf497('0x70')](_0x5f50ab[_0xf497('0x30')][_0xf497('0x6e')])[_0xf497('0x23')](function(){if(_['isArray'](_0x5f50ab[_0xf497('0x30')]['ids'])){for(var _0x2eddd1=0x0;_0x2eddd1<_0x5f50ab[_0xf497('0x30')][_0xf497('0x6e')][_0xf497('0x37')];_0x2eddd1+=0x1){socket[_0xf497('0x6f')](_0xf497('0x71'),{'UserId':Number(_0x5f50ab['query'][_0xf497('0x6e')][_0x2eddd1]),'VoicePrefixId':Number(_0x5f50ab[_0xf497('0x6d')]['id'])});}}else{socket[_0xf497('0x6f')]('userVoicePrefix:remove',{'UserId':Number(_0x5f50ab[_0xf497('0x30')][_0xf497('0x6e')]),'VoicePrefixId':Number(_0x5f50ab[_0xf497('0x6d')]['id'])});}});}})[_0xf497('0x23')](respondWithStatusCode(_0x373e2f,null))['catch'](handleError(_0x373e2f,null));};exports['getAgents']=function(_0x4bc81d,_0x48bf26,_0x2f178b){var _0x1d4394={};var _0x19513c={};var _0x4a7db2;var _0x180212;return db[_0xf497('0x40')][_0xf497('0x72')]({'where':{'id':_0x4bc81d['params']['id']}})['then'](handleEntityNotFound(_0x48bf26,null))[_0xf497('0x23')](function(_0x590eb3){if(_0x590eb3){_0x4a7db2=_0x590eb3;_0x19513c['model']=_[_0xf497('0x31')](db[_0xf497('0x73')][_0xf497('0x2b')]);_0x19513c[_0xf497('0x30')]=_[_0xf497('0x31')](_0x4bc81d['query']);_0x19513c[_0xf497('0x32')]=_['intersection'](_0x19513c['model'],_0x19513c[_0xf497('0x30')]);_0x1d4394['attributes']=_['intersection'](_0x19513c['model'],qs[_0xf497('0x36')](_0x4bc81d[_0xf497('0x30')][_0xf497('0x36')]));_0x1d4394['attributes']=_0x1d4394[_0xf497('0x35')][_0xf497('0x37')]?_0x1d4394['attributes']:_0x19513c[_0xf497('0x34')];_0x1d4394[_0xf497('0x3a')]=qs[_0xf497('0x3b')](_0x4bc81d[_0xf497('0x30')][_0xf497('0x3b')]);_0x1d4394[_0xf497('0x3c')]=qs[_0xf497('0x32')](_[_0xf497('0x74')](_0x4bc81d[_0xf497('0x30')],_0x19513c[_0xf497('0x32')]));if(_0x4bc81d[_0xf497('0x30')][_0xf497('0x3d')]){_0x1d4394['where']=_[_0xf497('0x3e')](_0x1d4394[_0xf497('0x3c')],{'$or':_['map'](_0x1d4394[_0xf497('0x35')],function(_0x2c8030){var _0x4b88a5={};_0x4b88a5[_0x2c8030]={'$like':'%'+_0x4bc81d[_0xf497('0x30')][_0xf497('0x3d')]+'%'};return _0x4b88a5;})});}_0x1d4394=_['merge']({},_0x1d4394,_0x4bc81d['options']);return _0x4a7db2[_0xf497('0x75')](_0x1d4394);}})[_0xf497('0x23')](function(_0x3f193d){if(_0x3f193d){_0x180212=_0x3f193d[_0xf497('0x37')];if(!_0x4bc81d[_0xf497('0x30')]['hasOwnProperty'](_0xf497('0x39'))){_0x1d4394[_0xf497('0x1e')]=qs[_0xf497('0x1e')](_0x4bc81d[_0xf497('0x30')]['limit']);_0x1d4394[_0xf497('0x1f')]=qs[_0xf497('0x1f')](_0x4bc81d[_0xf497('0x30')][_0xf497('0x1f')]);}return _0x4a7db2[_0xf497('0x75')](_0x1d4394);}})[_0xf497('0x23')](function(_0x5a8b28){if(_0x5a8b28){return _0x5a8b28?{'count':_0x180212,'rows':_0x5a8b28}:null;}})[_0xf497('0x23')](respondWithResult(_0x48bf26,null))[_0xf497('0x48')](handleError(_0x48bf26,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 857e683..f34b0d5 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 _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','update','emit'];(function(_0x175e89,_0x20835f){var _0x2ed996=function(_0x56239f){while(--_0x56239f){_0x175e89['push'](_0x175e89['shift']());}};_0x2ed996(++_0x20835f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var VoicePrefix=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){VoicePrefixEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);VoicePrefixEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];VoicePrefix[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','VoicePrefix','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x1d33eb,_0x29751c){_0x1d33eb=_0x1d33eb-0x0;var _0x106b4a=_0x3e74[_0x1d33eb];return _0x106b4a;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x43e7('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){VoicePrefixEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);VoicePrefixEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index af90bfc..94a1111 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 _0x9a01=['rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','../../config/logger','api','moment','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9a01,0x1cf));var _0x19a0=function(_0x14d810,_0x299c09){_0x14d810=_0x14d810-0x0;var _0x3a4d77=_0x9a01[_0x14d810];return _0x3a4d77;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x19a0('0x0'))(_0x19a0('0x1'));var moment=require(_0x19a0('0x2'));var BPromise=require('bluebird');var rp=require(_0x19a0('0x3'));var fs=require('fs');var path=require(_0x19a0('0x4'));var rimraf=require(_0x19a0('0x5'));var config=require(_0x19a0('0x6'));var attributes=require(_0x19a0('0x7'));module[_0x19a0('0x8')]=function(_0x2cbbe1,_0x40af90){return _0x2cbbe1[_0x19a0('0x9')](_0x19a0('0xa'),attributes,{'tableName':_0x19a0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x620f=['define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voicePrefix.attributes','exports'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0x620f,0x114));var _0xf620=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x620f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf620('0x0'));var util=require(_0xf620('0x1'));var logger=require(_0xf620('0x2'))(_0xf620('0x3'));var moment=require(_0xf620('0x4'));var BPromise=require(_0xf620('0x5'));var rp=require(_0xf620('0x6'));var fs=require('fs');var path=require(_0xf620('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf620('0x8'));module[_0xf620('0x9')]=function(_0x1f9025,_0x2fad4b){return _0x1f9025[_0xf620('0xa')](_0xf620('0xb'),attributes,{'tableName':_0xf620('0xc'),'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 ff461a9..837314a 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 _0x4bac=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x59671a,_0x13aef6){var _0x4a8989=function(_0x32b2a3){while(--_0x32b2a3){_0x59671a['push'](_0x59671a['shift']());}};_0x4a8989(++_0x13aef6);}(_0x4bac,0xb9));var _0xc4ba=function(_0x358dc1,_0x1c08a3){_0x358dc1=_0x358dc1-0x0;var _0xb3f349=_0x4bac[_0x358dc1];return _0xb3f349;};'use strict';var _=require(_0xc4ba('0x0'));var util=require('util');var moment=require(_0xc4ba('0x1'));var BPromise=require(_0xc4ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc4ba('0x3'));var db=require(_0xc4ba('0x4'))['db'];var utils=require(_0xc4ba('0x5'));var logger=require(_0xc4ba('0x6'))('rpc');var config=require(_0xc4ba('0x7'));var jayson=require(_0xc4ba('0x8'));var client=jayson[_0xc4ba('0x9')][_0xc4ba('0xa')]({'port':0x232a});config[_0xc4ba('0xb')]=_['defaults'](config['redis'],{'host':_0xc4ba('0xc'),'port':0x18eb});var socket=require(_0xc4ba('0xd'))(new Redis(config[_0xc4ba('0xb')]));require('./voicePrefix.socket')[_0xc4ba('0xe')](socket);function respondWithRpcPromise(_0x30e375,_0x135bea,_0x319efb){return new BPromise(function(_0xc680ff,_0x44655d){return client[_0xc4ba('0xf')](_0x30e375,_0x319efb)[_0xc4ba('0x10')](function(_0x549616){logger[_0xc4ba('0x11')](_0xc4ba('0x12'),_0x135bea,'request\x20sent');logger[_0xc4ba('0x13')](_0xc4ba('0x14'),_0x135bea,_0xc4ba('0x15'),JSON['stringify'](_0x549616));if(_0x549616[_0xc4ba('0x16')]){if(_0x549616['error'][_0xc4ba('0x17')]===0x1f4){logger['error'](_0xc4ba('0x12'),_0x135bea,_0x549616[_0xc4ba('0x16')][_0xc4ba('0x18')]);return _0x44655d(_0x549616[_0xc4ba('0x16')]['message']);}logger[_0xc4ba('0x16')](_0xc4ba('0x12'),_0x135bea,_0x549616[_0xc4ba('0x16')]['message']);return _0xc680ff(_0x549616[_0xc4ba('0x16')]['message']);}else{logger[_0xc4ba('0x11')](_0xc4ba('0x12'),_0x135bea,_0xc4ba('0x15'));_0xc680ff(_0x549616[_0xc4ba('0x19')][_0xc4ba('0x18')]);}})[_0xc4ba('0x1a')](function(_0x3d4366){logger[_0xc4ba('0x16')](_0xc4ba('0x12'),_0x135bea,_0x3d4366);_0x44655d(_0x3d4366);});});} \ No newline at end of file +var _0x94cc=['redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x255984,_0x46e231){var _0x3b8658=function(_0x18ca57){while(--_0x18ca57){_0x255984['push'](_0x255984['shift']());}};_0x3b8658(++_0x46e231);}(_0x94cc,0xf0));var _0xc94c=function(_0x2596f3,_0x3b4daf){_0x2596f3=_0x2596f3-0x0;var _0x563da6=_0x94cc[_0x2596f3];return _0x563da6;};'use strict';var _=require(_0xc94c('0x0'));var util=require(_0xc94c('0x1'));var moment=require(_0xc94c('0x2'));var BPromise=require(_0xc94c('0x3'));var rs=require(_0xc94c('0x4'));var fs=require('fs');var Redis=require(_0xc94c('0x5'));var db=require(_0xc94c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc94c('0x7'))(_0xc94c('0x8'));var config=require(_0xc94c('0x9'));var jayson=require(_0xc94c('0xa'));var client=jayson['client'][_0xc94c('0xb')]({'port':0x232a});config[_0xc94c('0xc')]=_['defaults'](config[_0xc94c('0xc')],{'host':_0xc94c('0xd'),'port':0x18eb});var socket=require(_0xc94c('0xe'))(new Redis(config[_0xc94c('0xc')]));require(_0xc94c('0xf'))[_0xc94c('0x10')](socket);function respondWithRpcPromise(_0x5d82d7,_0x10491d,_0x48f968){return new BPromise(function(_0x2c33f0,_0x5a0e56){return client[_0xc94c('0x11')](_0x5d82d7,_0x48f968)['then'](function(_0x535078){logger[_0xc94c('0x12')](_0xc94c('0x13'),_0x10491d,_0xc94c('0x14'));logger[_0xc94c('0x15')](_0xc94c('0x16'),_0x10491d,_0xc94c('0x14'),JSON['stringify'](_0x535078));if(_0x535078['error']){if(_0x535078['error'][_0xc94c('0x17')]===0x1f4){logger[_0xc94c('0x18')](_0xc94c('0x13'),_0x10491d,_0x535078['error'][_0xc94c('0x19')]);return _0x5a0e56(_0x535078['error'][_0xc94c('0x19')]);}logger[_0xc94c('0x18')](_0xc94c('0x13'),_0x10491d,_0x535078[_0xc94c('0x18')]['message']);return _0x2c33f0(_0x535078[_0xc94c('0x18')]['message']);}else{logger[_0xc94c('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x10491d,_0xc94c('0x14'));_0x2c33f0(_0x535078[_0xc94c('0x1a')]['message']);}})[_0xc94c('0x1b')](function(_0x72beaf){logger[_0xc94c('0x18')](_0xc94c('0x13'),_0x10491d,_0x72beaf);_0x5a0e56(_0x72beaf);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index dd7cadd..bfa0a43 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 _0x4954=['./voicePrefix.events','save','remove','update','emit','removeListener','register','voicePrefix:'];(function(_0xc7c78d,_0x1dd9fb){var _0x175f3d=function(_0x1966cf){while(--_0x1966cf){_0xc7c78d['push'](_0xc7c78d['shift']());}};_0x175f3d(++_0x1dd9fb);}(_0x4954,0x1c8));var _0x4495=function(_0x314882,_0x1809d6){_0x314882=_0x314882-0x0;var _0x4d02ac=_0x4954[_0x314882];return _0x4d02ac;};'use strict';var VoicePrefixEvents=require(_0x4495('0x0'));var events=[_0x4495('0x1'),_0x4495('0x2'),_0x4495('0x3')];function createListener(_0xee4129,_0x37e434){return function(_0x4a851c){_0x37e434[_0x4495('0x4')](_0xee4129,_0x4a851c);};}function removeListener(_0x1d3e09,_0xf93b70){return function(){VoicePrefixEvents[_0x4495('0x5')](_0x1d3e09,_0xf93b70);};}exports[_0x4495('0x6')]=function(_0x5445d2){for(var _0x472814=0x0,_0x3a7650=events['length'];_0x472814<_0x3a7650;_0x472814++){var _0x4c798b=events[_0x472814];var _0x353f1b=createListener(_0x4495('0x7')+_0x4c798b,_0x5445d2);VoicePrefixEvents['on'](_0x4c798b,_0x353f1b);}}; \ No newline at end of file +var _0x7f5d=['length','voicePrefix:','./voicePrefix.events','save','remove','update','emit','register'];(function(_0x4a3b2e,_0x4e94a1){var _0x519301=function(_0x130c5f){while(--_0x130c5f){_0x4a3b2e['push'](_0x4a3b2e['shift']());}};_0x519301(++_0x4e94a1);}(_0x7f5d,0xb2));var _0xd7f5=function(_0x39734b,_0x56a475){_0x39734b=_0x39734b-0x0;var _0x504aec=_0x7f5d[_0x39734b];return _0x504aec;};'use strict';var VoicePrefixEvents=require(_0xd7f5('0x0'));var events=[_0xd7f5('0x1'),_0xd7f5('0x2'),_0xd7f5('0x3')];function createListener(_0x1354ff,_0x2cd92e){return function(_0x6a00d2){_0x2cd92e[_0xd7f5('0x4')](_0x1354ff,_0x6a00d2);};}function removeListener(_0x359efa,_0x4daae9){return function(){VoicePrefixEvents['removeListener'](_0x359efa,_0x4daae9);};}exports[_0xd7f5('0x5')]=function(_0x95fe7c){for(var _0x648a65=0x0,_0x162ab8=events[_0xd7f5('0x6')];_0x648a65<_0x162ab8;_0x648a65++){var _0x2f44a0=events[_0x648a65];var _0x531653=createListener(_0xd7f5('0x7')+_0x2f44a0,_0x95fe7c);VoicePrefixEvents['on'](_0x2f44a0,_0x531653);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 78726ef..b921b3e 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 _0x4888=['/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/teams','addAgents','addLists','addBlackLists','put','/:id','destroy','removeTeams','delete','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x4888,0x198));var _0x8488=function(_0xd746ed,_0x81920c){_0xd746ed=_0xd746ed-0x0;var _0x5ef2a6=_0x4888[_0xd746ed];return _0x5ef2a6;};'use strict';var multer=require('multer');var util=require(_0x8488('0x0'));var path=require(_0x8488('0x1'));var timeout=require(_0x8488('0x2'));var express=require(_0x8488('0x3'));var router=express[_0x8488('0x4')]();var fs_extra=require(_0x8488('0x5'));var auth=require(_0x8488('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8488('0x7'));var controller=require(_0x8488('0x8'));router[_0x8488('0x9')]('/',auth[_0x8488('0xa')](),controller[_0x8488('0xb')]);router[_0x8488('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x8488('0xc'),auth[_0x8488('0xa')](),controller['getHoppers']);router[_0x8488('0x9')](_0x8488('0xd'),auth[_0x8488('0xa')](),controller[_0x8488('0xe')]);router['get'](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x10')]);router[_0x8488('0x9')](_0x8488('0x11'),auth['isAuthenticated'](),controller[_0x8488('0x12')]);router[_0x8488('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8488('0x13')]);router['get'](_0x8488('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0x8488('0x9')](_0x8488('0x15'),auth[_0x8488('0xa')](),controller[_0x8488('0x16')]);router[_0x8488('0x9')](_0x8488('0x17'),auth[_0x8488('0xa')](),controller['getLists']);router[_0x8488('0x9')](_0x8488('0x18'),auth[_0x8488('0xa')](),controller[_0x8488('0x19')]);router[_0x8488('0x1a')]('/',auth[_0x8488('0xa')](),controller[_0x8488('0x1b')]);router[_0x8488('0x1a')](_0x8488('0x1c'),auth[_0x8488('0xa')](),controller[_0x8488('0x1d')]);router[_0x8488('0x1a')](_0x8488('0x1e'),auth['isAuthenticated'](),controller['addTeams']);router[_0x8488('0x1a')](_0x8488('0x14'),auth[_0x8488('0xa')](),controller[_0x8488('0x1f')]);router[_0x8488('0x1a')](_0x8488('0x17'),auth[_0x8488('0xa')](),controller[_0x8488('0x20')]);router[_0x8488('0x1a')]('/:id/blacklists',auth[_0x8488('0xa')](),controller[_0x8488('0x21')]);router[_0x8488('0x22')](_0x8488('0x23'),auth[_0x8488('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8488('0x24')]);router['delete']('/:id/teams',auth[_0x8488('0xa')](),controller[_0x8488('0x25')]);router[_0x8488('0x26')](_0x8488('0x14'),auth[_0x8488('0xa')](),controller['removeAgents']);router[_0x8488('0x26')](_0x8488('0x17'),auth[_0x8488('0xa')](),controller[_0x8488('0x27')]);router[_0x8488('0x26')](_0x8488('0x18'),auth[_0x8488('0xa')](),controller[_0x8488('0x28')]);module[_0x8488('0x29')]=router; \ No newline at end of file +var _0x2032=['getLists','getBlackLists','create','/:id/clone','clone','post','/:id/teams','addTeams','addLists','update','delete','destroy','removeTeams','removeAgents','removeLists','/:id/blacklists','removeBlackLists','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getAgents','/:id/members','getMembers','/:id/lists'];(function(_0x157cca,_0x41a01c){var _0x3a3fe8=function(_0x35ff85){while(--_0x35ff85){_0x157cca['push'](_0x157cca['shift']());}};_0x3a3fe8(++_0x41a01c);}(_0x2032,0xd9));var _0x2203=function(_0xb18133,_0x4fb499){_0xb18133=_0xb18133-0x0;var _0x148558=_0x2032[_0xb18133];return _0x148558;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['get'](_0x2203('0x12'),auth[_0x2203('0x9')](),controller['getHopperBlacks']);router['get']('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x2203('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x2203('0x13')]);router[_0x2203('0x8')](_0x2203('0x14'),auth[_0x2203('0x9')](),controller[_0x2203('0x15')]);router[_0x2203('0x8')](_0x2203('0x16'),auth[_0x2203('0x9')](),controller[_0x2203('0x17')]);router[_0x2203('0x8')]('/:id/blacklists',auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x19')]);router['post'](_0x2203('0x1a'),auth['isAuthenticated'](),controller[_0x2203('0x1b')]);router[_0x2203('0x1c')](_0x2203('0x1d'),auth[_0x2203('0x9')](),controller[_0x2203('0x1e')]);router[_0x2203('0x1c')]('/:id/users',auth[_0x2203('0x9')](),controller['addAgents']);router['post'](_0x2203('0x16'),auth['isAuthenticated'](),controller[_0x2203('0x1f')]);router[_0x2203('0x1c')]('/:id/blacklists',auth[_0x2203('0x9')](),controller['addBlackLists']);router['put'](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x20')]);router[_0x2203('0x21')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x22')]);router[_0x2203('0x21')]('/:id/teams',auth[_0x2203('0x9')](),controller[_0x2203('0x23')]);router[_0x2203('0x21')]('/:id/users',auth[_0x2203('0x9')](),controller[_0x2203('0x24')]);router['delete'](_0x2203('0x16'),auth[_0x2203('0x9')](),controller[_0x2203('0x25')]);router[_0x2203('0x21')](_0x2203('0x26'),auth[_0x2203('0x9')](),controller[_0x2203('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index a67b42d..d144ed9 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 _0xb566=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','inbound','outbound','default','ENUM','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','type','getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','leavewhenempty','split','BOOLEAN','acw','wrapuptime','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#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)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x246a9c,_0x4df087){var _0x4bd0b3=function(_0x4558c6){while(--_0x4558c6){_0x246a9c['push'](_0x246a9c['shift']());}};_0x4bd0b3(++_0x4df087);}(_0xb566,0x1f1));var _0x6b56=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0xb566[_0x18a436];return _0x5c2cf8;};'use strict';var Sequelize=require(_0x6b56('0x0'));module[_0x6b56('0x1')]={'name':{'type':Sequelize[_0x6b56('0x2')],'allowNull':![],'unique':_0x6b56('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x6b56('0x4'),_0x6b56('0x5')),'allowNull':![],'defaultValue':_0x6b56('0x4')},'musiconhold':{'type':Sequelize[_0x6b56('0x2')],'defaultValue':_0x6b56('0x6')},'announce':{'type':Sequelize[_0x6b56('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x6b56('0x7')]('rr','ringall',_0x6b56('0x8'),_0x6b56('0x9'),_0x6b56('0xa'),_0x6b56('0xb'),_0x6b56('0xc'),_0x6b56('0xd'),_0x6b56('0xe')),'allowNull':![],'defaultValue':_0x6b56('0xf'),'set':function(_0x58ddcd){this[_0x6b56('0x10')](_0x6b56('0x11'),_0x58ddcd?_0x58ddcd:_0x6b56('0xb'));},'get':function(){var _0x5d79fd=this['getDataValue'](_0x6b56('0x12'));var _0x549d41=this[_0x6b56('0x13')]('dialMethod');var _0xa9932e=this[_0x6b56('0x13')](_0x6b56('0x11'));if(_0x5d79fd===_0x6b56('0x4')){return _0xa9932e;}if(_0x549d41==='booked'&&_0xa9932e==='rrmemory'||_0x549d41===_0x6b56('0x14')&&_0xa9932e===_0x6b56('0x15')){return _0xa9932e;}if(_0x549d41===_0x6b56('0x16')||_0x549d41===_0x6b56('0x17')||_0x549d41===_0x6b56('0x18')){return _0xa9932e;}return null;}},'servicelevel':{'type':Sequelize[_0x6b56('0x19')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x6b56('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x6b56('0x19')](0xb)},'timeout':{'type':Sequelize[_0x6b56('0x19')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x6b56('0x2')]},'weight':{'type':Sequelize[_0x6b56('0x19')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x6b56('0x1a'),'no'),'defaultValue':_0x6b56('0x1a')},'autopause':{'type':Sequelize[_0x6b56('0x7')](_0x6b56('0x1a'),'no',_0x6b56('0x1b')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x6b56('0x7')](_0x6b56('0x1a'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x6b56('0x1a'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x6b56('0x19')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x6b56('0x1a'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x6b56('0x7')](_0x6b56('0x1a'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x6b56('0x7')](_0x6b56('0x1a'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x6b56('0x1a'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x6b56('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x6b56('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x6b56('0x19')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x6b56('0x19')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x6b56('0x7')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x6b56('0x1a'),'no'),'defaultValue':_0x6b56('0x1a')},'announce_holdtime':{'type':Sequelize[_0x6b56('0x7')](_0x6b56('0x1a'),'no',_0x6b56('0x1c')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x6b56('0x1a'),'no')},'announce_position_limit':{'type':Sequelize[_0x6b56('0x19')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x6b56('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x6b56('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x6b56('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x6b56('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x6b56('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x6b56('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x6b56('0x2')]},'queue_quantity1':{'type':Sequelize[_0x6b56('0x2')]},'queue_quantity2':{'type':Sequelize[_0x6b56('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x6b56('0x2')]},'queue_less_than':{'type':Sequelize[_0x6b56('0x2')]},'periodic_announce':{'type':Sequelize[_0x6b56('0x1d')],'set':function(_0x42c913){this[_0x6b56('0x10')](_0x6b56('0x1e'),_0x42c913?_0x42c913['join'](','):[]);},'get':function(){return this[_0x6b56('0x13')](_0x6b56('0x1e'))?this[_0x6b56('0x13')](_0x6b56('0x1e'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x6b56('0x1a'),'set':function(_0x476c3a){this[_0x6b56('0x10')]('joinempty',_0x476c3a?_0x476c3a[_0x6b56('0x1f')](','):undefined);},'get':function(){return this[_0x6b56('0x13')](_0x6b56('0x20'))?this[_0x6b56('0x13')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x6b56('0x2')],'defaultValue':'no','set':function(_0x7af623){this[_0x6b56('0x10')](_0x6b56('0x21'),_0x7af623?_0x7af623['join'](','):undefined);},'get':function(){return this[_0x6b56('0x13')](_0x6b56('0x21'))?this['getDataValue'](_0x6b56('0x21'))[_0x6b56('0x22')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x6b56('0x7')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x6b56('0x7')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x6b56('0x19')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x6b56('0x7')](_0x6b56('0x1a'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x6b56('0x2')]},'description':{'type':Sequelize[_0x6b56('0x2')]},'acw':{'type':Sequelize[_0x6b56('0x23')],'defaultValue':0x0,'set':function(_0x558502){this[_0x6b56('0x10')](_0x6b56('0x24'),_0x558502);if(_0x558502){if(this[_0x6b56('0x13')](_0x6b56('0x25'))<0x2){this[_0x6b56('0x10')](_0x6b56('0x25'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x6b56('0x19')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x6b56('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x6b56('0x7')](_0x6b56('0x26'),_0x6b56('0x16'),_0x6b56('0x18'),_0x6b56('0x17'),_0x6b56('0x14')),'defaultValue':_0x6b56('0x16'),'comment':_0x6b56('0x27')},'dialLimitChannel':{'type':Sequelize[_0x6b56('0x19')](0x4)[_0x6b56('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6b56('0x29')},'dialLimitQueue':{'type':Sequelize[_0x6b56('0x19')](0x4)[_0x6b56('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6b56('0x2a')},'dialPowerLevel':{'type':Sequelize[_0x6b56('0x2b')](0x2)[_0x6b56('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x6b56('0x2c')},'dialPredictiveOptimization':{'type':Sequelize[_0x6b56('0x7')]('agentBusyFactor',_0x6b56('0x2d')),'defaultValue':_0x6b56('0x2d'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x6b56('0x2b')](0x2)[_0x6b56('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x6b56('0x19')](0x3)[_0x6b56('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x6b56('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6b56('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6b56('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x6b56('0x19')](0x3)[_0x6b56('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x6b56('0x2')],'defaultValue':_0x6b56('0x2f'),'comment':_0x6b56('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x6b56('0x19')](0x3)[_0x6b56('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b56('0x31')},'dialQueueProject':{'type':Sequelize[_0x6b56('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b56('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6b56('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b56('0x33')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6b56('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b56('0x34')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6b56('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b56('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6b56('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x6b56('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6b56('0x19')](0x5)[_0x6b56('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b56('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x6b56('0x19')](0x3)[_0x6b56('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x6b56('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6b56('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x6b56('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x6b56('0x7')](_0x6b56('0x38'),'never',_0x6b56('0x39')),'defaultValue':_0x6b56('0x38')},'dialAMDActive':{'type':Sequelize[_0x6b56('0x23')],'defaultValue':0x0,'comment':_0x6b56('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x6b56('0x19')](0x9)[_0x6b56('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x6b56('0x19')](0x9)[_0x6b56('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6b56('0x19')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6b56('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x6b56('0x19')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6b56('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6b56('0x19')](0x9)[_0x6b56('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6b56('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x6b56('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6b56('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6b56('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6b56('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x6b56('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6b56('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x6b56('0x19')](0x5)[_0x6b56('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x6b56('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x6b56('0x23')],'defaultValue':0x0,'comment':_0x6b56('0x42')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x6b56('0x43'),_0x6b56('0x44')),'defaultValue':_0x6b56('0x43')},'dialQueueProject2':{'type':Sequelize[_0x6b56('0x2')],'comment':_0x6b56('0x45')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x6b56('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6b56('0x19')](0x3)[_0x6b56('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6b56('0x46')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x6b56('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6b56('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6b56('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b56('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x6b56('0x19')](0x5)[_0x6b56('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b56('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x6b56('0x19')](0x3)[_0x6b56('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b56('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0x6b56('0x19')](0x5)[_0x6b56('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6b56('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b56('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x6b56('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b56('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6b56('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b56('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6b56('0x19')](0x3)[_0x6b56('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b56('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6b56('0x19')](0x5)[_0x6b56('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b56('0x4f')},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x6b56('0x19')](0x5)[_0x6b56('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x3,'comment':'Minutes\x20to\x20wait\x20to\x20call\x20next\x20additional\x20phone\x20number\x20'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6b56('0x19')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6b56('0x23')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4d321c){if(!_0x4d321c)this[_0x6b56('0x10')](_0x6b56('0x50'),null);this[_0x6b56('0x10')](_0x6b56('0x51'),_0x4d321c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x6b56('0x19')](0x3)[_0x6b56('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xb00d=['#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Minutes\x20to\x20wait\x20to\x20call\x20next\x20additional\x20phone\x20number\x20','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','default','ringall','leastrecent','fewestcalls','linear','wrandom','rrordered','strategy','rrmemory','getDataValue','booked','roundrobin','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','progressive','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0xb00d,0x19e));var _0xdb00=function(_0x4e7abc,_0x2aeca1){_0x4e7abc=_0x4e7abc-0x0;var _0x428796=_0xb00d[_0x4e7abc];return _0x428796;};'use strict';var Sequelize=require(_0xdb00('0x0'));module[_0xdb00('0x1')]={'name':{'type':Sequelize[_0xdb00('0x2')],'allowNull':![],'unique':_0xdb00('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xdb00('0x4')](_0xdb00('0x5'),'outbound'),'allowNull':![],'defaultValue':_0xdb00('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xdb00('0x6')},'announce':{'type':Sequelize[_0xdb00('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xdb00('0x7'),_0xdb00('0x8'),_0xdb00('0x9'),'random','rrmemory',_0xdb00('0xa'),_0xdb00('0xb'),_0xdb00('0xc')),'allowNull':![],'defaultValue':_0xdb00('0x7'),'set':function(_0x21e0e4){this['setDataValue'](_0xdb00('0xd'),_0x21e0e4?_0x21e0e4:_0xdb00('0xe'));},'get':function(){var _0x33c2fb=this[_0xdb00('0xf')]('type');var _0x1fe565=this[_0xdb00('0xf')]('dialMethod');var _0x2669fa=this['getDataValue'](_0xdb00('0xd'));if(_0x33c2fb===_0xdb00('0x5')){return _0x2669fa;}if(_0x1fe565===_0xdb00('0x10')&&_0x2669fa==='rrmemory'||_0x1fe565===_0xdb00('0x10')&&_0x2669fa===_0xdb00('0x11')){return _0x2669fa;}if(_0x1fe565==='progressive'||_0x1fe565===_0xdb00('0x12')||_0x1fe565===_0xdb00('0x13')){return _0x2669fa;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xdb00('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xdb00('0x14')](0xb)},'timeout':{'type':Sequelize[_0xdb00('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xdb00('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xdb00('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xdb00('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xdb00('0x4')](_0xdb00('0x15'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xdb00('0x4')]('yes','no',_0xdb00('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xdb00('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xdb00('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xdb00('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xdb00('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xdb00('0x4')](_0xdb00('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xdb00('0x4')](_0xdb00('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xdb00('0x4')](_0xdb00('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xdb00('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xdb00('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xdb00('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xdb00('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xdb00('0x15'),'no'),'defaultValue':_0xdb00('0x15')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xdb00('0x15'),'no',_0xdb00('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xdb00('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xdb00('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xdb00('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xdb00('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xdb00('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xdb00('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xdb00('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xdb00('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xdb00('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xdb00('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xdb00('0x2')]},'queue_quantity1':{'type':Sequelize[_0xdb00('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xdb00('0x2')]},'queue_less_than':{'type':Sequelize[_0xdb00('0x2')]},'periodic_announce':{'type':Sequelize[_0xdb00('0x18')],'set':function(_0x3d7dde){this[_0xdb00('0x19')](_0xdb00('0x1a'),_0x3d7dde?_0x3d7dde[_0xdb00('0x1b')](','):[]);},'get':function(){return this[_0xdb00('0xf')](_0xdb00('0x1a'))?this[_0xdb00('0xf')](_0xdb00('0x1a'))[_0xdb00('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0xdb00('0x2')],'defaultValue':_0xdb00('0x15'),'set':function(_0x43aedc){this['setDataValue'](_0xdb00('0x1d'),_0x43aedc?_0x43aedc[_0xdb00('0x1b')](','):undefined);},'get':function(){return this[_0xdb00('0xf')]('joinempty')?this[_0xdb00('0xf')]('joinempty')[_0xdb00('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x1cfafb){this[_0xdb00('0x19')](_0xdb00('0x1e'),_0x1cfafb?_0x1cfafb[_0xdb00('0x1b')](','):undefined);},'get':function(){return this[_0xdb00('0xf')]('leavewhenempty')?this[_0xdb00('0xf')](_0xdb00('0x1e'))[_0xdb00('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xdb00('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xdb00('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xdb00('0x4')](_0xdb00('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xdb00('0x2')]},'description':{'type':Sequelize[_0xdb00('0x2')]},'acw':{'type':Sequelize[_0xdb00('0x1f')],'defaultValue':0x0,'set':function(_0x5e78e4){this['setDataValue'](_0xdb00('0x20'),_0x5e78e4);if(_0x5e78e4){if(this['getDataValue']('wrapuptime')<0x2){this['setDataValue'](_0xdb00('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xdb00('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xdb00('0x4')](_0xdb00('0x22'),'progressive',_0xdb00('0x13'),_0xdb00('0x12'),'booked'),'defaultValue':_0xdb00('0x23'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xdb00('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xdb00('0x25')},'dialPowerLevel':{'type':Sequelize[_0xdb00('0x26')](0x2)[_0xdb00('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xdb00('0x27'),'dropRate'),'defaultValue':_0xdb00('0x28'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xdb00('0x26')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xdb00('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0xdb00('0x14')](0x3)[_0xdb00('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xdb00('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdb00('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdb00('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xdb00('0x14')](0x3)[_0xdb00('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdb00('0x2b')},'dialQueueOptions':{'type':Sequelize[_0xdb00('0x2')],'defaultValue':_0xdb00('0x2c'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xdb00('0x14')](0x3)[_0xdb00('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xdb00('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xdb00('0x14')](0x3)[_0xdb00('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdb00('0x2d')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdb00('0x14')](0x5)[_0xdb00('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xdb00('0x14')](0x3)[_0xdb00('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdb00('0x2e')},'dialBusyRetryFrequency':{'type':Sequelize[_0xdb00('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdb00('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xdb00('0x2f')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdb00('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xdb00('0x14')](0x3)[_0xdb00('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xdb00('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xdb00('0x30')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xdb00('0x4')](_0xdb00('0x31'),_0xdb00('0x32'),_0xdb00('0x33')),'defaultValue':_0xdb00('0x31')},'dialAMDActive':{'type':Sequelize[_0xdb00('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xdb00('0x14')](0x9)[_0xdb00('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdb00('0x34')},'dialAMDGreeting':{'type':Sequelize[_0xdb00('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdb00('0x35')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdb00('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdb00('0x36')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdb00('0x14')](0x9)[_0xdb00('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdb00('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0xdb00('0x14')](0x9)[_0xdb00('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdb00('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdb00('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdb00('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdb00('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdb00('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdb00('0x14')](0x5)[_0xdb00('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdb00('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdb00('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdb00('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0xdb00('0x14')](0x5)[_0xdb00('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xdb00('0x3d')},'dialRecallInQueue':{'type':Sequelize[_0xdb00('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xdb00('0x3e'),_0xdb00('0x3f')),'defaultValue':_0xdb00('0x3e')},'dialQueueProject2':{'type':Sequelize[_0xdb00('0x2')],'comment':_0xdb00('0x40')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xdb00('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdb00('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdb00('0x41')},'dialCutDigit':{'type':Sequelize[_0xdb00('0x14')](0x3)[_0xdb00('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdb00('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdb00('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdb00('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0xdb00('0x14')](0x3)[_0xdb00('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdb00('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0xdb00('0x14')](0x5)[_0xdb00('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdb00('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdb00('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdb00('0x14')](0x5)[_0xdb00('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdb00('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0xdb00('0x14')](0x3)[_0xdb00('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdb00('0x47')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdb00('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdb00('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdb00('0x14')](0x3)[_0xdb00('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdb00('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdb00('0x14')](0x5)[_0xdb00('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdb00('0x4a')},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xdb00('0x14')](0x5)[_0xdb00('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x3,'comment':_0xdb00('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdb00('0x14')],'allowNull':!![],'comment':_0xdb00('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0xdb00('0x1f')],'defaultValue':![],'comment':_0xdb00('0x4d'),'set':function(_0x345060){if(!_0x345060)this[_0xdb00('0x19')](_0xdb00('0x4e'),null);this['setDataValue'](_0xdb00('0x4f'),_0x345060);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xdb00('0x14')](0x3)[_0xdb00('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xdb00('0x14')](0x3)[_0xdb00('0x24')],'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 465be85..696a66d 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 _0xf9e6=['CmListId','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper_additional_phones','OrderBy','h.id','ci.item','h.ContactId\x20=\x20ci.CmContactId','h.VoiceQueueId=?','h.createdAt\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','then','get','VoiceQueues','outbound','filter','value','includes','type','find','destroy','end','name','send','index','VoiceQueue','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','merge','map','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','length','catch','create','body','user','role','inbound','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','QueueCampaigns','userProfileId','UserProfileResource','getHoppers','findOne','CmHopper','pick','include','hasOwnProperty','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','Team','getTeams','addTeams','User','Agents','online','voicePause','flatMap','forEach','penalty','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','interface','emit','userVoiceQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','union','compact','ids','removeAgents','userVoiceQueue:remove','addAgents','spread','isEmpty','all','isArray','getAgents','getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','NOW()','scheduledAt'];(function(_0x281d6b,_0xcdc3cf){var _0x5942ed=function(_0xdd98e6){while(--_0xdd98e6){_0x281d6b['push'](_0x281d6b['shift']());}};_0x5942ed(++_0xcdc3cf);}(_0xf9e6,0xd5));var _0x6f9e=function(_0x22ba58,_0x5ef46b){_0x22ba58=_0x22ba58-0x0;var _0x2948c1=_0xf9e6[_0x22ba58];return _0x2948c1;};'use strict';var emlformat=require(_0x6f9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f9e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f9e('0x2'));var moment=require(_0x6f9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6f9e('0x4'));var util=require(_0x6f9e('0x5'));var path=require(_0x6f9e('0x6'));var sox=require(_0x6f9e('0x7'));var csv=require(_0x6f9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f9e('0x9'));var _=require(_0x6f9e('0xa'));var squel=require('squel');var crypto=require(_0x6f9e('0xb'));var jsforce=require(_0x6f9e('0xc'));var deskjs=require(_0x6f9e('0xd'));var toCsv=require(_0x6f9e('0x8'));var querystring=require(_0x6f9e('0xe'));var Papa=require(_0x6f9e('0xf'));var Redis=require(_0x6f9e('0x10'));var authService=require(_0x6f9e('0x11'));var qs=require(_0x6f9e('0x12'));var as=require(_0x6f9e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f9e('0x14'))(_0x6f9e('0x15'));var utils=require(_0x6f9e('0x16'));var config=require(_0x6f9e('0x17'));var licenseUtil=require(_0x6f9e('0x18'));var db=require('../../mysqldb')['db'];config[_0x6f9e('0x19')]=_['defaults'](config[_0x6f9e('0x19')],{'host':_0x6f9e('0x1a'),'port':0x18eb});var socket=require(_0x6f9e('0x1b'))(new Redis(config[_0x6f9e('0x19')]));require(_0x6f9e('0x1c'))['register'](socket);function respondWithStatusCode(_0x14f751,_0x5c76b8){_0x5c76b8=_0x5c76b8||0xcc;return function(_0x2db44){if(_0x2db44){return _0x14f751[_0x6f9e('0x1d')](_0x5c76b8);}return _0x14f751[_0x6f9e('0x1e')](_0x5c76b8)['end']();};}function respondWithResult(_0x53c9d7,_0x2fb9ef){_0x2fb9ef=_0x2fb9ef||0xc8;return function(_0x1c5a16){if(_0x1c5a16){return _0x53c9d7[_0x6f9e('0x1e')](_0x2fb9ef)[_0x6f9e('0x1f')](_0x1c5a16);}};}function respondWithFilteredResult(_0xfff24f,_0x5d65a9){return function(_0x517d19){if(_0x517d19){var _0xf436d8=typeof _0x5d65a9[_0x6f9e('0x20')]===_0x6f9e('0x21')&&typeof _0x5d65a9[_0x6f9e('0x22')]===_0x6f9e('0x21');var _0x2b99c0=_0x517d19[_0x6f9e('0x23')];var _0xd62f6c=_0xf436d8?0x0:_0x5d65a9[_0x6f9e('0x20')];var _0x2de566=_0xf436d8?_0x517d19[_0x6f9e('0x23')]:_0x5d65a9[_0x6f9e('0x20')]+_0x5d65a9[_0x6f9e('0x22')];var _0x364e21;if(_0x2de566>=_0x2b99c0){_0x2de566=_0x2b99c0;_0x364e21=0xc8;}else{_0x364e21=0xce;}_0xfff24f[_0x6f9e('0x1e')](_0x364e21);return _0xfff24f['set'](_0x6f9e('0x24'),_0xd62f6c+'-'+_0x2de566+'/'+_0x2b99c0)[_0x6f9e('0x1f')](_0x517d19);}return null;};}function patchUpdates(_0x21d2a8){return function(_0x4b5a16){try{jsonpatch[_0x6f9e('0x25')](_0x4b5a16,_0x21d2a8,!![]);}catch(_0x2ea6d2){return BPromise['reject'](_0x2ea6d2);}return _0x4b5a16['save']();};}function saveUpdates(_0x3237e3,_0x1e058e){return function(_0x146afe){if(_0x146afe){return _0x146afe['update'](_0x3237e3)[_0x6f9e('0x26')](function(_0x1de350){return _0x1de350;});}return null;};}function removeEntity(_0x2c190d,_0x2612a1){return function(_0x46737d){if(_0x46737d){return _0x46737d['destroy']()['then'](function(){var _0x12fc37=_0x46737d[_0x6f9e('0x27')]({'plain':!![]});var _0x7be87e=[{'name':_0x6f9e('0x28'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':_0x6f9e('0x29'),'ignore':![]}];var _0x18974e=_(_0x7be87e)[_0x6f9e('0x2a')]('ignore')['map'](_0x6f9e('0x2b'))[_0x6f9e('0x2b')]();if(_[_0x6f9e('0x2c')](_0x18974e,_0x12fc37[_0x6f9e('0x2d')])){return;}var _0x5819d5=_[_0x6f9e('0x2e')](_0x7be87e,[_0x6f9e('0x2b'),_0x12fc37['type']])['name'];return db['UserProfileResource'][_0x6f9e('0x2f')]({'where':{'type':_0x5819d5,'resourceId':_0x12fc37['id']}})[_0x6f9e('0x26')](function(){return _0x46737d;});})[_0x6f9e('0x26')](function(){_0x2c190d[_0x6f9e('0x1e')](0xcc)[_0x6f9e('0x30')]();});}};}function handleEntityNotFound(_0x47da06,_0x19014b){return function(_0x5dbaae){if(!_0x5dbaae){_0x47da06['sendStatus'](0x194);}return _0x5dbaae;};}function handleError(_0x1cb1cc,_0x41f0e6){_0x41f0e6=_0x41f0e6||0x1f4;return function(_0x1c08a3){logger['error'](_0x1c08a3['stack']);if(_0x1c08a3[_0x6f9e('0x31')]){delete _0x1c08a3[_0x6f9e('0x31')];}_0x1cb1cc['status'](_0x41f0e6)[_0x6f9e('0x32')](_0x1c08a3);};}exports[_0x6f9e('0x33')]=function(_0x2977a6,_0x2d7def){var _0x449a3b={},_0x54f62a={},_0xc79e93={'count':0x0,'rows':[]};var _0x35e81c=_['map'](db[_0x6f9e('0x34')]['rawAttributes'],function(_0x4c83a9){return{'name':_0x4c83a9[_0x6f9e('0x35')],'type':_0x4c83a9[_0x6f9e('0x2d')][_0x6f9e('0x36')]};});_0x54f62a[_0x6f9e('0x37')]=_['map'](_0x35e81c,_0x6f9e('0x31'));_0x54f62a[_0x6f9e('0x38')]=_[_0x6f9e('0x39')](_0x2977a6[_0x6f9e('0x38')]);_0x54f62a[_0x6f9e('0x3a')]=_[_0x6f9e('0x3b')](_0x54f62a[_0x6f9e('0x37')],_0x54f62a[_0x6f9e('0x38')]);_0x449a3b['attributes']=_[_0x6f9e('0x3b')](_0x54f62a[_0x6f9e('0x37')],qs['fields'](_0x2977a6[_0x6f9e('0x38')][_0x6f9e('0x3c')]));_0x449a3b[_0x6f9e('0x3d')]=_0x449a3b[_0x6f9e('0x3d')]['length']?_0x449a3b[_0x6f9e('0x3d')]:_0x54f62a[_0x6f9e('0x37')];if(!_0x2977a6[_0x6f9e('0x38')]['hasOwnProperty'](_0x6f9e('0x3e'))){_0x449a3b[_0x6f9e('0x22')]=qs[_0x6f9e('0x22')](_0x2977a6[_0x6f9e('0x38')]['limit']);_0x449a3b[_0x6f9e('0x20')]=qs[_0x6f9e('0x20')](_0x2977a6['query'][_0x6f9e('0x20')]);}_0x449a3b[_0x6f9e('0x3f')]=qs[_0x6f9e('0x40')](_0x2977a6[_0x6f9e('0x38')][_0x6f9e('0x40')]);_0x449a3b[_0x6f9e('0x41')]=qs['filters'](_['pick'](_0x2977a6[_0x6f9e('0x38')],_0x54f62a['filters']),_0x35e81c);if(_0x2977a6[_0x6f9e('0x38')]['filter']){_0x449a3b[_0x6f9e('0x41')]=_[_0x6f9e('0x42')](_0x449a3b[_0x6f9e('0x41')],{'$or':_[_0x6f9e('0x43')](_0x35e81c,function(_0x1744ea){if(_0x1744ea['type']!==_0x6f9e('0x44')){var _0x1a5a37={};_0x1a5a37[_0x1744ea[_0x6f9e('0x31')]]={'$like':'%'+_0x2977a6['query'][_0x6f9e('0x2a')]+'%'};return _0x1a5a37;}})});}_0x449a3b=_[_0x6f9e('0x42')]({},_0x449a3b,_0x2977a6[_0x6f9e('0x45')]);var _0x5c0d88={'where':_0x449a3b[_0x6f9e('0x41')]};return db['VoiceQueue'][_0x6f9e('0x23')](_0x5c0d88)['then'](function(_0x24692d){_0xc79e93['count']=_0x24692d;if(_0x2977a6[_0x6f9e('0x38')][_0x6f9e('0x46')]){_0x449a3b['include']=[{'all':!![]}];}return db[_0x6f9e('0x34')][_0x6f9e('0x47')](_0x449a3b);})['then'](function(_0x781777){_0xc79e93[_0x6f9e('0x48')]=_0x781777;return _0xc79e93;})['then'](respondWithFilteredResult(_0x2d7def,_0x449a3b))['catch'](handleError(_0x2d7def,null));};exports[_0x6f9e('0x49')]=function(_0x48b0af,_0xb978c){var _0x2b193d={'raw':![],'where':{'id':_0x48b0af[_0x6f9e('0x4a')]['id']}},_0x160c5f={};_0x160c5f[_0x6f9e('0x37')]=_[_0x6f9e('0x39')](db['VoiceQueue'][_0x6f9e('0x4b')]);_0x160c5f[_0x6f9e('0x38')]=_[_0x6f9e('0x39')](_0x48b0af[_0x6f9e('0x38')]);_0x160c5f[_0x6f9e('0x3a')]=_[_0x6f9e('0x3b')](_0x160c5f['model'],_0x160c5f[_0x6f9e('0x38')]);_0x2b193d[_0x6f9e('0x3d')]=_['intersection'](_0x160c5f[_0x6f9e('0x37')],qs[_0x6f9e('0x3c')](_0x48b0af[_0x6f9e('0x38')][_0x6f9e('0x3c')]));_0x2b193d[_0x6f9e('0x3d')]=_0x2b193d['attributes'][_0x6f9e('0x4c')]?_0x2b193d[_0x6f9e('0x3d')]:_0x160c5f[_0x6f9e('0x37')];if(_0x48b0af[_0x6f9e('0x38')]['includeAll']){_0x2b193d['include']=[{'all':!![]}];}_0x2b193d=_[_0x6f9e('0x42')]({},_0x2b193d,_0x48b0af['options']);return db['VoiceQueue'][_0x6f9e('0x2e')](_0x2b193d)[_0x6f9e('0x26')](handleEntityNotFound(_0xb978c,null))[_0x6f9e('0x26')](respondWithResult(_0xb978c,null))[_0x6f9e('0x4d')](handleError(_0xb978c,null));};exports[_0x6f9e('0x4e')]=function(_0x3d2aba,_0x754561){return db[_0x6f9e('0x34')][_0x6f9e('0x4e')](_0x3d2aba[_0x6f9e('0x4f')],{})['then'](function(_0x40a690){var _0x25c9a0=_0x3d2aba[_0x6f9e('0x50')]['get']({'plain':!![]});if(!_0x25c9a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25c9a0[_0x6f9e('0x51')]==='user'){var _0x402fee=_0x40a690[_0x6f9e('0x27')]({'plain':!![]});var _0x20cf44=[{'name':_0x6f9e('0x28'),'value':_0x6f9e('0x52')},{'name':'QueueCampaigns','value':'outbound'}];var _0x298041=_['find'](_0x20cf44,['value',_0x402fee['type']])[_0x6f9e('0x31')];return db[_0x6f9e('0x53')]['find']({'where':{'name':_0x298041,'userProfileId':_0x25c9a0['userProfileId']},'raw':!![]})['then'](function(_0xe69bac){if(_0xe69bac&&_0xe69bac[_0x6f9e('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x402fee[_0x6f9e('0x31')],'resourceId':_0x402fee['id'],'type':_0xe69bac[_0x6f9e('0x31')],'sectionId':_0xe69bac['id']},{})['then'](function(){return _0x40a690;});}else{return _0x40a690;}})[_0x6f9e('0x4d')](function(_0x1d140c){logger[_0x6f9e('0x55')](_0x6f9e('0x56'),_0x1d140c);throw _0x1d140c;});}return _0x40a690;})[_0x6f9e('0x26')](respondWithResult(_0x754561,0xc9))[_0x6f9e('0x4d')](handleError(_0x754561,null));};exports[_0x6f9e('0x57')]=function(_0x530d4e,_0x2ea2f2){var _0x2a12f1={'where':{'id':_0x530d4e[_0x6f9e('0x4a')]['id']}},_0x6fdb83={};_0x6fdb83[_0x6f9e('0x37')]=_[_0x6f9e('0x39')](db[_0x6f9e('0x34')][_0x6f9e('0x4b')]);_0x2a12f1[_0x6f9e('0x3d')]=_[_0x6f9e('0x3b')](_0x6fdb83[_0x6f9e('0x37')],qs['fields'](_0x530d4e[_0x6f9e('0x38')]['fields']));_0x2a12f1[_0x6f9e('0x3d')]=_0x2a12f1[_0x6f9e('0x3d')][_0x6f9e('0x4c')]?_0x2a12f1['attributes']:_0x6fdb83['model'];if(_0x530d4e[_0x6f9e('0x38')][_0x6f9e('0x46')]){_0x2a12f1['include']=[{'all':!![]}];}_0x2a12f1=_[_0x6f9e('0x42')]({},_0x2a12f1,_0x530d4e['options']);return db[_0x6f9e('0x34')]['find'](_0x2a12f1)[_0x6f9e('0x26')](handleEntityNotFound(_0x2ea2f2,null))[_0x6f9e('0x26')](function(_0x27764a){if(_0x27764a){var _0x7cdd33=_0x27764a[_0x6f9e('0x27')]({'plain':!![]});_0x7cdd33=qs['omit'](_0x7cdd33,['id',_0x6f9e('0x58'),_0x6f9e('0x59')]);_0x530d4e['body']=_[_0x6f9e('0x5a')](_0x530d4e['body'],['id',_0x6f9e('0x58'),'updatedAt']);return db[_0x6f9e('0x34')][_0x6f9e('0x4e')](_[_0x6f9e('0x42')](_0x7cdd33,_0x530d4e['body']),{'include':_0x530d4e[_0x6f9e('0x38')][_0x6f9e('0x46')]?[{'all':!![]}]:undefined})[_0x6f9e('0x26')](function(_0x4d327c){var _0x4d757f=_0x530d4e['user'][_0x6f9e('0x27')]({'plain':!![]});if(!_0x4d757f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d757f[_0x6f9e('0x51')]==='user'){var _0x18f369=_0x4d327c[_0x6f9e('0x27')]({'plain':!![]});var _0x51537a=[{'name':_0x6f9e('0x28'),'value':_0x6f9e('0x52')},{'name':_0x6f9e('0x5b'),'value':_0x6f9e('0x29')}];var _0x35092c=_['find'](_0x51537a,['value',_0x18f369[_0x6f9e('0x2d')]])[_0x6f9e('0x31')];return db['UserProfileSection'][_0x6f9e('0x2e')]({'where':{'name':_0x35092c,'userProfileId':_0x4d757f[_0x6f9e('0x5c')]},'raw':!![]})[_0x6f9e('0x26')](function(_0x7322ba){if(_0x7322ba&&_0x7322ba[_0x6f9e('0x54')]===0x0){return db[_0x6f9e('0x5d')][_0x6f9e('0x4e')]({'name':_0x18f369['name'],'resourceId':_0x18f369['id'],'type':_0x7322ba['name'],'sectionId':_0x7322ba['id']},{})[_0x6f9e('0x26')](function(){return _0x4d327c;});}else{return _0x4d327c;}})[_0x6f9e('0x4d')](function(_0x53e4fa){logger[_0x6f9e('0x55')](_0x6f9e('0x56'),_0x53e4fa);throw _0x53e4fa;});}return _0x4d327c;});}})[_0x6f9e('0x26')](respondWithResult(_0x2ea2f2,0xc9))[_0x6f9e('0x4d')](handleError(_0x2ea2f2,null));};exports['update']=function(_0x4f9872,_0x5c2c16){if(_0x4f9872[_0x6f9e('0x4f')]['id']){delete _0x4f9872[_0x6f9e('0x4f')]['id'];}return db['VoiceQueue'][_0x6f9e('0x2e')]({'where':{'id':_0x4f9872[_0x6f9e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c2c16,null))['then'](saveUpdates(_0x4f9872[_0x6f9e('0x4f')],null))[_0x6f9e('0x26')](respondWithResult(_0x5c2c16,null))[_0x6f9e('0x4d')](handleError(_0x5c2c16,null));};exports[_0x6f9e('0x2f')]=function(_0x34f3f6,_0x418526){return db[_0x6f9e('0x34')]['find']({'where':{'id':_0x34f3f6[_0x6f9e('0x4a')]['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0x418526,null))[_0x6f9e('0x26')](removeEntity(_0x418526,null))[_0x6f9e('0x4d')](handleError(_0x418526,null));};exports[_0x6f9e('0x5e')]=function(_0x1c0772,_0x113893,_0x5ac089){var _0x4a4f37={'raw':![],'where':{}};var _0x3532fb={};var _0x18e672={'count':0x0,'rows':[]};return db[_0x6f9e('0x34')][_0x6f9e('0x5f')]({'where':{'id':_0x1c0772[_0x6f9e('0x4a')]['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0x113893,null))[_0x6f9e('0x26')](function(_0x340744){if(_0x340744){_0x3532fb[_0x6f9e('0x37')]=_[_0x6f9e('0x39')](db[_0x6f9e('0x60')]['rawAttributes']);_0x3532fb['query']=_[_0x6f9e('0x39')](_0x1c0772[_0x6f9e('0x38')]);_0x3532fb[_0x6f9e('0x3a')]=_[_0x6f9e('0x3b')](_0x3532fb['model'],_0x3532fb[_0x6f9e('0x38')]);_0x4a4f37['attributes']=_[_0x6f9e('0x3b')](_0x3532fb[_0x6f9e('0x37')],qs['fields'](_0x1c0772[_0x6f9e('0x38')][_0x6f9e('0x3c')]));_0x4a4f37[_0x6f9e('0x3d')]=_0x4a4f37[_0x6f9e('0x3d')][_0x6f9e('0x4c')]?_0x4a4f37[_0x6f9e('0x3d')]:_0x3532fb[_0x6f9e('0x37')];if(!_0x1c0772['query']['hasOwnProperty'](_0x6f9e('0x3e'))){_0x4a4f37[_0x6f9e('0x22')]=qs[_0x6f9e('0x22')](_0x1c0772[_0x6f9e('0x38')][_0x6f9e('0x22')]);_0x4a4f37['offset']=qs[_0x6f9e('0x20')](_0x1c0772[_0x6f9e('0x38')]['offset']);}_0x4a4f37[_0x6f9e('0x3f')]=qs[_0x6f9e('0x40')](_0x1c0772['query'][_0x6f9e('0x40')]);_0x4a4f37[_0x6f9e('0x41')]=qs[_0x6f9e('0x3a')](_[_0x6f9e('0x61')](_0x1c0772[_0x6f9e('0x38')],_0x3532fb[_0x6f9e('0x3a')]));_0x4a4f37[_0x6f9e('0x41')]['VoiceQueueId']=_0x340744['id'];if(_0x1c0772[_0x6f9e('0x38')][_0x6f9e('0x2a')]){_0x4a4f37[_0x6f9e('0x41')]=_[_0x6f9e('0x42')](_0x4a4f37['where'],{'$or':_[_0x6f9e('0x43')](_0x4a4f37[_0x6f9e('0x3d')],function(_0x551a62){var _0x3280d1={};_0x3280d1[_0x551a62]={'$like':'%'+_0x1c0772[_0x6f9e('0x38')][_0x6f9e('0x2a')]+'%'};return _0x3280d1;})});}_0x4a4f37=_[_0x6f9e('0x42')]({},_0x4a4f37,_0x1c0772['options']);return db[_0x6f9e('0x60')][_0x6f9e('0x23')]({'where':_0x4a4f37[_0x6f9e('0x41')]})['then'](function(_0x3e3c22){_0x18e672[_0x6f9e('0x23')]=_0x3e3c22;if(_0x1c0772['query'][_0x6f9e('0x46')]){_0x4a4f37[_0x6f9e('0x62')]=[{'all':!![]}];}return db['CmHopper'][_0x6f9e('0x47')](_0x4a4f37);})[_0x6f9e('0x26')](function(_0x8b11e6){_0x18e672[_0x6f9e('0x48')]=_0x8b11e6;return _0x18e672;});}})[_0x6f9e('0x26')](respondWithFilteredResult(_0x113893,_0x4a4f37))[_0x6f9e('0x4d')](handleError(_0x113893,null));};exports['getHopperHistories']=function(_0x402cfd,_0x27f166,_0xbd7b79){var _0xcde894={'raw':!![],'where':{}};var _0x3348ab={};var _0x31109a={'count':0x0,'rows':[]};return db[_0x6f9e('0x34')][_0x6f9e('0x5f')]({'where':{'id':_0x402cfd[_0x6f9e('0x4a')]['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0x27f166,null))['then'](function(_0x40cb68){if(_0x40cb68){_0x3348ab['model']=_[_0x6f9e('0x39')](db['CmHopperHistory'][_0x6f9e('0x4b')]);_0x3348ab['query']=_[_0x6f9e('0x39')](_0x402cfd[_0x6f9e('0x38')]);_0x3348ab['filters']=_['intersection'](_0x3348ab['model'],_0x3348ab[_0x6f9e('0x38')]);_0xcde894['attributes']=_[_0x6f9e('0x3b')](_0x3348ab[_0x6f9e('0x37')],qs[_0x6f9e('0x3c')](_0x402cfd[_0x6f9e('0x38')]['fields']));_0xcde894[_0x6f9e('0x3d')]=_0xcde894[_0x6f9e('0x3d')]['length']?_0xcde894[_0x6f9e('0x3d')]:_0x3348ab[_0x6f9e('0x37')];if(!_0x402cfd['query'][_0x6f9e('0x63')](_0x6f9e('0x3e'))){_0xcde894['limit']=qs[_0x6f9e('0x22')](_0x402cfd['query'][_0x6f9e('0x22')]);_0xcde894[_0x6f9e('0x20')]=qs[_0x6f9e('0x20')](_0x402cfd[_0x6f9e('0x38')][_0x6f9e('0x20')]);}_0xcde894[_0x6f9e('0x3f')]=qs[_0x6f9e('0x40')](_0x402cfd[_0x6f9e('0x38')][_0x6f9e('0x40')]);_0xcde894[_0x6f9e('0x41')]=qs[_0x6f9e('0x3a')](_[_0x6f9e('0x61')](_0x402cfd[_0x6f9e('0x38')],_0x3348ab['filters']));_0xcde894['where'][_0x6f9e('0x64')]=_0x40cb68['id'];if(_0x402cfd[_0x6f9e('0x38')][_0x6f9e('0x2a')]){_0xcde894[_0x6f9e('0x41')]=_[_0x6f9e('0x42')](_0xcde894[_0x6f9e('0x41')],{'$or':_[_0x6f9e('0x43')](_0xcde894[_0x6f9e('0x3d')],function(_0x46d981){var _0x202029={};_0x202029[_0x46d981]={'$like':'%'+_0x402cfd[_0x6f9e('0x38')][_0x6f9e('0x2a')]+'%'};return _0x202029;})});}_0xcde894=_[_0x6f9e('0x42')]({},_0xcde894,_0x402cfd['options']);return db[_0x6f9e('0x65')][_0x6f9e('0x23')]({'where':_0xcde894['where']})['then'](function(_0x54493c){_0x31109a[_0x6f9e('0x23')]=_0x54493c;if(_0x402cfd['query'][_0x6f9e('0x46')]){_0xcde894['include']=[{'all':!![]}];}return db[_0x6f9e('0x65')][_0x6f9e('0x47')](_0xcde894);})[_0x6f9e('0x26')](function(_0x211938){_0x31109a[_0x6f9e('0x48')]=_0x211938;return _0x31109a;});}})[_0x6f9e('0x26')](respondWithFilteredResult(_0x27f166,_0xcde894))['catch'](handleError(_0x27f166,null));};exports[_0x6f9e('0x66')]=function(_0x3d920a,_0x107d00,_0xeceb9a){var _0xed1a9d={'raw':!![],'where':{}};var _0x9f6f6a={};var _0x4f9a0f={'count':0x0,'rows':[]};return db[_0x6f9e('0x34')][_0x6f9e('0x5f')]({'where':{'id':_0x3d920a[_0x6f9e('0x4a')]['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0x107d00,null))[_0x6f9e('0x26')](function(_0x2b3250){if(_0x2b3250){_0x9f6f6a[_0x6f9e('0x37')]=_[_0x6f9e('0x39')](db[_0x6f9e('0x67')]['rawAttributes']);_0x9f6f6a[_0x6f9e('0x38')]=_[_0x6f9e('0x39')](_0x3d920a[_0x6f9e('0x38')]);_0x9f6f6a[_0x6f9e('0x3a')]=_[_0x6f9e('0x3b')](_0x9f6f6a[_0x6f9e('0x37')],_0x9f6f6a[_0x6f9e('0x38')]);_0xed1a9d[_0x6f9e('0x3d')]=_[_0x6f9e('0x3b')](_0x9f6f6a[_0x6f9e('0x37')],qs[_0x6f9e('0x3c')](_0x3d920a[_0x6f9e('0x38')]['fields']));_0xed1a9d[_0x6f9e('0x3d')]=_0xed1a9d['attributes'][_0x6f9e('0x4c')]?_0xed1a9d[_0x6f9e('0x3d')]:_0x9f6f6a['model'];if(!_0x3d920a[_0x6f9e('0x38')]['hasOwnProperty'](_0x6f9e('0x3e'))){_0xed1a9d[_0x6f9e('0x22')]=qs[_0x6f9e('0x22')](_0x3d920a[_0x6f9e('0x38')][_0x6f9e('0x22')]);_0xed1a9d[_0x6f9e('0x20')]=qs[_0x6f9e('0x20')](_0x3d920a[_0x6f9e('0x38')][_0x6f9e('0x20')]);}_0xed1a9d[_0x6f9e('0x3f')]=qs[_0x6f9e('0x40')](_0x3d920a['query']['sort']);_0xed1a9d[_0x6f9e('0x41')]=qs[_0x6f9e('0x3a')](_[_0x6f9e('0x61')](_0x3d920a[_0x6f9e('0x38')],_0x9f6f6a['filters']));_0xed1a9d[_0x6f9e('0x41')][_0x6f9e('0x64')]=_0x2b3250['id'];if(_0x3d920a[_0x6f9e('0x38')][_0x6f9e('0x2a')]){_0xed1a9d[_0x6f9e('0x41')]=_[_0x6f9e('0x42')](_0xed1a9d[_0x6f9e('0x41')],{'$or':_[_0x6f9e('0x43')](_0xed1a9d[_0x6f9e('0x3d')],function(_0x1cc3f0){var _0x5ba264={};_0x5ba264[_0x1cc3f0]={'$like':'%'+_0x3d920a[_0x6f9e('0x38')][_0x6f9e('0x2a')]+'%'};return _0x5ba264;})});}_0xed1a9d=_['merge']({},_0xed1a9d,_0x3d920a[_0x6f9e('0x45')]);return db[_0x6f9e('0x67')][_0x6f9e('0x23')]({'where':_0xed1a9d['where']})[_0x6f9e('0x26')](function(_0x2131f8){_0x4f9a0f[_0x6f9e('0x23')]=_0x2131f8;if(_0x3d920a[_0x6f9e('0x38')][_0x6f9e('0x46')]){_0xed1a9d[_0x6f9e('0x62')]=[{'all':!![]}];}return db[_0x6f9e('0x67')][_0x6f9e('0x47')](_0xed1a9d);})[_0x6f9e('0x26')](function(_0x58ac9b){_0x4f9a0f[_0x6f9e('0x48')]=_0x58ac9b;return _0x4f9a0f;});}})[_0x6f9e('0x26')](respondWithFilteredResult(_0x107d00,_0xed1a9d))[_0x6f9e('0x4d')](handleError(_0x107d00,null));};exports['getHopperBlacks']=function(_0x54df08,_0x25ed33,_0x4e0ebe){var _0x55aa39={'raw':!![],'where':{}};var _0x296e51={};var _0xa22bf3={'count':0x0,'rows':[]};return db[_0x6f9e('0x34')][_0x6f9e('0x5f')]({'where':{'id':_0x54df08[_0x6f9e('0x4a')]['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0x25ed33,null))[_0x6f9e('0x26')](function(_0x18272){if(_0x18272){_0x296e51[_0x6f9e('0x37')]=_[_0x6f9e('0x39')](db['CmHopperBlack'][_0x6f9e('0x4b')]);_0x296e51[_0x6f9e('0x38')]=_[_0x6f9e('0x39')](_0x54df08[_0x6f9e('0x38')]);_0x296e51[_0x6f9e('0x3a')]=_[_0x6f9e('0x3b')](_0x296e51[_0x6f9e('0x37')],_0x296e51['query']);_0x55aa39[_0x6f9e('0x3d')]=_[_0x6f9e('0x3b')](_0x296e51['model'],qs[_0x6f9e('0x3c')](_0x54df08[_0x6f9e('0x38')][_0x6f9e('0x3c')]));_0x55aa39[_0x6f9e('0x3d')]=_0x55aa39[_0x6f9e('0x3d')][_0x6f9e('0x4c')]?_0x55aa39[_0x6f9e('0x3d')]:_0x296e51[_0x6f9e('0x37')];if(!_0x54df08[_0x6f9e('0x38')][_0x6f9e('0x63')](_0x6f9e('0x3e'))){_0x55aa39[_0x6f9e('0x22')]=qs[_0x6f9e('0x22')](_0x54df08[_0x6f9e('0x38')][_0x6f9e('0x22')]);_0x55aa39[_0x6f9e('0x20')]=qs[_0x6f9e('0x20')](_0x54df08[_0x6f9e('0x38')][_0x6f9e('0x20')]);}_0x55aa39['order']=qs[_0x6f9e('0x40')](_0x54df08[_0x6f9e('0x38')][_0x6f9e('0x40')]);_0x55aa39[_0x6f9e('0x41')]=qs[_0x6f9e('0x3a')](_[_0x6f9e('0x61')](_0x54df08[_0x6f9e('0x38')],_0x296e51[_0x6f9e('0x3a')]));_0x55aa39[_0x6f9e('0x41')][_0x6f9e('0x64')]=_0x18272['id'];if(_0x54df08[_0x6f9e('0x38')][_0x6f9e('0x2a')]){_0x55aa39[_0x6f9e('0x41')]=_[_0x6f9e('0x42')](_0x55aa39[_0x6f9e('0x41')],{'$or':_[_0x6f9e('0x43')](_0x55aa39[_0x6f9e('0x3d')],function(_0x530b95){var _0x4b67e6={};_0x4b67e6[_0x530b95]={'$like':'%'+_0x54df08[_0x6f9e('0x38')][_0x6f9e('0x2a')]+'%'};return _0x4b67e6;})});}_0x55aa39=_['merge']({},_0x55aa39,_0x54df08[_0x6f9e('0x45')]);return db['CmHopperBlack'][_0x6f9e('0x23')]({'where':_0x55aa39[_0x6f9e('0x41')]})[_0x6f9e('0x26')](function(_0x3f6f5d){_0xa22bf3[_0x6f9e('0x23')]=_0x3f6f5d;if(_0x54df08[_0x6f9e('0x38')][_0x6f9e('0x46')]){_0x55aa39['include']=[{'all':!![]}];}return db[_0x6f9e('0x68')][_0x6f9e('0x47')](_0x55aa39);})[_0x6f9e('0x26')](function(_0x53705c){_0xa22bf3[_0x6f9e('0x48')]=_0x53705c;return _0xa22bf3;});}})[_0x6f9e('0x26')](respondWithFilteredResult(_0x25ed33,_0x55aa39))['catch'](handleError(_0x25ed33,null));};exports['getTeams']=function(_0x275ae5,_0x4df434,_0x4512fe){var _0x1427a9={};var _0x2e0a17={};var _0xaca40a;var _0x2160fe;return db[_0x6f9e('0x34')][_0x6f9e('0x5f')]({'where':{'id':_0x275ae5[_0x6f9e('0x4a')]['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0x4df434,null))[_0x6f9e('0x26')](function(_0xf8e1f0){if(_0xf8e1f0){_0xaca40a=_0xf8e1f0;_0x2e0a17[_0x6f9e('0x37')]=_[_0x6f9e('0x39')](db[_0x6f9e('0x69')][_0x6f9e('0x4b')]);_0x2e0a17[_0x6f9e('0x38')]=_[_0x6f9e('0x39')](_0x275ae5[_0x6f9e('0x38')]);_0x2e0a17['filters']=_[_0x6f9e('0x3b')](_0x2e0a17[_0x6f9e('0x37')],_0x2e0a17[_0x6f9e('0x38')]);_0x1427a9[_0x6f9e('0x3d')]=_[_0x6f9e('0x3b')](_0x2e0a17['model'],qs[_0x6f9e('0x3c')](_0x275ae5[_0x6f9e('0x38')][_0x6f9e('0x3c')]));_0x1427a9['attributes']=_0x1427a9[_0x6f9e('0x3d')][_0x6f9e('0x4c')]?_0x1427a9[_0x6f9e('0x3d')]:_0x2e0a17[_0x6f9e('0x37')];_0x1427a9['order']=qs[_0x6f9e('0x40')](_0x275ae5[_0x6f9e('0x38')][_0x6f9e('0x40')]);_0x1427a9['where']=qs[_0x6f9e('0x3a')](_['pick'](_0x275ae5[_0x6f9e('0x38')],_0x2e0a17[_0x6f9e('0x3a')]));if(_0x275ae5['query'][_0x6f9e('0x2a')]){_0x1427a9[_0x6f9e('0x41')]=_[_0x6f9e('0x42')](_0x1427a9[_0x6f9e('0x41')],{'$or':_['map'](_0x1427a9[_0x6f9e('0x3d')],function(_0x55564c){var _0x2134e4={};_0x2134e4[_0x55564c]={'$like':'%'+_0x275ae5[_0x6f9e('0x38')]['filter']+'%'};return _0x2134e4;})});}_0x1427a9=_[_0x6f9e('0x42')]({},_0x1427a9,_0x275ae5[_0x6f9e('0x45')]);return _0xaca40a[_0x6f9e('0x6a')](_0x1427a9);}})[_0x6f9e('0x26')](function(_0x3a4869){if(_0x3a4869){_0x2160fe=_0x3a4869[_0x6f9e('0x4c')];if(!_0x275ae5['query'][_0x6f9e('0x63')](_0x6f9e('0x3e'))){_0x1427a9[_0x6f9e('0x22')]=qs[_0x6f9e('0x22')](_0x275ae5['query'][_0x6f9e('0x22')]);_0x1427a9[_0x6f9e('0x20')]=qs[_0x6f9e('0x20')](_0x275ae5['query'][_0x6f9e('0x20')]);}return _0xaca40a[_0x6f9e('0x6a')](_0x1427a9);}})[_0x6f9e('0x26')](function(_0x4d5563){if(_0x4d5563){return _0x4d5563?{'count':_0x2160fe,'rows':_0x4d5563}:null;}})[_0x6f9e('0x26')](respondWithResult(_0x4df434,null))[_0x6f9e('0x4d')](handleError(_0x4df434,null));};exports[_0x6f9e('0x6b')]=function(_0x58519a,_0x1e76cd,_0x240c41){var _0x2f4e4f=_0x58519a['body']['teams'];var _0xf90969=_[_0x6f9e('0x43')](_0x2f4e4f,'id');return db[_0x6f9e('0x69')][_0x6f9e('0x47')]({'where':{'id':_0xf90969},'attributes':['id'],'include':[{'model':db[_0x6f9e('0x6c')],'as':_0x6f9e('0x6d'),'attributes':['id',_0x6f9e('0x31'),_0x6f9e('0x6e'),_0x6f9e('0x6f'),'interface'],'raw':!![]}]})[_0x6f9e('0x26')](function(_0x2805e1){if(_0x2805e1){var _0x3074da=_[_0x6f9e('0x70')](_0x2805e1,function(_0x2ce80a){var _0x1c109f=_0x2ce80a[_0x6f9e('0x27')]({'plain':!![]});_0x1c109f[_0x6f9e('0x6d')][_0x6f9e('0x71')](function(_0x8f7309){_0x8f7309['penalty']=_['find'](_0x2f4e4f,{'id':_0x1c109f['id']})[_0x6f9e('0x72')];});return _0x1c109f[_0x6f9e('0x6d')];});return db[_0x6f9e('0x34')][_0x6f9e('0x2e')]({'where':{'id':_0x58519a[_0x6f9e('0x4a')]['id']}})['then'](function(_0x164654){return db['sequelize']['transaction'](function(_0x1ac999){return _0x164654[_0x6f9e('0x6b')](_0xf90969,{'transaction':_0x1ac999})[_0x6f9e('0x26')](function(){return BPromise['each'](_0x2f4e4f,function(_0x37bfe7){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x37bfe7['id'],'VoiceQueueId':_0x58519a[_0x6f9e('0x4a')]['id'],'penalty':_0x37bfe7['penalty']},{'transaction':_0x1ac999});});})[_0x6f9e('0x26')](function(){return BPromise[_0x6f9e('0x73')](_0x3074da,function(_0x2348f3){return db[_0x6f9e('0x74')][_0x6f9e('0x75')]({'where':{'UserId':_0x2348f3['id'],'VoiceQueueId':_0x58519a['params']['id']},'defaults':{'penalty':_0x2348f3[_0x6f9e('0x72')]},'transaction':_0x1ac999});});})['then'](function(){return BPromise[_0x6f9e('0x73')](_['filter'](_0x3074da,{'online':!![]}),function(_0x168a86){return db[_0x6f9e('0x76')][_0x6f9e('0x77')]({'membername':_0x168a86[_0x6f9e('0x31')],'UserId':_0x168a86['id'],'queue_name':_0x164654[_0x6f9e('0x31')],'VoiceQueueId':_0x164654['id'],'interface':_[_0x6f9e('0x78')](_0x168a86['interface'])?util[_0x6f9e('0x79')](_0x6f9e('0x7a'),_0x168a86[_0x6f9e('0x31')]):_0x168a86[_0x6f9e('0x7b')],'paused':_0x168a86[_0x6f9e('0x6f')]||![],'penalty':_0x168a86[_0x6f9e('0x72')]},{'transaction':_0x1ac999});});})[_0x6f9e('0x26')](function(){_0x3074da['forEach'](function(_0x24c3d8){socket[_0x6f9e('0x7c')](_0x6f9e('0x7d'),{'UserId':_0x24c3d8['id'],'VoiceQueueId':_0x164654['id']});});});});});}})[_0x6f9e('0x26')](respondWithStatusCode(_0x1e76cd,null))[_0x6f9e('0x4d')](handleError(_0x1e76cd,null));};exports[_0x6f9e('0x7e')]=function(_0x4ab915,_0x2423ae,_0x5bb5ef){return db['Team']['findAll']({'where':{'id':_0x4ab915[_0x6f9e('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6f9e('0x6c')],'as':_0x6f9e('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x6f9e('0x26')](handleEntityNotFound(_0x2423ae,null))['then'](function(_0x1b7091){var _0x1ed4c6=_['map'](_0x1b7091,'id');var _0x1b9d54=[];var _0x15d8fd=[];var _0x449a0d=squel[_0x6f9e('0x7f')]();_0x449a0d[_0x6f9e('0x80')](_0x6f9e('0x81'))['from']('team_has_voice_queues','tq')[_0x6f9e('0x82')](_0x6f9e('0x83'),'ut',_0x6f9e('0x84'))['where'](_0x6f9e('0x85'),_0x4ab915[_0x6f9e('0x4a')]['id']);for(var _0x438501=0x0;_0x438501<_0x1b7091[_0x6f9e('0x4c')];_0x438501+=0x1){let _0x13b578=_0x1b7091[_0x438501];for(var _0x247cf5=0x0;_0x247cf5<_0x13b578[_0x6f9e('0x6d')][_0x6f9e('0x4c')];_0x247cf5+=0x1){let _0x3a8622=_0x13b578[_0x6f9e('0x6d')][_0x247cf5];var _0x16755c=_0x449a0d[_0x6f9e('0x57')]();_0x16755c[_0x6f9e('0x41')](_0x6f9e('0x86'),_0x3a8622['id']);_0x15d8fd[_0x6f9e('0x87')](db[_0x6f9e('0x88')][_0x6f9e('0x38')](_0x16755c[_0x6f9e('0x89')](),{'type':db[_0x6f9e('0x88')]['QueryTypes'][_0x6f9e('0x8a')]})[_0x6f9e('0x26')](function(_0x1fc0e1){if(_0x1fc0e1[_0x6f9e('0x4c')]===0x1){return _0x3a8622['id'];}else{var _0x497809=_['every'](_['map'](_0x1fc0e1,'TeamId'),function(_0x484ded){return _[_0x6f9e('0x2c')](_0x1ed4c6,_0x484ded);});if(_0x497809){return _0x3a8622['id'];}}}));}}return BPromise['all'](_0x15d8fd)[_0x6f9e('0x26')](function(_0x1853f6){_0x1b9d54=_(_0x1b9d54)[_0x6f9e('0x8b')](_0x1853f6)[_0x6f9e('0x8c')]()['value']();return db[_0x6f9e('0x34')][_0x6f9e('0x2e')]({'where':{'id':_0x4ab915['params']['id']}})[_0x6f9e('0x26')](function(_0x4fc801){return db[_0x6f9e('0x88')]['transaction'](function(_0x1caa9a){return _0x4fc801['removeTeams'](_0x4ab915[_0x6f9e('0x38')][_0x6f9e('0x8d')],{'transaction':_0x1caa9a})[_0x6f9e('0x26')](function(){if(!_['isEmpty'](_0x1b9d54)){return _0x4fc801[_0x6f9e('0x8e')](_0x1b9d54,{'transaction':_0x1caa9a})['then'](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x4ab915[_0x6f9e('0x4a')]['id'],'UserId':_0x1b9d54},'transaction':_0x1caa9a});});}})[_0x6f9e('0x26')](function(){_0x1b9d54[_0x6f9e('0x71')](function(_0x358bc5){socket['emit'](_0x6f9e('0x8f'),{'UserId':_0x358bc5,'VoiceQueueId':_0x4fc801['id']});});});});});});})['then'](respondWithStatusCode(_0x2423ae,null))[_0x6f9e('0x4d')](handleError(_0x2423ae,null));};exports['addAgents']=function(_0x489be2,_0x1b9dbe,_0x41c7ff){var _0x30f4af,_0x1c5f76;return db[_0x6f9e('0x34')][_0x6f9e('0x2e')]({'where':{'id':_0x489be2['params']['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0x1b9dbe,null))[_0x6f9e('0x26')](function(_0x55bd0e){if(_0x55bd0e){_0x1c5f76=_0x55bd0e;return _0x55bd0e[_0x6f9e('0x90')](_0x489be2['body'][_0x6f9e('0x8d')],_[_0x6f9e('0x5a')](_0x489be2[_0x6f9e('0x4f')],[_0x6f9e('0x8d'),'id'])||{})[_0x6f9e('0x91')](function(_0x27aa21){for(var _0x4884a2=0x0;_0x4884a2<_0x489be2['body'][_0x6f9e('0x8d')][_0x6f9e('0x4c')];_0x4884a2+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':_0x489be2[_0x6f9e('0x4f')][_0x6f9e('0x8d')][_0x4884a2],'VoiceQueueId':_0x489be2[_0x6f9e('0x4a')]['id']});}return _0x27aa21;});}})[_0x6f9e('0x26')](function(_0x1a8179){_0x30f4af=_0x1a8179||[];if(_0x1c5f76){return db[_0x6f9e('0x6c')][_0x6f9e('0x47')]({'where':{'id':_0x489be2['body']['ids']},'attributes':['id','name',_0x6f9e('0x6e'),'voicePause',_0x6f9e('0x7b')],'raw':!![]});}})['then'](function(_0x454e31){if(!_[_0x6f9e('0x92')](_0x454e31)){var _0x45f6e0=[];for(var _0x5b10a0=0x0;_0x5b10a0<_0x454e31[_0x6f9e('0x4c')];_0x5b10a0++){if(_0x454e31[_0x5b10a0][_0x6f9e('0x6e')]){_0x45f6e0[_0x6f9e('0x87')](db[_0x6f9e('0x76')][_0x6f9e('0x77')]({'membername':_0x454e31[_0x5b10a0][_0x6f9e('0x31')],'UserId':_0x454e31[_0x5b10a0]['id'],'queue_name':_0x1c5f76[_0x6f9e('0x31')],'VoiceQueueId':_0x1c5f76['id'],'interface':_[_0x6f9e('0x78')](_0x454e31[_0x5b10a0][_0x6f9e('0x7b')])?util[_0x6f9e('0x79')]('SIP/%s',_0x454e31[_0x5b10a0]['name']):_0x454e31[_0x5b10a0][_0x6f9e('0x7b')],'paused':_0x454e31[_0x5b10a0][_0x6f9e('0x6f')]||![],'penalty':_0x489be2['body'][_0x6f9e('0x72')]||0x0}));}}return BPromise[_0x6f9e('0x93')](_0x45f6e0);}})[_0x6f9e('0x26')](function(){return _0x30f4af;})[_0x6f9e('0x26')](respondWithResult(_0x1b9dbe,null))[_0x6f9e('0x4d')](handleError(_0x1b9dbe,null));};exports[_0x6f9e('0x8e')]=function(_0x9ecf97,_0x50e84f,_0x5d477f){return db[_0x6f9e('0x34')][_0x6f9e('0x2e')]({'where':{'id':_0x9ecf97['params']['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0x50e84f,null))['then'](function(_0x346470){if(_0x346470){return _0x346470[_0x6f9e('0x8e')](_0x9ecf97[_0x6f9e('0x38')][_0x6f9e('0x8d')])[_0x6f9e('0x26')](function(){if(_[_0x6f9e('0x94')](_0x9ecf97[_0x6f9e('0x38')]['ids'])){for(var _0x4a404c=0x0;_0x4a404c<_0x9ecf97[_0x6f9e('0x38')]['ids'][_0x6f9e('0x4c')];_0x4a404c+=0x1){socket[_0x6f9e('0x7c')](_0x6f9e('0x8f'),{'UserId':Number(_0x9ecf97[_0x6f9e('0x38')][_0x6f9e('0x8d')][_0x4a404c]),'VoiceQueueId':Number(_0x9ecf97['params']['id'])});}}else{socket[_0x6f9e('0x7c')](_0x6f9e('0x8f'),{'UserId':Number(_0x9ecf97[_0x6f9e('0x38')][_0x6f9e('0x8d')]),'VoiceQueueId':Number(_0x9ecf97['params']['id'])});}});}})[_0x6f9e('0x26')](function(_0x420c4c){return db[_0x6f9e('0x76')]['destroy']({'where':{'VoiceQueueId':_0x9ecf97[_0x6f9e('0x4a')]['id'],'UserId':_0x9ecf97[_0x6f9e('0x38')][_0x6f9e('0x8d')]}})[_0x6f9e('0x26')](function(){return _0x420c4c;});})['then'](respondWithStatusCode(_0x50e84f,null))[_0x6f9e('0x4d')](handleError(_0x50e84f,null));};exports[_0x6f9e('0x95')]=function(_0x51e594,_0xe8b88b,_0x2dd248){var _0x1b3870={};var _0x312a82={};var _0x4fd8db;var _0x177c9c;return db['VoiceQueue']['findOne']({'where':{'id':_0x51e594['params']['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0xe8b88b,null))['then'](function(_0xb71f98){if(_0xb71f98){_0x4fd8db=_0xb71f98;_0x312a82[_0x6f9e('0x37')]=_[_0x6f9e('0x39')](db[_0x6f9e('0x6c')][_0x6f9e('0x4b')]);_0x312a82['query']=_[_0x6f9e('0x39')](_0x51e594[_0x6f9e('0x38')]);_0x312a82[_0x6f9e('0x3a')]=_[_0x6f9e('0x3b')](_0x312a82['model'],_0x312a82[_0x6f9e('0x38')]);_0x1b3870['attributes']=_[_0x6f9e('0x3b')](_0x312a82[_0x6f9e('0x37')],qs[_0x6f9e('0x3c')](_0x51e594[_0x6f9e('0x38')][_0x6f9e('0x3c')]));_0x1b3870[_0x6f9e('0x3d')]=_0x1b3870[_0x6f9e('0x3d')][_0x6f9e('0x4c')]?_0x1b3870[_0x6f9e('0x3d')]:_0x312a82[_0x6f9e('0x37')];_0x1b3870[_0x6f9e('0x3f')]=qs[_0x6f9e('0x40')](_0x51e594['query']['sort']);_0x1b3870['where']=qs['filters'](_[_0x6f9e('0x61')](_0x51e594[_0x6f9e('0x38')],_0x312a82['filters']));if(_0x51e594[_0x6f9e('0x38')]['filter']){_0x1b3870[_0x6f9e('0x41')]=_[_0x6f9e('0x42')](_0x1b3870[_0x6f9e('0x41')],{'$or':_['map'](_0x1b3870[_0x6f9e('0x3d')],function(_0x3dcb80){var _0x2a5914={};_0x2a5914[_0x3dcb80]={'$like':'%'+_0x51e594[_0x6f9e('0x38')]['filter']+'%'};return _0x2a5914;})});}_0x1b3870=_[_0x6f9e('0x42')]({},_0x1b3870,_0x51e594['options']);return _0x4fd8db[_0x6f9e('0x95')](_0x1b3870);}})[_0x6f9e('0x26')](function(_0x593fed){if(_0x593fed){_0x177c9c=_0x593fed['length'];if(!_0x51e594[_0x6f9e('0x38')][_0x6f9e('0x63')]('nolimit')){_0x1b3870[_0x6f9e('0x22')]=qs[_0x6f9e('0x22')](_0x51e594[_0x6f9e('0x38')][_0x6f9e('0x22')]);_0x1b3870[_0x6f9e('0x20')]=qs[_0x6f9e('0x20')](_0x51e594[_0x6f9e('0x38')][_0x6f9e('0x20')]);}return _0x4fd8db['getAgents'](_0x1b3870);}})['then'](function(_0x51ffee){if(_0x51ffee){return _0x51ffee?{'count':_0x177c9c,'rows':_0x51ffee}:null;}})[_0x6f9e('0x26')](respondWithResult(_0xe8b88b,null))[_0x6f9e('0x4d')](handleError(_0xe8b88b,null));};exports['getMembers']=function(_0x501694,_0x5449a2,_0x4c51da){var _0x1cc5e8={};var _0x5d9cf8={};var _0x1d6b45;var _0xf2d9ec;return db[_0x6f9e('0x34')]['findOne']({'where':{'id':_0x501694[_0x6f9e('0x4a')]['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0x5449a2,null))[_0x6f9e('0x26')](function(_0x57e888){if(_0x57e888){_0x1d6b45=_0x57e888;_0x5d9cf8[_0x6f9e('0x37')]=_[_0x6f9e('0x39')](db['UserVoiceQueueRt']['rawAttributes']);_0x5d9cf8[_0x6f9e('0x38')]=_[_0x6f9e('0x39')](_0x501694[_0x6f9e('0x38')]);_0x5d9cf8[_0x6f9e('0x3a')]=_['intersection'](_0x5d9cf8['model'],_0x5d9cf8[_0x6f9e('0x38')]);_0x1cc5e8[_0x6f9e('0x3d')]=_[_0x6f9e('0x3b')](_0x5d9cf8[_0x6f9e('0x37')],qs[_0x6f9e('0x3c')](_0x501694[_0x6f9e('0x38')][_0x6f9e('0x3c')]));_0x1cc5e8[_0x6f9e('0x3d')]=_0x1cc5e8[_0x6f9e('0x3d')][_0x6f9e('0x4c')]?_0x1cc5e8['attributes']:_0x5d9cf8[_0x6f9e('0x37')];_0x1cc5e8[_0x6f9e('0x3f')]=qs[_0x6f9e('0x40')](_0x501694[_0x6f9e('0x38')]['sort']);_0x1cc5e8[_0x6f9e('0x41')]=qs[_0x6f9e('0x3a')](_[_0x6f9e('0x61')](_0x501694['query'],_0x5d9cf8[_0x6f9e('0x3a')]));if(_0x501694[_0x6f9e('0x38')][_0x6f9e('0x2a')]){_0x1cc5e8[_0x6f9e('0x41')]=_[_0x6f9e('0x42')](_0x1cc5e8['where'],{'$or':_[_0x6f9e('0x43')](_0x1cc5e8['attributes'],function(_0x3451a3){var _0xc8c878={};_0xc8c878[_0x3451a3]={'$like':'%'+_0x501694[_0x6f9e('0x38')]['filter']+'%'};return _0xc8c878;})});}_0x1cc5e8=_[_0x6f9e('0x42')]({},_0x1cc5e8,_0x501694['options']);return _0x1d6b45[_0x6f9e('0x96')](_0x1cc5e8);}})[_0x6f9e('0x26')](function(_0x440a80){if(_0x440a80){_0xf2d9ec=_0x440a80[_0x6f9e('0x4c')];if(!_0x501694['query'][_0x6f9e('0x63')]('nolimit')){_0x1cc5e8['limit']=qs[_0x6f9e('0x22')](_0x501694['query'][_0x6f9e('0x22')]);_0x1cc5e8['offset']=qs['offset'](_0x501694[_0x6f9e('0x38')][_0x6f9e('0x20')]);}return _0x1d6b45['getMembers'](_0x1cc5e8);}})[_0x6f9e('0x26')](function(_0x4859f3){return _0x4859f3?{'count':_0xf2d9ec,'rows':_0x4859f3}:null;})[_0x6f9e('0x26')](respondWithResult(_0x5449a2,null))[_0x6f9e('0x4d')](handleError(_0x5449a2,null));};exports[_0x6f9e('0x97')]=function(_0x51e4c0,_0x555ef2,_0x4328a4){var _0x3dd36f={};var _0x43129d={};var _0x5bc40e;var _0x4ee2cb;return db[_0x6f9e('0x34')][_0x6f9e('0x5f')]({'where':{'id':_0x51e4c0['params']['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0x555ef2,null))[_0x6f9e('0x26')](function(_0x9b59c5){if(_0x9b59c5){_0x5bc40e=_0x9b59c5;_0x43129d[_0x6f9e('0x37')]=_['keys'](db[_0x6f9e('0x98')][_0x6f9e('0x4b')]);_0x43129d[_0x6f9e('0x38')]=_[_0x6f9e('0x39')](_0x51e4c0[_0x6f9e('0x38')]);_0x43129d[_0x6f9e('0x3a')]=_[_0x6f9e('0x3b')](_0x43129d[_0x6f9e('0x37')],_0x43129d[_0x6f9e('0x38')]);_0x3dd36f[_0x6f9e('0x3d')]=_[_0x6f9e('0x3b')](_0x43129d['model'],qs['fields'](_0x51e4c0[_0x6f9e('0x38')][_0x6f9e('0x3c')]));_0x3dd36f[_0x6f9e('0x3d')]=_0x3dd36f[_0x6f9e('0x3d')][_0x6f9e('0x4c')]?_0x3dd36f[_0x6f9e('0x3d')]:_0x43129d['model'];_0x3dd36f[_0x6f9e('0x3f')]=qs['sort'](_0x51e4c0['query']['sort']);_0x3dd36f['where']=qs['filters'](_[_0x6f9e('0x61')](_0x51e4c0[_0x6f9e('0x38')],_0x43129d[_0x6f9e('0x3a')]));if(_0x51e4c0['query']['filter']){_0x3dd36f[_0x6f9e('0x41')]=_['merge'](_0x3dd36f[_0x6f9e('0x41')],{'$or':_[_0x6f9e('0x43')](_0x3dd36f[_0x6f9e('0x3d')],function(_0x125854){var _0xd9a60a={};_0xd9a60a[_0x125854]={'$like':'%'+_0x51e4c0[_0x6f9e('0x38')][_0x6f9e('0x2a')]+'%'};return _0xd9a60a;})});}_0x3dd36f=_['merge']({},_0x3dd36f,_0x51e4c0['options']);return _0x5bc40e[_0x6f9e('0x97')](_0x3dd36f);}})[_0x6f9e('0x26')](function(_0x4e810c){if(_0x4e810c){_0x4ee2cb=_0x4e810c['length'];if(!_0x51e4c0[_0x6f9e('0x38')]['hasOwnProperty']('nolimit')){_0x3dd36f[_0x6f9e('0x22')]=qs[_0x6f9e('0x22')](_0x51e4c0[_0x6f9e('0x38')][_0x6f9e('0x22')]);_0x3dd36f[_0x6f9e('0x20')]=qs[_0x6f9e('0x20')](_0x51e4c0[_0x6f9e('0x38')][_0x6f9e('0x20')]);}return _0x5bc40e[_0x6f9e('0x97')](_0x3dd36f);}})[_0x6f9e('0x26')](function(_0x719407){if(_0x719407){return _0x719407?{'count':_0x4ee2cb,'rows':_0x719407}:null;}})[_0x6f9e('0x26')](respondWithResult(_0x555ef2,null))[_0x6f9e('0x4d')](handleError(_0x555ef2,null));};exports['addLists']=function(_0x449a09,_0x3dbf04,_0x5b366a){var _0x32911e,_0x320bdb;var _0x1910b4=[];var _0x80ca11=moment()[_0x6f9e('0x79')](_0x6f9e('0x99'));return db[_0x6f9e('0x34')][_0x6f9e('0x2e')]({'where':{'id':_0x449a09[_0x6f9e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3dbf04,null))['then'](function(_0x1770b1){if(_0x1770b1){_0x320bdb=_0x1770b1;return _0x1770b1[_0x6f9e('0x9a')](_0x449a09['body']['ids'],_[_0x6f9e('0x5a')](_0x449a09[_0x6f9e('0x4f')],[_0x6f9e('0x8d'),'id'])||{});}return null;})['spread'](function(_0x1a4b7e){var _0x1eb338;var _0x13c513;_0x32911e=_0x1a4b7e||[];var _0x2bb252=[];if(_0x1a4b7e){for(var _0x631ec=0x0;_0x631ec<_0x1a4b7e[_0x6f9e('0x4c')];_0x631ec+=0x1){var _0x1e135f=_0x1a4b7e[_0x631ec][_0x6f9e('0x27')]({'plain':!![]});_0x320bdb[_0x6f9e('0x9b')]=_0x449a09[_0x6f9e('0x4f')][_0x6f9e('0x9b')]?_0x449a09[_0x6f9e('0x4f')][_0x6f9e('0x9b')]:_0x320bdb['dialCheckDuplicateType'];switch(_0x320bdb[_0x6f9e('0x9b')]){case _0x6f9e('0x9c'):_0x1eb338=squel[_0x6f9e('0x9d')]()[_0x6f9e('0x9e')](_0x6f9e('0x9f'))[_0x6f9e('0xa0')]([_0x6f9e('0xa1'),'scheduledAt',_0x6f9e('0xa2'),'ListId',_0x6f9e('0x64'),_0x6f9e('0x58'),_0x6f9e('0x59')],squel['select']()[_0x6f9e('0x80')](_0x6f9e('0xa1'),'phone')[_0x6f9e('0x80')](_0x6f9e('0xa3'),_0x6f9e('0xa4'))['field']('id',_0x6f9e('0xa2'))[_0x6f9e('0x80')](_0x1e135f[_0x6f9e('0xa5')]['toString'](),_0x6f9e('0xa6'))[_0x6f9e('0x80')](_0x449a09['params']['id'][_0x6f9e('0x89')](),_0x6f9e('0x64'))[_0x6f9e('0x80')]('\x27'+_0x80ca11+'\x27','createdAt')['field']('\x27'+_0x80ca11+'\x27',_0x6f9e('0x59'))[_0x6f9e('0xa7')](_0x6f9e('0xa8'))[_0x6f9e('0x41')](_0x6f9e('0xa9'))[_0x6f9e('0x41')](_0x6f9e('0xaa'),_0x1e135f[_0x6f9e('0xa5')]['toString']())[_0x6f9e('0x41')](_0x6f9e('0xab'))[_0x6f9e('0x41')](_0x6f9e('0xac'),squel[_0x6f9e('0x7f')]()[_0x6f9e('0x80')](_0x6f9e('0xad'))[_0x6f9e('0xa7')](_0x6f9e('0xae'))['where'](_0x6f9e('0x85'),_0x449a09[_0x6f9e('0x4a')]['id'][_0x6f9e('0x89')]()))[_0x6f9e('0x41')](_0x6f9e('0xac'),squel[_0x6f9e('0x7f')]()[_0x6f9e('0x80')](_0x6f9e('0xaf'))['from'](_0x6f9e('0x9f'))[_0x6f9e('0x41')](_0x6f9e('0x85'),_0x449a09[_0x6f9e('0x4a')]['id'][_0x6f9e('0x89')]())))[_0x6f9e('0x89')]();break;case _0x6f9e('0xb0'):_0x1eb338=squel[_0x6f9e('0x9d')]()[_0x6f9e('0x9e')](_0x6f9e('0x9f'))[_0x6f9e('0xa0')](['phone','scheduledAt','ContactId',_0x6f9e('0xa6'),_0x6f9e('0x64'),_0x6f9e('0x58'),_0x6f9e('0x59')],squel['select']()[_0x6f9e('0x80')]('phone','phone')[_0x6f9e('0x80')](_0x6f9e('0xa3'),_0x6f9e('0xa4'))[_0x6f9e('0x80')]('id','ContactId')[_0x6f9e('0x80')](_0x1e135f[_0x6f9e('0xa5')][_0x6f9e('0x89')](),_0x6f9e('0xa6'))[_0x6f9e('0x80')](_0x449a09[_0x6f9e('0x4a')]['id'][_0x6f9e('0x89')](),_0x6f9e('0x64'))[_0x6f9e('0x80')]('\x27'+_0x80ca11+'\x27',_0x6f9e('0x58'))[_0x6f9e('0x80')]('\x27'+_0x80ca11+'\x27',_0x6f9e('0x59'))[_0x6f9e('0xa7')](_0x6f9e('0xa8'))[_0x6f9e('0x41')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x1e135f[_0x6f9e('0xa5')]['toString']())[_0x6f9e('0x41')](_0x6f9e('0xab'))[_0x6f9e('0x41')](_0x6f9e('0xac'),squel['select']()[_0x6f9e('0x80')](_0x6f9e('0xaf'))[_0x6f9e('0xa7')](_0x6f9e('0x9f'))[_0x6f9e('0x41')](_0x6f9e('0x85'),_0x449a09[_0x6f9e('0x4a')]['id']['toString']())))[_0x6f9e('0x89')]();break;default:_0x1eb338=squel[_0x6f9e('0x9d')]()[_0x6f9e('0x9e')](_0x6f9e('0x9f'))['fromQuery']([_0x6f9e('0xa1'),'scheduledAt',_0x6f9e('0xa2'),_0x6f9e('0xa6'),_0x6f9e('0x64'),_0x6f9e('0x58'),_0x6f9e('0x59')],squel[_0x6f9e('0x7f')]()[_0x6f9e('0x80')](_0x6f9e('0xa1'),_0x6f9e('0xa1'))['field'](_0x6f9e('0xa3'),_0x6f9e('0xa4'))[_0x6f9e('0x80')]('id',_0x6f9e('0xa2'))[_0x6f9e('0x80')](_0x1e135f[_0x6f9e('0xa5')][_0x6f9e('0x89')](),_0x6f9e('0xa6'))[_0x6f9e('0x80')](_0x449a09[_0x6f9e('0x4a')]['id'][_0x6f9e('0x89')](),_0x6f9e('0x64'))['field']('\x27'+_0x80ca11+'\x27','createdAt')['field']('\x27'+_0x80ca11+'\x27',_0x6f9e('0x59'))[_0x6f9e('0xa7')]('cm_contacts')[_0x6f9e('0x41')](_0x6f9e('0xa9'))[_0x6f9e('0x41')](_0x6f9e('0xaa'),_0x1e135f[_0x6f9e('0xa5')]['toString']())[_0x6f9e('0x41')](_0x6f9e('0xab')))[_0x6f9e('0x89')]();}_0x13c513=squel['insert']()['into'](_0x6f9e('0xb1'))['fromQuery'](['cmHopperId',_0x6f9e('0xa4'),'phone',_0x6f9e('0xb2'),'createdAt','updatedAt'],squel[_0x6f9e('0x7f')]()[_0x6f9e('0x80')](_0x6f9e('0xb3'),'id')[_0x6f9e('0x80')](_0x6f9e('0xa3'),'scheduledAt')[_0x6f9e('0x80')](_0x6f9e('0xb4'),'phone')[_0x6f9e('0x80')]('ci.OrderBY',_0x6f9e('0xb2'))[_0x6f9e('0x80')]('\x27'+_0x80ca11+'\x27',_0x6f9e('0x58'))[_0x6f9e('0x80')]('\x27'+_0x80ca11+'\x27',_0x6f9e('0x59'))[_0x6f9e('0xa7')]('cm_contact_has_items','ci')['join']('cm_hopper','h',_0x6f9e('0xb5'))[_0x6f9e('0x41')]('h.ListId\x20=\x20?',_0x1e135f['CmListId'][_0x6f9e('0x89')]())[_0x6f9e('0x41')](_0x6f9e('0xb6'),_0x449a09[_0x6f9e('0x4a')]['id'][_0x6f9e('0x89')]())[_0x6f9e('0x41')](_0x6f9e('0xb7'),_0x80ca11))[_0x6f9e('0x89')]();_0x2bb252[_0x6f9e('0x87')](db['sequelize'][_0x6f9e('0x38')](_0x1eb338));_0x1910b4[_0x6f9e('0x87')](db[_0x6f9e('0x88')]['query'](_0x13c513));}return BPromise[_0x6f9e('0x93')](_0x2bb252);}})[_0x6f9e('0x26')](function(){return BPromise[_0x6f9e('0x93')](_0x1910b4);})[_0x6f9e('0x26')](function(){return _0x32911e;})[_0x6f9e('0x26')](respondWithResult(_0x3dbf04,null))[_0x6f9e('0x4d')](handleError(_0x3dbf04,null));};exports[_0x6f9e('0xb8')]=function(_0xbc0227,_0x507d2a,_0x194dd0){return db[_0x6f9e('0x34')][_0x6f9e('0x2e')]({'where':{'id':_0xbc0227[_0x6f9e('0x4a')]['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0x507d2a,null))[_0x6f9e('0x26')](function(_0x19d2cd){if(_0x19d2cd){return _0x19d2cd['removeLists'](_0xbc0227[_0x6f9e('0x38')]['ids']);}})[_0x6f9e('0x26')](function(_0x426949){if(_0x426949){return db[_0x6f9e('0x60')][_0x6f9e('0x2f')]({'where':{'ListId':_0xbc0227['query'][_0x6f9e('0x8d')],'VoiceQueueId':_0xbc0227[_0x6f9e('0x4a')]['id']}})[_0x6f9e('0x26')](function(){return _0x426949;});}})[_0x6f9e('0x26')](respondWithStatusCode(_0x507d2a,null))['catch'](handleError(_0x507d2a,null));};exports[_0x6f9e('0xb9')]=function(_0x27da6d,_0x22f28e,_0x3eb71c){var _0x3344e4={};var _0x384653={};var _0x2ed26f;var _0x493960;return db[_0x6f9e('0x34')][_0x6f9e('0x5f')]({'where':{'id':_0x27da6d[_0x6f9e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x22f28e,null))[_0x6f9e('0x26')](function(_0x5a9877){if(_0x5a9877){_0x2ed26f=_0x5a9877;_0x384653[_0x6f9e('0x37')]=_[_0x6f9e('0x39')](db[_0x6f9e('0x98')]['rawAttributes']);_0x384653[_0x6f9e('0x38')]=_[_0x6f9e('0x39')](_0x27da6d[_0x6f9e('0x38')]);_0x384653[_0x6f9e('0x3a')]=_[_0x6f9e('0x3b')](_0x384653['model'],_0x384653[_0x6f9e('0x38')]);_0x3344e4[_0x6f9e('0x3d')]=_[_0x6f9e('0x3b')](_0x384653[_0x6f9e('0x37')],qs[_0x6f9e('0x3c')](_0x27da6d['query'][_0x6f9e('0x3c')]));_0x3344e4[_0x6f9e('0x3d')]=_0x3344e4[_0x6f9e('0x3d')][_0x6f9e('0x4c')]?_0x3344e4['attributes']:_0x384653[_0x6f9e('0x37')];_0x3344e4['order']=qs[_0x6f9e('0x40')](_0x27da6d[_0x6f9e('0x38')]['sort']);_0x3344e4['where']=qs[_0x6f9e('0x3a')](_[_0x6f9e('0x61')](_0x27da6d[_0x6f9e('0x38')],_0x384653[_0x6f9e('0x3a')]));if(_0x27da6d[_0x6f9e('0x38')][_0x6f9e('0x2a')]){_0x3344e4[_0x6f9e('0x41')]=_[_0x6f9e('0x42')](_0x3344e4[_0x6f9e('0x41')],{'$or':_[_0x6f9e('0x43')](_0x3344e4[_0x6f9e('0x3d')],function(_0x5f8649){var _0x465d8d={};_0x465d8d[_0x5f8649]={'$like':'%'+_0x27da6d[_0x6f9e('0x38')][_0x6f9e('0x2a')]+'%'};return _0x465d8d;})});}_0x3344e4=_['merge']({},_0x3344e4,_0x27da6d[_0x6f9e('0x45')]);return _0x2ed26f[_0x6f9e('0xb9')](_0x3344e4);}})[_0x6f9e('0x26')](function(_0x82b899){if(_0x82b899){_0x493960=_0x82b899['length'];if(!_0x27da6d[_0x6f9e('0x38')]['hasOwnProperty'](_0x6f9e('0x3e'))){_0x3344e4[_0x6f9e('0x22')]=qs[_0x6f9e('0x22')](_0x27da6d[_0x6f9e('0x38')]['limit']);_0x3344e4['offset']=qs[_0x6f9e('0x20')](_0x27da6d[_0x6f9e('0x38')][_0x6f9e('0x20')]);}return _0x2ed26f[_0x6f9e('0xb9')](_0x3344e4);}})['then'](function(_0x40506d){if(_0x40506d){return _0x40506d?{'count':_0x493960,'rows':_0x40506d}:null;}})['then'](respondWithResult(_0x22f28e,null))[_0x6f9e('0x4d')](handleError(_0x22f28e,null));};exports['addBlackLists']=function(_0xaf824d,_0x9eb8c3,_0x378358){var _0x5c23c3,_0x375478;var _0x39361b=[];var _0x13f43c=moment()[_0x6f9e('0x79')](_0x6f9e('0x99'));return db[_0x6f9e('0x34')][_0x6f9e('0x2e')]({'where':{'id':_0xaf824d[_0x6f9e('0x4a')]['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0x9eb8c3,null))[_0x6f9e('0x26')](function(_0x2649ef){if(_0x2649ef){_0x375478=_0x2649ef;return _0x2649ef[_0x6f9e('0xba')](_0xaf824d[_0x6f9e('0x4f')]['ids'],_[_0x6f9e('0x5a')](_0xaf824d[_0x6f9e('0x4f')],[_0x6f9e('0x8d'),'id'])||{});}return null;})['spread'](function(_0x46a40a){var _0x4dbc72;var _0x26895d;_0x5c23c3=_0x46a40a||[];var _0x22bb92=[];if(_0x46a40a){for(var _0x3dab53=0x0;_0x3dab53<_0x46a40a[_0x6f9e('0x4c')];_0x3dab53+=0x1){var _0x3717bc=_0x46a40a[_0x3dab53]['get']({'plain':!![]});_0x4dbc72=squel['insert']()[_0x6f9e('0x9e')](_0x6f9e('0xbb'))[_0x6f9e('0xa0')]([_0x6f9e('0xa1'),_0x6f9e('0xa2'),_0x6f9e('0xa6'),_0x6f9e('0x64'),'createdAt',_0x6f9e('0x59')],squel[_0x6f9e('0x7f')]()[_0x6f9e('0x80')](_0x6f9e('0xa1'),_0x6f9e('0xa1'))[_0x6f9e('0x80')]('id','ContactId')[_0x6f9e('0x80')](_0x3717bc['CmListId']['toString'](),_0x6f9e('0xa6'))[_0x6f9e('0x80')](_0xaf824d[_0x6f9e('0x4a')]['id'][_0x6f9e('0x89')](),_0x6f9e('0x64'))[_0x6f9e('0x80')](_0x6f9e('0xa3'),'createdAt')['field'](_0x6f9e('0xa3'),_0x6f9e('0x59'))[_0x6f9e('0xa7')](_0x6f9e('0xa8'))[_0x6f9e('0x41')](_0x6f9e('0xa9'))[_0x6f9e('0x41')](_0x6f9e('0xaa'),_0x3717bc['CmListId'][_0x6f9e('0x89')]())[_0x6f9e('0x41')](_0x6f9e('0xab')))['toString']();_0x22bb92[_0x6f9e('0x87')](db[_0x6f9e('0x88')][_0x6f9e('0x38')](_0x4dbc72));}return BPromise[_0x6f9e('0x93')](_0x22bb92);}})[_0x6f9e('0x26')](function(){return _0x5c23c3;})['then'](respondWithResult(_0x9eb8c3,null))[_0x6f9e('0x4d')](handleError(_0x9eb8c3,null));};exports['removeBlackLists']=function(_0xafa5e9,_0xcec288,_0x177bc0){return db[_0x6f9e('0x34')][_0x6f9e('0x2e')]({'where':{'id':_0xafa5e9[_0x6f9e('0x4a')]['id']}})[_0x6f9e('0x26')](handleEntityNotFound(_0xcec288,null))['then'](function(_0x1be1d8){if(_0x1be1d8){return _0x1be1d8[_0x6f9e('0xbc')](_0xafa5e9[_0x6f9e('0x38')]['ids']);}})[_0x6f9e('0x26')](function(_0x45baa2){if(_0x45baa2){return db[_0x6f9e('0x68')][_0x6f9e('0x2f')]({'where':{'ListId':_0xafa5e9['query'][_0x6f9e('0x8d')],'VoiceQueueId':_0xafa5e9[_0x6f9e('0x4a')]['id']}})[_0x6f9e('0x26')](function(){return _0x45baa2;});}})[_0x6f9e('0x26')](respondWithStatusCode(_0xcec288,null))[_0x6f9e('0x4d')](handleError(_0xcec288,null));}; \ No newline at end of file +var _0x31bd=['YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','scheduledAt','ContactId','ListId','phone','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','fromQuery','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.VoiceQueueId=?','h.createdAt\x20=\x20?','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','VoiceQueues','outbound','map','value','type','find','name','UserProfileResource','end','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','inbound','findOne','CmHopper','order','VoiceQueueId','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','interface','flatMap','forEach','penalty','Agents','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','SELECT','every','includes','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','SIP/%s','isArray','getAgents','getMembers','getLists','format'];(function(_0x2ac618,_0x797d00){var _0x27c4aa=function(_0x46424a){while(--_0x46424a){_0x2ac618['push'](_0x2ac618['shift']());}};_0x27c4aa(++_0x797d00);}(_0x31bd,0x1b4));var _0xd31b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x31bd[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xd31b('0x0'));var rimraf=require(_0xd31b('0x1'));var zipdir=require(_0xd31b('0x2'));var jsonpatch=require(_0xd31b('0x3'));var rp=require('request-promise');var moment=require(_0xd31b('0x4'));var BPromise=require(_0xd31b('0x5'));var Mustache=require(_0xd31b('0x6'));var util=require('util');var path=require(_0xd31b('0x7'));var sox=require(_0xd31b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd31b('0x9'));var _=require(_0xd31b('0xa'));var squel=require(_0xd31b('0xb'));var crypto=require(_0xd31b('0xc'));var jsforce=require(_0xd31b('0xd'));var deskjs=require(_0xd31b('0xe'));var toCsv=require(_0xd31b('0xf'));var querystring=require(_0xd31b('0x10'));var Papa=require('papaparse');var Redis=require(_0xd31b('0x11'));var authService=require(_0xd31b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd31b('0x13'));var logger=require(_0xd31b('0x14'))('api');var utils=require(_0xd31b('0x15'));var config=require(_0xd31b('0x16'));var licenseUtil=require(_0xd31b('0x17'));var db=require(_0xd31b('0x18'))['db'];config[_0xd31b('0x19')]=_[_0xd31b('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd31b('0x19')]));require('./voiceQueue.socket')[_0xd31b('0x1b')](socket);function respondWithStatusCode(_0x5515b6,_0x6d218b){_0x6d218b=_0x6d218b||0xcc;return function(_0xa5d7b8){if(_0xa5d7b8){return _0x5515b6[_0xd31b('0x1c')](_0x6d218b);}return _0x5515b6[_0xd31b('0x1d')](_0x6d218b)['end']();};}function respondWithResult(_0x250240,_0xbeb818){_0xbeb818=_0xbeb818||0xc8;return function(_0x581073){if(_0x581073){return _0x250240[_0xd31b('0x1d')](_0xbeb818)[_0xd31b('0x1e')](_0x581073);}};}function respondWithFilteredResult(_0x1e0e61,_0x4e8295){return function(_0x3a8b12){if(_0x3a8b12){var _0x379a5e=typeof _0x4e8295[_0xd31b('0x1f')]===_0xd31b('0x20')&&typeof _0x4e8295['limit']===_0xd31b('0x20');var _0x25a287=_0x3a8b12[_0xd31b('0x21')];var _0x451026=_0x379a5e?0x0:_0x4e8295[_0xd31b('0x1f')];var _0x41db03=_0x379a5e?_0x3a8b12[_0xd31b('0x21')]:_0x4e8295[_0xd31b('0x1f')]+_0x4e8295[_0xd31b('0x22')];var _0x43dbf4;if(_0x41db03>=_0x25a287){_0x41db03=_0x25a287;_0x43dbf4=0xc8;}else{_0x43dbf4=0xce;}_0x1e0e61[_0xd31b('0x1d')](_0x43dbf4);return _0x1e0e61['set'](_0xd31b('0x23'),_0x451026+'-'+_0x41db03+'/'+_0x25a287)[_0xd31b('0x1e')](_0x3a8b12);}return null;};}function patchUpdates(_0x402872){return function(_0x4bd4d1){try{jsonpatch[_0xd31b('0x24')](_0x4bd4d1,_0x402872,!![]);}catch(_0x124d5d){return BPromise['reject'](_0x124d5d);}return _0x4bd4d1[_0xd31b('0x25')]();};}function saveUpdates(_0x3dd3c5,_0x577e82){return function(_0x3cc4f1){if(_0x3cc4f1){return _0x3cc4f1[_0xd31b('0x26')](_0x3dd3c5)[_0xd31b('0x27')](function(_0x95486){return _0x95486;});}return null;};}function removeEntity(_0xa2813a,_0x17b9ca){return function(_0x51e912){if(_0x51e912){return _0x51e912[_0xd31b('0x28')]()[_0xd31b('0x27')](function(){var _0x43e61c=_0x51e912['get']({'plain':!![]});var _0x4032f9=[{'name':_0xd31b('0x29'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':_0xd31b('0x2a'),'ignore':![]}];var _0x387862=_(_0x4032f9)['filter']('ignore')[_0xd31b('0x2b')](_0xd31b('0x2c'))[_0xd31b('0x2c')]();if(_['includes'](_0x387862,_0x43e61c[_0xd31b('0x2d')])){return;}var _0x36204c=_[_0xd31b('0x2e')](_0x4032f9,[_0xd31b('0x2c'),_0x43e61c[_0xd31b('0x2d')]])[_0xd31b('0x2f')];return db[_0xd31b('0x30')][_0xd31b('0x28')]({'where':{'type':_0x36204c,'resourceId':_0x43e61c['id']}})[_0xd31b('0x27')](function(){return _0x51e912;});})[_0xd31b('0x27')](function(){_0xa2813a[_0xd31b('0x1d')](0xcc)[_0xd31b('0x31')]();});}};}function handleEntityNotFound(_0x2d533f,_0x3a3ad1){return function(_0x24f19f){if(!_0x24f19f){_0x2d533f[_0xd31b('0x1c')](0x194);}return _0x24f19f;};}function handleError(_0x1ee307,_0x11d436){_0x11d436=_0x11d436||0x1f4;return function(_0x506417){logger[_0xd31b('0x32')](_0x506417[_0xd31b('0x33')]);if(_0x506417[_0xd31b('0x2f')]){delete _0x506417[_0xd31b('0x2f')];}_0x1ee307[_0xd31b('0x1d')](_0x11d436)[_0xd31b('0x34')](_0x506417);};}exports[_0xd31b('0x35')]=function(_0x3975ba,_0x1e4479){var _0x48fa17={},_0x46869c={},_0x5b5565={'count':0x0,'rows':[]};var _0x1fe6c7=_[_0xd31b('0x2b')](db[_0xd31b('0x36')][_0xd31b('0x37')],function(_0x51b64f){return{'name':_0x51b64f[_0xd31b('0x38')],'type':_0x51b64f[_0xd31b('0x2d')][_0xd31b('0x39')]};});_0x46869c['model']=_[_0xd31b('0x2b')](_0x1fe6c7,_0xd31b('0x2f'));_0x46869c['query']=_[_0xd31b('0x3a')](_0x3975ba[_0xd31b('0x3b')]);_0x46869c[_0xd31b('0x3c')]=_[_0xd31b('0x3d')](_0x46869c['model'],_0x46869c[_0xd31b('0x3b')]);_0x48fa17['attributes']=_[_0xd31b('0x3d')](_0x46869c[_0xd31b('0x3e')],qs[_0xd31b('0x3f')](_0x3975ba[_0xd31b('0x3b')][_0xd31b('0x3f')]));_0x48fa17[_0xd31b('0x40')]=_0x48fa17[_0xd31b('0x40')][_0xd31b('0x41')]?_0x48fa17[_0xd31b('0x40')]:_0x46869c[_0xd31b('0x3e')];if(!_0x3975ba[_0xd31b('0x3b')][_0xd31b('0x42')](_0xd31b('0x43'))){_0x48fa17[_0xd31b('0x22')]=qs[_0xd31b('0x22')](_0x3975ba['query'][_0xd31b('0x22')]);_0x48fa17['offset']=qs[_0xd31b('0x1f')](_0x3975ba[_0xd31b('0x3b')]['offset']);}_0x48fa17['order']=qs['sort'](_0x3975ba[_0xd31b('0x3b')][_0xd31b('0x44')]);_0x48fa17[_0xd31b('0x45')]=qs['filters'](_[_0xd31b('0x46')](_0x3975ba[_0xd31b('0x3b')],_0x46869c[_0xd31b('0x3c')]),_0x1fe6c7);if(_0x3975ba[_0xd31b('0x3b')][_0xd31b('0x47')]){_0x48fa17[_0xd31b('0x45')]=_[_0xd31b('0x48')](_0x48fa17['where'],{'$or':_[_0xd31b('0x2b')](_0x1fe6c7,function(_0x25e702){if(_0x25e702['type']!==_0xd31b('0x49')){var _0x257224={};_0x257224[_0x25e702[_0xd31b('0x2f')]]={'$like':'%'+_0x3975ba[_0xd31b('0x3b')][_0xd31b('0x47')]+'%'};return _0x257224;}})});}_0x48fa17=_[_0xd31b('0x48')]({},_0x48fa17,_0x3975ba[_0xd31b('0x4a')]);var _0xcad311={'where':_0x48fa17[_0xd31b('0x45')]};return db[_0xd31b('0x36')][_0xd31b('0x21')](_0xcad311)[_0xd31b('0x27')](function(_0xd4f18){_0x5b5565[_0xd31b('0x21')]=_0xd4f18;if(_0x3975ba[_0xd31b('0x3b')][_0xd31b('0x4b')]){_0x48fa17['include']=[{'all':!![]}];}return db[_0xd31b('0x36')][_0xd31b('0x4c')](_0x48fa17);})[_0xd31b('0x27')](function(_0x2e148a){_0x5b5565['rows']=_0x2e148a;return _0x5b5565;})[_0xd31b('0x27')](respondWithFilteredResult(_0x1e4479,_0x48fa17))[_0xd31b('0x4d')](handleError(_0x1e4479,null));};exports['show']=function(_0x2aa4c8,_0x4760bf){var _0x4b82e6={'raw':![],'where':{'id':_0x2aa4c8[_0xd31b('0x4e')]['id']}},_0x294651={};_0x294651[_0xd31b('0x3e')]=_[_0xd31b('0x3a')](db[_0xd31b('0x36')][_0xd31b('0x37')]);_0x294651[_0xd31b('0x3b')]=_[_0xd31b('0x3a')](_0x2aa4c8[_0xd31b('0x3b')]);_0x294651['filters']=_[_0xd31b('0x3d')](_0x294651[_0xd31b('0x3e')],_0x294651[_0xd31b('0x3b')]);_0x4b82e6[_0xd31b('0x40')]=_['intersection'](_0x294651[_0xd31b('0x3e')],qs[_0xd31b('0x3f')](_0x2aa4c8[_0xd31b('0x3b')]['fields']));_0x4b82e6[_0xd31b('0x40')]=_0x4b82e6[_0xd31b('0x40')][_0xd31b('0x41')]?_0x4b82e6[_0xd31b('0x40')]:_0x294651['model'];if(_0x2aa4c8['query'][_0xd31b('0x4b')]){_0x4b82e6['include']=[{'all':!![]}];}_0x4b82e6=_[_0xd31b('0x48')]({},_0x4b82e6,_0x2aa4c8[_0xd31b('0x4a')]);return db['VoiceQueue'][_0xd31b('0x2e')](_0x4b82e6)[_0xd31b('0x27')](handleEntityNotFound(_0x4760bf,null))['then'](respondWithResult(_0x4760bf,null))['catch'](handleError(_0x4760bf,null));};exports[_0xd31b('0x4f')]=function(_0x44d9b1,_0x3d2368){return db['VoiceQueue']['create'](_0x44d9b1[_0xd31b('0x50')],{})[_0xd31b('0x27')](function(_0x55f262){var _0x289c31=_0x44d9b1[_0xd31b('0x51')][_0xd31b('0x52')]({'plain':!![]});if(!_0x289c31)throw new Error(_0xd31b('0x53'));if(_0x289c31[_0xd31b('0x54')]===_0xd31b('0x51')){var _0x55061d=_0x55f262[_0xd31b('0x52')]({'plain':!![]});var _0x133b96=[{'name':'VoiceQueues','value':'inbound'},{'name':_0xd31b('0x55'),'value':'outbound'}];var _0x18db8b=_[_0xd31b('0x2e')](_0x133b96,[_0xd31b('0x2c'),_0x55061d['type']])[_0xd31b('0x2f')];return db[_0xd31b('0x56')][_0xd31b('0x2e')]({'where':{'name':_0x18db8b,'userProfileId':_0x289c31[_0xd31b('0x57')]},'raw':!![]})['then'](function(_0x449359){if(_0x449359&&_0x449359[_0xd31b('0x58')]===0x0){return db[_0xd31b('0x30')][_0xd31b('0x4f')]({'name':_0x55061d[_0xd31b('0x2f')],'resourceId':_0x55061d['id'],'type':_0x449359['name'],'sectionId':_0x449359['id']},{})['then'](function(){return _0x55f262;});}else{return _0x55f262;}})[_0xd31b('0x4d')](function(_0x3a0eaf){logger[_0xd31b('0x32')](_0xd31b('0x59'),_0x3a0eaf);throw _0x3a0eaf;});}return _0x55f262;})[_0xd31b('0x27')](respondWithResult(_0x3d2368,0xc9))[_0xd31b('0x4d')](handleError(_0x3d2368,null));};exports[_0xd31b('0x5a')]=function(_0x2780a6,_0x5a4b38){var _0x1b0783={'where':{'id':_0x2780a6['params']['id']}},_0xd27335={};_0xd27335[_0xd31b('0x3e')]=_['keys'](db['VoiceQueue'][_0xd31b('0x37')]);_0x1b0783[_0xd31b('0x40')]=_['intersection'](_0xd27335[_0xd31b('0x3e')],qs[_0xd31b('0x3f')](_0x2780a6[_0xd31b('0x3b')][_0xd31b('0x3f')]));_0x1b0783[_0xd31b('0x40')]=_0x1b0783[_0xd31b('0x40')][_0xd31b('0x41')]?_0x1b0783['attributes']:_0xd27335['model'];if(_0x2780a6[_0xd31b('0x3b')][_0xd31b('0x4b')]){_0x1b0783[_0xd31b('0x5b')]=[{'all':!![]}];}_0x1b0783=_['merge']({},_0x1b0783,_0x2780a6[_0xd31b('0x4a')]);return db[_0xd31b('0x36')][_0xd31b('0x2e')](_0x1b0783)[_0xd31b('0x27')](handleEntityNotFound(_0x5a4b38,null))[_0xd31b('0x27')](function(_0x4ea48a){if(_0x4ea48a){var _0x16f445=_0x4ea48a['get']({'plain':!![]});_0x16f445=qs[_0xd31b('0x5c')](_0x16f445,['id',_0xd31b('0x5d'),_0xd31b('0x5e')]);_0x2780a6[_0xd31b('0x50')]=_['omit'](_0x2780a6['body'],['id','createdAt',_0xd31b('0x5e')]);return db[_0xd31b('0x36')]['create'](_['merge'](_0x16f445,_0x2780a6[_0xd31b('0x50')]),{'include':_0x2780a6[_0xd31b('0x3b')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x54f612){var _0x2c7fac=_0x2780a6['user'][_0xd31b('0x52')]({'plain':!![]});if(!_0x2c7fac)throw new Error(_0xd31b('0x53'));if(_0x2c7fac['role']===_0xd31b('0x51')){var _0x993dd8=_0x54f612[_0xd31b('0x52')]({'plain':!![]});var _0x387b01=[{'name':'VoiceQueues','value':_0xd31b('0x5f')},{'name':_0xd31b('0x55'),'value':_0xd31b('0x2a')}];var _0x16e0c3=_[_0xd31b('0x2e')](_0x387b01,[_0xd31b('0x2c'),_0x993dd8[_0xd31b('0x2d')]])[_0xd31b('0x2f')];return db[_0xd31b('0x56')][_0xd31b('0x2e')]({'where':{'name':_0x16e0c3,'userProfileId':_0x2c7fac[_0xd31b('0x57')]},'raw':!![]})[_0xd31b('0x27')](function(_0x3acef9){if(_0x3acef9&&_0x3acef9['autoAssociation']===0x0){return db[_0xd31b('0x30')]['create']({'name':_0x993dd8[_0xd31b('0x2f')],'resourceId':_0x993dd8['id'],'type':_0x3acef9['name'],'sectionId':_0x3acef9['id']},{})['then'](function(){return _0x54f612;});}else{return _0x54f612;}})[_0xd31b('0x4d')](function(_0x20df73){logger[_0xd31b('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20df73);throw _0x20df73;});}return _0x54f612;});}})[_0xd31b('0x27')](respondWithResult(_0x5a4b38,0xc9))[_0xd31b('0x4d')](handleError(_0x5a4b38,null));};exports[_0xd31b('0x26')]=function(_0x4c7faa,_0x418914){if(_0x4c7faa[_0xd31b('0x50')]['id']){delete _0x4c7faa[_0xd31b('0x50')]['id'];}return db[_0xd31b('0x36')][_0xd31b('0x2e')]({'where':{'id':_0x4c7faa['params']['id']}})['then'](handleEntityNotFound(_0x418914,null))[_0xd31b('0x27')](saveUpdates(_0x4c7faa[_0xd31b('0x50')],null))['then'](respondWithResult(_0x418914,null))[_0xd31b('0x4d')](handleError(_0x418914,null));};exports['destroy']=function(_0x3e9f87,_0x50af26){return db['VoiceQueue'][_0xd31b('0x2e')]({'where':{'id':_0x3e9f87[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](handleEntityNotFound(_0x50af26,null))[_0xd31b('0x27')](removeEntity(_0x50af26,null))[_0xd31b('0x4d')](handleError(_0x50af26,null));};exports['getHoppers']=function(_0x104fc8,_0x39d1f1,_0x270792){var _0x1b4685={'raw':![],'where':{}};var _0x2be559={};var _0xfa7d01={'count':0x0,'rows':[]};return db[_0xd31b('0x36')][_0xd31b('0x60')]({'where':{'id':_0x104fc8[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](handleEntityNotFound(_0x39d1f1,null))[_0xd31b('0x27')](function(_0x123a57){if(_0x123a57){_0x2be559[_0xd31b('0x3e')]=_[_0xd31b('0x3a')](db[_0xd31b('0x61')][_0xd31b('0x37')]);_0x2be559[_0xd31b('0x3b')]=_['keys'](_0x104fc8[_0xd31b('0x3b')]);_0x2be559[_0xd31b('0x3c')]=_[_0xd31b('0x3d')](_0x2be559[_0xd31b('0x3e')],_0x2be559[_0xd31b('0x3b')]);_0x1b4685[_0xd31b('0x40')]=_['intersection'](_0x2be559[_0xd31b('0x3e')],qs[_0xd31b('0x3f')](_0x104fc8[_0xd31b('0x3b')][_0xd31b('0x3f')]));_0x1b4685['attributes']=_0x1b4685[_0xd31b('0x40')][_0xd31b('0x41')]?_0x1b4685[_0xd31b('0x40')]:_0x2be559['model'];if(!_0x104fc8['query']['hasOwnProperty']('nolimit')){_0x1b4685['limit']=qs[_0xd31b('0x22')](_0x104fc8[_0xd31b('0x3b')]['limit']);_0x1b4685[_0xd31b('0x1f')]=qs[_0xd31b('0x1f')](_0x104fc8[_0xd31b('0x3b')][_0xd31b('0x1f')]);}_0x1b4685[_0xd31b('0x62')]=qs[_0xd31b('0x44')](_0x104fc8['query'][_0xd31b('0x44')]);_0x1b4685[_0xd31b('0x45')]=qs[_0xd31b('0x3c')](_[_0xd31b('0x46')](_0x104fc8[_0xd31b('0x3b')],_0x2be559['filters']));_0x1b4685[_0xd31b('0x45')][_0xd31b('0x63')]=_0x123a57['id'];if(_0x104fc8[_0xd31b('0x3b')][_0xd31b('0x47')]){_0x1b4685[_0xd31b('0x45')]=_[_0xd31b('0x48')](_0x1b4685[_0xd31b('0x45')],{'$or':_[_0xd31b('0x2b')](_0x1b4685['attributes'],function(_0x203a14){var _0x43a3b3={};_0x43a3b3[_0x203a14]={'$like':'%'+_0x104fc8[_0xd31b('0x3b')][_0xd31b('0x47')]+'%'};return _0x43a3b3;})});}_0x1b4685=_[_0xd31b('0x48')]({},_0x1b4685,_0x104fc8[_0xd31b('0x4a')]);return db[_0xd31b('0x61')][_0xd31b('0x21')]({'where':_0x1b4685[_0xd31b('0x45')]})['then'](function(_0x28ca2b){_0xfa7d01[_0xd31b('0x21')]=_0x28ca2b;if(_0x104fc8[_0xd31b('0x3b')]['includeAll']){_0x1b4685[_0xd31b('0x5b')]=[{'all':!![]}];}return db[_0xd31b('0x61')][_0xd31b('0x4c')](_0x1b4685);})[_0xd31b('0x27')](function(_0x557e4d){_0xfa7d01[_0xd31b('0x64')]=_0x557e4d;return _0xfa7d01;});}})['then'](respondWithFilteredResult(_0x39d1f1,_0x1b4685))[_0xd31b('0x4d')](handleError(_0x39d1f1,null));};exports['getHopperHistories']=function(_0x5d3f04,_0x111e04,_0x4e14c0){var _0x6ee80b={'raw':!![],'where':{}};var _0x5dd375={};var _0x55a446={'count':0x0,'rows':[]};return db[_0xd31b('0x36')][_0xd31b('0x60')]({'where':{'id':_0x5d3f04[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](handleEntityNotFound(_0x111e04,null))[_0xd31b('0x27')](function(_0x19971a){if(_0x19971a){_0x5dd375[_0xd31b('0x3e')]=_[_0xd31b('0x3a')](db[_0xd31b('0x65')][_0xd31b('0x37')]);_0x5dd375[_0xd31b('0x3b')]=_[_0xd31b('0x3a')](_0x5d3f04[_0xd31b('0x3b')]);_0x5dd375[_0xd31b('0x3c')]=_[_0xd31b('0x3d')](_0x5dd375[_0xd31b('0x3e')],_0x5dd375[_0xd31b('0x3b')]);_0x6ee80b[_0xd31b('0x40')]=_[_0xd31b('0x3d')](_0x5dd375[_0xd31b('0x3e')],qs[_0xd31b('0x3f')](_0x5d3f04[_0xd31b('0x3b')][_0xd31b('0x3f')]));_0x6ee80b[_0xd31b('0x40')]=_0x6ee80b[_0xd31b('0x40')][_0xd31b('0x41')]?_0x6ee80b[_0xd31b('0x40')]:_0x5dd375['model'];if(!_0x5d3f04['query']['hasOwnProperty']('nolimit')){_0x6ee80b['limit']=qs['limit'](_0x5d3f04['query']['limit']);_0x6ee80b[_0xd31b('0x1f')]=qs[_0xd31b('0x1f')](_0x5d3f04[_0xd31b('0x3b')][_0xd31b('0x1f')]);}_0x6ee80b[_0xd31b('0x62')]=qs['sort'](_0x5d3f04['query']['sort']);_0x6ee80b['where']=qs[_0xd31b('0x3c')](_[_0xd31b('0x46')](_0x5d3f04[_0xd31b('0x3b')],_0x5dd375[_0xd31b('0x3c')]));_0x6ee80b[_0xd31b('0x45')][_0xd31b('0x63')]=_0x19971a['id'];if(_0x5d3f04['query']['filter']){_0x6ee80b[_0xd31b('0x45')]=_['merge'](_0x6ee80b[_0xd31b('0x45')],{'$or':_[_0xd31b('0x2b')](_0x6ee80b[_0xd31b('0x40')],function(_0x178f78){var _0x19f88d={};_0x19f88d[_0x178f78]={'$like':'%'+_0x5d3f04[_0xd31b('0x3b')][_0xd31b('0x47')]+'%'};return _0x19f88d;})});}_0x6ee80b=_['merge']({},_0x6ee80b,_0x5d3f04[_0xd31b('0x4a')]);return db[_0xd31b('0x65')][_0xd31b('0x21')]({'where':_0x6ee80b[_0xd31b('0x45')]})[_0xd31b('0x27')](function(_0x3ddfa6){_0x55a446['count']=_0x3ddfa6;if(_0x5d3f04['query'][_0xd31b('0x4b')]){_0x6ee80b[_0xd31b('0x5b')]=[{'all':!![]}];}return db[_0xd31b('0x65')][_0xd31b('0x4c')](_0x6ee80b);})[_0xd31b('0x27')](function(_0x15323c){_0x55a446['rows']=_0x15323c;return _0x55a446;});}})[_0xd31b('0x27')](respondWithFilteredResult(_0x111e04,_0x6ee80b))[_0xd31b('0x4d')](handleError(_0x111e04,null));};exports[_0xd31b('0x66')]=function(_0x1c9ff6,_0x413149,_0x57513f){var _0x254087={'raw':!![],'where':{}};var _0x104094={};var _0xdfcd04={'count':0x0,'rows':[]};return db[_0xd31b('0x36')]['findOne']({'where':{'id':_0x1c9ff6[_0xd31b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x413149,null))[_0xd31b('0x27')](function(_0x55a212){if(_0x55a212){_0x104094[_0xd31b('0x3e')]=_[_0xd31b('0x3a')](db['CmHopperFinal'][_0xd31b('0x37')]);_0x104094[_0xd31b('0x3b')]=_[_0xd31b('0x3a')](_0x1c9ff6[_0xd31b('0x3b')]);_0x104094[_0xd31b('0x3c')]=_[_0xd31b('0x3d')](_0x104094[_0xd31b('0x3e')],_0x104094[_0xd31b('0x3b')]);_0x254087[_0xd31b('0x40')]=_['intersection'](_0x104094[_0xd31b('0x3e')],qs[_0xd31b('0x3f')](_0x1c9ff6[_0xd31b('0x3b')][_0xd31b('0x3f')]));_0x254087[_0xd31b('0x40')]=_0x254087[_0xd31b('0x40')][_0xd31b('0x41')]?_0x254087[_0xd31b('0x40')]:_0x104094[_0xd31b('0x3e')];if(!_0x1c9ff6[_0xd31b('0x3b')]['hasOwnProperty'](_0xd31b('0x43'))){_0x254087['limit']=qs[_0xd31b('0x22')](_0x1c9ff6[_0xd31b('0x3b')]['limit']);_0x254087[_0xd31b('0x1f')]=qs['offset'](_0x1c9ff6['query'][_0xd31b('0x1f')]);}_0x254087['order']=qs[_0xd31b('0x44')](_0x1c9ff6[_0xd31b('0x3b')][_0xd31b('0x44')]);_0x254087[_0xd31b('0x45')]=qs[_0xd31b('0x3c')](_[_0xd31b('0x46')](_0x1c9ff6[_0xd31b('0x3b')],_0x104094[_0xd31b('0x3c')]));_0x254087['where']['VoiceQueueId']=_0x55a212['id'];if(_0x1c9ff6[_0xd31b('0x3b')]['filter']){_0x254087[_0xd31b('0x45')]=_[_0xd31b('0x48')](_0x254087[_0xd31b('0x45')],{'$or':_['map'](_0x254087[_0xd31b('0x40')],function(_0x2f9158){var _0x1f0941={};_0x1f0941[_0x2f9158]={'$like':'%'+_0x1c9ff6[_0xd31b('0x3b')][_0xd31b('0x47')]+'%'};return _0x1f0941;})});}_0x254087=_[_0xd31b('0x48')]({},_0x254087,_0x1c9ff6[_0xd31b('0x4a')]);return db[_0xd31b('0x67')][_0xd31b('0x21')]({'where':_0x254087[_0xd31b('0x45')]})[_0xd31b('0x27')](function(_0x4b5ec2){_0xdfcd04[_0xd31b('0x21')]=_0x4b5ec2;if(_0x1c9ff6[_0xd31b('0x3b')][_0xd31b('0x4b')]){_0x254087[_0xd31b('0x5b')]=[{'all':!![]}];}return db[_0xd31b('0x67')][_0xd31b('0x4c')](_0x254087);})['then'](function(_0x24a71d){_0xdfcd04[_0xd31b('0x64')]=_0x24a71d;return _0xdfcd04;});}})['then'](respondWithFilteredResult(_0x413149,_0x254087))['catch'](handleError(_0x413149,null));};exports[_0xd31b('0x68')]=function(_0x20ad66,_0x2879a4,_0xec1851){var _0x1faa9d={'raw':!![],'where':{}};var _0x294175={};var _0x1ef23f={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x20ad66[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](handleEntityNotFound(_0x2879a4,null))[_0xd31b('0x27')](function(_0x55546f){if(_0x55546f){_0x294175['model']=_[_0xd31b('0x3a')](db['CmHopperBlack']['rawAttributes']);_0x294175['query']=_[_0xd31b('0x3a')](_0x20ad66[_0xd31b('0x3b')]);_0x294175[_0xd31b('0x3c')]=_['intersection'](_0x294175[_0xd31b('0x3e')],_0x294175[_0xd31b('0x3b')]);_0x1faa9d['attributes']=_[_0xd31b('0x3d')](_0x294175[_0xd31b('0x3e')],qs['fields'](_0x20ad66[_0xd31b('0x3b')][_0xd31b('0x3f')]));_0x1faa9d[_0xd31b('0x40')]=_0x1faa9d[_0xd31b('0x40')][_0xd31b('0x41')]?_0x1faa9d[_0xd31b('0x40')]:_0x294175[_0xd31b('0x3e')];if(!_0x20ad66[_0xd31b('0x3b')][_0xd31b('0x42')](_0xd31b('0x43'))){_0x1faa9d[_0xd31b('0x22')]=qs[_0xd31b('0x22')](_0x20ad66[_0xd31b('0x3b')][_0xd31b('0x22')]);_0x1faa9d['offset']=qs[_0xd31b('0x1f')](_0x20ad66[_0xd31b('0x3b')][_0xd31b('0x1f')]);}_0x1faa9d[_0xd31b('0x62')]=qs[_0xd31b('0x44')](_0x20ad66[_0xd31b('0x3b')][_0xd31b('0x44')]);_0x1faa9d[_0xd31b('0x45')]=qs[_0xd31b('0x3c')](_['pick'](_0x20ad66[_0xd31b('0x3b')],_0x294175[_0xd31b('0x3c')]));_0x1faa9d[_0xd31b('0x45')][_0xd31b('0x63')]=_0x55546f['id'];if(_0x20ad66[_0xd31b('0x3b')][_0xd31b('0x47')]){_0x1faa9d['where']=_[_0xd31b('0x48')](_0x1faa9d[_0xd31b('0x45')],{'$or':_[_0xd31b('0x2b')](_0x1faa9d[_0xd31b('0x40')],function(_0xd73c14){var _0x908358={};_0x908358[_0xd73c14]={'$like':'%'+_0x20ad66[_0xd31b('0x3b')][_0xd31b('0x47')]+'%'};return _0x908358;})});}_0x1faa9d=_['merge']({},_0x1faa9d,_0x20ad66['options']);return db[_0xd31b('0x69')][_0xd31b('0x21')]({'where':_0x1faa9d[_0xd31b('0x45')]})['then'](function(_0x4d8b2d){_0x1ef23f[_0xd31b('0x21')]=_0x4d8b2d;if(_0x20ad66[_0xd31b('0x3b')][_0xd31b('0x4b')]){_0x1faa9d[_0xd31b('0x5b')]=[{'all':!![]}];}return db[_0xd31b('0x69')][_0xd31b('0x4c')](_0x1faa9d);})[_0xd31b('0x27')](function(_0x1fd154){_0x1ef23f[_0xd31b('0x64')]=_0x1fd154;return _0x1ef23f;});}})[_0xd31b('0x27')](respondWithFilteredResult(_0x2879a4,_0x1faa9d))[_0xd31b('0x4d')](handleError(_0x2879a4,null));};exports[_0xd31b('0x6a')]=function(_0x46a990,_0x2f743a,_0x1e65bc){var _0x268acf={};var _0x53322c={};var _0xd30eda;var _0x256225;return db[_0xd31b('0x36')][_0xd31b('0x60')]({'where':{'id':_0x46a990['params']['id']}})[_0xd31b('0x27')](handleEntityNotFound(_0x2f743a,null))[_0xd31b('0x27')](function(_0x5a8fca){if(_0x5a8fca){_0xd30eda=_0x5a8fca;_0x53322c[_0xd31b('0x3e')]=_[_0xd31b('0x3a')](db[_0xd31b('0x6b')]['rawAttributes']);_0x53322c[_0xd31b('0x3b')]=_[_0xd31b('0x3a')](_0x46a990['query']);_0x53322c[_0xd31b('0x3c')]=_[_0xd31b('0x3d')](_0x53322c[_0xd31b('0x3e')],_0x53322c[_0xd31b('0x3b')]);_0x268acf[_0xd31b('0x40')]=_[_0xd31b('0x3d')](_0x53322c[_0xd31b('0x3e')],qs[_0xd31b('0x3f')](_0x46a990[_0xd31b('0x3b')]['fields']));_0x268acf[_0xd31b('0x40')]=_0x268acf[_0xd31b('0x40')][_0xd31b('0x41')]?_0x268acf[_0xd31b('0x40')]:_0x53322c[_0xd31b('0x3e')];_0x268acf[_0xd31b('0x62')]=qs[_0xd31b('0x44')](_0x46a990[_0xd31b('0x3b')][_0xd31b('0x44')]);_0x268acf[_0xd31b('0x45')]=qs[_0xd31b('0x3c')](_[_0xd31b('0x46')](_0x46a990[_0xd31b('0x3b')],_0x53322c[_0xd31b('0x3c')]));if(_0x46a990[_0xd31b('0x3b')][_0xd31b('0x47')]){_0x268acf[_0xd31b('0x45')]=_[_0xd31b('0x48')](_0x268acf[_0xd31b('0x45')],{'$or':_[_0xd31b('0x2b')](_0x268acf['attributes'],function(_0x1ffbaa){var _0x1e8742={};_0x1e8742[_0x1ffbaa]={'$like':'%'+_0x46a990['query']['filter']+'%'};return _0x1e8742;})});}_0x268acf=_[_0xd31b('0x48')]({},_0x268acf,_0x46a990[_0xd31b('0x4a')]);return _0xd30eda[_0xd31b('0x6a')](_0x268acf);}})[_0xd31b('0x27')](function(_0x2a4e8b){if(_0x2a4e8b){_0x256225=_0x2a4e8b[_0xd31b('0x41')];if(!_0x46a990['query'][_0xd31b('0x42')](_0xd31b('0x43'))){_0x268acf['limit']=qs[_0xd31b('0x22')](_0x46a990[_0xd31b('0x3b')][_0xd31b('0x22')]);_0x268acf[_0xd31b('0x1f')]=qs[_0xd31b('0x1f')](_0x46a990[_0xd31b('0x3b')][_0xd31b('0x1f')]);}return _0xd30eda[_0xd31b('0x6a')](_0x268acf);}})['then'](function(_0x466915){if(_0x466915){return _0x466915?{'count':_0x256225,'rows':_0x466915}:null;}})[_0xd31b('0x27')](respondWithResult(_0x2f743a,null))[_0xd31b('0x4d')](handleError(_0x2f743a,null));};exports[_0xd31b('0x6c')]=function(_0x50004d,_0x49c0cd,_0x1d15d7){var _0x24e297=_0x50004d[_0xd31b('0x50')][_0xd31b('0x6d')];var _0x4b8cd3=_['map'](_0x24e297,'id');return db[_0xd31b('0x6b')]['findAll']({'where':{'id':_0x4b8cd3},'attributes':['id'],'include':[{'model':db[_0xd31b('0x6e')],'as':'Agents','attributes':['id',_0xd31b('0x2f'),_0xd31b('0x6f'),'voicePause',_0xd31b('0x70')],'raw':!![]}]})[_0xd31b('0x27')](function(_0x8c2ee9){if(_0x8c2ee9){var _0x46f40c=_[_0xd31b('0x71')](_0x8c2ee9,function(_0x55f75c){var _0x46f6be=_0x55f75c['get']({'plain':!![]});_0x46f6be['Agents'][_0xd31b('0x72')](function(_0x2e6b20){_0x2e6b20[_0xd31b('0x73')]=_[_0xd31b('0x2e')](_0x24e297,{'id':_0x46f6be['id']})['penalty'];});return _0x46f6be[_0xd31b('0x74')];});return db['VoiceQueue'][_0xd31b('0x2e')]({'where':{'id':_0x50004d[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](function(_0x2d013e){return db[_0xd31b('0x75')][_0xd31b('0x76')](function(_0x1fe556){return _0x2d013e['addTeams'](_0x4b8cd3,{'transaction':_0x1fe556})['then'](function(){return BPromise[_0xd31b('0x77')](_0x24e297,function(_0x154ef2){return db[_0xd31b('0x78')][_0xd31b('0x79')]({'TeamId':_0x154ef2['id'],'VoiceQueueId':_0x50004d[_0xd31b('0x4e')]['id'],'penalty':_0x154ef2[_0xd31b('0x73')]},{'transaction':_0x1fe556});});})['then'](function(){return BPromise[_0xd31b('0x77')](_0x46f40c,function(_0x4d7896){return db[_0xd31b('0x7a')][_0xd31b('0x7b')]({'where':{'UserId':_0x4d7896['id'],'VoiceQueueId':_0x50004d[_0xd31b('0x4e')]['id']},'defaults':{'penalty':_0x4d7896[_0xd31b('0x73')]},'transaction':_0x1fe556});});})[_0xd31b('0x27')](function(){return BPromise['each'](_[_0xd31b('0x47')](_0x46f40c,{'online':!![]}),function(_0x396dc8){return db[_0xd31b('0x7c')][_0xd31b('0x79')]({'membername':_0x396dc8['name'],'UserId':_0x396dc8['id'],'queue_name':_0x2d013e[_0xd31b('0x2f')],'VoiceQueueId':_0x2d013e['id'],'interface':_[_0xd31b('0x7d')](_0x396dc8[_0xd31b('0x70')])?util['format']('SIP/%s',_0x396dc8['name']):_0x396dc8['interface'],'paused':_0x396dc8[_0xd31b('0x7e')]||![],'penalty':_0x396dc8[_0xd31b('0x73')]},{'transaction':_0x1fe556});});})[_0xd31b('0x27')](function(){_0x46f40c[_0xd31b('0x72')](function(_0x542e74){socket[_0xd31b('0x7f')](_0xd31b('0x80'),{'UserId':_0x542e74['id'],'VoiceQueueId':_0x2d013e['id']});});});});});}})[_0xd31b('0x27')](respondWithStatusCode(_0x49c0cd,null))[_0xd31b('0x4d')](handleError(_0x49c0cd,null));};exports[_0xd31b('0x81')]=function(_0x434d1c,_0x366700,_0x2b8d95){return db[_0xd31b('0x6b')][_0xd31b('0x4c')]({'where':{'id':_0x434d1c[_0xd31b('0x3b')][_0xd31b('0x82')]},'attributes':['id'],'include':[{'model':db[_0xd31b('0x6e')],'as':_0xd31b('0x74'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x366700,null))['then'](function(_0x10ff73){var _0x3aac14=_[_0xd31b('0x2b')](_0x10ff73,'id');var _0x431c5c=[];var _0x237f11=[];var _0x328745=squel[_0xd31b('0x83')]();_0x328745[_0xd31b('0x84')]('tq.TeamId')[_0xd31b('0x85')]('team_has_voice_queues','tq')[_0xd31b('0x86')](_0xd31b('0x87'),'ut',_0xd31b('0x88'))[_0xd31b('0x45')]('VoiceQueueId\x20=\x20?',_0x434d1c['params']['id']);for(var _0x114b16=0x0;_0x114b16<_0x10ff73[_0xd31b('0x41')];_0x114b16+=0x1){let _0x256238=_0x10ff73[_0x114b16];for(var _0x2e6a4b=0x0;_0x2e6a4b<_0x256238['Agents'][_0xd31b('0x41')];_0x2e6a4b+=0x1){let _0x4f18b3=_0x256238['Agents'][_0x2e6a4b];var _0x982073=_0x328745[_0xd31b('0x5a')]();_0x982073[_0xd31b('0x45')](_0xd31b('0x89'),_0x4f18b3['id']);_0x237f11[_0xd31b('0x8a')](db[_0xd31b('0x75')]['query'](_0x982073['toString'](),{'type':db[_0xd31b('0x75')]['QueryTypes'][_0xd31b('0x8b')]})[_0xd31b('0x27')](function(_0x5e3172){if(_0x5e3172['length']===0x1){return _0x4f18b3['id'];}else{var _0x38ff04=_[_0xd31b('0x8c')](_['map'](_0x5e3172,'TeamId'),function(_0x2c1429){return _[_0xd31b('0x8d')](_0x3aac14,_0x2c1429);});if(_0x38ff04){return _0x4f18b3['id'];}}}));}}return BPromise['all'](_0x237f11)['then'](function(_0x1037d0){_0x431c5c=_(_0x431c5c)[_0xd31b('0x8e')](_0x1037d0)[_0xd31b('0x8f')]()[_0xd31b('0x2c')]();return db[_0xd31b('0x36')]['find']({'where':{'id':_0x434d1c[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](function(_0x3f753d){return db[_0xd31b('0x75')][_0xd31b('0x76')](function(_0x59040a){return _0x3f753d[_0xd31b('0x81')](_0x434d1c[_0xd31b('0x3b')][_0xd31b('0x82')],{'transaction':_0x59040a})[_0xd31b('0x27')](function(){if(!_[_0xd31b('0x90')](_0x431c5c)){return _0x3f753d[_0xd31b('0x91')](_0x431c5c,{'transaction':_0x59040a})[_0xd31b('0x27')](function(){return db[_0xd31b('0x7c')][_0xd31b('0x28')]({'where':{'VoiceQueueId':_0x434d1c[_0xd31b('0x4e')]['id'],'UserId':_0x431c5c},'transaction':_0x59040a});});}})[_0xd31b('0x27')](function(){_0x431c5c['forEach'](function(_0x4078c6){socket['emit'](_0xd31b('0x92'),{'UserId':_0x4078c6,'VoiceQueueId':_0x3f753d['id']});});});});});});})[_0xd31b('0x27')](respondWithStatusCode(_0x366700,null))[_0xd31b('0x4d')](handleError(_0x366700,null));};exports[_0xd31b('0x93')]=function(_0x26159f,_0x11a16a,_0x2ca536){var _0xdf89f4,_0x15c5fa;return db['VoiceQueue'][_0xd31b('0x2e')]({'where':{'id':_0x26159f[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](handleEntityNotFound(_0x11a16a,null))[_0xd31b('0x27')](function(_0x565b13){if(_0x565b13){_0x15c5fa=_0x565b13;return _0x565b13['addAgents'](_0x26159f[_0xd31b('0x50')]['ids'],_[_0xd31b('0x5c')](_0x26159f[_0xd31b('0x50')],[_0xd31b('0x82'),'id'])||{})[_0xd31b('0x94')](function(_0x13f59b){for(var _0x54545c=0x0;_0x54545c<_0x26159f[_0xd31b('0x50')][_0xd31b('0x82')]['length'];_0x54545c+=0x1){socket['emit'](_0xd31b('0x80'),{'UserId':_0x26159f[_0xd31b('0x50')]['ids'][_0x54545c],'VoiceQueueId':_0x26159f[_0xd31b('0x4e')]['id']});}return _0x13f59b;});}})[_0xd31b('0x27')](function(_0x47dc78){_0xdf89f4=_0x47dc78||[];if(_0x15c5fa){return db[_0xd31b('0x6e')][_0xd31b('0x4c')]({'where':{'id':_0x26159f[_0xd31b('0x50')][_0xd31b('0x82')]},'attributes':['id',_0xd31b('0x2f'),_0xd31b('0x6f'),_0xd31b('0x7e'),_0xd31b('0x70')],'raw':!![]});}})[_0xd31b('0x27')](function(_0x45248d){if(!_[_0xd31b('0x90')](_0x45248d)){var _0x210100=[];for(var _0x5c1a76=0x0;_0x5c1a76<_0x45248d['length'];_0x5c1a76++){if(_0x45248d[_0x5c1a76][_0xd31b('0x6f')]){_0x210100[_0xd31b('0x8a')](db['UserVoiceQueueRt'][_0xd31b('0x79')]({'membername':_0x45248d[_0x5c1a76][_0xd31b('0x2f')],'UserId':_0x45248d[_0x5c1a76]['id'],'queue_name':_0x15c5fa['name'],'VoiceQueueId':_0x15c5fa['id'],'interface':_['isNil'](_0x45248d[_0x5c1a76][_0xd31b('0x70')])?util['format'](_0xd31b('0x95'),_0x45248d[_0x5c1a76]['name']):_0x45248d[_0x5c1a76][_0xd31b('0x70')],'paused':_0x45248d[_0x5c1a76][_0xd31b('0x7e')]||![],'penalty':_0x26159f[_0xd31b('0x50')]['penalty']||0x0}));}}return BPromise['all'](_0x210100);}})['then'](function(){return _0xdf89f4;})['then'](respondWithResult(_0x11a16a,null))['catch'](handleError(_0x11a16a,null));};exports[_0xd31b('0x91')]=function(_0x21c064,_0x3599eb,_0x2bde73){return db[_0xd31b('0x36')][_0xd31b('0x2e')]({'where':{'id':_0x21c064[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](handleEntityNotFound(_0x3599eb,null))['then'](function(_0x2b8a6b){if(_0x2b8a6b){return _0x2b8a6b[_0xd31b('0x91')](_0x21c064['query'][_0xd31b('0x82')])[_0xd31b('0x27')](function(){if(_[_0xd31b('0x96')](_0x21c064[_0xd31b('0x3b')][_0xd31b('0x82')])){for(var _0x52c0ed=0x0;_0x52c0ed<_0x21c064[_0xd31b('0x3b')]['ids'][_0xd31b('0x41')];_0x52c0ed+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x21c064[_0xd31b('0x3b')][_0xd31b('0x82')][_0x52c0ed]),'VoiceQueueId':Number(_0x21c064['params']['id'])});}}else{socket[_0xd31b('0x7f')](_0xd31b('0x92'),{'UserId':Number(_0x21c064['query'][_0xd31b('0x82')]),'VoiceQueueId':Number(_0x21c064['params']['id'])});}});}})[_0xd31b('0x27')](function(_0x3f5b20){return db[_0xd31b('0x7c')][_0xd31b('0x28')]({'where':{'VoiceQueueId':_0x21c064['params']['id'],'UserId':_0x21c064['query'][_0xd31b('0x82')]}})['then'](function(){return _0x3f5b20;});})[_0xd31b('0x27')](respondWithStatusCode(_0x3599eb,null))[_0xd31b('0x4d')](handleError(_0x3599eb,null));};exports[_0xd31b('0x97')]=function(_0x445057,_0x7dbce5,_0xa16aa9){var _0x22ed73={};var _0x3a4ab6={};var _0x4ceedc;var _0xe07bd7;return db[_0xd31b('0x36')]['findOne']({'where':{'id':_0x445057[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](handleEntityNotFound(_0x7dbce5,null))['then'](function(_0x1b7338){if(_0x1b7338){_0x4ceedc=_0x1b7338;_0x3a4ab6['model']=_[_0xd31b('0x3a')](db['User'][_0xd31b('0x37')]);_0x3a4ab6[_0xd31b('0x3b')]=_[_0xd31b('0x3a')](_0x445057[_0xd31b('0x3b')]);_0x3a4ab6[_0xd31b('0x3c')]=_[_0xd31b('0x3d')](_0x3a4ab6[_0xd31b('0x3e')],_0x3a4ab6[_0xd31b('0x3b')]);_0x22ed73[_0xd31b('0x40')]=_['intersection'](_0x3a4ab6[_0xd31b('0x3e')],qs[_0xd31b('0x3f')](_0x445057[_0xd31b('0x3b')][_0xd31b('0x3f')]));_0x22ed73['attributes']=_0x22ed73[_0xd31b('0x40')]['length']?_0x22ed73[_0xd31b('0x40')]:_0x3a4ab6[_0xd31b('0x3e')];_0x22ed73[_0xd31b('0x62')]=qs[_0xd31b('0x44')](_0x445057[_0xd31b('0x3b')][_0xd31b('0x44')]);_0x22ed73[_0xd31b('0x45')]=qs[_0xd31b('0x3c')](_['pick'](_0x445057[_0xd31b('0x3b')],_0x3a4ab6[_0xd31b('0x3c')]));if(_0x445057[_0xd31b('0x3b')]['filter']){_0x22ed73['where']=_[_0xd31b('0x48')](_0x22ed73[_0xd31b('0x45')],{'$or':_[_0xd31b('0x2b')](_0x22ed73[_0xd31b('0x40')],function(_0x291870){var _0x3d48a7={};_0x3d48a7[_0x291870]={'$like':'%'+_0x445057['query'][_0xd31b('0x47')]+'%'};return _0x3d48a7;})});}_0x22ed73=_[_0xd31b('0x48')]({},_0x22ed73,_0x445057[_0xd31b('0x4a')]);return _0x4ceedc[_0xd31b('0x97')](_0x22ed73);}})[_0xd31b('0x27')](function(_0x2bb120){if(_0x2bb120){_0xe07bd7=_0x2bb120[_0xd31b('0x41')];if(!_0x445057[_0xd31b('0x3b')][_0xd31b('0x42')](_0xd31b('0x43'))){_0x22ed73['limit']=qs[_0xd31b('0x22')](_0x445057['query'][_0xd31b('0x22')]);_0x22ed73[_0xd31b('0x1f')]=qs['offset'](_0x445057[_0xd31b('0x3b')][_0xd31b('0x1f')]);}return _0x4ceedc[_0xd31b('0x97')](_0x22ed73);}})[_0xd31b('0x27')](function(_0x183d2c){if(_0x183d2c){return _0x183d2c?{'count':_0xe07bd7,'rows':_0x183d2c}:null;}})[_0xd31b('0x27')](respondWithResult(_0x7dbce5,null))[_0xd31b('0x4d')](handleError(_0x7dbce5,null));};exports[_0xd31b('0x98')]=function(_0x349124,_0x1a50b0,_0xc57e25){var _0x9308c9={};var _0x337bf9={};var _0x5ac9f5;var _0x43c6d9;return db[_0xd31b('0x36')][_0xd31b('0x60')]({'where':{'id':_0x349124[_0xd31b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1a50b0,null))[_0xd31b('0x27')](function(_0x13ceb7){if(_0x13ceb7){_0x5ac9f5=_0x13ceb7;_0x337bf9[_0xd31b('0x3e')]=_[_0xd31b('0x3a')](db[_0xd31b('0x7c')][_0xd31b('0x37')]);_0x337bf9[_0xd31b('0x3b')]=_[_0xd31b('0x3a')](_0x349124[_0xd31b('0x3b')]);_0x337bf9[_0xd31b('0x3c')]=_['intersection'](_0x337bf9[_0xd31b('0x3e')],_0x337bf9[_0xd31b('0x3b')]);_0x9308c9[_0xd31b('0x40')]=_[_0xd31b('0x3d')](_0x337bf9[_0xd31b('0x3e')],qs[_0xd31b('0x3f')](_0x349124[_0xd31b('0x3b')][_0xd31b('0x3f')]));_0x9308c9[_0xd31b('0x40')]=_0x9308c9[_0xd31b('0x40')][_0xd31b('0x41')]?_0x9308c9[_0xd31b('0x40')]:_0x337bf9['model'];_0x9308c9[_0xd31b('0x62')]=qs[_0xd31b('0x44')](_0x349124[_0xd31b('0x3b')][_0xd31b('0x44')]);_0x9308c9['where']=qs[_0xd31b('0x3c')](_['pick'](_0x349124[_0xd31b('0x3b')],_0x337bf9[_0xd31b('0x3c')]));if(_0x349124[_0xd31b('0x3b')]['filter']){_0x9308c9['where']=_[_0xd31b('0x48')](_0x9308c9[_0xd31b('0x45')],{'$or':_['map'](_0x9308c9[_0xd31b('0x40')],function(_0xfa8f78){var _0x48907d={};_0x48907d[_0xfa8f78]={'$like':'%'+_0x349124[_0xd31b('0x3b')]['filter']+'%'};return _0x48907d;})});}_0x9308c9=_[_0xd31b('0x48')]({},_0x9308c9,_0x349124[_0xd31b('0x4a')]);return _0x5ac9f5['getMembers'](_0x9308c9);}})[_0xd31b('0x27')](function(_0x2571a7){if(_0x2571a7){_0x43c6d9=_0x2571a7[_0xd31b('0x41')];if(!_0x349124[_0xd31b('0x3b')][_0xd31b('0x42')](_0xd31b('0x43'))){_0x9308c9[_0xd31b('0x22')]=qs['limit'](_0x349124['query'][_0xd31b('0x22')]);_0x9308c9[_0xd31b('0x1f')]=qs[_0xd31b('0x1f')](_0x349124['query'][_0xd31b('0x1f')]);}return _0x5ac9f5[_0xd31b('0x98')](_0x9308c9);}})[_0xd31b('0x27')](function(_0x47f3c0){return _0x47f3c0?{'count':_0x43c6d9,'rows':_0x47f3c0}:null;})[_0xd31b('0x27')](respondWithResult(_0x1a50b0,null))[_0xd31b('0x4d')](handleError(_0x1a50b0,null));};exports[_0xd31b('0x99')]=function(_0x517b1c,_0x5a8bef,_0x175ad0){var _0x329e08={};var _0x4ef351={};var _0x471288;var _0x410b2e;return db[_0xd31b('0x36')][_0xd31b('0x60')]({'where':{'id':_0x517b1c[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](handleEntityNotFound(_0x5a8bef,null))['then'](function(_0x145970){if(_0x145970){_0x471288=_0x145970;_0x4ef351[_0xd31b('0x3e')]=_[_0xd31b('0x3a')](db['CmList'][_0xd31b('0x37')]);_0x4ef351['query']=_[_0xd31b('0x3a')](_0x517b1c[_0xd31b('0x3b')]);_0x4ef351[_0xd31b('0x3c')]=_[_0xd31b('0x3d')](_0x4ef351[_0xd31b('0x3e')],_0x4ef351['query']);_0x329e08[_0xd31b('0x40')]=_[_0xd31b('0x3d')](_0x4ef351['model'],qs[_0xd31b('0x3f')](_0x517b1c[_0xd31b('0x3b')][_0xd31b('0x3f')]));_0x329e08[_0xd31b('0x40')]=_0x329e08[_0xd31b('0x40')][_0xd31b('0x41')]?_0x329e08[_0xd31b('0x40')]:_0x4ef351[_0xd31b('0x3e')];_0x329e08[_0xd31b('0x62')]=qs['sort'](_0x517b1c[_0xd31b('0x3b')]['sort']);_0x329e08['where']=qs[_0xd31b('0x3c')](_['pick'](_0x517b1c[_0xd31b('0x3b')],_0x4ef351[_0xd31b('0x3c')]));if(_0x517b1c['query'][_0xd31b('0x47')]){_0x329e08[_0xd31b('0x45')]=_[_0xd31b('0x48')](_0x329e08['where'],{'$or':_['map'](_0x329e08[_0xd31b('0x40')],function(_0x4dcec6){var _0x4ffb78={};_0x4ffb78[_0x4dcec6]={'$like':'%'+_0x517b1c[_0xd31b('0x3b')][_0xd31b('0x47')]+'%'};return _0x4ffb78;})});}_0x329e08=_['merge']({},_0x329e08,_0x517b1c[_0xd31b('0x4a')]);return _0x471288['getLists'](_0x329e08);}})[_0xd31b('0x27')](function(_0x1e2c0e){if(_0x1e2c0e){_0x410b2e=_0x1e2c0e[_0xd31b('0x41')];if(!_0x517b1c[_0xd31b('0x3b')][_0xd31b('0x42')](_0xd31b('0x43'))){_0x329e08['limit']=qs[_0xd31b('0x22')](_0x517b1c['query'][_0xd31b('0x22')]);_0x329e08[_0xd31b('0x1f')]=qs[_0xd31b('0x1f')](_0x517b1c[_0xd31b('0x3b')][_0xd31b('0x1f')]);}return _0x471288[_0xd31b('0x99')](_0x329e08);}})['then'](function(_0x5e61df){if(_0x5e61df){return _0x5e61df?{'count':_0x410b2e,'rows':_0x5e61df}:null;}})[_0xd31b('0x27')](respondWithResult(_0x5a8bef,null))[_0xd31b('0x4d')](handleError(_0x5a8bef,null));};exports['addLists']=function(_0x1682c7,_0x3aed2f,_0x42b05e){var _0x51ea62,_0x1ea673;var _0x28670f=[];var _0x4b3431=moment()[_0xd31b('0x9a')](_0xd31b('0x9b'));return db[_0xd31b('0x36')][_0xd31b('0x2e')]({'where':{'id':_0x1682c7[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](handleEntityNotFound(_0x3aed2f,null))['then'](function(_0x310c8b){if(_0x310c8b){_0x1ea673=_0x310c8b;return _0x310c8b[_0xd31b('0x9c')](_0x1682c7['body'][_0xd31b('0x82')],_['omit'](_0x1682c7[_0xd31b('0x50')],[_0xd31b('0x82'),'id'])||{});}return null;})['spread'](function(_0x345f59){var _0x27c9c2;var _0x4e9835;_0x51ea62=_0x345f59||[];var _0x24ee2e=[];if(_0x345f59){for(var _0x5165c0=0x0;_0x5165c0<_0x345f59['length'];_0x5165c0+=0x1){var _0x2cb3fc=_0x345f59[_0x5165c0][_0xd31b('0x52')]({'plain':!![]});_0x1ea673[_0xd31b('0x9d')]=_0x1682c7[_0xd31b('0x50')][_0xd31b('0x9d')]?_0x1682c7[_0xd31b('0x50')]['dialCheckDuplicateType']:_0x1ea673[_0xd31b('0x9d')];switch(_0x1ea673[_0xd31b('0x9d')]){case _0xd31b('0x9e'):_0x27c9c2=squel[_0xd31b('0x9f')]()[_0xd31b('0xa0')](_0xd31b('0xa1'))['fromQuery'](['phone',_0xd31b('0xa2'),_0xd31b('0xa3'),_0xd31b('0xa4'),'VoiceQueueId',_0xd31b('0x5d'),'updatedAt'],squel['select']()[_0xd31b('0x84')](_0xd31b('0xa5'),_0xd31b('0xa5'))['field'](_0xd31b('0xa6'),_0xd31b('0xa2'))[_0xd31b('0x84')]('id','ContactId')[_0xd31b('0x84')](_0x2cb3fc[_0xd31b('0xa7')]['toString'](),'ListId')[_0xd31b('0x84')](_0x1682c7['params']['id'][_0xd31b('0xa8')](),_0xd31b('0x63'))['field']('\x27'+_0x4b3431+'\x27',_0xd31b('0x5d'))['field']('\x27'+_0x4b3431+'\x27',_0xd31b('0x5e'))[_0xd31b('0x85')](_0xd31b('0xa9'))[_0xd31b('0x45')](_0xd31b('0xaa'))[_0xd31b('0x45')](_0xd31b('0xab'),_0x2cb3fc[_0xd31b('0xa7')][_0xd31b('0xa8')]())[_0xd31b('0x45')](_0xd31b('0xac'))['where'](_0xd31b('0xad'),squel[_0xd31b('0x83')]()[_0xd31b('0x84')](_0xd31b('0xae'))[_0xd31b('0x85')](_0xd31b('0xaf'))[_0xd31b('0x45')](_0xd31b('0xb0'),_0x1682c7['params']['id'][_0xd31b('0xa8')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xd31b('0x83')]()[_0xd31b('0x84')]('COALESCE(phone,\x27\x27)')[_0xd31b('0x85')](_0xd31b('0xa1'))[_0xd31b('0x45')](_0xd31b('0xb0'),_0x1682c7[_0xd31b('0x4e')]['id'][_0xd31b('0xa8')]())))[_0xd31b('0xa8')]();break;case'onlyIfOpen':_0x27c9c2=squel['insert']()[_0xd31b('0xa0')](_0xd31b('0xa1'))[_0xd31b('0xb1')]([_0xd31b('0xa5'),'scheduledAt',_0xd31b('0xa3'),_0xd31b('0xa4'),'VoiceQueueId','createdAt',_0xd31b('0x5e')],squel[_0xd31b('0x83')]()[_0xd31b('0x84')](_0xd31b('0xa5'),_0xd31b('0xa5'))[_0xd31b('0x84')](_0xd31b('0xa6'),_0xd31b('0xa2'))[_0xd31b('0x84')]('id',_0xd31b('0xa3'))[_0xd31b('0x84')](_0x2cb3fc[_0xd31b('0xa7')]['toString'](),_0xd31b('0xa4'))[_0xd31b('0x84')](_0x1682c7[_0xd31b('0x4e')]['id']['toString'](),_0xd31b('0x63'))[_0xd31b('0x84')]('\x27'+_0x4b3431+'\x27',_0xd31b('0x5d'))[_0xd31b('0x84')]('\x27'+_0x4b3431+'\x27',_0xd31b('0x5e'))['from'](_0xd31b('0xa9'))[_0xd31b('0x45')](_0xd31b('0xaa'))[_0xd31b('0x45')](_0xd31b('0xab'),_0x2cb3fc[_0xd31b('0xa7')][_0xd31b('0xa8')]())[_0xd31b('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0xd31b('0x45')](_0xd31b('0xad'),squel['select']()[_0xd31b('0x84')](_0xd31b('0xb2'))['from'](_0xd31b('0xa1'))[_0xd31b('0x45')](_0xd31b('0xb0'),_0x1682c7[_0xd31b('0x4e')]['id'][_0xd31b('0xa8')]())))['toString']();break;default:_0x27c9c2=squel[_0xd31b('0x9f')]()[_0xd31b('0xa0')]('cm_hopper')[_0xd31b('0xb1')]([_0xd31b('0xa5'),_0xd31b('0xa2'),_0xd31b('0xa3'),_0xd31b('0xa4'),_0xd31b('0x63'),_0xd31b('0x5d'),_0xd31b('0x5e')],squel[_0xd31b('0x83')]()[_0xd31b('0x84')](_0xd31b('0xa5'),'phone')[_0xd31b('0x84')]('NOW()','scheduledAt')['field']('id',_0xd31b('0xa3'))[_0xd31b('0x84')](_0x2cb3fc['CmListId'][_0xd31b('0xa8')](),'ListId')[_0xd31b('0x84')](_0x1682c7['params']['id']['toString'](),_0xd31b('0x63'))[_0xd31b('0x84')]('\x27'+_0x4b3431+'\x27',_0xd31b('0x5d'))[_0xd31b('0x84')]('\x27'+_0x4b3431+'\x27','updatedAt')[_0xd31b('0x85')]('cm_contacts')[_0xd31b('0x45')](_0xd31b('0xaa'))[_0xd31b('0x45')](_0xd31b('0xab'),_0x2cb3fc[_0xd31b('0xa7')][_0xd31b('0xa8')]())[_0xd31b('0x45')](_0xd31b('0xac')))['toString']();}_0x4e9835=squel[_0xd31b('0x9f')]()[_0xd31b('0xa0')](_0xd31b('0xb3'))[_0xd31b('0xb1')]([_0xd31b('0xb4'),_0xd31b('0xa2'),_0xd31b('0xa5'),_0xd31b('0xb5'),_0xd31b('0x5d'),'updatedAt'],squel['select']()['field'](_0xd31b('0xb6'),'id')[_0xd31b('0x84')](_0xd31b('0xa6'),'scheduledAt')[_0xd31b('0x84')](_0xd31b('0xb7'),_0xd31b('0xa5'))['field'](_0xd31b('0xb8'),'OrderBy')[_0xd31b('0x84')]('\x27'+_0x4b3431+'\x27',_0xd31b('0x5d'))[_0xd31b('0x84')]('\x27'+_0x4b3431+'\x27','updatedAt')[_0xd31b('0x85')](_0xd31b('0xb9'),'ci')['join']('cm_hopper','h',_0xd31b('0xba'))['where'](_0xd31b('0xbb'),_0x2cb3fc[_0xd31b('0xa7')]['toString']())[_0xd31b('0x45')](_0xd31b('0xbc'),_0x1682c7[_0xd31b('0x4e')]['id'][_0xd31b('0xa8')]())[_0xd31b('0x45')](_0xd31b('0xbd'),_0x4b3431))[_0xd31b('0xa8')]();_0x24ee2e[_0xd31b('0x8a')](db['sequelize']['query'](_0x27c9c2));_0x28670f[_0xd31b('0x8a')](db[_0xd31b('0x75')][_0xd31b('0x3b')](_0x4e9835));}return BPromise[_0xd31b('0xbe')](_0x24ee2e);}})['then'](function(){return BPromise[_0xd31b('0xbe')](_0x28670f);})[_0xd31b('0x27')](function(){return _0x51ea62;})['then'](respondWithResult(_0x3aed2f,null))['catch'](handleError(_0x3aed2f,null));};exports[_0xd31b('0xbf')]=function(_0x4f1c78,_0x3687f6,_0x1d710d){return db[_0xd31b('0x36')][_0xd31b('0x2e')]({'where':{'id':_0x4f1c78[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](handleEntityNotFound(_0x3687f6,null))[_0xd31b('0x27')](function(_0x326130){if(_0x326130){return _0x326130[_0xd31b('0xbf')](_0x4f1c78[_0xd31b('0x3b')][_0xd31b('0x82')]);}})[_0xd31b('0x27')](function(_0x5db037){if(_0x5db037){return db['CmHopper'][_0xd31b('0x28')]({'where':{'ListId':_0x4f1c78[_0xd31b('0x3b')][_0xd31b('0x82')],'VoiceQueueId':_0x4f1c78[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](function(){return _0x5db037;});}})[_0xd31b('0x27')](respondWithStatusCode(_0x3687f6,null))[_0xd31b('0x4d')](handleError(_0x3687f6,null));};exports[_0xd31b('0xc0')]=function(_0x32dd9c,_0x4be9ad,_0x5f399f){var _0x315e60={};var _0x14d067={};var _0x3ca176;var _0x1ab7fc;return db[_0xd31b('0x36')]['findOne']({'where':{'id':_0x32dd9c[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](handleEntityNotFound(_0x4be9ad,null))[_0xd31b('0x27')](function(_0x5f34ea){if(_0x5f34ea){_0x3ca176=_0x5f34ea;_0x14d067[_0xd31b('0x3e')]=_[_0xd31b('0x3a')](db[_0xd31b('0xc1')]['rawAttributes']);_0x14d067[_0xd31b('0x3b')]=_[_0xd31b('0x3a')](_0x32dd9c[_0xd31b('0x3b')]);_0x14d067[_0xd31b('0x3c')]=_[_0xd31b('0x3d')](_0x14d067[_0xd31b('0x3e')],_0x14d067[_0xd31b('0x3b')]);_0x315e60[_0xd31b('0x40')]=_['intersection'](_0x14d067[_0xd31b('0x3e')],qs[_0xd31b('0x3f')](_0x32dd9c['query'][_0xd31b('0x3f')]));_0x315e60['attributes']=_0x315e60['attributes']['length']?_0x315e60[_0xd31b('0x40')]:_0x14d067[_0xd31b('0x3e')];_0x315e60[_0xd31b('0x62')]=qs[_0xd31b('0x44')](_0x32dd9c['query']['sort']);_0x315e60[_0xd31b('0x45')]=qs[_0xd31b('0x3c')](_[_0xd31b('0x46')](_0x32dd9c[_0xd31b('0x3b')],_0x14d067['filters']));if(_0x32dd9c['query'][_0xd31b('0x47')]){_0x315e60[_0xd31b('0x45')]=_[_0xd31b('0x48')](_0x315e60['where'],{'$or':_['map'](_0x315e60[_0xd31b('0x40')],function(_0x20203e){var _0x4c6619={};_0x4c6619[_0x20203e]={'$like':'%'+_0x32dd9c[_0xd31b('0x3b')][_0xd31b('0x47')]+'%'};return _0x4c6619;})});}_0x315e60=_[_0xd31b('0x48')]({},_0x315e60,_0x32dd9c[_0xd31b('0x4a')]);return _0x3ca176['getBlackLists'](_0x315e60);}})['then'](function(_0x9aefe1){if(_0x9aefe1){_0x1ab7fc=_0x9aefe1[_0xd31b('0x41')];if(!_0x32dd9c['query'][_0xd31b('0x42')](_0xd31b('0x43'))){_0x315e60['limit']=qs[_0xd31b('0x22')](_0x32dd9c[_0xd31b('0x3b')]['limit']);_0x315e60['offset']=qs[_0xd31b('0x1f')](_0x32dd9c[_0xd31b('0x3b')]['offset']);}return _0x3ca176['getBlackLists'](_0x315e60);}})['then'](function(_0x2915e9){if(_0x2915e9){return _0x2915e9?{'count':_0x1ab7fc,'rows':_0x2915e9}:null;}})[_0xd31b('0x27')](respondWithResult(_0x4be9ad,null))['catch'](handleError(_0x4be9ad,null));};exports[_0xd31b('0xc2')]=function(_0x3e68b4,_0x3a85e2,_0x363869){var _0x39189e,_0xe2d44b;var _0x54981e=[];var _0x16128e=moment()[_0xd31b('0x9a')](_0xd31b('0x9b'));return db[_0xd31b('0x36')][_0xd31b('0x2e')]({'where':{'id':_0x3e68b4[_0xd31b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3a85e2,null))[_0xd31b('0x27')](function(_0x14bb30){if(_0x14bb30){_0xe2d44b=_0x14bb30;return _0x14bb30[_0xd31b('0xc2')](_0x3e68b4[_0xd31b('0x50')][_0xd31b('0x82')],_[_0xd31b('0x5c')](_0x3e68b4[_0xd31b('0x50')],[_0xd31b('0x82'),'id'])||{});}return null;})[_0xd31b('0x94')](function(_0xfcb890){var _0x33a069;var _0x335d75;_0x39189e=_0xfcb890||[];var _0x2cfcd6=[];if(_0xfcb890){for(var _0x139b2d=0x0;_0x139b2d<_0xfcb890[_0xd31b('0x41')];_0x139b2d+=0x1){var _0x5ba0de=_0xfcb890[_0x139b2d][_0xd31b('0x52')]({'plain':!![]});_0x33a069=squel[_0xd31b('0x9f')]()[_0xd31b('0xa0')](_0xd31b('0xc3'))[_0xd31b('0xb1')]([_0xd31b('0xa5'),_0xd31b('0xa3'),'ListId','VoiceQueueId','createdAt',_0xd31b('0x5e')],squel['select']()[_0xd31b('0x84')](_0xd31b('0xa5'),_0xd31b('0xa5'))[_0xd31b('0x84')]('id','ContactId')[_0xd31b('0x84')](_0x5ba0de[_0xd31b('0xa7')][_0xd31b('0xa8')](),_0xd31b('0xa4'))[_0xd31b('0x84')](_0x3e68b4['params']['id']['toString'](),_0xd31b('0x63'))['field']('NOW()',_0xd31b('0x5d'))[_0xd31b('0x84')](_0xd31b('0xa6'),_0xd31b('0x5e'))[_0xd31b('0x85')](_0xd31b('0xa9'))[_0xd31b('0x45')](_0xd31b('0xaa'))[_0xd31b('0x45')]('ListId\x20=\x20?',_0x5ba0de[_0xd31b('0xa7')]['toString']())[_0xd31b('0x45')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x2cfcd6['push'](db[_0xd31b('0x75')]['query'](_0x33a069));}return BPromise[_0xd31b('0xbe')](_0x2cfcd6);}})[_0xd31b('0x27')](function(){return _0x39189e;})[_0xd31b('0x27')](respondWithResult(_0x3a85e2,null))[_0xd31b('0x4d')](handleError(_0x3a85e2,null));};exports[_0xd31b('0xc4')]=function(_0x33a4c1,_0x2c0d89,_0x23959e){return db[_0xd31b('0x36')][_0xd31b('0x2e')]({'where':{'id':_0x33a4c1[_0xd31b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2c0d89,null))[_0xd31b('0x27')](function(_0x1525a3){if(_0x1525a3){return _0x1525a3[_0xd31b('0xc4')](_0x33a4c1[_0xd31b('0x3b')][_0xd31b('0x82')]);}})[_0xd31b('0x27')](function(_0x374b84){if(_0x374b84){return db[_0xd31b('0x69')][_0xd31b('0x28')]({'where':{'ListId':_0x33a4c1['query'][_0xd31b('0x82')],'VoiceQueueId':_0x33a4c1[_0xd31b('0x4e')]['id']}})[_0xd31b('0x27')](function(){return _0x374b84;});}})[_0xd31b('0x27')](respondWithStatusCode(_0x2c0d89,null))['catch'](handleError(_0x2c0d89,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index e18554e..fb28767 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 _0x0774=['emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','setMaxListeners','save','remove'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0774,0x9d));var _0x4077=function(_0x157de8,_0x4b9f93){_0x157de8=_0x157de8-0x0;var _0x2057eb=_0x0774[_0x157de8];return _0x2057eb;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x4077('0x0'))['db'][_0x4077('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x4077('0x2')](0x0);var events={'afterCreate':_0x4077('0x3'),'afterUpdate':'update','afterDestroy':_0x4077('0x4')};function emitEvent(_0x274d1a){return function(_0xf186c,_0x1f131c,_0x37eac6){VoiceQueueEvents[_0x4077('0x5')](_0x274d1a+':'+_0xf186c['id'],_0xf186c);VoiceQueueEvents[_0x4077('0x5')](_0x274d1a,_0xf186c);_0x37eac6(null);};}for(var e in events){if(events[_0x4077('0x6')](e)){var event=events[e];VoiceQueue[_0x4077('0x7')](e,emitEvent(event));}}module[_0x4077('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xa20e=['update','remove','hook','events','VoiceQueue','save'];(function(_0x2ab36d,_0x354b92){var _0x1300d4=function(_0x43e7bb){while(--_0x43e7bb){_0x2ab36d['push'](_0x2ab36d['shift']());}};_0x1300d4(++_0x354b92);}(_0xa20e,0xab));var _0xea20=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0xa20e[_0x2a67fe];return _0x57e726;};'use strict';var EventEmitter=require(_0xea20('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xea20('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xea20('0x2'),'afterUpdate':_0xea20('0x3'),'afterDestroy':_0xea20('0x4')};function emitEvent(_0x5aba3c){return function(_0x304c2a,_0x5d4d03,_0x25ffd5){VoiceQueueEvents['emit'](_0x5aba3c+':'+_0x304c2a['id'],_0x304c2a);VoiceQueueEvents['emit'](_0x5aba3c,_0x304c2a);_0x25ffd5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xea20('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index a378498..8a39b20 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 _0x7380=['util','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue'];(function(_0x498ccf,_0x4bc99a){var _0x3a9199=function(_0x2aae8a){while(--_0x2aae8a){_0x498ccf['push'](_0x498ccf['shift']());}};_0x3a9199(++_0x4bc99a);}(_0x7380,0x10e));var _0x0738=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x7380[_0xf51c06];return _0x1d5420;};'use strict';var _=require('lodash');var util=require(_0x0738('0x0'));var logger=require(_0x0738('0x1'))(_0x0738('0x2'));var moment=require(_0x0738('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0738('0x4'));var rimraf=require('rimraf');var config=require(_0x0738('0x5'));var attributes=require(_0x0738('0x6'));module[_0x0738('0x7')]=function(_0x155cdf,_0x186263){return _0x155cdf[_0x0738('0x8')](_0x0738('0x9'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xada4=['util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','VoiceQueue'];(function(_0x444edc,_0x5022b4){var _0x1d91e5=function(_0x4c4342){while(--_0x4c4342){_0x444edc['push'](_0x444edc['shift']());}};_0x1d91e5(++_0x5022b4);}(_0xada4,0x19a));var _0x4ada=function(_0x20a379,_0x3e11fb){_0x20a379=_0x20a379-0x0;var _0x4f3b39=_0xada4[_0x20a379];return _0x4f3b39;};'use strict';var _=require('lodash');var util=require(_0x4ada('0x0'));var logger=require('../../config/logger')(_0x4ada('0x1'));var moment=require(_0x4ada('0x2'));var BPromise=require(_0x4ada('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ada('0x4'));var rimraf=require(_0x4ada('0x5'));var config=require(_0x4ada('0x6'));var attributes=require('./voiceQueue.attributes');module[_0x4ada('0x7')]=function(_0x1c07f6,_0x3a8542){return _0x1c07f6[_0x4ada('0x8')](_0x4ada('0x9'),attributes,{'tableName':'voice_queues','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 f54be46..c634008 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 _0x3d06=['message','result','findAll','options','raw','where','include','model','attributes','map','then','GetVoiceQueue','debug','catch','ShowVoiceQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','info','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x57494e,_0x2c4d3d){var _0x4099da=function(_0x38c521){while(--_0x38c521){_0x57494e['push'](_0x57494e['shift']());}};_0x4099da(++_0x2c4d3d);}(_0x3d06,0x19f));var _0x63d0=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x3d06[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0x63d0('0x0'));var util=require(_0x63d0('0x1'));var moment=require(_0x63d0('0x2'));var BPromise=require('bluebird');var rs=require(_0x63d0('0x3'));var fs=require('fs');var Redis=require(_0x63d0('0x4'));var db=require(_0x63d0('0x5'))['db'];var utils=require(_0x63d0('0x6'));var logger=require(_0x63d0('0x7'))(_0x63d0('0x8'));var config=require(_0x63d0('0x9'));var jayson=require(_0x63d0('0xa'));var client=jayson['client'][_0x63d0('0xb')]({'port':0x232a});config[_0x63d0('0xc')]=_[_0x63d0('0xd')](config['redis'],{'host':_0x63d0('0xe'),'port':0x18eb});var socket=require(_0x63d0('0xf'))(new Redis(config['redis']));require(_0x63d0('0x10'))[_0x63d0('0x11')](socket);function respondWithRpcPromise(_0x1c4bde,_0x5069d9,_0xe84af3){return new BPromise(function(_0x4144a6,_0x306c39){return client['request'](_0x1c4bde,_0xe84af3)['then'](function(_0x5e2f92){logger[_0x63d0('0x12')](_0x63d0('0x13'),_0x5069d9,'request\x20sent');logger['debug'](_0x63d0('0x14'),_0x5069d9,_0x63d0('0x15'),JSON[_0x63d0('0x16')](_0x5e2f92));if(_0x5e2f92[_0x63d0('0x17')]){if(_0x5e2f92[_0x63d0('0x17')][_0x63d0('0x18')]===0x1f4){logger['error'](_0x63d0('0x13'),_0x5069d9,_0x5e2f92[_0x63d0('0x17')][_0x63d0('0x19')]);return _0x306c39(_0x5e2f92['error'][_0x63d0('0x19')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x5069d9,_0x5e2f92['error']['message']);return _0x4144a6(_0x5e2f92[_0x63d0('0x17')][_0x63d0('0x19')]);}else{logger[_0x63d0('0x12')](_0x63d0('0x13'),_0x5069d9,_0x63d0('0x15'));_0x4144a6(_0x5e2f92[_0x63d0('0x1a')]['message']);}})['catch'](function(_0x3518be){logger[_0x63d0('0x17')](_0x63d0('0x13'),_0x5069d9,_0x3518be);_0x306c39(_0x3518be);});});}exports['GetVoiceQueue']=function(_0x27eee8){var _0x3a5c59=this;return new Promise(function(_0xd26aef,_0x4127a7){return db['VoiceQueue'][_0x63d0('0x1b')]({'raw':_0x27eee8[_0x63d0('0x1c')]?_0x27eee8[_0x63d0('0x1c')][_0x63d0('0x1d')]===undefined?!![]:![]:!![],'where':_0x27eee8[_0x63d0('0x1c')]?_0x27eee8[_0x63d0('0x1c')][_0x63d0('0x1e')]||null:null,'attributes':_0x27eee8[_0x63d0('0x1c')]?_0x27eee8['options']['attributes']||null:null,'limit':_0x27eee8[_0x63d0('0x1c')]?_0x27eee8[_0x63d0('0x1c')]['limit']||null:null,'include':_0x27eee8[_0x63d0('0x1c')]?_0x27eee8['options'][_0x63d0('0x1f')]?_['map'](_0x27eee8[_0x63d0('0x1c')][_0x63d0('0x1f')],function(_0x137bf6){return{'model':db[_0x137bf6[_0x63d0('0x20')]],'as':_0x137bf6['as'],'attributes':_0x137bf6[_0x63d0('0x21')],'include':_0x137bf6[_0x63d0('0x1f')]?_[_0x63d0('0x22')](_0x137bf6[_0x63d0('0x1f')],function(_0x4d4a2e){return{'model':db[_0x4d4a2e[_0x63d0('0x20')]],'as':_0x4d4a2e['as'],'attributes':_0x4d4a2e[_0x63d0('0x21')],'include':_0x4d4a2e['include']?_[_0x63d0('0x22')](_0x4d4a2e['include'],function(_0x99fce9){return{'model':db[_0x99fce9[_0x63d0('0x20')]],'as':_0x99fce9['as'],'attributes':_0x99fce9[_0x63d0('0x21')]};}):[]};}):[]};}):[]:[]})[_0x63d0('0x23')](function(_0x3781cb){logger['info'](_0x63d0('0x24'),_0x27eee8);logger[_0x63d0('0x25')]('GetVoiceQueue',_0x27eee8,JSON[_0x63d0('0x16')](_0x3781cb));_0xd26aef(_0x3781cb);})[_0x63d0('0x26')](function(_0x4e25db){logger[_0x63d0('0x17')](_0x63d0('0x24'),_0x4e25db['message'],_0x27eee8);_0x4127a7(_0x3a5c59[_0x63d0('0x17')](0x1f4,_0x4e25db[_0x63d0('0x19')]));});});};exports[_0x63d0('0x27')]=function(_0x18405c){var _0x4b5848=this;return new Promise(function(_0x3a5179,_0x4715e5){return db['VoiceQueue']['find']({'raw':_0x18405c[_0x63d0('0x1c')]?_0x18405c[_0x63d0('0x1c')][_0x63d0('0x1d')]===undefined?!![]:![]:!![],'where':_0x18405c['options']?_0x18405c[_0x63d0('0x1c')][_0x63d0('0x1e')]||null:null,'attributes':_0x18405c[_0x63d0('0x1c')]?_0x18405c['options']['attributes']||null:null,'include':_0x18405c[_0x63d0('0x1c')]?_0x18405c[_0x63d0('0x1c')][_0x63d0('0x1f')]?_[_0x63d0('0x22')](_0x18405c[_0x63d0('0x1c')]['include'],function(_0x483474){return{'model':db[_0x483474[_0x63d0('0x20')]],'as':_0x483474['as'],'attributes':_0x483474[_0x63d0('0x21')],'include':_0x483474[_0x63d0('0x1f')]?_[_0x63d0('0x22')](_0x483474[_0x63d0('0x1f')],function(_0x3c0c93){return{'model':db[_0x3c0c93[_0x63d0('0x20')]],'as':_0x3c0c93['as'],'attributes':_0x3c0c93['attributes'],'include':_0x3c0c93['include']?_[_0x63d0('0x22')](_0x3c0c93['include'],function(_0xf4d936){return{'model':db[_0xf4d936['model']],'as':_0xf4d936['as'],'attributes':_0xf4d936[_0x63d0('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x857112){logger[_0x63d0('0x12')](_0x63d0('0x27'),_0x18405c);logger['debug']('ShowVoiceQueue',_0x18405c,JSON[_0x63d0('0x16')](_0x857112));_0x3a5179(_0x857112);})['catch'](function(_0x2c6000){logger[_0x63d0('0x17')](_0x63d0('0x27'),_0x2c6000['message'],_0x18405c);_0x4715e5(_0x4b5848[_0x63d0('0x17')](0x1f4,_0x2c6000[_0x63d0('0x19')]));});});}; \ No newline at end of file +var _0x4f06=['options','raw','limit','map','include','model','attributes','ShowVoiceQueue','where','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./voiceQueue.socket','register','then','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetVoiceQueue','VoiceQueue','findAll'];(function(_0x52b893,_0x16c3cb){var _0x380f91=function(_0x573ad7){while(--_0x573ad7){_0x52b893['push'](_0x52b893['shift']());}};_0x380f91(++_0x16c3cb);}(_0x4f06,0x1ac));var _0x64f0=function(_0x507742,_0x4877a4){_0x507742=_0x507742-0x0;var _0x541827=_0x4f06[_0x507742];return _0x541827;};'use strict';var _=require('lodash');var util=require(_0x64f0('0x0'));var moment=require(_0x64f0('0x1'));var BPromise=require(_0x64f0('0x2'));var rs=require(_0x64f0('0x3'));var fs=require('fs');var Redis=require(_0x64f0('0x4'));var db=require(_0x64f0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x64f0('0x6'))(_0x64f0('0x7'));var config=require('../../config/environment');var jayson=require(_0x64f0('0x8'));var client=jayson[_0x64f0('0x9')][_0x64f0('0xa')]({'port':0x232a});config[_0x64f0('0xb')]=_['defaults'](config[_0x64f0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x64f0('0xc'))(new Redis(config[_0x64f0('0xb')]));require(_0x64f0('0xd'))[_0x64f0('0xe')](socket);function respondWithRpcPromise(_0x343e38,_0x344c37,_0x201f31){return new BPromise(function(_0x357f03,_0x9209df){return client['request'](_0x343e38,_0x201f31)[_0x64f0('0xf')](function(_0x840b0b){logger['info'](_0x64f0('0x10'),_0x344c37,'request\x20sent');logger[_0x64f0('0x11')](_0x64f0('0x12'),_0x344c37,'request\x20sent',JSON['stringify'](_0x840b0b));if(_0x840b0b['error']){if(_0x840b0b[_0x64f0('0x13')][_0x64f0('0x14')]===0x1f4){logger[_0x64f0('0x13')](_0x64f0('0x10'),_0x344c37,_0x840b0b['error'][_0x64f0('0x15')]);return _0x9209df(_0x840b0b['error']['message']);}logger[_0x64f0('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x344c37,_0x840b0b[_0x64f0('0x13')][_0x64f0('0x15')]);return _0x357f03(_0x840b0b[_0x64f0('0x13')][_0x64f0('0x15')]);}else{logger[_0x64f0('0x16')](_0x64f0('0x10'),_0x344c37,'request\x20sent');_0x357f03(_0x840b0b[_0x64f0('0x17')][_0x64f0('0x15')]);}})[_0x64f0('0x18')](function(_0xdbe8fe){logger[_0x64f0('0x13')](_0x64f0('0x10'),_0x344c37,_0xdbe8fe);_0x9209df(_0xdbe8fe);});});}exports[_0x64f0('0x19')]=function(_0x257255){var _0x1e47be=this;return new Promise(function(_0x10c8cf,_0x1d783b){return db[_0x64f0('0x1a')][_0x64f0('0x1b')]({'raw':_0x257255['options']?_0x257255[_0x64f0('0x1c')][_0x64f0('0x1d')]===undefined?!![]:![]:!![],'where':_0x257255['options']?_0x257255['options']['where']||null:null,'attributes':_0x257255[_0x64f0('0x1c')]?_0x257255[_0x64f0('0x1c')]['attributes']||null:null,'limit':_0x257255[_0x64f0('0x1c')]?_0x257255[_0x64f0('0x1c')][_0x64f0('0x1e')]||null:null,'include':_0x257255[_0x64f0('0x1c')]?_0x257255[_0x64f0('0x1c')]['include']?_[_0x64f0('0x1f')](_0x257255['options'][_0x64f0('0x20')],function(_0x4fe341){return{'model':db[_0x4fe341[_0x64f0('0x21')]],'as':_0x4fe341['as'],'attributes':_0x4fe341[_0x64f0('0x22')],'include':_0x4fe341['include']?_[_0x64f0('0x1f')](_0x4fe341[_0x64f0('0x20')],function(_0x26c4ba){return{'model':db[_0x26c4ba['model']],'as':_0x26c4ba['as'],'attributes':_0x26c4ba['attributes'],'include':_0x26c4ba['include']?_[_0x64f0('0x1f')](_0x26c4ba[_0x64f0('0x20')],function(_0x291601){return{'model':db[_0x291601['model']],'as':_0x291601['as'],'attributes':_0x291601['attributes']};}):[]};}):[]};}):[]:[]})[_0x64f0('0xf')](function(_0x394426){logger[_0x64f0('0x16')]('GetVoiceQueue',_0x257255);logger['debug'](_0x64f0('0x19'),_0x257255,JSON['stringify'](_0x394426));_0x10c8cf(_0x394426);})['catch'](function(_0x432e10){logger['error'](_0x64f0('0x19'),_0x432e10[_0x64f0('0x15')],_0x257255);_0x1d783b(_0x1e47be[_0x64f0('0x13')](0x1f4,_0x432e10[_0x64f0('0x15')]));});});};exports[_0x64f0('0x23')]=function(_0x374713){var _0x2c4e08=this;return new Promise(function(_0x22535e,_0x17b53a){return db[_0x64f0('0x1a')]['find']({'raw':_0x374713[_0x64f0('0x1c')]?_0x374713[_0x64f0('0x1c')][_0x64f0('0x1d')]===undefined?!![]:![]:!![],'where':_0x374713[_0x64f0('0x1c')]?_0x374713[_0x64f0('0x1c')][_0x64f0('0x24')]||null:null,'attributes':_0x374713[_0x64f0('0x1c')]?_0x374713['options'][_0x64f0('0x22')]||null:null,'include':_0x374713[_0x64f0('0x1c')]?_0x374713[_0x64f0('0x1c')][_0x64f0('0x20')]?_[_0x64f0('0x1f')](_0x374713['options'][_0x64f0('0x20')],function(_0x1f7887){return{'model':db[_0x1f7887[_0x64f0('0x21')]],'as':_0x1f7887['as'],'attributes':_0x1f7887[_0x64f0('0x22')],'include':_0x1f7887[_0x64f0('0x20')]?_[_0x64f0('0x1f')](_0x1f7887[_0x64f0('0x20')],function(_0x169643){return{'model':db[_0x169643[_0x64f0('0x21')]],'as':_0x169643['as'],'attributes':_0x169643['attributes'],'include':_0x169643[_0x64f0('0x20')]?_[_0x64f0('0x1f')](_0x169643[_0x64f0('0x20')],function(_0x179cbc){return{'model':db[_0x179cbc[_0x64f0('0x21')]],'as':_0x179cbc['as'],'attributes':_0x179cbc[_0x64f0('0x22')]};}):[]};}):[]};}):[]:[]})[_0x64f0('0xf')](function(_0x5f484e){logger['info']('ShowVoiceQueue',_0x374713);logger[_0x64f0('0x11')](_0x64f0('0x23'),_0x374713,JSON[_0x64f0('0x25')](_0x5f484e));_0x22535e(_0x5f484e);})[_0x64f0('0x18')](function(_0x2f5b74){logger[_0x64f0('0x13')](_0x64f0('0x23'),_0x2f5b74[_0x64f0('0x15')],_0x374713);_0x17b53a(_0x2c4e08[_0x64f0('0x13')](0x1f4,_0x2f5b74['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 6039f67..bb0e9c9 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 _0x65ef=['update','emit','removeListener','register','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x65ef,0x7d));var _0xf65e=function(_0x1223ea,_0x1de811){_0x1223ea=_0x1223ea-0x0;var _0x4d233d=_0x65ef[_0x1223ea];return _0x4d233d;};'use strict';var VoiceQueueEvents=require(_0xf65e('0x0'));var events=[_0xf65e('0x1'),_0xf65e('0x2'),_0xf65e('0x3')];function createListener(_0x3fc930,_0x4b861c){return function(_0x3058dd){_0x4b861c[_0xf65e('0x4')](_0x3fc930,_0x3058dd);};}function removeListener(_0xd92cce,_0x484345){return function(){VoiceQueueEvents[_0xf65e('0x5')](_0xd92cce,_0x484345);};}exports[_0xf65e('0x6')]=function(_0x11fcca){for(var _0x406987=0x0,_0x2731b9=events['length'];_0x406987<_0x2731b9;_0x406987++){var _0x4a131e=events[_0x406987];var _0xb3d243=createListener(_0xf65e('0x7')+_0x4a131e,_0x11fcca);VoiceQueueEvents['on'](_0x4a131e,_0xb3d243);}}; \ No newline at end of file +var _0xe99f=['save','remove','update','removeListener','length'];(function(_0x4653f7,_0x3d3ae3){var _0x5454da=function(_0x448f55){while(--_0x448f55){_0x4653f7['push'](_0x4653f7['shift']());}};_0x5454da(++_0x3d3ae3);}(_0xe99f,0x136));var _0xfe99=function(_0x27a5e8,_0x569265){_0x27a5e8=_0x27a5e8-0x0;var _0x3d139c=_0xe99f[_0x27a5e8];return _0x3d139c;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xfe99('0x0'),_0xfe99('0x1'),_0xfe99('0x2')];function createListener(_0x382543,_0x1d3178){return function(_0x595232){_0x1d3178['emit'](_0x382543,_0x595232);};}function removeListener(_0x1dfc34,_0x52d3cf){return function(){VoiceQueueEvents[_0xfe99('0x3')](_0x1dfc34,_0x52d3cf);};}exports['register']=function(_0x52133c){for(var _0x1eb8c9=0x0,_0x383f30=events[_0xfe99('0x4')];_0x1eb8c9<_0x383f30;_0x1eb8c9++){var _0x262d83=events[_0x1eb8c9];var _0x379723=createListener('voiceQueue:'+_0x262d83,_0x52133c);VoiceQueueEvents['on'](_0x262d83,_0x379723);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 99e27a7..f542493 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 _0xeb3b=['post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','/index','getVoiceQueuesReport','/:id'];(function(_0x58f901,_0x25eed7){var _0x53e257=function(_0xcf28ab){while(--_0xcf28ab){_0x58f901['push'](_0x58f901['shift']());}};_0x53e257(++_0x25eed7);}(_0xeb3b,0xad));var _0xbeb3=function(_0x3d34f0,_0x4a5dc0){_0x3d34f0=_0x3d34f0-0x0;var _0x135ecd=_0xeb3b[_0x3d34f0];return _0x135ecd;};'use strict';var multer=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var path=require('path');var timeout=require(_0xbeb3('0x2'));var express=require(_0xbeb3('0x3'));var router=express[_0xbeb3('0x4')]();var fs_extra=require(_0xbeb3('0x5'));var auth=require(_0xbeb3('0x6'));var interaction=require(_0xbeb3('0x7'));var config=require(_0xbeb3('0x8'));var controller=require(_0xbeb3('0x9'));router[_0xbeb3('0xa')]('/',auth[_0xbeb3('0xb')](),controller['index']);router['get'](_0xbeb3('0xc'),auth[_0xbeb3('0xb')](),controller['describe']);router['get'](_0xbeb3('0xd'),auth[_0xbeb3('0xb')](),controller[_0xbeb3('0xe')]);router[_0xbeb3('0xa')](_0xbeb3('0xf'),auth[_0xbeb3('0xb')](),controller['show']);router[_0xbeb3('0x10')]('/',auth['isAuthenticated'](),controller[_0xbeb3('0x11')]);router[_0xbeb3('0x12')](_0xbeb3('0xf'),auth[_0xbeb3('0xb')](),controller['update']);router['delete']('/:id',auth[_0xbeb3('0xb')](),controller[_0xbeb3('0x13')]);module[_0xbeb3('0x14')]=router; \ No newline at end of file +var _0x157f=['../../config/environment','get','index','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2b2443,_0x3e283c){var _0x95988d=function(_0x2f6eff){while(--_0x2f6eff){_0x2b2443['push'](_0x2b2443['shift']());}};_0x95988d(++_0x3e283c);}(_0x157f,0x179));var _0xf157=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x157f[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0xf157('0x0'));var util=require(_0xf157('0x1'));var path=require('path');var timeout=require(_0xf157('0x2'));var express=require('express');var router=express[_0xf157('0x3')]();var fs_extra=require(_0xf157('0x4'));var auth=require(_0xf157('0x5'));var interaction=require(_0xf157('0x6'));var config=require(_0xf157('0x7'));var controller=require('./voiceQueueReport.controller');router[_0xf157('0x8')]('/',auth['isAuthenticated'](),controller[_0xf157('0x9')]);router[_0xf157('0x8')](_0xf157('0xa'),auth[_0xf157('0xb')](),controller[_0xf157('0xc')]);router[_0xf157('0x8')](_0xf157('0xd'),auth['isAuthenticated'](),controller[_0xf157('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf157('0xf')]);router[_0xf157('0x10')]('/',auth[_0xf157('0xb')](),controller[_0xf157('0x11')]);router[_0xf157('0x12')](_0xf157('0x13'),auth[_0xf157('0xb')](),controller[_0xf157('0x14')]);router[_0xf157('0x15')](_0xf157('0x13'),auth[_0xf157('0xb')](),controller[_0xf157('0x16')]);module[_0xf157('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 85b9927..f26973f 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 _0xb7e7=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x184623,_0x10c27f){var _0xf82018=function(_0x526351){while(--_0x526351){_0x184623['push'](_0x184623['shift']());}};_0xf82018(++_0x10c27f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb7e7[_0x45f951];return _0x24756c;};'use strict';var Sequelize=require(_0x7b7e('0x0'));var moment=require('moment');module[_0x7b7e('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7b7e('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7b7e('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x7b7e('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x7b7e('0x3')],'set':function(_0x1d9384){var _0x52047f=moment(_0x1d9384);var _0x53ed64=moment(this[_0x7b7e('0x4')](_0x7b7e('0x5')))[_0x7b7e('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x42b871=_0x52047f[_0x7b7e('0x7')](_0x53ed64,_0x7b7e('0x8'));this[_0x7b7e('0x9')](_0x7b7e('0xa'),_0x1d9384);this[_0x7b7e('0x9')](_0x7b7e('0xb'),_0x42b871||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x7b7e('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x7b7e('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x7b7e('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x7b7e('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x7b7e('0x3')]},'queuecallerexit':{'type':Sequelize[_0x7b7e('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x7b7e('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x7b7e('0x2')],'comment':_0x7b7e('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x7b7e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7b7e('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7b7e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x7b7e('0x2')]},'holdtime':{'type':Sequelize[_0x7b7e('0xc')]},'mohtime':{'type':Sequelize[_0x7b7e('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7b7e('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x7b7e('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x7b7e('0xf')},'transferexten':{'type':Sequelize[_0x7b7e('0x2')]},'transferuniqueid':{'type':Sequelize[_0x7b7e('0x2')]},'disposition':{'type':Sequelize[_0x7b7e('0x2')]},'secondDisposition':{'type':Sequelize[_0x7b7e('0x2')]},'thirdDisposition':{'type':Sequelize[_0x7b7e('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x7b7e('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb7e7=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x3138d3,_0x48c0ae){var _0x54945b=function(_0x25cbdb){while(--_0x25cbdb){_0x3138d3['push'](_0x3138d3['shift']());}};_0x54945b(++_0x48c0ae);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xb7e7[_0x2faddb];return _0x273c05;};'use strict';var Sequelize=require(_0x7b7e('0x0'));var moment=require('moment');module[_0x7b7e('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7b7e('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7b7e('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x7b7e('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x7b7e('0x3')],'set':function(_0x1d9384){var _0x52047f=moment(_0x1d9384);var _0x53ed64=moment(this[_0x7b7e('0x4')](_0x7b7e('0x5')))[_0x7b7e('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x42b871=_0x52047f[_0x7b7e('0x7')](_0x53ed64,_0x7b7e('0x8'));this[_0x7b7e('0x9')](_0x7b7e('0xa'),_0x1d9384);this[_0x7b7e('0x9')](_0x7b7e('0xb'),_0x42b871||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x7b7e('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x7b7e('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x7b7e('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x7b7e('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x7b7e('0x3')]},'queuecallerexit':{'type':Sequelize[_0x7b7e('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x7b7e('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x7b7e('0x2')],'comment':_0x7b7e('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x7b7e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7b7e('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7b7e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x7b7e('0x2')]},'holdtime':{'type':Sequelize[_0x7b7e('0xc')]},'mohtime':{'type':Sequelize[_0x7b7e('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7b7e('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x7b7e('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x7b7e('0xf')},'transferexten':{'type':Sequelize[_0x7b7e('0x2')]},'transferuniqueid':{'type':Sequelize[_0x7b7e('0x2')]},'disposition':{'type':Sequelize[_0x7b7e('0x2')]},'secondDisposition':{'type':Sequelize[_0x7b7e('0x2')]},'thirdDisposition':{'type':Sequelize[_0x7b7e('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x7b7e('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 8247636..2c7ed8d 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 _0x7ee4=['where','merge','VIRTUAL','filter','then','includeAll','include','rows','catch','rawAttributes','options','find','create','body','params','describe','getVoiceQueuesReport','findAll','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voiceQueueReport.socket','register','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','update','destroy','end','error','stack','name','send','index','map','VoiceQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x2625b8,_0x428b39){var _0x3f2b84=function(_0x4baab5){while(--_0x4baab5){_0x2625b8['push'](_0x2625b8['shift']());}};_0x3f2b84(++_0x428b39);}(_0x7ee4,0x10b));var _0x47ee=function(_0x332d5c,_0x4a2336){_0x332d5c=_0x332d5c-0x0;var _0x47448d=_0x7ee4[_0x332d5c];return _0x47448d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x47ee('0x0'));var jsonpatch=require(_0x47ee('0x1'));var rp=require(_0x47ee('0x2'));var moment=require(_0x47ee('0x3'));var BPromise=require(_0x47ee('0x4'));var Mustache=require(_0x47ee('0x5'));var util=require(_0x47ee('0x6'));var path=require(_0x47ee('0x7'));var sox=require('sox');var csv=require(_0x47ee('0x8'));var ejs=require(_0x47ee('0x9'));var fs=require('fs');var fs_extra=require(_0x47ee('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x47ee('0xb'));var jsforce=require(_0x47ee('0xc'));var deskjs=require(_0x47ee('0xd'));var toCsv=require(_0x47ee('0x8'));var querystring=require(_0x47ee('0xe'));var Papa=require('papaparse');var Redis=require(_0x47ee('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x47ee('0x10'));var as=require(_0x47ee('0x11'));var hardwareService=require(_0x47ee('0x12'));var logger=require(_0x47ee('0x13'))(_0x47ee('0x14'));var utils=require(_0x47ee('0x15'));var config=require(_0x47ee('0x16'));var licenseUtil=require(_0x47ee('0x17'));var db=require(_0x47ee('0x18'))['db'];config['redis']=_[_0x47ee('0x19')](config['redis'],{'host':_0x47ee('0x1a'),'port':0x18eb});var socket=require(_0x47ee('0x1b'))(new Redis(config[_0x47ee('0x1c')]));require(_0x47ee('0x1d'))[_0x47ee('0x1e')](socket);function respondWithStatusCode(_0x39b84b,_0x49faf2){_0x49faf2=_0x49faf2||0xcc;return function(_0x20dc1f){if(_0x20dc1f){return _0x39b84b[_0x47ee('0x1f')](_0x49faf2);}return _0x39b84b[_0x47ee('0x20')](_0x49faf2)['end']();};}function respondWithResult(_0xc1cf5b,_0x3f8d28){_0x3f8d28=_0x3f8d28||0xc8;return function(_0x1c0d22){if(_0x1c0d22){return _0xc1cf5b[_0x47ee('0x20')](_0x3f8d28)[_0x47ee('0x21')](_0x1c0d22);}};}function respondWithFilteredResult(_0x28fbbf,_0x48c8e3){return function(_0x2b13fb){if(_0x2b13fb){var _0x4b2e96=typeof _0x48c8e3[_0x47ee('0x22')]==='undefined'&&typeof _0x48c8e3[_0x47ee('0x23')]==='undefined';var _0x164a9e=_0x2b13fb[_0x47ee('0x24')];var _0x1b758e=_0x4b2e96?0x0:_0x48c8e3[_0x47ee('0x22')];var _0x5dfe90=_0x4b2e96?_0x2b13fb[_0x47ee('0x24')]:_0x48c8e3[_0x47ee('0x22')]+_0x48c8e3[_0x47ee('0x23')];var _0x18f7da;if(_0x5dfe90>=_0x164a9e){_0x5dfe90=_0x164a9e;_0x18f7da=0xc8;}else{_0x18f7da=0xce;}_0x28fbbf[_0x47ee('0x20')](_0x18f7da);return _0x28fbbf['set'](_0x47ee('0x25'),_0x1b758e+'-'+_0x5dfe90+'/'+_0x164a9e)[_0x47ee('0x21')](_0x2b13fb);}return null;};}function patchUpdates(_0x540b31){return function(_0x269baa){try{jsonpatch[_0x47ee('0x26')](_0x269baa,_0x540b31,!![]);}catch(_0x5d3eb3){return BPromise[_0x47ee('0x27')](_0x5d3eb3);}return _0x269baa['save']();};}function saveUpdates(_0x519a87,_0x3cb0d9){return function(_0xc88dd7){if(_0xc88dd7){return _0xc88dd7[_0x47ee('0x28')](_0x519a87)['then'](function(_0x19be08){return _0x19be08;});}return null;};}function removeEntity(_0x5f49b0,_0x5d3988){return function(_0x56dbeb){if(_0x56dbeb){return _0x56dbeb[_0x47ee('0x29')]()['then'](function(){_0x5f49b0[_0x47ee('0x20')](0xcc)[_0x47ee('0x2a')]();});}};}function handleEntityNotFound(_0x59b9db,_0x5db8d9){return function(_0x1dc37b){if(!_0x1dc37b){_0x59b9db['sendStatus'](0x194);}return _0x1dc37b;};}function handleError(_0x13521d,_0x153adb){_0x153adb=_0x153adb||0x1f4;return function(_0x3b9bf4){logger[_0x47ee('0x2b')](_0x3b9bf4[_0x47ee('0x2c')]);if(_0x3b9bf4[_0x47ee('0x2d')]){delete _0x3b9bf4[_0x47ee('0x2d')];}_0x13521d['status'](_0x153adb)[_0x47ee('0x2e')](_0x3b9bf4);};}exports[_0x47ee('0x2f')]=function(_0x3e8d52,_0x49e3af){var _0x2e8560={},_0x2c71ed={},_0x2eff69={'count':0x0,'rows':[]};var _0x202180=_[_0x47ee('0x30')](db[_0x47ee('0x31')]['rawAttributes'],function(_0x13a291){return{'name':_0x13a291['fieldName'],'type':_0x13a291[_0x47ee('0x32')][_0x47ee('0x33')]};});_0x2c71ed[_0x47ee('0x34')]=_[_0x47ee('0x30')](_0x202180,'name');_0x2c71ed[_0x47ee('0x35')]=_[_0x47ee('0x36')](_0x3e8d52['query']);_0x2c71ed[_0x47ee('0x37')]=_[_0x47ee('0x38')](_0x2c71ed[_0x47ee('0x34')],_0x2c71ed['query']);_0x2e8560[_0x47ee('0x39')]=_[_0x47ee('0x38')](_0x2c71ed[_0x47ee('0x34')],qs[_0x47ee('0x3a')](_0x3e8d52[_0x47ee('0x35')]['fields']));_0x2e8560[_0x47ee('0x39')]=_0x2e8560['attributes'][_0x47ee('0x3b')]?_0x2e8560[_0x47ee('0x39')]:_0x2c71ed[_0x47ee('0x34')];if(!_0x3e8d52[_0x47ee('0x35')][_0x47ee('0x3c')](_0x47ee('0x3d'))){_0x2e8560[_0x47ee('0x23')]=qs['limit'](_0x3e8d52[_0x47ee('0x35')][_0x47ee('0x23')]);_0x2e8560['offset']=qs['offset'](_0x3e8d52[_0x47ee('0x35')][_0x47ee('0x22')]);}_0x2e8560[_0x47ee('0x3e')]=qs[_0x47ee('0x3f')](_0x3e8d52[_0x47ee('0x35')][_0x47ee('0x3f')]);_0x2e8560['where']=qs['filters'](_[_0x47ee('0x40')](_0x3e8d52['query'],_0x2c71ed['filters']),_0x202180);if(_0x3e8d52[_0x47ee('0x35')]['filter']){_0x2e8560[_0x47ee('0x41')]=_[_0x47ee('0x42')](_0x2e8560['where'],{'$or':_[_0x47ee('0x30')](_0x202180,function(_0x3a0875){if(_0x3a0875[_0x47ee('0x32')]!==_0x47ee('0x43')){var _0x3a2a7b={};_0x3a2a7b[_0x3a0875[_0x47ee('0x2d')]]={'$like':'%'+_0x3e8d52[_0x47ee('0x35')][_0x47ee('0x44')]+'%'};return _0x3a2a7b;}})});}_0x2e8560=_[_0x47ee('0x42')]({},_0x2e8560,_0x3e8d52['options']);var _0x2e66c0={'where':_0x2e8560[_0x47ee('0x41')]};return db[_0x47ee('0x31')]['count'](_0x2e66c0)[_0x47ee('0x45')](function(_0x1d2ac8){_0x2eff69[_0x47ee('0x24')]=_0x1d2ac8;if(_0x3e8d52[_0x47ee('0x35')][_0x47ee('0x46')]){_0x2e8560[_0x47ee('0x47')]=[{'all':!![]}];}return db[_0x47ee('0x31')]['findAll'](_0x2e8560);})['then'](function(_0x8c4aae){_0x2eff69[_0x47ee('0x48')]=_0x8c4aae;return _0x2eff69;})[_0x47ee('0x45')](respondWithFilteredResult(_0x49e3af,_0x2e8560))[_0x47ee('0x49')](handleError(_0x49e3af,null));};exports['show']=function(_0x57be36,_0x50ec30){var _0x120cff={'raw':![],'where':{'id':_0x57be36['params']['id']}},_0x3bc71a={};_0x3bc71a[_0x47ee('0x34')]=_[_0x47ee('0x36')](db[_0x47ee('0x31')][_0x47ee('0x4a')]);_0x3bc71a[_0x47ee('0x35')]=_[_0x47ee('0x36')](_0x57be36[_0x47ee('0x35')]);_0x3bc71a[_0x47ee('0x37')]=_[_0x47ee('0x38')](_0x3bc71a[_0x47ee('0x34')],_0x3bc71a[_0x47ee('0x35')]);_0x120cff['attributes']=_[_0x47ee('0x38')](_0x3bc71a[_0x47ee('0x34')],qs[_0x47ee('0x3a')](_0x57be36[_0x47ee('0x35')][_0x47ee('0x3a')]));_0x120cff[_0x47ee('0x39')]=_0x120cff[_0x47ee('0x39')][_0x47ee('0x3b')]?_0x120cff[_0x47ee('0x39')]:_0x3bc71a[_0x47ee('0x34')];if(_0x57be36['query'][_0x47ee('0x46')]){_0x120cff[_0x47ee('0x47')]=[{'all':!![]}];}_0x120cff=_['merge']({},_0x120cff,_0x57be36[_0x47ee('0x4b')]);return db[_0x47ee('0x31')][_0x47ee('0x4c')](_0x120cff)[_0x47ee('0x45')](handleEntityNotFound(_0x50ec30,null))['then'](respondWithResult(_0x50ec30,null))[_0x47ee('0x49')](handleError(_0x50ec30,null));};exports[_0x47ee('0x4d')]=function(_0x30c708,_0x5e7064){return db[_0x47ee('0x31')][_0x47ee('0x4d')](_0x30c708[_0x47ee('0x4e')],{})['then'](respondWithResult(_0x5e7064,0xc9))[_0x47ee('0x49')](handleError(_0x5e7064,null));};exports['update']=function(_0x300847,_0x474110){if(_0x300847[_0x47ee('0x4e')]['id']){delete _0x300847[_0x47ee('0x4e')]['id'];}return db[_0x47ee('0x31')]['find']({'where':{'id':_0x300847[_0x47ee('0x4f')]['id']}})[_0x47ee('0x45')](handleEntityNotFound(_0x474110,null))[_0x47ee('0x45')](saveUpdates(_0x300847['body'],null))[_0x47ee('0x45')](respondWithResult(_0x474110,null))[_0x47ee('0x49')](handleError(_0x474110,null));};exports[_0x47ee('0x29')]=function(_0x29aa19,_0x1e0d8d){return db[_0x47ee('0x31')]['find']({'where':{'id':_0x29aa19[_0x47ee('0x4f')]['id']}})[_0x47ee('0x45')](handleEntityNotFound(_0x1e0d8d,null))[_0x47ee('0x45')](removeEntity(_0x1e0d8d,null))[_0x47ee('0x49')](handleError(_0x1e0d8d,null));};exports['describe']=function(_0x201706,_0x422127){return db[_0x47ee('0x31')][_0x47ee('0x50')]()[_0x47ee('0x45')](respondWithResult(_0x422127,null))[_0x47ee('0x49')](handleError(_0x422127,null));};exports[_0x47ee('0x51')]=function(_0x1ffb6e,_0x688cbb){var _0xb0df45={},_0xbab534={},_0x4cd8d3={'count':0x0,'rows':[]};_0xbab534[_0x47ee('0x34')]=_['keys'](db[_0x47ee('0x31')][_0x47ee('0x4a')]);_0xbab534[_0x47ee('0x35')]=_['keys'](_0x1ffb6e['query']);_0xbab534[_0x47ee('0x37')]=_[_0x47ee('0x38')](_0xbab534[_0x47ee('0x34')],_0xbab534[_0x47ee('0x35')]);_0xb0df45[_0x47ee('0x39')]=_[_0x47ee('0x38')](_0xbab534[_0x47ee('0x34')],qs['fields'](_0x1ffb6e[_0x47ee('0x35')]['fields']));_0xb0df45[_0x47ee('0x39')]=_0xb0df45[_0x47ee('0x39')]['length']?_0xb0df45['attributes']:_0xbab534[_0x47ee('0x34')];if(!_0x1ffb6e[_0x47ee('0x35')][_0x47ee('0x3c')](_0x47ee('0x3d'))){_0xb0df45[_0x47ee('0x23')]=qs[_0x47ee('0x23')](_0x1ffb6e['query'][_0x47ee('0x23')]);_0xb0df45[_0x47ee('0x22')]=qs['offset'](_0x1ffb6e[_0x47ee('0x35')]['offset']);}_0xb0df45['order']=qs[_0x47ee('0x3f')](_0x1ffb6e[_0x47ee('0x35')][_0x47ee('0x3f')]);_0xb0df45[_0x47ee('0x41')]=qs['filters'](_['pick'](_0x1ffb6e[_0x47ee('0x35')],_0xbab534[_0x47ee('0x37')]));if(_0x1ffb6e[_0x47ee('0x35')]['filter']){_0xb0df45[_0x47ee('0x41')]=_[_0x47ee('0x42')](_0xb0df45['where'],{'$or':_[_0x47ee('0x30')](_0xb0df45[_0x47ee('0x39')],function(_0x12fc50){var _0x505a30={};_0x505a30[_0x12fc50]={'$like':'%'+_0x1ffb6e[_0x47ee('0x35')][_0x47ee('0x44')]+'%'};return _0x505a30;})});}_0xb0df45=_[_0x47ee('0x42')]({},_0xb0df45,_0x1ffb6e[_0x47ee('0x4b')]);var _0x484de7={'where':_0xb0df45[_0x47ee('0x41')]};return db[_0x47ee('0x31')][_0x47ee('0x24')](_0x484de7)[_0x47ee('0x45')](function(_0xd08732){_0x4cd8d3['count']=_0xd08732;if(_0x1ffb6e[_0x47ee('0x35')][_0x47ee('0x46')]){_0xb0df45[_0x47ee('0x47')]=[{'all':!![]}];}return db[_0x47ee('0x31')][_0x47ee('0x52')](_0xb0df45);})[_0x47ee('0x45')](function(_0x9d17cb){_0x4cd8d3[_0x47ee('0x48')]=_0x9d17cb;return _0x4cd8d3;})[_0x47ee('0x45')](respondWithFilteredResult(_0x688cbb,_0xb0df45,_0x47ee('0x51')))['catch'](handleError(_0x688cbb,null,_0x47ee('0x51')));}; \ No newline at end of file +var _0x25c9=['nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','fields','model','options','find','create','body','describe','getVoiceQueuesReport','rawAttributes','order','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./voiceQueueReport.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','VoiceQueueReport','fieldName','type','key','query','keys','filters','intersection','attributes','length','hasOwnProperty'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x25c9,0x6c));var _0x925c=function(_0x3ad5ff,_0x4d8e3b){_0x3ad5ff=_0x3ad5ff-0x0;var _0x637cc2=_0x25c9[_0x3ad5ff];return _0x637cc2;};'use strict';var emlformat=require(_0x925c('0x0'));var rimraf=require(_0x925c('0x1'));var zipdir=require(_0x925c('0x2'));var jsonpatch=require(_0x925c('0x3'));var rp=require('request-promise');var moment=require(_0x925c('0x4'));var BPromise=require(_0x925c('0x5'));var Mustache=require('mustache');var util=require(_0x925c('0x6'));var path=require(_0x925c('0x7'));var sox=require(_0x925c('0x8'));var csv=require('to-csv');var ejs=require(_0x925c('0x9'));var fs=require('fs');var fs_extra=require(_0x925c('0xa'));var _=require(_0x925c('0xb'));var squel=require(_0x925c('0xc'));var crypto=require(_0x925c('0xd'));var jsforce=require(_0x925c('0xe'));var deskjs=require(_0x925c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x925c('0x10'));var Papa=require(_0x925c('0x11'));var Redis=require(_0x925c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x925c('0x13'));var as=require(_0x925c('0x14'));var hardwareService=require(_0x925c('0x15'));var logger=require(_0x925c('0x16'))(_0x925c('0x17'));var utils=require(_0x925c('0x18'));var config=require(_0x925c('0x19'));var licenseUtil=require(_0x925c('0x1a'));var db=require('../../mysqldb')['db'];config[_0x925c('0x1b')]=_['defaults'](config[_0x925c('0x1b')],{'host':_0x925c('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x925c('0x1b')]));require(_0x925c('0x1d'))[_0x925c('0x1e')](socket);function respondWithStatusCode(_0x4a68d8,_0x349b10){_0x349b10=_0x349b10||0xcc;return function(_0x18f857){if(_0x18f857){return _0x4a68d8[_0x925c('0x1f')](_0x349b10);}return _0x4a68d8[_0x925c('0x20')](_0x349b10)['end']();};}function respondWithResult(_0x10d667,_0x80ed05){_0x80ed05=_0x80ed05||0xc8;return function(_0x1b5fc3){if(_0x1b5fc3){return _0x10d667[_0x925c('0x20')](_0x80ed05)[_0x925c('0x21')](_0x1b5fc3);}};}function respondWithFilteredResult(_0x4f59af,_0x1b4d20){return function(_0x390430){if(_0x390430){var _0x2e9810=typeof _0x1b4d20[_0x925c('0x22')]===_0x925c('0x23')&&typeof _0x1b4d20['limit']==='undefined';var _0x4e0a75=_0x390430[_0x925c('0x24')];var _0x2c1a9f=_0x2e9810?0x0:_0x1b4d20['offset'];var _0x5395c6=_0x2e9810?_0x390430[_0x925c('0x24')]:_0x1b4d20[_0x925c('0x22')]+_0x1b4d20['limit'];var _0xbee326;if(_0x5395c6>=_0x4e0a75){_0x5395c6=_0x4e0a75;_0xbee326=0xc8;}else{_0xbee326=0xce;}_0x4f59af[_0x925c('0x20')](_0xbee326);return _0x4f59af[_0x925c('0x25')](_0x925c('0x26'),_0x2c1a9f+'-'+_0x5395c6+'/'+_0x4e0a75)['json'](_0x390430);}return null;};}function patchUpdates(_0x2e8c58){return function(_0x4c46a0){try{jsonpatch['apply'](_0x4c46a0,_0x2e8c58,!![]);}catch(_0x35e60c){return BPromise[_0x925c('0x27')](_0x35e60c);}return _0x4c46a0[_0x925c('0x28')]();};}function saveUpdates(_0x32e7bb,_0x5a0a9f){return function(_0x533000){if(_0x533000){return _0x533000[_0x925c('0x29')](_0x32e7bb)[_0x925c('0x2a')](function(_0x416580){return _0x416580;});}return null;};}function removeEntity(_0x33f000,_0x559cfb){return function(_0x470907){if(_0x470907){return _0x470907[_0x925c('0x2b')]()[_0x925c('0x2a')](function(){_0x33f000['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x94747f,_0x48645b){return function(_0x50c87a){if(!_0x50c87a){_0x94747f[_0x925c('0x1f')](0x194);}return _0x50c87a;};}function handleError(_0x15076e,_0x5cd245){_0x5cd245=_0x5cd245||0x1f4;return function(_0x276f19){logger['error'](_0x276f19[_0x925c('0x2c')]);if(_0x276f19[_0x925c('0x2d')]){delete _0x276f19[_0x925c('0x2d')];}_0x15076e[_0x925c('0x20')](_0x5cd245)[_0x925c('0x2e')](_0x276f19);};}exports['index']=function(_0x332949,_0x586955){var _0x5b1d24={},_0x54b696={},_0x38dd92={'count':0x0,'rows':[]};var _0x379962=_['map'](db[_0x925c('0x2f')]['rawAttributes'],function(_0x198d8c){return{'name':_0x198d8c[_0x925c('0x30')],'type':_0x198d8c[_0x925c('0x31')][_0x925c('0x32')]};});_0x54b696['model']=_['map'](_0x379962,_0x925c('0x2d'));_0x54b696[_0x925c('0x33')]=_[_0x925c('0x34')](_0x332949[_0x925c('0x33')]);_0x54b696[_0x925c('0x35')]=_[_0x925c('0x36')](_0x54b696['model'],_0x54b696['query']);_0x5b1d24[_0x925c('0x37')]=_[_0x925c('0x36')](_0x54b696['model'],qs['fields'](_0x332949[_0x925c('0x33')]['fields']));_0x5b1d24['attributes']=_0x5b1d24[_0x925c('0x37')][_0x925c('0x38')]?_0x5b1d24[_0x925c('0x37')]:_0x54b696['model'];if(!_0x332949['query'][_0x925c('0x39')](_0x925c('0x3a'))){_0x5b1d24[_0x925c('0x3b')]=qs[_0x925c('0x3b')](_0x332949[_0x925c('0x33')][_0x925c('0x3b')]);_0x5b1d24[_0x925c('0x22')]=qs['offset'](_0x332949[_0x925c('0x33')][_0x925c('0x22')]);}_0x5b1d24['order']=qs[_0x925c('0x3c')](_0x332949['query']['sort']);_0x5b1d24[_0x925c('0x3d')]=qs[_0x925c('0x35')](_[_0x925c('0x3e')](_0x332949[_0x925c('0x33')],_0x54b696[_0x925c('0x35')]),_0x379962);if(_0x332949['query']['filter']){_0x5b1d24[_0x925c('0x3d')]=_[_0x925c('0x3f')](_0x5b1d24[_0x925c('0x3d')],{'$or':_['map'](_0x379962,function(_0x30327c){if(_0x30327c[_0x925c('0x31')]!==_0x925c('0x40')){var _0x349ed7={};_0x349ed7[_0x30327c[_0x925c('0x2d')]]={'$like':'%'+_0x332949['query'][_0x925c('0x41')]+'%'};return _0x349ed7;}})});}_0x5b1d24=_[_0x925c('0x3f')]({},_0x5b1d24,_0x332949['options']);var _0x3582eb={'where':_0x5b1d24['where']};return db[_0x925c('0x2f')][_0x925c('0x24')](_0x3582eb)[_0x925c('0x2a')](function(_0x60c93){_0x38dd92[_0x925c('0x24')]=_0x60c93;if(_0x332949[_0x925c('0x33')][_0x925c('0x42')]){_0x5b1d24[_0x925c('0x43')]=[{'all':!![]}];}return db[_0x925c('0x2f')][_0x925c('0x44')](_0x5b1d24);})['then'](function(_0x5361c5){_0x38dd92[_0x925c('0x45')]=_0x5361c5;return _0x38dd92;})[_0x925c('0x2a')](respondWithFilteredResult(_0x586955,_0x5b1d24))[_0x925c('0x46')](handleError(_0x586955,null));};exports[_0x925c('0x47')]=function(_0x2c9adf,_0x487f67){var _0x36c4a7={'raw':![],'where':{'id':_0x2c9adf[_0x925c('0x48')]['id']}},_0x5d238d={};_0x5d238d['model']=_['keys'](db[_0x925c('0x2f')]['rawAttributes']);_0x5d238d[_0x925c('0x33')]=_[_0x925c('0x34')](_0x2c9adf['query']);_0x5d238d[_0x925c('0x35')]=_['intersection'](_0x5d238d['model'],_0x5d238d[_0x925c('0x33')]);_0x36c4a7[_0x925c('0x37')]=_['intersection'](_0x5d238d['model'],qs[_0x925c('0x49')](_0x2c9adf[_0x925c('0x33')]['fields']));_0x36c4a7[_0x925c('0x37')]=_0x36c4a7['attributes']['length']?_0x36c4a7[_0x925c('0x37')]:_0x5d238d[_0x925c('0x4a')];if(_0x2c9adf[_0x925c('0x33')]['includeAll']){_0x36c4a7[_0x925c('0x43')]=[{'all':!![]}];}_0x36c4a7=_['merge']({},_0x36c4a7,_0x2c9adf[_0x925c('0x4b')]);return db[_0x925c('0x2f')][_0x925c('0x4c')](_0x36c4a7)['then'](handleEntityNotFound(_0x487f67,null))[_0x925c('0x2a')](respondWithResult(_0x487f67,null))[_0x925c('0x46')](handleError(_0x487f67,null));};exports[_0x925c('0x4d')]=function(_0x29e4f7,_0x5052f1){return db['VoiceQueueReport'][_0x925c('0x4d')](_0x29e4f7[_0x925c('0x4e')],{})[_0x925c('0x2a')](respondWithResult(_0x5052f1,0xc9))[_0x925c('0x46')](handleError(_0x5052f1,null));};exports['update']=function(_0x31e990,_0x1b7cc3){if(_0x31e990[_0x925c('0x4e')]['id']){delete _0x31e990[_0x925c('0x4e')]['id'];}return db[_0x925c('0x2f')][_0x925c('0x4c')]({'where':{'id':_0x31e990[_0x925c('0x48')]['id']}})[_0x925c('0x2a')](handleEntityNotFound(_0x1b7cc3,null))['then'](saveUpdates(_0x31e990[_0x925c('0x4e')],null))['then'](respondWithResult(_0x1b7cc3,null))[_0x925c('0x46')](handleError(_0x1b7cc3,null));};exports[_0x925c('0x2b')]=function(_0x2feaff,_0x1fde90){return db[_0x925c('0x2f')][_0x925c('0x4c')]({'where':{'id':_0x2feaff['params']['id']}})[_0x925c('0x2a')](handleEntityNotFound(_0x1fde90,null))[_0x925c('0x2a')](removeEntity(_0x1fde90,null))[_0x925c('0x46')](handleError(_0x1fde90,null));};exports[_0x925c('0x4f')]=function(_0x364ee5,_0x210b40){return db[_0x925c('0x2f')][_0x925c('0x4f')]()[_0x925c('0x2a')](respondWithResult(_0x210b40,null))[_0x925c('0x46')](handleError(_0x210b40,null));};exports[_0x925c('0x50')]=function(_0x268940,_0x2ec58a){var _0xe06986={},_0x336f2f={},_0x44ceb0={'count':0x0,'rows':[]};_0x336f2f[_0x925c('0x4a')]=_[_0x925c('0x34')](db[_0x925c('0x2f')][_0x925c('0x51')]);_0x336f2f[_0x925c('0x33')]=_['keys'](_0x268940[_0x925c('0x33')]);_0x336f2f['filters']=_[_0x925c('0x36')](_0x336f2f[_0x925c('0x4a')],_0x336f2f['query']);_0xe06986[_0x925c('0x37')]=_['intersection'](_0x336f2f[_0x925c('0x4a')],qs[_0x925c('0x49')](_0x268940['query'][_0x925c('0x49')]));_0xe06986['attributes']=_0xe06986[_0x925c('0x37')][_0x925c('0x38')]?_0xe06986['attributes']:_0x336f2f[_0x925c('0x4a')];if(!_0x268940['query'][_0x925c('0x39')](_0x925c('0x3a'))){_0xe06986[_0x925c('0x3b')]=qs['limit'](_0x268940[_0x925c('0x33')][_0x925c('0x3b')]);_0xe06986[_0x925c('0x22')]=qs[_0x925c('0x22')](_0x268940[_0x925c('0x33')][_0x925c('0x22')]);}_0xe06986[_0x925c('0x52')]=qs[_0x925c('0x3c')](_0x268940[_0x925c('0x33')]['sort']);_0xe06986[_0x925c('0x3d')]=qs[_0x925c('0x35')](_[_0x925c('0x3e')](_0x268940['query'],_0x336f2f[_0x925c('0x35')]));if(_0x268940[_0x925c('0x33')][_0x925c('0x41')]){_0xe06986[_0x925c('0x3d')]=_[_0x925c('0x3f')](_0xe06986['where'],{'$or':_['map'](_0xe06986[_0x925c('0x37')],function(_0x865923){var _0x12d53c={};_0x12d53c[_0x865923]={'$like':'%'+_0x268940[_0x925c('0x33')]['filter']+'%'};return _0x12d53c;})});}_0xe06986=_['merge']({},_0xe06986,_0x268940[_0x925c('0x4b')]);var _0x55cf44={'where':_0xe06986[_0x925c('0x3d')]};return db[_0x925c('0x2f')][_0x925c('0x24')](_0x55cf44)[_0x925c('0x2a')](function(_0x6f71b5){_0x44ceb0[_0x925c('0x24')]=_0x6f71b5;if(_0x268940[_0x925c('0x33')][_0x925c('0x42')]){_0xe06986['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0xe06986);})[_0x925c('0x2a')](function(_0x2551ac){_0x44ceb0[_0x925c('0x45')]=_0x2551ac;return _0x44ceb0;})['then'](respondWithFilteredResult(_0x2ec58a,_0xe06986,_0x925c('0x50')))['catch'](handleError(_0x2ec58a,null,_0x925c('0x50')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 6bdf236..3c292f2 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 _0xf65f=['VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x1c4e87,_0x77a3dd){var _0x36725e=function(_0x287db7){while(--_0x287db7){_0x1c4e87['push'](_0x1c4e87['shift']());}};_0x36725e(++_0x77a3dd);}(_0xf65f,0xd0));var _0xff65=function(_0x508849,_0x149f0b){_0x508849=_0x508849-0x0;var _0x3a77bb=_0xf65f[_0x508849];return _0x3a77bb;};'use strict';var EventEmitter=require(_0xff65('0x0'));var VoiceQueueReport=require(_0xff65('0x1'))['db'][_0xff65('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xff65('0x3')](0x0);var events={'afterCreate':_0xff65('0x4'),'afterUpdate':_0xff65('0x5'),'afterDestroy':_0xff65('0x6')};function emitEvent(_0x2001e5){return function(_0x182b15,_0xae87c2,_0x8bd399){VoiceQueueReportEvents[_0xff65('0x7')](_0x2001e5+':'+_0x182b15['id'],_0x182b15);VoiceQueueReportEvents['emit'](_0x2001e5,_0x182b15);_0x8bd399(null);};}for(var e in events){if(events[_0xff65('0x8')](e)){var event=events[e];VoiceQueueReport[_0xff65('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xd6a9=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x2b4441,_0x3943a2){var _0x4c4c3a=function(_0x11b19e){while(--_0x11b19e){_0x2b4441['push'](_0x2b4441['shift']());}};_0x4c4c3a(++_0x3943a2);}(_0xd6a9,0x1eb));var _0x9d6a=function(_0x2782c5,_0x519c5f){_0x2782c5=_0x2782c5-0x0;var _0x5d011c=_0xd6a9[_0x2782c5];return _0x5d011c;};'use strict';var EventEmitter=require(_0x9d6a('0x0'));var VoiceQueueReport=require(_0x9d6a('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x9d6a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9d6a('0x3'),'afterDestroy':_0x9d6a('0x4')};function emitEvent(_0x478626){return function(_0x3abf5a,_0x5d1b8a,_0x6dd84){VoiceQueueReportEvents[_0x9d6a('0x5')](_0x478626+':'+_0x3abf5a['id'],_0x3abf5a);VoiceQueueReportEvents['emit'](_0x478626,_0x3abf5a);_0x6dd84(null);};}for(var e in events){if(events[_0x9d6a('0x6')](e)){var event=events[e];VoiceQueueReport[_0x9d6a('0x7')](e,emitEvent(event));}}module[_0x9d6a('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 e30a9da..5dabd3e 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 _0xb10b=['define','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x2f8805,_0x2f1d21){var _0xa16375=function(_0x1c5bcc){while(--_0x1c5bcc){_0x2f8805['push'](_0x2f8805['shift']());}};_0xa16375(++_0x2f1d21);}(_0xb10b,0x12a));var _0xbb10=function(_0x105c6a,_0x48c736){_0x105c6a=_0x105c6a-0x0;var _0x5b844d=_0xb10b[_0x105c6a];return _0x5b844d;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbb10('0xc')]},{'fields':[_0xbb10('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','VoiceQueueReport','report_queue','calleridnum','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0xf40309,_0x52ef14){var _0x48d0e5=function(_0x3b26d6){while(--_0x3b26d6){_0xf40309['push'](_0xf40309['shift']());}};_0x48d0e5(++_0x52ef14);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 7c728bc..c776dfb 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 _0x52f2=['result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','limit','map','include','model','attributes','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','info'];(function(_0x488f46,_0x54b996){var _0x23fbac=function(_0x19e8e1){while(--_0x19e8e1){_0x488f46['push'](_0x488f46['shift']());}};_0x23fbac(++_0x54b996);}(_0x52f2,0x98));var _0x252f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x52f2[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x252f('0x0'));var util=require(_0x252f('0x1'));var moment=require(_0x252f('0x2'));var BPromise=require(_0x252f('0x3'));var rs=require(_0x252f('0x4'));var fs=require('fs');var Redis=require(_0x252f('0x5'));var db=require(_0x252f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x252f('0x7'))(_0x252f('0x8'));var config=require(_0x252f('0x9'));var jayson=require(_0x252f('0xa'));var client=jayson[_0x252f('0xb')]['http']({'port':0x232a});config[_0x252f('0xc')]=_['defaults'](config[_0x252f('0xc')],{'host':_0x252f('0xd'),'port':0x18eb});var socket=require(_0x252f('0xe'))(new Redis(config[_0x252f('0xc')]));require(_0x252f('0xf'))[_0x252f('0x10')](socket);function respondWithRpcPromise(_0x42deed,_0x2d5ff1,_0x153671){return new BPromise(function(_0x242b82,_0x4a2820){return client[_0x252f('0x11')](_0x42deed,_0x153671)[_0x252f('0x12')](function(_0x1b6114){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x2d5ff1,_0x252f('0x13'));logger[_0x252f('0x14')](_0x252f('0x15'),_0x2d5ff1,_0x252f('0x13'),JSON[_0x252f('0x16')](_0x1b6114));if(_0x1b6114[_0x252f('0x17')]){if(_0x1b6114['error'][_0x252f('0x18')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x2d5ff1,_0x1b6114[_0x252f('0x17')][_0x252f('0x19')]);return _0x4a2820(_0x1b6114[_0x252f('0x17')]['message']);}logger[_0x252f('0x17')](_0x252f('0x1a'),_0x2d5ff1,_0x1b6114[_0x252f('0x17')]['message']);return _0x242b82(_0x1b6114[_0x252f('0x17')][_0x252f('0x19')]);}else{logger[_0x252f('0x1b')](_0x252f('0x1a'),_0x2d5ff1,_0x252f('0x13'));_0x242b82(_0x1b6114[_0x252f('0x1c')][_0x252f('0x19')]);}})[_0x252f('0x1d')](function(_0x1882c3){logger['error'](_0x252f('0x1a'),_0x2d5ff1,_0x1882c3);_0x4a2820(_0x1882c3);});});}exports[_0x252f('0x1e')]=function(_0x5331e4){var _0x4c2c69=this;return new Promise(function(_0x5b75fa,_0x11bc0a){return db[_0x252f('0x1f')][_0x252f('0x20')]({'raw':_0x5331e4['options']?_0x5331e4[_0x252f('0x21')][_0x252f('0x22')]===undefined?!![]:![]:!![],'where':_0x5331e4[_0x252f('0x21')]?_0x5331e4[_0x252f('0x21')]['where']||null:null,'attributes':_0x5331e4[_0x252f('0x21')]?_0x5331e4[_0x252f('0x21')]['attributes']||null:null,'limit':_0x5331e4[_0x252f('0x21')]?_0x5331e4[_0x252f('0x21')][_0x252f('0x23')]||null:null,'include':_0x5331e4['options']?_0x5331e4[_0x252f('0x21')]['include']?_[_0x252f('0x24')](_0x5331e4[_0x252f('0x21')]['include'],function(_0x5c8f63){return{'model':db[_0x5c8f63['model']],'as':_0x5c8f63['as'],'attributes':_0x5c8f63['attributes'],'include':_0x5c8f63[_0x252f('0x25')]?_[_0x252f('0x24')](_0x5c8f63[_0x252f('0x25')],function(_0xe2eb18){return{'model':db[_0xe2eb18['model']],'as':_0xe2eb18['as'],'attributes':_0xe2eb18['attributes'],'include':_0xe2eb18[_0x252f('0x25')]?_['map'](_0xe2eb18[_0x252f('0x25')],function(_0x25fdc9){return{'model':db[_0x25fdc9[_0x252f('0x26')]],'as':_0x25fdc9['as'],'attributes':_0x25fdc9[_0x252f('0x27')]};}):[]};}):[]};}):[]:[]})[_0x252f('0x12')](function(_0xc2e166){logger[_0x252f('0x1b')](_0x252f('0x1e'),_0x5331e4);logger['debug'](_0x252f('0x1e'),_0x5331e4,JSON[_0x252f('0x16')](_0xc2e166));_0x5b75fa(_0xc2e166);})[_0x252f('0x1d')](function(_0x413803){logger['error'](_0x252f('0x1e'),_0x413803[_0x252f('0x19')],_0x5331e4);_0x11bc0a(_0x4c2c69['error'](0x1f4,_0x413803[_0x252f('0x19')]));});});};exports[_0x252f('0x28')]=function(_0x350ce6){var _0x3efed0=this;return new Promise(function(_0x49cadf,_0x1e6dbe){return db[_0x252f('0x1f')][_0x252f('0x29')](_0x350ce6[_0x252f('0x2a')],{'raw':_0x350ce6[_0x252f('0x21')]?_0x350ce6['options'][_0x252f('0x22')]===undefined?!![]:![]:!![]})[_0x252f('0x12')](function(_0x495b31){logger[_0x252f('0x1b')]('CreateVoiceQueueReport',_0x350ce6);logger['debug']('CreateVoiceQueueReport',_0x350ce6,JSON[_0x252f('0x16')](_0x495b31));_0x49cadf(_0x495b31);})['catch'](function(_0x27ec0d){logger[_0x252f('0x17')]('CreateVoiceQueueReport',_0x27ec0d[_0x252f('0x19')],_0x350ce6);_0x1e6dbe(_0x3efed0[_0x252f('0x17')](0x1f4,_0x27ec0d['message']));});});};exports[_0x252f('0x2b')]=function(_0x117e62){var _0x314a66=this;return new Promise(function(_0x257008,_0x4e7c75){return db[_0x252f('0x1f')]['update'](_0x117e62[_0x252f('0x2a')],{'raw':_0x117e62[_0x252f('0x21')]?_0x117e62[_0x252f('0x21')][_0x252f('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x117e62['options']?_0x117e62[_0x252f('0x21')][_0x252f('0x2c')]||null:null,'attributes':_0x117e62[_0x252f('0x21')]?_0x117e62[_0x252f('0x21')]['attributes']||null:null,'limit':_0x117e62[_0x252f('0x21')]?_0x117e62[_0x252f('0x21')]['limit']||null:null})[_0x252f('0x12')](function(_0x42b3ce){logger[_0x252f('0x1b')](_0x252f('0x2b'),_0x117e62);logger[_0x252f('0x14')](_0x252f('0x2b'),_0x117e62,JSON[_0x252f('0x16')](_0x42b3ce));_0x257008(_0x42b3ce);})[_0x252f('0x1d')](function(_0x190e82){logger[_0x252f('0x17')](_0x252f('0x2b'),_0x190e82[_0x252f('0x19')],_0x117e62);_0x4e7c75(_0x314a66[_0x252f('0x17')](0x1f4,_0x190e82['message']));});});}; \ No newline at end of file +var _0x7d03=['where','attributes','map','include','model','GetVoiceQueueReport','debug','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','limit','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','register','then','info','VoiceQueueReport,\x20%s,\x20%s','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','VoiceQueueReport','findAll','options','raw'];(function(_0x205e5a,_0x5c19fb){var _0x10da58=function(_0x1ba35d){while(--_0x1ba35d){_0x205e5a['push'](_0x205e5a['shift']());}};_0x10da58(++_0x5c19fb);}(_0x7d03,0x103));var _0x37d0=function(_0x5d6dae,_0x416942){_0x5d6dae=_0x5d6dae-0x0;var _0xc51eef=_0x7d03[_0x5d6dae];return _0xc51eef;};'use strict';var _=require('lodash');var util=require(_0x37d0('0x0'));var moment=require(_0x37d0('0x1'));var BPromise=require(_0x37d0('0x2'));var rs=require(_0x37d0('0x3'));var fs=require('fs');var Redis=require(_0x37d0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x37d0('0x5'));var logger=require('../../config/logger')(_0x37d0('0x6'));var config=require('../../config/environment');var jayson=require(_0x37d0('0x7'));var client=jayson[_0x37d0('0x8')][_0x37d0('0x9')]({'port':0x232a});config[_0x37d0('0xa')]=_[_0x37d0('0xb')](config[_0x37d0('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37d0('0xa')]));require('./voiceQueueReport.socket')[_0x37d0('0xc')](socket);function respondWithRpcPromise(_0x52b1a0,_0x499370,_0x2d7f09){return new BPromise(function(_0x24c8de,_0x284441){return client['request'](_0x52b1a0,_0x2d7f09)[_0x37d0('0xd')](function(_0x6a81bf){logger[_0x37d0('0xe')](_0x37d0('0xf'),_0x499370,'request\x20sent');logger['debug'](_0x37d0('0x10'),_0x499370,'request\x20sent',JSON[_0x37d0('0x11')](_0x6a81bf));if(_0x6a81bf[_0x37d0('0x12')]){if(_0x6a81bf[_0x37d0('0x12')][_0x37d0('0x13')]===0x1f4){logger[_0x37d0('0x12')](_0x37d0('0xf'),_0x499370,_0x6a81bf[_0x37d0('0x12')][_0x37d0('0x14')]);return _0x284441(_0x6a81bf[_0x37d0('0x12')][_0x37d0('0x14')]);}logger[_0x37d0('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x499370,_0x6a81bf['error']['message']);return _0x24c8de(_0x6a81bf[_0x37d0('0x12')][_0x37d0('0x14')]);}else{logger['info'](_0x37d0('0xf'),_0x499370,_0x37d0('0x15'));_0x24c8de(_0x6a81bf[_0x37d0('0x16')]['message']);}})[_0x37d0('0x17')](function(_0x8d7d93){logger['error'](_0x37d0('0xf'),_0x499370,_0x8d7d93);_0x284441(_0x8d7d93);});});}exports['GetVoiceQueueReport']=function(_0x193926){var _0x25ad49=this;return new Promise(function(_0x214b56,_0x23d628){return db[_0x37d0('0x18')][_0x37d0('0x19')]({'raw':_0x193926['options']?_0x193926[_0x37d0('0x1a')][_0x37d0('0x1b')]===undefined?!![]:![]:!![],'where':_0x193926[_0x37d0('0x1a')]?_0x193926[_0x37d0('0x1a')][_0x37d0('0x1c')]||null:null,'attributes':_0x193926[_0x37d0('0x1a')]?_0x193926[_0x37d0('0x1a')][_0x37d0('0x1d')]||null:null,'limit':_0x193926[_0x37d0('0x1a')]?_0x193926[_0x37d0('0x1a')]['limit']||null:null,'include':_0x193926[_0x37d0('0x1a')]?_0x193926[_0x37d0('0x1a')]['include']?_[_0x37d0('0x1e')](_0x193926['options'][_0x37d0('0x1f')],function(_0x2ba97e){return{'model':db[_0x2ba97e[_0x37d0('0x20')]],'as':_0x2ba97e['as'],'attributes':_0x2ba97e[_0x37d0('0x1d')],'include':_0x2ba97e['include']?_[_0x37d0('0x1e')](_0x2ba97e[_0x37d0('0x1f')],function(_0x3b8c0b){return{'model':db[_0x3b8c0b[_0x37d0('0x20')]],'as':_0x3b8c0b['as'],'attributes':_0x3b8c0b['attributes'],'include':_0x3b8c0b[_0x37d0('0x1f')]?_['map'](_0x3b8c0b[_0x37d0('0x1f')],function(_0x28fc40){return{'model':db[_0x28fc40[_0x37d0('0x20')]],'as':_0x28fc40['as'],'attributes':_0x28fc40[_0x37d0('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x239526){logger[_0x37d0('0xe')](_0x37d0('0x21'),_0x193926);logger[_0x37d0('0x22')](_0x37d0('0x21'),_0x193926,JSON[_0x37d0('0x11')](_0x239526));_0x214b56(_0x239526);})[_0x37d0('0x17')](function(_0x4d3d74){logger['error']('GetVoiceQueueReport',_0x4d3d74[_0x37d0('0x14')],_0x193926);_0x23d628(_0x25ad49[_0x37d0('0x12')](0x1f4,_0x4d3d74[_0x37d0('0x14')]));});});};exports[_0x37d0('0x23')]=function(_0x2497c8){var _0x18ceee=this;return new Promise(function(_0x3da50a,_0x47d9e0){return db[_0x37d0('0x18')][_0x37d0('0x24')](_0x2497c8[_0x37d0('0x25')],{'raw':_0x2497c8['options']?_0x2497c8[_0x37d0('0x1a')][_0x37d0('0x1b')]===undefined?!![]:![]:!![]})[_0x37d0('0xd')](function(_0x5b0ce6){logger['info'](_0x37d0('0x23'),_0x2497c8);logger[_0x37d0('0x22')](_0x37d0('0x23'),_0x2497c8,JSON[_0x37d0('0x11')](_0x5b0ce6));_0x3da50a(_0x5b0ce6);})[_0x37d0('0x17')](function(_0x15e06c){logger[_0x37d0('0x12')](_0x37d0('0x23'),_0x15e06c['message'],_0x2497c8);_0x47d9e0(_0x18ceee[_0x37d0('0x12')](0x1f4,_0x15e06c[_0x37d0('0x14')]));});});};exports[_0x37d0('0x26')]=function(_0x582f34){var _0xc2d043=this;return new Promise(function(_0x5969ce,_0x435878){return db['VoiceQueueReport'][_0x37d0('0x27')](_0x582f34[_0x37d0('0x25')],{'raw':_0x582f34[_0x37d0('0x1a')]?_0x582f34[_0x37d0('0x1a')][_0x37d0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x582f34[_0x37d0('0x1a')]?_0x582f34[_0x37d0('0x1a')][_0x37d0('0x1c')]||null:null,'attributes':_0x582f34['options']?_0x582f34['options']['attributes']||null:null,'limit':_0x582f34[_0x37d0('0x1a')]?_0x582f34[_0x37d0('0x1a')][_0x37d0('0x28')]||null:null})[_0x37d0('0xd')](function(_0x309722){logger[_0x37d0('0xe')]('UpdateVoiceQueueReport',_0x582f34);logger[_0x37d0('0x22')](_0x37d0('0x26'),_0x582f34,JSON[_0x37d0('0x11')](_0x309722));_0x5969ce(_0x309722);})[_0x37d0('0x17')](function(_0xd0207d){logger[_0x37d0('0x12')](_0x37d0('0x26'),_0xd0207d[_0x37d0('0x14')],_0x582f34);_0x435878(_0xc2d043[_0x37d0('0x12')](0x1f4,_0xd0207d[_0x37d0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index d77a25d..f097e75 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 _0xc8cc=['update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0x4fd7d8,_0x15ef62){var _0x4e31bf=function(_0x41984c){while(--_0x41984c){_0x4fd7d8['push'](_0x4fd7d8['shift']());}};_0x4e31bf(++_0x15ef62);}(_0xc8cc,0x1b6));var _0xcc8c=function(_0x1e33fd,_0x12d3a5){_0x1e33fd=_0x1e33fd-0x0;var _0x4f4ea7=_0xc8cc[_0x1e33fd];return _0x4f4ea7;};'use strict';var VoiceQueueReportEvents=require(_0xcc8c('0x0'));var events=[_0xcc8c('0x1'),_0xcc8c('0x2'),_0xcc8c('0x3')];function createListener(_0x36e4ae,_0x1bdbe9){return function(_0x2b272d){_0x1bdbe9[_0xcc8c('0x4')](_0x36e4ae,_0x2b272d);};}function removeListener(_0x1ca193,_0x1494c1){return function(){VoiceQueueReportEvents[_0xcc8c('0x5')](_0x1ca193,_0x1494c1);};}exports[_0xcc8c('0x6')]=function(_0x27885d){for(var _0x544cdf=0x0,_0x3b1362=events[_0xcc8c('0x7')];_0x544cdf<_0x3b1362;_0x544cdf++){var _0x1b0b39=events[_0x544cdf];var _0x401c6c=createListener(_0xcc8c('0x8')+_0x1b0b39,_0x27885d);VoiceQueueReportEvents['on'](_0x1b0b39,_0x401c6c);}}; \ No newline at end of file +var _0xb1f8=['update','emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0xe76762,_0x4df5bd){var _0x174bb4=function(_0x2733e4){while(--_0x2733e4){_0xe76762['push'](_0xe76762['shift']());}};_0x174bb4(++_0x4df5bd);}(_0xb1f8,0xe5));var _0x8b1f=function(_0x429a3d,_0x595dcd){_0x429a3d=_0x429a3d-0x0;var _0x1bd66d=_0xb1f8[_0x429a3d];return _0x1bd66d;};'use strict';var VoiceQueueReportEvents=require(_0x8b1f('0x0'));var events=[_0x8b1f('0x1'),_0x8b1f('0x2'),_0x8b1f('0x3')];function createListener(_0xc6d67c,_0x31e394){return function(_0x582c33){_0x31e394[_0x8b1f('0x4')](_0xc6d67c,_0x582c33);};}function removeListener(_0x30e581,_0x43eae0){return function(){VoiceQueueReportEvents['removeListener'](_0x30e581,_0x43eae0);};}exports[_0x8b1f('0x5')]=function(_0x228ef0){for(var _0x2f368c=0x0,_0x455027=events[_0x8b1f('0x6')];_0x2f368c<_0x455027;_0x2f368c++){var _0x66d9ec=events[_0x2f368c];var _0x13e7cd=createListener(_0x8b1f('0x7')+_0x66d9ec,_0x228ef0);VoiceQueueReportEvents['on'](_0x66d9ec,_0x13e7cd);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 0ee782b..e963e92 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 _0x3024=['connect-timeout','express','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x39b271,_0x5be709){var _0x47b473=function(_0x3ef910){while(--_0x3ef910){_0x39b271['push'](_0x39b271['shift']());}};_0x47b473(++_0x5be709);}(_0x3024,0x64));var _0x4302=function(_0x5a8d27,_0x1aa051){_0x5a8d27=_0x5a8d27-0x0;var _0x227e66=_0x3024[_0x5a8d27];return _0x227e66;};'use strict';var multer=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var path=require('path');var timeout=require(_0x4302('0x2'));var express=require(_0x4302('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4302('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4302('0x5'));var controller=require(_0x4302('0x6'));router['get']('/',auth[_0x4302('0x7')](),controller[_0x4302('0x8')]);router['get'](_0x4302('0x9'),auth[_0x4302('0x7')](),controller[_0x4302('0xa')]);router[_0x4302('0xb')]('/',auth[_0x4302('0x7')](),controller[_0x4302('0xc')]);router[_0x4302('0xd')]('/:id',auth[_0x4302('0x7')](),controller[_0x4302('0xe')]);router[_0x4302('0xf')]('/:id',auth[_0x4302('0x7')](),controller[_0x4302('0x10')]);module['exports']=router; \ No newline at end of file +var _0x55c3=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x55c3,0x189));var _0x355c=function(_0x469cb0,_0x5b4dd5){_0x469cb0=_0x469cb0-0x0;var _0xdba9b=_0x55c3[_0x469cb0];return _0xdba9b;};'use strict';var multer=require('multer');var util=require(_0x355c('0x0'));var path=require(_0x355c('0x1'));var timeout=require(_0x355c('0x2'));var express=require(_0x355c('0x3'));var router=express[_0x355c('0x4')]();var fs_extra=require(_0x355c('0x5'));var auth=require(_0x355c('0x6'));var interaction=require(_0x355c('0x7'));var config=require(_0x355c('0x8'));var controller=require(_0x355c('0x9'));router[_0x355c('0xa')]('/',auth[_0x355c('0xb')](),controller[_0x355c('0xc')]);router[_0x355c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x355c('0xd')]);router[_0x355c('0xe')]('/',auth[_0x355c('0xb')](),controller[_0x355c('0xf')]);router[_0x355c('0x10')](_0x355c('0x11'),auth[_0x355c('0xb')](),controller[_0x355c('0x12')]);router[_0x355c('0x13')](_0x355c('0x11'),auth[_0x355c('0xb')](),controller[_0x355c('0x14')]);module[_0x355c('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 6b8dc8e..a7cbc15 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 _0x2fa4=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2fa4,0xe1));var _0x42fa=function(_0x198212,_0x4bd29a){_0x198212=_0x198212-0x0;var _0x338328=_0x2fa4[_0x198212];return _0x338328;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x42fa('0x0'));module[_0x42fa('0x1')]={'time':{'type':Sequelize[_0x42fa('0x2')]},'callid':{'type':Sequelize[_0x42fa('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x42fa('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x42fa('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x42fa('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x42fa('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x42fa('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x42fa('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x42fa('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x42fa('0x3')],'allowNull':![],'defaultValue':moment()[_0x42fa('0x4')](_0x42fa('0x5'))}}; \ No newline at end of file +var _0x3f2e=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE','format'];(function(_0x44ab4c,_0x14ad39){var _0x4c1ecf=function(_0x18526d){while(--_0x18526d){_0x44ab4c['push'](_0x44ab4c['shift']());}};_0x4c1ecf(++_0x14ad39);}(_0x3f2e,0x143));var _0xe3f2=function(_0x107844,_0x41926f){_0x107844=_0x107844-0x0;var _0x40c2b5=_0x3f2e[_0x107844];return _0x40c2b5;};'use strict';var Sequelize=require(_0xe3f2('0x0'));var moment=require(_0xe3f2('0x1'));module[_0xe3f2('0x2')]={'time':{'type':Sequelize[_0xe3f2('0x3')]},'callid':{'type':Sequelize[_0xe3f2('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xe3f2('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe3f2('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xe3f2('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xe3f2('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xe3f2('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xe3f2('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xe3f2('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe3f2('0x4')],'allowNull':![],'defaultValue':moment()[_0xe3f2('0x5')](_0xe3f2('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 15e50b2..b877af7 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 _0x81b8=['include','findAll','rows','catch','show','params','options','create','body','update','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','limit','sort','filters','pick','filter','merge','where','map','VIRTUAL','VoiceQueuesLog','includeAll'];(function(_0x5d93f0,_0x1a9059){var _0xa2a325=function(_0x598472){while(--_0x598472){_0x5d93f0['push'](_0x5d93f0['shift']());}};_0xa2a325(++_0x1a9059);}(_0x81b8,0x1ce));var _0x881b=function(_0x3db25a,_0x151fcd){_0x3db25a=_0x3db25a-0x0;var _0x458137=_0x81b8[_0x3db25a];return _0x458137;};'use strict';var emlformat=require(_0x881b('0x0'));var rimraf=require(_0x881b('0x1'));var zipdir=require(_0x881b('0x2'));var jsonpatch=require(_0x881b('0x3'));var rp=require(_0x881b('0x4'));var moment=require(_0x881b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x881b('0x6'));var sox=require('sox');var csv=require(_0x881b('0x7'));var ejs=require(_0x881b('0x8'));var fs=require('fs');var fs_extra=require(_0x881b('0x9'));var _=require(_0x881b('0xa'));var squel=require(_0x881b('0xb'));var crypto=require('crypto');var jsforce=require(_0x881b('0xc'));var deskjs=require(_0x881b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x881b('0xe'));var Papa=require(_0x881b('0xf'));var Redis=require(_0x881b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x881b('0x11'));var as=require(_0x881b('0x12'));var hardwareService=require(_0x881b('0x13'));var logger=require(_0x881b('0x14'))('api');var utils=require(_0x881b('0x15'));var config=require(_0x881b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x881b('0x17'))['db'];function respondWithStatusCode(_0x50da36,_0x2fab7b){_0x2fab7b=_0x2fab7b||0xcc;return function(_0x11f1ed){if(_0x11f1ed){return _0x50da36[_0x881b('0x18')](_0x2fab7b);}return _0x50da36[_0x881b('0x19')](_0x2fab7b)[_0x881b('0x1a')]();};}function respondWithResult(_0xea52d8,_0x30b2d6){_0x30b2d6=_0x30b2d6||0xc8;return function(_0xd4ae24){if(_0xd4ae24){return _0xea52d8[_0x881b('0x19')](_0x30b2d6)[_0x881b('0x1b')](_0xd4ae24);}};}function respondWithFilteredResult(_0x2c9e62,_0x284e66){return function(_0x3d8b0c){if(_0x3d8b0c){var _0x513637=typeof _0x284e66['offset']===_0x881b('0x1c')&&typeof _0x284e66['limit']==='undefined';var _0x38b0de=_0x3d8b0c[_0x881b('0x1d')];var _0x2c3387=_0x513637?0x0:_0x284e66[_0x881b('0x1e')];var _0x1b12f6=_0x513637?_0x3d8b0c[_0x881b('0x1d')]:_0x284e66[_0x881b('0x1e')]+_0x284e66['limit'];var _0x1f3e3c;if(_0x1b12f6>=_0x38b0de){_0x1b12f6=_0x38b0de;_0x1f3e3c=0xc8;}else{_0x1f3e3c=0xce;}_0x2c9e62['status'](_0x1f3e3c);return _0x2c9e62[_0x881b('0x1f')](_0x881b('0x20'),_0x2c3387+'-'+_0x1b12f6+'/'+_0x38b0de)['json'](_0x3d8b0c);}return null;};}function patchUpdates(_0x3d86d8){return function(_0x2323b8){try{jsonpatch[_0x881b('0x21')](_0x2323b8,_0x3d86d8,!![]);}catch(_0xec7bb8){return BPromise['reject'](_0xec7bb8);}return _0x2323b8[_0x881b('0x22')]();};}function saveUpdates(_0x1bcb49,_0x4e2e5c){return function(_0x57ce47){if(_0x57ce47){return _0x57ce47['update'](_0x1bcb49)[_0x881b('0x23')](function(_0x279838){return _0x279838;});}return null;};}function removeEntity(_0x9f5ba1,_0x9381a2){return function(_0x381dad){if(_0x381dad){return _0x381dad['destroy']()[_0x881b('0x23')](function(){_0x9f5ba1[_0x881b('0x19')](0xcc)[_0x881b('0x1a')]();});}};}function handleEntityNotFound(_0x167c3e,_0x478dd6){return function(_0x324a71){if(!_0x324a71){_0x167c3e[_0x881b('0x18')](0x194);}return _0x324a71;};}function handleError(_0x448649,_0x49b4af){_0x49b4af=_0x49b4af||0x1f4;return function(_0x53dc6c){logger[_0x881b('0x24')](_0x53dc6c[_0x881b('0x25')]);if(_0x53dc6c['name']){delete _0x53dc6c[_0x881b('0x26')];}_0x448649[_0x881b('0x19')](_0x49b4af)[_0x881b('0x27')](_0x53dc6c);};}exports['index']=function(_0x272631,_0x2e0561){var _0x2e4c73={},_0x3554e1={},_0x1b00bd={'count':0x0,'rows':[]};var _0x39a46d=_['map'](db['VoiceQueuesLog'][_0x881b('0x28')],function(_0x50c248){return{'name':_0x50c248[_0x881b('0x29')],'type':_0x50c248[_0x881b('0x2a')][_0x881b('0x2b')]};});_0x3554e1[_0x881b('0x2c')]=_['map'](_0x39a46d,_0x881b('0x26'));_0x3554e1['query']=_[_0x881b('0x2d')](_0x272631[_0x881b('0x2e')]);_0x3554e1['filters']=_[_0x881b('0x2f')](_0x3554e1[_0x881b('0x2c')],_0x3554e1[_0x881b('0x2e')]);_0x2e4c73['attributes']=_['intersection'](_0x3554e1[_0x881b('0x2c')],qs[_0x881b('0x30')](_0x272631['query']['fields']));_0x2e4c73[_0x881b('0x31')]=_0x2e4c73[_0x881b('0x31')][_0x881b('0x32')]?_0x2e4c73[_0x881b('0x31')]:_0x3554e1['model'];if(!_0x272631['query']['hasOwnProperty'](_0x881b('0x33'))){_0x2e4c73[_0x881b('0x34')]=qs['limit'](_0x272631[_0x881b('0x2e')]['limit']);_0x2e4c73[_0x881b('0x1e')]=qs[_0x881b('0x1e')](_0x272631[_0x881b('0x2e')][_0x881b('0x1e')]);}_0x2e4c73['order']=qs['sort'](_0x272631[_0x881b('0x2e')][_0x881b('0x35')]);_0x2e4c73['where']=qs[_0x881b('0x36')](_[_0x881b('0x37')](_0x272631[_0x881b('0x2e')],_0x3554e1[_0x881b('0x36')]),_0x39a46d);if(_0x272631[_0x881b('0x2e')][_0x881b('0x38')]){_0x2e4c73['where']=_[_0x881b('0x39')](_0x2e4c73[_0x881b('0x3a')],{'$or':_[_0x881b('0x3b')](_0x39a46d,function(_0x48ca78){if(_0x48ca78[_0x881b('0x2a')]!==_0x881b('0x3c')){var _0x49d8b9={};_0x49d8b9[_0x48ca78['name']]={'$like':'%'+_0x272631[_0x881b('0x2e')][_0x881b('0x38')]+'%'};return _0x49d8b9;}})});}_0x2e4c73=_['merge']({},_0x2e4c73,_0x272631['options']);var _0x2fbefd={'where':_0x2e4c73['where']};return db[_0x881b('0x3d')][_0x881b('0x1d')](_0x2fbefd)[_0x881b('0x23')](function(_0xa542db){_0x1b00bd[_0x881b('0x1d')]=_0xa542db;if(_0x272631[_0x881b('0x2e')][_0x881b('0x3e')]){_0x2e4c73[_0x881b('0x3f')]=[{'all':!![]}];}return db[_0x881b('0x3d')][_0x881b('0x40')](_0x2e4c73);})[_0x881b('0x23')](function(_0x56be26){_0x1b00bd[_0x881b('0x41')]=_0x56be26;return _0x1b00bd;})['then'](respondWithFilteredResult(_0x2e0561,_0x2e4c73))[_0x881b('0x42')](handleError(_0x2e0561,null));};exports[_0x881b('0x43')]=function(_0x3d4654,_0x13e9e9){var _0x3364d2={'raw':!![],'where':{'id':_0x3d4654[_0x881b('0x44')]['id']}},_0x515f1c={};_0x515f1c[_0x881b('0x2c')]=_[_0x881b('0x2d')](db[_0x881b('0x3d')][_0x881b('0x28')]);_0x515f1c['query']=_[_0x881b('0x2d')](_0x3d4654[_0x881b('0x2e')]);_0x515f1c[_0x881b('0x36')]=_[_0x881b('0x2f')](_0x515f1c[_0x881b('0x2c')],_0x515f1c['query']);_0x3364d2[_0x881b('0x31')]=_[_0x881b('0x2f')](_0x515f1c[_0x881b('0x2c')],qs['fields'](_0x3d4654[_0x881b('0x2e')]['fields']));_0x3364d2['attributes']=_0x3364d2['attributes']['length']?_0x3364d2[_0x881b('0x31')]:_0x515f1c[_0x881b('0x2c')];if(_0x3d4654[_0x881b('0x2e')][_0x881b('0x3e')]){_0x3364d2[_0x881b('0x3f')]=[{'all':!![]}];}_0x3364d2=_[_0x881b('0x39')]({},_0x3364d2,_0x3d4654[_0x881b('0x45')]);return db[_0x881b('0x3d')]['find'](_0x3364d2)[_0x881b('0x23')](handleEntityNotFound(_0x13e9e9,null))[_0x881b('0x23')](respondWithResult(_0x13e9e9,null))[_0x881b('0x42')](handleError(_0x13e9e9,null));};exports['create']=function(_0x51a4ff,_0x22165d){return db[_0x881b('0x3d')][_0x881b('0x46')](_0x51a4ff[_0x881b('0x47')],{})['then'](respondWithResult(_0x22165d,0xc9))[_0x881b('0x42')](handleError(_0x22165d,null));};exports[_0x881b('0x48')]=function(_0x3aced9,_0x5d9c1e){if(_0x3aced9[_0x881b('0x47')]['id']){delete _0x3aced9[_0x881b('0x47')]['id'];}return db['VoiceQueuesLog'][_0x881b('0x49')]({'where':{'id':_0x3aced9[_0x881b('0x44')]['id']}})[_0x881b('0x23')](handleEntityNotFound(_0x5d9c1e,null))['then'](saveUpdates(_0x3aced9['body'],null))[_0x881b('0x23')](respondWithResult(_0x5d9c1e,null))[_0x881b('0x42')](handleError(_0x5d9c1e,null));};exports[_0x881b('0x4a')]=function(_0x22f0ff,_0x1bf103){return db['VoiceQueuesLog'][_0x881b('0x49')]({'where':{'id':_0x22f0ff[_0x881b('0x44')]['id']}})['then'](handleEntityNotFound(_0x1bf103,null))[_0x881b('0x23')](removeEntity(_0x1bf103,null))[_0x881b('0x42')](handleError(_0x1bf103,null));}; \ No newline at end of file +var _0x823a=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x81b88e,_0x3d5378){var _0x1f21c7=function(_0x2a608f){while(--_0x2a608f){_0x81b88e['push'](_0x81b88e['shift']());}};_0x1f21c7(++_0x3d5378);}(_0x823a,0x14a));var _0xa823=function(_0x1cd633,_0x21c3db){_0x1cd633=_0x1cd633-0x0;var _0x5bf6d8=_0x823a[_0x1cd633];return _0x5bf6d8;};'use strict';var emlformat=require(_0xa823('0x0'));var rimraf=require(_0xa823('0x1'));var zipdir=require(_0xa823('0x2'));var jsonpatch=require(_0xa823('0x3'));var rp=require(_0xa823('0x4'));var moment=require(_0xa823('0x5'));var BPromise=require(_0xa823('0x6'));var Mustache=require(_0xa823('0x7'));var util=require(_0xa823('0x8'));var path=require(_0xa823('0x9'));var sox=require(_0xa823('0xa'));var csv=require(_0xa823('0xb'));var ejs=require(_0xa823('0xc'));var fs=require('fs');var fs_extra=require(_0xa823('0xd'));var _=require(_0xa823('0xe'));var squel=require('squel');var crypto=require(_0xa823('0xf'));var jsforce=require(_0xa823('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa823('0xb'));var querystring=require(_0xa823('0x11'));var Papa=require('papaparse');var Redis=require(_0xa823('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa823('0x13'));var as=require(_0xa823('0x14'));var hardwareService=require(_0xa823('0x15'));var logger=require(_0xa823('0x16'))(_0xa823('0x17'));var utils=require(_0xa823('0x18'));var config=require(_0xa823('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa823('0x1a'))['db'];function respondWithStatusCode(_0x24de27,_0x1842cc){_0x1842cc=_0x1842cc||0xcc;return function(_0x415d01){if(_0x415d01){return _0x24de27['sendStatus'](_0x1842cc);}return _0x24de27[_0xa823('0x1b')](_0x1842cc)[_0xa823('0x1c')]();};}function respondWithResult(_0xe8a990,_0x30907c){_0x30907c=_0x30907c||0xc8;return function(_0x2e226a){if(_0x2e226a){return _0xe8a990[_0xa823('0x1b')](_0x30907c)[_0xa823('0x1d')](_0x2e226a);}};}function respondWithFilteredResult(_0x396f38,_0xdae13f){return function(_0x33d755){if(_0x33d755){var _0x4d52b8=typeof _0xdae13f[_0xa823('0x1e')]==='undefined'&&typeof _0xdae13f[_0xa823('0x1f')]===_0xa823('0x20');var _0x4fa255=_0x33d755[_0xa823('0x21')];var _0x2995a4=_0x4d52b8?0x0:_0xdae13f[_0xa823('0x1e')];var _0x41ce0d=_0x4d52b8?_0x33d755[_0xa823('0x21')]:_0xdae13f[_0xa823('0x1e')]+_0xdae13f[_0xa823('0x1f')];var _0x28ee04;if(_0x41ce0d>=_0x4fa255){_0x41ce0d=_0x4fa255;_0x28ee04=0xc8;}else{_0x28ee04=0xce;}_0x396f38['status'](_0x28ee04);return _0x396f38[_0xa823('0x22')](_0xa823('0x23'),_0x2995a4+'-'+_0x41ce0d+'/'+_0x4fa255)['json'](_0x33d755);}return null;};}function patchUpdates(_0x515bc1){return function(_0x395dd2){try{jsonpatch[_0xa823('0x24')](_0x395dd2,_0x515bc1,!![]);}catch(_0x32b639){return BPromise[_0xa823('0x25')](_0x32b639);}return _0x395dd2[_0xa823('0x26')]();};}function saveUpdates(_0x3fba02,_0x35caad){return function(_0x4f9409){if(_0x4f9409){return _0x4f9409[_0xa823('0x27')](_0x3fba02)[_0xa823('0x28')](function(_0x143855){return _0x143855;});}return null;};}function removeEntity(_0x3fad27,_0x1712ee){return function(_0x5b5c56){if(_0x5b5c56){return _0x5b5c56[_0xa823('0x29')]()[_0xa823('0x28')](function(){_0x3fad27[_0xa823('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35b787,_0x55ca98){return function(_0x4ea99a){if(!_0x4ea99a){_0x35b787[_0xa823('0x2a')](0x194);}return _0x4ea99a;};}function handleError(_0xf4e58d,_0x129221){_0x129221=_0x129221||0x1f4;return function(_0x1bde9a){logger[_0xa823('0x2b')](_0x1bde9a[_0xa823('0x2c')]);if(_0x1bde9a[_0xa823('0x2d')]){delete _0x1bde9a[_0xa823('0x2d')];}_0xf4e58d[_0xa823('0x1b')](_0x129221)[_0xa823('0x2e')](_0x1bde9a);};}exports[_0xa823('0x2f')]=function(_0x9f7d79,_0x96fa6f){var _0x5bfccc={},_0x3a22d6={},_0xca4c77={'count':0x0,'rows':[]};var _0x51170c=_[_0xa823('0x30')](db[_0xa823('0x31')][_0xa823('0x32')],function(_0x1567ed){return{'name':_0x1567ed['fieldName'],'type':_0x1567ed[_0xa823('0x33')][_0xa823('0x34')]};});_0x3a22d6['model']=_[_0xa823('0x30')](_0x51170c,_0xa823('0x2d'));_0x3a22d6[_0xa823('0x35')]=_[_0xa823('0x36')](_0x9f7d79[_0xa823('0x35')]);_0x3a22d6[_0xa823('0x37')]=_[_0xa823('0x38')](_0x3a22d6[_0xa823('0x39')],_0x3a22d6['query']);_0x5bfccc['attributes']=_['intersection'](_0x3a22d6[_0xa823('0x39')],qs['fields'](_0x9f7d79[_0xa823('0x35')]['fields']));_0x5bfccc[_0xa823('0x3a')]=_0x5bfccc[_0xa823('0x3a')][_0xa823('0x3b')]?_0x5bfccc[_0xa823('0x3a')]:_0x3a22d6[_0xa823('0x39')];if(!_0x9f7d79[_0xa823('0x35')][_0xa823('0x3c')](_0xa823('0x3d'))){_0x5bfccc[_0xa823('0x1f')]=qs[_0xa823('0x1f')](_0x9f7d79['query'][_0xa823('0x1f')]);_0x5bfccc[_0xa823('0x1e')]=qs[_0xa823('0x1e')](_0x9f7d79[_0xa823('0x35')]['offset']);}_0x5bfccc['order']=qs[_0xa823('0x3e')](_0x9f7d79[_0xa823('0x35')]['sort']);_0x5bfccc[_0xa823('0x3f')]=qs['filters'](_[_0xa823('0x40')](_0x9f7d79[_0xa823('0x35')],_0x3a22d6[_0xa823('0x37')]),_0x51170c);if(_0x9f7d79[_0xa823('0x35')][_0xa823('0x41')]){_0x5bfccc['where']=_[_0xa823('0x42')](_0x5bfccc[_0xa823('0x3f')],{'$or':_[_0xa823('0x30')](_0x51170c,function(_0x4bdb26){if(_0x4bdb26[_0xa823('0x33')]!==_0xa823('0x43')){var _0x5f0b0d={};_0x5f0b0d[_0x4bdb26[_0xa823('0x2d')]]={'$like':'%'+_0x9f7d79[_0xa823('0x35')]['filter']+'%'};return _0x5f0b0d;}})});}_0x5bfccc=_['merge']({},_0x5bfccc,_0x9f7d79[_0xa823('0x44')]);var _0x31b681={'where':_0x5bfccc['where']};return db[_0xa823('0x31')]['count'](_0x31b681)[_0xa823('0x28')](function(_0x542a16){_0xca4c77[_0xa823('0x21')]=_0x542a16;if(_0x9f7d79[_0xa823('0x35')][_0xa823('0x45')]){_0x5bfccc[_0xa823('0x46')]=[{'all':!![]}];}return db[_0xa823('0x31')][_0xa823('0x47')](_0x5bfccc);})[_0xa823('0x28')](function(_0x303da6){_0xca4c77[_0xa823('0x48')]=_0x303da6;return _0xca4c77;})[_0xa823('0x28')](respondWithFilteredResult(_0x96fa6f,_0x5bfccc))[_0xa823('0x49')](handleError(_0x96fa6f,null));};exports['show']=function(_0x73a99c,_0x4b657c){var _0x19638f={'raw':!![],'where':{'id':_0x73a99c[_0xa823('0x4a')]['id']}},_0x222c27={};_0x222c27[_0xa823('0x39')]=_[_0xa823('0x36')](db[_0xa823('0x31')][_0xa823('0x32')]);_0x222c27['query']=_[_0xa823('0x36')](_0x73a99c[_0xa823('0x35')]);_0x222c27['filters']=_[_0xa823('0x38')](_0x222c27[_0xa823('0x39')],_0x222c27['query']);_0x19638f[_0xa823('0x3a')]=_[_0xa823('0x38')](_0x222c27[_0xa823('0x39')],qs['fields'](_0x73a99c[_0xa823('0x35')][_0xa823('0x4b')]));_0x19638f[_0xa823('0x3a')]=_0x19638f['attributes'][_0xa823('0x3b')]?_0x19638f[_0xa823('0x3a')]:_0x222c27[_0xa823('0x39')];if(_0x73a99c[_0xa823('0x35')][_0xa823('0x45')]){_0x19638f[_0xa823('0x46')]=[{'all':!![]}];}_0x19638f=_[_0xa823('0x42')]({},_0x19638f,_0x73a99c[_0xa823('0x44')]);return db[_0xa823('0x31')][_0xa823('0x4c')](_0x19638f)[_0xa823('0x28')](handleEntityNotFound(_0x4b657c,null))[_0xa823('0x28')](respondWithResult(_0x4b657c,null))[_0xa823('0x49')](handleError(_0x4b657c,null));};exports['create']=function(_0x2a2a74,_0x944f01){return db[_0xa823('0x31')][_0xa823('0x4d')](_0x2a2a74[_0xa823('0x4e')],{})[_0xa823('0x28')](respondWithResult(_0x944f01,0xc9))['catch'](handleError(_0x944f01,null));};exports['update']=function(_0x23f1b8,_0x99e67){if(_0x23f1b8['body']['id']){delete _0x23f1b8[_0xa823('0x4e')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x23f1b8[_0xa823('0x4a')]['id']}})[_0xa823('0x28')](handleEntityNotFound(_0x99e67,null))[_0xa823('0x28')](saveUpdates(_0x23f1b8[_0xa823('0x4e')],null))[_0xa823('0x28')](respondWithResult(_0x99e67,null))['catch'](handleError(_0x99e67,null));};exports[_0xa823('0x29')]=function(_0x38cdc7,_0x39fdec){return db[_0xa823('0x31')][_0xa823('0x4c')]({'where':{'id':_0x38cdc7['params']['id']}})[_0xa823('0x28')](handleEntityNotFound(_0x39fdec,null))['then'](removeEntity(_0x39fdec,null))[_0xa823('0x49')](handleError(_0x39fdec,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index e789255..33d1f9b 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 _0x2c41=['dtm','lodash','../../config/logger','api','moment','bluebird','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event'];(function(_0x48c33d,_0x3f79b0){var _0x14f61b=function(_0x5d310d){while(--_0x5d310d){_0x48c33d['push'](_0x48c33d['shift']());}};_0x14f61b(++_0x3f79b0);}(_0x2c41,0xd3));var _0x12c4=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0x2c41[_0x1bb47b];return _0x566418;};'use strict';var _=require(_0x12c4('0x0'));var util=require('util');var logger=require(_0x12c4('0x1'))(_0x12c4('0x2'));var moment=require(_0x12c4('0x3'));var BPromise=require(_0x12c4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x12c4('0x5'));var config=require('../../config/environment');var attributes=require(_0x12c4('0x6'));module[_0x12c4('0x7')]=function(_0x278ded,_0x126825){return _0x278ded[_0x12c4('0x8')](_0x12c4('0x9'),attributes,{'tableName':_0x12c4('0xa'),'paranoid':![],'indexes':[{'name':_0x12c4('0xb'),'fields':[_0x12c4('0xc'),_0x12c4('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x26ea=['define','VoiceQueuesLog','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueuesLog.attributes'];(function(_0x4cb5dd,_0x4bf8fa){var _0x1cd423=function(_0x278f32){while(--_0x278f32){_0x4cb5dd['push'](_0x4cb5dd['shift']());}};_0x1cd423(++_0x4bf8fa);}(_0x26ea,0x7d));var _0xa26e=function(_0x4fc0ba,_0x301b58){_0x4fc0ba=_0x4fc0ba-0x0;var _0x2432bb=_0x26ea[_0x4fc0ba];return _0x2432bb;};'use strict';var _=require(_0xa26e('0x0'));var util=require(_0xa26e('0x1'));var logger=require(_0xa26e('0x2'))(_0xa26e('0x3'));var moment=require(_0xa26e('0x4'));var BPromise=require(_0xa26e('0x5'));var rp=require(_0xa26e('0x6'));var fs=require('fs');var path=require(_0xa26e('0x7'));var rimraf=require(_0xa26e('0x8'));var config=require('../../config/environment');var attributes=require(_0xa26e('0x9'));module['exports']=function(_0x4b5e9a,_0x5ed556){return _0x4b5e9a[_0xa26e('0xa')](_0xa26e('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xa26e('0xc'),'fields':[_0xa26e('0xd'),_0xa26e('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 2e34215..02f4a54 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 _0xfef3=['lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfef3,0x118));var _0x3fef=function(_0x152c94,_0x1b9c39){_0x152c94=_0x152c94-0x0;var _0x4c46e8=_0xfef3[_0x152c94];return _0x4c46e8;};'use strict';var _=require(_0x3fef('0x0'));var util=require('util');var moment=require(_0x3fef('0x1'));var BPromise=require('bluebird');var rs=require(_0x3fef('0x2'));var fs=require('fs');var Redis=require(_0x3fef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fef('0x4'));var logger=require(_0x3fef('0x5'))('rpc');var config=require(_0x3fef('0x6'));var jayson=require(_0x3fef('0x7'));var client=jayson['client'][_0x3fef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f5b72,_0x800850,_0x33e00a){return new BPromise(function(_0x1fffc5,_0x41960c){return client[_0x3fef('0x9')](_0x5f5b72,_0x33e00a)[_0x3fef('0xa')](function(_0x31c30f){logger[_0x3fef('0xb')](_0x3fef('0xc'),_0x800850,_0x3fef('0xd'));logger[_0x3fef('0xe')](_0x3fef('0xf'),_0x800850,'request\x20sent',JSON[_0x3fef('0x10')](_0x31c30f));if(_0x31c30f[_0x3fef('0x11')]){if(_0x31c30f[_0x3fef('0x11')]['code']===0x1f4){logger[_0x3fef('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x800850,_0x31c30f[_0x3fef('0x11')][_0x3fef('0x12')]);return _0x41960c(_0x31c30f[_0x3fef('0x11')]['message']);}logger[_0x3fef('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x800850,_0x31c30f[_0x3fef('0x11')][_0x3fef('0x12')]);return _0x1fffc5(_0x31c30f['error'][_0x3fef('0x12')]);}else{logger[_0x3fef('0xb')](_0x3fef('0xc'),_0x800850,_0x3fef('0xd'));_0x1fffc5(_0x31c30f[_0x3fef('0x13')][_0x3fef('0x12')]);}})['catch'](function(_0x1cbdbb){logger[_0x3fef('0x11')](_0x3fef('0xc'),_0x800850,_0x1cbdbb);_0x41960c(_0x1cbdbb);});});} \ No newline at end of file +var _0xee4f=['VoiceQueuesLog,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','client','then','info','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x43177d,_0x4714ae){var _0x5319b8=function(_0x151f78){while(--_0x151f78){_0x43177d['push'](_0x43177d['shift']());}};_0x5319b8(++_0x4714ae);}(_0xee4f,0xad));var _0xfee4=function(_0x54b8e2,_0x5eabe1){_0x54b8e2=_0x54b8e2-0x0;var _0x34f93e=_0xee4f[_0x54b8e2];return _0x34f93e;};'use strict';var _=require(_0xfee4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfee4('0x1'));var rs=require(_0xfee4('0x2'));var fs=require('fs');var Redis=require(_0xfee4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfee4('0x4'));var logger=require('../../config/logger')(_0xfee4('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfee4('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52fb6b,_0x2fb1b3,_0x16cc9a){return new BPromise(function(_0x34908a,_0x4d3c71){return client['request'](_0x52fb6b,_0x16cc9a)[_0xfee4('0x7')](function(_0x11556d){logger[_0xfee4('0x8')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2fb1b3,'request\x20sent');logger[_0xfee4('0x9')](_0xfee4('0xa'),_0x2fb1b3,_0xfee4('0xb'),JSON['stringify'](_0x11556d));if(_0x11556d[_0xfee4('0xc')]){if(_0x11556d[_0xfee4('0xc')][_0xfee4('0xd')]===0x1f4){logger[_0xfee4('0xc')](_0xfee4('0xe'),_0x2fb1b3,_0x11556d[_0xfee4('0xc')][_0xfee4('0xf')]);return _0x4d3c71(_0x11556d['error'][_0xfee4('0xf')]);}logger[_0xfee4('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2fb1b3,_0x11556d[_0xfee4('0xc')][_0xfee4('0xf')]);return _0x34908a(_0x11556d[_0xfee4('0xc')][_0xfee4('0xf')]);}else{logger[_0xfee4('0x8')](_0xfee4('0xe'),_0x2fb1b3,_0xfee4('0xb'));_0x34908a(_0x11556d['result'][_0xfee4('0xf')]);}})[_0xfee4('0x10')](function(_0x437979){logger['error'](_0xfee4('0xe'),_0x2fb1b3,_0x437979);_0x4d3c71(_0x437979);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index cfa1286..a74d903 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 _0x674a=['show','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x674a,0x73));var _0xa674=function(_0x28bcf2,_0x198926){_0x28bcf2=_0x28bcf2-0x0;var _0x33b928=_0x674a[_0x28bcf2];return _0x33b928;};'use strict';var multer=require(_0xa674('0x0'));var util=require(_0xa674('0x1'));var path=require(_0xa674('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa674('0x3')]();var fs_extra=require(_0xa674('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa674('0x5'));var config=require(_0xa674('0x6'));var controller=require(_0xa674('0x7'));router['get']('/',auth[_0xa674('0x8')](),controller['index']);router['get']('/describe',auth[_0xa674('0x8')](),controller['describe']);router[_0xa674('0x9')](_0xa674('0xa'),auth[_0xa674('0x8')](),controller[_0xa674('0xb')]);router['get']('/:id/download',auth[_0xa674('0x8')](),controller['download']);router[_0xa674('0x9')](_0xa674('0xc'),controller[_0xa674('0xd')]);router['get'](_0xa674('0xe'),auth[_0xa674('0x8')](),controller[_0xa674('0xf')]);router[_0xa674('0x10')]('/',auth['isAuthenticated'](),controller[_0xa674('0x11')]);router[_0xa674('0x10')](_0xa674('0xe'),auth[_0xa674('0x8')](),controller['runTranscribe']);router['put'](_0xa674('0xa'),auth[_0xa674('0x8')](),controller['update']);router[_0xa674('0x12')]('/:id',auth[_0xa674('0x8')](),controller[_0xa674('0x13')]);module[_0xa674('0x14')]=router; \ No newline at end of file +var _0xaed4=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','create','delete','destroy','exports'];(function(_0x31b11d,_0x5d7fa9){var _0x1c1668=function(_0x1dda89){while(--_0x1dda89){_0x31b11d['push'](_0x31b11d['shift']());}};_0x1c1668(++_0x5d7fa9);}(_0xaed4,0xc8));var _0x4aed=function(_0x34733c,_0x28ed8c){_0x34733c=_0x34733c-0x0;var _0x2e3e3c=_0xaed4[_0x34733c];return _0x2e3e3c;};'use strict';var multer=require('multer');var util=require(_0x4aed('0x0'));var path=require(_0x4aed('0x1'));var timeout=require(_0x4aed('0x2'));var express=require(_0x4aed('0x3'));var router=express[_0x4aed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4aed('0x5'));var interaction=require(_0x4aed('0x6'));var config=require(_0x4aed('0x7'));var controller=require(_0x4aed('0x8'));router[_0x4aed('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4aed('0xa'),auth[_0x4aed('0xb')](),controller[_0x4aed('0xc')]);router['get'](_0x4aed('0xd'),auth[_0x4aed('0xb')](),controller[_0x4aed('0xe')]);router[_0x4aed('0x9')](_0x4aed('0xf'),auth[_0x4aed('0xb')](),controller[_0x4aed('0x10')]);router[_0x4aed('0x9')](_0x4aed('0x11'),controller[_0x4aed('0x12')]);router[_0x4aed('0x9')](_0x4aed('0x13'),auth[_0x4aed('0xb')](),controller['downloadTranscribe']);router[_0x4aed('0x14')]('/',auth[_0x4aed('0xb')](),controller[_0x4aed('0x15')]);router[_0x4aed('0x14')](_0x4aed('0x13'),auth[_0x4aed('0xb')](),controller['runTranscribe']);router['put'](_0x4aed('0xd'),auth[_0x4aed('0xb')](),controller['update']);router[_0x4aed('0x16')](_0x4aed('0xd'),auth[_0x4aed('0xb')](),controller[_0x4aed('0x17')]);module[_0x4aed('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 09743d9..fc7ac82 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 _0x06fb=['sequelize','moment','path','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','membername','split','INTEGER','TEXT','NEW','FLOAT','BOOLEAN','createdAt','format','MM-DD-YYYY\x20HH:mm','DATE','updatedAt','toString'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0x06fb,0x1e4));var _0xb06f=function(_0x1e20c8,_0x48dc04){_0x1e20c8=_0x1e20c8-0x0;var _0x4e18b0=_0x06fb[_0x1e20c8];return _0x4e18b0;};'use strict';var Sequelize=require(_0xb06f('0x0'));var moment=require(_0xb06f('0x1'));var path=require(_0xb06f('0x2'));module['exports']={'format':{'type':Sequelize[_0xb06f('0x3')],'get':function(){return this[_0xb06f('0x4')](_0xb06f('0x5'))?path[_0xb06f('0x6')](this['getDataValue'](_0xb06f('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0xb06f('0x7')]},'channel':{'type':Sequelize[_0xb06f('0x7')],'set':function(_0x20f9dc){if(_0x20f9dc){this[_0xb06f('0x8')]('channel',_0x20f9dc);this[_0xb06f('0x8')](_0xb06f('0x9'),_0x20f9dc[_0xb06f('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xb06f('0x7')]},'calleridnum':{'type':Sequelize[_0xb06f('0x7')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb06f('0x7')]},'connectedlinename':{'type':Sequelize[_0xb06f('0x7')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb06f('0x7')]},'exten':{'type':Sequelize[_0xb06f('0x7')]},'value':{'type':Sequelize[_0xb06f('0x7')]},'type':{'type':Sequelize[_0xb06f('0x7')]},'rating':{'type':Sequelize[_0xb06f('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xb06f('0x7')]},'userSecondDisposition':{'type':Sequelize[_0xb06f('0x7')]},'userThirdDisposition':{'type':Sequelize[_0xb06f('0x7')]},'location':{'type':Sequelize[_0xb06f('0xc')]},'transcribeName':{'type':Sequelize[_0xb06f('0x7')]},'transcribeStatus':{'type':Sequelize['STRING'],'defaultValue':_0xb06f('0xd')},'fileUri':{'type':Sequelize[_0xb06f('0xc')]},'fileText':{'type':Sequelize[_0xb06f('0xc')]},'failureReason':{'type':Sequelize[_0xb06f('0xc')]},'sentiment':{'type':Sequelize['STRING']},'sPositive':{'type':Sequelize[_0xb06f('0xe')]},'sNegative':{'type':Sequelize[_0xb06f('0xe')]},'sNeutral':{'type':Sequelize[_0xb06f('0xe')]},'sMixed':{'type':Sequelize[_0xb06f('0xe')]},'tempSentiment':{'type':Sequelize[_0xb06f('0xf')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb06f('0x4')](_0xb06f('0x10')))[_0xb06f('0x11')](_0xb06f('0x12'))['toString']();}},'updatedAt':{'type':Sequelize[_0xb06f('0x13')],'get':function(){return moment(this['getDataValue'](_0xb06f('0x14')))[_0xb06f('0x11')](_0xb06f('0x12'))[_0xb06f('0x15')]();}}}; \ No newline at end of file +var _0x0c11=['BOOLEAN','createdAt','format','MM-DD-YYYY\x20HH:mm','DATE','updatedAt','toString','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','STRING','setDataValue','channel','membername','split','INTEGER','TEXT','NEW','FLOAT'];(function(_0x1cd577,_0x180f2a){var _0x790837=function(_0x2cace5){while(--_0x2cace5){_0x1cd577['push'](_0x1cd577['shift']());}};_0x790837(++_0x180f2a);}(_0x0c11,0x149));var _0x10c1=function(_0x1c208e,_0x2a0a5b){_0x1c208e=_0x1c208e-0x0;var _0x5104ff=_0x0c11[_0x1c208e];return _0x5104ff;};'use strict';var Sequelize=require(_0x10c1('0x0'));var moment=require(_0x10c1('0x1'));var path=require(_0x10c1('0x2'));module[_0x10c1('0x3')]={'format':{'type':Sequelize[_0x10c1('0x4')],'get':function(){return this[_0x10c1('0x5')](_0x10c1('0x6'))?path['extname'](this[_0x10c1('0x5')](_0x10c1('0x6'))):undefined;}},'uniqueid':{'type':Sequelize[_0x10c1('0x7')]},'channel':{'type':Sequelize[_0x10c1('0x7')],'set':function(_0x5cc3a1){if(_0x5cc3a1){this[_0x10c1('0x8')](_0x10c1('0x9'),_0x5cc3a1);this[_0x10c1('0x8')](_0x10c1('0xa'),_0x5cc3a1[_0x10c1('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x10c1('0x7')]},'calleridnum':{'type':Sequelize[_0x10c1('0x7')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x10c1('0x7')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x10c1('0x7')]},'context':{'type':Sequelize[_0x10c1('0x7')]},'exten':{'type':Sequelize[_0x10c1('0x7')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x10c1('0x7')]},'rating':{'type':Sequelize[_0x10c1('0xc')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x10c1('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x10c1('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x10c1('0x7')]},'location':{'type':Sequelize[_0x10c1('0xd')]},'transcribeName':{'type':Sequelize[_0x10c1('0x7')]},'transcribeStatus':{'type':Sequelize[_0x10c1('0x7')],'defaultValue':_0x10c1('0xe')},'fileUri':{'type':Sequelize[_0x10c1('0xd')]},'fileText':{'type':Sequelize['TEXT']},'failureReason':{'type':Sequelize[_0x10c1('0xd')]},'sentiment':{'type':Sequelize['STRING']},'sPositive':{'type':Sequelize['FLOAT']},'sNegative':{'type':Sequelize[_0x10c1('0xf')]},'sNeutral':{'type':Sequelize['FLOAT']},'sMixed':{'type':Sequelize[_0x10c1('0xf')]},'tempSentiment':{'type':Sequelize[_0x10c1('0x10')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x10c1('0x11')))[_0x10c1('0x12')](_0x10c1('0x13'))['toString']();}},'updatedAt':{'type':Sequelize[_0x10c1('0x14')],'get':function(){return moment(this['getDataValue'](_0x10c1('0x15')))[_0x10c1('0x12')](_0x10c1('0x13'))[_0x10c1('0x16')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 989f611..7e92cad 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 _0xd3b3=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','stack','name','send','map','rawAttributes','fieldName','key','model','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','VoiceRecording','then','include','findAll','rows','show','params','keys','includeAll','catch','create','body','describe','../../components/encryptor','uniqueid','find','value','%s.cypher','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','decryptFile','secrets','recording','destroy','Entity\x20not\x20found','info','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','data1','IN_PROGRESS','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash'];(function(_0xe08054,_0x22c584){var _0x5c3e9d=function(_0x3e461a){while(--_0x3e461a){_0xe08054['push'](_0xe08054['shift']());}};_0x5c3e9d(++_0x22c584);}(_0xd3b3,0x8a));var _0x3d3b=function(_0x2a960f,_0x5aab73){_0x2a960f=_0x2a960f-0x0;var _0x5027df=_0xd3b3[_0x2a960f];return _0x5027df;};'use strict';var emlformat=require(_0x3d3b('0x0'));var rimraf=require(_0x3d3b('0x1'));var zipdir=require(_0x3d3b('0x2'));var jsonpatch=require(_0x3d3b('0x3'));var rp=require(_0x3d3b('0x4'));var moment=require('moment');var BPromise=require(_0x3d3b('0x5'));var Mustache=require(_0x3d3b('0x6'));var util=require(_0x3d3b('0x7'));var path=require('path');var sox=require(_0x3d3b('0x8'));var csv=require(_0x3d3b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d3b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3d3b('0xb'));var toCsv=require(_0x3d3b('0x9'));var querystring=require(_0x3d3b('0xc'));var Papa=require(_0x3d3b('0xd'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x3d3b('0xe'));var authService=require(_0x3d3b('0xf'));var qs=require(_0x3d3b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d3b('0x11'));var logger=require('../../config/logger')(_0x3d3b('0x12'));var utils=require(_0x3d3b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3d3b('0x14'));var db=require(_0x3d3b('0x15'))['db'];function respondWithStatusCode(_0x3e7aaa,_0x520247){_0x520247=_0x520247||0xcc;return function(_0x3dd4ed){if(_0x3dd4ed){return _0x3e7aaa['sendStatus'](_0x520247);}return _0x3e7aaa[_0x3d3b('0x16')](_0x520247)[_0x3d3b('0x17')]();};}function respondWithResult(_0x400a41,_0x24591d){_0x24591d=_0x24591d||0xc8;return function(_0x11e85e){if(_0x11e85e){return _0x400a41[_0x3d3b('0x16')](_0x24591d)[_0x3d3b('0x18')](_0x11e85e);}};}function respondWithFilteredResult(_0x398a1f,_0x25ad5e){return function(_0x384cd9){if(_0x384cd9){var _0x16de43=typeof _0x25ad5e[_0x3d3b('0x19')]===_0x3d3b('0x1a')&&typeof _0x25ad5e[_0x3d3b('0x1b')]===_0x3d3b('0x1a');var _0xed47e7=_0x384cd9['count'];var _0x5054ab=_0x16de43?0x0:_0x25ad5e[_0x3d3b('0x19')];var _0x198f88=_0x16de43?_0x384cd9[_0x3d3b('0x1c')]:_0x25ad5e[_0x3d3b('0x19')]+_0x25ad5e[_0x3d3b('0x1b')];var _0x554145;if(_0x198f88>=_0xed47e7){_0x198f88=_0xed47e7;_0x554145=0xc8;}else{_0x554145=0xce;}_0x398a1f[_0x3d3b('0x16')](_0x554145);return _0x398a1f[_0x3d3b('0x1d')](_0x3d3b('0x1e'),_0x5054ab+'-'+_0x198f88+'/'+_0xed47e7)['json'](_0x384cd9);}return null;};}function patchUpdates(_0x31cb16){return function(_0x5d9537){try{jsonpatch[_0x3d3b('0x1f')](_0x5d9537,_0x31cb16,!![]);}catch(_0x51b28a){return BPromise[_0x3d3b('0x20')](_0x51b28a);}return _0x5d9537['save']();};}function saveUpdates(_0x4b82b7,_0x22445b){return function(_0x21b7ed){if(_0x21b7ed){return _0x21b7ed[_0x3d3b('0x21')](_0x4b82b7)['then'](function(_0x57acc6){return _0x57acc6;});}return null;};}function removeEntity(_0x8c7d1c,_0x4f5b95){return function(_0x1b4e6c){if(_0x1b4e6c){return _0x1b4e6c['destroy']()['then'](function(){_0x8c7d1c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1927d1,_0x14e3bb){return function(_0x30ad82){if(!_0x30ad82){_0x1927d1['sendStatus'](0x194);}return _0x30ad82;};}function handleError(_0x4a7f0b,_0x1e1789){_0x1e1789=_0x1e1789||0x1f4;return function(_0x579107){logger['error'](_0x579107[_0x3d3b('0x22')]);if(_0x579107[_0x3d3b('0x23')]){delete _0x579107[_0x3d3b('0x23')];}_0x4a7f0b['status'](_0x1e1789)[_0x3d3b('0x24')](_0x579107);};}exports['index']=function(_0x15ba3e,_0x499e88){var _0x3b60bf={},_0x448f2e={},_0x4b1f74={'count':0x0,'rows':[]};var _0x129612=_[_0x3d3b('0x25')](db['VoiceRecording'][_0x3d3b('0x26')],function(_0x238d33){return{'name':_0x238d33[_0x3d3b('0x27')],'type':_0x238d33['type'][_0x3d3b('0x28')]};});_0x448f2e[_0x3d3b('0x29')]=_['differenceBy'](_[_0x3d3b('0x25')](_0x129612,_0x3d3b('0x23')),[_0x3d3b('0x2a')]);_0x448f2e[_0x3d3b('0x2b')]=_['keys'](_0x15ba3e[_0x3d3b('0x2b')]);_0x448f2e[_0x3d3b('0x2c')]=_[_0x3d3b('0x2d')](_0x448f2e[_0x3d3b('0x29')],_0x448f2e['query']);_0x3b60bf[_0x3d3b('0x2e')]=_[_0x3d3b('0x2d')](_0x448f2e['model'],qs[_0x3d3b('0x2f')](_0x15ba3e[_0x3d3b('0x2b')]['fields']));_0x3b60bf[_0x3d3b('0x2e')]=_0x3b60bf[_0x3d3b('0x2e')][_0x3d3b('0x30')]?_0x3b60bf['attributes']:_0x448f2e[_0x3d3b('0x29')];if(!_0x15ba3e[_0x3d3b('0x2b')][_0x3d3b('0x31')](_0x3d3b('0x32'))){_0x3b60bf[_0x3d3b('0x1b')]=qs['limit'](_0x15ba3e['query']['limit']);_0x3b60bf[_0x3d3b('0x19')]=qs[_0x3d3b('0x19')](_0x15ba3e['query'][_0x3d3b('0x19')]);}_0x3b60bf[_0x3d3b('0x33')]=qs[_0x3d3b('0x34')](_0x15ba3e[_0x3d3b('0x2b')][_0x3d3b('0x34')]);_0x3b60bf[_0x3d3b('0x35')]=qs['filters'](_[_0x3d3b('0x36')](_0x15ba3e[_0x3d3b('0x2b')],_0x448f2e[_0x3d3b('0x2c')]),_0x129612);if(_0x15ba3e[_0x3d3b('0x2b')][_0x3d3b('0x37')]){_0x3b60bf[_0x3d3b('0x35')]=_[_0x3d3b('0x38')](_0x3b60bf['where'],{'$or':_[_0x3d3b('0x25')](_0x129612,function(_0x340707){if(_0x340707[_0x3d3b('0x39')]!==_0x3d3b('0x3a')){var _0xa1d94d={};_0xa1d94d[_0x340707[_0x3d3b('0x23')]]={'$like':'%'+_0x15ba3e[_0x3d3b('0x2b')][_0x3d3b('0x37')]+'%'};return _0xa1d94d;}})});}_0x3b60bf=_['merge']({},_0x3b60bf,_0x15ba3e['options']);var _0x1ce12b={'where':_0x3b60bf[_0x3d3b('0x35')]};return db[_0x3d3b('0x3b')][_0x3d3b('0x1c')](_0x1ce12b)[_0x3d3b('0x3c')](function(_0x1c00c2){_0x4b1f74[_0x3d3b('0x1c')]=_0x1c00c2;if(_0x15ba3e['query']['includeAll']){_0x3b60bf[_0x3d3b('0x3d')]=[{'all':!![]}];}return db['VoiceRecording'][_0x3d3b('0x3e')](_0x3b60bf);})['then'](function(_0x3781ad){_0x4b1f74[_0x3d3b('0x3f')]=_0x3781ad;return _0x4b1f74;})['then'](respondWithFilteredResult(_0x499e88,_0x3b60bf))['catch'](handleError(_0x499e88,null));};exports[_0x3d3b('0x40')]=function(_0x154a1d,_0x46bbe5){var _0x2925f8={'raw':![],'where':{'id':_0x154a1d[_0x3d3b('0x41')]['id']}},_0x30d2e5={};_0x30d2e5[_0x3d3b('0x29')]=_[_0x3d3b('0x42')](db['VoiceRecording'][_0x3d3b('0x26')]);_0x30d2e5[_0x3d3b('0x2b')]=_[_0x3d3b('0x42')](_0x154a1d[_0x3d3b('0x2b')]);_0x30d2e5[_0x3d3b('0x2c')]=_[_0x3d3b('0x2d')](_0x30d2e5[_0x3d3b('0x29')],_0x30d2e5[_0x3d3b('0x2b')]);_0x2925f8[_0x3d3b('0x2e')]=_['intersection'](_0x30d2e5[_0x3d3b('0x29')],qs[_0x3d3b('0x2f')](_0x154a1d[_0x3d3b('0x2b')][_0x3d3b('0x2f')]));_0x2925f8[_0x3d3b('0x2e')]=_0x2925f8[_0x3d3b('0x2e')][_0x3d3b('0x30')]?_0x2925f8[_0x3d3b('0x2e')]:_0x30d2e5[_0x3d3b('0x29')];if(_0x154a1d[_0x3d3b('0x2b')][_0x3d3b('0x43')]){_0x2925f8[_0x3d3b('0x3d')]=[{'all':!![]}];}_0x2925f8=_[_0x3d3b('0x38')]({},_0x2925f8,_0x154a1d['options']);return db['VoiceRecording']['find'](_0x2925f8)[_0x3d3b('0x3c')](handleEntityNotFound(_0x46bbe5,null))[_0x3d3b('0x3c')](respondWithResult(_0x46bbe5,null))[_0x3d3b('0x44')](handleError(_0x46bbe5,null));};exports['create']=function(_0x3d86eb,_0x43055b){return db[_0x3d3b('0x3b')][_0x3d3b('0x45')](_0x3d86eb['body'],{})[_0x3d3b('0x3c')](respondWithResult(_0x43055b,0xc9))['catch'](handleError(_0x43055b,null));};exports[_0x3d3b('0x21')]=function(_0x2badf3,_0x5ca85f){if(_0x2badf3[_0x3d3b('0x46')]['id']){delete _0x2badf3[_0x3d3b('0x46')]['id'];}return db[_0x3d3b('0x3b')]['find']({'where':{'id':_0x2badf3[_0x3d3b('0x41')]['id']}})['then'](handleEntityNotFound(_0x5ca85f,null))['then'](saveUpdates(_0x2badf3['body'],null))[_0x3d3b('0x3c')](respondWithResult(_0x5ca85f,null))['catch'](handleError(_0x5ca85f,null));};exports[_0x3d3b('0x47')]=function(_0x3acd35,_0x2cdc8f){return db['VoiceRecording']['describe']()[_0x3d3b('0x3c')](respondWithResult(_0x2cdc8f,null))[_0x3d3b('0x44')](handleError(_0x2cdc8f,null));};exports['download']=function(_0x393a31,_0x10fd1d,_0x2fcc45){var _0x55c242=require(_0x3d3b('0x48'));var _0x410def=![];var _0x4161db={};if(_0x393a31[_0x3d3b('0x2b')][_0x3d3b('0x39')]&&_0x393a31[_0x3d3b('0x2b')]['type']===_0x3d3b('0x49')){_0x4161db[_0x3d3b('0x49')]=_0x393a31[_0x3d3b('0x41')]['id'];}else{_0x4161db['id']=_0x393a31[_0x3d3b('0x41')]['id'];}return db[_0x3d3b('0x3b')][_0x3d3b('0x4a')]({'where':_0x4161db,'attributes':['id',_0x3d3b('0x4b')],'raw':!![]})[_0x3d3b('0x3c')](handleEntityNotFound(_0x10fd1d,null))[_0x3d3b('0x3c')](function(_0xc6a8ed){if(_0xc6a8ed){var _0x740316=_0xc6a8ed['value'];var _0x53d90b=util[_0x3d3b('0x2a')](_0x3d3b('0x4c'),_0x740316);if(fs['existsSync'](_0x53d90b)){_0x410def=!![];return _0x55c242['decryptFile'](_0x53d90b,_0x740316,config['secrets']['recording'])[_0x3d3b('0x3c')](function(){return _0xc6a8ed;});}return _0xc6a8ed;}})[_0x3d3b('0x3c')](function(_0x3399a4){if(_0x3399a4){var _0x477f1d=_0x3399a4[_0x3d3b('0x4b')];if(!fs[_0x3d3b('0x4d')](_0x477f1d)){throw new db[(_0x3d3b('0x4e'))][(_0x3d3b('0x4f'))](_0x3d3b('0x50'));}if(_0x3399a4[_0x3d3b('0x51')]){return _0x10fd1d[_0x3d3b('0x52')](_0x477f1d,_0x3399a4[_0x3d3b('0x51')]+path[_0x3d3b('0x53')](_0x477f1d),function(){if(_0x410def){fs[_0x3d3b('0x54')](_0x477f1d);}});}else{return _0x10fd1d[_0x3d3b('0x52')](_0x477f1d,function(_0x1bdf48){if(_0x410def){fs[_0x3d3b('0x54')](_0x477f1d);}});}}})['catch'](function(_0x4154af){if(_0x4154af[_0x3d3b('0x55')]===_0x3d3b('0x50')){_0x10fd1d[_0x3d3b('0x16')](0x194)[_0x3d3b('0x24')](_0x3d3b('0x56'));}else{return handleError(_0x10fd1d,null);}});};exports[_0x3d3b('0x57')]=function(_0x4b388c,_0x163040,_0x4c2c09){var _0x24473d=require('../../components/encryptor');var _0x86eb33=![];var _0x4eaa9e={'$and':[db[_0x3d3b('0x58')][_0x3d3b('0x35')](db[_0x3d3b('0x58')]['fn'](_0x3d3b('0x59'),db['sequelize'][_0x3d3b('0x5a')](_0x3d3b('0x49'))),_0x4b388c[_0x3d3b('0x2b')][_0x3d3b('0x5b')])]};if(_0x4b388c['query'][_0x3d3b('0x39')]&&_0x4b388c[_0x3d3b('0x2b')][_0x3d3b('0x39')]===_0x3d3b('0x49')){_0x4eaa9e[_0x3d3b('0x5c')][_0x3d3b('0x5d')]({'uniqueid':_0x4b388c[_0x3d3b('0x41')]['id']});}else{_0x4eaa9e[_0x3d3b('0x5c')][_0x3d3b('0x5d')]({'id':_0x4b388c[_0x3d3b('0x41')]['id']});}return db[_0x3d3b('0x3b')][_0x3d3b('0x4a')]({'where':_0x4eaa9e,'attributes':['id',_0x3d3b('0x4b')],'raw':!![]})[_0x3d3b('0x3c')](handleEntityNotFound(_0x163040,null))['then'](function(_0x3be9fa){if(_0x3be9fa){var _0x89832d=util['format'](_0x3d3b('0x4c'),_0x3be9fa['value']);if(fs[_0x3d3b('0x4d')](_0x89832d)){_0x86eb33=!![];return _0x24473d[_0x3d3b('0x5e')](_0x89832d,_0x3be9fa[_0x3d3b('0x4b')],config[_0x3d3b('0x5f')][_0x3d3b('0x60')])[_0x3d3b('0x3c')](function(){return _0x3be9fa;});}return _0x3be9fa;}})['then'](function(_0x50a384){if(_0x50a384){if(!fs['existsSync'](_0x50a384[_0x3d3b('0x4b')])){throw new db['Sequelize'][(_0x3d3b('0x4f'))](_0x3d3b('0x50'));}if(_0x50a384[_0x3d3b('0x51')]){return _0x163040[_0x3d3b('0x52')](_0x50a384[_0x3d3b('0x4b')],_0x50a384[_0x3d3b('0x51')]+path[_0x3d3b('0x53')](_0x50a384[_0x3d3b('0x4b')]),function(){if(_0x86eb33){fs[_0x3d3b('0x54')](_0x50a384['value']);}});}else{return _0x163040[_0x3d3b('0x52')](_0x50a384[_0x3d3b('0x4b')],function(_0x4aa92c){if(_0x86eb33){fs[_0x3d3b('0x54')](_0x50a384[_0x3d3b('0x4b')]);}});}}})[_0x3d3b('0x44')](handleError(_0x163040,null));};exports[_0x3d3b('0x61')]=function(_0xc0206c,_0x4b85ea){return db[_0x3d3b('0x3b')][_0x3d3b('0x4a')]({'where':{'id':_0xc0206c['params']['id']}})[_0x3d3b('0x3c')](function(_0x565cb3){if(_['isNil'](_0x565cb3)){throw new ReferenceError(_0x3d3b('0x62'));}return _0x565cb3;})[_0x3d3b('0x3c')](function(_0x32954a){var _0x504942=_0x32954a['value'];logger[_0x3d3b('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x504942);if(!_['isNil'](_0x32954a[_0x3d3b('0x4b')])&&fs[_0x3d3b('0x4d')](_0x504942)){logger[_0x3d3b('0x63')](_0x3d3b('0x64')+_0x504942+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3d3b('0x65')](_0x504942);}_0x504942=_0x504942+'.cypher';if(!_['isNil'](_0x32954a[_0x3d3b('0x4b')])&&fs[_0x3d3b('0x4d')](_0x504942)){logger['info'](_0x3d3b('0x64')+_0x504942+_0x3d3b('0x66'));fs[_0x3d3b('0x65')](_0x504942);}return _0x32954a;})[_0x3d3b('0x3c')](function(_0x1f5994){if(!_0x1f5994)throw new InternalError();return _0x1f5994[_0x3d3b('0x61')]();})[_0x3d3b('0x3c')](function(){_0x4b85ea[_0x3d3b('0x16')](0xcc)['end']();})['catch'](handleError(_0x4b85ea,null));};function getBucketslist(_0x3233ad,_0x279fce,_0x256b30){return new Promise(function(_0x106359,_0x2802d3){var _0x2c2040=new AWS['S3']({'accessKeyId':_0x279fce,'secretAccessKey':_0x3233ad,'region':_0x256b30});_0x2c2040[_0x3d3b('0x67')]({},function(_0x29438b,_0x3875d2){if(_0x29438b){return _0x2802d3(_0x29438b);}else{return _0x106359(_0x3875d2);}});});}function createBucket(_0x4094ba,_0x72e990,_0x7eda2d,_0x4ed036){return new Promise(function(_0x137db5,_0x25ddd6){var _0x18b893=new AWS['S3']({'accessKeyId':_0x72e990,'secretAccessKey':_0x4094ba,'region':_0x7eda2d});_0x18b893['createBucket']({'Bucket':_0x4ed036},function(_0xb09570,_0x1bbcd0){if(_0xb09570){return _0x25ddd6(_0xb09570);}else{return _0x137db5(_0x1bbcd0);}});});}function uploadFile(_0x41075d,_0x32eaa9,_0x3d4539,_0x4c9007,_0x26085c,_0x2952e0){return new Promise(function(_0x5e8b27,_0x4c4a2b){var _0x232b1b=new AWS['S3']({'accessKeyId':_0x32eaa9,'secretAccessKey':_0x41075d,'region':_0x3d4539});_0x232b1b[_0x3d3b('0x68')]({'Bucket':_0x4c9007,'Key':_0x26085c,'Body':_0x2952e0},function(_0xa38814,_0x49fd81){if(_0xa38814){return _0x4c4a2b(_0xa38814);}else{return _0x5e8b27(_0x49fd81);}});});}function startTranscribe(_0x36f5d2,_0x5d8d65,_0x2339ef,_0x559850,_0x101d0c,_0x37ceb7){return new Promise(function(_0x2a0e2c,_0x2e62f7){var _0x2e707e=new AWS[(_0x3d3b('0x69'))]({'accessKeyId':_0x5d8d65,'secretAccessKey':_0x36f5d2,'region':_0x2339ef});_0x2e707e[_0x3d3b('0x6a')]({'TranscriptionJobName':_0x559850,'LanguageCode':_0x101d0c,'Media':{'MediaFileUri':_0x37ceb7}},function(_0x50f1ff,_0x2bc471){if(_0x50f1ff){return _0x2e62f7(_0x50f1ff);}else{return _0x2a0e2c(_0x2bc471);}});});}function transcribe(_0x503fa2,_0x10b2c6,_0x5538c3,_0x5e9a74,_0x4955b1,_0x1679f7,_0x3cf358){return new Promise(function(_0x3b1316,_0x59f4d4){var _0x513a68={};logger[_0x3d3b('0x63')](util['format'](_0x3d3b('0x6b'),_0x503fa2,_0x4955b1));return uploadFile(_0x10b2c6,_0x5538c3,_0x5e9a74,_0x4955b1,path[_0x3d3b('0x6c')](_0x1679f7),fs[_0x3d3b('0x6d')](_0x1679f7))['then'](function(_0x36ae26){logger[_0x3d3b('0x63')](util['format'](_0x3d3b('0x6e'),_0x503fa2,_0x4955b1,_0x36ae26[_0x3d3b('0x6f')]));_0x513a68['bucket']=_0x36ae26[_0x3d3b('0x70')];_0x513a68[_0x3d3b('0x71')]=_0x36ae26[_0x3d3b('0x6f')];logger[_0x3d3b('0x63')](util[_0x3d3b('0x2a')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x503fa2));return startTranscribe(_0x10b2c6,_0x5538c3,_0x5e9a74,uuidv4(),_0x3cf358,_0x36ae26[_0x3d3b('0x6f')]);})[_0x3d3b('0x3c')](function(_0x584ae4){logger[_0x3d3b('0x63')](util['format'](_0x3d3b('0x72'),_0x503fa2,_0x584ae4[_0x3d3b('0x73')][_0x3d3b('0x74')]));_0x513a68[_0x3d3b('0x75')]=_0x584ae4[_0x3d3b('0x73')]['TranscriptionJobName'];_0x513a68[_0x3d3b('0x76')]=_0x584ae4[_0x3d3b('0x73')]['TranscriptionJobStatus'];return _0x3b1316(_0x513a68);})[_0x3d3b('0x44')](function(_0x1fb25b){return _0x59f4d4(_0x1fb25b);});});}exports[_0x3d3b('0x77')]=function(_0x3b49bb,_0x27c327,_0x3d9b9d){var _0x34be62;var _0x48b190;var _0xd695c5;var _0x11c83c=require(_0x3d3b('0x48'));return db[_0x3d3b('0x3b')][_0x3d3b('0x78')]({'where':{'id':_0x3b49bb[_0x3d3b('0x41')]['id']}})['then'](function(_0x8c6fbc){if(_0x8c6fbc){var _0x128b9f=util[_0x3d3b('0x2a')](_0x3d3b('0x4c'),_0x8c6fbc[_0x3d3b('0x4b')]);if(fs[_0x3d3b('0x4d')](_0x128b9f)){cypher=!![];return _0x11c83c['decryptFile'](_0x128b9f,_0x8c6fbc['value'],config['secrets'][_0x3d3b('0x60')])[_0x3d3b('0x3c')](function(){return _0x8c6fbc;});}return _0x8c6fbc;}})['then'](function(_0x593558){if(!_0x593558){throw new db[(_0x3d3b('0x4e'))][(_0x3d3b('0x4f'))](_0x3d3b('0x79'));}_0x48b190=_0x593558;return db[_0x3d3b('0x7a')][_0x3d3b('0x78')]({'where':{'id':0x1}});})[_0x3d3b('0x3c')](handleEntityNotFound(_0x27c327,null))[_0x3d3b('0x3c')](function(_0x2bc823){if(_0x2bc823){_0x34be62=_0x2bc823;if(!_0x34be62['transcribe']||!_0x34be62[_0x3d3b('0x7b')]||!_0x34be62['transcribeRegion']||!_0x34be62[_0x3d3b('0x7c')]||!_0x34be62['bucket']){throw new db[(_0x3d3b('0x4e'))][(_0x3d3b('0x4f'))](_0x3d3b('0x7d'));}if(_0x3b49bb[_0x3d3b('0x46')][_0x3d3b('0x7e')]&&(!_0x34be62[_0x3d3b('0x7f')]||!_0x34be62['sentimentAccountId']||!_0x34be62[_0x3d3b('0x80')]||!_0x34be62[_0x3d3b('0x7c')]||!_0x34be62[_0x3d3b('0x81')])){throw new db[(_0x3d3b('0x4e'))][(_0x3d3b('0x4f'))](_0x3d3b('0x82'));}return db[_0x3d3b('0x83')]['findOne']({'where':{'id':_0x34be62[_0x3d3b('0x7b')]}});}})[_0x3d3b('0x3c')](function(_0x2b7609){if(!_0x2b7609){throw new db['Sequelize'][(_0x3d3b('0x4f'))](_0x3d3b('0x84'));}if(!_0x2b7609['data1']||!_0x2b7609['data2']){throw new db['Sequelize'][(_0x3d3b('0x4f'))]('Cloud\x20Provider\x20not\x20configured');}_0xd695c5=_0x2b7609;return getBucketslist(_0xd695c5['data1'],_0xd695c5[_0x3d3b('0x85')],_0x34be62[_0x3d3b('0x86')]);})[_0x3d3b('0x3c')](function(_0x3a1490){if(_0x3a1490&&_0x3a1490[_0x3d3b('0x87')]){var _0x598d79=_[_0x3d3b('0x4a')](_0x3a1490['Buckets'],function(_0x14a4bd){return _0x14a4bd[_0x3d3b('0x88')]===_0x34be62[_0x3d3b('0x81')];});if(!_0x598d79){logger[_0x3d3b('0x63')](util[_0x3d3b('0x2a')](_0x3d3b('0x89'),_0x3b49bb['params']['id'],_0x34be62[_0x3d3b('0x81')]));return createBucket(_0xd695c5['data1'],_0xd695c5[_0x3d3b('0x85')],_0x34be62[_0x3d3b('0x86')],_0x34be62[_0x3d3b('0x81')]);}logger[_0x3d3b('0x63')](util[_0x3d3b('0x2a')](_0x3d3b('0x8a'),_0x3b49bb[_0x3d3b('0x41')]['id'],_0x34be62['bucket']));return;}})[_0x3d3b('0x3c')](function(_0x12223a){if(_0x48b190[_0x3d3b('0x76')]===_0x3d3b('0x8b')){return transcribe(_0x3b49bb[_0x3d3b('0x41')]['id'],_0xd695c5[_0x3d3b('0x8c')],_0xd695c5['data2'],_0x34be62[_0x3d3b('0x86')],_0x34be62[_0x3d3b('0x81')],_0x48b190[_0x3d3b('0x4b')],_0x34be62[_0x3d3b('0x7c')]);}else{logger[_0x3d3b('0x63')](util[_0x3d3b('0x2a')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x3b49bb[_0x3d3b('0x41')]['id']));return{'transcribeStatus':_0x3d3b('0x8d')};}})['then'](function(_0x3fb96e){if(_0x3fb96e){_0x3fb96e['tempSentiment']=_0x3b49bb[_0x3d3b('0x46')][_0x3d3b('0x7e')];return _0x48b190[_0x3d3b('0x8e')](_0x3fb96e);}})[_0x3d3b('0x3c')](respondWithResult(_0x27c327,null))[_0x3d3b('0x44')](handleError(_0x27c327,null));};function writeFile(_0x24e3cc,_0x571217){return new Promise(function(_0x11b5c9,_0x4e0d74){fs[_0x3d3b('0x8f')](_0x571217,_0x24e3cc,function(_0x589804,_0x547a96){if(_0x589804){return _0x4e0d74(_0x589804);}else{return _0x11b5c9(_0x547a96);}});});}exports['downloadTranscribe']=function(_0x56ee7c,_0x25ff10,_0x2e9d30){return db[_0x3d3b('0x3b')][_0x3d3b('0x78')]({'where':{'id':_0x56ee7c[_0x3d3b('0x41')]['id']}})[_0x3d3b('0x3c')](handleEntityNotFound(_0x25ff10))[_0x3d3b('0x3c')](function(_0x24ee4e){if(_0x24ee4e&&_0x24ee4e['fileText']){var _0x28f2c6=_0x24ee4e[_0x3d3b('0x90')];var _0x1fd674=config[_0x3d3b('0x91')]+_0x3d3b('0x92')+_0x24ee4e['id']+_0x3d3b('0x93');if(fs[_0x3d3b('0x4d')](_0x1fd674)){return _0x1fd674;}return writeFile(_0x28f2c6,_0x1fd674)[_0x3d3b('0x3c')](function(){return _0x1fd674;});}else{throw new db[(_0x3d3b('0x4e'))][(_0x3d3b('0x4f'))](_0x3d3b('0x94'));}})['then'](function(_0x9ef943){return _0x25ff10[_0x3d3b('0x52')](_0x9ef943);})['catch'](handleError(_0x25ff10));}; \ No newline at end of file +var _0x1c86=['unlinkSync','.cypher','info','File:\x20\x22','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','transcribeStatus','TranscriptionJobStatus','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','Buckets','Name','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','error','name','send','index','map','VoiceRecording','fieldName','type','key','query','keys','intersection','attributes','fields','length','model','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rawAttributes','include','find','catch','create','body','params','describe','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','secrets','value','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','col','token','push','$and','format','recording','destroy','isNil','Entity\x20not\x20found'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1c86,0xc9));var _0x61c8=function(_0x37e8a1,_0x225770){_0x37e8a1=_0x37e8a1-0x0;var _0x14c5d0=_0x1c86[_0x37e8a1];return _0x14c5d0;};'use strict';var emlformat=require(_0x61c8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x61c8('0x1'));var rp=require(_0x61c8('0x2'));var moment=require(_0x61c8('0x3'));var BPromise=require(_0x61c8('0x4'));var Mustache=require('mustache');var util=require(_0x61c8('0x5'));var path=require(_0x61c8('0x6'));var sox=require(_0x61c8('0x7'));var csv=require(_0x61c8('0x8'));var ejs=require(_0x61c8('0x9'));var fs=require('fs');var fs_extra=require(_0x61c8('0xa'));var _=require('lodash');var squel=require(_0x61c8('0xb'));var crypto=require(_0x61c8('0xc'));var jsforce=require(_0x61c8('0xd'));var deskjs=require(_0x61c8('0xe'));var toCsv=require(_0x61c8('0x8'));var querystring=require('querystring');var Papa=require(_0x61c8('0xf'));var AWS=require(_0x61c8('0x10'));var uuidv4=require(_0x61c8('0x11'));var Redis=require(_0x61c8('0x12'));var authService=require(_0x61c8('0x13'));var qs=require(_0x61c8('0x14'));var as=require(_0x61c8('0x15'));var hardwareService=require(_0x61c8('0x16'));var logger=require('../../config/logger')(_0x61c8('0x17'));var utils=require(_0x61c8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x61c8('0x19'));var db=require(_0x61c8('0x1a'))['db'];function respondWithStatusCode(_0x48c8ed,_0x4572f6){_0x4572f6=_0x4572f6||0xcc;return function(_0x447efa){if(_0x447efa){return _0x48c8ed[_0x61c8('0x1b')](_0x4572f6);}return _0x48c8ed['status'](_0x4572f6)[_0x61c8('0x1c')]();};}function respondWithResult(_0x13ec1b,_0x3ad4d8){_0x3ad4d8=_0x3ad4d8||0xc8;return function(_0x14a1d6){if(_0x14a1d6){return _0x13ec1b[_0x61c8('0x1d')](_0x3ad4d8)[_0x61c8('0x1e')](_0x14a1d6);}};}function respondWithFilteredResult(_0x6f9e91,_0xa97545){return function(_0x559ff1){if(_0x559ff1){var _0x326ca0=typeof _0xa97545[_0x61c8('0x1f')]===_0x61c8('0x20')&&typeof _0xa97545[_0x61c8('0x21')]==='undefined';var _0x5bc86d=_0x559ff1[_0x61c8('0x22')];var _0x1530b7=_0x326ca0?0x0:_0xa97545[_0x61c8('0x1f')];var _0x4549b8=_0x326ca0?_0x559ff1[_0x61c8('0x22')]:_0xa97545[_0x61c8('0x1f')]+_0xa97545[_0x61c8('0x21')];var _0x50d605;if(_0x4549b8>=_0x5bc86d){_0x4549b8=_0x5bc86d;_0x50d605=0xc8;}else{_0x50d605=0xce;}_0x6f9e91[_0x61c8('0x1d')](_0x50d605);return _0x6f9e91['set']('Content-Range',_0x1530b7+'-'+_0x4549b8+'/'+_0x5bc86d)[_0x61c8('0x1e')](_0x559ff1);}return null;};}function patchUpdates(_0xf28186){return function(_0x4da359){try{jsonpatch[_0x61c8('0x23')](_0x4da359,_0xf28186,!![]);}catch(_0x301116){return BPromise[_0x61c8('0x24')](_0x301116);}return _0x4da359[_0x61c8('0x25')]();};}function saveUpdates(_0x2f5249,_0x169f46){return function(_0x18997b){if(_0x18997b){return _0x18997b[_0x61c8('0x26')](_0x2f5249)[_0x61c8('0x27')](function(_0x2a9dd0){return _0x2a9dd0;});}return null;};}function removeEntity(_0x4647fc,_0x2198d2){return function(_0x540760){if(_0x540760){return _0x540760['destroy']()[_0x61c8('0x27')](function(){_0x4647fc['status'](0xcc)[_0x61c8('0x1c')]();});}};}function handleEntityNotFound(_0x22971d,_0x5544e7){return function(_0x4c3375){if(!_0x4c3375){_0x22971d[_0x61c8('0x1b')](0x194);}return _0x4c3375;};}function handleError(_0x1ab81c,_0x3dc612){_0x3dc612=_0x3dc612||0x1f4;return function(_0x296151){logger[_0x61c8('0x28')](_0x296151['stack']);if(_0x296151[_0x61c8('0x29')]){delete _0x296151[_0x61c8('0x29')];}_0x1ab81c[_0x61c8('0x1d')](_0x3dc612)[_0x61c8('0x2a')](_0x296151);};}exports[_0x61c8('0x2b')]=function(_0x3ad2f2,_0xcc4bc5){var _0x4f7098={},_0x2ca909={},_0xad66d0={'count':0x0,'rows':[]};var _0x4e6e79=_[_0x61c8('0x2c')](db[_0x61c8('0x2d')]['rawAttributes'],function(_0x4d6a1b){return{'name':_0x4d6a1b[_0x61c8('0x2e')],'type':_0x4d6a1b[_0x61c8('0x2f')][_0x61c8('0x30')]};});_0x2ca909['model']=_['differenceBy'](_[_0x61c8('0x2c')](_0x4e6e79,_0x61c8('0x29')),['format']);_0x2ca909[_0x61c8('0x31')]=_[_0x61c8('0x32')](_0x3ad2f2[_0x61c8('0x31')]);_0x2ca909['filters']=_[_0x61c8('0x33')](_0x2ca909['model'],_0x2ca909[_0x61c8('0x31')]);_0x4f7098[_0x61c8('0x34')]=_[_0x61c8('0x33')](_0x2ca909['model'],qs[_0x61c8('0x35')](_0x3ad2f2[_0x61c8('0x31')][_0x61c8('0x35')]));_0x4f7098['attributes']=_0x4f7098['attributes'][_0x61c8('0x36')]?_0x4f7098['attributes']:_0x2ca909[_0x61c8('0x37')];if(!_0x3ad2f2['query']['hasOwnProperty']('nolimit')){_0x4f7098['limit']=qs[_0x61c8('0x21')](_0x3ad2f2[_0x61c8('0x31')]['limit']);_0x4f7098[_0x61c8('0x1f')]=qs[_0x61c8('0x1f')](_0x3ad2f2[_0x61c8('0x31')][_0x61c8('0x1f')]);}_0x4f7098[_0x61c8('0x38')]=qs[_0x61c8('0x39')](_0x3ad2f2['query'][_0x61c8('0x39')]);_0x4f7098[_0x61c8('0x3a')]=qs[_0x61c8('0x3b')](_[_0x61c8('0x3c')](_0x3ad2f2[_0x61c8('0x31')],_0x2ca909['filters']),_0x4e6e79);if(_0x3ad2f2[_0x61c8('0x31')][_0x61c8('0x3d')]){_0x4f7098[_0x61c8('0x3a')]=_[_0x61c8('0x3e')](_0x4f7098[_0x61c8('0x3a')],{'$or':_[_0x61c8('0x2c')](_0x4e6e79,function(_0x3e1cc3){if(_0x3e1cc3['type']!=='VIRTUAL'){var _0x32e80b={};_0x32e80b[_0x3e1cc3['name']]={'$like':'%'+_0x3ad2f2[_0x61c8('0x31')]['filter']+'%'};return _0x32e80b;}})});}_0x4f7098=_['merge']({},_0x4f7098,_0x3ad2f2[_0x61c8('0x3f')]);var _0x252925={'where':_0x4f7098[_0x61c8('0x3a')]};return db[_0x61c8('0x2d')]['count'](_0x252925)['then'](function(_0x15b111){_0xad66d0[_0x61c8('0x22')]=_0x15b111;if(_0x3ad2f2[_0x61c8('0x31')][_0x61c8('0x40')]){_0x4f7098['include']=[{'all':!![]}];}return db[_0x61c8('0x2d')][_0x61c8('0x41')](_0x4f7098);})[_0x61c8('0x27')](function(_0x17465c){_0xad66d0['rows']=_0x17465c;return _0xad66d0;})[_0x61c8('0x27')](respondWithFilteredResult(_0xcc4bc5,_0x4f7098))['catch'](handleError(_0xcc4bc5,null));};exports['show']=function(_0x224206,_0x3d2fdc){var _0x1b9c2e={'raw':![],'where':{'id':_0x224206['params']['id']}},_0x42b0c5={};_0x42b0c5['model']=_[_0x61c8('0x32')](db['VoiceRecording'][_0x61c8('0x42')]);_0x42b0c5[_0x61c8('0x31')]=_[_0x61c8('0x32')](_0x224206[_0x61c8('0x31')]);_0x42b0c5[_0x61c8('0x3b')]=_[_0x61c8('0x33')](_0x42b0c5[_0x61c8('0x37')],_0x42b0c5[_0x61c8('0x31')]);_0x1b9c2e[_0x61c8('0x34')]=_[_0x61c8('0x33')](_0x42b0c5[_0x61c8('0x37')],qs[_0x61c8('0x35')](_0x224206[_0x61c8('0x31')][_0x61c8('0x35')]));_0x1b9c2e[_0x61c8('0x34')]=_0x1b9c2e[_0x61c8('0x34')][_0x61c8('0x36')]?_0x1b9c2e[_0x61c8('0x34')]:_0x42b0c5['model'];if(_0x224206['query'][_0x61c8('0x40')]){_0x1b9c2e[_0x61c8('0x43')]=[{'all':!![]}];}_0x1b9c2e=_[_0x61c8('0x3e')]({},_0x1b9c2e,_0x224206[_0x61c8('0x3f')]);return db[_0x61c8('0x2d')][_0x61c8('0x44')](_0x1b9c2e)[_0x61c8('0x27')](handleEntityNotFound(_0x3d2fdc,null))['then'](respondWithResult(_0x3d2fdc,null))[_0x61c8('0x45')](handleError(_0x3d2fdc,null));};exports[_0x61c8('0x46')]=function(_0x3a1188,_0x1937b3){return db['VoiceRecording']['create'](_0x3a1188['body'],{})[_0x61c8('0x27')](respondWithResult(_0x1937b3,0xc9))[_0x61c8('0x45')](handleError(_0x1937b3,null));};exports['update']=function(_0x3a468d,_0x20fc2f){if(_0x3a468d[_0x61c8('0x47')]['id']){delete _0x3a468d[_0x61c8('0x47')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x3a468d[_0x61c8('0x48')]['id']}})['then'](handleEntityNotFound(_0x20fc2f,null))['then'](saveUpdates(_0x3a468d[_0x61c8('0x47')],null))[_0x61c8('0x27')](respondWithResult(_0x20fc2f,null))[_0x61c8('0x45')](handleError(_0x20fc2f,null));};exports[_0x61c8('0x49')]=function(_0x249e03,_0x216b75){return db[_0x61c8('0x2d')][_0x61c8('0x49')]()['then'](respondWithResult(_0x216b75,null))[_0x61c8('0x45')](handleError(_0x216b75,null));};exports[_0x61c8('0x4a')]=function(_0x3f1b1b,_0x11ea75,_0x43d5d9){var _0x58e99a=require(_0x61c8('0x4b'));var _0x3ad3ed=![];var _0x6b25e2={};if(_0x3f1b1b[_0x61c8('0x31')][_0x61c8('0x2f')]&&_0x3f1b1b['query']['type']==='uniqueid'){_0x6b25e2[_0x61c8('0x4c')]=_0x3f1b1b[_0x61c8('0x48')]['id'];}else{_0x6b25e2['id']=_0x3f1b1b[_0x61c8('0x48')]['id'];}return db[_0x61c8('0x2d')][_0x61c8('0x44')]({'where':_0x6b25e2,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x11ea75,null))[_0x61c8('0x27')](function(_0x2ba773){if(_0x2ba773){var _0x41bd56=_0x2ba773['value'];var _0xfd39db=util['format'](_0x61c8('0x4d'),_0x41bd56);if(fs[_0x61c8('0x4e')](_0xfd39db)){_0x3ad3ed=!![];return _0x58e99a[_0x61c8('0x4f')](_0xfd39db,_0x41bd56,config[_0x61c8('0x50')]['recording'])[_0x61c8('0x27')](function(){return _0x2ba773;});}return _0x2ba773;}})[_0x61c8('0x27')](function(_0x46e31c){if(_0x46e31c){var _0x291234=_0x46e31c[_0x61c8('0x51')];if(!fs[_0x61c8('0x4e')](_0x291234)){throw new db[(_0x61c8('0x52'))][(_0x61c8('0x53'))](_0x61c8('0x54'));}if(_0x46e31c[_0x61c8('0x55')]){return _0x11ea75['download'](_0x291234,_0x46e31c[_0x61c8('0x55')]+path[_0x61c8('0x56')](_0x291234),function(){if(_0x3ad3ed){fs[_0x61c8('0x57')](_0x291234);}});}else{return _0x11ea75['download'](_0x291234,function(_0x543e22){if(_0x3ad3ed){fs[_0x61c8('0x57')](_0x291234);}});}}})[_0x61c8('0x45')](function(_0x37e1cb){if(_0x37e1cb[_0x61c8('0x58')]===_0x61c8('0x54')){_0x11ea75[_0x61c8('0x1d')](0x194)['send']('Not\x20found');}else{return handleError(_0x11ea75,null);}});};exports[_0x61c8('0x59')]=function(_0x1944eb,_0x35fe5e,_0x2ffde4){var _0x40e9cd=require(_0x61c8('0x4b'));var _0x331582=![];var _0x428858={'$and':[db['sequelize']['where'](db[_0x61c8('0x5a')]['fn'](_0x61c8('0x5b'),db['sequelize'][_0x61c8('0x5c')](_0x61c8('0x4c'))),_0x1944eb['query'][_0x61c8('0x5d')])]};if(_0x1944eb['query'][_0x61c8('0x2f')]&&_0x1944eb[_0x61c8('0x31')][_0x61c8('0x2f')]===_0x61c8('0x4c')){_0x428858['$and'][_0x61c8('0x5e')]({'uniqueid':_0x1944eb[_0x61c8('0x48')]['id']});}else{_0x428858[_0x61c8('0x5f')][_0x61c8('0x5e')]({'id':_0x1944eb['params']['id']});}return db[_0x61c8('0x2d')]['find']({'where':_0x428858,'attributes':['id',_0x61c8('0x51')],'raw':!![]})[_0x61c8('0x27')](handleEntityNotFound(_0x35fe5e,null))[_0x61c8('0x27')](function(_0x485cb2){if(_0x485cb2){var _0x565342=util[_0x61c8('0x60')](_0x61c8('0x4d'),_0x485cb2[_0x61c8('0x51')]);if(fs[_0x61c8('0x4e')](_0x565342)){_0x331582=!![];return _0x40e9cd[_0x61c8('0x4f')](_0x565342,_0x485cb2[_0x61c8('0x51')],config[_0x61c8('0x50')][_0x61c8('0x61')])[_0x61c8('0x27')](function(){return _0x485cb2;});}return _0x485cb2;}})[_0x61c8('0x27')](function(_0x3882a3){if(_0x3882a3){if(!fs[_0x61c8('0x4e')](_0x3882a3['value'])){throw new db[(_0x61c8('0x52'))][(_0x61c8('0x53'))](_0x61c8('0x54'));}if(_0x3882a3['filename']){return _0x35fe5e[_0x61c8('0x4a')](_0x3882a3[_0x61c8('0x51')],_0x3882a3[_0x61c8('0x55')]+path['extname'](_0x3882a3['value']),function(){if(_0x331582){fs[_0x61c8('0x57')](_0x3882a3[_0x61c8('0x51')]);}});}else{return _0x35fe5e[_0x61c8('0x4a')](_0x3882a3[_0x61c8('0x51')],function(_0x3510f0){if(_0x331582){fs[_0x61c8('0x57')](_0x3882a3[_0x61c8('0x51')]);}});}}})[_0x61c8('0x45')](handleError(_0x35fe5e,null));};exports[_0x61c8('0x62')]=function(_0xa640de,_0x43c62b){return db[_0x61c8('0x2d')]['find']({'where':{'id':_0xa640de[_0x61c8('0x48')]['id']}})[_0x61c8('0x27')](function(_0x2d6378){if(_[_0x61c8('0x63')](_0x2d6378)){throw new ReferenceError(_0x61c8('0x64'));}return _0x2d6378;})['then'](function(_0x7fe9e1){var _0x225350=_0x7fe9e1['value'];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x225350);if(!_[_0x61c8('0x63')](_0x7fe9e1['value'])&&fs['existsSync'](_0x225350)){logger['info']('File:\x20\x22'+_0x225350+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x61c8('0x65')](_0x225350);}_0x225350=_0x225350+_0x61c8('0x66');if(!_[_0x61c8('0x63')](_0x7fe9e1['value'])&&fs[_0x61c8('0x4e')](_0x225350)){logger[_0x61c8('0x67')](_0x61c8('0x68')+_0x225350+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x61c8('0x65')](_0x225350);}return _0x7fe9e1;})[_0x61c8('0x27')](function(_0x23d2c1){if(!_0x23d2c1)throw new InternalError();return _0x23d2c1[_0x61c8('0x62')]();})[_0x61c8('0x27')](function(){_0x43c62b[_0x61c8('0x1d')](0xcc)[_0x61c8('0x1c')]();})[_0x61c8('0x45')](handleError(_0x43c62b,null));};function getBucketslist(_0xef64c2,_0x2e0f57,_0x2c10f5){return new Promise(function(_0x516110,_0x36f012){var _0x231beb=new AWS['S3']({'accessKeyId':_0x2e0f57,'secretAccessKey':_0xef64c2,'region':_0x2c10f5});_0x231beb[_0x61c8('0x69')]({},function(_0x1f0dd8,_0x3205a4){if(_0x1f0dd8){return _0x36f012(_0x1f0dd8);}else{return _0x516110(_0x3205a4);}});});}function createBucket(_0x5573e8,_0x37849b,_0x396324,_0x424459){return new Promise(function(_0x4de4be,_0x2e053a){var _0x589879=new AWS['S3']({'accessKeyId':_0x37849b,'secretAccessKey':_0x5573e8,'region':_0x396324});_0x589879[_0x61c8('0x6a')]({'Bucket':_0x424459},function(_0x13d413,_0xa70da2){if(_0x13d413){return _0x2e053a(_0x13d413);}else{return _0x4de4be(_0xa70da2);}});});}function uploadFile(_0x545cb8,_0x76d326,_0x2bbc44,_0x24e455,_0x2aa915,_0x2d139d){return new Promise(function(_0x7fe8c9,_0x45209e){var _0x206f37=new AWS['S3']({'accessKeyId':_0x76d326,'secretAccessKey':_0x545cb8,'region':_0x2bbc44});_0x206f37[_0x61c8('0x6b')]({'Bucket':_0x24e455,'Key':_0x2aa915,'Body':_0x2d139d},function(_0x5c853b,_0x2d8ef9){if(_0x5c853b){return _0x45209e(_0x5c853b);}else{return _0x7fe8c9(_0x2d8ef9);}});});}function startTranscribe(_0x58bb21,_0x5c3820,_0x345013,_0x273052,_0x373ba0,_0x15a0f6){return new Promise(function(_0x49a2ca,_0x12e3a1){var _0x17602a=new AWS[(_0x61c8('0x6c'))]({'accessKeyId':_0x5c3820,'secretAccessKey':_0x58bb21,'region':_0x345013});_0x17602a['startTranscriptionJob']({'TranscriptionJobName':_0x273052,'LanguageCode':_0x373ba0,'Media':{'MediaFileUri':_0x15a0f6}},function(_0x253f97,_0x5b313a){if(_0x253f97){return _0x12e3a1(_0x253f97);}else{return _0x49a2ca(_0x5b313a);}});});}function transcribe(_0x30d199,_0x183b92,_0x36bf41,_0x1b6253,_0x270b49,_0x2f5bb2,_0x1e01d4){return new Promise(function(_0x17da92,_0x3e2bfd){var _0xa45ac2={};logger['info'](util[_0x61c8('0x60')](_0x61c8('0x6d'),_0x30d199,_0x270b49));return uploadFile(_0x183b92,_0x36bf41,_0x1b6253,_0x270b49,path[_0x61c8('0x6e')](_0x2f5bb2),fs['readFileSync'](_0x2f5bb2))[_0x61c8('0x27')](function(_0x2f68a3){logger['info'](util[_0x61c8('0x60')](_0x61c8('0x6f'),_0x30d199,_0x270b49,_0x2f68a3[_0x61c8('0x70')]));_0xa45ac2[_0x61c8('0x71')]=_0x2f68a3[_0x61c8('0x72')];_0xa45ac2[_0x61c8('0x73')]=_0x2f68a3[_0x61c8('0x70')];logger['info'](util[_0x61c8('0x60')](_0x61c8('0x74'),_0x30d199));return startTranscribe(_0x183b92,_0x36bf41,_0x1b6253,uuidv4(),_0x1e01d4,_0x2f68a3[_0x61c8('0x70')]);})['then'](function(_0x59f1a7){logger[_0x61c8('0x67')](util[_0x61c8('0x60')](_0x61c8('0x75'),_0x30d199,_0x59f1a7[_0x61c8('0x76')]['TranscriptionJobName']));_0xa45ac2[_0x61c8('0x77')]=_0x59f1a7[_0x61c8('0x76')]['TranscriptionJobName'];_0xa45ac2[_0x61c8('0x78')]=_0x59f1a7[_0x61c8('0x76')][_0x61c8('0x79')];return _0x17da92(_0xa45ac2);})['catch'](function(_0x472a12){return _0x3e2bfd(_0x472a12);});});}exports['runTranscribe']=function(_0x3158aa,_0x2c240f,_0x161fe8){var _0x5c32bd;var _0x400920;var _0x165526;var _0x25a2cc=require(_0x61c8('0x4b'));return db[_0x61c8('0x2d')]['findOne']({'where':{'id':_0x3158aa[_0x61c8('0x48')]['id']}})[_0x61c8('0x27')](function(_0x21f9e1){if(_0x21f9e1){var _0x2d21a1=util[_0x61c8('0x60')](_0x61c8('0x4d'),_0x21f9e1[_0x61c8('0x51')]);if(fs[_0x61c8('0x4e')](_0x2d21a1)){cypher=!![];return _0x25a2cc[_0x61c8('0x4f')](_0x2d21a1,_0x21f9e1[_0x61c8('0x51')],config[_0x61c8('0x50')][_0x61c8('0x61')])[_0x61c8('0x27')](function(){return _0x21f9e1;});}return _0x21f9e1;}})[_0x61c8('0x27')](function(_0x5caaca){if(!_0x5caaca){throw new db[(_0x61c8('0x52'))]['ValidationError'](_0x61c8('0x7a'));}_0x400920=_0x5caaca;return db[_0x61c8('0x7b')][_0x61c8('0x7c')]({'where':{'id':0x1}});})[_0x61c8('0x27')](handleEntityNotFound(_0x2c240f,null))[_0x61c8('0x27')](function(_0x1316f6){if(_0x1316f6){_0x5c32bd=_0x1316f6;if(!_0x5c32bd['transcribe']||!_0x5c32bd[_0x61c8('0x7d')]||!_0x5c32bd[_0x61c8('0x7e')]||!_0x5c32bd[_0x61c8('0x7f')]||!_0x5c32bd['bucket']){throw new db[(_0x61c8('0x52'))][(_0x61c8('0x53'))](_0x61c8('0x80'));}if(_0x3158aa[_0x61c8('0x47')]['runSentiment']&&(!_0x5c32bd[_0x61c8('0x81')]||!_0x5c32bd[_0x61c8('0x82')]||!_0x5c32bd[_0x61c8('0x83')]||!_0x5c32bd[_0x61c8('0x7f')]||!_0x5c32bd['bucket'])){throw new db['Sequelize'][(_0x61c8('0x53'))](_0x61c8('0x84'));}return db[_0x61c8('0x85')][_0x61c8('0x7c')]({'where':{'id':_0x5c32bd[_0x61c8('0x7d')]}});}})[_0x61c8('0x27')](function(_0x2d324d){if(!_0x2d324d){throw new db[(_0x61c8('0x52'))]['ValidationError'](_0x61c8('0x86'));}if(!_0x2d324d[_0x61c8('0x87')]||!_0x2d324d['data2']){throw new db[(_0x61c8('0x52'))][(_0x61c8('0x53'))](_0x61c8('0x88'));}_0x165526=_0x2d324d;return getBucketslist(_0x165526[_0x61c8('0x87')],_0x165526['data2'],_0x5c32bd[_0x61c8('0x7e')]);})[_0x61c8('0x27')](function(_0x25bf90){if(_0x25bf90&&_0x25bf90[_0x61c8('0x89')]){var _0x588afd=_[_0x61c8('0x44')](_0x25bf90['Buckets'],function(_0x7b9921){return _0x7b9921[_0x61c8('0x8a')]===_0x5c32bd[_0x61c8('0x71')];});if(!_0x588afd){logger[_0x61c8('0x67')](util[_0x61c8('0x60')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x3158aa['params']['id'],_0x5c32bd['bucket']));return createBucket(_0x165526[_0x61c8('0x87')],_0x165526[_0x61c8('0x8b')],_0x5c32bd['transcribeRegion'],_0x5c32bd[_0x61c8('0x71')]);}logger[_0x61c8('0x67')](util['format'](_0x61c8('0x8c'),_0x3158aa[_0x61c8('0x48')]['id'],_0x5c32bd['bucket']));return;}})[_0x61c8('0x27')](function(_0x1d90ad){if(_0x400920[_0x61c8('0x78')]==='NEW'){return transcribe(_0x3158aa['params']['id'],_0x165526['data1'],_0x165526[_0x61c8('0x8b')],_0x5c32bd[_0x61c8('0x7e')],_0x5c32bd[_0x61c8('0x71')],_0x400920[_0x61c8('0x51')],_0x5c32bd[_0x61c8('0x7f')]);}else{logger[_0x61c8('0x67')](util[_0x61c8('0x60')](_0x61c8('0x8d'),_0x3158aa[_0x61c8('0x48')]['id']));return{'transcribeStatus':_0x61c8('0x8e')};}})[_0x61c8('0x27')](function(_0x431034){if(_0x431034){_0x431034[_0x61c8('0x8f')]=_0x3158aa['body'][_0x61c8('0x90')];return _0x400920[_0x61c8('0x91')](_0x431034);}})[_0x61c8('0x27')](respondWithResult(_0x2c240f,null))['catch'](handleError(_0x2c240f,null));};function writeFile(_0x3819a4,_0x86b637){return new Promise(function(_0x12bbec,_0x2603a0){fs['writeFile'](_0x86b637,_0x3819a4,function(_0x56643c,_0xae6eed){if(_0x56643c){return _0x2603a0(_0x56643c);}else{return _0x12bbec(_0xae6eed);}});});}exports[_0x61c8('0x92')]=function(_0x41f347,_0x146930,_0x2dcc28){return db[_0x61c8('0x2d')][_0x61c8('0x7c')]({'where':{'id':_0x41f347[_0x61c8('0x48')]['id']}})[_0x61c8('0x27')](handleEntityNotFound(_0x146930))[_0x61c8('0x27')](function(_0x4abfe1){if(_0x4abfe1&&_0x4abfe1[_0x61c8('0x93')]){var _0x51422f=_0x4abfe1[_0x61c8('0x93')];var _0x471c78=config['root']+_0x61c8('0x94')+_0x4abfe1['id']+_0x61c8('0x95');if(fs[_0x61c8('0x4e')](_0x471c78)){return _0x471c78;}return writeFile(_0x51422f,_0x471c78)[_0x61c8('0x27')](function(){return _0x471c78;});}else{throw new db[(_0x61c8('0x52'))]['ValidationError'](_0x61c8('0x96'));}})[_0x61c8('0x27')](function(_0x4d16ed){return _0x146930[_0x61c8('0x4a')](_0x4d16ed);})['catch'](handleError(_0x146930));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index db3245a..dfebb82 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 _0x8850=['uniqueid','../../config/logger','moment','request-promise','../../config/environment','exports','define','VoiceRecording'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0x8850,0xe1));var _0x0885=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8850[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0885('0x0'))('api');var moment=require(_0x0885('0x1'));var BPromise=require('bluebird');var rp=require(_0x0885('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0885('0x3'));var attributes=require('./voiceRecording.attributes');module[_0x0885('0x4')]=function(_0x50ff94,_0x2f7bd2){return _0x50ff94[_0x0885('0x5')](_0x0885('0x6'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x0885('0x7'),'fields':[_0x0885('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1ca4=['VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./voiceRecording.attributes','exports','define'];(function(_0x2e1fc8,_0x106d21){var _0x34689c=function(_0x1ac4fe){while(--_0x1ac4fe){_0x2e1fc8['push'](_0x2e1fc8['shift']());}};_0x34689c(++_0x106d21);}(_0x1ca4,0x183));var _0x41ca=function(_0x479a60,_0x51e99a){_0x479a60=_0x479a60-0x0;var _0x462ea0=_0x1ca4[_0x479a60];return _0x462ea0;};'use strict';var _=require(_0x41ca('0x0'));var util=require(_0x41ca('0x1'));var logger=require(_0x41ca('0x2'))('api');var moment=require('moment');var BPromise=require(_0x41ca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x41ca('0x4'));var config=require(_0x41ca('0x5'));var attributes=require(_0x41ca('0x6'));module[_0x41ca('0x7')]=function(_0x13bb52,_0x49ec6f){return _0x13bb52[_0x41ca('0x8')](_0x41ca('0x9'),attributes,{'tableName':_0x41ca('0xa'),'paranoid':![],'indexes':[{'name':_0x41ca('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 684c271..1624039 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(_0x16c467,_0x53d6fa){var _0x22db4f=function(_0x498d3f){while(--_0x498d3f){_0x16c467['push'](_0x16c467['shift']());}};_0x22db4f(++_0x53d6fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x21d1eb,_0x56f664){var _0x4cb8cd=function(_0x450a48){while(--_0x450a48){_0x21d1eb['push'](_0x21d1eb['shift']());}};_0x4cb8cd(++_0x56f664);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 2ad410a..5740221 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 _0x7bbc=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','/describe','isAuthenticated','/:id','show','put','delete'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0x7bbc,0x1f0));var _0xc7bb=function(_0x2b4eb1,_0x1d007a){_0x2b4eb1=_0x2b4eb1-0x0;var _0x2dd440=_0x7bbc[_0x2b4eb1];return _0x2dd440;};'use strict';var multer=require(_0xc7bb('0x0'));var util=require(_0xc7bb('0x1'));var path=require(_0xc7bb('0x2'));var timeout=require('connect-timeout');var express=require(_0xc7bb('0x3'));var router=express[_0xc7bb('0x4')]();var fs_extra=require(_0xc7bb('0x5'));var auth=require(_0xc7bb('0x6'));var interaction=require(_0xc7bb('0x7'));var config=require(_0xc7bb('0x8'));var controller=require(_0xc7bb('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc7bb('0xa')](_0xc7bb('0xb'),auth[_0xc7bb('0xc')](),controller['describe']);router[_0xc7bb('0xa')](_0xc7bb('0xd'),auth[_0xc7bb('0xc')](),controller[_0xc7bb('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc7bb('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc7bb('0x10')]('/:id',auth[_0xc7bb('0xc')](),controller[_0xc7bb('0x11')]);module[_0xc7bb('0x12')]=router; \ No newline at end of file +var _0x2c28=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2b7922,_0x5a317d){var _0x44d0e4=function(_0x37f895){while(--_0x37f895){_0x2b7922['push'](_0x2b7922['shift']());}};_0x44d0e4(++_0x5a317d);}(_0x2c28,0xed));var _0x82c2=function(_0xa55947,_0x28ccd8){_0xa55947=_0xa55947-0x0;var _0x2b26c0=_0x2c28[_0xa55947];return _0x2b26c0;};'use strict';var multer=require(_0x82c2('0x0'));var util=require(_0x82c2('0x1'));var path=require(_0x82c2('0x2'));var timeout=require(_0x82c2('0x3'));var express=require(_0x82c2('0x4'));var router=express[_0x82c2('0x5')]();var fs_extra=require(_0x82c2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x82c2('0x7'));var config=require(_0x82c2('0x8'));var controller=require('./voiceTransferReport.controller');router[_0x82c2('0x9')]('/',auth[_0x82c2('0xa')](),controller[_0x82c2('0xb')]);router[_0x82c2('0x9')](_0x82c2('0xc'),auth[_0x82c2('0xa')](),controller[_0x82c2('0xd')]);router[_0x82c2('0x9')](_0x82c2('0xe'),auth[_0x82c2('0xa')](),controller[_0x82c2('0xf')]);router['post']('/',auth[_0x82c2('0xa')](),controller[_0x82c2('0x10')]);router[_0x82c2('0x11')](_0x82c2('0xe'),auth[_0x82c2('0xa')](),controller[_0x82c2('0x12')]);router[_0x82c2('0x13')](_0x82c2('0xe'),auth[_0x82c2('0xa')](),controller[_0x82c2('0x14')]);module[_0x82c2('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 3c73c28..bde34b2 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 _0x70af=['blind','STRING','sequelize','moment','exports','ENUM'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x70af,0xe6));var _0xf70a=function(_0x4f2dc0,_0xfc5b53){_0x4f2dc0=_0x4f2dc0-0x0;var _0x3aa369=_0x70af[_0x4f2dc0];return _0x3aa369;};'use strict';var Sequelize=require(_0xf70a('0x0'));var moment=require(_0xf70a('0x1'));module[_0xf70a('0x2')]={'type':{'type':Sequelize[_0xf70a('0x3')](_0xf70a('0x4'),'attended')},'result':{'type':Sequelize[_0xf70a('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xf70a('0x5')]},'transferercalleridname':{'type':Sequelize[_0xf70a('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xf70a('0x5')]},'transferercontext':{'type':Sequelize[_0xf70a('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xf70a('0x5')]},'transfereechannel':{'type':Sequelize[_0xf70a('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xf70a('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xf70a('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xf70a('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xf70a('0x5')]},'transfereecontext':{'type':Sequelize[_0xf70a('0x5')]},'transfereeexten':{'type':Sequelize[_0xf70a('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xf70a('0x5')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0xf70a('0x5')]},'extension':{'type':Sequelize[_0xf70a('0x5')]}}; \ No newline at end of file +var _0x01c3=['attended','STRING','sequelize','exports','ENUM','blind'];(function(_0x2023e1,_0xeca985){var _0x1fe133=function(_0x526d5f){while(--_0x526d5f){_0x2023e1['push'](_0x2023e1['shift']());}};_0x1fe133(++_0xeca985);}(_0x01c3,0x7a));var _0x301c=function(_0x518b91,_0x4b8390){_0x518b91=_0x518b91-0x0;var _0x3e867e=_0x01c3[_0x518b91];return _0x3e867e;};'use strict';var Sequelize=require(_0x301c('0x0'));var moment=require('moment');module[_0x301c('0x1')]={'type':{'type':Sequelize[_0x301c('0x2')](_0x301c('0x3'),_0x301c('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x301c('0x5')]},'transferercalleridname':{'type':Sequelize[_0x301c('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x301c('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x301c('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x301c('0x5')]},'transferercontext':{'type':Sequelize[_0x301c('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x301c('0x5')]},'transfereechannel':{'type':Sequelize[_0x301c('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x301c('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x301c('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x301c('0x5')]},'transfereecontext':{'type':Sequelize[_0x301c('0x5')]},'transfereeexten':{'type':Sequelize[_0x301c('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x301c('0x5')]},'isexternal':{'type':Sequelize[_0x301c('0x2')]('Yes','No')},'context':{'type':Sequelize[_0x301c('0x5')]},'extension':{'type':Sequelize[_0x301c('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index e75132e..f3c9827 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 _0x7a54=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','VoiceTransferReport','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0xee6366,_0xe36b0a){var _0xe4d7bc=function(_0x1ce306){while(--_0x1ce306){_0xee6366['push'](_0xee6366['shift']());}};_0xe4d7bc(++_0xe36b0a);}(_0x7a54,0x106));var _0x47a5=function(_0x5c78f8,_0x238bf4){_0x5c78f8=_0x5c78f8-0x0;var _0x5ec7a3=_0x7a54[_0x5c78f8];return _0x5ec7a3;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['VoiceTransferReport'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['VoiceTransferReport']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['VoiceTransferReport']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x48')]=function(_0x1c9a62,_0x5f6a){return db['VoiceTransferReport'][_0x47a5('0x48')]()['then'](respondWithResult(_0x5f6a,null))[_0x47a5('0x46')](handleError(_0x5f6a,null));}; \ No newline at end of file +var _0x7a54=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','VoiceTransferReport','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x10b986,_0x284bba){var _0x1c3e54=function(_0x3fa0f3){while(--_0x3fa0f3){_0x10b986['push'](_0x10b986['shift']());}};_0x1c3e54(++_0x284bba);}(_0x7a54,0x106));var _0x47a5=function(_0x4b4221,_0x34bfb9){_0x4b4221=_0x4b4221-0x0;var _0x10dc30=_0x7a54[_0x4b4221];return _0x10dc30;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['VoiceTransferReport'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['VoiceTransferReport']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['VoiceTransferReport']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x48')]=function(_0x1c9a62,_0x5f6a){return db['VoiceTransferReport'][_0x47a5('0x48')]()['then'](respondWithResult(_0x5f6a,null))[_0x47a5('0x46')](handleError(_0x5f6a,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index b3180c1..ff675d8 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 _0xe04a=['path','rimraf','../../config/environment','exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4a6164,_0x5685dc){var _0x14fc4e=function(_0x12d66b){while(--_0x12d66b){_0x4a6164['push'](_0x4a6164['shift']());}};_0x14fc4e(++_0x5685dc);}(_0xe04a,0x10f));var _0xae04=function(_0x1823e6,_0x322154){_0x1823e6=_0x1823e6-0x0;var _0x15fad9=_0xe04a[_0x1823e6];return _0x15fad9;};'use strict';var _=require(_0xae04('0x0'));var util=require('util');var logger=require(_0xae04('0x1'))(_0xae04('0x2'));var moment=require(_0xae04('0x3'));var BPromise=require(_0xae04('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xae04('0x5'));var rimraf=require(_0xae04('0x6'));var config=require(_0xae04('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0xae04('0x8')]=function(_0x29ea68,_0x4231a6){return _0x29ea68[_0xae04('0x9')](_0xae04('0xa'),attributes,{'tableName':_0xae04('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ed5=['util','../../config/logger','bluebird','path','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer'];(function(_0x48fe9e,_0x29720a){var _0x4dac6c=function(_0x2774ea){while(--_0x2774ea){_0x48fe9e['push'](_0x48fe9e['shift']());}};_0x4dac6c(++_0x29720a);}(_0x8ed5,0x15f));var _0x58ed=function(_0x502e7e,_0x4e2e2e){_0x502e7e=_0x502e7e-0x0;var _0x1954e7=_0x8ed5[_0x502e7e];return _0x1954e7;};'use strict';var _=require('lodash');var util=require(_0x58ed('0x0'));var logger=require(_0x58ed('0x1'))('api');var moment=require('moment');var BPromise=require(_0x58ed('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58ed('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x58ed('0x4'));module[_0x58ed('0x5')]=function(_0x523033,_0xeb3a80){return _0x523033[_0x58ed('0x6')](_0x58ed('0x7'),attributes,{'tableName':_0x58ed('0x8'),'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 0540d57..ab7bf74 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 _0x032a=['result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x57d45b,_0x4651d5){var _0x4ceefb=function(_0x1cb65f){while(--_0x1cb65f){_0x57d45b['push'](_0x57d45b['shift']());}};_0x4ceefb(++_0x4651d5);}(_0x032a,0xf0));var _0xa032=function(_0x5093e9,_0x5154d0){_0x5093e9=_0x5093e9-0x0;var _0x4c9a22=_0x032a[_0x5093e9];return _0x4c9a22;};'use strict';var _=require('lodash');var util=require(_0xa032('0x0'));var moment=require('moment');var BPromise=require(_0xa032('0x1'));var rs=require(_0xa032('0x2'));var fs=require('fs');var Redis=require(_0xa032('0x3'));var db=require(_0xa032('0x4'))['db'];var utils=require(_0xa032('0x5'));var logger=require(_0xa032('0x6'))(_0xa032('0x7'));var config=require(_0xa032('0x8'));var jayson=require(_0xa032('0x9'));var client=jayson[_0xa032('0xa')][_0xa032('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40128a,_0x54275c,_0x616437){return new BPromise(function(_0x4a5d8e,_0x5d0744){return client[_0xa032('0xc')](_0x40128a,_0x616437)['then'](function(_0x18283a){logger[_0xa032('0xd')](_0xa032('0xe'),_0x54275c,_0xa032('0xf'));logger[_0xa032('0x10')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x54275c,_0xa032('0xf'),JSON[_0xa032('0x11')](_0x18283a));if(_0x18283a['error']){if(_0x18283a[_0xa032('0x12')][_0xa032('0x13')]===0x1f4){logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x18283a[_0xa032('0x12')]['message']);return _0x5d0744(_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);}logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);return _0x4a5d8e(_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);}else{logger[_0xa032('0xd')](_0xa032('0xe'),_0x54275c,'request\x20sent');_0x4a5d8e(_0x18283a[_0xa032('0x15')][_0xa032('0x14')]);}})[_0xa032('0x16')](function(_0x2caacd){logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x2caacd);_0x5d0744(_0x2caacd);});});}exports[_0xa032('0x17')]=function(_0x577406){var _0xff6817=this;return new Promise(function(_0x54fba7,_0x1d8cf4){return db[_0xa032('0x18')][_0xa032('0x19')](_0x577406['body'],{'raw':_0x577406[_0xa032('0x1a')]?_0x577406['options'][_0xa032('0x1b')]===undefined?!![]:![]:!![]})[_0xa032('0x1c')](function(_0x471757){logger[_0xa032('0xd')](_0xa032('0x17'),_0x577406);logger[_0xa032('0x10')]('CreateVoiceTransferReport',_0x577406,JSON[_0xa032('0x11')](_0x471757));_0x54fba7(_0x471757);})[_0xa032('0x16')](function(_0x5a817b){logger[_0xa032('0x12')]('CreateVoiceTransferReport',_0x5a817b[_0xa032('0x14')],_0x577406);_0x1d8cf4(_0xff6817['error'](0x1f4,_0x5a817b[_0xa032('0x14')]));});});}; \ No newline at end of file +var _0x9205=['stringify','error','code','message','info','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4a9f7c,_0x344d95){var _0x52f052=function(_0x126392){while(--_0x126392){_0x4a9f7c['push'](_0x4a9f7c['shift']());}};_0x52f052(++_0x344d95);}(_0x9205,0x14d));var _0x5920=function(_0x47c1b2,_0x5daa14){_0x47c1b2=_0x47c1b2-0x0;var _0x2ed8c0=_0x9205[_0x47c1b2];return _0x2ed8c0;};'use strict';var _=require(_0x5920('0x0'));var util=require(_0x5920('0x1'));var moment=require(_0x5920('0x2'));var BPromise=require(_0x5920('0x3'));var rs=require(_0x5920('0x4'));var fs=require('fs');var Redis=require(_0x5920('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5920('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54425e,_0xdc66ec,_0x24b8ab){return new BPromise(function(_0x13dacb,_0x661e9){return client[_0x5920('0x7')](_0x54425e,_0x24b8ab)[_0x5920('0x8')](function(_0xd61c79){logger['info'](_0x5920('0x9'),_0xdc66ec,_0x5920('0xa'));logger['debug'](_0x5920('0xb'),_0xdc66ec,_0x5920('0xa'),JSON[_0x5920('0xc')](_0xd61c79));if(_0xd61c79['error']){if(_0xd61c79[_0x5920('0xd')][_0x5920('0xe')]===0x1f4){logger['error'](_0x5920('0x9'),_0xdc66ec,_0xd61c79[_0x5920('0xd')][_0x5920('0xf')]);return _0x661e9(_0xd61c79[_0x5920('0xd')][_0x5920('0xf')]);}logger[_0x5920('0xd')](_0x5920('0x9'),_0xdc66ec,_0xd61c79['error'][_0x5920('0xf')]);return _0x13dacb(_0xd61c79[_0x5920('0xd')][_0x5920('0xf')]);}else{logger[_0x5920('0x10')](_0x5920('0x9'),_0xdc66ec,_0x5920('0xa'));_0x13dacb(_0xd61c79['result']['message']);}})[_0x5920('0x11')](function(_0x3edf67){logger['error'](_0x5920('0x9'),_0xdc66ec,_0x3edf67);_0x661e9(_0x3edf67);});});}exports[_0x5920('0x12')]=function(_0x1801c1){var _0x2e8218=this;return new Promise(function(_0x34d93a,_0x39634c){return db[_0x5920('0x13')][_0x5920('0x14')](_0x1801c1['body'],{'raw':_0x1801c1[_0x5920('0x15')]?_0x1801c1[_0x5920('0x15')][_0x5920('0x16')]===undefined?!![]:![]:!![]})[_0x5920('0x8')](function(_0x55776d){logger[_0x5920('0x10')](_0x5920('0x12'),_0x1801c1);logger['debug'](_0x5920('0x12'),_0x1801c1,JSON['stringify'](_0x55776d));_0x34d93a(_0x55776d);})['catch'](function(_0x2a676f){logger[_0x5920('0xd')]('CreateVoiceTransferReport',_0x2a676f[_0x5920('0xf')],_0x1801c1);_0x39634c(_0x2e8218[_0x5920('0xd')](0x1f4,_0x2a676f[_0x5920('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index d1400fc..771bcea 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x636f=['isAuthenticated','originate','/hangup','canUpdate','/answer','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','exports','../../components/auth/service','./webbar.controller','post','/originate'];(function(_0x51542a,_0x3bbd6a){var _0x5646f3=function(_0x2332c9){while(--_0x2332c9){_0x51542a['push'](_0x51542a['shift']());}};_0x5646f3(++_0x3bbd6a);}(_0x636f,0x188));var _0xf636=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x636f[_0x397e5f];return _0x5302b8;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xf636('0x0'));var controller=require(_0xf636('0x1'));router[_0xf636('0x2')](_0xf636('0x3'),auth[_0xf636('0x4')](),auth['canUpdate'](),controller[_0xf636('0x5')]);router[_0xf636('0x2')](_0xf636('0x6'),auth[_0xf636('0x4')](),auth[_0xf636('0x7')](),controller['hangup']);router[_0xf636('0x2')](_0xf636('0x8'),auth[_0xf636('0x4')](),auth[_0xf636('0x7')](),controller[_0xf636('0x9')]);router[_0xf636('0x2')](_0xf636('0xa'),auth[_0xf636('0x4')](),auth[_0xf636('0x7')](),controller[_0xf636('0xb')]);router['post'](_0xf636('0xc'),auth[_0xf636('0x4')](),auth['canUpdate'](),controller[_0xf636('0xd')]);router[_0xf636('0x2')](_0xf636('0xe'),auth[_0xf636('0x4')](),auth[_0xf636('0x7')](),controller[_0xf636('0xf')]);router['post'](_0xf636('0x10'),auth[_0xf636('0x4')](),auth[_0xf636('0x7')](),controller['transfer']);module[_0xf636('0x11')]=router; \ No newline at end of file +var _0x279d=['hangup','/answer','answer','/hold','hold','/unhold','exports','express','Router','../../components/auth/service','./webbar.controller','isAuthenticated','canUpdate','post','/hangup'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x279d,0x1d8));var _0xd279=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x279d[_0x9dfc10];return _0x4f938a;};'use strict';var express=require(_0xd279('0x0'));var router=express[_0xd279('0x1')]();var auth=require(_0xd279('0x2'));var controller=require(_0xd279('0x3'));router['post']('/originate',auth[_0xd279('0x4')](),auth[_0xd279('0x5')](),controller['originate']);router[_0xd279('0x6')](_0xd279('0x7'),auth[_0xd279('0x4')](),auth[_0xd279('0x5')](),controller[_0xd279('0x8')]);router[_0xd279('0x6')](_0xd279('0x9'),auth['isAuthenticated'](),auth[_0xd279('0x5')](),controller[_0xd279('0xa')]);router[_0xd279('0x6')](_0xd279('0xb'),auth[_0xd279('0x4')](),auth[_0xd279('0x5')](),controller[_0xd279('0xc')]);router[_0xd279('0x6')](_0xd279('0xd'),auth[_0xd279('0x4')](),auth[_0xd279('0x5')](),controller['unhold']);router[_0xd279('0x6')]('/calls',auth[_0xd279('0x4')](),auth[_0xd279('0x5')](),controller['calls']);router[_0xd279('0x6')]('/transfer',auth['isAuthenticated'](),auth[_0xd279('0x5')](),controller['transfer']);module[_0xd279('0xe')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index a5c9db2..68e746b 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef1c=['transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','send','NotFound','request','then','message','result','catch','User','all','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','format','user:%s','json','hangup','hangup\x20fired:','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','answer\x20executed!','hold\x20fired:','webbar:hold','unhold','webbar:unhold','unhold\x20executed!','calls\x20fired:','VoiceChannels','filter','UserId','conference\x20fired:','webbar:conference','conference\x20executed!'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0xef1c,0x176));var _0xcef1=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xef1c[_0x160c73];return _0xd9302;};'use strict';var path=require(_0xcef1('0x0'));var fs=require('fs');var _=require(_0xcef1('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xcef1('0x2'));var util=require(_0xcef1('0x3'));var BPromise=require(_0xcef1('0x4'));var jayson=require(_0xcef1('0x5'));var amiClient=jayson[_0xcef1('0x6')][_0xcef1('0x7')]({'port':0x232a});var logger=require('../../config/logger')(_0xcef1('0x8'));var Redis=require(_0xcef1('0x9'));config[_0xcef1('0xa')]=_['defaults'](config[_0xcef1('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xcef1('0xb'))(new Redis(config[_0xcef1('0xa')]));var Schema=require(_0xcef1('0xc'));var originateValidation=new Schema({'userId':{'type':_0xcef1('0xd'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xcef1('0xe'),'required':[!![],_0xcef1('0xf')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xcef1('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xcef1('0xd'),'required':[!![],_0xcef1('0x10')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xcef1('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xcef1('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xcef1('0xe'),'required':[!![],_0xcef1('0x11')]},'transferNumber':{'type':_0xcef1('0xe'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xcef1('0xd'),'required':[!![],_0xcef1('0x10')]},'sessionId':{'type':_0xcef1('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xcef1('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xcef1('0xd'),'required':[!![],_0xcef1('0x10')]}});function emit(_0x3d693b,_0x182d45,_0x5c3481){logger[_0xcef1('0x12')](_0x3d693b,_0x182d45,JSON[_0xcef1('0x13')](_0x5c3481));io['to'](_0x3d693b)[_0xcef1('0x14')](_0x182d45,_0x5c3481);}function handleError(_0x66f8e6){return function(_0x391cba){console[_0xcef1('0x15')](_0xcef1('0x16'),_0x391cba,_0x391cba instanceof RangeError);logger[_0xcef1('0x17')](_0x391cba['stack']);if(_0x391cba instanceof RangeError){if(_0x391cba[_0xcef1('0x18')]){delete _0x391cba[_0xcef1('0x18')];}_0x66f8e6[_0xcef1('0x19')](0x194)[_0xcef1('0x1a')](_0x391cba);}else{if(_0x391cba[_0xcef1('0x18')]){delete _0x391cba['name'];}_0x66f8e6[_0xcef1('0x19')](0x1f4)[_0xcef1('0x1a')](_0x391cba);}};}function checkError(){return function(_0x4004aa){if(!_0x4004aa){throw new RangeError(_0xcef1('0x1b'));}return _0x4004aa;};}function respondWithRpcPromise(_0x539b5b,_0x3c4976){return new BPromise(function(_0x17f34c,_0x1cff9f){var _0x23895e=amiClient;return _0x23895e[_0xcef1('0x1c')](_0x539b5b,_0x3c4976)[_0xcef1('0x1d')](function(_0xa2876f){if(_0xa2876f['error']){if(_0xa2876f[_0xcef1('0x17')]['code']===0x1f4){return _0x1cff9f(_0xa2876f[_0xcef1('0x17')][_0xcef1('0x1e')]);}return _0x17f34c(_0xa2876f[_0xcef1('0x17')][_0xcef1('0x1e')]);}else{_0x17f34c(_0xa2876f[_0xcef1('0x1f')]);}})[_0xcef1('0x20')](function(_0x1616fa){_0x1cff9f(_0x1616fa);});});}function getAgent(_0x144c55){return db[_0xcef1('0x21')]['findOne']({'where':{'id':_0x144c55,'role':'agent'}})[_0xcef1('0x1d')](checkError());}function getAgentCheckSession(_0x21cac5,_0x1f0fab){return new BPromise(function(_0x561dfc,_0x360317){var _0x5909bf=respondWithRpcPromise('VoiceChannels');var _0xbad376=getAgent(_0x21cac5);Promise[_0xcef1('0x22')]([_0x5909bf,_0xbad376])[_0xcef1('0x1d')](function(_0x4565d0){var _0x5987bc=_0x4565d0[0x0];var _0x8fd24a=_0x4565d0[0x1];var _0xe2ed16=_['filter'](_0x5987bc[_0xcef1('0x23')],function(_0x3939d7){return _0x3939d7['UserId']==_0x8fd24a['id']&&_0x3939d7[_0xcef1('0x24')]==_0x1f0fab;});if(_0xe2ed16[_0xcef1('0x25')]==0x1){_0x561dfc(_0x8fd24a);}else{_0x360317(new RangeError(_0xcef1('0x26')+_0x1f0fab+_0xcef1('0x27')));}});});}exports[_0xcef1('0x28')]=function(_0x264c54,_0x2e22a4){logger[_0xcef1('0x12')](_0xcef1('0x29'),_0x264c54['body']);var _0x100df3=originateValidation[_0xcef1('0xc')](_0x264c54[_0xcef1('0x2a')]);if(_0x100df3['length']>0x0){return _0x2e22a4[_0xcef1('0x19')](0x190)['json'](_0x100df3);}var _0x271f8a=_0x264c54[_0xcef1('0x2a')][_0xcef1('0x2b')];var _0x2464ee=_0x264c54['body'][_0xcef1('0x2c')];var _0x9655ec=_0x264c54[_0xcef1('0x2a')][_0xcef1('0x2d')];var _0x40004e=_0x264c54[_0xcef1('0x2a')][_0xcef1('0x2e')];return getAgent(_0x271f8a)['then'](function(_0x5f18a2){logger[_0xcef1('0x12')]('entityFound:',_0x5f18a2['name']);emit(util[_0xcef1('0x2f')](_0xcef1('0x30'),_0x5f18a2[_0xcef1('0x18')]),'webbar:originate',{'callNumber':_0x2464ee,'callerId':_0x9655ec,'callbackUrl':_0x40004e});return _0x2e22a4['status'](0xc8)[_0xcef1('0x31')]({'error':![],'message':'originate\x20executed!'});})[_0xcef1('0x20')](handleError(_0x2e22a4));};exports[_0xcef1('0x32')]=function(_0x47ec0c,_0x19ceaf){logger[_0xcef1('0x12')](_0xcef1('0x33'),_0x47ec0c[_0xcef1('0x2a')]);var _0x257437=hangupValidation[_0xcef1('0xc')](_0x47ec0c[_0xcef1('0x2a')]);if(_0x257437['length']>0x0){return _0x19ceaf[_0xcef1('0x19')](0x190)['json'](_0x257437);}var _0x1f1f71=_0x47ec0c[_0xcef1('0x2a')][_0xcef1('0x2b')];var _0x6a5ccf=_0x47ec0c[_0xcef1('0x2a')]['sessionId'];return getAgent(_0x1f1f71)[_0xcef1('0x1d')](function(_0x1eba15){logger[_0xcef1('0x12')](_0xcef1('0x34'),_0x1eba15['name']);emit(util[_0xcef1('0x2f')](_0xcef1('0x30'),_0x1eba15[_0xcef1('0x18')]),_0xcef1('0x35'),{'sessionId':_0x6a5ccf});return _0x19ceaf[_0xcef1('0x19')](0xc8)[_0xcef1('0x31')]({'error':![],'message':_0xcef1('0x36')});})[_0xcef1('0x20')](handleError(_0x19ceaf));};exports[_0xcef1('0x37')]=function(_0x3282fe,_0x44b047){logger[_0xcef1('0x12')](_0xcef1('0x38'),_0x3282fe[_0xcef1('0x2a')]);var _0x2ba79e=answerValidation['validate'](_0x3282fe[_0xcef1('0x2a')]);if(_0x2ba79e[_0xcef1('0x25')]>0x0){return _0x44b047[_0xcef1('0x19')](0x190)[_0xcef1('0x31')](_0x2ba79e);}var _0x3bf0e0=_0x3282fe['body']['userId'];var _0x565daf=_0x3282fe[_0xcef1('0x2a')][_0xcef1('0x24')];return getAgent(_0x3bf0e0)['then'](function(_0x1b16f9){logger[_0xcef1('0x12')](_0xcef1('0x34'),_0x1b16f9['name']);emit(util['format'](_0xcef1('0x30'),_0x1b16f9[_0xcef1('0x18')]),'webbar:answer',{'sessionId':_0x565daf});return _0x44b047['status'](0xc8)[_0xcef1('0x31')]({'error':![],'message':_0xcef1('0x39')});})[_0xcef1('0x20')](handleError(_0x44b047));};exports['hold']=function(_0x5e0e3d,_0x2f44fd){logger['info'](_0xcef1('0x3a'),_0x5e0e3d['body']);var _0x587c45=holdValidation['validate'](_0x5e0e3d[_0xcef1('0x2a')]);if(_0x587c45['length']>0x0){return _0x2f44fd['status'](0x190)[_0xcef1('0x31')](_0x587c45);}var _0x14e919=_0x5e0e3d[_0xcef1('0x2a')][_0xcef1('0x2b')];var _0x4e4c8a=_0x5e0e3d[_0xcef1('0x2a')][_0xcef1('0x24')];return getAgent(_0x14e919)[_0xcef1('0x1d')](function(_0x25ae31){logger[_0xcef1('0x12')](_0xcef1('0x34'),_0x25ae31[_0xcef1('0x18')]);emit(util['format'](_0xcef1('0x30'),_0x25ae31[_0xcef1('0x18')]),_0xcef1('0x3b'),{'sessionId':_0x4e4c8a});return _0x2f44fd[_0xcef1('0x19')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x2f44fd));};exports[_0xcef1('0x3c')]=function(_0x308a65,_0x44750a){logger[_0xcef1('0x12')]('unhold\x20fired:',_0x308a65[_0xcef1('0x2a')]);var _0x277696=unholdValidation[_0xcef1('0xc')](_0x308a65[_0xcef1('0x2a')]);if(_0x277696[_0xcef1('0x25')]>0x0){return _0x44750a[_0xcef1('0x19')](0x190)[_0xcef1('0x31')](_0x277696);}var _0x5d1cc8=_0x308a65[_0xcef1('0x2a')]['userId'];var _0x26c77a=_0x308a65['body'][_0xcef1('0x24')];return getAgent(_0x5d1cc8)[_0xcef1('0x1d')](function(_0x2a21fb){logger['info'](_0xcef1('0x34'),_0x2a21fb[_0xcef1('0x18')]);emit(util[_0xcef1('0x2f')](_0xcef1('0x30'),_0x2a21fb['name']),_0xcef1('0x3d'),{'sessionId':_0x26c77a});return _0x44750a[_0xcef1('0x19')](0xc8)[_0xcef1('0x31')]({'error':![],'message':_0xcef1('0x3e')});})[_0xcef1('0x20')](handleError(_0x44750a));};exports['calls']=function(_0x3cc8aa,_0x39e994){logger[_0xcef1('0x12')](_0xcef1('0x3f'),_0x39e994['body']);var _0x2c0b41=callsValidation['validate'](_0x3cc8aa[_0xcef1('0x2a')]);if(_0x2c0b41[_0xcef1('0x25')]>0x0){return _0x39e994[_0xcef1('0x19')](0x190)[_0xcef1('0x31')](_0x2c0b41);}var _0x3768e8=_0x3cc8aa[_0xcef1('0x2a')][_0xcef1('0x2b')];var _0x47cb2a=respondWithRpcPromise(_0xcef1('0x40'));var _0x4ce54b=getAgent(_0x3768e8);return Promise[_0xcef1('0x22')]([_0x47cb2a,_0x4ce54b])['then'](function(_0xe4bb7e){var _0x387faa=_0xe4bb7e[0x0];var _0x10ebff=_0xe4bb7e[0x1];var _0x373d8f=_[_0xcef1('0x41')](_0x387faa[_0xcef1('0x23')],function(_0x2544af){return _0x2544af[_0xcef1('0x42')]==_0x10ebff['id'];});return _0x39e994[_0xcef1('0x19')](0xc8)[_0xcef1('0x31')]({'count':_0x373d8f[_0xcef1('0x25')],'rows':_0x373d8f});})['catch'](handleError(_0x39e994));};exports['conference']=function(_0x1bbaa9,_0xe69870){logger[_0xcef1('0x12')](_0xcef1('0x43'),_0x1bbaa9[_0xcef1('0x2a')]);var _0x3befc0=conferenceValidation[_0xcef1('0xc')](_0x1bbaa9['body']);if(_0x3befc0[_0xcef1('0x25')]>0x0){return _0xe69870['status'](0x190)[_0xcef1('0x31')](_0x3befc0);}var _0x487000=_0x1bbaa9[_0xcef1('0x2a')][_0xcef1('0x2b')];return getAgent(_0x487000)[_0xcef1('0x1d')](function(_0x519b73){logger['info'](_0xcef1('0x34'),_0x519b73[_0xcef1('0x18')]);emit(util[_0xcef1('0x2f')](_0xcef1('0x30'),_0x519b73['name']),_0xcef1('0x44'));return _0xe69870[_0xcef1('0x19')](0xc8)[_0xcef1('0x31')]({'error':![],'message':_0xcef1('0x45')});})[_0xcef1('0x20')](handleError(_0xe69870));};exports['transfer']=function(_0x53d6ef,_0x2bab7f){logger[_0xcef1('0x12')](_0xcef1('0x46'),_0x53d6ef[_0xcef1('0x2a')]);var _0x48a7a0=transferValidation[_0xcef1('0xc')](_0x53d6ef[_0xcef1('0x2a')]);if(_0x48a7a0[_0xcef1('0x25')]>0x0){return _0x2bab7f[_0xcef1('0x19')](0x190)[_0xcef1('0x31')](_0x48a7a0);}var _0x2bf1ca=_0x53d6ef[_0xcef1('0x2a')][_0xcef1('0x2b')];var _0x2ddeb1=_0x53d6ef['body']['sessionId'];var _0x28ba08=_0x53d6ef['body'][_0xcef1('0x47')];return getAgent(_0x2bf1ca)[_0xcef1('0x1d')](function(_0x9162d7){logger[_0xcef1('0x12')]('entityFound:',_0x9162d7[_0xcef1('0x18')]);emit(util[_0xcef1('0x2f')](_0xcef1('0x30'),_0x9162d7[_0xcef1('0x18')]),_0xcef1('0x48'),{'sessionId':_0x2ddeb1,'transferNumber':_0x28ba08});return _0x2bab7f[_0xcef1('0x19')](0xc8)[_0xcef1('0x31')]({'error':![],'message':_0xcef1('0x49')});})[_0xcef1('0x20')](handleError(_0x2bab7f));}; \ No newline at end of file +var _0x8c25=['then','error','code','message','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','hangup','userId','webbar:hangup','answer','validate','webbar:answer','hold','hold\x20fired:','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','client','ioredis','defaults','socket.io-emitter','redis','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','name','status','send','NotFound','request'];(function(_0x5c38a2,_0x40e4e4){var _0x22869c=function(_0x4601ce){while(--_0x4601ce){_0x5c38a2['push'](_0x5c38a2['shift']());}};_0x22869c(++_0x40e4e4);}(_0x8c25,0x15e));var _0x58c2=function(_0x54a49c,_0x2640f3){_0x54a49c=_0x54a49c-0x0;var _0x4e7690=_0x8c25[_0x54a49c];return _0x4e7690;};'use strict';var path=require(_0x58c2('0x0'));var fs=require('fs');var _=require(_0x58c2('0x1'));var db=require(_0x58c2('0x2'))['db'];var config=require(_0x58c2('0x3'));var util=require(_0x58c2('0x4'));var BPromise=require(_0x58c2('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x58c2('0x6')]['http']({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0x58c2('0x7'));config['redis']=_[_0x58c2('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x58c2('0x9'))(new Redis(config[_0x58c2('0xa')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x58c2('0xb'),'required':[!![],_0x58c2('0xc')]},'callNumber':{'type':_0x58c2('0xd'),'required':[!![],_0x58c2('0xe')]},'callerId':{'type':_0x58c2('0xd')},'callbackUrl':{'type':_0x58c2('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x58c2('0xb'),'required':[!![],_0x58c2('0xc')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x58c2('0xb'),'required':[!![],_0x58c2('0xc')]},'sessionId':{'type':_0x58c2('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x58c2('0xc')]},'sessionId':{'type':_0x58c2('0xd'),'required':[!![],_0x58c2('0xf')]},'transferNumber':{'type':_0x58c2('0xd'),'required':[!![],_0x58c2('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x58c2('0xb'),'required':[!![],_0x58c2('0xc')]},'sessionId':{'type':_0x58c2('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x58c2('0xb'),'required':[!![],_0x58c2('0xc')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x58c2('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0x58c2('0xb'),'required':[!![],_0x58c2('0xc')]}});function emit(_0x20d6d6,_0x3e6589,_0x4ec80c){logger[_0x58c2('0x11')](_0x20d6d6,_0x3e6589,JSON[_0x58c2('0x12')](_0x4ec80c));io['to'](_0x20d6d6)['emit'](_0x3e6589,_0x4ec80c);}function handleError(_0x50e4fa){return function(_0x55d76b){console[_0x58c2('0x13')]('handleError:',_0x55d76b,_0x55d76b instanceof RangeError);logger['error'](_0x55d76b['stack']);if(_0x55d76b instanceof RangeError){if(_0x55d76b['name']){delete _0x55d76b[_0x58c2('0x14')];}_0x50e4fa[_0x58c2('0x15')](0x194)[_0x58c2('0x16')](_0x55d76b);}else{if(_0x55d76b[_0x58c2('0x14')]){delete _0x55d76b[_0x58c2('0x14')];}_0x50e4fa[_0x58c2('0x15')](0x1f4)['send'](_0x55d76b);}};}function checkError(){return function(_0x4094a3){if(!_0x4094a3){throw new RangeError(_0x58c2('0x17'));}return _0x4094a3;};}function respondWithRpcPromise(_0x1f7adc,_0x21618c){return new BPromise(function(_0x59f55c,_0x34c54b){var _0x148d67=amiClient;return _0x148d67[_0x58c2('0x18')](_0x1f7adc,_0x21618c)[_0x58c2('0x19')](function(_0x21f3de){if(_0x21f3de[_0x58c2('0x1a')]){if(_0x21f3de[_0x58c2('0x1a')][_0x58c2('0x1b')]===0x1f4){return _0x34c54b(_0x21f3de[_0x58c2('0x1a')][_0x58c2('0x1c')]);}return _0x59f55c(_0x21f3de[_0x58c2('0x1a')]['message']);}else{_0x59f55c(_0x21f3de['result']);}})[_0x58c2('0x1d')](function(_0x2481fa){_0x34c54b(_0x2481fa);});});}function getAgent(_0x371fe2){return db[_0x58c2('0x1e')][_0x58c2('0x1f')]({'where':{'id':_0x371fe2,'role':_0x58c2('0x20')}})[_0x58c2('0x19')](checkError());}function getAgentCheckSession(_0x9eeb35,_0x4198c3){return new BPromise(function(_0x367d44,_0x1b3a7f){var _0x2344a5=respondWithRpcPromise(_0x58c2('0x21'));var _0xda8f66=getAgent(_0x9eeb35);Promise[_0x58c2('0x22')]([_0x2344a5,_0xda8f66])[_0x58c2('0x19')](function(_0x543745){var _0x2ce592=_0x543745[0x0];var _0x40d5aa=_0x543745[0x1];var _0x1bd3a5=_[_0x58c2('0x23')](_0x2ce592[_0x58c2('0x24')],function(_0x2544fa){return _0x2544fa[_0x58c2('0x25')]==_0x40d5aa['id']&&_0x2544fa[_0x58c2('0x26')]==_0x4198c3;});if(_0x1bd3a5[_0x58c2('0x27')]==0x1){_0x367d44(_0x40d5aa);}else{_0x1b3a7f(new RangeError(_0x58c2('0x28')+_0x4198c3+_0x58c2('0x29')));}});});}exports[_0x58c2('0x2a')]=function(_0x175e34,_0x179502){logger[_0x58c2('0x11')](_0x58c2('0x2b'),_0x175e34[_0x58c2('0x2c')]);var _0x55a460=originateValidation['validate'](_0x175e34[_0x58c2('0x2c')]);if(_0x55a460[_0x58c2('0x27')]>0x0){return _0x179502['status'](0x190)[_0x58c2('0x2d')](_0x55a460);}var _0x5d33d1=_0x175e34['body']['userId'];var _0x2d12b1=_0x175e34[_0x58c2('0x2c')]['callNumber'];var _0x2e1970=_0x175e34[_0x58c2('0x2c')][_0x58c2('0x2e')];var _0x1f4f13=_0x175e34['body'][_0x58c2('0x2f')];return getAgent(_0x5d33d1)[_0x58c2('0x19')](function(_0x5b3f29){logger[_0x58c2('0x11')](_0x58c2('0x30'),_0x5b3f29[_0x58c2('0x14')]);emit(util[_0x58c2('0x31')](_0x58c2('0x32'),_0x5b3f29[_0x58c2('0x14')]),_0x58c2('0x33'),{'callNumber':_0x2d12b1,'callerId':_0x2e1970,'callbackUrl':_0x1f4f13});return _0x179502[_0x58c2('0x15')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x179502));};exports[_0x58c2('0x34')]=function(_0x2f93a7,_0x8fb783){logger['info']('hangup\x20fired:',_0x2f93a7[_0x58c2('0x2c')]);var _0x177eda=hangupValidation['validate'](_0x2f93a7[_0x58c2('0x2c')]);if(_0x177eda['length']>0x0){return _0x8fb783[_0x58c2('0x15')](0x190)[_0x58c2('0x2d')](_0x177eda);}var _0x3e4e5c=_0x2f93a7[_0x58c2('0x2c')][_0x58c2('0x35')];var _0x117459=_0x2f93a7[_0x58c2('0x2c')]['sessionId'];return getAgent(_0x3e4e5c)[_0x58c2('0x19')](function(_0x24f451){logger[_0x58c2('0x11')](_0x58c2('0x30'),_0x24f451[_0x58c2('0x14')]);emit(util['format'](_0x58c2('0x32'),_0x24f451[_0x58c2('0x14')]),_0x58c2('0x36'),{'sessionId':_0x117459});return _0x8fb783[_0x58c2('0x15')](0xc8)[_0x58c2('0x2d')]({'error':![],'message':'hangup\x20executed!'});})[_0x58c2('0x1d')](handleError(_0x8fb783));};exports[_0x58c2('0x37')]=function(_0x23687b,_0x7a9fb7){logger['info']('answer\x20fired:',_0x23687b[_0x58c2('0x2c')]);var _0x5bd179=answerValidation[_0x58c2('0x38')](_0x23687b[_0x58c2('0x2c')]);if(_0x5bd179['length']>0x0){return _0x7a9fb7[_0x58c2('0x15')](0x190)[_0x58c2('0x2d')](_0x5bd179);}var _0xc2487d=_0x23687b[_0x58c2('0x2c')][_0x58c2('0x35')];var _0x4933b6=_0x23687b[_0x58c2('0x2c')][_0x58c2('0x26')];return getAgent(_0xc2487d)[_0x58c2('0x19')](function(_0x4da893){logger['info'](_0x58c2('0x30'),_0x4da893['name']);emit(util[_0x58c2('0x31')](_0x58c2('0x32'),_0x4da893['name']),_0x58c2('0x39'),{'sessionId':_0x4933b6});return _0x7a9fb7['status'](0xc8)[_0x58c2('0x2d')]({'error':![],'message':'answer\x20executed!'});})[_0x58c2('0x1d')](handleError(_0x7a9fb7));};exports[_0x58c2('0x3a')]=function(_0x24c3c9,_0x25db32){logger[_0x58c2('0x11')](_0x58c2('0x3b'),_0x24c3c9[_0x58c2('0x2c')]);var _0x4af7e6=holdValidation['validate'](_0x24c3c9[_0x58c2('0x2c')]);if(_0x4af7e6[_0x58c2('0x27')]>0x0){return _0x25db32[_0x58c2('0x15')](0x190)[_0x58c2('0x2d')](_0x4af7e6);}var _0x693625=_0x24c3c9['body'][_0x58c2('0x35')];var _0x471b5f=_0x24c3c9[_0x58c2('0x2c')][_0x58c2('0x26')];return getAgent(_0x693625)[_0x58c2('0x19')](function(_0xfc6a7e){logger['info']('entityFound:',_0xfc6a7e['name']);emit(util['format'](_0x58c2('0x32'),_0xfc6a7e[_0x58c2('0x14')]),_0x58c2('0x3c'),{'sessionId':_0x471b5f});return _0x25db32[_0x58c2('0x15')](0xc8)[_0x58c2('0x2d')]({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x25db32));};exports[_0x58c2('0x3d')]=function(_0x2edceb,_0x221a0f){logger[_0x58c2('0x11')](_0x58c2('0x3e'),_0x2edceb['body']);var _0x1302f0=unholdValidation['validate'](_0x2edceb[_0x58c2('0x2c')]);if(_0x1302f0[_0x58c2('0x27')]>0x0){return _0x221a0f[_0x58c2('0x15')](0x190)[_0x58c2('0x2d')](_0x1302f0);}var _0x280cf1=_0x2edceb['body'][_0x58c2('0x35')];var _0x35faa8=_0x2edceb[_0x58c2('0x2c')][_0x58c2('0x26')];return getAgent(_0x280cf1)[_0x58c2('0x19')](function(_0x37d59a){logger[_0x58c2('0x11')](_0x58c2('0x30'),_0x37d59a[_0x58c2('0x14')]);emit(util[_0x58c2('0x31')](_0x58c2('0x32'),_0x37d59a['name']),_0x58c2('0x3f'),{'sessionId':_0x35faa8});return _0x221a0f[_0x58c2('0x15')](0xc8)[_0x58c2('0x2d')]({'error':![],'message':_0x58c2('0x40')});})[_0x58c2('0x1d')](handleError(_0x221a0f));};exports[_0x58c2('0x41')]=function(_0x43b6ef,_0x3a169a){logger[_0x58c2('0x11')](_0x58c2('0x42'),_0x3a169a[_0x58c2('0x2c')]);var _0x4e1ba6=callsValidation[_0x58c2('0x38')](_0x43b6ef[_0x58c2('0x2c')]);if(_0x4e1ba6[_0x58c2('0x27')]>0x0){return _0x3a169a[_0x58c2('0x15')](0x190)['json'](_0x4e1ba6);}var _0x10f587=_0x43b6ef['body'][_0x58c2('0x35')];var _0x2cb1c5=respondWithRpcPromise('VoiceChannels');var _0x4b251e=getAgent(_0x10f587);return Promise[_0x58c2('0x22')]([_0x2cb1c5,_0x4b251e])['then'](function(_0x59a3ef){var _0x24bca8=_0x59a3ef[0x0];var _0x3f8e7c=_0x59a3ef[0x1];var _0x1a39bb=_[_0x58c2('0x23')](_0x24bca8[_0x58c2('0x24')],function(_0x421f7d){return _0x421f7d[_0x58c2('0x25')]==_0x3f8e7c['id'];});return _0x3a169a['status'](0xc8)[_0x58c2('0x2d')]({'count':_0x1a39bb['length'],'rows':_0x1a39bb});})['catch'](handleError(_0x3a169a));};exports['conference']=function(_0x21ad0f,_0x1f66da){logger[_0x58c2('0x11')](_0x58c2('0x43'),_0x21ad0f[_0x58c2('0x2c')]);var _0x238e6e=conferenceValidation['validate'](_0x21ad0f[_0x58c2('0x2c')]);if(_0x238e6e[_0x58c2('0x27')]>0x0){return _0x1f66da[_0x58c2('0x15')](0x190)[_0x58c2('0x2d')](_0x238e6e);}var _0x394bc0=_0x21ad0f['body'][_0x58c2('0x35')];return getAgent(_0x394bc0)[_0x58c2('0x19')](function(_0x4e68e2){logger[_0x58c2('0x11')](_0x58c2('0x30'),_0x4e68e2['name']);emit(util[_0x58c2('0x31')](_0x58c2('0x32'),_0x4e68e2[_0x58c2('0x14')]),_0x58c2('0x44'));return _0x1f66da[_0x58c2('0x15')](0xc8)[_0x58c2('0x2d')]({'error':![],'message':_0x58c2('0x45')});})[_0x58c2('0x1d')](handleError(_0x1f66da));};exports[_0x58c2('0x46')]=function(_0x3ce842,_0x116e28){logger[_0x58c2('0x11')](_0x58c2('0x47'),_0x3ce842[_0x58c2('0x2c')]);var _0x653ec4=transferValidation[_0x58c2('0x38')](_0x3ce842[_0x58c2('0x2c')]);if(_0x653ec4[_0x58c2('0x27')]>0x0){return _0x116e28['status'](0x190)[_0x58c2('0x2d')](_0x653ec4);}var _0x445ec3=_0x3ce842[_0x58c2('0x2c')][_0x58c2('0x35')];var _0x50e780=_0x3ce842['body'][_0x58c2('0x26')];var _0x521089=_0x3ce842[_0x58c2('0x2c')][_0x58c2('0x48')];return getAgent(_0x445ec3)[_0x58c2('0x19')](function(_0x5d13b5){logger[_0x58c2('0x11')](_0x58c2('0x30'),_0x5d13b5[_0x58c2('0x14')]);emit(util[_0x58c2('0x31')](_0x58c2('0x32'),_0x5d13b5[_0x58c2('0x14')]),_0x58c2('0x49'),{'sessionId':_0x50e780,'transferNumber':_0x521089});return _0x116e28['status'](0xc8)['json']({'error':![],'message':_0x58c2('0x4a')});})[_0x58c2('0x1d')](handleError(_0x116e28));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 4280ebe..9de9262 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3b4=['/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xe3b4,0xb0));var _0x4e3b=function(_0x48cc87,_0xf5bf00){_0x48cc87=_0x48cc87-0x0;var _0x5868bb=_0xe3b4[_0x48cc87];return _0x5868bb;};'use strict';var multer=require(_0x4e3b('0x0'));var util=require(_0x4e3b('0x1'));var path=require(_0x4e3b('0x2'));var timeout=require('connect-timeout');var express=require(_0x4e3b('0x3'));var router=express[_0x4e3b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4e3b('0x5'));var interaction=require(_0x4e3b('0x6'));var config=require(_0x4e3b('0x7'));var controller=require(_0x4e3b('0x8'));router['get']('/',auth[_0x4e3b('0x9')](),controller[_0x4e3b('0xa')]);router[_0x4e3b('0xb')](_0x4e3b('0xc'),auth[_0x4e3b('0x9')](),controller[_0x4e3b('0xd')]);router[_0x4e3b('0xb')](_0x4e3b('0xe'),auth['isAuthenticated'](),controller[_0x4e3b('0xf')]);router[_0x4e3b('0xb')](_0x4e3b('0x10'),auth[_0x4e3b('0x9')](),controller['getDispositions']);router['get'](_0x4e3b('0x11'),auth['isAuthenticated'](),controller[_0x4e3b('0x12')]);router[_0x4e3b('0xb')](_0x4e3b('0x13'),auth['isAuthenticated'](),controller[_0x4e3b('0x14')]);router[_0x4e3b('0xb')](_0x4e3b('0x15'),auth[_0x4e3b('0x9')](),controller[_0x4e3b('0x16')]);router[_0x4e3b('0x17')]('/',auth[_0x4e3b('0x9')](),controller[_0x4e3b('0x18')]);router[_0x4e3b('0x17')]('/:id/dispositions',auth[_0x4e3b('0x9')](),controller[_0x4e3b('0x19')]);router[_0x4e3b('0x17')](_0x4e3b('0x11'),auth[_0x4e3b('0x9')](),controller[_0x4e3b('0x1a')]);router[_0x4e3b('0x17')]('/:id/users',auth[_0x4e3b('0x9')](),controller[_0x4e3b('0x1b')]);router[_0x4e3b('0x17')](_0x4e3b('0x15'),auth['isAuthenticated'](),controller[_0x4e3b('0x1c')]);router[_0x4e3b('0x17')](_0x4e3b('0x1d'),controller[_0x4e3b('0x1e')]);router[_0x4e3b('0x17')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x4e3b('0x1f')](_0x4e3b('0xe'),auth[_0x4e3b('0x9')](),controller[_0x4e3b('0x20')]);router[_0x4e3b('0x21')](_0x4e3b('0xe'),auth[_0x4e3b('0x9')](),controller[_0x4e3b('0x22')]);router[_0x4e3b('0x21')](_0x4e3b('0x10'),auth[_0x4e3b('0x9')](),controller[_0x4e3b('0x23')]);router[_0x4e3b('0x21')](_0x4e3b('0x11'),auth[_0x4e3b('0x9')](),controller[_0x4e3b('0x24')]);router[_0x4e3b('0x21')](_0x4e3b('0x13'),auth[_0x4e3b('0x9')](),controller[_0x4e3b('0x25')]);module['exports']=router; \ No newline at end of file +var _0xcf35=['../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/users','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','notify','send','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','express','Router','fs-extra'];(function(_0x46530d,_0x121f73){var _0x4774c3=function(_0x2f5c02){while(--_0x2f5c02){_0x46530d['push'](_0x46530d['shift']());}};_0x4774c3(++_0x121f73);}(_0xcf35,0x83));var _0x5cf3=function(_0x3c414c,_0x399dbb){_0x3c414c=_0x3c414c-0x0;var _0x4f3062=_0xcf35[_0x3c414c];return _0x4f3062;};'use strict';var multer=require(_0x5cf3('0x0'));var util=require('util');var path=require(_0x5cf3('0x1'));var timeout=require('connect-timeout');var express=require(_0x5cf3('0x2'));var router=express[_0x5cf3('0x3')]();var fs_extra=require(_0x5cf3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5cf3('0x5'));var controller=require(_0x5cf3('0x6'));router[_0x5cf3('0x7')]('/',auth[_0x5cf3('0x8')](),controller[_0x5cf3('0x9')]);router[_0x5cf3('0x7')]('/describe',auth[_0x5cf3('0x8')](),controller[_0x5cf3('0xa')]);router[_0x5cf3('0x7')](_0x5cf3('0xb'),auth[_0x5cf3('0x8')](),controller[_0x5cf3('0xc')]);router[_0x5cf3('0x7')](_0x5cf3('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x5cf3('0x7')]('/:id/canned_answers',auth[_0x5cf3('0x8')](),controller['getAnswers']);router[_0x5cf3('0x7')](_0x5cf3('0xe'),auth[_0x5cf3('0x8')](),controller[_0x5cf3('0xf')]);router[_0x5cf3('0x7')](_0x5cf3('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x5cf3('0x11')]('/',auth[_0x5cf3('0x8')](),controller[_0x5cf3('0x12')]);router[_0x5cf3('0x11')](_0x5cf3('0xd'),auth[_0x5cf3('0x8')](),controller[_0x5cf3('0x13')]);router['post'](_0x5cf3('0x14'),auth[_0x5cf3('0x8')](),controller[_0x5cf3('0x15')]);router[_0x5cf3('0x11')]('/:id/users',auth[_0x5cf3('0x8')](),controller[_0x5cf3('0x16')]);router[_0x5cf3('0x11')](_0x5cf3('0x10'),auth['isAuthenticated'](),controller[_0x5cf3('0x17')]);router[_0x5cf3('0x11')](_0x5cf3('0x18'),controller[_0x5cf3('0x19')]);router[_0x5cf3('0x11')]('/:id/send',auth[_0x5cf3('0x8')](),controller[_0x5cf3('0x1a')]);router[_0x5cf3('0x1b')](_0x5cf3('0xb'),auth['isAuthenticated'](),controller[_0x5cf3('0x1c')]);router[_0x5cf3('0x1d')](_0x5cf3('0xb'),auth[_0x5cf3('0x8')](),controller['destroy']);router[_0x5cf3('0x1d')]('/:id/dispositions',auth[_0x5cf3('0x8')](),controller[_0x5cf3('0x1e')]);router[_0x5cf3('0x1d')](_0x5cf3('0x14'),auth[_0x5cf3('0x8')](),controller[_0x5cf3('0x1f')]);router[_0x5cf3('0x1d')](_0x5cf3('0xe'),auth[_0x5cf3('0x8')](),controller[_0x5cf3('0x20')]);module[_0x5cf3('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index d174257..b161a02 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdffd=['generate','twilio','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING'];(function(_0x1ef71d,_0x453e87){var _0x5bd739=function(_0x595a8a){while(--_0x595a8a){_0x1ef71d['push'](_0x1ef71d['shift']());}};_0x5bd739(++_0x453e87);}(_0xdffd,0x1dd));var _0xddff=function(_0x5e6023,_0x26ddf7){_0x5e6023=_0x5e6023-0x0;var _0x402ffd=_0xdffd[_0x5e6023];return _0x402ffd;};'use strict';var Sequelize=require(_0xddff('0x0'));var rs=require(_0xddff('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xddff('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xddff('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xddff('0x3')]();}},'phone':{'type':Sequelize[_0xddff('0x2')]},'type':{'type':Sequelize['ENUM'](_0xddff('0x4'))},'accountSid':{'type':Sequelize[_0xddff('0x2')]},'authToken':{'type':Sequelize[_0xddff('0x2')]},'notificationTemplate':{'type':Sequelize[_0xddff('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xddff('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xddff('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xddff('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xddff('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xddff('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xddff('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xddff('0x7')],'comment':_0xddff('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xddff('0x9'),'set':function(_0x51a5b4){if(!_0x51a5b4){this[_0xddff('0xa')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0xddff('0xb'),_0x51a5b4);}},'description':{'type':Sequelize[_0xddff('0x2')]}}; \ No newline at end of file +var _0x0f3c=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','generate','ENUM','twilio','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x8f8e58,_0x2fa3cc){var _0x24ce7a=function(_0x41bcca){while(--_0x41bcca){_0x8f8e58['push'](_0x8f8e58['shift']());}};_0x24ce7a(++_0x2fa3cc);}(_0x0f3c,0x185));var _0xc0f3=function(_0x478527,_0x2a3b0f){_0x478527=_0x478527-0x0;var _0x28c5fc=_0x0f3c[_0x478527];return _0x28c5fc;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc0f3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xc0f3('0x1')],'defaultValue':function(){return rs[_0xc0f3('0x2')]();}},'phone':{'type':Sequelize[_0xc0f3('0x1')]},'type':{'type':Sequelize[_0xc0f3('0x3')](_0xc0f3('0x4'))},'accountSid':{'type':Sequelize[_0xc0f3('0x1')]},'authToken':{'type':Sequelize[_0xc0f3('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc0f3('0x5');}},'notificationSound':{'type':Sequelize[_0xc0f3('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc0f3('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc0f3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc0f3('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc0f3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc0f3('0x7')],'comment':_0xc0f3('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xc0f3('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x400004){if(!_0x400004){this[_0xc0f3('0x9')](_0xc0f3('0xa'),null);}this[_0xc0f3('0x9')](_0xc0f3('0xb'),_0x400004);}},'description':{'type':Sequelize[_0xc0f3('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index eacc415..0333b1d 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc499=['save','update','then','destroy','UserProfileResource','stack','name','send','mandatoryDispositionPause','WhatsappAccount','type','key','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','Pause','keys','rawAttributes','include','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','userProfileId','autoAssociation','body','describe','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','removeDispositions','WhatsappAccountId','CannedAnswer','getAnswers','pick','removeAnswers','ids','addAgents','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','whatsapp','Applications','applications','orderBy','asc','account','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','from','From','replace','whatsapp:','Body','MessageSid','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','defaults','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','created','messageId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','entity\x20found','twilio','text/xml','\x0a','to\x20is\x20mandatory','List','out','WhatsappMessage','dataValues','Messages','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappAccount.socket','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject'];(function(_0x2d9f8f,_0x40bc79){var _0x240df4=function(_0x397d13){while(--_0x397d13){_0x2d9f8f['push'](_0x2d9f8f['shift']());}};_0x240df4(++_0x40bc79);}(_0xc499,0x85));var _0x9c49=function(_0x2a0bf0,_0x247ffd){_0x2a0bf0=_0x2a0bf0-0x0;var _0x104fd6=_0xc499[_0x2a0bf0];return _0x104fd6;};'use strict';var emlformat=require(_0x9c49('0x0'));var rimraf=require(_0x9c49('0x1'));var zipdir=require(_0x9c49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c49('0x3'));var moment=require(_0x9c49('0x4'));var BPromise=require(_0x9c49('0x5'));var Mustache=require(_0x9c49('0x6'));var util=require(_0x9c49('0x7'));var path=require(_0x9c49('0x8'));var sox=require(_0x9c49('0x9'));var csv=require(_0x9c49('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9c49('0xb'));var squel=require(_0x9c49('0xc'));var crypto=require(_0x9c49('0xd'));var jsforce=require(_0x9c49('0xe'));var deskjs=require(_0x9c49('0xf'));var toCsv=require(_0x9c49('0xa'));var querystring=require(_0x9c49('0x10'));var Papa=require(_0x9c49('0x11'));var Redis=require(_0x9c49('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9c49('0x13'));var as=require(_0x9c49('0x14'));var hardwareService=require(_0x9c49('0x15'));var logger=require(_0x9c49('0x16'))(_0x9c49('0x17'));var utils=require(_0x9c49('0x18'));var config=require(_0x9c49('0x19'));var licenseUtil=require(_0x9c49('0x1a'));var db=require(_0x9c49('0x1b'))['db'];config['redis']=_['defaults'](config[_0x9c49('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x9c49('0x1d'))(new Redis(config['redis']));require(_0x9c49('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x9c49('0x1f')][_0x9c49('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x2d679e,_0x237d5e,_0x1a4cf5,_0x445fb9){return new BPromise(function(_0x3af631,_0x47d1bd){var _0x4864ea=_0x445fb9||client;return _0x4864ea[_0x9c49('0x21')](_0x2d679e,_0x1a4cf5)['then'](function(_0x3138af){logger[_0x9c49('0x22')](_0x9c49('0x23'),_0x237d5e,_0x9c49('0x24'));logger[_0x9c49('0x25')](_0x9c49('0x26'),_0x237d5e,_0x9c49('0x24'),JSON[_0x9c49('0x27')](_0x3138af));if(_0x3138af[_0x9c49('0x28')]){if(_0x3138af[_0x9c49('0x28')][_0x9c49('0x29')]===0x1f4){logger[_0x9c49('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x237d5e,_0x3138af[_0x9c49('0x28')][_0x9c49('0x2a')]);return _0x47d1bd(_0x3138af[_0x9c49('0x28')][_0x9c49('0x2a')]);}logger['error'](_0x9c49('0x23'),_0x237d5e,_0x3138af[_0x9c49('0x28')][_0x9c49('0x2a')]);return _0x3af631(_0x3138af[_0x9c49('0x28')][_0x9c49('0x2a')]);}else{logger[_0x9c49('0x22')](_0x9c49('0x23'),_0x237d5e,'request\x20sent');_0x3af631(_0x3138af['result'][_0x9c49('0x2a')]);}})[_0x9c49('0x2b')](function(_0x9e31ae){logger[_0x9c49('0x28')](_0x9c49('0x23'),_0x237d5e,_0x9e31ae);_0x47d1bd(_0x9e31ae);});});}function respondWithStatusCode(_0x255eff,_0x48d830){_0x48d830=_0x48d830||0xcc;return function(_0x4efb36){if(_0x4efb36){return _0x255eff[_0x9c49('0x2c')](_0x48d830);}return _0x255eff['status'](_0x48d830)[_0x9c49('0x2d')]();};}function respondWithResult(_0x64d416,_0x99fe0e){_0x99fe0e=_0x99fe0e||0xc8;return function(_0x276ece){if(_0x276ece){return _0x64d416[_0x9c49('0x2e')](_0x99fe0e)['json'](_0x276ece);}};}function respondWithFilteredResult(_0x52d279,_0x47e5ec){return function(_0x2f3a6c){if(_0x2f3a6c){var _0x5dad79=typeof _0x47e5ec[_0x9c49('0x2f')]===_0x9c49('0x30')&&typeof _0x47e5ec[_0x9c49('0x31')]==='undefined';var _0x5e344a=_0x2f3a6c['count'];var _0x149c17=_0x5dad79?0x0:_0x47e5ec['offset'];var _0xf7a575=_0x5dad79?_0x2f3a6c[_0x9c49('0x32')]:_0x47e5ec[_0x9c49('0x2f')]+_0x47e5ec[_0x9c49('0x31')];var _0x4657e1;if(_0xf7a575>=_0x5e344a){_0xf7a575=_0x5e344a;_0x4657e1=0xc8;}else{_0x4657e1=0xce;}_0x52d279[_0x9c49('0x2e')](_0x4657e1);return _0x52d279[_0x9c49('0x33')](_0x9c49('0x34'),_0x149c17+'-'+_0xf7a575+'/'+_0x5e344a)[_0x9c49('0x35')](_0x2f3a6c);}return null;};}function patchUpdates(_0x7d3a23){return function(_0x41ef8a){try{jsonpatch['apply'](_0x41ef8a,_0x7d3a23,!![]);}catch(_0x61f3cc){return BPromise[_0x9c49('0x36')](_0x61f3cc);}return _0x41ef8a[_0x9c49('0x37')]();};}function saveUpdates(_0x2e25b2,_0x4acde1){return function(_0x17eb1e){if(_0x17eb1e){return _0x17eb1e[_0x9c49('0x38')](_0x2e25b2)[_0x9c49('0x39')](function(_0x178769){return _0x178769;});}return null;};}function removeEntity(_0x33fe35,_0x56b6e0){return function(_0x2d4d2f){if(_0x2d4d2f){return _0x2d4d2f[_0x9c49('0x3a')]()[_0x9c49('0x39')](function(){var _0x2e83b5=_0x2d4d2f['get']({'plain':!![]});var _0x3e2dc9='WhatsappAccounts';return db[_0x9c49('0x3b')]['destroy']({'where':{'type':_0x3e2dc9,'resourceId':_0x2e83b5['id']}})[_0x9c49('0x39')](function(){return _0x2d4d2f;});})[_0x9c49('0x39')](function(){_0x33fe35[_0x9c49('0x2e')](0xcc)[_0x9c49('0x2d')]();});}};}function handleEntityNotFound(_0x4b8446,_0x203b6d){return function(_0x26a075){if(!_0x26a075){_0x4b8446['sendStatus'](0x194);}return _0x26a075;};}function handleError(_0x4e9584,_0x128e2a){_0x128e2a=_0x128e2a||0x1f4;return function(_0x226258){logger[_0x9c49('0x28')](_0x226258[_0x9c49('0x3c')]);if(_0x226258[_0x9c49('0x3d')]){delete _0x226258[_0x9c49('0x3d')];}_0x4e9584[_0x9c49('0x2e')](_0x128e2a)[_0x9c49('0x3e')](_0x226258);};}exports['index']=function(_0x3aac77,_0xc37686){var _0x495cf5={'include':[{'model':db['Pause'],'as':_0x9c49('0x3f')}]},_0x38a857={},_0x44e007={'count':0x0,'rows':[]};var _0x2aa32e=_['map'](db[_0x9c49('0x40')]['rawAttributes'],function(_0x57263a){return{'name':_0x57263a['fieldName'],'type':_0x57263a[_0x9c49('0x41')][_0x9c49('0x42')]};});_0x38a857[_0x9c49('0x43')]=_[_0x9c49('0x44')](_0x2aa32e,_0x9c49('0x3d'));_0x38a857['query']=_['keys'](_0x3aac77[_0x9c49('0x45')]);_0x38a857[_0x9c49('0x46')]=_[_0x9c49('0x47')](_0x38a857[_0x9c49('0x43')],_0x38a857[_0x9c49('0x45')]);_0x495cf5[_0x9c49('0x48')]=_[_0x9c49('0x47')](_0x38a857[_0x9c49('0x43')],qs['fields'](_0x3aac77[_0x9c49('0x45')][_0x9c49('0x49')]));_0x495cf5[_0x9c49('0x48')]=_0x495cf5[_0x9c49('0x48')][_0x9c49('0x4a')]?_0x495cf5['attributes']:_0x38a857[_0x9c49('0x43')];if(!_0x3aac77[_0x9c49('0x45')]['hasOwnProperty']('nolimit')){_0x495cf5[_0x9c49('0x31')]=qs[_0x9c49('0x31')](_0x3aac77[_0x9c49('0x45')][_0x9c49('0x31')]);_0x495cf5['offset']=qs[_0x9c49('0x2f')](_0x3aac77[_0x9c49('0x45')][_0x9c49('0x2f')]);}_0x495cf5[_0x9c49('0x4b')]=qs[_0x9c49('0x4c')](_0x3aac77[_0x9c49('0x45')][_0x9c49('0x4c')]);_0x495cf5[_0x9c49('0x4d')]=qs[_0x9c49('0x46')](_['pick'](_0x3aac77[_0x9c49('0x45')],_0x38a857['filters']),_0x2aa32e);if(_0x3aac77['query'][_0x9c49('0x4e')]){_0x495cf5[_0x9c49('0x4d')]=_[_0x9c49('0x4f')](_0x495cf5[_0x9c49('0x4d')],{'$or':_[_0x9c49('0x44')](_0x2aa32e,function(_0x2f9bd7){if(_0x2f9bd7['type']!==_0x9c49('0x50')){var _0x177b87={};_0x177b87[_0x2f9bd7['name']]={'$like':'%'+_0x3aac77[_0x9c49('0x45')][_0x9c49('0x4e')]+'%'};return _0x177b87;}})});}_0x495cf5=_[_0x9c49('0x4f')]({},_0x495cf5,_0x3aac77['options']);var _0x2103ce={'where':_0x495cf5[_0x9c49('0x4d')]};return db[_0x9c49('0x40')][_0x9c49('0x32')](_0x2103ce)[_0x9c49('0x39')](function(_0x2104bf){_0x44e007['count']=_0x2104bf;if(_0x3aac77['query'][_0x9c49('0x51')]){_0x495cf5['include']=[{'all':!![]}];}return db[_0x9c49('0x40')][_0x9c49('0x52')](_0x495cf5);})[_0x9c49('0x39')](function(_0x39820f){_0x44e007[_0x9c49('0x53')]=_0x39820f;return _0x44e007;})[_0x9c49('0x39')](respondWithFilteredResult(_0xc37686,_0x495cf5))['catch'](handleError(_0xc37686,null));};exports[_0x9c49('0x54')]=function(_0x45ca5c,_0x21c13c){var _0x3e3550={'raw':![],'where':{'id':_0x45ca5c[_0x9c49('0x55')]['id']},'include':[{'model':db[_0x9c49('0x56')],'as':_0x9c49('0x3f')}]},_0x398198={};_0x398198[_0x9c49('0x43')]=_[_0x9c49('0x57')](db['WhatsappAccount'][_0x9c49('0x58')]);_0x398198[_0x9c49('0x45')]=_[_0x9c49('0x57')](_0x45ca5c[_0x9c49('0x45')]);_0x398198['filters']=_[_0x9c49('0x47')](_0x398198[_0x9c49('0x43')],_0x398198['query']);_0x3e3550[_0x9c49('0x48')]=_[_0x9c49('0x47')](_0x398198[_0x9c49('0x43')],qs[_0x9c49('0x49')](_0x45ca5c['query']['fields']));_0x3e3550[_0x9c49('0x48')]=_0x3e3550[_0x9c49('0x48')][_0x9c49('0x4a')]?_0x3e3550[_0x9c49('0x48')]:_0x398198['model'];if(_0x45ca5c['query'][_0x9c49('0x51')]){_0x3e3550[_0x9c49('0x59')]=[{'all':!![]}];}_0x3e3550=_[_0x9c49('0x4f')]({},_0x3e3550,_0x45ca5c[_0x9c49('0x5a')]);return db[_0x9c49('0x40')][_0x9c49('0x5b')](_0x3e3550)[_0x9c49('0x39')](handleEntityNotFound(_0x21c13c,null))['then'](respondWithResult(_0x21c13c,null))['catch'](handleError(_0x21c13c,null));};exports[_0x9c49('0x5c')]=function(_0x4ff765,_0x5951d8){return db['WhatsappAccount'][_0x9c49('0x5c')](_0x4ff765['body'],{})[_0x9c49('0x39')](function(_0x26afad){var _0x227d2d=_0x4ff765[_0x9c49('0x5d')][_0x9c49('0x5e')]({'plain':!![]});if(!_0x227d2d)throw new Error(_0x9c49('0x5f'));if(_0x227d2d[_0x9c49('0x60')]===_0x9c49('0x5d')){var _0x217860=_0x26afad[_0x9c49('0x5e')]({'plain':!![]});var _0x35c812=_0x9c49('0x61');return db['UserProfileSection'][_0x9c49('0x5b')]({'where':{'name':_0x35c812,'userProfileId':_0x227d2d[_0x9c49('0x62')]},'raw':!![]})['then'](function(_0x593f99){if(_0x593f99&&_0x593f99[_0x9c49('0x63')]===0x0){return db[_0x9c49('0x3b')]['create']({'name':_0x217860[_0x9c49('0x3d')],'resourceId':_0x217860['id'],'type':_0x593f99[_0x9c49('0x3d')],'sectionId':_0x593f99['id']},{})[_0x9c49('0x39')](function(){return _0x26afad;});}else{return _0x26afad;}})[_0x9c49('0x2b')](function(_0x2b5bb4){logger[_0x9c49('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b5bb4);throw _0x2b5bb4;});}return _0x26afad;})['then'](respondWithResult(_0x5951d8,0xc9))['catch'](handleError(_0x5951d8,null));};exports[_0x9c49('0x38')]=function(_0x30db05,_0x21f024){if(_0x30db05[_0x9c49('0x64')]['id']){delete _0x30db05[_0x9c49('0x64')]['id'];}return db[_0x9c49('0x40')][_0x9c49('0x5b')]({'where':{'id':_0x30db05[_0x9c49('0x55')]['id']},'include':[{'model':db[_0x9c49('0x56')],'as':_0x9c49('0x3f')}]})[_0x9c49('0x39')](handleEntityNotFound(_0x21f024,null))[_0x9c49('0x39')](saveUpdates(_0x30db05['body'],null))['then'](respondWithResult(_0x21f024,null))[_0x9c49('0x2b')](handleError(_0x21f024,null));};exports['destroy']=function(_0x46d093,_0xdb56ef){return db[_0x9c49('0x40')]['find']({'where':{'id':_0x46d093['params']['id']}})['then'](handleEntityNotFound(_0xdb56ef,null))[_0x9c49('0x39')](removeEntity(_0xdb56ef,null))['catch'](handleError(_0xdb56ef,null));};exports[_0x9c49('0x65')]=function(_0x2b4c8e,_0x55911d){return db[_0x9c49('0x40')]['describe']()[_0x9c49('0x39')](respondWithResult(_0x55911d,null))[_0x9c49('0x2b')](handleError(_0x55911d,null));};exports['addDisposition']=function(_0x110fba,_0x2a704b,_0x1993e2){if(_0x110fba[_0x9c49('0x64')]['id']){delete _0x110fba[_0x9c49('0x64')]['id'];}return db['WhatsappAccount'][_0x9c49('0x5b')]({'where':{'id':_0x110fba[_0x9c49('0x55')]['id']}})[_0x9c49('0x39')](handleEntityNotFound(_0x2a704b,null))['then'](function(_0x1e4def){if(_0x1e4def){_0x110fba[_0x9c49('0x64')]['WhatsappAccountId']=_0x1e4def['id'];return db[_0x9c49('0x66')][_0x9c49('0x5c')](_0x110fba[_0x9c49('0x64')]);}})[_0x9c49('0x39')](respondWithResult(_0x2a704b,null))[_0x9c49('0x2b')](handleError(_0x2a704b,null));};exports[_0x9c49('0x67')]=function(_0x1d58bd,_0x1d9207,_0x24d123){var _0x3d12f9={'raw':![],'where':{}};var _0x21e53d={};var _0x5b2fde={'count':0x0,'rows':[]};return db[_0x9c49('0x40')][_0x9c49('0x68')]({'where':{'id':_0x1d58bd[_0x9c49('0x55')]['id']}})[_0x9c49('0x39')](handleEntityNotFound(_0x1d9207,null))[_0x9c49('0x39')](function(_0x50652d){if(_0x50652d){_0x21e53d[_0x9c49('0x43')]=_[_0x9c49('0x57')](db[_0x9c49('0x66')][_0x9c49('0x58')]);_0x21e53d[_0x9c49('0x45')]=_[_0x9c49('0x57')](_0x1d58bd[_0x9c49('0x45')]);_0x21e53d[_0x9c49('0x46')]=_['intersection'](_0x21e53d[_0x9c49('0x43')],_0x21e53d[_0x9c49('0x45')]);_0x3d12f9[_0x9c49('0x48')]=_['intersection'](_0x21e53d['model'],qs[_0x9c49('0x49')](_0x1d58bd[_0x9c49('0x45')][_0x9c49('0x49')]));_0x3d12f9[_0x9c49('0x48')]=_0x3d12f9[_0x9c49('0x48')][_0x9c49('0x4a')]?_0x3d12f9[_0x9c49('0x48')]:_0x21e53d['model'];if(!_0x1d58bd[_0x9c49('0x45')][_0x9c49('0x69')](_0x9c49('0x6a'))){_0x3d12f9[_0x9c49('0x31')]=qs['limit'](_0x1d58bd[_0x9c49('0x45')][_0x9c49('0x31')]);_0x3d12f9[_0x9c49('0x2f')]=qs[_0x9c49('0x2f')](_0x1d58bd[_0x9c49('0x45')][_0x9c49('0x2f')]);}_0x3d12f9[_0x9c49('0x4b')]=qs['sort'](_0x1d58bd[_0x9c49('0x45')][_0x9c49('0x4c')]);_0x3d12f9[_0x9c49('0x4d')]=qs[_0x9c49('0x46')](_['pick'](_0x1d58bd['query'],_0x21e53d[_0x9c49('0x46')]));_0x3d12f9[_0x9c49('0x4d')]['WhatsappAccountId']=_0x50652d['id'];if(_0x1d58bd['query'][_0x9c49('0x4e')]){_0x3d12f9[_0x9c49('0x4d')]=_['merge'](_0x3d12f9[_0x9c49('0x4d')],{'$or':_[_0x9c49('0x44')](_0x3d12f9['attributes'],function(_0x1fdf11){var _0x540194={};_0x540194[_0x1fdf11]={'$like':'%'+_0x1d58bd[_0x9c49('0x45')][_0x9c49('0x4e')]+'%'};return _0x540194;})});}_0x3d12f9=_[_0x9c49('0x4f')]({},_0x3d12f9,_0x1d58bd[_0x9c49('0x5a')]);return db[_0x9c49('0x66')][_0x9c49('0x32')]({'where':_0x3d12f9[_0x9c49('0x4d')]})['then'](function(_0x4a1580){_0x5b2fde[_0x9c49('0x32')]=_0x4a1580;if(_0x1d58bd[_0x9c49('0x45')][_0x9c49('0x51')]){_0x3d12f9[_0x9c49('0x59')]=[{'all':!![]}];}return db[_0x9c49('0x66')]['findAll'](_0x3d12f9);})[_0x9c49('0x39')](function(_0x129e85){_0x5b2fde[_0x9c49('0x53')]=_0x129e85;return _0x5b2fde;});}})['then'](respondWithFilteredResult(_0x1d9207,_0x3d12f9))[_0x9c49('0x2b')](handleError(_0x1d9207,null));};exports[_0x9c49('0x6b')]=function(_0x2b52e2,_0x25cb64,_0x2e049a){return db[_0x9c49('0x40')][_0x9c49('0x5b')]({'where':{'id':_0x2b52e2['params']['id']}})[_0x9c49('0x39')](handleEntityNotFound(_0x25cb64,null))['then'](function(_0x59d987){if(_0x59d987){return _0x59d987[_0x9c49('0x6b')](_0x2b52e2[_0x9c49('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x25cb64,null))['catch'](handleError(_0x25cb64,null));};exports['addAnswer']=function(_0xe5e4bf,_0x3bd832,_0x5b9d3b){if(_0xe5e4bf[_0x9c49('0x64')]['id']){delete _0xe5e4bf[_0x9c49('0x64')]['id'];}return db['WhatsappAccount'][_0x9c49('0x5b')]({'where':{'id':_0xe5e4bf[_0x9c49('0x55')]['id']}})[_0x9c49('0x39')](handleEntityNotFound(_0x3bd832,null))[_0x9c49('0x39')](function(_0x3a0ea5){if(_0x3a0ea5){_0xe5e4bf[_0x9c49('0x64')][_0x9c49('0x6c')]=_0x3a0ea5['id'];return db[_0x9c49('0x6d')][_0x9c49('0x5c')](_0xe5e4bf[_0x9c49('0x64')]);}})[_0x9c49('0x39')](respondWithResult(_0x3bd832,null))[_0x9c49('0x2b')](handleError(_0x3bd832,null));};exports[_0x9c49('0x6e')]=function(_0x1b10a3,_0x59c45c,_0x48c1f1){var _0x87f5b={'raw':![],'where':{}};var _0x524a44={};var _0x38493d={'count':0x0,'rows':[]};return db[_0x9c49('0x40')][_0x9c49('0x68')]({'where':{'id':_0x1b10a3[_0x9c49('0x55')]['id']}})[_0x9c49('0x39')](handleEntityNotFound(_0x59c45c,null))[_0x9c49('0x39')](function(_0x2cd940){if(_0x2cd940){_0x524a44[_0x9c49('0x43')]=_[_0x9c49('0x57')](db['CannedAnswer']['rawAttributes']);_0x524a44[_0x9c49('0x45')]=_['keys'](_0x1b10a3[_0x9c49('0x45')]);_0x524a44[_0x9c49('0x46')]=_[_0x9c49('0x47')](_0x524a44[_0x9c49('0x43')],_0x524a44['query']);_0x87f5b[_0x9c49('0x48')]=_[_0x9c49('0x47')](_0x524a44[_0x9c49('0x43')],qs[_0x9c49('0x49')](_0x1b10a3[_0x9c49('0x45')][_0x9c49('0x49')]));_0x87f5b['attributes']=_0x87f5b[_0x9c49('0x48')][_0x9c49('0x4a')]?_0x87f5b['attributes']:_0x524a44[_0x9c49('0x43')];if(!_0x1b10a3[_0x9c49('0x45')][_0x9c49('0x69')](_0x9c49('0x6a'))){_0x87f5b['limit']=qs[_0x9c49('0x31')](_0x1b10a3[_0x9c49('0x45')][_0x9c49('0x31')]);_0x87f5b[_0x9c49('0x2f')]=qs[_0x9c49('0x2f')](_0x1b10a3[_0x9c49('0x45')]['offset']);}_0x87f5b[_0x9c49('0x4b')]=qs[_0x9c49('0x4c')](_0x1b10a3[_0x9c49('0x45')][_0x9c49('0x4c')]);_0x87f5b[_0x9c49('0x4d')]=qs[_0x9c49('0x46')](_[_0x9c49('0x6f')](_0x1b10a3[_0x9c49('0x45')],_0x524a44[_0x9c49('0x46')]));_0x87f5b[_0x9c49('0x4d')][_0x9c49('0x6c')]=_0x2cd940['id'];if(_0x1b10a3[_0x9c49('0x45')]['filter']){_0x87f5b[_0x9c49('0x4d')]=_[_0x9c49('0x4f')](_0x87f5b[_0x9c49('0x4d')],{'$or':_['map'](_0x87f5b[_0x9c49('0x48')],function(_0xc0ae8c){var _0x24d6ea={};_0x24d6ea[_0xc0ae8c]={'$like':'%'+_0x1b10a3[_0x9c49('0x45')][_0x9c49('0x4e')]+'%'};return _0x24d6ea;})});}_0x87f5b=_[_0x9c49('0x4f')]({},_0x87f5b,_0x1b10a3[_0x9c49('0x5a')]);return db[_0x9c49('0x6d')][_0x9c49('0x32')]({'where':_0x87f5b['where']})[_0x9c49('0x39')](function(_0x5c601c){_0x38493d[_0x9c49('0x32')]=_0x5c601c;if(_0x1b10a3[_0x9c49('0x45')][_0x9c49('0x51')]){_0x87f5b[_0x9c49('0x59')]=[{'all':!![]}];}return db[_0x9c49('0x6d')][_0x9c49('0x52')](_0x87f5b);})[_0x9c49('0x39')](function(_0x29dd1a){_0x38493d[_0x9c49('0x53')]=_0x29dd1a;return _0x38493d;});}})[_0x9c49('0x39')](respondWithFilteredResult(_0x59c45c,_0x87f5b))[_0x9c49('0x2b')](handleError(_0x59c45c,null));};exports[_0x9c49('0x70')]=function(_0x3c6ccb,_0x3cb954,_0x4d5111){return db[_0x9c49('0x40')][_0x9c49('0x5b')]({'where':{'id':_0x3c6ccb[_0x9c49('0x55')]['id']}})[_0x9c49('0x39')](handleEntityNotFound(_0x3cb954,null))[_0x9c49('0x39')](function(_0x172e4d){if(_0x172e4d){return _0x172e4d['removeAnswers'](_0x3c6ccb[_0x9c49('0x45')][_0x9c49('0x71')]);}})[_0x9c49('0x39')](respondWithStatusCode(_0x3cb954,null))[_0x9c49('0x2b')](handleError(_0x3cb954,null));};exports['addAgents']=function(_0x163f10,_0x3d0904,_0x39c244){return db[_0x9c49('0x40')][_0x9c49('0x5b')]({'where':{'id':_0x163f10[_0x9c49('0x55')]['id']}})[_0x9c49('0x39')](handleEntityNotFound(_0x3d0904,null))['then'](function(_0x2ad6d3){if(_0x2ad6d3){return _0x2ad6d3[_0x9c49('0x72')](_0x163f10[_0x9c49('0x64')]['ids'],_['omit'](_0x163f10[_0x9c49('0x64')],[_0x9c49('0x71'),'id'])||{})[_0x9c49('0x73')](function(_0xe7c7a5){for(var _0x27211f=0x0;_0x27211f<_0x163f10[_0x9c49('0x64')][_0x9c49('0x71')]['length'];_0x27211f+=0x1){socket[_0x9c49('0x74')]('userWhatsappAccount:save',{'UserId':_0x163f10[_0x9c49('0x64')][_0x9c49('0x71')][_0x27211f],'WhatsappAccountId':_0x163f10[_0x9c49('0x55')]['id']});}return _0xe7c7a5;});}})['then'](respondWithResult(_0x3d0904,null))[_0x9c49('0x2b')](handleError(_0x3d0904,null));};exports[_0x9c49('0x75')]=function(_0x35b19f,_0x4c39d6,_0x3c4afb){return db[_0x9c49('0x40')][_0x9c49('0x5b')]({'where':{'id':_0x35b19f[_0x9c49('0x55')]['id']}})[_0x9c49('0x39')](handleEntityNotFound(_0x4c39d6,null))[_0x9c49('0x39')](function(_0x23c7cc){if(_0x23c7cc){return _0x23c7cc[_0x9c49('0x75')](_0x35b19f[_0x9c49('0x45')][_0x9c49('0x71')])[_0x9c49('0x39')](function(){if(_[_0x9c49('0x76')](_0x35b19f[_0x9c49('0x45')]['ids'])){for(var _0xfde5f7=0x0;_0xfde5f7<_0x35b19f[_0x9c49('0x45')][_0x9c49('0x71')][_0x9c49('0x4a')];_0xfde5f7+=0x1){socket['emit'](_0x9c49('0x77'),{'UserId':Number(_0x35b19f[_0x9c49('0x45')][_0x9c49('0x71')][_0xfde5f7]),'WhatsappAccountId':Number(_0x35b19f[_0x9c49('0x55')]['id'])});}}else{socket[_0x9c49('0x74')](_0x9c49('0x77'),{'UserId':Number(_0x35b19f[_0x9c49('0x45')]['ids']),'WhatsappAccountId':Number(_0x35b19f[_0x9c49('0x55')]['id'])});}});}})[_0x9c49('0x39')](respondWithStatusCode(_0x4c39d6,null))[_0x9c49('0x2b')](handleError(_0x4c39d6,null));};exports[_0x9c49('0x78')]=function(_0x48521c,_0x19eb20,_0x54e0a4){var _0x3285d8={};var _0x3058ec={};var _0x377d12;var _0x5eb069;return db['WhatsappAccount'][_0x9c49('0x68')]({'where':{'id':_0x48521c[_0x9c49('0x55')]['id']}})['then'](handleEntityNotFound(_0x19eb20,null))[_0x9c49('0x39')](function(_0x35dd4d){if(_0x35dd4d){_0x377d12=_0x35dd4d;_0x3058ec[_0x9c49('0x43')]=_[_0x9c49('0x57')](db[_0x9c49('0x79')][_0x9c49('0x58')]);_0x3058ec['query']=_[_0x9c49('0x57')](_0x48521c['query']);_0x3058ec['filters']=_[_0x9c49('0x47')](_0x3058ec[_0x9c49('0x43')],_0x3058ec[_0x9c49('0x45')]);_0x3285d8[_0x9c49('0x48')]=_[_0x9c49('0x47')](_0x3058ec[_0x9c49('0x43')],qs[_0x9c49('0x49')](_0x48521c[_0x9c49('0x45')][_0x9c49('0x49')]));_0x3285d8[_0x9c49('0x48')]=_0x3285d8[_0x9c49('0x48')]['length']?_0x3285d8[_0x9c49('0x48')]:_0x3058ec[_0x9c49('0x43')];_0x3285d8['order']=qs['sort'](_0x48521c['query'][_0x9c49('0x4c')]);_0x3285d8[_0x9c49('0x4d')]=qs[_0x9c49('0x46')](_[_0x9c49('0x6f')](_0x48521c[_0x9c49('0x45')],_0x3058ec[_0x9c49('0x46')]));if(_0x48521c[_0x9c49('0x45')][_0x9c49('0x4e')]){_0x3285d8[_0x9c49('0x4d')]=_[_0x9c49('0x4f')](_0x3285d8['where'],{'$or':_[_0x9c49('0x44')](_0x3285d8[_0x9c49('0x48')],function(_0x293d97){var _0x1a6830={};_0x1a6830[_0x293d97]={'$like':'%'+_0x48521c['query'][_0x9c49('0x4e')]+'%'};return _0x1a6830;})});}_0x3285d8=_[_0x9c49('0x4f')]({},_0x3285d8,_0x48521c[_0x9c49('0x5a')]);return _0x377d12[_0x9c49('0x78')](_0x3285d8);}})['then'](function(_0x3e21d9){if(_0x3e21d9){_0x5eb069=_0x3e21d9[_0x9c49('0x4a')];if(!_0x48521c[_0x9c49('0x45')][_0x9c49('0x69')](_0x9c49('0x6a'))){_0x3285d8['limit']=qs[_0x9c49('0x31')](_0x48521c['query']['limit']);_0x3285d8[_0x9c49('0x2f')]=qs[_0x9c49('0x2f')](_0x48521c['query'][_0x9c49('0x2f')]);}return _0x377d12[_0x9c49('0x78')](_0x3285d8);}})[_0x9c49('0x39')](function(_0x1606fb){if(_0x1606fb){return _0x1606fb?{'count':_0x5eb069,'rows':_0x1606fb}:null;}})[_0x9c49('0x39')](respondWithResult(_0x19eb20,null))[_0x9c49('0x2b')](handleError(_0x19eb20,null));};exports[_0x9c49('0x7a')]=function(_0x120b7b,_0x4a57a7,_0x388432){return db[_0x9c49('0x40')][_0x9c49('0x68')]({'where':{'id':_0x120b7b['params']['id']}})[_0x9c49('0x39')](handleEntityNotFound(_0x4a57a7,null))[_0x9c49('0x39')](function(_0x3a226b){if(_0x3a226b){return db[_0x9c49('0x7b')]['transaction'](function(_0x510e17){return db[_0x9c49('0x7c')][_0x9c49('0x3a')]({'where':{'WhatsappAccountId':_0x120b7b[_0x9c49('0x55')]['id']},'transaction':_0x510e17})[_0x9c49('0x39')](function(_0x2fbe0b){var _0xfb0b84=_[_0x9c49('0x44')](_0x120b7b['body'],function(_0x2231d2){_0x2231d2['WhatsappAccountId']=_0x120b7b[_0x9c49('0x55')]['id'];return _0x2231d2;});return db['WhatsappApplication'][_0x9c49('0x7d')](_0xfb0b84,{'transaction':_0x510e17});});})[_0x9c49('0x39')](function(){return db[_0x9c49('0x7c')][_0x9c49('0x7e')]({'where':{'WhatsappAccountId':_0x120b7b[_0x9c49('0x55')]['id']},'order':_0x9c49('0x7f')});});}})[_0x9c49('0x39')](respondWithResult(_0x4a57a7,null))[_0x9c49('0x2b')](handleError(_0x4a57a7,null));};exports[_0x9c49('0x80')]=function(_0x39ede3,_0x4eec20,_0x279d93){var _0x237f1b={};var _0x1c2a60={};var _0x44226;var _0x265e38;return db['WhatsappAccount'][_0x9c49('0x68')]({'where':{'id':_0x39ede3[_0x9c49('0x55')]['id']}})[_0x9c49('0x39')](handleEntityNotFound(_0x4eec20,null))[_0x9c49('0x39')](function(_0x4fe803){if(_0x4fe803){_0x44226=_0x4fe803;_0x1c2a60['model']=_[_0x9c49('0x57')](db[_0x9c49('0x7c')][_0x9c49('0x58')]);_0x1c2a60[_0x9c49('0x45')]=_[_0x9c49('0x57')](_0x39ede3[_0x9c49('0x45')]);_0x1c2a60[_0x9c49('0x46')]=_[_0x9c49('0x47')](_0x1c2a60[_0x9c49('0x43')],_0x1c2a60[_0x9c49('0x45')]);_0x237f1b[_0x9c49('0x48')]=_[_0x9c49('0x47')](_0x1c2a60['model'],qs[_0x9c49('0x49')](_0x39ede3[_0x9c49('0x45')][_0x9c49('0x49')]));_0x237f1b['attributes']=_0x237f1b[_0x9c49('0x48')][_0x9c49('0x4a')]?_0x237f1b[_0x9c49('0x48')]:_0x1c2a60[_0x9c49('0x43')];_0x237f1b[_0x9c49('0x4b')]=qs['sort'](_0x39ede3['query']['sort']);_0x237f1b[_0x9c49('0x4d')]=qs[_0x9c49('0x46')](_[_0x9c49('0x6f')](_0x39ede3['query'],_0x1c2a60['filters']));if(_0x39ede3[_0x9c49('0x45')][_0x9c49('0x4e')]){_0x237f1b[_0x9c49('0x4d')]=_[_0x9c49('0x4f')](_0x237f1b['where'],{'$or':_['map'](_0x237f1b[_0x9c49('0x48')],function(_0x3de8be){var _0x1d9720={};_0x1d9720[_0x3de8be]={'$like':'%'+_0x39ede3[_0x9c49('0x45')][_0x9c49('0x4e')]+'%'};return _0x1d9720;})});}_0x237f1b=_[_0x9c49('0x4f')]({},_0x237f1b,_0x39ede3['options']);return _0x44226[_0x9c49('0x80')](_0x237f1b);}})[_0x9c49('0x39')](function(_0x3e0e94){if(_0x3e0e94){_0x265e38=_0x3e0e94[_0x9c49('0x4a')];if(!_0x39ede3[_0x9c49('0x45')]['hasOwnProperty'](_0x9c49('0x6a'))){_0x237f1b[_0x9c49('0x31')]=qs['limit'](_0x39ede3[_0x9c49('0x45')]['limit']);_0x237f1b[_0x9c49('0x2f')]=qs[_0x9c49('0x2f')](_0x39ede3[_0x9c49('0x45')][_0x9c49('0x2f')]);}return _0x44226[_0x9c49('0x80')](_0x237f1b);}})['then'](function(_0x1bd22b){if(_0x1bd22b){return _0x1bd22b?{'count':_0x265e38,'rows':_0x1bd22b}:null;}})[_0x9c49('0x39')](respondWithResult(_0x4eec20,null))[_0x9c49('0x2b')](handleError(_0x4eec20,null));};exports['notify']=function(_0x18dce9,_0x1682a7,_0x309e0c){var _0x4672fb={'channel':_0x9c49('0x81')};var _0x5f5c35=[];var _0x4b9c7a=[];var _0x3f8983={};return db[_0x9c49('0x40')][_0x9c49('0x5b')]({'where':{'id':_0x18dce9[_0x9c49('0x55')]['id']},'include':[{'model':db[_0x9c49('0x7c')],'as':_0x9c49('0x82')}]})[_0x9c49('0x39')](handleEntityNotFound(_0x1682a7,null))[_0x9c49('0x39')](function(_0x489262){_0x4672fb['account']=_0x489262;_0x4672fb[_0x9c49('0x83')]=_[_0x9c49('0x84')](_0x489262[_0x9c49('0x82')],[_0x9c49('0x7f')],[_0x9c49('0x85')]);if(_0x4672fb[_0x9c49('0x86')][_0x9c49('0x82')]){delete _0x4672fb[_0x9c49('0x86')][_0x9c49('0x82')];}return db[_0x9c49('0x87')][_0x9c49('0x65')]();})[_0x9c49('0x39')](function(_0x897638){if(!_0x897638){throw new db['Sequelize'][(_0x9c49('0x88'))](_0x9c49('0x89'));}_0x5f5c35=_['difference'](_[_0x9c49('0x57')](_0x897638),[_0x9c49('0x8a'),'updatedAt']);_0x4b9c7a=_['difference'](_[_0x9c49('0x57')](_0x897638),['createdAt',_0x9c49('0x8b'),_0x9c49('0x8c'),_0x9c49('0x8d')]);_0x4672fb['body']={'mapKey':'mobile'};if(_0x4672fb[_0x9c49('0x86')][_0x9c49('0x41')]&&_0x4672fb[_0x9c49('0x86')]['type']==='twilio'){_0x4672fb['body'][_0x9c49('0x8e')]=_0x18dce9[_0x9c49('0x64')][_0x9c49('0x8f')][_0x9c49('0x90')](_0x9c49('0x91'),'');_0x4672fb['body']['body']=_0x18dce9[_0x9c49('0x64')][_0x9c49('0x92')];_0x4672fb[_0x9c49('0x64')]['messageId']=_0x18dce9[_0x9c49('0x64')][_0x9c49('0x93')];}if(_0x4672fb[_0x9c49('0x64')]['id']){delete _0x4672fb[_0x9c49('0x64')]['id'];}if(_[_0x9c49('0x94')](_0x4672fb['body'][_0x9c49('0x8e')])){throw new db[(_0x9c49('0x95'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x4672fb['body'][_0x9c49('0x64')])||_0x4672fb[_0x9c49('0x64')]['body']===''){throw new db['Sequelize'][(_0x9c49('0x88'))](_0x9c49('0x96'));}if(_[_0x9c49('0x94')](_0x4672fb['body'][_0x9c49('0x97')])){throw new db['Sequelize'][(_0x9c49('0x88'))](_0x9c49('0x98')+_0x4b9c7a);}if(!_[_0x9c49('0x99')](_0x4b9c7a,_0x4672fb[_0x9c49('0x64')]['mapKey'])){throw new db[(_0x9c49('0x95'))]['ValidationError'](_0x9c49('0x9a')+_0x4b9c7a);}_0x3f8983[_0x4672fb[_0x9c49('0x64')][_0x9c49('0x97')]]=_0x4672fb[_0x9c49('0x64')][_0x9c49('0x8e')];return db[_0x9c49('0x9b')][_0x9c49('0x5b')]({'where':{'id':_0x4672fb[_0x9c49('0x86')][_0x9c49('0x8d')]},'include':[{'model':db[_0x9c49('0x87')],'as':'Contacts','where':_0x3f8983,'limit':0x1,'order':[['updatedAt',_0x9c49('0x9c')]]}]});})['then'](handleEntityNotFound(_0x1682a7,null))[_0x9c49('0x39')](function(_0x573aa6){if(_0x573aa6){_0x4672fb[_0x9c49('0x9d')]=_[_0x9c49('0x9e')](_0x573aa6,[_0x9c49('0x9f')]);if(_0x573aa6[_0x9c49('0x9f')][_0x9c49('0x4a')]){return _0x573aa6[_0x9c49('0x9f')][0x0];}var _0x31ba58=_[_0x9c49('0xa0')](_0x4672fb['body'],{'firstName':_0x4672fb[_0x9c49('0x64')][_0x9c49('0x8e')],'ListId':_0x573aa6['id']});_0x31ba58[_0x4672fb[_0x9c49('0x64')][_0x9c49('0x97')]]=_0x4672fb[_0x9c49('0x64')][_0x9c49('0x8e')];return db[_0x9c49('0x87')][_0x9c49('0x5c')](_0x31ba58,{'fields':_0x5f5c35,'raw':!![]});}})[_0x9c49('0x39')](handleEntityNotFound(_0x1682a7,null))[_0x9c49('0x39')](function(_0x4434e4){if(_0x4434e4){_0x4672fb[_0x9c49('0xa1')]=_0x4434e4;var _0x23dfa8={'ContactId':_0x4434e4['id'],'phone':_0x4672fb[_0x9c49('0x64')][_0x9c49('0x8e')],'WhatsappAccountId':_0x18dce9[_0x9c49('0x55')]['id']};var _0x584c09={'ContactId':_0x4434e4['id'],'WhatsappAccountId':_0x18dce9[_0x9c49('0x55')]['id'],'closed':![]};return db[_0x9c49('0xa2')][_0x9c49('0x5b')]({'where':_0x584c09})['then'](function(_0x4b31fa){if(_0x4b31fa){return[_0x4b31fa,![]];}return db[_0x9c49('0xa2')][_0x9c49('0x5c')](_0x23dfa8)[_0x9c49('0x39')](function(_0x35cc80){return[_0x35cc80,!![]];});});}})[_0x9c49('0x73')](function(_0x142744,_0x1b7b3a){_0x4672fb['interaction']=_0x142744[_0x9c49('0x5e')]({'plain':!![]});_0x4672fb[_0x9c49('0xa3')]['created']=![];if(_0x1b7b3a){if(_0x4672fb[_0x9c49('0x86')][_0x9c49('0xa4')]){_0x4672fb[_0x9c49('0x83')][_0x9c49('0xa5')]({'id':0x0,'priority':_0x4672fb[_0x9c49('0x83')][_0x9c49('0x4a')]+0x1,'app':_0x9c49('0xa6'),'appdata':_0x9c49('0xa7'),'interval':'*,*,*,*'});}_0x4672fb['interaction'][_0x9c49('0xa8')]=!![];}return db['WhatsappMessage'][_0x9c49('0x5c')]({'phone':_0x4672fb['body'][_0x9c49('0x8e')],'messageId':_0x4672fb[_0x9c49('0x64')][_0x9c49('0xa9')],'body':_0x4672fb[_0x9c49('0x64')][_0x9c49('0x64')],'WhatsappAccountId':_0x18dce9['params']['id'],'WhatsappInteractionId':_0x142744['id'],'direction':'in','ContactId':_0x142744['ContactId'],'AttachmentId':_0x4672fb[_0x9c49('0x64')][_0x9c49('0xaa')]});})[_0x9c49('0x39')](function(_0x1f6a34){_0x4672fb[_0x9c49('0x2a')]=_0x1f6a34;if(_0x4672fb[_0x9c49('0xa3')][_0x9c49('0xab')]){return db[_0x9c49('0x79')][_0x9c49('0x5b')]({'attributes':['id',_0x9c49('0x3d')],'where':{'id':_0x4672fb[_0x9c49('0xa3')][_0x9c49('0xab')]}})[_0x9c49('0x39')](function(_0x3ceedc){if(_0x3ceedc){_0x4672fb[_0x9c49('0x83')][_0x9c49('0xac')]({'id':0x0,'priority':0x0,'app':_0x9c49('0xad'),'appdata':_0x3ceedc['name']+','+(_0x4672fb[_0x9c49('0x86')][_0x9c49('0xae')]||0xa),'interval':_0x9c49('0xaf')});}return respondWithRpcPromise('Start',_0x9c49('0xb0'),_0x4672fb);});}return respondWithRpcPromise(_0x9c49('0xb1'),_0x9c49('0xb0'),_0x4672fb);})[_0x9c49('0x39')](function(_0x53252f){if(_0x53252f){var _0x3a7312=0xc8;var _0xccf366='receiveMessage';logger[_0x9c49('0x22')](_0x9c49('0x26'),_0xccf366,_0x3a7312,'entity\x20found');logger[_0x9c49('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xccf366,_0x3a7312,_0x9c49('0xb2'),JSON[_0x9c49('0x27')](_0x53252f));if(_0x4672fb[_0x9c49('0x86')]['type']===_0x9c49('0xb3')){return _0x1682a7[_0x9c49('0x2e')](_0x3a7312)['set']('Content-Type',_0x9c49('0xb4'))[_0x9c49('0x3e')](_0x9c49('0xb5'));}else{return _0x1682a7[_0x9c49('0x2e')](_0x3a7312)[_0x9c49('0x35')](_0x53252f);}}})['catch'](handleError(_0x1682a7,null));};exports[_0x9c49('0x3e')]=function(_0x5f14ac,_0x55a9ee,_0x319274){var _0x207839,_0x4035d2,_0x1a1722;if(_[_0x9c49('0x94')](_0x5f14ac['body']['body'])||_0x5f14ac[_0x9c49('0x64')][_0x9c49('0x64')]===''){throw new db[(_0x9c49('0x95'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9c49('0x94')](_0x5f14ac['body']['to'])){throw new db[(_0x9c49('0x95'))][(_0x9c49('0x88'))](_0x9c49('0xb6'));}_0x207839=_0x5f14ac[_0x9c49('0x64')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x5f14ac[_0x9c49('0x55')]['id']},'include':[{'model':db[_0x9c49('0x9b')],'as':_0x9c49('0xb7'),'include':[{'model':db[_0x9c49('0x87')],'as':_0x9c49('0x9f'),'where':{'mobile':_0x207839},'limit':0x1,'order':[[_0x9c49('0x8b'),_0x9c49('0x9c')]]}]}]})[_0x9c49('0x39')](handleEntityNotFound(_0x55a9ee,null))[_0x9c49('0x39')](function(_0xa78bcf){if(_0xa78bcf&&_0xa78bcf['List']){_0x4035d2=_0xa78bcf[_0x9c49('0x5e')]({'plain':!![]});if(_0x4035d2['List']&&_0x4035d2[_0x9c49('0xb7')][_0x9c49('0x9f')][_0x9c49('0x4a')]){return _0x4035d2[_0x9c49('0xb7')][_0x9c49('0x9f')][0x0];}return db['CmContact'][_0x9c49('0x5c')](_[_0x9c49('0xa0')](_0x5f14ac[_0x9c49('0x64')],{'firstName':_0x207839,'mobile':_0x207839,'phone':_0x207839,'ListId':_0x4035d2[_0x9c49('0x8d')]}));}})[_0x9c49('0x39')](handleEntityNotFound(_0x55a9ee,null))[_0x9c49('0x39')](function(_0x6a22ad){if(_0x6a22ad){_0x1a1722=_0x6a22ad;return db[_0x9c49('0xa2')][_0x9c49('0x5b')]({'where':{'ContactId':_0x1a1722['id'],'closed':![],'WhatsappAccountId':_0x4035d2['id']}})[_0x9c49('0x39')](function(_0x3ed17b){if(_0x3ed17b){return[_0x3ed17b,![]];}return db['WhatsappInteraction'][_0x9c49('0x5c')]({'UserId':_0x5f14ac[_0x9c49('0x5d')]['id'],'ContactId':_0x1a1722['id'],'WhatsappAccountId':_0x4035d2['id'],'phone':_0x207839,'firstMsgDirection':_0x9c49('0xb8'),'Messages':[_[_0x9c49('0x4f')](_0x5f14ac[_0x9c49('0x64')],{'read':![],'body':_0x5f14ac[_0x9c49('0x64')]['body'],'phone':_0x207839,'WhatsappAccountId':_0x4035d2['id'],'UserId':_0x5f14ac['user']['id'],'ContactId':_0x1a1722['id']})]},{'include':[{'model':db[_0x9c49('0xb9')],'as':'Messages'}]})['then'](function(_0x2058ce){return[_0x2058ce,!![]];});});}})[_0x9c49('0x73')](function(_0x519471,_0x1659a2){if(_0x1659a2){return _0x519471;}return db['WhatsappMessage'][_0x9c49('0x5c')](_[_0x9c49('0x4f')](_0x5f14ac[_0x9c49('0x64')],{'read':![],'body':_0x5f14ac[_0x9c49('0x64')][_0x9c49('0x64')],'phone':_0x207839,'WhatsappAccountId':_0x4035d2['id'],'WhatsappInteractionId':_0x519471['id'],'UserId':_0x5f14ac[_0x9c49('0x5d')]['id'],'ContactId':_0x1a1722['id']}))[_0x9c49('0x39')](function(_0x33b905){_0x519471[_0x9c49('0xba')]['Messages']=[];_0x519471[_0x9c49('0xba')][_0x9c49('0xbb')][_0x9c49('0xa5')](_0x33b905[_0x9c49('0xba')]);return _0x519471;});})[_0x9c49('0x39')](respondWithResult(_0x55a9ee,null))['catch'](handleError(_0x55a9ee,null));}; \ No newline at end of file +var _0xc1ea=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','fields','attributes','length','query','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','WhatsappAccount','findAll','rows','params','Pause','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','catch','describe','WhatsappAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','addAgents','omit','spread','removeAgents','isArray','emit','getAgents','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','applications','orderBy','asc','CmContact','createdAt','updatedAt','difference','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','push','unmanaged','*,*,*,*','WhatsappMessage','UserId','User','unshift','agent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','to\x20is\x20mandatory','List','dataValues','Messages','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x546005,_0x354855){var _0x516d1e=function(_0x5afc06){while(--_0x5afc06){_0x546005['push'](_0x546005['shift']());}};_0x516d1e(++_0x354855);}(_0xc1ea,0xa2));var _0xac1e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc1ea[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xac1e('0x0'));var jsonpatch=require(_0xac1e('0x1'));var rp=require(_0xac1e('0x2'));var moment=require(_0xac1e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xac1e('0x4'));var util=require(_0xac1e('0x5'));var path=require(_0xac1e('0x6'));var sox=require(_0xac1e('0x7'));var csv=require('to-csv');var ejs=require(_0xac1e('0x8'));var fs=require('fs');var fs_extra=require(_0xac1e('0x9'));var _=require(_0xac1e('0xa'));var squel=require(_0xac1e('0xb'));var crypto=require('crypto');var jsforce=require(_0xac1e('0xc'));var deskjs=require(_0xac1e('0xd'));var toCsv=require(_0xac1e('0xe'));var querystring=require('querystring');var Papa=require(_0xac1e('0xf'));var Redis=require(_0xac1e('0x10'));var authService=require(_0xac1e('0x11'));var qs=require(_0xac1e('0x12'));var as=require(_0xac1e('0x13'));var hardwareService=require(_0xac1e('0x14'));var logger=require(_0xac1e('0x15'))(_0xac1e('0x16'));var utils=require('../../config/utils');var config=require(_0xac1e('0x17'));var licenseUtil=require(_0xac1e('0x18'));var db=require(_0xac1e('0x19'))['db'];config[_0xac1e('0x1a')]=_[_0xac1e('0x1b')](config[_0xac1e('0x1a')],{'host':_0xac1e('0x1c'),'port':0x18eb});var socket=require(_0xac1e('0x1d'))(new Redis(config['redis']));require(_0xac1e('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xac1e('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1133d1,_0x539a15,_0x51a0f6,_0x3a3566){return new BPromise(function(_0xe8e407,_0x3a3f51){var _0x508c1c=_0x3a3566||client;return _0x508c1c[_0xac1e('0x20')](_0x1133d1,_0x51a0f6)[_0xac1e('0x21')](function(_0x594c95){logger[_0xac1e('0x22')](_0xac1e('0x23'),_0x539a15,'request\x20sent');logger[_0xac1e('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x539a15,_0xac1e('0x25'),JSON[_0xac1e('0x26')](_0x594c95));if(_0x594c95['error']){if(_0x594c95[_0xac1e('0x27')][_0xac1e('0x28')]===0x1f4){logger[_0xac1e('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x539a15,_0x594c95[_0xac1e('0x27')][_0xac1e('0x29')]);return _0x3a3f51(_0x594c95[_0xac1e('0x27')]['message']);}logger[_0xac1e('0x27')](_0xac1e('0x23'),_0x539a15,_0x594c95[_0xac1e('0x27')]['message']);return _0xe8e407(_0x594c95[_0xac1e('0x27')][_0xac1e('0x29')]);}else{logger[_0xac1e('0x22')](_0xac1e('0x23'),_0x539a15,'request\x20sent');_0xe8e407(_0x594c95[_0xac1e('0x2a')]['message']);}})['catch'](function(_0x291dd6){logger[_0xac1e('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x539a15,_0x291dd6);_0x3a3f51(_0x291dd6);});});}function respondWithStatusCode(_0x1c881d,_0x21b18e){_0x21b18e=_0x21b18e||0xcc;return function(_0x468bfe){if(_0x468bfe){return _0x1c881d['sendStatus'](_0x21b18e);}return _0x1c881d[_0xac1e('0x2b')](_0x21b18e)[_0xac1e('0x2c')]();};}function respondWithResult(_0x2d96c5,_0x5314a2){_0x5314a2=_0x5314a2||0xc8;return function(_0x312e44){if(_0x312e44){return _0x2d96c5[_0xac1e('0x2b')](_0x5314a2)[_0xac1e('0x2d')](_0x312e44);}};}function respondWithFilteredResult(_0x4f5f81,_0x2077a2){return function(_0x3a000a){if(_0x3a000a){var _0x147236=typeof _0x2077a2[_0xac1e('0x2e')]===_0xac1e('0x2f')&&typeof _0x2077a2[_0xac1e('0x30')]===_0xac1e('0x2f');var _0x1a354a=_0x3a000a[_0xac1e('0x31')];var _0x29cf08=_0x147236?0x0:_0x2077a2[_0xac1e('0x2e')];var _0x2cdc1c=_0x147236?_0x3a000a['count']:_0x2077a2['offset']+_0x2077a2[_0xac1e('0x30')];var _0x39e55a;if(_0x2cdc1c>=_0x1a354a){_0x2cdc1c=_0x1a354a;_0x39e55a=0xc8;}else{_0x39e55a=0xce;}_0x4f5f81[_0xac1e('0x2b')](_0x39e55a);return _0x4f5f81[_0xac1e('0x32')]('Content-Range',_0x29cf08+'-'+_0x2cdc1c+'/'+_0x1a354a)[_0xac1e('0x2d')](_0x3a000a);}return null;};}function patchUpdates(_0x18f19a){return function(_0x21bda9){try{jsonpatch[_0xac1e('0x33')](_0x21bda9,_0x18f19a,!![]);}catch(_0xa908ee){return BPromise['reject'](_0xa908ee);}return _0x21bda9[_0xac1e('0x34')]();};}function saveUpdates(_0x5104f0,_0x2a6475){return function(_0x414eb2){if(_0x414eb2){return _0x414eb2[_0xac1e('0x35')](_0x5104f0)['then'](function(_0x5b1a51){return _0x5b1a51;});}return null;};}function removeEntity(_0xb83a,_0x5bbc1a){return function(_0x227c95){if(_0x227c95){return _0x227c95[_0xac1e('0x36')]()['then'](function(){var _0x294abf=_0x227c95[_0xac1e('0x37')]({'plain':!![]});var _0x19e2c1=_0xac1e('0x38');return db[_0xac1e('0x39')][_0xac1e('0x36')]({'where':{'type':_0x19e2c1,'resourceId':_0x294abf['id']}})['then'](function(){return _0x227c95;});})[_0xac1e('0x21')](function(){_0xb83a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c3f11,_0x5ed849){return function(_0xe2add9){if(!_0xe2add9){_0x3c3f11[_0xac1e('0x3a')](0x194);}return _0xe2add9;};}function handleError(_0x1fd5a1,_0xe1e16b){_0xe1e16b=_0xe1e16b||0x1f4;return function(_0x1b689d){logger['error'](_0x1b689d[_0xac1e('0x3b')]);if(_0x1b689d[_0xac1e('0x3c')]){delete _0x1b689d[_0xac1e('0x3c')];}_0x1fd5a1[_0xac1e('0x2b')](_0xe1e16b)[_0xac1e('0x3d')](_0x1b689d);};}exports[_0xac1e('0x3e')]=function(_0x43473a,_0x1c3f3c){var _0x4737e1={'include':[{'model':db['Pause'],'as':_0xac1e('0x3f')}]},_0x5d2200={},_0x557e7e={'count':0x0,'rows':[]};var _0x10c3c6=_[_0xac1e('0x40')](db['WhatsappAccount'][_0xac1e('0x41')],function(_0x21a2b0){return{'name':_0x21a2b0[_0xac1e('0x42')],'type':_0x21a2b0[_0xac1e('0x43')][_0xac1e('0x44')]};});_0x5d2200[_0xac1e('0x45')]=_['map'](_0x10c3c6,'name');_0x5d2200['query']=_[_0xac1e('0x46')](_0x43473a['query']);_0x5d2200[_0xac1e('0x47')]=_[_0xac1e('0x48')](_0x5d2200[_0xac1e('0x45')],_0x5d2200['query']);_0x4737e1['attributes']=_['intersection'](_0x5d2200[_0xac1e('0x45')],qs[_0xac1e('0x49')](_0x43473a['query'][_0xac1e('0x49')]));_0x4737e1[_0xac1e('0x4a')]=_0x4737e1[_0xac1e('0x4a')][_0xac1e('0x4b')]?_0x4737e1[_0xac1e('0x4a')]:_0x5d2200['model'];if(!_0x43473a[_0xac1e('0x4c')][_0xac1e('0x4d')](_0xac1e('0x4e'))){_0x4737e1[_0xac1e('0x30')]=qs[_0xac1e('0x30')](_0x43473a['query'][_0xac1e('0x30')]);_0x4737e1[_0xac1e('0x2e')]=qs['offset'](_0x43473a[_0xac1e('0x4c')][_0xac1e('0x2e')]);}_0x4737e1['order']=qs[_0xac1e('0x4f')](_0x43473a['query'][_0xac1e('0x4f')]);_0x4737e1[_0xac1e('0x50')]=qs[_0xac1e('0x47')](_[_0xac1e('0x51')](_0x43473a[_0xac1e('0x4c')],_0x5d2200[_0xac1e('0x47')]),_0x10c3c6);if(_0x43473a[_0xac1e('0x4c')][_0xac1e('0x52')]){_0x4737e1[_0xac1e('0x50')]=_[_0xac1e('0x53')](_0x4737e1['where'],{'$or':_[_0xac1e('0x40')](_0x10c3c6,function(_0x2fde94){if(_0x2fde94['type']!==_0xac1e('0x54')){var _0x4f6e39={};_0x4f6e39[_0x2fde94[_0xac1e('0x3c')]]={'$like':'%'+_0x43473a[_0xac1e('0x4c')][_0xac1e('0x52')]+'%'};return _0x4f6e39;}})});}_0x4737e1=_['merge']({},_0x4737e1,_0x43473a[_0xac1e('0x55')]);var _0x40f1b1={'where':_0x4737e1[_0xac1e('0x50')]};return db['WhatsappAccount']['count'](_0x40f1b1)[_0xac1e('0x21')](function(_0x52406a){_0x557e7e[_0xac1e('0x31')]=_0x52406a;if(_0x43473a[_0xac1e('0x4c')][_0xac1e('0x56')]){_0x4737e1['include']=[{'all':!![]}];}return db[_0xac1e('0x57')][_0xac1e('0x58')](_0x4737e1);})[_0xac1e('0x21')](function(_0x29c73d){_0x557e7e[_0xac1e('0x59')]=_0x29c73d;return _0x557e7e;})['then'](respondWithFilteredResult(_0x1c3f3c,_0x4737e1))['catch'](handleError(_0x1c3f3c,null));};exports['show']=function(_0x58a316,_0x4b39ae){var _0x539b94={'raw':![],'where':{'id':_0x58a316[_0xac1e('0x5a')]['id']},'include':[{'model':db[_0xac1e('0x5b')],'as':_0xac1e('0x3f')}]},_0x46159b={};_0x46159b[_0xac1e('0x45')]=_[_0xac1e('0x46')](db[_0xac1e('0x57')][_0xac1e('0x41')]);_0x46159b[_0xac1e('0x4c')]=_['keys'](_0x58a316[_0xac1e('0x4c')]);_0x46159b['filters']=_['intersection'](_0x46159b[_0xac1e('0x45')],_0x46159b[_0xac1e('0x4c')]);_0x539b94[_0xac1e('0x4a')]=_['intersection'](_0x46159b['model'],qs['fields'](_0x58a316[_0xac1e('0x4c')][_0xac1e('0x49')]));_0x539b94[_0xac1e('0x4a')]=_0x539b94[_0xac1e('0x4a')]['length']?_0x539b94[_0xac1e('0x4a')]:_0x46159b[_0xac1e('0x45')];if(_0x58a316['query'][_0xac1e('0x56')]){_0x539b94[_0xac1e('0x5c')]=[{'all':!![]}];}_0x539b94=_[_0xac1e('0x53')]({},_0x539b94,_0x58a316['options']);return db['WhatsappAccount'][_0xac1e('0x5d')](_0x539b94)[_0xac1e('0x21')](handleEntityNotFound(_0x4b39ae,null))[_0xac1e('0x21')](respondWithResult(_0x4b39ae,null))['catch'](handleError(_0x4b39ae,null));};exports[_0xac1e('0x5e')]=function(_0x43ee4f,_0xb26b8d){return db[_0xac1e('0x57')]['create'](_0x43ee4f[_0xac1e('0x5f')],{})['then'](function(_0x4c5a30){var _0x38087c=_0x43ee4f[_0xac1e('0x60')][_0xac1e('0x37')]({'plain':!![]});if(!_0x38087c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38087c[_0xac1e('0x61')]===_0xac1e('0x60')){var _0x317ad9=_0x4c5a30['get']({'plain':!![]});var _0x33311a=_0xac1e('0x38');return db[_0xac1e('0x62')][_0xac1e('0x5d')]({'where':{'name':_0x33311a,'userProfileId':_0x38087c[_0xac1e('0x63')]},'raw':!![]})[_0xac1e('0x21')](function(_0xb12773){if(_0xb12773&&_0xb12773[_0xac1e('0x64')]===0x0){return db[_0xac1e('0x39')]['create']({'name':_0x317ad9[_0xac1e('0x3c')],'resourceId':_0x317ad9['id'],'type':_0xb12773[_0xac1e('0x3c')],'sectionId':_0xb12773['id']},{})[_0xac1e('0x21')](function(){return _0x4c5a30;});}else{return _0x4c5a30;}})[_0xac1e('0x65')](function(_0x4fa498){logger[_0xac1e('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fa498);throw _0x4fa498;});}return _0x4c5a30;})[_0xac1e('0x21')](respondWithResult(_0xb26b8d,0xc9))[_0xac1e('0x65')](handleError(_0xb26b8d,null));};exports[_0xac1e('0x35')]=function(_0x4f6cb4,_0x21a920){if(_0x4f6cb4[_0xac1e('0x5f')]['id']){delete _0x4f6cb4[_0xac1e('0x5f')]['id'];}return db[_0xac1e('0x57')][_0xac1e('0x5d')]({'where':{'id':_0x4f6cb4[_0xac1e('0x5a')]['id']},'include':[{'model':db[_0xac1e('0x5b')],'as':_0xac1e('0x3f')}]})[_0xac1e('0x21')](handleEntityNotFound(_0x21a920,null))[_0xac1e('0x21')](saveUpdates(_0x4f6cb4[_0xac1e('0x5f')],null))[_0xac1e('0x21')](respondWithResult(_0x21a920,null))[_0xac1e('0x65')](handleError(_0x21a920,null));};exports[_0xac1e('0x36')]=function(_0x52468f,_0x1476e9){return db[_0xac1e('0x57')][_0xac1e('0x5d')]({'where':{'id':_0x52468f['params']['id']}})[_0xac1e('0x21')](handleEntityNotFound(_0x1476e9,null))[_0xac1e('0x21')](removeEntity(_0x1476e9,null))[_0xac1e('0x65')](handleError(_0x1476e9,null));};exports[_0xac1e('0x66')]=function(_0x4f042f,_0xb8d325){return db[_0xac1e('0x57')][_0xac1e('0x66')]()[_0xac1e('0x21')](respondWithResult(_0xb8d325,null))[_0xac1e('0x65')](handleError(_0xb8d325,null));};exports['addDisposition']=function(_0x52bba8,_0x5e0a43,_0xaa2dd5){if(_0x52bba8[_0xac1e('0x5f')]['id']){delete _0x52bba8[_0xac1e('0x5f')]['id'];}return db['WhatsappAccount'][_0xac1e('0x5d')]({'where':{'id':_0x52bba8['params']['id']}})[_0xac1e('0x21')](handleEntityNotFound(_0x5e0a43,null))['then'](function(_0x55e9e6){if(_0x55e9e6){_0x52bba8['body'][_0xac1e('0x67')]=_0x55e9e6['id'];return db[_0xac1e('0x68')][_0xac1e('0x5e')](_0x52bba8['body']);}})[_0xac1e('0x21')](respondWithResult(_0x5e0a43,null))[_0xac1e('0x65')](handleError(_0x5e0a43,null));};exports['getDispositions']=function(_0x33012f,_0x46063a,_0x1c97ec){var _0x52f4cb={'raw':![],'where':{}};var _0x2a60e2={};var _0x5778e8={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xac1e('0x69')]({'where':{'id':_0x33012f[_0xac1e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x46063a,null))[_0xac1e('0x21')](function(_0x3dc353){if(_0x3dc353){_0x2a60e2[_0xac1e('0x45')]=_['keys'](db[_0xac1e('0x68')]['rawAttributes']);_0x2a60e2[_0xac1e('0x4c')]=_[_0xac1e('0x46')](_0x33012f['query']);_0x2a60e2[_0xac1e('0x47')]=_[_0xac1e('0x48')](_0x2a60e2['model'],_0x2a60e2['query']);_0x52f4cb[_0xac1e('0x4a')]=_[_0xac1e('0x48')](_0x2a60e2[_0xac1e('0x45')],qs[_0xac1e('0x49')](_0x33012f[_0xac1e('0x4c')][_0xac1e('0x49')]));_0x52f4cb[_0xac1e('0x4a')]=_0x52f4cb[_0xac1e('0x4a')][_0xac1e('0x4b')]?_0x52f4cb[_0xac1e('0x4a')]:_0x2a60e2['model'];if(!_0x33012f['query']['hasOwnProperty'](_0xac1e('0x4e'))){_0x52f4cb[_0xac1e('0x30')]=qs['limit'](_0x33012f[_0xac1e('0x4c')][_0xac1e('0x30')]);_0x52f4cb[_0xac1e('0x2e')]=qs[_0xac1e('0x2e')](_0x33012f[_0xac1e('0x4c')][_0xac1e('0x2e')]);}_0x52f4cb['order']=qs['sort'](_0x33012f['query'][_0xac1e('0x4f')]);_0x52f4cb[_0xac1e('0x50')]=qs[_0xac1e('0x47')](_[_0xac1e('0x51')](_0x33012f['query'],_0x2a60e2[_0xac1e('0x47')]));_0x52f4cb[_0xac1e('0x50')][_0xac1e('0x67')]=_0x3dc353['id'];if(_0x33012f[_0xac1e('0x4c')][_0xac1e('0x52')]){_0x52f4cb['where']=_[_0xac1e('0x53')](_0x52f4cb[_0xac1e('0x50')],{'$or':_[_0xac1e('0x40')](_0x52f4cb[_0xac1e('0x4a')],function(_0x3b94f4){var _0x21cd2d={};_0x21cd2d[_0x3b94f4]={'$like':'%'+_0x33012f[_0xac1e('0x4c')][_0xac1e('0x52')]+'%'};return _0x21cd2d;})});}_0x52f4cb=_[_0xac1e('0x53')]({},_0x52f4cb,_0x33012f[_0xac1e('0x55')]);return db['Disposition'][_0xac1e('0x31')]({'where':_0x52f4cb[_0xac1e('0x50')]})['then'](function(_0x3f5e31){_0x5778e8['count']=_0x3f5e31;if(_0x33012f[_0xac1e('0x4c')]['includeAll']){_0x52f4cb[_0xac1e('0x5c')]=[{'all':!![]}];}return db[_0xac1e('0x68')][_0xac1e('0x58')](_0x52f4cb);})[_0xac1e('0x21')](function(_0x4130c7){_0x5778e8[_0xac1e('0x59')]=_0x4130c7;return _0x5778e8;});}})['then'](respondWithFilteredResult(_0x46063a,_0x52f4cb))['catch'](handleError(_0x46063a,null));};exports[_0xac1e('0x6a')]=function(_0x742078,_0x1a2f81,_0x4d65c6){return db[_0xac1e('0x57')][_0xac1e('0x5d')]({'where':{'id':_0x742078['params']['id']}})['then'](handleEntityNotFound(_0x1a2f81,null))[_0xac1e('0x21')](function(_0x3b697a){if(_0x3b697a){return _0x3b697a['removeDispositions'](_0x742078['query'][_0xac1e('0x6b')]);}})['then'](respondWithStatusCode(_0x1a2f81,null))[_0xac1e('0x65')](handleError(_0x1a2f81,null));};exports[_0xac1e('0x6c')]=function(_0x59027d,_0x2517b9,_0x12f56c){if(_0x59027d[_0xac1e('0x5f')]['id']){delete _0x59027d[_0xac1e('0x5f')]['id'];}return db[_0xac1e('0x57')]['find']({'where':{'id':_0x59027d['params']['id']}})[_0xac1e('0x21')](handleEntityNotFound(_0x2517b9,null))[_0xac1e('0x21')](function(_0x25da81){if(_0x25da81){_0x59027d[_0xac1e('0x5f')]['WhatsappAccountId']=_0x25da81['id'];return db[_0xac1e('0x6d')][_0xac1e('0x5e')](_0x59027d[_0xac1e('0x5f')]);}})[_0xac1e('0x21')](respondWithResult(_0x2517b9,null))[_0xac1e('0x65')](handleError(_0x2517b9,null));};exports[_0xac1e('0x6e')]=function(_0x45dcf0,_0x52164d,_0x53e503){var _0x48b787={'raw':![],'where':{}};var _0x3cac69={};var _0x4943e9={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xac1e('0x69')]({'where':{'id':_0x45dcf0[_0xac1e('0x5a')]['id']}})[_0xac1e('0x21')](handleEntityNotFound(_0x52164d,null))[_0xac1e('0x21')](function(_0x3492e1){if(_0x3492e1){_0x3cac69['model']=_['keys'](db[_0xac1e('0x6d')]['rawAttributes']);_0x3cac69['query']=_[_0xac1e('0x46')](_0x45dcf0['query']);_0x3cac69['filters']=_[_0xac1e('0x48')](_0x3cac69[_0xac1e('0x45')],_0x3cac69['query']);_0x48b787[_0xac1e('0x4a')]=_[_0xac1e('0x48')](_0x3cac69[_0xac1e('0x45')],qs[_0xac1e('0x49')](_0x45dcf0[_0xac1e('0x4c')][_0xac1e('0x49')]));_0x48b787[_0xac1e('0x4a')]=_0x48b787[_0xac1e('0x4a')][_0xac1e('0x4b')]?_0x48b787[_0xac1e('0x4a')]:_0x3cac69['model'];if(!_0x45dcf0['query']['hasOwnProperty'](_0xac1e('0x4e'))){_0x48b787[_0xac1e('0x30')]=qs[_0xac1e('0x30')](_0x45dcf0[_0xac1e('0x4c')][_0xac1e('0x30')]);_0x48b787[_0xac1e('0x2e')]=qs[_0xac1e('0x2e')](_0x45dcf0[_0xac1e('0x4c')][_0xac1e('0x2e')]);}_0x48b787[_0xac1e('0x6f')]=qs['sort'](_0x45dcf0[_0xac1e('0x4c')][_0xac1e('0x4f')]);_0x48b787[_0xac1e('0x50')]=qs['filters'](_[_0xac1e('0x51')](_0x45dcf0[_0xac1e('0x4c')],_0x3cac69[_0xac1e('0x47')]));_0x48b787[_0xac1e('0x50')][_0xac1e('0x67')]=_0x3492e1['id'];if(_0x45dcf0['query'][_0xac1e('0x52')]){_0x48b787[_0xac1e('0x50')]=_[_0xac1e('0x53')](_0x48b787['where'],{'$or':_[_0xac1e('0x40')](_0x48b787[_0xac1e('0x4a')],function(_0x482643){var _0x336229={};_0x336229[_0x482643]={'$like':'%'+_0x45dcf0[_0xac1e('0x4c')]['filter']+'%'};return _0x336229;})});}_0x48b787=_[_0xac1e('0x53')]({},_0x48b787,_0x45dcf0[_0xac1e('0x55')]);return db[_0xac1e('0x6d')][_0xac1e('0x31')]({'where':_0x48b787['where']})[_0xac1e('0x21')](function(_0x1d689f){_0x4943e9['count']=_0x1d689f;if(_0x45dcf0[_0xac1e('0x4c')][_0xac1e('0x56')]){_0x48b787[_0xac1e('0x5c')]=[{'all':!![]}];}return db['CannedAnswer'][_0xac1e('0x58')](_0x48b787);})['then'](function(_0x43165b){_0x4943e9[_0xac1e('0x59')]=_0x43165b;return _0x4943e9;});}})[_0xac1e('0x21')](respondWithFilteredResult(_0x52164d,_0x48b787))[_0xac1e('0x65')](handleError(_0x52164d,null));};exports['removeAnswers']=function(_0x31e82f,_0xecf46e,_0x12a656){return db['WhatsappAccount'][_0xac1e('0x5d')]({'where':{'id':_0x31e82f[_0xac1e('0x5a')]['id']}})[_0xac1e('0x21')](handleEntityNotFound(_0xecf46e,null))[_0xac1e('0x21')](function(_0x3a35d6){if(_0x3a35d6){return _0x3a35d6[_0xac1e('0x70')](_0x31e82f['query'][_0xac1e('0x6b')]);}})[_0xac1e('0x21')](respondWithStatusCode(_0xecf46e,null))['catch'](handleError(_0xecf46e,null));};exports[_0xac1e('0x71')]=function(_0x32f273,_0x5d1601,_0x1561a0){return db[_0xac1e('0x57')][_0xac1e('0x5d')]({'where':{'id':_0x32f273[_0xac1e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5d1601,null))[_0xac1e('0x21')](function(_0x113771){if(_0x113771){return _0x113771[_0xac1e('0x71')](_0x32f273['body'][_0xac1e('0x6b')],_[_0xac1e('0x72')](_0x32f273['body'],[_0xac1e('0x6b'),'id'])||{})[_0xac1e('0x73')](function(_0x5e647a){for(var _0x258f63=0x0;_0x258f63<_0x32f273[_0xac1e('0x5f')][_0xac1e('0x6b')][_0xac1e('0x4b')];_0x258f63+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':_0x32f273[_0xac1e('0x5f')][_0xac1e('0x6b')][_0x258f63],'WhatsappAccountId':_0x32f273[_0xac1e('0x5a')]['id']});}return _0x5e647a;});}})[_0xac1e('0x21')](respondWithResult(_0x5d1601,null))[_0xac1e('0x65')](handleError(_0x5d1601,null));};exports[_0xac1e('0x74')]=function(_0x405a8,_0x3ea6ba,_0x252bbe){return db['WhatsappAccount'][_0xac1e('0x5d')]({'where':{'id':_0x405a8[_0xac1e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3ea6ba,null))[_0xac1e('0x21')](function(_0x561fb1){if(_0x561fb1){return _0x561fb1[_0xac1e('0x74')](_0x405a8[_0xac1e('0x4c')]['ids'])[_0xac1e('0x21')](function(){if(_[_0xac1e('0x75')](_0x405a8[_0xac1e('0x4c')][_0xac1e('0x6b')])){for(var _0x4f4a84=0x0;_0x4f4a84<_0x405a8['query']['ids'][_0xac1e('0x4b')];_0x4f4a84+=0x1){socket[_0xac1e('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x405a8[_0xac1e('0x4c')]['ids'][_0x4f4a84]),'WhatsappAccountId':Number(_0x405a8[_0xac1e('0x5a')]['id'])});}}else{socket[_0xac1e('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x405a8[_0xac1e('0x4c')][_0xac1e('0x6b')]),'WhatsappAccountId':Number(_0x405a8[_0xac1e('0x5a')]['id'])});}});}})[_0xac1e('0x21')](respondWithStatusCode(_0x3ea6ba,null))[_0xac1e('0x65')](handleError(_0x3ea6ba,null));};exports[_0xac1e('0x77')]=function(_0x2bdac3,_0x3715bc,_0x36912f){var _0x41a23b={};var _0x17697d={};var _0x3703d3;var _0x1c4def;return db[_0xac1e('0x57')][_0xac1e('0x69')]({'where':{'id':_0x2bdac3[_0xac1e('0x5a')]['id']}})[_0xac1e('0x21')](handleEntityNotFound(_0x3715bc,null))[_0xac1e('0x21')](function(_0x9369fb){if(_0x9369fb){_0x3703d3=_0x9369fb;_0x17697d[_0xac1e('0x45')]=_[_0xac1e('0x46')](db['User'][_0xac1e('0x41')]);_0x17697d[_0xac1e('0x4c')]=_['keys'](_0x2bdac3[_0xac1e('0x4c')]);_0x17697d['filters']=_[_0xac1e('0x48')](_0x17697d['model'],_0x17697d['query']);_0x41a23b[_0xac1e('0x4a')]=_[_0xac1e('0x48')](_0x17697d[_0xac1e('0x45')],qs[_0xac1e('0x49')](_0x2bdac3[_0xac1e('0x4c')][_0xac1e('0x49')]));_0x41a23b[_0xac1e('0x4a')]=_0x41a23b[_0xac1e('0x4a')][_0xac1e('0x4b')]?_0x41a23b[_0xac1e('0x4a')]:_0x17697d[_0xac1e('0x45')];_0x41a23b[_0xac1e('0x6f')]=qs['sort'](_0x2bdac3[_0xac1e('0x4c')][_0xac1e('0x4f')]);_0x41a23b[_0xac1e('0x50')]=qs[_0xac1e('0x47')](_[_0xac1e('0x51')](_0x2bdac3['query'],_0x17697d[_0xac1e('0x47')]));if(_0x2bdac3['query']['filter']){_0x41a23b[_0xac1e('0x50')]=_['merge'](_0x41a23b['where'],{'$or':_[_0xac1e('0x40')](_0x41a23b[_0xac1e('0x4a')],function(_0x12b52e){var _0x13e448={};_0x13e448[_0x12b52e]={'$like':'%'+_0x2bdac3['query']['filter']+'%'};return _0x13e448;})});}_0x41a23b=_[_0xac1e('0x53')]({},_0x41a23b,_0x2bdac3['options']);return _0x3703d3[_0xac1e('0x77')](_0x41a23b);}})[_0xac1e('0x21')](function(_0x10f7c7){if(_0x10f7c7){_0x1c4def=_0x10f7c7['length'];if(!_0x2bdac3[_0xac1e('0x4c')]['hasOwnProperty'](_0xac1e('0x4e'))){_0x41a23b[_0xac1e('0x30')]=qs[_0xac1e('0x30')](_0x2bdac3[_0xac1e('0x4c')][_0xac1e('0x30')]);_0x41a23b[_0xac1e('0x2e')]=qs[_0xac1e('0x2e')](_0x2bdac3[_0xac1e('0x4c')][_0xac1e('0x2e')]);}return _0x3703d3[_0xac1e('0x77')](_0x41a23b);}})[_0xac1e('0x21')](function(_0x45f696){if(_0x45f696){return _0x45f696?{'count':_0x1c4def,'rows':_0x45f696}:null;}})[_0xac1e('0x21')](respondWithResult(_0x3715bc,null))[_0xac1e('0x65')](handleError(_0x3715bc,null));};exports[_0xac1e('0x78')]=function(_0x139e3b,_0x3562af,_0x555b17){return db[_0xac1e('0x57')][_0xac1e('0x69')]({'where':{'id':_0x139e3b[_0xac1e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3562af,null))[_0xac1e('0x21')](function(_0x5736d8){if(_0x5736d8){return db[_0xac1e('0x79')][_0xac1e('0x7a')](function(_0x10cefa){return db[_0xac1e('0x7b')][_0xac1e('0x36')]({'where':{'WhatsappAccountId':_0x139e3b['params']['id']},'transaction':_0x10cefa})[_0xac1e('0x21')](function(_0x3ff6b1){var _0x2eb369=_['map'](_0x139e3b[_0xac1e('0x5f')],function(_0x14adde){_0x14adde['WhatsappAccountId']=_0x139e3b[_0xac1e('0x5a')]['id'];return _0x14adde;});return db[_0xac1e('0x7b')][_0xac1e('0x7c')](_0x2eb369,{'transaction':_0x10cefa});});})['then'](function(){return db['WhatsappApplication'][_0xac1e('0x7d')]({'where':{'WhatsappAccountId':_0x139e3b[_0xac1e('0x5a')]['id']},'order':_0xac1e('0x7e')});});}})[_0xac1e('0x21')](respondWithResult(_0x3562af,null))[_0xac1e('0x65')](handleError(_0x3562af,null));};exports['getApplications']=function(_0x258dd7,_0x1afef3,_0x300dd7){var _0x359f2b={};var _0x3fc511={};var _0x5d725b;var _0x5868cb;return db[_0xac1e('0x57')][_0xac1e('0x69')]({'where':{'id':_0x258dd7[_0xac1e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1afef3,null))['then'](function(_0x3d2b90){if(_0x3d2b90){_0x5d725b=_0x3d2b90;_0x3fc511[_0xac1e('0x45')]=_[_0xac1e('0x46')](db[_0xac1e('0x7b')][_0xac1e('0x41')]);_0x3fc511['query']=_[_0xac1e('0x46')](_0x258dd7[_0xac1e('0x4c')]);_0x3fc511['filters']=_['intersection'](_0x3fc511[_0xac1e('0x45')],_0x3fc511[_0xac1e('0x4c')]);_0x359f2b[_0xac1e('0x4a')]=_[_0xac1e('0x48')](_0x3fc511[_0xac1e('0x45')],qs[_0xac1e('0x49')](_0x258dd7[_0xac1e('0x4c')][_0xac1e('0x49')]));_0x359f2b['attributes']=_0x359f2b[_0xac1e('0x4a')][_0xac1e('0x4b')]?_0x359f2b[_0xac1e('0x4a')]:_0x3fc511[_0xac1e('0x45')];_0x359f2b[_0xac1e('0x6f')]=qs[_0xac1e('0x4f')](_0x258dd7[_0xac1e('0x4c')][_0xac1e('0x4f')]);_0x359f2b[_0xac1e('0x50')]=qs[_0xac1e('0x47')](_['pick'](_0x258dd7[_0xac1e('0x4c')],_0x3fc511['filters']));if(_0x258dd7['query'][_0xac1e('0x52')]){_0x359f2b[_0xac1e('0x50')]=_['merge'](_0x359f2b[_0xac1e('0x50')],{'$or':_[_0xac1e('0x40')](_0x359f2b['attributes'],function(_0x22b21c){var _0x2be3cf={};_0x2be3cf[_0x22b21c]={'$like':'%'+_0x258dd7[_0xac1e('0x4c')]['filter']+'%'};return _0x2be3cf;})});}_0x359f2b=_[_0xac1e('0x53')]({},_0x359f2b,_0x258dd7[_0xac1e('0x55')]);return _0x5d725b[_0xac1e('0x7f')](_0x359f2b);}})['then'](function(_0x1e5837){if(_0x1e5837){_0x5868cb=_0x1e5837[_0xac1e('0x4b')];if(!_0x258dd7[_0xac1e('0x4c')][_0xac1e('0x4d')](_0xac1e('0x4e'))){_0x359f2b[_0xac1e('0x30')]=qs[_0xac1e('0x30')](_0x258dd7[_0xac1e('0x4c')][_0xac1e('0x30')]);_0x359f2b[_0xac1e('0x2e')]=qs[_0xac1e('0x2e')](_0x258dd7[_0xac1e('0x4c')][_0xac1e('0x2e')]);}return _0x5d725b[_0xac1e('0x7f')](_0x359f2b);}})[_0xac1e('0x21')](function(_0x2a8978){if(_0x2a8978){return _0x2a8978?{'count':_0x5868cb,'rows':_0x2a8978}:null;}})['then'](respondWithResult(_0x1afef3,null))[_0xac1e('0x65')](handleError(_0x1afef3,null));};exports[_0xac1e('0x80')]=function(_0x33236d,_0x3a4198,_0x198c50){var _0x487cae={'channel':_0xac1e('0x81')};var _0x4a1204=[];var _0x4ce4e6=[];var _0x42acd5={};return db[_0xac1e('0x57')]['find']({'where':{'id':_0x33236d[_0xac1e('0x5a')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xac1e('0x82')}]})[_0xac1e('0x21')](handleEntityNotFound(_0x3a4198,null))[_0xac1e('0x21')](function(_0x28f3dc){_0x487cae[_0xac1e('0x83')]=_0x28f3dc;_0x487cae[_0xac1e('0x84')]=_[_0xac1e('0x85')](_0x28f3dc[_0xac1e('0x82')],[_0xac1e('0x7e')],[_0xac1e('0x86')]);if(_0x487cae[_0xac1e('0x83')]['Applications']){delete _0x487cae[_0xac1e('0x83')][_0xac1e('0x82')];}return db[_0xac1e('0x87')][_0xac1e('0x66')]();})[_0xac1e('0x21')](function(_0x101a08){if(!_0x101a08){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x4a1204=_['difference'](_['keys'](_0x101a08),[_0xac1e('0x88'),_0xac1e('0x89')]);_0x4ce4e6=_[_0xac1e('0x8a')](_[_0xac1e('0x46')](_0x101a08),[_0xac1e('0x88'),_0xac1e('0x89'),'CompanyId',_0xac1e('0x8b')]);_0x487cae[_0xac1e('0x5f')]={'mapKey':_0xac1e('0x8c')};if(_0x487cae[_0xac1e('0x83')][_0xac1e('0x43')]&&_0x487cae['account'][_0xac1e('0x43')]===_0xac1e('0x8d')){_0x487cae[_0xac1e('0x5f')][_0xac1e('0x8e')]=_0x33236d['body'][_0xac1e('0x8f')][_0xac1e('0x90')](_0xac1e('0x91'),'');_0x487cae[_0xac1e('0x5f')][_0xac1e('0x5f')]=_0x33236d[_0xac1e('0x5f')][_0xac1e('0x92')];_0x487cae[_0xac1e('0x5f')][_0xac1e('0x93')]=_0x33236d[_0xac1e('0x5f')][_0xac1e('0x94')];}if(_0x487cae[_0xac1e('0x5f')]['id']){delete _0x487cae[_0xac1e('0x5f')]['id'];}if(_[_0xac1e('0x95')](_0x487cae[_0xac1e('0x5f')]['from'])){throw new db[(_0xac1e('0x96'))][(_0xac1e('0x97'))](_0xac1e('0x98'));}if(_[_0xac1e('0x95')](_0x487cae['body']['body'])||_0x487cae['body'][_0xac1e('0x5f')]===''){throw new db[(_0xac1e('0x96'))][(_0xac1e('0x97'))](_0xac1e('0x99'));}if(_['isNil'](_0x487cae[_0xac1e('0x5f')][_0xac1e('0x9a')])){throw new db[(_0xac1e('0x96'))][(_0xac1e('0x97'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4ce4e6);}if(!_[_0xac1e('0x9b')](_0x4ce4e6,_0x487cae[_0xac1e('0x5f')][_0xac1e('0x9a')])){throw new db[(_0xac1e('0x96'))][(_0xac1e('0x97'))](_0xac1e('0x9c')+_0x4ce4e6);}_0x42acd5[_0x487cae[_0xac1e('0x5f')][_0xac1e('0x9a')]]=_0x487cae[_0xac1e('0x5f')][_0xac1e('0x8e')];return db[_0xac1e('0x9d')][_0xac1e('0x5d')]({'where':{'id':_0x487cae[_0xac1e('0x83')][_0xac1e('0x8b')]},'include':[{'model':db['CmContact'],'as':_0xac1e('0x9e'),'where':_0x42acd5,'limit':0x1,'order':[[_0xac1e('0x89'),_0xac1e('0x9f')]]}]});})[_0xac1e('0x21')](handleEntityNotFound(_0x3a4198,null))[_0xac1e('0x21')](function(_0x37e554){if(_0x37e554){_0x487cae[_0xac1e('0xa0')]=_[_0xac1e('0x72')](_0x37e554,['Contacts']);if(_0x37e554[_0xac1e('0x9e')][_0xac1e('0x4b')]){return _0x37e554[_0xac1e('0x9e')][0x0];}var _0x53a7f6=_[_0xac1e('0x1b')](_0x487cae[_0xac1e('0x5f')],{'firstName':_0x487cae[_0xac1e('0x5f')]['from'],'ListId':_0x37e554['id']});_0x53a7f6[_0x487cae[_0xac1e('0x5f')][_0xac1e('0x9a')]]=_0x487cae[_0xac1e('0x5f')][_0xac1e('0x8e')];return db[_0xac1e('0x87')][_0xac1e('0x5e')](_0x53a7f6,{'fields':_0x4a1204,'raw':!![]});}})[_0xac1e('0x21')](handleEntityNotFound(_0x3a4198,null))[_0xac1e('0x21')](function(_0x4fef14){if(_0x4fef14){_0x487cae[_0xac1e('0xa1')]=_0x4fef14;var _0x36ee6e={'ContactId':_0x4fef14['id'],'phone':_0x487cae[_0xac1e('0x5f')][_0xac1e('0x8e')],'WhatsappAccountId':_0x33236d['params']['id']};var _0x2e58ce={'ContactId':_0x4fef14['id'],'WhatsappAccountId':_0x33236d[_0xac1e('0x5a')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xac1e('0x5d')]({'where':_0x2e58ce})[_0xac1e('0x21')](function(_0x74e9fc){if(_0x74e9fc){return[_0x74e9fc,![]];}return db[_0xac1e('0xa2')]['create'](_0x36ee6e)[_0xac1e('0x21')](function(_0x40433b){return[_0x40433b,!![]];});});}})['spread'](function(_0x38a946,_0x313fdf){_0x487cae[_0xac1e('0xa3')]=_0x38a946[_0xac1e('0x37')]({'plain':!![]});_0x487cae[_0xac1e('0xa3')][_0xac1e('0xa4')]=![];if(_0x313fdf){if(_0x487cae[_0xac1e('0x83')]['autoclose']){_0x487cae[_0xac1e('0x84')][_0xac1e('0xa5')]({'id':0x0,'priority':_0x487cae[_0xac1e('0x84')][_0xac1e('0x4b')]+0x1,'app':'close','appdata':_0xac1e('0xa6'),'interval':_0xac1e('0xa7')});}_0x487cae[_0xac1e('0xa3')]['created']=!![];}return db[_0xac1e('0xa8')][_0xac1e('0x5e')]({'phone':_0x487cae[_0xac1e('0x5f')][_0xac1e('0x8e')],'messageId':_0x487cae[_0xac1e('0x5f')]['messageId'],'body':_0x487cae[_0xac1e('0x5f')][_0xac1e('0x5f')],'WhatsappAccountId':_0x33236d[_0xac1e('0x5a')]['id'],'WhatsappInteractionId':_0x38a946['id'],'direction':'in','ContactId':_0x38a946['ContactId'],'AttachmentId':_0x487cae[_0xac1e('0x5f')]['AttachmentId']});})[_0xac1e('0x21')](function(_0xdda483){_0x487cae[_0xac1e('0x29')]=_0xdda483;if(_0x487cae['interaction'][_0xac1e('0xa9')]){return db[_0xac1e('0xaa')][_0xac1e('0x5d')]({'attributes':['id',_0xac1e('0x3c')],'where':{'id':_0x487cae[_0xac1e('0xa3')][_0xac1e('0xa9')]}})[_0xac1e('0x21')](function(_0x4e2de2){if(_0x4e2de2){_0x487cae[_0xac1e('0x84')][_0xac1e('0xab')]({'id':0x0,'priority':0x0,'app':_0xac1e('0xac'),'appdata':_0x4e2de2['name']+','+(_0x487cae['account']['waitForTheAssignedAgent']||0xa),'interval':_0xac1e('0xa7')});}return respondWithRpcPromise(_0xac1e('0xad'),_0xac1e('0xae'),_0x487cae);});}return respondWithRpcPromise(_0xac1e('0xad'),'startRouting',_0x487cae);})[_0xac1e('0x21')](function(_0x349ec2){if(_0x349ec2){var _0x3da383=0xc8;var _0x5715f0=_0xac1e('0xaf');logger[_0xac1e('0x22')](_0xac1e('0xb0'),_0x5715f0,_0x3da383,_0xac1e('0xb1'));logger['debug'](_0xac1e('0xb2'),_0x5715f0,_0x3da383,_0xac1e('0xb1'),JSON[_0xac1e('0x26')](_0x349ec2));if(_0x487cae['account'][_0xac1e('0x43')]==='twilio'){return _0x3a4198[_0xac1e('0x2b')](_0x3da383)[_0xac1e('0x32')](_0xac1e('0xb3'),_0xac1e('0xb4'))['send']('\x0a');}else{return _0x3a4198[_0xac1e('0x2b')](_0x3da383)[_0xac1e('0x2d')](_0x349ec2);}}})['catch'](handleError(_0x3a4198,null));};exports[_0xac1e('0x3d')]=function(_0x179ba4,_0xa70886,_0x6eddb7){var _0x4073c2,_0x3f71c8,_0x156be4;if(_[_0xac1e('0x95')](_0x179ba4[_0xac1e('0x5f')][_0xac1e('0x5f')])||_0x179ba4[_0xac1e('0x5f')]['body']===''){throw new db['Sequelize']['ValidationError'](_0xac1e('0x99'));}if(_[_0xac1e('0x95')](_0x179ba4[_0xac1e('0x5f')]['to'])){throw new db[(_0xac1e('0x96'))]['ValidationError'](_0xac1e('0xb5'));}_0x4073c2=_0x179ba4[_0xac1e('0x5f')]['to'];return db[_0xac1e('0x57')][_0xac1e('0x5d')]({'where':{'id':_0x179ba4[_0xac1e('0x5a')]['id']},'include':[{'model':db[_0xac1e('0x9d')],'as':'List','include':[{'model':db[_0xac1e('0x87')],'as':'Contacts','where':{'mobile':_0x4073c2},'limit':0x1,'order':[['updatedAt',_0xac1e('0x9f')]]}]}]})[_0xac1e('0x21')](handleEntityNotFound(_0xa70886,null))[_0xac1e('0x21')](function(_0x5d7dc8){if(_0x5d7dc8&&_0x5d7dc8['List']){_0x3f71c8=_0x5d7dc8[_0xac1e('0x37')]({'plain':!![]});if(_0x3f71c8['List']&&_0x3f71c8[_0xac1e('0xb6')][_0xac1e('0x9e')]['length']){return _0x3f71c8['List'][_0xac1e('0x9e')][0x0];}return db[_0xac1e('0x87')]['create'](_['defaults'](_0x179ba4[_0xac1e('0x5f')],{'firstName':_0x4073c2,'mobile':_0x4073c2,'phone':_0x4073c2,'ListId':_0x3f71c8['ListId']}));}})[_0xac1e('0x21')](handleEntityNotFound(_0xa70886,null))['then'](function(_0x10e64f){if(_0x10e64f){_0x156be4=_0x10e64f;return db['WhatsappInteraction'][_0xac1e('0x5d')]({'where':{'ContactId':_0x156be4['id'],'closed':![],'WhatsappAccountId':_0x3f71c8['id']}})['then'](function(_0x57605c){if(_0x57605c){return[_0x57605c,![]];}return db[_0xac1e('0xa2')]['create']({'UserId':_0x179ba4[_0xac1e('0x60')]['id'],'ContactId':_0x156be4['id'],'WhatsappAccountId':_0x3f71c8['id'],'phone':_0x4073c2,'firstMsgDirection':'out','Messages':[_['merge'](_0x179ba4['body'],{'read':![],'body':_0x179ba4[_0xac1e('0x5f')][_0xac1e('0x5f')],'phone':_0x4073c2,'WhatsappAccountId':_0x3f71c8['id'],'UserId':_0x179ba4[_0xac1e('0x60')]['id'],'ContactId':_0x156be4['id']})]},{'include':[{'model':db[_0xac1e('0xa8')],'as':'Messages'}]})[_0xac1e('0x21')](function(_0x47208e){return[_0x47208e,!![]];});});}})[_0xac1e('0x73')](function(_0xc9817b,_0x1ad1ac){if(_0x1ad1ac){return _0xc9817b;}return db[_0xac1e('0xa8')][_0xac1e('0x5e')](_[_0xac1e('0x53')](_0x179ba4[_0xac1e('0x5f')],{'read':![],'body':_0x179ba4[_0xac1e('0x5f')]['body'],'phone':_0x4073c2,'WhatsappAccountId':_0x3f71c8['id'],'WhatsappInteractionId':_0xc9817b['id'],'UserId':_0x179ba4[_0xac1e('0x60')]['id'],'ContactId':_0x156be4['id']}))['then'](function(_0x30bc23){_0xc9817b[_0xac1e('0xb7')][_0xac1e('0xb8')]=[];_0xc9817b[_0xac1e('0xb7')]['Messages']['push'](_0x30bc23['dataValues']);return _0xc9817b;});})[_0xac1e('0x21')](respondWithResult(_0xa70886,null))['catch'](handleError(_0xa70886,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 90aff28..5dde0bd 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x964b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x16662e,_0x1d622f){var _0x2bca33=function(_0x11627d){while(--_0x11627d){_0x16662e['push'](_0x16662e['shift']());}};_0x2bca33(++_0x1d622f);}(_0x964b,0x112));var _0xb964=function(_0x49decb,_0x1b04ff){_0x49decb=_0x49decb-0x0;var _0x106ada=_0x964b[_0x49decb];return _0x106ada;};'use strict';var EventEmitter=require(_0xb964('0x0'));var WhatsappAccount=require(_0xb964('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xb964('0x2')](0x0);var events={'afterCreate':_0xb964('0x3'),'afterUpdate':_0xb964('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c4f01){return function(_0x2c4686,_0x48b771,_0x4760b2){WhatsappAccountEvents[_0xb964('0x5')](_0x5c4f01+':'+_0x2c4686['id'],_0x2c4686);WhatsappAccountEvents[_0xb964('0x5')](_0x5c4f01,_0x2c4686);_0x4760b2(null);};}for(var e in events){if(events[_0xb964('0x6')](e)){var event=events[e];WhatsappAccount[_0xb964('0x7')](e,emitEvent(event));}}module[_0xb964('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x01d9=['WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x901d('0x0'));var WhatsappAccount=require(_0x901d('0x1'))['db'][_0x901d('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x901d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x901d('0x4'),'afterDestroy':_0x901d('0x5')};function emitEvent(_0x247cfc){return function(_0x8f7b4,_0x214f38,_0x456f31){WhatsappAccountEvents[_0x901d('0x6')](_0x247cfc+':'+_0x8f7b4['id'],_0x8f7b4);WhatsappAccountEvents['emit'](_0x247cfc,_0x8f7b4);_0x456f31(null);};}for(var e in events){if(events[_0x901d('0x7')](e)){var event=events[e];WhatsappAccount[_0x901d('0x8')](e,emitEvent(event));}}module[_0x901d('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index d4777c2..b003a6d 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d8f=['define','whatsapp_accounts','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes'];(function(_0x594c6d,_0x4d984f){var _0x522757=function(_0x4ec408){while(--_0x4ec408){_0x594c6d['push'](_0x594c6d['shift']());}};_0x522757(++_0x4d984f);}(_0x4d8f,0xd3));var _0xf4d8=function(_0x29a606,_0xbff75b){_0x29a606=_0x29a606-0x0;var _0xbb4c22=_0x4d8f[_0x29a606];return _0xbb4c22;};'use strict';var _=require(_0xf4d8('0x0'));var util=require(_0xf4d8('0x1'));var logger=require(_0xf4d8('0x2'))('api');var moment=require(_0xf4d8('0x3'));var BPromise=require('bluebird');var rp=require(_0xf4d8('0x4'));var fs=require('fs');var path=require(_0xf4d8('0x5'));var rimraf=require(_0xf4d8('0x6'));var config=require(_0xf4d8('0x7'));var attributes=require(_0xf4d8('0x8'));module['exports']=function(_0x4311e2,_0x2af756){return _0x4311e2[_0xf4d8('0x9')]('WhatsappAccount',attributes,{'tableName':_0xf4d8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab5a=['exports','whatsapp_accounts','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x5680b4,_0x21ae4e){var _0x43dd45=function(_0x13f956){while(--_0x13f956){_0x5680b4['push'](_0x5680b4['shift']());}};_0x43dd45(++_0x21ae4e);}(_0xab5a,0x122));var _0xaab5=function(_0x54169a,_0x1ea0d1){_0x54169a=_0x54169a-0x0;var _0x14e2fc=_0xab5a[_0x54169a];return _0x14e2fc;};'use strict';var _=require(_0xaab5('0x0'));var util=require('util');var logger=require(_0xaab5('0x1'))(_0xaab5('0x2'));var moment=require(_0xaab5('0x3'));var BPromise=require(_0xaab5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaab5('0x5'));var rimraf=require('rimraf');var config=require(_0xaab5('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0xaab5('0x7')]=function(_0x516b75,_0x549d2b){return _0x516b75['define']('WhatsappAccount',attributes,{'tableName':_0xaab5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index fc2c452..a864abb 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0c7=['result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','include','map','model','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message'];(function(_0x27dfae,_0x50c65a){var _0x57992f=function(_0x3ab74a){while(--_0x3ab74a){_0x27dfae['push'](_0x27dfae['shift']());}};_0x57992f(++_0x50c65a);}(_0xc0c7,0x115));var _0x7c0c=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xc0c7[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x7c0c('0x0'));var util=require(_0x7c0c('0x1'));var moment=require(_0x7c0c('0x2'));var BPromise=require('bluebird');var rs=require(_0x7c0c('0x3'));var fs=require('fs');var Redis=require(_0x7c0c('0x4'));var db=require(_0x7c0c('0x5'))['db'];var utils=require(_0x7c0c('0x6'));var logger=require('../../config/logger')(_0x7c0c('0x7'));var config=require(_0x7c0c('0x8'));var jayson=require(_0x7c0c('0x9'));var client=jayson[_0x7c0c('0xa')][_0x7c0c('0xb')]({'port':0x232a});config['redis']=_[_0x7c0c('0xc')](config[_0x7c0c('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x7c0c('0xe'))(new Redis(config[_0x7c0c('0xd')]));require('./whatsappAccount.socket')[_0x7c0c('0xf')](socket);function respondWithRpcPromise(_0x22ec39,_0x3787eb,_0x49f355){return new BPromise(function(_0x413bcd,_0x4fa0ec){return client[_0x7c0c('0x10')](_0x22ec39,_0x49f355)[_0x7c0c('0x11')](function(_0x11c216){logger[_0x7c0c('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x3787eb,'request\x20sent');logger[_0x7c0c('0x13')](_0x7c0c('0x14'),_0x3787eb,_0x7c0c('0x15'),JSON[_0x7c0c('0x16')](_0x11c216));if(_0x11c216[_0x7c0c('0x17')]){if(_0x11c216[_0x7c0c('0x17')][_0x7c0c('0x18')]===0x1f4){logger[_0x7c0c('0x17')](_0x7c0c('0x19'),_0x3787eb,_0x11c216[_0x7c0c('0x17')]['message']);return _0x4fa0ec(_0x11c216[_0x7c0c('0x17')][_0x7c0c('0x1a')]);}logger[_0x7c0c('0x17')](_0x7c0c('0x19'),_0x3787eb,_0x11c216['error'][_0x7c0c('0x1a')]);return _0x413bcd(_0x11c216[_0x7c0c('0x17')]['message']);}else{logger[_0x7c0c('0x12')](_0x7c0c('0x19'),_0x3787eb,'request\x20sent');_0x413bcd(_0x11c216[_0x7c0c('0x1b')][_0x7c0c('0x1a')]);}})[_0x7c0c('0x1c')](function(_0x419007){logger[_0x7c0c('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x3787eb,_0x419007);_0x4fa0ec(_0x419007);});});}exports[_0x7c0c('0x1d')]=function(_0x1afe8b){var _0x5746b3=this;return new Promise(function(_0x3061eb,_0x3b95c8){return db[_0x7c0c('0x1e')]['find']({'raw':_0x1afe8b[_0x7c0c('0x1f')]?_0x1afe8b[_0x7c0c('0x1f')][_0x7c0c('0x20')]===undefined?!![]:![]:!![],'where':_0x1afe8b[_0x7c0c('0x1f')]?_0x1afe8b[_0x7c0c('0x1f')][_0x7c0c('0x21')]||null:null,'attributes':_0x1afe8b['options']?_0x1afe8b['options']['attributes']||null:null,'include':_0x1afe8b['options']?_0x1afe8b[_0x7c0c('0x1f')][_0x7c0c('0x22')]?_[_0x7c0c('0x23')](_0x1afe8b[_0x7c0c('0x1f')][_0x7c0c('0x22')],function(_0x14f854){return{'model':db[_0x14f854[_0x7c0c('0x24')]],'as':_0x14f854['as'],'attributes':_0x14f854['attributes'],'include':_0x14f854[_0x7c0c('0x22')]?_[_0x7c0c('0x23')](_0x14f854[_0x7c0c('0x22')],function(_0x452141){return{'model':db[_0x452141[_0x7c0c('0x24')]],'as':_0x452141['as'],'attributes':_0x452141[_0x7c0c('0x25')],'include':_0x452141[_0x7c0c('0x22')]?_[_0x7c0c('0x23')](_0x452141['include'],function(_0x30c55c){return{'model':db[_0x30c55c['model']],'as':_0x30c55c['as'],'attributes':_0x30c55c[_0x7c0c('0x25')]};}):[]};}):[]};}):[]:[]})[_0x7c0c('0x11')](function(_0x331fdb){logger['info']('ShowWhatsappAccount',_0x1afe8b);logger[_0x7c0c('0x13')](_0x7c0c('0x1d'),_0x1afe8b,JSON[_0x7c0c('0x16')](_0x331fdb));_0x3061eb(_0x331fdb);})[_0x7c0c('0x1c')](function(_0x568d6c){logger[_0x7c0c('0x17')]('ShowWhatsappAccount',_0x568d6c[_0x7c0c('0x1a')],_0x1afe8b);_0x3b95c8(_0x5746b3[_0x7c0c('0x17')](0x1f4,_0x568d6c['message']));});});}; \ No newline at end of file +var _0x95aa=['rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5228da,_0x4d44ac){var _0x1723f4=function(_0x4b169d){while(--_0x4b169d){_0x5228da['push'](_0x5228da['shift']());}};_0x1723f4(++_0x4d44ac);}(_0x95aa,0x91));var _0xa95a=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0x95aa[_0x1e4f2f];return _0xccea89;};'use strict';var _=require(_0xa95a('0x0'));var util=require('util');var moment=require(_0xa95a('0x1'));var BPromise=require(_0xa95a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa95a('0x3'));var db=require(_0xa95a('0x4'))['db'];var utils=require(_0xa95a('0x5'));var logger=require(_0xa95a('0x6'))(_0xa95a('0x7'));var config=require(_0xa95a('0x8'));var jayson=require(_0xa95a('0x9'));var client=jayson[_0xa95a('0xa')][_0xa95a('0xb')]({'port':0x232a});config['redis']=_[_0xa95a('0xc')](config['redis'],{'host':_0xa95a('0xd'),'port':0x18eb});var socket=require(_0xa95a('0xe'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0xa95a('0xf')](socket);function respondWithRpcPromise(_0x1a4056,_0x29a091,_0x2ec118){return new BPromise(function(_0x15ce6d,_0x29e4f0){return client[_0xa95a('0x10')](_0x1a4056,_0x2ec118)[_0xa95a('0x11')](function(_0xb951fb){logger[_0xa95a('0x12')](_0xa95a('0x13'),_0x29a091,'request\x20sent');logger['debug'](_0xa95a('0x14'),_0x29a091,'request\x20sent',JSON[_0xa95a('0x15')](_0xb951fb));if(_0xb951fb[_0xa95a('0x16')]){if(_0xb951fb[_0xa95a('0x16')][_0xa95a('0x17')]===0x1f4){logger[_0xa95a('0x16')](_0xa95a('0x13'),_0x29a091,_0xb951fb[_0xa95a('0x16')][_0xa95a('0x18')]);return _0x29e4f0(_0xb951fb[_0xa95a('0x16')][_0xa95a('0x18')]);}logger['error'](_0xa95a('0x13'),_0x29a091,_0xb951fb[_0xa95a('0x16')]['message']);return _0x15ce6d(_0xb951fb[_0xa95a('0x16')][_0xa95a('0x18')]);}else{logger[_0xa95a('0x12')](_0xa95a('0x13'),_0x29a091,'request\x20sent');_0x15ce6d(_0xb951fb[_0xa95a('0x19')]['message']);}})[_0xa95a('0x1a')](function(_0x334c65){logger[_0xa95a('0x16')](_0xa95a('0x13'),_0x29a091,_0x334c65);_0x29e4f0(_0x334c65);});});}exports[_0xa95a('0x1b')]=function(_0x28791e){var _0x4584c4=this;return new Promise(function(_0x27c464,_0x26a3be){return db[_0xa95a('0x1c')][_0xa95a('0x1d')]({'raw':_0x28791e['options']?_0x28791e[_0xa95a('0x1e')][_0xa95a('0x1f')]===undefined?!![]:![]:!![],'where':_0x28791e[_0xa95a('0x1e')]?_0x28791e[_0xa95a('0x1e')][_0xa95a('0x20')]||null:null,'attributes':_0x28791e['options']?_0x28791e['options'][_0xa95a('0x21')]||null:null,'include':_0x28791e[_0xa95a('0x1e')]?_0x28791e[_0xa95a('0x1e')][_0xa95a('0x22')]?_[_0xa95a('0x23')](_0x28791e[_0xa95a('0x1e')][_0xa95a('0x22')],function(_0xd66aea){return{'model':db[_0xd66aea[_0xa95a('0x24')]],'as':_0xd66aea['as'],'attributes':_0xd66aea[_0xa95a('0x21')],'include':_0xd66aea[_0xa95a('0x22')]?_[_0xa95a('0x23')](_0xd66aea[_0xa95a('0x22')],function(_0x3aa452){return{'model':db[_0x3aa452['model']],'as':_0x3aa452['as'],'attributes':_0x3aa452[_0xa95a('0x21')],'include':_0x3aa452[_0xa95a('0x22')]?_[_0xa95a('0x23')](_0x3aa452[_0xa95a('0x22')],function(_0x389f87){return{'model':db[_0x389f87[_0xa95a('0x24')]],'as':_0x389f87['as'],'attributes':_0x389f87[_0xa95a('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa95a('0x11')](function(_0x1a795f){logger[_0xa95a('0x12')]('ShowWhatsappAccount',_0x28791e);logger[_0xa95a('0x25')]('ShowWhatsappAccount',_0x28791e,JSON['stringify'](_0x1a795f));_0x27c464(_0x1a795f);})[_0xa95a('0x1a')](function(_0x11f114){logger['error']('ShowWhatsappAccount',_0x11f114[_0xa95a('0x18')],_0x28791e);_0x26a3be(_0x4584c4[_0xa95a('0x16')](0x1f4,_0x11f114[_0xa95a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 6f462a6..74a5e2f 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa587=['emit','length','whatsappAccount:','./whatsappAccount.events','save','remove','update'];(function(_0x1fd703,_0x31e4ef){var _0x112d62=function(_0x28054f){while(--_0x28054f){_0x1fd703['push'](_0x1fd703['shift']());}};_0x112d62(++_0x31e4ef);}(_0xa587,0x192));var _0x7a58=function(_0x271707,_0x447aaf){_0x271707=_0x271707-0x0;var _0x303537=_0xa587[_0x271707];return _0x303537;};'use strict';var WhatsappAccountEvents=require(_0x7a58('0x0'));var events=[_0x7a58('0x1'),_0x7a58('0x2'),_0x7a58('0x3')];function createListener(_0x15538e,_0x4756c4){return function(_0x3b70d9){_0x4756c4[_0x7a58('0x4')](_0x15538e,_0x3b70d9);};}function removeListener(_0x4ba257,_0x195a78){return function(){WhatsappAccountEvents['removeListener'](_0x4ba257,_0x195a78);};}exports['register']=function(_0x25d02a){for(var _0x3c3023=0x0,_0xb277e4=events[_0x7a58('0x5')];_0x3c3023<_0xb277e4;_0x3c3023++){var _0xd3abe2=events[_0x3c3023];var _0x34779e=createListener(_0x7a58('0x6')+_0xd3abe2,_0x25d02a);WhatsappAccountEvents['on'](_0xd3abe2,_0x34779e);}}; \ No newline at end of file +var _0x7996=['remove','emit','removeListener','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x3770c8,_0x4c3e51){var _0x33d6ff=function(_0x5e1f08){while(--_0x5e1f08){_0x3770c8['push'](_0x3770c8['shift']());}};_0x33d6ff(++_0x4c3e51);}(_0x7996,0x1c0));var _0x6799=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0x7996[_0x1b02bb];return _0x131245;};'use strict';var WhatsappAccountEvents=require(_0x6799('0x0'));var events=[_0x6799('0x1'),_0x6799('0x2'),'update'];function createListener(_0x2ba0e7,_0x5c5e32){return function(_0x3af4bf){_0x5c5e32[_0x6799('0x3')](_0x2ba0e7,_0x3af4bf);};}function removeListener(_0x14c1a6,_0x41dffa){return function(){WhatsappAccountEvents[_0x6799('0x4')](_0x14c1a6,_0x41dffa);};}exports['register']=function(_0x1bc661){for(var _0xcc84d=0x0,_0x28a300=events['length'];_0xcc84d<_0x28a300;_0xcc84d++){var _0x26682a=events[_0xcc84d];var _0x32961f=createListener(_0x6799('0x5')+_0x26682a,_0x1bc661);WhatsappAccountEvents['on'](_0x26682a,_0x32961f);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 9ef0bd1..e17377e 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x134f=['/:id','show','create','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index'];(function(_0x28ad8b,_0x47975a){var _0x30d0b9=function(_0xa859a5){while(--_0xa859a5){_0x28ad8b['push'](_0x28ad8b['shift']());}};_0x30d0b9(++_0x47975a);}(_0x134f,0xa0));var _0xf134=function(_0x49efc3,_0x2de846){_0x49efc3=_0x49efc3-0x0;var _0xabe06=_0x134f[_0x49efc3];return _0xabe06;};'use strict';var multer=require(_0xf134('0x0'));var util=require(_0xf134('0x1'));var path=require('path');var timeout=require(_0xf134('0x2'));var express=require('express');var router=express[_0xf134('0x3')]();var fs_extra=require(_0xf134('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf134('0x5'));var config=require('../../config/environment');var controller=require(_0xf134('0x6'));router[_0xf134('0x7')]('/',auth[_0xf134('0x8')](),controller[_0xf134('0x9')]);router[_0xf134('0x7')](_0xf134('0xa'),auth['isAuthenticated'](),controller[_0xf134('0xb')]);router['post']('/',auth[_0xf134('0x8')](),controller[_0xf134('0xc')]);router[_0xf134('0xd')](_0xf134('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xf134('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf134('0xf')]);module[_0xf134('0x10')]=router; \ No newline at end of file +var _0x5574=['isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get'];(function(_0xd580e2,_0x109182){var _0x4d955f=function(_0x568fff){while(--_0x568fff){_0xd580e2['push'](_0xd580e2['shift']());}};_0x4d955f(++_0x109182);}(_0x5574,0x81));var _0x4557=function(_0x2ff72c,_0x2ea6c8){_0x2ff72c=_0x2ff72c-0x0;var _0x41020a=_0x5574[_0x2ff72c];return _0x41020a;};'use strict';var multer=require(_0x4557('0x0'));var util=require('util');var path=require(_0x4557('0x1'));var timeout=require(_0x4557('0x2'));var express=require(_0x4557('0x3'));var router=express[_0x4557('0x4')]();var fs_extra=require(_0x4557('0x5'));var auth=require(_0x4557('0x6'));var interaction=require(_0x4557('0x7'));var config=require(_0x4557('0x8'));var controller=require(_0x4557('0x9'));router[_0x4557('0xa')]('/',auth[_0x4557('0xb')](),controller[_0x4557('0xc')]);router['get'](_0x4557('0xd'),auth[_0x4557('0xb')](),controller[_0x4557('0xe')]);router[_0x4557('0xf')]('/',auth[_0x4557('0xb')](),controller[_0x4557('0x10')]);router[_0x4557('0x11')](_0x4557('0xd'),auth[_0x4557('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4557('0x12')]);module[_0x4557('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index d01c27a..bf8a501 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5de5=['INTEGER','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x5ac1f0,_0x557b2c){var _0x3b98a6=function(_0x45873c){while(--_0x45873c){_0x5ac1f0['push'](_0x5ac1f0['shift']());}};_0x3b98a6(++_0x557b2c);}(_0x5de5,0x12a));var _0x55de=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5de5[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x55de('0x0'));module[_0x55de('0x1')]={'priority':{'type':Sequelize[_0x55de('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x55de('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x55de('0x4')],'defaultValue':_0x55de('0x5')}}; \ No newline at end of file +var _0x64e5=['INTEGER','STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64e5,0x146));var _0x564e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x64e5[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x564e('0x0'));module[_0x564e('0x1')]={'priority':{'type':Sequelize[_0x564e('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x564e('0x3')]},'interval':{'type':Sequelize[_0x564e('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index e77c5a3..a10bc59 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59ea=['limit','undefined','count','offset','status','set','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','WhatsappApplication','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','then','rows','catch','show','include','options','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','json'];(function(_0x4bc4c8,_0x3139d3){var _0x3bb121=function(_0x95ad12){while(--_0x95ad12){_0x4bc4c8['push'](_0x4bc4c8['shift']());}};_0x3bb121(++_0x3139d3);}(_0x59ea,0x19d));var _0xa59e=function(_0x2ed9e6,_0x1cbe8a){_0x2ed9e6=_0x2ed9e6-0x0;var _0x414867=_0x59ea[_0x2ed9e6];return _0x414867;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa59e('0x0'));var jsonpatch=require(_0xa59e('0x1'));var rp=require(_0xa59e('0x2'));var moment=require(_0xa59e('0x3'));var BPromise=require(_0xa59e('0x4'));var Mustache=require(_0xa59e('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa59e('0x6'));var csv=require('to-csv');var ejs=require(_0xa59e('0x7'));var fs=require('fs');var fs_extra=require(_0xa59e('0x8'));var _=require(_0xa59e('0x9'));var squel=require('squel');var crypto=require(_0xa59e('0xa'));var jsforce=require(_0xa59e('0xb'));var deskjs=require(_0xa59e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa59e('0xd'));var Papa=require(_0xa59e('0xe'));var Redis=require(_0xa59e('0xf'));var authService=require(_0xa59e('0x10'));var qs=require(_0xa59e('0x11'));var as=require(_0xa59e('0x12'));var hardwareService=require(_0xa59e('0x13'));var logger=require(_0xa59e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xa59e('0x15'));var licenseUtil=require(_0xa59e('0x16'));var db=require(_0xa59e('0x17'))['db'];function respondWithStatusCode(_0x31c9f0,_0x570575){_0x570575=_0x570575||0xcc;return function(_0x3e959c){if(_0x3e959c){return _0x31c9f0['sendStatus'](_0x570575);}return _0x31c9f0['status'](_0x570575)['end']();};}function respondWithResult(_0x5ea8cd,_0xd398e5){_0xd398e5=_0xd398e5||0xc8;return function(_0x141386){if(_0x141386){return _0x5ea8cd['status'](_0xd398e5)[_0xa59e('0x18')](_0x141386);}};}function respondWithFilteredResult(_0x27c4ed,_0x2eca0b){return function(_0xafa9db){if(_0xafa9db){var _0x520c26=typeof _0x2eca0b['offset']==='undefined'&&typeof _0x2eca0b[_0xa59e('0x19')]===_0xa59e('0x1a');var _0x500d8c=_0xafa9db[_0xa59e('0x1b')];var _0x277aee=_0x520c26?0x0:_0x2eca0b[_0xa59e('0x1c')];var _0x38104c=_0x520c26?_0xafa9db['count']:_0x2eca0b[_0xa59e('0x1c')]+_0x2eca0b[_0xa59e('0x19')];var _0xac51d9;if(_0x38104c>=_0x500d8c){_0x38104c=_0x500d8c;_0xac51d9=0xc8;}else{_0xac51d9=0xce;}_0x27c4ed[_0xa59e('0x1d')](_0xac51d9);return _0x27c4ed[_0xa59e('0x1e')]('Content-Range',_0x277aee+'-'+_0x38104c+'/'+_0x500d8c)[_0xa59e('0x18')](_0xafa9db);}return null;};}function patchUpdates(_0x2e1d5d){return function(_0x4ffb12){try{jsonpatch[_0xa59e('0x1f')](_0x4ffb12,_0x2e1d5d,!![]);}catch(_0x2bb8d9){return BPromise[_0xa59e('0x20')](_0x2bb8d9);}return _0x4ffb12[_0xa59e('0x21')]();};}function saveUpdates(_0x440dc5,_0x2a583a){return function(_0x541cb3){if(_0x541cb3){return _0x541cb3[_0xa59e('0x22')](_0x440dc5)['then'](function(_0x431dc5){return _0x431dc5;});}return null;};}function removeEntity(_0x4f34a1,_0x549ba){return function(_0x5ea0cb){if(_0x5ea0cb){return _0x5ea0cb[_0xa59e('0x23')]()['then'](function(){_0x4f34a1[_0xa59e('0x1d')](0xcc)[_0xa59e('0x24')]();});}};}function handleEntityNotFound(_0x3be835,_0x1bd232){return function(_0x48c396){if(!_0x48c396){_0x3be835[_0xa59e('0x25')](0x194);}return _0x48c396;};}function handleError(_0x3896e9,_0x4997ee){_0x4997ee=_0x4997ee||0x1f4;return function(_0x73b615){logger['error'](_0x73b615['stack']);if(_0x73b615[_0xa59e('0x26')]){delete _0x73b615[_0xa59e('0x26')];}_0x3896e9['status'](_0x4997ee)[_0xa59e('0x27')](_0x73b615);};}exports[_0xa59e('0x28')]=function(_0x52dc5a,_0x1175da){var _0x3b3ad6={},_0x539a31={},_0xed0965={'count':0x0,'rows':[]};var _0x3e5650=_[_0xa59e('0x29')](db[_0xa59e('0x2a')]['rawAttributes'],function(_0x253dff){return{'name':_0x253dff[_0xa59e('0x2b')],'type':_0x253dff[_0xa59e('0x2c')]['key']};});_0x539a31[_0xa59e('0x2d')]=_['map'](_0x3e5650,_0xa59e('0x26'));_0x539a31[_0xa59e('0x2e')]=_[_0xa59e('0x2f')](_0x52dc5a['query']);_0x539a31[_0xa59e('0x30')]=_[_0xa59e('0x31')](_0x539a31[_0xa59e('0x2d')],_0x539a31['query']);_0x3b3ad6[_0xa59e('0x32')]=_[_0xa59e('0x31')](_0x539a31[_0xa59e('0x2d')],qs[_0xa59e('0x33')](_0x52dc5a[_0xa59e('0x2e')][_0xa59e('0x33')]));_0x3b3ad6['attributes']=_0x3b3ad6['attributes'][_0xa59e('0x34')]?_0x3b3ad6[_0xa59e('0x32')]:_0x539a31[_0xa59e('0x2d')];if(!_0x52dc5a[_0xa59e('0x2e')][_0xa59e('0x35')](_0xa59e('0x36'))){_0x3b3ad6['limit']=qs[_0xa59e('0x19')](_0x52dc5a[_0xa59e('0x2e')][_0xa59e('0x19')]);_0x3b3ad6[_0xa59e('0x1c')]=qs[_0xa59e('0x1c')](_0x52dc5a[_0xa59e('0x2e')][_0xa59e('0x1c')]);}_0x3b3ad6['order']=qs[_0xa59e('0x37')](_0x52dc5a['query'][_0xa59e('0x37')]);_0x3b3ad6[_0xa59e('0x38')]=qs[_0xa59e('0x30')](_[_0xa59e('0x39')](_0x52dc5a[_0xa59e('0x2e')],_0x539a31['filters']),_0x3e5650);if(_0x52dc5a['query'][_0xa59e('0x3a')]){_0x3b3ad6[_0xa59e('0x38')]=_['merge'](_0x3b3ad6[_0xa59e('0x38')],{'$or':_[_0xa59e('0x29')](_0x3e5650,function(_0x3a4cca){if(_0x3a4cca[_0xa59e('0x2c')]!==_0xa59e('0x3b')){var _0x377a07={};_0x377a07[_0x3a4cca['name']]={'$like':'%'+_0x52dc5a[_0xa59e('0x2e')][_0xa59e('0x3a')]+'%'};return _0x377a07;}})});}_0x3b3ad6=_[_0xa59e('0x3c')]({},_0x3b3ad6,_0x52dc5a['options']);var _0x5b06b8={'where':_0x3b3ad6['where']};return db['WhatsappApplication'][_0xa59e('0x1b')](_0x5b06b8)['then'](function(_0x13d6a4){_0xed0965['count']=_0x13d6a4;if(_0x52dc5a[_0xa59e('0x2e')][_0xa59e('0x3d')]){_0x3b3ad6['include']=[{'all':!![]}];}return db[_0xa59e('0x2a')][_0xa59e('0x3e')](_0x3b3ad6);})[_0xa59e('0x3f')](function(_0x163473){_0xed0965[_0xa59e('0x40')]=_0x163473;return _0xed0965;})[_0xa59e('0x3f')](respondWithFilteredResult(_0x1175da,_0x3b3ad6))[_0xa59e('0x41')](handleError(_0x1175da,null));};exports[_0xa59e('0x42')]=function(_0x5ea90f,_0x1c90fb){var _0xeeca23={'raw':!![],'where':{'id':_0x5ea90f['params']['id']}},_0x17d67b={};_0x17d67b[_0xa59e('0x2d')]=_[_0xa59e('0x2f')](db[_0xa59e('0x2a')]['rawAttributes']);_0x17d67b['query']=_[_0xa59e('0x2f')](_0x5ea90f[_0xa59e('0x2e')]);_0x17d67b[_0xa59e('0x30')]=_[_0xa59e('0x31')](_0x17d67b[_0xa59e('0x2d')],_0x17d67b[_0xa59e('0x2e')]);_0xeeca23[_0xa59e('0x32')]=_[_0xa59e('0x31')](_0x17d67b[_0xa59e('0x2d')],qs[_0xa59e('0x33')](_0x5ea90f[_0xa59e('0x2e')][_0xa59e('0x33')]));_0xeeca23[_0xa59e('0x32')]=_0xeeca23['attributes'][_0xa59e('0x34')]?_0xeeca23['attributes']:_0x17d67b[_0xa59e('0x2d')];if(_0x5ea90f['query']['includeAll']){_0xeeca23[_0xa59e('0x43')]=[{'all':!![]}];}_0xeeca23=_['merge']({},_0xeeca23,_0x5ea90f[_0xa59e('0x44')]);return db[_0xa59e('0x2a')][_0xa59e('0x45')](_0xeeca23)[_0xa59e('0x3f')](handleEntityNotFound(_0x1c90fb,null))[_0xa59e('0x3f')](respondWithResult(_0x1c90fb,null))['catch'](handleError(_0x1c90fb,null));};exports['create']=function(_0x2d730a,_0x40c672){return db[_0xa59e('0x2a')][_0xa59e('0x46')](_0x2d730a[_0xa59e('0x47')],{})[_0xa59e('0x3f')](respondWithResult(_0x40c672,0xc9))['catch'](handleError(_0x40c672,null));};exports[_0xa59e('0x22')]=function(_0x492704,_0x2d22eb){if(_0x492704[_0xa59e('0x47')]['id']){delete _0x492704[_0xa59e('0x47')]['id'];}return db[_0xa59e('0x2a')]['find']({'where':{'id':_0x492704[_0xa59e('0x48')]['id']}})[_0xa59e('0x3f')](handleEntityNotFound(_0x2d22eb,null))[_0xa59e('0x3f')](saveUpdates(_0x492704['body'],null))[_0xa59e('0x3f')](respondWithResult(_0x2d22eb,null))[_0xa59e('0x41')](handleError(_0x2d22eb,null));};exports[_0xa59e('0x23')]=function(_0x388970,_0x12a6ca){return db[_0xa59e('0x2a')][_0xa59e('0x45')]({'where':{'id':_0x388970[_0xa59e('0x48')]['id']}})[_0xa59e('0x3f')](handleEntityNotFound(_0x12a6ca,null))[_0xa59e('0x3f')](removeEntity(_0x12a6ca,null))[_0xa59e('0x41')](handleError(_0x12a6ca,null));}; \ No newline at end of file +var _0x53aa=['destroy','error','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','WhatsappApplication','findAll','catch','show','includeAll','include','create','body','find','params','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','save','update','then'];(function(_0x594857,_0x32bdc5){var _0x2894f3=function(_0x80cf2d){while(--_0x80cf2d){_0x594857['push'](_0x594857['shift']());}};_0x2894f3(++_0x32bdc5);}(_0x53aa,0x6d));var _0xa53a=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x53aa[_0x486f4a];return _0x135d99;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa53a('0x0'));var jsonpatch=require(_0xa53a('0x1'));var rp=require('request-promise');var moment=require(_0xa53a('0x2'));var BPromise=require(_0xa53a('0x3'));var Mustache=require(_0xa53a('0x4'));var util=require(_0xa53a('0x5'));var path=require(_0xa53a('0x6'));var sox=require(_0xa53a('0x7'));var csv=require(_0xa53a('0x8'));var ejs=require(_0xa53a('0x9'));var fs=require('fs');var fs_extra=require(_0xa53a('0xa'));var _=require(_0xa53a('0xb'));var squel=require('squel');var crypto=require(_0xa53a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa53a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa53a('0xe'));var Papa=require('papaparse');var Redis=require(_0xa53a('0xf'));var authService=require(_0xa53a('0x10'));var qs=require(_0xa53a('0x11'));var as=require(_0xa53a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa53a('0x13'));var utils=require(_0xa53a('0x14'));var config=require(_0xa53a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa53a('0x16'))['db'];function respondWithStatusCode(_0x419494,_0x18e658){_0x18e658=_0x18e658||0xcc;return function(_0x20de47){if(_0x20de47){return _0x419494[_0xa53a('0x17')](_0x18e658);}return _0x419494['status'](_0x18e658)[_0xa53a('0x18')]();};}function respondWithResult(_0x39e5ab,_0x5bb756){_0x5bb756=_0x5bb756||0xc8;return function(_0x49f8f1){if(_0x49f8f1){return _0x39e5ab[_0xa53a('0x19')](_0x5bb756)[_0xa53a('0x1a')](_0x49f8f1);}};}function respondWithFilteredResult(_0x3aded6,_0x2ba1cc){return function(_0x23c420){if(_0x23c420){var _0x49ffe7=typeof _0x2ba1cc[_0xa53a('0x1b')]===_0xa53a('0x1c')&&typeof _0x2ba1cc[_0xa53a('0x1d')]===_0xa53a('0x1c');var _0x3e729b=_0x23c420[_0xa53a('0x1e')];var _0x595d3c=_0x49ffe7?0x0:_0x2ba1cc[_0xa53a('0x1b')];var _0x2beec4=_0x49ffe7?_0x23c420[_0xa53a('0x1e')]:_0x2ba1cc[_0xa53a('0x1b')]+_0x2ba1cc[_0xa53a('0x1d')];var _0x145586;if(_0x2beec4>=_0x3e729b){_0x2beec4=_0x3e729b;_0x145586=0xc8;}else{_0x145586=0xce;}_0x3aded6[_0xa53a('0x19')](_0x145586);return _0x3aded6['set']('Content-Range',_0x595d3c+'-'+_0x2beec4+'/'+_0x3e729b)[_0xa53a('0x1a')](_0x23c420);}return null;};}function patchUpdates(_0x5a4281){return function(_0x2121c8){try{jsonpatch[_0xa53a('0x1f')](_0x2121c8,_0x5a4281,!![]);}catch(_0x27071c){return BPromise['reject'](_0x27071c);}return _0x2121c8[_0xa53a('0x20')]();};}function saveUpdates(_0x42d44a,_0x2a344d){return function(_0x4fd7b8){if(_0x4fd7b8){return _0x4fd7b8[_0xa53a('0x21')](_0x42d44a)[_0xa53a('0x22')](function(_0x3c457f){return _0x3c457f;});}return null;};}function removeEntity(_0x33a698,_0x2b56b7){return function(_0x458d03){if(_0x458d03){return _0x458d03[_0xa53a('0x23')]()['then'](function(){_0x33a698[_0xa53a('0x19')](0xcc)[_0xa53a('0x18')]();});}};}function handleEntityNotFound(_0x58df30,_0xd1cfed){return function(_0x71de90){if(!_0x71de90){_0x58df30[_0xa53a('0x17')](0x194);}return _0x71de90;};}function handleError(_0x383503,_0x18fa52){_0x18fa52=_0x18fa52||0x1f4;return function(_0x43589f){logger[_0xa53a('0x24')](_0x43589f[_0xa53a('0x25')]);if(_0x43589f[_0xa53a('0x26')]){delete _0x43589f[_0xa53a('0x26')];}_0x383503[_0xa53a('0x19')](_0x18fa52)[_0xa53a('0x27')](_0x43589f);};}exports['index']=function(_0x2b3180,_0x3d0c0d){var _0x1f1957={},_0x36b686={},_0x134f5e={'count':0x0,'rows':[]};var _0x2cb10f=_[_0xa53a('0x28')](db['WhatsappApplication']['rawAttributes'],function(_0x2c6d93){return{'name':_0x2c6d93[_0xa53a('0x29')],'type':_0x2c6d93['type'][_0xa53a('0x2a')]};});_0x36b686[_0xa53a('0x2b')]=_['map'](_0x2cb10f,_0xa53a('0x26'));_0x36b686[_0xa53a('0x2c')]=_[_0xa53a('0x2d')](_0x2b3180[_0xa53a('0x2c')]);_0x36b686[_0xa53a('0x2e')]=_[_0xa53a('0x2f')](_0x36b686[_0xa53a('0x2b')],_0x36b686[_0xa53a('0x2c')]);_0x1f1957[_0xa53a('0x30')]=_['intersection'](_0x36b686[_0xa53a('0x2b')],qs[_0xa53a('0x31')](_0x2b3180[_0xa53a('0x2c')][_0xa53a('0x31')]));_0x1f1957['attributes']=_0x1f1957[_0xa53a('0x30')][_0xa53a('0x32')]?_0x1f1957['attributes']:_0x36b686[_0xa53a('0x2b')];if(!_0x2b3180[_0xa53a('0x2c')][_0xa53a('0x33')](_0xa53a('0x34'))){_0x1f1957[_0xa53a('0x1d')]=qs['limit'](_0x2b3180['query'][_0xa53a('0x1d')]);_0x1f1957['offset']=qs[_0xa53a('0x1b')](_0x2b3180[_0xa53a('0x2c')]['offset']);}_0x1f1957[_0xa53a('0x35')]=qs[_0xa53a('0x36')](_0x2b3180[_0xa53a('0x2c')]['sort']);_0x1f1957[_0xa53a('0x37')]=qs[_0xa53a('0x2e')](_[_0xa53a('0x38')](_0x2b3180[_0xa53a('0x2c')],_0x36b686[_0xa53a('0x2e')]),_0x2cb10f);if(_0x2b3180[_0xa53a('0x2c')]['filter']){_0x1f1957['where']=_[_0xa53a('0x39')](_0x1f1957[_0xa53a('0x37')],{'$or':_[_0xa53a('0x28')](_0x2cb10f,function(_0x1cab87){if(_0x1cab87[_0xa53a('0x3a')]!==_0xa53a('0x3b')){var _0x5c85a6={};_0x5c85a6[_0x1cab87['name']]={'$like':'%'+_0x2b3180[_0xa53a('0x2c')][_0xa53a('0x3c')]+'%'};return _0x5c85a6;}})});}_0x1f1957=_['merge']({},_0x1f1957,_0x2b3180[_0xa53a('0x3d')]);var _0x72d879={'where':_0x1f1957[_0xa53a('0x37')]};return db[_0xa53a('0x3e')][_0xa53a('0x1e')](_0x72d879)[_0xa53a('0x22')](function(_0x32d45f){_0x134f5e[_0xa53a('0x1e')]=_0x32d45f;if(_0x2b3180[_0xa53a('0x2c')]['includeAll']){_0x1f1957['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0xa53a('0x3f')](_0x1f1957);})[_0xa53a('0x22')](function(_0x2e0a4e){_0x134f5e['rows']=_0x2e0a4e;return _0x134f5e;})[_0xa53a('0x22')](respondWithFilteredResult(_0x3d0c0d,_0x1f1957))[_0xa53a('0x40')](handleError(_0x3d0c0d,null));};exports[_0xa53a('0x41')]=function(_0xfc7e4a,_0x46a1aa){var _0x49b2fb={'raw':!![],'where':{'id':_0xfc7e4a['params']['id']}},_0x3d784a={};_0x3d784a[_0xa53a('0x2b')]=_[_0xa53a('0x2d')](db[_0xa53a('0x3e')]['rawAttributes']);_0x3d784a['query']=_[_0xa53a('0x2d')](_0xfc7e4a['query']);_0x3d784a[_0xa53a('0x2e')]=_[_0xa53a('0x2f')](_0x3d784a[_0xa53a('0x2b')],_0x3d784a['query']);_0x49b2fb[_0xa53a('0x30')]=_['intersection'](_0x3d784a[_0xa53a('0x2b')],qs['fields'](_0xfc7e4a[_0xa53a('0x2c')][_0xa53a('0x31')]));_0x49b2fb[_0xa53a('0x30')]=_0x49b2fb['attributes'][_0xa53a('0x32')]?_0x49b2fb['attributes']:_0x3d784a['model'];if(_0xfc7e4a['query'][_0xa53a('0x42')]){_0x49b2fb[_0xa53a('0x43')]=[{'all':!![]}];}_0x49b2fb=_[_0xa53a('0x39')]({},_0x49b2fb,_0xfc7e4a[_0xa53a('0x3d')]);return db[_0xa53a('0x3e')]['find'](_0x49b2fb)[_0xa53a('0x22')](handleEntityNotFound(_0x46a1aa,null))[_0xa53a('0x22')](respondWithResult(_0x46a1aa,null))[_0xa53a('0x40')](handleError(_0x46a1aa,null));};exports['create']=function(_0x5eeca8,_0x511326){return db[_0xa53a('0x3e')][_0xa53a('0x44')](_0x5eeca8['body'],{})[_0xa53a('0x22')](respondWithResult(_0x511326,0xc9))[_0xa53a('0x40')](handleError(_0x511326,null));};exports[_0xa53a('0x21')]=function(_0x139cf4,_0xce75b0){if(_0x139cf4[_0xa53a('0x45')]['id']){delete _0x139cf4[_0xa53a('0x45')]['id'];}return db[_0xa53a('0x3e')][_0xa53a('0x46')]({'where':{'id':_0x139cf4[_0xa53a('0x47')]['id']}})[_0xa53a('0x22')](handleEntityNotFound(_0xce75b0,null))[_0xa53a('0x22')](saveUpdates(_0x139cf4['body'],null))[_0xa53a('0x22')](respondWithResult(_0xce75b0,null))[_0xa53a('0x40')](handleError(_0xce75b0,null));};exports[_0xa53a('0x23')]=function(_0x5e7b2f,_0x3e3f26){return db['WhatsappApplication'][_0xa53a('0x46')]({'where':{'id':_0x5e7b2f[_0xa53a('0x47')]['id']}})[_0xa53a('0x22')](handleEntityNotFound(_0x3e3f26,null))[_0xa53a('0x22')](removeEntity(_0x3e3f26,null))[_0xa53a('0x40')](handleError(_0x3e3f26,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index cbd4af0..a7216e0 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1dc=['./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0xf1dc,0xca));var _0xcf1d=function(_0xf53fc8,_0x456beb){_0xf53fc8=_0xf53fc8-0x0;var _0x3bc434=_0xf1dc[_0xf53fc8];return _0x3bc434;};'use strict';var _=require(_0xcf1d('0x0'));var util=require(_0xcf1d('0x1'));var logger=require(_0xcf1d('0x2'))(_0xcf1d('0x3'));var moment=require(_0xcf1d('0x4'));var BPromise=require(_0xcf1d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcf1d('0x6'));var config=require(_0xcf1d('0x7'));var attributes=require(_0xcf1d('0x8'));module[_0xcf1d('0x9')]=function(_0x2a49de,_0x14c14f){return _0x2a49de[_0xcf1d('0xa')](_0xcf1d('0xb'),attributes,{'tableName':_0xcf1d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcf1d('0xd')});}; \ No newline at end of file +var _0xa6c0=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x3df25f,_0x2ed46e){var _0x386acd=function(_0x27edb0){while(--_0x27edb0){_0x3df25f['push'](_0x3df25f['shift']());}};_0x386acd(++_0x2ed46e);}(_0xa6c0,0x184));var _0x0a6c=function(_0x322c68,_0x2fe626){_0x322c68=_0x322c68-0x0;var _0x38cf31=_0xa6c0[_0x322c68];return _0x38cf31;};'use strict';var _=require(_0x0a6c('0x0'));var util=require(_0x0a6c('0x1'));var logger=require(_0x0a6c('0x2'))('api');var moment=require(_0x0a6c('0x3'));var BPromise=require('bluebird');var rp=require(_0x0a6c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6c('0x5'));var config=require(_0x0a6c('0x6'));var attributes=require(_0x0a6c('0x7'));module[_0x0a6c('0x8')]=function(_0xc2325f,_0x505f0d){return _0xc2325f[_0x0a6c('0x9')](_0x0a6c('0xa'),attributes,{'tableName':_0x0a6c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a6c('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 309a000..9d175cd 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa0a1=['request\x20sent','error','code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s'];(function(_0x571c1d,_0x3b0586){var _0x33c609=function(_0x226499){while(--_0x226499){_0x571c1d['push'](_0x571c1d['shift']());}};_0x33c609(++_0x3b0586);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x399f39,_0x403e9a){_0x399f39=_0x399f39-0x0;var _0x38b439=_0xa0a1[_0x399f39];return _0x38b439;};'use strict';var _=require(_0x1a0a('0x0'));var util=require('util');var moment=require(_0x1a0a('0x1'));var BPromise=require(_0x1a0a('0x2'));var rs=require(_0x1a0a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1a0a('0x4'));var logger=require(_0x1a0a('0x5'))('rpc');var config=require(_0x1a0a('0x6'));var jayson=require(_0x1a0a('0x7'));var client=jayson['client'][_0x1a0a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe59f97,_0x3fe29f,_0x245f3d){return new BPromise(function(_0x9da67c,_0x48d604){return client[_0x1a0a('0x9')](_0xe59f97,_0x245f3d)[_0x1a0a('0xa')](function(_0x8165a1){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x3fe29f,'request\x20sent');logger[_0x1a0a('0xb')](_0x1a0a('0xc'),_0x3fe29f,_0x1a0a('0xd'),JSON['stringify'](_0x8165a1));if(_0x8165a1[_0x1a0a('0xe')]){if(_0x8165a1['error'][_0x1a0a('0xf')]===0x1f4){logger[_0x1a0a('0xe')](_0x1a0a('0x10'),_0x3fe29f,_0x8165a1[_0x1a0a('0xe')][_0x1a0a('0x11')]);return _0x48d604(_0x8165a1[_0x1a0a('0xe')][_0x1a0a('0x11')]);}logger['error'](_0x1a0a('0x10'),_0x3fe29f,_0x8165a1[_0x1a0a('0xe')][_0x1a0a('0x11')]);return _0x9da67c(_0x8165a1[_0x1a0a('0xe')][_0x1a0a('0x11')]);}else{logger['info'](_0x1a0a('0x10'),_0x3fe29f,_0x1a0a('0xd'));_0x9da67c(_0x8165a1[_0x1a0a('0x12')]['message']);}})[_0x1a0a('0x13')](function(_0x57c942){logger[_0x1a0a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x3fe29f,_0x57c942);_0x48d604(_0x57c942);});});} \ No newline at end of file +var _0x39d9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappApplication,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x53d99f,_0x112f2c){var _0x3555a8=function(_0x290c5b){while(--_0x290c5b){_0x53d99f['push'](_0x53d99f['shift']());}};_0x3555a8(++_0x112f2c);}(_0x39d9,0x17f));var _0x939d=function(_0x40c98f,_0x538320){_0x40c98f=_0x40c98f-0x0;var _0x2380b5=_0x39d9[_0x40c98f];return _0x2380b5;};'use strict';var _=require(_0x939d('0x0'));var util=require(_0x939d('0x1'));var moment=require(_0x939d('0x2'));var BPromise=require(_0x939d('0x3'));var rs=require(_0x939d('0x4'));var fs=require('fs');var Redis=require(_0x939d('0x5'));var db=require(_0x939d('0x6'))['db'];var utils=require(_0x939d('0x7'));var logger=require('../../config/logger')(_0x939d('0x8'));var config=require(_0x939d('0x9'));var jayson=require(_0x939d('0xa'));var client=jayson['client'][_0x939d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x537fd2,_0x2ba30f,_0x1bac28){return new BPromise(function(_0x20546a,_0xd65604){return client[_0x939d('0xc')](_0x537fd2,_0x1bac28)[_0x939d('0xd')](function(_0x39e0b5){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x2ba30f,_0x939d('0xe'));logger[_0x939d('0xf')](_0x939d('0x10'),_0x2ba30f,_0x939d('0xe'),JSON[_0x939d('0x11')](_0x39e0b5));if(_0x39e0b5['error']){if(_0x39e0b5['error']['code']===0x1f4){logger[_0x939d('0x12')](_0x939d('0x13'),_0x2ba30f,_0x39e0b5[_0x939d('0x12')]['message']);return _0xd65604(_0x39e0b5[_0x939d('0x12')][_0x939d('0x14')]);}logger[_0x939d('0x12')](_0x939d('0x13'),_0x2ba30f,_0x39e0b5[_0x939d('0x12')][_0x939d('0x14')]);return _0x20546a(_0x39e0b5[_0x939d('0x12')][_0x939d('0x14')]);}else{logger[_0x939d('0x15')]('WhatsappApplication,\x20%s,\x20%s',_0x2ba30f,'request\x20sent');_0x20546a(_0x39e0b5[_0x939d('0x16')]['message']);}})[_0x939d('0x17')](function(_0x1b1a4f){logger['error'](_0x939d('0x13'),_0x2ba30f,_0x1b1a4f);_0xd65604(_0x1b1a4f);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 7d428d5..0a0b187 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76c4=['./whatsappInteraction.controller','isAuthenticated','get','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2cefd6,_0x320d0b){var _0x56d9ea=function(_0x47413b){while(--_0x47413b){_0x2cefd6['push'](_0x2cefd6['shift']());}};_0x56d9ea(++_0x320d0b);}(_0x76c4,0x141));var _0x476c=function(_0x6f3c80,_0x458801){_0x6f3c80=_0x6f3c80-0x0;var _0x4703b4=_0x76c4[_0x6f3c80];return _0x4703b4;};'use strict';var multer=require(_0x476c('0x0'));var util=require(_0x476c('0x1'));var path=require(_0x476c('0x2'));var timeout=require(_0x476c('0x3'));var express=require(_0x476c('0x4'));var router=express[_0x476c('0x5')]();var fs_extra=require(_0x476c('0x6'));var auth=require(_0x476c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x476c('0x8'));var controller=require(_0x476c('0x9'));router['get']('/',auth[_0x476c('0xa')](),controller['index']);router[_0x476c('0xb')](_0x476c('0xc'),auth[_0x476c('0xa')](),controller[_0x476c('0xd')]);router[_0x476c('0xb')](_0x476c('0xe'),auth[_0x476c('0xa')](),controller['show']);router[_0x476c('0xb')](_0x476c('0xf'),auth[_0x476c('0xa')](),controller[_0x476c('0x10')]);router[_0x476c('0xb')](_0x476c('0x11'),auth['isAuthenticated'](),controller[_0x476c('0x12')]);router[_0x476c('0x13')]('/',auth[_0x476c('0xa')](),controller[_0x476c('0x14')]);router[_0x476c('0x13')](_0x476c('0xf'),auth[_0x476c('0xa')](),controller[_0x476c('0x15')]);router[_0x476c('0x13')](_0x476c('0x16'),auth[_0x476c('0xa')](),interaction[_0x476c('0x17')](_0x476c('0x18'),_0x476c('0x19')),controller[_0x476c('0x1a')]);router[_0x476c('0x1b')]('/:id',auth[_0x476c('0xa')](),interaction[_0x476c('0x17')](_0x476c('0x18'),_0x476c('0x1c')),controller['update']);router[_0x476c('0x1d')](_0x476c('0xe'),auth[_0x476c('0xa')](),interaction[_0x476c('0x17')](_0x476c('0x18'),_0x476c('0x1e')),controller[_0x476c('0x1f')]);router['delete'](_0x476c('0x16'),auth[_0x476c('0xa')](),controller['removeTags']);module[_0x476c('0x20')]=router; \ No newline at end of file +var _0x72b1=['delete','whatsappinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','whatsappinteraction:addtags','put','tracked','whatsapp'];(function(_0x5b67f1,_0x1b73b9){var _0x4a3dff=function(_0x57fc2a){while(--_0x57fc2a){_0x5b67f1['push'](_0x5b67f1['shift']());}};_0x4a3dff(++_0x1b73b9);}(_0x72b1,0x1c6));var _0x172b=function(_0x5c16d7,_0x13a968){_0x5c16d7=_0x5c16d7-0x0;var _0x2d33a2=_0x72b1[_0x5c16d7];return _0x2d33a2;};'use strict';var multer=require(_0x172b('0x0'));var util=require(_0x172b('0x1'));var path=require(_0x172b('0x2'));var timeout=require(_0x172b('0x3'));var express=require(_0x172b('0x4'));var router=express['Router']();var fs_extra=require(_0x172b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x172b('0x6'));var config=require(_0x172b('0x7'));var controller=require(_0x172b('0x8'));router[_0x172b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x172b('0x9')](_0x172b('0xa'),auth[_0x172b('0xb')](),controller[_0x172b('0xc')]);router[_0x172b('0x9')](_0x172b('0xd'),auth[_0x172b('0xb')](),controller[_0x172b('0xe')]);router[_0x172b('0x9')](_0x172b('0xf'),auth[_0x172b('0xb')](),controller[_0x172b('0x10')]);router[_0x172b('0x9')](_0x172b('0x11'),auth[_0x172b('0xb')](),controller['download']);router[_0x172b('0x12')]('/',auth['isAuthenticated'](),controller[_0x172b('0x13')]);router[_0x172b('0x12')]('/:id/messages',auth[_0x172b('0xb')](),controller[_0x172b('0x14')]);router['post'](_0x172b('0x15'),auth['isAuthenticated'](),interaction['tracked']('whatsapp',_0x172b('0x16')),controller['addTags']);router[_0x172b('0x17')](_0x172b('0xd'),auth[_0x172b('0xb')](),interaction[_0x172b('0x18')](_0x172b('0x19'),'whatsappinteraction:update'),controller['update']);router[_0x172b('0x1a')](_0x172b('0xd'),auth[_0x172b('0xb')](),interaction[_0x172b('0x18')](_0x172b('0x19'),_0x172b('0x1b')),controller[_0x172b('0x1c')]);router['delete'](_0x172b('0x15'),auth[_0x172b('0xb')](),controller[_0x172b('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 193d50a..a386671 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9153=['moment','exports','BOOLEAN','STRING','DATE','ENUM','out','sequelize'];(function(_0x1a0eec,_0x393f49){var _0xc546dd=function(_0x4d647c){while(--_0x4d647c){_0x1a0eec['push'](_0x1a0eec['shift']());}};_0xc546dd(++_0x393f49);}(_0x9153,0x1a7));var _0x3915=function(_0xf0b775,_0x5b4f89){_0xf0b775=_0xf0b775-0x0;var _0x1c9165=_0x9153[_0xf0b775];return _0x1c9165;};'use strict';var Sequelize=require(_0x3915('0x0'));var moment=require(_0x3915('0x1'));module[_0x3915('0x2')]={'closed':{'type':Sequelize[_0x3915('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3915('0x4')]},'secondDisposition':{'type':Sequelize[_0x3915('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3915('0x4')]},'phone':{'type':Sequelize[_0x3915('0x4')]},'read1stAt':{'type':Sequelize[_0x3915('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x3915('0x6')]('in',_0x3915('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3915('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x3915('0x6')]('in',_0x3915('0x7')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x8747=['STRING','out','ENUM','sequelize','exports','DATE'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x8747,0xab));var _0x7874=function(_0x3c2d87,_0x623ad){_0x3c2d87=_0x3c2d87-0x0;var _0x142d3c=_0x8747[_0x3c2d87];return _0x142d3c;};'use strict';var Sequelize=require(_0x7874('0x0'));var moment=require('moment');module[_0x7874('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7874('0x2')]},'disposition':{'type':Sequelize[_0x7874('0x3')]},'secondDisposition':{'type':Sequelize[_0x7874('0x3')]},'thirdDisposition':{'type':Sequelize[_0x7874('0x3')]},'note':{'type':Sequelize[_0x7874('0x3')]},'phone':{'type':Sequelize[_0x7874('0x3')]},'read1stAt':{'type':Sequelize[_0x7874('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7874('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7874('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7874('0x5')]('in',_0x7874('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index c7695d4..a112fae 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1009=['u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','keys','compact','isEmpty','WhatsappAccountId','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','WhatsappInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','all','show','params','includeAll','include','merge','options','describe','addMessage','ids','getMessages','WhatsappMessage','WhatsappInteractionId','format','findAll','rows','addTags','setTags','spread','Tag','color','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','CmContact','firstName','lastName','Attachment','Messages','direction','secret','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closed','closedAt','disposition','basename','existsSync','pipe','System','Contact','out','renderFile','.pdf','log','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','then','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','left_join','users'];(function(_0x177eaa,_0x411e1e){var _0x180958=function(_0x22fd94){while(--_0x22fd94){_0x177eaa['push'](_0x177eaa['shift']());}};_0x180958(++_0x411e1e);}(_0x1009,0x185));var _0x9100=function(_0x12a962,_0x569097){_0x12a962=_0x12a962-0x0;var _0x5bb916=_0x1009[_0x12a962];return _0x5bb916;};'use strict';var emlformat=require(_0x9100('0x0'));var rimraf=require(_0x9100('0x1'));var zipdir=require(_0x9100('0x2'));var jsonpatch=require(_0x9100('0x3'));var rp=require(_0x9100('0x4'));var moment=require(_0x9100('0x5'));var BPromise=require(_0x9100('0x6'));var Mustache=require(_0x9100('0x7'));var util=require(_0x9100('0x8'));var path=require(_0x9100('0x9'));var sox=require(_0x9100('0xa'));var csv=require('to-csv');var ejs=require(_0x9100('0xb'));var fs=require('fs');var fs_extra=require(_0x9100('0xc'));var _=require('lodash');var squel=require(_0x9100('0xd'));var crypto=require(_0x9100('0xe'));var jsforce=require(_0x9100('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9100('0x10'));var Papa=require(_0x9100('0x11'));var Redis=require(_0x9100('0x12'));var authService=require(_0x9100('0x13'));var qs=require(_0x9100('0x14'));var as=require(_0x9100('0x15'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9100('0x16'))('api');var utils=require(_0x9100('0x17'));var config=require(_0x9100('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9100('0x19'))['db'];config[_0x9100('0x1a')]=_[_0x9100('0x1b')](config[_0x9100('0x1a')],{'host':_0x9100('0x1c'),'port':0x18eb});var socket=require(_0x9100('0x1d'))(new Redis(config[_0x9100('0x1a')]));require('./whatsappInteraction.socket')[_0x9100('0x1e')](socket);function respondWithStatusCode(_0x4d1a50,_0x2d7309){_0x2d7309=_0x2d7309||0xcc;return function(_0xdaedd2){if(_0xdaedd2){return _0x4d1a50[_0x9100('0x1f')](_0x2d7309);}return _0x4d1a50['status'](_0x2d7309)[_0x9100('0x20')]();};}function respondWithResult(_0x3f7164,_0x46498d){_0x46498d=_0x46498d||0xc8;return function(_0x20d334){if(_0x20d334){return _0x3f7164[_0x9100('0x21')](_0x46498d)[_0x9100('0x22')](_0x20d334);}};}function respondWithFilteredResult(_0x3dcafe,_0x472483){return function(_0x187cd7){if(_0x187cd7){var _0x14dbd2=typeof _0x472483['offset']==='undefined'&&typeof _0x472483[_0x9100('0x23')]===_0x9100('0x24');var _0x320cb3=_0x187cd7[_0x9100('0x25')];var _0x31f12f=_0x14dbd2?0x0:_0x472483[_0x9100('0x26')];var _0x5ef6fd=_0x14dbd2?_0x187cd7[_0x9100('0x25')]:_0x472483[_0x9100('0x26')]+_0x472483['limit'];var _0x5ce922;if(_0x5ef6fd>=_0x320cb3){_0x5ef6fd=_0x320cb3;_0x5ce922=0xc8;}else{_0x5ce922=0xce;}_0x3dcafe[_0x9100('0x21')](_0x5ce922);return _0x3dcafe[_0x9100('0x27')](_0x9100('0x28'),_0x31f12f+'-'+_0x5ef6fd+'/'+_0x320cb3)[_0x9100('0x22')](_0x187cd7);}return null;};}function patchUpdates(_0x320c1f){return function(_0x35e442){try{jsonpatch[_0x9100('0x29')](_0x35e442,_0x320c1f,!![]);}catch(_0x489711){return BPromise['reject'](_0x489711);}return _0x35e442[_0x9100('0x2a')]();};}function saveUpdates(_0xe5225e,_0x492130){return function(_0x21510a){if(_0x21510a){return _0x21510a['update'](_0xe5225e)['then'](function(_0x2292ae){return _0x2292ae;});}return null;};}function removeEntity(_0x584165,_0x14f456){return function(_0x2505e4){if(_0x2505e4){return _0x2505e4['destroy']()[_0x9100('0x2b')](function(){_0x584165[_0x9100('0x21')](0xcc)[_0x9100('0x20')]();});}};}function handleEntityNotFound(_0x3916c3,_0x4f011c){return function(_0x4755e5){if(!_0x4755e5){_0x3916c3[_0x9100('0x1f')](0x194);}return _0x4755e5;};}function handleError(_0x9bbeee,_0x1628dd){_0x1628dd=_0x1628dd||0x1f4;return function(_0x32bd5f){logger[_0x9100('0x2c')](_0x32bd5f[_0x9100('0x2d')]);if(_0x32bd5f[_0x9100('0x2e')]){delete _0x32bd5f[_0x9100('0x2e')];}_0x9bbeee['status'](_0x1628dd)[_0x9100('0x2f')](_0x32bd5f);};}function getInteractionUsers(_0x46d955,_0x11bb2a){return new BPromise(function(_0x18c17d,_0xe553dc){try{if(_0x11bb2a[_0x46d955['id']]){_0x46d955[_0x9100('0x30')]=_['map'](_0x11bb2a[_0x46d955['id']],function(_0x25fb08){return{'id':_0x25fb08['id'],'fullname':_0x25fb08[_0x9100('0x31')]};});}}catch(_0x242e74){_0xe553dc(_0x242e74);}_0x18c17d(_0x46d955);});}function getInteractionTags(_0x494822,_0x2b7b0f){return new BPromise(function(_0x299574,_0x322006){try{if(_0x494822[_0x9100('0x32')]){_0x494822[_0x9100('0x33')]=[];_0x494822[_0x9100('0x32')][_0x9100('0x34')](',')[_0x9100('0x35')](function(_0x59b4b2){_0x494822['Tags'][_0x9100('0x36')](_0x2b7b0f[_0x59b4b2]);});}delete _0x494822['TagIds'];}catch(_0x4e7d50){_0x322006(_0x4e7d50);}_0x299574(_0x494822);});}function updateWhatsappInteraction(_0xeb58d8,_0x2c8e6e,_0x2d82cf){return new BPromise(function(_0x5d5b44,_0x355b19){return getInteractionUsers(_0xeb58d8,_0x2d82cf)[_0x9100('0x2b')](function(_0x3c5a7d){return getInteractionTags(_0x3c5a7d,_0x2c8e6e);})[_0x9100('0x2b')](function(_0x59789c){_0x5d5b44(_0x59789c);})[_0x9100('0x37')](function(_0xa0cf08){_0x355b19(_0xa0cf08);});});}exports[_0x9100('0x38')]=function(_0x50c470,_0x57d8ea){var _0x4faff7={},_0x17c5bd={},_0x1fc311={'count':0x0,'rows':[]};var _0x1163ee=_['map'](db['WhatsappInteraction'][_0x9100('0x39')],function(_0x19b5b6){return{'name':_0x19b5b6[_0x9100('0x3a')],'type':_0x19b5b6[_0x9100('0x3b')][_0x9100('0x3c')]};});_0x17c5bd[_0x9100('0x3d')]=_[_0x9100('0x3e')](_0x1163ee,_0x9100('0x2e'));_0x17c5bd[_0x9100('0x3f')]=_['keys'](_0x50c470['query']);_0x17c5bd[_0x9100('0x40')]=_[_0x9100('0x41')](_0x17c5bd[_0x9100('0x3d')],_0x17c5bd['query']);_0x4faff7['attributes']=_[_0x9100('0x41')](_0x17c5bd[_0x9100('0x3d')],qs[_0x9100('0x42')](_0x50c470[_0x9100('0x3f')]['fields']));_0x4faff7[_0x9100('0x43')]=_0x4faff7[_0x9100('0x43')][_0x9100('0x44')]?_0x4faff7[_0x9100('0x43')]:_0x17c5bd[_0x9100('0x3d')];if(!_0x50c470['query'][_0x9100('0x45')](_0x9100('0x46'))){_0x4faff7[_0x9100('0x23')]=qs['limit'](_0x50c470['query']['limit']);_0x4faff7['offset']=qs[_0x9100('0x26')](_0x50c470[_0x9100('0x3f')][_0x9100('0x26')]);}_0x4faff7['order']=qs[_0x9100('0x47')](_0x50c470[_0x9100('0x3f')]['sort']);_0x4faff7[_0x9100('0x48')]=qs['filters'](_[_0x9100('0x49')](_0x50c470[_0x9100('0x3f')],_0x17c5bd['filters']),_0x1163ee);var _0x785d32=[];var _0x55bff2=squel[_0x9100('0x4a')]()[_0x9100('0x4b')]('id')[_0x9100('0x4b')]('name')['field']('color')[_0x9100('0x4c')](_0x9100('0x4d'));var _0x211235=squel[_0x9100('0x4a')]()['field'](_0x9100('0x4e'))[_0x9100('0x4b')](_0x9100('0x4f'))[_0x9100('0x4b')](_0x9100('0x50'))[_0x9100('0x4c')]('user_has_whatsapp_interactions','ui')[_0x9100('0x51')](_0x9100('0x52'),'u',_0x9100('0x53'));var _0x4017a1=squel[_0x9100('0x4a')]()[_0x9100('0x4c')](_0x9100('0x54'),'i')['left_join'](_0x9100('0x55'),'c',_0x9100('0x56'))[_0x9100('0x51')]('users','o','o.id\x20=\x20i.UserId')['left_join'](_0x9100('0x57'),'a',_0x9100('0x58'))[_0x9100('0x51')]('whatsapp_messages','me',_0x9100('0x59'))[_0x9100('0x51')](_0x9100('0x5a'),'it',_0x9100('0x5b'))[_0x9100('0x51')](_0x9100('0x4d'),'t',_0x9100('0x5c'));var _0x4c0822=squel['expr']();var _0x54f8de=[];var _0x36250b=squel[_0x9100('0x5d')]();var _0xee6850;if(_0x50c470[_0x9100('0x3f')][_0x9100('0x5e')]){_0xee6850=as[_0x9100('0x5f')](_0x50c470['query'][_0x9100('0x5e')]);var _0x2ec894=_0xee6850[_0x9100('0x60')];for(var _0x412256=0x0;_0x412256<_0xee6850[_0x9100('0x61')][_0x9100('0x44')];_0x412256++){var _0x2892a9=_0xee6850[_0x9100('0x61')][_0x412256];var _0x589727='i';var _0xc58fbd=_[_0x9100('0x62')](_0x1163ee,[_0x9100('0x2e'),_0x2892a9[_0x9100('0x4b')]]);if(!_0xc58fbd){switch(_0x2892a9[_0x9100('0x4b')]){case _0x9100('0x63'):if(_0x2892a9[_0x9100('0x64')]==0x1){_0x4017a1['having']('`'+_0x2892a9[_0x9100('0x4b')]+_0x9100('0x65'));}else{_0x4017a1[_0x9100('0x66')]('`'+_0x2892a9[_0x9100('0x4b')]+_0x9100('0x67'));}break;case'Contact':if(_0x2892a9[_0x9100('0x68')]===_0x9100('0x69')){if(_0x2892a9[_0x9100('0x64')][_0x9100('0x34')]('\x20')[_0x9100('0x44')]>0x1){_0x4c0822[_0x2ec894](_0x9100('0x6a'),qs[_0x9100('0x6b')](_0x2892a9[_0x9100('0x64')]),null);}else{var _0x7ff74='%'+_0x2892a9[_0x9100('0x64')]+'%';_0x4c0822[_0x2ec894]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x7ff74,_0x7ff74,_0x7ff74);}}else{_0xc58fbd=_['find'](_0x1163ee,[_0x9100('0x2e'),_0x9100('0x6c')]);_0x2892a9[_0x9100('0x4b')]=_0x9100('0x6c');_0x4a11e1=as['buildExpression'](_0x589727,_0xc58fbd['type'],_0x2892a9);_0x4c0822[_0x2ec894](_0x4a11e1[_0x9100('0x6d')],_0x4a11e1[_0x9100('0x64')][_0x9100('0x6e')],_0x4a11e1['value'][_0x9100('0x20')]);}break;case'Tag':var _0x423959=_0x2892a9[_0x9100('0x64')][_0x9100('0x34')](',')['map'](function(_0x113837){return Number(_0x113837);});_0x423959[_0x9100('0x35')](function(_0x455829){_0x36250b['or'](_0x9100('0x6f'),'%,'+_0x455829+',%');});_0x54f8de=_['union'](_0x54f8de,_0x423959);break;case _0x9100('0x70'):if(_0x2892a9['operator']===_0x9100('0x69')){_0x4c0822[_0x2ec894](_0x9100('0x71'),'%'+_0x2892a9[_0x9100('0x64')]+'%',null);}else{_0xc58fbd=_[_0x9100('0x62')](_0x1163ee,[_0x9100('0x2e'),_0x9100('0x72')]);_0x2892a9[_0x9100('0x4b')]=_0x9100('0x72');_0x4a11e1=as[_0x9100('0x73')](_0x589727,_0xc58fbd[_0x9100('0x3b')],_0x2892a9);_0x4c0822[_0x2ec894](_0x4a11e1[_0x9100('0x6d')],_0x4a11e1[_0x9100('0x64')][_0x9100('0x6e')],_0x4a11e1[_0x9100('0x64')][_0x9100('0x20')]);}break;case _0x9100('0x74'):_0x4a11e1=as[_0x9100('0x73')]('me',null,_0x2892a9);_0x4c0822[_0x2ec894](_0x4a11e1[_0x9100('0x6d')],_0x4a11e1[_0x9100('0x64')]['start'],_0x4a11e1[_0x9100('0x64')][_0x9100('0x20')]);break;}}else{var _0x4a11e1=as['buildExpression'](_0x589727,_0xc58fbd[_0x9100('0x3b')],_0x2892a9);_0x4c0822[_0x2ec894](_0x4a11e1[_0x9100('0x6d')],_0x4a11e1[_0x9100('0x64')]['start'],_0x4a11e1[_0x9100('0x64')][_0x9100('0x20')]);}}}else{var _0x512d3e=_(_0x50c470[_0x9100('0x3f')])[_0x9100('0x75')]()[_0x9100('0x3e')](function(_0x27398e){return _['some'](_0x1163ee,[_0x9100('0x2e'),_0x27398e])?_0x27398e:undefined;})[_0x9100('0x76')]()[_0x9100('0x64')]();if(!_[_0x9100('0x77')](_0x512d3e)){_0x512d3e['forEach'](function(_0x141063){if(_0x141063===_0x9100('0x78')){_0x4017a1[_0x9100('0x48')]('i.WhatsappAccountId\x20IN\x20?',[]['concat'](_0x50c470['query'][_0x141063]));}else if(_0x141063===_0x9100('0x79')){var _0x2a021b=JSON[_0x9100('0x7a')](_0x50c470['query'][_0x141063])[_0x9100('0x7b')];var _0x501aae=JSON[_0x9100('0x7a')](_0x50c470[_0x9100('0x3f')][_0x141063])[_0x9100('0x7c')];_0x4017a1[_0x9100('0x48')](_0x9100('0x7d'),_0x2a021b,_0x501aae);}else{if(_0x50c470[_0x9100('0x3f')][_0x141063]===_0x9100('0x7e')){_0x4017a1[_0x9100('0x48')]('i.'+_0x141063+_0x9100('0x7f'));}else{_0x4017a1[_0x9100('0x48')]('i.'+_0x141063+_0x9100('0x80'),_0x50c470['query'][_0x141063]);}}});}if(_0x50c470[_0x9100('0x3f')][_0x9100('0x81')]){if(_0x50c470[_0x9100('0x3f')][_0x9100('0x81')]==0x1){_0x4017a1[_0x9100('0x66')](_0x9100('0x82'));}else{_0x4017a1[_0x9100('0x66')](_0x9100('0x83'));}}if(_0x50c470[_0x9100('0x3f')][_0x9100('0x84')]){_0x54f8de=_[_0x9100('0x85')](_0x50c470[_0x9100('0x3f')][_0x9100('0x84')])?_0x50c470[_0x9100('0x3f')]['tag']:new Array(_0x50c470[_0x9100('0x3f')][_0x9100('0x84')]);_0x54f8de[_0x9100('0x35')](function(_0x36d06f){_0x36250b['or'](_0x9100('0x6f'),'%,'+_0x36d06f+',%');});}if(_0x50c470['query'][_0x9100('0x86')]){var _0x296376=_0x50c470[_0x9100('0x3f')]['filter'][_0x9100('0x87')]('\x5c','\x5c\x5c')[_0x9100('0x87')](/'/g,'\x27\x27');if(qs[_0x9100('0x88')](_0x296376)){_0x4c0822['or'](_0x9100('0x89'),_0x296376+'%')['or']('i.phone\x20LIKE\x20?',_0x296376+'%');}else{_0x4c0822['or'](_0x9100('0x8a'),qs[_0x9100('0x6b')](_0x296376))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x296376+'%');}}}_0x4017a1['where'](_0x4c0822);_0x4017a1[_0x9100('0x8b')](_0x9100('0x8c'));var _0x1ae02c={'type':db[_0x9100('0x8d')]['QueryTypes'][_0x9100('0x8e')],'raw':!![]};var _0x53b9ba=_0x4017a1[_0x9100('0x8f')]();_0x53b9ba[_0x9100('0x4b')](_0x9100('0x8c'));_0x53b9ba[_0x9100('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x4faff7[_0x9100('0x90')]){_0x4faff7[_0x9100('0x90')][_0x9100('0x35')](function(_0x1d1d8a){var _0x5079aa=_0x1d1d8a[0x0]===_0x9100('0x91')?_0x1d1d8a[0x0]:'i.'+_0x1d1d8a[0x0];_0x4017a1['order'](_0x5079aa,_0x1d1d8a[0x1]===_0x9100('0x92')?![]:!![]);});}if(!_[_0x9100('0x77')](_0x54f8de)){_0x4017a1[_0x9100('0x66')](_0x36250b);_0x53b9ba[_0x9100('0x48')](_0x9100('0x93'),_0x54f8de);}BPromise[_0x9100('0x94')]()['then'](function(){if(!_0xee6850){if(_0x50c470[_0x9100('0x3f')][_0x9100('0x78')])return;_0x53b9ba[_0x9100('0x48')](_0x9100('0x95'));_0x4017a1['where'](_0x9100('0x95'));return;}if(_0x50c470[_0x9100('0x96')][_0x9100('0x97')]!==_0x9100('0x98'))return;return _0x50c470['user'][_0x9100('0x99')]({'attributes':['id'],'raw':!![]})[_0x9100('0x2b')](function(_0x59af21){if(_[_0x9100('0x77')](_0x59af21)){_0x53b9ba[_0x9100('0x48')](_0x9100('0x9a'));_0x4017a1[_0x9100('0x48')](_0x9100('0x9a'));}else{_0x53b9ba[_0x9100('0x48')](_0x9100('0x9b'),_[_0x9100('0x3e')](_0x59af21,'id'));_0x4017a1['where'](_0x9100('0x9b'),_['map'](_0x59af21,'id'));}});})[_0x9100('0x2b')](function(){if(_0x50c470[_0x9100('0x96')][_0x9100('0x97')]==='agent'&&!_0xee6850&&!_0x50c470[_0x9100('0x3f')][_0x9100('0x78')])return[];return db[_0x9100('0x9c')][_0x9100('0x3f')](_0x53b9ba[_0x9100('0x9d')](),_0x1ae02c);})['then'](function(_0x460385){_0x1fc311[_0x9100('0x25')]=_0x460385['length'];if(_0x1fc311[_0x9100('0x25')]===0x0)return[];return db[_0x9100('0x9c')][_0x9100('0x3f')](_0x55bff2[_0x9100('0x9d')](),_0x1ae02c)[_0x9100('0x2b')](function(_0xa9dbcc){_0x785d32=_[_0x9100('0x9e')](_0xa9dbcc,'id');_0x1ae02c=_['merge'](_0x1ae02c,{'model':db[_0x9100('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x50c470[_0x9100('0x3f')][_0x9100('0x42')]){_0x4faff7[_0x9100('0x43')][_0x9100('0x35')](function(_0x1449c0){_0x4017a1['field']('i.'+_0x1449c0);});}else{_0x4017a1[_0x9100('0x4b')](_0x9100('0xa0'),_0x9100('0x63'));_0x4017a1[_0x9100('0x4b')](_0x9100('0xa1'),'Account.key');_0x4017a1[_0x9100('0x4b')](_0x9100('0xa2'),'Account.mandatoryDisposition');_0x4017a1[_0x9100('0x4b')](_0x9100('0xa3'),_0x9100('0x91'));_0x4017a1['field'](_0x9100('0xa4'));_0x4017a1[_0x9100('0x4b')](_0x9100('0xa5'),_0x9100('0xa6'));_0x4017a1[_0x9100('0x4b')](_0x9100('0xa7'),_0x9100('0xa8'));_0x4017a1[_0x9100('0x4b')](_0x9100('0xa9'),_0x9100('0xaa'));_0x4017a1[_0x9100('0x4b')](_0x9100('0xab'),'Contact.phone');_0x4017a1[_0x9100('0x4b')](_0x9100('0xac'),'Contact.mobile');_0x4017a1[_0x9100('0x4b')](_0x9100('0xad'),_0x9100('0xae'));_0x4017a1[_0x9100('0x4b')](_0x9100('0xaf'),_0x9100('0xb0'));_0x4017a1[_0x9100('0x4b')](_0x9100('0xb1'),_0x9100('0xb2'));_0x4017a1[_0x9100('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9100('0x32'));}if(_0x4faff7['limit'])_0x4017a1[_0x9100('0x23')](_0x4faff7[_0x9100('0x23')]);if(_0x4faff7['offset'])_0x4017a1[_0x9100('0x26')](_0x4faff7[_0x9100('0x26')]);return db[_0x9100('0x9c')][_0x9100('0x3f')](_0x4017a1[_0x9100('0x9d')](),_0x1ae02c);})[_0x9100('0x2b')](function(_0xad4f3e){if(_0xad4f3e[_0x9100('0x44')]>0x0)_0x211235[_0x9100('0x48')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0xad4f3e,'id'));return db[_0x9100('0x9c')][_0x9100('0x3f')](_0x211235[_0x9100('0x9d')](),_0x1ae02c)[_0x9100('0x2b')](function(_0x2e28cb){var _0x49754b=_[_0x9100('0xb3')](_0x2e28cb,'WhatsappInteractionId');var _0x3be406=[];_0xad4f3e[_0x9100('0x35')](function(_0x3c7c54){_0x3be406[_0x9100('0x36')](updateWhatsappInteraction(_0x3c7c54,_0x785d32,_0x49754b));});return BPromise[_0x9100('0xb4')](_0x3be406);});});})[_0x9100('0x2b')](function(_0x2bfc66){_0x1fc311['rows']=_0x2bfc66;return _0x1fc311;})[_0x9100('0x2b')](respondWithFilteredResult(_0x57d8ea,_0x4faff7))[_0x9100('0x37')](handleError(_0x57d8ea,null));};exports[_0x9100('0xb5')]=function(_0x123f72,_0x5257ba){var _0x1b8881={'raw':![],'where':{'id':_0x123f72[_0x9100('0xb6')]['id']}},_0x59d508={};_0x59d508[_0x9100('0x3d')]=_[_0x9100('0x75')](db[_0x9100('0x9f')][_0x9100('0x39')]);_0x59d508[_0x9100('0x3f')]=_[_0x9100('0x75')](_0x123f72[_0x9100('0x3f')]);_0x59d508['filters']=_['intersection'](_0x59d508[_0x9100('0x3d')],_0x59d508['query']);_0x1b8881[_0x9100('0x43')]=_[_0x9100('0x41')](_0x59d508[_0x9100('0x3d')],qs[_0x9100('0x42')](_0x123f72[_0x9100('0x3f')]['fields']));_0x1b8881[_0x9100('0x43')]=_0x1b8881[_0x9100('0x43')]['length']?_0x1b8881[_0x9100('0x43')]:_0x59d508[_0x9100('0x3d')];if(_0x123f72[_0x9100('0x3f')][_0x9100('0xb7')]){_0x1b8881[_0x9100('0xb8')]=[{'all':!![]}];}_0x1b8881=_[_0x9100('0xb9')]({},_0x1b8881,_0x123f72[_0x9100('0xba')]);return db[_0x9100('0x9f')][_0x9100('0x62')](_0x1b8881)['then'](handleEntityNotFound(_0x5257ba,null))['then'](respondWithResult(_0x5257ba,null))['catch'](handleError(_0x5257ba,null));};exports['create']=function(_0x1df1f5,_0x1a483c){return db[_0x9100('0x9f')]['create'](_0x1df1f5[_0x9100('0x74')],{})['then'](respondWithResult(_0x1a483c,0xc9))['catch'](handleError(_0x1a483c,null));};exports['update']=function(_0x3ac563,_0x1e71b){if(_0x3ac563[_0x9100('0x74')]['id']){delete _0x3ac563[_0x9100('0x74')]['id'];}return db[_0x9100('0x9f')]['find']({'where':{'id':_0x3ac563[_0x9100('0xb6')]['id']}})[_0x9100('0x2b')](handleEntityNotFound(_0x1e71b,null))[_0x9100('0x2b')](saveUpdates(_0x3ac563[_0x9100('0x74')],null))[_0x9100('0x2b')](respondWithResult(_0x1e71b,null))[_0x9100('0x37')](handleError(_0x1e71b,null));};exports['destroy']=function(_0x4f27be,_0x7b240){return db[_0x9100('0x9f')][_0x9100('0x62')]({'where':{'id':_0x4f27be[_0x9100('0xb6')]['id']}})['then'](handleEntityNotFound(_0x7b240,null))[_0x9100('0x2b')](removeEntity(_0x7b240,null))[_0x9100('0x37')](handleError(_0x7b240,null));};exports[_0x9100('0xbb')]=function(_0x1f09a9,_0x3e4f53){return db[_0x9100('0x9f')][_0x9100('0xbb')]()[_0x9100('0x2b')](respondWithResult(_0x3e4f53,null))[_0x9100('0x37')](handleError(_0x3e4f53,null));};exports[_0x9100('0xbc')]=function(_0x492886,_0x39afa4,_0x58b40c){return db['WhatsappMessage'][_0x9100('0x62')]({'where':{'id':_0x492886['params']['id']}})[_0x9100('0x2b')](handleEntityNotFound(_0x39afa4,null))[_0x9100('0x2b')](function(_0x2d8547){if(_0x2d8547){return _0x2d8547['addMessage'](_0x492886[_0x9100('0x74')][_0x9100('0xbd')],_['omit'](_0x492886[_0x9100('0x74')],[_0x9100('0xbd'),'id'])||{});}})[_0x9100('0x2b')](respondWithResult(_0x39afa4,null))['catch'](handleError(_0x39afa4,null));};exports[_0x9100('0xbe')]=function(_0x30fdca,_0x5e5138,_0x4f99c4){var _0x3f315b={'raw':![],'where':{}};var _0x5b234b={};var _0x303367={'count':0x0,'rows':[]};return db[_0x9100('0x9f')]['findOne']({'where':{'id':_0x30fdca[_0x9100('0xb6')]['id']}})[_0x9100('0x2b')](handleEntityNotFound(_0x5e5138,null))[_0x9100('0x2b')](function(_0x491fc7){if(_0x491fc7){_0x5b234b['model']=_[_0x9100('0x75')](db[_0x9100('0xbf')][_0x9100('0x39')]);_0x5b234b[_0x9100('0x3f')]=_['keys'](_0x30fdca[_0x9100('0x3f')]);_0x5b234b['filters']=_['intersection'](_0x5b234b['model'],_0x5b234b['query']);_0x3f315b[_0x9100('0x43')]=_['intersection'](_0x5b234b[_0x9100('0x3d')],qs[_0x9100('0x42')](_0x30fdca['query']['fields']));_0x3f315b[_0x9100('0x43')]=_0x3f315b[_0x9100('0x43')][_0x9100('0x44')]?_0x3f315b['attributes']:_0x5b234b['model'];if(!_0x30fdca[_0x9100('0x3f')][_0x9100('0x45')](_0x9100('0x46'))){_0x3f315b[_0x9100('0x23')]=qs[_0x9100('0x23')](_0x30fdca[_0x9100('0x3f')][_0x9100('0x23')]);_0x3f315b[_0x9100('0x26')]=qs[_0x9100('0x26')](_0x30fdca[_0x9100('0x3f')]['offset']);}_0x3f315b['order']=qs['sort'](_0x30fdca[_0x9100('0x3f')][_0x9100('0x47')]);_0x3f315b['where']=qs[_0x9100('0x40')](_['pick'](_0x30fdca[_0x9100('0x3f')],_0x5b234b[_0x9100('0x40')]));_0x3f315b[_0x9100('0x48')][_0x9100('0xc0')]=_0x491fc7['id'];if(_0x30fdca[_0x9100('0x3f')][_0x9100('0x86')]){_0x3f315b['where']=_['merge'](_0x3f315b[_0x9100('0x48')],{'$or':_[_0x9100('0x3e')](_0x3f315b[_0x9100('0x43')],function(_0x3ba560){var _0x5b93f0={};_0x5b93f0[_0x3ba560]={'$like':'%'+_0x30fdca[_0x9100('0x3f')][_0x9100('0x86')]+'%'};return _0x5b93f0;})});}if(_0x30fdca[_0x9100('0x3f')][_0x9100('0x7b')]){var _0x54a7df=_0x30fdca[_0x9100('0x3f')][_0x9100('0x7b')]['split'](',');var _0x32ac94={};_0x32ac94[_0x54a7df[0x0]]={'$gte':moment(_0x54a7df[0x1])[_0x9100('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3f315b['where']=_[_0x9100('0xb9')](_0x3f315b[_0x9100('0x48')],_0x32ac94);}_0x3f315b=_[_0x9100('0xb9')]({},_0x3f315b,_0x30fdca[_0x9100('0xba')]);return db['WhatsappMessage'][_0x9100('0x25')]({'where':_0x3f315b[_0x9100('0x48')]})[_0x9100('0x2b')](function(_0x4fc432){_0x303367[_0x9100('0x25')]=_0x4fc432;if(_0x30fdca[_0x9100('0x3f')][_0x9100('0xb7')]){_0x3f315b[_0x9100('0xb8')]=[{'all':!![]}];}return db[_0x9100('0xbf')][_0x9100('0xc2')](_0x3f315b);})['then'](function(_0x30aa37){_0x303367[_0x9100('0xc3')]=_0x30aa37;return _0x303367;});}})['then'](respondWithFilteredResult(_0x5e5138,_0x3f315b))[_0x9100('0x37')](handleError(_0x5e5138,null));};exports[_0x9100('0xc4')]=function(_0x9838cc,_0x4f8f66,_0x337e0f){return db[_0x9100('0x9f')][_0x9100('0x62')]({'where':{'id':_0x9838cc[_0x9100('0xb6')]['id']}})[_0x9100('0x2b')](handleEntityNotFound(_0x4f8f66,null))['then'](function(_0x1a8c5c){if(_0x1a8c5c){return _0x1a8c5c[_0x9100('0xc5')](_0x9838cc[_0x9100('0x74')][_0x9100('0xbd')],_['omit'](_0x9838cc[_0x9100('0x74')],[_0x9100('0xbd'),'id'])||{})[_0x9100('0xc6')](function(){return db[_0x9100('0xc7')][_0x9100('0xc2')]({'attributes':['id',_0x9100('0x2e'),_0x9100('0xc8')],'where':{'id':_0x9838cc['body']['ids']}});})[_0x9100('0x2b')](function(_0x147b5a){socket['emit'](_0x9100('0xc9'),{'id':Number(_0x9838cc[_0x9100('0xb6')]['id']),'tags':_0x147b5a||[]});return{'id':Number(_0x9838cc[_0x9100('0xb6')]['id']),'tags':_0x147b5a||[]};});}})[_0x9100('0x2b')](respondWithResult(_0x4f8f66,null))[_0x9100('0x37')](handleError(_0x4f8f66,null));};exports[_0x9100('0xca')]=function(_0x5a2462,_0x259b5f,_0x4c0683){return db['WhatsappInteraction']['find']({'where':{'id':_0x5a2462[_0x9100('0xb6')]['id']}})[_0x9100('0x2b')](handleEntityNotFound(_0x259b5f,null))[_0x9100('0x2b')](function(_0x151f28){if(_0x151f28){return _0x151f28[_0x9100('0xca')](_0x5a2462[_0x9100('0x3f')][_0x9100('0xbd')]);}})[_0x9100('0x2b')](respondWithStatusCode(_0x259b5f,null))[_0x9100('0x37')](handleError(_0x259b5f,null));};exports[_0x9100('0xcb')]=function(_0x409fd8,_0xdece45){var _0x117dec=moment()[_0x9100('0xcc')]()['toString']();var _0x3f3782=path[_0x9100('0xcd')](config[_0x9100('0xce')],_0x9100('0xcf'),_0x9100('0xd0'),_0x9100('0xd1'));var _0x536b72=path[_0x9100('0xcd')](config[_0x9100('0xce')],'server','files',_0x9100('0xd2'));var _0x5e0361=path[_0x9100('0xcd')](_0x3f3782,_0x117dec);var _0x22bea7=util[_0x9100('0xc1')]('transcript-%d-%s.zip',_0x409fd8[_0x9100('0xb6')]['id'],_0x117dec);var _0x4ff3be=path['join'](_0x3f3782,_0x22bea7);var _0x2b1302=[];_0x2b1302[_0x9100('0x36')]({'model':db['User'],'as':_0x9100('0x70'),'attributes':['id',_0x9100('0x31')],'raw':!![]});_0x2b1302['push']({'model':db[_0x9100('0xd3')],'as':'Contact','attributes':['id',_0x9100('0xd4'),_0x9100('0xd5')],'raw':!![]});if(_0x409fd8[_0x9100('0x3f')][_0x9100('0xd2')]){_0x2b1302[_0x9100('0x36')]({'model':db[_0x9100('0xd6')],'as':_0x9100('0xd6'),'raw':!![]});}var _0x3aeaba=[{'model':db[_0x9100('0xbf')],'as':_0x9100('0xd7'),'attributes':['id',_0x9100('0x74'),'createdAt',_0x9100('0xd8'),_0x9100('0xd9'),'read'],'include':_0x2b1302}];_0x3aeaba[_0x9100('0x36')]({'model':db['WhatsappAccount'],'as':_0x9100('0xda'),'attributes':['id',_0x9100('0x2e')]});_0x3aeaba[_0x9100('0x36')]({'model':db['User'],'as':_0x9100('0xdb'),'attributes':['id',_0x9100('0x31')]});return db['WhatsappInteraction'][_0x9100('0x62')]({'where':{'id':_0x409fd8[_0x9100('0xb6')]['id']},'include':_0x3aeaba})[_0x9100('0x2b')](handleEntityNotFound(_0xdece45,null))[_0x9100('0x2b')](function(_0x5b826a){if(_0x5b826a){var _0x2b464d=_0x5b826a[_0x9100('0xdc')]({'plain':!![]});fs[_0x9100('0xdd')](_0x5e0361);var _0x1b2733={'channel':_0x9100('0xde'),'account':_0x2b464d[_0x9100('0xda')][_0x9100('0x2e')],'agent':_0x2b464d['Owner']?_0x2b464d[_0x9100('0xdb')][_0x9100('0x31')]:_0x9100('0xdf'),'createdAt':moment(_0x2b464d['createdAt'])[_0x9100('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9100('0x9d')](),'closedAt':_0x2b464d[_0x9100('0xe0')]?moment(_0x2b464d[_0x9100('0xe1')])[_0x9100('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9100('0x9d')]():'','disposition':_0x2b464d[_0x9100('0xe2')],'messages':_(_0x2b464d[_0x9100('0xd7')])[_0x9100('0x86')]({'secret':![]})[_0x9100('0x3e')](function(_0x5f0077){if(_0x5f0077['Attachment']){var _0x4456a8=path['join'](_0x536b72,_0x5f0077[_0x9100('0xd6')][_0x9100('0xe3')]);if(fs[_0x9100('0xe4')](_0x4456a8)){fs['createReadStream'](_0x4456a8)[_0x9100('0xe5')](fs['createWriteStream'](path[_0x9100('0xcd')](_0x5e0361,_0x5f0077[_0x9100('0xd6')][_0x9100('0xe3')])));}}return{'date':moment(_0x5f0077[_0x9100('0x79')])[_0x9100('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9100('0x9d')](),'sender':_0x5f0077[_0x9100('0xd8')]==='out'?_0x5f0077['User']?_0x5f0077['User'][_0x9100('0x31')]:_0x9100('0xe6'):_0x5f0077[_0x9100('0xe7')]['firstName']+(_0x5f0077[_0x9100('0xe7')][_0x9100('0xd5')]?'\x20'+_0x5f0077[_0x9100('0xe7')][_0x9100('0xd5')]:''),'body':_0x5f0077['Attachment']?_0x5f0077[_0x9100('0xd6')]['basename']:_0x5f0077[_0x9100('0x74')],'direction':_0x5f0077[_0x9100('0xd8')]===_0x9100('0xe8')?'A':'C','secret':_0x5f0077[_0x9100('0xd9')],'read':_0x5f0077[_0x9100('0x81')],'attachment':_0x5f0077[_0x9100('0xd6')]};})[_0x9100('0x64')]()};return ejs[_0x9100('0xe9')](path['join'](config[_0x9100('0xce')],_0x9100('0xcf'),'views','downloadInteraction.html'),{'interaction':_0x1b2733})[_0x9100('0x2b')](function(_0x27df50){var _0x48b7d1=path[_0x9100('0xcd')](_0x5e0361,'transcript-'+_0x2b464d['id']+'-'+_0x117dec+_0x9100('0xea'));var _0x512a35={'path':_0x48b7d1,'channel':_0x9100('0xde'),'interactionId':_0x2b464d['id']};return pdf['createPdfFromHTML'](_0x27df50,_0x512a35);})['then'](function(){return new BPromise(function(_0x3c903b,_0x1c61c6){zipdir(_0x5e0361,{'saveTo':_0x4ff3be},function(_0x31e8dc,_0x309ee1){if(_0x31e8dc)return _0x1c61c6(_0x31e8dc);return _0x3c903b(_0x309ee1);});})[_0x9100('0x2b')](function(){return new BPromise(function(_0x194341,_0x3f699b){rimraf(_0x5e0361,function(_0x160b21){if(_0x160b21)_0x3f699b(_0x160b21);return _0x194341();});});})[_0x9100('0x2b')](function(){return _0xdece45['download'](_0x4ff3be,_0x22bea7,function(_0x355fb6){if(_0x355fb6){console[_0x9100('0xeb')]('err',_0x355fb6);}else{fs['unlinkSync'](_0x4ff3be);}});});});}else{return _0xdece45[_0x9100('0x1f')](0xc8);}})['catch'](handleError(_0xdece45,null));}; \ No newline at end of file +var _0x0746=['save','destroy','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','WhatsappInteraction','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','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)','getFullTextValue','find','ContactId','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','buildExpression','start','body','some','compact','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','then','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','isEmpty','i.WhatsappAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','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','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','catch','show','includeAll','include','options','create','update','params','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','whatsappInteractionTags:save','removeTags','unix','join','root','files','attachments','transcript-%d-%s.zip','User','CmContact','Attachment','Messages','secret','Account','get','mkdirSync','Owner','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','firstName','lastName','direction','renderFile','views','downloadInteraction.html','transcript-','.pdf','download','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject'];(function(_0x4f6044,_0x9c627b){var _0x12211d=function(_0x1fe5df){while(--_0x1fe5df){_0x4f6044['push'](_0x4f6044['shift']());}};_0x12211d(++_0x9c627b);}(_0x0746,0x1c2));var _0x6074=function(_0x1a0d75,_0xc3143a){_0x1a0d75=_0x1a0d75-0x0;var _0x4efa9e=_0x0746[_0x1a0d75];return _0x4efa9e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6074('0x0'));var zipdir=require(_0x6074('0x1'));var jsonpatch=require(_0x6074('0x2'));var rp=require('request-promise');var moment=require(_0x6074('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6074('0x4'));var util=require(_0x6074('0x5'));var path=require('path');var sox=require(_0x6074('0x6'));var csv=require(_0x6074('0x7'));var ejs=require(_0x6074('0x8'));var fs=require('fs');var fs_extra=require(_0x6074('0x9'));var _=require(_0x6074('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6074('0xb'));var deskjs=require(_0x6074('0xc'));var toCsv=require(_0x6074('0x7'));var querystring=require(_0x6074('0xd'));var Papa=require(_0x6074('0xe'));var Redis=require(_0x6074('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6074('0x10'));var pdf=require(_0x6074('0x11'));var hardwareService=require(_0x6074('0x12'));var logger=require('../../config/logger')(_0x6074('0x13'));var utils=require(_0x6074('0x14'));var config=require(_0x6074('0x15'));var licenseUtil=require(_0x6074('0x16'));var db=require('../../mysqldb')['db'];config[_0x6074('0x17')]=_[_0x6074('0x18')](config['redis'],{'host':_0x6074('0x19'),'port':0x18eb});var socket=require(_0x6074('0x1a'))(new Redis(config[_0x6074('0x17')]));require(_0x6074('0x1b'))[_0x6074('0x1c')](socket);function respondWithStatusCode(_0x196bdb,_0x3aa4fe){_0x3aa4fe=_0x3aa4fe||0xcc;return function(_0x4d9513){if(_0x4d9513){return _0x196bdb[_0x6074('0x1d')](_0x3aa4fe);}return _0x196bdb[_0x6074('0x1e')](_0x3aa4fe)[_0x6074('0x1f')]();};}function respondWithResult(_0xbbb59c,_0x14862a){_0x14862a=_0x14862a||0xc8;return function(_0x4f2b16){if(_0x4f2b16){return _0xbbb59c[_0x6074('0x1e')](_0x14862a)[_0x6074('0x20')](_0x4f2b16);}};}function respondWithFilteredResult(_0x12e6e3,_0x10d7d8){return function(_0x5bed43){if(_0x5bed43){var _0x26852f=typeof _0x10d7d8['offset']===_0x6074('0x21')&&typeof _0x10d7d8['limit']===_0x6074('0x21');var _0x493c54=_0x5bed43[_0x6074('0x22')];var _0x210011=_0x26852f?0x0:_0x10d7d8[_0x6074('0x23')];var _0x5e40e2=_0x26852f?_0x5bed43[_0x6074('0x22')]:_0x10d7d8[_0x6074('0x23')]+_0x10d7d8[_0x6074('0x24')];var _0x132ef0;if(_0x5e40e2>=_0x493c54){_0x5e40e2=_0x493c54;_0x132ef0=0xc8;}else{_0x132ef0=0xce;}_0x12e6e3['status'](_0x132ef0);return _0x12e6e3['set'](_0x6074('0x25'),_0x210011+'-'+_0x5e40e2+'/'+_0x493c54)[_0x6074('0x20')](_0x5bed43);}return null;};}function patchUpdates(_0x1ef22a){return function(_0xb34184){try{jsonpatch[_0x6074('0x26')](_0xb34184,_0x1ef22a,!![]);}catch(_0x3f0828){return BPromise[_0x6074('0x27')](_0x3f0828);}return _0xb34184[_0x6074('0x28')]();};}function saveUpdates(_0x3ba3c8,_0x479852){return function(_0x1280c2){if(_0x1280c2){return _0x1280c2['update'](_0x3ba3c8)['then'](function(_0x339087){return _0x339087;});}return null;};}function removeEntity(_0x2e06aa,_0x1ad167){return function(_0xa9218d){if(_0xa9218d){return _0xa9218d[_0x6074('0x29')]()['then'](function(){_0x2e06aa[_0x6074('0x1e')](0xcc)[_0x6074('0x1f')]();});}};}function handleEntityNotFound(_0x1cdff5,_0xdce56e){return function(_0x25cdfe){if(!_0x25cdfe){_0x1cdff5[_0x6074('0x1d')](0x194);}return _0x25cdfe;};}function handleError(_0x17c1f6,_0x3f4919){_0x3f4919=_0x3f4919||0x1f4;return function(_0x152fdd){logger[_0x6074('0x2a')](_0x152fdd[_0x6074('0x2b')]);if(_0x152fdd[_0x6074('0x2c')]){delete _0x152fdd[_0x6074('0x2c')];}_0x17c1f6['status'](_0x3f4919)[_0x6074('0x2d')](_0x152fdd);};}function getInteractionUsers(_0x108de1,_0x37388b){return new BPromise(function(_0x26d3cd,_0x331e8a){try{if(_0x37388b[_0x108de1['id']]){_0x108de1[_0x6074('0x2e')]=_[_0x6074('0x2f')](_0x37388b[_0x108de1['id']],function(_0x399671){return{'id':_0x399671['id'],'fullname':_0x399671[_0x6074('0x30')]};});}}catch(_0x410bd5){_0x331e8a(_0x410bd5);}_0x26d3cd(_0x108de1);});}function getInteractionTags(_0x3242b0,_0x46fa27){return new BPromise(function(_0x2c21db,_0x600d64){try{if(_0x3242b0[_0x6074('0x31')]){_0x3242b0['Tags']=[];_0x3242b0[_0x6074('0x31')][_0x6074('0x32')](',')[_0x6074('0x33')](function(_0x45c2e0){_0x3242b0[_0x6074('0x34')][_0x6074('0x35')](_0x46fa27[_0x45c2e0]);});}delete _0x3242b0['TagIds'];}catch(_0x3a882d){_0x600d64(_0x3a882d);}_0x2c21db(_0x3242b0);});}function updateWhatsappInteraction(_0x127a42,_0x2374d5,_0x4dc92e){return new BPromise(function(_0x36d562,_0x4d3040){return getInteractionUsers(_0x127a42,_0x4dc92e)['then'](function(_0x29eb57){return getInteractionTags(_0x29eb57,_0x2374d5);})['then'](function(_0x3298fe){_0x36d562(_0x3298fe);})['catch'](function(_0x1a8b94){_0x4d3040(_0x1a8b94);});});}exports['index']=function(_0x35463a,_0x5268ed){var _0x3f2135={},_0x3ac812={},_0x4b8757={'count':0x0,'rows':[]};var _0x3745dc=_['map'](db[_0x6074('0x36')][_0x6074('0x37')],function(_0x509c00){return{'name':_0x509c00['fieldName'],'type':_0x509c00[_0x6074('0x38')][_0x6074('0x39')]};});_0x3ac812[_0x6074('0x3a')]=_[_0x6074('0x2f')](_0x3745dc,'name');_0x3ac812['query']=_[_0x6074('0x3b')](_0x35463a[_0x6074('0x3c')]);_0x3ac812[_0x6074('0x3d')]=_[_0x6074('0x3e')](_0x3ac812['model'],_0x3ac812[_0x6074('0x3c')]);_0x3f2135['attributes']=_[_0x6074('0x3e')](_0x3ac812[_0x6074('0x3a')],qs['fields'](_0x35463a['query'][_0x6074('0x3f')]));_0x3f2135[_0x6074('0x40')]=_0x3f2135[_0x6074('0x40')][_0x6074('0x41')]?_0x3f2135['attributes']:_0x3ac812['model'];if(!_0x35463a[_0x6074('0x3c')][_0x6074('0x42')](_0x6074('0x43'))){_0x3f2135[_0x6074('0x24')]=qs[_0x6074('0x24')](_0x35463a[_0x6074('0x3c')][_0x6074('0x24')]);_0x3f2135[_0x6074('0x23')]=qs[_0x6074('0x23')](_0x35463a[_0x6074('0x3c')]['offset']);}_0x3f2135[_0x6074('0x44')]=qs[_0x6074('0x45')](_0x35463a['query']['sort']);_0x3f2135[_0x6074('0x46')]=qs[_0x6074('0x3d')](_[_0x6074('0x47')](_0x35463a[_0x6074('0x3c')],_0x3ac812[_0x6074('0x3d')]),_0x3745dc);var _0x29c93f=[];var _0x34d72f=squel[_0x6074('0x48')]()[_0x6074('0x49')]('id')[_0x6074('0x49')](_0x6074('0x2c'))['field'](_0x6074('0x4a'))[_0x6074('0x4b')](_0x6074('0x4c'));var _0x58c6a0=squel[_0x6074('0x48')]()['field'](_0x6074('0x4d'))[_0x6074('0x49')](_0x6074('0x4e'))[_0x6074('0x49')](_0x6074('0x4f'))[_0x6074('0x4b')](_0x6074('0x50'),'ui')[_0x6074('0x51')](_0x6074('0x52'),'u',_0x6074('0x53'));var _0x31ba04=squel['select']()[_0x6074('0x4b')](_0x6074('0x54'),'i')[_0x6074('0x51')](_0x6074('0x55'),'c',_0x6074('0x56'))[_0x6074('0x51')]('users','o',_0x6074('0x57'))[_0x6074('0x51')]('whatsapp_accounts','a',_0x6074('0x58'))[_0x6074('0x51')]('whatsapp_messages','me',_0x6074('0x59'))['left_join']('whatsapp_interaction_has_tags','it',_0x6074('0x5a'))['left_join']('tools_tags','t',_0x6074('0x5b'));var _0x338972=squel['expr']();var _0x47e8e5=[];var _0x4b4359=squel[_0x6074('0x5c')]();var _0x2fbdae;if(_0x35463a[_0x6074('0x3c')][_0x6074('0x5d')]){_0x2fbdae=as[_0x6074('0x5e')](_0x35463a[_0x6074('0x3c')][_0x6074('0x5d')]);var _0x572356=_0x2fbdae[_0x6074('0x5f')];for(var _0x2e42c4=0x0;_0x2e42c4<_0x2fbdae[_0x6074('0x60')][_0x6074('0x41')];_0x2e42c4++){var _0x1e4a7d=_0x2fbdae['conditions'][_0x2e42c4];var _0x183c46='i';var _0x33243c=_['find'](_0x3745dc,[_0x6074('0x2c'),_0x1e4a7d[_0x6074('0x49')]]);if(!_0x33243c){switch(_0x1e4a7d[_0x6074('0x49')]){case _0x6074('0x61'):if(_0x1e4a7d[_0x6074('0x62')]==0x1){_0x31ba04[_0x6074('0x63')]('`'+_0x1e4a7d['field']+'`\x20=\x200');}else{_0x31ba04[_0x6074('0x63')]('`'+_0x1e4a7d['field']+_0x6074('0x64'));}break;case _0x6074('0x65'):if(_0x1e4a7d[_0x6074('0x66')]===_0x6074('0x67')){if(_0x1e4a7d[_0x6074('0x62')][_0x6074('0x32')]('\x20')[_0x6074('0x41')]>0x1){_0x338972[_0x572356](_0x6074('0x68'),qs[_0x6074('0x69')](_0x1e4a7d[_0x6074('0x62')]),null);}else{var _0x3cc9af='%'+_0x1e4a7d[_0x6074('0x62')]+'%';_0x338972[_0x572356]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3cc9af,_0x3cc9af,_0x3cc9af);}}else{_0x33243c=_[_0x6074('0x6a')](_0x3745dc,[_0x6074('0x2c'),_0x6074('0x6b')]);_0x1e4a7d['field']=_0x6074('0x6b');_0x47889a=as['buildExpression'](_0x183c46,_0x33243c[_0x6074('0x38')],_0x1e4a7d);_0x338972[_0x572356](_0x47889a[_0x6074('0x6c')],_0x47889a[_0x6074('0x62')]['start'],_0x47889a[_0x6074('0x62')]['end']);}break;case _0x6074('0x6d'):var _0x4446eb=_0x1e4a7d[_0x6074('0x62')]['split'](',')['map'](function(_0x19d7cd){return Number(_0x19d7cd);});_0x4446eb[_0x6074('0x33')](function(_0x440add){_0x4b4359['or'](_0x6074('0x6e'),'%,'+_0x440add+',%');});_0x47e8e5=_[_0x6074('0x6f')](_0x47e8e5,_0x4446eb);break;case'User':if(_0x1e4a7d[_0x6074('0x66')]===_0x6074('0x67')){_0x338972[_0x572356](_0x6074('0x70'),'%'+_0x1e4a7d[_0x6074('0x62')]+'%',null);}else{_0x33243c=_[_0x6074('0x6a')](_0x3745dc,[_0x6074('0x2c'),'UserId']);_0x1e4a7d[_0x6074('0x49')]=_0x6074('0x71');_0x47889a=as[_0x6074('0x72')](_0x183c46,_0x33243c[_0x6074('0x38')],_0x1e4a7d);_0x338972[_0x572356](_0x47889a['text'],_0x47889a[_0x6074('0x62')][_0x6074('0x73')],_0x47889a[_0x6074('0x62')][_0x6074('0x1f')]);}break;case _0x6074('0x74'):_0x47889a=as['buildExpression']('me',null,_0x1e4a7d);_0x338972[_0x572356](_0x47889a[_0x6074('0x6c')],_0x47889a[_0x6074('0x62')]['start'],_0x47889a[_0x6074('0x62')]['end']);break;}}else{var _0x47889a=as['buildExpression'](_0x183c46,_0x33243c[_0x6074('0x38')],_0x1e4a7d);_0x338972[_0x572356](_0x47889a[_0x6074('0x6c')],_0x47889a[_0x6074('0x62')][_0x6074('0x73')],_0x47889a[_0x6074('0x62')]['end']);}}}else{var _0xdf1a6f=_(_0x35463a[_0x6074('0x3c')])[_0x6074('0x3b')]()[_0x6074('0x2f')](function(_0x1f0175){return _[_0x6074('0x75')](_0x3745dc,[_0x6074('0x2c'),_0x1f0175])?_0x1f0175:undefined;})[_0x6074('0x76')]()[_0x6074('0x62')]();if(!_['isEmpty'](_0xdf1a6f)){_0xdf1a6f[_0x6074('0x33')](function(_0x31e42d){if(_0x31e42d===_0x6074('0x77')){_0x31ba04['where'](_0x6074('0x78'),[][_0x6074('0x79')](_0x35463a['query'][_0x31e42d]));}else if(_0x31e42d===_0x6074('0x7a')){var _0x54acc2=JSON['parse'](_0x35463a[_0x6074('0x3c')][_0x31e42d])['$gte'];var _0x2a38b8=JSON[_0x6074('0x7b')](_0x35463a[_0x6074('0x3c')][_0x31e42d])['$lte'];_0x31ba04[_0x6074('0x46')](_0x6074('0x7c'),_0x54acc2,_0x2a38b8);}else{if(_0x35463a[_0x6074('0x3c')][_0x31e42d]===_0x6074('0x7d')){_0x31ba04[_0x6074('0x46')]('i.'+_0x31e42d+_0x6074('0x7e'));}else{_0x31ba04['where']('i.'+_0x31e42d+_0x6074('0x7f'),_0x35463a['query'][_0x31e42d]);}}});}if(_0x35463a[_0x6074('0x3c')]['read']){if(_0x35463a[_0x6074('0x3c')][_0x6074('0x80')]==0x1){_0x31ba04[_0x6074('0x63')](_0x6074('0x81'));}else{_0x31ba04[_0x6074('0x63')](_0x6074('0x82'));}}if(_0x35463a[_0x6074('0x3c')][_0x6074('0x83')]){_0x47e8e5=_[_0x6074('0x84')](_0x35463a[_0x6074('0x3c')][_0x6074('0x83')])?_0x35463a['query'][_0x6074('0x83')]:new Array(_0x35463a[_0x6074('0x3c')][_0x6074('0x83')]);_0x47e8e5[_0x6074('0x33')](function(_0x387989){_0x4b4359['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x387989+',%');});}if(_0x35463a[_0x6074('0x3c')]['filter']){var _0x2c74e9=_0x35463a[_0x6074('0x3c')][_0x6074('0x85')]['replace']('\x5c','\x5c\x5c')[_0x6074('0x86')](/'/g,'\x27\x27');if(qs[_0x6074('0x87')](_0x2c74e9)){_0x338972['or'](_0x6074('0x88'),_0x2c74e9+'%')['or'](_0x6074('0x89'),_0x2c74e9+'%');}else{_0x338972['or'](_0x6074('0x8a'),qs[_0x6074('0x69')](_0x2c74e9))['or'](_0x6074('0x8b'),_0x2c74e9+'%');}}}_0x31ba04[_0x6074('0x46')](_0x338972);_0x31ba04[_0x6074('0x8c')]('i.id');var _0x1ac6df={'type':db[_0x6074('0x8d')][_0x6074('0x8e')][_0x6074('0x8f')],'raw':!![]};var _0x5a095c=_0x31ba04[_0x6074('0x90')]();_0x5a095c[_0x6074('0x49')]('i.id');_0x5a095c[_0x6074('0x49')](_0x6074('0x91'),_0x6074('0x61'));if(_0x3f2135[_0x6074('0x44')]){_0x3f2135[_0x6074('0x44')][_0x6074('0x33')](function(_0x40ad47){var _0x4a42bc=_0x40ad47[0x0]===_0x6074('0x92')?_0x40ad47[0x0]:'i.'+_0x40ad47[0x0];_0x31ba04[_0x6074('0x44')](_0x4a42bc,_0x40ad47[0x1]===_0x6074('0x93')?![]:!![]);});}if(!_['isEmpty'](_0x47e8e5)){_0x31ba04[_0x6074('0x63')](_0x4b4359);_0x5a095c[_0x6074('0x46')](_0x6074('0x94'),_0x47e8e5);}BPromise[_0x6074('0x95')]()[_0x6074('0x96')](function(){if(!_0x2fbdae){if(_0x35463a[_0x6074('0x3c')][_0x6074('0x77')])return;_0x5a095c[_0x6074('0x46')](_0x6074('0x97'));_0x31ba04[_0x6074('0x46')](_0x6074('0x97'));return;}if(_0x35463a[_0x6074('0x98')][_0x6074('0x99')]!==_0x6074('0x9a'))return;return _0x35463a['user']['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x6074('0x96')](function(_0x3b67be){if(_[_0x6074('0x9b')](_0x3b67be)){_0x5a095c['where'](_0x6074('0x9c'));_0x31ba04['where'](_0x6074('0x9c'));}else{_0x5a095c['where'](_0x6074('0x78'),_[_0x6074('0x2f')](_0x3b67be,'id'));_0x31ba04[_0x6074('0x46')](_0x6074('0x78'),_['map'](_0x3b67be,'id'));}});})[_0x6074('0x96')](function(){if(_0x35463a[_0x6074('0x98')][_0x6074('0x99')]===_0x6074('0x9a')&&!_0x2fbdae&&!_0x35463a[_0x6074('0x3c')][_0x6074('0x77')])return[];return db['sequelize'][_0x6074('0x3c')](_0x5a095c[_0x6074('0x9d')](),_0x1ac6df);})[_0x6074('0x96')](function(_0x1c384f){_0x4b8757[_0x6074('0x22')]=_0x1c384f['length'];if(_0x4b8757[_0x6074('0x22')]===0x0)return[];return db[_0x6074('0x9e')][_0x6074('0x3c')](_0x34d72f[_0x6074('0x9d')](),_0x1ac6df)[_0x6074('0x96')](function(_0x5b1bbd){_0x29c93f=_[_0x6074('0x9f')](_0x5b1bbd,'id');_0x1ac6df=_[_0x6074('0xa0')](_0x1ac6df,{'model':db[_0x6074('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x35463a[_0x6074('0x3c')]['fields']){_0x3f2135[_0x6074('0x40')]['forEach'](function(_0x571e0b){_0x31ba04['field']('i.'+_0x571e0b);});}else{_0x31ba04[_0x6074('0x49')](_0x6074('0x91'),_0x6074('0x61'));_0x31ba04[_0x6074('0x49')]('a.key',_0x6074('0xa1'));_0x31ba04[_0x6074('0x49')](_0x6074('0xa2'),_0x6074('0xa3'));_0x31ba04['field'](_0x6074('0xa4'),_0x6074('0x92'));_0x31ba04[_0x6074('0x49')]('i.*');_0x31ba04[_0x6074('0x49')](_0x6074('0xa5'),_0x6074('0xa6'));_0x31ba04[_0x6074('0x49')](_0x6074('0xa7'),_0x6074('0xa8'));_0x31ba04[_0x6074('0x49')](_0x6074('0xa9'),_0x6074('0xaa'));_0x31ba04[_0x6074('0x49')](_0x6074('0xab'),_0x6074('0xac'));_0x31ba04[_0x6074('0x49')](_0x6074('0xad'),_0x6074('0xae'));_0x31ba04['field'](_0x6074('0xaf'),_0x6074('0xb0'));_0x31ba04[_0x6074('0x49')](_0x6074('0xb1'),_0x6074('0xb2'));_0x31ba04['field'](_0x6074('0xb3'),'Owner.internal');_0x31ba04[_0x6074('0x49')](_0x6074('0xb4'),_0x6074('0x31'));}if(_0x3f2135[_0x6074('0x24')])_0x31ba04[_0x6074('0x24')](_0x3f2135[_0x6074('0x24')]);if(_0x3f2135['offset'])_0x31ba04[_0x6074('0x23')](_0x3f2135[_0x6074('0x23')]);return db[_0x6074('0x9e')][_0x6074('0x3c')](_0x31ba04[_0x6074('0x9d')](),_0x1ac6df);})[_0x6074('0x96')](function(_0x224654){if(_0x224654[_0x6074('0x41')]>0x0)_0x58c6a0['where'](_0x6074('0xb5'),_[_0x6074('0x2f')](_0x224654,'id'));return db[_0x6074('0x9e')][_0x6074('0x3c')](_0x58c6a0['toString'](),_0x1ac6df)[_0x6074('0x96')](function(_0x3206a2){var _0x125118=_['groupBy'](_0x3206a2,'WhatsappInteractionId');var _0xb2138c=[];_0x224654[_0x6074('0x33')](function(_0x2ff83e){_0xb2138c['push'](updateWhatsappInteraction(_0x2ff83e,_0x29c93f,_0x125118));});return BPromise['all'](_0xb2138c);});});})[_0x6074('0x96')](function(_0x2f3e58){_0x4b8757['rows']=_0x2f3e58;return _0x4b8757;})[_0x6074('0x96')](respondWithFilteredResult(_0x5268ed,_0x3f2135))[_0x6074('0xb6')](handleError(_0x5268ed,null));};exports[_0x6074('0xb7')]=function(_0x23bb8c,_0x466252){var _0x170124={'raw':![],'where':{'id':_0x23bb8c['params']['id']}},_0xd66fdc={};_0xd66fdc[_0x6074('0x3a')]=_[_0x6074('0x3b')](db[_0x6074('0x36')][_0x6074('0x37')]);_0xd66fdc['query']=_['keys'](_0x23bb8c['query']);_0xd66fdc['filters']=_['intersection'](_0xd66fdc[_0x6074('0x3a')],_0xd66fdc[_0x6074('0x3c')]);_0x170124[_0x6074('0x40')]=_[_0x6074('0x3e')](_0xd66fdc[_0x6074('0x3a')],qs['fields'](_0x23bb8c[_0x6074('0x3c')][_0x6074('0x3f')]));_0x170124['attributes']=_0x170124[_0x6074('0x40')][_0x6074('0x41')]?_0x170124[_0x6074('0x40')]:_0xd66fdc[_0x6074('0x3a')];if(_0x23bb8c[_0x6074('0x3c')][_0x6074('0xb8')]){_0x170124[_0x6074('0xb9')]=[{'all':!![]}];}_0x170124=_['merge']({},_0x170124,_0x23bb8c[_0x6074('0xba')]);return db[_0x6074('0x36')][_0x6074('0x6a')](_0x170124)['then'](handleEntityNotFound(_0x466252,null))[_0x6074('0x96')](respondWithResult(_0x466252,null))[_0x6074('0xb6')](handleError(_0x466252,null));};exports[_0x6074('0xbb')]=function(_0x7a77fd,_0x3937a6){return db[_0x6074('0x36')][_0x6074('0xbb')](_0x7a77fd[_0x6074('0x74')],{})[_0x6074('0x96')](respondWithResult(_0x3937a6,0xc9))[_0x6074('0xb6')](handleError(_0x3937a6,null));};exports[_0x6074('0xbc')]=function(_0x1c1225,_0x2e5503){if(_0x1c1225[_0x6074('0x74')]['id']){delete _0x1c1225[_0x6074('0x74')]['id'];}return db[_0x6074('0x36')][_0x6074('0x6a')]({'where':{'id':_0x1c1225[_0x6074('0xbd')]['id']}})[_0x6074('0x96')](handleEntityNotFound(_0x2e5503,null))[_0x6074('0x96')](saveUpdates(_0x1c1225[_0x6074('0x74')],null))['then'](respondWithResult(_0x2e5503,null))[_0x6074('0xb6')](handleError(_0x2e5503,null));};exports[_0x6074('0x29')]=function(_0x3c0e68,_0x4833bd){return db[_0x6074('0x36')][_0x6074('0x6a')]({'where':{'id':_0x3c0e68[_0x6074('0xbd')]['id']}})[_0x6074('0x96')](handleEntityNotFound(_0x4833bd,null))[_0x6074('0x96')](removeEntity(_0x4833bd,null))[_0x6074('0xb6')](handleError(_0x4833bd,null));};exports[_0x6074('0xbe')]=function(_0x313197,_0x22ec4b){return db[_0x6074('0x36')][_0x6074('0xbe')]()[_0x6074('0x96')](respondWithResult(_0x22ec4b,null))[_0x6074('0xb6')](handleError(_0x22ec4b,null));};exports[_0x6074('0xbf')]=function(_0x5db381,_0x4d3b9a,_0x19699b){return db[_0x6074('0xc0')][_0x6074('0x6a')]({'where':{'id':_0x5db381[_0x6074('0xbd')]['id']}})['then'](handleEntityNotFound(_0x4d3b9a,null))[_0x6074('0x96')](function(_0x401fe1){if(_0x401fe1){return _0x401fe1['addMessage'](_0x5db381[_0x6074('0x74')][_0x6074('0xc1')],_[_0x6074('0xc2')](_0x5db381[_0x6074('0x74')],[_0x6074('0xc1'),'id'])||{});}})[_0x6074('0x96')](respondWithResult(_0x4d3b9a,null))[_0x6074('0xb6')](handleError(_0x4d3b9a,null));};exports[_0x6074('0xc3')]=function(_0x5874f2,_0xf90278,_0x1319f4){var _0x71dbd0={'raw':![],'where':{}};var _0xf5fa57={};var _0x51bc8d={'count':0x0,'rows':[]};return db[_0x6074('0x36')][_0x6074('0xc4')]({'where':{'id':_0x5874f2['params']['id']}})[_0x6074('0x96')](handleEntityNotFound(_0xf90278,null))[_0x6074('0x96')](function(_0x49ddae){if(_0x49ddae){_0xf5fa57['model']=_[_0x6074('0x3b')](db[_0x6074('0xc0')][_0x6074('0x37')]);_0xf5fa57[_0x6074('0x3c')]=_[_0x6074('0x3b')](_0x5874f2[_0x6074('0x3c')]);_0xf5fa57[_0x6074('0x3d')]=_['intersection'](_0xf5fa57['model'],_0xf5fa57['query']);_0x71dbd0['attributes']=_['intersection'](_0xf5fa57[_0x6074('0x3a')],qs['fields'](_0x5874f2[_0x6074('0x3c')][_0x6074('0x3f')]));_0x71dbd0['attributes']=_0x71dbd0[_0x6074('0x40')]['length']?_0x71dbd0['attributes']:_0xf5fa57[_0x6074('0x3a')];if(!_0x5874f2[_0x6074('0x3c')]['hasOwnProperty'](_0x6074('0x43'))){_0x71dbd0['limit']=qs[_0x6074('0x24')](_0x5874f2[_0x6074('0x3c')][_0x6074('0x24')]);_0x71dbd0['offset']=qs[_0x6074('0x23')](_0x5874f2[_0x6074('0x3c')][_0x6074('0x23')]);}_0x71dbd0[_0x6074('0x44')]=qs[_0x6074('0x45')](_0x5874f2['query'][_0x6074('0x45')]);_0x71dbd0['where']=qs[_0x6074('0x3d')](_[_0x6074('0x47')](_0x5874f2[_0x6074('0x3c')],_0xf5fa57[_0x6074('0x3d')]));_0x71dbd0[_0x6074('0x46')][_0x6074('0xc5')]=_0x49ddae['id'];if(_0x5874f2[_0x6074('0x3c')][_0x6074('0x85')]){_0x71dbd0[_0x6074('0x46')]=_[_0x6074('0xa0')](_0x71dbd0[_0x6074('0x46')],{'$or':_[_0x6074('0x2f')](_0x71dbd0[_0x6074('0x40')],function(_0x4fbbeb){var _0x4fd724={};_0x4fd724[_0x4fbbeb]={'$like':'%'+_0x5874f2[_0x6074('0x3c')]['filter']+'%'};return _0x4fd724;})});}if(_0x5874f2[_0x6074('0x3c')][_0x6074('0xc6')]){var _0x43072e=_0x5874f2[_0x6074('0x3c')][_0x6074('0xc6')]['split'](',');var _0x4b0e5e={};_0x4b0e5e[_0x43072e[0x0]]={'$gte':moment(_0x43072e[0x1])[_0x6074('0xc7')](_0x6074('0xc8'))};_0x71dbd0[_0x6074('0x46')]=_[_0x6074('0xa0')](_0x71dbd0[_0x6074('0x46')],_0x4b0e5e);}_0x71dbd0=_['merge']({},_0x71dbd0,_0x5874f2[_0x6074('0xba')]);return db[_0x6074('0xc0')]['count']({'where':_0x71dbd0[_0x6074('0x46')]})['then'](function(_0x1962e5){_0x51bc8d[_0x6074('0x22')]=_0x1962e5;if(_0x5874f2[_0x6074('0x3c')][_0x6074('0xb8')]){_0x71dbd0[_0x6074('0xb9')]=[{'all':!![]}];}return db[_0x6074('0xc0')][_0x6074('0xc9')](_0x71dbd0);})[_0x6074('0x96')](function(_0xba2e2f){_0x51bc8d[_0x6074('0xca')]=_0xba2e2f;return _0x51bc8d;});}})[_0x6074('0x96')](respondWithFilteredResult(_0xf90278,_0x71dbd0))[_0x6074('0xb6')](handleError(_0xf90278,null));};exports[_0x6074('0xcb')]=function(_0x34ea78,_0x12151d,_0x804824){return db['WhatsappInteraction'][_0x6074('0x6a')]({'where':{'id':_0x34ea78[_0x6074('0xbd')]['id']}})[_0x6074('0x96')](handleEntityNotFound(_0x12151d,null))[_0x6074('0x96')](function(_0x221621){if(_0x221621){return _0x221621[_0x6074('0xcc')](_0x34ea78[_0x6074('0x74')][_0x6074('0xc1')],_[_0x6074('0xc2')](_0x34ea78[_0x6074('0x74')],[_0x6074('0xc1'),'id'])||{})[_0x6074('0xcd')](function(){return db[_0x6074('0x6d')][_0x6074('0xc9')]({'attributes':['id',_0x6074('0x2c'),_0x6074('0x4a')],'where':{'id':_0x34ea78['body'][_0x6074('0xc1')]}});})[_0x6074('0x96')](function(_0x33241c){socket['emit'](_0x6074('0xce'),{'id':Number(_0x34ea78[_0x6074('0xbd')]['id']),'tags':_0x33241c||[]});return{'id':Number(_0x34ea78['params']['id']),'tags':_0x33241c||[]};});}})[_0x6074('0x96')](respondWithResult(_0x12151d,null))[_0x6074('0xb6')](handleError(_0x12151d,null));};exports[_0x6074('0xcf')]=function(_0x43983d,_0x4fa8fc,_0x5d2fc5){return db[_0x6074('0x36')]['find']({'where':{'id':_0x43983d['params']['id']}})[_0x6074('0x96')](handleEntityNotFound(_0x4fa8fc,null))[_0x6074('0x96')](function(_0x2af051){if(_0x2af051){return _0x2af051[_0x6074('0xcf')](_0x43983d[_0x6074('0x3c')][_0x6074('0xc1')]);}})[_0x6074('0x96')](respondWithStatusCode(_0x4fa8fc,null))[_0x6074('0xb6')](handleError(_0x4fa8fc,null));};exports['download']=function(_0x41dbbf,_0xea53af){var _0x1e5714=moment()[_0x6074('0xd0')]()[_0x6074('0x9d')]();var _0x13f8d5=path[_0x6074('0xd1')](config[_0x6074('0xd2')],'server',_0x6074('0xd3'),'tmp');var _0x16a01a=path['join'](config['root'],'server',_0x6074('0xd3'),_0x6074('0xd4'));var _0x224d49=path[_0x6074('0xd1')](_0x13f8d5,_0x1e5714);var _0x53b9b8=util['format'](_0x6074('0xd5'),_0x41dbbf['params']['id'],_0x1e5714);var _0x5966cc=path[_0x6074('0xd1')](_0x13f8d5,_0x53b9b8);var _0x5dec1c=[];_0x5dec1c['push']({'model':db[_0x6074('0xd6')],'as':_0x6074('0xd6'),'attributes':['id',_0x6074('0x30')],'raw':!![]});_0x5dec1c[_0x6074('0x35')]({'model':db[_0x6074('0xd7')],'as':_0x6074('0x65'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x41dbbf[_0x6074('0x3c')][_0x6074('0xd4')]){_0x5dec1c['push']({'model':db[_0x6074('0xd8')],'as':'Attachment','raw':!![]});}var _0x426460=[{'model':db[_0x6074('0xc0')],'as':_0x6074('0xd9'),'attributes':['id',_0x6074('0x74'),_0x6074('0x7a'),'direction',_0x6074('0xda'),_0x6074('0x80')],'include':_0x5dec1c}];_0x426460[_0x6074('0x35')]({'model':db['WhatsappAccount'],'as':_0x6074('0xdb'),'attributes':['id',_0x6074('0x2c')]});_0x426460[_0x6074('0x35')]({'model':db[_0x6074('0xd6')],'as':'Owner','attributes':['id',_0x6074('0x30')]});return db[_0x6074('0x36')][_0x6074('0x6a')]({'where':{'id':_0x41dbbf[_0x6074('0xbd')]['id']},'include':_0x426460})[_0x6074('0x96')](handleEntityNotFound(_0xea53af,null))[_0x6074('0x96')](function(_0x2be6d4){if(_0x2be6d4){var _0x27a6ae=_0x2be6d4[_0x6074('0xdc')]({'plain':!![]});fs[_0x6074('0xdd')](_0x224d49);var _0x537b92={'channel':'Whatsapp','account':_0x27a6ae['Account'][_0x6074('0x2c')],'agent':_0x27a6ae[_0x6074('0xde')]?_0x27a6ae[_0x6074('0xde')]['fullname']:'N.A.','createdAt':moment(_0x27a6ae[_0x6074('0x7a')])[_0x6074('0xc7')](_0x6074('0xc8'))[_0x6074('0x9d')](),'closedAt':_0x27a6ae[_0x6074('0xdf')]?moment(_0x27a6ae[_0x6074('0xe0')])['format'](_0x6074('0xc8'))[_0x6074('0x9d')]():'','disposition':_0x27a6ae[_0x6074('0xe1')],'messages':_(_0x27a6ae['Messages'])[_0x6074('0x85')]({'secret':![]})['map'](function(_0x103e20){if(_0x103e20[_0x6074('0xd8')]){var _0x355828=path[_0x6074('0xd1')](_0x16a01a,_0x103e20[_0x6074('0xd8')][_0x6074('0xe2')]);if(fs[_0x6074('0xe3')](_0x355828)){fs[_0x6074('0xe4')](_0x355828)[_0x6074('0xe5')](fs[_0x6074('0xe6')](path[_0x6074('0xd1')](_0x224d49,_0x103e20[_0x6074('0xd8')][_0x6074('0xe2')])));}}return{'date':moment(_0x103e20[_0x6074('0x7a')])[_0x6074('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6074('0x9d')](),'sender':_0x103e20['direction']===_0x6074('0xe7')?_0x103e20[_0x6074('0xd6')]?_0x103e20[_0x6074('0xd6')][_0x6074('0x30')]:_0x6074('0xe8'):_0x103e20['Contact'][_0x6074('0xe9')]+(_0x103e20[_0x6074('0x65')][_0x6074('0xea')]?'\x20'+_0x103e20['Contact']['lastName']:''),'body':_0x103e20[_0x6074('0xd8')]?_0x103e20[_0x6074('0xd8')][_0x6074('0xe2')]:_0x103e20[_0x6074('0x74')],'direction':_0x103e20[_0x6074('0xeb')]===_0x6074('0xe7')?'A':'C','secret':_0x103e20[_0x6074('0xda')],'read':_0x103e20[_0x6074('0x80')],'attachment':_0x103e20[_0x6074('0xd8')]};})[_0x6074('0x62')]()};return ejs[_0x6074('0xec')](path[_0x6074('0xd1')](config['root'],'server',_0x6074('0xed'),_0x6074('0xee')),{'interaction':_0x537b92})[_0x6074('0x96')](function(_0x1ad996){var _0x307364=path[_0x6074('0xd1')](_0x224d49,_0x6074('0xef')+_0x27a6ae['id']+'-'+_0x1e5714+_0x6074('0xf0'));var _0x234e03={'path':_0x307364,'channel':'Whatsapp','interactionId':_0x27a6ae['id']};return pdf['createPdfFromHTML'](_0x1ad996,_0x234e03);})[_0x6074('0x96')](function(){return new BPromise(function(_0x53f20a,_0x4f5a5b){zipdir(_0x224d49,{'saveTo':_0x5966cc},function(_0x80d712,_0x47101b){if(_0x80d712)return _0x4f5a5b(_0x80d712);return _0x53f20a(_0x47101b);});})[_0x6074('0x96')](function(){return new BPromise(function(_0x467994,_0x18922d){rimraf(_0x224d49,function(_0x294fdc){if(_0x294fdc)_0x18922d(_0x294fdc);return _0x467994();});});})[_0x6074('0x96')](function(){return _0xea53af[_0x6074('0xf1')](_0x5966cc,_0x53b9b8,function(_0x3e08e0){if(_0x3e08e0){console[_0x6074('0xf2')](_0x6074('0xf3'),_0x3e08e0);}else{fs[_0x6074('0xf4')](_0x5966cc);}});});});}else{return _0xea53af[_0x6074('0x1d')](0xc8);}})[_0x6074('0xb6')](handleError(_0xea53af,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index d4a0966..c1e67bd 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2678=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','remove','getUsers'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x2678,0x13b));var _0x8267=function(_0xf1227,_0x40f6e6){_0xf1227=_0xf1227-0x0;var _0x1271d3=_0x2678[_0xf1227];return _0x1271d3;};'use strict';var EventEmitter=require(_0x8267('0x0'));var WhatsappInteraction=require(_0x8267('0x1'))['db'][_0x8267('0x2')];var WhatsappMessage=require(_0x8267('0x1'))['db'][_0x8267('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x8267('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8267('0x5'),'afterDestroy':_0x8267('0x6')};function emitEvent(_0x2f24e1){return function(_0x179d4d,_0x4674b2,_0x56f7cf){_0x179d4d[_0x8267('0x7')]({'attributes':['id'],'raw':!![]})[_0x8267('0x8')](function(_0x44bb76){_0x179d4d[_0x8267('0x9')](_0x8267('0xa'),_0x44bb76[_0x8267('0xb')](function(_0x6337){return{'id':_0x6337['id']};}));return WhatsappMessage[_0x8267('0xc')]({'where':{'WhatsappInteractionId':_0x179d4d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3e3e91){_0x179d4d['setDataValue'](_0x8267('0xd'),_0x3e3e91[_0x8267('0xe')]);WhatsappInteractionEvents[_0x8267('0xf')](_0x2f24e1+':'+_0x179d4d['id'],_0x179d4d);WhatsappInteractionEvents[_0x8267('0xf')](_0x2f24e1,_0x179d4d);_0x56f7cf(null);})[_0x8267('0x10')](_0x56f7cf(null));};}for(var e in events){if(events[_0x8267('0x11')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x8267('0x12')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x3b58=['map','findAll','unreadMessages','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','setDataValue','Users'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b58,0xbc));var _0x83b5=function(_0x2057d3,_0x3b00e2){_0x2057d3=_0x2057d3-0x0;var _0x2723d0=_0x3b58[_0x2057d3];return _0x2723d0;};'use strict';var EventEmitter=require(_0x83b5('0x0'));var WhatsappInteraction=require(_0x83b5('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x83b5('0x1'))['db'][_0x83b5('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x83b5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x83b5('0x4'),'afterDestroy':_0x83b5('0x5')};function emitEvent(_0x1de446){return function(_0x533bf9,_0x1da8de,_0x2607b9){_0x533bf9['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x184cff){_0x533bf9[_0x83b5('0x6')](_0x83b5('0x7'),_0x184cff[_0x83b5('0x8')](function(_0x3bba01){return{'id':_0x3bba01['id']};}));return WhatsappMessage[_0x83b5('0x9')]({'where':{'WhatsappInteractionId':_0x533bf9['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x227d8f){_0x533bf9[_0x83b5('0x6')](_0x83b5('0xa'),_0x227d8f['length']);WhatsappInteractionEvents[_0x83b5('0xb')](_0x1de446+':'+_0x533bf9['id'],_0x533bf9);WhatsappInteractionEvents[_0x83b5('0xb')](_0x1de446,_0x533bf9);_0x2607b9(null);})['catch'](_0x2607b9(null));};}for(var e in events){if(events[_0x83b5('0xc')](e)){var event=events[e];WhatsappInteraction[_0x83b5('0xd')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 9217a90..b0e3979 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2cd=['rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0xf2cd,0x15b));var _0xdf2c=function(_0x118653,_0x50ef26){_0x118653=_0x118653-0x0;var _0xc11fa6=_0xf2cd[_0x118653];return _0xc11fa6;};'use strict';var _=require(_0xdf2c('0x0'));var util=require('util');var logger=require(_0xdf2c('0x1'))(_0xdf2c('0x2'));var moment=require(_0xdf2c('0x3'));var BPromise=require('bluebird');var rp=require(_0xdf2c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf2c('0x5'));var config=require(_0xdf2c('0x6'));var attributes=require(_0xdf2c('0x7'));module[_0xdf2c('0x8')]=function(_0xb32c88,_0x28505a){return _0xb32c88[_0xdf2c('0x9')](_0xdf2c('0xa'),attributes,{'tableName':_0xdf2c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d9a97,_0x1a25c9,_0x35261c){if(_0x3d9a97[_0xdf2c('0xc')](_0xdf2c('0xd'))){_0x3d9a97['closedAt']=moment()[_0xdf2c('0xe')](_0xdf2c('0xf'));}_0x35261c(null,_0x3d9a97);}}});}; \ No newline at end of file +var _0x8308=['rimraf','../../config/environment','define','WhatsappInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8308,0x1cb));var _0x8830=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x8308[_0xe30e17];return _0x2342c9;};'use strict';var _=require(_0x8830('0x0'));var util=require('util');var logger=require(_0x8830('0x1'))('api');var moment=require(_0x8830('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8830('0x3'));var config=require(_0x8830('0x4'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x5780ac,_0x411404){return _0x5780ac[_0x8830('0x5')](_0x8830('0x6'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x361b3a,_0x51723e,_0x49029d){if(_0x361b3a[_0x8830('0x7')]('closed')){_0x361b3a[_0x8830('0x8')]=moment()[_0x8830('0x9')](_0x8830('0xa'));}_0x49029d(null,_0x361b3a);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 8480820..9589e98 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc155=['error','code','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','limit','then','catch','AddTagsToWhatsappInteraction','find','addTags','body','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2eefa0,_0x5c8180){var _0x3b0ac8=function(_0x11269c){while(--_0x11269c){_0x2eefa0['push'](_0x2eefa0['shift']());}};_0x3b0ac8(++_0x5c8180);}(_0xc155,0x148));var _0x5c15=function(_0x11b612,_0x4c0daf){_0x11b612=_0x11b612-0x0;var _0x2422c7=_0xc155[_0x11b612];return _0x2422c7;};'use strict';var _=require(_0x5c15('0x0'));var util=require(_0x5c15('0x1'));var moment=require(_0x5c15('0x2'));var BPromise=require(_0x5c15('0x3'));var rs=require(_0x5c15('0x4'));var fs=require('fs');var Redis=require(_0x5c15('0x5'));var db=require(_0x5c15('0x6'))['db'];var utils=require(_0x5c15('0x7'));var logger=require(_0x5c15('0x8'))(_0x5c15('0x9'));var config=require('../../config/environment');var jayson=require(_0x5c15('0xa'));var client=jayson[_0x5c15('0xb')][_0x5c15('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5c15('0xd')],{'host':_0x5c15('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c15('0xd')]));require(_0x5c15('0xf'))[_0x5c15('0x10')](socket);function respondWithRpcPromise(_0x16972f,_0x291cb2,_0x3e5a1b){return new BPromise(function(_0x34d5d2,_0x19fba2){return client[_0x5c15('0x11')](_0x16972f,_0x3e5a1b)['then'](function(_0x2f549e){logger[_0x5c15('0x12')](_0x5c15('0x13'),_0x291cb2,_0x5c15('0x14'));logger[_0x5c15('0x15')](_0x5c15('0x16'),_0x291cb2,_0x5c15('0x14'),JSON[_0x5c15('0x17')](_0x2f549e));if(_0x2f549e[_0x5c15('0x18')]){if(_0x2f549e[_0x5c15('0x18')][_0x5c15('0x19')]===0x1f4){logger[_0x5c15('0x18')](_0x5c15('0x13'),_0x291cb2,_0x2f549e[_0x5c15('0x18')][_0x5c15('0x1a')]);return _0x19fba2(_0x2f549e[_0x5c15('0x18')][_0x5c15('0x1a')]);}logger[_0x5c15('0x18')](_0x5c15('0x13'),_0x291cb2,_0x2f549e['error'][_0x5c15('0x1a')]);return _0x34d5d2(_0x2f549e[_0x5c15('0x18')][_0x5c15('0x1a')]);}else{logger[_0x5c15('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x291cb2,_0x5c15('0x14'));_0x34d5d2(_0x2f549e[_0x5c15('0x1b')]['message']);}})['catch'](function(_0x2c4f76){logger['error'](_0x5c15('0x13'),_0x291cb2,_0x2c4f76);_0x19fba2(_0x2c4f76);});});}exports[_0x5c15('0x1c')]=function(_0xdd0d9f){var _0x534c8c=this;return new Promise(function(_0xf69724,_0x2d2b49){return db[_0x5c15('0x1d')][_0x5c15('0x1e')](_0xdd0d9f['body'],{'raw':_0xdd0d9f[_0x5c15('0x1f')]?_0xdd0d9f[_0x5c15('0x1f')][_0x5c15('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdd0d9f[_0x5c15('0x1f')]?_0xdd0d9f[_0x5c15('0x1f')][_0x5c15('0x21')]||null:null,'attributes':_0xdd0d9f[_0x5c15('0x1f')]?_0xdd0d9f[_0x5c15('0x1f')][_0x5c15('0x22')]||null:null,'limit':_0xdd0d9f[_0x5c15('0x1f')]?_0xdd0d9f[_0x5c15('0x1f')][_0x5c15('0x23')]||null:null})[_0x5c15('0x24')](function(_0x2cc3d9){logger[_0x5c15('0x12')]('UpdateWhatsappInteraction',_0xdd0d9f);logger['debug'](_0x5c15('0x1c'),_0xdd0d9f,JSON[_0x5c15('0x17')](_0x2cc3d9));_0xf69724(_0x2cc3d9);})[_0x5c15('0x25')](function(_0x4e5805){logger['error'](_0x5c15('0x1c'),_0x4e5805[_0x5c15('0x1a')],_0xdd0d9f);_0x2d2b49(_0x534c8c['error'](0x1f4,_0x4e5805[_0x5c15('0x1a')]));});});};exports[_0x5c15('0x26')]=function(_0x2afc71){return new Promise(function(_0x34bba5,_0x3cc3fb){return db['WhatsappInteraction'][_0x5c15('0x27')]({'where':_0x2afc71['options']?_0x2afc71[_0x5c15('0x1f')]['where']||null:null})['then'](function(_0x16ad6f){if(_0x16ad6f){return _0x16ad6f[_0x5c15('0x28')](_0x2afc71[_0x5c15('0x29')][_0x5c15('0x2a')],_['omit'](_0x2afc71[_0x5c15('0x29')],['ids','id'])||{});}})['spread'](function(_0x11db42){logger[_0x5c15('0x12')](_0x5c15('0x2b'),_0x2afc71);logger[_0x5c15('0x15')](_0x5c15('0x2b'),_0x2afc71,JSON[_0x5c15('0x17')](_0x11db42));_0x34bba5(_0x11db42);})[_0x5c15('0x25')](function(_0x39ac3e){logger['error']('AddTags',_0x39ac3e[_0x5c15('0x1a')],_0x2afc71);_0x3cc3fb(_this[_0x5c15('0x18')](0x1f4,_0x39ac3e[_0x5c15('0x1a')]));});});}; \ No newline at end of file +var _0xd84f=['limit','UpdateWhatsappInteraction','find','addTags','ids','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappInteraction','update','body','options','raw','where','attributes'];(function(_0x3dad04,_0x5bd65a){var _0x31dc42=function(_0x5744f2){while(--_0x5744f2){_0x3dad04['push'](_0x3dad04['shift']());}};_0x31dc42(++_0x5bd65a);}(_0xd84f,0x134));var _0xfd84=function(_0x43e5f8,_0x334949){_0x43e5f8=_0x43e5f8-0x0;var _0xcb023e=_0xd84f[_0x43e5f8];return _0xcb023e;};'use strict';var _=require(_0xfd84('0x0'));var util=require(_0xfd84('0x1'));var moment=require('moment');var BPromise=require(_0xfd84('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd84('0x3'));var db=require(_0xfd84('0x4'))['db'];var utils=require(_0xfd84('0x5'));var logger=require(_0xfd84('0x6'))(_0xfd84('0x7'));var config=require(_0xfd84('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfd84('0x9')][_0xfd84('0xa')]({'port':0x232a});config[_0xfd84('0xb')]=_['defaults'](config['redis'],{'host':_0xfd84('0xc'),'port':0x18eb});var socket=require(_0xfd84('0xd'))(new Redis(config[_0xfd84('0xb')]));require(_0xfd84('0xe'))[_0xfd84('0xf')](socket);function respondWithRpcPromise(_0x5bf078,_0x4ee488,_0x4afbac){return new BPromise(function(_0x4cce52,_0x20bb23){return client[_0xfd84('0x10')](_0x5bf078,_0x4afbac)[_0xfd84('0x11')](function(_0x4eaf19){logger[_0xfd84('0x12')](_0xfd84('0x13'),_0x4ee488,_0xfd84('0x14'));logger[_0xfd84('0x15')](_0xfd84('0x16'),_0x4ee488,_0xfd84('0x14'),JSON[_0xfd84('0x17')](_0x4eaf19));if(_0x4eaf19['error']){if(_0x4eaf19[_0xfd84('0x18')][_0xfd84('0x19')]===0x1f4){logger[_0xfd84('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x4ee488,_0x4eaf19[_0xfd84('0x18')][_0xfd84('0x1a')]);return _0x20bb23(_0x4eaf19[_0xfd84('0x18')][_0xfd84('0x1a')]);}logger[_0xfd84('0x18')](_0xfd84('0x13'),_0x4ee488,_0x4eaf19[_0xfd84('0x18')][_0xfd84('0x1a')]);return _0x4cce52(_0x4eaf19[_0xfd84('0x18')][_0xfd84('0x1a')]);}else{logger[_0xfd84('0x12')](_0xfd84('0x13'),_0x4ee488,_0xfd84('0x14'));_0x4cce52(_0x4eaf19[_0xfd84('0x1b')][_0xfd84('0x1a')]);}})[_0xfd84('0x1c')](function(_0x59969a){logger['error'](_0xfd84('0x13'),_0x4ee488,_0x59969a);_0x20bb23(_0x59969a);});});}exports['UpdateWhatsappInteraction']=function(_0x26e52b){var _0x394730=this;return new Promise(function(_0x142317,_0x4f8ac3){return db[_0xfd84('0x1d')][_0xfd84('0x1e')](_0x26e52b[_0xfd84('0x1f')],{'raw':_0x26e52b[_0xfd84('0x20')]?_0x26e52b[_0xfd84('0x20')][_0xfd84('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26e52b[_0xfd84('0x20')]?_0x26e52b[_0xfd84('0x20')][_0xfd84('0x22')]||null:null,'attributes':_0x26e52b['options']?_0x26e52b[_0xfd84('0x20')][_0xfd84('0x23')]||null:null,'limit':_0x26e52b[_0xfd84('0x20')]?_0x26e52b[_0xfd84('0x20')][_0xfd84('0x24')]||null:null})[_0xfd84('0x11')](function(_0xed577e){logger[_0xfd84('0x12')](_0xfd84('0x25'),_0x26e52b);logger[_0xfd84('0x15')](_0xfd84('0x25'),_0x26e52b,JSON[_0xfd84('0x17')](_0xed577e));_0x142317(_0xed577e);})[_0xfd84('0x1c')](function(_0xf5d8b0){logger[_0xfd84('0x18')](_0xfd84('0x25'),_0xf5d8b0['message'],_0x26e52b);_0x4f8ac3(_0x394730[_0xfd84('0x18')](0x1f4,_0xf5d8b0[_0xfd84('0x1a')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x18982d){return new Promise(function(_0x39fda2,_0x556907){return db[_0xfd84('0x1d')][_0xfd84('0x26')]({'where':_0x18982d['options']?_0x18982d[_0xfd84('0x20')][_0xfd84('0x22')]||null:null})[_0xfd84('0x11')](function(_0x19ce69){if(_0x19ce69){return _0x19ce69[_0xfd84('0x27')](_0x18982d['body'][_0xfd84('0x28')],_['omit'](_0x18982d[_0xfd84('0x1f')],[_0xfd84('0x28'),'id'])||{});}})[_0xfd84('0x29')](function(_0x146c11){logger[_0xfd84('0x12')](_0xfd84('0x2a'),_0x18982d);logger['debug'](_0xfd84('0x2a'),_0x18982d,JSON['stringify'](_0x146c11));_0x39fda2(_0x146c11);})[_0xfd84('0x1c')](function(_0x18ce9c){logger[_0xfd84('0x18')](_0xfd84('0x2a'),_0x18ce9c[_0xfd84('0x1a')],_0x18982d);_0x556907(_this[_0xfd84('0x18')](0x1f4,_0x18ce9c[_0xfd84('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 28eae3c..e1a188e 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb47a=['removeListener','register','length','remove','emit'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xb47a,0x76));var _0xab47=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xb47a[_0x16b9ed];return _0x66b1f8;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save',_0xab47('0x0'),'update'];function createListener(_0x55ebf9,_0x61e353){return function(_0x3f37a1){_0x61e353[_0xab47('0x1')](_0x55ebf9,_0x3f37a1);};}function removeListener(_0x5bfb1a,_0x2a5e19){return function(){WhatsappInteractionEvents[_0xab47('0x2')](_0x5bfb1a,_0x2a5e19);};}exports[_0xab47('0x3')]=function(_0x333581){for(var _0x1f0afa=0x0,_0x19eec0=events[_0xab47('0x4')];_0x1f0afa<_0x19eec0;_0x1f0afa++){var _0x58b48e=events[_0x1f0afa];var _0x52f13c=createListener('whatsappInteraction:'+_0x58b48e,_0x333581);WhatsappInteractionEvents['on'](_0x58b48e,_0x52f13c);}}; \ No newline at end of file +var _0xde34=['update','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x2c24df,_0x2ca187){var _0x198bb2=function(_0x5bb76f){while(--_0x5bb76f){_0x2c24df['push'](_0x2c24df['shift']());}};_0x198bb2(++_0x2ca187);}(_0xde34,0x133));var _0x4de3=function(_0x267730,_0x1dcfb4){_0x267730=_0x267730-0x0;var _0x772034=_0xde34[_0x267730];return _0x772034;};'use strict';var WhatsappInteractionEvents=require(_0x4de3('0x0'));var events=['save','remove',_0x4de3('0x1')];function createListener(_0x536219,_0x2257a9){return function(_0x53fe8f){_0x2257a9[_0x4de3('0x2')](_0x536219,_0x53fe8f);};}function removeListener(_0x1c1f68,_0x452a25){return function(){WhatsappInteractionEvents[_0x4de3('0x3')](_0x1c1f68,_0x452a25);};}exports[_0x4de3('0x4')]=function(_0x37728b){for(var _0x59d8f3=0x0,_0x4c3b4e=events[_0x4de3('0x5')];_0x59d8f3<_0x4c3b4e;_0x59d8f3++){var _0x4be01f=events[_0x59d8f3];var _0xdecdf6=createListener(_0x4de3('0x6')+_0x4be01f,_0x37728b);WhatsappInteractionEvents['on'](_0x4be01f,_0xdecdf6);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 6825483..746ca6f 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['/:id/reject','reject','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept'];(function(_0x21a95e,_0x4de45e){var _0x828e72=function(_0x5adae3){while(--_0x5adae3){_0x21a95e['push'](_0x21a95e['shift']());}};_0x828e72(++_0x4de45e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5f5497,_0x50803a){_0x5f5497=_0x5f5497-0x0;var _0x10e943=_0xf3cd[_0x5f5497];return _0x10e943;};'use strict';var multer=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var timeout=require(_0xdf3c('0x3'));var express=require(_0xdf3c('0x4'));var router=express[_0xdf3c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdf3c('0x6'));var interaction=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var controller=require('./whatsappMessage.controller');router[_0xdf3c('0x9')]('/',auth[_0xdf3c('0xa')](),controller[_0xdf3c('0xb')]);router[_0xdf3c('0x9')](_0xdf3c('0xc'),auth[_0xdf3c('0xa')](),controller['describe']);router[_0xdf3c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0xe')]('/',auth['isAuthenticated'](),interaction[_0xdf3c('0xf')](_0xdf3c('0x10'),_0xdf3c('0x11')),controller[_0xdf3c('0x12')]);router[_0xdf3c('0xe')](_0xdf3c('0x13'),controller[_0xdf3c('0x14')]);router[_0xdf3c('0x15')]('/:id',auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x16')]);router[_0xdf3c('0x15')](_0xdf3c('0x17'),auth['isAuthenticated'](),controller[_0xdf3c('0x18')]);router[_0xdf3c('0x15')](_0xdf3c('0x19'),auth['isAuthenticated'](),controller[_0xdf3c('0x1a')]);router[_0xdf3c('0x1b')](_0xdf3c('0x1c'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x1d')]);module[_0xdf3c('0x1e')]=router; \ No newline at end of file +var _0xeec6=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','/describe','describe','get','show','post','whatsappmessage:create','create','status','/:id','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x88000f,_0x443a85){var _0x3187a7=function(_0x551de5){while(--_0x551de5){_0x88000f['push'](_0x88000f['shift']());}};_0x3187a7(++_0x443a85);}(_0xeec6,0x1c2));var _0x6eec=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0xeec6[_0x2a390b];return _0x5df10a;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get']('/',auth[_0x6eec('0xa')](),controller[_0x6eec('0xb')]);router['get'](_0x6eec('0xc'),auth[_0x6eec('0xa')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xa')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/',auth['isAuthenticated'](),interaction['tracked']('whatsapp',_0x6eec('0x11')),controller[_0x6eec('0x12')]);router['post']('/:id/status',controller[_0x6eec('0x13')]);router['put'](_0x6eec('0x14'),auth[_0x6eec('0xa')](),controller[_0x6eec('0x15')]);router[_0x6eec('0x16')](_0x6eec('0x17'),auth['isAuthenticated'](),controller[_0x6eec('0x18')]);router[_0x6eec('0x16')](_0x6eec('0x19'),auth[_0x6eec('0xa')](),controller[_0x6eec('0x1a')]);router[_0x6eec('0x1b')](_0x6eec('0x14'),auth[_0x6eec('0xa')](),controller[_0x6eec('0x1c')]);module[_0x6eec('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 815d0f8..8da6be8 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe82=['medium','BOOLEAN','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x262087,_0x3bd6ca){var _0x2867f=function(_0x208253){while(--_0x208253){_0x262087['push'](_0x262087['shift']());}};_0x2867f(++_0x3bd6ca);}(_0xfe82,0x9d));var _0x2fe8=function(_0x1a0946,_0x4f40c2){_0x1a0946=_0x1a0946-0x0;var _0x1c179f=_0xfe82[_0x1a0946];return _0x1c179f;};'use strict';var Sequelize=require(_0x2fe8('0x0'));module[_0x2fe8('0x1')]={'body':{'type':Sequelize[_0x2fe8('0x2')](_0x2fe8('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2fe8('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2fe8('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x2fe8('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x2fe8('0x7')]},'secret':{'type':Sequelize[_0x2fe8('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x2fe8('0x2')]}}; \ No newline at end of file +var _0xc8ed=['ENUM','out','STRING','DATE','BOOLEAN','sequelize','exports','TEXT','medium'];(function(_0x9381e1,_0xa19020){var _0x1a4f47=function(_0x5155b7){while(--_0x5155b7){_0x9381e1['push'](_0x9381e1['shift']());}};_0x1a4f47(++_0xa19020);}(_0xc8ed,0x137));var _0xdc8e=function(_0x4ac1cc,_0x586beb){_0x4ac1cc=_0x4ac1cc-0x0;var _0x300e78=_0xc8ed[_0x4ac1cc];return _0x300e78;};'use strict';var Sequelize=require(_0xdc8e('0x0'));module[_0xdc8e('0x1')]={'body':{'type':Sequelize[_0xdc8e('0x2')](_0xdc8e('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdc8e('0x4')]('in',_0xdc8e('0x5')),'defaultValue':_0xdc8e('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xdc8e('0x6')](0xbe)},'phone':{'type':Sequelize[_0xdc8e('0x6')]},'readAt':{'type':Sequelize[_0xdc8e('0x7')]},'secret':{'type':Sequelize[_0xdc8e('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xdc8e('0x6')]},'providerResponse':{'type':Sequelize[_0xdc8e('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 981bcc9..427ff85 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./whatsappMessage.socket','register','http','client','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','map','WhatsappMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','where','pick','merge','VIRTUAL','filter','include','findAll','show','params','includeAll','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','WhatsappInteraction','WhatsappInteractionId','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','length','startsWith','push','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','manual','SIP/%s','channel','event','EventManager','RejectMessage','rejectMessage','Sequelize','QueryTypes','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x45d80c,_0x35c0ff){var _0x449a98=function(_0x1b5ab7){while(--_0x1b5ab7){_0x45d80c['push'](_0x45d80c['shift']());}};_0x449a98(++_0x35c0ff);}(_0x3e74,0x175));var _0x43e7=function(_0x717793,_0xa11372){_0x717793=_0x717793-0x0;var _0x3ca7a1=_0x3e74[_0x717793];return _0x3ca7a1;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];config[_0x43e7('0x15')]=_[_0x43e7('0x16')](config[_0x43e7('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43e7('0x15')]));require(_0x43e7('0x17'))[_0x43e7('0x18')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x43e7('0x19')]({'port':0x232c});var client9002=jayson[_0x43e7('0x1a')][_0x43e7('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x328445,_0x4de324,_0x5c4eaa,_0xdf16c){return new BPromise(function(_0x264575,_0x273a32){var _0x5d346f=_0xdf16c||client;return _0x5d346f['request'](_0x328445,_0x5c4eaa)[_0x43e7('0x1b')](function(_0x1ca758){logger[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x4de324,_0x43e7('0x1e'));logger[_0x43e7('0x1f')](_0x43e7('0x20'),_0x4de324,_0x43e7('0x1e'),JSON[_0x43e7('0x21')](_0x1ca758));if(_0x1ca758[_0x43e7('0x22')]){if(_0x1ca758[_0x43e7('0x22')][_0x43e7('0x23')]===0x1f4){logger['error'](_0x43e7('0x1d'),_0x4de324,_0x1ca758[_0x43e7('0x22')]['message']);return _0x273a32(_0x1ca758[_0x43e7('0x22')][_0x43e7('0x24')]);}logger[_0x43e7('0x22')](_0x43e7('0x1d'),_0x4de324,_0x1ca758[_0x43e7('0x22')][_0x43e7('0x24')]);return _0x264575(_0x1ca758['error'][_0x43e7('0x24')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x4de324,_0x43e7('0x1e'));_0x264575(_0x1ca758[_0x43e7('0x25')]['message']);}})[_0x43e7('0x26')](function(_0x4ca5cf){logger[_0x43e7('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x4de324,_0x4ca5cf);_0x273a32(_0x4ca5cf);});});}function respondWithStatusCode(_0x1af208,_0x1b5f50){_0x1b5f50=_0x1b5f50||0xcc;return function(_0x20888b){if(_0x20888b){return _0x1af208[_0x43e7('0x27')](_0x1b5f50);}return _0x1af208['status'](_0x1b5f50)['end']();};}function respondWithResult(_0x805b54,_0x501551){_0x501551=_0x501551||0xc8;return function(_0x2dd5f){if(_0x2dd5f){return _0x805b54[_0x43e7('0x28')](_0x501551)[_0x43e7('0x29')](_0x2dd5f);}};}function respondWithFilteredResult(_0xb1fc63,_0x5087d7){return function(_0x33a1a5){if(_0x33a1a5){var _0x4690a6=typeof _0x5087d7[_0x43e7('0x2a')]===_0x43e7('0x2b')&&typeof _0x5087d7[_0x43e7('0x2c')]===_0x43e7('0x2b');var _0x2b85a5=_0x33a1a5[_0x43e7('0x2d')];var _0x3bf475=_0x4690a6?0x0:_0x5087d7[_0x43e7('0x2a')];var _0x17df44=_0x4690a6?_0x33a1a5[_0x43e7('0x2d')]:_0x5087d7[_0x43e7('0x2a')]+_0x5087d7[_0x43e7('0x2c')];var _0x4bdb17;if(_0x17df44>=_0x2b85a5){_0x17df44=_0x2b85a5;_0x4bdb17=0xc8;}else{_0x4bdb17=0xce;}_0xb1fc63[_0x43e7('0x28')](_0x4bdb17);return _0xb1fc63[_0x43e7('0x2e')](_0x43e7('0x2f'),_0x3bf475+'-'+_0x17df44+'/'+_0x2b85a5)[_0x43e7('0x29')](_0x33a1a5);}return null;};}function patchUpdates(_0x4251c8){return function(_0x4c8650){try{jsonpatch[_0x43e7('0x30')](_0x4c8650,_0x4251c8,!![]);}catch(_0x49b83d){return BPromise[_0x43e7('0x31')](_0x49b83d);}return _0x4c8650[_0x43e7('0x32')]();};}function saveUpdates(_0x4c61b9,_0x5a7342){return function(_0x5e203f){if(_0x5e203f){return _0x5e203f[_0x43e7('0x33')](_0x4c61b9)[_0x43e7('0x1b')](function(_0x117c07){return _0x117c07;});}return null;};}function removeEntity(_0x234fe6,_0x108313){return function(_0xde7ed){if(_0xde7ed){return _0xde7ed['destroy']()['then'](function(){_0x234fe6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e8e86,_0x564f0e){return function(_0x5cb753){if(!_0x5cb753){_0x4e8e86[_0x43e7('0x27')](0x194);}return _0x5cb753;};}function handleError(_0x49cda6,_0x2b4bfd){_0x2b4bfd=_0x2b4bfd||0x1f4;return function(_0x8e9f40){logger[_0x43e7('0x22')](_0x8e9f40[_0x43e7('0x34')]);if(_0x8e9f40[_0x43e7('0x35')]){delete _0x8e9f40[_0x43e7('0x35')];}_0x49cda6[_0x43e7('0x28')](_0x2b4bfd)['send'](_0x8e9f40);};}exports['index']=function(_0x5d84f4,_0xfa0474){var _0xfe70e9={},_0x199ff6={},_0x16cdba={'count':0x0,'rows':[]};var _0x1b1440=_[_0x43e7('0x36')](db[_0x43e7('0x37')][_0x43e7('0x38')],function(_0x55c798){return{'name':_0x55c798[_0x43e7('0x39')],'type':_0x55c798[_0x43e7('0x3a')]['key']};});_0x199ff6[_0x43e7('0x3b')]=_['map'](_0x1b1440,_0x43e7('0x35'));_0x199ff6[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](_0x5d84f4[_0x43e7('0x3c')]);_0x199ff6[_0x43e7('0x3e')]=_[_0x43e7('0x3f')](_0x199ff6['model'],_0x199ff6['query']);_0xfe70e9[_0x43e7('0x40')]=_[_0x43e7('0x3f')](_0x199ff6[_0x43e7('0x3b')],qs[_0x43e7('0x41')](_0x5d84f4[_0x43e7('0x3c')]['fields']));_0xfe70e9[_0x43e7('0x40')]=_0xfe70e9[_0x43e7('0x40')]['length']?_0xfe70e9[_0x43e7('0x40')]:_0x199ff6['model'];if(!_0x5d84f4[_0x43e7('0x3c')]['hasOwnProperty'](_0x43e7('0x42'))){_0xfe70e9[_0x43e7('0x2c')]=qs[_0x43e7('0x2c')](_0x5d84f4[_0x43e7('0x3c')]['limit']);_0xfe70e9['offset']=qs[_0x43e7('0x2a')](_0x5d84f4[_0x43e7('0x3c')][_0x43e7('0x2a')]);}_0xfe70e9[_0x43e7('0x43')]=qs['sort'](_0x5d84f4['query']['sort']);_0xfe70e9[_0x43e7('0x44')]=qs['filters'](_[_0x43e7('0x45')](_0x5d84f4['query'],_0x199ff6['filters']),_0x1b1440);if(_0x5d84f4[_0x43e7('0x3c')]['filter']){_0xfe70e9[_0x43e7('0x44')]=_[_0x43e7('0x46')](_0xfe70e9[_0x43e7('0x44')],{'$or':_[_0x43e7('0x36')](_0x1b1440,function(_0x4fc5e8){if(_0x4fc5e8[_0x43e7('0x3a')]!==_0x43e7('0x47')){var _0x23a611={};_0x23a611[_0x4fc5e8[_0x43e7('0x35')]]={'$like':'%'+_0x5d84f4[_0x43e7('0x3c')][_0x43e7('0x48')]+'%'};return _0x23a611;}})});}_0xfe70e9=_['merge']({},_0xfe70e9,_0x5d84f4['options']);var _0x3bc9de={'where':_0xfe70e9[_0x43e7('0x44')]};return db[_0x43e7('0x37')]['count'](_0x3bc9de)['then'](function(_0x56489b){_0x16cdba[_0x43e7('0x2d')]=_0x56489b;if(_0x5d84f4[_0x43e7('0x3c')]['includeAll']){_0xfe70e9[_0x43e7('0x49')]=[{'all':!![]}];}return db[_0x43e7('0x37')][_0x43e7('0x4a')](_0xfe70e9);})['then'](function(_0x593155){_0x16cdba['rows']=_0x593155;return _0x16cdba;})['then'](respondWithFilteredResult(_0xfa0474,_0xfe70e9))[_0x43e7('0x26')](handleError(_0xfa0474,null));};exports[_0x43e7('0x4b')]=function(_0x52fea5,_0x23e7cb){var _0x82d32f={'raw':!![],'where':{'id':_0x52fea5[_0x43e7('0x4c')]['id']}},_0x426bcb={};_0x426bcb['model']=_[_0x43e7('0x3d')](db['WhatsappMessage']['rawAttributes']);_0x426bcb[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](_0x52fea5[_0x43e7('0x3c')]);_0x426bcb[_0x43e7('0x3e')]=_[_0x43e7('0x3f')](_0x426bcb[_0x43e7('0x3b')],_0x426bcb[_0x43e7('0x3c')]);_0x82d32f[_0x43e7('0x40')]=_[_0x43e7('0x3f')](_0x426bcb[_0x43e7('0x3b')],qs['fields'](_0x52fea5[_0x43e7('0x3c')][_0x43e7('0x41')]));_0x82d32f['attributes']=_0x82d32f[_0x43e7('0x40')]['length']?_0x82d32f[_0x43e7('0x40')]:_0x426bcb[_0x43e7('0x3b')];if(_0x52fea5[_0x43e7('0x3c')][_0x43e7('0x4d')]){_0x82d32f[_0x43e7('0x49')]=[{'all':!![]}];}_0x82d32f=_['merge']({},_0x82d32f,_0x52fea5['options']);return db[_0x43e7('0x37')][_0x43e7('0x4e')](_0x82d32f)[_0x43e7('0x1b')](handleEntityNotFound(_0x23e7cb,null))[_0x43e7('0x1b')](respondWithResult(_0x23e7cb,null))[_0x43e7('0x26')](handleError(_0x23e7cb,null));};exports[_0x43e7('0x4f')]=function(_0xa47464,_0x44f8a0){return db[_0x43e7('0x37')][_0x43e7('0x4f')](_0xa47464[_0x43e7('0x50')],{})['then'](respondWithResult(_0x44f8a0,0xc9))[_0x43e7('0x26')](handleError(_0x44f8a0,null));};exports[_0x43e7('0x33')]=function(_0x50a3fa,_0x4314d8){if(_0x50a3fa[_0x43e7('0x50')]['id']){delete _0x50a3fa[_0x43e7('0x50')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x50a3fa[_0x43e7('0x4c')]['id']}})[_0x43e7('0x1b')](handleEntityNotFound(_0x4314d8,null))['then'](saveUpdates(_0x50a3fa[_0x43e7('0x50')],null))['then'](respondWithResult(_0x4314d8,null))['catch'](handleError(_0x4314d8,null));};exports[_0x43e7('0x51')]=function(_0x4b6b7f,_0x1f7c02){return db[_0x43e7('0x37')][_0x43e7('0x4e')]({'where':{'id':_0x4b6b7f['params']['id']}})[_0x43e7('0x1b')](handleEntityNotFound(_0x1f7c02,null))[_0x43e7('0x1b')](removeEntity(_0x1f7c02,null))['catch'](handleError(_0x1f7c02,null));};exports[_0x43e7('0x52')]=function(_0x1267c5,_0x296a0d){return db['WhatsappMessage']['describe']()['then'](respondWithResult(_0x296a0d,null))[_0x43e7('0x26')](handleError(_0x296a0d,null));};var interaction_log=require(_0x43e7('0x11'))(_0x43e7('0x53'));exports[_0x43e7('0x54')]=function(_0x52ea9c,_0x5a50fc,_0x1b27da){var _0x8b50bb={'agent':{},'channel':_0x43e7('0x55')};if(_0x52ea9c[_0x43e7('0x50')]['id']){delete _0x52ea9c['body']['id'];}_0x52ea9c[_0x43e7('0x50')][_0x43e7('0x56')]=!![];_0x52ea9c[_0x43e7('0x50')][_0x43e7('0x57')]=moment()[_0x43e7('0x58')](_0x43e7('0x59'));_0x52ea9c[_0x43e7('0x50')][_0x43e7('0x5a')]=_0x52ea9c[_0x43e7('0x50')][_0x43e7('0x5a')]||_0x52ea9c[_0x43e7('0x5b')]['id'];_0x8b50bb['agent']['id']=_0x52ea9c['body'][_0x43e7('0x5a')];return db['WhatsappMessage']['find']({'where':{'id':_0x52ea9c['params']['id'],'UserId':null},'include':[{'model':db[_0x43e7('0x5c')],'as':_0x43e7('0x5d')}]})['then'](handleEntityNotFound(_0x5a50fc,null))[_0x43e7('0x1b')](saveUpdates(_0x52ea9c[_0x43e7('0x50')],null))[_0x43e7('0x1b')](function(_0x537a53){if(_0x537a53){_0x8b50bb[_0x43e7('0x24')]=_0x537a53[_0x43e7('0x5e')]({'plain':!![]});return db[_0x43e7('0x5f')][_0x43e7('0x4e')]({'where':{'id':_0x537a53[_0x43e7('0x60')]}});}return null;})[_0x43e7('0x1b')](handleEntityNotFound(_0x5a50fc,null))[_0x43e7('0x1b')](function(_0x515f01){if(_0x515f01){return _0x515f01[_0x43e7('0x33')]({'UserId':_0x52ea9c[_0x43e7('0x50')][_0x43e7('0x5a')],'read1stAt':_['isNil'](_0x515f01['read1stAt'])?moment()[_0x43e7('0x58')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1b793d){if(_0x1b793d){_0x8b50bb[_0x43e7('0x61')]=_0x1b793d['get']({'plain':!![]});interaction_log[_0x43e7('0x1c')](_0x43e7('0x62'),_0x52ea9c[_0x43e7('0x5b')]['id'],_0x52ea9c[_0x43e7('0x5b')][_0x43e7('0x35')],_0x52ea9c[_0x43e7('0x5b')][_0x43e7('0x63')],_0x8b50bb['interaction']['id'],_0x52ea9c[_0x43e7('0x50')]?JSON[_0x43e7('0x21')](_0x52ea9c['body']):_0x43e7('0x64'));return respondWithRpcPromise('AcceptMessage',_0x43e7('0x65'),_0x8b50bb);}return null;})[_0x43e7('0x1b')](function(_0x37301b){return db[_0x43e7('0x5c')]['describe']()[_0x43e7('0x1b')](function(_0x2646c2){var _0xf929a5=[];for(var _0x556001=0x0;_0x556001=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['WhatsappMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['WhatsappMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('whatsapp-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'whatsapp'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x5e')],'as':'Contact'}]})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))[_0x0a9e('0x1d')](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x401837){if(_0x401837){_0x273cb5['message']=_0x401837[_0x0a9e('0x5f')]({'plain':!![]});return db[_0x0a9e('0x60')][_0x0a9e('0x55')]({'where':{'id':_0x401837['WhatsappInteractionId']}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x5211e3){if(_0x5211e3){return _0x5211e3[_0x0a9e('0x35')]({'UserId':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x61')](_0x5211e3[_0x0a9e('0x62')])?moment()[_0x0a9e('0x63')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x2d7205){if(_0x2d7205){_0x273cb5[_0x0a9e('0x64')]=_0x2d7205[_0x0a9e('0x5f')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x65'),_0x5ba1f9[_0x0a9e('0x66')]['id'],_0x5ba1f9[_0x0a9e('0x66')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x66')][_0x0a9e('0x67')],_0x273cb5['interaction']['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x5ba1f9[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x68'),_0x0a9e('0x69'),_0x273cb5);}return null;})['then'](function(_0x83f0b2){return db[_0x0a9e('0x5e')][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](function(_0x13b5c0){var _0x4a43a8=[];for(var _0x50cdce=0x0;_0x50cdce=_0x503c18){_0x4a9498=_0x503c18;_0x3d57c8=0xc8;}else{_0x3d57c8=0xce;}_0x35e952[_0xa2d0('0x1d')](_0x3d57c8);return _0x35e952[_0xa2d0('0x24')](_0xa2d0('0x25'),_0x37a670+'-'+_0x4a9498+'/'+_0x503c18)[_0xa2d0('0x1f')](_0x1ff16f);}return null;};}function patchUpdates(_0x389dfa){return function(_0x348c8f){try{jsonpatch[_0xa2d0('0x26')](_0x348c8f,_0x389dfa,!![]);}catch(_0x1451f1){return BPromise[_0xa2d0('0x27')](_0x1451f1);}return _0x348c8f['save']();};}function saveUpdates(_0x1f2dac,_0x699c84){return function(_0xf56cb7){if(_0xf56cb7){return _0xf56cb7[_0xa2d0('0x28')](_0x1f2dac)['then'](function(_0x5db399){return _0x5db399;});}return null;};}function removeEntity(_0x55b591,_0x43a6e3){return function(_0x33d094){if(_0x33d094){return _0x33d094[_0xa2d0('0x29')]()[_0xa2d0('0x2a')](function(){var _0x560ef3=_0x33d094[_0xa2d0('0x2b')]({'plain':!![]});var _0x478cd9=_0xa2d0('0x2c');return db[_0xa2d0('0x2d')][_0xa2d0('0x29')]({'where':{'type':_0x478cd9,'resourceId':_0x560ef3['id']}})[_0xa2d0('0x2a')](function(){return _0x33d094;});})[_0xa2d0('0x2a')](function(){_0x55b591['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31eff3,_0x2607eb){return function(_0x5900b4){if(!_0x5900b4){_0x31eff3[_0xa2d0('0x1c')](0x194);}return _0x5900b4;};}function handleError(_0x187859,_0x3d80de){_0x3d80de=_0x3d80de||0x1f4;return function(_0x1cd79c){logger['error'](_0x1cd79c[_0xa2d0('0x2e')]);if(_0x1cd79c['name']){delete _0x1cd79c['name'];}_0x187859[_0xa2d0('0x1d')](_0x3d80de)[_0xa2d0('0x2f')](_0x1cd79c);};}exports[_0xa2d0('0x30')]=function(_0x1645d2,_0xf70055){var _0xe3ba14={},_0xc737f7={},_0x406560={'count':0x0,'rows':[]};var _0x23ad12=_['map'](db[_0xa2d0('0x31')][_0xa2d0('0x32')],function(_0x45ccb1){return{'name':_0x45ccb1['fieldName'],'type':_0x45ccb1[_0xa2d0('0x33')][_0xa2d0('0x34')]};});_0xc737f7[_0xa2d0('0x35')]=_[_0xa2d0('0x36')](_0x23ad12,_0xa2d0('0x37'));_0xc737f7[_0xa2d0('0x38')]=_[_0xa2d0('0x39')](_0x1645d2[_0xa2d0('0x38')]);_0xc737f7[_0xa2d0('0x3a')]=_['intersection'](_0xc737f7[_0xa2d0('0x35')],_0xc737f7['query']);_0xe3ba14[_0xa2d0('0x3b')]=_['intersection'](_0xc737f7[_0xa2d0('0x35')],qs[_0xa2d0('0x3c')](_0x1645d2[_0xa2d0('0x38')][_0xa2d0('0x3c')]));_0xe3ba14[_0xa2d0('0x3b')]=_0xe3ba14[_0xa2d0('0x3b')][_0xa2d0('0x3d')]?_0xe3ba14[_0xa2d0('0x3b')]:_0xc737f7[_0xa2d0('0x35')];if(!_0x1645d2['query'][_0xa2d0('0x3e')](_0xa2d0('0x3f'))){_0xe3ba14['limit']=qs[_0xa2d0('0x23')](_0x1645d2[_0xa2d0('0x38')]['limit']);_0xe3ba14[_0xa2d0('0x20')]=qs[_0xa2d0('0x20')](_0x1645d2[_0xa2d0('0x38')]['offset']);}_0xe3ba14['order']=qs['sort'](_0x1645d2['query'][_0xa2d0('0x40')]);_0xe3ba14[_0xa2d0('0x41')]=qs[_0xa2d0('0x3a')](_[_0xa2d0('0x42')](_0x1645d2['query'],_0xc737f7['filters']),_0x23ad12);if(_0x1645d2[_0xa2d0('0x38')][_0xa2d0('0x43')]){_0xe3ba14['where']=_[_0xa2d0('0x44')](_0xe3ba14['where'],{'$or':_[_0xa2d0('0x36')](_0x23ad12,function(_0x2da866){if(_0x2da866[_0xa2d0('0x33')]!==_0xa2d0('0x45')){var _0xe874ea={};_0xe874ea[_0x2da866['name']]={'$like':'%'+_0x1645d2[_0xa2d0('0x38')][_0xa2d0('0x43')]+'%'};return _0xe874ea;}})});}_0xe3ba14=_['merge']({},_0xe3ba14,_0x1645d2['options']);var _0x12ff65={'where':_0xe3ba14['where']};return db['WhatsappQueue'][_0xa2d0('0x22')](_0x12ff65)[_0xa2d0('0x2a')](function(_0x3b2b55){_0x406560[_0xa2d0('0x22')]=_0x3b2b55;if(_0x1645d2[_0xa2d0('0x38')][_0xa2d0('0x46')]){_0xe3ba14[_0xa2d0('0x47')]=[{'all':!![]}];}return db['WhatsappQueue'][_0xa2d0('0x48')](_0xe3ba14);})[_0xa2d0('0x2a')](function(_0x42d88d){_0x406560['rows']=_0x42d88d;return _0x406560;})[_0xa2d0('0x2a')](respondWithFilteredResult(_0xf70055,_0xe3ba14))[_0xa2d0('0x49')](handleError(_0xf70055,null));};exports[_0xa2d0('0x4a')]=function(_0x5cbc26,_0x41d45d){var _0x2d62e3={'raw':!![],'where':{'id':_0x5cbc26[_0xa2d0('0x4b')]['id']}},_0x3095cb={};_0x3095cb['model']=_['keys'](db[_0xa2d0('0x31')][_0xa2d0('0x32')]);_0x3095cb[_0xa2d0('0x38')]=_['keys'](_0x5cbc26['query']);_0x3095cb['filters']=_[_0xa2d0('0x4c')](_0x3095cb[_0xa2d0('0x35')],_0x3095cb['query']);_0x2d62e3[_0xa2d0('0x3b')]=_[_0xa2d0('0x4c')](_0x3095cb['model'],qs[_0xa2d0('0x3c')](_0x5cbc26[_0xa2d0('0x38')][_0xa2d0('0x3c')]));_0x2d62e3['attributes']=_0x2d62e3[_0xa2d0('0x3b')][_0xa2d0('0x3d')]?_0x2d62e3[_0xa2d0('0x3b')]:_0x3095cb[_0xa2d0('0x35')];if(_0x5cbc26['query'][_0xa2d0('0x46')]){_0x2d62e3[_0xa2d0('0x47')]=[{'all':!![]}];}_0x2d62e3=_[_0xa2d0('0x44')]({},_0x2d62e3,_0x5cbc26[_0xa2d0('0x4d')]);return db[_0xa2d0('0x31')][_0xa2d0('0x4e')](_0x2d62e3)[_0xa2d0('0x2a')](handleEntityNotFound(_0x41d45d,null))[_0xa2d0('0x2a')](respondWithResult(_0x41d45d,null))[_0xa2d0('0x49')](handleError(_0x41d45d,null));};exports[_0xa2d0('0x4f')]=function(_0x5219e1,_0x53d587){return db[_0xa2d0('0x31')][_0xa2d0('0x4f')](_0x5219e1[_0xa2d0('0x50')],{})[_0xa2d0('0x2a')](function(_0x38e5ce){var _0x480a22=_0x5219e1[_0xa2d0('0x51')][_0xa2d0('0x2b')]({'plain':!![]});if(!_0x480a22)throw new Error(_0xa2d0('0x52'));if(_0x480a22[_0xa2d0('0x53')]===_0xa2d0('0x51')){var _0x5820f3=_0x38e5ce['get']({'plain':!![]});var _0x1d0265='WhatsappQueues';return db[_0xa2d0('0x54')][_0xa2d0('0x4e')]({'where':{'name':_0x1d0265,'userProfileId':_0x480a22['userProfileId']},'raw':!![]})[_0xa2d0('0x2a')](function(_0x3bee6a){if(_0x3bee6a&&_0x3bee6a[_0xa2d0('0x55')]===0x0){return db[_0xa2d0('0x2d')][_0xa2d0('0x4f')]({'name':_0x5820f3['name'],'resourceId':_0x5820f3['id'],'type':_0x3bee6a['name'],'sectionId':_0x3bee6a['id']},{})['then'](function(){return _0x38e5ce;});}else{return _0x38e5ce;}})[_0xa2d0('0x49')](function(_0x2c2ec4){logger[_0xa2d0('0x56')](_0xa2d0('0x57'),_0x2c2ec4);throw _0x2c2ec4;});}return _0x38e5ce;})['then'](respondWithResult(_0x53d587,0xc9))[_0xa2d0('0x49')](handleError(_0x53d587,null));};exports[_0xa2d0('0x28')]=function(_0x487421,_0x525a6d){if(_0x487421[_0xa2d0('0x50')]['id']){delete _0x487421[_0xa2d0('0x50')]['id'];}return db[_0xa2d0('0x31')][_0xa2d0('0x4e')]({'where':{'id':_0x487421[_0xa2d0('0x4b')]['id']}})[_0xa2d0('0x2a')](handleEntityNotFound(_0x525a6d,null))[_0xa2d0('0x2a')](saveUpdates(_0x487421['body'],null))['then'](respondWithResult(_0x525a6d,null))[_0xa2d0('0x49')](handleError(_0x525a6d,null));};exports[_0xa2d0('0x29')]=function(_0x19b7c3,_0x5db8ce){return db[_0xa2d0('0x31')][_0xa2d0('0x4e')]({'where':{'id':_0x19b7c3[_0xa2d0('0x4b')]['id']}})[_0xa2d0('0x2a')](handleEntityNotFound(_0x5db8ce,null))[_0xa2d0('0x2a')](removeEntity(_0x5db8ce,null))[_0xa2d0('0x49')](handleError(_0x5db8ce,null));};exports[_0xa2d0('0x58')]=function(_0x98afdc,_0x2ad2d1){return db[_0xa2d0('0x31')][_0xa2d0('0x58')]()[_0xa2d0('0x2a')](respondWithResult(_0x2ad2d1,null))['catch'](handleError(_0x2ad2d1,null));};exports[_0xa2d0('0x59')]=function(_0xb3377f,_0x581a0f,_0x3a236b){var _0x30e01d={'raw':!![],'where':{}},_0x391967={},_0x1a9335;return db['WhatsappQueue']['findOne']({'where':{'id':_0xb3377f[_0xa2d0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x581a0f,null))[_0xa2d0('0x2a')](function(_0x8da0f9){if(_0x8da0f9){_0x1a9335=_0x8da0f9[_0xa2d0('0x2b')]({'plain':!![]});_0x391967[_0xa2d0('0x35')]=_[_0xa2d0('0x39')](db[_0xa2d0('0x5a')][_0xa2d0('0x32')]);_0x391967[_0xa2d0('0x38')]=_[_0xa2d0('0x39')](_0xb3377f['query']);_0x391967[_0xa2d0('0x3a')]=_[_0xa2d0('0x4c')](_0x391967[_0xa2d0('0x35')],_0x391967[_0xa2d0('0x38')]);_0x30e01d[_0xa2d0('0x3b')]=_[_0xa2d0('0x4c')](_0x391967[_0xa2d0('0x35')],qs[_0xa2d0('0x3c')](_0xb3377f[_0xa2d0('0x38')]['fields']));_0x30e01d[_0xa2d0('0x3b')]=_0x30e01d[_0xa2d0('0x3b')][_0xa2d0('0x3d')]?_0x30e01d['attributes']:_0x391967[_0xa2d0('0x35')];if(!_0xb3377f['query']['hasOwnProperty']('nolimit')){_0x30e01d[_0xa2d0('0x23')]=qs[_0xa2d0('0x23')](_0xb3377f['query'][_0xa2d0('0x23')]);_0x30e01d[_0xa2d0('0x20')]=qs[_0xa2d0('0x20')](_0xb3377f[_0xa2d0('0x38')][_0xa2d0('0x20')]);}_0x30e01d[_0xa2d0('0x5b')]=qs[_0xa2d0('0x40')](_0xb3377f[_0xa2d0('0x38')][_0xa2d0('0x40')]);_0x30e01d[_0xa2d0('0x41')]=qs[_0xa2d0('0x3a')](_[_0xa2d0('0x42')](_0xb3377f[_0xa2d0('0x38')],_0x391967['filters']));_0x30e01d[_0xa2d0('0x41')][_0xa2d0('0x5c')]=_0x8da0f9['id'];if(_0xb3377f[_0xa2d0('0x38')]['filter']){_0x30e01d[_0xa2d0('0x41')]=_[_0xa2d0('0x44')](_0x30e01d[_0xa2d0('0x41')],{'$or':_[_0xa2d0('0x36')](_0x30e01d[_0xa2d0('0x3b')],function(_0x50d23e){var _0x5b48d1={};_0x5b48d1[_0x50d23e]={'$like':'%'+_0xb3377f[_0xa2d0('0x38')][_0xa2d0('0x43')]+'%'};return _0x5b48d1;})});}_0x30e01d=_[_0xa2d0('0x44')]({},_0x30e01d,_0xb3377f[_0xa2d0('0x4d')]);return db[_0xa2d0('0x5a')][_0xa2d0('0x48')](_0x30e01d);}})['then'](function(_0x137325){if(_0x137325){return db['User'][_0xa2d0('0x5d')]({'where':{'id':_['map'](_0x137325,_0xa2d0('0x5e')),'role':_0xa2d0('0x5f')},'attributes':['id','name','whatsappPause',_0xa2d0('0x60'),_0xa2d0('0x61')]});}})[_0xa2d0('0x2a')](function(_0x14bf4e){if(_0x14bf4e){return{'count':_0x14bf4e[_0xa2d0('0x22')],'rows':_[_0xa2d0('0x36')](_0x14bf4e['rows'],function(_0x178fbd){return{'membername':_0x178fbd['name'],'UserId':_0x178fbd['id'],'queue_name':_0x1a9335[_0xa2d0('0x37')],'WhatsappQueueId':_0x1a9335['id'],'interface':util[_0xa2d0('0x62')](_0xa2d0('0x63'),_0xa2d0('0x64'),_0x178fbd['name']),'penalty':0x0,'paused':_0x178fbd['whatsappPause'],'createdAt':_0x178fbd['createdAt'],'updatedAt':_0x178fbd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa2d0('0x2a')](respondWithFilteredResult(_0x581a0f,_0x30e01d))['catch'](handleError(_0x581a0f,null));};exports[_0xa2d0('0x65')]=function(_0x33648b,_0x285ab8,_0x3efb1f){var _0x55313a={};var _0x514068={};var _0xa419e7;var _0x35faaa;return db['WhatsappQueue'][_0xa2d0('0x66')]({'where':{'id':_0x33648b[_0xa2d0('0x4b')]['id']}})[_0xa2d0('0x2a')](handleEntityNotFound(_0x285ab8,null))[_0xa2d0('0x2a')](function(_0x5eb15c){if(_0x5eb15c){_0xa419e7=_0x5eb15c;_0x514068[_0xa2d0('0x35')]=_['keys'](db[_0xa2d0('0x67')][_0xa2d0('0x32')]);_0x514068['query']=_[_0xa2d0('0x39')](_0x33648b[_0xa2d0('0x38')]);_0x514068[_0xa2d0('0x3a')]=_[_0xa2d0('0x4c')](_0x514068[_0xa2d0('0x35')],_0x514068['query']);_0x55313a['attributes']=_['intersection'](_0x514068['model'],qs['fields'](_0x33648b[_0xa2d0('0x38')]['fields']));_0x55313a['attributes']=_0x55313a[_0xa2d0('0x3b')][_0xa2d0('0x3d')]?_0x55313a['attributes']:_0x514068[_0xa2d0('0x35')];_0x55313a[_0xa2d0('0x5b')]=qs['sort'](_0x33648b[_0xa2d0('0x38')][_0xa2d0('0x40')]);_0x55313a[_0xa2d0('0x41')]=qs[_0xa2d0('0x3a')](_['pick'](_0x33648b['query'],_0x514068[_0xa2d0('0x3a')]));if(_0x33648b[_0xa2d0('0x38')][_0xa2d0('0x43')]){_0x55313a['where']=_['merge'](_0x55313a[_0xa2d0('0x41')],{'$or':_[_0xa2d0('0x36')](_0x55313a[_0xa2d0('0x3b')],function(_0x1f75f0){var _0xe7f613={};_0xe7f613[_0x1f75f0]={'$like':'%'+_0x33648b[_0xa2d0('0x38')][_0xa2d0('0x43')]+'%'};return _0xe7f613;})});}_0x55313a=_[_0xa2d0('0x44')]({},_0x55313a,_0x33648b[_0xa2d0('0x4d')]);return _0xa419e7[_0xa2d0('0x65')](_0x55313a);}})[_0xa2d0('0x2a')](function(_0x49fda6){if(_0x49fda6){_0x35faaa=_0x49fda6[_0xa2d0('0x3d')];if(!_0x33648b[_0xa2d0('0x38')][_0xa2d0('0x3e')](_0xa2d0('0x3f'))){_0x55313a[_0xa2d0('0x23')]=qs['limit'](_0x33648b[_0xa2d0('0x38')]['limit']);_0x55313a['offset']=qs[_0xa2d0('0x20')](_0x33648b[_0xa2d0('0x38')][_0xa2d0('0x20')]);}return _0xa419e7['getTeams'](_0x55313a);}})[_0xa2d0('0x2a')](function(_0x34702b){if(_0x34702b){return _0x34702b?{'count':_0x35faaa,'rows':_0x34702b}:null;}})[_0xa2d0('0x2a')](respondWithResult(_0x285ab8,null))[_0xa2d0('0x49')](handleError(_0x285ab8,null));};exports[_0xa2d0('0x68')]=function(_0x46574a,_0x120d9a,_0x195a8b){var _0xb8ca4=_0x46574a[_0xa2d0('0x50')][_0xa2d0('0x69')];return db[_0xa2d0('0x67')][_0xa2d0('0x48')]({'where':{'id':_0xb8ca4},'attributes':['id'],'include':[{'model':db[_0xa2d0('0x6a')],'as':_0xa2d0('0x6b'),'attributes':['id','name','online',_0xa2d0('0x6c'),'interface'],'raw':!![]}]})[_0xa2d0('0x2a')](function(_0xc84b28){if(_0xc84b28){var _0x50a00e=_[_0xa2d0('0x6d')](_0xc84b28,function(_0x46ea27){var _0x51a51a=_0x46ea27[_0xa2d0('0x2b')]({'plain':!![]});return _0x51a51a[_0xa2d0('0x6b')];});return db[_0xa2d0('0x31')][_0xa2d0('0x4e')]({'where':{'id':_0x46574a[_0xa2d0('0x4b')]['id']}})['then'](function(_0x584504){return db['sequelize'][_0xa2d0('0x6e')](function(_0xa898d1){return _0x584504[_0xa2d0('0x68')](_0xb8ca4,{'transaction':_0xa898d1})[_0xa2d0('0x2a')](function(){return BPromise[_0xa2d0('0x6f')](_0x50a00e,function(_0x230405){return db[_0xa2d0('0x5a')][_0xa2d0('0x70')]({'where':{'UserId':_0x230405['id'],'WhatsappQueueId':_0x46574a['params']['id']},'transaction':_0xa898d1});});})[_0xa2d0('0x2a')](function(){_0x50a00e[_0xa2d0('0x71')](function(_0x5a9b8e){socket['emit'](_0xa2d0('0x72'),{'UserId':_0x5a9b8e['id'],'WhatsappQueueId':_0x584504['id']});});});});});}})[_0xa2d0('0x2a')](respondWithStatusCode(_0x120d9a,null))[_0xa2d0('0x49')](handleError(_0x120d9a,null));};exports['removeTeams']=function(_0x53a762,_0x351963,_0x16b192){return db[_0xa2d0('0x67')][_0xa2d0('0x48')]({'where':{'id':_0x53a762[_0xa2d0('0x38')][_0xa2d0('0x69')]},'attributes':['id'],'include':[{'model':db[_0xa2d0('0x6a')],'as':_0xa2d0('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xa2d0('0x2a')](handleEntityNotFound(_0x351963,null))[_0xa2d0('0x2a')](function(_0x44e871){var _0x18a419=_[_0xa2d0('0x36')](_0x44e871,'id');var _0x53bd1b=[];var _0x4bc141=[];var _0x464ca4=squel['select']();_0x464ca4[_0xa2d0('0x73')](_0xa2d0('0x74'))['from'](_0xa2d0('0x75'),'tq')[_0xa2d0('0x76')](_0xa2d0('0x77'),'ut',_0xa2d0('0x78'))[_0xa2d0('0x41')](_0xa2d0('0x79'),_0x53a762[_0xa2d0('0x4b')]['id']);for(var _0x582c4c=0x0;_0x582c4c<_0x44e871['length'];_0x582c4c+=0x1){let _0x5cc643=_0x44e871[_0x582c4c];for(var _0x20ecb8=0x0;_0x20ecb8<_0x5cc643[_0xa2d0('0x6b')][_0xa2d0('0x3d')];_0x20ecb8+=0x1){let _0x46c9cf=_0x5cc643[_0xa2d0('0x6b')][_0x20ecb8];var _0x44135c=_0x464ca4[_0xa2d0('0x7a')]();_0x44135c['where'](_0xa2d0('0x7b'),_0x46c9cf['id']);_0x4bc141[_0xa2d0('0x7c')](db[_0xa2d0('0x7d')][_0xa2d0('0x38')](_0x44135c[_0xa2d0('0x7e')](),{'type':db[_0xa2d0('0x7d')][_0xa2d0('0x7f')][_0xa2d0('0x80')]})['then'](function(_0x26f174){if(_0x26f174[_0xa2d0('0x3d')]===0x1){return _0x46c9cf['id'];}else{var _0x348c59=_[_0xa2d0('0x81')](_[_0xa2d0('0x36')](_0x26f174,'TeamId'),function(_0x277638){return _[_0xa2d0('0x82')](_0x18a419,_0x277638);});if(_0x348c59){return _0x46c9cf['id'];}}}));}}return BPromise['all'](_0x4bc141)[_0xa2d0('0x2a')](function(_0x20c566){_0x53bd1b=_(_0x53bd1b)[_0xa2d0('0x83')](_0x20c566)[_0xa2d0('0x84')]()[_0xa2d0('0x85')]();return db['WhatsappQueue'][_0xa2d0('0x4e')]({'where':{'id':_0x53a762[_0xa2d0('0x4b')]['id']}})[_0xa2d0('0x2a')](function(_0x31e8a9){return db[_0xa2d0('0x7d')][_0xa2d0('0x6e')](function(_0x402d89){return _0x31e8a9[_0xa2d0('0x86')](_0x53a762[_0xa2d0('0x38')][_0xa2d0('0x69')],{'transaction':_0x402d89})['then'](function(){if(!_[_0xa2d0('0x87')](_0x53bd1b)){return _0x31e8a9['removeAgents'](_0x53bd1b,{'transaction':_0x402d89});}})['then'](function(){_0x53bd1b[_0xa2d0('0x71')](function(_0x343a7d){socket['emit'](_0xa2d0('0x88'),{'UserId':_0x343a7d,'WhatsappQueueId':_0x31e8a9['id']});});});});});});})['then'](respondWithStatusCode(_0x351963,null))[_0xa2d0('0x49')](handleError(_0x351963,null));};exports['addAgents']=function(_0x1ae028,_0x53e69d,_0x48e856){return db[_0xa2d0('0x31')]['find']({'where':{'id':_0x1ae028[_0xa2d0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x53e69d,null))[_0xa2d0('0x2a')](function(_0x241826){if(_0x241826){return _0x241826[_0xa2d0('0x89')](_0x1ae028[_0xa2d0('0x50')][_0xa2d0('0x69')],_[_0xa2d0('0x8a')](_0x1ae028[_0xa2d0('0x50')],[_0xa2d0('0x69'),'id'])||{})[_0xa2d0('0x8b')](function(_0x35337a){for(var _0x23b2ab=0x0;_0x23b2ab<_0x1ae028[_0xa2d0('0x50')]['ids'][_0xa2d0('0x3d')];_0x23b2ab+=0x1){socket[_0xa2d0('0x8c')](_0xa2d0('0x72'),{'UserId':_0x1ae028[_0xa2d0('0x50')][_0xa2d0('0x69')][_0x23b2ab],'WhatsappQueueId':_0x1ae028[_0xa2d0('0x4b')]['id']});}return _0x35337a;});}})['then'](respondWithResult(_0x53e69d,null))[_0xa2d0('0x49')](handleError(_0x53e69d,null));};exports[_0xa2d0('0x8d')]=function(_0x2b615b,_0x437bd2,_0x18f39a){return db['WhatsappQueue'][_0xa2d0('0x4e')]({'where':{'id':_0x2b615b[_0xa2d0('0x4b')]['id']}})[_0xa2d0('0x2a')](handleEntityNotFound(_0x437bd2,null))[_0xa2d0('0x2a')](function(_0x380ea5){if(_0x380ea5){return _0x380ea5[_0xa2d0('0x8d')](_0x2b615b[_0xa2d0('0x38')][_0xa2d0('0x69')])[_0xa2d0('0x2a')](function(){if(_[_0xa2d0('0x8e')](_0x2b615b[_0xa2d0('0x38')][_0xa2d0('0x69')])){for(var _0x372b46=0x0;_0x372b46<_0x2b615b[_0xa2d0('0x38')][_0xa2d0('0x69')][_0xa2d0('0x3d')];_0x372b46+=0x1){socket[_0xa2d0('0x8c')](_0xa2d0('0x88'),{'UserId':Number(_0x2b615b[_0xa2d0('0x38')]['ids'][_0x372b46]),'WhatsappQueueId':Number(_0x2b615b['params']['id'])});}}else{socket['emit'](_0xa2d0('0x88'),{'UserId':Number(_0x2b615b['query'][_0xa2d0('0x69')]),'WhatsappQueueId':Number(_0x2b615b[_0xa2d0('0x4b')]['id'])});}});}})[_0xa2d0('0x2a')](respondWithStatusCode(_0x437bd2,null))[_0xa2d0('0x49')](handleError(_0x437bd2,null));};exports[_0xa2d0('0x8f')]=function(_0x538d99,_0x3b066b,_0x4ffe54){var _0x483821={};var _0x259a20={};var _0x574aaa;var _0x130c9c;return db[_0xa2d0('0x31')][_0xa2d0('0x66')]({'where':{'id':_0x538d99[_0xa2d0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3b066b,null))['then'](function(_0x2cb5c7){if(_0x2cb5c7){_0x574aaa=_0x2cb5c7;_0x259a20['model']=_[_0xa2d0('0x39')](db[_0xa2d0('0x6a')][_0xa2d0('0x32')]);_0x259a20[_0xa2d0('0x38')]=_['keys'](_0x538d99['query']);_0x259a20[_0xa2d0('0x3a')]=_['intersection'](_0x259a20[_0xa2d0('0x35')],_0x259a20[_0xa2d0('0x38')]);_0x483821[_0xa2d0('0x3b')]=_[_0xa2d0('0x4c')](_0x259a20['model'],qs[_0xa2d0('0x3c')](_0x538d99[_0xa2d0('0x38')][_0xa2d0('0x3c')]));_0x483821[_0xa2d0('0x3b')]=_0x483821[_0xa2d0('0x3b')][_0xa2d0('0x3d')]?_0x483821['attributes']:_0x259a20[_0xa2d0('0x35')];_0x483821[_0xa2d0('0x5b')]=qs[_0xa2d0('0x40')](_0x538d99[_0xa2d0('0x38')][_0xa2d0('0x40')]);_0x483821[_0xa2d0('0x41')]=qs[_0xa2d0('0x3a')](_['pick'](_0x538d99[_0xa2d0('0x38')],_0x259a20['filters']));if(_0x538d99['query']['filter']){_0x483821[_0xa2d0('0x41')]=_[_0xa2d0('0x44')](_0x483821['where'],{'$or':_[_0xa2d0('0x36')](_0x483821['attributes'],function(_0x176c59){var _0x3ba72a={};_0x3ba72a[_0x176c59]={'$like':'%'+_0x538d99[_0xa2d0('0x38')][_0xa2d0('0x43')]+'%'};return _0x3ba72a;})});}_0x483821=_[_0xa2d0('0x44')]({},_0x483821,_0x538d99[_0xa2d0('0x4d')]);return _0x574aaa[_0xa2d0('0x8f')](_0x483821);}})['then'](function(_0x1e1a11){if(_0x1e1a11){_0x130c9c=_0x1e1a11[_0xa2d0('0x3d')];if(!_0x538d99[_0xa2d0('0x38')][_0xa2d0('0x3e')]('nolimit')){_0x483821[_0xa2d0('0x23')]=qs[_0xa2d0('0x23')](_0x538d99[_0xa2d0('0x38')][_0xa2d0('0x23')]);_0x483821['offset']=qs['offset'](_0x538d99[_0xa2d0('0x38')]['offset']);}return _0x574aaa['getAgents'](_0x483821);}})[_0xa2d0('0x2a')](function(_0x2c34b4){if(_0x2c34b4){return _0x2c34b4?{'count':_0x130c9c,'rows':_0x2c34b4}:null;}})['then'](respondWithResult(_0x3b066b,null))['catch'](handleError(_0x3b066b,null));}; \ No newline at end of file +var _0x3cb7=['bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./whatsappQueue.socket','register','status','json','undefined','limit','offset','count','set','reject','save','update','then','destroy','get','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','type','VIRTUAL','options','where','WhatsappQueue','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','describe','getMembers','UserWhatsappQueue','order','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','value','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x5a9aa7,_0x55b38f){var _0x298adf=function(_0x2643d4){while(--_0x2643d4){_0x5a9aa7['push'](_0x5a9aa7['shift']());}};_0x298adf(++_0x55b38f);}(_0x3cb7,0x1a8));var _0x73cb=function(_0x324e86,_0x81b1cb){_0x324e86=_0x324e86-0x0;var _0x592846=_0x3cb7[_0x324e86];return _0x592846;};'use strict';var emlformat=require(_0x73cb('0x0'));var rimraf=require(_0x73cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x73cb('0x2'));var rp=require(_0x73cb('0x3'));var moment=require(_0x73cb('0x4'));var BPromise=require(_0x73cb('0x5'));var Mustache=require(_0x73cb('0x6'));var util=require('util');var path=require(_0x73cb('0x7'));var sox=require('sox');var csv=require(_0x73cb('0x8'));var ejs=require(_0x73cb('0x9'));var fs=require('fs');var fs_extra=require(_0x73cb('0xa'));var _=require(_0x73cb('0xb'));var squel=require(_0x73cb('0xc'));var crypto=require(_0x73cb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x73cb('0xe'));var toCsv=require(_0x73cb('0x8'));var querystring=require(_0x73cb('0xf'));var Papa=require(_0x73cb('0x10'));var Redis=require(_0x73cb('0x11'));var authService=require(_0x73cb('0x12'));var qs=require(_0x73cb('0x13'));var as=require(_0x73cb('0x14'));var hardwareService=require(_0x73cb('0x15'));var logger=require(_0x73cb('0x16'))(_0x73cb('0x17'));var utils=require(_0x73cb('0x18'));var config=require(_0x73cb('0x19'));var licenseUtil=require(_0x73cb('0x1a'));var db=require('../../mysqldb')['db'];config[_0x73cb('0x1b')]=_[_0x73cb('0x1c')](config[_0x73cb('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73cb('0x1b')]));require(_0x73cb('0x1d'))[_0x73cb('0x1e')](socket);function respondWithStatusCode(_0x554e20,_0xec7664){_0xec7664=_0xec7664||0xcc;return function(_0x2fa647){if(_0x2fa647){return _0x554e20['sendStatus'](_0xec7664);}return _0x554e20[_0x73cb('0x1f')](_0xec7664)['end']();};}function respondWithResult(_0x32f167,_0x3f7b57){_0x3f7b57=_0x3f7b57||0xc8;return function(_0x41b0aa){if(_0x41b0aa){return _0x32f167['status'](_0x3f7b57)[_0x73cb('0x20')](_0x41b0aa);}};}function respondWithFilteredResult(_0x487751,_0xc52f4a){return function(_0x1b2a83){if(_0x1b2a83){var _0x3077c9=typeof _0xc52f4a['offset']===_0x73cb('0x21')&&typeof _0xc52f4a[_0x73cb('0x22')]===_0x73cb('0x21');var _0x17d583=_0x1b2a83['count'];var _0x8eef2d=_0x3077c9?0x0:_0xc52f4a[_0x73cb('0x23')];var _0x35093a=_0x3077c9?_0x1b2a83[_0x73cb('0x24')]:_0xc52f4a[_0x73cb('0x23')]+_0xc52f4a[_0x73cb('0x22')];var _0x590cea;if(_0x35093a>=_0x17d583){_0x35093a=_0x17d583;_0x590cea=0xc8;}else{_0x590cea=0xce;}_0x487751[_0x73cb('0x1f')](_0x590cea);return _0x487751[_0x73cb('0x25')]('Content-Range',_0x8eef2d+'-'+_0x35093a+'/'+_0x17d583)['json'](_0x1b2a83);}return null;};}function patchUpdates(_0x5a030e){return function(_0x5550b0){try{jsonpatch['apply'](_0x5550b0,_0x5a030e,!![]);}catch(_0x310013){return BPromise[_0x73cb('0x26')](_0x310013);}return _0x5550b0[_0x73cb('0x27')]();};}function saveUpdates(_0x489db3,_0x2574e1){return function(_0x757511){if(_0x757511){return _0x757511[_0x73cb('0x28')](_0x489db3)[_0x73cb('0x29')](function(_0x263dd6){return _0x263dd6;});}return null;};}function removeEntity(_0x28cac5,_0x58eb8a){return function(_0x1afa3e){if(_0x1afa3e){return _0x1afa3e[_0x73cb('0x2a')]()['then'](function(){var _0x1981ae=_0x1afa3e[_0x73cb('0x2b')]({'plain':!![]});var _0x543553='WhatsappQueues';return db['UserProfileResource'][_0x73cb('0x2a')]({'where':{'type':_0x543553,'resourceId':_0x1981ae['id']}})[_0x73cb('0x29')](function(){return _0x1afa3e;});})['then'](function(){_0x28cac5[_0x73cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x350820,_0x2cd5a2){return function(_0x175be6){if(!_0x175be6){_0x350820[_0x73cb('0x2c')](0x194);}return _0x175be6;};}function handleError(_0x9a2833,_0xc0f5f7){_0xc0f5f7=_0xc0f5f7||0x1f4;return function(_0x4552e1){logger[_0x73cb('0x2d')](_0x4552e1[_0x73cb('0x2e')]);if(_0x4552e1[_0x73cb('0x2f')]){delete _0x4552e1[_0x73cb('0x2f')];}_0x9a2833[_0x73cb('0x1f')](_0xc0f5f7)[_0x73cb('0x30')](_0x4552e1);};}exports[_0x73cb('0x31')]=function(_0x5be308,_0x5f0f19){var _0x27e019={},_0x1e3a46={},_0x411839={'count':0x0,'rows':[]};var _0x543e70=_['map'](db['WhatsappQueue'][_0x73cb('0x32')],function(_0x1e700f){return{'name':_0x1e700f[_0x73cb('0x33')],'type':_0x1e700f['type'][_0x73cb('0x34')]};});_0x1e3a46[_0x73cb('0x35')]=_[_0x73cb('0x36')](_0x543e70,'name');_0x1e3a46[_0x73cb('0x37')]=_['keys'](_0x5be308[_0x73cb('0x37')]);_0x1e3a46['filters']=_['intersection'](_0x1e3a46[_0x73cb('0x35')],_0x1e3a46['query']);_0x27e019[_0x73cb('0x38')]=_[_0x73cb('0x39')](_0x1e3a46[_0x73cb('0x35')],qs[_0x73cb('0x3a')](_0x5be308['query']['fields']));_0x27e019[_0x73cb('0x38')]=_0x27e019[_0x73cb('0x38')][_0x73cb('0x3b')]?_0x27e019[_0x73cb('0x38')]:_0x1e3a46[_0x73cb('0x35')];if(!_0x5be308[_0x73cb('0x37')][_0x73cb('0x3c')](_0x73cb('0x3d'))){_0x27e019['limit']=qs[_0x73cb('0x22')](_0x5be308[_0x73cb('0x37')][_0x73cb('0x22')]);_0x27e019[_0x73cb('0x23')]=qs[_0x73cb('0x23')](_0x5be308[_0x73cb('0x37')][_0x73cb('0x23')]);}_0x27e019['order']=qs[_0x73cb('0x3e')](_0x5be308[_0x73cb('0x37')][_0x73cb('0x3e')]);_0x27e019['where']=qs['filters'](_[_0x73cb('0x3f')](_0x5be308['query'],_0x1e3a46[_0x73cb('0x40')]),_0x543e70);if(_0x5be308[_0x73cb('0x37')][_0x73cb('0x41')]){_0x27e019['where']=_[_0x73cb('0x42')](_0x27e019['where'],{'$or':_[_0x73cb('0x36')](_0x543e70,function(_0xee3e25){if(_0xee3e25[_0x73cb('0x43')]!==_0x73cb('0x44')){var _0x29336e={};_0x29336e[_0xee3e25[_0x73cb('0x2f')]]={'$like':'%'+_0x5be308[_0x73cb('0x37')][_0x73cb('0x41')]+'%'};return _0x29336e;}})});}_0x27e019=_[_0x73cb('0x42')]({},_0x27e019,_0x5be308[_0x73cb('0x45')]);var _0x2a95a7={'where':_0x27e019[_0x73cb('0x46')]};return db[_0x73cb('0x47')][_0x73cb('0x24')](_0x2a95a7)[_0x73cb('0x29')](function(_0x3c7e57){_0x411839[_0x73cb('0x24')]=_0x3c7e57;if(_0x5be308[_0x73cb('0x37')]['includeAll']){_0x27e019['include']=[{'all':!![]}];}return db[_0x73cb('0x47')][_0x73cb('0x48')](_0x27e019);})[_0x73cb('0x29')](function(_0x159519){_0x411839[_0x73cb('0x49')]=_0x159519;return _0x411839;})[_0x73cb('0x29')](respondWithFilteredResult(_0x5f0f19,_0x27e019))[_0x73cb('0x4a')](handleError(_0x5f0f19,null));};exports[_0x73cb('0x4b')]=function(_0x374913,_0xf844cd){var _0x4402e7={'raw':!![],'where':{'id':_0x374913[_0x73cb('0x4c')]['id']}},_0x4cf24f={};_0x4cf24f[_0x73cb('0x35')]=_[_0x73cb('0x4d')](db[_0x73cb('0x47')][_0x73cb('0x32')]);_0x4cf24f[_0x73cb('0x37')]=_[_0x73cb('0x4d')](_0x374913[_0x73cb('0x37')]);_0x4cf24f[_0x73cb('0x40')]=_[_0x73cb('0x39')](_0x4cf24f[_0x73cb('0x35')],_0x4cf24f[_0x73cb('0x37')]);_0x4402e7[_0x73cb('0x38')]=_[_0x73cb('0x39')](_0x4cf24f[_0x73cb('0x35')],qs[_0x73cb('0x3a')](_0x374913[_0x73cb('0x37')][_0x73cb('0x3a')]));_0x4402e7[_0x73cb('0x38')]=_0x4402e7['attributes'][_0x73cb('0x3b')]?_0x4402e7[_0x73cb('0x38')]:_0x4cf24f[_0x73cb('0x35')];if(_0x374913['query'][_0x73cb('0x4e')]){_0x4402e7['include']=[{'all':!![]}];}_0x4402e7=_['merge']({},_0x4402e7,_0x374913[_0x73cb('0x45')]);return db[_0x73cb('0x47')][_0x73cb('0x4f')](_0x4402e7)['then'](handleEntityNotFound(_0xf844cd,null))[_0x73cb('0x29')](respondWithResult(_0xf844cd,null))['catch'](handleError(_0xf844cd,null));};exports[_0x73cb('0x50')]=function(_0x1284f6,_0x4c47b1){return db[_0x73cb('0x47')][_0x73cb('0x50')](_0x1284f6[_0x73cb('0x51')],{})[_0x73cb('0x29')](function(_0x33d847){var _0x6e3c2e=_0x1284f6[_0x73cb('0x52')]['get']({'plain':!![]});if(!_0x6e3c2e)throw new Error(_0x73cb('0x53'));if(_0x6e3c2e[_0x73cb('0x54')]===_0x73cb('0x52')){var _0x408324=_0x33d847['get']({'plain':!![]});var _0xa909fe='WhatsappQueues';return db[_0x73cb('0x55')]['find']({'where':{'name':_0xa909fe,'userProfileId':_0x6e3c2e[_0x73cb('0x56')]},'raw':!![]})[_0x73cb('0x29')](function(_0x5c9731){if(_0x5c9731&&_0x5c9731['autoAssociation']===0x0){return db[_0x73cb('0x57')]['create']({'name':_0x408324['name'],'resourceId':_0x408324['id'],'type':_0x5c9731[_0x73cb('0x2f')],'sectionId':_0x5c9731['id']},{})['then'](function(){return _0x33d847;});}else{return _0x33d847;}})[_0x73cb('0x4a')](function(_0x19af7a){logger[_0x73cb('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19af7a);throw _0x19af7a;});}return _0x33d847;})[_0x73cb('0x29')](respondWithResult(_0x4c47b1,0xc9))[_0x73cb('0x4a')](handleError(_0x4c47b1,null));};exports[_0x73cb('0x28')]=function(_0x345712,_0x15ee0f){if(_0x345712['body']['id']){delete _0x345712[_0x73cb('0x51')]['id'];}return db[_0x73cb('0x47')][_0x73cb('0x4f')]({'where':{'id':_0x345712[_0x73cb('0x4c')]['id']}})[_0x73cb('0x29')](handleEntityNotFound(_0x15ee0f,null))['then'](saveUpdates(_0x345712['body'],null))[_0x73cb('0x29')](respondWithResult(_0x15ee0f,null))[_0x73cb('0x4a')](handleError(_0x15ee0f,null));};exports['destroy']=function(_0xbfae01,_0x102d3b){return db[_0x73cb('0x47')][_0x73cb('0x4f')]({'where':{'id':_0xbfae01[_0x73cb('0x4c')]['id']}})[_0x73cb('0x29')](handleEntityNotFound(_0x102d3b,null))[_0x73cb('0x29')](removeEntity(_0x102d3b,null))['catch'](handleError(_0x102d3b,null));};exports['describe']=function(_0x19fc2d,_0x5a0b0b){return db[_0x73cb('0x47')][_0x73cb('0x58')]()[_0x73cb('0x29')](respondWithResult(_0x5a0b0b,null))[_0x73cb('0x4a')](handleError(_0x5a0b0b,null));};exports[_0x73cb('0x59')]=function(_0x530880,_0x186703,_0x4e091f){var _0x5aa4a0={'raw':!![],'where':{}},_0xd384c9={},_0x32e772;return db['WhatsappQueue']['findOne']({'where':{'id':_0x530880[_0x73cb('0x4c')]['id']}})[_0x73cb('0x29')](handleEntityNotFound(_0x186703,null))['then'](function(_0x78de2e){if(_0x78de2e){_0x32e772=_0x78de2e['get']({'plain':!![]});_0xd384c9['model']=_[_0x73cb('0x4d')](db[_0x73cb('0x5a')][_0x73cb('0x32')]);_0xd384c9['query']=_['keys'](_0x530880[_0x73cb('0x37')]);_0xd384c9[_0x73cb('0x40')]=_[_0x73cb('0x39')](_0xd384c9[_0x73cb('0x35')],_0xd384c9[_0x73cb('0x37')]);_0x5aa4a0[_0x73cb('0x38')]=_[_0x73cb('0x39')](_0xd384c9[_0x73cb('0x35')],qs['fields'](_0x530880[_0x73cb('0x37')][_0x73cb('0x3a')]));_0x5aa4a0['attributes']=_0x5aa4a0[_0x73cb('0x38')][_0x73cb('0x3b')]?_0x5aa4a0[_0x73cb('0x38')]:_0xd384c9[_0x73cb('0x35')];if(!_0x530880[_0x73cb('0x37')]['hasOwnProperty'](_0x73cb('0x3d'))){_0x5aa4a0[_0x73cb('0x22')]=qs[_0x73cb('0x22')](_0x530880[_0x73cb('0x37')][_0x73cb('0x22')]);_0x5aa4a0[_0x73cb('0x23')]=qs[_0x73cb('0x23')](_0x530880[_0x73cb('0x37')][_0x73cb('0x23')]);}_0x5aa4a0[_0x73cb('0x5b')]=qs['sort'](_0x530880[_0x73cb('0x37')][_0x73cb('0x3e')]);_0x5aa4a0[_0x73cb('0x46')]=qs[_0x73cb('0x40')](_[_0x73cb('0x3f')](_0x530880[_0x73cb('0x37')],_0xd384c9['filters']));_0x5aa4a0[_0x73cb('0x46')][_0x73cb('0x5c')]=_0x78de2e['id'];if(_0x530880['query'][_0x73cb('0x41')]){_0x5aa4a0[_0x73cb('0x46')]=_[_0x73cb('0x42')](_0x5aa4a0[_0x73cb('0x46')],{'$or':_['map'](_0x5aa4a0[_0x73cb('0x38')],function(_0x34e1bf){var _0x218365={};_0x218365[_0x34e1bf]={'$like':'%'+_0x530880[_0x73cb('0x37')][_0x73cb('0x41')]+'%'};return _0x218365;})});}_0x5aa4a0=_['merge']({},_0x5aa4a0,_0x530880[_0x73cb('0x45')]);return db['UserWhatsappQueue'][_0x73cb('0x48')](_0x5aa4a0);}})[_0x73cb('0x29')](function(_0x4629d5){if(_0x4629d5){return db[_0x73cb('0x5d')][_0x73cb('0x5e')]({'where':{'id':_[_0x73cb('0x36')](_0x4629d5,_0x73cb('0x5f')),'role':_0x73cb('0x60')},'attributes':['id',_0x73cb('0x2f'),_0x73cb('0x61'),'updatedAt',_0x73cb('0x62')]});}})[_0x73cb('0x29')](function(_0x4b0087){if(_0x4b0087){return{'count':_0x4b0087[_0x73cb('0x24')],'rows':_['map'](_0x4b0087[_0x73cb('0x49')],function(_0x41a1dc){return{'membername':_0x41a1dc[_0x73cb('0x2f')],'UserId':_0x41a1dc['id'],'queue_name':_0x32e772[_0x73cb('0x2f')],'WhatsappQueueId':_0x32e772['id'],'interface':util[_0x73cb('0x63')](_0x73cb('0x64'),_0x73cb('0x65'),_0x41a1dc[_0x73cb('0x2f')]),'penalty':0x0,'paused':_0x41a1dc[_0x73cb('0x61')],'createdAt':_0x41a1dc[_0x73cb('0x62')],'updatedAt':_0x41a1dc[_0x73cb('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x186703,_0x5aa4a0))[_0x73cb('0x4a')](handleError(_0x186703,null));};exports[_0x73cb('0x67')]=function(_0x745352,_0x457fad,_0x4e512f){var _0x2f3e52={};var _0x3409c6={};var _0x4897c5;var _0x1057ec;return db[_0x73cb('0x47')]['findOne']({'where':{'id':_0x745352[_0x73cb('0x4c')]['id']}})[_0x73cb('0x29')](handleEntityNotFound(_0x457fad,null))[_0x73cb('0x29')](function(_0x32eb51){if(_0x32eb51){_0x4897c5=_0x32eb51;_0x3409c6[_0x73cb('0x35')]=_[_0x73cb('0x4d')](db[_0x73cb('0x68')][_0x73cb('0x32')]);_0x3409c6[_0x73cb('0x37')]=_['keys'](_0x745352[_0x73cb('0x37')]);_0x3409c6[_0x73cb('0x40')]=_[_0x73cb('0x39')](_0x3409c6[_0x73cb('0x35')],_0x3409c6[_0x73cb('0x37')]);_0x2f3e52[_0x73cb('0x38')]=_[_0x73cb('0x39')](_0x3409c6[_0x73cb('0x35')],qs['fields'](_0x745352['query'][_0x73cb('0x3a')]));_0x2f3e52['attributes']=_0x2f3e52[_0x73cb('0x38')][_0x73cb('0x3b')]?_0x2f3e52[_0x73cb('0x38')]:_0x3409c6[_0x73cb('0x35')];_0x2f3e52[_0x73cb('0x5b')]=qs[_0x73cb('0x3e')](_0x745352['query'][_0x73cb('0x3e')]);_0x2f3e52[_0x73cb('0x46')]=qs['filters'](_[_0x73cb('0x3f')](_0x745352[_0x73cb('0x37')],_0x3409c6[_0x73cb('0x40')]));if(_0x745352[_0x73cb('0x37')][_0x73cb('0x41')]){_0x2f3e52[_0x73cb('0x46')]=_[_0x73cb('0x42')](_0x2f3e52[_0x73cb('0x46')],{'$or':_['map'](_0x2f3e52[_0x73cb('0x38')],function(_0x4fab5c){var _0x4449d1={};_0x4449d1[_0x4fab5c]={'$like':'%'+_0x745352[_0x73cb('0x37')][_0x73cb('0x41')]+'%'};return _0x4449d1;})});}_0x2f3e52=_[_0x73cb('0x42')]({},_0x2f3e52,_0x745352['options']);return _0x4897c5[_0x73cb('0x67')](_0x2f3e52);}})[_0x73cb('0x29')](function(_0xd2e02d){if(_0xd2e02d){_0x1057ec=_0xd2e02d[_0x73cb('0x3b')];if(!_0x745352[_0x73cb('0x37')][_0x73cb('0x3c')](_0x73cb('0x3d'))){_0x2f3e52[_0x73cb('0x22')]=qs[_0x73cb('0x22')](_0x745352[_0x73cb('0x37')][_0x73cb('0x22')]);_0x2f3e52['offset']=qs[_0x73cb('0x23')](_0x745352[_0x73cb('0x37')]['offset']);}return _0x4897c5[_0x73cb('0x67')](_0x2f3e52);}})[_0x73cb('0x29')](function(_0x268f55){if(_0x268f55){return _0x268f55?{'count':_0x1057ec,'rows':_0x268f55}:null;}})[_0x73cb('0x29')](respondWithResult(_0x457fad,null))[_0x73cb('0x4a')](handleError(_0x457fad,null));};exports['addTeams']=function(_0x3f4b81,_0x45e3c5,_0x5b07ec){var _0x5a9f4c=_0x3f4b81[_0x73cb('0x51')][_0x73cb('0x69')];return db[_0x73cb('0x68')][_0x73cb('0x48')]({'where':{'id':_0x5a9f4c},'attributes':['id'],'include':[{'model':db[_0x73cb('0x5d')],'as':_0x73cb('0x6a'),'attributes':['id',_0x73cb('0x2f'),_0x73cb('0x6b'),_0x73cb('0x6c'),_0x73cb('0x6d')],'raw':!![]}]})[_0x73cb('0x29')](function(_0x19b676){if(_0x19b676){var _0x5880ec=_['flatMap'](_0x19b676,function(_0xfce5fb){var _0x511b93=_0xfce5fb['get']({'plain':!![]});return _0x511b93['Agents'];});return db[_0x73cb('0x47')][_0x73cb('0x4f')]({'where':{'id':_0x3f4b81[_0x73cb('0x4c')]['id']}})[_0x73cb('0x29')](function(_0x3358d0){return db[_0x73cb('0x6e')][_0x73cb('0x6f')](function(_0x41022a){return _0x3358d0[_0x73cb('0x70')](_0x5a9f4c,{'transaction':_0x41022a})[_0x73cb('0x29')](function(){return BPromise[_0x73cb('0x71')](_0x5880ec,function(_0x165932){return db['UserWhatsappQueue'][_0x73cb('0x72')]({'where':{'UserId':_0x165932['id'],'WhatsappQueueId':_0x3f4b81[_0x73cb('0x4c')]['id']},'transaction':_0x41022a});});})[_0x73cb('0x29')](function(){_0x5880ec['forEach'](function(_0x511030){socket[_0x73cb('0x73')](_0x73cb('0x74'),{'UserId':_0x511030['id'],'WhatsappQueueId':_0x3358d0['id']});});});});});}})[_0x73cb('0x29')](respondWithStatusCode(_0x45e3c5,null))[_0x73cb('0x4a')](handleError(_0x45e3c5,null));};exports[_0x73cb('0x75')]=function(_0x5129b5,_0x164108,_0x486f21){return db[_0x73cb('0x68')][_0x73cb('0x48')]({'where':{'id':_0x5129b5[_0x73cb('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x73cb('0x5d')],'as':_0x73cb('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x164108,null))['then'](function(_0x13c0e3){var _0x384485=_[_0x73cb('0x36')](_0x13c0e3,'id');var _0x42227a=[];var _0x3b0493=[];var _0x1a09fc=squel[_0x73cb('0x76')]();_0x1a09fc[_0x73cb('0x77')](_0x73cb('0x78'))[_0x73cb('0x79')](_0x73cb('0x7a'),'tq')[_0x73cb('0x7b')](_0x73cb('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x73cb('0x7d'),_0x5129b5[_0x73cb('0x4c')]['id']);for(var _0x5da54b=0x0;_0x5da54b<_0x13c0e3[_0x73cb('0x3b')];_0x5da54b+=0x1){let _0x3d2733=_0x13c0e3[_0x5da54b];for(var _0x5c6085=0x0;_0x5c6085<_0x3d2733[_0x73cb('0x6a')][_0x73cb('0x3b')];_0x5c6085+=0x1){let _0x3446a0=_0x3d2733['Agents'][_0x5c6085];var _0x247405=_0x1a09fc['clone']();_0x247405[_0x73cb('0x46')]('ut.UserId\x20=\x20?',_0x3446a0['id']);_0x3b0493[_0x73cb('0x7e')](db[_0x73cb('0x6e')]['query'](_0x247405[_0x73cb('0x7f')](),{'type':db[_0x73cb('0x6e')][_0x73cb('0x80')][_0x73cb('0x81')]})[_0x73cb('0x29')](function(_0x3f4421){if(_0x3f4421[_0x73cb('0x3b')]===0x1){return _0x3446a0['id'];}else{var _0x11bd0b=_[_0x73cb('0x82')](_[_0x73cb('0x36')](_0x3f4421,'TeamId'),function(_0xd55505){return _['includes'](_0x384485,_0xd55505);});if(_0x11bd0b){return _0x3446a0['id'];}}}));}}return BPromise[_0x73cb('0x83')](_0x3b0493)['then'](function(_0x537367){_0x42227a=_(_0x42227a)[_0x73cb('0x84')](_0x537367)[_0x73cb('0x85')]()[_0x73cb('0x86')]();return db[_0x73cb('0x47')][_0x73cb('0x4f')]({'where':{'id':_0x5129b5[_0x73cb('0x4c')]['id']}})[_0x73cb('0x29')](function(_0x25011c){return db[_0x73cb('0x6e')][_0x73cb('0x6f')](function(_0x480dc8){return _0x25011c[_0x73cb('0x75')](_0x5129b5['query'][_0x73cb('0x69')],{'transaction':_0x480dc8})[_0x73cb('0x29')](function(){if(!_['isEmpty'](_0x42227a)){return _0x25011c['removeAgents'](_0x42227a,{'transaction':_0x480dc8});}})['then'](function(){_0x42227a['forEach'](function(_0xf40fca){socket[_0x73cb('0x73')](_0x73cb('0x87'),{'UserId':_0xf40fca,'WhatsappQueueId':_0x25011c['id']});});});});});});})[_0x73cb('0x29')](respondWithStatusCode(_0x164108,null))[_0x73cb('0x4a')](handleError(_0x164108,null));};exports[_0x73cb('0x88')]=function(_0x563eab,_0x1fa773,_0x1ea69d){return db[_0x73cb('0x47')]['find']({'where':{'id':_0x563eab[_0x73cb('0x4c')]['id']}})[_0x73cb('0x29')](handleEntityNotFound(_0x1fa773,null))[_0x73cb('0x29')](function(_0xe9209b){if(_0xe9209b){return _0xe9209b[_0x73cb('0x88')](_0x563eab[_0x73cb('0x51')]['ids'],_[_0x73cb('0x89')](_0x563eab[_0x73cb('0x51')],[_0x73cb('0x69'),'id'])||{})[_0x73cb('0x8a')](function(_0x10d487){for(var _0x2e2fc9=0x0;_0x2e2fc9<_0x563eab[_0x73cb('0x51')][_0x73cb('0x69')][_0x73cb('0x3b')];_0x2e2fc9+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':_0x563eab[_0x73cb('0x51')][_0x73cb('0x69')][_0x2e2fc9],'WhatsappQueueId':_0x563eab['params']['id']});}return _0x10d487;});}})[_0x73cb('0x29')](respondWithResult(_0x1fa773,null))[_0x73cb('0x4a')](handleError(_0x1fa773,null));};exports[_0x73cb('0x8b')]=function(_0x10dc6c,_0x3b56f8,_0xb7f230){return db[_0x73cb('0x47')][_0x73cb('0x4f')]({'where':{'id':_0x10dc6c[_0x73cb('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b56f8,null))[_0x73cb('0x29')](function(_0xbd72da){if(_0xbd72da){return _0xbd72da[_0x73cb('0x8b')](_0x10dc6c[_0x73cb('0x37')][_0x73cb('0x69')])[_0x73cb('0x29')](function(){if(_[_0x73cb('0x8c')](_0x10dc6c[_0x73cb('0x37')][_0x73cb('0x69')])){for(var _0x4e1d4c=0x0;_0x4e1d4c<_0x10dc6c['query'][_0x73cb('0x69')][_0x73cb('0x3b')];_0x4e1d4c+=0x1){socket[_0x73cb('0x73')](_0x73cb('0x87'),{'UserId':Number(_0x10dc6c[_0x73cb('0x37')][_0x73cb('0x69')][_0x4e1d4c]),'WhatsappQueueId':Number(_0x10dc6c[_0x73cb('0x4c')]['id'])});}}else{socket['emit'](_0x73cb('0x87'),{'UserId':Number(_0x10dc6c['query'][_0x73cb('0x69')]),'WhatsappQueueId':Number(_0x10dc6c[_0x73cb('0x4c')]['id'])});}});}})[_0x73cb('0x29')](respondWithStatusCode(_0x3b56f8,null))[_0x73cb('0x4a')](handleError(_0x3b56f8,null));};exports[_0x73cb('0x8d')]=function(_0x193d66,_0x563cac,_0x5bf54c){var _0x15a38e={};var _0x3a0452={};var _0x3b2dac;var _0x1f7da6;return db[_0x73cb('0x47')][_0x73cb('0x8e')]({'where':{'id':_0x193d66[_0x73cb('0x4c')]['id']}})[_0x73cb('0x29')](handleEntityNotFound(_0x563cac,null))[_0x73cb('0x29')](function(_0x3efb3b){if(_0x3efb3b){_0x3b2dac=_0x3efb3b;_0x3a0452['model']=_[_0x73cb('0x4d')](db[_0x73cb('0x5d')]['rawAttributes']);_0x3a0452[_0x73cb('0x37')]=_[_0x73cb('0x4d')](_0x193d66[_0x73cb('0x37')]);_0x3a0452[_0x73cb('0x40')]=_[_0x73cb('0x39')](_0x3a0452[_0x73cb('0x35')],_0x3a0452[_0x73cb('0x37')]);_0x15a38e[_0x73cb('0x38')]=_[_0x73cb('0x39')](_0x3a0452[_0x73cb('0x35')],qs[_0x73cb('0x3a')](_0x193d66['query'][_0x73cb('0x3a')]));_0x15a38e[_0x73cb('0x38')]=_0x15a38e['attributes'][_0x73cb('0x3b')]?_0x15a38e[_0x73cb('0x38')]:_0x3a0452[_0x73cb('0x35')];_0x15a38e[_0x73cb('0x5b')]=qs[_0x73cb('0x3e')](_0x193d66[_0x73cb('0x37')]['sort']);_0x15a38e['where']=qs[_0x73cb('0x40')](_['pick'](_0x193d66['query'],_0x3a0452[_0x73cb('0x40')]));if(_0x193d66[_0x73cb('0x37')][_0x73cb('0x41')]){_0x15a38e[_0x73cb('0x46')]=_[_0x73cb('0x42')](_0x15a38e['where'],{'$or':_[_0x73cb('0x36')](_0x15a38e[_0x73cb('0x38')],function(_0x139d45){var _0x78decf={};_0x78decf[_0x139d45]={'$like':'%'+_0x193d66['query']['filter']+'%'};return _0x78decf;})});}_0x15a38e=_[_0x73cb('0x42')]({},_0x15a38e,_0x193d66[_0x73cb('0x45')]);return _0x3b2dac['getAgents'](_0x15a38e);}})['then'](function(_0x380e32){if(_0x380e32){_0x1f7da6=_0x380e32[_0x73cb('0x3b')];if(!_0x193d66[_0x73cb('0x37')]['hasOwnProperty'](_0x73cb('0x3d'))){_0x15a38e['limit']=qs[_0x73cb('0x22')](_0x193d66['query'][_0x73cb('0x22')]);_0x15a38e[_0x73cb('0x23')]=qs[_0x73cb('0x23')](_0x193d66[_0x73cb('0x37')][_0x73cb('0x23')]);}return _0x3b2dac[_0x73cb('0x8d')](_0x15a38e);}})[_0x73cb('0x29')](function(_0xeb1aba){if(_0xeb1aba){return _0xeb1aba?{'count':_0x1f7da6,'rows':_0xeb1aba}:null;}})[_0x73cb('0x29')](respondWithResult(_0x563cac,null))[_0x73cb('0x4a')](handleError(_0x563cac,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 6fd6bb6..95a30cf 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14d0=['exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hook'];(function(_0x82c354,_0x1b4c7d){var _0x593a18=function(_0x252cf5){while(--_0x252cf5){_0x82c354['push'](_0x82c354['shift']());}};_0x593a18(++_0x1b4c7d);}(_0x14d0,0x8d));var _0x014d=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0x14d0[_0xc40b9f];return _0x535b9c;};'use strict';var EventEmitter=require(_0x014d('0x0'));var WhatsappQueue=require(_0x014d('0x1'))['db'][_0x014d('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x014d('0x3')](0x0);var events={'afterCreate':_0x014d('0x4'),'afterUpdate':_0x014d('0x5'),'afterDestroy':_0x014d('0x6')};function emitEvent(_0x1f950a){return function(_0x93ab5a,_0x2bb130,_0x35afd2){WhatsappQueueEvents[_0x014d('0x7')](_0x1f950a+':'+_0x93ab5a['id'],_0x93ab5a);WhatsappQueueEvents[_0x014d('0x7')](_0x1f950a,_0x93ab5a);_0x35afd2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x014d('0x8')](e,emitEvent(event));}}module[_0x014d('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0xe849=['WhatsappQueue','setMaxListeners','save','update','remove','emit','events'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xe849,0x8b));var _0x9e84=function(_0x50812d,_0x49c2e9){_0x50812d=_0x50812d-0x0;var _0x1c0781=_0xe849[_0x50812d];return _0x1c0781;};'use strict';var EventEmitter=require(_0x9e84('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x9e84('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x9e84('0x2')](0x0);var events={'afterCreate':_0x9e84('0x3'),'afterUpdate':_0x9e84('0x4'),'afterDestroy':_0x9e84('0x5')};function emitEvent(_0x37cb63){return function(_0x13d130,_0x435d12,_0x2c2af6){WhatsappQueueEvents['emit'](_0x37cb63+':'+_0x13d130['id'],_0x13d130);WhatsappQueueEvents[_0x9e84('0x6')](_0x37cb63,_0x13d130);_0x2c2af6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 92e1f8d..a376d48 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab52=['define','whatsapp_queues','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xab52,0x18e));var _0x2ab5=function(_0x1aa4e8,_0x2ea4a6){_0x1aa4e8=_0x1aa4e8-0x0;var _0xe88a15=_0xab52[_0x1aa4e8];return _0xe88a15;};'use strict';var _=require(_0x2ab5('0x0'));var util=require(_0x2ab5('0x1'));var logger=require(_0x2ab5('0x2'))(_0x2ab5('0x3'));var moment=require(_0x2ab5('0x4'));var BPromise=require('bluebird');var rp=require(_0x2ab5('0x5'));var fs=require('fs');var path=require(_0x2ab5('0x6'));var rimraf=require('rimraf');var config=require(_0x2ab5('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0x2ab5('0x8')]=function(_0x863304,_0x5f33d2){return _0x863304[_0x2ab5('0x9')]('WhatsappQueue',attributes,{'tableName':_0x2ab5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a6a=['define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports'];(function(_0x56cba1,_0x2b23c1){var _0x3ddfdf=function(_0x1f8771){while(--_0x1f8771){_0x56cba1['push'](_0x56cba1['shift']());}};_0x3ddfdf(++_0x2b23c1);}(_0x1a6a,0xab));var _0xa1a6=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x1a6a[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0xa1a6('0x0'));var util=require(_0xa1a6('0x1'));var logger=require(_0xa1a6('0x2'))('api');var moment=require(_0xa1a6('0x3'));var BPromise=require(_0xa1a6('0x4'));var rp=require(_0xa1a6('0x5'));var fs=require('fs');var path=require(_0xa1a6('0x6'));var rimraf=require(_0xa1a6('0x7'));var config=require(_0xa1a6('0x8'));var attributes=require(_0xa1a6('0x9'));module[_0xa1a6('0xa')]=function(_0x56753d,_0x586ec4){return _0x56753d[_0xa1a6('0xb')](_0xa1a6('0xc'),attributes,{'tableName':_0xa1a6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 60dabdb..9e96747 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6e5=['debug','stringify','error','message','info','result','GetWhatsappQueue','findAll','options','raw','where','limit','map','include','attributes','model','catch','ShowWhatsappQueue','WhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','WhatsappQueue,\x20%s,\x20%s'];(function(_0x2e476a,_0x1c655d){var _0x188142=function(_0x4936ef){while(--_0x4936ef){_0x2e476a['push'](_0x2e476a['shift']());}};_0x188142(++_0x1c655d);}(_0xe6e5,0x1e7));var _0x5e6e=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xe6e5[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x5e6e('0x0'));var util=require(_0x5e6e('0x1'));var moment=require(_0x5e6e('0x2'));var BPromise=require(_0x5e6e('0x3'));var rs=require(_0x5e6e('0x4'));var fs=require('fs');var Redis=require(_0x5e6e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e6e('0x6'));var logger=require(_0x5e6e('0x7'))(_0x5e6e('0x8'));var config=require(_0x5e6e('0x9'));var jayson=require(_0x5e6e('0xa'));var client=jayson['client'][_0x5e6e('0xb')]({'port':0x232a});config[_0x5e6e('0xc')]=_[_0x5e6e('0xd')](config[_0x5e6e('0xc')],{'host':_0x5e6e('0xe'),'port':0x18eb});var socket=require(_0x5e6e('0xf'))(new Redis(config[_0x5e6e('0xc')]));require('./whatsappQueue.socket')[_0x5e6e('0x10')](socket);function respondWithRpcPromise(_0x1e67bd,_0x26ea1b,_0x29f03c){return new BPromise(function(_0x5a843c,_0x6f7aac){return client[_0x5e6e('0x11')](_0x1e67bd,_0x29f03c)[_0x5e6e('0x12')](function(_0x4468f9){logger['info'](_0x5e6e('0x13'),_0x26ea1b,'request\x20sent');logger[_0x5e6e('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x26ea1b,'request\x20sent',JSON[_0x5e6e('0x15')](_0x4468f9));if(_0x4468f9[_0x5e6e('0x16')]){if(_0x4468f9[_0x5e6e('0x16')]['code']===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x26ea1b,_0x4468f9['error'][_0x5e6e('0x17')]);return _0x6f7aac(_0x4468f9[_0x5e6e('0x16')][_0x5e6e('0x17')]);}logger[_0x5e6e('0x16')](_0x5e6e('0x13'),_0x26ea1b,_0x4468f9[_0x5e6e('0x16')]['message']);return _0x5a843c(_0x4468f9[_0x5e6e('0x16')][_0x5e6e('0x17')]);}else{logger[_0x5e6e('0x18')](_0x5e6e('0x13'),_0x26ea1b,'request\x20sent');_0x5a843c(_0x4468f9[_0x5e6e('0x19')][_0x5e6e('0x17')]);}})['catch'](function(_0x1a8972){logger[_0x5e6e('0x16')](_0x5e6e('0x13'),_0x26ea1b,_0x1a8972);_0x6f7aac(_0x1a8972);});});}exports[_0x5e6e('0x1a')]=function(_0x218b20){var _0x2ebda7=this;return new Promise(function(_0x42810c,_0x284ca0){return db['WhatsappQueue'][_0x5e6e('0x1b')]({'raw':_0x218b20[_0x5e6e('0x1c')]?_0x218b20['options'][_0x5e6e('0x1d')]===undefined?!![]:![]:!![],'where':_0x218b20[_0x5e6e('0x1c')]?_0x218b20[_0x5e6e('0x1c')][_0x5e6e('0x1e')]||null:null,'attributes':_0x218b20[_0x5e6e('0x1c')]?_0x218b20[_0x5e6e('0x1c')]['attributes']||null:null,'limit':_0x218b20[_0x5e6e('0x1c')]?_0x218b20[_0x5e6e('0x1c')][_0x5e6e('0x1f')]||null:null,'include':_0x218b20[_0x5e6e('0x1c')]?_0x218b20[_0x5e6e('0x1c')]['include']?_[_0x5e6e('0x20')](_0x218b20[_0x5e6e('0x1c')][_0x5e6e('0x21')],function(_0x25ba8f){return{'model':db[_0x25ba8f['model']],'as':_0x25ba8f['as'],'attributes':_0x25ba8f[_0x5e6e('0x22')],'include':_0x25ba8f[_0x5e6e('0x21')]?_[_0x5e6e('0x20')](_0x25ba8f[_0x5e6e('0x21')],function(_0x5730a2){return{'model':db[_0x5730a2[_0x5e6e('0x23')]],'as':_0x5730a2['as'],'attributes':_0x5730a2['attributes'],'include':_0x5730a2[_0x5e6e('0x21')]?_[_0x5e6e('0x20')](_0x5730a2[_0x5e6e('0x21')],function(_0x193236){return{'model':db[_0x193236[_0x5e6e('0x23')]],'as':_0x193236['as'],'attributes':_0x193236[_0x5e6e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5e6e('0x12')](function(_0x54ed59){logger['info']('GetWhatsappQueue',_0x218b20);logger['debug'](_0x5e6e('0x1a'),_0x218b20,JSON['stringify'](_0x54ed59));_0x42810c(_0x54ed59);})[_0x5e6e('0x24')](function(_0x3efd24){logger[_0x5e6e('0x16')](_0x5e6e('0x1a'),_0x3efd24[_0x5e6e('0x17')],_0x218b20);_0x284ca0(_0x2ebda7['error'](0x1f4,_0x3efd24[_0x5e6e('0x17')]));});});};exports[_0x5e6e('0x25')]=function(_0x5dca9b){var _0x130f93=this;return new Promise(function(_0x41682b,_0xeab151){return db[_0x5e6e('0x26')]['find']({'raw':_0x5dca9b[_0x5e6e('0x1c')]?_0x5dca9b['options'][_0x5e6e('0x1d')]===undefined?!![]:![]:!![],'where':_0x5dca9b[_0x5e6e('0x1c')]?_0x5dca9b[_0x5e6e('0x1c')]['where']||null:null,'attributes':_0x5dca9b[_0x5e6e('0x1c')]?_0x5dca9b[_0x5e6e('0x1c')][_0x5e6e('0x22')]||null:null,'include':_0x5dca9b[_0x5e6e('0x1c')]?_0x5dca9b['options'][_0x5e6e('0x21')]?_[_0x5e6e('0x20')](_0x5dca9b[_0x5e6e('0x1c')][_0x5e6e('0x21')],function(_0x504912){return{'model':db[_0x504912[_0x5e6e('0x23')]],'as':_0x504912['as'],'attributes':_0x504912[_0x5e6e('0x22')],'include':_0x504912[_0x5e6e('0x21')]?_[_0x5e6e('0x20')](_0x504912[_0x5e6e('0x21')],function(_0x45e453){return{'model':db[_0x45e453[_0x5e6e('0x23')]],'as':_0x45e453['as'],'attributes':_0x45e453[_0x5e6e('0x22')],'include':_0x45e453[_0x5e6e('0x21')]?_[_0x5e6e('0x20')](_0x45e453[_0x5e6e('0x21')],function(_0x40b7b8){return{'model':db[_0x40b7b8[_0x5e6e('0x23')]],'as':_0x40b7b8['as'],'attributes':_0x40b7b8[_0x5e6e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5e6e('0x12')](function(_0x480d1b){logger[_0x5e6e('0x18')](_0x5e6e('0x25'),_0x5dca9b);logger['debug'](_0x5e6e('0x25'),_0x5dca9b,JSON['stringify'](_0x480d1b));_0x41682b(_0x480d1b);})[_0x5e6e('0x24')](function(_0x26d663){logger['error'](_0x5e6e('0x25'),_0x26d663[_0x5e6e('0x17')],_0x5dca9b);_0xeab151(_0x130f93[_0x5e6e('0x16')](0x1f4,_0x26d663[_0x5e6e('0x17')]));});});}; \ No newline at end of file +var _0xafea=['where','attributes','include','map','model','GetWhatsappQueue','stringify','catch','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./whatsappQueue.socket','register','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','WhatsappQueue','findAll','options'];(function(_0x4a3ebd,_0x3e9fd1){var _0x4dca85=function(_0x417506){while(--_0x417506){_0x4a3ebd['push'](_0x4a3ebd['shift']());}};_0x4dca85(++_0x3e9fd1);}(_0xafea,0x172));var _0xaafe=function(_0x4123eb,_0x418858){_0x4123eb=_0x4123eb-0x0;var _0x32562a=_0xafea[_0x4123eb];return _0x32562a;};'use strict';var _=require(_0xaafe('0x0'));var util=require(_0xaafe('0x1'));var moment=require(_0xaafe('0x2'));var BPromise=require(_0xaafe('0x3'));var rs=require(_0xaafe('0x4'));var fs=require('fs');var Redis=require(_0xaafe('0x5'));var db=require(_0xaafe('0x6'))['db'];var utils=require(_0xaafe('0x7'));var logger=require(_0xaafe('0x8'))(_0xaafe('0x9'));var config=require('../../config/environment');var jayson=require(_0xaafe('0xa'));var client=jayson[_0xaafe('0xb')][_0xaafe('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xaafe('0xd')],{'host':_0xaafe('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaafe('0xd')]));require(_0xaafe('0xf'))[_0xaafe('0x10')](socket);function respondWithRpcPromise(_0x257f7c,_0x3a6ebd,_0xf64fe1){return new BPromise(function(_0x4ff7ef,_0x12f822){return client['request'](_0x257f7c,_0xf64fe1)[_0xaafe('0x11')](function(_0x46e8b7){logger['info'](_0xaafe('0x12'),_0x3a6ebd,_0xaafe('0x13'));logger[_0xaafe('0x14')](_0xaafe('0x15'),_0x3a6ebd,_0xaafe('0x13'),JSON['stringify'](_0x46e8b7));if(_0x46e8b7[_0xaafe('0x16')]){if(_0x46e8b7[_0xaafe('0x16')][_0xaafe('0x17')]===0x1f4){logger[_0xaafe('0x16')](_0xaafe('0x12'),_0x3a6ebd,_0x46e8b7[_0xaafe('0x16')][_0xaafe('0x18')]);return _0x12f822(_0x46e8b7[_0xaafe('0x16')][_0xaafe('0x18')]);}logger[_0xaafe('0x16')](_0xaafe('0x12'),_0x3a6ebd,_0x46e8b7[_0xaafe('0x16')][_0xaafe('0x18')]);return _0x4ff7ef(_0x46e8b7[_0xaafe('0x16')][_0xaafe('0x18')]);}else{logger[_0xaafe('0x19')](_0xaafe('0x12'),_0x3a6ebd,'request\x20sent');_0x4ff7ef(_0x46e8b7[_0xaafe('0x1a')][_0xaafe('0x18')]);}})['catch'](function(_0x1e6b54){logger[_0xaafe('0x16')](_0xaafe('0x12'),_0x3a6ebd,_0x1e6b54);_0x12f822(_0x1e6b54);});});}exports['GetWhatsappQueue']=function(_0x4d0178){var _0x3c0d09=this;return new Promise(function(_0x62423c,_0x12c5f6){return db[_0xaafe('0x1b')][_0xaafe('0x1c')]({'raw':_0x4d0178[_0xaafe('0x1d')]?_0x4d0178['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d0178[_0xaafe('0x1d')]?_0x4d0178[_0xaafe('0x1d')][_0xaafe('0x1e')]||null:null,'attributes':_0x4d0178[_0xaafe('0x1d')]?_0x4d0178[_0xaafe('0x1d')][_0xaafe('0x1f')]||null:null,'limit':_0x4d0178[_0xaafe('0x1d')]?_0x4d0178[_0xaafe('0x1d')]['limit']||null:null,'include':_0x4d0178[_0xaafe('0x1d')]?_0x4d0178[_0xaafe('0x1d')][_0xaafe('0x20')]?_[_0xaafe('0x21')](_0x4d0178['options']['include'],function(_0x1bf862){return{'model':db[_0x1bf862[_0xaafe('0x22')]],'as':_0x1bf862['as'],'attributes':_0x1bf862['attributes'],'include':_0x1bf862[_0xaafe('0x20')]?_[_0xaafe('0x21')](_0x1bf862['include'],function(_0x5d7693){return{'model':db[_0x5d7693['model']],'as':_0x5d7693['as'],'attributes':_0x5d7693['attributes'],'include':_0x5d7693['include']?_[_0xaafe('0x21')](_0x5d7693[_0xaafe('0x20')],function(_0x32f46f){return{'model':db[_0x32f46f['model']],'as':_0x32f46f['as'],'attributes':_0x32f46f[_0xaafe('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b2af9){logger[_0xaafe('0x19')](_0xaafe('0x23'),_0x4d0178);logger[_0xaafe('0x14')](_0xaafe('0x23'),_0x4d0178,JSON[_0xaafe('0x24')](_0x3b2af9));_0x62423c(_0x3b2af9);})[_0xaafe('0x25')](function(_0x175741){logger['error'](_0xaafe('0x23'),_0x175741[_0xaafe('0x18')],_0x4d0178);_0x12c5f6(_0x3c0d09[_0xaafe('0x16')](0x1f4,_0x175741[_0xaafe('0x18')]));});});};exports[_0xaafe('0x26')]=function(_0x23fea7){var _0x3d6885=this;return new Promise(function(_0x497d4c,_0x1e4cf5){return db[_0xaafe('0x1b')][_0xaafe('0x27')]({'raw':_0x23fea7[_0xaafe('0x1d')]?_0x23fea7[_0xaafe('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x23fea7['options']?_0x23fea7[_0xaafe('0x1d')][_0xaafe('0x1e')]||null:null,'attributes':_0x23fea7[_0xaafe('0x1d')]?_0x23fea7[_0xaafe('0x1d')]['attributes']||null:null,'include':_0x23fea7[_0xaafe('0x1d')]?_0x23fea7[_0xaafe('0x1d')][_0xaafe('0x20')]?_[_0xaafe('0x21')](_0x23fea7[_0xaafe('0x1d')]['include'],function(_0x237264){return{'model':db[_0x237264[_0xaafe('0x22')]],'as':_0x237264['as'],'attributes':_0x237264[_0xaafe('0x1f')],'include':_0x237264[_0xaafe('0x20')]?_[_0xaafe('0x21')](_0x237264[_0xaafe('0x20')],function(_0x3de24f){return{'model':db[_0x3de24f[_0xaafe('0x22')]],'as':_0x3de24f['as'],'attributes':_0x3de24f[_0xaafe('0x1f')],'include':_0x3de24f[_0xaafe('0x20')]?_['map'](_0x3de24f[_0xaafe('0x20')],function(_0x4a40f1){return{'model':db[_0x4a40f1[_0xaafe('0x22')]],'as':_0x4a40f1['as'],'attributes':_0x4a40f1[_0xaafe('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41b2e9){logger[_0xaafe('0x19')](_0xaafe('0x26'),_0x23fea7);logger[_0xaafe('0x14')](_0xaafe('0x26'),_0x23fea7,JSON[_0xaafe('0x24')](_0x41b2e9));_0x497d4c(_0x41b2e9);})[_0xaafe('0x25')](function(_0x92b2e7){logger[_0xaafe('0x16')](_0xaafe('0x26'),_0x92b2e7['message'],_0x23fea7);_0x1e4cf5(_0x3d6885[_0xaafe('0x16')](0x1f4,_0x92b2e7['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 5bf0359..44c3ab9 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c1f=['save','remove','update','emit','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x5c280d,_0xd67fa0){var _0x460137=function(_0x344a6c){while(--_0x344a6c){_0x5c280d['push'](_0x5c280d['shift']());}};_0x460137(++_0xd67fa0);}(_0x4c1f,0x14f));var _0xf4c1=function(_0x4d9f3c,_0x55b8dd){_0x4d9f3c=_0x4d9f3c-0x0;var _0xc935a3=_0x4c1f[_0x4d9f3c];return _0xc935a3;};'use strict';var WhatsappQueueEvents=require(_0xf4c1('0x0'));var events=[_0xf4c1('0x1'),_0xf4c1('0x2'),_0xf4c1('0x3')];function createListener(_0x96ade4,_0x3d02ce){return function(_0xc6c44a){_0x3d02ce[_0xf4c1('0x4')](_0x96ade4,_0xc6c44a);};}function removeListener(_0x384b66,_0x3e532e){return function(){WhatsappQueueEvents['removeListener'](_0x384b66,_0x3e532e);};}exports[_0xf4c1('0x5')]=function(_0x22c06d){for(var _0x235c7d=0x0,_0x3f2ae6=events[_0xf4c1('0x6')];_0x235c7d<_0x3f2ae6;_0x235c7d++){var _0x43cbfb=events[_0x235c7d];var _0x3dec35=createListener(_0xf4c1('0x7')+_0x43cbfb,_0x22c06d);WhatsappQueueEvents['on'](_0x43cbfb,_0x3dec35);}}; \ No newline at end of file +var _0xbf13=['removeListener','register','length','./whatsappQueue.events','save','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf13,0x173));var _0x3bf1=function(_0xdba375,_0x2a01d0){_0xdba375=_0xdba375-0x0;var _0x591a41=_0xbf13[_0xdba375];return _0x591a41;};'use strict';var WhatsappQueueEvents=require(_0x3bf1('0x0'));var events=[_0x3bf1('0x1'),_0x3bf1('0x2'),_0x3bf1('0x3')];function createListener(_0x20b9e3,_0x2ab602){return function(_0x200e96){_0x2ab602[_0x3bf1('0x4')](_0x20b9e3,_0x200e96);};}function removeListener(_0x159413,_0x4529be){return function(){WhatsappQueueEvents[_0x3bf1('0x5')](_0x159413,_0x4529be);};}exports[_0x3bf1('0x6')]=function(_0x3dbd2a){for(var _0x1189cb=0x0,_0x522c73=events[_0x3bf1('0x7')];_0x1189cb<_0x522c73;_0x1189cb++){var _0x350905=events[_0x1189cb];var _0x48d6f3=createListener('whatsappQueue:'+_0x350905,_0x3dbd2a);WhatsappQueueEvents['on'](_0x350905,_0x48d6f3);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 472c09c..22289c5 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ff3=['/:id','post','create','put','update','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index'];(function(_0x219007,_0x53298a){var _0x4b46db=function(_0x53b2b0){while(--_0x53b2b0){_0x219007['push'](_0x219007['shift']());}};_0x4b46db(++_0x53298a);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2f8919,_0x128bc2){_0x2f8919=_0x2f8919-0x0;var _0x2e658d=_0x5ff3[_0x2f8919];return _0x2e658d;};'use strict';var multer=require('multer');var util=require(_0x35ff('0x0'));var path=require('path');var timeout=require(_0x35ff('0x1'));var express=require('express');var router=express[_0x35ff('0x2')]();var fs_extra=require(_0x35ff('0x3'));var auth=require(_0x35ff('0x4'));var interaction=require(_0x35ff('0x5'));var config=require('../../config/environment');var controller=require(_0x35ff('0x6'));router[_0x35ff('0x7')]('/',auth[_0x35ff('0x8')](),controller[_0x35ff('0x9')]);router[_0x35ff('0x7')]('/describe',auth[_0x35ff('0x8')](),controller['describe']);router[_0x35ff('0x7')](_0x35ff('0xa'),auth[_0x35ff('0x8')](),controller['show']);router[_0x35ff('0xb')]('/',auth['isAuthenticated'](),controller[_0x35ff('0xc')]);router[_0x35ff('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x35ff('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x35ff('0xf')]);module[_0x35ff('0x10')]=router; \ No newline at end of file +var _0xe600=['describe','/:id','show','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','/describe'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xe600,0x159));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x0e60('0x0'));var path=require('path');var timeout=require(_0x0e60('0x1'));var express=require(_0x0e60('0x2'));var router=express[_0x0e60('0x3')]();var fs_extra=require(_0x0e60('0x4'));var auth=require(_0x0e60('0x5'));var interaction=require(_0x0e60('0x6'));var config=require(_0x0e60('0x7'));var controller=require(_0x0e60('0x8'));router[_0x0e60('0x9')]('/',auth[_0x0e60('0xa')](),controller['index']);router[_0x0e60('0x9')](_0x0e60('0xb'),auth[_0x0e60('0xa')](),controller[_0x0e60('0xc')]);router['get'](_0x0e60('0xd'),auth[_0x0e60('0xa')](),controller[_0x0e60('0xe')]);router[_0x0e60('0xf')]('/',auth[_0x0e60('0xa')](),controller[_0x0e60('0x10')]);router['put'](_0x0e60('0xd'),auth[_0x0e60('0xa')](),controller[_0x0e60('0x11')]);router[_0x0e60('0x12')](_0x0e60('0xd'),auth[_0x0e60('0xa')](),controller[_0x0e60('0x13')]);module[_0x0e60('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 4e9b109..735e45d 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['STRING','DATE','sequelize','exports'];(function(_0x39ef79,_0x4cd3ab){var _0x529871=function(_0x253003){while(--_0x253003){_0x39ef79['push'](_0x39ef79['shift']());}};_0x529871(++_0x4cd3ab);}(_0x8ef6,0xf2));var _0x68ef=function(_0x269e27,_0x333704){_0x269e27=_0x269e27-0x0;var _0x3e08a9=_0x8ef6[_0x269e27];return _0x3e08a9;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'uniqueid':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x68ef('0x2')]},'joinAt':{'type':Sequelize[_0x68ef('0x3')]},'leaveAt':{'type':Sequelize[_0x68ef('0x3')]},'acceptAt':{'type':Sequelize[_0x68ef('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x68ef('0x2')]}}; \ No newline at end of file +var _0x00bb=['sequelize','exports','STRING','DATE'];(function(_0x1ab616,_0x2a359){var _0x20425d=function(_0x53277f){while(--_0x53277f){_0x1ab616['push'](_0x1ab616['shift']());}};_0x20425d(++_0x2a359);}(_0x00bb,0x1d8));var _0xb00b=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x00bb[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'uniqueid':{'type':Sequelize[_0xb00b('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xb00b('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb00b('0x3')]},'exitAt':{'type':Sequelize[_0xb00b('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 4aca566..5989df1 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3b1=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel'];(function(_0x3e7b3b,_0x14d240){var _0x2aa720=function(_0x535885){while(--_0x535885){_0x3e7b3b['push'](_0x3e7b3b['shift']());}};_0x2aa720(++_0x14d240);}(_0xf3b1,0x16a));var _0x1f3b=function(_0x5bd7dd,_0x1019e6){_0x5bd7dd=_0x5bd7dd-0x0;var _0x4b5c1e=_0xf3b1[_0x5bd7dd];return _0x4b5c1e;};'use strict';var emlformat=require(_0x1f3b('0x0'));var rimraf=require(_0x1f3b('0x1'));var zipdir=require(_0x1f3b('0x2'));var jsonpatch=require(_0x1f3b('0x3'));var rp=require(_0x1f3b('0x4'));var moment=require(_0x1f3b('0x5'));var BPromise=require(_0x1f3b('0x6'));var Mustache=require(_0x1f3b('0x7'));var util=require(_0x1f3b('0x8'));var path=require('path');var sox=require(_0x1f3b('0x9'));var csv=require(_0x1f3b('0xa'));var ejs=require(_0x1f3b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1f3b('0xc'));var crypto=require(_0x1f3b('0xd'));var jsforce=require(_0x1f3b('0xe'));var deskjs=require(_0x1f3b('0xf'));var toCsv=require(_0x1f3b('0xa'));var querystring=require(_0x1f3b('0x10'));var Papa=require(_0x1f3b('0x11'));var Redis=require('ioredis');var authService=require(_0x1f3b('0x12'));var qs=require(_0x1f3b('0x13'));var as=require(_0x1f3b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f3b('0x15'))(_0x1f3b('0x16'));var utils=require(_0x1f3b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1f3b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ee464,_0x7d5295){_0x7d5295=_0x7d5295||0xcc;return function(_0x2c1071){if(_0x2c1071){return _0x4ee464[_0x1f3b('0x19')](_0x7d5295);}return _0x4ee464['status'](_0x7d5295)['end']();};}function respondWithResult(_0x3239cd,_0x31ee51){_0x31ee51=_0x31ee51||0xc8;return function(_0x3cbd9f){if(_0x3cbd9f){return _0x3239cd[_0x1f3b('0x1a')](_0x31ee51)[_0x1f3b('0x1b')](_0x3cbd9f);}};}function respondWithFilteredResult(_0x1c4e2b,_0x424a50){return function(_0x324a6b){if(_0x324a6b){var _0x2ac99a=typeof _0x424a50[_0x1f3b('0x1c')]===_0x1f3b('0x1d')&&typeof _0x424a50[_0x1f3b('0x1e')]===_0x1f3b('0x1d');var _0x244e6a=_0x324a6b[_0x1f3b('0x1f')];var _0x37382f=_0x2ac99a?0x0:_0x424a50[_0x1f3b('0x1c')];var _0x5f4fc3=_0x2ac99a?_0x324a6b['count']:_0x424a50[_0x1f3b('0x1c')]+_0x424a50[_0x1f3b('0x1e')];var _0x1f75a3;if(_0x5f4fc3>=_0x244e6a){_0x5f4fc3=_0x244e6a;_0x1f75a3=0xc8;}else{_0x1f75a3=0xce;}_0x1c4e2b['status'](_0x1f75a3);return _0x1c4e2b[_0x1f3b('0x20')](_0x1f3b('0x21'),_0x37382f+'-'+_0x5f4fc3+'/'+_0x244e6a)[_0x1f3b('0x1b')](_0x324a6b);}return null;};}function patchUpdates(_0x3b3536){return function(_0x25b683){try{jsonpatch[_0x1f3b('0x22')](_0x25b683,_0x3b3536,!![]);}catch(_0x9fa096){return BPromise[_0x1f3b('0x23')](_0x9fa096);}return _0x25b683[_0x1f3b('0x24')]();};}function saveUpdates(_0x3346b6,_0x3fd9aa){return function(_0x455886){if(_0x455886){return _0x455886[_0x1f3b('0x25')](_0x3346b6)[_0x1f3b('0x26')](function(_0x43408c){return _0x43408c;});}return null;};}function removeEntity(_0x443b6d,_0x35425c){return function(_0x2404e9){if(_0x2404e9){return _0x2404e9['destroy']()[_0x1f3b('0x26')](function(){_0x443b6d[_0x1f3b('0x1a')](0xcc)[_0x1f3b('0x27')]();});}};}function handleEntityNotFound(_0x1a9d77,_0x1b15bc){return function(_0x149c82){if(!_0x149c82){_0x1a9d77[_0x1f3b('0x19')](0x194);}return _0x149c82;};}function handleError(_0x4ae009,_0x4a36af){_0x4a36af=_0x4a36af||0x1f4;return function(_0x2ef14a){logger[_0x1f3b('0x28')](_0x2ef14a[_0x1f3b('0x29')]);if(_0x2ef14a[_0x1f3b('0x2a')]){delete _0x2ef14a[_0x1f3b('0x2a')];}_0x4ae009[_0x1f3b('0x1a')](_0x4a36af)[_0x1f3b('0x2b')](_0x2ef14a);};}exports[_0x1f3b('0x2c')]=function(_0x3658b9,_0x121133){var _0x3df24d={},_0x50ace4={},_0x1df638={'count':0x0,'rows':[]};var _0x427fe8=_['map'](db[_0x1f3b('0x2d')][_0x1f3b('0x2e')],function(_0x596762){return{'name':_0x596762[_0x1f3b('0x2f')],'type':_0x596762[_0x1f3b('0x30')][_0x1f3b('0x31')]};});_0x50ace4[_0x1f3b('0x32')]=_['map'](_0x427fe8,_0x1f3b('0x2a'));_0x50ace4[_0x1f3b('0x33')]=_[_0x1f3b('0x34')](_0x3658b9[_0x1f3b('0x33')]);_0x50ace4[_0x1f3b('0x35')]=_[_0x1f3b('0x36')](_0x50ace4[_0x1f3b('0x32')],_0x50ace4[_0x1f3b('0x33')]);_0x3df24d['attributes']=_[_0x1f3b('0x36')](_0x50ace4['model'],qs[_0x1f3b('0x37')](_0x3658b9[_0x1f3b('0x33')][_0x1f3b('0x37')]));_0x3df24d[_0x1f3b('0x38')]=_0x3df24d[_0x1f3b('0x38')][_0x1f3b('0x39')]?_0x3df24d[_0x1f3b('0x38')]:_0x50ace4[_0x1f3b('0x32')];if(!_0x3658b9[_0x1f3b('0x33')]['hasOwnProperty']('nolimit')){_0x3df24d[_0x1f3b('0x1e')]=qs[_0x1f3b('0x1e')](_0x3658b9[_0x1f3b('0x33')][_0x1f3b('0x1e')]);_0x3df24d[_0x1f3b('0x1c')]=qs[_0x1f3b('0x1c')](_0x3658b9['query'][_0x1f3b('0x1c')]);}_0x3df24d[_0x1f3b('0x3a')]=qs['sort'](_0x3658b9[_0x1f3b('0x33')][_0x1f3b('0x3b')]);_0x3df24d['where']=qs['filters'](_['pick'](_0x3658b9[_0x1f3b('0x33')],_0x50ace4[_0x1f3b('0x35')]),_0x427fe8);if(_0x3658b9[_0x1f3b('0x33')]['filter']){_0x3df24d[_0x1f3b('0x3c')]=_[_0x1f3b('0x3d')](_0x3df24d[_0x1f3b('0x3c')],{'$or':_['map'](_0x427fe8,function(_0x23676b){if(_0x23676b['type']!==_0x1f3b('0x3e')){var _0x5c26f8={};_0x5c26f8[_0x23676b['name']]={'$like':'%'+_0x3658b9[_0x1f3b('0x33')]['filter']+'%'};return _0x5c26f8;}})});}_0x3df24d=_['merge']({},_0x3df24d,_0x3658b9['options']);var _0x35f9ab={'where':_0x3df24d['where']};return db['WhatsappQueueReport']['count'](_0x35f9ab)[_0x1f3b('0x26')](function(_0x37cf8c){_0x1df638[_0x1f3b('0x1f')]=_0x37cf8c;if(_0x3658b9[_0x1f3b('0x33')][_0x1f3b('0x3f')]){_0x3df24d[_0x1f3b('0x40')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x1f3b('0x41')](_0x3df24d);})[_0x1f3b('0x26')](function(_0x5d218e){_0x1df638['rows']=_0x5d218e;return _0x1df638;})[_0x1f3b('0x26')](respondWithFilteredResult(_0x121133,_0x3df24d))[_0x1f3b('0x42')](handleError(_0x121133,null));};exports[_0x1f3b('0x43')]=function(_0x2b134c,_0x3c8c34){var _0x2c55d0={'raw':!![],'where':{'id':_0x2b134c[_0x1f3b('0x44')]['id']}},_0x2a1496={};_0x2a1496[_0x1f3b('0x32')]=_['keys'](db[_0x1f3b('0x2d')][_0x1f3b('0x2e')]);_0x2a1496['query']=_['keys'](_0x2b134c[_0x1f3b('0x33')]);_0x2a1496[_0x1f3b('0x35')]=_['intersection'](_0x2a1496[_0x1f3b('0x32')],_0x2a1496[_0x1f3b('0x33')]);_0x2c55d0[_0x1f3b('0x38')]=_['intersection'](_0x2a1496[_0x1f3b('0x32')],qs[_0x1f3b('0x37')](_0x2b134c[_0x1f3b('0x33')][_0x1f3b('0x37')]));_0x2c55d0[_0x1f3b('0x38')]=_0x2c55d0[_0x1f3b('0x38')]['length']?_0x2c55d0[_0x1f3b('0x38')]:_0x2a1496[_0x1f3b('0x32')];if(_0x2b134c['query'][_0x1f3b('0x3f')]){_0x2c55d0[_0x1f3b('0x40')]=[{'all':!![]}];}_0x2c55d0=_['merge']({},_0x2c55d0,_0x2b134c[_0x1f3b('0x45')]);return db['WhatsappQueueReport'][_0x1f3b('0x46')](_0x2c55d0)[_0x1f3b('0x26')](handleEntityNotFound(_0x3c8c34,null))['then'](respondWithResult(_0x3c8c34,null))[_0x1f3b('0x42')](handleError(_0x3c8c34,null));};exports[_0x1f3b('0x47')]=function(_0x1662dc,_0x4362e7){return db[_0x1f3b('0x2d')]['create'](_0x1662dc[_0x1f3b('0x48')],{})[_0x1f3b('0x26')](respondWithResult(_0x4362e7,0xc9))['catch'](handleError(_0x4362e7,null));};exports[_0x1f3b('0x25')]=function(_0x5e31c2,_0xb768e7){if(_0x5e31c2[_0x1f3b('0x48')]['id']){delete _0x5e31c2[_0x1f3b('0x48')]['id'];}return db[_0x1f3b('0x2d')][_0x1f3b('0x46')]({'where':{'id':_0x5e31c2[_0x1f3b('0x44')]['id']}})[_0x1f3b('0x26')](handleEntityNotFound(_0xb768e7,null))[_0x1f3b('0x26')](saveUpdates(_0x5e31c2[_0x1f3b('0x48')],null))['then'](respondWithResult(_0xb768e7,null))[_0x1f3b('0x42')](handleError(_0xb768e7,null));};exports[_0x1f3b('0x49')]=function(_0x35164a,_0x5aae90){return db[_0x1f3b('0x2d')]['find']({'where':{'id':_0x35164a['params']['id']}})[_0x1f3b('0x26')](handleEntityNotFound(_0x5aae90,null))[_0x1f3b('0x26')](removeEntity(_0x5aae90,null))[_0x1f3b('0x42')](handleError(_0x5aae90,null));};exports['describe']=function(_0x437207,_0x2798cc){return db['WhatsappQueueReport'][_0x1f3b('0x4a')]()[_0x1f3b('0x26')](respondWithResult(_0x2798cc,null))[_0x1f3b('0x42')](handleError(_0x2798cc,null));}; \ No newline at end of file +var _0xc67e=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','apply','reject','update','destroy','then','end','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x5e4b35,_0x4d0efd){var _0x220bde=function(_0xa4f167){while(--_0xa4f167){_0x5e4b35['push'](_0x5e4b35['shift']());}};_0x220bde(++_0x4d0efd);}(_0xc67e,0x110));var _0xec67=function(_0x6c31a8,_0x417cb7){_0x6c31a8=_0x6c31a8-0x0;var _0x138b37=_0xc67e[_0x6c31a8];return _0x138b37;};'use strict';var emlformat=require(_0xec67('0x0'));var rimraf=require(_0xec67('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xec67('0x2'));var moment=require(_0xec67('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xec67('0x4'));var path=require(_0xec67('0x5'));var sox=require('sox');var csv=require(_0xec67('0x6'));var ejs=require(_0xec67('0x7'));var fs=require('fs');var fs_extra=require(_0xec67('0x8'));var _=require(_0xec67('0x9'));var squel=require(_0xec67('0xa'));var crypto=require(_0xec67('0xb'));var jsforce=require(_0xec67('0xc'));var deskjs=require(_0xec67('0xd'));var toCsv=require(_0xec67('0x6'));var querystring=require(_0xec67('0xe'));var Papa=require('papaparse');var Redis=require(_0xec67('0xf'));var authService=require(_0xec67('0x10'));var qs=require(_0xec67('0x11'));var as=require(_0xec67('0x12'));var hardwareService=require(_0xec67('0x13'));var logger=require(_0xec67('0x14'))('api');var utils=require(_0xec67('0x15'));var config=require(_0xec67('0x16'));var licenseUtil=require(_0xec67('0x17'));var db=require(_0xec67('0x18'))['db'];function respondWithStatusCode(_0x884631,_0x5eca12){_0x5eca12=_0x5eca12||0xcc;return function(_0x98c145){if(_0x98c145){return _0x884631[_0xec67('0x19')](_0x5eca12);}return _0x884631[_0xec67('0x1a')](_0x5eca12)['end']();};}function respondWithResult(_0x54daae,_0x2342c4){_0x2342c4=_0x2342c4||0xc8;return function(_0x1bfb5e){if(_0x1bfb5e){return _0x54daae[_0xec67('0x1a')](_0x2342c4)[_0xec67('0x1b')](_0x1bfb5e);}};}function respondWithFilteredResult(_0x533fb,_0x1a531e){return function(_0x308363){if(_0x308363){var _0x3e4ec8=typeof _0x1a531e['offset']===_0xec67('0x1c')&&typeof _0x1a531e[_0xec67('0x1d')]==='undefined';var _0x5d94f3=_0x308363['count'];var _0x414390=_0x3e4ec8?0x0:_0x1a531e[_0xec67('0x1e')];var _0x58a489=_0x3e4ec8?_0x308363[_0xec67('0x1f')]:_0x1a531e[_0xec67('0x1e')]+_0x1a531e[_0xec67('0x1d')];var _0x3df053;if(_0x58a489>=_0x5d94f3){_0x58a489=_0x5d94f3;_0x3df053=0xc8;}else{_0x3df053=0xce;}_0x533fb[_0xec67('0x1a')](_0x3df053);return _0x533fb['set']('Content-Range',_0x414390+'-'+_0x58a489+'/'+_0x5d94f3)[_0xec67('0x1b')](_0x308363);}return null;};}function patchUpdates(_0x27b2d2){return function(_0x16b6a6){try{jsonpatch[_0xec67('0x20')](_0x16b6a6,_0x27b2d2,!![]);}catch(_0x567997){return BPromise[_0xec67('0x21')](_0x567997);}return _0x16b6a6['save']();};}function saveUpdates(_0x1dc03b,_0x1d49c4){return function(_0x3f1061){if(_0x3f1061){return _0x3f1061[_0xec67('0x22')](_0x1dc03b)['then'](function(_0x395ad8){return _0x395ad8;});}return null;};}function removeEntity(_0x3cd3c2,_0x12506a){return function(_0x1c9684){if(_0x1c9684){return _0x1c9684[_0xec67('0x23')]()[_0xec67('0x24')](function(){_0x3cd3c2[_0xec67('0x1a')](0xcc)[_0xec67('0x25')]();});}};}function handleEntityNotFound(_0x3e8ba6,_0x174906){return function(_0x1bab1b){if(!_0x1bab1b){_0x3e8ba6[_0xec67('0x19')](0x194);}return _0x1bab1b;};}function handleError(_0x4fc9c6,_0x3d6bcf){_0x3d6bcf=_0x3d6bcf||0x1f4;return function(_0x4e6adb){logger['error'](_0x4e6adb[_0xec67('0x26')]);if(_0x4e6adb[_0xec67('0x27')]){delete _0x4e6adb[_0xec67('0x27')];}_0x4fc9c6[_0xec67('0x1a')](_0x3d6bcf)[_0xec67('0x28')](_0x4e6adb);};}exports[_0xec67('0x29')]=function(_0x297129,_0x558d6a){var _0x239204={},_0x2b53ff={},_0x1e4b66={'count':0x0,'rows':[]};var _0xf6970a=_[_0xec67('0x2a')](db[_0xec67('0x2b')]['rawAttributes'],function(_0x26c600){return{'name':_0x26c600[_0xec67('0x2c')],'type':_0x26c600[_0xec67('0x2d')]['key']};});_0x2b53ff[_0xec67('0x2e')]=_[_0xec67('0x2a')](_0xf6970a,_0xec67('0x27'));_0x2b53ff[_0xec67('0x2f')]=_[_0xec67('0x30')](_0x297129[_0xec67('0x2f')]);_0x2b53ff['filters']=_['intersection'](_0x2b53ff[_0xec67('0x2e')],_0x2b53ff[_0xec67('0x2f')]);_0x239204[_0xec67('0x31')]=_[_0xec67('0x32')](_0x2b53ff[_0xec67('0x2e')],qs['fields'](_0x297129['query'][_0xec67('0x33')]));_0x239204[_0xec67('0x31')]=_0x239204[_0xec67('0x31')][_0xec67('0x34')]?_0x239204[_0xec67('0x31')]:_0x2b53ff[_0xec67('0x2e')];if(!_0x297129[_0xec67('0x2f')][_0xec67('0x35')]('nolimit')){_0x239204[_0xec67('0x1d')]=qs[_0xec67('0x1d')](_0x297129['query'][_0xec67('0x1d')]);_0x239204['offset']=qs[_0xec67('0x1e')](_0x297129[_0xec67('0x2f')]['offset']);}_0x239204['order']=qs[_0xec67('0x36')](_0x297129[_0xec67('0x2f')][_0xec67('0x36')]);_0x239204[_0xec67('0x37')]=qs['filters'](_[_0xec67('0x38')](_0x297129[_0xec67('0x2f')],_0x2b53ff['filters']),_0xf6970a);if(_0x297129[_0xec67('0x2f')][_0xec67('0x39')]){_0x239204[_0xec67('0x37')]=_[_0xec67('0x3a')](_0x239204[_0xec67('0x37')],{'$or':_[_0xec67('0x2a')](_0xf6970a,function(_0x2439b2){if(_0x2439b2[_0xec67('0x2d')]!==_0xec67('0x3b')){var _0x57f43d={};_0x57f43d[_0x2439b2['name']]={'$like':'%'+_0x297129[_0xec67('0x2f')][_0xec67('0x39')]+'%'};return _0x57f43d;}})});}_0x239204=_['merge']({},_0x239204,_0x297129[_0xec67('0x3c')]);var _0x3c2327={'where':_0x239204[_0xec67('0x37')]};return db[_0xec67('0x2b')][_0xec67('0x1f')](_0x3c2327)[_0xec67('0x24')](function(_0x220f16){_0x1e4b66['count']=_0x220f16;if(_0x297129[_0xec67('0x2f')][_0xec67('0x3d')]){_0x239204[_0xec67('0x3e')]=[{'all':!![]}];}return db[_0xec67('0x2b')][_0xec67('0x3f')](_0x239204);})[_0xec67('0x24')](function(_0x54c818){_0x1e4b66[_0xec67('0x40')]=_0x54c818;return _0x1e4b66;})[_0xec67('0x24')](respondWithFilteredResult(_0x558d6a,_0x239204))[_0xec67('0x41')](handleError(_0x558d6a,null));};exports['show']=function(_0x24df6e,_0x5980d0){var _0x1fdcf0={'raw':!![],'where':{'id':_0x24df6e[_0xec67('0x42')]['id']}},_0x2ef53c={};_0x2ef53c[_0xec67('0x2e')]=_['keys'](db['WhatsappQueueReport']['rawAttributes']);_0x2ef53c['query']=_[_0xec67('0x30')](_0x24df6e[_0xec67('0x2f')]);_0x2ef53c['filters']=_[_0xec67('0x32')](_0x2ef53c[_0xec67('0x2e')],_0x2ef53c[_0xec67('0x2f')]);_0x1fdcf0[_0xec67('0x31')]=_[_0xec67('0x32')](_0x2ef53c['model'],qs[_0xec67('0x33')](_0x24df6e[_0xec67('0x2f')]['fields']));_0x1fdcf0['attributes']=_0x1fdcf0[_0xec67('0x31')]['length']?_0x1fdcf0[_0xec67('0x31')]:_0x2ef53c['model'];if(_0x24df6e[_0xec67('0x2f')][_0xec67('0x3d')]){_0x1fdcf0['include']=[{'all':!![]}];}_0x1fdcf0=_['merge']({},_0x1fdcf0,_0x24df6e[_0xec67('0x3c')]);return db['WhatsappQueueReport'][_0xec67('0x43')](_0x1fdcf0)['then'](handleEntityNotFound(_0x5980d0,null))[_0xec67('0x24')](respondWithResult(_0x5980d0,null))[_0xec67('0x41')](handleError(_0x5980d0,null));};exports[_0xec67('0x44')]=function(_0x333622,_0x5020c0){return db[_0xec67('0x2b')]['create'](_0x333622[_0xec67('0x45')],{})[_0xec67('0x24')](respondWithResult(_0x5020c0,0xc9))[_0xec67('0x41')](handleError(_0x5020c0,null));};exports[_0xec67('0x22')]=function(_0x331b70,_0x85d686){if(_0x331b70['body']['id']){delete _0x331b70['body']['id'];}return db['WhatsappQueueReport'][_0xec67('0x43')]({'where':{'id':_0x331b70[_0xec67('0x42')]['id']}})[_0xec67('0x24')](handleEntityNotFound(_0x85d686,null))['then'](saveUpdates(_0x331b70['body'],null))['then'](respondWithResult(_0x85d686,null))['catch'](handleError(_0x85d686,null));};exports[_0xec67('0x23')]=function(_0x23749a,_0x22eb66){return db[_0xec67('0x2b')][_0xec67('0x43')]({'where':{'id':_0x23749a['params']['id']}})[_0xec67('0x24')](handleEntityNotFound(_0x22eb66,null))[_0xec67('0x24')](removeEntity(_0x22eb66,null))['catch'](handleError(_0x22eb66,null));};exports[_0xec67('0x46')]=function(_0x42b918,_0x222a6e){return db[_0xec67('0x2b')][_0xec67('0x46')]()['then'](respondWithResult(_0x222a6e,null))[_0xec67('0x41')](handleError(_0x222a6e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 11fa56d..94eb53b 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f1f=['exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x146221,_0x49a97a){var _0x552ecb=function(_0x123caf){while(--_0x123caf){_0x146221['push'](_0x146221['shift']());}};_0x552ecb(++_0x49a97a);}(_0x1f1f,0xe5));var _0xf1f1=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0x1f1f[_0x2f6f50];return _0x2cf365;};'use strict';var _=require(_0xf1f1('0x0'));var util=require(_0xf1f1('0x1'));var logger=require(_0xf1f1('0x2'))(_0xf1f1('0x3'));var moment=require(_0xf1f1('0x4'));var BPromise=require(_0xf1f1('0x5'));var rp=require(_0xf1f1('0x6'));var fs=require('fs');var path=require(_0xf1f1('0x7'));var rimraf=require(_0xf1f1('0x8'));var config=require(_0xf1f1('0x9'));var attributes=require(_0xf1f1('0xa'));module[_0xf1f1('0xb')]=function(_0x1dede4,_0x457bcb){return _0x1dede4[_0xf1f1('0xc')](_0xf1f1('0xd'),attributes,{'tableName':_0xf1f1('0xe'),'paranoid':![],'indexes':[{'name':_0xf1f1('0xf'),'fields':[_0xf1f1('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x94cb=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./whatsappQueueReport.attributes','define','WhatsappQueueReport'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0x94cb,0x16e));var _0xb94c=function(_0x286d0f,_0x597012){_0x286d0f=_0x286d0f-0x0;var _0x6c91d4=_0x94cb[_0x286d0f];return _0x6c91d4;};'use strict';var _=require(_0xb94c('0x0'));var util=require(_0xb94c('0x1'));var logger=require(_0xb94c('0x2'))(_0xb94c('0x3'));var moment=require(_0xb94c('0x4'));var BPromise=require('bluebird');var rp=require(_0xb94c('0x5'));var fs=require('fs');var path=require(_0xb94c('0x6'));var rimraf=require(_0xb94c('0x7'));var config=require('../../config/environment');var attributes=require(_0xb94c('0x8'));module['exports']=function(_0x51fb5e,_0x42382c){return _0x51fb5e[_0xb94c('0x9')](_0xb94c('0xa'),attributes,{'tableName':_0xb94c('0xb'),'paranoid':![],'indexes':[{'name':_0xb94c('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index dde6838..d34573a 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bf2=['where','attributes','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateWhatsappQueueReport','create','body','options','stringify','UpdateWhatsappQueueReport','WhatsappQueueReport','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4bf2,0x136));var _0x24bf=function(_0x33ed60,_0x4a594a){_0x33ed60=_0x33ed60-0x0;var _0x47f94e=_0x4bf2[_0x33ed60];return _0x47f94e;};'use strict';var _=require(_0x24bf('0x0'));var util=require(_0x24bf('0x1'));var moment=require(_0x24bf('0x2'));var BPromise=require(_0x24bf('0x3'));var rs=require(_0x24bf('0x4'));var fs=require('fs');var Redis=require(_0x24bf('0x5'));var db=require(_0x24bf('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x24bf('0x7'))(_0x24bf('0x8'));var config=require(_0x24bf('0x9'));var jayson=require(_0x24bf('0xa'));var client=jayson[_0x24bf('0xb')][_0x24bf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x333fe9,_0x39619e,_0x461bd7){return new BPromise(function(_0x2fd94a,_0x13aae8){return client[_0x24bf('0xd')](_0x333fe9,_0x461bd7)['then'](function(_0x1ebaa2){logger['info'](_0x24bf('0xe'),_0x39619e,_0x24bf('0xf'));logger['debug'](_0x24bf('0x10'),_0x39619e,_0x24bf('0xf'),JSON['stringify'](_0x1ebaa2));if(_0x1ebaa2[_0x24bf('0x11')]){if(_0x1ebaa2[_0x24bf('0x11')][_0x24bf('0x12')]===0x1f4){logger[_0x24bf('0x11')](_0x24bf('0xe'),_0x39619e,_0x1ebaa2[_0x24bf('0x11')]['message']);return _0x13aae8(_0x1ebaa2[_0x24bf('0x11')][_0x24bf('0x13')]);}logger[_0x24bf('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x39619e,_0x1ebaa2[_0x24bf('0x11')]['message']);return _0x2fd94a(_0x1ebaa2[_0x24bf('0x11')][_0x24bf('0x13')]);}else{logger[_0x24bf('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0x39619e,'request\x20sent');_0x2fd94a(_0x1ebaa2['result']['message']);}})[_0x24bf('0x15')](function(_0x16c63b){logger['error'](_0x24bf('0xe'),_0x39619e,_0x16c63b);_0x13aae8(_0x16c63b);});});}exports[_0x24bf('0x16')]=function(_0x4b9264){var _0x5ad8d6=this;return new Promise(function(_0x178a66,_0x4b12e4){return db['WhatsappQueueReport'][_0x24bf('0x17')](_0x4b9264[_0x24bf('0x18')],{'raw':_0x4b9264['options']?_0x4b9264[_0x24bf('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3ec33d){logger[_0x24bf('0x14')](_0x24bf('0x16'),_0x4b9264);logger['debug']('CreateWhatsappQueueReport',_0x4b9264,JSON[_0x24bf('0x1a')](_0x3ec33d));_0x178a66(_0x3ec33d);})[_0x24bf('0x15')](function(_0x1cb0f5){logger[_0x24bf('0x11')](_0x24bf('0x16'),_0x1cb0f5[_0x24bf('0x13')],_0x4b9264);_0x4b12e4(_0x5ad8d6[_0x24bf('0x11')](0x1f4,_0x1cb0f5[_0x24bf('0x13')]));});});};exports[_0x24bf('0x1b')]=function(_0x29b0fd){var _0x34b652=this;return new Promise(function(_0x55e23f,_0x3aa00e){return db[_0x24bf('0x1c')][_0x24bf('0x1d')](_0x29b0fd[_0x24bf('0x18')],{'raw':_0x29b0fd['options']?_0x29b0fd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29b0fd[_0x24bf('0x19')]?_0x29b0fd[_0x24bf('0x19')][_0x24bf('0x1e')]||null:null,'attributes':_0x29b0fd[_0x24bf('0x19')]?_0x29b0fd[_0x24bf('0x19')][_0x24bf('0x1f')]||null:null,'limit':_0x29b0fd[_0x24bf('0x19')]?_0x29b0fd[_0x24bf('0x19')]['limit']||null:null})[_0x24bf('0x20')](function(_0x3d2065){logger['info'](_0x24bf('0x1b'),_0x29b0fd);logger[_0x24bf('0x21')](_0x24bf('0x1b'),_0x29b0fd,JSON[_0x24bf('0x1a')](_0x3d2065));_0x55e23f(_0x3d2065);})[_0x24bf('0x15')](function(_0x32c470){logger[_0x24bf('0x11')](_0x24bf('0x1b'),_0x32c470[_0x24bf('0x13')],_0x29b0fd);_0x3aa00e(_0x34b652[_0x24bf('0x11')](0x1f4,_0x32c470[_0x24bf('0x13')]));});});}; \ No newline at end of file +var _0x7986=['stringify','UpdateWhatsappQueueReport','update','raw','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','WhatsappQueueReport','body','options','then','CreateWhatsappQueueReport'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0x7986,0x14f));var _0x6798=function(_0x28be52,_0x46c500){_0x28be52=_0x28be52-0x0;var _0x8f9def=_0x7986[_0x28be52];return _0x8f9def;};'use strict';var _=require(_0x6798('0x0'));var util=require(_0x6798('0x1'));var moment=require(_0x6798('0x2'));var BPromise=require(_0x6798('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6798('0x4'));var db=require(_0x6798('0x5'))['db'];var utils=require(_0x6798('0x6'));var logger=require(_0x6798('0x7'))(_0x6798('0x8'));var config=require(_0x6798('0x9'));var jayson=require(_0x6798('0xa'));var client=jayson['client'][_0x6798('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x222d4b,_0x1458ca,_0x2900f7){return new BPromise(function(_0x46372f,_0x16bd77){return client[_0x6798('0xc')](_0x222d4b,_0x2900f7)['then'](function(_0x5bfc18){logger[_0x6798('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1458ca,_0x6798('0xe'));logger[_0x6798('0xf')](_0x6798('0x10'),_0x1458ca,'request\x20sent',JSON['stringify'](_0x5bfc18));if(_0x5bfc18[_0x6798('0x11')]){if(_0x5bfc18['error'][_0x6798('0x12')]===0x1f4){logger[_0x6798('0x11')](_0x6798('0x13'),_0x1458ca,_0x5bfc18[_0x6798('0x11')][_0x6798('0x14')]);return _0x16bd77(_0x5bfc18[_0x6798('0x11')]['message']);}logger[_0x6798('0x11')](_0x6798('0x13'),_0x1458ca,_0x5bfc18[_0x6798('0x11')]['message']);return _0x46372f(_0x5bfc18[_0x6798('0x11')]['message']);}else{logger[_0x6798('0xd')](_0x6798('0x13'),_0x1458ca,_0x6798('0xe'));_0x46372f(_0x5bfc18[_0x6798('0x15')][_0x6798('0x14')]);}})[_0x6798('0x16')](function(_0x183349){logger[_0x6798('0x11')](_0x6798('0x13'),_0x1458ca,_0x183349);_0x16bd77(_0x183349);});});}exports['CreateWhatsappQueueReport']=function(_0x3e9b03){var _0x89e06a=this;return new Promise(function(_0x145004,_0x324f20){return db[_0x6798('0x17')]['create'](_0x3e9b03[_0x6798('0x18')],{'raw':_0x3e9b03[_0x6798('0x19')]?_0x3e9b03['options']['raw']===undefined?!![]:![]:!![]})[_0x6798('0x1a')](function(_0x2a4cec){logger[_0x6798('0xd')](_0x6798('0x1b'),_0x3e9b03);logger['debug']('CreateWhatsappQueueReport',_0x3e9b03,JSON[_0x6798('0x1c')](_0x2a4cec));_0x145004(_0x2a4cec);})['catch'](function(_0x4ea1c3){logger[_0x6798('0x11')](_0x6798('0x1b'),_0x4ea1c3[_0x6798('0x14')],_0x3e9b03);_0x324f20(_0x89e06a[_0x6798('0x11')](0x1f4,_0x4ea1c3[_0x6798('0x14')]));});});};exports[_0x6798('0x1d')]=function(_0x8fbfbe){var _0x1f0817=this;return new Promise(function(_0x3ef95c,_0x177f41){return db[_0x6798('0x17')][_0x6798('0x1e')](_0x8fbfbe[_0x6798('0x18')],{'raw':_0x8fbfbe['options']?_0x8fbfbe[_0x6798('0x19')][_0x6798('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8fbfbe['options']?_0x8fbfbe[_0x6798('0x19')]['where']||null:null,'attributes':_0x8fbfbe[_0x6798('0x19')]?_0x8fbfbe[_0x6798('0x19')]['attributes']||null:null,'limit':_0x8fbfbe[_0x6798('0x19')]?_0x8fbfbe[_0x6798('0x19')][_0x6798('0x20')]||null:null})['then'](function(_0x4b3c9f){logger[_0x6798('0xd')](_0x6798('0x1d'),_0x8fbfbe);logger[_0x6798('0xf')](_0x6798('0x1d'),_0x8fbfbe,JSON[_0x6798('0x1c')](_0x4b3c9f));_0x3ef95c(_0x4b3c9f);})[_0x6798('0x16')](function(_0x1a626e){logger[_0x6798('0x11')]('UpdateWhatsappQueueReport',_0x1a626e[_0x6798('0x14')],_0x8fbfbe);_0x177f41(_0x1f0817[_0x6798('0x11')](0x1f4,_0x1a626e[_0x6798('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 0cdcd59..abca78b 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b5d=['delete','multer','path','connect-timeout','Router','fs-extra','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x33cf10,_0x562577){var _0x244198=function(_0x1d99d4){while(--_0x1d99d4){_0x33cf10['push'](_0x33cf10['shift']());}};_0x244198(++_0x562577);}(_0x9b5d,0x188));var _0xd9b5=function(_0x16718e,_0x3e6083){_0x16718e=_0x16718e-0x0;var _0x43c2dc=_0x9b5d[_0x16718e];return _0x43c2dc;};'use strict';var multer=require(_0xd9b5('0x0'));var util=require('util');var path=require(_0xd9b5('0x1'));var timeout=require(_0xd9b5('0x2'));var express=require('express');var router=express[_0xd9b5('0x3')]();var fs_extra=require(_0xd9b5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd9b5('0x5'));var controller=require('./whatsappTransferReport.controller');router[_0xd9b5('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd9b5('0x6')](_0xd9b5('0x7'),auth[_0xd9b5('0x8')](),controller[_0xd9b5('0x9')]);router[_0xd9b5('0x6')](_0xd9b5('0xa'),auth['isAuthenticated'](),controller[_0xd9b5('0xb')]);router[_0xd9b5('0xc')]('/',auth[_0xd9b5('0x8')](),controller[_0xd9b5('0xd')]);router[_0xd9b5('0xe')]('/:id',auth[_0xd9b5('0x8')](),controller[_0xd9b5('0xf')]);router[_0xd9b5('0x10')](_0xd9b5('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe235=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports'];(function(_0x102d5c,_0x4d89dd){var _0xe06cc2=function(_0x5b593f){while(--_0x5b593f){_0x102d5c['push'](_0x102d5c['shift']());}};_0xe06cc2(++_0x4d89dd);}(_0xe235,0x12b));var _0x5e23=function(_0x1d6f1e,_0x22a3f2){_0x1d6f1e=_0x1d6f1e-0x0;var _0xc74a85=_0xe235[_0x1d6f1e];return _0xc74a85;};'use strict';var multer=require(_0x5e23('0x0'));var util=require(_0x5e23('0x1'));var path=require('path');var timeout=require(_0x5e23('0x2'));var express=require(_0x5e23('0x3'));var router=express[_0x5e23('0x4')]();var fs_extra=require(_0x5e23('0x5'));var auth=require(_0x5e23('0x6'));var interaction=require(_0x5e23('0x7'));var config=require(_0x5e23('0x8'));var controller=require(_0x5e23('0x9'));router[_0x5e23('0xa')]('/',auth[_0x5e23('0xb')](),controller[_0x5e23('0xc')]);router[_0x5e23('0xa')](_0x5e23('0xd'),auth[_0x5e23('0xb')](),controller[_0x5e23('0xe')]);router[_0x5e23('0xa')](_0x5e23('0xf'),auth['isAuthenticated'](),controller[_0x5e23('0x10')]);router[_0x5e23('0x11')]('/',auth[_0x5e23('0xb')](),controller[_0x5e23('0x12')]);router[_0x5e23('0x13')](_0x5e23('0xf'),auth[_0x5e23('0xb')](),controller[_0x5e23('0x14')]);router[_0x5e23('0x15')]('/:id',auth[_0x5e23('0xb')](),controller['destroy']);module[_0x5e23('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index ab44965..f260526 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['DATE','sequelize','STRING','account','agent','queue'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0x0b0e[_0x513545];return _0x18b7c5;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xe0b0('0x5')]}}; \ No newline at end of file +var _0x5f2f=['agent','queue','DATE','sequelize','exports','STRING','ENUM','account'];(function(_0x334c6c,_0x3978fb){var _0x2e3ba1=function(_0x46ab97){while(--_0x46ab97){_0x334c6c['push'](_0x334c6c['shift']());}};_0x2e3ba1(++_0x3978fb);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4a174e,_0x48d236){_0x4a174e=_0x4a174e-0x0;var _0x4ff7cd=_0x5f2f[_0x4a174e];return _0x4ff7cd;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'uniqueid':{'type':Sequelize[_0xf5f2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf5f2('0x3')](_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xf5f2('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index c5de960..c4c54e2 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a7c=['json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','keys','create','body','catch','find','describe','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x27907f,_0x3a5482){var _0x176a9d=function(_0x2ec21f){while(--_0x2ec21f){_0x27907f['push'](_0x27907f['shift']());}};_0x176a9d(++_0x3a5482);}(_0x6a7c,0x79));var _0xc6a7=function(_0x125b2b,_0x2889e2){_0x125b2b=_0x125b2b-0x0;var _0x139f2b=_0x6a7c[_0x125b2b];return _0x139f2b;};'use strict';var emlformat=require(_0xc6a7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc6a7('0x1'));var moment=require(_0xc6a7('0x2'));var BPromise=require(_0xc6a7('0x3'));var Mustache=require(_0xc6a7('0x4'));var util=require(_0xc6a7('0x5'));var path=require('path');var sox=require(_0xc6a7('0x6'));var csv=require(_0xc6a7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc6a7('0x8'));var _=require(_0xc6a7('0x9'));var squel=require(_0xc6a7('0xa'));var crypto=require(_0xc6a7('0xb'));var jsforce=require(_0xc6a7('0xc'));var deskjs=require(_0xc6a7('0xd'));var toCsv=require(_0xc6a7('0x7'));var querystring=require(_0xc6a7('0xe'));var Papa=require(_0xc6a7('0xf'));var Redis=require(_0xc6a7('0x10'));var authService=require(_0xc6a7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc6a7('0x12'));var hardwareService=require(_0xc6a7('0x13'));var logger=require(_0xc6a7('0x14'))(_0xc6a7('0x15'));var utils=require('../../config/utils');var config=require(_0xc6a7('0x16'));var licenseUtil=require(_0xc6a7('0x17'));var db=require(_0xc6a7('0x18'))['db'];function respondWithStatusCode(_0x37f273,_0x4f47aa){_0x4f47aa=_0x4f47aa||0xcc;return function(_0x4d2b50){if(_0x4d2b50){return _0x37f273['sendStatus'](_0x4f47aa);}return _0x37f273[_0xc6a7('0x19')](_0x4f47aa)[_0xc6a7('0x1a')]();};}function respondWithResult(_0x105bcb,_0x27f9cf){_0x27f9cf=_0x27f9cf||0xc8;return function(_0x51a361){if(_0x51a361){return _0x105bcb[_0xc6a7('0x19')](_0x27f9cf)[_0xc6a7('0x1b')](_0x51a361);}};}function respondWithFilteredResult(_0x417e45,_0x2842b8){return function(_0xd03a9f){if(_0xd03a9f){var _0x1fad7d=typeof _0x2842b8[_0xc6a7('0x1c')]===_0xc6a7('0x1d')&&typeof _0x2842b8['limit']==='undefined';var _0x237592=_0xd03a9f[_0xc6a7('0x1e')];var _0x19292b=_0x1fad7d?0x0:_0x2842b8['offset'];var _0x3dd1c9=_0x1fad7d?_0xd03a9f[_0xc6a7('0x1e')]:_0x2842b8['offset']+_0x2842b8[_0xc6a7('0x1f')];var _0x188743;if(_0x3dd1c9>=_0x237592){_0x3dd1c9=_0x237592;_0x188743=0xc8;}else{_0x188743=0xce;}_0x417e45[_0xc6a7('0x19')](_0x188743);return _0x417e45['set'](_0xc6a7('0x20'),_0x19292b+'-'+_0x3dd1c9+'/'+_0x237592)[_0xc6a7('0x1b')](_0xd03a9f);}return null;};}function patchUpdates(_0x115c15){return function(_0x5c0778){try{jsonpatch['apply'](_0x5c0778,_0x115c15,!![]);}catch(_0x9ac82e){return BPromise[_0xc6a7('0x21')](_0x9ac82e);}return _0x5c0778[_0xc6a7('0x22')]();};}function saveUpdates(_0x1ff9fe,_0x3bcc64){return function(_0x2b943a){if(_0x2b943a){return _0x2b943a[_0xc6a7('0x23')](_0x1ff9fe)[_0xc6a7('0x24')](function(_0x335748){return _0x335748;});}return null;};}function removeEntity(_0x37d9af,_0x10310e){return function(_0x49dcbc){if(_0x49dcbc){return _0x49dcbc[_0xc6a7('0x25')]()['then'](function(){_0x37d9af[_0xc6a7('0x19')](0xcc)[_0xc6a7('0x1a')]();});}};}function handleEntityNotFound(_0x2d019c,_0x13d69d){return function(_0x5ed9ae){if(!_0x5ed9ae){_0x2d019c[_0xc6a7('0x26')](0x194);}return _0x5ed9ae;};}function handleError(_0x243115,_0x517fc4){_0x517fc4=_0x517fc4||0x1f4;return function(_0x4d68a6){logger['error'](_0x4d68a6[_0xc6a7('0x27')]);if(_0x4d68a6[_0xc6a7('0x28')]){delete _0x4d68a6[_0xc6a7('0x28')];}_0x243115[_0xc6a7('0x19')](_0x517fc4)[_0xc6a7('0x29')](_0x4d68a6);};}exports[_0xc6a7('0x2a')]=function(_0x428925,_0x225125){var _0x6773aa={},_0x5bad95={},_0x30a61e={'count':0x0,'rows':[]};var _0x19874f=_[_0xc6a7('0x2b')](db[_0xc6a7('0x2c')][_0xc6a7('0x2d')],function(_0x3b8f21){return{'name':_0x3b8f21[_0xc6a7('0x2e')],'type':_0x3b8f21[_0xc6a7('0x2f')][_0xc6a7('0x30')]};});_0x5bad95[_0xc6a7('0x31')]=_['map'](_0x19874f,_0xc6a7('0x28'));_0x5bad95[_0xc6a7('0x32')]=_['keys'](_0x428925[_0xc6a7('0x32')]);_0x5bad95[_0xc6a7('0x33')]=_[_0xc6a7('0x34')](_0x5bad95[_0xc6a7('0x31')],_0x5bad95[_0xc6a7('0x32')]);_0x6773aa[_0xc6a7('0x35')]=_[_0xc6a7('0x34')](_0x5bad95['model'],qs[_0xc6a7('0x36')](_0x428925[_0xc6a7('0x32')]['fields']));_0x6773aa[_0xc6a7('0x35')]=_0x6773aa[_0xc6a7('0x35')][_0xc6a7('0x37')]?_0x6773aa[_0xc6a7('0x35')]:_0x5bad95['model'];if(!_0x428925[_0xc6a7('0x32')]['hasOwnProperty']('nolimit')){_0x6773aa['limit']=qs['limit'](_0x428925[_0xc6a7('0x32')][_0xc6a7('0x1f')]);_0x6773aa['offset']=qs[_0xc6a7('0x1c')](_0x428925[_0xc6a7('0x32')][_0xc6a7('0x1c')]);}_0x6773aa[_0xc6a7('0x38')]=qs[_0xc6a7('0x39')](_0x428925['query']['sort']);_0x6773aa[_0xc6a7('0x3a')]=qs[_0xc6a7('0x33')](_[_0xc6a7('0x3b')](_0x428925[_0xc6a7('0x32')],_0x5bad95['filters']),_0x19874f);if(_0x428925[_0xc6a7('0x32')][_0xc6a7('0x3c')]){_0x6773aa[_0xc6a7('0x3a')]=_[_0xc6a7('0x3d')](_0x6773aa['where'],{'$or':_['map'](_0x19874f,function(_0x49c133){if(_0x49c133[_0xc6a7('0x2f')]!==_0xc6a7('0x3e')){var _0x5c9db2={};_0x5c9db2[_0x49c133['name']]={'$like':'%'+_0x428925['query'][_0xc6a7('0x3c')]+'%'};return _0x5c9db2;}})});}_0x6773aa=_[_0xc6a7('0x3d')]({},_0x6773aa,_0x428925['options']);var _0x3e5477={'where':_0x6773aa[_0xc6a7('0x3a')]};return db['WhatsappTransferReport'][_0xc6a7('0x1e')](_0x3e5477)[_0xc6a7('0x24')](function(_0x28a59a){_0x30a61e[_0xc6a7('0x1e')]=_0x28a59a;if(_0x428925[_0xc6a7('0x32')][_0xc6a7('0x3f')]){_0x6773aa[_0xc6a7('0x40')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xc6a7('0x41')](_0x6773aa);})['then'](function(_0x4b4f02){_0x30a61e['rows']=_0x4b4f02;return _0x30a61e;})[_0xc6a7('0x24')](respondWithFilteredResult(_0x225125,_0x6773aa))['catch'](handleError(_0x225125,null));};exports[_0xc6a7('0x42')]=function(_0x469830,_0x469b2c){var _0x16d422={'raw':!![],'where':{'id':_0x469830[_0xc6a7('0x43')]['id']}},_0x1b347e={};_0x1b347e[_0xc6a7('0x31')]=_[_0xc6a7('0x44')](db[_0xc6a7('0x2c')][_0xc6a7('0x2d')]);_0x1b347e[_0xc6a7('0x32')]=_['keys'](_0x469830[_0xc6a7('0x32')]);_0x1b347e[_0xc6a7('0x33')]=_[_0xc6a7('0x34')](_0x1b347e['model'],_0x1b347e[_0xc6a7('0x32')]);_0x16d422[_0xc6a7('0x35')]=_[_0xc6a7('0x34')](_0x1b347e['model'],qs[_0xc6a7('0x36')](_0x469830[_0xc6a7('0x32')][_0xc6a7('0x36')]));_0x16d422[_0xc6a7('0x35')]=_0x16d422[_0xc6a7('0x35')][_0xc6a7('0x37')]?_0x16d422[_0xc6a7('0x35')]:_0x1b347e['model'];if(_0x469830[_0xc6a7('0x32')][_0xc6a7('0x3f')]){_0x16d422[_0xc6a7('0x40')]=[{'all':!![]}];}_0x16d422=_['merge']({},_0x16d422,_0x469830['options']);return db[_0xc6a7('0x2c')]['find'](_0x16d422)[_0xc6a7('0x24')](handleEntityNotFound(_0x469b2c,null))[_0xc6a7('0x24')](respondWithResult(_0x469b2c,null))['catch'](handleError(_0x469b2c,null));};exports[_0xc6a7('0x45')]=function(_0x1ef1be,_0xad709a){return db[_0xc6a7('0x2c')][_0xc6a7('0x45')](_0x1ef1be[_0xc6a7('0x46')],{})['then'](respondWithResult(_0xad709a,0xc9))[_0xc6a7('0x47')](handleError(_0xad709a,null));};exports[_0xc6a7('0x23')]=function(_0x975143,_0x3f6c09){if(_0x975143[_0xc6a7('0x46')]['id']){delete _0x975143['body']['id'];}return db[_0xc6a7('0x2c')][_0xc6a7('0x48')]({'where':{'id':_0x975143[_0xc6a7('0x43')]['id']}})[_0xc6a7('0x24')](handleEntityNotFound(_0x3f6c09,null))[_0xc6a7('0x24')](saveUpdates(_0x975143[_0xc6a7('0x46')],null))[_0xc6a7('0x24')](respondWithResult(_0x3f6c09,null))['catch'](handleError(_0x3f6c09,null));};exports[_0xc6a7('0x25')]=function(_0x2ba893,_0x2d2a7b){return db[_0xc6a7('0x2c')][_0xc6a7('0x48')]({'where':{'id':_0x2ba893[_0xc6a7('0x43')]['id']}})[_0xc6a7('0x24')](handleEntityNotFound(_0x2d2a7b,null))[_0xc6a7('0x24')](removeEntity(_0x2d2a7b,null))[_0xc6a7('0x47')](handleError(_0x2d2a7b,null));};exports['describe']=function(_0x35863c,_0x25bb3f){return db['WhatsappTransferReport'][_0xc6a7('0x49')]()['then'](respondWithResult(_0x25bb3f,null))[_0xc6a7('0x47')](handleError(_0x25bb3f,null));}; \ No newline at end of file +var _0x81ae=['path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','destroy','then','sendStatus','error','stack','name','send','WhatsappTransferReport','rawAttributes','fieldName','type','query','keys','filters','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','show','intersection','find','catch','create','body','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x3063f9,_0x385fc7){var _0x100015=function(_0x35a166){while(--_0x35a166){_0x3063f9['push'](_0x3063f9['shift']());}};_0x100015(++_0x385fc7);}(_0x81ae,0xdf));var _0xe81a=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x81ae[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0xe81a('0x0'));var rimraf=require(_0xe81a('0x1'));var zipdir=require(_0xe81a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe81a('0x3'));var moment=require(_0xe81a('0x4'));var BPromise=require(_0xe81a('0x5'));var Mustache=require(_0xe81a('0x6'));var util=require(_0xe81a('0x7'));var path=require(_0xe81a('0x8'));var sox=require(_0xe81a('0x9'));var csv=require('to-csv');var ejs=require(_0xe81a('0xa'));var fs=require('fs');var fs_extra=require(_0xe81a('0xb'));var _=require(_0xe81a('0xc'));var squel=require('squel');var crypto=require(_0xe81a('0xd'));var jsforce=require(_0xe81a('0xe'));var deskjs=require(_0xe81a('0xf'));var toCsv=require(_0xe81a('0x10'));var querystring=require(_0xe81a('0x11'));var Papa=require('papaparse');var Redis=require(_0xe81a('0x12'));var authService=require(_0xe81a('0x13'));var qs=require(_0xe81a('0x14'));var as=require(_0xe81a('0x15'));var hardwareService=require(_0xe81a('0x16'));var logger=require('../../config/logger')(_0xe81a('0x17'));var utils=require(_0xe81a('0x18'));var config=require(_0xe81a('0x19'));var licenseUtil=require(_0xe81a('0x1a'));var db=require(_0xe81a('0x1b'))['db'];function respondWithStatusCode(_0xf4382e,_0x4fd6e6){_0x4fd6e6=_0x4fd6e6||0xcc;return function(_0x1a77d5){if(_0x1a77d5){return _0xf4382e['sendStatus'](_0x4fd6e6);}return _0xf4382e['status'](_0x4fd6e6)[_0xe81a('0x1c')]();};}function respondWithResult(_0x3eea75,_0x2eebe8){_0x2eebe8=_0x2eebe8||0xc8;return function(_0x32a204){if(_0x32a204){return _0x3eea75[_0xe81a('0x1d')](_0x2eebe8)[_0xe81a('0x1e')](_0x32a204);}};}function respondWithFilteredResult(_0x2795bc,_0x26b191){return function(_0x63760c){if(_0x63760c){var _0x3e46b0=typeof _0x26b191[_0xe81a('0x1f')]===_0xe81a('0x20')&&typeof _0x26b191['limit']===_0xe81a('0x20');var _0x2935d0=_0x63760c[_0xe81a('0x21')];var _0x3f4058=_0x3e46b0?0x0:_0x26b191[_0xe81a('0x1f')];var _0x16013e=_0x3e46b0?_0x63760c['count']:_0x26b191['offset']+_0x26b191[_0xe81a('0x22')];var _0xc70792;if(_0x16013e>=_0x2935d0){_0x16013e=_0x2935d0;_0xc70792=0xc8;}else{_0xc70792=0xce;}_0x2795bc[_0xe81a('0x1d')](_0xc70792);return _0x2795bc['set'](_0xe81a('0x23'),_0x3f4058+'-'+_0x16013e+'/'+_0x2935d0)[_0xe81a('0x1e')](_0x63760c);}return null;};}function patchUpdates(_0x5af24e){return function(_0x195661){try{jsonpatch['apply'](_0x195661,_0x5af24e,!![]);}catch(_0x3b207c){return BPromise[_0xe81a('0x24')](_0x3b207c);}return _0x195661[_0xe81a('0x25')]();};}function saveUpdates(_0x2db2f5,_0x5bd307){return function(_0x18759b){if(_0x18759b){return _0x18759b['update'](_0x2db2f5)['then'](function(_0x2281dd){return _0x2281dd;});}return null;};}function removeEntity(_0x29e72c,_0x53445f){return function(_0x52b059){if(_0x52b059){return _0x52b059[_0xe81a('0x26')]()[_0xe81a('0x27')](function(){_0x29e72c['status'](0xcc)[_0xe81a('0x1c')]();});}};}function handleEntityNotFound(_0x3b8622,_0x2ea72a){return function(_0x2d072d){if(!_0x2d072d){_0x3b8622[_0xe81a('0x28')](0x194);}return _0x2d072d;};}function handleError(_0x88cd3a,_0x164572){_0x164572=_0x164572||0x1f4;return function(_0x42ebd9){logger[_0xe81a('0x29')](_0x42ebd9[_0xe81a('0x2a')]);if(_0x42ebd9['name']){delete _0x42ebd9[_0xe81a('0x2b')];}_0x88cd3a[_0xe81a('0x1d')](_0x164572)[_0xe81a('0x2c')](_0x42ebd9);};}exports['index']=function(_0x1de8b4,_0xce76a4){var _0x2252a1={},_0x3bf8e3={},_0x5da7dd={'count':0x0,'rows':[]};var _0x4d4a0a=_['map'](db[_0xe81a('0x2d')][_0xe81a('0x2e')],function(_0x2d24d6){return{'name':_0x2d24d6[_0xe81a('0x2f')],'type':_0x2d24d6[_0xe81a('0x30')]['key']};});_0x3bf8e3['model']=_['map'](_0x4d4a0a,_0xe81a('0x2b'));_0x3bf8e3[_0xe81a('0x31')]=_[_0xe81a('0x32')](_0x1de8b4[_0xe81a('0x31')]);_0x3bf8e3[_0xe81a('0x33')]=_['intersection'](_0x3bf8e3[_0xe81a('0x34')],_0x3bf8e3[_0xe81a('0x31')]);_0x2252a1['attributes']=_['intersection'](_0x3bf8e3[_0xe81a('0x34')],qs[_0xe81a('0x35')](_0x1de8b4[_0xe81a('0x31')][_0xe81a('0x35')]));_0x2252a1[_0xe81a('0x36')]=_0x2252a1[_0xe81a('0x36')][_0xe81a('0x37')]?_0x2252a1[_0xe81a('0x36')]:_0x3bf8e3[_0xe81a('0x34')];if(!_0x1de8b4[_0xe81a('0x31')][_0xe81a('0x38')]('nolimit')){_0x2252a1['limit']=qs[_0xe81a('0x22')](_0x1de8b4[_0xe81a('0x31')][_0xe81a('0x22')]);_0x2252a1[_0xe81a('0x1f')]=qs[_0xe81a('0x1f')](_0x1de8b4['query'][_0xe81a('0x1f')]);}_0x2252a1['order']=qs['sort'](_0x1de8b4[_0xe81a('0x31')][_0xe81a('0x39')]);_0x2252a1[_0xe81a('0x3a')]=qs[_0xe81a('0x33')](_[_0xe81a('0x3b')](_0x1de8b4[_0xe81a('0x31')],_0x3bf8e3['filters']),_0x4d4a0a);if(_0x1de8b4[_0xe81a('0x31')][_0xe81a('0x3c')]){_0x2252a1['where']=_[_0xe81a('0x3d')](_0x2252a1[_0xe81a('0x3a')],{'$or':_[_0xe81a('0x3e')](_0x4d4a0a,function(_0x48d85a){if(_0x48d85a['type']!=='VIRTUAL'){var _0x554810={};_0x554810[_0x48d85a['name']]={'$like':'%'+_0x1de8b4[_0xe81a('0x31')][_0xe81a('0x3c')]+'%'};return _0x554810;}})});}_0x2252a1=_[_0xe81a('0x3d')]({},_0x2252a1,_0x1de8b4[_0xe81a('0x3f')]);var _0x519a55={'where':_0x2252a1[_0xe81a('0x3a')]};return db[_0xe81a('0x2d')][_0xe81a('0x21')](_0x519a55)['then'](function(_0x16211c){_0x5da7dd['count']=_0x16211c;if(_0x1de8b4['query'][_0xe81a('0x40')]){_0x2252a1[_0xe81a('0x41')]=[{'all':!![]}];}return db[_0xe81a('0x2d')][_0xe81a('0x42')](_0x2252a1);})[_0xe81a('0x27')](function(_0x1b2d46){_0x5da7dd[_0xe81a('0x43')]=_0x1b2d46;return _0x5da7dd;})[_0xe81a('0x27')](respondWithFilteredResult(_0xce76a4,_0x2252a1))['catch'](handleError(_0xce76a4,null));};exports[_0xe81a('0x44')]=function(_0x8bceb1,_0x37701b){var _0x4de521={'raw':!![],'where':{'id':_0x8bceb1['params']['id']}},_0x22b89a={};_0x22b89a[_0xe81a('0x34')]=_[_0xe81a('0x32')](db[_0xe81a('0x2d')][_0xe81a('0x2e')]);_0x22b89a[_0xe81a('0x31')]=_[_0xe81a('0x32')](_0x8bceb1[_0xe81a('0x31')]);_0x22b89a[_0xe81a('0x33')]=_['intersection'](_0x22b89a[_0xe81a('0x34')],_0x22b89a['query']);_0x4de521[_0xe81a('0x36')]=_[_0xe81a('0x45')](_0x22b89a[_0xe81a('0x34')],qs['fields'](_0x8bceb1[_0xe81a('0x31')][_0xe81a('0x35')]));_0x4de521[_0xe81a('0x36')]=_0x4de521[_0xe81a('0x36')][_0xe81a('0x37')]?_0x4de521[_0xe81a('0x36')]:_0x22b89a['model'];if(_0x8bceb1[_0xe81a('0x31')]['includeAll']){_0x4de521[_0xe81a('0x41')]=[{'all':!![]}];}_0x4de521=_[_0xe81a('0x3d')]({},_0x4de521,_0x8bceb1[_0xe81a('0x3f')]);return db[_0xe81a('0x2d')][_0xe81a('0x46')](_0x4de521)[_0xe81a('0x27')](handleEntityNotFound(_0x37701b,null))[_0xe81a('0x27')](respondWithResult(_0x37701b,null))[_0xe81a('0x47')](handleError(_0x37701b,null));};exports[_0xe81a('0x48')]=function(_0x41b322,_0x3b9b4a){return db[_0xe81a('0x2d')][_0xe81a('0x48')](_0x41b322[_0xe81a('0x49')],{})[_0xe81a('0x27')](respondWithResult(_0x3b9b4a,0xc9))[_0xe81a('0x47')](handleError(_0x3b9b4a,null));};exports[_0xe81a('0x4a')]=function(_0x4b699e,_0xef1d81){if(_0x4b699e[_0xe81a('0x49')]['id']){delete _0x4b699e[_0xe81a('0x49')]['id'];}return db['WhatsappTransferReport'][_0xe81a('0x46')]({'where':{'id':_0x4b699e[_0xe81a('0x4b')]['id']}})[_0xe81a('0x27')](handleEntityNotFound(_0xef1d81,null))['then'](saveUpdates(_0x4b699e[_0xe81a('0x49')],null))['then'](respondWithResult(_0xef1d81,null))[_0xe81a('0x47')](handleError(_0xef1d81,null));};exports[_0xe81a('0x26')]=function(_0x5b89de,_0x3192f5){return db['WhatsappTransferReport'][_0xe81a('0x46')]({'where':{'id':_0x5b89de['params']['id']}})[_0xe81a('0x27')](handleEntityNotFound(_0x3192f5,null))['then'](removeEntity(_0x3192f5,null))['catch'](handleError(_0x3192f5,null));};exports['describe']=function(_0x4544c3,_0x226289){return db[_0xe81a('0x2d')][_0xe81a('0x4c')]()['then'](respondWithResult(_0x226289,null))[_0xe81a('0x47')](handleError(_0x226289,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 30ead72..31eb6d5 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb01a=['api','bluebird','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb01a,0x18a));var _0xab01=function(_0x5a037a,_0x44a3fc){_0x5a037a=_0x5a037a-0x0;var _0x28ff57=_0xb01a[_0x5a037a];return _0x28ff57;};'use strict';var _=require(_0xab01('0x0'));var util=require(_0xab01('0x1'));var logger=require('../../config/logger')(_0xab01('0x2'));var moment=require('moment');var BPromise=require(_0xab01('0x3'));var rp=require(_0xab01('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab01('0x5'));var config=require(_0xab01('0x6'));var attributes=require(_0xab01('0x7'));module['exports']=function(_0x2e4cb0,_0x315392){return _0x2e4cb0[_0xab01('0x8')](_0xab01('0x9'),attributes,{'tableName':_0xab01('0xa'),'paranoid':![],'indexes':[{'name':_0xab01('0xb'),'fields':[_0xab01('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x216d=['uniqueid','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x306b08,_0x4f84a9){var _0x254c71=function(_0x380392){while(--_0x380392){_0x306b08['push'](_0x306b08['shift']());}};_0x254c71(++_0x4f84a9);}(_0x216d,0x181));var _0xd216=function(_0x38644f,_0x4d4b16){_0x38644f=_0x38644f-0x0;var _0x5cf843=_0x216d[_0x38644f];return _0x5cf843;};'use strict';var _=require('lodash');var util=require(_0xd216('0x0'));var logger=require(_0xd216('0x1'))(_0xd216('0x2'));var moment=require(_0xd216('0x3'));var BPromise=require(_0xd216('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd216('0x5'));var config=require(_0xd216('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0xd216('0x7')]=function(_0x2ea548,_0xb5e09){return _0x2ea548[_0xd216('0x8')](_0xd216('0x9'),attributes,{'tableName':_0xd216('0xa'),'paranoid':![],'indexes':[{'name':_0xd216('0xb'),'fields':[_0xd216('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index aba0dbf..690966d 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\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(_0xd1ddee,_0x189ff6){var _0x5149a5=function(_0x4c31d4){while(--_0x4c31d4){_0xd1ddee['push'](_0xd1ddee['shift']());}};_0x5149a5(++_0x189ff6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\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(_0x1b49ea,_0x4cbd3c){var _0xcb861=function(_0x737573){while(--_0x737573){_0x1b49ea['push'](_0x1b49ea['shift']());}};_0xcb861(++_0x4cbd3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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/app.js b/server/app.js index 4de9fc9..3485a6c 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed5c=['Offline\x20apps:','status','None','seedDB','./config/seedDB','default','./config/license','error','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','listen','then','info','start','map','filter','online','name','join'];(function(_0x291d80,_0x574ab4){var _0x35e2c6=function(_0x44e01f){while(--_0x44e01f){_0x291d80['push'](_0x291d80['shift']());}};_0x35e2c6(++_0x574ab4);}(_0xed5c,0x81));var _0xced5=function(_0x16d6d5,_0x42d7d6){_0x16d6d5=_0x16d6d5-0x0;var _0x5d86a2=_0xed5c[_0x16d6d5];return _0x5d86a2;};'use strict';var _=require(_0xced5('0x0'));var mysqldb=require(_0xced5('0x1'));var rpc=require(_0xced5('0x2'));var config=require(_0xced5('0x3'));var logger=require(_0xced5('0x4'))(_0xced5('0x5'));var pm2=require(_0xced5('0x6'));var pm2Config=require(_0xced5('0x7'));var schedule=require(_0xced5('0x8'));var chat=require(_0xced5('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xced5('0xa'));function main(){return mysqldb['db'][_0xced5('0xb')]['sync']()['then'](function(){return rpc[_0xced5('0xc')]();})[_0xced5('0xd')](function(_0x2857d8){logger[_0xced5('0xe')](_0x2857d8);return chat[_0xced5('0xf')]();})['then'](function(){return whatsapp['start']();})[_0xced5('0xd')](function(){return schedule[_0xced5('0xf')]();})[_0xced5('0xd')](function(){return transcribe[_0xced5('0xf')]();})['then'](function(_0x1f2185){logger['info'](_0x1f2185);return pm2[_0xced5('0xf')](pm2Config);})[_0xced5('0xd')](function(_0x4b8279){logger[_0xced5('0xe')]('Online\x20apps:',_[_0xced5('0x10')](_[_0xced5('0x11')](_0x4b8279,{'status':_0xced5('0x12')}),_0xced5('0x13'))[_0xced5('0x14')]());logger[_0xced5('0xe')](_0xced5('0x15'),_['map'](_['filter'](_0x4b8279,function(_0x23ca09){return _0x23ca09[_0xced5('0x16')]!==_0xced5('0x12');}),'name')['join']()||_0xced5('0x17'));config[_0xced5('0x18')]&&require(_0xced5('0x19'))[_0xced5('0x1a')]();require(_0xced5('0x1b'))[_0xced5('0x1a')]();})['catch'](function(_0x29a3ba){logger[_0xced5('0x1c')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x29a3ba);process[_0xced5('0x1d')](0x1);});}main(); \ No newline at end of file +var _0xf03a=['join','Offline\x20apps:','status','online','name','None','./config/seedDB','default','./config/license','catch','exit','./mysqldb','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','then','info','start','Online\x20apps:','map','filter'];(function(_0x20ea8,_0x15f89f){var _0x44366e=function(_0x147c96){while(--_0x147c96){_0x20ea8['push'](_0x20ea8['shift']());}};_0x44366e(++_0x15f89f);}(_0xf03a,0x1a0));var _0xaf03=function(_0x39b8a5,_0xc78910){_0x39b8a5=_0x39b8a5-0x0;var _0x3f17e7=_0xf03a[_0x39b8a5];return _0x3f17e7;};'use strict';var _=require('lodash');var mysqldb=require(_0xaf03('0x0'));var rpc=require(_0xaf03('0x1'));var config=require(_0xaf03('0x2'));var logger=require(_0xaf03('0x3'))('app');var pm2=require(_0xaf03('0x4'));var pm2Config=require(_0xaf03('0x5'));var schedule=require('./config/schedule');var chat=require(_0xaf03('0x6'));var whatsapp=require(_0xaf03('0x7'));var transcribe=require(_0xaf03('0x8'));function main(){return mysqldb['db'][_0xaf03('0x9')]['sync']()[_0xaf03('0xa')](function(){return rpc['listen']();})[_0xaf03('0xa')](function(_0x467e7c){logger[_0xaf03('0xb')](_0x467e7c);return chat[_0xaf03('0xc')]();})[_0xaf03('0xa')](function(){return whatsapp[_0xaf03('0xc')]();})['then'](function(){return schedule[_0xaf03('0xc')]();})[_0xaf03('0xa')](function(){return transcribe[_0xaf03('0xc')]();})[_0xaf03('0xa')](function(_0x417c6a){logger['info'](_0x417c6a);return pm2[_0xaf03('0xc')](pm2Config);})[_0xaf03('0xa')](function(_0x2254d4){logger[_0xaf03('0xb')](_0xaf03('0xd'),_[_0xaf03('0xe')](_[_0xaf03('0xf')](_0x2254d4,{'status':'online'}),'name')[_0xaf03('0x10')]());logger[_0xaf03('0xb')](_0xaf03('0x11'),_['map'](_['filter'](_0x2254d4,function(_0x38ae35){return _0x38ae35[_0xaf03('0x12')]!==_0xaf03('0x13');}),_0xaf03('0x14'))[_0xaf03('0x10')]()||_0xaf03('0x15'));config['seedDB']&&require(_0xaf03('0x16'))[_0xaf03('0x17')]();require(_0xaf03('0x18'))[_0xaf03('0x17')]();})[_0xaf03('0x19')](function(_0x27e625){logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x27e625);process[_0xaf03('0x1a')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 08093f4..f0dc61d 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 _0x1067=['startsWith','Bearer','Unknown\x20authorization\x20format','getUuid','query','apikey','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','apiKeyNonce','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','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~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','decryptString','length','splice','unshift','join','promisify','sign','secret','payload','options','verify','toString','hex','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','secrets','session','role','fullname','name','internal','email','permissions','md5secret','voicePause','chatPause','smsPause','openchannelPause','showWebBar','lastLoginAt','crudPermissions','alias','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','downloadVoiceRecordings','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','closed','disposition','then','json','unmanaged','Unmanaged.','Forbidden.','use','headers','authorization','Basic','User','find','authenticate','status','Wrong\x20credentials.','catch'];(function(_0x22a6ac,_0x3dda9e){var _0x2d62b2=function(_0x226c17){while(--_0x226c17){_0x22a6ac['push'](_0x22a6ac['shift']());}};_0x2d62b2(++_0x3dda9e);}(_0x1067,0x131));var _0x7106=function(_0x4e6a6d,_0x304e36){_0x4e6a6d=_0x4e6a6d-0x0;var _0x2fd87e=_0x1067[_0x4e6a6d];return _0x2fd87e;};'use strict';var db=require(_0x7106('0x0'))['db'];var config=require(_0x7106('0x1'));var hardwareConf=require(_0x7106('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0x7106('0x3'));var _=require(_0x7106('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x7106('0x5'));var compose=require(_0x7106('0x6'));var basicAuth=require(_0x7106('0x7'));var crypto=require('crypto');var BPromise=require(_0x7106('0x8'));var util=require(_0x7106('0x9'));var moment=require(_0x7106('0xa'));var validateJwt=expressJwt({'secret':config[_0x7106('0xb')][_0x7106('0xc')]});var userAttributes=['id',_0x7106('0xd'),_0x7106('0xe'),_0x7106('0xf'),_0x7106('0x10'),_0x7106('0x11'),'userpic',_0x7106('0x12'),_0x7106('0x13'),_0x7106('0x14'),_0x7106('0x15'),'mailPause','faxPause',_0x7106('0x16'),_0x7106('0x17'),'pauseType',_0x7106('0x18'),_0x7106('0x19'),'lastPauseAt',_0x7106('0x1a'),'allowmessenger','passwordResetAt',_0x7106('0x1b'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording',_0x7106('0x1c'),_0x7106('0x1d'),_0x7106('0x1e'),_0x7106('0x1f'),_0x7106('0x20'),_0x7106('0x21'),_0x7106('0x22'),_0x7106('0x23'),'userProfileId','privacyEnabled','settingsEnabled','wssPort',_0x7106('0x24'),'downloadOmnichannelInteractions',_0x7106('0x25')];exports[_0x7106('0x26')]=function(){return this[_0x7106('0x27')](!![])['use'](function(_0xdd2f30,_0xf7369e,_0x4f314c){if(_0xdd2f30[_0x7106('0x28')]){_0x4f314c();}else{return db[_0x7106('0x29')][_0x7106('0x2a')]({'where':{'id':_0xdd2f30[_0x7106('0x2b')]['id']},'attributes':['id',_0x7106('0x2c'),_0x7106('0x2d')],'raw':!![]})[_0x7106('0x2e')](function(_0x5602fb){if(_0x5602fb&&_0x5602fb[_0x7106('0x2c')]){return _0xf7369e['status'](_0x5602fb['disposition']==='unmanaged'?0x195:0x193)[_0x7106('0x2f')]({'message':_0x5602fb['disposition']===_0x7106('0x30')?_0x7106('0x31'):_0x7106('0x32')});}else{_0x4f314c();}})['catch'](function(_0x19f32b){_0x4f314c(_0x19f32b);});}});};exports['isAuthenticated']=function isAuthenticated(_0x365f7d){return compose()[_0x7106('0x33')](function(_0x23531d,_0xd30bca,_0x188459){var _0x37f6ab;if(_0x23531d[_0x7106('0x34')][_0x7106('0x35')]){if(_['startsWith'](_0x23531d[_0x7106('0x34')][_0x7106('0x35')],_0x7106('0x36'))){var _0x7be5dc=basicAuth(_0x23531d);db[_0x7106('0x37')][_0x7106('0x38')]({'where':{'name':_0x7be5dc['name']}})[_0x7106('0x2e')](function(_0x200430){if(!_0x200430||!_0x200430[_0x7106('0x39')](_0x7be5dc['pass'])){return _0xd30bca[_0x7106('0x3a')](0x191)['json']({'message':_0x7106('0x3b')});}_0x23531d[_0x7106('0x28')]={'id':_0x200430['id']};_0x188459();})[_0x7106('0x3c')](function(_0xdb629a){_0x188459(_0xdb629a);});}else if(_[_0x7106('0x3d')](_0x23531d[_0x7106('0x34')][_0x7106('0x35')],_0x7106('0x3e'))){validateJwt(_0x23531d,_0xd30bca,_0x188459);}else{if(_0x365f7d){_0x188459();}else{return _0xd30bca[_0x7106('0x3a')](0x193)['json']({'message':_0x7106('0x3f')});}}}else if(_0x23531d['query']['apikey']){try{var _0x5158ca={'audience':hardwareConf[_0x7106('0x40')](),'issuer':hardwareConf[_0x7106('0x40')]()};verifyJwt(_0x23531d[_0x7106('0x41')][_0x7106('0x42')],_0x5158ca)[_0x7106('0x2e')](function(_0x364f05){return db[_0x7106('0x37')][_0x7106('0x38')]({'where':{'id':_0x364f05['sub']}})['then'](function(_0x512fc1){_0x37f6ab=_0x512fc1;return db[_0x7106('0x43')][_0x7106('0x2a')]({'where':{'id':0x1},'attributes':[_0x7106('0x44'),_0x7106('0x45')],'raw':!![]});})[_0x7106('0x2e')](function(_0x517286){if(!_0x37f6ab||!_[_0x7106('0x46')](_0x37f6ab['apiKeyNonce'],_0x364f05[_0x7106('0x47')])){return _0xd30bca[_0x7106('0x3a')](0x191)[_0x7106('0x2f')]({'message':_0x7106('0x48')});}if(_0x37f6ab[_0x7106('0x49')]){return _0xd30bca[_0x7106('0x3a')](0x191)[_0x7106('0x2f')]({'message':_0x7106('0x4a')});}if(_0x37f6ab[_0x7106('0x4b')]){if(_0x517286[_0x7106('0x45')]>0x0){if(moment(_0x37f6ab['blockedAt'])[_0x7106('0x4c')](_0x517286[_0x7106('0x45')],_0x7106('0x4d'))>moment()){return _0xd30bca['status'](0x191)[_0x7106('0x2f')]({'message':_0x7106('0x4a')});}}else{return _0xd30bca[_0x7106('0x3a')](0x191)[_0x7106('0x2f')]({'message':_0x7106('0x4a')});}}_0x23531d['user']={'id':_0x37f6ab['id']};_0x188459();});})[_0x7106('0x3c')](function(){return _0xd30bca[_0x7106('0x3a')](0x191)[_0x7106('0x2f')]({'message':_0x7106('0x4a')});});}catch(_0x411f47){_0x188459(_0x411f47);}}else if(_0x365f7d){_0x188459();}else{return _0xd30bca[_0x7106('0x3a')](0x193)[_0x7106('0x2f')]({'message':_0x7106('0x3f')});}})['use'](function(_0x4264de,_0x5b159f,_0x42554f){if(_0x4264de[_0x7106('0x28')]){db[_0x7106('0x37')][_0x7106('0x38')]({'where':{'id':_0x4264de[_0x7106('0x28')]['id']},'attributes':userAttributes})[_0x7106('0x2e')](function(_0x241c49){if(!_0x241c49){return _0x5b159f[_0x7106('0x3a')](0x194)[_0x7106('0x2f')]({'message':_0x7106('0x4e')});}_0x4264de[_0x7106('0x28')]=_0x241c49;_0x42554f();})['catch'](function(_0x1a3fb6){_0x42554f(_0x1a3fb6);});}else if(_0x365f7d){_0x42554f();}else{return _0x5b159f['status'](0x194)['json']({'message':_0x7106('0x4f')});}});};exports[_0x7106('0x50')]=function canUpdate(){return compose()[_0x7106('0x33')](function(_0x1d746b,_0x11d764,_0x1b46c9){return licenseUtil[_0x7106('0x51')]()[_0x7106('0x2e')](function(_0xda09bd){if(_0xda09bd[_0x7106('0x52')]){_0x1b46c9();}else{return _0x11d764['status'](0x193)[_0x7106('0x2f')]({'message':_0x7106('0x53')});}})['catch'](function(_0x486f52){_0x1b46c9(_0x486f52);});});};exports['isMiddleware']=function(_0x23eaca,_0x38cc04,_0x276f67){_0x23eaca[_0x7106('0x54')]=!![];return _0x276f67();};exports[_0x7106('0x55')]=function signToken(_0x170056){return signJwt(_0x170056);};exports['setTokenCookie']=function(_0x326907,_0x575d8b){if(!_0x326907[_0x7106('0x28')]){return _0x575d8b[_0x7106('0x3a')](0x194)['json']({'message':_0x7106('0x56')});}var _0x54170e={'payload':{'id':_0x326907[_0x7106('0x28')]['id'],'role':_0x326907[_0x7106('0x28')][_0x7106('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x54170e)[_0x7106('0x2e')](function(_0x6e2f67){_0x575d8b['cookie']('motion.token',_0x6e2f67);_0x575d8b['redirect'](_0x7106('0x57'));})[_0x7106('0x3c')](function(_0x24d92f){return _0x575d8b['status'](0x1f4)[_0x7106('0x58')](_0x24d92f);});};exports[_0x7106('0x59')]=function(_0x3fdc30){if(_[_0x7106('0x5a')](_0x3fdc30['apiKeyNonce'])||_[_0x7106('0x5a')](_0x3fdc30[_0x7106('0x5b')])){return null;}else{return createJwt(_0x3fdc30);}};exports[_0x7106('0x5c')]=function(_0x7e5cb5){_0x7e5cb5[_0x7106('0x5d')]=generateNonce();_0x7e5cb5[_0x7106('0x5b')]=generateIssuedAt();return createJwt(_0x7e5cb5);};exports[_0x7106('0x5e')]=function(_0xd5bd00,_0x38b448){var _0x5e7caa=_0xd5bd00[_0x7106('0x41')][_0x7106('0x42')];if(_0x5e7caa){var _0x427d61={'nonce':_0x38b448[_0x7106('0x5d')],'iat':_0x38b448['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x7106('0x40')]()};return verifyJwt(_0x5e7caa,_0x427d61)[_0x7106('0x2e')](function(){return generateApiKey(_0x38b448);});}else{throw{'message':_0x7106('0x5f')};}};exports[_0x7106('0x60')]=function(_0xaed1a1){var _0x56dc07=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x56dc07[_0x7106('0x61')](_0xaed1a1))throw new db['Sequelize']['ValidationError'](_0x7106('0x62'));return;};exports[_0x7106('0x63')]=function(_0x38cb99,_0x2fed77,_0x3fae79){var _0x274d54=encryptor['decryptString'](_0x2fed77)[_0x7106('0x64')](',');for(var _0x3d3239=0x0;_0x3d3239<_0x3fae79;_0x3d3239++){if(!_0x274d54[_0x3d3239])break;if(_0x38cb99[_0x7106('0x65')]()===_0x274d54[_0x3d3239][_0x7106('0x65')]()){var _0x3635e8=util[_0x7106('0x66')](_0x7106('0x67'),_0x3fae79);if(_0x3fae79===0x1){_0x3635e8=_0x7106('0x68');}throw new db[(_0x7106('0x69'))][(_0x7106('0x6a'))](_0x3635e8);}}return;};exports[_0x7106('0x6b')]=function(_0x1af9ae,_0x7a6120){var _0x9650af=_0x7a6120?encryptor[_0x7106('0x6c')](_0x7a6120)[_0x7106('0x64')](','):[];if(_0x9650af[_0x7106('0x6d')]===0x5){_0x9650af[_0x7106('0x6e')](-0x1,0x1);}_0x9650af[_0x7106('0x6f')](_0x1af9ae);return encryptor['encryptString'](_0x9650af[_0x7106('0x70')](','));};function signJwt(_0x48ee86){var _0x406910=BPromise[_0x7106('0x71')](jwt[_0x7106('0x72')],{'context':jwt});var _0x188bef=_0x48ee86[_0x7106('0x73')]||config[_0x7106('0xb')][_0x7106('0xc')];return new BPromise(function(_0x2d9fad,_0x28b592){_0x406910(_0x48ee86[_0x7106('0x74')],_0x188bef,_0x48ee86[_0x7106('0x75')])[_0x7106('0x2e')](function(_0x1ff0bd){_0x2d9fad(_0x1ff0bd);})['catch'](function(_0x2e4c60){_0x28b592(_0x2e4c60);});});}function verifyJwt(_0x2363fa,_0x534c00,_0xd270c7){var _0x4e0dbf=BPromise[_0x7106('0x71')](jwt[_0x7106('0x76')],{'context':jwt});var _0xc0f9ea=_0xd270c7||config[_0x7106('0xb')]['session'];return new BPromise(function(_0x4a15f1,_0x94d915){_0x4e0dbf(_0x2363fa,_0xc0f9ea,_0x534c00)[_0x7106('0x2e')](function(_0x20d170){_0x4a15f1(_0x20d170);})['catch'](function(_0x1c7bbb){_0x94d915(_0x1c7bbb);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x7106('0x77')](_0x7106('0x78'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)['toString']();}function createJwt(_0x2ee92e){var _0x452489={'payload':{'iat':_0x2ee92e[_0x7106('0x5b')],'nonce':_0x2ee92e['apiKeyNonce']},'options':{'algorithm':_0x7106('0x79'),'subject':_0x2ee92e['id']['toString'](),'issuer':hardwareConf[_0x7106('0x40')](),'audience':hardwareConf[_0x7106('0x40')]()}};return signJwt(_0x452489)[_0x7106('0x2e')](function(_0x5c0a62){return{'iat':_0x2ee92e['apiKeyIat'],'nonce':_0x2ee92e[_0x7106('0x5d')],'token':_0x5c0a62};});} \ No newline at end of file +var _0x976c=['express-jwt','crypto','bluebird','util','moment','secrets','role','fullname','name','internal','email','userpic','permissions','voicePause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','then','status','unmanaged','Forbidden.','authorization','startsWith','headers','Basic','User','find','authenticate','pass','json','Wrong\x20credentials.','catch','Unknown\x20authorization\x20format','query','apikey','getUuid','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','updatePasswordsHistory','unshift','join','sign','payload','options','verify','session','randomBytes','toString','hex','floor','now','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','lodash'];(function(_0x55059d,_0x4e7936){var _0x131cd9=function(_0x149ee5){while(--_0x149ee5){_0x55059d['push'](_0x55059d['shift']());}};_0x131cd9(++_0x4e7936);}(_0x976c,0x72));var _0xc976=function(_0x3d8fe6,_0x174155){_0x3d8fe6=_0x3d8fe6-0x0;var _0x3864e2=_0x976c[_0x3d8fe6];return _0x3864e2;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xc976('0x0'));var hardwareConf=require(_0xc976('0x1'));var licenseUtil=require(_0xc976('0x2'));var encryptor=require('../encryptor');var _=require(_0xc976('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xc976('0x4'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0xc976('0x5'));var BPromise=require(_0xc976('0x6'));var util=require(_0xc976('0x7'));var moment=require(_0xc976('0x8'));var validateJwt=expressJwt({'secret':config[_0xc976('0x9')]['session']});var userAttributes=['id',_0xc976('0xa'),_0xc976('0xb'),_0xc976('0xc'),_0xc976('0xd'),_0xc976('0xe'),_0xc976('0xf'),_0xc976('0x10'),'md5secret',_0xc976('0x11'),'chatPause',_0xc976('0x12'),_0xc976('0x13'),_0xc976('0x14'),_0xc976('0x15'),'pauseType',_0xc976('0x16'),_0xc976('0x17'),_0xc976('0x18'),_0xc976('0x19'),'allowmessenger','passwordResetAt',_0xc976('0x1a'),_0xc976('0x1b'),_0xc976('0x1c'),_0xc976('0x1d'),_0xc976('0x1e'),_0xc976('0x1f'),_0xc976('0x20'),_0xc976('0x21'),'phoneBarPrefixRequired','phoneBarRemoteControl',_0xc976('0x22'),'hotdesk',_0xc976('0x23'),_0xc976('0x24'),_0xc976('0x25'),_0xc976('0x26'),_0xc976('0x27'),'downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments'];exports[_0xc976('0x28')]=function(){return this[_0xc976('0x29')](!![])[_0xc976('0x2a')](function(_0x19a20b,_0x95866d,_0x1e0f1a){if(_0x19a20b[_0xc976('0x2b')]){_0x1e0f1a();}else{return db[_0xc976('0x2c')][_0xc976('0x2d')]({'where':{'id':_0x19a20b['params']['id']},'attributes':['id',_0xc976('0x2e'),_0xc976('0x2f')],'raw':!![]})[_0xc976('0x30')](function(_0x28478d){if(_0x28478d&&_0x28478d['closed']){return _0x95866d[_0xc976('0x31')](_0x28478d[_0xc976('0x2f')]===_0xc976('0x32')?0x195:0x193)['json']({'message':_0x28478d[_0xc976('0x2f')]==='unmanaged'?'Unmanaged.':_0xc976('0x33')});}else{_0x1e0f1a();}})['catch'](function(_0x504268){_0x1e0f1a(_0x504268);});}});};exports['isAuthenticated']=function isAuthenticated(_0x2c6fc1){return compose()[_0xc976('0x2a')](function(_0x274e47,_0x4f47e3,_0x2c8cc6){var _0x558761;if(_0x274e47['headers'][_0xc976('0x34')]){if(_[_0xc976('0x35')](_0x274e47[_0xc976('0x36')][_0xc976('0x34')],_0xc976('0x37'))){var _0x178c12=basicAuth(_0x274e47);db[_0xc976('0x38')][_0xc976('0x39')]({'where':{'name':_0x178c12['name']}})[_0xc976('0x30')](function(_0x1916b8){if(!_0x1916b8||!_0x1916b8[_0xc976('0x3a')](_0x178c12[_0xc976('0x3b')])){return _0x4f47e3[_0xc976('0x31')](0x191)[_0xc976('0x3c')]({'message':_0xc976('0x3d')});}_0x274e47['user']={'id':_0x1916b8['id']};_0x2c8cc6();})[_0xc976('0x3e')](function(_0x3e6eeb){_0x2c8cc6(_0x3e6eeb);});}else if(_['startsWith'](_0x274e47[_0xc976('0x36')][_0xc976('0x34')],'Bearer')){validateJwt(_0x274e47,_0x4f47e3,_0x2c8cc6);}else{if(_0x2c6fc1){_0x2c8cc6();}else{return _0x4f47e3[_0xc976('0x31')](0x193)[_0xc976('0x3c')]({'message':_0xc976('0x3f')});}}}else if(_0x274e47[_0xc976('0x40')][_0xc976('0x41')]){try{var _0x45118e={'audience':hardwareConf[_0xc976('0x42')](),'issuer':hardwareConf[_0xc976('0x42')]()};verifyJwt(_0x274e47[_0xc976('0x40')][_0xc976('0x41')],_0x45118e)[_0xc976('0x30')](function(_0x1cd778){return db[_0xc976('0x38')][_0xc976('0x39')]({'where':{'id':_0x1cd778['sub']}})['then'](function(_0x596184){_0x558761=_0x596184;return db[_0xc976('0x43')]['findOne']({'where':{'id':0x1},'attributes':[_0xc976('0x44'),_0xc976('0x45')],'raw':!![]});})['then'](function(_0x477b40){if(!_0x558761||!_['isEqual'](_0x558761[_0xc976('0x46')],_0x1cd778['nonce'])){return _0x4f47e3['status'](0x191)[_0xc976('0x3c')]({'message':_0xc976('0x47')});}if(_0x558761[_0xc976('0x48')]){return _0x4f47e3['status'](0x191)[_0xc976('0x3c')]({'message':_0xc976('0x49')});}if(_0x558761[_0xc976('0x4a')]){if(_0x477b40[_0xc976('0x45')]>0x0){if(moment(_0x558761['blockedAt'])[_0xc976('0x4b')](_0x477b40[_0xc976('0x45')],_0xc976('0x4c'))>moment()){return _0x4f47e3[_0xc976('0x31')](0x191)[_0xc976('0x3c')]({'message':_0xc976('0x49')});}}else{return _0x4f47e3[_0xc976('0x31')](0x191)['json']({'message':_0xc976('0x49')});}}_0x274e47[_0xc976('0x2b')]={'id':_0x558761['id']};_0x2c8cc6();});})[_0xc976('0x3e')](function(){return _0x4f47e3[_0xc976('0x31')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x492c83){_0x2c8cc6(_0x492c83);}}else if(_0x2c6fc1){_0x2c8cc6();}else{return _0x4f47e3[_0xc976('0x31')](0x193)[_0xc976('0x3c')]({'message':_0xc976('0x3f')});}})[_0xc976('0x2a')](function(_0x4a63a0,_0x4862f9,_0x2df8a4){if(_0x4a63a0[_0xc976('0x2b')]){db['User']['find']({'where':{'id':_0x4a63a0[_0xc976('0x2b')]['id']},'attributes':userAttributes})[_0xc976('0x30')](function(_0x307011){if(!_0x307011){return _0x4862f9[_0xc976('0x31')](0x194)['json']({'message':_0xc976('0x4d')});}_0x4a63a0[_0xc976('0x2b')]=_0x307011;_0x2df8a4();})['catch'](function(_0x20975f){_0x2df8a4(_0x20975f);});}else if(_0x2c6fc1){_0x2df8a4();}else{return _0x4862f9[_0xc976('0x31')](0x194)[_0xc976('0x3c')]({'message':_0xc976('0x4e')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xc976('0x2a')](function(_0x51d644,_0xa425,_0x305126){return licenseUtil[_0xc976('0x4f')]()[_0xc976('0x30')](function(_0xdfd8e4){if(_0xdfd8e4[_0xc976('0x50')]){_0x305126();}else{return _0xa425[_0xc976('0x31')](0x193)['json']({'message':'Forbidden'});}})['catch'](function(_0x43e291){_0x305126(_0x43e291);});});};exports['isMiddleware']=function(_0xd4f78f,_0x5d8f30,_0x46db63){_0xd4f78f[_0xc976('0x51')]=!![];return _0x46db63();};exports[_0xc976('0x52')]=function signToken(_0x423159){return signJwt(_0x423159);};exports[_0xc976('0x53')]=function(_0x2af904,_0x1afbef){if(!_0x2af904[_0xc976('0x2b')]){return _0x1afbef[_0xc976('0x31')](0x194)['json']({'message':_0xc976('0x54')});}var _0xa20174={'payload':{'id':_0x2af904[_0xc976('0x2b')]['id'],'role':_0x2af904['user'][_0xc976('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0xa20174)[_0xc976('0x30')](function(_0x43cc8c){_0x1afbef['cookie'](_0xc976('0x55'),_0x43cc8c);_0x1afbef[_0xc976('0x56')](_0xc976('0x57'));})[_0xc976('0x3e')](function(_0x17b70f){return _0x1afbef[_0xc976('0x31')](0x1f4)[_0xc976('0x58')](_0x17b70f);});};exports[_0xc976('0x59')]=function(_0x74615f){if(_[_0xc976('0x5a')](_0x74615f[_0xc976('0x46')])||_[_0xc976('0x5a')](_0x74615f[_0xc976('0x5b')])){return null;}else{return createJwt(_0x74615f);}};exports[_0xc976('0x5c')]=function(_0x3a14cd){_0x3a14cd[_0xc976('0x46')]=generateNonce();_0x3a14cd['apiKeyIat']=generateIssuedAt();return createJwt(_0x3a14cd);};exports['regenerateApiKey']=function(_0x2e6b33,_0x3def20){var _0x370abc=_0x2e6b33['query'][_0xc976('0x41')];if(_0x370abc){var _0x54b3ff={'nonce':_0x3def20['apiKeyNonce'],'iat':_0x3def20[_0xc976('0x5b')],'audience':hardwareConf[_0xc976('0x42')](),'issuer':hardwareConf[_0xc976('0x42')]()};return verifyJwt(_0x370abc,_0x54b3ff)[_0xc976('0x30')](function(){return generateApiKey(_0x3def20);});}else{throw{'message':_0xc976('0x5d')};}};exports[_0xc976('0x5e')]=function(_0x12f2f9){var _0x44d077=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x44d077[_0xc976('0x5f')](_0x12f2f9))throw new db[(_0xc976('0x60'))][(_0xc976('0x61'))](_0xc976('0x62'));return;};exports[_0xc976('0x63')]=function(_0x29ce0d,_0x3f14d3,_0x3e645f){var _0xdb8399=encryptor[_0xc976('0x64')](_0x3f14d3)[_0xc976('0x65')](',');for(var _0x4fac00=0x0;_0x4fac00<_0x3e645f;_0x4fac00++){if(!_0xdb8399[_0x4fac00])break;if(_0x29ce0d[_0xc976('0x66')]()===_0xdb8399[_0x4fac00][_0xc976('0x66')]()){var _0x434a20=util[_0xc976('0x67')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x3e645f);if(_0x3e645f===0x1){_0x434a20='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xc976('0x60'))][(_0xc976('0x61'))](_0x434a20);}}return;};exports[_0xc976('0x68')]=function(_0x3e33a6,_0x39c417){var _0x85a4c8=_0x39c417?encryptor['decryptString'](_0x39c417)[_0xc976('0x65')](','):[];if(_0x85a4c8['length']===0x5){_0x85a4c8['splice'](-0x1,0x1);}_0x85a4c8[_0xc976('0x69')](_0x3e33a6);return encryptor['encryptString'](_0x85a4c8[_0xc976('0x6a')](','));};function signJwt(_0x4e8ed9){var _0x39549b=BPromise['promisify'](jwt[_0xc976('0x6b')],{'context':jwt});var _0x21c44b=_0x4e8ed9['secret']||config[_0xc976('0x9')]['session'];return new BPromise(function(_0x4dcdce,_0x52156f){_0x39549b(_0x4e8ed9[_0xc976('0x6c')],_0x21c44b,_0x4e8ed9[_0xc976('0x6d')])[_0xc976('0x30')](function(_0x499f2a){_0x4dcdce(_0x499f2a);})[_0xc976('0x3e')](function(_0x19505b){_0x52156f(_0x19505b);});});}function verifyJwt(_0x31a6e0,_0x554ae2,_0x2c5dc4){var _0x4a25ce=BPromise['promisify'](jwt[_0xc976('0x6e')],{'context':jwt});var _0x565078=_0x2c5dc4||config['secrets'][_0xc976('0x6f')];return new BPromise(function(_0x50c885,_0x31ce4c){_0x4a25ce(_0x31a6e0,_0x565078,_0x554ae2)[_0xc976('0x30')](function(_0x1629d8){_0x50c885(_0x1629d8);})[_0xc976('0x3e')](function(_0x47cb5e){_0x31ce4c(_0x47cb5e);});});}function generateNonce(){return crypto[_0xc976('0x70')](0x10)[_0xc976('0x71')](_0xc976('0x72'));}function generateIssuedAt(){return Math[_0xc976('0x73')](Date[_0xc976('0x74')]()/0x3e8)['toString']();}function createJwt(_0x5eb901){var _0x124edf={'payload':{'iat':_0x5eb901['apiKeyIat'],'nonce':_0x5eb901['apiKeyNonce']},'options':{'algorithm':_0xc976('0x75'),'subject':_0x5eb901['id'][_0xc976('0x71')](),'issuer':hardwareConf[_0xc976('0x42')](),'audience':hardwareConf[_0xc976('0x42')]()}};return signJwt(_0x124edf)['then'](function(_0x3ee563){return{'iat':_0x5eb901['apiKeyIat'],'nonce':_0x5eb901[_0xc976('0x46')],'token':_0x3ee563};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 9abc1b9..9eadd55 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 _0x3a99=['encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','binary','unlink','decryptFile','createDecipher','data','update','write','end','encryptString','utf8','final','base64','decryptString','secret','crypto','bluebird','lodash','../../config/environment','app','secrets','aes-256-ctr','aes192'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0x3a99,0x1bf));var _0x93a9=function(_0x3fd12f,_0x47e86b){_0x3fd12f=_0x3fd12f-0x0;var _0x4fc0f8=_0x3a99[_0x3fd12f];return _0x4fc0f8;};'use strict';var crypto=require(_0x93a9('0x0'));var fs=require('fs');var BPromise=require(_0x93a9('0x1'));var _=require(_0x93a9('0x2'));var config=require(_0x93a9('0x3'));var logger=require('../../config/logger')(_0x93a9('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x93a9('0x5')]['session'],'algorithm':_0x93a9('0x6')};const fileOptions={'algorithm':_0x93a9('0x7')};if(config['encrypt']&&config[_0x93a9('0x8')][_0x93a9('0x9')]){var isSupported=isAlgorithmSupported(config[_0x93a9('0x8')]['algorithm']);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0x93a9('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x93a9('0xa')](',\x20');logger[_0x93a9('0xb')](config[_0x93a9('0x8')][_0x93a9('0x9')],_0x93a9('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2378f0){return AES_SUPPORTED_RX[_0x93a9('0xd')](_0x2378f0);}function getSupportedCiphers(){return crypto[_0x93a9('0xe')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x13d891){return getSupportedCiphers()[_0x93a9('0xf')](_0x13d891)>-0x1;}function combineOptions(_0xdf52e4){var _0x43302d={};for(var _0x3c0ceb in fileOptions){if(fileOptions['hasOwnProperty'](_0x3c0ceb)){_0x43302d[_0x3c0ceb]=fileOptions[_0x3c0ceb];}}if(_0xdf52e4){for(var _0x15f1c6 in _0xdf52e4){if(_0xdf52e4[_0x93a9('0x10')](_0x15f1c6)){_0x43302d[_0x15f1c6]=_0xdf52e4[_0x15f1c6];}}}return _0x43302d;}exports[_0x93a9('0x11')]=function(_0x2aecad,_0x326923,_0x33b2f4,_0x5c1434){return new BPromise(function(_0x1d685e,_0x26e0f2){_0x5c1434=combineOptions(_0x5c1434);var _0x539cff=new Buffer(_0x33b2f4);var _0x1581ca=fs[_0x93a9('0x12')](_0x2aecad);var _0x39183c=fs[_0x93a9('0x13')](_0x326923);var _0x5de7e2=crypto[_0x93a9('0x14')](_0x5c1434[_0x93a9('0x9')],_0x539cff);_0x1581ca['on']('data',function(_0x53a770){var _0x204cfe=new Buffer(_0x5de7e2['update'](_0x53a770),_0x93a9('0x15'));_0x39183c['write'](_0x204cfe);});_0x1581ca['on']('end',function(){try{var _0x1b14f6=new Buffer(_0x5de7e2['final']('binary'),_0x93a9('0x15'));_0x39183c['write'](_0x1b14f6);_0x39183c['end']();_0x39183c['on']('close',function(){return _0x1d685e(_0x326923);});}catch(_0x4c1a03){fs[_0x93a9('0x16')](_0x326923);return _0x26e0f2(_0x4c1a03);}});});};exports[_0x93a9('0x17')]=function(_0x281cfe,_0x17c1ba,_0x446d47,_0x2713e4){return new BPromise(function(_0x5cb022,_0x3ae521){_0x2713e4=combineOptions(_0x2713e4);var _0x194c69=new Buffer(_0x446d47);var _0x2e6399=fs['createReadStream'](_0x281cfe);var _0x4e1b59=fs[_0x93a9('0x13')](_0x17c1ba);var _0x48d051=crypto[_0x93a9('0x18')](_0x2713e4[_0x93a9('0x9')],_0x194c69);_0x2e6399['on'](_0x93a9('0x19'),function(_0xeba91c){var _0x2d7d1f=new Buffer(_0x48d051[_0x93a9('0x1a')](_0xeba91c),_0x93a9('0x15'));_0x4e1b59[_0x93a9('0x1b')](_0x2d7d1f);});_0x2e6399['on'](_0x93a9('0x1c'),function(){try{var _0x95a1d8=new Buffer(_0x48d051['final']('binary'),_0x93a9('0x15'));_0x4e1b59[_0x93a9('0x1b')](_0x95a1d8);_0x4e1b59[_0x93a9('0x1c')]();_0x4e1b59['on']('close',function(){return _0x5cb022(_0x17c1ba);});}catch(_0x5b7256){fs[_0x93a9('0x16')](_0x17c1ba);return _0x3ae521(_0x5b7256);}});});};exports[_0x93a9('0x1d')]=function(_0x52a853,_0x320d44,_0x2d5cdd){var _0x486d6c=_0x2d5cdd||stringOptions[_0x93a9('0x9')];var _0x1caffb=_0x320d44||stringOptions['secret'];var _0x196dce=crypto[_0x93a9('0x14')](_0x486d6c,_0x1caffb);var _0x5a0392=_0x196dce[_0x93a9('0x1a')](_0x52a853,_0x93a9('0x1e'),'base64');_0x5a0392+=_0x196dce[_0x93a9('0x1f')](_0x93a9('0x20'));return _0x5a0392;};exports[_0x93a9('0x21')]=function(_0x5235ec,_0xba5fb1,_0x1a6f53){var _0x485b76=_0x1a6f53||stringOptions[_0x93a9('0x9')];var _0x5a7fe4=_0xba5fb1||stringOptions[_0x93a9('0x22')];var _0xaf8546=crypto[_0x93a9('0x18')](_0x485b76,_0x5a7fe4);var _0xfd4f05=_0xaf8546[_0x93a9('0x1a')](_0x5235ec,_0x93a9('0x20'),_0x93a9('0x1e'));_0xfd4f05+=_0xaf8546[_0x93a9('0x1f')](_0x93a9('0x1e'));return _0xfd4f05;}; \ No newline at end of file +var _0x6b00=['app','secrets','session','aes-256-ctr','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','end','final','write','close','unlink','decryptFile','encryptString','secret','utf8','base64','decryptString','createDecipher','bluebird'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x6b00,0xb9));var _0x06b0=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6b00[_0x432682];return _0x463d05;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x06b0('0x0'));var _=require('lodash');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x06b0('0x1'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x06b0('0x2')][_0x06b0('0x3')],'algorithm':_0x06b0('0x4')};const fileOptions={'algorithm':'aes192'};if(config[_0x06b0('0x5')]&&config['encrypt'][_0x06b0('0x6')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0x06b0('0x6')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0x06b0('0x5')]['algorithm'],_0x06b0('0x7'),supportedAlgorithms);}}function isASupportedCipher(_0x38096a){return AES_SUPPORTED_RX[_0x06b0('0x8')](_0x38096a);}function getSupportedCiphers(){return crypto[_0x06b0('0x9')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x403b85){return getSupportedCiphers()[_0x06b0('0xa')](_0x403b85)>-0x1;}function combineOptions(_0x102055){var _0x15c5d1={};for(var _0x15243d in fileOptions){if(fileOptions[_0x06b0('0xb')](_0x15243d)){_0x15c5d1[_0x15243d]=fileOptions[_0x15243d];}}if(_0x102055){for(var _0x34499e in _0x102055){if(_0x102055['hasOwnProperty'](_0x34499e)){_0x15c5d1[_0x34499e]=_0x102055[_0x34499e];}}}return _0x15c5d1;}exports[_0x06b0('0xc')]=function(_0xe634f2,_0x1b35d4,_0x32f377,_0x2c5aa7){return new BPromise(function(_0x311138,_0x34d34f){_0x2c5aa7=combineOptions(_0x2c5aa7);var _0x2f4b36=new Buffer(_0x32f377);var _0x3f5c91=fs[_0x06b0('0xd')](_0xe634f2);var _0x2e7b8a=fs[_0x06b0('0xe')](_0x1b35d4);var _0x43d170=crypto[_0x06b0('0xf')](_0x2c5aa7[_0x06b0('0x6')],_0x2f4b36);_0x3f5c91['on'](_0x06b0('0x10'),function(_0x4fb17d){var _0x12a86e=new Buffer(_0x43d170[_0x06b0('0x11')](_0x4fb17d),_0x06b0('0x12'));_0x2e7b8a['write'](_0x12a86e);});_0x3f5c91['on'](_0x06b0('0x13'),function(){try{var _0x131a9c=new Buffer(_0x43d170[_0x06b0('0x14')](_0x06b0('0x12')),_0x06b0('0x12'));_0x2e7b8a[_0x06b0('0x15')](_0x131a9c);_0x2e7b8a[_0x06b0('0x13')]();_0x2e7b8a['on'](_0x06b0('0x16'),function(){return _0x311138(_0x1b35d4);});}catch(_0x5ee164){fs[_0x06b0('0x17')](_0x1b35d4);return _0x34d34f(_0x5ee164);}});});};exports[_0x06b0('0x18')]=function(_0x4697a2,_0x1a0db8,_0x42d201,_0xd47eb0){return new BPromise(function(_0x3bd796,_0x592271){_0xd47eb0=combineOptions(_0xd47eb0);var _0x29606e=new Buffer(_0x42d201);var _0x18547d=fs['createReadStream'](_0x4697a2);var _0x39ca5f=fs[_0x06b0('0xe')](_0x1a0db8);var _0x2004ff=crypto['createDecipher'](_0xd47eb0[_0x06b0('0x6')],_0x29606e);_0x18547d['on'](_0x06b0('0x10'),function(_0xa8559e){var _0x565a4c=new Buffer(_0x2004ff['update'](_0xa8559e),_0x06b0('0x12'));_0x39ca5f[_0x06b0('0x15')](_0x565a4c);});_0x18547d['on'](_0x06b0('0x13'),function(){try{var _0x48f6e1=new Buffer(_0x2004ff[_0x06b0('0x14')](_0x06b0('0x12')),_0x06b0('0x12'));_0x39ca5f[_0x06b0('0x15')](_0x48f6e1);_0x39ca5f[_0x06b0('0x13')]();_0x39ca5f['on'](_0x06b0('0x16'),function(){return _0x3bd796(_0x1a0db8);});}catch(_0x2b93a4){fs[_0x06b0('0x17')](_0x1a0db8);return _0x592271(_0x2b93a4);}});});};exports[_0x06b0('0x19')]=function(_0x511d90,_0x100f2,_0x45b317){var _0x2f2f20=_0x45b317||stringOptions[_0x06b0('0x6')];var _0x23c186=_0x100f2||stringOptions[_0x06b0('0x1a')];var _0x2de03a=crypto['createCipher'](_0x2f2f20,_0x23c186);var _0x396c7c=_0x2de03a[_0x06b0('0x11')](_0x511d90,_0x06b0('0x1b'),_0x06b0('0x1c'));_0x396c7c+=_0x2de03a[_0x06b0('0x14')](_0x06b0('0x1c'));return _0x396c7c;};exports[_0x06b0('0x1d')]=function(_0x507560,_0x48b1dd,_0x437d22){var _0x84b418=_0x437d22||stringOptions[_0x06b0('0x6')];var _0x11f30b=_0x48b1dd||stringOptions[_0x06b0('0x1a')];var _0x1630fb=crypto[_0x06b0('0x1e')](_0x84b418,_0x11f30b);var _0x2a683d=_0x1630fb['update'](_0x507560,'base64',_0x06b0('0x1b'));_0x2a683d+=_0x1630fb['final'](_0x06b0('0x1b'));return _0x2a683d;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index aa32dcd..1afb2dd 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 _0xdd66=['catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','length','existsSync','mkdirSync','join','%s%d.%s','csv','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xdd66,0x1b6));var _0x6dd6=function(_0x5205c8,_0x6095f3){_0x5205c8=_0x5205c8-0x0;var _0x1a2d13=_0xdd66[_0x5205c8];return _0x1a2d13;};'use strict';var util=require(_0x6dd6('0x0'));var path=require(_0x6dd6('0x1'));var _=require(_0x6dd6('0x2'));var csv=require(_0x6dd6('0x3'));var fs=require('fs');var BPromise=require(_0x6dd6('0x4'));var zipdir=require(_0x6dd6('0x5'));var rimraf=require(_0x6dd6('0x6'));var db=require(_0x6dd6('0x7'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6dd6('0x8')][0x2]);var QUERY=process[_0x6dd6('0x8')][0x3];var PATH=process[_0x6dd6('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1a61aa,_0x349bac){var _0x42c49c={'status':_0x1a61aa};var _0x3953cf={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x349bac){_0x42c49c[_0x6dd6('0x9')]=_0x349bac;}return db[_0x6dd6('0xa')][_0x6dd6('0xb')](_0x42c49c,_0x3953cf);}function main(){var _0x3c0b64=0x1388;var _0x1217ac;logger[_0x6dd6('0xc')](util[_0x6dd6('0xd')](_0x6dd6('0xe'),EXTRACTED_REPORT_ID,_0x6dd6('0xf')));return db[_0x6dd6('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x6dd6('0x11')]})[_0x6dd6('0x12')](function(_0x4e3d9a){if(_0x4e3d9a){_0x1217ac=_0x4e3d9a;_0x3c0b64=_0x1217ac[_0x6dd6('0x11')]||0x1388;}})[_0x6dd6('0x12')](function(){return dbH[_0x6dd6('0x13')][_0x6dd6('0x14')](util[_0x6dd6('0xd')](_0x6dd6('0x15'),QUERY),{'type':dbH[_0x6dd6('0x13')][_0x6dd6('0x16')][_0x6dd6('0x17')]});})[_0x6dd6('0x12')](function(_0x27b364){if(!_0x27b364[0x0][_0x6dd6('0x18')]){return analyticExtractedReport(_0x6dd6('0x19'));}var _0xf9560c=[];var _0x4519ac=0x0;var _0x13b204=!![];if(_0x27b364&&_0x27b364['length']){var _0x534258=_0x27b364[0x0]['num']%(_0x4519ac+_0x3c0b64);if(_0x1217ac[_0x6dd6('0x1a')]){for(;_0x13b204;_0x4519ac+=_0x3c0b64,_0x534258=_0x27b364[0x0][_0x6dd6('0x18')]%(_0x4519ac+_0x3c0b64)){if(_0x534258==0x0||_0x534258==_0x27b364[0x0][_0x6dd6('0x18')]){_0x13b204=![];}_0xf9560c['push'](dbH[_0x6dd6('0x13')][_0x6dd6('0x14')](util[_0x6dd6('0xd')](_0x6dd6('0x1b'),QUERY,_0x3c0b64,_0x4519ac),{'type':dbH[_0x6dd6('0x13')][_0x6dd6('0x16')][_0x6dd6('0x17')]}));}}else{_0xf9560c[_0x6dd6('0x1c')](dbH[_0x6dd6('0x13')][_0x6dd6('0x14')](QUERY,{'type':dbH[_0x6dd6('0x13')][_0x6dd6('0x16')][_0x6dd6('0x17')]}));}}var _0x2776d1=path[_0x6dd6('0x1d')](PATH);var _0x20170b=path[_0x6dd6('0x1e')](PATH,_0x6dd6('0x1f'));var _0x1c2b7a=_0x1217ac[_0x6dd6('0x1a')]&&_0xf9560c[_0x6dd6('0x20')]>0x1;var _0x4f1268=[];if(!fs[_0x6dd6('0x21')](path['join'](_0x2776d1,_0x20170b))&&_0x1c2b7a){fs[_0x6dd6('0x22')](path[_0x6dd6('0x23')](_0x2776d1,_0x20170b));}return BPromise['each'](_0xf9560c,function(_0x192397){_0x4f1268['push'](_0x192397);})[_0x6dd6('0x12')](function(){for(var _0x3a915f=0x0;_0x3a915f<_0x4f1268['length'];_0x3a915f+=0x1){var _0x462d65;var _0x58a20e=_0x4f1268[_0x3a915f];if(_0x1c2b7a){_0x462d65=path[_0x6dd6('0x23')](_0x2776d1,_0x20170b,util[_0x6dd6('0xd')](_0x6dd6('0x24'),_0x20170b,_0x3a915f,_0x6dd6('0x25')));}else{_0x462d65=path['join'](_0x2776d1,util[_0x6dd6('0xd')](_0x6dd6('0x26'),_0x20170b,_0x6dd6('0x25')));}fs['writeFileSync'](_0x462d65,csv(_0x58a20e));}})[_0x6dd6('0x12')](function(){if(_0x1c2b7a){zipdir(path['join'](_0x2776d1,_0x20170b),{'saveTo':path[_0x6dd6('0x23')](_0x2776d1,util[_0x6dd6('0xd')](_0x6dd6('0x26'),_0x20170b,'zip'))},function(_0x45216a,_0x4b9757){});rimraf(path[_0x6dd6('0x23')](_0x2776d1,_0x20170b),function(){});}})[_0x6dd6('0x12')](function(){logger['info'](util[_0x6dd6('0xd')](_0x6dd6('0x27'),EXTRACTED_REPORT_ID,_0x6dd6('0xf')));return analyticExtractedReport(_0x6dd6('0x28'),_0x1c2b7a?util[_0x6dd6('0xd')]('%s.%s',_0x20170b,_0x1c2b7a?_0x6dd6('0x29'):_0x6dd6('0x25')):null);});})[_0x6dd6('0x2a')](function(_0x5d739a){logger[_0x6dd6('0xc')](util['format'](_0x6dd6('0x2b'),EXTRACTED_REPORT_ID,'CSV'),util[_0x6dd6('0x2c')](_0x5d739a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6dd6('0x2d'));})[_0x6dd6('0x2e')](function(){process[_0x6dd6('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x29b8=['push','dirname','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','to-csv','bluebird','zip-dir','../../mysqldb','argv','update','info','CSV','find','then','splitSizeCsv','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','split','%s\x20limit\x20%d\x20OFFSET\x20%d'];(function(_0x543950,_0x5c0344){var _0x220740=function(_0x51a41d){while(--_0x51a41d){_0x543950['push'](_0x543950['shift']());}};_0x220740(++_0x5c0344);}(_0x29b8,0x18e));var _0x829b=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x29b8[_0x754ab4];return _0x34079a;};'use strict';var util=require('util');var path=require('path');var _=require(_0x829b('0x0'));var csv=require(_0x829b('0x1'));var fs=require('fs');var BPromise=require(_0x829b('0x2'));var zipdir=require(_0x829b('0x3'));var rimraf=require('rimraf');var db=require(_0x829b('0x4'))['db'];var dbH=require(_0x829b('0x4'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x829b('0x5')][0x2]);var QUERY=process[_0x829b('0x5')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x31e283,_0x30ad04){var _0x3bc613={'status':_0x31e283};var _0x1cb4b1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x30ad04){_0x3bc613['savename']=_0x30ad04;}return db['AnalyticExtractedReport'][_0x829b('0x6')](_0x3bc613,_0x1cb4b1);}function main(){var _0x4bc76d=0x1388;var _0x5512de;logger[_0x829b('0x7')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x829b('0x8')));return db['Setting'][_0x829b('0x9')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})[_0x829b('0xa')](function(_0x378b45){if(_0x378b45){_0x5512de=_0x378b45;_0x4bc76d=_0x5512de[_0x829b('0xb')]||0x1388;}})[_0x829b('0xa')](function(){return dbH[_0x829b('0xc')][_0x829b('0xd')](util[_0x829b('0xe')](_0x829b('0xf'),QUERY),{'type':dbH['sequelize'][_0x829b('0x10')][_0x829b('0x11')]});})[_0x829b('0xa')](function(_0x92ab5a){if(!_0x92ab5a[0x0][_0x829b('0x12')]){return analyticExtractedReport('Empty');}var _0x1c70d8=[];var _0x460d0c=0x0;var _0x57717c=!![];if(_0x92ab5a&&_0x92ab5a[_0x829b('0x13')]){var _0x59f06f=_0x92ab5a[0x0][_0x829b('0x12')]%(_0x460d0c+_0x4bc76d);if(_0x5512de[_0x829b('0x14')]){for(;_0x57717c;_0x460d0c+=_0x4bc76d,_0x59f06f=_0x92ab5a[0x0][_0x829b('0x12')]%(_0x460d0c+_0x4bc76d)){if(_0x59f06f==0x0||_0x59f06f==_0x92ab5a[0x0]['num']){_0x57717c=![];}_0x1c70d8['push'](dbH[_0x829b('0xc')][_0x829b('0xd')](util['format'](_0x829b('0x15'),QUERY,_0x4bc76d,_0x460d0c),{'type':dbH['sequelize'][_0x829b('0x10')][_0x829b('0x11')]}));}}else{_0x1c70d8[_0x829b('0x16')](dbH[_0x829b('0xc')]['query'](QUERY,{'type':dbH[_0x829b('0xc')][_0x829b('0x10')]['SELECT']}));}}var _0x5dcb44=path[_0x829b('0x17')](PATH);var _0xf23135=path['basename'](PATH,'.csv');var _0x5d885b=_0x5512de[_0x829b('0x14')]&&_0x1c70d8[_0x829b('0x13')]>0x1;var _0x334ca1=[];if(!fs[_0x829b('0x18')](path[_0x829b('0x19')](_0x5dcb44,_0xf23135))&&_0x5d885b){fs['mkdirSync'](path[_0x829b('0x19')](_0x5dcb44,_0xf23135));}return BPromise[_0x829b('0x1a')](_0x1c70d8,function(_0x480955){_0x334ca1[_0x829b('0x16')](_0x480955);})[_0x829b('0xa')](function(){for(var _0x3b16c8=0x0;_0x3b16c8<_0x334ca1[_0x829b('0x13')];_0x3b16c8+=0x1){var _0x41f25d;var _0x1650d1=_0x334ca1[_0x3b16c8];if(_0x5d885b){_0x41f25d=path[_0x829b('0x19')](_0x5dcb44,_0xf23135,util[_0x829b('0xe')](_0x829b('0x1b'),_0xf23135,_0x3b16c8,_0x829b('0x1c')));}else{_0x41f25d=path['join'](_0x5dcb44,util[_0x829b('0xe')](_0x829b('0x1d'),_0xf23135,'csv'));}fs[_0x829b('0x1e')](_0x41f25d,csv(_0x1650d1));}})[_0x829b('0xa')](function(){if(_0x5d885b){zipdir(path[_0x829b('0x19')](_0x5dcb44,_0xf23135),{'saveTo':path[_0x829b('0x19')](_0x5dcb44,util['format'](_0x829b('0x1d'),_0xf23135,_0x829b('0x1f')))},function(_0xb50b62,_0x3756fb){});rimraf(path[_0x829b('0x19')](_0x5dcb44,_0xf23135),function(){});}})[_0x829b('0xa')](function(){logger[_0x829b('0x7')](util[_0x829b('0xe')](_0x829b('0x20'),EXTRACTED_REPORT_ID,_0x829b('0x8')));return analyticExtractedReport('Completed',_0x5d885b?util[_0x829b('0xe')](_0x829b('0x1d'),_0xf23135,_0x5d885b?_0x829b('0x1f'):'csv'):null);});})['catch'](function(_0x2756eb){logger[_0x829b('0x7')](util['format'](_0x829b('0x21'),EXTRACTED_REPORT_ID,_0x829b('0x8')),util['inspect'](_0x2756eb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x829b('0x22'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c2fa6eb..d7b7f7c 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 _0x96fa=['error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','tableHeader','map','pick','length','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','Arial','num','Empty','dirname','basename','.pdf','join','%s.%s','pdf','split','splitSizePdf','then','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','query','existsSync','all','flatten','createPdfKitDocument','%s%d.%s','zip','info','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','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish'];(function(_0x483f00,_0x2d1abb){var _0x2fbe0a=function(_0x3c2f8f){while(--_0x3c2f8f){_0x483f00['push'](_0x483f00['shift']());}};_0x2fbe0a(++_0x2d1abb);}(_0x96fa,0xb9));var _0xa96f=function(_0x59fc18,_0x1ab634){_0x59fc18=_0x59fc18-0x0;var _0x4b9910=_0x96fa[_0x59fc18];return _0x4b9910;};'use strict';var _=require(_0xa96f('0x0'));var fs=require('fs');var util=require(_0xa96f('0x1'));var path=require(_0xa96f('0x2'));var moment=require(_0xa96f('0x3'));var htmlToPdfmake=require(_0xa96f('0x4'));var PdfPrinter=require(_0xa96f('0x5'));var zipdir=require(_0xa96f('0x6'));var rimraf=require(_0xa96f('0x7'));var JSDOM=require(_0xa96f('0x8'))[_0xa96f('0x9')];var window=new JSDOM('')[_0xa96f('0xa')];var db=require(_0xa96f('0xb'))['db'];var dbH=require(_0xa96f('0xb'))[_0xa96f('0xc')];var logger=require('../../config/logger')(_0xa96f('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xa96f('0xe')][0x2]);var QUERY=process[_0xa96f('0xe')][0x3];var PATH=process[_0xa96f('0xe')][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5db010,_0x1e2dc6){var _0x4af77b={'status':_0x5db010};var _0x8614={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1e2dc6){_0x4af77b[_0xa96f('0xf')]=_0x1e2dc6;}return db[_0xa96f('0x10')][_0xa96f('0x11')](_0x4af77b,_0x8614);}function getHeaders(_0x393648){return _['map'](_0x393648,function(_0x5b36a5){return{'text':_0x5b36a5,'style':_0xa96f('0x12')};});}function getRows(_0x4a7da5,_0x52ef8e){return _[_0xa96f('0x13')](_0x52ef8e,function(_0x4f7da8){return _(_0x4f7da8)[_0xa96f('0x14')](_0x4a7da5)[_0xa96f('0x13')](function(_0x59c0f6){return _0x59c0f6?_['toString'](_0x59c0f6):'';})['value']();});}function createTable(_0x661d76,_0x2f6a1f){var _0x47e450={'widths':_['fill'](Array(_0x661d76[_0xa96f('0x15')]),0x91),'heights':function(_0x463c76){return _0x463c76===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3f8d44=getHeaders(_0x661d76);_0x47e450[_0xa96f('0x16')][_0xa96f('0x17')](_0x3f8d44);var _0x182f63=getRows(_0x661d76,_0x2f6a1f);_0x47e450[_0xa96f('0x16')]=_0x47e450['body'][_0xa96f('0x18')](_0x182f63);return _0x47e450;}function createTables(_0x205d29){var _0x205f4e=[];var _0x5b2f80=_[_0xa96f('0x19')](Object[_0xa96f('0x1a')](_0x205d29[0x0]),0x5);_0x5b2f80[_0xa96f('0x1b')](function(_0x33862b){_0x205f4e[_0xa96f('0x17')](createTable(_0x33862b,_0x205d29));});return _0x205f4e;}function getPDFDocDefinition(_0xe451a7){var _0x252d68=util[_0xa96f('0x1c')](_0xa96f('0x1d'),NAME,EXTRACTED_REPORT[_0xa96f('0x1e')],moment(EXTRACTED_REPORT[_0xa96f('0x1f')])[_0xa96f('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0xa96f('0x20')])[_0xa96f('0x1c')](FORMAT));var _0x57ab9c=[];for(var _0x3e6b9c=0x0;_0x3e6b9c<_0xe451a7[_0xa96f('0x15')];_0x3e6b9c++){var _0x4c5d0d=[];if(_0x3e6b9c===0x0){_0x4c5d0d['push']({'text':_0x252d68,'style':_0xa96f('0x21')});}var _0x3ef83e={'table':_0xe451a7[_0x3e6b9c]};if(_0x3e6b9c>0x0){_0x3ef83e[_0xa96f('0x22')]=_0xa96f('0x23');_0x3ef83e[_0xa96f('0x24')]=[0x0,0x46,0x0,0x0];}_0x4c5d0d['push'](_0x3ef83e);_0x57ab9c['push'](_0x4c5d0d);}return{'pageSize':'A4','pageOrientation':_0xa96f('0x25'),'content':_0x57ab9c,'footer':function(_0x31656e,_0x338efd){return{'text':_0x31656e[_0xa96f('0x26')]()+_0xa96f('0x27')+_0x338efd,'style':_0xa96f('0x28')};},'defaultStyle':{'font':_0xa96f('0x29')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x54dc66){var _0x4a0af9=0x1388;var _0x535d04;if(!_0x54dc66[0x0][_0xa96f('0x2a')]){return analyticExtractedReport(_0xa96f('0x2b'));}var _0x1743be=[];var _0x1e731f=0x0;var _0x890e47=!![];var _0x5dc745=path[_0xa96f('0x2c')](PATH);var _0x1b6c9f=path[_0xa96f('0x2d')](PATH,_0xa96f('0x2e'));var _0x4be4bd=path[_0xa96f('0x2f')](_0x5dc745,util[_0xa96f('0x1c')](_0xa96f('0x30'),_0x1b6c9f,_0xa96f('0x31')));var _0x338357=![];return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa96f('0x32'),_0xa96f('0x33')]})[_0xa96f('0x34')](function(_0x26c540){if(_0x26c540){_0x535d04=_0x26c540;_0x4a0af9=_0x535d04['splitSizePdf']||0x3e8;}})[_0xa96f('0x34')](function(){if(_0x54dc66&&_0x54dc66[_0xa96f('0x15')]){var _0x10613e=_0x54dc66[0x0][_0xa96f('0x2a')]%(_0x1e731f+_0x4a0af9);if(_0x535d04[_0xa96f('0x32')]){for(;_0x890e47;_0x1e731f+=_0x4a0af9,_0x10613e=_0x54dc66[0x0][_0xa96f('0x2a')]%(_0x1e731f+_0x4a0af9)){if(_0x10613e==0x0||_0x10613e==_0x54dc66[0x0][_0xa96f('0x2a')]){_0x890e47=![];}_0x1743be['push'](dbH['sequelize']['query'](util[_0xa96f('0x1c')](_0xa96f('0x35'),QUERY,_0x4a0af9,_0x1e731f),{'type':dbH[_0xa96f('0x36')][_0xa96f('0x37')][_0xa96f('0x38')]}));}}else{_0x1743be[_0xa96f('0x17')](dbH[_0xa96f('0x36')][_0xa96f('0x39')](QUERY,{'type':dbH[_0xa96f('0x36')][_0xa96f('0x37')][_0xa96f('0x38')]}));}}_0x338357=_0x535d04['split']&&_0x1743be[_0xa96f('0x15')]>0x1;if(!fs[_0xa96f('0x3a')](path[_0xa96f('0x2f')](_0x5dc745,_0x1b6c9f))&&_0x338357){fs['mkdirSync'](path[_0xa96f('0x2f')](_0x5dc745,_0x1b6c9f));}return Promise[_0xa96f('0x3b')](_0x1743be);})[_0xa96f('0x34')](function(_0x47c5d4){return createTables(_[_0xa96f('0x3c')](_0x47c5d4));})[_0xa96f('0x34')](function(_0x5c4686){var _0x55937a=getPDFDocDefinition(_0x5c4686);var _0x1a9cf4=getPDFPrinter();var _0x63bbea=_0x1a9cf4[_0xa96f('0x3d')](_0x55937a);if(_0x338357)_0x4be4bd=path[_0xa96f('0x2f')](_0x5dc745,_0x1b6c9f,util[_0xa96f('0x1c')](_0xa96f('0x3e'),_0x1b6c9f,index,_0xa96f('0x31')));return writePDFDocument(_0x63bbea,_0x4be4bd);})[_0xa96f('0x34')](function(){if(!_0x338357)return;zipdir(path[_0xa96f('0x2f')](_0x5dc745,_0x1b6c9f),{'saveTo':path[_0xa96f('0x2f')](_0x5dc745,util[_0xa96f('0x1c')](_0xa96f('0x30'),_0x1b6c9f,_0xa96f('0x3f')))},function(_0x1c2374){if(_0x1c2374)throw _0x1c2374;return;});})['then'](function(){if(!_0x338357)return;rimraf(path[_0xa96f('0x2f')](_0x5dc745,_0x1b6c9f),function(){});})[_0xa96f('0x34')](function(){logger[_0xa96f('0x40')](util[_0xa96f('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xa96f('0x41'),_0x338357?util[_0xa96f('0x1c')](_0xa96f('0x30'),_0x1b6c9f,_0x338357?_0xa96f('0x3f'):'pdf'):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xa96f('0x1c')](_0xa96f('0x42'),EXTRACTED_REPORT_ID,_0xa96f('0x43')));return db['AnalyticExtractedReport'][_0xa96f('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x4b998b){EXTRACTED_REPORT=_0x4b998b;return dbH[_0xa96f('0x36')]['query'](util[_0xa96f('0x1c')](_0xa96f('0x45'),QUERY),{'type':dbH[_0xa96f('0x36')]['QueryTypes'][_0xa96f('0x38')]});})[_0xa96f('0x34')](extractReport)[_0xa96f('0x46')](function(_0x207865){logger[_0xa96f('0x40')](util['format'](_0xa96f('0x47'),EXTRACTED_REPORT_ID,_0xa96f('0x43')),util[_0xa96f('0x48')](_0x207865,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa96f('0x49'));})['finally'](function(){process[_0xa96f('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x9023af=new PdfPrinter({'Arial':{'normal':__dirname+_0xa96f('0x4b'),'bold':__dirname+_0xa96f('0x4c'),'italics':__dirname+_0xa96f('0x4d'),'bolditalics':__dirname+_0xa96f('0x4e')}});return _0x9023af;}function getPDFDocDefinitionFromHTML(_0x175126,_0x554b7b){var _0x4ff3ed=util[_0xa96f('0x1c')]('%s\x20#%d',_0x554b7b[_0xa96f('0x4f')],_0x554b7b[_0xa96f('0x50')]);var _0x1f6c77=moment()[_0xa96f('0x1c')](_0xa96f('0x51'))[_0xa96f('0x26')]();var _0x91bdf2=htmlToPdfmake(_0x175126,{'window':window,'tableAutoSize':!![]});return{'content':[_0x91bdf2],'defaultStyle':{'font':_0xa96f('0x29')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xa96f('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xa96f('0x52')}},'header':function(){return[{'text':_0xa96f('0x53'),'style':_0xa96f('0x21')}];},'footer':function(_0x491016,_0x560e0a){return[{'text':util[_0xa96f('0x1c')](_0xa96f('0x54'),_0x4ff3ed,_0x491016,_0x560e0a,_0x1f6c77),'style':_0xa96f('0x28')}];}};}function writePDFDocument(_0x247af3,_0x1f9cdb){return new Promise(function(_0x455c48,_0x577234){var _0x3d10e=_0x247af3[_0xa96f('0x55')](fs[_0xa96f('0x56')](_0x1f9cdb));_0x3d10e['on'](_0xa96f('0x57'),function(){_0x455c48('finish');});_0x3d10e['on'](_0xa96f('0x58'),function(_0x1d45d3){_0x577234(_0x1d45d3);});_0x247af3[_0xa96f('0x59')]();});}exports[_0xa96f('0x5a')]=function(_0x120eed,_0x47d6a4){var _0x5939fc=getPDFPrinter();var _0x53589e=getPDFDocDefinitionFromHTML(_0x120eed,_0x47d6a4);var _0x49411a=_0x5939fc['createPdfKitDocument'](_0x53589e);return writePDFDocument(_0x49411a,_0x47d6a4[_0xa96f('0x2')])[_0xa96f('0x46')](function(_0x33546d){throw _0x33546d;});}; \ No newline at end of file +var _0xa877=['sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','existsSync','mkdirSync','flatten','createPdfKitDocument','pdf','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','inspect','Failed','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','catch','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','JSDOM','window','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','map','tableHeader','pick','toString','value','fill','length','auto','body','push','concat','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','endDate','before','margin','landscape','\x20/\x20','footer','num','Empty','.pdf','join','Setting','find','then','splitSizePdf','split'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa877,0x12d));var _0x7a87=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa877[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x7a87('0x0'));var fs=require('fs');var util=require(_0x7a87('0x1'));var path=require(_0x7a87('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x7a87('0x3'));var PdfPrinter=require(_0x7a87('0x4'));var zipdir=require(_0x7a87('0x5'));var rimraf=require(_0x7a87('0x6'));var JSDOM=require('jsdom')[_0x7a87('0x7')];var window=new JSDOM('')[_0x7a87('0x8')];var db=require('../../mysqldb')['db'];var dbH=require(_0x7a87('0x9'))['dbH'];var logger=require(_0x7a87('0xa'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x7a87('0xb')][0x2]);var QUERY=process[_0x7a87('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x7a87('0xb')][0x5];var FORMAT=_0x7a87('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x16affa,_0x1219c8){var _0x5e48e0={'status':_0x16affa};var _0x56db0d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1219c8){_0x5e48e0['savename']=_0x1219c8;}return db[_0x7a87('0xd')]['update'](_0x5e48e0,_0x56db0d);}function getHeaders(_0x269477){return _[_0x7a87('0xe')](_0x269477,function(_0x935b0f){return{'text':_0x935b0f,'style':_0x7a87('0xf')};});}function getRows(_0x29501d,_0x345fae){return _[_0x7a87('0xe')](_0x345fae,function(_0x354d01){return _(_0x354d01)[_0x7a87('0x10')](_0x29501d)['map'](function(_0x188884){return _0x188884?_[_0x7a87('0x11')](_0x188884):'';})[_0x7a87('0x12')]();});}function createTable(_0x17c793,_0x4b6a0b){var _0x357bc0={'widths':_[_0x7a87('0x13')](Array(_0x17c793[_0x7a87('0x14')]),0x91),'heights':function(_0xd2d472){return _0xd2d472===0x0?_0x7a87('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1e38f4=getHeaders(_0x17c793);_0x357bc0[_0x7a87('0x16')][_0x7a87('0x17')](_0x1e38f4);var _0x21135c=getRows(_0x17c793,_0x4b6a0b);_0x357bc0[_0x7a87('0x16')]=_0x357bc0[_0x7a87('0x16')][_0x7a87('0x18')](_0x21135c);return _0x357bc0;}function createTables(_0x4cf6e7){var _0x5ab049=[];var _0x2571b1=_[_0x7a87('0x19')](Object[_0x7a87('0x1a')](_0x4cf6e7[0x0]),0x5);_0x2571b1[_0x7a87('0x1b')](function(_0x32d696){_0x5ab049['push'](createTable(_0x32d696,_0x4cf6e7));});return _0x5ab049;}function getPDFDocDefinition(_0x4bb9d0){var _0x5a3565=util['format'](_0x7a87('0x1c'),NAME,EXTRACTED_REPORT[_0x7a87('0x1d')],moment(EXTRACTED_REPORT[_0x7a87('0x1e')])[_0x7a87('0x1f')](FORMAT),moment(EXTRACTED_REPORT[_0x7a87('0x20')])[_0x7a87('0x1f')](FORMAT));var _0x49a7b9=[];for(var _0x5d1431=0x0;_0x5d1431<_0x4bb9d0[_0x7a87('0x14')];_0x5d1431++){var _0x33dc31=[];if(_0x5d1431===0x0){_0x33dc31['push']({'text':_0x5a3565,'style':'header'});}var _0x258646={'table':_0x4bb9d0[_0x5d1431]};if(_0x5d1431>0x0){_0x258646['pageBreak']=_0x7a87('0x21');_0x258646[_0x7a87('0x22')]=[0x0,0x46,0x0,0x0];}_0x33dc31[_0x7a87('0x17')](_0x258646);_0x49a7b9[_0x7a87('0x17')](_0x33dc31);}return{'pageSize':'A4','pageOrientation':_0x7a87('0x23'),'content':_0x49a7b9,'footer':function(_0xf470d1,_0x1ec1ca){return{'text':_0xf470d1[_0x7a87('0x11')]()+_0x7a87('0x24')+_0x1ec1ca,'style':_0x7a87('0x25')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x167400){var _0x1ec593=0x1388;var _0x42e932;if(!_0x167400[0x0][_0x7a87('0x26')]){return analyticExtractedReport(_0x7a87('0x27'));}var _0x264b10=[];var _0x343581=0x0;var _0x286479=!![];var _0x4a53d5=path['dirname'](PATH);var _0x43ecaf=path['basename'](PATH,_0x7a87('0x28'));var _0xac8e88=path[_0x7a87('0x29')](_0x4a53d5,util[_0x7a87('0x1f')]('%s.%s',_0x43ecaf,'pdf'));var _0x2637ff=![];return db[_0x7a87('0x2a')][_0x7a87('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0x7a87('0x2c')](function(_0x3395ac){if(_0x3395ac){_0x42e932=_0x3395ac;_0x1ec593=_0x42e932[_0x7a87('0x2d')]||0x3e8;}})[_0x7a87('0x2c')](function(){if(_0x167400&&_0x167400[_0x7a87('0x14')]){var _0x1b6d2c=_0x167400[0x0][_0x7a87('0x26')]%(_0x343581+_0x1ec593);if(_0x42e932[_0x7a87('0x2e')]){for(;_0x286479;_0x343581+=_0x1ec593,_0x1b6d2c=_0x167400[0x0][_0x7a87('0x26')]%(_0x343581+_0x1ec593)){if(_0x1b6d2c==0x0||_0x1b6d2c==_0x167400[0x0][_0x7a87('0x26')]){_0x286479=![];}_0x264b10[_0x7a87('0x17')](dbH[_0x7a87('0x2f')][_0x7a87('0x30')](util[_0x7a87('0x1f')](_0x7a87('0x31'),QUERY,_0x1ec593,_0x343581),{'type':dbH[_0x7a87('0x2f')]['QueryTypes'][_0x7a87('0x32')]}));}}else{_0x264b10[_0x7a87('0x17')](dbH[_0x7a87('0x2f')][_0x7a87('0x30')](QUERY,{'type':dbH['sequelize'][_0x7a87('0x33')][_0x7a87('0x32')]}));}}_0x2637ff=_0x42e932[_0x7a87('0x2e')]&&_0x264b10[_0x7a87('0x14')]>0x1;if(!fs[_0x7a87('0x34')](path[_0x7a87('0x29')](_0x4a53d5,_0x43ecaf))&&_0x2637ff){fs[_0x7a87('0x35')](path[_0x7a87('0x29')](_0x4a53d5,_0x43ecaf));}return Promise['all'](_0x264b10);})[_0x7a87('0x2c')](function(_0x2db6d5){return createTables(_[_0x7a87('0x36')](_0x2db6d5));})['then'](function(_0x5f4386){var _0x7835a6=getPDFDocDefinition(_0x5f4386);var _0x2232c3=getPDFPrinter();var _0x2209c0=_0x2232c3[_0x7a87('0x37')](_0x7835a6);if(_0x2637ff)_0xac8e88=path['join'](_0x4a53d5,_0x43ecaf,util[_0x7a87('0x1f')]('%s%d.%s',_0x43ecaf,index,_0x7a87('0x38')));return writePDFDocument(_0x2209c0,_0xac8e88);})['then'](function(){if(!_0x2637ff)return;zipdir(path[_0x7a87('0x29')](_0x4a53d5,_0x43ecaf),{'saveTo':path[_0x7a87('0x29')](_0x4a53d5,util[_0x7a87('0x1f')](_0x7a87('0x39'),_0x43ecaf,_0x7a87('0x3a')))},function(_0xcfbc7e){if(_0xcfbc7e)throw _0xcfbc7e;return;});})[_0x7a87('0x2c')](function(){if(!_0x2637ff)return;rimraf(path['join'](_0x4a53d5,_0x43ecaf),function(){});})[_0x7a87('0x2c')](function(){logger[_0x7a87('0x3b')](util[_0x7a87('0x1f')](_0x7a87('0x3c'),EXTRACTED_REPORT_ID,_0x7a87('0x3d')));return analyticExtractedReport('Completed',_0x2637ff?util[_0x7a87('0x1f')]('%s.%s',_0x43ecaf,_0x2637ff?_0x7a87('0x3a'):_0x7a87('0x38')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x7a87('0x3b')](util[_0x7a87('0x1f')](_0x7a87('0x3e'),EXTRACTED_REPORT_ID,_0x7a87('0x3f')));return db[_0x7a87('0xd')][_0x7a87('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x11eaae){EXTRACTED_REPORT=_0x11eaae;return dbH['sequelize'][_0x7a87('0x30')](util[_0x7a87('0x1f')](_0x7a87('0x41'),QUERY),{'type':dbH['sequelize'][_0x7a87('0x33')]['SELECT']});})[_0x7a87('0x2c')](extractReport)['catch'](function(_0x370592){logger[_0x7a87('0x3b')](util[_0x7a87('0x1f')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7a87('0x3f')),util[_0x7a87('0x42')](_0x370592,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7a87('0x43'));})['finally'](function(){process[_0x7a87('0x44')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3bdafc=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x7a87('0x45'),'italics':__dirname+_0x7a87('0x46'),'bolditalics':__dirname+_0x7a87('0x47')}});return _0x3bdafc;}function getPDFDocDefinitionFromHTML(_0x58cb9b,_0x31cd3a){var _0x5e80fd=util[_0x7a87('0x1f')](_0x7a87('0x48'),_0x31cd3a[_0x7a87('0x49')],_0x31cd3a[_0x7a87('0x4a')]);var _0x412349=moment()[_0x7a87('0x1f')](_0x7a87('0x4b'))[_0x7a87('0x11')]();var _0x2b58d7=htmlToPdfmake(_0x58cb9b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2b58d7],'defaultStyle':{'font':_0x7a87('0x4c')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x7a87('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x7a87('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x7a87('0x4d')}},'header':function(){return[{'text':_0x7a87('0x4e'),'style':_0x7a87('0x4f')}];},'footer':function(_0x17467b,_0x9ba84b){return[{'text':util[_0x7a87('0x1f')](_0x7a87('0x50'),_0x5e80fd,_0x17467b,_0x9ba84b,_0x412349),'style':_0x7a87('0x25')}];}};}function writePDFDocument(_0x20d9fe,_0x51837b){return new Promise(function(_0x4df964,_0xe64b2f){var _0x282cd5=_0x20d9fe[_0x7a87('0x51')](fs[_0x7a87('0x52')](_0x51837b));_0x282cd5['on'](_0x7a87('0x53'),function(){_0x4df964('finish');});_0x282cd5['on'](_0x7a87('0x54'),function(_0x2b55f2){_0xe64b2f(_0x2b55f2);});_0x20d9fe[_0x7a87('0x55')]();});}exports['createPdfFromHTML']=function(_0x5968d4,_0x2dba8e){var _0x5c7d66=getPDFPrinter();var _0xb22774=getPDFDocDefinitionFromHTML(_0x5968d4,_0x2dba8e);var _0x26929e=_0x5c7d66[_0x7a87('0x37')](_0xb22774);return writePDFDocument(_0x26929e,_0x2dba8e[_0x7a87('0x2')])[_0x7a87('0x56')](function(_0x61691e){throw _0x61691e;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 064623b..23fd9e8 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 _0xa9e0=['QueryTypes','SELECT','num','split','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join','mkdirSync','each','length','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','lodash','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x419b6a,_0x265b43){var _0x229232=function(_0x514a3e){while(--_0x514a3e){_0x419b6a['push'](_0x419b6a['shift']());}};_0x229232(++_0x265b43);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var util=require(_0x0a9e('0x0'));var path=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0x0a9e('0x3'));var rimraf=require('rimraf');var db=require(_0x0a9e('0x4'))['db'];var dbH=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x0a9e('0x8')][0x3];var PATH=process[_0x0a9e('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2cc193,_0x5f41ea){var _0x503809={'status':_0x2cc193};var _0xe42b77={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5f41ea){_0x503809['savename']=_0x5f41ea;}return db['AnalyticExtractedReport'][_0x0a9e('0x9')](_0x503809,_0xe42b77);}function main(){var _0xf81284=0x1388;var _0x307b3e;logger[_0x0a9e('0xa')](util[_0x0a9e('0xb')](_0x0a9e('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x0a9e('0xd')]})[_0x0a9e('0xe')](function(_0xd5b662){if(_0xd5b662){_0x307b3e=_0xd5b662;_0xf81284=_0x307b3e[_0x0a9e('0xd')]||0x1388;}})[_0x0a9e('0xe')](function(){return dbH[_0x0a9e('0xf')]['query'](util[_0x0a9e('0xb')](_0x0a9e('0x10'),QUERY),{'type':dbH[_0x0a9e('0xf')][_0x0a9e('0x11')][_0x0a9e('0x12')]});})[_0x0a9e('0xe')](function(_0x52a03d){if(!_0x52a03d[0x0][_0x0a9e('0x13')]){return analyticExtractedReport('Empty');}var _0x1985b6=[];var _0x519dfd=0x0;var _0x16033c=!![];if(_0x307b3e[_0x0a9e('0x14')]){if(_0x52a03d&&_0x52a03d['length']){var _0x225616=_0x52a03d[0x0]['num']%(_0x519dfd+_0xf81284);for(;_0x16033c;_0x519dfd+=_0xf81284,_0x225616=_0x52a03d[0x0][_0x0a9e('0x13')]%(_0x519dfd+_0xf81284)){if(_0x225616==0x0||_0x225616==_0x52a03d[0x0][_0x0a9e('0x13')]){_0x16033c=![];}_0x1985b6[_0x0a9e('0x15')](dbH[_0x0a9e('0xf')][_0x0a9e('0x16')](util[_0x0a9e('0xb')](_0x0a9e('0x17'),QUERY,_0xf81284,_0x519dfd),{'type':dbH[_0x0a9e('0xf')][_0x0a9e('0x11')][_0x0a9e('0x12')]}));}}}else{_0x1985b6[_0x0a9e('0x15')](dbH[_0x0a9e('0xf')]['query'](QUERY,{'type':dbH[_0x0a9e('0xf')][_0x0a9e('0x11')]['SELECT']}));}var _0x20f109=path['dirname'](PATH);var _0x588269=path[_0x0a9e('0x18')](PATH,_0x0a9e('0x19'));var _0x38e7c4=_0x307b3e[_0x0a9e('0x14')]&&_0x1985b6['length']>0x1;var _0xfb6e48=[];if(!fs[_0x0a9e('0x1a')](path[_0x0a9e('0x1b')](_0x20f109,_0x588269))&&_0x38e7c4){fs[_0x0a9e('0x1c')](path[_0x0a9e('0x1b')](_0x20f109,_0x588269));}return BPromise[_0x0a9e('0x1d')](_0x1985b6,function(_0x16b1ca){_0xfb6e48['push'](_0x16b1ca);})['then'](function(){for(var _0x197ec0=0x0;_0x197ec0<_0xfb6e48[_0x0a9e('0x1e')];_0x197ec0+=0x1){var _0x40c424;var _0x33161b=_0xfb6e48[_0x197ec0];if(_0x38e7c4){_0x40c424=path['join'](_0x20f109,_0x588269,util[_0x0a9e('0xb')]('%s%d.%s',_0x588269,_0x197ec0,_0x0a9e('0x1f')));}else{_0x40c424=path['join'](_0x20f109,util[_0x0a9e('0xb')](_0x0a9e('0x20'),_0x588269,_0x0a9e('0x1f')));}fs[_0x0a9e('0x21')](_0x40c424,json2xls(_0x33161b),_0x0a9e('0x22'));}})[_0x0a9e('0xe')](function(){if(_0x38e7c4){zipdir(path[_0x0a9e('0x1b')](_0x20f109,_0x588269),{'saveTo':path[_0x0a9e('0x1b')](_0x20f109,util['format'](_0x0a9e('0x20'),_0x588269,_0x0a9e('0x23')))},function(_0x2b1f27,_0x2ec755){});rimraf(path['join'](_0x20f109,_0x588269),function(){});}})[_0x0a9e('0xe')](function(){logger[_0x0a9e('0xa')](util[_0x0a9e('0xb')](_0x0a9e('0x24'),EXTRACTED_REPORT_ID,_0x0a9e('0x25')));return analyticExtractedReport(_0x0a9e('0x26'),_0x38e7c4?util[_0x0a9e('0xb')](_0x0a9e('0x20'),_0x588269,_0x38e7c4?_0x0a9e('0x23'):'xlsx'):null);});})[_0x0a9e('0x27')](function(_0x5d1e0e){logger[_0x0a9e('0xa')](util[_0x0a9e('0xb')](_0x0a9e('0x28'),EXTRACTED_REPORT_ID,_0x0a9e('0x25')),util[_0x0a9e('0x29')](_0x5d1e0e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x0a9e('0x2a')](function(){process[_0x0a9e('0x2b')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xa9e0=['QueryTypes','SELECT','num','split','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join','mkdirSync','each','length','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','lodash','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var util=require(_0x0a9e('0x0'));var path=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0x0a9e('0x3'));var rimraf=require('rimraf');var db=require(_0x0a9e('0x4'))['db'];var dbH=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x0a9e('0x8')][0x3];var PATH=process[_0x0a9e('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2cc193,_0x5f41ea){var _0x503809={'status':_0x2cc193};var _0xe42b77={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5f41ea){_0x503809['savename']=_0x5f41ea;}return db['AnalyticExtractedReport'][_0x0a9e('0x9')](_0x503809,_0xe42b77);}function main(){var _0xf81284=0x1388;var _0x307b3e;logger[_0x0a9e('0xa')](util[_0x0a9e('0xb')](_0x0a9e('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x0a9e('0xd')]})[_0x0a9e('0xe')](function(_0xd5b662){if(_0xd5b662){_0x307b3e=_0xd5b662;_0xf81284=_0x307b3e[_0x0a9e('0xd')]||0x1388;}})[_0x0a9e('0xe')](function(){return dbH[_0x0a9e('0xf')]['query'](util[_0x0a9e('0xb')](_0x0a9e('0x10'),QUERY),{'type':dbH[_0x0a9e('0xf')][_0x0a9e('0x11')][_0x0a9e('0x12')]});})[_0x0a9e('0xe')](function(_0x52a03d){if(!_0x52a03d[0x0][_0x0a9e('0x13')]){return analyticExtractedReport('Empty');}var _0x1985b6=[];var _0x519dfd=0x0;var _0x16033c=!![];if(_0x307b3e[_0x0a9e('0x14')]){if(_0x52a03d&&_0x52a03d['length']){var _0x225616=_0x52a03d[0x0]['num']%(_0x519dfd+_0xf81284);for(;_0x16033c;_0x519dfd+=_0xf81284,_0x225616=_0x52a03d[0x0][_0x0a9e('0x13')]%(_0x519dfd+_0xf81284)){if(_0x225616==0x0||_0x225616==_0x52a03d[0x0][_0x0a9e('0x13')]){_0x16033c=![];}_0x1985b6[_0x0a9e('0x15')](dbH[_0x0a9e('0xf')][_0x0a9e('0x16')](util[_0x0a9e('0xb')](_0x0a9e('0x17'),QUERY,_0xf81284,_0x519dfd),{'type':dbH[_0x0a9e('0xf')][_0x0a9e('0x11')][_0x0a9e('0x12')]}));}}}else{_0x1985b6[_0x0a9e('0x15')](dbH[_0x0a9e('0xf')]['query'](QUERY,{'type':dbH[_0x0a9e('0xf')][_0x0a9e('0x11')]['SELECT']}));}var _0x20f109=path['dirname'](PATH);var _0x588269=path[_0x0a9e('0x18')](PATH,_0x0a9e('0x19'));var _0x38e7c4=_0x307b3e[_0x0a9e('0x14')]&&_0x1985b6['length']>0x1;var _0xfb6e48=[];if(!fs[_0x0a9e('0x1a')](path[_0x0a9e('0x1b')](_0x20f109,_0x588269))&&_0x38e7c4){fs[_0x0a9e('0x1c')](path[_0x0a9e('0x1b')](_0x20f109,_0x588269));}return BPromise[_0x0a9e('0x1d')](_0x1985b6,function(_0x16b1ca){_0xfb6e48['push'](_0x16b1ca);})['then'](function(){for(var _0x197ec0=0x0;_0x197ec0<_0xfb6e48[_0x0a9e('0x1e')];_0x197ec0+=0x1){var _0x40c424;var _0x33161b=_0xfb6e48[_0x197ec0];if(_0x38e7c4){_0x40c424=path['join'](_0x20f109,_0x588269,util[_0x0a9e('0xb')]('%s%d.%s',_0x588269,_0x197ec0,_0x0a9e('0x1f')));}else{_0x40c424=path['join'](_0x20f109,util[_0x0a9e('0xb')](_0x0a9e('0x20'),_0x588269,_0x0a9e('0x1f')));}fs[_0x0a9e('0x21')](_0x40c424,json2xls(_0x33161b),_0x0a9e('0x22'));}})[_0x0a9e('0xe')](function(){if(_0x38e7c4){zipdir(path[_0x0a9e('0x1b')](_0x20f109,_0x588269),{'saveTo':path[_0x0a9e('0x1b')](_0x20f109,util['format'](_0x0a9e('0x20'),_0x588269,_0x0a9e('0x23')))},function(_0x2b1f27,_0x2ec755){});rimraf(path['join'](_0x20f109,_0x588269),function(){});}})[_0x0a9e('0xe')](function(){logger[_0x0a9e('0xa')](util[_0x0a9e('0xb')](_0x0a9e('0x24'),EXTRACTED_REPORT_ID,_0x0a9e('0x25')));return analyticExtractedReport(_0x0a9e('0x26'),_0x38e7c4?util[_0x0a9e('0xb')](_0x0a9e('0x20'),_0x588269,_0x38e7c4?_0x0a9e('0x23'):'xlsx'):null);});})[_0x0a9e('0x27')](function(_0x5d1e0e){logger[_0x0a9e('0xa')](util[_0x0a9e('0xb')](_0x0a9e('0x28'),EXTRACTED_REPORT_ID,_0x0a9e('0x25')),util[_0x0a9e('0x29')](_0x5d1e0e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x0a9e('0x2a')](function(){process[_0x0a9e('0x2b')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 67484e4..22fbe8e 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 _0x7633=['${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','length','createdAt','updatedAt','*,*,*,*','interval','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','models','VoiceExtension','destroy','bulkCreate','catch','error','lodash','util','Interval','findAll','intervals','IntervalId','then','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','hasOwnProperty','priority','extensions','extension','find','push','type','Set','context','VoiceExtensionId','outbound','CDR(destination)='];(function(_0x3c208f,_0x371b0f){var _0x1aedcc=function(_0x185841){while(--_0x185841){_0x3c208f['push'](_0x3c208f['shift']());}};_0x1aedcc(++_0x371b0f);}(_0x7633,0x1c4));var _0x3763=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7633[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x3763('0x0'));var util=require(_0x3763('0x1'));function rewrite(_0x1a6321,_0x45e7db){var _0xd1b764=this;return _0x1a6321['models'][_0x3763('0x2')][_0x3763('0x3')]({'raw':!![]})['then'](function(_0x5f4eb8){_0xd1b764[_0x3763('0x4')]=_0x5f4eb8;return _0x1a6321['models']['VoiceExtension'][_0x3763('0x3')]({'where':{'IntervalId':_0x45e7db[_0x3763('0x5')]},'raw':!![]});})[_0x3763('0x6')](function(_0x335382){return _0x1a6321['models']['VoiceExtension'][_0x3763('0x3')]({'where':{'exten':{'$in':_[_0x3763('0x7')](_['map'](_0x335382,_0x3763('0x8')))}},'order':[{'raw':_0x3763('0x9')}],'raw':!![]});})[_0x3763('0x6')](function(_0x401909){var _0x29ec1c=_[_0x3763('0xa')](_0x401909,{'priority':'1'});var _0x7335b9=_[_0x3763('0xa')](_0x401909,{'isApp':0x1});var _0x4b3226=_[_0x3763('0xb')](_0x7335b9,_0x3763('0x8'));var _0x11d390=['queue','playback'];var _0x10602e=[];var _0x58e8c9=[];for(var _0x12f0ea in _0x4b3226){if(_0x4b3226[_0x3763('0xc')](_0x12f0ea)){_0xd1b764[_0x3763('0xd')]=0x2;_0xd1b764[_0x3763('0xe')]=[];_0xd1b764[_0x3763('0xf')]=_[_0x3763('0x10')](_0x29ec1c,{'exten':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x8')]});_0xd1b764['extensions'][_0x3763('0x11')]({'type':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x12')],'app':_0x3763('0x13'),'appdata':util['format']('CDR(type)=%s',_0x4b3226[_0x12f0ea][0x0]['type']),'context':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x14')],'exten':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x8')],'priority':_0xd1b764[_0x3763('0xd')]++,'VoiceExtensionId':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x15')]});if(_0x4b3226[_0x12f0ea][0x0][_0x3763('0x12')]===_0x3763('0x16')){if(_0xd1b764[_0x3763('0xf')]){_0xd1b764['extensions'][_0x3763('0x11')]({'type':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x12')],'app':_0x3763('0x13'),'appdata':_0x3763('0x17')+(_0xd1b764['extension']['cutdigits']?_0x3763('0x18')+_0xd1b764[_0x3763('0xf')][_0x3763('0x19')]+'}':_0x3763('0x1a')),'context':_0x4b3226[_0x12f0ea][0x0]['context'],'exten':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x8')],'priority':_0xd1b764['priority']++,'VoiceExtensionId':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x15')]});}_0xd1b764[_0x3763('0xe')]['push']({'type':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x12')],'app':_0x3763('0x13'),'appdata':_0x3763('0x1b')+_0x4b3226[_0x12f0ea][0x0][_0x3763('0x15')],'context':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x14')],'exten':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x8')],'priority':_0xd1b764[_0x3763('0xd')]++,'VoiceExtensionId':_0x4b3226[_0x12f0ea][0x0]['VoiceExtensionId']});var _0x57036c=_0xd1b764['priority']++;_0xd1b764[_0x3763('0xe')][_0x3763('0x11')]({'type':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x12')],'app':_0x3763('0x1c'),'appdata':_0x3763('0x1d')+(_0x57036c+0x2)+_0x3763('0x1e')+(_0x57036c+0x1)+')','context':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x14')],'exten':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x8')],'priority':_0x57036c,'VoiceExtensionId':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x15')]});if(_0xd1b764[_0x3763('0xf')]){_0xd1b764[_0x3763('0xe')][_0x3763('0x11')]({'type':_0x4b3226[_0x12f0ea][0x0]['type'],'app':_0x3763('0x13'),'appdata':_0xd1b764[_0x3763('0xf')][_0x3763('0x19')]?'CDR(prefix)=${EXTEN:0:'+_0xd1b764[_0x3763('0xf')][_0x3763('0x19')]+'}':_0x3763('0x1f'),'context':_0x4b3226[_0x12f0ea][0x0]['context'],'exten':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x8')],'priority':_0xd1b764[_0x3763('0xd')]++,'VoiceExtensionId':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x15')]});}_0xd1b764[_0x3763('0xe')][_0x3763('0x11')]({'type':_0x4b3226[_0x12f0ea][0x0]['type'],'app':'Set','appdata':_0x3763('0x20')+_0x4b3226[_0x12f0ea][0x0][_0x3763('0x15')],'context':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x14')],'exten':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x8')],'priority':_0xd1b764[_0x3763('0xd')]++,'VoiceExtensionId':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x15')]});if(_0xd1b764[_0x3763('0xf')]&&_0xd1b764[_0x3763('0xf')]['hasOwnProperty'](_0x3763('0x21'))&&_0xd1b764[_0x3763('0xf')][_0x3763('0x21')]!==_0x3763('0x22')){_0xd1b764['extensions']['push']({'type':_0x4b3226[_0x12f0ea][0x0]['type'],'app':'Set','appdata':_0x3763('0x23'),'context':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x14')],'exten':_0x4b3226[_0x12f0ea][0x0]['exten'],'priority':_0xd1b764[_0x3763('0xd')]++,'VoiceExtensionId':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x15')]});_0xd1b764['extensions'][_0x3763('0x11')]({'type':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x12')],'app':_0x3763('0x13'),'appdata':_0x3763('0x24')+_0xd1b764[_0x3763('0xf')][_0x3763('0x21')]||_0x3763('0x25'),'context':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x14')],'exten':_0x4b3226[_0x12f0ea][0x0]['exten'],'priority':_0xd1b764[_0x3763('0xd')]++,'VoiceExtensionId':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x15')]});}}_0xd1b764['extensions'][_0x3763('0x11')]({'type':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x12')],'app':_0x3763('0x13'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x14')],'exten':_0x4b3226[_0x12f0ea][0x0]['exten'],'priority':_0xd1b764[_0x3763('0xd')]++,'VoiceExtensionId':_0x4b3226[_0x12f0ea][0x0]['VoiceExtensionId']});_0xd1b764[_0x3763('0xe')][_0x3763('0x11')]({'type':_0x4b3226[_0x12f0ea][0x0]['type'],'app':_0x3763('0x13'),'appdata':_0x3763('0x26'),'context':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x14')],'exten':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x8')],'priority':_0xd1b764['priority']++,'VoiceExtensionId':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x15')]});_0xd1b764[_0x3763('0xe')]['push']({'type':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x12')],'app':_0x3763('0x13'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x14')],'exten':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x8')],'priority':_0xd1b764[_0x3763('0xd')]++,'VoiceExtensionId':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x15')]});for(var _0x524b12=0x0,_0x271a64=0x0;_0x524b12<_0x4b3226[_0x12f0ea][_0x3763('0x27')];_0x524b12+=0x1,_0x271a64=0x0){var _0x11626e=_0x4b3226[_0x12f0ea][_0x524b12];if(_0x11626e[_0x3763('0x12')]){_0x11626e['type']=_0x11626e['type']['toLowerCase']();}var _0x58439b=[];var _0x5926b0=[];delete _0x11626e['id'];delete _0x11626e[_0x3763('0x28')];delete _0x11626e[_0x3763('0x29')];var _0xe64204=_0x11626e['interval']!==_0x3763('0x2a')?[_0x11626e[_0x3763('0x2b')]]:_0x11626e[_0x3763('0x5')]?_[_0x3763('0x2c')](_[_0x3763('0xa')](_0xd1b764[_0x3763('0x4')],{'IntervalId':_0x11626e[_0x3763('0x5')]}),_0x3763('0x2b')):[];if(_0x11626e[_0x3763('0xc')](_0x3763('0x2d'))){if(_0x11626e[_0x3763('0x2d')]&&_0x11626e['tag']!=='--'){_0x58439b['push']({'type':_0x11626e['type'],'app':_0x3763('0x13'),'appdata':_0x3763('0x2e')+_0x11626e[_0x3763('0x2d')],'context':_0x11626e[_0x3763('0x14')],'exten':_0x11626e['exten'],'priority':_0xe64204[_0x3763('0x27')]+_0xd1b764['priority']+_0x271a64++,'VoiceExtensionId':_0x11626e[_0x3763('0x15')]});}}if(_0x11626e[_0x3763('0x12')]===_0x3763('0x16')&&_0x11626e[_0x3763('0xc')](_0x3763('0x2f'))){if(_0x11626e[_0x3763('0x2f')]){_0x58439b[_0x3763('0x11')]({'type':_0x11626e['type'],'app':_0x3763('0x1c'),'appdata':_0x3763('0x30')+_0x11626e[_0x3763('0x2f')]+')','context':_0x11626e[_0x3763('0x14')],'exten':_0x11626e['exten'],'priority':_0xe64204['length']+_0xd1b764[_0x3763('0xd')]+_0x271a64++,'VoiceExtensionId':_0x11626e['VoiceExtensionId']});}else{_0x58439b[_0x3763('0x11')]({'type':_0x11626e['type'],'app':'ExecIf','appdata':_0x3763('0x31'),'context':_0x11626e[_0x3763('0x14')],'exten':_0x11626e[_0x3763('0x8')],'priority':_0xe64204[_0x3763('0x27')]+_0xd1b764[_0x3763('0xd')]+_0x271a64++,'VoiceExtensionId':_0x11626e[_0x3763('0x15')]});}}if(_0x11626e[_0x3763('0xc')]('answer')){if(_0x11d390[_0x3763('0x32')](_0x11626e[_0x3763('0x33')][_0x3763('0x34')]())>=0x0&&_0x11626e[_0x3763('0x35')]!==_0x3763('0x36')){if(_0x11626e['answer']){_0x58439b[_0x3763('0x11')]({'type':_0x11626e[_0x3763('0x12')],'app':_0x3763('0x1c'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x11626e[_0x3763('0x14')],'exten':_0x11626e[_0x3763('0x8')],'priority':_0xe64204['length']+_0xd1b764[_0x3763('0xd')]+_0x271a64++,'VoiceExtensionId':_0x11626e['VoiceExtensionId']});_0x58439b[_0x3763('0x11')]({'type':_0x11626e[_0x3763('0x12')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x11626e['context'],'exten':_0x11626e[_0x3763('0x8')],'priority':_0xe64204[_0x3763('0x27')]+_0xd1b764[_0x3763('0xd')]+_0x271a64++,'VoiceExtensionId':_0x11626e[_0x3763('0x15')]});}else{_0x58439b[_0x3763('0x11')]({'type':_0x11626e[_0x3763('0x12')],'app':_0x3763('0x1c'),'appdata':_0x3763('0x37'),'context':_0x11626e['context'],'exten':_0x11626e[_0x3763('0x8')],'priority':_0xe64204['length']+_0xd1b764[_0x3763('0xd')]+_0x271a64++,'VoiceExtensionId':_0x11626e[_0x3763('0x15')]});_0x58439b['push']({'type':_0x11626e[_0x3763('0x12')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x11626e[_0x3763('0x14')],'exten':_0x11626e[_0x3763('0x8')],'priority':_0xe64204[_0x3763('0x27')]+_0xd1b764['priority']+_0x271a64++,'VoiceExtensionId':_0x11626e[_0x3763('0x15')]});}}}for(var _0x52d80e=0x0;_0x52d80e<_0xe64204[_0x3763('0x27')];_0x52d80e+=0x1){var _0x4fdcbf=_0xd1b764[_0x3763('0xd')]+_0xe64204[_0x3763('0x27')];var _0x276074=_0x52d80e===_0xe64204[_0x3763('0x27')]-0x1?_0xd1b764[_0x3763('0xd')]+_0x58439b[_0x3763('0x27')]+_0x5926b0[_0x3763('0x27')]+0x2:_0xd1b764[_0x3763('0xd')]+_0x52d80e+0x1;_0x58439b[_0x3763('0x38')](_0x52d80e,0x0,{'type':_0x11626e['type'],'app':_0x3763('0x39'),'appdata':_0xe64204[_0x52d80e]+'?'+_0x11626e['context']+_0x3763('0x3a')+_0x4fdcbf+':'+_0x11626e['context']+_0x3763('0x3a')+_0x276074,'exten':_0x11626e[_0x3763('0x8')],'context':_0x11626e[_0x3763('0x14')],'priority':_0xd1b764[_0x3763('0xd')]+_0x52d80e,'VoiceExtensionId':_0x4b3226[_0x12f0ea][0x0]['VoiceExtensionId']});}_0x11626e[_0x3763('0xd')]=_0x58439b[_0x3763('0x27')]?_[_0x3763('0x3b')](_0x58439b)[_0x3763('0xd')]+0x1:_0xd1b764['priority'];_0xd1b764[_0x3763('0xd')]=(_0x5926b0[_0x3763('0x27')]?_['last'](_0x5926b0)[_0x3763('0xd')]:_0x11626e['priority'])+0x1;_0xd1b764['extensions']=_[_0x3763('0x3c')](_0xd1b764[_0x3763('0xe')],_0x58439b,[_0x11626e],_0x5926b0);}_0xd1b764[_0x3763('0xe')][_0x3763('0x11')]({'type':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x12')],'app':_0x3763('0x3d'),'exten':_0x4b3226[_0x12f0ea][0x0]['exten'],'context':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x14')],'priority':_0xd1b764['priority'],'VoiceExtensionId':_0x4b3226[_0x12f0ea][0x0][_0x3763('0x15')]});_0x10602e[_0x3763('0x11')](_0x4b3226[_0x12f0ea][0x0][_0x3763('0x15')]);_0x58e8c9=_[_0x3763('0x3c')](_0x58e8c9,_0xd1b764[_0x3763('0xe')]);}}return _0x1a6321['transaction'](function(_0x1ab664){return _0x1a6321[_0x3763('0x3e')][_0x3763('0x3f')][_0x3763('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x10602e}},'transaction':_0x1ab664})[_0x3763('0x6')](function(_0x47865a){return _0x1a6321[_0x3763('0x3e')][_0x3763('0x3f')][_0x3763('0x41')](_['sortBy'](_0x58e8c9,_0x3763('0xd')),{'transaction':_0x1ab664});});});})[_0x3763('0x42')](function(_0x43d751){console[_0x3763('0x43')](_0x43d751);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xe8f2=['$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','extension','find','push','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='];(function(_0x6ebf74,_0x422052){var _0x32d24d=function(_0x237fcf){while(--_0x237fcf){_0x6ebf74['push'](_0x6ebf74['shift']());}};_0x32d24d(++_0x422052);}(_0xe8f2,0x133));var _0x2e8f=function(_0x4bc9b3,_0x298862){_0x4bc9b3=_0x4bc9b3-0x0;var _0x19da83=_0xe8f2[_0x4bc9b3];return _0x19da83;};'use strict';var _=require(_0x2e8f('0x0'));var util=require(_0x2e8f('0x1'));function rewrite(_0x6adba0,_0x1ea1d5){var _0x5c07ab=this;return _0x6adba0[_0x2e8f('0x2')][_0x2e8f('0x3')][_0x2e8f('0x4')]({'raw':!![]})['then'](function(_0x5806d1){_0x5c07ab[_0x2e8f('0x5')]=_0x5806d1;return _0x6adba0[_0x2e8f('0x2')][_0x2e8f('0x6')][_0x2e8f('0x4')]({'where':{'IntervalId':_0x1ea1d5[_0x2e8f('0x7')]},'raw':!![]});})[_0x2e8f('0x8')](function(_0x284c13){return _0x6adba0[_0x2e8f('0x2')][_0x2e8f('0x6')]['findAll']({'where':{'exten':{'$in':_[_0x2e8f('0x9')](_[_0x2e8f('0xa')](_0x284c13,_0x2e8f('0xb')))}},'order':[{'raw':_0x2e8f('0xc')}],'raw':!![]});})['then'](function(_0x4fb298){var _0x4e9d2c=_['filter'](_0x4fb298,{'priority':'1'});var _0x335c80=_[_0x2e8f('0xd')](_0x4fb298,{'isApp':0x1});var _0xdf163f=_[_0x2e8f('0xe')](_0x335c80,_0x2e8f('0xb'));var _0x192653=[_0x2e8f('0xf'),_0x2e8f('0x10')];var _0x4999ce=[];var _0x37b3d3=[];for(var _0x4a231b in _0xdf163f){if(_0xdf163f['hasOwnProperty'](_0x4a231b)){_0x5c07ab[_0x2e8f('0x11')]=0x2;_0x5c07ab[_0x2e8f('0x12')]=[];_0x5c07ab[_0x2e8f('0x13')]=_[_0x2e8f('0x14')](_0x4e9d2c,{'exten':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0xb')]});_0x5c07ab[_0x2e8f('0x12')][_0x2e8f('0x15')]({'type':_0xdf163f[_0x4a231b][0x0]['type'],'app':_0x2e8f('0x16'),'appdata':util[_0x2e8f('0x17')](_0x2e8f('0x18'),_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x19')]),'context':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1a')],'exten':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0xb')],'priority':_0x5c07ab[_0x2e8f('0x11')]++,'VoiceExtensionId':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1b')]});if(_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x19')]===_0x2e8f('0x1c')){if(_0x5c07ab[_0x2e8f('0x13')]){_0x5c07ab['extensions']['push']({'type':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x19')],'app':'Set','appdata':_0x2e8f('0x1d')+(_0x5c07ab[_0x2e8f('0x13')]['cutdigits']?'${EXTEN:'+_0x5c07ab[_0x2e8f('0x13')][_0x2e8f('0x1e')]+'}':'${EXTEN}'),'context':_0xdf163f[_0x4a231b][0x0]['context'],'exten':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0xb')],'priority':_0x5c07ab['priority']++,'VoiceExtensionId':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1b')]});}_0x5c07ab[_0x2e8f('0x12')]['push']({'type':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x19')],'app':_0x2e8f('0x16'),'appdata':_0x2e8f('0x1f')+_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1b')],'context':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1a')],'exten':_0xdf163f[_0x4a231b][0x0]['exten'],'priority':_0x5c07ab[_0x2e8f('0x11')]++,'VoiceExtensionId':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1b')]});var _0x2db35b=_0x5c07ab[_0x2e8f('0x11')]++;_0x5c07ab[_0x2e8f('0x12')][_0x2e8f('0x15')]({'type':_0xdf163f[_0x4a231b][0x0]['type'],'app':_0x2e8f('0x20'),'appdata':_0x2e8f('0x21')+(_0x2db35b+0x2)+'):Goto('+(_0x2db35b+0x1)+')','context':_0xdf163f[_0x4a231b][0x0]['context'],'exten':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0xb')],'priority':_0x2db35b,'VoiceExtensionId':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1b')]});if(_0x5c07ab[_0x2e8f('0x13')]){_0x5c07ab[_0x2e8f('0x12')][_0x2e8f('0x15')]({'type':_0xdf163f[_0x4a231b][0x0]['type'],'app':'Set','appdata':_0x5c07ab[_0x2e8f('0x13')][_0x2e8f('0x1e')]?_0x2e8f('0x22')+_0x5c07ab[_0x2e8f('0x13')][_0x2e8f('0x1e')]+'}':_0x2e8f('0x23'),'context':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1a')],'exten':_0xdf163f[_0x4a231b][0x0]['exten'],'priority':_0x5c07ab[_0x2e8f('0x11')]++,'VoiceExtensionId':_0xdf163f[_0x4a231b][0x0]['VoiceExtensionId']});}_0x5c07ab[_0x2e8f('0x12')]['push']({'type':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x19')],'app':_0x2e8f('0x16'),'appdata':_0x2e8f('0x24')+_0xdf163f[_0x4a231b][0x0]['VoiceExtensionId'],'context':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1a')],'exten':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0xb')],'priority':_0x5c07ab['priority']++,'VoiceExtensionId':_0xdf163f[_0x4a231b][0x0]['VoiceExtensionId']});if(_0x5c07ab[_0x2e8f('0x13')]&&_0x5c07ab[_0x2e8f('0x13')][_0x2e8f('0x25')](_0x2e8f('0x26'))&&_0x5c07ab[_0x2e8f('0x13')][_0x2e8f('0x26')]!=='none'){_0x5c07ab[_0x2e8f('0x12')][_0x2e8f('0x15')]({'type':_0xdf163f[_0x4a231b][0x0]['type'],'app':_0x2e8f('0x16'),'appdata':_0x2e8f('0x27'),'context':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1a')],'exten':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0xb')],'priority':_0x5c07ab['priority']++,'VoiceExtensionId':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1b')]});_0x5c07ab[_0x2e8f('0x12')][_0x2e8f('0x15')]({'type':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x19')],'app':_0x2e8f('0x16'),'appdata':_0x2e8f('0x28')+_0x5c07ab[_0x2e8f('0x13')][_0x2e8f('0x26')]||_0x2e8f('0x29'),'context':_0xdf163f[_0x4a231b][0x0]['context'],'exten':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0xb')],'priority':_0x5c07ab['priority']++,'VoiceExtensionId':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1b')]});}}_0x5c07ab[_0x2e8f('0x12')][_0x2e8f('0x15')]({'type':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x19')],'app':_0x2e8f('0x16'),'appdata':_0x2e8f('0x2a'),'context':_0xdf163f[_0x4a231b][0x0]['context'],'exten':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0xb')],'priority':_0x5c07ab['priority']++,'VoiceExtensionId':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1b')]});_0x5c07ab[_0x2e8f('0x12')][_0x2e8f('0x15')]({'type':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x19')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1a')],'exten':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0xb')],'priority':_0x5c07ab['priority']++,'VoiceExtensionId':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1b')]});_0x5c07ab[_0x2e8f('0x12')]['push']({'type':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x19')],'app':'Set','appdata':_0x2e8f('0x2b'),'context':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1a')],'exten':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0xb')],'priority':_0x5c07ab[_0x2e8f('0x11')]++,'VoiceExtensionId':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1b')]});for(var _0x677c1=0x0,_0x45cc44=0x0;_0x677c1<_0xdf163f[_0x4a231b][_0x2e8f('0x2c')];_0x677c1+=0x1,_0x45cc44=0x0){var _0xc69b64=_0xdf163f[_0x4a231b][_0x677c1];if(_0xc69b64['type']){_0xc69b64[_0x2e8f('0x19')]=_0xc69b64[_0x2e8f('0x19')]['toLowerCase']();}var _0xacf657=[];var _0x258480=[];delete _0xc69b64['id'];delete _0xc69b64[_0x2e8f('0x2d')];delete _0xc69b64[_0x2e8f('0x2e')];var _0x4c790b=_0xc69b64[_0x2e8f('0x2f')]!==_0x2e8f('0x30')?[_0xc69b64[_0x2e8f('0x2f')]]:_0xc69b64[_0x2e8f('0x7')]?_['map'](_[_0x2e8f('0xd')](_0x5c07ab[_0x2e8f('0x5')],{'IntervalId':_0xc69b64[_0x2e8f('0x7')]}),_0x2e8f('0x2f')):[];if(_0xc69b64[_0x2e8f('0x25')](_0x2e8f('0x31'))){if(_0xc69b64['tag']&&_0xc69b64[_0x2e8f('0x31')]!=='--'){_0xacf657[_0x2e8f('0x15')]({'type':_0xc69b64[_0x2e8f('0x19')],'app':_0x2e8f('0x16'),'appdata':_0x2e8f('0x32')+_0xc69b64[_0x2e8f('0x31')],'context':_0xc69b64[_0x2e8f('0x1a')],'exten':_0xc69b64[_0x2e8f('0xb')],'priority':_0x4c790b['length']+_0x5c07ab['priority']+_0x45cc44++,'VoiceExtensionId':_0xc69b64[_0x2e8f('0x1b')]});}}if(_0xc69b64[_0x2e8f('0x19')]==='outbound'&&_0xc69b64[_0x2e8f('0x25')](_0x2e8f('0x33'))){if(_0xc69b64[_0x2e8f('0x33')]){_0xacf657[_0x2e8f('0x15')]({'type':_0xc69b64[_0x2e8f('0x19')],'app':_0x2e8f('0x20'),'appdata':_0x2e8f('0x34')+_0xc69b64[_0x2e8f('0x33')]+')','context':_0xc69b64['context'],'exten':_0xc69b64[_0x2e8f('0xb')],'priority':_0x4c790b[_0x2e8f('0x2c')]+_0x5c07ab[_0x2e8f('0x11')]+_0x45cc44++,'VoiceExtensionId':_0xc69b64[_0x2e8f('0x1b')]});}else{_0xacf657['push']({'type':_0xc69b64[_0x2e8f('0x19')],'app':_0x2e8f('0x20'),'appdata':_0x2e8f('0x35'),'context':_0xc69b64[_0x2e8f('0x1a')],'exten':_0xc69b64[_0x2e8f('0xb')],'priority':_0x4c790b['length']+_0x5c07ab[_0x2e8f('0x11')]+_0x45cc44++,'VoiceExtensionId':_0xc69b64[_0x2e8f('0x1b')]});}}if(_0xc69b64[_0x2e8f('0x25')](_0x2e8f('0x36'))){if(_0x192653[_0x2e8f('0x37')](_0xc69b64['app'][_0x2e8f('0x38')]())>=0x0&&_0xc69b64[_0x2e8f('0x39')]!==_0x2e8f('0x3a')){if(_0xc69b64['answer']){_0xacf657['push']({'type':_0xc69b64[_0x2e8f('0x19')],'app':'ExecIf','appdata':_0x2e8f('0x3b'),'context':_0xc69b64['context'],'exten':_0xc69b64[_0x2e8f('0xb')],'priority':_0x4c790b[_0x2e8f('0x2c')]+_0x5c07ab[_0x2e8f('0x11')]+_0x45cc44++,'VoiceExtensionId':_0xc69b64['VoiceExtensionId']});_0xacf657[_0x2e8f('0x15')]({'type':_0xc69b64['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0xc69b64[_0x2e8f('0x1a')],'exten':_0xc69b64['exten'],'priority':_0x4c790b[_0x2e8f('0x2c')]+_0x5c07ab[_0x2e8f('0x11')]+_0x45cc44++,'VoiceExtensionId':_0xc69b64[_0x2e8f('0x1b')]});}else{_0xacf657[_0x2e8f('0x15')]({'type':_0xc69b64[_0x2e8f('0x19')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0xc69b64[_0x2e8f('0x1a')],'exten':_0xc69b64[_0x2e8f('0xb')],'priority':_0x4c790b[_0x2e8f('0x2c')]+_0x5c07ab[_0x2e8f('0x11')]+_0x45cc44++,'VoiceExtensionId':_0xc69b64[_0x2e8f('0x1b')]});_0xacf657[_0x2e8f('0x15')]({'type':_0xc69b64['type'],'app':_0x2e8f('0x16'),'appdata':_0x2e8f('0x3c'),'context':_0xc69b64[_0x2e8f('0x1a')],'exten':_0xc69b64[_0x2e8f('0xb')],'priority':_0x4c790b[_0x2e8f('0x2c')]+_0x5c07ab[_0x2e8f('0x11')]+_0x45cc44++,'VoiceExtensionId':_0xc69b64['VoiceExtensionId']});}}}for(var _0x164345=0x0;_0x164345<_0x4c790b[_0x2e8f('0x2c')];_0x164345+=0x1){var _0x5f4ced=_0x5c07ab[_0x2e8f('0x11')]+_0x4c790b['length'];var _0x35c8f7=_0x164345===_0x4c790b['length']-0x1?_0x5c07ab[_0x2e8f('0x11')]+_0xacf657[_0x2e8f('0x2c')]+_0x258480['length']+0x2:_0x5c07ab['priority']+_0x164345+0x1;_0xacf657[_0x2e8f('0x3d')](_0x164345,0x0,{'type':_0xc69b64['type'],'app':_0x2e8f('0x3e'),'appdata':_0x4c790b[_0x164345]+'?'+_0xc69b64[_0x2e8f('0x1a')]+_0x2e8f('0x3f')+_0x5f4ced+':'+_0xc69b64[_0x2e8f('0x1a')]+',${EXTEN},'+_0x35c8f7,'exten':_0xc69b64[_0x2e8f('0xb')],'context':_0xc69b64[_0x2e8f('0x1a')],'priority':_0x5c07ab['priority']+_0x164345,'VoiceExtensionId':_0xdf163f[_0x4a231b][0x0]['VoiceExtensionId']});}_0xc69b64[_0x2e8f('0x11')]=_0xacf657[_0x2e8f('0x2c')]?_[_0x2e8f('0x40')](_0xacf657)[_0x2e8f('0x11')]+0x1:_0x5c07ab[_0x2e8f('0x11')];_0x5c07ab[_0x2e8f('0x11')]=(_0x258480[_0x2e8f('0x2c')]?_['last'](_0x258480)[_0x2e8f('0x11')]:_0xc69b64[_0x2e8f('0x11')])+0x1;_0x5c07ab[_0x2e8f('0x12')]=_[_0x2e8f('0x41')](_0x5c07ab[_0x2e8f('0x12')],_0xacf657,[_0xc69b64],_0x258480);}_0x5c07ab[_0x2e8f('0x12')][_0x2e8f('0x15')]({'type':_0xdf163f[_0x4a231b][0x0]['type'],'app':_0x2e8f('0x42'),'exten':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0xb')],'context':_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1a')],'priority':_0x5c07ab['priority'],'VoiceExtensionId':_0xdf163f[_0x4a231b][0x0]['VoiceExtensionId']});_0x4999ce[_0x2e8f('0x15')](_0xdf163f[_0x4a231b][0x0][_0x2e8f('0x1b')]);_0x37b3d3=_[_0x2e8f('0x41')](_0x37b3d3,_0x5c07ab['extensions']);}}return _0x6adba0[_0x2e8f('0x43')](function(_0x1f5598){return _0x6adba0['models'][_0x2e8f('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x4999ce}},'transaction':_0x1f5598})[_0x2e8f('0x8')](function(_0x231f8b){return _0x6adba0[_0x2e8f('0x2')]['VoiceExtension']['bulkCreate'](_[_0x2e8f('0x44')](_0x37b3d3,_0x2e8f('0x11')),{'transaction':_0x1f5598});});});})[_0x2e8f('0x45')](function(_0x7c9ae1){console[_0x2e8f('0x46')](_0x7c9ae1);});}exports[_0x2e8f('0x47')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 08b38e0..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 _0xa9e0=['CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','str','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','VoiceQueueId','onlyIfOpen','query','catch','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','contact:csv_','emit','unlinkSync','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','errors','length','map','message','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!','ListId','CompanyId','find','duplicate'];(function(_0x540af8,_0x491c2f){var _0x378002=function(_0x387aaf){while(--_0x387aaf){_0x540af8['push'](_0x540af8['shift']());}};_0x378002(++_0x491c2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0a9e('0x3'));var db=require('../../../mysqldb')['db'];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 socket=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x0a9e('0xb')][0x2]||process['argv'][0x2]==='undefined'||process[_0x0a9e('0xb')][0x2]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0xd'));}var FILEPATH=process[_0x0a9e('0xb')][0x2];if(!process[_0x0a9e('0xb')][0x3]||process[_0x0a9e('0xb')][0x3]==='undefined'||process['argv'][0x3]==='null'||!process['argv'][0x4]||process[_0x0a9e('0xb')][0x4]===_0x0a9e('0xe')||process[_0x0a9e('0xb')][0x4]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0xf'));}var FIELDS=_[_0x0a9e('0x10')](process['argv'][0x3][_0x0a9e('0x11')](','),process[_0x0a9e('0xb')][0x4][_0x0a9e('0x11')](','));if(!process[_0x0a9e('0xb')][0x5]||process[_0x0a9e('0xb')][0x5]===_0x0a9e('0xe')||process['argv'][0x5]===_0x0a9e('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x0a9e('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x0a9e('0xb')][0x6]!==_0x0a9e('0xe')&&process['argv'][0x6]!==_0x0a9e('0xc')?process['argv'][0x6]:null;var DUPLICATES=process[_0x0a9e('0xb')][0x7]&&process[_0x0a9e('0xb')][0x7]!==_0x0a9e('0xe')&&process[_0x0a9e('0xb')][0x7]!==_0x0a9e('0xc')?process[_0x0a9e('0xb')][0x7]:null;if(!process[_0x0a9e('0xb')][0x8]||process[_0x0a9e('0xb')][0x8]===_0x0a9e('0xe')||process[_0x0a9e('0xb')][0x8]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x2c3407){logger[_0x0a9e('0x13')](_0x2c3407);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(_0x53682f,_0x20f109,_0x5a09ef,_0x588269){var _0x3a02e1={'message':_0x20f109};_0x3a02e1[_0x53682f]=!![];if(_0x5a09ef){_0x3a02e1[_0x0a9e('0x14')]=_0x5a09ef;}if(_0x588269){_0x3a02e1[_0x0a9e('0x15')]=_0x588269;}return _0x3a02e1;}function isEmail(_0x30bae6){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'](_0x30bae6);}function checkRow(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return new BPromise(function(_0x4d00e6,_0x370d86){if(_[_0x0a9e('0x16')](_0xfb6e48)){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3b45bc));}if(_0xfb6e48['errors']&&_0xfb6e48[_0x0a9e('0x17')][_0x0a9e('0x18')]){var _0x40c424=_[_0x0a9e('0x19')](_0xfb6e48['errors'],_0x0a9e('0x1a'))['join'](';');return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x40c424,null,_0x3b45bc));}var _0x5bfb33={};for(var _0x1dc186 in FIELDS){if(FIELDS[_0x0a9e('0x1b')](_0x1dc186)&&FIELDS[_0x1dc186]){_0x5bfb33[_0x1dc186]=_0xfb6e48[_0x0a9e('0x1c')][0x0][FIELDS[_0x1dc186]]||_0xfb6e48[_0x0a9e('0x1c')][0x0]['\ufeff'+FIELDS[_0x1dc186]];}}if(!_0x5bfb33[_0x0a9e('0x1d')]){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x1e'),null,_0x3b45bc));}if(!_0x5bfb33[_0x0a9e('0x1f')]){return _0x370d86(handleCheckRowError('error',_0x0a9e('0x20'),null,_0x3b45bc));}if(_0x5bfb33[_0x0a9e('0x21')]){var _0x2b1f27=moment(_0x5bfb33[_0x0a9e('0x21')],'YYYY-MM-DD');if(!_0x2b1f27[_0x0a9e('0x22')]()){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x23'),null,_0x3b45bc));}}if(_0x5bfb33[_0x0a9e('0x24')]){if(!isEmail(_0x5bfb33[_0x0a9e('0x24')])){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x25'),null,_0x3b45bc));}}_0x5bfb33[_0x0a9e('0x26')]=LISTID;_0x5bfb33[_0x0a9e('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2fb0e4){var _0x426950={};for(var _0x5d1e0e=0x0,_0x2407f9=DUPLICATES[_0x0a9e('0x18')];_0x5d1e0e<_0x2407f9;_0x5d1e0e+=0x1){_0x426950[DUPLICATES[_0x5d1e0e]]=_0x5bfb33[DUPLICATES[_0x5d1e0e]];}var _0x1122db=_[_0x0a9e('0x28')](_0x2fb0e4,_0x426950);if(_0x1122db){return _0x370d86(handleCheckRowError(_0x0a9e('0x29'),'Duplicate\x20Contact',_0x1122db,_0x3b45bc));}}return db[_0x0a9e('0x2a')][_0x0a9e('0x2b')](_0x5bfb33,{'raw':!![],'hooks':![],'fields':_[_0x0a9e('0x2c')](_0x5bfb33)})[_0x0a9e('0x2d')](function(_0x2b45ea){if(DUPLICATES&&DUPLICATES[_0x0a9e('0x18')]&&_0x2fb0e4){_0x2fb0e4[_0x0a9e('0x2e')](_[_0x0a9e('0x2f')](_0x5bfb33,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2b45ea['id'];return _0x4d00e6();})['catch'](function(_0x44295a){return _0x370d86(handleCheckRowError('error',_0x0a9e('0x30')+(_0x44295a[_0x0a9e('0x1a')]||JSON[_0x0a9e('0x31')](_0x44295a)),null,_0x3b45bc));});});}function checkHopper(){function _0x3f3d41(){return function(_0x567193){logger[_0x0a9e('0x13')](_0x0a9e('0x32'),_0x0a9e('0x33'),util[_0x0a9e('0x34')](_0x567193,{'showHidden':![],'depth':null}));};}var _0x4853b1=function(_0x54135e,_0x1e8694){var _0x5640eb=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))[_0x0a9e('0x38')](['phone',_0x0a9e('0x39'),_0x0a9e('0x3a'),_0x0a9e('0x26'),_0x1e8694,'createdAt',_0x0a9e('0x3b')],squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')]('phone','phone')[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'scheduledAt')[_0x0a9e('0x3d')]('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID[_0x0a9e('0x3f')](),'ListId')['field'](_0x54135e['id'][_0x0a9e('0x3f')](),_0x1e8694)[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'updatedAt')[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID[_0x0a9e('0x3f')]())[_0x0a9e('0x43')](_0x0a9e('0x46'))[_0x0a9e('0x43')](_0x0a9e('0x47'),squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x1f'))[_0x0a9e('0x41')]('cm_hopper')['where'](_0x1e8694+_0x0a9e('0x48'),_0x54135e['id'][_0x0a9e('0x3f')]())))[_0x0a9e('0x3f')]();return _0x5640eb;};var _0x315881=function(_0x1a69dd,_0xc9a702){var _0x10b040=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))[_0x0a9e('0x38')]([_0x0a9e('0x1f'),'scheduledAt',_0x0a9e('0x3a'),_0x0a9e('0x26'),_0xc9a702,_0x0a9e('0x40'),_0x0a9e('0x3b')],squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x1f'),_0x0a9e('0x1f'))['field'](_0x0a9e('0x3e'),'scheduledAt')[_0x0a9e('0x3d')]('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID['toString'](),_0x0a9e('0x26'))[_0x0a9e('0x3d')](_0x1a69dd['id'][_0x0a9e('0x3f')](),_0xc9a702)[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x40'))[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x3b'))[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID[_0x0a9e('0x3f')]())[_0x0a9e('0x43')]('id\x20IN\x20?',squel[_0x0a9e('0x49')](hopperContacts))[_0x0a9e('0x43')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x4a'))[_0x0a9e('0x41')](_0x0a9e('0x4b'))[_0x0a9e('0x43')](_0xc9a702+_0x0a9e('0x48'),_0x1a69dd['id'][_0x0a9e('0x3f')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0a9e('0x3d')](_0x0a9e('0x1f'))[_0x0a9e('0x41')]('cm_hopper')[_0x0a9e('0x43')](_0xc9a702+_0x0a9e('0x48'),_0x1a69dd['id']['toString']())))['toString']();return _0x10b040;};function _0x2ef381(_0x59c6ff,_0x443e72){var _0x4c3845=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))['fromQuery']([_0x0a9e('0x1f'),_0x0a9e('0x39'),'ContactId','ListId',_0x443e72,_0x0a9e('0x40'),_0x0a9e('0x3b')],squel['select']()[_0x0a9e('0x3d')]('phone',_0x0a9e('0x1f'))['field'](_0x0a9e('0x3e'),'scheduledAt')['field']('id','ContactId')[_0x0a9e('0x3d')](LISTID['toString'](),_0x0a9e('0x26'))[_0x0a9e('0x3d')](_0x59c6ff['id'][_0x0a9e('0x3f')](),_0x443e72)[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'updatedAt')[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID['toString']())[_0x0a9e('0x43')](_0x0a9e('0x4c'),squel['str'](hopperContacts))[_0x0a9e('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x0a9e('0x3f')]();return _0x4c3845;}function _0x5ba1f9(_0x4b3c1a,_0x5674ee){var _0x273cb5=squel['insert']()[_0x0a9e('0x36')](_0x0a9e('0x4d'))[_0x0a9e('0x38')]([_0x0a9e('0x1f'),_0x0a9e('0x3a'),_0x0a9e('0x26'),_0x5674ee,'createdAt',_0x0a9e('0x3b')],squel['select']()[_0x0a9e('0x3d')](_0x0a9e('0x1f'),_0x0a9e('0x1f'))['field']('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID[_0x0a9e('0x3f')](),_0x0a9e('0x26'))['field'](_0x4b3c1a['id'][_0x0a9e('0x3f')](),_0x5674ee)[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x3b'))[_0x0a9e('0x41')]('cm_contacts')[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')]('ListId\x20=\x20?',LISTID[_0x0a9e('0x3f')]())['where']('id\x20IN\x20?',squel[_0x0a9e('0x49')](hopperContacts))[_0x0a9e('0x43')](_0x0a9e('0x46')))[_0x0a9e('0x3f')]();return _0x273cb5;}return db[_0x0a9e('0x4e')][_0x0a9e('0x4f')]({'where':{'type':_0x0a9e('0x50')},'attributes':['id',_0x0a9e('0x51')],'include':[{'model':db[_0x0a9e('0x52')],'as':_0x0a9e('0x53'),'where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x19012b){var _0x2bbb86=[];if(_0x19012b){var _0x2b8192;for(var _0x320898=0x0,_0x412a72;_0x320898<_0x19012b[_0x0a9e('0x18')];_0x320898+=0x1){_0x412a72=_0x19012b[_0x320898][_0x0a9e('0x54')]({'plain':!![]});switch(_0x412a72['dialCheckDuplicateType']){case _0x0a9e('0x55'):_0x2bbb86[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x315881(_0x412a72,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));break;case _0x0a9e('0x58'):_0x2bbb86[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x4853b1(_0x412a72,_0x0a9e('0x57')))['then'](function(){})['catch'](_0x3f3d41()));break;default:_0x2bbb86['push'](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x2ef381(_0x412a72,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}}return _0x2bbb86;})[_0x0a9e('0x5b')]()[_0x0a9e('0x2d')](function(){return db[_0x0a9e('0x4e')]['findAll']({'where':{'type':_0x0a9e('0x50')},'attributes':['id'],'include':[{'model':db[_0x0a9e('0x52')],'as':_0x0a9e('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x2bdc44){var _0x583b2e=[];if(_0x2bdc44){var _0x4437ff;for(var _0x44351d=0x0,_0x4c46c1;_0x44351d<_0x2bdc44[_0x0a9e('0x18')];_0x44351d+=0x1){_0x4c46c1=_0x2bdc44[_0x44351d][_0x0a9e('0x54')]({'plain':!![]});_0x583b2e[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x5ba1f9(_0x4c46c1,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}return _0x583b2e;})[_0x0a9e('0x5b')]();})['then'](function(){return db[_0x0a9e('0x5d')][_0x0a9e('0x4f')]({'attributes':['id',_0x0a9e('0x51')],'include':[{'model':db[_0x0a9e('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x3511c9){var _0x30a4c7=[];if(_0x3511c9){for(var _0xf410e5=0x0,_0x332367;_0xf410e5<_0x3511c9[_0x0a9e('0x18')];_0xf410e5+=0x1){_0x332367=_0x3511c9[_0xf410e5][_0x0a9e('0x54')]({'plain':!![]});switch(_0x332367[_0x0a9e('0x51')]){case _0x0a9e('0x55'):_0x30a4c7[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x315881(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));break;case _0x0a9e('0x58'):_0x30a4c7[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x4853b1(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));break;default:_0x30a4c7[_0x0a9e('0x2e')](db['sequelize']['query'](_0x2ef381(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));}}}return _0x30a4c7;})[_0x0a9e('0x5b')]();})['then'](function(){return db[_0x0a9e('0x5d')][_0x0a9e('0x4f')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x0a9e('0x5c'),'where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x2d2286){var _0x42b959=[];if(_0x2d2286){for(var _0x3755fe=0x0,_0x1f42a0;_0x3755fe<_0x2d2286[_0x0a9e('0x18')];_0x3755fe+=0x1){_0x1f42a0=_0x2d2286[_0x3755fe]['get']({'plain':!![]});_0x42b959[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x5ba1f9(_0x1f42a0,_0x0a9e('0x5e')))['then'](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}return _0x42b959;})[_0x0a9e('0x5b')]();})['catch'](function(_0x1d6834){logger['error'](_0x0a9e('0x5f'),_0x0a9e('0x60'),_0x1d6834[_0x0a9e('0x1a')]);});}var processPromises=function(_0x385d52){return BPromise['all'](promises)['then'](function(_0x353384){})[_0x0a9e('0x5a')](function(_0x94dcf5){logger['error'](_0x0a9e('0x61'),JSON[_0x0a9e('0x31')](_0x94dcf5));})['finally'](function(){socket['emit'](_0x0a9e('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x385d52){return _0x385d52['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x0a9e('0x2d')](function(){socket[_0x0a9e('0x63')](_0x0a9e('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0a9e('0x64')](FILEPATH);}catch(_0x3c6dd6){logger[_0x0a9e('0x13')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x0a9e('0x31')](_0x3c6dd6));}finally{process['exit'](0x0);}});};process['on'](_0x0a9e('0x65'),function(){logger[_0x0a9e('0x66')](_0x0a9e('0x67'));endCsv();});function main(){return BPromise[_0x0a9e('0x68')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0a9e('0x11')](',');return db[_0x0a9e('0x2a')][_0x0a9e('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0xb6e411){var _0x21e592=fs[_0x0a9e('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0a9e('0x6a')](_0x21e592,{'header':!![],'skipEmptyLines':!![],'step':function(_0x255e49,_0x1910bf){total+=0x1;var _0x32b9bd=total;promises[_0x0a9e('0x2e')](checkRow(_0x255e49,_0xb6e411,_0x32b9bd)['then'](function(){success+=0x1;})[_0x0a9e('0x5a')](function(_0x3325c5){if(_0x3325c5['error']){errors+=0x1;delete _0x3325c5[_0x0a9e('0x13')];}else if(_0x3325c5[_0x0a9e('0x29')]){duplicates+=0x1;delete _0x3325c5[_0x0a9e('0x29')];}rows['push'](_0x3325c5);}));if(total%0xc8===0x0){_0x1910bf[_0x0a9e('0x6b')]();return processPromises(_0x1910bf);}},'complete':function(){return processPromises()['then'](function(){logger[_0x0a9e('0x66')](_0x0a9e('0x6c'));endCsv();});},'error':function(_0x558a87,_0x1f29bd){logger[_0x0a9e('0x66')](_0x0a9e('0x6d'),JSON[_0x0a9e('0x31')](_0x558a87));endCsv();}});})[_0x0a9e('0x5a')](function(_0x501050){logger[_0x0a9e('0x13')](_0x0a9e('0x6e'),JSON[_0x0a9e('0x31')](_0x501050));});}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 9445888..376d333 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 _0xe79a=['recallme','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.phone','cm_hopper_black','ContactId','ListId','fields','cm_contacts.ListId\x20=\x20','field','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','CmHopperId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','message','errors','query','error','send','binding','clone','socket_timestamp','root','server/files/tmp','ContactItemType','name','_description','writeFileSync','parse','createReadStream','data','find','isNil','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','UserId','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','rows','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','CIS\x20len','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','all','contactId','contactTypeId','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','exit','catch','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','papaparse','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/logger','import','defaults','redis','format','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','length','push','split','filter','findOne','update','updated','CmContactHasItem','create','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','createdAt','updatedAt','priority'];(function(_0x224dda,_0x16d0f9){var _0x2987ac=function(_0x3b1033){while(--_0x3b1033){_0x224dda['push'](_0x224dda['shift']());}};_0x2987ac(++_0x16d0f9);}(_0xe79a,0x70));var _0xae79=function(_0x17fd65,_0x556d01){_0x17fd65=_0x17fd65-0x0;var _0x27d033=_0xe79a[_0x17fd65];return _0x27d033;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0xae79('0x0'));var util=require('util');var BPromise=require(_0xae79('0x1'));var moment=require(_0xae79('0x2'));var squel=require(_0xae79('0x3'));var Redis=require(_0xae79('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0xae79('0x5'));var logger=require(_0xae79('0x6'))(_0xae79('0x7'));config['redis']=_[_0xae79('0x8')](config[_0xae79('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xae79('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xae79('0xa')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4043ff){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'](_0x4043ff);}function selectNotIn(_0x29307a,_0x5dce36,_0x4f4678,_0x8c0bf9,_0x3ab34b){return squel[_0xae79('0xb')]()['field'](_0xae79('0xc'))[_0xae79('0xd')](_0x8c0bf9)[_0xae79('0xe')](_0x5dce36,null,_0x5dce36+_0xae79('0xf')+_0x8c0bf9+'.'+_0x4f4678)[_0xae79('0x10')](_0x8c0bf9+'.'+_0x4f4678+_0xae79('0x11')+_0x29307a+'.'+_0x4f4678)[_0xae79('0x10')](_0x5dce36+_0xae79('0x12')+_0x3ab34b[_0xae79('0xe')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x471fbf,_0x478937){promisesAdditionalPhones=[];return db[_0xae79('0x13')][_0xae79('0x14')]({'raw':!![],'attributes':['id',_0xae79('0x15')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xae79('0x16')](function(_0x4c8f9a){if(_0x4c8f9a!==null){var _0x4e4615=[];for(var _0x101327=0x0;_0x101327<_0x4c8f9a[_0xae79('0x17')];_0x101327++){var _0x4c8a59=_0x4c8f9a[_0x101327];_0x4e4615[_0xae79('0x18')](insertAdditionalPhones(_0x4c8a59));}}Promise['all'](_0x4e4615)[_0xae79('0x16')](function(){_0x471fbf({'val':0x1});});});});}function insertAdditionalPhones(_0x44f55e){return new Promise(function(_0x124745,_0x371944){var _0x3474a0=_0x44f55e['AdditionalPhones'];var _0x432f0d=_0x3474a0[_0xae79('0x19')](';');var _0x348044=[];orderBy=0x0;for(var _0x23fd7d=0x0;_0x23fd7d<_0x432f0d[_0xae79('0x17')];_0x23fd7d++){_0x348044[_0xae79('0x18')](splitAdditionalPhone(_0x44f55e['id'],_0x432f0d[_0x23fd7d]));}Promise['all'](_0x348044)[_0xae79('0x16')](function(){_0x124745({'val':_0x432f0d[_0xae79('0x17')]});});});}function splitAdditionalPhone(_0x27b5fe,_0x533e63){return new Promise(function(_0xb0d047,_0x158ea2){var _0x5b6a8d=_0x533e63[_0xae79('0x19')](':');var _0x2d006d=_0x5b6a8d[0x0];var _0x173ded=_0x5b6a8d[0x1];if(_0x173ded!==''){var _0x3f8409=_0x173ded['split']('|');var _0x42fbbc=[];for(var _0x33f0c5=0x0;_0x33f0c5<_0x3f8409['length'];_0x33f0c5++){if(_0x3f8409[_0x33f0c5]!==''){var _0x5d4a57=_[_0xae79('0x1a')](promisesAdditionalPhones,{'contactId':_0x27b5fe,'phone':_0x3f8409[_0x33f0c5]});if(_0x5d4a57[_0xae79('0x17')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x27b5fe,'contactTypeId':_0x2d006d,'phone':_0x3f8409[_0x33f0c5],'orderBy':orderBy});}}}_0xb0d047({'ok':0x1});}else _0xb0d047({'res':0x0});});}function createAdditionalPhone(_0x1e5101,_0x6a289b,_0x819255,_0x1621e0){var _0x5783e8='';var _0x1e8618='';var _0x504d65=_0x819255[_0xae79('0x19')]('§');_0x5783e8=_0x504d65[0x0];if(_0x504d65['length']==0x2)_0x1e8618=_0x504d65[0x1];return new Promise(function(_0x560e01,_0x43d306){return db['CmContactHasItem'][_0xae79('0x1b')]({'where':{'CmContactId':_0x1e5101,'item':_0x5783e8}})[_0xae79('0x16')](function(_0x480e7a){if(_0x480e7a){return db['CmContactHasItem'][_0xae79('0x1c')]({'ItemTypeId':_0x6a289b,'description':_0x1e8618,'OrderBy':_0x1621e0},{'where':{'CmContactId':_0x1e5101,'item':_0x5783e8}})[_0xae79('0x16')](function(_0x7281ce){_0x560e01({'res':_0xae79('0x1d')});});}else{return db[_0xae79('0x1e')][_0xae79('0x1f')]({'CmContactId':_0x1e5101,'item':_0x5783e8,'description':_0x1e8618,'ItemTypeId':_0x6a289b,'OrderBy':_0x1621e0,'ItemClass':'PHONE'})['then'](function(_0x36a0cf){_0x560e01({'res':'inserted'});});}});});}function insertCmHopper(_0x4693be,_0x34596b,_0x45e222,_0x271a78,_0x2b79ca){var _0x3eaca4=['cm_contacts.phone',_0xae79('0x20'),_0xae79('0x21'),_0xae79('0x22'),_0x34596b+'.'+_0x271a78,'cm_contacts.createdAt',_0xae79('0x23'),_0xae79('0x24'),_0xae79('0x25'),'\x22'+_0x2b79ca+'\x22'];return squel[_0xae79('0x26')]()[_0xae79('0x27')]('cm_hopper')[_0xae79('0x28')]([_0xae79('0xc'),_0xae79('0x29'),'ContactId','ListId',_0x271a78,_0xae79('0x2a'),_0xae79('0x2b'),_0xae79('0x2c'),'UserId',_0xae79('0x2d')],squel[_0xae79('0xb')]()['fields'](_0x3eaca4)[_0xae79('0xd')](_0x34596b)[_0xae79('0xe')](_0xae79('0x2e'),null,'cm_contacts.ListId\x20=\x20'+_0x34596b+_0xae79('0x2f'))[_0xae79('0xe')](_0x45e222,null,_0x45e222+_0xae79('0xf')+_0x34596b+'.'+_0x271a78)[_0xae79('0x10')](_0x34596b+_0xae79('0x30'),_0x4693be)['where'](_0xae79('0x31'),NOW)[_0xae79('0x10')](_0xae79('0x32'),selectNotIn(_0x34596b,_0x45e222,_0x271a78,_0xae79('0x33'),['\x22always\x22',_0xae79('0x34')]))[_0xae79('0x10')](_0xae79('0x32'),selectNotIn(_0x34596b,_0x45e222,_0x271a78,'cm_hopper',[_0xae79('0x35')])))[_0xae79('0x36')]();}function insertCmHopperBlack(_0x39fbce,_0x57658f,_0x19d6f1,_0xa6879){var _0x4d4de3=[_0xae79('0x37'),_0xae79('0x21'),_0xae79('0x22'),_0x57658f+'.'+_0xa6879,'cm_contacts.createdAt',_0xae79('0x23')];return squel[_0xae79('0x26')]()[_0xae79('0x27')](_0xae79('0x38'))[_0xae79('0x28')]([_0xae79('0xc'),_0xae79('0x39'),_0xae79('0x3a'),_0xa6879,'createdAt',_0xae79('0x2b')],squel['select']()[_0xae79('0x3b')](_0x4d4de3)[_0xae79('0xd')](_0x57658f)[_0xae79('0xe')](_0xae79('0x2e'),null,_0xae79('0x3c')+_0x57658f+_0xae79('0x2f'))['join'](_0x19d6f1,null,_0x19d6f1+_0xae79('0xf')+_0x57658f+'.'+_0xa6879)[_0xae79('0x10')](_0x57658f+_0xae79('0x30'),_0x39fbce)['where'](_0xae79('0x31'),NOW)['where'](_0xae79('0x32'),squel[_0xae79('0xb')]()[_0xae79('0x3d')](_0xae79('0xc'))[_0xae79('0xd')]('cm_hopper_black')[_0xae79('0x10')](_0xae79('0x3e'),_0x39fbce)[_0xae79('0x10')](_0xa6879+_0xae79('0x3f'),_0x57658f+'.'+_0xa6879)))[_0xae79('0x36')]();}function insertCmHopperAdditionalPhones(_0x205850){var _0x4edb81=[_0xae79('0x40'),'cm_contact_has_items.item',_0xae79('0x41'),_0xae79('0x42'),'cm_contact_has_items.updatedAt'];return squel[_0xae79('0x26')]()[_0xae79('0x27')]('cm_hopper_additional_phones')['fromQuery']([_0xae79('0x43'),_0xae79('0xc'),'OrderBy','createdAt',_0xae79('0x2b')],squel[_0xae79('0xb')]()[_0xae79('0x3b')](_0x4edb81)[_0xae79('0xd')]('cm_hopper')['join']('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xae79('0xe')](_0xae79('0x44'),null,_0xae79('0x45'))[_0xae79('0x10')](_0xae79('0x46'),_0x205850)[_0xae79('0x10')](_0xae79('0x31'),NOW))[_0xae79('0x36')]();}function insertCmContact(_0x4fb503,_0x232654,_0x18f618,_0x552b48){var _0x17c561=_[_0xae79('0x47')](_[_0xae79('0x48')](_0x552b48),['ListId',_0xae79('0x49'),_0xae79('0x2a'),_0xae79('0x2b')]);return squel[_0xae79('0x26')]()['into']('cm_contacts')[_0xae79('0x28')](_0x17c561,squel[_0xae79('0xb')]()['fields'](_0x17c561)[_0xae79('0xd')](_0x232654)['where']('('+_0x18f618[_0xae79('0xe')](',')+_0xae79('0x4a'),squel[_0xae79('0xb')]()[_0xae79('0x3b')](_0x18f618)['from'](_0xae79('0x2e'))[_0xae79('0x10')]('ListId\x20=\x20?',_0x4fb503)[_0xae79('0x10')](_0xae79('0x4b')))[_0xae79('0x10')](_0xae79('0x4c'),squel['select']()[_0xae79('0x3d')](_0xae79('0x4d'),_0xae79('0x4e'))['from'](_0x232654)[_0xae79('0x4f')](_0x18f618['join'](','))))[_0xae79('0x36')]();}function handleStop(){logger[_0xae79('0x50')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x5913c3){logger['error'](_0x5913c3[_0xae79('0x51')]);process['exit'](0x1);}function handleError(_0x22a1cf,_0xfa8720){stats[_0xae79('0x52')][_0xae79('0x18')]({'name':_0xfa8720['code'],'message':_0xfa8720[_0xae79('0x51')],'row':_0x22a1cf});}function handleQuery(_0x49b890){logger[_0xae79('0x50')](_0x49b890);return db['sequelize'][_0xae79('0x53')](_0x49b890)['spread'](function(_0x55ca9b){results[_0xae79('0x18')](_0x55ca9b);})['catch'](function(_0x36ff25){logger[_0xae79('0x54')](_0x36ff25['message']);});}function main(_0x5923a0,_0x3f86bf,_0x4cfb05,_0x29ce2e){logger[_0xae79('0x50')]('main',_0x5923a0,JSON['stringify'](_0x3f86bf));process[_0xae79('0x55')]('start');var _0x2d372c=_0x3f86bf[_0xae79('0x56')];var _0x3b49ed=_[_0xae79('0x57')](_0x2d372c);var _0x38403a=_0x3f86bf[_0xae79('0x58')];var _0x113144=path[_0xae79('0xe')](config[_0xae79('0x59')],_0xae79('0x5a'),_0x38403a+'.csv');logger['info']('body',_0x3f86bf);db[_0xae79('0x5b')][_0xae79('0x14')]({'raw':!![],'attributes':['id','name']})['then'](function(_0x10ad25){for(var _0x2e004c=0x0;_0x2e004c<_0x10ad25['length'];_0x2e004c++){if(_0x10ad25[_0x2e004c][_0xae79('0x5c')]in _0x2d372c){contactItemTypes[_0xae79('0x18')](_0x10ad25[_0x2e004c]);delete _0x3b49ed[_0x10ad25[_0x2e004c]['name']];hasAdditionalPhones=!![];}for(var _0x48ba34 in _0x2d372c){if(_0x10ad25[_0x2e004c]['name']+_0xae79('0x5d')===_0x48ba34){phoneDescriptions[_0xae79('0x18')]({'itemTypeId':_0x10ad25[_0x2e004c]['id'],'description':_0x48ba34});delete _0x3b49ed[_0x48ba34];}}}if(hasAdditionalPhones)_0x3b49ed[_0xae79('0x15')]='';var _0xdf0f68=_[_0xae79('0x48')](_0x3b49ed)[_0xae79('0xe')]();logger[_0xae79('0x50')]('header',_0xdf0f68);fs[_0xae79('0x5e')](_0x113144,_0xdf0f68+'\x0a');Papa[_0xae79('0x5f')](fs[_0xae79('0x60')](_0x5923a0),{'header':!![],'skipEmptyLines':!![],'step':function(_0x132f09,_0x47b289){try{for(var _0x10d34d=0x0,_0x53454a=[];_0x10d34d<_0x132f09[_0xae79('0x61')]['length'];_0x10d34d++){stats['rows']+=0x1;if(_0x132f09[_0xae79('0x52')][_0x10d34d]){handleError(_0x132f09[_0xae79('0x61')][_0x10d34d],_0x132f09[_0xae79('0x52')][_0x10d34d]);}else{var _0x486f37=[];var _0x39204d=[];var _0x43d3be={};for(var _0x3a4daa in _0x2d372c){let _0x4e271b=contactItemTypes[_0xae79('0x62')](_0x4259ac=>_0x4259ac[_0xae79('0x5c')]===_0x3a4daa);let _0xcfe968=contactItemTypes[_0xae79('0x62')](_0x1c28e6=>_0x1c28e6['name']+'_description'===_0x3a4daa);if(_[_0xae79('0x63')](_0x4e271b)&&_['isNil'](_0xcfe968)){if(_0x2d372c[_0xae79('0x64')](_0x3a4daa)){if(_0x132f09[_0xae79('0x61')][_0x10d34d][_0x2d372c[_0x3a4daa]]){var _0x2dc106=_[_0xae79('0x65')](_0x132f09['data'][_0x10d34d][_0x2d372c[_0x3a4daa]][_0xae79('0x66')](/"/g,'\x27'));switch(_0x3a4daa){case _0xae79('0x29'):var _0x544f8b=moment(_0x2dc106,_0xae79('0x67'),!![]);if(_0x544f8b[_0xae79('0x68')]()){_0x53454a['push']('\x22'+_0x2dc106+'\x22');}else{_0x486f37[_0xae79('0x18')](_0xae79('0x69'));}break;case _0xae79('0x2c'):var _0x47e754=parseInt(_0x2dc106);_0x2dc106=_['isNaN'](_0x47e754)||_0x47e754<0x0||_0x47e754>0x4?_0x29ce2e?0x3:0x2:_0x47e754;_0x53454a[_0xae79('0x18')]('\x22'+_0x2dc106+'\x22');break;case _0xae79('0x6a'):var _0x1f015e=parseInt(_0x2dc106);if(_[_0xae79('0x6b')](_0x1f015e)&&_['includes'](_0x4cfb05,_0x1f015e)){_0x53454a[_0xae79('0x18')]('\x22'+_0x1f015e+'\x22');}else{_0x486f37['push'](_0xae79('0x6c'));}break;case _0xae79('0x6d'):if(isEmail(_0x2dc106)){_0x53454a['push']('\x22'+_0x2dc106+'\x22');}else{_0x486f37[_0xae79('0x18')](_0xae79('0x6e'));}break;case'dateOfBirth':var _0x2b99a3=moment(_0x2dc106,_0xae79('0x6f'),!![]);if(_0x2b99a3[_0xae79('0x68')]()){_0x53454a[_0xae79('0x18')]('\x22'+_0x2dc106+'\x22');}else{_0x486f37[_0xae79('0x18')](_0xae79('0x70'));}break;default:_0x53454a[_0xae79('0x18')]('\x22'+_0x2dc106+'\x22');}}else{switch(_0x3a4daa){case _0xae79('0x71'):case _0xae79('0xc'):_0x486f37[_0xae79('0x18')](_0x3a4daa+_0xae79('0x72'));break;default:_0x53454a[_0xae79('0x18')]('\x22\x22');}}}}else{var _0x587ffd='';if(!_['isNil'](_0x4e271b)){if(!_0x43d3be[_0xae79('0x64')](_0x4e271b['id'])){for(var _0x3977ac=0x0;_0x3977ac<_0x2d372c[_0x3a4daa][_0xae79('0x17')];_0x3977ac++){var _0x2dc106=_[_0xae79('0x65')](_0x132f09[_0xae79('0x61')][_0x10d34d][_0x2d372c[_0x3a4daa][_0x3977ac]]['replace'](/"/g,'\x27'));var _0x4d1c87=phoneDescriptions[_0xae79('0x62')](_0xa4ca14=>_0xa4ca14[_0xae79('0x73')]===_0x4e271b['id']);if(!_[_0xae79('0x63')](_0x4d1c87)){var _0x272d84=_[_0xae79('0x65')](_0x132f09[_0xae79('0x61')][_0x10d34d][_0x2d372c[_0x4d1c87['description']][0x0]][_0xae79('0x66')](/"/g,'\x27'));if(!_[_0xae79('0x63')](_0x272d84))_0x2dc106=_0x2dc106+'§'+_0x272d84;}if(_0x587ffd=='')_0x587ffd=_0x2dc106;else _0x587ffd+='|'+_0x2dc106;}_0x39204d[_0xae79('0x18')](_0x4e271b['id']+':'+_0x587ffd);_0x43d3be[_0x4e271b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x53454a[_0xae79('0x18')]('\x22'+_0x39204d[_0xae79('0xe')](';')+'\x22');}if(_0x486f37[_0xae79('0x17')]){handleError(_0x132f09[_0xae79('0x61')][_0x10d34d],{'code':'SystemRow','message':_0x486f37[_0xae79('0xe')]()});}else{fs['appendFileSync'](_0x113144,_0x53454a[_0xae79('0xe')]()+'\x0a');}_0x53454a=[];}if(!(stats[_0xae79('0x74')]%0xc8)){socket[_0xae79('0x75')](_0xae79('0x76')+_0x38403a,stats);stats[_0xae79('0x52')]=[];}}if(stopped){logger[_0xae79('0x50')](_0xae79('0x77'));_0x47b289[_0xae79('0x78')]();}}catch(_0x538569){handleError(_0x132f09[_0xae79('0x61')][_0x10d34d],{'code':'SystemError','message':_0x538569[_0xae79('0x51')]});logger[_0xae79('0x54')](_0xae79('0x79'),_0x538569[_0xae79('0x51')]);}},'complete':function(){try{var _0x4f2921=[];var _0x479b5f=_0xae79('0x2e');if(_0x3f86bf[_0xae79('0x7a')]&&_0x3f86bf[_0xae79('0x7a')]['length']){_0x479b5f=_0xae79('0x7b')+_0x38403a;_0x4f2921[_0xae79('0x18')](_0xae79('0x7c')+_0x479b5f+'\x20LIKE\x20cm_contacts;');}logger[_0xae79('0x50')](_0xae79('0x7d'),contactItemTypes[_0xae79('0x17')]);var _0x707284=util['format'](_0xae79('0x7e'),_0x113144,_0x479b5f,_0xdf0f68,_0x3f86bf[_0xae79('0x3a')],_0x3f86bf[_0xae79('0x49')]||null,NOW,NOW);if(_[_0xae79('0x63')](_0x2d372c[_0xae79('0x29')])){_0x707284+=_0xae79('0x7f');}_0x4f2921[_0xae79('0x18')](_0x707284);if(_0x3f86bf[_0xae79('0x7a')]&&_0x3f86bf[_0xae79('0x7a')][_0xae79('0x17')]){_0x4f2921['push'](insertCmContact(_0x3f86bf[_0xae79('0x3a')],_0x479b5f,_0x3f86bf['duplicates'],_0x2d372c));_0x4f2921['push'](_0xae79('0x80')+_0x479b5f+';');}BPromise['each'](_0x4f2921,handleQuery)['then'](function(_0x317b7d){BPromise[_0xae79('0x81')]([handleAdditionalPhones()])[_0xae79('0x16')](function(){_0x4f2921=[];for(var _0x1c03e8=0x0;_0x1c03e8_0x5bb76b[_0xf0f9('0x67')]===_0x5cd450);let _0x24396e=contactItemTypes['find'](_0x180c37=>_0x180c37['name']+_0xf0f9('0x68')===_0x5cd450);if(_[_0xf0f9('0x6e')](_0x1ac791)&&_[_0xf0f9('0x6e')](_0x24396e)){if(_0x10e1c7['hasOwnProperty'](_0x5cd450)){if(_0x1a23f2[_0xf0f9('0x6b')][_0x5b3b40][_0x10e1c7[_0x5cd450]]){var _0x4b042b=_[_0xf0f9('0x6f')](_0x1a23f2[_0xf0f9('0x6b')][_0x5b3b40][_0x10e1c7[_0x5cd450]]['replace'](/"/g,'\x27'));switch(_0x5cd450){case _0xf0f9('0x2e'):var _0x1e5018=moment(_0x4b042b,_0xf0f9('0xd'),!![]);if(_0x1e5018[_0xf0f9('0x70')]()){_0x110bb7[_0xf0f9('0x1b')]('\x22'+_0x4b042b+'\x22');}else{_0x504cb5[_0xf0f9('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xf0f9('0x33'):var _0x1eb8d2=parseInt(_0x4b042b);_0x4b042b=_[_0xf0f9('0x71')](_0x1eb8d2)||_0x1eb8d2<0x0||_0x1eb8d2>0x4?_0x2f3cfb?0x3:0x2:_0x1eb8d2;_0x110bb7[_0xf0f9('0x1b')]('\x22'+_0x4b042b+'\x22');break;case'UserId':var _0x28c540=parseInt(_0x4b042b);if(_['isNumber'](_0x28c540)&&_[_0xf0f9('0x72')](_0x3dbb9c,_0x28c540)){_0x110bb7[_0xf0f9('0x1b')]('\x22'+_0x28c540+'\x22');}else{_0x504cb5[_0xf0f9('0x1b')](_0xf0f9('0x73'));}break;case _0xf0f9('0x74'):if(isEmail(_0x4b042b)){_0x110bb7[_0xf0f9('0x1b')]('\x22'+_0x4b042b+'\x22');}else{_0x504cb5[_0xf0f9('0x1b')](_0xf0f9('0x75'));}break;case _0xf0f9('0x76'):var _0x46a345=moment(_0x4b042b,_0xf0f9('0x77'),!![]);if(_0x46a345[_0xf0f9('0x70')]()){_0x110bb7['push']('\x22'+_0x4b042b+'\x22');}else{_0x504cb5[_0xf0f9('0x1b')](_0xf0f9('0x78'));}break;default:_0x110bb7['push']('\x22'+_0x4b042b+'\x22');}}else{switch(_0x5cd450){case _0xf0f9('0x79'):case _0xf0f9('0x10'):_0x504cb5['push'](_0x5cd450+'\x20not\x20specified');break;default:_0x110bb7[_0xf0f9('0x1b')]('\x22\x22');}}}}else{var _0xb1f145='';if(!_[_0xf0f9('0x6e')](_0x1ac791)){if(!_0x33f71c[_0xf0f9('0x7a')](_0x1ac791['id'])){for(var _0x287b01=0x0;_0x287b01<_0x10e1c7[_0x5cd450][_0xf0f9('0x1a')];_0x287b01++){var _0x4b042b=_[_0xf0f9('0x6f')](_0x1a23f2[_0xf0f9('0x6b')][_0x5b3b40][_0x10e1c7[_0x5cd450][_0x287b01]][_0xf0f9('0x7b')](/"/g,'\x27'));var _0x3862a2=phoneDescriptions[_0xf0f9('0x6d')](_0x46fe0a=>_0x46fe0a[_0xf0f9('0x7c')]===_0x1ac791['id']);if(!_[_0xf0f9('0x6e')](_0x3862a2)){var _0x5cee0d=_[_0xf0f9('0x6f')](_0x1a23f2[_0xf0f9('0x6b')][_0x5b3b40][_0x10e1c7[_0x3862a2[_0xf0f9('0x7d')]][0x0]][_0xf0f9('0x7b')](/"/g,'\x27'));if(!_['isNil'](_0x5cee0d))_0x4b042b=_0x4b042b+'§'+_0x5cee0d;}if(_0xb1f145=='')_0xb1f145=_0x4b042b;else _0xb1f145+='|'+_0x4b042b;}_0x392ffa['push'](_0x1ac791['id']+':'+_0xb1f145);_0x33f71c[_0x1ac791['id']]=0x1;}}}}if(hasAdditionalPhones){_0x110bb7[_0xf0f9('0x1b')]('\x22'+_0x392ffa[_0xf0f9('0x12')](';')+'\x22');}if(_0x504cb5['length']){handleError(_0x1a23f2[_0xf0f9('0x6b')][_0x5b3b40],{'code':_0xf0f9('0x7e'),'message':_0x504cb5[_0xf0f9('0x12')]()});}else{fs['appendFileSync'](_0x5bcef6,_0x110bb7[_0xf0f9('0x12')]()+'\x0a');}_0x110bb7=[];}if(!(stats[_0xf0f9('0x6c')]%0xc8)){socket['emit'](_0xf0f9('0x7f')+_0x51f80a,stats);stats[_0xf0f9('0x57')]=[];}}if(stopped){logger['info'](_0xf0f9('0x80'));_0x405c38[_0xf0f9('0x81')]();}}catch(_0x338e66){handleError(_0x1a23f2[_0xf0f9('0x6b')][_0x5b3b40],{'code':'SystemError','message':_0x338e66[_0xf0f9('0x55')]});logger[_0xf0f9('0x54')](_0xf0f9('0x82'),_0x338e66['message']);}},'complete':function(){try{var _0x4f3ff7=[];var _0x404809='cm_contacts';if(_0x838550[_0xf0f9('0x83')]&&_0x838550[_0xf0f9('0x83')][_0xf0f9('0x1a')]){_0x404809=_0xf0f9('0x84')+_0x51f80a;_0x4f3ff7[_0xf0f9('0x1b')](_0xf0f9('0x85')+_0x404809+_0xf0f9('0x86'));}logger[_0xf0f9('0x52')](_0xf0f9('0x87'),contactItemTypes['length']);var _0x2f91d8=util[_0xf0f9('0x88')](_0xf0f9('0x89'),_0x5bcef6,_0x404809,_0x4e43e3,_0x838550[_0xf0f9('0x30')],_0x838550[_0xf0f9('0x4f')]||null,NOW,NOW);if(_[_0xf0f9('0x6e')](_0x10e1c7['scheduledat'])){_0x2f91d8+=_0xf0f9('0x8a');}_0x4f3ff7['push'](_0x2f91d8);if(_0x838550[_0xf0f9('0x83')]&&_0x838550[_0xf0f9('0x83')][_0xf0f9('0x1a')]){_0x4f3ff7[_0xf0f9('0x1b')](insertCmContact(_0x838550[_0xf0f9('0x30')],_0x404809,_0x838550[_0xf0f9('0x83')],_0x10e1c7));_0x4f3ff7[_0xf0f9('0x1b')]('DROP\x20TABLE\x20'+_0x404809+';');}BPromise[_0xf0f9('0x8b')](_0x4f3ff7,handleQuery)['then'](function(_0x5de55d){BPromise[_0xf0f9('0x1c')]([handleAdditionalPhones()])['then'](function(){_0x4f3ff7=[];for(var _0xeb5dd8=0x0;_0xeb5dd8\x20\x20');}var _0xce45e3=path[_0xf0f9('0x12')](config[_0xf0f9('0x62')],_0xf0f9('0x63'),process[_0xf0f9('0x9a')][0x2]);if(!fs[_0xf0f9('0x9b')](_0xce45e3)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x2c24e7={};try{_0x2c24e7=JSON[_0xf0f9('0x6a')](process['argv'][0x3]);if(!_0x2c24e7[_0xf0f9('0x9c')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x2c24e7[_0xf0f9('0x9c')][_0xf0f9('0x10')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x2c24e7[_0xf0f9('0x9c')][_0xf0f9('0x79')]){throw new Error(_0xf0f9('0x9d'));}var _0x100d38=0x0;if(_0x2c24e7[_0xf0f9('0x9c')][_0xf0f9('0x9e')]){_0x100d38=0x1;}if(!_0x2c24e7[_0xf0f9('0x30')]){throw new Error(_0xf0f9('0x9f'));}}catch(_0x4ceaab){throw new Error(_0xf0f9('0xa0'));}var _0x40d42d=[];try{_0x40d42d=_['map'](JSON[_0xf0f9('0x6a')](process[_0xf0f9('0x9a')][0x4]),'id');}catch(_0x3c70fa){logger[_0xf0f9('0x52')](_0xf0f9('0xa1'));}main(_0xce45e3,_0x2c24e7,_0x40d42d,_0x100d38);}validate();process['on']('SIGINT',handleStop);process['on'](_0xf0f9('0xa2'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 43fe401..7e93290 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['error','message','split','CmContactHasItem','findOne','update','updated','create','PHONE','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','into','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper','toString','cm_contacts.id','insert','ListId','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','errors','code','spread','main','stringify','start','binding','clone','socket_timestamp','root','.csv','ContactItemType','findAll','name','header','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','emit','Abort\x20parser','abort','SystemError','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','each','contactId','contactTypeId','DROP\x20TABLE\x20','finish','affectedRows','contact:import:','unlink','exit','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','path','lodash','papaparse','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','format','YYYYMMDDHHmmss','test','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','length','isNil','AdditionalPhones','push','all','then','catch'];(function(_0xe38fdf,_0x26995b){var _0x89e338=function(_0x1c6cac){while(--_0x1c6cac){_0xe38fdf['push'](_0xe38fdf['shift']());}};_0x89e338(++_0x26995b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var Papa=require(_0x0a9e('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x0a9e('0x3'));var squel=require('squel');var Redis=require(_0x0a9e('0x4'));var db=require(_0x0a9e('0x5'))['db'];var config=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));config['redis']=_[_0x0a9e('0x9')](config[_0x0a9e('0xa')],{'host':_0x0a9e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x0a9e('0xc')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName='cm_contacts_temp_'+moment()[_0x0a9e('0xc')](_0x0a9e('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x307b3e){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))*$/[_0x0a9e('0xe')](_0x307b3e);}function selectNotIn(_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2,_0x527cdd){return squel['select']()[_0x0a9e('0xf')](_0x0a9e('0x10'))[_0x0a9e('0x11')](_0x50dfb2)[_0x0a9e('0x12')](_0xbd1168,null,_0xbd1168+_0x0a9e('0x13')+_0x50dfb2+'.'+_0x4a4c56)[_0x0a9e('0x14')](_0x50dfb2+'.'+_0x4a4c56+'\x20=\x20'+_0xfeb75b+'.'+_0x4a4c56)[_0x0a9e('0x14')](_0xbd1168+_0x0a9e('0x15')+_0x527cdd[_0x0a9e('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x281129,_0x44dcfd){promisesAdditionalPhones=[];promisesContact=[];return db[_0x0a9e('0x16')]['query'](_0x0a9e('0x17')+tempTableName)['spread'](function(_0x1985b6){if(_0x1985b6!==null){var _0x519dfd=[];for(var _0x16033c=0x0;_0x16033c<_0x1985b6[_0x0a9e('0x18')];_0x16033c++){var _0x48f32d=_0x1985b6[_0x16033c];if(!_[_0x0a9e('0x19')](_0x48f32d['phone'])){if(!_[_0x0a9e('0x19')](_0x48f32d[_0x0a9e('0x1a')]))_0x519dfd[_0x0a9e('0x1b')](insertAdditionalPhones(_0x48f32d));promisesContact[_0x0a9e('0x1b')]({'contact':_0x48f32d});}}}Promise[_0x0a9e('0x1c')](_0x519dfd)[_0x0a9e('0x1d')](function(){_0x281129({'val':0x1});});})[_0x0a9e('0x1e')](function(_0x20559e){logger[_0x0a9e('0x1f')](_0x20559e[_0x0a9e('0x20')]);});});}function insertAdditionalPhones(_0x1c696a){return new Promise(function(_0x105080,_0x4bb1e3){var _0x2c3407=_0x1c696a[_0x0a9e('0x1a')];if(_['isNil'](_0x2c3407))_0x4bb1e3({'val':0x0});else{var _0x20f109=_0x2c3407['split'](';');var _0x588269=[];orderBy=0x0;for(var _0x3a02e1=0x0;_0x3a02e1<_0x20f109[_0x0a9e('0x18')];_0x3a02e1++){_0x588269[_0x0a9e('0x1b')](splitAdditionalPhone(_0x1c696a['id'],_0x20f109[_0x3a02e1]));}Promise[_0x0a9e('0x1c')](_0x588269)['then'](function(){_0x105080({'val':_0x20f109[_0x0a9e('0x18')]});});}});}function splitAdditionalPhone(_0x2fb0e4,_0x3b45bc){return new Promise(function(_0x4d00e6,_0x370d86){var _0x42ac8f=_0x3b45bc[_0x0a9e('0x21')](':');var _0x5ea472=_0x42ac8f[0x0];var _0x59181e=_0x42ac8f[0x1];if(_0x59181e!==''){var _0x197ec0=_0x59181e[_0x0a9e('0x21')]('|');var _0x40c424=[];for(var _0x33161b=0x0;_0x33161b<_0x197ec0['length'];_0x33161b++){if(_0x197ec0[_0x33161b]!==''){var _0x384319=_['filter'](promisesAdditionalPhones,{'contactId':_0x2fb0e4,'phone':_0x197ec0[_0x33161b]});if(_0x384319[_0x0a9e('0x18')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x2fb0e4,'contactTypeId':_0x5ea472,'phone':_0x197ec0[_0x33161b],'orderBy':orderBy});}}}_0x4d00e6({'ok':0x1});}else _0x4d00e6({'res':0x0});});}function createAdditionalPhone(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c){var _0x140511='';var _0x1538a4='';var _0x11c3b6=_0x25fba9[_0x0a9e('0x21')]('§');_0x140511=_0x11c3b6[0x0];if(_0x11c3b6['length']==0x2)_0x1538a4=_0x11c3b6[0x1];return new Promise(function(_0x3652a7,_0x468813){return db[_0x0a9e('0x22')][_0x0a9e('0x23')]({'where':{'CmContactId':_0x1dc186,'item':_0x140511}})['then'](function(_0x15b200){if(_0x15b200){return db[_0x0a9e('0x22')][_0x0a9e('0x24')]({'ItemTypeId':_0x34dc65,'description':_0x1538a4,'OrderBy':_0x14433c},{'where':{'CmContactId':_0x1dc186,'item':_0x140511}})[_0x0a9e('0x1d')](function(_0x58b06f){_0x3652a7({'res':_0x0a9e('0x25')});});}else{return db[_0x0a9e('0x22')][_0x0a9e('0x26')]({'CmContactId':_0x1dc186,'item':_0x140511,'ItemTypeId':_0x34dc65,'description':_0x1538a4,'OrderBy':_0x14433c,'ItemClass':_0x0a9e('0x27')})['then'](function(_0x426950){_0x3652a7({'res':'inserted'});});}});});}function updateContact(_0x2407f9){return new Promise(function(_0x3ae878,_0x1122db){var _0x33bdb7=_0x2407f9['id'];delete _0x2407f9['id'];return db[_0x0a9e('0x28')]['update'](_0x2407f9,{'where':{'id':_0x33bdb7}})[_0x0a9e('0x1d')](function(_0x46f0a5){updatedRows+=0x1;return db[_0x0a9e('0x29')][_0x0a9e('0x24')]({'phone':_0x2407f9[_0x0a9e('0x10')]},{'where':{'ContactId':_0x33bdb7}})[_0x0a9e('0x1d')](function(_0x332d35){_0x3ae878({'ret':'OK'});});});});}function insertCmHopper(_0x39e565,_0x5583a4,_0x44295a,_0x5e7238,_0x2cc7a0){var _0x14b13f=[_0x0a9e('0x2a'),_0x0a9e('0x2b'),'cm_contacts.id',_0x0a9e('0x2c'),_0x5583a4+'.'+_0x5e7238,_0x0a9e('0x2d'),_0x0a9e('0x2e'),_0x0a9e('0x2f'),'cm_contacts.UserId','\x22'+_0x2cc7a0+'\x22'];return squel['insert']()[_0x0a9e('0x30')]('cm_hopper')[_0x0a9e('0x31')]([_0x0a9e('0x10'),_0x0a9e('0x32'),_0x0a9e('0x33'),'ListId',_0x5e7238,_0x0a9e('0x34'),_0x0a9e('0x35'),_0x0a9e('0x36'),'UserId',_0x0a9e('0x37')],squel[_0x0a9e('0x38')]()[_0x0a9e('0x39')](_0x14b13f)['from'](_0x5583a4)['join'](_0x0a9e('0x3a'),null,_0x0a9e('0x3b')+_0x5583a4+'.CmListId')[_0x0a9e('0x12')](_0x44295a,null,_0x44295a+_0x0a9e('0x13')+_0x5583a4+'.'+_0x5e7238)[_0x0a9e('0x14')](_0x5583a4+_0x0a9e('0x3c'),_0x39e565)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x0a9e('0x14')](_0x0a9e('0x3d'),selectNotIn(_0x5583a4,_0x44295a,_0x5e7238,'cm_hopper',[_0x0a9e('0x3e'),_0x0a9e('0x3f')]))[_0x0a9e('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5583a4,_0x44295a,_0x5e7238,_0x0a9e('0x40'),[_0x0a9e('0x3e')])))[_0x0a9e('0x41')]();}function insertCmHopperBlack(_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3){var _0x45a9b8=[_0x0a9e('0x2a'),_0x0a9e('0x42'),_0x0a9e('0x2c'),_0x13cb1f+'.'+_0x2881b3,_0x0a9e('0x2d'),_0x0a9e('0x2e')];return squel[_0x0a9e('0x43')]()[_0x0a9e('0x30')]('cm_hopper_black')['fromQuery']([_0x0a9e('0x10'),_0x0a9e('0x33'),_0x0a9e('0x44'),_0x2881b3,_0x0a9e('0x34'),_0x0a9e('0x35')],squel[_0x0a9e('0x38')]()[_0x0a9e('0x39')](_0x45a9b8)[_0x0a9e('0x11')](_0x13cb1f)[_0x0a9e('0x12')](_0x0a9e('0x3a'),null,_0x0a9e('0x3b')+_0x13cb1f+_0x0a9e('0x45'))['join'](_0xeaa5e5,null,_0xeaa5e5+_0x0a9e('0x13')+_0x13cb1f+'.'+_0x2881b3)[_0x0a9e('0x14')](_0x13cb1f+_0x0a9e('0x3c'),_0x43dd5b)[_0x0a9e('0x14')](_0x0a9e('0x46'),NOW)[_0x0a9e('0x14')](_0x0a9e('0x3d'),squel[_0x0a9e('0x38')]()['field'](_0x0a9e('0x10'))['from'](_0x0a9e('0x47'))[_0x0a9e('0x14')](_0x0a9e('0x48'),_0x43dd5b)['where'](_0x2881b3+_0x0a9e('0x49'),_0x13cb1f+'.'+_0x2881b3)))[_0x0a9e('0x41')]();}function insertCmHopperAdditionalPhones(_0x4774f4){var _0x34aa5a=[_0x0a9e('0x4a'),_0x0a9e('0x4b'),_0x0a9e('0x4c'),'cm_contact_has_items.createdAt',_0x0a9e('0x4d')];return squel[_0x0a9e('0x43')]()[_0x0a9e('0x30')](_0x0a9e('0x4e'))[_0x0a9e('0x31')]([_0x0a9e('0x4f'),_0x0a9e('0x10'),_0x0a9e('0x50'),_0x0a9e('0x34'),'updatedAt'],squel[_0x0a9e('0x38')]()[_0x0a9e('0x39')](_0x34aa5a)['from']('cm_hopper')['join'](_0x0a9e('0x3a'),null,_0x0a9e('0x51'))[_0x0a9e('0x12')](_0x0a9e('0x52'),null,_0x0a9e('0x53'))[_0x0a9e('0x14')](_0x0a9e('0x54'),_0x4774f4)[_0x0a9e('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x53975a,_0x39d77d,_0x204173,_0x14d602){var _0x5bb3ed=_[_0x0a9e('0x55')](_[_0x0a9e('0x56')](_0x14d602),['ListId','CompanyId',_0x0a9e('0x34'),'updatedAt']);return squel[_0x0a9e('0x43')]()['into'](_0x0a9e('0x3a'))[_0x0a9e('0x31')](_0x5bb3ed,squel[_0x0a9e('0x38')]()['fields'](_0x5bb3ed)[_0x0a9e('0x11')](_0x39d77d)[_0x0a9e('0x14')]('('+_0x204173['join'](',')+')\x20NOT\x20IN\x20?',squel[_0x0a9e('0x38')]()[_0x0a9e('0x39')](_0x204173)['from'](_0x0a9e('0x3a'))['where'](_0x0a9e('0x48'),_0x53975a))['where'](_0x0a9e('0x57'),squel['select']()['field']('MIN(id)',_0x0a9e('0x58'))['from'](_0x39d77d)[_0x0a9e('0x59')](_0x204173[_0x0a9e('0x12')](','))))[_0x0a9e('0x41')]();}function handleStop(){logger[_0x0a9e('0x5a')](_0x0a9e('0x5b'));stopped=!![];}function handleUncaughtException(_0x272738){logger[_0x0a9e('0x1f')](_0x272738[_0x0a9e('0x20')]);process['exit'](0x1);}function handleError(_0x1c693e,_0x121cef){stats[_0x0a9e('0x5c')][_0x0a9e('0x1b')]({'name':_0x121cef[_0x0a9e('0x5d')],'message':_0x121cef[_0x0a9e('0x20')],'row':_0x1c693e});}function handleQuery(_0x5d86e9){logger[_0x0a9e('0x5a')](_0x5d86e9);return db[_0x0a9e('0x16')]['query'](_0x5d86e9)[_0x0a9e('0x5e')](function(_0x5cc8fb){results[_0x0a9e('0x1b')](_0x5cc8fb);})['catch'](function(_0x4b3c1a){logger['error'](_0x4b3c1a[_0x0a9e('0x20')]);});}function main(_0x49d231,_0x2244d6,_0x1fc70e,_0x261adb){logger[_0x0a9e('0x5a')](_0x0a9e('0x5f'),_0x49d231,JSON[_0x0a9e('0x60')](_0x2244d6));process['send'](_0x0a9e('0x61'));var _0x5854cc=_0x2244d6[_0x0a9e('0x62')];var _0x1f07cb=_[_0x0a9e('0x63')](_0x5854cc);var _0x5adf8f=_0x2244d6[_0x0a9e('0x64')];var _0x156f1c=path[_0x0a9e('0x12')](config[_0x0a9e('0x65')],'server/files/tmp',_0x5adf8f+_0x0a9e('0x66'));logger[_0x0a9e('0x5a')]('body',_0x2244d6);db[_0x0a9e('0x67')][_0x0a9e('0x68')]({'raw':!![],'attributes':['id',_0x0a9e('0x69')]})[_0x0a9e('0x1d')](function(_0x401837){for(var _0x4d4a35=0x0;_0x4d4a35<_0x401837[_0x0a9e('0x18')];_0x4d4a35++){if(_0x401837[_0x4d4a35][_0x0a9e('0x69')]in _0x5854cc){contactItemTypes[_0x0a9e('0x1b')](_0x401837[_0x4d4a35]);delete _0x1f07cb[_0x401837[_0x4d4a35]['name']];hasAdditionalPhones=!![];}for(var _0x3528b7 in _0x5854cc){if(_0x401837[_0x4d4a35]['name']+'_description'===_0x3528b7){phoneDescriptions[_0x0a9e('0x1b')]({'itemTypeId':_0x401837[_0x4d4a35]['id'],'description':_0x3528b7});delete _0x1f07cb[_0x3528b7];}}}if(hasAdditionalPhones)_0x1f07cb[_0x0a9e('0x1a')]='';var _0x9375fb=_[_0x0a9e('0x56')](_0x1f07cb)[_0x0a9e('0x12')]();logger[_0x0a9e('0x5a')](_0x0a9e('0x6a'),_0x9375fb);fs[_0x0a9e('0x6b')](_0x156f1c,_0x9375fb+'\x0a');Papa[_0x0a9e('0x6c')](fs[_0x0a9e('0x6d')](_0x49d231),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2e89b7,_0x19012b){try{for(var _0x2bbb86=0x0,_0x2b8192=[];_0x2bbb86<_0x2e89b7[_0x0a9e('0x6e')][_0x0a9e('0x18')];_0x2bbb86++){stats[_0x0a9e('0x6f')]+=0x1;if(_0x2e89b7[_0x0a9e('0x5c')][_0x2bbb86]){handleError(_0x2e89b7['data'][_0x2bbb86],_0x2e89b7[_0x0a9e('0x5c')][_0x2bbb86]);}else{var _0x295763=[];var _0x243d12=[];var _0x4edbb0={};for(var _0x1148a1 in _0x5854cc){let _0x30944e=contactItemTypes['find'](_0x83f0b2=>_0x83f0b2[_0x0a9e('0x69')]===_0x1148a1);let _0x3ef315=contactItemTypes[_0x0a9e('0x70')](_0x13b5c0=>_0x13b5c0['name']+'_description'===_0x1148a1);if(_['isNil'](_0x30944e)&&_[_0x0a9e('0x19')](_0x3ef315)){if(_0x5854cc[_0x0a9e('0x71')](_0x1148a1)){if(_0x2e89b7[_0x0a9e('0x6e')][_0x2bbb86][_0x5854cc[_0x1148a1]]){var _0x5b35db=_[_0x0a9e('0x72')](_0x2e89b7[_0x0a9e('0x6e')][_0x2bbb86][_0x5854cc[_0x1148a1]][_0x0a9e('0x73')](/"/g,'\x27'));switch(_0x1148a1){case _0x0a9e('0x32'):var _0x5512d1=moment(_0x5b35db,_0x0a9e('0x74'),!![]);if(_0x5512d1[_0x0a9e('0x75')]()){_0x2b8192[_0x0a9e('0x1b')]('\x22'+_0x5b35db+'\x22');}else{_0x295763['push'](_0x0a9e('0x76'));}break;case'priority':var _0x4437ff=parseInt(_0x5b35db);_0x5b35db=_[_0x0a9e('0x77')](_0x4437ff)||_0x4437ff<0x0||_0x4437ff>0x4?_0x261adb?0x3:0x2:_0x4437ff;_0x2b8192['push']('\x22'+_0x5b35db+'\x22');break;case _0x0a9e('0x78'):var _0x75912a=parseInt(_0x5b35db);if(_[_0x0a9e('0x79')](_0x75912a)&&_[_0x0a9e('0x7a')](_0x1fc70e,_0x75912a)){_0x2b8192['push']('\x22'+_0x75912a+'\x22');}else{_0x295763[_0x0a9e('0x1b')](_0x0a9e('0x7b'));}break;case _0x0a9e('0x7c'):if(isEmail(_0x5b35db)){_0x2b8192[_0x0a9e('0x1b')]('\x22'+_0x5b35db+'\x22');}else{_0x295763['push'](_0x0a9e('0x7d'));}break;case _0x0a9e('0x7e'):var _0x2d5506=moment(_0x5b35db,_0x0a9e('0x7f'),!![]);if(_0x2d5506['isValid']()){_0x2b8192[_0x0a9e('0x1b')]('\x22'+_0x5b35db+'\x22');}else{_0x295763[_0x0a9e('0x1b')](_0x0a9e('0x80'));}break;default:_0x2b8192[_0x0a9e('0x1b')]('\x22'+_0x5b35db+'\x22');}}else{switch(_0x1148a1){case _0x0a9e('0x81'):case _0x0a9e('0x10'):_0x295763[_0x0a9e('0x1b')](_0x1148a1+_0x0a9e('0x82'));break;default:_0x2b8192[_0x0a9e('0x1b')]('\x22\x22');}}}}else{var _0x336dc3='';if(!_[_0x0a9e('0x19')](_0x30944e)){if(!_0x4edbb0[_0x0a9e('0x71')](_0x30944e['id'])){for(var _0x25744a=0x0;_0x25744a<_0x5854cc[_0x1148a1][_0x0a9e('0x18')];_0x25744a++){var _0x5b35db=_[_0x0a9e('0x72')](_0x2e89b7[_0x0a9e('0x6e')][_0x2bbb86][_0x5854cc[_0x1148a1][_0x25744a]][_0x0a9e('0x73')](/"/g,'\x27'));var _0x563627=phoneDescriptions[_0x0a9e('0x70')](_0x33dda0=>_0x33dda0[_0x0a9e('0x83')]===_0x30944e['id']);if(!_[_0x0a9e('0x19')](_0x563627)){var _0x56d650=_['trim'](_0x2e89b7[_0x0a9e('0x6e')][_0x2bbb86][_0x5854cc[_0x563627[_0x0a9e('0x84')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x0a9e('0x19')](_0x56d650))_0x5b35db=_0x5b35db+'§'+_0x56d650;}if(_0x336dc3=='')_0x336dc3=_0x5b35db;else _0x336dc3+='|'+_0x5b35db;}_0x243d12['push'](_0x30944e['id']+':'+_0x336dc3);_0x4edbb0[_0x30944e['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2b8192[_0x0a9e('0x1b')]('\x22'+_0x243d12[_0x0a9e('0x12')](';')+'\x22');}if(_0x295763['length']){handleError(_0x2e89b7[_0x0a9e('0x6e')][_0x2bbb86],{'code':_0x0a9e('0x85'),'message':_0x295763[_0x0a9e('0x12')]()});}else{fs[_0x0a9e('0x86')](_0x156f1c,_0x2b8192[_0x0a9e('0x12')]()+'\x0a');}_0x2b8192=[];}if(!(stats[_0x0a9e('0x6f')]%0xc8)){socket[_0x0a9e('0x87')]('contact:import:'+_0x5adf8f,stats);stats[_0x0a9e('0x5c')]=[];}}if(stopped){logger[_0x0a9e('0x5a')](_0x0a9e('0x88'));_0x19012b[_0x0a9e('0x89')]();}}catch(_0x492543){handleError(_0x2e89b7[_0x0a9e('0x6e')][_0x2bbb86],{'code':_0x0a9e('0x8a'),'message':_0x492543['message']});logger[_0x0a9e('0x1f')]('step',_0x492543[_0x0a9e('0x20')]);}},'complete':function(){try{var _0x2bb25a=[];var _0x3003eb=tempTableName;_0x2bb25a[_0x0a9e('0x1b')]('CREATE\x20TABLE\x20'+_0x3003eb+'\x20LIKE\x20cm_contacts;');logger[_0x0a9e('0x5a')](_0x0a9e('0x8b'),contactItemTypes[_0x0a9e('0x18')]);var _0x5ac73d=util[_0x0a9e('0xc')](_0x0a9e('0x8c'),_0x156f1c,_0x3003eb,_0x9375fb,_0x2244d6['ListId'],_0x2244d6['CompanyId']||null,NOW,NOW);if(_[_0x0a9e('0x19')](_0x5854cc['scheduledat'])){_0x5ac73d+=',\x20scheduledAt\x20=\x20NOW()';}_0x2bb25a['push'](_0x5ac73d);BPromise[_0x0a9e('0x8d')](_0x2bb25a,handleQuery)[_0x0a9e('0x1d')](function(_0x9044fe){BPromise[_0x0a9e('0x1c')]([handleAdditionalPhones()])[_0x0a9e('0x1d')](function(){_0x2bb25a=[];for(var _0x2600de=0x0;_0x2600de\x20\x20','file\x20doesn\x27t\x20exists','parse','binding','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','SIGINT','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','.id\x20=\x20','\x20=\x20','where','join','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','message','split','filter','CmContactHasItem','findOne','update','create','inserted','CmContact','CmHopper'];(function(_0x2feb53,_0x264ef7){var _0x5700ee=function(_0x700c98){while(--_0x700c98){_0x2feb53['push'](_0x2feb53['shift']());}};_0x5700ee(++_0x264ef7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0x3071('0x0'));var util=require(_0x3071('0x1'));var BPromise=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var squel=require(_0x3071('0x4'));var Redis=require('ioredis');var db=require(_0x3071('0x5'))['db'];var config=require(_0x3071('0x6'));var logger=require(_0x3071('0x7'))(_0x3071('0x8'));config[_0x3071('0x9')]=_[_0x3071('0xa')](config[_0x3071('0x9')],{'host':_0x3071('0xb'),'port':0x18eb});var socket=require(_0x3071('0xc'))(new Redis(config[_0x3071('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x3071('0xd')](_0x3071('0xe'));var tempTableName=_0x3071('0xf')+moment()['format'](_0x3071('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x2610b4){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))*$/[_0x3071('0x11')](_0x2610b4);}function selectNotIn(_0xff9a29,_0x1ce844,_0x4a470a,_0x2ace21,_0x11a7ee){return squel[_0x3071('0x12')]()[_0x3071('0x13')](_0x3071('0x14'))['from'](_0x2ace21)['join'](_0x1ce844,null,_0x1ce844+_0x3071('0x15')+_0x2ace21+'.'+_0x4a470a)['where'](_0x2ace21+'.'+_0x4a470a+_0x3071('0x16')+_0xff9a29+'.'+_0x4a470a)[_0x3071('0x17')](_0x1ce844+'.dialCheckDuplicateType\x20IN\x20('+_0x11a7ee[_0x3071('0x18')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4e1219,_0x2fc15d){promisesAdditionalPhones=[];promisesContact=[];return db[_0x3071('0x19')][_0x3071('0x1a')](_0x3071('0x1b')+tempTableName)[_0x3071('0x1c')](function(_0x2a6a4b){if(_0x2a6a4b!==null){var _0x157a47=[];for(var _0x11bdc9=0x0;_0x11bdc9<_0x2a6a4b[_0x3071('0x1d')];_0x11bdc9++){var _0x344ea6=_0x2a6a4b[_0x11bdc9];if(!_['isNil'](_0x344ea6[_0x3071('0x14')])){if(!_[_0x3071('0x1e')](_0x344ea6[_0x3071('0x1f')]))_0x157a47[_0x3071('0x20')](insertAdditionalPhones(_0x344ea6));promisesContact[_0x3071('0x20')]({'contact':_0x344ea6});}}}Promise[_0x3071('0x21')](_0x157a47)[_0x3071('0x22')](function(){_0x4e1219({'val':0x1});});})[_0x3071('0x23')](function(_0x502a16){logger[_0x3071('0x24')](_0x502a16[_0x3071('0x25')]);});});}function insertAdditionalPhones(_0xd3e23d){return new Promise(function(_0x56c267,_0xb8f4e3){var _0x5cd80d=_0xd3e23d[_0x3071('0x1f')];if(_[_0x3071('0x1e')](_0x5cd80d))_0xb8f4e3({'val':0x0});else{var _0x3762d8=_0x5cd80d[_0x3071('0x26')](';');var _0x33090c=[];orderBy=0x0;for(var _0x34c50e=0x0;_0x34c50e<_0x3762d8[_0x3071('0x1d')];_0x34c50e++){_0x33090c[_0x3071('0x20')](splitAdditionalPhone(_0xd3e23d['id'],_0x3762d8[_0x34c50e]));}Promise['all'](_0x33090c)['then'](function(){_0x56c267({'val':_0x3762d8[_0x3071('0x1d')]});});}});}function splitAdditionalPhone(_0xb05b1d,_0x412652){return new Promise(function(_0x13df9f,_0x2793ef){var _0x44b45f=_0x412652[_0x3071('0x26')](':');var _0x1fe727=_0x44b45f[0x0];var _0x1de5fb=_0x44b45f[0x1];if(_0x1de5fb!==''){var _0x4c7130=_0x1de5fb[_0x3071('0x26')]('|');var _0x3f1e6e=[];for(var _0x177138=0x0;_0x177138<_0x4c7130['length'];_0x177138++){if(_0x4c7130[_0x177138]!==''){var _0x4fb1ca=_[_0x3071('0x27')](promisesAdditionalPhones,{'contactId':_0xb05b1d,'phone':_0x4c7130[_0x177138]});if(_0x4fb1ca[_0x3071('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0x3071('0x20')]({'contactId':_0xb05b1d,'contactTypeId':_0x1fe727,'phone':_0x4c7130[_0x177138],'orderBy':orderBy});}}}_0x13df9f({'ok':0x1});}else _0x13df9f({'res':0x0});});}function createAdditionalPhone(_0x3fa3b8,_0x25b96b,_0x177b5f,_0x3921a1){var _0x32f1b4='';var _0x292205='';var _0x254fc8=_0x177b5f['split']('§');_0x32f1b4=_0x254fc8[0x0];if(_0x254fc8['length']==0x2)_0x292205=_0x254fc8[0x1];return new Promise(function(_0x9e26d1,_0x149e0d){return db[_0x3071('0x28')][_0x3071('0x29')]({'where':{'CmContactId':_0x3fa3b8,'item':_0x32f1b4}})[_0x3071('0x22')](function(_0x29538c){if(_0x29538c){return db[_0x3071('0x28')][_0x3071('0x2a')]({'ItemTypeId':_0x25b96b,'description':_0x292205,'OrderBy':_0x3921a1},{'where':{'CmContactId':_0x3fa3b8,'item':_0x32f1b4}})['then'](function(_0x55d230){_0x9e26d1({'res':'updated'});});}else{return db[_0x3071('0x28')][_0x3071('0x2b')]({'CmContactId':_0x3fa3b8,'item':_0x32f1b4,'ItemTypeId':_0x25b96b,'description':_0x292205,'OrderBy':_0x3921a1,'ItemClass':'PHONE'})[_0x3071('0x22')](function(_0x28747d){_0x9e26d1({'res':_0x3071('0x2c')});});}});});}function updateContact(_0x13ae2c){return new Promise(function(_0x5e1d2b,_0x218a82){var _0x1525df=_0x13ae2c['id'];delete _0x13ae2c['id'];return db[_0x3071('0x2d')][_0x3071('0x2a')](_0x13ae2c,{'where':{'id':_0x1525df}})[_0x3071('0x22')](function(_0x2068ce){updatedRows+=0x1;return db[_0x3071('0x2e')][_0x3071('0x2a')]({'phone':_0x13ae2c['phone']},{'where':{'ContactId':_0x1525df}})[_0x3071('0x22')](function(_0x54e52f){_0x5e1d2b({'ret':'OK'});});});});}function insertCmHopper(_0x4fb1ec,_0x1a1a64,_0xa3a7ae,_0x54d9c3,_0x2e85c8){var _0x46e94e=[_0x3071('0x2f'),_0x3071('0x30'),_0x3071('0x31'),_0x3071('0x32'),_0x1a1a64+'.'+_0x54d9c3,'cm_contacts.createdAt',_0x3071('0x33'),_0x3071('0x34'),'cm_contacts.UserId','\x22'+_0x2e85c8+'\x22'];return squel[_0x3071('0x35')]()['into'](_0x3071('0x36'))[_0x3071('0x37')](['phone','scheduledat',_0x3071('0x38'),_0x3071('0x39'),_0x54d9c3,_0x3071('0x3a'),'updatedAt',_0x3071('0x3b'),'UserId',_0x3071('0x3c')],squel['select']()[_0x3071('0x3d')](_0x46e94e)[_0x3071('0x3e')](_0x1a1a64)[_0x3071('0x18')](_0x3071('0x3f'),null,_0x3071('0x40')+_0x1a1a64+'.CmListId')['join'](_0xa3a7ae,null,_0xa3a7ae+_0x3071('0x15')+_0x1a1a64+'.'+_0x54d9c3)[_0x3071('0x17')](_0x1a1a64+_0x3071('0x41'),_0x4fb1ec)[_0x3071('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x3071('0x17')](_0x3071('0x42'),selectNotIn(_0x1a1a64,_0xa3a7ae,_0x54d9c3,_0x3071('0x36'),[_0x3071('0x43'),_0x3071('0x44')]))[_0x3071('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1a1a64,_0xa3a7ae,_0x54d9c3,_0x3071('0x36'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x4dc9d1,_0x47ceaf,_0x2992e6,_0x1be8b6){var _0x67b2fb=[_0x3071('0x2f'),_0x3071('0x31'),_0x3071('0x32'),_0x47ceaf+'.'+_0x1be8b6,_0x3071('0x45'),_0x3071('0x33')];return squel['insert']()[_0x3071('0x46')](_0x3071('0x47'))[_0x3071('0x37')]([_0x3071('0x14'),_0x3071('0x38'),'ListId',_0x1be8b6,'createdAt',_0x3071('0x48')],squel[_0x3071('0x12')]()[_0x3071('0x3d')](_0x67b2fb)[_0x3071('0x3e')](_0x47ceaf)[_0x3071('0x18')]('cm_contacts',null,_0x3071('0x40')+_0x47ceaf+'.CmListId')[_0x3071('0x18')](_0x2992e6,null,_0x2992e6+'.id\x20=\x20'+_0x47ceaf+'.'+_0x1be8b6)['where'](_0x47ceaf+_0x3071('0x41'),_0x4dc9d1)['where'](_0x3071('0x49'),NOW)['where'](_0x3071('0x42'),squel[_0x3071('0x12')]()[_0x3071('0x13')](_0x3071('0x14'))['from'](_0x3071('0x47'))['where'](_0x3071('0x4a'),_0x4dc9d1)['where'](_0x1be8b6+_0x3071('0x4b'),_0x47ceaf+'.'+_0x1be8b6)))[_0x3071('0x4c')]();}function insertCmHopperAdditionalPhones(_0x4d395a){var _0x131ae6=[_0x3071('0x4d'),_0x3071('0x4e'),_0x3071('0x4f'),_0x3071('0x50'),_0x3071('0x51')];return squel[_0x3071('0x35')]()['into'](_0x3071('0x52'))[_0x3071('0x37')]([_0x3071('0x53'),_0x3071('0x14'),'OrderBy',_0x3071('0x3a'),_0x3071('0x48')],squel[_0x3071('0x12')]()[_0x3071('0x3d')](_0x131ae6)[_0x3071('0x3e')](_0x3071('0x36'))[_0x3071('0x18')](_0x3071('0x3f'),null,_0x3071('0x54'))[_0x3071('0x18')](_0x3071('0x55'),null,_0x3071('0x56'))[_0x3071('0x17')](_0x3071('0x57'),_0x4d395a)[_0x3071('0x17')](_0x3071('0x49'),NOW))['toString']();}function insertCmContact(_0x47a438,_0x12536d,_0x580c04,_0x403761){var _0x198168=_[_0x3071('0x58')](_['keys'](_0x403761),[_0x3071('0x39'),_0x3071('0x59'),'createdAt','updatedAt']);return squel[_0x3071('0x35')]()[_0x3071('0x46')](_0x3071('0x3f'))[_0x3071('0x37')](_0x198168,squel['select']()[_0x3071('0x3d')](_0x198168)[_0x3071('0x3e')](_0x12536d)[_0x3071('0x17')]('('+_0x580c04[_0x3071('0x18')](',')+_0x3071('0x5a'),squel['select']()[_0x3071('0x3d')](_0x580c04)[_0x3071('0x3e')](_0x3071('0x3f'))[_0x3071('0x17')](_0x3071('0x4a'),_0x47a438))[_0x3071('0x17')](_0x3071('0x5b'),squel['select']()['field'](_0x3071('0x5c'),'min_id')[_0x3071('0x3e')](_0x12536d)[_0x3071('0x5d')](_0x580c04['join'](','))))[_0x3071('0x4c')]();}function handleStop(){logger[_0x3071('0x5e')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x108b14){logger[_0x3071('0x24')](_0x108b14[_0x3071('0x25')]);process[_0x3071('0x5f')](0x1);}function handleError(_0x2aaccb,_0x53a399){stats[_0x3071('0x60')][_0x3071('0x20')]({'name':_0x53a399[_0x3071('0x61')],'message':_0x53a399['message'],'row':_0x2aaccb});}function handleQuery(_0x1b0f81){logger[_0x3071('0x5e')](_0x1b0f81);return db[_0x3071('0x19')][_0x3071('0x1a')](_0x1b0f81)[_0x3071('0x1c')](function(_0x210123){results[_0x3071('0x20')](_0x210123);})[_0x3071('0x23')](function(_0x3b47e8){logger['error'](_0x3b47e8[_0x3071('0x25')]);});}function main(_0x29a58e,_0x3bcf28,_0x26ecb2,_0x466835){logger[_0x3071('0x5e')](_0x3071('0x62'),_0x29a58e,JSON[_0x3071('0x63')](_0x3bcf28));process[_0x3071('0x64')](_0x3071('0x65'));var _0x195d03=_0x3bcf28['binding'];var _0x320fe6=_[_0x3071('0x66')](_0x195d03);var _0x279594=_0x3bcf28[_0x3071('0x67')];var _0x429a03=path[_0x3071('0x18')](config[_0x3071('0x68')],_0x3071('0x69'),_0x279594+'.csv');logger[_0x3071('0x5e')](_0x3071('0x6a'),_0x3bcf28);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x3071('0x6b')]})[_0x3071('0x22')](function(_0x3469c1){for(var _0x38bc1f=0x0;_0x38bc1f<_0x3469c1['length'];_0x38bc1f++){if(_0x3469c1[_0x38bc1f]['name']in _0x195d03){contactItemTypes[_0x3071('0x20')](_0x3469c1[_0x38bc1f]);delete _0x320fe6[_0x3469c1[_0x38bc1f]['name']];hasAdditionalPhones=!![];}for(var _0x518bb5 in _0x195d03){if(_0x3469c1[_0x38bc1f]['name']+'_description'===_0x518bb5){phoneDescriptions[_0x3071('0x20')]({'itemTypeId':_0x3469c1[_0x38bc1f]['id'],'description':_0x518bb5});delete _0x320fe6[_0x518bb5];}}}if(hasAdditionalPhones)_0x320fe6[_0x3071('0x1f')]='';var _0xd928e8=_['keys'](_0x320fe6)[_0x3071('0x18')]();logger[_0x3071('0x5e')](_0x3071('0x6c'),_0xd928e8);fs[_0x3071('0x6d')](_0x429a03,_0xd928e8+'\x0a');Papa['parse'](fs[_0x3071('0x6e')](_0x29a58e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x29841a,_0x588406){try{for(var _0x1b35d3=0x0,_0x29ee70=[];_0x1b35d3<_0x29841a[_0x3071('0x6f')][_0x3071('0x1d')];_0x1b35d3++){stats[_0x3071('0x70')]+=0x1;if(_0x29841a[_0x3071('0x60')][_0x1b35d3]){handleError(_0x29841a[_0x3071('0x6f')][_0x1b35d3],_0x29841a['errors'][_0x1b35d3]);}else{var _0x5dde93=[];var _0x21c1e3=[];var _0x168025={};for(var _0x1456ce in _0x195d03){let _0x4bf839=contactItemTypes['find'](_0x9f49f0=>_0x9f49f0[_0x3071('0x6b')]===_0x1456ce);let _0x3bad84=contactItemTypes[_0x3071('0x71')](_0x2f1935=>_0x2f1935[_0x3071('0x6b')]+_0x3071('0x72')===_0x1456ce);if(_[_0x3071('0x1e')](_0x4bf839)&&_['isNil'](_0x3bad84)){if(_0x195d03[_0x3071('0x73')](_0x1456ce)){if(_0x29841a['data'][_0x1b35d3][_0x195d03[_0x1456ce]]){var _0xa8e233=_[_0x3071('0x74')](_0x29841a[_0x3071('0x6f')][_0x1b35d3][_0x195d03[_0x1456ce]][_0x3071('0x75')](/"/g,'\x27'));switch(_0x1456ce){case _0x3071('0x76'):var _0x44b5dc=moment(_0xa8e233,_0x3071('0xe'),!![]);if(_0x44b5dc[_0x3071('0x77')]()){_0x29ee70['push']('\x22'+_0xa8e233+'\x22');}else{_0x5dde93[_0x3071('0x20')](_0x3071('0x78'));}break;case _0x3071('0x3b'):var _0x4f06c0=parseInt(_0xa8e233);_0xa8e233=_[_0x3071('0x79')](_0x4f06c0)||_0x4f06c0<0x0||_0x4f06c0>0x4?_0x466835?0x3:0x2:_0x4f06c0;_0x29ee70[_0x3071('0x20')]('\x22'+_0xa8e233+'\x22');break;case _0x3071('0x7a'):var _0x567e33=parseInt(_0xa8e233);if(_['isNumber'](_0x567e33)&&_[_0x3071('0x7b')](_0x26ecb2,_0x567e33)){_0x29ee70['push']('\x22'+_0x567e33+'\x22');}else{_0x5dde93[_0x3071('0x20')](_0x3071('0x7c'));}break;case _0x3071('0x7d'):if(isEmail(_0xa8e233)){_0x29ee70[_0x3071('0x20')]('\x22'+_0xa8e233+'\x22');}else{_0x5dde93[_0x3071('0x20')](_0x3071('0x7e'));}break;case _0x3071('0x7f'):var _0x4c67ec=moment(_0xa8e233,_0x3071('0x80'),!![]);if(_0x4c67ec[_0x3071('0x77')]()){_0x29ee70[_0x3071('0x20')]('\x22'+_0xa8e233+'\x22');}else{_0x5dde93[_0x3071('0x20')](_0x3071('0x81'));}break;default:_0x29ee70[_0x3071('0x20')]('\x22'+_0xa8e233+'\x22');}}else{switch(_0x1456ce){case _0x3071('0x82'):case _0x3071('0x14'):_0x5dde93['push'](_0x1456ce+_0x3071('0x83'));break;default:_0x29ee70['push']('\x22\x22');}}}}else{var _0x2aef6e='';if(!_[_0x3071('0x1e')](_0x4bf839)){if(!_0x168025[_0x3071('0x73')](_0x4bf839['id'])){for(var _0x45879b=0x0;_0x45879b<_0x195d03[_0x1456ce][_0x3071('0x1d')];_0x45879b++){var _0xa8e233=_[_0x3071('0x74')](_0x29841a[_0x3071('0x6f')][_0x1b35d3][_0x195d03[_0x1456ce][_0x45879b]][_0x3071('0x75')](/"/g,'\x27'));var _0x3a3cf3=phoneDescriptions['find'](_0x456921=>_0x456921[_0x3071('0x84')]===_0x4bf839['id']);if(!_['isNil'](_0x3a3cf3)){var _0x156826=_[_0x3071('0x74')](_0x29841a[_0x3071('0x6f')][_0x1b35d3][_0x195d03[_0x3a3cf3[_0x3071('0x85')]][0x0]][_0x3071('0x75')](/"/g,'\x27'));if(!_['isNil'](_0x156826))_0xa8e233=_0xa8e233+'§'+_0x156826;}if(_0x2aef6e=='')_0x2aef6e=_0xa8e233;else _0x2aef6e+='|'+_0xa8e233;}_0x21c1e3['push'](_0x4bf839['id']+':'+_0x2aef6e);_0x168025[_0x4bf839['id']]=0x1;}}}}if(hasAdditionalPhones){_0x29ee70[_0x3071('0x20')]('\x22'+_0x21c1e3['join'](';')+'\x22');}if(_0x5dde93[_0x3071('0x1d')]){handleError(_0x29841a[_0x3071('0x6f')][_0x1b35d3],{'code':_0x3071('0x86'),'message':_0x5dde93[_0x3071('0x18')]()});}else{fs[_0x3071('0x87')](_0x429a03,_0x29ee70[_0x3071('0x18')]()+'\x0a');}_0x29ee70=[];}if(!(stats['rows']%0xc8)){socket[_0x3071('0x88')](_0x3071('0x89')+_0x279594,stats);stats[_0x3071('0x60')]=[];}}if(stopped){logger[_0x3071('0x5e')]('Abort\x20parser');_0x588406[_0x3071('0x8a')]();}}catch(_0x446546){handleError(_0x29841a['data'][_0x1b35d3],{'code':_0x3071('0x8b'),'message':_0x446546[_0x3071('0x25')]});logger[_0x3071('0x24')](_0x3071('0x8c'),_0x446546[_0x3071('0x25')]);}},'complete':function(){try{var _0x547ba8=[];var _0x44cecd=tempTableName;_0x547ba8['push'](_0x3071('0x8d')+_0x44cecd+_0x3071('0x8e'));logger[_0x3071('0x5e')](_0x3071('0x8f'),contactItemTypes[_0x3071('0x1d')]);var _0x247cda=util[_0x3071('0xd')](_0x3071('0x90'),_0x429a03,_0x44cecd,_0xd928e8,_0x3bcf28['ListId'],_0x3bcf28[_0x3071('0x59')]||null,NOW,NOW);if(_[_0x3071('0x1e')](_0x195d03[_0x3071('0x76')])){_0x247cda+=',\x20scheduledAt\x20=\x20NOW()';}_0x547ba8[_0x3071('0x20')](_0x247cda);BPromise['each'](_0x547ba8,handleQuery)[_0x3071('0x22')](function(_0x5a5861){BPromise[_0x3071('0x21')]([handleAdditionalPhones()])['then'](function(){_0x547ba8=[];for(var _0x163b29=0x0;_0x163b29=_0x20f37f){return _0x353ece['status'](0x193)[_0x1713('0xe')]({'message':util[_0x1713('0x5')](_0x1713('0xf'),_0x5ebdc0)});}_0x45cfa1();})['catch'](function(_0x4d4d58){_0x45cfa1(_0x4d4d58);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x1713('0x10')],{'where':{'$or':[{'role':_0x1713('0x11')},{'role':_0x1713('0x12')}]}});}exports[_0x1713('0x13')]=isUserLimit; \ No newline at end of file +var _0x0983=['%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format'];(function(_0x94cd8,_0x80691a){var _0x5572f4=function(_0x2cae9b){while(--_0x2cae9b){_0x94cd8['push'](_0x94cd8['shift']());}};_0x5572f4(++_0x80691a);}(_0x0983,0x92));var _0x3098=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x0983[_0x2dadb9];return _0x2f0097;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x3098('0x0'));var db=require(_0x3098('0x1'))['db'];var config=require(_0x3098('0x2'));function getValueFromLicense(_0x2bc782,_0x1fc8bd){if(_0x2bc782&&_0x1fc8bd){if(_0x1fc8bd[_0x3098('0x3')]&&_0x1fc8bd['license']){var _0x5ef7c6=_0x1fc8bd[_0x3098('0x3')];var _0x46b4b1=_0x1fc8bd[_0x3098('0x4')];var _0x5910ad=_0x5ef7c6[_0x3098('0x5')]('-')[0x4];var _0x597df9=_0x5ef7c6[_0x3098('0x5')]('-')[0x0];var _0x1b125f=crypto[_0x3098('0x6')]('aes-256-ctr',util[_0x3098('0x7')](_0x3098('0x8'),_0x5910ad,_0x5ef7c6,_0x597df9));var _0x158d22=_0x1b125f[_0x3098('0x9')](_0x46b4b1,_0x3098('0xa'),_0x3098('0xb'));_0x158d22+=_0x1b125f['final'](_0x3098('0xb'));var _0x1601c6=JSON[_0x3098('0xc')](_0x158d22);return _0x1601c6[_0x3098('0xd')](_0x2bc782)?_0x1601c6[_0x2bc782]:null;}}return null;}function isLimit(_0x58058c,_0x31e4a2,_0x1ba5d7,_0x378d92){var _0x41fccb=_0x31e4a2;return compose()[_0x3098('0xe')](function(_0x4b0358,_0x21a582,_0x3cac7e){return db[_0x3098('0xf')][_0x3098('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x2301f8){var _0x7b1888=getValueFromLicense(_0x58058c,_0x2301f8);return _0x7b1888?_0x7b1888:_0x41fccb;})[_0x3098('0x11')](function(_0x47b504){_0x41fccb=_0x47b504;return _0x1ba5d7['count'](_0x378d92);})[_0x3098('0x11')](function(_0x48ed25){if(_0x48ed25>=_0x41fccb){return _0x21a582[_0x3098('0x12')](0x193)['json']({'message':util[_0x3098('0x7')](_0x3098('0x13'),_0x58058c)});}_0x3cac7e();})['catch'](function(_0x38cca4){_0x3cac7e(_0x38cca4);});});}function isUserLimit(){return isLimit(_0x3098('0x14'),0x1,db[_0x3098('0x15')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 2fbd893..9f80c74 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 _0xa43b=['CAST(','field','\x20AS\x20','castTo','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','split','forEach','shift','match','indexOf','map','push','buildExpression','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','text'];(function(_0x3316d6,_0x9e6ac1){var _0x7a30c=function(_0x5dedcb){while(--_0x5dedcb){_0x3316d6['push'](_0x3316d6['shift']());}};_0x7a30c(++_0x9e6ac1);}(_0xa43b,0x194));var _0xba43=function(_0x14f1bd,_0x2f27e2){_0x14f1bd=_0x14f1bd-0x0;var _0x238c4b=_0xa43b[_0x14f1bd];return _0x238c4b;};'use strict';var _=require(_0xba43('0x0'));var moment=require(_0xba43('0x1'));exports[_0xba43('0x2')]=function(_0xa4f776){var _0xcf0384={'conditions':[]};_0xcf0384[_0xba43('0x3')]=_[_0xba43('0x4')](_0xa4f776,_0xba43('0x5'))?'or':'and';var _0x906986=_0xa4f776[_0xba43('0x6')](_0xba43('0x7'),'')[_0xba43('0x6')](_0xba43('0x5'),'')[_0xba43('0x8')]('||');for(var _0xcc4afa=0x0;_0xcc4afa<_0x906986['length'];_0xcc4afa++){var _0x18d16e=_0x906986[_0xcc4afa][_0xba43('0x8')](':=');var _0x56143f=_0x18d16e[0x0];var _0x580c49=_0x18d16e['slice'](0x1);_0x580c49[_0xba43('0x9')](function(_0x486f36){var _0x24f939=_0x486f36['split']('[')[_0xba43('0xa')]();var _0x37dfc0=_0x486f36[_0xba43('0xb')](/\[(.*?)\]/g);_0x37dfc0[_0xba43('0x9')](function(_0x1c4ee7){var _0x20da13=_0x1c4ee7['split']('[')['filter'](function(_0x41bb82){return _0x41bb82[_0xba43('0xc')](']')>-0x1;})[_0xba43('0xd')](function(_0x1ae37a){return _0x1ae37a[_0xba43('0x8')](']')[0x0];})[0x0];_0xcf0384['conditions'][_0xba43('0xe')]({'field':_0x56143f,'operator':_0x24f939,'value':_0x20da13});});});}return _0xcf0384;};exports[_0xba43('0xf')]=function(_0x5e000d,_0x567c1d,_0x527c86){var _0xc2bddd={};if(_0x567c1d==='DATE'){if(_0x527c86[_0xba43('0x10')]===_0xba43('0x11')){_0x527c86[_0xba43('0x10')]=_0xba43('0x12');_0x527c86[_0xba43('0x13')]+=','+_0x527c86[_0xba43('0x13')];}else if(_[_0xba43('0x14')]([_0xba43('0x15'),_0xba43('0x16')],_0x527c86[_0xba43('0x10')])){_0x527c86[_0xba43('0x13')]=moment(_0x527c86['value'])[_0xba43('0x17')](0x1,_0xba43('0x18'))[_0xba43('0x19')](_0xba43('0x1a'));}}if(_0x527c86['castTo']){_0x567c1d=_0x527c86['castTo'];_0xc2bddd[_0xba43('0x1b')]=_0xba43('0x1c')+_0x5e000d+'.'+_0x527c86[_0xba43('0x1d')]+_0xba43('0x1e')+_0x527c86[_0xba43('0x1f')]+')\x20'+parseOperator(_0x527c86[_0xba43('0x10')]);}else{_0xc2bddd['text']=_0x5e000d+'.'+_0x527c86[_0xba43('0x1d')]+'\x20'+parseOperator(_0x527c86[_0xba43('0x10')]);}if(_['includes'](['$ne',_0xba43('0x20')],_0x527c86['operator']))_0xc2bddd[_0xba43('0x1b')]='('+_0xc2bddd[_0xba43('0x1b')]+_0xba43('0x21')+_0x5e000d+'.'+_0x527c86[_0xba43('0x1d')]+_0xba43('0x22');_0xc2bddd[_0xba43('0x13')]=parseValue(_0x567c1d,_0x527c86['operator'],_0x527c86[_0xba43('0x13')]);return _0xc2bddd;};function parseOperator(_0x504917){var _0x3d0d6c;switch(_0x504917){case _0xba43('0x23'):_0x3d0d6c=_0xba43('0x24');break;case _0xba43('0x20'):_0x3d0d6c='NOT\x20IN\x20?';break;case _0xba43('0x11'):_0x3d0d6c='=\x20?';break;case'$ne':_0x3d0d6c=_0xba43('0x25');break;case _0xba43('0x26'):case _0xba43('0x27'):case _0xba43('0x28'):_0x3d0d6c=_0xba43('0x29');break;case _0xba43('0x2a'):_0x3d0d6c=_0xba43('0x2b');break;case _0xba43('0x15'):_0x3d0d6c=_0xba43('0x2c');break;case _0xba43('0x16'):_0x3d0d6c=_0xba43('0x2d');break;case _0xba43('0x2e'):_0x3d0d6c=_0xba43('0x2f');break;case _0xba43('0x12'):_0x3d0d6c=_0xba43('0x30');break;}return _0x3d0d6c;}function parseValue(_0xcf9c4c,_0x201be1,_0x135881){var _0x428426={'start':undefined,'end':undefined};switch(_0x201be1){case _0xba43('0x23'):case _0xba43('0x20'):_0x428426[_0xba43('0x31')]=_0x135881['split'](',');break;case _0xba43('0x26'):_0x428426[_0xba43('0x31')]='%'+_0x135881+'%';break;case _0xba43('0x27'):_0x428426[_0xba43('0x31')]=_0x135881+'%';break;case _0xba43('0x28'):_0x428426[_0xba43('0x31')]='%'+_0x135881;break;case _0xba43('0x12'):var _0x22e2a6=_0x135881[_0xba43('0x8')](',');var _0x135881=_0x22e2a6[_0xba43('0xa')]();var _0x3ca5ae=_0x22e2a6[_0xba43('0x32')]();if(_0xcf9c4c==='DATE'){_0x135881=moment(_0x135881)[_0xba43('0x33')](0x0,!![])['format']();_0x3ca5ae=moment(_0x3ca5ae)['utcOffset'](0x0,!![])[_0xba43('0x17')](0x17,'hours')[_0xba43('0x17')](0x3b,_0xba43('0x34'))['add'](0x3b,_0xba43('0x35'))[_0xba43('0x19')]();}_0x428426={'start':_0x135881,'end':_0x3ca5ae};break;default:_0x428426[_0xba43('0x31')]=_0x135881;break;}return _0x428426;} \ No newline at end of file +var _0x9e2b=['parseSearch','sqlOperator','[$or]','and','replace','[$and]','split','slice','forEach','shift','match','filter','indexOf','push','buildExpression','DATE','operator','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','>=\x20?','$between','start','pop','utcOffset','hours','minutes','seconds','lodash','moment'];(function(_0x48be2d,_0x53c7a2){var _0x427905=function(_0x5d32cc){while(--_0x5d32cc){_0x48be2d['push'](_0x48be2d['shift']());}};_0x427905(++_0x53c7a2);}(_0x9e2b,0xa6));var _0xb9e2=function(_0x482f2d,_0x56f3fc){_0x482f2d=_0x482f2d-0x0;var _0x4f929a=_0x9e2b[_0x482f2d];return _0x4f929a;};'use strict';var _=require(_0xb9e2('0x0'));var moment=require(_0xb9e2('0x1'));exports[_0xb9e2('0x2')]=function(_0x5d17be){var _0x6c4f7d={'conditions':[]};_0x6c4f7d[_0xb9e2('0x3')]=_['startsWith'](_0x5d17be,_0xb9e2('0x4'))?'or':_0xb9e2('0x5');var _0x41b001=_0x5d17be[_0xb9e2('0x6')](_0xb9e2('0x7'),'')[_0xb9e2('0x6')]('[$or]','')[_0xb9e2('0x8')]('||');for(var _0x4cc691=0x0;_0x4cc691<_0x41b001['length'];_0x4cc691++){var _0x2cae6e=_0x41b001[_0x4cc691][_0xb9e2('0x8')](':=');var _0x34bc68=_0x2cae6e[0x0];var _0x1ed9e8=_0x2cae6e[_0xb9e2('0x9')](0x1);_0x1ed9e8[_0xb9e2('0xa')](function(_0x2d0e51){var _0x2cc63a=_0x2d0e51[_0xb9e2('0x8')]('[')[_0xb9e2('0xb')]();var _0x3aadb0=_0x2d0e51[_0xb9e2('0xc')](/\[(.*?)\]/g);_0x3aadb0[_0xb9e2('0xa')](function(_0x4549dd){var _0x49527b=_0x4549dd[_0xb9e2('0x8')]('[')[_0xb9e2('0xd')](function(_0x48f33f){return _0x48f33f[_0xb9e2('0xe')](']')>-0x1;})['map'](function(_0x56540b){return _0x56540b[_0xb9e2('0x8')](']')[0x0];})[0x0];_0x6c4f7d['conditions'][_0xb9e2('0xf')]({'field':_0x34bc68,'operator':_0x2cc63a,'value':_0x49527b});});});}return _0x6c4f7d;};exports[_0xb9e2('0x10')]=function(_0xbff517,_0x3849cf,_0x51b253){var _0x514636={};if(_0x3849cf===_0xb9e2('0x11')){if(_0x51b253[_0xb9e2('0x12')]==='$eq'){_0x51b253[_0xb9e2('0x12')]='$between';_0x51b253[_0xb9e2('0x13')]+=','+_0x51b253[_0xb9e2('0x13')];}else if(_[_0xb9e2('0x14')]([_0xb9e2('0x15'),_0xb9e2('0x16')],_0x51b253[_0xb9e2('0x12')])){_0x51b253[_0xb9e2('0x13')]=moment(_0x51b253['value'])[_0xb9e2('0x17')](0x1,_0xb9e2('0x18'))[_0xb9e2('0x19')](_0xb9e2('0x1a'));}}if(_0x51b253[_0xb9e2('0x1b')]){_0x3849cf=_0x51b253[_0xb9e2('0x1b')];_0x514636[_0xb9e2('0x1c')]=_0xb9e2('0x1d')+_0xbff517+'.'+_0x51b253[_0xb9e2('0x1e')]+_0xb9e2('0x1f')+_0x51b253[_0xb9e2('0x1b')]+')\x20'+parseOperator(_0x51b253['operator']);}else{_0x514636[_0xb9e2('0x1c')]=_0xbff517+'.'+_0x51b253[_0xb9e2('0x1e')]+'\x20'+parseOperator(_0x51b253[_0xb9e2('0x12')]);}if(_['includes']([_0xb9e2('0x20'),_0xb9e2('0x21')],_0x51b253[_0xb9e2('0x12')]))_0x514636[_0xb9e2('0x1c')]='('+_0x514636[_0xb9e2('0x1c')]+_0xb9e2('0x22')+_0xbff517+'.'+_0x51b253[_0xb9e2('0x1e')]+_0xb9e2('0x23');_0x514636['value']=parseValue(_0x3849cf,_0x51b253[_0xb9e2('0x12')],_0x51b253[_0xb9e2('0x13')]);return _0x514636;};function parseOperator(_0x413a40){var _0x3aac2f;switch(_0x413a40){case _0xb9e2('0x24'):_0x3aac2f=_0xb9e2('0x25');break;case'$notIn':_0x3aac2f=_0xb9e2('0x26');break;case _0xb9e2('0x27'):_0x3aac2f='=\x20?';break;case _0xb9e2('0x20'):_0x3aac2f='<>\x20?';break;case _0xb9e2('0x28'):case _0xb9e2('0x29'):case _0xb9e2('0x2a'):_0x3aac2f=_0xb9e2('0x2b');break;case _0xb9e2('0x2c'):_0x3aac2f=_0xb9e2('0x2d');break;case'$gt':_0x3aac2f=_0xb9e2('0x2e');break;case _0xb9e2('0x16'):_0x3aac2f='<=\x20?';break;case _0xb9e2('0x2f'):_0x3aac2f=_0xb9e2('0x30');break;case _0xb9e2('0x31'):_0x3aac2f='BETWEEN\x20?\x20AND\x20?';break;}return _0x3aac2f;}function parseValue(_0x1d7494,_0x5d402e,_0x4d0f45){var _0xa6e598={'start':undefined,'end':undefined};switch(_0x5d402e){case _0xb9e2('0x24'):case'$notIn':_0xa6e598[_0xb9e2('0x32')]=_0x4d0f45[_0xb9e2('0x8')](',');break;case'$substring':_0xa6e598[_0xb9e2('0x32')]='%'+_0x4d0f45+'%';break;case _0xb9e2('0x29'):_0xa6e598[_0xb9e2('0x32')]=_0x4d0f45+'%';break;case'$endsWith':_0xa6e598[_0xb9e2('0x32')]='%'+_0x4d0f45;break;case'$between':var _0x16fdec=_0x4d0f45[_0xb9e2('0x8')](',');var _0x4d0f45=_0x16fdec['shift']();var _0x45573e=_0x16fdec[_0xb9e2('0x33')]();if(_0x1d7494===_0xb9e2('0x11')){_0x4d0f45=moment(_0x4d0f45)[_0xb9e2('0x34')](0x0,!![])[_0xb9e2('0x19')]();_0x45573e=moment(_0x45573e)[_0xb9e2('0x34')](0x0,!![])['add'](0x17,_0xb9e2('0x35'))['add'](0x3b,_0xb9e2('0x36'))[_0xb9e2('0x17')](0x3b,_0xb9e2('0x37'))['format']();}_0xa6e598={'start':_0x4d0f45,'end':_0x45573e};break;default:_0xa6e598[_0xb9e2('0x32')]=_0x4d0f45;break;}return _0xa6e598;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index a3ed2d8..6f620e8 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 _0x8cc4=['isEmpty','forOwn','DATE','parse','format','$lte','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','sort','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','includes','push','join','lodash','sequelize','moment','fields','split','filters'];(function(_0x4aba66,_0x1d803d){var _0x3d7ebe=function(_0x37e689){while(--_0x37e689){_0x4aba66['push'](_0x4aba66['shift']());}};_0x3d7ebe(++_0x1d803d);}(_0x8cc4,0xf6));var _0x48cc=function(_0x24697b,_0x2eb072){_0x24697b=_0x24697b-0x0;var _0x585b99=_0x8cc4[_0x24697b];return _0x585b99;};'use strict';var _=require(_0x48cc('0x0'));var sequelize=require(_0x48cc('0x1'));var moment=require(_0x48cc('0x2'));var LIMIT_VALUE=0xfa;exports[_0x48cc('0x3')]=function(_0x5416ea){var _0x57decc=null;if(_0x5416ea){_0x57decc=_0x5416ea[_0x48cc('0x4')](',');}return _0x57decc;};exports[_0x48cc('0x5')]=function(_0xfbfd63,_0xfbf41f){var _0xb64c85={};if(!_[_0x48cc('0x6')](_0xfbfd63)){_[_0x48cc('0x7')](_0xfbfd63,function(_0x36a3a2,_0x3a8dd9){try{if(_0xfbf41f){var _0x17f363=_['find'](_0xfbf41f,{'name':_0x3a8dd9})||{};if(_0x17f363['type']===_0x48cc('0x8')&&_['isPlainObject'](_0x36a3a2)){var _0x1401f0=JSON[_0x48cc('0x9')](_0x36a3a2);var _0x41dc7d={'$gte':moment(moment(_0x1401f0['$gte'])['format']('YYYY-MM-DD'))['utc']()[_0x48cc('0xa')](),'$lte':moment(moment(_0x1401f0[_0x48cc('0xb')])[_0x48cc('0xa')](_0x48cc('0xc')))[_0x48cc('0xd')]()[_0x48cc('0xe')](0x1,'s')[_0x48cc('0xa')]()};_0xb64c85[_0x3a8dd9]=_0x41dc7d;}else if(_0x17f363[_0x48cc('0xf')]===_0x48cc('0x10')){_0xb64c85[_0x3a8dd9]=_0x36a3a2;}else{_0xb64c85[_0x3a8dd9]=_['isArray'](_0x36a3a2)?_0x36a3a2:JSON[_0x48cc('0x9')](_0x36a3a2);}}else{_0xb64c85[_0x3a8dd9]=_[_0x48cc('0x11')](_0x36a3a2)?_0x36a3a2:JSON[_0x48cc('0x9')](_0x36a3a2);}}catch(_0x237f51){_0xb64c85[_0x3a8dd9]=_0x36a3a2[_0x48cc('0x4')](',');}});}return _0xb64c85;};exports['limit']=function(_0x312877){_0x312877=parseInt(_0x312877,0xa);if(!_0x312877||_0x312877<0x0){_0x312877=LIMIT_VALUE;}return _0x312877;};exports['offset']=function(_0x34fab3){_0x34fab3=parseInt(_0x34fab3,0xa);if(!_0x34fab3||_0x34fab3<0x0){_0x34fab3=0x0;}return _0x34fab3;};exports[_0x48cc('0x12')]=function(_0x1f97c7){var _0x3e7953,_0x3aac40=null;if(_0x1f97c7){_0x3e7953=_0x1f97c7[_0x48cc('0x4')](',');_0x3aac40=_['map'](_0x3e7953,function(_0x225319){if(_0x225319[_0x48cc('0x13')]('-')===0x0){return[_0x225319===_0x48cc('0x14')?sequelize[_0x48cc('0x15')](sequelize[_0x48cc('0x16')](_0x48cc('0x14')),_0x48cc('0x17')):_0x225319[_0x48cc('0x18')](0x1),_0x48cc('0x19')];}else{return[_0x225319===_0x48cc('0x14')?sequelize[_0x48cc('0x15')](sequelize['col']('priority'),'unsigned'):_0x225319,_0x48cc('0x1a')];}});}return _0x3aac40;};exports[_0x48cc('0x1b')]=function(_0x1bf126,_0xe5076){if(_[_0x48cc('0x6')](_0x1bf126)){return _0x1bf126;}if(_[_0x48cc('0x11')](_0x1bf126)){for(var _0xca642d=0x0;_0xca642d<_0x1bf126[_0x48cc('0x1c')];_0xca642d+=0x1){_0x1bf126[_0xca642d]=this[_0x48cc('0x1b')](_0x1bf126[_0xca642d],_0xe5076);}return _0x1bf126;}if(!_[_0x48cc('0x1d')](_0x1bf126)){return _0x1bf126;}if(_[_0x48cc('0x1e')](_0xe5076)){_0xe5076=[_0xe5076];}if(!_[_0x48cc('0x11')](_0xe5076)){return _0x1bf126;}for(var _0x340b83=0x0;_0x340b83<_0xe5076['length'];_0x340b83+=0x1){_[_0x48cc('0x1f')](_0x1bf126,_0xe5076[_0x340b83]);}for(var _0x2fc2a7 in _0x1bf126){if(_0x1bf126[_0x48cc('0x20')](_0x2fc2a7)){_0x1bf126[_0x2fc2a7]=this[_0x48cc('0x1b')](_0x1bf126[_0x2fc2a7],_0xe5076);}}return _0x1bf126;};exports[_0x48cc('0x21')]=function(_0x2eae72){return _0x2eae72[_0x48cc('0x22')](RegExp(_0x48cc('0x23')))?!![]:![];};exports[_0x48cc('0x24')]=function(_0x3b4b10){return _0x3b4b10[_0x48cc('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x48cc('0x25')]=function(_0x4c8a25){var _0x151a7b=[];_0x4c8a25[_0x48cc('0x4')](/[ ,]+/)[_0x48cc('0x26')](function(_0x10bc8e){_0x10bc8e=_0x10bc8e['replace'](/([^:]")"+/g,'$1');_0x10bc8e='+'+_0x10bc8e+'*';if(_0x10bc8e[_0x48cc('0x27')]('@'))_0x10bc8e='\x22'+_0x10bc8e+'\x22';_0x151a7b[_0x48cc('0x28')](_0x10bc8e);});return _0x151a7b[_0x48cc('0x29')]('\x20');}; \ No newline at end of file +var _0x5b15=['format','name','uniqueid','isArray','map','priority','cast','unsigned','substr','DESC','col','ASC','isEmpty','omit','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','push','join','lodash','moment','fields','split','filters','find','type','DATE','isPlainObject','parse','YYYY-MM-DD','utc'];(function(_0x214624,_0x4dcf4a){var _0x4b52ff=function(_0x11a688){while(--_0x11a688){_0x214624['push'](_0x214624['shift']());}};_0x4b52ff(++_0x4dcf4a);}(_0x5b15,0x1e2));var _0x55b1=function(_0x380ca8,_0x4f3b17){_0x380ca8=_0x380ca8-0x0;var _0x456f29=_0x5b15[_0x380ca8];return _0x456f29;};'use strict';var _=require(_0x55b1('0x0'));var sequelize=require('sequelize');var moment=require(_0x55b1('0x1'));var LIMIT_VALUE=0xfa;exports[_0x55b1('0x2')]=function(_0x34302f){var _0x388eef=null;if(_0x34302f){_0x388eef=_0x34302f[_0x55b1('0x3')](',');}return _0x388eef;};exports[_0x55b1('0x4')]=function(_0x59c277,_0x2993ca){var _0x4c35d4={};if(!_['isEmpty'](_0x59c277)){_['forOwn'](_0x59c277,function(_0x493889,_0x3c7ed2){try{if(_0x2993ca){var _0x4030a6=_[_0x55b1('0x5')](_0x2993ca,{'name':_0x3c7ed2})||{};if(_0x4030a6[_0x55b1('0x6')]===_0x55b1('0x7')&&_[_0x55b1('0x8')](_0x493889)){var _0x117622=JSON[_0x55b1('0x9')](_0x493889);var _0x5de89f={'$gte':moment(moment(_0x117622['$gte'])['format'](_0x55b1('0xa')))[_0x55b1('0xb')]()[_0x55b1('0xc')](),'$lte':moment(moment(_0x117622['$lte'])[_0x55b1('0xc')](_0x55b1('0xa')))[_0x55b1('0xb')]()['subtract'](0x1,'s')[_0x55b1('0xc')]()};_0x4c35d4[_0x3c7ed2]=_0x5de89f;}else if(_0x4030a6[_0x55b1('0xd')]===_0x55b1('0xe')){_0x4c35d4[_0x3c7ed2]=_0x493889;}else{_0x4c35d4[_0x3c7ed2]=_[_0x55b1('0xf')](_0x493889)?_0x493889:JSON['parse'](_0x493889);}}else{_0x4c35d4[_0x3c7ed2]=_[_0x55b1('0xf')](_0x493889)?_0x493889:JSON[_0x55b1('0x9')](_0x493889);}}catch(_0x5c13e7){_0x4c35d4[_0x3c7ed2]=_0x493889[_0x55b1('0x3')](',');}});}return _0x4c35d4;};exports['limit']=function(_0x4cef29){_0x4cef29=parseInt(_0x4cef29,0xa);if(!_0x4cef29||_0x4cef29<0x0){_0x4cef29=LIMIT_VALUE;}return _0x4cef29;};exports['offset']=function(_0x213633){_0x213633=parseInt(_0x213633,0xa);if(!_0x213633||_0x213633<0x0){_0x213633=0x0;}return _0x213633;};exports['sort']=function(_0x31d4d8){var _0x247687,_0x127293=null;if(_0x31d4d8){_0x247687=_0x31d4d8['split'](',');_0x127293=_[_0x55b1('0x10')](_0x247687,function(_0x5800ad){if(_0x5800ad['indexOf']('-')===0x0){return[_0x5800ad===_0x55b1('0x11')?sequelize[_0x55b1('0x12')](sequelize['col'](_0x55b1('0x11')),_0x55b1('0x13')):_0x5800ad[_0x55b1('0x14')](0x1),_0x55b1('0x15')];}else{return[_0x5800ad==='priority'?sequelize[_0x55b1('0x12')](sequelize[_0x55b1('0x16')](_0x55b1('0x11')),_0x55b1('0x13')):_0x5800ad,_0x55b1('0x17')];}});}return _0x127293;};exports['omit']=function(_0x18be13,_0x2717a7){if(_[_0x55b1('0x18')](_0x18be13)){return _0x18be13;}if(_[_0x55b1('0xf')](_0x18be13)){for(var _0x22b3fb=0x0;_0x22b3fb<_0x18be13['length'];_0x22b3fb+=0x1){_0x18be13[_0x22b3fb]=this[_0x55b1('0x19')](_0x18be13[_0x22b3fb],_0x2717a7);}return _0x18be13;}if(!_[_0x55b1('0x1a')](_0x18be13)){return _0x18be13;}if(_[_0x55b1('0x1b')](_0x2717a7)){_0x2717a7=[_0x2717a7];}if(!_[_0x55b1('0xf')](_0x2717a7)){return _0x18be13;}for(var _0x25430b=0x0;_0x25430b<_0x2717a7['length'];_0x25430b+=0x1){_[_0x55b1('0x1c')](_0x18be13,_0x2717a7[_0x25430b]);}for(var _0x29aa83 in _0x18be13){if(_0x18be13[_0x55b1('0x1d')](_0x29aa83)){_0x18be13[_0x29aa83]=this['omit'](_0x18be13[_0x29aa83],_0x2717a7);}}return _0x18be13;};exports[_0x55b1('0x1e')]=function(_0x520ed2){return _0x520ed2[_0x55b1('0x1f')](RegExp(_0x55b1('0x20')))?!![]:![];};exports[_0x55b1('0x21')]=function(_0x5a9be5){return _0x5a9be5['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x55b1('0x22')]=function(_0x53be28){var _0x40473e=[];_0x53be28['split'](/[ ,]+/)[_0x55b1('0x23')](function(_0x3a6221){_0x3a6221=_0x3a6221['replace'](/([^:]")"+/g,'$1');_0x3a6221='+'+_0x3a6221+'*';if(_0x3a6221['includes']('@'))_0x3a6221='\x22'+_0x3a6221+'\x22';_0x40473e[_0x55b1('0x24')](_0x3a6221);});return _0x40473e[_0x55b1('0x25')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 3042ca1..3a2a351 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41c5=['moment','../mysqldb','production','set','public','test','appPath','join','root','use','json\x20replacer','toISOString','static','get','views','/server/views','engine','html','ejs','renderFile','view\x20engine','50mb','express','serve-favicon','cookie-parser','errorhandler','passport','cors'];(function(_0x233950,_0x4f00d7){var _0x158833=function(_0x349027){while(--_0x349027){_0x233950['push'](_0x233950['shift']());}};_0x158833(++_0x4f00d7);}(_0x41c5,0xda));var _0x541c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x41c5[_0x19950b];return _0x3c6b41;};'use strict';var express=require(_0x541c('0x0'));var favicon=require(_0x541c('0x1'));var bodyParser=require('body-parser');var methodOverride=require('method-override');var cookieParser=require(_0x541c('0x2'));var errorHandler=require(_0x541c('0x3'));var path=require('path');var passport=require(_0x541c('0x4'));var cors=require(_0x541c('0x5'));var moment=require(_0x541c('0x6'));var config=require('./environment');var db=require(_0x541c('0x7'))['db'];exports['default']=function(_0x21d1d1){var _0x58a7b0=_0x21d1d1['get']('env');if(_0x58a7b0===_0x541c('0x8')){_0x21d1d1[_0x541c('0x9')]('appPath',path['join'](config['root'],_0x541c('0xa')));}if(_0x58a7b0==='development'||_0x58a7b0===_0x541c('0xb')){_0x21d1d1['set'](_0x541c('0xc'),path[_0x541c('0xd')](config[_0x541c('0xe')],'client'));_0x21d1d1[_0x541c('0xf')](errorHandler());}_0x21d1d1[_0x541c('0x9')](_0x541c('0x10'),function(_0xe39891,_0x42ddf8){if(this[_0xe39891]instanceof Date){_0x42ddf8=this[_0xe39891][_0x541c('0x11')]()['split']('.')[0x0]+'Z';}return _0x42ddf8;});_0x21d1d1[_0x541c('0xf')](express[_0x541c('0x12')](_0x21d1d1[_0x541c('0x13')](_0x541c('0xc'))));_0x21d1d1[_0x541c('0x9')](_0x541c('0x14'),config[_0x541c('0xe')]+_0x541c('0x15'));_0x21d1d1[_0x541c('0x16')](_0x541c('0x17'),require(_0x541c('0x18'))[_0x541c('0x19')]);_0x21d1d1[_0x541c('0x9')](_0x541c('0x1a'),_0x541c('0x17'));_0x21d1d1[_0x541c('0xf')](bodyParser['urlencoded']({'limit':'50mb','extended':!![]}));_0x21d1d1[_0x541c('0xf')](bodyParser['json']({'limit':_0x541c('0x1b')}));_0x21d1d1['use'](cors());_0x21d1d1[_0x541c('0xf')](methodOverride());_0x21d1d1[_0x541c('0xf')](cookieParser());_0x21d1d1[_0x541c('0xf')](passport['initialize']());}; \ No newline at end of file +var _0xe42a=['set','appPath','join','development','test','root','use','static','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','method-override','cookie-parser','errorhandler','path','moment','../mysqldb','get','env','production'];(function(_0x340423,_0xc67494){var _0x12a33f=function(_0x263599){while(--_0x263599){_0x340423['push'](_0x340423['shift']());}};_0x12a33f(++_0xc67494);}(_0xe42a,0x15d));var _0xae42=function(_0x79e8a8,_0xbcbcf5){_0x79e8a8=_0x79e8a8-0x0;var _0x405b73=_0xe42a[_0x79e8a8];return _0x405b73;};'use strict';var express=require(_0xae42('0x0'));var favicon=require(_0xae42('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0xae42('0x2'));var cookieParser=require(_0xae42('0x3'));var errorHandler=require(_0xae42('0x4'));var path=require(_0xae42('0x5'));var passport=require('passport');var cors=require('cors');var moment=require(_0xae42('0x6'));var config=require('./environment');var db=require(_0xae42('0x7'))['db'];exports['default']=function(_0x407727){var _0x434ccc=_0x407727[_0xae42('0x8')](_0xae42('0x9'));if(_0x434ccc===_0xae42('0xa')){_0x407727[_0xae42('0xb')](_0xae42('0xc'),path[_0xae42('0xd')](config['root'],'public'));}if(_0x434ccc===_0xae42('0xe')||_0x434ccc===_0xae42('0xf')){_0x407727['set']('appPath',path['join'](config[_0xae42('0x10')],'client'));_0x407727[_0xae42('0x11')](errorHandler());}_0x407727[_0xae42('0xb')]('json\x20replacer',function(_0x3042be,_0x4db9b3){if(this[_0x3042be]instanceof Date){_0x4db9b3=this[_0x3042be]['toISOString']()['split']('.')[0x0]+'Z';}return _0x4db9b3;});_0x407727['use'](express[_0xae42('0x12')](_0x407727[_0xae42('0x8')]('appPath')));_0x407727[_0xae42('0xb')](_0xae42('0x13'),config[_0xae42('0x10')]+_0xae42('0x14'));_0x407727[_0xae42('0x15')](_0xae42('0x16'),require(_0xae42('0x17'))[_0xae42('0x18')]);_0x407727[_0xae42('0xb')](_0xae42('0x19'),'html');_0x407727[_0xae42('0x11')](bodyParser[_0xae42('0x1a')]({'limit':_0xae42('0x1b'),'extended':!![]}));_0x407727[_0xae42('0x11')](bodyParser[_0xae42('0x1c')]({'limit':_0xae42('0x1b')}));_0x407727[_0xae42('0x11')](cors());_0x407727[_0xae42('0x11')](methodOverride());_0x407727[_0xae42('0x11')](cookieParser());_0x407727[_0xae42('0x11')](passport[_0xae42('0x1d')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 57e3c16..1a64b16 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 _0x6b0b=['127.0.0.1','getFirstInterface','map','model','update','hex','getUuid','platform','licenseToken','test','win32','utf8','replace','hostname','macAddress','ipAddress','createHash','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','length','filter','family','IPv4','internal','concat','head','mac','address'];(function(_0x401ccd,_0x140815){var _0x5a57ad=function(_0x8ad698){while(--_0x8ad698){_0x401ccd['push'](_0x401ccd['shift']());}};_0x5a57ad(++_0x140815);}(_0x6b0b,0x144));var _0xb6b0=function(_0x20d81e,_0x4c4baf){_0x20d81e=_0x20d81e-0x0;var _0x273461=_0x6b0b[_0x20d81e];return _0x273461;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xb6b0('0x0'));var machine=require(_0xb6b0('0x1'));var exec=require(_0xb6b0('0x2'))[_0xb6b0('0x3')];var config=require(_0xb6b0('0x4'));function getInterfaces(){var _0x2545fb=[];var _0x12fd20=os[_0xb6b0('0x5')]();var _0x2f5ed3=_[_0xb6b0('0x6')](_['keys'](_0x12fd20));for(var _0x2bfe26=0x0;_0x2bfe26<_0x2f5ed3[_0xb6b0('0x7')];_0x2bfe26++){var _0x143de1=_0x12fd20[_0x2f5ed3[_0x2bfe26]][_0xb6b0('0x8')](function(_0x5bb394){return _0x5bb394[_0xb6b0('0x9')]===_0xb6b0('0xa')&&_0x5bb394[_0xb6b0('0xb')]===![];});_0x2545fb=_0x2545fb[_0xb6b0('0xc')](_0x143de1);}return _0x2545fb;}function getFirstInterface(){var _0x3dadcb=_[_0xb6b0('0xd')](getInterfaces());return{'macAddress':_0x3dadcb&&_0x3dadcb[_0xb6b0('0xe')]?_0x3dadcb[_0xb6b0('0xe')]:'00:00:00:00:00:00','ipAddress':_0x3dadcb&&_0x3dadcb[_0xb6b0('0xf')]?_0x3dadcb[_0xb6b0('0xf')]:_0xb6b0('0x10')};}exports[_0xb6b0('0x11')]=getFirstInterface;function getCPUhash(){var _0x5a4fcb=_[_0xb6b0('0x6')](os['cpus']()[_0xb6b0('0x12')](function(_0x49f08a){return _0x49f08a[_0xb6b0('0x13')];}))['join'](':');return crypto['createHash']('md5')[_0xb6b0('0x14')](_0x5a4fcb)['digest'](_0xb6b0('0x15'));}exports[_0xb6b0('0x16')]=function(){var _0x29de83=os[_0xb6b0('0x17')]();var _0x6d2402=/[0-9a-f-]{36}/;if(config[_0xb6b0('0x18')]&&_0x6d2402[_0xb6b0('0x19')](config['licenseToken'])){return config[_0xb6b0('0x18')];}else if(_0x29de83===_0xb6b0('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xb6b0('0x1b')})[_0xb6b0('0x1c')]('\x0d\x0a','');}else{var _0xe810f8=getFirstInterface();var _0xddd6d=getCPUhash();var _0x2461cc=_0xddd6d+'|'+os[_0xb6b0('0x1d')]()+'|'+_0xe810f8[_0xb6b0('0x1e')]+'|'+_0xe810f8[_0xb6b0('0x1f')];var _0x53a25f=crypto[_0xb6b0('0x20')]('md5')[_0xb6b0('0x14')](_0x2461cc)['digest'](_0xb6b0('0x15'));return _0x53a25f[_0xb6b0('0x21')](0x0,0x8)+'-'+_0x53a25f['substring'](0x8,0xc)+'-'+_0x53a25f[_0xb6b0('0x21')](0xc,0x10)+'-'+_0x53a25f['substring'](0x10,0x14)+'-'+_0x53a25f[_0xb6b0('0x21')](0x14);}}; \ No newline at end of file +var _0xf9fd=['join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','execSync','../environment','orderBy','length','filter','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus'];(function(_0x8bb633,_0x49a383){var _0x536bfb=function(_0x520db4){while(--_0x520db4){_0x8bb633['push'](_0x8bb633['shift']());}};_0x536bfb(++_0x49a383);}(_0xf9fd,0x118));var _0xdf9f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf9fd[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xdf9f('0x0'));var os=require('os');var crypto=require(_0xdf9f('0x1'));var machine=require(_0xdf9f('0x2'));var exec=require('child_process')[_0xdf9f('0x3')];var config=require(_0xdf9f('0x4'));function getInterfaces(){var _0x54c2db=[];var _0x42a5ea=os['networkInterfaces']();var _0x544f5a=_[_0xdf9f('0x5')](_['keys'](_0x42a5ea));for(var _0x2de026=0x0;_0x2de026<_0x544f5a[_0xdf9f('0x6')];_0x2de026++){var _0x482a4c=_0x42a5ea[_0x544f5a[_0x2de026]][_0xdf9f('0x7')](function(_0x2a0de2){return _0x2a0de2['family']===_0xdf9f('0x8')&&_0x2a0de2[_0xdf9f('0x9')]===![];});_0x54c2db=_0x54c2db['concat'](_0x482a4c);}return _0x54c2db;}function getFirstInterface(){var _0x135ad5=_[_0xdf9f('0xa')](getInterfaces());return{'macAddress':_0x135ad5&&_0x135ad5[_0xdf9f('0xb')]?_0x135ad5['mac']:_0xdf9f('0xc'),'ipAddress':_0x135ad5&&_0x135ad5[_0xdf9f('0xd')]?_0x135ad5[_0xdf9f('0xd')]:_0xdf9f('0xe')};}exports[_0xdf9f('0xf')]=getFirstInterface;function getCPUhash(){var _0x869706=_[_0xdf9f('0x5')](os[_0xdf9f('0x10')]()['map'](function(_0x1bc5ef){return _0x1bc5ef['model'];}))[_0xdf9f('0x11')](':');return crypto[_0xdf9f('0x12')](_0xdf9f('0x13'))[_0xdf9f('0x14')](_0x869706)[_0xdf9f('0x15')](_0xdf9f('0x16'));}exports[_0xdf9f('0x17')]=function(){var _0x5834cb=os[_0xdf9f('0x18')]();var _0x757c0b=/[0-9a-f-]{36}/;if(config[_0xdf9f('0x19')]&&_0x757c0b[_0xdf9f('0x1a')](config['licenseToken'])){return config[_0xdf9f('0x19')];}else if(_0x5834cb==='win32'){return exec(_0xdf9f('0x1b'),{'encoding':_0xdf9f('0x1c')})[_0xdf9f('0x1d')]('\x0d\x0a','');}else{var _0x2dd244=getFirstInterface();var _0x552b3b=getCPUhash();var _0x1a7f4c=_0x552b3b+'|'+os['hostname']()+'|'+_0x2dd244[_0xdf9f('0x1e')]+'|'+_0x2dd244[_0xdf9f('0x1f')];var _0x2bdf0c=crypto[_0xdf9f('0x12')](_0xdf9f('0x13'))[_0xdf9f('0x14')](_0x1a7f4c)[_0xdf9f('0x15')]('hex');return _0x2bdf0c[_0xdf9f('0x20')](0x0,0x8)+'-'+_0x2bdf0c[_0xdf9f('0x20')](0x8,0xc)+'-'+_0x2bdf0c['substring'](0xc,0x10)+'-'+_0x2bdf0c[_0xdf9f('0x20')](0x10,0x14)+'-'+_0x2bdf0c['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 65e0411..e4fecdf 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 _0xaf16=['data2','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','decryptString','days','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','catch','get','data1','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED'];(function(_0x289a1f,_0x1b4dc6){var _0x5a44ec=function(_0x341c20){while(--_0x341c20){_0x289a1f['push'](_0x289a1f['shift']());}};_0x5a44ec(++_0x1b4dc6);}(_0xaf16,0x1e2));var _0x6af1=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0xaf16[_0x19babd];return _0x314eaf;};'use strict';var util=require('util');var moment=require(_0x6af1('0x0'));var rp=require(_0x6af1('0x1'));var BPromise=require(_0x6af1('0x2'));var pkginfo=require(_0x6af1('0x3'))(module,_0x6af1('0x4'));var db=require(_0x6af1('0x5'))['db'];var encryptor=require(_0x6af1('0x6'));var hardware=require('./hardware');var logger=require(_0x6af1('0x7'))(_0x6af1('0x8'));var HOST=_0x6af1('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x11a43d){return new BPromise(function(_0x233bb2,_0x12123c){var _0x4dafe3=util[_0x6af1('0xa')](_0x6af1('0xb'),HOST,_0x11a43d,module['exports']['version']);if(oldToken){_0x4dafe3=util[_0x6af1('0xa')](_0x6af1('0xc'),HOST,_0x11a43d,module[_0x6af1('0xd')][_0x6af1('0x4')],oldToken);}var _0x1dcecf={'uri':_0x4dafe3,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x1dcecf)['then'](function(_0x2af396){_0x233bb2(_0x2af396);})[_0x6af1('0xe')](function(_0x3ce554){_0x12123c(_0x3ce554);});});}function manageLicense(_0x42e2e6,_0x3acabd){var _0x41be9d=_0x3acabd[_0x6af1('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x41be9d['data1']!==_0x42e2e6&&!_0x41be9d['data2']){oldToken=_0x41be9d[_0x6af1('0x10')];}httpRequest(_0x42e2e6)[_0x6af1('0x11')](function(_0x37d2d2){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x37d2d2[_0x6af1('0x12')]){isOldTokenSent=![];if(!_0x41be9d[_0x6af1('0x8')]&&_0x41be9d[_0x6af1('0x8')]!=_0x37d2d2[_0x6af1('0x8')]||_0x41be9d[_0x6af1('0x8')]&&_0x41be9d['data2']){logger[_0x6af1('0x13')](_0x6af1('0x14'));}if(_0x41be9d[_0x6af1('0x8')]&&!_0x41be9d['data2']&&_0x41be9d[_0x6af1('0x8')]!=_0x37d2d2[_0x6af1('0x8')]){logger['info'](_0x6af1('0x15'));}if(_0x41be9d['license']&&!_0x41be9d[_0x6af1('0x16')]&&_0x41be9d[_0x6af1('0x8')]==_0x37d2d2[_0x6af1('0x8')]){return _0x3acabd;}return _0x3acabd['update']({'data1':_0x42e2e6,'data2':null,'license':_0x37d2d2[_0x6af1('0x8')]});}else{if(_0x37d2d2[_0x6af1('0x8')]||_0x41be9d['license']){if(!_0x41be9d[_0x6af1('0x16')]){if(_0x41be9d[_0x6af1('0x10')]==_0x42e2e6){GRAY_PERIOD_REASON=_0x6af1('0x17');logger[_0x6af1('0x13')](_0x6af1('0x18'));}else{GRAY_PERIOD_REASON=_0x6af1('0x19');logger[_0x6af1('0x13')](_0x6af1('0x1a'),_0x41be9d[_0x6af1('0x10')],_0x42e2e6);}logger[_0x6af1('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x6af1('0x1b')](),moment()[_0x6af1('0xa')](_0x6af1('0x1c')));return _0x3acabd[_0x6af1('0x1d')]({'data2':encryptor[_0x6af1('0x1e')](moment()[_0x6af1('0xa')](_0x6af1('0x1c')))});}else{if(moment()['diff'](encryptor[_0x6af1('0x1f')](_0x41be9d[_0x6af1('0x16')]),_0x6af1('0x20'))>DAYS){logger[_0x6af1('0x13')]('DEMO\x20START\x20AT\x20%s',moment()[_0x6af1('0xa')](_0x6af1('0x1c')));isOldTokenSent=![];return _0x3acabd[_0x6af1('0x1d')]({'data1':_0x42e2e6,'data2':null,'license':null});}}}else{if(_0x41be9d[_0x6af1('0x10')]!=_0x42e2e6){logger['info'](_0x6af1('0x1a'),_0x41be9d['data1'],_0x42e2e6);return _0x3acabd[_0x6af1('0x1d')]({'data1':_0x42e2e6,'data2':null,'license':null});}}}return _0x3acabd;})['then'](function(_0x55ace3){_0x3acabd=_0x55ace3;})['catch'](function(_0x27ffe5){logger[_0x6af1('0x21')](_0x27ffe5[_0x6af1('0x22')]);})[_0x6af1('0x23')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x3acabd);},TIME);});}function defaultLicense(){var _0x500b14=hardware[_0x6af1('0x24')]();if(_0x500b14){return db[_0x6af1('0x25')][_0x6af1('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x500b14}})[_0x6af1('0x27')](function(_0x200f4c,_0x16fbbc){logger[_0x6af1('0x13')](_0x6af1('0x28'),_0x500b14);manageLicense(_0x500b14,_0x200f4c);})[_0x6af1('0xe')](function(_0x16fe9d){logger['error'](_0x16fe9d[_0x6af1('0x22')]);});}}exports[_0x6af1('0x29')]=defaultLicense; \ No newline at end of file +var _0x0cd4=['finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','get','data1','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','info','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','DEMO\x20START\x20AT\x20%s','catch','message'];(function(_0x7d093e,_0xf569ea){var _0x34432d=function(_0x3996f9){while(--_0x3996f9){_0x7d093e['push'](_0x7d093e['shift']());}};_0x34432d(++_0xf569ea);}(_0x0cd4,0xd4));var _0x40cd=function(_0x81d907,_0x44941d){_0x81d907=_0x81d907-0x0;var _0x359b3f=_0x0cd4[_0x81d907];return _0x359b3f;};'use strict';var util=require(_0x40cd('0x0'));var moment=require(_0x40cd('0x1'));var rp=require(_0x40cd('0x2'));var BPromise=require(_0x40cd('0x3'));var pkginfo=require(_0x40cd('0x4'))(module,_0x40cd('0x5'));var db=require(_0x40cd('0x6'))['db'];var encryptor=require(_0x40cd('0x7'));var hardware=require(_0x40cd('0x8'));var logger=require(_0x40cd('0x9'))(_0x40cd('0xa'));var HOST=_0x40cd('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x40c1b5){return new BPromise(function(_0x37d55f,_0x5cdbcc){var _0x24e897=util[_0x40cd('0xc')](_0x40cd('0xd'),HOST,_0x40c1b5,module[_0x40cd('0xe')][_0x40cd('0x5')]);if(oldToken){_0x24e897=util[_0x40cd('0xc')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x40c1b5,module['exports'][_0x40cd('0x5')],oldToken);}var _0x20df92={'uri':_0x24e897,'method':_0x40cd('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x20df92)[_0x40cd('0x10')](function(_0xf8eed2){_0x37d55f(_0xf8eed2);})['catch'](function(_0x40f0d9){_0x5cdbcc(_0x40f0d9);});});}function manageLicense(_0x3d21ea,_0x44474e){var _0x2a01e6=_0x44474e[_0x40cd('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x2a01e6[_0x40cd('0x12')]!==_0x3d21ea&&!_0x2a01e6[_0x40cd('0x13')]){oldToken=_0x2a01e6[_0x40cd('0x12')];}httpRequest(_0x3d21ea)[_0x40cd('0x10')](function(_0x702251){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x702251['active']){isOldTokenSent=![];if(!_0x2a01e6['license']&&_0x2a01e6[_0x40cd('0xa')]!=_0x702251['license']||_0x2a01e6[_0x40cd('0xa')]&&_0x2a01e6[_0x40cd('0x13')]){logger['info'](_0x40cd('0x14'));}if(_0x2a01e6['license']&&!_0x2a01e6[_0x40cd('0x13')]&&_0x2a01e6[_0x40cd('0xa')]!=_0x702251[_0x40cd('0xa')]){logger['info'](_0x40cd('0x15'));}if(_0x2a01e6[_0x40cd('0xa')]&&!_0x2a01e6[_0x40cd('0x13')]&&_0x2a01e6[_0x40cd('0xa')]==_0x702251[_0x40cd('0xa')]){return _0x44474e;}return _0x44474e[_0x40cd('0x16')]({'data1':_0x3d21ea,'data2':null,'license':_0x702251[_0x40cd('0xa')]});}else{if(_0x702251['license']||_0x2a01e6[_0x40cd('0xa')]){if(!_0x2a01e6[_0x40cd('0x13')]){if(_0x2a01e6[_0x40cd('0x12')]==_0x3d21ea){GRAY_PERIOD_REASON=_0x40cd('0x17');logger[_0x40cd('0x18')](_0x40cd('0x19'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x40cd('0x18')](_0x40cd('0x1a'),_0x2a01e6[_0x40cd('0x12')],_0x3d21ea);}logger[_0x40cd('0x18')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x40cd('0x1b')](),moment()[_0x40cd('0xc')](_0x40cd('0x1c')));return _0x44474e[_0x40cd('0x16')]({'data2':encryptor['encryptString'](moment()[_0x40cd('0xc')](_0x40cd('0x1c')))});}else{if(moment()[_0x40cd('0x1d')](encryptor[_0x40cd('0x1e')](_0x2a01e6['data2']),'days')>DAYS){logger[_0x40cd('0x18')](_0x40cd('0x1f'),moment()[_0x40cd('0xc')](_0x40cd('0x1c')));isOldTokenSent=![];return _0x44474e[_0x40cd('0x16')]({'data1':_0x3d21ea,'data2':null,'license':null});}}}else{if(_0x2a01e6[_0x40cd('0x12')]!=_0x3d21ea){logger[_0x40cd('0x18')](_0x40cd('0x1a'),_0x2a01e6[_0x40cd('0x12')],_0x3d21ea);return _0x44474e['update']({'data1':_0x3d21ea,'data2':null,'license':null});}}}return _0x44474e;})[_0x40cd('0x10')](function(_0x2eb564){_0x44474e=_0x2eb564;})[_0x40cd('0x20')](function(_0x1d0254){logger['error'](_0x1d0254[_0x40cd('0x21')]);})[_0x40cd('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x40cd('0x23')](),_0x44474e);},TIME);});}function defaultLicense(){var _0x43c43d=hardware['getUuid']();if(_0x43c43d){return db[_0x40cd('0x24')][_0x40cd('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x43c43d}})[_0x40cd('0x26')](function(_0x12549e,_0x1a24fa){logger[_0x40cd('0x18')](_0x40cd('0x27'),_0x43c43d);manageLicense(_0x43c43d,_0x12549e);})[_0x40cd('0x20')](function(_0x484faa){logger[_0x40cd('0x28')](_0x484faa['message']);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 2213e0d..808eaf8 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 _0xe389=['user','telephone','users','telephones','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','changed','disabled','message','User','findAll','role','sequelize','COUNT','admin'];(function(_0x42a571,_0x57321c){var _0x32afaf=function(_0x3318bb){while(--_0x3318bb){_0x42a571['push'](_0x42a571['shift']());}};_0x32afaf(++_0x57321c);}(_0xe389,0x1eb));var _0x9e38=function(_0x246d87,_0x4116fd){_0x246d87=_0x246d87-0x0;var _0x4ef605=_0xe389[_0x246d87];return _0x4ef605;};'use strict';var util=require(_0x9e38('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0x9e38('0x1'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9e38('0x2'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9e38('0x3'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9e38('0x4'),'machineUuid':hardware[_0x9e38('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x50a49c){return new BPromise(function(_0x552051,_0xed0105){return db[_0x9e38('0x6')][_0x9e38('0x7')](_[_0x9e38('0x8')](_0x50a49c,{'raw':!![],'where':{'id':0x1}}))[_0x9e38('0x9')](function(_0x86bcdd){return checkLicense(_0x86bcdd,null);})[_0x9e38('0x9')](function(_0x2845ce){_0x552051(_0x2845ce);return;})[_0x9e38('0xa')](function(_0x5abd25){_0xed0105(_0x5abd25);});});}function checkLicense(_0x22fef4,_0x3d19a0){if(!_0x22fef4){demoLicense[_0x9e38('0xb')]=_0x22fef4[_0x9e38('0xc')];return demoLicense;}try{var _0xda0a10=_0x3d19a0||_0x22fef4[_0x9e38('0xd')];if(_[_0x9e38('0xe')](_0xda0a10)){throw new Error(_0x9e38('0xf'));}var _0x79881b=_0x22fef4['data1'];var _0x33e1c5=_0x22fef4[_0x9e38('0x10')];var _0x41fbfb=_0x79881b[_0x9e38('0x11')]('-')[0x4];var _0xaf3392=_0x79881b['split']('-')[0x0];var _0x91e19f=encryptor[_0x9e38('0x12')](_0xda0a10,util[_0x9e38('0x13')](_0x9e38('0x14'),_0x41fbfb,_0x79881b,_0xaf3392));var _0x4641e8=JSON[_0x9e38('0x15')](_0x91e19f);_0x4641e8[_0x9e38('0x16')]=![];_0x4641e8[_0x9e38('0xb')]=_0x79881b;_0x4641e8[_0x9e38('0x17')]=hardware[_0x9e38('0x5')]();if(_0x33e1c5){var _0x97bf79=encryptor[_0x9e38('0x12')](_0x33e1c5);_0x4641e8[_0x9e38('0x18')]=_0x97bf79;_0x4641e8[_0x9e38('0x19')]=moment(_0x97bf79)[_0x9e38('0x1a')](0x7,_0x9e38('0x1b'))[_0x9e38('0x13')]();_0x4641e8['grayReason']=_0x4641e8[_0x9e38('0xb')]!=_0x4641e8[_0x9e38('0x17')]?_0x9e38('0x1c'):_0x9e38('0x1d');}return _0x4641e8;}catch(_0x134153){breakingLicense[_0x9e38('0xb')]=_0x22fef4['data1'];breakingLicense[_0x9e38('0x1e')]=_0x134153['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x93dc64,_0x209845){getLicense()[_0x9e38('0x9')](function(_0x5f20ca){return db[_0x9e38('0x1f')][_0x9e38('0x20')]({'attributes':[_0x9e38('0x21'),[db[_0x9e38('0x22')]['fn'](_0x9e38('0x23'),db[_0x9e38('0x22')]['col'](_0x9e38('0x21'))),'count']],'group':_0x9e38('0x21'),'where':{'role':{'$or':[_0x9e38('0x24'),_0x9e38('0x25'),_0x9e38('0x26')]}},'raw':!![]})[_0x9e38('0x9')](function(_0x4192b1){var _0x3e8b9f={'user':_0x5f20ca[_0x9e38('0x27')]||0x0,'telephone':_0x5f20ca[_0x9e38('0x28')]||0x0};_0x4192b1[_0x9e38('0x29')](function(_0x54c8a9){var _0x5cacba=_0x54c8a9[_0x9e38('0x21')]==='admin'?_0x9e38('0x25'):_0x54c8a9['role'];_0x3e8b9f[_0x5cacba]-=_0x54c8a9[_0x9e38('0x2a')];if(_0x3e8b9f[_0x5cacba]<0x0)_0x3e8b9f[_0x5cacba]=0x0;});_0x93dc64(_0x3e8b9f);return;});})[_0x9e38('0xa')](function(_0x482a61){_0x209845(_0x482a61);});});}function checkUserLimits(_0x206dc7){return new BPromise(function(_0x23812f,_0x54fa2f){getLimits()['then'](function(_0x4545c2){var _0x12c987=_[_0x9e38('0x2b')](_[_0x9e38('0x2c')](_0x206dc7,_0x9e38('0x21')),[_0x9e38('0x24'),'user',_0x9e38('0x26')]);var _0x3365e7=(_0x12c987[_0x9e38('0x24')]||0x0)+(_0x12c987[_0x9e38('0x25')]||0x0);var _0x44ea32=_0x12c987[_0x9e38('0x26')]||0x0;if(_0x3365e7>_0x4545c2[_0x9e38('0x25')])return _0x54fa2f(_0x9e38('0x2d'));if(_0x44ea32>_0x4545c2[_0x9e38('0x26')])return _0x54fa2f(_0x9e38('0x2e'));return _0x23812f();})[_0x9e38('0xa')](function(_0x6ab3e1){_0x54fa2f(_0x6ab3e1);});});}module[_0x9e38('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x4b24=['defaults','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','machineUuid','getUuid','gray','deadline','add','days','grayReason','changed','message','findAll','sequelize','col','role','count','admin','telephone','users','telephones','forEach','user','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','../../components/encryptor','../../mysqldb','Demo\x20license','2027-01-01T00:00:00.000Z','Breaking\x20license','License'];(function(_0xe4c712,_0x1e26d5){var _0x101962=function(_0x1bfc5a){while(--_0x1bfc5a){_0xe4c712['push'](_0xe4c712['shift']());}};_0x101962(++_0x1e26d5);}(_0x4b24,0x7d));var _0x44b2=function(_0x3f5bf8,_0x5514d2){_0x3f5bf8=_0x3f5bf8-0x0;var _0x2a912f=_0x4b24[_0x3f5bf8];return _0x2a912f;};'use strict';var util=require(_0x44b2('0x0'));var _=require(_0x44b2('0x1'));var moment=require(_0x44b2('0x2'));var BPromise=require(_0x44b2('0x3'));var hardware=require('./hardware');var encryptor=require(_0x44b2('0x4'));var db=require(_0x44b2('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x44b2('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x44b2('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x44b2('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x17695e){return new BPromise(function(_0x30f770,_0x1efcf5){return db[_0x44b2('0x9')]['find'](_[_0x44b2('0xa')](_0x17695e,{'raw':!![],'where':{'id':0x1}}))[_0x44b2('0xb')](function(_0x4ece5b){return checkLicense(_0x4ece5b,null);})['then'](function(_0x94b5a7){_0x30f770(_0x94b5a7);return;})[_0x44b2('0xc')](function(_0x551e0c){_0x1efcf5(_0x551e0c);});});}function checkLicense(_0x1a1fd7,_0x2c292e){if(!_0x1a1fd7){demoLicense[_0x44b2('0xd')]=_0x1a1fd7[_0x44b2('0xe')];return demoLicense;}try{var _0x3c1b5e=_0x2c292e||_0x1a1fd7['license'];if(_[_0x44b2('0xf')](_0x3c1b5e)){throw new Error(_0x44b2('0x10'));}var _0x9090d7=_0x1a1fd7[_0x44b2('0xe')];var _0x45e74c=_0x1a1fd7[_0x44b2('0x11')];var _0x2d698a=_0x9090d7[_0x44b2('0x12')]('-')[0x4];var _0x50a610=_0x9090d7['split']('-')[0x0];var _0x763f10=encryptor[_0x44b2('0x13')](_0x3c1b5e,util[_0x44b2('0x14')]('%s:%s:%s',_0x2d698a,_0x9090d7,_0x50a610));var _0x3120ec=JSON[_0x44b2('0x15')](_0x763f10);_0x3120ec[_0x44b2('0x16')]=![];_0x3120ec[_0x44b2('0xd')]=_0x9090d7;_0x3120ec[_0x44b2('0x17')]=hardware[_0x44b2('0x18')]();if(_0x45e74c){var _0x4c095d=encryptor[_0x44b2('0x13')](_0x45e74c);_0x3120ec[_0x44b2('0x19')]=_0x4c095d;_0x3120ec[_0x44b2('0x1a')]=moment(_0x4c095d)[_0x44b2('0x1b')](0x7,_0x44b2('0x1c'))[_0x44b2('0x14')]();_0x3120ec[_0x44b2('0x1d')]=_0x3120ec['uuid']!=_0x3120ec['machineUuid']?_0x44b2('0x1e'):'disabled';}return _0x3120ec;}catch(_0x53fd86){breakingLicense[_0x44b2('0xd')]=_0x1a1fd7[_0x44b2('0xe')];breakingLicense['message']=_0x53fd86[_0x44b2('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x218a38,_0x319f04){getLicense()[_0x44b2('0xb')](function(_0x1935a8){return db['User'][_0x44b2('0x20')]({'attributes':['role',[db[_0x44b2('0x21')]['fn']('COUNT',db[_0x44b2('0x21')][_0x44b2('0x22')](_0x44b2('0x23'))),_0x44b2('0x24')]],'group':_0x44b2('0x23'),'where':{'role':{'$or':[_0x44b2('0x25'),'user',_0x44b2('0x26')]}},'raw':!![]})[_0x44b2('0xb')](function(_0x18a302){var _0x4d32dc={'user':_0x1935a8[_0x44b2('0x27')]||0x0,'telephone':_0x1935a8[_0x44b2('0x28')]||0x0};_0x18a302[_0x44b2('0x29')](function(_0x412364){var _0x314a07=_0x412364[_0x44b2('0x23')]===_0x44b2('0x25')?_0x44b2('0x2a'):_0x412364[_0x44b2('0x23')];_0x4d32dc[_0x314a07]-=_0x412364[_0x44b2('0x24')];if(_0x4d32dc[_0x314a07]<0x0)_0x4d32dc[_0x314a07]=0x0;});_0x218a38(_0x4d32dc);return;});})['catch'](function(_0x581f02){_0x319f04(_0x581f02);});});}function checkUserLimits(_0x12660a){return new BPromise(function(_0x103f72,_0x4a0b41){getLimits()[_0x44b2('0xb')](function(_0x3c2f7e){var _0x2f405e=_['pick'](_['countBy'](_0x12660a,_0x44b2('0x23')),['admin',_0x44b2('0x2a'),'telephone']);var _0x734b51=(_0x2f405e[_0x44b2('0x25')]||0x0)+(_0x2f405e[_0x44b2('0x2a')]||0x0);var _0x15f528=_0x2f405e[_0x44b2('0x26')]||0x0;if(_0x734b51>_0x3c2f7e[_0x44b2('0x2a')])return _0x4a0b41('License\x20limit\x20reached\x20for\x20users');if(_0x15f528>_0x3c2f7e['telephone'])return _0x4a0b41(_0x44b2('0x2b'));return _0x103f72();})[_0x44b2('0xc')](function(_0x2141db){_0x4a0b41(_0x2141db);});});}module[_0x44b2('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 7b7945c..e454a50 100644 --- a/server/config/local.env.js +++ b/server/config/local.env.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05c2=['http://localhost:9000','app-id','secret','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05c2,0x1ab));var _0x205c=function(_0x24a873,_0x50a107){_0x24a873=_0x24a873-0x0;var _0x5d10b7=_0x05c2[_0x24a873];return _0x5d10b7;};'use strict';module[_0x205c('0x0')]={'DOMAIN':_0x205c('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x205c('0x2'),'GOOGLE_SECRET':_0x205c('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x7269=['myappanuglar-secret','exports','http://localhost:9000'];(function(_0xd9fc62,_0x338164){var _0x5cb280=function(_0x1a2b28){while(--_0x1a2b28){_0xd9fc62['push'](_0xd9fc62['shift']());}};_0x5cb280(++_0x338164);}(_0x7269,0x76));var _0x9726=function(_0xe150c,_0x3d0e26){_0xe150c=_0xe150c-0x0;var _0x403e98=_0x7269[_0xe150c];return _0x403e98;};'use strict';module[_0x9726('0x0')]={'DOMAIN':_0x9726('0x1'),'SESSION_SECRET':_0x9726('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index b82a9cd..e12ec63 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0878=['toUpperCase','exports','Logger','transports','File','%s-%s','error','info','env','debugLevel','moment','winston','util','INFO','join','/var','format','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level'];(function(_0x5c1222,_0x5161bc){var _0x495e2c=function(_0x46c3e0){while(--_0x46c3e0){_0x5c1222['push'](_0x5c1222['shift']());}};_0x495e2c(++_0x5161bc);}(_0x0878,0x12a));var _0x8087=function(_0x3feea9,_0x1a938f){_0x3feea9=_0x3feea9-0x0;var _0x39c3bc=_0x0878[_0x3feea9];return _0x39c3bc;};'use strict';var moment=require(_0x8087('0x0'));var winston=require(_0x8087('0x1'));var util=require(_0x8087('0x2'));var path=require('path');var debugLevel=_0x8087('0x3');function filename(_0x17984e,_0x318004){return path[_0x8087('0x4')](_0x8087('0x5'),'log','xcally',util[_0x8087('0x6')](_0x8087('0x7'),_0x17984e,_0x318004));}function formatter(_0x4b5709,_0x2112c8){_0x2112c8['message']=_0x2112c8[_0x8087('0x8')]['replace'](/@@{/g,_0x8087('0x9'))[_0x8087('0xa')](/}@@/g,_0x8087('0xb'))[_0x8087('0xa')](/@{/g,'{{')[_0x8087('0xa')](/}@/g,'}}');return util[_0x8087('0x6')](_0x8087('0xc'),moment()[_0x8087('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),_0x2112c8[_0x8087('0xd')][_0x8087('0xe')](),_0x4b5709,_0x2112c8['message']);}module[_0x8087('0xf')]=function(_0x25f1b8){return new winston[(_0x8087('0x10'))]({'transports':[new winston[(_0x8087('0x11'))][(_0x8087('0x12'))]({'name':util[_0x8087('0x6')](_0x8087('0x13'),_0x25f1b8,_0x8087('0x14')),'filename':filename(_0x25f1b8,'error'),'level':_0x8087('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5ab8eb){return formatter(_0x25f1b8,_0x5ab8eb);}}),new winston[(_0x8087('0x11'))][(_0x8087('0x12'))]({'name':util['format']('%s-%s',_0x25f1b8,_0x8087('0x15')),'filename':filename(_0x25f1b8,'info'),'level':_0x8087('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x48e9f7){return formatter(_0x25f1b8,_0x48e9f7);}}),new winston[(_0x8087('0x11'))]['Console']({'level':process[_0x8087('0x16')][_0x8087('0x17')]||debugLevel,'json':![],'formatter':function(_0x29b40a){return formatter(_0x25f1b8,_0x29b40a);}})]});}; \ No newline at end of file +var _0x334d=['moment','winston','util','path','INFO','join','log','xcally','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console'];(function(_0x2f559a,_0x2ac955){var _0x228437=function(_0x22a5a2){while(--_0x22a5a2){_0x2f559a['push'](_0x2f559a['shift']());}};_0x228437(++_0x2ac955);}(_0x334d,0x1a9));var _0xd334=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x334d[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xd334('0x0'));var winston=require(_0xd334('0x1'));var util=require(_0xd334('0x2'));var path=require(_0xd334('0x3'));var debugLevel=_0xd334('0x4');function filename(_0x5673ee,_0xcb81f9){return path[_0xd334('0x5')]('/var',_0xd334('0x6'),_0xd334('0x7'),util[_0xd334('0x8')](_0xd334('0x9'),_0x5673ee,_0xcb81f9));}function formatter(_0x1c7b46,_0x3a35b5){_0x3a35b5[_0xd334('0xa')]=_0x3a35b5['message'][_0xd334('0xb')](/@@{/g,'{{{')[_0xd334('0xb')](/}@@/g,_0xd334('0xc'))['replace'](/@{/g,'{{')[_0xd334('0xb')](/}@/g,'}}');return util['format'](_0xd334('0xd'),moment()[_0xd334('0x8')](_0xd334('0xe')),_0x3a35b5[_0xd334('0xf')][_0xd334('0x10')](),_0x1c7b46,_0x3a35b5['message']);}module[_0xd334('0x11')]=function(_0x2d24e7){return new winston[(_0xd334('0x12'))]({'transports':[new winston[(_0xd334('0x13'))][(_0xd334('0x14'))]({'name':util[_0xd334('0x8')](_0xd334('0x15'),_0x2d24e7,_0xd334('0x16')),'filename':filename(_0x2d24e7,'error'),'level':_0xd334('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x388a4c){return formatter(_0x2d24e7,_0x388a4c);}}),new winston[(_0xd334('0x13'))]['File']({'name':util['format'](_0xd334('0x15'),_0x2d24e7,'info'),'filename':filename(_0x2d24e7,_0xd334('0x17')),'level':_0xd334('0x17'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x56525d){return formatter(_0x2d24e7,_0x56525d);}}),new winston[(_0xd334('0x13'))][(_0xd334('0x18'))]({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0x45eb51){return formatter(_0x2d24e7,_0x45eb51);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 4090925..f0eed0d 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 _0x2401=['../../services/routing/index.js','xdr','path','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2401,0x1af));var _0x1240=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2401[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x1240('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x1240('0x1')](__dirname,_0x1240('0x2'))},{'name':_0x1240('0x3'),'script':path[_0x1240('0x1')](__dirname,_0x1240('0x4'))},{'name':_0x1240('0x5'),'script':path[_0x1240('0x1')](__dirname,'../../services/agi/index.js')},{'name':_0x1240('0x6'),'script':path[_0x1240('0x1')](__dirname,_0x1240('0x7'))},{'name':_0x1240('0x8'),'script':path[_0x1240('0x1')](__dirname,_0x1240('0x9'))},{'name':_0x1240('0xa'),'script':path['join'](__dirname,'../../services/xdr/index.js')}]};module['exports']=config; \ No newline at end of file +var _0x3dcd=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','path','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js'];(function(_0x38d428,_0x58a778){var _0xf5dcd5=function(_0x579daf){while(--_0x579daf){_0x38d428['push'](_0x38d428['shift']());}};_0xf5dcd5(++_0x58a778);}(_0x3dcd,0xc5));var _0xd3dc=function(_0x23129b,_0x2d13ae){_0x23129b=_0x23129b-0x0;var _0x3b2fe9=_0x3dcd[_0x23129b];return _0x3b2fe9;};'use strict';var path=require(_0xd3dc('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xd3dc('0x1')](__dirname,_0xd3dc('0x2'))},{'name':_0xd3dc('0x3'),'script':path[_0xd3dc('0x1')](__dirname,_0xd3dc('0x4'))},{'name':_0xd3dc('0x5'),'script':path['join'](__dirname,_0xd3dc('0x6'))},{'name':'email','script':path[_0xd3dc('0x1')](__dirname,_0xd3dc('0x7'))},{'name':_0xd3dc('0x8'),'script':path[_0xd3dc('0x1')](__dirname,_0xd3dc('0x9'))},{'name':_0xd3dc('0xa'),'script':path[_0xd3dc('0x1')](__dirname,'../../services/xdr/index.js')}]};module[_0xd3dc('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 1253d18..0131e4f 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 _0x53ec=['connected','then','stop','disconnect','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect'];(function(_0xcc0c27,_0x1f26ae){var _0x4cf1d4=function(_0x3c8862){while(--_0x3c8862){_0xcc0c27['push'](_0xcc0c27['shift']());}};_0x4cf1d4(++_0x1f26ae);}(_0x53ec,0x192));var _0xc53e=function(_0x25483f,_0x43852f){_0x25483f=_0x25483f-0x0;var _0x220d13=_0x53ec[_0x25483f];return _0x220d13;};'use strict';var pm2=require(_0xc53e('0x0'));var BPromise=require(_0xc53e('0x1'));var config=require(_0xc53e('0x2'));function connect(){return new BPromise(function(_0x476d3a,_0x1b04cc){return pm2[_0xc53e('0x3')](function(_0x51c435){if(_0x51c435){return _0x1b04cc(_0x51c435);}return _0x476d3a(_0xc53e('0x4'));});});};exports['start']=function(_0x2b90f6){return connect()[_0xc53e('0x5')](function(){return new BPromise(function(_0x4a9c59,_0x2f1414){return pm2['start'](_0x2b90f6,function(_0x41a9e8,_0x2de88b){if(_0x41a9e8){return _0x2f1414(_0x41a9e8);}pm2['disconnect']();return _0x4a9c59(_0x2de88b);});});});};exports[_0xc53e('0x6')]=function(_0x1ac6c0){return connect()[_0xc53e('0x5')](function(){return new BPromise(function(_0x2cb51d,_0xd9612){return pm2[_0xc53e('0x6')](_0x1ac6c0,function(_0xd82002,_0x361e9d){if(_0xd82002){return _0xd9612(_0xd82002);}pm2[_0xc53e('0x7')]();return _0x2cb51d(_0x361e9d);});});});};exports['restart']=function(_0x57e818){return connect()[_0xc53e('0x5')](function(){return new BPromise(function(_0x5a2da7,_0x54e3ba){return pm2[_0xc53e('0x8')](_0x57e818,function(_0x9ffbcb,_0x863fa){if(_0x9ffbcb){return _0x54e3ba(_0x9ffbcb);}pm2[_0xc53e('0x7')]();return _0x5a2da7(_0x863fa);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x1c06cd,_0x19a772){return pm2[_0xc53e('0x9')](function(_0x3d2e17,_0x358ef3){if(_0x3d2e17){return _0x19a772(_0x3d2e17);}pm2[_0xc53e('0x7')]();return _0x1c06cd(_0x358ef3);});});});};exports[_0xc53e('0xa')]=function(_0x19c0d1){return connect()[_0xc53e('0x5')](function(){return new BPromise(function(_0x2ad6eb,_0x5b0a88){return pm2[_0xc53e('0xa')](_0x19c0d1,function(_0x191567,_0x535cd4){if(_0x191567){return _0x5b0a88(_0x191567);}pm2[_0xc53e('0x7')]();return _0x2ad6eb(_0x535cd4);});});});};exports[_0xc53e('0xb')]=function(_0x270c78){return connect()[_0xc53e('0x5')](function(){return new BPromise(function(_0x2d4ebb,_0x3b550e){return pm2['delete'](_0x270c78,function(_0x546fab,_0x35b7b2){if(_0x546fab){return _0x3b550e(_0x546fab);}pm2[_0xc53e('0x7')]();return _0x2d4ebb(_0x35b7b2);});});});};exports[_0xc53e('0xc')]=function(){return connect()[_0xc53e('0x5')](function(){return new BPromise(function(_0x20066e,_0x2cfe2b){return pm2[_0xc53e('0xc')](function(_0x25702b){if(_0x25702b){return _0x2cfe2b(_0x25702b);}return _0x20066e(_0xc53e('0xd'));});});});}; \ No newline at end of file +var _0x76ed=['start','disconnect','stop','restart','then','list','describe','dump','saved','pm2','bluebird','connect','connected'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x76ed,0x1d0));var _0xd76e=function(_0x4aba66,_0x1d803d){_0x4aba66=_0x4aba66-0x0;var _0x3d7ebe=_0x76ed[_0x4aba66];return _0x3d7ebe;};'use strict';var pm2=require(_0xd76e('0x0'));var BPromise=require(_0xd76e('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x467bd5,_0x351dfa){return pm2[_0xd76e('0x2')](function(_0x355fc0){if(_0x355fc0){return _0x351dfa(_0x355fc0);}return _0x467bd5(_0xd76e('0x3'));});});};exports[_0xd76e('0x4')]=function(_0x485b78){return connect()['then'](function(){return new BPromise(function(_0x2e2320,_0x13c9cc){return pm2[_0xd76e('0x4')](_0x485b78,function(_0xb3682c,_0x3e4c93){if(_0xb3682c){return _0x13c9cc(_0xb3682c);}pm2[_0xd76e('0x5')]();return _0x2e2320(_0x3e4c93);});});});};exports[_0xd76e('0x6')]=function(_0x249dff){return connect()['then'](function(){return new BPromise(function(_0xe7de14,_0x35f986){return pm2[_0xd76e('0x6')](_0x249dff,function(_0x2037d7,_0x5df681){if(_0x2037d7){return _0x35f986(_0x2037d7);}pm2[_0xd76e('0x5')]();return _0xe7de14(_0x5df681);});});});};exports[_0xd76e('0x7')]=function(_0x4e0193){return connect()[_0xd76e('0x8')](function(){return new BPromise(function(_0x807b29,_0x7aba9a){return pm2['restart'](_0x4e0193,function(_0x5a173f,_0x2fc119){if(_0x5a173f){return _0x7aba9a(_0x5a173f);}pm2['disconnect']();return _0x807b29(_0x2fc119);});});});};exports['list']=function(){return connect()[_0xd76e('0x8')](function(){return new BPromise(function(_0x2ea3a1,_0x843bff){return pm2[_0xd76e('0x9')](function(_0x36013f,_0x1dbfe0){if(_0x36013f){return _0x843bff(_0x36013f);}pm2['disconnect']();return _0x2ea3a1(_0x1dbfe0);});});});};exports[_0xd76e('0xa')]=function(_0x74ad97){return connect()[_0xd76e('0x8')](function(){return new BPromise(function(_0x516292,_0xca992){return pm2['describe'](_0x74ad97,function(_0x263475,_0x54cede){if(_0x263475){return _0xca992(_0x263475);}pm2[_0xd76e('0x5')]();return _0x516292(_0x54cede);});});});};exports['delete']=function(_0x59dade){return connect()['then'](function(){return new BPromise(function(_0x210e4b,_0xcaa115){return pm2['delete'](_0x59dade,function(_0x13a9f9,_0x3a48eb){if(_0x13a9f9){return _0xcaa115(_0x13a9f9);}pm2[_0xd76e('0x5')]();return _0x210e4b(_0x3a48eb);});});});};exports['dump']=function(){return connect()[_0xd76e('0x8')](function(){return new BPromise(function(_0x355edc,_0x191c4d){return pm2[_0xd76e('0xb')](function(_0x215618){if(_0x215618){return _0x191c4d(_0x215618);}return _0x355edc(_0xd76e('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index b109899..8054bba 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 _0xcbfa=['../../config/environment','../../mysqldb','redis','localhost','find','then','ChatInteraction','findAll','subtract','minutes','map','info','update','system','timeout','format','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','util'];(function(_0x1aeade,_0x1d1933){var _0x50690c=function(_0xb931ba){while(--_0xb931ba){_0x1aeade['push'](_0x1aeade['shift']());}};_0x50690c(++_0x1d1933);}(_0xcbfa,0x15d));var _0xacbf=function(_0x52bbc9,_0xb342e0){_0x52bbc9=_0x52bbc9-0x0;var _0x5909d0=_0xcbfa[_0x52bbc9];return _0x5909d0;};'use strict';var _=require('lodash');var moment=require(_0xacbf('0x0'));var Redis=require('ioredis');var util=require(_0xacbf('0x1'));var config=require(_0xacbf('0x2'));var db=require(_0xacbf('0x3'))['db'];var logger=require('../logger')('schedule');config['redis']=_['defaults'](config[_0xacbf('0x4')],{'host':_0xacbf('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xacbf('0x4')]));function closeInteractions(){var _0x270349=0x0;var _0x407632=[];return db['Setting'][_0xacbf('0x6')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xacbf('0x7')](function(_0xc6c089){_0x270349=_0xc6c089['chatTimeout'];if(_0x270349){return db[_0xacbf('0x8')][_0xacbf('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xacbf('0xa')](_0xc6c089['chatTimeout'],_0xacbf('0xb'))}}});}else{return[];}})['then'](function(_0x57e0ba){if(_0x57e0ba&&_0x57e0ba['length']){_0x407632=_[_0xacbf('0xc')](_0x57e0ba||[],'id');logger[_0xacbf('0xd')]('[CHAT]\x20Interactions\x20to\x20close:',_0x407632['join']());return db[_0xacbf('0x8')][_0xacbf('0xe')]({'closeReason':_0xacbf('0xf'),'disposition':_0xacbf('0x10'),'closed':!![],'closedAt':moment()[_0xacbf('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x407632}});}})['then'](function(){if(_0x407632&&_0x407632[_0xacbf('0x12')]){logger[_0xacbf('0xd')](_0xacbf('0x13'),_0x407632[_0xacbf('0x14')]());for(var _0xc68cc1=0x0;_0xc68cc1<_0x407632['length'];_0xc68cc1++){io[_0xacbf('0x15')](_0xacbf('0x16'),{'id':_0x407632[_0xc68cc1],'closed':!![]});}}})[_0xacbf('0x17')](function(_0xb83359){logger['error'](_0xacbf('0x18'),_0xb83359?util[_0xacbf('0x19')](_0xb83359,{'showHidden':![],'depth':null}):'');});}exports[_0xacbf('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa66f=['findAll','lastMsgAt','subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','start','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xa66f,0x1e1));var _0xfa66=function(_0x175cbb,_0x25a77c){_0x175cbb=_0x175cbb-0x0;var _0x84fd88=_0xa66f[_0x175cbb];return _0x84fd88;};'use strict';var _=require(_0xfa66('0x0'));var moment=require(_0xfa66('0x1'));var Redis=require(_0xfa66('0x2'));var util=require(_0xfa66('0x3'));var config=require(_0xfa66('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0xfa66('0x5'))(_0xfa66('0x6'));config[_0xfa66('0x7')]=_[_0xfa66('0x8')](config[_0xfa66('0x7')],{'host':_0xfa66('0x9'),'port':0x18eb});var io=require(_0xfa66('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x3dcd4c=0x0;var _0x37956b=[];return db[_0xfa66('0xb')]['find']({'raw':!![],'attributes':['id',_0xfa66('0xc')],'where':{'id':0x1}})[_0xfa66('0xd')](function(_0x8db50a){_0x3dcd4c=_0x8db50a[_0xfa66('0xc')];if(_0x3dcd4c){return db[_0xfa66('0xe')][_0xfa66('0xf')]({'raw':!![],'attributes':['id',_0xfa66('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xfa66('0x11')](_0x8db50a['chatTimeout'],_0xfa66('0x12'))}}});}else{return[];}})[_0xfa66('0xd')](function(_0x42dedd){if(_0x42dedd&&_0x42dedd[_0xfa66('0x13')]){_0x37956b=_[_0xfa66('0x14')](_0x42dedd||[],'id');logger['info'](_0xfa66('0x15'),_0x37956b[_0xfa66('0x16')]());return db[_0xfa66('0xe')][_0xfa66('0x17')]({'closeReason':_0xfa66('0x18'),'disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x37956b}});}})['then'](function(){if(_0x37956b&&_0x37956b[_0xfa66('0x13')]){logger[_0xfa66('0x19')](_0xfa66('0x1a'),_0x37956b['join']());for(var _0x1840a5=0x0;_0x1840a5<_0x37956b[_0xfa66('0x13')];_0x1840a5++){io[_0xfa66('0x1b')](_0xfa66('0x1c'),{'id':_0x37956b[_0x1840a5],'closed':!![]});}}})[_0xfa66('0x1d')](function(_0x225dda){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x225dda?util['inspect'](_0x225dda,{'showHidden':![],'depth':null}):'');});}exports[_0xfa66('0x1e')]=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 b1fd1a9..b40dac5 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 _0x2ca8=['Schedule','MailServerOut','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','cron','active','isBetween','endAt','add','start','add\x20cron','startAt','update\x20cron','stop\x20cron','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','email','service','MailAccount','Smtp','host','secure','auth','user','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','status','message','attachments','text','stringify','Sent','sendIfEmpty','info','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','runReport'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x2ca8,0x6d));var _0x82ca=function(_0x4c1a53,_0x1ff473){_0x4c1a53=_0x4c1a53-0x0;var _0x1b025b=_0x2ca8[_0x4c1a53];return _0x1b025b;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x82ca('0x0'));var _=require(_0x82ca('0x1'));var moment=require(_0x82ca('0x2'));var CronJobManager=require(_0x82ca('0x3'));var jayson=require(_0x82ca('0x4'));var BPromise=require(_0x82ca('0x5'));var logger=require(_0x82ca('0x6'))('schedule');var db=require(_0x82ca('0x7'))['db'];var analyticCustomReportController=require(_0x82ca('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x82ca('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xd0c499,_0x1b0519){return function(){logger['info'](_0x82ca('0xa'),_0xd0c499[_0x82ca('0xb')]);var _0x12e444=!![];var _0x4ae986={'tls':{'rejectUnauthorized':![]}};if(_0xd0c499['MailAccount']['Smtp']['service']){_0x4ae986[_0x82ca('0xc')]=_0xd0c499[_0x82ca('0xd')][_0x82ca('0xe')][_0x82ca('0xc')];}else{_0x4ae986[_0x82ca('0xf')]=_0xd0c499[_0x82ca('0xd')][_0x82ca('0xe')][_0x82ca('0xf')];_0x4ae986['port']=_0xd0c499[_0x82ca('0xd')][_0x82ca('0xe')]['port'];_0x4ae986[_0x82ca('0x10')]=_0xd0c499[_0x82ca('0xd')]['Smtp'][_0x82ca('0x10')];}if(_0xd0c499[_0x82ca('0xd')][_0x82ca('0xe')]['authentication']){_0x4ae986[_0x82ca('0x11')]={'user':_0xd0c499[_0x82ca('0xd')]['Smtp'][_0x82ca('0x12')],'pass':_0xd0c499[_0x82ca('0xd')][_0x82ca('0xe')]['pass']};}var _0x5f31aa={'account':_0x4ae986,'message':{'from':util[_0x82ca('0x13')](_0x82ca('0x14'),_0xd0c499[_0x82ca('0xd')]['name'],_0xd0c499[_0x82ca('0xd')][_0x82ca('0xb')]||_0xd0c499['MailAccount'][_0x82ca('0xe')][_0x82ca('0x12')]),'to':_0xd0c499[_0x82ca('0xb')],'cc':_0xd0c499['cc'],'bcc':_0xd0c499[_0x82ca('0x15')],'subject':util[_0x82ca('0x13')](_0x82ca('0x16'),_0x1b0519[_0x82ca('0x17')],_0xd0c499[_0x82ca('0x18')],_0xd0c499[_0x82ca('0x19')])}};var _0xd2bbea=path[_0x82ca('0x1a')](__dirname,_0x82ca('0x1b'));var _0x4b5464=_0x1b0519[_0x82ca('0x1c')];var _0x46c8b6=util[_0x82ca('0x13')](_0x82ca('0x1d'),path[_0x82ca('0x1e')](_0x1b0519[_0x82ca('0x1c')],path[_0x82ca('0x1f')](_0x1b0519[_0x82ca('0x1c')])),_0x82ca('0x20'));var _0xede6ef=path[_0x82ca('0x1a')](_0xd2bbea,_0x4b5464);var _0xb8c25=path[_0x82ca('0x1a')](_0xd2bbea,_0x46c8b6);if(fs['existsSync'](_0xede6ef)){_0x1b0519[_0x82ca('0x21')]='Sent';_0x5f31aa[_0x82ca('0x22')][_0x82ca('0x23')]=[{'filename':_0x4b5464,'path':_0xede6ef}];_0x5f31aa[_0x82ca('0x22')][_0x82ca('0x24')]=util[_0x82ca('0x13')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x82ca('0x25')](_0x1b0519,null,0x2));}else if(fs['existsSync'](_0xb8c25)){_0x1b0519[_0x82ca('0x21')]=_0x82ca('0x26');_0x5f31aa[_0x82ca('0x22')][_0x82ca('0x23')]=[{'filename':_0x46c8b6,'path':_0xb8c25}];}else{_0x5f31aa[_0x82ca('0x22')][_0x82ca('0x24')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0xd0c499[_0x82ca('0x27')]){_0x12e444=![];logger[_0x82ca('0x28')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x12e444){return client[_0x82ca('0x29')](_0x82ca('0x2a'),_0x5f31aa)[_0x82ca('0x2b')](function(_0x23ab31){if(_0x23ab31['error']){return logger[_0x82ca('0x2c')](_0x82ca('0x2d'),JSON[_0x82ca('0x25')](_0x23ab31));}return logger[_0x82ca('0x28')](_0x82ca('0x2e'));})[_0x82ca('0x2f')](function(_0x283cc2){return logger[_0x82ca('0x2c')](_0x82ca('0x2d'),JSON[_0x82ca('0x25')](_0x283cc2));});}};}function handleError(){return function(_0x2689eb){return logger[_0x82ca('0x2c')](JSON['stringify'](_0x2689eb));};}function handleResult(_0x39e737){return function(_0x2c8127){logger['info'](_0x82ca('0x30'),JSON[_0x82ca('0x25')](_0x2c8127));if(_0x39e737[_0x82ca('0xd')]&&_0x39e737[_0x82ca('0xd')][_0x82ca('0xe')]&&!_[_0x82ca('0x31')](_0x39e737[_0x82ca('0xb')])){setTimeout(handleSendEmail(_0x39e737,_0x2c8127),0x3c*0x3e8);}};}function handleJob(_0x3d719a){return function(){try{if(_[_0x82ca('0x31')](_0x3d719a['subtractNumber'])){return logger[_0x82ca('0x28')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x82ca('0x31')](_0x3d719a[_0x82ca('0x19')])){return logger['info'](_0x82ca('0x32'));}var _0x410ab7={'startDate':moment()[_0x82ca('0x33')](_0x3d719a[_0x82ca('0x18')],_0x3d719a[_0x82ca('0x19')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x82ca('0x13')](_0x82ca('0x34')),'type':_0x82ca('0x35'),'output':_0x3d719a[_0x82ca('0x36')],'name':_0x3d719a['name']};if(!_[_0x82ca('0x31')](_0x3d719a[_0x82ca('0x37')])){logger['info'](_0x82ca('0x38'),_0x3d719a['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x3d719a[_0x82ca('0x37')]},_0x410ab7)[_0x82ca('0x2b')](handleResult(_0x3d719a))[_0x82ca('0x2f')](handleError());}if(!_[_0x82ca('0x31')](_0x3d719a['CustomReportId'])){logger[_0x82ca('0x28')]('exec\x20custom\x20report\x20id:%s',_0x3d719a[_0x82ca('0x39')]);return analyticCustomReportController[_0x82ca('0x3a')]({'id':_0x3d719a[_0x82ca('0x39')]},_0x410ab7)[_0x82ca('0x2b')](handleResult(_0x3d719a))[_0x82ca('0x2f')](handleError());}}catch(_0x13f676){logger[_0x82ca('0x2c')](JSON['stringify'](_0x13f676));}return logger[_0x82ca('0x28')]('no\x20report\x20id');};}function getJobs(_0x2e2c3b){var _0x4a4422={};if(_0x2e2c3b){_0x4a4422['id']=_0x2e2c3b;}return db[_0x82ca('0x3b')]['findAll']({'where':_0x4a4422,'include':[{'model':db[_0x82ca('0xd')],'attributes':['id','name','email'],'include':[{'model':db[_0x82ca('0x3c')],'as':'Smtp'}]}]})[_0x82ca('0x2b')](function(_0x18c22a){var _0x4d9b04=_['keys'](manager[_0x82ca('0x3d')]);var _0x360591=_[_0x82ca('0x3e')](_0x18c22a,function(_0x2ff403){return _0x2ff403['id'][_0x82ca('0x3f')]();});var _0x7c9710=_[_0x82ca('0x40')](_0x18c22a,function(_0x1b8289){return _0x1b8289['id'][_0x82ca('0x3f')]();});var _0x3019dd=_0x2e2c3b?_0x360591:_[_0x82ca('0x41')](_0x360591,_0x4d9b04);var _0x30aa19=_[_0x82ca('0x42')](_0x360591,_0x4d9b04);var _0x27551a=_[_0x82ca('0x41')](_0x4d9b04,_0x360591);var _0x4a0ea1;var _0x17d110;for(_0x4a0ea1=0x0;_0x4a0ea1<_0x27551a[_0x82ca('0x43')]&&!_0x2e2c3b;_0x4a0ea1+=0x1){_0x17d110=_0x27551a[_0x4a0ea1][_0x82ca('0x3f')]();if(manager[_0x82ca('0x44')](_0x17d110)){manager[_0x82ca('0x45')](_0x17d110);manager[_0x82ca('0x46')](_0x17d110);logger[_0x82ca('0x28')](_0x82ca('0x47'),_0x17d110);}}logger[_0x82ca('0x28')](_0x82ca('0x48'),JSON['stringify'](_0x3019dd));for(_0x4a0ea1=0x0;_0x4a0ea1<_0x3019dd[_0x82ca('0x43')];_0x4a0ea1+=0x1){_0x17d110=_0x3019dd[_0x4a0ea1][_0x82ca('0x3f')]();logger['info']('index',_0x17d110);if(_0x2e2c3b){logger[_0x82ca('0x28')](_0x82ca('0x49'),_0x2e2c3b);logger[_0x82ca('0x28')](JSON[_0x82ca('0x25')](_0x7c9710[_0x17d110]));BPromise['resolve']()['then'](handleJob(_0x7c9710[_0x17d110]));logger[_0x82ca('0x28')]('run\x20job',_0x7c9710[_0x17d110][_0x82ca('0x17')],_0x7c9710[_0x17d110]['cron']);}else if(_0x7c9710[_0x17d110][_0x82ca('0x4a')]&&_0x7c9710[_0x17d110][_0x82ca('0x4b')]&&moment()[_0x82ca('0x4c')](_0x7c9710[_0x17d110]['startAt'],_0x7c9710[_0x17d110][_0x82ca('0x4d')])){manager[_0x82ca('0x4e')](_0x17d110,_0x7c9710[_0x17d110][_0x82ca('0x4a')],handleJob(_0x7c9710[_0x17d110]));manager[_0x82ca('0x4f')](_0x17d110);logger[_0x82ca('0x28')](_0x82ca('0x50'),_0x7c9710[_0x17d110][_0x82ca('0x17')],_0x7c9710[_0x17d110][_0x82ca('0x4a')]);}else if(manager[_0x82ca('0x44')](_0x17d110)){manager[_0x82ca('0x45')](_0x17d110);manager['deleteJob'](_0x17d110);logger['info']('stop\x20cron',_0x7c9710[_0x17d110]['name'],_0x7c9710[_0x17d110]['cron']);}}for(_0x4a0ea1=0x0,_0x17d110;_0x4a0ea1<_0x30aa19['length']&&!_0x2e2c3b;_0x4a0ea1+=0x1){_0x17d110=_0x30aa19[_0x4a0ea1]['toString']();if(manager[_0x82ca('0x44')](_0x17d110)){if(_0x7c9710[_0x17d110][_0x82ca('0x4a')]&&_0x7c9710[_0x17d110][_0x82ca('0x4b')]&&moment()[_0x82ca('0x4c')](_0x7c9710[_0x17d110][_0x82ca('0x51')],_0x7c9710[_0x17d110][_0x82ca('0x4d')])){manager['update'](_0x17d110,_0x7c9710[_0x17d110][_0x82ca('0x4a')],handleJob(_0x7c9710[_0x17d110]));logger['info'](_0x82ca('0x52'),_0x7c9710[_0x17d110][_0x82ca('0x17')],_0x7c9710[_0x17d110][_0x82ca('0x4a')]);}else{manager[_0x82ca('0x45')](_0x17d110);manager[_0x82ca('0x46')](_0x17d110);logger[_0x82ca('0x28')](_0x82ca('0x53'),_0x7c9710[_0x17d110]['name'],_0x7c9710[_0x17d110]['cron']);}}}})['catch'](function(_0x1b7ce6){logger[_0x82ca('0x2c')](JSON[_0x82ca('0x25')](_0x1b7ce6));});}exports['run']=function(_0x318ad1){return getJobs(_0x318ad1);};exports[_0x82ca('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xa716=['bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','zip','join','existsSync','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','empty\x20file,\x20email\x20not\x20sent','SendMail','error','email\x20sent','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','then','jobs','map','toString','difference','intersection','length','exists','delete\x20cron','toRun','index','resolve','run\x20job','cron','isBetween','startAt','add','start','add\x20cron','active','endAt','update','update\x20cron','stop','stop\x20cron','util','path','lodash'];(function(_0x946156,_0x4902e0){var _0x5a7488=function(_0x4ad37b){while(--_0x4ad37b){_0x946156['push'](_0x946156['shift']());}};_0x5a7488(++_0x4902e0);}(_0xa716,0x10b));var _0x6a71=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa716[_0x19950b];return _0x3c6b41;};'use strict';var fs=require('fs');var util=require(_0x6a71('0x0'));var path=require(_0x6a71('0x1'));var _=require(_0x6a71('0x2'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0x6a71('0x3'));var logger=require(_0x6a71('0x4'))(_0x6a71('0x5'));var db=require(_0x6a71('0x6'))['db'];var analyticCustomReportController=require(_0x6a71('0x7'));var analyticDefaultReportController=require(_0x6a71('0x8'));var client=jayson[_0x6a71('0x9')][_0x6a71('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x57d180,_0x1b39e5){return function(){logger[_0x6a71('0xb')](_0x6a71('0xc'),_0x57d180[_0x6a71('0xd')]);var _0x2d2c68=!![];var _0x3074ea={'tls':{'rejectUnauthorized':![]}};if(_0x57d180[_0x6a71('0xe')][_0x6a71('0xf')][_0x6a71('0x10')]){_0x3074ea[_0x6a71('0x10')]=_0x57d180[_0x6a71('0xe')][_0x6a71('0xf')][_0x6a71('0x10')];}else{_0x3074ea[_0x6a71('0x11')]=_0x57d180[_0x6a71('0xe')]['Smtp'][_0x6a71('0x11')];_0x3074ea[_0x6a71('0x12')]=_0x57d180['MailAccount'][_0x6a71('0xf')][_0x6a71('0x12')];_0x3074ea['secure']=_0x57d180[_0x6a71('0xe')]['Smtp'][_0x6a71('0x13')];}if(_0x57d180[_0x6a71('0xe')][_0x6a71('0xf')][_0x6a71('0x14')]){_0x3074ea[_0x6a71('0x15')]={'user':_0x57d180[_0x6a71('0xe')][_0x6a71('0xf')][_0x6a71('0x16')],'pass':_0x57d180['MailAccount'][_0x6a71('0xf')][_0x6a71('0x17')]};}var _0x599aba={'account':_0x3074ea,'message':{'from':util[_0x6a71('0x18')]('\x22%s\x22\x20<%s>',_0x57d180[_0x6a71('0xe')][_0x6a71('0x19')],_0x57d180[_0x6a71('0xe')][_0x6a71('0xd')]||_0x57d180['MailAccount'][_0x6a71('0xf')][_0x6a71('0x16')]),'to':_0x57d180[_0x6a71('0xd')],'cc':_0x57d180['cc'],'bcc':_0x57d180[_0x6a71('0x1a')],'subject':util['format'](_0x6a71('0x1b'),_0x1b39e5['name'],_0x57d180[_0x6a71('0x1c')],_0x57d180[_0x6a71('0x1d')])}};var _0x587b09=path['join'](__dirname,_0x6a71('0x1e'));var _0x5f58b3=_0x1b39e5[_0x6a71('0x1f')];var _0x330ed2=util[_0x6a71('0x18')](_0x6a71('0x20'),path[_0x6a71('0x21')](_0x1b39e5['savename'],path[_0x6a71('0x22')](_0x1b39e5[_0x6a71('0x1f')])),_0x6a71('0x23'));var _0x455f45=path[_0x6a71('0x24')](_0x587b09,_0x5f58b3);var _0x424ce4=path[_0x6a71('0x24')](_0x587b09,_0x330ed2);if(fs[_0x6a71('0x25')](_0x455f45)){_0x1b39e5['status']=_0x6a71('0x26');_0x599aba[_0x6a71('0x27')][_0x6a71('0x28')]=[{'filename':_0x5f58b3,'path':_0x455f45}];_0x599aba['message'][_0x6a71('0x29')]=util['format'](_0x6a71('0x2a'),JSON[_0x6a71('0x2b')](_0x1b39e5,null,0x2));}else if(fs[_0x6a71('0x25')](_0x424ce4)){_0x1b39e5['status']='Sent';_0x599aba[_0x6a71('0x27')][_0x6a71('0x28')]=[{'filename':_0x330ed2,'path':_0x424ce4}];}else{_0x599aba[_0x6a71('0x27')][_0x6a71('0x29')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x57d180['sendIfEmpty']){_0x2d2c68=![];logger[_0x6a71('0xb')](_0x6a71('0x2c'));}}if(_0x2d2c68){return client['request'](_0x6a71('0x2d'),_0x599aba)['then'](function(_0x4881a5){if(_0x4881a5[_0x6a71('0x2e')]){return logger['error']('error\x20mail',JSON[_0x6a71('0x2b')](_0x4881a5));}return logger[_0x6a71('0xb')](_0x6a71('0x2f'));})[_0x6a71('0x30')](function(_0x21ab55){return logger[_0x6a71('0x2e')](_0x6a71('0x31'),JSON[_0x6a71('0x2b')](_0x21ab55));});}};}function handleError(){return function(_0x3a3896){return logger['error'](JSON['stringify'](_0x3a3896));};}function handleResult(_0x285d95){return function(_0x26c436){logger['info'](_0x6a71('0x32'),JSON['stringify'](_0x26c436));if(_0x285d95[_0x6a71('0xe')]&&_0x285d95[_0x6a71('0xe')]['Smtp']&&!_[_0x6a71('0x33')](_0x285d95[_0x6a71('0xd')])){setTimeout(handleSendEmail(_0x285d95,_0x26c436),0x3c*0x3e8);}};}function handleJob(_0x15e244){return function(){try{if(_[_0x6a71('0x33')](_0x15e244[_0x6a71('0x1c')])){return logger['info'](_0x6a71('0x34'));}if(_[_0x6a71('0x33')](_0x15e244[_0x6a71('0x1d')])){return logger[_0x6a71('0xb')](_0x6a71('0x35'));}var _0x583bee={'startDate':moment()[_0x6a71('0x36')](_0x15e244[_0x6a71('0x1c')],_0x15e244['subtractUnit'])[_0x6a71('0x18')](_0x6a71('0x37')),'endDate':moment()[_0x6a71('0x18')](_0x6a71('0x37')),'type':_0x6a71('0x38'),'output':_0x15e244[_0x6a71('0x39')],'name':_0x15e244[_0x6a71('0x19')]};if(!_['isNil'](_0x15e244[_0x6a71('0x3a')])){logger['info'](_0x6a71('0x3b'),_0x15e244[_0x6a71('0x3a')]);return analyticDefaultReportController['runReport']({'id':_0x15e244[_0x6a71('0x3a')]},_0x583bee)['then'](handleResult(_0x15e244))['catch'](handleError());}if(!_[_0x6a71('0x33')](_0x15e244[_0x6a71('0x3c')])){logger[_0x6a71('0xb')](_0x6a71('0x3d'),_0x15e244[_0x6a71('0x3c')]);return analyticCustomReportController['runReport']({'id':_0x15e244[_0x6a71('0x3c')]},_0x583bee)['then'](handleResult(_0x15e244))[_0x6a71('0x30')](handleError());}}catch(_0x4b7c55){logger[_0x6a71('0x2e')](JSON[_0x6a71('0x2b')](_0x4b7c55));}return logger[_0x6a71('0xb')](_0x6a71('0x3e'));};}function getJobs(_0x42f445){var _0x31a9={};if(_0x42f445){_0x31a9['id']=_0x42f445;}return db[_0x6a71('0x3f')]['findAll']({'where':_0x31a9,'include':[{'model':db[_0x6a71('0xe')],'attributes':['id','name',_0x6a71('0xd')],'include':[{'model':db[_0x6a71('0x40')],'as':_0x6a71('0xf')}]}]})[_0x6a71('0x41')](function(_0x462c66){var _0x30dab5=_['keys'](manager[_0x6a71('0x42')]);var _0x402ce2=_[_0x6a71('0x43')](_0x462c66,function(_0x5c60cc){return _0x5c60cc['id'][_0x6a71('0x44')]();});var _0x490046=_['keyBy'](_0x462c66,function(_0x3e5a09){return _0x3e5a09['id']['toString']();});var _0x2828e9=_0x42f445?_0x402ce2:_[_0x6a71('0x45')](_0x402ce2,_0x30dab5);var _0x4ca9c9=_[_0x6a71('0x46')](_0x402ce2,_0x30dab5);var _0x3679e9=_[_0x6a71('0x45')](_0x30dab5,_0x402ce2);var _0x2dcf24;var _0xe5ac92;for(_0x2dcf24=0x0;_0x2dcf24<_0x3679e9[_0x6a71('0x47')]&&!_0x42f445;_0x2dcf24+=0x1){_0xe5ac92=_0x3679e9[_0x2dcf24][_0x6a71('0x44')]();if(manager[_0x6a71('0x48')](_0xe5ac92)){manager['stop'](_0xe5ac92);manager['deleteJob'](_0xe5ac92);logger[_0x6a71('0xb')](_0x6a71('0x49'),_0xe5ac92);}}logger['info'](_0x6a71('0x4a'),JSON['stringify'](_0x2828e9));for(_0x2dcf24=0x0;_0x2dcf24<_0x2828e9['length'];_0x2dcf24+=0x1){_0xe5ac92=_0x2828e9[_0x2dcf24]['toString']();logger[_0x6a71('0xb')](_0x6a71('0x4b'),_0xe5ac92);if(_0x42f445){logger['info']('my\x20id',_0x42f445);logger[_0x6a71('0xb')](JSON[_0x6a71('0x2b')](_0x490046[_0xe5ac92]));BPromise[_0x6a71('0x4c')]()['then'](handleJob(_0x490046[_0xe5ac92]));logger[_0x6a71('0xb')](_0x6a71('0x4d'),_0x490046[_0xe5ac92][_0x6a71('0x19')],_0x490046[_0xe5ac92][_0x6a71('0x4e')]);}else if(_0x490046[_0xe5ac92][_0x6a71('0x4e')]&&_0x490046[_0xe5ac92]['active']&&moment()[_0x6a71('0x4f')](_0x490046[_0xe5ac92][_0x6a71('0x50')],_0x490046[_0xe5ac92]['endAt'])){manager[_0x6a71('0x51')](_0xe5ac92,_0x490046[_0xe5ac92]['cron'],handleJob(_0x490046[_0xe5ac92]));manager[_0x6a71('0x52')](_0xe5ac92);logger[_0x6a71('0xb')](_0x6a71('0x53'),_0x490046[_0xe5ac92][_0x6a71('0x19')],_0x490046[_0xe5ac92][_0x6a71('0x4e')]);}else if(manager['exists'](_0xe5ac92)){manager['stop'](_0xe5ac92);manager['deleteJob'](_0xe5ac92);logger[_0x6a71('0xb')]('stop\x20cron',_0x490046[_0xe5ac92]['name'],_0x490046[_0xe5ac92][_0x6a71('0x4e')]);}}for(_0x2dcf24=0x0,_0xe5ac92;_0x2dcf24<_0x4ca9c9['length']&&!_0x42f445;_0x2dcf24+=0x1){_0xe5ac92=_0x4ca9c9[_0x2dcf24]['toString']();if(manager[_0x6a71('0x48')](_0xe5ac92)){if(_0x490046[_0xe5ac92][_0x6a71('0x4e')]&&_0x490046[_0xe5ac92][_0x6a71('0x54')]&&moment()[_0x6a71('0x4f')](_0x490046[_0xe5ac92][_0x6a71('0x50')],_0x490046[_0xe5ac92][_0x6a71('0x55')])){manager[_0x6a71('0x56')](_0xe5ac92,_0x490046[_0xe5ac92][_0x6a71('0x4e')],handleJob(_0x490046[_0xe5ac92]));logger[_0x6a71('0xb')](_0x6a71('0x57'),_0x490046[_0xe5ac92][_0x6a71('0x19')],_0x490046[_0xe5ac92][_0x6a71('0x4e')]);}else{manager[_0x6a71('0x58')](_0xe5ac92);manager['deleteJob'](_0xe5ac92);logger['info'](_0x6a71('0x59'),_0x490046[_0xe5ac92][_0x6a71('0x19')],_0x490046[_0xe5ac92][_0x6a71('0x4e')]);}}}})[_0x6a71('0x30')](function(_0x40d6aa){logger[_0x6a71('0x2e')](JSON[_0x6a71('0x2b')](_0x40d6aa));});}exports['run']=function(_0xa1501a){return getJobs(_0xa1501a);};exports[_0x6a71('0x52')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index bf70d99..1a1db39 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65bb=['name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','CloudProvider','transcribeAccountId','push','all','catch','inspect','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','transcribeName','then','info','format','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Transcript\x20not\x20available','ValidationError','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','resolve','language','findOne','Negative'];(function(_0x57cf0e,_0x2b61eb){var _0x5bb2bd=function(_0x54e1a3){while(--_0x54e1a3){_0x57cf0e['push'](_0x57cf0e['shift']());}};_0x5bb2bd(++_0x2b61eb);}(_0x65bb,0x9f));var _0xb65b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x65bb[_0x3dd15e];return _0x231fd0;};var _=require(_0xb65b('0x0'));var AWS=require(_0xb65b('0x1'));var rp=require(_0xb65b('0x2'));var util=require(_0xb65b('0x3'));var BPromise=require(_0xb65b('0x4'));var db=require(_0xb65b('0x5'))['db'];var logger=require(_0xb65b('0x6'))(_0xb65b('0x7'));function getTranscriptionJob(_0x21d2bf,_0x2ef95d,_0x5e0fe7,_0x26072e){return new Promise(function(_0x5625b1,_0x5a3124){var _0x5128aa=new AWS[(_0xb65b('0x8'))]({'accessKeyId':_0x2ef95d,'secretAccessKey':_0x21d2bf,'region':_0x5e0fe7});_0x5128aa[_0xb65b('0x9')]({'TranscriptionJobName':_0x26072e},function(_0x58ed16,_0x216d7a){if(_0x58ed16){return _0x5a3124(_0x58ed16);}else{return _0x5625b1(_0x216d7a);}});});}function sentiment(_0x26340a,_0x3bb50b,_0x40cbdb,_0x53c4aa,_0x50200){return new Promise(function(_0x1c83fb,_0x14c5b0){var _0x11b024=new AWS['Comprehend']({'accessKeyId':_0x3bb50b,'secretAccessKey':_0x26340a,'region':_0x40cbdb});_0x11b024[_0xb65b('0xa')]({'Text':_0x53c4aa,'LanguageCode':_0x50200[_0xb65b('0xb')](0x0,0x2)},function(_0x23be7b,_0x39254f){if(_0x23be7b){return _0x14c5b0(_0x23be7b);}else{return _0x1c83fb(_0x39254f);}});});}function checkTranscribeJob(_0x7fe89,_0x5319f3,_0x2a52d6){var _0x5bcfda;return new BPromise(function(_0x33a7c1,_0x962cae){logger['info'](util['format'](_0xb65b('0xc'),_0x7fe89['id'],_0x7fe89['transcribeName']));return getTranscriptionJob(_0x2a52d6[_0xb65b('0xd')],_0x2a52d6[_0xb65b('0xe')],_0x5319f3[_0xb65b('0xf')],_0x7fe89[_0xb65b('0x10')])[_0xb65b('0x11')](function(_0xdc2f6b){logger[_0xb65b('0x12')](util[_0xb65b('0x13')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x7fe89['id'],_0x7fe89['transcribeName'],_0xdc2f6b[_0xb65b('0x14')]['TranscriptionJobStatus']));if(!_0x7fe89[_0xb65b('0x15')]){switch(_0xdc2f6b[_0xb65b('0x14')][_0xb65b('0x16')]){case _0xb65b('0x17'):var _0x52fae9={'transcribeStatus':_0xdc2f6b[_0xb65b('0x14')][_0xb65b('0x16')],'fileUri':_0xdc2f6b[_0xb65b('0x14')]['Transcript'][_0xb65b('0x18')]};logger[_0xb65b('0x12')](util[_0xb65b('0x13')](_0xb65b('0x19'),_0x7fe89['id']));return rp({'uri':_0xdc2f6b[_0xb65b('0x14')][_0xb65b('0x1a')][_0xb65b('0x18')],'json':!![]})[_0xb65b('0x11')](function(_0x3df4e2){logger[_0xb65b('0x12')](util[_0xb65b('0x13')](_0xb65b('0x1b'),_0x7fe89['id']));if(_0x3df4e2&&_0x3df4e2[_0xb65b('0x1c')]&&_0x3df4e2[_0xb65b('0x1c')][_0xb65b('0x1d')]&&_0x3df4e2[_0xb65b('0x1c')][_0xb65b('0x1d')]['length']){_0x52fae9[_0xb65b('0x15')]='';for(var _0x592616=0x0;_0x592616<_0x3df4e2[_0xb65b('0x1c')][_0xb65b('0x1d')][_0xb65b('0x1e')];_0x592616++){_0x52fae9[_0xb65b('0x15')]+=_0x3df4e2[_0xb65b('0x1c')][_0xb65b('0x1d')][_0x592616][_0xb65b('0x1f')]+'';}}return _0x7fe89[_0xb65b('0x20')](_0x52fae9);})[_0xb65b('0x11')](function(){logger[_0xb65b('0x12')](util['format'](_0xb65b('0x21'),_0x7fe89['id']));if(!_0x7fe89[_0xb65b('0x22')]){throw new db[(_0xb65b('0x23'))]['ValidationError'](_0xb65b('0x24'));}if(!_0x5319f3[_0xb65b('0x25')]||!_0x5319f3[_0xb65b('0x26')]||!_0x5319f3[_0xb65b('0x27')]||!_0x5319f3['language']||!_0x5319f3[_0xb65b('0x28')]){throw new db[(_0xb65b('0x23'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x52fae9['fileText']){throw new Error(_0xb65b('0x29'));}if(_0x5319f3[_0xb65b('0x26')]===_0x2a52d6['id']){return _0x2a52d6;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0xb65b('0x26')]}});}})[_0xb65b('0x11')](function(_0x36309d){if(!_0x36309d){throw new db[(_0xb65b('0x23'))][(_0xb65b('0x2a'))](_0xb65b('0x2b'));}if(!_0x36309d['data1']||!_0x36309d[_0xb65b('0xe')]){throw new db[(_0xb65b('0x23'))][(_0xb65b('0x2a'))](_0xb65b('0x2c'));}_0x5bcfda=_0x36309d;logger[_0xb65b('0x12')](util['format'](_0xb65b('0x2d'),_0x7fe89['id']));return sentiment(_0x5bcfda[_0xb65b('0xd')],_0x5bcfda[_0xb65b('0xe')],_0x5319f3[_0xb65b('0x27')],_0x52fae9['fileText'],_0x5319f3['language']);})[_0xb65b('0x11')](function(_0x1990a9){logger[_0xb65b('0x12')](util[_0xb65b('0x13')](_0xb65b('0x2e'),_0x7fe89['id']));return _0x7fe89[_0xb65b('0x20')]({'sentiment':_0x1990a9[_0xb65b('0x2f')],'sPositive':_0x1990a9[_0xb65b('0x30')][_0xb65b('0x31')],'sNegative':_0x1990a9[_0xb65b('0x30')]['Negative'],'sMixed':_0x1990a9[_0xb65b('0x30')][_0xb65b('0x32')],'sNeutral':_0x1990a9[_0xb65b('0x30')][_0xb65b('0x33')]});})[_0xb65b('0x11')](function(){logger[_0xb65b('0x12')](util[_0xb65b('0x13')](_0xb65b('0x21'),_0x7fe89['id']));_0x33a7c1();});case'FAILED':return _0x7fe89[_0xb65b('0x20')]({'transcribeStatus':_0xb65b('0x34'),'failureReason':_0xdc2f6b[_0xb65b('0x14')]['FailureReason']})[_0xb65b('0x11')](function(){logger[_0xb65b('0x12')](util[_0xb65b('0x13')](_0xb65b('0x21'),_0x7fe89['id']));_0x33a7c1();});default:logger[_0xb65b('0x12')](util[_0xb65b('0x13')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x7fe89['id']));break;}}else{return BPromise[_0xb65b('0x35')]()[_0xb65b('0x11')](function(){if(!_0x7fe89[_0xb65b('0x22')]){throw new db[(_0xb65b('0x23'))]['ValidationError'](_0xb65b('0x24'));}if(!_0x5319f3[_0xb65b('0x25')]||!_0x5319f3[_0xb65b('0x26')]||!_0x5319f3[_0xb65b('0x27')]||!_0x5319f3[_0xb65b('0x36')]||!_0x5319f3[_0xb65b('0x28')]){throw new db[(_0xb65b('0x23'))][(_0xb65b('0x2a'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x7fe89['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x5319f3[_0xb65b('0x26')]===_0x2a52d6['id']){return _0x2a52d6;}else{return db['CloudProvider'][_0xb65b('0x37')]({'where':{'id':_settings[_0xb65b('0x26')]}});}})[_0xb65b('0x11')](function(_0x2745bd){if(!_0x2745bd){throw new db[(_0xb65b('0x23'))][(_0xb65b('0x2a'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2745bd[_0xb65b('0xd')]||!_0x2745bd[_0xb65b('0xe')]){throw new db[(_0xb65b('0x23'))][(_0xb65b('0x2a'))](_0xb65b('0x2c'));}_0x5bcfda=_0x2745bd;logger[_0xb65b('0x12')](util['format'](_0xb65b('0x2d'),_0x7fe89['id']));return sentiment(_0x5bcfda[_0xb65b('0xd')],_0x5bcfda[_0xb65b('0xe')],_0x5319f3[_0xb65b('0x27')],_0x7fe89[_0xb65b('0x15')],_0x5319f3[_0xb65b('0x36')]);})[_0xb65b('0x11')](function(_0x50b54e){logger[_0xb65b('0x12')](util[_0xb65b('0x13')](_0xb65b('0x2e'),_0x7fe89['id']));return _0x7fe89[_0xb65b('0x20')]({'sentiment':_0x50b54e[_0xb65b('0x2f')],'sPositive':_0x50b54e[_0xb65b('0x30')][_0xb65b('0x31')],'sNegative':_0x50b54e['SentimentScore'][_0xb65b('0x38')],'sMixed':_0x50b54e[_0xb65b('0x30')]['Mixed'],'sNeutral':_0x50b54e[_0xb65b('0x30')][_0xb65b('0x33')],'transcribeStatus':_0xb65b('0x17')});})['then'](function(){logger['info'](util['format'](_0xb65b('0x21'),_0x7fe89['id']));_0x33a7c1();});}})['catch'](function(_0x90ef7e){if(_0x90ef7e){if(!_0x90ef7e[_0xb65b('0x39')]||_0x90ef7e[_0xb65b('0x39')]!==_0xb65b('0x3a')){logger[_0xb65b('0x3b')](util[_0xb65b('0x13')](_0xb65b('0x3c'),_0x7fe89['id']),util['inspect'](_0x90ef7e,{'showHidden':![],'depth':null}));}}_0x33a7c1();});});}function checkTranscribe(){var _0x4e72e1;var _0x193ef1;var _0x13f699;return db[_0xb65b('0x3d')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xb65b('0x11')](function(_0x525a18){if(!_0x525a18||!_0x525a18[_0xb65b('0x1e')]){throw new db['Sequelize'][(_0xb65b('0x2a'))](_0xb65b('0x3e'));}_0x4e72e1=_0x525a18;return db[_0xb65b('0x3f')]['findOne']({'where':{'id':0x1}});})[_0xb65b('0x11')](function(_0x4f6312){if(!_0x4f6312){throw new db['Sequelize'][(_0xb65b('0x2a'))](_0xb65b('0x40'));}_0x193ef1=_0x4f6312;if(!_0x193ef1[_0xb65b('0x7')]||!_0x193ef1['transcribeAccountId']||!_0x193ef1[_0xb65b('0xf')]||!_0x193ef1['language']||!_0x193ef1['bucket']){throw new db[(_0xb65b('0x23'))][(_0xb65b('0x2a'))](_0xb65b('0x41'));}return db[_0xb65b('0x42')][_0xb65b('0x37')]({'where':{'id':_0x193ef1[_0xb65b('0x43')]}});})['then'](function(_0x90d88){if(!_0x90d88){throw new db[(_0xb65b('0x23'))][(_0xb65b('0x2a'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x90d88[_0xb65b('0xd')]||!_0x90d88[_0xb65b('0xe')]){throw new db['Sequelize'][(_0xb65b('0x2a'))](_0xb65b('0x2c'));}_0x13f699=_0x90d88;var _0x1644ba=[];_0x4e72e1['forEach'](function(_0x505965){_0x1644ba[_0xb65b('0x44')](checkTranscribeJob(_0x505965,_0x193ef1,_0x13f699));});return BPromise[_0xb65b('0x45')](_0x1644ba);})[_0xb65b('0x46')](function(_0xadff9c){if(_0xadff9c){if(!_0xadff9c[_0xb65b('0x39')]||_0xadff9c['name']!==_0xb65b('0x3a')){logger[_0xb65b('0x3b')](util[_0xb65b('0x47')](_0xadff9c,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xc3e3=['COMPLETED','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data2','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Mixed','FAILED','update','resolve','tempSentiment','bucket','CloudProvider','Positive'];(function(_0x332b14,_0xef9261){var _0x17e5b8=function(_0x1d6819){while(--_0x1d6819){_0x332b14['push'](_0x332b14['shift']());}};_0x17e5b8(++_0xef9261);}(_0xc3e3,0x1ba));var _0x3c3e=function(_0x3527eb,_0x2a1ddc){_0x3527eb=_0x3527eb-0x0;var _0x449056=_0xc3e3[_0x3527eb];return _0x449056;};var _=require(_0x3c3e('0x0'));var AWS=require(_0x3c3e('0x1'));var rp=require(_0x3c3e('0x2'));var util=require(_0x3c3e('0x3'));var BPromise=require(_0x3c3e('0x4'));var db=require(_0x3c3e('0x5'))['db'];var logger=require(_0x3c3e('0x6'))(_0x3c3e('0x7'));function getTranscriptionJob(_0x259ac6,_0x337927,_0x2516cf,_0x23ce25){return new Promise(function(_0x3ebf54,_0x794bc3){var _0x3f8b7a=new AWS['TranscribeService']({'accessKeyId':_0x337927,'secretAccessKey':_0x259ac6,'region':_0x2516cf});_0x3f8b7a[_0x3c3e('0x8')]({'TranscriptionJobName':_0x23ce25},function(_0x28816d,_0x50c853){if(_0x28816d){return _0x794bc3(_0x28816d);}else{return _0x3ebf54(_0x50c853);}});});}function sentiment(_0x2d51f7,_0x5dfa3d,_0x5ae488,_0x12214e,_0x49bab3){return new Promise(function(_0x3f3fbb,_0x52b5f9){var _0x3ef330=new AWS[(_0x3c3e('0x9'))]({'accessKeyId':_0x5dfa3d,'secretAccessKey':_0x2d51f7,'region':_0x5ae488});_0x3ef330['detectSentiment']({'Text':_0x12214e,'LanguageCode':_0x49bab3[_0x3c3e('0xa')](0x0,0x2)},function(_0x1edb7f,_0x45320f){if(_0x1edb7f){return _0x52b5f9(_0x1edb7f);}else{return _0x3f3fbb(_0x45320f);}});});}function checkTranscribeJob(_0x24161a,_0x47204f,_0x862c39){var _0x40ed51;return new BPromise(function(_0x75fdb2,_0x573f43){logger[_0x3c3e('0xb')](util[_0x3c3e('0xc')](_0x3c3e('0xd'),_0x24161a['id'],_0x24161a[_0x3c3e('0xe')]));return getTranscriptionJob(_0x862c39[_0x3c3e('0xf')],_0x862c39['data2'],_0x47204f[_0x3c3e('0x10')],_0x24161a['transcribeName'])['then'](function(_0x1251b6){logger[_0x3c3e('0xb')](util[_0x3c3e('0xc')](_0x3c3e('0x11'),_0x24161a['id'],_0x24161a[_0x3c3e('0xe')],_0x1251b6[_0x3c3e('0x12')][_0x3c3e('0x13')]));if(!_0x24161a[_0x3c3e('0x14')]){switch(_0x1251b6['TranscriptionJob'][_0x3c3e('0x13')]){case'COMPLETED':var _0x162caa={'transcribeStatus':_0x1251b6[_0x3c3e('0x12')]['TranscriptionJobStatus'],'fileUri':_0x1251b6[_0x3c3e('0x12')][_0x3c3e('0x15')][_0x3c3e('0x16')]};logger[_0x3c3e('0xb')](util[_0x3c3e('0xc')](_0x3c3e('0x17'),_0x24161a['id']));return rp({'uri':_0x1251b6[_0x3c3e('0x12')][_0x3c3e('0x15')][_0x3c3e('0x16')],'json':!![]})[_0x3c3e('0x18')](function(_0x5c1699){logger[_0x3c3e('0xb')](util[_0x3c3e('0xc')](_0x3c3e('0x19'),_0x24161a['id']));if(_0x5c1699&&_0x5c1699[_0x3c3e('0x1a')]&&_0x5c1699[_0x3c3e('0x1a')][_0x3c3e('0x1b')]&&_0x5c1699[_0x3c3e('0x1a')][_0x3c3e('0x1b')][_0x3c3e('0x1c')]){_0x162caa['fileText']='';for(var _0x1bcb4c=0x0;_0x1bcb4c<_0x5c1699['results'][_0x3c3e('0x1b')][_0x3c3e('0x1c')];_0x1bcb4c++){_0x162caa[_0x3c3e('0x14')]+=_0x5c1699[_0x3c3e('0x1a')][_0x3c3e('0x1b')][_0x1bcb4c][_0x3c3e('0x1d')]+'';}}return _0x24161a['update'](_0x162caa);})[_0x3c3e('0x18')](function(){logger[_0x3c3e('0xb')](util[_0x3c3e('0xc')](_0x3c3e('0x1e'),_0x24161a['id']));if(!_0x24161a['tempSentiment']){throw new db[(_0x3c3e('0x1f'))][(_0x3c3e('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x47204f[_0x3c3e('0x21')]||!_0x47204f['sentimentAccountId']||!_0x47204f[_0x3c3e('0x22')]||!_0x47204f['language']||!_0x47204f['bucket']){throw new db[(_0x3c3e('0x1f'))][(_0x3c3e('0x20'))](_0x3c3e('0x23'));}if(!_0x162caa['fileText']){throw new Error(_0x3c3e('0x24'));}if(_0x47204f[_0x3c3e('0x25')]===_0x862c39['id']){return _0x862c39;}else{return db['CloudProvider'][_0x3c3e('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x3c3e('0x18')](function(_0x5dc339){if(!_0x5dc339){throw new db[(_0x3c3e('0x1f'))][(_0x3c3e('0x20'))](_0x3c3e('0x27'));}if(!_0x5dc339[_0x3c3e('0xf')]||!_0x5dc339['data2']){throw new db[(_0x3c3e('0x1f'))]['ValidationError'](_0x3c3e('0x28'));}_0x40ed51=_0x5dc339;logger[_0x3c3e('0xb')](util[_0x3c3e('0xc')](_0x3c3e('0x29'),_0x24161a['id']));return sentiment(_0x40ed51['data1'],_0x40ed51[_0x3c3e('0x2a')],_0x47204f[_0x3c3e('0x22')],_0x162caa[_0x3c3e('0x14')],_0x47204f[_0x3c3e('0x2b')]);})[_0x3c3e('0x18')](function(_0x2cd63e){logger[_0x3c3e('0xb')](util[_0x3c3e('0xc')](_0x3c3e('0x2c'),_0x24161a['id']));return _0x24161a['update']({'sentiment':_0x2cd63e[_0x3c3e('0x2d')],'sPositive':_0x2cd63e[_0x3c3e('0x2e')]['Positive'],'sNegative':_0x2cd63e[_0x3c3e('0x2e')]['Negative'],'sMixed':_0x2cd63e[_0x3c3e('0x2e')][_0x3c3e('0x2f')],'sNeutral':_0x2cd63e['SentimentScore']['Neutral']});})[_0x3c3e('0x18')](function(){logger[_0x3c3e('0xb')](util[_0x3c3e('0xc')](_0x3c3e('0x1e'),_0x24161a['id']));_0x75fdb2();});case _0x3c3e('0x30'):return _0x24161a[_0x3c3e('0x31')]({'transcribeStatus':_0x3c3e('0x30'),'failureReason':_0x1251b6[_0x3c3e('0x12')]['FailureReason']})['then'](function(){logger[_0x3c3e('0xb')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x24161a['id']));_0x75fdb2();});default:logger['info'](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x24161a['id']));break;}}else{return BPromise[_0x3c3e('0x32')]()[_0x3c3e('0x18')](function(){if(!_0x24161a[_0x3c3e('0x33')]){throw new db[(_0x3c3e('0x1f'))][(_0x3c3e('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x47204f[_0x3c3e('0x21')]||!_0x47204f[_0x3c3e('0x25')]||!_0x47204f[_0x3c3e('0x22')]||!_0x47204f['language']||!_0x47204f[_0x3c3e('0x34')]){throw new db['Sequelize']['ValidationError'](_0x3c3e('0x23'));}if(!_0x24161a[_0x3c3e('0x14')]){throw new Error(_0x3c3e('0x24'));}if(_0x47204f['sentimentAccountId']===_0x862c39['id']){return _0x862c39;}else{return db[_0x3c3e('0x35')][_0x3c3e('0x26')]({'where':{'id':_settings[_0x3c3e('0x25')]}});}})[_0x3c3e('0x18')](function(_0x219cc0){if(!_0x219cc0){throw new db[(_0x3c3e('0x1f'))][(_0x3c3e('0x20'))](_0x3c3e('0x27'));}if(!_0x219cc0[_0x3c3e('0xf')]||!_0x219cc0[_0x3c3e('0x2a')]){throw new db[(_0x3c3e('0x1f'))][(_0x3c3e('0x20'))](_0x3c3e('0x28'));}_0x40ed51=_0x219cc0;logger[_0x3c3e('0xb')](util[_0x3c3e('0xc')](_0x3c3e('0x29'),_0x24161a['id']));return sentiment(_0x40ed51[_0x3c3e('0xf')],_0x40ed51[_0x3c3e('0x2a')],_0x47204f[_0x3c3e('0x22')],_0x24161a[_0x3c3e('0x14')],_0x47204f[_0x3c3e('0x2b')]);})['then'](function(_0x484f6f){logger[_0x3c3e('0xb')](util[_0x3c3e('0xc')](_0x3c3e('0x2c'),_0x24161a['id']));return _0x24161a[_0x3c3e('0x31')]({'sentiment':_0x484f6f['Sentiment'],'sPositive':_0x484f6f['SentimentScore'][_0x3c3e('0x36')],'sNegative':_0x484f6f[_0x3c3e('0x2e')]['Negative'],'sMixed':_0x484f6f[_0x3c3e('0x2e')][_0x3c3e('0x2f')],'sNeutral':_0x484f6f[_0x3c3e('0x2e')]['Neutral'],'transcribeStatus':_0x3c3e('0x37')});})[_0x3c3e('0x18')](function(){logger['info'](util[_0x3c3e('0xc')](_0x3c3e('0x1e'),_0x24161a['id']));_0x75fdb2();});}})[_0x3c3e('0x38')](function(_0x5b1bcb){if(_0x5b1bcb){if(!_0x5b1bcb[_0x3c3e('0x39')]||_0x5b1bcb[_0x3c3e('0x39')]!==_0x3c3e('0x3a')){logger[_0x3c3e('0x3b')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x24161a['id']),util[_0x3c3e('0x3c')](_0x5b1bcb,{'showHidden':![],'depth':null}));}}_0x75fdb2();});});}function checkTranscribe(){var _0x3b6800;var _0xfa658f;var _0x651cf4;return db[_0x3c3e('0x3d')][_0x3c3e('0x3e')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x3c3e('0x18')](function(_0xf51d6b){if(!_0xf51d6b||!_0xf51d6b[_0x3c3e('0x1c')]){throw new db[(_0x3c3e('0x1f'))]['ValidationError'](_0x3c3e('0x3f'));}_0x3b6800=_0xf51d6b;return db[_0x3c3e('0x40')][_0x3c3e('0x26')]({'where':{'id':0x1}});})[_0x3c3e('0x18')](function(_0x3af2d4){if(!_0x3af2d4){throw new db[(_0x3c3e('0x1f'))][(_0x3c3e('0x20'))](_0x3c3e('0x41'));}_0xfa658f=_0x3af2d4;if(!_0xfa658f[_0x3c3e('0x7')]||!_0xfa658f[_0x3c3e('0x42')]||!_0xfa658f[_0x3c3e('0x10')]||!_0xfa658f[_0x3c3e('0x2b')]||!_0xfa658f[_0x3c3e('0x34')]){throw new db[(_0x3c3e('0x1f'))][(_0x3c3e('0x20'))](_0x3c3e('0x43'));}return db[_0x3c3e('0x35')][_0x3c3e('0x26')]({'where':{'id':_0xfa658f[_0x3c3e('0x42')]}});})[_0x3c3e('0x18')](function(_0x241967){if(!_0x241967){throw new db[(_0x3c3e('0x1f'))][(_0x3c3e('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x241967[_0x3c3e('0xf')]||!_0x241967[_0x3c3e('0x2a')]){throw new db['Sequelize'][(_0x3c3e('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x651cf4=_0x241967;var _0x55a000=[];_0x3b6800[_0x3c3e('0x44')](function(_0x2949b7){_0x55a000[_0x3c3e('0x45')](checkTranscribeJob(_0x2949b7,_0xfa658f,_0x651cf4));});return BPromise[_0x3c3e('0x46')](_0x55a000);})[_0x3c3e('0x38')](function(_0x66ec9e){if(_0x66ec9e){if(!_0x66ec9e['name']||_0x66ec9e[_0x3c3e('0x39')]!==_0x3c3e('0x3a')){logger[_0x3c3e('0x3b')](util['inspect'](_0x66ec9e,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index ec6e535..dc1c17e 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9821=['lastMsgAt','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','timeout','YYYY-MM-DD\x20HH:mm:ss','then','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll'];(function(_0xd3e3bd,_0x134be2){var _0x5951f5=function(_0x2d0428){while(--_0x2d0428){_0xd3e3bd['push'](_0xd3e3bd['shift']());}};_0x5951f5(++_0x134be2);}(_0x9821,0x72));var _0x1982=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9821[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var moment=require(_0x1982('0x0'));var Redis=require('ioredis');var util=require(_0x1982('0x1'));var config=require('../../config/environment');var db=require(_0x1982('0x2'))['db'];var logger=require(_0x1982('0x3'))(_0x1982('0x4'));config[_0x1982('0x5')]=_[_0x1982('0x6')](config[_0x1982('0x5')],{'host':_0x1982('0x7'),'port':0x18eb});var io=require(_0x1982('0x8'))(new Redis(config[_0x1982('0x5')]));function closeInteractions(){var _0x187c0b=[];return db[_0x1982('0x9')][_0x1982('0xa')]({'raw':!![],'attributes':['id',_0x1982('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,'hours')}}})['then'](function(_0x472acd){if(_0x472acd&&_0x472acd[_0x1982('0xc')]){_0x187c0b=_['map'](_0x472acd||[],'id');logger[_0x1982('0xd')](_0x1982('0xe'),_0x187c0b['join']());return db[_0x1982('0x9')]['update']({'closeReason':'system','disposition':_0x1982('0xf'),'closed':!![],'closedAt':moment()['format'](_0x1982('0x10'))},{'where':{'id':_0x187c0b}});}})[_0x1982('0x11')](function(){if(_0x187c0b&&_0x187c0b[_0x1982('0xc')]){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x187c0b['join']());for(var _0x2c90a1=0x0;_0x2c90a1<_0x187c0b['length'];_0x2c90a1++){io[_0x1982('0x12')](_0x1982('0x13'),{'id':_0x187c0b[_0x2c90a1],'closed':!![]});}}})[_0x1982('0x14')](function(_0x13b515){logger[_0x1982('0x15')](_0x1982('0x16'),_0x13b515?util[_0x1982('0x17')](_0x13b515,{'showHidden':![],'depth':null}):'');});}exports[_0x1982('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x7fcf=['hours','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','start','util','../../config/environment','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','subtract'];(function(_0x21ecf3,_0x3b4b99){var _0x3cf63a=function(_0x536c67){while(--_0x536c67){_0x21ecf3['push'](_0x21ecf3['shift']());}};_0x3cf63a(++_0x3b4b99);}(_0x7fcf,0xe0));var _0xf7fc=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x7fcf[_0x47b58b];return _0x46bebe;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require('ioredis');var util=require(_0xf7fc('0x0'));var config=require(_0xf7fc('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0xf7fc('0x2'))(_0xf7fc('0x3'));config[_0xf7fc('0x4')]=_[_0xf7fc('0x5')](config[_0xf7fc('0x4')],{'host':_0xf7fc('0x6'),'port':0x18eb});var io=require(_0xf7fc('0x7'))(new Redis(config[_0xf7fc('0x4')]));function closeInteractions(){var _0x14f10f=[];return db[_0xf7fc('0x8')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xf7fc('0x9')](0x18,_0xf7fc('0xa'))}}})['then'](function(_0x1053f4){if(_0x1053f4&&_0x1053f4['length']){_0x14f10f=_['map'](_0x1053f4||[],'id');logger[_0xf7fc('0xb')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x14f10f[_0xf7fc('0xc')]());return db[_0xf7fc('0x8')][_0xf7fc('0xd')]({'closeReason':_0xf7fc('0xe'),'disposition':_0xf7fc('0xf'),'closed':!![],'closedAt':moment()[_0xf7fc('0x10')](_0xf7fc('0x11'))},{'where':{'id':_0x14f10f}});}})[_0xf7fc('0x12')](function(){if(_0x14f10f&&_0x14f10f[_0xf7fc('0x13')]){logger[_0xf7fc('0xb')](_0xf7fc('0x14'),_0x14f10f['join']());for(var _0x21e054=0x0;_0x21e054<_0x14f10f['length'];_0x21e054++){io[_0xf7fc('0x15')](_0xf7fc('0x16'),{'id':_0x14f10f[_0x21e054],'closed':!![]});}}})[_0xf7fc('0x17')](function(_0x5a5639){logger['error'](_0xf7fc('0x18'),_0x5a5639?util['inspect'](_0x5a5639,{'showHidden':![],'depth':null}):'');});}exports[_0xf7fc('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 5dfad47..6cd4a13 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5142=['finished\x20populating','contacts1','CmHopper','bulkCreate','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','log'];(function(_0x450073,_0x1735bc){var _0x3945b1=function(_0x3752d1){while(--_0x3752d1){_0x450073['push'](_0x450073['shift']());}};_0x3945b1(++_0x1735bc);}(_0x5142,0x1f3));var _0x2514=function(_0x1461d9,_0x10e3a3){_0x1461d9=_0x1461d9-0x0;var _0x306a70=_0x5142[_0x1461d9];return _0x306a70;};'use strict';var util=require('util');var db=require(_0x2514('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x2514('0x1')]({'id':i,'firstName':_0x2514('0x2')+i,'lastName':_0x2514('0x3')+i,'phone':0xf879fb460+i,'email':_0x2514('0x4')+i+_0x2514('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x2514('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x2514('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2514('0x6')](),'updatedAt':Date[_0x2514('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x2514('0x1')]({'id':i,'firstName':_0x2514('0x2')+i,'lastName':_0x2514('0x3')+i,'phone':0xf879fb460+i,'email':_0x2514('0x4')+i+_0x2514('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x2514('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2514('0x6')](),'updatedAt':Date['now']()});}db[_0x2514('0x7')][_0x2514('0x8')]({'where':{}})[_0x2514('0x9')](function(){return db[_0x2514('0x7')]['bulkCreate'](contacts);})[_0x2514('0x9')](function(){console[_0x2514('0xa')](_0x2514('0xb'),_0x2514('0xc'));return db[_0x2514('0xd')][_0x2514('0x8')]({'where':{}});})[_0x2514('0x9')](function(){return db[_0x2514('0xd')][_0x2514('0xe')](hopper);})[_0x2514('0x9')](function(){console[_0x2514('0xa')](_0x2514('0xb'),'hopper1');return db[_0x2514('0x7')]['bulkCreate'](contacts2);})[_0x2514('0x9')](function(){console[_0x2514('0xa')](_0x2514('0xb'),'contacts2');return db[_0x2514('0xd')]['bulkCreate'](hopper2);})[_0x2514('0x9')](function(){console['log'](_0x2514('0xb'),_0x2514('0xf'));})[_0x2514('0x10')](function(_0x313893){console[_0x2514('0xa')](_0x313893);}); \ No newline at end of file +var _0x9a26=['util','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','then','CmContact','bulkCreate','log','finished\x20populating','contacts1','CmHopper','destroy','hopper1','contacts2','hopper2','catch'];(function(_0x568449,_0x1ea607){var _0x5d53af=function(_0x41ad20){while(--_0x41ad20){_0x568449['push'](_0x568449['shift']());}};_0x5d53af(++_0x1ea607);}(_0x9a26,0x169));var _0x69a2=function(_0x33396b,_0x38e90c){_0x33396b=_0x33396b-0x0;var _0x24ca65=_0x9a26[_0x33396b];return _0x24ca65;};'use strict';var util=require(_0x69a2('0x0'));var db=require(_0x69a2('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x69a2('0x2')]({'id':i,'firstName':_0x69a2('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x69a2('0x4')+i+_0x69a2('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x69a2('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x69a2('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x69a2('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x69a2('0x2')]({'id':i,'firstName':_0x69a2('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x69a2('0x4')+i+_0x69a2('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x69a2('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x69a2('0x6')]()});}db['CmContact']['destroy']({'where':{}})[_0x69a2('0x7')](function(){return db[_0x69a2('0x8')][_0x69a2('0x9')](contacts);})['then'](function(){console[_0x69a2('0xa')](_0x69a2('0xb'),_0x69a2('0xc'));return db[_0x69a2('0xd')][_0x69a2('0xe')]({'where':{}});})[_0x69a2('0x7')](function(){return db['CmHopper'][_0x69a2('0x9')](hopper);})['then'](function(){console[_0x69a2('0xa')](_0x69a2('0xb'),_0x69a2('0xf'));return db[_0x69a2('0x8')]['bulkCreate'](contacts2);})['then'](function(){console[_0x69a2('0xa')](_0x69a2('0xb'),_0x69a2('0x10'));return db[_0x69a2('0xd')][_0x69a2('0x9')](hopper2);})[_0x69a2('0x7')](function(){console[_0x69a2('0xa')](_0x69a2('0xb'),_0x69a2('0x11'));})[_0x69a2('0x12')](function(_0x521b06){console[_0x69a2('0xa')](_0x521b06);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 55eb58b..d595cb6 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72dd=['/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','../mysqldb','push','agent','format','%s%s','password','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x72dd,0x148));var _0xd72d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x72dd[_0x3947c9];return _0x2e7871;};'use strict';var util=require('util');var db=require(_0xd72d('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd72d('0x1')]({'name':util['format']('%s%s',_0xd72d('0x2'),i),'fullname':util[_0xd72d('0x3')](_0xd72d('0x4'),_0xd72d('0x2'),i),'email':util['format']('%s%s@xcally.com',_0xd72d('0x2'),i),'role':_0xd72d('0x2'),'password':_0xd72d('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0xd72d('0x6'),'ws',_0xd72d('0x7')],'disallow':[_0xd72d('0x8')],'allow':[_0xd72d('0x9')],'defaultuser':util[_0xd72d('0x3')](_0xd72d('0x4'),'agent',i),'encryption':_0xd72d('0xa'),'avpf':_0xd72d('0xa'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0xd72d('0xa'),'dtlsverify':'no','dtlscertfile':_0xd72d('0xb'),'dtlsprivatekey':_0xd72d('0xc'),'dtlssetup':_0xd72d('0xd'),'callerid':util['format'](_0xd72d('0xe'),util[_0xd72d('0x3')](_0xd72d('0x4'),_0xd72d('0x2'),i),0xfa0+i)});}db[_0xd72d('0xf')]['bulkCreate'](users)[_0xd72d('0x10')](function(){console[_0xd72d('0x11')](_0xd72d('0x12'));})[_0xd72d('0x13')](function(_0x590e07){console[_0xd72d('0x11')](_0x590e07);}); \ No newline at end of file +var _0x600d=['actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','push','format','agent','%s%s','%s%s@xcally.com','password','udp','wss','all','ulaw','yes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x600d,0x196));var _0xd600=function(_0x199185,_0x28b3bd){_0x199185=_0x199185-0x0;var _0x5c0c4f=_0x600d[_0x199185];return _0x5c0c4f;};'use strict';var util=require(_0xd600('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd600('0x1')]({'name':util[_0xd600('0x2')]('%s%s',_0xd600('0x3'),i),'fullname':util['format'](_0xd600('0x4'),_0xd600('0x3'),i),'email':util[_0xd600('0x2')](_0xd600('0x5'),'agent',i),'role':'agent','password':_0xd600('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0xd600('0x7'),'ws',_0xd600('0x8')],'disallow':[_0xd600('0x9')],'allow':[_0xd600('0xa')],'defaultuser':util['format'](_0xd600('0x4'),'agent',i),'encryption':_0xd600('0xb'),'avpf':_0xd600('0xb'),'force_avp':_0xd600('0xb'),'icesupport':'yes','dtlsenable':_0xd600('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xd600('0xc'),'callerid':util['format'](_0xd600('0xd'),util['format'](_0xd600('0x4'),'agent',i),0xfa0+i)});}db['User'][_0xd600('0xe')](users)[_0xd600('0xf')](function(){console[_0xd600('0x10')](_0xd600('0x11'));})[_0xd600('0x12')](function(_0x184551){console[_0xd600('0x10')](_0x184551);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index c4c36fd..8ce0e9b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8cb=['user_has_chat_interactions:remove','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','address','request','remoteAddress','remotePort','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','role','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','where','format','length','handshake','query','ChatInteractions','MailInteraction','MailInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Campaign','user','userProfileId','ChatQueues','WhatsappQueue','Trunk','agent','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','chat','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit'];(function(_0x39dfc6,_0x5387fc){var _0x577cad=function(_0x52e11b){while(--_0x52e11b){_0x39dfc6['push'](_0x39dfc6['shift']());}};_0x577cad(++_0x5387fc);}(_0xb8cb,0xd9));var _0xbb8c=function(_0x335a25,_0x1b88ba){_0x335a25=_0x335a25-0x0;var _0x31ebbe=_0xb8cb[_0x335a25];return _0x31ebbe;};'use strict';var _=require(_0xbb8c('0x0'));var util=require(_0xbb8c('0x1'));var BPromise=require(_0xbb8c('0x2'));var db=require(_0xbb8c('0x3'))['db'];var config=require(_0xbb8c('0x4'));var queryQueues={'attributes':['id',_0xbb8c('0x5')],'include':[{'as':_0xbb8c('0x6'),'model':db['User'],'attributes':['id',_0xbb8c('0x5'),_0xbb8c('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xbb8c('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xbb8c('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xbb8c('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xbb8c('0x5'),_0xbb8c('0x9')],'where':{'type':_0xbb8c('0xa')}};function getAssociatedResources(_0x823c83,_0x1d62d4,_0x2a9791){return db[_0xbb8c('0xb')][_0xbb8c('0xc')]({'where':{'name':_0x823c83,'userProfileId':_0x1d62d4},'raw':!![]})[_0xbb8c('0xd')](function(_0x3aea3d){if(_0x3aea3d){if(_0x3aea3d[_0xbb8c('0xe')]){switch(_0x823c83){case _0xbb8c('0xf'):case'ChatQueues':case _0xbb8c('0x10'):case _0xbb8c('0x11'):case _0xbb8c('0x12'):case _0xbb8c('0x13'):case _0xbb8c('0x14'):return db[_0x2a9791]['findAll'](queryQueues);case _0xbb8c('0x15'):return db[_0x2a9791][_0xbb8c('0x16')](queryTelephones);case _0xbb8c('0x17'):return db[_0x2a9791][_0xbb8c('0x16')](queryTrunks);case _0xbb8c('0x18'):return db[_0x2a9791][_0xbb8c('0x16')](queryCampaigns);}}else{return db[_0xbb8c('0x19')]['findAll']({'attributes':[_0xbb8c('0x1a')],'where':{'sectionId':_0x3aea3d['id']},'raw':!![]})[_0xbb8c('0xd')](function(_0x425891){if(_0x425891){var _0x403710={'where':{'id':_[_0xbb8c('0x1b')](_0x425891,_0xbb8c('0x1a'))},'raw':!![]};switch(_0x2a9791){case _0xbb8c('0x1c'):_0x403710[_0xbb8c('0x1d')][_0xbb8c('0x7')]=_0xbb8c('0x8');break;case'Campaign':_0x403710[_0xbb8c('0x1d')][_0xbb8c('0x9')]=_0xbb8c('0xa');break;}return db[_0x2a9791][_0xbb8c('0x16')](_0x403710);}else{return[];}});}}else{return[];}})[_0xbb8c('0xd')](function(_0x25e2c4){return _0x25e2c4;});}function joinOrLeaveQueues(_0x520ea9,_0x472156,_0x30e1b7,_0x55d9c4){_0x520ea9[_0x472156](util[_0xbb8c('0x1e')]('%s:queue:%s',_0x30e1b7,_0x55d9c4[_0xbb8c('0x5')]));if(_0x55d9c4['Agents']){for(var _0x32b961=0x0;_0x32b961<_0x55d9c4[_0xbb8c('0x6')][_0xbb8c('0x1f')];_0x32b961+=0x1){_0x520ea9[_0x472156](util['format']('user:%s',_0x55d9c4[_0xbb8c('0x6')][_0x32b961]['name']));}}}function joinOrLeave(_0x171530,_0x1b764d,_0x36163c){var _0xec7fb5;if(_0x171530[_0xbb8c('0x20')][_0xbb8c('0x21')]['id']){db[_0xbb8c('0x1c')]['find']({'attributes':['id',_0xbb8c('0x5'),'role','userProfileId'],'where':{'id':_0x171530[_0xbb8c('0x20')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0xbb8c('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xbb8c('0x23')],'as':_0xbb8c('0x24'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xbb8c('0x25')],'as':_0xbb8c('0x26'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xbb8c('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xbb8c('0x28')],'as':_0xbb8c('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x271ad7){if(_0x271ad7){_0xec7fb5=_0x271ad7;_0x171530[_0x1b764d](util[_0xbb8c('0x1e')](_0xbb8c('0x2a'),_0x271ad7[_0xbb8c('0x5')]));var _0x260d7b=[];switch(_0x271ad7[_0xbb8c('0x7')]){case _0xbb8c('0x2b'):_0x171530[_0x1b764d](_0xbb8c('0x2c'));_0x171530[_0x1b764d](_0xbb8c('0x2d'));if(queryQueues[_0xbb8c('0x2e')]('include')){delete queryQueues['include'];}_0x260d7b[_0xbb8c('0x2f')](db[_0xbb8c('0x30')][_0xbb8c('0x16')](queryQueues));_0x260d7b[_0xbb8c('0x2f')](db[_0xbb8c('0x31')]['findAll'](queryQueues));_0x260d7b[_0xbb8c('0x2f')](db[_0xbb8c('0x32')][_0xbb8c('0x16')](queryQueues));_0x260d7b[_0xbb8c('0x2f')](db[_0xbb8c('0x33')][_0xbb8c('0x16')](queryQueues));_0x260d7b[_0xbb8c('0x2f')](db[_0xbb8c('0x34')][_0xbb8c('0x16')](queryQueues));_0x260d7b['push'](db[_0xbb8c('0x35')][_0xbb8c('0x16')](queryQueues));_0x260d7b[_0xbb8c('0x2f')](db['WhatsappQueue']['findAll'](queryQueues));_0x260d7b[_0xbb8c('0x2f')](db[_0xbb8c('0x1c')][_0xbb8c('0x16')](queryTelephones));_0x260d7b[_0xbb8c('0x2f')](db['Trunk'][_0xbb8c('0x16')](queryTrunks));_0x260d7b[_0xbb8c('0x2f')](db[_0xbb8c('0x36')][_0xbb8c('0x16')](queryCampaigns));_0x260d7b[_0xbb8c('0x2f')](db['User'][_0xbb8c('0x16')](queryAgents));break;case _0xbb8c('0x37'):_0x171530[_0x1b764d](_0xbb8c('0x2c'));_0x171530[_0x1b764d](_0xbb8c('0x2d'));_0x260d7b['push'](getAssociatedResources(_0xbb8c('0xf'),_0x271ad7[_0xbb8c('0x38')],_0xbb8c('0x30')));_0x260d7b[_0xbb8c('0x2f')](getAssociatedResources(_0xbb8c('0x39'),_0x271ad7[_0xbb8c('0x38')],_0xbb8c('0x31')));_0x260d7b[_0xbb8c('0x2f')](getAssociatedResources(_0xbb8c('0x10'),_0x271ad7[_0xbb8c('0x38')],_0xbb8c('0x32')));_0x260d7b[_0xbb8c('0x2f')](getAssociatedResources('SmsQueues',_0x271ad7[_0xbb8c('0x38')],_0xbb8c('0x33')));_0x260d7b[_0xbb8c('0x2f')](getAssociatedResources(_0xbb8c('0x12'),_0x271ad7['userProfileId'],_0xbb8c('0x34')));_0x260d7b['push'](getAssociatedResources('OpenchannelQueues',_0x271ad7[_0xbb8c('0x38')],_0xbb8c('0x35')));_0x260d7b[_0xbb8c('0x2f')](getAssociatedResources('WhatsappQueues',_0x271ad7[_0xbb8c('0x38')],_0xbb8c('0x3a')));_0x260d7b['push'](getAssociatedResources(_0xbb8c('0x15'),_0x271ad7[_0xbb8c('0x38')],_0xbb8c('0x1c')));_0x260d7b[_0xbb8c('0x2f')](getAssociatedResources('Trunks',_0x271ad7[_0xbb8c('0x38')],_0xbb8c('0x3b')));_0x260d7b[_0xbb8c('0x2f')](getAssociatedResources('IvrCampaigns',_0x271ad7[_0xbb8c('0x38')],_0xbb8c('0x36')));_0x260d7b['push'](db['User'][_0xbb8c('0x16')](queryAgents));break;case _0xbb8c('0x3c'):_0x171530[_0x1b764d]('voice:inbound');_0x171530[_0x1b764d]('voice:outbound');_0x260d7b[_0xbb8c('0x2f')](_0x271ad7['getVoiceQueues']({'attributes':['id',_0xbb8c('0x5')]}));_0x260d7b['push'](_0x271ad7[_0xbb8c('0x3d')]({'attributes':['id','name']}));_0x260d7b[_0xbb8c('0x2f')](_0x271ad7[_0xbb8c('0x3e')]({'attributes':['id',_0xbb8c('0x5')]}));_0x260d7b[_0xbb8c('0x2f')](_0x271ad7[_0xbb8c('0x3f')]({'attributes':['id',_0xbb8c('0x5')]}));_0x260d7b['push'](_0x271ad7[_0xbb8c('0x40')]({'attributes':['id','name']}));_0x260d7b[_0xbb8c('0x2f')](_0x271ad7[_0xbb8c('0x41')]({'attributes':['id',_0xbb8c('0x5')]}));_0x260d7b[_0xbb8c('0x2f')](_0x271ad7[_0xbb8c('0x42')]({'attributes':['id',_0xbb8c('0x5')]}));break;}return BPromise['all'](_0x260d7b);}})['then'](function(_0x110760){if(_0x110760&&_0x110760[_0xbb8c('0x1f')]){for(var _0x53643d=0x0;_0x53643d<_0x110760[_0xbb8c('0x1f')];_0x53643d+=0x1){for(var _0x317b4f=0x0;_0x317b4f<_0x110760[_0x53643d][_0xbb8c('0x1f')];_0x317b4f+=0x1){switch(_0x53643d){case 0x0:joinOrLeaveQueues(_0x171530,_0x1b764d,'voice',_0x110760[_0x53643d][_0x317b4f]);break;case 0x1:joinOrLeaveQueues(_0x171530,_0x1b764d,_0xbb8c('0x43'),_0x110760[_0x53643d][_0x317b4f]);break;case 0x2:joinOrLeaveQueues(_0x171530,_0x1b764d,'fax',_0x110760[_0x53643d][_0x317b4f]);break;case 0x3:joinOrLeaveQueues(_0x171530,_0x1b764d,_0xbb8c('0x44'),_0x110760[_0x53643d][_0x317b4f]);break;case 0x4:joinOrLeaveQueues(_0x171530,_0x1b764d,_0xbb8c('0x45'),_0x110760[_0x53643d][_0x317b4f]);break;case 0x5:joinOrLeaveQueues(_0x171530,_0x1b764d,_0xbb8c('0x46'),_0x110760[_0x53643d][_0x317b4f]);break;case 0x6:joinOrLeaveQueues(_0x171530,_0x1b764d,'whatsapp',_0x110760[_0x53643d][_0x317b4f]);break;case 0x7:if(_0xec7fb5[_0xbb8c('0x7')]!==_0xbb8c('0x3c'))_0x171530[_0x1b764d](util[_0xbb8c('0x1e')](_0xbb8c('0x47'),_0x110760[_0x53643d][_0x317b4f][_0xbb8c('0x5')]));break;case 0x8:if(_0xec7fb5[_0xbb8c('0x7')]!==_0xbb8c('0x3c'))_0x171530[_0x1b764d](util[_0xbb8c('0x1e')](_0xbb8c('0x48'),_0x110760[_0x53643d][_0x317b4f][_0xbb8c('0x5')]));break;case 0x9:if(_0xec7fb5['role']!==_0xbb8c('0x3c'))_0x171530[_0x1b764d](util[_0xbb8c('0x1e')](_0xbb8c('0x49'),_0x110760[_0x53643d][_0x317b4f]['type'],_0x110760[_0x53643d][_0x317b4f][_0xbb8c('0x5')]));break;case 0xa:_0x171530[_0x1b764d](util[_0xbb8c('0x1e')](_0xbb8c('0x2a'),_0x110760[_0x53643d][_0x317b4f][_0xbb8c('0x5')]));break;}}}}})[_0xbb8c('0xd')](function(){if(_0x1b764d===_0xbb8c('0x4a')){var _0x4c5afd=_[_0xbb8c('0x1b')](_0xec7fb5[_0xbb8c('0x22')],'id');return _0xec7fb5[_0xbb8c('0x4b')](_0x4c5afd)['then'](function(){for(var _0x3973c3=0x0;_0x3973c3<_0x4c5afd['length'];_0x3973c3+=0x1){_0x36163c[_0xbb8c('0x4c')](_0xbb8c('0x4d'),{'ChatInteractionId':Number(_0x4c5afd[_0x3973c3]),'UserId':Number(_0xec7fb5['id'])});}});}})[_0xbb8c('0xd')](function(){if(_0x1b764d===_0xbb8c('0x4a')){var _0x16c9e3=_['map'](_0xec7fb5[_0xbb8c('0x24')],'id');return _0xec7fb5['removeMailInteractions'](_0x16c9e3)[_0xbb8c('0xd')](function(){for(var _0x1ff96f=0x0;_0x1ff96f<_0x16c9e3[_0xbb8c('0x1f')];_0x1ff96f+=0x1){_0x36163c['emit'](_0xbb8c('0x4e'),{'MailInteractionId':Number(_0x16c9e3[_0x1ff96f]),'UserId':Number(_0xec7fb5['id'])});}});}})[_0xbb8c('0xd')](function(){if(_0x1b764d===_0xbb8c('0x4a')){var _0x2bce32=_[_0xbb8c('0x1b')](_0xec7fb5[_0xbb8c('0x4f')],'id');return _0xec7fb5[_0xbb8c('0x50')](_0x2bce32)[_0xbb8c('0xd')](function(){for(var _0x22475d=0x0;_0x22475d<_0x2bce32[_0xbb8c('0x1f')];_0x22475d+=0x1){_0x36163c[_0xbb8c('0x4c')](_0xbb8c('0x51'),{'FaxInteractionId':Number(_0x2bce32[_0x22475d]),'UserId':Number(_0xec7fb5['id'])});}});}})[_0xbb8c('0xd')](function(){if(_0x1b764d==='leave'){var _0x582d95=_[_0xbb8c('0x1b')](_0xec7fb5[_0xbb8c('0x26')],'id');return _0xec7fb5['removeSmsInteractions'](_0x582d95)[_0xbb8c('0xd')](function(){for(var _0x4244cf=0x0;_0x4244cf<_0x582d95['length'];_0x4244cf+=0x1){_0x36163c[_0xbb8c('0x4c')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x582d95[_0x4244cf]),'UserId':Number(_0xec7fb5['id'])});}});}})[_0xbb8c('0xd')](function(){if(_0x1b764d===_0xbb8c('0x4a')){var _0x13a850=_[_0xbb8c('0x1b')](_0xec7fb5['OpenchannelInteractions'],'id');return _0xec7fb5[_0xbb8c('0x52')](_0x13a850)['then'](function(){for(var _0x3eccad=0x0;_0x3eccad<_0x13a850['length'];_0x3eccad+=0x1){_0x36163c['emit'](_0xbb8c('0x53'),{'OpenchannelInteractionId':Number(_0x13a850[_0x3eccad]),'UserId':Number(_0xec7fb5['id'])});}});}})['then'](function(){if(_0x1b764d===_0xbb8c('0x4a')){var _0x241bf0=_[_0xbb8c('0x1b')](_0xec7fb5[_0xbb8c('0x29')],'id');return _0xec7fb5[_0xbb8c('0x54')](_0x241bf0)[_0xbb8c('0xd')](function(){for(var _0x20d469=0x0;_0x20d469<_0x241bf0[_0xbb8c('0x1f')];_0x20d469+=0x1){_0x36163c[_0xbb8c('0x4c')](_0xbb8c('0x55'),{'WhatsappInteractionId':Number(_0x241bf0[_0x20d469]),'UserId':Number(_0xec7fb5['id'])});}});}})[_0xbb8c('0x56')](function(_0x24a5d5){_0x171530[_0xbb8c('0x57')](_0x24a5d5);});}}function onDisconnect(_0x18a425,_0x333c16){joinOrLeave(_0x18a425,_0xbb8c('0x4a'),_0x333c16);}function onConnect(_0x58d0db){joinOrLeave(_0x58d0db,_0xbb8c('0x58'));}exports['default']=function(_0xbb05f9){_0xbb05f9['on'](_0xbb8c('0x59'),function(_0x2eccea){_0x2eccea['setMaxListeners'](0x0);_0x2eccea[_0xbb8c('0x5a')]=_0x2eccea[_0xbb8c('0x5b')]['connection'][_0xbb8c('0x5c')]+':'+_0x2eccea['request']['connection'][_0xbb8c('0x5d')];_0x2eccea['connectedAt']=new Date();_0x2eccea[_0xbb8c('0x57')]=function(_0x528db9){console[_0xbb8c('0x57')]('SocketIO\x20'+_0x2eccea[_0xbb8c('0x5e')][_0xbb8c('0x5')]+'['+_0x2eccea['address']+']',_0x528db9);};_0x2eccea['on'](_0xbb8c('0x5f'),function(){onDisconnect(_0x2eccea,_0xbb05f9);_0x2eccea[_0xbb8c('0x57')](_0xbb8c('0x60'));});onConnect(_0x2eccea);_0x2eccea[_0xbb8c('0x57')](_0xbb8c('0x61'));});}; \ No newline at end of file +var _0x19fc=['FaxInteractions','SmsInteraction','SmsInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','push','MailQueue','OpenchannelQueue','WhatsappQueue','user','voice:inbound','VoiceQueue','SmsQueues','SmsQueue','OpenchannelQueues','getVoiceQueues','getSmsQueues','getWhatsappQueues','all','chat','fax','sms','mail','whatsapp','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','join','default','setMaxListeners','request','remoteAddress','connection','remotePort','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','where','Campaign','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction'];(function(_0x2d9535,_0x4bc592){var _0xb4e710=function(_0x50b9a9){while(--_0x50b9a9){_0x2d9535['push'](_0x2d9535['shift']());}};_0xb4e710(++_0x4bc592);}(_0x19fc,0x150));var _0xc19f=function(_0x2d6d0f,_0x3cf2a5){_0x2d6d0f=_0x2d6d0f-0x0;var _0xd2bee6=_0x19fc[_0x2d6d0f];return _0xd2bee6;};'use strict';var _=require(_0xc19f('0x0'));var util=require('util');var BPromise=require(_0xc19f('0x1'));var db=require(_0xc19f('0x2'))['db'];var config=require(_0xc19f('0x3'));var queryQueues={'attributes':['id',_0xc19f('0x4')],'include':[{'as':_0xc19f('0x5'),'model':db[_0xc19f('0x6')],'attributes':['id',_0xc19f('0x4'),_0xc19f('0x7')],'raw':!![],'where':{'role':_0xc19f('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xc19f('0x4')],'where':{'role':_0xc19f('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xc19f('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xc19f('0x4')],'where':{'role':_0xc19f('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xc19f('0x4'),_0xc19f('0xa')],'where':{'type':_0xc19f('0xb')}};function getAssociatedResources(_0x2fe58b,_0x5ce1ad,_0x2da042){return db[_0xc19f('0xc')]['findOne']({'where':{'name':_0x2fe58b,'userProfileId':_0x5ce1ad},'raw':!![]})['then'](function(_0x2a958a){if(_0x2a958a){if(_0x2a958a[_0xc19f('0xd')]){switch(_0x2fe58b){case _0xc19f('0xe'):case _0xc19f('0xf'):case _0xc19f('0x10'):case'SmsQueues':case _0xc19f('0x11'):case'OpenchannelQueues':case _0xc19f('0x12'):return db[_0x2da042]['findAll'](queryQueues);case'Telephones':return db[_0x2da042][_0xc19f('0x13')](queryTelephones);case _0xc19f('0x14'):return db[_0x2da042][_0xc19f('0x13')](queryTrunks);case _0xc19f('0x15'):return db[_0x2da042][_0xc19f('0x13')](queryCampaigns);}}else{return db[_0xc19f('0x16')][_0xc19f('0x13')]({'attributes':[_0xc19f('0x17')],'where':{'sectionId':_0x2a958a['id']},'raw':!![]})[_0xc19f('0x18')](function(_0x1fc69d){if(_0x1fc69d){var _0x38a3c3={'where':{'id':_[_0xc19f('0x19')](_0x1fc69d,_0xc19f('0x17'))},'raw':!![]};switch(_0x2da042){case _0xc19f('0x6'):_0x38a3c3[_0xc19f('0x1a')][_0xc19f('0x7')]=_0xc19f('0x9');break;case _0xc19f('0x1b'):_0x38a3c3[_0xc19f('0x1a')][_0xc19f('0xa')]=_0xc19f('0xb');break;}return db[_0x2da042][_0xc19f('0x13')](_0x38a3c3);}else{return[];}});}}else{return[];}})[_0xc19f('0x18')](function(_0x4ba5d8){return _0x4ba5d8;});}function joinOrLeaveQueues(_0x346aa8,_0x39210a,_0x7307d5,_0x74a1b6){_0x346aa8[_0x39210a](util[_0xc19f('0x1c')](_0xc19f('0x1d'),_0x7307d5,_0x74a1b6[_0xc19f('0x4')]));if(_0x74a1b6[_0xc19f('0x5')]){for(var _0x53be70=0x0;_0x53be70<_0x74a1b6['Agents'][_0xc19f('0x1e')];_0x53be70+=0x1){_0x346aa8[_0x39210a](util[_0xc19f('0x1c')](_0xc19f('0x1f'),_0x74a1b6[_0xc19f('0x5')][_0x53be70]['name']));}}}function joinOrLeave(_0x5b79b2,_0x2a7f6a,_0x2af360){var _0x4c8d63;if(_0x5b79b2[_0xc19f('0x20')]['query']['id']){db[_0xc19f('0x6')][_0xc19f('0x21')]({'attributes':['id',_0xc19f('0x4'),_0xc19f('0x7'),_0xc19f('0x22')],'where':{'id':_0x5b79b2[_0xc19f('0x20')][_0xc19f('0x23')]['id']},'include':[{'model':db[_0xc19f('0x24')],'as':_0xc19f('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xc19f('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc19f('0x27')],'as':_0xc19f('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xc19f('0x29')],'as':_0xc19f('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc19f('0x2b')],'as':_0xc19f('0x2c'),'attributes':['id'],'raw':!![]}]})[_0xc19f('0x18')](function(_0x32699c){if(_0x32699c){_0x4c8d63=_0x32699c;_0x5b79b2[_0x2a7f6a](util['format'](_0xc19f('0x1f'),_0x32699c[_0xc19f('0x4')]));var _0x494252=[];switch(_0x32699c[_0xc19f('0x7')]){case _0xc19f('0x2d'):_0x5b79b2[_0x2a7f6a]('voice:inbound');_0x5b79b2[_0x2a7f6a](_0xc19f('0x2e'));if(queryQueues[_0xc19f('0x2f')]('include')){delete queryQueues['include'];}_0x494252[_0xc19f('0x30')](db['VoiceQueue'][_0xc19f('0x13')](queryQueues));_0x494252[_0xc19f('0x30')](db['ChatQueue'][_0xc19f('0x13')](queryQueues));_0x494252[_0xc19f('0x30')](db['FaxQueue'][_0xc19f('0x13')](queryQueues));_0x494252[_0xc19f('0x30')](db['SmsQueue'][_0xc19f('0x13')](queryQueues));_0x494252[_0xc19f('0x30')](db[_0xc19f('0x31')][_0xc19f('0x13')](queryQueues));_0x494252['push'](db[_0xc19f('0x32')]['findAll'](queryQueues));_0x494252[_0xc19f('0x30')](db[_0xc19f('0x33')][_0xc19f('0x13')](queryQueues));_0x494252[_0xc19f('0x30')](db[_0xc19f('0x6')][_0xc19f('0x13')](queryTelephones));_0x494252[_0xc19f('0x30')](db['Trunk']['findAll'](queryTrunks));_0x494252[_0xc19f('0x30')](db[_0xc19f('0x1b')][_0xc19f('0x13')](queryCampaigns));_0x494252['push'](db['User'][_0xc19f('0x13')](queryAgents));break;case _0xc19f('0x34'):_0x5b79b2[_0x2a7f6a](_0xc19f('0x35'));_0x5b79b2[_0x2a7f6a](_0xc19f('0x2e'));_0x494252['push'](getAssociatedResources(_0xc19f('0xe'),_0x32699c[_0xc19f('0x22')],_0xc19f('0x36')));_0x494252[_0xc19f('0x30')](getAssociatedResources(_0xc19f('0xf'),_0x32699c[_0xc19f('0x22')],'ChatQueue'));_0x494252[_0xc19f('0x30')](getAssociatedResources(_0xc19f('0x10'),_0x32699c[_0xc19f('0x22')],'FaxQueue'));_0x494252[_0xc19f('0x30')](getAssociatedResources(_0xc19f('0x37'),_0x32699c[_0xc19f('0x22')],_0xc19f('0x38')));_0x494252['push'](getAssociatedResources(_0xc19f('0x11'),_0x32699c['userProfileId'],_0xc19f('0x31')));_0x494252[_0xc19f('0x30')](getAssociatedResources(_0xc19f('0x39'),_0x32699c[_0xc19f('0x22')],_0xc19f('0x32')));_0x494252['push'](getAssociatedResources(_0xc19f('0x12'),_0x32699c['userProfileId'],_0xc19f('0x33')));_0x494252['push'](getAssociatedResources('Telephones',_0x32699c[_0xc19f('0x22')],_0xc19f('0x6')));_0x494252['push'](getAssociatedResources(_0xc19f('0x14'),_0x32699c['userProfileId'],'Trunk'));_0x494252[_0xc19f('0x30')](getAssociatedResources('IvrCampaigns',_0x32699c[_0xc19f('0x22')],_0xc19f('0x1b')));_0x494252[_0xc19f('0x30')](db[_0xc19f('0x6')][_0xc19f('0x13')](queryAgents));break;case _0xc19f('0x8'):_0x5b79b2[_0x2a7f6a](_0xc19f('0x35'));_0x5b79b2[_0x2a7f6a](_0xc19f('0x2e'));_0x494252[_0xc19f('0x30')](_0x32699c[_0xc19f('0x3a')]({'attributes':['id',_0xc19f('0x4')]}));_0x494252['push'](_0x32699c['getChatQueues']({'attributes':['id',_0xc19f('0x4')]}));_0x494252['push'](_0x32699c['getFaxQueues']({'attributes':['id',_0xc19f('0x4')]}));_0x494252[_0xc19f('0x30')](_0x32699c[_0xc19f('0x3b')]({'attributes':['id','name']}));_0x494252['push'](_0x32699c['getMailQueues']({'attributes':['id',_0xc19f('0x4')]}));_0x494252['push'](_0x32699c['getOpenchannelQueues']({'attributes':['id',_0xc19f('0x4')]}));_0x494252[_0xc19f('0x30')](_0x32699c[_0xc19f('0x3c')]({'attributes':['id',_0xc19f('0x4')]}));break;}return BPromise[_0xc19f('0x3d')](_0x494252);}})['then'](function(_0x383cd8){if(_0x383cd8&&_0x383cd8['length']){for(var _0x39da63=0x0;_0x39da63<_0x383cd8[_0xc19f('0x1e')];_0x39da63+=0x1){for(var _0x4a8547=0x0;_0x4a8547<_0x383cd8[_0x39da63]['length'];_0x4a8547+=0x1){switch(_0x39da63){case 0x0:joinOrLeaveQueues(_0x5b79b2,_0x2a7f6a,'voice',_0x383cd8[_0x39da63][_0x4a8547]);break;case 0x1:joinOrLeaveQueues(_0x5b79b2,_0x2a7f6a,_0xc19f('0x3e'),_0x383cd8[_0x39da63][_0x4a8547]);break;case 0x2:joinOrLeaveQueues(_0x5b79b2,_0x2a7f6a,_0xc19f('0x3f'),_0x383cd8[_0x39da63][_0x4a8547]);break;case 0x3:joinOrLeaveQueues(_0x5b79b2,_0x2a7f6a,_0xc19f('0x40'),_0x383cd8[_0x39da63][_0x4a8547]);break;case 0x4:joinOrLeaveQueues(_0x5b79b2,_0x2a7f6a,_0xc19f('0x41'),_0x383cd8[_0x39da63][_0x4a8547]);break;case 0x5:joinOrLeaveQueues(_0x5b79b2,_0x2a7f6a,'openchannel',_0x383cd8[_0x39da63][_0x4a8547]);break;case 0x6:joinOrLeaveQueues(_0x5b79b2,_0x2a7f6a,_0xc19f('0x42'),_0x383cd8[_0x39da63][_0x4a8547]);break;case 0x7:if(_0x4c8d63['role']!==_0xc19f('0x8'))_0x5b79b2[_0x2a7f6a](util['format'](_0xc19f('0x43'),_0x383cd8[_0x39da63][_0x4a8547]['name']));break;case 0x8:if(_0x4c8d63[_0xc19f('0x7')]!==_0xc19f('0x8'))_0x5b79b2[_0x2a7f6a](util[_0xc19f('0x1c')]('trunk:%s',_0x383cd8[_0x39da63][_0x4a8547]['name']));break;case 0x9:if(_0x4c8d63[_0xc19f('0x7')]!==_0xc19f('0x8'))_0x5b79b2[_0x2a7f6a](util[_0xc19f('0x1c')](_0xc19f('0x44'),_0x383cd8[_0x39da63][_0x4a8547][_0xc19f('0xa')],_0x383cd8[_0x39da63][_0x4a8547][_0xc19f('0x4')]));break;case 0xa:_0x5b79b2[_0x2a7f6a](util['format']('user:%s',_0x383cd8[_0x39da63][_0x4a8547][_0xc19f('0x4')]));break;}}}}})[_0xc19f('0x18')](function(){if(_0x2a7f6a===_0xc19f('0x45')){var _0x34c836=_[_0xc19f('0x19')](_0x4c8d63[_0xc19f('0x25')],'id');return _0x4c8d63[_0xc19f('0x46')](_0x34c836)[_0xc19f('0x18')](function(){for(var _0xb1157d=0x0;_0xb1157d<_0x34c836[_0xc19f('0x1e')];_0xb1157d+=0x1){_0x2af360[_0xc19f('0x47')](_0xc19f('0x48'),{'ChatInteractionId':Number(_0x34c836[_0xb1157d]),'UserId':Number(_0x4c8d63['id'])});}});}})[_0xc19f('0x18')](function(){if(_0x2a7f6a===_0xc19f('0x45')){var _0x311ab2=_[_0xc19f('0x19')](_0x4c8d63[_0xc19f('0x49')],'id');return _0x4c8d63[_0xc19f('0x4a')](_0x311ab2)[_0xc19f('0x18')](function(){for(var _0x116d57=0x0;_0x116d57<_0x311ab2[_0xc19f('0x1e')];_0x116d57+=0x1){_0x2af360[_0xc19f('0x47')](_0xc19f('0x4b'),{'MailInteractionId':Number(_0x311ab2[_0x116d57]),'UserId':Number(_0x4c8d63['id'])});}});}})[_0xc19f('0x18')](function(){if(_0x2a7f6a==='leave'){var _0x5c157b=_[_0xc19f('0x19')](_0x4c8d63[_0xc19f('0x28')],'id');return _0x4c8d63['removeFaxInteractions'](_0x5c157b)[_0xc19f('0x18')](function(){for(var _0x3cabdb=0x0;_0x3cabdb<_0x5c157b[_0xc19f('0x1e')];_0x3cabdb+=0x1){_0x2af360['emit'](_0xc19f('0x4c'),{'FaxInteractionId':Number(_0x5c157b[_0x3cabdb]),'UserId':Number(_0x4c8d63['id'])});}});}})[_0xc19f('0x18')](function(){if(_0x2a7f6a===_0xc19f('0x45')){var _0x31afe5=_[_0xc19f('0x19')](_0x4c8d63[_0xc19f('0x2a')],'id');return _0x4c8d63[_0xc19f('0x4d')](_0x31afe5)[_0xc19f('0x18')](function(){for(var _0x23442e=0x0;_0x23442e<_0x31afe5['length'];_0x23442e+=0x1){_0x2af360[_0xc19f('0x47')](_0xc19f('0x4e'),{'SmsInteractionId':Number(_0x31afe5[_0x23442e]),'UserId':Number(_0x4c8d63['id'])});}});}})['then'](function(){if(_0x2a7f6a===_0xc19f('0x45')){var _0x58484d=_[_0xc19f('0x19')](_0x4c8d63[_0xc19f('0x4f')],'id');return _0x4c8d63[_0xc19f('0x50')](_0x58484d)['then'](function(){for(var _0x4bb91e=0x0;_0x4bb91e<_0x58484d[_0xc19f('0x1e')];_0x4bb91e+=0x1){_0x2af360[_0xc19f('0x47')](_0xc19f('0x51'),{'OpenchannelInteractionId':Number(_0x58484d[_0x4bb91e]),'UserId':Number(_0x4c8d63['id'])});}});}})['then'](function(){if(_0x2a7f6a===_0xc19f('0x45')){var _0x595193=_[_0xc19f('0x19')](_0x4c8d63[_0xc19f('0x2c')],'id');return _0x4c8d63['removeWhatsappInteractions'](_0x595193)[_0xc19f('0x18')](function(){for(var _0x43f338=0x0;_0x43f338<_0x595193[_0xc19f('0x1e')];_0x43f338+=0x1){_0x2af360[_0xc19f('0x47')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x595193[_0x43f338]),'UserId':Number(_0x4c8d63['id'])});}});}})['catch'](function(_0xbd3b96){_0x5b79b2['log'](_0xbd3b96);});}}function onDisconnect(_0xcc27bf,_0x29a2cc){joinOrLeave(_0xcc27bf,'leave',_0x29a2cc);}function onConnect(_0x1c68b7){joinOrLeave(_0x1c68b7,_0xc19f('0x52'));}exports[_0xc19f('0x53')]=function(_0xff5be2){_0xff5be2['on']('connection',function(_0x28bb77){_0x28bb77[_0xc19f('0x54')](0x0);_0x28bb77['address']=_0x28bb77[_0xc19f('0x55')]['connection'][_0xc19f('0x56')]+':'+_0x28bb77[_0xc19f('0x55')][_0xc19f('0x57')][_0xc19f('0x58')];_0x28bb77['connectedAt']=new Date();_0x28bb77[_0xc19f('0x59')]=function(_0x4f5ca7){console[_0xc19f('0x59')](_0xc19f('0x5a')+_0x28bb77[_0xc19f('0x5b')]['name']+'['+_0x28bb77['address']+']',_0x4f5ca7);};_0x28bb77['on'](_0xc19f('0x5c'),function(){onDisconnect(_0x28bb77,_0xff5be2);_0x28bb77[_0xc19f('0x59')](_0xc19f('0x5d'));});onConnect(_0x28bb77);_0x28bb77[_0xc19f('0x59')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 6df4b83..3edabd1 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 _0xdf6d=['OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','event','describe','keys','length','startsWith','cf_','push','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','UserId','User','find','name','format','SIP/%s','incomingmessage','outgoingmessage','opened','CmContact','contact','changed','closed','default','model','callback','toLowerCase','../../mysqldb','jayson/promise','../logger','triggers','lodash','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xdf6d,0x70));var _0xddf6=function(_0x4291b6,_0x5f39cc){_0x4291b6=_0x4291b6-0x0;var _0xab0a33=_0xdf6d[_0x4291b6];return _0xab0a33;};'use strict';var util=require('util');var db=require(_0xddf6('0x0'))['db'];var jayson=require(_0xddf6('0x1'));var logger=require(_0xddf6('0x2'))(_0xddf6('0x3'));var _=require(_0xddf6('0x4'));var client=jayson['client'][_0xddf6('0x5')]({'port':0x232a});var triggers=[{'channel':_0xddf6('0x6'),'model':_0xddf6('0x7'),'event':_0xddf6('0x8'),'condition':_0xddf6('0x9'),'callback':afterCreate},{'channel':_0xddf6('0x6'),'model':_0xddf6('0x7'),'event':_0xddf6('0xa'),'condition':_0xddf6('0xb'),'callback':afterUpdate},{'channel':_0xddf6('0x6'),'model':_0xddf6('0xc'),'event':'afterCreate','condition':_0xddf6('0xd'),'callback':afterCreateMessage},{'channel':_0xddf6('0xe'),'model':_0xddf6('0xf'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xddf6('0xe'),'model':'SmsInteraction','event':_0xddf6('0xa'),'condition':_0xddf6('0xb'),'callback':afterUpdate},{'channel':'Sms','model':_0xddf6('0x10'),'event':'afterCreate','condition':_0xddf6('0xd'),'callback':afterCreateMessage},{'channel':_0xddf6('0x11'),'model':_0xddf6('0x12'),'event':'afterCreate','condition':_0xddf6('0x9'),'callback':afterCreate},{'channel':_0xddf6('0x11'),'model':_0xddf6('0x12'),'event':_0xddf6('0xa'),'condition':_0xddf6('0xb'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0xddf6('0x13'),'event':_0xddf6('0x8'),'condition':_0xddf6('0xd'),'callback':afterCreateMessage},{'channel':_0xddf6('0x14'),'model':_0xddf6('0x15'),'event':_0xddf6('0x8'),'condition':_0xddf6('0x9'),'callback':afterCreate},{'channel':'Fax','model':_0xddf6('0x15'),'event':_0xddf6('0xa'),'condition':_0xddf6('0xb'),'callback':afterUpdate},{'channel':_0xddf6('0x14'),'model':_0xddf6('0x16'),'event':_0xddf6('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':_0xddf6('0x8'),'condition':_0xddf6('0x9'),'callback':afterCreate},{'channel':_0xddf6('0x17'),'model':_0xddf6('0x18'),'event':_0xddf6('0xa'),'condition':_0xddf6('0xb'),'callback':afterUpdate},{'channel':_0xddf6('0x17'),'model':_0xddf6('0x19'),'event':_0xddf6('0x8'),'condition':_0xddf6('0xd'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xddf6('0x1a'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xddf6('0x1b'),'model':_0xddf6('0x1a'),'event':_0xddf6('0xa'),'condition':_0xddf6('0xb'),'callback':afterUpdate},{'channel':_0xddf6('0x1b'),'model':_0xddf6('0x1c'),'event':_0xddf6('0x8'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x2313cc){return client[_0xddf6('0x1d')](_0xddf6('0x1e'),_0x2313cc)[_0xddf6('0x1f')](function(_0x2c0f21){logger[_0xddf6('0x20')](_0xddf6('0x21'),_0xddf6('0x1e'),_0x2c0f21);if(_0x2c0f21[_0xddf6('0x22')]){if(_0x2c0f21['error'][_0xddf6('0x23')]===0x1f4){logger[_0xddf6('0x22')](_0xddf6('0x21'),_0xddf6('0x1e'),_0x2c0f21[_0xddf6('0x22')]);}}})[_0xddf6('0x24')](function(_0x1d20bb){logger[_0xddf6('0x22')](_0xddf6('0x21'),_0xddf6('0x1e'),_0x1d20bb);});}function afterCreateMessage(_0x75a0b3,_0x31e950){return function(_0x38bfae,_0x37efbf){_0x38bfae=_0x38bfae[_0xddf6('0x25')]({'plain':!![]});_0x38bfae[_0xddf6('0x26')]=_0x75a0b3;_0x38bfae[_0xddf6('0x27')]=_0x38bfae['direction'];return db['CmContact'][_0xddf6('0x28')]()['then'](function(_0x169cdb){var _0x1795c2=[];for(var _0x118aa0=0x0;_0x118aa0=_0x1ac34c[_0xb24d('0x16')]){throw Error(_0xb24d('0x17'));}_0x36326b(_0x44923e);})[_0xb24d('0x18')](function(_0x4bc7ea){_0x205afc(_0x4bc7ea);});});}; \ No newline at end of file +var _0x6967=['Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','chat','fax','whatsapp','openchannel','getChannels','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','User','count','agent','then','agents'];(function(_0x4be059,_0x4bd08b){var _0x11f539=function(_0x3d06f3){while(--_0x3d06f3){_0x4be059['push'](_0x4be059['shift']());}};_0x11f539(++_0x4bd08b);}(_0x6967,0x152));var _0x7696=function(_0x33765d,_0x360e71){_0x33765d=_0x33765d-0x0;var _0x4e5cfb=_0x6967[_0x33765d];return _0x4e5cfb;};'use strict';var _=require(_0x7696('0x0'));var BPromise=require(_0x7696('0x1'));var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=['voice','mail',_0x7696('0x2'),_0x7696('0x3'),'sms',_0x7696('0x4'),_0x7696('0x5')];exports[_0x7696('0x6')]=function(){return channels;};exports['isValidChannel']=function(_0x57b2f9){_0x57b2f9=_0x57b2f9['toLowerCase']();return _[_0x7696('0x7')](channels,_0x57b2f9);};exports[_0x7696('0x8')]=function(_0x1d474f,_0x8a9be5,_0x4bb3e9,_0x4cf269){var _0x5f2057={'loginAttempts':_0x8a9be5,'blocked':_0x4bb3e9};if(!_[_0x7696('0x9')](_0x4cf269)){_0x5f2057[_0x7696('0xa')]=_0x4cf269;}return _0x1d474f[_0x7696('0xb')](_0x5f2057);};exports[_0x7696('0xc')]=function(_0x194c5a){return new BPromise(function(_0x3c262e,_0x5f0ea6){var _0x2e6145=0x0;if(_0x194c5a[_0x7696('0xd')]!=='agent'){_0x3c262e(_0x194c5a);}db[_0x7696('0xe')][_0x7696('0xf')]({'where':{'role':_0x7696('0x10'),'online':!![],'id':{'$ne':_0x194c5a['id']}}})['then'](function(_0x6a4c77){_0x2e6145=_0x6a4c77;return util[_0x7696('0xc')]();})[_0x7696('0x11')](function(_0x27afb5){if(_0x27afb5&&_0x27afb5[_0x7696('0x12')]&&_0x2e6145>=_0x27afb5['agents']){throw Error(_0x7696('0x13'));}_0x3c262e(_0x194c5a);})[_0x7696('0x14')](function(_0x33965a){_0x5f0ea6(_0x33965a);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 4ae3966..daa6f96 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3492=['exports','404','status','json','send'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x3492,0x17c));var _0x2349=function(_0x811e11,_0x13c010){_0x811e11=_0x811e11-0x0;var _0x3f6eb2=_0x3492[_0x811e11];return _0x3f6eb2;};'use strict';module[_0x2349('0x0')][0x194]=function pageNotFound(_0x4e3772,_0x1d551f){var _0x487a02=_0x2349('0x1');var _0x22d179=0x194;var _0x5b3820={'status':_0x22d179};_0x1d551f['status'](_0x5b3820[_0x2349('0x2')]);_0x1d551f['render'](_0x487a02,{},function(_0x56c47b,_0xace430){if(_0x56c47b){return _0x1d551f[_0x2349('0x2')](_0x5b3820['status'])[_0x2349('0x3')](_0x5b3820);}_0x1d551f[_0x2349('0x4')](_0xace430);});}; \ No newline at end of file +var _0x8120=['status','json','send','exports'];(function(_0x57f1bc,_0x103651){var _0x57649d=function(_0x251c28){while(--_0x251c28){_0x57f1bc['push'](_0x57f1bc['shift']());}};_0x57649d(++_0x103651);}(_0x8120,0x8b));var _0x0812=function(_0x46516f,_0x3ce26e){_0x46516f=_0x46516f-0x0;var _0x5df1e0=_0x8120[_0x46516f];return _0x5df1e0;};'use strict';module[_0x0812('0x0')][0x194]=function pageNotFound(_0x3d978f,_0x5d1394){var _0x4e2c3f='404';var _0x3e6ff3=0x194;var _0x2ca881={'status':_0x3e6ff3};_0x5d1394[_0x0812('0x1')](_0x2ca881['status']);_0x5d1394['render'](_0x4e2c3f,{},function(_0x39257e,_0x5befe1){if(_0x39257e){return _0x5d1394[_0x0812('0x1')](_0x2ca881[_0x0812('0x1')])[_0x0812('0x2')](_0x2ca881);}_0x5d1394[_0x0812('0x3')](_0x5befe1);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 38e1d2a..330fdbe 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbca7=['../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','../api/migration/migration.model','Plugin','MailTransferReport','ChatTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','hasOne','cascade','UserId','Recordings','hasMany','UserVoiceQueueRt','VoiceExtension','Extensions','HopperFinals','ReportAgentPreview','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','ChatQueues','UserChatQueue','FaxQueues','UserFaxQueue','OpenchannelQueues','WhatsappQueues','user_has_voice_prefixes','user_has_chat_websites','FaxAccount','FaxAccounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','VoiceChanSpy','SpiedAgents','ChanSpyId','VoiceContext','Applications','moh_has_sounds','Members','HopperHistories','VoiceQueueId','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','belongsTo','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Imap','Smtp','Disposition','Dispositions','Answers','MailMessage','Interactions','MailApplication','Template','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Tag','ThroughTags','user_has_mail_interactions','Attachment','Attachments','Interaction','ChatWebsite','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','List','ListId','Items','FaxAccountId','FaxInteractionId','fax_interaction_has_tags','Users','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsApplication','SmsQueue','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','CompanyId','Phones','CmContactId','Hoppers','FaxInteractions','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','Campaign','CampaignId','OwnerId','All','OneAll','AutomationAllId','Automation','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerId','Fields','AnalyticDefaultReport','MetricId','Configurations','AccountId','SubjectId','Descriptions','Description','DescriptionId','Field','FieldId','VariableId','Subjects','Subject','int_desk_configuration_has_tags','ZendeskAccount','int_freshdesk_configuration_has_tags','VtigerField','VtigerAccount','ServicenowConfiguration','Dynamics365Account','Dynamics365Configuration','ChatQueueReport','FromId','ToId','SessionId','SmsQueueReport','JscriptyProject','ProjectId','user_has_square_projects','MailQueues','SmsQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','voice_queues_has_cm_lists','userProfileId','Resources','sectionId','WhatsappAccount','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','path','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','User','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','import','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticDefaultReport/analyticDefaultReport.model','../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','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField'];(function(_0x50a7c4,_0x582aca){var _0x17d784=function(_0x3f13f9){while(--_0x3f13f9){_0x50a7c4['push'](_0x50a7c4['shift']());}};_0x17d784(++_0x582aca);}(_0xbca7,0x149));var _0x7bca=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xbca7[_0x3899d1];return _0xeb4a7d;};'use strict';var path=require(_0x7bca('0x0'));var config=require(_0x7bca('0x1'));var Sequelize=require(_0x7bca('0x2'));var _=require(_0x7bca('0x3'));var jstz=require(_0x7bca('0x4'));var timezone=jstz[_0x7bca('0x5')]();config[_0x7bca('0x2')]=_[_0x7bca('0x6')](config[_0x7bca('0x2')],{'database':_0x7bca('0x7'),'username':_0x7bca('0x8'),'password':_0x7bca('0x9'),'options':{'host':_0x7bca('0xa'),'port':0xcea,'dialect':_0x7bca('0xb'),'dialectOptions':{'charset':_0x7bca('0xc')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x7bca('0xd'),'collate':_0x7bca('0xe')}}});config[_0x7bca('0xf')]=_[_0x7bca('0x6')](config[_0x7bca('0xf')],{'database':'motion2','username':_0x7bca('0x8'),'password':'xC@LL1234','options':{'host':_0x7bca('0xa'),'port':0xcea,'dialect':_0x7bca('0xb'),'dialectOptions':{'charset':_0x7bca('0xc')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x7bca('0xd'),'collate':_0x7bca('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7bca('0x2')][_0x7bca('0x10')],config[_0x7bca('0x2')][_0x7bca('0x11')],config[_0x7bca('0x2')][_0x7bca('0x12')],config[_0x7bca('0x2')][_0x7bca('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7bca('0xf')]['database'],config[_0x7bca('0xf')][_0x7bca('0x11')],config['sequelizeHistory']['password'],config[_0x7bca('0xf')][_0x7bca('0x13')])};db[_0x7bca('0x14')]=db[_0x7bca('0x2')]['import'](_0x7bca('0x15'));db['VoiceChanSpy']=db[_0x7bca('0x2')]['import'](_0x7bca('0x16'));db['VoiceContext']=db['sequelize']['import'](_0x7bca('0x17'));db['VoiceExtension']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x19'));db[_0x7bca('0x1a')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x1b'));db[_0x7bca('0x1c')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/voiceQueue/voiceQueue.model');db[_0x7bca('0x1d')]=db['sequelize'][_0x7bca('0x18')]('../api/voiceRecording/voiceRecording.model');db[_0x7bca('0x1e')]=db['sequelize']['import']('../api/screenRecording/screenRecording.model');db[_0x7bca('0x1f')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x20'));db[_0x7bca('0x21')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x22'));db[_0x7bca('0x23')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x24'));db['VoiceDialReport']=db[_0x7bca('0x2')]['import'](_0x7bca('0x25'));db['VoiceAgentReport']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x26'));db['VoiceQueueReport']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x27'));db[_0x7bca('0x28')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x29'));db['Trunk']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x2a'));db['VoiceTransferReport']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x2b'));db['UserVoiceQueueRt']=db[_0x7bca('0x2')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x7bca('0x2c')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x2d'));db['UserChatQueue']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x2e'));db[_0x7bca('0x2f')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x30'));db['UserFaxQueue']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x31'));db[_0x7bca('0x32')]=db['sequelize']['import']('../api/userSmsQueue/userSmsQueue.model');db[_0x7bca('0x33')]=db[_0x7bca('0x2')]['import'](_0x7bca('0x34'));db[_0x7bca('0x35')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x36'));db[_0x7bca('0x37')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/mailServerIn/mailServerIn.model');db[_0x7bca('0x38')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/mailServerOut/mailServerOut.model');db[_0x7bca('0x39')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/mailAccount/mailAccount.model');db[_0x7bca('0x3a')]=db[_0x7bca('0x2')]['import'](_0x7bca('0x3b'));db[_0x7bca('0x3c')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/mailSubstatus/mailSubstatus.model');db[_0x7bca('0x3d')]=db[_0x7bca('0x2')]['import']('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x3e'));db['MailApplication']=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x3f'));db['MailQueueReport']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x40'));db[_0x7bca('0x41')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/dashboard/dashboard.model');db[_0x7bca('0x42')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x43'));db[_0x7bca('0x44')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x45'));db[_0x7bca('0x46')]=db['sequelize'][_0x7bca('0x18')]('../api/faxInteraction/faxInteraction.model');db[_0x7bca('0x47')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x48'));db[_0x7bca('0x49')]=db[_0x7bca('0x2')]['import'](_0x7bca('0x4a'));db[_0x7bca('0x4b')]=db[_0x7bca('0x2')]['import'](_0x7bca('0x4c'));db[_0x7bca('0x4d')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x4e'));db[_0x7bca('0x4f')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x50'));db['SmsMessage']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x51'));db['SmsQueue']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x52'));db[_0x7bca('0x53')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/openchannelAccount/openchannelAccount.model');db[_0x7bca('0x54')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x55'));db['OpenchannelInteraction']=db[_0x7bca('0x2')]['import'](_0x7bca('0x56'));db[_0x7bca('0x57')]=db[_0x7bca('0x2')]['import'](_0x7bca('0x58'));db[_0x7bca('0x59')]=db['sequelize']['import'](_0x7bca('0x5a'));db['ChatWebsite']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x5b'));db[_0x7bca('0x5c')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x7bca('0x5d')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x5e'));db[_0x7bca('0x5f')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/chatInteraction/chatInteraction.model');db[_0x7bca('0x60')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/chatMessage/chatMessage.model');db[_0x7bca('0x61')]=db['sequelize']['import'](_0x7bca('0x62'));db[_0x7bca('0x63')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x64'));db[_0x7bca('0x65')]=db['sequelize'][_0x7bca('0x18')]('../api/chatGroup/chatGroup.model');db[_0x7bca('0x66')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x67'));db[_0x7bca('0x68')]=db['sequelize']['import'](_0x7bca('0x69'));db['CmContact']=db[_0x7bca('0x2')]['import']('../api/cmContact/cmContact.model');db[_0x7bca('0x6a')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x6b'));db[_0x7bca('0x6c')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x6d'));db[_0x7bca('0x6e')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x6f'));db[_0x7bca('0x70')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x71'));db['ReportAgentPreview']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x72'));db[_0x7bca('0x73')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/cmCustomField/cmCustomField.model');db[_0x7bca('0x74')]=db[_0x7bca('0x2')]['import'](_0x7bca('0x75'));db['Automation']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x76'));db[_0x7bca('0x77')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x78'));db['Disposition']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x79'));db[_0x7bca('0x7a')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x7b'));db[_0x7bca('0x7c')]=db['sequelize']['import'](_0x7bca('0x7d'));db[_0x7bca('0x7e')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x7f'));db['Cdr']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x80'));db[_0x7bca('0x81')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x82'));db[_0x7bca('0x83')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x84'));db[_0x7bca('0x85')]=db['sequelize']['import']('../api/sound/sound.model');db['Tag']=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/tag/tag.model');db['ContactItemType']=db[_0x7bca('0x2')]['import'](_0x7bca('0x86'));db[_0x7bca('0x87')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x88'));db['CmHopperAdditionalPhone']=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x89'));db['Template']=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/template/template.model');db[_0x7bca('0x8a')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x8b'));db[_0x7bca('0x8c')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0x8d'));db[_0x7bca('0x8e')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x8f'));db[_0x7bca('0x90')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x91'));db[_0x7bca('0x92')]=db[_0x7bca('0x2')]['import']('../api/analyticCustomReport/analyticCustomReport.model');db['AnalyticDefaultReport']=db['sequelize']['import'](_0x7bca('0x93'));db['AnalyticExtractedReport']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x94'));db[_0x7bca('0x95')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x96'));db[_0x7bca('0x97')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x98'));db[_0x7bca('0x99')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x9a'));db[_0x7bca('0x9b')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x9c'));db[_0x7bca('0x9d')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x9e'));db[_0x7bca('0x9f')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xa0'));db[_0x7bca('0xa1')]=db[_0x7bca('0x2')]['import'](_0x7bca('0xa2'));db[_0x7bca('0xa3')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xa4'));db[_0x7bca('0xa5')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xa6'));db[_0x7bca('0xa7')]=db[_0x7bca('0x2')]['import']('../api/intDeskAccount/intDeskAccount.model');db[_0x7bca('0xa8')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xa9'));db[_0x7bca('0xaa')]=db['sequelize']['import'](_0x7bca('0xab'));db[_0x7bca('0xac')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/intZohoAccount/intZohoAccount.model');db[_0x7bca('0xad')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0xae'));db[_0x7bca('0xaf')]=db['sequelize'][_0x7bca('0x18')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xb0'));db[_0x7bca('0xb1')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xb2'));db[_0x7bca('0xb3')]=db['sequelize'][_0x7bca('0x18')]('../api/intZendeskField/intZendeskField.model');db[_0x7bca('0xb4')]=db['sequelize'][_0x7bca('0x18')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x7bca('0xb5')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xb6'));db[_0x7bca('0xb7')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xb8'));db['VtigerAccount']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xb9'));db[_0x7bca('0xba')]=db[_0x7bca('0x2')]['import'](_0x7bca('0xbb'));db['VtigerField']=db['sequelize']['import'](_0x7bca('0xbc'));db[_0x7bca('0xbd')]=db['sequelize'][_0x7bca('0x18')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0x7bca('0x2')]['import'](_0x7bca('0xbe'));db[_0x7bca('0xbf')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xc0'));db['Dynamics365Account']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xc1'));db['Dynamics365Configuration']=db['sequelize'][_0x7bca('0x18')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x7bca('0xc2')]=db['sequelize'][_0x7bca('0x18')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x7bca('0xc3')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x7bca('0xc4')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xc5'));db[_0x7bca('0xc6')]=db['sequelize']['import'](_0x7bca('0xc7'));db['Integration']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0x8f'));db['Network']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xc8'));db['ChatQueueReport']=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/chatQueueReport/chatQueueReport.model');db[_0x7bca('0xc9')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xca'));db[_0x7bca('0xcb')]=db[_0x7bca('0x2')]['import'](_0x7bca('0xcc'));db[_0x7bca('0xcd')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xce'));db[_0x7bca('0xcf')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xd0'));db['SquareReport']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xd1'));db[_0x7bca('0xd2')]=db[_0x7bca('0x2')]['import'](_0x7bca('0xd3'));db['JscriptyProject']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xd4'));db[_0x7bca('0xd5')]=db[_0x7bca('0x2')]['import']('../api/setting/setting.model');db['SquareOdbc']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xd6'));db[_0x7bca('0xd7')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/squareProject/squareProject.model');db[_0x7bca('0xd8')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xd9'));db[_0x7bca('0xda')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xdb'));db[_0x7bca('0xdc')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xdd'));db[_0x7bca('0xde')]=db[_0x7bca('0x2')]['import'](_0x7bca('0xdf'));db['Campaign']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xe0'));db['Migration']=db['sequelize'][_0x7bca('0x18')](_0x7bca('0xe1'));db['Attachment']=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/attachment/attachment.model');db[_0x7bca('0xe2')]=db[_0x7bca('0x2')]['import']('../api/plugin/plugin.model');db[_0x7bca('0xe3')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/mailTransferReport/mailTransferReport.model');db[_0x7bca('0xe4')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xe5'));db['OpenchannelTransferReport']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xe6'));db[_0x7bca('0xe7')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xe8'));db[_0x7bca('0xe9')]=db[_0x7bca('0x2')]['import']('../api/cmList/cmList.model');db[_0x7bca('0xea')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xeb'));db[_0x7bca('0xec')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/userProfile/userProfile.model');db[_0x7bca('0xed')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xee'));db[_0x7bca('0xef')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xf0'));db[_0x7bca('0xf1')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0xf2'));db['WhatsappAccount']=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xf3'));db[_0x7bca('0xf4')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/whatsappApplication/whatsappApplication.model');db[_0x7bca('0xf5')]=db[_0x7bca('0x2')][_0x7bca('0x18')](_0x7bca('0xf6'));db[_0x7bca('0xf7')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/whatsappMessage/whatsappMessage.model');db[_0x7bca('0xf8')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0xf9'));db[_0x7bca('0xfa')]=db[_0x7bca('0x2')][_0x7bca('0x18')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x7bca('0xfb')]=db['sequelize'][_0x7bca('0x18')]('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db[_0x7bca('0x2')]['import'](_0x7bca('0xfc'));db[_0x7bca('0xfd')]=db['sequelize'][_0x7bca('0x18')](_0x7bca('0xfe'));db[_0x7bca('0x14')][_0x7bca('0xff')](db[_0x7bca('0x1f')],{'as':_0x7bca('0x1f'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x101')});db[_0x7bca('0x14')]['hasMany'](db[_0x7bca('0x1d')],{'as':_0x7bca('0x102'),'foreignKey':_0x7bca('0x101')});db['User'][_0x7bca('0x103')](db[_0x7bca('0x104')],{'as':'VoiceQueuesRt','foreignKey':_0x7bca('0x101')});db[_0x7bca('0x14')][_0x7bca('0x103')](db[_0x7bca('0x105')],{'as':_0x7bca('0x106'),'onDelete':'cascade','hooks':!![]});db['User'][_0x7bca('0x103')](db['CmHopperFinal'],{'as':_0x7bca('0x107'),'foreignKey':_0x7bca('0x101')});db['User'][_0x7bca('0x103')](db[_0x7bca('0x70')],{'as':'HopperHistory','foreignKey':_0x7bca('0x101')});db[_0x7bca('0x14')]['hasMany'](db[_0x7bca('0x108')],{'as':_0x7bca('0x108'),'foreignKey':_0x7bca('0x101')});db['User'][_0x7bca('0x103')](db[_0x7bca('0x109')],{'as':_0x7bca('0x10a'),'foreignKey':_0x7bca('0x101')});db[_0x7bca('0x14')][_0x7bca('0x103')](db['ChatInteraction'],{'as':_0x7bca('0x10b'),'foreignKey':_0x7bca('0x101')});db[_0x7bca('0x14')][_0x7bca('0x103')](db['SmsInteraction'],{'as':_0x7bca('0x10c'),'foreignKey':_0x7bca('0x101')});db[_0x7bca('0x14')][_0x7bca('0x103')](db[_0x7bca('0x46')],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0x7bca('0x14')]['hasMany'](db['MailInteraction'],{'as':_0x7bca('0x10d'),'foreignKey':_0x7bca('0x101')});db[_0x7bca('0x14')][_0x7bca('0x103')](db[_0x7bca('0xf5')],{'as':_0x7bca('0x10e'),'foreignKey':_0x7bca('0x101')});db[_0x7bca('0x14')][_0x7bca('0x103')](db[_0x7bca('0xf1')],{'as':_0x7bca('0x10f'),'foreignKey':_0x7bca('0x110')});db[_0x7bca('0x14')]['belongsTo'](db[_0x7bca('0xec')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0x7bca('0x14')][_0x7bca('0x111')](db[_0x7bca('0x65')],{'as':_0x7bca('0x112'),'through':_0x7bca('0x113')});db[_0x7bca('0x14')][_0x7bca('0x111')](db[_0x7bca('0x114')],{'as':_0x7bca('0x115'),'through':_0x7bca('0x116')});db[_0x7bca('0x14')][_0x7bca('0x111')](db[_0x7bca('0xe9')],{'as':_0x7bca('0x117'),'through':_0x7bca('0x118')});db[_0x7bca('0x14')][_0x7bca('0x111')](db[_0x7bca('0xdc')],{'through':_0x7bca('0x119')});db[_0x7bca('0x14')][_0x7bca('0x111')](db['MailInteraction'],{'as':_0x7bca('0x10d'),'through':'user_has_mail_interactions'});db[_0x7bca('0x14')][_0x7bca('0x111')](db[_0x7bca('0x5f')],{'as':_0x7bca('0x10b'),'through':_0x7bca('0x11a')});db['User'][_0x7bca('0x111')](db[_0x7bca('0x46')],{'as':'FaxInteractions','through':_0x7bca('0x11b')});db['User']['belongsToMany'](db[_0x7bca('0x4f')],{'as':'SmsInteractions','through':_0x7bca('0x11c')});db[_0x7bca('0x14')][_0x7bca('0x111')](db['OpenchannelInteraction'],{'as':_0x7bca('0x10a'),'through':'user_has_openchannel_interactions'});db[_0x7bca('0x14')][_0x7bca('0x111')](db[_0x7bca('0xf5')],{'as':_0x7bca('0x10e'),'through':_0x7bca('0x11d')});db[_0x7bca('0x14')][_0x7bca('0x111')](db[_0x7bca('0x1c')],{'as':_0x7bca('0x11e'),'through':_0x7bca('0x2c'),'required':![]});db['User'][_0x7bca('0x111')](db[_0x7bca('0x3a')],{'as':'MailQueues','through':_0x7bca('0x2f'),'required':![]});db[_0x7bca('0x14')]['belongsToMany'](db[_0x7bca('0x63')],{'as':_0x7bca('0x11f'),'through':_0x7bca('0x120'),'required':![],'hooks':!![]});db[_0x7bca('0x14')][_0x7bca('0x111')](db[_0x7bca('0x49')],{'as':_0x7bca('0x121'),'through':_0x7bca('0x122'),'required':![]});db['User'][_0x7bca('0x111')](db['SmsQueue'],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0x7bca('0x14')]['belongsToMany'](db[_0x7bca('0x59')],{'as':_0x7bca('0x123'),'through':_0x7bca('0x33'),'required':![]});db[_0x7bca('0x14')][_0x7bca('0x111')](db['WhatsappQueue'],{'as':_0x7bca('0x124'),'through':_0x7bca('0x35'),'required':![]});db[_0x7bca('0x14')]['belongsToMany'](db[_0x7bca('0xe9')],{'through':_0x7bca('0x118')});db['User'][_0x7bca('0x111')](db[_0x7bca('0xea')],{'as':'VoicePrefixes','through':_0x7bca('0x125'),'required':![]});db[_0x7bca('0x14')][_0x7bca('0x111')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0x7bca('0x126')});db[_0x7bca('0x14')][_0x7bca('0x111')](db[_0x7bca('0x127')],{'as':_0x7bca('0x128'),'through':'user_has_fax_accounts'});db[_0x7bca('0x14')][_0x7bca('0x111')](db[_0x7bca('0x39')],{'as':_0x7bca('0x129'),'through':_0x7bca('0x12a')});db['User'][_0x7bca('0x111')](db[_0x7bca('0x53')],{'as':'OpenchannelAccounts','through':_0x7bca('0x12b')});db[_0x7bca('0x14')][_0x7bca('0x111')](db['SmsAccount'],{'as':_0x7bca('0x12c'),'through':_0x7bca('0x12d')});db[_0x7bca('0x14')][_0x7bca('0x111')](db['WhatsappAccount'],{'as':_0x7bca('0x12e'),'through':'user_has_whatsapp_accounts'});db[_0x7bca('0x14')]['belongsToMany'](db['SquareProject'],{'as':'SquareProjects','through':'user_has_square_projects'});db[_0x7bca('0x12f')]['hasMany'](db[_0x7bca('0x105')],{'as':_0x7bca('0x130'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x131')});db[_0x7bca('0x132')][_0x7bca('0x103')](db[_0x7bca('0x105')],{'onDelete':'cascade'});db['VoiceExtension'][_0x7bca('0x103')](db[_0x7bca('0x105')],{'as':_0x7bca('0x133'),'onDelete':'cascade'});db[_0x7bca('0x1a')][_0x7bca('0x111')](db[_0x7bca('0x85')],{'as':'Sounds','through':_0x7bca('0x134')});db[_0x7bca('0x1c')][_0x7bca('0x103')](db[_0x7bca('0x104')],{'as':_0x7bca('0x135'),'foreignKey':'VoiceQueueId'});db[_0x7bca('0x1c')]['hasMany'](db[_0x7bca('0x6a')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0x7bca('0x1c')][_0x7bca('0x103')](db[_0x7bca('0x6e')],{'as':_0x7bca('0x107'),'foreignKey':'VoiceQueueId'});db[_0x7bca('0x1c')][_0x7bca('0x103')](db[_0x7bca('0x70')],{'as':_0x7bca('0x136'),'foreignKey':_0x7bca('0x137')});db[_0x7bca('0x1c')][_0x7bca('0x103')](db[_0x7bca('0x108')],{'as':_0x7bca('0x108'),'foreignKey':'VoiceQueueId'});db[_0x7bca('0x1c')]['hasMany'](db[_0x7bca('0x6c')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0x7bca('0x1c')][_0x7bca('0x103')](db[_0x7bca('0xcf')],{'as':_0x7bca('0x138'),'foreignKey':_0x7bca('0x137')});db[_0x7bca('0x1c')]['belongsTo'](db['Trunk'],{'as':_0x7bca('0x139'),'foreignKey':_0x7bca('0x13a')});db[_0x7bca('0x1c')]['belongsTo'](db[_0x7bca('0x139')],{'as':_0x7bca('0x13b'),'foreignKey':_0x7bca('0x13c')});db[_0x7bca('0x1c')][_0x7bca('0x13d')](db[_0x7bca('0x7c')],{'as':_0x7bca('0x7c'),'foreignKey':_0x7bca('0x13e')});db['VoiceQueue'][_0x7bca('0x13d')](db[_0x7bca('0x7e')],{'as':_0x7bca('0x13f'),'foreignKey':_0x7bca('0x140')});db[_0x7bca('0x1c')]['belongsToMany'](db[_0x7bca('0xe9')],{'as':_0x7bca('0x117'),'through':'voice_queues_has_cm_lists'});db[_0x7bca('0x1c')]['belongsToMany'](db[_0x7bca('0x14')],{'as':_0x7bca('0x141'),'through':'UserVoiceQueue'});db['VoiceQueue']['belongsToMany'](db[_0x7bca('0xdc')],{'as':_0x7bca('0x142'),'through':_0x7bca('0xfd')});db[_0x7bca('0x1c')][_0x7bca('0x111')](db['CmList'],{'as':_0x7bca('0x143'),'through':_0x7bca('0x144')});db[_0x7bca('0x1d')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'as':_0x7bca('0x14'),'foreignKey':_0x7bca('0x101')});db[_0x7bca('0x1e')][_0x7bca('0x13d')](db['User'],{'as':_0x7bca('0x14'),'foreignKey':_0x7bca('0x101')});db['VoiceMail'][_0x7bca('0x103')](db[_0x7bca('0x21')],{'as':_0x7bca('0x145'),'onDelete':'cascade','foreignKey':_0x7bca('0x146'),'sourceKey':_0x7bca('0x147')});db[_0x7bca('0x21')][_0x7bca('0x13d')](db[_0x7bca('0x1f')],{'foreignKey':_0x7bca('0x146'),'targetKey':_0x7bca('0x147')});db[_0x7bca('0x23')][_0x7bca('0x103')](db[_0x7bca('0x148')],{'as':'QueueCalls','foreignKey':_0x7bca('0x149'),'constraints':![]});db[_0x7bca('0x23')][_0x7bca('0x103')](db['VoiceAgentReport'],{'as':_0x7bca('0x14a'),'foreignKey':_0x7bca('0x149'),'constraints':![]});db[_0x7bca('0x23')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'as':_0x7bca('0x14'),'foreignKey':_0x7bca('0x101')});db['VoiceCallReport']['belongsTo'](db[_0x7bca('0x114')],{'as':_0x7bca('0x14b'),'foreignKey':_0x7bca('0x14c')});db['MailServerIn'][_0x7bca('0x13d')](db['MailAccount'],{'as':_0x7bca('0x39'),'foreignKey':_0x7bca('0x14d')});db[_0x7bca('0x38')][_0x7bca('0x13d')](db[_0x7bca('0x39')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x7bca('0x39')][_0x7bca('0xff')](db[_0x7bca('0x37')],{'as':_0x7bca('0x14e'),'onDelete':_0x7bca('0x100')});db['MailAccount'][_0x7bca('0xff')](db[_0x7bca('0x38')],{'as':_0x7bca('0x14f'),'onDelete':_0x7bca('0x100')});db['MailAccount']['hasMany'](db[_0x7bca('0x150')],{'as':_0x7bca('0x151'),'foreignKey':_0x7bca('0x14d')});db[_0x7bca('0x39')][_0x7bca('0x103')](db['CannedAnswer'],{'as':_0x7bca('0x152'),'foreignKey':_0x7bca('0x14d')});db[_0x7bca('0x39')]['hasMany'](db[_0x7bca('0x153')],{'as':_0x7bca('0x145'),'foreignKey':'MailAccountId'});db[_0x7bca('0x39')][_0x7bca('0x103')](db[_0x7bca('0x3d')],{'as':_0x7bca('0x154')});db[_0x7bca('0x39')][_0x7bca('0x103')](db[_0x7bca('0x155')],{'as':_0x7bca('0x133')});db[_0x7bca('0x39')][_0x7bca('0x13d')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x7bca('0x39')]['belongsTo'](db[_0x7bca('0x156')],{'as':_0x7bca('0x156'),'foreignKey':'TemplateId'});db[_0x7bca('0x39')]['belongsTo'](db[_0x7bca('0x7e')],{'as':_0x7bca('0x13f'),'foreignKey':_0x7bca('0x140')});db[_0x7bca('0x39')][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':'Agents','through':_0x7bca('0x12a')});db[_0x7bca('0x3a')][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x141'),'through':_0x7bca('0x2f')});db[_0x7bca('0x3a')]['belongsToMany'](db[_0x7bca('0xdc')],{'through':_0x7bca('0x157'),'as':'Teams'});db[_0x7bca('0x3d')][_0x7bca('0x103')](db['MailMessage'],{'as':_0x7bca('0x145'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x158')});db[_0x7bca('0x3d')][_0x7bca('0x13d')](db[_0x7bca('0x39')],{'as':_0x7bca('0x159'),'foreignKey':'MailAccountId'});db[_0x7bca('0x3d')]['belongsTo'](db[_0x7bca('0x114')],{'as':'Contact','foreignKey':_0x7bca('0x14c')});db['MailInteraction'][_0x7bca('0x13d')](db['User'],{'as':_0x7bca('0x15a'),'foreignKey':_0x7bca('0x101')});db['MailInteraction'][_0x7bca('0x111')](db['Tag'],{'through':_0x7bca('0x15b'),'as':_0x7bca('0x15c')});db['MailInteraction'][_0x7bca('0x111')](db[_0x7bca('0x15d')],{'through':_0x7bca('0x15b'),'as':_0x7bca('0x15e')});db['MailInteraction'][_0x7bca('0x111')](db['User'],{'as':'Users','through':_0x7bca('0x15f'),'foreignKey':'MailInteractionId'});db['MailMessage']['hasMany'](db[_0x7bca('0x160')],{'as':_0x7bca('0x161'),'onDelete':'cascade'});db['MailMessage']['belongsTo'](db['User'],{'as':_0x7bca('0x14')});db[_0x7bca('0x153')][_0x7bca('0x13d')](db[_0x7bca('0x114')],{'onDelete':'cascade','as':_0x7bca('0x14b')});db['MailMessage'][_0x7bca('0x13d')](db['MailInteraction'],{'as':_0x7bca('0x162'),'foreignKey':_0x7bca('0x158')});db[_0x7bca('0x153')][_0x7bca('0x13d')](db[_0x7bca('0x39')],{'as':_0x7bca('0x159'),'foreignKey':_0x7bca('0x14d')});db[_0x7bca('0x153')][_0x7bca('0x13d')](db['ChatWebsite'],{'as':_0x7bca('0x163'),'foreignKey':_0x7bca('0x164')});db['MailMessage']['belongsTo'](db[_0x7bca('0x61')],{'as':_0x7bca('0x61'),'foreignKey':_0x7bca('0x165')});db[_0x7bca('0x155')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'onDelete':_0x7bca('0x166')});db[_0x7bca('0x155')][_0x7bca('0x13d')](db[_0x7bca('0x3a')],{'onDelete':_0x7bca('0x166')});db[_0x7bca('0x155')][_0x7bca('0x13d')](db[_0x7bca('0x39')],{'onDelete':_0x7bca('0x166')});db[_0x7bca('0x155')][_0x7bca('0x13d')](db['Interval'],{'onDelete':_0x7bca('0x166'),'foreignKey':_0x7bca('0x13e')});db['MailApplication']['belongsTo'](db[_0x7bca('0x15d')],{'onDelete':_0x7bca('0x166'),'foreignKey':_0x7bca('0x167')});db[_0x7bca('0x168')][_0x7bca('0x13d')](db[_0x7bca('0x39')],{});db[_0x7bca('0x168')][_0x7bca('0x13d')](db[_0x7bca('0xe9')],{'as':_0x7bca('0x169'),'foreignKey':_0x7bca('0x16a')});db[_0x7bca('0x168')]['belongsTo'](db[_0x7bca('0x114')],{'as':_0x7bca('0x14b'),'foreignKey':'ContactId'});db[_0x7bca('0x168')][_0x7bca('0x13d')](db['MailInteraction'],{});db[_0x7bca('0x168')]['belongsTo'](db[_0x7bca('0x153')],{});db[_0x7bca('0x168')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{});db[_0x7bca('0x168')][_0x7bca('0x13d')](db[_0x7bca('0x3a')],{});db['Dashboard'][_0x7bca('0x103')](db['DashboardItem'],{'as':_0x7bca('0x16b'),'onDelete':_0x7bca('0x100')});db[_0x7bca('0x127')][_0x7bca('0x103')](db['Disposition'],{'as':_0x7bca('0x151'),'foreignKey':_0x7bca('0x16c')});db[_0x7bca('0x127')][_0x7bca('0x103')](db[_0x7bca('0x77')],{'as':_0x7bca('0x152'),'foreignKey':_0x7bca('0x16c')});db[_0x7bca('0x127')][_0x7bca('0x103')](db[_0x7bca('0x46')],{'as':_0x7bca('0x154')});db[_0x7bca('0x127')][_0x7bca('0x103')](db[_0x7bca('0x44')],{'as':_0x7bca('0x133')});db['FaxAccount']['hasMany'](db[_0x7bca('0x105')],{'as':'Exntensions','onDelete':_0x7bca('0x100')});db[_0x7bca('0x127')][_0x7bca('0x103')](db[_0x7bca('0x47')],{'as':_0x7bca('0x145')});db[_0x7bca('0x127')][_0x7bca('0x13d')](db[_0x7bca('0x139')],{'as':'Trunk'});db[_0x7bca('0x127')][_0x7bca('0x13d')](db[_0x7bca('0xe9')],{'as':_0x7bca('0x169'),'foreignKey':_0x7bca('0x16a')});db[_0x7bca('0x127')][_0x7bca('0x13d')](db[_0x7bca('0x7e')],{'as':_0x7bca('0x13f'),'foreignKey':_0x7bca('0x140')});db[_0x7bca('0x127')][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x141'),'through':'user_has_fax_accounts'});db[_0x7bca('0x44')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'onDelete':_0x7bca('0x166')});db['FaxApplication'][_0x7bca('0x13d')](db['FaxQueue'],{'onDelete':_0x7bca('0x166')});db[_0x7bca('0x44')][_0x7bca('0x13d')](db[_0x7bca('0x127')],{'onDelete':'restrict'});db[_0x7bca('0x44')][_0x7bca('0x13d')](db[_0x7bca('0x15d')],{'onDelete':_0x7bca('0x166'),'foreignKey':_0x7bca('0x167')});db[_0x7bca('0x46')]['hasMany'](db['FaxMessage'],{'as':_0x7bca('0x145'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x16d')});db[_0x7bca('0x46')]['belongsTo'](db[_0x7bca('0x127')],{'as':_0x7bca('0x159'),'foreignKey':_0x7bca('0x16c')});db[_0x7bca('0x46')][_0x7bca('0x13d')](db[_0x7bca('0x114')],{'as':_0x7bca('0x14b'),'foreignKey':_0x7bca('0x14c')});db[_0x7bca('0x46')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'as':_0x7bca('0x15a'),'foreignKey':_0x7bca('0x101')});db[_0x7bca('0x46')]['belongsToMany'](db[_0x7bca('0x15d')],{'through':'fax_interaction_has_tags','as':'Tags'});db['FaxInteraction'][_0x7bca('0x111')](db[_0x7bca('0x15d')],{'through':_0x7bca('0x16e'),'as':_0x7bca('0x15e')});db[_0x7bca('0x46')][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x16f'),'through':_0x7bca('0x11b'),'foreignKey':_0x7bca('0x16d')});db[_0x7bca('0x47')]['belongsTo'](db[_0x7bca('0x14')],{'onDelete':_0x7bca('0x100'),'as':_0x7bca('0x14')});db[_0x7bca('0x47')][_0x7bca('0x13d')](db[_0x7bca('0x46')],{'as':_0x7bca('0x162'),'foreignKey':_0x7bca('0x16d')});db[_0x7bca('0x47')][_0x7bca('0x13d')](db['CmContact'],{'onDelete':_0x7bca('0x100'),'as':_0x7bca('0x14b')});db[_0x7bca('0x47')][_0x7bca('0x13d')](db[_0x7bca('0x160')],{'as':_0x7bca('0x160'),'foreignKey':_0x7bca('0x170')});db['FaxMessage'][_0x7bca('0x13d')](db[_0x7bca('0x127')],{'as':_0x7bca('0x159'),'foreignKey':_0x7bca('0x16c')});db[_0x7bca('0x49')][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x141'),'through':_0x7bca('0x122')});db[_0x7bca('0x49')][_0x7bca('0x111')](db[_0x7bca('0xdc')],{'through':_0x7bca('0x171'),'as':_0x7bca('0x142')});db[_0x7bca('0x4b')][_0x7bca('0x13d')](db[_0x7bca('0x127')],{});db[_0x7bca('0x4b')][_0x7bca('0x13d')](db[_0x7bca('0xe9')],{'as':_0x7bca('0x169'),'foreignKey':'ListId'});db['FaxQueueReport'][_0x7bca('0x13d')](db[_0x7bca('0x114')],{'as':_0x7bca('0x14b'),'foreignKey':_0x7bca('0x14c')});db[_0x7bca('0x4b')]['belongsTo'](db['FaxInteraction'],{});db[_0x7bca('0x4b')][_0x7bca('0x13d')](db[_0x7bca('0x47')],{});db['FaxQueueReport'][_0x7bca('0x13d')](db[_0x7bca('0x14')],{});db[_0x7bca('0x4b')][_0x7bca('0x13d')](db[_0x7bca('0x49')],{});db[_0x7bca('0x4d')][_0x7bca('0x103')](db[_0x7bca('0x150')],{'as':_0x7bca('0x151'),'foreignKey':_0x7bca('0x172')});db[_0x7bca('0x4d')]['hasMany'](db[_0x7bca('0x77')],{'as':_0x7bca('0x152'),'foreignKey':_0x7bca('0x172')});db['SmsAccount']['hasMany'](db[_0x7bca('0x173')],{'as':_0x7bca('0x145'),'foreignKey':_0x7bca('0x172')});db[_0x7bca('0x4d')][_0x7bca('0x103')](db[_0x7bca('0x4f')],{'as':_0x7bca('0x154')});db['SmsAccount'][_0x7bca('0x103')](db[_0x7bca('0x174')],{'as':_0x7bca('0x133')});db['SmsAccount']['belongsTo'](db[_0x7bca('0xe9')],{'as':_0x7bca('0x169'),'foreignKey':_0x7bca('0x16a')});db['SmsAccount']['belongsTo'](db[_0x7bca('0x7e')],{'as':_0x7bca('0x13f'),'foreignKey':_0x7bca('0x140')});db[_0x7bca('0x4d')][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x141'),'through':_0x7bca('0x12d')});db[_0x7bca('0x174')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'onDelete':_0x7bca('0x166')});db['SmsApplication'][_0x7bca('0x13d')](db[_0x7bca('0x175')],{'onDelete':_0x7bca('0x166')});db[_0x7bca('0x174')][_0x7bca('0x13d')](db['SmsAccount'],{'onDelete':_0x7bca('0x166')});db[_0x7bca('0x174')]['belongsTo'](db[_0x7bca('0x7c')],{'onDelete':_0x7bca('0x166'),'foreignKey':_0x7bca('0x13e')});db[_0x7bca('0x174')][_0x7bca('0x13d')](db[_0x7bca('0x15d')],{'onDelete':'restrict','foreignKey':_0x7bca('0x167')});db[_0x7bca('0x4f')][_0x7bca('0x103')](db['SmsMessage'],{'as':'Messages','onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x176')});db[_0x7bca('0x4f')][_0x7bca('0x13d')](db[_0x7bca('0x4d')],{'as':_0x7bca('0x159'),'foreignKey':_0x7bca('0x172')});db[_0x7bca('0x4f')][_0x7bca('0x13d')](db[_0x7bca('0x114')],{'as':'Contact','foreignKey':_0x7bca('0x14c')});db[_0x7bca('0x4f')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'as':_0x7bca('0x15a'),'foreignKey':_0x7bca('0x101')});db[_0x7bca('0x4f')]['belongsToMany'](db['Tag'],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0x7bca('0x4f')][_0x7bca('0x111')](db['Tag'],{'through':_0x7bca('0x177'),'as':_0x7bca('0x15e')});db['SmsInteraction'][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x16f'),'through':_0x7bca('0x11c'),'foreignKey':_0x7bca('0x176')});db[_0x7bca('0x173')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'as':_0x7bca('0x14')});db[_0x7bca('0x173')][_0x7bca('0x13d')](db[_0x7bca('0x114')],{'onDelete':_0x7bca('0x100'),'as':_0x7bca('0x14b')});db[_0x7bca('0x173')]['belongsTo'](db['SmsInteraction'],{'onDelete':'cascade','as':_0x7bca('0x162'),'foreignKey':_0x7bca('0x176')});db[_0x7bca('0x173')][_0x7bca('0x13d')](db[_0x7bca('0x4d')],{'as':_0x7bca('0x159'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x141'),'through':'UserSmsQueue','foreignKey':_0x7bca('0x178')});db['SmsQueue']['belongsToMany'](db[_0x7bca('0xdc')],{'through':_0x7bca('0x179'),'as':_0x7bca('0x142')});db[_0x7bca('0x53')][_0x7bca('0x103')](db[_0x7bca('0x150')],{'as':_0x7bca('0x151'),'foreignKey':_0x7bca('0x17a')});db['OpenchannelAccount']['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x7bca('0x53')][_0x7bca('0x103')](db[_0x7bca('0x109')],{'as':_0x7bca('0x154'),'foreignKey':_0x7bca('0x17a')});db[_0x7bca('0x53')][_0x7bca('0x103')](db[_0x7bca('0x57')],{'as':'Messages','foreignKey':_0x7bca('0x17a')});db[_0x7bca('0x53')][_0x7bca('0x103')](db[_0x7bca('0x54')],{'as':_0x7bca('0x133'),'foreignKey':_0x7bca('0x17a')});db[_0x7bca('0x53')][_0x7bca('0x13d')](db[_0x7bca('0xe9')],{'as':'List','foreignKey':_0x7bca('0x16a')});db[_0x7bca('0x53')][_0x7bca('0x13d')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount'][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x141'),'through':_0x7bca('0x12b')});db[_0x7bca('0x54')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'onDelete':'restrict'});db[_0x7bca('0x54')][_0x7bca('0x13d')](db['OpenchannelQueue'],{'onDelete':_0x7bca('0x166'),'foreignKey':_0x7bca('0x17b')});db[_0x7bca('0x54')][_0x7bca('0x13d')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication'][_0x7bca('0x13d')](db[_0x7bca('0x7c')],{'onDelete':_0x7bca('0x166'),'foreignKey':_0x7bca('0x13e')});db['OpenchannelApplication']['belongsTo'](db[_0x7bca('0x15d')],{'onDelete':_0x7bca('0x166'),'foreignKey':_0x7bca('0x167')});db[_0x7bca('0x109')]['hasMany'](db[_0x7bca('0x57')],{'as':_0x7bca('0x145'),'onDelete':_0x7bca('0x100'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelInteraction']['belongsTo'](db[_0x7bca('0x53')],{'as':_0x7bca('0x159'),'foreignKey':_0x7bca('0x17a')});db[_0x7bca('0x109')][_0x7bca('0x13d')](db[_0x7bca('0x114')],{'as':_0x7bca('0x14b'),'foreignKey':_0x7bca('0x14c')});db[_0x7bca('0x109')][_0x7bca('0x13d')](db['User'],{'as':_0x7bca('0x15a'),'foreignKey':_0x7bca('0x101')});db[_0x7bca('0x109')][_0x7bca('0x111')](db['Tag'],{'through':_0x7bca('0x17c'),'as':_0x7bca('0x15c')});db['OpenchannelInteraction'][_0x7bca('0x111')](db[_0x7bca('0x15d')],{'through':'openchannel_interaction_has_tags','as':_0x7bca('0x15e')});db['OpenchannelInteraction'][_0x7bca('0x111')](db['User'],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':_0x7bca('0x17d')});db[_0x7bca('0x57')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'onDelete':_0x7bca('0x100'),'as':'User'});db[_0x7bca('0x57')][_0x7bca('0x13d')](db[_0x7bca('0x114')],{'onDelete':_0x7bca('0x100'),'as':_0x7bca('0x14b')});db[_0x7bca('0x57')][_0x7bca('0x13d')](db[_0x7bca('0x109')],{'onDelete':_0x7bca('0x100'),'as':_0x7bca('0x162'),'foreignKey':_0x7bca('0x17d')});db['OpenchannelMessage'][_0x7bca('0x13d')](db[_0x7bca('0x160')],{'as':'Attachment','foreignKey':_0x7bca('0x170')});db[_0x7bca('0x57')][_0x7bca('0x13d')](db['OpenchannelAccount'],{'as':_0x7bca('0x159'),'foreignKey':_0x7bca('0x17a')});db[_0x7bca('0x59')][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x141'),'through':_0x7bca('0x33'),'foreignKey':'OpenchannelQueueId'});db[_0x7bca('0x59')][_0x7bca('0x111')](db[_0x7bca('0xdc')],{'through':_0x7bca('0x17e'),'as':_0x7bca('0x142')});db['ChatWebsite']['hasMany'](db['Disposition'],{'as':_0x7bca('0x151'),'foreignKey':_0x7bca('0x164')});db[_0x7bca('0x163')][_0x7bca('0x103')](db['CannedAnswer'],{'as':_0x7bca('0x152'),'foreignKey':'ChatWebsiteId'});db[_0x7bca('0x163')][_0x7bca('0x103')](db['ChatProactiveAction'],{'as':_0x7bca('0x17f')});db['ChatWebsite'][_0x7bca('0x103')](db['ChatInteraction'],{'as':_0x7bca('0x154')});db['ChatWebsite'][_0x7bca('0x103')](db[_0x7bca('0x5d')],{'as':'Applications'});db[_0x7bca('0x163')][_0x7bca('0x103')](db['ChatMessage'],{'as':_0x7bca('0x145')});db[_0x7bca('0x163')]['belongsTo'](db[_0x7bca('0xe9')],{'as':_0x7bca('0x169'),'foreignKey':'ListId'});db[_0x7bca('0x163')][_0x7bca('0x13d')](db[_0x7bca('0x7c')],{'as':_0x7bca('0x7c'),'foreignKey':'IntervalId'});db[_0x7bca('0x163')]['belongsTo'](db[_0x7bca('0x39')],{'as':_0x7bca('0x39'),'foreignKey':_0x7bca('0x14d')});db[_0x7bca('0x163')][_0x7bca('0x13d')](db[_0x7bca('0x7e')],{'as':_0x7bca('0x13f'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':'Agents','through':_0x7bca('0x126')});db[_0x7bca('0x5c')]['belongsTo'](db[_0x7bca('0x53')],{});db[_0x7bca('0x5c')][_0x7bca('0x13d')](db[_0x7bca('0xe9')],{'as':_0x7bca('0x169'),'foreignKey':_0x7bca('0x16a')});db[_0x7bca('0x5c')]['belongsTo'](db[_0x7bca('0x114')],{'as':_0x7bca('0x14b'),'foreignKey':_0x7bca('0x14c')});db[_0x7bca('0x5c')][_0x7bca('0x13d')](db[_0x7bca('0x109')],{});db[_0x7bca('0x5c')][_0x7bca('0x13d')](db[_0x7bca('0x57')],{});db[_0x7bca('0x5c')][_0x7bca('0x13d')](db['User'],{});db[_0x7bca('0x5c')]['belongsTo'](db['OpenchannelQueue'],{});db[_0x7bca('0x5d')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'as':_0x7bca('0x180'),'foreignKey':_0x7bca('0x101'),'onDelete':_0x7bca('0x166')});db[_0x7bca('0x5d')][_0x7bca('0x13d')](db['ChatQueue'],{'as':_0x7bca('0x181'),'foreignKey':'ChatQueueId','onDelete':_0x7bca('0x166')});db['ChatApplication'][_0x7bca('0x13d')](db[_0x7bca('0x163')],{'as':_0x7bca('0x182'),'foreignKey':_0x7bca('0x164'),'onDelete':'restrict'});db[_0x7bca('0x5d')]['belongsTo'](db[_0x7bca('0x15d')],{'onDelete':_0x7bca('0x166'),'foreignKey':_0x7bca('0x167')});db[_0x7bca('0x5f')][_0x7bca('0x103')](db[_0x7bca('0x60')],{'as':_0x7bca('0x145'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x183')});db[_0x7bca('0x5f')]['belongsTo'](db[_0x7bca('0x163')],{'as':_0x7bca('0x159'),'foreignKey':_0x7bca('0x164')});db[_0x7bca('0x5f')][_0x7bca('0x13d')](db['CmContact'],{'as':_0x7bca('0x14b'),'foreignKey':'ContactId'});db[_0x7bca('0x5f')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'as':_0x7bca('0x15a'),'foreignKey':_0x7bca('0x101')});db['ChatInteraction']['belongsToMany'](db[_0x7bca('0x15d')],{'through':_0x7bca('0x184'),'as':_0x7bca('0x15c')});db[_0x7bca('0x5f')]['belongsToMany'](db[_0x7bca('0x15d')],{'through':_0x7bca('0x184'),'as':_0x7bca('0x15e')});db['ChatInteraction'][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x16f'),'through':_0x7bca('0x11a'),'foreignKey':_0x7bca('0x183')});db[_0x7bca('0x60')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'onDelete':_0x7bca('0x100'),'as':_0x7bca('0x14')});db['ChatMessage'][_0x7bca('0x13d')](db[_0x7bca('0x114')],{'onDelete':'cascade','as':_0x7bca('0x14b'),'foreignKey':_0x7bca('0x14c')});db['ChatMessage']['belongsTo'](db['ChatInteraction'],{'onDelete':_0x7bca('0x100'),'as':_0x7bca('0x162'),'foreignKey':_0x7bca('0x183')});db['ChatMessage'][_0x7bca('0x13d')](db[_0x7bca('0x160')],{'as':_0x7bca('0x160'),'foreignKey':'AttachmentId'});db[_0x7bca('0x60')][_0x7bca('0x13d')](db[_0x7bca('0x163')],{'as':'Account','foreignKey':_0x7bca('0x164')});db[_0x7bca('0x61')][_0x7bca('0x103')](db[_0x7bca('0x160')],{'as':_0x7bca('0x161'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db[_0x7bca('0x61')][_0x7bca('0x13d')](db[_0x7bca('0x114')],{'onDelete':_0x7bca('0x100'),'as':_0x7bca('0x14b'),'foreignKey':_0x7bca('0x14c')});db[_0x7bca('0x61')][_0x7bca('0x13d')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x141'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue']['belongsToMany'](db['Team'],{'through':_0x7bca('0x185'),'as':'Teams'});db[_0x7bca('0x65')][_0x7bca('0x103')](db[_0x7bca('0xc9')],{'as':_0x7bca('0x145'),'foreignKey':'ChatGroupId','onDelete':_0x7bca('0x100')});db[_0x7bca('0x65')]['belongsToMany'](db[_0x7bca('0x14')],{'as':_0x7bca('0x135'),'through':_0x7bca('0x113')});db[_0x7bca('0x66')][_0x7bca('0x13d')](db[_0x7bca('0x163')],{'as':_0x7bca('0x182'),'foreignKey':_0x7bca('0x164')});db[_0x7bca('0x68')][_0x7bca('0x103')](db[_0x7bca('0x114')],{'as':'Contacts','foreignKey':_0x7bca('0x186')});db[_0x7bca('0x114')]['hasMany'](db['CmContactHasItem'],{'as':_0x7bca('0x187'),'foreignKey':_0x7bca('0x188')});db[_0x7bca('0x114')]['hasMany'](db['CmHopper'],{'as':_0x7bca('0x189'),'foreignKey':_0x7bca('0x14c')});db[_0x7bca('0x114')][_0x7bca('0x103')](db[_0x7bca('0x6e')],{'as':_0x7bca('0x107'),'foreignKey':_0x7bca('0x14c')});db['CmContact'][_0x7bca('0x103')](db[_0x7bca('0x70')],{'as':_0x7bca('0x136'),'foreignKey':_0x7bca('0x14c')});db['CmContact']['hasMany'](db[_0x7bca('0x108')],{'as':_0x7bca('0x108'),'foreignKey':_0x7bca('0x14c')});db[_0x7bca('0x114')][_0x7bca('0x103')](db[_0x7bca('0xcf')],{'as':_0x7bca('0x138'),'foreignKey':_0x7bca('0x14c')});db[_0x7bca('0x114')][_0x7bca('0x103')](db[_0x7bca('0x109')],{'as':_0x7bca('0x10a'),'foreignKey':_0x7bca('0x14c'),'onDelete':'restrict'});db[_0x7bca('0x114')]['hasMany'](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x7bca('0x14c'),'onDelete':'restrict'});db[_0x7bca('0x114')][_0x7bca('0x103')](db[_0x7bca('0x4f')],{'as':_0x7bca('0x10c'),'foreignKey':_0x7bca('0x14c'),'onDelete':_0x7bca('0x166')});db[_0x7bca('0x114')][_0x7bca('0x103')](db[_0x7bca('0x46')],{'as':_0x7bca('0x18a'),'foreignKey':_0x7bca('0x14c'),'onDelete':_0x7bca('0x166')});db['CmContact'][_0x7bca('0x103')](db['MailInteraction'],{'as':_0x7bca('0x10d'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x7bca('0x114')][_0x7bca('0x13d')](db[_0x7bca('0x68')],{'as':_0x7bca('0x18b'),'foreignKey':_0x7bca('0x186')});db['CmContact'][_0x7bca('0x13d')](db['CmList'],{'as':_0x7bca('0x169'),'foreignKey':'ListId','onDelete':_0x7bca('0x100')});db[_0x7bca('0x114')][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x16f'),'through':_0x7bca('0x116')});db['CmContact']['belongsToMany'](db['Tag'],{'as':_0x7bca('0x15c'),'through':_0x7bca('0x18c')});db['CmContact']['belongsToMany'](db[_0x7bca('0x15d')],{'through':'cm_contact_has_tags','as':_0x7bca('0x15e')});db[_0x7bca('0x6a')]['hasMany'](db[_0x7bca('0x18d')],{'as':_0x7bca('0x18e'),'foreignKey':'CmHopperId'});db['CmHopper'][_0x7bca('0x13d')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x7bca('0x100')});db[_0x7bca('0x6a')][_0x7bca('0x13d')](db[_0x7bca('0xe9')],{'as':'List','foreignKey':'ListId','onDelete':_0x7bca('0x100')});db[_0x7bca('0x6a')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'as':_0x7bca('0x180'),'foreignKey':_0x7bca('0x101')});db[_0x7bca('0x6a')][_0x7bca('0x13d')](db['VoiceQueue'],{'as':_0x7bca('0x181'),'foreignKey':_0x7bca('0x137'),'onDelete':_0x7bca('0x100')});db[_0x7bca('0x6a')]['belongsTo'](db[_0x7bca('0x18f')],{'as':_0x7bca('0x18f'),'foreignKey':_0x7bca('0x190'),'onDelete':_0x7bca('0x100')});db[_0x7bca('0x6a')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'as':_0x7bca('0x15a'),'foreignKey':_0x7bca('0x191')});db[_0x7bca('0x6c')][_0x7bca('0x13d')](db['CmContact'],{'as':_0x7bca('0x14b'),'foreignKey':_0x7bca('0x14c'),'onDelete':_0x7bca('0x100')});db['CmHopperBlack'][_0x7bca('0x13d')](db[_0x7bca('0xe9')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0x7bca('0x6c')]['belongsTo'](db['VoiceQueue'],{'as':_0x7bca('0x181'),'foreignKey':'VoiceQueueId','onDelete':_0x7bca('0x100')});db[_0x7bca('0x6c')][_0x7bca('0x13d')](db[_0x7bca('0x18f')],{'as':_0x7bca('0x18f'),'foreignKey':_0x7bca('0x190'),'onDelete':'cascade'});db['Automation'][_0x7bca('0x103')](db['Condition'],{'as':{'plural':_0x7bca('0x192'),'singular':_0x7bca('0x193')},'foreignKey':_0x7bca('0x194'),'onDelete':'cascade','hooks':!![]});db[_0x7bca('0x195')]['hasMany'](db[_0x7bca('0x7a')],{'as':{'plural':_0x7bca('0x196'),'singular':_0x7bca('0x197')},'foreignKey':_0x7bca('0x198'),'onDelete':_0x7bca('0x100'),'hooks':!![]});db['Automation']['hasMany'](db[_0x7bca('0x74')],{'as':_0x7bca('0x199'),'foreignKey':_0x7bca('0x19a'),'onDelete':_0x7bca('0x100'),'hooks':!![]});db[_0x7bca('0x150')][_0x7bca('0x103')](db[_0x7bca('0x150')],{'as':'Dispositions','foreignKey':_0x7bca('0x19b'),'onDelete':_0x7bca('0x100')});db[_0x7bca('0x7c')][_0x7bca('0x103')](db[_0x7bca('0x7c')],{'as':_0x7bca('0x19c'),'foreignKey':_0x7bca('0x13e'),'onDelete':_0x7bca('0x100'),'hooks':!![],'required':![]});db[_0x7bca('0x7c')]['hasMany'](db['VoiceExtension'],{'as':'Extensions','foreignKey':_0x7bca('0x13e'),'onDelete':_0x7bca('0x166')});db[_0x7bca('0x7c')]['hasMany'](db['MailApplication'],{'as':_0x7bca('0x19d'),'foreignKey':_0x7bca('0x13e')});db['Interval'][_0x7bca('0x103')](db['ChatApplication'],{'as':_0x7bca('0x19e'),'foreignKey':'IntervalId'});db['Interval']['hasMany'](db[_0x7bca('0x44')],{'as':_0x7bca('0x19f'),'foreignKey':_0x7bca('0x13e')});db[_0x7bca('0x7c')][_0x7bca('0x103')](db[_0x7bca('0x174')],{'as':_0x7bca('0x1a0'),'foreignKey':'IntervalId'});db[_0x7bca('0x83')]['belongsTo'](db['MailAccount'],{});db[_0x7bca('0x83')]['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':_0x7bca('0x1a1')});db[_0x7bca('0x83')][_0x7bca('0x13d')](db[_0x7bca('0x92')],{'foreignKey':_0x7bca('0x1a2')});db[_0x7bca('0x85')][_0x7bca('0x111')](db[_0x7bca('0x1a')],{'as':_0x7bca('0x1a3'),'through':'moh_has_sounds','onDelete':_0x7bca('0x166')});db['Tag']['belongsToMany'](db[_0x7bca('0x114')],{'through':_0x7bca('0x18c')});db[_0x7bca('0x15d')]['belongsToMany'](db['ChatInteraction'],{'through':_0x7bca('0x184')});db[_0x7bca('0x15d')][_0x7bca('0x111')](db[_0x7bca('0x3d')],{'through':_0x7bca('0x15b')});db[_0x7bca('0x15d')][_0x7bca('0x111')](db[_0x7bca('0x4f')],{'through':'sms_interaction_has_tags'});db['Tag'][_0x7bca('0x111')](db[_0x7bca('0x46')],{'through':_0x7bca('0x16e')});db['Tag']['belongsToMany'](db[_0x7bca('0x109')],{'through':_0x7bca('0x17c')});db['Tag'][_0x7bca('0x111')](db[_0x7bca('0xf5')],{'through':_0x7bca('0x1a4')});db[_0x7bca('0x87')]['belongsTo'](db['ContactItemType'],{'as':'ItemType','foreignKey':'ItemTypeId'});db[_0x7bca('0x18d')][_0x7bca('0x13d')](db[_0x7bca('0x6a')],{'as':_0x7bca('0x1a5'),'foreignKey':'CmHopperId'});db[_0x7bca('0x8a')][_0x7bca('0x103')](db[_0x7bca('0x7a')],{'as':{'plural':_0x7bca('0x1a6'),'singular':_0x7bca('0x1a7')},'foreignKey':_0x7bca('0x1a8'),'onDelete':'cascade','hooks':!![]});db[_0x7bca('0x8a')][_0x7bca('0x103')](db['Condition'],{'as':{'plural':_0x7bca('0x1a9'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0x7bca('0x100'),'hooks':!![]});db[_0x7bca('0x8a')][_0x7bca('0x103')](db[_0x7bca('0x74')],{'as':'Actions','foreignKey':_0x7bca('0x1aa'),'onDelete':_0x7bca('0x100'),'hooks':!![]});db['AnalyticCustomReport'][_0x7bca('0x103')](db[_0x7bca('0x97')],{'as':_0x7bca('0x1ab'),'onDelete':'cascade','foreignKey':_0x7bca('0x1a2'),'hooks':!![]});db[_0x7bca('0x1ac')][_0x7bca('0x103')](db[_0x7bca('0x97')],{'as':_0x7bca('0x1ab'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x7bca('0x95')][_0x7bca('0x103')](db[_0x7bca('0x97')],{'as':_0x7bca('0x1ab'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1ad')});db[_0x7bca('0x97')][_0x7bca('0x13d')](db[_0x7bca('0x95')],{'foreignKey':_0x7bca('0x1ad')});db['SalesforceAccount'][_0x7bca('0x103')](db[_0x7bca('0x9d')],{'as':_0x7bca('0x1ae'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1af')});db[_0x7bca('0x9d')]['hasMany'](db[_0x7bca('0x9f')],{'as':'Subjects','onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1b0')});db['SalesforceConfiguration']['hasMany'](db[_0x7bca('0x9f')],{'as':_0x7bca('0x1b1'),'onDelete':_0x7bca('0x100'),'foreignKey':'DescriptionId'});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0x7bca('0x1ab'),'onDelete':_0x7bca('0x100'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x7bca('0x13d')](db[_0x7bca('0x9b')],{'as':'Account','foreignKey':_0x7bca('0x1af')});db[_0x7bca('0x9f')][_0x7bca('0x103')](db[_0x7bca('0x9f')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x7bca('0x9f')][_0x7bca('0x103')](db[_0x7bca('0x9f')],{'as':_0x7bca('0x1b2'),'foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0x9f')][_0x7bca('0x103')](db[_0x7bca('0x9f')],{'as':_0x7bca('0x1b4'),'foreignKey':_0x7bca('0x1b5')});db[_0x7bca('0x9f')]['belongsTo'](db[_0x7bca('0x8c')],{'as':'Variable','foreignKey':_0x7bca('0x1b6')});db['SugarcrmAccount'][_0x7bca('0x103')](db[_0x7bca('0xa3')],{'as':_0x7bca('0x1ae'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1af')});db[_0x7bca('0xa3')][_0x7bca('0x103')](db[_0x7bca('0xa5')],{'as':_0x7bca('0x1b7'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1b0')});db[_0x7bca('0xa3')][_0x7bca('0x103')](db[_0x7bca('0xa5')],{'as':_0x7bca('0x1b1'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0xa3')]['hasMany'](db[_0x7bca('0xa5')],{'as':'Fields','onDelete':_0x7bca('0x100'),'foreignKey':'FieldId'});db[_0x7bca('0xa3')][_0x7bca('0x13d')](db[_0x7bca('0xa1')],{'as':_0x7bca('0x159'),'foreignKey':_0x7bca('0x1af')});db[_0x7bca('0xa5')][_0x7bca('0x103')](db[_0x7bca('0xa5')],{'as':_0x7bca('0x1b8'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0x7bca('0x103')](db['SugarcrmField'],{'as':_0x7bca('0x1b2'),'foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0xa5')][_0x7bca('0x103')](db[_0x7bca('0xa5')],{'as':_0x7bca('0x1b4'),'foreignKey':_0x7bca('0x1b5')});db[_0x7bca('0xa5')][_0x7bca('0x13d')](db[_0x7bca('0x8c')],{'as':_0x7bca('0x8c'),'foreignKey':'VariableId'});db[_0x7bca('0xa7')][_0x7bca('0x103')](db[_0x7bca('0xa8')],{'as':_0x7bca('0x1ae'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1af')});db['DeskConfiguration'][_0x7bca('0x103')](db['DeskField'],{'as':'Subjects','onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1b0')});db[_0x7bca('0xa8')]['hasMany'](db[_0x7bca('0xaa')],{'as':'Descriptions','onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0xa8')]['hasMany'](db[_0x7bca('0xaa')],{'as':_0x7bca('0x1ab'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1b5')});db['DeskConfiguration'][_0x7bca('0x13d')](db[_0x7bca('0xa7')],{'as':_0x7bca('0x159'),'foreignKey':_0x7bca('0x1af')});db[_0x7bca('0xa8')][_0x7bca('0x111')](db['Tag'],{'through':_0x7bca('0x1b9')});db[_0x7bca('0xaa')][_0x7bca('0x103')](db[_0x7bca('0xaa')],{'as':_0x7bca('0x1b8'),'foreignKey':_0x7bca('0x1b0')});db[_0x7bca('0xaa')]['hasMany'](db['DeskField'],{'as':_0x7bca('0x1b2'),'foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0xaa')]['hasMany'](db[_0x7bca('0xaa')],{'as':_0x7bca('0x1b4'),'foreignKey':_0x7bca('0x1b5')});db[_0x7bca('0xaa')][_0x7bca('0x13d')](db[_0x7bca('0x8c')],{'as':'Variable','foreignKey':_0x7bca('0x1b6')});db[_0x7bca('0xac')][_0x7bca('0x103')](db[_0x7bca('0xad')],{'as':'Configurations','onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1af')});db[_0x7bca('0xad')][_0x7bca('0x103')](db[_0x7bca('0xaf')],{'as':_0x7bca('0x1b7'),'onDelete':'cascade','foreignKey':_0x7bca('0x1b0')});db[_0x7bca('0xad')][_0x7bca('0x103')](db[_0x7bca('0xaf')],{'as':_0x7bca('0x1b1'),'onDelete':'cascade','foreignKey':_0x7bca('0x1b3')});db['ZohoConfiguration'][_0x7bca('0x103')](db[_0x7bca('0xaf')],{'as':_0x7bca('0x1ab'),'onDelete':_0x7bca('0x100'),'foreignKey':'FieldId'});db[_0x7bca('0xad')][_0x7bca('0x13d')](db[_0x7bca('0xac')],{'as':'Account','foreignKey':_0x7bca('0x1af')});db[_0x7bca('0xaf')][_0x7bca('0x103')](db[_0x7bca('0xaf')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x7bca('0xaf')][_0x7bca('0x103')](db['ZohoField'],{'as':_0x7bca('0x1b2'),'foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0xaf')]['hasMany'](db['ZohoField'],{'as':_0x7bca('0x1b4'),'foreignKey':_0x7bca('0x1b5')});db[_0x7bca('0xaf')][_0x7bca('0x13d')](db[_0x7bca('0x8c')],{'as':_0x7bca('0x8c'),'foreignKey':'VariableId'});db['ZendeskAccount'][_0x7bca('0x103')](db['ZendeskConfiguration'],{'as':_0x7bca('0x1ae'),'onDelete':_0x7bca('0x100'),'foreignKey':'AccountId'});db[_0x7bca('0xb1')]['hasMany'](db[_0x7bca('0xb3')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x7bca('0xb1')][_0x7bca('0x103')](db[_0x7bca('0xb3')],{'as':_0x7bca('0x1b1'),'foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0xb1')]['hasMany'](db[_0x7bca('0xb3')],{'as':_0x7bca('0x1ab'),'foreignKey':_0x7bca('0x1b5')});db[_0x7bca('0xb1')][_0x7bca('0x13d')](db[_0x7bca('0x1ba')],{'as':_0x7bca('0x159'),'foreignKey':_0x7bca('0x1af')});db[_0x7bca('0xb1')][_0x7bca('0x111')](db[_0x7bca('0x15d')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x7bca('0x103')](db[_0x7bca('0xb3')],{'as':_0x7bca('0x1b8'),'foreignKey':_0x7bca('0x1b0')});db[_0x7bca('0xb3')][_0x7bca('0x103')](db['ZendeskField'],{'as':_0x7bca('0x1b2'),'foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0xb3')]['hasMany'](db[_0x7bca('0xb3')],{'as':_0x7bca('0x1b4'),'foreignKey':_0x7bca('0x1b5')});db[_0x7bca('0xb3')][_0x7bca('0x13d')](db[_0x7bca('0x8c')],{'as':_0x7bca('0x8c'),'foreignKey':'VariableId'});db[_0x7bca('0xb4')][_0x7bca('0x103')](db['FreshdeskConfiguration'],{'as':_0x7bca('0x1ae'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1af')});db[_0x7bca('0xb5')][_0x7bca('0x103')](db[_0x7bca('0xb7')],{'as':_0x7bca('0x1b7'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1b0')});db[_0x7bca('0xb5')][_0x7bca('0x103')](db['FreshdeskField'],{'as':_0x7bca('0x1b1'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0xb5')][_0x7bca('0x103')](db[_0x7bca('0xb7')],{'as':'Fields','onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1b5')});db[_0x7bca('0xb5')][_0x7bca('0x13d')](db[_0x7bca('0xb4')],{'as':_0x7bca('0x159'),'foreignKey':'AccountId'});db[_0x7bca('0xb5')][_0x7bca('0x111')](db[_0x7bca('0x15d')],{'through':_0x7bca('0x1bb')});db[_0x7bca('0xb7')]['hasMany'](db[_0x7bca('0xb7')],{'as':_0x7bca('0x1b8'),'foreignKey':_0x7bca('0x1b0')});db['FreshdeskField'][_0x7bca('0x103')](db[_0x7bca('0xb7')],{'as':_0x7bca('0x1b2'),'foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0xb7')][_0x7bca('0x103')](db[_0x7bca('0xb7')],{'as':_0x7bca('0x1b4'),'foreignKey':_0x7bca('0x1b5')});db[_0x7bca('0xb7')][_0x7bca('0x13d')](db[_0x7bca('0x8c')],{'as':'Variable','foreignKey':_0x7bca('0x1b6')});db['VtigerAccount'][_0x7bca('0x103')](db['VtigerConfiguration'],{'as':_0x7bca('0x1ae'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1af')});db[_0x7bca('0xba')]['hasMany'](db[_0x7bca('0x1bc')],{'as':'Subjects','foreignKey':_0x7bca('0x1b0')});db[_0x7bca('0xba')]['hasMany'](db[_0x7bca('0x1bc')],{'as':_0x7bca('0x1b1'),'foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0xba')][_0x7bca('0x103')](db['VtigerField'],{'as':_0x7bca('0x1ab'),'foreignKey':_0x7bca('0x1b5')});db[_0x7bca('0xba')][_0x7bca('0x13d')](db[_0x7bca('0x1bd')],{'as':_0x7bca('0x159'),'foreignKey':_0x7bca('0x1af')});db[_0x7bca('0x1bc')]['hasMany'](db[_0x7bca('0x1bc')],{'as':'Subject','foreignKey':_0x7bca('0x1b0')});db[_0x7bca('0x1bc')]['hasMany'](db[_0x7bca('0x1bc')],{'as':_0x7bca('0x1b2'),'foreignKey':'DescriptionId'});db['VtigerField']['hasMany'](db['VtigerField'],{'as':'Field','foreignKey':_0x7bca('0x1b5')});db['VtigerField'][_0x7bca('0x13d')](db[_0x7bca('0x8c')],{'as':_0x7bca('0x8c'),'foreignKey':_0x7bca('0x1b6')});db[_0x7bca('0xbd')][_0x7bca('0x103')](db[_0x7bca('0x1be')],{'as':_0x7bca('0x1ae'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1af')});db[_0x7bca('0x1be')][_0x7bca('0x103')](db[_0x7bca('0xbf')],{'as':_0x7bca('0x1b7'),'foreignKey':_0x7bca('0x1b0')});db[_0x7bca('0x1be')][_0x7bca('0x103')](db['ServicenowField'],{'as':_0x7bca('0x1b1'),'foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0x1be')][_0x7bca('0x103')](db['ServicenowField'],{'as':_0x7bca('0x1ab'),'foreignKey':'FieldId'});db['ServicenowConfiguration']['belongsTo'](db['ServicenowAccount'],{'as':_0x7bca('0x159'),'foreignKey':'AccountId'});db[_0x7bca('0xbf')]['hasMany'](db[_0x7bca('0xbf')],{'as':_0x7bca('0x1b8'),'foreignKey':_0x7bca('0x1b0')});db[_0x7bca('0xbf')]['hasMany'](db[_0x7bca('0xbf')],{'as':'Description','foreignKey':'DescriptionId'});db['ServicenowField'][_0x7bca('0x103')](db['ServicenowField'],{'as':_0x7bca('0x1b4'),'foreignKey':'FieldId'});db['ServicenowField']['belongsTo'](db[_0x7bca('0x8c')],{'as':'Variable','foreignKey':_0x7bca('0x1b6')});db[_0x7bca('0x1bf')][_0x7bca('0x103')](db['Dynamics365Configuration'],{'as':_0x7bca('0x1ae'),'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1af')});db['Dynamics365Configuration'][_0x7bca('0x103')](db[_0x7bca('0xc2')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x7bca('0x1b0')});db[_0x7bca('0x1c0')][_0x7bca('0x103')](db[_0x7bca('0xc2')],{'as':_0x7bca('0x1b1'),'onDelete':'cascade','foreignKey':_0x7bca('0x1b3')});db['Dynamics365Configuration']['hasMany'](db[_0x7bca('0xc2')],{'as':_0x7bca('0x1ab'),'onDelete':'cascade','foreignKey':_0x7bca('0x1b5')});db[_0x7bca('0x1c0')]['belongsTo'](db[_0x7bca('0x1bf')],{'as':_0x7bca('0x159'),'foreignKey':'AccountId'});db[_0x7bca('0xc2')][_0x7bca('0x103')](db[_0x7bca('0xc2')],{'as':_0x7bca('0x1b8'),'foreignKey':_0x7bca('0x1b0')});db[_0x7bca('0xc2')][_0x7bca('0x103')](db[_0x7bca('0xc2')],{'as':_0x7bca('0x1b2'),'foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0xc2')][_0x7bca('0x103')](db['Dynamics365Field'],{'as':'Field','foreignKey':'FieldId'});db[_0x7bca('0xc2')]['belongsTo'](db[_0x7bca('0x8c')],{'as':_0x7bca('0x8c'),'foreignKey':'VariableId'});db['FreshsalesAccount']['hasMany'](db[_0x7bca('0xc4')],{'as':'Configurations','onDelete':_0x7bca('0x100'),'foreignKey':'AccountId'});db[_0x7bca('0xc4')][_0x7bca('0x103')](db[_0x7bca('0xc6')],{'as':'Subjects','foreignKey':_0x7bca('0x1b0')});db[_0x7bca('0xc4')][_0x7bca('0x103')](db[_0x7bca('0xc6')],{'as':'Descriptions','foreignKey':_0x7bca('0x1b3')});db[_0x7bca('0xc4')][_0x7bca('0x103')](db[_0x7bca('0xc6')],{'as':'Fields','foreignKey':_0x7bca('0x1b5')});db[_0x7bca('0xc4')][_0x7bca('0x13d')](db[_0x7bca('0xc3')],{'as':_0x7bca('0x159'),'foreignKey':_0x7bca('0x1af')});db[_0x7bca('0xc6')]['hasMany'](db['FreshsalesField'],{'as':_0x7bca('0x1b8'),'foreignKey':'SubjectId'});db[_0x7bca('0xc6')][_0x7bca('0x103')](db[_0x7bca('0xc6')],{'as':_0x7bca('0x1b2'),'foreignKey':'DescriptionId'});db[_0x7bca('0xc6')][_0x7bca('0x103')](db[_0x7bca('0xc6')],{'as':_0x7bca('0x1b4'),'foreignKey':_0x7bca('0x1b5')});db[_0x7bca('0xc6')][_0x7bca('0x13d')](db[_0x7bca('0x8c')],{'as':'Variable','foreignKey':'VariableId'});db[_0x7bca('0x1c1')][_0x7bca('0x13d')](db[_0x7bca('0x163')],{});db[_0x7bca('0x1c1')][_0x7bca('0x13d')](db[_0x7bca('0xe9')],{'as':'List','foreignKey':'ListId'});db[_0x7bca('0x1c1')][_0x7bca('0x13d')](db[_0x7bca('0x114')],{'as':'Contact','foreignKey':'ContactId'});db[_0x7bca('0x1c1')][_0x7bca('0x13d')](db[_0x7bca('0x5f')],{});db[_0x7bca('0x1c1')][_0x7bca('0x13d')](db[_0x7bca('0x60')],{});db[_0x7bca('0x1c1')]['belongsTo'](db[_0x7bca('0x14')],{});db['ChatQueueReport'][_0x7bca('0x13d')](db['ChatQueue'],{});db[_0x7bca('0xc9')]['belongsTo'](db[_0x7bca('0x14')],{'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1c2')});db['ChatInternalMessage'][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x1c3')});db[_0x7bca('0xcf')]['hasMany'](db[_0x7bca('0xcd')],{'foreignKey':_0x7bca('0x1c4'),'onDelete':_0x7bca('0x100')});db[_0x7bca('0xcf')][_0x7bca('0x103')](db[_0x7bca('0xcb')],{'foreignKey':_0x7bca('0x1c4'),'onDelete':_0x7bca('0x100')});db[_0x7bca('0x1c5')][_0x7bca('0x13d')](db[_0x7bca('0x4d')],{});db[_0x7bca('0x1c5')]['belongsTo'](db[_0x7bca('0xe9')],{'as':_0x7bca('0x169'),'foreignKey':_0x7bca('0x16a')});db[_0x7bca('0x1c5')][_0x7bca('0x13d')](db[_0x7bca('0x114')],{'as':_0x7bca('0x14b'),'foreignKey':'ContactId'});db[_0x7bca('0x1c5')]['belongsTo'](db[_0x7bca('0x4f')],{});db[_0x7bca('0x1c5')][_0x7bca('0x13d')](db[_0x7bca('0x173')],{});db[_0x7bca('0x1c5')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{});db[_0x7bca('0x1c5')][_0x7bca('0x13d')](db['SmsQueue'],{});db[_0x7bca('0x1c6')]['hasMany'](db[_0x7bca('0xcf')],{'foreignKey':'ProjectId'});db[_0x7bca('0x1c6')][_0x7bca('0x103')](db[_0x7bca('0xcd')],{'foreignKey':_0x7bca('0x1c7')});db['JscriptyProject'][_0x7bca('0x103')](db[_0x7bca('0xcb')],{'foreignKey':'ProjectId'});db[_0x7bca('0xd7')][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x16f'),'through':_0x7bca('0x1c8')});db[_0x7bca('0xdc')]['belongsToMany'](db[_0x7bca('0x14')],{'as':_0x7bca('0x141'),'through':'user_has_teams'});db[_0x7bca('0xdc')][_0x7bca('0x111')](db['VoiceQueue'],{'through':_0x7bca('0xfd'),'as':_0x7bca('0x11e')});db[_0x7bca('0xdc')][_0x7bca('0x111')](db[_0x7bca('0x3a')],{'through':_0x7bca('0x157'),'as':_0x7bca('0x1c9')});db[_0x7bca('0xdc')][_0x7bca('0x111')](db[_0x7bca('0x63')],{'through':_0x7bca('0x185'),'as':_0x7bca('0x11f')});db[_0x7bca('0xdc')]['belongsToMany'](db[_0x7bca('0x49')],{'through':_0x7bca('0x171'),'as':_0x7bca('0x121')});db[_0x7bca('0xdc')][_0x7bca('0x111')](db['SmsQueue'],{'through':_0x7bca('0x179'),'as':_0x7bca('0x1ca')});db[_0x7bca('0xdc')]['belongsToMany'](db[_0x7bca('0x59')],{'through':_0x7bca('0x17e'),'as':_0x7bca('0x123')});db[_0x7bca('0xdc')][_0x7bca('0x111')](db['WhatsappQueue'],{'through':_0x7bca('0x1cb'),'as':_0x7bca('0x124')});db[_0x7bca('0x18f')][_0x7bca('0x103')](db[_0x7bca('0x6a')],{'as':_0x7bca('0x189'),'foreignKey':'CampaignId'});db[_0x7bca('0x18f')]['hasMany'](db[_0x7bca('0x6e')],{'as':_0x7bca('0x107'),'foreignKey':_0x7bca('0x190')});db['Campaign'][_0x7bca('0x103')](db['CmHopperHistory'],{'as':_0x7bca('0x136'),'foreignKey':_0x7bca('0x190')});db[_0x7bca('0x18f')][_0x7bca('0x103')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x7bca('0x190')});db[_0x7bca('0x18f')][_0x7bca('0x13d')](db['Trunk'],{'as':'Trunk','foreignKey':_0x7bca('0x13a')});db[_0x7bca('0x18f')][_0x7bca('0x13d')](db[_0x7bca('0x139')],{'as':_0x7bca('0x13b'),'foreignKey':_0x7bca('0x13c')});db[_0x7bca('0x18f')][_0x7bca('0x13d')](db[_0x7bca('0x7c')],{'as':_0x7bca('0x7c'),'foreignKey':_0x7bca('0x13e')});db['Campaign'][_0x7bca('0x13d')](db['SquareProject'],{'as':_0x7bca('0xd7'),'foreignKey':_0x7bca('0x1cc')});db['Campaign'][_0x7bca('0x111')](db[_0x7bca('0xe9')],{'as':'Lists','through':_0x7bca('0x1cd')});db['Campaign'][_0x7bca('0x111')](db[_0x7bca('0xe9')],{'as':_0x7bca('0x143'),'through':_0x7bca('0x1ce')});db[_0x7bca('0x160')][_0x7bca('0x13d')](db['ChatOfflineMessage'],{'as':_0x7bca('0x61'),'foreignKey':'ChatOfflineMessageId'});db[_0x7bca('0xe3')]['belongsTo'](db[_0x7bca('0x153')],{});db[_0x7bca('0xe3')][_0x7bca('0x13d')](db['MailInteraction'],{});db[_0x7bca('0xe3')]['belongsTo'](db[_0x7bca('0x39')],{'foreignKey':_0x7bca('0x1cf'),'as':_0x7bca('0x1d0')});db[_0x7bca('0xe3')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'foreignKey':_0x7bca('0x1d1'),'as':_0x7bca('0x1d2')});db['MailTransferReport'][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'foreignKey':_0x7bca('0x1d3'),'as':_0x7bca('0x1d4')});db[_0x7bca('0xe3')][_0x7bca('0x13d')](db[_0x7bca('0x3a')],{'foreignKey':_0x7bca('0x1d5'),'as':_0x7bca('0x1d6')});db[_0x7bca('0xe3')][_0x7bca('0x13d')](db[_0x7bca('0x39')],{'foreignKey':'ToMailAccountId','as':_0x7bca('0x1d7')});db[_0x7bca('0xe4')][_0x7bca('0x13d')](db[_0x7bca('0x60')],{});db['ChatTransferReport']['belongsTo'](db['ChatInteraction'],{});db[_0x7bca('0xe4')][_0x7bca('0x13d')](db[_0x7bca('0x163')],{'foreignKey':_0x7bca('0x1d8'),'as':_0x7bca('0x1d0')});db[_0x7bca('0xe4')]['belongsTo'](db[_0x7bca('0x14')],{'foreignKey':_0x7bca('0x1d1'),'as':_0x7bca('0x1d2')});db[_0x7bca('0xe4')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'foreignKey':'ToUserId','as':_0x7bca('0x1d4')});db['ChatTransferReport'][_0x7bca('0x13d')](db['ChatQueue'],{'foreignKey':_0x7bca('0x1d9'),'as':_0x7bca('0x1d6')});db[_0x7bca('0xe4')][_0x7bca('0x13d')](db[_0x7bca('0x163')],{'foreignKey':_0x7bca('0x1da'),'as':_0x7bca('0x1d7')});db[_0x7bca('0x1db')][_0x7bca('0x13d')](db[_0x7bca('0x47')],{});db['FaxTransferReport'][_0x7bca('0x13d')](db[_0x7bca('0x46')],{});db[_0x7bca('0x1db')][_0x7bca('0x13d')](db[_0x7bca('0x127')],{'foreignKey':_0x7bca('0x1dc'),'as':_0x7bca('0x1d0')});db[_0x7bca('0x1db')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'foreignKey':'FromUserId','as':_0x7bca('0x1d2')});db[_0x7bca('0x1db')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'foreignKey':_0x7bca('0x1d3'),'as':_0x7bca('0x1d4')});db['FaxTransferReport'][_0x7bca('0x13d')](db[_0x7bca('0x49')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db[_0x7bca('0x1db')][_0x7bca('0x13d')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0x7bca('0x1d7')});db[_0x7bca('0x1dd')][_0x7bca('0x13d')](db[_0x7bca('0x57')],{});db[_0x7bca('0x1dd')][_0x7bca('0x13d')](db[_0x7bca('0x109')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x7bca('0x53')],{'foreignKey':_0x7bca('0x1de'),'as':'FromAccount'});db[_0x7bca('0x1dd')][_0x7bca('0x13d')](db['User'],{'foreignKey':'FromUserId','as':_0x7bca('0x1d2')});db[_0x7bca('0x1dd')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'foreignKey':_0x7bca('0x1d3'),'as':_0x7bca('0x1d4')});db[_0x7bca('0x1dd')]['belongsTo'](db[_0x7bca('0x59')],{'foreignKey':_0x7bca('0x1df'),'as':_0x7bca('0x1d6')});db['OpenchannelTransferReport']['belongsTo'](db[_0x7bca('0x53')],{'foreignKey':_0x7bca('0x1e0'),'as':_0x7bca('0x1d7')});db[_0x7bca('0xe7')][_0x7bca('0x13d')](db['SmsMessage'],{});db['SmsTransferReport']['belongsTo'](db[_0x7bca('0x4f')],{});db['SmsTransferReport'][_0x7bca('0x13d')](db[_0x7bca('0x4d')],{'foreignKey':_0x7bca('0x1e1'),'as':_0x7bca('0x1d0')});db[_0x7bca('0xe7')][_0x7bca('0x13d')](db['User'],{'foreignKey':_0x7bca('0x1d1'),'as':'FromAgent'});db[_0x7bca('0xe7')]['belongsTo'](db[_0x7bca('0x14')],{'foreignKey':'ToUserId','as':_0x7bca('0x1d4')});db[_0x7bca('0xe7')]['belongsTo'](db[_0x7bca('0x175')],{'foreignKey':_0x7bca('0x1e2'),'as':_0x7bca('0x1d6')});db[_0x7bca('0xe7')][_0x7bca('0x13d')](db[_0x7bca('0x4d')],{'foreignKey':_0x7bca('0x1e3'),'as':_0x7bca('0x1d7')});db['CmList']['hasMany'](db['Disposition'],{'as':_0x7bca('0x151'),'foreignKey':_0x7bca('0x16a')});db[_0x7bca('0xe9')][_0x7bca('0x103')](db[_0x7bca('0x73')],{'as':_0x7bca('0x1e4'),'foreignKey':'ListId'});db['CmList'][_0x7bca('0x103')](db['CmContact'],{'as':'Contacts','onDelete':_0x7bca('0x100'),'foreignKey':_0x7bca('0x16a')});db['CmList'][_0x7bca('0x103')](db[_0x7bca('0x6e')],{'as':_0x7bca('0x107'),'foreignKey':_0x7bca('0x16a')});db[_0x7bca('0xe9')][_0x7bca('0x103')](db[_0x7bca('0x70')],{'as':_0x7bca('0x1e5'),'foreignKey':_0x7bca('0x16a')});db['CmList'][_0x7bca('0x103')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x7bca('0x16a')});db[_0x7bca('0xe9')][_0x7bca('0x111')](db[_0x7bca('0x1c')],{'as':_0x7bca('0x1e6'),'through':_0x7bca('0x1e7')});db[_0x7bca('0xe9')][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x141'),'through':'cm_user_has_lists'});db[_0x7bca('0xea')][_0x7bca('0x103')](db['VoiceExtension'],{'as':_0x7bca('0x106'),'onDelete':_0x7bca('0x100')});db['VoicePrefix'][_0x7bca('0x111')](db['User'],{'as':_0x7bca('0x141'),'through':_0x7bca('0x125')});db[_0x7bca('0xec')][_0x7bca('0x103')](db[_0x7bca('0x14')],{'as':_0x7bca('0x16f'),'foreignKey':_0x7bca('0x1e8')});db[_0x7bca('0xec')][_0x7bca('0x103')](db[_0x7bca('0xed')],{'as':'UserProfileSections','foreignKey':_0x7bca('0x1e8'),'onDelete':_0x7bca('0x100')});db[_0x7bca('0xed')][_0x7bca('0x103')](db['UserProfileResource'],{'as':_0x7bca('0x1e9'),'foreignKey':_0x7bca('0x1ea'),'onDelete':_0x7bca('0x100')});db[_0x7bca('0x1eb')][_0x7bca('0x103')](db[_0x7bca('0x150')],{'as':_0x7bca('0x151'),'foreignKey':_0x7bca('0x1ec')});db['WhatsappAccount'][_0x7bca('0x103')](db[_0x7bca('0x77')],{'as':'Answers','foreignKey':_0x7bca('0x1ec')});db['WhatsappAccount'][_0x7bca('0x103')](db[_0x7bca('0xf7')],{'as':'Messages','foreignKey':_0x7bca('0x1ec')});db[_0x7bca('0x1eb')][_0x7bca('0x103')](db[_0x7bca('0xf5')],{'as':_0x7bca('0x154')});db[_0x7bca('0x1eb')][_0x7bca('0x103')](db[_0x7bca('0xf4')],{'as':_0x7bca('0x133')});db[_0x7bca('0x1eb')][_0x7bca('0x13d')](db[_0x7bca('0xe9')],{'as':'List','foreignKey':'ListId'});db[_0x7bca('0x1eb')][_0x7bca('0x13d')](db['Pause'],{'as':_0x7bca('0x13f'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount']['belongsToMany'](db[_0x7bca('0x14')],{'as':'Agents','through':_0x7bca('0x1ed')});db[_0x7bca('0xf4')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'onDelete':_0x7bca('0x166')});db[_0x7bca('0xf4')]['belongsTo'](db[_0x7bca('0xfb')],{'onDelete':_0x7bca('0x166')});db[_0x7bca('0xf4')][_0x7bca('0x13d')](db['WhatsappAccount'],{'onDelete':_0x7bca('0x166')});db[_0x7bca('0xf4')][_0x7bca('0x13d')](db[_0x7bca('0x7c')],{'onDelete':_0x7bca('0x166'),'foreignKey':_0x7bca('0x13e')});db[_0x7bca('0xf4')][_0x7bca('0x13d')](db[_0x7bca('0x15d')],{'onDelete':_0x7bca('0x166'),'foreignKey':_0x7bca('0x167')});db['WhatsappInteraction']['hasMany'](db[_0x7bca('0xf7')],{'as':_0x7bca('0x145'),'onDelete':'cascade','foreignKey':_0x7bca('0x1ee')});db['WhatsappInteraction'][_0x7bca('0x13d')](db[_0x7bca('0x1eb')],{'as':'Account','foreignKey':_0x7bca('0x1ec')});db[_0x7bca('0xf5')][_0x7bca('0x13d')](db[_0x7bca('0x114')],{'as':'Contact','foreignKey':_0x7bca('0x14c')});db[_0x7bca('0xf5')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'as':_0x7bca('0x15a'),'foreignKey':_0x7bca('0x101')});db['WhatsappInteraction'][_0x7bca('0x111')](db[_0x7bca('0x15d')],{'through':_0x7bca('0x1a4'),'as':'Tags'});db['WhatsappInteraction']['belongsToMany'](db[_0x7bca('0x15d')],{'through':_0x7bca('0x1a4'),'as':'ThroughTags'});db[_0x7bca('0xf5')][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x16f'),'through':_0x7bca('0x11d'),'foreignKey':'WhatsappInteractionId'});db[_0x7bca('0xf7')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'as':'User'});db[_0x7bca('0xf7')]['belongsTo'](db[_0x7bca('0x114')],{'onDelete':_0x7bca('0x100'),'as':_0x7bca('0x14b')});db[_0x7bca('0xf7')][_0x7bca('0x13d')](db[_0x7bca('0xf5')],{'onDelete':'cascade','as':_0x7bca('0x162'),'foreignKey':_0x7bca('0x1ee')});db['WhatsappMessage']['belongsTo'](db[_0x7bca('0x1eb')],{'as':_0x7bca('0x159'),'foreignKey':_0x7bca('0x1ec')});db[_0x7bca('0xf8')][_0x7bca('0x13d')](db[_0x7bca('0x1eb')],{});db['WhatsappQueueReport'][_0x7bca('0x13d')](db[_0x7bca('0xe9')],{'as':'List','foreignKey':_0x7bca('0x16a')});db[_0x7bca('0xf8')][_0x7bca('0x13d')](db[_0x7bca('0x114')],{'as':_0x7bca('0x14b'),'foreignKey':_0x7bca('0x14c')});db[_0x7bca('0xf8')][_0x7bca('0x13d')](db[_0x7bca('0xf5')],{});db[_0x7bca('0xf8')][_0x7bca('0x13d')](db[_0x7bca('0xfb')],{});db['WhatsappQueueReport'][_0x7bca('0x13d')](db[_0x7bca('0xf7')],{});db[_0x7bca('0xf8')][_0x7bca('0x13d')](db['User'],{});db[_0x7bca('0xfa')]['belongsTo'](db[_0x7bca('0xf7')],{});db[_0x7bca('0xfa')]['belongsTo'](db['WhatsappInteraction'],{});db[_0x7bca('0xfa')][_0x7bca('0x13d')](db['WhatsappAccount'],{'foreignKey':_0x7bca('0x1ef'),'as':'FromAccount'});db['WhatsappTransferReport'][_0x7bca('0x13d')](db[_0x7bca('0x1eb')],{'foreignKey':_0x7bca('0x1f0'),'as':_0x7bca('0x1d7')});db[_0x7bca('0xfa')][_0x7bca('0x13d')](db[_0x7bca('0xfb')],{'foreignKey':_0x7bca('0x1f1'),'as':_0x7bca('0x1d6')});db[_0x7bca('0xfa')][_0x7bca('0x13d')](db[_0x7bca('0x14')],{'foreignKey':_0x7bca('0x1d1'),'as':'FromAgent'});db[_0x7bca('0xfa')][_0x7bca('0x13d')](db['User'],{'foreignKey':_0x7bca('0x1d3'),'as':_0x7bca('0x1d4')});db[_0x7bca('0xfb')][_0x7bca('0x111')](db[_0x7bca('0x14')],{'as':_0x7bca('0x141'),'through':_0x7bca('0x35'),'foreignKey':_0x7bca('0x1f2')});db[_0x7bca('0xfb')][_0x7bca('0x111')](db['Team'],{'through':_0x7bca('0x1cb'),'as':_0x7bca('0x142')});module[_0x7bca('0x1f3')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x80b1=['MailQueue','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','ChatWebsites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Sound','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperFinals','HopperHistories','JscriptySessions','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPause','Agents','BlackLists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','CmContact','Contact','ContactId','MailAccountId','Imap','Disposition','Dispositions','CannedAnswer','Interactions','MailApplication','Applications','ListId','mandatoryDispositionPauseId','Teams','MailInteractionId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','Account','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','List','DashboardItem','FaxAccountId','Answers','Exntensions','Tag','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','Interaction','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','user_has_chat_websites','OpenchannelQueueReport','Agent','ChatQueue','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','Attachments','team_has_chat_queues','chat_group_has_users','CompanyId','Phones','cm_contact_has_tags','AdditionalPhones','CmHopperId','Campaign','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticMetric','MetricId','AccountId','Subjects','SubjectId','Descriptions','Subject','Description','FieldId','SugarcrmAccount','Configurations','SugarcrmField','DescriptionId','Field','VariableId','DeskAccount','DeskField','int_desk_configuration_has_tags','ZohoField','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','Dynamics365Configuration','ChatInternalMessage','ToId','SessionId','SmsQueueReport','ProjectId','SquareProject','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','FromAgent','ToChatQueueId','ToFaxAccountId','ToUserId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','voice_queues_has_cm_lists','userProfileId','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','WhatsappQueueReport','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','path','../config/environment','sequelize','jstz','determine','defaultsDeep','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','database','username','options','password','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatQueue/chatQueue.model','../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','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Interval','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../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','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/campaign/campaign.model','Migration','Attachment','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','hasOne','cascade','hasMany','VoiceRecording','UserId','UserVoiceQueueRt','Extensions','ReportAgentPreview','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','belongsToMany','ChatGroup','cm_user_has_contacts','Lists','cm_user_has_lists','Team','ChatInteractions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x80b1,0xd6));var _0x180b=function(_0x5eec91,_0x2c1d91){_0x5eec91=_0x5eec91-0x0;var _0x41cacf=_0x80b1[_0x5eec91];return _0x41cacf;};'use strict';var path=require(_0x180b('0x0'));var config=require(_0x180b('0x1'));var Sequelize=require(_0x180b('0x2'));var _=require('lodash');var jstz=require(_0x180b('0x3'));var timezone=jstz[_0x180b('0x4')]();config['sequelize']=_[_0x180b('0x5')](config[_0x180b('0x2')],{'database':'motion2','username':'xcall','password':_0x180b('0x6'),'options':{'host':_0x180b('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x180b('0x8')},'logging':![],'timezone':timezone[_0x180b('0x9')](),'define':{'charset':_0x180b('0xa'),'collate':_0x180b('0xb')}}});config[_0x180b('0xc')]=_['defaultsDeep'](config[_0x180b('0xc')],{'database':'motion2','username':_0x180b('0xd'),'password':_0x180b('0x6'),'options':{'host':_0x180b('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x180b('0x8')},'logging':![],'timezone':timezone[_0x180b('0x9')](),'define':{'charset':_0x180b('0xa'),'collate':_0x180b('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x180b('0x2')][_0x180b('0xe')],config['sequelize'][_0x180b('0xf')],config[_0x180b('0x2')]['password'],config[_0x180b('0x2')][_0x180b('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x180b('0xc')][_0x180b('0xe')],config[_0x180b('0xc')][_0x180b('0xf')],config[_0x180b('0xc')][_0x180b('0x11')],config[_0x180b('0xc')][_0x180b('0x10')])};db[_0x180b('0x12')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x14'));db['VoiceChanSpy']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x15'));db[_0x180b('0x16')]=db[_0x180b('0x2')]['import'](_0x180b('0x17'));db[_0x180b('0x18')]=db[_0x180b('0x2')]['import']('../api/voiceExtension/voiceExtension.model');db[_0x180b('0x19')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x1a'));db[_0x180b('0x1b')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x1c'));db['VoiceRecording']=db[_0x180b('0x2')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x180b('0x1d')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/screenRecording/screenRecording.model');db[_0x180b('0x1e')]=db[_0x180b('0x2')]['import']('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0x180b('0x2')]['import'](_0x180b('0x1f'));db[_0x180b('0x20')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x21'));db[_0x180b('0x22')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x23'));db[_0x180b('0x24')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x25'));db[_0x180b('0x26')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x27'));db[_0x180b('0x28')]=db['sequelize']['import'](_0x180b('0x29'));db[_0x180b('0x2a')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x2b'));db[_0x180b('0x2c')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x2d'));db['UserVoiceQueueRt']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x2e'));db[_0x180b('0x2f')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x30'));db[_0x180b('0x31')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x180b('0x2')]['import'](_0x180b('0x32'));db[_0x180b('0x33')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x34'));db[_0x180b('0x35')]=db['sequelize'][_0x180b('0x13')](_0x180b('0x36'));db[_0x180b('0x37')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x180b('0x38')]=db['sequelize'][_0x180b('0x13')](_0x180b('0x39'));db[_0x180b('0x3a')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0x180b('0x3b')]=db['sequelize'][_0x180b('0x13')](_0x180b('0x3c'));db[_0x180b('0x3d')]=db[_0x180b('0x2')]['import'](_0x180b('0x3e'));db['MailQueue']=db[_0x180b('0x2')][_0x180b('0x13')]('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0x180b('0x2')][_0x180b('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0x180b('0x3f')]=db['sequelize']['import'](_0x180b('0x40'));db[_0x180b('0x41')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x42'));db['MailApplication']=db['sequelize']['import'](_0x180b('0x43'));db[_0x180b('0x44')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x45'));db[_0x180b('0x46')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0x180b('0x2')][_0x180b('0x13')]('../api/dashboardItem/dashboardItem.model');db[_0x180b('0x47')]=db['sequelize'][_0x180b('0x13')](_0x180b('0x48'));db[_0x180b('0x49')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/faxApplication/faxApplication.model');db[_0x180b('0x4a')]=db['sequelize'][_0x180b('0x13')](_0x180b('0x4b'));db[_0x180b('0x4c')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x4d'));db[_0x180b('0x4e')]=db[_0x180b('0x2')]['import'](_0x180b('0x4f'));db['FaxQueueReport']=db[_0x180b('0x2')]['import'](_0x180b('0x50'));db[_0x180b('0x51')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/smsAccount/smsAccount.model');db[_0x180b('0x52')]=db['sequelize'][_0x180b('0x13')](_0x180b('0x53'));db[_0x180b('0x54')]=db['sequelize'][_0x180b('0x13')]('../api/smsInteraction/smsInteraction.model');db[_0x180b('0x55')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x56'));db[_0x180b('0x57')]=db[_0x180b('0x2')]['import'](_0x180b('0x58'));db[_0x180b('0x59')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x5a'));db['OpenchannelApplication']=db['sequelize'][_0x180b('0x13')](_0x180b('0x5b'));db[_0x180b('0x5c')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x180b('0x5d')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x5e'));db[_0x180b('0x5f')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x60'));db['OpenchannelQueueReport']=db[_0x180b('0x2')][_0x180b('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x180b('0x61')]=db['sequelize'][_0x180b('0x13')](_0x180b('0x62'));db[_0x180b('0x63')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x64'));db[_0x180b('0x65')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x66'));db[_0x180b('0x67')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db['sequelize'][_0x180b('0x13')](_0x180b('0x68'));db['ChatGroup']=db['sequelize'][_0x180b('0x13')](_0x180b('0x69'));db[_0x180b('0x6a')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x6b'));db[_0x180b('0x6c')]=db['sequelize'][_0x180b('0x13')](_0x180b('0x6d'));db['CmContact']=db['sequelize']['import'](_0x180b('0x6e'));db[_0x180b('0x6f')]=db['sequelize'][_0x180b('0x13')](_0x180b('0x70'));db[_0x180b('0x71')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x72'));db[_0x180b('0x73')]=db[_0x180b('0x2')]['import'](_0x180b('0x74'));db[_0x180b('0x75')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0x180b('0x2')][_0x180b('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x180b('0x76')]=db['sequelize'][_0x180b('0x13')](_0x180b('0x77'));db[_0x180b('0x78')]=db['sequelize']['import']('../api/action/action.model');db[_0x180b('0x79')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/automation/automation.model');db['CannedAnswer']=db['sequelize'][_0x180b('0x13')](_0x180b('0x7a'));db['Disposition']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x7b'));db['Condition']=db[_0x180b('0x2')]['import']('../api/condition/condition.model');db[_0x180b('0x7c')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x7d'));db[_0x180b('0x7e')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/pause/pause.model');db[_0x180b('0x7f')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x80'));db[_0x180b('0x81')]=db[_0x180b('0x2')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x180b('0x82')]=db['sequelize']['import'](_0x180b('0x83'));db['Sound']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x84'));db['Tag']=db['sequelize'][_0x180b('0x13')](_0x180b('0x85'));db[_0x180b('0x86')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x87'));db[_0x180b('0x88')]=db['sequelize']['import']('../api/cmContactHasItem/cmContactHasItem.model');db[_0x180b('0x89')]=db[_0x180b('0x2')]['import'](_0x180b('0x8a'));db[_0x180b('0x8b')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x8c'));db[_0x180b('0x8d')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/trigger/trigger.model');db[_0x180b('0x8e')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x8f'));db[_0x180b('0x90')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x91'));db['IntegrationReport']=db['sequelize'][_0x180b('0x13')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db[_0x180b('0x2')]['import'](_0x180b('0x92'));db[_0x180b('0x93')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x94'));db['AnalyticExtractedReport']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x95'));db['AnalyticMetric']=db[_0x180b('0x2')]['import'](_0x180b('0x96'));db[_0x180b('0x97')]=db['sequelize'][_0x180b('0x13')](_0x180b('0x98'));db['AnalyticTreeReport']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x99'));db[_0x180b('0x9a')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x9b'));db[_0x180b('0x9c')]=db[_0x180b('0x2')]['import'](_0x180b('0x9d'));db[_0x180b('0x9e')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x9f'));db[_0x180b('0xa0')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xa1'));db['SugarcrmField']=db[_0x180b('0x2')]['import'](_0x180b('0xa2'));db['DeskAccount']=db[_0x180b('0x2')]['import'](_0x180b('0xa3'));db[_0x180b('0xa4')]=db[_0x180b('0x2')]['import'](_0x180b('0xa5'));db['DeskField']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xa6'));db[_0x180b('0xa7')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xa8'));db[_0x180b('0xa9')]=db[_0x180b('0x2')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x180b('0x2')][_0x180b('0x13')]('../api/intZohoField/intZohoField.model');db[_0x180b('0xaa')]=db[_0x180b('0x2')]['import'](_0x180b('0xab'));db['ZendeskConfiguration']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xac'));db[_0x180b('0xad')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/intZendeskField/intZendeskField.model');db[_0x180b('0xae')]=db['sequelize'][_0x180b('0x13')](_0x180b('0xaf'));db[_0x180b('0xb0')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xb1'));db[_0x180b('0xb2')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xb3'));db['VtigerAccount']=db[_0x180b('0x2')][_0x180b('0x13')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x180b('0xb4')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xb5'));db['VtigerField']=db[_0x180b('0x2')]['import'](_0x180b('0xb6'));db[_0x180b('0xb7')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xb8'));db[_0x180b('0xb9')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x180b('0xba')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xbb'));db[_0x180b('0xbc')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xbd'));db['Dynamics365Configuration']=db['sequelize'][_0x180b('0x13')](_0x180b('0xbe'));db[_0x180b('0xbf')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x180b('0xc0')]=db['sequelize'][_0x180b('0x13')](_0x180b('0xc1'));db[_0x180b('0xc2')]=db[_0x180b('0x2')]['import']('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x180b('0xc3')]=db['sequelize'][_0x180b('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x180b('0x90')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0x91'));db['Network']=db['sequelize']['import'](_0x180b('0xc4'));db[_0x180b('0xc5')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xc6'));db['ChatInternalMessage']=db['sequelize'][_0x180b('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x180b('0xc7')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xc8'));db[_0x180b('0xc9')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xca'));db[_0x180b('0xcb')]=db['sequelize'][_0x180b('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xcc'));db[_0x180b('0xcd')]=db[_0x180b('0x2')]['import'](_0x180b('0xce'));db[_0x180b('0xcf')]=db[_0x180b('0x2')]['import'](_0x180b('0xd0'));db[_0x180b('0xd1')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xd2'));db[_0x180b('0xd3')]=db['sequelize'][_0x180b('0x13')](_0x180b('0xd4'));db['SquareOdbc']=db[_0x180b('0x2')]['import'](_0x180b('0xd5'));db['SquareProject']=db[_0x180b('0x2')]['import'](_0x180b('0xd6'));db['SquareRecording']=db[_0x180b('0x2')][_0x180b('0x13')]('../api/squareRecording/squareRecording.model');db[_0x180b('0xd7')]=db['sequelize']['import'](_0x180b('0xd8'));db['Team']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xd9'));db[_0x180b('0xda')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/license/license.model');db['Campaign']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xdb'));db[_0x180b('0xdc')]=db[_0x180b('0x2')]['import']('../api/migration/migration.model');db[_0x180b('0xdd')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/attachment/attachment.model');db['Plugin']=db[_0x180b('0x2')]['import'](_0x180b('0xde'));db['MailTransferReport']=db['sequelize'][_0x180b('0x13')](_0x180b('0xdf'));db[_0x180b('0xe0')]=db[_0x180b('0x2')]['import'](_0x180b('0xe1'));db[_0x180b('0xe2')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xe3'));db[_0x180b('0xe4')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xe5'));db[_0x180b('0xe6')]=db[_0x180b('0x2')]['import'](_0x180b('0xe7'));db[_0x180b('0xe8')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xe9'));db[_0x180b('0xea')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xeb'));db[_0x180b('0xec')]=db[_0x180b('0x2')]['import']('../api/userProfile/userProfile.model');db[_0x180b('0xed')]=db[_0x180b('0x2')]['import']('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xee'));db[_0x180b('0xef')]=db[_0x180b('0x2')][_0x180b('0x13')]('../api/userNotification/userNotification.model');db[_0x180b('0xf0')]=db[_0x180b('0x2')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0x180b('0xf1')]=db[_0x180b('0x2')]['import'](_0x180b('0xf2'));db[_0x180b('0xf3')]=db[_0x180b('0x2')]['import'](_0x180b('0xf4'));db[_0x180b('0xf5')]=db[_0x180b('0x2')]['import'](_0x180b('0xf6'));db['WhatsappQueueReport']=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xf7'));db['WhatsappTransferReport']=db[_0x180b('0x2')]['import'](_0x180b('0xf8'));db[_0x180b('0xf9')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xfa'));db['CloudProvider']=db[_0x180b('0x2')][_0x180b('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0x180b('0xfb')]=db[_0x180b('0x2')][_0x180b('0x13')](_0x180b('0xfc'));db[_0x180b('0x12')][_0x180b('0xfd')](db[_0x180b('0x1e')],{'as':_0x180b('0x1e'),'onDelete':_0x180b('0xfe'),'foreignKey':'UserId'});db['User'][_0x180b('0xff')](db[_0x180b('0x100')],{'as':'Recordings','foreignKey':_0x180b('0x101')});db[_0x180b('0x12')]['hasMany'](db[_0x180b('0x102')],{'as':'VoiceQueuesRt','foreignKey':_0x180b('0x101')});db[_0x180b('0x12')]['hasMany'](db['VoiceExtension'],{'as':_0x180b('0x103'),'onDelete':_0x180b('0xfe'),'hooks':!![]});db[_0x180b('0x12')][_0x180b('0xff')](db[_0x180b('0x73')],{'as':'HopperFinals','foreignKey':_0x180b('0x101')});db[_0x180b('0x12')][_0x180b('0xff')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x180b('0x101')});db[_0x180b('0x12')][_0x180b('0xff')](db['ReportAgentPreview'],{'as':_0x180b('0x104'),'foreignKey':'UserId'});db[_0x180b('0x12')][_0x180b('0xff')](db[_0x180b('0x5c')],{'as':'OpenchannelInteractions','foreignKey':_0x180b('0x101')});db['User']['hasMany'](db[_0x180b('0x63')],{'as':'ChatInteractions','foreignKey':_0x180b('0x101')});db[_0x180b('0x12')]['hasMany'](db[_0x180b('0x54')],{'as':'SmsInteractions','foreignKey':_0x180b('0x101')});db[_0x180b('0x12')][_0x180b('0xff')](db[_0x180b('0x4a')],{'as':_0x180b('0x105'),'foreignKey':_0x180b('0x101')});db[_0x180b('0x12')]['hasMany'](db[_0x180b('0x3f')],{'as':_0x180b('0x106'),'foreignKey':'UserId'});db[_0x180b('0x12')][_0x180b('0xff')](db[_0x180b('0xf3')],{'as':_0x180b('0x107'),'foreignKey':_0x180b('0x101')});db[_0x180b('0x12')][_0x180b('0xff')](db[_0x180b('0xef')],{'as':_0x180b('0x108'),'foreignKey':_0x180b('0x109')});db[_0x180b('0x12')][_0x180b('0x10a')](db['UserProfile'],{'as':_0x180b('0xec'),'foreignKey':'userProfileId'});db['User'][_0x180b('0x10b')](db[_0x180b('0x10c')],{'as':'Groups','through':'chat_group_has_users'});db[_0x180b('0x12')][_0x180b('0x10b')](db['CmContact'],{'as':'Contacts','through':_0x180b('0x10d')});db['User'][_0x180b('0x10b')](db[_0x180b('0xe8')],{'as':_0x180b('0x10e'),'through':_0x180b('0x10f')});db[_0x180b('0x12')][_0x180b('0x10b')](db[_0x180b('0x110')],{'through':'user_has_teams'});db[_0x180b('0x12')]['belongsToMany'](db['MailInteraction'],{'as':'MailInteractions','through':'user_has_mail_interactions'});db[_0x180b('0x12')]['belongsToMany'](db[_0x180b('0x63')],{'as':_0x180b('0x111'),'through':'user_has_chat_interactions'});db[_0x180b('0x12')]['belongsToMany'](db[_0x180b('0x4a')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db['User']['belongsToMany'](db['SmsInteraction'],{'as':_0x180b('0x112'),'through':_0x180b('0x113')});db[_0x180b('0x12')][_0x180b('0x10b')](db[_0x180b('0x5c')],{'as':'OpenchannelInteractions','through':_0x180b('0x114')});db['User'][_0x180b('0x10b')](db[_0x180b('0xf3')],{'as':_0x180b('0x107'),'through':_0x180b('0x115')});db[_0x180b('0x12')][_0x180b('0x10b')](db['VoiceQueue'],{'as':_0x180b('0x116'),'through':_0x180b('0x2f'),'required':![]});db[_0x180b('0x12')][_0x180b('0x10b')](db[_0x180b('0x117')],{'as':_0x180b('0x118'),'through':_0x180b('0x119'),'required':![]});db[_0x180b('0x12')][_0x180b('0x10b')](db['ChatQueue'],{'as':_0x180b('0x11a'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x180b('0x12')][_0x180b('0x10b')](db['FaxQueue'],{'as':_0x180b('0x11b'),'through':_0x180b('0x33'),'required':![]});db[_0x180b('0x12')][_0x180b('0x10b')](db[_0x180b('0x57')],{'as':_0x180b('0x11c'),'through':_0x180b('0x35'),'required':![]});db[_0x180b('0x12')][_0x180b('0x10b')](db['OpenchannelQueue'],{'as':_0x180b('0x11d'),'through':_0x180b('0x37'),'required':![]});db[_0x180b('0x12')][_0x180b('0x10b')](db[_0x180b('0xf9')],{'as':_0x180b('0x11e'),'through':_0x180b('0x38'),'required':![]});db[_0x180b('0x12')][_0x180b('0x10b')](db[_0x180b('0xe8')],{'through':'cm_user_has_lists'});db['User'][_0x180b('0x10b')](db['VoicePrefix'],{'as':_0x180b('0x11f'),'through':_0x180b('0x120'),'required':![]});db[_0x180b('0x12')]['belongsToMany'](db[_0x180b('0x121')],{'as':_0x180b('0x122'),'through':'user_has_chat_websites'});db[_0x180b('0x12')][_0x180b('0x10b')](db[_0x180b('0x47')],{'as':_0x180b('0x123'),'through':'user_has_fax_accounts'});db[_0x180b('0x12')][_0x180b('0x10b')](db[_0x180b('0x3d')],{'as':_0x180b('0x124'),'through':_0x180b('0x125')});db[_0x180b('0x12')]['belongsToMany'](db[_0x180b('0x59')],{'as':_0x180b('0x126'),'through':_0x180b('0x127')});db[_0x180b('0x12')]['belongsToMany'](db[_0x180b('0x51')],{'as':_0x180b('0x128'),'through':_0x180b('0x129')});db['User'][_0x180b('0x10b')](db[_0x180b('0xf0')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0x180b('0x12')][_0x180b('0x10b')](db['SquareProject'],{'as':_0x180b('0x12a'),'through':_0x180b('0x12b')});db[_0x180b('0x12c')]['hasMany'](db[_0x180b('0x18')],{'as':_0x180b('0x12d'),'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x12e')});db[_0x180b('0x16')][_0x180b('0xff')](db[_0x180b('0x18')],{'onDelete':_0x180b('0xfe')});db[_0x180b('0x18')]['hasMany'](db[_0x180b('0x18')],{'as':'Applications','onDelete':'cascade'});db['VoiceMusicOnHold'][_0x180b('0x10b')](db[_0x180b('0x12f')],{'as':_0x180b('0x130'),'through':_0x180b('0x131')});db[_0x180b('0x1b')]['hasMany'](db[_0x180b('0x102')],{'as':_0x180b('0x132'),'foreignKey':'VoiceQueueId'});db[_0x180b('0x1b')]['hasMany'](db[_0x180b('0x6f')],{'as':_0x180b('0x133'),'foreignKey':_0x180b('0x134')});db['VoiceQueue'][_0x180b('0xff')](db[_0x180b('0x73')],{'as':_0x180b('0x135'),'foreignKey':'VoiceQueueId'});db[_0x180b('0x1b')][_0x180b('0xff')](db[_0x180b('0x75')],{'as':_0x180b('0x136'),'foreignKey':_0x180b('0x134')});db[_0x180b('0x1b')][_0x180b('0xff')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x180b('0x134')});db['VoiceQueue']['hasMany'](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0x180b('0x1b')][_0x180b('0xff')](db['JscriptySessionReport'],{'as':_0x180b('0x137'),'foreignKey':_0x180b('0x134')});db[_0x180b('0x1b')][_0x180b('0x10a')](db['Trunk'],{'as':'Trunk','foreignKey':_0x180b('0x138')});db[_0x180b('0x1b')][_0x180b('0x10a')](db[_0x180b('0x2a')],{'as':_0x180b('0x139'),'foreignKey':'TrunkBackupId'});db[_0x180b('0x1b')][_0x180b('0x10a')](db[_0x180b('0x7c')],{'as':_0x180b('0x7c'),'foreignKey':_0x180b('0x13a')});db['VoiceQueue'][_0x180b('0x10a')](db[_0x180b('0x7e')],{'as':_0x180b('0x13b'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue']['belongsToMany'](db[_0x180b('0xe8')],{'as':_0x180b('0x10e'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x13c'),'through':'UserVoiceQueue'});db[_0x180b('0x1b')][_0x180b('0x10b')](db[_0x180b('0x110')],{'as':'Teams','through':_0x180b('0xfb')});db['VoiceQueue'][_0x180b('0x10b')](db[_0x180b('0xe8')],{'as':_0x180b('0x13d'),'through':'voice_queues_has_cm_blacklists'});db['VoiceRecording'][_0x180b('0x10a')](db['User'],{'as':'User','foreignKey':_0x180b('0x101')});db['ScreenRecording'][_0x180b('0x10a')](db['User'],{'as':_0x180b('0x12'),'foreignKey':_0x180b('0x101')});db[_0x180b('0x1e')][_0x180b('0xff')](db[_0x180b('0x13e')],{'as':_0x180b('0x13f'),'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x140'),'sourceKey':_0x180b('0x141')});db[_0x180b('0x13e')][_0x180b('0x10a')](db['VoiceMail'],{'foreignKey':_0x180b('0x140'),'targetKey':_0x180b('0x141')});db[_0x180b('0x20')][_0x180b('0xff')](db[_0x180b('0x26')],{'as':_0x180b('0x142'),'foreignKey':_0x180b('0x143'),'constraints':![]});db[_0x180b('0x20')][_0x180b('0xff')](db[_0x180b('0x24')],{'as':_0x180b('0x144'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0x180b('0x10a')](db[_0x180b('0x12')],{'as':'User','foreignKey':_0x180b('0x101')});db['VoiceCallReport'][_0x180b('0x10a')](db[_0x180b('0x145')],{'as':_0x180b('0x146'),'foreignKey':_0x180b('0x147')});db[_0x180b('0x3a')][_0x180b('0x10a')](db[_0x180b('0x3d')],{'as':_0x180b('0x3d'),'foreignKey':_0x180b('0x148')});db[_0x180b('0x3b')][_0x180b('0x10a')](db[_0x180b('0x3d')],{'as':_0x180b('0x3d'),'foreignKey':_0x180b('0x148')});db[_0x180b('0x3d')]['hasOne'](db[_0x180b('0x3a')],{'as':_0x180b('0x149'),'onDelete':_0x180b('0xfe')});db['MailAccount']['hasOne'](db[_0x180b('0x3b')],{'as':'Smtp','onDelete':_0x180b('0xfe')});db['MailAccount']['hasMany'](db[_0x180b('0x14a')],{'as':_0x180b('0x14b'),'foreignKey':'MailAccountId'});db[_0x180b('0x3d')]['hasMany'](db[_0x180b('0x14c')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x180b('0x3d')]['hasMany'](db[_0x180b('0x41')],{'as':_0x180b('0x13f'),'foreignKey':_0x180b('0x148')});db[_0x180b('0x3d')][_0x180b('0xff')](db[_0x180b('0x3f')],{'as':_0x180b('0x14d')});db['MailAccount']['hasMany'](db[_0x180b('0x14e')],{'as':_0x180b('0x14f')});db[_0x180b('0x3d')]['belongsTo'](db[_0x180b('0xe8')],{'as':'List','foreignKey':_0x180b('0x150')});db[_0x180b('0x3d')][_0x180b('0x10a')](db['Template'],{'as':'Template','foreignKey':'TemplateId'});db[_0x180b('0x3d')][_0x180b('0x10a')](db[_0x180b('0x7e')],{'as':_0x180b('0x13b'),'foreignKey':_0x180b('0x151')});db[_0x180b('0x3d')][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x13c'),'through':_0x180b('0x125')});db[_0x180b('0x117')]['belongsToMany'](db[_0x180b('0x12')],{'as':_0x180b('0x13c'),'through':_0x180b('0x119')});db['MailQueue'][_0x180b('0x10b')](db[_0x180b('0x110')],{'through':'team_has_mail_queues','as':_0x180b('0x152')});db['MailInteraction']['hasMany'](db[_0x180b('0x41')],{'as':'Messages','onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x153')});db[_0x180b('0x3f')]['belongsTo'](db[_0x180b('0x3d')],{'as':'Account','foreignKey':_0x180b('0x148')});db['MailInteraction'][_0x180b('0x10a')](db[_0x180b('0x145')],{'as':'Contact','foreignKey':_0x180b('0x147')});db[_0x180b('0x3f')][_0x180b('0x10a')](db[_0x180b('0x12')],{'as':_0x180b('0x154'),'foreignKey':_0x180b('0x101')});db[_0x180b('0x3f')]['belongsToMany'](db['Tag'],{'through':_0x180b('0x155'),'as':_0x180b('0x156')});db['MailInteraction'][_0x180b('0x10b')](db['Tag'],{'through':_0x180b('0x155'),'as':_0x180b('0x157')});db['MailInteraction'][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x158'),'through':_0x180b('0x159'),'foreignKey':'MailInteractionId'});db[_0x180b('0x41')][_0x180b('0xff')](db[_0x180b('0xdd')],{'as':'Attachments','onDelete':_0x180b('0xfe')});db['MailMessage'][_0x180b('0x10a')](db['User'],{'as':_0x180b('0x12')});db[_0x180b('0x41')][_0x180b('0x10a')](db[_0x180b('0x145')],{'onDelete':_0x180b('0xfe'),'as':'Contact'});db[_0x180b('0x41')][_0x180b('0x10a')](db[_0x180b('0x3f')],{'as':'Interaction','foreignKey':_0x180b('0x153')});db[_0x180b('0x41')][_0x180b('0x10a')](db[_0x180b('0x3d')],{'as':_0x180b('0x15a'),'foreignKey':_0x180b('0x148')});db['MailMessage'][_0x180b('0x10a')](db[_0x180b('0x121')],{'as':_0x180b('0x121'),'foreignKey':_0x180b('0x15b')});db['MailMessage'][_0x180b('0x10a')](db[_0x180b('0x67')],{'as':'ChatOfflineMessage','foreignKey':_0x180b('0x15c')});db[_0x180b('0x14e')][_0x180b('0x10a')](db[_0x180b('0x12')],{'onDelete':_0x180b('0x15d')});db[_0x180b('0x14e')]['belongsTo'](db['MailQueue'],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db['MailAccount'],{'onDelete':'restrict'});db[_0x180b('0x14e')][_0x180b('0x10a')](db[_0x180b('0x7c')],{'onDelete':_0x180b('0x15d'),'foreignKey':'IntervalId'});db[_0x180b('0x14e')]['belongsTo'](db['Tag'],{'onDelete':_0x180b('0x15d'),'foreignKey':_0x180b('0x15e')});db[_0x180b('0x44')][_0x180b('0x10a')](db[_0x180b('0x3d')],{});db[_0x180b('0x44')][_0x180b('0x10a')](db[_0x180b('0xe8')],{'as':_0x180b('0x15f'),'foreignKey':'ListId'});db[_0x180b('0x44')][_0x180b('0x10a')](db[_0x180b('0x145')],{'as':_0x180b('0x146'),'foreignKey':_0x180b('0x147')});db[_0x180b('0x44')][_0x180b('0x10a')](db[_0x180b('0x3f')],{});db[_0x180b('0x44')][_0x180b('0x10a')](db['MailMessage'],{});db[_0x180b('0x44')][_0x180b('0x10a')](db[_0x180b('0x12')],{});db[_0x180b('0x44')][_0x180b('0x10a')](db[_0x180b('0x117')],{});db[_0x180b('0x46')]['hasMany'](db[_0x180b('0x160')],{'as':'Items','onDelete':_0x180b('0xfe')});db[_0x180b('0x47')][_0x180b('0xff')](db[_0x180b('0x14a')],{'as':_0x180b('0x14b'),'foreignKey':_0x180b('0x161')});db[_0x180b('0x47')]['hasMany'](db[_0x180b('0x14c')],{'as':_0x180b('0x162'),'foreignKey':'FaxAccountId'});db[_0x180b('0x47')][_0x180b('0xff')](db[_0x180b('0x4a')],{'as':'Interactions'});db[_0x180b('0x47')][_0x180b('0xff')](db[_0x180b('0x49')],{'as':_0x180b('0x14f')});db['FaxAccount'][_0x180b('0xff')](db[_0x180b('0x18')],{'as':_0x180b('0x163'),'onDelete':_0x180b('0xfe')});db['FaxAccount'][_0x180b('0xff')](db['FaxMessage'],{'as':_0x180b('0x13f')});db[_0x180b('0x47')][_0x180b('0x10a')](db[_0x180b('0x2a')],{'as':_0x180b('0x2a')});db['FaxAccount'][_0x180b('0x10a')](db[_0x180b('0xe8')],{'as':_0x180b('0x15f'),'foreignKey':_0x180b('0x150')});db[_0x180b('0x47')]['belongsTo'](db[_0x180b('0x7e')],{'as':_0x180b('0x13b'),'foreignKey':_0x180b('0x151')});db[_0x180b('0x47')][_0x180b('0x10b')](db['User'],{'as':_0x180b('0x13c'),'through':'user_has_fax_accounts'});db[_0x180b('0x49')]['belongsTo'](db[_0x180b('0x12')],{'onDelete':_0x180b('0x15d')});db[_0x180b('0x49')][_0x180b('0x10a')](db['FaxQueue'],{'onDelete':_0x180b('0x15d')});db[_0x180b('0x49')][_0x180b('0x10a')](db[_0x180b('0x47')],{'onDelete':_0x180b('0x15d')});db[_0x180b('0x49')]['belongsTo'](db[_0x180b('0x164')],{'onDelete':_0x180b('0x15d'),'foreignKey':_0x180b('0x15e')});db[_0x180b('0x4a')][_0x180b('0xff')](db['FaxMessage'],{'as':_0x180b('0x13f'),'onDelete':'cascade','foreignKey':_0x180b('0x165')});db[_0x180b('0x4a')][_0x180b('0x10a')](db['FaxAccount'],{'as':_0x180b('0x15a'),'foreignKey':'FaxAccountId'});db[_0x180b('0x4a')][_0x180b('0x10a')](db['CmContact'],{'as':'Contact','foreignKey':_0x180b('0x147')});db[_0x180b('0x4a')][_0x180b('0x10a')](db[_0x180b('0x12')],{'as':_0x180b('0x154'),'foreignKey':_0x180b('0x101')});db[_0x180b('0x4a')][_0x180b('0x10b')](db['Tag'],{'through':_0x180b('0x166'),'as':_0x180b('0x156')});db[_0x180b('0x4a')][_0x180b('0x10b')](db[_0x180b('0x164')],{'through':'fax_interaction_has_tags','as':_0x180b('0x157')});db['FaxInteraction'][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':'Users','through':_0x180b('0x167'),'foreignKey':'FaxInteractionId'});db[_0x180b('0x4c')][_0x180b('0x10a')](db[_0x180b('0x12')],{'onDelete':_0x180b('0xfe'),'as':_0x180b('0x12')});db[_0x180b('0x4c')]['belongsTo'](db[_0x180b('0x4a')],{'as':'Interaction','foreignKey':_0x180b('0x165')});db[_0x180b('0x4c')][_0x180b('0x10a')](db[_0x180b('0x145')],{'onDelete':'cascade','as':'Contact'});db[_0x180b('0x4c')]['belongsTo'](db[_0x180b('0xdd')],{'as':_0x180b('0xdd'),'foreignKey':_0x180b('0x168')});db[_0x180b('0x4c')]['belongsTo'](db[_0x180b('0x47')],{'as':_0x180b('0x15a'),'foreignKey':_0x180b('0x161')});db[_0x180b('0x4e')]['belongsToMany'](db[_0x180b('0x12')],{'as':_0x180b('0x13c'),'through':'UserFaxQueue'});db['FaxQueue'][_0x180b('0x10b')](db[_0x180b('0x110')],{'through':_0x180b('0x169'),'as':_0x180b('0x152')});db[_0x180b('0x16a')][_0x180b('0x10a')](db[_0x180b('0x47')],{});db[_0x180b('0x16a')][_0x180b('0x10a')](db[_0x180b('0xe8')],{'as':_0x180b('0x15f'),'foreignKey':'ListId'});db[_0x180b('0x16a')]['belongsTo'](db[_0x180b('0x145')],{'as':'Contact','foreignKey':_0x180b('0x147')});db[_0x180b('0x16a')]['belongsTo'](db[_0x180b('0x4a')],{});db[_0x180b('0x16a')]['belongsTo'](db['FaxMessage'],{});db[_0x180b('0x16a')][_0x180b('0x10a')](db['User'],{});db['FaxQueueReport'][_0x180b('0x10a')](db[_0x180b('0x4e')],{});db[_0x180b('0x51')][_0x180b('0xff')](db[_0x180b('0x14a')],{'as':_0x180b('0x14b'),'foreignKey':_0x180b('0x16b')});db['SmsAccount'][_0x180b('0xff')](db[_0x180b('0x14c')],{'as':_0x180b('0x162'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0x180b('0xff')](db[_0x180b('0x55')],{'as':_0x180b('0x13f'),'foreignKey':_0x180b('0x16b')});db[_0x180b('0x51')][_0x180b('0xff')](db[_0x180b('0x54')],{'as':_0x180b('0x14d')});db[_0x180b('0x51')][_0x180b('0xff')](db[_0x180b('0x52')],{'as':_0x180b('0x14f')});db[_0x180b('0x51')][_0x180b('0x10a')](db[_0x180b('0xe8')],{'as':_0x180b('0x15f'),'foreignKey':_0x180b('0x150')});db['SmsAccount'][_0x180b('0x10a')](db[_0x180b('0x7e')],{'as':_0x180b('0x13b'),'foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount'][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x13c'),'through':_0x180b('0x129')});db[_0x180b('0x52')][_0x180b('0x10a')](db[_0x180b('0x12')],{'onDelete':_0x180b('0x15d')});db[_0x180b('0x52')][_0x180b('0x10a')](db[_0x180b('0x57')],{'onDelete':_0x180b('0x15d')});db[_0x180b('0x52')][_0x180b('0x10a')](db[_0x180b('0x51')],{'onDelete':_0x180b('0x15d')});db['SmsApplication'][_0x180b('0x10a')](db['Interval'],{'onDelete':_0x180b('0x15d'),'foreignKey':_0x180b('0x13a')});db[_0x180b('0x52')][_0x180b('0x10a')](db[_0x180b('0x164')],{'onDelete':_0x180b('0x15d'),'foreignKey':_0x180b('0x15e')});db[_0x180b('0x54')][_0x180b('0xff')](db[_0x180b('0x55')],{'as':'Messages','onDelete':_0x180b('0xfe'),'foreignKey':'SmsInteractionId'});db[_0x180b('0x54')][_0x180b('0x10a')](db['SmsAccount'],{'as':'Account','foreignKey':_0x180b('0x16b')});db['SmsInteraction'][_0x180b('0x10a')](db[_0x180b('0x145')],{'as':_0x180b('0x146'),'foreignKey':_0x180b('0x147')});db[_0x180b('0x54')]['belongsTo'](db[_0x180b('0x12')],{'as':_0x180b('0x154'),'foreignKey':'UserId'});db[_0x180b('0x54')]['belongsToMany'](db[_0x180b('0x164')],{'through':_0x180b('0x16c'),'as':_0x180b('0x156')});db['SmsInteraction'][_0x180b('0x10b')](db[_0x180b('0x164')],{'through':'sms_interaction_has_tags','as':_0x180b('0x157')});db['SmsInteraction'][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x158'),'through':_0x180b('0x113'),'foreignKey':_0x180b('0x16d')});db[_0x180b('0x55')][_0x180b('0x10a')](db[_0x180b('0x12')],{'as':'User'});db[_0x180b('0x55')]['belongsTo'](db[_0x180b('0x145')],{'onDelete':_0x180b('0xfe'),'as':_0x180b('0x146')});db['SmsMessage'][_0x180b('0x10a')](db[_0x180b('0x54')],{'onDelete':_0x180b('0xfe'),'as':_0x180b('0x16e'),'foreignKey':_0x180b('0x16d')});db[_0x180b('0x55')][_0x180b('0x10a')](db[_0x180b('0x51')],{'as':_0x180b('0x15a'),'foreignKey':'SmsAccountId'});db[_0x180b('0x57')]['belongsToMany'](db[_0x180b('0x12')],{'as':'Agents','through':_0x180b('0x35'),'foreignKey':_0x180b('0x16f')});db[_0x180b('0x57')][_0x180b('0x10b')](db['Team'],{'through':_0x180b('0x170'),'as':_0x180b('0x152')});db[_0x180b('0x59')][_0x180b('0xff')](db[_0x180b('0x14a')],{'as':_0x180b('0x14b'),'foreignKey':_0x180b('0x171')});db[_0x180b('0x59')][_0x180b('0xff')](db[_0x180b('0x14c')],{'as':_0x180b('0x162'),'foreignKey':_0x180b('0x171')});db[_0x180b('0x59')]['hasMany'](db[_0x180b('0x5c')],{'as':_0x180b('0x14d'),'foreignKey':_0x180b('0x171')});db['OpenchannelAccount'][_0x180b('0xff')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0x180b('0x59')][_0x180b('0xff')](db['OpenchannelApplication'],{'as':_0x180b('0x14f'),'foreignKey':'OpenchannelAccountId'});db[_0x180b('0x59')][_0x180b('0x10a')](db[_0x180b('0xe8')],{'as':_0x180b('0x15f'),'foreignKey':_0x180b('0x150')});db[_0x180b('0x59')][_0x180b('0x10a')](db[_0x180b('0x7e')],{'as':_0x180b('0x13b'),'foreignKey':_0x180b('0x151')});db[_0x180b('0x59')][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':'Agents','through':_0x180b('0x127')});db[_0x180b('0x172')][_0x180b('0x10a')](db[_0x180b('0x12')],{'onDelete':_0x180b('0x15d')});db['OpenchannelApplication'][_0x180b('0x10a')](db[_0x180b('0x5f')],{'onDelete':_0x180b('0x15d'),'foreignKey':_0x180b('0x173')});db[_0x180b('0x172')]['belongsTo'](db[_0x180b('0x59')],{'onDelete':_0x180b('0x15d'),'foreignKey':_0x180b('0x171')});db[_0x180b('0x172')][_0x180b('0x10a')](db[_0x180b('0x7c')],{'onDelete':'restrict','foreignKey':_0x180b('0x13a')});db['OpenchannelApplication']['belongsTo'](db[_0x180b('0x164')],{'onDelete':'restrict','foreignKey':_0x180b('0x15e')});db[_0x180b('0x5c')][_0x180b('0xff')](db[_0x180b('0x5d')],{'as':_0x180b('0x13f'),'onDelete':'cascade','foreignKey':_0x180b('0x174')});db[_0x180b('0x5c')][_0x180b('0x10a')](db['OpenchannelAccount'],{'as':_0x180b('0x15a'),'foreignKey':_0x180b('0x171')});db[_0x180b('0x5c')][_0x180b('0x10a')](db['CmContact'],{'as':'Contact','foreignKey':_0x180b('0x147')});db[_0x180b('0x5c')][_0x180b('0x10a')](db[_0x180b('0x12')],{'as':'Owner','foreignKey':'UserId'});db['OpenchannelInteraction'][_0x180b('0x10b')](db[_0x180b('0x164')],{'through':'openchannel_interaction_has_tags','as':_0x180b('0x156')});db['OpenchannelInteraction'][_0x180b('0x10b')](db[_0x180b('0x164')],{'through':_0x180b('0x175'),'as':_0x180b('0x157')});db['OpenchannelInteraction'][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x158'),'through':_0x180b('0x114'),'foreignKey':'OpenchannelInteractionId'});db[_0x180b('0x5d')][_0x180b('0x10a')](db['User'],{'onDelete':'cascade','as':_0x180b('0x12')});db[_0x180b('0x5d')]['belongsTo'](db['CmContact'],{'onDelete':_0x180b('0xfe'),'as':_0x180b('0x146')});db[_0x180b('0x5d')][_0x180b('0x10a')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x180b('0x16e'),'foreignKey':_0x180b('0x174')});db['OpenchannelMessage'][_0x180b('0x10a')](db[_0x180b('0xdd')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x180b('0x5d')]['belongsTo'](db[_0x180b('0x59')],{'as':_0x180b('0x15a'),'foreignKey':_0x180b('0x171')});db[_0x180b('0x5f')][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x13c'),'through':_0x180b('0x37'),'foreignKey':_0x180b('0x173')});db['OpenchannelQueue']['belongsToMany'](db[_0x180b('0x110')],{'through':_0x180b('0x176'),'as':_0x180b('0x152')});db[_0x180b('0x121')][_0x180b('0xff')](db[_0x180b('0x14a')],{'as':_0x180b('0x14b'),'foreignKey':_0x180b('0x15b')});db[_0x180b('0x121')][_0x180b('0xff')](db[_0x180b('0x14c')],{'as':_0x180b('0x162'),'foreignKey':'ChatWebsiteId'});db[_0x180b('0x121')]['hasMany'](db[_0x180b('0x6a')],{'as':_0x180b('0x177')});db['ChatWebsite']['hasMany'](db[_0x180b('0x63')],{'as':'Interactions'});db['ChatWebsite'][_0x180b('0xff')](db[_0x180b('0x61')],{'as':_0x180b('0x14f')});db[_0x180b('0x121')][_0x180b('0xff')](db[_0x180b('0x65')],{'as':_0x180b('0x13f')});db['ChatWebsite']['belongsTo'](db[_0x180b('0xe8')],{'as':_0x180b('0x15f'),'foreignKey':'ListId'});db[_0x180b('0x121')][_0x180b('0x10a')](db[_0x180b('0x7c')],{'as':_0x180b('0x7c'),'foreignKey':'IntervalId'});db[_0x180b('0x121')][_0x180b('0x10a')](db[_0x180b('0x3d')],{'as':_0x180b('0x3d'),'foreignKey':_0x180b('0x148')});db['ChatWebsite'][_0x180b('0x10a')](db['Pause'],{'as':_0x180b('0x13b'),'foreignKey':_0x180b('0x151')});db[_0x180b('0x121')][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x13c'),'through':_0x180b('0x178')});db['OpenchannelQueueReport'][_0x180b('0x10a')](db[_0x180b('0x59')],{});db['OpenchannelQueueReport'][_0x180b('0x10a')](db['CmList'],{'as':_0x180b('0x15f'),'foreignKey':_0x180b('0x150')});db[_0x180b('0x179')][_0x180b('0x10a')](db[_0x180b('0x145')],{'as':_0x180b('0x146'),'foreignKey':_0x180b('0x147')});db[_0x180b('0x179')]['belongsTo'](db[_0x180b('0x5c')],{});db[_0x180b('0x179')]['belongsTo'](db[_0x180b('0x5d')],{});db[_0x180b('0x179')][_0x180b('0x10a')](db[_0x180b('0x12')],{});db[_0x180b('0x179')][_0x180b('0x10a')](db[_0x180b('0x5f')],{});db[_0x180b('0x61')][_0x180b('0x10a')](db[_0x180b('0x12')],{'as':_0x180b('0x17a'),'foreignKey':_0x180b('0x101'),'onDelete':_0x180b('0x15d')});db['ChatApplication'][_0x180b('0x10a')](db[_0x180b('0x17b')],{'as':_0x180b('0x17c'),'foreignKey':_0x180b('0x17d'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0x180b('0x121')],{'as':_0x180b('0x17e'),'foreignKey':_0x180b('0x15b'),'onDelete':_0x180b('0x15d')});db[_0x180b('0x61')][_0x180b('0x10a')](db[_0x180b('0x164')],{'onDelete':_0x180b('0x15d'),'foreignKey':_0x180b('0x15e')});db[_0x180b('0x63')]['hasMany'](db[_0x180b('0x65')],{'as':_0x180b('0x13f'),'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x17f')});db[_0x180b('0x63')][_0x180b('0x10a')](db['ChatWebsite'],{'as':_0x180b('0x15a'),'foreignKey':_0x180b('0x15b')});db[_0x180b('0x63')]['belongsTo'](db[_0x180b('0x145')],{'as':_0x180b('0x146'),'foreignKey':_0x180b('0x147')});db[_0x180b('0x63')]['belongsTo'](db[_0x180b('0x12')],{'as':_0x180b('0x154'),'foreignKey':'UserId'});db[_0x180b('0x63')][_0x180b('0x10b')](db[_0x180b('0x164')],{'through':_0x180b('0x180'),'as':'Tags'});db[_0x180b('0x63')][_0x180b('0x10b')](db[_0x180b('0x164')],{'through':_0x180b('0x180'),'as':_0x180b('0x157')});db['ChatInteraction'][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x158'),'through':_0x180b('0x181'),'foreignKey':'ChatInteractionId'});db[_0x180b('0x65')]['belongsTo'](db['User'],{'onDelete':'cascade','as':_0x180b('0x12')});db['ChatMessage'][_0x180b('0x10a')](db['CmContact'],{'onDelete':_0x180b('0xfe'),'as':'Contact','foreignKey':'ContactId'});db[_0x180b('0x65')]['belongsTo'](db[_0x180b('0x63')],{'onDelete':_0x180b('0xfe'),'as':_0x180b('0x16e'),'foreignKey':_0x180b('0x17f')});db[_0x180b('0x65')]['belongsTo'](db[_0x180b('0xdd')],{'as':_0x180b('0xdd'),'foreignKey':_0x180b('0x168')});db[_0x180b('0x65')]['belongsTo'](db[_0x180b('0x121')],{'as':_0x180b('0x15a'),'foreignKey':_0x180b('0x15b')});db['ChatOfflineMessage'][_0x180b('0xff')](db[_0x180b('0xdd')],{'as':_0x180b('0x182'),'foreignKey':_0x180b('0x15c'),'onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage'][_0x180b('0x10a')](db['CmContact'],{'onDelete':_0x180b('0xfe'),'as':_0x180b('0x146'),'foreignKey':'ContactId'});db[_0x180b('0x67')]['belongsTo'](db['ChatWebsite'],{'as':_0x180b('0x15a'),'foreignKey':'ChatWebsiteId'});db[_0x180b('0x17b')][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x13c'),'through':_0x180b('0x31'),'hooks':!![]});db[_0x180b('0x17b')][_0x180b('0x10b')](db[_0x180b('0x110')],{'through':_0x180b('0x183'),'as':_0x180b('0x152')});db['ChatGroup'][_0x180b('0xff')](db['ChatInternalMessage'],{'as':_0x180b('0x13f'),'foreignKey':'ChatGroupId','onDelete':_0x180b('0xfe')});db['ChatGroup'][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x132'),'through':_0x180b('0x184')});db[_0x180b('0x6a')][_0x180b('0x10a')](db[_0x180b('0x121')],{'as':_0x180b('0x17e'),'foreignKey':_0x180b('0x15b')});db[_0x180b('0x6c')][_0x180b('0xff')](db['CmContact'],{'as':'Contacts','foreignKey':_0x180b('0x185')});db[_0x180b('0x145')][_0x180b('0xff')](db[_0x180b('0x88')],{'as':_0x180b('0x186'),'foreignKey':'CmContactId'});db['CmContact']['hasMany'](db['CmHopper'],{'as':_0x180b('0x133'),'foreignKey':_0x180b('0x147')});db['CmContact']['hasMany'](db[_0x180b('0x73')],{'as':_0x180b('0x135'),'foreignKey':_0x180b('0x147')});db[_0x180b('0x145')]['hasMany'](db['CmHopperHistory'],{'as':_0x180b('0x136'),'foreignKey':_0x180b('0x147')});db[_0x180b('0x145')][_0x180b('0xff')](db[_0x180b('0x104')],{'as':_0x180b('0x104'),'foreignKey':_0x180b('0x147')});db['CmContact']['hasMany'](db[_0x180b('0xcb')],{'as':'JscriptySessions','foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0x180b('0x5c')],{'as':'OpenchannelInteractions','foreignKey':_0x180b('0x147'),'onDelete':'restrict'});db[_0x180b('0x145')][_0x180b('0xff')](db[_0x180b('0x63')],{'as':_0x180b('0x111'),'foreignKey':'ContactId','onDelete':_0x180b('0x15d')});db[_0x180b('0x145')][_0x180b('0xff')](db['SmsInteraction'],{'as':_0x180b('0x112'),'foreignKey':_0x180b('0x147'),'onDelete':'restrict'});db[_0x180b('0x145')][_0x180b('0xff')](db[_0x180b('0x4a')],{'as':'FaxInteractions','foreignKey':_0x180b('0x147'),'onDelete':'restrict'});db[_0x180b('0x145')][_0x180b('0xff')](db[_0x180b('0x3f')],{'as':'MailInteractions','foreignKey':_0x180b('0x147'),'onDelete':_0x180b('0x15d')});db['CmContact'][_0x180b('0x10a')](db[_0x180b('0x6c')],{'as':'Company','foreignKey':_0x180b('0x185')});db[_0x180b('0x145')]['belongsTo'](db[_0x180b('0xe8')],{'as':'List','foreignKey':_0x180b('0x150'),'onDelete':'cascade'});db[_0x180b('0x145')][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':'Users','through':_0x180b('0x10d')});db[_0x180b('0x145')][_0x180b('0x10b')](db[_0x180b('0x164')],{'as':'Tags','through':_0x180b('0x187')});db[_0x180b('0x145')][_0x180b('0x10b')](db[_0x180b('0x164')],{'through':_0x180b('0x187'),'as':_0x180b('0x157')});db['CmHopper']['hasMany'](db[_0x180b('0x89')],{'as':_0x180b('0x188'),'foreignKey':_0x180b('0x189')});db['CmHopper']['belongsTo'](db[_0x180b('0x145')],{'as':'Contact','foreignKey':_0x180b('0x147'),'onDelete':_0x180b('0xfe')});db[_0x180b('0x6f')][_0x180b('0x10a')](db['CmList'],{'as':_0x180b('0x15f'),'foreignKey':_0x180b('0x150'),'onDelete':_0x180b('0xfe')});db[_0x180b('0x6f')][_0x180b('0x10a')](db[_0x180b('0x12')],{'as':_0x180b('0x17a'),'foreignKey':_0x180b('0x101')});db[_0x180b('0x6f')][_0x180b('0x10a')](db[_0x180b('0x1b')],{'as':_0x180b('0x17c'),'foreignKey':_0x180b('0x134'),'onDelete':_0x180b('0xfe')});db[_0x180b('0x6f')][_0x180b('0x10a')](db[_0x180b('0x18a')],{'as':_0x180b('0x18a'),'foreignKey':_0x180b('0x18b'),'onDelete':_0x180b('0xfe')});db[_0x180b('0x6f')][_0x180b('0x10a')](db[_0x180b('0x12')],{'as':_0x180b('0x154'),'foreignKey':_0x180b('0x18c')});db[_0x180b('0x71')][_0x180b('0x10a')](db[_0x180b('0x145')],{'as':_0x180b('0x146'),'foreignKey':'ContactId','onDelete':_0x180b('0xfe')});db[_0x180b('0x71')][_0x180b('0x10a')](db[_0x180b('0xe8')],{'as':_0x180b('0x15f'),'foreignKey':_0x180b('0x150'),'onDelete':_0x180b('0xfe')});db['CmHopperBlack'][_0x180b('0x10a')](db[_0x180b('0x1b')],{'as':_0x180b('0x17c'),'foreignKey':_0x180b('0x134'),'onDelete':_0x180b('0xfe')});db['CmHopperBlack']['belongsTo'](db[_0x180b('0x18a')],{'as':_0x180b('0x18a'),'foreignKey':_0x180b('0x18b'),'onDelete':_0x180b('0xfe')});db[_0x180b('0x79')][_0x180b('0xff')](db[_0x180b('0x18d')],{'as':{'plural':_0x180b('0x18e'),'singular':_0x180b('0x18f')},'foreignKey':_0x180b('0x190'),'onDelete':_0x180b('0xfe'),'hooks':!![]});db[_0x180b('0x79')]['hasMany'](db[_0x180b('0x18d')],{'as':{'plural':_0x180b('0x191'),'singular':_0x180b('0x192')},'foreignKey':_0x180b('0x193'),'onDelete':_0x180b('0xfe'),'hooks':!![]});db[_0x180b('0x79')][_0x180b('0xff')](db[_0x180b('0x78')],{'as':'Actions','foreignKey':_0x180b('0x194'),'onDelete':'cascade','hooks':!![]});db['Disposition']['hasMany'](db[_0x180b('0x14a')],{'as':_0x180b('0x14b'),'foreignKey':'ParentId','onDelete':_0x180b('0xfe')});db[_0x180b('0x7c')][_0x180b('0xff')](db[_0x180b('0x7c')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0x180b('0xfe'),'hooks':!![],'required':![]});db['Interval'][_0x180b('0xff')](db[_0x180b('0x18')],{'as':_0x180b('0x103'),'foreignKey':_0x180b('0x13a'),'onDelete':_0x180b('0x15d')});db[_0x180b('0x7c')][_0x180b('0xff')](db[_0x180b('0x14e')],{'as':_0x180b('0x195'),'foreignKey':_0x180b('0x13a')});db[_0x180b('0x7c')][_0x180b('0xff')](db[_0x180b('0x61')],{'as':_0x180b('0x196'),'foreignKey':_0x180b('0x13a')});db[_0x180b('0x7c')][_0x180b('0xff')](db['FaxApplication'],{'as':_0x180b('0x197'),'foreignKey':_0x180b('0x13a')});db[_0x180b('0x7c')]['hasMany'](db[_0x180b('0x52')],{'as':_0x180b('0x198'),'foreignKey':'IntervalId'});db[_0x180b('0x82')][_0x180b('0x10a')](db[_0x180b('0x3d')],{});db[_0x180b('0x82')]['belongsTo'](db[_0x180b('0x93')],{'foreignKey':_0x180b('0x199')});db[_0x180b('0x82')][_0x180b('0x10a')](db[_0x180b('0x19a')],{'foreignKey':_0x180b('0x19b')});db['Sound'][_0x180b('0x10b')](db['VoiceMusicOnHold'],{'as':_0x180b('0x19c'),'through':_0x180b('0x131'),'onDelete':_0x180b('0x15d')});db[_0x180b('0x164')]['belongsToMany'](db[_0x180b('0x145')],{'through':'cm_contact_has_tags'});db['Tag'][_0x180b('0x10b')](db[_0x180b('0x63')],{'through':_0x180b('0x180')});db[_0x180b('0x164')][_0x180b('0x10b')](db[_0x180b('0x3f')],{'through':'mail_interaction_has_tags'});db[_0x180b('0x164')]['belongsToMany'](db['SmsInteraction'],{'through':_0x180b('0x16c')});db[_0x180b('0x164')][_0x180b('0x10b')](db[_0x180b('0x4a')],{'through':_0x180b('0x166')});db[_0x180b('0x164')][_0x180b('0x10b')](db[_0x180b('0x5c')],{'through':'openchannel_interaction_has_tags'});db['Tag'][_0x180b('0x10b')](db[_0x180b('0xf3')],{'through':_0x180b('0x19d')});db[_0x180b('0x88')][_0x180b('0x10a')](db[_0x180b('0x86')],{'as':'ItemType','foreignKey':_0x180b('0x19e')});db[_0x180b('0x89')][_0x180b('0x10a')](db[_0x180b('0x6f')],{'as':_0x180b('0x19f'),'foreignKey':_0x180b('0x189')});db[_0x180b('0x8d')][_0x180b('0xff')](db['Condition'],{'as':{'plural':_0x180b('0x1a0'),'singular':_0x180b('0x1a1')},'foreignKey':_0x180b('0x1a2'),'onDelete':_0x180b('0xfe'),'hooks':!![]});db[_0x180b('0x8d')][_0x180b('0xff')](db[_0x180b('0x18d')],{'as':{'plural':_0x180b('0x1a3'),'singular':_0x180b('0x1a4')},'foreignKey':_0x180b('0x1a5'),'onDelete':_0x180b('0xfe'),'hooks':!![]});db[_0x180b('0x8d')][_0x180b('0xff')](db['Action'],{'as':'Actions','foreignKey':_0x180b('0x1a6'),'onDelete':_0x180b('0xfe'),'hooks':!![]});db[_0x180b('0x19a')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x180b('0x1a7'),'onDelete':'cascade','foreignKey':_0x180b('0x19b'),'hooks':!![]});db[_0x180b('0x93')][_0x180b('0xff')](db[_0x180b('0x97')],{'as':_0x180b('0x1a7'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x180b('0x1a8')][_0x180b('0xff')](db[_0x180b('0x97')],{'as':_0x180b('0x1a7'),'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1a9')});db['AnalyticFieldReport']['belongsTo'](db[_0x180b('0x1a8')],{'foreignKey':_0x180b('0x1a9')});db[_0x180b('0x9a')][_0x180b('0xff')](db[_0x180b('0x9c')],{'as':'Configurations','onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1aa')});db[_0x180b('0x9c')][_0x180b('0xff')](db[_0x180b('0x9e')],{'as':_0x180b('0x1ab'),'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1ac')});db[_0x180b('0x9c')][_0x180b('0xff')](db[_0x180b('0x9e')],{'as':_0x180b('0x1ad'),'onDelete':_0x180b('0xfe'),'foreignKey':'DescriptionId'});db[_0x180b('0x9c')]['hasMany'](db['SalesforceField'],{'as':_0x180b('0x1a7'),'onDelete':_0x180b('0xfe'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x180b('0x10a')](db[_0x180b('0x9a')],{'as':'Account','foreignKey':_0x180b('0x1aa')});db[_0x180b('0x9e')][_0x180b('0xff')](db[_0x180b('0x9e')],{'as':_0x180b('0x1ae'),'foreignKey':_0x180b('0x1ac')});db['SalesforceField'][_0x180b('0xff')](db[_0x180b('0x9e')],{'as':_0x180b('0x1af'),'foreignKey':'DescriptionId'});db[_0x180b('0x9e')][_0x180b('0xff')](db[_0x180b('0x9e')],{'as':'Field','foreignKey':_0x180b('0x1b0')});db[_0x180b('0x9e')]['belongsTo'](db[_0x180b('0x8e')],{'as':_0x180b('0x8e'),'foreignKey':'VariableId'});db[_0x180b('0x1b1')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0x180b('0x1b2'),'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1aa')});db[_0x180b('0xa0')]['hasMany'](db['SugarcrmField'],{'as':'Subjects','onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1ac')});db[_0x180b('0xa0')][_0x180b('0xff')](db[_0x180b('0x1b3')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x180b('0x1b4')});db[_0x180b('0xa0')]['hasMany'](db[_0x180b('0x1b3')],{'as':_0x180b('0x1a7'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x180b('0xa0')][_0x180b('0x10a')](db[_0x180b('0x1b1')],{'as':_0x180b('0x15a'),'foreignKey':_0x180b('0x1aa')});db['SugarcrmField']['hasMany'](db[_0x180b('0x1b3')],{'as':'Subject','foreignKey':'SubjectId'});db['SugarcrmField'][_0x180b('0xff')](db[_0x180b('0x1b3')],{'as':'Description','foreignKey':_0x180b('0x1b4')});db['SugarcrmField'][_0x180b('0xff')](db[_0x180b('0x1b3')],{'as':_0x180b('0x1b5'),'foreignKey':_0x180b('0x1b0')});db[_0x180b('0x1b3')][_0x180b('0x10a')](db[_0x180b('0x8e')],{'as':_0x180b('0x8e'),'foreignKey':_0x180b('0x1b6')});db[_0x180b('0x1b7')][_0x180b('0xff')](db[_0x180b('0xa4')],{'as':_0x180b('0x1b2'),'onDelete':_0x180b('0xfe'),'foreignKey':'AccountId'});db['DeskConfiguration']['hasMany'](db[_0x180b('0x1b8')],{'as':_0x180b('0x1ab'),'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1ac')});db[_0x180b('0xa4')][_0x180b('0xff')](db[_0x180b('0x1b8')],{'as':'Descriptions','onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1b4')});db['DeskConfiguration'][_0x180b('0xff')](db[_0x180b('0x1b8')],{'as':_0x180b('0x1a7'),'onDelete':_0x180b('0xfe'),'foreignKey':'FieldId'});db[_0x180b('0xa4')]['belongsTo'](db[_0x180b('0x1b7')],{'as':_0x180b('0x15a'),'foreignKey':_0x180b('0x1aa')});db[_0x180b('0xa4')][_0x180b('0x10b')](db[_0x180b('0x164')],{'through':_0x180b('0x1b9')});db['DeskField'][_0x180b('0xff')](db[_0x180b('0x1b8')],{'as':_0x180b('0x1ae'),'foreignKey':'SubjectId'});db['DeskField']['hasMany'](db[_0x180b('0x1b8')],{'as':'Description','foreignKey':_0x180b('0x1b4')});db[_0x180b('0x1b8')][_0x180b('0xff')](db[_0x180b('0x1b8')],{'as':_0x180b('0x1b5'),'foreignKey':_0x180b('0x1b0')});db['DeskField'][_0x180b('0x10a')](db[_0x180b('0x8e')],{'as':_0x180b('0x8e'),'foreignKey':_0x180b('0x1b6')});db[_0x180b('0xa7')]['hasMany'](db[_0x180b('0xa9')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x180b('0x1aa')});db['ZohoConfiguration'][_0x180b('0xff')](db['ZohoField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x180b('0xa9')][_0x180b('0xff')](db[_0x180b('0x1ba')],{'as':'Descriptions','onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1b4')});db[_0x180b('0xa9')]['hasMany'](db[_0x180b('0x1ba')],{'as':'Fields','onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1b0')});db[_0x180b('0xa9')][_0x180b('0x10a')](db[_0x180b('0xa7')],{'as':'Account','foreignKey':_0x180b('0x1aa')});db[_0x180b('0x1ba')][_0x180b('0xff')](db[_0x180b('0x1ba')],{'as':_0x180b('0x1ae'),'foreignKey':'SubjectId'});db[_0x180b('0x1ba')][_0x180b('0xff')](db[_0x180b('0x1ba')],{'as':_0x180b('0x1af'),'foreignKey':_0x180b('0x1b4')});db[_0x180b('0x1ba')]['hasMany'](db['ZohoField'],{'as':_0x180b('0x1b5'),'foreignKey':_0x180b('0x1b0')});db[_0x180b('0x1ba')][_0x180b('0x10a')](db[_0x180b('0x8e')],{'as':_0x180b('0x8e'),'foreignKey':_0x180b('0x1b6')});db['ZendeskAccount'][_0x180b('0xff')](db[_0x180b('0x1bb')],{'as':_0x180b('0x1b2'),'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1aa')});db[_0x180b('0x1bb')][_0x180b('0xff')](db[_0x180b('0xad')],{'as':_0x180b('0x1ab'),'foreignKey':_0x180b('0x1ac')});db[_0x180b('0x1bb')][_0x180b('0xff')](db[_0x180b('0xad')],{'as':_0x180b('0x1ad'),'foreignKey':_0x180b('0x1b4')});db[_0x180b('0x1bb')][_0x180b('0xff')](db[_0x180b('0xad')],{'as':_0x180b('0x1a7'),'foreignKey':_0x180b('0x1b0')});db['ZendeskConfiguration'][_0x180b('0x10a')](db['ZendeskAccount'],{'as':_0x180b('0x15a'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x180b('0x10b')](db['Tag'],{'through':_0x180b('0x1bc')});db[_0x180b('0xad')][_0x180b('0xff')](db[_0x180b('0xad')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x180b('0xad')][_0x180b('0xff')](db['ZendeskField'],{'as':_0x180b('0x1af'),'foreignKey':'DescriptionId'});db[_0x180b('0xad')][_0x180b('0xff')](db[_0x180b('0xad')],{'as':_0x180b('0x1b5'),'foreignKey':'FieldId'});db[_0x180b('0xad')][_0x180b('0x10a')](db[_0x180b('0x8e')],{'as':_0x180b('0x8e'),'foreignKey':_0x180b('0x1b6')});db[_0x180b('0xae')][_0x180b('0xff')](db[_0x180b('0xb0')],{'as':'Configurations','onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1aa')});db['FreshdeskConfiguration'][_0x180b('0xff')](db[_0x180b('0xb2')],{'as':'Subjects','onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1ac')});db['FreshdeskConfiguration']['hasMany'](db[_0x180b('0xb2')],{'as':_0x180b('0x1ad'),'onDelete':'cascade','foreignKey':_0x180b('0x1b4')});db['FreshdeskConfiguration'][_0x180b('0xff')](db['FreshdeskField'],{'as':'Fields','onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1b0')});db[_0x180b('0xb0')][_0x180b('0x10a')](db[_0x180b('0xae')],{'as':_0x180b('0x15a'),'foreignKey':_0x180b('0x1aa')});db[_0x180b('0xb0')][_0x180b('0x10b')](db[_0x180b('0x164')],{'through':_0x180b('0x1bd')});db[_0x180b('0xb2')][_0x180b('0xff')](db['FreshdeskField'],{'as':_0x180b('0x1ae'),'foreignKey':_0x180b('0x1ac')});db[_0x180b('0xb2')][_0x180b('0xff')](db[_0x180b('0xb2')],{'as':_0x180b('0x1af'),'foreignKey':_0x180b('0x1b4')});db[_0x180b('0xb2')][_0x180b('0xff')](db['FreshdeskField'],{'as':_0x180b('0x1b5'),'foreignKey':_0x180b('0x1b0')});db['FreshdeskField'][_0x180b('0x10a')](db['Variable'],{'as':'Variable','foreignKey':_0x180b('0x1b6')});db[_0x180b('0x1be')]['hasMany'](db[_0x180b('0xb4')],{'as':'Configurations','onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1aa')});db[_0x180b('0xb4')][_0x180b('0xff')](db[_0x180b('0x1bf')],{'as':'Subjects','foreignKey':_0x180b('0x1ac')});db[_0x180b('0xb4')][_0x180b('0xff')](db['VtigerField'],{'as':_0x180b('0x1ad'),'foreignKey':'DescriptionId'});db[_0x180b('0xb4')]['hasMany'](db[_0x180b('0x1bf')],{'as':'Fields','foreignKey':'FieldId'});db[_0x180b('0xb4')][_0x180b('0x10a')](db[_0x180b('0x1be')],{'as':_0x180b('0x15a'),'foreignKey':_0x180b('0x1aa')});db['VtigerField']['hasMany'](db[_0x180b('0x1bf')],{'as':_0x180b('0x1ae'),'foreignKey':_0x180b('0x1ac')});db[_0x180b('0x1bf')][_0x180b('0xff')](db['VtigerField'],{'as':_0x180b('0x1af'),'foreignKey':_0x180b('0x1b4')});db[_0x180b('0x1bf')][_0x180b('0xff')](db['VtigerField'],{'as':_0x180b('0x1b5'),'foreignKey':_0x180b('0x1b0')});db['VtigerField'][_0x180b('0x10a')](db['Variable'],{'as':'Variable','foreignKey':_0x180b('0x1b6')});db[_0x180b('0xb7')][_0x180b('0xff')](db[_0x180b('0xb9')],{'as':_0x180b('0x1b2'),'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1aa')});db['ServicenowConfiguration']['hasMany'](db[_0x180b('0xba')],{'as':_0x180b('0x1ab'),'foreignKey':_0x180b('0x1ac')});db['ServicenowConfiguration'][_0x180b('0xff')](db[_0x180b('0xba')],{'as':_0x180b('0x1ad'),'foreignKey':_0x180b('0x1b4')});db['ServicenowConfiguration'][_0x180b('0xff')](db[_0x180b('0xba')],{'as':_0x180b('0x1a7'),'foreignKey':_0x180b('0x1b0')});db['ServicenowConfiguration'][_0x180b('0x10a')](db[_0x180b('0xb7')],{'as':_0x180b('0x15a'),'foreignKey':_0x180b('0x1aa')});db[_0x180b('0xba')][_0x180b('0xff')](db['ServicenowField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x180b('0xba')][_0x180b('0xff')](db[_0x180b('0xba')],{'as':_0x180b('0x1af'),'foreignKey':_0x180b('0x1b4')});db[_0x180b('0xba')]['hasMany'](db['ServicenowField'],{'as':_0x180b('0x1b5'),'foreignKey':_0x180b('0x1b0')});db['ServicenowField'][_0x180b('0x10a')](db[_0x180b('0x8e')],{'as':'Variable','foreignKey':_0x180b('0x1b6')});db[_0x180b('0xbc')][_0x180b('0xff')](db['Dynamics365Configuration'],{'as':_0x180b('0x1b2'),'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1aa')});db[_0x180b('0x1c0')][_0x180b('0xff')](db['Dynamics365Field'],{'as':_0x180b('0x1ab'),'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1ac')});db[_0x180b('0x1c0')][_0x180b('0xff')](db[_0x180b('0xbf')],{'as':_0x180b('0x1ad'),'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1b4')});db[_0x180b('0x1c0')][_0x180b('0xff')](db['Dynamics365Field'],{'as':_0x180b('0x1a7'),'onDelete':_0x180b('0xfe'),'foreignKey':'FieldId'});db[_0x180b('0x1c0')][_0x180b('0x10a')](db['Dynamics365Account'],{'as':_0x180b('0x15a'),'foreignKey':'AccountId'});db[_0x180b('0xbf')][_0x180b('0xff')](db[_0x180b('0xbf')],{'as':_0x180b('0x1ae'),'foreignKey':'SubjectId'});db[_0x180b('0xbf')][_0x180b('0xff')](db[_0x180b('0xbf')],{'as':_0x180b('0x1af'),'foreignKey':_0x180b('0x1b4')});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':_0x180b('0x1b5'),'foreignKey':_0x180b('0x1b0')});db[_0x180b('0xbf')][_0x180b('0x10a')](db['Variable'],{'as':'Variable','foreignKey':_0x180b('0x1b6')});db['FreshsalesAccount'][_0x180b('0xff')](db[_0x180b('0xc2')],{'as':_0x180b('0x1b2'),'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1aa')});db[_0x180b('0xc2')][_0x180b('0xff')](db[_0x180b('0xc3')],{'as':_0x180b('0x1ab'),'foreignKey':_0x180b('0x1ac')});db[_0x180b('0xc2')][_0x180b('0xff')](db['FreshsalesField'],{'as':_0x180b('0x1ad'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0x180b('0xff')](db['FreshsalesField'],{'as':_0x180b('0x1a7'),'foreignKey':_0x180b('0x1b0')});db[_0x180b('0xc2')][_0x180b('0x10a')](db[_0x180b('0xc0')],{'as':_0x180b('0x15a'),'foreignKey':_0x180b('0x1aa')});db[_0x180b('0xc3')]['hasMany'](db[_0x180b('0xc3')],{'as':_0x180b('0x1ae'),'foreignKey':'SubjectId'});db[_0x180b('0xc3')][_0x180b('0xff')](db[_0x180b('0xc3')],{'as':'Description','foreignKey':_0x180b('0x1b4')});db[_0x180b('0xc3')][_0x180b('0xff')](db[_0x180b('0xc3')],{'as':_0x180b('0x1b5'),'foreignKey':'FieldId'});db[_0x180b('0xc3')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x180b('0xc5')][_0x180b('0x10a')](db[_0x180b('0x121')],{});db[_0x180b('0xc5')][_0x180b('0x10a')](db[_0x180b('0xe8')],{'as':_0x180b('0x15f'),'foreignKey':_0x180b('0x150')});db[_0x180b('0xc5')]['belongsTo'](db[_0x180b('0x145')],{'as':'Contact','foreignKey':'ContactId'});db['ChatQueueReport']['belongsTo'](db[_0x180b('0x63')],{});db[_0x180b('0xc5')]['belongsTo'](db[_0x180b('0x65')],{});db[_0x180b('0xc5')]['belongsTo'](db['User'],{});db[_0x180b('0xc5')][_0x180b('0x10a')](db['ChatQueue'],{});db[_0x180b('0x1c1')][_0x180b('0x10a')](db[_0x180b('0x12')],{'onDelete':_0x180b('0xfe'),'foreignKey':'FromId'});db[_0x180b('0x1c1')][_0x180b('0x10a')](db['User'],{'onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1c2')});db[_0x180b('0xcb')][_0x180b('0xff')](db[_0x180b('0xc9')],{'foreignKey':'SessionId','onDelete':_0x180b('0xfe')});db[_0x180b('0xcb')]['hasMany'](db[_0x180b('0xc7')],{'foreignKey':_0x180b('0x1c3'),'onDelete':_0x180b('0xfe')});db[_0x180b('0x1c4')][_0x180b('0x10a')](db['SmsAccount'],{});db['SmsQueueReport'][_0x180b('0x10a')](db['CmList'],{'as':_0x180b('0x15f'),'foreignKey':_0x180b('0x150')});db[_0x180b('0x1c4')][_0x180b('0x10a')](db[_0x180b('0x145')],{'as':_0x180b('0x146'),'foreignKey':_0x180b('0x147')});db[_0x180b('0x1c4')]['belongsTo'](db[_0x180b('0x54')],{});db[_0x180b('0x1c4')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x180b('0x10a')](db[_0x180b('0x12')],{});db[_0x180b('0x1c4')][_0x180b('0x10a')](db[_0x180b('0x57')],{});db[_0x180b('0xd1')]['hasMany'](db[_0x180b('0xcb')],{'foreignKey':'ProjectId'});db[_0x180b('0xd1')]['hasMany'](db[_0x180b('0xc9')],{'foreignKey':_0x180b('0x1c5')});db[_0x180b('0xd1')][_0x180b('0xff')](db[_0x180b('0xc7')],{'foreignKey':_0x180b('0x1c5')});db[_0x180b('0x1c6')][_0x180b('0x10b')](db['User'],{'as':_0x180b('0x158'),'through':_0x180b('0x12b')});db['Team']['belongsToMany'](db[_0x180b('0x12')],{'as':_0x180b('0x13c'),'through':'user_has_teams'});db[_0x180b('0x110')][_0x180b('0x10b')](db['VoiceQueue'],{'through':_0x180b('0xfb'),'as':'VoiceQueues'});db[_0x180b('0x110')][_0x180b('0x10b')](db[_0x180b('0x117')],{'through':'team_has_mail_queues','as':_0x180b('0x118')});db[_0x180b('0x110')][_0x180b('0x10b')](db['ChatQueue'],{'through':_0x180b('0x183'),'as':_0x180b('0x11a')});db[_0x180b('0x110')][_0x180b('0x10b')](db[_0x180b('0x4e')],{'through':'team_has_fax_queues','as':_0x180b('0x11b')});db[_0x180b('0x110')][_0x180b('0x10b')](db[_0x180b('0x57')],{'through':_0x180b('0x170'),'as':_0x180b('0x11c')});db[_0x180b('0x110')]['belongsToMany'](db[_0x180b('0x5f')],{'through':_0x180b('0x176'),'as':_0x180b('0x11d')});db[_0x180b('0x110')]['belongsToMany'](db[_0x180b('0xf9')],{'through':'team_has_whatsapp_queues','as':_0x180b('0x11e')});db['Campaign'][_0x180b('0xff')](db[_0x180b('0x6f')],{'as':'Hoppers','foreignKey':_0x180b('0x18b')});db[_0x180b('0x18a')][_0x180b('0xff')](db[_0x180b('0x73')],{'as':_0x180b('0x135'),'foreignKey':'CampaignId'});db[_0x180b('0x18a')][_0x180b('0xff')](db[_0x180b('0x75')],{'as':_0x180b('0x136'),'foreignKey':_0x180b('0x18b')});db[_0x180b('0x18a')][_0x180b('0xff')](db[_0x180b('0x71')],{'as':'HopperBlacks','foreignKey':_0x180b('0x18b')});db['Campaign'][_0x180b('0x10a')](db[_0x180b('0x2a')],{'as':_0x180b('0x2a'),'foreignKey':_0x180b('0x138')});db['Campaign']['belongsTo'](db['Trunk'],{'as':_0x180b('0x139'),'foreignKey':'TrunkBackupId'});db[_0x180b('0x18a')][_0x180b('0x10a')](db[_0x180b('0x7c')],{'as':_0x180b('0x7c'),'foreignKey':_0x180b('0x13a')});db['Campaign'][_0x180b('0x10a')](db[_0x180b('0x1c6')],{'as':_0x180b('0x1c6'),'foreignKey':_0x180b('0x1c7')});db['Campaign'][_0x180b('0x10b')](db[_0x180b('0xe8')],{'as':'Lists','through':_0x180b('0x1c8')});db[_0x180b('0x18a')][_0x180b('0x10b')](db[_0x180b('0xe8')],{'as':'BlackLists','through':_0x180b('0x1c9')});db[_0x180b('0xdd')][_0x180b('0x10a')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x180b('0x15c')});db[_0x180b('0x1ca')][_0x180b('0x10a')](db['MailMessage'],{});db[_0x180b('0x1ca')][_0x180b('0x10a')](db[_0x180b('0x3f')],{});db[_0x180b('0x1ca')][_0x180b('0x10a')](db[_0x180b('0x3d')],{'foreignKey':_0x180b('0x1cb'),'as':'FromAccount'});db[_0x180b('0x1ca')][_0x180b('0x10a')](db['User'],{'foreignKey':_0x180b('0x1cc'),'as':'FromAgent'});db['MailTransferReport'][_0x180b('0x10a')](db[_0x180b('0x12')],{'foreignKey':'ToUserId','as':_0x180b('0x1cd')});db[_0x180b('0x1ca')][_0x180b('0x10a')](db[_0x180b('0x117')],{'foreignKey':_0x180b('0x1ce'),'as':_0x180b('0x1cf')});db['MailTransferReport'][_0x180b('0x10a')](db[_0x180b('0x3d')],{'foreignKey':_0x180b('0x1d0'),'as':_0x180b('0x1d1')});db[_0x180b('0xe0')][_0x180b('0x10a')](db['ChatMessage'],{});db[_0x180b('0xe0')]['belongsTo'](db[_0x180b('0x63')],{});db[_0x180b('0xe0')][_0x180b('0x10a')](db[_0x180b('0x121')],{'foreignKey':_0x180b('0x1d2'),'as':_0x180b('0x1d3')});db[_0x180b('0xe0')][_0x180b('0x10a')](db[_0x180b('0x12')],{'foreignKey':_0x180b('0x1cc'),'as':_0x180b('0x1d4')});db[_0x180b('0xe0')][_0x180b('0x10a')](db['User'],{'foreignKey':'ToUserId','as':_0x180b('0x1cd')});db[_0x180b('0xe0')]['belongsTo'](db[_0x180b('0x17b')],{'foreignKey':_0x180b('0x1d5'),'as':_0x180b('0x1cf')});db['ChatTransferReport']['belongsTo'](db[_0x180b('0x121')],{'foreignKey':'ToChatWebsiteId','as':'ToAccount'});db[_0x180b('0xe2')][_0x180b('0x10a')](db[_0x180b('0x4c')],{});db['FaxTransferReport'][_0x180b('0x10a')](db[_0x180b('0x4a')],{});db[_0x180b('0xe2')]['belongsTo'](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':_0x180b('0x1d3')});db[_0x180b('0xe2')]['belongsTo'](db[_0x180b('0x12')],{'foreignKey':'FromUserId','as':_0x180b('0x1d4')});db[_0x180b('0xe2')][_0x180b('0x10a')](db[_0x180b('0x12')],{'foreignKey':'ToUserId','as':_0x180b('0x1cd')});db[_0x180b('0xe2')][_0x180b('0x10a')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x180b('0x1cf')});db[_0x180b('0xe2')][_0x180b('0x10a')](db[_0x180b('0x47')],{'foreignKey':_0x180b('0x1d6'),'as':'ToAccount'});db[_0x180b('0xe4')][_0x180b('0x10a')](db[_0x180b('0x5d')],{});db[_0x180b('0xe4')][_0x180b('0x10a')](db[_0x180b('0x5c')],{});db[_0x180b('0xe4')][_0x180b('0x10a')](db[_0x180b('0x59')],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db[_0x180b('0xe4')][_0x180b('0x10a')](db[_0x180b('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x180b('0xe4')]['belongsTo'](db[_0x180b('0x12')],{'foreignKey':_0x180b('0x1d7'),'as':_0x180b('0x1cd')});db[_0x180b('0xe4')][_0x180b('0x10a')](db[_0x180b('0x5f')],{'foreignKey':_0x180b('0x1d8'),'as':_0x180b('0x1cf')});db[_0x180b('0xe4')][_0x180b('0x10a')](db[_0x180b('0x59')],{'foreignKey':_0x180b('0x1d9'),'as':_0x180b('0x1d1')});db[_0x180b('0xe6')][_0x180b('0x10a')](db[_0x180b('0x55')],{});db[_0x180b('0xe6')][_0x180b('0x10a')](db['SmsInteraction'],{});db[_0x180b('0xe6')]['belongsTo'](db[_0x180b('0x51')],{'foreignKey':_0x180b('0x1da'),'as':_0x180b('0x1d3')});db[_0x180b('0xe6')][_0x180b('0x10a')](db[_0x180b('0x12')],{'foreignKey':'FromUserId','as':_0x180b('0x1d4')});db['SmsTransferReport'][_0x180b('0x10a')](db[_0x180b('0x12')],{'foreignKey':_0x180b('0x1d7'),'as':_0x180b('0x1cd')});db['SmsTransferReport'][_0x180b('0x10a')](db[_0x180b('0x57')],{'foreignKey':_0x180b('0x1db'),'as':_0x180b('0x1cf')});db[_0x180b('0xe6')][_0x180b('0x10a')](db['SmsAccount'],{'foreignKey':_0x180b('0x1dc'),'as':_0x180b('0x1d1')});db[_0x180b('0xe8')]['hasMany'](db[_0x180b('0x14a')],{'as':_0x180b('0x14b'),'foreignKey':_0x180b('0x150')});db['CmList'][_0x180b('0xff')](db[_0x180b('0x76')],{'as':_0x180b('0x1dd'),'foreignKey':_0x180b('0x150')});db[_0x180b('0xe8')][_0x180b('0xff')](db[_0x180b('0x145')],{'as':'Contacts','onDelete':_0x180b('0xfe'),'foreignKey':'ListId'});db[_0x180b('0xe8')][_0x180b('0xff')](db[_0x180b('0x73')],{'as':'HopperFinals','foreignKey':_0x180b('0x150')});db[_0x180b('0xe8')]['hasMany'](db[_0x180b('0x75')],{'as':_0x180b('0x1de'),'foreignKey':_0x180b('0x150')});db[_0x180b('0xe8')][_0x180b('0xff')](db[_0x180b('0x104')],{'as':_0x180b('0x104'),'foreignKey':_0x180b('0x150')});db['CmList']['belongsToMany'](db['VoiceQueue'],{'as':_0x180b('0x1df'),'through':_0x180b('0x1e0')});db[_0x180b('0xe8')][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x13c'),'through':_0x180b('0x10f')});db[_0x180b('0xea')][_0x180b('0xff')](db[_0x180b('0x18')],{'as':_0x180b('0x103'),'onDelete':'cascade'});db['VoicePrefix'][_0x180b('0x10b')](db['User'],{'as':'Agents','through':_0x180b('0x120')});db[_0x180b('0xec')][_0x180b('0xff')](db[_0x180b('0x12')],{'as':_0x180b('0x158'),'foreignKey':_0x180b('0x1e1')});db[_0x180b('0xec')][_0x180b('0xff')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0x180b('0x1e1'),'onDelete':_0x180b('0xfe')});db[_0x180b('0xed')]['hasMany'](db['UserProfileResource'],{'as':_0x180b('0x1e2'),'foreignKey':_0x180b('0x1e3'),'onDelete':_0x180b('0xfe')});db[_0x180b('0xf0')][_0x180b('0xff')](db['Disposition'],{'as':_0x180b('0x14b'),'foreignKey':_0x180b('0x1e4')});db[_0x180b('0xf0')][_0x180b('0xff')](db[_0x180b('0x14c')],{'as':_0x180b('0x162'),'foreignKey':_0x180b('0x1e4')});db[_0x180b('0xf0')]['hasMany'](db[_0x180b('0xf5')],{'as':_0x180b('0x13f'),'foreignKey':'WhatsappAccountId'});db[_0x180b('0xf0')][_0x180b('0xff')](db['WhatsappInteraction'],{'as':_0x180b('0x14d')});db[_0x180b('0xf0')]['hasMany'](db[_0x180b('0xf1')],{'as':_0x180b('0x14f')});db[_0x180b('0xf0')][_0x180b('0x10a')](db[_0x180b('0xe8')],{'as':_0x180b('0x15f'),'foreignKey':'ListId'});db[_0x180b('0xf0')][_0x180b('0x10a')](db[_0x180b('0x7e')],{'as':_0x180b('0x13b'),'foreignKey':_0x180b('0x151')});db[_0x180b('0xf0')]['belongsToMany'](db['User'],{'as':_0x180b('0x13c'),'through':_0x180b('0x1e5')});db[_0x180b('0xf1')][_0x180b('0x10a')](db[_0x180b('0x12')],{'onDelete':_0x180b('0x15d')});db['WhatsappApplication'][_0x180b('0x10a')](db[_0x180b('0xf9')],{'onDelete':_0x180b('0x15d')});db[_0x180b('0xf1')][_0x180b('0x10a')](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0x180b('0xf1')][_0x180b('0x10a')](db[_0x180b('0x7c')],{'onDelete':_0x180b('0x15d'),'foreignKey':_0x180b('0x13a')});db['WhatsappApplication']['belongsTo'](db['Tag'],{'onDelete':_0x180b('0x15d'),'foreignKey':'TagId'});db[_0x180b('0xf3')][_0x180b('0xff')](db[_0x180b('0xf5')],{'as':'Messages','onDelete':_0x180b('0xfe'),'foreignKey':_0x180b('0x1e6')});db[_0x180b('0xf3')][_0x180b('0x10a')](db['WhatsappAccount'],{'as':_0x180b('0x15a'),'foreignKey':_0x180b('0x1e4')});db[_0x180b('0xf3')][_0x180b('0x10a')](db[_0x180b('0x145')],{'as':_0x180b('0x146'),'foreignKey':_0x180b('0x147')});db[_0x180b('0xf3')][_0x180b('0x10a')](db['User'],{'as':'Owner','foreignKey':_0x180b('0x101')});db[_0x180b('0xf3')][_0x180b('0x10b')](db[_0x180b('0x164')],{'through':_0x180b('0x19d'),'as':'Tags'});db[_0x180b('0xf3')]['belongsToMany'](db[_0x180b('0x164')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0x180b('0xf3')][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x158'),'through':'user_has_whatsapp_interactions','foreignKey':_0x180b('0x1e6')});db[_0x180b('0xf5')][_0x180b('0x10a')](db[_0x180b('0x12')],{'as':'User'});db[_0x180b('0xf5')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0x180b('0x146')});db[_0x180b('0xf5')][_0x180b('0x10a')](db['WhatsappInteraction'],{'onDelete':_0x180b('0xfe'),'as':'Interaction','foreignKey':_0x180b('0x1e6')});db[_0x180b('0xf5')][_0x180b('0x10a')](db[_0x180b('0xf0')],{'as':_0x180b('0x15a'),'foreignKey':'WhatsappAccountId'});db[_0x180b('0x1e7')][_0x180b('0x10a')](db[_0x180b('0xf0')],{});db[_0x180b('0x1e7')][_0x180b('0x10a')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x180b('0x1e7')][_0x180b('0x10a')](db[_0x180b('0x145')],{'as':_0x180b('0x146'),'foreignKey':_0x180b('0x147')});db[_0x180b('0x1e7')]['belongsTo'](db[_0x180b('0xf3')],{});db[_0x180b('0x1e7')][_0x180b('0x10a')](db[_0x180b('0xf9')],{});db[_0x180b('0x1e7')][_0x180b('0x10a')](db[_0x180b('0xf5')],{});db['WhatsappQueueReport'][_0x180b('0x10a')](db[_0x180b('0x12')],{});db[_0x180b('0x1e8')][_0x180b('0x10a')](db[_0x180b('0xf5')],{});db[_0x180b('0x1e8')][_0x180b('0x10a')](db[_0x180b('0xf3')],{});db[_0x180b('0x1e8')][_0x180b('0x10a')](db[_0x180b('0xf0')],{'foreignKey':'FromWhatsappAccountId','as':_0x180b('0x1d3')});db[_0x180b('0x1e8')]['belongsTo'](db[_0x180b('0xf0')],{'foreignKey':_0x180b('0x1e9'),'as':'ToAccount'});db[_0x180b('0x1e8')][_0x180b('0x10a')](db[_0x180b('0xf9')],{'foreignKey':_0x180b('0x1ea'),'as':'ToQueue'});db[_0x180b('0x1e8')][_0x180b('0x10a')](db[_0x180b('0x12')],{'foreignKey':_0x180b('0x1cc'),'as':_0x180b('0x1d4')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x180b('0x1d7'),'as':_0x180b('0x1cd')});db[_0x180b('0xf9')][_0x180b('0x10b')](db[_0x180b('0x12')],{'as':_0x180b('0x13c'),'through':_0x180b('0x38'),'foreignKey':_0x180b('0x1eb')});db[_0x180b('0xf9')][_0x180b('0x10b')](db[_0x180b('0x110')],{'through':'team_has_whatsapp_queues','as':_0x180b('0x152')});module[_0x180b('0x1ec')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index f02b821..259c3bf 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2354=['agent_name','/api/users','/api/voice/chanspy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/messages','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./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/cmContact','/api/cm/hopper','./api/cmHopper','./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/canned_answers','./api/cannedAnswer','/api/dispositions','./api/condition','/api/intervals','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integrationReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','/api/teams','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/cm/lists','./api/cmList','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','./api/whatsappAccount','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','join','root','/www','static','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','get','route','sendFile','resolve','appPath','username','password','newPassword','apiKey','lastName','street','phone','mobile','fax','email','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridname','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','pass','localstationid','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','path','express-winston','util','./errors','./config/environment','./config/logger','auth','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','connection','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','headers','remoteAddress','url'];(function(_0x4409e7,_0x307f17){var _0x24c751=function(_0x3a7d33){while(--_0x3a7d33){_0x4409e7['push'](_0x4409e7['shift']());}};_0x24c751(++_0x307f17);}(_0x2354,0x125));var _0x4235=function(_0x5868b6,_0x4c6951){_0x5868b6=_0x5868b6-0x0;var _0x27e033=_0x2354[_0x5868b6];return _0x27e033;};'use strict';var _=require('lodash');var path=require(_0x4235('0x0'));var express=require('express');var ewinston=require(_0x4235('0x1'));var util=require(_0x4235('0x2'));var errors=require(_0x4235('0x3'));var config=require(_0x4235('0x4'));var logger=require(_0x4235('0x5'))('api');var authLogger=require(_0x4235('0x5'))(_0x4235('0x6'));exports['default']=function(_0x56c2ad){_0x56c2ad[_0x4235('0x7')](ewinston[_0x4235('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2b21bb,_0x23f622){var _0x3380e5=_0x4235('0x9');if(!_[_0x4235('0xa')](_0x2b21bb[_0x4235('0xb')])){_0x3380e5+=_0x4235('0xc');var _0x2a5ee8=_0x2b21bb[_0x4235('0xb')];maskSensitiveData(_0x2a5ee8);}return util[_0x4235('0xd')](_0x3380e5,_0x2b21bb[_0x4235('0xe')],_0x2b21bb['headers']['x-forwarded-for']?_0x2b21bb['headers'][_0x4235('0xf')]:_0x2b21bb[_0x4235('0x10')]['remoteAddress']||_0x2b21bb['ip'],_0x2b21bb['url'],_0x23f622[_0x4235('0x11')],_0x23f622[_0x4235('0x12')],_0x2b21bb[_0x4235('0x13')]?_0x2b21bb[_0x4235('0x13')]['id']:null,_0x2b21bb[_0x4235('0x13')]?_0x2b21bb[_0x4235('0x13')][_0x4235('0x14')]:null,_0x2b21bb[_0x4235('0x13')]?_0x2b21bb[_0x4235('0x13')][_0x4235('0x15')]:null,_0x2a5ee8?util[_0x4235('0x16')](_0x2a5ee8,![],null):'');}}));_0x56c2ad['use'](ewinston[_0x4235('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0xf7e998,_0x27cc45){var _0x32da99=_0x4235('0x17');if(_0xf7e998[_0x4235('0xb')]&&_0xf7e998[_0x4235('0xb')][_0x4235('0x18')]&&_0xf7e998[_0x4235('0xb')][_0x4235('0x19')]){_0x32da99=_0x4235('0x1a');}return util[_0x4235('0xd')](_0x32da99,_0xf7e998[_0x4235('0xe')],_0xf7e998['headers']['x-forwarded-for']?_0xf7e998[_0x4235('0x1b')]['x-forwarded-for']:_0xf7e998[_0x4235('0x10')][_0x4235('0x1c')]||_0xf7e998['ip'],_0xf7e998[_0x4235('0x1d')],_0x27cc45['statusCode'],_0x27cc45[_0x4235('0x12')],_0xf7e998['user']?_0xf7e998[_0x4235('0x13')]['id']:null,_0xf7e998[_0x4235('0x13')]?_0xf7e998[_0x4235('0x13')]['name']:null,_0xf7e998[_0x4235('0x13')]?_0xf7e998[_0x4235('0x13')][_0x4235('0x15')]:null,_0xf7e998['body']&&_0xf7e998['body'][_0x4235('0x18')]?_0xf7e998[_0x4235('0xb')][_0x4235('0x18')]:'other',_0xf7e998['body']&&_0xf7e998[_0x4235('0xb')][_0x4235('0x19')]?_0xf7e998['body']['agent_id']:'',_0xf7e998[_0x4235('0xb')]&&_0xf7e998[_0x4235('0xb')]['agent_name']?_0xf7e998[_0x4235('0xb')][_0x4235('0x1e')]:'');},'ignoreRoute':function(_0x425a5e){var _0x5e5c59=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5e5c59['test'](_0x425a5e[_0x4235('0x1d')]);}}));_0x56c2ad['use'](_0x4235('0x1f'),require('./api/user'));_0x56c2ad[_0x4235('0x7')](_0x4235('0x20'),require('./api/voiceChanSpy'));_0x56c2ad['use'](_0x4235('0x21'),require('./api/voiceContext'));_0x56c2ad['use'](_0x4235('0x22'),require(_0x4235('0x23')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x24'),require(_0x4235('0x25')));_0x56c2ad['use'](_0x4235('0x26'),require(_0x4235('0x27')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x28'),require(_0x4235('0x29')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x2a'),require(_0x4235('0x2b')));_0x56c2ad[_0x4235('0x7')]('/api/voice/mails',require('./api/voiceMail'));_0x56c2ad[_0x4235('0x7')](_0x4235('0x2c'),require(_0x4235('0x2d')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x2e'),require(_0x4235('0x2f')));_0x56c2ad[_0x4235('0x7')]('/api/voice/dials/reports',require(_0x4235('0x30')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x31'),require(_0x4235('0x32')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x33'),require(_0x4235('0x34')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x35'),require(_0x4235('0x36')));_0x56c2ad[_0x4235('0x7')]('/api/trunks',require(_0x4235('0x37')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x38'),require(_0x4235('0x39')));_0x56c2ad[_0x4235('0x7')]('/api/mail/out_servers',require(_0x4235('0x3a')));_0x56c2ad['use']('/api/mail/accounts',require('./api/mailAccount'));_0x56c2ad[_0x4235('0x7')](_0x4235('0x3b'),require(_0x4235('0x3c')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x3d'),require(_0x4235('0x3e')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x3f'),require(_0x4235('0x40')));_0x56c2ad['use'](_0x4235('0x41'),require(_0x4235('0x42')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x43'),require('./api/mailApplication'));_0x56c2ad[_0x4235('0x7')](_0x4235('0x44'),require(_0x4235('0x45')));_0x56c2ad['use']('/api/dashboards',require(_0x4235('0x46')));_0x56c2ad['use'](_0x4235('0x47'),require(_0x4235('0x48')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x49'),require('./api/faxAccount'));_0x56c2ad[_0x4235('0x7')]('/api/fax/applications',require(_0x4235('0x4a')));_0x56c2ad[_0x4235('0x7')]('/api/fax/interactions',require('./api/faxInteraction'));_0x56c2ad[_0x4235('0x7')](_0x4235('0x4b'),require('./api/faxMessage'));_0x56c2ad[_0x4235('0x7')]('/api/fax/queues',require('./api/faxQueue'));_0x56c2ad[_0x4235('0x7')](_0x4235('0x4c'),require(_0x4235('0x4d')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x4e'),require(_0x4235('0x4f')));_0x56c2ad['use'](_0x4235('0x50'),require(_0x4235('0x51')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x52'),require('./api/smsInteraction'));_0x56c2ad[_0x4235('0x7')](_0x4235('0x53'),require('./api/smsMessage'));_0x56c2ad[_0x4235('0x7')]('/api/sms/queues',require('./api/smsQueue'));_0x56c2ad['use'](_0x4235('0x54'),require(_0x4235('0x55')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x56'),require(_0x4235('0x57')));_0x56c2ad['use'](_0x4235('0x58'),require(_0x4235('0x59')));_0x56c2ad['use'](_0x4235('0x5a'),require('./api/openchannelMessage'));_0x56c2ad['use'](_0x4235('0x5b'),require('./api/openchannelQueue'));_0x56c2ad[_0x4235('0x7')]('/api/chat/websites',require(_0x4235('0x5c')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x5d'),require(_0x4235('0x5e')));_0x56c2ad[_0x4235('0x7')]('/api/chat/applications',require(_0x4235('0x5f')));_0x56c2ad['use'](_0x4235('0x60'),require(_0x4235('0x61')));_0x56c2ad[_0x4235('0x7')]('/api/chat/messages',require(_0x4235('0x62')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x63'),require(_0x4235('0x64')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x65'),require(_0x4235('0x66')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x67'),require(_0x4235('0x68')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x69'),require(_0x4235('0x6a')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x6b'),require('./api/cmCompany'));_0x56c2ad[_0x4235('0x7')]('/api/cm/contacts',require(_0x4235('0x6c')));_0x56c2ad['use'](_0x4235('0x6d'),require(_0x4235('0x6e')));_0x56c2ad[_0x4235('0x7')]('/api/cm/hopper_black',require(_0x4235('0x6f')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x70'),require(_0x4235('0x71')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x72'),require(_0x4235('0x73')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x74'),require(_0x4235('0x75')));_0x56c2ad[_0x4235('0x7')]('/api/actions',require(_0x4235('0x76')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x77'),require('./api/automation'));_0x56c2ad[_0x4235('0x7')](_0x4235('0x78'),require(_0x4235('0x79')));_0x56c2ad['use'](_0x4235('0x7a'),require('./api/disposition'));_0x56c2ad['use']('/api/conditions',require(_0x4235('0x7b')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x7c'),require('./api/interval'));_0x56c2ad['use'](_0x4235('0x7d'),require('./api/pause'));_0x56c2ad[_0x4235('0x7')](_0x4235('0x7e'),require(_0x4235('0x7f')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x80'),require('./api/voiceQueuesLog'));_0x56c2ad[_0x4235('0x7')](_0x4235('0x81'),require(_0x4235('0x82')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x83'),require(_0x4235('0x84')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x85'),require(_0x4235('0x86')));_0x56c2ad['use'](_0x4235('0x87'),require(_0x4235('0x88')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x89'),require('./api/cmContactHasItem'));_0x56c2ad[_0x4235('0x7')](_0x4235('0x8a'),require('./api/cmHopperAdditionalPhone'));_0x56c2ad[_0x4235('0x7')](_0x4235('0x8b'),require(_0x4235('0x8c')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x8d'),require(_0x4235('0x8e')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x8f'),require('./api/variable'));_0x56c2ad['use'](_0x4235('0x90'),require('./api/integration'));_0x56c2ad[_0x4235('0x7')]('/api/integrations/reports',require(_0x4235('0x91')));_0x56c2ad[_0x4235('0x7')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x56c2ad['use'](_0x4235('0x92'),require(_0x4235('0x93')));_0x56c2ad['use'](_0x4235('0x94'),require(_0x4235('0x95')));_0x56c2ad[_0x4235('0x7')]('/api/analytics/metrics',require(_0x4235('0x96')));_0x56c2ad['use'](_0x4235('0x97'),require(_0x4235('0x98')));_0x56c2ad['use']('/api/analytics/tree_reports',require(_0x4235('0x99')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x9a'),require(_0x4235('0x9b')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x9c'),require(_0x4235('0x9d')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x9e'),require(_0x4235('0x9f')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xa0'),require(_0x4235('0xa1')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xa2'),require(_0x4235('0xa3')));_0x56c2ad['use'](_0x4235('0xa4'),require('./api/intSugarcrmField'));_0x56c2ad[_0x4235('0x7')](_0x4235('0xa5'),require(_0x4235('0xa6')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xa7'),require(_0x4235('0xa8')));_0x56c2ad[_0x4235('0x7')]('/api/integrations/desk/fields',require(_0x4235('0xa9')));_0x56c2ad['use']('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x56c2ad['use']('/api/integrations/zoho/configurations',require(_0x4235('0xaa')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xab'),require(_0x4235('0xac')));_0x56c2ad[_0x4235('0x7')]('/api/integrations/zendesk/accounts',require(_0x4235('0xad')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xae'),require(_0x4235('0xaf')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xb0'),require(_0x4235('0xb1')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xb2'),require(_0x4235('0xb3')));_0x56c2ad[_0x4235('0x7')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x56c2ad[_0x4235('0x7')](_0x4235('0xb4'),require(_0x4235('0xb5')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xb6'),require(_0x4235('0xb7')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xb8'),require(_0x4235('0xb9')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xba'),require(_0x4235('0xbb')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xbc'),require(_0x4235('0xbd')));_0x56c2ad['use'](_0x4235('0xbe'),require(_0x4235('0xbf')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xc0'),require('./api/intServicenowField'));_0x56c2ad[_0x4235('0x7')](_0x4235('0xc1'),require(_0x4235('0xc2')));_0x56c2ad['use'](_0x4235('0xc3'),require(_0x4235('0xc4')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xc5'),require('./api/intDynamics365Field'));_0x56c2ad[_0x4235('0x7')](_0x4235('0xc6'),require('./api/intFreshsalesAccount'));_0x56c2ad[_0x4235('0x7')](_0x4235('0xc7'),require('./api/intFreshsalesConfiguration'));_0x56c2ad[_0x4235('0x7')](_0x4235('0xc8'),require(_0x4235('0xc9')));_0x56c2ad[_0x4235('0x7')]('/api/networks',require(_0x4235('0xca')));_0x56c2ad['use']('/api/chat/reports/queue',require(_0x4235('0xcb')));_0x56c2ad['use']('/api/chat/internal/messages',require(_0x4235('0xcc')));_0x56c2ad['use'](_0x4235('0xcd'),require(_0x4235('0xce')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xcf'),require(_0x4235('0xd0')));_0x56c2ad[_0x4235('0x7')]('/api/jscripty/sessions/reports',require(_0x4235('0xd1')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xd2'),require(_0x4235('0xd3')));_0x56c2ad[_0x4235('0x7')]('/api/square/reports',require(_0x4235('0xd4')));_0x56c2ad['use'](_0x4235('0xd5'),require(_0x4235('0xd6')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xd7'),require(_0x4235('0xd8')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xd9'),require(_0x4235('0xda')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xdb'),require(_0x4235('0xdc')));_0x56c2ad[_0x4235('0x7')]('/api/square/projects',require('./api/squareProject'));_0x56c2ad[_0x4235('0x7')](_0x4235('0xdd'),require(_0x4235('0xde')));_0x56c2ad[_0x4235('0x7')]('/api/square/messages',require('./api/squareMessage'));_0x56c2ad[_0x4235('0x7')](_0x4235('0xdf'),require('./api/team'));_0x56c2ad[_0x4235('0x7')]('/api/license',require('./api/license'));_0x56c2ad[_0x4235('0x7')](_0x4235('0xe0'),require(_0x4235('0xe1')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xe2'),require(_0x4235('0xe3')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xe4'),require(_0x4235('0xe5')));_0x56c2ad['use'](_0x4235('0xe6'),require(_0x4235('0xe7')));_0x56c2ad['use']('/api/mail/reports/transfer',require(_0x4235('0xe8')));_0x56c2ad[_0x4235('0x7')]('/api/chat/reports/transfer',require(_0x4235('0xe9')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xea'),require(_0x4235('0xeb')));_0x56c2ad['use'](_0x4235('0xec'),require(_0x4235('0xed')));_0x56c2ad[_0x4235('0x7')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x56c2ad[_0x4235('0x7')](_0x4235('0xee'),require(_0x4235('0xef')));_0x56c2ad['use']('/api/voice/prefixes',require('./api/voicePrefix'));_0x56c2ad['use'](_0x4235('0xf0'),require(_0x4235('0xf1')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xf2'),require('./api/userProfileSection'));_0x56c2ad['use']('/api/userProfile/resources',require(_0x4235('0xf3')));_0x56c2ad[_0x4235('0x7')]('/api/userNotifications',require('./api/userNotification'));_0x56c2ad[_0x4235('0x7')]('/api/whatsapp/accounts',require(_0x4235('0xf4')));_0x56c2ad[_0x4235('0x7')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x56c2ad[_0x4235('0x7')](_0x4235('0xf5'),require(_0x4235('0xf6')));_0x56c2ad['use'](_0x4235('0xf7'),require(_0x4235('0xf8')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xf9'),require(_0x4235('0xfa')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xfb'),require('./api/whatsappTransferReport'));_0x56c2ad[_0x4235('0x7')](_0x4235('0xfc'),require(_0x4235('0xfd')));_0x56c2ad[_0x4235('0x7')](_0x4235('0xfe'),require(_0x4235('0xff')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x100'),require(_0x4235('0x101')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x102'),require(_0x4235('0x103')));_0x56c2ad['use'](_0x4235('0x104'),require(_0x4235('0x105')));_0x56c2ad['use'](_0x4235('0x106'),require(_0x4235('0x107')));_0x56c2ad[_0x4235('0x7')]('/api/version',require(_0x4235('0x108')));_0x56c2ad[_0x4235('0x7')]('/api/system',require(_0x4235('0x109')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x10a'),require(_0x4235('0x10b')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x10c'),require(_0x4235('0x10d')));_0x56c2ad[_0x4235('0x7')]('/apidoc',express['static'](path[_0x4235('0x10e')](config[_0x4235('0x10f')],'/apidoc')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x110'),express[_0x4235('0x111')](path[_0x4235('0x10e')](config['root'],'/www')));_0x56c2ad[_0x4235('0x7')](_0x4235('0x112'),express[_0x4235('0x111')](path['join'](config[_0x4235('0x10f')],_0x4235('0x112'))));_0x56c2ad[_0x4235('0x7')](_0x4235('0x113'),express['static'](path[_0x4235('0x10e')](config[_0x4235('0x10f')],'snippet',_0x4235('0x114'))));_0x56c2ad[_0x4235('0x7')](_0x4235('0x115'),express[_0x4235('0x111')](path[_0x4235('0x10e')](config['root'],_0x4235('0x116'))));_0x56c2ad['route']('/:url(api|auth|components|app|bower_components|assets)/*')[_0x4235('0x117')](errors[0x194]);_0x56c2ad[_0x4235('0x118')]('/*')['get'](function(_0x22e903,_0x30f26d){_0x30f26d[_0x4235('0x119')](path[_0x4235('0x11a')](_0x56c2ad[_0x4235('0x117')](_0x4235('0x11b'))+'/index.html'));});};var sensitiveFields=[_0x4235('0x11c'),_0x4235('0x11d'),_0x4235('0x11e'),_0x4235('0x11f'),'firstName',_0x4235('0x120'),_0x4235('0x121'),_0x4235('0x122'),_0x4235('0x123'),_0x4235('0x124'),_0x4235('0x125'),'clientId','clientSecret',_0x4235('0x126'),_0x4235('0x127'),_0x4235('0x128'),_0x4235('0x129'),_0x4235('0x12a'),'channelSecret',_0x4235('0x12b'),_0x4235('0x12c'),_0x4235('0x12d'),_0x4235('0x12e'),_0x4235('0x12f'),'membername',_0x4235('0x130'),'calleridnum',_0x4235('0x131'),_0x4235('0x132'),'clientEmail',_0x4235('0x133'),_0x4235('0x134'),_0x4235('0x135'),_0x4235('0x136'),_0x4235('0x13'),_0x4235('0x137'),'accountSid',_0x4235('0x138'),'dsn',_0x4235('0x139'),_0x4235('0x13a'),_0x4235('0x13b')];function maskSensitiveData(_0x56e826){var _0x520a9c=/(?!^)[\s\S](?!$)/g;if(!_[_0x4235('0x13c')](_0x56e826))return;for(var _0x38358f in _0x56e826){if(_[_0x4235('0x13d')](_0x56e826[_0x38358f])){for(var _0xd97160=0x0;_0xd97160<_0x56e826[_0x38358f][_0x4235('0x13e')];_0xd97160++){maskSensitiveData(_0x56e826[_0x38358f][_0xd97160]);}}else if(_[_0x4235('0x13c')](_0x56e826[_0x38358f])){maskSensitiveData(_0x56e826[_0x38358f]);}else if(_[_0x4235('0x13f')](_0x56e826[_0x38358f])){_0x56e826[_0x38358f]=_0x56e826[_0x38358f][_0x4235('0x140')](/{{{/g,_0x4235('0x141'))[_0x4235('0x140')](/}}}/g,_0x4235('0x142'))[_0x4235('0x140')](/{{/g,'@{')[_0x4235('0x140')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x38358f)){_0x56e826[_0x38358f]=_0x56e826[_0x38358f][_0x4235('0x140')](_0x520a9c,'*');}}}} \ No newline at end of file +var _0x6c2c=['registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','includes','path','express','express-winston','util','./errors','./config/logger','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','responseTime','other','agent_id','agent_name','test','url','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsQueue','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/tags','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','./api/setting','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/auth/local','/api/auth/google','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','privateKey','key','pass','accountSid','localstationid','dsn'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x6c2c,0x158));var _0xc6c2=function(_0x99f10b,_0x32b68e){_0x99f10b=_0x99f10b-0x0;var _0x4e440c=_0x6c2c[_0x99f10b];return _0x4e440c;};'use strict';var _=require('lodash');var path=require(_0xc6c2('0x0'));var express=require(_0xc6c2('0x1'));var ewinston=require(_0xc6c2('0x2'));var util=require(_0xc6c2('0x3'));var errors=require(_0xc6c2('0x4'));var config=require('./config/environment');var logger=require(_0xc6c2('0x5'))(_0xc6c2('0x6'));var authLogger=require(_0xc6c2('0x5'))(_0xc6c2('0x7'));exports[_0xc6c2('0x8')]=function(_0x30ad0b){_0x30ad0b[_0xc6c2('0x9')](ewinston[_0xc6c2('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2d63d5,_0x27eaa4){var _0x490e12=_0xc6c2('0xb');if(!_[_0xc6c2('0xc')](_0x2d63d5[_0xc6c2('0xd')])){_0x490e12+=_0xc6c2('0xe');var _0x13ed3a=_0x2d63d5[_0xc6c2('0xd')];maskSensitiveData(_0x13ed3a);}return util[_0xc6c2('0xf')](_0x490e12,_0x2d63d5[_0xc6c2('0x10')],_0x2d63d5[_0xc6c2('0x11')][_0xc6c2('0x12')]?_0x2d63d5[_0xc6c2('0x11')]['x-forwarded-for']:_0x2d63d5[_0xc6c2('0x13')][_0xc6c2('0x14')]||_0x2d63d5['ip'],_0x2d63d5['url'],_0x27eaa4[_0xc6c2('0x15')],_0x27eaa4['responseTime'],_0x2d63d5['user']?_0x2d63d5[_0xc6c2('0x16')]['id']:null,_0x2d63d5['user']?_0x2d63d5[_0xc6c2('0x16')][_0xc6c2('0x17')]:null,_0x2d63d5[_0xc6c2('0x16')]?_0x2d63d5['user'][_0xc6c2('0x18')]:null,_0x13ed3a?util[_0xc6c2('0x19')](_0x13ed3a,![],null):'');}}));_0x30ad0b[_0xc6c2('0x9')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4a3a2d,_0x2290b7){var _0x1af0e4=_0xc6c2('0x1a');if(_0x4a3a2d[_0xc6c2('0xd')]&&_0x4a3a2d['body'][_0xc6c2('0x1b')]&&_0x4a3a2d['body']['agent_id']){_0x1af0e4=_0xc6c2('0x1c');}return util[_0xc6c2('0xf')](_0x1af0e4,_0x4a3a2d[_0xc6c2('0x10')],_0x4a3a2d[_0xc6c2('0x11')][_0xc6c2('0x12')]?_0x4a3a2d[_0xc6c2('0x11')][_0xc6c2('0x12')]:_0x4a3a2d[_0xc6c2('0x13')]['remoteAddress']||_0x4a3a2d['ip'],_0x4a3a2d['url'],_0x2290b7['statusCode'],_0x2290b7[_0xc6c2('0x1d')],_0x4a3a2d[_0xc6c2('0x16')]?_0x4a3a2d[_0xc6c2('0x16')]['id']:null,_0x4a3a2d[_0xc6c2('0x16')]?_0x4a3a2d['user'][_0xc6c2('0x17')]:null,_0x4a3a2d[_0xc6c2('0x16')]?_0x4a3a2d[_0xc6c2('0x16')][_0xc6c2('0x18')]:null,_0x4a3a2d[_0xc6c2('0xd')]&&_0x4a3a2d[_0xc6c2('0xd')][_0xc6c2('0x1b')]?_0x4a3a2d[_0xc6c2('0xd')][_0xc6c2('0x1b')]:_0xc6c2('0x1e'),_0x4a3a2d['body']&&_0x4a3a2d[_0xc6c2('0xd')]['agent_id']?_0x4a3a2d[_0xc6c2('0xd')][_0xc6c2('0x1f')]:'',_0x4a3a2d[_0xc6c2('0xd')]&&_0x4a3a2d[_0xc6c2('0xd')][_0xc6c2('0x20')]?_0x4a3a2d[_0xc6c2('0xd')][_0xc6c2('0x20')]:'');},'ignoreRoute':function(_0x484e33){var _0xbe1010=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xbe1010[_0xc6c2('0x21')](_0x484e33[_0xc6c2('0x22')]);}}));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x23'),require(_0xc6c2('0x24')));_0x30ad0b[_0xc6c2('0x9')]('/api/voice/chanspy',require(_0xc6c2('0x25')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x26'),require(_0xc6c2('0x27')));_0x30ad0b['use'](_0xc6c2('0x28'),require(_0xc6c2('0x29')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x2a'),require(_0xc6c2('0x2b')));_0x30ad0b[_0xc6c2('0x9')]('/api/voice/queues',require(_0xc6c2('0x2c')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x2d'),require(_0xc6c2('0x2e')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x2f'),require('./api/screenRecording'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x30'),require(_0xc6c2('0x31')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x32'),require(_0xc6c2('0x33')));_0x30ad0b['use'](_0xc6c2('0x34'),require('./api/voiceCallReport'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x35'),require(_0xc6c2('0x36')));_0x30ad0b['use'](_0xc6c2('0x37'),require('./api/voiceAgentReport'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x38'),require(_0xc6c2('0x39')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x3a'),require('./api/memberReport'));_0x30ad0b['use'](_0xc6c2('0x3b'),require(_0xc6c2('0x3c')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x3d'),require('./api/voiceTransferReport'));_0x30ad0b['use']('/api/mail/out_servers',require('./api/mailServerOut'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x3e'),require(_0xc6c2('0x3f')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x40'),require(_0xc6c2('0x41')));_0x30ad0b[_0xc6c2('0x9')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x42'),require(_0xc6c2('0x43')));_0x30ad0b['use'](_0xc6c2('0x44'),require(_0xc6c2('0x45')));_0x30ad0b[_0xc6c2('0x9')]('/api/mail/applications',require(_0xc6c2('0x46')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x47'),require('./api/mailQueueReport'));_0x30ad0b[_0xc6c2('0x9')]('/api/dashboards',require(_0xc6c2('0x48')));_0x30ad0b['use'](_0xc6c2('0x49'),require(_0xc6c2('0x4a')));_0x30ad0b['use'](_0xc6c2('0x4b'),require('./api/faxAccount'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x4c'),require(_0xc6c2('0x4d')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x4e'),require('./api/faxInteraction'));_0x30ad0b['use'](_0xc6c2('0x4f'),require(_0xc6c2('0x50')));_0x30ad0b['use']('/api/fax/queues',require(_0xc6c2('0x51')));_0x30ad0b[_0xc6c2('0x9')]('/api/fax/reports/queue',require(_0xc6c2('0x52')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x53'),require(_0xc6c2('0x54')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x55'),require(_0xc6c2('0x56')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x57'),require('./api/smsInteraction'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x58'),require('./api/smsMessage'));_0x30ad0b['use']('/api/sms/queues',require(_0xc6c2('0x59')));_0x30ad0b[_0xc6c2('0x9')]('/api/openchannel/accounts',require(_0xc6c2('0x5a')));_0x30ad0b[_0xc6c2('0x9')]('/api/openchannel/applications',require(_0xc6c2('0x5b')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x5c'),require('./api/openchannelInteraction'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x5d'),require(_0xc6c2('0x5e')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x5f'),require('./api/openchannelQueue'));_0x30ad0b['use']('/api/chat/websites',require(_0xc6c2('0x60')));_0x30ad0b['use']('/api/openchannel/reports/queue',require(_0xc6c2('0x61')));_0x30ad0b['use'](_0xc6c2('0x62'),require(_0xc6c2('0x63')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x64'),require('./api/chatInteraction'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x65'),require('./api/chatMessage'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x66'),require(_0xc6c2('0x67')));_0x30ad0b['use'](_0xc6c2('0x68'),require(_0xc6c2('0x69')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x6a'),require('./api/chatGroup'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x6b'),require(_0xc6c2('0x6c')));_0x30ad0b['use'](_0xc6c2('0x6d'),require(_0xc6c2('0x6e')));_0x30ad0b['use'](_0xc6c2('0x6f'),require(_0xc6c2('0x70')));_0x30ad0b['use'](_0xc6c2('0x71'),require('./api/cmHopper'));_0x30ad0b[_0xc6c2('0x9')]('/api/cm/hopper_black',require(_0xc6c2('0x72')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x73'),require(_0xc6c2('0x74')));_0x30ad0b['use']('/api/cm/hopper_history',require(_0xc6c2('0x75')));_0x30ad0b['use'](_0xc6c2('0x76'),require(_0xc6c2('0x77')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x78'),require('./api/action'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x79'),require(_0xc6c2('0x7a')));_0x30ad0b['use'](_0xc6c2('0x7b'),require(_0xc6c2('0x7c')));_0x30ad0b['use'](_0xc6c2('0x7d'),require(_0xc6c2('0x7e')));_0x30ad0b[_0xc6c2('0x9')]('/api/conditions',require(_0xc6c2('0x7f')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x80'),require(_0xc6c2('0x81')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x82'),require(_0xc6c2('0x83')));_0x30ad0b[_0xc6c2('0x9')]('/api/cdr',require(_0xc6c2('0x84')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x85'),require(_0xc6c2('0x86')));_0x30ad0b['use'](_0xc6c2('0x87'),require(_0xc6c2('0x88')));_0x30ad0b[_0xc6c2('0x9')]('/api/sounds',require('./api/sound'));_0x30ad0b['use'](_0xc6c2('0x89'),require('./api/tag'));_0x30ad0b['use'](_0xc6c2('0x8a'),require(_0xc6c2('0x8b')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x8c'),require('./api/cmContactHasItem'));_0x30ad0b[_0xc6c2('0x9')]('/api/cm_hopper_additional_phones',require(_0xc6c2('0x8d')));_0x30ad0b['use'](_0xc6c2('0x8e'),require(_0xc6c2('0x8f')));_0x30ad0b['use'](_0xc6c2('0x90'),require(_0xc6c2('0x91')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x92'),require(_0xc6c2('0x93')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x94'),require(_0xc6c2('0x95')));_0x30ad0b[_0xc6c2('0x9')]('/api/integrations/reports',require(_0xc6c2('0x96')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x97'),require(_0xc6c2('0x98')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x99'),require(_0xc6c2('0x9a')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x9b'),require(_0xc6c2('0x9c')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x9d'),require(_0xc6c2('0x9e')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x9f'),require('./api/analyticFieldReport'));_0x30ad0b[_0xc6c2('0x9')]('/api/analytics/tree_reports',require(_0xc6c2('0xa0')));_0x30ad0b['use']('/api/integrations/salesforce/accounts',require(_0xc6c2('0xa1')));_0x30ad0b['use'](_0xc6c2('0xa2'),require(_0xc6c2('0xa3')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xa4'),require(_0xc6c2('0xa5')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xa6'),require(_0xc6c2('0xa7')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xa8'),require(_0xc6c2('0xa9')));_0x30ad0b['use'](_0xc6c2('0xaa'),require(_0xc6c2('0xab')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xac'),require('./api/intDeskAccount'));_0x30ad0b[_0xc6c2('0x9')]('/api/integrations/desk/configurations',require(_0xc6c2('0xad')));_0x30ad0b[_0xc6c2('0x9')]('/api/integrations/desk/fields',require(_0xc6c2('0xae')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xaf'),require(_0xc6c2('0xb0')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xb1'),require(_0xc6c2('0xb2')));_0x30ad0b['use'](_0xc6c2('0xb3'),require(_0xc6c2('0xb4')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xb5'),require('./api/intZendeskAccount'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xb6'),require(_0xc6c2('0xb7')));_0x30ad0b[_0xc6c2('0x9')]('/api/integrations/zendesk/fields',require(_0xc6c2('0xb8')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xb9'),require(_0xc6c2('0xba')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xbb'),require(_0xc6c2('0xbc')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xbd'),require(_0xc6c2('0xbe')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xbf'),require('./api/intVtigerAccount'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xc0'),require(_0xc6c2('0xc1')));_0x30ad0b[_0xc6c2('0x9')]('/api/integrations/vtiger/fields',require(_0xc6c2('0xc2')));_0x30ad0b['use']('/api/integrations/servicenow/accounts',require(_0xc6c2('0xc3')));_0x30ad0b['use'](_0xc6c2('0xc4'),require(_0xc6c2('0xc5')));_0x30ad0b[_0xc6c2('0x9')]('/api/integrations/servicenow/fields',require(_0xc6c2('0xc6')));_0x30ad0b[_0xc6c2('0x9')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xc7'),require('./api/intDynamics365Configuration'));_0x30ad0b['use'](_0xc6c2('0xc8'),require(_0xc6c2('0xc9')));_0x30ad0b[_0xc6c2('0x9')]('/api/integrations/freshsales/accounts',require(_0xc6c2('0xca')));_0x30ad0b[_0xc6c2('0x9')]('/api/integrations/freshsales/configurations',require(_0xc6c2('0xcb')));_0x30ad0b[_0xc6c2('0x9')]('/api/integrations/freshsales/fields',require(_0xc6c2('0xcc')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xcd'),require(_0xc6c2('0xce')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xcf'),require(_0xc6c2('0xd0')));_0x30ad0b['use'](_0xc6c2('0xd1'),require('./api/chatInternalMessage'));_0x30ad0b['use'](_0xc6c2('0xd2'),require(_0xc6c2('0xd3')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xd4'),require(_0xc6c2('0xd5')));_0x30ad0b['use'](_0xc6c2('0xd6'),require('./api/jscriptySessionReport'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xd7'),require(_0xc6c2('0xd8')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xd9'),require(_0xc6c2('0xda')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xdb'),require('./api/squareReportDetail'));_0x30ad0b['use']('/api/jscripty/projects',require(_0xc6c2('0xdc')));_0x30ad0b[_0xc6c2('0x9')]('/api/settings',require(_0xc6c2('0xdd')));_0x30ad0b[_0xc6c2('0x9')]('/api/square/odbc',require('./api/squareOdbc'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xde'),require(_0xc6c2('0xdf')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xe0'),require(_0xc6c2('0xe1')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xe2'),require(_0xc6c2('0xe3')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xe4'),require(_0xc6c2('0xe5')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xe6'),require(_0xc6c2('0xe7')));_0x30ad0b[_0xc6c2('0x9')]('/api/campaigns',require(_0xc6c2('0xe8')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xe9'),require(_0xc6c2('0xea')));_0x30ad0b[_0xc6c2('0x9')]('/api/attachments',require('./api/attachment'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xeb'),require(_0xc6c2('0xec')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xed'),require(_0xc6c2('0xee')));_0x30ad0b[_0xc6c2('0x9')]('/api/chat/reports/transfer',require(_0xc6c2('0xef')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xf0'),require(_0xc6c2('0xf1')));_0x30ad0b[_0xc6c2('0x9')]('/api/openchannel/reports/transfer',require(_0xc6c2('0xf2')));_0x30ad0b[_0xc6c2('0x9')]('/api/sms/reports/transfer',require(_0xc6c2('0xf3')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xf4'),require(_0xc6c2('0xf5')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xf6'),require(_0xc6c2('0xf7')));_0x30ad0b[_0xc6c2('0x9')]('/api/userProfiles',require(_0xc6c2('0xf8')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xf9'),require('./api/userProfileSection'));_0x30ad0b['use'](_0xc6c2('0xfa'),require('./api/userProfileResource'));_0x30ad0b[_0xc6c2('0x9')]('/api/userNotifications',require(_0xc6c2('0xfb')));_0x30ad0b['use'](_0xc6c2('0xfc'),require(_0xc6c2('0xfd')));_0x30ad0b[_0xc6c2('0x9')]('/api/whatsapp/applications',require(_0xc6c2('0xfe')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0xff'),require(_0xc6c2('0x100')));_0x30ad0b[_0xc6c2('0x9')]('/api/whatsapp/messages',require(_0xc6c2('0x101')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x102'),require('./api/whatsappQueueReport'));_0x30ad0b['use'](_0xc6c2('0x103'),require(_0xc6c2('0x104')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x105'),require(_0xc6c2('0x106')));_0x30ad0b['use'](_0xc6c2('0x107'),require(_0xc6c2('0x108')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x109'),require('./api/authLocal'));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x10a'),require('./api/authGoogle'));_0x30ad0b[_0xc6c2('0x9')]('/api/jira',require(_0xc6c2('0x10b')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x10c'),require(_0xc6c2('0x10d')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x10e'),require(_0xc6c2('0x10f')));_0x30ad0b['use']('/api/system',require(_0xc6c2('0x110')));_0x30ad0b['use'](_0xc6c2('0x111'),require(_0xc6c2('0x112')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x113'),require(_0xc6c2('0x114')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x115'),express[_0xc6c2('0x116')](path[_0xc6c2('0x117')](config[_0xc6c2('0x118')],_0xc6c2('0x115'))));_0x30ad0b[_0xc6c2('0x9')]('/www',express[_0xc6c2('0x116')](path[_0xc6c2('0x117')](config[_0xc6c2('0x118')],_0xc6c2('0x119'))));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x11a'),express[_0xc6c2('0x116')](path['join'](config[_0xc6c2('0x118')],'/demo')));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x11b'),express[_0xc6c2('0x116')](path[_0xc6c2('0x117')](config['root'],_0xc6c2('0x11c'),_0xc6c2('0x11d'))));_0x30ad0b[_0xc6c2('0x9')](_0xc6c2('0x11e'),express[_0xc6c2('0x116')](path[_0xc6c2('0x117')](config[_0xc6c2('0x118')],_0xc6c2('0x11f'))));_0x30ad0b[_0xc6c2('0x120')](_0xc6c2('0x121'))[_0xc6c2('0x122')](errors[0x194]);_0x30ad0b['route']('/*')['get'](function(_0x4c2950,_0x3457ae){_0x3457ae[_0xc6c2('0x123')](path[_0xc6c2('0x124')](_0x30ad0b[_0xc6c2('0x122')](_0xc6c2('0x125'))+_0xc6c2('0x126')));});};var sensitiveFields=[_0xc6c2('0x127'),_0xc6c2('0x128'),_0xc6c2('0x129'),_0xc6c2('0x12a'),_0xc6c2('0x12b'),_0xc6c2('0x12c'),'street',_0xc6c2('0x12d'),_0xc6c2('0x12e'),_0xc6c2('0x12f'),_0xc6c2('0x130'),_0xc6c2('0x131'),_0xc6c2('0x132'),_0xc6c2('0x133'),_0xc6c2('0x134'),_0xc6c2('0x135'),_0xc6c2('0x136'),'token',_0xc6c2('0x137'),_0xc6c2('0x138'),'accessTokenSecret','authToken',_0xc6c2('0x139'),_0xc6c2('0x13a'),_0xc6c2('0x13b'),_0xc6c2('0x13c'),_0xc6c2('0x13d'),_0xc6c2('0x13e'),_0xc6c2('0x13f'),'clientEmail',_0xc6c2('0x140'),'accesskeyid','secretaccesskey',_0xc6c2('0x141'),'user',_0xc6c2('0x142'),_0xc6c2('0x143'),_0xc6c2('0x144'),_0xc6c2('0x145'),'secret',_0xc6c2('0x146'),_0xc6c2('0x147')];function maskSensitiveData(_0x90b7b0){var _0x299f1e=/(?!^)[\s\S](?!$)/g;if(!_[_0xc6c2('0x148')](_0x90b7b0))return;for(var _0x144f47 in _0x90b7b0){if(_[_0xc6c2('0x149')](_0x90b7b0[_0x144f47])){for(var _0x34003f=0x0;_0x34003f<_0x90b7b0[_0x144f47][_0xc6c2('0x14a')];_0x34003f++){maskSensitiveData(_0x90b7b0[_0x144f47][_0x34003f]);}}else if(_[_0xc6c2('0x148')](_0x90b7b0[_0x144f47])){maskSensitiveData(_0x90b7b0[_0x144f47]);}else if(_[_0xc6c2('0x14b')](_0x90b7b0[_0x144f47])){_0x90b7b0[_0x144f47]=_0x90b7b0[_0x144f47][_0xc6c2('0x14c')](/{{{/g,_0xc6c2('0x14d'))[_0xc6c2('0x14c')](/}}}/g,'}@@')[_0xc6c2('0x14c')](/{{/g,'@{')[_0xc6c2('0x14c')](/}}/g,'}@');if(_[_0xc6c2('0x14e')](sensitiveFields,_0x144f47)){_0x90b7b0[_0x144f47]=_0x90b7b0[_0x144f47][_0xc6c2('0x14c')](_0x299f1e,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index ab79d7f..18503f5 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89b5=['../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc'];(function(_0x26a74d,_0x37ecfc){var _0xcbb1a3=function(_0x24b978){while(--_0x24b978){_0x26a74d['push'](_0x26a74d['shift']());}};_0xcbb1a3(++_0x37ecfc);}(_0x89b5,0x112));var _0x589b=function(_0x12b82e,_0x1a955f){_0x12b82e=_0x12b82e-0x0;var _0x215209=_0x89b5[_0x12b82e];return _0x215209;};'use strict';var jayson=require(_0x589b('0x0'));var BPromise=require(_0x589b('0x1'));var _=require(_0x589b('0x2'));var config=require('../config/environment');exports[_0x589b('0x3')]=function(){return new BPromise(function(_0x177126,_0x413592){var _0x361828={};_0x361828=_['merge'](_0x361828,require(_0x589b('0x4')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x6')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x7')));_0x361828=_[_0x589b('0x5')](_0x361828,require('../api/voiceRecording/voiceRecording.rpc'));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x8')));_0x361828=_['merge'](_0x361828,require(_0x589b('0x9')));_0x361828=_['merge'](_0x361828,require(_0x589b('0xa')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0xb')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0xc')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0xd')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0xe')));_0x361828=_['merge'](_0x361828,require(_0x589b('0xf')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x10')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x11')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x12')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x13')));_0x361828=_[_0x589b('0x5')](_0x361828,require('../api/mailMessage/mailMessage.rpc'));_0x361828=_['merge'](_0x361828,require(_0x589b('0x14')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x15')));_0x361828=_['merge'](_0x361828,require('../api/faxAccount/faxAccount.rpc'));_0x361828=_[_0x589b('0x5')](_0x361828,require('../api/faxApplication/faxApplication.rpc'));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x16')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x17')));_0x361828=_['merge'](_0x361828,require(_0x589b('0x18')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x19')));_0x361828=_['merge'](_0x361828,require(_0x589b('0x1a')));_0x361828=_[_0x589b('0x5')](_0x361828,require('../api/smsInteraction/smsInteraction.rpc'));_0x361828=_['merge'](_0x361828,require(_0x589b('0x1b')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x1c')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x1d')));_0x361828=_[_0x589b('0x5')](_0x361828,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x361828=_['merge'](_0x361828,require(_0x589b('0x1e')));_0x361828=_[_0x589b('0x5')](_0x361828,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x361828=_['merge'](_0x361828,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x1f')));_0x361828=_['merge'](_0x361828,require(_0x589b('0x20')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x21')));_0x361828=_['merge'](_0x361828,require(_0x589b('0x22')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x23')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x24')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x25')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x26')));_0x361828=_['merge'](_0x361828,require(_0x589b('0x27')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x28')));_0x361828=_['merge'](_0x361828,require(_0x589b('0x29')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x2a')));_0x361828=_['merge'](_0x361828,require(_0x589b('0x2b')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x2c')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x2d')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x2e')));_0x361828=_['merge'](_0x361828,require(_0x589b('0x2f')));_0x361828=_[_0x589b('0x5')](_0x361828,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x361828=_['merge'](_0x361828,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x30')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x31')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x32')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x33')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x34')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x35')));_0x361828=_['merge'](_0x361828,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x361828=_['merge'](_0x361828,require(_0x589b('0x36')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x37')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x38')));_0x361828=_[_0x589b('0x5')](_0x361828,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x361828=_[_0x589b('0x5')](_0x361828,require('../api/setting/setting.rpc'));_0x361828=_['merge'](_0x361828,require(_0x589b('0x39')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x3a')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x3b')));_0x361828=_['merge'](_0x361828,require('../api/squareMessage/squareMessage.rpc'));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x3c')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x3d')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x3e')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x3f')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x40')));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x41')));_0x361828=_[_0x589b('0x5')](_0x361828,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x361828=_[_0x589b('0x5')](_0x361828,require(_0x589b('0x42')));var _0x1873b9=jayson[_0x589b('0x43')](_0x361828)[_0x589b('0x44')]();var _0x2e5614=config[_0x589b('0x45')][_0x589b('0x46')]||config[_0x589b('0x46')]+0x1;var _0x100ec7=config[_0x589b('0x45')]['ip']||'localhost';_0x1873b9['on'](_0x589b('0x47'),function(_0x30255c){return _0x413592(_0x30255c);});_0x1873b9[_0x589b('0x3')](_0x2e5614,_0x100ec7,function(){console[_0x589b('0x48')](_0x589b('0x49'),_0x100ec7,_0x2e5614);require(_0x589b('0x4a'))[_0x589b('0x4b')]();return _0x177126(_0x589b('0x4c')+_0x100ec7+':'+_0x2e5614);});});}; \ No newline at end of file +var _0x2931=['../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','bluebird','lodash','../config/environment','listen','merge','../api/user/user.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/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc'];(function(_0x138c93,_0x16c108){var _0x3d56d0=function(_0x4233ce){while(--_0x4233ce){_0x138c93['push'](_0x138c93['shift']());}};_0x3d56d0(++_0x16c108);}(_0x2931,0x101));var _0x1293=function(_0x3054ae,_0x5cb0bb){_0x3054ae=_0x3054ae-0x0;var _0xa72ff0=_0x2931[_0x3054ae];return _0xa72ff0;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1293('0x0'));var _=require(_0x1293('0x1'));var config=require(_0x1293('0x2'));exports[_0x1293('0x3')]=function(){return new BPromise(function(_0x1a34ee,_0xaad30a){var _0x321a0e={};_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x5')));_0x321a0e=_['merge'](_0x321a0e,require('../api/voiceExtension/voiceExtension.rpc'));_0x321a0e=_['merge'](_0x321a0e,require(_0x1293('0x6')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x7')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x8')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x9')));_0x321a0e=_['merge'](_0x321a0e,require(_0x1293('0xa')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0xb')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0xc')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0xd')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0xe')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0xf')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x10')));_0x321a0e=_['merge'](_0x321a0e,require(_0x1293('0x11')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x12')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x13')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x14')));_0x321a0e=_['merge'](_0x321a0e,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x15')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x16')));_0x321a0e=_['merge'](_0x321a0e,require(_0x1293('0x17')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require('../api/faxMessage/faxMessage.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require('../api/faxQueue/faxQueue.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x18')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x19')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x1a')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require('../api/smsMessage/smsMessage.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x1b')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x1c')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x1d')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x1e')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x1f')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x20')));_0x321a0e=_['merge'](_0x321a0e,require(_0x1293('0x21')));_0x321a0e=_['merge'](_0x321a0e,require('../api/chatQueue/chatQueue.rpc'));_0x321a0e=_['merge'](_0x321a0e,require('../api/cmContact/cmContact.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x22')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x23')));_0x321a0e=_['merge'](_0x321a0e,require(_0x1293('0x24')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x25')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x26')));_0x321a0e=_['merge'](_0x321a0e,require('../api/interval/interval.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x27')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require('../api/sound/sound.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x28')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x29')));_0x321a0e=_['merge'](_0x321a0e,require(_0x1293('0x2a')));_0x321a0e=_['merge'](_0x321a0e,require('../api/variable/variable.rpc'));_0x321a0e=_['merge'](_0x321a0e,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x321a0e=_['merge'](_0x321a0e,require(_0x1293('0x2b')));_0x321a0e=_['merge'](_0x321a0e,require(_0x1293('0x2c')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x2d')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x2e')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x2f')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x321a0e=_['merge'](_0x321a0e,require(_0x1293('0x30')));_0x321a0e=_['merge'](_0x321a0e,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x321a0e=_['merge'](_0x321a0e,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x31')));_0x321a0e=_['merge'](_0x321a0e,require(_0x1293('0x32')));_0x321a0e=_['merge'](_0x321a0e,require(_0x1293('0x33')));_0x321a0e=_['merge'](_0x321a0e,require('../api/squareOdbc/squareOdbc.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x34')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x35')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x36')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x37')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x38')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require('../api/plugin/plugin.rpc'));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x39')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x3a')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x3b')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x3c')));_0x321a0e=_[_0x1293('0x4')](_0x321a0e,require(_0x1293('0x3d')));var _0x568770=jayson[_0x1293('0x3e')](_0x321a0e)[_0x1293('0x3f')]();var _0x2086f8=config['rpc'][_0x1293('0x40')]||config[_0x1293('0x40')]+0x1;var _0xa258e1=config['rpc']['ip']||_0x1293('0x41');_0x568770['on'](_0x1293('0x42'),function(_0x51f64d){return _0xaad30a(_0x51f64d);});_0x568770[_0x1293('0x3')](_0x2086f8,_0xa258e1,function(){console[_0x1293('0x43')](_0x1293('0x44'),_0xa258e1,_0x2086f8);require(_0x1293('0x45'))['default']();return _0x1a34ee(_0x1293('0x46')+_0xa258e1+':'+_0x2086f8);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index c2138d5..17007d9 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 _0x0713=['noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','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','setExtension','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','label','exports','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','result=','substr','indexOf','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','inherits','prototype','sendRequest','sync','answer','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s'];(function(_0x112e53,_0x1a24ca){var _0x139aa7=function(_0x2723c5){while(--_0x2723c5){_0x112e53['push'](_0x112e53['shift']());}};_0x139aa7(++_0x1a24ca);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x3071('0x0'))[_0x3071('0x1')];var AGIReply=require(_0x3071('0x2'));var AGIError=require(_0x3071('0x3'));function AGIChannel(_0x864539){var _0x52b5fb=this,_0x2c547f=new AGIReply(),_0x7b18a4=![],_0x33a70c={};EventEmitter[_0x3071('0x4')](_0x52b5fb);_0x864539[_0x3071('0x5')](_0x3071('0x6'));_0x864539[_0x3071('0x7')](0x8*0x3c*0x3c*0x3e8);_0x2c547f[_0x3071('0x5')](_0x3071('0x6'));_0x2c547f['on'](_0x3071('0x8'),function(_0x3e9a5e){for(var _0x2fce7a in _0x3e9a5e){_0x52b5fb[_0x2fce7a]=_0x3e9a5e[_0x2fce7a];}_0x52b5fb[_0x3071('0x9')]('ready');});_0x2c547f['on'](_0x3071('0xa'),function(_0x2610b4){if(_0x2610b4[_0x3071('0xb')]()==_0x3071('0xc')){_0x52b5fb[_0x3071('0x9')]('hangup');return;}if(_0x2610b4[_0x3071('0xd')](0x0,0xb)==_0x3071('0xe')){_0x7b18a4=!![];}if(_0x7b18a4){_0x33a70c['rx']+=_0x2610b4+'\x0a';if(_0x2610b4[_0x3071('0xf')](_0x3071('0x10'))!=-0x1){_0x7b18a4=![];}}else{_0x33a70c['rx']=_0x2610b4;}if(_0x7b18a4){return;}if(typeof _0x33a70c['cb']==_0x3071('0x11')){var _0x4a8cc7=_0x33a70c['rx']['substring'](0x0,0x3),_0x5330a8=null,_0x1826ca=null;_0x4a8cc7=parseInt(_0x4a8cc7);if(isNaN(_0x4a8cc7)){_0x33a70c['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x3071('0x12')});return;}if(_0x4a8cc7!=0xc8){_0x33a70c['cb'](null,{'code':_0x4a8cc7,'result':-0x1,'extra':'KO'});return;}_0x5330a8=_0x33a70c['rx'][_0x3071('0xd')](0x4)['replace'](_0x3071('0x13'),'');if(_0x5330a8['indexOf']('\x20')!=-0x1){_0x5330a8=_0x5330a8[_0x3071('0x14')](0x0,_0x5330a8[_0x3071('0x15')]('\x20'));}if(_[_0x3071('0x16')](_0x5330a8,'-1')){_0x5330a8=parseInt(_0x5330a8);}_0x1826ca=_0x33a70c['rx'][_0x3071('0x17')]('\x20');if(_0x1826ca[_0x3071('0x18')]==0x3){_0x1826ca=_0x1826ca[0x2][_0x3071('0xd')](0x1,_0x1826ca[0x2][_0x3071('0x18')]-0x1);}else if(_0x1826ca[_0x3071('0x18')]>0x3){var _0x21aad3=/\((.+)\)/;var _0x344ea6=_0x33a70c['rx']['match'](_0x21aad3);if(_0x344ea6){_0x1826ca=_0x344ea6[0x1];}else{_0x1826ca=null;}}else{_0x1826ca=null;}_0x33a70c['cb'](null,{'code':_0x4a8cc7,'result':_0x5330a8,'extra':_0x1826ca});}});_0x864539['on'](_0x3071('0x19'),function(_0x17dbda){_0x52b5fb[_0x3071('0x9')](_0x3071('0x19'),new AGIError(_0x3071('0x1a'),_0x17dbda[_0x3071('0x1b')]));});_0x864539['on'](_0x3071('0x1c'),function(){_0x52b5fb[_0x3071('0x9')]('close',new AGIError(_0x3071('0x1d')));});_0x864539['on'](_0x3071('0x1e'),function(){_0x52b5fb[_0x3071('0x9')]('timeout',new AGIError(_0x3071('0x1f')));_0x864539['destroy']();});_0x864539[_0x3071('0x20')](_0x2c547f);this[_0x3071('0x21')]=function(_0x3762d8,_0x457b57){var _0x3762d8=_0x3762d8||'',_0x457b57=typeof _0x457b57==_0x3071('0x11')?_0x457b57:new Function();_0x33a70c={'tx':_0x3762d8,'rx':'','cb':_0x457b57};_0x864539[_0x3071('0x22')](_0x3762d8+'\x0a');},this['close']=function(){_0x864539['destroy']();};}util[_0x3071('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x3071('0x24')][_0x3071('0x25')]=function(_0x13df9f){return this[_0x3071('0x21')][_0x3071('0x26')](this,_0x13df9f);};AGIChannel[_0x3071('0x24')][_0x3071('0x27')]=function(){return this[_0x3071('0x25')]('ANSWER');};AGIChannel[_0x3071('0x24')][_0x3071('0x28')]=function(_0x177138,_0x4d5c4b,_0x4fb1ca){_0x177138=_0x177138===undefined?_0x3071('0x29'):_0x177138;_0x4d5c4b=_0x4d5c4b===undefined?'5':_0x4d5c4b;_0x4fb1ca=_0x4fb1ca===undefined?'1':_0x4fb1ca;return this[_0x3071('0x25')](util[_0x3071('0x2a')](_0x3071('0x2b'),_0x177138,_0x4d5c4b*0x3e8,_0x4fb1ca));};AGIChannel[_0x3071('0x24')][_0x3071('0x2c')]=function(_0x3921a1){_0x3921a1=_0x3921a1||_0x3071('0x2d');return this[_0x3071('0x25')](util[_0x3071('0x2a')]('VERBOSE\x20\x22%s\x22',_0x3921a1));};AGIChannel['prototype'][_0x3071('0x2e')]=function(_0x149e0d,_0x6ddf96){if(_[_0x3071('0x2f')](_0x6ddf96)){return this[_0x3071('0x25')](util[_0x3071('0x2a')](_0x3071('0x30'),_0x149e0d,_0x6ddf96[_0x3071('0x31')](',')));}return this['sendRequest'](util['format']('EXEC\x20%s\x20%s',_0x149e0d,_0x6ddf96));};AGIChannel[_0x3071('0x24')][_0x3071('0x32')]=function(_0x5b5bf1){return this[_0x3071('0x25')](util[_0x3071('0x2a')](_0x3071('0x33'),_0x5b5bf1));};AGIChannel[_0x3071('0x24')]['setExtension']=function(_0x218a82){return this[_0x3071('0x25')](util[_0x3071('0x2a')](_0x3071('0x34'),_0x218a82));};AGIChannel[_0x3071('0x24')][_0x3071('0x35')]=function(_0x3c55c){return this[_0x3071('0x25')](util['format'](_0x3071('0x36'),_0x3c55c));};AGIChannel['prototype']['hangup']=function(){return this[_0x3071('0x25')](_0x3071('0x37'));};AGIChannel['prototype'][_0x3071('0x38')]=function(_0x46e94e,_0x265d76){var _0x14ac42=_[_0x3071('0x39')](_0x265d76)||_[_0x3071('0x3a')](_0x265d76)?_0x265d76['toString']():_0x265d76;return this[_0x3071('0x25')](util[_0x3071('0x2a')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x46e94e,_0x14ac42?_0x14ac42[_0x3071('0x3b')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x3071('0x24')][_0x3071('0x3c')]=function(_0x5733e9,_0x593c99){return this[_0x3071('0x25')](util[_0x3071('0x2a')](_0x3071('0x3d'),_0x5733e9,_0x593c99));};AGIChannel['prototype'][_0x3071('0x3e')]=function(_0x534a77,_0x1ac90a){return this['sendRequest'](util[_0x3071('0x2a')](_0x3071('0x3f'),_0x534a77,_0x1ac90a));};AGIChannel[_0x3071('0x24')][_0x3071('0x40')]=function(_0x30ab68,_0x593c9c){return this['sendRequest'](util[_0x3071('0x2a')](_0x3071('0x41'),_0x30ab68,_0x593c9c));};AGIChannel[_0x3071('0x24')][_0x3071('0x42')]=function(_0x525389,_0x3cfc05,_0x60549a){_0x3cfc05=_0x3cfc05||this[_0x3071('0x43')];_0x60549a=_0x60549a||0x1;this[_0x3071('0x32')](_0x525389);this[_0x3071('0x44')](_0x3cfc05);this[_0x3071('0x35')](_0x60549a);return this['noop'](util[_0x3071('0x2a')]('GOTO\x20%s\x20%s\x20%s',_0x525389,_0x3cfc05,_0x60549a));};AGIChannel['prototype']['getVariable']=function(_0x47ceaf){return this[_0x3071('0x25')](util[_0x3071('0x2a')](_0x3071('0x45'),_0x47ceaf));};AGIChannel[_0x3071('0x24')][_0x3071('0x46')]=function(_0x3a81e9,_0xa711b5,_0x2e6c70,_0x56589e,_0x1e8222,_0x1641d9){_0xa711b5=_0xa711b5||_0x3071('0x47');_0x2e6c70=_0x2e6c70||'';_0x56589e=_0x56589e===undefined?-0x1:_0x56589e==='-1'?-0x1:_0x56589e*0x3e8;_0x1e8222=_0x1e8222===undefined?'':'s='+_0x1e8222;_0x1641d9=_0x1641d9?_0x3071('0x48'):'';return this[_0x3071('0x25')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x3a81e9,_0xa711b5,_0x2e6c70,_0x56589e,_0x1641d9,_0x1e8222));};AGIChannel[_0x3071('0x24')][_0x3071('0x49')]=function(_0x1fe5e0,_0x5c5865){_0x5c5865=_0x5c5865||'';return this[_0x3071('0x25')](util['format'](_0x3071('0x4a'),_0x1fe5e0,_0x5c5865));};AGIChannel['prototype'][_0x3071('0x4b')]=function(_0x509178){return this['exec'](_0x3071('0x4c'),_0x509178);};AGIChannel['prototype'][_0x3071('0x4d')]=function(_0x5a0a69){return this[_0x3071('0x2e')](_0x3071('0x4e'),_0x5a0a69);};AGIChannel[_0x3071('0x24')][_0x3071('0x19')]=function(_0x554047,_0x2d70bf){this['noop'](util[_0x3071('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x554047['id'],_0x554047[_0x3071('0x4f')],_0x2d70bf));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3071('0x50')]=AGIChannel; \ No newline at end of file +var _0xa9e0=['utf8','setTimeout','setEncoding','ready','line','toLowerCase','hangup','emit','520\x20End\x20of\x20proper','function','substring','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','write','inherits','prototype','sendRequest','command','sync','ANSWER','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','label','exports','util','lodash','events','./error','call'];(function(_0x32f7ef,_0x2a139e){var _0x4d1051=function(_0x174216){while(--_0x174216){_0x32f7ef['push'](_0x32f7ef['shift']());}};_0x4d1051(++_0x2a139e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x0a9e('0x3'));function AGIChannel(_0x4ce2f1){var _0x333808=this,_0x432180=new AGIReply(),_0x2ab90b=![],_0x991246={};EventEmitter[_0x0a9e('0x4')](_0x333808);_0x4ce2f1['setEncoding'](_0x0a9e('0x5'));_0x4ce2f1[_0x0a9e('0x6')](0x8*0x3c*0x3c*0x3e8);_0x432180[_0x0a9e('0x7')]('utf8');_0x432180['on']('headers',function(_0xe42b77){for(var _0x56465b in _0xe42b77){_0x333808[_0x56465b]=_0xe42b77[_0x56465b];}_0x333808['emit'](_0x0a9e('0x8'));});_0x432180['on'](_0x0a9e('0x9'),function(_0x307b3e){if(_0x307b3e[_0x0a9e('0xa')]()==_0x0a9e('0xb')){_0x333808[_0x0a9e('0xc')]('hangup');return;}if(_0x307b3e['substring'](0x0,0xb)=='520-Invalid'){_0x2ab90b=!![];}if(_0x2ab90b){_0x991246['rx']+=_0x307b3e+'\x0a';if(_0x307b3e['search'](_0x0a9e('0xd'))!=-0x1){_0x2ab90b=![];}}else{_0x991246['rx']=_0x307b3e;}if(_0x2ab90b){return;}if(typeof _0x991246['cb']==_0x0a9e('0xe')){var _0xd5b662=_0x991246['rx'][_0x0a9e('0xf')](0x0,0x3),_0x26d672=null,_0x32d742=null;_0xd5b662=parseInt(_0xd5b662);if(isNaN(_0xd5b662)){_0x991246['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xd5b662!=0xc8){_0x991246['cb'](null,{'code':_0xd5b662,'result':-0x1,'extra':'KO'});return;}_0x26d672=_0x991246['rx'][_0x0a9e('0xf')](0x4)[_0x0a9e('0x10')](_0x0a9e('0x11'),'');if(_0x26d672[_0x0a9e('0x12')]('\x20')!=-0x1){_0x26d672=_0x26d672[_0x0a9e('0x13')](0x0,_0x26d672[_0x0a9e('0x12')]('\x20'));}if(_['startsWith'](_0x26d672,'-1')){_0x26d672=parseInt(_0x26d672);}_0x32d742=_0x991246['rx'][_0x0a9e('0x14')]('\x20');if(_0x32d742['length']==0x3){_0x32d742=_0x32d742[0x2][_0x0a9e('0xf')](0x1,_0x32d742[0x2]['length']-0x1);}else if(_0x32d742[_0x0a9e('0x15')]>0x3){var _0x12066b=/\((.+)\)/;var _0x48f32d=_0x991246['rx'][_0x0a9e('0x16')](_0x12066b);if(_0x48f32d){_0x32d742=_0x48f32d[0x1];}else{_0x32d742=null;}}else{_0x32d742=null;}_0x991246['cb'](null,{'code':_0xd5b662,'result':_0x26d672,'extra':_0x32d742});}});_0x4ce2f1['on']('error',function(_0x459eb1){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x17'),new AGIError(_0x0a9e('0x18'),_0x459eb1[_0x0a9e('0x19')]));});_0x4ce2f1['on'](_0x0a9e('0x1a'),function(){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x1a'),new AGIError(_0x0a9e('0x1b')));});_0x4ce2f1['on'](_0x0a9e('0x1c'),function(){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x4ce2f1[_0x0a9e('0x1d')]();});_0x4ce2f1[_0x0a9e('0x1e')](_0x432180);this['command']=function(_0x20f109,_0x5a09ef){var _0x20f109=_0x20f109||'',_0x5a09ef=typeof _0x5a09ef==_0x0a9e('0xe')?_0x5a09ef:new Function();_0x991246={'tx':_0x20f109,'rx':'','cb':_0x5a09ef};_0x4ce2f1[_0x0a9e('0x1f')](_0x20f109+'\x0a');},this[_0x0a9e('0x1a')]=function(){_0x4ce2f1['destroy']();};}util[_0x0a9e('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x22')]=function(_0x4d00e6){return this[_0x0a9e('0x23')][_0x0a9e('0x24')](this,_0x4d00e6);};AGIChannel[_0x0a9e('0x21')]['answer']=function(){return this['sendRequest'](_0x0a9e('0x25'));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x26')]=function(_0x33161b,_0x526cf3,_0x384319){_0x33161b=_0x33161b===undefined?'beep':_0x33161b;_0x526cf3=_0x526cf3===undefined?'5':_0x526cf3;_0x384319=_0x384319===undefined?'1':_0x384319;return this[_0x0a9e('0x22')](util['format'](_0x0a9e('0x27'),_0x33161b,_0x526cf3*0x3e8,_0x384319));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x28')]=function(_0x14433c){_0x14433c=_0x14433c||_0x0a9e('0x29');return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x14433c));};AGIChannel['prototype'][_0x0a9e('0x2c')]=function(_0x468813,_0x2b1f27){if(_[_0x0a9e('0x2d')](_0x2b1f27)){return this['sendRequest'](util[_0x0a9e('0x2a')](_0x0a9e('0x2e'),_0x468813,_0x2b1f27[_0x0a9e('0x2f')](',')));}return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x2e'),_0x468813,_0x2b1f27));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x30')]=function(_0x1dbde2){return this['sendRequest'](util[_0x0a9e('0x2a')]('SET\x20CONTEXT\x20%s',_0x1dbde2));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x31')]=function(_0x1122db){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SET\x20EXTENSION\x20%s',_0x1122db));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x32')]=function(_0x40cb85){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x33'),_0x40cb85));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0xb')]=function(){return this['sendRequest'](_0x0a9e('0x34'));};AGIChannel['prototype'][_0x0a9e('0x35')]=function(_0x14b13f,_0x2b7e7f){var _0x3f3d41=_['isBoolean'](_0x2b7e7f)||_[_0x0a9e('0x36')](_0x2b7e7f)?_0x2b7e7f[_0x0a9e('0x37')]():_0x2b7e7f;return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x14b13f,_0x3f3d41?_0x3f3d41['toString']()[_0x0a9e('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){return this[_0x0a9e('0x22')](util['format'](_0x0a9e('0x39'),_0x3d9717,_0x381c37));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x3a')]=function(_0x533942,_0x1dbf74){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x533942,_0x1dbf74));};AGIChannel['prototype'][_0x0a9e('0x3b')]=function(_0x40d766,_0x5adda1){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x3c'),_0x40d766,_0x5adda1));};AGIChannel[_0x0a9e('0x21')]['continueAt']=function(_0x5a594b,_0x15e37d,_0x45b3d0){_0x15e37d=_0x15e37d||this['extension'];_0x45b3d0=_0x45b3d0||0x1;this[_0x0a9e('0x30')](_0x5a594b);this[_0x0a9e('0x31')](_0x15e37d);this[_0x0a9e('0x32')](_0x45b3d0);return this['noop'](util[_0x0a9e('0x2a')](_0x0a9e('0x3d'),_0x5a594b,_0x15e37d,_0x45b3d0));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x3e')]=function(_0x13cb1f){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x3f'),_0x13cb1f));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x40')]=function(_0x2c3711,_0x148007,_0x1a7bce,_0x11ca30,_0x37f6cc,_0x4d04c8){_0x148007=_0x148007||'wav';_0x1a7bce=_0x1a7bce||'';_0x11ca30=_0x11ca30===undefined?-0x1:_0x11ca30==='-1'?-0x1:_0x11ca30*0x3e8;_0x37f6cc=_0x37f6cc===undefined?'':'s='+_0x37f6cc;_0x4d04c8=_0x4d04c8?_0x0a9e('0x41'):'';return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x42'),_0x2c3711,_0x148007,_0x1a7bce,_0x11ca30,_0x4d04c8,_0x37f6cc));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x43')]=function(_0x10b040,_0x445e25){_0x445e25=_0x445e25||'';return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x44'),_0x10b040,_0x445e25));};AGIChannel[_0x0a9e('0x21')]['agi']=function(_0x117c99){return this[_0x0a9e('0x2c')](_0x0a9e('0x45'),_0x117c99);};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x46')]=function(_0xbe9d19){return this[_0x0a9e('0x2c')](_0x0a9e('0x47'),_0xbe9d19);};AGIChannel['prototype'][_0x0a9e('0x17')]=function(_0x48fd45,_0x473dc8){this[_0x0a9e('0x28')](util[_0x0a9e('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x48fd45['id'],_0x48fd45[_0x0a9e('0x48')],_0x473dc8));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0a9e('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 0df39f8..516f71a 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 _0x92f0=['message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x92f0,0x10d));var _0x092f=function(_0x2bc2a2,_0x51e95f){_0x2bc2a2=_0x2bc2a2-0x0;var _0x20de67=_0x92f0[_0x2bc2a2];return _0x20de67;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x092f('0x0'),'E_AGI_ARGUMENT_PORT':_0x092f('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x092f('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x092f('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x092f('0x4'),'E_AGI_SOCKET_TIMEOUT':_0x092f('0x5'),'E_AGI_COMMAND_EMPTY':_0x092f('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x092f('0x7'),'E_AGI_IVR_ENTRY':_0x092f('0x8')};function AGIError(_0x2b6dcb){var _0x2b6dcb=_0x2b6dcb||null,_0x434211=_0x434211||[],_0x542b99=0x1,_0x1825f7='';if(!error[_0x2b6dcb]){_0x2b6dcb='E_AGI_UNDEFINED';}_0x434211[_0x092f('0x9')](error[_0x2b6dcb]);while(arguments[_0x542b99]){_0x434211['push'](arguments[_0x542b99]);_0x542b99++;}_0x1825f7=util[_0x092f('0xa')]['apply'](util,_0x434211);this[_0x092f('0xb')]=_0x1825f7;this[_0x092f('0xc')]=_0x2b6dcb;}module[_0x092f('0xd')]=AGIError; \ No newline at end of file +var _0xb28a=['Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.'];(function(_0x4d82b2,_0x4a1269){var _0x45b964=function(_0x584e40){while(--_0x584e40){_0x4d82b2['push'](_0x4d82b2['shift']());}};_0x45b964(++_0x4a1269);}(_0xb28a,0x166));var _0xab28=function(_0x22b099,_0x2f69ba){_0x22b099=_0x22b099-0x0;var _0x5652c7=_0xb28a[_0x22b099];return _0x5652c7;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xab28('0x0'),'E_AGI_ARGUMENT_PORT':_0xab28('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xab28('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xab28('0x3'),'E_AGI_SOCKET_TIMEOUT':_0xab28('0x4'),'E_AGI_COMMAND_EMPTY':_0xab28('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xab28('0x6'),'E_AGI_IVR_ENTRY':_0xab28('0x7')};function AGIError(_0x128a13){var _0x128a13=_0x128a13||null,_0x3b2507=_0x3b2507||[],_0x48949b=0x1,_0x479267='';if(!error[_0x128a13]){_0x128a13=_0xab28('0x8');}_0x3b2507[_0xab28('0x9')](error[_0x128a13]);while(arguments[_0x48949b]){_0x3b2507[_0xab28('0x9')](arguments[_0x48949b]);_0x48949b++;}_0x479267=util[_0xab28('0xa')][_0xab28('0xb')](util,_0x3b2507);this[_0xab28('0xc')]=_0x479267;this['name']=_0x128a13;}module[_0xab28('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index dfc5861..5628a4b 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 _0x34b7=['no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','agi','menu','getdigits','getsecretdigits','vertices','edges','addVertex','prototype','addEdge','size','relations','numberOfEdges','getVertex','traverseBFS'];(function(_0x43f387,_0x398ff0){var _0x11de6c=function(_0x583c27){while(--_0x583c27){_0x43f387['push'](_0x43f387['shift']());}};_0x11de6c(++_0x398ff0);}(_0x34b7,0x196));var _0x734b=function(_0x5811f0,_0x13ba47){_0x5811f0=_0x5811f0-0x0;var _0x3f7013=_0x34b7[_0x5811f0];return _0x3f7013;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0x734b('0x0'));var verticesWithRetry=[_0x734b('0x1'),_0x734b('0x2'),_0x734b('0x3')];var Graph=function(){this[_0x734b('0x4')]={};this[_0x734b('0x5')]={};this['numberOfEdges']=0x0;};Graph['prototype'][_0x734b('0x6')]=function(_0x2fde69){this[_0x734b('0x4')][_0x2fde69['id']]=_0x2fde69;this[_0x734b('0x5')][_0x2fde69['id']]=[];};Graph[_0x734b('0x7')][_0x734b('0x8')]=function(_0x58e2f1,_0x1eb803,_0x2e7932){this['edges'][_0x58e2f1]['push']({'target':_0x1eb803,'condition':_0x2e7932});this['numberOfEdges']+=0x1;};Graph[_0x734b('0x7')]['size']=function(){return _[_0x734b('0x9')](this[_0x734b('0x4')]);};Graph[_0x734b('0x7')][_0x734b('0xa')]=function(){return this[_0x734b('0xb')];};Graph[_0x734b('0x7')][_0x734b('0xc')]=function(_0x32e0c2){return this[_0x734b('0x4')][_0x32e0c2];};Graph[_0x734b('0x7')][_0x734b('0xd')]=function(_0xff9ddf,_0x145ec3){if(!this[_0x734b('0x4')][_0xff9ddf]){return logger['info'](_0x734b('0xe'));}var _0x252510=_0x145ec3(this[_0x734b('0x4')][_0xff9ddf]);if(!_0x252510){return logger[_0x734b('0xf')](_0x734b('0x10'));}if(this[_0x734b('0x5')][_0xff9ddf][_0x734b('0x11')]===0x0){return logger[_0x734b('0xf')](_0x734b('0x12'));}for(var _0x4b8c63=0x0,_0x42407a=[],_0x4d2d23=![];_0x4b8c63\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','agicommand','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','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','lodash','syncho','util','moment','../../config/environment','../../config/license/util','./rpc','./graph','./vertices','defaults','agi','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','message','format','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','getSquareProject','then','catch','createSquareReport','indexOf','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','sync','production','start','root'];(function(_0x3bec69,_0x46371f){var _0x5c7b82=function(_0x37b398){while(--_0x37b398){_0x3bec69['push'](_0x3bec69['shift']());}};_0x5c7b82(++_0x46371f);}(_0x4ab0,0xd5));var _0x04ab=function(_0x171135,_0x191e8d){_0x171135=_0x171135-0x0;var _0x40ca62=_0x4ab0[_0x171135];return _0x40ca62;};'use strict';var parser=require('xml2json');var _=require(_0x04ab('0x0'));var syncho=require(_0x04ab('0x1'));var util=require(_0x04ab('0x2'));var moment=require(_0x04ab('0x3'));var config=require(_0x04ab('0x4'));var logger=require('../../config/logger')('agi');var utilLicense=require(_0x04ab('0x5'));var rpc=require(_0x04ab('0x6'));var mailRpc=require('./mailRpc');var Graph=require(_0x04ab('0x7'));var Vertices=require(_0x04ab('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x04ab('0x9')](config[_0x04ab('0xa')],{'ip':_0x04ab('0xb'),'port':0x11dd});function connectionHandler(_0x4bc05e){process[_0x04ab('0xc')](function(){syncho(function(){try{setChannelVariables(_0x4bc05e);agiHandler(_0x4bc05e);}catch(_0x2b3754){logger[_0x04ab('0xd')](_0x2b3754[_0x04ab('0xe')]);}});});}function listeningHandler(){console['log'](_0x04ab('0xf'),config[_0x04ab('0xa')][_0x04ab('0x10')]);logger[_0x04ab('0x11')](util['format'](_0x04ab('0x12'),config[_0x04ab('0xa')]['ip'],config[_0x04ab('0xa')][_0x04ab('0x10')]));}function errorHandler(_0x1c58f3){if(_0x1c58f3&&_0x1c58f3[_0x04ab('0x13')]&&_0x1c58f3['message']){logger[_0x04ab('0xd')](util['format'](_0x04ab('0x14'),_0x1c58f3[_0x04ab('0x13')],_0x1c58f3[_0x04ab('0x15')]));}else{logger[_0x04ab('0xd')](util['format']('[ERROR]\x20%s',_0x1c58f3['stack']));}}function closeHandler(){logger[_0x04ab('0x11')](util[_0x04ab('0x16')](_0x04ab('0x17'),this[_0x04ab('0x18')],this[_0x04ab('0x19')],this[_0x04ab('0x1a')],this[_0x04ab('0x1b')],this[_0x04ab('0x1c')]));try{createSquareReport(this);}catch(_0x1f3251){logger[_0x04ab('0xd')](_0x1f3251['stack']);}}function timeoutHandler(){logger[_0x04ab('0x11')](util[_0x04ab('0x16')](_0x04ab('0x1d'),this[_0x04ab('0x18')],this[_0x04ab('0x19')],this[_0x04ab('0x1a')],this[_0x04ab('0x1b')],this[_0x04ab('0x1c')]));}function hangupHandler(){logger[_0x04ab('0x11')](util['format'](_0x04ab('0x1e'),this['arg_1'],this[_0x04ab('0x19')],this[_0x04ab('0x1a')],this[_0x04ab('0x1b')],this['uniqueid']));this[_0x04ab('0x1f')]=!![];}function getRoot(_0x1c08f4){return parser[_0x04ab('0x20')](_0x1c08f4,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0xc8358e,_0x2f614a,_0x5885bd){_0x2f614a['agicommand']=_0x5885bd;if(_0x2f614a[_0x04ab('0x21')](_0x04ab('0x22'))){_0x2f614a[_0x04ab('0x23')]=parseInt(_0x2f614a[_0x04ab('0x22')],0xa);}_0xc8358e[_0x04ab('0x24')](_[_0x04ab('0x25')](_0x2f614a,_0x04ab('0x26')));}function initGraph(_0x46cec5,_0x222557){var _0x5cf1e5=new Graph();for(var _0x86bf80 in _0x46cec5){if(_0x46cec5[_0x04ab('0x21')](_0x86bf80)){if(_[_0x04ab('0x27')](_0x46cec5[_0x86bf80])){for(var _0x9ea90c=0x0;_0x9ea90c<_0x46cec5[_0x86bf80]['length'];_0x9ea90c+=0x1){addVertex(_0x5cf1e5,_0x46cec5[_0x86bf80][_0x9ea90c],_0x86bf80);}}else{addVertex(_0x5cf1e5,_0x46cec5[_0x86bf80],_0x86bf80);}}}for(var _0x530a1c=0x0;_0x530a1c<_0x222557[_0x04ab('0x28')];_0x530a1c+=0x1){if(_0x222557[_0x530a1c]['source']&&_0x222557[_0x530a1c][_0x04ab('0x29')]){_0x5cf1e5[_0x04ab('0x2a')](_0x222557[_0x530a1c][_0x04ab('0x2b')],_0x222557[_0x530a1c][_0x04ab('0x29')],_0x222557[_0x530a1c][_0x04ab('0x2c')]);}}return _0x5cf1e5;}function getSquareProject(_0x5596fc,_0x47f9be){rpc[_0x04ab('0x2d')](_0x5596fc)[_0x04ab('0x2e')](function(_0x28e77b){_0x47f9be(null,_0x28e77b);})[_0x04ab('0x2f')](function(_0x1ac676){_0x47f9be(null,_0x1ac676);});}function createSquareReport(_0x459e8c,_0x1c3dca){rpc[_0x04ab('0x30')](_0x459e8c)[_0x04ab('0x2e')](function(_0x766754){if(_0x1c3dca){_0x1c3dca(null,_0x766754);}})[_0x04ab('0x2f')](function(_0x28bfca){if(_0x1c3dca){_0x1c3dca(null,_0x28bfca);}});}function setChannelVariables(_0x2f978d){for(var _0x48b7a3 in _0x2f978d){if(_0x2f978d[_0x04ab('0x21')](_0x48b7a3)){if(_0x48b7a3[_0x04ab('0x31')]('agi_')===0x0){_0x2f978d[_0x48b7a3[_0x04ab('0x32')](0x4)]=_0x2f978d[_0x48b7a3];delete _0x2f978d[_0x48b7a3];}}}}function getLogFromObject(_0x148c76){return util['inspect'](_0x148c76,{'showHidden':![],'depth':null});}function agiHandler(_0x45ee8c){var _0x35aadf,_0x48a0b9,_0x69e081,_0x3e1750,_0x42202f;logger[_0x04ab('0x33')](_0x04ab('0x34'),JSON[_0x04ab('0x35')](_0x45ee8c,null,0x2));logger['info'](util[_0x04ab('0x16')](_0x04ab('0x36'),_0x45ee8c[_0x04ab('0x18')],_0x45ee8c['calleridname'],_0x45ee8c[_0x04ab('0x1a')],_0x45ee8c['dnid'],_0x45ee8c['uniqueid']));_0x45ee8c['on'](_0x04ab('0xd'),errorHandler);_0x45ee8c['on'](_0x04ab('0x37'),closeHandler);_0x45ee8c['on']('timeout',timeoutHandler);_0x45ee8c[_0x04ab('0x1f')]=![];_0x45ee8c['on']('hangup',hangupHandler);var _0x3c66a8=getSquareProject[_0x04ab('0x38')](null,_0x45ee8c[_0x04ab('0x18')]);if(_0x3c66a8){if(_0x3c66a8[_0x04ab('0x39')]){_0x35aadf=getRoot(_0x3c66a8[_0x04ab('0x39')]);if(_0x35aadf&&_0x35aadf[_0x04ab('0x3a')]){logger[_0x04ab('0x33')](_0x04ab('0x3b'),JSON[_0x04ab('0x35')](_0x35aadf,null,0x2));_0x45ee8c[_0x04ab('0x3c')]=moment()[_0x04ab('0x16')](_0x04ab('0x3d'));_0x48a0b9=initGraph(_['omit'](_0x35aadf,_0x04ab('0x26')),_0x35aadf[_0x04ab('0x26')]);_0x69e081=new Vertices(_0x45ee8c,rpc,mailRpc);logger['info'](util['format'](_0x04ab('0x3e'),_0x45ee8c[_0x04ab('0x18')],_0x45ee8c[_0x04ab('0x19')],_0x45ee8c[_0x04ab('0x1a')],_0x45ee8c['dnid'],_0x45ee8c[_0x04ab('0x1c')]));_0x48a0b9[_0x04ab('0x3f')](_0x35aadf[_0x04ab('0x3a')]['id'],function(_0x244acf){try{_0x244acf=_0x69e081['clear'](_0x244acf);logger[_0x04ab('0x33')](_0x04ab('0x40'),JSON[_0x04ab('0x35')](_0x244acf,null,0x2));if(_0x244acf[_0x04ab('0x41')]===_0x04ab('0x42')){logger[_0x04ab('0x11')](_0x04ab('0x43'));_0x45ee8c[_0x04ab('0x44')]=_0x244acf['context']||_0x45ee8c['context'];_0x45ee8c[_0x04ab('0x45')]=_0x244acf[_0x04ab('0x45')];_0x45ee8c[_0x04ab('0x46')]=_0x244acf[_0x04ab('0x46')]?_0x244acf[_0x04ab('0x46')]-0x1:0x1;return null;}else if(_0x244acf&&_0x69e081[_0x244acf['agicommand']]){_0x42202f=_0x69e081[_0x244acf[_0x04ab('0x41')]](_0x244acf);logger[_0x04ab('0x11')](_0x04ab('0x47'),JSON['stringify'](_0x42202f,null,0x2));if(_0x42202f&&_0x42202f[_0x04ab('0x48')]===AGI_CODE_SUCCESS&&_0x42202f[_0x04ab('0x49')]!==AGI_RESULT_ERROR&&!_0x45ee8c[_0x04ab('0x1f')]){logger[_0x04ab('0x33')](_0x04ab('0x47'),getLogFromObject(_0x42202f));return _[_0x04ab('0x4a')](_0x42202f[_0x04ab('0x49')])?null:_0x42202f[_0x04ab('0x49')][_0x04ab('0x4b')]();}else{logger[_0x04ab('0xd')]('response',getLogFromObject(_0x42202f));return null;}}else{logger[_0x04ab('0xd')](_0x04ab('0x4c'));return null;}}catch(_0x7da2b8){logger[_0x04ab('0xd')](_0x7da2b8[_0x04ab('0xe')]);return null;}});if(_0x35aadf[_0x04ab('0x4d')]){logger['info'](util[_0x04ab('0x16')](_0x04ab('0x4e'),_0x45ee8c[_0x04ab('0x18')],_0x45ee8c[_0x04ab('0x19')],_0x45ee8c['callerid'],_0x45ee8c[_0x04ab('0x1b')],_0x45ee8c[_0x04ab('0x1c')]));_0x48a0b9[_0x04ab('0x3f')](_0x35aadf[_0x04ab('0x4d')]['id'],function(_0x257123){try{_0x257123=_0x69e081['clear'](_0x257123);logger[_0x04ab('0x33')](_0x04ab('0x40'),JSON['stringify'](_0x257123,null,0x2));if(_0x257123&&_0x69e081[_0x257123['agicommand']]){_0x42202f=_0x69e081[_0x257123[_0x04ab('0x41')]](_0x257123);if(_0x42202f){logger[_0x04ab('0x33')](_0x04ab('0x47'),getLogFromObject(_0x42202f));return _[_0x04ab('0x4a')](_0x42202f[_0x04ab('0x49')])?null:_0x42202f[_0x04ab('0x49')][_0x04ab('0x4b')]();}else{logger['error'](_0x04ab('0x47'),getLogFromObject(_0x42202f));return null;}}else{logger[_0x04ab('0xd')](_0x04ab('0x4c'));return null;}}catch(_0x597673){logger[_0x04ab('0xd')](_0x597673[_0x04ab('0xe')]);return null;}});}logger['info'](util[_0x04ab('0x16')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x45ee8c[_0x04ab('0x18')],_0x45ee8c['calleridname'],_0x45ee8c[_0x04ab('0x1a')],_0x45ee8c['dnid'],_0x45ee8c['uniqueid']));logger[_0x04ab('0x11')](util[_0x04ab('0x16')](_0x04ab('0x4f'),_0x45ee8c['context'],_0x45ee8c['extension'],parseInt(_0x45ee8c[_0x04ab('0x46')],0xa)+0x1));_0x45ee8c[_0x04ab('0x50')](_0x45ee8c[_0x04ab('0x44')],_0x45ee8c['extension'],parseInt(_0x45ee8c[_0x04ab('0x46')],0xa)+0x1);_0x45ee8c['close']();}}else{logger[_0x04ab('0xd')](util[_0x04ab('0x16')](_0x04ab('0x51'),_0x45ee8c['arg_1']));_0x45ee8c[_0x04ab('0x50')](_0x45ee8c[_0x04ab('0x44')],_0x45ee8c[_0x04ab('0x45')],parseInt(_0x45ee8c[_0x04ab('0x46')],0xa)+0x1);_0x45ee8c[_0x04ab('0x37')]();}}else{logger[_0x04ab('0xd')](util[_0x04ab('0x16')](_0x04ab('0x52'),_0x45ee8c[_0x04ab('0x18')]));_0x45ee8c[_0x04ab('0x50')](_0x45ee8c[_0x04ab('0x44')],_0x45ee8c['extension'],parseInt(_0x45ee8c[_0x04ab('0x46')],0xa)+0x1);_0x45ee8c['close']();}}function main(){var _0x7b63ea;return utilLicense[_0x04ab('0x53')]()['then'](function(_0x53fa2b){if(_0x53fa2b){if(_0x53fa2b[_0x04ab('0x54')]){if(_0x53fa2b[_0x04ab('0x55')]&&_0x53fa2b[_0x04ab('0x55')]>0x0){logger[_0x04ab('0x11')](util[_0x04ab('0x16')](_0x04ab('0x56'),_0x53fa2b[_0x04ab('0x55')]));_0x7b63ea=_0x53fa2b[_0x04ab('0x55')];}else{logger[_0x04ab('0x11')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x04ab('0x11')](_0x04ab('0x57'));_0x7b63ea=-0x1;}}})[_0x04ab('0x2f')](function(_0x590cf8){logger[_0x04ab('0xd')](_0x04ab('0x58'),_0x590cf8[_0x04ab('0xe')]);})['finally'](function(){var _0x2d60c8=require(_0x04ab('0x59'))(config[_0x04ab('0xa')][_0x04ab('0x10')],config['agi']['ip'],_0x7b63ea);_0x2d60c8['on'](_0x04ab('0xd'),errorHandler);_0x2d60c8['on']('listening',listeningHandler);_0x2d60c8['on'](_0x04ab('0x5a'),connectionHandler);_0x2d60c8['on'](_0x04ab('0x37'),closeHandler);});}main(); \ No newline at end of file +var _0x79a8=['stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','evtHangup','sync','production','start','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','result','isUndefined','toString','response','agicommand\x20not\x20found','finally','[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','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','xml2json','syncho','util','moment','../../config/logger','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','agi','defaults','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','port','name','[%s]\x20%s','message','[ERROR]\x20%s','stack','arg_1','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','inspect','debug','variables'];(function(_0x2cd368,_0x4a8c24){var _0x363036=function(_0x41f907){while(--_0x41f907){_0x2cd368['push'](_0x2cd368['shift']());}};_0x363036(++_0x4a8c24);}(_0x79a8,0x1d0));var _0x879a=function(_0x3cb09b,_0x31c2a5){_0x3cb09b=_0x3cb09b-0x0;var _0x242048=_0x79a8[_0x3cb09b];return _0x242048;};'use strict';var parser=require(_0x879a('0x0'));var _=require('lodash');var syncho=require(_0x879a('0x1'));var util=require(_0x879a('0x2'));var moment=require(_0x879a('0x3'));var config=require('../../config/environment');var logger=require(_0x879a('0x4'))('agi');var utilLicense=require(_0x879a('0x5'));var rpc=require(_0x879a('0x6'));var mailRpc=require(_0x879a('0x7'));var Graph=require(_0x879a('0x8'));var Vertices=require(_0x879a('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x879a('0xa')]=_[_0x879a('0xb')](config[_0x879a('0xa')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0xe27fe6){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0xe27fe6);agiHandler(_0xe27fe6);}catch(_0x445079){logger[_0x879a('0xc')](_0x445079['stack']);}});});}function listeningHandler(){console[_0x879a('0xd')](_0x879a('0xe'),config[_0x879a('0xa')]['port']);logger[_0x879a('0xf')](util[_0x879a('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config[_0x879a('0xa')][_0x879a('0x11')]));}function errorHandler(_0x3391c8){if(_0x3391c8&&_0x3391c8[_0x879a('0x12')]&&_0x3391c8['message']){logger[_0x879a('0xc')](util[_0x879a('0x10')](_0x879a('0x13'),_0x3391c8[_0x879a('0x12')],_0x3391c8[_0x879a('0x14')]));}else{logger[_0x879a('0xc')](util[_0x879a('0x10')](_0x879a('0x15'),_0x3391c8[_0x879a('0x16')]));}}function closeHandler(){logger[_0x879a('0xf')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x879a('0x17')],this[_0x879a('0x18')],this['callerid'],this[_0x879a('0x19')],this[_0x879a('0x1a')]));try{createSquareReport(this);}catch(_0x149105){logger[_0x879a('0xc')](_0x149105[_0x879a('0x16')]);}}function timeoutHandler(){logger[_0x879a('0xf')](util[_0x879a('0x10')](_0x879a('0x1b'),this[_0x879a('0x17')],this[_0x879a('0x18')],this[_0x879a('0x1c')],this[_0x879a('0x19')],this[_0x879a('0x1a')]));}function hangupHandler(){logger[_0x879a('0xf')](util['format'](_0x879a('0x1d'),this[_0x879a('0x17')],this['calleridname'],this[_0x879a('0x1c')],this[_0x879a('0x19')],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x4ed0d6){return parser[_0x879a('0x1e')](_0x4ed0d6,{'object':!![]})[_0x879a('0x1f')][_0x879a('0x20')];}function addVertex(_0x38d42c,_0x4c3808,_0x5c21e2){_0x4c3808[_0x879a('0x21')]=_0x5c21e2;if(_0x4c3808[_0x879a('0x22')](_0x879a('0x23'))){_0x4c3808[_0x879a('0x24')]=parseInt(_0x4c3808[_0x879a('0x23')],0xa);}_0x38d42c[_0x879a('0x25')](_[_0x879a('0x26')](_0x4c3808,_0x879a('0x27')));}function initGraph(_0x358f0e,_0x2ee375){var _0x272bf9=new Graph();for(var _0x3510cc in _0x358f0e){if(_0x358f0e[_0x879a('0x22')](_0x3510cc)){if(_['isArray'](_0x358f0e[_0x3510cc])){for(var _0x51a665=0x0;_0x51a665<_0x358f0e[_0x3510cc][_0x879a('0x28')];_0x51a665+=0x1){addVertex(_0x272bf9,_0x358f0e[_0x3510cc][_0x51a665],_0x3510cc);}}else{addVertex(_0x272bf9,_0x358f0e[_0x3510cc],_0x3510cc);}}}for(var _0x92c805=0x0;_0x92c805<_0x2ee375[_0x879a('0x28')];_0x92c805+=0x1){if(_0x2ee375[_0x92c805][_0x879a('0x29')]&&_0x2ee375[_0x92c805][_0x879a('0x2a')]){_0x272bf9[_0x879a('0x2b')](_0x2ee375[_0x92c805][_0x879a('0x29')],_0x2ee375[_0x92c805][_0x879a('0x2a')],_0x2ee375[_0x92c805][_0x879a('0x2c')]);}}return _0x272bf9;}function getSquareProject(_0x2605e9,_0x1c06f8){rpc[_0x879a('0x2d')](_0x2605e9)[_0x879a('0x2e')](function(_0x99559){_0x1c06f8(null,_0x99559);})[_0x879a('0x2f')](function(_0x14c6c9){_0x1c06f8(null,_0x14c6c9);});}function createSquareReport(_0x93790b,_0x4db7dd){rpc[_0x879a('0x30')](_0x93790b)['then'](function(_0x3ac306){if(_0x4db7dd){_0x4db7dd(null,_0x3ac306);}})[_0x879a('0x2f')](function(_0x1a0358){if(_0x4db7dd){_0x4db7dd(null,_0x1a0358);}});}function setChannelVariables(_0x4d001a){for(var _0x24adad in _0x4d001a){if(_0x4d001a['hasOwnProperty'](_0x24adad)){if(_0x24adad['indexOf']('agi_')===0x0){_0x4d001a[_0x24adad['substring'](0x4)]=_0x4d001a[_0x24adad];delete _0x4d001a[_0x24adad];}}}}function getLogFromObject(_0x334361){return util[_0x879a('0x31')](_0x334361,{'showHidden':![],'depth':null});}function agiHandler(_0x4dcf18){var _0xfff69f,_0x192363,_0x146fbc,_0x4d3e7d,_0x2fd7e7;logger[_0x879a('0x32')](_0x879a('0x33'),JSON[_0x879a('0x34')](_0x4dcf18,null,0x2));logger['info'](util[_0x879a('0x10')](_0x879a('0x35'),_0x4dcf18[_0x879a('0x17')],_0x4dcf18[_0x879a('0x18')],_0x4dcf18['callerid'],_0x4dcf18[_0x879a('0x19')],_0x4dcf18['uniqueid']));_0x4dcf18['on'](_0x879a('0xc'),errorHandler);_0x4dcf18['on']('close',closeHandler);_0x4dcf18['on'](_0x879a('0x36'),timeoutHandler);_0x4dcf18[_0x879a('0x37')]=![];_0x4dcf18['on']('hangup',hangupHandler);var _0x2b80ee=getSquareProject[_0x879a('0x38')](null,_0x4dcf18[_0x879a('0x17')]);if(_0x2b80ee){if(_0x2b80ee[_0x879a('0x39')]){_0xfff69f=getRoot(_0x2b80ee['production']);if(_0xfff69f&&_0xfff69f[_0x879a('0x3a')]){logger[_0x879a('0x32')](_0x879a('0x20'),JSON['stringify'](_0xfff69f,null,0x2));_0x4dcf18['joinAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x192363=initGraph(_['omit'](_0xfff69f,_0x879a('0x27')),_0xfff69f[_0x879a('0x27')]);_0x146fbc=new Vertices(_0x4dcf18,rpc,mailRpc);logger[_0x879a('0xf')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4dcf18['arg_1'],_0x4dcf18[_0x879a('0x18')],_0x4dcf18['callerid'],_0x4dcf18[_0x879a('0x19')],_0x4dcf18[_0x879a('0x1a')]));_0x192363[_0x879a('0x3b')](_0xfff69f['start']['id'],function(_0x4f9681){try{_0x4f9681=_0x146fbc[_0x879a('0x3c')](_0x4f9681);logger['debug'](_0x879a('0x3d'),JSON[_0x879a('0x34')](_0x4f9681,null,0x2));if(_0x4f9681['agicommand']===_0x879a('0x3e')){logger[_0x879a('0xf')](_0x879a('0x3f'));_0x4dcf18['context']=_0x4f9681[_0x879a('0x40')]||_0x4dcf18[_0x879a('0x40')];_0x4dcf18['extension']=_0x4f9681[_0x879a('0x41')];_0x4dcf18[_0x879a('0x42')]=_0x4f9681['priority']?_0x4f9681[_0x879a('0x42')]-0x1:0x1;return null;}else if(_0x4f9681&&_0x146fbc[_0x4f9681[_0x879a('0x21')]]){_0x2fd7e7=_0x146fbc[_0x4f9681[_0x879a('0x21')]](_0x4f9681);logger[_0x879a('0xf')]('response',JSON[_0x879a('0x34')](_0x2fd7e7,null,0x2));if(_0x2fd7e7&&_0x2fd7e7['code']===AGI_CODE_SUCCESS&&_0x2fd7e7[_0x879a('0x43')]!==AGI_RESULT_ERROR&&!_0x4dcf18['evtHangup']){logger[_0x879a('0x32')]('response',getLogFromObject(_0x2fd7e7));return _[_0x879a('0x44')](_0x2fd7e7[_0x879a('0x43')])?null:_0x2fd7e7[_0x879a('0x43')][_0x879a('0x45')]();}else{logger[_0x879a('0xc')](_0x879a('0x46'),getLogFromObject(_0x2fd7e7));return null;}}else{logger['error'](_0x879a('0x47'));return null;}}catch(_0x26c474){logger[_0x879a('0xc')](_0x26c474['stack']);return null;}});if(_0xfff69f[_0x879a('0x48')]){logger[_0x879a('0xf')](util[_0x879a('0x10')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4dcf18[_0x879a('0x17')],_0x4dcf18[_0x879a('0x18')],_0x4dcf18[_0x879a('0x1c')],_0x4dcf18[_0x879a('0x19')],_0x4dcf18['uniqueid']));_0x192363['traverseBFS'](_0xfff69f[_0x879a('0x48')]['id'],function(_0x4159a3){try{_0x4159a3=_0x146fbc['clear'](_0x4159a3);logger[_0x879a('0x32')](_0x879a('0x3d'),JSON['stringify'](_0x4159a3,null,0x2));if(_0x4159a3&&_0x146fbc[_0x4159a3[_0x879a('0x21')]]){_0x2fd7e7=_0x146fbc[_0x4159a3[_0x879a('0x21')]](_0x4159a3);if(_0x2fd7e7){logger[_0x879a('0x32')](_0x879a('0x46'),getLogFromObject(_0x2fd7e7));return _['isUndefined'](_0x2fd7e7[_0x879a('0x43')])?null:_0x2fd7e7[_0x879a('0x43')][_0x879a('0x45')]();}else{logger['error']('response',getLogFromObject(_0x2fd7e7));return null;}}else{logger[_0x879a('0xc')](_0x879a('0x47'));return null;}}catch(_0x524f1c){logger[_0x879a('0xc')](_0x524f1c[_0x879a('0x16')]);return null;}});}logger[_0x879a('0xf')](util['format'](_0x879a('0x49'),_0x4dcf18[_0x879a('0x17')],_0x4dcf18[_0x879a('0x18')],_0x4dcf18[_0x879a('0x1c')],_0x4dcf18['dnid'],_0x4dcf18[_0x879a('0x1a')]));logger[_0x879a('0xf')](util['format'](_0x879a('0x4a'),_0x4dcf18[_0x879a('0x40')],_0x4dcf18['extension'],parseInt(_0x4dcf18['priority'],0xa)+0x1));_0x4dcf18[_0x879a('0x4b')](_0x4dcf18['context'],_0x4dcf18['extension'],parseInt(_0x4dcf18[_0x879a('0x42')],0xa)+0x1);_0x4dcf18[_0x879a('0x4c')]();}}else{logger['error'](util[_0x879a('0x10')](_0x879a('0x4d'),_0x4dcf18[_0x879a('0x17')]));_0x4dcf18['continueAt'](_0x4dcf18[_0x879a('0x40')],_0x4dcf18[_0x879a('0x41')],parseInt(_0x4dcf18[_0x879a('0x42')],0xa)+0x1);_0x4dcf18[_0x879a('0x4c')]();}}else{logger[_0x879a('0xc')](util[_0x879a('0x10')](_0x879a('0x4e'),_0x4dcf18[_0x879a('0x17')]));_0x4dcf18['continueAt'](_0x4dcf18[_0x879a('0x40')],_0x4dcf18[_0x879a('0x41')],parseInt(_0x4dcf18['priority'],0xa)+0x1);_0x4dcf18['close']();}}function main(){var _0x1d3e3c;return utilLicense['getLicense']()[_0x879a('0x2e')](function(_0x457e4e){if(_0x457e4e){if(_0x457e4e[_0x879a('0x4f')]){if(_0x457e4e[_0x879a('0x50')]&&_0x457e4e['callysquare']>0x0){logger['info'](util[_0x879a('0x10')](_0x879a('0x51'),_0x457e4e['callysquare']));_0x1d3e3c=_0x457e4e[_0x879a('0x50')];}else{logger[_0x879a('0xf')](_0x879a('0x52'));}}else{logger[_0x879a('0xf')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x1d3e3c=-0x1;}}})['catch'](function(_0x527e37){logger[_0x879a('0xc')](_0x879a('0x53'),_0x527e37['stack']);})['finally'](function(){var _0x11338c=require(_0x879a('0x54'))(config[_0x879a('0xa')][_0x879a('0x11')],config['agi']['ip'],_0x1d3e3c);_0x11338c['on'](_0x879a('0xc'),errorHandler);_0x11338c['on'](_0x879a('0x55'),listeningHandler);_0x11338c['on']('connection',connectionHandler);_0x11338c['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index eea5b3e..d2c3699 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 _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x3e1c75,_0x3123ac){var _0x5a5d41=function(_0x319214){while(--_0x319214){_0x3e1c75['push'](_0x3e1c75['shift']());}};_0x5a5d41(++_0x3123ac);}(_0x34e8,0x12c));var _0x834e=function(_0x151fa0,_0x2f0376){_0x151fa0=_0x151fa0-0x0;var _0x5eb0ca=_0x34e8[_0x151fa0];return _0x5eb0ca;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x5120a9,_0x43a68a){var _0x2903fa=function(_0x36ed87){while(--_0x36ed87){_0x5120a9['push'](_0x5120a9['shift']());}};_0x2903fa(++_0x43a68a);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 08c2203..6415da1 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 _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0xb6dab,_0x5bff55){var _0x1ec72d=function(_0x208140){while(--_0x208140){_0xb6dab['push'](_0xb6dab['shift']());}};_0x1ec72d(++_0x5bff55);}(_0x5f2f,0x73));var _0xf5f2=function(_0xf61170,_0x16f614){_0xf61170=_0xf61170-0x0;var _0x13198c=_0x5f2f[_0xf61170];return _0x13198c;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file +var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x4b6339,_0x49c545){var _0x353978=function(_0x4ad096){while(--_0x4ad096){_0x4b6339['push'](_0x4b6339['shift']());}};_0x353978(++_0x49c545);}(_0x5f2f,0x73));var _0xf5f2=function(_0x137e96,_0x301502){_0x137e96=_0x137e96-0x0;var _0x47d8f2=_0x5f2f[_0x137e96];return _0x47d8f2;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index b8cafb6..eb96787 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 _0xc9d7=['ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','phone','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','request','then','error','message','result','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','email','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById'];(function(_0x2a85e6,_0x19dca3){var _0x4e6d1a=function(_0x7c4d3e){while(--_0x7c4d3e){_0x2a85e6['push'](_0x2a85e6['shift']());}};_0x4e6d1a(++_0x19dca3);}(_0xc9d7,0x149));var _0x7c9d=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xc9d7[_0x1b6186];return _0x186121;};'use strict';var BPromise=require(_0x7c9d('0x0'));var moment=require(_0x7c9d('0x1'));var _=require(_0x7c9d('0x2'));var util=require(_0x7c9d('0x3'));var jayson=require(_0x7c9d('0x4'));var client=jayson[_0x7c9d('0x5')]['http']({'port':0x2329});function request(_0x1ac7b2,_0x36a6fd){return new BPromise(function(_0x1eacf2,_0x232db4){return client[_0x7c9d('0x6')](_0x1ac7b2,_0x36a6fd)[_0x7c9d('0x7')](function(_0x18b838){if(_0x18b838[_0x7c9d('0x8')]){return _0x232db4(_0x18b838['error'][_0x7c9d('0x9')]);}else{return _0x1eacf2(_0x18b838[_0x7c9d('0xa')]);}})[_0x7c9d('0xb')](function(_0x57f95c){return _0x232db4(_0x57f95c);});});}exports['getSquareProject']=function(_0x3d657d){return request(_0x7c9d('0xc'),{'options':{'raw':![],'where':{'name':_0x3d657d},'attributes':[_0x7c9d('0xd')]}});};exports[_0x7c9d('0xe')]=function(_0x280e47){return request(_0x7c9d('0xf'),{'options':{'raw':![],'where':{'id':_0x280e47},'include':[{'model':_0x7c9d('0x10'),'as':'Smtp'}],'attributes':['id','name',_0x7c9d('0x11')]}});};exports['getSquareProjectById']=function(_0x20bd7b){return request(_0x7c9d('0xc'),{'options':{'where':{'id':_0x20bd7b},'attributes':[_0x7c9d('0x12')]}});};exports[_0x7c9d('0x13')]=function(_0x29bd90){return request(_0x7c9d('0x14'),{'options':{'where':{'id':_0x29bd90},'attributes':[_0x7c9d('0x12')]}});};exports[_0x7c9d('0x15')]=function(_0x1650a0){return request(_0x7c9d('0x16'),{'options':{'where':{'id':_0x1650a0},'attributes':['name']}});};exports[_0x7c9d('0x17')]=function(_0x3a9d4f){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x3a9d4f},'attributes':[_0x7c9d('0x18')]}});};exports['getUserById']=function(_0x5adf17){return request(_0x7c9d('0x19'),{'options':{'where':{'id':_0x5adf17},'attributes':[_0x7c9d('0x12')]}});};exports[_0x7c9d('0x1a')]=function(_0x27b810){return request(_0x7c9d('0x1b'),{'options':{'where':{'id':_0x27b810},'attributes':[_0x7c9d('0x12')]}});};exports[_0x7c9d('0x1c')]=function(_0x5eedeb){return request(_0x7c9d('0x1d'),{'options':{'where':{'id':_0x5eedeb},'attributes':['save_name']}});};exports[_0x7c9d('0x1e')]=function(_0x3aecc4){return request(_0x7c9d('0x1f'),{'options':{'raw':![],'where':{'id':_0x3aecc4},'include':[{'model':_0x7c9d('0x20'),'as':_0x7c9d('0x21')}]}});};exports[_0x7c9d('0x22')]=function(_0x5033e9){return request('ShowSmsAccount',{'options':{'where':{'id':_0x5033e9},'attributes':['id',_0x7c9d('0x12')]}});};exports[_0x7c9d('0x23')]=function(_0x490c09){return request('CreateSmsMessage',{'body':_0x490c09});};exports[_0x7c9d('0x24')]=function(_0x2f67ad){return request(_0x7c9d('0x25'),{'body':_0x2f67ad});};exports[_0x7c9d('0x26')]=function(_0xc748f9){return request(_0x7c9d('0x27'),{'body':_[_0x7c9d('0x28')](_0xc748f9,{'project_name':_0xc748f9[_0x7c9d('0x29')],'prev_project_name':_0xc748f9[_0x7c9d('0x2a')]||'','is_subproject':_0xc748f9['arg_2']?!![]:![],'leaveAt':moment()[_0x7c9d('0x2b')](_0x7c9d('0x2c'))})});};exports['createSquareRecording']=function(_0x422436){return request('CreateSquareRecording',{'body':_0x422436});};exports[_0x7c9d('0x2d')]=function(_0x3ed9ea){return request(_0x7c9d('0x2e'),{'body':_0x3ed9ea});};exports[_0x7c9d('0x2f')]=function(_0x4bf9d4){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x4bf9d4[_0x7c9d('0x30')],'ListId':_0x4bf9d4[_0x7c9d('0x31')]}}})[_0x7c9d('0x7')](function(_0xd8315b){if(_0xd8315b){return _0xd8315b;}return request('CreateCmContact',{'body':_0x4bf9d4});});};exports[_0x7c9d('0x32')]=function(_0xd182fd){return request(_0x7c9d('0x33'),{'options':{'where':{'id':_0xd182fd},'attributes':[_0x7c9d('0x12')]}});};exports[_0x7c9d('0x34')]=function(_0x4dd61f,_0x271f94){return request(_0x7c9d('0x35'),{'body':{'interface':_0x271f94},'options':{'where':_0x4dd61f}});};exports[_0x7c9d('0x36')]=function(_0x21c7f0,_0x5c2342,_0x50a7ec){return request(_0x7c9d('0x37'),{'body':{'type':_0x5c2342,'uniqueid':_0x50a7ec},'options':{'where':_0x21c7f0}});};exports[_0x7c9d('0x38')]=function(_0x5a1dbf){return request(_0x7c9d('0x39'),{'body':{},'options':{'where':_0x5a1dbf}});};exports[_0x7c9d('0x3a')]=function(_0x248932){return request(_0x7c9d('0x3b'),{'body':{},'options':{'where':_0x248932}});}; \ No newline at end of file +var _0x1c52=['getTrunkById','getSoundById','save_name','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','util','client','http','request','then','error','result','catch','ShowSquareProject','getMailAccountById','Smtp','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1c52,0xa9));var _0x21c5=function(_0x3f3940,_0x158134){_0x3f3940=_0x3f3940-0x0;var _0xdd1ff6=_0x1c52[_0x3f3940];return _0xdd1ff6;};'use strict';var BPromise=require(_0x21c5('0x0'));var moment=require(_0x21c5('0x1'));var _=require('lodash');var util=require(_0x21c5('0x2'));var jayson=require('jayson/promise');var client=jayson[_0x21c5('0x3')][_0x21c5('0x4')]({'port':0x2329});function request(_0x3ebf6e,_0x3a639b){return new BPromise(function(_0x994c52,_0x59bc56){return client[_0x21c5('0x5')](_0x3ebf6e,_0x3a639b)[_0x21c5('0x6')](function(_0xc7e95b){if(_0xc7e95b[_0x21c5('0x7')]){return _0x59bc56(_0xc7e95b['error']['message']);}else{return _0x994c52(_0xc7e95b[_0x21c5('0x8')]);}})[_0x21c5('0x9')](function(_0x2d926d){return _0x59bc56(_0x2d926d);});});}exports['getSquareProject']=function(_0x141a50){return request(_0x21c5('0xa'),{'options':{'raw':![],'where':{'name':_0x141a50},'attributes':['production']}});};exports[_0x21c5('0xb')]=function(_0x59f706){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x59f706},'include':[{'model':'MailServerOut','as':_0x21c5('0xc')}],'attributes':['id',_0x21c5('0xd'),_0x21c5('0xe')]}});};exports[_0x21c5('0xf')]=function(_0x3ea3a0){return request('ShowSquareProject',{'options':{'where':{'id':_0x3ea3a0},'attributes':[_0x21c5('0xd')]}});};exports[_0x21c5('0x10')]=function(_0x410b6b){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x410b6b},'attributes':[_0x21c5('0xd')]}});};exports[_0x21c5('0x11')]=function(_0xdb3e0b){return request(_0x21c5('0x12'),{'options':{'where':{'id':_0xdb3e0b},'attributes':['name']}});};exports[_0x21c5('0x13')]=function(_0xc2d464){return request(_0x21c5('0x14'),{'options':{'where':{'id':_0xc2d464},'attributes':[_0x21c5('0x15')]}});};exports['getUserById']=function(_0x3ce3d6){return request(_0x21c5('0x16'),{'options':{'where':{'id':_0x3ce3d6},'attributes':[_0x21c5('0xd')]}});};exports[_0x21c5('0x17')]=function(_0x124ca3){return request('ShowTrunk',{'options':{'where':{'id':_0x124ca3},'attributes':[_0x21c5('0xd')]}});};exports[_0x21c5('0x18')]=function(_0x283fd7){return request('ShowSound',{'options':{'where':{'id':_0x283fd7},'attributes':[_0x21c5('0x19')]}});};exports['getIntervalById']=function(_0x432ca7){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x432ca7},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0x21c5('0x1a')]=function(_0x57f203){return request(_0x21c5('0x1b'),{'options':{'where':{'id':_0x57f203},'attributes':['id','name']}});};exports[_0x21c5('0x1c')]=function(_0x2b07f2){return request('CreateSmsMessage',{'body':_0x2b07f2});};exports['createSquareDetailsReport']=function(_0x5d8853){return request('CreateSquareDetailsReport',{'body':_0x5d8853});};exports[_0x21c5('0x1d')]=function(_0x729260){return request('CreateSquareReport',{'body':_[_0x21c5('0x1e')](_0x729260,{'project_name':_0x729260[_0x21c5('0x1f')],'prev_project_name':_0x729260[_0x21c5('0x20')]||'','is_subproject':_0x729260['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x21c5('0x21'))})});};exports[_0x21c5('0x22')]=function(_0x2fad52){return request('CreateSquareRecording',{'body':_0x2fad52});};exports[_0x21c5('0x23')]=function(_0x5533dc){return request(_0x21c5('0x24'),{'body':_0x5533dc});};exports['createCmContact']=function(_0x125ee0){return request(_0x21c5('0x25'),{'options':{'raw':![],'where':{'phone':_0x125ee0['phone'],'ListId':_0x125ee0[_0x21c5('0x26')]}}})[_0x21c5('0x6')](function(_0x300a6d){if(_0x300a6d){return _0x300a6d;}return request(_0x21c5('0x27'),{'body':_0x125ee0});});};exports[_0x21c5('0x28')]=function(_0x12bbbe){return request('ShowPause',{'options':{'where':{'id':_0x12bbbe},'attributes':[_0x21c5('0xd')]}});};exports[_0x21c5('0x29')]=function(_0x6d3cee,_0x20955f){return request(_0x21c5('0x2a'),{'body':{'interface':_0x20955f},'options':{'where':_0x6d3cee}});};exports[_0x21c5('0x2b')]=function(_0x8b704a,_0xd77a1b,_0x127b91){return request('PauseUser',{'body':{'type':_0xd77a1b,'uniqueid':_0x127b91},'options':{'where':_0x8b704a}});};exports[_0x21c5('0x2c')]=function(_0x31f802){return request(_0x21c5('0x2d'),{'body':{},'options':{'where':_0x31f802}});};exports[_0x21c5('0x2e')]=function(_0x42722e){return request(_0x21c5('0x2f'),{'body':{},'options':{'where':_0x42722e}});}; \ 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 2c51574..8abd5f2 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 _0x4bc3=['./polly','./lex'];(function(_0x559921,_0x48ad89){var _0xf01d47=function(_0x532f60){while(--_0x532f60){_0x559921['push'](_0x559921['shift']());}};_0xf01d47(++_0x48ad89);}(_0x4bc3,0x16e));var _0x34bc=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x4bc3[_0x5a776b];return _0xbbef59;};var polly=require(_0x34bc('0x0'));var lex=require(_0x34bc('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xca66=['./polly'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0xca66,0x8b));var _0x6ca6=function(_0x2688d3,_0x58b123){_0x2688d3=_0x2688d3-0x0;var _0x42f823=_0xca66[_0x2688d3];return _0x42f823;};var polly=require(_0x6ca6('0x0'));var lex=require('./lex');module['exports']={'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 0213d55..3f20a28 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 _0x3685=['./lib/api'];(function(_0x584181,_0x11b804){var _0x5185f1=function(_0x389865){while(--_0x389865){_0x584181['push'](_0x584181['shift']());}};_0x5185f1(++_0x11b804);}(_0x3685,0xf8));var _0x5368=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3685[_0x122ef9];return _0x42fba0;};'use strict';var lex=require(_0x5368('0x0'));module['exports']=function(_0x31ec8e,_0x581fe7,_0x1e4f48,_0x3ee78f,_0x38e06c,_0xf0428a){return lex(_0x31ec8e,_0x581fe7,_0x1e4f48,_0x3ee78f,_0x38e06c,_0xf0428a);}; \ No newline at end of file +var _0x89e8=['./lib/api','exports'];(function(_0x31eb97,_0x35db07){var _0x36c853=function(_0x44df57){while(--_0x44df57){_0x31eb97['push'](_0x31eb97['shift']());}};_0x36c853(++_0x35db07);}(_0x89e8,0x74));var _0x889e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x89e8[_0x397e5f];return _0x5302b8;};'use strict';var lex=require(_0x889e('0x0'));module[_0x889e('0x1')]=function(_0xfc1dd0,_0x319ddb,_0x35d770,_0x2a8b6d,_0xfe71bf,_0x935fd){return lex(_0xfc1dd0,_0x319ddb,_0x35d770,_0x2a8b6d,_0xfe71bf,_0x935fd);}; \ 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 29f9ea0..f2abe9e 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 _0xac28=['hasOwnProperty','exports','LexRuntime','$LATEST','bluebird','aws-sdk','postText','slots'];(function(_0x3ed3bd,_0x57df95){var _0x363081=function(_0x2c7e01){while(--_0x2c7e01){_0x3ed3bd['push'](_0x3ed3bd['shift']());}};_0x363081(++_0x57df95);}(_0xac28,0x18c));var _0x8ac2=function(_0x145aae,_0x5374cc){_0x145aae=_0x145aae-0x0;var _0x19c61c=_0xac28[_0x145aae];return _0x19c61c;};'use strict';var BPromise=require(_0x8ac2('0x0'));var AWS=require(_0x8ac2('0x1'));function lexResult(_0x41e247,_0x22dde8){return new BPromise(function(_0x28d921,_0x50ead1){_0x41e247[_0x8ac2('0x2')](_0x22dde8,function(_0x5b2a67,_0x382ee2){if(_0x5b2a67){_0x50ead1(_0x5b2a67);}if(_0x382ee2[_0x8ac2('0x3')]){for(const _0x2a8457 in _0x382ee2['slots']){if(_0x382ee2[_0x8ac2('0x3')][_0x8ac2('0x4')](_0x2a8457)){var _0x532dde=_0x382ee2[_0x8ac2('0x3')][_0x2a8457];_0x382ee2['slot_'+_0x2a8457]=_0x532dde;}}}_0x28d921(_0x382ee2);});});}module[_0x8ac2('0x5')]=function(_0x4ea0ba,_0x6bd58a,_0x28d273,_0x4942dc,_0x219380,_0x54b3a5){var _0x14a13b=new AWS[(_0x8ac2('0x6'))]({'accessKeyId':_0x6bd58a,'secretAccessKey':_0x28d273,'region':_0x4942dc});var _0x3592cd={'botAlias':_0x8ac2('0x7'),'botName':_0x54b3a5,'inputText':_0x219380,'userId':_0x4ea0ba};return lexResult(_0x14a13b,_0x3592cd);}; \ No newline at end of file +var _0xa32f=['bluebird','aws-sdk','postText','slots','hasOwnProperty','exports','LexRuntime'];(function(_0x53765c,_0x37d8a5){var _0x170107=function(_0x263606){while(--_0x263606){_0x53765c['push'](_0x53765c['shift']());}};_0x170107(++_0x37d8a5);}(_0xa32f,0x1b9));var _0xfa32=function(_0x4e464e,_0x5529e4){_0x4e464e=_0x4e464e-0x0;var _0x46d8fc=_0xa32f[_0x4e464e];return _0x46d8fc;};'use strict';var BPromise=require(_0xfa32('0x0'));var AWS=require(_0xfa32('0x1'));function lexResult(_0x47be39,_0x350162){return new BPromise(function(_0x51a84d,_0x573659){_0x47be39[_0xfa32('0x2')](_0x350162,function(_0x41d4a1,_0x235d7e){if(_0x41d4a1){_0x573659(_0x41d4a1);}if(_0x235d7e['slots']){for(const _0x2ae8ee in _0x235d7e['slots']){if(_0x235d7e[_0xfa32('0x3')][_0xfa32('0x4')](_0x2ae8ee)){var _0x470f24=_0x235d7e[_0xfa32('0x3')][_0x2ae8ee];_0x235d7e['slot_'+_0x2ae8ee]=_0x470f24;}}}_0x51a84d(_0x235d7e);});});}module[_0xfa32('0x5')]=function(_0x2bfe7e,_0x40010f,_0x2ab28b,_0x5be8b9,_0x2fb718,_0x6b3af7){var _0x2c7aa6=new AWS[(_0xfa32('0x6'))]({'accessKeyId':_0x40010f,'secretAccessKey':_0x2ab28b,'region':_0x5be8b9});var _0x340e66={'botAlias':'$LATEST','botName':_0x6b3af7,'inputText':_0x2fb718,'userId':_0x2bfe7e};return lexResult(_0x2c7aa6,_0x340e66);}; \ 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 efb4580..829f896 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd18b=['exports'];(function(_0x24e1cf,_0xe307bb){var _0x21a3de=function(_0x1b24ab){while(--_0x1b24ab){_0x24e1cf['push'](_0x24e1cf['shift']());}};_0x21a3de(++_0xe307bb);}(_0xd18b,0xec));var _0xbd18=function(_0xc6124c,_0x5415a9){_0xc6124c=_0xc6124c-0x0;var _0x241d9e=_0xd18b[_0xc6124c];return _0x241d9e;};'use strict';var polly=require('./lib/api');module[_0xbd18('0x0')]=function(_0x411d47,_0x35fd17,_0x1bf007,_0xefb735,_0x3bcefd,_0x24a9b2,_0x124dab){return polly(_0x411d47,_0x35fd17,_0x1bf007,_0xefb735,_0x3bcefd,_0x24a9b2,_0x124dab);}; \ No newline at end of file +var _0xd4ea=['./lib/api','exports'];(function(_0x4981ed,_0x5ee4af){var _0x4134fa=function(_0x510ed9){while(--_0x510ed9){_0x4981ed['push'](_0x4981ed['shift']());}};_0x4134fa(++_0x5ee4af);}(_0xd4ea,0x12e));var _0xad4e=function(_0x7cd2cc,_0x49fc1a){_0x7cd2cc=_0x7cd2cc-0x0;var _0x3c6d19=_0xd4ea[_0x7cd2cc];return _0x3c6d19;};'use strict';var polly=require(_0xad4e('0x0'));module[_0xad4e('0x1')]=function(_0x48771e,_0x29033d,_0x1f4453,_0x510c77,_0x18f16e,_0x3821ec,_0x598f10){return polly(_0x48771e,_0x29033d,_0x1f4453,_0x510c77,_0x18f16e,_0x3821ec,_0x598f10);}; \ 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 1a8d9e4..ed80d7d 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 _0x2bd3=['text','mp3','path','aws-sdk','synthesizeSpeech','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x4d6c97,_0x2084ba){var _0x1c85c4=function(_0x2fb6b4){while(--_0x2fb6b4){_0x4d6c97['push'](_0x4d6c97['shift']());}};_0x1c85c4(++_0x2084ba);}(_0x2bd3,0x185));var _0x32bd=function(_0x1f61e6,_0x2a395e){_0x1f61e6=_0x1f61e6-0x0;var _0x43f6bb=_0x2bd3[_0x1f61e6];return _0x43f6bb;};'use strict';var fs=require('fs');var path=require(_0x32bd('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0x32bd('0x1'));function pollyResult(_0x5e25d6,_0x5d485e,_0x20225d){return new BPromise(function(_0x32b997,_0x358ad3){_0x5e25d6[_0x32bd('0x2')](_0x5d485e,function(_0x465a6a,_0x28d58f){if(_0x465a6a){_0x358ad3(_0x465a6a);}else if(_0x28d58f){if(_0x28d58f['AudioStream']instanceof Buffer){fs[_0x32bd('0x3')](_0x20225d,_0x28d58f['AudioStream'],function(_0x6f07fc){if(_0x6f07fc){_0x358ad3(_0x6f07fc);}else{_0x32b997();}});}else{_0x358ad3(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x358ad3(new Error(_0x32bd('0x4')));}});});}module[_0x32bd('0x5')]=function(_0x46fcdf,_0x9a89ff,_0x37b62c,_0x4360df,_0x5dab3e,_0x3b4ca1,_0x104a4f){var _0x136253=new AWS[(_0x32bd('0x6'))]({'accessKeyId':_0x46fcdf,'secretAccessKey':_0x9a89ff,'region':_0x37b62c});var _0x48f983={'Text':_0x5dab3e,'TextType':_0x3b4ca1||_0x32bd('0x7'),'OutputFormat':_0x32bd('0x8'),'VoiceId':_0x4360df};return pollyResult(_0x136253,_0x48f983,_0x104a4f);}; \ No newline at end of file +var _0xef6b=['bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path'];(function(_0x45cfc8,_0x25c9ed){var _0x5e3c59=function(_0x34d410){while(--_0x34d410){_0x45cfc8['push'](_0x45cfc8['shift']());}};_0x5e3c59(++_0x25c9ed);}(_0xef6b,0xaf));var _0xbef6=function(_0x3d37cc,_0x52a9eb){_0x3d37cc=_0x3d37cc-0x0;var _0x5e74be=_0xef6b[_0x3d37cc];return _0x5e74be;};'use strict';var fs=require('fs');var path=require(_0xbef6('0x0'));var BPromise=require(_0xbef6('0x1'));var rs=require(_0xbef6('0x2'));var AWS=require(_0xbef6('0x3'));function pollyResult(_0x4ee6bf,_0x3dd747,_0x1faebe){return new BPromise(function(_0x48cd16,_0x226c86){_0x4ee6bf[_0xbef6('0x4')](_0x3dd747,function(_0x5593d0,_0x1ee0ee){if(_0x5593d0){_0x226c86(_0x5593d0);}else if(_0x1ee0ee){if(_0x1ee0ee[_0xbef6('0x5')]instanceof Buffer){fs[_0xbef6('0x6')](_0x1faebe,_0x1ee0ee['AudioStream'],function(_0xee84b){if(_0xee84b){_0x226c86(_0xee84b);}else{_0x48cd16();}});}else{_0x226c86(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x226c86(new Error(_0xbef6('0x7')));}});});}module[_0xbef6('0x8')]=function(_0x180182,_0x356c82,_0x4fff66,_0x34220a,_0x18aeaa,_0x361af0,_0x44b345){var _0x541c13=new AWS[(_0xbef6('0x9'))]({'accessKeyId':_0x180182,'secretAccessKey':_0x356c82,'region':_0x4fff66});var _0x167c19={'Text':_0x18aeaa,'TextType':_0x361af0||_0xbef6('0xa'),'OutputFormat':'mp3','VoiceId':_0x34220a};return pollyResult(_0x541c13,_0x167c19,_0x44b345);}; \ 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 1960012..582d446 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 _0x73b3=['exports','./lib/api'];(function(_0x54ead4,_0x4fc746){var _0x2d3a36=function(_0x364597){while(--_0x364597){_0x54ead4['push'](_0x54ead4['shift']());}};_0x2d3a36(++_0x4fc746);}(_0x73b3,0x16f));var _0x373b=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x73b3[_0x4d1ee9];return _0x9a5456;};'use strict';var asr=require(_0x373b('0x0'));module[_0x373b('0x1')]=function(_0x28d9ee,_0x5c7062,_0x1d45b7,_0x4d00b3){return asr(_0x28d9ee,_0x5c7062,_0x1d45b7);}; \ No newline at end of file +var _0x855f=['./lib/api'];(function(_0x2f7f9b,_0x1ad489){var _0x2de4d7=function(_0x31d5fc){while(--_0x31d5fc){_0x2f7f9b['push'](_0x2f7f9b['shift']());}};_0x2de4d7(++_0x1ad489);}(_0x855f,0x17b));var _0xf855=function(_0x4dbaba,_0x4d96fa){_0x4dbaba=_0x4dbaba-0x0;var _0x4a7836=_0x855f[_0x4dbaba];return _0x4a7836;};'use strict';var asr=require(_0xf855('0x0'));module['exports']=function(_0x318883,_0xb0346e,_0xa99450,_0x3450ed){return asr(_0x318883,_0xb0346e,_0xa99450);}; \ 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 81e2433..168560c 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 _0xd8a7=['exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','LINEAR16','8000','url','bluebird','https://speech.googleapis.com'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd8a7,0x138));var _0x7d8a=function(_0x1e6190,_0x2d66c2){_0x1e6190=_0x1e6190-0x0;var _0x7f49bb=_0xd8a7[_0x1e6190];return _0x7f49bb;};'use strict';var url=require(_0x7d8a('0x0'));var BPromise=require(_0x7d8a('0x1'));var fs=require('fs');var host=_0x7d8a('0x2');module[_0x7d8a('0x3')]=function(_0x494e81,_0x3dfd15,_0x286b92){return new BPromise(function(_0x379dbf,_0xa189f4){var _0x49e0f0;if(typeof _0x494e81!==_0x7d8a('0x4')||_0x494e81[_0x7d8a('0x5')]===0x0){return _0xa189f4(_0x7d8a('0x6'));}if(typeof _0x3dfd15!==_0x7d8a('0x4')||_0x3dfd15['length']===0x0){return _0xa189f4(_0x7d8a('0x7'));}if(typeof _0x286b92!==_0x7d8a('0x8')&&(typeof _0x286b92!==_0x7d8a('0x4')||_0x286b92[_0x7d8a('0x5')]===0x0)){return _0xa189f4(_0x7d8a('0x9'));}try{_0x49e0f0=fs[_0x7d8a('0xa')](_0x494e81)[_0x7d8a('0xb')]('base64');}catch(_0x2a9016){return _0xa189f4(_0x2a9016);}return _0x379dbf({'method':_0x7d8a('0xc'),'uri':host+'/v1/speech:recognize?key='+_0x3dfd15,'body':{'config':{'encoding':_0x7d8a('0xd'),'sampleRateHertz':_0x7d8a('0xe'),'languageCode':_0x286b92},'audio':{'content':_0x49e0f0}},'json':!![]});});}; \ No newline at end of file +var _0x7a4d=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','string','length'];(function(_0x530c55,_0x457b25){var _0x27c858=function(_0x2c69b5){while(--_0x2c69b5){_0x530c55['push'](_0x530c55['shift']());}};_0x27c858(++_0x457b25);}(_0x7a4d,0x183));var _0xd7a4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x7a4d[_0x465a0c];return _0x1e202e;};'use strict';var url=require('url');var BPromise=require(_0xd7a4('0x0'));var fs=require('fs');var host=_0xd7a4('0x1');module[_0xd7a4('0x2')]=function(_0x4c325d,_0x2c596a,_0x3ec3ba){return new BPromise(function(_0x2fad7e,_0x268399){var _0x3dbe80;if(typeof _0x4c325d!==_0xd7a4('0x3')||_0x4c325d[_0xd7a4('0x4')]===0x0){return _0x268399(_0xd7a4('0x5'));}if(typeof _0x2c596a!==_0xd7a4('0x3')||_0x2c596a[_0xd7a4('0x4')]===0x0){return _0x268399(_0xd7a4('0x6'));}if(typeof _0x3ec3ba!=='undefined'&&(typeof _0x3ec3ba!==_0xd7a4('0x3')||_0x3ec3ba['length']===0x0)){return _0x268399(_0xd7a4('0x7'));}try{_0x3dbe80=fs['readFileSync'](_0x4c325d)[_0xd7a4('0x8')](_0xd7a4('0x9'));}catch(_0x3eaaa9){return _0x268399(_0x3eaaa9);}return _0x2fad7e({'method':_0xd7a4('0xa'),'uri':host+_0xd7a4('0xb')+_0x2c596a,'body':{'config':{'encoding':_0xd7a4('0xc'),'sampleRateHertz':_0xd7a4('0xd'),'languageCode':_0x3ec3ba},'audio':{'content':_0x3dbe80}},'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 78f5630..10cb4be 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87ef=['./asr'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x87ef,0x13f));var _0xf87e=function(_0x3d6db1,_0x4358f8){_0x3d6db1=_0x3d6db1-0x0;var _0x5e1cc3=_0x87ef[_0x3d6db1];return _0x5e1cc3;};var asr=require(_0xf87e('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 93124de..9e27ad7 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 _0xd7fd=['nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','http','https','md5','google-tts-api','url','util','./google','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','download\x20error','pipe','end','https:','path','data','wav','error\x20convert','finish\x20to\x20convert','tmp','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','resolve','generate','.mp3','audioContent','writeFile','unlink','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','[%s]\x20%s:%s','name','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','intent','isFallback','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','model=%s','freeform=3','parse'];(function(_0xafed24,_0x555329){var _0x24c443=function(_0x137d31){while(--_0x137d31){_0xafed24['push'](_0xafed24['shift']());}};_0x24c443(++_0x555329);}(_0xd7fd,0x89));var _0xdd7f=function(_0x493503,_0x351993){_0x493503=_0x493503-0x0;var _0x1986d0=_0xd7fd[_0x493503];return _0x1986d0;};'use strict';var apiai=require(_0xdd7f('0x0'));var BPromise=require(_0xdd7f('0x1'));var dialogflow=require(_0xdd7f('0x2'));var fs=require('fs');var http=require(_0xdd7f('0x3'));var https=require(_0xdd7f('0x4'));var md5=require(_0xdd7f('0x5'));var path=require('path');var querystring=require('querystring');var rp=require('request-promise');var rs=require('randomstring');var sox=require('sox');var tts=require(_0xdd7f('0x6'));var urlParse=require(_0xdd7f('0x7'))['parse'];var util=require(_0xdd7f('0x8'));var aws=require('./aws');var google=require(_0xdd7f('0x9'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0xdd7f('0xa');function downloadFile(_0x348a26,_0x523937){return new BPromise(function(_0x443e4e,_0x16f826){var _0x5b78d6=urlParse(_0x348a26);var _0xa1299f=_0x5b78d6[_0xdd7f('0xb')]==='https:'?https:http;var _0x1a16c0={'host':_0x5b78d6[_0xdd7f('0xc')],'path':_0x5b78d6['path'],'headers':{'user-agent':_0xdd7f('0xd')}};_0xa1299f[_0xdd7f('0xe')](_0x1a16c0,function(_0x279898){if(_0x279898[_0xdd7f('0xf')]!==0xc8){logger[_0xdd7f('0x10')](_0xdd7f('0x11')+_0x348a26+_0xdd7f('0x12')+_0x279898[_0xdd7f('0xf')]+'\x20('+_0x279898[_0xdd7f('0x13')]+')');_0x16f826(new Error(_0xdd7f('0x11')+_0x348a26+_0xdd7f('0x12')+_0x279898[_0xdd7f('0xf')]+'\x20('+_0x279898[_0xdd7f('0x13')]+')'));return;}var _0x825739=fs[_0xdd7f('0x14')](_0x523937);_0x825739['on'](_0xdd7f('0x15'),function(){logger[_0xdd7f('0x16')](_0xdd7f('0x17'));_0x825739['close'](_0x443e4e);});_0x825739['on'](_0xdd7f('0x10'),function(_0x131ff0){fs['unlink'](_0x523937);logger[_0xdd7f('0x10')](_0xdd7f('0x18'),_0x131ff0);_0x16f826(_0x131ff0);});_0x279898[_0xdd7f('0x19')](_0x825739);})['on']('error',function(_0x4aa193){logger[_0xdd7f('0x10')](_0x4aa193);_0x16f826(_0x4aa193);})[_0xdd7f('0x1a')]();});}function uploadFile(_0x3e7cf0){return new BPromise(function(_0x5c9641,_0xcd0e17){var _0x33b908=urlParse(_0x3e7cf0);var _0x5d8903=_0x33b908[_0xdd7f('0xb')]===_0xdd7f('0x1b')?https:http;var _0x214e07={'host':_0x33b908['host'],'path':_0x33b908[_0xdd7f('0x1c')],'headers':{'user-agent':_0xdd7f('0xd')}};_0x5d8903[_0xdd7f('0xe')](_0x214e07,function(_0x27e890){if(_0x27e890[_0xdd7f('0xf')]!==0xc8){_0xcd0e17(new Error(_0xdd7f('0x11')+_0x3e7cf0+_0xdd7f('0x12')+_0x27e890[_0xdd7f('0xf')]+'\x20('+_0x27e890[_0xdd7f('0x13')]+')'));return;}var _0xd2ac8e='';_0x27e890['on'](_0xdd7f('0x1d'),function(_0x3ba795){_0xd2ac8e+=_0x3ba795;});_0x27e890['on'](_0xdd7f('0x1a'),function(){_0x5c9641(_0xd2ac8e);});})['on']('error',function(_0x15d69f){_0xcd0e17(_0x15d69f);})['end']();});}function convertFile(_0x4babc1,_0x430a53){return new BPromise(function(_0x45e3fc,_0x15f7fc){var _0x3ba1e7=sox['transcode'](_0x4babc1,_0x430a53,{'sampleRate':0x1f40,'format':_0xdd7f('0x1e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3ba1e7['on'](_0xdd7f('0x10'),function(_0x31a70b){logger[_0xdd7f('0x10')](_0xdd7f('0x1f'),_0x31a70b);_0x15f7fc(_0x31a70b);});_0x3ba1e7['on'](_0xdd7f('0x1a'),function(){logger[_0xdd7f('0x16')](_0xdd7f('0x20'));_0x45e3fc();});_0x3ba1e7['start']();});}function base64Decode(_0x508db4,_0x2347b0){var _0x16e4e3=path['resolve'](__dirname,_0xdd7f('0x21'),rs['generate'](0x4)+_0xdd7f('0x22'));fs[_0xdd7f('0x23')](_0x16e4e3,_0x508db4,_0xdd7f('0x24'));return convertFile(_0x16e4e3,_0x2347b0)[_0xdd7f('0x25')](function(){try{fs['unlink'](_0x16e4e3);fs[_0xdd7f('0x26')](_0x2347b0,_0xdd7f('0x27'));}catch(_0x17f67a){logger['error'](_0x17f67a);}return _0x2347b0[_0xdd7f('0x28')]('.')[0x0];});}function base64Encode(_0x250a67){var _0x592740=fs[_0xdd7f('0x29')](_0x250a67);return new Buffer(_0x592740)[_0xdd7f('0x2a')]('base64');}exports[_0xdd7f('0x2b')]=function(_0x3b5b48,_0x34d46f,_0x45f2a7,_0x922447,_0x3480c6,_0x10f8e1){var _0x5175e3,_0x383978;var _0x58f881='https://texttospeech.googleapis.com/v1/';var _0x2665d2=_0xdd7f('0x2c')+_0x3b5b48;var _0x99a746={};if(_0x34d46f===_0xdd7f('0x2d')){_0x99a746[_0xdd7f('0x2e')]={'ssml':_0x45f2a7};}else{_0x99a746['input']={'text':_0x45f2a7};};_0x99a746[_0xdd7f('0x2f')]={'languageCode':_0x922447,'ssmlGender':_0x3480c6};_0x99a746[_0xdd7f('0x30')]={'audioEncoding':_0xdd7f('0x31'),'sampleRateHertz':0x1f40};var _0xe7d0ce={'url':_0x58f881+_0xdd7f('0x32')+_0x2665d2,'method':_0xdd7f('0x33'),'json':!![],'body':_0x99a746};return rp(_0xe7d0ce)['then'](function(_0x2d2781){return new BPromise(function(_0x3c834d,_0x362da4){_0x5175e3=path[_0xdd7f('0x34')](__dirname,_0xdd7f('0x21'),rs[_0xdd7f('0x35')](0x4)+_0xdd7f('0x36'));var _0x189ad2=Buffer['from'](_0x2d2781[_0xdd7f('0x37')],_0xdd7f('0x24'));return fs[_0xdd7f('0x38')](_0x5175e3,_0x189ad2,function(_0x22dd88){_0x362da4(_0x22dd88);},function(_0x3e6993){fs['chmodSync'](_0x5175e3,_0xdd7f('0x27'));_0x3c834d(_0x3e6993);});});})['then'](function(_0xe3c529){_0x383978=path[_0xdd7f('0x34')](__dirname,'tmp',rs['generate'](0x4)+_0xdd7f('0x22'));return convertFile(_0x5175e3,_0x383978);})[_0xdd7f('0x25')](function(){try{fs[_0xdd7f('0x39')](_0x5175e3);fs[_0xdd7f('0x26')](_0x383978,_0xdd7f('0x27'));}catch(_0x18018a){logger[_0xdd7f('0x10')](_0x18018a);}logger[_0xdd7f('0x16')](_0xdd7f('0x3a'),_0x383978[_0xdd7f('0x28')]('.')[0x0]);return _0x383978[_0xdd7f('0x28')]('.')[0x0];});};exports[_0xdd7f('0x3b')]=function(_0x41e589,_0x116c03){var _0x30633b=_0xdd7f('0x3c');var _0x57dcf4,_0x3d2d1b;var _0x530e19;var _0x21f2f3={'encoding':'utf8','method':_0xdd7f('0x33'),'timeout':0x2710,'url':_0x30633b,'headers':{'Content-Type':_0xdd7f('0x3d')},'body':_0xdd7f('0x3e')+encodeURIComponent(JSON[_0xdd7f('0x3f')]([[[_0xdd7f('0x40'),JSON[_0xdd7f('0x3f')]([_0x41e589,_0x116c03||'en',![],'null']),null,'generic']]]))};return rp(_0x21f2f3)[_0xdd7f('0x25')](function(_0x57bae6){try{_0x530e19=eval(_0x57bae6['slice'](0x5))[0x0][0x2];}catch(_0x2aca06){throw new Error('parse\x20response\x20failed:\x0a'+_0x57bae6[_0xdd7f('0x1d')]);}if(!_0x530e19){if(_0x41e589[_0xdd7f('0x41')]>0xc8){throw new Error(_0xdd7f('0x42'));}else{throw new Error(_0xdd7f('0x43')+_0x116c03+_0xdd7f('0x44'));}}try{_0x530e19=eval(_0x530e19)[0x0];}catch(_0x5cf670){throw new Error(_0xdd7f('0x45')+res['data']);}const _0x43d2a0=_0x530e19;_0x57dcf4=path[_0xdd7f('0x34')](__dirname,_0xdd7f('0x21'),rs[_0xdd7f('0x35')](0x4)+_0xdd7f('0x36'));fs['writeFileSync'](_0x57dcf4,_0x530e19,{'encoding':_0xdd7f('0x24')});_0x3d2d1b=path['resolve'](__dirname,_0xdd7f('0x21'),rs[_0xdd7f('0x35')](0x4)+_0xdd7f('0x22'));return convertFile(_0x57dcf4,_0x3d2d1b);})[_0xdd7f('0x25')](function(){try{fs['unlink'](_0x57dcf4);fs[_0xdd7f('0x26')](_0x3d2d1b,_0xdd7f('0x27'));}catch(_0x28269b){logger[_0xdd7f('0x10')](_0x28269b);}logger['info'](_0xdd7f('0x46'),_0x3d2d1b['split']('.')[0x0]);return _0x3d2d1b['split']('.')[0x0];});};exports['googleASR']=function(_0x57186d,_0x3882d2,_0x5eae83){return google[_0xdd7f('0x47')](_0x57186d,_0x3882d2,_0x5eae83)['then'](function(_0x2dbdc7){logger[_0xdd7f('0x16')](_0x2dbdc7[_0xdd7f('0x48')]);return rp(_0x2dbdc7);})[_0xdd7f('0x25')](function(_0x3de0f6){var _0x163773='';var _0x7b86bc=0x0;try{fs[_0xdd7f('0x39')](_0x57186d);}catch(_0x42e23d){logger[_0xdd7f('0x10')](_0x42e23d);}if(_0x3de0f6&&_0x3de0f6[_0xdd7f('0x49')]){_0x163773=_0x3de0f6['results'][_0xdd7f('0x4a')](function(_0x434464){return _0x434464&&_0x434464[_0xdd7f('0x4b')][0x0]&&_0x434464[_0xdd7f('0x4b')][0x0][_0xdd7f('0x4c')]?_0x434464[_0xdd7f('0x4b')][0x0][_0xdd7f('0x4c')]:'';})[_0xdd7f('0x4d')]('\x0a');_0x7b86bc=_0x3de0f6[_0xdd7f('0x49')][_0xdd7f('0x4a')](function(_0x178c82){return _0x178c82&&_0x178c82['alternatives'][0x0]&&_0x178c82['alternatives'][0x0][_0xdd7f('0x4e')]?_0x178c82['alternatives'][0x0][_0xdd7f('0x4e')]:0x0;})[_0xdd7f('0x4d')]('\x0a');}logger[_0xdd7f('0x16')](_0xdd7f('0x4f'),_0x163773);logger[_0xdd7f('0x16')]('googleASR\x20confidence',_0x7b86bc);return{'transcript':_0x163773,'confidence':_0x7b86bc};})['catch'](function(_0x4d6b0f){logger[_0xdd7f('0x10')](_0xdd7f('0x50'),_0x4d6b0f[_0xdd7f('0xf')],_0x4d6b0f[_0xdd7f('0x51')],_0x4d6b0f['message']);});};exports['googleDialogflow']=function(_0x676c79,_0x28f8db,_0x326650,_0x4388a0){var _0x288b3d=apiai(_0x28f8db,{'language':_0x4388a0||'en'});return _0x288b3d[_0xdd7f('0x52')](_0x326650,{'sessionId':md5(_0x676c79)})[_0xdd7f('0x25')](function(_0x385c42){logger[_0xdd7f('0x16')](JSON[_0xdd7f('0x3f')](_0x385c42));return{'source':_0x385c42[_0xdd7f('0x53')][_0xdd7f('0x54')],'resolvedQuery':_0x385c42[_0xdd7f('0x53')][_0xdd7f('0x55')],'action':_0x385c42['result']['action'],'actionIncomplete':_0x385c42[_0xdd7f('0x53')][_0xdd7f('0x56')],'speech':_0x385c42['result'][_0xdd7f('0x57')][_0xdd7f('0x58')],'score':_0x385c42[_0xdd7f('0x53')]['score'],'statusCode':_0x385c42['status'][_0xdd7f('0x59')],'endConversation':_0x385c42[_0xdd7f('0x53')][_0xdd7f('0x5a')][_0xdd7f('0x5b')]||![],'isFallbackIntent':_0x385c42[_0xdd7f('0x53')][_0xdd7f('0x5a')][_0xdd7f('0x5c')]};});};exports[_0xdd7f('0x5d')]=function(_0x223098,_0x546a25,_0x11989c,_0x5a817f,_0x30c0ab,_0x3e7e27){var _0x25c33b=_0x5a817f[_0xdd7f('0x5e')](/\\n/g,'\x0a');var _0x10fdc9={'credentials':{'private_key':_0x25c33b,'client_email':_0x11989c}};var _0x20470e=new dialogflow[(_0xdd7f('0x5f'))](_0x10fdc9);var _0x872578=_0x20470e[_0xdd7f('0x60')](_0x546a25,md5(_0x223098));var _0x2f128e={'session':_0x872578,'queryInput':{'text':{'text':_0x30c0ab,'languageCode':_0x3e7e27}}};return _0x20470e[_0xdd7f('0x61')](_0x2f128e)[_0xdd7f('0x25')](function(_0x41a6dd){if(_0x41a6dd&&_0x41a6dd[_0xdd7f('0x41')]){logger[_0xdd7f('0x16')](_0xdd7f('0x62'),JSON[_0xdd7f('0x3f')](_0x41a6dd));var _0x152f94=_0x41a6dd[0x0];if(_0x152f94){var _0x103ba9={'action':_0x152f94[_0xdd7f('0x63')][_0xdd7f('0x64')],'allRequiredParamsPresent':_0x152f94[_0xdd7f('0x63')][_0xdd7f('0x65')],'endConversation':_0x152f94[_0xdd7f('0x63')][_0xdd7f('0x66')]&&_0x152f94[_0xdd7f('0x63')][_0xdd7f('0x66')][_0xdd7f('0x67')]?_0x152f94[_0xdd7f('0x63')]['diagnosticInfo'][_0xdd7f('0x67')][_0xdd7f('0x68')]['boolValue']:![],'fulfillmentText':_0x152f94[_0xdd7f('0x63')]['fulfillmentText'],'intentName':_0x152f94['queryResult'][_0xdd7f('0x69')]['name'],'intentDisplayName':_0x152f94[_0xdd7f('0x63')]['intent']['displayName'],'isFallbackIntent':_0x152f94[_0xdd7f('0x63')]['intent'][_0xdd7f('0x6a')],'languageCode':_0x152f94[_0xdd7f('0x63')]['languageCode'],'queryText':_0x152f94['queryResult'][_0xdd7f('0x6b')],'responseId':_0x152f94[_0xdd7f('0x6c')],'score':_0x152f94[_0xdd7f('0x63')][_0xdd7f('0x6d')],'speech':_0x152f94[_0xdd7f('0x63')][_0xdd7f('0x6e')],'providerResponse':JSON[_0xdd7f('0x3f')](_0x41a6dd)};return _0x103ba9;}}});};exports[_0xdd7f('0x6f')]=function(_0x53b482,_0x1b1fa7,_0x5b8a4d,_0x4ef2a8){return tilde[_0xdd7f('0x47')](_0x53b482,_0x1b1fa7,_0x5b8a4d,_0x4ef2a8)[_0xdd7f('0x25')](function(_0x3e0444){try{fs['unlink'](_0x53b482);}catch(_0x3fab0b){logger[_0xdd7f('0x10')](_0x3fab0b);}logger[_0xdd7f('0x16')](_0xdd7f('0x70'),_0x3e0444['transcript']);logger['info'](_0xdd7f('0x71'),_0x3e0444[_0xdd7f('0x4e')]);return _0x3e0444;});};exports['awsPolly']=function(_0x875341,_0x1783b7,_0x17c0e6,_0x11fa56,_0x53d1af,_0x4f9dc1){var _0x5a63ca=path[_0xdd7f('0x34')](__dirname,_0xdd7f('0x21'),rs['generate'](0x4)+_0xdd7f('0x36'));var _0x2f5ee1;return aws[_0xdd7f('0x72')](_0x875341,_0x1783b7,_0x17c0e6,_0x11fa56,_0x53d1af,_0x4f9dc1,_0x5a63ca)[_0xdd7f('0x25')](function(){_0x2f5ee1=path[_0xdd7f('0x34')](__dirname,_0xdd7f('0x21'),rs[_0xdd7f('0x35')](0x4)+_0xdd7f('0x22'));return convertFile(_0x5a63ca,_0x2f5ee1);})[_0xdd7f('0x25')](function(){try{fs[_0xdd7f('0x39')](_0x5a63ca);fs[_0xdd7f('0x26')](_0x2f5ee1,_0xdd7f('0x27'));}catch(_0x40f01a){logger[_0xdd7f('0x10')](_0x40f01a);}return _0x2f5ee1['split']('.')[0x0];});};exports['awsLex']=function(_0x132c2a,_0x1a9d67,_0x46b161,_0x500d2c,_0x286ae3,_0x5e3a66){return aws[_0xdd7f('0x73')](_0x132c2a,_0x1a9d67,_0x46b161,_0x500d2c,_0x286ae3,_0x5e3a66)[_0xdd7f('0x25')](function(_0x5058b0){logger[_0xdd7f('0x16')](JSON['stringify'](_0x5058b0));return _0x5058b0;});};exports['ispeechTTS']=function(_0x4464ec,_0x1eaaca,_0x354a2d,_0x3bed06){var _0x202c96=util[_0xdd7f('0x74')](_0xdd7f('0x75'),ISPEECH_API,_0x4464ec,encodeURIComponent(_0x1eaaca),_0x354a2d,_0x3bed06);var _0x228b52=path[_0xdd7f('0x34')](__dirname,'tmp',rs[_0xdd7f('0x35')](0x4)+'.mp3');var _0x59a429;return downloadFile(_0x202c96,_0x228b52)['then'](function(){_0x59a429=path[_0xdd7f('0x34')](__dirname,_0xdd7f('0x21'),rs[_0xdd7f('0x35')](0x4)+'.wav');return convertFile(_0x228b52,_0x59a429);})[_0xdd7f('0x25')](function(){try{fs[_0xdd7f('0x39')](_0x228b52);fs[_0xdd7f('0x26')](_0x59a429,_0xdd7f('0x27'));}catch(_0x56f2b6){logger['error'](_0x56f2b6);}return _0x59a429['split']('.')[0x0];});};exports['ispeechASR']=function(_0x4ff6df,_0x2b5b51,_0x351ebf,_0x281e15){var _0x2f10b6=util[_0xdd7f('0x74')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x2b5b51,_0x351ebf,base64Encode(_0x4ff6df),_0x281e15?util['format'](_0xdd7f('0x76'),encodeURIComponent(_0x281e15)):_0xdd7f('0x77'));return uploadFile(_0x2f10b6)[_0xdd7f('0x25')](function(_0x2c483c){return querystring[_0xdd7f('0x78')](_0x2c483c);});};exports['sestekNDA']=function(_0x57cef3,_0x5ca1f8){return sestek[_0xdd7f('0x79')](_0x57cef3,_0x5ca1f8)[_0xdd7f('0x25')](function(_0x84c9f1){logger[_0xdd7f('0x16')](JSON[_0xdd7f('0x3f')](_0x84c9f1));var _0x80a2d1={'speech':_0x84c9f1[_0xdd7f('0x7a')],'action':_0x84c9f1[_0xdd7f('0x7b')]?_0x84c9f1[_0xdd7f('0x7b')][_0xdd7f('0x7c')]:undefined,'actiondata':_0x84c9f1[_0xdd7f('0x7b')]?_0x84c9f1[_0xdd7f('0x7b')][_0xdd7f('0x7d')]:undefined};if(_0x84c9f1[_0xdd7f('0x7b')]&&_0x84c9f1[_0xdd7f('0x7b')]['AudioFromTts']){return base64Decode(_0x84c9f1[_0xdd7f('0x7b')][_0xdd7f('0x7e')][_0xdd7f('0x7f')],path[_0xdd7f('0x34')](__dirname,_0xdd7f('0x21'),rs[_0xdd7f('0x35')](0x4)+_0xdd7f('0x22')))[_0xdd7f('0x25')](function(_0x3cc969){_0x80a2d1[_0xdd7f('0x80')]=_0x3cc969;return _0x80a2d1;});}return _0x80a2d1;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x1d7a=['./google','./sestek','../../../config/logger','agi','protocol','https:','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','info','close','unlink','download\x20error','pipe','host','path','data','end','transcode','wav','error\x20convert','start','resolve','writeFileSync','chmodSync','777','readFileSync','base64','https://texttospeech.googleapis.com/v1/','ssml','input','audioConfig','MP3','text:synthesize','POST','then','tmp','generate','from','writeFile','.wav','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','source','result','action','actionIncomplete','fulfillment','speech','status','code','endConversation','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','diagnosticInfo','queryResult','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','parse','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','dialogflow','https','md5','querystring','request-promise','randomstring','sox','google-tts-api','url','util'];(function(_0xaabea0,_0x5f4ac7){var _0x4f366d=function(_0x47a9fc){while(--_0x47a9fc){_0xaabea0['push'](_0xaabea0['shift']());}};_0x4f366d(++_0x5f4ac7);}(_0x1d7a,0x187));var _0xa1d7=function(_0x1ebeea,_0x2f54f4){_0x1ebeea=_0x1ebeea-0x0;var _0x576465=_0x1d7a[_0x1ebeea];return _0x576465;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xa1d7('0x0'));var dialogflow=require(_0xa1d7('0x1'));var fs=require('fs');var http=require('http');var https=require(_0xa1d7('0x2'));var md5=require(_0xa1d7('0x3'));var path=require('path');var querystring=require(_0xa1d7('0x4'));var rp=require(_0xa1d7('0x5'));var rs=require(_0xa1d7('0x6'));var sox=require(_0xa1d7('0x7'));var tts=require(_0xa1d7('0x8'));var urlParse=require(_0xa1d7('0x9'))['parse'];var util=require(_0xa1d7('0xa'));var aws=require('./aws');var google=require(_0xa1d7('0xb'));var sestek=require(_0xa1d7('0xc'));var tilde=require('./tilde');var logger=require(_0xa1d7('0xd'))(_0xa1d7('0xe'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x2c65ce,_0x117d32){return new BPromise(function(_0x264ec2,_0x130e6a){var _0x432212=urlParse(_0x2c65ce);var _0xee9add=_0x432212[_0xa1d7('0xf')]===_0xa1d7('0x10')?https:http;var _0x159161={'host':_0x432212['host'],'path':_0x432212['path'],'headers':{'user-agent':_0xa1d7('0x11')}};_0xee9add[_0xa1d7('0x12')](_0x159161,function(_0xecefbc){if(_0xecefbc['statusCode']!==0xc8){logger[_0xa1d7('0x13')](_0xa1d7('0x14')+_0x2c65ce+_0xa1d7('0x15')+_0xecefbc[_0xa1d7('0x16')]+'\x20('+_0xecefbc[_0xa1d7('0x17')]+')');_0x130e6a(new Error(_0xa1d7('0x14')+_0x2c65ce+'\x20failed,\x20status\x20code\x20=\x20'+_0xecefbc[_0xa1d7('0x16')]+'\x20('+_0xecefbc['statusMessage']+')'));return;}var _0x2a38f1=fs[_0xa1d7('0x18')](_0x117d32);_0x2a38f1['on']('finish',function(){logger[_0xa1d7('0x19')]('finish\x20download\x20file');_0x2a38f1[_0xa1d7('0x1a')](_0x264ec2);});_0x2a38f1['on'](_0xa1d7('0x13'),function(_0x77bdd2){fs[_0xa1d7('0x1b')](_0x117d32);logger[_0xa1d7('0x13')](_0xa1d7('0x1c'),_0x77bdd2);_0x130e6a(_0x77bdd2);});_0xecefbc[_0xa1d7('0x1d')](_0x2a38f1);})['on']('error',function(_0x580945){logger[_0xa1d7('0x13')](_0x580945);_0x130e6a(_0x580945);})['end']();});}function uploadFile(_0x47fc0c){return new BPromise(function(_0x5d9a75,_0x4eceff){var _0x233b3a=urlParse(_0x47fc0c);var _0x35ff90=_0x233b3a['protocol']===_0xa1d7('0x10')?https:http;var _0x8f7c7c={'host':_0x233b3a[_0xa1d7('0x1e')],'path':_0x233b3a[_0xa1d7('0x1f')],'headers':{'user-agent':'WHAT_EVER'}};_0x35ff90[_0xa1d7('0x12')](_0x8f7c7c,function(_0x20d794){if(_0x20d794[_0xa1d7('0x16')]!==0xc8){_0x4eceff(new Error(_0xa1d7('0x14')+_0x47fc0c+_0xa1d7('0x15')+_0x20d794[_0xa1d7('0x16')]+'\x20('+_0x20d794[_0xa1d7('0x17')]+')'));return;}var _0x31a48d='';_0x20d794['on'](_0xa1d7('0x20'),function(_0x221a5f){_0x31a48d+=_0x221a5f;});_0x20d794['on'](_0xa1d7('0x21'),function(){_0x5d9a75(_0x31a48d);});})['on'](_0xa1d7('0x13'),function(_0xfda49){_0x4eceff(_0xfda49);})[_0xa1d7('0x21')]();});}function convertFile(_0x265b70,_0x362b4d){return new BPromise(function(_0x3d1084,_0x8e47a5){var _0x2b90c4=sox[_0xa1d7('0x22')](_0x265b70,_0x362b4d,{'sampleRate':0x1f40,'format':_0xa1d7('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2b90c4['on'](_0xa1d7('0x13'),function(_0x10857e){logger[_0xa1d7('0x13')](_0xa1d7('0x24'),_0x10857e);_0x8e47a5(_0x10857e);});_0x2b90c4['on'](_0xa1d7('0x21'),function(){logger[_0xa1d7('0x19')]('finish\x20to\x20convert');_0x3d1084();});_0x2b90c4[_0xa1d7('0x25')]();});}function base64Decode(_0x107db4,_0x3ed6fb){var _0x275946=path[_0xa1d7('0x26')](__dirname,'tmp',rs['generate'](0x4)+'.wav');fs[_0xa1d7('0x27')](_0x275946,_0x107db4,'base64');return convertFile(_0x275946,_0x3ed6fb)['then'](function(){try{fs['unlink'](_0x275946);fs[_0xa1d7('0x28')](_0x3ed6fb,_0xa1d7('0x29'));}catch(_0x518405){logger[_0xa1d7('0x13')](_0x518405);}return _0x3ed6fb['split']('.')[0x0];});}function base64Encode(_0xda49e){var _0x44c15e=fs[_0xa1d7('0x2a')](_0xda49e);return new Buffer(_0x44c15e)['toString'](_0xa1d7('0x2b'));}exports['googleCloudTTS']=function(_0x5ccc61,_0x5e2df8,_0x251309,_0x62f06e,_0x53185a,_0x1b7235){var _0x589b91,_0xaa649f;var _0x95da4d=_0xa1d7('0x2c');var _0x5acb3c='?key='+_0x5ccc61;var _0x447858={};if(_0x5e2df8===_0xa1d7('0x2d')){_0x447858[_0xa1d7('0x2e')]={'ssml':_0x251309};}else{_0x447858[_0xa1d7('0x2e')]={'text':_0x251309};};_0x447858['voice']={'languageCode':_0x62f06e,'ssmlGender':_0x53185a};_0x447858[_0xa1d7('0x2f')]={'audioEncoding':_0xa1d7('0x30'),'sampleRateHertz':0x1f40};var _0x2c6121={'url':_0x95da4d+_0xa1d7('0x31')+_0x5acb3c,'method':_0xa1d7('0x32'),'json':!![],'body':_0x447858};return rp(_0x2c6121)[_0xa1d7('0x33')](function(_0x3f90bd){return new BPromise(function(_0x328438,_0x31decd){_0x589b91=path[_0xa1d7('0x26')](__dirname,_0xa1d7('0x34'),rs[_0xa1d7('0x35')](0x4)+'.mp3');var _0x181f4b=Buffer[_0xa1d7('0x36')](_0x3f90bd['audioContent'],_0xa1d7('0x2b'));return fs[_0xa1d7('0x37')](_0x589b91,_0x181f4b,function(_0x155b62){_0x31decd(_0x155b62);},function(_0x304a66){fs[_0xa1d7('0x28')](_0x589b91,_0xa1d7('0x29'));_0x328438(_0x304a66);});});})[_0xa1d7('0x33')](function(_0x567860){_0xaa649f=path['resolve'](__dirname,_0xa1d7('0x34'),rs[_0xa1d7('0x35')](0x4)+_0xa1d7('0x38'));return convertFile(_0x589b91,_0xaa649f);})['then'](function(){try{fs[_0xa1d7('0x1b')](_0x589b91);fs[_0xa1d7('0x28')](_0xaa649f,_0xa1d7('0x29'));}catch(_0x2025a5){logger[_0xa1d7('0x13')](_0x2025a5);}logger['info']('googleCloudTTS\x20path',_0xaa649f[_0xa1d7('0x39')]('.')[0x0]);return _0xaa649f[_0xa1d7('0x39')]('.')[0x0];});};exports['googleTTS']=function(_0x3555be,_0x4e1a72){var _0x50d62a=_0xa1d7('0x3a');var _0x57eddf,_0x19af9b;var _0x3bde36;var _0x4f2266={'encoding':'utf8','method':_0xa1d7('0x32'),'timeout':0x2710,'url':_0x50d62a,'headers':{'Content-Type':_0xa1d7('0x3b')},'body':_0xa1d7('0x3c')+encodeURIComponent(JSON[_0xa1d7('0x3d')]([[['jQ1olc',JSON[_0xa1d7('0x3d')]([_0x3555be,_0x4e1a72||'en',![],'null']),null,_0xa1d7('0x3e')]]]))};return rp(_0x4f2266)[_0xa1d7('0x33')](function(_0x5c7088){try{_0x3bde36=eval(_0x5c7088[_0xa1d7('0x3f')](0x5))[0x0][0x2];}catch(_0x32688f){throw new Error(_0xa1d7('0x40')+_0x5c7088[_0xa1d7('0x20')]);}if(!_0x3bde36){if(_0x3555be[_0xa1d7('0x41')]>0xc8){throw new Error(_0xa1d7('0x42'));}else{throw new Error(_0xa1d7('0x43')+_0x4e1a72+_0xa1d7('0x44'));}}try{_0x3bde36=eval(_0x3bde36)[0x0];}catch(_0x1a5cb8){throw new Error(_0xa1d7('0x40')+res[_0xa1d7('0x20')]);}const _0x470a61=_0x3bde36;_0x57eddf=path[_0xa1d7('0x26')](__dirname,_0xa1d7('0x34'),rs[_0xa1d7('0x35')](0x4)+_0xa1d7('0x45'));fs[_0xa1d7('0x27')](_0x57eddf,_0x3bde36,{'encoding':_0xa1d7('0x2b')});_0x19af9b=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x57eddf,_0x19af9b);})[_0xa1d7('0x33')](function(){try{fs[_0xa1d7('0x1b')](_0x57eddf);fs[_0xa1d7('0x28')](_0x19af9b,_0xa1d7('0x29'));}catch(_0x3f807f){logger[_0xa1d7('0x13')](_0x3f807f);}logger[_0xa1d7('0x19')](_0xa1d7('0x46'),_0x19af9b[_0xa1d7('0x39')]('.')[0x0]);return _0x19af9b['split']('.')[0x0];});};exports[_0xa1d7('0x47')]=function(_0x42ba79,_0x44ab3f,_0x167bea){return google[_0xa1d7('0x48')](_0x42ba79,_0x44ab3f,_0x167bea)[_0xa1d7('0x33')](function(_0x4649b6){logger['info'](_0x4649b6[_0xa1d7('0x49')]);return rp(_0x4649b6);})[_0xa1d7('0x33')](function(_0x234b98){var _0x56be20='';var _0x832123=0x0;try{fs[_0xa1d7('0x1b')](_0x42ba79);}catch(_0x3da67a){logger[_0xa1d7('0x13')](_0x3da67a);}if(_0x234b98&&_0x234b98[_0xa1d7('0x4a')]){_0x56be20=_0x234b98[_0xa1d7('0x4a')]['map'](function(_0x2006b9){return _0x2006b9&&_0x2006b9[_0xa1d7('0x4b')][0x0]&&_0x2006b9['alternatives'][0x0][_0xa1d7('0x4c')]?_0x2006b9[_0xa1d7('0x4b')][0x0][_0xa1d7('0x4c')]:'';})['join']('\x0a');_0x832123=_0x234b98[_0xa1d7('0x4a')][_0xa1d7('0x4d')](function(_0x2fb603){return _0x2fb603&&_0x2fb603[_0xa1d7('0x4b')][0x0]&&_0x2fb603[_0xa1d7('0x4b')][0x0][_0xa1d7('0x4e')]?_0x2fb603[_0xa1d7('0x4b')][0x0][_0xa1d7('0x4e')]:0x0;})['join']('\x0a');}logger['info'](_0xa1d7('0x4f'),_0x56be20);logger[_0xa1d7('0x19')](_0xa1d7('0x50'),_0x832123);return{'transcript':_0x56be20,'confidence':_0x832123};})[_0xa1d7('0x51')](function(_0x1f03bd){logger[_0xa1d7('0x13')](_0xa1d7('0x52'),_0x1f03bd[_0xa1d7('0x16')],_0x1f03bd[_0xa1d7('0x53')],_0x1f03bd[_0xa1d7('0x54')]);});};exports['googleDialogflow']=function(_0xe4ca45,_0x349ad9,_0x43d1e3,_0x54d68e){var _0x4ddcc1=apiai(_0x349ad9,{'language':_0x54d68e||'en'});return _0x4ddcc1[_0xa1d7('0x55')](_0x43d1e3,{'sessionId':md5(_0xe4ca45)})[_0xa1d7('0x33')](function(_0x2edfac){logger[_0xa1d7('0x19')](JSON[_0xa1d7('0x3d')](_0x2edfac));return{'source':_0x2edfac['result'][_0xa1d7('0x56')],'resolvedQuery':_0x2edfac['result']['resolvedQuery'],'action':_0x2edfac[_0xa1d7('0x57')][_0xa1d7('0x58')],'actionIncomplete':_0x2edfac[_0xa1d7('0x57')][_0xa1d7('0x59')],'speech':_0x2edfac[_0xa1d7('0x57')][_0xa1d7('0x5a')][_0xa1d7('0x5b')],'score':_0x2edfac[_0xa1d7('0x57')]['score'],'statusCode':_0x2edfac[_0xa1d7('0x5c')][_0xa1d7('0x5d')],'endConversation':_0x2edfac[_0xa1d7('0x57')]['metadata'][_0xa1d7('0x5e')]||![],'isFallbackIntent':_0x2edfac[_0xa1d7('0x57')]['metadata']['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x497240,_0xf85135,_0x5aa977,_0x1a9c4a,_0x4863a1,_0x9c9e51){var _0x2261ff=_0x1a9c4a[_0xa1d7('0x5f')](/\\n/g,'\x0a');var _0x5d7f40={'credentials':{'private_key':_0x2261ff,'client_email':_0x5aa977}};var _0x30b51f=new dialogflow[(_0xa1d7('0x60'))](_0x5d7f40);var _0x3d69d9=_0x30b51f['sessionPath'](_0xf85135,md5(_0x497240));var _0x49954f={'session':_0x3d69d9,'queryInput':{'text':{'text':_0x4863a1,'languageCode':_0x9c9e51}}};return _0x30b51f[_0xa1d7('0x61')](_0x49954f)[_0xa1d7('0x33')](function(_0x2d1fac){if(_0x2d1fac&&_0x2d1fac[_0xa1d7('0x41')]){logger[_0xa1d7('0x19')](_0xa1d7('0x62'),JSON[_0xa1d7('0x3d')](_0x2d1fac));var _0x4934a5=_0x2d1fac[0x0];if(_0x4934a5){var _0xbf72c0={'action':_0x4934a5['queryResult']['action'],'allRequiredParamsPresent':_0x4934a5['queryResult'][_0xa1d7('0x63')],'endConversation':_0x4934a5['queryResult']['diagnosticInfo']&&_0x4934a5['queryResult'][_0xa1d7('0x64')]['fields']?_0x4934a5[_0xa1d7('0x65')][_0xa1d7('0x64')][_0xa1d7('0x66')][_0xa1d7('0x67')][_0xa1d7('0x68')]:![],'fulfillmentText':_0x4934a5[_0xa1d7('0x65')][_0xa1d7('0x69')],'intentName':_0x4934a5[_0xa1d7('0x65')][_0xa1d7('0x6a')]['name'],'intentDisplayName':_0x4934a5['queryResult'][_0xa1d7('0x6a')][_0xa1d7('0x6b')],'isFallbackIntent':_0x4934a5[_0xa1d7('0x65')][_0xa1d7('0x6a')][_0xa1d7('0x6c')],'languageCode':_0x4934a5[_0xa1d7('0x65')][_0xa1d7('0x6d')],'queryText':_0x4934a5['queryResult'][_0xa1d7('0x6e')],'responseId':_0x4934a5['responseId'],'score':_0x4934a5[_0xa1d7('0x65')][_0xa1d7('0x6f')],'speech':_0x4934a5[_0xa1d7('0x65')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x2d1fac)};return _0xbf72c0;}}});};exports[_0xa1d7('0x70')]=function(_0xde622a,_0x50fcf2,_0x37826e,_0x9e9e19){return tilde[_0xa1d7('0x48')](_0xde622a,_0x50fcf2,_0x37826e,_0x9e9e19)[_0xa1d7('0x33')](function(_0x27595b){try{fs[_0xa1d7('0x1b')](_0xde622a);}catch(_0x57338f){logger[_0xa1d7('0x13')](_0x57338f);}logger[_0xa1d7('0x19')](_0xa1d7('0x71'),_0x27595b['transcript']);logger[_0xa1d7('0x19')](_0xa1d7('0x72'),_0x27595b[_0xa1d7('0x4e')]);return _0x27595b;});};exports[_0xa1d7('0x73')]=function(_0x17f785,_0x291c61,_0x221144,_0x58099f,_0x41695d,_0x597a5f){var _0x29f51b=path[_0xa1d7('0x26')](__dirname,_0xa1d7('0x34'),rs['generate'](0x4)+_0xa1d7('0x45'));var _0x435f75;return aws[_0xa1d7('0x74')](_0x17f785,_0x291c61,_0x221144,_0x58099f,_0x41695d,_0x597a5f,_0x29f51b)[_0xa1d7('0x33')](function(){_0x435f75=path[_0xa1d7('0x26')](__dirname,_0xa1d7('0x34'),rs[_0xa1d7('0x35')](0x4)+'.wav');return convertFile(_0x29f51b,_0x435f75);})['then'](function(){try{fs[_0xa1d7('0x1b')](_0x29f51b);fs[_0xa1d7('0x28')](_0x435f75,_0xa1d7('0x29'));}catch(_0x1799bb){logger['error'](_0x1799bb);}return _0x435f75[_0xa1d7('0x39')]('.')[0x0];});};exports[_0xa1d7('0x75')]=function(_0x12d2d0,_0x14b5a9,_0x4534b7,_0x41b492,_0x584baa,_0x4a2163){return aws['lex'](_0x12d2d0,_0x14b5a9,_0x4534b7,_0x41b492,_0x584baa,_0x4a2163)[_0xa1d7('0x33')](function(_0x34034e){logger[_0xa1d7('0x19')](JSON[_0xa1d7('0x3d')](_0x34034e));return _0x34034e;});};exports[_0xa1d7('0x76')]=function(_0x47c12a,_0x26236d,_0x157d60,_0x24d0dd){var _0x546ed9=util[_0xa1d7('0x77')](_0xa1d7('0x78'),ISPEECH_API,_0x47c12a,encodeURIComponent(_0x26236d),_0x157d60,_0x24d0dd);var _0x3fece9=path['resolve'](__dirname,_0xa1d7('0x34'),rs[_0xa1d7('0x35')](0x4)+_0xa1d7('0x45'));var _0x279ecf;return downloadFile(_0x546ed9,_0x3fece9)['then'](function(){_0x279ecf=path[_0xa1d7('0x26')](__dirname,_0xa1d7('0x34'),rs[_0xa1d7('0x35')](0x4)+_0xa1d7('0x38'));return convertFile(_0x3fece9,_0x279ecf);})[_0xa1d7('0x33')](function(){try{fs[_0xa1d7('0x1b')](_0x3fece9);fs[_0xa1d7('0x28')](_0x279ecf,_0xa1d7('0x29'));}catch(_0x5dedaf){logger[_0xa1d7('0x13')](_0x5dedaf);}return _0x279ecf[_0xa1d7('0x39')]('.')[0x0];});};exports[_0xa1d7('0x79')]=function(_0x51d682,_0x1d8b32,_0x13df23,_0x33c793){var _0x51911d=util[_0xa1d7('0x77')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x1d8b32,_0x13df23,base64Encode(_0x51d682),_0x33c793?util[_0xa1d7('0x77')](_0xa1d7('0x7a'),encodeURIComponent(_0x33c793)):_0xa1d7('0x7b'));return uploadFile(_0x51911d)[_0xa1d7('0x33')](function(_0x58b427){return querystring[_0xa1d7('0x7c')](_0x58b427);});};exports[_0xa1d7('0x7d')]=function(_0x3be21f,_0x16cb68){return sestek[_0xa1d7('0x7e')](_0x3be21f,_0x16cb68)[_0xa1d7('0x33')](function(_0xe2f185){logger[_0xa1d7('0x19')](JSON['stringify'](_0xe2f185));var _0x3edc42={'speech':_0xe2f185[_0xa1d7('0x7f')],'action':_0xe2f185[_0xa1d7('0x80')]?_0xe2f185[_0xa1d7('0x80')]['CustomAction']:undefined,'actiondata':_0xe2f185[_0xa1d7('0x80')]?_0xe2f185[_0xa1d7('0x80')][_0xa1d7('0x81')]:undefined};if(_0xe2f185[_0xa1d7('0x80')]&&_0xe2f185[_0xa1d7('0x80')][_0xa1d7('0x82')]){return base64Decode(_0xe2f185['channelData'][_0xa1d7('0x82')][_0xa1d7('0x83')],path[_0xa1d7('0x26')](__dirname,'tmp',rs[_0xa1d7('0x35')](0x4)+_0xa1d7('0x38')))[_0xa1d7('0x33')](function(_0x45fb6e){_0x3edc42[_0xa1d7('0x84')]=_0x45fb6e;return _0x3edc42;});}return _0x3edc42;});};exports[_0xa1d7('0x85')]=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 8ae4a4f..5831553 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 _0x6d42=['./nda','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x6d42,0x168));var _0x26d4=function(_0x334629,_0x3e0a25){_0x334629=_0x334629-0x0;var _0x6d4bc1=_0x6d42[_0x334629];return _0x6d4bc1;};var nda=require(_0x26d4('0x0'));module[_0x26d4('0x1')]={'nda':nda}; \ No newline at end of file +var _0x80ad=['exports'];(function(_0x5721c4,_0x2ffbd4){var _0x597a5f=function(_0x2387a5){while(--_0x2387a5){_0x5721c4['push'](_0x5721c4['shift']());}};_0x597a5f(++_0x2ffbd4);}(_0x80ad,0x1ba));var _0xd80a=function(_0x5a69b5,_0x167340){_0x5a69b5=_0x5a69b5-0x0;var _0x33a7fe=_0x80ad[_0x5a69b5];return _0x33a7fe;};var nda=require('./nda');module[_0xd80a('0x0')]={'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 72fad88..63b66c2 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 _0x8844=['ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','CustomActionData','custom_action_data','info','stringify','request-promise','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','channelData','ProjectName'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x8844,0xf0));var _0x4884=function(_0x1a6bc2,_0x126f66){_0x1a6bc2=_0x1a6bc2-0x0;var _0x147952=_0x8844[_0x1a6bc2];return _0x147952;};'use strict';var rp=require(_0x4884('0x0'));var url=require('url');var logger=require(_0x4884('0x1'))(_0x4884('0x2'));module[_0x4884('0x3')]=function(_0x5763cb,_0x5008be){var _0x312d29={'method':_0x4884('0x4'),'uri':url[_0x4884('0x5')](_0x5008be[_0x4884('0x6')],_0x4884('0x7')),'form':{'grant_type':'password','username':_0x5008be[_0x4884('0x8')],'password':_0x5008be[_0x4884('0x9')]},'json':!![]};return rp(_0x312d29)['then'](function(_0x598bcd){var _0x165749={'method':_0x4884('0x4'),'uri':url[_0x4884('0x5')](_0x5008be[_0x4884('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5008be[_0x4884('0xb')]||_0x4884('0xc'),'channelId':_0x4884('0xd'),'conversation':{'id':_0x5763cb[_0x4884('0xe')]},'from':{'id':_0x5763cb[_0x4884('0xf')],'name':_0x5763cb[_0x4884('0x10')]},'recipient':{'id':_0x5763cb[_0x4884('0x11')],'name':_0x5763cb[_0x4884('0x12')]},'text':_0x5008be['text'],'channelData':{}},'headers':{'Authorization':_0x4884('0x13')+_0x598bcd[_0x4884('0x14')]},'json':!![]};if(_0x5008be[_0x4884('0x15')]){_0x165749['body'][_0x4884('0x16')][_0x4884('0x17')]=_0x5008be[_0x4884('0x15')];}if(_0x5008be[_0x4884('0x18')]=='1'){_0x165749[_0x4884('0x19')][_0x4884('0x16')][_0x4884('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4884('0x1b')};}if(_0x5008be[_0x4884('0x1c')]){_0x165749[_0x4884('0x19')]['channelData']['CustomAction']=_0x5008be[_0x4884('0x1c')];if(_0x5008be['custom_action_data']){_0x165749[_0x4884('0x19')][_0x4884('0x16')][_0x4884('0x1d')]=_0x5008be[_0x4884('0x1e')];}}logger[_0x4884('0x1f')](JSON[_0x4884('0x20')](_0x165749));return rp(_0x165749);});}; \ No newline at end of file +var _0xe8cc=['ndagenerate_audio','AudioOutputSettings','CustomAction','custom_action','custom_action_data','body','info','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','channelData','ProjectName'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xe8cc,0x127));var _0xce8c=function(_0x1f8b88,_0x3a2e67){_0x1f8b88=_0x1f8b88-0x0;var _0x12416c=_0xe8cc[_0x1f8b88];return _0x12416c;};'use strict';var rp=require(_0xce8c('0x0'));var url=require(_0xce8c('0x1'));var logger=require(_0xce8c('0x2'))(_0xce8c('0x3'));module[_0xce8c('0x4')]=function(_0x1e616d,_0xb3038f){var _0x4e52ff={'method':_0xce8c('0x5'),'uri':url[_0xce8c('0x6')](_0xb3038f[_0xce8c('0x7')],_0xce8c('0x8')),'form':{'grant_type':_0xce8c('0x9'),'username':_0xb3038f[_0xce8c('0xa')],'password':_0xb3038f[_0xce8c('0x9')]},'json':!![]};return rp(_0x4e52ff)[_0xce8c('0xb')](function(_0x5cd157){var _0x469855={'method':_0xce8c('0x5'),'uri':url[_0xce8c('0x6')](_0xb3038f['ndassistant_url'],_0xce8c('0xc')),'body':{'type':_0xb3038f[_0xce8c('0xd')]||_0xce8c('0xe'),'channelId':'Nda','conversation':{'id':_0x1e616d[_0xce8c('0xf')]},'from':{'id':_0x1e616d['callerid'],'name':_0x1e616d[_0xce8c('0x10')]},'recipient':{'id':_0x1e616d[_0xce8c('0x11')],'name':_0x1e616d[_0xce8c('0x12')]},'text':_0xb3038f[_0xce8c('0x13')],'channelData':{}},'headers':{'Authorization':_0xce8c('0x14')+_0x5cd157[_0xce8c('0x15')]},'json':!![]};if(_0xb3038f[_0xce8c('0x16')]){_0x469855['body'][_0xce8c('0x17')][_0xce8c('0x18')]=_0xb3038f[_0xce8c('0x16')];}if(_0xb3038f[_0xce8c('0x19')]=='1'){_0x469855['body']['channelData'][_0xce8c('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0xb3038f['custom_action']){_0x469855['body'][_0xce8c('0x17')][_0xce8c('0x1b')]=_0xb3038f[_0xce8c('0x1c')];if(_0xb3038f[_0xce8c('0x1d')]){_0x469855[_0xce8c('0x1e')][_0xce8c('0x17')]['CustomActionData']=_0xb3038f[_0xce8c('0x1d')];}}logger[_0xce8c('0x1f')](JSON['stringify'](_0x469855));return rp(_0x469855);});}; \ 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 5dfeea3..3121932 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 _0x3e80=['./lib/api'];(function(_0x137bdb,_0x5a71ab){var _0x468bb7=function(_0x1efbaf){while(--_0x1efbaf){_0x137bdb['push'](_0x137bdb['shift']());}};_0x468bb7(++_0x5a71ab);}(_0x3e80,0x1b8));var _0x03e8=function(_0xce9195,_0x1963e1){_0xce9195=_0xce9195-0x0;var _0x530fe6=_0x3e80[_0xce9195];return _0x530fe6;};'use strict';var asr=require(_0x03e8('0x0'));module['exports']=function(_0x32a1c8,_0x6ec942,_0x1426b5,_0x52c605){return asr(_0x32a1c8,_0x6ec942,_0x1426b5,_0x52c605);}; \ No newline at end of file +var _0x568d=['exports','./lib/api'];(function(_0x5bc5fe,_0x2afaef){var _0x298ea7=function(_0x1c6bd5){while(--_0x1c6bd5){_0x5bc5fe['push'](_0x5bc5fe['shift']());}};_0x298ea7(++_0x2afaef);}(_0x568d,0x191));var _0xd568=function(_0x212dad,_0xb862ef){_0x212dad=_0x212dad-0x0;var _0x4fea3f=_0x568d[_0x212dad];return _0x4fea3f;};'use strict';var asr=require(_0xd568('0x0'));module[_0xd568('0x1')]=function(_0x5baa39,_0x4eb7d6,_0x481179,_0x1c0b69){return asr(_0x5baa39,_0x4eb7d6,_0x481179,_0x1c0b69);}; \ 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 b272262..5abd507 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 _0x581e=['isNil','open','message','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x581e,0x162));var _0xe581=function(_0x434567,_0x1f127b){_0x434567=_0x434567-0x0;var _0x3257a1=_0x581e[_0x434567];return _0x3257a1;};'use strict';var BPromise=require(_0xe581('0x0'));var _=require(_0xe581('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xe581('0x2'));var logger=require(_0xe581('0x3'))(_0xe581('0x4'));module[_0xe581('0x5')]=function(_0x275156,_0x7cae51,_0x18d3ba,_0x25c9dc){return new BPromise(function(_0x464641,_0x44263f){logger[_0xe581('0x6')](_0xe581('0x7'),_0x25c9dc||_0xe581('0x8'));var _0x577b7d=new WebSocket(_0x25c9dc||_0xe581('0x8'),{'perMessageDeflate':![]});var _0x550dd3='';var _0xa300ef='0';var _0x10ee66='1';var _0x18621d=_0xe581('0x9');function _0x4b9735(_0x451e54){var _0x715573=crypto[_0xe581('0xa')](_0xe581('0xb'));_0x715573[_0xe581('0xc')](_0x451e54);return _0x715573[_0xe581('0xd')]('hex');}function _0x2c66c4(){try{logger[_0xe581('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x2d6eb1=moment()[_0xe581('0xe')]();var _0xe6a5c9=_0x4b9735(_0x2d6eb1+_0x7cae51+_0x18d3ba);_0x577b7d[_0xe581('0xf')](JSON[_0xe581('0x10')]({'appID':_0x7cae51,'timestamp':_0x2d6eb1,'appKey':_0xe6a5c9}));var _0x4fbaab=fs[_0xe581('0x11')](_0x275156);_0x4fbaab['on'](_0xe581('0x12'),function(_0x380fe2){_0x577b7d[_0xe581('0xf')](_0x380fe2);});_0x4fbaab['on'](_0xe581('0x13'),function(){_0x577b7d[_0xe581('0xf')](_0xe581('0x14'));});}catch(_0x56bcd2){logger[_0xe581('0x15')](_0xe581('0x16'),JSON[_0xe581('0x10')](_0x56bcd2));_0x577b7d['terminate']();}}function _0x3e1c51(_0x2db945){try{if(_0x2db945){var _0x556118=JSON[_0xe581('0x17')](_0x2db945);switch(_0x556118[_0xe581('0x18')]){case 0x0:if(_0x556118[_0xe581('0x19')]){if(_0x556118[_0xe581('0x19')][_0xe581('0x1a')]){logger[_0xe581('0x6')](_0xe581('0x1b'),JSON['stringify'](_0x556118['result'][_0xe581('0x1c')]));_0x550dd3=_0x556118[_0xe581('0x19')]['hypotheses'][0x0]['transcript'];_0xa300ef=_0x556118['result'][_0xe581('0x1c')][0x0]['likelihood'];_0x10ee66='0';_0x18621d='Success.';_0x577b7d[_0xe581('0x1d')]();}}break;case 0x1:logger[_0xe581('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x10ee66='1';_0x18621d=_0xe581('0x9');break;case 0x2:logger['info'](_0xe581('0x1e'));_0x10ee66='2';_0x18621d=_0xe581('0x1e');break;case 0x9:logger['info'](_0xe581('0x1f'));_0x10ee66='9';_0x18621d=_0xe581('0x1f');break;case 0xa:logger[_0xe581('0x6')](_0xe581('0x20'));_0x10ee66='10';_0x18621d=_0xe581('0x20');break;case 0xb:logger[_0xe581('0x6')](_0xe581('0x21'));_0x10ee66='11';_0x18621d=_0xe581('0x21');}}}catch(_0x176907){logger[_0xe581('0x15')](_0xe581('0x22'),JSON[_0xe581('0x10')](_0x176907));_0x577b7d[_0xe581('0x1d')]();}}function _0x3c227f(){logger[_0xe581('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0x464641({'transcript':_0x550dd3,'confidence':_0xa300ef,'status':_0x10ee66,'status_message':_0x18621d});}function _0x114fb6(_0x432fe8){logger[_0xe581('0x15')](_0xe581('0x23'));if(!_[_0xe581('0x24')](_0x432fe8)){logger[_0xe581('0x15')](_['isObject'](_0x432fe8)?JSON[_0xe581('0x10')](_0x432fe8):_0x432fe8);}}_0x577b7d['on'](_0xe581('0x25'),_0x2c66c4);_0x577b7d['on'](_0xe581('0x26'),_0x3e1c51);_0x577b7d['on'](_0xe581('0x13'),_0x3c227f);_0x577b7d['on'](_0xe581('0x15'),_0x114fb6);});}; \ No newline at end of file +var _0xfa23=['message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','EOS','Tilde\x20ASR\x20send\x20error','stringify','status','result','final','Tilde\x20ASR\x20hypoteses','likelihood','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open'];(function(_0x168698,_0x39e9ca){var _0x20ca66=function(_0x10c3a2){while(--_0x10c3a2){_0x168698['push'](_0x168698['shift']());}};_0x20ca66(++_0x39e9ca);}(_0xfa23,0x1d5));var _0x3fa2=function(_0x34c403,_0x341b70){_0x34c403=_0x34c403-0x0;var _0x5bf2b9=_0xfa23[_0x34c403];return _0x5bf2b9;};'use strict';var BPromise=require(_0x3fa2('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3fa2('0x1'));var crypto=require(_0x3fa2('0x2'));var logger=require(_0x3fa2('0x3'))(_0x3fa2('0x4'));module[_0x3fa2('0x5')]=function(_0xcdeadd,_0x2457b6,_0x586e64,_0xdba7bc){return new BPromise(function(_0x3c636b,_0x745841){logger[_0x3fa2('0x6')](_0x3fa2('0x7'),_0xdba7bc||_0x3fa2('0x8'));var _0x598a81=new WebSocket(_0xdba7bc||_0x3fa2('0x8'),{'perMessageDeflate':![]});var _0x273474='';var _0x5d648c='0';var _0x2f6591='1';var _0x5a2d6a=_0x3fa2('0x9');function _0x578519(_0x34cbf0){var _0x5ae21e=crypto[_0x3fa2('0xa')](_0x3fa2('0xb'));_0x5ae21e[_0x3fa2('0xc')](_0x34cbf0);return _0x5ae21e[_0x3fa2('0xd')](_0x3fa2('0xe'));}function _0x13b465(){try{logger[_0x3fa2('0x6')](_0x3fa2('0xf'));var _0x53b96d=moment()[_0x3fa2('0x10')]();var _0x4df352=_0x578519(_0x53b96d+_0x2457b6+_0x586e64);_0x598a81[_0x3fa2('0x11')](JSON['stringify']({'appID':_0x2457b6,'timestamp':_0x53b96d,'appKey':_0x4df352}));var _0x4ec33b=fs['createReadStream'](_0xcdeadd);_0x4ec33b['on']('data',function(_0x380651){_0x598a81[_0x3fa2('0x11')](_0x380651);});_0x4ec33b['on']('close',function(){_0x598a81[_0x3fa2('0x11')](_0x3fa2('0x12'));});}catch(_0x179abc){logger['error'](_0x3fa2('0x13'),JSON[_0x3fa2('0x14')](_0x179abc));_0x598a81['terminate']();}}function _0x19fc1d(_0x40f673){try{if(_0x40f673){var _0x2ccf76=JSON['parse'](_0x40f673);switch(_0x2ccf76[_0x3fa2('0x15')]){case 0x0:if(_0x2ccf76['result']){if(_0x2ccf76[_0x3fa2('0x16')][_0x3fa2('0x17')]){logger[_0x3fa2('0x6')](_0x3fa2('0x18'),JSON[_0x3fa2('0x14')](_0x2ccf76['result']['hypotheses']));_0x273474=_0x2ccf76[_0x3fa2('0x16')]['hypotheses'][0x0]['transcript'];_0x5d648c=_0x2ccf76[_0x3fa2('0x16')]['hypotheses'][0x0][_0x3fa2('0x19')];_0x2f6591='0';_0x5a2d6a='Success.';_0x598a81[_0x3fa2('0x1a')]();}}break;case 0x1:logger['info'](_0x3fa2('0x9'));_0x2f6591='1';_0x5a2d6a=_0x3fa2('0x9');break;case 0x2:logger[_0x3fa2('0x6')](_0x3fa2('0x1b'));_0x2f6591='2';_0x5a2d6a=_0x3fa2('0x1b');break;case 0x9:logger[_0x3fa2('0x6')](_0x3fa2('0x1c'));_0x2f6591='9';_0x5a2d6a='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info']('Authentication\x20failed.');_0x2f6591='10';_0x5a2d6a='Authentication\x20failed.';break;case 0xb:logger[_0x3fa2('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x2f6591='11';_0x5a2d6a=_0x3fa2('0x1d');}}}catch(_0x3bbce0){logger[_0x3fa2('0x1e')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x3fa2('0x14')](_0x3bbce0));_0x598a81['terminate']();}}function _0x202b47(){logger['info'](_0x3fa2('0x1f'));_0x3c636b({'transcript':_0x273474,'confidence':_0x5d648c,'status':_0x2f6591,'status_message':_0x5a2d6a});}function _0x2f0bab(_0x4a3551){logger[_0x3fa2('0x1e')](_0x3fa2('0x20'));if(!_['isNil'](_0x4a3551)){logger[_0x3fa2('0x1e')](_[_0x3fa2('0x21')](_0x4a3551)?JSON[_0x3fa2('0x14')](_0x4a3551):_0x4a3551);}}_0x598a81['on'](_0x3fa2('0x22'),_0x13b465);_0x598a81['on'](_0x3fa2('0x23'),_0x19fc1d);_0x598a81['on']('close',_0x202b47);_0x598a81['on'](_0x3fa2('0x1e'),_0x2f0bab);});}; \ 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 5d67694..7b4e740 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 _0xcedb=['./asr'];(function(_0x4ab74f,_0x177b0d){var _0x3405be=function(_0x3cd346){while(--_0x3cd346){_0x4ab74f['push'](_0x4ab74f['shift']());}};_0x3405be(++_0x177b0d);}(_0xcedb,0xdd));var _0xbced=function(_0x4ab67b,_0x244b1c){_0x4ab67b=_0x4ab67b-0x0;var _0x2dd50c=_0xcedb[_0x4ab67b];return _0x2dd50c;};var asr=require(_0xbced('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x2906=['./asr','exports'];(function(_0x485fd,_0x21c739){var _0x1b3e43=function(_0xa8d8e2){while(--_0xa8d8e2){_0x485fd['push'](_0x485fd['shift']());}};_0x1b3e43(++_0x21c739);}(_0x2906,0xe0));var _0x6290=function(_0x4032e3,_0x6d6449){_0x4032e3=_0x4032e3-0x0;var _0x34f51a=_0x2906[_0x4032e3];return _0x34f51a;};var asr=require(_0x6290('0x0'));module[_0x6290('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index a2f6364..5b8adda 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 _0x0fc8=['ready','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION'];(function(_0x3fddf3,_0x36ce44){var _0x15650d=function(_0x315a11){while(--_0x315a11){_0x3fddf3['push'](_0x3fddf3['shift']());}};_0x15650d(++_0x36ce44);}(_0x0fc8,0x145));var _0x80fc=function(_0x2bbd70,_0x5ae140){_0x2bbd70=_0x2bbd70-0x0;var _0x3c9b34=_0x0fc8[_0x2bbd70];return _0x3c9b34;};'use strict';var util=require(_0x80fc('0x0'));var net=require(_0x80fc('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x80fc('0x2'));var AGIServer=function(_0x5c035b,_0x499326,_0x4a128e){var _0x862499=this,_0x5c035b=_0x5c035b||0x11dd,_0x499326=_0x499326||_0x80fc('0x3'),_0x42a9ff=null,_0x10b37c=0x0;EventEmitter[_0x80fc('0x4')](_0x862499);function _0x5cb645(){if(!_0x5c035b){_0x862499[_0x80fc('0x5')](_0x80fc('0x6'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x42a9ff=net[_0x80fc('0x7')]();_0x42a9ff[_0x80fc('0x8')](_0x5c035b,_0x499326);_0x42a9ff['on'](_0x80fc('0x9'),function(){_0x862499['emit'](_0x80fc('0x9'));});_0x42a9ff['on']('connection',function(_0x56dc2b){_0x42a9ff[_0x80fc('0xa')](function(_0x449953,_0x19d0a2){if(_0x449953){_0x862499[_0x80fc('0x5')](_0x80fc('0x6'),new AGIError(_0x80fc('0xb'),_0x449953));}else if(_0x4a128e&&_0x4a128e<0x0){_0x862499[_0x80fc('0x5')](_0x80fc('0x6'),new AGIError(_0x80fc('0xc')));_0x56dc2b[_0x80fc('0xd')]();}else if(_0x4a128e&&_0x4a128e>0x0&&_0x4a128e<_0x19d0a2){_0x10b37c+=0x1;_0x862499[_0x80fc('0x5')](_0x80fc('0x6'),new AGIError(_0x80fc('0xe'),_0x10b37c));_0x56dc2b[_0x80fc('0xd')]();}else{var _0x9f0417=new AGIChannel(_0x56dc2b);_0x9f0417['on'](_0x80fc('0xf'),function(){_0x862499[_0x80fc('0x5')]('connection',_0x9f0417);});}});});_0x42a9ff['on'](_0x80fc('0x6'),function(_0x534f29){_0x862499[_0x80fc('0x5')](_0x80fc('0x6'),new AGIError(_0x80fc('0xb'),_0x534f29['code']));});_0x42a9ff['on'](_0x80fc('0x10'),function(){_0x862499['emit'](_0x80fc('0x10'),new AGIError(_0x80fc('0x11')));});}process[_0x80fc('0x12')](function(){_0x5cb645();});};util['inherits'](AGIServer,EventEmitter);module[_0x80fc('0x13')]=function(_0x4878c2,_0x2b0de8,_0x1e46ec){return new AGIServer(_0x4878c2,_0x2b0de8,_0x1e46ec);}; \ No newline at end of file +var _0x8e0d=['connection','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','EventEmitter','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen'];(function(_0x2cd998,_0x3e3cde){var _0x7e5c31=function(_0x25913a){while(--_0x25913a){_0x2cd998['push'](_0x2cd998['shift']());}};_0x7e5c31(++_0x3e3cde);}(_0x8e0d,0x82));var _0xd8e0=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0x8e0d[_0x18f152];return _0xa10b34;};'use strict';var util=require(_0xd8e0('0x0'));var net=require('net');var EventEmitter=require('events')[_0xd8e0('0x1')];var AGIError=require(_0xd8e0('0x2'));var AGIChannel=require('./channel');var AGIServer=function(_0x3ee520,_0x180f36,_0x14598d){var _0xe9c59f=this,_0x3ee520=_0x3ee520||0x11dd,_0x180f36=_0x180f36||_0xd8e0('0x3'),_0x2e79ab=null,_0x33ff41=0x0;EventEmitter[_0xd8e0('0x4')](_0xe9c59f);function _0x5e9735(){if(!_0x3ee520){_0xe9c59f[_0xd8e0('0x5')](_0xd8e0('0x6'),new AGIError(_0xd8e0('0x7')));return![];}_0x2e79ab=net[_0xd8e0('0x8')]();_0x2e79ab[_0xd8e0('0x9')](_0x3ee520,_0x180f36);_0x2e79ab['on']('listening',function(){_0xe9c59f[_0xd8e0('0x5')]('listening');});_0x2e79ab['on'](_0xd8e0('0xa'),function(_0x48e06b){_0x2e79ab['getConnections'](function(_0x6ca388,_0x47004a){if(_0x6ca388){_0xe9c59f[_0xd8e0('0x5')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x6ca388));}else if(_0x14598d&&_0x14598d<0x0){_0xe9c59f[_0xd8e0('0x5')]('error',new AGIError(_0xd8e0('0xb')));_0x48e06b['destroy']();}else if(_0x14598d&&_0x14598d>0x0&&_0x14598d<_0x47004a){_0x33ff41+=0x1;_0xe9c59f['emit']('error',new AGIError(_0xd8e0('0xc'),_0x33ff41));_0x48e06b['destroy']();}else{var _0x34f992=new AGIChannel(_0x48e06b);_0x34f992['on'](_0xd8e0('0xd'),function(){_0xe9c59f[_0xd8e0('0x5')](_0xd8e0('0xa'),_0x34f992);});}});});_0x2e79ab['on'](_0xd8e0('0x6'),function(_0x28f3e0){_0xe9c59f[_0xd8e0('0x5')](_0xd8e0('0x6'),new AGIError(_0xd8e0('0xe'),_0x28f3e0['code']));});_0x2e79ab['on'](_0xd8e0('0xf'),function(){_0xe9c59f[_0xd8e0('0x5')](_0xd8e0('0xf'),new AGIError(_0xd8e0('0x10')));});}process[_0xd8e0('0x11')](function(){_0x5e9735();});};util[_0xd8e0('0x12')](AGIServer,EventEmitter);module[_0xd8e0('0x13')]=function(_0x3dc2d7,_0x4e7238,_0x371136){return new AGIServer(_0x3dc2d7,_0x4e7238,_0x371136);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 933e878..dbe172d 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 _0xc1dc=['Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','streamFile','ispeech\x20TTS\x20is\x20unreachable','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','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','digit','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','service','port','secure','authentication','auth','user','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','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','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','AGI','system','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','util','lodash','odbc','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','open','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','error','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','number','timeout','includes','POST','PUT','toUpperCase','body','parse','rawBody','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','clear','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','isString','saveRestApiResult','isPlainObject','%s.%s','setVariable','split','length','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','getAndSetVariable','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','unlink','aws\x20Polly\x20is\x20unreachable','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr'];(function(_0x4caade,_0x549ce1){var _0x2041ff=function(_0x402f3a){while(--_0x402f3a){_0x4caade['push'](_0x4caade['shift']());}};_0x2041ff(++_0x549ce1);}(_0xc1dc,0x84));var _0xcc1d=function(_0x1af26d,_0x535f9f){_0x1af26d=_0x1af26d-0x0;var _0x3a03be=_0xc1dc[_0x1af26d];return _0x3a03be;};'use strict';var fs=require('fs');var path=require(_0xcc1d('0x0'));var util=require(_0xcc1d('0x1'));var _=require(_0xcc1d('0x2'));var sh=require('shelljs');var odbc=require(_0xcc1d('0x3'))();var rs=require('randomstring');var moment=require(_0xcc1d('0x4'));var Mustache=require(_0xcc1d('0x5'));var rp=require('request-promise');var logger=require(_0xcc1d('0x6'))(_0xcc1d('0x7'));var config=require(_0xcc1d('0x8'));var scripts=require(_0xcc1d('0x9'));var FILES_PATH=_0xcc1d('0xa');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0xcc1d('0xb'),_0xcc1d('0xc'),_0xcc1d('0xd')];var AGIVertices=function(_0x3154cf,_0x16afac,_0x171592){this['channel']=_0x3154cf;this[_0xcc1d('0xe')]=_0x16afac;this[_0xcc1d('0xf')]=_0x171592;};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x11')]=function(_0x2eea62,_0x39a466){this['rpc'][_0xcc1d('0x12')](_0x2eea62)[_0xcc1d('0x13')](function(_0x49b75d){_0x39a466(null,_0x49b75d?_0x49b75d[_0xcc1d('0x14')]:![]);})[_0xcc1d('0x15')](function(_0x1440f6){_0x39a466(_0x1440f6);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x16')]=function(_0x3b251e,_0x18b64a){this['rpc']['getVoiceQueueById'](_0x3b251e)[_0xcc1d('0x13')](function(_0x562648){_0x18b64a(null,_0x562648?_0x562648[_0xcc1d('0x14')]:![]);})[_0xcc1d('0x15')](function(_0x35f147){_0x18b64a(_0x35f147);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x17')]=function(_0x2bf07a,_0x1f9737){this[_0xcc1d('0xe')][_0xcc1d('0x18')](_0x2bf07a)[_0xcc1d('0x13')](function(_0x483963){_0x1f9737(null,_0x483963?_0x483963['name']:![]);})[_0xcc1d('0x15')](function(_0x536641){_0x1f9737(_0x536641);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x19')]=function(_0xf44327,_0x104c54){this[_0xcc1d('0xe')][_0xcc1d('0x1a')](_0xf44327)[_0xcc1d('0x13')](function(_0x1b88f4){_0x104c54(null,_0x1b88f4?_0x1b88f4[_0xcc1d('0x1b')]:![]);})['catch'](function(_0x23189c){_0x104c54(_0x23189c);});};AGIVertices['prototype'][_0xcc1d('0x1c')]=function(_0x1bcf7b,_0x167b9f){this['rpc'][_0xcc1d('0x1d')](_0x1bcf7b)[_0xcc1d('0x13')](function(_0x31a006){_0x167b9f(null,_0x31a006?_0x31a006[_0xcc1d('0x14')]:![]);})[_0xcc1d('0x15')](function(_0x5e2f74){_0x167b9f(_0x5e2f74);});};AGIVertices[_0xcc1d('0x10')]['getTrunk']=function(_0x220eae,_0x114b63){this[_0xcc1d('0xe')][_0xcc1d('0x1e')](_0x220eae)[_0xcc1d('0x13')](function(_0x4f6ec8){_0x114b63(null,_0x4f6ec8?_0x4f6ec8[_0xcc1d('0x14')]:![]);})[_0xcc1d('0x15')](function(_0xec0667){_0x114b63(_0xec0667);});};AGIVertices['prototype'][_0xcc1d('0x1f')]=function(_0x491edb,_0x2d2b0c){var _0x5c521e=this;this[_0xcc1d('0xe')][_0xcc1d('0x20')](_0x491edb)[_0xcc1d('0x13')](function(_0x50b769){_0x2d2b0c(null,_0x50b769?_0x5c521e[_0xcc1d('0x21')](_0x50b769[_0xcc1d('0x22')]):![]);})[_0xcc1d('0x15')](function(_0x4a406f){_0x2d2b0c(_0x4a406f);});};AGIVertices[_0xcc1d('0x10')]['getMailAccount']=function(_0x18cbc0,_0x2a68ef){this[_0xcc1d('0xe')][_0xcc1d('0x23')](_0x18cbc0)[_0xcc1d('0x13')](function(_0x5d9163){_0x2a68ef(null,_0x5d9163?_0x5d9163:![]);})[_0xcc1d('0x15')](function(_0x12aab7){_0x2a68ef(_0x12aab7);});};AGIVertices['prototype'][_0xcc1d('0x24')]=function(_0x5dfe28,_0x1f7dc7,_0x5ac7e9){this['mailRpc'][_0xcc1d('0x24')](_0x5dfe28,_0x1f7dc7)['then'](function(){_0x5ac7e9(null);})[_0xcc1d('0x15')](function(_0x3892a3){_0x5ac7e9(_0x3892a3);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x25')]=function(_0x16ba8b,_0x237a34){this['rpc'][_0xcc1d('0x26')](_0x16ba8b)['then'](function(_0x25ad8e){if(_0x25ad8e){if(_0x25ad8e[_0xcc1d('0x27')]){_0x237a34(null,[_0x25ad8e[_0xcc1d('0x28')]]);}else{_0x237a34(null,_[_0xcc1d('0x29')](_0x25ad8e['Intervals'],_0xcc1d('0x28')));}}else{_0x237a34(null,![]);}})[_0xcc1d('0x15')](function(_0x1252fd){_0x237a34(_0x1252fd);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x21')]=function(_0x26910c){return util[_0xcc1d('0x2a')](_0xcc1d('0x2b'),FILES_PATH,_0x26910c);};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x2c')]=function(_0x57fb8b,_0x5c3596,_0x45aaf6){odbc[_0xcc1d('0x2d')](_0x57fb8b,function(_0x49c5ac){if(_0x49c5ac){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x49c5ac);_0x45aaf6(_0x49c5ac);}else{logger[_0xcc1d('0x2e')](_0xcc1d('0x2f'));odbc[_0xcc1d('0x30')](_0x5c3596,function(_0x38b541,_0x21e60a){if(_0x38b541){logger[_0xcc1d('0x2e')](_0xcc1d('0x31'),_0x5c3596);_0x45aaf6(_0x38b541);}else{logger['info'](_0xcc1d('0x32'),_0x5c3596);odbc['close'](function(_0x51124f){if(_0x51124f){logger['error'](_0xcc1d('0x33'),_0x51124f);}_0x45aaf6(null,_0x21e60a);});}});}});};AGIVertices[_0xcc1d('0x10')]['getSmsAccount']=function(_0x4bb1f2,_0x43c7ae){this['rpc'][_0xcc1d('0x34')](_0x4bb1f2)[_0xcc1d('0x13')](function(_0x41f650){_0x43c7ae(null,_0x41f650?_0x41f650:![]);})['catch'](function(_0xe587a6){_0x43c7ae(_0xe587a6);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x35')]=function(_0x1ea6b6,_0x3e568c){this[_0xcc1d('0xe')][_0xcc1d('0x35')](_0x1ea6b6)['then'](function(_0x11e467){_0x3e568c(null,_0x11e467);})['catch'](function(_0x809c64){_0x3e568c(_0x809c64);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x36')]=function(_0x252361,_0x21e26c,_0x3f5561){this[_0xcc1d('0xe')][_0xcc1d('0x36')]({'uniqueid':this[_0xcc1d('0x37')][_0xcc1d('0x38')],'node':_0x252361[_0xcc1d('0x39')],'application':_0x252361[_0xcc1d('0x3a')],'data':_0x21e26c||null,'project_name':this['channel'][_0xcc1d('0x3b')],'callerid':this[_0xcc1d('0x37')][_0xcc1d('0x3c')]})[_0xcc1d('0x13')](function(_0xc80077){if(_0x3f5561){_0x3f5561(null,_0xc80077);}})[_0xcc1d('0x15')](function(_0x2f2312){if(_0x3f5561){_0x3f5561(_0x2f2312);}});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x3d')]=function(_0x3dde5e,_0x1413c8,_0x559ed0,_0x2cce97){this[_0xcc1d('0xe')][_0xcc1d('0x3d')]({'uniqueid':this[_0xcc1d('0x37')][_0xcc1d('0x38')],'callerid':this[_0xcc1d('0x37')][_0xcc1d('0x3c')],'calleridname':this[_0xcc1d('0x37')][_0xcc1d('0x3e')],'context':this[_0xcc1d('0x37')][_0xcc1d('0x3f')],'extension':this[_0xcc1d('0x37')][_0xcc1d('0x40')],'priority':this[_0xcc1d('0x37')][_0xcc1d('0x41')],'accountcode':this[_0xcc1d('0x37')][_0xcc1d('0x42')],'dnid':this[_0xcc1d('0x37')][_0xcc1d('0x43')],'projectName':this[_0xcc1d('0x37')]['arg_1'],'saveName':_0x1413c8,'filename':_0x3dde5e[_0xcc1d('0x44')]||_0x1413c8,'savePath':_0x559ed0})['then'](function(_0x467fa7){_0x2cce97(null,_0x467fa7);})[_0xcc1d('0x15')](function(_0x5671c2){_0x2cce97(_0x5671c2);});};AGIVertices['prototype'][_0xcc1d('0x45')]=function(_0x1af8d1,_0x264256,_0x12cd53,_0x78b49e,_0x2a5ee2){this['rpc'][_0xcc1d('0x45')]({'uniqueid':this[_0xcc1d('0x37')]['uniqueid'],'body':_0x1af8d1,'direction':_0x264256,'providerName':_0x12cd53,'providerResponse':_0x78b49e})[_0xcc1d('0x13')](function(_0x8fc62a){if(_0x2a5ee2){_0x2a5ee2(null,_0x8fc62a);}})[_0xcc1d('0x15')](function(_0x51ef0f){if(_0x2a5ee2){_0x2a5ee2(_0x51ef0f);}});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x46')]=function(_0x3b232f,_0x50d994){this[_0xcc1d('0xe')][_0xcc1d('0x46')]({'firstName':_[_0xcc1d('0x47')](_0x3b232f[_0xcc1d('0x14')])||_[_0xcc1d('0x48')](_0x3b232f[_0xcc1d('0x14')])?_0xcc1d('0x49')+Math[_0xcc1d('0x4a')]():_0x3b232f['name'],'lastName':_[_0xcc1d('0x47')](_0x3b232f[_0xcc1d('0x4b')])||_['isNil'](_0x3b232f[_0xcc1d('0x4b')])?null:_0x3b232f[_0xcc1d('0x4b')],'phone':_0x3b232f[_0xcc1d('0x4c')],'ListId':_0x3b232f[_0xcc1d('0x4d')],'scheduledat':_0x3b232f[_0xcc1d('0x4e')],'callbackUniqueid':this[_0xcc1d('0x37')][_0xcc1d('0x38')],'tags':_0xcc1d('0x4f'),'description':_0xcc1d('0x50')+_0x3b232f[_0xcc1d('0x4e')][_0xcc1d('0x51')](),'priority':_0x3b232f[_0xcc1d('0x52')]})[_0xcc1d('0x13')](function(_0x46663f){_0x50d994(null,_0x46663f);})[_0xcc1d('0x15')](function(_0x448d5d){_0x50d994(_0x448d5d);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x53')]=function(_0x47ba98,_0x2ef9ad){this['rpc'][_0xcc1d('0x54')](_0x47ba98)[_0xcc1d('0x13')](function(_0x4f0316){_0x2ef9ad(null,_0x4f0316?_0x4f0316[_0xcc1d('0x14')]:![]);})[_0xcc1d('0x15')](function(_0x3dc10b){_0x2ef9ad(_0x3dc10b);});};AGIVertices['prototype'][_0xcc1d('0x55')]=function(_0x5e3550,_0x23ae2d,_0x584df1){var _0x1e3180={'role':_0xcc1d('0x56')};_0x1e3180[_0x5e3550]=this[_0xcc1d('0x37')][_0xcc1d('0x3c')];this[_0xcc1d('0xe')]['agentPause'](_0x1e3180,_0x23ae2d,this['channel'][_0xcc1d('0x38')])[_0xcc1d('0x13')](function(_0xad73ba){_0x584df1(null,_[_0xcc1d('0x48')](_0xad73ba)?![]:!![]);})[_0xcc1d('0x15')](function(_0x346c79){logger['error'](_0x346c79);_0x584df1(null,![]);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x57')]=function(_0x1bd52a,_0x213995){var _0x3471f4={'role':_0xcc1d('0x56')};_0x3471f4[_0x1bd52a]=this[_0xcc1d('0x37')]['callerid'];this['rpc'][_0xcc1d('0x57')](_0x3471f4)[_0xcc1d('0x13')](function(_0xb77d78){_0x213995(null,_[_0xcc1d('0x48')](_0xb77d78)?![]:!![]);})[_0xcc1d('0x15')](function(_0x4fbd07){logger['error'](_0x4fbd07);_0x213995(null,![]);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x58')]=function(_0x122128,_0x3e077b){var _0x1b1394={'role':_0xcc1d('0x56')};_0x1b1394[_0x122128]=this['channel'][_0xcc1d('0x3c')];this['rpc'][_0xcc1d('0x58')](_0x1b1394)[_0xcc1d('0x13')](function(_0x707145){_0x3e077b(null,_[_0xcc1d('0x48')](_0x707145)?![]:!![]);})[_0xcc1d('0x15')](function(_0x9a7a93){logger[_0xcc1d('0x59')](_0x9a7a93);_0x3e077b(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x5d09b0,_0x38c619){var _0x33a5fc={'role':_0xcc1d('0x56')};_0x33a5fc[_0x5d09b0]=this['channel'][_0xcc1d('0x3c')];var _0x175b5b=_0x5d09b0!=_0xcc1d('0x5a')?util['format'](_0xcc1d('0x5b'),_0xcc1d('0x5c'),this[_0xcc1d('0x37')][_0xcc1d('0x3c')]):undefined;this[_0xcc1d('0xe')]['agentLogin'](_0x33a5fc,_0x175b5b)[_0xcc1d('0x13')](function(_0x1ebb44){_0x38c619(null,_[_0xcc1d('0x48')](_0x1ebb44)?![]:!![]);})[_0xcc1d('0x15')](function(_0x35fc3a){logger[_0xcc1d('0x59')](_0x35fc3a);_0x38c619(null,![]);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x5d')]=function(_0x139768,_0x1c7616){sh[_0xcc1d('0x5e')](_['trim'](_0x139768),function(_0x7da1b2,_0x38adb0){var _0x5a0f26=_0x38adb0[_0xcc1d('0x5f')](/(\r\n|\n|\r)/gm,'');_0x1c7616(null,_0x5a0f26);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x60')]=function(_0x1aad75,_0x43846c){scripts['googleCloudTTS'](_0x1aad75[_0xcc1d('0x61')],_0x1aad75[_0xcc1d('0x62')]||_0xcc1d('0x63'),_0x1aad75[_0xcc1d('0x63')],_0x1aad75['languageCode']||_0xcc1d('0x64'),_0x1aad75[_0xcc1d('0x65')]||_0xcc1d('0x66'),_0x1aad75[_0xcc1d('0x67')]||_0xcc1d('0x68'))[_0xcc1d('0x13')](function(_0x4632ef){_0x43846c(null,_0x4632ef);})['catch'](function(_0x409b36){_0x43846c(_0x409b36);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x69')]=function(_0x1d7d9c,_0x4388c3){scripts[_0xcc1d('0x69')](_0x1d7d9c['text'],_0x1d7d9c[_0xcc1d('0x6a')]||'en',0x1)[_0xcc1d('0x13')](function(_0x22647c){_0x4388c3(null,_0x22647c);})[_0xcc1d('0x15')](function(_0x178c45){_0x4388c3(_0x178c45);});};AGIVertices['prototype'][_0xcc1d('0x6b')]=function(_0x278d8f,_0x3cbcba){var _0x4e901e={'uri':_0x278d8f[_0xcc1d('0x6c')],'method':_0x278d8f[_0xcc1d('0x6d')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x278d8f['timeout'])===_0xcc1d('0x6e')&&parseInt(_0x278d8f[_0xcc1d('0x6f')])>=0x1?parseInt(_0x278d8f['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xcc1d('0x70')]([_0xcc1d('0x71'),_0xcc1d('0x72')],_0x4e901e[_0xcc1d('0x6d')][_0xcc1d('0x73')]())){try{_0x4e901e[_0xcc1d('0x74')]=_0x278d8f['rawBody']?JSON[_0xcc1d('0x75')](_0x278d8f[_0xcc1d('0x76')]):{};}catch(_0x3353cb){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3353cb);}}try{_0x4e901e[_0xcc1d('0x77')]=_0x278d8f[_0xcc1d('0x78')]?JSON[_0xcc1d('0x75')](_0x278d8f[_0xcc1d('0x78')]):{};}catch(_0x5ff77){logger['error'](_0xcc1d('0x79'),_0x5ff77);}if(_0x278d8f[_0xcc1d('0x7a')]){try{var _0x1d937e=require(_0x278d8f[_0xcc1d('0x7a')])[_0xcc1d('0x7b')](this,_0x4e901e);_0x4e901e[_0xcc1d('0x7c')]=Mustache[_0xcc1d('0x7d')](_0x278d8f[_0xcc1d('0x6c')],_0x1d937e,{},['$$','$$']);if(_0x4e901e[_0xcc1d('0x77')]){_0x4e901e[_0xcc1d('0x77')]=JSON[_0xcc1d('0x75')](Mustache[_0xcc1d('0x7d')](JSON[_0xcc1d('0x7e')](_0x4e901e[_0xcc1d('0x77')]),_0x1d937e,{},['$$','$$']));}if(_0x4e901e[_0xcc1d('0x74')]){_0x4e901e[_0xcc1d('0x74')]=JSON['parse'](Mustache[_0xcc1d('0x7d')](JSON[_0xcc1d('0x7e')](_0x4e901e[_0xcc1d('0x74')]),_0x1d937e,{},['$$','$$']));}}catch(_0x426858){logger[_0xcc1d('0x59')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x426858);}}rp(_0x4e901e)['then'](function(_0x5be0c4){var _0x350e6b={'statusCode':_0x5be0c4[_0xcc1d('0x7f')]||0xc8,'statusMessage':_0x5be0c4[_0xcc1d('0x80')]||'OK','headers':_0x5be0c4[_0xcc1d('0x77')]||{},'body':_0x5be0c4[_0xcc1d('0x74')]||{}};_0x3cbcba(null,_0x350e6b);})[_0xcc1d('0x15')](function(_0x2ee4e4){var _0x1a2dfe={'statusCode':_0x2ee4e4['statusCode']||0x1f4,'statusMessage':_0x2ee4e4[_0xcc1d('0x81')]||_0xcc1d('0x82'),'headers':_0x2ee4e4[_0xcc1d('0x83')][_0xcc1d('0x77')]||{},'body':_0x2ee4e4[_0xcc1d('0x83')][_0xcc1d('0x74')]||{}};_0x3cbcba(null,_0x1a2dfe);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x84')]=function(_0x56caec,_0x4200db){scripts[_0xcc1d('0x84')](this[_0xcc1d('0x37')][_0xcc1d('0x38')],_0x56caec[_0xcc1d('0x85')],_0x56caec['text'],_0x56caec['dialogflow_language']||'en')[_0xcc1d('0x13')](function(_0x4a989f){_0x4200db(null,_0x4a989f);})[_0xcc1d('0x15')](function(_0x357eec){_0x4200db(_0x357eec);});};AGIVertices['prototype'][_0xcc1d('0x86')]=function(_0x1bad3d,_0x51e91c){scripts[_0xcc1d('0x86')](this[_0xcc1d('0x37')][_0xcc1d('0x38')],_0x1bad3d[_0xcc1d('0x87')],_0x1bad3d[_0xcc1d('0x88')],_0x1bad3d[_0xcc1d('0x89')],_0x1bad3d['text'],_0x1bad3d[_0xcc1d('0x8a')]||'en')[_0xcc1d('0x13')](function(_0x46604b){_0x51e91c(null,_0x46604b);})[_0xcc1d('0x15')](function(_0x5d0b25){_0x51e91c(_0x5d0b25);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x8b')]=function(_0x3a1e38,_0x11bb0b){scripts[_0xcc1d('0x8b')](this[_0xcc1d('0x37')],_0x3a1e38)[_0xcc1d('0x13')](function(_0x410009){_0x11bb0b(null,_0x410009);})['catch'](function(_0x165e95){_0x11bb0b(_0x165e95);});};AGIVertices[_0xcc1d('0x10')]['ispeechTTS']=function(_0x465d77,_0x106e32){scripts[_0xcc1d('0x8c')](_0x465d77['key'],_0x465d77[_0xcc1d('0x63')],_0x465d77['ispeech_tts_language']||_0xcc1d('0x64'),_0x465d77[_0xcc1d('0x8d')])['then'](function(_0x5edc44){_0x106e32(null,_0x5edc44);})[_0xcc1d('0x15')](function(_0x4799ca){_0x106e32(_0x4799ca);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x8e')]=function(_0x9962d9,_0x6b3de6,_0x3c3ae0){scripts[_0xcc1d('0x8e')](_0x6b3de6,_0x9962d9[_0xcc1d('0x85')],_0x9962d9[_0xcc1d('0x8f')]||_0xcc1d('0x64'),this[_0xcc1d('0x90')](_0x9962d9['model'])?_0x9962d9[_0xcc1d('0x91')]:undefined)[_0xcc1d('0x13')](function(_0x4f6826){_0x3c3ae0(null,_0x4f6826);})[_0xcc1d('0x15')](function(_0x18fe5e){_0x3c3ae0(_0x18fe5e);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x92')]=function(_0x2d945e,_0x1d4cb3){scripts['awsPolly'](_0x2d945e['aws_access_key_id'],_0x2d945e[_0xcc1d('0x93')],_0x2d945e['aws_polly_region'],_0x2d945e['aws_polly_voice']||'Amy',_0x2d945e[_0xcc1d('0x63')],_0x2d945e[_0xcc1d('0x94')]||_0xcc1d('0x63'))[_0xcc1d('0x13')](function(_0xd779a3){_0x1d4cb3(null,_0xd779a3);})['catch'](function(_0x261db0){_0x1d4cb3(_0x261db0);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x95')]=function(_0x45b19c,_0x31715d){scripts[_0xcc1d('0x95')](this['channel'][_0xcc1d('0x38')],_0x45b19c[_0xcc1d('0x96')],_0x45b19c['aws_secret_access_key'],_0x45b19c[_0xcc1d('0x97')],_0x45b19c[_0xcc1d('0x63')],_0x45b19c[_0xcc1d('0x98')])[_0xcc1d('0x13')](function(_0x51cd67){_0x31715d(null,_0x51cd67);})[_0xcc1d('0x15')](function(_0xb24a3b){_0x31715d(_0xb24a3b);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x99')]=function(_0xddc7c7,_0x2167de,_0x4e1420){scripts[_0xcc1d('0x99')](_0x2167de,_0xddc7c7[_0xcc1d('0x85')],_0xddc7c7['google_asr_language']||_0xcc1d('0x64'))[_0xcc1d('0x13')](function(_0x11f9fb){_0x4e1420(null,_0x11f9fb);})[_0xcc1d('0x15')](function(_0x1f123f){_0x4e1420(_0x1f123f);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x9a')]=function(_0x121939,_0x44ac74,_0x31d929){scripts[_0xcc1d('0x9a')](_0x44ac74,_0x121939[_0xcc1d('0x9b')],_0x121939['appsecret'],_0x121939['uri'])['then'](function(_0x47a685){_0x31d929(null,_0x47a685);})[_0xcc1d('0x15')](function(_0x14d154){_0x31d929(_0x14d154);});};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x9c')]=function(_0x4bf73){var _0x8e3ea0=_[_0xcc1d('0x70')](verticesWithRetry,_0x4bf73['agicommand'])?_0x4bf73:_[_0xcc1d('0x9d')](_0x4bf73);for(var _0x4d6fa7 in _0x8e3ea0){if(_0x8e3ea0[_0xcc1d('0x9e')](_0x4d6fa7)){if(_0x8e3ea0[_0x4d6fa7]&&_['isString'](_0x8e3ea0[_0x4d6fa7])){if(_['includes'](recursiveMapAttributes,_0x4d6fa7)){_0x8e3ea0[_0x4d6fa7]=this[_0xcc1d('0x9f')](_0x8e3ea0[_0x4d6fa7]);}else{_0x8e3ea0[_0x4d6fa7]=this[_0xcc1d('0xa0')](_0x8e3ea0[_0x4d6fa7]);}}}}return _0x8e3ea0;};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xa1')]=function(_0x5dc43f){for(var _0x3a9c4e in _0x5dc43f){if(_0x5dc43f[_0xcc1d('0x9e')](_0x3a9c4e)){if(_['isPlainObject'](_0x5dc43f[_0x3a9c4e])){this[_0xcc1d('0xa1')](_0x5dc43f[_0x3a9c4e]);}else if(_[_0xcc1d('0xa2')](_0x5dc43f[_0x3a9c4e])){for(var _0x8dfcdf=0x0;_0x8dfcdf<_0x5dc43f[_0x3a9c4e]['length'];_0x8dfcdf++){this[_0xcc1d('0xa1')](_0x5dc43f[_0x3a9c4e][_0x8dfcdf]);}}else if(_[_0xcc1d('0xa3')](_0x5dc43f[_0x3a9c4e])){_0x5dc43f[_0x3a9c4e]=this[_0xcc1d('0xa0')](_0x5dc43f[_0x3a9c4e]);}}}};AGIVertices['prototype'][_0xcc1d('0xa4')]=function(_0xe432f0,_0x6e01fe){for(var _0x59aa28 in _0xe432f0){if(_0xe432f0[_0xcc1d('0x9e')](_0x59aa28)){if(_[_0xcc1d('0xa5')](_0xe432f0[_0x59aa28])){if(!_['isEmpty'](_0xe432f0[_0x59aa28])){this[_0xcc1d('0xa4')](_0xe432f0[_0x59aa28],util[_0xcc1d('0x2a')](_0xcc1d('0xa6'),_0x6e01fe,_0x59aa28));}}else if(_[_0xcc1d('0xa2')](_0xe432f0[_0x59aa28])){for(var _0x4f3acd=0x0;_0x4f3acd<_0xe432f0[_0x59aa28]['length'];_0x4f3acd++){this[_0xcc1d('0xa4')](_0xe432f0[_0x59aa28][_0x4f3acd],util[_0xcc1d('0x2a')]('%s.%s',_0x6e01fe,_0x59aa28+'['+_0x4f3acd+']'));}}else{if(!_[_0xcc1d('0x48')](_0xe432f0[_0x59aa28])){this[_0xcc1d('0x37')][_0xcc1d('0xa7')](util[_0xcc1d('0x2a')](_0xcc1d('0xa6'),_0x6e01fe,_0x59aa28),_0xe432f0[_0x59aa28]);}}}}};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x9f')]=function(_0x36e7e1){try{var _0x1d49ef=JSON['parse'](_0x36e7e1);this[_0xcc1d('0xa1')](_0x1d49ef);return JSON[_0xcc1d('0x7e')](_0x1d49ef);}catch(_0xe2d503){return this[_0xcc1d('0xa0')](_0x36e7e1);}};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xa0')]=function(_0x21dc0b){var _0xda3bb9=_0x21dc0b[_0xcc1d('0xa8')]('{');for(var _0x5026bb=0x1;_0x5026bb<_0xda3bb9[_0xcc1d('0xa9')];_0x5026bb+=0x1){var _0x461765=_0xda3bb9[_0x5026bb]['split']('}');if(_0x461765[_0xcc1d('0xa9')]>0x1){_0x21dc0b=_0x21dc0b[_0xcc1d('0xaa')]('{'+_0x461765[0x0]+'}',this[_0xcc1d('0x37')]['getVariable'](_0x461765[0x0])[_0xcc1d('0xab')]||_0x461765[0x0]);}}if(_0xda3bb9[_0xcc1d('0xa9')]===0x1){return _0x21dc0b[_0xcc1d('0x51')]();}return this['replaceAllVariables'](_0x21dc0b);};AGIVertices[_0xcc1d('0x10')]['getAndSetVariable']=function(_0x25b919,_0x2f73c0){var _0x250afc=this['channel'][_0xcc1d('0x11')](_0x25b919);if(_0x250afc[_0xcc1d('0xac')]===-0x1){return _0x250afc;}logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0xad'),_0x2f73c0,_0x250afc[_0xcc1d('0xab')]));return this['channel'][_0xcc1d('0xa7')](_0x2f73c0,_0x250afc['extra']);};AGIVertices['prototype'][_0xcc1d('0x90')]=function(_0x107c33){return _0x107c33&&_0x107c33!=='0'&&_0x107c33!=='-1'&&_0x107c33!=='';};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xae')]=function(_0x6e0b4e){this[_0xcc1d('0x36')][_0xcc1d('0x7b')](this,_0x6e0b4e,'-');_0x6e0b4e[_0xcc1d('0xaf')]=_0x6e0b4e[_0xcc1d('0xae')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xcc1d('0x10')]['mrcpsynth']=function(_0xbb8561){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0xbb8561[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0xbb8561['text'])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0xb1'));}var _0x2aaff9='\x22'+_0xbb8561[_0xcc1d('0x63')]+'\x22';if(this[_0xcc1d('0x90')](_0xbb8561[_0xcc1d('0x83')])){_0x2aaff9+=','+_0xbb8561[_0xcc1d('0x83')];}var _0x3d4528=this['channel'][_0xcc1d('0x5e')](_0xcc1d('0xb2'),_0x2aaff9);if(_0x3d4528[_0xcc1d('0xac')]===-0x1){return _0x3d4528;}return this['channel'][_0xcc1d('0xb0')](util['format'](_0xcc1d('0xb3'),_0x2aaff9));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xb4')]=function(_0x4996b7){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0xb5'),_0x4996b7[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x4996b7['grammar'])){return this['channel'][_0xcc1d('0xb0')](_0xcc1d('0xb6'));}var _0x2cf8f9=_0x4996b7['grammar'];if(this[_0xcc1d('0x90')](_0x4996b7[_0xcc1d('0x83')])){_0x2cf8f9+=','+_0x4996b7[_0xcc1d('0x83')];}var _0x27f744=this[_0xcc1d('0x37')][_0xcc1d('0x5e')]('MRCPRecog',_0x2cf8f9);if(_0x27f744[_0xcc1d('0xac')]===-0x1){return _0x27f744;}var _0x1cb222=this[_0xcc1d('0xb7')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x1cb222['result']===-0x1){return _0x1cb222;}var _0x2a07f5=this['getAndSetVariable'](_0xcc1d('0xb8'),'MRCP_RECOG_TRANSCRIPT');if(_0x2a07f5[_0xcc1d('0xac')]===-0x1){return _0x2a07f5;}var _0x58404a=this['getAndSetVariable'](_0xcc1d('0xb9'),_0xcc1d('0xba'));if(_0x58404a[_0xcc1d('0xac')]===-0x1){return _0x58404a;}return this['channel']['noop'](util['format'](_0xcc1d('0xbb'),_0x2cf8f9));};AGIVertices['prototype']['agi']=function(_0x4d2b46){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x4d2b46[_0xcc1d('0x39')]));return this[_0xcc1d('0x37')][_0xcc1d('0x7')]([_0x4d2b46['command'],_0x4d2b46[_0xcc1d('0xbc')]]);};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xbd')]=function(_0x368e4a){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0xbe'),_0x368e4a['label']));if(this['isConfigured'](_0x368e4a[_0xcc1d('0x6f')])){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x368e4a[_0xcc1d('0x6f')]));var _0x4a705b=this[_0xcc1d('0x37')][_0xcc1d('0xbf')](_0x368e4a[_0xcc1d('0x6f')]);if(_0x4a705b[_0xcc1d('0xac')]===-0x1){return _0x4a705b;}}return this['channel'][_0xcc1d('0xbd')]();};AGIVertices[_0xcc1d('0x10')]['callback']=function(_0x5ea62f){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0xc0'),_0x5ea62f[_0xcc1d('0x39')]));if(!this['isConfigured'](_0x5ea62f[_0xcc1d('0x4d')])){return this['channel'][_0xcc1d('0x59')](_0x5ea62f,_0xcc1d('0xc1'));}_0x5ea62f[_0xcc1d('0x4e')]=moment();if(this['isConfigured'](_0x5ea62f[_0xcc1d('0xc2')])){_0x5ea62f['scheduledAt']=moment()[_0xcc1d('0xc3')](_0x5ea62f[_0xcc1d('0xc2')],'minutes');}if(!this[_0xcc1d('0x90')](_0x5ea62f['callback_priority'])){_0x5ea62f['callback_priority']=0x2;}this['createCmContact'][_0xcc1d('0x7b')](this,_0x5ea62f);return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0xc4'),_0x5ea62f['phone'],_0x5ea62f[_0xcc1d('0x4d')],_0x5ea62f[_0xcc1d('0x4e')]));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xc5')]=function(_0x123594){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0xc6'),_0x123594[_0xcc1d('0x39')]));var _0x357d13=this['channel'][_0xcc1d('0x5e')](_0x123594[_0xcc1d('0xc7')],_0x123594[_0xcc1d('0x83')]);if(_0x357d13['result']===-0x1){return _0x357d13;}return this['channel'][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')]('Executed\x20command\x20%s\x20%s',_0x123594[_0xcc1d('0xc7')],_0x123594[_0xcc1d('0x83')]));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xc8')]=function(_0x4328c4){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0xc9'),_0x4328c4['label']));if(!this[_0xcc1d('0x90')](_0x4328c4[_0xcc1d('0x63')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0xb1'));}var _0x3f5d0e='\x22'+_0x4328c4[_0xcc1d('0x63')]+'\x22';if(this[_0xcc1d('0x90')](_0x4328c4[_0xcc1d('0x83')])){_0x3f5d0e+=','+_0x4328c4[_0xcc1d('0x83')];}var _0x113015=this['channel'][_0xcc1d('0x5e')](_0xcc1d('0xb2'),_0x3f5d0e);if(_0x113015[_0xcc1d('0xac')]===-0x1){return _0x113015;}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0xb3'),_0x3f5d0e));};AGIVertices['prototype']['sestektts']=function(_0x5342dc){logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0xca'),_0x5342dc['label']));if(!this[_0xcc1d('0x90')](_0x5342dc[_0xcc1d('0x63')])){return this[_0xcc1d('0x37')]['noop'](_0xcc1d('0xb1'));}var _0x5a408d='\x22'+_0x5342dc[_0xcc1d('0x63')]+'\x22';if(this[_0xcc1d('0x90')](_0x5342dc[_0xcc1d('0x83')])){_0x5a408d+=','+_0x5342dc['options'];}var _0x429050=this[_0xcc1d('0x37')][_0xcc1d('0x5e')](_0xcc1d('0xb2'),_0x5a408d);if(_0x429050[_0xcc1d('0xac')]===-0x1){return _0x429050;}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5a408d));};AGIVertices[_0xcc1d('0x10')]['lumenvoxasr']=function(_0xb3c0c9){logger['info'](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0xb3c0c9[_0xcc1d('0x39')]));if(!this['isConfigured'](_0xb3c0c9[_0xcc1d('0xcb')])){return this[_0xcc1d('0x37')]['noop'](_0xcc1d('0xb6'));}var _0x315d15=_0xb3c0c9[_0xcc1d('0xcb')];if(this[_0xcc1d('0x90')](_0xb3c0c9[_0xcc1d('0x83')])){_0x315d15+=','+_0xb3c0c9[_0xcc1d('0x83')];}var _0x4760e9=this[_0xcc1d('0x37')][_0xcc1d('0x5e')](_0xcc1d('0xcc'),_0x315d15);if(_0x4760e9[_0xcc1d('0xac')]===-0x1){return _0x4760e9;}var _0x2a1423=this['getAndSetVariable'](_0xcc1d('0xcd'),_0xcc1d('0xce'));if(_0x2a1423[_0xcc1d('0xac')]===-0x1){return _0x2a1423;}var _0x556cda=this[_0xcc1d('0xb7')](_0xcc1d('0xb8'),_0xcc1d('0xcf'));if(_0x556cda[_0xcc1d('0xac')]===-0x1){return _0x556cda;}var _0x463164=this[_0xcc1d('0xb7')](_0xcc1d('0xb9'),_0xcc1d('0xd0'));if(_0x463164[_0xcc1d('0xac')]===-0x1){return _0x463164;}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0xbb'),_0x315d15));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xd1')]=function(_0x4c7cec){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0xd2'),_0x4c7cec[_0xcc1d('0x39')]));if(!this['isConfigured'](_0x4c7cec['grammar'])){return this['channel'][_0xcc1d('0xb0')](_0xcc1d('0xb6'));}var _0x22c28c=_0x4c7cec[_0xcc1d('0xcb')];if(this[_0xcc1d('0x90')](_0x4c7cec[_0xcc1d('0x83')])){_0x22c28c+=','+_0x4c7cec['options'];}var _0x516c31=this[_0xcc1d('0x37')][_0xcc1d('0x5e')]('MRCPRecog',_0x22c28c);if(_0x516c31[_0xcc1d('0xac')]===-0x1){return _0x516c31;}var _0x3017f0=this[_0xcc1d('0xb7')](_0xcc1d('0xcd'),_0xcc1d('0xd3'));if(_0x3017f0[_0xcc1d('0xac')]===-0x1){return _0x3017f0;}var _0x5b8cf6=this[_0xcc1d('0xb7')](_0xcc1d('0xb8'),_0xcc1d('0xd4'));if(_0x5b8cf6['result']===-0x1){return _0x5b8cf6;}var _0x556649=this[_0xcc1d('0xb7')](_0xcc1d('0xb9'),'SESTEK_ASR_INSTANCE');if(_0x556649[_0xcc1d('0xac')]===-0x1){return _0x556649;}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0xbb'),_0x22c28c));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xd5')]=function(_0x2b3756){logger[_0xcc1d('0x2e')](util['format'](_0xcc1d('0xd6'),_0x2b3756[_0xcc1d('0x39')]));if(!this['isConfigured'](_0x2b3756[_0xcc1d('0xd7')])){return this['channel'][_0xcc1d('0x59')](_0x2b3756,_0xcc1d('0xd8'));}var _0x28aa82=this[_0xcc1d('0x19')][_0xcc1d('0x7b')](this,_0x2b3756['odbc_id']);if(!_0x28aa82){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x2b3756,'no\x20odbc\x20database\x20found');}if(!this[_0xcc1d('0x90')](_0x2b3756[_0xcc1d('0x30')])){return this['channel'][_0xcc1d('0x59')](_0x2b3756,_0xcc1d('0xd9'));}var _0x21e3fe=_0x2b3756[_0xcc1d('0x30')][_0xcc1d('0x5f')](/(\r\n|\n|\r)/gm,'\x20');this[_0xcc1d('0x37')]['noop'](util[_0xcc1d('0x2a')](_0xcc1d('0xda'),_0x21e3fe));var _0x291472=this[_0xcc1d('0x2c')]['sync'](this,_0x28aa82,_0x21e3fe);this[_0xcc1d('0x36')]['sync'](this,_0x2b3756,_0x21e3fe);if(!this[_0xcc1d('0x90')](_0x2b3756[_0xcc1d('0xdb')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0xdc'));}var _0x2aa244=this[_0xcc1d('0x11')][_0xcc1d('0x7b')](this,_0x2b3756[_0xcc1d('0xdb')]);if(!_0x2aa244){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x2b3756,_0xcc1d('0xdd'));}var _0x5bcbe4=this;_0x291472[_0xcc1d('0xde')](function(_0x12738a,_0x3732f0){Object[_0xcc1d('0xdf')](_0x12738a)[_0xcc1d('0xde')](function(_0x20c6ef){_0x5bcbe4['channel'][_0xcc1d('0xa7')](util['format'](_0xcc1d('0xe0'),_0x2aa244,_0x3732f0,_0x20c6ef),_0x12738a[_0x20c6ef]);});});this[_0xcc1d('0x37')][_0xcc1d('0xa7')](util[_0xcc1d('0x2a')](_0xcc1d('0xe1'),_0x2aa244),_0x291472[_0xcc1d('0xa9')]);return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0xe2'),_0x2aa244));};AGIVertices['prototype']['dial']=function(_0x3ea800){logger[_0xcc1d('0xe3')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x3ea800['label']));if(!this[_0xcc1d('0x90')](_0x3ea800[_0xcc1d('0xe4')])){return this[_0xcc1d('0x37')]['error'](_0x3ea800,'no\x20user\x20selected');}var _0x3e1546=this[_0xcc1d('0x1c')][_0xcc1d('0x7b')](this,_0x3ea800['sip_id']);if(!_0x3e1546){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x3ea800,_0xcc1d('0xe5'));}var _0x34156f=this[_0xcc1d('0x37')]['exec'](_0xcc1d('0xe6'),[util[_0xcc1d('0x2a')](_0xcc1d('0xe7'),_0x3e1546),_0x3ea800['timeout'],_0x3ea800[_0xcc1d('0xe8')],_0x3ea800[_0xcc1d('0x6c')]]);if(_0x34156f['result']===-0x1){return _0x34156f;}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0xe9'),_0xcc1d('0xe6')));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xea')]=function(_0x28e1bc){logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0xeb'),_0x28e1bc[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x28e1bc[_0xcc1d('0x85')])){return this['channel'][_0xcc1d('0xb0')](_0xcc1d('0xec'));}if(!this['isConfigured'](_0x28e1bc[_0xcc1d('0x63')])){return this[_0xcc1d('0x37')]['noop'](_0xcc1d('0xb1'));}this[_0xcc1d('0x37')][_0xcc1d('0xed')]=!![];this[_0xcc1d('0x36')](_0x28e1bc);this[_0xcc1d('0x45')](_0x28e1bc[_0xcc1d('0x63')],'in','','');this['channel'][_0xcc1d('0xb0')](util['format'](_0xcc1d('0xee'),_0x28e1bc[_0xcc1d('0x63')]));var _0x5af00f=this['googleDialogflow']['sync'](this,_0x28e1bc);if(_0x5af00f){for(var _0x5b2c11 in _0x5af00f){if(_0x5af00f['hasOwnProperty'](_0x5b2c11)){this['channel'][_0xcc1d('0xa7')](util[_0xcc1d('0x2a')](_0xcc1d('0xef'),_0x5b2c11[_0xcc1d('0x73')]()),_0x5af00f[_0x5b2c11]);}}this[_0xcc1d('0x45')](_0x5af00f[_0xcc1d('0xf0')],_0xcc1d('0xf1'),'dialogflow','');return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0xf2'),_0x5af00f[_0xcc1d('0xf0')]));}return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x28e1bc,_0xcc1d('0xf3'));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xf4')]=function(_0x551bfe){logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0xf5'),_0x551bfe['label']));if(!this[_0xcc1d('0x90')](_0x551bfe[_0xcc1d('0x87')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')]('no\x20project_id\x20configured');}if(!this[_0xcc1d('0x90')](_0x551bfe[_0xcc1d('0x88')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')]('no\x20client_email\x20configured');}if(!this[_0xcc1d('0x90')](_0x551bfe[_0xcc1d('0x89')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0xf6'));}if(!this[_0xcc1d('0x90')](_0x551bfe['dialogflowV2_language'])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0xf7'));}if(!this['isConfigured'](_0x551bfe[_0xcc1d('0x63')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0xb1'));}this[_0xcc1d('0x37')][_0xcc1d('0xed')]=!![];this[_0xcc1d('0x36')](_0x551bfe);this[_0xcc1d('0x45')](_0x551bfe[_0xcc1d('0x63')],'in','','');this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util['format'](_0xcc1d('0xf8'),_0x551bfe[_0xcc1d('0x63')]));var _0x5735b1=this[_0xcc1d('0x86')][_0xcc1d('0x7b')](this,_0x551bfe);if(_0x5735b1){for(var _0x1de623 in _0x5735b1){if(_0x5735b1[_0xcc1d('0x9e')](_0x1de623)){if(_0x1de623!==_0xcc1d('0xf9')){this['channel'][_0xcc1d('0xa7')](util[_0xcc1d('0x2a')]('DIALOGFLOW_%s',_0x1de623[_0xcc1d('0x73')]()),_0x5735b1[_0x1de623]);}}}this['createSquareMessage'](_0x5735b1['speech'],_0xcc1d('0xf1'),_0xcc1d('0xf4'),_0x5735b1['providerResponse']);return this['channel'][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')]('DialogflowV2\x20Result\x20%s',_0x5735b1[_0xcc1d('0xf0')]));}return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x551bfe,_0xcc1d('0xfa'));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xfb')]=function(_0x49cf0a){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0xfc'),_0x49cf0a[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x49cf0a[_0xcc1d('0xfd')])){return this['channel'][_0xcc1d('0xb0')]('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x49cf0a[_0xcc1d('0xfe')])){return this['channel'][_0xcc1d('0xb0')](_0xcc1d('0xff'));}if(!this[_0xcc1d('0x90')](_0x49cf0a[_0xcc1d('0x100')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')]('no\x20password\x20configured');}if(!this[_0xcc1d('0x90')](_0x49cf0a[_0xcc1d('0x101')])){return this['channel'][_0xcc1d('0xb0')](_0xcc1d('0xb1'));}this[_0xcc1d('0x37')]['bot']=!![];this[_0xcc1d('0x36')](_0x49cf0a);this['createSquareMessage'](_0x49cf0a['text'],'in','','');this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util['format'](_0xcc1d('0x102'),_0x49cf0a[_0xcc1d('0x63')]));var _0x13382b=this['sestekNDA'][_0xcc1d('0x7b')](this,_0x49cf0a);if(_0x13382b){for(var _0x1ed56f in _0x13382b){if(_0x13382b[_0xcc1d('0x9e')](_0x1ed56f)){this[_0xcc1d('0x37')][_0xcc1d('0xa7')](util['format'](_0xcc1d('0x103'),_0x1ed56f[_0xcc1d('0x73')]()),_0x13382b[_0x1ed56f]);}}this[_0xcc1d('0x45')](_0x13382b[_0xcc1d('0xf0')],'out',_0xcc1d('0xfb'),'');if(_0x13382b[_0xcc1d('0x104')]){this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x13382b['audiofile']));var _0x22aeda=this[_0xcc1d('0x37')]['streamFile'](_0x13382b[_0xcc1d('0x104')]);try{fs['unlink'](_0x13382b['audiofile']+_0xcc1d('0x105'));}catch(_0x27e611){logger[_0xcc1d('0x59')](_0x27e611);}return _0x22aeda;}else{return this[_0xcc1d('0x37')]['noop'](util['format'](_0xcc1d('0x106'),_0x13382b[_0xcc1d('0xf0')]));}}return this[_0xcc1d('0x37')]['error'](_0x49cf0a,_0xcc1d('0x107'));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x108')]=function(_0x2a4b19){logger[_0xcc1d('0x2e')](util['format'](_0xcc1d('0x109'),_0x2a4b19[_0xcc1d('0x39')]));return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0x108'));};AGIVertices[_0xcc1d('0x10')]['ext_dial']=function(_0x1a202b){logger[_0xcc1d('0x2e')](util['format'](_0xcc1d('0x10a'),_0x1a202b[_0xcc1d('0x39')]));var _0xaa45b4='';if(_0x1a202b['trunk_id']){if(!this[_0xcc1d('0x90')](_0x1a202b[_0xcc1d('0x10b')])){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x1a202b,'no\x20trunk\x20selected');}else{var _0x239081=parseInt(_0x1a202b['trunk_id'],0xa);if(isNaN(_0x239081)){_0xaa45b4=_0x1a202b[_0xcc1d('0x10b')];}else{_0xaa45b4=this[_0xcc1d('0x10c')][_0xcc1d('0x7b')](this,_0x1a202b[_0xcc1d('0x10b')]);if(!_0xaa45b4){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x1a202b,_0xcc1d('0x10d'));}}}}else if(_0x1a202b['trunk_name']){_0xaa45b4=_0x1a202b[_0xcc1d('0x10e')];}else{return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x1a202b,_0xcc1d('0x10f'));}var _0x457274=this[_0xcc1d('0x37')][_0xcc1d('0x5e')](_0xcc1d('0xe6'),[util[_0xcc1d('0x2a')](_0xcc1d('0x110'),_0xaa45b4,_0x1a202b[_0xcc1d('0x4c')]),_0x1a202b[_0xcc1d('0x6f')],_0x1a202b[_0xcc1d('0xe8')],_0x1a202b['url']]);if(_0x457274[_0xcc1d('0xac')]===-0x1){return _0x457274;}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0xe9'),'DIAL'));};AGIVertices[_0xcc1d('0x10')]['finally']=function(_0x395eb7){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x111'),_0x395eb7['label']));return this['channel'][_0xcc1d('0xb0')](_0xcc1d('0x112'));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xc')]=function(_0x149d9c){logger[_0xcc1d('0x2e')](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x149d9c[_0xcc1d('0x39')]));if(_0x149d9c[_0xcc1d('0xaf')]===0x0){return this[_0xcc1d('0xae')](_0x149d9c);}_0x149d9c[_0xcc1d('0xaf')]-=0x1;if(!this[_0xcc1d('0x90')](_0x149d9c[_0xcc1d('0x113')])){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x149d9c,_0xcc1d('0x114'));}var _0x6d8da5=this[_0xcc1d('0x1f')][_0xcc1d('0x7b')](this,_0x149d9c['file_id']);if(!_0x6d8da5){return this[_0xcc1d('0x37')]['error'](_0x149d9c,_0xcc1d('0x115'));}if(!this[_0xcc1d('0x90')](_0x149d9c['variable_id'])){return this['channel'][_0xcc1d('0x59')](_0xcc1d('0xdc'));}var _0x13a2ae=this['channel'][_0xcc1d('0x116')](_0x6d8da5,_0x149d9c[_0xcc1d('0x117')],_0x149d9c[_0xcc1d('0x118')]);var _0x1cd7f8=_0x13a2ae[_0xcc1d('0xac')]?_0x13a2ae[_0xcc1d('0xac')][_0xcc1d('0x51')]():'';logger['info']('test',JSON['stringify'](_0x13a2ae));if(_0x13a2ae[_0xcc1d('0xac')]===-0x1){this[_0xcc1d('0x36')]['sync'](this,_0x149d9c,_0x1cd7f8);return _0x13a2ae;}else if(_0x13a2ae['extra']==='timeout'){_0x13a2ae[_0xcc1d('0xac')]=_0x1cd7f8[_0xcc1d('0xa9')]>=parseInt(_0x149d9c[_0xcc1d('0x119')])?'x':'i';}else{_0x13a2ae[_0xcc1d('0xac')]=_0x1cd7f8['length']>=parseInt(_0x149d9c[_0xcc1d('0x119')])&&_0x1cd7f8['length']<=parseInt(_0x149d9c[_0xcc1d('0x118')])?'x':'i';}var _0x1159a7=this[_0xcc1d('0x11')][_0xcc1d('0x7b')](this,_0x149d9c[_0xcc1d('0xdb')]);if(!_0x1159a7){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x149d9c,_0xcc1d('0xdd'));}this[_0xcc1d('0x37')][_0xcc1d('0xa7')](_0x1159a7,_0x1cd7f8);if(this[_0xcc1d('0x90')](_0x149d9c[_0xcc1d('0x11a')])){var _0x3a1dec=parseInt(_0x149d9c[_0xcc1d('0x11a')],0xa);var _0x5011f5=rs[_0xcc1d('0x11b')]({'charset':'*','length':_0x3a1dec});var _0x2ee6be=_0x1cd7f8[_0xcc1d('0xa9')];if(_0x2ee6be>0x0){if(_0x2ee6be>_0x3a1dec){this[_0xcc1d('0x36')][_0xcc1d('0x7b')](this,_0x149d9c,_0x149d9c[_0xcc1d('0x11c')]===_0xcc1d('0x11d')?_0x5011f5+_0x1cd7f8['substr'](_0x3a1dec):_0x1cd7f8[_0xcc1d('0x11e')](0x0,_0x2ee6be-_0x3a1dec)+_0x5011f5);}else{this[_0xcc1d('0x36')][_0xcc1d('0x7b')](this,_0x149d9c,rs[_0xcc1d('0x11b')]({'charset':'*','length':_0x2ee6be}));}}else{this[_0xcc1d('0x36')]['sync'](this,_0x149d9c,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x149d9c,_0x1cd7f8);}return _0x13a2ae;};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0xd')]=function(_0x4104c2){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x4104c2[_0xcc1d('0x39')]));return this[_0xcc1d('0xc')](_0x4104c2);};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x11f')]=function(_0x1236ea){logger[_0xcc1d('0x2e')](util['format'](_0xcc1d('0x120'),_0x1236ea[_0xcc1d('0x39')]));this[_0xcc1d('0x36')][_0xcc1d('0x7b')](this,_0x1236ea,_0x1236ea[_0xcc1d('0x121')]);return this['channel'][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x122'),_0x1236ea[_0xcc1d('0x121')]));};AGIVertices[_0xcc1d('0x10')]['awspolly']=function(_0x22a85d){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x123'),_0x22a85d[_0xcc1d('0x39')]));if(!this['isConfigured'](_0x22a85d[_0xcc1d('0x96')])||!this[_0xcc1d('0x90')](_0x22a85d[_0xcc1d('0x93')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0x124'));}if(!this[_0xcc1d('0x90')](_0x22a85d[_0xcc1d('0x63')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0xb1'));}this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util['format'](_0xcc1d('0x125'),_0x22a85d[_0xcc1d('0x63')]));var _0x45b565=this[_0xcc1d('0x92')][_0xcc1d('0x7b')](this,_0x22a85d);if(_0x45b565){this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')]('aws\x20Polly\x20%s\x20file\x20created',_0x45b565));var _0x207fa9=this[_0xcc1d('0x37')]['streamFile'](_0x45b565);try{fs[_0xcc1d('0x126')](_0x45b565+_0xcc1d('0x105'));}catch(_0x49eac0){logger['error'](_0x49eac0);}return _0x207fa9;}return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x22a85d,_0xcc1d('0x127'));};AGIVertices['prototype']['awslex']=function(_0x111bef){logger[_0xcc1d('0x2e')](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x111bef[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x111bef['aws_access_key_id'])||!this[_0xcc1d('0x90')](_0x111bef[_0xcc1d('0x93')])){return this[_0xcc1d('0x37')]['noop'](_0xcc1d('0x124'));}if(!this[_0xcc1d('0x90')](_0x111bef[_0xcc1d('0x98')])){return this['channel'][_0xcc1d('0xb0')]('no\x20bot\x20name\x20configured');}if(!this[_0xcc1d('0x90')](_0x111bef[_0xcc1d('0x63')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0xb1'));}this[_0xcc1d('0x37')][_0xcc1d('0xed')]=!![];this[_0xcc1d('0x36')](_0x111bef);this[_0xcc1d('0x45')](_0x111bef[_0xcc1d('0x63')],'in','','');this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x128'),_0x111bef[_0xcc1d('0x63')]));var _0x3f34b5=this['awsLex'][_0xcc1d('0x7b')](this,_0x111bef);if(_0x3f34b5){for(var _0xf7173f in _0x3f34b5){if(_0x3f34b5['hasOwnProperty'](_0xf7173f)&&_[_0xcc1d('0xa3')](_0x3f34b5[_0xf7173f])){this[_0xcc1d('0x37')][_0xcc1d('0xa7')](util[_0xcc1d('0x2a')](_0xcc1d('0x129'),_0xf7173f[_0xcc1d('0x73')]()),_0x3f34b5[_0xf7173f]);}}if(_[_0xcc1d('0x48')](_0x3f34b5[_0xcc1d('0x81')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0x12a'));}else{this[_0xcc1d('0x45')](_0x3f34b5[_0xcc1d('0x81')],_0xcc1d('0xf1'),_0xcc1d('0x12b'),'');return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x12c'),_0x3f34b5['message']));}}return this[_0xcc1d('0x37')]['error'](_0x111bef,_0xcc1d('0x12d'));};AGIVertices['prototype']['googleasr']=function(_0xf8a455){logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0x12e'),_0xf8a455[_0xcc1d('0x39')],_0xf8a455['timeout']));if(!this[_0xcc1d('0x90')](_0xf8a455[_0xcc1d('0x85')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')]('no\x20key\x20configured');}var _0x53c8af='wav';var _0x1234b5=util[_0xcc1d('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0xcc1d('0x11b')](0x4));var _0x1aebff=util['format'](_0xcc1d('0xa6'),_0x1234b5,_0x53c8af);var _0x5e54ba=!![];if(_0xf8a455[_0xcc1d('0x12f')]===_0xcc1d('0x130')){_0x5e54ba=![];}var _0x59fcfa=this[_0xcc1d('0x37')][_0xcc1d('0x131')](_0x1234b5,_0x53c8af,_0xf8a455[_0xcc1d('0x132')],_0xf8a455[_0xcc1d('0x6f')],undefined,_0x5e54ba);if(_0x59fcfa[_0xcc1d('0xac')]!==-0x1){this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x133'),_0x1aebff));var _0x4e9672=this[_0xcc1d('0x99')]['sync'](this,_0xf8a455,_0x1aebff);if(_0x4e9672){for(var _0x10d8a8 in _0x4e9672){if(_0x4e9672['hasOwnProperty'](_0x10d8a8)){this['channel'][_0xcc1d('0xa7')](util[_0xcc1d('0x2a')]('GOOGLE_ASR_%s',_0x10d8a8[_0xcc1d('0x73')]()),_0x4e9672[_0x10d8a8]);}}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x4e9672)));}}return _0x59fcfa;};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x134')]=function(_0x22cf3a){logger['info'](util[_0xcc1d('0x2a')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x22cf3a[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x22cf3a[_0xcc1d('0x9b')])){return this[_0xcc1d('0x37')]['noop'](_0xcc1d('0x135'));}if(!this[_0xcc1d('0x90')](_0x22cf3a['appsecret'])){return this['channel']['noop'](_0xcc1d('0x136'));}var _0x1ebd9c=_0xcc1d('0x137');var _0xe362=util[_0xcc1d('0x2a')](_0xcc1d('0x138'),FILES_PATH,rs[_0xcc1d('0x11b')](0x4));var _0x34808f=util[_0xcc1d('0x2a')](_0xcc1d('0xa6'),_0xe362,_0x1ebd9c);var _0x19bafe=!![];if(_0x22cf3a[_0xcc1d('0x12f')]==='NOBEEP'){_0x19bafe=![];}var _0x38375c=this['channel'][_0xcc1d('0x131')](_0xe362,_0x1ebd9c,_0x22cf3a[_0xcc1d('0x132')],_0x22cf3a[_0xcc1d('0x6f')],undefined,_0x19bafe);if(_0x38375c[_0xcc1d('0xac')]!==-0x1){this['channel'][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x139'),_0x34808f));var _0x1efb21=this[_0xcc1d('0x9a')][_0xcc1d('0x7b')](this,_0x22cf3a,_0x34808f);if(_0x1efb21){for(var _0x3dcbe2 in _0x1efb21){if(_0x1efb21[_0xcc1d('0x9e')](_0x3dcbe2)){this[_0xcc1d('0x37')][_0xcc1d('0xa7')](util[_0xcc1d('0x2a')](_0xcc1d('0x13a'),_0x3dcbe2[_0xcc1d('0x73')]()),_0x1efb21[_0x3dcbe2]);}}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x13b'),JSON[_0xcc1d('0x7e')](_0x1efb21)));}}return _0x38375c;};AGIVertices['prototype'][_0xcc1d('0x13c')]=function(_0x3cd54e){logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0x13d'),_0x3cd54e[_0xcc1d('0x39')]));return this[_0xcc1d('0x37')][_0xcc1d('0x13e')](_0x3cd54e[_0xcc1d('0x3f')],_0x3cd54e[_0xcc1d('0x40')],_0x3cd54e[_0xcc1d('0x41')]);};AGIVertices[_0xcc1d('0x10')]['gotoif']=function(_0x5858e0){logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0x13f'),_0x5858e0['label']));if(!this[_0xcc1d('0x90')](_0x5858e0[_0xcc1d('0x140')])){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x5858e0,_0xcc1d('0x141'));}try{var _0x69c588=eval(_0x5858e0[_0xcc1d('0x140')])?_0xcc1d('0x142'):_0xcc1d('0x143');this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x5858e0['condition'],_0x69c588));return{'code':0xc8,'result':_0x69c588};}catch(_0x454d06){return{'code':0xc8,'result':_0xcc1d('0x143')};}};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x144')]=function(_0x292847){logger['info'](util['format'](_0xcc1d('0x145'),_0x292847[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x292847[_0xcc1d('0x146')])){return this[_0xcc1d('0x37')]['error'](_0x292847,'no\x20interval\x20configured');}var _0x3c0ee0=this[_0xcc1d('0x25')][_0xcc1d('0x7b')](this,_0x292847[_0xcc1d('0x146')]);if(!_0x3c0ee0){return this[_0xcc1d('0x37')]['error'](_0x292847,_0xcc1d('0x147'));}for(var _0x5fe044=0x0;_0x5fe044<_0x3c0ee0['length'];_0x5fe044+=0x1){var _0x1242ad=this[_0xcc1d('0x37')][_0xcc1d('0x11')](util[_0xcc1d('0x2a')](_0xcc1d('0x148'),_0x3c0ee0[_0x5fe044]));if(_0x1242ad[_0xcc1d('0xac')]===-0x1){return _0x1242ad;}logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x149'),_0x3c0ee0[_0x5fe044],_0x1242ad[_0xcc1d('0xab')]));if(_0x1242ad[_0xcc1d('0xab')]==='true'){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')]('IFTIME\x20%s\x20%s',_0x3c0ee0[_0x5fe044],_0xcc1d('0x142')));this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')]('IFTIME\x20%s\x20%s',_0x3c0ee0[_0x5fe044],_0xcc1d('0x142')));return{'code':0xc8,'result':'true'};}else{logger['info'](util['format'](_0xcc1d('0x149'),_0x3c0ee0[_0x5fe044],_0xcc1d('0x143')));this['channel'][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x149'),_0x3c0ee0[_0x5fe044],_0xcc1d('0x143')));}}return{'code':0xc8,'result':_0xcc1d('0x143')};};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x14a')]=function(_0x15187f){logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0x14b'),_0x15187f[_0xcc1d('0x39')]));return this[_0xcc1d('0x37')][_0xcc1d('0x14a')]();};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x14c')]=function(_0x2121ed){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x14d'),_0x2121ed[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x2121ed[_0xcc1d('0x85')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0xec'));}var _0x1de4e9=_0xcc1d('0x137');var _0x2fd828=util[_0xcc1d('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0xcc1d('0x11b')](0x4));var _0x33ef1f=util[_0xcc1d('0x2a')](_0xcc1d('0xa6'),_0x2fd828,_0x1de4e9);var _0x4c3c4e=!![];if(_0x2121ed[_0xcc1d('0x12f')]===_0xcc1d('0x130')){_0x4c3c4e=![];}var _0x4e1879=this[_0xcc1d('0x37')][_0xcc1d('0x131')](_0x2fd828,_0x1de4e9,_0x2121ed[_0xcc1d('0x132')],_0x2121ed[_0xcc1d('0x6f')],undefined,_0x4c3c4e);if(_0x4e1879['result']!==-0x1){this[_0xcc1d('0x37')]['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x33ef1f));var _0x3816f8=this['ispeechASR']['sync'](this,_0x2121ed,_0x33ef1f);if(_0x3816f8){for(var _0x52c369 in _0x3816f8){if(_0x3816f8[_0xcc1d('0x9e')](_0x52c369)){this['channel']['setVariable'](util[_0xcc1d('0x2a')]('ISPEECH_ASR_%s',_0x52c369['toUpperCase']()),_0x3816f8[_0x52c369]);}}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util['format'](_0xcc1d('0x14e'),JSON[_0xcc1d('0x7e')](_0x3816f8)));}}return _0x4e1879;};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x14f')]=function(_0x22367c){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x150'),_0x22367c['label']));if(!this[_0xcc1d('0x90')](_0x22367c[_0xcc1d('0x85')])){return this['channel']['noop'](_0xcc1d('0xec'));}if(!this[_0xcc1d('0x90')](_0x22367c[_0xcc1d('0x63')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0xb1'));}this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x151'),_0x22367c[_0xcc1d('0x63')]));var _0x31a164=this[_0xcc1d('0x8c')][_0xcc1d('0x7b')](this,_0x22367c);if(_0x31a164){this[_0xcc1d('0x37')]['noop'](util[_0xcc1d('0x2a')](_0xcc1d('0x152'),_0x31a164));var _0x50ff97=this[_0xcc1d('0x37')][_0xcc1d('0x153')](_0x31a164,_0x22367c['intKey']);try{fs[_0xcc1d('0x126')](_0x31a164+_0xcc1d('0x105'));}catch(_0x31dfae){logger['error'](_0x31dfae);}return _0x50ff97;}return this[_0xcc1d('0x37')]['error'](_0x22367c,_0xcc1d('0x154'));};AGIVertices[_0xcc1d('0x10')]['login']=function(_0x484ed5){logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0x155'),_0x484ed5['label']));if(!this[_0xcc1d('0x90')](_0x484ed5[_0xcc1d('0x156')])){return this['channel'][_0xcc1d('0x59')](_0x484ed5,_0xcc1d('0x157'));}logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0x158'),this[_0xcc1d('0x37')][_0xcc1d('0x3c')],_0x484ed5[_0xcc1d('0x156')]));var _0x5e8481=this['agentLogin']['sync'](this,_0x484ed5[_0xcc1d('0x156')]);if(_0x5e8481){logger['info'](util['format'](_0xcc1d('0x159'),this['channel'][_0xcc1d('0x3c')],_0x484ed5[_0xcc1d('0x156')]));this['channel'][_0xcc1d('0xb0')](util['format'](_0xcc1d('0x159'),this['channel'][_0xcc1d('0x3c')],_0x484ed5[_0xcc1d('0x156')]));return{'code':0xc8,'result':_0xcc1d('0x15a')};}else{logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x15b'),this[_0xcc1d('0x37')]['callerid'],_0x484ed5[_0xcc1d('0x156')]));this['channel']['noop'](util[_0xcc1d('0x2a')](_0xcc1d('0x15b'),this[_0xcc1d('0x37')][_0xcc1d('0x3c')],_0x484ed5[_0xcc1d('0x156')]));return{'code':0xc8,'result':_0xcc1d('0x15c')};}};AGIVertices['prototype']['logout']=function(_0xaf249d){logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0x15d'),_0xaf249d[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0xaf249d[_0xcc1d('0x156')])){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0xaf249d,'no\x20find\x20by\x20configured');}logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x158'),this[_0xcc1d('0x37')][_0xcc1d('0x3c')],_0xaf249d['findBy']));var _0x3314cc=this[_0xcc1d('0x58')][_0xcc1d('0x7b')](this,_0xaf249d[_0xcc1d('0x156')]);if(_0x3314cc){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x159'),this['channel'][_0xcc1d('0x3c')],_0xaf249d['findBy']));this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x159'),this[_0xcc1d('0x37')][_0xcc1d('0x3c')],_0xaf249d['findBy']));return{'code':0xc8,'result':_0xcc1d('0x15a')};}else{logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0x15b'),this[_0xcc1d('0x37')][_0xcc1d('0x3c')],_0xaf249d['findBy']));this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x15b'),this[_0xcc1d('0x37')][_0xcc1d('0x3c')],_0xaf249d['findBy']));return{'code':0xc8,'result':_0xcc1d('0x15c')};}};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x15e')]=function(_0x1a0335){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x15f'),_0x1a0335[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x1a0335[_0xcc1d('0x160')])){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x1a0335,_0xcc1d('0x161'));}this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x162'),_0x1a0335[_0xcc1d('0x160')]));var _0x261daf=eval(_0x1a0335['operation']);if(!this[_0xcc1d('0x90')](_0x1a0335[_0xcc1d('0xdb')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0xdc'));}var _0x64d193=this[_0xcc1d('0x11')]['sync'](this,_0x1a0335[_0xcc1d('0xdb')]);if(!_0x64d193){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x1a0335,'no\x20variable\x20found');}if(_[_0xcc1d('0xa2')](_0x261daf)){var _0x193247=this;_0x261daf[_0xcc1d('0xde')](function(_0x4f42ac,_0x11ea10){_0x193247[_0xcc1d('0x37')][_0xcc1d('0xa7')](util[_0xcc1d('0x2a')]('%s[%s]',_0x64d193,_0x11ea10),_0x4f42ac);});return this['channel'][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x163'),_0x64d193));}else{return this[_0xcc1d('0x37')][_0xcc1d('0xa7')](_0x64d193,_0x261daf);}};AGIVertices['prototype'][_0xcc1d('0xb')]=function(_0xf2711f){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0xf2711f[_0xcc1d('0x39')]));if(_0xf2711f[_0xcc1d('0xaf')]===0x0){return this[_0xcc1d('0xae')](_0xf2711f);}_0xf2711f['retry']-=0x1;if(!this[_0xcc1d('0x90')](_0xf2711f[_0xcc1d('0x113')])){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0xf2711f,'no\x20file\x20audio\x20selected');}var _0xe56ef4=this[_0xcc1d('0x1f')][_0xcc1d('0x7b')](this,_0xf2711f[_0xcc1d('0x113')]);if(!_0xe56ef4){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0xf2711f,_0xcc1d('0x115'));}var _0x33c9fc=this[_0xcc1d('0x37')][_0xcc1d('0x116')](_0xe56ef4,_0xf2711f[_0xcc1d('0x117')],_0xf2711f[_0xcc1d('0x164')]);var _0x36a07d=_0x33c9fc[_0xcc1d('0xac')];if(_0x33c9fc['result']===-0x1){this[_0xcc1d('0x36')][_0xcc1d('0x7b')](this,_0xf2711f,'-1');return _0x33c9fc;}else if(_0x33c9fc[_0xcc1d('0xab')]===_0xcc1d('0x6f')){_0x33c9fc[_0xcc1d('0xac')]=_0x33c9fc['result']['length']>0x0?_0x33c9fc[_0xcc1d('0xac')]:'t';}else if(_['isEmpty'](_0x33c9fc[_0xcc1d('0xac')])){_0x33c9fc['result']='#';_0x36a07d='#';}if(!this[_0xcc1d('0x90')](_0xf2711f[_0xcc1d('0xdb')])){this['channel'][_0xcc1d('0xb0')](_0xcc1d('0xdc'));}else{var _0x21e915=this['getVariable'][_0xcc1d('0x7b')](this,_0xf2711f[_0xcc1d('0xdb')]);if(!_0x21e915){return this['channel'][_0xcc1d('0x59')](_0xf2711f,_0xcc1d('0xdd'));}this[_0xcc1d('0x37')][_0xcc1d('0xa7')](_0x21e915,_0x36a07d);}this[_0xcc1d('0x36')][_0xcc1d('0x7b')](this,_0xf2711f,_0x36a07d);return _0x33c9fc;};AGIVertices['prototype'][_0xcc1d('0xb0')]=function(_0xd62bc8){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0xd62bc8[_0xcc1d('0x39')]));return this['channel'][_0xcc1d('0xb0')](_0xd62bc8['output']||_0xd62bc8[_0xcc1d('0x39')]);};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x165')]=function(_0x3d83a4){logger[_0xcc1d('0x2e')](util['format'](_0xcc1d('0x166'),_0x3d83a4[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x3d83a4[_0xcc1d('0x156')])){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x3d83a4,_0xcc1d('0x157'));}logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xcc1d('0x37')][_0xcc1d('0x3c')],_0x3d83a4[_0xcc1d('0x156')]));var _0x3bf66e=this['getPause'][_0xcc1d('0x7b')](this,_0x3d83a4[_0xcc1d('0x167')]);var _0x1e9d1c=this[_0xcc1d('0x55')][_0xcc1d('0x7b')](this,_0x3d83a4[_0xcc1d('0x156')],_0x3bf66e);if(_0x1e9d1c){logger['info'](util['format'](_0xcc1d('0x159'),this[_0xcc1d('0x37')]['callerid'],_0x3d83a4[_0xcc1d('0x156')]));this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x159'),this[_0xcc1d('0x37')][_0xcc1d('0x3c')],_0x3d83a4[_0xcc1d('0x156')]));return{'code':0xc8,'result':_0xcc1d('0x15a')};}else{logger[_0xcc1d('0x2e')](util['format'](_0xcc1d('0x15b'),this[_0xcc1d('0x37')][_0xcc1d('0x3c')],_0x3d83a4[_0xcc1d('0x156')]));this[_0xcc1d('0x37')]['noop'](util[_0xcc1d('0x2a')](_0xcc1d('0x159'),this['channel'][_0xcc1d('0x3c')],_0x3d83a4[_0xcc1d('0x156')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x168')]=function(_0x5d70b6){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x169'),_0x5d70b6[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x5d70b6[_0xcc1d('0x113')])){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x5d70b6,_0xcc1d('0x114'));}var _0x5b4f49=this[_0xcc1d('0x1f')]['sync'](this,_0x5d70b6['file_id']);if(!_0x5b4f49){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x5d70b6,_0xcc1d('0x115'));}var _0x9e1429=this['channel'][_0xcc1d('0x5e')](_0xcc1d('0x16a'),[_0x5b4f49,_0x5d70b6[_0xcc1d('0xe8')]]);if(_0x9e1429[_0xcc1d('0xac')]===-0x1){return _0x9e1429;}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x16b'),_0xcc1d('0x16a'),_0x5b4f49));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x16c')]=function(_0x5afc77){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x16d'),_0x5afc77[_0xcc1d('0x39')]));if(!this['isConfigured'](_0x5afc77['queue_id'])){return this[_0xcc1d('0x37')]['error'](_0x5afc77,_0xcc1d('0x16e'));}var _0x4beb0e='';var _0x31557a=parseInt(_0x5afc77[_0xcc1d('0x16f')],0xa);if(isNaN(_0x31557a)){_0x4beb0e=_0x5afc77[_0xcc1d('0x16f')];}else{_0x4beb0e=this[_0xcc1d('0x16')][_0xcc1d('0x7b')](this,_0x5afc77[_0xcc1d('0x16f')]);if(!_0x4beb0e){return this[_0xcc1d('0x37')]['error'](_0x5afc77,_0xcc1d('0x170'));}}var _0x31cd46='';if(this[_0xcc1d('0x90')](_0x5afc77[_0xcc1d('0x113')])){var _0x5df6ed=this[_0xcc1d('0x1f')][_0xcc1d('0x7b')](this,_0x5afc77[_0xcc1d('0x113')]);if(_0x5df6ed){_0x31cd46=_0x5df6ed;}}this['createSquareDetailsReport'][_0xcc1d('0x7b')](this,_0x5afc77,_0x4beb0e);if(_0x5afc77[_0xcc1d('0xe8')]['indexOf']('x')<0x0){_0x5afc77['opts']+='x';}if(_0x5afc77['opts'][_0xcc1d('0x171')]('X')<0x0){_0x5afc77[_0xcc1d('0xe8')]+='X';}this[_0xcc1d('0x37')][_0xcc1d('0xa7')](_0xcc1d('0x172'),_0x4beb0e?_0x4beb0e[_0xcc1d('0x173')]():'');var _0x32bbe7=this['channel'][_0xcc1d('0x5e')](_0xcc1d('0x174'),[_0x4beb0e,_0x5afc77[_0xcc1d('0xe8')],_0x5afc77['url'],_0x31cd46,_0x5afc77[_0xcc1d('0x6f')],_0x5afc77['agi'],_0x5afc77['macro'],_0x5afc77[_0xcc1d('0x175')],'',_0x5afc77[_0xcc1d('0x176')]]);if(_0x32bbe7[_0xcc1d('0xac')]===-0x1){return _0x32bbe7;}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util['format'](_0xcc1d('0x16b'),_0xcc1d('0x174'),_0x4beb0e));};AGIVertices['prototype'][_0xcc1d('0x177')]=function(_0x222478){logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0x178'),_0x222478[_0xcc1d('0x39')]));var _0x2ab8fb=_0x222478['recordingFormat']||_0xcc1d('0x137');var _0x18dc45=util[_0xcc1d('0x2a')](_0xcc1d('0x179'),this[_0xcc1d('0x37')][_0xcc1d('0x38')],rs[_0xcc1d('0x11b')](0x5));var _0x14162f=util[_0xcc1d('0x2a')](_0xcc1d('0x17a'),FILES_PATH,_0x18dc45,_0x2ab8fb);var _0x2c49f3=util[_0xcc1d('0x2a')]('%s/recordings/%s',FILES_PATH,_0x18dc45);this[_0xcc1d('0x3d')][_0xcc1d('0x7b')](this,_0x222478,_0x18dc45,_0x14162f);this['channel']['setVariable'](_0xcc1d('0x17b'),_0x18dc45);logger[_0xcc1d('0x2e')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x2c49f3,_0x2ab8fb,_0x222478[_0xcc1d('0x17c')],_0x222478[_0xcc1d('0x6f')]);return this['channel'][_0xcc1d('0x131')](_0x2c49f3,_0x2ab8fb,_0x222478[_0xcc1d('0x17c')],_0x222478[_0xcc1d('0x6f')],undefined,!![]);};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x17d')]=function(_0x20f206){logger[_0xcc1d('0x2e')](util['format'](_0xcc1d('0x17e'),_0x20f206[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x20f206[_0xcc1d('0x6c')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0x17f'));}var _0x47a01e=this[_0xcc1d('0x6b')]['sync'](this,_0x20f206);logger[_0xcc1d('0x2e')](util['format'](_0xcc1d('0x180'),util[_0xcc1d('0x181')](_0x47a01e,{'showHidden':![],'depth':null})));if(!this[_0xcc1d('0x90')](_0x20f206['variable_id'])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0x182'));}var _0x43a44b=this[_0xcc1d('0x11')][_0xcc1d('0x7b')](this,_0x20f206[_0xcc1d('0xdb')]);if(!_0x43a44b){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x20f206,_0xcc1d('0xdd'));}this[_0xcc1d('0x37')][_0xcc1d('0xa7')](util[_0xcc1d('0x2a')](_0xcc1d('0x183'),_0x43a44b),_0x47a01e[_0xcc1d('0x7f')]?_0x47a01e[_0xcc1d('0x7f')]:_0xcc1d('0x184'));this[_0xcc1d('0x37')][_0xcc1d('0xa7')](util[_0xcc1d('0x2a')](_0xcc1d('0x185'),_0x43a44b),_0x47a01e[_0xcc1d('0x80')]?_0x47a01e[_0xcc1d('0x80')]:'OK');if(_0x47a01e['body']){try{this[_0xcc1d('0xa4')](_0x47a01e[_0xcc1d('0x74')],_0x43a44b);}catch(_0x4bd851){logger['error'](util[_0xcc1d('0x2a')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x43a44b));}}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0xe2'),_0x43a44b));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x186')]=function(_0x25d012){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x187'),_0x25d012[_0xcc1d('0x39')]));return this[_0xcc1d('0x37')][_0xcc1d('0x188')](_0x25d012['digits'][_0xcc1d('0x5f')](/\s+/g,''),_0x25d012[_0xcc1d('0x17c')]);};AGIVertices['prototype']['saynumber']=function(_0x2d736d){logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0x189'),_0x2d736d['label']));return this[_0xcc1d('0x37')][_0xcc1d('0x18a')](_0x2d736d[_0xcc1d('0x6e')][_0xcc1d('0x5f')](/\s+/g,''),_0x2d736d[_0xcc1d('0x17c')]);};AGIVertices['prototype'][_0xcc1d('0x18b')]=function(_0x49d91e){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x18c'),_0x49d91e[_0xcc1d('0x39')]));return this[_0xcc1d('0x37')]['sayPhonetic'](_0x49d91e[_0xcc1d('0x63')],_0x49d91e[_0xcc1d('0x17c')]);};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x18d')]=function(_0x5a33dd){logger['info'](util[_0xcc1d('0x2a')](_0xcc1d('0x18e'),_0x5a33dd[_0xcc1d('0x39')]));if(!this['isConfigured'](_0x5a33dd[_0xcc1d('0x18f')])){return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0x190'));}var _0x1fb289=this['getMailAccount'][_0xcc1d('0x7b')](this,_0x5a33dd[_0xcc1d('0x18f')]);if(!_0x1fb289||!_0x1fb289[_0xcc1d('0x191')]){return this[_0xcc1d('0x37')]['error'](_0x5a33dd,_0xcc1d('0x192'));}var _0x5ba9f2={'from':util[_0xcc1d('0x2a')](_0xcc1d('0x193'),_0x1fb289[_0xcc1d('0x14')],_0x1fb289[_0xcc1d('0x194')]||_0x1fb289['Smtp']['user']),'to':_0x5a33dd['to']||'','cc':_0x5a33dd['cc']||'','bcc':_0x5a33dd[_0xcc1d('0x195')]||'','subject':_0x5a33dd[_0xcc1d('0x196')],'html':_0x5a33dd['text'],'text':_0x5a33dd[_0xcc1d('0x63')]};var _0x3df975={'tls':{'rejectUnauthorized':![]}};if(_0x1fb289[_0xcc1d('0x191')][_0xcc1d('0x197')]){_0x3df975[_0xcc1d('0x197')]=_0x1fb289[_0xcc1d('0x191')][_0xcc1d('0x197')];}else{_0x3df975['host']=_0x1fb289[_0xcc1d('0x191')]['host'];_0x3df975[_0xcc1d('0x198')]=_0x1fb289[_0xcc1d('0x191')][_0xcc1d('0x198')];_0x3df975[_0xcc1d('0x199')]=_0x1fb289[_0xcc1d('0x191')][_0xcc1d('0x199')];}if(_0x1fb289['Smtp'][_0xcc1d('0x19a')]){_0x3df975[_0xcc1d('0x19b')]={'user':_0x1fb289['Smtp'][_0xcc1d('0x19c')],'pass':_0x1fb289[_0xcc1d('0x191')][_0xcc1d('0x19d')]};}if(this[_0xcc1d('0x90')](_0x5a33dd[_0xcc1d('0x19e')])){}logger[_0xcc1d('0xe3')](_0xcc1d('0x19f'),JSON[_0xcc1d('0x7e')](_0x5ba9f2));this[_0xcc1d('0x36')][_0xcc1d('0x7b')](this,_0x5a33dd,_0x5a33dd[_0xcc1d('0x18f')]);this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x1a0'),_0x1fb289[_0xcc1d('0x14')]));this['sendMailMessage'][_0xcc1d('0x7b')](this,_0x3df975,_0x5ba9f2);return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0x1a1'));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x1a2')]=function(_0x27a497){logger['info'](util['format'](_0xcc1d('0x1a3'),_0x27a497[_0xcc1d('0x39')]));return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0x1a4'));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x1a5')]=function(_0x3669c7){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x1a6'),_0x3669c7[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x3669c7[_0xcc1d('0x1a7')])){return this['channel'][_0xcc1d('0xb0')]('no\x20sms\x20account\x20configured');}var _0x553063=this['getSmsAccount'][_0xcc1d('0x7b')](this,_0x3669c7[_0xcc1d('0x1a7')]);if(!_0x553063){return this[_0xcc1d('0x37')]['error'](_0x3669c7,'no\x20sms\x20account\x20found');}var _0x23dec8={'body':_0x3669c7[_0xcc1d('0x1a8')],'phone':_0x3669c7['to']||'','SmsAccountId':_0x553063['id']};logger[_0xcc1d('0xe3')]('sendSMS\x20message',JSON['stringify'](_0x23dec8));this[_0xcc1d('0x36')][_0xcc1d('0x7b')](this,_0x3669c7,_0x3669c7[_0xcc1d('0x1a7')]);this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util['format'](_0xcc1d('0x1a9'),_0x553063[_0xcc1d('0x14')]));this[_0xcc1d('0x35')]['sync'](this,_0x23dec8);return this[_0xcc1d('0x37')][_0xcc1d('0xb0')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x1aa')]=function(_0x43ba7c){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x43ba7c[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x43ba7c[_0xcc1d('0xdb')])){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x43ba7c,_0xcc1d('0x1ab'));}var _0x17615c=this[_0xcc1d('0x11')][_0xcc1d('0x7b')](this,_0x43ba7c['variable_id']);if(!_0x17615c){return this[_0xcc1d('0x37')]['error'](_0x43ba7c,'no\x20variable\x20found');}return this[_0xcc1d('0x37')][_0xcc1d('0xa7')](_0x17615c,_0x43ba7c[_0xcc1d('0x1ac')]);};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x1ad')]=function(_0x1a0fcd){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x1ae'),_0x1a0fcd[_0xcc1d('0x39')]));this[_0xcc1d('0x37')]['noop'](_0xcc1d('0x1af'));if(_0x1a0fcd[_0xcc1d('0xbd')]==='yes'){this[_0xcc1d('0x37')]['noop'](_0xcc1d('0x1b0'));return this[_0xcc1d('0x37')]['answer']();}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](_0xcc1d('0x1b1'));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x1b2')]=function(_0x238b3a){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x1b3'),_0x238b3a[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x238b3a[_0xcc1d('0x1b4')])){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x238b3a,_0xcc1d('0x1b5'));}var _0x2021f0=this[_0xcc1d('0x17')]['sync'](this,_0x238b3a['project_id']);if(!this[_0xcc1d('0x90')](_0x2021f0)){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x238b3a,util['format'](_0xcc1d('0x1b6'),_0x238b3a[_0xcc1d('0x1b4')]));}if(_0x2021f0===this[_0xcc1d('0x37')][_0xcc1d('0x3b')]){return this['channel'][_0xcc1d('0x59')](_0x238b3a,_0xcc1d('0x1b7'));}this[_0xcc1d('0x36')][_0xcc1d('0x7b')](this,_0x238b3a,_0x2021f0);var _0x33cbce=this['channel'][_0xcc1d('0x5e')]('AGI',util[_0xcc1d('0x2a')](_0xcc1d('0x1b8'),config['agi'][_0xcc1d('0x1b9')]||_0xcc1d('0x1ba'),_0x2021f0,this[_0xcc1d('0x37')][_0xcc1d('0x3b')]));if(_0x33cbce['result']===-0x1){return _0x33cbce;}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x16b'),_0xcc1d('0x1bb'),_0x2021f0));};AGIVertices['prototype'][_0xcc1d('0x1bc')]=function(_0x35c972){logger['info'](util[_0xcc1d('0x2a')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x35c972[_0xcc1d('0x39')]));var _0x51ec64=this[_0xcc1d('0x5d')][_0xcc1d('0x7b')](this,_0x35c972[_0xcc1d('0x1bd')]);this[_0xcc1d('0x36')][_0xcc1d('0x7b')](this,_0x35c972,_0x35c972[_0xcc1d('0x1bd')]);if(this[_0xcc1d('0x90')](_0x35c972[_0xcc1d('0xdb')])){var _0x582dd9=this[_0xcc1d('0x11')][_0xcc1d('0x7b')](this,_0x35c972[_0xcc1d('0xdb')]);if(_0x582dd9){this[_0xcc1d('0x37')][_0xcc1d('0xa7')](_0x582dd9,_0x51ec64);return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x1be'),_0x35c972[_0xcc1d('0x1bd')],_0x582dd9));}}return this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x35c972[_0xcc1d('0x1bd')]));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x1bf')]=function(_0x198945){logger[_0xcc1d('0x2e')](util['format'](_0xcc1d('0x1c0'),_0x198945[_0xcc1d('0x39')]));_0x198945['text']=_0x198945[_0xcc1d('0x63')][_0xcc1d('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xcc1d('0x90')](_0x198945[_0xcc1d('0x61')])){return this[_0xcc1d('0x37')]['noop'](_0xcc1d('0x1c1'));}if(!this[_0xcc1d('0x90')](_0x198945['text'])){return this['channel'][_0xcc1d('0xb0')]('no\x20text\x20configured');}this[_0xcc1d('0x37')]['noop'](util['format'](_0xcc1d('0x1c2'),_0x198945['text']));var _0x3c2327=this[_0xcc1d('0x60')][_0xcc1d('0x7b')](this,_0x198945);if(_0x3c2327){this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x3c2327));var _0x18f9c0=this['channel'][_0xcc1d('0x153')](_0x3c2327);try{fs['unlink'](_0x3c2327+_0xcc1d('0x105'));}catch(_0x4510ba){logger[_0xcc1d('0x59')](_0x4510ba);}return _0x18f9c0;}return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x198945,_0xcc1d('0x1c3'));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x1c4')]=function(_0x3c2aff){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x1c5'),_0x3c2aff[_0xcc1d('0x39')]));_0x3c2aff[_0xcc1d('0x63')]=_0x3c2aff[_0xcc1d('0x63')][_0xcc1d('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xcc1d('0x90')](_0x3c2aff[_0xcc1d('0x63')])){return this['channel'][_0xcc1d('0xb0')]('no\x20text\x20configured');}this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x1c6'),_0x3c2aff['text']));var _0x1d60f8=this[_0xcc1d('0x69')][_0xcc1d('0x7b')](this,_0x3c2aff);if(_0x1d60f8){this['channel']['noop'](util[_0xcc1d('0x2a')](_0xcc1d('0x1c7'),_0x1d60f8));var _0x1d810e=this['channel']['streamFile'](_0x1d60f8);try{fs[_0xcc1d('0x126')](_0x1d60f8+_0xcc1d('0x105'));}catch(_0x392212){logger[_0xcc1d('0x59')](_0x392212);}return _0x1d810e;}return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x3c2aff,_0xcc1d('0x1c8'));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x1c9')]=function(_0x154f15){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x1ca'),_0x154f15[_0xcc1d('0x39')]));if(!this[_0xcc1d('0x90')](_0x154f15[_0xcc1d('0x156')])){return this['channel']['error'](_0x154f15,_0xcc1d('0x157'));}logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x158'),this[_0xcc1d('0x37')][_0xcc1d('0x3c')],_0x154f15[_0xcc1d('0x156')]));var _0x499f7b=this[_0xcc1d('0x57')][_0xcc1d('0x7b')](this,_0x154f15[_0xcc1d('0x156')]);if(_0x499f7b){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x159'),this['channel'][_0xcc1d('0x3c')],_0x154f15[_0xcc1d('0x156')]));this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x159'),this[_0xcc1d('0x37')][_0xcc1d('0x3c')],_0x154f15['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xcc1d('0x2e')](util['format'](_0xcc1d('0x15b'),this[_0xcc1d('0x37')][_0xcc1d('0x3c')],_0x154f15['findBy']));this[_0xcc1d('0x37')][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x15b'),this[_0xcc1d('0x37')][_0xcc1d('0x3c')],_0x154f15[_0xcc1d('0x156')]));return{'code':0xc8,'result':_0xcc1d('0x15c')};}};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x1cb')]=function(_0x5b5ae7){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x5b5ae7[_0xcc1d('0x39')]));var _0x29c504=this[_0xcc1d('0x37')][_0xcc1d('0x5e')](_0xcc1d('0x1cc'),[_0x5b5ae7[_0xcc1d('0x1cd')],_0x5b5ae7[_0xcc1d('0x83')]]);if(_0x29c504[_0xcc1d('0xac')]===-0x1){return _0x29c504;}return this['channel'][_0xcc1d('0xb0')](util[_0xcc1d('0x2a')](_0xcc1d('0x16b'),_0xcc1d('0x1cc'),_0x5b5ae7[_0xcc1d('0x1cd')]));};AGIVertices[_0xcc1d('0x10')][_0xcc1d('0x1ce')]=function(_0x16adf8){logger[_0xcc1d('0x2e')](util[_0xcc1d('0x2a')](_0xcc1d('0x1cf'),_0x16adf8[_0xcc1d('0x39')]));if(!this['isConfigured'](_0x16adf8[_0xcc1d('0xdb')])){return this[_0xcc1d('0x37')][_0xcc1d('0x59')](_0x16adf8,_0xcc1d('0x1ab'));}var _0x1566d2=this[_0xcc1d('0x11')]['sync'](this,_0x16adf8[_0xcc1d('0xdb')]);if(!_0x1566d2){return this[_0xcc1d('0x37')]['error'](_0x16adf8,_0xcc1d('0xdd'));}var _0x25b720=this[_0xcc1d('0x37')]['getVariable'](_0x1566d2);return{'code':0xc8,'result':_0x25b720[_0xcc1d('0xab')]?_0x25b720[_0xcc1d('0xab')]:'-'};};String['prototype'][_0xcc1d('0xaa')]=function(_0x4b9c33,_0x5b372b){return this[_0xcc1d('0xa8')](_0x4b9c33)[_0xcc1d('0x1d0')](_0x5b372b);};module['exports']=AGIVertices; \ No newline at end of file +var _0xdc03=['Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','no\x20file\x20audio\x20selected','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','%s/recordings/%s.%s','createSquareRecording','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','Smtp','email','bcc','subject','service','host','port','secure','authentication','user','pass','template_id','sendMail\x20message','account_id','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','127.0.0.1','AGI','system','shellCommand','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','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','exports','path','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','getSoundPath','format','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','callerid','uniqueid','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','scheduledAt','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','agentLogin','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','method','timeout','number','includes','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','url','stringify','body','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','tildeASR','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','exec','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','noop','no\x20grammar\x20configured','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','sync','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','getdigits','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','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','tildeasr','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','FIND\x20AGENT\x20%s\x20BY\x20%s','failure','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set'];(function(_0x3a828e,_0x5aefff){var _0x38f7d0=function(_0x3d363c){while(--_0x3d363c){_0x3a828e['push'](_0x3a828e['shift']());}};_0x38f7d0(++_0x5aefff);}(_0xdc03,0x65));var _0x3dc0=function(_0x25fd83,_0x18f216){_0x25fd83=_0x25fd83-0x0;var _0x5dd42c=_0xdc03[_0x25fd83];return _0x5dd42c;};'use strict';var fs=require('fs');var path=require(_0x3dc0('0x0'));var util=require('util');var _=require(_0x3dc0('0x1'));var sh=require(_0x3dc0('0x2'));var odbc=require('odbc')();var rs=require(_0x3dc0('0x3'));var moment=require(_0x3dc0('0x4'));var Mustache=require(_0x3dc0('0x5'));var rp=require(_0x3dc0('0x6'));var logger=require(_0x3dc0('0x7'))(_0x3dc0('0x8'));var config=require('../../config/environment');var scripts=require(_0x3dc0('0x9'));var FILES_PATH=_0x3dc0('0xa');var recursiveMapAttributes=[_0x3dc0('0xb'),'rawBody'];var verticesWithRetry=[_0x3dc0('0xc'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x51f26b,_0x7d59a8,_0x146fd0){this[_0x3dc0('0xd')]=_0x51f26b;this[_0x3dc0('0xe')]=_0x7d59a8;this[_0x3dc0('0xf')]=_0x146fd0;};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x11')]=function(_0x569cfa,_0x481013){this[_0x3dc0('0xe')][_0x3dc0('0x12')](_0x569cfa)[_0x3dc0('0x13')](function(_0x4db45a){_0x481013(null,_0x4db45a?_0x4db45a['name']:![]);})[_0x3dc0('0x14')](function(_0x4938d1){_0x481013(_0x4938d1);});};AGIVertices[_0x3dc0('0x10')]['getVoiceQueue']=function(_0x52147f,_0x297de8){this[_0x3dc0('0xe')][_0x3dc0('0x15')](_0x52147f)[_0x3dc0('0x13')](function(_0x2bed0d){_0x297de8(null,_0x2bed0d?_0x2bed0d[_0x3dc0('0x16')]:![]);})[_0x3dc0('0x14')](function(_0x21d8f7){_0x297de8(_0x21d8f7);});};AGIVertices['prototype'][_0x3dc0('0x17')]=function(_0x3bcee6,_0x5d8781){this[_0x3dc0('0xe')][_0x3dc0('0x18')](_0x3bcee6)[_0x3dc0('0x13')](function(_0x5d45ee){_0x5d8781(null,_0x5d45ee?_0x5d45ee[_0x3dc0('0x16')]:![]);})[_0x3dc0('0x14')](function(_0x200a15){_0x5d8781(_0x200a15);});};AGIVertices['prototype'][_0x3dc0('0x19')]=function(_0x3776f4,_0xd5d90a){this[_0x3dc0('0xe')][_0x3dc0('0x1a')](_0x3776f4)[_0x3dc0('0x13')](function(_0x379fff){_0xd5d90a(null,_0x379fff?_0x379fff[_0x3dc0('0x1b')]:![]);})[_0x3dc0('0x14')](function(_0xbef495){_0xd5d90a(_0xbef495);});};AGIVertices['prototype'][_0x3dc0('0x1c')]=function(_0x1927a0,_0x273ea2){this['rpc']['getUserById'](_0x1927a0)[_0x3dc0('0x13')](function(_0x3843bb){_0x273ea2(null,_0x3843bb?_0x3843bb[_0x3dc0('0x16')]:![]);})[_0x3dc0('0x14')](function(_0x503332){_0x273ea2(_0x503332);});};AGIVertices[_0x3dc0('0x10')]['getTrunk']=function(_0x58c3db,_0x4173c1){this[_0x3dc0('0xe')][_0x3dc0('0x1d')](_0x58c3db)[_0x3dc0('0x13')](function(_0x1dfdbc){_0x4173c1(null,_0x1dfdbc?_0x1dfdbc['name']:![]);})['catch'](function(_0x105e55){_0x4173c1(_0x105e55);});};AGIVertices['prototype'][_0x3dc0('0x1e')]=function(_0x1ec992,_0x4dcc24){var _0x3ebb0e=this;this['rpc'][_0x3dc0('0x1f')](_0x1ec992)[_0x3dc0('0x13')](function(_0x59593c){_0x4dcc24(null,_0x59593c?_0x3ebb0e['getSoundPath'](_0x59593c[_0x3dc0('0x20')]):![]);})['catch'](function(_0x58add0){_0x4dcc24(_0x58add0);});};AGIVertices['prototype'][_0x3dc0('0x21')]=function(_0x1a4905,_0x195560){this['rpc'][_0x3dc0('0x22')](_0x1a4905)[_0x3dc0('0x13')](function(_0x52b5ac){_0x195560(null,_0x52b5ac?_0x52b5ac:![]);})['catch'](function(_0xc319cd){_0x195560(_0xc319cd);});};AGIVertices['prototype'][_0x3dc0('0x23')]=function(_0x17653f,_0x6bdef6,_0x45c1d0){this[_0x3dc0('0xf')]['sendMailMessage'](_0x17653f,_0x6bdef6)['then'](function(){_0x45c1d0(null);})[_0x3dc0('0x14')](function(_0x156a7c){_0x45c1d0(_0x156a7c);});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x24')]=function(_0x2f3d61,_0x153516){this['rpc']['getIntervalById'](_0x2f3d61)['then'](function(_0xc3273d){if(_0xc3273d){if(_0xc3273d[_0x3dc0('0x25')]){_0x153516(null,[_0xc3273d[_0x3dc0('0x26')]]);}else{_0x153516(null,_['map'](_0xc3273d['Intervals'],_0x3dc0('0x26')));}}else{_0x153516(null,![]);}})[_0x3dc0('0x14')](function(_0x263bcc){_0x153516(_0x263bcc);});};AGIVertices['prototype'][_0x3dc0('0x27')]=function(_0xd7d3b7){return util[_0x3dc0('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0xd7d3b7);};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x29')]=function(_0x150607,_0x389a88,_0x18981b){odbc[_0x3dc0('0x2a')](_0x150607,function(_0xd2e8d2){if(_0xd2e8d2){logger['error'](_0x3dc0('0x2b'),_0xd2e8d2);_0x18981b(_0xd2e8d2);}else{logger['info'](_0x3dc0('0x2c'));odbc[_0x3dc0('0x2d')](_0x389a88,function(_0x277325,_0x33de4b){if(_0x277325){logger[_0x3dc0('0x2e')](_0x3dc0('0x2f'),_0x389a88);_0x18981b(_0x277325);}else{logger[_0x3dc0('0x2e')]('Query\x20executed\x20correctly\x20%s',_0x389a88);odbc['close'](function(_0x5e8dfa){if(_0x5e8dfa){logger[_0x3dc0('0x30')](_0x3dc0('0x31'),_0x5e8dfa);}_0x18981b(null,_0x33de4b);});}});}});};AGIVertices[_0x3dc0('0x10')]['getSmsAccount']=function(_0x28f1c2,_0x4c60db){this[_0x3dc0('0xe')][_0x3dc0('0x32')](_0x28f1c2)[_0x3dc0('0x13')](function(_0x520a97){_0x4c60db(null,_0x520a97?_0x520a97:![]);})[_0x3dc0('0x14')](function(_0x40af27){_0x4c60db(_0x40af27);});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x33')]=function(_0x322dbb,_0x4e4845){this[_0x3dc0('0xe')][_0x3dc0('0x33')](_0x322dbb)[_0x3dc0('0x13')](function(_0x576897){_0x4e4845(null,_0x576897);})[_0x3dc0('0x14')](function(_0x4c5e13){_0x4e4845(_0x4c5e13);});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x34')]=function(_0x2715f8,_0x331dba,_0xc409c){this[_0x3dc0('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x3dc0('0xd')]['uniqueid'],'node':_0x2715f8[_0x3dc0('0x35')],'application':_0x2715f8[_0x3dc0('0x36')],'data':_0x331dba||null,'project_name':this[_0x3dc0('0xd')]['arg_1'],'callerid':this[_0x3dc0('0xd')][_0x3dc0('0x37')]})[_0x3dc0('0x13')](function(_0x2916f7){if(_0xc409c){_0xc409c(null,_0x2916f7);}})[_0x3dc0('0x14')](function(_0xb21e0b){if(_0xc409c){_0xc409c(_0xb21e0b);}});};AGIVertices[_0x3dc0('0x10')]['createSquareRecording']=function(_0xfaf4d1,_0x3df8e3,_0x23ceee,_0x4f2e0e){this[_0x3dc0('0xe')]['createSquareRecording']({'uniqueid':this[_0x3dc0('0xd')][_0x3dc0('0x38')],'callerid':this[_0x3dc0('0xd')][_0x3dc0('0x37')],'calleridname':this['channel'][_0x3dc0('0x39')],'context':this[_0x3dc0('0xd')][_0x3dc0('0x3a')],'extension':this[_0x3dc0('0xd')][_0x3dc0('0x3b')],'priority':this[_0x3dc0('0xd')][_0x3dc0('0x3c')],'accountcode':this['channel'][_0x3dc0('0x3d')],'dnid':this['channel'][_0x3dc0('0x3e')],'projectName':this[_0x3dc0('0xd')][_0x3dc0('0x3f')],'saveName':_0x3df8e3,'filename':_0xfaf4d1[_0x3dc0('0x40')]||_0x3df8e3,'savePath':_0x23ceee})[_0x3dc0('0x13')](function(_0x370cfe){_0x4f2e0e(null,_0x370cfe);})[_0x3dc0('0x14')](function(_0x76889c){_0x4f2e0e(_0x76889c);});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x41')]=function(_0x3689e0,_0x1879e7,_0x3cda33,_0x470faf,_0x448c8f){this[_0x3dc0('0xe')][_0x3dc0('0x41')]({'uniqueid':this[_0x3dc0('0xd')][_0x3dc0('0x38')],'body':_0x3689e0,'direction':_0x1879e7,'providerName':_0x3cda33,'providerResponse':_0x470faf})['then'](function(_0x58a9b1){if(_0x448c8f){_0x448c8f(null,_0x58a9b1);}})[_0x3dc0('0x14')](function(_0xbf0667){if(_0x448c8f){_0x448c8f(_0xbf0667);}});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x42')]=function(_0x1a0c67,_0x5df5bf){this[_0x3dc0('0xe')][_0x3dc0('0x42')]({'firstName':_[_0x3dc0('0x43')](_0x1a0c67[_0x3dc0('0x16')])||_['isNil'](_0x1a0c67[_0x3dc0('0x16')])?'callback_'+Math['random']():_0x1a0c67[_0x3dc0('0x16')],'lastName':_['isEmpty'](_0x1a0c67['lastName'])||_[_0x3dc0('0x44')](_0x1a0c67[_0x3dc0('0x45')])?null:_0x1a0c67[_0x3dc0('0x45')],'phone':_0x1a0c67[_0x3dc0('0x46')],'ListId':_0x1a0c67[_0x3dc0('0x47')],'scheduledat':_0x1a0c67['scheduledAt'],'callbackUniqueid':this['channel'][_0x3dc0('0x38')],'tags':'callback','description':_0x3dc0('0x48')+_0x1a0c67[_0x3dc0('0x49')]['toString'](),'priority':_0x1a0c67[_0x3dc0('0x4a')]})[_0x3dc0('0x13')](function(_0x2cf469){_0x5df5bf(null,_0x2cf469);})[_0x3dc0('0x14')](function(_0x19a04a){_0x5df5bf(_0x19a04a);});};AGIVertices['prototype']['getPause']=function(_0xfda90d,_0x546a62){this[_0x3dc0('0xe')][_0x3dc0('0x4b')](_0xfda90d)['then'](function(_0x3af529){_0x546a62(null,_0x3af529?_0x3af529[_0x3dc0('0x16')]:![]);})['catch'](function(_0x2d4b79){_0x546a62(_0x2d4b79);});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x4c')]=function(_0x219004,_0x4b31dd,_0x367d09){var _0x3d561b={'role':_0x3dc0('0x4d')};_0x3d561b[_0x219004]=this[_0x3dc0('0xd')][_0x3dc0('0x37')];this[_0x3dc0('0xe')]['agentPause'](_0x3d561b,_0x4b31dd,this[_0x3dc0('0xd')]['uniqueid'])['then'](function(_0x59f2b5){_0x367d09(null,_[_0x3dc0('0x44')](_0x59f2b5)?![]:!![]);})[_0x3dc0('0x14')](function(_0x42ed52){logger[_0x3dc0('0x30')](_0x42ed52);_0x367d09(null,![]);});};AGIVertices[_0x3dc0('0x10')]['agentUnpause']=function(_0x379866,_0x14e85f){var _0x414c31={'role':'agent'};_0x414c31[_0x379866]=this[_0x3dc0('0xd')]['callerid'];this[_0x3dc0('0xe')][_0x3dc0('0x4e')](_0x414c31)['then'](function(_0x4937e6){_0x14e85f(null,_[_0x3dc0('0x44')](_0x4937e6)?![]:!![]);})[_0x3dc0('0x14')](function(_0x24e27e){logger[_0x3dc0('0x30')](_0x24e27e);_0x14e85f(null,![]);});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x4f')]=function(_0x51a2c4,_0x2c4fb7){var _0x5b0af8={'role':_0x3dc0('0x4d')};_0x5b0af8[_0x51a2c4]=this[_0x3dc0('0xd')][_0x3dc0('0x37')];this[_0x3dc0('0xe')][_0x3dc0('0x4f')](_0x5b0af8)['then'](function(_0x361e1f){_0x2c4fb7(null,_[_0x3dc0('0x44')](_0x361e1f)?![]:!![]);})['catch'](function(_0x3efcc8){logger['error'](_0x3efcc8);_0x2c4fb7(null,![]);});};AGIVertices[_0x3dc0('0x10')]['agentLogin']=function(_0x3e5fea,_0x1cc61b){var _0x2b0829={'role':_0x3dc0('0x4d')};_0x2b0829[_0x3e5fea]=this[_0x3dc0('0xd')][_0x3dc0('0x37')];var _0xadebc0=_0x3e5fea!=_0x3dc0('0x50')?util[_0x3dc0('0x28')](_0x3dc0('0x51'),'LOCAL',this['channel']['callerid']):undefined;this[_0x3dc0('0xe')][_0x3dc0('0x52')](_0x2b0829,_0xadebc0)['then'](function(_0x12e76e){_0x1cc61b(null,_[_0x3dc0('0x44')](_0x12e76e)?![]:!![]);})['catch'](function(_0x4e5ab8){logger[_0x3dc0('0x30')](_0x4e5ab8);_0x1cc61b(null,![]);});};AGIVertices[_0x3dc0('0x10')]['shellCommand']=function(_0x2561b5,_0x586122){sh['exec'](_[_0x3dc0('0x53')](_0x2561b5),function(_0x270242,_0x10b959){var _0x529c5f=_0x10b959['replace'](/(\r\n|\n|\r)/gm,'');_0x586122(null,_0x529c5f);});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x54')]=function(_0x2494c4,_0x11e193){scripts[_0x3dc0('0x54')](_0x2494c4[_0x3dc0('0x55')],_0x2494c4[_0x3dc0('0x56')]||_0x3dc0('0x57'),_0x2494c4[_0x3dc0('0x57')],_0x2494c4[_0x3dc0('0x58')]||_0x3dc0('0x59'),_0x2494c4[_0x3dc0('0x5a')]||_0x3dc0('0x5b'),_0x2494c4['audioEncoding']||_0x3dc0('0x5c'))[_0x3dc0('0x13')](function(_0x56e9f6){_0x11e193(null,_0x56e9f6);})[_0x3dc0('0x14')](function(_0x107c47){_0x11e193(_0x107c47);});};AGIVertices['prototype']['googleTTS']=function(_0x2b459a,_0x10812d){scripts[_0x3dc0('0x5d')](_0x2b459a[_0x3dc0('0x57')],_0x2b459a['google_tts_language']||'en',0x1)[_0x3dc0('0x13')](function(_0x471bc5){_0x10812d(null,_0x471bc5);})[_0x3dc0('0x14')](function(_0x1931a9){_0x10812d(_0x1931a9);});};AGIVertices[_0x3dc0('0x10')]['restAPI']=function(_0x421a93,_0x3d20da){var _0x302dd2={'uri':_0x421a93['url'],'method':_0x421a93[_0x3dc0('0x5e')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x421a93[_0x3dc0('0x5f')])===_0x3dc0('0x60')&&parseInt(_0x421a93['timeout'])>=0x1?parseInt(_0x421a93[_0x3dc0('0x5f')])*0x3e8:0x5*0x3e8};if(_[_0x3dc0('0x61')]([_0x3dc0('0x62'),_0x3dc0('0x63')],_0x302dd2[_0x3dc0('0x5e')][_0x3dc0('0x64')]())){try{_0x302dd2['body']=_0x421a93['rawBody']?JSON[_0x3dc0('0x65')](_0x421a93['rawBody']):{};}catch(_0x198a0b){logger['error'](_0x3dc0('0x66'),_0x198a0b);}}try{_0x302dd2['headers']=_0x421a93['rawHeaders']?JSON[_0x3dc0('0x65')](_0x421a93[_0x3dc0('0xb')]):{};}catch(_0x2b6702){logger['error'](_0x3dc0('0x67'),_0x2b6702);}if(_0x421a93[_0x3dc0('0x68')]){try{var _0x5399a2=require(_0x421a93['computedVariables'])['sync'](this,_0x302dd2);_0x302dd2[_0x3dc0('0x69')]=Mustache[_0x3dc0('0x6a')](_0x421a93[_0x3dc0('0x6b')],_0x5399a2,{},['$$','$$']);if(_0x302dd2['headers']){_0x302dd2['headers']=JSON[_0x3dc0('0x65')](Mustache[_0x3dc0('0x6a')](JSON[_0x3dc0('0x6c')](_0x302dd2['headers']),_0x5399a2,{},['$$','$$']));}if(_0x302dd2['body']){_0x302dd2[_0x3dc0('0x6d')]=JSON['parse'](Mustache[_0x3dc0('0x6a')](JSON['stringify'](_0x302dd2[_0x3dc0('0x6d')]),_0x5399a2,{},['$$','$$']));}}catch(_0x122500){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x122500);}}rp(_0x302dd2)[_0x3dc0('0x13')](function(_0x40df84){var _0x1b69fd={'statusCode':_0x40df84[_0x3dc0('0x6e')]||0xc8,'statusMessage':_0x40df84[_0x3dc0('0x6f')]||'OK','headers':_0x40df84['headers']||{},'body':_0x40df84[_0x3dc0('0x6d')]||{}};_0x3d20da(null,_0x1b69fd);})[_0x3dc0('0x14')](function(_0x5063db){var _0xc2dcdc={'statusCode':_0x5063db['statusCode']||0x1f4,'statusMessage':_0x5063db[_0x3dc0('0x70')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x5063db[_0x3dc0('0x71')]['headers']||{},'body':_0x5063db[_0x3dc0('0x71')][_0x3dc0('0x6d')]||{}};_0x3d20da(null,_0xc2dcdc);});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x72')]=function(_0x37bab7,_0x965f4b){scripts[_0x3dc0('0x72')](this[_0x3dc0('0xd')][_0x3dc0('0x38')],_0x37bab7[_0x3dc0('0x73')],_0x37bab7['text'],_0x37bab7[_0x3dc0('0x74')]||'en')[_0x3dc0('0x13')](function(_0x36f8db){_0x965f4b(null,_0x36f8db);})[_0x3dc0('0x14')](function(_0x523c32){_0x965f4b(_0x523c32);});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x75')]=function(_0x2d7ccb,_0x243830){scripts['googleDialogflowV2'](this['channel']['uniqueid'],_0x2d7ccb[_0x3dc0('0x76')],_0x2d7ccb[_0x3dc0('0x77')],_0x2d7ccb[_0x3dc0('0x78')],_0x2d7ccb[_0x3dc0('0x57')],_0x2d7ccb[_0x3dc0('0x79')]||'en')['then'](function(_0x54ac62){_0x243830(null,_0x54ac62);})[_0x3dc0('0x14')](function(_0x4d1b5d){_0x243830(_0x4d1b5d);});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x7a')]=function(_0x198726,_0x3a0a9b){scripts[_0x3dc0('0x7a')](this[_0x3dc0('0xd')],_0x198726)[_0x3dc0('0x13')](function(_0x28fc87){_0x3a0a9b(null,_0x28fc87);})[_0x3dc0('0x14')](function(_0xcc894){_0x3a0a9b(_0xcc894);});};AGIVertices['prototype'][_0x3dc0('0x7b')]=function(_0x5a6f89,_0x4113e9){scripts['ispeechTTS'](_0x5a6f89[_0x3dc0('0x73')],_0x5a6f89[_0x3dc0('0x57')],_0x5a6f89['ispeech_tts_language']||_0x3dc0('0x59'),_0x5a6f89[_0x3dc0('0x7c')])['then'](function(_0x3f4200){_0x4113e9(null,_0x3f4200);})['catch'](function(_0x2c7b88){_0x4113e9(_0x2c7b88);});};AGIVertices['prototype'][_0x3dc0('0x7d')]=function(_0x107105,_0x2e0cb0,_0x4dc12a){scripts['ispeechASR'](_0x2e0cb0,_0x107105[_0x3dc0('0x73')],_0x107105[_0x3dc0('0x7e')]||_0x3dc0('0x59'),this[_0x3dc0('0x7f')](_0x107105[_0x3dc0('0x80')])?_0x107105[_0x3dc0('0x80')]:undefined)['then'](function(_0x3fc30f){_0x4dc12a(null,_0x3fc30f);})[_0x3dc0('0x14')](function(_0x5808e9){_0x4dc12a(_0x5808e9);});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x81')]=function(_0x443998,_0x175b8b){scripts[_0x3dc0('0x81')](_0x443998['aws_access_key_id'],_0x443998[_0x3dc0('0x82')],_0x443998[_0x3dc0('0x83')],_0x443998[_0x3dc0('0x84')]||_0x3dc0('0x85'),_0x443998['text'],_0x443998[_0x3dc0('0x86')]||'text')['then'](function(_0x4ff89d){_0x175b8b(null,_0x4ff89d);})['catch'](function(_0x4f4187){_0x175b8b(_0x4f4187);});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x87')]=function(_0x1fa41d,_0x72bf32){scripts[_0x3dc0('0x87')](this[_0x3dc0('0xd')][_0x3dc0('0x38')],_0x1fa41d[_0x3dc0('0x88')],_0x1fa41d[_0x3dc0('0x82')],_0x1fa41d[_0x3dc0('0x89')],_0x1fa41d[_0x3dc0('0x57')],_0x1fa41d[_0x3dc0('0x8a')])['then'](function(_0x11f23a){_0x72bf32(null,_0x11f23a);})['catch'](function(_0xde7f7d){_0x72bf32(_0xde7f7d);});};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x8b')]=function(_0x485a35,_0x291f2d,_0x35f52f){scripts['googleASR'](_0x291f2d,_0x485a35['key'],_0x485a35['google_asr_language']||'en-US')[_0x3dc0('0x13')](function(_0x5a4893){_0x35f52f(null,_0x5a4893);})[_0x3dc0('0x14')](function(_0xdfc108){_0x35f52f(_0xdfc108);});};AGIVertices['prototype'][_0x3dc0('0x8c')]=function(_0x942abf,_0x26ea1e,_0x336378){scripts['tildeASR'](_0x26ea1e,_0x942abf['appid'],_0x942abf[_0x3dc0('0x8d')],_0x942abf[_0x3dc0('0x69')])[_0x3dc0('0x13')](function(_0x3a5669){_0x336378(null,_0x3a5669);})[_0x3dc0('0x14')](function(_0x56512a){_0x336378(_0x56512a);});};AGIVertices[_0x3dc0('0x10')]['clear']=function(_0x51f76a){var _0x8681f6=_['includes'](verticesWithRetry,_0x51f76a[_0x3dc0('0x36')])?_0x51f76a:_[_0x3dc0('0x8e')](_0x51f76a);for(var _0xb2f68b in _0x8681f6){if(_0x8681f6[_0x3dc0('0x8f')](_0xb2f68b)){if(_0x8681f6[_0xb2f68b]&&_[_0x3dc0('0x90')](_0x8681f6[_0xb2f68b])){if(_[_0x3dc0('0x61')](recursiveMapAttributes,_0xb2f68b)){_0x8681f6[_0xb2f68b]=this[_0x3dc0('0x91')](_0x8681f6[_0xb2f68b]);}else{_0x8681f6[_0xb2f68b]=this[_0x3dc0('0x92')](_0x8681f6[_0xb2f68b]);}}}}return _0x8681f6;};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x93')]=function(_0x174bb3){for(var _0x107013 in _0x174bb3){if(_0x174bb3['hasOwnProperty'](_0x107013)){if(_[_0x3dc0('0x94')](_0x174bb3[_0x107013])){this[_0x3dc0('0x93')](_0x174bb3[_0x107013]);}else if(_[_0x3dc0('0x95')](_0x174bb3[_0x107013])){for(var _0xbdcacc=0x0;_0xbdcacc<_0x174bb3[_0x107013][_0x3dc0('0x96')];_0xbdcacc++){this[_0x3dc0('0x93')](_0x174bb3[_0x107013][_0xbdcacc]);}}else if(_[_0x3dc0('0x90')](_0x174bb3[_0x107013])){_0x174bb3[_0x107013]=this[_0x3dc0('0x92')](_0x174bb3[_0x107013]);}}}};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x97')]=function(_0x7383d1,_0x414389){for(var _0x516d36 in _0x7383d1){if(_0x7383d1['hasOwnProperty'](_0x516d36)){if(_[_0x3dc0('0x94')](_0x7383d1[_0x516d36])){if(!_[_0x3dc0('0x43')](_0x7383d1[_0x516d36])){this['saveRestApiResult'](_0x7383d1[_0x516d36],util['format']('%s.%s',_0x414389,_0x516d36));}}else if(_[_0x3dc0('0x95')](_0x7383d1[_0x516d36])){for(var _0x3ebf57=0x0;_0x3ebf57<_0x7383d1[_0x516d36][_0x3dc0('0x96')];_0x3ebf57++){this[_0x3dc0('0x97')](_0x7383d1[_0x516d36][_0x3ebf57],util[_0x3dc0('0x28')](_0x3dc0('0x98'),_0x414389,_0x516d36+'['+_0x3ebf57+']'));}}else{if(!_[_0x3dc0('0x44')](_0x7383d1[_0x516d36])){this[_0x3dc0('0xd')][_0x3dc0('0x99')](util[_0x3dc0('0x28')](_0x3dc0('0x98'),_0x414389,_0x516d36),_0x7383d1[_0x516d36]);}}}}};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x91')]=function(_0x4a224e){try{var _0x2556cb=JSON[_0x3dc0('0x65')](_0x4a224e);this[_0x3dc0('0x93')](_0x2556cb);return JSON['stringify'](_0x2556cb);}catch(_0xb5f426){return this[_0x3dc0('0x92')](_0x4a224e);}};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x92')]=function(_0x25be23){var _0x23130c=_0x25be23['split']('{');for(var _0x291d2a=0x1;_0x291d2a<_0x23130c['length'];_0x291d2a+=0x1){var _0x163eda=_0x23130c[_0x291d2a][_0x3dc0('0x9a')]('}');if(_0x163eda[_0x3dc0('0x96')]>0x1){_0x25be23=_0x25be23['replaceAll']('{'+_0x163eda[0x0]+'}',this[_0x3dc0('0xd')][_0x3dc0('0x11')](_0x163eda[0x0])[_0x3dc0('0x9b')]||_0x163eda[0x0]);}}if(_0x23130c[_0x3dc0('0x96')]===0x1){return _0x25be23[_0x3dc0('0x9c')]();}return this[_0x3dc0('0x92')](_0x25be23);};AGIVertices['prototype'][_0x3dc0('0x9d')]=function(_0x322c2b,_0x134ed6){var _0x422a2c=this[_0x3dc0('0xd')][_0x3dc0('0x11')](_0x322c2b);if(_0x422a2c[_0x3dc0('0x9e')]===-0x1){return _0x422a2c;}logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x9f'),_0x134ed6,_0x422a2c['extra']));return this[_0x3dc0('0xd')]['setVariable'](_0x134ed6,_0x422a2c[_0x3dc0('0x9b')]);};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x7f')]=function(_0x14f5b3){return _0x14f5b3&&_0x14f5b3!=='0'&&_0x14f5b3!=='-1'&&_0x14f5b3!=='';};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0xa0')]=function(_0x39f95b){this[_0x3dc0('0x34')]['sync'](this,_0x39f95b,'-');_0x39f95b['retry']=_0x39f95b['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0xa1')]=function(_0x32cfda){logger[_0x3dc0('0x2e')](util['format'](_0x3dc0('0xa2'),_0x32cfda[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x32cfda[_0x3dc0('0x57')])){return this[_0x3dc0('0xd')]['noop'](_0x3dc0('0xa3'));}var _0xac7e0b='\x22'+_0x32cfda['text']+'\x22';if(this[_0x3dc0('0x7f')](_0x32cfda[_0x3dc0('0x71')])){_0xac7e0b+=','+_0x32cfda[_0x3dc0('0x71')];}var _0x5e58be=this[_0x3dc0('0xd')][_0x3dc0('0xa4')](_0x3dc0('0xa5'),_0xac7e0b);if(_0x5e58be[_0x3dc0('0x9e')]===-0x1){return _0x5e58be;}return this[_0x3dc0('0xd')]['noop'](util[_0x3dc0('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0xac7e0b));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0xa6')]=function(_0x10e940){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0xa7'),_0x10e940[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x10e940['grammar'])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0xa9'));}var _0x2e1b0c=_0x10e940[_0x3dc0('0xaa')];if(this[_0x3dc0('0x7f')](_0x10e940['options'])){_0x2e1b0c+=','+_0x10e940[_0x3dc0('0x71')];}var _0x803915=this[_0x3dc0('0xd')][_0x3dc0('0xa4')](_0x3dc0('0xab'),_0x2e1b0c);if(_0x803915[_0x3dc0('0x9e')]===-0x1){return _0x803915;}var _0x2223fb=this[_0x3dc0('0x9d')]('RECOG_CONFIDENCE()',_0x3dc0('0xac'));if(_0x2223fb[_0x3dc0('0x9e')]===-0x1){return _0x2223fb;}var _0x2eb83c=this[_0x3dc0('0x9d')](_0x3dc0('0xad'),_0x3dc0('0xae'));if(_0x2eb83c[_0x3dc0('0x9e')]===-0x1){return _0x2eb83c;}var _0x2bff89=this[_0x3dc0('0x9d')](_0x3dc0('0xaf'),_0x3dc0('0xb0'));if(_0x2bff89[_0x3dc0('0x9e')]===-0x1){return _0x2bff89;}return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x2e1b0c));};AGIVertices[_0x3dc0('0x10')]['agi']=function(_0xac8976){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0xb1'),_0xac8976['label']));return this[_0x3dc0('0xd')]['agi']([_0xac8976['command'],_0xac8976['args']]);};AGIVertices['prototype'][_0x3dc0('0xb2')]=function(_0x565aad){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0xb3'),_0x565aad[_0x3dc0('0x35')]));if(this[_0x3dc0('0x7f')](_0x565aad[_0x3dc0('0x5f')])){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0xb4'),_0x565aad['timeout']));var _0xf849fd=this[_0x3dc0('0xd')][_0x3dc0('0xb5')](_0x565aad['timeout']);if(_0xf849fd[_0x3dc0('0x9e')]===-0x1){return _0xf849fd;}}return this[_0x3dc0('0xd')]['answer']();};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0xb6')]=function(_0x6171fa){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x6171fa['label']));if(!this[_0x3dc0('0x7f')](_0x6171fa[_0x3dc0('0x47')])){return this[_0x3dc0('0xd')]['error'](_0x6171fa,_0x3dc0('0xb7'));}_0x6171fa['scheduledAt']=moment();if(this[_0x3dc0('0x7f')](_0x6171fa[_0x3dc0('0xb8')])){_0x6171fa[_0x3dc0('0x49')]=moment()[_0x3dc0('0xb9')](_0x6171fa['delay'],'minutes');}if(!this[_0x3dc0('0x7f')](_0x6171fa[_0x3dc0('0x4a')])){_0x6171fa[_0x3dc0('0x4a')]=0x2;}this[_0x3dc0('0x42')]['sync'](this,_0x6171fa);return this[_0x3dc0('0xd')]['noop'](util[_0x3dc0('0x28')](_0x3dc0('0xba'),_0x6171fa[_0x3dc0('0x46')],_0x6171fa[_0x3dc0('0x47')],_0x6171fa[_0x3dc0('0x49')]));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0xbb')]=function(_0x53819e){logger[_0x3dc0('0x2e')](util['format'](_0x3dc0('0xbc'),_0x53819e[_0x3dc0('0x35')]));var _0xffe5d1=this[_0x3dc0('0xd')]['exec'](_0x53819e['application'],_0x53819e[_0x3dc0('0x71')]);if(_0xffe5d1[_0x3dc0('0x9e')]===-0x1){return _0xffe5d1;}return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util['format']('Executed\x20command\x20%s\x20%s',_0x53819e[_0x3dc0('0xbd')],_0x53819e[_0x3dc0('0x71')]));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0xbe')]=function(_0x5e3275){logger['info'](util[_0x3dc0('0x28')](_0x3dc0('0xbf'),_0x5e3275[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x5e3275['text'])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0xa3'));}var _0x1f8ac5='\x22'+_0x5e3275[_0x3dc0('0x57')]+'\x22';if(this[_0x3dc0('0x7f')](_0x5e3275[_0x3dc0('0x71')])){_0x1f8ac5+=','+_0x5e3275[_0x3dc0('0x71')];}var _0x366661=this[_0x3dc0('0xd')][_0x3dc0('0xa4')](_0x3dc0('0xa5'),_0x1f8ac5);if(_0x366661['result']===-0x1){return _0x366661;}return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0xc0'),_0x1f8ac5));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0xc1')]=function(_0xaa972e){logger[_0x3dc0('0x2e')](util['format'](_0x3dc0('0xc2'),_0xaa972e[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0xaa972e[_0x3dc0('0x57')])){return this['channel'][_0x3dc0('0xa8')]('no\x20text\x20configured');}var _0x455c4e='\x22'+_0xaa972e['text']+'\x22';if(this[_0x3dc0('0x7f')](_0xaa972e[_0x3dc0('0x71')])){_0x455c4e+=','+_0xaa972e[_0x3dc0('0x71')];}var _0x2c6cf7=this[_0x3dc0('0xd')]['exec'](_0x3dc0('0xa5'),_0x455c4e);if(_0x2c6cf7[_0x3dc0('0x9e')]===-0x1){return _0x2c6cf7;}return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x455c4e));};AGIVertices[_0x3dc0('0x10')]['lumenvoxasr']=function(_0x4e1017){logger['info'](util[_0x3dc0('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x4e1017[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x4e1017[_0x3dc0('0xaa')])){return this[_0x3dc0('0xd')]['noop'](_0x3dc0('0xa9'));}var _0x806f01=_0x4e1017['grammar'];if(this[_0x3dc0('0x7f')](_0x4e1017[_0x3dc0('0x71')])){_0x806f01+=','+_0x4e1017[_0x3dc0('0x71')];}var _0x2cd600=this['channel'][_0x3dc0('0xa4')](_0x3dc0('0xab'),_0x806f01);if(_0x2cd600[_0x3dc0('0x9e')]===-0x1){return _0x2cd600;}var _0x3a0290=this[_0x3dc0('0x9d')](_0x3dc0('0xc3'),_0x3dc0('0xc4'));if(_0x3a0290[_0x3dc0('0x9e')]===-0x1){return _0x3a0290;}var _0x4ca225=this[_0x3dc0('0x9d')]('RECOG_INPUT()',_0x3dc0('0xc5'));if(_0x4ca225[_0x3dc0('0x9e')]===-0x1){return _0x4ca225;}var _0x38ad3f=this[_0x3dc0('0x9d')]('RECOG_INSTANCE()',_0x3dc0('0xc6'));if(_0x38ad3f[_0x3dc0('0x9e')]===-0x1){return _0x38ad3f;}return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0xc7'),_0x806f01));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0xc8')]=function(_0x1abd4b){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0xc9'),_0x1abd4b[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x1abd4b['grammar'])){return this['channel'][_0x3dc0('0xa8')]('no\x20grammar\x20configured');}var _0x27eb61=_0x1abd4b[_0x3dc0('0xaa')];if(this['isConfigured'](_0x1abd4b[_0x3dc0('0x71')])){_0x27eb61+=','+_0x1abd4b['options'];}var _0x5715e2=this['channel'][_0x3dc0('0xa4')](_0x3dc0('0xab'),_0x27eb61);if(_0x5715e2[_0x3dc0('0x9e')]===-0x1){return _0x5715e2;}var _0x5ac7e7=this['getAndSetVariable'](_0x3dc0('0xc3'),_0x3dc0('0xca'));if(_0x5ac7e7[_0x3dc0('0x9e')]===-0x1){return _0x5ac7e7;}var _0x4d0d6f=this['getAndSetVariable'](_0x3dc0('0xad'),_0x3dc0('0xcb'));if(_0x4d0d6f[_0x3dc0('0x9e')]===-0x1){return _0x4d0d6f;}var _0x10f8f6=this[_0x3dc0('0x9d')](_0x3dc0('0xaf'),_0x3dc0('0xcc'));if(_0x10f8f6[_0x3dc0('0x9e')]===-0x1){return _0x10f8f6;}return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util['format'](_0x3dc0('0xc7'),_0x27eb61));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0xcd')]=function(_0x413026){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0xce'),_0x413026[_0x3dc0('0x35')]));if(!this['isConfigured'](_0x413026[_0x3dc0('0xcf')])){return this['channel'][_0x3dc0('0x30')](_0x413026,_0x3dc0('0xd0'));}var _0x48db5b=this['getSquareOdbc'][_0x3dc0('0xd1')](this,_0x413026[_0x3dc0('0xcf')]);if(!_0x48db5b){return this[_0x3dc0('0xd')]['error'](_0x413026,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x413026['query'])){return this[_0x3dc0('0xd')]['error'](_0x413026,_0x3dc0('0xd2'));}var _0xadee02=_0x413026[_0x3dc0('0x2d')][_0x3dc0('0xd3')](/(\r\n|\n|\r)/gm,'\x20');this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util['format'](_0x3dc0('0xd4'),_0xadee02));var _0x470afa=this[_0x3dc0('0x29')][_0x3dc0('0xd1')](this,_0x48db5b,_0xadee02);this[_0x3dc0('0x34')][_0x3dc0('0xd1')](this,_0x413026,_0xadee02);if(!this[_0x3dc0('0x7f')](_0x413026[_0x3dc0('0xd5')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0xd6'));}var _0x458d8a=this['getVariable'][_0x3dc0('0xd1')](this,_0x413026[_0x3dc0('0xd5')]);if(!_0x458d8a){return this['channel'][_0x3dc0('0x30')](_0x413026,_0x3dc0('0xd7'));}var _0x1d8401=this;_0x470afa[_0x3dc0('0xd8')](function(_0x229cea,_0xb8d9e5){Object[_0x3dc0('0xd9')](_0x229cea)[_0x3dc0('0xd8')](function(_0x1e9760){_0x1d8401['channel'][_0x3dc0('0x99')](util[_0x3dc0('0x28')]('%s[%s][%s]',_0x458d8a,_0xb8d9e5,_0x1e9760),_0x229cea[_0x1e9760]);});});this[_0x3dc0('0xd')][_0x3dc0('0x99')](util[_0x3dc0('0x28')](_0x3dc0('0xda'),_0x458d8a),_0x470afa['length']);return this['channel']['noop'](util[_0x3dc0('0x28')]('variable\x20%s\x20set',_0x458d8a));};AGIVertices[_0x3dc0('0x10')]['dial']=function(_0x45e3f1){logger[_0x3dc0('0xdb')](util['format'](_0x3dc0('0xdc'),_0x45e3f1[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x45e3f1[_0x3dc0('0xdd')])){return this['channel'][_0x3dc0('0x30')](_0x45e3f1,_0x3dc0('0xde'));}var _0x5d836e=this[_0x3dc0('0x1c')][_0x3dc0('0xd1')](this,_0x45e3f1[_0x3dc0('0xdd')]);if(!_0x5d836e){return this[_0x3dc0('0xd')]['error'](_0x45e3f1,_0x3dc0('0xdf'));}var _0x301f65=this[_0x3dc0('0xd')][_0x3dc0('0xa4')](_0x3dc0('0xe0'),[util[_0x3dc0('0x28')](_0x3dc0('0xe1'),_0x5d836e),_0x45e3f1[_0x3dc0('0x5f')],_0x45e3f1[_0x3dc0('0xe2')],_0x45e3f1[_0x3dc0('0x6b')]]);if(_0x301f65[_0x3dc0('0x9e')]===-0x1){return _0x301f65;}return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0xe3'),_0x3dc0('0xe0')));};AGIVertices[_0x3dc0('0x10')]['dialogflow']=function(_0x5f3da7){logger['info'](util[_0x3dc0('0x28')](_0x3dc0('0xe4'),_0x5f3da7[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x5f3da7[_0x3dc0('0x73')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0xe5'));}if(!this[_0x3dc0('0x7f')](_0x5f3da7[_0x3dc0('0x57')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')]('no\x20text\x20configured');}this['channel'][_0x3dc0('0xe6')]=!![];this[_0x3dc0('0x34')](_0x5f3da7);this[_0x3dc0('0x41')](_0x5f3da7[_0x3dc0('0x57')],'in','','');this['channel'][_0x3dc0('0xa8')](util['format'](_0x3dc0('0xe7'),_0x5f3da7[_0x3dc0('0x57')]));var _0x1e6ba7=this['googleDialogflow'][_0x3dc0('0xd1')](this,_0x5f3da7);if(_0x1e6ba7){for(var _0x7b6576 in _0x1e6ba7){if(_0x1e6ba7[_0x3dc0('0x8f')](_0x7b6576)){this['channel'][_0x3dc0('0x99')](util[_0x3dc0('0x28')](_0x3dc0('0xe8'),_0x7b6576['toUpperCase']()),_0x1e6ba7[_0x7b6576]);}}this[_0x3dc0('0x41')](_0x1e6ba7[_0x3dc0('0xe9')],_0x3dc0('0xea'),'dialogflow','');return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0xeb'),_0x1e6ba7[_0x3dc0('0xe9')]));}return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x5f3da7,_0x3dc0('0xec'));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0xed')]=function(_0x2e7f8a){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x2e7f8a[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x2e7f8a[_0x3dc0('0x76')])){return this[_0x3dc0('0xd')]['noop'](_0x3dc0('0xee'));}if(!this[_0x3dc0('0x7f')](_0x2e7f8a[_0x3dc0('0x77')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0xef'));}if(!this['isConfigured'](_0x2e7f8a[_0x3dc0('0x78')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0xf0'));}if(!this['isConfigured'](_0x2e7f8a[_0x3dc0('0x79')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')]('no\x20anguage\x20configured');}if(!this[_0x3dc0('0x7f')](_0x2e7f8a[_0x3dc0('0x57')])){return this[_0x3dc0('0xd')]['noop'](_0x3dc0('0xa3'));}this[_0x3dc0('0xd')][_0x3dc0('0xe6')]=!![];this['createSquareDetailsReport'](_0x2e7f8a);this[_0x3dc0('0x41')](_0x2e7f8a[_0x3dc0('0x57')],'in','','');this[_0x3dc0('0xd')]['noop'](util[_0x3dc0('0x28')](_0x3dc0('0xf1'),_0x2e7f8a[_0x3dc0('0x57')]));var _0x3d7b8b=this[_0x3dc0('0x75')][_0x3dc0('0xd1')](this,_0x2e7f8a);if(_0x3d7b8b){for(var _0x25a2fa in _0x3d7b8b){if(_0x3d7b8b[_0x3dc0('0x8f')](_0x25a2fa)){if(_0x25a2fa!=='providerResponse'){this[_0x3dc0('0xd')][_0x3dc0('0x99')](util[_0x3dc0('0x28')]('DIALOGFLOW_%s',_0x25a2fa[_0x3dc0('0x64')]()),_0x3d7b8b[_0x25a2fa]);}}}this[_0x3dc0('0x41')](_0x3d7b8b[_0x3dc0('0xe9')],_0x3dc0('0xea'),_0x3dc0('0xed'),_0x3d7b8b[_0x3dc0('0xf2')]);return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')]('DialogflowV2\x20Result\x20%s',_0x3d7b8b[_0x3dc0('0xe9')]));}return this[_0x3dc0('0xd')]['error'](_0x2e7f8a,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype'][_0x3dc0('0xf3')]=function(_0x863888){logger['info'](util[_0x3dc0('0x28')](_0x3dc0('0xf4'),_0x863888[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x863888[_0x3dc0('0xf5')])){return this[_0x3dc0('0xd')]['noop'](_0x3dc0('0xf6'));}if(!this[_0x3dc0('0x7f')](_0x863888[_0x3dc0('0xf7')])){return this['channel'][_0x3dc0('0xa8')]('no\x20username\x20configured');}if(!this[_0x3dc0('0x7f')](_0x863888[_0x3dc0('0xf8')])){return this[_0x3dc0('0xd')]['noop'](_0x3dc0('0xf9'));}if(!this[_0x3dc0('0x7f')](_0x863888['ndassistant_url'])){return this[_0x3dc0('0xd')]['noop'](_0x3dc0('0xa3'));}this[_0x3dc0('0xd')][_0x3dc0('0xe6')]=!![];this[_0x3dc0('0x34')](_0x863888);this[_0x3dc0('0x41')](_0x863888[_0x3dc0('0x57')],'in','','');this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0xfa'),_0x863888[_0x3dc0('0x57')]));var _0x392d81=this[_0x3dc0('0x7a')][_0x3dc0('0xd1')](this,_0x863888);if(_0x392d81){for(var _0x4f9247 in _0x392d81){if(_0x392d81[_0x3dc0('0x8f')](_0x4f9247)){this[_0x3dc0('0xd')]['setVariable'](util[_0x3dc0('0x28')]('SESTEK_NDA_%s',_0x4f9247['toUpperCase']()),_0x392d81[_0x4f9247]);}}this['createSquareMessage'](_0x392d81['speech'],_0x3dc0('0xea'),_0x3dc0('0xf3'),'');if(_0x392d81[_0x3dc0('0xfb')]){this['channel'][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0xfc'),_0x392d81[_0x3dc0('0xfb')]));var _0x40a75d=this['channel'][_0x3dc0('0xfd')](_0x392d81[_0x3dc0('0xfb')]);try{fs[_0x3dc0('0xfe')](_0x392d81[_0x3dc0('0xfb')]+_0x3dc0('0xff'));}catch(_0x1d72e3){logger[_0x3dc0('0x30')](_0x1d72e3);}return _0x40a75d;}else{return this[_0x3dc0('0xd')]['noop'](util[_0x3dc0('0x28')]('SestekNDA\x20Result\x20%s',_0x392d81[_0x3dc0('0xe9')]));}}return this['channel'][_0x3dc0('0x30')](_0x863888,_0x3dc0('0x100'));};AGIVertices[_0x3dc0('0x10')]['end']=function(_0x256ed5){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x101'),_0x256ed5['label']));return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0x102'));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x103')]=function(_0x1f8073){logger[_0x3dc0('0x2e')](util['format'](_0x3dc0('0x104'),_0x1f8073[_0x3dc0('0x35')]));var _0x4b1966='';if(_0x1f8073[_0x3dc0('0x105')]){if(!this['isConfigured'](_0x1f8073[_0x3dc0('0x105')])){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x1f8073,_0x3dc0('0x106'));}else{var _0x106ce5=parseInt(_0x1f8073[_0x3dc0('0x105')],0xa);if(isNaN(_0x106ce5)){_0x4b1966=_0x1f8073[_0x3dc0('0x105')];}else{_0x4b1966=this[_0x3dc0('0x107')][_0x3dc0('0xd1')](this,_0x1f8073['trunk_id']);if(!_0x4b1966){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x1f8073,_0x3dc0('0x108'));}}}}else if(_0x1f8073['trunk_name']){_0x4b1966=_0x1f8073[_0x3dc0('0x109')];}else{return this[_0x3dc0('0xd')]['error'](_0x1f8073,_0x3dc0('0x106'));}var _0x720898=this[_0x3dc0('0xd')][_0x3dc0('0xa4')](_0x3dc0('0xe0'),[util[_0x3dc0('0x28')](_0x3dc0('0x10a'),_0x4b1966,_0x1f8073[_0x3dc0('0x46')]),_0x1f8073[_0x3dc0('0x5f')],_0x1f8073[_0x3dc0('0xe2')],_0x1f8073[_0x3dc0('0x6b')]]);if(_0x720898[_0x3dc0('0x9e')]===-0x1){return _0x720898;}return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')]('Executed\x20command\x20%s',_0x3dc0('0xe0')));};AGIVertices['prototype'][_0x3dc0('0x10b')]=function(_0x24c6d3){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x10c'),_0x24c6d3[_0x3dc0('0x35')]));return this[_0x3dc0('0xd')]['noop'](_0x3dc0('0x10b'));};AGIVertices[_0x3dc0('0x10')]['getdigits']=function(_0x23ecf7){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x10d'),_0x23ecf7[_0x3dc0('0x35')]));if(_0x23ecf7['retry']===0x0){return this[_0x3dc0('0xa0')](_0x23ecf7);}_0x23ecf7[_0x3dc0('0x10e')]-=0x1;if(!this[_0x3dc0('0x7f')](_0x23ecf7[_0x3dc0('0x10f')])){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x23ecf7,'no\x20file\x20audio\x20selected');}var _0x4555f0=this[_0x3dc0('0x1e')][_0x3dc0('0xd1')](this,_0x23ecf7[_0x3dc0('0x10f')]);if(!_0x4555f0){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x23ecf7,_0x3dc0('0x110'));}if(!this[_0x3dc0('0x7f')](_0x23ecf7[_0x3dc0('0xd5')])){return this[_0x3dc0('0xd')][_0x3dc0('0x30')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x14b6ee=this[_0x3dc0('0xd')][_0x3dc0('0x111')](_0x4555f0,_0x23ecf7[_0x3dc0('0x112')],_0x23ecf7[_0x3dc0('0x113')]);var _0x12c3c4=_0x14b6ee['result']?_0x14b6ee[_0x3dc0('0x9e')]['toString']():'';logger['info'](_0x3dc0('0x114'),JSON[_0x3dc0('0x6c')](_0x14b6ee));if(_0x14b6ee[_0x3dc0('0x9e')]===-0x1){this[_0x3dc0('0x34')]['sync'](this,_0x23ecf7,_0x12c3c4);return _0x14b6ee;}else if(_0x14b6ee[_0x3dc0('0x9b')]===_0x3dc0('0x5f')){_0x14b6ee[_0x3dc0('0x9e')]=_0x12c3c4[_0x3dc0('0x96')]>=parseInt(_0x23ecf7['mindigit'])?'x':'i';}else{_0x14b6ee[_0x3dc0('0x9e')]=_0x12c3c4[_0x3dc0('0x96')]>=parseInt(_0x23ecf7['mindigit'])&&_0x12c3c4[_0x3dc0('0x96')]<=parseInt(_0x23ecf7[_0x3dc0('0x113')])?'x':'i';}var _0x3215b5=this[_0x3dc0('0x11')][_0x3dc0('0xd1')](this,_0x23ecf7[_0x3dc0('0xd5')]);if(!_0x3215b5){return this[_0x3dc0('0xd')]['error'](_0x23ecf7,'no\x20variable\x20found');}this['channel']['setVariable'](_0x3215b5,_0x12c3c4);if(this[_0x3dc0('0x7f')](_0x23ecf7[_0x3dc0('0x115')])){var _0x3b92db=parseInt(_0x23ecf7[_0x3dc0('0x115')],0xa);var _0x2ae535=rs[_0x3dc0('0x116')]({'charset':'*','length':_0x3b92db});var _0x552768=_0x12c3c4[_0x3dc0('0x96')];if(_0x552768>0x0){if(_0x552768>_0x3b92db){this[_0x3dc0('0x34')][_0x3dc0('0xd1')](this,_0x23ecf7,_0x23ecf7[_0x3dc0('0x117')]==='first'?_0x2ae535+_0x12c3c4[_0x3dc0('0x118')](_0x3b92db):_0x12c3c4[_0x3dc0('0x118')](0x0,_0x552768-_0x3b92db)+_0x2ae535);}else{this[_0x3dc0('0x34')][_0x3dc0('0xd1')](this,_0x23ecf7,rs[_0x3dc0('0x116')]({'charset':'*','length':_0x552768}));}}else{this[_0x3dc0('0x34')][_0x3dc0('0xd1')](this,_0x23ecf7,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x23ecf7,_0x12c3c4);}return _0x14b6ee;};AGIVertices[_0x3dc0('0x10')]['getsecretdigits']=function(_0x53b122){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x119'),_0x53b122['label']));return this[_0x3dc0('0x11a')](_0x53b122);};AGIVertices[_0x3dc0('0x10')]['goal']=function(_0x2e2344){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x11b'),_0x2e2344[_0x3dc0('0x35')]));this[_0x3dc0('0x34')][_0x3dc0('0xd1')](this,_0x2e2344,_0x2e2344[_0x3dc0('0x11c')]);return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0x11d'),_0x2e2344[_0x3dc0('0x11c')]));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x11e')]=function(_0x583803){logger['info'](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x583803['label']));if(!this['isConfigured'](_0x583803[_0x3dc0('0x88')])||!this['isConfigured'](_0x583803[_0x3dc0('0x82')])){return this['channel']['noop'](_0x3dc0('0x11f'));}if(!this[_0x3dc0('0x7f')](_0x583803[_0x3dc0('0x57')])){return this['channel'][_0x3dc0('0xa8')](_0x3dc0('0xa3'));}this[_0x3dc0('0xd')]['noop'](util['format'](_0x3dc0('0x120'),_0x583803[_0x3dc0('0x57')]));var _0x3178a2=this[_0x3dc0('0x81')][_0x3dc0('0xd1')](this,_0x583803);if(_0x3178a2){this[_0x3dc0('0xd')]['noop'](util[_0x3dc0('0x28')](_0x3dc0('0x121'),_0x3178a2));var _0xbf5e26=this[_0x3dc0('0xd')][_0x3dc0('0xfd')](_0x3178a2);try{fs['unlink'](_0x3178a2+_0x3dc0('0xff'));}catch(_0x38c7b3){logger[_0x3dc0('0x30')](_0x38c7b3);}return _0xbf5e26;}return this[_0x3dc0('0xd')]['error'](_0x583803,_0x3dc0('0x122'));};AGIVertices[_0x3dc0('0x10')]['awslex']=function(_0x5542c3){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5542c3[_0x3dc0('0x35')]));if(!this['isConfigured'](_0x5542c3[_0x3dc0('0x88')])||!this[_0x3dc0('0x7f')](_0x5542c3[_0x3dc0('0x82')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x3dc0('0x7f')](_0x5542c3[_0x3dc0('0x8a')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0x123'));}if(!this[_0x3dc0('0x7f')](_0x5542c3[_0x3dc0('0x57')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0xa3'));}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x5542c3);this[_0x3dc0('0x41')](_0x5542c3[_0x3dc0('0x57')],'in','','');this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util['format'](_0x3dc0('0x124'),_0x5542c3[_0x3dc0('0x57')]));var _0x3c9169=this[_0x3dc0('0x87')][_0x3dc0('0xd1')](this,_0x5542c3);if(_0x3c9169){for(var _0x45d36b in _0x3c9169){if(_0x3c9169[_0x3dc0('0x8f')](_0x45d36b)&&_[_0x3dc0('0x90')](_0x3c9169[_0x45d36b])){this[_0x3dc0('0xd')][_0x3dc0('0x99')](util[_0x3dc0('0x28')]('AWS_LEX_%s',_0x45d36b[_0x3dc0('0x64')]()),_0x3c9169[_0x45d36b]);}}if(_[_0x3dc0('0x44')](_0x3c9169[_0x3dc0('0x70')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0x125'));}else{this[_0x3dc0('0x41')](_0x3c9169['message'],_0x3dc0('0xea'),_0x3dc0('0x126'),'');return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')]('Amazon\x20Lex\x20Result\x20%s',_0x3c9169['message']));}}return this[_0x3dc0('0xd')]['error'](_0x5542c3,_0x3dc0('0x127'));};AGIVertices['prototype'][_0x3dc0('0x128')]=function(_0x2a0401){logger['info'](util['format'](_0x3dc0('0x129'),_0x2a0401['label'],_0x2a0401['timeout']));if(!this['isConfigured'](_0x2a0401[_0x3dc0('0x73')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0xe5'));}var _0xd22e5c=_0x3dc0('0x12a');var _0x4143f6=util['format'](_0x3dc0('0x12b'),FILES_PATH,rs['generate'](0x4));var _0x25b97d=util[_0x3dc0('0x28')]('%s.%s',_0x4143f6,_0xd22e5c);var _0x2361ed=!![];if(_0x2a0401[_0x3dc0('0x12c')]===_0x3dc0('0x12d')){_0x2361ed=![];}var _0x38bbf8=this[_0x3dc0('0xd')][_0x3dc0('0x12e')](_0x4143f6,_0xd22e5c,_0x2a0401[_0x3dc0('0x12f')],_0x2a0401[_0x3dc0('0x5f')],undefined,_0x2361ed);if(_0x38bbf8[_0x3dc0('0x9e')]!==-0x1){this['channel'][_0x3dc0('0xa8')](util['format']('google\x20%s\x20file\x20created',_0x25b97d));var _0x5cf278=this[_0x3dc0('0x8b')]['sync'](this,_0x2a0401,_0x25b97d);if(_0x5cf278){for(var _0x5c28e8 in _0x5cf278){if(_0x5cf278[_0x3dc0('0x8f')](_0x5c28e8)){this[_0x3dc0('0xd')]['setVariable'](util[_0x3dc0('0x28')](_0x3dc0('0x130'),_0x5c28e8[_0x3dc0('0x64')]()),_0x5cf278[_0x5c28e8]);}}return this['channel'][_0x3dc0('0xa8')](util[_0x3dc0('0x28')]('GoogleASR\x20Result\x20%s',JSON[_0x3dc0('0x6c')](_0x5cf278)));}}return _0x38bbf8;};AGIVertices['prototype'][_0x3dc0('0x131')]=function(_0x4f3188){logger[_0x3dc0('0x2e')](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4f3188[_0x3dc0('0x35')]));if(!this['isConfigured'](_0x4f3188[_0x3dc0('0x132')])){return this['channel'][_0x3dc0('0xa8')](_0x3dc0('0x133'));}if(!this[_0x3dc0('0x7f')](_0x4f3188[_0x3dc0('0x8d')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0x134'));}var _0x11d3cb=_0x3dc0('0x12a');var _0x47ff8f=util[_0x3dc0('0x28')](_0x3dc0('0x12b'),FILES_PATH,rs[_0x3dc0('0x116')](0x4));var _0x20b015=util['format'](_0x3dc0('0x98'),_0x47ff8f,_0x11d3cb);var _0x5c5659=!![];if(_0x4f3188[_0x3dc0('0x12c')]===_0x3dc0('0x12d')){_0x5c5659=![];}var _0x14d3cb=this['channel']['recordFile'](_0x47ff8f,_0x11d3cb,_0x4f3188[_0x3dc0('0x12f')],_0x4f3188[_0x3dc0('0x5f')],undefined,_0x5c5659);if(_0x14d3cb['result']!==-0x1){this[_0x3dc0('0xd')]['noop'](util[_0x3dc0('0x28')](_0x3dc0('0x135'),_0x20b015));var _0x1985ae=this[_0x3dc0('0x8c')][_0x3dc0('0xd1')](this,_0x4f3188,_0x20b015);if(_0x1985ae){for(var _0x566308 in _0x1985ae){if(_0x1985ae[_0x3dc0('0x8f')](_0x566308)){this[_0x3dc0('0xd')][_0x3dc0('0x99')](util[_0x3dc0('0x28')]('TILDE_ASR_%s',_0x566308[_0x3dc0('0x64')]()),_0x1985ae[_0x566308]);}}return this[_0x3dc0('0xd')]['noop'](util['format']('TildeASR\x20Result\x20%s',JSON[_0x3dc0('0x6c')](_0x1985ae)));}}return _0x14d3cb;};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x136')]=function(_0x24b4cf){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x137'),_0x24b4cf[_0x3dc0('0x35')]));return this[_0x3dc0('0xd')][_0x3dc0('0x138')](_0x24b4cf[_0x3dc0('0x3a')],_0x24b4cf[_0x3dc0('0x3b')],_0x24b4cf[_0x3dc0('0x3c')]);};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x139')]=function(_0x34e4ad){logger['info'](util['format'](_0x3dc0('0x13a'),_0x34e4ad[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x34e4ad[_0x3dc0('0x13b')])){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x34e4ad,_0x3dc0('0x13c'));}try{var _0x589189=eval(_0x34e4ad[_0x3dc0('0x13b')])?'true':_0x3dc0('0x13d');this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')]('EVAL\x20CONDITION\x20%s\x20%s',_0x34e4ad['condition'],_0x589189));return{'code':0xc8,'result':_0x589189};}catch(_0x3a5dd8){return{'code':0xc8,'result':_0x3dc0('0x13d')};}};AGIVertices[_0x3dc0('0x10')]['gotoiftime']=function(_0x43de98){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x13e'),_0x43de98['label']));if(!this[_0x3dc0('0x7f')](_0x43de98[_0x3dc0('0x13f')])){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x43de98,_0x3dc0('0x140'));}var _0x15478d=this[_0x3dc0('0x24')][_0x3dc0('0xd1')](this,_0x43de98['interval_id']);if(!_0x15478d){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x43de98,_0x3dc0('0x141'));}for(var _0x52c182=0x0;_0x52c182<_0x15478d[_0x3dc0('0x96')];_0x52c182+=0x1){var _0x297288=this[_0x3dc0('0xd')]['getVariable'](util[_0x3dc0('0x28')](_0x3dc0('0x142'),_0x15478d[_0x52c182]));if(_0x297288[_0x3dc0('0x9e')]===-0x1){return _0x297288;}logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x143'),_0x15478d[_0x52c182],_0x297288[_0x3dc0('0x9b')]));if(_0x297288[_0x3dc0('0x9b')]===_0x3dc0('0x144')){logger[_0x3dc0('0x2e')](util['format'](_0x3dc0('0x143'),_0x15478d[_0x52c182],_0x3dc0('0x144')));this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util['format'](_0x3dc0('0x143'),_0x15478d[_0x52c182],_0x3dc0('0x144')));return{'code':0xc8,'result':_0x3dc0('0x144')};}else{logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x15478d[_0x52c182],_0x3dc0('0x13d')));this['channel'][_0x3dc0('0xa8')](util['format'](_0x3dc0('0x143'),_0x15478d[_0x52c182],_0x3dc0('0x13d')));}}return{'code':0xc8,'result':_0x3dc0('0x13d')};};AGIVertices[_0x3dc0('0x10')]['hangup']=function(_0x4d4e9a){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x145'),_0x4d4e9a[_0x3dc0('0x35')]));return this[_0x3dc0('0xd')]['hangup']();};AGIVertices['prototype']['ispeechasr']=function(_0x46ab63){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x146'),_0x46ab63['label']));if(!this[_0x3dc0('0x7f')](_0x46ab63[_0x3dc0('0x73')])){return this[_0x3dc0('0xd')]['noop'](_0x3dc0('0xe5'));}var _0x4767b1='wav';var _0x4d316d=util[_0x3dc0('0x28')](_0x3dc0('0x12b'),FILES_PATH,rs[_0x3dc0('0x116')](0x4));var _0x1e006a=util[_0x3dc0('0x28')](_0x3dc0('0x98'),_0x4d316d,_0x4767b1);var _0x222d28=!![];if(_0x46ab63[_0x3dc0('0x12c')]===_0x3dc0('0x12d')){_0x222d28=![];}var _0x3e1cd6=this['channel'][_0x3dc0('0x12e')](_0x4d316d,_0x4767b1,_0x46ab63[_0x3dc0('0x12f')],_0x46ab63[_0x3dc0('0x5f')],undefined,_0x222d28);if(_0x3e1cd6[_0x3dc0('0x9e')]!==-0x1){this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0x147'),_0x1e006a));var _0x43024c=this[_0x3dc0('0x7d')][_0x3dc0('0xd1')](this,_0x46ab63,_0x1e006a);if(_0x43024c){for(var _0x533a35 in _0x43024c){if(_0x43024c['hasOwnProperty'](_0x533a35)){this[_0x3dc0('0xd')][_0x3dc0('0x99')](util[_0x3dc0('0x28')](_0x3dc0('0x148'),_0x533a35[_0x3dc0('0x64')]()),_0x43024c[_0x533a35]);}}return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0x149'),JSON['stringify'](_0x43024c)));}}return _0x3e1cd6;};AGIVertices['prototype']['ispeechtts']=function(_0x38b8b6){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x14a'),_0x38b8b6[_0x3dc0('0x35')]));if(!this['isConfigured'](_0x38b8b6['key'])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0xe5'));}if(!this[_0x3dc0('0x7f')](_0x38b8b6['text'])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')]('no\x20text\x20configured');}this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0x14b'),_0x38b8b6[_0x3dc0('0x57')]));var _0x426faa=this[_0x3dc0('0x7b')][_0x3dc0('0xd1')](this,_0x38b8b6);if(_0x426faa){this[_0x3dc0('0xd')]['noop'](util[_0x3dc0('0x28')](_0x3dc0('0x147'),_0x426faa));var _0x45eaa0=this['channel'][_0x3dc0('0xfd')](_0x426faa,_0x38b8b6['intKey']);try{fs[_0x3dc0('0xfe')](_0x426faa+'.wav');}catch(_0x49c838){logger[_0x3dc0('0x30')](_0x49c838);}return _0x45eaa0;}return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x38b8b6,_0x3dc0('0x14c'));};AGIVertices['prototype']['login']=function(_0x1f9434){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x14d'),_0x1f9434['label']));if(!this['isConfigured'](_0x1f9434[_0x3dc0('0x14e')])){return this['channel'][_0x3dc0('0x30')](_0x1f9434,_0x3dc0('0x14f'));}logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3dc0('0xd')][_0x3dc0('0x37')],_0x1f9434[_0x3dc0('0x14e')]));var _0x5e2b47=this['agentLogin'][_0x3dc0('0xd1')](this,_0x1f9434[_0x3dc0('0x14e')]);if(_0x5e2b47){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3dc0('0xd')][_0x3dc0('0x37')],_0x1f9434[_0x3dc0('0x14e')]));this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util['format'](_0x3dc0('0x150'),this[_0x3dc0('0xd')][_0x3dc0('0x37')],_0x1f9434[_0x3dc0('0x14e')]));return{'code':0xc8,'result':_0x3dc0('0x151')};}else{logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3dc0('0xd')]['callerid'],_0x1f9434[_0x3dc0('0x14e')]));this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0x152'),this[_0x3dc0('0xd')][_0x3dc0('0x37')],_0x1f9434['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['logout']=function(_0x4c37bf){logger[_0x3dc0('0x2e')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x4c37bf[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x4c37bf[_0x3dc0('0x14e')])){return this[_0x3dc0('0xd')]['error'](_0x4c37bf,_0x3dc0('0x14f'));}logger['info'](util[_0x3dc0('0x28')](_0x3dc0('0x153'),this[_0x3dc0('0xd')][_0x3dc0('0x37')],_0x4c37bf[_0x3dc0('0x14e')]));var _0x382a68=this[_0x3dc0('0x4f')][_0x3dc0('0xd1')](this,_0x4c37bf[_0x3dc0('0x14e')]);if(_0x382a68){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x150'),this['channel'][_0x3dc0('0x37')],_0x4c37bf[_0x3dc0('0x14e')]));this[_0x3dc0('0xd')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x3dc0('0x37')],_0x4c37bf[_0x3dc0('0x14e')]));return{'code':0xc8,'result':_0x3dc0('0x151')};}else{logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x152'),this[_0x3dc0('0xd')][_0x3dc0('0x37')],_0x4c37bf[_0x3dc0('0x14e')]));this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0x152'),this[_0x3dc0('0xd')][_0x3dc0('0x37')],_0x4c37bf[_0x3dc0('0x14e')]));return{'code':0xc8,'result':_0x3dc0('0x154')};}};AGIVertices[_0x3dc0('0x10')]['math']=function(_0x7bef56){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x155'),_0x7bef56[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x7bef56[_0x3dc0('0x156')])){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x7bef56,'no\x20operation\x20configured');}this[_0x3dc0('0xd')]['noop'](util[_0x3dc0('0x28')](_0x3dc0('0x157'),_0x7bef56[_0x3dc0('0x156')]));var _0x24a1ed=eval(_0x7bef56['operation']);if(!this[_0x3dc0('0x7f')](_0x7bef56[_0x3dc0('0xd5')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0xd6'));}var _0xa53149=this[_0x3dc0('0x11')][_0x3dc0('0xd1')](this,_0x7bef56[_0x3dc0('0xd5')]);if(!_0xa53149){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x7bef56,'no\x20variable\x20found');}if(_['isArray'](_0x24a1ed)){var _0x32fec1=this;_0x24a1ed[_0x3dc0('0xd8')](function(_0x53a9c0,_0x6d793e){_0x32fec1[_0x3dc0('0xd')][_0x3dc0('0x99')](util[_0x3dc0('0x28')](_0x3dc0('0x158'),_0xa53149,_0x6d793e),_0x53a9c0);});return this['channel'][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0x159'),_0xa53149));}else{return this[_0x3dc0('0xd')][_0x3dc0('0x99')](_0xa53149,_0x24a1ed);}};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0xc')]=function(_0x4fe3c3){logger['info'](util['format'](_0x3dc0('0x15a'),_0x4fe3c3[_0x3dc0('0x35')]));if(_0x4fe3c3['retry']===0x0){return this[_0x3dc0('0xa0')](_0x4fe3c3);}_0x4fe3c3[_0x3dc0('0x10e')]-=0x1;if(!this[_0x3dc0('0x7f')](_0x4fe3c3['file_id'])){return this[_0x3dc0('0xd')]['error'](_0x4fe3c3,'no\x20file\x20audio\x20selected');}var _0x2d4a47=this[_0x3dc0('0x1e')][_0x3dc0('0xd1')](this,_0x4fe3c3[_0x3dc0('0x10f')]);if(!_0x2d4a47){return this[_0x3dc0('0xd')]['error'](_0x4fe3c3,_0x3dc0('0x110'));}var _0x13b144=this[_0x3dc0('0xd')]['getData'](_0x2d4a47,_0x4fe3c3[_0x3dc0('0x112')],_0x4fe3c3['digit']);var _0x3cafce=_0x13b144[_0x3dc0('0x9e')];if(_0x13b144[_0x3dc0('0x9e')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x4fe3c3,'-1');return _0x13b144;}else if(_0x13b144['extra']===_0x3dc0('0x5f')){_0x13b144['result']=_0x13b144[_0x3dc0('0x9e')]['length']>0x0?_0x13b144['result']:'t';}else if(_[_0x3dc0('0x43')](_0x13b144['result'])){_0x13b144[_0x3dc0('0x9e')]='#';_0x3cafce='#';}if(!this[_0x3dc0('0x7f')](_0x4fe3c3['variable_id'])){this[_0x3dc0('0xd')][_0x3dc0('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x40ec4=this[_0x3dc0('0x11')]['sync'](this,_0x4fe3c3[_0x3dc0('0xd5')]);if(!_0x40ec4){return this[_0x3dc0('0xd')]['error'](_0x4fe3c3,_0x3dc0('0xd7'));}this[_0x3dc0('0xd')][_0x3dc0('0x99')](_0x40ec4,_0x3cafce);}this[_0x3dc0('0x34')][_0x3dc0('0xd1')](this,_0x4fe3c3,_0x3cafce);return _0x13b144;};AGIVertices[_0x3dc0('0x10')]['noop']=function(_0x2687a7){logger['info'](util[_0x3dc0('0x28')](_0x3dc0('0x15b'),_0x2687a7[_0x3dc0('0x35')]));return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x2687a7['output']||_0x2687a7[_0x3dc0('0x35')]);};AGIVertices['prototype']['pause']=function(_0x15fb8c){logger['info'](util[_0x3dc0('0x28')](_0x3dc0('0x15c'),_0x15fb8c[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x15fb8c['findBy'])){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x15fb8c,_0x3dc0('0x14f'));}logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x153'),this[_0x3dc0('0xd')]['callerid'],_0x15fb8c['findBy']));var _0x301493=this[_0x3dc0('0x15d')][_0x3dc0('0xd1')](this,_0x15fb8c[_0x3dc0('0x15e')]);var _0x5797f8=this[_0x3dc0('0x4c')][_0x3dc0('0xd1')](this,_0x15fb8c[_0x3dc0('0x14e')],_0x301493);if(_0x5797f8){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x15fb8c['findBy']));this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0x150'),this[_0x3dc0('0xd')][_0x3dc0('0x37')],_0x15fb8c[_0x3dc0('0x14e')]));return{'code':0xc8,'result':_0x3dc0('0x151')};}else{logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x152'),this[_0x3dc0('0xd')][_0x3dc0('0x37')],_0x15fb8c[_0x3dc0('0x14e')]));this['channel'][_0x3dc0('0xa8')](util[_0x3dc0('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3dc0('0xd')][_0x3dc0('0x37')],_0x15fb8c[_0x3dc0('0x14e')]));return{'code':0xc8,'result':_0x3dc0('0x154')};}};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x15f')]=function(_0x2b481f){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x2b481f['label']));if(!this['isConfigured'](_0x2b481f[_0x3dc0('0x10f')])){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x2b481f,_0x3dc0('0x160'));}var _0x305f90=this[_0x3dc0('0x1e')]['sync'](this,_0x2b481f[_0x3dc0('0x10f')]);if(!_0x305f90){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x2b481f,'no\x20file\x20audio\x20found');}var _0x1701aa=this['channel'][_0x3dc0('0xa4')](_0x3dc0('0x161'),[_0x305f90,_0x2b481f[_0x3dc0('0xe2')]]);if(_0x1701aa[_0x3dc0('0x9e')]===-0x1){return _0x1701aa;}return this['channel']['noop'](util[_0x3dc0('0x28')](_0x3dc0('0x162'),_0x3dc0('0x161'),_0x305f90));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x163')]=function(_0x5e4a59){logger[_0x3dc0('0x2e')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x5e4a59[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x5e4a59[_0x3dc0('0x164')])){return this[_0x3dc0('0xd')]['error'](_0x5e4a59,'no\x20queue\x20selected');}var _0x90753e='';var _0x59ae79=parseInt(_0x5e4a59['queue_id'],0xa);if(isNaN(_0x59ae79)){_0x90753e=_0x5e4a59['queue_id'];}else{_0x90753e=this['getVoiceQueue']['sync'](this,_0x5e4a59['queue_id']);if(!_0x90753e){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x5e4a59,_0x3dc0('0x165'));}}var _0x42670a='';if(this['isConfigured'](_0x5e4a59[_0x3dc0('0x10f')])){var _0x1e9844=this['getSound']['sync'](this,_0x5e4a59[_0x3dc0('0x10f')]);if(_0x1e9844){_0x42670a=_0x1e9844;}}this['createSquareDetailsReport'][_0x3dc0('0xd1')](this,_0x5e4a59,_0x90753e);if(_0x5e4a59[_0x3dc0('0xe2')][_0x3dc0('0x166')]('x')<0x0){_0x5e4a59[_0x3dc0('0xe2')]+='x';}if(_0x5e4a59[_0x3dc0('0xe2')][_0x3dc0('0x166')]('X')<0x0){_0x5e4a59['opts']+='X';}this['channel'][_0x3dc0('0x99')](_0x3dc0('0x167'),_0x90753e?_0x90753e[_0x3dc0('0x168')]():'');var _0x509462=this[_0x3dc0('0xd')][_0x3dc0('0xa4')](_0x3dc0('0x169'),[_0x90753e,_0x5e4a59[_0x3dc0('0xe2')],_0x5e4a59[_0x3dc0('0x6b')],_0x42670a,_0x5e4a59[_0x3dc0('0x5f')],_0x5e4a59['agi'],_0x5e4a59['macro'],_0x5e4a59[_0x3dc0('0x16a')],'',_0x5e4a59[_0x3dc0('0x16b')]]);if(_0x509462[_0x3dc0('0x9e')]===-0x1){return _0x509462;}return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0x162'),_0x3dc0('0x169'),_0x90753e));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x16c')]=function(_0x3b3540){logger['info'](util[_0x3dc0('0x28')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x3b3540['label']));var _0x4bdb6c=_0x3b3540['recordingFormat']||_0x3dc0('0x12a');var _0x369065=util['format']('%s_%s',this[_0x3dc0('0xd')][_0x3dc0('0x38')],rs[_0x3dc0('0x116')](0x5));var _0x294678=util[_0x3dc0('0x28')](_0x3dc0('0x16d'),FILES_PATH,_0x369065,_0x4bdb6c);var _0x3cd11e=util[_0x3dc0('0x28')](_0x3dc0('0x12b'),FILES_PATH,_0x369065);this[_0x3dc0('0x16e')]['sync'](this,_0x3b3540,_0x369065,_0x294678);this[_0x3dc0('0xd')][_0x3dc0('0x99')](_0x3dc0('0x16f'),_0x369065);logger['info'](_0x3dc0('0x170'),_0x3cd11e,_0x4bdb6c,_0x3b3540[_0x3dc0('0x171')],_0x3b3540[_0x3dc0('0x5f')]);return this['channel'][_0x3dc0('0x12e')](_0x3cd11e,_0x4bdb6c,_0x3b3540[_0x3dc0('0x171')],_0x3b3540[_0x3dc0('0x5f')],undefined,!![]);};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x172')]=function(_0x1d84c5){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x173'),_0x1d84c5[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x1d84c5[_0x3dc0('0x6b')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')]('no\x20url\x20configured');}var _0x4670ac=this['restAPI'][_0x3dc0('0xd1')](this,_0x1d84c5);logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')]('Response:',util[_0x3dc0('0x174')](_0x4670ac,{'showHidden':![],'depth':null})));if(!this[_0x3dc0('0x7f')](_0x1d84c5[_0x3dc0('0xd5')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0x175'));}var _0x287f11=this[_0x3dc0('0x11')][_0x3dc0('0xd1')](this,_0x1d84c5[_0x3dc0('0xd5')]);if(!_0x287f11){return this[_0x3dc0('0xd')]['error'](_0x1d84c5,_0x3dc0('0xd7'));}this[_0x3dc0('0xd')][_0x3dc0('0x99')](util[_0x3dc0('0x28')]('%s_STATUS_CODE',_0x287f11),_0x4670ac[_0x3dc0('0x6e')]?_0x4670ac[_0x3dc0('0x6e')]:_0x3dc0('0x176'));this[_0x3dc0('0xd')][_0x3dc0('0x99')](util[_0x3dc0('0x28')](_0x3dc0('0x177'),_0x287f11),_0x4670ac[_0x3dc0('0x6f')]?_0x4670ac['statusMessage']:'OK');if(_0x4670ac[_0x3dc0('0x6d')]){try{this[_0x3dc0('0x97')](_0x4670ac[_0x3dc0('0x6d')],_0x287f11);}catch(_0x5c273b){logger['error'](util['format'](_0x3dc0('0x178'),_0x287f11));}}return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0x179'),_0x287f11));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x17a')]=function(_0x4c117c){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x17b'),_0x4c117c[_0x3dc0('0x35')]));return this['channel'][_0x3dc0('0x17c')](_0x4c117c[_0x3dc0('0x17d')][_0x3dc0('0xd3')](/\s+/g,''),_0x4c117c[_0x3dc0('0x171')]);};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x17e')]=function(_0x581f98){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x17f'),_0x581f98[_0x3dc0('0x35')]));return this['channel'][_0x3dc0('0x180')](_0x581f98[_0x3dc0('0x60')]['replace'](/\s+/g,''),_0x581f98[_0x3dc0('0x171')]);};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x181')]=function(_0xc93a66){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0xc93a66[_0x3dc0('0x35')]));return this[_0x3dc0('0xd')][_0x3dc0('0x182')](_0xc93a66['text'],_0xc93a66[_0x3dc0('0x171')]);};AGIVertices['prototype'][_0x3dc0('0x183')]=function(_0x26ab97){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x184'),_0x26ab97['label']));if(!this[_0x3dc0('0x7f')](_0x26ab97['account_id'])){return this[_0x3dc0('0xd')]['noop']('no\x20mail\x20account\x20configured');}var _0x30e955=this[_0x3dc0('0x21')]['sync'](this,_0x26ab97['account_id']);if(!_0x30e955||!_0x30e955[_0x3dc0('0x185')]){return this['channel'][_0x3dc0('0x30')](_0x26ab97,'no\x20mail\x20account\x20found');}var _0x25f7d0={'from':util[_0x3dc0('0x28')]('\x22%s\x22\x20<%s>',_0x30e955[_0x3dc0('0x16')],_0x30e955[_0x3dc0('0x186')]||_0x30e955[_0x3dc0('0x185')]['user']),'to':_0x26ab97['to']||'','cc':_0x26ab97['cc']||'','bcc':_0x26ab97[_0x3dc0('0x187')]||'','subject':_0x26ab97[_0x3dc0('0x188')],'html':_0x26ab97['text'],'text':_0x26ab97[_0x3dc0('0x57')]};var _0x2cbcbf={'tls':{'rejectUnauthorized':![]}};if(_0x30e955['Smtp'][_0x3dc0('0x189')]){_0x2cbcbf['service']=_0x30e955[_0x3dc0('0x185')][_0x3dc0('0x189')];}else{_0x2cbcbf[_0x3dc0('0x18a')]=_0x30e955['Smtp'][_0x3dc0('0x18a')];_0x2cbcbf[_0x3dc0('0x18b')]=_0x30e955[_0x3dc0('0x185')][_0x3dc0('0x18b')];_0x2cbcbf['secure']=_0x30e955[_0x3dc0('0x185')][_0x3dc0('0x18c')];}if(_0x30e955[_0x3dc0('0x185')][_0x3dc0('0x18d')]){_0x2cbcbf['auth']={'user':_0x30e955[_0x3dc0('0x185')][_0x3dc0('0x18e')],'pass':_0x30e955[_0x3dc0('0x185')][_0x3dc0('0x18f')]};}if(this[_0x3dc0('0x7f')](_0x26ab97[_0x3dc0('0x190')])){}logger[_0x3dc0('0xdb')](_0x3dc0('0x191'),JSON['stringify'](_0x25f7d0));this[_0x3dc0('0x34')][_0x3dc0('0xd1')](this,_0x26ab97,_0x26ab97[_0x3dc0('0x192')]);this['channel'][_0x3dc0('0xa8')](util[_0x3dc0('0x28')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x30e955[_0x3dc0('0x16')]));this['sendMailMessage'][_0x3dc0('0xd1')](this,_0x2cbcbf,_0x25f7d0);return this[_0x3dc0('0xd')]['noop'](_0x3dc0('0x193'));};AGIVertices[_0x3dc0('0x10')]['sendFax']=function(_0xe51dc4){logger['info'](util[_0x3dc0('0x28')](_0x3dc0('0x194'),_0xe51dc4['label']));return this['channel'][_0x3dc0('0xa8')](_0x3dc0('0x195'));};AGIVertices['prototype'][_0x3dc0('0x196')]=function(_0x5f058a){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x197'),_0x5f058a[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x5f058a[_0x3dc0('0x198')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0x199'));}var _0x1074f7=this[_0x3dc0('0x19a')][_0x3dc0('0xd1')](this,_0x5f058a[_0x3dc0('0x198')]);if(!_0x1074f7){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x5f058a,_0x3dc0('0x19b'));}var _0x373818={'body':_0x5f058a[_0x3dc0('0x19c')],'phone':_0x5f058a['to']||'','SmsAccountId':_0x1074f7['id']};logger[_0x3dc0('0xdb')](_0x3dc0('0x19d'),JSON[_0x3dc0('0x6c')](_0x373818));this['createSquareDetailsReport'][_0x3dc0('0xd1')](this,_0x5f058a,_0x5f058a[_0x3dc0('0x198')]);this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x1074f7[_0x3dc0('0x16')]));this[_0x3dc0('0x33')][_0x3dc0('0xd1')](this,_0x373818);return this[_0x3dc0('0xd')][_0x3dc0('0xa8')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x3dc0('0x10')]['set']=function(_0x31a36b){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x31a36b['label']));if(!this[_0x3dc0('0x7f')](_0x31a36b[_0x3dc0('0xd5')])){return this[_0x3dc0('0xd')]['error'](_0x31a36b,_0x3dc0('0x19e'));}var _0x2a9f7d=this[_0x3dc0('0x11')][_0x3dc0('0xd1')](this,_0x31a36b[_0x3dc0('0xd5')]);if(!_0x2a9f7d){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x31a36b,_0x3dc0('0xd7'));}return this[_0x3dc0('0xd')][_0x3dc0('0x99')](_0x2a9f7d,_0x31a36b[_0x3dc0('0x19f')]);};AGIVertices['prototype'][_0x3dc0('0x1a0')]=function(_0x537625){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x1a1'),_0x537625[_0x3dc0('0x35')]));this[_0x3dc0('0xd')][_0x3dc0('0xa8')]('START\x20CALLY\x20SQUARE');if(_0x537625[_0x3dc0('0xb2')]==='yes'){this[_0x3dc0('0xd')][_0x3dc0('0xa8')]('Answer');return this[_0x3dc0('0xd')][_0x3dc0('0xb2')]();}return this['channel'][_0x3dc0('0xa8')](_0x3dc0('0x1a2'));};AGIVertices[_0x3dc0('0x10')]['subproject']=function(_0x560990){logger[_0x3dc0('0x2e')](util['format'](_0x3dc0('0x1a3'),_0x560990[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x560990[_0x3dc0('0x1a4')])){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x560990,_0x3dc0('0x1a5'));}var _0x1bae9f=this[_0x3dc0('0x17')]['sync'](this,_0x560990[_0x3dc0('0x1a4')]);if(!this['isConfigured'](_0x1bae9f)){return this[_0x3dc0('0xd')]['error'](_0x560990,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x560990[_0x3dc0('0x1a4')]));}if(_0x1bae9f===this['channel'][_0x3dc0('0x3f')]){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x560990,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x3dc0('0x34')][_0x3dc0('0xd1')](this,_0x560990,_0x1bae9f);var _0xd8b8b=this['channel'][_0x3dc0('0xa4')]('AGI',util[_0x3dc0('0x28')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x3dc0('0x8')]['host']||_0x3dc0('0x1a6'),_0x1bae9f,this[_0x3dc0('0xd')][_0x3dc0('0x3f')]));if(_0xd8b8b['result']===-0x1){return _0xd8b8b;}return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0x162'),_0x3dc0('0x1a7'),_0x1bae9f));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x1a8')]=function(_0x496a73){logger[_0x3dc0('0x2e')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x496a73['label']));var _0x176040=this[_0x3dc0('0x1a9')]['sync'](this,_0x496a73[_0x3dc0('0x1aa')]);this[_0x3dc0('0x34')][_0x3dc0('0xd1')](this,_0x496a73,_0x496a73['command']);if(this['isConfigured'](_0x496a73[_0x3dc0('0xd5')])){var _0x5e33b1=this[_0x3dc0('0x11')][_0x3dc0('0xd1')](this,_0x496a73[_0x3dc0('0xd5')]);if(_0x5e33b1){this['channel']['setVariable'](_0x5e33b1,_0x176040);return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0x1ab'),_0x496a73['command'],_0x5e33b1));}}return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util['format'](_0x3dc0('0x1ac'),_0x496a73['command']));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x1ad')]=function(_0x16855f){logger['info'](util[_0x3dc0('0x28')](_0x3dc0('0x1ae'),_0x16855f['label']));_0x16855f['text']=_0x16855f[_0x3dc0('0x57')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3dc0('0x7f')](_0x16855f[_0x3dc0('0x55')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')]('no\x20apiKey\x20configured');}if(!this[_0x3dc0('0x7f')](_0x16855f[_0x3dc0('0x57')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')](_0x3dc0('0xa3'));}this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')](_0x3dc0('0x1af'),_0x16855f[_0x3dc0('0x57')]));var _0x30db64=this['googleCloudTTS']['sync'](this,_0x16855f);if(_0x30db64){this[_0x3dc0('0xd')]['noop'](util['format'](_0x3dc0('0x1b0'),_0x30db64));var _0x56e896=this[_0x3dc0('0xd')]['streamFile'](_0x30db64);try{fs[_0x3dc0('0xfe')](_0x30db64+_0x3dc0('0xff'));}catch(_0x3a32dc){logger[_0x3dc0('0x30')](_0x3a32dc);}return _0x56e896;}return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x16855f,_0x3dc0('0x1b1'));};AGIVertices['prototype']['tts']=function(_0x11aad9){logger['info'](util['format'](_0x3dc0('0x1b2'),_0x11aad9['label']));_0x11aad9[_0x3dc0('0x57')]=_0x11aad9[_0x3dc0('0x57')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3dc0('0x7f')](_0x11aad9[_0x3dc0('0x57')])){return this[_0x3dc0('0xd')][_0x3dc0('0xa8')]('no\x20text\x20configured');}this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util[_0x3dc0('0x28')]('Trying\x20Google\x20TTS\x20%s',_0x11aad9[_0x3dc0('0x57')]));var _0x2c789a=this[_0x3dc0('0x5d')][_0x3dc0('0xd1')](this,_0x11aad9);if(_0x2c789a){this[_0x3dc0('0xd')]['noop'](util['format'](_0x3dc0('0x1b3'),_0x2c789a));var _0x161c5c=this[_0x3dc0('0xd')][_0x3dc0('0xfd')](_0x2c789a);try{fs['unlink'](_0x2c789a+_0x3dc0('0xff'));}catch(_0x378b96){logger[_0x3dc0('0x30')](_0x378b96);}return _0x161c5c;}return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x11aad9,_0x3dc0('0x1b4'));};AGIVertices['prototype'][_0x3dc0('0x1b5')]=function(_0x217cfc){logger[_0x3dc0('0x2e')](util['format'](_0x3dc0('0x1b6'),_0x217cfc[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x217cfc[_0x3dc0('0x14e')])){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x217cfc,'no\x20find\x20by\x20configured');}logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x153'),this['channel'][_0x3dc0('0x37')],_0x217cfc[_0x3dc0('0x14e')]));var _0x56c992=this[_0x3dc0('0x4e')]['sync'](this,_0x217cfc[_0x3dc0('0x14e')]);if(_0x56c992){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x150'),this['channel'][_0x3dc0('0x37')],_0x217cfc[_0x3dc0('0x14e')]));this[_0x3dc0('0xd')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x3dc0('0xd')][_0x3dc0('0x37')],_0x217cfc['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x3dc0('0x28')](_0x3dc0('0x152'),this['channel'][_0x3dc0('0x37')],_0x217cfc['findBy']));this[_0x3dc0('0xd')][_0x3dc0('0xa8')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x3dc0('0x37')],_0x217cfc['findBy']));return{'code':0xc8,'result':_0x3dc0('0x154')};}};AGIVertices['prototype'][_0x3dc0('0x1b7')]=function(_0xb4429a){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x1b8'),_0xb4429a[_0x3dc0('0x35')]));var _0x450b15=this[_0x3dc0('0xd')][_0x3dc0('0xa4')](_0x3dc0('0x1b9'),[_0xb4429a['mailbox'],_0xb4429a[_0x3dc0('0x71')]]);if(_0x450b15[_0x3dc0('0x9e')]===-0x1){return _0x450b15;}return this[_0x3dc0('0xd')]['noop'](util[_0x3dc0('0x28')]('Executed\x20command\x20%s\x20%s',_0x3dc0('0x1b9'),_0xb4429a[_0x3dc0('0x1ba')]));};AGIVertices[_0x3dc0('0x10')][_0x3dc0('0x1bb')]=function(_0x8fdfec){logger[_0x3dc0('0x2e')](util[_0x3dc0('0x28')](_0x3dc0('0x1bc'),_0x8fdfec[_0x3dc0('0x35')]));if(!this[_0x3dc0('0x7f')](_0x8fdfec[_0x3dc0('0xd5')])){return this[_0x3dc0('0xd')]['error'](_0x8fdfec,_0x3dc0('0x19e'));}var _0x55cea4=this['getVariable']['sync'](this,_0x8fdfec[_0x3dc0('0xd5')]);if(!_0x55cea4){return this[_0x3dc0('0xd')][_0x3dc0('0x30')](_0x8fdfec,_0x3dc0('0xd7'));}var _0x32e8e9=this[_0x3dc0('0xd')][_0x3dc0('0x11')](_0x55cea4);return{'code':0xc8,'result':_0x32e8e9['extra']?_0x32e8e9[_0x3dc0('0x9b')]:'-'};};String[_0x3dc0('0x10')]['replaceAll']=function(_0xcceaa7,_0x20d167){return this[_0x3dc0('0x9a')](_0xcceaa7)[_0x3dc0('0x1bd')](_0x20d167);};module[_0x3dc0('0x1be')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index f6b678f..3044767 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 _0x9957=['then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','message','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','queue','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','getAgent'];(function(_0x50691d,_0x2814b8){var _0x2ad821=function(_0x4fa9a8){while(--_0x4fa9a8){_0x50691d['push'](_0x50691d['shift']());}};_0x2ad821(++_0x2814b8);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var ami=require(_0x7995('0x3'));var logger=require('../../../config/logger')(_0x7995('0x4'));var RpcUser=require(_0x7995('0x5'));var RpcVoiceAgentReport=require(_0x7995('0x6'));function Acw(_0x462a03){this['voiceQueues']=_0x462a03[_0x7995('0x7')];this[_0x7995('0x8')]=_0x462a03[_0x7995('0x8')];this[_0x7995('0x9')]=_0x462a03[_0x7995('0x9')];this[_0x7995('0xa')]={};ami['on']('agentconnect',this[_0x7995('0xb')][_0x7995('0xc')](this));ami['on']('hanguprequest',this[_0x7995('0xd')][_0x7995('0xc')](this));ami['on'](_0x7995('0xe'),this[_0x7995('0xf')][_0x7995('0xc')](this));ami['on'](_0x7995('0x10'),this[_0x7995('0x11')]['bind'](this));ami['on'](_0x7995('0x12'),this[_0x7995('0x13')]['bind'](this));ami['on'](_0x7995('0x14'),this[_0x7995('0x15')][_0x7995('0xc')](this));ami['on'](_0x7995('0x16'),this[_0x7995('0x17')][_0x7995('0xc')](this));}function getDiff(_0x2bbe7a){var _0x4cc004=moment()['milliseconds'](0x0);var _0x2b4e94=moment(_0x2bbe7a)[_0x7995('0x18')](0x0);return _0x4cc004[_0x7995('0x19')](_0x2b4e94,_0x7995('0x1a'));}Acw[_0x7995('0x1b')][_0x7995('0x1c')]=function(_0x2202ce){try{var _0x41cbf0=this;var _0x5377e5=this[_0x7995('0xa')][_0x2202ce]['interface'];var _0x2f832e=this[_0x7995('0xa')][_0x2202ce][_0x7995('0x1d')];var _0x291317=this[_0x7995('0x7')][_0x2f832e];var _0x37a7d4=![];var _0x4faa60='ACW';if(_0x291317[_0x7995('0x1e')]){if(_0x291317['mandatoryDispositionPause']['name']){_0x37a7d4=!![];_0x4faa60=_0x291317[_0x7995('0x1f')][_0x7995('0x20')];}}ami['Action']({'action':_0x7995('0x21'),'interface':_0x5377e5,'paused':!![],'reason':_0x4faa60})['then'](function(_0x4b1a8e){if(_0x41cbf0[_0x7995('0x8')][_0x5377e5]){return RpcUser[_0x7995('0x22')](_0x41cbf0[_0x7995('0x8')][_0x5377e5]['id'])[_0x7995('0x23')](function(_0x460924){if(_0x460924&&!_0x460924[_0x7995('0x24')]){logger['info'](_0x7995('0x25'),_0x2202ce,_0x5377e5,_0x2f832e);var _0x46ee4b=_0x41cbf0[_0x7995('0xa')][_0x2202ce][_0x7995('0x26')]&&_0x41cbf0[_0x7995('0xa')][_0x2202ce][_0x7995('0x27')]?_0x41cbf0[_0x7995('0xa')][_0x2202ce][_0x7995('0x27')]:_0x2202ce;return RpcUser['savePause'](_0x41cbf0[_0x7995('0x8')][_0x5377e5],_0x4faa60,_0x46ee4b)[_0x7995('0x23')](function(_0x401dc3){if(!_0x37a7d4){_0x41cbf0[_0x7995('0x9')][_0x5377e5]={};logger[_0x7995('0x28')](_0x7995('0x29'),_0x2202ce,_0x41cbf0['voiceQueues'][_0x2f832e][_0x7995('0x2a')],_0x5377e5,_0x2f832e);_0x41cbf0['timers'][_0x5377e5][_0x7995('0x2b')]=setTimeout(_0x41cbf0[_0x7995('0x2c')][_0x7995('0xc')](_0x41cbf0,_0x5377e5),_0x41cbf0[_0x7995('0x7')][_0x2f832e][_0x7995('0x2a')]*0x3e8);_0x41cbf0['timers'][_0x5377e5][_0x7995('0x2d')]=moment()['format'](_0x7995('0x2e'));_0x41cbf0[_0x7995('0x9')][_0x5377e5][_0x7995('0x2f')]=_0x2202ce;_0x41cbf0['timers'][_0x5377e5]['queue']=_0x2f832e;_0x41cbf0['timers'][_0x5377e5][_0x7995('0x30')]=function(){var _0xe6b0b3=getDiff(_0x41cbf0[_0x7995('0x9')][_0x5377e5][_0x7995('0x2d')]);clearTimeout(_0x41cbf0[_0x7995('0x9')][_0x5377e5][_0x7995('0x2b')]);_0x41cbf0['timers'][_0x5377e5]['timer']=![];RpcVoiceAgentReport[_0x7995('0x31')]({'acwtime':_0xe6b0b3},_0x41cbf0['timers'][_0x5377e5][_0x7995('0x2f')],_0x5377e5)[_0x7995('0x23')](function(_0x29fac5){logger[_0x7995('0x28')](_0x7995('0x32'),_0x2202ce,_0xe6b0b3,_0x29fac5);})['catch'](function(_0x44309d){logger[_0x7995('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x2202ce,_0x44309d);});delete _0x41cbf0['timers'][_0x5377e5];};}});}else{logger['info'](_0x7995('0x34'),_0x2202ce,_0x5377e5,_0x2f832e);}});}})[_0x7995('0x35')](function(_0x4a176f){logger[_0x7995('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2202ce,_0x41cbf0[_0x7995('0x7')][_0x2f832e][_0x7995('0x2a')],_0x5377e5,_0x2f832e);})[_0x7995('0x36')](function(){delete _0x41cbf0['channels'][_0x2202ce];});}catch(_0x52d76d){logger[_0x7995('0x33')]('[ACW][START]\x20%s',_0x52d76d['message']);}};Acw[_0x7995('0x1b')][_0x7995('0x2c')]=function(_0x5212ff){try{var _0x1baa15=this;if(_0x1baa15[_0x7995('0x9')][_0x5212ff]){_0x1baa15[_0x7995('0x9')][_0x5212ff][_0x7995('0x2b')]=![];var _0x1e3dbf=_0x1baa15['timers'][_0x5212ff][_0x7995('0x2f')];var _0x242713=_0x1baa15[_0x7995('0x9')][_0x5212ff][_0x7995('0x1d')];var _0x4b1541=_0x1baa15[_0x7995('0x7')][_0x242713][_0x7995('0x2a')];logger[_0x7995('0x28')](_0x7995('0x37'),_0x1e3dbf,_0x5212ff);RpcUser[_0x7995('0x38')](this[_0x7995('0x8')][_0x5212ff]);RpcVoiceAgentReport['update']({'acwtime':_0x4b1541,'agentacw':!![]},_0x1e3dbf,_0x5212ff)[_0x7995('0x23')](function(_0x3be298){logger[_0x7995('0x28')](_0x7995('0x32'),_0x1e3dbf,_0x4b1541,_0x3be298);})[_0x7995('0x35')](function(_0x298fc2){logger[_0x7995('0x33')](_0x7995('0x39'),_0x1e3dbf,_0x298fc2);});}else{logger[_0x7995('0x33')](_0x7995('0x3a'),_0x5212ff);if(_0x1baa15[_0x7995('0x9')]){logger[_0x7995('0x28')](_0x7995('0x3b'),JSON['stringify'](_0x1baa15['timers']));}}}catch(_0x334dff){logger[_0x7995('0x33')]('[ACW][STOP]\x20%s',_0x334dff['message']);}};Acw[_0x7995('0x1b')]['syncAgentConnect']=function(_0x504a33){try{if(this[_0x7995('0x7')][_0x504a33[_0x7995('0x1d')]]&&(this[_0x7995('0x7')][_0x504a33['queue']][_0x7995('0x4')]||this['voiceQueues'][_0x504a33[_0x7995('0x1d')]]['mandatoryDisposition'])){if(this['agents'][_0x504a33[_0x7995('0x3c')]]){this[_0x7995('0xa')][_0x504a33[_0x7995('0x2f')]]={'queue':_0x504a33[_0x7995('0x1d')],'interface':_0x504a33['interface'],'destlinkedid':_0x504a33[_0x7995('0x27')]};}}}catch(_0x40fc68){logger[_0x7995('0x33')](_0x7995('0x3d'),_0x40fc68['message']);}};Acw['prototype'][_0x7995('0x17')]=function(_0x55791b){try{if(this[_0x7995('0x7')][_0x55791b['queue']]&&(this[_0x7995('0x7')][_0x55791b['queue']][_0x7995('0x4')]||this[_0x7995('0x7')][_0x55791b['queue']][_0x7995('0x1e')])){if(this[_0x7995('0x8')][_0x55791b[_0x7995('0x3c')]]){this[_0x7995('0xa')][_0x55791b['uniqueid']]={'queue':_0x55791b[_0x7995('0x1d')],'interface':_0x55791b[_0x7995('0x3c')]};}}}catch(_0x237270){logger['error'](_0x7995('0x3e'),_0x237270[_0x7995('0x3f')]);}};Acw[_0x7995('0x1b')][_0x7995('0xd')]=function(_0x255313){try{if(this['channels'][_0x255313[_0x7995('0x2f')]]&&_[_0x7995('0x40')](this['channels'][_0x255313[_0x7995('0x2f')]]['attended'])){logger[_0x7995('0x28')](_0x7995('0x41'),_0x255313[_0x7995('0x2f')]);this[_0x7995('0x1c')](_0x255313[_0x7995('0x2f')]);}else if(this[_0x7995('0xa')][_0x255313[_0x7995('0x42')]]&&_['isUndefined'](this[_0x7995('0xa')][_0x255313[_0x7995('0x42')]][_0x7995('0x26')])){logger['info'](_0x7995('0x43'),_0x255313[_0x7995('0x42')]);this[_0x7995('0x1c')](_0x255313['linkedid']);}}catch(_0x4ec548){logger['error'](_0x7995('0x44'),_0x4ec548[_0x7995('0x3f')]);}};Acw['prototype'][_0x7995('0xf')]=function(_0x29f300){try{if(this[_0x7995('0xa')][_0x29f300[_0x7995('0x2f')]]&&this[_0x7995('0xa')][_0x29f300['uniqueid']][_0x7995('0x26')]){logger['info'](_0x7995('0x45'),_0x29f300[_0x7995('0x2f')]);this[_0x7995('0x1c')](_0x29f300['uniqueid']);}else if(this['channels'][_0x29f300['linkedid']]&&this['channels'][_0x29f300[_0x7995('0x42')]][_0x7995('0x26')]){logger[_0x7995('0x28')](_0x7995('0x46'),_0x29f300[_0x7995('0x42')]);this[_0x7995('0x1c')](_0x29f300[_0x7995('0x42')]);}}catch(_0xda6ce8){logger[_0x7995('0x33')](_0x7995('0x47'),_0xda6ce8[_0x7995('0x3f')]);}};Acw[_0x7995('0x1b')][_0x7995('0x13')]=function(_0x35bea3){try{if(!_[_0x7995('0x48')](this[_0x7995('0xa')][_0x35bea3[_0x7995('0x49')]])){this[_0x7995('0x1c')](_0x35bea3[_0x7995('0x49')]);if(this['channels'][_0x35bea3[_0x7995('0x4a')]]){this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4a')]][_0x7995('0x26')]=!![];this['channels'][_0x35bea3['transfertargetuniqueid']]=this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4a')]];delete this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4a')]];}}else if(!_['isNil'](this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4b')]])){this[_0x7995('0x1c')](_0x35bea3[_0x7995('0x4b')]);if(this['channels'][_0x35bea3['origtransfereruniqueid']]){this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4c')]][_0x7995('0x26')]=!![];this[_0x7995('0xa')][_0x35bea3[_0x7995('0x49')]]=this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4c')]];delete this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4c')]];}}}catch(_0x50caf5){logger[_0x7995('0x33')](_0x7995('0x4d'),_0x50caf5[_0x7995('0x3f')]);}};Acw[_0x7995('0x1b')]['syncBlindTransfer']=function(_0x51bf6a){try{if(this[_0x7995('0xa')][_0x51bf6a[_0x7995('0x4e')]]){logger['info'](_0x7995('0x4f'),JSON[_0x7995('0x50')](_0x51bf6a[_0x7995('0x4e')]));this[_0x7995('0x1c')](_0x51bf6a[_0x7995('0x4e')]);}else if(this['channels'][_0x51bf6a[_0x7995('0x51')]]){logger['info'](_0x7995('0x52'),JSON[_0x7995('0x50')](_0x51bf6a[_0x7995('0x51')]));this[_0x7995('0x1c')](_0x51bf6a[_0x7995('0x51')]);}}catch(_0xeb8920){logger[_0x7995('0x33')](_0x7995('0x53'),_0xeb8920[_0x7995('0x3f')]);}};Acw[_0x7995('0x1b')][_0x7995('0x11')]=function(_0x234d8d){try{if(this['voiceQueues'][_0x234d8d[_0x7995('0x1d')]]&&this[_0x7995('0x7')][_0x234d8d[_0x7995('0x1d')]][_0x7995('0x54')]===_0x7995('0x55')){if(this['agents'][_0x234d8d['interface']]){logger[_0x7995('0x28')](_0x7995('0x56'),_0x234d8d[_0x7995('0x2f')],_0x234d8d[_0x7995('0x3c')],_0x234d8d['queue']);return RpcUser[_0x7995('0x57')](this['agents'][_0x234d8d['interface']],_0x7995('0x58'),_0x234d8d[_0x7995('0x2f')]);}}}catch(_0x3f0a71){logger[_0x7995('0x33')](_0x7995('0x59'),_0x3f0a71[_0x7995('0x3f')]);}};module[_0x7995('0x5a')]=Acw; \ No newline at end of file +var _0x9957=['then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','message','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','queue','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','getAgent'];(function(_0x54433e,_0x32e332){var _0x3011dd=function(_0x1c409d){while(--_0x1c409d){_0x54433e['push'](_0x54433e['shift']());}};_0x3011dd(++_0x32e332);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var ami=require(_0x7995('0x3'));var logger=require('../../../config/logger')(_0x7995('0x4'));var RpcUser=require(_0x7995('0x5'));var RpcVoiceAgentReport=require(_0x7995('0x6'));function Acw(_0x462a03){this['voiceQueues']=_0x462a03[_0x7995('0x7')];this[_0x7995('0x8')]=_0x462a03[_0x7995('0x8')];this[_0x7995('0x9')]=_0x462a03[_0x7995('0x9')];this[_0x7995('0xa')]={};ami['on']('agentconnect',this[_0x7995('0xb')][_0x7995('0xc')](this));ami['on']('hanguprequest',this[_0x7995('0xd')][_0x7995('0xc')](this));ami['on'](_0x7995('0xe'),this[_0x7995('0xf')][_0x7995('0xc')](this));ami['on'](_0x7995('0x10'),this[_0x7995('0x11')]['bind'](this));ami['on'](_0x7995('0x12'),this[_0x7995('0x13')]['bind'](this));ami['on'](_0x7995('0x14'),this[_0x7995('0x15')][_0x7995('0xc')](this));ami['on'](_0x7995('0x16'),this[_0x7995('0x17')][_0x7995('0xc')](this));}function getDiff(_0x2bbe7a){var _0x4cc004=moment()['milliseconds'](0x0);var _0x2b4e94=moment(_0x2bbe7a)[_0x7995('0x18')](0x0);return _0x4cc004[_0x7995('0x19')](_0x2b4e94,_0x7995('0x1a'));}Acw[_0x7995('0x1b')][_0x7995('0x1c')]=function(_0x2202ce){try{var _0x41cbf0=this;var _0x5377e5=this[_0x7995('0xa')][_0x2202ce]['interface'];var _0x2f832e=this[_0x7995('0xa')][_0x2202ce][_0x7995('0x1d')];var _0x291317=this[_0x7995('0x7')][_0x2f832e];var _0x37a7d4=![];var _0x4faa60='ACW';if(_0x291317[_0x7995('0x1e')]){if(_0x291317['mandatoryDispositionPause']['name']){_0x37a7d4=!![];_0x4faa60=_0x291317[_0x7995('0x1f')][_0x7995('0x20')];}}ami['Action']({'action':_0x7995('0x21'),'interface':_0x5377e5,'paused':!![],'reason':_0x4faa60})['then'](function(_0x4b1a8e){if(_0x41cbf0[_0x7995('0x8')][_0x5377e5]){return RpcUser[_0x7995('0x22')](_0x41cbf0[_0x7995('0x8')][_0x5377e5]['id'])[_0x7995('0x23')](function(_0x460924){if(_0x460924&&!_0x460924[_0x7995('0x24')]){logger['info'](_0x7995('0x25'),_0x2202ce,_0x5377e5,_0x2f832e);var _0x46ee4b=_0x41cbf0[_0x7995('0xa')][_0x2202ce][_0x7995('0x26')]&&_0x41cbf0[_0x7995('0xa')][_0x2202ce][_0x7995('0x27')]?_0x41cbf0[_0x7995('0xa')][_0x2202ce][_0x7995('0x27')]:_0x2202ce;return RpcUser['savePause'](_0x41cbf0[_0x7995('0x8')][_0x5377e5],_0x4faa60,_0x46ee4b)[_0x7995('0x23')](function(_0x401dc3){if(!_0x37a7d4){_0x41cbf0[_0x7995('0x9')][_0x5377e5]={};logger[_0x7995('0x28')](_0x7995('0x29'),_0x2202ce,_0x41cbf0['voiceQueues'][_0x2f832e][_0x7995('0x2a')],_0x5377e5,_0x2f832e);_0x41cbf0['timers'][_0x5377e5][_0x7995('0x2b')]=setTimeout(_0x41cbf0[_0x7995('0x2c')][_0x7995('0xc')](_0x41cbf0,_0x5377e5),_0x41cbf0[_0x7995('0x7')][_0x2f832e][_0x7995('0x2a')]*0x3e8);_0x41cbf0['timers'][_0x5377e5][_0x7995('0x2d')]=moment()['format'](_0x7995('0x2e'));_0x41cbf0[_0x7995('0x9')][_0x5377e5][_0x7995('0x2f')]=_0x2202ce;_0x41cbf0['timers'][_0x5377e5]['queue']=_0x2f832e;_0x41cbf0['timers'][_0x5377e5][_0x7995('0x30')]=function(){var _0xe6b0b3=getDiff(_0x41cbf0[_0x7995('0x9')][_0x5377e5][_0x7995('0x2d')]);clearTimeout(_0x41cbf0[_0x7995('0x9')][_0x5377e5][_0x7995('0x2b')]);_0x41cbf0['timers'][_0x5377e5]['timer']=![];RpcVoiceAgentReport[_0x7995('0x31')]({'acwtime':_0xe6b0b3},_0x41cbf0['timers'][_0x5377e5][_0x7995('0x2f')],_0x5377e5)[_0x7995('0x23')](function(_0x29fac5){logger[_0x7995('0x28')](_0x7995('0x32'),_0x2202ce,_0xe6b0b3,_0x29fac5);})['catch'](function(_0x44309d){logger[_0x7995('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x2202ce,_0x44309d);});delete _0x41cbf0['timers'][_0x5377e5];};}});}else{logger['info'](_0x7995('0x34'),_0x2202ce,_0x5377e5,_0x2f832e);}});}})[_0x7995('0x35')](function(_0x4a176f){logger[_0x7995('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2202ce,_0x41cbf0[_0x7995('0x7')][_0x2f832e][_0x7995('0x2a')],_0x5377e5,_0x2f832e);})[_0x7995('0x36')](function(){delete _0x41cbf0['channels'][_0x2202ce];});}catch(_0x52d76d){logger[_0x7995('0x33')]('[ACW][START]\x20%s',_0x52d76d['message']);}};Acw[_0x7995('0x1b')][_0x7995('0x2c')]=function(_0x5212ff){try{var _0x1baa15=this;if(_0x1baa15[_0x7995('0x9')][_0x5212ff]){_0x1baa15[_0x7995('0x9')][_0x5212ff][_0x7995('0x2b')]=![];var _0x1e3dbf=_0x1baa15['timers'][_0x5212ff][_0x7995('0x2f')];var _0x242713=_0x1baa15[_0x7995('0x9')][_0x5212ff][_0x7995('0x1d')];var _0x4b1541=_0x1baa15[_0x7995('0x7')][_0x242713][_0x7995('0x2a')];logger[_0x7995('0x28')](_0x7995('0x37'),_0x1e3dbf,_0x5212ff);RpcUser[_0x7995('0x38')](this[_0x7995('0x8')][_0x5212ff]);RpcVoiceAgentReport['update']({'acwtime':_0x4b1541,'agentacw':!![]},_0x1e3dbf,_0x5212ff)[_0x7995('0x23')](function(_0x3be298){logger[_0x7995('0x28')](_0x7995('0x32'),_0x1e3dbf,_0x4b1541,_0x3be298);})[_0x7995('0x35')](function(_0x298fc2){logger[_0x7995('0x33')](_0x7995('0x39'),_0x1e3dbf,_0x298fc2);});}else{logger[_0x7995('0x33')](_0x7995('0x3a'),_0x5212ff);if(_0x1baa15[_0x7995('0x9')]){logger[_0x7995('0x28')](_0x7995('0x3b'),JSON['stringify'](_0x1baa15['timers']));}}}catch(_0x334dff){logger[_0x7995('0x33')]('[ACW][STOP]\x20%s',_0x334dff['message']);}};Acw[_0x7995('0x1b')]['syncAgentConnect']=function(_0x504a33){try{if(this[_0x7995('0x7')][_0x504a33[_0x7995('0x1d')]]&&(this[_0x7995('0x7')][_0x504a33['queue']][_0x7995('0x4')]||this['voiceQueues'][_0x504a33[_0x7995('0x1d')]]['mandatoryDisposition'])){if(this['agents'][_0x504a33[_0x7995('0x3c')]]){this[_0x7995('0xa')][_0x504a33[_0x7995('0x2f')]]={'queue':_0x504a33[_0x7995('0x1d')],'interface':_0x504a33['interface'],'destlinkedid':_0x504a33[_0x7995('0x27')]};}}}catch(_0x40fc68){logger[_0x7995('0x33')](_0x7995('0x3d'),_0x40fc68['message']);}};Acw['prototype'][_0x7995('0x17')]=function(_0x55791b){try{if(this[_0x7995('0x7')][_0x55791b['queue']]&&(this[_0x7995('0x7')][_0x55791b['queue']][_0x7995('0x4')]||this[_0x7995('0x7')][_0x55791b['queue']][_0x7995('0x1e')])){if(this[_0x7995('0x8')][_0x55791b[_0x7995('0x3c')]]){this[_0x7995('0xa')][_0x55791b['uniqueid']]={'queue':_0x55791b[_0x7995('0x1d')],'interface':_0x55791b[_0x7995('0x3c')]};}}}catch(_0x237270){logger['error'](_0x7995('0x3e'),_0x237270[_0x7995('0x3f')]);}};Acw[_0x7995('0x1b')][_0x7995('0xd')]=function(_0x255313){try{if(this['channels'][_0x255313[_0x7995('0x2f')]]&&_[_0x7995('0x40')](this['channels'][_0x255313[_0x7995('0x2f')]]['attended'])){logger[_0x7995('0x28')](_0x7995('0x41'),_0x255313[_0x7995('0x2f')]);this[_0x7995('0x1c')](_0x255313[_0x7995('0x2f')]);}else if(this[_0x7995('0xa')][_0x255313[_0x7995('0x42')]]&&_['isUndefined'](this[_0x7995('0xa')][_0x255313[_0x7995('0x42')]][_0x7995('0x26')])){logger['info'](_0x7995('0x43'),_0x255313[_0x7995('0x42')]);this[_0x7995('0x1c')](_0x255313['linkedid']);}}catch(_0x4ec548){logger['error'](_0x7995('0x44'),_0x4ec548[_0x7995('0x3f')]);}};Acw['prototype'][_0x7995('0xf')]=function(_0x29f300){try{if(this[_0x7995('0xa')][_0x29f300[_0x7995('0x2f')]]&&this[_0x7995('0xa')][_0x29f300['uniqueid']][_0x7995('0x26')]){logger['info'](_0x7995('0x45'),_0x29f300[_0x7995('0x2f')]);this[_0x7995('0x1c')](_0x29f300['uniqueid']);}else if(this['channels'][_0x29f300['linkedid']]&&this['channels'][_0x29f300[_0x7995('0x42')]][_0x7995('0x26')]){logger[_0x7995('0x28')](_0x7995('0x46'),_0x29f300[_0x7995('0x42')]);this[_0x7995('0x1c')](_0x29f300[_0x7995('0x42')]);}}catch(_0xda6ce8){logger[_0x7995('0x33')](_0x7995('0x47'),_0xda6ce8[_0x7995('0x3f')]);}};Acw[_0x7995('0x1b')][_0x7995('0x13')]=function(_0x35bea3){try{if(!_[_0x7995('0x48')](this[_0x7995('0xa')][_0x35bea3[_0x7995('0x49')]])){this[_0x7995('0x1c')](_0x35bea3[_0x7995('0x49')]);if(this['channels'][_0x35bea3[_0x7995('0x4a')]]){this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4a')]][_0x7995('0x26')]=!![];this['channels'][_0x35bea3['transfertargetuniqueid']]=this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4a')]];delete this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4a')]];}}else if(!_['isNil'](this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4b')]])){this[_0x7995('0x1c')](_0x35bea3[_0x7995('0x4b')]);if(this['channels'][_0x35bea3['origtransfereruniqueid']]){this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4c')]][_0x7995('0x26')]=!![];this[_0x7995('0xa')][_0x35bea3[_0x7995('0x49')]]=this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4c')]];delete this[_0x7995('0xa')][_0x35bea3[_0x7995('0x4c')]];}}}catch(_0x50caf5){logger[_0x7995('0x33')](_0x7995('0x4d'),_0x50caf5[_0x7995('0x3f')]);}};Acw[_0x7995('0x1b')]['syncBlindTransfer']=function(_0x51bf6a){try{if(this[_0x7995('0xa')][_0x51bf6a[_0x7995('0x4e')]]){logger['info'](_0x7995('0x4f'),JSON[_0x7995('0x50')](_0x51bf6a[_0x7995('0x4e')]));this[_0x7995('0x1c')](_0x51bf6a[_0x7995('0x4e')]);}else if(this['channels'][_0x51bf6a[_0x7995('0x51')]]){logger['info'](_0x7995('0x52'),JSON[_0x7995('0x50')](_0x51bf6a[_0x7995('0x51')]));this[_0x7995('0x1c')](_0x51bf6a[_0x7995('0x51')]);}}catch(_0xeb8920){logger[_0x7995('0x33')](_0x7995('0x53'),_0xeb8920[_0x7995('0x3f')]);}};Acw[_0x7995('0x1b')][_0x7995('0x11')]=function(_0x234d8d){try{if(this['voiceQueues'][_0x234d8d[_0x7995('0x1d')]]&&this[_0x7995('0x7')][_0x234d8d[_0x7995('0x1d')]][_0x7995('0x54')]===_0x7995('0x55')){if(this['agents'][_0x234d8d['interface']]){logger[_0x7995('0x28')](_0x7995('0x56'),_0x234d8d[_0x7995('0x2f')],_0x234d8d[_0x7995('0x3c')],_0x234d8d['queue']);return RpcUser[_0x7995('0x57')](this['agents'][_0x234d8d['interface']],_0x7995('0x58'),_0x234d8d[_0x7995('0x2f')]);}}}catch(_0x3f0a71){logger[_0x7995('0x33')](_0x7995('0x59'),_0x3f0a71[_0x7995('0x3f')]);}};module[_0x7995('0x5a')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index f8a3a22..481a6fd 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 _0xbd4b=['log','exports','asterisk-manager','bluebird','moment','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','action','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','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','error','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch'];(function(_0x2017ed,_0x602e41){var _0x35e12f=function(_0x154365){while(--_0x154365){_0x2017ed['push'](_0x2017ed['shift']());}};_0x35e12f(++_0x602e41);}(_0xbd4b,0x113));var _0xbbd4=function(_0x132e03,_0x2bf39c){_0x132e03=_0x132e03-0x0;var _0x44f948=_0xbd4b[_0x132e03];return _0x44f948;};'use strict';var Manager=require(_0xbbd4('0x0'));var BPromise=require(_0xbbd4('0x1'));var moment=require(_0xbbd4('0x2'));var util=require('util');var _=require('lodash');var logger=require(_0xbbd4('0x3'))(_0xbbd4('0x4'));var config=require(_0xbbd4('0x5'));var ami=new Manager(config[_0xbbd4('0x6')][_0xbbd4('0x7')],config[_0xbbd4('0x6')]['ip'],config[_0xbbd4('0x6')][_0xbbd4('0x8')],config[_0xbbd4('0x6')][_0xbbd4('0x9')],!![]);ami['keepConnected']();ami[_0xbbd4('0xa')]=BPromise[_0xbbd4('0xb')](ami[_0xbbd4('0xc')]);function error(_0x415afa){logger['error'](util[_0xbbd4('0xd')](_0xbbd4('0xe'),config[_0xbbd4('0x6')][_0xbbd4('0x8')],config[_0xbbd4('0x6')]['ip'],config[_0xbbd4('0x6')][_0xbbd4('0x7')],util[_0xbbd4('0xf')](_0x415afa,![],null)));}function close(){logger['error'](util[_0xbbd4('0xd')](_0xbbd4('0x10'),config[_0xbbd4('0x6')][_0xbbd4('0x8')],config[_0xbbd4('0x6')]['ip'],config[_0xbbd4('0x6')][_0xbbd4('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xbbd4('0xa')]({'action':_0xbbd4('0x11')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xbbd4('0xa')]({'action':_0xbbd4('0x12')});};};ami[_0xbbd4('0x13')]=function(){return function(){return ami[_0xbbd4('0xa')]({'action':_0xbbd4('0x14')});};};ami[_0xbbd4('0x15')]=function(){return function(){return ami[_0xbbd4('0xa')]({'action':_0xbbd4('0x16')});};};ami[_0xbbd4('0x17')]=function(){return function(){return ami[_0xbbd4('0xa')]({'action':_0xbbd4('0x18')});};};function connect(_0x1bff64){logger[_0xbbd4('0x19')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xbbd4('0x6')][_0xbbd4('0x8')],config['asterisk']['ip'],config['asterisk'][_0xbbd4('0x7')]));ami[_0xbbd4('0x1a')](_0xbbd4('0x1b'),error);ami[_0xbbd4('0x1a')](_0xbbd4('0x1c'),close);}ami['on']('connect',connect);ami['on'](_0xbbd4('0x1d'),function(_0x374e92){logger[_0xbbd4('0x19')](util[_0xbbd4('0xd')](_0xbbd4('0x1e'),config['asterisk'][_0xbbd4('0x8')],config[_0xbbd4('0x6')]['ip'],config[_0xbbd4('0x6')]['port'],util['inspect'](_0x374e92,![],null)));});ami['on'](_0xbbd4('0x1f'),function(_0xa57e8f){logger['info'](util[_0xbbd4('0xd')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config['asterisk'][_0xbbd4('0x8')],config[_0xbbd4('0x6')]['ip'],config[_0xbbd4('0x6')]['port']));return BPromise[_0xbbd4('0x20')]()[_0xbbd4('0x21')](ami[_0xbbd4('0x22')]())[_0xbbd4('0x21')](ami[_0xbbd4('0x23')]())[_0xbbd4('0x21')](ami[_0xbbd4('0x13')]())[_0xbbd4('0x21')](ami['actionQueueSummary']())[_0xbbd4('0x21')](ami[_0xbbd4('0x17')]())[_0xbbd4('0x24')](function(_0x3ddee0){console[_0xbbd4('0x25')](_0x3ddee0);});});ami[_0xbbd4('0x1a')](_0xbbd4('0x1b'),error);ami['once']('close',close);module[_0xbbd4('0x26')]=ami; \ No newline at end of file +var _0xf89d=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch','log','once','exports','asterisk-manager','bluebird','util','lodash','../../config/logger','ami','asterisk','username','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0xf89d,0x11a));var _0xdf89=function(_0x5678b5,_0x567052){_0x5678b5=_0x5678b5-0x0;var _0xceb841=_0xf89d[_0x5678b5];return _0xceb841;};'use strict';var Manager=require(_0xdf89('0x0'));var BPromise=require(_0xdf89('0x1'));var moment=require('moment');var util=require(_0xdf89('0x2'));var _=require(_0xdf89('0x3'));var logger=require(_0xdf89('0x4'))(_0xdf89('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0xdf89('0x6')]['port'],config['asterisk']['ip'],config['asterisk'][_0xdf89('0x7')],config['asterisk'][_0xdf89('0x8')],!![]);ami['keepConnected']();ami[_0xdf89('0x9')]=BPromise[_0xdf89('0xa')](ami[_0xdf89('0xb')]);function error(_0x7db4fa){logger[_0xdf89('0xc')](util[_0xdf89('0xd')](_0xdf89('0xe'),config[_0xdf89('0x6')][_0xdf89('0x7')],config[_0xdf89('0x6')]['ip'],config[_0xdf89('0x6')][_0xdf89('0xf')],util[_0xdf89('0x10')](_0x7db4fa,![],null)));}function close(){logger[_0xdf89('0xc')](util[_0xdf89('0xd')](_0xdf89('0x11'),config[_0xdf89('0x6')]['username'],config[_0xdf89('0x6')]['ip'],config[_0xdf89('0x6')][_0xdf89('0xf')]));}ami[_0xdf89('0x12')]=function(){return function(){return ami[_0xdf89('0x9')]({'action':'sipshowregistry'});};};ami[_0xdf89('0x13')]=function(){return function(){return ami[_0xdf89('0x9')]({'action':'devicestatelist'});};};ami[_0xdf89('0x14')]=function(){return function(){return ami[_0xdf89('0x9')]({'action':_0xdf89('0x15')});};};ami[_0xdf89('0x16')]=function(){return function(){return ami[_0xdf89('0x9')]({'action':_0xdf89('0x17')});};};ami[_0xdf89('0x18')]=function(){return function(){return ami[_0xdf89('0x9')]({'action':_0xdf89('0x19')});};};function connect(_0x501c29){logger[_0xdf89('0x1a')](util[_0xdf89('0xd')](_0xdf89('0x1b'),config[_0xdf89('0x6')][_0xdf89('0x7')],config[_0xdf89('0x6')]['ip'],config[_0xdf89('0x6')]['port']));ami['once'](_0xdf89('0xc'),error);ami['once'](_0xdf89('0x1c'),close);}ami['on']('connect',connect);ami['on'](_0xdf89('0x1d'),function(_0x3892b8){logger[_0xdf89('0x1a')](util[_0xdf89('0xd')](_0xdf89('0x1e'),config[_0xdf89('0x6')]['username'],config[_0xdf89('0x6')]['ip'],config[_0xdf89('0x6')][_0xdf89('0xf')],util[_0xdf89('0x10')](_0x3892b8,![],null)));});ami['on'](_0xdf89('0x1f'),function(_0x2efd9e){logger[_0xdf89('0x1a')](util['format'](_0xdf89('0x20'),config[_0xdf89('0x6')]['username'],config[_0xdf89('0x6')]['ip'],config['asterisk'][_0xdf89('0xf')]));return BPromise['resolve']()[_0xdf89('0x21')](ami[_0xdf89('0x12')]())[_0xdf89('0x21')](ami['actionDeviceStateList']())[_0xdf89('0x21')](ami['actionSipPeerStatus']())['then'](ami[_0xdf89('0x16')]())[_0xdf89('0x21')](ami[_0xdf89('0x18')]())[_0xdf89('0x22')](function(_0x25a739){console[_0xdf89('0x23')](_0x25a739);});});ami['once'](_0xdf89('0xc'),error);ami[_0xdf89('0x24')]('close',close);module[_0xdf89('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 5d1359c..8778fb2 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 _0x6e05=['Request','debug','rpc','memberReport','error','message','result','catch','jayson/promise','../../config/logger','ami','client','http'];(function(_0x378bb8,_0x10a669){var _0x27fba5=function(_0x24bb6e){while(--_0x24bb6e){_0x378bb8['push'](_0x378bb8['shift']());}};_0x27fba5(++_0x10a669);}(_0x6e05,0xb1));var _0x56e0=function(_0x4dbdda,_0x11f07c){_0x4dbdda=_0x4dbdda-0x0;var _0x1acbf1=_0x6e05[_0x4dbdda];return _0x1acbf1;};'use strict';var jayson=require(_0x56e0('0x0'));var BPromise=require('bluebird');var logger=require(_0x56e0('0x1'))(_0x56e0('0x2'));var client=jayson[_0x56e0('0x3')][_0x56e0('0x4')]({'port':0x2329});client[_0x56e0('0x5')]=function(_0x3623c2,_0x3cb576){return new BPromise(function(_0x328bbd,_0x49ed3a){return client['request'](_0x3623c2,_0x3cb576)['then'](function(_0x1ed9bc){logger[_0x56e0('0x6')](_0x56e0('0x7'),_0x56e0('0x8'),_0x3623c2,_0x3cb576,_0x1ed9bc);if(_0x1ed9bc[_0x56e0('0x9')]){logger[_0x56e0('0x9')](_0x56e0('0x7'),_0x56e0('0x8'),_0x3623c2,_0x1ed9bc['error'][_0x56e0('0xa')],_0x3cb576);return _0x49ed3a(_0x1ed9bc[_0x56e0('0x9')][_0x56e0('0xa')]);}else{return _0x328bbd(_0x1ed9bc[_0x56e0('0xb')]);}})[_0x56e0('0xc')](function(_0x2d6f08){logger[_0x56e0('0x9')](_0x56e0('0x7'),_0x56e0('0x8'),_0x3623c2,_0x2d6f08,_0x3cb576);return _0x49ed3a(_0x2d6f08);});});};module['exports']=client; \ No newline at end of file +var _0xac5d=['client','then','debug','rpc','memberReport','error','message','exports','bluebird','../../config/logger'];(function(_0xd16c61,_0x2fa57e){var _0x2ef528=function(_0x3a967d){while(--_0x3a967d){_0xd16c61['push'](_0xd16c61['shift']());}};_0x2ef528(++_0x2fa57e);}(_0xac5d,0x1de));var _0xdac5=function(_0x41eccd,_0x2052f4){_0x41eccd=_0x41eccd-0x0;var _0x4ebf84=_0xac5d[_0x41eccd];return _0x4ebf84;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xdac5('0x0'));var logger=require(_0xdac5('0x1'))('ami');var client=jayson[_0xdac5('0x2')]['http']({'port':0x2329});client['Request']=function(_0x240d6a,_0x129d1f){return new BPromise(function(_0x1a4e1d,_0x3d57ac){return client['request'](_0x240d6a,_0x129d1f)[_0xdac5('0x3')](function(_0x275529){logger[_0xdac5('0x4')](_0xdac5('0x5'),_0xdac5('0x6'),_0x240d6a,_0x129d1f,_0x275529);if(_0x275529['error']){logger[_0xdac5('0x7')](_0xdac5('0x5'),'memberReport',_0x240d6a,_0x275529['error'][_0xdac5('0x8')],_0x129d1f);return _0x3d57ac(_0x275529[_0xdac5('0x7')]['message']);}else{return _0x1a4e1d(_0x275529['result']);}})['catch'](function(_0x435340){logger[_0xdac5('0x7')](_0xdac5('0x5'),_0xdac5('0x6'),_0x240d6a,_0x435340,_0x129d1f);return _0x3d57ac(_0x435340);});});};module[_0xdac5('0x9')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 8ce9292..3f1c6c6 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 _0xbc2b=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','number','getQueue','exports','moment','isNil','string','voiceQueue','uniqueid','name','Contact','lastName','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x401381,_0x66b5d4){var _0x4a8fac=function(_0x5c45d8){while(--_0x5c45d8){_0x401381['push'](_0x401381['shift']());}};_0x4a8fac(++_0x66b5d4);}(_0xbc2b,0x1ba));var _0xbbc2=function(_0x525c42,_0x486cc5){_0x525c42=_0x525c42-0x0;var _0x2c2999=_0xbc2b[_0x525c42];return _0x2c2999;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xbbc2('0x0'));function checkNameSurname(_0x426de6,_0x5360cc,_0x5d48a6){var _0x160279='';if(!_[_0xbbc2('0x1')](_0x5360cc)&&_0xbbc2('0x2')===typeof _0x5360cc){_0x160279+=_0x5360cc;}if(!_[_0xbbc2('0x1')](_0x5d48a6)&&_0xbbc2('0x2')===typeof _0x5d48a6){_0x160279+='\x20'+_0x5d48a6;}if(_0x160279!==''){return _0x160279;}return _0x426de6;}function Action(_0x61b6e,_0x5f3a6c,_0x10dbec){this[_0xbbc2('0x3')]=_0x61b6e;this[_0xbbc2('0x4')]=_0x10dbec||undefined;this[_0xbbc2('0x5')]=checkNameSurname(_0x5f3a6c[_0xbbc2('0x6')]['phone'],_0x5f3a6c['Contact']['firstName'],_0x5f3a6c[_0xbbc2('0x6')][_0xbbc2('0x7')]);this['number']=_0x5f3a6c[_0xbbc2('0x8')];this[_0xbbc2('0x9')]=_0x61b6e[_0xbbc2('0x5')];this[_0xbbc2('0xa')]=_0x5f3a6c[_0xbbc2('0xa')]||![];this['type']=_0x61b6e[_0xbbc2('0xb')];this[_0xbbc2('0xc')]=_0x61b6e['dialQueueTimeout']||0x3;this[_0xbbc2('0xd')]=_0x5f3a6c[_0xbbc2('0xd')];this[_0xbbc2('0xe')]=_0x5f3a6c['countbusyretry'];this[_0xbbc2('0xf')]=_0x5f3a6c['countcongestionretry'];this['countnoanswerretry']=_0x5f3a6c[_0xbbc2('0x10')];this[_0xbbc2('0x11')]=_0x5f3a6c[_0xbbc2('0x11')];this[_0xbbc2('0x12')]=_0x5f3a6c[_0xbbc2('0x12')];this[_0xbbc2('0x13')]=_0x5f3a6c['countabandonedretry'];this[_0xbbc2('0x14')]=_0x5f3a6c['countmachineretry'];this[_0xbbc2('0x15')]=_0x5f3a6c[_0xbbc2('0x15')];this[_0xbbc2('0x16')]=_0x5f3a6c[_0xbbc2('0x16')];this[_0xbbc2('0x17')]=_0x5f3a6c[_0xbbc2('0x17')];this[_0xbbc2('0x18')]=_0x5f3a6c['UserId'];this[_0xbbc2('0x19')]=_0x5f3a6c[_0xbbc2('0x19')];this[_0xbbc2('0x1a')]=_0x5f3a6c[_0xbbc2('0x1a')];this[_0xbbc2('0x1b')]=_0x5f3a6c['id'];this['ContactFirstName']=_0x5f3a6c[_0xbbc2('0x6')][_0xbbc2('0x1c')]||'';this[_0xbbc2('0x1d')]=moment()[_0xbbc2('0x1e')](_0xbbc2('0x1f'));this[_0xbbc2('0x20')]=_0x5f3a6c[_0xbbc2('0x20')];this[_0xbbc2('0x21')]=_0x5f3a6c[_0xbbc2('0x21')];this[_0xbbc2('0x22')]=_0x5f3a6c[_0xbbc2('0x22')];this[_0xbbc2('0x23')]=_0x5f3a6c[_0xbbc2('0x23')];this[_0xbbc2('0x24')]='';this[_0xbbc2('0x25')]='';}Action[_0xbbc2('0x26')][_0xbbc2('0x27')]=function(){return util[_0xbbc2('0x1e')](_0xbbc2('0x28'),this[_0xbbc2('0x5')],this[_0xbbc2('0x3')][_0xbbc2('0x29')]>0x0?this['number'][_0xbbc2('0x2a')](this['voiceQueue']['dialCutDigit']):this[_0xbbc2('0x2b')]);};Action[_0xbbc2('0x26')][_0xbbc2('0x2c')]=function(){return this['queue'];};module[_0xbbc2('0x2d')]=Action; \ No newline at end of file +var _0x240d=['callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','voiceQueue','substring','dialCutDigit','prototype','getQueue','exports','lodash','moment','isNil','uniqueid','name','Contact','phone','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x240d,0x17e));var _0xd240=function(_0x334bd4,_0x2c9665){_0x334bd4=_0x334bd4-0x0;var _0x2b367f=_0x240d[_0x334bd4];return _0x2b367f;};'use strict';var util=require('util');var _=require(_0xd240('0x0'));var moment=require(_0xd240('0x1'));function checkNameSurname(_0x595f73,_0x1b24b6,_0x20ce67){var _0x3db70c='';if(!_[_0xd240('0x2')](_0x1b24b6)&&'string'===typeof _0x1b24b6){_0x3db70c+=_0x1b24b6;}if(!_[_0xd240('0x2')](_0x20ce67)&&'string'===typeof _0x20ce67){_0x3db70c+='\x20'+_0x20ce67;}if(_0x3db70c!==''){return _0x3db70c;}return _0x595f73;}function Action(_0x518cbe,_0x4c0137,_0x4b69cb){this['voiceQueue']=_0x518cbe;this[_0xd240('0x3')]=_0x4b69cb||undefined;this[_0xd240('0x4')]=checkNameSurname(_0x4c0137[_0xd240('0x5')][_0xd240('0x6')],_0x4c0137['Contact']['firstName'],_0x4c0137[_0xd240('0x5')][_0xd240('0x7')]);this[_0xd240('0x8')]=_0x4c0137[_0xd240('0x6')];this[_0xd240('0x9')]=_0x518cbe[_0xd240('0x4')];this[_0xd240('0xa')]=_0x4c0137['active']||![];this[_0xd240('0xb')]=_0x518cbe[_0xd240('0xb')];this[_0xd240('0xc')]=_0x518cbe[_0xd240('0xc')]||0x3;this[_0xd240('0xd')]=_0x4c0137[_0xd240('0xd')];this['countbusyretry']=_0x4c0137[_0xd240('0xe')];this[_0xd240('0xf')]=_0x4c0137[_0xd240('0xf')];this[_0xd240('0x10')]=_0x4c0137[_0xd240('0x10')];this[_0xd240('0x11')]=_0x4c0137[_0xd240('0x11')];this[_0xd240('0x12')]=_0x4c0137['countdropretry'];this[_0xd240('0x13')]=_0x4c0137['countabandonedretry'];this[_0xd240('0x14')]=_0x4c0137[_0xd240('0x14')];this['countagentrejectretry']=_0x4c0137['countagentrejectretry'];this[_0xd240('0x15')]=_0x4c0137[_0xd240('0x15')];this['ListId']=_0x4c0137['ListId'];this[_0xd240('0x16')]=_0x4c0137['UserId'];this[_0xd240('0x17')]=_0x4c0137[_0xd240('0x17')];this['CampaignId']=_0x4c0137[_0xd240('0x18')];this[_0xd240('0x19')]=_0x4c0137['id'];this[_0xd240('0x1a')]=_0x4c0137[_0xd240('0x5')]['firstName']||'';this['starttime']=moment()[_0xd240('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x4c0137[_0xd240('0x1c')];this[_0xd240('0x1d')]=_0x4c0137[_0xd240('0x1d')];this[_0xd240('0x1e')]=_0x4c0137[_0xd240('0x1e')];this['recallme']=_0x4c0137['recallme'];this[_0xd240('0x1f')]='';this[_0xd240('0x20')]='';}Action['prototype'][_0xd240('0x21')]=function(){return util[_0xd240('0x1b')](_0xd240('0x22'),this[_0xd240('0x4')],this[_0xd240('0x23')]['dialCutDigit']>0x0?this[_0xd240('0x8')][_0xd240('0x24')](this[_0xd240('0x23')][_0xd240('0x25')]):this[_0xd240('0x8')]);};Action[_0xd240('0x26')][_0xd240('0x27')]=function(){return this[_0xd240('0x9')];};module[_0xd240('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/additionalPhone.js b/server/services/ami/dialer/additionalPhone.js index 6649353..3e7b510 100644 --- a/server/services/ami/dialer/additionalPhone.js +++ b/server/services/ami/dialer/additionalPhone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11f1=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','number','starttime','responsetime','ringtime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x349915,_0x124261){var _0x8be4f3=function(_0x3a82a9){while(--_0x3a82a9){_0x349915['push'](_0x349915['shift']());}};_0x8be4f3(++_0x124261);}(_0x11f1,0x84));var _0x111f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x11f1[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x111f('0x0'));var _=require(_0x111f('0x1'));var moment=require(_0x111f('0x2'));function getSeconds(_0xf04fb5,_0x51b0b7){var _0x20b5d3=moment(_0xf04fb5)['milliseconds'](0x0);var _0x21a812=moment(_0x51b0b7)[_0x111f('0x3')](0x0);return _0x20b5d3[_0x111f('0x4')](_0x21a812,_0x111f('0x5'));}function AdditionalPhone(_0x5a553e){this[_0x111f('0x6')]=_0x5a553e[_0x111f('0x6')];this[_0x111f('0x7')]=_0x5a553e[_0x111f('0x7')]||undefined;this['type']=_0x5a553e[_0x111f('0x8')];this[_0x111f('0x9')]=_0x5a553e[_0x111f('0x8')]===_0x111f('0xa')?_0x111f('0xb'):_0x5a553e[_0x111f('0x8')];this['countbusyretry']=_0x5a553e[_0x111f('0xc')];this[_0x111f('0xd')]=_0x5a553e['countcongestionretry'];this[_0x111f('0xe')]=_0x5a553e[_0x111f('0xe')];this['countglobal']=_0x5a553e[_0x111f('0xc')]+_0x5a553e[_0x111f('0xd')]+_0x5a553e[_0x111f('0xe')]+_0x5a553e[_0x111f('0xf')]+_0x5a553e[_0x111f('0x10')]+_0x5a553e[_0x111f('0x11')]+_0x5a553e[_0x111f('0x12')]+_0x5a553e[_0x111f('0x13')];this[_0x111f('0xf')]=_0x5a553e[_0x111f('0xf')];this[_0x111f('0x10')]=_0x5a553e[_0x111f('0x10')];this[_0x111f('0x11')]=_0x5a553e['countabandonedretry'];this[_0x111f('0x12')]=_0x5a553e[_0x111f('0x12')];this[_0x111f('0x13')]=_0x5a553e['countagentrejectretry'];this[_0x111f('0xb')]=_0x5a553e['queue'];this['calleridname']=_0x5a553e[_0x111f('0x14')];this[_0x111f('0x15')]=_0x5a553e[_0x111f('0x16')];this['starttime']=_0x5a553e[_0x111f('0x17')];this[_0x111f('0x18')]=_0x5a553e[_0x111f('0x18')];this['endtime']=_0x5a553e['responsetime'];this[_0x111f('0x19')]=getSeconds(_0x5a553e[_0x111f('0x18')],_0x5a553e[_0x111f('0x17')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x111f('0x1a')]=_0x5a553e[_0x111f('0x1a')];this[_0x111f('0x1b')]=_0x5a553e[_0x111f('0x1b')];this[_0x111f('0x1c')]=_0x5a553e[_0x111f('0x1c')];this['recallme']=_0x5a553e['recallme'];this[_0x111f('0x1d')]=_0x5a553e[_0x111f('0x1d')];this[_0x111f('0x1e')]=_0x5a553e['ListId'];this[_0x111f('0x1f')]=_0x5a553e[_0x111f('0x1f')];this[_0x111f('0x20')]=_0x5a553e['VoiceQueueId'];this['CampaignId']=_0x5a553e[_0x111f('0x21')];this[_0x111f('0x22')]=_0x5a553e[_0x111f('0x22')]||'';this[_0x111f('0x23')]=_0x5a553e[_0x111f('0x23')]||'';}module[_0x111f('0x24')]=History; \ No newline at end of file +var _0xc2ca=['calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','diff','uniqueid','scheduledat','campaigntype','outbound','queue','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x49b385,_0x2a4a84){var _0x317e8f=function(_0x18f811){while(--_0x18f811){_0x49b385['push'](_0x49b385['shift']());}};_0x317e8f(++_0x2a4a84);}(_0xc2ca,0xe3));var _0xac2c=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xc2ca[_0x3e5086];return _0xfeb102;};'use strict';var util=require('util');var _=require(_0xac2c('0x0'));var moment=require(_0xac2c('0x1'));function getSeconds(_0x286d37,_0x302422){var _0x56843b=moment(_0x286d37)['milliseconds'](0x0);var _0x53a4f5=moment(_0x302422)['milliseconds'](0x0);return _0x56843b[_0xac2c('0x2')](_0x53a4f5,'seconds');}function AdditionalPhone(_0x8a52ca){this[_0xac2c('0x3')]=_0x8a52ca[_0xac2c('0x3')];this[_0xac2c('0x4')]=_0x8a52ca['scheduledat']||undefined;this['type']=_0x8a52ca['type'];this[_0xac2c('0x5')]=_0x8a52ca['type']===_0xac2c('0x6')?_0xac2c('0x7'):_0x8a52ca[_0xac2c('0x8')];this[_0xac2c('0x9')]=_0x8a52ca['countbusyretry'];this[_0xac2c('0xa')]=_0x8a52ca[_0xac2c('0xa')];this[_0xac2c('0xb')]=_0x8a52ca['countnoanswerretry'];this[_0xac2c('0xc')]=_0x8a52ca['countbusyretry']+_0x8a52ca[_0xac2c('0xa')]+_0x8a52ca[_0xac2c('0xb')]+_0x8a52ca[_0xac2c('0xd')]+_0x8a52ca[_0xac2c('0xe')]+_0x8a52ca[_0xac2c('0xf')]+_0x8a52ca[_0xac2c('0x10')]+_0x8a52ca[_0xac2c('0x11')];this[_0xac2c('0xd')]=_0x8a52ca['countnosuchnumberretry'];this[_0xac2c('0xe')]=_0x8a52ca[_0xac2c('0xe')];this[_0xac2c('0xf')]=_0x8a52ca[_0xac2c('0xf')];this[_0xac2c('0x10')]=_0x8a52ca[_0xac2c('0x10')];this[_0xac2c('0x11')]=_0x8a52ca[_0xac2c('0x11')];this[_0xac2c('0x7')]=_0x8a52ca[_0xac2c('0x7')];this[_0xac2c('0x12')]=_0x8a52ca['name'];this[_0xac2c('0x13')]=_0x8a52ca['number'];this[_0xac2c('0x14')]=_0x8a52ca['starttime'];this[_0xac2c('0x15')]=_0x8a52ca['responsetime'];this['endtime']=_0x8a52ca['responsetime'];this[_0xac2c('0x16')]=getSeconds(_0x8a52ca[_0xac2c('0x15')],_0x8a52ca['starttime']);this[_0xac2c('0x17')]=0x0;this[_0xac2c('0x18')]=0x0;this['callback']=_0x8a52ca[_0xac2c('0x19')];this[_0xac2c('0x1a')]=_0x8a52ca['callbackuniqueid'];this[_0xac2c('0x1b')]=_0x8a52ca[_0xac2c('0x1b')];this[_0xac2c('0x1c')]=_0x8a52ca[_0xac2c('0x1c')];this[_0xac2c('0x1d')]=_0x8a52ca['ContactId'];this['ListId']=_0x8a52ca['ListId'];this[_0xac2c('0x1e')]=_0x8a52ca[_0xac2c('0x1e')];this[_0xac2c('0x1f')]=_0x8a52ca['VoiceQueueId'];this[_0xac2c('0x20')]=_0x8a52ca['CampaignId'];this[_0xac2c('0x21')]=_0x8a52ca[_0xac2c('0x21')]||'';this[_0xac2c('0x22')]=_0x8a52ca[_0xac2c('0x22')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index d7c1c53..cf42eab 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 _0xa5dd=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','state','statedesc','Answer','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId'];(function(_0x15b491,_0x312e92){var _0x22bb5f=function(_0x2e5124){while(--_0x2e5124){_0x15b491['push'](_0x15b491['shift']());}};_0x22bb5f(++_0x312e92);}(_0xa5dd,0x1d2));var _0xda5d=function(_0x2a1368,_0x97712c){_0x2a1368=_0x2a1368-0x0;var _0x4df067=_0xa5dd[_0x2a1368];return _0x4df067;};'use strict';var util=require(_0xda5d('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x4cd181,_0x540636){var _0x428063=moment(_0x4cd181)[_0xda5d('0x1')](0x0);var _0x2a7bf0=moment(_0x540636)[_0xda5d('0x1')](0x0);return _0x428063['diff'](_0x2a7bf0,'seconds');}function AgentComplete(_0xf204fc,_0x631802){this[_0xda5d('0x2')]=0x4;this[_0xda5d('0x3')]=_0xda5d('0x4');this['scheduledat']=_0xf204fc['scheduledat'];this['type']=_0xf204fc[_0xda5d('0x5')];this[_0xda5d('0x6')]=_0xf204fc[_0xda5d('0x5')]===_0xda5d('0x7')?_0xda5d('0x8'):_0xf204fc[_0xda5d('0x5')];this[_0xda5d('0x9')]=_0xf204fc[_0xda5d('0x9')];this['countcongestionretry']=_0xf204fc[_0xda5d('0xa')];this['countnoanswerretry']=_0xf204fc[_0xda5d('0xb')];this[_0xda5d('0xc')]=_0xf204fc['countbusyretry']+_0xf204fc[_0xda5d('0xa')]+_0xf204fc[_0xda5d('0xb')]+_0xf204fc[_0xda5d('0xd')]+_0xf204fc[_0xda5d('0xe')]+_0xf204fc[_0xda5d('0xf')]+_0xf204fc[_0xda5d('0x10')]+_0xf204fc[_0xda5d('0x11')];this[_0xda5d('0xd')]=_0xf204fc[_0xda5d('0xd')];this['countdropretry']=_0xf204fc[_0xda5d('0xe')];this[_0xda5d('0xf')]=_0xf204fc[_0xda5d('0xf')];this['countmachineretry']=_0xf204fc[_0xda5d('0x10')];this[_0xda5d('0x11')]=_0xf204fc['countagentrejectretry'];this[_0xda5d('0x12')]=_0x631802[_0xda5d('0x12')];this[_0xda5d('0x13')]=_0xf204fc[_0xda5d('0x14')];this[_0xda5d('0x15')]=_0xf204fc[_0xda5d('0x16')];this[_0xda5d('0x17')]=_0xf204fc['starttime'];this[_0xda5d('0x18')]=_0xf204fc[_0xda5d('0x18')];this[_0xda5d('0x19')]=_0xf204fc[_0xda5d('0x19')];this[_0xda5d('0x1a')]=moment()['format'](_0xda5d('0x1b'));this['ringtime']=getSeconds(_0xf204fc[_0xda5d('0x18')],_0xf204fc['starttime']);this[_0xda5d('0x1c')]=getSeconds(_0xf204fc[_0xda5d('0x19')],_0xf204fc[_0xda5d('0x18')]);this['talktime']=getSeconds(this[_0xda5d('0x1a')],_0xf204fc[_0xda5d('0x19')]);this[_0xda5d('0x8')]=_0x631802[_0xda5d('0x8')];this[_0xda5d('0x1d')]=_0x631802['membername'];this[_0xda5d('0x1e')]=_0x631802[_0xda5d('0x1e')];this[_0xda5d('0x1f')]=_0xf204fc[_0xda5d('0x1f')];this[_0xda5d('0x20')]=_0xf204fc['callbackuniqueid'];this['callbackat']=_0xf204fc[_0xda5d('0x21')];this[_0xda5d('0x22')]=_0xf204fc[_0xda5d('0x22')];this[_0xda5d('0x23')]=_0xf204fc['ContactId'];this[_0xda5d('0x24')]=_0xf204fc['ListId'];this['UserId']=_0xf204fc['UserId'];this['VoiceQueueId']=_0xf204fc[_0xda5d('0x25')];this[_0xda5d('0x26')]=_0xf204fc[_0xda5d('0x26')];this[_0xda5d('0x27')]=_0xf204fc['originatecalleridnum']||'';this['originatecalleridname']=_0xf204fc[_0xda5d('0x28')]||'';}module[_0xda5d('0x29')]=AgentComplete; \ No newline at end of file +var _0xe100=['membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime'];(function(_0x2281a0,_0x1351d6){var _0x265a56=function(_0x38b3fa){while(--_0x38b3fa){_0x2281a0['push'](_0x2281a0['shift']());}};_0x265a56(++_0x1351d6);}(_0xe100,0xdd));var _0x0e10=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe100[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x0e10('0x0'));var _=require('lodash');var moment=require(_0x0e10('0x1'));function getSeconds(_0x5397b3,_0x1d9b1a){var _0x11224c=moment(_0x5397b3)[_0x0e10('0x2')](0x0);var _0x2d6c7c=moment(_0x1d9b1a)['milliseconds'](0x0);return _0x11224c[_0x0e10('0x3')](_0x2d6c7c,_0x0e10('0x4'));}function AgentComplete(_0x23604e,_0x35fdc1){this[_0x0e10('0x5')]=0x4;this[_0x0e10('0x6')]=_0x0e10('0x7');this[_0x0e10('0x8')]=_0x23604e[_0x0e10('0x8')];this['type']=_0x23604e[_0x0e10('0x9')];this['campaigntype']=_0x23604e[_0x0e10('0x9')]==='outbound'?_0x0e10('0xa'):_0x23604e[_0x0e10('0x9')];this[_0x0e10('0xb')]=_0x23604e[_0x0e10('0xb')];this['countcongestionretry']=_0x23604e['countcongestionretry'];this[_0x0e10('0xc')]=_0x23604e[_0x0e10('0xc')];this['countglobal']=_0x23604e[_0x0e10('0xb')]+_0x23604e[_0x0e10('0xd')]+_0x23604e[_0x0e10('0xc')]+_0x23604e[_0x0e10('0xe')]+_0x23604e[_0x0e10('0xf')]+_0x23604e['countabandonedretry']+_0x23604e[_0x0e10('0x10')]+_0x23604e[_0x0e10('0x11')];this[_0x0e10('0xe')]=_0x23604e['countnosuchnumberretry'];this['countdropretry']=_0x23604e[_0x0e10('0xf')];this[_0x0e10('0x12')]=_0x23604e['countabandonedretry'];this[_0x0e10('0x10')]=_0x23604e[_0x0e10('0x10')];this[_0x0e10('0x11')]=_0x23604e[_0x0e10('0x11')];this['uniqueid']=_0x35fdc1[_0x0e10('0x13')];this[_0x0e10('0x14')]=_0x23604e[_0x0e10('0x15')];this['calleridnum']=_0x23604e[_0x0e10('0x16')];this[_0x0e10('0x17')]=_0x23604e[_0x0e10('0x17')];this[_0x0e10('0x18')]=_0x23604e[_0x0e10('0x18')];this[_0x0e10('0x19')]=_0x23604e[_0x0e10('0x19')];this['endtime']=moment()['format'](_0x0e10('0x1a'));this[_0x0e10('0x1b')]=getSeconds(_0x23604e[_0x0e10('0x18')],_0x23604e['starttime']);this[_0x0e10('0x1c')]=getSeconds(_0x23604e['answertime'],_0x23604e[_0x0e10('0x18')]);this[_0x0e10('0x1d')]=getSeconds(this[_0x0e10('0x1e')],_0x23604e[_0x0e10('0x19')]);this[_0x0e10('0xa')]=_0x35fdc1[_0x0e10('0xa')];this[_0x0e10('0x1f')]=_0x35fdc1['membername'];this['reason']=_0x35fdc1[_0x0e10('0x20')];this[_0x0e10('0x21')]=_0x23604e['callback'];this['callbackuniqueid']=_0x23604e['callbackuniqueid'];this[_0x0e10('0x22')]=_0x23604e[_0x0e10('0x22')];this[_0x0e10('0x23')]=_0x23604e[_0x0e10('0x23')];this[_0x0e10('0x24')]=_0x23604e['ContactId'];this[_0x0e10('0x25')]=_0x23604e[_0x0e10('0x25')];this['UserId']=_0x23604e[_0x0e10('0x26')];this[_0x0e10('0x27')]=_0x23604e['VoiceQueueId'];this['CampaignId']=_0x23604e['CampaignId'];this['originatecalleridnum']=_0x23604e['originatecalleridnum']||'';this[_0x0e10('0x28')]=_0x23604e['originatecalleridname']||'';}module[_0x0e10('0x29')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 8abe8f6..c11d031 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 _0x8019=['calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry'];(function(_0x4b6507,_0x5518b5){var _0x2001ec=function(_0x330ddf){while(--_0x330ddf){_0x4b6507['push'](_0x4b6507['shift']());}};_0x2001ec(++_0x5518b5);}(_0x8019,0x18e));var _0x9801=function(_0x202771,_0xcace9c){_0x202771=_0x202771-0x0;var _0x3612ef=_0x8019[_0x202771];return _0x3612ef;};'use strict';var util=require(_0x9801('0x0'));var _=require('lodash');var moment=require(_0x9801('0x1'));function getSeconds(_0x3d30c9,_0xbb50a3){var _0x2e1cec=moment(_0x3d30c9)[_0x9801('0x2')](0x0);var _0x3baaf8=moment(_0xbb50a3)[_0x9801('0x2')](0x0);return _0x2e1cec[_0x9801('0x3')](_0x3baaf8,_0x9801('0x4'));}function Final(_0x231a5b){this[_0x9801('0x5')]=_0x231a5b[_0x9801('0x5')];this[_0x9801('0x6')]=_0x231a5b['scheduledat'];this[_0x9801('0x7')]=_0x231a5b[_0x9801('0x7')];this[_0x9801('0x8')]=_0x231a5b[_0x9801('0x7')]===_0x9801('0x9')?_0x9801('0xa'):_0x231a5b[_0x9801('0x7')];this[_0x9801('0xb')]=_0x231a5b[_0x9801('0xb')];this[_0x9801('0xc')]=_0x231a5b[_0x9801('0xc')];this[_0x9801('0xd')]=_0x231a5b[_0x9801('0xd')];this[_0x9801('0xe')]=_0x231a5b[_0x9801('0xb')]+_0x231a5b[_0x9801('0xc')]+_0x231a5b[_0x9801('0xd')]+_0x231a5b[_0x9801('0xf')]+_0x231a5b[_0x9801('0x10')]+_0x231a5b['countabandonedretry']+_0x231a5b['countmachineretry']+_0x231a5b[_0x9801('0x11')];this[_0x9801('0xf')]=_0x231a5b['countnosuchnumberretry'];this[_0x9801('0x10')]=_0x231a5b['countdropretry'];this[_0x9801('0x12')]=_0x231a5b[_0x9801('0x12')];this[_0x9801('0x13')]=_0x231a5b['countmachineretry'];this[_0x9801('0x11')]=_0x231a5b['countagentrejectretry'];this['queue']=_0x231a5b['queue'];this[_0x9801('0x14')]=_0x231a5b[_0x9801('0x14')];this['calleridnum']=_0x231a5b[_0x9801('0x15')];this[_0x9801('0x16')]=_0x231a5b['starttime'];this['responsetime']=_0x231a5b[_0x9801('0x17')];this[_0x9801('0x18')]=_0x231a5b['responsetime'];this[_0x9801('0x19')]=_0x231a5b[_0x9801('0x19')]||0x0;this[_0x9801('0x1a')]=_0x231a5b[_0x9801('0x1a')]||0x0;this[_0x9801('0x1b')]=_0x231a5b['talktime']||0x0;this[_0x9801('0x1c')]=_0x231a5b[_0x9801('0x1c')];this[_0x9801('0x1d')]=_0x231a5b[_0x9801('0x1d')];this[_0x9801('0x1e')]=_0x231a5b[_0x9801('0x1e')];this['recallme']=_0x231a5b['recallme'];this[_0x9801('0x1f')]=_0x231a5b[_0x9801('0x1f')];this[_0x9801('0x20')]=_0x231a5b[_0x9801('0x20')];this[_0x9801('0x21')]=_0x231a5b['UserId'];this['VoiceQueueId']=_0x231a5b['VoiceQueueId'];this[_0x9801('0x22')]=_0x231a5b[_0x9801('0x22')];this[_0x9801('0x23')]=_0x231a5b[_0x9801('0x23')]||'';this[_0x9801('0x24')]=_0x231a5b[_0x9801('0x24')]||'';}module[_0x9801('0x25')]=Final; \ No newline at end of file +var _0x9750=['callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','util','milliseconds','diff','seconds','uniqueid','scheduledat','campaigntype','outbound','type','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','talktime','callback'];(function(_0x1fb51b,_0x40539c){var _0x173ebb=function(_0x1024bc){while(--_0x1024bc){_0x1fb51b['push'](_0x1fb51b['shift']());}};_0x173ebb(++_0x40539c);}(_0x9750,0xb2));var _0x0975=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x9750[_0x1e7b16];return _0x37fadc;};'use strict';var util=require(_0x0975('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x371053,_0x319cf0){var _0x2ad039=moment(_0x371053)[_0x0975('0x1')](0x0);var _0x6b47ec=moment(_0x319cf0)['milliseconds'](0x0);return _0x2ad039[_0x0975('0x2')](_0x6b47ec,_0x0975('0x3'));}function Final(_0x5271ca){this[_0x0975('0x4')]=_0x5271ca[_0x0975('0x4')];this['scheduledat']=_0x5271ca[_0x0975('0x5')];this['type']=_0x5271ca['type'];this[_0x0975('0x6')]=_0x5271ca['type']===_0x0975('0x7')?'queue':_0x5271ca[_0x0975('0x8')];this[_0x0975('0x9')]=_0x5271ca[_0x0975('0x9')];this[_0x0975('0xa')]=_0x5271ca[_0x0975('0xa')];this[_0x0975('0xb')]=_0x5271ca[_0x0975('0xb')];this['countglobal']=_0x5271ca[_0x0975('0x9')]+_0x5271ca[_0x0975('0xa')]+_0x5271ca['countnoanswerretry']+_0x5271ca[_0x0975('0xc')]+_0x5271ca[_0x0975('0xd')]+_0x5271ca[_0x0975('0xe')]+_0x5271ca['countmachineretry']+_0x5271ca[_0x0975('0xf')];this[_0x0975('0xc')]=_0x5271ca[_0x0975('0xc')];this[_0x0975('0xd')]=_0x5271ca[_0x0975('0xd')];this[_0x0975('0xe')]=_0x5271ca['countabandonedretry'];this[_0x0975('0x10')]=_0x5271ca[_0x0975('0x10')];this[_0x0975('0xf')]=_0x5271ca[_0x0975('0xf')];this[_0x0975('0x11')]=_0x5271ca[_0x0975('0x11')];this[_0x0975('0x12')]=_0x5271ca[_0x0975('0x12')];this[_0x0975('0x13')]=_0x5271ca[_0x0975('0x13')];this[_0x0975('0x14')]=_0x5271ca[_0x0975('0x14')];this[_0x0975('0x15')]=_0x5271ca[_0x0975('0x15')];this[_0x0975('0x16')]=_0x5271ca['responsetime'];this[_0x0975('0x17')]=_0x5271ca[_0x0975('0x17')]||0x0;this['holdtime']=_0x5271ca['holdtime']||0x0;this[_0x0975('0x18')]=_0x5271ca[_0x0975('0x18')]||0x0;this[_0x0975('0x19')]=_0x5271ca['callback'];this[_0x0975('0x1a')]=_0x5271ca[_0x0975('0x1a')];this[_0x0975('0x1b')]=_0x5271ca['callbackat'];this['recallme']=_0x5271ca['recallme'];this[_0x0975('0x1c')]=_0x5271ca[_0x0975('0x1c')];this[_0x0975('0x1d')]=_0x5271ca[_0x0975('0x1d')];this[_0x0975('0x1e')]=_0x5271ca['UserId'];this[_0x0975('0x1f')]=_0x5271ca[_0x0975('0x1f')];this[_0x0975('0x20')]=_0x5271ca[_0x0975('0x20')];this['originatecalleridnum']=_0x5271ca['originatecalleridnum']||'';this[_0x0975('0x21')]=_0x5271ca[_0x0975('0x21')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index d05b472..a3f8f23 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 _0xdf53=['VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','state','statedesc','scheduledat','campaigntype','type','outbound','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','queue','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0xafcda6,_0x2817b9){var _0x2f00c5=function(_0x20c6ff){while(--_0x20c6ff){_0xafcda6['push'](_0xafcda6['shift']());}};_0x2f00c5(++_0x2817b9);}(_0xdf53,0xe4));var _0x3df5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xdf53[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0x3df5('0x0'));var _=require(_0x3df5('0x1'));var moment=require(_0x3df5('0x2'));function getSeconds(_0x23f501,_0x3e2f88){var _0xa9cd23=moment(_0x23f501)['milliseconds'](0x0);var _0x368067=moment(_0x3e2f88)[_0x3df5('0x3')](0x0);return _0xa9cd23[_0x3df5('0x4')](_0x368067,'seconds');}function Hangup(_0x1130d0,_0x4807d0){this[_0x3df5('0x5')]=0x4;this[_0x3df5('0x6')]='Answer';this[_0x3df5('0x7')]=_0x1130d0[_0x3df5('0x7')];this['type']=_0x1130d0['type'];this[_0x3df5('0x8')]=_0x1130d0[_0x3df5('0x9')]===_0x3df5('0xa')?'queue':_0x1130d0[_0x3df5('0x9')];this['countbusyretry']=_0x1130d0['countbusyretry'];this[_0x3df5('0xb')]=_0x1130d0['countcongestionretry'];this[_0x3df5('0xc')]=_0x1130d0[_0x3df5('0xc')];this[_0x3df5('0xd')]=_0x1130d0[_0x3df5('0xe')]+_0x1130d0[_0x3df5('0xb')]+_0x1130d0['countnoanswerretry']+_0x1130d0[_0x3df5('0xf')]+_0x1130d0[_0x3df5('0x10')]+_0x1130d0[_0x3df5('0x11')]+_0x1130d0[_0x3df5('0x12')]+_0x1130d0[_0x3df5('0x13')];this[_0x3df5('0xf')]=_0x1130d0[_0x3df5('0xf')];this[_0x3df5('0x10')]=_0x1130d0[_0x3df5('0x10')];this[_0x3df5('0x11')]=_0x1130d0[_0x3df5('0x11')];this[_0x3df5('0x12')]=_0x1130d0[_0x3df5('0x12')];this[_0x3df5('0x13')]=_0x1130d0[_0x3df5('0x13')];this[_0x3df5('0x14')]=_0x4807d0[_0x3df5('0x14')];this['calleridname']=_0x1130d0[_0x3df5('0x15')];this[_0x3df5('0x16')]=_0x1130d0[_0x3df5('0x17')];this[_0x3df5('0x18')]=_0x1130d0['starttime'];this[_0x3df5('0x19')]=_0x1130d0['responsetime'];this['endtime']=moment()['format'](_0x3df5('0x1a'));this[_0x3df5('0x1b')]=getSeconds(_0x1130d0[_0x3df5('0x19')],_0x1130d0[_0x3df5('0x18')]);this[_0x3df5('0x1c')]=0x0;this[_0x3df5('0x1d')]=getSeconds(this[_0x3df5('0x1e')],_0x1130d0[_0x3df5('0x19')]);this[_0x3df5('0x1f')]=_0x1130d0[_0x3df5('0x1f')];this[_0x3df5('0x20')]=_0x3df5('0x21');this[_0x3df5('0x22')]=_0x4807d0['cause-txt'];this[_0x3df5('0x23')]=_0x1130d0[_0x3df5('0x23')];this[_0x3df5('0x24')]=_0x1130d0[_0x3df5('0x24')];this[_0x3df5('0x25')]=_0x1130d0['callbackat'];this[_0x3df5('0x26')]=_0x1130d0[_0x3df5('0x26')];this[_0x3df5('0x27')]=_0x1130d0[_0x3df5('0x27')];this[_0x3df5('0x28')]=_0x1130d0['ListId'];this[_0x3df5('0x29')]=_0x1130d0[_0x3df5('0x29')];this[_0x3df5('0x2a')]=_0x1130d0['VoiceQueueId'];this[_0x3df5('0x2b')]=_0x1130d0[_0x3df5('0x2b')];}module[_0x3df5('0x2c')]=Hangup; \ No newline at end of file +var _0x124d=['starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','endtime','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','statedesc','Answer','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number'];(function(_0x2a9b1f,_0xfb584d){var _0x3dde47=function(_0xb9a54a){while(--_0xb9a54a){_0x2a9b1f['push'](_0x2a9b1f['shift']());}};_0x3dde47(++_0xfb584d);}(_0x124d,0x91));var _0xd124=function(_0x30bb46,_0x1c722a){_0x30bb46=_0x30bb46-0x0;var _0x49b2f5=_0x124d[_0x30bb46];return _0x49b2f5;};'use strict';var util=require(_0xd124('0x0'));var _=require(_0xd124('0x1'));var moment=require(_0xd124('0x2'));function getSeconds(_0x6cf4ed,_0x27ab5c){var _0x36023d=moment(_0x6cf4ed)[_0xd124('0x3')](0x0);var _0x172205=moment(_0x27ab5c)[_0xd124('0x3')](0x0);return _0x36023d['diff'](_0x172205,'seconds');}function Hangup(_0x546d63,_0x3d101d){this['state']=0x4;this[_0xd124('0x4')]=_0xd124('0x5');this['scheduledat']=_0x546d63['scheduledat'];this['type']=_0x546d63['type'];this[_0xd124('0x6')]=_0x546d63[_0xd124('0x7')]===_0xd124('0x8')?_0xd124('0x9'):_0x546d63[_0xd124('0x7')];this[_0xd124('0xa')]=_0x546d63[_0xd124('0xa')];this[_0xd124('0xb')]=_0x546d63['countcongestionretry'];this[_0xd124('0xc')]=_0x546d63[_0xd124('0xc')];this[_0xd124('0xd')]=_0x546d63[_0xd124('0xa')]+_0x546d63['countcongestionretry']+_0x546d63[_0xd124('0xc')]+_0x546d63[_0xd124('0xe')]+_0x546d63[_0xd124('0xf')]+_0x546d63[_0xd124('0x10')]+_0x546d63['countmachineretry']+_0x546d63['countagentrejectretry'];this['countnosuchnumberretry']=_0x546d63[_0xd124('0xe')];this['countdropretry']=_0x546d63[_0xd124('0xf')];this[_0xd124('0x10')]=_0x546d63[_0xd124('0x10')];this['countmachineretry']=_0x546d63[_0xd124('0x11')];this[_0xd124('0x12')]=_0x546d63[_0xd124('0x12')];this[_0xd124('0x13')]=_0x3d101d[_0xd124('0x13')];this[_0xd124('0x14')]=_0x546d63[_0xd124('0x15')];this['calleridnum']=_0x546d63[_0xd124('0x16')];this[_0xd124('0x17')]=_0x546d63[_0xd124('0x17')];this[_0xd124('0x18')]=_0x546d63['responsetime'];this['endtime']=moment()[_0xd124('0x19')](_0xd124('0x1a'));this[_0xd124('0x1b')]=getSeconds(_0x546d63[_0xd124('0x18')],_0x546d63[_0xd124('0x17')]);this[_0xd124('0x1c')]=0x0;this['talktime']=getSeconds(this[_0xd124('0x1d')],_0x546d63[_0xd124('0x18')]);this[_0xd124('0x9')]=_0x546d63['queue'];this[_0xd124('0x1e')]=_0xd124('0x1f');this['reason']=_0x3d101d['cause-txt'];this[_0xd124('0x20')]=_0x546d63[_0xd124('0x20')];this[_0xd124('0x21')]=_0x546d63['callbackuniqueid'];this[_0xd124('0x22')]=_0x546d63[_0xd124('0x22')];this[_0xd124('0x23')]=_0x546d63[_0xd124('0x23')];this[_0xd124('0x24')]=_0x546d63[_0xd124('0x24')];this[_0xd124('0x25')]=_0x546d63[_0xd124('0x25')];this[_0xd124('0x26')]=_0x546d63['UserId'];this[_0xd124('0x27')]=_0x546d63[_0xd124('0x27')];this[_0xd124('0x28')]=_0x546d63[_0xd124('0x28')];}module[_0xd124('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 2c97fb5..b7762bb 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 _0x38e2=['ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x38e2,0xff));var _0x238e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x38e2[_0x4a9fb1];return _0x348672;};'use strict';var util=require('util');var _=require(_0x238e('0x0'));var moment=require(_0x238e('0x1'));function getSeconds(_0x5665b7,_0x52cb1a){var _0x16dbdd=moment(_0x5665b7)[_0x238e('0x2')](0x0);var _0x57cbf9=moment(_0x52cb1a)['milliseconds'](0x0);return _0x16dbdd[_0x238e('0x3')](_0x57cbf9,_0x238e('0x4'));}function History(_0x34006b){this[_0x238e('0x5')]=_0x34006b[_0x238e('0x5')];this['scheduledat']=_0x34006b[_0x238e('0x6')]||undefined;this[_0x238e('0x7')]=_0x34006b[_0x238e('0x7')];this['campaigntype']=_0x34006b[_0x238e('0x7')]==='outbound'?_0x238e('0x8'):_0x34006b['type'];this['countbusyretry']=_0x34006b[_0x238e('0x9')];this[_0x238e('0xa')]=_0x34006b[_0x238e('0xa')];this['countnoanswerretry']=_0x34006b[_0x238e('0xb')];this[_0x238e('0xc')]=_0x34006b[_0x238e('0x9')]+_0x34006b[_0x238e('0xa')]+_0x34006b[_0x238e('0xb')]+_0x34006b['countnosuchnumberretry']+_0x34006b[_0x238e('0xd')]+_0x34006b['countabandonedretry']+_0x34006b[_0x238e('0xe')]+_0x34006b[_0x238e('0xf')];this[_0x238e('0x10')]=_0x34006b[_0x238e('0x10')];this[_0x238e('0xd')]=_0x34006b['countdropretry'];this[_0x238e('0x11')]=_0x34006b[_0x238e('0x11')];this['countmachineretry']=_0x34006b['countmachineretry'];this[_0x238e('0xf')]=_0x34006b[_0x238e('0xf')];this['queue']=_0x34006b[_0x238e('0x8')];this[_0x238e('0x12')]=_0x34006b[_0x238e('0x13')];this[_0x238e('0x14')]=_0x34006b[_0x238e('0x15')];this[_0x238e('0x16')]=_0x34006b[_0x238e('0x16')];this[_0x238e('0x17')]=_0x34006b['responsetime'];this[_0x238e('0x18')]=_0x34006b[_0x238e('0x17')];this[_0x238e('0x19')]=getSeconds(_0x34006b[_0x238e('0x17')],_0x34006b[_0x238e('0x16')]);this[_0x238e('0x1a')]=0x0;this[_0x238e('0x1b')]=0x0;this[_0x238e('0x1c')]=_0x34006b['callback'];this['callbackuniqueid']=_0x34006b[_0x238e('0x1d')];this[_0x238e('0x1e')]=_0x34006b[_0x238e('0x1e')];this['recallme']=_0x34006b[_0x238e('0x1f')];this[_0x238e('0x20')]=_0x34006b[_0x238e('0x20')];this[_0x238e('0x21')]=_0x34006b[_0x238e('0x21')];this[_0x238e('0x22')]=_0x34006b[_0x238e('0x22')];this[_0x238e('0x23')]=_0x34006b[_0x238e('0x23')];this[_0x238e('0x24')]=_0x34006b['CampaignId'];this[_0x238e('0x25')]=_0x34006b[_0x238e('0x25')]||'';this[_0x238e('0x26')]=_0x34006b['originatecalleridname']||'';}module[_0x238e('0x27')]=History; \ No newline at end of file +var _0xf301=['callbackuniqueid','callbackat','recallme','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','name','starttime','endtime','ringtime','responsetime','holdtime','talktime'];(function(_0x1d9b84,_0x409ab6){var _0x254e02=function(_0x10f297){while(--_0x10f297){_0x1d9b84['push'](_0x1d9b84['shift']());}};_0x254e02(++_0x409ab6);}(_0xf301,0xe6));var _0x1f30=function(_0x456068,_0x2669c7){_0x456068=_0x456068-0x0;var _0x2b8835=_0xf301[_0x456068];return _0x2b8835;};'use strict';var util=require(_0x1f30('0x0'));var _=require(_0x1f30('0x1'));var moment=require(_0x1f30('0x2'));function getSeconds(_0x2f177d,_0x33f6b1){var _0x412361=moment(_0x2f177d)[_0x1f30('0x3')](0x0);var _0xe890c3=moment(_0x33f6b1)[_0x1f30('0x3')](0x0);return _0x412361[_0x1f30('0x4')](_0xe890c3,_0x1f30('0x5'));}function History(_0x590fae){this[_0x1f30('0x6')]=_0x590fae[_0x1f30('0x6')];this[_0x1f30('0x7')]=_0x590fae['scheduledat']||undefined;this[_0x1f30('0x8')]=_0x590fae[_0x1f30('0x8')];this[_0x1f30('0x9')]=_0x590fae[_0x1f30('0x8')]===_0x1f30('0xa')?_0x1f30('0xb'):_0x590fae[_0x1f30('0x8')];this['countbusyretry']=_0x590fae['countbusyretry'];this[_0x1f30('0xc')]=_0x590fae[_0x1f30('0xc')];this[_0x1f30('0xd')]=_0x590fae[_0x1f30('0xd')];this[_0x1f30('0xe')]=_0x590fae[_0x1f30('0xf')]+_0x590fae['countcongestionretry']+_0x590fae[_0x1f30('0xd')]+_0x590fae[_0x1f30('0x10')]+_0x590fae['countdropretry']+_0x590fae[_0x1f30('0x11')]+_0x590fae[_0x1f30('0x12')]+_0x590fae[_0x1f30('0x13')];this[_0x1f30('0x10')]=_0x590fae['countnosuchnumberretry'];this['countdropretry']=_0x590fae[_0x1f30('0x14')];this[_0x1f30('0x11')]=_0x590fae[_0x1f30('0x11')];this[_0x1f30('0x12')]=_0x590fae[_0x1f30('0x12')];this[_0x1f30('0x13')]=_0x590fae[_0x1f30('0x13')];this[_0x1f30('0xb')]=_0x590fae[_0x1f30('0xb')];this[_0x1f30('0x15')]=_0x590fae[_0x1f30('0x16')];this['calleridnum']=_0x590fae['number'];this['starttime']=_0x590fae[_0x1f30('0x17')];this['responsetime']=_0x590fae['responsetime'];this[_0x1f30('0x18')]=_0x590fae['responsetime'];this[_0x1f30('0x19')]=getSeconds(_0x590fae[_0x1f30('0x1a')],_0x590fae[_0x1f30('0x17')]);this[_0x1f30('0x1b')]=0x0;this[_0x1f30('0x1c')]=0x0;this['callback']=_0x590fae['callback'];this['callbackuniqueid']=_0x590fae[_0x1f30('0x1d')];this[_0x1f30('0x1e')]=_0x590fae['callbackat'];this[_0x1f30('0x1f')]=_0x590fae[_0x1f30('0x1f')];this['ContactId']=_0x590fae['ContactId'];this['ListId']=_0x590fae['ListId'];this[_0x1f30('0x20')]=_0x590fae[_0x1f30('0x20')];this[_0x1f30('0x21')]=_0x590fae[_0x1f30('0x21')];this[_0x1f30('0x22')]=_0x590fae[_0x1f30('0x22')];this['originatecalleridnum']=_0x590fae[_0x1f30('0x23')]||'';this[_0x1f30('0x24')]=_0x590fae[_0x1f30('0x24')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index cc78ddc..34954dc 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 _0xa9fc=['isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','error','inspect','stack','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','loopClearZombieChannels','clearZombieChannels','uniqueId','[uniqueid]','[actions]','prototype','isNil','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','then','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','resolve','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','uniqueid','HangupInAMD','AMD','emit','custom:amd','amd','[syncHangupInAMD]','value','MACHINE','Machine','membername','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','reason\x2019\x20machine....','add','YYYY-MM-DD\x20HH:mm:ss','HANGUP','[syncHangupInAMDIvr][createHistory]','stateGlobal','dialMachineMaxRetry','createStateFinal','minutes','[rescheduleContact][Machine]','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','Unknow','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','Drop','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','queueCallerAbandonCreateState','[syncAgentComplete][createHistory][11]','actionid','roundrobin','locked','paused','stateinterface','push','pick','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','Action','command','interval','iftime\x20%s,%s','content','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialTimezone','checkDialMethod','[syncQueueSummary]','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','dialer','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','substring','dialCutDigit','from-sip','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][Abandoned]','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','reason\x2020\x20agentreject','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','floor','predictiveIntervalHitRate','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','booked','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','inBlackList','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkContactBlack','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','Contact.phone','tryOriginatePredictive','[handlePredictive][limitChannel]','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','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','p\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','[busyFactor]','Ts\x20=\x20','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','ioredis','../../../config/environment/','../../../config/logger','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','newexten','syncNewExten','varset','queuemember','queuestatuscomplete','syncQueueStatusComplete','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','stringify','milliseconds','diff','seconds','type','outbound','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','Trunk','active','callerid','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------'];(function(_0x219f6c,_0x5f1f22){var _0x2d0be7=function(_0x11f345){while(--_0x11f345){_0x219f6c['push'](_0x219f6c['shift']());}};_0x2d0be7(++_0x5f1f22);}(_0xa9fc,0x19f));var _0xca9f=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0xa9fc[_0x31a576];return _0x30b1d3;};'use strict';var util=require(_0xca9f('0x0'));var _=require(_0xca9f('0x1'));var BPromise=require(_0xca9f('0x2'));var uuid=require(_0xca9f('0x3'));var moment=require(_0xca9f('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xca9f('0x5'));var ut=require('../preview/util/util');var config=require(_0xca9f('0x6'));var logger=require(_0xca9f('0x7'))('dialer');var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require(_0xca9f('0x7'))('predictive');var loggerPredictiveCalls=require(_0xca9f('0x7'))(_0xca9f('0x8'));var loggerSyncQueueSummary=require(_0xca9f('0x7'))(_0xca9f('0x9'));var ami=require(_0xca9f('0xa'));config[_0xca9f('0xb')]=_[_0xca9f('0xc')](config[_0xca9f('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xca9f('0xd'))(new Redis(config[_0xca9f('0xb')]));var cmHopper=require(_0xca9f('0xe'));var cmHopperHistory=require(_0xca9f('0xf'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperAdditionalPhone=require(_0xca9f('0x10'));var cmHopperBlack=require(_0xca9f('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xca9f('0x12'));var History=require(_0xca9f('0x13'));var Final=require(_0xca9f('0x14'));var AgentComplete=require(_0xca9f('0x15'));var QueueCallerAbandon=require(_0xca9f('0x16'));var Hangup=require(_0xca9f('0x17'));var ipAgi=process[_0xca9f('0x18')][_0xca9f('0x19')]||_0xca9f('0x1a');var strategy={'rrmemory':_0xca9f('0x1b'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype'][_0xca9f('0x1c')]=function(_0x5ec217){this['tail']=this[_0xca9f('0x1d')]?this[_0xca9f('0x1d')]['finally'](_0x5ec217):_0x5ec217();};function Dialer(_0x4afedf,_0x49060d){this[_0xca9f('0x1e')]=new Sequence();this['preview']=_0x49060d;this[_0xca9f('0x1f')]=_0x4afedf[_0xca9f('0x1f')];this[_0xca9f('0x20')]=_0x4afedf[_0xca9f('0x20')];this[_0xca9f('0x21')]=_0x4afedf['agents'];this[_0xca9f('0x22')]=_0x4afedf['trunks'];this[_0xca9f('0x23')]=config[_0xca9f('0x23')]||0x2;this[_0xca9f('0x24')]={};this[_0xca9f('0x25')]={};this[_0xca9f('0x26')]={};this['uniqueId']={};this[_0xca9f('0x27')]={};this[_0xca9f('0x28')]={};this[_0xca9f('0x29')]={};this[_0xca9f('0x2a')]={};this[_0xca9f('0x2b')]={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0xca9f('0x2c')][_0xca9f('0x2d')](this));ami['on'](_0xca9f('0x2e'),this[_0xca9f('0x2f')][_0xca9f('0x2d')](this));ami['on']('originateresponse',this[_0xca9f('0x30')][_0xca9f('0x2d')](this));ami['on'](_0xca9f('0x31'),this['syncAgentComplete'][_0xca9f('0x2d')](this));ami['on'](_0xca9f('0x32'),this[_0xca9f('0x9')][_0xca9f('0x2d')](this));ami['on'](_0xca9f('0x33'),this['syncHangup'][_0xca9f('0x2d')](this));ami['on'](_0xca9f('0x34'),this[_0xca9f('0x35')][_0xca9f('0x2d')](this));ami['on'](_0xca9f('0x36'),this['syncVarSet']['bind'](this));ami['on'](_0xca9f('0x37'),this['syncQueueMember'][_0xca9f('0x2d')](this));ami['on'](_0xca9f('0x38'),this[_0xca9f('0x39')][_0xca9f('0x2d')](this));this['loopCampaigns']();this['loopClearZombieChannels']();}function isNotNull(_0xf153c8){return _0xf153c8!==null&&!_['isUndefined'](_0xf153c8);}function checkIsLoggedIn(_0x26b33d,_0x54beae){return function(){if(_0x54beae<=0x0){_0x26b33d[_0xca9f('0x3a')]=_0xca9f('0x3b');throw _0x26b33d[_0xca9f('0x3c')]+_0xca9f('0x3d');}};}function isActive(_0x282dc4){return _0x282dc4;}function checkIsActive(_0x1c9138,_0x4f9368){return function(){if(!isActive(_0x4f9368)){_0x1c9138['message']=_0xca9f('0x3e');throw _0x1c9138['name']+_0xca9f('0x3f');}};}function checkInterval(_0x33a9d5){return function(){if(!isNotNull(_0x33a9d5[_0xca9f('0x40')])){_0x33a9d5['message']='INTERVAL_IS_NULL';throw _0x33a9d5[_0xca9f('0x3c')]+_0xca9f('0x41');}if(!isNotNull(_0x33a9d5[_0xca9f('0x40')]['Intervals'])){_0x33a9d5[_0xca9f('0x3a')]=_0xca9f('0x42');throw _0x33a9d5['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xca9f('0x43')](_0x33a9d5[_0xca9f('0x40')][_0xca9f('0x44')]))){_0x33a9d5[_0xca9f('0x3a')]=_0xca9f('0x42');throw _0x33a9d5[_0xca9f('0x3c')]+_0xca9f('0x41');}};}function msgResponse(_0x28b5f9,_0xaa5f8f,_0x3d3be3){return{'action':_0x28b5f9,'response':_0xaa5f8f,'message':_0x3d3be3,'stack':_0x3d3be3};}function myreject(_0x2e9d94){return function(_0x46339a){return _0x2e9d94(msgResponse(_0xca9f('0x45'),'Error',JSON[_0xca9f('0x46')](_0x46339a)));};}function getSeconds(_0x49f65e,_0xfda8b0){var _0x282b8e=moment(_0x49f65e)['milliseconds'](0x0);var _0x6ba7ba=moment(_0xfda8b0)[_0xca9f('0x47')](0x0);return _0x282b8e[_0xca9f('0x48')](_0x6ba7ba,_0xca9f('0x49'));}function emit(_0x2644bf,_0x57ae73,_0x4e8fda){io['to'](_0x2644bf)['emit'](_0x57ae73,_0x4e8fda);}function emitVoiceQueueSummary(_0x4643a2){if(_0x4643a2[_0xca9f('0x4a')]===_0xca9f('0x4b')){var _0x557dff={'id':_0x4643a2['id'],'name':_0x4643a2[_0xca9f('0x3c')],'strategy':_0x4643a2[_0xca9f('0x4c')],'answered':_0x4643a2['answered'],'available':_0x4643a2[_0xca9f('0x4d')],'loggedIn':_0x4643a2[_0xca9f('0x4e')],'pTalking':_0x4643a2['pTalking'],'sumBillable':_0x4643a2[_0xca9f('0x4f')],'sumDuration':_0x4643a2[_0xca9f('0x50')],'sumHoldTime':_0x4643a2[_0xca9f('0x51')]||0x0,'talking':_0x4643a2[_0xca9f('0x52')],'total':_0x4643a2[_0xca9f('0x53')],'type':_0x4643a2['type'],'unmanaged':_0x4643a2[_0xca9f('0x54')],'abandoned':_0x4643a2[_0xca9f('0x55')],'waiting':_0x4643a2['waiting'],'loggedInDb':_0x4643a2[_0xca9f('0x56')],'dialActive':_0x4643a2[_0xca9f('0x57')],'dialMethod':_0x4643a2[_0xca9f('0x58')],'dialOriginateCallerIdName':_0x4643a2[_0xca9f('0x59')],'dialOriginateCallerIdNumber':_0x4643a2[_0xca9f('0x5a')],'dialOriginateTimeout':_0x4643a2[_0xca9f('0x5b')],'dialPrefix':_0x4643a2[_0xca9f('0x5c')],'outboundAnswerAgiCallsDay':_0x4643a2[_0xca9f('0x5d')],'outboundAnswerCallsDay':_0x4643a2[_0xca9f('0x5e')],'outboundBlacklistCallsDay':_0x4643a2[_0xca9f('0x5f')],'outboundBusyCallsDay':_0x4643a2[_0xca9f('0x60')],'outboundCongestionCallsDay':_0x4643a2[_0xca9f('0x61')],'outboundDropCallsDayACS':_0x4643a2['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4643a2[_0xca9f('0x62')],'outboundDropCallsDayTimeout':_0x4643a2[_0xca9f('0x63')],'outboundNoAnswerCallsDay':_0x4643a2[_0xca9f('0x64')],'outboundNoSuchCallsDay':_0x4643a2[_0xca9f('0x65')],'outboundOriginateFailureCallsDay':_0x4643a2[_0xca9f('0x66')],'outboundReCallsDay':_0x4643a2['outboundReCallsDay'],'outboundRejectCallsDay':_0x4643a2['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4643a2[_0xca9f('0x67')],'predictiveIntervalAnsweredCalls':_0x4643a2['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x4643a2[_0xca9f('0x68')],'predictiveIntervalAvgTalktime':_0x4643a2[_0xca9f('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x4643a2[_0xca9f('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x4643a2[_0xca9f('0x6b')],'predictiveIntervalErlangCalls':_0x4643a2[_0xca9f('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x4643a2[_0xca9f('0x6d')],'predictiveIntervalHitRate':_0x4643a2['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4643a2[_0xca9f('0x6e')],'predictiveIntervalPauses':_0x4643a2[_0xca9f('0x6f')],'predictiveIntervalAvailable':_0x4643a2['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x4643a2[_0xca9f('0x70')],'message':_0x4643a2[_0xca9f('0x3a')],'originated':_0x4643a2[_0xca9f('0x71')],'erlangCalls':_0x4643a2[_0xca9f('0x72')],'erlangCallToSecond':_0x4643a2['erlangCallToSecond'],'erlangAbandonmentRate':_0x4643a2[_0xca9f('0x73')],'erlangBusyFactor':_0x4643a2['erlangBusyFactor'],'startPredictive':_0x4643a2[_0xca9f('0x28')],'startProgressive':_0x4643a2[_0xca9f('0x29')]};if(_0x4643a2[_0xca9f('0x74')]){_0x557dff[_0xca9f('0x74')]={'id':_0x4643a2['Trunk']['id'],'name':_0x4643a2['Trunk']['name'],'active':_0x4643a2[_0xca9f('0x74')][_0xca9f('0x75')],'callerid':_0x4643a2[_0xca9f('0x74')][_0xca9f('0x76')]};}if(_0x4643a2[_0xca9f('0x40')]){_0x557dff[_0xca9f('0x40')]={'id':_0x4643a2[_0xca9f('0x40')]['id'],'name':_0x4643a2[_0xca9f('0x40')][_0xca9f('0x3c')]};}var _0x14bcb6=md5(JSON['stringify'](_0x557dff));if(_0x4643a2[_0xca9f('0x77')]!==_0x14bcb6){_0x4643a2['md5']=_0x14bcb6;emit(util[_0xca9f('0x78')](_0xca9f('0x79'),_0x557dff['name']),_0xca9f('0x7a'),_0x557dff);}}}function emitCampaignSummary(_0x34fcf1){if(_0x34fcf1[_0xca9f('0x4a')]===_0xca9f('0x7b')){emit(util[_0xca9f('0x78')](_0xca9f('0x7c'),_0x34fcf1[_0xca9f('0x3c')]),_0xca9f('0x7d'),_0x34fcf1);}}function checkGetDataPredictive(_0x599e2d){if(isNotNull(_0x599e2d)&&!_['isEmpty'](_0x599e2d)){loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x7f'));loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x80'),_0x599e2d[_0xca9f('0x70')]);loggerPredictive[_0xca9f('0x7e')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x599e2d[_0xca9f('0x81')]);loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x82'),_0x599e2d['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x83'),_0x599e2d['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info'](_0xca9f('0x84'),_0x599e2d[_0xca9f('0x68')]);loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x85'),_0x599e2d[_0xca9f('0x69')]);loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x86'));if(_0x599e2d[_0xca9f('0x70')]>0x0){if(!_[_0xca9f('0x87')](_0x599e2d[_0xca9f('0x69')])&&_0x599e2d[_0xca9f('0x69')]>0x0){return!![];}loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x88'));if(!_[_0xca9f('0x87')](_0x599e2d[_0xca9f('0x68')])&&_0x599e2d[_0xca9f('0x68')]>0x0){return!![];}loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x89'));}else{loggerPredictive['info'](_0xca9f('0x8a'));}}else{loggerPredictive[_0xca9f('0x7e')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x5c8119){return function(_0x5ac9ed){loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x8b'));loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x8c'),_0x5ac9ed[_0xca9f('0x72')]);loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x8d'),_0x5ac9ed[_0xca9f('0x8e')]);loggerPredictive[_0xca9f('0x7e')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ac9ed[_0xca9f('0x73')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ac9ed['erlangBusyFactor']);loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x8f'),_0x5ac9ed[_0xca9f('0x73')]);loggerPredictive['info']('---------------------------');_[_0xca9f('0x90')](_0x5c8119,_0x5ac9ed);};}function getDiff(_0x386bd1){var _0x5d1638=moment()['milliseconds'](0x0);var _0x228c14=moment(_0x386bd1)[_0xca9f('0x47')](0x0);return _0x5d1638['diff'](_0x228c14,_0xca9f('0x49'));}function ifInterval(_0x159611,_0x5a9fb3){if(_['isUndefined'](_0x5a9fb3)){return![];}return getDiff(_0x5a9fb3)<_0x159611*0x3c;}function freeVariablesPredictive(_0x367a01){if(isNotNull(_0x367a01)){if(!_[_0xca9f('0x87')](_0x367a01['startProgressive'])){_0x367a01[_0xca9f('0x29')]=undefined;loggerPredictive['info'](_0x367a01['name'],_0xca9f('0x91'));}if(!_['isUndefined'](_0x367a01['startPredictive'])){_0x367a01[_0xca9f('0x28')]=undefined;loggerPredictive[_0xca9f('0x7e')](_0x367a01[_0xca9f('0x3c')],_0xca9f('0x92'));}if(!_['isUndefined'](_0x367a01[_0xca9f('0x93')])){clearInterval(_0x367a01[_0xca9f('0x93')]);_0x367a01['handlePredictive']=undefined;loggerPredictive[_0xca9f('0x7e')](_0x367a01[_0xca9f('0x3c')],_0xca9f('0x94'));}}}function erlangb(_0x50afd2,_0x2236fa){if(_0x2236fa===0x0){return 0x0;}var _0x2c6a70=0x1;for(var _0x158ae1=0x1;_0x158ae1<=_0x2236fa;_0x158ae1+=0x1){_0x2c6a70=0x1+_0x2c6a70*_0x158ae1/_0x50afd2;}return 0x1/_0x2c6a70;}function isVoiceQueueOutbound(_0x5080cd){return _0x5080cd===_0xca9f('0x4b');}function isNotPreview(_0xb3db81){return _0xb3db81!==_0xca9f('0x95');}function isCampaignIvr(_0x1c55bc){return _0x1c55bc===_0xca9f('0x7b');}function getCallerId(_0x465d3d,_0x2544d7,_0x5254b6){if(!_[_0xca9f('0x87')](_0x5254b6)&&typeof _0x5254b6==='string'&&!_['isEmpty'](_0x5254b6)){if(!_['isUndefined'](_0x2544d7)&&typeof _0x2544d7==='string'&&!_['isEmpty'](_0x2544d7)){return util[_0xca9f('0x78')]('\x22%s\x22\x20<%s>',_0x2544d7,_0x5254b6);}return util['format']('\x22%s\x22\x20<%s>',_0x5254b6,_0x5254b6);}if(!_[_0xca9f('0x87')](_0x465d3d)&&typeof _0x465d3d==='string'&&!_[_0xca9f('0x43')](_0x465d3d)){return _0x465d3d;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x4f4628,_0x435d20){return function(_0x52cf7c){freeVariablesPredictive(_0x435d20);emitVoiceQueueSummary(_0x435d20);emitCampaignSummary(_0x435d20);loggerSyncQueueSummary[_0xca9f('0x96')](_0x4f4628,util[_0xca9f('0x97')](_0x52cf7c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x396eab,_0x2f5368){return function(_0x23881b){loggerPredictive[_0xca9f('0x96')](_0x2f5368[_0xca9f('0x3c')],_0x396eab);loggerPredictive[_0xca9f('0x96')](_0x23881b[_0xca9f('0x98')]);freeVariablesPredictive(_0x2f5368);};}function loggerCatch(_0xa0d5e1){return function(_0x1d83ca){logger[_0xca9f('0x96')](_0xa0d5e1,util[_0xca9f('0x97')](_0x1d83ca,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xb48c29){return _0xb48c29&&!_[_0xca9f('0x87')](_0xb48c29)&&_0xb48c29['length']>0x0;}function decremetOriginate(_0x17a592){if(!_['isUndefined'](_0x17a592)&&_0x17a592!==null){if(typeof _0x17a592[_0xca9f('0x71')]!==_0xca9f('0x99')){if(_0x17a592[_0xca9f('0x71')]>0x0){_0x17a592['originated']-=0x1;}else{logger[_0xca9f('0x96')](_0xca9f('0x9a'));}}}else{logger[_0xca9f('0x96')](_0xca9f('0x9b'));}}function checkContactLowerLimitOriginate(_0x352e72,_0x563595,_0x2b69b5){if(_0x563595>_0x2b69b5){for(var _0x394832=0x0;_0x394832<_0x563595-_0x2b69b5;_0x394832+=0x1){decremetOriginate(_0x352e72);}}}function loggerGetContactDialer(_0xc84c0b,_0x25db8c,_0x3158dc){return function(_0x55c421){checkContactLowerLimitOriginate(_0x25db8c,_0x3158dc,0x0);logger[_0xca9f('0x96')](_0xc84c0b,util[_0xca9f('0x97')](_0x55c421,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x241ae2){return function(_0x2121de){if(isNotNull(_0x2121de)&&isNotNull(_0x2121de[0x0])){if(_0x2121de[0x0][_0xca9f('0x9c')]>0x0){_0x241ae2[_0xca9f('0x3a')]=_0xca9f('0x9d');logger[_0xca9f('0x7e')](_0xca9f('0x9e')+_0x241ae2[_0xca9f('0x3c')],_0x2121de[0x0][_0xca9f('0x9c')],'contacts');}else{_0x241ae2[_0xca9f('0x3a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xca9f('0x7e')](_0xca9f('0x9f')+_0x241ae2[_0xca9f('0x3c')]);}}};}function notSendMessagesQueue(_0x17dc92){if(_0x17dc92[_0xca9f('0xa0')]){freeVariablesPredictive(_0x17dc92);if(_0x17dc92[_0xca9f('0x71')]===0x0&&_0x17dc92[_0xca9f('0x52')]===0x0&&_0x17dc92[_0xca9f('0xa1')]===0x0&&(_0x17dc92[_0xca9f('0xa2')]||0x0)===0x0){_0x17dc92[_0xca9f('0xa0')]=![];_0x17dc92[_0xca9f('0x4d')]=0x0;_0x17dc92['message']=_0xca9f('0x3e');loggerSyncQueueSummary[_0xca9f('0x96')](_0xca9f('0xa3'),_0x17dc92[_0xca9f('0x3c')],_0xca9f('0xa4'));}else{_0x17dc92[_0xca9f('0x3a')]=_0xca9f('0xa5');loggerSyncQueueSummary['error'](_0xca9f('0xa3'),_0x17dc92[_0xca9f('0x3c')],_0xca9f('0xa6'));}emitVoiceQueueSummary(_0x17dc92);}}function notSendMessagesCampaign(_0x872534){if(_0x872534['sendMessageOneNotActive']){if(_0x872534[_0xca9f('0x71')]===0x0){_0x872534[_0xca9f('0xa0')]=![];_0x872534['message']=_0xca9f('0x3e');loggerSyncQueueSummary['error'](_0xca9f('0xa7'),_0x872534['name'],_0xca9f('0xa4'));}else{_0x872534[_0xca9f('0x3a')]='IS_DISACTIVED';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x872534[_0xca9f('0x3c')],_0xca9f('0xa6'));}emitCampaignSummary(_0x872534);}}function createObjHistory(_0x21e802,_0x19908b,_0x1605ad,_0xe936f1,_0x566827){_0x21e802[_0xca9f('0x3a')]=_0x1605ad;var _0x4a5fa2=new Action(_0x21e802,_0x19908b);var _0x1d3441=new History(_0x4a5fa2);_0x1d3441[_0xca9f('0xa8')]=_0xe936f1;_0x1d3441[_0xca9f('0xa9')]=_0x566827;_0x1d3441[_0xca9f('0xaa')]=_0x4a5fa2[_0xca9f('0xab')];return _0x1d3441;}Dialer['prototype'][_0xca9f('0xac')]=function(){var _0x26e4c5=this;setInterval(function(){_0x26e4c5[_0xca9f('0xad')](_0x26e4c5[_0xca9f('0xae')],_0xca9f('0xaf'));_0x26e4c5[_0xca9f('0xad')](_0x26e4c5[_0xca9f('0x25')],_0xca9f('0xb0'));},0x32c8);};Dialer[_0xca9f('0xb1')][_0xca9f('0xad')]=function(_0x529853,_0x42dbaf){var _0x3c0d5a=this;for(var _0x59625b in _0x529853){if(typeof _0x529853[_0x59625b]!=='undefined'){this[_0xca9f('0x1e')][_0xca9f('0x1c')](function(){if(!_[_0xca9f('0xb2')](_0x529853[_0x59625b])){return ami['Action']({'action':_0xca9f('0xb3'),'channel':_0x529853[_0x59625b][_0xca9f('0xb4')]})[_0xca9f('0xb5')](function(_0x46db44){if(_0x46db44[_0xca9f('0x3a')]===_0xca9f('0xb6')){setTimeout(function(){if(_0x529853[_0x59625b]&&_0x529853[_0x59625b][_0xca9f('0x4a')]!==_0xca9f('0x7b')){_0x3c0d5a[_0xca9f('0xb7')](_0x3c0d5a[_0xca9f('0x1f')][_0x529853[_0x59625b][_0xca9f('0xb8')]]);logger[_0xca9f('0x96')]('[Dialer][checkChannel]',_0x42dbaf,_0x59625b,_0x529853[_0x59625b][_0xca9f('0xb8')]);delete _0x529853[_0x59625b];}if(_0x529853[_0x59625b]&&_0x529853[_0x59625b]['type']==='ivr'){_0x3c0d5a['updateOriginated'](_0x3c0d5a[_0xca9f('0x20')][_0x529853[_0x59625b]['queue']]);logger[_0xca9f('0x96')](_0xca9f('0xb9'),_0x42dbaf,_0x59625b,_0x529853[_0x59625b][_0xca9f('0xb8')]);delete _0x529853[_0x59625b];}},0x2328);}});}});}}};Dialer[_0xca9f('0xb1')]['countReScheduled']=function(_0x536fe0){return BPromise['resolve']()['then'](cmHopper[_0xca9f('0xba')](_0x536fe0))[_0xca9f('0xb5')](loggerCatch(_0xca9f('0xbb')));};Dialer['prototype']['checkIsBlackList']=function(_0xde4b27){return BPromise['resolve']()[_0xca9f('0xbc')](cmHopperBlack[_0xca9f('0xbd')](_0xde4b27))[_0xca9f('0xb5')](loggerCatch(_0xca9f('0xbe')));};Dialer[_0xca9f('0xb1')][_0xca9f('0xbf')]=function(_0x53e379,_0x3138a7,_0x128cab){return BPromise['resolve']()[_0xca9f('0xbc')](cmHopperAdditionalPhone[_0xca9f('0xbf')](_0x53e379,_0x3138a7,_0x128cab))[_0xca9f('0xb5')](loggerCatch(_0xca9f('0xc0')));};Dialer[_0xca9f('0xb1')][_0xca9f('0xc1')]=function(_0x1c616e,_0x30384d,_0xd101ae){return BPromise[_0xca9f('0xc2')]()[_0xca9f('0xbc')](cmHopperAdditionalPhone[_0xca9f('0xc1')](_0x1c616e,_0x30384d,_0xd101ae))[_0xca9f('0xb5')](loggerCatch(_0xca9f('0xc3')));};Dialer[_0xca9f('0xb1')][_0xca9f('0xc4')]=function(_0x570a1f){return BPromise[_0xca9f('0xc2')]()[_0xca9f('0xbc')](cmHopperBlack[_0xca9f('0xc4')](_0x570a1f))[_0xca9f('0xb5')](loggerCatch(_0xca9f('0xc5')));};Dialer['prototype'][_0xca9f('0xc6')]=function(_0x2b5ed8){return BPromise[_0xca9f('0xc2')]()['then'](cmHopperHistory['avgHandleTime'](_0x2b5ed8))['catch'](loggerCatch(_0xca9f('0xc7')));};Dialer['prototype'][_0xca9f('0xc8')]=function(_0x2ac70d){return BPromise[_0xca9f('0xc2')]()[_0xca9f('0xbc')](cmHopper[_0xca9f('0xc8')](_0x2ac70d))['catch'](loggerCatch(_0xca9f('0xc9')));};Dialer[_0xca9f('0xb1')][_0xca9f('0xca')]=function(_0x5260d7,_0x577356,_0x303468){return BPromise[_0xca9f('0xc2')]()[_0xca9f('0xbc')](cmHopper[_0xca9f('0xca')](_0x5260d7,_0x577356,_0x303468))[_0xca9f('0xb5')](loggerCatch(_0xca9f('0xcb')));};Dialer[_0xca9f('0xb1')][_0xca9f('0xcc')]=function(_0x3021e7,_0x340048,_0x44a171,_0x2b639a,_0x1289da){return BPromise[_0xca9f('0xc2')]()[_0xca9f('0xbc')](cmHopper[_0xca9f('0xcc')](_0x3021e7,_0x340048,_0x44a171,_0x2b639a))[_0xca9f('0xb5')](function(_0x5bd3f0){_0x1289da[_0xca9f('0xcd')]-=_0x44a171;_0x1289da[_0xca9f('0xcd')]=_0x1289da['temp']>0x0?_0x1289da[_0xca9f('0xcd')]:0x0;loggerCatch(_0xca9f('0xce'))(_0x5bd3f0);});};Dialer['prototype']['getContactDialerIvr']=function(_0x4e57f0,_0x375852,_0x4da2c3,_0x20dd4b){return BPromise[_0xca9f('0xc2')]()[_0xca9f('0xbc')](cmHopper[_0xca9f('0xcf')](_0x4e57f0,_0x375852,_0x4da2c3))['catch'](function(_0x558568){_0x20dd4b['temp']-=_0x375852;_0x20dd4b[_0xca9f('0xcd')]=_0x20dd4b[_0xca9f('0xcd')]>0x0?_0x20dd4b['temp']:0x0;loggerCatch(_0xca9f('0xd0'))(_0x558568);});};Dialer[_0xca9f('0xb1')][_0xca9f('0xd1')]=function(_0x270c63){return BPromise['resolve']()[_0xca9f('0xbc')](voiceQueueRt[_0xca9f('0xd1')](_0x270c63))[_0xca9f('0xb5')](loggerCatch(_0xca9f('0xd2')));};Dialer[_0xca9f('0xb1')][_0xca9f('0xd3')]=function(_0x1bc4f1){return BPromise[_0xca9f('0xc2')]()['then'](cmHopper[_0xca9f('0xd3')](_0x1bc4f1))[_0xca9f('0xb5')](loggerCatch(_0xca9f('0xd4')));};Dialer[_0xca9f('0xb1')][_0xca9f('0xd5')]=function(_0x4991b4){return BPromise[_0xca9f('0xc2')]()['then'](cmHopperHistory[_0xca9f('0xd5')](_0x4991b4))['catch'](loggerCatch(_0xca9f('0xd6')));};Dialer[_0xca9f('0xb1')][_0xca9f('0xb7')]=function(_0x4d10d0){if(!_['isUndefined'](_0x4d10d0)&&_0x4d10d0!==null){if(typeof _0x4d10d0[_0xca9f('0x71')]!=='undefined'){if(_0x4d10d0[_0xca9f('0x71')]>0x0){_0x4d10d0[_0xca9f('0x71')]-=0x1;}else{logger[_0xca9f('0x96')](_0xca9f('0xd7'));}}}else{logger[_0xca9f('0x96')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xca9f('0xb1')]['loggerHandler']=function(_0x703ed5,_0x2c103a){var _0x3c5de2=this;return function(_0x503eaf){_0x3c5de2[_0xca9f('0xb7')](_0x2c103a);logger[_0xca9f('0x96')](_0x703ed5,util[_0xca9f('0x97')](_0x503eaf,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x433ea3,_0x5ca580,_0x7a98f8){var _0x3ac901={'state':0x19,'statedesc':_0xca9f('0xd8')};this['updateOriginated'](_0x5ca580);this[_0xca9f('0xd9')](_[_0xca9f('0x90')](_0x3ac901,_['pick'](_0x7a98f8,[_0xca9f('0xda'),_0xca9f('0xdb'),_0xca9f('0xdc'),_0xca9f('0xdd'),_0xca9f('0xde')])),_0xca9f('0xdf'),_0xca9f('0xe0'));logger[_0xca9f('0x96')](_0x433ea3);};Dialer[_0xca9f('0xb1')][_0xca9f('0xe1')]=function(_0x218b2c){return _0x218b2c===_0xca9f('0xe2');};Dialer[_0xca9f('0xb1')][_0xca9f('0xe3')]=function(_0x5af2cd){return!_[_0xca9f('0x87')](_0x5af2cd)&&_0x5af2cd&&!_[_0xca9f('0x87')](_0x5af2cd[_0xca9f('0x3c')])&&!_[_0xca9f('0x87')](_0x5af2cd[_0xca9f('0x75')])&&_0x5af2cd[_0xca9f('0x75')]&&(this[_0xca9f('0x22')][util[_0xca9f('0x78')](_0xca9f('0xe4'),_0x5af2cd['name'])][_0xca9f('0xb3')]===_0xca9f('0xe5')||this[_0xca9f('0x22')][util[_0xca9f('0x78')](_0xca9f('0xe4'),_0x5af2cd[_0xca9f('0x3c')])]['status']==='unmonitored');};Dialer[_0xca9f('0xb1')][_0xca9f('0xd9')]=function(_0x5cf8fa,_0x480126,_0x31e9ed){this['createHistory'](_0x5cf8fa)['catch'](loggerCatch(_0x480126));this['moveContactManagedDialer'](_0x5cf8fa)['catch'](loggerCatch(_0x31e9ed));};Dialer[_0xca9f('0xb1')][_0xca9f('0xe6')]=function(_0x3bfae5){var _0x5f4cad=this[_0xca9f('0xae')][_0x3bfae5['uniqueid']];var _0x2d73a9;if(!_[_0xca9f('0xb2')](_0x3bfae5)&&!_[_0xca9f('0xb2')](_0x3bfae5[_0xca9f('0xe7')])&&!_[_0xca9f('0xb2')](_0x3bfae5['variable'][_0xca9f('0xe8')])&&_0x3bfae5[_0xca9f('0xe9')]===_0xca9f('0xea')&&_0x5f4cad){if(_0x5f4cad[_0xca9f('0x4a')]!==_0xca9f('0x7b')&&this[_0xca9f('0x1f')][_0x5f4cad['queue']][_0xca9f('0xeb')]&&_0x3bfae5['value']==='HANGUP'){delete this['uniqueId'][_0x3bfae5[_0xca9f('0xec')]];this[_0xca9f('0xb7')](this[_0xca9f('0x1f')][_0x5f4cad[_0xca9f('0xb8')]]);this[_0xca9f('0x1f')][_0x5f4cad[_0xca9f('0xb8')]][_0xca9f('0x5e')]+=0x1;this[_0xca9f('0x1f')][_0x5f4cad[_0xca9f('0xb8')]][_0xca9f('0x5d')]+=0x1;_0x2d73a9=new Hangup(_0x5f4cad,_0x3bfae5);_0x2d73a9[_0xca9f('0xa8')]=0x12;_0x2d73a9[_0xca9f('0xa9')]=_0xca9f('0xed');_0x2d73a9['membername']=_0xca9f('0xee');ami[_0xca9f('0xef')](_0xca9f('0xf0'),ut['buildObj'](_0x2d73a9,_0xca9f('0xf1')));this['saveInDb'](_0x2d73a9,'[syncHangupInAMD][createHistory]',_0xca9f('0xf2'));}if(_0x5f4cad[_0xca9f('0x4a')]!=='ivr'&&this['voiceQueues'][_0x5f4cad[_0xca9f('0xb8')]]['dialAMDActive']&&_0x3bfae5[_0xca9f('0xf3')]===_0xca9f('0xf4')){var _0xb4558a=this;return new BPromise(function(_0x582663,_0x125e3f){delete _0xb4558a[_0xca9f('0xae')][_0x3bfae5[_0xca9f('0xec')]];_0xb4558a[_0xca9f('0xb7')](_0xb4558a['voiceQueues'][_0x5f4cad[_0xca9f('0xb8')]]);_0xb4558a[_0xca9f('0x1f')][_0x5f4cad[_0xca9f('0xb8')]][_0xca9f('0x5e')]+=0x1;_0xb4558a[_0xca9f('0x1f')][_0x5f4cad['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0xaa338b=_0xb4558a['voiceQueues'][_0x5f4cad['queue']];var _0x284993=new Hangup(_0x5f4cad,_0x3bfae5);_0x284993[_0xca9f('0xa8')]=0x13;_0x284993[_0xca9f('0xa9')]=_0xca9f('0xf5');_0x284993[_0xca9f('0xf6')]=_0xca9f('0xee');_0x284993['countmachineretry']+=0x1;_0x284993[_0xca9f('0xf7')]+=0x1;_0x284993[_0xca9f('0xf1')]=!![];ami[_0xca9f('0xef')](_0xca9f('0xf0'),ut[_0xca9f('0xf8')](_0x284993,_0xca9f('0xf1')));_0xb4558a[_0xca9f('0xd5')](_0x284993)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0xf9')));if(_0x284993[_0xca9f('0xfa')]+_0x284993[_0xca9f('0xfb')]+_0x284993[_0xca9f('0xfc')]+_0x284993[_0xca9f('0xfd')]+_0x284993[_0xca9f('0xfe')]+_0x284993[_0xca9f('0xff')]+_0x284993[_0xca9f('0x100')]+_0x284993[_0xca9f('0x101')]>=_0xaa338b[_0xca9f('0x102')]){_0xb4558a['stateGlobal'](_0x284993,_0x582663,_0x125e3f,_0xca9f('0x103'));}else{if(_0x284993[_0xca9f('0x100')]>=_0xaa338b['dialMachineMaxRetry']){_0xb4558a['createStateFinal'](_0x284993,_0x582663,_0x125e3f,_0xca9f('0x104'));}else{_0xb4558a[_0xca9f('0xc8')]({'active':![],'countmachineretry':_0x284993[_0xca9f('0x100')],'scheduledat':moment()[_0xca9f('0x105')](_0xaa338b['dialMachineRetryFrequency'],'minutes')[_0xca9f('0x78')](_0xca9f('0x106')),'ContactId':_0x284993[_0xca9f('0xda')],'ListId':_0x284993['ListId'],'VoiceQueueId':_0x284993['VoiceQueueId']||undefined,'CampaignId':_0x284993['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x582663({'reschedule':0x1});}}});}if(_0x5f4cad[_0xca9f('0x4a')]===_0xca9f('0x7b')&&this[_0xca9f('0x20')][_0x5f4cad['queue']][_0xca9f('0xeb')]&&_0x3bfae5['value']===_0xca9f('0x107')){delete this['uniqueId'][_0x3bfae5['uniqueid']];this['updateOriginated'](this[_0xca9f('0x20')][_0x5f4cad[_0xca9f('0xb8')]]);_0x2d73a9=new Hangup(_0x5f4cad,_0x3bfae5);_0x2d73a9['state']=0x12;_0x2d73a9[_0xca9f('0xa9')]=_0xca9f('0xed');_0x2d73a9[_0xca9f('0xf6')]=_0xca9f('0xee');ami[_0xca9f('0xef')](_0xca9f('0xf0'),ut['buildObj'](_0x2d73a9,_0xca9f('0xf1')));this[_0xca9f('0xd9')](_0x2d73a9,_0xca9f('0x108'),'[syncHangupInAMDIvr]');}if(_0x5f4cad[_0xca9f('0x4a')]==='ivr'&&this['campaigns'][_0x5f4cad[_0xca9f('0xb8')]]['dialAMDActive']&&_0x3bfae5['value']===_0xca9f('0xf4')){var _0xb4558a=this;return new BPromise(function(_0x12bf7f,_0x8dfeb4){delete _0xb4558a['uniqueId'][_0x3bfae5[_0xca9f('0xec')]];_0xb4558a[_0xca9f('0xb7')](_0xb4558a[_0xca9f('0x20')][_0x5f4cad[_0xca9f('0xb8')]]);_0xb4558a['campaigns'][_0x5f4cad[_0xca9f('0xb8')]][_0xca9f('0x5e')]+=0x1;_0xb4558a['campaigns'][_0x5f4cad['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x52026d=_0xb4558a['campaigns'][_0x5f4cad[_0xca9f('0xb8')]];var _0x4ba57d=new Hangup(_0x5f4cad,_0x3bfae5);_0x4ba57d[_0xca9f('0xa8')]=0x13;_0x4ba57d[_0xca9f('0xa9')]='Machine';_0x4ba57d[_0xca9f('0xf6')]='AMD';_0x4ba57d[_0xca9f('0x100')]+=0x1;_0x4ba57d[_0xca9f('0xf7')]+=0x1;_0x4ba57d[_0xca9f('0xf1')]=!![];ami[_0xca9f('0xef')](_0xca9f('0xf0'),ut[_0xca9f('0xf8')](_0x4ba57d,'amd'));_0xb4558a[_0xca9f('0xd5')](_0x4ba57d)[_0xca9f('0xb5')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4ba57d['countbusyretry']+_0x4ba57d['countcongestionretry']+_0x4ba57d[_0xca9f('0xfc')]+_0x4ba57d[_0xca9f('0xfd')]+_0x4ba57d[_0xca9f('0xfe')]+_0x4ba57d[_0xca9f('0xff')]+_0x4ba57d[_0xca9f('0x100')]+_0x4ba57d['countagentrejectretry']>=_0x52026d[_0xca9f('0x102')]){_0xb4558a[_0xca9f('0x109')](_0x4ba57d,_0x12bf7f,_0x8dfeb4,_0xca9f('0x103'));}else{if(_0x4ba57d[_0xca9f('0x100')]>=_0x52026d[_0xca9f('0x10a')]){_0xb4558a[_0xca9f('0x10b')](_0x4ba57d,_0x12bf7f,_0x8dfeb4,'reason\x2019\x20machine....');}else{_0xb4558a[_0xca9f('0xc8')]({'active':![],'countmachineretry':_0x4ba57d[_0xca9f('0x100')],'scheduledat':moment()[_0xca9f('0x105')](_0x52026d['dialMachineRetryFrequency'],_0xca9f('0x10c'))[_0xca9f('0x78')](_0xca9f('0x106')),'ContactId':_0x4ba57d[_0xca9f('0xda')],'ListId':_0x4ba57d[_0xca9f('0xdb')],'VoiceQueueId':_0x4ba57d['VoiceQueueId']||undefined,'CampaignId':_0x4ba57d[_0xca9f('0xde')]||undefined})[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x10d')));_0x12bf7f({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xca9f('0x10e')]=function(_0x3884bf){var _0x209906=this[_0xca9f('0xae')][_0x3884bf[_0xca9f('0xec')]];var _0x2d23bb=this;var _0x122907;if(_0x209906&&_0x209906['type']==='ivr'){delete this[_0xca9f('0xae')][_0x3884bf[_0xca9f('0xec')]];this[_0xca9f('0xb7')](this[_0xca9f('0x20')][_0x209906[_0xca9f('0xb8')]]);this[_0xca9f('0x20')][_0x209906[_0xca9f('0xb8')]][_0xca9f('0x10f')]+=0x1;_0x122907=new Hangup(_0x209906,_0x3884bf);this[_0xca9f('0xd5')](_0x122907)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x110')));this[_0xca9f('0xd3')](_0x122907)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x111')));}if(_0x209906&&_0x209906[_0xca9f('0x4a')]!=='ivr'&&isNotNull(this[_0xca9f('0x1f')][_0x209906['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x3884bf[_0xca9f('0xec')]];this[_0xca9f('0xb7')](this[_0xca9f('0x1f')][_0x209906[_0xca9f('0xb8')]]);this[_0xca9f('0x1f')][_0x209906[_0xca9f('0xb8')]][_0xca9f('0x5e')]+=0x1;this[_0xca9f('0x1f')][_0x209906[_0xca9f('0xb8')]][_0xca9f('0x5d')]+=0x1;_0x122907=new Hangup(_0x209906,_0x3884bf);_0x122907[_0xca9f('0xa8')]=0x10;_0x122907[_0xca9f('0xa9')]=_0xca9f('0x112');_0x122907['membername']=_0xca9f('0x113');this[_0xca9f('0xd5')](_0x122907)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x110')));this[_0xca9f('0xd3')](_0x122907)[_0xca9f('0xb5')](loggerCatch('[syncHangupIvr]'));}if(_0x209906&&_0x209906[_0xca9f('0x4a')]!==_0xca9f('0x7b')&&!isNotNull(this[_0xca9f('0x1f')][_0x209906[_0xca9f('0xb8')]][_0xca9f('0x114')])){delete this[_0xca9f('0xae')][_0x3884bf[_0xca9f('0xec')]];this[_0xca9f('0xb7')](this['voiceQueues'][_0x209906['queue']]);this[_0xca9f('0x1f')][_0x209906[_0xca9f('0xb8')]][_0xca9f('0x67')]+=0x1;_0x122907=new Hangup(_0x209906,_0x3884bf);_0x122907['state']=0xc;_0x122907[_0xca9f('0xa9')]=_0x3884bf['cause-txt'];_0x122907[_0xca9f('0xf6')]=_0xca9f('0x115');this[_0xca9f('0xd5')](_0x122907)['catch'](loggerCatch(_0xca9f('0x110')));this[_0xca9f('0xd3')](_0x122907)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x111')));}};Dialer[_0xca9f('0xb1')]['syncAgentComplete']=function(_0x2452e2){var _0x3c7b66=this['uniqueId'][_0x2452e2['uniqueid']];var _0x2503bc=this;if(this[_0xca9f('0x1f')][_0x2452e2[_0xca9f('0xb8')]]){if(_0x3c7b66&&_0x3c7b66[_0xca9f('0x4a')]!==_0xca9f('0x7b')){delete this[_0xca9f('0xae')][_0x2452e2[_0xca9f('0xec')]];this[_0xca9f('0x1f')][_0x2452e2[_0xca9f('0xb8')]][_0xca9f('0x5e')]+=0x1;var _0x425d9a=new AgentComplete(_0x3c7b66,_0x2452e2);if(_0x2452e2[_0xca9f('0x116')]==='agent'){_0x425d9a[_0xca9f('0x117')]=this[_0xca9f('0x1f')][_0x2452e2['queue']][_0xca9f('0x118')]&&this['voiceQueues'][_0x2452e2[_0xca9f('0xb8')]][_0xca9f('0x119')]?moment()[_0xca9f('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xca9f('0xd5')](_0x425d9a)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x11a')));this['moveContactManagedDialer'](_0x425d9a)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x11b')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x24901f){if(this[_0xca9f('0x1f')][_0x24901f[_0xca9f('0xb8')]]){if(this[_0xca9f('0xae')][_0x24901f['uniqueid']]&&this[_0xca9f('0xae')][_0x24901f['uniqueid']][_0xca9f('0x4a')]!=='ivr'){this[_0xca9f('0xb7')](this[_0xca9f('0x1f')][_0x24901f[_0xca9f('0xb8')]]);this[_0xca9f('0xae')][_0x24901f['uniqueid']][_0xca9f('0x11c')]=moment()[_0xca9f('0x78')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xca9f('0xb1')]['queueCallerAbandonCreateState']=function(_0x1254ea,_0x47ded4){this[_0xca9f('0xd5')](_0x1254ea)['catch'](loggerCatch(_0xca9f('0x11a')));if(_0x47ded4==0x0){this[_0xca9f('0xd3')](_0x1254ea)['catch'](loggerCatch(_0xca9f('0x11d')));}};Dialer[_0xca9f('0xb1')]['syncQueueCallerAbandon']=function(_0xd318d){var _0xffb2bf=this[_0xca9f('0xae')][_0xd318d[_0xca9f('0xec')]];var _0x4aa0be=this;var _0x3b0ad3=![];var _0x51e8dd;var _0x2ed13f;if(this['voiceQueues'][_0xd318d[_0xca9f('0xb8')]]){if(_0xffb2bf&&_0xffb2bf[_0xca9f('0x4a')]!==_0xca9f('0x7b')){delete this[_0xca9f('0xae')][_0xd318d[_0xca9f('0xec')]];this['updateOriginated'](this['voiceQueues'][_0xd318d[_0xca9f('0xb8')]]);_0xffb2bf[_0xca9f('0x11e')]=moment()[_0xca9f('0x78')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4b0311=new QueueCallerAbandon(_0xffb2bf,_0xd318d);if(getSeconds(_0xffb2bf[_0xca9f('0x11e')],_0xffb2bf['responsetime'])>=_0xffb2bf['dialQueueTimeout']){this[_0xca9f('0x1f')][_0xd318d[_0xca9f('0xb8')]][_0xca9f('0x6b')]+=0x1;this[_0xca9f('0x1f')][_0xd318d[_0xca9f('0xb8')]][_0xca9f('0x63')]+=0x1;this[_0xca9f('0x1f')][_0xd318d[_0xca9f('0xb8')]][_0xca9f('0x6d')]+=0x1;_0x4b0311['state']=0xa;_0x4b0311[_0xca9f('0xa9')]=_0xca9f('0x11f');_0x4b0311['dropreason']=_0xca9f('0x120');_0x4b0311[_0xca9f('0x117')]=this['voiceQueues'][_0xd318d['queue']][_0xca9f('0x118')]?moment()['format'](_0xca9f('0x106')):undefined;_0x4b0311[_0xca9f('0xfe')]+=0x1;_0x4b0311['countglobal']+=0x1;_0x51e8dd=this[_0xca9f('0x1f')][_0xd318d[_0xca9f('0xb8')]][_0xca9f('0x121')];_0x2ed13f=this[_0xca9f('0x1f')][_0xd318d['queue']][_0xca9f('0x122')];_0x4aa0be[_0xca9f('0xbf')](_0x4b0311,_0x4b0311['state'],_0xffb2bf[_0xca9f('0x123')])[_0xca9f('0xbc')](function(_0x39aad2){_0x3b0ad3=_0x39aad2[_0xca9f('0x124')]==0x1;if(_0x4b0311[_0xca9f('0xfe')]>=_0x4aa0be[_0xca9f('0x1f')][_0xd318d[_0xca9f('0xb8')]]['dialDropMaxRetry']){_0x4aa0be['queueCallerAbandonCreateState'](_0x4b0311,_0x39aad2[_0xca9f('0x124')]);}else{_0x4aa0be['rescheduleContact']({'active':![],'countdropretry':_0x4b0311[_0xca9f('0xfe')],'scheduledat':moment()['add'](this[_0xca9f('0x1f')][_0xd318d[_0xca9f('0xb8')]][_0xca9f('0x121')],'minutes')[_0xca9f('0x78')](_0xca9f('0x106')),'ContactId':_0xffb2bf[_0xca9f('0xda')],'ListId':_0xffb2bf[_0xca9f('0xdb')],'VoiceQueueId':_0xffb2bf[_0xca9f('0xdd')]||undefined,'CampaignId':_0xffb2bf[_0xca9f('0xde')]||undefined})[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x125')));var _0x3a6b61=new History(_0x4b0311);_0x3a6b61[_0xca9f('0xa8')]=0xa;_0x3a6b61[_0xca9f('0xa9')]=_0xca9f('0x11f');_0x3a6b61[_0xca9f('0xab')]=moment()[_0xca9f('0x78')](_0xca9f('0x106'));_0x3a6b61[_0xca9f('0xaa')]=_0x3a6b61[_0xca9f('0xab')];_0x3a6b61[_0xca9f('0x126')]=_0x4b0311[_0xca9f('0x126')];_0x3a6b61['calleridnum']=_0x4b0311[_0xca9f('0x127')];_0x4aa0be['createHistory'](_0x3a6b61)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x128')));}})[_0xca9f('0xbc')](function(_0x5276ea){if(_0x3b0ad3)_0x4aa0be[_0xca9f('0xc1')](_0x4b0311,_0x51e8dd,_0x2ed13f)[_0xca9f('0xbc')](function(_0x3ae0e0){return 0x1;});});}else{this[_0xca9f('0x1f')][_0xd318d['queue']][_0xca9f('0x6a')]+=0x1;this['voiceQueues'][_0xd318d['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x4b0311[_0xca9f('0xa8')]=0xb;_0x4b0311['statedesc']=_0xca9f('0x129');_0x4b0311[_0xca9f('0x12a')]=_0xca9f('0x12b');_0x4b0311['countabandonedretry']+=0x1;_0x4b0311[_0xca9f('0xf7')]+=0x1;_0x51e8dd=this[_0xca9f('0x1f')][_0xd318d[_0xca9f('0xb8')]][_0xca9f('0x12c')];_0x2ed13f=this[_0xca9f('0x1f')][_0xd318d[_0xca9f('0xb8')]][_0xca9f('0x122')];_0x4aa0be[_0xca9f('0xbf')](_0x4b0311,_0x4b0311[_0xca9f('0xa8')],_0xffb2bf[_0xca9f('0x123')])[_0xca9f('0xbc')](function(_0x44c9a2){if(_0x4b0311[_0xca9f('0xff')]>=_0x4aa0be['voiceQueues'][_0xd318d[_0xca9f('0xb8')]][_0xca9f('0x12d')]){_0x4aa0be[_0xca9f('0x12e')](_0x4b0311,_0x44c9a2[_0xca9f('0x124')]);}else{_0x4aa0be['rescheduleContact']({'active':![],'countabandonedretry':_0x4b0311['countabandonedretry'],'scheduledat':moment()[_0xca9f('0x105')](this[_0xca9f('0x1f')][_0xd318d[_0xca9f('0xb8')]]['dialAbandonedRetryFrequency'],_0xca9f('0x10c'))['format'](_0xca9f('0x106')),'ContactId':_0xffb2bf[_0xca9f('0xda')],'ListId':_0xffb2bf[_0xca9f('0xdb')],'VoiceQueueId':_0xffb2bf['VoiceQueueId']||undefined,'CampaignId':_0xffb2bf[_0xca9f('0xde')]||undefined})[_0xca9f('0xb5')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x377ff4=new History(_0x4b0311);_0x377ff4[_0xca9f('0xa8')]=0xb;_0x377ff4[_0xca9f('0xa9')]=_0xca9f('0x129');_0x377ff4[_0xca9f('0xab')]=moment()[_0xca9f('0x78')](_0xca9f('0x106'));_0x377ff4['endtime']=_0x377ff4['starttime'];_0x377ff4[_0xca9f('0x126')]=_0x4b0311[_0xca9f('0x126')];_0x377ff4[_0xca9f('0x127')]=_0x4b0311[_0xca9f('0x127')];_0x4aa0be[_0xca9f('0xd5')](_0x377ff4)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x12f')));}})[_0xca9f('0xbc')](function(_0x4d62cb){if(_0x3b0ad3)_0x4aa0be[_0xca9f('0xc1')](_0x4b0311,_0x51e8dd,_0x2ed13f)[_0xca9f('0xbc')](function(_0x1c401){return 0x1;});});}}}};Dialer[_0xca9f('0xb1')][_0xca9f('0x35')]=function(_0x4fdc62){if(this[_0xca9f('0x25')][_0x4fdc62[_0xca9f('0xec')]]){this[_0xca9f('0x25')][_0x4fdc62[_0xca9f('0xec')]][_0xca9f('0xb4')]=_0x4fdc62[_0xca9f('0xb4')];}if(this[_0xca9f('0xae')][_0x4fdc62[_0xca9f('0xec')]]){this[_0xca9f('0xae')][_0x4fdc62[_0xca9f('0xec')]][_0xca9f('0xb4')]=_0x4fdc62[_0xca9f('0xb4')];}};Dialer[_0xca9f('0xb1')]['syncQueueMember']=function(_0x3b2586){if(strategy[this[_0xca9f('0x1f')][this[_0xca9f('0x25')][_0x3b2586[_0xca9f('0x130')]][_0xca9f('0xb8')]][_0xca9f('0x4c')]]===_0xca9f('0x131')){if(this[_0xca9f('0x25')][_0x3b2586['actionid']]&&_[_0xca9f('0xb2')](this[_0xca9f('0x25')][_0x3b2586[_0xca9f('0x130')]][_0xca9f('0x132')])&&_0x3b2586[_0xca9f('0xb3')]==='1'&&_0x3b2586[_0xca9f('0x133')]==='0'){if(this['agents'][_0x3b2586[_0xca9f('0x134')]]){if(!this[_0xca9f('0x21')][_0x3b2586[_0xca9f('0x134')]][_0xca9f('0x132')]){this[_0xca9f('0x21')][_0x3b2586['stateinterface']][_0xca9f('0x132')]=!![];this['actions'][_0x3b2586[_0xca9f('0x130')]][_0xca9f('0x132')]=!![];this['actions'][_0x3b2586[_0xca9f('0x130')]][_0xca9f('0x134')]=_0x3b2586[_0xca9f('0x134')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x3b2586[_0xca9f('0x130')]][_0xca9f('0xb8')]][_0xca9f('0x4c')]]||_0xca9f('0x1b'))===_0xca9f('0x1b')){if(this['actions'][_0x3b2586['actionid']]){if(this[_0xca9f('0x21')][_0x3b2586[_0xca9f('0x134')]]){this[_0xca9f('0x25')][_0x3b2586['actionid']][_0xca9f('0x134')]=_0x3b2586[_0xca9f('0x134')];if(_[_0xca9f('0xb2')](this[_0xca9f('0x2b')][this[_0xca9f('0x25')][_0x3b2586[_0xca9f('0x130')]][_0xca9f('0xb8')]])){this[_0xca9f('0x2b')][this[_0xca9f('0x25')][_0x3b2586[_0xca9f('0x130')]][_0xca9f('0xb8')]]=[];}this[_0xca9f('0x2b')][this[_0xca9f('0x25')][_0x3b2586[_0xca9f('0x130')]][_0xca9f('0xb8')]][_0xca9f('0x135')](_['merge'](_[_0xca9f('0x136')](this[_0xca9f('0x25')][_0x3b2586['actionid']],[_0xca9f('0x137'),_0xca9f('0x134')]),{'status':_0x3b2586['status'],'paused':_0x3b2586[_0xca9f('0x133')]}));}}}};function unlockQueueStatus(_0x328165,_0x36f413){setTimeout(function(){if(_[_0xca9f('0x87')](_0x328165['queueStatusComplete'])){loggerBooked[_0xca9f('0x96')](_0xca9f('0x138'),_0x36f413);}_0x328165[_0xca9f('0x139')]=!![];loggerBooked[_0xca9f('0x7e')](_0xca9f('0x13a'),_0x36f413,JSON[_0xca9f('0x46')](_['pick'](_0x328165,[_0xca9f('0x3c'),_0xca9f('0x139')])));},0x1f3);}Dialer[_0xca9f('0xb1')][_0xca9f('0x39')]=function(_0x4321ca){var _0x1e53a2=this;var _0x58ac05=_0x1e53a2[_0xca9f('0x1f')][_0x1e53a2[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]][_0xca9f('0xb8')]];if(strategy[this[_0xca9f('0x1f')][this[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]]['queue']]['strategy']]===_0xca9f('0x131')){if(this['actions'][_0x4321ca[_0xca9f('0x130')]]&&this[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]][_0xca9f('0x134')]){this[_0xca9f('0x95')][_0xca9f('0x13b')](this[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]][_0xca9f('0x137')],this[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]][_0xca9f('0x134')])[_0xca9f('0xb5')](function(_0x18767b){logger[_0xca9f('0x96')](_0xca9f('0x13c'),util['inspect'](_0x18767b,{'showHidden':![],'depth':null}));})[_0xca9f('0x13d')](function(){_0x1e53a2['updateOriginated'](_0x1e53a2[_0xca9f('0x1f')][_0x1e53a2[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]]['queue']]);_0x1e53a2['agents'][_0x1e53a2[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]][_0xca9f('0x134')]]['locked']=![];delete _0x1e53a2[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]];unlockQueueStatus(_0x58ac05);});}else{this[_0xca9f('0xb7')](this[_0xca9f('0x1f')][this[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]][_0xca9f('0xb8')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x4321ca[_0xca9f('0x130')]]['ContactId'],'ListId':this[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]][_0xca9f('0xdb')],'VoiceQueueId':this[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]][_0xca9f('0xde')]||undefined})[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x13e')));delete this[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]];unlockQueueStatus(_0x58ac05);}}else if((strategy[this[_0xca9f('0x1f')][this['actions'][_0x4321ca[_0xca9f('0x130')]][_0xca9f('0xb8')]][_0xca9f('0x4c')]]||_0xca9f('0x1b'))==='rrmemory'){var _0x25257a;if(this[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]]&&!_['isEmpty'](this['queueBooked'][this['actions'][_0x4321ca[_0xca9f('0x130')]]['queue']])){if(this['queueBookedRR'][_0x1e53a2['actions'][_0x4321ca[_0xca9f('0x130')]][_0xca9f('0xb8')]]){this[_0xca9f('0x13f')][_0x1e53a2['actions'][_0x4321ca['actionid']][_0xca9f('0xb8')]]=this[_0xca9f('0x13f')][this['actions'][_0x4321ca['actionid']][_0xca9f('0xb8')]]?this[_0xca9f('0x13f')][this[_0xca9f('0x25')][_0x4321ca['actionid']][_0xca9f('0xb8')]]:this[_0xca9f('0x2b')][this[_0xca9f('0x25')][_0x4321ca['actionid']][_0xca9f('0xb8')]]?this['queueBooked'][this['actions'][_0x4321ca[_0xca9f('0x130')]][_0xca9f('0xb8')]][_0xca9f('0x140')]||0x0:0x0;}this[_0xca9f('0x2b')][this[_0xca9f('0x25')][_0x4321ca[_0xca9f('0x130')]][_0xca9f('0xb8')]][_0xca9f('0x140')]=this['queueBookedRR'][this['actions'][_0x4321ca[_0xca9f('0x130')]][_0xca9f('0xb8')]];for(var _0x1a598a=0x0;_0x1a598a=0x0;})[_0xca9f('0xb5')](myreject(_0x1daf44)));}}else{_0x3b08cc[_0xca9f('0x135')](ami[_0xca9f('0x159')]({'action':_0xca9f('0x15a'),'command':util[_0xca9f('0x78')](_0xca9f('0x15c'),_0x37029b,!_[_0xca9f('0x87')](config['timezones'][_0x4cb9f2])?_0x4cb9f2:'')})['then'](function(_0x493f7e){return _0x493f7e[_0xca9f('0x15d')][_0xca9f('0x15e')]('true')>=0x0;})[_0xca9f('0xb5')](myreject(_0x1daf44)));}BPromise[_0xca9f('0x15f')](_0x3b08cc)['then'](function(_0x25d464){var _0x53ae18=_[_0xca9f('0x160')](_0x25d464);if(_0x53ae18){return _0x55e757(_0x53ae18);}else{_0x1b503a['message']=_0x36caf5?_0xca9f('0x161'):_0xca9f('0x162');return _0x1daf44(msgResponse(_0xca9f('0x163'),_0xca9f('0x152'),_0xca9f('0x164')+_0x36caf5+'\x20'+_0x5cfa03+_0xca9f('0x165')+util[_0xca9f('0x97')](_0x37029b,{'showHidden':![],'depth':null})+_0xca9f('0x166')+_0x4cb9f2));}})[_0xca9f('0xb5')](function(_0x1f188a){return _0x1daf44(msgResponse(_0xca9f('0x151'),_0xca9f('0x152'),JSON[_0xca9f('0x46')](_0x1f188a)));});});};Dialer[_0xca9f('0xb1')]['checkDialMethod']=function(_0x2f5c6e){var _0x262c2d=this;return function(){switch(_0x2f5c6e['dialMethod']){case _0xca9f('0x167'):freeVariablesPredictive(_0x2f5c6e);_0x262c2d[_0xca9f('0x168')](_0x2f5c6e,0x1);break;case _0xca9f('0x169'):freeVariablesPredictive(_0x2f5c6e);_0x262c2d[_0xca9f('0x168')](_0x2f5c6e,_0x2f5c6e['dialPowerLevel']);break;case'predictive':_0x262c2d[_0xca9f('0x16a')](_0x2f5c6e);break;case'booked':freeVariablesPredictive(_0x2f5c6e);_0x262c2d['handlePower'](_0x2f5c6e,0x1);break;default:freeVariablesPredictive(_0x2f5c6e);logger['error'](_0xca9f('0x16b'),_0x2f5c6e[_0xca9f('0x3c')],_0xca9f('0x16c'));}};};Dialer[_0xca9f('0xb1')][_0xca9f('0x16d')]=function(_0x5f3d8b){var _0x33971f=this;return function(){_0x33971f[_0xca9f('0x16e')](_0x5f3d8b);};};Dialer[_0xca9f('0xb1')]['syncQueueSummary']=function(_0x8dd507){var _0x16d890=this;if(isNotPreview(_0x8dd507[_0xca9f('0x58')])){if(isVoiceQueueOutbound(_0x8dd507[_0xca9f('0x4a')])&&isActive(_0x8dd507['dialActive'])){_0x8dd507['sendMessageOneNotActive']=!![];BPromise[_0xca9f('0xc2')]()[_0xca9f('0xbc')](checkIsLoggedIn(_0x8dd507,_0x8dd507[_0xca9f('0x4e')]))[_0xca9f('0xbc')](checkIsActive(_0x8dd507,_0x8dd507[_0xca9f('0x57')]))['then'](checkInterval(_0x8dd507))[_0xca9f('0xbc')](_0x16d890[_0xca9f('0x14b')](_0x8dd507))[_0xca9f('0xbc')](_0x16d890['checkIfTime'](_0x8dd507['dialGlobalInterval'],_0x8dd507[_0xca9f('0x16f')],_0x8dd507[_0xca9f('0x3c')],_0x8dd507))['then'](_0x16d890[_0xca9f('0x150')](_0x8dd507[_0xca9f('0x40')],_0x8dd507[_0xca9f('0x16f')],_0x8dd507['name'],_0x8dd507))[_0xca9f('0xbc')](_0x16d890[_0xca9f('0x170')](_0x8dd507))['catch'](loggerCatchQueueSummary(_0xca9f('0x171'),_0x8dd507));}else{notSendMessagesQueue(_0x8dd507);}}else{freeVariablesPredictive(_0x8dd507);}};Dialer[_0xca9f('0xb1')][_0xca9f('0x14a')]=function(){var _0x2db81c=this;var _0x1abab9;for(var _0x1defa0 in this['campaigns']){if(typeof this[_0xca9f('0x20')][_0x1defa0]!==_0xca9f('0x99')){_0x1abab9=this[_0xca9f('0x20')][_0x1defa0];if(isCampaignIvr(_0x1abab9[_0xca9f('0x4a')])&&isActive(_0x1abab9['active'])){_0x1abab9[_0xca9f('0xa0')]=!![];BPromise[_0xca9f('0xc2')]()['then'](checkIsActive(_0x1abab9,_0x1abab9[_0xca9f('0x75')]))[_0xca9f('0xbc')](checkInterval(_0x1abab9))[_0xca9f('0xbc')](_0x2db81c[_0xca9f('0x14b')](_0x1abab9))[_0xca9f('0xbc')](_0x2db81c[_0xca9f('0x14f')](_0x1abab9[_0xca9f('0x172')],_0x1abab9['dialTimezone'],_0x1abab9[_0xca9f('0x3c')],_0x1abab9))[_0xca9f('0xbc')](_0x2db81c[_0xca9f('0x150')](_0x1abab9[_0xca9f('0x40')],_0x1abab9[_0xca9f('0x16f')],_0x1abab9[_0xca9f('0x3c')],_0x1abab9))['then'](_0x2db81c['launchHandleIvr'](_0x1abab9))[_0xca9f('0xb5')](loggerCatchQueueSummary(_0xca9f('0x173'),_0x1abab9));}else{notSendMessagesCampaign(_0x1abab9);}}}};function getCallerIdRandom(_0x4f8273,_0x1058f8){var _0x2bdaed;var _0x5a1916;var _0x568ac9;if(_0x1058f8<=0x0){_0x1058f8=0x1;}_0x2bdaed=new RegExp(_0xca9f('0x174')+_0x1058f8+'}$');_0x5a1916=Math[_0xca9f('0x175')](0xa,_0x1058f8-0x1);_0x568ac9=Math['pow'](0xa,_0x1058f8)-0x1;return util[_0xca9f('0x78')]('%s',_[_0xca9f('0x176')](_0x4f8273,_0x2bdaed,_['random'](_0x5a1916,_0x568ac9)));}function extractCalleridName(_0x4ffdcf){var _0x18c06d=_0x4ffdcf['match'](/"(.*?)"/);return _0x18c06d?_0x18c06d[0x1]:_0x4ffdcf;}function extractCalleridNumber(_0x161b91){var _0x143d4a=_0x161b91['match'](/<(.*?)>/);return _0x143d4a?_0x143d4a[0x1]:_0x161b91;}Dialer[_0xca9f('0xb1')][_0xca9f('0x177')]=function(_0x50717b,_0x27a88c){var _0x52cc09=this;var _0x3e5460=uuid['v4']();this[_0xca9f('0x25')][_0x3e5460]=new Action(_0x50717b,_0x27a88c,_0x3e5460);return new BPromise(function(_0x231d12,_0x130176){if(_[_0xca9f('0x87')](_0x50717b)&&typeof _0x50717b!==_0xca9f('0x178')){return _0x130176(msgResponse(_0xca9f('0x179'),_0xca9f('0x152'),_0xca9f('0x17a')));}if(_[_0xca9f('0x87')](_0x27a88c[_0xca9f('0x17b')])||_0x27a88c[_0xca9f('0x17b')]===null){return _0x130176(msgResponse('originate',_0xca9f('0x152'),_0xca9f('0x17c')));}var _0x2d79ce={'XMD-CALLERID':_0x52cc09[_0xca9f('0x25')][_0x3e5460][_0xca9f('0x17d')](),'XMD-AGI':_0x50717b['dialQueueProject']?util['format'](_0xca9f('0x17e'),ipAgi,_0x50717b['dialQueueProject']):_0xca9f('0x17f'),'XMD-AGIAFTER':_0x50717b[_0xca9f('0x118')]?util[_0xca9f('0x78')](_0xca9f('0x17e'),ipAgi,_0x50717b[_0xca9f('0x118')]):_0xca9f('0x17f'),'XMD-QUEUE':_0x50717b[_0xca9f('0x4a')]===_0xca9f('0x4b')?util['format'](_0xca9f('0x180'),_0x50717b[_0xca9f('0x3c')],_0x50717b[_0xca9f('0x181')]||'',_0x50717b['dialAgiAfterHangupAgent']?'c':'',_0x50717b[_0xca9f('0x182')]||0x3):_0xca9f('0x17f'),'XMD-CONTACTID':_0x27a88c['ContactId'],'XMD-CDRTYPE':_0xca9f('0x183'),'CALLERID(all)':_0x52cc09['actions'][_0x3e5460]['getCaller'](),'XMD-AMD':_0x50717b['dialAMDActive']?_0xca9f('0x184'):_0xca9f('0x17f'),'XMD-DESTINATION':_0xca9f('0xea')};if(_0x50717b[_0xca9f('0xeb')]){_0x2d79ce[_0xca9f('0x185')]=_0x50717b['dialAMDInitialSilence']||0x9c4;_0x2d79ce[_0xca9f('0x186')]=_0x50717b[_0xca9f('0x187')]||0x5dc;_0x2d79ce['XMD-AMDAFTERGREETINGSILENCE']=_0x50717b[_0xca9f('0x188')]||0x320;_0x2d79ce[_0xca9f('0x189')]=_0x50717b['dialAMDTotalAnalysisTime']||0x1388;_0x2d79ce[_0xca9f('0x18a')]=_0x50717b[_0xca9f('0x18b')]||0x64;_0x2d79ce[_0xca9f('0x18c')]=_0x50717b[_0xca9f('0x18d')]||0x32;_0x2d79ce[_0xca9f('0x18e')]=_0x50717b[_0xca9f('0x18f')]||0x3;_0x2d79ce[_0xca9f('0x190')]=_0x50717b[_0xca9f('0x191')]||0x100;_0x2d79ce[_0xca9f('0x192')]=_0x50717b['dialAMDMaximumWordLength']||0x1388;}if(_0x50717b[_0xca9f('0x4a')]==='outbound'){_0x2d79ce[_0xca9f('0x193')]=_0x27a88c[_0xca9f('0xdd')];}else{_0x2d79ce[_0xca9f('0x194')]=_0x27a88c[_0xca9f('0xde')];}for(var _0x384c9b in _0x27a88c[_0xca9f('0x195')]){if(typeof _0x27a88c[_0xca9f('0x195')][_0x384c9b]!==_0xca9f('0x99')){if(isNotNull(_0x27a88c[_0xca9f('0x195')][_0x384c9b])&&_0x384c9b!=='id'&&_0x384c9b!==_0xca9f('0x196')&&_0x384c9b!==_0xca9f('0x197')&&_0x384c9b!==_0xca9f('0x198')){_0x2d79ce[util[_0xca9f('0x78')](_0xca9f('0x199'),'XMD-',_['toUpper'](_0x384c9b))]=_0x27a88c[_0xca9f('0x195')][_0x384c9b];}}}var _0x84a491=_0x52cc09[_0xca9f('0xe3')](_0x50717b['Trunk'])?getCallerId(_0x50717b['Trunk'][_0xca9f('0x76')],_0x50717b[_0xca9f('0x59')],_0x50717b[_0xca9f('0x19a')]>0x0?getCallerIdRandom(_0x50717b[_0xca9f('0x5a')],_0x50717b[_0xca9f('0x19a')]):_0x50717b[_0xca9f('0x5a')]):getCallerId(_['isNil'](_0x50717b[_0xca9f('0x14c')])?_0x50717b['Trunk']['callerid']:_0x50717b[_0xca9f('0x14c')]['callerid'],_0x50717b['dialOriginateCallerIdName'],_0x50717b[_0xca9f('0x19a')]>0x0?getCallerIdRandom(_0x50717b[_0xca9f('0x5a')],_0x50717b[_0xca9f('0x19a')]):_0x50717b['dialOriginateCallerIdNumber']);if(_0x84a491){_0x2d79ce[_0xca9f('0x19b')]=_0x52cc09[_0xca9f('0x25')][_0x3e5460]['originatecalleridname']=extractCalleridName(_0x84a491);_0x2d79ce[_0xca9f('0x19c')]=_0x27a88c[_0xca9f('0x17b')];}return ami[_0xca9f('0x159')]({'actionid':_0x3e5460,'action':_0xca9f('0x179'),'channel':_0x52cc09['isTrunkReachable'](_0x50717b['Trunk'])?util[_0xca9f('0x78')](_0xca9f('0x19d'),_0x50717b['Trunk']['name'],isNotNull(_0x50717b[_0xca9f('0x5c')])?_0x50717b[_0xca9f('0x5c')][_0xca9f('0x19e')]()||'':'',_0x50717b['dialCutDigit']>0x0?_0x27a88c[_0xca9f('0x17b')][_0xca9f('0x19f')](_0x50717b['dialCutDigit']):_0x27a88c[_0xca9f('0x17b')]):util[_0xca9f('0x78')](_0xca9f('0x19d'),_[_0xca9f('0xb2')](_0x50717b['TrunkBackup'])?_0x50717b['Trunk']['name']:_0x50717b['TrunkBackup'][_0xca9f('0x3c')],isNotNull(_0x50717b[_0xca9f('0x5c')])?_0x50717b['dialPrefix'][_0xca9f('0x19e')]()||'':'',_0x50717b[_0xca9f('0x1a0')]>0x0?_0x27a88c['phone']['substring'](_0x50717b['dialCutDigit']):_0x27a88c[_0xca9f('0x17b')]),'callerid':_0x84a491,'Exten':_0xca9f('0xea'),'Context':_0xca9f('0x1a1'),'Priority':'1','variable':_0x2d79ce,'timeout':(_0x50717b[_0xca9f('0x5b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3e5460})['then'](function(_0x2cb5a5){return _0x231d12(_0x2cb5a5);})[_0xca9f('0xb5')](function(_0x43af98){_0x50717b[_0xca9f('0x66')]+=0x1;var _0x55230e=new History(_0x52cc09[_0xca9f('0x25')][_0x3e5460]);logger['error'](util['format']('[originateError]:\x20%s',JSON[_0xca9f('0x46')](_0x43af98)));_0x55230e[_0xca9f('0xa8')]=0xe;_0x55230e[_0xca9f('0xa9')]=_0xca9f('0x1a2');_0x55230e['starttime']=moment()[_0xca9f('0x78')]('YYYY-MM-DD\x20HH:mm:ss');_0x55230e['endtime']=_0x55230e['starttime'];_0x52cc09[_0xca9f('0xd5')](_0x55230e)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x1a3')));_0x52cc09[_0xca9f('0xd3')](_0x55230e)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x1a3')))['finally'](function(){delete _0x52cc09[_0xca9f('0x25')][_0x3e5460];return _0x130176(msgResponse(_0xca9f('0x179'),_0xca9f('0x1a4'),_0xca9f('0x1a5')));});});});};Dialer['prototype'][_0xca9f('0x30')]=function(_0xf3bdec){var _0x1e1c2d=this[_0xca9f('0x25')][_0xf3bdec[_0xca9f('0x130')]];if(_0x1e1c2d){delete this[_0xca9f('0x25')][_0xf3bdec['actionid']];_0x1e1c2d['responsetime']=moment()['format'](_0xca9f('0x106'));var _0x1d0942=_0x1e1c2d[_0xca9f('0x4a')]==='ivr'?this[_0xca9f('0x20')][_0x1e1c2d['queue']]:this['voiceQueues'][_0x1e1c2d[_0xca9f('0x1a6')]()];if(!this[_0xca9f('0xe1')](_0xf3bdec[_0xca9f('0x1a7')])){this[_0xca9f('0xb7')](_0x1d0942);return this[_0xca9f('0x1a8')](_0x1e1c2d,_0x1d0942,_0xf3bdec)['catch'](loggerCatch(_0xca9f('0x1a9')));}this[_0xca9f('0xae')][_0xf3bdec[_0xca9f('0xec')]]=_0x1e1c2d;}};Dialer[_0xca9f('0xb1')]['checkRetriveMax']=function(_0x1e6edf,_0x1b8e4c,_0x1afd5c){var _0x957d7=new History(_0x1b8e4c);if(_0x957d7[_0xca9f('0xfa')]+_0x957d7[_0xca9f('0xfb')]+_0x957d7[_0xca9f('0xfc')]+_0x957d7[_0xca9f('0xfd')]+_0x957d7['countdropretry']+_0x957d7[_0xca9f('0xff')]+_0x957d7[_0xca9f('0x100')]+_0x957d7['countagentrejectretry']>=_0x1afd5c[_0xca9f('0x102')]-0x1){return!![];}switch(_0x1e6edf){case 0x3:if(_0x957d7['countnoanswerretry']>=_0x1afd5c['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0xca9f('0xc8')]({'active':![],'countnoanswerretry':_0x957d7['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x1afd5c[_0xca9f('0x1aa')],_0xca9f('0x10c'))[_0xca9f('0x78')](_0xca9f('0x106')),'ContactId':_0x957d7['ContactId'],'ListId':_0x957d7['ListId'],'VoiceQueueId':_0x957d7[_0xca9f('0xdd')]||undefined,'CampaignId':_0x957d7[_0xca9f('0xde')]||undefined})[_0xca9f('0xb5')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x957d7[_0xca9f('0xfa')]>=_0x1afd5c[_0xca9f('0x1ab')]-0x1){return!![];}this[_0xca9f('0xc8')]({'active':![],'countbusyretry':_0x957d7[_0xca9f('0xfa')]+=0x1,'scheduledat':moment()[_0xca9f('0x105')](_0x1afd5c[_0xca9f('0x1ac')],_0xca9f('0x10c'))[_0xca9f('0x78')](_0xca9f('0x106')),'ContactId':_0x957d7['ContactId'],'ListId':_0x957d7[_0xca9f('0xdb')],'VoiceQueueId':_0x957d7[_0xca9f('0xdd')]||undefined,'CampaignId':_0x957d7[_0xca9f('0xde')]||undefined})[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x1ad')));break;case 0x8:if(_0x957d7['countcongestionretry']>=_0x1afd5c[_0xca9f('0x1ae')]-0x1){return!![];}this[_0xca9f('0xc8')]({'active':![],'countcongestionretry':_0x957d7['countcongestionretry']+=0x1,'scheduledat':moment()[_0xca9f('0x105')](_0x1afd5c['dialCongestionRetryFrequency'],_0xca9f('0x10c'))[_0xca9f('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x957d7[_0xca9f('0xda')],'ListId':_0x957d7[_0xca9f('0xdb')],'VoiceQueueId':_0x957d7['VoiceQueueId']||undefined,'CampaignId':_0x957d7[_0xca9f('0xde')]||undefined})[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x1af')));break;case 0x0:if(_0x957d7[_0xca9f('0xfd')]>=_0x1afd5c[_0xca9f('0x1b0')]-0x1){return!![];}else{this[_0xca9f('0xc8')]({'active':![],'countnosuchnumberretry':_0x957d7[_0xca9f('0xfd')]+=0x1,'scheduledat':moment()[_0xca9f('0x105')](_0x1afd5c[_0xca9f('0x1b1')],_0xca9f('0x10c'))[_0xca9f('0x78')](_0xca9f('0x106')),'ContactId':_0x957d7['ContactId'],'ListId':_0x957d7[_0xca9f('0xdb')],'VoiceQueueId':_0x957d7['VoiceQueueId']||undefined,'CampaignId':_0x957d7[_0xca9f('0xde')]||undefined})[_0xca9f('0xb5')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x957d7[_0xca9f('0xfe')]>=_0x1afd5c['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x957d7[_0xca9f('0xfe')]+=0x1,'scheduledat':moment()[_0xca9f('0x105')](_0x1afd5c['dialDropRetryFrequency'],'minutes')[_0xca9f('0x78')](_0xca9f('0x106')),'ContactId':_0x957d7[_0xca9f('0xda')],'ListId':_0x957d7[_0xca9f('0xdb')],'VoiceQueueId':_0x957d7['VoiceQueueId']||undefined,'CampaignId':_0x957d7[_0xca9f('0xde')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x957d7['countabandonedretry']>=_0x1afd5c[_0xca9f('0x12d')]-0x1){return!![];}this[_0xca9f('0xc8')]({'active':![],'countabandonedretry':_0x957d7['countabandonedretry']+=0x1,'scheduledat':moment()[_0xca9f('0x105')](_0x1afd5c['dialAbandonedRetryFrequency'],_0xca9f('0x10c'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x957d7[_0xca9f('0xda')],'ListId':_0x957d7[_0xca9f('0xdb')],'VoiceQueueId':_0x957d7[_0xca9f('0xdd')]||undefined,'CampaignId':_0x957d7[_0xca9f('0xde')]||undefined})['catch'](loggerCatch(_0xca9f('0x1b2')));break;case 0x13:if(_0x957d7['countmachineretry']>=_0x1afd5c[_0xca9f('0x10a')]-0x1){return!![];}this[_0xca9f('0xc8')]({'active':![],'countmachineretry':_0x957d7[_0xca9f('0x100')]+=0x1,'scheduledat':moment()['add'](_0x1afd5c[_0xca9f('0x1b3')],_0xca9f('0x10c'))[_0xca9f('0x78')](_0xca9f('0x106')),'ContactId':_0x957d7[_0xca9f('0xda')],'ListId':_0x957d7['ListId'],'VoiceQueueId':_0x957d7['VoiceQueueId']||undefined,'CampaignId':_0x957d7['CampaignId']||undefined})[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x10d')));break;case 0x14:if(_0x957d7['countagentrejectretry']>=_0x1afd5c[_0xca9f('0x1b4')]-0x1){return!![];}this[_0xca9f('0xc8')]({'active':![],'countagentrejectretry':_0x957d7['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x1afd5c[_0xca9f('0x1b5')],_0xca9f('0x10c'))[_0xca9f('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x957d7[_0xca9f('0xda')],'ListId':_0x957d7[_0xca9f('0xdb')],'VoiceQueueId':_0x957d7[_0xca9f('0xdd')]||undefined,'CampaignId':_0x957d7[_0xca9f('0xde')]||undefined})[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x1b6')));break;default:return!![];}};Dialer[_0xca9f('0xb1')][_0xca9f('0x1a8')]=function(_0x147462,_0x4c547b,_0x55e439){var _0x594bda=this;var _0x51b677=new History(_0x147462);var _0x1546e6=![];var _0x44bb11;var _0x3f1703;return new BPromise(function(_0x1ecfc2,_0x1fb8b7){if(_[_0xca9f('0x87')](_0x4c547b)&&typeof _0x4c547b!==_0xca9f('0x178')){return _0x1fb8b7(msgResponse(_0xca9f('0x1b7'),_0xca9f('0x152'),_0xca9f('0x1b8')));}if(_[_0xca9f('0x87')](_0x55e439)&&typeof _0x55e439!==_0xca9f('0x178')){return _0x1fb8b7(msgResponse(_0xca9f('0x1b7'),_0xca9f('0x152'),'evt\x20is\x20undefine'));}_0x594bda['verifyAdditionalPhones'](_0x51b677,_0x55e439[_0xca9f('0x116')],_0x4c547b)[_0xca9f('0xbc')](function(_0x1ff13d){if(_0x1ff13d['additional']==0x1)_0x1546e6=!![];switch(_0x55e439[_0xca9f('0x116')]){case'0':_0x4c547b[_0xca9f('0x65')]+=0x1;_0x51b677[_0xca9f('0xa8')]=0x0;_0x51b677[_0xca9f('0xa9')]=_0xca9f('0x1b9');_0x51b677['countnosuchnumberretry']+=0x1;_0x51b677[_0xca9f('0xf7')]+=0x1;ami[_0xca9f('0xef')]('custom:agentnosuchnumber',ut[_0xca9f('0xf8')](_0x147462,_0xca9f('0x1ba')));_0x44bb11=_0x4c547b[_0xca9f('0x1b1')];_0x3f1703=_0x4c547b[_0xca9f('0x122')];_0x594bda[_0xca9f('0xd5')](_0x51b677)[_0xca9f('0xb5')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x594bda['checkRetriveMax'](0x0,_0x147462,_0x4c547b)&&!_0x1546e6){if(_0x51b677[_0xca9f('0xfd')]>=_0x4c547b['dialNoSuchNumberMaxRetry']){_0x594bda[_0xca9f('0x10b')](_0x51b677,_0x1ecfc2,_0x1fb8b7,_0xca9f('0x1bb'));}else{_0x594bda['stateGlobal'](_0x51b677,_0x1ecfc2,_0x1fb8b7,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x4c547b[_0xca9f('0x64')]+=0x1;_0x51b677[_0xca9f('0xa8')]=0x3;_0x51b677[_0xca9f('0xa9')]=_0xca9f('0x1bc');_0x51b677['countnoanswerretry']+=0x1;_0x51b677[_0xca9f('0xf7')]+=0x1;ami[_0xca9f('0xef')](_0xca9f('0x1bd'),ut[_0xca9f('0xf8')](_0x147462,_0xca9f('0x1be')));_0x44bb11=_0x4c547b['dialNoAnswerRetryFrequency'];_0x3f1703=_0x4c547b[_0xca9f('0x122')];_0x594bda[_0xca9f('0xd5')](_0x51b677)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x1bf')));if(_0x594bda[_0xca9f('0x1c0')](0x3,_0x147462,_0x4c547b)&&!_0x1546e6){if(_0x51b677[_0xca9f('0xfc')]>=_0x4c547b['dialNoAnswerMaxRetry']){_0x594bda['createStateFinal'](_0x51b677,_0x1ecfc2,_0x1fb8b7,'reason\x203\x20ringing\x20no\x20answer');}else{_0x594bda['stateGlobal'](_0x51b677,_0x1ecfc2,_0x1fb8b7,_0xca9f('0x1c1'));}}break;case'5':_0x4c547b[_0xca9f('0x60')]+=0x1;_0x51b677[_0xca9f('0xa8')]=0x5;_0x51b677[_0xca9f('0xa9')]='Busy';_0x51b677[_0xca9f('0xfa')]+=0x1;_0x51b677[_0xca9f('0xf7')]+=0x1;ami[_0xca9f('0xef')](_0xca9f('0x1c2'),ut[_0xca9f('0xf8')](_0x147462,_0xca9f('0x1c3')));_0x44bb11=_0x4c547b[_0xca9f('0x1ac')];_0x3f1703=_0x4c547b[_0xca9f('0x122')];_0x594bda[_0xca9f('0xd5')](_0x51b677)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x1c4')));if(_0x594bda[_0xca9f('0x1c0')](0x5,_0x147462,_0x4c547b)&&!_0x1546e6){if(_0x51b677[_0xca9f('0xfa')]>=_0x4c547b['dialBusyMaxRetry']){_0x594bda[_0xca9f('0x10b')](_0x51b677,_0x1ecfc2,_0x1fb8b7,_0xca9f('0x1c5'));}else{_0x594bda[_0xca9f('0x109')](_0x51b677,_0x1ecfc2,_0x1fb8b7,'reason\x205\x20busy');}}break;case'8':_0x4c547b['outboundCongestionCallsDay']+=0x1;_0x51b677[_0xca9f('0xa8')]=0x8;_0x51b677[_0xca9f('0xa9')]='Congestion';_0x51b677[_0xca9f('0xfb')]+=0x1;_0x51b677[_0xca9f('0xf7')]+=0x1;_0x44bb11=_0x4c547b[_0xca9f('0x1c6')];_0x3f1703=_0x4c547b[_0xca9f('0x122')];ami['emit'](_0xca9f('0x1c7'),ut[_0xca9f('0xf8')](_0x147462,_0xca9f('0x1c8')));_0x594bda[_0xca9f('0xd5')](_0x51b677)[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x1c9')));if(_0x594bda[_0xca9f('0x1c0')](0x8,_0x147462,_0x4c547b)&&!_0x1546e6){if(_0x51b677[_0xca9f('0xfb')]>=_0x4c547b['dialCongestionMaxRetry']){_0x594bda[_0xca9f('0x10b')](_0x51b677,_0x1ecfc2,_0x1fb8b7,'reason\x208\x20congestion');}else{_0x594bda[_0xca9f('0x109')](_0x51b677,_0x1ecfc2,_0x1fb8b7,_0xca9f('0x1ca'));}}break;case'11':_0x4c547b['outboundAbandonedCallsDay']+=0x1;_0x51b677[_0xca9f('0xa8')]=0xb;_0x51b677[_0xca9f('0xa9')]=_0xca9f('0x129');_0x51b677[_0xca9f('0xff')]+=0x1;_0x51b677[_0xca9f('0xf7')]+=0x1;_0x44bb11=_0x4c547b['dialAbandonedRetryFrequency'];_0x3f1703=_0x4c547b['callAdditionalPhoneAfterMin'];_0x594bda[_0xca9f('0xd5')](_0x51b677)[_0xca9f('0xb5')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x594bda[_0xca9f('0x1c0')](0xb,_0x147462,_0x4c547b)&&!_0x1546e6){if(_0x51b677[_0xca9f('0xff')]>=_0x4c547b[_0xca9f('0x12d')]){_0x594bda[_0xca9f('0x10b')](_0x51b677,_0x1ecfc2,_0x1fb8b7,_0xca9f('0x1cb'));}else{_0x594bda[_0xca9f('0x109')](_0x51b677,_0x1ecfc2,_0x1fb8b7,_0xca9f('0x1cb'));}}break;case'20':_0x4c547b[_0xca9f('0x1cc')]+=0x1;_0x51b677['state']=0x14;_0x51b677[_0xca9f('0xa9')]='AgentReject';_0x51b677[_0xca9f('0x101')]+=0x1;_0x51b677[_0xca9f('0xf7')]+=0x1;_0x44bb11=_0x4c547b['dialAgentRejectRetryFrequency'];_0x3f1703=_0x4c547b[_0xca9f('0x122')];ami[_0xca9f('0xef')](_0xca9f('0x1cd'),ut['buildObj'](_0x147462,'agentreject'));_0x594bda[_0xca9f('0xd5')](_0x51b677)[_0xca9f('0xb5')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x594bda[_0xca9f('0x1c0')](0x14,_0x147462,_0x4c547b)&&!_0x1546e6){if(_0x51b677[_0xca9f('0x101')]>=_0x4c547b[_0xca9f('0x1b4')]){_0x594bda['createStateFinal'](_0x51b677,_0x1ecfc2,_0x1fb8b7,'reason\x2020\x20agentreject');}else{_0x594bda[_0xca9f('0x109')](_0x51b677,_0x1ecfc2,_0x1fb8b7,_0xca9f('0x1ce'));}}break;default:_0x4c547b['outboundUnknownCallsDay']+=0x1;_0x51b677[_0xca9f('0xa8')]=0xc;_0x51b677[_0xca9f('0xa9')]=_0x55e439[_0xca9f('0x116')];_0x44bb11=_0x4c547b['dialAgentRejectRetryFrequency'];_0x3f1703=_0x4c547b[_0xca9f('0x122')];_0x594bda[_0xca9f('0xd5')](_0x51b677)[_0xca9f('0xb5')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x594bda['checkRetriveMax'](_0x55e439['reason'],_0x147462,_0x4c547b)&&!_0x1546e6){if(_0x51b677['countbusyretry']+_0x51b677[_0xca9f('0xfb')]+_0x51b677['countnoanswerretry']+_0x51b677[_0xca9f('0xfd')]+_0x51b677['countdropretry']+_0x51b677[_0xca9f('0xff')]+_0x51b677[_0xca9f('0x100')]+_0x51b677[_0xca9f('0x101')]>=_0x4c547b[_0xca9f('0x102')]){_0x594bda[_0xca9f('0x109')](_0x51b677,_0x1ecfc2,_0x1fb8b7,_0x55e439[_0xca9f('0x116')]);}else{_0x594bda[_0xca9f('0x10b')](_0x51b677,_0x1ecfc2,_0x1fb8b7,_0x55e439[_0xca9f('0x116')]);}}}})[_0xca9f('0xbc')](function(_0x4563b8){if(_0x1546e6){_0x594bda['swapAdditionalPhones'](_0x51b677,_0x44bb11,_0x3f1703)['then'](function(_0x302f09){return _0x1ecfc2(0x1);});}});});};Dialer['prototype'][_0xca9f('0x109')]=function(_0x6d38e1,_0x34d9f0,_0x21feb3,_0xb45225){var _0x39eb24=new Final(_0x6d38e1);_0x39eb24[_0xca9f('0xa8')]=0xf;_0x39eb24[_0xca9f('0xa9')]='Global';this['createStateFinal'](_0x39eb24,_0x34d9f0,_0x21feb3,_0xb45225);};Dialer[_0xca9f('0xb1')][_0xca9f('0x10b')]=function(_0x56d6dd,_0x133307,_0x562fcc,_0x384918){this[_0xca9f('0xd3')](_0x56d6dd)['then'](function(){return _0x133307(msgResponse(_0xca9f('0x1b7'),_0xca9f('0xe2'),_0x384918));})[_0xca9f('0xb5')](function(){return _0x562fcc(msgResponse('[moveContactManagedDialer][0]',_0xca9f('0x152'),_0xca9f('0x1cf')));});};Dialer[_0xca9f('0xb1')][_0xca9f('0x16a')]=function(_0x1866cf){var _0x5abd3a=_0x1866cf[_0xca9f('0x1d0')]/0x64;var _0x42994=_0x1866cf[_0xca9f('0x63')]/(_0x1866cf['outboundDropCallsDayTimeout']+_0x1866cf[_0xca9f('0x5e')]);var _0x58c6e8=Math['round'](_0x1866cf[_0xca9f('0x1d1')]*(_0x1866cf[_0xca9f('0x1d2')]/0x64));var _0x362485=Math[_0xca9f('0x1d3')](_0x1866cf[_0xca9f('0x1d1')]*(_0x1866cf['predictiveIntervalMinThreshold']/0x64));var _0x5d905a=_0x1866cf['available']+_0x1866cf['talking'];var _0x55a333=Math[_0xca9f('0x1d4')](_0x1866cf[_0xca9f('0x72')]*_0x1866cf[_0xca9f('0x73')]*_0x1866cf[_0xca9f('0x1d5')]*_0x1866cf[_0xca9f('0x6e')]);if(_['isUndefined'](_0x1866cf[_0xca9f('0x29')])){if(!_[_0xca9f('0x87')](_0x1866cf[_0xca9f('0x28')])){_0x1866cf[_0xca9f('0x28')]=undefined;loggerPredictive[_0xca9f('0x96')]('[startMethodPredictive][StartProgressive]',_0xca9f('0x1d6'));}if(!_[_0xca9f('0x87')](_0x1866cf[_0xca9f('0x93')])){loggerPredictive[_0xca9f('0x96')]('[startMethodPredictive][StartProgressive]',_0xca9f('0x1d7'));clearInterval(_0x1866cf['handlePredictive']);_0x1866cf[_0xca9f('0x93')]=undefined;}_0x1866cf[_0xca9f('0x29')]=moment()['format'](_0xca9f('0x106'));loggerPredictive[_0xca9f('0x7e')](_0x1866cf[_0xca9f('0x3c')],_0xca9f('0x1d8'),_0x1866cf[_0xca9f('0x29')]);this[_0xca9f('0x168')](_0x1866cf,0x1);}else if(ifInterval(_0x1866cf[_0xca9f('0x1d9')],_0x1866cf[_0xca9f('0x29')])){this[_0xca9f('0x168')](_0x1866cf,0x1);loggerPredictiveCalls[_0xca9f('0x7e')](_0xca9f('0x1da'),_0x1866cf[_0xca9f('0x29')],_0x1866cf[_0xca9f('0x3c')]);_0x1866cf[_0xca9f('0x72')]=0x0;_0x1866cf[_0xca9f('0x6d')]=0x0;}else if(_0x5abd3a<_0x42994&&_0x1866cf[_0xca9f('0x1db')]===_0xca9f('0x1dc')){freeVariablesPredictive(_0x1866cf);loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x1dd'),_0xca9f('0x1de'),_0x42994,_0xca9f('0x29'),_0x1866cf[_0xca9f('0x3c')]);}else if(_0x55a333<_0x1866cf[_0xca9f('0x6d')]&&_0x1866cf[_0xca9f('0x1db')]===_0xca9f('0x1dc')){freeVariablesPredictive(_0x1866cf);loggerPredictive[_0xca9f('0x7e')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xca9f('0x1df'),_0x55a333,_0xca9f('0x1e0'),_0x1866cf[_0xca9f('0x6d')],'startProgressive',_0x1866cf['name']);}else if(!ifInterval(_0x1866cf[_0xca9f('0x1d9')],_0x1866cf[_0xca9f('0x29')])&&_['isUndefined'](_0x1866cf[_0xca9f('0x28')])&&!_[_0xca9f('0x87')](_0x1866cf[_0xca9f('0x29')])){_0x1866cf['startPredictive']=moment()[_0xca9f('0x78')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xca9f('0x7e')](_0x1866cf['name'],'started\x20in\x20predictive\x20at',_0x1866cf[_0xca9f('0x28')]);this[_0xca9f('0xc6')](_0x1866cf[_0xca9f('0x1d9')])[_0xca9f('0xbc')](this[_0xca9f('0x1e1')](_0x1866cf))[_0xca9f('0xbc')](mergeDataErlangB(_0x1866cf))['then'](this[_0xca9f('0x1e2')](_0x1866cf))[_0xca9f('0xb5')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x1866cf));}else if(!ifInterval(_0x1866cf[_0xca9f('0x1d9')],_0x1866cf[_0xca9f('0x28')])){_0x1866cf['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x1866cf[_0xca9f('0x28')]=moment()[_0xca9f('0x78')](_0xca9f('0x106'));loggerPredictive[_0xca9f('0x7e')](_0x1866cf[_0xca9f('0x3c')],_0xca9f('0x1e3'),_0x1866cf[_0xca9f('0x28')]);clearInterval(_0x1866cf[_0xca9f('0x93')]);_0x1866cf[_0xca9f('0x93')]=undefined;this[_0xca9f('0xc6')](_0x1866cf[_0xca9f('0x1d9')])[_0xca9f('0xbc')](this[_0xca9f('0x1e1')](_0x1866cf))[_0xca9f('0xbc')](mergeDataErlangB(_0x1866cf))[_0xca9f('0xbc')](this[_0xca9f('0x1e2')](_0x1866cf))[_0xca9f('0xb5')](loggerCatchPredictive(_0xca9f('0x1e4'),_0x1866cf));}else if(_0x1866cf[_0xca9f('0x1d1')]&&_0x5d905a<_0x1866cf[_0xca9f('0x1d1')]-_0x362485){freeVariablesPredictive(_0x1866cf);loggerPredictive[_0xca9f('0x7e')](_0x1866cf['name'],_0xca9f('0x1e5'),_0x5d905a,_0xca9f('0x1e6'),_0x1866cf['predictiveIntervalAvailable'],'-',_0x362485,'=',_0x1866cf[_0xca9f('0x1d1')]-_0x362485,')');}else if(_0x1866cf[_0xca9f('0x1d1')]&&_0x5d905a>_0x1866cf[_0xca9f('0x1d1')]+_0x58c6e8){freeVariablesPredictive(_0x1866cf);loggerPredictive[_0xca9f('0x7e')](_0x1866cf[_0xca9f('0x3c')],_0xca9f('0x1e5'),_0x5d905a,')\x20are\x20more\x20than\x20threshold\x20(',_0x1866cf[_0xca9f('0x1d1')],'+',_0x58c6e8,'=',_0x1866cf[_0xca9f('0x1d1')]+_0x58c6e8,')');}};Dialer[_0xca9f('0xb1')]['getDataPredictive']=function(_0x522d35){var _0xf85bbd=this;return function(_0x5c78d1){return new BPromise(function(_0x4dedcb,_0x5a62fa){_[_0xca9f('0x90')](_0x522d35,_0x5c78d1[0x0]);if(checkGetDataPredictive(_0x5c78d1[0x0])){var _0x47f4d9=_0x522d35['predictiveIntervalAvailable']=_0x522d35['talking']+_0x522d35['available'];var _0x3c8454=_0x522d35[_0xca9f('0x1d9')]*0x3c;var _0x346c1e=_0x5c78d1[0x0][_0xca9f('0x69')]+_0x5c78d1[0x0]['predictiveIntervalAvgHoldtime'];var _0x5b4d84=(_0x5c78d1[0x0][_0xca9f('0x81')]+_0x5c78d1[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5c78d1[0x0][_0xca9f('0x6a')])/_0x5c78d1[0x0][_0xca9f('0x70')];_0x522d35[_0xca9f('0x1d5')]=_0x5b4d84>0x0?_0x5b4d84:0x1;switch(_0x522d35[_0xca9f('0x1db')]){case _0xca9f('0x1dc'):var _0x56b2a2=_0x522d35[_0xca9f('0x1d0')]/0x64;return _0xf85bbd[_0xca9f('0x1e7')](_0x47f4d9,_0x3c8454,_0x346c1e,_0x5b4d84,_0x56b2a2)[_0xca9f('0xbc')](function(_0x375474){return _0x4dedcb(_0x375474);});case _0xca9f('0x1e8'):var _0x10c6d3=_0x522d35[_0xca9f('0x1d0')]/0x64;return _0xf85bbd['busyFactor'](_0x47f4d9,_0x3c8454,_0x346c1e,_0x5b4d84,_0x10c6d3)[_0xca9f('0xbc')](function(_0x3643b1){return _0x4dedcb(_0x3643b1);});default:return _0x5a62fa(msgResponse(_0xca9f('0x1e9'),_0xca9f('0x152'),'Unknown\x20Predictive'));}}else{return _0x5a62fa(msgResponse(_0xca9f('0x1e9'),'Failure','check\x20failure'));}});};};Dialer[_0xca9f('0xb1')][_0xca9f('0x1ea')]=function(_0xcdad94){var _0x547984=this;return function(_0x4cfa76){return new BPromise(function(_0x5c9b57,_0x59da72){_[_0xca9f('0x90')](_0xcdad94,_0x4cfa76[0x0]);if(checkGetDataPredictive(_0x4cfa76[0x0])){loggerPredictive[_0xca9f('0x7e')](JSON[_0xca9f('0x46')](_0x4cfa76[0x0]));if(_0xcdad94[_0xca9f('0x1db')]===_0xca9f('0x1dc')){return _0x547984['getVoiceQueueRtPauses'](_0xcdad94['id'])[_0xca9f('0xbc')](function(_0xc5b4c5){var _0x20f6a8=_0xcdad94[_0xca9f('0x4e')]-_0xc5b4c5[0x0]['outboundQueuePauses'];var _0xbb9d22=_0xcdad94['dialPredictiveInterval']*0x3c;var _0x3f3a75=_0x4cfa76[0x0][_0xca9f('0x69')]+_0x4cfa76[0x0][_0xca9f('0x68')];var _0x328b96=(_0x4cfa76[0x0][_0xca9f('0x81')]+_0x4cfa76[0x0][_0xca9f('0x6b')]+_0x4cfa76[0x0][_0xca9f('0x6a')])/_0x4cfa76[0x0][_0xca9f('0x70')];var _0xa223a8=_0xcdad94[_0xca9f('0x1d0')]/0x64;_0xcdad94['predictiveIntervalPauses']=_0xc5b4c5[0x0][_0xca9f('0x1eb')]||0x0;_0xcdad94[_0xca9f('0x1d5')]=_0x328b96>0x0?_0x328b96:0x1;return _0x547984[_0xca9f('0x1e7')](_0x20f6a8,_0xbb9d22,_0x3f3a75,_0x328b96,_0xa223a8);})['then'](function(_0x3bd368){return _0x5c9b57(_0x3bd368);})[_0xca9f('0xb5')](function(_0x40c329){return _0x59da72(msgResponse(_0xca9f('0x1ec'),'Failure',JSON[_0xca9f('0x46')](_0x40c329)));});}if(_0xcdad94[_0xca9f('0x1db')]==='agentBusyFactor'){return _0x547984['getVoiceQueueRtPauses'](_0xcdad94['id'])[_0xca9f('0xbc')](function(_0x5a095b){var _0xbf76e8=_0xcdad94[_0xca9f('0x4e')]-_0x5a095b[0x0][_0xca9f('0x1eb')];var _0x4e895e=_0xcdad94[_0xca9f('0x1d9')]*0x3c;var _0x40ab06=_0x4cfa76[0x0][_0xca9f('0x69')]+_0x4cfa76[0x0][_0xca9f('0x68')];var _0x3dec8a=(_0x4cfa76[0x0][_0xca9f('0x81')]+_0x4cfa76[0x0][_0xca9f('0x6b')]+_0x4cfa76[0x0][_0xca9f('0x6a')])/_0x4cfa76[0x0]['predictiveIntervalTotalCalls'];var _0x2dc4fb=_0xcdad94['dialPredictiveOptimizationPercentage']/0x64;_0xcdad94[_0xca9f('0x6f')]=_0x5a095b[0x0][_0xca9f('0x1eb')]||0x0;_0xcdad94[_0xca9f('0x1d5')]=_0x3dec8a>0x0?_0x3dec8a:0x1;return _0x547984['busyFactor'](_0xbf76e8,_0x4e895e,_0x40ab06,_0x3dec8a,_0x2dc4fb);})[_0xca9f('0xbc')](function(_0x56d121){return _0x5c9b57(_0x56d121);})[_0xca9f('0xb5')](function(_0x44826){return _0x59da72(msgResponse(_0xca9f('0x1ec'),'Failure',JSON[_0xca9f('0x46')](_0x44826)));});}}else{return _0x59da72(msgResponse('[getDataPredictive]',_0xca9f('0x152'),_0xca9f('0x1ed')));}});};};Dialer[_0xca9f('0xb1')][_0xca9f('0x1e2')]=function(_0x49f95c){var _0x318688=this;return function(){var _0x3157e6=0x0;var _0x4ccc4f=Math[_0xca9f('0x1d4')](_0x49f95c['erlangCallToSecond']*0x3e8);if(_0x4ccc4f>0x0){_0x4ccc4f=_0x4ccc4f<0x64?0x64:_0x4ccc4f;loggerPredictive[_0xca9f('0x7e')](_0x49f95c['name'],_0xca9f('0x1ee'),_0x4ccc4f,_0xca9f('0x47'));_0x49f95c['handlePredictive']=setInterval(function(){_0x318688[_0xca9f('0x93')](_0x49f95c);loggerPredictiveCalls['info'](_0xca9f('0x1ef'),_0x3157e6+=0x1);},_0x4ccc4f);}else{loggerPredictive[_0xca9f('0x7e')](_0x49f95c[_0xca9f('0x3c')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype']['checkContactBlack']=function(_0x1041e6,_0x223725){var _0x27ecc1=this;return function(_0x464ec5){if(_[_0xca9f('0x43')](_0x464ec5)){if(_[_0xca9f('0xb2')](_0x223725[_0xca9f('0xdc')])||!_0x223725['recallme']){if(_0x1041e6[_0xca9f('0x58')]===_0xca9f('0x1f0')){_0x1041e6[_0xca9f('0x139')]=_[_0xca9f('0x87')](_0x1041e6['queueStatusComplete'])?!![]:_0x1041e6[_0xca9f('0x139')];var _0x4e557b=uuid['v4']();_0x27ecc1[_0xca9f('0x25')][_0x4e557b]=new Action(_0x1041e6,_0x223725,_0x4e557b);loggerBooked['info']('[booked][checkContactBlack]',_0x4e557b,_0xca9f('0x1f1'),JSON[_0xca9f('0x46')](_0x1041e6[_0xca9f('0x139')]),_0xca9f('0x1f2'),_0x1041e6[_0xca9f('0x3c')]);if(_0x1041e6[_0xca9f('0x139')]){_0x1041e6[_0xca9f('0x139')]=![];_0x27ecc1[_0xca9f('0x2b')][_0x27ecc1[_0xca9f('0x25')][_0x4e557b]['queue']]=[];ami[_0xca9f('0x159')]({'actionid':_0x4e557b,'action':_0xca9f('0x1f3'),'queue':_0x1041e6[_0xca9f('0x3c')]})[_0xca9f('0xb5')](function(){_0x27ecc1[_0xca9f('0xb7')](_0x1041e6);_0x27ecc1[_0xca9f('0xc8')]({'active':![],'ContactId':_0x27ecc1[_0xca9f('0x25')][_0x4e557b][_0xca9f('0xda')],'ListId':_0x27ecc1[_0xca9f('0x25')][_0x4e557b][_0xca9f('0xdb')],'VoiceQueueId':_0x27ecc1[_0xca9f('0x25')][_0x4e557b][_0xca9f('0xdd')]||undefined,'CampaignId':_0x27ecc1[_0xca9f('0x25')][_0x4e557b][_0xca9f('0xde')]||undefined})[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x1f4')));delete _0x27ecc1[_0xca9f('0x25')][_0x4e557b];});}else{loggerBooked[_0xca9f('0x7e')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x1041e6['queueStatusComplete']),_0xca9f('0x1f2'),_0x1041e6[_0xca9f('0x3c')]);_0x27ecc1[_0xca9f('0xb7')](_0x1041e6);_0x27ecc1[_0xca9f('0xc8')]({'active':![],'ContactId':_0x27ecc1[_0xca9f('0x25')][_0x4e557b][_0xca9f('0xda')],'ListId':_0x27ecc1['actions'][_0x4e557b][_0xca9f('0xdb')],'VoiceQueueId':_0x27ecc1[_0xca9f('0x25')][_0x4e557b][_0xca9f('0xdd')]||undefined,'CampaignId':_0x27ecc1['actions'][_0x4e557b][_0xca9f('0xde')]||undefined})[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x1f4')));delete _0x27ecc1[_0xca9f('0x25')][_0x4e557b];}}else{return _0x27ecc1[_0xca9f('0x177')](_0x1041e6,_0x223725);}}else{if(getDiff(_0x223725['scheduledat'])<_0x1041e6[_0xca9f('0x1f5')]*0x3c){if(_0x223725[_0xca9f('0x1f6')]&&!_0x223725[_0xca9f('0x1f6')][_0xca9f('0x1f7')]){_0x27ecc1['preview'][_0xca9f('0x13b')](_0x223725['id'])[_0xca9f('0x13d')](function(){_0x27ecc1[_0xca9f('0xb7')](_0x1041e6);});}else{_0x27ecc1['unlockContact']({'active':![]},_0x223725['id'],0x1)[_0xca9f('0x13d')](function(){_0x27ecc1[_0xca9f('0xb7')](_0x1041e6);});}}else{_0x1041e6[_0xca9f('0x1f8')]+=0x1;_0x27ecc1[_0xca9f('0xb7')](_0x1041e6);if(_0x1041e6[_0xca9f('0x1f9')]){_0x27ecc1['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x223725[_0xca9f('0xda')],'ListId':_0x223725['ListId'],'VoiceQueueId':_0x223725[_0xca9f('0xdd')]||undefined,'CampaignId':_0x223725['CampaignId']||undefined})[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x1fa')));_0x27ecc1[_0xca9f('0xd5')](createObjHistory(_0x1041e6,_0x223725,_0xca9f('0x1fb'),0x17,_0xca9f('0x1fc')))[_0xca9f('0xb5')](loggerCatch(_0xca9f('0x1fd')));}else{_0x27ecc1['saveInDb'](createObjHistory(_0x1041e6,_0x223725,_0xca9f('0x1fe'),0x16,_0xca9f('0x1ff')),'[Originate][HistoryRecallClose][historyCatch]',_0xca9f('0x200'));}}}}else{_0x1041e6[_0xca9f('0x5f')]+=0x1;_0x27ecc1[_0xca9f('0xd9')](createObjHistory(_0x1041e6,_0x223725,_0xca9f('0x201'),0xd,_0xca9f('0x202')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0xca9f('0x203');}};};Dialer[_0xca9f('0xb1')][_0xca9f('0x16e')]=function(_0x22770c){var _0x500433=this;var _0x54bb7b=_0x22770c['limitCalls']-_0x22770c[_0xca9f('0x71')]-_0x22770c[_0xca9f('0xcd')];emitCampaignSummary(_0x22770c);if(_0x54bb7b>0x0){if(_0x54bb7b>this['maxNumberOriginate']){_0x54bb7b=this[_0xca9f('0x23')];}_0x22770c['temp']+=_0x54bb7b;this['getContactDialerIvr'](_0x22770c['id'],_0x54bb7b,_0x22770c[_0xca9f('0x204')],_0x22770c)[_0xca9f('0xbc')](function(_0x560a57){_0x22770c['temp']-=_0x54bb7b;_0x22770c[_0xca9f('0xcd')]=_0x22770c['temp']>0x0?_0x22770c[_0xca9f('0xcd')]:0x0;if(!checkContactEmpty(_0x560a57)){_0x22770c[_0xca9f('0x3a')]=_0xca9f('0x205');logger[_0xca9f('0x7e')](_0xca9f('0x206')+_0x22770c['name']);}else{_0x22770c['originated']+=_0x560a57['length'];_0x22770c['message']=_0xca9f('0x207');for(var _0xc1afb=0x0;_0xc1afb<_0x560a57[_0xca9f('0x141')];_0xc1afb+=0x1){_0x22770c[_0xca9f('0x208')]+=0x1;if(_[_0xca9f('0xb2')](_0x560a57[_0xc1afb])||_[_0xca9f('0xb2')](_0x560a57[_0xc1afb][_0xca9f('0x195')])||_[_0xca9f('0xb2')](_0x560a57[_0xc1afb][_0xca9f('0x17b')])){_0x500433[_0xca9f('0x209')](_0xca9f('0x20a'),_0x22770c,_0x560a57[_0xc1afb]);}else{_0x500433['checkIsBlackListIvr'](_[_0xca9f('0x136')](_0x560a57[_0xc1afb],[_0xca9f('0xde'),'Contact.phone']))[_0xca9f('0xbc')](_0x500433[_0xca9f('0x20b')](_0x22770c,_0x560a57[_0xc1afb]))[_0xca9f('0xb5')](_0x500433[_0xca9f('0x20c')](_0xca9f('0x20d'),_0x22770c));}}}})['catch'](loggerGetContactDialer(_0xca9f('0x20e'),_0x22770c,_0x54bb7b));}};Dialer[_0xca9f('0xb1')][_0xca9f('0x168')]=function(_0xc4dba9,_0x44df94){var _0x58232e=this;var _0xdbbd22=[];var _0x45e95d=_0x44df94>=0x1?_0x44df94:0x1;if(_0xc4dba9[_0xca9f('0x58')]==='booked'){_0x45e95d=0x1;}var _0x49b43a=Math[_0xca9f('0x1d4')](_0xc4dba9[_0xca9f('0x4d')]*_0x45e95d)-_0xc4dba9[_0xca9f('0x71')]-_0xc4dba9[_0xca9f('0xcd')];emitVoiceQueueSummary(_0xc4dba9);if(_0xc4dba9[_0xca9f('0x20f')]>0x0){var _0x38064f=_0xc4dba9[_0xca9f('0x20f')]-_0xc4dba9[_0xca9f('0x71')]-_0xc4dba9[_0xca9f('0x52')]-_0xc4dba9[_0xca9f('0xcd')]-_0xc4dba9['pTalking'];if(_0x49b43a>_0x38064f){_0x49b43a=_0x38064f;}}if(_0x49b43a>0x0){if(_0xc4dba9[_0xca9f('0x58')]===_0xca9f('0x1f0')){_0x49b43a=0x1;}if(_0x49b43a>this[_0xca9f('0x23')]){_0x49b43a=this['maxNumberOriginate'];}_0xc4dba9[_0xca9f('0xcd')]+=_0x49b43a;for(var _0x53613c in this[_0xca9f('0x21')]){if(typeof this['agents'][_0x53613c]!=='undefined'){if(this['agents'][_0x53613c][_0xca9f('0xa8')]==='not_inuse'&&this[_0xca9f('0x21')][_0x53613c]['status']===_0xca9f('0xe5')){_0xdbbd22['push'](this[_0xca9f('0x21')][_0x53613c]['id']);}}}this[_0xca9f('0xcc')](_0xc4dba9['id'],_0xdbbd22,_0x49b43a,_0xc4dba9[_0xca9f('0x204')],_0xc4dba9)[_0xca9f('0xbc')](function(_0x4cf1b9){_0xc4dba9[_0xca9f('0xcd')]-=_0x49b43a;_0xc4dba9['temp']=_0xc4dba9[_0xca9f('0xcd')]>0x0?_0xc4dba9[_0xca9f('0xcd')]:0x0;if(!checkContactEmpty(_0x4cf1b9)){_0x58232e[_0xca9f('0xba')](_0xc4dba9)[_0xca9f('0xbc')](sendMessageReschedule(_0xc4dba9))[_0xca9f('0xb5')](loggerCatch(_0xca9f('0xbb')));}else{_0xc4dba9[_0xca9f('0x71')]+=_0x4cf1b9['length'];_0xc4dba9['message']=_0xc4dba9[_0xca9f('0x58')]==='booked'?_0xca9f('0x184'):_0xca9f('0x207');for(var _0x3e24cc=0x0;_0x3e24cc<_0x4cf1b9[_0xca9f('0x141')];_0x3e24cc+=0x1){if(_['isNil'](_0x4cf1b9[_0x3e24cc])||_[_0xca9f('0xb2')](_0x4cf1b9[_0x3e24cc][_0xca9f('0x195')])||_[_0xca9f('0xb2')](_0x4cf1b9[_0x3e24cc]['phone'])){_0x58232e[_0xca9f('0x209')](_0xca9f('0x20a'),_0xc4dba9,_0x4cf1b9[_0x3e24cc]);}else{_0x58232e[_0xca9f('0xbd')](_[_0xca9f('0x136')](_0x4cf1b9[_0x3e24cc],[_0xca9f('0xdd'),_0xca9f('0x210')]))[_0xca9f('0xbc')](_0x58232e[_0xca9f('0x20b')](_0xc4dba9,_0x4cf1b9[_0x3e24cc]))['catch'](_0x58232e['loggerHandler'](_0xca9f('0x20a'),_0xc4dba9));}}}})[_0xca9f('0xb5')](loggerGetContactDialer('[getContactDialer2]',_0xc4dba9,_0x49b43a));}};Dialer['prototype']['handlePredictive']=function(_0x5e4efd){if(_0x5e4efd[_0xca9f('0x20f')]>0x0){var _0x50d9a8=_0x5e4efd[_0xca9f('0x20f')]-_0x5e4efd[_0xca9f('0x71')]-_0x5e4efd[_0xca9f('0x52')];if(_0x50d9a8>0x0){this[_0xca9f('0x211')](_0x5e4efd);}else{loggerPredictiveCalls[_0xca9f('0x7e')](_0xca9f('0x212'));}}else{this[_0xca9f('0x211')](_0x5e4efd);}};Dialer[_0xca9f('0xb1')][_0xca9f('0x211')]=function(_0x38b144){var _0x4052bb=this;var _0x1443ce=[];_0x38b144[_0xca9f('0x71')]+=0x1;for(var _0x2d0fc1 in this[_0xca9f('0x21')]){if(typeof this[_0xca9f('0x21')][_0x2d0fc1]!=='undefined'){if(this[_0xca9f('0x21')][_0x2d0fc1][_0xca9f('0xa8')]===_0xca9f('0x213')&&this['agents'][_0x2d0fc1][_0xca9f('0xb3')]==='reachable'){_0x1443ce[_0xca9f('0x135')](this[_0xca9f('0x21')][_0x2d0fc1]['id']);}}}this[_0xca9f('0xcc')](_0x38b144['id'],_0x1443ce,0x1,_0x38b144[_0xca9f('0x204')],_0x38b144)[_0xca9f('0xbc')](function(_0x5f46be){if(!checkContactEmpty(_0x5f46be)){checkContactLowerLimitOriginate(_0x38b144,0x1,0x0);_0x4052bb[_0xca9f('0xba')](_0x38b144)['then'](sendMessageReschedule(_0x38b144))['catch'](loggerCatch(_0xca9f('0xbb')));}else{_0x38b144[_0xca9f('0x3a')]=_0xca9f('0x207');if(_[_0xca9f('0xb2')](_0x5f46be[0x0])||_[_0xca9f('0xb2')](_0x5f46be[0x0][_0xca9f('0x195')])||_[_0xca9f('0xb2')](_0x5f46be[0x0][_0xca9f('0x17b')])){_0x4052bb['emptyContact'](_0xca9f('0x20a'),_0x38b144,_0x5f46be[0x0]);}else{_0x4052bb['checkIsBlackList'](_['pick'](_0x5f46be[0x0],[_0xca9f('0xdd'),'Contact.phone']))[_0xca9f('0xbc')](_0x4052bb[_0xca9f('0x20b')](_0x38b144,_0x5f46be[0x0]))[_0xca9f('0xb5')](_0x4052bb[_0xca9f('0x20c')](_0xca9f('0x214'),_0x38b144));}}})['catch'](loggerGetContactDialer(_0xca9f('0x215'),_0x38b144,0x1));emitVoiceQueueSummary(_0x38b144);};Dialer[_0xca9f('0xb1')][_0xca9f('0x1e7')]=function(_0x55a062,_0x20414f,_0xbd5a3e,_0x5a172c,_0x3747e2,_0x45cfa3){loggerPredictive['info'](_0xca9f('0x216'));loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x217'),_0x55a062);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x20414f);loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x218'),_0xbd5a3e);loggerPredictive['info'](_0xca9f('0x219'),_0x5a172c);loggerPredictive['info'](_0xca9f('0x21a'),_0x3747e2);loggerPredictive[_0xca9f('0x7e')]('---------------------------');return new BPromise(function(_0x13421a,_0x2a7fb7){if(_0x55a062<=0x0||isNaN(_0x55a062)){return _0x2a7fb7(msgResponse(_0xca9f('0x21b'),_0xca9f('0x1a4'),_0xca9f('0x21c')+_0x55a062));}if(_0xbd5a3e<=0x0||isNaN(_0xbd5a3e)){return _0x2a7fb7(msgResponse(_0xca9f('0x21b'),_0xca9f('0x1a4'),'Ts\x20=\x20'+_0xbd5a3e));}if(_0x5a172c<=0x0||isNaN(_0x5a172c)){return _0x2a7fb7(msgResponse(_0xca9f('0x21b'),_0xca9f('0x1a4'),_0xca9f('0x21d')+_0x5a172c));}if(_0x20414f<=0x0||isNaN(_0x20414f)){return _0x2a7fb7(msgResponse(_0xca9f('0x21b'),_0xca9f('0x1a4'),'interval\x20=\x20'+_0x20414f));}if(_0x3747e2<=0x0||isNaN(_0x3747e2)){return _0x2a7fb7(msgResponse(_0xca9f('0x21b'),_0xca9f('0x1a4'),_0xca9f('0x21e')+_0x3747e2));}_0x45cfa3=_0x45cfa3||0x0;var _0xefe5af=0x1/_0xbd5a3e;var _0x1c6fe1=0x0;var _0x56d3cd=0x0;var _0x424451=0x0;var _0x39226a=0x0;for(var _0x39e037=0x0;_0x424451<_0x3747e2;_0x39e037+=0x1){_0x56d3cd=_0x39e037/_0x20414f;_0x1c6fe1=(_0x5a172c*_0x56d3cd+_0x45cfa3)/_0xefe5af;_0x424451=erlangb(_0x1c6fe1,_0x55a062);_0x39226a=_0x1c6fe1/_0x55a062*(0x1-erlangb(_0x1c6fe1,_0x55a062));}return _0x13421a({'erlangCalls':_0x39e037,'erlangCallToSecond':_0x20414f/_0x39e037,'erlangAbandonmentRate':_0x424451,'erlangBusyFactor':_0x39226a});});};Dialer[_0xca9f('0xb1')]['busyFactor']=function(_0x55ec23,_0x26fe59,_0x4a5a6f,_0x419405,_0x3e49e2,_0x5275cf){loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x21f'));loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x217'),_0x55ec23);loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x220'),_0x26fe59);loggerPredictive['info'](_0xca9f('0x218'),_0x4a5a6f);loggerPredictive['info'](_0xca9f('0x219'),_0x419405);loggerPredictive[_0xca9f('0x7e')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e49e2);loggerPredictive[_0xca9f('0x7e')](_0xca9f('0x86'));return new BPromise(function(_0x18c8f7,_0x43e56d){if(_0x55ec23<=0x0||isNaN(_0x55ec23)){return _0x43e56d(msgResponse('[busyFactor]',_0xca9f('0x1a4'),_0xca9f('0x21c')+_0x55ec23));}if(_0x4a5a6f<=0x0||isNaN(_0x4a5a6f)){return _0x43e56d(msgResponse(_0xca9f('0x221'),'Error',_0xca9f('0x222')+_0x4a5a6f));}if(_0x419405<=0x0||isNaN(_0x419405)){return _0x43e56d(msgResponse(_0xca9f('0x221'),_0xca9f('0x1a4'),_0xca9f('0x21d')+_0x419405));}if(_0x26fe59<=0x0||isNaN(_0x26fe59)){return _0x43e56d(msgResponse(_0xca9f('0x221'),_0xca9f('0x1a4'),_0xca9f('0x223')+_0x26fe59));}if(_0x3e49e2<=0x0||isNaN(_0x3e49e2)){return _0x43e56d(msgResponse(_0xca9f('0x221'),_0xca9f('0x1a4'),_0xca9f('0x224')+_0x3e49e2));}_0x5275cf=_0x5275cf||0x0;var _0x3e71fd=0x1/_0x4a5a6f;var _0xc7982d=0x0;var _0x5ba72f=0x0;var _0x4daefc=0x0;var _0x383fcb=0x0;for(var _0x141e53=0x0;_0x383fcb<_0x3e49e2;_0x141e53+=0x1){_0x5ba72f=_0x141e53/_0x26fe59;_0xc7982d=(_0x419405*_0x5ba72f+_0x5275cf)/_0x3e71fd;_0x4daefc=erlangb(_0xc7982d,_0x55ec23);_0x383fcb=_0xc7982d/_0x55ec23*(0x1-erlangb(_0xc7982d,_0x55ec23));}return _0x18c8f7({'erlangCalls':_0x141e53,'erlangCallToSecond':_0x26fe59/_0x141e53,'erlangAbandonmentRate':_0x4daefc,'erlangBusyFactor':_0x383fcb});});};module[_0xca9f('0x225')]=Dialer; \ No newline at end of file +var _0xdb1e=['[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','enqueue','isNil','status','channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','then','checkIsBlackList','resolve','[checkIsBlackList]\x20','verifyAdditionalPhones','catch','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','Success','SIP/%s','reachable','unmonitored','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','Machine','countglobal','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','stateGlobal','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countagentrejectretry','reason19\x20machine....','dialMachineMaxRetry','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Unknow','agent','agiafterat','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dropreason','callAdditionalPhoneAfterMin','voiceQueue','additional','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','syncQueueMember','actionid','locked','paused','stateinterface','rrmemory','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','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-','toUpper','isTrunkReachable','dialRandomLastDigitCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','response','callProgressDetecting','[callProgressDetecting]\x20','countbusyretry','countnosuchnumberretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialDropRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','Busy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','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','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','maxNumberOriginate','[getContactCampaign2][Empty]','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','RUNNING','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\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','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','[busyFactor]','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/voiceQueueRt','./history','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','actions','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuestatuscomplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','Trunk','active','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined'];(function(_0x8a545f,_0x176141){var _0x1908a8=function(_0x5352cd){while(--_0x5352cd){_0x8a545f['push'](_0x8a545f['shift']());}};_0x1908a8(++_0x176141);}(_0xdb1e,0x18a));var _0xedb1=function(_0x2835fd,_0x415386){_0x2835fd=_0x2835fd-0x0;var _0x3515b1=_0xdb1e[_0x2835fd];return _0x3515b1;};'use strict';var util=require(_0xedb1('0x0'));var _=require(_0xedb1('0x1'));var BPromise=require(_0xedb1('0x2'));var uuid=require(_0xedb1('0x3'));var moment=require(_0xedb1('0x4'));var rr=require('rr');var md5=require(_0xedb1('0x5'));var Redis=require(_0xedb1('0x6'));var ut=require(_0xedb1('0x7'));var config=require(_0xedb1('0x8'));var logger=require(_0xedb1('0x9'))(_0xedb1('0xa'));var loggerBooked=require(_0xedb1('0x9'))(_0xedb1('0xb'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0xedb1('0xc'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xedb1('0xd'));var ami=require(_0xedb1('0xe'));config[_0xedb1('0xf')]=_['defaults'](config[_0xedb1('0xf')],{'host':'localhost','port':0x18eb});var io=require(_0xedb1('0x10'))(new Redis(config[_0xedb1('0xf')]));var cmHopper=require(_0xedb1('0x11'));var cmHopperHistory=require(_0xedb1('0x12'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperAdditionalPhone=require(_0xedb1('0x13'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xedb1('0x14'));var Action=require('./action');var History=require(_0xedb1('0x15'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xedb1('0x16'));var ipAgi=process[_0xedb1('0x17')][_0xedb1('0x18')]||_0xedb1('0x19');var strategy={'rrmemory':'rrmemory','roundrobin':_0xedb1('0x1a')};var Sequence=function(){};Sequence[_0xedb1('0x1b')]['enqueue']=function(_0x1dd1c7){this[_0xedb1('0x1c')]=this['tail']?this['tail'][_0xedb1('0x1d')](_0x1dd1c7):_0x1dd1c7();};function Dialer(_0x1f14f3,_0x29922f){this[_0xedb1('0x1e')]=new Sequence();this['preview']=_0x29922f;this[_0xedb1('0x1f')]=_0x1f14f3['voiceQueues'];this['campaigns']=_0x1f14f3[_0xedb1('0x20')];this['agents']=_0x1f14f3[_0xedb1('0x21')];this[_0xedb1('0x22')]=_0x1f14f3[_0xedb1('0x22')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this['channels']={};this[_0xedb1('0x23')]={};this['contactsId']={};this[_0xedb1('0x24')]={};this['optionPredictive']={};this[_0xedb1('0x25')]={};this[_0xedb1('0x26')]={};this[_0xedb1('0x27')]={};this[_0xedb1('0x28')]={};this['queueBookedRR']={};ami['on'](_0xedb1('0x29'),this[_0xedb1('0x2a')]['bind'](this));ami['on'](_0xedb1('0x2b'),this[_0xedb1('0x2c')][_0xedb1('0x2d')](this));ami['on']('originateresponse',this[_0xedb1('0x2e')][_0xedb1('0x2d')](this));ami['on'](_0xedb1('0x2f'),this[_0xedb1('0x30')][_0xedb1('0x2d')](this));ami['on'](_0xedb1('0x31'),this[_0xedb1('0xd')][_0xedb1('0x2d')](this));ami['on'](_0xedb1('0x32'),this[_0xedb1('0x33')][_0xedb1('0x2d')](this));ami['on'](_0xedb1('0x34'),this[_0xedb1('0x35')][_0xedb1('0x2d')](this));ami['on']('varset',this[_0xedb1('0x36')][_0xedb1('0x2d')](this));ami['on']('queuemember',this['syncQueueMember'][_0xedb1('0x2d')](this));ami['on'](_0xedb1('0x37'),this['syncQueueStatusComplete'][_0xedb1('0x2d')](this));this['loopCampaigns']();this[_0xedb1('0x38')]();}function isNotNull(_0x46eb1c){return _0x46eb1c!==null&&!_[_0xedb1('0x39')](_0x46eb1c);}function checkIsLoggedIn(_0xe2d961,_0x4aff9d){return function(){if(_0x4aff9d<=0x0){_0xe2d961[_0xedb1('0x3a')]=_0xedb1('0x3b');throw _0xe2d961['name']+_0xedb1('0x3c');}};}function isActive(_0x500983){return _0x500983;}function checkIsActive(_0x400cab,_0x1fd641){return function(){if(!isActive(_0x1fd641)){_0x400cab[_0xedb1('0x3a')]=_0xedb1('0x3d');throw _0x400cab[_0xedb1('0x3e')]+'\x20NOT\x20Active';}};}function checkInterval(_0x318ff4){return function(){if(!isNotNull(_0x318ff4[_0xedb1('0x3f')])){_0x318ff4[_0xedb1('0x3a')]=_0xedb1('0x40');throw _0x318ff4['name']+_0xedb1('0x41');}if(!isNotNull(_0x318ff4['Interval']['Intervals'])){_0x318ff4[_0xedb1('0x3a')]=_0xedb1('0x40');throw _0x318ff4[_0xedb1('0x3e')]+_0xedb1('0x41');}if(!isNotNull(_[_0xedb1('0x42')](_0x318ff4[_0xedb1('0x3f')][_0xedb1('0x43')]))){_0x318ff4[_0xedb1('0x3a')]='INTERVAL_IS_NULL';throw _0x318ff4[_0xedb1('0x3e')]+_0xedb1('0x41');}};}function msgResponse(_0x59de5a,_0x5d6903,_0x4cba2f){return{'action':_0x59de5a,'response':_0x5d6903,'message':_0x4cba2f,'stack':_0x4cba2f};}function myreject(_0x47813e){return function(_0x4e38d4){return _0x47813e(msgResponse(_0xedb1('0x44'),_0xedb1('0x45'),JSON[_0xedb1('0x46')](_0x4e38d4)));};}function getSeconds(_0x57d2c9,_0x5546b8){var _0x3474a8=moment(_0x57d2c9)[_0xedb1('0x47')](0x0);var _0x176c1f=moment(_0x5546b8)[_0xedb1('0x47')](0x0);return _0x3474a8[_0xedb1('0x48')](_0x176c1f,_0xedb1('0x49'));}function emit(_0x696826,_0x13e3af,_0x5392bb){io['to'](_0x696826)[_0xedb1('0x4a')](_0x13e3af,_0x5392bb);}function emitVoiceQueueSummary(_0x3d3f08){if(_0x3d3f08[_0xedb1('0x4b')]===_0xedb1('0x4c')){var _0x2691f1={'id':_0x3d3f08['id'],'name':_0x3d3f08[_0xedb1('0x3e')],'strategy':_0x3d3f08[_0xedb1('0x4d')],'answered':_0x3d3f08[_0xedb1('0x4e')],'available':_0x3d3f08[_0xedb1('0x4f')],'loggedIn':_0x3d3f08[_0xedb1('0x50')],'pTalking':_0x3d3f08[_0xedb1('0x51')],'sumBillable':_0x3d3f08[_0xedb1('0x52')],'sumDuration':_0x3d3f08[_0xedb1('0x53')],'sumHoldTime':_0x3d3f08['sumHoldTime']||0x0,'talking':_0x3d3f08[_0xedb1('0x54')],'total':_0x3d3f08[_0xedb1('0x55')],'type':_0x3d3f08[_0xedb1('0x4b')],'unmanaged':_0x3d3f08[_0xedb1('0x56')],'abandoned':_0x3d3f08['abandoned'],'waiting':_0x3d3f08[_0xedb1('0x57')],'loggedInDb':_0x3d3f08[_0xedb1('0x58')],'dialActive':_0x3d3f08[_0xedb1('0x59')],'dialMethod':_0x3d3f08[_0xedb1('0x5a')],'dialOriginateCallerIdName':_0x3d3f08[_0xedb1('0x5b')],'dialOriginateCallerIdNumber':_0x3d3f08[_0xedb1('0x5c')],'dialOriginateTimeout':_0x3d3f08[_0xedb1('0x5d')],'dialPrefix':_0x3d3f08[_0xedb1('0x5e')],'outboundAnswerAgiCallsDay':_0x3d3f08[_0xedb1('0x5f')],'outboundAnswerCallsDay':_0x3d3f08[_0xedb1('0x60')],'outboundBlacklistCallsDay':_0x3d3f08['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3d3f08[_0xedb1('0x61')],'outboundCongestionCallsDay':_0x3d3f08[_0xedb1('0x62')],'outboundDropCallsDayACS':_0x3d3f08[_0xedb1('0x63')],'outboundDropCallsDayCallersExit':_0x3d3f08['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3d3f08['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x3d3f08[_0xedb1('0x64')],'outboundNoSuchCallsDay':_0x3d3f08[_0xedb1('0x65')],'outboundOriginateFailureCallsDay':_0x3d3f08[_0xedb1('0x66')],'outboundReCallsDay':_0x3d3f08[_0xedb1('0x67')],'outboundRejectCallsDay':_0x3d3f08['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3d3f08[_0xedb1('0x68')],'predictiveIntervalAnsweredCalls':_0x3d3f08['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3d3f08[_0xedb1('0x69')],'predictiveIntervalAvgTalktime':_0x3d3f08[_0xedb1('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x3d3f08[_0xedb1('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x3d3f08[_0xedb1('0x6c')],'predictiveIntervalErlangCalls':_0x3d3f08[_0xedb1('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x3d3f08[_0xedb1('0x6e')],'predictiveIntervalHitRate':_0x3d3f08[_0xedb1('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x3d3f08['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3d3f08[_0xedb1('0x70')],'predictiveIntervalAvailable':_0x3d3f08[_0xedb1('0x71')],'predictiveIntervalTotalCalls':_0x3d3f08[_0xedb1('0x72')],'message':_0x3d3f08[_0xedb1('0x3a')],'originated':_0x3d3f08[_0xedb1('0x73')],'erlangCalls':_0x3d3f08[_0xedb1('0x74')],'erlangCallToSecond':_0x3d3f08[_0xedb1('0x75')],'erlangAbandonmentRate':_0x3d3f08['erlangAbandonmentRate'],'erlangBusyFactor':_0x3d3f08['erlangBusyFactor'],'startPredictive':_0x3d3f08[_0xedb1('0x25')],'startProgressive':_0x3d3f08[_0xedb1('0x26')]};if(_0x3d3f08[_0xedb1('0x76')]){_0x2691f1[_0xedb1('0x76')]={'id':_0x3d3f08[_0xedb1('0x76')]['id'],'name':_0x3d3f08['Trunk'][_0xedb1('0x3e')],'active':_0x3d3f08['Trunk'][_0xedb1('0x77')],'callerid':_0x3d3f08['Trunk']['callerid']};}if(_0x3d3f08[_0xedb1('0x3f')]){_0x2691f1[_0xedb1('0x3f')]={'id':_0x3d3f08[_0xedb1('0x3f')]['id'],'name':_0x3d3f08[_0xedb1('0x3f')][_0xedb1('0x3e')]};}var _0x22f77b=md5(JSON[_0xedb1('0x46')](_0x2691f1));if(_0x3d3f08['md5']!==_0x22f77b){_0x3d3f08['md5']=_0x22f77b;emit(util['format'](_0xedb1('0x78'),_0x2691f1['name']),_0xedb1('0x79'),_0x2691f1);}}}function emitCampaignSummary(_0x2aebed){if(_0x2aebed[_0xedb1('0x4b')]===_0xedb1('0x7a')){emit(util[_0xedb1('0x7b')](_0xedb1('0x7c'),_0x2aebed['name']),_0xedb1('0x7d'),_0x2aebed);}}function checkGetDataPredictive(_0x3dbd8b){if(isNotNull(_0x3dbd8b)&&!_[_0xedb1('0x42')](_0x3dbd8b)){loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x7f'));loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x80'),_0x3dbd8b[_0xedb1('0x72')]);loggerPredictive['info'](_0xedb1('0x81'),_0x3dbd8b[_0xedb1('0x82')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3dbd8b[_0xedb1('0x6c')]);loggerPredictive[_0xedb1('0x7e')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3dbd8b[_0xedb1('0x6b')]);loggerPredictive['info'](_0xedb1('0x83'),_0x3dbd8b[_0xedb1('0x69')]);loggerPredictive['info'](_0xedb1('0x84'),_0x3dbd8b[_0xedb1('0x6a')]);loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x85'));if(_0x3dbd8b[_0xedb1('0x72')]>0x0){if(!_[_0xedb1('0x39')](_0x3dbd8b['predictiveIntervalAvgTalktime'])&&_0x3dbd8b['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x86'));if(!_['isUndefined'](_0x3dbd8b[_0xedb1('0x69')])&&_0x3dbd8b[_0xedb1('0x69')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x87'));}}else{loggerPredictive['info'](_0xedb1('0x88'));}return![];}function mergeDataErlangB(_0x5925b9){return function(_0x176140){loggerPredictive[_0xedb1('0x7e')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x89'),_0x176140[_0xedb1('0x74')]);loggerPredictive['info'](_0xedb1('0x8a'),_0x176140['erlangCallToSecond']);loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x8b'),_0x176140[_0xedb1('0x8c')]);loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x8d'),_0x176140[_0xedb1('0x8e')]);loggerPredictive['info'](_0xedb1('0x8b'),_0x176140[_0xedb1('0x8c')]);loggerPredictive['info'](_0xedb1('0x85'));_[_0xedb1('0x8f')](_0x5925b9,_0x176140);};}function getDiff(_0x22ff6b){var _0x5b2c4b=moment()[_0xedb1('0x47')](0x0);var _0x320959=moment(_0x22ff6b)[_0xedb1('0x47')](0x0);return _0x5b2c4b['diff'](_0x320959,_0xedb1('0x49'));}function ifInterval(_0x476c09,_0x19ab31){if(_[_0xedb1('0x39')](_0x19ab31)){return![];}return getDiff(_0x19ab31)<_0x476c09*0x3c;}function freeVariablesPredictive(_0x485148){if(isNotNull(_0x485148)){if(!_['isUndefined'](_0x485148[_0xedb1('0x26')])){_0x485148[_0xedb1('0x26')]=undefined;loggerPredictive[_0xedb1('0x7e')](_0x485148[_0xedb1('0x3e')],_0xedb1('0x90'));}if(!_[_0xedb1('0x39')](_0x485148[_0xedb1('0x25')])){_0x485148[_0xedb1('0x25')]=undefined;loggerPredictive['info'](_0x485148[_0xedb1('0x3e')],_0xedb1('0x91'));}if(!_[_0xedb1('0x39')](_0x485148[_0xedb1('0x92')])){clearInterval(_0x485148[_0xedb1('0x92')]);_0x485148[_0xedb1('0x92')]=undefined;loggerPredictive[_0xedb1('0x7e')](_0x485148['name'],_0xedb1('0x93'));}}}function erlangb(_0xd1755b,_0x335fb7){if(_0x335fb7===0x0){return 0x0;}var _0x34a94b=0x1;for(var _0x35e5cd=0x1;_0x35e5cd<=_0x335fb7;_0x35e5cd+=0x1){_0x34a94b=0x1+_0x34a94b*_0x35e5cd/_0xd1755b;}return 0x1/_0x34a94b;}function isVoiceQueueOutbound(_0x188708){return _0x188708===_0xedb1('0x4c');}function isNotPreview(_0x183525){return _0x183525!==_0xedb1('0x94');}function isCampaignIvr(_0x1b1c03){return _0x1b1c03===_0xedb1('0x7a');}function getCallerId(_0x3d909e,_0x38dfdc,_0x393e30){if(!_[_0xedb1('0x39')](_0x393e30)&&typeof _0x393e30===_0xedb1('0x95')&&!_[_0xedb1('0x42')](_0x393e30)){if(!_[_0xedb1('0x39')](_0x38dfdc)&&typeof _0x38dfdc===_0xedb1('0x95')&&!_['isEmpty'](_0x38dfdc)){return util['format'](_0xedb1('0x96'),_0x38dfdc,_0x393e30);}return util[_0xedb1('0x7b')](_0xedb1('0x96'),_0x393e30,_0x393e30);}if(!_[_0xedb1('0x39')](_0x3d909e)&&typeof _0x3d909e===_0xedb1('0x95')&&!_['isEmpty'](_0x3d909e)){return _0x3d909e;}return _0xedb1('0x97');}function loggerCatchQueueSummary(_0x30bf49,_0x51ac5a){return function(_0x132640){freeVariablesPredictive(_0x51ac5a);emitVoiceQueueSummary(_0x51ac5a);emitCampaignSummary(_0x51ac5a);loggerSyncQueueSummary[_0xedb1('0x98')](_0x30bf49,util[_0xedb1('0x99')](_0x132640,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2c88fb,_0x46ffd9){return function(_0x8868a4){loggerPredictive[_0xedb1('0x98')](_0x46ffd9[_0xedb1('0x3e')],_0x2c88fb);loggerPredictive[_0xedb1('0x98')](_0x8868a4[_0xedb1('0x9a')]);freeVariablesPredictive(_0x46ffd9);};}function loggerCatch(_0x345133){return function(_0xc0743a){logger['error'](_0x345133,util['inspect'](_0xc0743a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x7cd5f){return _0x7cd5f&&!_[_0xedb1('0x39')](_0x7cd5f)&&_0x7cd5f[_0xedb1('0x9b')]>0x0;}function decremetOriginate(_0x687134){if(!_[_0xedb1('0x39')](_0x687134)&&_0x687134!==null){if(typeof _0x687134[_0xedb1('0x73')]!==_0xedb1('0x9c')){if(_0x687134['originated']>0x0){_0x687134[_0xedb1('0x73')]-=0x1;}else{logger[_0xedb1('0x98')](_0xedb1('0x9d'));}}}else{logger[_0xedb1('0x98')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x41b9d8,_0x3726cd,_0x30d800){if(_0x3726cd>_0x30d800){for(var _0x3e1f53=0x0;_0x3e1f53<_0x3726cd-_0x30d800;_0x3e1f53+=0x1){decremetOriginate(_0x41b9d8);}}}function loggerGetContactDialer(_0x28ce35,_0x3a9a63,_0x53dad0){return function(_0x2ddfb0){checkContactLowerLimitOriginate(_0x3a9a63,_0x53dad0,0x0);logger[_0xedb1('0x98')](_0x28ce35,util[_0xedb1('0x99')](_0x2ddfb0,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1956fb){return function(_0x470129){if(isNotNull(_0x470129)&&isNotNull(_0x470129[0x0])){if(_0x470129[0x0][_0xedb1('0x9e')]>0x0){_0x1956fb['message']=_0xedb1('0x9f');logger['info'](_0xedb1('0xa0')+_0x1956fb[_0xedb1('0x3e')],_0x470129[0x0][_0xedb1('0x9e')],'contacts');}else{_0x1956fb[_0xedb1('0x3a')]=_0xedb1('0xa1');logger[_0xedb1('0x7e')](_0xedb1('0xa2')+_0x1956fb[_0xedb1('0x3e')]);}}};}function notSendMessagesQueue(_0x14fc56){if(_0x14fc56[_0xedb1('0xa3')]){freeVariablesPredictive(_0x14fc56);if(_0x14fc56[_0xedb1('0x73')]===0x0&&_0x14fc56[_0xedb1('0x54')]===0x0&&_0x14fc56[_0xedb1('0x57')]===0x0&&(_0x14fc56[_0xedb1('0x51')]||0x0)===0x0){_0x14fc56['sendMessageOneNotActive']=![];_0x14fc56[_0xedb1('0x4f')]=0x0;_0x14fc56['message']=_0xedb1('0x3d');loggerSyncQueueSummary[_0xedb1('0x98')](_0xedb1('0xa4'),_0x14fc56['name'],_0xedb1('0xa5'));}else{_0x14fc56[_0xedb1('0x3a')]=_0xedb1('0xa6');loggerSyncQueueSummary[_0xedb1('0x98')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x14fc56[_0xedb1('0x3e')],_0xedb1('0xa7'));}emitVoiceQueueSummary(_0x14fc56);}}function notSendMessagesCampaign(_0x557a1a){if(_0x557a1a[_0xedb1('0xa3')]){if(_0x557a1a[_0xedb1('0x73')]===0x0){_0x557a1a[_0xedb1('0xa3')]=![];_0x557a1a['message']=_0xedb1('0x3d');loggerSyncQueueSummary['error'](_0xedb1('0xa8'),_0x557a1a[_0xedb1('0x3e')],_0xedb1('0xa5'));}else{_0x557a1a[_0xedb1('0x3a')]=_0xedb1('0xa6');loggerSyncQueueSummary['error'](_0xedb1('0xa8'),_0x557a1a[_0xedb1('0x3e')],_0xedb1('0xa7'));}emitCampaignSummary(_0x557a1a);}}function createObjHistory(_0x56809f,_0x256e6c,_0x14e674,_0x4a38f9,_0x3c06c6){_0x56809f[_0xedb1('0x3a')]=_0x14e674;var _0x3c241a=new Action(_0x56809f,_0x256e6c);var _0x1e5e40=new History(_0x3c241a);_0x1e5e40[_0xedb1('0xa9')]=_0x4a38f9;_0x1e5e40[_0xedb1('0xaa')]=_0x3c06c6;_0x1e5e40[_0xedb1('0xab')]=_0x3c241a[_0xedb1('0xac')];return _0x1e5e40;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x5c0084=this;setInterval(function(){_0x5c0084[_0xedb1('0xad')](_0x5c0084[_0xedb1('0x24')],_0xedb1('0xae'));_0x5c0084[_0xedb1('0xad')](_0x5c0084[_0xedb1('0x23')],_0xedb1('0xaf'));},0x32c8);};Dialer['prototype'][_0xedb1('0xad')]=function(_0x178d67,_0x131258){var _0xabc802=this;for(var _0x271e3e in _0x178d67){if(typeof _0x178d67[_0x271e3e]!=='undefined'){this[_0xedb1('0x1e')][_0xedb1('0xb0')](function(){if(!_[_0xedb1('0xb1')](_0x178d67[_0x271e3e])){return ami['Action']({'action':_0xedb1('0xb2'),'channel':_0x178d67[_0x271e3e][_0xedb1('0xb3')]})['catch'](function(_0x3809ad){if(_0x3809ad[_0xedb1('0x3a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x178d67[_0x271e3e]&&_0x178d67[_0x271e3e][_0xedb1('0x4b')]!==_0xedb1('0x7a')){_0xabc802[_0xedb1('0xb4')](_0xabc802[_0xedb1('0x1f')][_0x178d67[_0x271e3e][_0xedb1('0xb5')]]);logger['error'](_0xedb1('0xb6'),_0x131258,_0x271e3e,_0x178d67[_0x271e3e][_0xedb1('0xb5')]);delete _0x178d67[_0x271e3e];}if(_0x178d67[_0x271e3e]&&_0x178d67[_0x271e3e][_0xedb1('0x4b')]==='ivr'){_0xabc802[_0xedb1('0xb4')](_0xabc802[_0xedb1('0x20')][_0x178d67[_0x271e3e]['queue']]);logger[_0xedb1('0x98')](_0xedb1('0xb7'),_0x131258,_0x271e3e,_0x178d67[_0x271e3e]['queue']);delete _0x178d67[_0x271e3e];}},0x2328);}});}});}}};Dialer[_0xedb1('0x1b')][_0xedb1('0xb8')]=function(_0x2c7220){return BPromise['resolve']()[_0xedb1('0xb9')](cmHopper[_0xedb1('0xb8')](_0x2c7220))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xedb1('0x1b')][_0xedb1('0xba')]=function(_0x319428){return BPromise[_0xedb1('0xbb')]()[_0xedb1('0xb9')](cmHopperBlack[_0xedb1('0xba')](_0x319428))['catch'](loggerCatch(_0xedb1('0xbc')));};Dialer['prototype']['verifyAdditionalPhones']=function(_0x2acf97,_0x1e8d00,_0x4abcf3){return BPromise[_0xedb1('0xbb')]()[_0xedb1('0xb9')](cmHopperAdditionalPhone[_0xedb1('0xbd')](_0x2acf97,_0x1e8d00,_0x4abcf3))[_0xedb1('0xbe')](loggerCatch(_0xedb1('0xbf')));};Dialer[_0xedb1('0x1b')]['swapAdditionalPhones']=function(_0x4f0320,_0x27877f,_0x57e7f0){return BPromise[_0xedb1('0xbb')]()[_0xedb1('0xb9')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x4f0320,_0x27877f,_0x57e7f0))[_0xedb1('0xbe')](loggerCatch(_0xedb1('0xc0')));};Dialer[_0xedb1('0x1b')][_0xedb1('0xc1')]=function(_0xd64b3e){return BPromise[_0xedb1('0xbb')]()[_0xedb1('0xb9')](cmHopperBlack[_0xedb1('0xc1')](_0xd64b3e))[_0xedb1('0xbe')](loggerCatch(_0xedb1('0xc2')));};Dialer[_0xedb1('0x1b')][_0xedb1('0xc3')]=function(_0x30906e){return BPromise[_0xedb1('0xbb')]()[_0xedb1('0xb9')](cmHopperHistory[_0xedb1('0xc4')](_0x30906e))[_0xedb1('0xbe')](loggerCatch(_0xedb1('0xc5')));};Dialer[_0xedb1('0x1b')][_0xedb1('0xc6')]=function(_0x5c9ffd){return BPromise[_0xedb1('0xbb')]()[_0xedb1('0xb9')](cmHopper[_0xedb1('0xc6')](_0x5c9ffd))['catch'](loggerCatch(_0xedb1('0xc7')));};Dialer[_0xedb1('0x1b')][_0xedb1('0xc8')]=function(_0x318b96,_0x3b8aab,_0x1dbf5e){return BPromise['resolve']()[_0xedb1('0xb9')](cmHopper['unlockContact'](_0x318b96,_0x3b8aab,_0x1dbf5e))[_0xedb1('0xbe')](loggerCatch(_0xedb1('0xc9')));};Dialer[_0xedb1('0x1b')][_0xedb1('0xca')]=function(_0x6bdf0d,_0x42bdd1,_0x229e8a,_0x1f9dd4,_0x59d518){return BPromise[_0xedb1('0xbb')]()[_0xedb1('0xb9')](cmHopper[_0xedb1('0xca')](_0x6bdf0d,_0x42bdd1,_0x229e8a,_0x1f9dd4))[_0xedb1('0xbe')](function(_0x27f2de){_0x59d518[_0xedb1('0xcb')]-=_0x229e8a;_0x59d518['temp']=_0x59d518[_0xedb1('0xcb')]>0x0?_0x59d518['temp']:0x0;loggerCatch(_0xedb1('0xcc'))(_0x27f2de);});};Dialer['prototype'][_0xedb1('0xcd')]=function(_0x43a47d,_0x5289bb,_0xbd8eaa,_0x5e4dc3){return BPromise[_0xedb1('0xbb')]()['then'](cmHopper['getContactDialerIvr'](_0x43a47d,_0x5289bb,_0xbd8eaa))[_0xedb1('0xbe')](function(_0x1428b3){_0x5e4dc3[_0xedb1('0xcb')]-=_0x5289bb;_0x5e4dc3[_0xedb1('0xcb')]=_0x5e4dc3['temp']>0x0?_0x5e4dc3[_0xedb1('0xcb')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x1428b3);});};Dialer[_0xedb1('0x1b')][_0xedb1('0xce')]=function(_0x541c9c){return BPromise['resolve']()[_0xedb1('0xb9')](voiceQueueRt['getVoiceQueueRtPauses'](_0x541c9c))['catch'](loggerCatch(_0xedb1('0xcf')));};Dialer[_0xedb1('0x1b')][_0xedb1('0xd0')]=function(_0x593526){return BPromise[_0xedb1('0xbb')]()['then'](cmHopper[_0xedb1('0xd0')](_0x593526))['catch'](loggerCatch(_0xedb1('0xd1')));};Dialer[_0xedb1('0x1b')][_0xedb1('0xd2')]=function(_0x1598f6){return BPromise[_0xedb1('0xbb')]()['then'](cmHopperHistory['createHistory'](_0x1598f6))[_0xedb1('0xbe')](loggerCatch(_0xedb1('0xd3')));};Dialer[_0xedb1('0x1b')][_0xedb1('0xb4')]=function(_0x1f9079){if(!_[_0xedb1('0x39')](_0x1f9079)&&_0x1f9079!==null){if(typeof _0x1f9079[_0xedb1('0x73')]!=='undefined'){if(_0x1f9079[_0xedb1('0x73')]>0x0){_0x1f9079[_0xedb1('0x73')]-=0x1;}else{logger[_0xedb1('0x98')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xedb1('0x98')](_0xedb1('0xd4'));}};Dialer[_0xedb1('0x1b')][_0xedb1('0xd5')]=function(_0x305ab6,_0x1c5796){var _0x34e48a=this;return function(_0x14d4b4){_0x34e48a['updateOriginated'](_0x1c5796);logger[_0xedb1('0x98')](_0x305ab6,util[_0xedb1('0x99')](_0x14d4b4,{'showHidden':![],'depth':null}));};};Dialer[_0xedb1('0x1b')][_0xedb1('0xd6')]=function(_0x743d96,_0x3897bf,_0x29f993){var _0x27fe30={'state':0x19,'statedesc':'notFound'};this[_0xedb1('0xb4')](_0x3897bf);this['saveInDb'](_[_0xedb1('0x8f')](_0x27fe30,_[_0xedb1('0xd7')](_0x29f993,[_0xedb1('0xd8'),_0xedb1('0xd9'),'UserId',_0xedb1('0xda'),_0xedb1('0xdb')])),_0xedb1('0xdc'),'[emptyContact]');logger[_0xedb1('0x98')](_0x743d96);};Dialer[_0xedb1('0x1b')]['isSuccess']=function(_0x4d5971){return _0x4d5971===_0xedb1('0xdd');};Dialer['prototype']['isTrunkReachable']=function(_0x12b7ea){return!_[_0xedb1('0x39')](_0x12b7ea)&&_0x12b7ea&&!_[_0xedb1('0x39')](_0x12b7ea[_0xedb1('0x3e')])&&!_[_0xedb1('0x39')](_0x12b7ea['active'])&&_0x12b7ea[_0xedb1('0x77')]&&(this[_0xedb1('0x22')][util[_0xedb1('0x7b')](_0xedb1('0xde'),_0x12b7ea[_0xedb1('0x3e')])][_0xedb1('0xb2')]===_0xedb1('0xdf')||this[_0xedb1('0x22')][util[_0xedb1('0x7b')](_0xedb1('0xde'),_0x12b7ea[_0xedb1('0x3e')])]['status']===_0xedb1('0xe0'));};Dialer['prototype']['saveInDb']=function(_0x5cd7af,_0x3fe841,_0xb96d3b){this[_0xedb1('0xd2')](_0x5cd7af)[_0xedb1('0xbe')](loggerCatch(_0x3fe841));this[_0xedb1('0xd0')](_0x5cd7af)[_0xedb1('0xbe')](loggerCatch(_0xb96d3b));};Dialer[_0xedb1('0x1b')][_0xedb1('0x36')]=function(_0x5908e6){var _0x250dbe=this['uniqueId'][_0x5908e6['uniqueid']];var _0x360758;if(!_[_0xedb1('0xb1')](_0x5908e6)&&!_[_0xedb1('0xb1')](_0x5908e6['variable'])&&!_['isNil'](_0x5908e6['variable'][_0xedb1('0xe1')])&&_0x5908e6[_0xedb1('0xe2')]===_0xedb1('0xe3')&&_0x250dbe){if(_0x250dbe[_0xedb1('0x4b')]!=='ivr'&&this['voiceQueues'][_0x250dbe[_0xedb1('0xb5')]][_0xedb1('0xe4')]&&_0x5908e6[_0xedb1('0xe5')]===_0xedb1('0xe6')){delete this[_0xedb1('0x24')][_0x5908e6[_0xedb1('0xe7')]];this['updateOriginated'](this['voiceQueues'][_0x250dbe[_0xedb1('0xb5')]]);this[_0xedb1('0x1f')][_0x250dbe[_0xedb1('0xb5')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x250dbe[_0xedb1('0xb5')]][_0xedb1('0x5f')]+=0x1;_0x360758=new Hangup(_0x250dbe,_0x5908e6);_0x360758[_0xedb1('0xa9')]=0x12;_0x360758['statedesc']=_0xedb1('0xe8');_0x360758[_0xedb1('0xe9')]=_0xedb1('0xea');ami['emit'](_0xedb1('0xeb'),ut[_0xedb1('0xec')](_0x360758,_0xedb1('0xed')));this[_0xedb1('0xee')](_0x360758,_0xedb1('0xef'),'[syncHangupInAMD]');}if(_0x250dbe[_0xedb1('0x4b')]!==_0xedb1('0x7a')&&this[_0xedb1('0x1f')][_0x250dbe[_0xedb1('0xb5')]][_0xedb1('0xe4')]&&_0x5908e6[_0xedb1('0xe5')]==='MACHINE'){var _0x350e76=this;return new BPromise(function(_0x3d6653,_0x2d1b2f){delete _0x350e76['uniqueId'][_0x5908e6['uniqueid']];_0x350e76[_0xedb1('0xb4')](_0x350e76[_0xedb1('0x1f')][_0x250dbe['queue']]);_0x350e76[_0xedb1('0x1f')][_0x250dbe[_0xedb1('0xb5')]][_0xedb1('0x60')]+=0x1;_0x350e76[_0xedb1('0x1f')][_0x250dbe[_0xedb1('0xb5')]][_0xedb1('0x5f')]+=0x1;var _0x51cc4f=_0x350e76[_0xedb1('0x1f')][_0x250dbe[_0xedb1('0xb5')]];var _0x15ab1b=new Hangup(_0x250dbe,_0x5908e6);_0x15ab1b[_0xedb1('0xa9')]=0x13;_0x15ab1b['statedesc']=_0xedb1('0xf0');_0x15ab1b[_0xedb1('0xe9')]='AMD';_0x15ab1b['countmachineretry']+=0x1;_0x15ab1b[_0xedb1('0xf1')]+=0x1;_0x15ab1b['amd']=!![];ami['emit'](_0xedb1('0xeb'),ut['buildObj'](_0x15ab1b,'amd'));_0x350e76[_0xedb1('0xd2')](_0x15ab1b)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0xf2')));if(_0x15ab1b['countbusyretry']+_0x15ab1b[_0xedb1('0xf3')]+_0x15ab1b[_0xedb1('0xf4')]+_0x15ab1b['countnosuchnumberretry']+_0x15ab1b[_0xedb1('0xf5')]+_0x15ab1b[_0xedb1('0xf6')]+_0x15ab1b[_0xedb1('0xf7')]+_0x15ab1b['countagentrejectretry']>=_0x51cc4f['dialGlobalMaxRetry']){_0x350e76[_0xedb1('0xf8')](_0x15ab1b,_0x3d6653,_0x2d1b2f,'reason19\x20machine....');}else{if(_0x15ab1b[_0xedb1('0xf7')]>=_0x51cc4f['dialMachineMaxRetry']){_0x350e76[_0xedb1('0xf9')](_0x15ab1b,_0x3d6653,_0x2d1b2f,'reason\x2019\x20machine....');}else{_0x350e76['rescheduleContact']({'active':![],'countmachineretry':_0x15ab1b[_0xedb1('0xf7')],'scheduledat':moment()[_0xedb1('0xfa')](_0x51cc4f[_0xedb1('0xfb')],_0xedb1('0xfc'))['format'](_0xedb1('0xfd')),'ContactId':_0x15ab1b[_0xedb1('0xd8')],'ListId':_0x15ab1b[_0xedb1('0xd9')],'VoiceQueueId':_0x15ab1b[_0xedb1('0xda')]||undefined,'CampaignId':_0x15ab1b[_0xedb1('0xdb')]||undefined})[_0xedb1('0xbe')](loggerCatch(_0xedb1('0xfe')));_0x3d6653({'reschedule':0x1});}}});}if(_0x250dbe[_0xedb1('0x4b')]===_0xedb1('0x7a')&&this['campaigns'][_0x250dbe[_0xedb1('0xb5')]][_0xedb1('0xe4')]&&_0x5908e6['value']===_0xedb1('0xe6')){delete this[_0xedb1('0x24')][_0x5908e6[_0xedb1('0xe7')]];this[_0xedb1('0xb4')](this['campaigns'][_0x250dbe[_0xedb1('0xb5')]]);_0x360758=new Hangup(_0x250dbe,_0x5908e6);_0x360758['state']=0x12;_0x360758[_0xedb1('0xaa')]=_0xedb1('0xe8');_0x360758['membername']=_0xedb1('0xea');ami['emit'](_0xedb1('0xeb'),ut[_0xedb1('0xec')](_0x360758,'amd'));this[_0xedb1('0xee')](_0x360758,_0xedb1('0xff'),_0xedb1('0x100'));}if(_0x250dbe[_0xedb1('0x4b')]===_0xedb1('0x7a')&&this[_0xedb1('0x20')][_0x250dbe[_0xedb1('0xb5')]][_0xedb1('0xe4')]&&_0x5908e6[_0xedb1('0xe5')]===_0xedb1('0x101')){var _0x350e76=this;return new BPromise(function(_0xdc4811,_0x244534){delete _0x350e76[_0xedb1('0x24')][_0x5908e6[_0xedb1('0xe7')]];_0x350e76[_0xedb1('0xb4')](_0x350e76[_0xedb1('0x20')][_0x250dbe['queue']]);_0x350e76['campaigns'][_0x250dbe[_0xedb1('0xb5')]]['outboundAnswerCallsDay']+=0x1;_0x350e76[_0xedb1('0x20')][_0x250dbe['queue']][_0xedb1('0x5f')]+=0x1;var _0x41e2d6=_0x350e76[_0xedb1('0x20')][_0x250dbe[_0xedb1('0xb5')]];var _0x1e09af=new Hangup(_0x250dbe,_0x5908e6);_0x1e09af[_0xedb1('0xa9')]=0x13;_0x1e09af[_0xedb1('0xaa')]='Machine';_0x1e09af['membername']=_0xedb1('0xea');_0x1e09af[_0xedb1('0xf7')]+=0x1;_0x1e09af[_0xedb1('0xf1')]+=0x1;_0x1e09af[_0xedb1('0xed')]=!![];ami[_0xedb1('0x4a')]('custom:amd',ut[_0xedb1('0xec')](_0x1e09af,_0xedb1('0xed')));_0x350e76[_0xedb1('0xd2')](_0x1e09af)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0xf2')));if(_0x1e09af['countbusyretry']+_0x1e09af[_0xedb1('0xf3')]+_0x1e09af[_0xedb1('0xf4')]+_0x1e09af['countnosuchnumberretry']+_0x1e09af[_0xedb1('0xf5')]+_0x1e09af[_0xedb1('0xf6')]+_0x1e09af['countmachineretry']+_0x1e09af[_0xedb1('0x102')]>=_0x41e2d6['dialGlobalMaxRetry']){_0x350e76[_0xedb1('0xf8')](_0x1e09af,_0xdc4811,_0x244534,_0xedb1('0x103'));}else{if(_0x1e09af[_0xedb1('0xf7')]>=_0x41e2d6[_0xedb1('0x104')]){_0x350e76[_0xedb1('0xf9')](_0x1e09af,_0xdc4811,_0x244534,'reason\x2019\x20machine....');}else{_0x350e76['rescheduleContact']({'active':![],'countmachineretry':_0x1e09af[_0xedb1('0xf7')],'scheduledat':moment()[_0xedb1('0xfa')](_0x41e2d6['dialMachineRetryFrequency'],_0xedb1('0xfc'))[_0xedb1('0x7b')](_0xedb1('0xfd')),'ContactId':_0x1e09af[_0xedb1('0xd8')],'ListId':_0x1e09af[_0xedb1('0xd9')],'VoiceQueueId':_0x1e09af[_0xedb1('0xda')]||undefined,'CampaignId':_0x1e09af[_0xedb1('0xdb')]||undefined})['catch'](loggerCatch(_0xedb1('0xfe')));_0xdc4811({'reschedule':0x1});}}});}}};Dialer[_0xedb1('0x1b')]['syncHangup']=function(_0x528bcb){var _0x35a15b=this['uniqueId'][_0x528bcb['uniqueid']];var _0x183d80=this;var _0x4850c7;if(_0x35a15b&&_0x35a15b['type']===_0xedb1('0x7a')){delete this[_0xedb1('0x24')][_0x528bcb[_0xedb1('0xe7')]];this['updateOriginated'](this[_0xedb1('0x20')][_0x35a15b[_0xedb1('0xb5')]]);this[_0xedb1('0x20')][_0x35a15b[_0xedb1('0xb5')]]['ivrAnswerCallsDay']+=0x1;_0x4850c7=new Hangup(_0x35a15b,_0x528bcb);this[_0xedb1('0xd2')](_0x4850c7)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x105')));this['moveContactManagedDialer'](_0x4850c7)[_0xedb1('0xbe')](loggerCatch('[syncHangupIvr]'));}if(_0x35a15b&&_0x35a15b['type']!==_0xedb1('0x7a')&&isNotNull(this['voiceQueues'][_0x35a15b['queue']][_0xedb1('0x106')])){delete this['uniqueId'][_0x528bcb['uniqueid']];this[_0xedb1('0xb4')](this['voiceQueues'][_0x35a15b[_0xedb1('0xb5')]]);this['voiceQueues'][_0x35a15b['queue']][_0xedb1('0x60')]+=0x1;this[_0xedb1('0x1f')][_0x35a15b[_0xedb1('0xb5')]][_0xedb1('0x5f')]+=0x1;_0x4850c7=new Hangup(_0x35a15b,_0x528bcb);_0x4850c7[_0xedb1('0xa9')]=0x10;_0x4850c7[_0xedb1('0xaa')]=_0xedb1('0x107');_0x4850c7[_0xedb1('0xe9')]=_0xedb1('0x108');this[_0xedb1('0xd2')](_0x4850c7)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x105')));this[_0xedb1('0xd0')](_0x4850c7)['catch'](loggerCatch(_0xedb1('0x109')));}if(_0x35a15b&&_0x35a15b[_0xedb1('0x4b')]!==_0xedb1('0x7a')&&!isNotNull(this['voiceQueues'][_0x35a15b[_0xedb1('0xb5')]][_0xedb1('0x106')])){delete this[_0xedb1('0x24')][_0x528bcb[_0xedb1('0xe7')]];this[_0xedb1('0xb4')](this[_0xedb1('0x1f')][_0x35a15b[_0xedb1('0xb5')]]);this[_0xedb1('0x1f')][_0x35a15b[_0xedb1('0xb5')]]['outboundUnknownCallsDay']+=0x1;_0x4850c7=new Hangup(_0x35a15b,_0x528bcb);_0x4850c7[_0xedb1('0xa9')]=0xc;_0x4850c7[_0xedb1('0xaa')]=_0x528bcb[_0xedb1('0x10a')];_0x4850c7[_0xedb1('0xe9')]=_0xedb1('0x10b');this[_0xedb1('0xd2')](_0x4850c7)[_0xedb1('0xbe')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xedb1('0xd0')](_0x4850c7)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xedb1('0x1b')][_0xedb1('0x30')]=function(_0x58a6b4){var _0x2de0dd=this['uniqueId'][_0x58a6b4[_0xedb1('0xe7')]];var _0x5d0b57=this;if(this[_0xedb1('0x1f')][_0x58a6b4[_0xedb1('0xb5')]]){if(_0x2de0dd&&_0x2de0dd['type']!=='ivr'){delete this[_0xedb1('0x24')][_0x58a6b4[_0xedb1('0xe7')]];this[_0xedb1('0x1f')][_0x58a6b4[_0xedb1('0xb5')]][_0xedb1('0x60')]+=0x1;var _0x23cfdd=new AgentComplete(_0x2de0dd,_0x58a6b4);if(_0x58a6b4['reason']===_0xedb1('0x10c')){_0x23cfdd[_0xedb1('0x10d')]=this[_0xedb1('0x1f')][_0x58a6b4[_0xedb1('0xb5')]]['dialQueueProject2']&&this[_0xedb1('0x1f')][_0x58a6b4['queue']]['dialAgiAfterHangupAgent']?moment()[_0xedb1('0x7b')](_0xedb1('0xfd')):undefined;}this[_0xedb1('0xd2')](_0x23cfdd)['catch'](loggerCatch(_0xedb1('0x10e')));this['moveContactManagedDialer'](_0x23cfdd)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x10f')));}}};Dialer[_0xedb1('0x1b')][_0xedb1('0x2a')]=function(_0x54095d){if(this[_0xedb1('0x1f')][_0x54095d[_0xedb1('0xb5')]]){if(this[_0xedb1('0x24')][_0x54095d[_0xedb1('0xe7')]]&&this['uniqueId'][_0x54095d[_0xedb1('0xe7')]]['type']!==_0xedb1('0x7a')){this[_0xedb1('0xb4')](this[_0xedb1('0x1f')][_0x54095d[_0xedb1('0xb5')]]);this[_0xedb1('0x24')][_0x54095d[_0xedb1('0xe7')]][_0xedb1('0x110')]=moment()[_0xedb1('0x7b')](_0xedb1('0xfd'));}}};Dialer[_0xedb1('0x1b')][_0xedb1('0x111')]=function(_0x5e5638,_0x22af3f){this[_0xedb1('0xd2')](_0x5e5638)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x10e')));if(_0x22af3f==0x0){this[_0xedb1('0xd0')](_0x5e5638)['catch'](loggerCatch(_0xedb1('0x112')));}};Dialer['prototype'][_0xedb1('0x2c')]=function(_0x145891){var _0x16be8d=this[_0xedb1('0x24')][_0x145891[_0xedb1('0xe7')]];var _0x504892=this;var _0x25548b=![];var _0x5ef3f4;var _0x4c41cc;if(this[_0xedb1('0x1f')][_0x145891[_0xedb1('0xb5')]]){if(_0x16be8d&&_0x16be8d[_0xedb1('0x4b')]!==_0xedb1('0x7a')){delete this[_0xedb1('0x24')][_0x145891[_0xedb1('0xe7')]];this[_0xedb1('0xb4')](this[_0xedb1('0x1f')][_0x145891['queue']]);_0x16be8d[_0xedb1('0x113')]=moment()[_0xedb1('0x7b')](_0xedb1('0xfd'));var _0x8f687f=new QueueCallerAbandon(_0x16be8d,_0x145891);if(getSeconds(_0x16be8d[_0xedb1('0x113')],_0x16be8d[_0xedb1('0x114')])>=_0x16be8d['dialQueueTimeout']){this[_0xedb1('0x1f')][_0x145891[_0xedb1('0xb5')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x145891['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0xedb1('0x1f')][_0x145891[_0xedb1('0xb5')]][_0xedb1('0x6e')]+=0x1;_0x8f687f[_0xedb1('0xa9')]=0xa;_0x8f687f[_0xedb1('0xaa')]='Drop';_0x8f687f[_0xedb1('0x115')]='TIMEOUT';_0x8f687f[_0xedb1('0x10d')]=this[_0xedb1('0x1f')][_0x145891[_0xedb1('0xb5')]]['dialQueueProject2']?moment()[_0xedb1('0x7b')](_0xedb1('0xfd')):undefined;_0x8f687f['countdropretry']+=0x1;_0x8f687f[_0xedb1('0xf1')]+=0x1;_0x5ef3f4=this[_0xedb1('0x1f')][_0x145891['queue']]['dialDropRetryFrequency'];_0x4c41cc=this[_0xedb1('0x1f')][_0x145891['queue']][_0xedb1('0x116')];_0x504892['verifyAdditionalPhones'](_0x8f687f,_0x8f687f[_0xedb1('0xa9')],_0x16be8d[_0xedb1('0x117')])['then'](function(_0x305cbb){_0x25548b=_0x305cbb[_0xedb1('0x118')]==0x1;if(_0x8f687f[_0xedb1('0xf5')]>=_0x504892[_0xedb1('0x1f')][_0x145891[_0xedb1('0xb5')]]['dialDropMaxRetry']){_0x504892[_0xedb1('0x111')](_0x8f687f,_0x305cbb[_0xedb1('0x118')]);}else{_0x504892['rescheduleContact']({'active':![],'countdropretry':_0x8f687f['countdropretry'],'scheduledat':moment()[_0xedb1('0xfa')](_0x504892[_0xedb1('0x1f')][_0x145891['queue']]['dialDropRetryFrequency'],_0xedb1('0xfc'))[_0xedb1('0x7b')](_0xedb1('0xfd')),'ContactId':_0x16be8d[_0xedb1('0xd8')],'ListId':_0x16be8d[_0xedb1('0xd9')],'VoiceQueueId':_0x16be8d[_0xedb1('0xda')]||undefined,'CampaignId':_0x16be8d[_0xedb1('0xdb')]||undefined})[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x119')));var _0xd07f52=new History(_0x8f687f);_0xd07f52[_0xedb1('0xa9')]=0xa;_0xd07f52[_0xedb1('0xaa')]=_0xedb1('0x11a');_0xd07f52[_0xedb1('0xac')]=moment()[_0xedb1('0x7b')](_0xedb1('0xfd'));_0xd07f52[_0xedb1('0xab')]=_0xd07f52[_0xedb1('0xac')];_0xd07f52[_0xedb1('0x11b')]=_0x8f687f['calleridname'];_0xd07f52[_0xedb1('0x11c')]=_0x8f687f[_0xedb1('0x11c')];_0x504892[_0xedb1('0xd2')](_0xd07f52)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x11d')));}})[_0xedb1('0xb9')](function(_0x5716dd){if(_0x25548b)_0x504892['swapAdditionalPhones'](_0x8f687f,_0x5ef3f4,_0x4c41cc)[_0xedb1('0xb9')](function(_0x473e7b){return 0x1;});});}else{this['voiceQueues'][_0x145891[_0xedb1('0xb5')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xedb1('0x1f')][_0x145891[_0xedb1('0xb5')]][_0xedb1('0x11e')]+=0x1;_0x8f687f[_0xedb1('0xa9')]=0xb;_0x8f687f[_0xedb1('0xaa')]='Abandoned';_0x8f687f[_0xedb1('0x115')]=_0xedb1('0x11f');_0x8f687f[_0xedb1('0xf6')]+=0x1;_0x8f687f[_0xedb1('0xf1')]+=0x1;_0x5ef3f4=this[_0xedb1('0x1f')][_0x145891['queue']][_0xedb1('0x120')];_0x4c41cc=this[_0xedb1('0x1f')][_0x145891[_0xedb1('0xb5')]][_0xedb1('0x116')];_0x504892[_0xedb1('0xbd')](_0x8f687f,_0x8f687f['state'],_0x16be8d[_0xedb1('0x117')])[_0xedb1('0xb9')](function(_0x3ffe25){if(_0x8f687f[_0xedb1('0xf6')]>=_0x504892[_0xedb1('0x1f')][_0x145891[_0xedb1('0xb5')]][_0xedb1('0x121')]){_0x504892[_0xedb1('0x111')](_0x8f687f,_0x3ffe25[_0xedb1('0x118')]);}else{_0x504892[_0xedb1('0xc6')]({'active':![],'countabandonedretry':_0x8f687f[_0xedb1('0xf6')],'scheduledat':moment()[_0xedb1('0xfa')](_0x504892['voiceQueues'][_0x145891['queue']][_0xedb1('0x120')],_0xedb1('0xfc'))[_0xedb1('0x7b')](_0xedb1('0xfd')),'ContactId':_0x16be8d[_0xedb1('0xd8')],'ListId':_0x16be8d[_0xedb1('0xd9')],'VoiceQueueId':_0x16be8d['VoiceQueueId']||undefined,'CampaignId':_0x16be8d[_0xedb1('0xdb')]||undefined})[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x122')));var _0x21fbca=new History(_0x8f687f);_0x21fbca['state']=0xb;_0x21fbca['statedesc']=_0xedb1('0x123');_0x21fbca['starttime']=moment()[_0xedb1('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');_0x21fbca['endtime']=_0x21fbca[_0xedb1('0xac')];_0x21fbca[_0xedb1('0x11b')]=_0x8f687f[_0xedb1('0x11b')];_0x21fbca['calleridnum']=_0x8f687f[_0xedb1('0x11c')];_0x504892[_0xedb1('0xd2')](_0x21fbca)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x124')));}})[_0xedb1('0xb9')](function(_0x558554){if(_0x25548b)_0x504892[_0xedb1('0x125')](_0x8f687f,_0x5ef3f4,_0x4c41cc)[_0xedb1('0xb9')](function(_0x1f400a){return 0x1;});});}}}};Dialer[_0xedb1('0x1b')]['syncNewExten']=function(_0x3411cc){if(this['actions'][_0x3411cc[_0xedb1('0xe7')]]){this[_0xedb1('0x23')][_0x3411cc[_0xedb1('0xe7')]][_0xedb1('0xb3')]=_0x3411cc['channel'];}if(this['uniqueId'][_0x3411cc['uniqueid']]){this[_0xedb1('0x24')][_0x3411cc[_0xedb1('0xe7')]]['channel']=_0x3411cc[_0xedb1('0xb3')];}};Dialer[_0xedb1('0x1b')][_0xedb1('0x126')]=function(_0x378607){if(strategy[this[_0xedb1('0x1f')][this[_0xedb1('0x23')][_0x378607[_0xedb1('0x127')]][_0xedb1('0xb5')]]['strategy']]===_0xedb1('0x1a')){if(this['actions'][_0x378607[_0xedb1('0x127')]]&&_[_0xedb1('0xb1')](this[_0xedb1('0x23')][_0x378607[_0xedb1('0x127')]][_0xedb1('0x128')])&&_0x378607[_0xedb1('0xb2')]==='1'&&_0x378607[_0xedb1('0x129')]==='0'){if(this[_0xedb1('0x21')][_0x378607['stateinterface']]){if(!this[_0xedb1('0x21')][_0x378607[_0xedb1('0x12a')]][_0xedb1('0x128')]){this[_0xedb1('0x21')][_0x378607[_0xedb1('0x12a')]][_0xedb1('0x128')]=!![];this[_0xedb1('0x23')][_0x378607[_0xedb1('0x127')]][_0xedb1('0x128')]=!![];this[_0xedb1('0x23')][_0x378607['actionid']][_0xedb1('0x12a')]=_0x378607[_0xedb1('0x12a')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x378607['actionid']][_0xedb1('0xb5')]][_0xedb1('0x4d')]]||'rrmemory')===_0xedb1('0x12b')){if(this[_0xedb1('0x23')][_0x378607[_0xedb1('0x127')]]){if(this['agents'][_0x378607[_0xedb1('0x12a')]]){this[_0xedb1('0x23')][_0x378607[_0xedb1('0x127')]][_0xedb1('0x12a')]=_0x378607['stateinterface'];if(_[_0xedb1('0xb1')](this[_0xedb1('0x28')][this['actions'][_0x378607[_0xedb1('0x127')]][_0xedb1('0xb5')]])){this[_0xedb1('0x28')][this[_0xedb1('0x23')][_0x378607[_0xedb1('0x127')]][_0xedb1('0xb5')]]=[];}this[_0xedb1('0x28')][this[_0xedb1('0x23')][_0x378607[_0xedb1('0x127')]]['queue']][_0xedb1('0x12c')](_[_0xedb1('0x8f')](_[_0xedb1('0xd7')](this['actions'][_0x378607['actionid']],[_0xedb1('0x12d'),_0xedb1('0x12a')]),{'status':_0x378607['status'],'paused':_0x378607[_0xedb1('0x129')]}));}}}};function unlockQueueStatus(_0x4d8379,_0x3fb94f){setTimeout(function(){if(_[_0xedb1('0x39')](_0x4d8379[_0xedb1('0x12e')])){loggerBooked[_0xedb1('0x98')](_0xedb1('0x12f'),_0x3fb94f);}_0x4d8379['queueStatusComplete']=!![];loggerBooked[_0xedb1('0x7e')](_0xedb1('0x130'),_0x3fb94f,JSON['stringify'](_[_0xedb1('0xd7')](_0x4d8379,[_0xedb1('0x3e'),_0xedb1('0x12e')])));},0x1f3);}Dialer[_0xedb1('0x1b')]['syncQueueStatusComplete']=function(_0x3229cb){var _0x28e25d=this;var _0x218010=_0x28e25d[_0xedb1('0x1f')][_0x28e25d[_0xedb1('0x23')][_0x3229cb['actionid']][_0xedb1('0xb5')]];if(strategy[this['voiceQueues'][this['actions'][_0x3229cb['actionid']][_0xedb1('0xb5')]][_0xedb1('0x4d')]]===_0xedb1('0x1a')){if(this[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]]&&this[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]][_0xedb1('0x12a')]){this['preview'][_0xedb1('0x131')](this[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]][_0xedb1('0x12d')],this[_0xedb1('0x23')][_0x3229cb['actionid']]['stateinterface'])[_0xedb1('0xbe')](function(_0x3ad95f){logger[_0xedb1('0x98')](_0xedb1('0x132'),util[_0xedb1('0x99')](_0x3ad95f,{'showHidden':![],'depth':null}));})[_0xedb1('0x1d')](function(){_0x28e25d[_0xedb1('0xb4')](_0x28e25d['voiceQueues'][_0x28e25d[_0xedb1('0x23')][_0x3229cb['actionid']]['queue']]);_0x28e25d['agents'][_0x28e25d['actions'][_0x3229cb[_0xedb1('0x127')]]['stateinterface']][_0xedb1('0x128')]=![];delete _0x28e25d[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]];unlockQueueStatus(_0x218010);});}else{this[_0xedb1('0xb4')](this[_0xedb1('0x1f')][this[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]][_0xedb1('0xb5')]]);this[_0xedb1('0xc6')]({'active':![],'ContactId':this[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]][_0xedb1('0xd8')],'ListId':this['actions'][_0x3229cb['actionid']][_0xedb1('0xd9')],'VoiceQueueId':this[_0xedb1('0x23')][_0x3229cb['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]][_0xedb1('0xdb')]||undefined})[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x133')));delete this[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]];unlockQueueStatus(_0x218010);}}else if((strategy[this[_0xedb1('0x1f')][this[_0xedb1('0x23')][_0x3229cb['actionid']][_0xedb1('0xb5')]][_0xedb1('0x4d')]]||_0xedb1('0x12b'))===_0xedb1('0x12b')){var _0x1fa3fe;if(this[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]]&&!_[_0xedb1('0x42')](this[_0xedb1('0x28')][this['actions'][_0x3229cb['actionid']]['queue']])){if(this[_0xedb1('0x134')][_0x28e25d[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]][_0xedb1('0xb5')]]){this[_0xedb1('0x134')][_0x28e25d[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]][_0xedb1('0xb5')]]=this['queueBookedRR'][this[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]][_0xedb1('0xb5')]]?this['queueBookedRR'][this[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]][_0xedb1('0xb5')]]:this[_0xedb1('0x28')][this[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]][_0xedb1('0xb5')]]?this[_0xedb1('0x28')][this['actions'][_0x3229cb[_0xedb1('0x127')]][_0xedb1('0xb5')]][_0xedb1('0x135')]||0x0:0x0;}this[_0xedb1('0x28')][this[_0xedb1('0x23')][_0x3229cb[_0xedb1('0x127')]]['queue']][_0xedb1('0x135')]=this['queueBookedRR'][this['actions'][_0x3229cb['actionid']][_0xedb1('0xb5')]];for(var _0x544088=0x0;_0x544088=0x0;})[_0xedb1('0xbe')](myreject(_0x78b999)));}}else{_0x49fe7f[_0xedb1('0x12c')](ami['Action']({'action':_0xedb1('0x14d'),'command':util[_0xedb1('0x7b')](_0xedb1('0x14e'),_0x173597,!_['isUndefined'](config[_0xedb1('0x149')][_0xe05226])?_0xe05226:'')})[_0xedb1('0xb9')](function(_0x19e80f){return _0x19e80f[_0xedb1('0x150')][_0xedb1('0x151')](_0xedb1('0x152'))>=0x0;})[_0xedb1('0xbe')](myreject(_0x78b999)));}BPromise[_0xedb1('0x153')](_0x49fe7f)[_0xedb1('0xb9')](function(_0x51fe9){var _0x4ecfd8=_['some'](_0x51fe9);if(_0x4ecfd8){return _0x58b966(_0x4ecfd8);}else{_0xc91c35[_0xedb1('0x3a')]=_0x966d57?_0xedb1('0x154'):_0xedb1('0x155');return _0x78b999(msgResponse(_0xedb1('0x156'),'Failure',_0xedb1('0x157')+_0x966d57+'\x20'+_0x2ce7c5+_0xedb1('0x158')+util[_0xedb1('0x99')](_0x173597,{'showHidden':![],'depth':null})+_0xedb1('0x159')+_0xe05226));}})[_0xedb1('0xbe')](function(_0x2bb488){return _0x78b999(msgResponse(_0xedb1('0x144'),_0xedb1('0x145'),JSON[_0xedb1('0x46')](_0x2bb488)));});});};Dialer['prototype'][_0xedb1('0x15a')]=function(_0x33c24a){var _0x1cf228=this;return function(){switch(_0x33c24a[_0xedb1('0x5a')]){case _0xedb1('0x15b'):freeVariablesPredictive(_0x33c24a);_0x1cf228[_0xedb1('0x15c')](_0x33c24a,0x1);break;case _0xedb1('0x15d'):freeVariablesPredictive(_0x33c24a);_0x1cf228['handlePower'](_0x33c24a,_0x33c24a[_0xedb1('0x15e')]);break;case _0xedb1('0x15f'):_0x1cf228['predictive'](_0x33c24a);break;case'booked':freeVariablesPredictive(_0x33c24a);_0x1cf228[_0xedb1('0x15c')](_0x33c24a,0x1);break;default:freeVariablesPredictive(_0x33c24a);logger[_0xedb1('0x98')]('Queue',_0x33c24a['name'],_0xedb1('0x160'));}};};Dialer['prototype'][_0xedb1('0x161')]=function(_0x13238b){var _0x24e653=this;return function(){_0x24e653[_0xedb1('0x162')](_0x13238b);};};Dialer[_0xedb1('0x1b')][_0xedb1('0xd')]=function(_0x5672b4){var _0x49b4b6=this;if(isNotPreview(_0x5672b4['dialMethod'])){if(isVoiceQueueOutbound(_0x5672b4[_0xedb1('0x4b')])&&isActive(_0x5672b4[_0xedb1('0x59')])){_0x5672b4[_0xedb1('0xa3')]=!![];BPromise[_0xedb1('0xbb')]()[_0xedb1('0xb9')](checkIsLoggedIn(_0x5672b4,_0x5672b4[_0xedb1('0x50')]))[_0xedb1('0xb9')](checkIsActive(_0x5672b4,_0x5672b4[_0xedb1('0x59')]))[_0xedb1('0xb9')](checkInterval(_0x5672b4))[_0xedb1('0xb9')](_0x49b4b6[_0xedb1('0x140')](_0x5672b4))[_0xedb1('0xb9')](_0x49b4b6['checkIfTime'](_0x5672b4[_0xedb1('0x163')],_0x5672b4[_0xedb1('0x164')],_0x5672b4[_0xedb1('0x3e')],_0x5672b4))['then'](_0x49b4b6[_0xedb1('0x165')](_0x5672b4[_0xedb1('0x3f')],_0x5672b4['dialTimezone'],_0x5672b4[_0xedb1('0x3e')],_0x5672b4))[_0xedb1('0xb9')](_0x49b4b6[_0xedb1('0x15a')](_0x5672b4))[_0xedb1('0xbe')](loggerCatchQueueSummary(_0xedb1('0x166'),_0x5672b4));}else{notSendMessagesQueue(_0x5672b4);}}else{freeVariablesPredictive(_0x5672b4);}};Dialer['prototype'][_0xedb1('0x13f')]=function(){var _0x13fcb9=this;var _0x5e9e18;for(var _0x277f75 in this['campaigns']){if(typeof this[_0xedb1('0x20')][_0x277f75]!==_0xedb1('0x9c')){_0x5e9e18=this[_0xedb1('0x20')][_0x277f75];if(isCampaignIvr(_0x5e9e18[_0xedb1('0x4b')])&&isActive(_0x5e9e18[_0xedb1('0x77')])){_0x5e9e18[_0xedb1('0xa3')]=!![];BPromise[_0xedb1('0xbb')]()[_0xedb1('0xb9')](checkIsActive(_0x5e9e18,_0x5e9e18[_0xedb1('0x77')]))['then'](checkInterval(_0x5e9e18))[_0xedb1('0xb9')](_0x13fcb9[_0xedb1('0x140')](_0x5e9e18))[_0xedb1('0xb9')](_0x13fcb9[_0xedb1('0x143')](_0x5e9e18[_0xedb1('0x163')],_0x5e9e18[_0xedb1('0x164')],_0x5e9e18[_0xedb1('0x3e')],_0x5e9e18))[_0xedb1('0xb9')](_0x13fcb9['checkIfTimeIntervals'](_0x5e9e18['Interval'],_0x5e9e18[_0xedb1('0x164')],_0x5e9e18[_0xedb1('0x3e')],_0x5e9e18))[_0xedb1('0xb9')](_0x13fcb9['launchHandleIvr'](_0x5e9e18))['catch'](loggerCatchQueueSummary(_0xedb1('0x167'),_0x5e9e18));}else{notSendMessagesCampaign(_0x5e9e18);}}}};function getCallerIdRandom(_0x2e7a22,_0x5e065d){var _0x4a166e;var _0x44335a;var _0x2655fa;if(_0x5e065d<=0x0){_0x5e065d=0x1;}_0x4a166e=new RegExp(_0xedb1('0x168')+_0x5e065d+'}$');_0x44335a=Math[_0xedb1('0x169')](0xa,_0x5e065d-0x1);_0x2655fa=Math[_0xedb1('0x169')](0xa,_0x5e065d)-0x1;return util[_0xedb1('0x7b')]('%s',_[_0xedb1('0x16a')](_0x2e7a22,_0x4a166e,_[_0xedb1('0x16b')](_0x44335a,_0x2655fa)));}function extractCalleridName(_0x576246){var _0x2ceff8=_0x576246[_0xedb1('0x16c')](/"(.*?)"/);return _0x2ceff8?_0x2ceff8[0x1]:_0x576246;}function extractCalleridNumber(_0x2b1a66){var _0x496c35=_0x2b1a66[_0xedb1('0x16c')](/<(.*?)>/);return _0x496c35?_0x496c35[0x1]:_0x2b1a66;}Dialer['prototype'][_0xedb1('0x16d')]=function(_0x3cb876,_0x546806){var _0x213fce=this;var _0x4efdaa=uuid['v4']();this[_0xedb1('0x23')][_0x4efdaa]=new Action(_0x3cb876,_0x546806,_0x4efdaa);return new BPromise(function(_0x30b713,_0x49084d){if(_[_0xedb1('0x39')](_0x3cb876)&&typeof _0x3cb876!==_0xedb1('0x16e')){return _0x49084d(msgResponse(_0xedb1('0x16f'),_0xedb1('0x145'),_0xedb1('0x170')));}if(_[_0xedb1('0x39')](_0x546806[_0xedb1('0x171')])||_0x546806[_0xedb1('0x171')]===null){return _0x49084d(msgResponse(_0xedb1('0x16f'),_0xedb1('0x145'),_0xedb1('0x172')));}var _0x4a1224={'XMD-CALLERID':_0x213fce[_0xedb1('0x23')][_0x4efdaa][_0xedb1('0x173')](),'XMD-AGI':_0x3cb876['dialQueueProject']?util[_0xedb1('0x7b')](_0xedb1('0x174'),ipAgi,_0x3cb876[_0xedb1('0x106')]):_0xedb1('0x175'),'XMD-AGIAFTER':_0x3cb876[_0xedb1('0x176')]?util[_0xedb1('0x7b')](_0xedb1('0x174'),ipAgi,_0x3cb876[_0xedb1('0x176')]):_0xedb1('0x175'),'XMD-QUEUE':_0x3cb876[_0xedb1('0x4b')]===_0xedb1('0x4c')?util[_0xedb1('0x7b')](_0xedb1('0x177'),_0x3cb876[_0xedb1('0x3e')],_0x3cb876[_0xedb1('0x178')]||'',_0x3cb876[_0xedb1('0x179')]?'c':'',_0x3cb876[_0xedb1('0x17a')]||0x3):_0xedb1('0x175'),'XMD-CONTACTID':_0x546806['ContactId'],'XMD-CDRTYPE':_0xedb1('0xa'),'CALLERID(all)':_0x213fce[_0xedb1('0x23')][_0x4efdaa][_0xedb1('0x173')](),'XMD-AMD':_0x3cb876[_0xedb1('0xe4')]?_0xedb1('0x17b'):_0xedb1('0x175'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x3cb876[_0xedb1('0xe4')]){_0x4a1224[_0xedb1('0x17c')]=_0x3cb876['dialAMDInitialSilence']||0x9c4;_0x4a1224[_0xedb1('0x17d')]=_0x3cb876['dialAMDGreeting']||0x5dc;_0x4a1224[_0xedb1('0x17e')]=_0x3cb876['dialAMDAfterGreetingSilence']||0x320;_0x4a1224['XMD-AMDTOTALANALYSISTIME']=_0x3cb876['dialAMDTotalAnalysisTime']||0x1388;_0x4a1224[_0xedb1('0x17f')]=_0x3cb876[_0xedb1('0x180')]||0x64;_0x4a1224[_0xedb1('0x181')]=_0x3cb876[_0xedb1('0x182')]||0x32;_0x4a1224[_0xedb1('0x183')]=_0x3cb876[_0xedb1('0x184')]||0x3;_0x4a1224[_0xedb1('0x185')]=_0x3cb876[_0xedb1('0x186')]||0x100;_0x4a1224[_0xedb1('0x187')]=_0x3cb876[_0xedb1('0x188')]||0x1388;}if(_0x3cb876[_0xedb1('0x4b')]===_0xedb1('0x4c')){_0x4a1224[_0xedb1('0x189')]=_0x546806['VoiceQueueId'];}else{_0x4a1224[_0xedb1('0x18a')]=_0x546806['CampaignId'];}for(var _0x44ec8d in _0x546806[_0xedb1('0x18b')]){if(typeof _0x546806[_0xedb1('0x18b')][_0x44ec8d]!==_0xedb1('0x9c')){if(isNotNull(_0x546806[_0xedb1('0x18b')][_0x44ec8d])&&_0x44ec8d!=='id'&&_0x44ec8d!==_0xedb1('0x18c')&&_0x44ec8d!==_0xedb1('0x18d')&&_0x44ec8d!==_0xedb1('0x18e')){_0x4a1224[util['format'](_0xedb1('0x18f'),_0xedb1('0x190'),_[_0xedb1('0x191')](_0x44ec8d))]=_0x546806['Contact'][_0x44ec8d];}}}var _0x3a0409=_0x213fce[_0xedb1('0x192')](_0x3cb876[_0xedb1('0x76')])?getCallerId(_0x3cb876[_0xedb1('0x76')]['callerid'],_0x3cb876[_0xedb1('0x5b')],_0x3cb876[_0xedb1('0x193')]>0x0?getCallerIdRandom(_0x3cb876['dialOriginateCallerIdNumber'],_0x3cb876['dialRandomLastDigitCallerIdNumber']):_0x3cb876[_0xedb1('0x5c')]):getCallerId(_['isNil'](_0x3cb876[_0xedb1('0x141')])?_0x3cb876[_0xedb1('0x76')]['callerid']:_0x3cb876[_0xedb1('0x141')][_0xedb1('0x194')],_0x3cb876[_0xedb1('0x5b')],_0x3cb876[_0xedb1('0x193')]>0x0?getCallerIdRandom(_0x3cb876[_0xedb1('0x5c')],_0x3cb876[_0xedb1('0x193')]):_0x3cb876[_0xedb1('0x5c')]);if(_0x3a0409){_0x4a1224[_0xedb1('0x195')]=_0x213fce[_0xedb1('0x23')][_0x4efdaa][_0xedb1('0x196')]=extractCalleridName(_0x3a0409);_0x4a1224['XMD-ORIGINATECALLERIDNUM']=_0x546806[_0xedb1('0x171')];}return ami[_0xedb1('0x14c')]({'actionid':_0x4efdaa,'action':_0xedb1('0x16f'),'channel':_0x213fce[_0xedb1('0x192')](_0x3cb876[_0xedb1('0x76')])?util[_0xedb1('0x7b')]('SIP/%s/%s%s',_0x3cb876[_0xedb1('0x76')][_0xedb1('0x3e')],isNotNull(_0x3cb876[_0xedb1('0x5e')])?_0x3cb876[_0xedb1('0x5e')][_0xedb1('0x197')]()||'':'',_0x3cb876[_0xedb1('0x198')]>0x0?_0x546806[_0xedb1('0x171')][_0xedb1('0x199')](_0x3cb876['dialCutDigit']):_0x546806[_0xedb1('0x171')]):util[_0xedb1('0x7b')]('SIP/%s/%s%s',_[_0xedb1('0xb1')](_0x3cb876[_0xedb1('0x141')])?_0x3cb876['Trunk'][_0xedb1('0x3e')]:_0x3cb876['TrunkBackup']['name'],isNotNull(_0x3cb876['dialPrefix'])?_0x3cb876[_0xedb1('0x5e')][_0xedb1('0x197')]()||'':'',_0x3cb876[_0xedb1('0x198')]>0x0?_0x546806[_0xedb1('0x171')][_0xedb1('0x199')](_0x3cb876[_0xedb1('0x198')]):_0x546806[_0xedb1('0x171')]),'callerid':_0x3a0409,'Exten':_0xedb1('0xe3'),'Context':_0xedb1('0x19a'),'Priority':'1','variable':_0x4a1224,'timeout':(_0x3cb876[_0xedb1('0x5d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4efdaa})[_0xedb1('0xb9')](function(_0x578314){return _0x30b713(_0x578314);})[_0xedb1('0xbe')](function(_0x527d24){_0x3cb876[_0xedb1('0x66')]+=0x1;var _0x4789bd=new History(_0x213fce[_0xedb1('0x23')][_0x4efdaa]);logger[_0xedb1('0x98')](util[_0xedb1('0x7b')](_0xedb1('0x19b'),JSON[_0xedb1('0x46')](_0x527d24)));_0x4789bd['state']=0xe;_0x4789bd[_0xedb1('0xaa')]='OriginateError';_0x4789bd[_0xedb1('0xac')]=moment()[_0xedb1('0x7b')](_0xedb1('0xfd'));_0x4789bd[_0xedb1('0xab')]=_0x4789bd['starttime'];_0x213fce['createHistory'](_0x4789bd)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x19c')));_0x213fce[_0xedb1('0xd0')](_0x4789bd)[_0xedb1('0xbe')](loggerCatch('[originate][error]'))[_0xedb1('0x1d')](function(){delete _0x213fce['actions'][_0x4efdaa];return _0x49084d(msgResponse(_0xedb1('0x16f'),_0xedb1('0x45'),_0xedb1('0x19d')));});});});};Dialer[_0xedb1('0x1b')]['syncOriginateResponse']=function(_0x1c3c32){var _0x22407b=this[_0xedb1('0x23')][_0x1c3c32['actionid']];if(_0x22407b){delete this[_0xedb1('0x23')][_0x1c3c32[_0xedb1('0x127')]];_0x22407b[_0xedb1('0x114')]=moment()[_0xedb1('0x7b')](_0xedb1('0xfd'));var _0x3ab355=_0x22407b['type']==='ivr'?this[_0xedb1('0x20')][_0x22407b[_0xedb1('0xb5')]]:this['voiceQueues'][_0x22407b['getQueue']()];if(!this['isSuccess'](_0x1c3c32[_0xedb1('0x19e')])){this['updateOriginated'](_0x3ab355);return this[_0xedb1('0x19f')](_0x22407b,_0x3ab355,_0x1c3c32)['catch'](loggerCatch(_0xedb1('0x1a0')));}this[_0xedb1('0x24')][_0x1c3c32[_0xedb1('0xe7')]]=_0x22407b;}};Dialer['prototype']['checkRetriveMax']=function(_0x432cdc,_0x583d96,_0x401062){var _0x5602c6=new History(_0x583d96);if(_0x5602c6[_0xedb1('0x1a1')]+_0x5602c6[_0xedb1('0xf3')]+_0x5602c6[_0xedb1('0xf4')]+_0x5602c6[_0xedb1('0x1a2')]+_0x5602c6[_0xedb1('0xf5')]+_0x5602c6[_0xedb1('0xf6')]+_0x5602c6[_0xedb1('0xf7')]+_0x5602c6[_0xedb1('0x102')]>=_0x401062[_0xedb1('0x1a3')]-0x1){return!![];}switch(_0x432cdc){case 0x3:if(_0x5602c6[_0xedb1('0xf4')]>=_0x401062[_0xedb1('0x1a4')]-0x1){return!![];}this[_0xedb1('0xc6')]({'active':![],'countnoanswerretry':_0x5602c6[_0xedb1('0xf4')]+=0x1,'scheduledat':moment()[_0xedb1('0xfa')](_0x401062[_0xedb1('0x1a5')],'minutes')[_0xedb1('0x7b')](_0xedb1('0xfd')),'ContactId':_0x5602c6['ContactId'],'ListId':_0x5602c6[_0xedb1('0xd9')],'VoiceQueueId':_0x5602c6[_0xedb1('0xda')]||undefined,'CampaignId':_0x5602c6['CampaignId']||undefined})[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x1a6')));break;case 0x5:if(_0x5602c6[_0xedb1('0x1a1')]>=_0x401062[_0xedb1('0x1a7')]-0x1){return!![];}this[_0xedb1('0xc6')]({'active':![],'countbusyretry':_0x5602c6[_0xedb1('0x1a1')]+=0x1,'scheduledat':moment()[_0xedb1('0xfa')](_0x401062['dialBusyRetryFrequency'],_0xedb1('0xfc'))[_0xedb1('0x7b')](_0xedb1('0xfd')),'ContactId':_0x5602c6['ContactId'],'ListId':_0x5602c6[_0xedb1('0xd9')],'VoiceQueueId':_0x5602c6[_0xedb1('0xda')]||undefined,'CampaignId':_0x5602c6[_0xedb1('0xdb')]||undefined})[_0xedb1('0xbe')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x5602c6['countcongestionretry']>=_0x401062['dialCongestionMaxRetry']-0x1){return!![];}this[_0xedb1('0xc6')]({'active':![],'countcongestionretry':_0x5602c6[_0xedb1('0xf3')]+=0x1,'scheduledat':moment()[_0xedb1('0xfa')](_0x401062[_0xedb1('0x1a8')],_0xedb1('0xfc'))['format'](_0xedb1('0xfd')),'ContactId':_0x5602c6[_0xedb1('0xd8')],'ListId':_0x5602c6[_0xedb1('0xd9')],'VoiceQueueId':_0x5602c6[_0xedb1('0xda')]||undefined,'CampaignId':_0x5602c6[_0xedb1('0xdb')]||undefined})[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x1a9')));break;case 0x0:if(_0x5602c6[_0xedb1('0x1a2')]>=_0x401062[_0xedb1('0x1aa')]-0x1){return!![];}else{this[_0xedb1('0xc6')]({'active':![],'countnosuchnumberretry':_0x5602c6[_0xedb1('0x1a2')]+=0x1,'scheduledat':moment()['add'](_0x401062[_0xedb1('0x1ab')],_0xedb1('0xfc'))[_0xedb1('0x7b')](_0xedb1('0xfd')),'ContactId':_0x5602c6[_0xedb1('0xd8')],'ListId':_0x5602c6['ListId'],'VoiceQueueId':_0x5602c6['VoiceQueueId']||undefined,'CampaignId':_0x5602c6[_0xedb1('0xdb')]||undefined})[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x1ac')));}break;case 0xa:if(_0x5602c6[_0xedb1('0xf5')]>=_0x401062[_0xedb1('0x1ad')]-0x1){return!![];}this[_0xedb1('0xc6')]({'active':![],'countdropretry':_0x5602c6[_0xedb1('0xf5')]+=0x1,'scheduledat':moment()[_0xedb1('0xfa')](_0x401062[_0xedb1('0x1ae')],_0xedb1('0xfc'))[_0xedb1('0x7b')](_0xedb1('0xfd')),'ContactId':_0x5602c6['ContactId'],'ListId':_0x5602c6[_0xedb1('0xd9')],'VoiceQueueId':_0x5602c6['VoiceQueueId']||undefined,'CampaignId':_0x5602c6['CampaignId']||undefined})[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x119')));break;case 0xb:if(_0x5602c6[_0xedb1('0xf6')]>=_0x401062[_0xedb1('0x121')]-0x1){return!![];}this[_0xedb1('0xc6')]({'active':![],'countabandonedretry':_0x5602c6[_0xedb1('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x401062[_0xedb1('0x120')],_0xedb1('0xfc'))[_0xedb1('0x7b')](_0xedb1('0xfd')),'ContactId':_0x5602c6['ContactId'],'ListId':_0x5602c6[_0xedb1('0xd9')],'VoiceQueueId':_0x5602c6['VoiceQueueId']||undefined,'CampaignId':_0x5602c6['CampaignId']||undefined})['catch'](loggerCatch(_0xedb1('0x122')));break;case 0x13:if(_0x5602c6[_0xedb1('0xf7')]>=_0x401062['dialMachineMaxRetry']-0x1){return!![];}this[_0xedb1('0xc6')]({'active':![],'countmachineretry':_0x5602c6['countmachineretry']+=0x1,'scheduledat':moment()[_0xedb1('0xfa')](_0x401062['dialMachineRetryFrequency'],_0xedb1('0xfc'))[_0xedb1('0x7b')](_0xedb1('0xfd')),'ContactId':_0x5602c6[_0xedb1('0xd8')],'ListId':_0x5602c6['ListId'],'VoiceQueueId':_0x5602c6[_0xedb1('0xda')]||undefined,'CampaignId':_0x5602c6['CampaignId']||undefined})[_0xedb1('0xbe')](loggerCatch(_0xedb1('0xfe')));break;case 0x14:if(_0x5602c6[_0xedb1('0x102')]>=_0x401062[_0xedb1('0x1af')]-0x1){return!![];}this[_0xedb1('0xc6')]({'active':![],'countagentrejectretry':_0x5602c6[_0xedb1('0x102')]+=0x1,'scheduledat':moment()[_0xedb1('0xfa')](_0x401062[_0xedb1('0x1b0')],'minutes')[_0xedb1('0x7b')](_0xedb1('0xfd')),'ContactId':_0x5602c6[_0xedb1('0xd8')],'ListId':_0x5602c6[_0xedb1('0xd9')],'VoiceQueueId':_0x5602c6['VoiceQueueId']||undefined,'CampaignId':_0x5602c6['CampaignId']||undefined})[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x1b1')));break;default:return!![];}};Dialer[_0xedb1('0x1b')][_0xedb1('0x19f')]=function(_0xf626f,_0x42a4b2,_0x416a13){var _0x493d2b=this;var _0x209af0=new History(_0xf626f);var _0x5203ce=![];var _0x27cc17;var _0x5e2d23;return new BPromise(function(_0x12c13a,_0x26a77d){if(_[_0xedb1('0x39')](_0x42a4b2)&&typeof _0x42a4b2!==_0xedb1('0x16e')){return _0x26a77d(msgResponse(_0xedb1('0x1b2'),_0xedb1('0x145'),'entity\x20is\x20undefine'));}if(_[_0xedb1('0x39')](_0x416a13)&&typeof _0x416a13!==_0xedb1('0x16e')){return _0x26a77d(msgResponse(_0xedb1('0x1b2'),'Failure',_0xedb1('0x1b3')));}_0x493d2b['verifyAdditionalPhones'](_0x209af0,_0x416a13[_0xedb1('0x1b4')],_0x42a4b2)[_0xedb1('0xb9')](function(_0x68023d){if(_0x68023d[_0xedb1('0x118')]==0x1)_0x5203ce=!![];switch(_0x416a13[_0xedb1('0x1b4')]){case'0':_0x42a4b2['outboundNoSuchCallsDay']+=0x1;_0x209af0[_0xedb1('0xa9')]=0x0;_0x209af0[_0xedb1('0xaa')]=_0xedb1('0x1b5');_0x209af0[_0xedb1('0x1a2')]+=0x1;_0x209af0[_0xedb1('0xf1')]+=0x1;ami['emit'](_0xedb1('0x1b6'),ut['buildObj'](_0xf626f,_0xedb1('0x1b7')));_0x27cc17=_0x42a4b2[_0xedb1('0x1ab')];_0x5e2d23=_0x42a4b2[_0xedb1('0x116')];_0x493d2b['createHistory'](_0x209af0)['catch'](loggerCatch(_0xedb1('0xf2')));if(_0x493d2b['checkRetriveMax'](0x0,_0xf626f,_0x42a4b2)&&!_0x5203ce){if(_0x209af0[_0xedb1('0x1a2')]>=_0x42a4b2[_0xedb1('0x1aa')]){_0x493d2b['createStateFinal'](_0x209af0,_0x12c13a,_0x26a77d,_0xedb1('0x1b8'));}else{_0x493d2b[_0xedb1('0xf8')](_0x209af0,_0x12c13a,_0x26a77d,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x42a4b2[_0xedb1('0x64')]+=0x1;_0x209af0[_0xedb1('0xa9')]=0x3;_0x209af0['statedesc']=_0xedb1('0x1b9');_0x209af0[_0xedb1('0xf4')]+=0x1;_0x209af0['countglobal']+=0x1;ami[_0xedb1('0x4a')](_0xedb1('0x1ba'),ut['buildObj'](_0xf626f,'noanswer'));_0x27cc17=_0x42a4b2['dialNoAnswerRetryFrequency'];_0x5e2d23=_0x42a4b2['callAdditionalPhoneAfterMin'];_0x493d2b[_0xedb1('0xd2')](_0x209af0)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x1bb')));if(_0x493d2b[_0xedb1('0x1bc')](0x3,_0xf626f,_0x42a4b2)&&!_0x5203ce){if(_0x209af0[_0xedb1('0xf4')]>=_0x42a4b2[_0xedb1('0x1a4')]){_0x493d2b['createStateFinal'](_0x209af0,_0x12c13a,_0x26a77d,_0xedb1('0x1bd'));}else{_0x493d2b[_0xedb1('0xf8')](_0x209af0,_0x12c13a,_0x26a77d,_0xedb1('0x1bd'));}}break;case'5':_0x42a4b2['outboundBusyCallsDay']+=0x1;_0x209af0[_0xedb1('0xa9')]=0x5;_0x209af0['statedesc']=_0xedb1('0x1be');_0x209af0[_0xedb1('0x1a1')]+=0x1;_0x209af0[_0xedb1('0xf1')]+=0x1;ami['emit']('custom:agentbusy',ut['buildObj'](_0xf626f,_0xedb1('0x1bf')));_0x27cc17=_0x42a4b2[_0xedb1('0x1c0')];_0x5e2d23=_0x42a4b2[_0xedb1('0x116')];_0x493d2b['createHistory'](_0x209af0)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x1c1')));if(_0x493d2b['checkRetriveMax'](0x5,_0xf626f,_0x42a4b2)&&!_0x5203ce){if(_0x209af0[_0xedb1('0x1a1')]>=_0x42a4b2[_0xedb1('0x1a7')]){_0x493d2b[_0xedb1('0xf9')](_0x209af0,_0x12c13a,_0x26a77d,_0xedb1('0x1c2'));}else{_0x493d2b[_0xedb1('0xf8')](_0x209af0,_0x12c13a,_0x26a77d,_0xedb1('0x1c2'));}}break;case'8':_0x42a4b2['outboundCongestionCallsDay']+=0x1;_0x209af0['state']=0x8;_0x209af0[_0xedb1('0xaa')]=_0xedb1('0x1c3');_0x209af0['countcongestionretry']+=0x1;_0x209af0['countglobal']+=0x1;_0x27cc17=_0x42a4b2[_0xedb1('0x1a8')];_0x5e2d23=_0x42a4b2['callAdditionalPhoneAfterMin'];ami['emit'](_0xedb1('0x1c4'),ut[_0xedb1('0xec')](_0xf626f,'congestion'));_0x493d2b[_0xedb1('0xd2')](_0x209af0)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x1c5')));if(_0x493d2b['checkRetriveMax'](0x8,_0xf626f,_0x42a4b2)&&!_0x5203ce){if(_0x209af0[_0xedb1('0xf3')]>=_0x42a4b2[_0xedb1('0x1c6')]){_0x493d2b[_0xedb1('0xf9')](_0x209af0,_0x12c13a,_0x26a77d,_0xedb1('0x1c7'));}else{_0x493d2b[_0xedb1('0xf8')](_0x209af0,_0x12c13a,_0x26a77d,'reason\x208\x20congestion');}}break;case'11':_0x42a4b2['outboundAbandonedCallsDay']+=0x1;_0x209af0[_0xedb1('0xa9')]=0xb;_0x209af0[_0xedb1('0xaa')]=_0xedb1('0x123');_0x209af0[_0xedb1('0xf6')]+=0x1;_0x209af0['countglobal']+=0x1;_0x27cc17=_0x42a4b2['dialAbandonedRetryFrequency'];_0x5e2d23=_0x42a4b2[_0xedb1('0x116')];_0x493d2b[_0xedb1('0xd2')](_0x209af0)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x124')));if(_0x493d2b[_0xedb1('0x1bc')](0xb,_0xf626f,_0x42a4b2)&&!_0x5203ce){if(_0x209af0[_0xedb1('0xf6')]>=_0x42a4b2['dialAbandonedMaxRetry']){_0x493d2b['createStateFinal'](_0x209af0,_0x12c13a,_0x26a77d,_0xedb1('0x1c8'));}else{_0x493d2b[_0xedb1('0xf8')](_0x209af0,_0x12c13a,_0x26a77d,'reason\x2011\x20abandoned');}}break;case'20':_0x42a4b2[_0xedb1('0x1c9')]+=0x1;_0x209af0[_0xedb1('0xa9')]=0x14;_0x209af0['statedesc']=_0xedb1('0x1ca');_0x209af0[_0xedb1('0x102')]+=0x1;_0x209af0['countglobal']+=0x1;_0x27cc17=_0x42a4b2[_0xedb1('0x1b0')];_0x5e2d23=_0x42a4b2[_0xedb1('0x116')];ami[_0xedb1('0x4a')](_0xedb1('0x1cb'),ut[_0xedb1('0xec')](_0xf626f,'agentreject'));_0x493d2b[_0xedb1('0xd2')](_0x209af0)['catch'](loggerCatch(_0xedb1('0x1cc')));if(_0x493d2b['checkRetriveMax'](0x14,_0xf626f,_0x42a4b2)&&!_0x5203ce){if(_0x209af0[_0xedb1('0x102')]>=_0x42a4b2[_0xedb1('0x1af')]){_0x493d2b['createStateFinal'](_0x209af0,_0x12c13a,_0x26a77d,'reason\x2020\x20agentreject');}else{_0x493d2b['stateGlobal'](_0x209af0,_0x12c13a,_0x26a77d,'reason\x2020\x20agentreject');}}break;default:_0x42a4b2['outboundUnknownCallsDay']+=0x1;_0x209af0[_0xedb1('0xa9')]=0xc;_0x209af0['statedesc']=_0x416a13[_0xedb1('0x1b4')];_0x27cc17=_0x42a4b2[_0xedb1('0x1b0')];_0x5e2d23=_0x42a4b2[_0xedb1('0x116')];_0x493d2b['createHistory'](_0x209af0)[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x1cd')));if(_0x493d2b[_0xedb1('0x1bc')](_0x416a13[_0xedb1('0x1b4')],_0xf626f,_0x42a4b2)&&!_0x5203ce){if(_0x209af0[_0xedb1('0x1a1')]+_0x209af0[_0xedb1('0xf3')]+_0x209af0['countnoanswerretry']+_0x209af0[_0xedb1('0x1a2')]+_0x209af0[_0xedb1('0xf5')]+_0x209af0['countabandonedretry']+_0x209af0['countmachineretry']+_0x209af0['countagentrejectretry']>=_0x42a4b2[_0xedb1('0x1a3')]){_0x493d2b[_0xedb1('0xf8')](_0x209af0,_0x12c13a,_0x26a77d,_0x416a13[_0xedb1('0x1b4')]);}else{_0x493d2b[_0xedb1('0xf9')](_0x209af0,_0x12c13a,_0x26a77d,_0x416a13[_0xedb1('0x1b4')]);}}}})[_0xedb1('0xb9')](function(_0x318890){if(_0x5203ce){_0x493d2b['swapAdditionalPhones'](_0x209af0,_0x27cc17,_0x5e2d23)['then'](function(_0x119b7b){return _0x12c13a(0x1);});}});});};Dialer[_0xedb1('0x1b')][_0xedb1('0xf8')]=function(_0x4766da,_0x26e613,_0x19a5d2,_0x45158b){var _0x1b795a=new Final(_0x4766da);_0x1b795a['state']=0xf;_0x1b795a['statedesc']='Global';this[_0xedb1('0xf9')](_0x1b795a,_0x26e613,_0x19a5d2,_0x45158b);};Dialer[_0xedb1('0x1b')][_0xedb1('0xf9')]=function(_0x832890,_0x1f72c1,_0x41e75a,_0x81c7e9){this[_0xedb1('0xd0')](_0x832890)[_0xedb1('0xb9')](function(){return _0x1f72c1(msgResponse(_0xedb1('0x1b2'),'Success',_0x81c7e9));})[_0xedb1('0xbe')](function(){return _0x41e75a(msgResponse(_0xedb1('0x1ce'),'Failure',_0xedb1('0x1cf')));});};Dialer['prototype'][_0xedb1('0x15f')]=function(_0x50e6e6){var _0x470388=_0x50e6e6[_0xedb1('0x1d0')]/0x64;var _0x252e54=_0x50e6e6['outboundDropCallsDayTimeout']/(_0x50e6e6[_0xedb1('0x1d1')]+_0x50e6e6[_0xedb1('0x60')]);var _0x449d83=Math[_0xedb1('0x1d2')](_0x50e6e6['predictiveIntervalAvailable']*(_0x50e6e6[_0xedb1('0x1d3')]/0x64));var _0x27b898=Math[_0xedb1('0x1d2')](_0x50e6e6[_0xedb1('0x71')]*(_0x50e6e6[_0xedb1('0x1d4')]/0x64));var _0x339d8c=_0x50e6e6[_0xedb1('0x4f')]+_0x50e6e6[_0xedb1('0x54')];var _0xa0451d=Math[_0xedb1('0x1d5')](_0x50e6e6[_0xedb1('0x74')]*_0x50e6e6[_0xedb1('0x8c')]*_0x50e6e6[_0xedb1('0x6f')]*_0x50e6e6[_0xedb1('0x1d6')]);if(_[_0xedb1('0x39')](_0x50e6e6[_0xedb1('0x26')])){if(!_[_0xedb1('0x39')](_0x50e6e6[_0xedb1('0x25')])){_0x50e6e6[_0xedb1('0x25')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xedb1('0x39')](_0x50e6e6[_0xedb1('0x92')])){loggerPredictive[_0xedb1('0x98')](_0xedb1('0x1d7'),_0xedb1('0x1d8'));clearInterval(_0x50e6e6['handlePredictive']);_0x50e6e6['handlePredictive']=undefined;}_0x50e6e6[_0xedb1('0x26')]=moment()[_0xedb1('0x7b')](_0xedb1('0xfd'));loggerPredictive['info'](_0x50e6e6['name'],_0xedb1('0x1d9'),_0x50e6e6[_0xedb1('0x26')]);this['handlePower'](_0x50e6e6,0x1);}else if(ifInterval(_0x50e6e6[_0xedb1('0x1da')],_0x50e6e6[_0xedb1('0x26')])){this[_0xedb1('0x15c')](_0x50e6e6,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x50e6e6[_0xedb1('0x26')],_0x50e6e6[_0xedb1('0x3e')]);_0x50e6e6[_0xedb1('0x74')]=0x0;_0x50e6e6[_0xedb1('0x6e')]=0x0;}else if(_0x470388<_0x252e54&&_0x50e6e6[_0xedb1('0x1db')]===_0xedb1('0x1dc')){freeVariablesPredictive(_0x50e6e6);loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x1dd'),_0xedb1('0x1de'),_0x252e54,_0xedb1('0x26'),_0x50e6e6[_0xedb1('0x3e')]);}else if(_0xa0451d<_0x50e6e6[_0xedb1('0x6e')]&&_0x50e6e6[_0xedb1('0x1db')]==='dropRate'){freeVariablesPredictive(_0x50e6e6);loggerPredictive['info'](_0xedb1('0x1df'),'Max\x20Drop\x20',_0xa0451d,_0xedb1('0x1e0'),_0x50e6e6['predictiveIntervalErlangCallsDroppedCalls'],_0xedb1('0x26'),_0x50e6e6[_0xedb1('0x3e')]);}else if(!ifInterval(_0x50e6e6[_0xedb1('0x1da')],_0x50e6e6[_0xedb1('0x26')])&&_[_0xedb1('0x39')](_0x50e6e6[_0xedb1('0x25')])&&!_[_0xedb1('0x39')](_0x50e6e6[_0xedb1('0x26')])){_0x50e6e6[_0xedb1('0x25')]=moment()['format'](_0xedb1('0xfd'));loggerPredictive[_0xedb1('0x7e')](_0x50e6e6[_0xedb1('0x3e')],_0xedb1('0x1e1'),_0x50e6e6['startPredictive']);this['averageHandleTime'](_0x50e6e6[_0xedb1('0x1da')])[_0xedb1('0xb9')](this[_0xedb1('0x1e2')](_0x50e6e6))[_0xedb1('0xb9')](mergeDataErlangB(_0x50e6e6))['then'](this[_0xedb1('0x1e3')](_0x50e6e6))[_0xedb1('0xbe')](loggerCatchPredictive(_0xedb1('0x1e4'),_0x50e6e6));}else if(!ifInterval(_0x50e6e6[_0xedb1('0x1da')],_0x50e6e6[_0xedb1('0x25')])){_0x50e6e6['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x50e6e6[_0xedb1('0x25')]=moment()['format'](_0xedb1('0xfd'));loggerPredictive[_0xedb1('0x7e')](_0x50e6e6[_0xedb1('0x3e')],_0xedb1('0x1e5'),_0x50e6e6[_0xedb1('0x25')]);clearInterval(_0x50e6e6['handlePredictive']);_0x50e6e6[_0xedb1('0x92')]=undefined;this[_0xedb1('0xc3')](_0x50e6e6[_0xedb1('0x1da')])['then'](this[_0xedb1('0x1e2')](_0x50e6e6))['then'](mergeDataErlangB(_0x50e6e6))[_0xedb1('0xb9')](this[_0xedb1('0x1e3')](_0x50e6e6))['catch'](loggerCatchPredictive(_0xedb1('0x1e6'),_0x50e6e6));}else if(_0x50e6e6['predictiveIntervalAvailable']&&_0x339d8c<_0x50e6e6['predictiveIntervalAvailable']-_0x27b898){freeVariablesPredictive(_0x50e6e6);loggerPredictive[_0xedb1('0x7e')](_0x50e6e6[_0xedb1('0x3e')],_0xedb1('0x1e7'),_0x339d8c,_0xedb1('0x1e8'),_0x50e6e6[_0xedb1('0x71')],'-',_0x27b898,'=',_0x50e6e6[_0xedb1('0x71')]-_0x27b898,')');}else if(_0x50e6e6['predictiveIntervalAvailable']&&_0x339d8c>_0x50e6e6['predictiveIntervalAvailable']+_0x449d83){freeVariablesPredictive(_0x50e6e6);loggerPredictive[_0xedb1('0x7e')](_0x50e6e6[_0xedb1('0x3e')],_0xedb1('0x1e7'),_0x339d8c,_0xedb1('0x1e9'),_0x50e6e6[_0xedb1('0x71')],'+',_0x449d83,'=',_0x50e6e6['predictiveIntervalAvailable']+_0x449d83,')');}};Dialer[_0xedb1('0x1b')]['getDataPredictive']=function(_0xd4b905){var _0x48c377=this;return function(_0x222c79){return new BPromise(function(_0xe90226,_0x592497){_['merge'](_0xd4b905,_0x222c79[0x0]);if(checkGetDataPredictive(_0x222c79[0x0])){var _0x484463=_0xd4b905[_0xedb1('0x71')]=_0xd4b905[_0xedb1('0x54')]+_0xd4b905[_0xedb1('0x4f')];var _0x3c438c=_0xd4b905[_0xedb1('0x1da')]*0x3c;var _0x286529=_0x222c79[0x0]['predictiveIntervalAvgTalktime']+_0x222c79[0x0][_0xedb1('0x69')];var _0x415d8f=(_0x222c79[0x0][_0xedb1('0x82')]+_0x222c79[0x0][_0xedb1('0x6c')]+_0x222c79[0x0][_0xedb1('0x6b')])/_0x222c79[0x0]['predictiveIntervalTotalCalls'];_0xd4b905[_0xedb1('0x6f')]=_0x415d8f>0x0?_0x415d8f:0x1;switch(_0xd4b905[_0xedb1('0x1db')]){case _0xedb1('0x1dc'):var _0x4984d3=_0xd4b905[_0xedb1('0x1d0')]/0x64;return _0x48c377[_0xedb1('0x1ea')](_0x484463,_0x3c438c,_0x286529,_0x415d8f,_0x4984d3)[_0xedb1('0xb9')](function(_0x1da9f1){return _0xe90226(_0x1da9f1);});case _0xedb1('0x1eb'):var _0x154e2c=_0xd4b905[_0xedb1('0x1d0')]/0x64;return _0x48c377[_0xedb1('0x1ec')](_0x484463,_0x3c438c,_0x286529,_0x415d8f,_0x154e2c)['then'](function(_0x2cf440){return _0xe90226(_0x2cf440);});default:return _0x592497(msgResponse(_0xedb1('0x1ed'),_0xedb1('0x145'),_0xedb1('0x1ee')));}}else{return _0x592497(msgResponse(_0xedb1('0x1ed'),_0xedb1('0x145'),_0xedb1('0x1ef')));}});};};Dialer[_0xedb1('0x1b')]['getDataPredictiveOld']=function(_0x2c7207){var _0x212524=this;return function(_0x1b8f94){return new BPromise(function(_0xf27f96,_0x2d67f1){_[_0xedb1('0x8f')](_0x2c7207,_0x1b8f94[0x0]);if(checkGetDataPredictive(_0x1b8f94[0x0])){loggerPredictive['info'](JSON[_0xedb1('0x46')](_0x1b8f94[0x0]));if(_0x2c7207[_0xedb1('0x1db')]===_0xedb1('0x1dc')){return _0x212524[_0xedb1('0xce')](_0x2c7207['id'])[_0xedb1('0xb9')](function(_0x406745){var _0x38555d=_0x2c7207[_0xedb1('0x50')]-_0x406745[0x0][_0xedb1('0x1f0')];var _0x2ccc79=_0x2c7207[_0xedb1('0x1da')]*0x3c;var _0x5094c3=_0x1b8f94[0x0]['predictiveIntervalAvgTalktime']+_0x1b8f94[0x0][_0xedb1('0x69')];var _0x5e699b=(_0x1b8f94[0x0][_0xedb1('0x82')]+_0x1b8f94[0x0][_0xedb1('0x6c')]+_0x1b8f94[0x0][_0xedb1('0x6b')])/_0x1b8f94[0x0]['predictiveIntervalTotalCalls'];var _0x3a67ee=_0x2c7207['dialPredictiveOptimizationPercentage']/0x64;_0x2c7207['predictiveIntervalPauses']=_0x406745[0x0][_0xedb1('0x1f0')]||0x0;_0x2c7207[_0xedb1('0x6f')]=_0x5e699b>0x0?_0x5e699b:0x1;return _0x212524[_0xedb1('0x1ea')](_0x38555d,_0x2ccc79,_0x5094c3,_0x5e699b,_0x3a67ee);})[_0xedb1('0xb9')](function(_0x2ef303){return _0xf27f96(_0x2ef303);})[_0xedb1('0xbe')](function(_0x49bb8c){return _0x2d67f1(msgResponse(_0xedb1('0x1f1'),_0xedb1('0x145'),JSON[_0xedb1('0x46')](_0x49bb8c)));});}if(_0x2c7207[_0xedb1('0x1db')]==='agentBusyFactor'){return _0x212524[_0xedb1('0xce')](_0x2c7207['id'])[_0xedb1('0xb9')](function(_0x22de88){var _0x62096d=_0x2c7207['loggedIn']-_0x22de88[0x0][_0xedb1('0x1f0')];var _0x2f345b=_0x2c7207[_0xedb1('0x1da')]*0x3c;var _0x16678b=_0x1b8f94[0x0][_0xedb1('0x6a')]+_0x1b8f94[0x0]['predictiveIntervalAvgHoldtime'];var _0x1337f7=(_0x1b8f94[0x0][_0xedb1('0x82')]+_0x1b8f94[0x0][_0xedb1('0x6c')]+_0x1b8f94[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1b8f94[0x0][_0xedb1('0x72')];var _0x20c452=_0x2c7207[_0xedb1('0x1d0')]/0x64;_0x2c7207[_0xedb1('0x70')]=_0x22de88[0x0][_0xedb1('0x1f0')]||0x0;_0x2c7207[_0xedb1('0x6f')]=_0x1337f7>0x0?_0x1337f7:0x1;return _0x212524[_0xedb1('0x1ec')](_0x62096d,_0x2f345b,_0x16678b,_0x1337f7,_0x20c452);})[_0xedb1('0xb9')](function(_0x331a37){return _0xf27f96(_0x331a37);})[_0xedb1('0xbe')](function(_0x5b5d28){return _0x2d67f1(msgResponse(_0xedb1('0x1f1'),'Failure',JSON['stringify'](_0x5b5d28)));});}}else{return _0x2d67f1(msgResponse(_0xedb1('0x1ed'),_0xedb1('0x145'),_0xedb1('0x1ef')));}});};};Dialer[_0xedb1('0x1b')][_0xedb1('0x1e3')]=function(_0x49b75d){var _0xd7dbcc=this;return function(){var _0x5926da=0x0;var _0x238450=Math[_0xedb1('0x1d5')](_0x49b75d[_0xedb1('0x75')]*0x3e8);if(_0x238450>0x0){_0x238450=_0x238450<0x64?0x64:_0x238450;loggerPredictive[_0xedb1('0x7e')](_0x49b75d[_0xedb1('0x3e')],_0xedb1('0x1f2'),_0x238450,_0xedb1('0x47'));_0x49b75d[_0xedb1('0x92')]=setInterval(function(){_0xd7dbcc[_0xedb1('0x92')](_0x49b75d);loggerPredictiveCalls['info'](_0xedb1('0x1f3'),_0x5926da+=0x1);},_0x238450);}else{loggerPredictive['info'](_0x49b75d[_0xedb1('0x3e')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xedb1('0x1b')][_0xedb1('0x1f4')]=function(_0x1bccea,_0x4dfb73){var _0x18a7ba=this;return function(_0x96e9b6){if(_['isEmpty'](_0x96e9b6)){if(_[_0xedb1('0xb1')](_0x4dfb73[_0xedb1('0x1f5')])||!_0x4dfb73[_0xedb1('0x1f6')]){if(_0x1bccea[_0xedb1('0x5a')]===_0xedb1('0xb')){_0x1bccea[_0xedb1('0x12e')]=_[_0xedb1('0x39')](_0x1bccea['queueStatusComplete'])?!![]:_0x1bccea[_0xedb1('0x12e')];var _0x66a236=uuid['v4']();_0x18a7ba[_0xedb1('0x23')][_0x66a236]=new Action(_0x1bccea,_0x4dfb73,_0x66a236);loggerBooked[_0xedb1('0x7e')](_0xedb1('0x1f7'),_0x66a236,_0xedb1('0x1f8'),JSON[_0xedb1('0x46')](_0x1bccea[_0xedb1('0x12e')]),'Queue:\x20',_0x1bccea[_0xedb1('0x3e')]);if(_0x1bccea[_0xedb1('0x12e')]){_0x1bccea[_0xedb1('0x12e')]=![];_0x18a7ba[_0xedb1('0x28')][_0x18a7ba[_0xedb1('0x23')][_0x66a236][_0xedb1('0xb5')]]=[];ami[_0xedb1('0x14c')]({'actionid':_0x66a236,'action':_0xedb1('0x1f9'),'queue':_0x1bccea[_0xedb1('0x3e')]})['catch'](function(){_0x18a7ba[_0xedb1('0xb4')](_0x1bccea);_0x18a7ba['rescheduleContact']({'active':![],'ContactId':_0x18a7ba[_0xedb1('0x23')][_0x66a236][_0xedb1('0xd8')],'ListId':_0x18a7ba[_0xedb1('0x23')][_0x66a236][_0xedb1('0xd9')],'VoiceQueueId':_0x18a7ba['actions'][_0x66a236]['VoiceQueueId']||undefined,'CampaignId':_0x18a7ba[_0xedb1('0x23')][_0x66a236][_0xedb1('0xdb')]||undefined})['catch'](loggerCatch(_0xedb1('0x1fa')));delete _0x18a7ba[_0xedb1('0x23')][_0x66a236];});}else{loggerBooked[_0xedb1('0x7e')](_0xedb1('0x1fb'),JSON[_0xedb1('0x46')](_0x1bccea[_0xedb1('0x12e')]),'Queue:\x20',_0x1bccea[_0xedb1('0x3e')]);_0x18a7ba['updateOriginated'](_0x1bccea);_0x18a7ba['rescheduleContact']({'active':![],'ContactId':_0x18a7ba[_0xedb1('0x23')][_0x66a236][_0xedb1('0xd8')],'ListId':_0x18a7ba[_0xedb1('0x23')][_0x66a236][_0xedb1('0xd9')],'VoiceQueueId':_0x18a7ba[_0xedb1('0x23')][_0x66a236][_0xedb1('0xda')]||undefined,'CampaignId':_0x18a7ba['actions'][_0x66a236][_0xedb1('0xdb')]||undefined})[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x1fa')));delete _0x18a7ba['actions'][_0x66a236];}}else{return _0x18a7ba[_0xedb1('0x16d')](_0x1bccea,_0x4dfb73);}}else{if(getDiff(_0x4dfb73['scheduledat'])<_0x1bccea[_0xedb1('0x1fc')]*0x3c){if(_0x4dfb73[_0xedb1('0x1fd')]&&!_0x4dfb73[_0xedb1('0x1fd')][_0xedb1('0x1fe')]){_0x18a7ba[_0xedb1('0x94')][_0xedb1('0x131')](_0x4dfb73['id'])[_0xedb1('0x1d')](function(){_0x18a7ba['updateOriginated'](_0x1bccea);});}else{_0x18a7ba[_0xedb1('0xc8')]({'active':![]},_0x4dfb73['id'],0x1)['finally'](function(){_0x18a7ba['updateOriginated'](_0x1bccea);});}}else{_0x1bccea[_0xedb1('0x67')]+=0x1;_0x18a7ba['updateOriginated'](_0x1bccea);if(_0x1bccea[_0xedb1('0x1ff')]){_0x18a7ba[_0xedb1('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4dfb73[_0xedb1('0xd8')],'ListId':_0x4dfb73[_0xedb1('0xd9')],'VoiceQueueId':_0x4dfb73['VoiceQueueId']||undefined,'CampaignId':_0x4dfb73[_0xedb1('0xdb')]||undefined})['catch'](loggerCatch(_0xedb1('0x200')));_0x18a7ba[_0xedb1('0xd2')](createObjHistory(_0x1bccea,_0x4dfb73,_0xedb1('0x201'),0x17,'RecallInQueue'))[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x202')));}else{_0x18a7ba['saveInDb'](createObjHistory(_0x1bccea,_0x4dfb73,_0xedb1('0x203'),0x16,_0xedb1('0x204')),'[Originate][HistoryRecallClose][historyCatch]',_0xedb1('0x205'));}}}}else{_0x1bccea[_0xedb1('0x206')]+=0x1;_0x18a7ba[_0xedb1('0xee')](createObjHistory(_0x1bccea,_0x4dfb73,'BLACKLIST',0xd,'Blacklist'),_0xedb1('0x207'),_0xedb1('0x208'));throw'inBlackList';}};};Dialer['prototype']['handleIvr']=function(_0x2535e1){var _0x35810e=this;var _0x696125=_0x2535e1[_0xedb1('0x209')]-_0x2535e1[_0xedb1('0x73')]-_0x2535e1[_0xedb1('0xcb')];emitCampaignSummary(_0x2535e1);if(_0x696125>0x0){if(_0x696125>this[_0xedb1('0x20a')]){_0x696125=this[_0xedb1('0x20a')];}_0x2535e1[_0xedb1('0xcb')]+=_0x696125;this[_0xedb1('0xcd')](_0x2535e1['id'],_0x696125,_0x2535e1['dialOrderByScheduledAt'],_0x2535e1)['then'](function(_0x4307d4){_0x2535e1[_0xedb1('0xcb')]-=_0x696125;_0x2535e1['temp']=_0x2535e1[_0xedb1('0xcb')]>0x0?_0x2535e1[_0xedb1('0xcb')]:0x0;if(!checkContactEmpty(_0x4307d4)){_0x2535e1[_0xedb1('0x3a')]=_0xedb1('0xa1');logger['info'](_0xedb1('0x20b')+_0x2535e1[_0xedb1('0x3e')]);}else{_0x2535e1[_0xedb1('0x73')]+=_0x4307d4[_0xedb1('0x9b')];_0x2535e1[_0xedb1('0x3a')]='RUNNING';for(var _0x38e755=0x0;_0x38e755<_0x4307d4[_0xedb1('0x9b')];_0x38e755+=0x1){_0x2535e1['ivrTotalCallsDays']+=0x1;if(_[_0xedb1('0xb1')](_0x4307d4[_0x38e755])||_['isNil'](_0x4307d4[_0x38e755]['Contact'])||_['isNil'](_0x4307d4[_0x38e755][_0xedb1('0x171')])){_0x35810e['emptyContact'](_0xedb1('0x20c'),_0x2535e1,_0x4307d4[_0x38e755]);}else{_0x35810e[_0xedb1('0xc1')](_[_0xedb1('0xd7')](_0x4307d4[_0x38e755],[_0xedb1('0xdb'),_0xedb1('0x20d')]))[_0xedb1('0xb9')](_0x35810e[_0xedb1('0x1f4')](_0x2535e1,_0x4307d4[_0x38e755]))[_0xedb1('0xbe')](_0x35810e[_0xedb1('0xd5')](_0xedb1('0x20e'),_0x2535e1));}}}})['catch'](loggerGetContactDialer(_0xedb1('0x20f'),_0x2535e1,_0x696125));}};Dialer[_0xedb1('0x1b')][_0xedb1('0x15c')]=function(_0x37d53f,_0x53ab92){var _0x49855b=this;var _0x8a32f3=[];var _0x151185=_0x53ab92>=0x1?_0x53ab92:0x1;if(_0x37d53f[_0xedb1('0x5a')]===_0xedb1('0xb')){_0x151185=0x1;}var _0x7a9667=Math[_0xedb1('0x1d5')](_0x37d53f[_0xedb1('0x4f')]*_0x151185)-_0x37d53f[_0xedb1('0x73')]-_0x37d53f[_0xedb1('0xcb')];emitVoiceQueueSummary(_0x37d53f);if(_0x37d53f[_0xedb1('0x210')]>0x0){var _0x36d186=_0x37d53f[_0xedb1('0x210')]-_0x37d53f[_0xedb1('0x73')]-_0x37d53f['talking']-_0x37d53f['temp']-_0x37d53f[_0xedb1('0x51')];if(_0x7a9667>_0x36d186){_0x7a9667=_0x36d186;}}if(_0x7a9667>0x0){if(_0x37d53f[_0xedb1('0x5a')]===_0xedb1('0xb')){_0x7a9667=0x1;}if(_0x7a9667>this[_0xedb1('0x20a')]){_0x7a9667=this[_0xedb1('0x20a')];}_0x37d53f[_0xedb1('0xcb')]+=_0x7a9667;for(var _0x2ab809 in this['agents']){if(typeof this['agents'][_0x2ab809]!==_0xedb1('0x9c')){if(this[_0xedb1('0x21')][_0x2ab809]['state']===_0xedb1('0x211')&&this['agents'][_0x2ab809][_0xedb1('0xb2')]===_0xedb1('0xdf')){_0x8a32f3[_0xedb1('0x12c')](this[_0xedb1('0x21')][_0x2ab809]['id']);}}}this[_0xedb1('0xca')](_0x37d53f['id'],_0x8a32f3,_0x7a9667,_0x37d53f['dialOrderByScheduledAt'],_0x37d53f)[_0xedb1('0xb9')](function(_0x219d37){_0x37d53f[_0xedb1('0xcb')]-=_0x7a9667;_0x37d53f[_0xedb1('0xcb')]=_0x37d53f['temp']>0x0?_0x37d53f[_0xedb1('0xcb')]:0x0;if(!checkContactEmpty(_0x219d37)){_0x49855b[_0xedb1('0xb8')](_0x37d53f)[_0xedb1('0xb9')](sendMessageReschedule(_0x37d53f))[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x212')));}else{_0x37d53f[_0xedb1('0x73')]+=_0x219d37['length'];_0x37d53f['message']=_0x37d53f[_0xedb1('0x5a')]===_0xedb1('0xb')?_0xedb1('0x17b'):'RUNNING';for(var _0x565d8b=0x0;_0x565d8b<_0x219d37[_0xedb1('0x9b')];_0x565d8b+=0x1){if(_[_0xedb1('0xb1')](_0x219d37[_0x565d8b])||_['isNil'](_0x219d37[_0x565d8b][_0xedb1('0x18b')])||_[_0xedb1('0xb1')](_0x219d37[_0x565d8b][_0xedb1('0x171')])){_0x49855b[_0xedb1('0xd6')](_0xedb1('0x20c'),_0x37d53f,_0x219d37[_0x565d8b]);}else{_0x49855b[_0xedb1('0xba')](_[_0xedb1('0xd7')](_0x219d37[_0x565d8b],[_0xedb1('0xda'),_0xedb1('0x20d')]))[_0xedb1('0xb9')](_0x49855b[_0xedb1('0x1f4')](_0x37d53f,_0x219d37[_0x565d8b]))['catch'](_0x49855b[_0xedb1('0xd5')]('[actionOriginate]\x20',_0x37d53f));}}}})[_0xedb1('0xbe')](loggerGetContactDialer(_0xedb1('0x213'),_0x37d53f,_0x7a9667));}};Dialer[_0xedb1('0x1b')][_0xedb1('0x92')]=function(_0x5a3fd0){if(_0x5a3fd0['dialLimitQueue']>0x0){var _0x48076d=_0x5a3fd0[_0xedb1('0x210')]-_0x5a3fd0['originated']-_0x5a3fd0[_0xedb1('0x54')];if(_0x48076d>0x0){this[_0xedb1('0x214')](_0x5a3fd0);}else{loggerPredictiveCalls[_0xedb1('0x7e')](_0xedb1('0x215'));}}else{this[_0xedb1('0x214')](_0x5a3fd0);}};Dialer[_0xedb1('0x1b')][_0xedb1('0x214')]=function(_0x42e96a){var _0x5aa668=this;var _0x352e84=[];_0x42e96a[_0xedb1('0x73')]+=0x1;for(var _0x3c9686 in this[_0xedb1('0x21')]){if(typeof this[_0xedb1('0x21')][_0x3c9686]!==_0xedb1('0x9c')){if(this['agents'][_0x3c9686][_0xedb1('0xa9')]==='not_inuse'&&this[_0xedb1('0x21')][_0x3c9686][_0xedb1('0xb2')]===_0xedb1('0xdf')){_0x352e84['push'](this[_0xedb1('0x21')][_0x3c9686]['id']);}}}this[_0xedb1('0xca')](_0x42e96a['id'],_0x352e84,0x1,_0x42e96a[_0xedb1('0x216')],_0x42e96a)[_0xedb1('0xb9')](function(_0x199162){if(!checkContactEmpty(_0x199162)){checkContactLowerLimitOriginate(_0x42e96a,0x1,0x0);_0x5aa668[_0xedb1('0xb8')](_0x42e96a)['then'](sendMessageReschedule(_0x42e96a))[_0xedb1('0xbe')](loggerCatch(_0xedb1('0x212')));}else{_0x42e96a[_0xedb1('0x3a')]=_0xedb1('0x217');if(_[_0xedb1('0xb1')](_0x199162[0x0])||_[_0xedb1('0xb1')](_0x199162[0x0][_0xedb1('0x18b')])||_[_0xedb1('0xb1')](_0x199162[0x0]['phone'])){_0x5aa668['emptyContact'](_0xedb1('0x20c'),_0x42e96a,_0x199162[0x0]);}else{_0x5aa668[_0xedb1('0xba')](_[_0xedb1('0xd7')](_0x199162[0x0],[_0xedb1('0xda'),'Contact.phone']))['then'](_0x5aa668[_0xedb1('0x1f4')](_0x42e96a,_0x199162[0x0]))[_0xedb1('0xbe')](_0x5aa668['loggerHandler'](_0xedb1('0x218'),_0x42e96a));}}})[_0xedb1('0xbe')](loggerGetContactDialer(_0xedb1('0x219'),_0x42e96a,0x1));emitVoiceQueueSummary(_0x42e96a);};Dialer[_0xedb1('0x1b')][_0xedb1('0x1ea')]=function(_0x42a4d3,_0x4b4f40,_0x50172a,_0x51e1fa,_0x229c6c,_0x30404b){loggerPredictive['info'](_0xedb1('0x21a'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x42a4d3);loggerPredictive[_0xedb1('0x7e')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b4f40);loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x21b'),_0x50172a);loggerPredictive[_0xedb1('0x7e')]('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',_0x51e1fa);loggerPredictive[_0xedb1('0x7e')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x229c6c);loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x85'));return new BPromise(function(_0x4173e6,_0x35717d){if(_0x42a4d3<=0x0||isNaN(_0x42a4d3)){return _0x35717d(msgResponse(_0xedb1('0x21c'),_0xedb1('0x45'),_0xedb1('0x21d')+_0x42a4d3));}if(_0x50172a<=0x0||isNaN(_0x50172a)){return _0x35717d(msgResponse(_0xedb1('0x21c'),_0xedb1('0x45'),_0xedb1('0x21e')+_0x50172a));}if(_0x51e1fa<=0x0||isNaN(_0x51e1fa)){return _0x35717d(msgResponse(_0xedb1('0x21c'),_0xedb1('0x45'),_0xedb1('0x21f')+_0x51e1fa));}if(_0x4b4f40<=0x0||isNaN(_0x4b4f40)){return _0x35717d(msgResponse(_0xedb1('0x21c'),_0xedb1('0x45'),_0xedb1('0x220')+_0x4b4f40));}if(_0x229c6c<=0x0||isNaN(_0x229c6c)){return _0x35717d(msgResponse('[abandonmentRate]',_0xedb1('0x45'),'Amax\x20=\x20'+_0x229c6c));}_0x30404b=_0x30404b||0x0;var _0x5d39fd=0x1/_0x50172a;var _0x5554d5=0x0;var _0x2499f1=0x0;var _0x28c405=0x0;var _0x10b77c=0x0;for(var _0xb8975c=0x0;_0x28c405<_0x229c6c;_0xb8975c+=0x1){_0x2499f1=_0xb8975c/_0x4b4f40;_0x5554d5=(_0x51e1fa*_0x2499f1+_0x30404b)/_0x5d39fd;_0x28c405=erlangb(_0x5554d5,_0x42a4d3);_0x10b77c=_0x5554d5/_0x42a4d3*(0x1-erlangb(_0x5554d5,_0x42a4d3));}return _0x4173e6({'erlangCalls':_0xb8975c,'erlangCallToSecond':_0x4b4f40/_0xb8975c,'erlangAbandonmentRate':_0x28c405,'erlangBusyFactor':_0x10b77c});});};Dialer[_0xedb1('0x1b')][_0xedb1('0x1ec')]=function(_0x4cc5f9,_0x448539,_0x1299b8,_0x36b9c2,_0x15414f,_0xed2cc6){loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x221'));loggerPredictive['info'](_0xedb1('0x222'),_0x4cc5f9);loggerPredictive['info'](_0xedb1('0x223'),_0x448539);loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x21b'),_0x1299b8);loggerPredictive['info'](_0xedb1('0x224'),_0x36b9c2);loggerPredictive[_0xedb1('0x7e')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x15414f);loggerPredictive[_0xedb1('0x7e')](_0xedb1('0x85'));return new BPromise(function(_0x4ec5ef,_0x1b310d){if(_0x4cc5f9<=0x0||isNaN(_0x4cc5f9)){return _0x1b310d(msgResponse(_0xedb1('0x225'),_0xedb1('0x45'),_0xedb1('0x21d')+_0x4cc5f9));}if(_0x1299b8<=0x0||isNaN(_0x1299b8)){return _0x1b310d(msgResponse(_0xedb1('0x225'),_0xedb1('0x45'),_0xedb1('0x21e')+_0x1299b8));}if(_0x36b9c2<=0x0||isNaN(_0x36b9c2)){return _0x1b310d(msgResponse(_0xedb1('0x225'),_0xedb1('0x45'),_0xedb1('0x21f')+_0x36b9c2));}if(_0x448539<=0x0||isNaN(_0x448539)){return _0x1b310d(msgResponse(_0xedb1('0x225'),'Error',_0xedb1('0x220')+_0x448539));}if(_0x15414f<=0x0||isNaN(_0x15414f)){return _0x1b310d(msgResponse('[busyFactor]',_0xedb1('0x45'),'Umin\x20=\x20'+_0x15414f));}_0xed2cc6=_0xed2cc6||0x0;var _0x418670=0x1/_0x1299b8;var _0x4866e6=0x0;var _0x1b122e=0x0;var _0x35e64c=0x0;var _0x44cf78=0x0;for(var _0x2e67df=0x0;_0x44cf78<_0x15414f;_0x2e67df+=0x1){_0x1b122e=_0x2e67df/_0x448539;_0x4866e6=(_0x36b9c2*_0x1b122e+_0xed2cc6)/_0x418670;_0x35e64c=erlangb(_0x4866e6,_0x4cc5f9);_0x44cf78=_0x4866e6/_0x4cc5f9*(0x1-erlangb(_0x4866e6,_0x4cc5f9));}return _0x4ec5ef({'erlangCalls':_0x2e67df,'erlangCallToSecond':_0x448539/_0x2e67df,'erlangAbandonmentRate':_0x35e64c,'erlangBusyFactor':_0x44cf78});});};module[_0xedb1('0x226')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 14715c5..b491c89 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 _0xc466=['milliseconds','diff','seconds','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','talktime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment'];(function(_0x7d3f9a,_0x534e8b){var _0x14f5c2=function(_0x781350){while(--_0x781350){_0x7d3f9a['push'](_0x7d3f9a['shift']());}};_0x14f5c2(++_0x534e8b);}(_0xc466,0xca));var _0x6c46=function(_0xceb651,_0x19e6a1){_0xceb651=_0xceb651-0x0;var _0x4aab94=_0xc466[_0xceb651];return _0x4aab94;};'use strict';var util=require(_0x6c46('0x0'));var _=require(_0x6c46('0x1'));var moment=require(_0x6c46('0x2'));function getSeconds(_0x253a88,_0xa1e12b){var _0x2b626f=moment(_0x253a88)[_0x6c46('0x3')](0x0);var _0x18792f=moment(_0xa1e12b)[_0x6c46('0x3')](0x0);return _0x2b626f[_0x6c46('0x4')](_0x18792f,_0x6c46('0x5'));}function QueueCallerAbandon(_0x81ebd1,_0x560937){this[_0x6c46('0x6')]=_0x81ebd1[_0x6c46('0x6')];this['type']=_0x81ebd1[_0x6c46('0x7')];this[_0x6c46('0x8')]=_0x81ebd1['type']==='outbound'?'queue':_0x81ebd1[_0x6c46('0x7')];this[_0x6c46('0x9')]=_0x81ebd1[_0x6c46('0x9')];this['countcongestionretry']=_0x81ebd1[_0x6c46('0xa')];this[_0x6c46('0xb')]=_0x81ebd1[_0x6c46('0xb')];this['countglobal']=_0x81ebd1[_0x6c46('0x9')]+_0x81ebd1[_0x6c46('0xa')]+_0x81ebd1[_0x6c46('0xb')]+_0x81ebd1['countnosuchnumberretry']+_0x81ebd1[_0x6c46('0xc')]+_0x81ebd1[_0x6c46('0xd')]+_0x81ebd1[_0x6c46('0xe')]+_0x81ebd1['countagentrejectretry'];this[_0x6c46('0xf')]=_0x81ebd1[_0x6c46('0xf')];this[_0x6c46('0xc')]=_0x81ebd1[_0x6c46('0xc')];this['countabandonedretry']=_0x81ebd1[_0x6c46('0xd')];this[_0x6c46('0xe')]=_0x81ebd1[_0x6c46('0xe')];this[_0x6c46('0x10')]=_0x81ebd1['countagentrejectretry'];this[_0x6c46('0x11')]=_0x560937[_0x6c46('0x11')];this[_0x6c46('0x12')]=_0x81ebd1[_0x6c46('0x13')];this[_0x6c46('0x14')]=_0x81ebd1[_0x6c46('0x15')];this[_0x6c46('0x16')]=_0x81ebd1['starttime'];this[_0x6c46('0x17')]=_0x81ebd1[_0x6c46('0x17')];this['droptime']=_0x81ebd1[_0x6c46('0x18')];this['endtime']=this['droptime'];this['ringtime']=getSeconds(_0x81ebd1[_0x6c46('0x17')],_0x81ebd1[_0x6c46('0x16')]);this['holdtime']=getSeconds(this[_0x6c46('0x18')],_0x81ebd1['responsetime']);this[_0x6c46('0x19')]=0x0;this[_0x6c46('0x1a')]=_0x560937[_0x6c46('0x1a')];this['membername']=_0x560937[_0x6c46('0x1b')];this[_0x6c46('0x1c')]=_0x560937[_0x6c46('0x1c')];this[_0x6c46('0x1d')]=_0x81ebd1[_0x6c46('0x1d')];this[_0x6c46('0x1e')]=_0x81ebd1[_0x6c46('0x1e')];this[_0x6c46('0x1f')]=_0x81ebd1[_0x6c46('0x1f')];this[_0x6c46('0x20')]=_0x81ebd1[_0x6c46('0x20')];this[_0x6c46('0x21')]=_0x81ebd1['ContactId'];this[_0x6c46('0x22')]=_0x81ebd1[_0x6c46('0x22')];this[_0x6c46('0x23')]=_0x81ebd1[_0x6c46('0x23')];this[_0x6c46('0x24')]=_0x81ebd1[_0x6c46('0x24')];this[_0x6c46('0x25')]=_0x81ebd1['CampaignId'];this[_0x6c46('0x26')]=_0x81ebd1[_0x6c46('0x26')]||'';this['originatecalleridname']=_0x81ebd1[_0x6c46('0x27')]||'';}module[_0x6c46('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0xaea8=['responsetime','droptime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime'];(function(_0x297057,_0x11e912){var _0x42f8bb=function(_0x17c117){while(--_0x17c117){_0x297057['push'](_0x297057['shift']());}};_0x42f8bb(++_0x11e912);}(_0xaea8,0x152));var _0x8aea=function(_0x71288,_0x431f06){_0x71288=_0x71288-0x0;var _0x5b38ed=_0xaea8[_0x71288];return _0x5b38ed;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x8aea('0x0'));function getSeconds(_0x18dc2b,_0x340ed2){var _0x51ae0c=moment(_0x18dc2b)[_0x8aea('0x1')](0x0);var _0x203fcb=moment(_0x340ed2)[_0x8aea('0x1')](0x0);return _0x51ae0c[_0x8aea('0x2')](_0x203fcb,'seconds');}function QueueCallerAbandon(_0x329586,_0x36291a){this[_0x8aea('0x3')]=_0x329586[_0x8aea('0x3')];this['type']=_0x329586[_0x8aea('0x4')];this[_0x8aea('0x5')]=_0x329586[_0x8aea('0x4')]===_0x8aea('0x6')?'queue':_0x329586[_0x8aea('0x4')];this['countbusyretry']=_0x329586[_0x8aea('0x7')];this[_0x8aea('0x8')]=_0x329586['countcongestionretry'];this[_0x8aea('0x9')]=_0x329586[_0x8aea('0x9')];this[_0x8aea('0xa')]=_0x329586[_0x8aea('0x7')]+_0x329586[_0x8aea('0x8')]+_0x329586[_0x8aea('0x9')]+_0x329586[_0x8aea('0xb')]+_0x329586['countdropretry']+_0x329586[_0x8aea('0xc')]+_0x329586[_0x8aea('0xd')]+_0x329586[_0x8aea('0xe')];this['countnosuchnumberretry']=_0x329586[_0x8aea('0xb')];this[_0x8aea('0xf')]=_0x329586[_0x8aea('0xf')];this['countabandonedretry']=_0x329586[_0x8aea('0xc')];this[_0x8aea('0xd')]=_0x329586[_0x8aea('0xd')];this[_0x8aea('0xe')]=_0x329586[_0x8aea('0xe')];this['uniqueid']=_0x36291a[_0x8aea('0x10')];this[_0x8aea('0x11')]=_0x329586[_0x8aea('0x12')];this[_0x8aea('0x13')]=_0x329586[_0x8aea('0x14')];this[_0x8aea('0x15')]=_0x329586[_0x8aea('0x15')];this[_0x8aea('0x16')]=_0x329586[_0x8aea('0x16')];this[_0x8aea('0x17')]=_0x329586[_0x8aea('0x17')];this[_0x8aea('0x18')]=this['droptime'];this['ringtime']=getSeconds(_0x329586[_0x8aea('0x16')],_0x329586[_0x8aea('0x15')]);this['holdtime']=getSeconds(this[_0x8aea('0x17')],_0x329586[_0x8aea('0x16')]);this['talktime']=0x0;this[_0x8aea('0x19')]=_0x36291a[_0x8aea('0x19')];this[_0x8aea('0x1a')]=_0x36291a['connectedlinename'];this[_0x8aea('0x1b')]=_0x36291a[_0x8aea('0x1b')];this['callback']=_0x329586[_0x8aea('0x1c')];this[_0x8aea('0x1d')]=_0x329586[_0x8aea('0x1d')];this[_0x8aea('0x1e')]=_0x329586[_0x8aea('0x1e')];this[_0x8aea('0x1f')]=_0x329586[_0x8aea('0x1f')];this[_0x8aea('0x20')]=_0x329586[_0x8aea('0x20')];this[_0x8aea('0x21')]=_0x329586[_0x8aea('0x21')];this[_0x8aea('0x22')]=_0x329586[_0x8aea('0x22')];this['VoiceQueueId']=_0x329586[_0x8aea('0x23')];this[_0x8aea('0x24')]=_0x329586[_0x8aea('0x24')];this[_0x8aea('0x25')]=_0x329586['originatecalleridnum']||'';this[_0x8aea('0x26')]=_0x329586['originatecalleridname']||'';}module[_0x8aea('0x27')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index ff317e9..25d3157 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 _0x95c2=['AttachmentId','util','moment','uniqueid','channel','%s/%s/%s','Trunk','localstationid','headerinfo','path'];(function(_0x4e094d,_0xeb173b){var _0x514558=function(_0x2d038d){while(--_0x2d038d){_0x4e094d['push'](_0x4e094d['shift']());}};_0x514558(++_0xeb173b);}(_0x95c2,0x137));var _0x295c=function(_0x4ff160,_0x3be7f5){_0x4ff160=_0x4ff160-0x0;var _0x31b238=_0x95c2[_0x4ff160];return _0x31b238;};'use strict';var util=require(_0x295c('0x0'));var _=require('lodash');var moment=require(_0x295c('0x1'));function Action(_0x42984b,_0x53361b,_0x11c57f){this[_0x295c('0x2')]=_0x42984b||undefined;this[_0x295c('0x3')]=util['format'](_0x295c('0x4'),_0x53361b['tech'],_0x53361b[_0x295c('0x5')]['name'],_0x11c57f['fax']);this[_0x295c('0x6')]=_0x53361b[_0x295c('0x6')];this[_0x295c('0x7')]=_0x53361b['headerinfo'];this[_0x295c('0x8')]=_0x11c57f[_0x295c('0x8')];this['AttachmentId']=_0x11c57f[_0x295c('0x9')];}module['exports']=Action; \ No newline at end of file +var _0x4c6d=['path','AttachmentId','util','moment','uniqueid','format','%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo'];(function(_0xbb1170,_0xe8069c){var _0x1693f2=function(_0x502f08){while(--_0x502f08){_0xbb1170['push'](_0xbb1170['shift']());}};_0x1693f2(++_0xe8069c);}(_0x4c6d,0x6a));var _0xd4c6=function(_0x275fa7,_0x4085ea){_0x275fa7=_0x275fa7-0x0;var _0x30739f=_0x4c6d[_0x275fa7];return _0x30739f;};'use strict';var util=require(_0xd4c6('0x0'));var _=require('lodash');var moment=require(_0xd4c6('0x1'));function Action(_0x390353,_0x1bf5f2,_0x23e48b){this[_0xd4c6('0x2')]=_0x390353||undefined;this['channel']=util[_0xd4c6('0x3')](_0xd4c6('0x4'),_0x1bf5f2[_0xd4c6('0x5')],_0x1bf5f2[_0xd4c6('0x6')][_0xd4c6('0x7')],_0x23e48b[_0xd4c6('0x8')]);this[_0xd4c6('0x9')]=_0x1bf5f2['localstationid'];this['headerinfo']=_0x1bf5f2[_0xd4c6('0xa')];this[_0xd4c6('0xb')]=_0x23e48b['path'];this[_0xd4c6('0xc')]=_0x23e48b['AttachmentId'];}module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index f99c4c3..9657db9 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 _0x58a4=['pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','name','parse','application/pdf','then','notify','.pdf','catch','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','format','SIP/%s','reachable','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','newstate','syncNewState','bind','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','prototype','from-voip-provider','faxAccounts','hasOwnProperty','localstationid','uniqueid','channel','info','\x20syncNewchannel\x20','value','channelstate','channelstatedesc','variable','operation','status','filename','\x20syncFaxStatus\x20','remotestationid'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x58a4,0xbf));var _0x458a=function(_0x1a3243,_0x201872){_0x1a3243=_0x1a3243-0x0;var _0x33f2ca=_0x58a4[_0x1a3243];return _0x33f2ca;};'use strict';var util=require(_0x458a('0x0'));var _=require(_0x458a('0x1'));var BPromise=require(_0x458a('0x2'));var uuid=require(_0x458a('0x3'));var moment=require(_0x458a('0x4'));var path=require(_0x458a('0x5'));var tiff2pdf=require(_0x458a('0x6'));var gs=require(_0x458a('0x7'));var logger=require(_0x458a('0x8'))(_0x458a('0x9'));var ami=require(_0x458a('0xa'));var rpcDb=require(_0x458a('0xb'));var Channel=require(_0x458a('0xc'));var ut=require('./util/util');var Action=require('./action');var faxAccount=require(_0x458a('0xd'));var attachment=require(_0x458a('0xe'));var faxMessage=require(_0x458a('0xf'));function Fax(_0x1e658e){this[_0x458a('0x10')]={};this['faxAccounts']=_0x1e658e['faxAccounts'];this[_0x458a('0x11')]=_0x1e658e[_0x458a('0x11')];this[_0x458a('0x12')]={};ami['on'](_0x458a('0x13'),this[_0x458a('0x14')]['bind'](this));ami['on'](_0x458a('0x15'),this[_0x458a('0x16')]['bind'](this));ami['on'](_0x458a('0x17'),this[_0x458a('0x18')][_0x458a('0x19')](this));ami['on'](_0x458a('0x1a'),this[_0x458a('0x1b')]['bind'](this));ami['on']('faxstatus',this[_0x458a('0x1c')]['bind'](this));ami['on'](_0x458a('0x1d'),this[_0x458a('0x1e')][_0x458a('0x19')](this));ami['on'](_0x458a('0x1f'),this[_0x458a('0x20')][_0x458a('0x19')](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));}Fax[_0x458a('0x21')][_0x458a('0x14')]=function(_0x3558b9){if(_0x3558b9['context']===_0x458a('0x22')){for(var _0x260c87 in this[_0x458a('0x23')]){if(this[_0x458a('0x23')][_0x458a('0x24')](_0x260c87)){if(_0x3558b9['exten']===this['faxAccounts'][_0x260c87][_0x458a('0x25')]){this['channels'][_0x3558b9[_0x458a('0x26')]]={};this[_0x458a('0x10')][_0x3558b9['uniqueid']][_0x458a('0x27')]=_0x3558b9['channel'];this[_0x458a('0x10')][_0x3558b9[_0x458a('0x26')]]['id']=this['faxAccounts'][_0x260c87]['id'];this[_0x458a('0x10')][_0x3558b9[_0x458a('0x26')]]['name']=this[_0x458a('0x23')][_0x260c87]['name'];logger[_0x458a('0x28')](_0x3558b9['uniqueid'],_0x458a('0x29'));}}}}if(this['actions'][_0x3558b9[_0x458a('0x26')]]){this[_0x458a('0x10')][_0x3558b9[_0x458a('0x26')]]={};this[_0x458a('0x10')][_0x3558b9[_0x458a('0x26')]][_0x458a('0x27')]=_0x3558b9[_0x458a('0x27')];logger[_0x458a('0x28')](_0x3558b9[_0x458a('0x26')],_0x458a('0x29'));}};Fax[_0x458a('0x21')][_0x458a('0x16')]=function(_0x21ec38){if(this['channels'][_0x21ec38[_0x458a('0x26')]]){for(var _0x112fa6 in _0x21ec38['variable']){if(_0x21ec38['variable'][_0x458a('0x24')](_0x112fa6)){this['channels'][_0x21ec38[_0x458a('0x26')]][_0x112fa6]=_0x21ec38[_0x458a('0x2a')];}}}};Fax[_0x458a('0x21')]['syncNewState']=function(_0xa6fdf){if(this[_0x458a('0x10')][_0xa6fdf[_0x458a('0x26')]]){this['channels'][_0xa6fdf['uniqueid']][_0x458a('0x2b')]=_0xa6fdf['channelstate'];this[_0x458a('0x10')][_0xa6fdf['uniqueid']][_0x458a('0x2c')]=_0xa6fdf[_0x458a('0x2c')];}};Fax['prototype'][_0x458a('0x1b')]=function(_0x269f53){if(this[_0x458a('0x10')][_0x269f53['uniqueid']]){for(var _0x3371c3 in _0x269f53[_0x458a('0x2d')]){if(_0x269f53[_0x458a('0x2d')][_0x458a('0x24')](_0x3371c3)){this[_0x458a('0x10')][_0x269f53['uniqueid']][_0x3371c3]=_0x269f53[_0x458a('0x2a')];}}}};Fax[_0x458a('0x21')][_0x458a('0x1c')]=function(_0x22f02a){if(this[_0x458a('0x10')][_0x22f02a[_0x458a('0x26')]]){this['channels'][_0x22f02a[_0x458a('0x26')]][_0x458a('0x2e')]=_0x22f02a[_0x458a('0x2e')];this[_0x458a('0x10')][_0x22f02a[_0x458a('0x26')]][_0x458a('0x2f')]=_0x22f02a[_0x458a('0x2f')];this[_0x458a('0x10')][_0x22f02a[_0x458a('0x26')]]['localstationid']=_0x22f02a[_0x458a('0x25')];this[_0x458a('0x10')][_0x22f02a[_0x458a('0x26')]][_0x458a('0x30')]=_0x22f02a[_0x458a('0x30')];logger[_0x458a('0x28')](_0x22f02a[_0x458a('0x26')],_0x458a('0x31'));}};Fax[_0x458a('0x21')][_0x458a('0x1e')]=function(_0x1a4011){var _0x1aa28e=this;if(this[_0x458a('0x10')][_0x1a4011[_0x458a('0x26')]]){var _0x5d79cb=this['channels'][_0x1a4011[_0x458a('0x26')]]['id'];this[_0x458a('0x10')][_0x1a4011[_0x458a('0x26')]][_0x458a('0x32')]=_0x1a4011[_0x458a('0x32')];this[_0x458a('0x10')][_0x1a4011[_0x458a('0x26')]][_0x458a('0x33')]=_0x1a4011[_0x458a('0x33')];this[_0x458a('0x10')][_0x1a4011[_0x458a('0x26')]]['localstationid']=_0x1a4011[_0x458a('0x25')];this[_0x458a('0x10')][_0x1a4011['uniqueid']][_0x458a('0x34')]=_0x1a4011[_0x458a('0x34')];this[_0x458a('0x10')][_0x1a4011['uniqueid']][_0x458a('0x35')]=_0x1a4011[_0x458a('0x35')];this[_0x458a('0x10')][_0x1a4011[_0x458a('0x26')]][_0x458a('0x30')]=_0x1a4011[_0x458a('0x30')];this[_0x458a('0x10')][_0x1a4011[_0x458a('0x26')]]['calleridnum']=_0x1a4011[_0x458a('0x36')];if(this[_0x458a('0x10')][_0x1a4011[_0x458a('0x26')]]['pagestransferred']>0x0){tiff2pdf(_0x1a4011[_0x458a('0x30')],_0x458a('0x37'),function(_0x49d06e){logger[_0x458a('0x28')](_0x1a4011[_0x458a('0x26')],_0x458a('0x38'),_0x49d06e[_0x458a('0x39')]);attachment[_0x458a('0x3a')]({'name':path['parse'](_0x1a4011['filename'])[_0x458a('0x3b')],'basename':path[_0x458a('0x3c')](_0x1a4011[_0x458a('0x30')])[_0x458a('0x3b')]+'.pdf','type':_0x458a('0x3d')})[_0x458a('0x3e')](function(_0x5237b9){faxAccount[_0x458a('0x3f')](_0x5d79cb,{'from':_0x1a4011['calleridnum'],'mapKey':_0x458a('0x9'),'body':path[_0x458a('0x3c')](_0x1a4011[_0x458a('0x30')])['name']+_0x458a('0x40'),'AttachmentId':_0x5237b9['id']})[_0x458a('0x41')](function(_0x36ea19){logger['error'](_0x1a4011['uniqueid'],_0x458a('0x42'),JSON[_0x458a('0x43')](_0x36ea19));});})[_0x458a('0x41')](function(_0x4dea55){logger['error'](_0x1a4011[_0x458a('0x26')],_0x458a('0x44'),JSON[_0x458a('0x43')](_0x4dea55));});});}logger[_0x458a('0x28')](_0x1a4011[_0x458a('0x26')],_0x458a('0x44'));}};Fax[_0x458a('0x21')][_0x458a('0x45')]=function(_0xb22232){if(this[_0x458a('0x12')][_0xb22232[_0x458a('0x26')]]){_[_0x458a('0x46')](this[_0x458a('0x10')][_0xb22232[_0x458a('0x26')]],_[_0x458a('0x47')](_0xb22232,[_0x458a('0x48'),'reason']));}};function updateStatus(_0x1c270b){if(_0x1c270b[_0x458a('0x49')]){faxMessage[_0x458a('0x4a')](_0x1c270b[_0x458a('0x49')],{'failMessage':_0x458a('0x4b')})['then'](function(_0x4b5093){ut['logger'](_0x458a('0x4c'),_0x4b5093);})['catch'](function(_0x236d2f){ut[_0x458a('0x4d')](_0x458a('0x4e'),_0x236d2f);});}else{ut[_0x458a('0x4d')](_0x458a('0x4f'));}}Fax['prototype']['updateStatus']=function(_0x3d7616,_0x2d8b77,_0x2587a1){var _0x8ff0dd=this;var _0x2d67b1={};if(_0x2d8b77){_0x2d67b1={'read':_0x2d8b77};}else{_0x2d67b1={'failMessage':_0x2587a1};}if(this['actions'][_0x3d7616][_0x458a('0x49')]){faxMessage['update'](this[_0x458a('0x12')][_0x3d7616]['AttachmentId'],_0x2d67b1)[_0x458a('0x3e')](function(_0x59ae40){ut['logger']('[Fax][Message][Updated]',_0x59ae40);})[_0x458a('0x41')](function(_0x3eb267){ut['logger'](_0x458a('0x50'),_0x3eb267);})[_0x458a('0x51')](function(){delete _0x8ff0dd[_0x458a('0x10')][_0x3d7616];delete _0x8ff0dd['actions'][_0x3d7616];});}else{ut[_0x458a('0x4d')](_0x458a('0x52'));delete this[_0x458a('0x10')][_0x3d7616];delete this[_0x458a('0x12')][_0x3d7616];}};Fax[_0x458a('0x21')][_0x458a('0x20')]=function(_0x597e74){var _0x15200c=this;if(this[_0x458a('0x10')][_0x597e74[_0x458a('0x26')]]){if(this[_0x458a('0x12')][_0x597e74[_0x458a('0x26')]]){this[_0x458a('0x10')][_0x597e74[_0x458a('0x26')]]['id']=this[_0x458a('0x12')][_0x597e74['uniqueid']]['id'];this[_0x458a('0x10')][_0x597e74['uniqueid']][_0x458a('0x3b')]=this[_0x458a('0x12')][_0x597e74[_0x458a('0x26')]][_0x458a('0x3b')];}logger['info'](_0x597e74['uniqueid'],this[_0x458a('0x12')][_0x597e74[_0x458a('0x26')]]?_0x458a('0x53'):_0x458a('0x54'),JSON[_0x458a('0x43')](this[_0x458a('0x10')][_0x597e74['uniqueid']]));if(this[_0x458a('0x12')][_0x597e74[_0x458a('0x26')]]){if(this['channels'][_0x597e74[_0x458a('0x26')]]['faxpages']>0x0&&this[_0x458a('0x10')][_0x597e74[_0x458a('0x26')]][_0x458a('0x55')]===_0x458a('0x56')){this[_0x458a('0x57')](_0x597e74[_0x458a('0x26')],!![]);}else{this[_0x458a('0x57')](_0x597e74[_0x458a('0x26')],![],this['channels'][_0x597e74[_0x458a('0x26')]][_0x458a('0x58')]?'SENDING\x20FAILED:\x20'+this[_0x458a('0x10')][_0x597e74[_0x458a('0x26')]]['faxstatusstring']:_0x458a('0x59'));}}}};Fax[_0x458a('0x21')]['send']=function(_0x17b611){var _0x180df0=this;return new BPromise(function(_0x582ff7,_0x16f82f){_0x180df0[_0x458a('0x5a')](_0x17b611,_0x180df0[_0x458a('0x23')][_0x17b611[_0x458a('0x5b')]])[_0x458a('0x3e')](function(_0x27d1f2){ut[_0x458a('0x4d')](_0x458a('0x5c'),_0x27d1f2);_0x582ff7(ut['message'](_0x458a('0x5d')));})[_0x458a('0x41')](function(_0x29b11e){ut[_0x458a('0x4d')](_0x458a('0x5e'),_0x29b11e);updateStatus(_0x17b611);_0x16f82f(ut[_0x458a('0x39')](_0x458a('0x5f')));});});};Fax[_0x458a('0x21')][_0x458a('0x60')]=function(_0xfe46ae){var _0x546519=this;return new BPromise(function(_0x3837b7,_0x527c09){var _0x53fcf4=_0x546519[_0x458a('0x61')](_0x546519[_0x458a('0x23')][_0xfe46ae[_0x458a('0x5b')]][_0x458a('0x62')],_0xfe46ae);if(_0x53fcf4[_0x458a('0x63')]){_0x3837b7(ut[_0x458a('0x39')](_0x458a('0x64')));}else{_0x527c09(ut[_0x458a('0x39')](_0x53fcf4[_0x458a('0x39')]));}});};function originate(_0x31074e,_0x448cbc,_0x11bbba){return new BPromise(function(_0x435884,_0x3948aa){if(_0x11bbba){var _0x2c131b=util['format'](_0x458a('0x65'),path['parse'](_0x31074e[_0x458a('0x5')])[_0x458a('0x3b')],_0x31074e['path']);gs[_0x458a('0x66')](_0x2c131b)[_0x458a('0x3e')](function(){_0x31074e[_0x458a('0x5')]=util['format'](_0x458a('0x67'),path[_0x458a('0x3c')](_0x31074e[_0x458a('0x5')])[_0x458a('0x68')],path[_0x458a('0x3c')](_0x31074e[_0x458a('0x5')])['name']);_0x448cbc[_0x458a('0x69')]=_0x31074e['path'];ut['logger'](_0x458a('0x6a'),'');ami[_0x458a('0x6b')](ut[_0x458a('0x6c')](_0x31074e,_0x448cbc))[_0x458a('0x3e')](function(_0xaf6262){_0x435884(_0xaf6262);})[_0x458a('0x41')](function(_0x42eae7){_0x3948aa(_0x42eae7);});})[_0x458a('0x41')](function(_0x3d30e2){_0x3948aa(_0x3d30e2);});}else{ami[_0x458a('0x6b')](ut[_0x458a('0x6c')](_0x31074e,_0x448cbc))[_0x458a('0x3e')](function(_0x14231a){_0x435884(_0x14231a);})[_0x458a('0x41')](function(_0x486687){_0x3948aa(_0x486687);});}});}Fax['prototype']['execOriginate']=function(_0x2cdde0,_0x5c6a8d){var _0x4358d2=this;return new BPromise(function(_0x4db3ab,_0x46ef02){var _0x3d73d1=uuid['v4']();var _0x259e54=ut[_0x458a('0x6d')](_0x2cdde0,_0x5c6a8d);_0x4358d2[_0x458a('0x12')][_0x3d73d1]=new Action(_0x3d73d1,_0x5c6a8d,_0x2cdde0);var _0x49f3ee=_0x4358d2[_0x458a('0x12')][_0x3d73d1];if(path[_0x458a('0x3c')](_0x2cdde0['path'])[_0x458a('0x6e')]==='.pdf'){originate(_0x49f3ee,_0x259e54,!![])[_0x458a('0x3e')](function(_0x58d29d){_0x4db3ab(_0x58d29d);})[_0x458a('0x41')](function(_0x177457){_0x46ef02(_0x177457);});}else{originate(_0x49f3ee,_0x259e54,![])[_0x458a('0x3e')](function(_0x1fe8a1){_0x4db3ab(_0x1fe8a1);})['catch'](function(_0x191872){_0x46ef02(_0x191872);});}});};Fax[_0x458a('0x21')][_0x458a('0x6f')]=function(_0x239e2f){return!_[_0x458a('0x70')](_0x239e2f)&&!_[_0x458a('0x70')](_0x239e2f[_0x458a('0x3b')])&&!_[_0x458a('0x70')](_0x239e2f['active'])&&_0x239e2f[_0x458a('0x71')]&&!_[_0x458a('0x70')](this[_0x458a('0x11')][util[_0x458a('0x72')]('SIP/%s',_0x239e2f[_0x458a('0x3b')])])&&!_[_0x458a('0x70')](this['trunks'][util[_0x458a('0x72')](_0x458a('0x73'),_0x239e2f[_0x458a('0x3b')])][_0x458a('0x2f')])&&(this[_0x458a('0x11')][util['format'](_0x458a('0x73'),_0x239e2f[_0x458a('0x3b')])][_0x458a('0x2f')]===_0x458a('0x74')||this[_0x458a('0x11')][util[_0x458a('0x72')](_0x458a('0x73'),_0x239e2f['name'])][_0x458a('0x2f')]==='unmonitored');};Fax[_0x458a('0x21')][_0x458a('0x61')]=function(_0x1fa730,_0x4e2a65){if(!this[_0x458a('0x6f')](_0x1fa730)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x458a('0x70')](_0x1fa730)?'':_0x1fa730[_0x458a('0x3b')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x458a('0x70')](_0x4e2a65[_0x458a('0x9')])){ut[_0x458a('0x4d')](_0x458a('0x75'),JSON[_0x458a('0x43')](_0x4e2a65));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x458a('0x70')](_0x4e2a65['path'])){ut[_0x458a('0x4d')](_0x458a('0x76'),JSON[_0x458a('0x43')](_0x4e2a65));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x458a('0x77')};};module[_0x458a('0x78')]=Fax; \ No newline at end of file +var _0xb200=['merge','pick','response','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][failure]','Fax\x20failed','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','path','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Is\x20Valid','util','moment','./util/gs','../../../config/logger','fax','./rpcDb','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','newchannel','syncNewchannel','syncVarSet','bind','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','prototype','context','hasOwnProperty','channels','uniqueid','channel','name','\x20syncNewchannel\x20','actions','info','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','notify','\x20notify\x20','stringify','catch','error','\x20receiveFax\x20','syncOriginateResponse'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0xb200,0x180));var _0x0b20=function(_0x291b8f,_0x3b8484){_0x291b8f=_0x291b8f-0x0;var _0x3b504b=_0xb200[_0x291b8f];return _0x3b504b;};'use strict';var util=require(_0x0b20('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x0b20('0x1'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require(_0x0b20('0x2'));var logger=require(_0x0b20('0x3'))(_0x0b20('0x4'));var ami=require('../ami');var rpcDb=require(_0x0b20('0x5'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x0b20('0x6'));var faxAccount=require(_0x0b20('0x7'));var attachment=require(_0x0b20('0x8'));var faxMessage=require(_0x0b20('0x9'));function Fax(_0x3c2296){this['channels']={};this[_0x0b20('0xa')]=_0x3c2296[_0x0b20('0xa')];this['trunks']=_0x3c2296[_0x0b20('0xb')];this['actions']={};ami['on'](_0x0b20('0xc'),this[_0x0b20('0xd')]['bind'](this));ami['on']('varset',this[_0x0b20('0xe')][_0x0b20('0xf')](this));ami['on']('newstate',this[_0x0b20('0x10')][_0x0b20('0xf')](this));ami['on']('newexten',this[_0x0b20('0x11')][_0x0b20('0xf')](this));ami['on'](_0x0b20('0x12'),this[_0x0b20('0x13')][_0x0b20('0xf')](this));ami['on'](_0x0b20('0x14'),this[_0x0b20('0x15')][_0x0b20('0xf')](this));ami['on']('hangup',this[_0x0b20('0x16')][_0x0b20('0xf')](this));ami['on'](_0x0b20('0x17'),this['syncOriginateResponse'][_0x0b20('0xf')](this));}Fax[_0x0b20('0x18')]['syncNewchannel']=function(_0x3d8be9){if(_0x3d8be9[_0x0b20('0x19')]==='from-voip-provider'){for(var _0x574f2b in this[_0x0b20('0xa')]){if(this[_0x0b20('0xa')][_0x0b20('0x1a')](_0x574f2b)){if(_0x3d8be9['exten']===this[_0x0b20('0xa')][_0x574f2b]['localstationid']){this[_0x0b20('0x1b')][_0x3d8be9[_0x0b20('0x1c')]]={};this['channels'][_0x3d8be9[_0x0b20('0x1c')]][_0x0b20('0x1d')]=_0x3d8be9[_0x0b20('0x1d')];this[_0x0b20('0x1b')][_0x3d8be9['uniqueid']]['id']=this[_0x0b20('0xa')][_0x574f2b]['id'];this[_0x0b20('0x1b')][_0x3d8be9[_0x0b20('0x1c')]][_0x0b20('0x1e')]=this[_0x0b20('0xa')][_0x574f2b]['name'];logger['info'](_0x3d8be9[_0x0b20('0x1c')],_0x0b20('0x1f'));}}}}if(this[_0x0b20('0x20')][_0x3d8be9[_0x0b20('0x1c')]]){this[_0x0b20('0x1b')][_0x3d8be9[_0x0b20('0x1c')]]={};this[_0x0b20('0x1b')][_0x3d8be9['uniqueid']][_0x0b20('0x1d')]=_0x3d8be9[_0x0b20('0x1d')];logger[_0x0b20('0x21')](_0x3d8be9[_0x0b20('0x1c')],_0x0b20('0x1f'));}};Fax['prototype'][_0x0b20('0xe')]=function(_0x3c3b9e){if(this[_0x0b20('0x1b')][_0x3c3b9e[_0x0b20('0x1c')]]){for(var _0x5ac2c1 in _0x3c3b9e[_0x0b20('0x22')]){if(_0x3c3b9e['variable'][_0x0b20('0x1a')](_0x5ac2c1)){this['channels'][_0x3c3b9e[_0x0b20('0x1c')]][_0x5ac2c1]=_0x3c3b9e[_0x0b20('0x23')];}}}};Fax['prototype'][_0x0b20('0x10')]=function(_0x179ff5){if(this[_0x0b20('0x1b')][_0x179ff5[_0x0b20('0x1c')]]){this['channels'][_0x179ff5[_0x0b20('0x1c')]]['channelstate']=_0x179ff5[_0x0b20('0x24')];this[_0x0b20('0x1b')][_0x179ff5[_0x0b20('0x1c')]][_0x0b20('0x25')]=_0x179ff5['channelstatedesc'];}};Fax['prototype'][_0x0b20('0x11')]=function(_0x19d707){if(this[_0x0b20('0x1b')][_0x19d707['uniqueid']]){for(var _0x1c5d8e in _0x19d707['variable']){if(_0x19d707[_0x0b20('0x22')][_0x0b20('0x1a')](_0x1c5d8e)){this['channels'][_0x19d707[_0x0b20('0x1c')]][_0x1c5d8e]=_0x19d707[_0x0b20('0x23')];}}}};Fax[_0x0b20('0x18')][_0x0b20('0x13')]=function(_0x269690){if(this['channels'][_0x269690[_0x0b20('0x1c')]]){this[_0x0b20('0x1b')][_0x269690['uniqueid']]['operation']=_0x269690[_0x0b20('0x26')];this[_0x0b20('0x1b')][_0x269690[_0x0b20('0x1c')]][_0x0b20('0x27')]=_0x269690[_0x0b20('0x27')];this[_0x0b20('0x1b')][_0x269690[_0x0b20('0x1c')]][_0x0b20('0x28')]=_0x269690['localstationid'];this[_0x0b20('0x1b')][_0x269690['uniqueid']][_0x0b20('0x29')]=_0x269690[_0x0b20('0x29')];logger[_0x0b20('0x21')](_0x269690[_0x0b20('0x1c')],_0x0b20('0x2a'));}};Fax['prototype'][_0x0b20('0x15')]=function(_0x4012e1){var _0x487f17=this;if(this[_0x0b20('0x1b')][_0x4012e1[_0x0b20('0x1c')]]){var _0x2ddf5f=this[_0x0b20('0x1b')][_0x4012e1[_0x0b20('0x1c')]]['id'];this[_0x0b20('0x1b')][_0x4012e1[_0x0b20('0x1c')]][_0x0b20('0x2b')]=_0x4012e1[_0x0b20('0x2b')];this[_0x0b20('0x1b')][_0x4012e1[_0x0b20('0x1c')]][_0x0b20('0x2c')]=_0x4012e1[_0x0b20('0x2c')];this[_0x0b20('0x1b')][_0x4012e1[_0x0b20('0x1c')]][_0x0b20('0x28')]=_0x4012e1[_0x0b20('0x28')];this[_0x0b20('0x1b')][_0x4012e1[_0x0b20('0x1c')]][_0x0b20('0x2d')]=_0x4012e1[_0x0b20('0x2d')];this[_0x0b20('0x1b')][_0x4012e1[_0x0b20('0x1c')]][_0x0b20('0x2e')]=_0x4012e1['transferrate'];this[_0x0b20('0x1b')][_0x4012e1[_0x0b20('0x1c')]][_0x0b20('0x29')]=_0x4012e1['filename'];this[_0x0b20('0x1b')][_0x4012e1[_0x0b20('0x1c')]][_0x0b20('0x2f')]=_0x4012e1[_0x0b20('0x2f')];if(this[_0x0b20('0x1b')][_0x4012e1[_0x0b20('0x1c')]][_0x0b20('0x2c')]>0x0){tiff2pdf(_0x4012e1[_0x0b20('0x29')],'/var/opt/motion2/server/files/attachments/',function(_0x587a96){logger[_0x0b20('0x21')](_0x4012e1[_0x0b20('0x1c')],_0x0b20('0x30'),_0x587a96[_0x0b20('0x31')]);attachment[_0x0b20('0x32')]({'name':path[_0x0b20('0x33')](_0x4012e1[_0x0b20('0x29')])[_0x0b20('0x1e')],'basename':path[_0x0b20('0x33')](_0x4012e1[_0x0b20('0x29')])[_0x0b20('0x1e')]+_0x0b20('0x34'),'type':'application/pdf'})['then'](function(_0x4a500a){faxAccount[_0x0b20('0x35')](_0x2ddf5f,{'from':_0x4012e1[_0x0b20('0x2f')],'mapKey':_0x0b20('0x4'),'body':path['parse'](_0x4012e1[_0x0b20('0x29')])[_0x0b20('0x1e')]+_0x0b20('0x34'),'AttachmentId':_0x4a500a['id']})['catch'](function(_0xb5bc61){logger['error'](_0x4012e1['uniqueid'],_0x0b20('0x36'),JSON[_0x0b20('0x37')](_0xb5bc61));});})[_0x0b20('0x38')](function(_0x10bbb7){logger[_0x0b20('0x39')](_0x4012e1[_0x0b20('0x1c')],_0x0b20('0x3a'),JSON[_0x0b20('0x37')](_0x10bbb7));});});}logger[_0x0b20('0x21')](_0x4012e1[_0x0b20('0x1c')],_0x0b20('0x3a'));}};Fax['prototype'][_0x0b20('0x3b')]=function(_0x30b41e){if(this[_0x0b20('0x20')][_0x30b41e[_0x0b20('0x1c')]]){_[_0x0b20('0x3c')](this[_0x0b20('0x1b')][_0x30b41e[_0x0b20('0x1c')]],_[_0x0b20('0x3d')](_0x30b41e,[_0x0b20('0x3e'),'reason']));}};function updateStatus(_0x165f21){if(_0x165f21[_0x0b20('0x3f')]){faxMessage['update'](_0x165f21[_0x0b20('0x3f')],{'failMessage':_0x0b20('0x40')})[_0x0b20('0x41')](function(_0x20a9c9){ut[_0x0b20('0x42')]('[Fax][Message][Error][Updated]',_0x20a9c9);})['catch'](function(_0x9142f4){ut[_0x0b20('0x42')]('[Fax][Message][Error][NoUpdate1]',_0x9142f4);});}else{ut[_0x0b20('0x42')](_0x0b20('0x43'));}}Fax[_0x0b20('0x18')][_0x0b20('0x44')]=function(_0x2c5986,_0xfaa23f,_0x264a35){var _0x2ece1b=this;var _0x2a4f1e={};if(_0xfaa23f){_0x2a4f1e={'read':_0xfaa23f};}else{_0x2a4f1e={'failMessage':_0x264a35};}if(this[_0x0b20('0x20')][_0x2c5986][_0x0b20('0x3f')]){faxMessage[_0x0b20('0x45')](this['actions'][_0x2c5986][_0x0b20('0x3f')],_0x2a4f1e)[_0x0b20('0x41')](function(_0x1fadd4){ut[_0x0b20('0x42')](_0x0b20('0x46'),_0x1fadd4);})[_0x0b20('0x38')](function(_0x483b33){ut[_0x0b20('0x42')](_0x0b20('0x47'),_0x483b33);})['finally'](function(){delete _0x2ece1b[_0x0b20('0x1b')][_0x2c5986];delete _0x2ece1b[_0x0b20('0x20')][_0x2c5986];});}else{ut[_0x0b20('0x42')](_0x0b20('0x48'));delete this[_0x0b20('0x1b')][_0x2c5986];delete this[_0x0b20('0x20')][_0x2c5986];}};Fax[_0x0b20('0x18')][_0x0b20('0x16')]=function(_0x105cc9){var _0x5991cb=this;if(this[_0x0b20('0x1b')][_0x105cc9[_0x0b20('0x1c')]]){if(this[_0x0b20('0x20')][_0x105cc9[_0x0b20('0x1c')]]){this['channels'][_0x105cc9[_0x0b20('0x1c')]]['id']=this[_0x0b20('0x20')][_0x105cc9[_0x0b20('0x1c')]]['id'];this[_0x0b20('0x1b')][_0x105cc9[_0x0b20('0x1c')]][_0x0b20('0x1e')]=this[_0x0b20('0x20')][_0x105cc9['uniqueid']][_0x0b20('0x1e')];}logger[_0x0b20('0x21')](_0x105cc9[_0x0b20('0x1c')],this[_0x0b20('0x20')][_0x105cc9[_0x0b20('0x1c')]]?_0x0b20('0x49'):_0x0b20('0x4a'),JSON[_0x0b20('0x37')](this[_0x0b20('0x1b')][_0x105cc9['uniqueid']]));if(this[_0x0b20('0x20')][_0x105cc9[_0x0b20('0x1c')]]){if(this[_0x0b20('0x1b')][_0x105cc9[_0x0b20('0x1c')]][_0x0b20('0x4b')]>0x0&&this[_0x0b20('0x1b')][_0x105cc9[_0x0b20('0x1c')]][_0x0b20('0x12')]===_0x0b20('0x4c')){this[_0x0b20('0x44')](_0x105cc9['uniqueid'],!![]);}else{this[_0x0b20('0x44')](_0x105cc9[_0x0b20('0x1c')],![],this[_0x0b20('0x1b')][_0x105cc9[_0x0b20('0x1c')]][_0x0b20('0x4d')]?_0x0b20('0x4e')+this['channels'][_0x105cc9[_0x0b20('0x1c')]][_0x0b20('0x4d')]:_0x0b20('0x4f'));}}}};Fax['prototype'][_0x0b20('0x50')]=function(_0x50948b){var _0x30aa1b=this;return new BPromise(function(_0x481498,_0x476852){_0x30aa1b[_0x0b20('0x51')](_0x50948b,_0x30aa1b[_0x0b20('0xa')][_0x50948b['FaxAccountId']])[_0x0b20('0x41')](function(_0x10592d){ut['logger']('[Fax][execOriginate][success]',_0x10592d);_0x481498(ut[_0x0b20('0x31')]('Fax\x20received'));})[_0x0b20('0x38')](function(_0x153d32){ut['logger'](_0x0b20('0x52'),_0x153d32);updateStatus(_0x50948b);_0x476852(ut[_0x0b20('0x31')](_0x0b20('0x53')));});});};Fax['prototype']['checkAfterSend']=function(_0x570a59){var _0x4b0abe=this;return new BPromise(function(_0x2bf564,_0x338698){var _0x4eba58=_0x4b0abe[_0x0b20('0x54')](_0x4b0abe[_0x0b20('0xa')][_0x570a59[_0x0b20('0x55')]][_0x0b20('0x56')],_0x570a59);if(_0x4eba58['isValid']){_0x2bf564(ut[_0x0b20('0x31')](_0x0b20('0x57')));}else{_0x338698(ut['message'](_0x4eba58[_0x0b20('0x31')]));}});};function originate(_0x1d8768,_0x3adedf,_0x4187d6){return new BPromise(function(_0x338107,_0x5cecf1){if(_0x4187d6){var _0x9ef1ef=util[_0x0b20('0x58')](_0x0b20('0x59'),path[_0x0b20('0x33')](_0x1d8768[_0x0b20('0x5a')])[_0x0b20('0x1e')],_0x1d8768[_0x0b20('0x5a')]);gs[_0x0b20('0x5b')](_0x9ef1ef)[_0x0b20('0x41')](function(){_0x1d8768['path']=util[_0x0b20('0x58')]('%s/%s.tif',path[_0x0b20('0x33')](_0x1d8768[_0x0b20('0x5a')])[_0x0b20('0x5c')],path['parse'](_0x1d8768[_0x0b20('0x5a')])['name']);_0x3adedf[_0x0b20('0x5d')]=_0x1d8768['path'];ut[_0x0b20('0x42')](_0x0b20('0x5e'),'');ami[_0x0b20('0x5f')](ut[_0x0b20('0x60')](_0x1d8768,_0x3adedf))[_0x0b20('0x41')](function(_0x215684){_0x338107(_0x215684);})[_0x0b20('0x38')](function(_0x105927){_0x5cecf1(_0x105927);});})[_0x0b20('0x38')](function(_0x40fa7d){_0x5cecf1(_0x40fa7d);});}else{ami[_0x0b20('0x5f')](ut[_0x0b20('0x60')](_0x1d8768,_0x3adedf))[_0x0b20('0x41')](function(_0x418acd){_0x338107(_0x418acd);})[_0x0b20('0x38')](function(_0x1bf405){_0x5cecf1(_0x1bf405);});}});}Fax['prototype']['execOriginate']=function(_0x4d3b52,_0x17e77f){var _0x5eed1d=this;return new BPromise(function(_0x25456d,_0x5a77e2){var _0x2ce626=uuid['v4']();var _0x13a363=ut[_0x0b20('0x61')](_0x4d3b52,_0x17e77f);_0x5eed1d[_0x0b20('0x20')][_0x2ce626]=new Action(_0x2ce626,_0x17e77f,_0x4d3b52);var _0x3f536f=_0x5eed1d[_0x0b20('0x20')][_0x2ce626];if(path['parse'](_0x4d3b52[_0x0b20('0x5a')])[_0x0b20('0x62')]===_0x0b20('0x34')){originate(_0x3f536f,_0x13a363,!![])[_0x0b20('0x41')](function(_0x5d9ee2){_0x25456d(_0x5d9ee2);})[_0x0b20('0x38')](function(_0x25e9db){_0x5a77e2(_0x25e9db);});}else{originate(_0x3f536f,_0x13a363,![])['then'](function(_0x4cf150){_0x25456d(_0x4cf150);})[_0x0b20('0x38')](function(_0x26596f){_0x5a77e2(_0x26596f);});}});};Fax['prototype'][_0x0b20('0x63')]=function(_0x23f960){return!_['isNil'](_0x23f960)&&!_['isNil'](_0x23f960['name'])&&!_[_0x0b20('0x64')](_0x23f960[_0x0b20('0x65')])&&_0x23f960['active']&&!_['isNil'](this[_0x0b20('0xb')][util['format']('SIP/%s',_0x23f960['name'])])&&!_[_0x0b20('0x64')](this[_0x0b20('0xb')][util[_0x0b20('0x58')]('SIP/%s',_0x23f960[_0x0b20('0x1e')])][_0x0b20('0x27')])&&(this['trunks'][util[_0x0b20('0x58')](_0x0b20('0x66'),_0x23f960[_0x0b20('0x1e')])][_0x0b20('0x27')]===_0x0b20('0x67')||this[_0x0b20('0xb')][util[_0x0b20('0x58')](_0x0b20('0x66'),_0x23f960[_0x0b20('0x1e')])][_0x0b20('0x27')]===_0x0b20('0x68'));};Fax['prototype'][_0x0b20('0x54')]=function(_0x206314,_0x3905d6){if(!this[_0x0b20('0x63')](_0x206314)){ut[_0x0b20('0x42')](_0x0b20('0x69'),_[_0x0b20('0x64')](_0x206314)?'':_0x206314[_0x0b20('0x1e')]+_0x0b20('0x6a'));return{'isValid':![],'message':_0x0b20('0x6b')};}if(_['isNil'](_0x3905d6[_0x0b20('0x4')])){ut[_0x0b20('0x42')](_0x0b20('0x6c'),JSON['stringify'](_0x3905d6));return{'isValid':![],'message':_0x0b20('0x6d')};}if(_['isNil'](_0x3905d6[_0x0b20('0x5a')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0x0b20('0x37')](_0x3905d6));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x0b20('0x6e')};};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 70e0799..8243dfa 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 _0x063c=['lodash','error','inspect','notify','resolve','then','catch','[Notify]\x20','../../../config/logger'];(function(_0x2f47a7,_0x502c58){var _0x19f205=function(_0x4a08bf){while(--_0x4a08bf){_0x2f47a7['push'](_0x2f47a7['shift']());}};_0x19f205(++_0x502c58);}(_0x063c,0xbc));var _0xc063=function(_0x15961d,_0x5372e7){_0x15961d=_0x15961d-0x0;var _0x141f2e=_0x063c[_0x15961d];return _0x141f2e;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xc063('0x0'))('preview');var _=require(_0xc063('0x1'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x27d09d){return function(_0x57254a){logger[_0xc063('0x2')](_0x27d09d,util[_0xc063('0x3')](_0x57254a,{'showHidden':![],'depth':null}));};}exports[_0xc063('0x4')]=function(_0xdaba32,_0x30d5b0){return BPromise[_0xc063('0x5')]()[_0xc063('0x6')](faxAccount[_0xc063('0x4')](_0xdaba32,_0x30d5b0))[_0xc063('0x7')](loggerCatch(_0xc063('0x8')));}; \ No newline at end of file +var _0x1290=['../../../config/logger','preview','lodash','../rpc/faxAccount','error','resolve','then','notify','catch','[Notify]\x20','bluebird'];(function(_0x7c7a41,_0x11a170){var _0x5c09d3=function(_0x5dec92){while(--_0x5dec92){_0x7c7a41['push'](_0x7c7a41['shift']());}};_0x5c09d3(++_0x11a170);}(_0x1290,0x1c2));var _0x0129=function(_0x481cbe,_0xb51c0d){_0x481cbe=_0x481cbe-0x0;var _0x3a82bc=_0x1290[_0x481cbe];return _0x3a82bc;};'use strict';var util=require('util');var BPromise=require(_0x0129('0x0'));var logger=require(_0x0129('0x1'))(_0x0129('0x2'));var _=require(_0x0129('0x3'));var faxAccount=require(_0x0129('0x4'));function loggerCatch(_0x2cf776){return function(_0x5ceeae){logger[_0x0129('0x5')](_0x2cf776,util['inspect'](_0x5ceeae,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x5a5cb0,_0x4b7ed7){return BPromise[_0x0129('0x6')]()[_0x0129('0x7')](faxAccount[_0x0129('0x8')](_0x5a5cb0,_0x4b7ed7))[_0x0129('0x9')](loggerCatch(_0x0129('0xa')));}; \ 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 e6afe0d..6eff227 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 _0x2929=['bluebird','child_process','exec','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2929,0xb1));var _0x9292=function(_0x2c742d,_0x1ab441){_0x2c742d=_0x2c742d-0x0;var _0x92747b=_0x2929[_0x2c742d];return _0x92747b;};'use strict';var util=require(_0x9292('0x0'));var logger=require(_0x9292('0x1'))(_0x9292('0x2'));var BPromise=require(_0x9292('0x3'));var exec=require(_0x9292('0x4'))[_0x9292('0x5')];exports['execute']=function(_0x38223e){return new BPromise(function(_0x1d0cb6,_0x1ec9a7){exec(_0x38223e,function(_0x49a532,_0x5517c9,_0xa08b5f){logger[_0x9292('0x6')](_0x9292('0x7'),_0x5517c9);if(_0x49a532){logger[_0x9292('0x6')](_0x9292('0x7'),_0x9292('0x8'),util[_0x9292('0x9')](_0x49a532,{'showHidden':![],'depth':null}),_0x5517c9,_0xa08b5f);_0x1ec9a7(_0x49a532);}_0x1d0cb6(_0x5517c9);});});}; \ No newline at end of file +var _0xb70e=['inspect','util','../../../../config/logger','fax','bluebird','exec','execute','Exec\x20gs','\x20Error\x20:'];(function(_0x1601f7,_0x4fcc88){var _0x4e3a3c=function(_0x40d002){while(--_0x40d002){_0x1601f7['push'](_0x1601f7['shift']());}};_0x4e3a3c(++_0x4fcc88);}(_0xb70e,0xc7));var _0xeb70=function(_0x7a1a71,_0x21eb82){_0x7a1a71=_0x7a1a71-0x0;var _0x515a96=_0xb70e[_0x7a1a71];return _0x515a96;};'use strict';var util=require(_0xeb70('0x0'));var logger=require(_0xeb70('0x1'))(_0xeb70('0x2'));var BPromise=require(_0xeb70('0x3'));var exec=require('child_process')[_0xeb70('0x4')];exports[_0xeb70('0x5')]=function(_0x22bae4){return new BPromise(function(_0x282e06,_0x2b22a){exec(_0x22bae4,function(_0x5432f5,_0x3daeaf,_0x314e19){logger['info']('Exec\x20gs',_0x3daeaf);if(_0x5432f5){logger['info'](_0xeb70('0x6'),_0xeb70('0x7'),util[_0xeb70('0x8')](_0x5432f5,{'showHidden':![],'depth':null}),_0x3daeaf,_0x314e19);_0x2b22a(_0x5432f5);}_0x282e06(_0x3daeaf);});});}; \ 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 8019fa0..95d5e3b 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 _0x2e54=['addVariables','headerinfo','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','../../../../config/logger','fax','message','logger','inspect'];(function(_0x41a6f7,_0x4bf0e2){var _0x5775fc=function(_0x4dd9ad){while(--_0x4dd9ad){_0x41a6f7['push'](_0x41a6f7['shift']());}};_0x5775fc(++_0x4bf0e2);}(_0x2e54,0x1dd));var _0x42e5=function(_0x20cc70,_0x644f35){_0x20cc70=_0x20cc70-0x0;var _0x4acb12=_0x2e54[_0x20cc70];return _0x4acb12;};'use strict';var util=require(_0x42e5('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x42e5('0x1'))(_0x42e5('0x2'));exports[_0x42e5('0x3')]=function(_0x1c62bb){return{'message':_0x1c62bb};};exports[_0x42e5('0x4')]=function(_0x153440,_0x42736b){logger['info'](_0x153440,util[_0x42e5('0x5')](_0x42736b,{'showHidden':![],'depth':null}));};exports[_0x42e5('0x6')]=function(_0x38cb1b,_0x4bed10){var _0x2af5bb={'XMF-ECM':_0x4bed10['ecm'],'XMF-HEADERINFO':_0x4bed10[_0x42e5('0x7')],'XMF-MINRATE':_0x4bed10['minrate'],'XMF-MAXRATE':_0x4bed10[_0x42e5('0x8')],'XMF-MODEM':util[_0x42e5('0x9')](_0x42e5('0xa'),_0x4bed10[_0x42e5('0xb')]),'XMF-GATEWAY':_0x4bed10[_0x42e5('0xc')],'XMF-FAXDETECT':_0x4bed10[_0x42e5('0xd')],'XMF-T38TIMEOUT':_0x4bed10[_0x42e5('0xe')],'XMF-LOCALSTATIONID':_0x4bed10[_0x42e5('0xf')],'XMF-PATH':_0x38cb1b[_0x42e5('0x10')]};return _0x2af5bb;};exports['variablesAction']=function(_0x456298,_0x28b3b3){return{'actionid':_0x456298['uniqueid'],'action':_0x42e5('0x11'),'channel':_0x456298[_0x42e5('0x12')],'Exten':_0x42e5('0x13'),'Context':_0x42e5('0x14'),'Priority':'1','callerid':util[_0x42e5('0x9')](_0x42e5('0x15'),_0x456298[_0x42e5('0x7')]?_0x456298[_0x42e5('0x7')]:'',_0x456298[_0x42e5('0xf')]),'variable':_0x28b3b3,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x456298[_0x42e5('0x16')]};}; \ No newline at end of file +var _0xdace=['t38timeout','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','util','moment','../../../../config/logger','fax','logger','inspect','addVariables','ecm','headerinfo','maxrate','format','\x22%s\x22','faxdetect'];(function(_0x180c9b,_0x13d173){var _0x3ff116=function(_0x241982){while(--_0x241982){_0x180c9b['push'](_0x180c9b['shift']());}};_0x3ff116(++_0x13d173);}(_0xdace,0xc5));var _0xedac=function(_0x57b432,_0x1589a0){_0x57b432=_0x57b432-0x0;var _0x2edf2a=_0xdace[_0x57b432];return _0x2edf2a;};'use strict';var util=require(_0xedac('0x0'));var _=require('lodash');var moment=require(_0xedac('0x1'));var logger=require(_0xedac('0x2'))(_0xedac('0x3'));exports['message']=function(_0x413d77){return{'message':_0x413d77};};exports[_0xedac('0x4')]=function(_0x15d3bd,_0xefb142){logger['info'](_0x15d3bd,util[_0xedac('0x5')](_0xefb142,{'showHidden':![],'depth':null}));};exports[_0xedac('0x6')]=function(_0x39328a,_0x5ecbd3){var _0x4081c6={'XMF-ECM':_0x5ecbd3[_0xedac('0x7')],'XMF-HEADERINFO':_0x5ecbd3[_0xedac('0x8')],'XMF-MINRATE':_0x5ecbd3['minrate'],'XMF-MAXRATE':_0x5ecbd3[_0xedac('0x9')],'XMF-MODEM':util[_0xedac('0xa')](_0xedac('0xb'),_0x5ecbd3['modem']),'XMF-GATEWAY':_0x5ecbd3['gateway'],'XMF-FAXDETECT':_0x5ecbd3[_0xedac('0xc')],'XMF-T38TIMEOUT':_0x5ecbd3[_0xedac('0xd')],'XMF-LOCALSTATIONID':_0x5ecbd3['localstationid'],'XMF-PATH':_0x39328a['path']};return _0x4081c6;};exports[_0xedac('0xe')]=function(_0x25395d,_0x57f637){return{'actionid':_0x25395d[_0xedac('0xf')],'action':'originate','channel':_0x25395d[_0xedac('0x10')],'Exten':_0xedac('0x11'),'Context':_0xedac('0x12'),'Priority':'1','callerid':util[_0xedac('0xa')](_0xedac('0x13'),_0x25395d[_0xedac('0x8')]?_0x25395d[_0xedac('0x8')]:'',_0x25395d[_0xedac('0x14')]),'variable':_0x57f637,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x25395d['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 2a8035a..21d36f8 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 _0xe706=['initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','sync','bluebird','util','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','initTelephones','getVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts'];(function(_0x5ef62b,_0x4879e3){var _0x1c551a=function(_0x224b6a){while(--_0x224b6a){_0x5ef62b['push'](_0x5ef62b['shift']());}};_0x1c551a(++_0x4879e3);}(_0xe706,0xa3));var _0x6e70=function(_0x1b2d57,_0x4fccb7){_0x1b2d57=_0x1b2d57-0x0;var _0x5d46dd=_0xe706[_0x1b2d57];return _0x5d46dd;};'use strict';var BPromise=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var server=require('./server');var Realtime=require(_0x6e70('0x3'));var Report=require(_0x6e70('0x4'));var Acw=require(_0x6e70('0x5'));var Trigger=require(_0x6e70('0x6'));var Dialer=require(_0x6e70('0x7'));var Preview=require(_0x6e70('0x8'));var Fax=require(_0x6e70('0x9'));var user=require(_0x6e70('0xa'));var voiceQueue=require(_0x6e70('0xb'));var voiceQueueReport=require(_0x6e70('0xc'));var voiceCallReport=require(_0x6e70('0xd'));var trunk=require(_0x6e70('0xe'));var trigger=require(_0x6e70('0xf'));var template=require(_0x6e70('0x10'));var cmHopperHistory=require(_0x6e70('0x11'));var campaign=require(_0x6e70('0x12'));var voiceExtension=require(_0x6e70('0x13'));var faxAccount=require(_0x6e70('0x14'));var zendesk=require(_0x6e70('0x15'));var salesforce=require(_0x6e70('0x16'));var sugarcrm=require(_0x6e70('0x17'));var freshdesk=require(_0x6e70('0x18'));var desk=require(_0x6e70('0x19'));var zoho=require(_0x6e70('0x1a'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x6e70('0x1b'));var dynamics365=require(_0x6e70('0x1c'));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()[_0x6e70('0x1d')](_0x6e70('0x1e'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6e70('0x1d')](_0x6e70('0x1e'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x6e70('0x1f')]()[_0x6e70('0x20')](user['getAgents']())['then'](realtime['initAgents']())[_0x6e70('0x20')](user['getTelephones']())['then'](realtime[_0x6e70('0x21')]())[_0x6e70('0x20')](trunk['getTrunks']())[_0x6e70('0x20')](realtime['initTrunks']())[_0x6e70('0x20')](voiceQueue[_0x6e70('0x22')]())['then'](realtime['initVoiceQueues']())[_0x6e70('0x20')](trigger['getTriggers']())[_0x6e70('0x20')](realtime[_0x6e70('0x23')]())['then'](template['getTemplates']())[_0x6e70('0x20')](realtime[_0x6e70('0x24')]())[_0x6e70('0x20')](zendesk[_0x6e70('0x25')]())[_0x6e70('0x20')](realtime[_0x6e70('0x26')]())[_0x6e70('0x20')](salesforce[_0x6e70('0x27')]())[_0x6e70('0x20')](realtime[_0x6e70('0x28')]())['then'](sugarcrm[_0x6e70('0x29')]())[_0x6e70('0x20')](realtime[_0x6e70('0x2a')]())['then'](freshdesk[_0x6e70('0x2b')]())[_0x6e70('0x20')](realtime[_0x6e70('0x2c')]())['then'](desk[_0x6e70('0x2d')]())['then'](realtime['initDeskAccounts']())['then'](zoho[_0x6e70('0x2e')]())[_0x6e70('0x20')](realtime['initZohoAccounts']())[_0x6e70('0x20')](vtiger[_0x6e70('0x2f')]())['then'](realtime[_0x6e70('0x30')]())[_0x6e70('0x20')](freshsales[_0x6e70('0x31')]())['then'](realtime['initFreshsalesAccounts']())[_0x6e70('0x20')](servicenow[_0x6e70('0x32')]())[_0x6e70('0x20')](realtime[_0x6e70('0x33')]())[_0x6e70('0x20')](dynamics365['getDynamics365Accounts']())[_0x6e70('0x20')](realtime[_0x6e70('0x34')]())[_0x6e70('0x20')](campaign[_0x6e70('0x35')]())[_0x6e70('0x20')](realtime[_0x6e70('0x36')]())[_0x6e70('0x20')](voiceExtension[_0x6e70('0x37')]())[_0x6e70('0x20')](realtime[_0x6e70('0x38')]())['then'](faxAccount[_0x6e70('0x39')]())['then'](realtime[_0x6e70('0x3a')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x6e70('0x1f')]()[_0x6e70('0x20')](voiceQueueReport[_0x6e70('0x3b')]())['then'](realtime[_0x6e70('0x3c')]())[_0x6e70('0x20')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x6e70('0x20')](realtime[_0x6e70('0x3d')]())['then'](cmHopperHistory[_0x6e70('0x3e')]())[_0x6e70('0x20')](realtime[_0x6e70('0x3f')]())[_0x6e70('0x20')](voiceCallReport[_0x6e70('0x40')]())[_0x6e70('0x20')](realtime[_0x6e70('0x41')]())[_0x6e70('0x20')](function(_0xf146fd){})[_0x6e70('0x42')](function(_0x4d32d8){console[_0x6e70('0x43')](_0x4d32d8);});}function main(){return server['listen'](realtime,preview,fax)[_0x6e70('0x20')](function(_0x3222a2){return initRealtime();})[_0x6e70('0x20')](function(){return initParams();})[_0x6e70('0x20')](function(){report[_0x6e70('0x44')]();setInterval(initRealtime,0x1388);})[_0x6e70('0x42')](function(_0x2440be){console[_0x6e70('0x43')](_0x2440be);});}main(); \ No newline at end of file +var _0xac4a=['initVoiceCallReports','catch','log','sync','bluebird','util','moment','./server','./realtime','./report','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xac4a,0x13f));var _0xaac4=function(_0xff4708,_0x3b672c){_0xff4708=_0xff4708-0x0;var _0xe9e28f=_0xac4a[_0xff4708];return _0xe9e28f;};'use strict';var BPromise=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var server=require(_0xaac4('0x3'));var Realtime=require(_0xaac4('0x4'));var Report=require(_0xaac4('0x5'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0xaac4('0x6'));var Preview=require(_0xaac4('0x7'));var Fax=require(_0xaac4('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0xaac4('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xaac4('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0xaac4('0xb'));var template=require(_0xaac4('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0xaac4('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xaac4('0xe'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xaac4('0xf'));var desk=require(_0xaac4('0x10'));var zoho=require(_0xaac4('0x11'));var vtiger=require(_0xaac4('0x12'));var freshsales=require(_0xaac4('0x13'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xaac4('0x14')](_0xaac4('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xaac4('0x14')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xaac4('0x16')]()[_0xaac4('0x17')](user['getAgents']())[_0xaac4('0x17')](realtime[_0xaac4('0x18')]())[_0xaac4('0x17')](user[_0xaac4('0x19')]())[_0xaac4('0x17')](realtime[_0xaac4('0x1a')]())[_0xaac4('0x17')](trunk[_0xaac4('0x1b')]())[_0xaac4('0x17')](realtime[_0xaac4('0x1c')]())[_0xaac4('0x17')](voiceQueue[_0xaac4('0x1d')]())[_0xaac4('0x17')](realtime['initVoiceQueues']())[_0xaac4('0x17')](trigger['getTriggers']())[_0xaac4('0x17')](realtime['initTriggers']())[_0xaac4('0x17')](template[_0xaac4('0x1e')]())[_0xaac4('0x17')](realtime[_0xaac4('0x1f')]())[_0xaac4('0x17')](zendesk[_0xaac4('0x20')]())[_0xaac4('0x17')](realtime[_0xaac4('0x21')]())[_0xaac4('0x17')](salesforce['getSalesforceAccounts']())[_0xaac4('0x17')](realtime['initSalesforceAccounts']())[_0xaac4('0x17')](sugarcrm[_0xaac4('0x22')]())[_0xaac4('0x17')](realtime[_0xaac4('0x23')]())[_0xaac4('0x17')](freshdesk[_0xaac4('0x24')]())['then'](realtime[_0xaac4('0x25')]())[_0xaac4('0x17')](desk[_0xaac4('0x26')]())[_0xaac4('0x17')](realtime[_0xaac4('0x27')]())[_0xaac4('0x17')](zoho[_0xaac4('0x28')]())['then'](realtime[_0xaac4('0x29')]())['then'](vtiger['getVtigerAccounts']())['then'](realtime['initVtigerAccounts']())[_0xaac4('0x17')](freshsales[_0xaac4('0x2a')]())[_0xaac4('0x17')](realtime[_0xaac4('0x2b')]())[_0xaac4('0x17')](servicenow[_0xaac4('0x2c')]())[_0xaac4('0x17')](realtime[_0xaac4('0x2d')]())[_0xaac4('0x17')](dynamics365[_0xaac4('0x2e')]())['then'](realtime[_0xaac4('0x2f')]())[_0xaac4('0x17')](campaign[_0xaac4('0x30')]())[_0xaac4('0x17')](realtime[_0xaac4('0x31')]())[_0xaac4('0x17')](voiceExtension['getVoiceExtensions']())[_0xaac4('0x17')](realtime['initVoiceExtensions']())[_0xaac4('0x17')](faxAccount[_0xaac4('0x32')]())[_0xaac4('0x17')](realtime[_0xaac4('0x33')]())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0xaac4('0x34')]())[_0xaac4('0x17')](realtime[_0xaac4('0x35')]())[_0xaac4('0x17')](cmHopperHistory[_0xaac4('0x36')]())[_0xaac4('0x17')](realtime[_0xaac4('0x37')]())[_0xaac4('0x17')](cmHopperHistory[_0xaac4('0x38')]())[_0xaac4('0x17')](realtime[_0xaac4('0x39')]())[_0xaac4('0x17')](voiceCallReport[_0xaac4('0x3a')]())[_0xaac4('0x17')](realtime[_0xaac4('0x3b')]())['then'](function(_0x5bad9f){})[_0xaac4('0x3c')](function(_0x40f64b){console[_0xaac4('0x3d')](_0x40f64b);});}function main(){return server['listen'](realtime,preview,fax)[_0xaac4('0x17')](function(_0x16fae8){return initRealtime();})[_0xaac4('0x17')](function(){return initParams();})[_0xaac4('0x17')](function(){report[_0xaac4('0x3e')]();setInterval(initRealtime,0x1388);})[_0xaac4('0x3c')](function(_0x418939){console['log'](_0x418939);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index e55c6e5..4e1b137 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 _0xd716=['mobile','interface','online','unknown','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','voiceStatus','toNumber','format','email','address','stringify','emit','user:save','user:presence','util','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','accountcode','fullname','state','status','phone'];(function(_0x539678,_0x442225){var _0x768565=function(_0x3acf4b){while(--_0x3acf4b){_0x539678['push'](_0x539678['shift']());}};_0x768565(++_0x442225);}(_0xd716,0x137));var _0x6d71=function(_0x158dd7,_0x1f5f90){_0x158dd7=_0x158dd7-0x0;var _0x1772ba=_0xd716[_0x158dd7];return _0x1772ba;};'use strict';var _=require('lodash');var util=require(_0x6d71('0x0'));var moment=require('moment');var md5=require(_0x6d71('0x1'));var Redis=require(_0x6d71('0x2'));var config=require(_0x6d71('0x3'));config[_0x6d71('0x4')]=_[_0x6d71('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6d71('0x6'))(new Redis(config[_0x6d71('0x4')]));function Agent(_0x39adaf){this['id']=_0x39adaf['id']||0x0;this[_0x6d71('0x7')]=_0x39adaf['name']||'';this['email']=_0x39adaf['email']||'';this[_0x6d71('0x8')]=_0x39adaf[_0x6d71('0x8')]||'';this['fullname']=_0x39adaf[_0x6d71('0x9')]||'';this[_0x6d71('0xa')]='unknown';this['stateTime']=0x0;this[_0x6d71('0xb')]='unknown';this['address']='';this[_0x6d71('0xc')]='';this[_0x6d71('0xd')]='';this[_0x6d71('0xe')]='';this['online']=_0x39adaf[_0x6d71('0xf')]||![];this['voiceStatus']=_0x6d71('0x10');this[_0x6d71('0x11')]=0x0;this[_0x6d71('0x12')]='';this[_0x6d71('0x13')]='';this[_0x6d71('0x14')]=![];this[_0x6d71('0x15')]=![];this[_0x6d71('0x1')]='';}Agent['prototype'][_0x6d71('0x16')]=function(_0x23c9b9){var _0x5c0737;if(_0x23c9b9&&_0x23c9b9[_0x6d71('0xa')]){_0x5c0737=_0x23c9b9[_0x6d71('0xa')][_0x6d71('0x17')]();switch(_0x5c0737){case _0x6d71('0x18'):_0x5c0737=_0x6d71('0x19');break;case _0x6d71('0x1a'):_0x5c0737='talking';break;}}if(_0x5c0737&&this[_0x6d71('0x1b')]!==_0x5c0737||_0x23c9b9['statePause']){this[_0x6d71('0x11')]=_[_0x6d71('0x1c')](moment()[_0x6d71('0x1d')]('x'));}if(_0x5c0737){this[_0x6d71('0x1b')]=_0x5c0737;}var _0x26d4ec={'id':this['id'],'name':this[_0x6d71('0x7')],'email':this[_0x6d71('0x1e')],'accountcode':this['accountcode'],'fullname':this[_0x6d71('0x9')],'state':this['state'],'stateTime':this['stateTime'],'status':this[_0x6d71('0xb')],'address':this[_0x6d71('0x1f')],'online':this[_0x6d71('0xf')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x6d71('0x11')],'voiceStatusCallerIdNumber':this[_0x6d71('0x12')],'voiceStatusQueue':this[_0x6d71('0x13')],'interface':this[_0x6d71('0xe')],'onhold':this['onhold']};var _0x4bea29=md5(JSON[_0x6d71('0x20')](_0x26d4ec));if(this['md5']!==_0x4bea29){this[_0x6d71('0x1')]=_0x4bea29;io['to'](util[_0x6d71('0x1d')]('user:%s',_0x26d4ec[_0x6d71('0x7')]))[_0x6d71('0x21')](_0x6d71('0x22'),_0x26d4ec);io[_0x6d71('0x21')](_0x6d71('0x23'),_0x26d4ec);}};module['exports']=Agent; \ No newline at end of file +var _0xc0af=['statePause','toNumber','format','status','address','user:%s','emit','user:presence','exports','lodash','util','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','stateTime','unknown','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','local','updateStatusRealtime','state','toLowerCase','idle','inuse'];(function(_0x592c14,_0x34cf86){var _0x1cc2eb=function(_0x28b4ec){while(--_0x28b4ec){_0x592c14['push'](_0x592c14['shift']());}};_0x1cc2eb(++_0x34cf86);}(_0xc0af,0x9d));var _0xfc0a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc0af[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xfc0a('0x0'));var util=require(_0xfc0a('0x1'));var moment=require('moment');var md5=require(_0xfc0a('0x2'));var Redis=require(_0xfc0a('0x3'));var config=require(_0xfc0a('0x4'));config[_0xfc0a('0x5')]=_['defaults'](config['redis'],{'host':_0xfc0a('0x6'),'port':0x18eb});var io=require(_0xfc0a('0x7'))(new Redis(config['redis']));function Agent(_0x427e43){this['id']=_0x427e43['id']||0x0;this[_0xfc0a('0x8')]=_0x427e43['name']||'';this[_0xfc0a('0x9')]=_0x427e43[_0xfc0a('0x9')]||'';this[_0xfc0a('0xa')]=_0x427e43[_0xfc0a('0xa')]||'';this['fullname']=_0x427e43[_0xfc0a('0xb')]||'';this['state']='unknown';this[_0xfc0a('0xc')]=0x0;this['status']=_0xfc0a('0xd');this['address']='';this[_0xfc0a('0xe')]='';this[_0xfc0a('0xf')]='';this[_0xfc0a('0x10')]='';this[_0xfc0a('0x11')]=_0x427e43[_0xfc0a('0x11')]||![];this[_0xfc0a('0x12')]=_0xfc0a('0xd');this[_0xfc0a('0x13')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0xfc0a('0x14')]='';this[_0xfc0a('0x15')]=![];this[_0xfc0a('0x16')]=![];this[_0xfc0a('0x2')]='';}Agent['prototype'][_0xfc0a('0x17')]=function(_0x1c23ee){var _0x2ed0bf;if(_0x1c23ee&&_0x1c23ee[_0xfc0a('0x18')]){_0x2ed0bf=_0x1c23ee[_0xfc0a('0x18')][_0xfc0a('0x19')]();switch(_0x2ed0bf){case'not_inuse':_0x2ed0bf=_0xfc0a('0x1a');break;case _0xfc0a('0x1b'):_0x2ed0bf='talking';break;}}if(_0x2ed0bf&&this[_0xfc0a('0x12')]!==_0x2ed0bf||_0x1c23ee[_0xfc0a('0x1c')]){this[_0xfc0a('0x13')]=_[_0xfc0a('0x1d')](moment()[_0xfc0a('0x1e')]('x'));}if(_0x2ed0bf){this[_0xfc0a('0x12')]=_0x2ed0bf;}var _0x520979={'id':this['id'],'name':this[_0xfc0a('0x8')],'email':this[_0xfc0a('0x9')],'accountcode':this[_0xfc0a('0xa')],'fullname':this['fullname'],'state':this['state'],'stateTime':this[_0xfc0a('0xc')],'status':this[_0xfc0a('0x1f')],'address':this[_0xfc0a('0x20')],'online':this[_0xfc0a('0x11')],'voiceStatus':this[_0xfc0a('0x12')],'voiceStatusTime':this[_0xfc0a('0x13')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0xfc0a('0x10')],'onhold':this[_0xfc0a('0x15')]};var _0x8a709a=md5(JSON['stringify'](_0x520979));if(this[_0xfc0a('0x2')]!==_0x8a709a){this[_0xfc0a('0x2')]=_0x8a709a;io['to'](util[_0xfc0a('0x1e')](_0xfc0a('0x21'),_0x520979[_0xfc0a('0x8')]))[_0xfc0a('0x22')]('user:save',_0x520979);io[_0xfc0a('0x22')](_0xfc0a('0x23'),_0x520979);}};module[_0xfc0a('0x24')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 9430bee..b9a46a1 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 _0xe88e=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xe88e,0x167));var _0xee88=function(_0x2534a0,_0xda89db){_0x2534a0=_0x2534a0-0x0;var _0x3209c0=_0xe88e[_0x2534a0];return _0x3209c0;};'use strict';function Campaign(_0xee034b){this['id']=_0xee034b['id']||0x0;this[_0xee88('0x0')]=_0xee034b[_0xee88('0x0')]||'';this[_0xee88('0x1')]=_0xee034b[_0xee88('0x1')]||_0xee88('0x2');this[_0xee88('0x3')]=0x0;this[_0xee88('0x4')]=0x0;this[_0xee88('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0xee88('0x6')]=!![];this[_0xee88('0x7')]=_0xee034b[_0xee88('0x7')];this['limitCalls']=_0xee034b[_0xee88('0x8')];this[_0xee88('0x9')]=_0xee034b['dialTimezone']||null;this['dialGlobalInterval']=_0xee034b[_0xee88('0xa')]?_0xee034b[_0xee88('0xa')]:null;this[_0xee88('0xb')]=_0xee034b[_0xee88('0xb')];this[_0xee88('0xc')]=_0xee034b[_0xee88('0xc')];this[_0xee88('0xd')]=_0xee034b[_0xee88('0xd')]||0x1e;this[_0xee88('0xe')]=_0xee034b[_0xee88('0xe')];this[_0xee88('0xf')]=_0xee034b[_0xee88('0xf')];this[_0xee88('0x10')]=_0xee034b[_0xee88('0x10')];this[_0xee88('0x11')]=_0xee034b[_0xee88('0x11')];this[_0xee88('0x12')]=_0xee034b['dialNoAnswerMaxRetry'];this[_0xee88('0x13')]=_0xee034b[_0xee88('0x13')];this['dialGlobalMaxRetry']=_0xee034b[_0xee88('0x14')];this[_0xee88('0x15')]=_0xee034b[_0xee88('0x15')]||0x3;this[_0xee88('0x16')]=_0xee034b[_0xee88('0x16')]||0x96;this[_0xee88('0x17')]=_0xee034b[_0xee88('0x17')]||0x3;this[_0xee88('0x18')]=_0xee034b['dialDropRetryFrequency']||0x96;this[_0xee88('0x19')]=_0xee034b[_0xee88('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0xee034b['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0xee034b[_0xee88('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0xee034b[_0xee88('0x1b')]||0x96;this[_0xee88('0x1c')]=_0xee034b[_0xee88('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0xee034b['dialAgentRejectRetryFrequency']||0x96;this[_0xee88('0x1d')]=_0xee034b[_0xee88('0x1d')]||_0xee88('0x1e');this[_0xee88('0x1f')]=_0xee034b[_0xee88('0x1f')]||undefined;this[_0xee88('0x20')]=_0xee034b[_0xee88('0x20')]||undefined;this[_0xee88('0x21')]=_0xee034b[_0xee88('0x21')]||undefined;this['TrunkBackup']=_0xee034b['TrunkBackup']?_0xee034b[_0xee88('0x22')]:undefined;this[_0xee88('0x23')]=_0xee034b[_0xee88('0x23')]?_0xee034b[_0xee88('0x23')]:undefined;this[_0xee88('0x24')]=_0xee034b[_0xee88('0x24')]?_0xee034b[_0xee88('0x24')]:undefined;this['SquareProject']=_0xee034b[_0xee88('0x25')]?_0xee034b[_0xee88('0x25')]:undefined;this[_0xee88('0x26')]=_0xee034b[_0xee88('0x25')]?_0xee034b[_0xee88('0x25')][_0xee88('0x0')]:undefined;this[_0xee88('0x27')]=_0xee034b[_0xee88('0x27')]||![];this[_0xee88('0x28')]=_0xee034b[_0xee88('0x28')];this[_0xee88('0x29')]=_0xee034b[_0xee88('0x29')];this[_0xee88('0x2a')]=_0xee034b[_0xee88('0x2a')];this[_0xee88('0x2b')]=_0xee034b[_0xee88('0x2b')];this['dialAMDMinWordLength']=_0xee034b[_0xee88('0x2c')];this[_0xee88('0x2d')]=_0xee034b[_0xee88('0x2d')];this[_0xee88('0x2e')]=_0xee034b[_0xee88('0x2e')];this[_0xee88('0x2f')]=_0xee034b['dialAMDSilenceThreshold'];this[_0xee88('0x30')]=_0xee034b[_0xee88('0x30')];}module[_0xee88('0x31')]=Campaign; \ No newline at end of file +var _0x8119=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x6cb323,_0x15c81d){var _0x448547=function(_0x33686c){while(--_0x33686c){_0x6cb323['push'](_0x6cb323['shift']());}};_0x448547(++_0x15c81d);}(_0x8119,0x126));var _0x9811=function(_0x119464,_0x4e9c81){_0x119464=_0x119464-0x0;var _0x12311c=_0x8119[_0x119464];return _0x12311c;};'use strict';function Campaign(_0x277dac){this['id']=_0x277dac['id']||0x0;this[_0x9811('0x0')]=_0x277dac[_0x9811('0x0')]||'';this['type']=_0x277dac['type']||_0x9811('0x1');this[_0x9811('0x2')]=0x0;this[_0x9811('0x3')]=0x0;this[_0x9811('0x4')]=0x0;this[_0x9811('0x5')]=0x0;this[_0x9811('0x6')]='';this[_0x9811('0x7')]=!![];this[_0x9811('0x8')]=_0x277dac['active'];this[_0x9811('0x9')]=_0x277dac[_0x9811('0x9')];this[_0x9811('0xa')]=_0x277dac[_0x9811('0xa')]||null;this[_0x9811('0xb')]=_0x277dac[_0x9811('0xb')]?_0x277dac['dialGlobalInterval']:null;this[_0x9811('0xc')]=_0x277dac[_0x9811('0xc')];this[_0x9811('0xd')]=_0x277dac[_0x9811('0xd')];this[_0x9811('0xe')]=_0x277dac[_0x9811('0xe')]||0x1e;this[_0x9811('0xf')]=_0x277dac[_0x9811('0xf')];this[_0x9811('0x10')]=_0x277dac[_0x9811('0x10')];this['dialBusyMaxRetry']=_0x277dac[_0x9811('0x11')];this[_0x9811('0x12')]=_0x277dac[_0x9811('0x12')];this[_0x9811('0x13')]=_0x277dac[_0x9811('0x13')];this[_0x9811('0x14')]=_0x277dac[_0x9811('0x14')];this[_0x9811('0x15')]=_0x277dac['dialGlobalMaxRetry'];this[_0x9811('0x16')]=_0x277dac['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x277dac[_0x9811('0x17')]||0x96;this[_0x9811('0x18')]=_0x277dac['dialDropMaxRetry']||0x3;this[_0x9811('0x19')]=_0x277dac[_0x9811('0x19')]||0x96;this['dialAbandonedMaxRetry']=_0x277dac[_0x9811('0x1a')]||0x3;this[_0x9811('0x1b')]=_0x277dac[_0x9811('0x1b')]||0x96;this[_0x9811('0x1c')]=_0x277dac['dialMachineMaxRetry']||0x3;this[_0x9811('0x1d')]=_0x277dac[_0x9811('0x1d')]||0x96;this[_0x9811('0x1e')]=_0x277dac[_0x9811('0x1e')]||0x3;this['dialAgentRejectRetryFrequency']=_0x277dac[_0x9811('0x1f')]||0x96;this[_0x9811('0x20')]=_0x277dac[_0x9811('0x20')]||'DESC';this[_0x9811('0x21')]=_0x277dac[_0x9811('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x277dac[_0x9811('0x22')]||undefined;this[_0x9811('0x23')]=_0x277dac[_0x9811('0x23')]||undefined;this[_0x9811('0x24')]=_0x277dac[_0x9811('0x24')]?_0x277dac[_0x9811('0x24')]:undefined;this[_0x9811('0x25')]=_0x277dac[_0x9811('0x25')]?_0x277dac['Trunk']:undefined;this[_0x9811('0x26')]=_0x277dac[_0x9811('0x26')]?_0x277dac['Interval']:undefined;this[_0x9811('0x27')]=_0x277dac[_0x9811('0x27')]?_0x277dac[_0x9811('0x27')]:undefined;this[_0x9811('0x28')]=_0x277dac[_0x9811('0x27')]?_0x277dac[_0x9811('0x27')][_0x9811('0x0')]:undefined;this['dialAMDActive']=_0x277dac[_0x9811('0x29')]||![];this[_0x9811('0x2a')]=_0x277dac['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x277dac[_0x9811('0x2b')];this[_0x9811('0x2c')]=_0x277dac[_0x9811('0x2c')];this[_0x9811('0x2d')]=_0x277dac['dialAMDTotalAnalysisTime'];this[_0x9811('0x2e')]=_0x277dac[_0x9811('0x2e')];this[_0x9811('0x2f')]=_0x277dac['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x277dac[_0x9811('0x30')];this[_0x9811('0x31')]=_0x277dac[_0x9811('0x31')];this[_0x9811('0x32')]=_0x277dac[_0x9811('0x32')];}module[_0x9811('0x33')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 470f9be..33d03aa 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 _0x53d1=['unmanaged','lastapplication','duration','billableseconds','type','tag','disposition','monitorFilename','queue','monitors','transfercalleridnum','exports','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','linkedid','exten','answertime','endtime'];(function(_0x1fe768,_0x12272f){var _0xba6b6d=function(_0x5bc185){while(--_0x5bc185){_0x1fe768['push'](_0x1fe768['shift']());}};_0xba6b6d(++_0x12272f);}(_0x53d1,0x174));var _0x153d=function(_0x248286,_0x5a8646){_0x248286=_0x248286-0x0;var _0x10f392=_0x53d1[_0x248286];return _0x10f392;};'use strict';function Channel(){this[_0x153d('0x0')]=null;this[_0x153d('0x1')]='';this['destinationchannel']='';this[_0x153d('0x2')]=0x0;this[_0x153d('0x3')]='';this[_0x153d('0x4')]=undefined;this[_0x153d('0x5')]=undefined;this[_0x153d('0x6')]=0x0;this['context']='';this[_0x153d('0x7')]=0x0;this[_0x153d('0x8')]=0x0;this[_0x153d('0x9')]=0x0;this['answered']=![];this[_0x153d('0xa')]=null;this[_0x153d('0xb')]=null;this[_0x153d('0xc')]=![];this['abandoned']=![];this[_0x153d('0xd')]='';this['lastdata']='';this[_0x153d('0xe')]=0x0;this[_0x153d('0xf')]=0x0;this['holdtime']=0x0;this[_0x153d('0x10')]=null;this[_0x153d('0x11')]=null;this[_0x153d('0x12')]=null;this['monitor']=![];this[_0x153d('0x13')]=null;this[_0x153d('0x14')]=null;this[_0x153d('0x15')]=[];this[_0x153d('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0x153d('0x17')]=Channel; \ No newline at end of file +var _0xee58=['starttime','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','holdtime','type','tag','monitor','monitorFilename','monitors','transferType','exports'];(function(_0x5984da,_0x374813){var _0x1fa87e=function(_0x4b0d73){while(--_0x4b0d73){_0x5984da['push'](_0x5984da['shift']());}};_0x1fa87e(++_0x374813);}(_0xee58,0x104));var _0x8ee5=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xee58[_0x3947c9];return _0x2e7871;};'use strict';function Channel(){this[_0x8ee5('0x0')]=null;this[_0x8ee5('0x1')]='';this[_0x8ee5('0x2')]='';this['calleridnum']=0x0;this[_0x8ee5('0x3')]='';this[_0x8ee5('0x4')]=undefined;this[_0x8ee5('0x5')]=undefined;this['accountcode']=0x0;this[_0x8ee5('0x6')]='';this[_0x8ee5('0x7')]=0x0;this[_0x8ee5('0x8')]=0x0;this[_0x8ee5('0x9')]=0x0;this[_0x8ee5('0xa')]=![];this[_0x8ee5('0xb')]=null;this[_0x8ee5('0xc')]=null;this[_0x8ee5('0xd')]=![];this[_0x8ee5('0xe')]=![];this[_0x8ee5('0xf')]='';this[_0x8ee5('0x10')]='';this[_0x8ee5('0x11')]=0x0;this['billableseconds']=0x0;this[_0x8ee5('0x12')]=0x0;this[_0x8ee5('0x13')]=null;this[_0x8ee5('0x14')]=null;this['disposition']=null;this[_0x8ee5('0x15')]=![];this[_0x8ee5('0x16')]=null;this['queue']=null;this[_0x8ee5('0x17')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x8ee5('0x18')]=undefined;this['mohtime']=0x0;}module[_0x8ee5('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 33f57c0..62b2b1c 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 _0x3eea=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','token','tokenSecret','type','serverUrl'];(function(_0x3f46b0,_0x7a813a){var _0x2873fe=function(_0x46194c){while(--_0x46194c){_0x3f46b0['push'](_0x3f46b0['shift']());}};_0x2873fe(++_0x7a813a);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x58e3aa,_0x3eec90){_0x58e3aa=_0x58e3aa-0x0;var _0x476147=_0x3eea[_0x58e3aa];return _0x476147;};'use strict';function DeskAccount(_0xd20a35){this['id']=_0xd20a35['id']||0x0;this['name']=_0xd20a35[_0xa3ee('0x0')]||'';this[_0xa3ee('0x1')]=_0xd20a35[_0xa3ee('0x1')]||'';this[_0xa3ee('0x2')]=_0xd20a35[_0xa3ee('0x2')]||'';this[_0xa3ee('0x3')]=_0xd20a35[_0xa3ee('0x3')]||'';this[_0xa3ee('0x4')]=_0xd20a35[_0xa3ee('0x4')]||'';this[_0xa3ee('0x5')]=_0xd20a35[_0xa3ee('0x5')]||'';this['consumerSecret']=_0xd20a35['consumerSecret']||'';this[_0xa3ee('0x6')]=_0xd20a35['token']||'';this[_0xa3ee('0x7')]=_0xd20a35['tokenSecret']||'';this[_0xa3ee('0x8')]=_0xd20a35['type']||'';this[_0xa3ee('0x9')]=_0xd20a35['serverUrl']||'';this[_0xa3ee('0xa')]=_0xd20a35[_0xa3ee('0xa')]||{};}module[_0xa3ee('0xb')]=DeskAccount; \ No newline at end of file +var _0x383d=['type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x57604d,_0x3e9d7d){var _0x43e8f3=function(_0x4d4214){while(--_0x4d4214){_0x57604d['push'](_0x57604d['shift']());}};_0x43e8f3(++_0x3e9d7d);}(_0x383d,0x86));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';function DeskAccount(_0x26f5cd){this['id']=_0x26f5cd['id']||0x0;this['name']=_0x26f5cd[_0xd383('0x0')]||'';this[_0xd383('0x1')]=_0x26f5cd[_0xd383('0x1')]||'';this['remoteUri']=_0x26f5cd[_0xd383('0x2')]||'';this[_0xd383('0x3')]=_0x26f5cd[_0xd383('0x3')]||'';this[_0xd383('0x4')]=_0x26f5cd[_0xd383('0x4')]||'';this[_0xd383('0x5')]=_0x26f5cd['consumerKey']||'';this[_0xd383('0x6')]=_0x26f5cd[_0xd383('0x6')]||'';this[_0xd383('0x7')]=_0x26f5cd[_0xd383('0x7')]||'';this[_0xd383('0x8')]=_0x26f5cd['tokenSecret']||'';this['type']=_0x26f5cd[_0xd383('0x9')]||'';this[_0xd383('0xa')]=_0x26f5cd['serverUrl']||'';this[_0xd383('0xb')]=_0x26f5cd[_0xd383('0xb')]||{};}module[_0xd383('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 b00a32a..57cc600 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 _0xf3e5=['Configurations','name','username','password','remoteUri','tenantId','clientSecret','serverUrl'];(function(_0x2ec3a7,_0x1d5993){var _0x507f82=function(_0x5ce431){while(--_0x5ce431){_0x2ec3a7['push'](_0x2ec3a7['shift']());}};_0x507f82(++_0x1d5993);}(_0xf3e5,0x189));var _0x5f3e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xf3e5[_0x3054be];return _0x3df150;};'use strict';function Dynamics365Account(_0x37a143){this['id']=_0x37a143['id']||0x0;this[_0x5f3e('0x0')]=_0x37a143['name']||'';this['username']=_0x37a143[_0x5f3e('0x1')]||'';this['password']=_0x37a143[_0x5f3e('0x2')]||'';this[_0x5f3e('0x3')]=_0x37a143[_0x5f3e('0x3')]||'';this[_0x5f3e('0x4')]=_0x37a143['tenantId']||'';this['clientId']=_0x37a143['clientId']||'';this[_0x5f3e('0x5')]=_0x37a143[_0x5f3e('0x5')]||{};this[_0x5f3e('0x6')]=_0x37a143[_0x5f3e('0x6')]||'';this[_0x5f3e('0x7')]=_0x37a143[_0x5f3e('0x7')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x6dfb=['tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x6dfb,0x114));var _0xb6df=function(_0x1322d7,_0xbdf1c0){_0x1322d7=_0x1322d7-0x0;var _0x55d13b=_0x6dfb[_0x1322d7];return _0x55d13b;};'use strict';function Dynamics365Account(_0x5e2dd7){this['id']=_0x5e2dd7['id']||0x0;this[_0xb6df('0x0')]=_0x5e2dd7[_0xb6df('0x0')]||'';this[_0xb6df('0x1')]=_0x5e2dd7[_0xb6df('0x1')]||'';this['password']=_0x5e2dd7[_0xb6df('0x2')]||'';this['remoteUri']=_0x5e2dd7[_0xb6df('0x3')]||'';this[_0xb6df('0x4')]=_0x5e2dd7[_0xb6df('0x4')]||'';this[_0xb6df('0x5')]=_0x5e2dd7['clientId']||'';this[_0xb6df('0x6')]=_0x5e2dd7[_0xb6df('0x6')]||{};this[_0xb6df('0x7')]=_0x5e2dd7[_0xb6df('0x7')]||'';this['Configurations']=_0x5e2dd7[_0xb6df('0x8')]||{};}module[_0xb6df('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 0754662..cbaa665 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 _0xa6ce=['ecm','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description'];(function(_0x359b43,_0x5b108b){var _0x55cbb9=function(_0x38766b){while(--_0x38766b){_0x359b43['push'](_0x359b43['shift']());}};_0x55cbb9(++_0x5b108b);}(_0xa6ce,0x15e));var _0xea6c=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0xa6ce[_0x383356];return _0x32ee5a;};'use strict';function FaxAccount(_0x433da5){this['id']=_0x433da5['id']||0x0;this['name']=_0x433da5[_0xea6c('0x0')]||'';this[_0xea6c('0x1')]=_0x433da5['description'];this[_0xea6c('0x2')]=_0x433da5[_0xea6c('0x2')];this['headerinfo']=_0x433da5['headerinfo'];this[_0xea6c('0x3')]=_0x433da5[_0xea6c('0x3')];this[_0xea6c('0x4')]=_0x433da5[_0xea6c('0x4')]||0x960;this[_0xea6c('0x5')]=_0x433da5[_0xea6c('0x5')]||0x3840;this['modem']=_0x433da5[_0xea6c('0x6')]||_0xea6c('0x7');this[_0xea6c('0x8')]=_0x433da5[_0xea6c('0x8')]||'no';this[_0xea6c('0x9')]=_0x433da5[_0xea6c('0x9')]||'no';this[_0xea6c('0xa')]=_0x433da5[_0xea6c('0xa')]||0x1388;this[_0xea6c('0xb')]=_0x433da5[_0xea6c('0xb')]||_0xea6c('0xc');this[_0xea6c('0xd')]=_0x433da5[_0xea6c('0xd')]?_0x433da5[_0xea6c('0xd')]:undefined;this['ListId']=_0x433da5[_0xea6c('0xe')];this[_0xea6c('0xf')]=_0x433da5[_0xea6c('0xf')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x4d79=['tech','Trunk','ListId','key','name','ecm','headerinfo','localstationid','minrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x408c59,_0x347808){var _0x24bcd8=function(_0x3afdba){while(--_0x3afdba){_0x408c59['push'](_0x408c59['shift']());}};_0x24bcd8(++_0x347808);}(_0x4d79,0x10e));var _0x94d7=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0x4d79[_0x540133];return _0x26b6e9;};'use strict';function FaxAccount(_0x394acd){this['id']=_0x394acd['id']||0x0;this[_0x94d7('0x0')]=_0x394acd[_0x94d7('0x0')]||'';this['description']=_0x394acd['description'];this[_0x94d7('0x1')]=_0x394acd['ecm'];this[_0x94d7('0x2')]=_0x394acd[_0x94d7('0x2')];this[_0x94d7('0x3')]=_0x394acd[_0x94d7('0x3')];this['minrate']=_0x394acd[_0x94d7('0x4')]||0x960;this['maxrate']=_0x394acd['maxrate']||0x3840;this[_0x94d7('0x5')]=_0x394acd[_0x94d7('0x5')]||_0x94d7('0x6');this[_0x94d7('0x7')]=_0x394acd[_0x94d7('0x7')]||'no';this[_0x94d7('0x8')]=_0x394acd['faxdetect']||'no';this[_0x94d7('0x9')]=_0x394acd[_0x94d7('0x9')]||0x1388;this['tech']=_0x394acd[_0x94d7('0xa')]||'SIP';this[_0x94d7('0xb')]=_0x394acd[_0x94d7('0xb')]?_0x394acd[_0x94d7('0xb')]:undefined;this[_0x94d7('0xc')]=_0x394acd[_0x94d7('0xc')];this[_0x94d7('0xd')]=_0x394acd[_0x94d7('0xd')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 6ef3fd0..ead35c0 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 _0xbfc8=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x2b4ab5,_0x5c8451){var _0x2acfe5=function(_0x27c52c){while(--_0x27c52c){_0x2b4ab5['push'](_0x2b4ab5['shift']());}};_0x2acfe5(++_0x5c8451);}(_0xbfc8,0x1b2));var _0x8bfc=function(_0x1d75fb,_0x6646e3){_0x1d75fb=_0x1d75fb-0x0;var _0x2332b8=_0xbfc8[_0x1d75fb];return _0x2332b8;};'use strict';function FreshdeskAccount(_0x35b67a){this['id']=_0x35b67a['id']||0x0;this[_0x8bfc('0x0')]=_0x35b67a[_0x8bfc('0x0')]||'';this[_0x8bfc('0x1')]=_0x35b67a[_0x8bfc('0x1')]||'';this[_0x8bfc('0x2')]=_0x35b67a[_0x8bfc('0x3')]||'';this['remoteUri']=_0x35b67a[_0x8bfc('0x4')]||'';this[_0x8bfc('0x5')]=_0x35b67a['serverUrl']||'';this['Configurations']=_0x35b67a[_0x8bfc('0x6')]||{};}module[_0x8bfc('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x4479=['Configurations','name','username','apiKey','remoteUri','serverUrl'];(function(_0x2e2e88,_0x4bb6bf){var _0x52c753=function(_0x5ab9f3){while(--_0x5ab9f3){_0x2e2e88['push'](_0x2e2e88['shift']());}};_0x52c753(++_0x4bb6bf);}(_0x4479,0x18d));var _0x9447=function(_0x36b5ca,_0x4fa10f){_0x36b5ca=_0x36b5ca-0x0;var _0x4a4313=_0x4479[_0x36b5ca];return _0x4a4313;};'use strict';function FreshdeskAccount(_0x5619a8){this['id']=_0x5619a8['id']||0x0;this['name']=_0x5619a8[_0x9447('0x0')]||'';this['username']=_0x5619a8[_0x9447('0x1')]||'';this[_0x9447('0x2')]=_0x5619a8['token']||'';this[_0x9447('0x3')]=_0x5619a8[_0x9447('0x3')]||'';this['serverUrl']=_0x5619a8[_0x9447('0x4')]||'';this[_0x9447('0x5')]=_0x5619a8['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index c86dbee..f11c5ad 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 _0xb337=['serverUrl','Configurations','name','username','apiKey','token','remoteUri'];(function(_0x13ceed,_0xecda6a){var _0x545d11=function(_0x3f40a0){while(--_0x3f40a0){_0x13ceed['push'](_0x13ceed['shift']());}};_0x545d11(++_0xecda6a);}(_0xb337,0x175));var _0x7b33=function(_0x492cf8,_0x10f596){_0x492cf8=_0x492cf8-0x0;var _0x3ab058=_0xb337[_0x492cf8];return _0x3ab058;};'use strict';function FreshsalesAccount(_0x5a7320){this['id']=_0x5a7320['id']||0x0;this[_0x7b33('0x0')]=_0x5a7320['name']||'';this['username']=_0x5a7320[_0x7b33('0x1')]||'';this[_0x7b33('0x2')]=_0x5a7320[_0x7b33('0x3')]||'';this['remoteUri']=_0x5a7320[_0x7b33('0x4')]||'';this[_0x7b33('0x5')]=_0x5a7320['serverUrl']||'';this[_0x7b33('0x6')]=_0x5a7320[_0x7b33('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x1d3f=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x4d5689,_0x3c3925){var _0x42ea18=function(_0x1b86d7){while(--_0x1b86d7){_0x4d5689['push'](_0x4d5689['shift']());}};_0x42ea18(++_0x3c3925);}(_0x1d3f,0x1e4));var _0xf1d3=function(_0x31ce33,_0x1a7f94){_0x31ce33=_0x31ce33-0x0;var _0x32d860=_0x1d3f[_0x31ce33];return _0x32d860;};'use strict';function FreshsalesAccount(_0x4a4ae1){this['id']=_0x4a4ae1['id']||0x0;this[_0xf1d3('0x0')]=_0x4a4ae1[_0xf1d3('0x0')]||'';this['username']=_0x4a4ae1[_0xf1d3('0x1')]||'';this[_0xf1d3('0x2')]=_0x4a4ae1['token']||'';this['remoteUri']=_0x4a4ae1[_0xf1d3('0x3')]||'';this[_0xf1d3('0x4')]=_0x4a4ae1[_0xf1d3('0x4')]||'';this[_0xf1d3('0x5')]=_0x4a4ae1[_0xf1d3('0x5')]||{};}module[_0xf1d3('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 522e07c..e079994 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 _0x9a11=['lastAssignedTo','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','priority','assigned'];(function(_0x37da19,_0x24b966){var _0x47f0cb=function(_0x5763eb){while(--_0x5763eb){_0x37da19['push'](_0x37da19['shift']());}};_0x47f0cb(++_0x24b966);}(_0x9a11,0x122));var _0x19a1=function(_0x1fefe8,_0x3422b8){_0x1fefe8=_0x1fefe8-0x0;var _0x2ab965=_0x9a11[_0x1fefe8];return _0x2ab965;};'use strict';function QueueReport(){this[_0x19a1('0x0')]=_0x19a1('0x1');this[_0x19a1('0x2')]='';this[_0x19a1('0x3')]='';this[_0x19a1('0x4')]='';this[_0x19a1('0x5')]='';this[_0x19a1('0x6')]=null;this['queuecallerleaveAt']=null;this[_0x19a1('0x7')]=0x1;this[_0x19a1('0x8')]=0x1;this[_0x19a1('0x9')]=![];this[_0x19a1('0xa')]=null;this['queuecallercomplete']=![];this[_0x19a1('0xb')]=null;this[_0x19a1('0xc')]=![];this[_0x19a1('0xd')]=null;this[_0x19a1('0xe')]=0x1;this[_0x19a1('0xf')]='';this[_0x19a1('0x10')]='';this[_0x19a1('0x11')]='';this[_0x19a1('0x12')]='';this[_0x19a1('0x13')]='';this['exten']='';this[_0x19a1('0x14')]='';this['holdtime']=0x0;this[_0x19a1('0x15')]=![];this[_0x19a1('0x16')]='';this['mohtime']=0x0;this['variables']={};}module[_0x19a1('0x17')]=QueueReport; \ No newline at end of file +var _0x53e6=['variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo'];(function(_0x1eccb3,_0x3dc5d2){var _0x19b94a=function(_0x19f9a9){while(--_0x19f9a9){_0x1eccb3['push'](_0x1eccb3['shift']());}};_0x19b94a(++_0x3dc5d2);}(_0x53e6,0x178));var _0x653e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x53e6[_0x4b369d];return _0x571a98;};'use strict';function QueueReport(){this[_0x653e('0x0')]=_0x653e('0x1');this[_0x653e('0x2')]='';this[_0x653e('0x3')]='';this[_0x653e('0x4')]='';this['queue']='';this[_0x653e('0x5')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this['count']=0x1;this[_0x653e('0x6')]=![];this[_0x653e('0x7')]=null;this[_0x653e('0x8')]=![];this[_0x653e('0x9')]=null;this[_0x653e('0xa')]=![];this['queuecallerexitAt']=null;this[_0x653e('0xb')]=0x1;this[_0x653e('0xc')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x653e('0xd')]='';this[_0x653e('0xe')]='';this[_0x653e('0xf')]='';this[_0x653e('0x10')]='';this[_0x653e('0x11')]=0x0;this[_0x653e('0x12')]=![];this[_0x653e('0x13')]='';this['mohtime']=0x0;this[_0x653e('0x14')]={};}module[_0x653e('0x15')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 8968e66..1038877 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 _0x4add=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name','username'];(function(_0x56a0fe,_0x117eba){var _0x1d46f1=function(_0x2a7dae){while(--_0x2a7dae){_0x56a0fe['push'](_0x56a0fe['shift']());}};_0x1d46f1(++_0x117eba);}(_0x4add,0x153));var _0xd4ad=function(_0x2276f4,_0x21912b){_0x2276f4=_0x2276f4-0x0;var _0x285e38=_0x4add[_0x2276f4];return _0x285e38;};'use strict';function SalesforceAccount(_0x576959){this['id']=_0x576959['id']||0x0;this['name']=_0x576959[_0xd4ad('0x0')]||'';this[_0xd4ad('0x1')]=_0x576959['username']||'';this[_0xd4ad('0x2')]=_0x576959[_0xd4ad('0x2')]||'';this[_0xd4ad('0x3')]=_0x576959[_0xd4ad('0x3')]||'';this[_0xd4ad('0x4')]=_0x576959[_0xd4ad('0x4')]||'';this[_0xd4ad('0x5')]=_0x576959[_0xd4ad('0x5')]||'';this[_0xd4ad('0x6')]=_0x576959[_0xd4ad('0x6')]||'';this[_0xd4ad('0x7')]=_0x576959[_0xd4ad('0x7')]||_0xd4ad('0x8');this[_0xd4ad('0x9')]=_0x576959[_0xd4ad('0x9')]||'';this['Configurations']=_0x576959[_0xd4ad('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x9606=['exports','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9606,0x1af));var _0x6960=function(_0x2e20f2,_0x30b124){_0x2e20f2=_0x2e20f2-0x0;var _0x53c611=_0x9606[_0x2e20f2];return _0x53c611;};'use strict';function SalesforceAccount(_0x21fdb5){this['id']=_0x21fdb5['id']||0x0;this['name']=_0x21fdb5['name']||'';this['username']=_0x21fdb5[_0x6960('0x0')]||'';this[_0x6960('0x1')]=_0x21fdb5[_0x6960('0x1')]||'';this['password']=_0x21fdb5[_0x6960('0x2')]||'';this[_0x6960('0x3')]=_0x21fdb5[_0x6960('0x3')]||'';this[_0x6960('0x4')]=_0x21fdb5[_0x6960('0x4')]||'';this[_0x6960('0x5')]=_0x21fdb5[_0x6960('0x5')]||'';this[_0x6960('0x6')]=_0x21fdb5[_0x6960('0x6')]||_0x6960('0x7');this[_0x6960('0x8')]=_0x21fdb5[_0x6960('0x8')]||'';this['Configurations']=_0x21fdb5['Configurations']||{};}module[_0x6960('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index e7f5c3c..a4ef7ee 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 _0xe3a9=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x241c04,_0x321135){var _0x1828ea=function(_0x803eba){while(--_0x803eba){_0x241c04['push'](_0x241c04['shift']());}};_0x1828ea(++_0x321135);}(_0xe3a9,0x128));var _0x9e3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe3a9[_0x3dd15e];return _0x231fd0;};'use strict';function ServicenowAccount(_0x336376){this['id']=_0x336376['id']||0x0;this[_0x9e3a('0x0')]=_0x336376['name']||'';this[_0x9e3a('0x1')]=_0x336376['username']||'';this[_0x9e3a('0x2')]=_0x336376[_0x9e3a('0x2')]||'';this[_0x9e3a('0x3')]=_0x336376[_0x9e3a('0x3')]||'';this[_0x9e3a('0x4')]=_0x336376[_0x9e3a('0x4')]||'';this[_0x9e3a('0x5')]=_0x336376[_0x9e3a('0x5')]||{};}module[_0x9e3a('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x0893=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x1a635e,_0x241651){var _0x5b3345=function(_0x5d94d8){while(--_0x5d94d8){_0x1a635e['push'](_0x1a635e['shift']());}};_0x5b3345(++_0x241651);}(_0x0893,0xc7));var _0x3089=function(_0x315434,_0x54ec22){_0x315434=_0x315434-0x0;var _0x32ca82=_0x0893[_0x315434];return _0x32ca82;};'use strict';function ServicenowAccount(_0x3029ec){this['id']=_0x3029ec['id']||0x0;this[_0x3089('0x0')]=_0x3029ec['name']||'';this[_0x3089('0x1')]=_0x3029ec[_0x3089('0x1')]||'';this[_0x3089('0x2')]=_0x3029ec['password']||'';this[_0x3089('0x3')]=_0x3029ec[_0x3089('0x3')]||'';this[_0x3089('0x4')]=_0x3029ec['serverUrl']||'';this[_0x3089('0x5')]=_0x3029ec['Configurations']||{};}module[_0x3089('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index f872959..d3fc799 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 _0x05cd=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0xf023c1,_0x2726eb){var _0x5dac5a=function(_0x1e89de){while(--_0x1e89de){_0xf023c1['push'](_0xf023c1['shift']());}};_0x5dac5a(++_0x2726eb);}(_0x05cd,0x1c8));var _0xd05c=function(_0x2175a3,_0x426e08){_0x2175a3=_0x2175a3-0x0;var _0x3d308b=_0x05cd[_0x2175a3];return _0x3d308b;};'use strict';function SugarcrmAccount(_0x4641bf){this['id']=_0x4641bf['id']||0x0;this[_0xd05c('0x0')]=_0x4641bf[_0xd05c('0x0')]||'';this['username']=_0x4641bf[_0xd05c('0x1')]||'';this[_0xd05c('0x2')]=_0x4641bf[_0xd05c('0x2')]||'';this[_0xd05c('0x3')]=_0x4641bf[_0xd05c('0x3')]||'';this[_0xd05c('0x4')]=_0x4641bf['serverUrl']||'';this['Configurations']=_0x4641bf[_0xd05c('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x60d7=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x4b7ff7,_0x305f98){var _0x3b0227=function(_0xd1784c){while(--_0xd1784c){_0x4b7ff7['push'](_0x4b7ff7['shift']());}};_0x3b0227(++_0x305f98);}(_0x60d7,0x190));var _0x760d=function(_0x55f308,_0x1719e8){_0x55f308=_0x55f308-0x0;var _0x1eeb98=_0x60d7[_0x55f308];return _0x1eeb98;};'use strict';function SugarcrmAccount(_0x2f3ebf){this['id']=_0x2f3ebf['id']||0x0;this['name']=_0x2f3ebf[_0x760d('0x0')]||'';this['username']=_0x2f3ebf[_0x760d('0x1')]||'';this['password']=_0x2f3ebf[_0x760d('0x2')]||'';this[_0x760d('0x3')]=_0x2f3ebf[_0x760d('0x3')]||'';this[_0x760d('0x4')]=_0x2f3ebf[_0x760d('0x4')]||'';this[_0x760d('0x5')]=_0x2f3ebf[_0x760d('0x5')]||{};}module[_0x760d('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 e10f959..76ec295 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 _0xd0d3=['status','address','name','accountcode','state','unknown','stateTime'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd0d3,0x175));var _0x3d0d=function(_0x548b35,_0x13e9ce){_0x548b35=_0x548b35-0x0;var _0x2089a6=_0xd0d3[_0x548b35];return _0x2089a6;};'use strict';function Telephone(_0x4c72cc){this['id']=_0x4c72cc['id']||0x0;this[_0x3d0d('0x0')]=_0x4c72cc[_0x3d0d('0x0')]||'';this[_0x3d0d('0x1')]=_0x4c72cc['accountcode']||'';this[_0x3d0d('0x2')]=_0x3d0d('0x3');this[_0x3d0d('0x4')]=0x0;this[_0x3d0d('0x5')]=_0x3d0d('0x3');this[_0x3d0d('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x1576=['name','accountcode','stateTime','status','unknown','address','exports'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x1576,0x142));var _0x6157=function(_0x14e001,_0x569bf){_0x14e001=_0x14e001-0x0;var _0x2c09da=_0x1576[_0x14e001];return _0x2c09da;};'use strict';function Telephone(_0x172de4){this['id']=_0x172de4['id']||0x0;this[_0x6157('0x0')]=_0x172de4['name']||'';this[_0x6157('0x1')]=_0x172de4['accountcode']||'';this['state']='unknown';this[_0x6157('0x2')]=0x0;this[_0x6157('0x3')]=_0x6157('0x4');this[_0x6157('0x5')]='';}module[_0x6157('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 3fca31b..17e01e3 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 _0x5455=['html','exports','name'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5455,0x197));var _0x5545=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5455[_0x8c43de];return _0xa6591b;};'use strict';function template(_0x46c43f){this['id']=_0x46c43f['id']||0x0;this[_0x5545('0x0')]=_0x46c43f[_0x5545('0x0')]||'';this[_0x5545('0x1')]=_0x46c43f[_0x5545('0x1')]||'';}module[_0x5545('0x2')]=template; \ No newline at end of file +var _0x7973=['name','html'];(function(_0x5dc4f7,_0x1967d9){var _0x530021=function(_0x27363a){while(--_0x27363a){_0x5dc4f7['push'](_0x5dc4f7['shift']());}};_0x530021(++_0x1967d9);}(_0x7973,0x17c));var _0x3797=function(_0x52516a,_0x408e5e){_0x52516a=_0x52516a-0x0;var _0x541ee2=_0x7973[_0x52516a];return _0x541ee2;};'use strict';function template(_0x49b3d7){this['id']=_0x49b3d7['id']||0x0;this[_0x3797('0x0')]=_0x49b3d7[_0x3797('0x0')]||'';this[_0x3797('0x1')]=_0x49b3d7['html']||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index ad150f3..0499d32 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 _0x55ca=['name','voice','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x55ca,0x126));var _0xa55c=function(_0x9cbfe0,_0x56aada){_0x9cbfe0=_0x9cbfe0-0x0;var _0x1f1534=_0x55ca[_0x9cbfe0];return _0x1f1534;};'use strict';function Trigger(_0x53d0d7){this['id']=_0x53d0d7['id']||0x0;this[_0xa55c('0x0')]=_0x53d0d7['name']||'';this['channel']=_0x53d0d7['channel']||_0xa55c('0x1');this[_0xa55c('0x2')]=_0x53d0d7['status']||![];this[_0xa55c('0x3')]=_0x53d0d7[_0xa55c('0x3')]||[];this[_0xa55c('0x4')]=_0x53d0d7[_0xa55c('0x4')]||[];this[_0xa55c('0x5')]=_0x53d0d7[_0xa55c('0x5')]||[];}module[_0xa55c('0x6')]=Trigger; \ No newline at end of file +var _0xedd9=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x476f73,_0x2a7695){var _0x150b12=function(_0x23fda9){while(--_0x23fda9){_0x476f73['push'](_0x476f73['shift']());}};_0x150b12(++_0x2a7695);}(_0xedd9,0xfc));var _0x9edd=function(_0x453ccf,_0x4ed71d){_0x453ccf=_0x453ccf-0x0;var _0x1c6582=_0xedd9[_0x453ccf];return _0x1c6582;};'use strict';function Trigger(_0x265eb8){this['id']=_0x265eb8['id']||0x0;this[_0x9edd('0x0')]=_0x265eb8[_0x9edd('0x0')]||'';this[_0x9edd('0x1')]=_0x265eb8[_0x9edd('0x1')]||_0x9edd('0x2');this[_0x9edd('0x3')]=_0x265eb8[_0x9edd('0x3')]||![];this[_0x9edd('0x4')]=_0x265eb8['AllConditions']||[];this[_0x9edd('0x5')]=_0x265eb8[_0x9edd('0x5')]||[];this[_0x9edd('0x6')]=_0x265eb8[_0x9edd('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 1fe9896..25afbc9 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 _0xcba2=['host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf'];(function(_0xb5f126,_0x258eda){var _0x4a851a=function(_0x446f7f){while(--_0x446f7f){_0xb5f126['push'](_0xb5f126['shift']());}};_0x4a851a(++_0x258eda);}(_0xcba2,0x118));var _0x2cba=function(_0x5b4f0f,_0x419771){_0x5b4f0f=_0x5b4f0f-0x0;var _0x826688=_0xcba2[_0x5b4f0f];return _0x826688;};'use strict';function Trunk(_0x2b144a){this['id']=_0x2b144a['id']||0x0;this['active']=_0x2b144a[_0x2cba('0x0')]||![];this[_0x2cba('0x1')]=_0x2b144a['name']||'';this[_0x2cba('0x2')]=_0x2cba('0x3');this[_0x2cba('0x4')]=0x0;this[_0x2cba('0x5')]='unknown';this[_0x2cba('0x6')]=_0x2b144a['registry']&&_0x2b144a['registry'][_0x2cba('0x7')](':')?_0x2b144a[_0x2cba('0x6')]['split'](':')[0x0]:'';this[_0x2cba('0x8')]='';this[_0x2cba('0x9')]='';this[_0x2cba('0xa')]='';this[_0x2cba('0xb')]='';this[_0x2cba('0xc')]='';this[_0x2cba('0xd')]='unknown';this[_0x2cba('0xe')]='';this[_0x2cba('0xf')]='';this['defaultuser']=_0x2b144a[_0x2cba('0x10')]||'';}module[_0x2cba('0x11')]=Trunk; \ No newline at end of file +var _0x24ee=['host','port','domain','refresh','stateRegistry','registrationtime','address','defaultuser','exports','name','state','unknown','stateTime','status','registry','indexOf','split'];(function(_0x1a0a74,_0x29554c){var _0x571aa3=function(_0x46d3b0){while(--_0x46d3b0){_0x1a0a74['push'](_0x1a0a74['shift']());}};_0x571aa3(++_0x29554c);}(_0x24ee,0x1b2));var _0xe24e=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x24ee[_0x541ea6];return _0x3c3e84;};'use strict';function Trunk(_0x576de9){this['id']=_0x576de9['id']||0x0;this['active']=_0x576de9['active']||![];this['name']=_0x576de9[_0xe24e('0x0')]||'';this[_0xe24e('0x1')]=_0xe24e('0x2');this[_0xe24e('0x3')]=0x0;this[_0xe24e('0x4')]=_0xe24e('0x2');this[_0xe24e('0x5')]=_0x576de9[_0xe24e('0x5')]&&_0x576de9['registry'][_0xe24e('0x6')](':')?_0x576de9[_0xe24e('0x5')][_0xe24e('0x7')](':')[0x0]:'';this[_0xe24e('0x8')]='';this[_0xe24e('0x9')]='';this[_0xe24e('0xa')]='';this['domainport']='';this[_0xe24e('0xb')]='';this[_0xe24e('0xc')]='unknown';this[_0xe24e('0xd')]='';this[_0xe24e('0xe')]='';this[_0xe24e('0xf')]=_0x576de9['defaultuser']||'';}module[_0xe24e('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 64aefb8..6b6d38f 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. * // * * // ************************************************************************* -'use strict';function voiceExtension(_0x941855){this['id']=_0x941855['id']||0x0;this['exten']=_0x941855['exten']||'';this['recordingFormat']=_0x941855['recordingFormat']||'none';this['mandatoryDisposition']=_0x941855['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x91f8=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x265756,_0x298c09){var _0x4efaa5=function(_0x19e3b4){while(--_0x19e3b4){_0x265756['push'](_0x265756['shift']());}};_0x4efaa5(++_0x298c09);}(_0x91f8,0x95));var _0x891f=function(_0x37dbf3,_0x4ad77d){_0x37dbf3=_0x37dbf3-0x0;var _0x1cda9b=_0x91f8[_0x37dbf3];return _0x1cda9b;};'use strict';function voiceExtension(_0x1e0117){this['id']=_0x1e0117['id']||0x0;this[_0x891f('0x0')]=_0x1e0117[_0x891f('0x0')]||'';this['recordingFormat']=_0x1e0117[_0x891f('0x1')]||_0x891f('0x2');this[_0x891f('0x3')]=_0x1e0117[_0x891f('0x3')]||![];}module[_0x891f('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 7b8789c..506f9a0 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 _0x7a54=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','waiting','talking','answered','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x74958f,_0x31c9d8){var _0x485474=function(_0x3c868e){while(--_0x3c868e){_0x74958f['push'](_0x74958f['shift']());}};_0x485474(++_0x31c9d8);}(_0x7a54,0x106));var _0x47a5=function(_0x4756e6,_0x548b74){_0x4756e6=_0x4756e6-0x0;var _0x1621d9=_0x7a54[_0x4756e6];return _0x1621d9;};'use strict';var statusDesc=[_0x47a5('0x0'),_0x47a5('0x1'),_0x47a5('0x2'),'busy',_0x47a5('0x3'),_0x47a5('0x4'),'ringing',_0x47a5('0x5'),_0x47a5('0x6')];var monitorFormat={'wav':_0x47a5('0x7'),'wav49':_0x47a5('0x8'),'gsm':_0x47a5('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x47a5('0xa')};function VoiceQueue(_0x59199c){this['id']=_0x59199c['id']||0x0;this[_0x47a5('0xb')]=_0x59199c[_0x47a5('0xb')]||'';this['monitor_format']=_0x59199c[_0x47a5('0xc')]||'';this['type']=_0x59199c['type']||'inbound';this[_0x47a5('0xd')]=0x0;this[_0x47a5('0xe')]=0x0;this['total']=0x0;this[_0x47a5('0xf')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x47a5('0x10')]=0x0;this[_0x47a5('0x11')]=0x0;this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;this[_0x47a5('0x14')]=0x0;this[_0x47a5('0x15')]=_0x59199c[_0x47a5('0x15')]||![];this['acwTimeout']=_0x59199c[_0x47a5('0x16')]||0xa;this[_0x47a5('0x17')]=_0x59199c[_0x47a5('0x17')]||'no';this[_0x47a5('0x18')]=!![];this[_0x47a5('0x19')]='';this[_0x47a5('0x1a')]=0x0;this[_0x47a5('0x1b')]=0x0;this[_0x47a5('0x1c')]=_0x59199c['dialTimezone']||null;this[_0x47a5('0x1d')]=_0x59199c[_0x47a5('0x1d')]?_0x59199c[_0x47a5('0x1d')]:null;this[_0x47a5('0x1e')]=_0x59199c[_0x47a5('0x1e')];this['dialMethod']=_0x59199c['dialMethod']||_0x47a5('0x1f');this['dialLimitChannel']=_0x59199c['dialLimitChannel']||0x0;this[_0x47a5('0x20')]=_0x59199c[_0x47a5('0x20')]||0x0;this[_0x47a5('0x21')]=_0x59199c[_0x47a5('0x21')]||0x1;this[_0x47a5('0x22')]=_0x59199c[_0x47a5('0x22')]||_0x47a5('0x23');this[_0x47a5('0x24')]=_0x59199c[_0x47a5('0x24')]||0.03;this['dialPredictiveInterval']=_0x59199c[_0x47a5('0x25')]||0x258;this[_0x47a5('0x26')]=_0x59199c['dialOriginateCallerIdName']||_0x47a5('0x27');this[_0x47a5('0x28')]=_0x59199c[_0x47a5('0x28')]||'anonymous';this[_0x47a5('0x29')]=_0x59199c[_0x47a5('0x29')]||0x1e;this[_0x47a5('0x2a')]=_0x59199c[_0x47a5('0x2a')]||'tTxX';this[_0x47a5('0x2b')]=_0x59199c[_0x47a5('0x2b')]||0x3;this['dialQueueProject']=_0x59199c[_0x47a5('0x2c')]||undefined;this[_0x47a5('0x2d')]=_0x59199c[_0x47a5('0x2d')]||0x3;this[_0x47a5('0x2e')]=_0x59199c[_0x47a5('0x2e')]||0x96;this['dialBusyMaxRetry']=_0x59199c['dialBusyMaxRetry']||0x3;this[_0x47a5('0x2f')]=_0x59199c['dialBusyRetryFrequency']||0x96;this[_0x47a5('0x30')]=_0x59199c['dialNoAnswerMaxRetry']||0x3;this[_0x47a5('0x31')]=_0x59199c[_0x47a5('0x31')]||0x96;this[_0x47a5('0x32')]=_0x59199c[_0x47a5('0x32')]||0x3;this[_0x47a5('0x33')]=_0x59199c[_0x47a5('0x33')]||0x96;this[_0x47a5('0x34')]=_0x59199c[_0x47a5('0x34')]||0x3;this[_0x47a5('0x35')]=_0x59199c[_0x47a5('0x35')]||0x96;this[_0x47a5('0x36')]=_0x59199c[_0x47a5('0x36')]||0x3;this[_0x47a5('0x37')]=_0x59199c['dialAbandonedRetryFrequency']||0x96;this[_0x47a5('0x38')]=_0x59199c['dialMachineMaxRetry']||0x3;this[_0x47a5('0x39')]=_0x59199c[_0x47a5('0x39')]||0x96;this[_0x47a5('0x3a')]=_0x59199c['dialAgentRejectMaxRetry']||0x3;this[_0x47a5('0x3b')]=_0x59199c[_0x47a5('0x3b')]||0x96;this[_0x47a5('0x3c')]=_0x59199c[_0x47a5('0x3c')]||0x3;this['dialGlobalMaxRetry']=_0x59199c['dialGlobalMaxRetry']||0x4;this[_0x47a5('0x3d')]=_0x59199c[_0x47a5('0x3d')]?_0x59199c['Trunk']:undefined;this['TrunkBackup']=_0x59199c[_0x47a5('0x3e')]?_0x59199c[_0x47a5('0x3e')]:undefined;this['dialPrefix']=_0x59199c[_0x47a5('0x3f')]||undefined;this['Interval']=_0x59199c[_0x47a5('0x40')]?_0x59199c[_0x47a5('0x40')]:undefined;this['dialOrderByScheduledAt']=_0x59199c['dialOrderByScheduledAt']||_0x47a5('0x41');this['dialRandomLastDigitCallerIdNumber']=_0x59199c[_0x47a5('0x42')]||undefined;this[_0x47a5('0x43')]=_0x59199c[_0x47a5('0x43')]||undefined;this['strategy']=strategy[_0x59199c[_0x47a5('0x44')]]||'rrmemory';this['queueStatusComplete']=!![];this[_0x47a5('0x45')]=_0x59199c['dialAMDActive']||![];this[_0x47a5('0x46')]=_0x59199c['dialAMDInitialSilence'];this[_0x47a5('0x47')]=_0x59199c[_0x47a5('0x47')];this[_0x47a5('0x48')]=_0x59199c[_0x47a5('0x48')];this[_0x47a5('0x49')]=_0x59199c[_0x47a5('0x49')];this[_0x47a5('0x4a')]=_0x59199c[_0x47a5('0x4a')];this[_0x47a5('0x4b')]=_0x59199c['dialAMDBetweenWordsSilence'];this[_0x47a5('0x4c')]=_0x59199c[_0x47a5('0x4c')];this['dialAMDSilenceThreshold']=_0x59199c[_0x47a5('0x4d')];this[_0x47a5('0x4e')]=_0x59199c[_0x47a5('0x4e')];this['outboundRejectCallsDay']=0x0;this[_0x47a5('0x4f')]=0x0;this[_0x47a5('0x50')]=_0x59199c['timeout'];this[_0x47a5('0x51')]=0x0;this[_0x47a5('0x52')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x47a5('0x53')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x47a5('0x54')]=0x0;this[_0x47a5('0x55')]=0x0;this[_0x47a5('0x56')]=0x0;this[_0x47a5('0x57')]=0x0;this[_0x47a5('0x58')]=0x0;this[_0x47a5('0x59')]=0x0;this[_0x47a5('0x5a')]=0x0;this[_0x47a5('0x5b')]=undefined;this[_0x47a5('0x5c')]=undefined;this[_0x47a5('0x5d')]=undefined;this[_0x47a5('0x5e')]=1.05;this[_0x47a5('0x5f')]=0x0;this[_0x47a5('0x60')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x47a5('0x61')]=0x0;this[_0x47a5('0x62')]=0x0;this[_0x47a5('0x63')]=0x0;this[_0x47a5('0x64')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x47a5('0x65')]=_0x59199c['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x59199c['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x47a5('0x66')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x47a5('0x67')]=0x0;this[_0x47a5('0x68')]=0x0;this[_0x47a5('0x69')]=0x0;this['erlangBusyFactor']=0x0;this[_0x47a5('0x6a')]=_0x59199c[_0x47a5('0x6a')]||0x1e;this['dialRecallInQueue']=_0x59199c['dialRecallInQueue']||![];this[_0x47a5('0x6b')]=_0x59199c['dialQueueProject2']||undefined;this[_0x47a5('0x6c')]=_0x59199c[_0x47a5('0x6c')]||![];this[_0x47a5('0x6d')]=_0x59199c[_0x47a5('0x6d')]||![];this[_0x47a5('0xc')]=monitorFormat[_0x59199c[_0x47a5('0xc')]]?monitorFormat[_0x59199c[_0x47a5('0xc')]]:undefined;this[_0x47a5('0x6e')]=_0x59199c[_0x47a5('0x6e')]||![];this[_0x47a5('0x6f')]=_0x59199c[_0x47a5('0x6f')]?_0x59199c[_0x47a5('0x6f')]:undefined;}module[_0x47a5('0x70')]=VoiceQueue; \ No newline at end of file +var _0x5f2f=['wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse'];(function(_0x149bb0,_0x2cbeba){var _0x41cfb9=function(_0x176084){while(--_0x176084){_0x149bb0['push'](_0x149bb0['shift']());}};_0x41cfb9(++_0x2cbeba);}(_0x5f2f,0x73));var _0xf5f2=function(_0x374e84,_0x1260ed){_0x374e84=_0x374e84-0x0;var _0x162826=_0x5f2f[_0x374e84];return _0x162826;};'use strict';var statusDesc=[_0xf5f2('0x0'),_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3'),_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'onhold'];var monitorFormat={'wav':'wav','wav49':_0xf5f2('0x8'),'gsm':_0xf5f2('0x9')};var strategy={'rrmemory':_0xf5f2('0xa'),'roundrobin':_0xf5f2('0xb')};function VoiceQueue(_0x3133bc){this['id']=_0x3133bc['id']||0x0;this[_0xf5f2('0xc')]=_0x3133bc['name']||'';this[_0xf5f2('0xd')]=_0x3133bc[_0xf5f2('0xd')]||'';this[_0xf5f2('0xe')]=_0x3133bc['type']||_0xf5f2('0xf');this[_0xf5f2('0x10')]=0x0;this[_0xf5f2('0x11')]=0x0;this['total']=0x0;this[_0xf5f2('0x12')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0xf5f2('0x13')]=0x0;this[_0xf5f2('0x14')]=0x0;this['abandoned']=0x0;this[_0xf5f2('0x15')]=0x0;this[_0xf5f2('0x16')]=0x0;this[_0xf5f2('0x17')]=_0x3133bc[_0xf5f2('0x17')]||![];this[_0xf5f2('0x18')]=_0x3133bc[_0xf5f2('0x18')]||0xa;this['autopause']=_0x3133bc[_0xf5f2('0x19')]||'no';this[_0xf5f2('0x1a')]=!![];this[_0xf5f2('0x1b')]='';this[_0xf5f2('0x1c')]=0x0;this[_0xf5f2('0x1d')]=0x0;this['dialTimezone']=_0x3133bc[_0xf5f2('0x1e')]||null;this[_0xf5f2('0x1f')]=_0x3133bc[_0xf5f2('0x1f')]?_0x3133bc[_0xf5f2('0x1f')]:null;this[_0xf5f2('0x20')]=_0x3133bc[_0xf5f2('0x20')];this[_0xf5f2('0x21')]=_0x3133bc[_0xf5f2('0x21')]||_0xf5f2('0x22');this[_0xf5f2('0x23')]=_0x3133bc[_0xf5f2('0x23')]||0x0;this[_0xf5f2('0x24')]=_0x3133bc[_0xf5f2('0x24')]||0x0;this[_0xf5f2('0x25')]=_0x3133bc[_0xf5f2('0x25')]||0x1;this[_0xf5f2('0x26')]=_0x3133bc[_0xf5f2('0x26')]||'dropRate';this[_0xf5f2('0x27')]=_0x3133bc[_0xf5f2('0x27')]||0.03;this['dialPredictiveInterval']=_0x3133bc['dialPredictiveInterval']||0x258;this[_0xf5f2('0x28')]=_0x3133bc[_0xf5f2('0x28')]||'anonymous';this[_0xf5f2('0x29')]=_0x3133bc[_0xf5f2('0x29')]||_0xf5f2('0x2a');this[_0xf5f2('0x2b')]=_0x3133bc[_0xf5f2('0x2b')]||0x1e;this['dialQueueOptions']=_0x3133bc[_0xf5f2('0x2c')]||_0xf5f2('0x2d');this[_0xf5f2('0x2e')]=_0x3133bc[_0xf5f2('0x2e')]||0x3;this[_0xf5f2('0x2f')]=_0x3133bc['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x3133bc[_0xf5f2('0x30')]||0x3;this[_0xf5f2('0x31')]=_0x3133bc[_0xf5f2('0x31')]||0x96;this[_0xf5f2('0x32')]=_0x3133bc[_0xf5f2('0x32')]||0x3;this[_0xf5f2('0x33')]=_0x3133bc[_0xf5f2('0x33')]||0x96;this[_0xf5f2('0x34')]=_0x3133bc[_0xf5f2('0x34')]||0x3;this['dialNoAnswerRetryFrequency']=_0x3133bc[_0xf5f2('0x35')]||0x96;this[_0xf5f2('0x36')]=_0x3133bc[_0xf5f2('0x36')]||0x3;this[_0xf5f2('0x37')]=_0x3133bc[_0xf5f2('0x37')]||0x96;this[_0xf5f2('0x38')]=_0x3133bc['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x3133bc[_0xf5f2('0x39')]||0x96;this[_0xf5f2('0x3a')]=_0x3133bc[_0xf5f2('0x3a')]||0x3;this['dialAbandonedRetryFrequency']=_0x3133bc['dialAbandonedRetryFrequency']||0x96;this[_0xf5f2('0x3b')]=_0x3133bc[_0xf5f2('0x3b')]||0x3;this[_0xf5f2('0x3c')]=_0x3133bc[_0xf5f2('0x3c')]||0x96;this[_0xf5f2('0x3d')]=_0x3133bc['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x3133bc[_0xf5f2('0x3e')]||0x96;this['callAdditionalPhoneAfterMin']=_0x3133bc[_0xf5f2('0x3f')]||0x3;this['dialGlobalMaxRetry']=_0x3133bc[_0xf5f2('0x40')]||0x4;this[_0xf5f2('0x41')]=_0x3133bc[_0xf5f2('0x41')]?_0x3133bc[_0xf5f2('0x41')]:undefined;this[_0xf5f2('0x42')]=_0x3133bc[_0xf5f2('0x42')]?_0x3133bc[_0xf5f2('0x42')]:undefined;this[_0xf5f2('0x43')]=_0x3133bc['dialPrefix']||undefined;this[_0xf5f2('0x44')]=_0x3133bc[_0xf5f2('0x44')]?_0x3133bc[_0xf5f2('0x44')]:undefined;this[_0xf5f2('0x45')]=_0x3133bc[_0xf5f2('0x45')]||_0xf5f2('0x46');this[_0xf5f2('0x47')]=_0x3133bc['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xf5f2('0x48')]=_0x3133bc[_0xf5f2('0x48')]||undefined;this['strategy']=strategy[_0x3133bc[_0xf5f2('0x49')]]||'rrmemory';this[_0xf5f2('0x4a')]=!![];this[_0xf5f2('0x4b')]=_0x3133bc[_0xf5f2('0x4b')]||![];this[_0xf5f2('0x4c')]=_0x3133bc['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x3133bc[_0xf5f2('0x4d')];this[_0xf5f2('0x4e')]=_0x3133bc[_0xf5f2('0x4e')];this['dialAMDTotalAnalysisTime']=_0x3133bc[_0xf5f2('0x4f')];this['dialAMDMinWordLength']=_0x3133bc[_0xf5f2('0x50')];this['dialAMDBetweenWordsSilence']=_0x3133bc[_0xf5f2('0x51')];this[_0xf5f2('0x52')]=_0x3133bc['dialAMDMaximumNumberOfWords'];this[_0xf5f2('0x53')]=_0x3133bc[_0xf5f2('0x53')];this[_0xf5f2('0x54')]=_0x3133bc[_0xf5f2('0x54')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this[_0xf5f2('0x55')]=_0x3133bc[_0xf5f2('0x55')];this[_0xf5f2('0x56')]=0x0;this[_0xf5f2('0x57')]=0x0;this[_0xf5f2('0x58')]=0x0;this[_0xf5f2('0x59')]=0x0;this[_0xf5f2('0x5a')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xf5f2('0x5b')]=0x0;this[_0xf5f2('0x5c')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xf5f2('0x5d')]=0x0;this[_0xf5f2('0x5e')]=0x0;this[_0xf5f2('0x5f')]=0x0;this[_0xf5f2('0x60')]=0x0;this[_0xf5f2('0x61')]=0x0;this[_0xf5f2('0x62')]=undefined;this[_0xf5f2('0x63')]=undefined;this[_0xf5f2('0x64')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xf5f2('0x65')]=0x0;this[_0xf5f2('0x66')]=0x0;this[_0xf5f2('0x67')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xf5f2('0x68')]=0x0;this[_0xf5f2('0x69')]=0x0;this['predictiveIntervalMaxThreshold']=_0x3133bc[_0xf5f2('0x6a')]||0x14;this[_0xf5f2('0x6b')]=_0x3133bc[_0xf5f2('0x6a')]||0xa;this[_0xf5f2('0x6c')]=0x0;this[_0xf5f2('0x6d')]=0x0;this[_0xf5f2('0x6e')]=0x1;this[_0xf5f2('0x6f')]=0x0;this[_0xf5f2('0x70')]=0x0;this[_0xf5f2('0x71')]=0x0;this[_0xf5f2('0x72')]=0x0;this[_0xf5f2('0x73')]=_0x3133bc[_0xf5f2('0x73')]||0x1e;this[_0xf5f2('0x74')]=_0x3133bc[_0xf5f2('0x74')]||![];this['dialQueueProject2']=_0x3133bc[_0xf5f2('0x75')]||undefined;this['dialAgiAfterHangupClient']=_0x3133bc[_0xf5f2('0x76')]||![];this[_0xf5f2('0x77')]=_0x3133bc[_0xf5f2('0x77')]||![];this[_0xf5f2('0xd')]=monitorFormat[_0x3133bc[_0xf5f2('0xd')]]?monitorFormat[_0x3133bc[_0xf5f2('0xd')]]:undefined;this['mandatoryDisposition']=_0x3133bc[_0xf5f2('0x78')]||![];this[_0xf5f2('0x79')]=_0x3133bc[_0xf5f2('0x79')]?_0x3133bc[_0xf5f2('0x79')]:undefined;}module[_0xf5f2('0x7a')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 93d5773..c5995c3 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 _0x7a73=['exports','name','username','accessKey'];(function(_0x94b760,_0x1dbbfe){var _0x5dfb70=function(_0x23f6bd){while(--_0x23f6bd){_0x94b760['push'](_0x94b760['shift']());}};_0x5dfb70(++_0x1dbbfe);}(_0x7a73,0x65));var _0x37a7=function(_0x2a5407,_0x56cf97){_0x2a5407=_0x2a5407-0x0;var _0x45c79d=_0x7a73[_0x2a5407];return _0x45c79d;};'use strict';function VtigerAccount(_0x129464){this['id']=_0x129464['id']||0x0;this[_0x37a7('0x0')]=_0x129464[_0x37a7('0x0')]||'';this[_0x37a7('0x1')]=_0x129464[_0x37a7('0x1')]||'';this[_0x37a7('0x2')]=_0x129464[_0x37a7('0x2')]||'';this['remoteUri']=_0x129464['remoteUri']||'';this['serverUrl']=_0x129464['serverUrl']||'';this['Configurations']=_0x129464['Configurations']||{};}module[_0x37a7('0x3')]=VtigerAccount; \ No newline at end of file +var _0xbd54=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x4bee6d,_0x3fbc90){var _0x2f2ea4=function(_0xff81b){while(--_0xff81b){_0x4bee6d['push'](_0x4bee6d['shift']());}};_0x2f2ea4(++_0x3fbc90);}(_0xbd54,0x1d6));var _0x4bd5=function(_0x22bf47,_0x5b3cfd){_0x22bf47=_0x22bf47-0x0;var _0x63e280=_0xbd54[_0x22bf47];return _0x63e280;};'use strict';function VtigerAccount(_0x5ac262){this['id']=_0x5ac262['id']||0x0;this[_0x4bd5('0x0')]=_0x5ac262[_0x4bd5('0x0')]||'';this['username']=_0x5ac262[_0x4bd5('0x1')]||'';this[_0x4bd5('0x2')]=_0x5ac262[_0x4bd5('0x2')]||'';this[_0x4bd5('0x3')]=_0x5ac262['remoteUri']||'';this[_0x4bd5('0x4')]=_0x5ac262[_0x4bd5('0x4')]||'';this[_0x4bd5('0x5')]=_0x5ac262['Configurations']||{};}module[_0x4bd5('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 0ad04cc..e7a494a 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 _0xadb5=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadb5,0xad));var _0x5adb=function(_0x457365,_0x5c5706){_0x457365=_0x457365-0x0;var _0x28f7fa=_0xadb5[_0x457365];return _0x28f7fa;};'use strict';function ZendeskAccount(_0x1f969c){this['id']=_0x1f969c['id']||0x0;this[_0x5adb('0x0')]=_0x1f969c['name']||'';this[_0x5adb('0x1')]=_0x1f969c[_0x5adb('0x1')]||'';this[_0x5adb('0x2')]=_0x1f969c['password']||'';this[_0x5adb('0x3')]=_0x1f969c[_0x5adb('0x3')]||'';this[_0x5adb('0x4')]=_0x1f969c['remoteUri']||'';this[_0x5adb('0x5')]=_0x1f969c[_0x5adb('0x5')]||'';this[_0x5adb('0x6')]=_0x1f969c[_0x5adb('0x6')]||_0x5adb('0x7');this[_0x5adb('0x8')]=_0x1f969c[_0x5adb('0x8')]||'';this[_0x5adb('0x9')]=_0x1f969c[_0x5adb('0x9')]||{};}module[_0x5adb('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x5f2f=['authType','type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri'];(function(_0x562110,_0x15656b){var _0x2f2cfa=function(_0x4b9a16){while(--_0x4b9a16){_0x562110['push'](_0x562110['shift']());}};_0x2f2cfa(++_0x15656b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x359955,_0x5089e8){_0x359955=_0x359955-0x0;var _0xe5175f=_0x5f2f[_0x359955];return _0xe5175f;};'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 diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 2214023..1447ee9 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 _0x96d9=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0xa38346,_0x1ed99f){var _0xeb8384=function(_0x4ca8bf){while(--_0x4ca8bf){_0xa38346['push'](_0xa38346['shift']());}};_0xeb8384(++_0x1ed99f);}(_0x96d9,0xea));var _0x996d=function(_0x1d48b9,_0x12ba3a){_0x1d48b9=_0x1d48b9-0x0;var _0x50e848=_0x96d9[_0x1d48b9];return _0x50e848;};'use strict';function ZohoAccount(_0x1cece5){this['id']=_0x1cece5['id']||0x0;this[_0x996d('0x0')]=_0x1cece5[_0x996d('0x0')]||'';this[_0x996d('0x1')]=_0x1cece5[_0x996d('0x1')]||'';this[_0x996d('0x2')]=_0x1cece5[_0x996d('0x2')]||'';this[_0x996d('0x3')]=_0x1cece5['zone']||'';this[_0x996d('0x4')]=_0x1cece5[_0x996d('0x4')]||'';this[_0x996d('0x5')]=_0x1cece5[_0x996d('0x5')]||'';this[_0x996d('0x6')]=_0x1cece5[_0x996d('0x6')]||'';this[_0x996d('0x7')]=_0x1cece5['code']||'';this[_0x996d('0x8')]=_0x1cece5[_0x996d('0x8')]||'';this[_0x996d('0x9')]=_0x1cece5[_0x996d('0x9')]||{};}module[_0x996d('0xa')]=ZohoAccount; \ No newline at end of file +var _0x8286=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x4d3c40,_0x40bf62){var _0x4fd737=function(_0x4f7c6e){while(--_0x4f7c6e){_0x4d3c40['push'](_0x4d3c40['shift']());}};_0x4fd737(++_0x40bf62);}(_0x8286,0x66));var _0x6828=function(_0x34b8bc,_0x38f4f6){_0x34b8bc=_0x34b8bc-0x0;var _0x48a472=_0x8286[_0x34b8bc];return _0x48a472;};'use strict';function ZohoAccount(_0x57b687){this['id']=_0x57b687['id']||0x0;this[_0x6828('0x0')]=_0x57b687[_0x6828('0x0')]||'';this[_0x6828('0x1')]=_0x57b687[_0x6828('0x1')]||'';this[_0x6828('0x2')]=_0x57b687[_0x6828('0x2')]||'';this[_0x6828('0x3')]=_0x57b687[_0x6828('0x3')]||'';this[_0x6828('0x4')]=_0x57b687[_0x6828('0x4')]||'';this['clientSecret']=_0x57b687[_0x6828('0x5')]||'';this[_0x6828('0x6')]=_0x57b687['serverUrl']||'';this[_0x6828('0x7')]=_0x57b687[_0x6828('0x7')]||'';this[_0x6828('0x8')]=_0x57b687['refreshToken']||'';this[_0x6828('0x9')]=_0x57b687[_0x6828('0x9')]||{};}module[_0x6828('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 9d3bd82..ee2530b 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 _0xeb25=['phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','util','lodash','isNil','uniqueid','idContact','queue','campaigntype','membername','Agent','name','channelAgent','format'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0xeb25,0xde));var _0x5eb2=function(_0x45b1b3,_0x224dce){_0x45b1b3=_0x45b1b3-0x0;var _0x8f20cc=_0xeb25[_0x45b1b3];return _0x8f20cc;};'use strict';var util=require(_0x5eb2('0x0'));var _=require(_0x5eb2('0x1'));var moment=require('moment');function checkNameSurname(_0x4b7d9c,_0x43322c,_0x46884){var _0x51e034='';if(!_[_0x5eb2('0x2')](_0x43322c)&&'string'===typeof _0x43322c){_0x51e034+=_0x43322c;}if(!_['isNil'](_0x46884)&&'string'===typeof _0x46884){_0x51e034+='\x20'+_0x46884;}if(_0x51e034!==''){return _0x51e034;}return _0x4b7d9c;}function Action(_0x4e3add,_0x541166,_0x29bfcc,_0x130d7e,_0x3c6bd1){this[_0x5eb2('0x3')]=_0x29bfcc||undefined;this[_0x5eb2('0x4')]=_0x4e3add['id'];this[_0x5eb2('0x5')]=_0x541166['name'];this['type']=_0x541166['type'];this[_0x5eb2('0x6')]='queue';this['dialAnswer']=![];this[_0x5eb2('0x7')]=_[_0x5eb2('0x2')](_0x4e3add[_0x5eb2('0x8')])?undefined:_0x4e3add[_0x5eb2('0x8')][_0x5eb2('0x9')];this[_0x5eb2('0xa')]=this[_0x5eb2('0x7')]?util[_0x5eb2('0xb')]('SIP/%s',this[_0x5eb2('0x7')]):_0x130d7e||undefined;this['calleridname']=checkNameSurname(_0x4e3add['Contact'][_0x5eb2('0xc')],_0x4e3add['Contact'][_0x5eb2('0xd')],_0x4e3add['Contact'][_0x5eb2('0xe')]);this['active']=_0x4e3add[_0x5eb2('0xf')]||![];this['calleridnum']=_0x4e3add[_0x5eb2('0xc')];this[_0x5eb2('0x10')]=_0x4e3add[_0x5eb2('0x10')];this[_0x5eb2('0x11')]=_0x4e3add[_0x5eb2('0x11')]||0x0;this[_0x5eb2('0x12')]=_0x4e3add[_0x5eb2('0x12')]||0x0;this[_0x5eb2('0x13')]=_0x4e3add[_0x5eb2('0x13')]||0x0;this[_0x5eb2('0x14')]=(_0x4e3add['countbusyretry']||0x0)+(_0x4e3add['countcongestionretry']||0x0)+(_0x4e3add[_0x5eb2('0x13')]||0x0)+(_0x4e3add[_0x5eb2('0x15')]||0x0)+(_0x4e3add['countdropretry']||0x0)+(_0x4e3add[_0x5eb2('0x16')]||0x0)+(_0x4e3add[_0x5eb2('0x17')]||0x0)+(_0x4e3add['countagentrejectretry']||0x0);this[_0x5eb2('0x15')]=_0x4e3add[_0x5eb2('0x15')]||0x0;this[_0x5eb2('0x18')]=_0x4e3add[_0x5eb2('0x18')]||0x0;this[_0x5eb2('0x16')]=_0x4e3add[_0x5eb2('0x16')]||0x0;this[_0x5eb2('0x17')]=_0x4e3add[_0x5eb2('0x17')]||0x0;this['countagentrejectretry']=_0x4e3add[_0x5eb2('0x19')]||0x0;this[_0x5eb2('0x1a')]=_0x4e3add[_0x5eb2('0x1a')];this[_0x5eb2('0x1b')]=_0x4e3add['callbackuniqueid'];this[_0x5eb2('0x1c')]=_0x4e3add[_0x5eb2('0x1c')];this[_0x5eb2('0x1d')]=_0x4e3add['recallme'];this[_0x5eb2('0x1e')]=_0x4e3add[_0x5eb2('0x1e')];this['ListId']=_0x4e3add[_0x5eb2('0x1f')];this[_0x5eb2('0x20')]=_[_0x5eb2('0x2')](_0x4e3add[_0x5eb2('0x8')])?_0x4e3add[_0x5eb2('0x20')]:_0x4e3add[_0x5eb2('0x8')]['id'];this[_0x5eb2('0x21')]=_0x4e3add['VoiceQueueId'];this[_0x5eb2('0x22')]='';this[_0x5eb2('0x23')]='';}Action[_0x5eb2('0x24')][_0x5eb2('0x25')]=function(){return util[_0x5eb2('0xb')](_0x5eb2('0x26'),this['calleridname'],this['number']);};module['exports']=Action; \ No newline at end of file +var _0xb590=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry'];(function(_0x4c2fe8,_0x211425){var _0x16289d=function(_0xea8cab){while(--_0xea8cab){_0x4c2fe8['push'](_0x4c2fe8['shift']());}};_0x16289d(++_0x211425);}(_0xb590,0x1bc));var _0x0b59=function(_0xadd69d,_0x766fe3){_0xadd69d=_0xadd69d-0x0;var _0x10d2ab=_0xb590[_0xadd69d];return _0x10d2ab;};'use strict';var util=require(_0x0b59('0x0'));var _=require(_0x0b59('0x1'));var moment=require('moment');function checkNameSurname(_0xf08b14,_0x5c6dfe,_0x4bcc79){var _0x388d47='';if(!_['isNil'](_0x5c6dfe)&&_0x0b59('0x2')===typeof _0x5c6dfe){_0x388d47+=_0x5c6dfe;}if(!_[_0x0b59('0x3')](_0x4bcc79)&&'string'===typeof _0x4bcc79){_0x388d47+='\x20'+_0x4bcc79;}if(_0x388d47!==''){return _0x388d47;}return _0xf08b14;}function Action(_0x35c388,_0x48cc98,_0x58ae75,_0x452b22,_0xacf716){this[_0x0b59('0x4')]=_0x58ae75||undefined;this[_0x0b59('0x5')]=_0x35c388['id'];this[_0x0b59('0x6')]=_0x48cc98[_0x0b59('0x7')];this[_0x0b59('0x8')]=_0x48cc98[_0x0b59('0x8')];this[_0x0b59('0x9')]=_0x0b59('0x6');this[_0x0b59('0xa')]=![];this[_0x0b59('0xb')]=_['isNil'](_0x35c388[_0x0b59('0xc')])?undefined:_0x35c388['Agent'][_0x0b59('0x7')];this[_0x0b59('0xd')]=this[_0x0b59('0xb')]?util[_0x0b59('0xe')](_0x0b59('0xf'),this[_0x0b59('0xb')]):_0x452b22||undefined;this[_0x0b59('0x10')]=checkNameSurname(_0x35c388[_0x0b59('0x11')]['phone'],_0x35c388[_0x0b59('0x11')][_0x0b59('0x12')],_0x35c388[_0x0b59('0x11')][_0x0b59('0x13')]);this['active']=_0x35c388[_0x0b59('0x14')]||![];this[_0x0b59('0x15')]=_0x35c388[_0x0b59('0x16')];this[_0x0b59('0x17')]=_0x35c388['scheduledat'];this[_0x0b59('0x18')]=_0x35c388[_0x0b59('0x18')]||0x0;this[_0x0b59('0x19')]=_0x35c388[_0x0b59('0x19')]||0x0;this[_0x0b59('0x1a')]=_0x35c388[_0x0b59('0x1a')]||0x0;this[_0x0b59('0x1b')]=(_0x35c388[_0x0b59('0x18')]||0x0)+(_0x35c388['countcongestionretry']||0x0)+(_0x35c388[_0x0b59('0x1a')]||0x0)+(_0x35c388[_0x0b59('0x1c')]||0x0)+(_0x35c388[_0x0b59('0x1d')]||0x0)+(_0x35c388[_0x0b59('0x1e')]||0x0)+(_0x35c388[_0x0b59('0x1f')]||0x0)+(_0x35c388['countagentrejectretry']||0x0);this[_0x0b59('0x1c')]=_0x35c388[_0x0b59('0x1c')]||0x0;this[_0x0b59('0x1d')]=_0x35c388[_0x0b59('0x1d')]||0x0;this[_0x0b59('0x1e')]=_0x35c388['countabandonedretry']||0x0;this[_0x0b59('0x1f')]=_0x35c388[_0x0b59('0x1f')]||0x0;this['countagentrejectretry']=_0x35c388['countagentrejectretry']||0x0;this[_0x0b59('0x20')]=_0x35c388[_0x0b59('0x20')];this[_0x0b59('0x21')]=_0x35c388[_0x0b59('0x21')];this[_0x0b59('0x22')]=_0x35c388[_0x0b59('0x22')];this[_0x0b59('0x23')]=_0x35c388['recallme'];this[_0x0b59('0x24')]=_0x35c388[_0x0b59('0x24')];this['ListId']=_0x35c388[_0x0b59('0x25')];this[_0x0b59('0x26')]=_[_0x0b59('0x3')](_0x35c388['Agent'])?_0x35c388[_0x0b59('0x26')]:_0x35c388['Agent']['id'];this[_0x0b59('0x27')]=_0x35c388[_0x0b59('0x27')];this[_0x0b59('0x28')]='';this[_0x0b59('0x29')]='';}Action[_0x0b59('0x2a')][_0x0b59('0x2b')]=function(){return util['format'](_0x0b59('0x2c'),this[_0x0b59('0x10')],this[_0x0b59('0x2d')]);};module[_0x0b59('0x2e')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index e8295e3..a8b63fc 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 _0xdd37=['sumDuration','sumHoldTime','total','unmanaged','abandoned','loggedInDb','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','name','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','hasOwnProperty','dialMethod','clearZombieChannels','preview','dialActive','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','pTalking','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','size','getContactRecallMe','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','totalGlobal','NoSuchNumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','responsetime','uniqueid','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','countglobal','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','\x20Queue','BUSY','buildObj','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','countbusyretry','dialBusyRetryFrequency','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','cloneAction','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','outboundRejectCallsDay','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countagentrejectretry','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','updateOriginated','[callProgressDetectingAgent]','resolve','[incrementPreviewCounters]\x20','Contact','phone','lookAgent','execCall','[Preview][execCall][success]','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','isEmpty','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','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridnum','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','callProgressDetectingCustomer','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','variable','keys','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','answered','loggedIn','sumBillable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd37,0x12d));var _0x7dd3=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xdd37[_0x46aff0];return _0x9d78cf;};'use strict';var util=require('util');var _=require(_0x7dd3('0x0'));var BPromise=require(_0x7dd3('0x1'));var uuid=require(_0x7dd3('0x2'));var moment=require(_0x7dd3('0x3'));var md5=require(_0x7dd3('0x4'));var Redis=require(_0x7dd3('0x5'));var config=require('../../../config/environment');var logger=require(_0x7dd3('0x6'))('preview');var loggerAction=require(_0x7dd3('0x6'))(_0x7dd3('0x7'));var ami=require('../ami');var rpcDb=require(_0x7dd3('0x8'));var cmHopperAdditionalPhone=require(_0x7dd3('0x9'));var Action=require(_0x7dd3('0xa'));var ut=require(_0x7dd3('0xb'));config[_0x7dd3('0xc')]=_['defaults'](config[_0x7dd3('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x7dd3('0xd'))(new Redis(config[_0x7dd3('0xc')]));var Sequence=function(){};Sequence[_0x7dd3('0xe')][_0x7dd3('0xf')]=function(_0x4bee24){this['tail']=this[_0x7dd3('0x10')]?this[_0x7dd3('0x10')]['finally'](_0x4bee24):_0x4bee24();};function Preview(_0x25dd3c){this[_0x7dd3('0x11')]=new Sequence();this[_0x7dd3('0x12')]=_0x25dd3c[_0x7dd3('0x13')];this[_0x7dd3('0x14')]=_0x25dd3c['trunks'];this[_0x7dd3('0x15')]={};this[_0x7dd3('0x16')]=_0x25dd3c[_0x7dd3('0x16')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0x7dd3('0x17')](this));ami['on']('hangup',this[_0x7dd3('0x18')][_0x7dd3('0x17')](this));ami['on'](_0x7dd3('0x19'),this[_0x7dd3('0x1a')][_0x7dd3('0x17')](this));ami['on'](_0x7dd3('0x1b'),this[_0x7dd3('0x1c')]['bind'](this));ami['on'](_0x7dd3('0x1d'),this[_0x7dd3('0x1e')][_0x7dd3('0x17')](this));ami['on']('varset',this[_0x7dd3('0x1f')][_0x7dd3('0x17')](this));ami['on'](_0x7dd3('0x20'),this[_0x7dd3('0x21')][_0x7dd3('0x17')](this));ami['on']('blindtransfer',this[_0x7dd3('0x22')][_0x7dd3('0x17')](this));this[_0x7dd3('0x23')](this[_0x7dd3('0x12')]);}function emit(_0xbbabe4,_0x2b8fdd,_0x3ff540){io['to'](_0xbbabe4)[_0x7dd3('0x24')](_0x2b8fdd,_0x3ff540);}function emitCampaignPreview(_0x25661d){if(_0x25661d[_0x7dd3('0x25')]===_0x7dd3('0x26')){var _0x3b794e={'id':_0x25661d['id'],'name':_0x25661d['name'],'strategy':_0x25661d['strategy'],'answered':_0x25661d[_0x7dd3('0x27')],'available':_0x25661d['available'],'loggedIn':_0x25661d[_0x7dd3('0x28')],'pTalking':_0x25661d['pTalking'],'sumBillable':_0x25661d[_0x7dd3('0x29')],'sumDuration':_0x25661d[_0x7dd3('0x2a')],'sumHoldTime':_0x25661d[_0x7dd3('0x2b')]||0x0,'talking':_0x25661d['talking'],'total':_0x25661d[_0x7dd3('0x2c')],'type':_0x25661d[_0x7dd3('0x25')],'unmanaged':_0x25661d[_0x7dd3('0x2d')],'abandoned':_0x25661d[_0x7dd3('0x2e')],'waiting':_0x25661d['waiting'],'loggedInDb':_0x25661d[_0x7dd3('0x2f')],'dialActive':_0x25661d['dialActive'],'dialMethod':_0x25661d['dialMethod'],'dialOriginateCallerIdName':_0x25661d['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x25661d[_0x7dd3('0x30')],'dialOriginateTimeout':_0x25661d[_0x7dd3('0x31')],'dialPrefix':_0x25661d['dialPrefix'],'outboundAnswerAgiCallsDay':_0x25661d[_0x7dd3('0x32')],'outboundAnswerCallsDay':_0x25661d[_0x7dd3('0x33')],'outboundBlacklistCallsDay':_0x25661d[_0x7dd3('0x34')],'outboundBusyCallsDay':_0x25661d['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x25661d[_0x7dd3('0x35')],'outboundDropCallsDayACS':_0x25661d[_0x7dd3('0x36')],'outboundDropCallsDayCallersExit':_0x25661d[_0x7dd3('0x37')],'outboundDropCallsDayTimeout':_0x25661d[_0x7dd3('0x38')],'outboundNoAnswerCallsDay':_0x25661d['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x25661d[_0x7dd3('0x39')],'outboundOriginateFailureCallsDay':_0x25661d[_0x7dd3('0x3a')],'outboundReCallsDay':_0x25661d[_0x7dd3('0x3b')],'outboundRejectCallsDay':_0x25661d['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x25661d[_0x7dd3('0x3c')],'outboundAbandonedCallsDay':_0x25661d['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x25661d[_0x7dd3('0x3d')],'predictiveIntervalAvgHoldtime':_0x25661d[_0x7dd3('0x3e')],'predictiveIntervalAvgTalktime':_0x25661d['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x25661d[_0x7dd3('0x3f')],'predictiveIntervalDroppedCallsTimeout':_0x25661d[_0x7dd3('0x40')],'predictiveIntervalErlangCalls':_0x25661d[_0x7dd3('0x41')],'predictiveIntervalErlangCallsDroppedCalls':_0x25661d['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x25661d[_0x7dd3('0x42')],'predictiveIntervalMultiplicativeFactor':_0x25661d[_0x7dd3('0x43')],'predictiveIntervalPauses':_0x25661d[_0x7dd3('0x44')],'predictiveIntervalAvailable':_0x25661d['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x25661d[_0x7dd3('0x45')],'message':_0x25661d['message'],'originated':_0x25661d[_0x7dd3('0x46')],'erlangCalls':_0x25661d[_0x7dd3('0x47')],'erlangCallToSecond':_0x25661d[_0x7dd3('0x48')],'erlangAbandonmentRate':_0x25661d[_0x7dd3('0x49')],'erlangBusyFactor':_0x25661d[_0x7dd3('0x4a')],'startPredictive':_0x25661d['startPredictive'],'startProgressive':_0x25661d[_0x7dd3('0x4b')]};if(_0x25661d[_0x7dd3('0x4c')]){_0x3b794e[_0x7dd3('0x4c')]={'id':_0x25661d[_0x7dd3('0x4c')]['id'],'name':_0x25661d[_0x7dd3('0x4c')][_0x7dd3('0x4d')],'active':_0x25661d[_0x7dd3('0x4c')][_0x7dd3('0x4e')],'callerid':_0x25661d[_0x7dd3('0x4c')][_0x7dd3('0x4f')]};}if(_0x25661d[_0x7dd3('0x50')]){_0x3b794e[_0x7dd3('0x50')]={'id':_0x25661d[_0x7dd3('0x50')]['id'],'name':_0x25661d['Interval'][_0x7dd3('0x4d')]};}var _0x30395f=md5(JSON[_0x7dd3('0x51')](_0x3b794e));if(_0x25661d[_0x7dd3('0x4')]!==_0x30395f){_0x25661d['md5']=_0x30395f;emit(util[_0x7dd3('0x52')](_0x7dd3('0x53'),_0x3b794e['name']),_0x7dd3('0x54'),_0x3b794e);}}}function emitVoiceQueueChannelRemove(_0x54901d){logger[_0x7dd3('0x55')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x54901d));emit(util[_0x7dd3('0x52')](_0x7dd3('0x53'),_0x54901d['name']),_0x7dd3('0x56'),_0x54901d);io[_0x7dd3('0x24')](_0x7dd3('0x57'),_0x54901d);}function notSendMessagesQueue(_0x444be7){if(_0x444be7[_0x7dd3('0x58')]){if(_0x444be7[_0x7dd3('0x46')]===0x0&&_0x444be7['pTalking']===0x0){_0x444be7[_0x7dd3('0x58')]=![];_0x444be7[_0x7dd3('0x59')]=0x0;_0x444be7[_0x7dd3('0x5a')]=0x0;_0x444be7[_0x7dd3('0x5b')]=_0x7dd3('0x5c');ut[_0x7dd3('0x5d')](_0x7dd3('0x5e'),_0x444be7[_0x7dd3('0x4d')]+_0x7dd3('0x5f'));}else{_0x444be7[_0x7dd3('0x5b')]='IS_DISACTIVED';ut[_0x7dd3('0x5d')](_0x7dd3('0x5e'),_0x444be7[_0x7dd3('0x4d')]+_0x7dd3('0x60'));}emitCampaignPreview(_0x444be7);}}Preview['prototype'][_0x7dd3('0x23')]=function(){var _0x315af9=this;setInterval(function(){_0x315af9[_0x7dd3('0x61')]();},0x7cf);};Preview[_0x7dd3('0xe')][_0x7dd3('0x61')]=function(){var _0x46dd1c=this[_0x7dd3('0x12')];this[_0x7dd3('0x62')]+=0x1;for(var _0x92075d in _0x46dd1c){if(_0x46dd1c[_0x7dd3('0x63')](_0x92075d)&&(_0x46dd1c[_0x92075d][_0x7dd3('0x64')]==='preview'||_0x46dd1c[_0x92075d][_0x7dd3('0x64')]==='booked')&&_0x46dd1c[_0x92075d]['type']===_0x7dd3('0x26')){if(this[_0x7dd3('0x62')]>0x7){this[_0x7dd3('0x62')]=0x0;this[_0x7dd3('0x65')]();}}if(_0x46dd1c[_0x7dd3('0x63')](_0x92075d)&&_0x46dd1c[_0x92075d]['dialMethod']===_0x7dd3('0x66')&&_0x46dd1c[_0x92075d]['type']==='outbound'){if(_0x46dd1c[_0x92075d][_0x7dd3('0x67')]){this[_0x7dd3('0x68')](_0x46dd1c[_0x92075d]);this[_0x7dd3('0x69')](_0x46dd1c[_0x92075d]);}else{notSendMessagesQueue(_0x46dd1c[_0x92075d]);}}}};Preview[_0x7dd3('0xe')][_0x7dd3('0x6a')]=function(_0x59e7e4){var _0xf3ff8f=this;this[_0x7dd3('0x11')][_0x7dd3('0xf')](function(){if(!_[_0x7dd3('0x6b')](_0xf3ff8f[_0x7dd3('0x15')][_0x59e7e4])){loggerAction['info'](_0x7dd3('0x6c'),_0x59e7e4,_0x7dd3('0x6d'),_0xf3ff8f['actions'][_0x59e7e4][_0x7dd3('0x6e')],_0x7dd3('0x6f'),JSON[_0x7dd3('0x51')](_0xf3ff8f[_0x7dd3('0x12')][_0xf3ff8f[_0x7dd3('0x15')][_0x59e7e4][_0x7dd3('0x6e')]][_0x7dd3('0x46')]),_0x7dd3('0x70'),JSON[_0x7dd3('0x51')](_0xf3ff8f[_0x7dd3('0x12')][_0xf3ff8f[_0x7dd3('0x15')][_0x59e7e4][_0x7dd3('0x6e')]][_0x7dd3('0x71')]),JSON[_0x7dd3('0x51')](_0xf3ff8f['actions'][_0x59e7e4][_0x7dd3('0x72')]),JSON[_0x7dd3('0x51')](_[_0x7dd3('0x73')](_0xf3ff8f[_0x7dd3('0x15')][_0x59e7e4],[_0x7dd3('0x74'),_0x7dd3('0x75'),_0x7dd3('0x76'),_0x7dd3('0x77')])));return ami[_0x7dd3('0x78')]({'action':_0x7dd3('0x79'),'channel':_0xf3ff8f['actions'][_0x59e7e4][_0x7dd3('0x7a')]})[_0x7dd3('0x7b')](function(_0x581c7c){if(_0x581c7c[_0x7dd3('0x5b')]===_0x7dd3('0x7c')){setTimeout(function(){if(_0xf3ff8f[_0x7dd3('0x15')][_0x59e7e4]){ut['updateOriginated'](_0xf3ff8f[_0x7dd3('0x12')][_0xf3ff8f[_0x7dd3('0x15')][_0x59e7e4][_0x7dd3('0x6e')]],_0x7dd3('0x7d'));if(_0xf3ff8f[_0x7dd3('0x15')][_0x59e7e4][_0x7dd3('0x72')]===!![]){ut[_0x7dd3('0x7e')](_0xf3ff8f[_0x7dd3('0x12')][_0xf3ff8f[_0x7dd3('0x15')][_0x59e7e4][_0x7dd3('0x6e')]],'[clearZombieChannel]');ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x59e7e4,_0xf3ff8f[_0x7dd3('0x15')][_0x59e7e4][_0x7dd3('0x6e')]);}ut[_0x7dd3('0x7f')](_0x7dd3('0x80')+_0x59e7e4,_0xf3ff8f[_0x7dd3('0x15')][_0x59e7e4][_0x7dd3('0x6e')]);delete _0xf3ff8f[_0x7dd3('0x15')][_0x59e7e4];}},0x2328);}});}});};Preview[_0x7dd3('0xe')][_0x7dd3('0x65')]=function(){var _0x56f8af=this;loggerAction['info']('[action]',_[_0x7dd3('0x81')](this[_0x7dd3('0x15')]));for(var _0x2d8c02 in this[_0x7dd3('0x15')]){if(_0x56f8af[_0x7dd3('0x15')][_0x7dd3('0x63')](_0x2d8c02)){_0x56f8af[_0x7dd3('0x6a')](_0x2d8c02);}}};Preview['prototype'][_0x7dd3('0x69')]=function(_0x33f34e){var _0x34f246=this;rpcDb[_0x7dd3('0x82')](_0x33f34e['id'],ut['agentReadyId'](this[_0x7dd3('0x16')]))[_0x7dd3('0x83')](function(_0x54f882){if(!_[_0x7dd3('0x6b')](_0x54f882)){for(var _0x45149f=0x0;_0x45149f<_0x54f882[_0x7dd3('0x84')];_0x45149f+=0x1){if(ut['getDiff'](_0x54f882[_0x45149f][_0x7dd3('0x85')])<_0x33f34e[_0x7dd3('0x86')]*0x3c){if(_0x54f882[_0x45149f][_0x7dd3('0x87')]&&!_0x54f882[_0x45149f][_0x7dd3('0x87')][_0x7dd3('0x88')]){_0x34f246[_0x7dd3('0x89')](_0x54f882[_0x45149f]['id'])['then'](ut[_0x7dd3('0x8a')](_0x7dd3('0x8b')))[_0x7dd3('0x7b')](ut['logger2'](_0x7dd3('0x8b')));}else{rpcDb[_0x7dd3('0x8c')](_0x54f882[_0x45149f]['id']);}}else{var _0x114d0b=new Action(_0x54f882[_0x45149f],_0x33f34e);_0x114d0b[_0x7dd3('0x8d')]=moment()[_0x7dd3('0x52')](_0x7dd3('0x8e'));_0x33f34e['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x114d0b,0x17,'RecallInQueue');if(_0x33f34e[_0x7dd3('0x8f')]){rpcDb[_0x7dd3('0x90')](ut[_0x7dd3('0x91')](_0x54f882[_0x45149f]));rpcDb['createCustomerHistory'](_0x114d0b,_0x7dd3('0x92'));}else{ut[_0x7dd3('0x93')](_0x114d0b,0x16,_0x7dd3('0x94'));rpcDb[_0x7dd3('0x95')](_0x114d0b,_0x7dd3('0x96'));rpcDb[_0x7dd3('0x97')](_0x114d0b,_0x7dd3('0x96'));}}}}})[_0x7dd3('0x7b')](ut[_0x7dd3('0x8a')](_0x7dd3('0x98')));};Preview[_0x7dd3('0xe')]['setMessage']=function(_0x4ceefc){_0x4ceefc[_0x7dd3('0x58')]=!![];if(ut[_0x7dd3('0x99')](_0x4ceefc[_0x7dd3('0x28')])){_0x4ceefc['message']=_0x7dd3('0x9a');}else if(!ut[_0x7dd3('0x9b')](_0x4ceefc[_0x7dd3('0x67')])){_0x4ceefc[_0x7dd3('0x5b')]=_0x7dd3('0x5c');}else if(!this[_0x7dd3('0x9c')](_0x4ceefc[_0x7dd3('0x4c')])){if(!this[_0x7dd3('0x9c')](_0x4ceefc[_0x7dd3('0x9d')])){_0x4ceefc[_0x7dd3('0x5b')]=_0x7dd3('0x9e');}else{_0x4ceefc[_0x7dd3('0x5b')]='ACTIVE';}}else{_0x4ceefc[_0x7dd3('0x5b')]=_0x7dd3('0x9f');}emitCampaignPreview(_0x4ceefc);};Preview[_0x7dd3('0xe')]['callProgressDetectingCustomer']=function(_0x125b10,_0x19fad2,_0x53c170){var _0x12de1c=this;var _0x2dc44d=this[_0x7dd3('0x15')][_0x19fad2];var _0x176259=this['campaignsPreview'][_0x2dc44d['queue']];var _0x202bac;var _0x28f467=![];var _0x494394=0x2;var _0x1b21fc=0x3;if(_0x176259){switch(_0x53c170){case'1':_0x176259[_0x7dd3('0x39')]+=0x1;_0x2dc44d[_0x7dd3('0xa0')]+=0x1;_0x2dc44d['countglobal']=ut[_0x7dd3('0xa1')](_0x2dc44d);ut[_0x7dd3('0x93')](_0x2dc44d,0x0,_0x7dd3('0xa2'));ami[_0x7dd3('0x24')]('custom:agentnosuchnumber',ut['buildObj'](_0x2dc44d,_0x7dd3('0xa3')));rpcDb[_0x7dd3('0x95')](_0x2dc44d,_0x7dd3('0xa4'));_0x12de1c[_0x7dd3('0xa5')](_0x2dc44d,'0',_0x176259)[_0x7dd3('0x83')](function(_0xd33e41){_0x28f467=_0xd33e41[_0x7dd3('0xa6')]==0x1;_0x494394=_0x176259[_0x7dd3('0xa7')];_0x1b21fc=_0x176259[_0x7dd3('0xa8')];if(!_0x28f467){if(ut[_0x7dd3('0xa1')](_0x2dc44d)>=_0x176259[_0x7dd3('0xa9')]){_0x202bac=ut['cloneAction'](_0x2dc44d,0xf,_0x7dd3('0xaa'));rpcDb[_0x7dd3('0x97')](_0x202bac,_0x7dd3('0xab'));}else{if(_0x2dc44d[_0x7dd3('0xa0')]>=_0x176259[_0x7dd3('0xac')]){rpcDb[_0x7dd3('0x97')](_0x2dc44d,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x7dd3('0xad')](ut[_0x7dd3('0xae')](_0x2dc44d,_0x7dd3('0xa0'),_0x176259['dialNoSuchNumberRetryFrequency']),_0x2dc44d[_0x7dd3('0xaf')],_0x2dc44d[_0x7dd3('0xb0')]);}}delete this[_0x7dd3('0x15')][_0x125b10[_0x7dd3('0xb1')]];}else{_0x2dc44d['countnosuchnumberretry']++;logger[_0x7dd3('0x55')](_0x7dd3('0xb2'),_0x2dc44d[_0x7dd3('0xa0')]);logger[_0x7dd3('0x55')]('id',_0x2dc44d[_0x7dd3('0xb3')]);_0x12de1c[_0x7dd3('0xb4')]({'id':_0x2dc44d[_0x7dd3('0xb3')],'field':{'countnosuchnumberretry':_0x2dc44d['countnosuchnumberretry']}})[_0x7dd3('0x83')](function(){_0x12de1c[_0x7dd3('0xb5')](_0x2dc44d,_0x494394,_0x1b21fc)[_0x7dd3('0x83')](function(){});});}});break;case'ANSWER':var _0x540094=moment()[_0x7dd3('0x52')](_0x7dd3('0x8e'));_0x2dc44d[_0x7dd3('0xb6')]=_0x540094;_0x2dc44d['answertime']=_0x540094;_0x2dc44d[_0x7dd3('0x72')]=!![];_0x176259[_0x7dd3('0x71')]+=0x1;logger[_0x7dd3('0x55')]('[syncHangup][talking][increment]',_0x2dc44d[_0x7dd3('0xb7')],'\x20Queue',_0x176259[_0x7dd3('0x4d')],_0x7dd3('0x70'),_0x176259[_0x7dd3('0x71')]);ami[_0x7dd3('0x24')](_0x7dd3('0xb8'),ut['buildObj'](_0x2dc44d,'connect',this[_0x7dd3('0x12')][_0x2dc44d[_0x7dd3('0x6e')]]));if(_0x176259[_0x7dd3('0xb9')]){ami[_0x7dd3('0x24')](_0x7dd3('0xba'),ut[_0x7dd3('0xbb')](_0x2dc44d));}break;case'16':ami[_0x7dd3('0x24')](_0x7dd3('0xbc'),ut['buildObj'](_0x2dc44d,_0x7dd3('0xbd'),this[_0x7dd3('0x12')][_0x2dc44d[_0x7dd3('0x6e')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2dc44d,_0x7dd3('0xbd')));_0x176259[_0x7dd3('0x33')]+=0x1;_0x176259[_0x7dd3('0x2c')]+=0x1;_0x176259[_0x7dd3('0x27')]+=0x1;ut['decrementTalkink'](_0x176259,_0x7dd3('0xbe'));_0x2dc44d[_0x7dd3('0xbf')]=ut['totalGlobal'](_0x2dc44d);ut[_0x7dd3('0x93')](_0x2dc44d,0x4,'Answer');rpcDb[_0x7dd3('0x95')](_0x2dc44d,_0x7dd3('0xc0'));rpcDb[_0x7dd3('0x97')](_0x2dc44d,_0x7dd3('0xc1'));rpcDb['crateCustomerReportQueue'](_0x2dc44d);_0x176259['sumDuration']+=_0x2dc44d['talktime'];_0x176259['sumBillable']+=_0x2dc44d[_0x7dd3('0xc2')];logger[_0x7dd3('0x55')]('[syncHangup][talking][decrement]',_0x2dc44d[_0x7dd3('0xb7')],_0x7dd3('0xc3'),_0x176259[_0x7dd3('0x4d')],'pTalking:\x20',_0x176259['pTalking']);delete this['actions'][_0x125b10['linkedid']];break;case _0x7dd3('0xc4'):_0x176259['outboundBusyCallsDay']+=0x1;_0x2dc44d['countbusyretry']+=0x1;_0x2dc44d['countglobal']=ut[_0x7dd3('0xa1')](_0x2dc44d);ut[_0x7dd3('0x93')](_0x2dc44d,0x5,'Busy');_0x494394=_0x176259['dialBusyRetryFrequency'];_0x1b21fc=_0x176259[_0x7dd3('0xa8')];ami['emit']('custom:agentbusy',ut[_0x7dd3('0xc5')](_0x2dc44d,_0x7dd3('0xc6')));rpcDb[_0x7dd3('0x95')](_0x2dc44d,_0x7dd3('0xc7'));_0x12de1c[_0x7dd3('0xa5')](_0x2dc44d,'5',_0x176259)[_0x7dd3('0x83')](function(_0x4d0f77){_0x28f467=_0x4d0f77[_0x7dd3('0xa6')]==0x1;if(!_0x28f467){if(ut[_0x7dd3('0xa1')](_0x2dc44d)>=_0x176259['dialGlobalMaxRetry']){_0x202bac=ut['cloneAction'](_0x2dc44d,0xf,_0x7dd3('0xaa'));rpcDb[_0x7dd3('0x97')](_0x202bac,_0x7dd3('0xc8'));}else{if(_0x2dc44d['countbusyretry']>=_0x176259[_0x7dd3('0xc9')]){rpcDb[_0x7dd3('0x97')](_0x2dc44d,_0x7dd3('0xc7'));}else{rpcDb[_0x7dd3('0xad')](ut['scheduledAt'](_0x2dc44d,_0x7dd3('0xca'),_0x176259[_0x7dd3('0xcb')]),_0x2dc44d[_0x7dd3('0xaf')],_0x2dc44d[_0x7dd3('0xb0')]);}}}else{_0x2dc44d['countbusyretry']++;_0x12de1c[_0x7dd3('0xb4')]({'id':_0x2dc44d[_0x7dd3('0xb3')],'field':{'countbusyretry':_0x2dc44d['countbusyretry']}})['then'](function(){_0x12de1c['swapAdditionalPhones'](_0x2dc44d,_0x494394,_0x1b21fc)['then'](function(){});});}});break;case _0x7dd3('0xcc'):_0x176259[_0x7dd3('0xcd')]+=0x1;_0x2dc44d[_0x7dd3('0xce')]+=0x1;_0x2dc44d[_0x7dd3('0xbf')]=ut[_0x7dd3('0xa1')](_0x2dc44d);ut[_0x7dd3('0x93')](_0x2dc44d,0x3,'NoAnswer');_0x494394=_0x176259[_0x7dd3('0xcf')];_0x1b21fc=_0x176259[_0x7dd3('0xa8')];ami['emit'](_0x7dd3('0xd0'),ut['buildObj'](_0x2dc44d,'noanswer'));rpcDb['createCustomerHistory'](_0x2dc44d,_0x7dd3('0xd1'));_0x12de1c[_0x7dd3('0xa5')](_0x2dc44d,'3',_0x176259)[_0x7dd3('0x83')](function(_0x6ff111){_0x28f467=_0x6ff111['additional']==0x1;if(!_0x28f467){if(ut[_0x7dd3('0xa1')](_0x2dc44d)>=_0x176259['dialGlobalMaxRetry']){_0x202bac=ut['cloneAction'](_0x2dc44d,0xf,_0x7dd3('0xaa'));rpcDb['createCustomerFinal'](_0x202bac,_0x7dd3('0xd2'));}else{if(_0x2dc44d[_0x7dd3('0xce')]>=_0x176259[_0x7dd3('0xd3')]){rpcDb[_0x7dd3('0x97')](_0x2dc44d,_0x7dd3('0xd1'));}else{rpcDb[_0x7dd3('0xad')](ut[_0x7dd3('0xae')](_0x2dc44d,_0x7dd3('0xce'),_0x176259[_0x7dd3('0xcf')]),_0x2dc44d[_0x7dd3('0xaf')],_0x2dc44d[_0x7dd3('0xb0')]);}}}else{_0x2dc44d[_0x7dd3('0xce')]++;_0x12de1c[_0x7dd3('0xb4')]({'id':_0x2dc44d[_0x7dd3('0xb3')],'field':{'countnoanswerretry':_0x2dc44d[_0x7dd3('0xce')]}})[_0x7dd3('0x83')](function(){_0x12de1c[_0x7dd3('0xb5')](_0x2dc44d,_0x494394,_0x1b21fc)[_0x7dd3('0x83')](function(){});});}});break;case'CONGESTION':_0x176259[_0x7dd3('0x35')]+=0x1;_0x2dc44d[_0x7dd3('0xd4')]+=0x1;_0x2dc44d[_0x7dd3('0xbf')]=ut[_0x7dd3('0xa1')](_0x2dc44d);ut[_0x7dd3('0x93')](_0x2dc44d,0x8,_0x7dd3('0xd5'));_0x494394=_0x176259[_0x7dd3('0xd6')];_0x1b21fc=_0x176259[_0x7dd3('0xa8')];ami[_0x7dd3('0x24')](_0x7dd3('0xd7'),ut['buildObj'](_0x2dc44d,'congestion'));rpcDb[_0x7dd3('0x95')](_0x2dc44d,_0x7dd3('0xd8'));_0x12de1c[_0x7dd3('0xa5')](_0x2dc44d,'8',_0x176259)[_0x7dd3('0x83')](function(_0x304cf6){_0x28f467=_0x304cf6[_0x7dd3('0xa6')]==0x1;if(!_0x28f467){if(ut[_0x7dd3('0xa1')](_0x2dc44d)>=_0x176259['dialGlobalMaxRetry']){_0x202bac=ut[_0x7dd3('0xd9')](_0x2dc44d,0xf,_0x7dd3('0xaa'));rpcDb[_0x7dd3('0x97')](_0x202bac,_0x7dd3('0xda'));}else{if(_0x2dc44d[_0x7dd3('0xd4')]>=_0x176259['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x2dc44d,_0x7dd3('0xd8'));}else{rpcDb[_0x7dd3('0xad')](ut[_0x7dd3('0xae')](_0x2dc44d,_0x7dd3('0xd4'),_0x176259[_0x7dd3('0xcb')]),_0x2dc44d[_0x7dd3('0xaf')],_0x2dc44d[_0x7dd3('0xb0')]);}}}else{_0x2dc44d['countcongestionretry']++;_0x12de1c[_0x7dd3('0xb4')]({'id':_0x2dc44d[_0x7dd3('0xb3')],'field':{'countcongestionretry':_0x2dc44d[_0x7dd3('0xd4')]}})['then'](function(){_0x12de1c[_0x7dd3('0xb5')](_0x2dc44d,_0x494394,_0x1b21fc)['then'](function(){});});}});break;case _0x7dd3('0xdb'):_0x176259[_0x7dd3('0xdc')]+=0x1;_0x2dc44d['countagentrejectretry']+=0x1;_0x2dc44d[_0x7dd3('0xbf')]=ut[_0x7dd3('0xa1')](_0x2dc44d);ut[_0x7dd3('0x93')](_0x2dc44d,0x14,'AgentReject');_0x494394=_0x176259[_0x7dd3('0xdd')];_0x1b21fc=_0x176259[_0x7dd3('0xa8')];ami['emit'](_0x7dd3('0xde'),ut['buildObj'](_0x2dc44d,_0x7dd3('0xdf')));rpcDb['createCustomerHistory'](_0x2dc44d,_0x7dd3('0xe0'));_0x12de1c[_0x7dd3('0xa5')](_0x2dc44d,'20',_0x176259)['then'](function(_0x1fc116){_0x28f467=_0x1fc116[_0x7dd3('0xa6')]==0x1;if(!_0x28f467){if(ut[_0x7dd3('0xa1')](_0x2dc44d)>=_0x176259[_0x7dd3('0xa9')]){_0x202bac=ut[_0x7dd3('0xd9')](_0x2dc44d,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x202bac,_0x7dd3('0xe1'));}else{if(_0x2dc44d['countagentrejectretry']>=_0x176259[_0x7dd3('0xe2')]){rpcDb['createCustomerFinal'](_0x2dc44d,_0x7dd3('0xe1'));}else{rpcDb[_0x7dd3('0xad')](ut['scheduledAt'](_0x2dc44d,_0x7dd3('0xe3'),_0x176259[_0x7dd3('0xdd')]),_0x2dc44d[_0x7dd3('0xaf')],_0x2dc44d[_0x7dd3('0xb0')]);}}}else{_0x2dc44d[_0x7dd3('0xce')]++;_0x12de1c['incrementPreviewCounters']({'id':_0x2dc44d[_0x7dd3('0xb3')],'field':{'countnoanswerretry':_0x2dc44d['countnoanswerretry']}})[_0x7dd3('0x83')](function(){_0x12de1c[_0x7dd3('0xb5')](_0x2dc44d,_0x494394,_0x1b21fc)[_0x7dd3('0x83')](function(){});});}});break;case'ABANDONED':_0x176259[_0x7dd3('0xe4')]+=0x1;_0x2dc44d[_0x7dd3('0xe5')]+=0x1;_0x2dc44d[_0x7dd3('0xbf')]=ut[_0x7dd3('0xa1')](_0x2dc44d);ut[_0x7dd3('0x93')](_0x2dc44d,0xb,_0x7dd3('0xe6'));rpcDb[_0x7dd3('0x95')](_0x2dc44d,_0x7dd3('0xe7'));if(ut[_0x7dd3('0xa1')](_0x2dc44d)>=_0x176259['dialGlobalMaxRetry']){_0x202bac=ut[_0x7dd3('0xd9')](_0x2dc44d,0xf,_0x7dd3('0xaa'));rpcDb['createCustomerFinal'](_0x202bac,_0x7dd3('0xe7'));}else{if(_0x2dc44d['countabandonedetry']>=_0x176259['dialAbandonedMaxRety']){rpcDb[_0x7dd3('0x97')](_0x2dc44d,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x7dd3('0xad')](ut[_0x7dd3('0xae')](_0x2dc44d,_0x7dd3('0xe5'),_0x176259[_0x7dd3('0xe8')]),_0x2dc44d[_0x7dd3('0xaf')],_0x2dc44d['activeContact']);}}break;case'18':_0x176259[_0x7dd3('0x3c')]+=0x1;_0x2dc44d['countmachineretry']+=0x1;_0x2dc44d[_0x7dd3('0xbf')]=ut[_0x7dd3('0xa1')](_0x2dc44d);ut['logCustomer'](_0x2dc44d,0x12,_0x125b10[_0x7dd3('0xe9')]||_0x125b10[_0x7dd3('0xea')]);ami[_0x7dd3('0x24')]('custom:amd',ut[_0x7dd3('0xc5')](_0x2dc44d,_0x7dd3('0xeb')));rpcDb[_0x7dd3('0x95')](_0x2dc44d,_0x7dd3('0xec'));if(ut[_0x7dd3('0xa1')](_0x2dc44d)>=_0x176259[_0x7dd3('0xa9')]){_0x202bac=ut[_0x7dd3('0xd9')](_0x2dc44d,0xf,_0x7dd3('0xaa'));rpcDb[_0x7dd3('0x97')](_0x202bac,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x7dd3('0x97')](_0x2dc44d,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x7dd3('0x15')][_0x125b10[_0x7dd3('0xb1')]];break;case'19':_0x176259[_0x7dd3('0x3c')]+=0x1;_0x2dc44d['countglobal']=ut[_0x7dd3('0xa1')](_0x2dc44d);ut[_0x7dd3('0x93')](_0x2dc44d,0x13,_0x125b10[_0x7dd3('0xe9')]||_0x125b10[_0x7dd3('0xea')]);ami['emit'](_0x7dd3('0xed'),ut[_0x7dd3('0xc5')](_0x2dc44d,_0x7dd3('0xeb')));rpcDb['createCustomerHistory'](_0x2dc44d,'[callProgressDetectingCustomer][machine]');if(ut[_0x7dd3('0xa1')](_0x2dc44d)>=_0x176259[_0x7dd3('0xa9')]){_0x202bac=ut['cloneAction'](_0x2dc44d,0xf,_0x7dd3('0xaa'));rpcDb[_0x7dd3('0x97')](_0x202bac,_0x7dd3('0xee'));}else{rpcDb['createCustomerFinal'](_0x2dc44d,_0x7dd3('0xee'));}delete this['actions'][_0x125b10[_0x7dd3('0xb1')]];break;default:if(_0x2dc44d[_0x7dd3('0x72')]){ut[_0x7dd3('0x7e')](_0x176259,_0x7dd3('0xef'));ut[_0x7dd3('0x7f')](_0x7dd3('0xf0')+_0x176259[_0x7dd3('0x4d')],_0x125b10);}_0x176259[_0x7dd3('0x3c')]+=0x1;_0x2dc44d[_0x7dd3('0xbf')]=ut[_0x7dd3('0xa1')](_0x2dc44d);ut[_0x7dd3('0x93')](_0x2dc44d,0xc,_0x125b10['cause-txt']||_0x125b10[_0x7dd3('0xea')]);_0x494394=_0x176259[_0x7dd3('0xdd')];_0x1b21fc=_0x176259[_0x7dd3('0xa8')];rpcDb[_0x7dd3('0x95')](_0x2dc44d,_0x7dd3('0xf1'));_0x12de1c[_0x7dd3('0xa5')](_0x2dc44d,'20',_0x176259)[_0x7dd3('0x83')](function(_0x10eea4){_0x28f467=_0x10eea4['additional']==0x1;if(!_0x28f467){if(ut[_0x7dd3('0xa1')](_0x2dc44d)>=_0x176259[_0x7dd3('0xa9')]){_0x202bac=ut[_0x7dd3('0xd9')](_0x2dc44d,0xf,_0x7dd3('0xaa'));rpcDb[_0x7dd3('0x97')](_0x202bac,_0x7dd3('0xf2'));}else{rpcDb[_0x7dd3('0x97')](_0x2dc44d,_0x7dd3('0xf2'));}delete this[_0x7dd3('0x15')][_0x125b10[_0x7dd3('0xb1')]];}else{_0x12de1c[_0x7dd3('0xb5')](_0x2dc44d,_0x494394,_0x1b21fc)[_0x7dd3('0x83')](function(_0x1d38d2){});}});}if(!(_0x2dc44d['dialAnswer']&&_0x53c170==='16')){ut['updateOriginated'](_0x176259,_0x7dd3('0xf3'));logger[_0x7dd3('0x55')](_0x7dd3('0xf4'),_0x2dc44d[_0x7dd3('0xb7')],'\x20Queue',_0x176259[_0x7dd3('0x4d')],_0x7dd3('0x6f'),_0x176259[_0x7dd3('0x46')]);}if(_0x53c170!=='ANSWER'){delete this[_0x7dd3('0x15')][_0x125b10[_0x7dd3('0xb1')]];delete this[_0x7dd3('0x15')][_0x125b10[_0x7dd3('0xf5')]];}}};Preview[_0x7dd3('0xe')][_0x7dd3('0xf6')]=function(_0x40a62f,_0x13711e,_0x2d0e9c){if(_[_0x7dd3('0xf7')](_0x13711e)&&'object'!==typeof _0x13711e){return;}if(_[_0x7dd3('0xf7')](_0x2d0e9c)&&_0x7dd3('0xf8')!==typeof _0x2d0e9c){return;}switch(_0x2d0e9c[_0x7dd3('0xf9')]){case'0':ut[_0x7dd3('0xfa')](_0x40a62f,0x0,_0x7dd3('0xa2'));rpcDb[_0x7dd3('0xfb')](_0x40a62f,_0x7dd3('0xfc'));break;case'3':ut[_0x7dd3('0xfa')](_0x40a62f,0x3,'NoAnswer');rpcDb[_0x7dd3('0xfb')](_0x40a62f,_0x7dd3('0xfd'));break;case'5':ut[_0x7dd3('0xfa')](_0x40a62f,0x5,_0x7dd3('0xfe'));rpcDb['createAgentHistory'](_0x40a62f,_0x7dd3('0xff'));break;case'8':ut[_0x7dd3('0xfa')](_0x40a62f,0x8,_0x7dd3('0xd5'));rpcDb[_0x7dd3('0xfb')](_0x40a62f,_0x7dd3('0x100'));break;case'22':ut[_0x7dd3('0xfa')](_0x40a62f,0x16,_0x7dd3('0x101'));rpcDb[_0x7dd3('0xfb')](_0x40a62f,_0x7dd3('0x102'));break;default:ut['logAgent'](_0x40a62f,0xc,_0x2d0e9c['reason']);rpcDb['createAgentHistory'](_0x40a62f,_0x7dd3('0x100'));}ut[_0x7dd3('0x103')](_0x13711e,_0x7dd3('0x104'));logger[_0x7dd3('0x55')]('[originated][decrement][callProgressDetectingAgent]',_0x40a62f[_0x7dd3('0xb7')],'\x20Queue',_0x13711e[_0x7dd3('0x4d')],_0x7dd3('0x6f'),_0x13711e[_0x7dd3('0x46')]);delete this['actions'][_0x40a62f[_0x7dd3('0xb7')]];};Preview[_0x7dd3('0xe')][_0x7dd3('0xa5')]=function(_0x440ac9,_0x18cd93,_0x336250){return BPromise[_0x7dd3('0x105')]()[_0x7dd3('0x83')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x440ac9,_0x18cd93,_0x336250))[_0x7dd3('0x7b')](logger[_0x7dd3('0x55')]('[verifyAdditionalPhone]\x20'));};Preview[_0x7dd3('0xe')][_0x7dd3('0xb5')]=function(_0x352e65,_0x30ed36,_0x212d24){return BPromise[_0x7dd3('0x105')]()[_0x7dd3('0x83')](cmHopperAdditionalPhone[_0x7dd3('0xb5')](_0x352e65,_0x30ed36,_0x212d24))[_0x7dd3('0x7b')](logger['info']('[swapAdditionalPhone]\x20'));};Preview[_0x7dd3('0xe')][_0x7dd3('0xb4')]=function(_0x37492c){return BPromise['resolve']()['then'](cmHopperAdditionalPhone[_0x7dd3('0xb4')](_0x37492c))[_0x7dd3('0x7b')](logger[_0x7dd3('0x55')](_0x7dd3('0x106')));};Preview[_0x7dd3('0xe')]['checkInBlack']=function(_0xef114d,_0x5cf3ef,_0x5c4d2d,_0x323db6,_0x3d7882){var _0x15bc48=this;return new BPromise(function(_0x15c371,_0x16fabf){if(_[_0x7dd3('0x6b')](_0x5cf3ef)||_[_0x7dd3('0x6b')](_0x5cf3ef[_0x7dd3('0x107')])||_[_0x7dd3('0x6b')](_0x5cf3ef[_0x7dd3('0x108')])||_[_0x7dd3('0x6b')](_0x5cf3ef[_0x7dd3('0x76')])){_0x16fabf(ut[_0x7dd3('0x5b')]('Contact\x20is\x20undefined',_0x323db6,_0x3d7882));return;}var _0x3881de=uuid['v4']();var _0x22741a=_0x15bc48[_0x7dd3('0x12')][_0x5cf3ef['Queue'][_0x7dd3('0x4d')]];var _0x3df381=_0x5c4d2d?_0x15bc48[_0x7dd3('0x16')][_0x5c4d2d]['id']:undefined;_0x15bc48[_0x7dd3('0x15')][_0x3881de]=new Action(_0x5cf3ef,_0x22741a,_0x3881de,_0x5c4d2d,_0x3df381);var _0x5bae56=_0x15bc48[_0x7dd3('0x15')][_0x3881de];_0x5bae56[_0x7dd3('0xaf')]=_0x323db6;_0x5bae56[_0x7dd3('0xb0')]=_0x3d7882;_0x5bae56[_0x7dd3('0x109')]=_0x5c4d2d;if(_['isEmpty'](_0xef114d)){_0x15bc48[_0x7dd3('0x10a')](_0x5bae56,_0x22741a,_0x5cf3ef,_0x5c4d2d)[_0x7dd3('0x83')](function(_0x4ba0f1){logger['info'](_0x7dd3('0x10b'),'Queue:\x20'+_0x5bae56['queue']+'\x20IdHopper:\x20'+_0x5bae56[_0x7dd3('0xb3')],JSON['stringify'](_0x4ba0f1));ami[_0x7dd3('0x24')](_0x7dd3('0x10c'),ut[_0x7dd3('0xc5')](_0x5bae56,'called',_0x15bc48[_0x7dd3('0x12')][_0x5bae56[_0x7dd3('0x6e')]]));_0x15c371(ut[_0x7dd3('0x5b')](_0x7dd3('0x10d')));})[_0x7dd3('0x7b')](function(_0x1418c5){ut[_0x7dd3('0x5d')](_0x7dd3('0x10e'),_0x1418c5);_0x16fabf(ut[_0x7dd3('0x5b')](_0x7dd3('0x10f'),_0x323db6,_0x3d7882));});}else{_0x22741a[_0x7dd3('0x34')]+=0x1;ut[_0x7dd3('0x110')](_0x5bae56);rpcDb[_0x7dd3('0x111')](_0x5bae56,_0x7dd3('0x112'));delete _0x15bc48[_0x7dd3('0x15')][_0x3881de];_0x16fabf(ut[_0x7dd3('0x5b')](_0x7dd3('0x113'),_0x323db6,_0x3d7882));}});};Preview['prototype'][_0x7dd3('0x9c')]=function(_0x24cb29){return!_['isNil'](_0x24cb29)&&!_[_0x7dd3('0x6b')](_0x24cb29[_0x7dd3('0x4d')])&&!_[_0x7dd3('0x6b')](_0x24cb29['active'])&&_0x24cb29[_0x7dd3('0x4e')]&&!_[_0x7dd3('0x6b')](this[_0x7dd3('0x14')][util[_0x7dd3('0x52')](_0x7dd3('0x114'),_0x24cb29[_0x7dd3('0x4d')])])&&!_[_0x7dd3('0x6b')](this[_0x7dd3('0x14')][util[_0x7dd3('0x52')]('SIP/%s',_0x24cb29[_0x7dd3('0x4d')])][_0x7dd3('0x79')])&&(this['trunks'][util['format']('SIP/%s',_0x24cb29[_0x7dd3('0x4d')])]['status']==='reachable'||this[_0x7dd3('0x14')][util[_0x7dd3('0x52')]('SIP/%s',_0x24cb29['name'])][_0x7dd3('0x79')]==='unmonitored');};Preview['prototype']['run']=function(_0xc01aa2,_0x3d14d1){var _0x5449d9=this;return new BPromise(function(_0xf434f9,_0x2d9faa){_0x5449d9[_0x7dd3('0x115')](_0xc01aa2,_0x3d14d1)[_0x7dd3('0x83')](function(_0x2e61fa){_0xf434f9(_[_0x7dd3('0x73')](_0x2e61fa,['message']));})[_0x7dd3('0x7b')](function(_0x558175){if(_0x558175[_0x7dd3('0x116')]){rpcDb[_0x7dd3('0x117')](_0xc01aa2);}if(_0x558175[_0x7dd3('0x4e')]){rpcDb[_0x7dd3('0x8c')](_0xc01aa2);}_0x2d9faa(_[_0x7dd3('0x73')](_0x558175,[_0x7dd3('0x5b')]));});});};Preview['prototype'][_0x7dd3('0x115')]=function(_0x4c2fab,_0xa065b7){var _0x5f5264=this;return new BPromise(function(_0x310e53,_0x497828){var _0x378e04,_0x357700;rpcDb[_0x7dd3('0x118')](_0x4c2fab)['then'](function(_0x4cd13b){if(!_[_0x7dd3('0x6b')](_0x4cd13b[0x0])){_0x357700=_0x4cd13b[0x0][_0x7dd3('0x119')]?![]:!![];_0x378e04=_0x4cd13b[0x0][_0x7dd3('0x119')]?!![]:![];_0x378e04=_0xa065b7?!![]:_0x378e04;}var _0x516317=_0x5f5264[_0x7dd3('0x11a')](_0x4cd13b);if(_0x516317[_0x7dd3('0x11b')]){rpcDb[_0x7dd3('0x11c')](_[_0x7dd3('0x73')](_0x4cd13b[0x0],[_0x7dd3('0x76'),'phone']))[_0x7dd3('0x83')](function(_0x3b0f2){_0x5f5264[_0x7dd3('0x11d')](_0x3b0f2,_0x4cd13b[0x0],_0xa065b7,_0x357700,_0x378e04)[_0x7dd3('0x83')](function(_0x2f5136){_0x310e53(_0x2f5136);})[_0x7dd3('0x7b')](function(_0x38cee4){_0x497828(_0x38cee4);});})[_0x7dd3('0x7b')](function(_0x4901c7){ut[_0x7dd3('0x5d')](_0x7dd3('0x11e'),_0x4901c7);_0x497828(ut[_0x7dd3('0x5b')](_0x7dd3('0x11f'),_0x357700,_0x378e04));});}else{_0x497828(ut[_0x7dd3('0x5b')](_0x516317[_0x7dd3('0x5b')],_0x357700,_0x378e04));}})[_0x7dd3('0x7b')](function(_0x4e24d9){ut[_0x7dd3('0x5d')]('[Preview][getContactPreview]',_0x4e24d9);_0x497828(ut[_0x7dd3('0x5b')](_0x7dd3('0x11f'),![],!![]));});});};Preview['prototype'][_0x7dd3('0x11a')]=function(_0x3d7714){if(_['isNil'](_0x3d7714)||_[_0x7dd3('0x120')](_0x3d7714)||!_[_0x7dd3('0x6b')](_0x3d7714[0x0][_0x7dd3('0x87')])&&_[_0x7dd3('0x6b')](_0x3d7714[0x0][_0x7dd3('0x87')][_0x7dd3('0x4d')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x3d7714);return{'isValid':![],'message':_0x7dd3('0x121')};}var _0x1b3bad=this[_0x7dd3('0x12')][_0x3d7714[0x0]['Queue']['name']];_0x1b3bad[_0x7dd3('0x5b')]='ACTIVE';if(_['isNil'](_0x1b3bad)){ut[_0x7dd3('0x5d')](_0x7dd3('0x122'),_0x1b3bad);return{'isValid':![],'message':_0x7dd3('0x123')};}if(!this[_0x7dd3('0x9c')](_0x1b3bad[_0x7dd3('0x4c')])){ut[_0x7dd3('0x5d')](_0x7dd3('0x124'),_0x7dd3('0x125')+_0x1b3bad['name']+_0x7dd3('0x126'));if(!this[_0x7dd3('0x9c')](_0x1b3bad[_0x7dd3('0x9d')])){ut[_0x7dd3('0x5d')](_0x7dd3('0x124'),_0x1b3bad[_0x7dd3('0x4d')]+_0x7dd3('0x127'));return{'isValid':![],'message':_0x7dd3('0x128')};}}if(!ut[_0x7dd3('0x9b')](_0x1b3bad[_0x7dd3('0x67')])){ut[_0x7dd3('0x5d')]('[Preview][validateContact][Campaign\x20Active]',_0x1b3bad[_0x7dd3('0x4d')]+_0x7dd3('0x129'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x1b3bad[_0x7dd3('0x4d')]+_0x7dd3('0x129')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype']['execCall']=function(_0xfb8a69,_0x1e804d,_0x517dd4,_0x4db75d){var _0xaa2aa3=this;return new BPromise(function(_0x5d0bf0,_0x35ee38){var _0x1192b9=_0xfb8a69[_0x7dd3('0xb7')];var _0x1f02dd=_0xaa2aa3[_0x7dd3('0x9c')](_0x1e804d[_0x7dd3('0x4c')])?util[_0x7dd3('0x52')](_0x7dd3('0x12a'),_0x1e804d['Trunk']['name'],_[_0x7dd3('0x6b')](_0x1e804d[_0x7dd3('0x12b')])?'':_0x1e804d[_0x7dd3('0x12b')][_0x7dd3('0x12c')]()||'',_0x1e804d[_0x7dd3('0x12d')]>0x0?_0x517dd4[_0x7dd3('0x108')][_0x7dd3('0x12e')](_0x1e804d[_0x7dd3('0x12d')]):_0x517dd4['phone']):util[_0x7dd3('0x52')](_0x7dd3('0x12a'),_[_0x7dd3('0x6b')](_0x1e804d['TrunkBackup'])?_0x1e804d[_0x7dd3('0x4c')][_0x7dd3('0x4d')]:_0x1e804d[_0x7dd3('0x9d')]['name'],_[_0x7dd3('0x6b')](_0x1e804d['dialPrefix'])?'':_0x1e804d[_0x7dd3('0x12b')][_0x7dd3('0x12c')]()||'',_0x1e804d[_0x7dd3('0x12d')]>0x0?_0x517dd4[_0x7dd3('0x108')]['substring'](_0x1e804d[_0x7dd3('0x12d')]):_0x517dd4[_0x7dd3('0x108')]);var _0x6227fb=_0xaa2aa3[_0x7dd3('0x9c')](_0x1e804d['Trunk'])?ut[_0x7dd3('0x12f')](_0x1e804d[_0x7dd3('0x4c')][_0x7dd3('0x4f')],_0x1e804d[_0x7dd3('0x130')],_0x1e804d[_0x7dd3('0x131')]>0x0?ut[_0x7dd3('0x132')](_0x1e804d['dialOriginateCallerIdNumber'],_0x1e804d['dialRandomLastDigitCallerIdNumber']):_0x1e804d[_0x7dd3('0x30')]):ut['getCallerId'](_[_0x7dd3('0x6b')](_0x1e804d[_0x7dd3('0x9d')])?_0x1e804d[_0x7dd3('0x4c')][_0x7dd3('0x4f')]:_0x1e804d[_0x7dd3('0x9d')]['callerid'],_0x1e804d[_0x7dd3('0x130')],_0x1e804d['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x7dd3('0x132')](_0x1e804d[_0x7dd3('0x30')],_0x1e804d[_0x7dd3('0x131')]):_0x1e804d['dialOriginateCallerIdNumber']);if(_0x6227fb){_0xfb8a69['originatecalleridname']=ut['extractCalleridName'](_0x6227fb);_0xfb8a69[_0x7dd3('0x133')]=ut['extractCalleridNumber'](_0x6227fb);}var _0x282b6d=ut['addVariables'](_0x1e804d,_0x517dd4,_0x1f02dd,_0x6227fb,_0x1192b9,_0xfb8a69);_[_0x7dd3('0x134')](_0xfb8a69,ut[_0x7dd3('0x135')](_0x282b6d));_0xfb8a69[_0x7dd3('0x8d')]=moment()['format'](_0x7dd3('0x8e'));ami['Action'](ut[_0x7dd3('0x136')](_0xfb8a69,_0x1e804d,_0x282b6d,_0xfb8a69[_0x7dd3('0xb0')],_0x4db75d))[_0x7dd3('0x83')](function(_0x3667b3){_0x1e804d[_0x7dd3('0x46')]+=0x1;logger['info'](_0x7dd3('0x137'),_0x1192b9,_0x7dd3('0xc3'),_0x1e804d[_0x7dd3('0x4d')],_0x7dd3('0x6f'),_0x1e804d['originated']);_0x5d0bf0(_0x3667b3);})['catch'](function(_0x5794dc){ut[_0x7dd3('0xfa')](_0xfb8a69,0xe,_0x7dd3('0x138'));rpcDb[_0x7dd3('0xfb')](_0xfb8a69,_0x7dd3('0x139'));_0x35ee38(_0x5794dc);});});};Preview[_0x7dd3('0xe')][_0x7dd3('0x1e')]=function(_0x9df683){if(this[_0x7dd3('0x15')][_0x9df683[_0x7dd3('0xb1')]]){this[_0x7dd3('0x15')][_0x9df683['linkedid']][_0x7dd3('0x7a')]=_0x9df683[_0x7dd3('0x7a')];}};Preview['prototype'][_0x7dd3('0x13a')]=function(_0x496b0e){var _0x39e752=this;var _0x46792c=this[_0x7dd3('0x15')][_0x496b0e[_0x7dd3('0x13b')]];if(_0x46792c){if(_0x46792c[_0x7dd3('0x109')]&&this[_0x7dd3('0x16')][_0x46792c[_0x7dd3('0x109')]]){ut[_0x7dd3('0x13c')](_0x46792c,this['agents'][_0x46792c[_0x7dd3('0x109')]][_0x7dd3('0x4d')],this['agents'][_0x46792c[_0x7dd3('0x109')]]['id']);}var _0x568a05=_[_0x7dd3('0x13d')](_0x46792c);_0x568a05['responsetime']=moment()[_0x7dd3('0x52')]('YYYY-MM-DD\x20HH:mm:ss');var _0x16a5e4=_0x39e752['campaignsPreview'][_0x46792c[_0x7dd3('0x6e')]];if(ut[_0x7dd3('0x13e')](_0x496b0e[_0x7dd3('0x13f')])){if(_0x46792c[_0x7dd3('0xaf')]){rpcDb[_0x7dd3('0x117')](_0x46792c[_0x7dd3('0xb3')]);}if(_0x46792c[_0x7dd3('0xb0')]){rpcDb['disableContact'](_0x46792c['idContact']);}ami[_0x7dd3('0x24')](_0x7dd3('0x140'),ut['buildObj'](_0x46792c,_0x7dd3('0x141'),this[_0x7dd3('0x12')][_0x46792c[_0x7dd3('0x6e')]]));this[_0x7dd3('0xf6')](_0x568a05,_0x16a5e4,_0x496b0e);}else{_0x46792c[_0x7dd3('0x8d')]=moment()[_0x7dd3('0x52')](_0x7dd3('0x8e'));ut[_0x7dd3('0xfa')](_0x568a05,0x4,'Answer');rpcDb[_0x7dd3('0xfb')](_0x568a05,_0x7dd3('0x142'));}}};Preview[_0x7dd3('0xe')][_0x7dd3('0x18')]=function(_0x4b9ea4){var _0x9d3c58=this;var _0x583761=this['actions'][_0x4b9ea4['linkedid']];var _0x16c1f5;if(_0x583761){_0x16c1f5=this[_0x7dd3('0x12')][_0x583761[_0x7dd3('0x6e')]];logger['info'](_0x7dd3('0x143'),_0x4b9ea4[_0x7dd3('0xb1')],_0x7dd3('0xc3'),_0x16c1f5[_0x7dd3('0x4d')],_0x7dd3('0x70'),_0x16c1f5[_0x7dd3('0x71')]);}if(this[_0x7dd3('0x15')][_0x4b9ea4[_0x7dd3('0xb1')]]&&_0x4b9ea4['linkedid']!==_0x4b9ea4['uniqueid']){if(_0x4b9ea4['cause']==='16'&&this[_0x7dd3('0x15')][_0x4b9ea4[_0x7dd3('0xb1')]]['dialAnswer']){this[_0x7dd3('0x144')](_0x4b9ea4,_0x4b9ea4[_0x7dd3('0xb1')],_0x4b9ea4[_0x7dd3('0x145')]);}else if(this[_0x7dd3('0x15')][_0x4b9ea4['linkedid']]['dialAnswer']){logger[_0x7dd3('0x55')](_0x7dd3('0x146'),_0x4b9ea4['linkedid'],_0x4b9ea4[_0x7dd3('0x145')],_0x7dd3('0xc3'),_0x16c1f5[_0x7dd3('0x4d')],_0x7dd3('0x70'),_0x16c1f5[_0x7dd3('0x71')]);this[_0x7dd3('0x144')](_0x4b9ea4,_0x4b9ea4[_0x7dd3('0xb1')],_0x4b9ea4[_0x7dd3('0x145')]);}}else if(_0x583761&&_[_0x7dd3('0x6b')](_0x583761['statedesc'])&&_0x16c1f5[_0x7dd3('0x147')]&&_0x4b9ea4['linkedid']===_0x4b9ea4[_0x7dd3('0xb7')]&&_[_0x7dd3('0x6b')](_0x4b9ea4['reason'])&&_0x4b9ea4['cause']==='16'&&_0x4b9ea4[_0x7dd3('0x148')]==='6'&&_[_0x7dd3('0xf7')](_0x583761[_0x7dd3('0x149')])){if(_0x583761[_0x7dd3('0xaf')]){rpcDb[_0x7dd3('0x117')](_0x583761[_0x7dd3('0xb3')]);}if(_0x583761[_0x7dd3('0xb0')]){rpcDb[_0x7dd3('0x8c')](_0x583761[_0x7dd3('0xb3')]);}_0x4b9ea4['reason']='22';this[_0x7dd3('0xf6')](_0x583761,_0x16c1f5,_0x4b9ea4);}else if(_0x583761&&_0x583761[_0x7dd3('0x149')]){if(_0x4b9ea4[_0x7dd3('0x145')]==='16'&&this[_0x7dd3('0x15')][_0x4b9ea4[_0x7dd3('0xb1')]][_0x7dd3('0x72')]){logger[_0x7dd3('0x55')](_0x7dd3('0x14a'),_0x4b9ea4['linkedid'],_0x4b9ea4['cause'],'\x20Queue',_0x16c1f5[_0x7dd3('0x4d')],_0x7dd3('0x70'),_0x16c1f5[_0x7dd3('0x71')]);this[_0x7dd3('0x144')](_0x4b9ea4,_0x4b9ea4[_0x7dd3('0xb1')],_0x4b9ea4[_0x7dd3('0x145')]);}else if(this[_0x7dd3('0x15')][_0x4b9ea4[_0x7dd3('0xb1')]][_0x7dd3('0x72')]){logger[_0x7dd3('0x55')](_0x7dd3('0x146'),_0x4b9ea4[_0x7dd3('0xb1')],_0x4b9ea4[_0x7dd3('0x145')],_0x7dd3('0xc3'),_0x16c1f5[_0x7dd3('0x4d')],_0x7dd3('0x70'),_0x16c1f5[_0x7dd3('0x71')]);this['callProgressDetectingCustomer'](_0x4b9ea4,_0x4b9ea4[_0x7dd3('0xb1')],_0x4b9ea4['cause']);}}};Preview[_0x7dd3('0xe')][_0x7dd3('0x1c')]=function(_0x3fa0ee){if(this['actions'][_0x3fa0ee['destlinkedid']]&&_0x3fa0ee[_0x7dd3('0xf5')]!==_0x3fa0ee[_0x7dd3('0x14b')]){this[_0x7dd3('0x144')](_0x3fa0ee,_0x3fa0ee[_0x7dd3('0xf5')],_0x3fa0ee['dialstatus']);}};Preview[_0x7dd3('0xe')][_0x7dd3('0x1a')]=function(_0x2967d6){if(this[_0x7dd3('0x15')][_0x2967d6[_0x7dd3('0xb1')]]&&_0x2967d6[_0x7dd3('0xb1')]!==_0x2967d6[_0x7dd3('0xb7')]&&!this[_0x7dd3('0x15')][_0x2967d6['linkedid']][_0x7dd3('0x72')]){if(_0x2967d6[_0x7dd3('0x145')]==='1'){this[_0x7dd3('0x144')](_0x2967d6,_0x2967d6[_0x7dd3('0xb1')],_0x2967d6[_0x7dd3('0x145')]);}}};Preview[_0x7dd3('0xe')][_0x7dd3('0x14c')]=function(_0x2e06f5,_0x2cd5b6,_0x3feeae){if(this[_0x7dd3('0x15')][_0x2e06f5]){if(_['isNil'](this[_0x7dd3('0x15')][_0x2e06f5][_0x7dd3('0x14d')])){this[_0x7dd3('0x15')][_0x2e06f5][_0x7dd3('0x14d')]={};}this['actions'][_0x2e06f5][_0x7dd3('0x14d')][_0x2cd5b6]=_0x3feeae;}};Preview[_0x7dd3('0xe')]['syncVarSet']=function(_0x54adcc){try{if(!_[_0x7dd3('0x6b')](_0x54adcc)){if(ut[_0x7dd3('0x14e')](_['keys'](_0x54adcc[_0x7dd3('0x14f')])[0x0])){this['addVariable'](_0x54adcc[_0x7dd3('0xb7')],_[_0x7dd3('0x150')](_0x54adcc[_0x7dd3('0x14f')])[0x0],_0x54adcc[_0x7dd3('0x151')]);}}}catch(_0x3541b1){logger[_0x7dd3('0x152')]('[syncVarSet][Preview]',util[_0x7dd3('0x153')](_0x3541b1,{'showHidden':![],'depth':null}));}};Preview[_0x7dd3('0xe')][_0x7dd3('0x21')]=function(_0x54eb0c){if(_0x54eb0c){if(this['actions'][_0x54eb0c[_0x7dd3('0x154')]]){this['actions'][_0x54eb0c[_0x7dd3('0x154')]][_0x7dd3('0x149')]=!![];}}};Preview['prototype'][_0x7dd3('0x22')]=function(_0x20e4f7){if(_0x20e4f7){if(this[_0x7dd3('0x15')][_0x20e4f7[_0x7dd3('0x155')]]){this['actions'][_0x20e4f7[_0x7dd3('0x155')]][_0x7dd3('0x149')]=!![];}}};module[_0x7dd3('0x156')]=Preview; \ No newline at end of file +var _0xb513=['predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','emit','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','paused','message','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','booked','recallMe','[clearZombieChannels][talking]','queue','pTalking:\x20','dialAnswer','pick','UserId','ListId','Action','status','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','info','size','clearZombieChannel','then','length','getDiff','scheduledat','dialRecallMeTimeout','voicePause','run','logger2','[RecallMe]','starttime','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','setMessage','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','createCustomerHistory','verifyAdditionalPhones','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','actioncountonusuch','idContact','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','linkedid','countbusyretry','Busy','callAdditionalPhoneAfterMin','custom:agentbusy','additional','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','scheduledAt','activeContact','incrementPreviewCounters','NOANSWER','outboundNoAnswerCallsDay','dialNoAnswerRetryFrequency','noanswer','[callProgressDetectingCustomer][logNoAnswer]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','originated:\x20','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','[callProgressDetectingAgent][logNoAnswer]','logAgent','createAgentHistory','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[originated][decrement][callProgressDetectingAgent]','originated','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','isNil','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','Queue','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','unlock','disableContact','validateContact','isValid','checkInBlack','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','dialPrefix','dialCutDigit','substring','SIP/%s/%s%s','trim','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','merge','variablesAction','OriginateError','syncNewExten','channel','actionid','lookAgent','logLookAgent','isFailure','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','unlockContact','[syncHangup][talking][transfer]','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','util','bluebird','moment','md5','ioredis','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','varset','syncVarSet','attendedtransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','answered','available','sumBillable','sumHoldTime','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime'];(function(_0x46d38e,_0x4b9456){var _0x2f83ad=function(_0x4f4b59){while(--_0x4f4b59){_0x46d38e['push'](_0x46d38e['shift']());}};_0x2f83ad(++_0x4b9456);}(_0xb513,0x113));var _0x3b51=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0xb513[_0x4327fe];return _0x138651;};'use strict';var util=require(_0x3b51('0x0'));var _=require('lodash');var BPromise=require(_0x3b51('0x1'));var uuid=require('uuid');var moment=require(_0x3b51('0x2'));var md5=require(_0x3b51('0x3'));var Redis=require(_0x3b51('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x3b51('0x5'));var loggerAction=require('../../../config/logger')(_0x3b51('0x6'));var ami=require(_0x3b51('0x7'));var rpcDb=require(_0x3b51('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x3b51('0x9'));var ut=require(_0x3b51('0xa'));config[_0x3b51('0xb')]=_['defaults'](config['redis'],{'host':_0x3b51('0xc'),'port':0x18eb});var io=require(_0x3b51('0xd'))(new Redis(config[_0x3b51('0xb')]));var Sequence=function(){};Sequence['prototype'][_0x3b51('0xe')]=function(_0x2b2e43){this['tail']=this[_0x3b51('0xf')]?this['tail'][_0x3b51('0x10')](_0x2b2e43):_0x2b2e43();};function Preview(_0x25c5d2){this[_0x3b51('0x11')]=new Sequence();this[_0x3b51('0x12')]=_0x25c5d2[_0x3b51('0x13')];this[_0x3b51('0x14')]=_0x25c5d2[_0x3b51('0x14')];this[_0x3b51('0x15')]={};this[_0x3b51('0x16')]=_0x25c5d2[_0x3b51('0x16')];this[_0x3b51('0x17')]=0x0;ami['on'](_0x3b51('0x18'),this[_0x3b51('0x19')][_0x3b51('0x1a')](this));ami['on']('hangup',this[_0x3b51('0x1b')][_0x3b51('0x1a')](this));ami['on'](_0x3b51('0x1c'),this[_0x3b51('0x1d')]['bind'](this));ami['on']('dialend',this[_0x3b51('0x1e')]['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x3b51('0x1a')](this));ami['on'](_0x3b51('0x1f'),this[_0x3b51('0x20')][_0x3b51('0x1a')](this));ami['on'](_0x3b51('0x21'),this['syncAttendedTransfer'][_0x3b51('0x1a')](this));ami['on']('blindtransfer',this[_0x3b51('0x22')][_0x3b51('0x1a')](this));this[_0x3b51('0x23')](this[_0x3b51('0x12')]);}function emit(_0x4b0575,_0x1233bc,_0x4fba74){io['to'](_0x4b0575)['emit'](_0x1233bc,_0x4fba74);}function emitCampaignPreview(_0x5c34ee){if(_0x5c34ee[_0x3b51('0x24')]===_0x3b51('0x25')){var _0xcf74c5={'id':_0x5c34ee['id'],'name':_0x5c34ee[_0x3b51('0x26')],'strategy':_0x5c34ee['strategy'],'answered':_0x5c34ee[_0x3b51('0x27')],'available':_0x5c34ee[_0x3b51('0x28')],'loggedIn':_0x5c34ee['loggedIn'],'pTalking':_0x5c34ee['pTalking'],'sumBillable':_0x5c34ee[_0x3b51('0x29')],'sumDuration':_0x5c34ee['sumDuration'],'sumHoldTime':_0x5c34ee[_0x3b51('0x2a')]||0x0,'talking':_0x5c34ee['talking'],'total':_0x5c34ee['total'],'type':_0x5c34ee['type'],'unmanaged':_0x5c34ee[_0x3b51('0x2b')],'abandoned':_0x5c34ee[_0x3b51('0x2c')],'waiting':_0x5c34ee[_0x3b51('0x2d')],'loggedInDb':_0x5c34ee['loggedInDb'],'dialActive':_0x5c34ee[_0x3b51('0x2e')],'dialMethod':_0x5c34ee[_0x3b51('0x2f')],'dialOriginateCallerIdName':_0x5c34ee[_0x3b51('0x30')],'dialOriginateCallerIdNumber':_0x5c34ee['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x5c34ee[_0x3b51('0x31')],'dialPrefix':_0x5c34ee['dialPrefix'],'outboundAnswerAgiCallsDay':_0x5c34ee[_0x3b51('0x32')],'outboundAnswerCallsDay':_0x5c34ee[_0x3b51('0x33')],'outboundBlacklistCallsDay':_0x5c34ee[_0x3b51('0x34')],'outboundBusyCallsDay':_0x5c34ee[_0x3b51('0x35')],'outboundCongestionCallsDay':_0x5c34ee[_0x3b51('0x36')],'outboundDropCallsDayACS':_0x5c34ee[_0x3b51('0x37')],'outboundDropCallsDayCallersExit':_0x5c34ee[_0x3b51('0x38')],'outboundDropCallsDayTimeout':_0x5c34ee[_0x3b51('0x39')],'outboundNoAnswerCallsDay':_0x5c34ee['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x5c34ee['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x5c34ee[_0x3b51('0x3a')],'outboundReCallsDay':_0x5c34ee[_0x3b51('0x3b')],'outboundRejectCallsDay':_0x5c34ee[_0x3b51('0x3c')],'outboundUnknownCallsDay':_0x5c34ee[_0x3b51('0x3d')],'outboundAbandonedCallsDay':_0x5c34ee[_0x3b51('0x3e')],'predictiveIntervalAnsweredCalls':_0x5c34ee[_0x3b51('0x3f')],'predictiveIntervalAvgHoldtime':_0x5c34ee[_0x3b51('0x40')],'predictiveIntervalAvgTalktime':_0x5c34ee[_0x3b51('0x41')],'predictiveIntervalDroppedCallsCallersExit':_0x5c34ee[_0x3b51('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x5c34ee[_0x3b51('0x43')],'predictiveIntervalErlangCalls':_0x5c34ee[_0x3b51('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x5c34ee['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x5c34ee[_0x3b51('0x45')],'predictiveIntervalMultiplicativeFactor':_0x5c34ee['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x5c34ee[_0x3b51('0x46')],'predictiveIntervalAvailable':_0x5c34ee[_0x3b51('0x47')],'predictiveIntervalTotalCalls':_0x5c34ee[_0x3b51('0x48')],'message':_0x5c34ee['message'],'originated':_0x5c34ee['originated'],'erlangCalls':_0x5c34ee['erlangCalls'],'erlangCallToSecond':_0x5c34ee[_0x3b51('0x49')],'erlangAbandonmentRate':_0x5c34ee[_0x3b51('0x4a')],'erlangBusyFactor':_0x5c34ee[_0x3b51('0x4b')],'startPredictive':_0x5c34ee['startPredictive'],'startProgressive':_0x5c34ee[_0x3b51('0x4c')]};if(_0x5c34ee[_0x3b51('0x4d')]){_0xcf74c5[_0x3b51('0x4d')]={'id':_0x5c34ee['Trunk']['id'],'name':_0x5c34ee['Trunk'][_0x3b51('0x26')],'active':_0x5c34ee[_0x3b51('0x4d')]['active'],'callerid':_0x5c34ee[_0x3b51('0x4d')][_0x3b51('0x4e')]};}if(_0x5c34ee[_0x3b51('0x4f')]){_0xcf74c5['Interval']={'id':_0x5c34ee[_0x3b51('0x4f')]['id'],'name':_0x5c34ee['Interval'][_0x3b51('0x26')]};}var _0x4b9e0c=md5(JSON[_0x3b51('0x50')](_0xcf74c5));if(_0x5c34ee['md5']!==_0x4b9e0c){_0x5c34ee[_0x3b51('0x3')]=_0x4b9e0c;emit(util[_0x3b51('0x51')](_0x3b51('0x52'),_0xcf74c5[_0x3b51('0x26')]),_0x3b51('0x53'),_0xcf74c5);}}}function emitVoiceQueueChannelRemove(_0x56ad30){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x3b51('0x50')](_0x56ad30));emit(util[_0x3b51('0x51')](_0x3b51('0x52'),_0x56ad30[_0x3b51('0x26')]),_0x3b51('0x54'),_0x56ad30);io[_0x3b51('0x55')](_0x3b51('0x56'),_0x56ad30);}function notSendMessagesQueue(_0x2b6c1f){if(_0x2b6c1f[_0x3b51('0x57')]){if(_0x2b6c1f['originated']===0x0&&_0x2b6c1f[_0x3b51('0x58')]===0x0){_0x2b6c1f[_0x3b51('0x57')]=![];_0x2b6c1f[_0x3b51('0x28')]=0x0;_0x2b6c1f[_0x3b51('0x59')]=0x0;_0x2b6c1f[_0x3b51('0x5a')]='NOT_ACTIVE';ut[_0x3b51('0x5b')](_0x3b51('0x5c'),_0x2b6c1f[_0x3b51('0x26')]+_0x3b51('0x5d'));}else{_0x2b6c1f[_0x3b51('0x5a')]=_0x3b51('0x5e');ut[_0x3b51('0x5b')](_0x3b51('0x5c'),_0x2b6c1f['name']+_0x3b51('0x5f'));}emitCampaignPreview(_0x2b6c1f);}}Preview[_0x3b51('0x60')][_0x3b51('0x23')]=function(){var _0x495ecc=this;setInterval(function(){_0x495ecc[_0x3b51('0x61')]();},0x7cf);};Preview[_0x3b51('0x60')][_0x3b51('0x61')]=function(){var _0x214d92=this[_0x3b51('0x12')];this[_0x3b51('0x17')]+=0x1;for(var _0x5bcfdc in _0x214d92){if(_0x214d92[_0x3b51('0x62')](_0x5bcfdc)&&(_0x214d92[_0x5bcfdc]['dialMethod']==='preview'||_0x214d92[_0x5bcfdc][_0x3b51('0x2f')]===_0x3b51('0x63'))&&_0x214d92[_0x5bcfdc][_0x3b51('0x24')]===_0x3b51('0x25')){if(this['clockClearZombieChannels']>0x7){this[_0x3b51('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x214d92[_0x3b51('0x62')](_0x5bcfdc)&&_0x214d92[_0x5bcfdc][_0x3b51('0x2f')]===_0x3b51('0x5')&&_0x214d92[_0x5bcfdc][_0x3b51('0x24')]===_0x3b51('0x25')){if(_0x214d92[_0x5bcfdc][_0x3b51('0x2e')]){this['setMessage'](_0x214d92[_0x5bcfdc]);this[_0x3b51('0x64')](_0x214d92[_0x5bcfdc]);}else{notSendMessagesQueue(_0x214d92[_0x5bcfdc]);}}}};Preview[_0x3b51('0x60')]['clearZombieChannel']=function(_0x4acc6a){var _0x2cac40=this;this[_0x3b51('0x11')][_0x3b51('0xe')](function(){if(!_['isNil'](_0x2cac40['actions'][_0x4acc6a])){loggerAction['info'](_0x3b51('0x65'),_0x4acc6a,'Queue',_0x2cac40[_0x3b51('0x15')][_0x4acc6a]['queue'],'originated:\x20',JSON['stringify'](_0x2cac40[_0x3b51('0x12')][_0x2cac40['actions'][_0x4acc6a][_0x3b51('0x66')]]['originated']),_0x3b51('0x67'),JSON[_0x3b51('0x50')](_0x2cac40[_0x3b51('0x12')][_0x2cac40[_0x3b51('0x15')][_0x4acc6a][_0x3b51('0x66')]][_0x3b51('0x58')]),JSON[_0x3b51('0x50')](_0x2cac40[_0x3b51('0x15')][_0x4acc6a][_0x3b51('0x68')]),JSON['stringify'](_[_0x3b51('0x69')](_0x2cac40['actions'][_0x4acc6a],['contactId',_0x3b51('0x6a'),'VoiceQueueId',_0x3b51('0x6b')])));return ami[_0x3b51('0x6c')]({'action':_0x3b51('0x6d'),'channel':_0x2cac40[_0x3b51('0x15')][_0x4acc6a]['channel']})[_0x3b51('0x6e')](function(_0x520eb6){if(_0x520eb6[_0x3b51('0x5a')]===_0x3b51('0x6f')){setTimeout(function(){if(_0x2cac40['actions'][_0x4acc6a]){ut[_0x3b51('0x70')](_0x2cac40[_0x3b51('0x12')][_0x2cac40[_0x3b51('0x15')][_0x4acc6a]['queue']],_0x3b51('0x71'));if(_0x2cac40[_0x3b51('0x15')][_0x4acc6a]['dialAnswer']===!![]){ut[_0x3b51('0x72')](_0x2cac40[_0x3b51('0x12')][_0x2cac40[_0x3b51('0x15')][_0x4acc6a][_0x3b51('0x66')]],_0x3b51('0x71'));ut['loggerError'](_0x3b51('0x73')+_0x4acc6a,_0x2cac40['actions'][_0x4acc6a][_0x3b51('0x66')]);}ut[_0x3b51('0x74')](_0x3b51('0x75')+_0x4acc6a,_0x2cac40[_0x3b51('0x15')][_0x4acc6a][_0x3b51('0x66')]);delete _0x2cac40[_0x3b51('0x15')][_0x4acc6a];}},0x2328);}});}});};Preview[_0x3b51('0x60')]['clearZombieChannels']=function(){var _0x142a5e=this;loggerAction[_0x3b51('0x76')]('[action]',_[_0x3b51('0x77')](this[_0x3b51('0x15')]));for(var _0x5a5509 in this[_0x3b51('0x15')]){if(_0x142a5e[_0x3b51('0x15')][_0x3b51('0x62')](_0x5a5509)){_0x142a5e[_0x3b51('0x78')](_0x5a5509);}}};Preview[_0x3b51('0x60')][_0x3b51('0x64')]=function(_0x108f19){var _0x55b428=this;rpcDb['getContactRecallMe'](_0x108f19['id'],ut['agentReadyId'](this[_0x3b51('0x16')]))[_0x3b51('0x79')](function(_0x2ba07a){if(!_['isNil'](_0x2ba07a)){for(var _0x3ecaa8=0x0;_0x3ecaa8<_0x2ba07a[_0x3b51('0x7a')];_0x3ecaa8+=0x1){if(ut[_0x3b51('0x7b')](_0x2ba07a[_0x3ecaa8][_0x3b51('0x7c')])<_0x108f19[_0x3b51('0x7d')]*0x3c){if(_0x2ba07a[_0x3ecaa8]['Agent']&&!_0x2ba07a[_0x3ecaa8]['Agent'][_0x3b51('0x7e')]){_0x55b428[_0x3b51('0x7f')](_0x2ba07a[_0x3ecaa8]['id'])[_0x3b51('0x79')](ut[_0x3b51('0x80')](_0x3b51('0x81')))[_0x3b51('0x6e')](ut['logger2'](_0x3b51('0x81')));}else{rpcDb['disableContact'](_0x2ba07a[_0x3ecaa8]['id']);}}else{var _0x3a8849=new Action(_0x2ba07a[_0x3ecaa8],_0x108f19);_0x3a8849[_0x3b51('0x82')]=moment()[_0x3b51('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x108f19[_0x3b51('0x3b')]+=0x1;ut['logCustomer'](_0x3a8849,0x17,'RecallInQueue');if(_0x108f19[_0x3b51('0x83')]){rpcDb[_0x3b51('0x84')](ut[_0x3b51('0x85')](_0x2ba07a[_0x3ecaa8]));rpcDb['createCustomerHistory'](_0x3a8849,_0x3b51('0x86'));}else{ut[_0x3b51('0x87')](_0x3a8849,0x16,_0x3b51('0x88'));rpcDb['createCustomerHistory'](_0x3a8849,'[HistoryRecallClose]');rpcDb[_0x3b51('0x89')](_0x3a8849,_0x3b51('0x8a'));}}}}})[_0x3b51('0x6e')](ut[_0x3b51('0x80')]('[getContactRecallMe]'));};Preview[_0x3b51('0x60')][_0x3b51('0x8b')]=function(_0x5e7c98){_0x5e7c98[_0x3b51('0x57')]=!![];if(ut[_0x3b51('0x8c')](_0x5e7c98[_0x3b51('0x8d')])){_0x5e7c98[_0x3b51('0x5a')]=_0x3b51('0x8e');}else if(!ut[_0x3b51('0x8f')](_0x5e7c98[_0x3b51('0x2e')])){_0x5e7c98[_0x3b51('0x5a')]=_0x3b51('0x90');}else if(!this[_0x3b51('0x91')](_0x5e7c98[_0x3b51('0x4d')])){if(!this[_0x3b51('0x91')](_0x5e7c98[_0x3b51('0x92')])){_0x5e7c98[_0x3b51('0x5a')]=_0x3b51('0x93');}else{_0x5e7c98[_0x3b51('0x5a')]='ACTIVE';}}else{_0x5e7c98['message']=_0x3b51('0x94');}emitCampaignPreview(_0x5e7c98);};Preview[_0x3b51('0x60')][_0x3b51('0x95')]=function(_0x2734c4,_0x3aa374,_0x4fde2d){var _0x31c893=this;var _0x12236c=this[_0x3b51('0x15')][_0x3aa374];var _0x1b0ab3=this[_0x3b51('0x12')][_0x12236c['queue']];var _0x58897b;var _0x5338dc=![];var _0x53edb6=0x2;var _0x597d92=0x3;if(_0x1b0ab3){switch(_0x4fde2d){case'1':_0x1b0ab3['outboundNoSuchCallsDay']+=0x1;_0x12236c['countnosuchnumberretry']+=0x1;_0x12236c['countglobal']=ut['totalGlobal'](_0x12236c);ut[_0x3b51('0x87')](_0x12236c,0x0,_0x3b51('0x96'));ami[_0x3b51('0x55')](_0x3b51('0x97'),ut[_0x3b51('0x98')](_0x12236c,_0x3b51('0x99')));rpcDb[_0x3b51('0x9a')](_0x12236c,'[callProgressDetectingCustomer][logNoSuch]');_0x31c893[_0x3b51('0x9b')](_0x12236c,'0',_0x1b0ab3)['then'](function(_0x42ce47){_0x5338dc=_0x42ce47['additional']==0x1;_0x53edb6=_0x1b0ab3['dialNoSuchNumberRetryFrequency'];_0x597d92=_0x1b0ab3['callAdditionalPhoneAfterMin'];if(!_0x5338dc){if(ut[_0x3b51('0x9c')](_0x12236c)>=_0x1b0ab3[_0x3b51('0x9d')]){_0x58897b=ut[_0x3b51('0x9e')](_0x12236c,0xf,_0x3b51('0x9f'));rpcDb['createCustomerFinal'](_0x58897b,_0x3b51('0xa0'));}else{if(_0x12236c[_0x3b51('0xa1')]>=_0x1b0ab3['dialNoSuchNumberMaxRetry']){rpcDb[_0x3b51('0x89')](_0x12236c,_0x3b51('0xa0'));}else{rpcDb[_0x3b51('0xa2')](ut['scheduledAt'](_0x12236c,_0x3b51('0xa1'),_0x1b0ab3[_0x3b51('0xa3')]),_0x12236c[_0x3b51('0xa4')],_0x12236c['activeContact']);}}delete this[_0x3b51('0x15')][_0x2734c4['linkedid']];}else{_0x12236c[_0x3b51('0xa1')]++;logger['info'](_0x3b51('0xa5'),_0x12236c[_0x3b51('0xa1')]);logger[_0x3b51('0x76')]('id',_0x12236c[_0x3b51('0xa6')]);_0x31c893['incrementPreviewCounters']({'id':_0x12236c[_0x3b51('0xa6')],'field':{'countnosuchnumberretry':_0x12236c[_0x3b51('0xa1')]}})[_0x3b51('0x79')](function(){_0x31c893[_0x3b51('0xa7')](_0x12236c,_0x53edb6,_0x597d92)[_0x3b51('0x79')](function(){});});}});break;case _0x3b51('0xa8'):var _0x3ec117=moment()[_0x3b51('0x51')](_0x3b51('0xa9'));_0x12236c[_0x3b51('0xaa')]=_0x3ec117;_0x12236c['answertime']=_0x3ec117;_0x12236c[_0x3b51('0x68')]=!![];_0x1b0ab3[_0x3b51('0x58')]+=0x1;logger[_0x3b51('0x76')](_0x3b51('0xab'),_0x12236c[_0x3b51('0xac')],_0x3b51('0xad'),_0x1b0ab3[_0x3b51('0x26')],_0x3b51('0x67'),_0x1b0ab3['pTalking']);ami[_0x3b51('0x55')](_0x3b51('0xae'),ut[_0x3b51('0x98')](_0x12236c,_0x3b51('0xaf'),this[_0x3b51('0x12')][_0x12236c[_0x3b51('0x66')]]));if(_0x1b0ab3[_0x3b51('0xb0')]){ami[_0x3b51('0x55')](_0x3b51('0xb1'),ut[_0x3b51('0xb2')](_0x12236c));}break;case'16':ami[_0x3b51('0x55')]('custom:agentcomplete',ut[_0x3b51('0x98')](_0x12236c,'complete',this[_0x3b51('0x12')][_0x12236c[_0x3b51('0x66')]]));emitVoiceQueueChannelRemove(ut[_0x3b51('0x98')](_0x12236c,'complete'));_0x1b0ab3[_0x3b51('0x33')]+=0x1;_0x1b0ab3['total']+=0x1;_0x1b0ab3[_0x3b51('0x27')]+=0x1;ut[_0x3b51('0x72')](_0x1b0ab3,_0x3b51('0xb3'));_0x12236c[_0x3b51('0xb4')]=ut[_0x3b51('0x9c')](_0x12236c);ut[_0x3b51('0x87')](_0x12236c,0x4,_0x3b51('0xb5'));rpcDb[_0x3b51('0x9a')](_0x12236c,_0x3b51('0xb6'));rpcDb[_0x3b51('0x89')](_0x12236c,_0x3b51('0xb7'));rpcDb[_0x3b51('0xb8')](_0x12236c);_0x1b0ab3[_0x3b51('0xb9')]+=_0x12236c[_0x3b51('0xba')];_0x1b0ab3[_0x3b51('0x29')]+=_0x12236c[_0x3b51('0xba')];logger[_0x3b51('0x76')](_0x3b51('0xbb'),_0x12236c['uniqueid'],_0x3b51('0xad'),_0x1b0ab3[_0x3b51('0x26')],_0x3b51('0x67'),_0x1b0ab3[_0x3b51('0x58')]);delete this[_0x3b51('0x15')][_0x2734c4[_0x3b51('0xbc')]];break;case'BUSY':_0x1b0ab3['outboundBusyCallsDay']+=0x1;_0x12236c[_0x3b51('0xbd')]+=0x1;_0x12236c[_0x3b51('0xb4')]=ut['totalGlobal'](_0x12236c);ut[_0x3b51('0x87')](_0x12236c,0x5,_0x3b51('0xbe'));_0x53edb6=_0x1b0ab3['dialBusyRetryFrequency'];_0x597d92=_0x1b0ab3[_0x3b51('0xbf')];ami[_0x3b51('0x55')](_0x3b51('0xc0'),ut[_0x3b51('0x98')](_0x12236c,'busy'));rpcDb[_0x3b51('0x9a')](_0x12236c,'[callProgressDetectingCustomer][logBusy]');_0x31c893[_0x3b51('0x9b')](_0x12236c,'5',_0x1b0ab3)[_0x3b51('0x79')](function(_0x4c19c8){_0x5338dc=_0x4c19c8[_0x3b51('0xc1')]==0x1;if(!_0x5338dc){if(ut[_0x3b51('0x9c')](_0x12236c)>=_0x1b0ab3[_0x3b51('0x9d')]){_0x58897b=ut[_0x3b51('0x9e')](_0x12236c,0xf,_0x3b51('0x9f'));rpcDb[_0x3b51('0x89')](_0x58897b,_0x3b51('0xc2'));}else{if(_0x12236c['countbusyretry']>=_0x1b0ab3[_0x3b51('0xc3')]){rpcDb[_0x3b51('0x89')](_0x12236c,_0x3b51('0xc4'));}else{rpcDb['rescheduleContact'](ut[_0x3b51('0xc5')](_0x12236c,_0x3b51('0xbd'),_0x1b0ab3['dialBusyRetryFrequency']),_0x12236c[_0x3b51('0xa4')],_0x12236c[_0x3b51('0xc6')]);}}}else{_0x12236c[_0x3b51('0xbd')]++;_0x31c893[_0x3b51('0xc7')]({'id':_0x12236c[_0x3b51('0xa6')],'field':{'countbusyretry':_0x12236c[_0x3b51('0xbd')]}})[_0x3b51('0x79')](function(){_0x31c893[_0x3b51('0xa7')](_0x12236c,_0x53edb6,_0x597d92)[_0x3b51('0x79')](function(){});});}});break;case _0x3b51('0xc8'):_0x1b0ab3[_0x3b51('0xc9')]+=0x1;_0x12236c['countnoanswerretry']+=0x1;_0x12236c[_0x3b51('0xb4')]=ut[_0x3b51('0x9c')](_0x12236c);ut[_0x3b51('0x87')](_0x12236c,0x3,'NoAnswer');_0x53edb6=_0x1b0ab3[_0x3b51('0xca')];_0x597d92=_0x1b0ab3[_0x3b51('0xbf')];ami[_0x3b51('0x55')]('custom:agentnoanswer',ut[_0x3b51('0x98')](_0x12236c,_0x3b51('0xcb')));rpcDb[_0x3b51('0x9a')](_0x12236c,_0x3b51('0xcc'));_0x31c893['verifyAdditionalPhones'](_0x12236c,'3',_0x1b0ab3)[_0x3b51('0x79')](function(_0x120a80){_0x5338dc=_0x120a80['additional']==0x1;if(!_0x5338dc){if(ut[_0x3b51('0x9c')](_0x12236c)>=_0x1b0ab3[_0x3b51('0x9d')]){_0x58897b=ut[_0x3b51('0x9e')](_0x12236c,0xf,_0x3b51('0x9f'));rpcDb[_0x3b51('0x89')](_0x58897b,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x12236c[_0x3b51('0xcd')]>=_0x1b0ab3[_0x3b51('0xce')]){rpcDb[_0x3b51('0x89')](_0x12236c,_0x3b51('0xcc'));}else{rpcDb[_0x3b51('0xa2')](ut['scheduledAt'](_0x12236c,_0x3b51('0xcd'),_0x1b0ab3['dialNoAnswerRetryFrequency']),_0x12236c[_0x3b51('0xa4')],_0x12236c['activeContact']);}}}else{_0x12236c[_0x3b51('0xcd')]++;_0x31c893[_0x3b51('0xc7')]({'id':_0x12236c[_0x3b51('0xa6')],'field':{'countnoanswerretry':_0x12236c['countnoanswerretry']}})[_0x3b51('0x79')](function(){_0x31c893['swapAdditionalPhones'](_0x12236c,_0x53edb6,_0x597d92)[_0x3b51('0x79')](function(){});});}});break;case _0x3b51('0xcf'):_0x1b0ab3[_0x3b51('0x36')]+=0x1;_0x12236c[_0x3b51('0xd0')]+=0x1;_0x12236c[_0x3b51('0xb4')]=ut[_0x3b51('0x9c')](_0x12236c);ut['logCustomer'](_0x12236c,0x8,'Congestion');_0x53edb6=_0x1b0ab3[_0x3b51('0xd1')];_0x597d92=_0x1b0ab3[_0x3b51('0xbf')];ami[_0x3b51('0x55')]('custom:agentcongestion',ut['buildObj'](_0x12236c,_0x3b51('0xd2')));rpcDb[_0x3b51('0x9a')](_0x12236c,_0x3b51('0xd3'));_0x31c893[_0x3b51('0x9b')](_0x12236c,'8',_0x1b0ab3)['then'](function(_0x2130a9){_0x5338dc=_0x2130a9[_0x3b51('0xc1')]==0x1;if(!_0x5338dc){if(ut[_0x3b51('0x9c')](_0x12236c)>=_0x1b0ab3[_0x3b51('0x9d')]){_0x58897b=ut[_0x3b51('0x9e')](_0x12236c,0xf,_0x3b51('0x9f'));rpcDb[_0x3b51('0x89')](_0x58897b,_0x3b51('0xd4'));}else{if(_0x12236c[_0x3b51('0xd0')]>=_0x1b0ab3[_0x3b51('0xd5')]){rpcDb['createCustomerFinal'](_0x12236c,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x3b51('0xa2')](ut[_0x3b51('0xc5')](_0x12236c,_0x3b51('0xd0'),_0x1b0ab3[_0x3b51('0xd6')]),_0x12236c[_0x3b51('0xa4')],_0x12236c[_0x3b51('0xc6')]);}}}else{_0x12236c['countcongestionretry']++;_0x31c893[_0x3b51('0xc7')]({'id':_0x12236c['idContact'],'field':{'countcongestionretry':_0x12236c[_0x3b51('0xd0')]}})[_0x3b51('0x79')](function(){_0x31c893[_0x3b51('0xa7')](_0x12236c,_0x53edb6,_0x597d92)[_0x3b51('0x79')](function(){});});}});break;case _0x3b51('0xd7'):_0x1b0ab3[_0x3b51('0x3c')]+=0x1;_0x12236c[_0x3b51('0xd8')]+=0x1;_0x12236c[_0x3b51('0xb4')]=ut[_0x3b51('0x9c')](_0x12236c);ut[_0x3b51('0x87')](_0x12236c,0x14,'AgentReject');_0x53edb6=_0x1b0ab3['dialAgentRejectRetryFrequency'];_0x597d92=_0x1b0ab3[_0x3b51('0xbf')];ami[_0x3b51('0x55')](_0x3b51('0xd9'),ut[_0x3b51('0x98')](_0x12236c,_0x3b51('0xda')));rpcDb[_0x3b51('0x9a')](_0x12236c,_0x3b51('0xdb'));_0x31c893['verifyAdditionalPhones'](_0x12236c,'20',_0x1b0ab3)[_0x3b51('0x79')](function(_0x5de10f){_0x5338dc=_0x5de10f[_0x3b51('0xc1')]==0x1;if(!_0x5338dc){if(ut[_0x3b51('0x9c')](_0x12236c)>=_0x1b0ab3[_0x3b51('0x9d')]){_0x58897b=ut[_0x3b51('0x9e')](_0x12236c,0x14,_0x3b51('0xdc'));rpcDb['createCustomerFinal'](_0x58897b,_0x3b51('0xdd'));}else{if(_0x12236c[_0x3b51('0xd8')]>=_0x1b0ab3[_0x3b51('0xde')]){rpcDb[_0x3b51('0x89')](_0x12236c,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x3b51('0xa2')](ut[_0x3b51('0xc5')](_0x12236c,_0x3b51('0xd8'),_0x1b0ab3[_0x3b51('0xdf')]),_0x12236c[_0x3b51('0xa4')],_0x12236c['activeContact']);}}}else{_0x12236c[_0x3b51('0xcd')]++;_0x31c893[_0x3b51('0xc7')]({'id':_0x12236c[_0x3b51('0xa6')],'field':{'countnoanswerretry':_0x12236c[_0x3b51('0xcd')]}})['then'](function(){_0x31c893[_0x3b51('0xa7')](_0x12236c,_0x53edb6,_0x597d92)[_0x3b51('0x79')](function(){});});}});break;case _0x3b51('0xe0'):_0x1b0ab3[_0x3b51('0x3e')]+=0x1;_0x12236c[_0x3b51('0xe1')]+=0x1;_0x12236c[_0x3b51('0xb4')]=ut['totalGlobal'](_0x12236c);ut[_0x3b51('0x87')](_0x12236c,0xb,_0x3b51('0xe2'));rpcDb[_0x3b51('0x9a')](_0x12236c,_0x3b51('0xe3'));if(ut['totalGlobal'](_0x12236c)>=_0x1b0ab3['dialGlobalMaxRetry']){_0x58897b=ut[_0x3b51('0x9e')](_0x12236c,0xf,_0x3b51('0x9f'));rpcDb[_0x3b51('0x89')](_0x58897b,_0x3b51('0xe3'));}else{if(_0x12236c['countabandonedetry']>=_0x1b0ab3['dialAbandonedMaxRety']){rpcDb[_0x3b51('0x89')](_0x12236c,_0x3b51('0xe3'));}else{rpcDb['rescheduleContact'](ut[_0x3b51('0xc5')](_0x12236c,_0x3b51('0xe1'),_0x1b0ab3[_0x3b51('0xe4')]),_0x12236c['unlockAgent'],_0x12236c[_0x3b51('0xc6')]);}}break;case'18':_0x1b0ab3[_0x3b51('0x3d')]+=0x1;_0x12236c['countmachineretry']+=0x1;_0x12236c[_0x3b51('0xb4')]=ut[_0x3b51('0x9c')](_0x12236c);ut[_0x3b51('0x87')](_0x12236c,0x12,_0x2734c4['cause-txt']||_0x2734c4[_0x3b51('0xe5')]);ami[_0x3b51('0x55')]('custom:amd',ut[_0x3b51('0x98')](_0x12236c,_0x3b51('0xe6')));rpcDb['createCustomerHistory'](_0x12236c,_0x3b51('0xe7'));if(ut[_0x3b51('0x9c')](_0x12236c)>=_0x1b0ab3[_0x3b51('0x9d')]){_0x58897b=ut['cloneAction'](_0x12236c,0xf,_0x3b51('0x9f'));rpcDb[_0x3b51('0x89')](_0x58897b,_0x3b51('0xe7'));}else{rpcDb[_0x3b51('0x89')](_0x12236c,_0x3b51('0xe7'));}delete this['actions'][_0x2734c4[_0x3b51('0xbc')]];break;case'19':_0x1b0ab3['outboundUnknownCallsDay']+=0x1;_0x12236c['countglobal']=ut[_0x3b51('0x9c')](_0x12236c);ut[_0x3b51('0x87')](_0x12236c,0x13,_0x2734c4[_0x3b51('0xe8')]||_0x2734c4[_0x3b51('0xe5')]);ami[_0x3b51('0x55')](_0x3b51('0xe9'),ut[_0x3b51('0x98')](_0x12236c,_0x3b51('0xe6')));rpcDb[_0x3b51('0x9a')](_0x12236c,_0x3b51('0xea'));if(ut[_0x3b51('0x9c')](_0x12236c)>=_0x1b0ab3[_0x3b51('0x9d')]){_0x58897b=ut[_0x3b51('0x9e')](_0x12236c,0xf,_0x3b51('0x9f'));rpcDb[_0x3b51('0x89')](_0x58897b,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x3b51('0x89')](_0x12236c,_0x3b51('0xea'));}delete this['actions'][_0x2734c4['linkedid']];break;default:if(_0x12236c[_0x3b51('0x68')]){ut[_0x3b51('0x72')](_0x1b0ab3,'[default]');ut['loggerError'](_0x3b51('0xeb')+_0x1b0ab3[_0x3b51('0x26')],_0x2734c4);}_0x1b0ab3['outboundUnknownCallsDay']+=0x1;_0x12236c[_0x3b51('0xb4')]=ut[_0x3b51('0x9c')](_0x12236c);ut[_0x3b51('0x87')](_0x12236c,0xc,_0x2734c4[_0x3b51('0xe8')]||_0x2734c4[_0x3b51('0xe5')]);_0x53edb6=_0x1b0ab3['dialAgentRejectRetryFrequency'];_0x597d92=_0x1b0ab3['callAdditionalPhoneAfterMin'];rpcDb[_0x3b51('0x9a')](_0x12236c,_0x3b51('0xec'));_0x31c893[_0x3b51('0x9b')](_0x12236c,'20',_0x1b0ab3)[_0x3b51('0x79')](function(_0x1f2a94){_0x5338dc=_0x1f2a94['additional']==0x1;if(!_0x5338dc){if(ut[_0x3b51('0x9c')](_0x12236c)>=_0x1b0ab3[_0x3b51('0x9d')]){_0x58897b=ut[_0x3b51('0x9e')](_0x12236c,0xf,'Global');rpcDb[_0x3b51('0x89')](_0x58897b,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x3b51('0x89')](_0x12236c,_0x3b51('0xed'));}delete this['actions'][_0x2734c4[_0x3b51('0xbc')]];}else{_0x31c893[_0x3b51('0xa7')](_0x12236c,_0x53edb6,_0x597d92)[_0x3b51('0x79')](function(_0x49f45f){});}});}if(!(_0x12236c[_0x3b51('0x68')]&&_0x4fde2d==='16')){ut[_0x3b51('0x70')](_0x1b0ab3,_0x3b51('0xee'));logger[_0x3b51('0x76')]('[originated][decrement][callProgressDetectingCustomer]',_0x12236c['uniqueid'],_0x3b51('0xad'),_0x1b0ab3[_0x3b51('0x26')],_0x3b51('0xef'),_0x1b0ab3['originated']);}if(_0x4fde2d!==_0x3b51('0xa8')){delete this[_0x3b51('0x15')][_0x2734c4[_0x3b51('0xbc')]];delete this[_0x3b51('0x15')][_0x2734c4[_0x3b51('0xf0')]];}}};Preview[_0x3b51('0x60')][_0x3b51('0xf1')]=function(_0xdc352d,_0x399316,_0x2106ca){if(_[_0x3b51('0xf2')](_0x399316)&&_0x3b51('0xf3')!==typeof _0x399316){return;}if(_[_0x3b51('0xf2')](_0x2106ca)&&_0x3b51('0xf3')!==typeof _0x2106ca){return;}switch(_0x2106ca[_0x3b51('0xf4')]){case'0':ut['logAgent'](_0xdc352d,0x0,_0x3b51('0x96'));rpcDb['createAgentHistory'](_0xdc352d,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0xdc352d,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0xdc352d,_0x3b51('0xf5'));break;case'5':ut[_0x3b51('0xf6')](_0xdc352d,0x5,_0x3b51('0xbe'));rpcDb[_0x3b51('0xf7')](_0xdc352d,_0x3b51('0xf8'));break;case'8':ut[_0x3b51('0xf6')](_0xdc352d,0x8,'Congestion');rpcDb[_0x3b51('0xf7')](_0xdc352d,_0x3b51('0xf9'));break;case'22':ut['logAgent'](_0xdc352d,0x16,_0x3b51('0xfa'));rpcDb[_0x3b51('0xf7')](_0xdc352d,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0xdc352d,0xc,_0x2106ca[_0x3b51('0xf4')]);rpcDb[_0x3b51('0xf7')](_0xdc352d,_0x3b51('0xf9'));}ut['updateOriginated'](_0x399316,'[callProgressDetectingAgent]');logger[_0x3b51('0x76')](_0x3b51('0xfb'),_0xdc352d[_0x3b51('0xac')],'\x20Queue',_0x399316['name'],_0x3b51('0xef'),_0x399316[_0x3b51('0xfc')]);delete this[_0x3b51('0x15')][_0xdc352d[_0x3b51('0xac')]];};Preview[_0x3b51('0x60')][_0x3b51('0x9b')]=function(_0x4d8e18,_0xcd292e,_0x232474){return BPromise[_0x3b51('0xfd')]()['then'](cmHopperAdditionalPhone[_0x3b51('0x9b')](_0x4d8e18,_0xcd292e,_0x232474))[_0x3b51('0x6e')](logger['info'](_0x3b51('0xfe')));};Preview[_0x3b51('0x60')]['swapAdditionalPhones']=function(_0x129fdd,_0x26b566,_0x546f28){return BPromise[_0x3b51('0xfd')]()[_0x3b51('0x79')](cmHopperAdditionalPhone[_0x3b51('0xa7')](_0x129fdd,_0x26b566,_0x546f28))['catch'](logger[_0x3b51('0x76')](_0x3b51('0xff')));};Preview[_0x3b51('0x60')][_0x3b51('0xc7')]=function(_0x29b128){return BPromise[_0x3b51('0xfd')]()[_0x3b51('0x79')](cmHopperAdditionalPhone[_0x3b51('0xc7')](_0x29b128))[_0x3b51('0x6e')](logger[_0x3b51('0x76')](_0x3b51('0x100')));};Preview[_0x3b51('0x60')]['checkInBlack']=function(_0x3100e1,_0x15f30d,_0x2f2a6c,_0x436ce0,_0x37ddaa){var _0x2b682b=this;return new BPromise(function(_0x308005,_0x321c1c){if(_[_0x3b51('0x101')](_0x15f30d)||_[_0x3b51('0x101')](_0x15f30d[_0x3b51('0x102')])||_['isNil'](_0x15f30d[_0x3b51('0x103')])||_[_0x3b51('0x101')](_0x15f30d[_0x3b51('0x104')])){_0x321c1c(ut[_0x3b51('0x5a')](_0x3b51('0x105'),_0x436ce0,_0x37ddaa));return;}var _0xa95f99=uuid['v4']();var _0xe133fe=_0x2b682b['campaignsPreview'][_0x15f30d[_0x3b51('0x106')]['name']];var _0x11b1bd=_0x2f2a6c?_0x2b682b[_0x3b51('0x16')][_0x2f2a6c]['id']:undefined;_0x2b682b[_0x3b51('0x15')][_0xa95f99]=new Action(_0x15f30d,_0xe133fe,_0xa95f99,_0x2f2a6c,_0x11b1bd);var _0x490eb4=_0x2b682b[_0x3b51('0x15')][_0xa95f99];_0x490eb4[_0x3b51('0xa4')]=_0x436ce0;_0x490eb4[_0x3b51('0xc6')]=_0x37ddaa;_0x490eb4['lookAgent']=_0x2f2a6c;if(_[_0x3b51('0x107')](_0x3100e1)){_0x2b682b['execCall'](_0x490eb4,_0xe133fe,_0x15f30d,_0x2f2a6c)[_0x3b51('0x79')](function(_0x5459fb){logger['info'](_0x3b51('0x108'),_0x3b51('0x109')+_0x490eb4[_0x3b51('0x66')]+_0x3b51('0x10a')+_0x490eb4[_0x3b51('0xa6')],JSON['stringify'](_0x5459fb));ami[_0x3b51('0x55')](_0x3b51('0x10b'),ut[_0x3b51('0x98')](_0x490eb4,_0x3b51('0x10c'),_0x2b682b['campaignsPreview'][_0x490eb4['queue']]));_0x308005(ut[_0x3b51('0x5a')](_0x3b51('0x10d')));})[_0x3b51('0x6e')](function(_0x210baa){ut[_0x3b51('0x5b')](_0x3b51('0x10e'),_0x210baa);_0x321c1c(ut[_0x3b51('0x5a')]('Call\x20failed',_0x436ce0,_0x37ddaa));});}else{_0xe133fe[_0x3b51('0x34')]+=0x1;ut['logBlacklist'](_0x490eb4);rpcDb[_0x3b51('0x10f')](_0x490eb4,_0x3b51('0x110'));delete _0x2b682b[_0x3b51('0x15')][_0xa95f99];_0x321c1c(ut['message'](_0x3b51('0x111'),_0x436ce0,_0x37ddaa));}});};Preview['prototype'][_0x3b51('0x91')]=function(_0x50abbe){return!_[_0x3b51('0x101')](_0x50abbe)&&!_['isNil'](_0x50abbe[_0x3b51('0x26')])&&!_[_0x3b51('0x101')](_0x50abbe['active'])&&_0x50abbe[_0x3b51('0x112')]&&!_['isNil'](this['trunks'][util[_0x3b51('0x51')]('SIP/%s',_0x50abbe[_0x3b51('0x26')])])&&!_['isNil'](this[_0x3b51('0x14')][util[_0x3b51('0x51')]('SIP/%s',_0x50abbe['name'])][_0x3b51('0x6d')])&&(this['trunks'][util[_0x3b51('0x51')](_0x3b51('0x113'),_0x50abbe[_0x3b51('0x26')])][_0x3b51('0x6d')]===_0x3b51('0x114')||this[_0x3b51('0x14')][util[_0x3b51('0x51')]('SIP/%s',_0x50abbe[_0x3b51('0x26')])]['status']===_0x3b51('0x115'));};Preview[_0x3b51('0x60')]['run']=function(_0x11a54d,_0x1f7e92){var _0x1f6163=this;return new BPromise(function(_0x49edc8,_0x3021de){_0x1f6163[_0x3b51('0x116')](_0x11a54d,_0x1f7e92)[_0x3b51('0x79')](function(_0x1851f8){_0x49edc8(_[_0x3b51('0x69')](_0x1851f8,[_0x3b51('0x5a')]));})[_0x3b51('0x6e')](function(_0x5cf89a){if(_0x5cf89a[_0x3b51('0x117')]){rpcDb['unlockContact'](_0x11a54d);}if(_0x5cf89a[_0x3b51('0x112')]){rpcDb[_0x3b51('0x118')](_0x11a54d);}_0x3021de(_[_0x3b51('0x69')](_0x5cf89a,[_0x3b51('0x5a')]));});});};Preview[_0x3b51('0x60')][_0x3b51('0x116')]=function(_0x581b7c,_0x564505){var _0x10324f=this;return new BPromise(function(_0x3562da,_0x1c1051){var _0x358b54,_0x22a74c;rpcDb['getContactPreview'](_0x581b7c)[_0x3b51('0x79')](function(_0x14113e){if(!_['isNil'](_0x14113e[0x0])){_0x22a74c=_0x14113e[0x0]['recallme']?![]:!![];_0x358b54=_0x14113e[0x0]['recallme']?!![]:![];_0x358b54=_0x564505?!![]:_0x358b54;}var _0x3e80c3=_0x10324f[_0x3b51('0x119')](_0x14113e);if(_0x3e80c3[_0x3b51('0x11a')]){rpcDb['checkIsBlackList'](_[_0x3b51('0x69')](_0x14113e[0x0],[_0x3b51('0x104'),_0x3b51('0x103')]))[_0x3b51('0x79')](function(_0x567bb0){_0x10324f[_0x3b51('0x11b')](_0x567bb0,_0x14113e[0x0],_0x564505,_0x22a74c,_0x358b54)[_0x3b51('0x79')](function(_0x2efd94){_0x3562da(_0x2efd94);})[_0x3b51('0x6e')](function(_0x26721c){_0x1c1051(_0x26721c);});})[_0x3b51('0x6e')](function(_0xc27d8c){ut[_0x3b51('0x5b')]('[Preview][checkIsBlackList]',_0xc27d8c);_0x1c1051(ut['message']('Call\x20unsuccessful',_0x22a74c,_0x358b54));});}else{_0x1c1051(ut['message'](_0x3e80c3['message'],_0x22a74c,_0x358b54));}})['catch'](function(_0x457244){ut[_0x3b51('0x5b')](_0x3b51('0x11c'),_0x457244);_0x1c1051(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview[_0x3b51('0x60')][_0x3b51('0x119')]=function(_0x267f19){if(_[_0x3b51('0x101')](_0x267f19)||_[_0x3b51('0x107')](_0x267f19)||!_[_0x3b51('0x101')](_0x267f19[0x0]['Agent'])&&_['isNil'](_0x267f19[0x0][_0x3b51('0x11d')]['name'])){ut[_0x3b51('0x5b')](_0x3b51('0x11e'),_0x267f19);return{'isValid':![],'message':_0x3b51('0x11f')};}var _0x46bcb8=this[_0x3b51('0x12')][_0x267f19[0x0][_0x3b51('0x106')]['name']];_0x46bcb8[_0x3b51('0x5a')]=_0x3b51('0x94');if(_['isNil'](_0x46bcb8)){ut[_0x3b51('0x5b')]('[Preview][validateContact][Empty\x20Campaign]',_0x46bcb8);return{'isValid':![],'message':_0x3b51('0x120')};}if(!this[_0x3b51('0x91')](_0x46bcb8['Trunk'])){ut['logger'](_0x3b51('0x121'),'campaign\x20Name:\x20'+_0x46bcb8[_0x3b51('0x26')]+_0x3b51('0x122'));if(!this[_0x3b51('0x91')](_0x46bcb8[_0x3b51('0x92')])){ut[_0x3b51('0x5b')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x46bcb8[_0x3b51('0x26')]+_0x3b51('0x123'));return{'isValid':![],'message':_0x3b51('0x124')};}}if(!ut[_0x3b51('0x8f')](_0x46bcb8['dialActive'])){ut['logger'](_0x3b51('0x125'),_0x46bcb8[_0x3b51('0x26')]+_0x3b51('0x126'));return{'isValid':![],'message':_0x3b51('0x127')+_0x46bcb8[_0x3b51('0x26')]+_0x3b51('0x126')};}return{'isValid':!![],'message':_0x3b51('0x128')};};Preview[_0x3b51('0x60')]['execCall']=function(_0x3ec13b,_0x2f365d,_0x46bad7,_0x1f0ecd){var _0x326b36=this;return new BPromise(function(_0x385e50,_0x5bb25e){var _0x2b8e12=_0x3ec13b['uniqueid'];var _0x2218d4=_0x326b36['isTrunkReachable'](_0x2f365d[_0x3b51('0x4d')])?util[_0x3b51('0x51')]('SIP/%s/%s%s',_0x2f365d[_0x3b51('0x4d')][_0x3b51('0x26')],_[_0x3b51('0x101')](_0x2f365d[_0x3b51('0x129')])?'':_0x2f365d[_0x3b51('0x129')]['trim']()||'',_0x2f365d[_0x3b51('0x12a')]>0x0?_0x46bad7[_0x3b51('0x103')][_0x3b51('0x12b')](_0x2f365d[_0x3b51('0x12a')]):_0x46bad7['phone']):util['format'](_0x3b51('0x12c'),_[_0x3b51('0x101')](_0x2f365d[_0x3b51('0x92')])?_0x2f365d[_0x3b51('0x4d')][_0x3b51('0x26')]:_0x2f365d[_0x3b51('0x92')][_0x3b51('0x26')],_[_0x3b51('0x101')](_0x2f365d['dialPrefix'])?'':_0x2f365d[_0x3b51('0x129')][_0x3b51('0x12d')]()||'',_0x2f365d[_0x3b51('0x12a')]>0x0?_0x46bad7[_0x3b51('0x103')]['substring'](_0x2f365d[_0x3b51('0x12a')]):_0x46bad7[_0x3b51('0x103')]);var _0x321f23=_0x326b36[_0x3b51('0x91')](_0x2f365d[_0x3b51('0x4d')])?ut[_0x3b51('0x12e')](_0x2f365d[_0x3b51('0x4d')]['callerid'],_0x2f365d[_0x3b51('0x30')],_0x2f365d[_0x3b51('0x12f')]>0x0?ut[_0x3b51('0x130')](_0x2f365d[_0x3b51('0x131')],_0x2f365d[_0x3b51('0x12f')]):_0x2f365d[_0x3b51('0x131')]):ut[_0x3b51('0x12e')](_[_0x3b51('0x101')](_0x2f365d[_0x3b51('0x92')])?_0x2f365d['Trunk'][_0x3b51('0x4e')]:_0x2f365d['TrunkBackup'][_0x3b51('0x4e')],_0x2f365d[_0x3b51('0x30')],_0x2f365d[_0x3b51('0x12f')]>0x0?ut['getCallerIdRandom'](_0x2f365d[_0x3b51('0x131')],_0x2f365d['dialRandomLastDigitCallerIdNumber']):_0x2f365d[_0x3b51('0x131')]);if(_0x321f23){_0x3ec13b[_0x3b51('0x132')]=ut['extractCalleridName'](_0x321f23);_0x3ec13b[_0x3b51('0x133')]=ut[_0x3b51('0x134')](_0x321f23);}var _0x1bb0e9=ut[_0x3b51('0x135')](_0x2f365d,_0x46bad7,_0x2218d4,_0x321f23,_0x2b8e12,_0x3ec13b);_[_0x3b51('0x136')](_0x3ec13b,ut['toLowerVariables'](_0x1bb0e9));_0x3ec13b['starttime']=moment()[_0x3b51('0x51')](_0x3b51('0xa9'));ami[_0x3b51('0x6c')](ut[_0x3b51('0x137')](_0x3ec13b,_0x2f365d,_0x1bb0e9,_0x3ec13b[_0x3b51('0xc6')],_0x1f0ecd))[_0x3b51('0x79')](function(_0x1fc0d5){_0x2f365d['originated']+=0x1;logger['info']('[originated][increment]',_0x2b8e12,_0x3b51('0xad'),_0x2f365d[_0x3b51('0x26')],'originated:\x20',_0x2f365d[_0x3b51('0xfc')]);_0x385e50(_0x1fc0d5);})[_0x3b51('0x6e')](function(_0x1f1529){ut[_0x3b51('0xf6')](_0x3ec13b,0xe,_0x3b51('0x138'));rpcDb[_0x3b51('0xf7')](_0x3ec13b,'[originateFailure][logOriginateFailure]');_0x5bb25e(_0x1f1529);});});};Preview[_0x3b51('0x60')][_0x3b51('0x139')]=function(_0x55c050){if(this['actions'][_0x55c050[_0x3b51('0xbc')]]){this[_0x3b51('0x15')][_0x55c050[_0x3b51('0xbc')]][_0x3b51('0x13a')]=_0x55c050['channel'];}};Preview['prototype'][_0x3b51('0x19')]=function(_0x10f957){var _0xe4f053=this;var _0x39bb39=this[_0x3b51('0x15')][_0x10f957[_0x3b51('0x13b')]];if(_0x39bb39){if(_0x39bb39[_0x3b51('0x13c')]&&this['agents'][_0x39bb39['lookAgent']]){ut[_0x3b51('0x13d')](_0x39bb39,this[_0x3b51('0x16')][_0x39bb39[_0x3b51('0x13c')]]['name'],this['agents'][_0x39bb39['lookAgent']]['id']);}var _0x3b6fd1=_['clone'](_0x39bb39);_0x3b6fd1[_0x3b51('0xaa')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x5069ef=_0xe4f053[_0x3b51('0x12')][_0x39bb39[_0x3b51('0x66')]];if(ut[_0x3b51('0x13e')](_0x10f957['response'])){if(_0x39bb39[_0x3b51('0xa4')]){rpcDb['unlockContact'](_0x39bb39['idContact']);}if(_0x39bb39[_0x3b51('0xc6')]){rpcDb[_0x3b51('0x118')](_0x39bb39[_0x3b51('0xa6')]);}ami[_0x3b51('0x55')]('custom:agentringnoanswer',ut[_0x3b51('0x98')](_0x39bb39,'rejected',this[_0x3b51('0x12')][_0x39bb39['queue']]));this[_0x3b51('0xf1')](_0x3b6fd1,_0x5069ef,_0x10f957);}else{_0x39bb39[_0x3b51('0x82')]=moment()[_0x3b51('0x51')](_0x3b51('0xa9'));ut[_0x3b51('0xf6')](_0x3b6fd1,0x4,_0x3b51('0xb5'));rpcDb[_0x3b51('0xf7')](_0x3b6fd1,_0x3b51('0x13f'));}}};Preview[_0x3b51('0x60')][_0x3b51('0x1b')]=function(_0x190521){var _0x336468=this;var _0x225301=this['actions'][_0x190521[_0x3b51('0xbc')]];var _0x1bc85a;if(_0x225301){_0x1bc85a=this['campaignsPreview'][_0x225301['queue']];logger[_0x3b51('0x76')](_0x3b51('0x140'),_0x190521[_0x3b51('0xbc')],'\x20Queue',_0x1bc85a['name'],_0x3b51('0x67'),_0x1bc85a[_0x3b51('0x58')]);}if(this[_0x3b51('0x15')][_0x190521[_0x3b51('0xbc')]]&&_0x190521[_0x3b51('0xbc')]!==_0x190521[_0x3b51('0xac')]){if(_0x190521[_0x3b51('0x141')]==='16'&&this[_0x3b51('0x15')][_0x190521[_0x3b51('0xbc')]][_0x3b51('0x68')]){this[_0x3b51('0x95')](_0x190521,_0x190521[_0x3b51('0xbc')],_0x190521[_0x3b51('0x141')]);}else if(this[_0x3b51('0x15')][_0x190521[_0x3b51('0xbc')]][_0x3b51('0x68')]){logger[_0x3b51('0x76')](_0x3b51('0x142'),_0x190521['linkedid'],_0x190521[_0x3b51('0x141')],_0x3b51('0xad'),_0x1bc85a[_0x3b51('0x26')],'pTalking:\x20',_0x1bc85a['pTalking']);this[_0x3b51('0x95')](_0x190521,_0x190521[_0x3b51('0xbc')],_0x190521['cause']);}}else if(_0x225301&&_[_0x3b51('0x101')](_0x225301[_0x3b51('0x143')])&&_0x1bc85a[_0x3b51('0x144')]&&_0x190521['linkedid']===_0x190521[_0x3b51('0xac')]&&_[_0x3b51('0x101')](_0x190521[_0x3b51('0xf4')])&&_0x190521['cause']==='16'&&_0x190521['channelstate']==='6'&&_[_0x3b51('0xf2')](_0x225301[_0x3b51('0x145')])){if(_0x225301[_0x3b51('0xa4')]){rpcDb[_0x3b51('0x146')](_0x225301[_0x3b51('0xa6')]);}if(_0x225301[_0x3b51('0xc6')]){rpcDb[_0x3b51('0x118')](_0x225301[_0x3b51('0xa6')]);}_0x190521[_0x3b51('0xf4')]='22';this[_0x3b51('0xf1')](_0x225301,_0x1bc85a,_0x190521);}else if(_0x225301&&_0x225301[_0x3b51('0x145')]){if(_0x190521['cause']==='16'&&this[_0x3b51('0x15')][_0x190521['linkedid']][_0x3b51('0x68')]){logger[_0x3b51('0x76')](_0x3b51('0x147'),_0x190521['linkedid'],_0x190521['cause'],'\x20Queue',_0x1bc85a[_0x3b51('0x26')],'pTalking:\x20',_0x1bc85a[_0x3b51('0x58')]);this[_0x3b51('0x95')](_0x190521,_0x190521[_0x3b51('0xbc')],_0x190521[_0x3b51('0x141')]);}else if(this[_0x3b51('0x15')][_0x190521[_0x3b51('0xbc')]][_0x3b51('0x68')]){logger[_0x3b51('0x76')](_0x3b51('0x142'),_0x190521[_0x3b51('0xbc')],_0x190521[_0x3b51('0x141')],'\x20Queue',_0x1bc85a[_0x3b51('0x26')],_0x3b51('0x67'),_0x1bc85a[_0x3b51('0x58')]);this['callProgressDetectingCustomer'](_0x190521,_0x190521[_0x3b51('0xbc')],_0x190521[_0x3b51('0x141')]);}}};Preview[_0x3b51('0x60')][_0x3b51('0x1e')]=function(_0x21b6af){if(this[_0x3b51('0x15')][_0x21b6af[_0x3b51('0xf0')]]&&_0x21b6af[_0x3b51('0xf0')]!==_0x21b6af['destuniqueid']){this[_0x3b51('0x95')](_0x21b6af,_0x21b6af[_0x3b51('0xf0')],_0x21b6af[_0x3b51('0xe5')]);}};Preview[_0x3b51('0x60')][_0x3b51('0x1d')]=function(_0x48cc28){if(this[_0x3b51('0x15')][_0x48cc28[_0x3b51('0xbc')]]&&_0x48cc28[_0x3b51('0xbc')]!==_0x48cc28['uniqueid']&&!this[_0x3b51('0x15')][_0x48cc28[_0x3b51('0xbc')]][_0x3b51('0x68')]){if(_0x48cc28[_0x3b51('0x141')]==='1'){this[_0x3b51('0x95')](_0x48cc28,_0x48cc28[_0x3b51('0xbc')],_0x48cc28['cause']);}}};Preview[_0x3b51('0x60')][_0x3b51('0x148')]=function(_0xb6ac13,_0x5c23f1,_0x4cc15b){if(this['actions'][_0xb6ac13]){if(_[_0x3b51('0x101')](this[_0x3b51('0x15')][_0xb6ac13][_0x3b51('0x149')])){this[_0x3b51('0x15')][_0xb6ac13][_0x3b51('0x149')]={};}this[_0x3b51('0x15')][_0xb6ac13][_0x3b51('0x149')][_0x5c23f1]=_0x4cc15b;}};Preview[_0x3b51('0x60')]['syncVarSet']=function(_0x4df0ae){try{if(!_[_0x3b51('0x101')](_0x4df0ae)){if(ut[_0x3b51('0x14a')](_[_0x3b51('0x14b')](_0x4df0ae[_0x3b51('0x14c')])[0x0])){this['addVariable'](_0x4df0ae['uniqueid'],_[_0x3b51('0x14b')](_0x4df0ae[_0x3b51('0x14c')])[0x0],_0x4df0ae[_0x3b51('0x14d')]);}}}catch(_0x2e1d4c){logger[_0x3b51('0x14e')](_0x3b51('0x14f'),util[_0x3b51('0x150')](_0x2e1d4c,{'showHidden':![],'depth':null}));}};Preview[_0x3b51('0x60')][_0x3b51('0x151')]=function(_0x273ff2){if(_0x273ff2){if(this[_0x3b51('0x15')][_0x273ff2[_0x3b51('0x152')]]){this[_0x3b51('0x15')][_0x273ff2[_0x3b51('0x152')]]['transfer']=!![];}}};Preview[_0x3b51('0x60')][_0x3b51('0x22')]=function(_0x20d575){if(_0x20d575){if(this[_0x3b51('0x15')][_0x20d575[_0x3b51('0x153')]]){this['actions'][_0x20d575[_0x3b51('0x153')]]['transfer']=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 624c3fd..3b35709 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 _0x4b84=['xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','inspect','resolve','catch','[createHistory]\x20','then','createHistory','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','crateCustomerReportQueue','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4c73ac,_0x46b73c){_0x4c73ac=_0x4c73ac-0x0;var _0x9839ee=_0x4b84[_0x4c73ac];return _0x9839ee;};'use strict';var util=require(_0x44b8('0x0'));var BPromise=require(_0x44b8('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0x44b8('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x44b8('0x3'));var cmHopperBlack=require(_0x44b8('0x4'));var voiceQueueRt=require(_0x44b8('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x55f25d){return function(_0x996a8b){logger['error'](_0x55f25d,util[_0x44b8('0x6')](_0x996a8b,{'showHidden':![],'depth':null}));};}function create(_0x5947f7){return BPromise[_0x44b8('0x7')]()['then'](cmHopperHistory['createHistory'](_0x5947f7))[_0x44b8('0x8')](loggerCatch(_0x44b8('0x9')));}function createAgent(_0x30ebc3){return BPromise['resolve']()[_0x44b8('0xa')](agentReportPreview[_0x44b8('0xb')](_0x30ebc3))[_0x44b8('0x8')](loggerCatch(_0x44b8('0x9')));}function moveContact(_0x24dd10){return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](cmHopper['moveContactManagedDialer'](_0x24dd10,!![]))[_0x44b8('0x8')](loggerCatch(_0x44b8('0xc')));}exports['checkIsBlackList']=function(_0x194230){return BPromise['resolve']()[_0x44b8('0xa')](cmHopperBlack[_0x44b8('0xd')](_0x194230))['catch'](loggerCatch(_0x44b8('0xe')));};exports['getContactPreview']=function(_0x54fa95){return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](cmHopper[_0x44b8('0xf')](_0x54fa95))[_0x44b8('0x8')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x5d6349,_0x3fe9fb){create(_0x5d6349)['catch'](loggerCatch(_0x3fe9fb));moveContact(_0x5d6349)[_0x44b8('0x8')](loggerCatch(_0x3fe9fb));};exports[_0x44b8('0x10')]=function(_0x55e258,_0x36743e){createAgent(_0x55e258)[_0x44b8('0x8')](loggerCatch(_0x36743e));};exports['createCustomerHistory']=function(_0x89bc30,_0x3f4688){create(_0x89bc30)['catch'](loggerCatch(_0x3f4688));};exports[_0x44b8('0x11')]=function(_0x8b4301,_0xebfe79){moveContact(_0x8b4301)[_0x44b8('0x8')](loggerCatch(_0xebfe79));};exports[_0x44b8('0x12')]=function(_0x369c09,_0x452f2f,_0x9b0536){if(_0x452f2f){_0x369c09[_0x44b8('0x13')]=null;}if(_0x9b0536){_0x369c09[_0x44b8('0x14')]=![];}return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](cmHopper['rescheduleContact'](_0x369c09))[_0x44b8('0x8')](loggerCatch(_0x44b8('0x15')));};exports[_0x44b8('0x16')]=function(_0x1418db){return BPromise[_0x44b8('0x7')]()['then'](cmHopper[_0x44b8('0x16')](_0x1418db))['catch'](loggerCatch(_0x44b8('0x17')));};exports[_0x44b8('0x18')]=function(_0x25a0c1){return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](cmHopper['unlockContact']({'UserId':null},_0x25a0c1,0x1))[_0x44b8('0x8')](loggerCatch('[unlockContact]\x20'));};exports[_0x44b8('0x19')]=function(_0x350482){return BPromise['resolve']()[_0x44b8('0xa')](cmHopper[_0x44b8('0x18')]({'active':![]},_0x350482,0x1))[_0x44b8('0x8')](loggerCatch('[activeContact]\x20'));};exports[_0x44b8('0x1a')]=function(_0x242342){var _0x53d9c7={};_0x53d9c7[_0x44b8('0x1b')]=_0x242342['type'];_0x53d9c7[_0x44b8('0x1c')]=_0x242342['uniqueid'];_0x53d9c7['calleridnum']=_0x242342['calleridnum'];_0x53d9c7[_0x44b8('0x1d')]=_0x242342[_0x44b8('0x1d')];_0x53d9c7[_0x44b8('0x1e')]=_0x242342[_0x44b8('0x1e')];_0x53d9c7[_0x44b8('0x1f')]=_0x242342[_0x44b8('0x20')];_0x53d9c7[_0x44b8('0x21')]=_0x242342[_0x44b8('0x20')];_0x53d9c7[_0x44b8('0x22')]=0x1;_0x53d9c7[_0x44b8('0x23')]=_0x242342[_0x44b8('0x24')];_0x53d9c7[_0x44b8('0x25')]=_0x242342[_0x44b8('0x26')];_0x53d9c7['context']=_0x44b8('0x27');_0x53d9c7['exten']=_0x44b8('0x28');_0x53d9c7[_0x44b8('0x29')]=0x0;_0x53d9c7[_0x44b8('0x2a')]=0x1;_0x53d9c7[_0x44b8('0x2b')]=_0x242342[_0x44b8('0x26')];_0x53d9c7['queuecallerexitreason']=_0x44b8('0x2c');return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](voiceQueueReport[_0x44b8('0x2d')](_0x53d9c7))[_0x44b8('0x8')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x44b8('0x2e')]=function(_0x400edc,_0x1a30fc){return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](cmHopper[_0x44b8('0x2e')](_0x400edc,_0x1a30fc))[_0x44b8('0x8')](loggerCatch(_0x44b8('0x2f')));};exports[_0x44b8('0x30')]=function(_0x181761){return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](cmHopper[_0x44b8('0x12')](_0x181761,!![],!![]))[_0x44b8('0x8')](loggerCatch(_0x44b8('0x31')));}; \ No newline at end of file +var _0x5075=['exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','resolve','then','[createHistory]\x20','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createHistory','createAgentHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip'];(function(_0x57a268,_0x12d2fe){var _0x398b94=function(_0x396f44){while(--_0x396f44){_0x57a268['push'](_0x57a268['shift']());}};_0x398b94(++_0x12d2fe);}(_0x5075,0x73));var _0x5507=function(_0x1233d2,_0x5416f4){_0x1233d2=_0x1233d2-0x0;var _0x22759e=_0x5075[_0x1233d2];return _0x22759e;};'use strict';var util=require(_0x5507('0x0'));var BPromise=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var _=require(_0x5507('0x4'));var cmHopper=require(_0x5507('0x5'));var cmHopperFinal=require(_0x5507('0x6'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x5507('0x7'));var voiceQueueRt=require(_0x5507('0x8'));var agentReportPreview=require(_0x5507('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x5b6d7f){return function(_0x2cd9ee){logger[_0x5507('0xa')](_0x5b6d7f,util['inspect'](_0x2cd9ee,{'showHidden':![],'depth':null}));};}function create(_0x42c232){return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](cmHopperHistory['createHistory'](_0x42c232))['catch'](loggerCatch(_0x5507('0xd')));}function createAgent(_0x441bdc){return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](agentReportPreview['createHistory'](_0x441bdc))[_0x5507('0xe')](loggerCatch(_0x5507('0xd')));}function moveContact(_0x55520e){return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](cmHopper['moveContactManagedDialer'](_0x55520e,!![]))[_0x5507('0xe')](loggerCatch(_0x5507('0xf')));}exports[_0x5507('0x10')]=function(_0x267f27){return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](cmHopperBlack['checkIsBlackList'](_0x267f27))[_0x5507('0xe')](loggerCatch(_0x5507('0x11')));};exports[_0x5507('0x12')]=function(_0x46545d){return BPromise['resolve']()[_0x5507('0xc')](cmHopper[_0x5507('0x12')](_0x46545d))[_0x5507('0xe')](loggerCatch(_0x5507('0x13')));};exports[_0x5507('0x14')]=function(_0x2ede34,_0x241932){create(_0x2ede34)[_0x5507('0xe')](loggerCatch(_0x241932));moveContact(_0x2ede34)[_0x5507('0xe')](loggerCatch(_0x241932));};exports[_0x5507('0x15')]=function(_0x233b6a,_0x2260f7){createAgent(_0x233b6a)[_0x5507('0xe')](loggerCatch(_0x2260f7));};exports['createCustomerHistory']=function(_0x14dab0,_0x276a81){create(_0x14dab0)[_0x5507('0xe')](loggerCatch(_0x276a81));};exports[_0x5507('0x16')]=function(_0x54f473,_0x1dc53e){moveContact(_0x54f473)[_0x5507('0xe')](loggerCatch(_0x1dc53e));};exports[_0x5507('0x17')]=function(_0x3ca1f7,_0x68397c,_0x1be8b1){if(_0x68397c){_0x3ca1f7['UserId']=null;}if(_0x1be8b1){_0x3ca1f7[_0x5507('0x18')]=![];}return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](cmHopper[_0x5507('0x17')](_0x3ca1f7))[_0x5507('0xe')](loggerCatch(_0x5507('0x19')));};exports[_0x5507('0x1a')]=function(_0x10f149){return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](cmHopper[_0x5507('0x1a')](_0x10f149))[_0x5507('0xe')](loggerCatch(_0x5507('0x1b')));};exports[_0x5507('0x1c')]=function(_0x1a2203){return BPromise['resolve']()[_0x5507('0xc')](cmHopper['unlockContact']({'UserId':null},_0x1a2203,0x1))[_0x5507('0xe')](loggerCatch('[unlockContact]\x20'));};exports[_0x5507('0x1d')]=function(_0x24668b){return BPromise['resolve']()['then'](cmHopper[_0x5507('0x1c')]({'active':![]},_0x24668b,0x1))[_0x5507('0xe')](loggerCatch('[activeContact]\x20'));};exports[_0x5507('0x1e')]=function(_0x24574b){var _0x85d383={};_0x85d383[_0x5507('0x1f')]=_0x24574b[_0x5507('0x1f')];_0x85d383[_0x5507('0x20')]=_0x24574b['uniqueid'];_0x85d383[_0x5507('0x21')]=_0x24574b[_0x5507('0x21')];_0x85d383[_0x5507('0x22')]=_0x24574b[_0x5507('0x22')];_0x85d383[_0x5507('0x23')]=_0x24574b['queue'];_0x85d383['queuecallerjoinAt']=_0x24574b[_0x5507('0x24')];_0x85d383[_0x5507('0x25')]=_0x24574b[_0x5507('0x24')];_0x85d383[_0x5507('0x26')]=0x1;_0x85d383['queuecallercompleteAt']=_0x24574b[_0x5507('0x27')];_0x85d383[_0x5507('0x28')]=_0x24574b[_0x5507('0x29')];_0x85d383[_0x5507('0x2a')]=_0x5507('0x2b');_0x85d383[_0x5507('0x2c')]=_0x5507('0x2d');_0x85d383[_0x5507('0x2e')]=0x0;_0x85d383['assigned']=0x1;_0x85d383[_0x5507('0x2f')]=_0x24574b[_0x5507('0x29')];_0x85d383[_0x5507('0x30')]='COMPLETED';return BPromise['resolve']()[_0x5507('0xc')](voiceQueueReport[_0x5507('0x31')](_0x85d383))[_0x5507('0xe')](loggerCatch(_0x5507('0x32')));};exports[_0x5507('0x33')]=function(_0x574fc6,_0x5cc72c){return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](cmHopper[_0x5507('0x33')](_0x574fc6,_0x5cc72c))[_0x5507('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x23ea7c){return BPromise['resolve']()[_0x5507('0xc')](cmHopper[_0x5507('0x17')](_0x23ea7c,!![],!![]))[_0x5507('0xe')](loggerCatch(_0x5507('0x34')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 1630f7d..de35359 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 _0xcb58=['env','XCALLY_IP_AGI','milliseconds','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','format','calleridname','calleridnum','ContactId','VoiceQueueId','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','endtime','logAgent','ringtime','responsetime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','interface','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','push','diff','filterKey','idContact','type','dialAnswer','countbusyretry','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','pow','replace','extractCalleridName','extractCalleridNumber','util','lodash','../../../../config/logger','preview'];(function(_0x4e362a,_0x5060c5){var _0x50069f=function(_0xf9230d){while(--_0xf9230d){_0x4e362a['push'](_0x4e362a['shift']());}};_0x50069f(++_0x5060c5);}(_0xcb58,0x84));var _0x8cb5=function(_0x25a38b,_0x151f11){_0x25a38b=_0x25a38b-0x0;var _0x52e32f=_0xcb58[_0x25a38b];return _0x52e32f;};'use strict';var util=require(_0x8cb5('0x0'));var _=require(_0x8cb5('0x1'));var moment=require('moment');var logger=require(_0x8cb5('0x2'))(_0x8cb5('0x3'));var ipAgi=process[_0x8cb5('0x4')][_0x8cb5('0x5')]||'127.0.0.1';function getSeconds(_0x2304c2,_0xfca46f){var _0x1d89e3=moment(_0x2304c2)[_0x8cb5('0x6')](0x0);var _0x267483=moment(_0xfca46f)[_0x8cb5('0x6')](0x0);return _0x1d89e3['diff'](_0x267483,_0x8cb5('0x7'));}exports[_0x8cb5('0x8')]=function(_0x703e7f){return function(_0x52d4f1){logger[_0x8cb5('0x9')](_0x703e7f,util[_0x8cb5('0xa')](_0x52d4f1,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x206308,_0x21a41c){logger[_0x8cb5('0xb')](_0x206308,util[_0x8cb5('0xa')](_0x21a41c,{'showHidden':![],'depth':null}));};exports[_0x8cb5('0xc')]=function(_0x4d739b,_0x2f7b34){logger['error'](_0x4d739b,util['inspect'](_0x2f7b34,{'showHidden':![],'depth':null}));};exports[_0x8cb5('0xd')]=function(_0x38e7ed){return function(_0x216a5d){logger[_0x8cb5('0xb')](_0x38e7ed,util[_0x8cb5('0xa')](_0x216a5d,{'showHidden':![],'depth':null}));};};exports[_0x8cb5('0xe')]=function(_0x22ee1e,_0x4bf907,_0x1fb308){return{'message':_0x22ee1e,'unlock':_0x4bf907,'active':_0x1fb308};};exports[_0x8cb5('0xf')]=function(_0x259000,_0x59ffc6,_0x35a516){if(!_[_0x8cb5('0x10')](_0x35a516)&&_0x8cb5('0x11')===typeof _0x35a516&&!_[_0x8cb5('0x12')](_0x35a516)){if(!_[_0x8cb5('0x10')](_0x59ffc6)&&_0x8cb5('0x11')===typeof _0x59ffc6&&!_[_0x8cb5('0x12')](_0x59ffc6)){return util['format'](_0x8cb5('0x13'),_0x59ffc6,_0x35a516);}return util['format'](_0x8cb5('0x13'),_0x35a516,_0x35a516);}if(!_[_0x8cb5('0x10')](_0x259000)&&_0x8cb5('0x11')===typeof _0x259000&&!_[_0x8cb5('0x12')](_0x259000)){return _0x259000;}return _0x8cb5('0x14');};exports[_0x8cb5('0x15')]=function(_0x3a5e23){if(_[_0x8cb5('0x16')](_0x3a5e23)){return![];}return _0x3a5e23;};exports['addVariables']=function(_0x224831,_0x35c9ae,_0x4bf37c,_0x336f31,_0x25905d,_0x453ed1){var _0x1822c4={'XMD-QUEUE':_0x35c9ae[_0x8cb5('0x17')]?_0x35c9ae[_0x8cb5('0x17')]['name']:'','XMD-CALLERID':_0x336f31,'XMD-CALLERID-PREVIEW':_0x453ed1?util[_0x8cb5('0x18')]('\x22%s\x22\x20<%s>',_0x453ed1[_0x8cb5('0x19')],_0x453ed1[_0x8cb5('0x1a')]):_0x336f31,'XMD-DIALID':_0x25905d,'XMD-CONTACTID':_0x35c9ae[_0x8cb5('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x336f31,'XMD-VOICEQUEUEID':_0x35c9ae[_0x8cb5('0x1c')],'XMD-DIALCHANNEL':_0x4bf37c,'XMD-DIALTIMEOUT':_0x224831['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x8cb5('0x18')](_0x8cb5('0x1d'),_0x224831['dialQueueProject2']?'g':'',_['isEmpty'](_0x224831[_0x8cb5('0x1e')])?'':_0x8cb5('0x1f')),'XMD-DIALURL':_0x224831[_0x8cb5('0x20')]||'','XMD-AGI':_0x224831[_0x8cb5('0x21')]?util[_0x8cb5('0x18')](_0x8cb5('0x22'),ipAgi,_0x224831[_0x8cb5('0x21')]):_0x8cb5('0x23'),'XMD-AGIAFTER':_0x224831[_0x8cb5('0x24')]?util[_0x8cb5('0x18')](_0x8cb5('0x22'),ipAgi,_0x224831[_0x8cb5('0x24')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x453ed1?_0x453ed1[_0x8cb5('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x453ed1?_0x453ed1['originatecalleridname']:'','XMD-DESTINATION':_0x8cb5('0x26')};if(!_[_0x8cb5('0x12')](_0x224831[_0x8cb5('0x1e')])){_0x1822c4[util[_0x8cb5('0x18')]('%s',_0x8cb5('0x27'))]=_0x224831[_0x8cb5('0x1e')];_0x1822c4[util[_0x8cb5('0x18')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x25905d;}if(_0x35c9ae&&_0x35c9ae[_0x8cb5('0x28')]){for(var _0x25a9d0 in _0x35c9ae[_0x8cb5('0x28')]){if(_0x35c9ae[_0x8cb5('0x28')][_0x8cb5('0x29')](_0x25a9d0)){if(!_[_0x8cb5('0x16')](_0x35c9ae[_0x8cb5('0x28')][_0x25a9d0])&&_0x25a9d0!=='id'&&_0x25a9d0!==_0x8cb5('0x2a')&&_0x25a9d0!==_0x8cb5('0x2b')&&_0x25a9d0!==_0x8cb5('0x2c')){_0x1822c4[util[_0x8cb5('0x18')]('%s%s',_0x8cb5('0x2d'),_[_0x8cb5('0x2e')](_0x25a9d0))]=_0x35c9ae[_0x8cb5('0x28')][_0x25a9d0];}}}}return _0x1822c4;};exports[_0x8cb5('0x2f')]=function(_0x38421b){var _0x1e9bb6={};for(var _0x2c9449 in _0x38421b){if(_0x38421b['hasOwnProperty'](_0x2c9449)){_0x1e9bb6[util[_0x8cb5('0x18')]('%s',_['toLower'](_0x2c9449))]=_0x38421b[_0x2c9449];}}return{'variables':_0x1e9bb6};};exports['updateOriginated']=function(_0x17eb1c,_0x35d4ae){if(!_[_0x8cb5('0x16')](_0x17eb1c)){if(_0x17eb1c[_0x8cb5('0x29')](_0x8cb5('0x30'))){if(_0x17eb1c[_0x8cb5('0x30')]>0x0){_0x17eb1c[_0x8cb5('0x30')]-=0x1;}else{logger[_0x8cb5('0x9')](_0x8cb5('0x31'),_0x35d4ae);}}}else{logger[_0x8cb5('0x9')](_0x8cb5('0x32'),_0x35d4ae);}};exports[_0x8cb5('0x33')]=function(_0x557179){var _0x2a1e17=moment()[_0x8cb5('0x18')](_0x8cb5('0x34'));_0x557179[_0x8cb5('0x35')]=0xd;_0x557179[_0x8cb5('0x36')]='Blacklist';_0x557179[_0x8cb5('0x37')]=_0x2a1e17;_0x557179['responsetime']=_0x2a1e17;_0x557179[_0x8cb5('0x38')]=_0x2a1e17;};exports[_0x8cb5('0x39')]=function(_0x2f7a16,_0x5bff0a,_0x3546e7){var _0x3b3298=moment()[_0x8cb5('0x18')]('YYYY-MM-DD\x20HH:mm:ss');_0x2f7a16[_0x8cb5('0x35')]=_0x5bff0a;_0x2f7a16[_0x8cb5('0x36')]=_0x3546e7;_0x2f7a16['responsetime']=_0x3b3298;_0x2f7a16[_0x8cb5('0x3a')]=getSeconds(_0x2f7a16[_0x8cb5('0x3b')],_0x2f7a16['starttime']);};exports[_0x8cb5('0x3c')]=function(_0x2caff7,_0x59c15a,_0xb6fdbf){_0x2caff7[_0x8cb5('0x3d')]=_0x59c15a;_0x2caff7[_0x8cb5('0x3e')]=_0xb6fdbf;};exports[_0x8cb5('0x3f')]=function(_0x5e2b7d,_0x46d265,_0x697833){var _0x1834d9=moment()[_0x8cb5('0x18')](_0x8cb5('0x34'));_0x5e2b7d['state']=_0x46d265;_0x5e2b7d['statedesc']=_0x697833;_0x5e2b7d[_0x8cb5('0x3b')]=_0x5e2b7d[_0x8cb5('0x3b')]?_0x5e2b7d['responsetime']:_0x1834d9;_0x5e2b7d[_0x8cb5('0x38')]=_0x5e2b7d['endtime']?_0x5e2b7d[_0x8cb5('0x38')]:_0x1834d9;_0x5e2b7d[_0x8cb5('0x3a')]=getSeconds(_0x5e2b7d[_0x8cb5('0x3b')]||0x0,_0x5e2b7d[_0x8cb5('0x37')]||0x0);_0x5e2b7d[_0x8cb5('0x40')]=_0x5e2b7d[_0x8cb5('0x41')]?getSeconds(_0x5e2b7d[_0x8cb5('0x38')],_0x5e2b7d[_0x8cb5('0x41')]):0x0;};exports['isFailure']=function(_0x2478f3){return _0x2478f3===_0x8cb5('0x42');};exports[_0x8cb5('0x43')]=function(_0x310511,_0xc7afec,_0x470f80,_0x3f894d,_0x35edb8){var _0x4bfdc0=_0x3f894d?_0x8cb5('0x44'):_0x310511[_0x8cb5('0x19')];_0x4bfdc0=_0x35edb8?_0x8cb5('0x45'):_0x4bfdc0;return{'actionid':_0x310511[_0x8cb5('0x46')],'action':_0x8cb5('0x47'),'channel':_0x310511[_0x8cb5('0x48')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x4bfdc0,_0x310511[_0x8cb5('0x1a')]),'Exten':_0x8cb5('0x26'),'Context':'from-sip','Priority':'1','variable':_0x470f80,'timeout':(_0xc7afec[_0x8cb5('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x310511[_0x8cb5('0x46')]};};exports[_0x8cb5('0x4a')]=function(_0x54a67d){return _0x54a67d['countbusyretry']+_0x54a67d[_0x8cb5('0x4b')]+_0x54a67d[_0x8cb5('0x4c')]+_0x54a67d[_0x8cb5('0x4d')]+_0x54a67d['countnosuchnumberretry'];};exports[_0x8cb5('0x4e')]=function(_0x217353){var _0xc6851=_[_0x8cb5('0x4f')](_0x217353);_0xc6851[_0x8cb5('0x35')]=0xf;_0xc6851[_0x8cb5('0x36')]=_0x8cb5('0x50');return _0xc6851;};exports[_0x8cb5('0x51')]=function(_0x5093c5,_0x1307d0,_0x29b3a4){var _0x258be0={};_0x258be0[_0x1307d0]=_0x5093c5[_0x1307d0];_0x258be0[_0x8cb5('0x52')]=![];_0x258be0[_0x8cb5('0x53')]=moment()[_0x8cb5('0x54')](_0x29b3a4,_0x8cb5('0x55'))[_0x8cb5('0x18')](_0x8cb5('0x34'));_0x258be0[_0x8cb5('0x1b')]=_0x5093c5[_0x8cb5('0x1b')];_0x258be0[_0x8cb5('0x56')]=_0x5093c5[_0x8cb5('0x56')];_0x258be0[_0x8cb5('0x1c')]=_0x5093c5[_0x8cb5('0x1c')]||undefined;return _0x258be0;};exports['decrementTalkink']=function(_0x22b7d2,_0x1ccc84){if(!_[_0x8cb5('0x16')](_0x22b7d2)){if(_0x22b7d2[_0x8cb5('0x57')]>0x0){_0x22b7d2[_0x8cb5('0x57')]-=0x1;}else{logger[_0x8cb5('0x9')](_0x1ccc84,_0x8cb5('0x58'));}}else{logger[_0x8cb5('0x9')](_0x1ccc84,_0x8cb5('0x59'));}};exports[_0x8cb5('0x5a')]=function(_0x50d20e){if(_0x50d20e<=0x0){return!![];}return![];};exports['buildObj']=function(_0x24486e,_0x4d54ad,_0xe74840){_0x24486e[_0x8cb5('0x5b')]=_0x4d54ad;_0x24486e[_0x8cb5('0x5c')]=_0x24486e[_0x8cb5('0x5d')];_0x24486e[_0x8cb5('0x5e')]=_0x24486e['channelAgent'];if(_0xe74840){_0x24486e['mandatoryDisposition']=_0xe74840[_0x8cb5('0x5f')];}return _0x24486e;};exports['buildAcw']=function(_0x380774){var _0x2ba102={};_0x2ba102['queue']=_0x380774[_0x8cb5('0x5d')];_0x2ba102[_0x8cb5('0x5e')]=_0x380774[_0x8cb5('0x48')];_0x2ba102['uniqueid']=_0x380774[_0x8cb5('0x46')];return _0x2ba102;};exports[_0x8cb5('0x60')]=function(_0x207582){var _0x3fdb3a=[];for(var _0x4f6260 in _0x207582){if(_0x207582['hasOwnProperty'](_0x4f6260)){if(!_[_0x8cb5('0x16')](_0x207582[_0x4f6260])&&_0x207582[_0x4f6260][_0x8cb5('0x35')]===_0x8cb5('0x61')&&_0x207582[_0x4f6260][_0x8cb5('0x62')]===_0x8cb5('0x63')){_0x3fdb3a[_0x8cb5('0x64')](_0x207582[_0x4f6260]['id']);}}}return _0x3fdb3a;};exports['getDiff']=function(_0x585486){var _0xac6cf5=moment()['milliseconds'](0x0);var _0x2ba7ba=moment(_0x585486)[_0x8cb5('0x6')](0x0);return _0xac6cf5[_0x8cb5('0x65')](_0x2ba7ba,_0x8cb5('0x7'));};exports['createBody']=function(_0x4b351a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4b351a[_0x8cb5('0x1b')],'ListId':_0x4b351a[_0x8cb5('0x56')],'VoiceQueueId':_0x4b351a[_0x8cb5('0x1c')]||undefined,'CampaignId':_0x4b351a['CampaignId']||undefined};};exports[_0x8cb5('0x66')]=function(_0x297c5c){if(_0x297c5c===_0x8cb5('0x46')||_0x297c5c===_0x8cb5('0x67')||_0x297c5c===_0x8cb5('0x5d')||_0x297c5c===_0x8cb5('0x68')||_0x297c5c==='campaigntype'||_0x297c5c===_0x8cb5('0x69')||_0x297c5c===_0x8cb5('0x3d')||_0x297c5c===_0x8cb5('0x48')||_0x297c5c===_0x8cb5('0x19')||_0x297c5c==='active'||_0x297c5c==='calleridnum'||_0x297c5c===_0x8cb5('0x53')||_0x297c5c===_0x8cb5('0x6a')||_0x297c5c===_0x8cb5('0x4b')||_0x297c5c===_0x8cb5('0x4c')||_0x297c5c===_0x8cb5('0x6b')||_0x297c5c==='callback'||_0x297c5c===_0x8cb5('0x6c')||_0x297c5c===_0x8cb5('0x6d')||_0x297c5c===_0x8cb5('0x6e')||_0x297c5c===_0x8cb5('0x1b')||_0x297c5c===_0x8cb5('0x56')||_0x297c5c===_0x8cb5('0x3e')||_0x297c5c===_0x8cb5('0x1c')||_0x297c5c===_0x8cb5('0x6f')||_0x297c5c==='xmd-voicequeueid'||_0x297c5c===_0x8cb5('0x70')||_0x297c5c===_0x8cb5('0x71')||_0x297c5c===_0x8cb5('0x72')||_0x297c5c===_0x8cb5('0x73')||_0x297c5c===_0x8cb5('0x74')||_0x297c5c===_0x8cb5('0x75')||_0x297c5c==='xmd-dialid'||_0x297c5c===_0x8cb5('0x76')||_0x297c5c===_0x8cb5('0x77')||_0x297c5c===_0x8cb5('0x78')||_0x297c5c==='xmd-callerid'||_0x297c5c===_0x8cb5('0x79')||_0x297c5c===_0x8cb5('0x7a')||_0x297c5c===_0x8cb5('0x7b')||_0x297c5c===_0x8cb5('0x7c')||_0x297c5c===_0x8cb5('0x7d')||_0x297c5c===_0x8cb5('0x7e')||_0x297c5c===_0x8cb5('0x7f')||_0x297c5c===_0x8cb5('0x80')||_0x297c5c==='rtpaudioqosrtt'||_0x297c5c==='rtpaudioqosrttbridged'||_0x297c5c===_0x8cb5('0x7b')||_0x297c5c==='rtpaudioqosbridged'||_0x297c5c===_0x8cb5('0x7d')||_0x297c5c===_0x8cb5('0x7e')||_0x297c5c==='rtpaudioqosloss'||_0x297c5c===_0x8cb5('0x80')||_0x297c5c===_0x8cb5('0x81')||_0x297c5c===_0x8cb5('0x82')||_0x297c5c===_0x8cb5('0x83')||_0x297c5c==='bridgepvtcallid'||_0x297c5c===_0x8cb5('0x35')||_0x297c5c===_0x8cb5('0x36')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x5c3b31,_0x4d8a09){var _0x2dc7be,_0x6975ba,_0x3d23ec;if(_0x4d8a09<=0x0){_0x4d8a09=0x1;}_0x2dc7be=new RegExp('\x5cw{0,'+_0x4d8a09+'}$');_0x6975ba=Math[_0x8cb5('0x84')](0xa,_0x4d8a09-0x1);_0x3d23ec=Math[_0x8cb5('0x84')](0xa,_0x4d8a09)-0x1;return util[_0x8cb5('0x18')]('%s',_[_0x8cb5('0x85')](_0x5c3b31,_0x2dc7be,_['random'](_0x6975ba,_0x3d23ec)));};exports[_0x8cb5('0x86')]=function(_0x327a39){var _0x43359c=_0x327a39['match'](/"(.*?)"/);return _0x43359c?_0x43359c[0x1]:_0x327a39;};exports[_0x8cb5('0x87')]=function(_0x51583e){var _0x7c47c6=_0x51583e['match'](/<(.*?)>/);return _0x7c47c6?_0x7c47c6[0x1]:_0x51583e;}; \ No newline at end of file +var _0x5f49=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','interface','channelAgent','mandatoryDisposition','queue','agentReadyId','not_inuse','reachable','getDiff','milliseconds','createBody','ListId','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-agi','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','match','extractCalleridNumber','lodash','moment','../../../../config/logger','env','127.0.0.1','diff','seconds','inspect','logger','loggerError','error','logger2','info','message','getCallerId','string','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','Queue','name','calleridname','calleridnum','ContactId','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','state','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','statedesc','ringtime','UserId','logCustomer','answertime','Failure','RECALL','BOOKED','uniqueid','originate','from-sip','totalGlobal','countbusyretry'];(function(_0x152422,_0x153adb){var _0x4254a1=function(_0x50c9b3){while(--_0x50c9b3){_0x152422['push'](_0x152422['shift']());}};_0x4254a1(++_0x153adb);}(_0x5f49,0x13d));var _0x95f4=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x5f49[_0x381589];return _0x2a075d;};'use strict';var util=require('util');var _=require(_0x95f4('0x0'));var moment=require(_0x95f4('0x1'));var logger=require(_0x95f4('0x2'))('preview');var ipAgi=process[_0x95f4('0x3')]['XCALLY_IP_AGI']||_0x95f4('0x4');function getSeconds(_0xdbdbe0,_0xe9a4e8){var _0x37c9a1=moment(_0xdbdbe0)['milliseconds'](0x0);var _0x50c136=moment(_0xe9a4e8)['milliseconds'](0x0);return _0x37c9a1[_0x95f4('0x5')](_0x50c136,_0x95f4('0x6'));}exports['loggerCatch']=function(_0x147243){return function(_0x50fe36){logger['error'](_0x147243,util[_0x95f4('0x7')](_0x50fe36,{'showHidden':![],'depth':null}));};};exports[_0x95f4('0x8')]=function(_0x2ed573,_0x2473e4){logger['info'](_0x2ed573,util[_0x95f4('0x7')](_0x2473e4,{'showHidden':![],'depth':null}));};exports[_0x95f4('0x9')]=function(_0x4db92a,_0x4e630e){logger[_0x95f4('0xa')](_0x4db92a,util[_0x95f4('0x7')](_0x4e630e,{'showHidden':![],'depth':null}));};exports[_0x95f4('0xb')]=function(_0x475d59){return function(_0x3f50cb){logger[_0x95f4('0xc')](_0x475d59,util['inspect'](_0x3f50cb,{'showHidden':![],'depth':null}));};};exports[_0x95f4('0xd')]=function(_0x1f9aa6,_0x5a3e19,_0x23ba7d){return{'message':_0x1f9aa6,'unlock':_0x5a3e19,'active':_0x23ba7d};};exports[_0x95f4('0xe')]=function(_0x25bbf6,_0x328880,_0x5e3c32){if(!_['isUndefined'](_0x5e3c32)&&_0x95f4('0xf')===typeof _0x5e3c32&&!_['isEmpty'](_0x5e3c32)){if(!_[_0x95f4('0x10')](_0x328880)&&_0x95f4('0xf')===typeof _0x328880&&!_[_0x95f4('0x11')](_0x328880)){return util[_0x95f4('0x12')]('\x22%s\x22\x20<%s>',_0x328880,_0x5e3c32);}return util['format'](_0x95f4('0x13'),_0x5e3c32,_0x5e3c32);}if(!_['isUndefined'](_0x25bbf6)&&_0x95f4('0xf')===typeof _0x25bbf6&&!_[_0x95f4('0x11')](_0x25bbf6)){return _0x25bbf6;}return _0x95f4('0x14');};exports['isActive']=function(_0x2961eb){if(_['isNil'](_0x2961eb)){return![];}return _0x2961eb;};exports['addVariables']=function(_0x36af64,_0x293e23,_0x4d4e83,_0x18edc8,_0x2737df,_0x131e0b){var _0x3f40ce={'XMD-QUEUE':_0x293e23['Queue']?_0x293e23[_0x95f4('0x15')][_0x95f4('0x16')]:'','XMD-CALLERID':_0x18edc8,'XMD-CALLERID-PREVIEW':_0x131e0b?util['format']('\x22%s\x22\x20<%s>',_0x131e0b[_0x95f4('0x17')],_0x131e0b[_0x95f4('0x18')]):_0x18edc8,'XMD-DIALID':_0x2737df,'XMD-CONTACTID':_0x293e23[_0x95f4('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x18edc8,'XMD-VOICEQUEUEID':_0x293e23['VoiceQueueId'],'XMD-DIALCHANNEL':_0x4d4e83,'XMD-DIALTIMEOUT':_0x36af64['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x95f4('0x12')]('\x22rtTxX%s%s\x22',_0x36af64[_0x95f4('0x1a')]?'g':'',_[_0x95f4('0x11')](_0x36af64[_0x95f4('0x1b')])?'':_0x95f4('0x1c')),'XMD-DIALURL':_0x36af64[_0x95f4('0x1d')]||'','XMD-AGI':_0x36af64['dialQueueProject']?util[_0x95f4('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x36af64[_0x95f4('0x1e')]):_0x95f4('0x1f'),'XMD-AGIAFTER':_0x36af64['dialQueueProject2']?util[_0x95f4('0x12')](_0x95f4('0x20'),ipAgi,_0x36af64[_0x95f4('0x1a')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x131e0b?_0x131e0b[_0x95f4('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x131e0b?_0x131e0b[_0x95f4('0x22')]:'','XMD-DESTINATION':_0x95f4('0x23')};if(!_[_0x95f4('0x11')](_0x36af64[_0x95f4('0x1b')])){_0x3f40ce[util['format']('%s',_0x95f4('0x24'))]=_0x36af64['monitor_format'];_0x3f40ce[util[_0x95f4('0x12')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x2737df;}if(_0x293e23&&_0x293e23[_0x95f4('0x25')]){for(var _0x517ce0 in _0x293e23[_0x95f4('0x25')]){if(_0x293e23[_0x95f4('0x25')][_0x95f4('0x26')](_0x517ce0)){if(!_[_0x95f4('0x27')](_0x293e23[_0x95f4('0x25')][_0x517ce0])&&_0x517ce0!=='id'&&_0x517ce0!==_0x95f4('0x28')&&_0x517ce0!==_0x95f4('0x29')&&_0x517ce0!==_0x95f4('0x2a')){_0x3f40ce[util[_0x95f4('0x12')](_0x95f4('0x2b'),'XMD-',_[_0x95f4('0x2c')](_0x517ce0))]=_0x293e23[_0x95f4('0x25')][_0x517ce0];}}}}return _0x3f40ce;};exports[_0x95f4('0x2d')]=function(_0x246df0){var _0x3cc616={};for(var _0x35dca3 in _0x246df0){if(_0x246df0[_0x95f4('0x26')](_0x35dca3)){_0x3cc616[util[_0x95f4('0x12')]('%s',_[_0x95f4('0x2e')](_0x35dca3))]=_0x246df0[_0x35dca3];}}return{'variables':_0x3cc616};};exports[_0x95f4('0x2f')]=function(_0x4709b6,_0x15b789){if(!_[_0x95f4('0x27')](_0x4709b6)){if(_0x4709b6['hasOwnProperty'](_0x95f4('0x30'))){if(_0x4709b6[_0x95f4('0x30')]>0x0){_0x4709b6[_0x95f4('0x30')]-=0x1;}else{logger['error'](_0x95f4('0x31'),_0x15b789);}}}else{logger[_0x95f4('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x15b789);}};exports[_0x95f4('0x32')]=function(_0x39fcd8){var _0x67e629=moment()[_0x95f4('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x39fcd8[_0x95f4('0x33')]=0xd;_0x39fcd8['statedesc']='Blacklist';_0x39fcd8[_0x95f4('0x34')]=_0x67e629;_0x39fcd8[_0x95f4('0x35')]=_0x67e629;_0x39fcd8[_0x95f4('0x36')]=_0x67e629;};exports[_0x95f4('0x37')]=function(_0x5459b1,_0x25bf31,_0x23e68a){var _0x456e7d=moment()[_0x95f4('0x12')](_0x95f4('0x38'));_0x5459b1['state']=_0x25bf31;_0x5459b1[_0x95f4('0x39')]=_0x23e68a;_0x5459b1['responsetime']=_0x456e7d;_0x5459b1[_0x95f4('0x3a')]=getSeconds(_0x5459b1[_0x95f4('0x35')],_0x5459b1['starttime']);};exports['logLookAgent']=function(_0x5f209c,_0x5bc89e,_0x26bb6c){_0x5f209c['membername']=_0x5bc89e;_0x5f209c[_0x95f4('0x3b')]=_0x26bb6c;};exports[_0x95f4('0x3c')]=function(_0x1c80b0,_0x3a3fc4,_0x5d0295){var _0x25c5fb=moment()[_0x95f4('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c80b0[_0x95f4('0x33')]=_0x3a3fc4;_0x1c80b0[_0x95f4('0x39')]=_0x5d0295;_0x1c80b0[_0x95f4('0x35')]=_0x1c80b0['responsetime']?_0x1c80b0[_0x95f4('0x35')]:_0x25c5fb;_0x1c80b0[_0x95f4('0x36')]=_0x1c80b0[_0x95f4('0x36')]?_0x1c80b0[_0x95f4('0x36')]:_0x25c5fb;_0x1c80b0['ringtime']=getSeconds(_0x1c80b0[_0x95f4('0x35')]||0x0,_0x1c80b0['starttime']||0x0);_0x1c80b0['talktime']=_0x1c80b0[_0x95f4('0x3d')]?getSeconds(_0x1c80b0[_0x95f4('0x36')],_0x1c80b0[_0x95f4('0x3d')]):0x0;};exports['isFailure']=function(_0x461e7f){return _0x461e7f===_0x95f4('0x3e');};exports['variablesAction']=function(_0x70d665,_0x637cef,_0x3572e8,_0x57e0f9,_0x4fc9c8){var _0x5d61c8=_0x57e0f9?_0x95f4('0x3f'):_0x70d665[_0x95f4('0x17')];_0x5d61c8=_0x4fc9c8?_0x95f4('0x40'):_0x5d61c8;return{'actionid':_0x70d665[_0x95f4('0x41')],'action':_0x95f4('0x42'),'channel':_0x70d665['channelAgent'],'callerid':util[_0x95f4('0x12')](_0x95f4('0x13'),_0x5d61c8,_0x70d665[_0x95f4('0x18')]),'Exten':_0x95f4('0x23'),'Context':_0x95f4('0x43'),'Priority':'1','variable':_0x3572e8,'timeout':(_0x637cef['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x70d665[_0x95f4('0x41')]};};exports[_0x95f4('0x44')]=function(_0x10dfb6){return _0x10dfb6[_0x95f4('0x45')]+_0x10dfb6[_0x95f4('0x46')]+_0x10dfb6[_0x95f4('0x47')]+_0x10dfb6['countagentrejectretry']+_0x10dfb6[_0x95f4('0x48')];};exports[_0x95f4('0x49')]=function(_0x4d7a54){var _0x5995c3=_[_0x95f4('0x4a')](_0x4d7a54);_0x5995c3[_0x95f4('0x33')]=0xf;_0x5995c3[_0x95f4('0x39')]=_0x95f4('0x4b');return _0x5995c3;};exports[_0x95f4('0x4c')]=function(_0x4688da,_0x591cff,_0x3f4345){var _0x4494e2={};_0x4494e2[_0x591cff]=_0x4688da[_0x591cff];_0x4494e2[_0x95f4('0x4d')]=![];_0x4494e2[_0x95f4('0x4e')]=moment()[_0x95f4('0x4f')](_0x3f4345,_0x95f4('0x50'))[_0x95f4('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x4494e2[_0x95f4('0x19')]=_0x4688da['ContactId'];_0x4494e2['ListId']=_0x4688da['ListId'];_0x4494e2[_0x95f4('0x51')]=_0x4688da['VoiceQueueId']||undefined;return _0x4494e2;};exports[_0x95f4('0x52')]=function(_0x13dbc0,_0x16cc48){if(!_[_0x95f4('0x27')](_0x13dbc0)){if(_0x13dbc0['pTalking']>0x0){_0x13dbc0[_0x95f4('0x53')]-=0x1;}else{logger[_0x95f4('0xa')](_0x16cc48,_0x95f4('0x54'));}}else{logger[_0x95f4('0xa')](_0x16cc48,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x95f4('0x55')]=function(_0x598e53){if(_0x598e53<=0x0){return!![];}return![];};exports['buildObj']=function(_0x46d887,_0xdbb89f,_0x49baf7){_0x46d887[_0x95f4('0x56')]=_0xdbb89f;_0x46d887['name']=_0x46d887['queue'];_0x46d887[_0x95f4('0x57')]=_0x46d887[_0x95f4('0x58')];if(_0x49baf7){_0x46d887[_0x95f4('0x59')]=_0x49baf7['mandatoryDisposition'];}return _0x46d887;};exports['buildAcw']=function(_0x48a56d){var _0x283f2a={};_0x283f2a[_0x95f4('0x5a')]=_0x48a56d[_0x95f4('0x5a')];_0x283f2a[_0x95f4('0x57')]=_0x48a56d[_0x95f4('0x58')];_0x283f2a[_0x95f4('0x41')]=_0x48a56d[_0x95f4('0x41')];return _0x283f2a;};exports[_0x95f4('0x5b')]=function(_0x29d72a){var _0xe1ec3c=[];for(var _0x2892e3 in _0x29d72a){if(_0x29d72a[_0x95f4('0x26')](_0x2892e3)){if(!_[_0x95f4('0x27')](_0x29d72a[_0x2892e3])&&_0x29d72a[_0x2892e3][_0x95f4('0x33')]===_0x95f4('0x5c')&&_0x29d72a[_0x2892e3]['status']===_0x95f4('0x5d')){_0xe1ec3c['push'](_0x29d72a[_0x2892e3]['id']);}}}return _0xe1ec3c;};exports[_0x95f4('0x5e')]=function(_0x3b5bb7){var _0x4cb87e=moment()[_0x95f4('0x5f')](0x0);var _0x5dc71d=moment(_0x3b5bb7)['milliseconds'](0x0);return _0x4cb87e[_0x95f4('0x5')](_0x5dc71d,_0x95f4('0x6'));};exports[_0x95f4('0x60')]=function(_0x1f44f2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1f44f2['ContactId'],'ListId':_0x1f44f2[_0x95f4('0x61')],'VoiceQueueId':_0x1f44f2[_0x95f4('0x51')]||undefined,'CampaignId':_0x1f44f2[_0x95f4('0x62')]||undefined};};exports[_0x95f4('0x63')]=function(_0xa1b835){if(_0xa1b835===_0x95f4('0x41')||_0xa1b835===_0x95f4('0x64')||_0xa1b835==='queue'||_0xa1b835===_0x95f4('0x65')||_0xa1b835===_0x95f4('0x66')||_0xa1b835===_0x95f4('0x67')||_0xa1b835==='membername'||_0xa1b835===_0x95f4('0x58')||_0xa1b835===_0x95f4('0x17')||_0xa1b835==='active'||_0xa1b835==='calleridnum'||_0xa1b835===_0x95f4('0x4e')||_0xa1b835===_0x95f4('0x45')||_0xa1b835===_0x95f4('0x46')||_0xa1b835===_0x95f4('0x47')||_0xa1b835==='countglobal'||_0xa1b835===_0x95f4('0x68')||_0xa1b835===_0x95f4('0x69')||_0xa1b835===_0x95f4('0x6a')||_0xa1b835===_0x95f4('0x6b')||_0xa1b835===_0x95f4('0x19')||_0xa1b835===_0x95f4('0x61')||_0xa1b835===_0x95f4('0x3b')||_0xa1b835==='VoiceQueueId'||_0xa1b835===_0x95f4('0x6c')||_0xa1b835===_0x95f4('0x6d')||_0xa1b835==='xmd-queue'||_0xa1b835===_0x95f4('0x6e')||_0xa1b835==='xmd-listid'||_0xa1b835==='xmd-dialurl'||_0xa1b835===_0x95f4('0x6f')||_0xa1b835==='xmd-dialoptions'||_0xa1b835===_0x95f4('0x70')||_0xa1b835===_0x95f4('0x71')||_0xa1b835==='xmd-contactid'||_0xa1b835===_0x95f4('0x72')||_0xa1b835==='xmd-callerid'||_0xa1b835==='xmd-agiafter'||_0xa1b835===_0x95f4('0x73')||_0xa1b835==='rtpaudioqos'||_0xa1b835==='rtpaudioqosbridged'||_0xa1b835==='rtpaudioqosjitter'||_0xa1b835==='rtpaudioqosjitterbridged'||_0xa1b835===_0x95f4('0x74')||_0xa1b835===_0x95f4('0x75')||_0xa1b835===_0x95f4('0x76')||_0xa1b835===_0x95f4('0x77')||_0xa1b835===_0x95f4('0x78')||_0xa1b835===_0x95f4('0x79')||_0xa1b835==='rtpaudioqosjitter'||_0xa1b835===_0x95f4('0x7a')||_0xa1b835===_0x95f4('0x74')||_0xa1b835===_0x95f4('0x75')||_0xa1b835===_0x95f4('0x76')||_0xa1b835===_0x95f4('0x77')||_0xa1b835===_0x95f4('0x7b')||_0xa1b835===_0x95f4('0x7c')||_0xa1b835===_0x95f4('0x33')||_0xa1b835==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2be967,_0x280b3e){var _0x13d6dc,_0x202033,_0x44309a;if(_0x280b3e<=0x0){_0x280b3e=0x1;}_0x13d6dc=new RegExp(_0x95f4('0x7d')+_0x280b3e+'}$');_0x202033=Math[_0x95f4('0x7e')](0xa,_0x280b3e-0x1);_0x44309a=Math[_0x95f4('0x7e')](0xa,_0x280b3e)-0x1;return util['format']('%s',_['replace'](_0x2be967,_0x13d6dc,_['random'](_0x202033,_0x44309a)));};exports['extractCalleridName']=function(_0x245cac){var _0x212ef9=_0x245cac[_0x95f4('0x7f')](/"(.*?)"/);return _0x212ef9?_0x212ef9[0x1]:_0x245cac;};exports[_0x95f4('0x80')]=function(_0x353ddb){var _0x5d32d9=_0x353ddb[_0x95f4('0x7f')](/<(.*?)>/);return _0x5d32d9?_0x5d32d9[0x1]:_0x353ddb;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 6512539..564629c 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 _0xb10b=['voicequeuechannelhangup','queueadd','string','number','queueremove','queuepause','boolean','reload','voicechannel'];(function(_0x37459d,_0x3e5191){var _0x2fac31=function(_0x162082){while(--_0x162082){_0x37459d['push'](_0x37459d['shift']());}};_0x2fac31(++_0x3e5191);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b5c23,_0x101faa){_0x4b5c23=_0x4b5c23-0x0;var _0x262cfd=_0xb10b[_0x4b5c23];return _0x262cfd;};'use strict';exports[_0xbb10('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]},'membername':{'type':_0xbb10('0x1'),'required':!![]},'penalty':{'type':_0xbb10('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xbb10('0x3')]={'queue':{'type':_0xbb10('0x1'),'required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x4')]={'interface':{'type':_0xbb10('0x1'),'required':!![]},'paused':{'type':_0xbb10('0x5')},'reason':{'type':'string','required':![]}};exports[_0xbb10('0x6')]={'module':{'type':_0xbb10('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x7')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]},'filename':{'type':_0xbb10('0x1')},'format':{'type':_0xbb10('0x1')},'mixmonitorid':{'type':_0xbb10('0x1')}};exports[_0xbb10('0x8')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xbb10('0x1'),'required':!![]},'context':{'type':_0xbb10('0x1')}}; \ No newline at end of file +var _0x7a54=['number','boolean','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x42d0e8,_0x3da88d){var _0x35842e=function(_0x3df1ec){while(--_0x3df1ec){_0x42d0e8['push'](_0x42d0e8['shift']());}};_0x35842e(++_0x3da88d);}(_0x7a54,0x106));var _0x47a5=function(_0x5dd582,_0x2a2e99){_0x5dd582=_0x5dd582-0x0;var _0x45c36a=_0x7a54[_0x5dd582];return _0x45c36a;};'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 63e5117..12ec702 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 _0x9bde=['diff','queuecallercomplete','initVoiceCallReports','duration','billableseconds','initCampaigns','campaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','util','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','trunks','voiceQueues','triggers','templates','outbound','voiceExtensions','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','isUndefined','telephones','initTrunks','initVoiceQueues','initTriggers','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt'];(function(_0x4db9b5,_0x64570b){var _0x2a36c3=function(_0x4f9877){while(--_0x4f9877){_0x4db9b5['push'](_0x4db9b5['shift']());}};_0x2a36c3(++_0x64570b);}(_0x9bde,0xe1));var _0xe9bd=function(_0x238537,_0x368c54){_0x238537=_0x238537-0x0;var _0x48eaa7=_0x9bde[_0x238537];return _0x48eaa7;};'use strict';var BPromise=require('bluebird');var util=require(_0xe9bd('0x0'));var _=require('lodash');var moment=require(_0xe9bd('0x1'));var Agent=require('../model/agent');var Telephone=require(_0xe9bd('0x2'));var Trunk=require(_0xe9bd('0x3'));var VoiceQueue=require(_0xe9bd('0x4'));var Trigger=require(_0xe9bd('0x5'));var Template=require(_0xe9bd('0x6'));var Campaign=require(_0xe9bd('0x7'));var VoiceExtension=require(_0xe9bd('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xe9bd('0x9'));var FreshdeskAccount=require(_0xe9bd('0xa'));var SugarcrmAccount=require(_0xe9bd('0xb'));var ZohoAccount=require(_0xe9bd('0xc'));var DeskAccount=require(_0xe9bd('0xd'));var VtigerAccount=require(_0xe9bd('0xe'));var ServicenowAccount=require(_0xe9bd('0xf'));var Dynamics365Account=require(_0xe9bd('0x10'));var FreshsalesAccount=require(_0xe9bd('0x11'));var FaxAccount=require(_0xe9bd('0x12'));var Realtime=function(){this['agents']={};this['telephones']={};this[_0xe9bd('0x13')]={};this[_0xe9bd('0x14')]={};this[_0xe9bd('0x15')]={};this['campaigns']={};this[_0xe9bd('0x16')]={};this[_0xe9bd('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe9bd('0x18')]={};this[_0xe9bd('0x19')]={};this['queueChannels']={};this[_0xe9bd('0x1a')]={};this['timers']={};this[_0xe9bd('0x1b')]={};this[_0xe9bd('0x1c')]={};this[_0xe9bd('0x1d')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xe9bd('0x1e')]={};this[_0xe9bd('0x1f')]={};this[_0xe9bd('0x20')]={};this[_0xe9bd('0x21')]={};this[_0xe9bd('0x22')]={};this[_0xe9bd('0x23')]={};this[_0xe9bd('0x24')]={};};function freeIsNotKey(_0x573350,_0x1d11a0,_0x464a1b){var _0x160281=_['mapKeys'](_0x573350,function(_0x36f03d,_0x3bae08){return _0x36f03d[_0x464a1b];});for(var _0x34ba2b in _0x1d11a0){if(_0x1d11a0[_0xe9bd('0x25')](_0x34ba2b)){if(!_0x160281[_0x34ba2b]){delete _0x1d11a0[_0x34ba2b];}}}}function freeIsNotKeySip(_0x5cf674,_0x20ec32){var _0x50a5e8=_[_0xe9bd('0x26')](_0x5cf674,function(_0x55b869,_0x26aa4a){return util[_0xe9bd('0x27')](_0xe9bd('0x28'),_0x55b869[_0xe9bd('0x29')]);});for(var _0x1acb82 in _0x20ec32){if(_0x20ec32[_0xe9bd('0x25')](_0x1acb82)){if(!_0x50a5e8[_0x1acb82]){delete _0x20ec32[_0x1acb82];}}}}function freeIsNotKeyAgent(_0x6593ce,_0x49165b){var _0x133318=_[_0xe9bd('0x26')](_0x6593ce,function(_0x4ecaf5,_0x37aec1){var _0x505c23=_[_0xe9bd('0x2a')](_0x4ecaf5[_0xe9bd('0x2b')])?util[_0xe9bd('0x27')](_0xe9bd('0x28'),_0x4ecaf5['name']):_0x4ecaf5[_0xe9bd('0x2b')];return _0x505c23;});for(var _0x1e3cbb in _0x49165b){if(_0x49165b[_0xe9bd('0x25')](_0x1e3cbb)){if(!_0x133318[_0x1e3cbb]){delete _0x49165b[_0x1e3cbb];}}}}function clearVoiceCallReports(_0x39b206){_0x39b206[_0xe9bd('0x2c')]=0x0;_0x39b206[_0xe9bd('0x2d')]=0x0;_0x39b206[_0xe9bd('0x2e')]=0x0;_0x39b206[_0xe9bd('0x2f')]=0x0;_0x39b206[_0xe9bd('0x30')]=0x0;}function clearCampaigns(_0x5987af){if(!_[_0xe9bd('0x31')](_0x5987af)){for(var _0x38fdfa in _0x5987af){if(_0x5987af['hasOwnProperty'](_0x38fdfa)){_0x5987af[_0x38fdfa][_0xe9bd('0x32')]=0x0;_0x5987af[_0x38fdfa][_0xe9bd('0x33')]=0x0;}}}}function clearVoiceQueues(_0x119672){if(!_[_0xe9bd('0x31')](_0x119672)){for(var _0x141b95 in _0x119672){if(_0x119672[_0xe9bd('0x25')](_0x141b95)){_0x119672[_0x141b95]['total']=0x0;_0x119672[_0x141b95]['answered']=0x0;_0x119672[_0x141b95][_0xe9bd('0x34')]=0x0;_0x119672[_0x141b95]['abandoned']=0x0;_0x119672[_0x141b95][_0xe9bd('0x2e')]=0x0;_0x119672[_0x141b95][_0xe9bd('0x2f')]=0x0;_0x119672[_0x141b95][_0xe9bd('0x30')]=0x0;_0x119672[_0x141b95][_0xe9bd('0x35')]=0x0;_0x119672[_0x141b95][_0xe9bd('0x36')]=0x0;_0x119672[_0x141b95]['outboundBusyCallsDay']=0x0;_0x119672[_0x141b95]['outboundCongestionCallsDay']=0x0;_0x119672[_0x141b95][_0xe9bd('0x37')]=0x0;_0x119672[_0x141b95][_0xe9bd('0x38')]=0x0;_0x119672[_0x141b95][_0xe9bd('0x39')]=0x0;_0x119672[_0x141b95][_0xe9bd('0x3a')]=0x0;_0x119672[_0x141b95][_0xe9bd('0x3b')]=0x0;_0x119672[_0x141b95][_0xe9bd('0x3c')]=0x0;_0x119672[_0x141b95][_0xe9bd('0x3d')]=0x0;_0x119672[_0x141b95][_0xe9bd('0x3e')]=0x0;_0x119672[_0x141b95][_0xe9bd('0x35')]=0x0;_0x119672[_0x141b95]['outboundAnswerCallsDay']=0x0;_0x119672[_0x141b95][_0xe9bd('0x3f')]=!![];}}}}Realtime[_0xe9bd('0x40')][_0xe9bd('0x41')]=function(_0x5117bc,_0x524e08){for(var _0x25eeab in _0x524e08){if(_0x5117bc[_0xe9bd('0x25')](_0x25eeab)){_0x5117bc[_0x25eeab]=_0x524e08[_0x25eeab];}}};Realtime[_0xe9bd('0x40')][_0xe9bd('0x42')]=function(){var _0x1dda43=this;return function(_0x2950e8){if(_0x2950e8){freeIsNotKeyAgent(_0x2950e8,_0x1dda43[_0xe9bd('0x43')]);for(var _0x1c6173=0x0,_0x1a1a29={},_0x32b3e3={};_0x1c6173<_0x2950e8[_0xe9bd('0x44')];_0x1c6173+=0x1){_0x1a1a29=_0x2950e8[_0x1c6173];var _0x549dd1=_[_0xe9bd('0x2a')](_0x1a1a29[_0xe9bd('0x2b')])?util[_0xe9bd('0x27')](_0xe9bd('0x28'),_0x1a1a29[_0xe9bd('0x29')]):_0x1a1a29[_0xe9bd('0x2b')];if(_['isUndefined'](_0x1dda43[_0xe9bd('0x43')][_0x549dd1])){_0x1dda43[_0xe9bd('0x43')][_0x549dd1]=new Agent(_0x1a1a29);}else{_0x1dda43['mergeFromDatabase'](_0x1dda43[_0xe9bd('0x43')][_0x549dd1],_0x1a1a29);}}}return _0x1dda43[_0xe9bd('0x43')];};};Realtime['prototype']['initTelephones']=function(){var _0x2785e6=this;return function(_0xdf43b9){if(_0xdf43b9){freeIsNotKeySip(_0xdf43b9,_0x2785e6['telephones']);for(var _0x2d1289=0x0,_0x3ea705={},_0x14927c={};_0x2d1289<_0xdf43b9['length'];_0x2d1289+=0x1){_0x3ea705=_0xdf43b9[_0x2d1289];if(_[_0xe9bd('0x45')](_0x2785e6['telephones'][util[_0xe9bd('0x27')](_0xe9bd('0x28'),_0x3ea705[_0xe9bd('0x29')])])){_0x2785e6[_0xe9bd('0x46')][util['format'](_0xe9bd('0x28'),_0x3ea705[_0xe9bd('0x29')])]=new Telephone(_0x3ea705);}else{_0x2785e6[_0xe9bd('0x41')](_0x2785e6[_0xe9bd('0x46')][util[_0xe9bd('0x27')](_0xe9bd('0x28'),_0x3ea705[_0xe9bd('0x29')])],_0x3ea705);}}}return _0x2785e6[_0xe9bd('0x46')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x47')]=function(){var _0x4e8565=this;return function(_0x5e3604){if(_0x5e3604){freeIsNotKeySip(_0x5e3604,_0x4e8565[_0xe9bd('0x13')]);for(var _0x499e13=0x0,_0x4608a0={},_0x340819={};_0x499e13<_0x5e3604[_0xe9bd('0x44')];_0x499e13+=0x1){_0x4608a0=_0x5e3604[_0x499e13];if(_['isUndefined'](_0x4e8565[_0xe9bd('0x13')][util[_0xe9bd('0x27')](_0xe9bd('0x28'),_0x4608a0['name'])])){_0x4e8565[_0xe9bd('0x13')][util[_0xe9bd('0x27')](_0xe9bd('0x28'),_0x4608a0[_0xe9bd('0x29')])]=new Trunk(_0x4608a0);}else{_0x4e8565[_0xe9bd('0x41')](_0x4e8565[_0xe9bd('0x13')][util[_0xe9bd('0x27')](_0xe9bd('0x28'),_0x4608a0[_0xe9bd('0x29')])],_0x4608a0);}}}return _0x4e8565[_0xe9bd('0x13')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x48')]=function(){var _0x2d4e62=this;return function(_0x2a9e09){if(_0x2a9e09){freeIsNotKey(_0x2a9e09,_0x2d4e62[_0xe9bd('0x14')],'name');for(var _0x5a86fd=0x0,_0x283e67={},_0x2ced7c={};_0x5a86fd<_0x2a9e09[_0xe9bd('0x44')];_0x5a86fd+=0x1){_0x283e67=_0x2a9e09[_0x5a86fd];if(_['isUndefined'](_0x2d4e62['voiceQueues'][_0x283e67[_0xe9bd('0x29')]])){_0x2d4e62[_0xe9bd('0x14')][_0x283e67[_0xe9bd('0x29')]]=new VoiceQueue(_0x283e67);}else{_0x2d4e62[_0xe9bd('0x41')](_0x2d4e62[_0xe9bd('0x14')][_0x283e67[_0xe9bd('0x29')]],_0x283e67);}}}return _0x2d4e62[_0xe9bd('0x14')];};};Realtime['prototype'][_0xe9bd('0x49')]=function(){var _0x4cc146=this;return function(_0x36726e){if(_0x36726e){freeIsNotKey(_0x36726e,_0x4cc146[_0xe9bd('0x15')],'id');for(var _0x33ba69=0x0,_0x17dbcd={},_0x74ea23={};_0x33ba69<_0x36726e['length'];_0x33ba69+=0x1){_0x17dbcd=_0x36726e[_0x33ba69];if(_[_0xe9bd('0x45')](_0x4cc146[_0xe9bd('0x15')][_0x17dbcd['id']])){_0x4cc146[_0xe9bd('0x15')][_0x17dbcd['id']]=new Trigger(_0x17dbcd);}else{_0x4cc146['mergeFromDatabase'](_0x4cc146[_0xe9bd('0x15')][_0x17dbcd['id']],_0x17dbcd);}}}return _0x4cc146[_0xe9bd('0x15')];};};Realtime[_0xe9bd('0x40')]['initTemplates']=function(){var _0x28d2ea=this;return function(_0x27e7b0){if(_0x27e7b0){freeIsNotKey(_0x27e7b0,_0x28d2ea[_0xe9bd('0x16')],'id');for(var _0x10ec29=0x0,_0x1ee09c={},_0x579d26={};_0x10ec29<_0x27e7b0[_0xe9bd('0x44')];_0x10ec29+=0x1){_0x1ee09c=_0x27e7b0[_0x10ec29];if(_['isUndefined'](_0x28d2ea[_0xe9bd('0x16')][_0x1ee09c['id']])){_0x28d2ea[_0xe9bd('0x16')][_0x1ee09c['id']]=new Template(_0x1ee09c);}else{_0x28d2ea[_0xe9bd('0x41')](_0x28d2ea[_0xe9bd('0x16')][_0x1ee09c['id']],_0x1ee09c);}}}return _0x28d2ea[_0xe9bd('0x16')];};};Realtime['prototype'][_0xe9bd('0x4a')]=function(){var _0x485e95=this;return function(_0x14eed2){if(_0x14eed2){freeIsNotKey(_0x14eed2,_0x485e95[_0xe9bd('0x1c')],'id');for(var _0x5e08ae=0x0,_0x59d5cb={},_0x1ce539={};_0x5e08ae<_0x14eed2['length'];_0x5e08ae+=0x1){_0x59d5cb=_0x14eed2[_0x5e08ae];if(_[_0xe9bd('0x45')](_0x485e95['zendeskAccounts'][_0x59d5cb['id']])){_0x485e95[_0xe9bd('0x1c')][_0x59d5cb['id']]=new ZendeskAccount(_0x59d5cb);}else{_0x485e95[_0xe9bd('0x41')](_0x485e95['zendeskAccounts'][_0x59d5cb['id']],_0x59d5cb);}}}return _0x485e95[_0xe9bd('0x1c')];};};Realtime['prototype'][_0xe9bd('0x4b')]=function(){var _0x2d9a94=this;return function(_0x321050){if(_0x321050){freeIsNotKey(_0x321050,_0x2d9a94['salesforceAccounts'],'id');for(var _0xa2ef49=0x0,_0x1d703f={},_0x45b69e={};_0xa2ef49<_0x321050[_0xe9bd('0x44')];_0xa2ef49+=0x1){_0x1d703f=_0x321050[_0xa2ef49];if(_['isUndefined'](_0x2d9a94['salesforceAccounts'][_0x1d703f['id']])){_0x2d9a94[_0xe9bd('0x1d')][_0x1d703f['id']]=new SalesforceAccount(_0x1d703f);}else{_0x2d9a94['mergeFromDatabase'](_0x2d9a94[_0xe9bd('0x1d')][_0x1d703f['id']],_0x1d703f);}}}return _0x2d9a94[_0xe9bd('0x1d')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x4c')]=function(){var _0x159f68=this;return function(_0x145ea3){if(_0x145ea3){freeIsNotKey(_0x145ea3,_0x159f68[_0xe9bd('0x4d')],'id');for(var _0x3381ee=0x0,_0x46a099={},_0x3be526={};_0x3381ee<_0x145ea3[_0xe9bd('0x44')];_0x3381ee+=0x1){_0x46a099=_0x145ea3[_0x3381ee];if(_[_0xe9bd('0x45')](_0x159f68['freshdeskAccounts'][_0x46a099['id']])){_0x159f68['freshdeskAccounts'][_0x46a099['id']]=new FreshdeskAccount(_0x46a099);}else{_0x159f68['mergeFromDatabase'](_0x159f68[_0xe9bd('0x4d')][_0x46a099['id']],_0x46a099);}}}return _0x159f68['freshdeskAccounts'];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x4e')]=function(){var _0x90db01=this;return function(_0x6232e5){if(_0x6232e5){freeIsNotKey(_0x6232e5,_0x90db01[_0xe9bd('0x1e')],'id');for(var _0xaf6ffd=0x0,_0x3bb2ba={},_0x46797c={};_0xaf6ffd<_0x6232e5[_0xe9bd('0x44')];_0xaf6ffd+=0x1){_0x3bb2ba=_0x6232e5[_0xaf6ffd];if(_['isUndefined'](_0x90db01[_0xe9bd('0x1e')][_0x3bb2ba['id']])){_0x90db01[_0xe9bd('0x1e')][_0x3bb2ba['id']]=new ZohoAccount(_0x3bb2ba);}else{_0x90db01[_0xe9bd('0x41')](_0x90db01[_0xe9bd('0x1e')][_0x3bb2ba['id']],_0x3bb2ba);}}}return _0x90db01['zohoAccounts'];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x4f')]=function(){var _0x34bd38=this;return function(_0x4e05f0){if(_0x4e05f0){freeIsNotKey(_0x4e05f0,_0x34bd38[_0xe9bd('0x1f')],'id');for(var _0x204ea9=0x0,_0x2d724f={},_0xfe82f7={};_0x204ea9<_0x4e05f0['length'];_0x204ea9+=0x1){_0x2d724f=_0x4e05f0[_0x204ea9];if(_['isUndefined'](_0x34bd38[_0xe9bd('0x1f')][_0x2d724f['id']])){_0x34bd38[_0xe9bd('0x1f')][_0x2d724f['id']]=new DeskAccount(_0x2d724f);}else{_0x34bd38[_0xe9bd('0x41')](_0x34bd38[_0xe9bd('0x1f')][_0x2d724f['id']],_0x2d724f);}}}return _0x34bd38['deskAccounts'];};};Realtime['prototype'][_0xe9bd('0x50')]=function(){var _0x20855b=this;return function(_0x3ea0cc){if(_0x3ea0cc){freeIsNotKey(_0x3ea0cc,_0x20855b[_0xe9bd('0x51')],'id');for(var _0x1fd2b5=0x0,_0x23f476={},_0x4870f8={};_0x1fd2b5<_0x3ea0cc[_0xe9bd('0x44')];_0x1fd2b5+=0x1){_0x23f476=_0x3ea0cc[_0x1fd2b5];if(_['isUndefined'](_0x20855b[_0xe9bd('0x51')][_0x23f476['id']])){_0x20855b[_0xe9bd('0x51')][_0x23f476['id']]=new SugarcrmAccount(_0x23f476);}else{_0x20855b[_0xe9bd('0x41')](_0x20855b[_0xe9bd('0x51')][_0x23f476['id']],_0x23f476);}}}return _0x20855b['sugarcrmAccounts'];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x52')]=function(){var _0x3b0190=this;return function(_0x4f35c4){if(_0x4f35c4){freeIsNotKey(_0x4f35c4,_0x3b0190[_0xe9bd('0x20')],'id');for(var _0x1a9d0c=0x0,_0x396154={},_0x3e3e05={};_0x1a9d0c<_0x4f35c4[_0xe9bd('0x44')];_0x1a9d0c+=0x1){_0x396154=_0x4f35c4[_0x1a9d0c];if(_[_0xe9bd('0x45')](_0x3b0190[_0xe9bd('0x20')][_0x396154['id']])){_0x3b0190[_0xe9bd('0x20')][_0x396154['id']]=new VtigerAccount(_0x396154);}else{_0x3b0190[_0xe9bd('0x41')](_0x3b0190[_0xe9bd('0x20')][_0x396154['id']],_0x396154);}}}return _0x3b0190[_0xe9bd('0x20')];};};Realtime[_0xe9bd('0x40')]['initServicenowAccounts']=function(){var _0x3a12e9=this;return function(_0x9d0603){if(_0x9d0603){freeIsNotKey(_0x9d0603,_0x3a12e9['servicenowAccounts'],'id');for(var _0x2c2d78=0x0,_0xe82570={},_0x59b8be={};_0x2c2d78<_0x9d0603['length'];_0x2c2d78+=0x1){_0xe82570=_0x9d0603[_0x2c2d78];if(_[_0xe9bd('0x45')](_0x3a12e9[_0xe9bd('0x21')][_0xe82570['id']])){_0x3a12e9['servicenowAccounts'][_0xe82570['id']]=new ServicenowAccount(_0xe82570);}else{_0x3a12e9['mergeFromDatabase'](_0x3a12e9['servicenowAccounts'][_0xe82570['id']],_0xe82570);}}}return _0x3a12e9[_0xe9bd('0x21')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x4b5bfb=this;return function(_0x4bcf2b){if(_0x4bcf2b){freeIsNotKey(_0x4bcf2b,_0x4b5bfb[_0xe9bd('0x22')],'id');for(var _0x46da33=0x0,_0x2ed5f2={},_0x4947b0={};_0x46da33<_0x4bcf2b[_0xe9bd('0x44')];_0x46da33+=0x1){_0x2ed5f2=_0x4bcf2b[_0x46da33];if(_[_0xe9bd('0x45')](_0x4b5bfb[_0xe9bd('0x22')][_0x2ed5f2['id']])){_0x4b5bfb[_0xe9bd('0x22')][_0x2ed5f2['id']]=new Dynamics365Account(_0x2ed5f2);}else{_0x4b5bfb['mergeFromDatabase'](_0x4b5bfb[_0xe9bd('0x22')][_0x2ed5f2['id']],_0x2ed5f2);}}}return _0x4b5bfb[_0xe9bd('0x22')];};};Realtime[_0xe9bd('0x40')]['initFreshsalesAccounts']=function(){var _0x5248fd=this;return function(_0x3e68fb){if(_0x3e68fb){freeIsNotKey(_0x3e68fb,_0x5248fd[_0xe9bd('0x23')],'id');for(var _0x1f41fc=0x0,_0x40d9e0={},_0x5bea46={};_0x1f41fc<_0x3e68fb[_0xe9bd('0x44')];_0x1f41fc+=0x1){_0x40d9e0=_0x3e68fb[_0x1f41fc];if(_[_0xe9bd('0x45')](_0x5248fd[_0xe9bd('0x23')][_0x40d9e0['id']])){_0x5248fd['freshsalesAccounts'][_0x40d9e0['id']]=new FreshsalesAccount(_0x40d9e0);}else{_0x5248fd[_0xe9bd('0x41')](_0x5248fd[_0xe9bd('0x23')][_0x40d9e0['id']],_0x40d9e0);}}}return _0x5248fd[_0xe9bd('0x23')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x53')]=function(){var _0x5d7257=this;return function(_0xa13d16){for(var _0x52930c=0x0;_0x52930c<_0xa13d16['length'];_0x52930c+=0x1){_[_0xe9bd('0x54')](_0x5d7257[_0xe9bd('0x14')][_0xa13d16[_0x52930c]['name']],_0xa13d16[_0x52930c]);}return _0x5d7257[_0xe9bd('0x14')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x55')]=function(){var _0x292faf=this;return function(_0x582cf3){clearVoiceQueues(_0x292faf[_0xe9bd('0x14')]);if(_0x582cf3){_0x582cf3=_[_0xe9bd('0x56')](_0x582cf3,'uniqueid');for(var _0x2a014e in _0x582cf3){if(_0x582cf3[_0xe9bd('0x25')](_0x2a014e)){var _0x3ec3e0={};for(var _0x22fd20=0x0;_0x22fd20<_0x582cf3[_0x2a014e][_0xe9bd('0x44')];_0x22fd20+=0x1){var _0x1a36aa=_0x582cf3[_0x2a014e][_0x22fd20][_0xe9bd('0x57')];if(_0x292faf['voiceQueues'][_0x1a36aa]){if(_0x582cf3[_0x2a014e][_0x22fd20][_0xe9bd('0x58')]){_0x292faf[_0xe9bd('0x14')][_0x1a36aa][_0xe9bd('0x34')]+=0x1;}if(_0x582cf3[_0x2a014e][_0x22fd20][_0xe9bd('0x59')]){_0x292faf[_0xe9bd('0x14')][_0x1a36aa][_0xe9bd('0x5a')]+=0x1;}_0x292faf[_0xe9bd('0x14')][_0x1a36aa][_0xe9bd('0x2e')]+=moment(_0x582cf3[_0x2a014e][_0x22fd20][_0xe9bd('0x5b')])['diff'](moment(_0x582cf3[_0x2a014e][_0x22fd20][_0xe9bd('0x5c')]),_0xe9bd('0x5d'))||0x0;if(_0x22fd20===_0x582cf3[_0x2a014e][_0xe9bd('0x44')]-0x1){_0x292faf[_0xe9bd('0x14')][_0x1a36aa][_0xe9bd('0x2f')]+=moment(_0x582cf3[_0x2a014e][_0x22fd20][_0xe9bd('0x5e')]||_0x582cf3[_0x2a014e][_0x22fd20][_0xe9bd('0x5f')]||_0x582cf3[_0x2a014e][_0x22fd20]['queuecallerexitAt'])[_0xe9bd('0x60')](moment(_0x582cf3[_0x2a014e][_0x22fd20][_0xe9bd('0x5c')]),'seconds')||0x0;_0x292faf[_0xe9bd('0x14')][_0x1a36aa][_0xe9bd('0x2c')]+=0x1;if(_0x582cf3[_0x2a014e][_0x22fd20][_0xe9bd('0x61')]){_0x292faf[_0xe9bd('0x14')][_0x1a36aa][_0xe9bd('0x2d')]+=0x1;_0x292faf[_0xe9bd('0x14')][_0x1a36aa][_0xe9bd('0x30')]+=moment(_0x582cf3[_0x2a014e][_0x22fd20]['queuecallercompleteAt'])['diff'](moment(_0x582cf3[_0x2a014e][_0x22fd20][_0xe9bd('0x5b')]),_0xe9bd('0x5d'))||0x0;}}else{_0x292faf[_0xe9bd('0x14')][_0x1a36aa][_0xe9bd('0x2f')]+=_0x292faf[_0xe9bd('0x14')][_0x1a36aa][_0xe9bd('0x2e')]||0x0;}}}}}}return _0x292faf[_0xe9bd('0x14')];};};Realtime['prototype'][_0xe9bd('0x62')]=function(){var _0x44f47e=this;return function(_0x29833b){clearVoiceCallReports(_0x44f47e[_0xe9bd('0x17')]);if(_0x29833b){for(var _0x14cdd5=0x0;_0x14cdd5<_0x29833b[_0xe9bd('0x44')];_0x14cdd5+=0x1){_0x44f47e[_0xe9bd('0x17')]['total']+=0x1;_0x44f47e['outbound']['sumDuration']+=_0x29833b[_0x14cdd5][_0xe9bd('0x63')];if(_0x29833b[_0x14cdd5]['disposition']==='ANSWERED'){_0x44f47e['outbound'][_0xe9bd('0x2d')]+=0x1;_0x44f47e[_0xe9bd('0x17')][_0xe9bd('0x2e')]+=_0x29833b[_0x14cdd5][_0xe9bd('0x63')]-_0x29833b[_0x14cdd5][_0xe9bd('0x64')]||0x0;_0x44f47e[_0xe9bd('0x17')][_0xe9bd('0x30')]+=_0x29833b[_0x14cdd5][_0xe9bd('0x64')];}}}return _0x44f47e[_0xe9bd('0x17')];};};Realtime['prototype'][_0xe9bd('0x65')]=function(){var _0x4b79f1=this;return function(_0x22cc79){if(_0x22cc79){freeIsNotKey(_0x22cc79,_0x4b79f1[_0xe9bd('0x66')],_0xe9bd('0x29'));for(var _0x6fff03=0x0,_0x416938={};_0x6fff03<_0x22cc79['length'];_0x6fff03+=0x1){_0x416938=_0x22cc79[_0x6fff03];if(_['isUndefined'](_0x4b79f1['campaigns'][_0x416938[_0xe9bd('0x29')]])){_0x4b79f1[_0xe9bd('0x66')][_0x416938['name']]=new Campaign(_0x416938);}else{_0x4b79f1[_0xe9bd('0x41')](_0x4b79f1[_0xe9bd('0x66')][_0x416938[_0xe9bd('0x29')]],_0x416938);_0x4b79f1[_0xe9bd('0x66')][_0x416938[_0xe9bd('0x29')]]['dialQueueProject']=_0x416938[_0xe9bd('0x67')]?_0x416938[_0xe9bd('0x67')][_0xe9bd('0x29')]:undefined;}}}return _0x4b79f1[_0xe9bd('0x66')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x68')]=function(){var _0x4659f3=this;return function(_0x1ad344){if(_0x1ad344){freeIsNotKey(_0x1ad344,_0x4659f3[_0xe9bd('0x18')],'id');for(var _0x440b2d=0x0,_0x5f24c8={};_0x440b2d<_0x1ad344['length'];_0x440b2d+=0x1){_0x5f24c8=_0x1ad344[_0x440b2d];if(_['isUndefined'](_0x4659f3['voiceExtensions'][_0x5f24c8['id']])){_0x4659f3[_0xe9bd('0x18')][_0x5f24c8['id']]=new VoiceExtension(_0x5f24c8);}else{_0x4659f3[_0xe9bd('0x41')](_0x4659f3[_0xe9bd('0x18')][_0x5f24c8['id']],_0x5f24c8);}}}return _0x4659f3['voiceExtensions'];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x69')]=function(){var _0x5040a7=this;return function(_0x55b5a5){clearCampaigns(_0x5040a7[_0xe9bd('0x66')]);for(var _0x1250e4=0x0;_0x1250e4<_0x55b5a5[_0xe9bd('0x44')];_0x1250e4+=0x1){_[_0xe9bd('0x54')](_0x5040a7[_0xe9bd('0x66')][_0x55b5a5[_0x1250e4]['name']],_0x55b5a5[_0x1250e4]);}return _0x5040a7['campaigns'];};};Realtime['prototype'][_0xe9bd('0x6a')]=function(){var _0x2c7a14=this;return function(_0x448f82){if(_0x448f82){freeIsNotKey(_0x448f82,_0x2c7a14[_0xe9bd('0x24')],'id');for(var _0x1880e7=0x0,_0x351226={},_0x475cb9={};_0x1880e7<_0x448f82[_0xe9bd('0x44')];_0x1880e7+=0x1){_0x351226=_0x448f82[_0x1880e7];if(_[_0xe9bd('0x45')](_0x2c7a14[_0xe9bd('0x24')][_0x351226['id']])){_0x2c7a14['faxAccounts'][_0x351226['id']]=new FaxAccount(_0x351226);}else{_0x2c7a14[_0xe9bd('0x41')](_0x2c7a14['faxAccounts'][_0x351226['id']],_0x351226);}}}return _0x2c7a14[_0xe9bd('0x24')];};};module['exports']=Realtime; \ No newline at end of file +var _0x425d=['length','isUndefined','initTrunks','initTriggers','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','uniqueid','queue','queuecallerabandon','diff','seconds','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','faxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','hasOwnProperty','format','name','mapKeys','isNil','interface','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents'];(function(_0x1d78de,_0x2dbab0){var _0x4af54e=function(_0x577a58){while(--_0x577a58){_0x1d78de['push'](_0x1d78de['shift']());}};_0x4af54e(++_0x2dbab0);}(_0x425d,0x1e0));var _0xd425=function(_0x53e2a2,_0x38f753){_0x53e2a2=_0x53e2a2-0x0;var _0x4dcf45=_0x425d[_0x53e2a2];return _0x4dcf45;};'use strict';var BPromise=require(_0xd425('0x0'));var util=require('util');var _=require(_0xd425('0x1'));var moment=require(_0xd425('0x2'));var Agent=require(_0xd425('0x3'));var Telephone=require(_0xd425('0x4'));var Trunk=require(_0xd425('0x5'));var VoiceQueue=require(_0xd425('0x6'));var Trigger=require(_0xd425('0x7'));var Template=require('../model/template');var Campaign=require(_0xd425('0x8'));var VoiceExtension=require(_0xd425('0x9'));var ZendeskAccount=require(_0xd425('0xa'));var SalesforceAccount=require(_0xd425('0xb'));var FreshdeskAccount=require(_0xd425('0xc'));var SugarcrmAccount=require(_0xd425('0xd'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xd425('0xe'));var VtigerAccount=require(_0xd425('0xf'));var ServicenowAccount=require(_0xd425('0x10'));var Dynamics365Account=require(_0xd425('0x11'));var FreshsalesAccount=require(_0xd425('0x12'));var FaxAccount=require(_0xd425('0x13'));var Realtime=function(){this[_0xd425('0x14')]={};this[_0xd425('0x15')]={};this[_0xd425('0x16')]={};this[_0xd425('0x17')]={};this[_0xd425('0x18')]={};this[_0xd425('0x19')]={};this[_0xd425('0x1a')]={};this[_0xd425('0x1b')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xd425('0x1c')]={};this[_0xd425('0x1d')]={};this[_0xd425('0x1e')]={};this[_0xd425('0x1f')]={};this[_0xd425('0x20')]={};this[_0xd425('0x21')]={};this['zendeskAccounts']={};this[_0xd425('0x22')]={};this[_0xd425('0x23')]={};this[_0xd425('0x24')]={};this['zohoAccounts']={};this[_0xd425('0x25')]={};this[_0xd425('0x26')]={};this[_0xd425('0x27')]={};this[_0xd425('0x28')]={};this[_0xd425('0x29')]={};this['faxAccounts']={};};function freeIsNotKey(_0x278626,_0x471267,_0x7e267e){var _0x5dda0c=_['mapKeys'](_0x278626,function(_0x19d7d4,_0x434d97){return _0x19d7d4[_0x7e267e];});for(var _0x467a6c in _0x471267){if(_0x471267[_0xd425('0x2a')](_0x467a6c)){if(!_0x5dda0c[_0x467a6c]){delete _0x471267[_0x467a6c];}}}}function freeIsNotKeySip(_0x4e88fa,_0x58a0c1){var _0x5debc3=_['mapKeys'](_0x4e88fa,function(_0x427304,_0xb92870){return util[_0xd425('0x2b')]('SIP/%s',_0x427304[_0xd425('0x2c')]);});for(var _0x7e982e in _0x58a0c1){if(_0x58a0c1['hasOwnProperty'](_0x7e982e)){if(!_0x5debc3[_0x7e982e]){delete _0x58a0c1[_0x7e982e];}}}}function freeIsNotKeyAgent(_0x2e1ec4,_0xf2d0ce){var _0x249a2b=_[_0xd425('0x2d')](_0x2e1ec4,function(_0x3e93db,_0xb240c4){var _0x2480a0=_[_0xd425('0x2e')](_0x3e93db[_0xd425('0x2f')])?util[_0xd425('0x2b')](_0xd425('0x30'),_0x3e93db[_0xd425('0x2c')]):_0x3e93db['interface'];return _0x2480a0;});for(var _0x369b5b in _0xf2d0ce){if(_0xf2d0ce[_0xd425('0x2a')](_0x369b5b)){if(!_0x249a2b[_0x369b5b]){delete _0xf2d0ce[_0x369b5b];}}}}function clearVoiceCallReports(_0x398985){_0x398985[_0xd425('0x31')]=0x0;_0x398985[_0xd425('0x32')]=0x0;_0x398985[_0xd425('0x33')]=0x0;_0x398985[_0xd425('0x34')]=0x0;_0x398985['sumBillable']=0x0;}function clearCampaigns(_0x12f951){if(!_[_0xd425('0x35')](_0x12f951)){for(var _0x1d8861 in _0x12f951){if(_0x12f951['hasOwnProperty'](_0x1d8861)){_0x12f951[_0x1d8861][_0xd425('0x36')]=0x0;_0x12f951[_0x1d8861][_0xd425('0x37')]=0x0;}}}}function clearVoiceQueues(_0x433189){if(!_[_0xd425('0x35')](_0x433189)){for(var _0x27d29a in _0x433189){if(_0x433189[_0xd425('0x2a')](_0x27d29a)){_0x433189[_0x27d29a][_0xd425('0x31')]=0x0;_0x433189[_0x27d29a][_0xd425('0x32')]=0x0;_0x433189[_0x27d29a][_0xd425('0x38')]=0x0;_0x433189[_0x27d29a][_0xd425('0x39')]=0x0;_0x433189[_0x27d29a]['sumHoldTime']=0x0;_0x433189[_0x27d29a][_0xd425('0x34')]=0x0;_0x433189[_0x27d29a][_0xd425('0x3a')]=0x0;_0x433189[_0x27d29a][_0xd425('0x3b')]=0x0;_0x433189[_0x27d29a][_0xd425('0x3c')]=0x0;_0x433189[_0x27d29a][_0xd425('0x3d')]=0x0;_0x433189[_0x27d29a][_0xd425('0x3e')]=0x0;_0x433189[_0x27d29a][_0xd425('0x3f')]=0x0;_0x433189[_0x27d29a][_0xd425('0x40')]=0x0;_0x433189[_0x27d29a][_0xd425('0x41')]=0x0;_0x433189[_0x27d29a][_0xd425('0x42')]=0x0;_0x433189[_0x27d29a][_0xd425('0x43')]=0x0;_0x433189[_0x27d29a]['outboundOriginateFailureCallsDay']=0x0;_0x433189[_0x27d29a][_0xd425('0x44')]=0x0;_0x433189[_0x27d29a][_0xd425('0x45')]=0x0;_0x433189[_0x27d29a][_0xd425('0x3b')]=0x0;_0x433189[_0x27d29a][_0xd425('0x46')]=0x0;_0x433189[_0x27d29a][_0xd425('0x47')]=!![];}}}}Realtime['prototype'][_0xd425('0x48')]=function(_0x3badcc,_0x4cfcd1){for(var _0x574962 in _0x4cfcd1){if(_0x3badcc['hasOwnProperty'](_0x574962)){_0x3badcc[_0x574962]=_0x4cfcd1[_0x574962];}}};Realtime[_0xd425('0x49')][_0xd425('0x4a')]=function(){var _0x167179=this;return function(_0x2d586f){if(_0x2d586f){freeIsNotKeyAgent(_0x2d586f,_0x167179['agents']);for(var _0x42b974=0x0,_0x1d4414={},_0x30a9dc={};_0x42b974<_0x2d586f[_0xd425('0x4b')];_0x42b974+=0x1){_0x1d4414=_0x2d586f[_0x42b974];var _0x27b9e2=_[_0xd425('0x2e')](_0x1d4414[_0xd425('0x2f')])?util['format'](_0xd425('0x30'),_0x1d4414['name']):_0x1d4414[_0xd425('0x2f')];if(_[_0xd425('0x4c')](_0x167179[_0xd425('0x14')][_0x27b9e2])){_0x167179['agents'][_0x27b9e2]=new Agent(_0x1d4414);}else{_0x167179[_0xd425('0x48')](_0x167179[_0xd425('0x14')][_0x27b9e2],_0x1d4414);}}}return _0x167179[_0xd425('0x14')];};};Realtime[_0xd425('0x49')]['initTelephones']=function(){var _0x1d38fa=this;return function(_0x3cf540){if(_0x3cf540){freeIsNotKeySip(_0x3cf540,_0x1d38fa['telephones']);for(var _0x5d310e=0x0,_0x48fc85={},_0xb2e9d4={};_0x5d310e<_0x3cf540[_0xd425('0x4b')];_0x5d310e+=0x1){_0x48fc85=_0x3cf540[_0x5d310e];if(_[_0xd425('0x4c')](_0x1d38fa['telephones'][util['format']('SIP/%s',_0x48fc85[_0xd425('0x2c')])])){_0x1d38fa[_0xd425('0x15')][util[_0xd425('0x2b')](_0xd425('0x30'),_0x48fc85[_0xd425('0x2c')])]=new Telephone(_0x48fc85);}else{_0x1d38fa[_0xd425('0x48')](_0x1d38fa[_0xd425('0x15')][util['format'](_0xd425('0x30'),_0x48fc85[_0xd425('0x2c')])],_0x48fc85);}}}return _0x1d38fa[_0xd425('0x15')];};};Realtime['prototype'][_0xd425('0x4d')]=function(){var _0x2dffc7=this;return function(_0x336a87){if(_0x336a87){freeIsNotKeySip(_0x336a87,_0x2dffc7['trunks']);for(var _0x2361f2=0x0,_0x12b970={},_0x1c5ba6={};_0x2361f2<_0x336a87[_0xd425('0x4b')];_0x2361f2+=0x1){_0x12b970=_0x336a87[_0x2361f2];if(_['isUndefined'](_0x2dffc7[_0xd425('0x16')][util[_0xd425('0x2b')](_0xd425('0x30'),_0x12b970[_0xd425('0x2c')])])){_0x2dffc7[_0xd425('0x16')][util[_0xd425('0x2b')](_0xd425('0x30'),_0x12b970['name'])]=new Trunk(_0x12b970);}else{_0x2dffc7[_0xd425('0x48')](_0x2dffc7[_0xd425('0x16')][util['format'](_0xd425('0x30'),_0x12b970['name'])],_0x12b970);}}}return _0x2dffc7['trunks'];};};Realtime[_0xd425('0x49')]['initVoiceQueues']=function(){var _0x1be60a=this;return function(_0x5ba626){if(_0x5ba626){freeIsNotKey(_0x5ba626,_0x1be60a[_0xd425('0x17')],_0xd425('0x2c'));for(var _0x22d017=0x0,_0x3516f3={},_0x4420d2={};_0x22d017<_0x5ba626['length'];_0x22d017+=0x1){_0x3516f3=_0x5ba626[_0x22d017];if(_[_0xd425('0x4c')](_0x1be60a['voiceQueues'][_0x3516f3[_0xd425('0x2c')]])){_0x1be60a['voiceQueues'][_0x3516f3[_0xd425('0x2c')]]=new VoiceQueue(_0x3516f3);}else{_0x1be60a[_0xd425('0x48')](_0x1be60a[_0xd425('0x17')][_0x3516f3[_0xd425('0x2c')]],_0x3516f3);}}}return _0x1be60a[_0xd425('0x17')];};};Realtime['prototype'][_0xd425('0x4e')]=function(){var _0x433777=this;return function(_0x35e77b){if(_0x35e77b){freeIsNotKey(_0x35e77b,_0x433777[_0xd425('0x18')],'id');for(var _0x258ff4=0x0,_0x499796={},_0x440dc5={};_0x258ff4<_0x35e77b[_0xd425('0x4b')];_0x258ff4+=0x1){_0x499796=_0x35e77b[_0x258ff4];if(_[_0xd425('0x4c')](_0x433777[_0xd425('0x18')][_0x499796['id']])){_0x433777[_0xd425('0x18')][_0x499796['id']]=new Trigger(_0x499796);}else{_0x433777[_0xd425('0x48')](_0x433777['triggers'][_0x499796['id']],_0x499796);}}}return _0x433777[_0xd425('0x18')];};};Realtime[_0xd425('0x49')]['initTemplates']=function(){var _0x3f305=this;return function(_0x42c084){if(_0x42c084){freeIsNotKey(_0x42c084,_0x3f305[_0xd425('0x1a')],'id');for(var _0x3c6538=0x0,_0x5c0219={},_0x54f1d={};_0x3c6538<_0x42c084[_0xd425('0x4b')];_0x3c6538+=0x1){_0x5c0219=_0x42c084[_0x3c6538];if(_[_0xd425('0x4c')](_0x3f305[_0xd425('0x1a')][_0x5c0219['id']])){_0x3f305[_0xd425('0x1a')][_0x5c0219['id']]=new Template(_0x5c0219);}else{_0x3f305['mergeFromDatabase'](_0x3f305['templates'][_0x5c0219['id']],_0x5c0219);}}}return _0x3f305[_0xd425('0x1a')];};};Realtime['prototype'][_0xd425('0x4f')]=function(){var _0x1072bf=this;return function(_0x5594f9){if(_0x5594f9){freeIsNotKey(_0x5594f9,_0x1072bf[_0xd425('0x50')],'id');for(var _0x572711=0x0,_0x48d5b8={},_0x39f588={};_0x572711<_0x5594f9[_0xd425('0x4b')];_0x572711+=0x1){_0x48d5b8=_0x5594f9[_0x572711];if(_[_0xd425('0x4c')](_0x1072bf[_0xd425('0x50')][_0x48d5b8['id']])){_0x1072bf[_0xd425('0x50')][_0x48d5b8['id']]=new ZendeskAccount(_0x48d5b8);}else{_0x1072bf[_0xd425('0x48')](_0x1072bf[_0xd425('0x50')][_0x48d5b8['id']],_0x48d5b8);}}}return _0x1072bf[_0xd425('0x50')];};};Realtime['prototype'][_0xd425('0x51')]=function(){var _0x1c6141=this;return function(_0x1be9bb){if(_0x1be9bb){freeIsNotKey(_0x1be9bb,_0x1c6141[_0xd425('0x22')],'id');for(var _0x7b1080=0x0,_0x1c80c2={},_0x3b6d6a={};_0x7b1080<_0x1be9bb[_0xd425('0x4b')];_0x7b1080+=0x1){_0x1c80c2=_0x1be9bb[_0x7b1080];if(_['isUndefined'](_0x1c6141['salesforceAccounts'][_0x1c80c2['id']])){_0x1c6141['salesforceAccounts'][_0x1c80c2['id']]=new SalesforceAccount(_0x1c80c2);}else{_0x1c6141[_0xd425('0x48')](_0x1c6141[_0xd425('0x22')][_0x1c80c2['id']],_0x1c80c2);}}}return _0x1c6141[_0xd425('0x22')];};};Realtime[_0xd425('0x49')]['initFreshdeskAccounts']=function(){var _0x4fedc0=this;return function(_0x499a60){if(_0x499a60){freeIsNotKey(_0x499a60,_0x4fedc0['freshdeskAccounts'],'id');for(var _0x254b8b=0x0,_0x44c5e4={},_0x5abb99={};_0x254b8b<_0x499a60[_0xd425('0x4b')];_0x254b8b+=0x1){_0x44c5e4=_0x499a60[_0x254b8b];if(_[_0xd425('0x4c')](_0x4fedc0[_0xd425('0x24')][_0x44c5e4['id']])){_0x4fedc0['freshdeskAccounts'][_0x44c5e4['id']]=new FreshdeskAccount(_0x44c5e4);}else{_0x4fedc0['mergeFromDatabase'](_0x4fedc0[_0xd425('0x24')][_0x44c5e4['id']],_0x44c5e4);}}}return _0x4fedc0['freshdeskAccounts'];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x4458bc=this;return function(_0x259482){if(_0x259482){freeIsNotKey(_0x259482,_0x4458bc[_0xd425('0x52')],'id');for(var _0x5b2323=0x0,_0x3395d8={},_0x48bd20={};_0x5b2323<_0x259482[_0xd425('0x4b')];_0x5b2323+=0x1){_0x3395d8=_0x259482[_0x5b2323];if(_[_0xd425('0x4c')](_0x4458bc[_0xd425('0x52')][_0x3395d8['id']])){_0x4458bc[_0xd425('0x52')][_0x3395d8['id']]=new ZohoAccount(_0x3395d8);}else{_0x4458bc[_0xd425('0x48')](_0x4458bc[_0xd425('0x52')][_0x3395d8['id']],_0x3395d8);}}}return _0x4458bc[_0xd425('0x52')];};};Realtime[_0xd425('0x49')][_0xd425('0x53')]=function(){var _0x574e1f=this;return function(_0x42e483){if(_0x42e483){freeIsNotKey(_0x42e483,_0x574e1f[_0xd425('0x25')],'id');for(var _0x18dc33=0x0,_0xf22906={},_0x5c4df8={};_0x18dc33<_0x42e483['length'];_0x18dc33+=0x1){_0xf22906=_0x42e483[_0x18dc33];if(_[_0xd425('0x4c')](_0x574e1f[_0xd425('0x25')][_0xf22906['id']])){_0x574e1f[_0xd425('0x25')][_0xf22906['id']]=new DeskAccount(_0xf22906);}else{_0x574e1f[_0xd425('0x48')](_0x574e1f[_0xd425('0x25')][_0xf22906['id']],_0xf22906);}}}return _0x574e1f[_0xd425('0x25')];};};Realtime[_0xd425('0x49')][_0xd425('0x54')]=function(){var _0x1fcde4=this;return function(_0x78bb46){if(_0x78bb46){freeIsNotKey(_0x78bb46,_0x1fcde4[_0xd425('0x23')],'id');for(var _0x470e6f=0x0,_0x3e0eea={},_0x28979e={};_0x470e6f<_0x78bb46['length'];_0x470e6f+=0x1){_0x3e0eea=_0x78bb46[_0x470e6f];if(_[_0xd425('0x4c')](_0x1fcde4[_0xd425('0x23')][_0x3e0eea['id']])){_0x1fcde4[_0xd425('0x23')][_0x3e0eea['id']]=new SugarcrmAccount(_0x3e0eea);}else{_0x1fcde4['mergeFromDatabase'](_0x1fcde4['sugarcrmAccounts'][_0x3e0eea['id']],_0x3e0eea);}}}return _0x1fcde4['sugarcrmAccounts'];};};Realtime[_0xd425('0x49')][_0xd425('0x55')]=function(){var _0x27c60e=this;return function(_0x50ba6c){if(_0x50ba6c){freeIsNotKey(_0x50ba6c,_0x27c60e[_0xd425('0x26')],'id');for(var _0x4c1878=0x0,_0x2811a4={},_0xdc942c={};_0x4c1878<_0x50ba6c[_0xd425('0x4b')];_0x4c1878+=0x1){_0x2811a4=_0x50ba6c[_0x4c1878];if(_['isUndefined'](_0x27c60e[_0xd425('0x26')][_0x2811a4['id']])){_0x27c60e[_0xd425('0x26')][_0x2811a4['id']]=new VtigerAccount(_0x2811a4);}else{_0x27c60e[_0xd425('0x48')](_0x27c60e[_0xd425('0x26')][_0x2811a4['id']],_0x2811a4);}}}return _0x27c60e[_0xd425('0x26')];};};Realtime[_0xd425('0x49')][_0xd425('0x56')]=function(){var _0x44db7f=this;return function(_0xcb1a64){if(_0xcb1a64){freeIsNotKey(_0xcb1a64,_0x44db7f[_0xd425('0x27')],'id');for(var _0x2ba77b=0x0,_0x474fcf={},_0xebfc5b={};_0x2ba77b<_0xcb1a64[_0xd425('0x4b')];_0x2ba77b+=0x1){_0x474fcf=_0xcb1a64[_0x2ba77b];if(_[_0xd425('0x4c')](_0x44db7f[_0xd425('0x27')][_0x474fcf['id']])){_0x44db7f[_0xd425('0x27')][_0x474fcf['id']]=new ServicenowAccount(_0x474fcf);}else{_0x44db7f[_0xd425('0x48')](_0x44db7f['servicenowAccounts'][_0x474fcf['id']],_0x474fcf);}}}return _0x44db7f['servicenowAccounts'];};};Realtime[_0xd425('0x49')]['initDynamics365Accounts']=function(){var _0x135048=this;return function(_0x1e1a3f){if(_0x1e1a3f){freeIsNotKey(_0x1e1a3f,_0x135048[_0xd425('0x28')],'id');for(var _0x1ae1e3=0x0,_0x4c7000={},_0x3187ca={};_0x1ae1e3<_0x1e1a3f[_0xd425('0x4b')];_0x1ae1e3+=0x1){_0x4c7000=_0x1e1a3f[_0x1ae1e3];if(_[_0xd425('0x4c')](_0x135048[_0xd425('0x28')][_0x4c7000['id']])){_0x135048[_0xd425('0x28')][_0x4c7000['id']]=new Dynamics365Account(_0x4c7000);}else{_0x135048[_0xd425('0x48')](_0x135048['dynamics365Accounts'][_0x4c7000['id']],_0x4c7000);}}}return _0x135048['dynamics365Accounts'];};};Realtime[_0xd425('0x49')][_0xd425('0x57')]=function(){var _0x5e76f5=this;return function(_0x174081){if(_0x174081){freeIsNotKey(_0x174081,_0x5e76f5['freshsalesAccounts'],'id');for(var _0x20f6ec=0x0,_0x46fd93={},_0x1fc5ca={};_0x20f6ec<_0x174081[_0xd425('0x4b')];_0x20f6ec+=0x1){_0x46fd93=_0x174081[_0x20f6ec];if(_[_0xd425('0x4c')](_0x5e76f5[_0xd425('0x29')][_0x46fd93['id']])){_0x5e76f5[_0xd425('0x29')][_0x46fd93['id']]=new FreshsalesAccount(_0x46fd93);}else{_0x5e76f5['mergeFromDatabase'](_0x5e76f5[_0xd425('0x29')][_0x46fd93['id']],_0x46fd93);}}}return _0x5e76f5[_0xd425('0x29')];};};Realtime[_0xd425('0x49')][_0xd425('0x58')]=function(){var _0xfcba08=this;return function(_0x59e1e9){for(var _0x1f2834=0x0;_0x1f2834<_0x59e1e9[_0xd425('0x4b')];_0x1f2834+=0x1){_['merge'](_0xfcba08[_0xd425('0x17')][_0x59e1e9[_0x1f2834][_0xd425('0x2c')]],_0x59e1e9[_0x1f2834]);}return _0xfcba08['voiceQueues'];};};Realtime[_0xd425('0x49')][_0xd425('0x59')]=function(){var _0x74d30b=this;return function(_0xd923bb){clearVoiceQueues(_0x74d30b[_0xd425('0x17')]);if(_0xd923bb){_0xd923bb=_['groupBy'](_0xd923bb,_0xd425('0x5a'));for(var _0x4e3462 in _0xd923bb){if(_0xd923bb[_0xd425('0x2a')](_0x4e3462)){var _0x38c5b7={};for(var _0x5a1a9e=0x0;_0x5a1a9e<_0xd923bb[_0x4e3462][_0xd425('0x4b')];_0x5a1a9e+=0x1){var _0xcf7b51=_0xd923bb[_0x4e3462][_0x5a1a9e][_0xd425('0x5b')];if(_0x74d30b[_0xd425('0x17')][_0xcf7b51]){if(_0xd923bb[_0x4e3462][_0x5a1a9e]['queuecallerexit']){_0x74d30b['voiceQueues'][_0xcf7b51][_0xd425('0x38')]+=0x1;}if(_0xd923bb[_0x4e3462][_0x5a1a9e][_0xd425('0x5c')]){_0x74d30b[_0xd425('0x17')][_0xcf7b51]['abandoned']+=0x1;}_0x74d30b[_0xd425('0x17')][_0xcf7b51][_0xd425('0x33')]+=moment(_0xd923bb[_0x4e3462][_0x5a1a9e]['queuecallerleaveAt'])[_0xd425('0x5d')](moment(_0xd923bb[_0x4e3462][_0x5a1a9e]['queuecallerjoinAt']),_0xd425('0x5e'))||0x0;if(_0x5a1a9e===_0xd923bb[_0x4e3462][_0xd425('0x4b')]-0x1){_0x74d30b[_0xd425('0x17')][_0xcf7b51][_0xd425('0x34')]+=moment(_0xd923bb[_0x4e3462][_0x5a1a9e]['queuecallercompleteAt']||_0xd923bb[_0x4e3462][_0x5a1a9e]['queuecallerabandonAt']||_0xd923bb[_0x4e3462][_0x5a1a9e][_0xd425('0x5f')])[_0xd425('0x5d')](moment(_0xd923bb[_0x4e3462][_0x5a1a9e]['queuecallerjoinAt']),_0xd425('0x5e'))||0x0;_0x74d30b[_0xd425('0x17')][_0xcf7b51]['total']+=0x1;if(_0xd923bb[_0x4e3462][_0x5a1a9e][_0xd425('0x60')]){_0x74d30b[_0xd425('0x17')][_0xcf7b51][_0xd425('0x32')]+=0x1;_0x74d30b[_0xd425('0x17')][_0xcf7b51][_0xd425('0x3a')]+=moment(_0xd923bb[_0x4e3462][_0x5a1a9e][_0xd425('0x61')])[_0xd425('0x5d')](moment(_0xd923bb[_0x4e3462][_0x5a1a9e]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x74d30b[_0xd425('0x17')][_0xcf7b51]['sumDuration']+=_0x74d30b[_0xd425('0x17')][_0xcf7b51][_0xd425('0x33')]||0x0;}}}}}}return _0x74d30b['voiceQueues'];};};Realtime[_0xd425('0x49')][_0xd425('0x62')]=function(){var _0x5dac05=this;return function(_0x592c40){clearVoiceCallReports(_0x5dac05[_0xd425('0x1b')]);if(_0x592c40){for(var _0x242ed8=0x0;_0x242ed8<_0x592c40[_0xd425('0x4b')];_0x242ed8+=0x1){_0x5dac05[_0xd425('0x1b')][_0xd425('0x31')]+=0x1;_0x5dac05[_0xd425('0x1b')][_0xd425('0x34')]+=_0x592c40[_0x242ed8][_0xd425('0x63')];if(_0x592c40[_0x242ed8]['disposition']===_0xd425('0x64')){_0x5dac05[_0xd425('0x1b')]['answered']+=0x1;_0x5dac05[_0xd425('0x1b')][_0xd425('0x33')]+=_0x592c40[_0x242ed8][_0xd425('0x63')]-_0x592c40[_0x242ed8][_0xd425('0x65')]||0x0;_0x5dac05[_0xd425('0x1b')][_0xd425('0x3a')]+=_0x592c40[_0x242ed8][_0xd425('0x65')];}}}return _0x5dac05[_0xd425('0x1b')];};};Realtime[_0xd425('0x49')][_0xd425('0x66')]=function(){var _0x14cebc=this;return function(_0x572452){if(_0x572452){freeIsNotKey(_0x572452,_0x14cebc[_0xd425('0x19')],'name');for(var _0x4d3493=0x0,_0x2c8d63={};_0x4d3493<_0x572452['length'];_0x4d3493+=0x1){_0x2c8d63=_0x572452[_0x4d3493];if(_[_0xd425('0x4c')](_0x14cebc[_0xd425('0x19')][_0x2c8d63[_0xd425('0x2c')]])){_0x14cebc[_0xd425('0x19')][_0x2c8d63[_0xd425('0x2c')]]=new Campaign(_0x2c8d63);}else{_0x14cebc[_0xd425('0x48')](_0x14cebc[_0xd425('0x19')][_0x2c8d63['name']],_0x2c8d63);_0x14cebc[_0xd425('0x19')][_0x2c8d63[_0xd425('0x2c')]][_0xd425('0x67')]=_0x2c8d63[_0xd425('0x68')]?_0x2c8d63[_0xd425('0x68')]['name']:undefined;}}}return _0x14cebc[_0xd425('0x19')];};};Realtime[_0xd425('0x49')][_0xd425('0x69')]=function(){var _0x364f59=this;return function(_0x1a5f86){if(_0x1a5f86){freeIsNotKey(_0x1a5f86,_0x364f59[_0xd425('0x1c')],'id');for(var _0x409612=0x0,_0x4147eb={};_0x409612<_0x1a5f86[_0xd425('0x4b')];_0x409612+=0x1){_0x4147eb=_0x1a5f86[_0x409612];if(_[_0xd425('0x4c')](_0x364f59[_0xd425('0x1c')][_0x4147eb['id']])){_0x364f59[_0xd425('0x1c')][_0x4147eb['id']]=new VoiceExtension(_0x4147eb);}else{_0x364f59['mergeFromDatabase'](_0x364f59[_0xd425('0x1c')][_0x4147eb['id']],_0x4147eb);}}}return _0x364f59['voiceExtensions'];};};Realtime[_0xd425('0x49')][_0xd425('0x6a')]=function(){var _0x1c03d6=this;return function(_0x1e6930){clearCampaigns(_0x1c03d6[_0xd425('0x19')]);for(var _0x4a0d53=0x0;_0x4a0d53<_0x1e6930[_0xd425('0x4b')];_0x4a0d53+=0x1){_[_0xd425('0x6b')](_0x1c03d6[_0xd425('0x19')][_0x1e6930[_0x4a0d53][_0xd425('0x2c')]],_0x1e6930[_0x4a0d53]);}return _0x1c03d6[_0xd425('0x19')];};};Realtime[_0xd425('0x49')][_0xd425('0x6c')]=function(){var _0x568a83=this;return function(_0x25ed6c){if(_0x25ed6c){freeIsNotKey(_0x25ed6c,_0x568a83['faxAccounts'],'id');for(var _0x168f8b=0x0,_0x905e5d={},_0x4a43a7={};_0x168f8b<_0x25ed6c[_0xd425('0x4b')];_0x168f8b+=0x1){_0x905e5d=_0x25ed6c[_0x168f8b];if(_[_0xd425('0x4c')](_0x568a83['faxAccounts'][_0x905e5d['id']])){_0x568a83[_0xd425('0x6d')][_0x905e5d['id']]=new FaxAccount(_0x905e5d);}else{_0x568a83[_0xd425('0x48')](_0x568a83[_0xd425('0x6d')][_0x905e5d['id']],_0x905e5d);}}}return _0x568a83[_0xd425('0x6d')];};};module[_0xd425('0x6e')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index debf48d..6786468 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 _0xcb75=['lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','destination','exten','type','lastapplication','queue','lastdata','context','callerid','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','membername','xcally-motion-dialer','isArray','startsWith','Local','indexOf','mobile','phone','substring','lastIndexOf','voiceDialReport','transfererlinkedid','attendedTransfer','exports','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','xdr','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','blindtransfer','blindTransfer','attendedtransfer','prototype','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned'];(function(_0x5cb4f0,_0xb16665){var _0x22208=function(_0xa6ac92){while(--_0xa6ac92){_0x5cb4f0['push'](_0x5cb4f0['shift']());}};_0x22208(++_0xb16665);}(_0xcb75,0x136));var _0x5cb7=function(_0x2359da,_0x413c44){_0x2359da=_0x2359da-0x0;var _0x5c3381=_0xcb75[_0x2359da];return _0x5c3381;};'use strict';var _=require('lodash');var moment=require(_0x5cb7('0x0'));var util=require(_0x5cb7('0x1'));var config=require(_0x5cb7('0x2'));var ami=require(_0x5cb7('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x5cb7('0x4'));var RpcVoiceDialReport=require(_0x5cb7('0x5'));var RpcMemberReport=require(_0x5cb7('0x6'));var RpcVoiceQueueReport=require(_0x5cb7('0x7'));var RpcVoiceRecording=require(_0x5cb7('0x8'));var RpcVoiceTransferReport=require(_0x5cb7('0x9'));var VoiceQueueReport=require(_0x5cb7('0xa'));var VoiceCallReport=require(_0x5cb7('0xb'));var VoiceAgentReport=require(_0x5cb7('0xc'));var VoiceDialReport=require(_0x5cb7('0xd'));var UserReport=require('./userReport');function Report(_0x2cca7d){this[_0x5cb7('0xe')]=_0x2cca7d;this[_0x5cb7('0xf')]=_0x2cca7d['agents'];this[_0x5cb7('0x10')]=_0x2cca7d[_0x5cb7('0x10')];}Report['prototype']['sync']=function(_0x1f2d24){var _0x39d8d3=new VoiceQueueReport(this['realtime']);var _0x42ad38=new VoiceAgentReport(this['realtime']);var _0x4959ca=new VoiceDialReport(this[_0x5cb7('0xe')]);var _0x3e5858=new VoiceCallReport(this[_0x5cb7('0xe')]);var _0x31098c=new UserReport(this[_0x5cb7('0xe')]);if(config[_0x5cb7('0x11')]&&config[_0x5cb7('0x11')]['disabled']){ami['on'](_0x5cb7('0x12'),this[_0x5cb7('0x13')][_0x5cb7('0x14')](this));ami['on']('custom:voiceCallReport',this[_0x5cb7('0x15')][_0x5cb7('0x14')](this));ami['on'](_0x5cb7('0x16'),this['voiceAgentReport'][_0x5cb7('0x14')](this));ami['on']('custom:voiceDialReport',this['voiceDialReport'][_0x5cb7('0x14')](this));ami['on'](_0x5cb7('0x17'),this[_0x5cb7('0x18')][_0x5cb7('0x14')](this));ami['on'](_0x5cb7('0x19'),this['attendedTransfer'][_0x5cb7('0x14')](this));}};Report[_0x5cb7('0x1a')][_0x5cb7('0x1b')]=function(_0x155fd7){var _0x464daf;_0x464daf=_[_0x5cb7('0x1c')](this[_0x5cb7('0xf')],function(_0x5c718a){return _0x5c718a[_0x5cb7('0x1d')]==_0x155fd7||_0x5c718a[_0x5cb7('0x1e')]==_0x155fd7;});if(_[_0x5cb7('0x1f')](_0x464daf)){var _0x5967a9=_[_0x5cb7('0x1c')](this[_0x5cb7('0x10')],function(_0x327542){return _0x327542['accountcode']==_0x155fd7||_0x327542['name']==_0x155fd7;});if(_0x5967a9){_0x464daf=_[_0x5cb7('0x1c')](this[_0x5cb7('0xf')],function(_0x3a5f9f){return _0x3a5f9f[_0x5cb7('0x20')]==util[_0x5cb7('0x21')](_0x5cb7('0x22'),_0x5967a9['name']);});}}return _0x464daf;};Report[_0x5cb7('0x1a')][_0x5cb7('0x13')]=function(_0x2434c7){for(var _0x1a10f3=0x0;_0x1a10f3<_0x2434c7[_0x5cb7('0x23')];_0x1a10f3+=0x1){var _0x235f39=this[_0x5cb7('0x1b')](_0x2434c7[_0x1a10f3][_0x5cb7('0x24')]);if(_0x235f39){_0x2434c7[_0x1a10f3][_0x5cb7('0x1d')]=_0x235f39[_0x5cb7('0x1d')];_0x2434c7[_0x1a10f3][_0x5cb7('0x25')]=!![];_0x2434c7[_0x1a10f3][_0x5cb7('0x26')]=_0x235f39[_0x5cb7('0x1e')];_0x2434c7[_0x1a10f3][_0x5cb7('0x20')]=_[_0x5cb7('0x1f')](_0x235f39[_0x5cb7('0x20')])?util[_0x5cb7('0x21')]('SIP/%s',_0x235f39[_0x5cb7('0x1e')]):_0x235f39[_0x5cb7('0x20')];if(_0x2434c7[_0x1a10f3][_0x5cb7('0x27')]){_0x2434c7[_0x1a10f3][_0x5cb7('0x28')]=moment()[_0x5cb7('0x21')](_0x5cb7('0x29'));}if(_0x2434c7[_0x1a10f3]['queuecallerexit']){_0x2434c7[_0x1a10f3][_0x5cb7('0x2a')]=moment()[_0x5cb7('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x5cb7('0x13')](_0x2434c7[_0x1a10f3]);}RpcVoiceQueueReport[_0x5cb7('0x2b')](_0x2434c7[_0x1a10f3]);}};function extractCalleridNumber(_0x5b1a55){var _0x48bc7c=_0x5b1a55[_0x5cb7('0x2c')](/<(.*?)>/);return _0x48bc7c?_0x48bc7c[0x1]:_0x5b1a55;}Report['prototype']['voiceCallReport']=function(_0x75234a){_0x75234a[_0x5cb7('0x2d')]=_0x75234a[_0x5cb7('0x2d')]||_0x75234a[_0x5cb7('0x2e')];if(_0x75234a[_0x5cb7('0x2f')]=='dialer'){_0x75234a[_0x5cb7('0x30')]=_0x5cb7('0x31');_0x75234a[_0x5cb7('0x32')]=_0x75234a[_0x5cb7('0x31')];if(_0x75234a[_0x5cb7('0x33')]=='from-voip-provider'){_0x75234a['accountcode']='';_0x75234a[_0x5cb7('0x2d')]=extractCalleridNumber(_0x75234a[_0x5cb7('0x34')]);}else if(_0x75234a[_0x5cb7('0x33')]=='from-sip'){if(_0x75234a[_0x5cb7('0x2d')]==_0x5cb7('0x35')){_0x75234a[_0x5cb7('0x2d')]=extractCalleridNumber(_0x75234a[_0x5cb7('0x36')]);_0x75234a[_0x5cb7('0x37')]=_0x75234a[_0x5cb7('0x38')];_0x75234a[_0x5cb7('0x39')]=[_0x75234a['channel'],_0x75234a[_0x5cb7('0x3a')]=_0x75234a[_0x5cb7('0x39')]][0x0];_0x75234a['callerid']=_0x75234a[_0x5cb7('0x36')];}else{_0x75234a[_0x5cb7('0x2d')]=_0x75234a[_0x5cb7('0x37')];_0x75234a['calleridnum']=_0x75234a[_0x5cb7('0x38')];if(_0x75234a[_0x5cb7('0x3b')]==_0x5cb7('0x3c')){_0x75234a[_0x5cb7('0x1d')]=_0x75234a['connectedlinenum'];}else{_0x75234a[_0x5cb7('0x1d')]='';}}}}else{_0x75234a['callerid']=util['format'](_0x5cb7('0x3d'),_0x75234a['calleridname'],_0x75234a[_0x5cb7('0x37')]);}if(RpcVoiceTransferReport[_0x5cb7('0x3e')][_0x75234a[_0x5cb7('0x3f')]]){var _0x44fe77=RpcVoiceTransferReport[_0x5cb7('0x3e')][_0x75234a[_0x5cb7('0x3f')]];_0x44fe77[_0x5cb7('0x40')]=_0x75234a[_0x5cb7('0x41')];RpcVoiceTransferReport[_0x5cb7('0x18')](_0x44fe77);delete RpcVoiceTransferReport[_0x5cb7('0x3e')][_0x75234a[_0x5cb7('0x3f')]];}RpcVoiceCallReport[_0x5cb7('0x2b')](_0x75234a);if(_0x75234a[_0x5cb7('0x42')]){for(var _0x4b765b=0x0;_0x4b765b<_0x75234a[_0x5cb7('0x43')][_0x5cb7('0x23')];_0x4b765b+=0x1){_0x75234a[_0x5cb7('0x44')]=_0x75234a[_0x5cb7('0x43')][_0x4b765b][_0x5cb7('0x45')];_0x75234a['createdAt']=_0x75234a[_0x5cb7('0x43')][_0x4b765b][_0x5cb7('0x46')];if(_0x75234a[_0x5cb7('0x2e')]=='xcally-motion-preview'){_0x75234a[_0x5cb7('0x37')]=_0x75234a[_0x5cb7('0x24')];_0x75234a[_0x5cb7('0x47')]=_0x75234a[_0x5cb7('0x48')];_0x75234a['connectedlinenum']=_0x75234a[_0x5cb7('0x1d')];_0x75234a['connectedlinename']=_0x75234a[_0x5cb7('0x49')];_0x75234a[_0x5cb7('0x2e')]=_0x75234a[_0x5cb7('0x38')];}else if(_0x75234a['exten']==_0x5cb7('0x4a')){_0x75234a[_0x5cb7('0x37')]=_0x75234a[_0x5cb7('0x2d')];_0x75234a[_0x5cb7('0x2e')]=_0x75234a[_0x5cb7('0x38')];}RpcVoiceRecording[_0x5cb7('0x2b')](_0x75234a);}}};Report['prototype']['voiceAgentReport']=function(_0x3ac9ac){if(_[_0x5cb7('0x4b')](_0x3ac9ac)){_0x3ac9ac['forEach'](function(_0x3b4a45){RpcVoiceAgentReport[_0x5cb7('0x2b')](_0x3b4a45);});}else{RpcVoiceAgentReport[_0x5cb7('0x2b')](_0x3ac9ac);}};Report[_0x5cb7('0x1a')]['voiceDialReport']=function(_0x2421eb){RpcVoiceDialReport[_0x5cb7('0x2b')](_0x2421eb);var _0x29775b;var _0x48e358;var _0x1677ce=_0x2421eb[_0x5cb7('0x3a')];if(_[_0x5cb7('0x4c')](_0x1677ce,_0x5cb7('0x4d'))){_0x48e358=_0x1677ce['substring'](_0x1677ce[_0x5cb7('0x4e')]('/')+0x1,_0x1677ce['indexOf']('@'));_0x29775b=_['find'](this['agents'],function(_0x13b110){return _0x13b110[_0x5cb7('0x4f')]==_0x48e358||_0x13b110[_0x5cb7('0x50')]==_0x48e358||_0x13b110[_0x5cb7('0x1d')]==_0x48e358;});}else{_0x48e358=_0x1677ce[_0x5cb7('0x51')](_0x1677ce[_0x5cb7('0x4e')]('/')+0x1,_0x1677ce[_0x5cb7('0x52')]('-'));_0x29775b=this[_0x5cb7('0x1b')](_0x48e358);}if(_0x29775b){_0x2421eb[_0x5cb7('0x20')]=_[_0x5cb7('0x1f')](_0x29775b[_0x5cb7('0x20')])?util[_0x5cb7('0x21')](_0x5cb7('0x22'),_0x29775b['name']):_0x29775b[_0x5cb7('0x20')];_0x2421eb[_0x5cb7('0x49')]=_0x29775b[_0x5cb7('0x1e')];_0x2421eb[_0x5cb7('0x1d')]=_0x29775b['accountcode'];RpcMemberReport[_0x5cb7('0x53')](_0x2421eb);}};Report['prototype'][_0x5cb7('0x18')]=function(_0x33fd42){RpcVoiceTransferReport['transfers'][_0x33fd42[_0x5cb7('0x54')]]=_0x33fd42;};Report[_0x5cb7('0x1a')][_0x5cb7('0x55')]=function(_0x563d9a){RpcVoiceTransferReport[_0x5cb7('0x55')](_0x563d9a);};module[_0x5cb7('0x56')]=Report; \ No newline at end of file +var _0x28c2=['interface','format','SIP/%s','length','assigned','lastAssignedTo','isNil','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','destination','exten','type','dialer','lastapplication','queue','lastdata','from-voip-provider','context','from-sip','xcally-motion-preview','calleridnum','destinationchannel','channel','callerid','originatecalleridnum','disposition','ANSWERED','connectedlinenum','calleridname','linkedid','transfereelinkedid','uniqueid','create','monitor','monitors','filename','createdAt','connectedlinename','membername','isArray','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','blindTransfer','transfers','transfererlinkedid','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','attendedTransfer','findAgent','find','accountcode','name'];(function(_0xc36844,_0x41d978){var _0x592e3a=function(_0x4b3add){while(--_0x4b3add){_0xc36844['push'](_0xc36844['shift']());}};_0x592e3a(++_0x41d978);}(_0x28c2,0x8b));var _0x228c=function(_0x1e575c,_0x555cc1){_0x1e575c=_0x1e575c-0x0;var _0x5b26d0=_0x28c2[_0x1e575c];return _0x5b26d0;};'use strict';var _=require(_0x228c('0x0'));var moment=require(_0x228c('0x1'));var util=require(_0x228c('0x2'));var config=require(_0x228c('0x3'));var ami=require(_0x228c('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x228c('0x5'));var RpcVoiceDialReport=require(_0x228c('0x6'));var RpcMemberReport=require(_0x228c('0x7'));var RpcVoiceQueueReport=require(_0x228c('0x8'));var RpcVoiceRecording=require(_0x228c('0x9'));var RpcVoiceTransferReport=require(_0x228c('0xa'));var VoiceQueueReport=require(_0x228c('0xb'));var VoiceCallReport=require(_0x228c('0xc'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x228c('0xd'));function Report(_0x2bd71b){this[_0x228c('0xe')]=_0x2bd71b;this[_0x228c('0xf')]=_0x2bd71b[_0x228c('0xf')];this[_0x228c('0x10')]=_0x2bd71b[_0x228c('0x10')];}Report[_0x228c('0x11')][_0x228c('0x12')]=function(_0x187137){var _0x54b88d=new VoiceQueueReport(this['realtime']);var _0x3fc9b2=new VoiceAgentReport(this['realtime']);var _0x338be0=new VoiceDialReport(this[_0x228c('0xe')]);var _0x55bff7=new VoiceCallReport(this[_0x228c('0xe')]);var _0x3ee7ff=new UserReport(this['realtime']);if(config[_0x228c('0x13')]&&config[_0x228c('0x13')]['disabled']){ami['on'](_0x228c('0x14'),this[_0x228c('0x15')][_0x228c('0x16')](this));ami['on']('custom:voiceCallReport',this[_0x228c('0x17')][_0x228c('0x16')](this));ami['on'](_0x228c('0x18'),this[_0x228c('0x19')][_0x228c('0x16')](this));ami['on']('custom:voiceDialReport',this[_0x228c('0x1a')][_0x228c('0x16')](this));ami['on'](_0x228c('0x1b'),this['blindTransfer'][_0x228c('0x16')](this));ami['on']('attendedtransfer',this[_0x228c('0x1c')]['bind'](this));}};Report['prototype'][_0x228c('0x1d')]=function(_0x2eb00c){var _0x4d0f84;_0x4d0f84=_[_0x228c('0x1e')](this[_0x228c('0xf')],function(_0x288df1){return _0x288df1[_0x228c('0x1f')]==_0x2eb00c||_0x288df1[_0x228c('0x20')]==_0x2eb00c;});if(_['isNil'](_0x4d0f84)){var _0x4806f2=_[_0x228c('0x1e')](this[_0x228c('0x10')],function(_0x288163){return _0x288163[_0x228c('0x1f')]==_0x2eb00c||_0x288163[_0x228c('0x20')]==_0x2eb00c;});if(_0x4806f2){_0x4d0f84=_[_0x228c('0x1e')](this[_0x228c('0xf')],function(_0x1a0730){return _0x1a0730[_0x228c('0x21')]==util[_0x228c('0x22')](_0x228c('0x23'),_0x4806f2['name']);});}}return _0x4d0f84;};Report[_0x228c('0x11')]['voiceQueueReport']=function(_0x1140e1){for(var _0x42608c=0x0;_0x42608c<_0x1140e1[_0x228c('0x24')];_0x42608c+=0x1){var _0x17bc21=this[_0x228c('0x1d')](_0x1140e1[_0x42608c]['connectedlinenum']);if(_0x17bc21){_0x1140e1[_0x42608c][_0x228c('0x1f')]=_0x17bc21[_0x228c('0x1f')];_0x1140e1[_0x42608c][_0x228c('0x25')]=!![];_0x1140e1[_0x42608c][_0x228c('0x26')]=_0x17bc21['name'];_0x1140e1[_0x42608c][_0x228c('0x21')]=_[_0x228c('0x27')](_0x17bc21[_0x228c('0x21')])?util[_0x228c('0x22')](_0x228c('0x23'),_0x17bc21[_0x228c('0x20')]):_0x17bc21[_0x228c('0x21')];if(_0x1140e1[_0x42608c][_0x228c('0x28')]){_0x1140e1[_0x42608c]['queuecallercompleteAt']=moment()[_0x228c('0x22')](_0x228c('0x29'));}if(_0x1140e1[_0x42608c][_0x228c('0x2a')]){_0x1140e1[_0x42608c][_0x228c('0x2b')]=moment()[_0x228c('0x22')](_0x228c('0x29'));}RpcMemberReport['voiceQueueReport'](_0x1140e1[_0x42608c]);}RpcVoiceQueueReport['create'](_0x1140e1[_0x42608c]);}};function extractCalleridNumber(_0x30f553){var _0x4eb7c5=_0x30f553[_0x228c('0x2c')](/<(.*?)>/);return _0x4eb7c5?_0x4eb7c5[0x1]:_0x30f553;}Report[_0x228c('0x11')][_0x228c('0x17')]=function(_0x24be7b){_0x24be7b[_0x228c('0x2d')]=_0x24be7b[_0x228c('0x2d')]||_0x24be7b[_0x228c('0x2e')];if(_0x24be7b[_0x228c('0x2f')]==_0x228c('0x30')){_0x24be7b[_0x228c('0x31')]=_0x228c('0x32');_0x24be7b[_0x228c('0x33')]=_0x24be7b[_0x228c('0x32')];if(_0x24be7b['context']==_0x228c('0x34')){_0x24be7b[_0x228c('0x1f')]='';_0x24be7b[_0x228c('0x2d')]=extractCalleridNumber(_0x24be7b['callerid']);}else if(_0x24be7b[_0x228c('0x35')]==_0x228c('0x36')){if(_0x24be7b[_0x228c('0x2d')]==_0x228c('0x37')){_0x24be7b[_0x228c('0x2d')]=extractCalleridNumber(_0x24be7b['calleridpreview']);_0x24be7b[_0x228c('0x38')]=_0x24be7b['originatecalleridnum'];_0x24be7b[_0x228c('0x39')]=[_0x24be7b[_0x228c('0x3a')],_0x24be7b[_0x228c('0x3a')]=_0x24be7b['destinationchannel']][0x0];_0x24be7b[_0x228c('0x3b')]=_0x24be7b['calleridpreview'];}else{_0x24be7b[_0x228c('0x2d')]=_0x24be7b['calleridnum'];_0x24be7b[_0x228c('0x38')]=_0x24be7b[_0x228c('0x3c')];if(_0x24be7b[_0x228c('0x3d')]==_0x228c('0x3e')){_0x24be7b['accountcode']=_0x24be7b[_0x228c('0x3f')];}else{_0x24be7b[_0x228c('0x1f')]='';}}}}else{_0x24be7b[_0x228c('0x3b')]=util[_0x228c('0x22')]('\x22%s\x22\x20<%s>',_0x24be7b[_0x228c('0x40')],_0x24be7b[_0x228c('0x38')]);}if(RpcVoiceTransferReport['transfers'][_0x24be7b[_0x228c('0x41')]]){var _0x140b1e=RpcVoiceTransferReport['transfers'][_0x24be7b['linkedid']];_0x140b1e[_0x228c('0x42')]=_0x24be7b[_0x228c('0x43')];RpcVoiceTransferReport['blindTransfer'](_0x140b1e);delete RpcVoiceTransferReport['transfers'][_0x24be7b[_0x228c('0x41')]];}RpcVoiceCallReport[_0x228c('0x44')](_0x24be7b);if(_0x24be7b[_0x228c('0x45')]){for(var _0x3d68ce=0x0;_0x3d68ce<_0x24be7b[_0x228c('0x46')][_0x228c('0x24')];_0x3d68ce+=0x1){_0x24be7b['monitorFilename']=_0x24be7b[_0x228c('0x46')][_0x3d68ce][_0x228c('0x47')];_0x24be7b[_0x228c('0x48')]=_0x24be7b[_0x228c('0x46')][_0x3d68ce][_0x228c('0x48')];if(_0x24be7b[_0x228c('0x2e')]=='xcally-motion-preview'){_0x24be7b[_0x228c('0x38')]=_0x24be7b['connectedlinenum'];_0x24be7b[_0x228c('0x40')]=_0x24be7b[_0x228c('0x49')];_0x24be7b[_0x228c('0x3f')]=_0x24be7b['accountcode'];_0x24be7b[_0x228c('0x49')]=_0x24be7b[_0x228c('0x4a')];_0x24be7b[_0x228c('0x2e')]=_0x24be7b[_0x228c('0x3c')];}else if(_0x24be7b[_0x228c('0x2e')]=='xcally-motion-dialer'){_0x24be7b[_0x228c('0x38')]=_0x24be7b['destination'];_0x24be7b['exten']=_0x24be7b['originatecalleridnum'];}RpcVoiceRecording['create'](_0x24be7b);}}};Report[_0x228c('0x11')]['voiceAgentReport']=function(_0x5ea0d8){if(_[_0x228c('0x4b')](_0x5ea0d8)){_0x5ea0d8[_0x228c('0x4c')](function(_0x14a654){RpcVoiceAgentReport['create'](_0x14a654);});}else{RpcVoiceAgentReport[_0x228c('0x44')](_0x5ea0d8);}};Report[_0x228c('0x11')][_0x228c('0x1a')]=function(_0x24afa7){RpcVoiceDialReport[_0x228c('0x44')](_0x24afa7);var _0xb51bc7;var _0x5a60d4;var _0x215f0c=_0x24afa7[_0x228c('0x3a')];if(_[_0x228c('0x4d')](_0x215f0c,'Local')){_0x5a60d4=_0x215f0c[_0x228c('0x4e')](_0x215f0c[_0x228c('0x4f')]('/')+0x1,_0x215f0c['indexOf']('@'));_0xb51bc7=_[_0x228c('0x1e')](this['agents'],function(_0x6b8aa2){return _0x6b8aa2[_0x228c('0x50')]==_0x5a60d4||_0x6b8aa2[_0x228c('0x51')]==_0x5a60d4||_0x6b8aa2['accountcode']==_0x5a60d4;});}else{_0x5a60d4=_0x215f0c[_0x228c('0x4e')](_0x215f0c[_0x228c('0x4f')]('/')+0x1,_0x215f0c[_0x228c('0x52')]('-'));_0xb51bc7=this[_0x228c('0x1d')](_0x5a60d4);}if(_0xb51bc7){_0x24afa7[_0x228c('0x21')]=_[_0x228c('0x27')](_0xb51bc7[_0x228c('0x21')])?util['format'](_0x228c('0x23'),_0xb51bc7[_0x228c('0x20')]):_0xb51bc7['interface'];_0x24afa7['membername']=_0xb51bc7[_0x228c('0x20')];_0x24afa7['accountcode']=_0xb51bc7['accountcode'];RpcMemberReport[_0x228c('0x1a')](_0x24afa7);}};Report['prototype'][_0x228c('0x53')]=function(_0x23cba5){RpcVoiceTransferReport[_0x228c('0x54')][_0x23cba5[_0x228c('0x55')]]=_0x23cba5;};Report[_0x228c('0x11')]['attendedTransfer']=function(_0x464f25){RpcVoiceTransferReport[_0x228c('0x1c')](_0x464f25);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index ef3223b..9931723 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 _0x597c=['telephone:%s','telephone:save','Local','indexOf','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','updateStatusRealtime','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','trunk:%s','exports','lodash','moment','bluebird','../../../config/environment','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registry','syncRegistry','bind','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','then','catch','error','[userReport][sipshowregistry]','inspect','resolve','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','merge','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','format'];(function(_0x23c011,_0x234d6b){var _0x85d3cb=function(_0x54160d){while(--_0x54160d){_0x23c011['push'](_0x23c011['shift']());}};_0x85d3cb(++_0x234d6b);}(_0x597c,0x95));var _0xc597=function(_0x393cfd,_0x33d7b2){_0x393cfd=_0x393cfd-0x0;var _0x26c8df=_0x597c[_0x393cfd];return _0x26c8df;};'use strict';var _=require(_0xc597('0x0'));var moment=require(_0xc597('0x1'));var util=require('util');var Redis=require('ioredis');var BPromise=require(_0xc597('0x2'));var config=require(_0xc597('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0xc597('0x4'));config[_0xc597('0x5')]=_[_0xc597('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc597('0x7'))(new Redis(config[_0xc597('0x5')]));function UserReport(_0x30699b){this[_0xc597('0x8')]=_0x30699b['trunks'];this[_0xc597('0x9')]=_0x30699b[_0xc597('0x9')];this[_0xc597('0xa')]=_0x30699b[_0xc597('0xa')];ami['on']('registryentry',this['syncRegistry']['bind'](this));ami['on'](_0xc597('0xb'),this[_0xc597('0xc')][_0xc597('0xd')](this));ami['on']('devicestatechange',this[_0xc597('0xe')]['bind'](this));ami['on'](_0xc597('0xf'),this[_0xc597('0x10')][_0xc597('0xd')](this));return this[_0xc597('0x11')]();}function showSipRegistrations(){Promise['resolve']()[_0xc597('0x12')](ami['actionSipShowRegistry']())[_0xc597('0x13')](function(_0x3c65ae){logger[_0xc597('0x14')](_0xc597('0x15'),util[_0xc597('0x16')](_0x3c65ae,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xc597('0x12')](ami['actionDeviceStateList']())[_0xc597('0x13')](function(_0x27784b){logger[_0xc597('0x14')]('[userReport][devicestatelist]',util[_0xc597('0x16')](_0x27784b,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xc597('0x17')]()[_0xc597('0x12')](ami[_0xc597('0x18')]())['catch'](function(_0x238838){logger[_0xc597('0x14')](_0xc597('0x19'),util[_0xc597('0x16')](_0x238838,{'showHidden':![],'depth':null}));});}UserReport[_0xc597('0x1a')][_0xc597('0x11')]=function(){setInterval(function(){BPromise[_0xc597('0x17')]()[_0xc597('0x12')](showSipRegistrations())[_0xc597('0x12')](listDeviceStates())[_0xc597('0x12')](showPeersStatus());},0x32c8);};UserReport[_0xc597('0x1a')][_0xc597('0x1b')]=function(_0x3c6947){return _0x3c6947!==null&&!_[_0xc597('0x1c')](_0x3c6947);};UserReport[_0xc597('0x1a')][_0xc597('0x1d')]=function(_0x346fba,_0x3fe689,_0x501c39){io['to'](_0x346fba)[_0xc597('0x1d')](_0x3fe689,_0x501c39);};UserReport[_0xc597('0x1a')]['syncRegistry']=function(_0x17593c){try{if(this[_0xc597('0x1b')](_0x17593c)){logger[_0xc597('0x1e')](_0xc597('0x1f'),_0x17593c[_0xc597('0x20')],_0x17593c[_0xc597('0x21')]);logger[_0xc597('0x22')](_0xc597('0x23'),util[_0xc597('0x16')](_0x17593c,{'showHidden':![],'depth':null}));var _0x8b09c2=_[_0xc597('0x24')](this[_0xc597('0x8')],{'defaultuser':_0x17593c[_0xc597('0x20')]});if(_0x8b09c2){_0x17593c['stateRegistry']=_0x17593c[_0xc597('0x21')];_[_0xc597('0x25')](_0x8b09c2,_['omit'](_0x17593c,[_0xc597('0x26'),_0xc597('0x27'),_0xc597('0x20'),_0xc597('0x21')]));logger[_0xc597('0x22')](_0xc597('0x28'),util['inspect'](_0x8b09c2,{'showHidden':![],'depth':null}));this[_0xc597('0x1d')](util['format']('trunk:%s',_0x8b09c2[_0xc597('0x29')]),_0xc597('0x2a'),_0x8b09c2);}}}catch(_0x22bd39){logger[_0xc597('0x14')](_0xc597('0x23'),util[_0xc597('0x16')](_0x22bd39,{'showHidden':![],'depth':null}));}};UserReport[_0xc597('0x1a')][_0xc597('0xe')]=function(_0x4c43f1){try{if(this['isNotNull'](_0x4c43f1)){logger[_0xc597('0x1e')](_0xc597('0x2b'),_0x4c43f1[_0xc597('0x2c')],_0x4c43f1[_0xc597('0x21')]);logger[_0xc597('0x22')](_0xc597('0x2d'),util[_0xc597('0x16')](_0x4c43f1,{'showHidden':![],'depth':null}));if(this[_0xc597('0x9')][_0x4c43f1[_0xc597('0x2c')]]){if(!this[_0xc597('0x9')][_0x4c43f1[_0xc597('0x2c')]][_0xc597('0x2e')]||_0x4c43f1[_0xc597('0x21')][_0xc597('0x2f')]()==_0xc597('0x30')){this[_0xc597('0x9')][_0x4c43f1[_0xc597('0x2c')]][_0xc597('0x2e')]=![];if(this[_0xc597('0x9')][_0x4c43f1['device']][_0xc597('0x21')]!==_0x4c43f1[_0xc597('0x21')][_0xc597('0x2f')]()){this[_0xc597('0x9')][_0x4c43f1['device']][_0xc597('0x31')]=_['toNumber'](moment()['format']('x'));}this[_0xc597('0x9')][_0x4c43f1['device']][_0xc597('0x21')]=_0x4c43f1[_0xc597('0x21')][_0xc597('0x2f')]();this[_0xc597('0x9')][_0x4c43f1[_0xc597('0x2c')]]['updateStatusRealtime'](_0x4c43f1);}}else if(this[_0xc597('0xa')][_0x4c43f1[_0xc597('0x2c')]]){if(this[_0xc597('0xa')][_0x4c43f1[_0xc597('0x2c')]][_0xc597('0x21')]!==_0x4c43f1[_0xc597('0x21')][_0xc597('0x2f')]()){this[_0xc597('0xa')][_0x4c43f1['device']][_0xc597('0x31')]=_[_0xc597('0x32')](moment()[_0xc597('0x33')]('x'));}this[_0xc597('0xa')][_0x4c43f1[_0xc597('0x2c')]]['state']=_0x4c43f1['state'][_0xc597('0x2f')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xc597('0x16')](this[_0xc597('0xa')][_0x4c43f1[_0xc597('0x2c')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xc597('0x33')](_0xc597('0x34'),this[_0xc597('0xa')][_0x4c43f1[_0xc597('0x2c')]]['name']),_0xc597('0x35'),this[_0xc597('0xa')][_0x4c43f1['device']]);}else if(this[_0xc597('0x8')][_0x4c43f1[_0xc597('0x2c')]]){if(this['trunks'][_0x4c43f1['device']]['state']!==_0x4c43f1[_0xc597('0x21')]['toLowerCase']()){this[_0xc597('0x8')][_0x4c43f1['device']]['stateTime']=_['toNumber'](moment()['format']('x'));}this[_0xc597('0x8')][_0x4c43f1['device']][_0xc597('0x21')]=_0x4c43f1[_0xc597('0x21')][_0xc597('0x2f')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0xc597('0x16')](this[_0xc597('0x8')][_0x4c43f1['device']],{'showHidden':![],'depth':null}));this[_0xc597('0x1d')](util[_0xc597('0x33')]('trunk:%s',this[_0xc597('0x8')][_0x4c43f1[_0xc597('0x2c')]][_0xc597('0x29')]),'trunk:save',this['trunks'][_0x4c43f1['device']]);}else if(_['startsWith'](_0x4c43f1['device'],_0xc597('0x36'))){var _0x3db9ff=_0x4c43f1['device'];var _0x4a80da=_0x3db9ff['substring'](_0x3db9ff[_0xc597('0x37')]('/')+0x1,_0x3db9ff[_0xc597('0x37')]('@'));var _0x2f02ae=_['find'](this[_0xc597('0x9')],function(_0x407125){return _0x407125['mobile']==_0x4a80da||_0x407125['phone']==_0x4a80da||_0x407125[_0xc597('0x38')]==_0x4a80da;});if(_0x2f02ae){if(_0x2f02ae[_0xc597('0x21')]!==_0x4c43f1[_0xc597('0x21')]['toLowerCase']()){_0x2f02ae[_0xc597('0x31')]=_[_0xc597('0x32')](moment()[_0xc597('0x33')]('x'));}_0x2f02ae[_0xc597('0x21')]=_0x4c43f1[_0xc597('0x21')]['toLowerCase']();_0x2f02ae[_0xc597('0x2e')]=!![];_0x2f02ae['updateStatusRealtime'](_0x4c43f1);}}}}catch(_0x5d6b09){logger[_0xc597('0x14')]('[userReport][devicestatechange]',util[_0xc597('0x16')](_0x5d6b09,{'showHidden':![],'depth':null}));}};UserReport[_0xc597('0x1a')]['syncPeerStatus']=function(_0x260869){try{if(this[_0xc597('0x1b')](_0x260869)&&this[_0xc597('0x1b')](_0x260869[_0xc597('0xf')])){logger[_0xc597('0x1e')](_0xc597('0x39'),_0x260869[_0xc597('0x3a')],_0x260869[_0xc597('0x3b')],_0x260869[_0xc597('0xf')]);logger[_0xc597('0x22')](_0xc597('0x3c'),util[_0xc597('0x16')](_0x260869,{'showHidden':![],'depth':null}));if(this['agents'][_0x260869[_0xc597('0x3a')]]){if(!this['agents'][_0x260869['peer']][_0xc597('0x2e')]||_0x260869['peerstatus']['toLowerCase']()==_0xc597('0x3d')){this[_0xc597('0x9')][_0x260869[_0xc597('0x3a')]]['local']=![];this[_0xc597('0x9')][_0x260869[_0xc597('0x3a')]][_0xc597('0x3e')]=_0x260869[_0xc597('0xf')][_0xc597('0x2f')]();this['agents'][_0x260869[_0xc597('0x3a')]][_0xc597('0x3b')]=_0x260869[_0xc597('0x3b')];this['agents'][_0x260869['peer']][_0xc597('0x3f')](_0x260869);}}else if(this[_0xc597('0xa')][_0x260869[_0xc597('0x3a')]]){this[_0xc597('0xa')][_0x260869[_0xc597('0x3a')]]['status']=_0x260869[_0xc597('0xf')][_0xc597('0x2f')]();this[_0xc597('0xa')][_0x260869[_0xc597('0x3a')]][_0xc597('0x3b')]=_0x260869[_0xc597('0x3b')];logger[_0xc597('0x22')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0xc597('0x16')](this[_0xc597('0xa')][_0x260869[_0xc597('0x3a')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xc597('0x33')](_0xc597('0x34'),this[_0xc597('0xa')][_0x260869[_0xc597('0x3a')]][_0xc597('0x29')]),_0xc597('0x35'),this[_0xc597('0xa')][_0x260869['peer']]);}else if(this[_0xc597('0x8')][_0x260869[_0xc597('0x3a')]]){this[_0xc597('0x8')][_0x260869[_0xc597('0x3a')]]['status']=_0x260869['peerstatus'][_0xc597('0x2f')]();this[_0xc597('0x8')][_0x260869[_0xc597('0x3a')]][_0xc597('0x3b')]=_0x260869[_0xc597('0x3b')];logger[_0xc597('0x22')](_0xc597('0x40'),util[_0xc597('0x16')](this[_0xc597('0x8')][_0x260869[_0xc597('0x3a')]],{'showHidden':![],'depth':null}));this[_0xc597('0x1d')](util['format'](_0xc597('0x41'),this['trunks'][_0x260869[_0xc597('0x3a')]][_0xc597('0x29')]),_0xc597('0x2a'),this[_0xc597('0x8')][_0x260869['peer']]);}}}catch(_0x57f82b){logger[_0xc597('0x14')]('[userReport][peerstatus]',util['inspect'](_0x57f82b,{'showHidden':![],'depth':null}));}};module[_0xc597('0x42')]=UserReport; \ No newline at end of file +var _0xee71=['../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','[userReport][sipshowregistry]','inspect','actionDeviceStateList','catch','error','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','find','username','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','syncDeviceState','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','Local','substring','indexOf','mobile','phone','accountcode','updateStatusRealtime','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','moment','ioredis','bluebird','../../../config/environment','ami'];(function(_0x196d9e,_0x50ecf3){var _0x2235e0=function(_0x1adb58){while(--_0x1adb58){_0x196d9e['push'](_0x196d9e['shift']());}};_0x2235e0(++_0x50ecf3);}(_0xee71,0x1ce));var _0x1ee7=function(_0x1034bd,_0x26ef9f){_0x1034bd=_0x1034bd-0x0;var _0x5e6214=_0xee71[_0x1034bd];return _0x5e6214;};'use strict';var _=require(_0x1ee7('0x0'));var moment=require(_0x1ee7('0x1'));var util=require('util');var Redis=require(_0x1ee7('0x2'));var BPromise=require(_0x1ee7('0x3'));var config=require(_0x1ee7('0x4'));var logger=require('../../../config/logger')(_0x1ee7('0x5'));var ami=require(_0x1ee7('0x6'));config['redis']=_[_0x1ee7('0x7')](config[_0x1ee7('0x8')],{'host':_0x1ee7('0x9'),'port':0x18eb});var io=require(_0x1ee7('0xa'))(new Redis(config[_0x1ee7('0x8')]));function UserReport(_0x42a475){this[_0x1ee7('0xb')]=_0x42a475[_0x1ee7('0xb')];this['agents']=_0x42a475[_0x1ee7('0xc')];this[_0x1ee7('0xd')]=_0x42a475[_0x1ee7('0xd')];ami['on'](_0x1ee7('0xe'),this[_0x1ee7('0xf')]['bind'](this));ami['on']('registry',this[_0x1ee7('0xf')][_0x1ee7('0x10')](this));ami['on'](_0x1ee7('0x11'),this['syncDeviceState'][_0x1ee7('0x10')](this));ami['on'](_0x1ee7('0x12'),this[_0x1ee7('0x13')][_0x1ee7('0x10')](this));return this[_0x1ee7('0x14')]();}function showSipRegistrations(){Promise[_0x1ee7('0x15')]()[_0x1ee7('0x16')](ami[_0x1ee7('0x17')]())['catch'](function(_0x58eacd){logger['error'](_0x1ee7('0x18'),util[_0x1ee7('0x19')](_0x58eacd,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x1ee7('0x15')]()[_0x1ee7('0x16')](ami[_0x1ee7('0x1a')]())[_0x1ee7('0x1b')](function(_0x1418d9){logger[_0x1ee7('0x1c')](_0x1ee7('0x1d'),util[_0x1ee7('0x19')](_0x1418d9,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x1ee7('0x15')]()[_0x1ee7('0x16')](ami['actionSipPeerStatus']())[_0x1ee7('0x1b')](function(_0x16a924){logger[_0x1ee7('0x1c')](_0x1ee7('0x1e'),util[_0x1ee7('0x19')](_0x16a924,{'showHidden':![],'depth':null}));});}UserReport[_0x1ee7('0x1f')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0x1ee7('0x16')](showSipRegistrations())[_0x1ee7('0x16')](listDeviceStates())[_0x1ee7('0x16')](showPeersStatus());},0x32c8);};UserReport[_0x1ee7('0x1f')]['isNotNull']=function(_0x412da7){return _0x412da7!==null&&!_[_0x1ee7('0x20')](_0x412da7);};UserReport[_0x1ee7('0x1f')]['emit']=function(_0x4f119d,_0x2ef402,_0xaa3c9){io['to'](_0x4f119d)[_0x1ee7('0x21')](_0x2ef402,_0xaa3c9);};UserReport[_0x1ee7('0x1f')][_0x1ee7('0xf')]=function(_0x34dc1b){try{if(this[_0x1ee7('0x22')](_0x34dc1b)){logger[_0x1ee7('0x23')](_0x1ee7('0x24'),_0x34dc1b['username'],_0x34dc1b[_0x1ee7('0x25')]);logger[_0x1ee7('0x26')](_0x1ee7('0x27'),util[_0x1ee7('0x19')](_0x34dc1b,{'showHidden':![],'depth':null}));var _0x42aad4=_[_0x1ee7('0x28')](this[_0x1ee7('0xb')],{'defaultuser':_0x34dc1b[_0x1ee7('0x29')]});if(_0x42aad4){_0x34dc1b[_0x1ee7('0x2a')]=_0x34dc1b['state'];_[_0x1ee7('0x2b')](_0x42aad4,_[_0x1ee7('0x2c')](_0x34dc1b,[_0x1ee7('0x2d'),_0x1ee7('0x2e'),_0x1ee7('0x29'),_0x1ee7('0x25')]));logger[_0x1ee7('0x26')](_0x1ee7('0x2f'),util[_0x1ee7('0x19')](_0x42aad4,{'showHidden':![],'depth':null}));this[_0x1ee7('0x21')](util[_0x1ee7('0x30')](_0x1ee7('0x31'),_0x42aad4[_0x1ee7('0x32')]),'trunk:save',_0x42aad4);}}}catch(_0x2a8813){logger[_0x1ee7('0x1c')](_0x1ee7('0x27'),util[_0x1ee7('0x19')](_0x2a8813,{'showHidden':![],'depth':null}));}};UserReport[_0x1ee7('0x1f')][_0x1ee7('0x33')]=function(_0xe4f968){try{if(this[_0x1ee7('0x22')](_0xe4f968)){logger['info']('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0xe4f968[_0x1ee7('0x34')],_0xe4f968['state']);logger[_0x1ee7('0x26')](_0x1ee7('0x35'),util['inspect'](_0xe4f968,{'showHidden':![],'depth':null}));if(this[_0x1ee7('0xc')][_0xe4f968[_0x1ee7('0x34')]]){if(!this[_0x1ee7('0xc')][_0xe4f968[_0x1ee7('0x34')]][_0x1ee7('0x36')]||_0xe4f968[_0x1ee7('0x25')][_0x1ee7('0x37')]()==_0x1ee7('0x38')){this[_0x1ee7('0xc')][_0xe4f968['device']][_0x1ee7('0x36')]=![];if(this[_0x1ee7('0xc')][_0xe4f968[_0x1ee7('0x34')]][_0x1ee7('0x25')]!==_0xe4f968[_0x1ee7('0x25')][_0x1ee7('0x37')]()){this[_0x1ee7('0xc')][_0xe4f968[_0x1ee7('0x34')]][_0x1ee7('0x39')]=_[_0x1ee7('0x3a')](moment()[_0x1ee7('0x30')]('x'));}this[_0x1ee7('0xc')][_0xe4f968[_0x1ee7('0x34')]][_0x1ee7('0x25')]=_0xe4f968[_0x1ee7('0x25')]['toLowerCase']();this['agents'][_0xe4f968['device']]['updateStatusRealtime'](_0xe4f968);}}else if(this[_0x1ee7('0xd')][_0xe4f968[_0x1ee7('0x34')]]){if(this['telephones'][_0xe4f968[_0x1ee7('0x34')]][_0x1ee7('0x25')]!==_0xe4f968[_0x1ee7('0x25')][_0x1ee7('0x37')]()){this[_0x1ee7('0xd')][_0xe4f968[_0x1ee7('0x34')]][_0x1ee7('0x39')]=_['toNumber'](moment()[_0x1ee7('0x30')]('x'));}this['telephones'][_0xe4f968[_0x1ee7('0x34')]]['state']=_0xe4f968['state'][_0x1ee7('0x37')]();logger[_0x1ee7('0x26')](_0x1ee7('0x3b'),util[_0x1ee7('0x19')](this[_0x1ee7('0xd')][_0xe4f968[_0x1ee7('0x34')]],{'showHidden':![],'depth':null}));this[_0x1ee7('0x21')](util[_0x1ee7('0x30')](_0x1ee7('0x3c'),this[_0x1ee7('0xd')][_0xe4f968['device']][_0x1ee7('0x32')]),_0x1ee7('0x3d'),this[_0x1ee7('0xd')][_0xe4f968['device']]);}else if(this[_0x1ee7('0xb')][_0xe4f968[_0x1ee7('0x34')]]){if(this[_0x1ee7('0xb')][_0xe4f968[_0x1ee7('0x34')]][_0x1ee7('0x25')]!==_0xe4f968[_0x1ee7('0x25')][_0x1ee7('0x37')]()){this[_0x1ee7('0xb')][_0xe4f968['device']][_0x1ee7('0x39')]=_['toNumber'](moment()[_0x1ee7('0x30')]('x'));}this[_0x1ee7('0xb')][_0xe4f968[_0x1ee7('0x34')]][_0x1ee7('0x25')]=_0xe4f968['state']['toLowerCase']();logger[_0x1ee7('0x26')](_0x1ee7('0x3e'),util[_0x1ee7('0x19')](this[_0x1ee7('0xb')][_0xe4f968['device']],{'showHidden':![],'depth':null}));this[_0x1ee7('0x21')](util['format'](_0x1ee7('0x31'),this[_0x1ee7('0xb')][_0xe4f968[_0x1ee7('0x34')]][_0x1ee7('0x32')]),_0x1ee7('0x3f'),this[_0x1ee7('0xb')][_0xe4f968[_0x1ee7('0x34')]]);}else if(_['startsWith'](_0xe4f968[_0x1ee7('0x34')],_0x1ee7('0x40'))){var _0x23b310=_0xe4f968[_0x1ee7('0x34')];var _0x3307eb=_0x23b310[_0x1ee7('0x41')](_0x23b310[_0x1ee7('0x42')]('/')+0x1,_0x23b310[_0x1ee7('0x42')]('@'));var _0x346267=_[_0x1ee7('0x28')](this[_0x1ee7('0xc')],function(_0x14cecb){return _0x14cecb[_0x1ee7('0x43')]==_0x3307eb||_0x14cecb[_0x1ee7('0x44')]==_0x3307eb||_0x14cecb[_0x1ee7('0x45')]==_0x3307eb;});if(_0x346267){if(_0x346267[_0x1ee7('0x25')]!==_0xe4f968[_0x1ee7('0x25')]['toLowerCase']()){_0x346267['stateTime']=_[_0x1ee7('0x3a')](moment()[_0x1ee7('0x30')]('x'));}_0x346267['state']=_0xe4f968[_0x1ee7('0x25')][_0x1ee7('0x37')]();_0x346267[_0x1ee7('0x36')]=!![];_0x346267[_0x1ee7('0x46')](_0xe4f968);}}}}catch(_0x4ef4c6){logger['error'](_0x1ee7('0x35'),util[_0x1ee7('0x19')](_0x4ef4c6,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x1ee7('0x13')]=function(_0x540227){try{if(this[_0x1ee7('0x22')](_0x540227)&&this[_0x1ee7('0x22')](_0x540227['peerstatus'])){logger['info']('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x540227[_0x1ee7('0x47')],_0x540227[_0x1ee7('0x48')],_0x540227[_0x1ee7('0x12')]);logger[_0x1ee7('0x26')](_0x1ee7('0x49'),util[_0x1ee7('0x19')](_0x540227,{'showHidden':![],'depth':null}));if(this[_0x1ee7('0xc')][_0x540227[_0x1ee7('0x47')]]){if(!this[_0x1ee7('0xc')][_0x540227['peer']]['local']||_0x540227['peerstatus'][_0x1ee7('0x37')]()==_0x1ee7('0x4a')){this[_0x1ee7('0xc')][_0x540227[_0x1ee7('0x47')]][_0x1ee7('0x36')]=![];this[_0x1ee7('0xc')][_0x540227[_0x1ee7('0x47')]]['status']=_0x540227[_0x1ee7('0x12')]['toLowerCase']();this[_0x1ee7('0xc')][_0x540227[_0x1ee7('0x47')]][_0x1ee7('0x48')]=_0x540227[_0x1ee7('0x48')];this[_0x1ee7('0xc')][_0x540227['peer']][_0x1ee7('0x46')](_0x540227);}}else if(this[_0x1ee7('0xd')][_0x540227['peer']]){this['telephones'][_0x540227['peer']][_0x1ee7('0x4b')]=_0x540227['peerstatus'][_0x1ee7('0x37')]();this['telephones'][_0x540227[_0x1ee7('0x47')]][_0x1ee7('0x48')]=_0x540227['address'];logger[_0x1ee7('0x26')](_0x1ee7('0x4c'),util[_0x1ee7('0x19')](this[_0x1ee7('0xd')][_0x540227[_0x1ee7('0x47')]],{'showHidden':![],'depth':null}));this[_0x1ee7('0x21')](util[_0x1ee7('0x30')](_0x1ee7('0x3c'),this['telephones'][_0x540227[_0x1ee7('0x47')]][_0x1ee7('0x32')]),_0x1ee7('0x3d'),this['telephones'][_0x540227[_0x1ee7('0x47')]]);}else if(this[_0x1ee7('0xb')][_0x540227[_0x1ee7('0x47')]]){this[_0x1ee7('0xb')][_0x540227[_0x1ee7('0x47')]][_0x1ee7('0x4b')]=_0x540227[_0x1ee7('0x12')]['toLowerCase']();this[_0x1ee7('0xb')][_0x540227[_0x1ee7('0x47')]][_0x1ee7('0x48')]=_0x540227[_0x1ee7('0x48')];logger[_0x1ee7('0x26')](_0x1ee7('0x4d'),util[_0x1ee7('0x19')](this['trunks'][_0x540227[_0x1ee7('0x47')]],{'showHidden':![],'depth':null}));this[_0x1ee7('0x21')](util[_0x1ee7('0x30')]('trunk:%s',this['trunks'][_0x540227[_0x1ee7('0x47')]][_0x1ee7('0x32')]),_0x1ee7('0x3f'),this[_0x1ee7('0xb')][_0x540227['peer']]);}}}catch(_0xae4a85){logger[_0x1ee7('0x1c')](_0x1ee7('0x49'),util[_0x1ee7('0x19')](_0xae4a85,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 2f0de6e..9353505 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 _0xde05=['agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentringnoanswer]\x20event:','reason','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:%s','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','addVariable','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','value','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','secondtransfereruniqueid','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','emit','prototype','isNotNull','isUndefined','info','uniqueid','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','channels','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','membername','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','destchannelstate','destchannelstatedesc','lastevent','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xde05,0xe5));var _0x5de0=function(_0x4f5fd3,_0x284cff){_0x4f5fd3=_0x4f5fd3-0x0;var _0x4b377a=_0xde05[_0x4f5fd3];return _0x4b377a;};'use strict';var _=require(_0x5de0('0x0'));var moment=require(_0x5de0('0x1'));var util=require('util');var Redis=require(_0x5de0('0x2'));var config=require(_0x5de0('0x3'));var logger=require(_0x5de0('0x4'))(_0x5de0('0x5'));var ami=require(_0x5de0('0x6'));config[_0x5de0('0x7')]=_[_0x5de0('0x8')](config[_0x5de0('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5de0('0x9'))(new Redis(config['redis']));function VoiceAgentReport(_0x481f62){this['channels']={};this[_0x5de0('0xa')]=_0x481f62[_0x5de0('0xa')];this[_0x5de0('0xb')]=_0x481f62['agents'];this[_0x5de0('0xc')]={};ami['on'](_0x5de0('0xd'),this[_0x5de0('0xe')]['bind'](this));ami['on']('agentconnect',this['syncAgentConnect'][_0x5de0('0xf')](this));ami['on']('agentringnoanswer',this[_0x5de0('0x10')][_0x5de0('0xf')](this));ami['on'](_0x5de0('0x11'),this[_0x5de0('0x12')]['bind'](this));ami['on'](_0x5de0('0x13'),this['syncAgentComplete'][_0x5de0('0xf')](this));ami['on'](_0x5de0('0x14'),this['syncVarSet'][_0x5de0('0xf')](this));ami['on']('hangup',this[_0x5de0('0x15')][_0x5de0('0xf')](this));ami['on'](_0x5de0('0x16'),this['syncMusicOnHoldStart'][_0x5de0('0xf')](this));ami['on'](_0x5de0('0x17'),this[_0x5de0('0x18')][_0x5de0('0xf')](this));ami['on'](_0x5de0('0x19'),this[_0x5de0('0x1a')]['bind'](this));ami['on'](_0x5de0('0x1b'),this['syncBlindTransfer'][_0x5de0('0xf')](this));}VoiceAgentReport['prototype'][_0x5de0('0x1c')]=function(_0xe4e425,_0x3e19ac,_0x46f93e){io['to'](_0xe4e425)[_0x5de0('0x1c')](_0x3e19ac,_0x46f93e);};VoiceAgentReport[_0x5de0('0x1d')][_0x5de0('0x1e')]=function(_0xbb4b36){return _0xbb4b36!==null&&!_[_0x5de0('0x1f')](_0xbb4b36);};VoiceAgentReport['prototype']['syncAgentCalled']=function(_0x145e8a){try{if(this[_0x5de0('0x1e')](_0x145e8a)){logger[_0x5de0('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x145e8a[_0x5de0('0x21')],_0x145e8a['membername'],_0x145e8a[_0x5de0('0x22')]);logger[_0x5de0('0x23')](_0x5de0('0x24'),_0x145e8a[_0x5de0('0x21')],util[_0x5de0('0x25')](_0x145e8a,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x5de0('0x26')][_0x145e8a[_0x5de0('0x21')]])){this[_0x5de0('0x26')][_0x145e8a[_0x5de0('0x21')]]={};}if(_['isUndefined'](this[_0x5de0('0x26')][_0x145e8a['uniqueid']][_0x145e8a[_0x5de0('0x22')]])){this[_0x5de0('0x26')][_0x145e8a[_0x5de0('0x21')]][_0x145e8a['destuniqueid']]={'agentcalledAt':moment()[_0x5de0('0x27')](_0x5de0('0x28')),'lastevent':_0x5de0('0x29'),'mandatoryDisposition':this[_0x5de0('0xa')][_0x145e8a['queue']]?this[_0x5de0('0xa')][_0x145e8a[_0x5de0('0x2a')]][_0x5de0('0x2b')]||![]:![],'type':this[_0x5de0('0xa')][_0x145e8a['queue']]?this[_0x5de0('0xa')][_0x145e8a[_0x5de0('0x2a')]][_0x5de0('0x2c')]||'inbound':_0x5de0('0x2d'),'variables':this['variables'][_0x145e8a[_0x5de0('0x21')]]};}_[_0x5de0('0x2e')](this[_0x5de0('0x26')][_0x145e8a[_0x5de0('0x21')]][_0x145e8a[_0x5de0('0x22')]],_[_0x5de0('0x2f')](_0x145e8a,[_0x5de0('0x30'),_0x5de0('0x31')]));logger[_0x5de0('0x23')](_0x5de0('0x32'),_0x145e8a[_0x5de0('0x21')],util[_0x5de0('0x25')](this[_0x5de0('0x26')][_0x145e8a['uniqueid']][_0x145e8a[_0x5de0('0x22')]],{'showHidden':![],'depth':null}));ami[_0x5de0('0x1c')](_0x5de0('0x33'),this[_0x5de0('0x26')][_0x145e8a['uniqueid']][_0x145e8a[_0x5de0('0x22')]]);logger[_0x5de0('0x23')](_0x5de0('0x34'),_0x145e8a[_0x5de0('0x21')],util[_0x5de0('0x25')](this[_0x5de0('0x26')][_0x145e8a[_0x5de0('0x21')]][_0x145e8a[_0x5de0('0x22')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x5de0('0x27')]('user:%s',_0x145e8a[_0x5de0('0x35')]),_0x5de0('0x36'),this['channels'][_0x145e8a[_0x5de0('0x21')]][_0x145e8a[_0x5de0('0x22')]]);}}catch(_0x4bfb04){logger[_0x5de0('0x37')](_0x5de0('0x38'),_0x145e8a[_0x5de0('0x21')],util[_0x5de0('0x25')](_0x4bfb04,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5de0('0x39')]=function(_0x1f29d5){try{if(this[_0x5de0('0x1e')](_0x1f29d5)){if(this[_0x5de0('0x26')][_0x1f29d5[_0x5de0('0x21')]]){logger[_0x5de0('0x23')](_0x5de0('0x3a'),_0x1f29d5[_0x5de0('0x21')],util[_0x5de0('0x25')](_0x1f29d5,{'showHidden':![],'depth':null}));for(var _0x3f6288 in this['channels'][_0x1f29d5['uniqueid']]){if(this[_0x5de0('0x26')][_0x1f29d5[_0x5de0('0x21')]][_0x5de0('0x3b')](_0x3f6288)){if(_0x1f29d5[_0x5de0('0x22')]===_0x3f6288){logger[_0x5de0('0x20')](_0x5de0('0x3c'),_0x1f29d5[_0x5de0('0x21')],_0x1f29d5[_0x5de0('0x35')],_0x1f29d5[_0x5de0('0x22')]);this[_0x5de0('0x26')][_0x1f29d5['uniqueid']][_0x3f6288][_0x5de0('0x3d')]=moment()['format'](_0x5de0('0x28'));this[_0x5de0('0x26')][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288][_0x5de0('0x3e')]=_0x1f29d5[_0x5de0('0x3e')];this[_0x5de0('0x26')][_0x1f29d5['uniqueid']][_0x3f6288]['connectedlinenum']=_0x1f29d5['connectedlinenum'];this[_0x5de0('0x26')][_0x1f29d5['uniqueid']][_0x3f6288][_0x5de0('0x3f')]=_0x1f29d5[_0x5de0('0x3f')];this[_0x5de0('0x26')][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288][_0x5de0('0x40')]=_0x1f29d5['destchannelstatedesc'];this['channels'][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288]['holdtime']=_0x1f29d5['holdtime'];this[_0x5de0('0x26')][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288][_0x5de0('0x41')]='connect';_['merge'](this[_0x5de0('0xb')][_0x1f29d5[_0x5de0('0x42')]],_[_0x5de0('0x43')](_0x1f29d5,['queue',_0x5de0('0x44')]));logger['debug'](_0x5de0('0x45'),_0x1f29d5[_0x5de0('0x21')],util['inspect'](this['channels'][_0x1f29d5[_0x5de0('0x21')]][_0x1f29d5['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x5de0('0x1c')](_0x5de0('0x46'),this[_0x5de0('0x26')][_0x1f29d5['uniqueid']][_0x1f29d5[_0x5de0('0x22')]]);logger[_0x5de0('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x1f29d5[_0x5de0('0x21')],util['inspect'](this['channels'][_0x1f29d5[_0x5de0('0x21')]][_0x1f29d5[_0x5de0('0x22')]],{'showHidden':![],'depth':null}));this[_0x5de0('0x1c')](util['format']('user:%s',_0x1f29d5[_0x5de0('0x35')]),'user:agentconnect',this[_0x5de0('0x26')][_0x1f29d5[_0x5de0('0x21')]][_0x1f29d5[_0x5de0('0x22')]]);}else if(!this['channels'][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288][_0x5de0('0x47')]&&!this[_0x5de0('0x26')][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288][_0x5de0('0x13')]){logger['info'](_0x5de0('0x48'),_0x1f29d5[_0x5de0('0x21')],this[_0x5de0('0x26')][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288]['membername'],_0x3f6288);this[_0x5de0('0x26')][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288][_0x5de0('0x47')]=!![];this['channels'][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288][_0x5de0('0x49')]=moment()[_0x5de0('0x27')](_0x5de0('0x28'));this[_0x5de0('0x26')][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288][_0x5de0('0x4a')]=_0x1f29d5[_0x5de0('0x22')];this['channels'][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288][_0x5de0('0x4b')]=_0x1f29d5['membername'];this[_0x5de0('0x26')][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288][_0x5de0('0x41')]=_0x5de0('0x4c');this[_0x5de0('0x26')][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288]['reason']=_0x5de0('0x4c');logger[_0x5de0('0x23')](_0x5de0('0x4d'),_0x1f29d5[_0x5de0('0x21')],util[_0x5de0('0x25')](this['channels'][_0x1f29d5['uniqueid']][_0x3f6288],{'showHidden':![],'depth':null}));ami[_0x5de0('0x1c')](_0x5de0('0x4e'),this[_0x5de0('0x26')][_0x1f29d5[_0x5de0('0x21')]][_0x3f6288]);}}}}}}catch(_0x127d8f){logger[_0x5de0('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x1f29d5[_0x5de0('0x21')],util[_0x5de0('0x25')](_0x127d8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5de0('0x1d')][_0x5de0('0x10')]=function(_0x41a78e){try{if(this[_0x5de0('0x1e')](_0x41a78e)){logger[_0x5de0('0x23')](_0x5de0('0x4f'),_0x41a78e[_0x5de0('0x21')],util['inspect'](_0x41a78e,{'showHidden':![],'depth':null}));if(this[_0x5de0('0x26')][_0x41a78e[_0x5de0('0x21')]]&&this[_0x5de0('0x26')][_0x41a78e[_0x5de0('0x21')]][_0x41a78e[_0x5de0('0x22')]]){logger['info']('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x41a78e['uniqueid'],_0x41a78e['membername'],_0x41a78e[_0x5de0('0x22')]);this['channels'][_0x41a78e[_0x5de0('0x21')]][_0x41a78e[_0x5de0('0x22')]][_0x5de0('0x47')]=!![];this[_0x5de0('0x26')][_0x41a78e[_0x5de0('0x21')]][_0x41a78e['destuniqueid']]['agentringnoanswerAt']=moment()[_0x5de0('0x27')](_0x5de0('0x28'));this[_0x5de0('0x26')][_0x41a78e[_0x5de0('0x21')]][_0x41a78e[_0x5de0('0x22')]][_0x5de0('0x41')]='rejected';this[_0x5de0('0x26')][_0x41a78e[_0x5de0('0x21')]][_0x41a78e[_0x5de0('0x22')]][_0x5de0('0x50')]=_0x5de0('0x51');logger[_0x5de0('0x23')](_0x5de0('0x52'),_0x41a78e['uniqueid'],util['inspect'](this[_0x5de0('0x26')][_0x41a78e[_0x5de0('0x21')]][_0x41a78e['destuniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x5de0('0x53'),this[_0x5de0('0x26')][_0x41a78e[_0x5de0('0x21')]][_0x41a78e['destuniqueid']]);}}}catch(_0x5582c3){logger['error'](_0x5de0('0x54'),_0x41a78e['uniqueid'],util[_0x5de0('0x25')](_0x5582c3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5de0('0x1d')]['syncQueueCallerAbandon']=function(_0x217477){try{if(this[_0x5de0('0x1e')](_0x217477)){logger[_0x5de0('0x23')](_0x5de0('0x55'),_0x217477[_0x5de0('0x21')],util[_0x5de0('0x25')](_0x217477,{'showHidden':![],'depth':null}));if(this[_0x5de0('0x26')][_0x217477[_0x5de0('0x21')]]){for(var _0x2cb976 in this[_0x5de0('0x26')][_0x217477['uniqueid']]){if(this[_0x5de0('0x26')][_0x217477[_0x5de0('0x21')]][_0x5de0('0x3b')](_0x2cb976)&&!this[_0x5de0('0x26')][_0x217477[_0x5de0('0x21')]][_0x2cb976][_0x5de0('0x47')]&&!this[_0x5de0('0x26')][_0x217477[_0x5de0('0x21')]][_0x2cb976][_0x5de0('0x13')]){logger[_0x5de0('0x20')](_0x5de0('0x56'),_0x217477[_0x5de0('0x21')],this[_0x5de0('0x26')][_0x217477[_0x5de0('0x21')]][_0x2cb976][_0x5de0('0x35')],_0x2cb976);this[_0x5de0('0x26')][_0x217477[_0x5de0('0x21')]][_0x2cb976][_0x5de0('0x47')]=!![];this[_0x5de0('0x26')][_0x217477[_0x5de0('0x21')]][_0x2cb976][_0x5de0('0x49')]=moment()[_0x5de0('0x27')](_0x5de0('0x28'));this[_0x5de0('0x26')][_0x217477['uniqueid']][_0x2cb976][_0x5de0('0x41')]=_0x5de0('0x57');this[_0x5de0('0x26')][_0x217477[_0x5de0('0x21')]][_0x2cb976][_0x5de0('0x50')]=_0x5de0('0x57');logger['debug']('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x217477[_0x5de0('0x21')],util[_0x5de0('0x25')](this['channels'][_0x217477[_0x5de0('0x21')]][_0x2cb976],{'showHidden':![],'depth':null}));ami[_0x5de0('0x1c')]('custom:agentqueuecallerabandon',this[_0x5de0('0x26')][_0x217477[_0x5de0('0x21')]][_0x2cb976]);}}}}}catch(_0x40e641){logger[_0x5de0('0x37')](_0x5de0('0x58'),_0x217477[_0x5de0('0x21')],util['inspect'](_0x40e641,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5de0('0x59')]=function(_0x17d987){try{if(this[_0x5de0('0x1e')](_0x17d987)){logger['debug'](_0x5de0('0x5a'),_0x17d987[_0x5de0('0x21')],util['inspect'](_0x17d987,{'showHidden':![],'depth':null}));if(this[_0x5de0('0x26')][_0x17d987[_0x5de0('0x21')]]){for(var _0x151b6b in this['channels'][_0x17d987[_0x5de0('0x21')]]){if(this['channels'][_0x17d987['uniqueid']][_0x5de0('0x3b')](_0x151b6b)){if(this['channels'][_0x17d987['uniqueid']][_0x151b6b][_0x5de0('0x3d')]&&!this[_0x5de0('0x26')][_0x17d987['uniqueid']][_0x151b6b]['agentcomplete']){logger[_0x5de0('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x17d987[_0x5de0('0x21')],this['channels'][_0x17d987['uniqueid']][_0x151b6b][_0x5de0('0x35')],_0x151b6b);this[_0x5de0('0x26')][_0x17d987[_0x5de0('0x21')]][_0x151b6b][_0x5de0('0x13')]=!![];this[_0x5de0('0x26')][_0x17d987[_0x5de0('0x21')]][_0x151b6b][_0x5de0('0x5b')]=moment()[_0x5de0('0x27')](_0x5de0('0x28'));this[_0x5de0('0x26')][_0x17d987[_0x5de0('0x21')]][_0x151b6b]['lastevent']=_0x5de0('0x5c');this['channels'][_0x17d987[_0x5de0('0x21')]][_0x151b6b][_0x5de0('0x50')]=_0x17d987['reason']==_0x5de0('0x5d')?_0x5de0('0x5e'):_0x17d987[_0x5de0('0x50')];this['channels'][_0x17d987[_0x5de0('0x21')]][_0x151b6b][_0x5de0('0x5f')]=_0x17d987['talktime'];if(this[_0x5de0('0xa')][_0x17d987[_0x5de0('0x2a')]]&&this['voiceQueues'][_0x17d987[_0x5de0('0x2a')]][_0x5de0('0x60')]){this[_0x5de0('0x26')][_0x17d987[_0x5de0('0x21')]][_0x151b6b][_0x5de0('0x61')]=this[_0x5de0('0xa')][_0x17d987[_0x5de0('0x2a')]][_0x5de0('0x62')];this[_0x5de0('0x26')][_0x17d987[_0x5de0('0x21')]][_0x151b6b][_0x5de0('0x63')]=!![];}this['agents'][_0x17d987[_0x5de0('0x42')]]=_[_0x5de0('0x2f')](this['agents'][_0x17d987[_0x5de0('0x42')]],[_0x5de0('0x2a'),_0x5de0('0x44')]);logger[_0x5de0('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x17d987[_0x5de0('0x21')],util[_0x5de0('0x25')](this[_0x5de0('0x26')][_0x17d987[_0x5de0('0x21')]][_0x151b6b],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x5de0('0x26')][_0x17d987[_0x5de0('0x21')]][_0x151b6b]);logger['debug'](_0x5de0('0x64'),_0x17d987[_0x5de0('0x21')],util[_0x5de0('0x25')](this[_0x5de0('0x26')][_0x17d987['uniqueid']][_0x151b6b],{'showHidden':![],'depth':null}));this['emit'](util[_0x5de0('0x27')](_0x5de0('0x65'),_0x17d987[_0x5de0('0x35')]),_0x5de0('0x66'),this[_0x5de0('0x26')][_0x17d987[_0x5de0('0x21')]][_0x151b6b]);}}}}}}catch(_0x3aa28e){logger[_0x5de0('0x37')](_0x5de0('0x67'),_0x17d987['uniqueid'],util['inspect'](_0x3aa28e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5de0('0x1d')][_0x5de0('0x68')]=function(_0x24cf3c){try{if(this[_0x5de0('0x1e')](_0x24cf3c)){logger[_0x5de0('0x23')](_0x5de0('0x69'),_0x24cf3c[_0x5de0('0x21')],util[_0x5de0('0x25')](_0x24cf3c,{'showHidden':![],'depth':null}));this[_0x5de0('0x6a')](_0x24cf3c['uniqueid'],_['keys'](_0x24cf3c[_0x5de0('0x6b')])[0x0],_0x24cf3c['value']);if(this[_0x5de0('0x26')][_0x24cf3c[_0x5de0('0x21')]]){for(var _0x44bbb8 in this[_0x5de0('0x26')][_0x24cf3c[_0x5de0('0x21')]]){if(this[_0x5de0('0x26')][_0x24cf3c['uniqueid']][_0x5de0('0x3b')](_0x44bbb8)){logger[_0x5de0('0x20')](_0x5de0('0x6c'),_0x24cf3c[_0x5de0('0x21')],_0x44bbb8,_[_0x5de0('0x6d')](_0x24cf3c[_0x5de0('0x6b')])[0x0],_0x24cf3c[_0x5de0('0x6e')]);if(_[_0x5de0('0x1f')](this[_0x5de0('0x26')][_0x24cf3c[_0x5de0('0x21')]][_0x44bbb8][_0x5de0('0xc')])){this[_0x5de0('0x26')][_0x24cf3c['uniqueid']][_0x44bbb8][_0x5de0('0xc')]={};}this['channels'][_0x24cf3c[_0x5de0('0x21')]][_0x44bbb8]['variables']=this[_0x5de0('0xc')][_0x24cf3c['uniqueid']];}}}}}catch(_0x30a9c6){logger['error'](_0x5de0('0x6f'),_0x24cf3c[_0x5de0('0x21')],util[_0x5de0('0x25')](_0x30a9c6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5de0('0x1d')][_0x5de0('0x6a')]=function(_0x94ef10,_0x17dd9b,_0x4d643c){var _0x22de92=['rtpaudioqos',_0x5de0('0x70'),_0x5de0('0x71'),_0x5de0('0x72'),_0x5de0('0x73'),'rtpaudioqoslossbridged',_0x5de0('0x74'),_0x5de0('0x75'),_0x5de0('0x76'),_0x5de0('0x77'),'bridgepeer','bridgepvtcallid',_0x5de0('0x78'),_0x5de0('0x79'),_0x5de0('0x7a'),_0x5de0('0x7b'),'membername','memberpenalty',_0x5de0('0x7c')];if(!_[_0x5de0('0x7d')](_0x17dd9b)&&!_[_0x5de0('0x7e')](_0x22de92,_0x17dd9b)){if(_[_0x5de0('0x1f')](this[_0x5de0('0xc')][_0x94ef10])){this[_0x5de0('0xc')][_0x94ef10]={};}this['variables'][_0x94ef10][_0x17dd9b]=_0x4d643c;}};VoiceAgentReport[_0x5de0('0x1d')][_0x5de0('0x15')]=function(_0xf528fe){try{if(this[_0x5de0('0x1e')](_0xf528fe)){logger[_0x5de0('0x23')](_0x5de0('0x7f'),_0xf528fe[_0x5de0('0x21')],util['inspect'](_0xf528fe,{'showHidden':![],'depth':null}));if(this['channels'][_0xf528fe['uniqueid']]){for(var _0x205958 in this[_0x5de0('0x26')][_0xf528fe[_0x5de0('0x21')]]){if(this[_0x5de0('0x26')][_0xf528fe[_0x5de0('0x21')]]['hasOwnProperty'](_0x205958)){if(this['channels'][_0xf528fe[_0x5de0('0x21')]][_0x205958][_0x5de0('0x50')]==_0x5de0('0x5d')&&this['channels'][_0xf528fe[_0x5de0('0x21')]][_0x205958]['agentcomplete']){logger[_0x5de0('0x20')](_0x5de0('0x80'),_0xf528fe[_0x5de0('0x21')],_0x205958);this[_0x5de0('0x26')][_0xf528fe[_0x5de0('0x21')]][_0x205958][_0x5de0('0x5b')]=moment()[_0x5de0('0x27')](_0x5de0('0x28'));}}}logger[_0x5de0('0x23')](_0x5de0('0x81'),_0xf528fe[_0x5de0('0x21')],util[_0x5de0('0x25')](_[_0x5de0('0x82')](this['channels'][_0xf528fe[_0x5de0('0x21')]]),{'showHidden':![],'depth':null}));ami['emit'](_0x5de0('0x83'),_[_0x5de0('0x82')](this['channels'][_0xf528fe['uniqueid']]));delete this[_0x5de0('0x26')][_0xf528fe[_0x5de0('0x21')]];}if(this[_0x5de0('0xc')][_0xf528fe[_0x5de0('0x21')]]){delete this[_0x5de0('0xc')][_0xf528fe['uniqueid']];}}}catch(_0x47a5a1){logger[_0x5de0('0x37')](_0x5de0('0x84'),_0xf528fe['uniqueid'],util['inspect'](_0x47a5a1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5de0('0x1d')][_0x5de0('0x1a')]=function(_0x1bb069){try{if(this[_0x5de0('0x1e')](_0x1bb069)){logger[_0x5de0('0x23')](_0x5de0('0x85'),_0x1bb069[_0x5de0('0x21')],util['inspect'](_0x1bb069,{'showHidden':![],'depth':null}));if(this[_0x5de0('0x26')][_0x1bb069[_0x5de0('0x86')]]){for(var _0x102d58 in this['channels'][_0x1bb069['transfereeuniqueid']]){if(this['channels'][_0x1bb069[_0x5de0('0x86')]]['hasOwnProperty'](_0x102d58)){if(_0x1bb069[_0x5de0('0x87')]===_0x102d58){logger[_0x5de0('0x20')](_0x5de0('0x88'),_0x1bb069[_0x5de0('0x21')],this[_0x5de0('0x26')][_0x1bb069[_0x5de0('0x86')]][_0x102d58]['membername'],_0x102d58);var _0xa14d55=moment();this[_0x5de0('0x26')][_0x1bb069[_0x5de0('0x86')]][_0x102d58][_0x5de0('0x13')]=!![];this[_0x5de0('0x26')][_0x1bb069[_0x5de0('0x86')]][_0x102d58][_0x5de0('0x5b')]=moment()[_0x5de0('0x27')](_0x5de0('0x28'));this[_0x5de0('0x26')][_0x1bb069[_0x5de0('0x86')]][_0x102d58][_0x5de0('0x41')]=_0x5de0('0x5c');this[_0x5de0('0x26')][_0x1bb069[_0x5de0('0x86')]][_0x102d58]['reason']=_0x5de0('0x5d');this['channels'][_0x1bb069['transfereeuniqueid']][_0x102d58][_0x5de0('0x5f')]=_0xa14d55['diff'](this[_0x5de0('0x26')][_0x1bb069[_0x5de0('0x86')]][_0x102d58][_0x5de0('0x3d')],_0x5de0('0x89'));}}}}if(this[_0x5de0('0x26')][_0x1bb069['secondtransfereruniqueid']]){var _0x32cfcd=this[_0x5de0('0x26')][_0x1bb069['secondtransfereruniqueid']];this['channels'][_0x1bb069[_0x5de0('0x8a')]]=this[_0x5de0('0x26')][_0x1bb069['transfereeuniqueid']];this['channels'][_0x1bb069[_0x5de0('0x86')]]=_0x32cfcd;}}}catch(_0x284b65){logger[_0x5de0('0x37')]('[%s][voiceAgentReport][attendedtransfer]',_0x1bb069[_0x5de0('0x21')],util[_0x5de0('0x25')](_0x284b65,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5de0('0x8b')]=function(_0x6d3ec){try{if(this['isNotNull'](_0x6d3ec)){logger['debug'](_0x5de0('0x8c'),_0x6d3ec['uniqueid'],util['inspect'](_0x6d3ec,{'showHidden':![],'depth':null}));if(this[_0x5de0('0x26')][_0x6d3ec[_0x5de0('0x86')]]){for(var _0x51be48 in this[_0x5de0('0x26')][_0x6d3ec['transfereeuniqueid']]){if(this[_0x5de0('0x26')][_0x6d3ec[_0x5de0('0x86')]][_0x5de0('0x3b')](_0x51be48)){if(_0x6d3ec[_0x5de0('0x8d')]===_0x51be48){logger[_0x5de0('0x20')](_0x5de0('0x8e'),_0x6d3ec[_0x5de0('0x21')],this[_0x5de0('0x26')][_0x6d3ec[_0x5de0('0x86')]][_0x51be48][_0x5de0('0x35')],_0x51be48);var _0x2b732f=moment();this[_0x5de0('0x26')][_0x6d3ec[_0x5de0('0x86')]][_0x51be48][_0x5de0('0x13')]=!![];this[_0x5de0('0x26')][_0x6d3ec[_0x5de0('0x86')]][_0x51be48][_0x5de0('0x5b')]=_0x2b732f;this[_0x5de0('0x26')][_0x6d3ec[_0x5de0('0x86')]][_0x51be48][_0x5de0('0x41')]='complete';this[_0x5de0('0x26')][_0x6d3ec[_0x5de0('0x86')]][_0x51be48][_0x5de0('0x50')]=_0x5de0('0x5d');this['channels'][_0x6d3ec['transfereeuniqueid']][_0x51be48]['talktime']=_0x2b732f['diff'](this[_0x5de0('0x26')][_0x6d3ec['transfereeuniqueid']][_0x51be48][_0x5de0('0x3d')],_0x5de0('0x89'));}}}}}}catch(_0xe61578){logger[_0x5de0('0x37')]('[%s][voiceAgentReport][blindtransfer]',_0x6d3ec[_0x5de0('0x21')],util['inspect'](_0xe61578,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0x4eb37a){var _0x4f29dd='';try{if(this[_0x5de0('0x1e')](_0x4eb37a)){logger[_0x5de0('0x23')](_0x5de0('0x8f'),_0x4eb37a[_0x5de0('0x21')],util[_0x5de0('0x25')](_0x4eb37a,{'showHidden':![],'depth':null}));if(_0x4eb37a[_0x5de0('0x90')]){_0x4f29dd=_0x4eb37a[_0x5de0('0x90')]['substring'](0x0,_0x4eb37a[_0x5de0('0x90')][_0x5de0('0x91')]('-'));if(this[_0x5de0('0xb')][_0x4f29dd]){logger[_0x5de0('0x20')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x4eb37a['uniqueid'],_0x4f29dd);this[_0x5de0('0xb')][_0x4f29dd][_0x5de0('0x92')]=!![];}}}}catch(_0x3a77d0){logger[_0x5de0('0x37')]('[%s][voiceAgentReport][musiconholdstart]',_0x4eb37a[_0x5de0('0x21')],util[_0x5de0('0x25')](_0x3a77d0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5de0('0x1d')]['syncMusicOnHoldStop']=function(_0x1f2dcf){var _0x5d3d94='';try{if(this[_0x5de0('0x1e')](_0x1f2dcf)){logger['debug'](_0x5de0('0x93'),_0x1f2dcf[_0x5de0('0x21')],util[_0x5de0('0x25')](_0x1f2dcf,{'showHidden':![],'depth':null}));if(_0x1f2dcf['channel']){_0x5d3d94=_0x1f2dcf[_0x5de0('0x90')][_0x5de0('0x94')](0x0,_0x1f2dcf[_0x5de0('0x90')][_0x5de0('0x91')]('-'));if(this[_0x5de0('0xb')][_0x5d3d94]){logger[_0x5de0('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x1f2dcf['uniqueid'],_0x5d3d94);this[_0x5de0('0xb')][_0x5d3d94][_0x5de0('0x92')]=![];}}}}catch(_0x5e65b0){logger['error'](_0x5de0('0x95'),_0x1f2dcf[_0x5de0('0x21')],util['inspect'](_0x5e65b0,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xd6e4=['rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','membercalls','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','diff','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','voiceQueues','agents','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','isNotNull','isUndefined','syncAgentCalled','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','queue','type','inbound','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','emit','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','lastevent','connect','merge','interface','pick','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','destconnectedlinenum','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:%s','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','variable','value','keys','variables','[%s][voiceAgentReport][varset]'];(function(_0x33c638,_0x462bff){var _0x18a079=function(_0x336610){while(--_0x336610){_0x33c638['push'](_0x33c638['shift']());}};_0x18a079(++_0x462bff);}(_0xd6e4,0x1ed));var _0x4d6e=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xd6e4[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x4d6e('0x0'));var moment=require(_0x4d6e('0x1'));var util=require(_0x4d6e('0x2'));var Redis=require(_0x4d6e('0x3'));var config=require(_0x4d6e('0x4'));var logger=require('../../../config/logger')(_0x4d6e('0x5'));var ami=require(_0x4d6e('0x6'));config['redis']=_[_0x4d6e('0x7')](config[_0x4d6e('0x8')],{'host':_0x4d6e('0x9'),'port':0x18eb});var io=require(_0x4d6e('0xa'))(new Redis(config['redis']));function VoiceAgentReport(_0x42f6ee){this[_0x4d6e('0xb')]={};this[_0x4d6e('0xc')]=_0x42f6ee[_0x4d6e('0xc')];this[_0x4d6e('0xd')]=_0x42f6ee[_0x4d6e('0xd')];this['variables']={};ami['on']('agentcalled',this['syncAgentCalled'][_0x4d6e('0xe')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0x4d6e('0xe')](this));ami['on'](_0x4d6e('0xf'),this[_0x4d6e('0x10')][_0x4d6e('0xe')](this));ami['on'](_0x4d6e('0x11'),this[_0x4d6e('0x12')][_0x4d6e('0xe')](this));ami['on'](_0x4d6e('0x13'),this[_0x4d6e('0x14')][_0x4d6e('0xe')](this));ami['on']('varset',this[_0x4d6e('0x15')][_0x4d6e('0xe')](this));ami['on']('hangup',this[_0x4d6e('0x16')][_0x4d6e('0xe')](this));ami['on'](_0x4d6e('0x17'),this[_0x4d6e('0x18')][_0x4d6e('0xe')](this));ami['on'](_0x4d6e('0x19'),this[_0x4d6e('0x1a')][_0x4d6e('0xe')](this));ami['on'](_0x4d6e('0x1b'),this[_0x4d6e('0x1c')][_0x4d6e('0xe')](this));ami['on']('blindtransfer',this[_0x4d6e('0x1d')]['bind'](this));}VoiceAgentReport[_0x4d6e('0x1e')]['emit']=function(_0x5bf428,_0x2458f2,_0x42a8d7){io['to'](_0x5bf428)['emit'](_0x2458f2,_0x42a8d7);};VoiceAgentReport[_0x4d6e('0x1e')][_0x4d6e('0x1f')]=function(_0x83bda8){return _0x83bda8!==null&&!_[_0x4d6e('0x20')](_0x83bda8);};VoiceAgentReport[_0x4d6e('0x1e')][_0x4d6e('0x21')]=function(_0x5c1fb4){try{if(this[_0x4d6e('0x1f')](_0x5c1fb4)){logger['info']('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x5c1fb4[_0x4d6e('0x22')],_0x5c1fb4[_0x4d6e('0x23')],_0x5c1fb4[_0x4d6e('0x24')]);logger[_0x4d6e('0x25')](_0x4d6e('0x26'),_0x5c1fb4['uniqueid'],util[_0x4d6e('0x27')](_0x5c1fb4,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x4d6e('0xb')][_0x5c1fb4['uniqueid']])){this[_0x4d6e('0xb')][_0x5c1fb4[_0x4d6e('0x22')]]={};}if(_[_0x4d6e('0x20')](this[_0x4d6e('0xb')][_0x5c1fb4[_0x4d6e('0x22')]][_0x5c1fb4[_0x4d6e('0x24')]])){this[_0x4d6e('0xb')][_0x5c1fb4['uniqueid']][_0x5c1fb4[_0x4d6e('0x24')]]={'agentcalledAt':moment()[_0x4d6e('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','mandatoryDisposition':this[_0x4d6e('0xc')][_0x5c1fb4[_0x4d6e('0x29')]]?this[_0x4d6e('0xc')][_0x5c1fb4['queue']]['mandatoryDisposition']||![]:![],'type':this[_0x4d6e('0xc')][_0x5c1fb4['queue']]?this[_0x4d6e('0xc')][_0x5c1fb4[_0x4d6e('0x29')]][_0x4d6e('0x2a')]||_0x4d6e('0x2b'):'inbound','variables':this['variables'][_0x5c1fb4[_0x4d6e('0x22')]]};}_['merge'](this[_0x4d6e('0xb')][_0x5c1fb4[_0x4d6e('0x22')]][_0x5c1fb4[_0x4d6e('0x24')]],_[_0x4d6e('0x2c')](_0x5c1fb4,[_0x4d6e('0x2d'),_0x4d6e('0x2e')]));logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x5c1fb4[_0x4d6e('0x22')],util[_0x4d6e('0x27')](this[_0x4d6e('0xb')][_0x5c1fb4[_0x4d6e('0x22')]][_0x5c1fb4[_0x4d6e('0x24')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcalled',this[_0x4d6e('0xb')][_0x5c1fb4[_0x4d6e('0x22')]][_0x5c1fb4[_0x4d6e('0x24')]]);logger['debug'](_0x4d6e('0x2f'),_0x5c1fb4[_0x4d6e('0x22')],util['inspect'](this['channels'][_0x5c1fb4[_0x4d6e('0x22')]][_0x5c1fb4[_0x4d6e('0x24')]],{'showHidden':![],'depth':null}));this[_0x4d6e('0x30')](util[_0x4d6e('0x28')]('user:%s',_0x5c1fb4['membername']),_0x4d6e('0x31'),this['channels'][_0x5c1fb4[_0x4d6e('0x22')]][_0x5c1fb4['destuniqueid']]);}}catch(_0x58e5a6){logger[_0x4d6e('0x32')](_0x4d6e('0x33'),_0x5c1fb4['uniqueid'],util['inspect'](_0x58e5a6,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4d6e('0x34')]=function(_0x52dfbb){try{if(this['isNotNull'](_0x52dfbb)){if(this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]]){logger['debug'](_0x4d6e('0x35'),_0x52dfbb[_0x4d6e('0x22')],util['inspect'](_0x52dfbb,{'showHidden':![],'depth':null}));for(var _0x560bae in this['channels'][_0x52dfbb[_0x4d6e('0x22')]]){if(this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]][_0x4d6e('0x36')](_0x560bae)){if(_0x52dfbb[_0x4d6e('0x24')]===_0x560bae){logger[_0x4d6e('0x37')](_0x4d6e('0x38'),_0x52dfbb[_0x4d6e('0x22')],_0x52dfbb['membername'],_0x52dfbb[_0x4d6e('0x24')]);this['channels'][_0x52dfbb[_0x4d6e('0x22')]][_0x560bae][_0x4d6e('0x39')]=moment()[_0x4d6e('0x28')](_0x4d6e('0x3a'));this[_0x4d6e('0xb')][_0x52dfbb['uniqueid']][_0x560bae][_0x4d6e('0x3b')]=_0x52dfbb[_0x4d6e('0x3b')];this['channels'][_0x52dfbb['uniqueid']][_0x560bae]['connectedlinenum']=_0x52dfbb[_0x4d6e('0x3c')];this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]][_0x560bae]['destchannelstate']=_0x52dfbb[_0x4d6e('0x3d')];this[_0x4d6e('0xb')][_0x52dfbb['uniqueid']][_0x560bae]['destchannelstatedesc']=_0x52dfbb[_0x4d6e('0x3e')];this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]][_0x560bae]['holdtime']=_0x52dfbb['holdtime'];this['channels'][_0x52dfbb[_0x4d6e('0x22')]][_0x560bae][_0x4d6e('0x3f')]=_0x4d6e('0x40');_[_0x4d6e('0x41')](this[_0x4d6e('0xd')][_0x52dfbb[_0x4d6e('0x42')]],_[_0x4d6e('0x43')](_0x52dfbb,['queue','destconnectedlinenum']));logger[_0x4d6e('0x25')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x52dfbb['uniqueid'],util[_0x4d6e('0x27')](this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]][_0x52dfbb[_0x4d6e('0x24')]],{'showHidden':![],'depth':null}));ami['emit'](_0x4d6e('0x44'),this['channels'][_0x52dfbb[_0x4d6e('0x22')]][_0x52dfbb[_0x4d6e('0x24')]]);logger[_0x4d6e('0x25')](_0x4d6e('0x45'),_0x52dfbb[_0x4d6e('0x22')],util[_0x4d6e('0x27')](this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]][_0x52dfbb['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x4d6e('0x30')](util[_0x4d6e('0x28')]('user:%s',_0x52dfbb[_0x4d6e('0x23')]),'user:agentconnect',this['channels'][_0x52dfbb[_0x4d6e('0x22')]][_0x52dfbb['destuniqueid']]);}else if(!this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]][_0x560bae][_0x4d6e('0xf')]&&!this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]][_0x560bae]['agentcomplete']){logger[_0x4d6e('0x37')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x52dfbb[_0x4d6e('0x22')],this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]][_0x560bae]['membername'],_0x560bae);this[_0x4d6e('0xb')][_0x52dfbb['uniqueid']][_0x560bae][_0x4d6e('0xf')]=!![];this['channels'][_0x52dfbb['uniqueid']][_0x560bae][_0x4d6e('0x46')]=moment()[_0x4d6e('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]][_0x560bae][_0x4d6e('0x47')]=_0x52dfbb[_0x4d6e('0x24')];this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]][_0x560bae][_0x4d6e('0x48')]=_0x52dfbb[_0x4d6e('0x23')];this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]][_0x560bae][_0x4d6e('0x3f')]=_0x4d6e('0x49');this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]][_0x560bae][_0x4d6e('0x4a')]=_0x4d6e('0x49');logger[_0x4d6e('0x25')](_0x4d6e('0x4b'),_0x52dfbb['uniqueid'],util[_0x4d6e('0x27')](this[_0x4d6e('0xb')][_0x52dfbb[_0x4d6e('0x22')]][_0x560bae],{'showHidden':![],'depth':null}));ami[_0x4d6e('0x30')](_0x4d6e('0x4c'),this[_0x4d6e('0xb')][_0x52dfbb['uniqueid']][_0x560bae]);}}}}}}catch(_0x42896d){logger['error'](_0x4d6e('0x4d'),_0x52dfbb[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x42896d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4d6e('0x10')]=function(_0x29f6b2){try{if(this[_0x4d6e('0x1f')](_0x29f6b2)){logger[_0x4d6e('0x25')](_0x4d6e('0x4e'),_0x29f6b2[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x29f6b2,{'showHidden':![],'depth':null}));if(this[_0x4d6e('0xb')][_0x29f6b2[_0x4d6e('0x22')]]&&this['channels'][_0x29f6b2[_0x4d6e('0x22')]][_0x29f6b2['destuniqueid']]){logger[_0x4d6e('0x37')](_0x4d6e('0x4f'),_0x29f6b2[_0x4d6e('0x22')],_0x29f6b2['membername'],_0x29f6b2[_0x4d6e('0x24')]);this['channels'][_0x29f6b2[_0x4d6e('0x22')]][_0x29f6b2['destuniqueid']][_0x4d6e('0xf')]=!![];this['channels'][_0x29f6b2['uniqueid']][_0x29f6b2[_0x4d6e('0x24')]][_0x4d6e('0x46')]=moment()['format'](_0x4d6e('0x3a'));this[_0x4d6e('0xb')][_0x29f6b2[_0x4d6e('0x22')]][_0x29f6b2[_0x4d6e('0x24')]]['lastevent']=_0x4d6e('0x50');this['channels'][_0x29f6b2[_0x4d6e('0x22')]][_0x29f6b2[_0x4d6e('0x24')]]['reason']='rejected';logger[_0x4d6e('0x25')](_0x4d6e('0x51'),_0x29f6b2['uniqueid'],util[_0x4d6e('0x27')](this[_0x4d6e('0xb')][_0x29f6b2['uniqueid']][_0x29f6b2[_0x4d6e('0x24')]],{'showHidden':![],'depth':null}));ami[_0x4d6e('0x30')]('custom:agentringnoanswer',this[_0x4d6e('0xb')][_0x29f6b2[_0x4d6e('0x22')]][_0x29f6b2['destuniqueid']]);}}}catch(_0x22fd0c){logger[_0x4d6e('0x32')]('[%s][voiceAgentReport][agentringnoanswer]',_0x29f6b2[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x22fd0c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4d6e('0x1e')][_0x4d6e('0x12')]=function(_0x12d8e2){try{if(this['isNotNull'](_0x12d8e2)){logger[_0x4d6e('0x25')](_0x4d6e('0x52'),_0x12d8e2[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x12d8e2,{'showHidden':![],'depth':null}));if(this['channels'][_0x12d8e2['uniqueid']]){for(var _0xc95797 in this[_0x4d6e('0xb')][_0x12d8e2['uniqueid']]){if(this[_0x4d6e('0xb')][_0x12d8e2[_0x4d6e('0x22')]]['hasOwnProperty'](_0xc95797)&&!this[_0x4d6e('0xb')][_0x12d8e2[_0x4d6e('0x22')]][_0xc95797][_0x4d6e('0xf')]&&!this[_0x4d6e('0xb')][_0x12d8e2[_0x4d6e('0x22')]][_0xc95797][_0x4d6e('0x13')]){logger[_0x4d6e('0x37')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x12d8e2[_0x4d6e('0x22')],this[_0x4d6e('0xb')][_0x12d8e2['uniqueid']][_0xc95797][_0x4d6e('0x23')],_0xc95797);this[_0x4d6e('0xb')][_0x12d8e2[_0x4d6e('0x22')]][_0xc95797][_0x4d6e('0xf')]=!![];this['channels'][_0x12d8e2[_0x4d6e('0x22')]][_0xc95797]['agentringnoanswerAt']=moment()['format'](_0x4d6e('0x3a'));this[_0x4d6e('0xb')][_0x12d8e2[_0x4d6e('0x22')]][_0xc95797][_0x4d6e('0x3f')]=_0x4d6e('0x53');this[_0x4d6e('0xb')][_0x12d8e2[_0x4d6e('0x22')]][_0xc95797]['reason']=_0x4d6e('0x53');logger[_0x4d6e('0x25')](_0x4d6e('0x54'),_0x12d8e2['uniqueid'],util[_0x4d6e('0x27')](this['channels'][_0x12d8e2[_0x4d6e('0x22')]][_0xc95797],{'showHidden':![],'depth':null}));ami[_0x4d6e('0x30')](_0x4d6e('0x55'),this[_0x4d6e('0xb')][_0x12d8e2[_0x4d6e('0x22')]][_0xc95797]);}}}}}catch(_0x2c9d0b){logger[_0x4d6e('0x32')](_0x4d6e('0x56'),_0x12d8e2[_0x4d6e('0x22')],util['inspect'](_0x2c9d0b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4d6e('0x1e')][_0x4d6e('0x14')]=function(_0x34e953){try{if(this[_0x4d6e('0x1f')](_0x34e953)){logger[_0x4d6e('0x25')](_0x4d6e('0x57'),_0x34e953[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x34e953,{'showHidden':![],'depth':null}));if(this[_0x4d6e('0xb')][_0x34e953[_0x4d6e('0x22')]]){for(var _0x51772a in this[_0x4d6e('0xb')][_0x34e953[_0x4d6e('0x22')]]){if(this[_0x4d6e('0xb')][_0x34e953[_0x4d6e('0x22')]][_0x4d6e('0x36')](_0x51772a)){if(this['channels'][_0x34e953[_0x4d6e('0x22')]][_0x51772a][_0x4d6e('0x39')]&&!this[_0x4d6e('0xb')][_0x34e953[_0x4d6e('0x22')]][_0x51772a][_0x4d6e('0x13')]){logger[_0x4d6e('0x37')](_0x4d6e('0x58'),_0x34e953['uniqueid'],this[_0x4d6e('0xb')][_0x34e953[_0x4d6e('0x22')]][_0x51772a]['membername'],_0x51772a);this[_0x4d6e('0xb')][_0x34e953[_0x4d6e('0x22')]][_0x51772a]['agentcomplete']=!![];this[_0x4d6e('0xb')][_0x34e953[_0x4d6e('0x22')]][_0x51772a][_0x4d6e('0x59')]=moment()[_0x4d6e('0x28')](_0x4d6e('0x3a'));this[_0x4d6e('0xb')][_0x34e953[_0x4d6e('0x22')]][_0x51772a][_0x4d6e('0x3f')]=_0x4d6e('0x5a');this[_0x4d6e('0xb')][_0x34e953['uniqueid']][_0x51772a]['reason']=_0x34e953[_0x4d6e('0x4a')]==_0x4d6e('0x5b')?_0x4d6e('0x5c'):_0x34e953[_0x4d6e('0x4a')];this[_0x4d6e('0xb')][_0x34e953[_0x4d6e('0x22')]][_0x51772a][_0x4d6e('0x5d')]=_0x34e953[_0x4d6e('0x5d')];if(this[_0x4d6e('0xc')][_0x34e953['queue']]&&this[_0x4d6e('0xc')][_0x34e953[_0x4d6e('0x29')]][_0x4d6e('0x5e')]){this[_0x4d6e('0xb')][_0x34e953[_0x4d6e('0x22')]][_0x51772a][_0x4d6e('0x5f')]=this['voiceQueues'][_0x34e953[_0x4d6e('0x29')]][_0x4d6e('0x60')];this['channels'][_0x34e953[_0x4d6e('0x22')]][_0x51772a][_0x4d6e('0x61')]=!![];}this['agents'][_0x34e953[_0x4d6e('0x42')]]=_[_0x4d6e('0x2c')](this[_0x4d6e('0xd')][_0x34e953[_0x4d6e('0x42')]],[_0x4d6e('0x29'),_0x4d6e('0x62')]);logger[_0x4d6e('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x34e953['uniqueid'],util[_0x4d6e('0x27')](this[_0x4d6e('0xb')][_0x34e953['uniqueid']][_0x51772a],{'showHidden':![],'depth':null}));ami[_0x4d6e('0x30')](_0x4d6e('0x63'),this['channels'][_0x34e953[_0x4d6e('0x22')]][_0x51772a]);logger['debug'](_0x4d6e('0x64'),_0x34e953[_0x4d6e('0x22')],util[_0x4d6e('0x27')](this['channels'][_0x34e953[_0x4d6e('0x22')]][_0x51772a],{'showHidden':![],'depth':null}));this[_0x4d6e('0x30')](util[_0x4d6e('0x28')](_0x4d6e('0x65'),_0x34e953[_0x4d6e('0x23')]),_0x4d6e('0x66'),this[_0x4d6e('0xb')][_0x34e953[_0x4d6e('0x22')]][_0x51772a]);}}}}}}catch(_0x1c208b){logger[_0x4d6e('0x32')](_0x4d6e('0x67'),_0x34e953['uniqueid'],util['inspect'](_0x1c208b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4d6e('0x15')]=function(_0x2e9517){try{if(this[_0x4d6e('0x1f')](_0x2e9517)){logger[_0x4d6e('0x25')](_0x4d6e('0x68'),_0x2e9517[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x2e9517,{'showHidden':![],'depth':null}));this[_0x4d6e('0x69')](_0x2e9517[_0x4d6e('0x22')],_['keys'](_0x2e9517[_0x4d6e('0x6a')])[0x0],_0x2e9517[_0x4d6e('0x6b')]);if(this[_0x4d6e('0xb')][_0x2e9517['uniqueid']]){for(var _0xf9cef0 in this['channels'][_0x2e9517['uniqueid']]){if(this['channels'][_0x2e9517['uniqueid']][_0x4d6e('0x36')](_0xf9cef0)){logger[_0x4d6e('0x37')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x2e9517['uniqueid'],_0xf9cef0,_[_0x4d6e('0x6c')](_0x2e9517[_0x4d6e('0x6a')])[0x0],_0x2e9517[_0x4d6e('0x6b')]);if(_['isUndefined'](this[_0x4d6e('0xb')][_0x2e9517['uniqueid']][_0xf9cef0]['variables'])){this[_0x4d6e('0xb')][_0x2e9517[_0x4d6e('0x22')]][_0xf9cef0][_0x4d6e('0x6d')]={};}this[_0x4d6e('0xb')][_0x2e9517[_0x4d6e('0x22')]][_0xf9cef0][_0x4d6e('0x6d')]=this['variables'][_0x2e9517[_0x4d6e('0x22')]];}}}}}catch(_0x14c16a){logger[_0x4d6e('0x32')](_0x4d6e('0x6e'),_0x2e9517[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x14c16a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0xce2e23,_0xd1ae87,_0xc77c1a){var _0x275b89=['rtpaudioqos','rtpaudioqosbridged',_0x4d6e('0x6f'),_0x4d6e('0x70'),_0x4d6e('0x71'),_0x4d6e('0x72'),_0x4d6e('0x73'),_0x4d6e('0x74'),_0x4d6e('0x75'),'sipuri',_0x4d6e('0x76'),'bridgepvtcallid',_0x4d6e('0x77'),'memberdynamic',_0x4d6e('0x78'),'memberlastcall',_0x4d6e('0x23'),_0x4d6e('0x79'),_0x4d6e('0x7a')];if(!_[_0x4d6e('0x7b')](_0xd1ae87)&&!_[_0x4d6e('0x7c')](_0x275b89,_0xd1ae87)){if(_[_0x4d6e('0x20')](this[_0x4d6e('0x6d')][_0xce2e23])){this[_0x4d6e('0x6d')][_0xce2e23]={};}this[_0x4d6e('0x6d')][_0xce2e23][_0xd1ae87]=_0xc77c1a;}};VoiceAgentReport[_0x4d6e('0x1e')][_0x4d6e('0x16')]=function(_0x47d28f){try{if(this[_0x4d6e('0x1f')](_0x47d28f)){logger[_0x4d6e('0x25')](_0x4d6e('0x7d'),_0x47d28f[_0x4d6e('0x22')],util['inspect'](_0x47d28f,{'showHidden':![],'depth':null}));if(this[_0x4d6e('0xb')][_0x47d28f[_0x4d6e('0x22')]]){for(var _0x3d763a in this[_0x4d6e('0xb')][_0x47d28f[_0x4d6e('0x22')]]){if(this[_0x4d6e('0xb')][_0x47d28f[_0x4d6e('0x22')]]['hasOwnProperty'](_0x3d763a)){if(this[_0x4d6e('0xb')][_0x47d28f[_0x4d6e('0x22')]][_0x3d763a][_0x4d6e('0x4a')]=='transfer'&&this[_0x4d6e('0xb')][_0x47d28f[_0x4d6e('0x22')]][_0x3d763a][_0x4d6e('0x13')]){logger[_0x4d6e('0x37')](_0x4d6e('0x7e'),_0x47d28f[_0x4d6e('0x22')],_0x3d763a);this[_0x4d6e('0xb')][_0x47d28f['uniqueid']][_0x3d763a]['agentcompleteAt']=moment()[_0x4d6e('0x28')](_0x4d6e('0x3a'));}}}logger[_0x4d6e('0x25')](_0x4d6e('0x7f'),_0x47d28f[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_[_0x4d6e('0x80')](this['channels'][_0x47d28f[_0x4d6e('0x22')]]),{'showHidden':![],'depth':null}));ami[_0x4d6e('0x30')](_0x4d6e('0x81'),_[_0x4d6e('0x80')](this[_0x4d6e('0xb')][_0x47d28f[_0x4d6e('0x22')]]));delete this[_0x4d6e('0xb')][_0x47d28f['uniqueid']];}if(this[_0x4d6e('0x6d')][_0x47d28f[_0x4d6e('0x22')]]){delete this[_0x4d6e('0x6d')][_0x47d28f[_0x4d6e('0x22')]];}}}catch(_0x364f0f){logger[_0x4d6e('0x32')](_0x4d6e('0x82'),_0x47d28f[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x364f0f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4d6e('0x1e')][_0x4d6e('0x1c')]=function(_0x5c2adc){try{if(this['isNotNull'](_0x5c2adc)){logger[_0x4d6e('0x25')](_0x4d6e('0x83'),_0x5c2adc[_0x4d6e('0x22')],util['inspect'](_0x5c2adc,{'showHidden':![],'depth':null}));if(this['channels'][_0x5c2adc[_0x4d6e('0x84')]]){for(var _0x1cc290 in this[_0x4d6e('0xb')][_0x5c2adc[_0x4d6e('0x84')]]){if(this[_0x4d6e('0xb')][_0x5c2adc[_0x4d6e('0x84')]]['hasOwnProperty'](_0x1cc290)){if(_0x5c2adc[_0x4d6e('0x85')]===_0x1cc290){logger['info'](_0x4d6e('0x86'),_0x5c2adc[_0x4d6e('0x22')],this[_0x4d6e('0xb')][_0x5c2adc['transfereeuniqueid']][_0x1cc290][_0x4d6e('0x23')],_0x1cc290);var _0x2167b9=moment();this[_0x4d6e('0xb')][_0x5c2adc[_0x4d6e('0x84')]][_0x1cc290][_0x4d6e('0x13')]=!![];this[_0x4d6e('0xb')][_0x5c2adc[_0x4d6e('0x84')]][_0x1cc290][_0x4d6e('0x59')]=moment()[_0x4d6e('0x28')](_0x4d6e('0x3a'));this['channels'][_0x5c2adc['transfereeuniqueid']][_0x1cc290][_0x4d6e('0x3f')]='complete';this[_0x4d6e('0xb')][_0x5c2adc[_0x4d6e('0x84')]][_0x1cc290][_0x4d6e('0x4a')]='transfer';this[_0x4d6e('0xb')][_0x5c2adc[_0x4d6e('0x84')]][_0x1cc290][_0x4d6e('0x5d')]=_0x2167b9['diff'](this[_0x4d6e('0xb')][_0x5c2adc[_0x4d6e('0x84')]][_0x1cc290][_0x4d6e('0x39')],_0x4d6e('0x87'));}}}}if(this['channels'][_0x5c2adc[_0x4d6e('0x88')]]){var _0x4ba7b2=this[_0x4d6e('0xb')][_0x5c2adc[_0x4d6e('0x88')]];this[_0x4d6e('0xb')][_0x5c2adc[_0x4d6e('0x88')]]=this['channels'][_0x5c2adc[_0x4d6e('0x84')]];this['channels'][_0x5c2adc[_0x4d6e('0x84')]]=_0x4ba7b2;}}}catch(_0x17f879){logger['error'](_0x4d6e('0x89'),_0x5c2adc[_0x4d6e('0x22')],util['inspect'](_0x17f879,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4d6e('0x1e')][_0x4d6e('0x1d')]=function(_0x3f2cf2){try{if(this[_0x4d6e('0x1f')](_0x3f2cf2)){logger[_0x4d6e('0x25')](_0x4d6e('0x8a'),_0x3f2cf2[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x3f2cf2,{'showHidden':![],'depth':null}));if(this[_0x4d6e('0xb')][_0x3f2cf2['transfereeuniqueid']]){for(var _0x409cf3 in this[_0x4d6e('0xb')][_0x3f2cf2['transfereeuniqueid']]){if(this['channels'][_0x3f2cf2[_0x4d6e('0x84')]][_0x4d6e('0x36')](_0x409cf3)){if(_0x3f2cf2[_0x4d6e('0x8b')]===_0x409cf3){logger[_0x4d6e('0x37')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3f2cf2['uniqueid'],this[_0x4d6e('0xb')][_0x3f2cf2[_0x4d6e('0x84')]][_0x409cf3][_0x4d6e('0x23')],_0x409cf3);var _0x11a213=moment();this[_0x4d6e('0xb')][_0x3f2cf2[_0x4d6e('0x84')]][_0x409cf3][_0x4d6e('0x13')]=!![];this['channels'][_0x3f2cf2[_0x4d6e('0x84')]][_0x409cf3][_0x4d6e('0x59')]=_0x11a213;this[_0x4d6e('0xb')][_0x3f2cf2[_0x4d6e('0x84')]][_0x409cf3]['lastevent']=_0x4d6e('0x5a');this[_0x4d6e('0xb')][_0x3f2cf2[_0x4d6e('0x84')]][_0x409cf3]['reason']=_0x4d6e('0x5b');this[_0x4d6e('0xb')][_0x3f2cf2['transfereeuniqueid']][_0x409cf3][_0x4d6e('0x5d')]=_0x11a213[_0x4d6e('0x8c')](this[_0x4d6e('0xb')][_0x3f2cf2[_0x4d6e('0x84')]][_0x409cf3][_0x4d6e('0x39')],_0x4d6e('0x87'));}}}}}}catch(_0x2d576f){logger[_0x4d6e('0x32')](_0x4d6e('0x8d'),_0x3f2cf2[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x2d576f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0x407590){var _0x54debb='';try{if(this['isNotNull'](_0x407590)){logger[_0x4d6e('0x25')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x407590[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x407590,{'showHidden':![],'depth':null}));if(_0x407590[_0x4d6e('0x8e')]){_0x54debb=_0x407590[_0x4d6e('0x8e')][_0x4d6e('0x8f')](0x0,_0x407590[_0x4d6e('0x8e')][_0x4d6e('0x90')]('-'));if(this[_0x4d6e('0xd')][_0x54debb]){logger['info'](_0x4d6e('0x91'),_0x407590[_0x4d6e('0x22')],_0x54debb);this[_0x4d6e('0xd')][_0x54debb][_0x4d6e('0x92')]=!![];}}}}catch(_0x87c1a){logger['error'](_0x4d6e('0x93'),_0x407590[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x87c1a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4d6e('0x1e')][_0x4d6e('0x1a')]=function(_0x4dbf55){var _0x56d7be='';try{if(this['isNotNull'](_0x4dbf55)){logger[_0x4d6e('0x25')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x4dbf55[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x4dbf55,{'showHidden':![],'depth':null}));if(_0x4dbf55[_0x4d6e('0x8e')]){_0x56d7be=_0x4dbf55[_0x4d6e('0x8e')]['substring'](0x0,_0x4dbf55[_0x4d6e('0x8e')]['lastIndexOf']('-'));if(this[_0x4d6e('0xd')][_0x56d7be]){logger[_0x4d6e('0x37')](_0x4d6e('0x94'),_0x4dbf55[_0x4d6e('0x22')],_0x56d7be);this[_0x4d6e('0xd')][_0x56d7be]['onhold']=![];}}}}catch(_0x375ac4){logger[_0x4d6e('0x32')](_0x4d6e('0x95'),_0x4dbf55[_0x4d6e('0x22')],util[_0x4d6e('0x27')](_0x375ac4,{'showHidden':![],'depth':null}));}};module[_0x4d6e('0x96')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index eedc4df..cd68ee3 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 _0xf492=['dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','localhost','socket.io-emitter','channels','agents','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','syncNewCallerId','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','merge','pick','keys','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','exten','format','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','from-sip','channel','split','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:%s','name','user:agentconnect','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','starttime','duration','subtract','seconds','disposition','includes','lastapplication','startsWith','cdr(','match','queue','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','linkedid','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','xcally-motion-preview','connectedlinenum','destinationchannel','UserId','membername','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','replace','.wav49','.WAV','monitorFilename','find','monitors','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','mixmonitor_filename','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','diff','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','transferType','undefined','isEmpty','getSettings','then','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','blindTransfers','type','outbound','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','ATTENDED','syncBlindTransfer','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','bluebird','moment','util','../../../config/environment','../../../config/logger','ami','../ami','not_inuse','busy','invalid','ringing','onhold','set','agi'];(function(_0x4a2fde,_0x190c2f){var _0x52ab47=function(_0x28f4d5){while(--_0x28f4d5){_0x4a2fde['push'](_0x4a2fde['shift']());}};_0x52ab47(++_0x190c2f);}(_0xf492,0xb2));var _0x2f49=function(_0x4481e2,_0x378e2d){_0x4481e2=_0x4481e2-0x0;var _0x1fac47=_0xf492[_0x4481e2];return _0x1fac47;};'use strict';var BPromise=require(_0x2f49('0x0'));var _=require('lodash');var moment=require(_0x2f49('0x1'));var util=require(_0x2f49('0x2'));var path=require('path');var Redis=require('ioredis');var config=require(_0x2f49('0x3'));var logger=require(_0x2f49('0x4'))(_0x2f49('0x5'));var ami=require(_0x2f49('0x6'));var Channel=require('../model/channel');var RpcSetting=require('../rpc/setting');var statusDesc=['unknown',_0x2f49('0x7'),'inuse',_0x2f49('0x8'),_0x2f49('0x9'),'unavailable',_0x2f49('0xa'),'ringinuse',_0x2f49('0xb')];var applications=[_0x2f49('0xc'),'queue',_0x2f49('0xd'),_0x2f49('0xe'),'playback',_0x2f49('0xf')];var dispositions=[_0x2f49('0x10'),_0x2f49('0x11'),_0x2f49('0x11'),'NO\x20ANSWER',_0x2f49('0x10'),_0x2f49('0x10'),_0x2f49('0x12'),'BUSY','FAILED','FAILED',_0x2f49('0x11')];var actions={};config[_0x2f49('0x13')]=_[_0x2f49('0x14')](config[_0x2f49('0x13')],{'host':_0x2f49('0x15'),'port':0x18eb});var io=require(_0x2f49('0x16'))(new Redis(config[_0x2f49('0x13')]));function VoiceCallReport(_0x5195dd){this['channels']=_0x5195dd[_0x2f49('0x17')];this[_0x2f49('0x18')]=_0x5195dd[_0x2f49('0x18')];this['blindTransfers']={};ami['on']('coreshowchannel',this[_0x2f49('0x19')][_0x2f49('0x1a')](this));ami['on'](_0x2f49('0x1b'),this[_0x2f49('0x19')]['bind'](this));ami['on'](_0x2f49('0x1c'),this[_0x2f49('0x1d')][_0x2f49('0x1a')](this));ami['on'](_0x2f49('0x1e'),this[_0x2f49('0x1f')][_0x2f49('0x1a')](this));ami['on'](_0x2f49('0x20'),this[_0x2f49('0x21')][_0x2f49('0x1a')](this));ami['on'](_0x2f49('0x22'),this[_0x2f49('0x23')][_0x2f49('0x1a')](this));ami['on'](_0x2f49('0x24'),this['syncNewCallerId'][_0x2f49('0x1a')](this));ami['on'](_0x2f49('0x25'),this[_0x2f49('0x26')][_0x2f49('0x1a')](this));ami['on'](_0x2f49('0x27'),this['syncBlindTransfer'][_0x2f49('0x1a')](this));ami['on'](_0x2f49('0x28'),this[_0x2f49('0x29')][_0x2f49('0x1a')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x2f49('0x1a')](this));try{logger[_0x2f49('0x2a')](_0x2f49('0x2b'));ami['actionCoreShowChannels']();}catch(_0x1d4c25){logger[_0x2f49('0x2c')](_0x2f49('0x2d'),util[_0x2f49('0x2e')](_0x1d4c25,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x2f49('0x2f')][_0x2f49('0x30')]=function(_0x21143a){return _0x21143a!==null&&!_[_0x2f49('0x31')](_0x21143a);};VoiceCallReport['prototype']['emit']=function(_0x3e5587,_0x2205ec,_0x518678){io['to'](_0x3e5587)[_0x2f49('0x32')](_0x2205ec,_0x518678);};VoiceCallReport[_0x2f49('0x2f')][_0x2f49('0x33')]=function(_0x1c4db1){try{if(this[_0x2f49('0x30')](_0x1c4db1)){logger[_0x2f49('0x2a')](_0x2f49('0x34'),_0x1c4db1[_0x2f49('0x35')],_0x1c4db1[_0x2f49('0x36')],_0x1c4db1['calleridnum']);logger[_0x2f49('0x37')](_0x2f49('0x38'),_0x1c4db1[_0x2f49('0x35')],util[_0x2f49('0x2e')](_0x1c4db1,{'showHidden':![],'depth':null}));if(_0x1c4db1[_0x2f49('0x35')]===_0x1c4db1['linkedid']){if(!_[_0x2f49('0x31')](this[_0x2f49('0x17')][_0x1c4db1['uniqueid']])){_[_0x2f49('0x39')](this[_0x2f49('0x17')][_0x1c4db1[_0x2f49('0x35')]],_[_0x2f49('0x3a')](_0x1c4db1,_[_0x2f49('0x3b')](this[_0x2f49('0x17')][_0x1c4db1[_0x2f49('0x35')]])));}}}}catch(_0x5d2226){logger[_0x2f49('0x2c')]('[%s][voiceCallReport][newcallerid]',_0x1c4db1[_0x2f49('0x35')],util['inspect'](_0x5d2226,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2f49('0x2f')][_0x2f49('0x1d')]=function(_0x5232aa){try{if(this[_0x2f49('0x30')](_0x5232aa)){logger[_0x2f49('0x37')]('[%s][voiceCallReport][newchannel]\x20event:',_0x5232aa[_0x2f49('0x35')],util[_0x2f49('0x2e')](_0x5232aa,{'showHidden':![],'depth':null}));if(_0x5232aa[_0x2f49('0x35')]===_0x5232aa['linkedid']&&_0x5232aa['channel']!=_0x2f49('0x3c')){if(_[_0x2f49('0x31')](this['channels'][_0x5232aa[_0x2f49('0x35')]])){logger[_0x2f49('0x2a')](_0x2f49('0x3d'),_0x5232aa[_0x2f49('0x35')],_0x5232aa[_0x2f49('0x3e')],_0x5232aa[_0x2f49('0x3f')]);this['channels'][_0x5232aa['uniqueid']]=new Channel();this['channels'][_0x5232aa[_0x2f49('0x35')]]['starttime']=moment()[_0x2f49('0x40')](_0x2f49('0x41'));this[_0x2f49('0x17')][_0x5232aa[_0x2f49('0x35')]]['disposition']=dispositions[_[_0x2f49('0x42')](_0x5232aa[_0x2f49('0x43')])];_['merge'](this[_0x2f49('0x17')][_0x5232aa[_0x2f49('0x35')]],_[_0x2f49('0x3a')](_0x5232aa,_[_0x2f49('0x3b')](this['channels'][_0x5232aa[_0x2f49('0x35')]])));if(_0x5232aa[_0x2f49('0x3e')]===_0x2f49('0x44')){if(this['agents'][_0x5232aa[_0x2f49('0x45')][_0x2f49('0x46')]('-')[0x0]]){this[_0x2f49('0x18')][_0x5232aa[_0x2f49('0x45')][_0x2f49('0x46')]('-')[0x0]][_0x2f49('0x47')]=_0x5232aa[_0x2f49('0x3f')];logger[_0x2f49('0x37')](_0x2f49('0x48'),_0x5232aa[_0x2f49('0x35')],util[_0x2f49('0x2e')]({'destaccountcode':this[_0x2f49('0x18')][_0x5232aa[_0x2f49('0x45')][_0x2f49('0x46')]('-')[0x0]][_0x2f49('0x49')],'destconnectedlinenum':_0x5232aa[_0x2f49('0x3f')]},{'showHidden':![],'depth':null}));this[_0x2f49('0x32')](util['format'](_0x2f49('0x4a'),this[_0x2f49('0x18')][_0x5232aa[_0x2f49('0x45')][_0x2f49('0x46')]('-')[0x0]][_0x2f49('0x4b')]),_0x2f49('0x4c'),{'destaccountcode':this[_0x2f49('0x18')][_0x5232aa['channel'][_0x2f49('0x46')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5232aa[_0x2f49('0x3f')]});}}}}}}catch(_0x449828){logger[_0x2f49('0x2c')](_0x2f49('0x4d'),_0x5232aa['uniqueid'],util[_0x2f49('0x2e')](_0x449828,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2f49('0x2f')][_0x2f49('0x19')]=function(_0x2e7fb0){try{if(this[_0x2f49('0x30')](_0x2e7fb0)){logger['debug']('[%s][voiceCallReport][newexten]\x20event:',_0x2e7fb0['uniqueid'],util[_0x2f49('0x2e')](_0x2e7fb0,{'showHidden':![],'depth':null}));if(_0x2e7fb0[_0x2f49('0x35')]===_0x2e7fb0['linkedid']&&_0x2e7fb0[_0x2f49('0x3f')]!='h'&&_0x2e7fb0['channel']!=_0x2f49('0x3c')){_0x2e7fb0['application']=_0x2e7fb0[_0x2f49('0x4e')][_0x2f49('0x4f')]();_0x2e7fb0[_0x2f49('0x50')]=(_0x2e7fb0['appdata']||_0x2e7fb0['applicationdata'])[_0x2f49('0x4f')]();logger[_0x2f49('0x2a')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x2e7fb0[_0x2f49('0x35')],_0x2e7fb0[_0x2f49('0x4e')],_0x2e7fb0[_0x2f49('0x50')]);if(_[_0x2f49('0x31')](this['channels'][_0x2e7fb0[_0x2f49('0x35')]])){this[_0x2f49('0x17')][_0x2e7fb0[_0x2f49('0x35')]]=new Channel();this[_0x2f49('0x17')][_0x2e7fb0[_0x2f49('0x35')]][_0x2f49('0x51')]=_0x2e7fb0[_0x2f49('0x52')]?moment()[_0x2f49('0x53')](moment[_0x2f49('0x52')](_0x2e7fb0[_0x2f49('0x52')])[_0x2f49('0x54')](),_0x2f49('0x54'))[_0x2f49('0x40')](_0x2f49('0x41')):moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x2f49('0x17')][_0x2e7fb0[_0x2f49('0x35')]][_0x2f49('0x55')]='NO\x20ANSWER';}_['merge'](this[_0x2f49('0x17')][_0x2e7fb0['uniqueid']],_[_0x2f49('0x3a')](_0x2e7fb0,_[_0x2f49('0x3b')](this['channels'][_0x2e7fb0['uniqueid']])));if(_[_0x2f49('0x56')](applications,_0x2e7fb0[_0x2f49('0x4e')])){this[_0x2f49('0x17')][_0x2e7fb0[_0x2f49('0x35')]][_0x2f49('0x57')]=_0x2e7fb0['application'];this['channels'][_0x2e7fb0['uniqueid']]['lastdata']=_0x2e7fb0[_0x2f49('0x50')];if(_0x2e7fb0[_0x2f49('0x4e')]===_0x2f49('0xc')&&_[_0x2f49('0x58')](_0x2e7fb0[_0x2f49('0x50')],_0x2f49('0x59'))){var _0x48b302=_0x2e7fb0[_0x2f49('0x50')][_0x2f49('0x46')]('=');var _0x112274=_0x48b302[0x0][_0x2f49('0x5a')](/cdr\((.*)\)/);if(_0x112274){this[_0x2f49('0x17')][_0x2e7fb0['uniqueid']][_0x112274[0x1]]=_0x48b302[0x1];}}else if(_0x2e7fb0[_0x2f49('0x4e')]===_0x2f49('0x5b')){this[_0x2f49('0x17')][_0x2e7fb0[_0x2f49('0x35')]][_0x2f49('0x5b')]=_0x2e7fb0[_0x2f49('0x50')][_0x2f49('0x46')](',')[0x0];}}}}}catch(_0x22f940){logger[_0x2f49('0x2c')]('[%s][voiceCallReport][newexten]',_0x2e7fb0[_0x2f49('0x35')],util[_0x2f49('0x2e')](_0x22f940,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2f49('0x2f')]['syncNewState']=function(_0x20da92){try{if(this[_0x2f49('0x30')](_0x20da92)){logger['info'](_0x2f49('0x5c'),_0x20da92[_0x2f49('0x35')],_0x20da92[_0x2f49('0x5d')],_0x20da92[_0x2f49('0x36')],_0x20da92[_0x2f49('0x5e')]);logger[_0x2f49('0x37')](_0x2f49('0x5f'),_0x20da92['uniqueid'],util[_0x2f49('0x2e')](_0x20da92,{'showHidden':![],'depth':null}));if(_0x20da92[_0x2f49('0x35')]!==_0x20da92[_0x2f49('0x5d')]){if(this[_0x2f49('0x17')][_0x20da92[_0x2f49('0x5d')]]){if(_0x20da92[_0x2f49('0x43')]==='6'){if(!this[_0x2f49('0x17')][_0x20da92[_0x2f49('0x5d')]][_0x2f49('0x60')]){var _0x22eea8=moment();this[_0x2f49('0x17')][_0x20da92['linkedid']]['answered']=!![];this[_0x2f49('0x17')][_0x20da92[_0x2f49('0x5d')]][_0x2f49('0x61')]=_0x22eea8[_0x2f49('0x40')](_0x2f49('0x41'));if(this['channels'][_0x20da92['linkedid']]['starttime']){this[_0x2f49('0x17')][_0x20da92['linkedid']][_0x2f49('0x62')]=_0x22eea8['diff'](this[_0x2f49('0x17')][_0x20da92[_0x2f49('0x5d')]][_0x2f49('0x51')],_0x2f49('0x54'));}}this[_0x2f49('0x17')][_0x20da92[_0x2f49('0x5d')]][_0x2f49('0x5d')]=_0x20da92[_0x2f49('0x35')];if(_0x20da92[_0x2f49('0x5e')]!==_0x2f49('0x63')){this[_0x2f49('0x17')][_0x20da92[_0x2f49('0x5d')]][_0x2f49('0x64')]=_0x20da92[_0x2f49('0x5e')];}this[_0x2f49('0x17')][_0x20da92[_0x2f49('0x5d')]]['connectedlinename']=_0x20da92['calleridname'];this[_0x2f49('0x17')][_0x20da92['linkedid']][_0x2f49('0x65')]=_0x20da92[_0x2f49('0x45')];this[_0x2f49('0x17')][_0x20da92[_0x2f49('0x5d')]][_0x2f49('0x55')]=dispositions[_[_0x2f49('0x42')](_0x20da92[_0x2f49('0x43')])];if(this['agents'][_0x20da92['channel']['split']('-')[0x0]]){this[_0x2f49('0x17')][_0x20da92[_0x2f49('0x5d')]][_0x2f49('0x66')]=this['agents'][_0x20da92[_0x2f49('0x45')][_0x2f49('0x46')]('-')[0x0]]['id'];this[_0x2f49('0x17')][_0x20da92['linkedid']][_0x2f49('0x67')]=this[_0x2f49('0x18')][_0x20da92['channel']['split']('-')[0x0]]['name'];}}}}else{if(this[_0x2f49('0x17')][_0x20da92[_0x2f49('0x35')]]){if(_0x20da92[_0x2f49('0x43')]==='6'){if(this[_0x2f49('0x18')][_0x20da92[_0x2f49('0x45')][_0x2f49('0x46')]('-')[0x0]]){this['channels'][_0x20da92[_0x2f49('0x35')]][_0x2f49('0x66')]=this[_0x2f49('0x18')][_0x20da92[_0x2f49('0x45')][_0x2f49('0x46')]('-')[0x0]]['id'];this[_0x2f49('0x17')][_0x20da92[_0x2f49('0x35')]][_0x2f49('0x67')]=this[_0x2f49('0x18')][_0x20da92[_0x2f49('0x45')]['split']('-')[0x0]][_0x2f49('0x4b')];}}}}}}catch(_0x4bec52){logger['error'](_0x2f49('0x68'),_0x20da92['uniqueid'],util[_0x2f49('0x2e')](_0x4bec52,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x2f49('0x69')]=function(_0x9863d5,_0x575262){try{if(this[_0x2f49('0x17')][_0x9863d5]){logger[_0x2f49('0x2a')](_0x2f49('0x6a'),_0x9863d5,_0x575262);this[_0x2f49('0x17')][_0x9863d5]['monitor']=!![];if(_[_0x2f49('0x6b')](_0x575262,'.wav49')){_0x575262=_0x575262[_0x2f49('0x6c')](_0x2f49('0x6d'),_0x2f49('0x6e'));}this['channels'][_0x9863d5][_0x2f49('0x6f')]=_0x575262;var _0x4fc817=_[_0x2f49('0x70')](this[_0x2f49('0x17')][_0x9863d5][_0x2f49('0x71')],{'filename':_0x575262});if(_['isNil'](_0x4fc817)){this[_0x2f49('0x17')][_0x9863d5][_0x2f49('0x71')]['push']({'filename':_0x575262,'createdAt':moment()[_0x2f49('0x40')](_0x2f49('0x41')),'mixmonitorid':'','status':_0x2f49('0x72')});}}}catch(_0x14b6b6){logger[_0x2f49('0x2c')](_0x2f49('0x73'),_0x9863d5,util[_0x2f49('0x2e')](_0x14b6b6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2f49('0x2f')][_0x2f49('0x21')]=function(_0x185932){try{if(this[_0x2f49('0x30')](_0x185932)){logger[_0x2f49('0x37')](_0x2f49('0x74'),_0x185932[_0x2f49('0x35')],util[_0x2f49('0x2e')](_0x185932,{'showHidden':![],'depth':null}));if(this[_0x2f49('0x17')][_0x185932[_0x2f49('0x35')]]&&_0x185932[_0x2f49('0x45')]!='OutgoingSpoolFailed'){if(this['isNotNull'](_0x185932['variable'])){if(this[_0x2f49('0x30')](_0x185932[_0x2f49('0x75')]['mixmonitor_filename'])){logger[_0x2f49('0x2a')](_0x2f49('0x76'),_0x185932['uniqueid'],_0x185932[_0x2f49('0x77')]);this[_0x2f49('0x69')](_0x185932['uniqueid'],_0x185932[_0x2f49('0x77')]);}else if(this[_0x2f49('0x30')](_0x185932[_0x2f49('0x75')]['xmd-phone'])){logger[_0x2f49('0x2a')](_0x2f49('0x78'),_0x185932[_0x2f49('0x35')],_0x185932['value']);this['channels'][_0x185932[_0x2f49('0x35')]]['calleridnum']=_0x185932[_0x2f49('0x77')];}else if(this['isNotNull'](_0x185932[_0x2f49('0x75')][_0x2f49('0x79')])){logger[_0x2f49('0x2a')](_0x2f49('0x7a'),_0x185932[_0x2f49('0x35')],_0x185932[_0x2f49('0x77')]);this[_0x2f49('0x17')][_0x185932['uniqueid']][_0x2f49('0x7b')]=_0x185932[_0x2f49('0x77')];}else if(this[_0x2f49('0x30')](_0x185932['variable'][_0x2f49('0x7c')])){logger[_0x2f49('0x2a')](_0x2f49('0x7d'),_0x185932['uniqueid'],_0x185932[_0x2f49('0x77')]);this[_0x2f49('0x17')][_0x185932['uniqueid']]['type']=_0x185932[_0x2f49('0x77')];}else if(this[_0x2f49('0x30')](_0x185932[_0x2f49('0x75')][_0x2f49('0x7e')])){logger[_0x2f49('0x2a')](_0x2f49('0x7f'),_0x185932['uniqueid'],_0x185932[_0x2f49('0x77')]['split'](',')[0x0]);this[_0x2f49('0x17')][_0x185932[_0x2f49('0x35')]][_0x2f49('0x5b')]=_0x185932['value'][_0x2f49('0x46')](',')[0x0];}else if(this['isNotNull'](_0x185932['variable']['xmd-originatecalleridnum'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x185932[_0x2f49('0x35')],_0x185932[_0x2f49('0x77')]);this['channels'][_0x185932[_0x2f49('0x35')]][_0x2f49('0x80')]=_0x185932[_0x2f49('0x77')];}else if(this['isNotNull'](_0x185932[_0x2f49('0x75')][_0x2f49('0x81')])){logger['info'](_0x2f49('0x82'),_0x185932[_0x2f49('0x35')],_0x185932[_0x2f49('0x77')]);this[_0x2f49('0x17')][_0x185932[_0x2f49('0x35')]]['destination']=_0x185932[_0x2f49('0x77')];}else if(this[_0x2f49('0x30')](_0x185932[_0x2f49('0x75')][_0x2f49('0x83')])){logger[_0x2f49('0x2a')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x185932[_0x2f49('0x35')],_0x185932[_0x2f49('0x77')]);this['channels'][_0x185932[_0x2f49('0x35')]][_0x2f49('0x84')]=_0x185932[_0x2f49('0x77')];}else if(this['isNotNull'](_0x185932[_0x2f49('0x75')][_0x2f49('0x85')])){logger[_0x2f49('0x2a')](_0x2f49('0x86'),_0x185932['uniqueid'],_0x185932[_0x2f49('0x77')]);this['channels'][_0x185932[_0x2f49('0x35')]][_0x2f49('0x5b')]=_0x185932[_0x2f49('0x77')];}else if(this[_0x2f49('0x30')](_0x185932[_0x2f49('0x75')]['sipcallid'])){logger[_0x2f49('0x2a')](_0x2f49('0x87'),_0x185932[_0x2f49('0x35')],_0x185932[_0x2f49('0x77')]);this[_0x2f49('0x17')][_0x185932['uniqueid']]['sipcalluniqueid']=_0x185932['value'];}}}else if(this[_0x2f49('0x30')](_0x185932['variable'][_0x2f49('0x88')])){if(_0x185932['value']){var _0x5bff6b=path['parse'](_0x185932[_0x2f49('0x77')])[_0x2f49('0x4b')];logger[_0x2f49('0x2a')](_0x2f49('0x76'),_0x5bff6b,_0x185932[_0x2f49('0x77')]);this[_0x2f49('0x69')](_0x5bff6b,_0x185932[_0x2f49('0x77')]);}}else if(this[_0x2f49('0x17')][_0x185932[_0x2f49('0x5d')]]){if(this[_0x2f49('0x30')](_0x185932[_0x2f49('0x75')])){if(this[_0x2f49('0x30')](_0x185932[_0x2f49('0x75')][_0x2f49('0x89')])){logger[_0x2f49('0x2a')](_0x2f49('0x87'),_0x185932[_0x2f49('0x5d')],_0x185932[_0x2f49('0x77')]);this[_0x2f49('0x17')][_0x185932[_0x2f49('0x5d')]][_0x2f49('0x8a')]=_0x185932['value'];}}}}}catch(_0x138c2c){logger[_0x2f49('0x2c')](_0x2f49('0x8b'),_0x185932['uniqueid'],util[_0x2f49('0x2e')](_0x138c2c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2f49('0x2f')]['syncHangup']=function(_0x5dd512){try{if(this[_0x2f49('0x30')](_0x5dd512)){logger[_0x2f49('0x37')]('[%s][voiceCallReport][hangup]\x20event:',_0x5dd512['uniqueid'],util[_0x2f49('0x2e')](_0x5dd512,{'showHidden':![],'depth':null}));if(this[_0x2f49('0x17')][_0x5dd512[_0x2f49('0x35')]]){logger['info'](_0x2f49('0x8c'),_0x5dd512[_0x2f49('0x35')],_0x5dd512['cause-txt']);var _0x47cf12=moment();this['channels'][_0x5dd512[_0x2f49('0x35')]]['endtime']=_0x47cf12[_0x2f49('0x40')](_0x2f49('0x41'));this[_0x2f49('0x17')][_0x5dd512['uniqueid']][_0x2f49('0x52')]=_0x47cf12[_0x2f49('0x8d')](this['channels'][_0x5dd512[_0x2f49('0x35')]]['starttime'],_0x2f49('0x54'));if(this[_0x2f49('0x17')][_0x5dd512[_0x2f49('0x35')]][_0x2f49('0x60')]){this[_0x2f49('0x17')][_0x5dd512['uniqueid']]['billableseconds']=_0x47cf12[_0x2f49('0x8d')](this['channels'][_0x5dd512[_0x2f49('0x35')]][_0x2f49('0x61')],_0x2f49('0x54'));this[_0x2f49('0x17')][_0x5dd512[_0x2f49('0x35')]][_0x2f49('0x62')]=this[_0x2f49('0x17')][_0x5dd512['uniqueid']]['duration']-this[_0x2f49('0x17')][_0x5dd512[_0x2f49('0x35')]][_0x2f49('0x8e')];}if(_0x5dd512[_0x2f49('0x3e')]==='from-sip'){if(this['agents'][_0x5dd512[_0x2f49('0x45')][_0x2f49('0x46')]('-')[0x0]]){this['agents'][_0x5dd512[_0x2f49('0x45')][_0x2f49('0x46')]('-')[0x0]]=_['omit'](this['agents'][_0x5dd512[_0x2f49('0x45')]['split']('-')[0x0]],[_0x2f49('0x47')]);logger['debug'](_0x2f49('0x8f'),_0x5dd512[_0x2f49('0x35')],util['inspect']({'destaccountcode':this[_0x2f49('0x18')][_0x5dd512[_0x2f49('0x45')][_0x2f49('0x46')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x2f49('0x32')](util[_0x2f49('0x40')](_0x2f49('0x4a'),this[_0x2f49('0x18')][_0x5dd512[_0x2f49('0x45')]['split']('-')[0x0]]['name']),'user:agentcomplete',{'destaccountcode':this[_0x2f49('0x18')][_0x5dd512['channel'][_0x2f49('0x46')]('-')[0x0]]['accountcode']});}}var _0x3864aa=this;Promise['resolve']()['then'](function(){var _0x4e141f=_0x3864aa['channels'][_0x5dd512['uniqueid']];if(typeof _0x4e141f[_0x2f49('0x90')]===_0x2f49('0x91'))return;if(_[_0x2f49('0x92')](_0x4e141f[_0x2f49('0x71')]))return;return RpcSetting[_0x2f49('0x93')]()[_0x2f49('0x94')](function(_0x2f2147){if(!_0x2f2147[_0x2f49('0x95')])return;return Promise['resolve']()[_0x2f49('0x94')](function(){return ami[_0x2f49('0x96')]({'action':_0x2f49('0x97'),'channel':_0x4e141f[_0x2f49('0x45')]})[_0x2f49('0x98')](function(){});})['then'](function(){return ami[_0x2f49('0x96')]({'action':_0x2f49('0x97'),'channel':_0x4e141f[_0x2f49('0x65')]})[_0x2f49('0x98')](function(){})[_0x2f49('0x99')](function(){var _0x462df4=_0x3864aa[_0x2f49('0x18')][_0x4e141f[_0x2f49('0x65')][_0x2f49('0x46')]('-')[0x0]];if(!_0x462df4)return;io[_0x2f49('0x32')](_0x2f49('0x9a'),{'agentId':_0x462df4['id'],'uniqueid':_0x4e141f[_0x2f49('0x35')]});});});});})[_0x2f49('0x94')](function(){if(_0x5dd512[_0x2f49('0x9b')]===_0x2f49('0x9c')){_0x3864aa[_0x2f49('0x9d')][_0x5dd512[_0x2f49('0x35')]]=_0x3864aa[_0x2f49('0x17')][_0x5dd512[_0x2f49('0x35')]];}else{if(_0x3864aa[_0x2f49('0x17')][_0x5dd512[_0x2f49('0x35')]][_0x2f49('0x9e')]===_0x2f49('0x9f')&&_0x3864aa[_0x2f49('0x9d')][_0x5dd512[_0x2f49('0x35')]]){_0x3864aa[_0x2f49('0x17')][_0x5dd512[_0x2f49('0x35')]][_0x2f49('0x35')]=[_0x3864aa[_0x2f49('0x17')][_0x5dd512[_0x2f49('0x35')]][_0x2f49('0x5d')],_0x3864aa['channels'][_0x5dd512['uniqueid']][_0x2f49('0x5d')]=_0x3864aa[_0x2f49('0x17')][_0x5dd512[_0x2f49('0x35')]][_0x2f49('0x35')]][0x0];delete _0x3864aa[_0x2f49('0x9d')][_0x5dd512[_0x2f49('0x35')]];}}logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x5dd512[_0x2f49('0x35')],util[_0x2f49('0x2e')](_0x3864aa[_0x2f49('0x17')][_0x5dd512[_0x2f49('0x35')]],{'showHidden':![],'depth':null}));ami[_0x2f49('0x32')](_0x2f49('0xa0'),_0x3864aa[_0x2f49('0x17')][_0x5dd512[_0x2f49('0x35')]]);delete _0x3864aa['channels'][_0x5dd512[_0x2f49('0x35')]];});}}}catch(_0x40c971){logger[_0x2f49('0x2c')](_0x2f49('0xa1'),_0x5dd512[_0x2f49('0x35')],util[_0x2f49('0x2e')](_0x40c971,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2f49('0x2f')][_0x2f49('0x26')]=function(_0x5c419c){try{if(this['isNotNull'](_0x5c419c)){logger[_0x2f49('0x2a')](_0x2f49('0xa2'),_0x5c419c['uniqueid'],_0x5c419c[_0x2f49('0xa3')],_0x5c419c[_0x2f49('0xa4')]);logger['debug'](_0x2f49('0xa5'),_0x5c419c[_0x2f49('0x35')],util[_0x2f49('0x2e')](_0x5c419c,{'showHidden':![],'depth':null}));if(this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xa6')]]){this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xa6')]][_0x2f49('0xa7')]=_0x5c419c['origtransferercalleridnum'];this[_0x2f49('0x17')][_0x5c419c['transfereeuniqueid']][_0x2f49('0xa8')]=_0x5c419c[_0x2f49('0xa4')];if(this['channels'][_0x5c419c[_0x2f49('0xa9')]]){var _0x28e100=this['channels'][_0x5c419c[_0x2f49('0xa9')]];this[_0x2f49('0x17')][_0x5c419c['secondtransfereruniqueid']]=this[_0x2f49('0x17')][_0x5c419c['transfereeuniqueid']];this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xa6')]]=_0x28e100;}}else if(this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xaa')]]){this[_0x2f49('0x17')][_0x5c419c['transfertargetuniqueid']][_0x2f49('0xa7')]=_0x5c419c[_0x2f49('0xa3')];this[_0x2f49('0x17')][_0x5c419c['transfertargetuniqueid']][_0x2f49('0xa8')]=_0x5c419c[_0x2f49('0xa4')];if(this[_0x2f49('0x17')][_0x5c419c['origtransfereruniqueid']]){var _0x28e100=this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xab')]];this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xab')]]=this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xaa')]];this[_0x2f49('0x17')][_0x5c419c['transfertargetuniqueid']]=_0x28e100;}}if((this[_0x2f49('0x17')][_0x5c419c['origtransfereruniqueid']]||this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xac')]])&&this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xa9')]]){var _0x41dd62=_[_0x2f49('0xad')]([this[_0x2f49('0x17')][_0x5c419c['origtransfereruniqueid']],this['channels'][_0x5c419c[_0x2f49('0xac')]],this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xa9')]]],function(_0x29b607){return _0x29b607&&_0x29b607[_0x2f49('0x9e')]===_0x2f49('0x9f')&&_0x29b607[_0x2f49('0xae')];});if(_0x41dd62){if(this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xab')]])this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xab')]]['transferType']=_0x2f49('0xaf');if(this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xac')]])this[_0x2f49('0x17')][_0x5c419c[_0x2f49('0xac')]][_0x2f49('0x90')]='ATTENDED';this[_0x2f49('0x17')][_0x5c419c['secondtransfereruniqueid']]['transferType']=_0x2f49('0xaf');}}}}catch(_0x313d8b){logger[_0x2f49('0x2c')]('[%s][voiceCallReport][attendedtransfer]',_0x5c419c[_0x2f49('0x35')],util[_0x2f49('0x2e')](_0x313d8b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2f49('0x2f')][_0x2f49('0xb0')]=function(_0x120596){try{if(this['isNotNull'](_0x120596)){logger[_0x2f49('0x2a')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x120596['uniqueid'],_0x120596[_0x2f49('0xb1')],_0x120596[_0x2f49('0xb2')]);logger[_0x2f49('0x37')](_0x2f49('0xb3'),_0x120596[_0x2f49('0x35')],util[_0x2f49('0x2e')](_0x120596,{'showHidden':![],'depth':null}));if(this[_0x2f49('0x17')][_0x120596[_0x2f49('0xa6')]]){this[_0x2f49('0x17')][_0x120596['transfereeuniqueid']][_0x2f49('0xa7')]=_0x120596[_0x2f49('0xb1')];this['channels'][_0x120596[_0x2f49('0xa6')]][_0x2f49('0xa8')]=_0x120596[_0x2f49('0xb2')];this[_0x2f49('0x17')][_0x120596['transfereeuniqueid']][_0x2f49('0x90')]=_0x2f49('0xb4');this[_0x2f49('0x23')]({'event':'BlindTransfer','uniqueid':_0x120596[_0x2f49('0xa6')],'context':_0x120596[_0x2f49('0x3e')],'channel':_0x120596[_0x2f49('0xb5')]});}else{this[_0x2f49('0x17')][_0x120596['transfereruniqueid']]['transferType']=_0x2f49('0xb4');}}}catch(_0x2fbb24){logger[_0x2f49('0x2c')](_0x2f49('0xb6'),_0x120596[_0x2f49('0x35')],util[_0x2f49('0x2e')](_0x2fbb24,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x2f49('0x29')]=function(_0x2a165f){try{if(this['isNotNull'](_0x2a165f)){logger['debug'](_0x2f49('0xb7'),_0x2a165f[_0x2f49('0x35')],util['inspect'](_0x2a165f,{'showHidden':![],'depth':null}));if(this['channels'][_0x2a165f[_0x2f49('0x35')]]){if(!_[_0x2f49('0xb8')](this['channels'][_0x2a165f[_0x2f49('0x35')]]['answertime'])){this[_0x2f49('0x17')][_0x2a165f[_0x2f49('0x35')]][_0x2f49('0xb9')]=moment()[_0x2f49('0x40')](_0x2f49('0x41'));logger[_0x2f49('0x2a')](_0x2f49('0xba'),_0x2a165f['uniqueid'],this[_0x2f49('0x17')][_0x2a165f[_0x2f49('0x35')]][_0x2f49('0xb9')]);}}}}catch(_0x261a35){logger[_0x2f49('0x2c')](_0x2f49('0xbb'),_0x2a165f['uniqueid'],util[_0x2f49('0x2e')](_0x261a35,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2f49('0x2f')]['syncMusicOnHoldStop']=function(_0x402d96){try{if(this[_0x2f49('0x30')](_0x402d96)){logger[_0x2f49('0x37')](_0x2f49('0xbc'),_0x402d96[_0x2f49('0x35')],util[_0x2f49('0x2e')](_0x402d96,{'showHidden':![],'depth':null}));if(this[_0x2f49('0x17')][_0x402d96['uniqueid']]){if(!_[_0x2f49('0xb8')](this['channels'][_0x402d96[_0x2f49('0x35')]][_0x2f49('0xb9')])){this['channels'][_0x402d96[_0x2f49('0x35')]][_0x2f49('0xbd')]+=moment()['milliseconds'](0x0)[_0x2f49('0x8d')](this[_0x2f49('0x17')][_0x402d96[_0x2f49('0x35')]]['mohstarttime'],_0x2f49('0x54'));logger['info'](_0x2f49('0xbe'),_0x402d96[_0x2f49('0x35')],this[_0x2f49('0x17')][_0x402d96[_0x2f49('0x35')]][_0x2f49('0xbd')]);delete this[_0x2f49('0x17')][_0x402d96[_0x2f49('0x35')]][_0x2f49('0xb9')];}}}}catch(_0x5d46f9){logger[_0x2f49('0x2c')](_0x2f49('0xbf'),_0x402d96[_0x2f49('0x35')],util[_0x2f49('0x2e')](_0x5d46f9,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0xdba8=['busy','invalid','ringing','onhold','set','agi','dial','voicemail','FAILED','NO\x20ANSWER','BUSY','redis','localhost','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','[voiceCallReport][coreshowchannels]\x20started','error','prototype','isNotNull','isUndefined','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','inspect','linkedid','merge','pick','keys','[%s][voiceCallReport][newcallerid]','syncNewChannel','channel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','exten','starttime','format','disposition','toNumber','split','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:%s','name','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','toLowerCase','applicationdata','application','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','startsWith','cdr(','match','queue','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','calleridnum','destinationchannel','channelstate','UserId','membername','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','endsWith','replace','.wav49','.WAV','monitorFilename','find','monitors','isNil','push','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','from-sip','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','resolve','StopMixMonitor','catch','Action','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','outbound','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','mohtime','milliseconds','diff','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','bluebird','lodash','moment','ioredis','../../../config/logger','ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse'];(function(_0x1ac103,_0x3df308){var _0x29d25d=function(_0x2e5994){while(--_0x2e5994){_0x1ac103['push'](_0x1ac103['shift']());}};_0x29d25d(++_0x3df308);}(_0xdba8,0x179));var _0x8dba=function(_0x15af2f,_0x3c0a01){_0x15af2f=_0x15af2f-0x0;var _0x359239=_0xdba8[_0x15af2f];return _0x359239;};'use strict';var BPromise=require(_0x8dba('0x0'));var _=require(_0x8dba('0x1'));var moment=require(_0x8dba('0x2'));var util=require('util');var path=require('path');var Redis=require(_0x8dba('0x3'));var config=require('../../../config/environment');var logger=require(_0x8dba('0x4'))(_0x8dba('0x5'));var ami=require('../ami');var Channel=require(_0x8dba('0x6'));var RpcSetting=require(_0x8dba('0x7'));var statusDesc=[_0x8dba('0x8'),_0x8dba('0x9'),_0x8dba('0xa'),_0x8dba('0xb'),_0x8dba('0xc'),'unavailable',_0x8dba('0xd'),'ringinuse',_0x8dba('0xe')];var applications=[_0x8dba('0xf'),'queue',_0x8dba('0x10'),_0x8dba('0x11'),'playback',_0x8dba('0x12')];var dispositions=['NO\x20ANSWER',_0x8dba('0x13'),'FAILED','NO\x20ANSWER',_0x8dba('0x14'),_0x8dba('0x14'),'ANSWERED',_0x8dba('0x15'),'FAILED',_0x8dba('0x13'),_0x8dba('0x13')];var actions={};config[_0x8dba('0x16')]=_['defaults'](config[_0x8dba('0x16')],{'host':_0x8dba('0x17'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8dba('0x16')]));function VoiceCallReport(_0x4625f2){this[_0x8dba('0x18')]=_0x4625f2['channels'];this[_0x8dba('0x19')]=_0x4625f2[_0x8dba('0x19')];this[_0x8dba('0x1a')]={};ami['on'](_0x8dba('0x1b'),this[_0x8dba('0x1c')][_0x8dba('0x1d')](this));ami['on'](_0x8dba('0x1e'),this['syncNewExten'][_0x8dba('0x1d')](this));ami['on'](_0x8dba('0x1f'),this['syncNewChannel'][_0x8dba('0x1d')](this));ami['on'](_0x8dba('0x20'),this[_0x8dba('0x21')][_0x8dba('0x1d')](this));ami['on'](_0x8dba('0x22'),this[_0x8dba('0x23')][_0x8dba('0x1d')](this));ami['on'](_0x8dba('0x24'),this[_0x8dba('0x25')]['bind'](this));ami['on'](_0x8dba('0x26'),this['syncNewCallerId']['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x8dba('0x1d')](this));ami['on'](_0x8dba('0x27'),this[_0x8dba('0x28')][_0x8dba('0x1d')](this));ami['on'](_0x8dba('0x29'),this[_0x8dba('0x2a')][_0x8dba('0x1d')](this));ami['on'](_0x8dba('0x2b'),this['syncMusicOnHoldStop'][_0x8dba('0x1d')](this));try{logger['info'](_0x8dba('0x2c'));ami['actionCoreShowChannels']();}catch(_0x1156c6){logger[_0x8dba('0x2d')]('[voiceCallReport][coreshowchannels]',util['inspect'](_0x1156c6,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x8dba('0x2e')][_0x8dba('0x2f')]=function(_0x3f1ec4){return _0x3f1ec4!==null&&!_[_0x8dba('0x30')](_0x3f1ec4);};VoiceCallReport[_0x8dba('0x2e')][_0x8dba('0x31')]=function(_0x130ee5,_0x389236,_0x357290){io['to'](_0x130ee5)[_0x8dba('0x31')](_0x389236,_0x357290);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x561dfb){try{if(this['isNotNull'](_0x561dfb)){logger[_0x8dba('0x32')](_0x8dba('0x33'),_0x561dfb[_0x8dba('0x34')],_0x561dfb[_0x8dba('0x35')],_0x561dfb['calleridnum']);logger[_0x8dba('0x36')](_0x8dba('0x37'),_0x561dfb[_0x8dba('0x34')],util[_0x8dba('0x38')](_0x561dfb,{'showHidden':![],'depth':null}));if(_0x561dfb[_0x8dba('0x34')]===_0x561dfb[_0x8dba('0x39')]){if(!_[_0x8dba('0x30')](this[_0x8dba('0x18')][_0x561dfb[_0x8dba('0x34')]])){_[_0x8dba('0x3a')](this[_0x8dba('0x18')][_0x561dfb[_0x8dba('0x34')]],_[_0x8dba('0x3b')](_0x561dfb,_[_0x8dba('0x3c')](this[_0x8dba('0x18')][_0x561dfb[_0x8dba('0x34')]])));}}}}catch(_0xd5d805){logger[_0x8dba('0x2d')](_0x8dba('0x3d'),_0x561dfb['uniqueid'],util[_0x8dba('0x38')](_0xd5d805,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8dba('0x2e')][_0x8dba('0x3e')]=function(_0x4a6088){try{if(this[_0x8dba('0x2f')](_0x4a6088)){logger[_0x8dba('0x36')]('[%s][voiceCallReport][newchannel]\x20event:',_0x4a6088[_0x8dba('0x34')],util[_0x8dba('0x38')](_0x4a6088,{'showHidden':![],'depth':null}));if(_0x4a6088[_0x8dba('0x34')]===_0x4a6088[_0x8dba('0x39')]&&_0x4a6088[_0x8dba('0x3f')]!=_0x8dba('0x40')){if(_[_0x8dba('0x30')](this['channels'][_0x4a6088['uniqueid']])){logger['info'](_0x8dba('0x41'),_0x4a6088[_0x8dba('0x34')],_0x4a6088[_0x8dba('0x42')],_0x4a6088[_0x8dba('0x43')]);this['channels'][_0x4a6088[_0x8dba('0x34')]]=new Channel();this[_0x8dba('0x18')][_0x4a6088['uniqueid']][_0x8dba('0x44')]=moment()[_0x8dba('0x45')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4a6088[_0x8dba('0x34')]][_0x8dba('0x46')]=dispositions[_[_0x8dba('0x47')](_0x4a6088['channelstate'])];_['merge'](this[_0x8dba('0x18')][_0x4a6088[_0x8dba('0x34')]],_[_0x8dba('0x3b')](_0x4a6088,_[_0x8dba('0x3c')](this['channels'][_0x4a6088['uniqueid']])));if(_0x4a6088['context']==='from-sip'){if(this[_0x8dba('0x19')][_0x4a6088['channel']['split']('-')[0x0]]){this[_0x8dba('0x19')][_0x4a6088[_0x8dba('0x3f')][_0x8dba('0x48')]('-')[0x0]]['destconnectedlinenum']=_0x4a6088[_0x8dba('0x43')];logger['debug'](_0x8dba('0x49'),_0x4a6088[_0x8dba('0x34')],util[_0x8dba('0x38')]({'destaccountcode':this['agents'][_0x4a6088[_0x8dba('0x3f')]['split']('-')[0x0]][_0x8dba('0x4a')],'destconnectedlinenum':_0x4a6088[_0x8dba('0x43')]},{'showHidden':![],'depth':null}));this[_0x8dba('0x31')](util[_0x8dba('0x45')](_0x8dba('0x4b'),this['agents'][_0x4a6088[_0x8dba('0x3f')][_0x8dba('0x48')]('-')[0x0]][_0x8dba('0x4c')]),_0x8dba('0x4d'),{'destaccountcode':this[_0x8dba('0x19')][_0x4a6088[_0x8dba('0x3f')]['split']('-')[0x0]][_0x8dba('0x4a')],'destconnectedlinenum':_0x4a6088[_0x8dba('0x43')]});}}}}}}catch(_0x237949){logger['error'](_0x8dba('0x4e'),_0x4a6088[_0x8dba('0x34')],util[_0x8dba('0x38')](_0x237949,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8dba('0x2e')][_0x8dba('0x1c')]=function(_0x243def){try{if(this[_0x8dba('0x2f')](_0x243def)){logger['debug'](_0x8dba('0x4f'),_0x243def['uniqueid'],util[_0x8dba('0x38')](_0x243def,{'showHidden':![],'depth':null}));if(_0x243def[_0x8dba('0x34')]===_0x243def['linkedid']&&_0x243def['exten']!='h'&&_0x243def[_0x8dba('0x3f')]!=_0x8dba('0x40')){_0x243def['application']=_0x243def['application'][_0x8dba('0x50')]();_0x243def[_0x8dba('0x51')]=(_0x243def['appdata']||_0x243def[_0x8dba('0x51')])[_0x8dba('0x50')]();logger[_0x8dba('0x32')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x243def[_0x8dba('0x34')],_0x243def[_0x8dba('0x52')],_0x243def['applicationdata']);if(_[_0x8dba('0x30')](this[_0x8dba('0x18')][_0x243def[_0x8dba('0x34')]])){this['channels'][_0x243def[_0x8dba('0x34')]]=new Channel();this[_0x8dba('0x18')][_0x243def['uniqueid']]['starttime']=_0x243def[_0x8dba('0x53')]?moment()[_0x8dba('0x54')](moment[_0x8dba('0x53')](_0x243def[_0x8dba('0x53')])[_0x8dba('0x55')](),_0x8dba('0x55'))[_0x8dba('0x45')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x8dba('0x45')](_0x8dba('0x56'));this[_0x8dba('0x18')][_0x243def['uniqueid']]['disposition']=_0x8dba('0x14');}_[_0x8dba('0x3a')](this[_0x8dba('0x18')][_0x243def[_0x8dba('0x34')]],_[_0x8dba('0x3b')](_0x243def,_[_0x8dba('0x3c')](this[_0x8dba('0x18')][_0x243def[_0x8dba('0x34')]])));if(_[_0x8dba('0x57')](applications,_0x243def[_0x8dba('0x52')])){this[_0x8dba('0x18')][_0x243def[_0x8dba('0x34')]][_0x8dba('0x58')]=_0x243def[_0x8dba('0x52')];this[_0x8dba('0x18')][_0x243def[_0x8dba('0x34')]][_0x8dba('0x59')]=_0x243def[_0x8dba('0x51')];if(_0x243def[_0x8dba('0x52')]===_0x8dba('0xf')&&_[_0x8dba('0x5a')](_0x243def['applicationdata'],_0x8dba('0x5b'))){var _0x27094d=_0x243def['applicationdata'][_0x8dba('0x48')]('=');var _0x44b846=_0x27094d[0x0][_0x8dba('0x5c')](/cdr\((.*)\)/);if(_0x44b846){this[_0x8dba('0x18')][_0x243def[_0x8dba('0x34')]][_0x44b846[0x1]]=_0x27094d[0x1];}}else if(_0x243def[_0x8dba('0x52')]===_0x8dba('0x5d')){this['channels'][_0x243def[_0x8dba('0x34')]][_0x8dba('0x5d')]=_0x243def['applicationdata'][_0x8dba('0x48')](',')[0x0];}}}}}catch(_0x589093){logger[_0x8dba('0x2d')]('[%s][voiceCallReport][newexten]',_0x243def['uniqueid'],util[_0x8dba('0x38')](_0x589093,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8dba('0x2e')]['syncNewState']=function(_0x46863c){try{if(this[_0x8dba('0x2f')](_0x46863c)){logger[_0x8dba('0x32')](_0x8dba('0x5e'),_0x46863c[_0x8dba('0x34')],_0x46863c['linkedid'],_0x46863c[_0x8dba('0x35')],_0x46863c['calleridnum']);logger[_0x8dba('0x36')](_0x8dba('0x5f'),_0x46863c[_0x8dba('0x34')],util[_0x8dba('0x38')](_0x46863c,{'showHidden':![],'depth':null}));if(_0x46863c[_0x8dba('0x34')]!==_0x46863c[_0x8dba('0x39')]){if(this[_0x8dba('0x18')][_0x46863c[_0x8dba('0x39')]]){if(_0x46863c['channelstate']==='6'){if(!this[_0x8dba('0x18')][_0x46863c[_0x8dba('0x39')]][_0x8dba('0x60')]){var _0x1d6c64=moment();this['channels'][_0x46863c[_0x8dba('0x39')]][_0x8dba('0x60')]=!![];this[_0x8dba('0x18')][_0x46863c['linkedid']][_0x8dba('0x61')]=_0x1d6c64['format'](_0x8dba('0x56'));if(this[_0x8dba('0x18')][_0x46863c['linkedid']]['starttime']){this[_0x8dba('0x18')][_0x46863c[_0x8dba('0x39')]]['holdtime']=_0x1d6c64['diff'](this[_0x8dba('0x18')][_0x46863c[_0x8dba('0x39')]]['starttime'],'seconds');}}this['channels'][_0x46863c['linkedid']][_0x8dba('0x39')]=_0x46863c[_0x8dba('0x34')];if(_0x46863c[_0x8dba('0x62')]!=='xcally-motion-preview'){this[_0x8dba('0x18')][_0x46863c[_0x8dba('0x39')]]['connectedlinenum']=_0x46863c[_0x8dba('0x62')];}this[_0x8dba('0x18')][_0x46863c['linkedid']]['connectedlinename']=_0x46863c[_0x8dba('0x35')];this[_0x8dba('0x18')][_0x46863c[_0x8dba('0x39')]][_0x8dba('0x63')]=_0x46863c[_0x8dba('0x3f')];this[_0x8dba('0x18')][_0x46863c[_0x8dba('0x39')]][_0x8dba('0x46')]=dispositions[_[_0x8dba('0x47')](_0x46863c[_0x8dba('0x64')])];if(this['agents'][_0x46863c[_0x8dba('0x3f')]['split']('-')[0x0]]){this[_0x8dba('0x18')][_0x46863c[_0x8dba('0x39')]][_0x8dba('0x65')]=this['agents'][_0x46863c[_0x8dba('0x3f')][_0x8dba('0x48')]('-')[0x0]]['id'];this[_0x8dba('0x18')][_0x46863c[_0x8dba('0x39')]][_0x8dba('0x66')]=this[_0x8dba('0x19')][_0x46863c[_0x8dba('0x3f')][_0x8dba('0x48')]('-')[0x0]][_0x8dba('0x4c')];}}}}else{if(this['channels'][_0x46863c[_0x8dba('0x34')]]){if(_0x46863c['channelstate']==='6'){if(this['agents'][_0x46863c[_0x8dba('0x3f')][_0x8dba('0x48')]('-')[0x0]]){this[_0x8dba('0x18')][_0x46863c[_0x8dba('0x34')]][_0x8dba('0x65')]=this[_0x8dba('0x19')][_0x46863c[_0x8dba('0x3f')][_0x8dba('0x48')]('-')[0x0]]['id'];this[_0x8dba('0x18')][_0x46863c['uniqueid']][_0x8dba('0x66')]=this[_0x8dba('0x19')][_0x46863c[_0x8dba('0x3f')][_0x8dba('0x48')]('-')[0x0]][_0x8dba('0x4c')];}}}}}}catch(_0x4eedd3){logger[_0x8dba('0x2d')](_0x8dba('0x67'),_0x46863c[_0x8dba('0x34')],util['inspect'](_0x4eedd3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8dba('0x2e')][_0x8dba('0x68')]=function(_0x19e7e9,_0x550c3a){try{if(this[_0x8dba('0x18')][_0x19e7e9]){logger[_0x8dba('0x32')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x19e7e9,_0x550c3a);this[_0x8dba('0x18')][_0x19e7e9][_0x8dba('0x69')]=!![];if(_[_0x8dba('0x6a')](_0x550c3a,'.wav49')){_0x550c3a=_0x550c3a[_0x8dba('0x6b')](_0x8dba('0x6c'),_0x8dba('0x6d'));}this[_0x8dba('0x18')][_0x19e7e9][_0x8dba('0x6e')]=_0x550c3a;var _0x5adb8a=_[_0x8dba('0x6f')](this['channels'][_0x19e7e9][_0x8dba('0x70')],{'filename':_0x550c3a});if(_[_0x8dba('0x71')](_0x5adb8a)){this[_0x8dba('0x18')][_0x19e7e9][_0x8dba('0x70')][_0x8dba('0x72')]({'filename':_0x550c3a,'createdAt':moment()[_0x8dba('0x45')](_0x8dba('0x56')),'mixmonitorid':'','status':'rec'});}}}catch(_0x332fb4){logger['error'](_0x8dba('0x73'),_0x19e7e9,util[_0x8dba('0x38')](_0x332fb4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8dba('0x2e')][_0x8dba('0x23')]=function(_0x28e313){try{if(this[_0x8dba('0x2f')](_0x28e313)){logger['debug']('[%s][voiceCallReport][varset]\x20event:',_0x28e313['uniqueid'],util[_0x8dba('0x38')](_0x28e313,{'showHidden':![],'depth':null}));if(this[_0x8dba('0x18')][_0x28e313['uniqueid']]&&_0x28e313[_0x8dba('0x3f')]!=_0x8dba('0x40')){if(this[_0x8dba('0x2f')](_0x28e313[_0x8dba('0x74')])){if(this['isNotNull'](_0x28e313[_0x8dba('0x74')][_0x8dba('0x75')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x28e313['uniqueid'],_0x28e313[_0x8dba('0x76')]);this['syncMixMonitorFilename'](_0x28e313[_0x8dba('0x34')],_0x28e313[_0x8dba('0x76')]);}else if(this[_0x8dba('0x2f')](_0x28e313[_0x8dba('0x74')]['xmd-phone'])){logger[_0x8dba('0x32')](_0x8dba('0x77'),_0x28e313[_0x8dba('0x34')],_0x28e313[_0x8dba('0x76')]);this[_0x8dba('0x18')][_0x28e313['uniqueid']][_0x8dba('0x62')]=_0x28e313[_0x8dba('0x76')];}else if(this['isNotNull'](_0x28e313['variable'][_0x8dba('0x78')])){logger['info'](_0x8dba('0x79'),_0x28e313[_0x8dba('0x34')],_0x28e313[_0x8dba('0x76')]);this[_0x8dba('0x18')][_0x28e313['uniqueid']]['callerid']=_0x28e313['value'];}else if(this[_0x8dba('0x2f')](_0x28e313[_0x8dba('0x74')][_0x8dba('0x7a')])){logger[_0x8dba('0x32')](_0x8dba('0x7b'),_0x28e313[_0x8dba('0x34')],_0x28e313['value']);this[_0x8dba('0x18')][_0x28e313[_0x8dba('0x34')]][_0x8dba('0x7c')]=_0x28e313[_0x8dba('0x76')];}else if(this[_0x8dba('0x2f')](_0x28e313[_0x8dba('0x74')]['xmd-queue'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x28e313['uniqueid'],_0x28e313[_0x8dba('0x76')][_0x8dba('0x48')](',')[0x0]);this[_0x8dba('0x18')][_0x28e313[_0x8dba('0x34')]][_0x8dba('0x5d')]=_0x28e313[_0x8dba('0x76')][_0x8dba('0x48')](',')[0x0];}else if(this['isNotNull'](_0x28e313[_0x8dba('0x74')]['xmd-originatecalleridnum'])){logger[_0x8dba('0x32')](_0x8dba('0x7d'),_0x28e313['uniqueid'],_0x28e313[_0x8dba('0x76')]);this[_0x8dba('0x18')][_0x28e313['uniqueid']]['originatecalleridnum']=_0x28e313[_0x8dba('0x76')];}else if(this[_0x8dba('0x2f')](_0x28e313['variable']['xmd-destination'])){logger['info'](_0x8dba('0x7e'),_0x28e313['uniqueid'],_0x28e313[_0x8dba('0x76')]);this[_0x8dba('0x18')][_0x28e313[_0x8dba('0x34')]][_0x8dba('0x7f')]=_0x28e313['value'];}else if(this[_0x8dba('0x2f')](_0x28e313[_0x8dba('0x74')]['xmd-callerid-preview'])){logger[_0x8dba('0x32')](_0x8dba('0x80'),_0x28e313[_0x8dba('0x34')],_0x28e313[_0x8dba('0x76')]);this['channels'][_0x28e313[_0x8dba('0x34')]][_0x8dba('0x81')]=_0x28e313[_0x8dba('0x76')];}else if(this[_0x8dba('0x2f')](_0x28e313[_0x8dba('0x74')][_0x8dba('0x82')])){logger[_0x8dba('0x32')](_0x8dba('0x83'),_0x28e313[_0x8dba('0x34')],_0x28e313['value']);this[_0x8dba('0x18')][_0x28e313[_0x8dba('0x34')]][_0x8dba('0x5d')]=_0x28e313['value'];}else if(this[_0x8dba('0x2f')](_0x28e313['variable']['sipcallid'])){logger[_0x8dba('0x32')](_0x8dba('0x84'),_0x28e313[_0x8dba('0x34')],_0x28e313['value']);this[_0x8dba('0x18')][_0x28e313[_0x8dba('0x34')]][_0x8dba('0x85')]=_0x28e313[_0x8dba('0x76')];}}}else if(this[_0x8dba('0x2f')](_0x28e313['variable'][_0x8dba('0x75')])){if(_0x28e313[_0x8dba('0x76')]){var _0x19f440=path[_0x8dba('0x86')](_0x28e313[_0x8dba('0x76')])[_0x8dba('0x4c')];logger['info'](_0x8dba('0x87'),_0x19f440,_0x28e313['value']);this['syncMixMonitorFilename'](_0x19f440,_0x28e313[_0x8dba('0x76')]);}}else if(this[_0x8dba('0x18')][_0x28e313[_0x8dba('0x39')]]){if(this[_0x8dba('0x2f')](_0x28e313[_0x8dba('0x74')])){if(this[_0x8dba('0x2f')](_0x28e313['variable']['sipcallid'])){logger[_0x8dba('0x32')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x28e313[_0x8dba('0x39')],_0x28e313[_0x8dba('0x76')]);this[_0x8dba('0x18')][_0x28e313[_0x8dba('0x39')]][_0x8dba('0x88')]=_0x28e313['value'];}}}}}catch(_0x1ccd7d){logger[_0x8dba('0x2d')](_0x8dba('0x89'),_0x28e313[_0x8dba('0x34')],util[_0x8dba('0x38')](_0x1ccd7d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8dba('0x2e')][_0x8dba('0x25')]=function(_0x4e33ed){try{if(this[_0x8dba('0x2f')](_0x4e33ed)){logger[_0x8dba('0x36')](_0x8dba('0x8a'),_0x4e33ed[_0x8dba('0x34')],util['inspect'](_0x4e33ed,{'showHidden':![],'depth':null}));if(this['channels'][_0x4e33ed[_0x8dba('0x34')]]){logger[_0x8dba('0x32')](_0x8dba('0x8b'),_0x4e33ed['uniqueid'],_0x4e33ed[_0x8dba('0x8c')]);var _0x1554b1=moment();this[_0x8dba('0x18')][_0x4e33ed[_0x8dba('0x34')]][_0x8dba('0x8d')]=_0x1554b1[_0x8dba('0x45')](_0x8dba('0x56'));this[_0x8dba('0x18')][_0x4e33ed[_0x8dba('0x34')]][_0x8dba('0x53')]=_0x1554b1['diff'](this['channels'][_0x4e33ed[_0x8dba('0x34')]]['starttime'],'seconds');if(this[_0x8dba('0x18')][_0x4e33ed[_0x8dba('0x34')]][_0x8dba('0x60')]){this['channels'][_0x4e33ed[_0x8dba('0x34')]]['billableseconds']=_0x1554b1['diff'](this[_0x8dba('0x18')][_0x4e33ed[_0x8dba('0x34')]][_0x8dba('0x61')],_0x8dba('0x55'));this[_0x8dba('0x18')][_0x4e33ed[_0x8dba('0x34')]]['holdtime']=this['channels'][_0x4e33ed[_0x8dba('0x34')]]['duration']-this[_0x8dba('0x18')][_0x4e33ed[_0x8dba('0x34')]][_0x8dba('0x8e')];}if(_0x4e33ed[_0x8dba('0x42')]===_0x8dba('0x8f')){if(this[_0x8dba('0x19')][_0x4e33ed[_0x8dba('0x3f')][_0x8dba('0x48')]('-')[0x0]]){this[_0x8dba('0x19')][_0x4e33ed['channel'][_0x8dba('0x48')]('-')[0x0]]=_[_0x8dba('0x90')](this[_0x8dba('0x19')][_0x4e33ed[_0x8dba('0x3f')][_0x8dba('0x48')]('-')[0x0]],['destconnectedlinenum']);logger[_0x8dba('0x36')](_0x8dba('0x91'),_0x4e33ed[_0x8dba('0x34')],util[_0x8dba('0x38')]({'destaccountcode':this['agents'][_0x4e33ed[_0x8dba('0x3f')][_0x8dba('0x48')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x8dba('0x31')](util[_0x8dba('0x45')](_0x8dba('0x4b'),this[_0x8dba('0x19')][_0x4e33ed[_0x8dba('0x3f')]['split']('-')[0x0]][_0x8dba('0x4c')]),_0x8dba('0x92'),{'destaccountcode':this['agents'][_0x4e33ed[_0x8dba('0x3f')]['split']('-')[0x0]]['accountcode']});}}var _0x2d6ada=this;Promise['resolve']()[_0x8dba('0x93')](function(){var _0xb06afd=_0x2d6ada['channels'][_0x4e33ed[_0x8dba('0x34')]];if(typeof _0xb06afd[_0x8dba('0x94')]===_0x8dba('0x95'))return;if(_[_0x8dba('0x96')](_0xb06afd[_0x8dba('0x70')]))return;return RpcSetting[_0x8dba('0x97')]()['then'](function(_0x43f1b5){if(!_0x43f1b5[_0x8dba('0x98')])return;return Promise[_0x8dba('0x99')]()[_0x8dba('0x93')](function(){return ami['Action']({'action':_0x8dba('0x9a'),'channel':_0xb06afd[_0x8dba('0x3f')]})[_0x8dba('0x9b')](function(){});})[_0x8dba('0x93')](function(){return ami[_0x8dba('0x9c')]({'action':_0x8dba('0x9a'),'channel':_0xb06afd[_0x8dba('0x63')]})[_0x8dba('0x9b')](function(){})['finally'](function(){var _0x34bcdb=_0x2d6ada[_0x8dba('0x19')][_0xb06afd[_0x8dba('0x63')][_0x8dba('0x48')]('-')[0x0]];if(!_0x34bcdb)return;io[_0x8dba('0x31')](_0x8dba('0x9d'),{'agentId':_0x34bcdb['id'],'uniqueid':_0xb06afd['uniqueid']});});});});})[_0x8dba('0x93')](function(){if(_0x4e33ed[_0x8dba('0x9e')]===_0x8dba('0x9f')){_0x2d6ada[_0x8dba('0x1a')][_0x4e33ed[_0x8dba('0x34')]]=_0x2d6ada[_0x8dba('0x18')][_0x4e33ed[_0x8dba('0x34')]];}else{if(_0x2d6ada['channels'][_0x4e33ed['uniqueid']][_0x8dba('0x7c')]==='outbound'&&_0x2d6ada[_0x8dba('0x1a')][_0x4e33ed[_0x8dba('0x34')]]){_0x2d6ada['channels'][_0x4e33ed[_0x8dba('0x34')]]['uniqueid']=[_0x2d6ada[_0x8dba('0x18')][_0x4e33ed[_0x8dba('0x34')]][_0x8dba('0x39')],_0x2d6ada['channels'][_0x4e33ed[_0x8dba('0x34')]][_0x8dba('0x39')]=_0x2d6ada[_0x8dba('0x18')][_0x4e33ed[_0x8dba('0x34')]]['uniqueid']][0x0];delete _0x2d6ada['blindTransfers'][_0x4e33ed[_0x8dba('0x34')]];}}logger[_0x8dba('0x36')](_0x8dba('0xa0'),_0x4e33ed[_0x8dba('0x34')],util[_0x8dba('0x38')](_0x2d6ada['channels'][_0x4e33ed[_0x8dba('0x34')]],{'showHidden':![],'depth':null}));ami[_0x8dba('0x31')]('custom:voiceCallReport',_0x2d6ada[_0x8dba('0x18')][_0x4e33ed[_0x8dba('0x34')]]);delete _0x2d6ada[_0x8dba('0x18')][_0x4e33ed[_0x8dba('0x34')]];});}}}catch(_0x4efb42){logger['error']('[%s][voiceCallReport][hangup]',_0x4e33ed[_0x8dba('0x34')],util[_0x8dba('0x38')](_0x4efb42,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8dba('0x2e')][_0x8dba('0xa1')]=function(_0x40324f){try{if(this[_0x8dba('0x2f')](_0x40324f)){logger[_0x8dba('0x32')](_0x8dba('0xa2'),_0x40324f[_0x8dba('0x34')],_0x40324f['origtransferercalleridnum'],_0x40324f[_0x8dba('0xa3')]);logger[_0x8dba('0x36')](_0x8dba('0xa4'),_0x40324f['uniqueid'],util[_0x8dba('0x38')](_0x40324f,{'showHidden':![],'depth':null}));if(this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xa5')]]){this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xa5')]][_0x8dba('0xa6')]=_0x40324f[_0x8dba('0xa7')];this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xa5')]]['transferconnectedlinenum']=_0x40324f['transfertargetcalleridnum'];if(this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xa8')]]){var _0x51cf44=this['channels'][_0x40324f[_0x8dba('0xa8')]];this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xa8')]]=this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xa5')]];this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xa5')]]=_0x51cf44;}}else if(this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xa9')]]){this[_0x8dba('0x18')][_0x40324f['transfertargetuniqueid']][_0x8dba('0xa6')]=_0x40324f[_0x8dba('0xa7')];this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xa9')]][_0x8dba('0xaa')]=_0x40324f[_0x8dba('0xa3')];if(this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xab')]]){var _0x51cf44=this['channels'][_0x40324f[_0x8dba('0xab')]];this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xab')]]=this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xa9')]];this[_0x8dba('0x18')][_0x40324f['transfertargetuniqueid']]=_0x51cf44;}}if((this['channels'][_0x40324f[_0x8dba('0xab')]]||this['channels'][_0x40324f['origtransfererlinkedid']])&&this[_0x8dba('0x18')][_0x40324f['secondtransfereruniqueid']]){var _0x4dc392=_['some']([this[_0x8dba('0x18')][_0x40324f['origtransfereruniqueid']],this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xac')]],this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xa8')]]],function(_0x143e0e){return _0x143e0e&&_0x143e0e[_0x8dba('0x7c')]===_0x8dba('0xad')&&_0x143e0e[_0x8dba('0xae')];});if(_0x4dc392){if(this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xab')]])this['channels'][_0x40324f[_0x8dba('0xab')]]['transferType']='ATTENDED';if(this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xac')]])this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xac')]]['transferType']=_0x8dba('0xaf');this[_0x8dba('0x18')][_0x40324f[_0x8dba('0xa8')]][_0x8dba('0x94')]=_0x8dba('0xaf');}}}}catch(_0x3587ba){logger[_0x8dba('0x2d')](_0x8dba('0xb0'),_0x40324f[_0x8dba('0x34')],util[_0x8dba('0x38')](_0x3587ba,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8dba('0x28')]=function(_0x31c780){try{if(this['isNotNull'](_0x31c780)){logger[_0x8dba('0x32')](_0x8dba('0xb1'),_0x31c780[_0x8dba('0x34')],_0x31c780[_0x8dba('0xb2')],_0x31c780[_0x8dba('0xb3')]);logger[_0x8dba('0x36')](_0x8dba('0xb4'),_0x31c780[_0x8dba('0x34')],util[_0x8dba('0x38')](_0x31c780,{'showHidden':![],'depth':null}));if(this['channels'][_0x31c780[_0x8dba('0xa5')]]){this['channels'][_0x31c780[_0x8dba('0xa5')]]['transfercalleridnum']=_0x31c780[_0x8dba('0xb2')];this[_0x8dba('0x18')][_0x31c780[_0x8dba('0xa5')]]['transferconnectedlinenum']=_0x31c780['extension'];this[_0x8dba('0x18')][_0x31c780[_0x8dba('0xa5')]]['transferType']=_0x8dba('0xb5');this[_0x8dba('0x25')]({'event':_0x8dba('0x9f'),'uniqueid':_0x31c780[_0x8dba('0xa5')],'context':_0x31c780[_0x8dba('0x42')],'channel':_0x31c780[_0x8dba('0xb6')]});}else{this[_0x8dba('0x18')][_0x31c780[_0x8dba('0xb7')]][_0x8dba('0x94')]='BLIND';}}}catch(_0x3087f0){logger[_0x8dba('0x2d')]('[%s][voiceCallReport][blindtransfer]',_0x31c780[_0x8dba('0x34')],util['inspect'](_0x3087f0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8dba('0x2a')]=function(_0x1a9a7d){try{if(this[_0x8dba('0x2f')](_0x1a9a7d)){logger[_0x8dba('0x36')](_0x8dba('0xb8'),_0x1a9a7d[_0x8dba('0x34')],util[_0x8dba('0x38')](_0x1a9a7d,{'showHidden':![],'depth':null}));if(this[_0x8dba('0x18')][_0x1a9a7d[_0x8dba('0x34')]]){if(!_[_0x8dba('0x71')](this[_0x8dba('0x18')][_0x1a9a7d[_0x8dba('0x34')]][_0x8dba('0x61')])){this[_0x8dba('0x18')][_0x1a9a7d[_0x8dba('0x34')]]['mohstarttime']=moment()[_0x8dba('0x45')](_0x8dba('0x56'));logger[_0x8dba('0x32')](_0x8dba('0xb9'),_0x1a9a7d[_0x8dba('0x34')],this[_0x8dba('0x18')][_0x1a9a7d['uniqueid']][_0x8dba('0xba')]);}}}}catch(_0x465a2c){logger[_0x8dba('0x2d')](_0x8dba('0xbb'),_0x1a9a7d[_0x8dba('0x34')],util[_0x8dba('0x38')](_0x465a2c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8dba('0x2e')][_0x8dba('0xbc')]=function(_0x548ecf){try{if(this['isNotNull'](_0x548ecf)){logger[_0x8dba('0x36')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x548ecf[_0x8dba('0x34')],util[_0x8dba('0x38')](_0x548ecf,{'showHidden':![],'depth':null}));if(this[_0x8dba('0x18')][_0x548ecf[_0x8dba('0x34')]]){if(!_['isNil'](this[_0x8dba('0x18')][_0x548ecf[_0x8dba('0x34')]]['mohstarttime'])){this[_0x8dba('0x18')][_0x548ecf['uniqueid']][_0x8dba('0xbd')]+=moment()[_0x8dba('0xbe')](0x0)[_0x8dba('0xbf')](this['channels'][_0x548ecf['uniqueid']][_0x8dba('0xba')],_0x8dba('0x55'));logger[_0x8dba('0x32')](_0x8dba('0xc0'),_0x548ecf[_0x8dba('0x34')],this[_0x8dba('0x18')][_0x548ecf['uniqueid']][_0x8dba('0xbd')]);delete this[_0x8dba('0x18')][_0x548ecf[_0x8dba('0x34')]][_0x8dba('0xba')];}}}}catch(_0xf7a209){logger[_0x8dba('0x2d')]('[%s][voiceCallReport][musiconholdstop]',_0x548ecf[_0x8dba('0x34')],util[_0x8dba('0x38')](_0xf7a209,{'showHidden':![],'depth':null}));}};module[_0x8dba('0xc1')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 05844a1..a14cc51 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 _0x8e96=['info','membername','interface','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','voice:outbound','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','duration','endtime','diff','total','answered','holdtime','starttime','seconds','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','bind','dialend','syncDialEnd','varset','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','event','privilege'];(function(_0x3560bc,_0x5ae8d8){var _0x3a8087=function(_0x464ab4){while(--_0x464ab4){_0x3560bc['push'](_0x3560bc['shift']());}};_0x3a8087(++_0x5ae8d8);}(_0x8e96,0x182));var _0x68e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e96[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0x68e9('0x0'));var util=require(_0x68e9('0x1'));var Redis=require(_0x68e9('0x2'));var config=require(_0x68e9('0x3'));var logger=require(_0x68e9('0x4'))(_0x68e9('0x5'));var ami=require(_0x68e9('0x6'));config[_0x68e9('0x7')]=_[_0x68e9('0x8')](config[_0x68e9('0x7')],{'host':_0x68e9('0x9'),'port':0x18eb});var io=require(_0x68e9('0xa'))(new Redis(config[_0x68e9('0x7')]));function VoiceDialReport(_0x3417eb){this[_0x68e9('0xb')]=_0x3417eb[_0x68e9('0xc')];this[_0x68e9('0xd')]=_0x3417eb[_0x68e9('0xd')];this[_0x68e9('0xe')]={};ami['on'](_0x68e9('0xf'),this['syncDialBegin'][_0x68e9('0x10')](this));ami['on'](_0x68e9('0x11'),this[_0x68e9('0x12')]['bind'](this));ami['on'](_0x68e9('0x13'),this['syncVarSet']['bind'](this));ami['on'](_0x68e9('0x14'),this[_0x68e9('0x15')][_0x68e9('0x10')](this));}VoiceDialReport[_0x68e9('0x16')][_0x68e9('0x17')]=function(_0x594571){return _0x594571!==null&&!_[_0x68e9('0x18')](_0x594571);};VoiceDialReport[_0x68e9('0x16')][_0x68e9('0x19')]=function(_0x32be83,_0x428ad8,_0xf33e19){io['to'](_0x32be83)['emit'](_0x428ad8,_0xf33e19);};VoiceDialReport[_0x68e9('0x16')]['syncDialBegin']=function(_0x475942){try{if(this[_0x68e9('0x17')](_0x475942)){logger['debug']('[%s][voiceDialReport][dialbegin]\x20event:',_0x475942[_0x68e9('0x1a')],util[_0x68e9('0x1b')](_0x475942,{'showHidden':![],'depth':null}));if(this['channels'][_0x475942[_0x68e9('0x1a')]]){_[_0x68e9('0x1c')](this[_0x68e9('0xb')][_0x475942[_0x68e9('0x1a')]],{'starttime':moment()[_0x68e9('0x1d')](_0x68e9('0x1e')),'lastevent':_0x68e9('0x1f'),'interface':_0x475942['channel'][_0x68e9('0x20')](0x0,_0x475942[_0x68e9('0x21')][_0x68e9('0x22')]('-')),'membername':_0x475942['channel']['substring'](_0x475942[_0x68e9('0x21')][_0x68e9('0x22')]('/')+0x1,_0x475942[_0x68e9('0x21')][_0x68e9('0x22')]('-'))},_[_0x68e9('0x23')](_0x475942,[_0x68e9('0x24'),_0x68e9('0x25')]));logger[_0x68e9('0x26')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x475942[_0x68e9('0x1a')],this[_0x68e9('0xb')][_0x475942[_0x68e9('0x1a')]][_0x68e9('0x27')],this[_0x68e9('0xb')][_0x475942[_0x68e9('0x1a')]][_0x68e9('0x28')]);logger[_0x68e9('0x29')](_0x68e9('0x2a'),_0x475942[_0x68e9('0x1a')],util['inspect'](this[_0x68e9('0xb')][_0x475942[_0x68e9('0x1a')]],{'showHidden':![],'depth':null}));this[_0x68e9('0x19')]('voice:outbound',_0x68e9('0x2b'),this[_0x68e9('0xb')][_0x475942['uniqueid']]);logger[_0x68e9('0x29')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x475942['uniqueid'],util[_0x68e9('0x1b')](this[_0x68e9('0xb')][_0x475942[_0x68e9('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x68e9('0x19')](_0x68e9('0x2c'),this[_0x68e9('0xb')][_0x475942[_0x68e9('0x1a')]]);}}}catch(_0x27d69b){logger[_0x68e9('0x2d')](_0x68e9('0x2e'),_0x475942[_0x68e9('0x1a')],util[_0x68e9('0x1b')](_0x27d69b,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x68e9('0x12')]=function(_0xbd55ba){try{if(this[_0x68e9('0x17')](_0xbd55ba)){logger[_0x68e9('0x29')](_0x68e9('0x2f'),_0xbd55ba[_0x68e9('0x1a')],util[_0x68e9('0x1b')](_0xbd55ba,{'showHidden':![],'depth':null}));if(this[_0x68e9('0xb')][_0xbd55ba[_0x68e9('0x1a')]]){this[_0x68e9('0xb')][_0xbd55ba[_0x68e9('0x1a')]][_0x68e9('0x30')]=_0xbd55ba[_0x68e9('0x30')];if(_0xbd55ba[_0x68e9('0x30')]==='ANSWER'){this[_0x68e9('0xb')][_0xbd55ba[_0x68e9('0x1a')]][_0x68e9('0x31')]=_0xbd55ba['connectedlinenum'];this[_0x68e9('0xb')][_0xbd55ba['uniqueid']][_0x68e9('0x32')]=_0xbd55ba['connectedlinename'];this[_0x68e9('0xb')][_0xbd55ba[_0x68e9('0x1a')]][_0x68e9('0x33')]=moment()[_0x68e9('0x1d')](_0x68e9('0x1e'));this[_0x68e9('0xb')][_0xbd55ba['uniqueid']]['lastevent']=_0x68e9('0x34');logger[_0x68e9('0x26')](_0x68e9('0x35'),_0xbd55ba[_0x68e9('0x1a')],_0xbd55ba[_0x68e9('0x21')][_0x68e9('0x20')](_0xbd55ba[_0x68e9('0x21')][_0x68e9('0x22')]('/')+0x1,_0xbd55ba[_0x68e9('0x21')]['lastIndexOf']('-')));logger[_0x68e9('0x29')](_0x68e9('0x36'),_0xbd55ba[_0x68e9('0x1a')],util['inspect'](this['channels'][_0xbd55ba[_0x68e9('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x68e9('0x19')]('custom:dialconnect',this[_0x68e9('0xb')][_0xbd55ba[_0x68e9('0x1a')]]);}logger[_0x68e9('0x29')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0xbd55ba['uniqueid'],util[_0x68e9('0x1b')](this[_0x68e9('0xb')][_0xbd55ba[_0x68e9('0x1a')]],{'showHidden':![],'depth':null}));this[_0x68e9('0x19')](_0x68e9('0x37'),_0x68e9('0x2b'),this[_0x68e9('0xb')][_0xbd55ba[_0x68e9('0x1a')]]);}}}catch(_0x468089){logger[_0x68e9('0x2d')](_0x68e9('0x38'),_0xbd55ba[_0x68e9('0x1a')],util[_0x68e9('0x1b')](_0x468089,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x68e9('0x16')]['syncVarSet']=function(_0x1c4ab4){try{if(this[_0x68e9('0x17')](_0x1c4ab4)){logger[_0x68e9('0x29')](_0x68e9('0x39'),_0x1c4ab4[_0x68e9('0x1a')],util[_0x68e9('0x1b')](_0x1c4ab4,{'showHidden':![],'depth':null}));this['addVariable'](_0x1c4ab4[_0x68e9('0x1a')],_[_0x68e9('0x3a')](_0x1c4ab4[_0x68e9('0x3b')])[0x0],_0x1c4ab4[_0x68e9('0x3c')]);if(this[_0x68e9('0x17')](_0x1c4ab4[_0x68e9('0x3b')])&&this[_0x68e9('0x17')](_0x1c4ab4[_0x68e9('0x3b')][_0x68e9('0x3d')])){if(_[_0x68e9('0x18')](this[_0x68e9('0xb')][_0x1c4ab4['uniqueid']])){this['channels'][_0x1c4ab4['uniqueid']]={'routeId':_0x1c4ab4['value'],'variables':this[_0x68e9('0xe')][_0x1c4ab4[_0x68e9('0x1a')]]};logger['info'](_0x68e9('0x3e'),_0x1c4ab4[_0x68e9('0x1a')],_0x1c4ab4[_0x68e9('0x3b')][_0x68e9('0x3d')],_['keys'](_0x1c4ab4[_0x68e9('0x3b')])[0x0],_0x1c4ab4['value']);logger['debug']('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x1c4ab4[_0x68e9('0x1a')],util['inspect'](this[_0x68e9('0xb')][_0x1c4ab4[_0x68e9('0x1a')]],{'showHidden':![],'depth':null}));this[_0x68e9('0x19')]('voice:outbound','voice_outbound_channel:save',this[_0x68e9('0xb')][_0x1c4ab4[_0x68e9('0x1a')]]);}}}}catch(_0x5a9731){logger[_0x68e9('0x2d')](_0x68e9('0x3f'),_0x1c4ab4[_0x68e9('0x1a')],util[_0x68e9('0x1b')](_0x5a9731,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x68e9('0x16')][_0x68e9('0x40')]=function(_0x5b651d,_0x4bc8ca,_0x58f3fd){var _0xd71d5a=[_0x68e9('0x41'),_0x68e9('0x42'),'rtpaudioqosjitter',_0x68e9('0x43'),_0x68e9('0x44'),_0x68e9('0x45'),_0x68e9('0x46'),'rtpaudioqosrttbridged',_0x68e9('0x47'),_0x68e9('0x48'),_0x68e9('0x49'),_0x68e9('0x4a'),_0x68e9('0x4b'),_0x68e9('0x4c'),_0x68e9('0x4d'),'memberlastcall','membername',_0x68e9('0x4e'),_0x68e9('0x4f')];if(!_['isNil'](_0x4bc8ca)&&!_[_0x68e9('0x50')](_0xd71d5a,_0x4bc8ca)){if(_[_0x68e9('0x18')](this['variables'][_0x5b651d])){this[_0x68e9('0xe')][_0x5b651d]={};}this[_0x68e9('0xe')][_0x5b651d][_0x4bc8ca]=_0x58f3fd;}};VoiceDialReport[_0x68e9('0x16')][_0x68e9('0x15')]=function(_0x2b6ae0){try{if(this[_0x68e9('0x17')](_0x2b6ae0)){logger[_0x68e9('0x29')](_0x68e9('0x51'),_0x2b6ae0[_0x68e9('0x1a')],util['inspect'](_0x2b6ae0,{'showHidden':![],'depth':null}));if(this['channels'][_0x2b6ae0[_0x68e9('0x1a')]]){logger[_0x68e9('0x26')](_0x68e9('0x52'),_0x2b6ae0['uniqueid'],_0x2b6ae0[_0x68e9('0x53')]);this['channels'][_0x2b6ae0['uniqueid']]['endtime']=moment()[_0x68e9('0x1d')](_0x68e9('0x1e'));this['channels'][_0x2b6ae0[_0x68e9('0x1a')]][_0x68e9('0x54')]=moment(this['channels'][_0x2b6ae0[_0x68e9('0x1a')]][_0x68e9('0x55')])[_0x68e9('0x56')](this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x1a')]]['starttime'],'seconds');this['channels'][_0x2b6ae0[_0x68e9('0x1a')]]['lastevent']='complete';this[_0x68e9('0xd')][_0x68e9('0x57')]+=0x1;if(this['channels'][_0x2b6ae0[_0x68e9('0x1a')]]['answertime']){this[_0x68e9('0xd')][_0x68e9('0x58')]+=0x1;this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x1a')]][_0x68e9('0x59')]=moment(this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x1a')]]['answertime'])[_0x68e9('0x56')](this['channels'][_0x2b6ae0[_0x68e9('0x1a')]][_0x68e9('0x5a')],_0x68e9('0x5b'));this['channels'][_0x2b6ae0[_0x68e9('0x1a')]][_0x68e9('0x5c')]=moment(this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x1a')]][_0x68e9('0x55')])[_0x68e9('0x56')](this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x1a')]][_0x68e9('0x33')],_0x68e9('0x5b'));this['outbound'][_0x68e9('0x5d')]+=this['channels'][_0x2b6ae0[_0x68e9('0x1a')]]['holdtime']||0x0;this[_0x68e9('0xd')][_0x68e9('0x5e')]+=this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x1a')]][_0x68e9('0x5c')];}this[_0x68e9('0xd')][_0x68e9('0x5f')]+=this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x1a')]][_0x68e9('0x54')];logger['debug'](_0x68e9('0x60'),_0x2b6ae0['uniqueid'],util[_0x68e9('0x1b')](this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x1a')]],{'showHidden':![],'depth':null}));ami['emit'](_0x68e9('0x61'),this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x1a')]]);logger[_0x68e9('0x29')](_0x68e9('0x62'),_0x2b6ae0['uniqueid'],util[_0x68e9('0x1b')](this[_0x68e9('0xb')][_0x2b6ae0['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x68e9('0x63'),this['channels'][_0x2b6ae0[_0x68e9('0x1a')]]);logger[_0x68e9('0x29')](_0x68e9('0x64'),_0x2b6ae0[_0x68e9('0x1a')],util[_0x68e9('0x1b')](this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x1a')]],{'showHidden':![],'depth':null}));this[_0x68e9('0x19')](_0x68e9('0x37'),'voice_outbound:save',this[_0x68e9('0xd')]);logger[_0x68e9('0x26')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x68e9('0x65')](this['channels'][_0x2b6ae0[_0x68e9('0x1a')]]));logger['debug'](_0x68e9('0x66'),_0x2b6ae0['uniqueid'],util[_0x68e9('0x1b')](this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x1a')]],{'showHidden':![],'depth':null}));this[_0x68e9('0x19')](_0x68e9('0x37'),_0x68e9('0x67'),this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x1a')]]);delete this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x1a')]];}else if(this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x68')]]){this[_0x68e9('0xb')][_0x2b6ae0[_0x68e9('0x68')]]['uniqueid']=this[_0x68e9('0xb')][_0x2b6ae0['linkedid']][_0x68e9('0x69')];}if(this[_0x68e9('0xe')][_0x2b6ae0[_0x68e9('0x1a')]]){delete this['variables'][_0x2b6ae0[_0x68e9('0x1a')]];}}}catch(_0x3d36e7){logger[_0x68e9('0x2d')]('[%s][voiceDialReport][hangup]',_0x2b6ae0[_0x68e9('0x1a')],util[_0x68e9('0x1b')](_0x3d36e7,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0x51fb=['sumDuration','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','exports','lodash','moment','util','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','outboundChannels','outbound','variables','dialbegin','dialend','syncDialEnd','syncVarSet','hangup','syncHangup','isNotNull','isUndefined','prototype','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','channels','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','privilege','info','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','variable','value','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','keys','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberpenalty','memberrealtime','includes','[%s][voiceDialReport][hangup]\x20event:','cause-txt','endtime','duration','starttime','lastevent','complete','total','answered','diff','seconds','sumHoldTime','holdtime','sumBillable'];(function(_0x3cf302,_0x33d020){var _0x3ad0ae=function(_0x39d930){while(--_0x39d930){_0x3cf302['push'](_0x3cf302['shift']());}};_0x3ad0ae(++_0x33d020);}(_0x51fb,0xe1));var _0xb51f=function(_0x5c2bf9,_0x5cadcb){_0x5c2bf9=_0x5c2bf9-0x0;var _0x4f1285=_0x51fb[_0x5c2bf9];return _0x4f1285;};'use strict';var _=require(_0xb51f('0x0'));var moment=require(_0xb51f('0x1'));var util=require(_0xb51f('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xb51f('0x3'))(_0xb51f('0x4'));var ami=require(_0xb51f('0x5'));config[_0xb51f('0x6')]=_[_0xb51f('0x7')](config[_0xb51f('0x6')],{'host':_0xb51f('0x8'),'port':0x18eb});var io=require(_0xb51f('0x9'))(new Redis(config[_0xb51f('0x6')]));function VoiceDialReport(_0x1b74a2){this['channels']=_0x1b74a2[_0xb51f('0xa')];this[_0xb51f('0xb')]=_0x1b74a2[_0xb51f('0xb')];this[_0xb51f('0xc')]={};ami['on'](_0xb51f('0xd'),this['syncDialBegin']['bind'](this));ami['on'](_0xb51f('0xe'),this[_0xb51f('0xf')]['bind'](this));ami['on']('varset',this[_0xb51f('0x10')]['bind'](this));ami['on'](_0xb51f('0x11'),this[_0xb51f('0x12')]['bind'](this));}VoiceDialReport['prototype'][_0xb51f('0x13')]=function(_0x5d0fd0){return _0x5d0fd0!==null&&!_[_0xb51f('0x14')](_0x5d0fd0);};VoiceDialReport[_0xb51f('0x15')][_0xb51f('0x16')]=function(_0x2c3786,_0x12fabe,_0x844629){io['to'](_0x2c3786)['emit'](_0x12fabe,_0x844629);};VoiceDialReport[_0xb51f('0x15')]['syncDialBegin']=function(_0xf2a70c){try{if(this[_0xb51f('0x13')](_0xf2a70c)){logger[_0xb51f('0x17')](_0xb51f('0x18'),_0xf2a70c[_0xb51f('0x19')],util[_0xb51f('0x1a')](_0xf2a70c,{'showHidden':![],'depth':null}));if(this[_0xb51f('0x1b')][_0xf2a70c[_0xb51f('0x19')]]){_['merge'](this['channels'][_0xf2a70c[_0xb51f('0x19')]],{'starttime':moment()[_0xb51f('0x1c')](_0xb51f('0x1d')),'lastevent':_0xb51f('0x1e'),'interface':_0xf2a70c['channel'][_0xb51f('0x1f')](0x0,_0xf2a70c[_0xb51f('0x20')][_0xb51f('0x21')]('-')),'membername':_0xf2a70c['channel'][_0xb51f('0x1f')](_0xf2a70c[_0xb51f('0x20')][_0xb51f('0x21')]('/')+0x1,_0xf2a70c[_0xb51f('0x20')][_0xb51f('0x21')]('-'))},_[_0xb51f('0x22')](_0xf2a70c,['event',_0xb51f('0x23')]));logger[_0xb51f('0x24')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0xf2a70c['uniqueid'],this['channels'][_0xf2a70c[_0xb51f('0x19')]][_0xb51f('0x25')],this[_0xb51f('0x1b')][_0xf2a70c['uniqueid']][_0xb51f('0x26')]);logger[_0xb51f('0x17')](_0xb51f('0x27'),_0xf2a70c[_0xb51f('0x19')],util[_0xb51f('0x1a')](this[_0xb51f('0x1b')][_0xf2a70c['uniqueid']],{'showHidden':![],'depth':null}));this[_0xb51f('0x16')](_0xb51f('0x28'),_0xb51f('0x29'),this[_0xb51f('0x1b')][_0xf2a70c[_0xb51f('0x19')]]);logger['debug'](_0xb51f('0x2a'),_0xf2a70c['uniqueid'],util[_0xb51f('0x1a')](this[_0xb51f('0x1b')][_0xf2a70c[_0xb51f('0x19')]],{'showHidden':![],'depth':null}));ami[_0xb51f('0x16')](_0xb51f('0x2b'),this['channels'][_0xf2a70c[_0xb51f('0x19')]]);}}}catch(_0x2176a9){logger[_0xb51f('0x2c')](_0xb51f('0x2d'),_0xf2a70c[_0xb51f('0x19')],util[_0xb51f('0x1a')](_0x2176a9,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb51f('0x15')][_0xb51f('0xf')]=function(_0x18e717){try{if(this[_0xb51f('0x13')](_0x18e717)){logger[_0xb51f('0x17')](_0xb51f('0x2e'),_0x18e717[_0xb51f('0x19')],util[_0xb51f('0x1a')](_0x18e717,{'showHidden':![],'depth':null}));if(this[_0xb51f('0x1b')][_0x18e717['uniqueid']]){this[_0xb51f('0x1b')][_0x18e717[_0xb51f('0x19')]]['dialstatus']=_0x18e717[_0xb51f('0x2f')];if(_0x18e717[_0xb51f('0x2f')]===_0xb51f('0x30')){this[_0xb51f('0x1b')][_0x18e717[_0xb51f('0x19')]][_0xb51f('0x31')]=_0x18e717[_0xb51f('0x31')];this[_0xb51f('0x1b')][_0x18e717[_0xb51f('0x19')]][_0xb51f('0x32')]=_0x18e717['connectedlinename'];this[_0xb51f('0x1b')][_0x18e717['uniqueid']][_0xb51f('0x33')]=moment()['format'](_0xb51f('0x1d'));this['channels'][_0x18e717['uniqueid']]['lastevent']=_0xb51f('0x34');logger['info'](_0xb51f('0x35'),_0x18e717[_0xb51f('0x19')],_0x18e717['channel'][_0xb51f('0x1f')](_0x18e717['channel'][_0xb51f('0x21')]('/')+0x1,_0x18e717[_0xb51f('0x20')]['lastIndexOf']('-')));logger[_0xb51f('0x17')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x18e717[_0xb51f('0x19')],util['inspect'](this[_0xb51f('0x1b')][_0x18e717[_0xb51f('0x19')]],{'showHidden':![],'depth':null}));ami[_0xb51f('0x16')](_0xb51f('0x36'),this[_0xb51f('0x1b')][_0x18e717[_0xb51f('0x19')]]);}logger[_0xb51f('0x17')](_0xb51f('0x37'),_0x18e717[_0xb51f('0x19')],util[_0xb51f('0x1a')](this['channels'][_0x18e717[_0xb51f('0x19')]],{'showHidden':![],'depth':null}));this['emit'](_0xb51f('0x28'),'voice_outbound_channel:save',this['channels'][_0x18e717['uniqueid']]);}}}catch(_0x21bbd6){logger[_0xb51f('0x2c')](_0xb51f('0x38'),_0x18e717['uniqueid'],util[_0xb51f('0x1a')](_0x21bbd6,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb51f('0x15')][_0xb51f('0x10')]=function(_0xa0d61d){try{if(this[_0xb51f('0x13')](_0xa0d61d)){logger[_0xb51f('0x17')](_0xb51f('0x39'),_0xa0d61d['uniqueid'],util[_0xb51f('0x1a')](_0xa0d61d,{'showHidden':![],'depth':null}));this[_0xb51f('0x3a')](_0xa0d61d[_0xb51f('0x19')],_['keys'](_0xa0d61d['variable'])[0x0],_0xa0d61d['value']);if(this[_0xb51f('0x13')](_0xa0d61d[_0xb51f('0x3b')])&&this['isNotNull'](_0xa0d61d['variable']['outboundrouteid'])){if(_['isUndefined'](this['channels'][_0xa0d61d[_0xb51f('0x19')]])){this['channels'][_0xa0d61d['uniqueid']]={'routeId':_0xa0d61d[_0xb51f('0x3c')],'variables':this[_0xb51f('0xc')][_0xa0d61d[_0xb51f('0x19')]]};logger[_0xb51f('0x24')](_0xb51f('0x3d'),_0xa0d61d[_0xb51f('0x19')],_0xa0d61d[_0xb51f('0x3b')][_0xb51f('0x3e')],_[_0xb51f('0x3f')](_0xa0d61d[_0xb51f('0x3b')])[0x0],_0xa0d61d['value']);logger['debug'](_0xb51f('0x40'),_0xa0d61d['uniqueid'],util[_0xb51f('0x1a')](this[_0xb51f('0x1b')][_0xa0d61d[_0xb51f('0x19')]],{'showHidden':![],'depth':null}));this[_0xb51f('0x16')](_0xb51f('0x28'),'voice_outbound_channel:save',this['channels'][_0xa0d61d[_0xb51f('0x19')]]);}}}}catch(_0x4afc6d){logger[_0xb51f('0x2c')](_0xb51f('0x41'),_0xa0d61d['uniqueid'],util[_0xb51f('0x1a')](_0x4afc6d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb51f('0x15')][_0xb51f('0x3a')]=function(_0x26fec8,_0x12f076,_0x18e3c4){var _0x4f99e4=[_0xb51f('0x42'),_0xb51f('0x43'),_0xb51f('0x44'),_0xb51f('0x45'),_0xb51f('0x46'),_0xb51f('0x47'),_0xb51f('0x48'),'rtpaudioqosrttbridged',_0xb51f('0x49'),_0xb51f('0x4a'),_0xb51f('0x4b'),_0xb51f('0x4c'),_0xb51f('0x4d'),_0xb51f('0x4e'),'memberinterface','memberlastcall',_0xb51f('0x25'),_0xb51f('0x4f'),_0xb51f('0x50')];if(!_['isNil'](_0x12f076)&&!_[_0xb51f('0x51')](_0x4f99e4,_0x12f076)){if(_[_0xb51f('0x14')](this[_0xb51f('0xc')][_0x26fec8])){this[_0xb51f('0xc')][_0x26fec8]={};}this[_0xb51f('0xc')][_0x26fec8][_0x12f076]=_0x18e3c4;}};VoiceDialReport[_0xb51f('0x15')]['syncHangup']=function(_0x427351){try{if(this[_0xb51f('0x13')](_0x427351)){logger['debug'](_0xb51f('0x52'),_0x427351[_0xb51f('0x19')],util[_0xb51f('0x1a')](_0x427351,{'showHidden':![],'depth':null}));if(this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]]){logger[_0xb51f('0x24')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x427351[_0xb51f('0x19')],_0x427351[_0xb51f('0x53')]);this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]][_0xb51f('0x54')]=moment()[_0xb51f('0x1c')](_0xb51f('0x1d'));this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]][_0xb51f('0x55')]=moment(this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]][_0xb51f('0x54')])['diff'](this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]][_0xb51f('0x56')],'seconds');this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]][_0xb51f('0x57')]=_0xb51f('0x58');this['outbound'][_0xb51f('0x59')]+=0x1;if(this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]]['answertime']){this[_0xb51f('0xb')][_0xb51f('0x5a')]+=0x1;this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]]['holdtime']=moment(this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]][_0xb51f('0x33')])[_0xb51f('0x5b')](this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]][_0xb51f('0x56')],_0xb51f('0x5c'));this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]]['billableseconds']=moment(this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]]['endtime'])[_0xb51f('0x5b')](this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]][_0xb51f('0x33')],_0xb51f('0x5c'));this[_0xb51f('0xb')][_0xb51f('0x5d')]+=this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]][_0xb51f('0x5e')]||0x0;this[_0xb51f('0xb')][_0xb51f('0x5f')]+=this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]]['billableseconds'];}this['outbound'][_0xb51f('0x60')]+=this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]][_0xb51f('0x55')];logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x427351['uniqueid'],util[_0xb51f('0x1a')](this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]],{'showHidden':![],'depth':null}));ami[_0xb51f('0x16')]('custom:voiceDialReport',this[_0xb51f('0x1b')][_0x427351['uniqueid']]);logger[_0xb51f('0x17')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x427351[_0xb51f('0x19')],util[_0xb51f('0x1a')](this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x19')]],{'showHidden':![],'depth':null}));ami[_0xb51f('0x16')](_0xb51f('0x61'),this['channels'][_0x427351[_0xb51f('0x19')]]);logger[_0xb51f('0x17')](_0xb51f('0x62'),_0x427351[_0xb51f('0x19')],util[_0xb51f('0x1a')](this[_0xb51f('0x1b')][_0x427351['uniqueid']],{'showHidden':![],'depth':null}));this[_0xb51f('0x16')](_0xb51f('0x28'),_0xb51f('0x63'),this[_0xb51f('0xb')]);logger[_0xb51f('0x24')](_0xb51f('0x64'),JSON[_0xb51f('0x65')](this[_0xb51f('0x1b')][_0x427351['uniqueid']]));logger[_0xb51f('0x17')](_0xb51f('0x66'),_0x427351[_0xb51f('0x19')],util['inspect'](this['channels'][_0x427351[_0xb51f('0x19')]],{'showHidden':![],'depth':null}));this[_0xb51f('0x16')](_0xb51f('0x28'),_0xb51f('0x67'),this['channels'][_0x427351[_0xb51f('0x19')]]);delete this['channels'][_0x427351[_0xb51f('0x19')]];}else if(this['channels'][_0x427351['linkedid']]){this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x68')]][_0xb51f('0x19')]=this[_0xb51f('0x1b')][_0x427351[_0xb51f('0x68')]][_0xb51f('0x69')];}if(this['variables'][_0x427351['uniqueid']]){delete this[_0xb51f('0xc')][_0x427351[_0xb51f('0x19')]];}}}catch(_0x36c4dd){logger[_0xb51f('0x2c')]('[%s][voiceDialReport][hangup]',_0x427351[_0xb51f('0x19')],util[_0xb51f('0x1a')](_0x36c4dd,{'showHidden':![],'depth':null}));}};module[_0xb51f('0x6a')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 5fd43e9..d15a081 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 _0xae2b=['syncAgentComplete','agentconnect','syncAgentConnect','syncVarSet','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','channels','switch','enqueue','isNil','Action','status','channel','message','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','agents','prototype','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_channel:remove','type','inbound','available','sumBillable','sumDuration','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','debug','voice_queue:save','isNotNull','isUndefined','queues','catch','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','callers','toNumber','loggedin','emitVoiceQueueSummary','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','info','merge','pick','push','[%s][voiceQueueReport][queuecallerabandon]','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','last','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','membername','queuecallerexitAt','transfer','reason','COMPLETED','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','linkedid','COMPLETEDBY','addVariable','keys','variable','value','queuestatus','CONTINUE','queuecallerexit','TIMEOUT','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','varset','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','sumHoldTime','diff','answered','milliseconds','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','ATTENDEDTRANSFER','ATTENDED','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','BLINDTRANSFER','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','tail','finally','sequence','queueReports','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete'];(function(_0x10e653,_0x59f1cc){var _0x328dfd=function(_0x2bc428){while(--_0x2bc428){_0x10e653['push'](_0x10e653['shift']());}};_0x328dfd(++_0x59f1cc);}(_0xae2b,0xb3));var _0xbae2=function(_0x2dc697,_0x19df72){_0x2dc697=_0x2dc697-0x0;var _0x40f040=_0xae2b[_0x2dc697];return _0x40f040;};'use strict';var _=require(_0xbae2('0x0'));var moment=require(_0xbae2('0x1'));var util=require('util');var md5=require(_0xbae2('0x2'));var Redis=require(_0xbae2('0x3'));var config=require(_0xbae2('0x4'));var logger=require(_0xbae2('0x5'))(_0xbae2('0x6'));var ami=require(_0xbae2('0x7'));var QueueReport=require('../model/queueReport');config[_0xbae2('0x8')]=_['defaults'](config[_0xbae2('0x8')],{'host':_0xbae2('0x9'),'port':0x18eb});var io=require(_0xbae2('0xa'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x54d696){this[_0xbae2('0xb')]=this[_0xbae2('0xb')]?this[_0xbae2('0xb')][_0xbae2('0xc')](_0x54d696):_0x54d696();};function VoiceQueueReport(_0x27ea94){this[_0xbae2('0xd')]=new Sequence();this[_0xbae2('0xe')]={};this['agents']=_0x27ea94['agents'];this['channels']=_0x27ea94[_0xbae2('0xf')];this['voiceQueues']=_0x27ea94[_0xbae2('0x10')];this[_0xbae2('0x11')]=!![];this[_0xbae2('0x12')]=_0x27ea94['campaigns'];this[_0xbae2('0x13')]={};ami['on'](_0xbae2('0x14'),this['syncQueueSummary'][_0xbae2('0x15')](this));ami['on'](_0xbae2('0x16'),this[_0xbae2('0x17')][_0xbae2('0x15')](this));ami['on'](_0xbae2('0x18'),this[_0xbae2('0x19')][_0xbae2('0x15')](this));ami['on']('queuecallerabandon',this[_0xbae2('0x1a')]['bind'](this));ami['on'](_0xbae2('0x1b'),this[_0xbae2('0x1c')]['bind'](this));ami['on'](_0xbae2('0x1d'),this[_0xbae2('0x1e')]['bind'](this));ami['on'](_0xbae2('0x1f'),this[_0xbae2('0x20')][_0xbae2('0x15')](this));ami['on']('varset',this[_0xbae2('0x21')]['bind'](this));ami['on']('hangup',this[_0xbae2('0x22')][_0xbae2('0x15')](this));ami['on'](_0xbae2('0x23'),this[_0xbae2('0x24')]['bind'](this));ami['on'](_0xbae2('0x25'),this[_0xbae2('0x26')]['bind'](this));ami['on']('musiconholdstop',this[_0xbae2('0x27')][_0xbae2('0x15')](this));ami['on'](_0xbae2('0x28'),this[_0xbae2('0x29')][_0xbae2('0x15')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xbae2('0x15')](this));this[_0xbae2('0x2a')]();this['loopQueueShow']();}function clearChannels(_0x2f1da9){if(!_[_0xbae2('0x2b')](_0x2f1da9)){for(var _0x4154fd in _0x2f1da9){if(_0x2f1da9[_0xbae2('0x2c')](_0x4154fd)){delete _0x2f1da9[_0x4154fd];}}}}function clearCampaigns(_0x5b084f){if(!_[_0xbae2('0x2b')](_0x5b084f)){for(var _0x4827c1 in _0x5b084f){if(_0x5b084f[_0xbae2('0x2c')](_0x4827c1)){_0x5b084f[_0x4827c1][_0xbae2('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x245a74){if(!_[_0xbae2('0x2b')](_0x245a74)){for(var _0x141baa in _0x245a74){if(_0x245a74['hasOwnProperty'](_0x141baa)){_0x245a74[_0x141baa][_0xbae2('0x2d')]=0x0;_0x245a74[_0x141baa][_0xbae2('0x2e')]=0x0;_0x245a74[_0x141baa]['pTalking']=0x0;_0x245a74[_0x141baa][_0xbae2('0x2f')]=0x0;_0x245a74[_0x141baa][_0xbae2('0x30')]=!![];}}}}function clearAgentBooked(_0x339f83){if(!_[_0xbae2('0x2b')](_0x339f83)){for(var _0x25eba1 in _0x339f83){if(_0x339f83['hasOwnProperty'](_0x25eba1)){_0x339f83[_0x25eba1][_0xbae2('0x31')]=!![];}}}}VoiceQueueReport['prototype'][_0xbae2('0x32')]=function(){var _0x37e0f7=this;for(var _0x2ef178 in this[_0xbae2('0x33')]){if(this[_0xbae2('0x33')][_0xbae2('0x2c')](_0x2ef178)&&!this[_0xbae2('0x33')][_0x2ef178][_0xbae2('0x34')]){this[_0xbae2('0xd')][_0xbae2('0x35')](function(){if(!_[_0xbae2('0x36')](_0x37e0f7[_0xbae2('0x33')][_0x2ef178])){return ami[_0xbae2('0x37')]({'action':_0xbae2('0x38'),'channel':_0x37e0f7[_0xbae2('0x33')][_0x2ef178][_0xbae2('0x39')]})['catch'](function(_0x39820a){if(_0x39820a[_0xbae2('0x3a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x37e0f7['channels'][_0x2ef178]){delete _0x37e0f7[_0xbae2('0x33')][_0x2ef178];logger[_0xbae2('0x3b')](_0xbae2('0x3c'),_0x2ef178,util[_0xbae2('0x3d')](_0x39820a,{'showHidden':![],'depth':null}));}if(_0x37e0f7['queueReports'][_0x2ef178]){delete _0x37e0f7[_0xbae2('0xe')][_0x2ef178];logger[_0xbae2('0x3b')](_0xbae2('0x3e'),_0x2ef178,util[_0xbae2('0x3d')](_0x39820a,{'showHidden':![],'depth':null}));}if(_0x37e0f7[_0xbae2('0x13')][_0x2ef178]){delete _0x37e0f7[_0xbae2('0x13')][_0x2ef178];logger[_0xbae2('0x3b')](_0xbae2('0x3f'),_0x2ef178,util[_0xbae2('0x3d')](_0x39820a,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0xbae2('0x24')]=function(){logger[_0xbae2('0x3b')](_0xbae2('0x40'));clearChannels(this[_0xbae2('0x33')]);this['clearQueueReport'](this[_0xbae2('0xe')]);clearAgentBooked(this[_0xbae2('0x41')]);clearVoiceQueues(this[_0xbae2('0x10')]);clearCampaigns(this[_0xbae2('0x12')]);};VoiceQueueReport[_0xbae2('0x42')]['clearQueueReport']=function(_0x21f1e1){var _0x49fcfb=this;if(!_[_0xbae2('0x2b')](_0x21f1e1)){for(var _0x14ac8d in _0x21f1e1){if(_0x21f1e1[_0xbae2('0x2c')](_0x14ac8d)){_0x49fcfb[_0xbae2('0x43')](_0x21f1e1[_0x14ac8d],'clearqueuereport');delete _0x21f1e1[_0x14ac8d];}}}};VoiceQueueReport[_0xbae2('0x42')]['emit']=function(_0x57198b,_0x4f57f5,_0x323459){io['to'](_0x57198b)[_0xbae2('0x44')](_0x4f57f5,_0x323459);};VoiceQueueReport[_0xbae2('0x42')][_0xbae2('0x45')]=function(_0x78ec8b,_0x4da7a4){logger['debug'](_0xbae2('0x46')+_0x4da7a4+']\x20sending\x20voice_queue_channel:save\x20event:',_0x78ec8b[_0xbae2('0x47')],util[_0xbae2('0x3d')](_0x78ec8b,{'showHidden':![],'depth':null}));this[_0xbae2('0x44')](util[_0xbae2('0x48')](_0xbae2('0x49'),_0x78ec8b[_0xbae2('0x4a')]),_0xbae2('0x4b'),_0x78ec8b);io[_0xbae2('0x44')](_0xbae2('0x4c'),_0x78ec8b);};VoiceQueueReport[_0xbae2('0x42')][_0xbae2('0x43')]=function(_0x389075,_0x566db5){logger['debug']('[%s][voiceQueueReport]['+_0x566db5+_0xbae2('0x4d'),_0x389075[_0xbae2('0x47')],util['inspect'](_0x389075,{'showHidden':![],'depth':null}));this[_0xbae2('0x44')](util[_0xbae2('0x48')](_0xbae2('0x49'),_0x389075[_0xbae2('0x4a')]),_0xbae2('0x4e'),_0x389075);io['emit']('voice_queue_presence:remove',_0x389075);};VoiceQueueReport[_0xbae2('0x42')]['emitVoiceQueueSummary']=function(_0x3ba1f9,_0x931ed7){if(_0x3ba1f9[_0xbae2('0x4f')]===_0xbae2('0x50')){var _0x37fa18={'id':_0x3ba1f9['id'],'name':_0x3ba1f9['name'],'strategy':_0x3ba1f9['strategy'],'answered':_0x3ba1f9['answered'],'available':_0x3ba1f9[_0xbae2('0x51')],'loggedIn':_0x3ba1f9['loggedIn'],'pTalking':_0x3ba1f9['pTalking'],'sumBillable':_0x3ba1f9[_0xbae2('0x52')],'sumDuration':_0x3ba1f9[_0xbae2('0x53')],'sumHoldTime':_0x3ba1f9['sumHoldTime']||0x0,'talking':_0x3ba1f9['talking'],'total':_0x3ba1f9['total'],'type':_0x3ba1f9['type'],'unmanaged':_0x3ba1f9[_0xbae2('0x54')],'abandoned':_0x3ba1f9[_0xbae2('0x55')],'waiting':_0x3ba1f9['waiting']};if(_0x3ba1f9[_0xbae2('0x56')]){_0x37fa18[_0xbae2('0x56')]={'id':_0x3ba1f9[_0xbae2('0x56')]['id'],'name':_0x3ba1f9[_0xbae2('0x56')][_0xbae2('0x4a')],'active':_0x3ba1f9[_0xbae2('0x56')][_0xbae2('0x57')],'callerid':_0x3ba1f9[_0xbae2('0x56')][_0xbae2('0x58')]};}if(_0x3ba1f9[_0xbae2('0x59')]){_0x37fa18[_0xbae2('0x59')]={'id':_0x3ba1f9[_0xbae2('0x59')]['id'],'name':_0x3ba1f9['Interval'][_0xbae2('0x4a')]};}var _0x5630ac=md5(JSON[_0xbae2('0x5a')](_0x37fa18));if(_0x3ba1f9['md5']!==_0x5630ac){_0x3ba1f9[_0xbae2('0x2')]=_0x5630ac;logger[_0xbae2('0x5b')]('[voiceQueueReport]['+_0x931ed7+']\x20sending\x20voice_queue:save\x20event:',util[_0xbae2('0x3d')](_0x37fa18,{'showHidden':![],'depth':null}));this[_0xbae2('0x44')](util[_0xbae2('0x48')](_0xbae2('0x49'),_0x37fa18[_0xbae2('0x4a')]),_0xbae2('0x5c'),_0x37fa18);}}};VoiceQueueReport[_0xbae2('0x42')][_0xbae2('0x5d')]=function(_0x527514){return _0x527514!==null&&!_[_0xbae2('0x5e')](_0x527514);};VoiceQueueReport[_0xbae2('0x42')]['loopQueueShow']=function(){var _0x1b14db=this;setInterval(function(){_0x1b14db[_0xbae2('0x32')]();ami[_0xbae2('0x37')]({'action':_0xbae2('0x5f')})[_0xbae2('0x60')](function(_0x1ef83f){logger[_0xbae2('0x3b')]('[voiceQueueReport][queues]',util[_0xbae2('0x3d')](_0x1ef83f,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xbae2('0x42')][_0xbae2('0x2a')]=function(){var _0x57221a=this;setInterval(function(){if(_0x57221a[_0xbae2('0x11')]){return ami['Action']({'action':_0xbae2('0x14')})[_0xbae2('0x61')](function(_0x117ed7){_0x57221a[_0xbae2('0x11')]=![];})[_0xbae2('0x60')](function(_0x2d38da){logger[_0xbae2('0x3b')](_0xbae2('0x62'),util[_0xbae2('0x3d')](_0x2d38da,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xbae2('0x42')]['syncQueueSummary']=function(_0x20238b){try{if(this[_0xbae2('0x5d')](_0x20238b)&&this[_0xbae2('0x5d')](_0x20238b[_0xbae2('0x63')])){logger[_0xbae2('0x5b')](_0xbae2('0x64'),util[_0xbae2('0x3d')](_0x20238b,{'showHidden':![],'depth':null}));if(this[_0xbae2('0x10')][_0x20238b['queue']]){logger['info'](_0xbae2('0x65'),_0x20238b[_0xbae2('0x63')]);var _0xbfbb31=_['countBy'](this[_0xbae2('0x33')],_0xbae2('0x63'))[_0x20238b[_0xbae2('0x63')]]||0x0;var _0x3a3058=_0xbfbb31-_0x20238b[_0xbae2('0x66')];if(this[_0xbae2('0x10')][_0x20238b[_0xbae2('0x63')]][_0xbae2('0x2f')]!==_['toNumber'](_0x20238b[_0xbae2('0x66')])||this['voiceQueues'][_0x20238b[_0xbae2('0x63')]]['loggedIn']!==_[_0xbae2('0x67')](_0x20238b['loggedin'])||this[_0xbae2('0x10')][_0x20238b['queue']]['available']!==_[_0xbae2('0x67')](_0x20238b[_0xbae2('0x51')])||this['voiceQueues'][_0x20238b[_0xbae2('0x63')]][_0xbae2('0x2e')]!==_0x3a3058){this[_0xbae2('0x10')][_0x20238b[_0xbae2('0x63')]][_0xbae2('0x2f')]=_['toNumber'](_0x20238b[_0xbae2('0x66')]);this['voiceQueues'][_0x20238b[_0xbae2('0x63')]]['loggedIn']=_[_0xbae2('0x67')](_0x20238b[_0xbae2('0x68')]);this['voiceQueues'][_0x20238b['queue']][_0xbae2('0x51')]=_[_0xbae2('0x67')](_0x20238b[_0xbae2('0x51')]);this[_0xbae2('0x10')][_0x20238b[_0xbae2('0x63')]][_0xbae2('0x2e')]=_0x3a3058>0x0?_0x3a3058:0x0;this['voiceQueues'][_0x20238b[_0xbae2('0x63')]][_0xbae2('0x2e')]=this[_0xbae2('0x10')][_0x20238b[_0xbae2('0x63')]][_0xbae2('0x2e')]>_[_0xbae2('0x67')](_0x20238b[_0xbae2('0x68')])?_['toNumber'](_0x20238b['loggedin']):this[_0xbae2('0x10')][_0x20238b[_0xbae2('0x63')]][_0xbae2('0x2e')];this[_0xbae2('0x69')](this[_0xbae2('0x10')][_0x20238b[_0xbae2('0x63')]],'queuesummary');}logger[_0xbae2('0x5b')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this[_0xbae2('0x10')][_0x20238b['queue']],{'showHidden':![],'depth':null}));ami[_0xbae2('0x44')](_0xbae2('0x6a'),this['voiceQueues'][_0x20238b[_0xbae2('0x63')]]);}}}catch(_0xfb4696){logger[_0xbae2('0x3b')]('[voiceQueueReport][queuesummary]',util[_0xbae2('0x3d')](_0xfb4696,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbae2('0x42')][_0xbae2('0x17')]=function(_0x298ab2){logger[_0xbae2('0x5b')](_0xbae2('0x6b'),util[_0xbae2('0x3d')](_0x298ab2,{'showHidden':![],'depth':null}));this[_0xbae2('0x11')]=!![];};VoiceQueueReport[_0xbae2('0x42')][_0xbae2('0x19')]=function(_0x32e212){try{if(this[_0xbae2('0x5d')](_0x32e212)){logger[_0xbae2('0x5b')](_0xbae2('0x6c'),_0x32e212[_0xbae2('0x47')],util[_0xbae2('0x3d')](_0x32e212,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x32e212[_0xbae2('0x47')]])){this['queueReports'][_0x32e212[_0xbae2('0x47')]]=[];this['channels'][_0x32e212['uniqueid']]={};}var _0x14405a=new QueueReport();_0x14405a[_0xbae2('0x4a')]=_0x32e212['queue'];_0x14405a['type']=this[_0xbae2('0x10')][_0x14405a[_0xbae2('0x4a')]]&&this[_0xbae2('0x10')][_0x14405a[_0xbae2('0x4a')]][_0xbae2('0x4f')]?this[_0xbae2('0x10')][_0x14405a[_0xbae2('0x4a')]][_0xbae2('0x4f')]||_0xbae2('0x50'):_0xbae2('0x50');_0x14405a['queue']=_0x32e212[_0xbae2('0x63')];_0x14405a[_0xbae2('0x6d')]=moment()[_0xbae2('0x48')](_0xbae2('0x6e'));_0x14405a[_0xbae2('0x6f')]=_0x32e212[_0xbae2('0x6f')];_0x14405a[_0xbae2('0x70')]=_0x32e212[_0xbae2('0x70')];_0x14405a['uniqueid']=_0x32e212[_0xbae2('0x47')];logger[_0xbae2('0x71')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x14405a[_0xbae2('0x4a')],_0x14405a[_0xbae2('0x4f')]);_[_0xbae2('0x72')](_0x14405a,_[_0xbae2('0x73')](_0x32e212,_['keys'](_0x14405a)));this[_0xbae2('0xe')][_0x32e212['uniqueid']][_0xbae2('0x74')](_0x14405a);this[_0xbae2('0x33')][_0x32e212[_0xbae2('0x47')]]=_0x14405a;this[_0xbae2('0x45')](_0x14405a,_0xbae2('0x18'));}}catch(_0x55a538){logger[_0xbae2('0x3b')](_0xbae2('0x6c'),_0x32e212[_0xbae2('0x47')],util[_0xbae2('0x3d')](_0x55a538,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xbae2('0x1a')]=function(_0x54115b){try{if(this['isNotNull'](_0x54115b)){logger[_0xbae2('0x5b')](_0xbae2('0x75'),_0x54115b[_0xbae2('0x47')],util['inspect'](_0x54115b,{'showHidden':![],'depth':null}));if(this[_0xbae2('0xe')][_0x54115b['uniqueid']]){var _0x1641cc=_['last'](this['queueReports'][_0x54115b[_0xbae2('0x47')]]);_0x1641cc[_0xbae2('0x76')]=![];_0x1641cc[_0xbae2('0x77')]=null;_0x1641cc[_0xbae2('0x78')]=_0x54115b['holdtime'];_0x1641cc[_0xbae2('0x79')]=_0x54115b['originalposition'];_0x1641cc[_0xbae2('0x7a')]=!![];_0x1641cc[_0xbae2('0x7b')]=moment()[_0xbae2('0x48')](_0xbae2('0x6e'));_0x1641cc[_0xbae2('0x7c')]=_0xbae2('0x7d');_0x1641cc[_0xbae2('0x7e')]=null;logger[_0xbae2('0x71')](_0xbae2('0x7f'),_0x1641cc[_0xbae2('0x4a')],_0x1641cc[_0xbae2('0x4f')]);this[_0xbae2('0x33')][_0x54115b['uniqueid']]=_0x1641cc;this[_0xbae2('0x43')](_0x1641cc,_0xbae2('0x7a'));}}}catch(_0x3f9568){logger[_0xbae2('0x3b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x54115b[_0xbae2('0x47')],util[_0xbae2('0x3d')](_0x3f9568,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbae2('0x42')]['syncQueueCallerLeave']=function(_0x13f5c7){try{if(this[_0xbae2('0x5d')](_0x13f5c7)){logger[_0xbae2('0x5b')](_0xbae2('0x80'),_0x13f5c7[_0xbae2('0x47')],util[_0xbae2('0x3d')](_0x13f5c7,{'showHidden':![],'depth':null}));if(this[_0xbae2('0xe')][_0x13f5c7[_0xbae2('0x47')]]){var _0x31ccfd=_[_0xbae2('0x81')](this[_0xbae2('0xe')][_0x13f5c7[_0xbae2('0x47')]]);_0x31ccfd['queuecallerleaveAt']=moment()[_0xbae2('0x48')](_0xbae2('0x6e'));_0x31ccfd[_0xbae2('0x82')]=_0x13f5c7['connectedlinenum'];_0x31ccfd[_0xbae2('0x83')]=_0x13f5c7[_0xbae2('0x83')];logger[_0xbae2('0x71')](_0xbae2('0x84'),_0x31ccfd[_0xbae2('0x4a')],_0x31ccfd[_0xbae2('0x4f')],_0x13f5c7[_0xbae2('0x82')],_0x13f5c7[_0xbae2('0x83')]);this[_0xbae2('0x33')][_0x13f5c7[_0xbae2('0x47')]]=_0x31ccfd;this[_0xbae2('0x45')](_0x31ccfd,_0xbae2('0x1b'));}}}catch(_0x19c3f9){logger[_0xbae2('0x3b')]('[%s][voiceQueueReport][queuecallerleave]',_0x13f5c7['uniqueid'],util[_0xbae2('0x3d')](_0x19c3f9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbae2('0x42')][_0xbae2('0x20')]=function(_0x1aeb00){try{if(this['isNotNull'](_0x1aeb00)){logger[_0xbae2('0x5b')]('[%s][voiceQueueReport][agentconnect]',_0x1aeb00[_0xbae2('0x47')],util[_0xbae2('0x3d')](_0x1aeb00,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1aeb00[_0xbae2('0x47')]]){var _0xc5aa81=_[_0xbae2('0x81')](this[_0xbae2('0xe')][_0x1aeb00['uniqueid']]);_0xc5aa81[_0xbae2('0x76')]=!![];_0xc5aa81['queuecallerexitreason']=_0xbae2('0x85');logger['info'](_0xbae2('0x86'),_0xc5aa81[_0xbae2('0x4a')],_0xc5aa81[_0xbae2('0x4f')]);}}}catch(_0x32a3c3){logger[_0xbae2('0x3b')](_0xbae2('0x87'),_0x1aeb00[_0xbae2('0x47')],util[_0xbae2('0x3d')](_0x32a3c3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xbae2('0x1e')]=function(_0x4023f2){try{if(this[_0xbae2('0x5d')](_0x4023f2)){logger[_0xbae2('0x5b')](_0xbae2('0x88'),_0x4023f2[_0xbae2('0x47')],util[_0xbae2('0x3d')](_0x4023f2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4023f2['uniqueid']]){var _0x35518d=_['last'](this[_0xbae2('0xe')][_0x4023f2[_0xbae2('0x47')]]);_0x35518d['queuecallerabandon']=![];_0x35518d['queuecallerabandonAt']=null;_0x35518d['assigned']=!![];_0x35518d[_0xbae2('0x7e')]=_0x4023f2[_0xbae2('0x89')];_0x35518d[_0xbae2('0x78')]=_0x4023f2[_0xbae2('0x78')];_0x35518d[_0xbae2('0x76')]=!![];_0x35518d['queuecallerexit']=![];_0x35518d[_0xbae2('0x8a')]=null;if(!_0x35518d[_0xbae2('0x8b')]){if(_0x4023f2[_0xbae2('0x8c')]==_0xbae2('0x8b')){_0x35518d[_0xbae2('0x7c')]=_0xbae2('0x8d');logger[_0xbae2('0x71')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x35518d[_0xbae2('0x4a')],_0x35518d[_0xbae2('0x4f')]);}else{if(_['startsWith'](_0x4023f2['channel']['toLowerCase'](),'local/')){if(this[_0xbae2('0xe')][_0x4023f2['linkedid']]){var _0x444d18=_[_0xbae2('0x81')](this['queueReports'][_0x4023f2['linkedid']]);_0x444d18[_0xbae2('0x76')]=![];_0x444d18['queuecallerexit']=!![];_0x444d18[_0xbae2('0x8a')]=moment(_0x35518d[_0xbae2('0x6d')])['add'](_0x4023f2['holdtime'],_0xbae2('0x8e'))[_0xbae2('0x48')](_0xbae2('0x6e'));_0x444d18[_0xbae2('0x7c')]=_0xbae2('0x8f');_0x444d18['transfer']=!![];_0x444d18[_0xbae2('0x90')]='FORWARD';_0x444d18[_0xbae2('0x91')]=_0x4023f2[_0xbae2('0x92')];_0x444d18[_0xbae2('0x93')]=_0x4023f2[_0xbae2('0x47')];logger[_0xbae2('0x71')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x444d18['name'],_0x444d18['type']);var _0x25e385=this['queueReports'][_0x4023f2[_0xbae2('0x94')]];this['queueReports'][_0x4023f2[_0xbae2('0x94')]]=this[_0xbae2('0xe')][_0x4023f2['uniqueid']];this[_0xbae2('0xe')][_0x4023f2[_0xbae2('0x47')]]=_0x25e385;}}else{_0x35518d[_0xbae2('0x7c')]=_0xbae2('0x95')+_0x4023f2[_0xbae2('0x8c')]['toUpperCase']();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x35518d[_0xbae2('0x4a')],_0x35518d[_0xbae2('0x4f')],_0x35518d[_0xbae2('0x7c')]);}}}this[_0xbae2('0x33')][_0x4023f2[_0xbae2('0x47')]]=_0x35518d;this[_0xbae2('0x43')](_0x35518d,_0xbae2('0x1d'));}}}catch(_0x47eb7d){logger[_0xbae2('0x3b')](_0xbae2('0x88'),_0x4023f2[_0xbae2('0x47')],util[_0xbae2('0x3d')](_0x47eb7d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbae2('0x42')][_0xbae2('0x21')]=function(_0x561c50){try{if(this['isNotNull'](_0x561c50)){logger[_0xbae2('0x5b')]('[%s][voiceQueueReport][varset]',_0x561c50['uniqueid'],util['inspect'](_0x561c50,{'showHidden':![],'depth':null}));this[_0xbae2('0x96')](_0x561c50['uniqueid'],_[_0xbae2('0x97')](_0x561c50[_0xbae2('0x98')])[0x0],_0x561c50[_0xbae2('0x99')]);if(this['queueReports'][_0x561c50[_0xbae2('0x47')]]){var _0x2a5db8=_[_0xbae2('0x81')](this[_0xbae2('0xe')][_0x561c50[_0xbae2('0x47')]]);if(_0x2a5db8){if(this[_0xbae2('0x5d')](_0x561c50[_0xbae2('0x98')])&&this[_0xbae2('0x5d')](_0x561c50[_0xbae2('0x98')][_0xbae2('0x9a')])){switch(_0x561c50[_0xbae2('0x99')]){case _0xbae2('0x9b'):_0x2a5db8[_0xbae2('0x9c')]=![];_0x2a5db8[_0xbae2('0x8a')]=null;break;case _0xbae2('0x9d'):_0x2a5db8['lastevent']='timeout';_0x2a5db8[_0xbae2('0x9c')]=!![];_0x2a5db8['queuecallerexitAt']=moment()[_0xbae2('0x48')](_0xbae2('0x6e'));_0x2a5db8[_0xbae2('0x9e')]=moment()[_0xbae2('0x48')](_0xbae2('0x6e'));logger['debug'](_0xbae2('0x9f'),_0x561c50[_0xbae2('0x47')],util[_0xbae2('0x3d')](_0x2a5db8,{'showHidden':![],'depth':null}));ami['emit'](_0xbae2('0xa0'),_0x2a5db8);break;default:_0x2a5db8[_0xbae2('0x9c')]=!![];_0x2a5db8[_0xbae2('0x8a')]=moment()['format'](_0xbae2('0x6e'));_0x2a5db8[_0xbae2('0x9e')]=moment()[_0xbae2('0x48')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2a5db8['queuecallerabandon']=![];_0x2a5db8[_0xbae2('0x7b')]=null;_0x2a5db8[_0xbae2('0x7c')]=_0x561c50['value'];this[_0xbae2('0x33')][_0x561c50[_0xbae2('0x47')]]=_0x2a5db8;this[_0xbae2('0x43')](_0x2a5db8,_0xbae2('0xa1'));}else if(this['isNotNull'](_0x561c50[_0xbae2('0x98')])&&this['isNotNull'](_0x561c50['variable'][_0xbae2('0xa2')])){if(!_0x2a5db8['queuecallerabandon']){_0x2a5db8[_0xbae2('0x9c')]=!![];_0x2a5db8[_0xbae2('0x8a')]=moment()[_0xbae2('0x48')](_0xbae2('0x6e'));_0x2a5db8[_0xbae2('0x7c')]='EXITWITHKEY';_0x2a5db8[_0xbae2('0x9e')]=moment()[_0xbae2('0x48')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xbae2('0x33')][_0x561c50[_0xbae2('0x47')]]=_0x2a5db8;}}logger['info'](_0xbae2('0xa3'),_0x561c50[_0xbae2('0x47')],_0x2a5db8[_0xbae2('0x4a')],_0x2a5db8[_0xbae2('0x4f')],_[_0xbae2('0x97')](_0x561c50[_0xbae2('0x98')])[0x0],_0x561c50[_0xbae2('0x99')]);_0x2a5db8[_0xbae2('0x13')]=this[_0xbae2('0x13')][_0x561c50[_0xbae2('0x47')]];}}}}catch(_0x1d1615){logger['error']('[%s][voiceQueueReport][varset]',_0x561c50[_0xbae2('0x47')],util['inspect'](_0x1d1615,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbae2('0x42')][_0xbae2('0x96')]=function(_0x44176b,_0x48b186,_0x22415c){var _0x4202d7=[_0xbae2('0xa4'),_0xbae2('0xa5'),_0xbae2('0xa6'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xbae2('0xa7'),'rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid',_0xbae2('0xa8'),_0xbae2('0xa9'),'bridgepvtcallid',_0xbae2('0xaa'),_0xbae2('0xab'),_0xbae2('0xac'),_0xbae2('0xad'),'membername','memberpenalty',_0xbae2('0xae')];if(!_['isNil'](_0x48b186)&&!_[_0xbae2('0xaf')](_0x4202d7,_0x48b186)){if(_[_0xbae2('0x5e')](this['variables'][_0x44176b])){this['variables'][_0x44176b]={};}this[_0xbae2('0x13')][_0x44176b][_0x48b186]=_0x22415c;}};VoiceQueueReport[_0xbae2('0x42')][_0xbae2('0x22')]=function(_0x5311dc){try{if(this[_0xbae2('0x5d')](_0x5311dc)){logger[_0xbae2('0x5b')](_0xbae2('0xb0'),_0x5311dc['uniqueid'],util[_0xbae2('0x3d')](_0x5311dc,{'showHidden':![],'depth':null}));if(this[_0xbae2('0xe')][_0x5311dc['uniqueid']]){for(var _0x55200f=0x0,_0x86aa8b={};_0x55200f0x0?_0xc7238e:0x0;this['voiceQueues'][_0x4ab58e[_0xb39c('0x6e')]]['talking']=this[_0xb39c('0x11')][_0x4ab58e[_0xb39c('0x6e')]][_0xb39c('0x33')]>_['toNumber'](_0x4ab58e[_0xb39c('0x76')])?_[_0xb39c('0x74')](_0x4ab58e[_0xb39c('0x76')]):this[_0xb39c('0x11')][_0x4ab58e[_0xb39c('0x6e')]][_0xb39c('0x33')];this[_0xb39c('0x56')](this[_0xb39c('0x11')][_0x4ab58e[_0xb39c('0x6e')]],_0xb39c('0x15'));}logger[_0xb39c('0x53')](_0xb39c('0x77'),util[_0xb39c('0x41')](this[_0xb39c('0x11')][_0x4ab58e[_0xb39c('0x6e')]],{'showHidden':![],'depth':null}));ami[_0xb39c('0x49')](_0xb39c('0x78'),this['voiceQueues'][_0x4ab58e[_0xb39c('0x6e')]]);}}}catch(_0x2b3f85){logger[_0xb39c('0x3f')]('[voiceQueueReport][queuesummary]',util[_0xb39c('0x41')](_0x2b3f85,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x8d8f59){logger[_0xb39c('0x53')](_0xb39c('0x79'),util[_0xb39c('0x41')](_0x8d8f59,{'showHidden':![],'depth':null}));this[_0xb39c('0x12')]=!![];};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x26d08c){try{if(this[_0xb39c('0x69')](_0x26d08c)){logger['debug'](_0xb39c('0x7a'),_0x26d08c[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x26d08c,{'showHidden':![],'depth':null}));if(_[_0xb39c('0x7b')](this[_0xb39c('0x42')][_0x26d08c[_0xb39c('0x4d')]])){this[_0xb39c('0x42')][_0x26d08c[_0xb39c('0x4d')]]=[];this[_0xb39c('0xf')][_0x26d08c[_0xb39c('0x4d')]]={};}var _0xb5e7fb=new QueueReport();_0xb5e7fb[_0xb39c('0x50')]=_0x26d08c[_0xb39c('0x6e')];_0xb5e7fb[_0xb39c('0x57')]=this[_0xb39c('0x11')][_0xb5e7fb['name']]&&this[_0xb39c('0x11')][_0xb5e7fb['name']][_0xb39c('0x57')]?this[_0xb39c('0x11')][_0xb5e7fb['name']][_0xb39c('0x57')]||_0xb39c('0x58'):_0xb39c('0x58');_0xb5e7fb[_0xb39c('0x6e')]=_0x26d08c[_0xb39c('0x6e')];_0xb5e7fb[_0xb39c('0x7c')]=moment()['format'](_0xb39c('0x7d'));_0xb5e7fb[_0xb39c('0x7e')]=_0x26d08c[_0xb39c('0x7e')];_0xb5e7fb[_0xb39c('0x7f')]=_0x26d08c[_0xb39c('0x7f')];_0xb5e7fb[_0xb39c('0x4d')]=_0x26d08c[_0xb39c('0x4d')];logger[_0xb39c('0x70')](_0xb39c('0x80'),_0xb5e7fb['name'],_0xb5e7fb[_0xb39c('0x57')]);_[_0xb39c('0x81')](_0xb5e7fb,_[_0xb39c('0x82')](_0x26d08c,_[_0xb39c('0x83')](_0xb5e7fb)));this[_0xb39c('0x42')][_0x26d08c[_0xb39c('0x4d')]][_0xb39c('0x84')](_0xb5e7fb);this['channels'][_0x26d08c[_0xb39c('0x4d')]]=_0xb5e7fb;this[_0xb39c('0x4a')](_0xb5e7fb,_0xb39c('0x1a'));}}catch(_0x205329){logger[_0xb39c('0x3f')](_0xb39c('0x7a'),_0x26d08c[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x205329,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb39c('0x85')]=function(_0x52cb9d){try{if(this[_0xb39c('0x69')](_0x52cb9d)){logger[_0xb39c('0x53')](_0xb39c('0x86'),_0x52cb9d[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x52cb9d,{'showHidden':![],'depth':null}));if(this[_0xb39c('0x42')][_0x52cb9d[_0xb39c('0x4d')]]){var _0x3784fe=_['last'](this[_0xb39c('0x42')][_0x52cb9d[_0xb39c('0x4d')]]);_0x3784fe[_0xb39c('0x87')]=![];_0x3784fe[_0xb39c('0x88')]=null;_0x3784fe[_0xb39c('0x89')]=_0x52cb9d[_0xb39c('0x89')];_0x3784fe[_0xb39c('0x8a')]=_0x52cb9d[_0xb39c('0x8a')];_0x3784fe[_0xb39c('0x1c')]=!![];_0x3784fe[_0xb39c('0x8b')]=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));_0x3784fe[_0xb39c('0x8c')]=_0xb39c('0x8d');_0x3784fe[_0xb39c('0x8e')]=null;logger[_0xb39c('0x70')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x3784fe['name'],_0x3784fe[_0xb39c('0x57')]);this[_0xb39c('0xf')][_0x52cb9d[_0xb39c('0x4d')]]=_0x3784fe;this['emitVoiceQueueChannelRemove'](_0x3784fe,_0xb39c('0x1c'));}}}catch(_0x74411){logger[_0xb39c('0x3f')](_0xb39c('0x86'),_0x52cb9d[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x74411,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')]['syncQueueCallerLeave']=function(_0x41d28f){try{if(this[_0xb39c('0x69')](_0x41d28f)){logger['debug'](_0xb39c('0x8f'),_0x41d28f['uniqueid'],util[_0xb39c('0x41')](_0x41d28f,{'showHidden':![],'depth':null}));if(this[_0xb39c('0x42')][_0x41d28f[_0xb39c('0x4d')]]){var _0x5649af=_[_0xb39c('0x90')](this[_0xb39c('0x42')][_0x41d28f['uniqueid']]);_0x5649af[_0xb39c('0x91')]=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));_0x5649af[_0xb39c('0x92')]=_0x41d28f[_0xb39c('0x92')];_0x5649af[_0xb39c('0x93')]=_0x41d28f[_0xb39c('0x93')];logger[_0xb39c('0x70')](_0xb39c('0x94'),_0x5649af[_0xb39c('0x50')],_0x5649af[_0xb39c('0x57')],_0x41d28f[_0xb39c('0x92')],_0x41d28f[_0xb39c('0x93')]);this[_0xb39c('0xf')][_0x41d28f[_0xb39c('0x4d')]]=_0x5649af;this[_0xb39c('0x4a')](_0x5649af,_0xb39c('0x1d'));}}}catch(_0x24dcc8){logger[_0xb39c('0x3f')](_0xb39c('0x8f'),_0x41d28f[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x24dcc8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')]['syncAgentConnect']=function(_0xa87e5c){try{if(this[_0xb39c('0x69')](_0xa87e5c)){logger[_0xb39c('0x53')](_0xb39c('0x95'),_0xa87e5c['uniqueid'],util[_0xb39c('0x41')](_0xa87e5c,{'showHidden':![],'depth':null}));if(this[_0xb39c('0x42')][_0xa87e5c['uniqueid']]){var _0x3ab209=_[_0xb39c('0x90')](this[_0xb39c('0x42')][_0xa87e5c[_0xb39c('0x4d')]]);_0x3ab209[_0xb39c('0x87')]=!![];_0x3ab209['queuecallerexitreason']=_0xb39c('0x96');logger[_0xb39c('0x70')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x3ab209[_0xb39c('0x50')],_0x3ab209[_0xb39c('0x57')]);}}}catch(_0x80cead){logger[_0xb39c('0x3f')](_0xb39c('0x95'),_0xa87e5c[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x80cead,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')][_0xb39c('0x20')]=function(_0x155972){try{if(this['isNotNull'](_0x155972)){logger[_0xb39c('0x53')](_0xb39c('0x97'),_0x155972[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x155972,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x155972[_0xb39c('0x4d')]]){var _0x49c2a2=_[_0xb39c('0x90')](this[_0xb39c('0x42')][_0x155972['uniqueid']]);_0x49c2a2[_0xb39c('0x1c')]=![];_0x49c2a2[_0xb39c('0x8b')]=null;_0x49c2a2[_0xb39c('0x98')]=!![];_0x49c2a2[_0xb39c('0x8e')]=_0x155972[_0xb39c('0x99')];_0x49c2a2[_0xb39c('0x89')]=_0x155972[_0xb39c('0x89')];_0x49c2a2[_0xb39c('0x87')]=!![];_0x49c2a2['queuecallerexit']=![];_0x49c2a2[_0xb39c('0x9a')]=null;if(!_0x49c2a2[_0xb39c('0x9b')]){if(_0x155972[_0xb39c('0x9c')]==_0xb39c('0x9b')){_0x49c2a2[_0xb39c('0x8c')]=_0xb39c('0x9d');logger[_0xb39c('0x70')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x49c2a2['name'],_0x49c2a2[_0xb39c('0x57')]);}else{if(_[_0xb39c('0x9e')](_0x155972[_0xb39c('0x3c')]['toLowerCase'](),_0xb39c('0x9f'))){if(this[_0xb39c('0x42')][_0x155972[_0xb39c('0xa0')]]){var _0x10b7e9=_[_0xb39c('0x90')](this['queueReports'][_0x155972[_0xb39c('0xa0')]]);_0x10b7e9[_0xb39c('0x87')]=![];_0x10b7e9[_0xb39c('0xa1')]=!![];_0x10b7e9[_0xb39c('0x9a')]=moment(_0x49c2a2[_0xb39c('0x7c')])[_0xb39c('0xa2')](_0x155972[_0xb39c('0x89')],_0xb39c('0xa3'))['format'](_0xb39c('0x7d'));_0x10b7e9[_0xb39c('0x8c')]=_0xb39c('0xa4');_0x10b7e9[_0xb39c('0x9b')]=!![];_0x10b7e9[_0xb39c('0xa5')]='FORWARD';_0x10b7e9[_0xb39c('0xa6')]=_0x155972[_0xb39c('0xa7')];_0x10b7e9[_0xb39c('0xa8')]=_0x155972[_0xb39c('0x4d')];logger[_0xb39c('0x70')](_0xb39c('0xa9'),_0x10b7e9[_0xb39c('0x50')],_0x10b7e9['type']);var _0x29419d=this[_0xb39c('0x42')][_0x155972['linkedid']];this['queueReports'][_0x155972[_0xb39c('0xa0')]]=this['queueReports'][_0x155972[_0xb39c('0x4d')]];this['queueReports'][_0x155972[_0xb39c('0x4d')]]=_0x29419d;}}else{_0x49c2a2['queuecallerexitreason']=_0xb39c('0xaa')+_0x155972[_0xb39c('0x9c')][_0xb39c('0xab')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x49c2a2[_0xb39c('0x50')],_0x49c2a2[_0xb39c('0x57')],_0x49c2a2['queuecallerexitreason']);}}}this[_0xb39c('0xf')][_0x155972[_0xb39c('0x4d')]]=_0x49c2a2;this['emitVoiceQueueChannelRemove'](_0x49c2a2,_0xb39c('0x1f'));}}}catch(_0x214adc){logger[_0xb39c('0x3f')]('[%s][voiceQueueReport][agentcomplete]',_0x155972[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x214adc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')][_0xb39c('0x23')]=function(_0x3d84ff){try{if(this[_0xb39c('0x69')](_0x3d84ff)){logger[_0xb39c('0x53')]('[%s][voiceQueueReport][varset]',_0x3d84ff[_0xb39c('0x4d')],util['inspect'](_0x3d84ff,{'showHidden':![],'depth':null}));this['addVariable'](_0x3d84ff[_0xb39c('0x4d')],_[_0xb39c('0x83')](_0x3d84ff[_0xb39c('0xac')])[0x0],_0x3d84ff[_0xb39c('0xad')]);if(this[_0xb39c('0x42')][_0x3d84ff[_0xb39c('0x4d')]]){var _0xac1d01=_[_0xb39c('0x90')](this[_0xb39c('0x42')][_0x3d84ff['uniqueid']]);if(_0xac1d01){if(this[_0xb39c('0x69')](_0x3d84ff['variable'])&&this[_0xb39c('0x69')](_0x3d84ff['variable'][_0xb39c('0xae')])){switch(_0x3d84ff[_0xb39c('0xad')]){case _0xb39c('0xaf'):_0xac1d01['queuecallerexit']=![];_0xac1d01['queuecallerexitAt']=null;break;case _0xb39c('0xb0'):_0xac1d01['lastevent']='timeout';_0xac1d01[_0xb39c('0xa1')]=!![];_0xac1d01[_0xb39c('0x9a')]=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));_0xac1d01[_0xb39c('0x91')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x3d84ff['uniqueid'],util[_0xb39c('0x41')](_0xac1d01,{'showHidden':![],'depth':null}));ami[_0xb39c('0x49')](_0xb39c('0xb1'),_0xac1d01);break;default:_0xac1d01[_0xb39c('0xa1')]=!![];_0xac1d01['queuecallerexitAt']=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));_0xac1d01[_0xb39c('0x91')]=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));}_0xac1d01[_0xb39c('0x1c')]=![];_0xac1d01[_0xb39c('0x8b')]=null;_0xac1d01['queuecallerexitreason']=_0x3d84ff[_0xb39c('0xad')];this['channels'][_0x3d84ff[_0xb39c('0x4d')]]=_0xac1d01;this['emitVoiceQueueChannelRemove'](_0xac1d01,_0xb39c('0xb2'));}else if(this[_0xb39c('0x69')](_0x3d84ff[_0xb39c('0xac')])&&this[_0xb39c('0x69')](_0x3d84ff[_0xb39c('0xac')][_0xb39c('0xb3')])){if(!_0xac1d01[_0xb39c('0x1c')]){_0xac1d01[_0xb39c('0xa1')]=!![];_0xac1d01[_0xb39c('0x9a')]=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));_0xac1d01[_0xb39c('0x8c')]=_0xb39c('0xb4');_0xac1d01[_0xb39c('0x91')]=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));this['channels'][_0x3d84ff[_0xb39c('0x4d')]]=_0xac1d01;}}logger[_0xb39c('0x70')](_0xb39c('0xb5'),_0x3d84ff[_0xb39c('0x4d')],_0xac1d01['name'],_0xac1d01[_0xb39c('0x57')],_['keys'](_0x3d84ff['variable'])[0x0],_0x3d84ff[_0xb39c('0xad')]);_0xac1d01[_0xb39c('0x14')]=this[_0xb39c('0x14')][_0x3d84ff[_0xb39c('0x4d')]];}}}}catch(_0x4db8a9){logger[_0xb39c('0x3f')](_0xb39c('0xb6'),_0x3d84ff[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x4db8a9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')][_0xb39c('0xb7')]=function(_0x2af4fe,_0x1ea296,_0x55d99a){var _0x390790=[_0xb39c('0xb8'),_0xb39c('0xb9'),_0xb39c('0xba'),_0xb39c('0xbb'),_0xb39c('0xbc'),_0xb39c('0xbd'),_0xb39c('0xbe'),_0xb39c('0xbf'),_0xb39c('0xc0'),_0xb39c('0xc1'),'bridgepeer','bridgepvtcallid',_0xb39c('0xc2'),_0xb39c('0xc3'),'memberinterface',_0xb39c('0xc4'),_0xb39c('0x99'),_0xb39c('0xc5'),'memberrealtime'];if(!_[_0xb39c('0x39')](_0x1ea296)&&!_[_0xb39c('0xc6')](_0x390790,_0x1ea296)){if(_[_0xb39c('0x7b')](this[_0xb39c('0x14')][_0x2af4fe])){this[_0xb39c('0x14')][_0x2af4fe]={};}this[_0xb39c('0x14')][_0x2af4fe][_0x1ea296]=_0x55d99a;}};VoiceQueueReport[_0xb39c('0xb')][_0xb39c('0x25')]=function(_0x433384){try{if(this[_0xb39c('0x69')](_0x433384)){logger[_0xb39c('0x53')](_0xb39c('0xc7'),_0x433384[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x433384,{'showHidden':![],'depth':null}));if(this[_0xb39c('0x42')][_0x433384['uniqueid']]){for(var _0x341140=0x0,_0x1340bd={};_0x341140=0x0?moment(_0xc280b7['endtime'])[_0x937f('0x19')](_0xc280b7[_0x937f('0x16')],_0x937f('0x18')):null,'data1':_0x937f('0x1a'),'data2':_0xc280b7[_0x937f('0xe')],'data3':_0xc280b7[_0x937f('0xb')],'data4':_0xc280b7[_0x937f('0x1b')]||null,'role':_0x937f('0xd'),'internal':_0xc280b7[_0x937f('0xe')]?_[_0x937f('0xf')](_0xc280b7[_0x937f('0xe')]):undefined,'uniqueid':_0xc280b7['uniqueid']},'log':_0x937f('0x3')});}; \ No newline at end of file +var _0x72f2=['queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','format','interface','TALKING','queuecallerleaveAt','diff','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','CreateMemberReport','starttime','endtime','seconds','outbound','lodash','voiceQueueReport'];(function(_0x24b9db,_0x55e198){var _0x306929=function(_0x3c5054){while(--_0x3c5054){_0x24b9db['push'](_0x24b9db['shift']());}};_0x306929(++_0x55e198);}(_0x72f2,0x66));var _0x272f=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x72f2[_0x1abb09];return _0xea1c07;};'use strict';var moment=require('moment');var _=require(_0x272f('0x0'));var util=require('util');var client=require('../client');exports[_0x272f('0x1')]=function(_0x384f97){var _0x373ad0=_0x384f97[_0x272f('0x2')]||_0x384f97[_0x272f('0x3')];return client[_0x272f('0x4')]('CreateMemberReport',{'body':{'channel':_0x272f('0x5'),'membername':_0x384f97[_0x272f('0x6')],'interface':_[_0x272f('0x7')](_0x384f97['interface'])?util[_0x272f('0x8')]('SIP/%s',_0x384f97[_0x272f('0x6')]):_0x384f97[_0x272f('0x9')],'type':_0x272f('0xa'),'enterAt':_0x384f97[_0x272f('0xb')],'exitAt':_0x373ad0,'duration':moment(_0x373ad0)[_0x272f('0xc')](_0x384f97['queuecallerleaveAt'],'seconds'),'data1':_0x272f('0xd'),'data2':_0x384f97[_0x272f('0xe')],'data3':_0x384f97[_0x272f('0xf')],'data4':null,'data5':_0x384f97[_0x272f('0x10')],'role':_0x272f('0x11'),'internal':_0x384f97[_0x272f('0x12')]?_[_0x272f('0x13')](_0x384f97['accountcode']):undefined,'uniqueid':_0x384f97[_0x272f('0x14')]},'log':_0x272f('0x15')});};exports['voiceDialReport']=function(_0x568b2d){return client[_0x272f('0x4')](_0x272f('0x15'),{'body':{'channel':_0x272f('0x5'),'membername':_0x568b2d['membername'],'interface':_0x568b2d[_0x272f('0x9')],'type':_0x272f('0xa'),'enterAt':_0x568b2d[_0x272f('0x16')],'exitAt':_0x568b2d[_0x272f('0x17')],'duration':moment(_0x568b2d[_0x272f('0x17')])[_0x272f('0xc')](_0x568b2d['starttime'],_0x272f('0x18'))>=0x0?moment(_0x568b2d[_0x272f('0x17')])[_0x272f('0xc')](_0x568b2d[_0x272f('0x16')],_0x272f('0x18')):null,'data1':_0x272f('0x19'),'data2':_0x568b2d[_0x272f('0x12')],'data3':_0x568b2d['exten'],'data4':_0x568b2d['dialstring']||null,'role':'agent','internal':_0x568b2d[_0x272f('0x12')]?_[_0x272f('0x13')](_0x568b2d[_0x272f('0x12')]):undefined,'uniqueid':_0x568b2d[_0x272f('0x14')]},'log':_0x272f('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 1aa90d5..00940c1 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13f6=['../client','getSettings','stopRecordingOnTransfer','GetSettings'];(function(_0xa25342,_0x24522b){var _0x52be43=function(_0x1ea0e9){while(--_0x1ea0e9){_0xa25342['push'](_0xa25342['shift']());}};_0x52be43(++_0x24522b);}(_0x13f6,0x124));var _0x613f=function(_0x586cfa,_0x4c84c9){_0x586cfa=_0x586cfa-0x0;var _0x460cd8=_0x13f6[_0x586cfa];return _0x460cd8;};'use strict';var client=require(_0x613f('0x0'));exports[_0x613f('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x613f('0x2')]},'log':_0x613f('0x3')});}; \ No newline at end of file +var _0x9aea=['GetSettings','../client','Request','stopRecordingOnTransfer'];(function(_0x575118,_0x332ec8){var _0x40acf0=function(_0x336f43){while(--_0x336f43){_0x575118['push'](_0x575118['shift']());}};_0x40acf0(++_0x332ec8);}(_0x9aea,0xdd));var _0xa9ae=function(_0x5178ae,_0x189543){_0x5178ae=_0x5178ae-0x0;var _0x53ebda=_0x9aea[_0x5178ae];return _0x53ebda;};'use strict';var client=require(_0xa9ae('0x0'));exports['getSettings']=function(){return client[_0xa9ae('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xa9ae('0x2')]},'log':_0xa9ae('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 8dbc7fb..9e65a29 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 _0x131e=['Request','GetTemplate','name','html'];(function(_0xe27195,_0x468443){var _0x5762c3=function(_0x522475){while(--_0x522475){_0xe27195['push'](_0xe27195['shift']());}};_0x5762c3(++_0x468443);}(_0x131e,0x1ec));var _0xe131=function(_0x2d1fe6,_0x280692){_0x2d1fe6=_0x2d1fe6-0x0;var _0x56d315=_0x131e[_0x2d1fe6];return _0x56d315;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x58ba04){return function(_0x10fd23){return client[_0xe131('0x0')](_0xe131('0x1'),{'options':{'raw':!![],'attributes':['id',_0xe131('0x2'),_0xe131('0x3')]},'log':_0xe131('0x1')});};}; \ No newline at end of file +var _0x4483=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x424d82,_0x594352){var _0x3451d7=function(_0x560563){while(--_0x560563){_0x424d82['push'](_0x424d82['shift']());}};_0x3451d7(++_0x594352);}(_0x4483,0x1a3));var _0x3448=function(_0x2bd202,_0x37e879){_0x2bd202=_0x2bd202-0x0;var _0x441e88=_0x4483[_0x2bd202];return _0x441e88;};'use strict';var client=require(_0x3448('0x0'));exports[_0x3448('0x1')]=function(_0x229c0c){return function(_0x481d0c){return client[_0x3448('0x2')](_0x3448('0x3'),{'options':{'raw':!![],'attributes':['id',_0x3448('0x4'),_0x3448('0x5')]},'log':_0x3448('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 116f9b9..034d194 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 _0xbf39=['operator','value','AnyConditions','Action','Actions','action','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','field'];(function(_0x1d641b,_0x9b7063){var _0x22fb67=function(_0x1d19e8){while(--_0x1d19e8){_0x1d641b['push'](_0x1d641b['shift']());}};_0x22fb67(++_0x9b7063);}(_0xbf39,0xab));var _0x9bf3=function(_0x2b64f5,_0x423499){_0x2b64f5=_0x2b64f5-0x0;var _0x4b9f08=_0xbf39[_0x2b64f5];return _0x4b9f08;};'use strict';var client=require(_0x9bf3('0x0'));exports[_0x9bf3('0x1')]=function(_0x523c0b){return function(_0x20c0b5){return client[_0x9bf3('0x2')](_0x9bf3('0x3'),{'options':{'raw':![],'attributes':['id',_0x9bf3('0x4'),_0x9bf3('0x5'),_0x9bf3('0x6')],'include':[{'model':_0x9bf3('0x7'),'as':'AllConditions','attributes':['id',_0x9bf3('0x8'),_0x9bf3('0x9'),_0x9bf3('0xa')]},{'model':_0x9bf3('0x7'),'as':_0x9bf3('0xb'),'attributes':['id','field',_0x9bf3('0x9'),_0x9bf3('0xa')]},{'model':_0x9bf3('0xc'),'as':_0x9bf3('0xd'),'attributes':['id',_0x9bf3('0xe'),'data1','data2',_0x9bf3('0xf'),_0x9bf3('0x10'),_0x9bf3('0x11'),_0x9bf3('0x12'),_0x9bf3('0x13')]}]},'log':_0x9bf3('0x3')});};}; \ No newline at end of file +var _0x727e=['../client','getTriggers','name','channel','status','field','operator','value','Condition','AnyConditions','Action','Actions','action','data1','data2','data4','data6'];(function(_0x279edd,_0x4f19dc){var _0x3a4ad7=function(_0x465df4){while(--_0x465df4){_0x279edd['push'](_0x279edd['shift']());}};_0x3a4ad7(++_0x4f19dc);}(_0x727e,0x88));var _0xe727=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x727e[_0x27af45];return _0x18df21;};'use strict';var client=require(_0xe727('0x0'));exports[_0xe727('0x1')]=function(_0x4fb9c5){return function(_0x582852){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xe727('0x2'),_0xe727('0x3'),_0xe727('0x4')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0xe727('0x5'),_0xe727('0x6'),_0xe727('0x7')]},{'model':_0xe727('0x8'),'as':_0xe727('0x9'),'attributes':['id',_0xe727('0x5'),'operator','value']},{'model':_0xe727('0xa'),'as':_0xe727('0xb'),'attributes':['id',_0xe727('0xc'),_0xe727('0xd'),_0xe727('0xe'),'data3',_0xe727('0xf'),'data5',_0xe727('0x10'),'data7']}]},'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 ad46882..e536341 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 _0x9c85=['defaultuser','../client','getTrunks','Request','name'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x9c85,0x74));var _0x59c8=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x9c85[_0x500419];return _0x241c1a;};'use strict';var client=require(_0x59c8('0x0'));exports[_0x59c8('0x1')]=function(_0x2b8e53){return function(_0x20584a){return client[_0x59c8('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x59c8('0x3'),'registry',_0x59c8('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x58bb=['GetTrunk','defaultuser','Request'];(function(_0x16e0a6,_0x18e7f6){var _0x5e15cf=function(_0x266c66){while(--_0x266c66){_0x16e0a6['push'](_0x16e0a6['shift']());}};_0x5e15cf(++_0x18e7f6);}(_0x58bb,0x6e));var _0xb58b=function(_0x3cde30,_0x5cff11){_0x3cde30=_0x3cde30-0x0;var _0x3d975c=_0x58bb[_0x3cde30];return _0x3d975c;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x49ed3f){return function(_0x593af6){return client[_0xb58b('0x0')](_0xb58b('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0xb58b('0x2')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 71133a5..ba572ff 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 _0x0928=['savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','pauseType','getAgent','../client','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','online','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal'];(function(_0x2e95d0,_0x4e9c25){var _0x288b82=function(_0x4ca452){while(--_0x4ca452){_0x2e95d0['push'](_0x2e95d0['shift']());}};_0x288b82(++_0x4e9c25);}(_0x0928,0x125));var _0x8092=function(_0x5d4dc2,_0x4c4d6c){_0x5d4dc2=_0x5d4dc2-0x0;var _0x48b9bf=_0x0928[_0x5d4dc2];return _0x48b9bf;};'use strict';var client=require(_0x8092('0x0'));exports[_0x8092('0x1')]=function(){return function(){return client[_0x8092('0x2')](_0x8092('0x3'),{'options':{'raw':![],'where':{'role':_0x8092('0x4')},'attributes':['id',_0x8092('0x5'),_0x8092('0x6'),_0x8092('0x7'),_0x8092('0x8'),_0x8092('0x9'),_0x8092('0xa'),'pauseType',_0x8092('0xb'),_0x8092('0xc'),_0x8092('0xd'),_0x8092('0xe'),_0x8092('0xf')]},'log':_0x8092('0x1')});};};exports[_0x8092('0x10')]=function(){return function(){return client['Request'](_0x8092('0x3'),{'options':{'raw':!![],'where':{'role':_0x8092('0x11')},'attributes':['id',_0x8092('0x5'),_0x8092('0x7'),_0x8092('0x12')]},'log':_0x8092('0x10')});};};exports[_0x8092('0x13')]=function(_0x44b662,_0x3eed5c,_0x362d2a){return client[_0x8092('0x2')](_0x8092('0x14'),{'body':{'type':_0x3eed5c,'uniqueid':_0x362d2a},'options':{'where':{'id':_0x44b662['id']}},'log':_0x8092('0x13')});};exports[_0x8092('0x15')]=function(_0x3a46af){return client[_0x8092('0x2')](_0x8092('0x16'),{'body':{},'options':{'where':{'id':_0x3a46af['id']}},'log':_0x8092('0x13')});};exports['getAgent']=function(_0x494dc3){return client[_0x8092('0x2')](_0x8092('0x17'),{'options':{'raw':![],'where':{'role':_0x8092('0x4'),'id':_0x494dc3},'attributes':['id',_0x8092('0x5'),_0x8092('0x6'),'accountcode',_0x8092('0x8'),_0x8092('0x9'),_0x8092('0xa'),_0x8092('0x18'),_0x8092('0xb'),_0x8092('0xc'),'interface']},'log':_0x8092('0x19')});}; \ No newline at end of file +var _0xcd56=['Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','internal','PauseUser','savePause','UnpauseUser','getAgent','ShowUser','../client','getAgents'];(function(_0x245d40,_0x455ece){var _0x245534=function(_0x257f5d){while(--_0x257f5d){_0x245d40['push'](_0x245d40['shift']());}};_0x245534(++_0x455ece);}(_0xcd56,0x129));var _0x6cd5=function(_0x1adff1,_0x1bd45c){_0x1adff1=_0x1adff1-0x0;var _0x19ad22=_0xcd56[_0x1adff1];return _0x19ad22;};'use strict';var client=require(_0x6cd5('0x0'));exports[_0x6cd5('0x1')]=function(){return function(){return client[_0x6cd5('0x2')](_0x6cd5('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x6cd5('0x4'),_0x6cd5('0x5'),_0x6cd5('0x6'),_0x6cd5('0x7'),_0x6cd5('0x8'),_0x6cd5('0x9'),_0x6cd5('0xa'),_0x6cd5('0xb'),_0x6cd5('0xc'),_0x6cd5('0xd'),_0x6cd5('0xe'),_0x6cd5('0xf')]},'log':_0x6cd5('0x1')});};};exports[_0x6cd5('0x10')]=function(){return function(){return client[_0x6cd5('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x6cd5('0x4'),'accountcode',_0x6cd5('0x11')]},'log':_0x6cd5('0x10')});};};exports['savePause']=function(_0x2cd46a,_0x5b8993,_0x30d696){return client['Request'](_0x6cd5('0x12'),{'body':{'type':_0x5b8993,'uniqueid':_0x30d696},'options':{'where':{'id':_0x2cd46a['id']}},'log':_0x6cd5('0x13')});};exports['saveUnpause']=function(_0x2c4f6a){return client['Request'](_0x6cd5('0x14'),{'body':{},'options':{'where':{'id':_0x2c4f6a['id']}},'log':_0x6cd5('0x13')});};exports[_0x6cd5('0x15')]=function(_0x3da538){return client['Request'](_0x6cd5('0x16'),{'options':{'raw':![],'where':{'role':'agent','id':_0x3da538},'attributes':['id',_0x6cd5('0x4'),_0x6cd5('0x5'),'accountcode','fullname','online',_0x6cd5('0x9'),_0x6cd5('0xa'),_0x6cd5('0xb'),_0x6cd5('0xc'),_0x6cd5('0xf')]},'log':_0x6cd5('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index eb4ff4d..3dabff6 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 _0xec08=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create','Request'];(function(_0x3525b4,_0x2d5897){var _0x2bd50b=function(_0x234675){while(--_0x234675){_0x3525b4['push'](_0x3525b4['shift']());}};_0x2bd50b(++_0x2d5897);}(_0xec08,0xad));var _0x8ec0=function(_0x40033b,_0x3b3503){_0x40033b=_0x40033b-0x0;var _0x5c2de1=_0xec08[_0x40033b];return _0x5c2de1;};'use strict';var client=require('../client');exports[_0x8ec0('0x0')]=function(_0x5651ee){return client[_0x8ec0('0x1')](_0x8ec0('0x2'),{'body':_0x5651ee,'log':_0x8ec0('0x2')});};exports[_0x8ec0('0x3')]=function(_0x285442,_0x429e29,_0x28705b){return client[_0x8ec0('0x1')](_0x8ec0('0x4'),{'body':_0x285442,'options':{'where':{'uniqueid':_0x429e29,'interface':_0x28705b,'agentcomplete':!![]}},'log':_0x8ec0('0x4')});}; \ No newline at end of file +var _0x8c34=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0x8c34,0x181));var _0x48c3=function(_0x26fed0,_0x3f4ecc){_0x26fed0=_0x26fed0-0x0;var _0x32e5d4=_0x8c34[_0x26fed0];return _0x32e5d4;};'use strict';var client=require('../client');exports[_0x48c3('0x0')]=function(_0x1b69f0){return client[_0x48c3('0x1')](_0x48c3('0x2'),{'body':_0x1b69f0,'log':_0x48c3('0x2')});};exports[_0x48c3('0x3')]=function(_0x3df265,_0x84fa9e,_0x26d19b){return client[_0x48c3('0x1')](_0x48c3('0x4'),{'body':_0x3df265,'options':{'where':{'uniqueid':_0x84fa9e,'interface':_0x26d19b,'agentcomplete':!![]}},'log':_0x48c3('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 15f03b8..a6d4c4d 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 _0x1f5a=['outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','billableseconds','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport'];(function(_0x30604b,_0x3405e8){var _0x500e76=function(_0x1b5578){while(--_0x1b5578){_0x30604b['push'](_0x30604b['shift']());}};_0x500e76(++_0x3405e8);}(_0x1f5a,0x1d6));var _0xa1f5=function(_0x4bdc1e,_0x140439){_0x4bdc1e=_0x4bdc1e-0x0;var _0x2d2db0=_0x1f5a[_0x4bdc1e];return _0x2d2db0;};'use strict';var moment=require(_0xa1f5('0x0'));var util=require('util');var _=require(_0xa1f5('0x1'));var client=require(_0xa1f5('0x2'));exports[_0xa1f5('0x3')]=function(_0x335882){return client[_0xa1f5('0x4')](_0xa1f5('0x5'),{'body':_[_0xa1f5('0x6')](_0x335882,{'source':_0x335882[_0xa1f5('0x7')],'destinationcontext':_0x335882[_0xa1f5('0x8')],'callerid':_0x335882[_0xa1f5('0x9')],'amaflags':_0xa1f5('0xa')}),'log':'CreateVoiceCallReport'});};exports[_0xa1f5('0xb')]=function(){return function(){return client[_0xa1f5('0x4')](_0xa1f5('0xc'),{'options':{'where':{'type':[_0xa1f5('0xd')],'createdAt':{'$between':[moment()[_0xa1f5('0xe')](_0xa1f5('0xf'))[_0xa1f5('0x10')](_0xa1f5('0x11')),moment()[_0xa1f5('0x12')](_0xa1f5('0xf'))[_0xa1f5('0x10')](_0xa1f5('0x11'))]}},'attributes':[_0xa1f5('0x13'),'disposition',_0xa1f5('0x14'),_0xa1f5('0x15')]},'log':_0xa1f5('0x16')});};}; \ No newline at end of file +var _0xf475=['day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf'];(function(_0x516927,_0xb4aad0){var _0x30749b=function(_0x2ca6cc){while(--_0x2ca6cc){_0x516927['push'](_0x516927['shift']());}};_0x30749b(++_0xb4aad0);}(_0xf475,0xe2));var _0x5f47=function(_0x4630c9,_0x4d04b3){_0x4630c9=_0x4630c9-0x0;var _0x8e5298=_0xf475[_0x4630c9];return _0x8e5298;};'use strict';var moment=require(_0x5f47('0x0'));var util=require(_0x5f47('0x1'));var _=require(_0x5f47('0x2'));var client=require(_0x5f47('0x3'));exports[_0x5f47('0x4')]=function(_0x4b7a55){return client[_0x5f47('0x5')](_0x5f47('0x6'),{'body':_[_0x5f47('0x7')](_0x4b7a55,{'source':_0x4b7a55[_0x5f47('0x8')],'destinationcontext':_0x4b7a55['context'],'callerid':_0x4b7a55[_0x5f47('0x9')],'amaflags':'DOCUMENTATION'}),'log':_0x5f47('0x6')});};exports[_0x5f47('0xa')]=function(){return function(){return client[_0x5f47('0x5')](_0x5f47('0xb'),{'options':{'where':{'type':[_0x5f47('0xc')],'createdAt':{'$between':[moment()[_0x5f47('0xd')](_0x5f47('0xe'))[_0x5f47('0xf')](_0x5f47('0x10')),moment()[_0x5f47('0x11')]('day')[_0x5f47('0xf')](_0x5f47('0x10'))]}},'attributes':[_0x5f47('0x12'),'disposition','duration','billableseconds']},'log':_0x5f47('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 6306fb6..3d6b13d 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 _0x2ba8=['create','Request','CreateVoiceDialReport'];(function(_0x24cf7f,_0x31a459){var _0x522347=function(_0x28ebf6){while(--_0x28ebf6){_0x24cf7f['push'](_0x24cf7f['shift']());}};_0x522347(++_0x31a459);}(_0x2ba8,0x8a));var _0x82ba=function(_0x3c526f,_0x271d42){_0x3c526f=_0x3c526f-0x0;var _0x27cccd=_0x2ba8[_0x3c526f];return _0x27cccd;};'use strict';var client=require('../client');exports[_0x82ba('0x0')]=function(_0x510892){return client[_0x82ba('0x1')]('CreateVoiceDialReport',{'body':_0x510892,'log':_0x82ba('0x2')});}; \ No newline at end of file +var _0x6ae2=['CreateVoiceDialReport','create','Request'];(function(_0xdeaf40,_0x33c0b4){var _0x38cb58=function(_0x54cc35){while(--_0x54cc35){_0xdeaf40['push'](_0xdeaf40['shift']());}};_0x38cb58(++_0x33c0b4);}(_0x6ae2,0xdc));var _0x26ae=function(_0x357f41,_0x55f968){_0x357f41=_0x357f41-0x0;var _0x3a0037=_0x6ae2[_0x357f41];return _0x3a0037;};'use strict';var client=require('../client');exports[_0x26ae('0x0')]=function(_0x47da83){return client[_0x26ae('0x1')](_0x26ae('0x2'),{'body':_0x47da83,'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 4f85aa0..c3140a7 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 _0x1a95=['../client','Request','exten','recordingFormat'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x1a95,0x130));var _0x51a9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1a95[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x51a9('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x51a9('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x51a9('0x2'),_0x51a9('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xade9=['exten','recordingFormat','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x148c93,_0x23db9a){var _0x12be39=function(_0x26f229){while(--_0x26f229){_0x148c93['push'](_0x148c93['shift']());}};_0x12be39(++_0x23db9a);}(_0xade9,0x1e7));var _0x9ade=function(_0x208bc9,_0x4f36f6){_0x208bc9=_0x208bc9-0x0;var _0x2675a8=_0xade9[_0x208bc9];return _0x2675a8;};'use strict';var client=require('../client');exports[_0x9ade('0x0')]=function(){return function(){return client[_0x9ade('0x1')](_0x9ade('0x2'),{'options':{'raw':!![],'attributes':['id',_0x9ade('0x3'),_0x9ade('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x9ade('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 2778ed6..7e48be3 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 _0xce25=['dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','monitor_format','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','callAdditionalPhoneAfterMin','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','Request','name','autopause','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x5b13b6,_0x231bc5){var _0xfe953e=function(_0x24e7dd){while(--_0x24e7dd){_0x5b13b6['push'](_0x5b13b6['shift']());}};_0xfe953e(++_0x231bc5);}(_0xce25,0x67));var _0x5ce2=function(_0x3d4c90,_0x119f2b){_0x3d4c90=_0x3d4c90-0x0;var _0x4ddbfc=_0xce25[_0x3d4c90];return _0x4ddbfc;};'use strict';var client=require('../client');exports[_0x5ce2('0x0')]=function(){return function(){return client[_0x5ce2('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x5ce2('0x2'),'acw','acwTimeout',_0x5ce2('0x3'),'monitor_format','type','dialActive',_0x5ce2('0x4'),_0x5ce2('0x5'),_0x5ce2('0x6'),_0x5ce2('0x7'),_0x5ce2('0x8'),_0x5ce2('0x9'),_0x5ce2('0xa'),'dialOriginateCallerIdName',_0x5ce2('0xb'),_0x5ce2('0xc'),_0x5ce2('0xd'),_0x5ce2('0xe'),_0x5ce2('0xf'),_0x5ce2('0x10'),_0x5ce2('0x11'),_0x5ce2('0x12'),_0x5ce2('0x13'),_0x5ce2('0x14'),_0x5ce2('0x15'),_0x5ce2('0x16'),'dialTimezone','dialGlobalInterval',_0x5ce2('0x17'),_0x5ce2('0x18'),_0x5ce2('0x19'),_0x5ce2('0x1a'),_0x5ce2('0x1b'),'dialAMDAfterGreetingSilence',_0x5ce2('0x1c'),_0x5ce2('0x1d'),_0x5ce2('0x1e'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x5ce2('0x1f'),'timeout',_0x5ce2('0x20'),_0x5ce2('0x21'),_0x5ce2('0x22'),_0x5ce2('0x23'),'dialAgiAfterHangupClient','dialQueueProject2',_0x5ce2('0x24'),'strategy',_0x5ce2('0x25'),_0x5ce2('0x26'),_0x5ce2('0x27'),'dialNoSuchNumberRetryFrequency',_0x5ce2('0x28'),'dialDropRetryFrequency',_0x5ce2('0x29'),_0x5ce2('0x2a'),_0x5ce2('0x2b'),_0x5ce2('0x2c'),'dialAgentRejectMaxRetry',_0x5ce2('0x2d'),_0x5ce2('0x2e'),'dialPredictiveIntervalMaxThreshold',_0x5ce2('0x2f'),_0x5ce2('0x30')],'include':[{'model':_0x5ce2('0x31'),'as':_0x5ce2('0x31'),'attributes':['id',_0x5ce2('0x2'),_0x5ce2('0x32'),'active']},{'model':_0x5ce2('0x33'),'as':_0x5ce2('0x34'),'attributes':['id',_0x5ce2('0x2')]},{'model':_0x5ce2('0x31'),'as':_0x5ce2('0x35'),'attributes':['id',_0x5ce2('0x2'),'callerid',_0x5ce2('0x36')]},{'model':_0x5ce2('0x37'),'as':_0x5ce2('0x37'),'attributes':['id',_0x5ce2('0x2')],'include':[{'model':_0x5ce2('0x37'),'as':_0x5ce2('0x38'),'attributes':['id',_0x5ce2('0x2'),_0x5ce2('0x39')]}]}]},'log':_0x5ce2('0x0')});};}; \ No newline at end of file +var _0x8459=['dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','callAdditionalPhoneAfterMin','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','type','dialActive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallInQueue','dialAgiAfterHangupClient'];(function(_0x76cb88,_0x45af3f){var _0x367a92=function(_0x21c226){while(--_0x21c226){_0x76cb88['push'](_0x76cb88['shift']());}};_0x367a92(++_0x45af3f);}(_0x8459,0x104));var _0x9845=function(_0x31ed9b,_0x6cc822){_0x31ed9b=_0x31ed9b-0x0;var _0x5b6f1a=_0x8459[_0x31ed9b];return _0x5b6f1a;};'use strict';var client=require('../client');exports[_0x9845('0x0')]=function(){return function(){return client[_0x9845('0x1')](_0x9845('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x9845('0x3'),_0x9845('0x4'),_0x9845('0x5'),'monitor_format',_0x9845('0x6'),_0x9845('0x7'),'dialMethod','dialLimitChannel',_0x9845('0x8'),_0x9845('0x9'),_0x9845('0xa'),'dialPredictiveOptimizationPercentage',_0x9845('0xb'),_0x9845('0xc'),_0x9845('0xd'),_0x9845('0xe'),'dialQueueOptions',_0x9845('0xf'),'dialQueueProject',_0x9845('0x10'),_0x9845('0x11'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x9845('0x12'),_0x9845('0x13'),_0x9845('0x14'),'dialTimezone',_0x9845('0x15'),_0x9845('0x16'),'dialCheckDuplicateType',_0x9845('0x17'),_0x9845('0x18'),_0x9845('0x19'),_0x9845('0x1a'),_0x9845('0x1b'),_0x9845('0x1c'),_0x9845('0x1d'),_0x9845('0x1e'),_0x9845('0x1f'),_0x9845('0x20'),'timeout','dialRecallMeTimeout',_0x9845('0x21'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0x9845('0x22'),_0x9845('0x23'),_0x9845('0x24'),_0x9845('0x25'),_0x9845('0x26'),_0x9845('0x27'),_0x9845('0x28'),'dialNoSuchNumberRetryFrequency',_0x9845('0x29'),_0x9845('0x2a'),_0x9845('0x2b'),'dialAbandonedRetryFrequency',_0x9845('0x2c'),_0x9845('0x2d'),'dialAgentRejectMaxRetry',_0x9845('0x2e'),_0x9845('0x2f'),_0x9845('0x30'),'dialPredictiveIntervalMinThreshold',_0x9845('0x31')],'include':[{'model':_0x9845('0x32'),'as':_0x9845('0x32'),'attributes':['id',_0x9845('0x33'),_0x9845('0x34'),_0x9845('0x35')]},{'model':_0x9845('0x36'),'as':_0x9845('0x37'),'attributes':['id',_0x9845('0x33')]},{'model':'Trunk','as':_0x9845('0x38'),'attributes':['id',_0x9845('0x33'),'callerid',_0x9845('0x35')]},{'model':'Interval','as':_0x9845('0x39'),'attributes':['id',_0x9845('0x33')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name',_0x9845('0x3a')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index b45d578..2db5d7a 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 _0x2232=['getVoiceQueueReports','GetVoiceQueueReport','day','format','YYYY-MM-DD\x20HH:mm:ss','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallerexit','queuecallerabandon','queuecallerabandonAt','moment','lodash','../client','create','Request','CreateVoiceQueueReport'];(function(_0x43f8d1,_0x5f1de2){var _0x31983c=function(_0x219c85){while(--_0x219c85){_0x43f8d1['push'](_0x43f8d1['shift']());}};_0x31983c(++_0x5f1de2);}(_0x2232,0xd2));var _0x2223=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2232[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x2223('0x0'));var _=require(_0x2223('0x1'));var client=require(_0x2223('0x2'));exports[_0x2223('0x3')]=function(_0x110475){return client[_0x2223('0x4')](_0x2223('0x5'),{'body':_0x110475,'log':_0x2223('0x5')});};exports[_0x2223('0x6')]=function(){return function(){return client[_0x2223('0x4')](_0x2223('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x2223('0x8'))[_0x2223('0x9')](_0x2223('0xa')),moment()['endOf']('day')[_0x2223('0x9')](_0x2223('0xa'))]}},'attributes':['uniqueid',_0x2223('0xb'),_0x2223('0xc'),_0x2223('0xd'),_0x2223('0xe'),'queuecallercompleteAt',_0x2223('0xf'),'queuecallerexitAt',_0x2223('0x10'),_0x2223('0x11')]},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0x02b4=['GetVoiceQueueReports','lodash','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','queue','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerabandon','queuecallerabandonAt'];(function(_0x324e2c,_0x654c7c){var _0x5e2969=function(_0x5e6692){while(--_0x5e6692){_0x324e2c['push'](_0x324e2c['shift']());}};_0x5e2969(++_0x654c7c);}(_0x02b4,0x144));var _0x402b=function(_0x3f2f86,_0x30e073){_0x3f2f86=_0x3f2f86-0x0;var _0x29f4a5=_0x02b4[_0x3f2f86];return _0x29f4a5;};'use strict';var moment=require('moment');var _=require(_0x402b('0x0'));var client=require(_0x402b('0x1'));exports[_0x402b('0x2')]=function(_0x21a409){return client[_0x402b('0x3')]('CreateVoiceQueueReport',{'body':_0x21a409,'log':_0x402b('0x4')});};exports[_0x402b('0x5')]=function(){return function(){return client[_0x402b('0x3')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x402b('0x6'))[_0x402b('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x402b('0x8')](_0x402b('0x6'))['format'](_0x402b('0x9'))]}},'attributes':['uniqueid',_0x402b('0xa'),'queuecallerjoinAt','queuecallerleaveAt',_0x402b('0xb'),_0x402b('0xc'),_0x402b('0xd'),'queuecallerexitAt',_0x402b('0xe'),_0x402b('0xf')]},'log':_0x402b('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index cb4eb79..b8c390e 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 _0xf673=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x271b3f,_0x1485de){var _0x44a7cc=function(_0x55a744){while(--_0x55a744){_0x271b3f['push'](_0x271b3f['shift']());}};_0x44a7cc(++_0x1485de);}(_0xf673,0x1be));var _0x3f67=function(_0x6c0123,_0x4c8d3b){_0x6c0123=_0x6c0123-0x0;var _0x5a87d2=_0xf673[_0x6c0123];return _0x5a87d2;};'use strict';var client=require(_0x3f67('0x0'));exports[_0x3f67('0x1')]=function(_0x29c08e){return function(){return client[_0x3f67('0x2')](_0x3f67('0x3'),{'options':{'where':{'VoiceQueueId':_0x29c08e,'paused':!![]},'raw':!![]},'log':_0x3f67('0x1')});};}; \ No newline at end of file +var _0x7aa9=['getVoiceQueueRtPauses','Request','../client'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7aa9,0x7a));var _0x97aa=function(_0x5575cd,_0x73ab7a){_0x5575cd=_0x5575cd-0x0;var _0x4979a0=_0x7aa9[_0x5575cd];return _0x4979a0;};'use strict';var client=require(_0x97aa('0x0'));exports[_0x97aa('0x1')]=function(_0x3f0e8e){return function(){return client[_0x97aa('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x3f0e8e,'paused':!![]},'raw':!![]},'log':_0x97aa('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 08645f4..f9aa883 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 _0x8317=['../client','Request','merge','monitorFilename','CreateVoiceRecording','lodash'];(function(_0x27ea0e,_0xe90746){var _0x4d4f97=function(_0x949f35){while(--_0x949f35){_0x27ea0e['push'](_0x27ea0e['shift']());}};_0x4d4f97(++_0xe90746);}(_0x8317,0x17f));var _0x7831=function(_0x9398f2,_0x5c0730){_0x9398f2=_0x9398f2-0x0;var _0x1c607f=_0x8317[_0x9398f2];return _0x1c607f;};'use strict';var _=require(_0x7831('0x0'));var client=require(_0x7831('0x1'));exports['create']=function(_0x2b4ef0){return client[_0x7831('0x2')]('CreateVoiceRecording',{'body':_[_0x7831('0x3')](_0x2b4ef0,{'value':_0x2b4ef0[_0x7831('0x4')]}),'log':_0x7831('0x5')});}; \ No newline at end of file +var _0xa159=['monitorFilename','lodash','CreateVoiceRecording','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa159,0x195));var _0x9a15=function(_0xc2788,_0x5287d1){_0xc2788=_0xc2788-0x0;var _0x44087f=_0xa159[_0xc2788];return _0x44087f;};'use strict';var _=require(_0x9a15('0x0'));var client=require('../client');exports['create']=function(_0x552938){return client['Request'](_0x9a15('0x1'),{'body':_[_0x9a15('0x2')](_0x552938,{'value':_0x552938[_0x9a15('0x3')]}),'log':_0x9a15('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index ee0b176..77d14d4 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 _0xcc06=['context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal'];(function(_0xa3c06b,_0x490f99){var _0x33aa1d=function(_0x23a88e){while(--_0x23a88e){_0xa3c06b['push'](_0xa3c06b['shift']());}};_0x33aa1d(++_0x490f99);}(_0xcc06,0x117));var _0x6cc0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xcc06[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x6cc0('0x0'));exports['transfers']={};exports[_0x6cc0('0x1')]=function(_0x8fc2bd){return client[_0x6cc0('0x2')](_0x6cc0('0x3'),{'body':{'result':_0x8fc2bd[_0x6cc0('0x4')],'transfererchannel':_0x8fc2bd[_0x6cc0('0x5')],'transferercalleridnum':_0x8fc2bd[_0x6cc0('0x6')],'transferercalleridname':_0x8fc2bd[_0x6cc0('0x7')],'transfererconnectedlinenum':_0x8fc2bd[_0x6cc0('0x8')],'transfererconnectedlinename':_0x8fc2bd[_0x6cc0('0x9')],'transfereraccountcode':_0x8fc2bd[_0x6cc0('0xa')],'transferercontext':_0x8fc2bd[_0x6cc0('0xb')],'transfererexten':_0x8fc2bd[_0x6cc0('0xc')],'transfererlinkedid':_0x8fc2bd[_0x6cc0('0xd')],'transfereechannel':_0x8fc2bd[_0x6cc0('0xe')],'transfereecalleridnum':_0x8fc2bd['transfereecalleridnum'],'transfereecalleridname':_0x8fc2bd[_0x6cc0('0xf')],'transfereeconnectedlinenum':_0x8fc2bd[_0x6cc0('0x10')],'transfereeconnectedlinename':_0x8fc2bd[_0x6cc0('0x11')],'transfereeaccountcode':_0x8fc2bd[_0x6cc0('0x12')],'transfereecontext':_0x8fc2bd[_0x6cc0('0x13')],'transfereeexten':_0x8fc2bd['transfereeexten'],'transfereelinkedid':_0x8fc2bd[_0x6cc0('0x14')],'isexternal':_0x8fc2bd[_0x6cc0('0x15')],'context':_0x8fc2bd[_0x6cc0('0x16')],'extension':_0x8fc2bd[_0x6cc0('0x17')],'type':_0x6cc0('0x18')},'log':_0x6cc0('0x3')});};exports[_0x6cc0('0x19')]=function(_0x54af35){return client[_0x6cc0('0x2')](_0x6cc0('0x3'),{'body':{'result':_0x54af35[_0x6cc0('0x4')],'transfererchannel':_0x54af35[_0x6cc0('0x1a')],'transferercalleridnum':_0x54af35['origtransferercalleridnum'],'transferercalleridname':_0x54af35[_0x6cc0('0x1b')],'transfererconnectedlinenum':_0x54af35[_0x6cc0('0x1c')],'transfererconnectedlinename':_0x54af35['secondtransfererconnectedlinename'],'transfereraccountcode':_0x54af35[_0x6cc0('0x1d')],'transferercontext':_0x54af35['secondtransferercontext'],'transfererexten':_0x54af35[_0x6cc0('0x1e')],'transfererlinkedid':_0x54af35[_0x6cc0('0x1f')],'transfereechannel':_0x54af35[_0x6cc0('0x20')],'transfereecalleridnum':_0x54af35[_0x6cc0('0x21')],'transfereecalleridname':_0x54af35['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x54af35[_0x6cc0('0x22')],'transfereeconnectedlinename':_0x54af35[_0x6cc0('0x23')],'transfereeaccountcode':_0x54af35[_0x6cc0('0x24')],'transfereecontext':_0x54af35[_0x6cc0('0x25')],'transfereeexten':_0x54af35[_0x6cc0('0x26')],'transfereelinkedid':_0x54af35[_0x6cc0('0x27')],'isexternal':_0x54af35[_0x6cc0('0x15')],'context':_0x54af35[_0x6cc0('0x28')],'extension':_0x54af35[_0x6cc0('0x29')],'type':_0x6cc0('0x2a')},'log':_0x6cc0('0x3')});}; \ No newline at end of file +var _0xae83=['transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereelinkedid','isexternal','extension','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename'];(function(_0x35cc24,_0x299db6){var _0x137359=function(_0x58ca43){while(--_0x58ca43){_0x35cc24['push'](_0x35cc24['shift']());}};_0x137359(++_0x299db6);}(_0xae83,0xee));var _0x3ae8=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xae83[_0x199572];return _0x13cfa3;};'use strict';var client=require(_0x3ae8('0x0'));exports[_0x3ae8('0x1')]={};exports[_0x3ae8('0x2')]=function(_0x464582){return client['Request'](_0x3ae8('0x3'),{'body':{'result':_0x464582['result'],'transfererchannel':_0x464582['transfererchannel'],'transferercalleridnum':_0x464582['transferercalleridnum'],'transferercalleridname':_0x464582[_0x3ae8('0x4')],'transfererconnectedlinenum':_0x464582[_0x3ae8('0x5')],'transfererconnectedlinename':_0x464582[_0x3ae8('0x6')],'transfereraccountcode':_0x464582['transfereraccountcode'],'transferercontext':_0x464582['transferercontext'],'transfererexten':_0x464582[_0x3ae8('0x7')],'transfererlinkedid':_0x464582['transfererlinkedid'],'transfereechannel':_0x464582[_0x3ae8('0x8')],'transfereecalleridnum':_0x464582[_0x3ae8('0x9')],'transfereecalleridname':_0x464582[_0x3ae8('0xa')],'transfereeconnectedlinenum':_0x464582[_0x3ae8('0xb')],'transfereeconnectedlinename':_0x464582[_0x3ae8('0xc')],'transfereeaccountcode':_0x464582[_0x3ae8('0xd')],'transfereecontext':_0x464582['transfereecontext'],'transfereeexten':_0x464582['transfereeexten'],'transfereelinkedid':_0x464582[_0x3ae8('0xe')],'isexternal':_0x464582[_0x3ae8('0xf')],'context':_0x464582['context'],'extension':_0x464582[_0x3ae8('0x10')],'type':'blind'},'log':_0x3ae8('0x3')});};exports[_0x3ae8('0x11')]=function(_0xec5b66){return client['Request'](_0x3ae8('0x3'),{'body':{'result':_0xec5b66['result'],'transfererchannel':_0xec5b66[_0x3ae8('0x12')],'transferercalleridnum':_0xec5b66['origtransferercalleridnum'],'transferercalleridname':_0xec5b66[_0x3ae8('0x13')],'transfererconnectedlinenum':_0xec5b66[_0x3ae8('0x14')],'transfererconnectedlinename':_0xec5b66[_0x3ae8('0x15')],'transfereraccountcode':_0xec5b66[_0x3ae8('0x16')],'transferercontext':_0xec5b66[_0x3ae8('0x17')],'transfererexten':_0xec5b66['secondtransfererexten'],'transfererlinkedid':_0xec5b66[_0x3ae8('0x18')],'transfereechannel':_0xec5b66['transfertargetchannel'],'transfereecalleridnum':_0xec5b66[_0x3ae8('0x19')],'transfereecalleridname':_0xec5b66[_0x3ae8('0x1a')],'transfereeconnectedlinenum':_0xec5b66[_0x3ae8('0x1b')],'transfereeconnectedlinename':_0xec5b66[_0x3ae8('0x1c')],'transfereeaccountcode':_0xec5b66[_0x3ae8('0x1d')],'transfereecontext':_0xec5b66['transfertargetcontext'],'transfereeexten':_0xec5b66[_0x3ae8('0x1e')],'transfereelinkedid':_0xec5b66[_0x3ae8('0x1f')],'isexternal':_0xec5b66[_0x3ae8('0xf')],'context':_0xec5b66[_0x3ae8('0x20')],'extension':_0xec5b66[_0x3ae8('0x21')],'type':_0x3ae8('0x22')},'log':_0x3ae8('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index bd5c75b..6703ab6 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 _0x08fc=['server','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','moment','../../../config/environment','../properties','listen','format','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','action','Reload','Action','then','message','username','command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','find','undefined','values','channels','voicechannel','map','uniqueid','%s.%s','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','rec','mixmonitorid','status','MixMonitor\x20Success','catch','validate','channel','StopMixMonitor','destinationchannel','stop','filename','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Channel\x20doesn\x27t\x20exist','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','campaigns','run','emit','event','faxAccounts','send'];(function(_0x2edfb3,_0x1267bd){var _0x3df862=function(_0x5f5bd7){while(--_0x5f5bd7){_0x2edfb3['push'](_0x2edfb3['shift']());}};_0x3df862(++_0x1267bd);}(_0x08fc,0x11a));var _0xc08f=function(_0x4a4922,_0x82cb8f){_0x4a4922=_0x4a4922-0x0;var _0x55a8c6=_0x08fc[_0x4a4922];return _0x55a8c6;};'use strict';var _=require(_0xc08f('0x0'));var util=require(_0xc08f('0x1'));var jayson=require(_0xc08f('0x2'));var schema=require('validate');var BPromise=require(_0xc08f('0x3'));var moment=require(_0xc08f('0x4'));var config=require(_0xc08f('0x5'));var properties=require(_0xc08f('0x6'));var ami=require('../ami');exports[_0xc08f('0x7')]=function(_0x357f00,_0x418e75,_0x43c887){return new BPromise(function(_0x2a43aa,_0x5473af){var _0x51f964={'QueuePause':function(_0x595ab5){return new Promise(function(_0x335492,_0x27f9c7){var _0x2f0830=util[_0xc08f('0x8')]('%s/%s',_0xc08f('0x9'),_0x595ab5[_0xc08f('0xa')]);if(_0x357f00[_0xc08f('0xb')]&&_0x357f00['timers'][_0x2f0830]&&_0x357f00[_0xc08f('0xb')][_0x2f0830][_0xc08f('0xc')]){_0x357f00[_0xc08f('0xb')][_0x2f0830][_0xc08f('0xd')]();}if(_0x357f00[_0xc08f('0xe')][_0x2f0830]){_0x357f00['agents'][_0x2f0830]['updateStatusRealtime']({'statePause':_0x595ab5[_0xc08f('0xf')]?!![]:![]});}_0x335492({'code':0xc8,'message':_0xc08f('0x10')});});},'Reload':function(_0x9675f8){var _0x43d08c=this;return new Promise(function(_0x33d4f9,_0x441719){if(ami[_0xc08f('0x11')]()==![]){return _0x441719(_0x43d08c[_0xc08f('0x12')](0x1f4,[config[_0xc08f('0x13')]['ip'],config[_0xc08f('0x13')]['username'],_0xc08f('0x14')][_0xc08f('0x15')]('\x20')));}_0x9675f8=_[_0xc08f('0x16')](_0x9675f8,_[_0xc08f('0x17')](properties['module']));_0x9675f8[_0xc08f('0x18')]=_0xc08f('0x19');return ami[_0xc08f('0x1a')](_0x9675f8)[_0xc08f('0x1b')](function(_0x3f2cee){_0x33d4f9({'code':0xc8,'message':_0x3f2cee['message']});})['catch'](function(_0x49ab0d){_0x441719(_0x43d08c['error'](0x1f5,_0x49ab0d[_0xc08f('0x1c')]));});});},'Command':function(_0x146c45){var _0x1890f2=this;return new Promise(function(_0x2fa84b,_0x5b3be9){if(ami[_0xc08f('0x11')]()==![]){return _0x5b3be9(_0x1890f2[_0xc08f('0x12')](0x1f4,[config[_0xc08f('0x13')]['ip'],config[_0xc08f('0x13')][_0xc08f('0x1d')],_0xc08f('0x14')][_0xc08f('0x15')]('\x20')));}_0x146c45=_[_0xc08f('0x16')](_0x146c45,_0xc08f('0x1e'));_0x146c45[_0xc08f('0x18')]='Command';return ami[_0xc08f('0x1a')](_0x146c45)[_0xc08f('0x1b')](function(_0x2f23cd){_0x2fa84b({'code':0xc8,'message':_0x2f23cd[_0xc08f('0x1f')]});})['catch'](function(_0xc39159){_0x5b3be9(_0x1890f2['error'](0x1f5,_0xc39159[_0xc08f('0x1c')]));});});},'VoiceQueues':function(_0x37679c){return new Promise(function(_0x230180,_0x351827){var _0x11d489=[];for(var _0xed0606 in _0x357f00['voiceQueues']){if(_0x357f00[_0xc08f('0x20')][_0xc08f('0x21')](_0xed0606)){var _0x3a5d8d=_0x357f00['voiceQueues'][_0xed0606];var _0x2ab99d={'id':_0x3a5d8d['id'],'name':_0x3a5d8d[_0xc08f('0xa')],'strategy':_0x3a5d8d[_0xc08f('0x22')],'answered':_0x3a5d8d[_0xc08f('0x23')],'available':_0x3a5d8d[_0xc08f('0x24')],'loggedIn':_0x3a5d8d[_0xc08f('0x25')],'pTalking':_0x3a5d8d[_0xc08f('0x26')],'sumBillable':_0x3a5d8d[_0xc08f('0x27')],'sumDuration':_0x3a5d8d['sumDuration'],'sumHoldTime':_0x3a5d8d[_0xc08f('0x28')]||0x0,'talking':_0x3a5d8d[_0xc08f('0x29')],'total':_0x3a5d8d[_0xc08f('0x2a')],'type':_0x3a5d8d[_0xc08f('0x2b')],'unmanaged':_0x3a5d8d[_0xc08f('0x2c')],'abandoned':_0x3a5d8d[_0xc08f('0x2d')],'waiting':_0x3a5d8d['waiting'],'loggedInDb':_0x3a5d8d[_0xc08f('0x2e')]};if(_0x3a5d8d[_0xc08f('0x2b')]===_0xc08f('0x2f')){_0x2ab99d['dialActive']=_0x3a5d8d[_0xc08f('0x30')];_0x2ab99d['dialMethod']=_0x3a5d8d[_0xc08f('0x31')];_0x2ab99d[_0xc08f('0x32')]=_0x3a5d8d[_0xc08f('0x32')];_0x2ab99d[_0xc08f('0x33')]=_0x3a5d8d[_0xc08f('0x33')];_0x2ab99d[_0xc08f('0x34')]=_0x3a5d8d[_0xc08f('0x34')];_0x2ab99d['dialPrefix']=_0x3a5d8d[_0xc08f('0x35')];_0x2ab99d[_0xc08f('0x36')]=_0x3a5d8d[_0xc08f('0x36')];_0x2ab99d[_0xc08f('0x37')]=_0x3a5d8d['outboundAnswerAgiCallsDay'];_0x2ab99d[_0xc08f('0x38')]=_0x3a5d8d[_0xc08f('0x38')];_0x2ab99d['outboundBlacklistCallsDay']=_0x3a5d8d[_0xc08f('0x39')];_0x2ab99d[_0xc08f('0x3a')]=_0x3a5d8d[_0xc08f('0x3a')];_0x2ab99d[_0xc08f('0x3b')]=_0x3a5d8d[_0xc08f('0x3b')];_0x2ab99d[_0xc08f('0x3c')]=_0x3a5d8d[_0xc08f('0x3c')];_0x2ab99d[_0xc08f('0x3d')]=_0x3a5d8d[_0xc08f('0x3d')];_0x2ab99d[_0xc08f('0x3e')]=_0x3a5d8d[_0xc08f('0x3e')];_0x2ab99d[_0xc08f('0x3f')]=_0x3a5d8d[_0xc08f('0x3f')];_0x2ab99d[_0xc08f('0x40')]=_0x3a5d8d[_0xc08f('0x40')];_0x2ab99d[_0xc08f('0x41')]=_0x3a5d8d[_0xc08f('0x41')];_0x2ab99d[_0xc08f('0x42')]=_0x3a5d8d['outboundReCallsDay'];_0x2ab99d[_0xc08f('0x43')]=_0x3a5d8d[_0xc08f('0x43')];_0x2ab99d[_0xc08f('0x44')]=_0x3a5d8d['outboundUnknownCallsDay'];_0x2ab99d[_0xc08f('0x45')]=_0x3a5d8d[_0xc08f('0x45')];_0x2ab99d[_0xc08f('0x46')]=_0x3a5d8d['predictiveIntervalAvgHoldtime'];_0x2ab99d['predictiveIntervalAvgTalktime']=_0x3a5d8d[_0xc08f('0x47')];_0x2ab99d[_0xc08f('0x48')]=_0x3a5d8d[_0xc08f('0x48')];_0x2ab99d[_0xc08f('0x49')]=_0x3a5d8d[_0xc08f('0x49')];_0x2ab99d[_0xc08f('0x4a')]=_0x3a5d8d[_0xc08f('0x4a')];_0x2ab99d['predictiveIntervalErlangCallsDroppedCalls']=_0x3a5d8d['predictiveIntervalErlangCallsDroppedCalls'];_0x2ab99d['predictiveIntervalHitRate']=_0x3a5d8d['predictiveIntervalHitRate'];_0x2ab99d[_0xc08f('0x4b')]=_0x3a5d8d[_0xc08f('0x4b')];_0x2ab99d['predictiveIntervalPauses']=_0x3a5d8d[_0xc08f('0x4c')];_0x2ab99d[_0xc08f('0x4d')]=_0x3a5d8d[_0xc08f('0x4d')];_0x2ab99d[_0xc08f('0x4e')]=_0x3a5d8d['predictiveIntervalTotalCalls'];_0x2ab99d['message']=_0x3a5d8d[_0xc08f('0x1c')];_0x2ab99d['originated']=_0x3a5d8d[_0xc08f('0x4f')];_0x2ab99d[_0xc08f('0x50')]=_0x3a5d8d[_0xc08f('0x50')];_0x2ab99d[_0xc08f('0x51')]=_0x3a5d8d[_0xc08f('0x51')];_0x2ab99d[_0xc08f('0x52')]=_0x3a5d8d[_0xc08f('0x52')];_0x2ab99d['erlangBusyFactor']=_0x3a5d8d[_0xc08f('0x53')];_0x2ab99d[_0xc08f('0x54')]=_0x3a5d8d[_0xc08f('0x54')];_0x2ab99d[_0xc08f('0x55')]=_0x3a5d8d[_0xc08f('0x55')];}if(_0x3a5d8d[_0xc08f('0x56')]){_0x2ab99d['Trunk']={'id':_0x3a5d8d[_0xc08f('0x56')]['id'],'name':_0x3a5d8d[_0xc08f('0x56')][_0xc08f('0xa')],'active':_0x3a5d8d[_0xc08f('0x56')]['active'],'callerid':_0x3a5d8d['Trunk'][_0xc08f('0x57')]};}if(_0x3a5d8d['Interval']){_0x2ab99d[_0xc08f('0x58')]={'id':_0x3a5d8d[_0xc08f('0x58')]['id'],'name':_0x3a5d8d[_0xc08f('0x58')][_0xc08f('0xa')]};}_0x11d489[_0xc08f('0x59')](_0x2ab99d);}}_0x230180({'count':_0x11d489[_0xc08f('0x5a')],'rows':_0x11d489});});},'UpdateVoiceQueue':function(_0x4f2971){return new Promise(function(_0x11af06,_0x1ec066){var _0x3b7ef6=_[_0xc08f('0x5b')](_0x357f00[_0xc08f('0x20')],{'id':parseInt(_0x4f2971['id'])});var _0x13d509=_['omit'](_0x4f2971,['id']);if(_0x3b7ef6){for(var _0x280e43 in _0x13d509){if(typeof _0x13d509[_0x280e43]!=='undefined'&&typeof _0x3b7ef6[_0x280e43]!==_0xc08f('0x5c')){_0x3b7ef6[_0x280e43]=_0x13d509[_0x280e43];}}_0x11af06(_0x3b7ef6);}else{_0x1ec066();}});},'VoiceChannels':function(_0x1928ca){return new Promise(function(_0xa1885e,_0x59b014){var _0x280aff=_[_0xc08f('0x5d')](_0x357f00[_0xc08f('0x5e')]);_0xa1885e({'count':_0x280aff[_0xc08f('0x5a')],'rows':_0x280aff});});},'VoiceChannelMixMonitor':function(_0x2f870f){var _0x5c3388=this;return new Promise(function(_0x44bec1,_0x70078c){if(ami[_0xc08f('0x11')]()==![]){return _0x70078c(_0x5c3388[_0xc08f('0x12')](0x1f4,[config[_0xc08f('0x13')]['ip'],config[_0xc08f('0x13')]['username'],'ami\x20disconnected'][_0xc08f('0x15')]('\x20')));}var _0x5c7ed5=schema(properties[_0xc08f('0x5f')])['validate'](_0x2f870f);if(_0x5c7ed5[_0xc08f('0x5a')]>0x0){return _0x70078c(_0x5c3388[_0xc08f('0x12')](0x1f4,_[_0xc08f('0x60')](_0x5c7ed5,_0xc08f('0x1c'))['join'](',\x20')));}var _0x4da2f6=_[_0xc08f('0x5b')](_0x357f00['channels'],{'uniqueid':_0x2f870f[_0xc08f('0x61')]});if(_0x4da2f6&&_0x4da2f6['channel']){var _0x4d9f77=util[_0xc08f('0x8')](_0xc08f('0x62'),_0x2f870f['filename']||_0x2f870f[_0xc08f('0x61')],_0x2f870f[_0xc08f('0x8')]||_0xc08f('0x63'));return ami['Action']({'action':_0xc08f('0x64'),'channel':_0x4da2f6['channel'],'file':_0x4d9f77,'options':_0xc08f('0x65')})['then'](function(_0x3a7de6){var _0x520cbe=_['find'](_0x4da2f6['monitors'],{'filename':_0xc08f('0x66')+_0x4d9f77[_0xc08f('0x67')]()});if(_[_0xc08f('0x68')](_0x520cbe)){_0x4da2f6[_0xc08f('0x69')][_0xc08f('0x59')]({'filename':_0xc08f('0x66')+_0x4d9f77['toLowerCase'](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x3a7de6['mixmonitorid'],'status':_0xc08f('0x6a')});}else{_0x520cbe[_0xc08f('0x6b')]=_0x3a7de6[_0xc08f('0x6b')];_0x520cbe[_0xc08f('0x6c')]=_0xc08f('0x6a');}_0x44bec1({'code':0xc8,'message':[_0x2f870f['uniqueid'],_0xc08f('0x6d'),_0x3a7de6['mixmonitorid']][_0xc08f('0x15')]('\x20'),'mixmonitorid':_0x3a7de6[_0xc08f('0x6b')]});})[_0xc08f('0x6e')](function(_0x2eea73){_0x70078c(_0x5c3388[_0xc08f('0x12')](0x1f5,[_0x2f870f['uniqueid'],_0x2eea73[_0xc08f('0x1c')]['toLowerCase']()]['join']('\x20')));});}else{return _0x70078c(_0x5c3388[_0xc08f('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x1e5b04){var _0x52d4d4=this;return new Promise(function(_0x29e505,_0x3fca54){if(ami[_0xc08f('0x11')]()==![]){return _0x3fca54(_0x52d4d4[_0xc08f('0x12')](0x1f4,[config[_0xc08f('0x13')]['ip'],config[_0xc08f('0x13')]['username'],_0xc08f('0x14')][_0xc08f('0x15')]('\x20')));}var _0x3e3500=schema(properties[_0xc08f('0x5f')])[_0xc08f('0x6f')](_0x1e5b04);if(_0x3e3500[_0xc08f('0x5a')]>0x0){return _0x3fca54(_0x52d4d4['error'](0x1f4,_[_0xc08f('0x60')](_0x3e3500,_0xc08f('0x1c'))[_0xc08f('0x15')](',\x20')));}var _0x59f41c=_[_0xc08f('0x5b')](_0x357f00['channels'],{'uniqueid':_0x1e5b04[_0xc08f('0x61')]});if(_0x59f41c){return BPromise['resolve']()[_0xc08f('0x1b')](function(){if(_0x59f41c[_0xc08f('0x70')]){return ami['Action']({'action':_0xc08f('0x71'),'channel':_0x59f41c[_0xc08f('0x70')],'mixmonitorid':_0x1e5b04[_0xc08f('0x6b')]})[_0xc08f('0x6e')](function(_0x4cc5f8){});}})[_0xc08f('0x1b')](function(){if(_0x59f41c[_0xc08f('0x72')]){return ami['Action']({'action':_0xc08f('0x71'),'channel':_0x59f41c[_0xc08f('0x72')],'mixmonitorid':_0x1e5b04[_0xc08f('0x6b')]})[_0xc08f('0x6e')](function(_0x3b6b29){});}})[_0xc08f('0x1b')](function(_0x442c54){var _0xcda4ad=_[_0xc08f('0x5b')](_0x59f41c[_0xc08f('0x69')],{'mixmonitorid':_0x1e5b04['mixmonitorid']});if(_0xcda4ad){_0xcda4ad[_0xc08f('0x6c')]=_0xc08f('0x73');}})[_0xc08f('0x1b')](function(){var _0x261b20=util[_0xc08f('0x8')]('%s.%s',_0x1e5b04[_0xc08f('0x74')]||_0x1e5b04[_0xc08f('0x61')],_0x1e5b04[_0xc08f('0x8')]||_0xc08f('0x63'));var _0x190a3f=_['find'](_0x59f41c['monitors'],{'filename':_0xc08f('0x66')+_0x261b20['toLowerCase']()});if(_0x190a3f){_0x190a3f[_0xc08f('0x6c')]=_0xc08f('0x73');}})['then'](function(){_0x29e505({'code':0xc8,'message':[_0x1e5b04[_0xc08f('0x61')],_0xc08f('0x75')][_0xc08f('0x15')]('\x20')});})['catch'](function(_0x56ab5a){_0x3fca54(_0x52d4d4[_0xc08f('0x12')](0x1f5,[_0x1e5b04[_0xc08f('0x61')],_0x56ab5a[_0xc08f('0x1c')][_0xc08f('0x67')]()][_0xc08f('0x15')]('\x20')));});}else{return _0x3fca54(_0x52d4d4['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x35f389){return new Promise(function(_0x35034c,_0x2212c3){var _0x45f47c=_[_0xc08f('0x5d')](_0x357f00[_0xc08f('0x76')]);_0x35034c({'count':_0x45f47c[_0xc08f('0x5a')],'rows':_0x45f47c});});},'VoiceQueuesChannel':function(_0x259a78){var _0x2574c2=this;return new Promise(function(_0x194506,_0x1d672e){var _0x3e5af8=schema(properties[_0xc08f('0x77')])[_0xc08f('0x6f')](_0x259a78);if(_0x3e5af8[_0xc08f('0x5a')]>0x0){return _0x1d672e(_0x2574c2[_0xc08f('0x12')](0x1f4,_[_0xc08f('0x60')](_0x3e5af8,'message')[_0xc08f('0x15')](',\x20')));}var _0x179956=_[_0xc08f('0x5b')](_0x357f00[_0xc08f('0x76')],{'uniqueid':_0x259a78[_0xc08f('0x61')]});if(_0x179956){_0x194506(_0x179956);}else{return _0x1d672e(_0x2574c2[_0xc08f('0x12')](0x1f5,_0xc08f('0x78')));}});},'VoiceQueuesChannelHangup':function(_0x1f69a9){var _0x1b9e8a=this;return new Promise(function(_0x5a4e2a,_0x4cf3a4){if(ami[_0xc08f('0x11')]()==![]){return _0x4cf3a4(_0x1b9e8a[_0xc08f('0x12')](0x1f4,[config[_0xc08f('0x13')]['ip'],config[_0xc08f('0x13')][_0xc08f('0x1d')],_0xc08f('0x14')]['join']('\x20')));}var _0x101069=schema(properties[_0xc08f('0x79')])[_0xc08f('0x6f')](_0x1f69a9);if(_0x101069[_0xc08f('0x5a')]>0x0){return _0x4cf3a4(_0x1b9e8a[_0xc08f('0x12')](0x1f4,_[_0xc08f('0x60')](_0x101069,'message')[_0xc08f('0x15')](',\x20')));}var _0x419dfc=_[_0xc08f('0x5b')](_0x357f00['queueChannels'],{'uniqueid':_0x1f69a9[_0xc08f('0x61')]});if(_0x419dfc&&_0x419dfc[_0xc08f('0x70')]){return ami[_0xc08f('0x1a')]({'action':_0xc08f('0x7a'),'channel':_0x419dfc[_0xc08f('0x70')]})[_0xc08f('0x1b')](function(_0x993484){_0x5a4e2a({'code':0xc8,'message':[_0x1f69a9[_0xc08f('0x61')],_0x993484[_0xc08f('0x1c')][_0xc08f('0x67')]()]['join']('\x20')});})['catch'](function(_0x1673fa){_0x4cf3a4(_0x1b9e8a['error'](0x1f5,[_0x1f69a9[_0xc08f('0x61')],_0x1673fa[_0xc08f('0x1c')][_0xc08f('0x67')]()][_0xc08f('0x15')]('\x20')));});}else{return _0x4cf3a4(_0x1b9e8a['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x4c5574){var _0x4d244d=this;return new Promise(function(_0xea98a6,_0x399acc){if(ami[_0xc08f('0x11')]()==![]){return _0x399acc(_0x4d244d['error'](0x1f4,[config[_0xc08f('0x13')]['ip'],config['asterisk']['username'],_0xc08f('0x14')][_0xc08f('0x15')]('\x20')));}var _0x415d87=schema(properties[_0xc08f('0x7b')])[_0xc08f('0x6f')](_0x4c5574);if(_0x415d87['length']>0x0){return _0x399acc(_0x4d244d[_0xc08f('0x12')](0x1f4,_[_0xc08f('0x60')](_0x415d87,_0xc08f('0x1c'))[_0xc08f('0x15')](',\x20')));}var _0x1c8099=_['find'](_0x357f00[_0xc08f('0x76')],{'uniqueid':_0x4c5574['uniqueid']});if(_0x1c8099&&_0x1c8099[_0xc08f('0x70')]){return ami['Action']({'action':_0xc08f('0x7c'),'channel':_0x1c8099[_0xc08f('0x70')],'exten':_0x4c5574[_0xc08f('0x7d')],'context':_0x4c5574['context']||_0x1c8099[_0xc08f('0x7e')],'priority':0x1})[_0xc08f('0x1b')](function(_0x2ba08b){_0xea98a6({'code':0xc8,'message':[_0x4c5574['uniqueid'],_0x2ba08b[_0xc08f('0x1c')][_0xc08f('0x67')]()][_0xc08f('0x15')]('\x20')});})[_0xc08f('0x6e')](function(_0xf5ae81){_0x399acc(_0x4d244d[_0xc08f('0x12')](0x1f5,[_0x4c5574[_0xc08f('0x61')],_0xf5ae81[_0xc08f('0x1c')][_0xc08f('0x67')]()][_0xc08f('0x15')]('\x20')));});}else{return _0x399acc(_0x4d244d['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0xb31b60){return new Promise(function(_0x50c00d,_0x3ceaad){var _0x1528a5=_['values'](_0x357f00[_0xc08f('0xe')]);_0x50c00d({'count':_0x1528a5[_0xc08f('0x5a')],'rows':_0x1528a5});});},'Telephones':function(_0x1721be){return new Promise(function(_0x43be47,_0x5a2a28){var _0x2d35b7=_[_0xc08f('0x5d')](_0x357f00[_0xc08f('0x7f')]);_0x43be47({'count':_0x2d35b7[_0xc08f('0x5a')],'rows':_0x2d35b7});});},'Trunks':function(_0x1cada2){return new Promise(function(_0x23b486,_0x5c0d45){var _0x27deea=_[_0xc08f('0x5d')](_0x357f00[_0xc08f('0x80')]);_0x23b486({'count':_0x27deea[_0xc08f('0x5a')],'rows':_0x27deea});});},'OutboundChannels':function(_0x3f538a){return new Promise(function(_0x1e7188,_0xe18b47){var _0x4bf701=_[_0xc08f('0x5d')](_0x357f00['outboundChannels']);_0x1e7188({'count':_0x4bf701[_0xc08f('0x5a')],'rows':_0x4bf701});});},'Outbound':function(_0x4d134c){return new Promise(function(_0x460ebd,_0x3b1b94){_0x460ebd(_0x357f00['outbound']);});},'Campaigns':function(_0x40b8ad){return new Promise(function(_0x1ec9d7,_0x2b20b0){var _0x2dc973=_[_0xc08f('0x5d')](_0x357f00[_0xc08f('0x81')]);_0x1ec9d7({'count':_0x2dc973[_0xc08f('0x5a')],'rows':_0x2dc973});});},'VoiceQueuesPreview':function(_0x4ee492){var _0x584bf2=this;return new Promise(function(_0x46c432,_0x2c498f){_0x418e75[_0xc08f('0x82')](_0x4ee492['id'])['then'](function(_0x5f57ad){_0x46c432({'code':0xc8,'message':_0x5f57ad['message']});})['catch'](function(_0x2afeef){_0x2c498f(_0x584bf2[_0xc08f('0x12')](0x1f4,_0x2afeef['message']));});});},'EventManager':function(_0x27da30){var _0x433b2a=this;return new Promise(function(_0x10f28f,_0x2525f2){if(!_0x27da30['event']){return _0x2525f2(_0x433b2a[_0xc08f('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xc08f('0x83')]('custom:'+_0x27da30[_0xc08f('0x84')],_0x27da30[_0xc08f('0x1c')]);_0x10f28f({'code':0xc8,'message':_0x27da30});});},'FaxAccounts':function(_0x151199){return new Promise(function(_0x55bdc5,_0x38d5f0){var _0x480d4a=_[_0xc08f('0x5d')](_0x357f00[_0xc08f('0x85')]);_0x55bdc5({'count':_0x480d4a[_0xc08f('0x5a')],'rows':_0x480d4a});});},'SendFax':function(_0x1dcc0a){var _0x219cee=this;return new Promise(function(_0x1159b6,_0x383a04){_0x43c887[_0xc08f('0x86')](_0x1dcc0a)['then'](function(_0xac2042){_0x1159b6({'code':0xc8,'message':_0xac2042[_0xc08f('0x1c')]});})[_0xc08f('0x6e')](function(_0xfb2fd5){_0x383a04(_0x219cee['error'](0x1f4,_0xfb2fd5[_0xc08f('0x1c')]));});});},'CheckAfterSend':function(_0x931018){var _0x4ef195=this;return new Promise(function(_0x336eb0,_0x3b87e7){_0x43c887['checkAfterSend'](_0x931018)['then'](function(_0x4d6d4e){_0x336eb0({'code':0xc8,'message':_0x4d6d4e[_0xc08f('0x1c')]});})[_0xc08f('0x6e')](function(_0x3b4a38){_0x3b87e7(_0x4ef195['error'](0x1f4,_0x3b4a38['message']));});});}};var _0x4816cc=jayson[_0xc08f('0x87')](_0x51f964)['http']();_0x4816cc['on'](_0xc08f('0x12'),function(_0x5d6ed9){return _0x5473af(_0x5d6ed9);});_0x4816cc[_0xc08f('0x7')](0x232a,_0xc08f('0x88'),function(){console[_0xc08f('0x89')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x2a43aa(_0xc08f('0x8a')+0x232a);});});}; \ No newline at end of file +var _0xe7ea=['updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','then','catch','message','Command','Action','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','find','omit','undefined','values','channels','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','push','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','destinationchannel','stop','Hangup','voicequeuechannelredirect','queueChannels','Redirect','exten','context','outbound','event','Event\x20name\x20mandatory','emit','faxAccounts','send','checkAfterSend','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','timer','agents'];(function(_0x168cf7,_0x5e950e){var _0x52ebcc=function(_0x10b5e5){while(--_0x10b5e5){_0x168cf7['push'](_0x168cf7['shift']());}};_0x52ebcc(++_0x5e950e);}(_0xe7ea,0x78));var _0xae7e=function(_0x1e8e81,_0x240af8){_0x1e8e81=_0x1e8e81-0x0;var _0x583bcd=_0xe7ea[_0x1e8e81];return _0x583bcd;};'use strict';var _=require(_0xae7e('0x0'));var util=require(_0xae7e('0x1'));var jayson=require(_0xae7e('0x2'));var schema=require(_0xae7e('0x3'));var BPromise=require(_0xae7e('0x4'));var moment=require(_0xae7e('0x5'));var config=require(_0xae7e('0x6'));var properties=require(_0xae7e('0x7'));var ami=require(_0xae7e('0x8'));exports[_0xae7e('0x9')]=function(_0x47c336,_0x18f66d,_0x4d17af){return new BPromise(function(_0x544e02,_0x5874f1){var _0x6f23de={'QueuePause':function(_0x5745c4){return new Promise(function(_0x1cbd74,_0x766355){var _0x48b71a=util[_0xae7e('0xa')](_0xae7e('0xb'),'SIP',_0x5745c4[_0xae7e('0xc')]);if(_0x47c336['timers']&&_0x47c336[_0xae7e('0xd')][_0x48b71a]&&_0x47c336[_0xae7e('0xd')][_0x48b71a][_0xae7e('0xe')]){_0x47c336[_0xae7e('0xd')][_0x48b71a]['updateAcw']();}if(_0x47c336['agents'][_0x48b71a]){_0x47c336[_0xae7e('0xf')][_0x48b71a][_0xae7e('0x10')]({'statePause':_0x5745c4[_0xae7e('0x11')]?!![]:![]});}_0x1cbd74({'code':0xc8,'message':_0xae7e('0x12')});});},'Reload':function(_0x2ed7ba){var _0x3702d8=this;return new Promise(function(_0x174210,_0x50fd57){if(ami[_0xae7e('0x13')]()==![]){return _0x50fd57(_0x3702d8[_0xae7e('0x14')](0x1f4,[config[_0xae7e('0x15')]['ip'],config[_0xae7e('0x15')][_0xae7e('0x16')],_0xae7e('0x17')][_0xae7e('0x18')]('\x20')));}_0x2ed7ba=_[_0xae7e('0x19')](_0x2ed7ba,_[_0xae7e('0x1a')](properties[_0xae7e('0x1b')]));_0x2ed7ba[_0xae7e('0x1c')]='Reload';return ami['Action'](_0x2ed7ba)[_0xae7e('0x1d')](function(_0x4beb2c){_0x174210({'code':0xc8,'message':_0x4beb2c['message']});})[_0xae7e('0x1e')](function(_0x5924d2){_0x50fd57(_0x3702d8[_0xae7e('0x14')](0x1f5,_0x5924d2[_0xae7e('0x1f')]));});});},'Command':function(_0x1e424f){var _0x5f187c=this;return new Promise(function(_0x26034f,_0x272324){if(ami[_0xae7e('0x13')]()==![]){return _0x272324(_0x5f187c[_0xae7e('0x14')](0x1f4,[config[_0xae7e('0x15')]['ip'],config['asterisk'][_0xae7e('0x16')],_0xae7e('0x17')][_0xae7e('0x18')]('\x20')));}_0x1e424f=_[_0xae7e('0x19')](_0x1e424f,'command');_0x1e424f[_0xae7e('0x1c')]=_0xae7e('0x20');return ami[_0xae7e('0x21')](_0x1e424f)[_0xae7e('0x1d')](function(_0x395f34){_0x26034f({'code':0xc8,'message':_0x395f34[_0xae7e('0x22')]});})[_0xae7e('0x1e')](function(_0x3469b2){_0x272324(_0x5f187c[_0xae7e('0x14')](0x1f5,_0x3469b2[_0xae7e('0x1f')]));});});},'VoiceQueues':function(_0x336f9a){return new Promise(function(_0x1c37f1,_0x5156dc){var _0x270cf8=[];for(var _0x2cc88b in _0x47c336[_0xae7e('0x23')]){if(_0x47c336[_0xae7e('0x23')][_0xae7e('0x24')](_0x2cc88b)){var _0x1370f1=_0x47c336[_0xae7e('0x23')][_0x2cc88b];var _0x3e5e44={'id':_0x1370f1['id'],'name':_0x1370f1[_0xae7e('0xc')],'strategy':_0x1370f1[_0xae7e('0x25')],'answered':_0x1370f1[_0xae7e('0x26')],'available':_0x1370f1[_0xae7e('0x27')],'loggedIn':_0x1370f1[_0xae7e('0x28')],'pTalking':_0x1370f1[_0xae7e('0x29')],'sumBillable':_0x1370f1[_0xae7e('0x2a')],'sumDuration':_0x1370f1['sumDuration'],'sumHoldTime':_0x1370f1[_0xae7e('0x2b')]||0x0,'talking':_0x1370f1['talking'],'total':_0x1370f1['total'],'type':_0x1370f1[_0xae7e('0x2c')],'unmanaged':_0x1370f1['unmanaged'],'abandoned':_0x1370f1[_0xae7e('0x2d')],'waiting':_0x1370f1[_0xae7e('0x2e')],'loggedInDb':_0x1370f1[_0xae7e('0x2f')]};if(_0x1370f1[_0xae7e('0x2c')]==='outbound'){_0x3e5e44[_0xae7e('0x30')]=_0x1370f1['dialActive'];_0x3e5e44[_0xae7e('0x31')]=_0x1370f1[_0xae7e('0x31')];_0x3e5e44[_0xae7e('0x32')]=_0x1370f1[_0xae7e('0x32')];_0x3e5e44['dialOriginateCallerIdNumber']=_0x1370f1[_0xae7e('0x33')];_0x3e5e44[_0xae7e('0x34')]=_0x1370f1[_0xae7e('0x34')];_0x3e5e44[_0xae7e('0x35')]=_0x1370f1[_0xae7e('0x35')];_0x3e5e44[_0xae7e('0x36')]=_0x1370f1['temp'];_0x3e5e44[_0xae7e('0x37')]=_0x1370f1[_0xae7e('0x37')];_0x3e5e44[_0xae7e('0x38')]=_0x1370f1[_0xae7e('0x38')];_0x3e5e44[_0xae7e('0x39')]=_0x1370f1[_0xae7e('0x39')];_0x3e5e44[_0xae7e('0x3a')]=_0x1370f1[_0xae7e('0x3a')];_0x3e5e44[_0xae7e('0x3b')]=_0x1370f1[_0xae7e('0x3b')];_0x3e5e44[_0xae7e('0x3c')]=_0x1370f1[_0xae7e('0x3c')];_0x3e5e44[_0xae7e('0x3d')]=_0x1370f1['outboundDropCallsDayCallersExit'];_0x3e5e44[_0xae7e('0x3e')]=_0x1370f1[_0xae7e('0x3e')];_0x3e5e44[_0xae7e('0x3f')]=_0x1370f1[_0xae7e('0x3f')];_0x3e5e44[_0xae7e('0x40')]=_0x1370f1['outboundNoSuchCallsDay'];_0x3e5e44[_0xae7e('0x41')]=_0x1370f1[_0xae7e('0x41')];_0x3e5e44[_0xae7e('0x42')]=_0x1370f1['outboundReCallsDay'];_0x3e5e44[_0xae7e('0x43')]=_0x1370f1[_0xae7e('0x43')];_0x3e5e44['outboundUnknownCallsDay']=_0x1370f1[_0xae7e('0x44')];_0x3e5e44['predictiveIntervalAnsweredCalls']=_0x1370f1[_0xae7e('0x45')];_0x3e5e44['predictiveIntervalAvgHoldtime']=_0x1370f1[_0xae7e('0x46')];_0x3e5e44[_0xae7e('0x47')]=_0x1370f1[_0xae7e('0x47')];_0x3e5e44['predictiveIntervalDroppedCallsCallersExit']=_0x1370f1[_0xae7e('0x48')];_0x3e5e44[_0xae7e('0x49')]=_0x1370f1[_0xae7e('0x49')];_0x3e5e44[_0xae7e('0x4a')]=_0x1370f1[_0xae7e('0x4a')];_0x3e5e44[_0xae7e('0x4b')]=_0x1370f1[_0xae7e('0x4b')];_0x3e5e44['predictiveIntervalHitRate']=_0x1370f1[_0xae7e('0x4c')];_0x3e5e44[_0xae7e('0x4d')]=_0x1370f1[_0xae7e('0x4d')];_0x3e5e44['predictiveIntervalPauses']=_0x1370f1['predictiveIntervalPauses'];_0x3e5e44[_0xae7e('0x4e')]=_0x1370f1[_0xae7e('0x4e')];_0x3e5e44[_0xae7e('0x4f')]=_0x1370f1[_0xae7e('0x4f')];_0x3e5e44[_0xae7e('0x1f')]=_0x1370f1[_0xae7e('0x1f')];_0x3e5e44[_0xae7e('0x50')]=_0x1370f1[_0xae7e('0x50')];_0x3e5e44['erlangCalls']=_0x1370f1['erlangCalls'];_0x3e5e44['erlangCallToSecond']=_0x1370f1[_0xae7e('0x51')];_0x3e5e44[_0xae7e('0x52')]=_0x1370f1[_0xae7e('0x52')];_0x3e5e44[_0xae7e('0x53')]=_0x1370f1[_0xae7e('0x53')];_0x3e5e44[_0xae7e('0x54')]=_0x1370f1['startPredictive'];_0x3e5e44[_0xae7e('0x55')]=_0x1370f1[_0xae7e('0x55')];}if(_0x1370f1['Trunk']){_0x3e5e44[_0xae7e('0x56')]={'id':_0x1370f1[_0xae7e('0x56')]['id'],'name':_0x1370f1[_0xae7e('0x56')][_0xae7e('0xc')],'active':_0x1370f1[_0xae7e('0x56')][_0xae7e('0x57')],'callerid':_0x1370f1[_0xae7e('0x56')][_0xae7e('0x58')]};}if(_0x1370f1[_0xae7e('0x59')]){_0x3e5e44[_0xae7e('0x59')]={'id':_0x1370f1[_0xae7e('0x59')]['id'],'name':_0x1370f1[_0xae7e('0x59')]['name']};}_0x270cf8['push'](_0x3e5e44);}}_0x1c37f1({'count':_0x270cf8[_0xae7e('0x5a')],'rows':_0x270cf8});});},'UpdateVoiceQueue':function(_0x272a57){return new Promise(function(_0x548f72,_0x36e987){var _0x36d859=_[_0xae7e('0x5b')](_0x47c336[_0xae7e('0x23')],{'id':parseInt(_0x272a57['id'])});var _0x25f084=_[_0xae7e('0x5c')](_0x272a57,['id']);if(_0x36d859){for(var _0x270c8d in _0x25f084){if(typeof _0x25f084[_0x270c8d]!==_0xae7e('0x5d')&&typeof _0x36d859[_0x270c8d]!==_0xae7e('0x5d')){_0x36d859[_0x270c8d]=_0x25f084[_0x270c8d];}}_0x548f72(_0x36d859);}else{_0x36e987();}});},'VoiceChannels':function(_0xdfc039){return new Promise(function(_0x3bd339,_0x40a139){var _0x482ebf=_[_0xae7e('0x5e')](_0x47c336[_0xae7e('0x5f')]);_0x3bd339({'count':_0x482ebf[_0xae7e('0x5a')],'rows':_0x482ebf});});},'VoiceChannelMixMonitor':function(_0x58869a){var _0x20e056=this;return new Promise(function(_0x48154c,_0x50f35c){if(ami[_0xae7e('0x13')]()==![]){return _0x50f35c(_0x20e056[_0xae7e('0x14')](0x1f4,[config[_0xae7e('0x15')]['ip'],config[_0xae7e('0x15')]['username'],_0xae7e('0x17')][_0xae7e('0x18')]('\x20')));}var _0x121e2e=schema(properties['voicechannel'])[_0xae7e('0x3')](_0x58869a);if(_0x121e2e[_0xae7e('0x5a')]>0x0){return _0x50f35c(_0x20e056['error'](0x1f4,_[_0xae7e('0x60')](_0x121e2e,'message')['join'](',\x20')));}var _0x3a0bef=_[_0xae7e('0x5b')](_0x47c336['channels'],{'uniqueid':_0x58869a[_0xae7e('0x61')]});if(_0x3a0bef&&_0x3a0bef[_0xae7e('0x62')]){var _0x3020ce=util['format'](_0xae7e('0x63'),_0x58869a[_0xae7e('0x64')]||_0x58869a['uniqueid'],_0x58869a[_0xae7e('0xa')]||_0xae7e('0x65'));return ami[_0xae7e('0x21')]({'action':_0xae7e('0x66'),'channel':_0x3a0bef[_0xae7e('0x62')],'file':_0x3020ce,'options':_0xae7e('0x67')})[_0xae7e('0x1d')](function(_0xb6b134){var _0x5e9405=_[_0xae7e('0x5b')](_0x3a0bef[_0xae7e('0x68')],{'filename':_0xae7e('0x69')+_0x3020ce['toLowerCase']()});if(_[_0xae7e('0x6a')](_0x5e9405)){_0x3a0bef[_0xae7e('0x68')][_0xae7e('0x6b')]({'filename':_0xae7e('0x69')+_0x3020ce[_0xae7e('0x6c')](),'createdAt':moment()[_0xae7e('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0xb6b134[_0xae7e('0x6d')],'status':_0xae7e('0x6e')});}else{_0x5e9405[_0xae7e('0x6d')]=_0xb6b134[_0xae7e('0x6d')];_0x5e9405[_0xae7e('0x6f')]=_0xae7e('0x6e');}_0x48154c({'code':0xc8,'message':[_0x58869a[_0xae7e('0x61')],_0xae7e('0x70'),_0xb6b134[_0xae7e('0x6d')]]['join']('\x20'),'mixmonitorid':_0xb6b134[_0xae7e('0x6d')]});})[_0xae7e('0x1e')](function(_0x24a974){_0x50f35c(_0x20e056['error'](0x1f5,[_0x58869a[_0xae7e('0x61')],_0x24a974[_0xae7e('0x1f')][_0xae7e('0x6c')]()][_0xae7e('0x18')]('\x20')));});}else{return _0x50f35c(_0x20e056[_0xae7e('0x14')](0x1f5,_0xae7e('0x71')));}});},'VoiceChannelStopMixMonitor':function(_0x57df56){var _0x5cef54=this;return new Promise(function(_0x4c123e,_0x4d2a88){if(ami[_0xae7e('0x13')]()==![]){return _0x4d2a88(_0x5cef54['error'](0x1f4,[config[_0xae7e('0x15')]['ip'],config[_0xae7e('0x15')][_0xae7e('0x16')],_0xae7e('0x17')][_0xae7e('0x18')]('\x20')));}var _0x5c202b=schema(properties[_0xae7e('0x72')])['validate'](_0x57df56);if(_0x5c202b[_0xae7e('0x5a')]>0x0){return _0x4d2a88(_0x5cef54[_0xae7e('0x14')](0x1f4,_[_0xae7e('0x60')](_0x5c202b,_0xae7e('0x1f'))['join'](',\x20')));}var _0x2488d7=_[_0xae7e('0x5b')](_0x47c336[_0xae7e('0x5f')],{'uniqueid':_0x57df56[_0xae7e('0x61')]});if(_0x2488d7){return BPromise[_0xae7e('0x73')]()['then'](function(){if(_0x2488d7[_0xae7e('0x62')]){return ami[_0xae7e('0x21')]({'action':'StopMixMonitor','channel':_0x2488d7[_0xae7e('0x62')],'mixmonitorid':_0x57df56['mixmonitorid']})[_0xae7e('0x1e')](function(_0x54b743){});}})['then'](function(){if(_0x2488d7[_0xae7e('0x74')]){return ami[_0xae7e('0x21')]({'action':'StopMixMonitor','channel':_0x2488d7[_0xae7e('0x74')],'mixmonitorid':_0x57df56[_0xae7e('0x6d')]})[_0xae7e('0x1e')](function(_0x545a3e){});}})[_0xae7e('0x1d')](function(_0x14c9d8){var _0x20486e=_[_0xae7e('0x5b')](_0x2488d7[_0xae7e('0x68')],{'mixmonitorid':_0x57df56[_0xae7e('0x6d')]});if(_0x20486e){_0x20486e['status']=_0xae7e('0x75');}})[_0xae7e('0x1d')](function(){var _0x384bed=util[_0xae7e('0xa')](_0xae7e('0x63'),_0x57df56[_0xae7e('0x64')]||_0x57df56[_0xae7e('0x61')],_0x57df56[_0xae7e('0xa')]||_0xae7e('0x65'));var _0x3abcff=_[_0xae7e('0x5b')](_0x2488d7['monitors'],{'filename':_0xae7e('0x69')+_0x384bed[_0xae7e('0x6c')]()});if(_0x3abcff){_0x3abcff['status']=_0xae7e('0x75');}})[_0xae7e('0x1d')](function(){_0x4c123e({'code':0xc8,'message':[_0x57df56[_0xae7e('0x61')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xae7e('0x1e')](function(_0x1a3ed3){_0x4d2a88(_0x5cef54[_0xae7e('0x14')](0x1f5,[_0x57df56['uniqueid'],_0x1a3ed3[_0xae7e('0x1f')][_0xae7e('0x6c')]()][_0xae7e('0x18')]('\x20')));});}else{return _0x4d2a88(_0x5cef54[_0xae7e('0x14')](0x1f5,_0xae7e('0x71')));}});},'VoiceQueuesChannels':function(_0x47f8ba){return new Promise(function(_0x22161d,_0xdc0c36){var _0x76cc75=_['values'](_0x47c336['queueChannels']);_0x22161d({'count':_0x76cc75[_0xae7e('0x5a')],'rows':_0x76cc75});});},'VoiceQueuesChannel':function(_0x531d4c){var _0x465530=this;return new Promise(function(_0x262f09,_0x561351){var _0x536a90=schema(properties['voicequeuechannel'])[_0xae7e('0x3')](_0x531d4c);if(_0x536a90[_0xae7e('0x5a')]>0x0){return _0x561351(_0x465530[_0xae7e('0x14')](0x1f4,_[_0xae7e('0x60')](_0x536a90,_0xae7e('0x1f'))['join'](',\x20')));}var _0x323af3=_[_0xae7e('0x5b')](_0x47c336['queueChannels'],{'uniqueid':_0x531d4c['uniqueid']});if(_0x323af3){_0x262f09(_0x323af3);}else{return _0x561351(_0x465530[_0xae7e('0x14')](0x1f5,_0xae7e('0x71')));}});},'VoiceQueuesChannelHangup':function(_0x39ec63){var _0x21c2a6=this;return new Promise(function(_0x104c81,_0x5e0e9d){if(ami[_0xae7e('0x13')]()==![]){return _0x5e0e9d(_0x21c2a6[_0xae7e('0x14')](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0xae7e('0x17')]['join']('\x20')));}var _0x24f16a=schema(properties['voicequeuechannelhangup'])[_0xae7e('0x3')](_0x39ec63);if(_0x24f16a[_0xae7e('0x5a')]>0x0){return _0x5e0e9d(_0x21c2a6['error'](0x1f4,_[_0xae7e('0x60')](_0x24f16a,_0xae7e('0x1f'))[_0xae7e('0x18')](',\x20')));}var _0x489f1e=_[_0xae7e('0x5b')](_0x47c336['queueChannels'],{'uniqueid':_0x39ec63['uniqueid']});if(_0x489f1e&&_0x489f1e[_0xae7e('0x62')]){return ami[_0xae7e('0x21')]({'action':_0xae7e('0x76'),'channel':_0x489f1e['channel']})[_0xae7e('0x1d')](function(_0x2579a4){_0x104c81({'code':0xc8,'message':[_0x39ec63[_0xae7e('0x61')],_0x2579a4[_0xae7e('0x1f')][_0xae7e('0x6c')]()][_0xae7e('0x18')]('\x20')});})['catch'](function(_0x263625){_0x5e0e9d(_0x21c2a6[_0xae7e('0x14')](0x1f5,[_0x39ec63['uniqueid'],_0x263625[_0xae7e('0x1f')]['toLowerCase']()][_0xae7e('0x18')]('\x20')));});}else{return _0x5e0e9d(_0x21c2a6['error'](0x1f5,_0xae7e('0x71')));}});},'VoiceQueuesChannelRedirect':function(_0x58a7ee){var _0x54d2d6=this;return new Promise(function(_0x14736c,_0x1fd8da){if(ami[_0xae7e('0x13')]()==![]){return _0x1fd8da(_0x54d2d6[_0xae7e('0x14')](0x1f4,[config[_0xae7e('0x15')]['ip'],config[_0xae7e('0x15')][_0xae7e('0x16')],_0xae7e('0x17')]['join']('\x20')));}var _0xe5ffa4=schema(properties[_0xae7e('0x77')])[_0xae7e('0x3')](_0x58a7ee);if(_0xe5ffa4[_0xae7e('0x5a')]>0x0){return _0x1fd8da(_0x54d2d6[_0xae7e('0x14')](0x1f4,_[_0xae7e('0x60')](_0xe5ffa4,'message')[_0xae7e('0x18')](',\x20')));}var _0x31e1dc=_[_0xae7e('0x5b')](_0x47c336[_0xae7e('0x78')],{'uniqueid':_0x58a7ee[_0xae7e('0x61')]});if(_0x31e1dc&&_0x31e1dc[_0xae7e('0x62')]){return ami[_0xae7e('0x21')]({'action':_0xae7e('0x79'),'channel':_0x31e1dc['channel'],'exten':_0x58a7ee[_0xae7e('0x7a')],'context':_0x58a7ee['context']||_0x31e1dc[_0xae7e('0x7b')],'priority':0x1})[_0xae7e('0x1d')](function(_0x4a4c71){_0x14736c({'code':0xc8,'message':[_0x58a7ee[_0xae7e('0x61')],_0x4a4c71['message']['toLowerCase']()][_0xae7e('0x18')]('\x20')});})[_0xae7e('0x1e')](function(_0x140ae3){_0x1fd8da(_0x54d2d6[_0xae7e('0x14')](0x1f5,[_0x58a7ee['uniqueid'],_0x140ae3[_0xae7e('0x1f')]['toLowerCase']()]['join']('\x20')));});}else{return _0x1fd8da(_0x54d2d6[_0xae7e('0x14')](0x1f5,_0xae7e('0x71')));}});},'Agents':function(_0x20b11a){return new Promise(function(_0x161c34,_0x1523f3){var _0xb9bcf2=_['values'](_0x47c336[_0xae7e('0xf')]);_0x161c34({'count':_0xb9bcf2[_0xae7e('0x5a')],'rows':_0xb9bcf2});});},'Telephones':function(_0x3e3f55){return new Promise(function(_0x4e930d,_0x5990e3){var _0x349161=_[_0xae7e('0x5e')](_0x47c336['telephones']);_0x4e930d({'count':_0x349161[_0xae7e('0x5a')],'rows':_0x349161});});},'Trunks':function(_0x1d4d67){return new Promise(function(_0xe916c9,_0x4fd92a){var _0x1478c2=_[_0xae7e('0x5e')](_0x47c336['trunks']);_0xe916c9({'count':_0x1478c2['length'],'rows':_0x1478c2});});},'OutboundChannels':function(_0x1d6514){return new Promise(function(_0x4949b6,_0xc8b1ee){var _0x259983=_[_0xae7e('0x5e')](_0x47c336['outboundChannels']);_0x4949b6({'count':_0x259983['length'],'rows':_0x259983});});},'Outbound':function(_0x361978){return new Promise(function(_0x29b2c9,_0x410751){_0x29b2c9(_0x47c336[_0xae7e('0x7c')]);});},'Campaigns':function(_0x5b8226){return new Promise(function(_0x321a38,_0x442615){var _0x374264=_[_0xae7e('0x5e')](_0x47c336['campaigns']);_0x321a38({'count':_0x374264[_0xae7e('0x5a')],'rows':_0x374264});});},'VoiceQueuesPreview':function(_0x19f5f5){var _0x172c97=this;return new Promise(function(_0x123832,_0x4a8dc2){_0x18f66d['run'](_0x19f5f5['id'])[_0xae7e('0x1d')](function(_0x2f35c1){_0x123832({'code':0xc8,'message':_0x2f35c1[_0xae7e('0x1f')]});})[_0xae7e('0x1e')](function(_0x533b6d){_0x4a8dc2(_0x172c97[_0xae7e('0x14')](0x1f4,_0x533b6d['message']));});});},'EventManager':function(_0x3277ea){var _0x30592b=this;return new Promise(function(_0x2ba5ef,_0x2547ce){if(!_0x3277ea[_0xae7e('0x7d')]){return _0x2547ce(_0x30592b[_0xae7e('0x14')](0x1f4,_0xae7e('0x7e')));}ami[_0xae7e('0x7f')]('custom:'+_0x3277ea[_0xae7e('0x7d')],_0x3277ea['message']);_0x2ba5ef({'code':0xc8,'message':_0x3277ea});});},'FaxAccounts':function(_0x28a2a1){return new Promise(function(_0x5d1f87,_0x405a6f){var _0x1d8433=_[_0xae7e('0x5e')](_0x47c336[_0xae7e('0x80')]);_0x5d1f87({'count':_0x1d8433[_0xae7e('0x5a')],'rows':_0x1d8433});});},'SendFax':function(_0x27d52e){var _0x38adcf=this;return new Promise(function(_0x3806db,_0x31ed61){_0x4d17af[_0xae7e('0x81')](_0x27d52e)[_0xae7e('0x1d')](function(_0x3498e5){_0x3806db({'code':0xc8,'message':_0x3498e5[_0xae7e('0x1f')]});})[_0xae7e('0x1e')](function(_0x13517c){_0x31ed61(_0x38adcf[_0xae7e('0x14')](0x1f4,_0x13517c[_0xae7e('0x1f')]));});});},'CheckAfterSend':function(_0x20293c){var _0x24f8a3=this;return new Promise(function(_0x29fa75,_0xb25059){_0x4d17af[_0xae7e('0x82')](_0x20293c)[_0xae7e('0x1d')](function(_0x12c046){_0x29fa75({'code':0xc8,'message':_0x12c046[_0xae7e('0x1f')]});})[_0xae7e('0x1e')](function(_0x15bd33){_0xb25059(_0x24f8a3[_0xae7e('0x14')](0x1f4,_0x15bd33[_0xae7e('0x1f')]));});});}};var _0x47e3f0=jayson[_0xae7e('0x83')](_0x6f23de)[_0xae7e('0x84')]();_0x47e3f0['on'](_0xae7e('0x14'),function(_0x207f5d){return _0x5874f1(_0x207f5d);});_0x47e3f0[_0xae7e('0x9')](0x232a,'127.0.0.1',function(){console[_0xae7e('0x85')](_0xae7e('0x86'),0x232a);return _0x544e02(_0xae7e('0x87')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 0abd06b..8ca153f 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 _0xa23d=['ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','emit','exec','data1','data2','xmd-contactid','data3','split','phone','$or','map','routeId','destcalleridnum','firstName','lastName','mobile','fax','ListId','union','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','isNil','calleridnum','calleridname','','Unknown','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','action','merge','lodash','bluebird'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xa23d,0x6a));var _0xda23=function(_0x1c197e,_0x2dd3a7){_0x1c197e=_0x1c197e-0x0;var _0x5e31b7=_0xa23d[_0x1c197e];return _0x5e31b7;};'use strict';var _=require(_0xda23('0x0'));var BPromise=require(_0xda23('0x1'));var Redis=require(_0xda23('0x2'));var util=require(_0xda23('0x3'));var config=require('../../../../config/environment');var logger=require(_0xda23('0x4'))(_0xda23('0x5'));var cmContactRpc=require(_0xda23('0x6'));config[_0xda23('0x7')]=_['defaults'](config[_0xda23('0x7')],{'host':_0xda23('0x8'),'port':0x18eb});var io=require(_0xda23('0x9'))(new Redis(config[_0xda23('0x7')]));function emit(_0x91015e,_0xbfd4ce,_0x24bccb,_0x1d275a,_0x4075f4){logger[_0xda23('0xa')]('[CM][%s][%s]',_0x91015e,_0xbfd4ce['id'],_0x24bccb,_0x1d275a,JSON['stringify'](_0x4075f4));io['to'](_0x24bccb)[_0xda23('0xb')](_0x1d275a,_0x4075f4);}exports[_0xda23('0xc')]=function(_0x4a5570,_0x4ca7d6,_0x433e0e,_0x434e91){var _0x51037a,_0x1c2521;var _0x1aebc2={};var _0x3ff838=Number(_0x433e0e[_0xda23('0xd')]);var _0x3cd641=_0x433e0e[_0xda23('0xe')]?Boolean(Number(_0x433e0e[_0xda23('0xe')])):![];var _0x4ca40c;if(_0x434e91[_0xda23('0xf')]){_0x1aebc2['id']=_0x434e91[_0xda23('0xf')];}if(!_0x1aebc2['id']){_0x1aebc2['ListId']=_0x3ff838;_0x4ca40c=_0x433e0e['data3']&&_0x433e0e[_0xda23('0x10')]!=='0'?_0x433e0e[_0xda23('0x10')][_0xda23('0x11')](','):[_0xda23('0x12')];_0x1aebc2[_0xda23('0x13')]=_[_0xda23('0x14')](_0x4ca40c,function(_0x488739){var _0x3089b2={};_0x3089b2[_0x488739]=_0x434e91[_0xda23('0x15')]?_0x434e91[_0xda23('0x16')]:_0x434e91['calleridnum'];return _0x3089b2;});}var _0x37ab8f=['id',_0xda23('0x17'),_0xda23('0x18'),_0xda23('0x12'),_0xda23('0x19'),_0xda23('0x1a'),_0xda23('0x1b'),'createdAt','scheduledAt','updatedAt'];var _0x1a49f9=_[_0xda23('0x1c')](_0x37ab8f,_0x4ca40c);BPromise['resolve']()['then'](cmContactRpc[_0xda23('0x1d')]({'attributes':_0x1a49f9,'where':_0x1aebc2}))[_0xda23('0x1e')](function(_0x2e355f){_0x1c2521=_0x2e355f;if(!_[_0xda23('0x1f')](_0x1c2521)){if(_0x1c2521[_0xda23('0x20')]===0x1){_0x51037a=_0x1c2521[0x0];logger[_0xda23('0xa')](_0xda23('0x21'),_0x434e91[_0xda23('0x22')],_0x4ca7d6['id'],_0x51037a['id']);}else{logger[_0xda23('0xa')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x434e91[_0xda23('0x22')],_0x4ca7d6['id'],_[_0xda23('0x14')](_0x1c2521,'id')[_0xda23('0x23')](','));}return;}else{logger['info'](_0xda23('0x24'),_0x434e91[_0xda23('0x22')],_0x4ca7d6['id']);var _0x3e3378={'ListId':_0x3ff838};var _0x55294a=_0x433e0e[_0xda23('0x25')]&&_0x433e0e[_0xda23('0x25')]!=='0'?_0x433e0e[_0xda23('0x25')]:'phone';if(_0x3cd641){logger[_0xda23('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x434e91['uniqueid'],_0x4ca7d6['id']);_0x3e3378[_0x55294a]=_[_0xda23('0x26')](_0x434e91[_0xda23('0x15')])?_0x434e91[_0xda23('0x27')]:_0x434e91[_0xda23('0x16')];if(_['isNil'](_0x434e91[_0xda23('0x15')])){_0x3e3378['firstName']=_0x434e91[_0xda23('0x28')]&&_0x434e91['calleridname']!==_0xda23('0x29')?_0x434e91[_0xda23('0x28')]:_0xda23('0x2a');}else{_0x3e3378['firstName']=_0x434e91[_0xda23('0x2b')]&&_0x434e91[_0xda23('0x2b')]!==''?_0x434e91[_0xda23('0x2b')]:'Unknown';}return BPromise[_0xda23('0x2c')]()['then'](cmContactRpc[_0xda23('0x2d')](_0x3e3378))[_0xda23('0x1e')](function(_0x360a8d){_0x51037a=_0x360a8d;_0x1c2521[_0xda23('0x2e')](_0x360a8d);if(_0x51037a){logger['info'](_0xda23('0x2f'),_0x434e91[_0xda23('0x22')],_0x4ca7d6['id'],_0x51037a['id']);}return;});}else{logger[_0xda23('0xa')](_0xda23('0x30'),_0x434e91[_0xda23('0x22')],_0x4ca7d6['id']);_0x3e3378[_0x55294a]=_['isNil'](_0x434e91[_0xda23('0x15')])?_0x434e91[_0xda23('0x27')]:_0x434e91[_0xda23('0x16')];if(_[_0xda23('0x26')](_0x434e91[_0xda23('0x15')])){_0x3e3378[_0xda23('0x17')]=_0x434e91[_0xda23('0x28')]&&_0x434e91[_0xda23('0x28')]!==_0xda23('0x29')?_0x434e91['calleridname']:_0xda23('0x2a');}else{_0x3e3378['firstName']=_0x434e91[_0xda23('0x2b')]&&_0x434e91[_0xda23('0x2b')]!==''?_0x434e91[_0xda23('0x2b')]:_0xda23('0x2a');}_0x51037a=_0x3e3378;_0x1c2521[_0xda23('0x2e')](_0x3e3378);return;}}})[_0xda23('0x1e')](function(){if(_0x4a5570){emit(_0x434e91[_0xda23('0x22')],_0x4ca7d6,util[_0xda23('0x31')](_0xda23('0x32'),_0x4a5570[_0xda23('0x33')]),util[_0xda23('0x31')]('trigger:%s',_0x433e0e[_0xda23('0x34')]['toLowerCase']()),{'evt':_[_0xda23('0x35')](_0x434e91,{'autoCreate':_0x3cd641}),'contact':_0x51037a===undefined?{}:_0x51037a,'contacts':_0x1c2521[_0xda23('0x20')]===0x0?undefined:_0x1c2521});}});}; \ No newline at end of file +var _0xba18=['calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','lastName','mobile','fax','scheduledAt','updatedAt','then','getContacts','isEmpty','length','uniqueid','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridnum','firstName'];(function(_0xe7bbe1,_0x48a8d8){var _0x15accf=function(_0x5c390d){while(--_0x5c390d){_0xe7bbe1['push'](_0xe7bbe1['shift']());}};_0x15accf(++_0x48a8d8);}(_0xba18,0x79));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ba1('0x0'));var BPromise=require(_0x8ba1('0x1'));var Redis=require(_0x8ba1('0x2'));var util=require(_0x8ba1('0x3'));var config=require(_0x8ba1('0x4'));var logger=require(_0x8ba1('0x5'))('trigger');var cmContactRpc=require(_0x8ba1('0x6'));config[_0x8ba1('0x7')]=_[_0x8ba1('0x8')](config[_0x8ba1('0x7')],{'host':_0x8ba1('0x9'),'port':0x18eb});var io=require(_0x8ba1('0xa'))(new Redis(config['redis']));function emit(_0x4d96bc,_0x594730,_0x117a04,_0x2d92f5,_0x4d1e1e){logger[_0x8ba1('0xb')](_0x8ba1('0xc'),_0x4d96bc,_0x594730['id'],_0x117a04,_0x2d92f5,JSON[_0x8ba1('0xd')](_0x4d1e1e));io['to'](_0x117a04)[_0x8ba1('0xe')](_0x2d92f5,_0x4d1e1e);}exports[_0x8ba1('0xf')]=function(_0x2851cd,_0x46682a,_0x2ddfe8,_0x1fb04e){var _0x1f1512,_0x5d1b36;var _0x44b714={};var _0x544075=Number(_0x2ddfe8['data1']);var _0x1e0d07=_0x2ddfe8[_0x8ba1('0x10')]?Boolean(Number(_0x2ddfe8[_0x8ba1('0x10')])):![];var _0x3ec35f;if(_0x1fb04e[_0x8ba1('0x11')]){_0x44b714['id']=_0x1fb04e[_0x8ba1('0x11')];}if(!_0x44b714['id']){_0x44b714[_0x8ba1('0x12')]=_0x544075;_0x3ec35f=_0x2ddfe8[_0x8ba1('0x13')]&&_0x2ddfe8[_0x8ba1('0x13')]!=='0'?_0x2ddfe8[_0x8ba1('0x13')][_0x8ba1('0x14')](','):[_0x8ba1('0x15')];_0x44b714['$or']=_[_0x8ba1('0x16')](_0x3ec35f,function(_0x2f0b69){var _0x2857ce={};_0x2857ce[_0x2f0b69]=_0x1fb04e[_0x8ba1('0x17')]?_0x1fb04e[_0x8ba1('0x18')]:_0x1fb04e['calleridnum'];return _0x2857ce;});}var _0x4eaba9=['id','firstName',_0x8ba1('0x19'),_0x8ba1('0x15'),_0x8ba1('0x1a'),_0x8ba1('0x1b'),_0x8ba1('0x12'),'createdAt',_0x8ba1('0x1c'),_0x8ba1('0x1d')];var _0x27e2cb=_['union'](_0x4eaba9,_0x3ec35f);BPromise['resolve']()[_0x8ba1('0x1e')](cmContactRpc[_0x8ba1('0x1f')]({'attributes':_0x27e2cb,'where':_0x44b714}))['then'](function(_0x273444){_0x5d1b36=_0x273444;if(!_[_0x8ba1('0x20')](_0x5d1b36)){if(_0x5d1b36[_0x8ba1('0x21')]===0x1){_0x1f1512=_0x5d1b36[0x0];logger[_0x8ba1('0xb')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x1fb04e['uniqueid'],_0x46682a['id'],_0x1f1512['id']);}else{logger[_0x8ba1('0xb')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x1fb04e[_0x8ba1('0x22')],_0x46682a['id'],_[_0x8ba1('0x16')](_0x5d1b36,'id')['join'](','));}return;}else{logger[_0x8ba1('0xb')](_0x8ba1('0x23'),_0x1fb04e[_0x8ba1('0x22')],_0x46682a['id']);var _0x1cd57b={'ListId':_0x544075};var _0x1e621e=_0x2ddfe8[_0x8ba1('0x24')]&&_0x2ddfe8[_0x8ba1('0x24')]!=='0'?_0x2ddfe8[_0x8ba1('0x24')]:_0x8ba1('0x15');if(_0x1e0d07){logger[_0x8ba1('0xb')](_0x8ba1('0x25'),_0x1fb04e['uniqueid'],_0x46682a['id']);_0x1cd57b[_0x1e621e]=_[_0x8ba1('0x26')](_0x1fb04e['routeId'])?_0x1fb04e[_0x8ba1('0x27')]:_0x1fb04e['destcalleridnum'];if(_['isNil'](_0x1fb04e['routeId'])){_0x1cd57b[_0x8ba1('0x28')]=_0x1fb04e[_0x8ba1('0x29')]&&_0x1fb04e[_0x8ba1('0x29')]!==_0x8ba1('0x2a')?_0x1fb04e[_0x8ba1('0x29')]:'Unknown';}else{_0x1cd57b[_0x8ba1('0x28')]=_0x1fb04e[_0x8ba1('0x2b')]&&_0x1fb04e[_0x8ba1('0x2b')]!==_0x8ba1('0x2a')?_0x1fb04e[_0x8ba1('0x2b')]:_0x8ba1('0x2c');}return BPromise['resolve']()[_0x8ba1('0x1e')](cmContactRpc[_0x8ba1('0x2d')](_0x1cd57b))['then'](function(_0x9a9a82){_0x1f1512=_0x9a9a82;_0x5d1b36[_0x8ba1('0x2e')](_0x9a9a82);if(_0x1f1512){logger[_0x8ba1('0xb')](_0x8ba1('0x2f'),_0x1fb04e[_0x8ba1('0x22')],_0x46682a['id'],_0x1f1512['id']);}return;});}else{logger[_0x8ba1('0xb')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x1fb04e[_0x8ba1('0x22')],_0x46682a['id']);_0x1cd57b[_0x1e621e]=_['isNil'](_0x1fb04e[_0x8ba1('0x17')])?_0x1fb04e[_0x8ba1('0x27')]:_0x1fb04e[_0x8ba1('0x18')];if(_[_0x8ba1('0x26')](_0x1fb04e['routeId'])){_0x1cd57b[_0x8ba1('0x28')]=_0x1fb04e[_0x8ba1('0x29')]&&_0x1fb04e[_0x8ba1('0x29')]!==_0x8ba1('0x2a')?_0x1fb04e['calleridname']:_0x8ba1('0x2c');}else{_0x1cd57b[_0x8ba1('0x28')]=_0x1fb04e['destcalleridname']&&_0x1fb04e[_0x8ba1('0x2b')]!==_0x8ba1('0x2a')?_0x1fb04e[_0x8ba1('0x2b')]:'Unknown';}_0x1f1512=_0x1cd57b;_0x5d1b36[_0x8ba1('0x2e')](_0x1cd57b);return;}}})['then'](function(){if(_0x2851cd){emit(_0x1fb04e[_0x8ba1('0x22')],_0x46682a,util[_0x8ba1('0x30')](_0x8ba1('0x31'),_0x2851cd['name']),util[_0x8ba1('0x30')](_0x8ba1('0x32'),_0x2ddfe8[_0x8ba1('0x33')][_0x8ba1('0x34')]()),{'evt':_[_0x8ba1('0x35')](_0x1fb04e,{'autoCreate':_0x1e0d07}),'contact':_0x1f1512===undefined?{}:_0x1f1512,'contacts':_0x5d1b36['length']===0x0?undefined:_0x5d1b36});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 7f9bd1c..4bff486 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 _0x5afb=['user:%s','name','trigger:%s:%s','merge','jscripty','trigger:%s','exec','integration','queue','routeId','urlforward','script','parse','query','replace','every','channel','AnyConditions','some','checkConditions','account','chat','ChatWebsiteId','operator','upperFirst','AccountId','interaction','event','value','agent','membername','lastevent','exports','util','lodash','mustache','ioredis','./urlforward','./integration','./script','../../../config/logger','trigger','defaults','redis','localhost','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','emit','stringify','prototype','checkTriggers','interface','hasOwnProperty','status','checkTrigger','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','popup','TemplateId','html','render','data2','template\x20not\x20found','url','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','data6','winApplication','winArguments','format'];(function(_0x2aabfd,_0x168198){var _0x4f2305=function(_0x3f6ba9){while(--_0x3f6ba9){_0x2aabfd['push'](_0x2aabfd['shift']());}};_0x4f2305(++_0x168198);}(_0x5afb,0x113));var _0xb5af=function(_0x2d5887,_0xace828){_0x2d5887=_0x2d5887-0x0;var _0x257084=_0x5afb[_0x2d5887];return _0x257084;};'use strict';var util=require(_0xb5af('0x0'));var _=require(_0xb5af('0x1'));var url=require('url');var Mustache=require(_0xb5af('0x2'));var Redis=require(_0xb5af('0x3'));var urlforward=require(_0xb5af('0x4'));var integration=require(_0xb5af('0x5'));var cmContact=require('./cmContact');var script=require(_0xb5af('0x6'));var config=require('../../../config/environment');var logger=require(_0xb5af('0x7'))(_0xb5af('0x8'));var ami=require('../ami');config['redis']=_[_0xb5af('0x9')](config[_0xb5af('0xa')],{'host':_0xb5af('0xb'),'port':0x18eb});var io=require(_0xb5af('0xc'))(new Redis(config[_0xb5af('0xa')]));var operators={'equals':function(_0x45792d,_0x256832){return _0x45792d==_0x256832;},'not_equals':function(_0x4349a6,_0xf08d69){return _0x4349a6!=_0xf08d69;}};var barAndWebActions=['popup','url',_0xb5af('0xd')];function Trigger(_0x9fc4fa){this[_0xb5af('0xe')]=_0x9fc4fa[_0xb5af('0xe')];this['agents']=_0x9fc4fa[_0xb5af('0xf')];this['voiceQueues']=_0x9fc4fa[_0xb5af('0x10')];this[_0xb5af('0x11')]=_0x9fc4fa[_0xb5af('0x11')];this[_0xb5af('0x12')]=_0x9fc4fa[_0xb5af('0x12')];this[_0xb5af('0x13')]=_0x9fc4fa[_0xb5af('0x13')];this[_0xb5af('0x14')]=_0x9fc4fa[_0xb5af('0x14')];this[_0xb5af('0x15')]=_0x9fc4fa[_0xb5af('0x15')];this['sugarcrmAccounts']=_0x9fc4fa[_0xb5af('0x16')];this[_0xb5af('0x17')]=_0x9fc4fa[_0xb5af('0x17')];this[_0xb5af('0x18')]=_0x9fc4fa[_0xb5af('0x18')];this['vtigerAccounts']=_0x9fc4fa['vtigerAccounts'];this[_0xb5af('0x19')]=_0x9fc4fa[_0xb5af('0x19')];this[_0xb5af('0x1a')]=_0x9fc4fa[_0xb5af('0x1a')];this[_0xb5af('0x1b')]=_0x9fc4fa[_0xb5af('0x1b')];this[_0xb5af('0x1c')]={'zendesk':this[_0xb5af('0x13')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xb5af('0x14')],'sugarcrm':this[_0xb5af('0x16')],'zoho':this['zohoAccounts'],'desk':this[_0xb5af('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xb5af('0x1a')],'freshsales':this[_0xb5af('0x1b')],'servicenow':this[_0xb5af('0x19')]};ami['on'](_0xb5af('0x1d'),this[_0xb5af('0x1e')][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x20'),this['syncCustomEvent'][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x21'),this['syncCustomEvent'][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x22'),this[_0xb5af('0x1e')]['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0xb5af('0x1e')][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x23'),this[_0xb5af('0x1e')][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x24'),this[_0xb5af('0x1e')][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x25'),this[_0xb5af('0x1e')]['bind'](this));ami['on'](_0xb5af('0x26'),this[_0xb5af('0x1e')][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0xb5af('0x28'),this['syncCustomEvent']['bind'](this));ami['on'](_0xb5af('0x29'),this['syncCustomEvent'][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x2a'),this[_0xb5af('0x2b')][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x2c'),this[_0xb5af('0x2b')][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x2d'),this[_0xb5af('0x2b')][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x2e'),this[_0xb5af('0x1e')][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x2f'),this[_0xb5af('0x1e')]['bind'](this));ami['on'](_0xb5af('0x30'),this[_0xb5af('0x1e')][_0xb5af('0x1f')](this));ami['on']('custom:outgoingmessage',this[_0xb5af('0x1e')][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x31'),this[_0xb5af('0x1e')][_0xb5af('0x1f')](this));ami['on'](_0xb5af('0x32'),this[_0xb5af('0x1e')][_0xb5af('0x1f')](this));}Trigger['prototype'][_0xb5af('0x33')]=function(_0x21a1a7,_0x17b491,_0x44282f){logger['info'](_0x21a1a7,_0x17b491,JSON[_0xb5af('0x34')](_0x44282f));io['to'](_0x21a1a7)[_0xb5af('0x33')](_0x17b491,_0x44282f);};Trigger[_0xb5af('0x35')][_0xb5af('0x1e')]=function(_0x569f19){var _0x1e6f65=_['clone'](_0x569f19);this[_0xb5af('0x36')](_0x1e6f65);};Trigger[_0xb5af('0x35')][_0xb5af('0x2b')]=function(_0x3ff29f){if(this[_0xb5af('0xf')][_0x3ff29f[_0xb5af('0x37')]]){this[_0xb5af('0x1e')](_0x3ff29f);}};Trigger['prototype'][_0xb5af('0x36')]=function(_0x2f8ad9){var _0x429880;for(var _0x5b0f99 in this[_0xb5af('0xe')]){if(this['triggers'][_0xb5af('0x38')](_0x5b0f99)){if(this['triggers'][_0x5b0f99][_0xb5af('0x39')]){_0x429880=this[_0xb5af('0x3a')](this['triggers'][_0x5b0f99],_0x2f8ad9);if(_0x429880){_['merge'](_0x2f8ad9,_0x2f8ad9[_0xb5af('0x3b')]);for(var _0xe72856=0x0,_0x1c30b1,_0x385137,_0x86c905;_0xe728560x0){_0x2b4af9=_[_0x9268('0x2c')](_0x2c0b3c,_0x57d89d);}return _0x2b4af9;}function getCustomFields(_0x1fbe48,_0x2f204e){var _0x78ec5a=[];var _0x481549={'custom_fields':{}};if(_0x1fbe48[_0x9268('0x2d')]>0x0){_[_0x9268('0x2e')](_0x1fbe48,function(_0x5923dd){if(_[_0x9268('0x2f')](['string',_0x9268('0x30')],_0x5923dd[_0x9268('0x31')])&&_0x5923dd[_0x9268('0x32')]&&!_0x5923dd[_0x9268('0x33')]){_0x481549[_0x5923dd[_0x9268('0x32')]['toLowerCase']()]=_0x5923dd[_0x9268('0x34')][_0x9268('0x24')]();}else if(_['includes'](['string','picklist'],_0x5923dd[_0x9268('0x31')])&&_0x5923dd[_0x9268('0x35')]&&_0x5923dd[_0x9268('0x33')]){_0x481549[_0x9268('0x36')][_0x5923dd[_0x9268('0x35')]]=_0x5923dd[_0x9268('0x34')][_0x9268('0x24')]();}else if(_0x5923dd[_0x9268('0x31')]===_0x9268('0x37')&&_0x5923dd[_0x9268('0x38')]&&_0x5923dd[_0x9268('0x35')]&&_0x5923dd[_0x9268('0x33')]){_0x2f204e[_0x5923dd[_0x9268('0x38')]]&&(_0x481549[_0x9268('0x36')][_0x5923dd['idField']]=_0x2f204e[_0x5923dd['variableName']][_0x9268('0x24')]());}else if(_0x5923dd[_0x9268('0x31')]===_0x9268('0x39')&&_0x5923dd[_0x9268('0x3a')]&&_0x5923dd[_0x9268('0x3a')][_0x9268('0x3b')]&&_0x5923dd['idField']&&_0x5923dd[_0x9268('0x33')]){_0x2f204e[_0x5923dd[_0x9268('0x3a')]['name'][_0x9268('0x3c')]()]&&(_0x481549[_0x9268('0x36')][_0x5923dd[_0x9268('0x35')]]=_0x2f204e[_0x5923dd[_0x9268('0x3a')][_0x9268('0x3b')][_0x9268('0x3c')]()][_0x9268('0x24')]());}});}if(_0x481549[_0x9268('0x3d')]){_0x481549[_0x9268('0x3d')]=Number(_0x481549[_0x9268('0x3d')]);}return _0x481549;}function getTicket(_0x180612,_0x2196f3,_0x155ae3,_0x2e9776,_0x4f03ed){logger[_0x9268('0xe')](_0x9268('0x3e'));var _0x400a75=_['merge']({'subject':intUtil[_0x9268('0x3f')](_0x2e9776[_0x9268('0x40')],_0x4f03ed,'\x20'),'type':_0x9268('0x41'),'status':_0x9268('0x42'),'labels':[_0x9268('0x43'),_0x9268('0x44'),_0x9268('0x45')][_0x9268('0x46')](getTags(_0x2e9776[_0x9268('0x47')],_0x9268('0x3b'))),'description':intUtil['getString'](_0x2e9776[_0x9268('0x48')],_0x4f03ed,'\x0a'),'_links':{'assigned_user':{'href':util[_0x9268('0x10')](_0x9268('0x49'),_0x2196f3['id']),'class':_0x9268('0x4a')}},'message':{'direction':'in','body':intUtil[_0x9268('0x3f')](_0x2e9776[_0x9268('0x48')],_0x4f03ed,'\x0a')}},getCustomFields(_0x2e9776[_0x9268('0x4b')],_0x4f03ed));return request({'uri':util['format'](_0x9268('0x4c'),_0x180612['remoteUri'],_0x155ae3['id']),'method':'POST','body':_0x400a75});}exports[_0x9268('0x4d')]=function(_0x421e83,_0x422f2f,_0x1c7ea1,_0x63df1e,_0x485ff0,_0x4b8e06){var _0x7ae435,_0x3b67bd;_0x4b8e06['remoteUri']=intUtil[_0x9268('0x4e')](_0x4b8e06['remoteUri']);_0x4b8e06[_0x9268('0x4f')]=intUtil[_0x9268('0x4e')](_0x4b8e06[_0x9268('0x4f')]);if(_0x485ff0&&_0x485ff0['monitor_format']){logger[_0x9268('0xe')](_0x9268('0x50'),_0x9268('0x51'));_0x422f2f[_0x9268('0x52')]=util[_0x9268('0x10')](_0x9268('0x53'),_0x4b8e06[_0x9268('0x4f')],_0x422f2f[_0x9268('0x54')],md5(_0x422f2f[_0x9268('0x54')]));}else{_0x422f2f[_0x9268('0x52')]='';}headers['Authorization']=getAuth(_0x4b8e06);return getUser(_0x4b8e06,_0x63df1e[_0x9268('0x55')])[_0x9268('0x16')](function(_0x583442){_0x7ae435=_0x583442;logger[_0x9268('0xe')](_0x9268('0x56'),_0x7ae435['id']);return getEndUser(_0x4b8e06,_0x422f2f['calleridname'],_0x422f2f[_0x9268('0x57')]);})[_0x9268('0x16')](function(_0x5795af){_0x3b67bd=_0x5795af;logger[_0x9268('0xe')](_0x9268('0x58'),_0x3b67bd['id']);return getTicket(_0x4b8e06,_0x7ae435,_0x3b67bd,_0x1c7ea1,_0x422f2f);})[_0x9268('0x16')](function(_0x433a60){if(_0x433a60){logger[_0x9268('0xe')](_0x9268('0x59'));logger[_0x9268('0xe')](_0x9268('0x5a'),_0x433a60['id']);switch(_0x4b8e06[_0x9268('0x31')]){case'integrationTab':logger[_0x9268('0xe')](_0x9268('0x50'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x9268('0x5b'),_0x63df1e[_0x9268('0x3b')]),_0x9268('0x5c'),{'recordId':_0x433a60['id']});break;case'newTab':logger[_0x9268('0xe')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9268('0x10')](_0x9268('0x5b'),_0x63df1e[_0x9268('0x3b')]),_0x9268('0x5d'),{'uri':util['format'](_0x9268('0x5e'),_0x433a60['id'])});break;default:logger['error']('[QUEUE]',_0x9268('0x5f'));}}})[_0x9268('0x60')](function(_0x5cc7c8){console[_0x9268('0x61')](_0x5cc7c8);logger[_0x9268('0x61')]('[QUEUE]',JSON[_0x9268('0x1c')](_0x5cc7c8));});};exports[_0x9268('0x62')]=function(_0xb10da3,_0x29d1fc,_0x1c63f0,_0xbd16c1,_0x46b46d,_0x2630a4,_0x2fdd24){var _0x9e0937,_0x4e5a47;_0x2630a4['remoteUri']=intUtil['stripTrailingSlash'](_0x2630a4['remoteUri']);_0x2630a4[_0x9268('0x4f')]=intUtil[_0x9268('0x4e')](_0x2630a4[_0x9268('0x4f')]);if(_0x2fdd24&&_0x2fdd24[_0x9268('0x63')]&&_0x2fdd24[_0x9268('0x63')]!==_0x9268('0x64')){logger['info'](_0x9268('0x65'),_0x9268('0x51'));_0x29d1fc[_0x9268('0x52')]=util[_0x9268('0x10')](_0x9268('0x53'),_0x2630a4['serverUrl'],_0x29d1fc[_0x9268('0x54')],md5(_0x29d1fc[_0x9268('0x54')]));}headers['Authorization']=getAuth(_0x2630a4);return getUser(_0x2630a4,_0xbd16c1[_0x9268('0x55')])[_0x9268('0x16')](function(_0x1f8688){_0x9e0937=_0x1f8688;logger[_0x9268('0xe')](_0x9268('0x56'),_0x9e0937['id']);return getEndUser(_0x2630a4,_0x29d1fc[_0x9268('0x66')],_0x29d1fc[_0x9268('0x67')]);})['then'](function(_0x53c72b){_0x4e5a47=_0x53c72b;logger[_0x9268('0xe')](_0x9268('0x58'),_0x4e5a47['id']);return getTicket(_0x2630a4,_0x9e0937,_0x4e5a47,_0x1c63f0,_0x29d1fc);})['then'](function(_0x3b347d){if(_0x3b347d){logger[_0x9268('0xe')](_0x9268('0x59'));logger[_0x9268('0xe')]('The\x20Ticket\x20ID\x20is:',_0x3b347d['id']);switch(_0x2630a4[_0x9268('0x31')]){case _0x9268('0x68'):logger[_0x9268('0xe')](_0x9268('0x50'),_0x9268('0x69'));emit(util[_0x9268('0x10')](_0x9268('0x5b'),_0xbd16c1[_0x9268('0x3b')]),_0x9268('0x5c'),{'recordId':_0x3b347d['id']});break;case _0x9268('0x6a'):logger[_0x9268('0xe')](_0x9268('0x50'),_0x9268('0x6b'));emit(util[_0x9268('0x10')](_0x9268('0x5b'),_0xbd16c1['name']),_0x9268('0x5d'),{'uri':util[_0x9268('0x10')](_0x9268('0x6c'),_0x2630a4[_0x9268('0x12')],_0x3b347d['id'])});break;default:logger[_0x9268('0x61')]('[OUTBOUND]',_0x9268('0x5f'));}}})[_0x9268('0x60')](function(_0x381b66){logger['error'](_0x9268('0x65'),JSON['stringify'](_0x381b66));});};exports['unmanaged']=function(_0x26d1bf,_0x199ca1,_0xd72e0c,_0x348376,_0x1197e5,_0x5ad64d){var _0x56ddf9,_0x461908;_0x5ad64d[_0x9268('0x12')]=intUtil['stripTrailingSlash'](_0x5ad64d[_0x9268('0x12')]);_0x5ad64d[_0x9268('0x4f')]=intUtil[_0x9268('0x4e')](_0x5ad64d[_0x9268('0x4f')]);if(_0x1197e5&&_0x1197e5[_0x9268('0x6d')]){logger[_0x9268('0xe')]('['+_0x199ca1[_0x9268('0x6e')][_0x9268('0x6f')]()+']',_0x9268('0x51'));_0x199ca1[_0x9268('0x52')]=util[_0x9268('0x10')](_0x9268('0x53'),_0x5ad64d[_0x9268('0x4f')],_0x199ca1['uniqueid'],md5(_0x199ca1[_0x9268('0x54')]));}else{_0x199ca1['recordingURL']='';}headers[_0x9268('0x70')]=getAuth(_0x5ad64d);return getUser(_0x5ad64d)[_0x9268('0x16')](function(_0xee5869){_0x56ddf9=_0xee5869;logger[_0x9268('0xe')](_0x9268('0x56'),_0x56ddf9['id']);return getEndUser(_0x5ad64d,_0x199ca1[_0x9268('0x71')],_0x199ca1[_0x9268('0x57')]);})[_0x9268('0x16')](function(_0x38d3b2){_0x461908=_0x38d3b2;logger[_0x9268('0xe')](_0x9268('0x58'),_0x461908['id']);return getTicket(_0x5ad64d,_0x56ddf9,_0x461908,_0xd72e0c,_0x199ca1);})['then'](function(_0x2b9442){if(_0x2b9442){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x2b9442['id']);}})[_0x9268('0x60')](function(_0x38e01d){logger[_0x9268('0x61')]('['+_0x199ca1[_0x9268('0x6e')][_0x9268('0x6f')]()+']',JSON[_0x9268('0x1c')](_0x38e01d));});}; \ No newline at end of file +var _0x0bd1=['Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','variable','variableName','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','Desk\x20account\x20type\x20not\x20recognized','catch','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Ticket\x20created!','integrationTab','trigger:browser:url','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','util','ioredis','./util','../../../../config/environment','desk','redis','defaults','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email','remoteUri','then','total_entries','_embedded','entries','info','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!'];(function(_0x5427b7,_0x3c32a3){var _0x3b489c=function(_0x4f10f1){while(--_0x4f10f1){_0x5427b7['push'](_0x5427b7['shift']());}};_0x3b489c(++_0x3c32a3);}(_0x0bd1,0x1ec));var _0x10bd=function(_0x1c36a8,_0x49c835){_0x1c36a8=_0x1c36a8-0x0;var _0xb622c5=_0x0bd1[_0x1c36a8];return _0xb622c5;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x10bd('0x0'));var Redis=require(_0x10bd('0x1'));var intUtil=require(_0x10bd('0x2'));var config=require(_0x10bd('0x3'));var logger=require('../../../../config/logger')(_0x10bd('0x4'));config[_0x10bd('0x5')]=_[_0x10bd('0x6')](config[_0x10bd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x10bd('0x7'))(new Redis(config[_0x10bd('0x5')]));function emit(_0xcecdf9,_0x173e2a,_0x41fe67){io['to'](_0xcecdf9)[_0x10bd('0x8')](_0x173e2a,_0x41fe67);}var headers={'Content-Type':'application/json','Accept':_0x10bd('0x9')};function getUser(_0x3b744d,_0x2a46b8){if(intUtil[_0x10bd('0xa')](_0x2a46b8)===!![]){logger['info'](_0x10bd('0xb'),_0x2a46b8);return request({'uri':util['format']('%s/users',_0x3b744d[_0x10bd('0xc')])})[_0x10bd('0xd')](function(_0x4e8e09){if(_0x4e8e09[_0x10bd('0xe')]){return _['find'](_0x4e8e09[_0x10bd('0xf')][_0x10bd('0x10')],{'email':_0x2a46b8});}})[_0x10bd('0xd')](function(_0x1d4d84){if(_0x1d4d84){logger['info']('Agent\x20found!');return _0x1d4d84;}else{logger[_0x10bd('0x11')](_0x10bd('0x12'));return request({'uri':util[_0x10bd('0x13')](_0x10bd('0x14'),_0x3b744d['remoteUri'])});}});}else{logger[_0x10bd('0x11')](_0x10bd('0x15'));return request({'uri':util[_0x10bd('0x13')](_0x10bd('0x14'),_0x3b744d['remoteUri'])});}}function request(_0x57ecda){logger[_0x10bd('0x16')](_0x10bd('0x17'),JSON['stringify'](_0x57ecda));return rp(_[_0x10bd('0x6')](_0x57ecda,{'method':_0x10bd('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x1324d5){var _0x241572;if(_0x1324d5[_0x10bd('0x19')]===_0x10bd('0x1a')){_0x241572=util[_0x10bd('0x13')](_0x10bd('0x1b'),_0x1324d5[_0x10bd('0x1c')],_0x1324d5[_0x10bd('0x1d')]);}else if(_0x1324d5[_0x10bd('0x19')]===_0x10bd('0x1e')){_0x241572=util[_0x10bd('0x13')](_0x10bd('0x1f'),_0x1324d5['username'],_0x1324d5[_0x10bd('0x1e')]);}return util[_0x10bd('0x13')](_0x10bd('0x20'),new Buffer(_0x241572)[_0x10bd('0x21')](_0x10bd('0x22')));}function getEndUser(_0xa3ae1,_0x2b9862,_0x3784e6){logger[_0x10bd('0x11')](_0x10bd('0x23'),_0x3784e6);return request({'uri':util[_0x10bd('0x13')](_0x10bd('0x24'),_0xa3ae1[_0x10bd('0xc')]),'qs':{'phone':_0x3784e6}})[_0x10bd('0xd')](function(_0x52a8d0){if(_0x52a8d0[_0x10bd('0xe')]){logger[_0x10bd('0x11')](_0x10bd('0x25'));return _0x52a8d0[_0x10bd('0xf')][_0x10bd('0x10')][0x0];}else{logger[_0x10bd('0x11')](_0x10bd('0x26'));return request({'uri':util[_0x10bd('0x13')](_0x10bd('0x27'),_0xa3ae1['remoteUri']),'method':_0x10bd('0x28'),'body':{'first_name':_0x2b9862,'title':_0x2b9862,'phone_numbers':[{'type':'work','value':_0x3784e6}]}});}});}function getTags(_0xd108b8,_0x301e65){var _0x349aa8=[];if(_0xd108b8&&_0xd108b8[_0x10bd('0x29')]>0x0){_0x349aa8=_[_0x10bd('0x2a')](_0xd108b8,_0x301e65);}return _0x349aa8;}function getCustomFields(_0x1fd7ed,_0xc77643){var _0xac83a2=[];var _0x19cc9a={'custom_fields':{}};if(_0x1fd7ed[_0x10bd('0x29')]>0x0){_[_0x10bd('0x2b')](_0x1fd7ed,function(_0x283188){if(_[_0x10bd('0x2c')]([_0x10bd('0x2d'),_0x10bd('0x2e')],_0x283188[_0x10bd('0x2f')])&&_0x283188[_0x10bd('0x30')]&&!_0x283188[_0x10bd('0x31')]){_0x19cc9a[_0x283188[_0x10bd('0x30')][_0x10bd('0x32')]()]=_0x283188[_0x10bd('0x33')]['toString']();}else if(_[_0x10bd('0x2c')]([_0x10bd('0x2d'),_0x10bd('0x2e')],_0x283188[_0x10bd('0x2f')])&&_0x283188[_0x10bd('0x34')]&&_0x283188[_0x10bd('0x31')]){_0x19cc9a['custom_fields'][_0x283188[_0x10bd('0x34')]]=_0x283188[_0x10bd('0x33')][_0x10bd('0x21')]();}else if(_0x283188[_0x10bd('0x2f')]===_0x10bd('0x35')&&_0x283188['variableName']&&_0x283188['idField']&&_0x283188[_0x10bd('0x31')]){_0xc77643[_0x283188[_0x10bd('0x36')]]&&(_0x19cc9a[_0x10bd('0x37')][_0x283188[_0x10bd('0x34')]]=_0xc77643[_0x283188[_0x10bd('0x36')]]['toString']());}else if(_0x283188[_0x10bd('0x2f')]===_0x10bd('0x38')&&_0x283188[_0x10bd('0x39')]&&_0x283188[_0x10bd('0x39')][_0x10bd('0x3a')]&&_0x283188[_0x10bd('0x34')]&&_0x283188[_0x10bd('0x31')]){_0xc77643[_0x283188[_0x10bd('0x39')]['name'][_0x10bd('0x32')]()]&&(_0x19cc9a[_0x10bd('0x37')][_0x283188['idField']]=_0xc77643[_0x283188[_0x10bd('0x39')][_0x10bd('0x3a')]['toLowerCase']()][_0x10bd('0x21')]());}});}if(_0x19cc9a[_0x10bd('0x3b')]){_0x19cc9a[_0x10bd('0x3b')]=Number(_0x19cc9a['priority']);}return _0x19cc9a;}function getTicket(_0x267542,_0x363329,_0xc56f55,_0x3313d8,_0x42469d){logger['info'](_0x10bd('0x3c'));var _0x49a918=_[_0x10bd('0x3d')]({'subject':intUtil[_0x10bd('0x3e')](_0x3313d8['Subjects'],_0x42469d,'\x20'),'type':'phone','status':'new','labels':[_0x10bd('0x3f'),'Motion',_0x10bd('0x40')][_0x10bd('0x41')](getTags(_0x3313d8[_0x10bd('0x42')],_0x10bd('0x3a'))),'description':intUtil['getString'](_0x3313d8[_0x10bd('0x43')],_0x42469d,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x10bd('0x44'),_0x363329['id']),'class':_0x10bd('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x3313d8[_0x10bd('0x43')],_0x42469d,'\x0a')}},getCustomFields(_0x3313d8['Fields'],_0x42469d));return request({'uri':util['format']('%s/customers/%d/cases',_0x267542['remoteUri'],_0xc56f55['id']),'method':_0x10bd('0x28'),'body':_0x49a918});}exports['queue']=function(_0x5ec129,_0x111fd9,_0x10e94b,_0x3b2cf9,_0x376985,_0x1dd8ee){var _0x455fd9,_0x30da8a;_0x1dd8ee[_0x10bd('0xc')]=intUtil[_0x10bd('0x46')](_0x1dd8ee[_0x10bd('0xc')]);_0x1dd8ee['serverUrl']=intUtil[_0x10bd('0x46')](_0x1dd8ee['serverUrl']);if(_0x376985&&_0x376985[_0x10bd('0x47')]){logger[_0x10bd('0x11')](_0x10bd('0x48'),_0x10bd('0x49'));_0x111fd9[_0x10bd('0x4a')]=util[_0x10bd('0x13')](_0x10bd('0x4b'),_0x1dd8ee[_0x10bd('0x4c')],_0x111fd9[_0x10bd('0x4d')],md5(_0x111fd9[_0x10bd('0x4d')]));}else{_0x111fd9[_0x10bd('0x4a')]='';}headers[_0x10bd('0x4e')]=getAuth(_0x1dd8ee);return getUser(_0x1dd8ee,_0x3b2cf9['email'])[_0x10bd('0xd')](function(_0x2ad370){_0x455fd9=_0x2ad370;logger[_0x10bd('0x11')](_0x10bd('0x4f'),_0x455fd9['id']);return getEndUser(_0x1dd8ee,_0x111fd9['calleridname'],_0x111fd9[_0x10bd('0x50')]);})[_0x10bd('0xd')](function(_0x2ad9a9){_0x30da8a=_0x2ad9a9;logger[_0x10bd('0x11')](_0x10bd('0x51'),_0x30da8a['id']);return getTicket(_0x1dd8ee,_0x455fd9,_0x30da8a,_0x10e94b,_0x111fd9);})[_0x10bd('0xd')](function(_0x15c428){if(_0x15c428){logger['info']('Ticket\x20created!');logger[_0x10bd('0x11')](_0x10bd('0x52'),_0x15c428['id']);switch(_0x1dd8ee[_0x10bd('0x2f')]){case'integrationTab':logger[_0x10bd('0x11')](_0x10bd('0x48'),_0x10bd('0x53'));emit(util['format'](_0x10bd('0x54'),_0x3b2cf9[_0x10bd('0x3a')]),_0x10bd('0x55'),{'recordId':_0x15c428['id']});break;case _0x10bd('0x56'):logger[_0x10bd('0x11')](_0x10bd('0x48'),_0x10bd('0x57'));emit(util[_0x10bd('0x13')](_0x10bd('0x54'),_0x3b2cf9[_0x10bd('0x3a')]),'trigger:browser:url',{'uri':util[_0x10bd('0x13')](_0x10bd('0x58'),_0x15c428['id'])});break;default:logger['error']('[QUEUE]',_0x10bd('0x59'));}}})[_0x10bd('0x5a')](function(_0x32790b){console[_0x10bd('0x5b')](_0x32790b);logger[_0x10bd('0x5b')]('[QUEUE]',JSON[_0x10bd('0x5c')](_0x32790b));});};exports[_0x10bd('0x5d')]=function(_0x26fbc9,_0x1f3d68,_0x4e7e76,_0x4712e9,_0x53a1ee,_0x49a8f1,_0x15961e){var _0x3d6533,_0x4240e1;_0x49a8f1[_0x10bd('0xc')]=intUtil[_0x10bd('0x46')](_0x49a8f1[_0x10bd('0xc')]);_0x49a8f1[_0x10bd('0x4c')]=intUtil[_0x10bd('0x46')](_0x49a8f1[_0x10bd('0x4c')]);if(_0x15961e&&_0x15961e['recordingFormat']&&_0x15961e[_0x10bd('0x5e')]!==_0x10bd('0x5f')){logger['info'](_0x10bd('0x60'),_0x10bd('0x49'));_0x1f3d68['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x49a8f1[_0x10bd('0x4c')],_0x1f3d68[_0x10bd('0x4d')],md5(_0x1f3d68['uniqueid']));}headers[_0x10bd('0x4e')]=getAuth(_0x49a8f1);return getUser(_0x49a8f1,_0x4712e9['email'])[_0x10bd('0xd')](function(_0x3ade0e){_0x3d6533=_0x3ade0e;logger[_0x10bd('0x11')]('The\x20User\x20ID\x20is:',_0x3d6533['id']);return getEndUser(_0x49a8f1,_0x1f3d68[_0x10bd('0x61')],_0x1f3d68[_0x10bd('0x62')]);})[_0x10bd('0xd')](function(_0xb21161){_0x4240e1=_0xb21161;logger['info'](_0x10bd('0x51'),_0x4240e1['id']);return getTicket(_0x49a8f1,_0x3d6533,_0x4240e1,_0x4e7e76,_0x1f3d68);})[_0x10bd('0xd')](function(_0x510ae1){if(_0x510ae1){logger[_0x10bd('0x11')](_0x10bd('0x63'));logger[_0x10bd('0x11')]('The\x20Ticket\x20ID\x20is:',_0x510ae1['id']);switch(_0x49a8f1['type']){case _0x10bd('0x64'):logger[_0x10bd('0x11')](_0x10bd('0x48'),_0x10bd('0x53'));emit(util[_0x10bd('0x13')](_0x10bd('0x54'),_0x4712e9['name']),_0x10bd('0x55'),{'recordId':_0x510ae1['id']});break;case _0x10bd('0x56'):logger[_0x10bd('0x11')](_0x10bd('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x4712e9[_0x10bd('0x3a')]),_0x10bd('0x65'),{'uri':util['format'](_0x10bd('0x66'),_0x49a8f1[_0x10bd('0xc')],_0x510ae1['id'])});break;default:logger[_0x10bd('0x5b')]('[OUTBOUND]',_0x10bd('0x59'));}}})[_0x10bd('0x5a')](function(_0x398dcd){logger[_0x10bd('0x5b')](_0x10bd('0x60'),JSON[_0x10bd('0x5c')](_0x398dcd));});};exports[_0x10bd('0x67')]=function(_0x69ae5d,_0x238bc0,_0x2cd97a,_0x1045e4,_0x374927,_0x5bf581){var _0x15afc1,_0x47b331;_0x5bf581[_0x10bd('0xc')]=intUtil[_0x10bd('0x46')](_0x5bf581[_0x10bd('0xc')]);_0x5bf581[_0x10bd('0x4c')]=intUtil[_0x10bd('0x46')](_0x5bf581[_0x10bd('0x4c')]);if(_0x374927&&_0x374927[_0x10bd('0x47')]){logger['info']('['+_0x238bc0[_0x10bd('0x68')][_0x10bd('0x69')]()+']',_0x10bd('0x49'));_0x238bc0['recordingURL']=util[_0x10bd('0x13')](_0x10bd('0x4b'),_0x5bf581[_0x10bd('0x4c')],_0x238bc0[_0x10bd('0x4d')],md5(_0x238bc0[_0x10bd('0x4d')]));}else{_0x238bc0[_0x10bd('0x4a')]='';}headers['Authorization']=getAuth(_0x5bf581);return getUser(_0x5bf581)[_0x10bd('0xd')](function(_0xb604dc){_0x15afc1=_0xb604dc;logger['info'](_0x10bd('0x4f'),_0x15afc1['id']);return getEndUser(_0x5bf581,_0x238bc0['calleridname'],_0x238bc0[_0x10bd('0x50')]);})['then'](function(_0x481a44){_0x47b331=_0x481a44;logger[_0x10bd('0x11')](_0x10bd('0x51'),_0x47b331['id']);return getTicket(_0x5bf581,_0x15afc1,_0x47b331,_0x2cd97a,_0x238bc0);})[_0x10bd('0xd')](function(_0x58b5d5){if(_0x58b5d5){logger[_0x10bd('0x11')](_0x10bd('0x63'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x58b5d5['id']);}})[_0x10bd('0x5a')](function(_0x60284b){logger[_0x10bd('0x5b')]('['+_0x238bc0[_0x10bd('0x68')][_0x10bd('0x69')]()+']',JSON[_0x10bd('0x5c')](_0x60284b));});}; \ 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 debcfd0..f88e670 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 _0x9ab0=['socket.io-emitter','POST','remoteUri','password','clientSecret','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','internalemailaddress','toLowerCase','outbound','calleridnum','contacts','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1','destcalleridnum',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Fields','phonecalls','Descriptions','queue','callDirection','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','localhost'];(function(_0x598e63,_0x18d6a7){var _0x249ee2=function(_0xfd0dfc){while(--_0xfd0dfc){_0x598e63['push'](_0x598e63['shift']());}};_0x249ee2(++_0x18d6a7);}(_0x9ab0,0x195));var _0x09ab=function(_0x3667fc,_0x2241d0){_0x3667fc=_0x3667fc-0x0;var _0x4c2c81=_0x9ab0[_0x3667fc];return _0x4c2c81;};'use strict';var _=require(_0x09ab('0x0'));var BPromise=require(_0x09ab('0x1'));var rp=require(_0x09ab('0x2'));var util=require(_0x09ab('0x3'));var intUtil=require(_0x09ab('0x4'));var md5=require(_0x09ab('0x5'));var Redis=require(_0x09ab('0x6'));var logger=require(_0x09ab('0x7'))(_0x09ab('0x8'));var config=require('../../../../config/environment');config['redis']=_['defaults'](config[_0x09ab('0x9')],{'host':_0x09ab('0xa'),'port':0x18eb});var io=require(_0x09ab('0xb'))(new Redis(config[_0x09ab('0x9')]));function getAuthToken(_0x610663,_0x464d64,_0x174a54){var _0x27e45e={'method':_0x09ab('0xc'),'uri':_0x464d64,'form':{'client_id':_0x610663['clientId'],'resource':_0x610663[_0x09ab('0xd')],'username':_0x610663['username'],'password':_0x610663[_0x09ab('0xe')],'grant_type':_0x09ab('0xe'),'client_secret':_0x610663[_0x09ab('0xf')]},'json':!![]};return rp(_0x27e45e)['then'](function(_0x5f16c6){return _0x5f16c6[_0x09ab('0x10')];})[_0x09ab('0x11')](function(_0x553791){logger['error']('['+[_0x174a54[_0x09ab('0x12')]()]+_0x09ab('0x13'));return _0x553791[_0x09ab('0x14')];});}function getUser(_0x4705df,_0x116193,_0x34afbd,_0x18ecda,_0x25bb6b,_0x10971){return new BPromise(function(_0x1d4354,_0x2a16e4){return getAuthToken(_0x116193,_0x18ecda,_0x10971)[_0x09ab('0x15')](function(_0x5ac9da){var _0x24db01={'method':_0x09ab('0x16'),'uri':_0x25bb6b+_0x09ab('0x17'),'headers':{'Authorization':'Bearer\x20'+_0x5ac9da,'OData-Version':_0x09ab('0x18')},'json':!![]};return rp(_0x24db01);})[_0x09ab('0x15')](function(_0x2f75a8){var _0x574b0f=_0x2f75a8[_0x09ab('0x19')];var _0x3f86c4=![];var _0x88f781=null;if(!_[_0x09ab('0x1a')](_0x34afbd)){if(intUtil[_0x09ab('0x1b')](_0x34afbd[_0x09ab('0x1c')])){_0x4705df['userEmail']=_0x34afbd[_0x09ab('0x1c')];for(_0x88f781=0x0;_0x88f781<_0x574b0f[_0x09ab('0x1d')];_0x88f781++){if(_0x574b0f[_0x88f781]['internalemailaddress']===_0x34afbd[_0x09ab('0x1c')]&&!_0x574b0f[_0x88f781][_0x09ab('0x1e')]){_0x3f86c4=!![];logger[_0x09ab('0x1f')]('['+[_0x10971[_0x09ab('0x12')]()]+_0x09ab('0x20')+_0x574b0f[_0x88f781][_0x09ab('0x21')]+'!');_0x4705df[_0x09ab('0x22')]=_0x574b0f[_0x88f781][_0x09ab('0x21')];}}}}if(!_0x3f86c4){logger['info']('['+[_0x10971[_0x09ab('0x12')]()]+_0x09ab('0x23'));_0x4705df[_0x09ab('0x24')]=_0x116193[_0x09ab('0x25')];for(_0x88f781=0x0;_0x88f781<_0x574b0f[_0x09ab('0x1d')];_0x88f781++){if(_0x574b0f[_0x88f781][_0x09ab('0x26')]===_0x116193['username']){_0x4705df[_0x09ab('0x22')]=_0x574b0f[_0x88f781][_0x09ab('0x21')];}}}_0x1d4354(_0x4705df);})[_0x09ab('0x11')](function(_0x33cc49){_0x2a16e4(_0x33cc49[_0x09ab('0x14')]);});});}function createEndUser(_0x4c776b,_0x50a95b,_0x21ed17,_0x40932c,_0x5138d4,_0x429b1b){return new BPromise(function(_0x18e960,_0x22d3dd){return getAuthToken(_0x50a95b,_0x21ed17,_0x429b1b)[_0x09ab('0x15')](function(_0x381719){var _0x923b78=_0x429b1b[_0x09ab('0x27')]()===_0x09ab('0x28')?_0x5138d4['destcalleridnum']:_0x5138d4[_0x09ab('0x29')];var _0x2d4028={'method':_0x09ab('0xc'),'uri':_0x40932c+_0x09ab('0x2a'),'body':{'telephone1':_0x923b78,'fullname':_0x923b78,'firstname':_0x923b78,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x09ab('0x2b')+_0x4c776b[_0x09ab('0x22')]+')'},'headers':{'Authorization':_0x09ab('0x2c')+_0x381719,'OData-Version':_0x09ab('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2d4028);})[_0x09ab('0x15')](function(_0x237f9b){var _0x12f4f2=_0x237f9b[_0x09ab('0x2d')][_0x09ab('0x2e')];var _0x4d1be6=_0x12f4f2[_0x09ab('0x2f')](_0x12f4f2[_0x09ab('0x30')]('(')+0x1,_0x12f4f2[_0x09ab('0x30')](')'));_0x4c776b[_0x09ab('0x31')]=_0x4d1be6;_0x18e960(_0x4c776b);})[_0x09ab('0x11')](function(_0x11bf0d){_0x22d3dd(_0x11bf0d[_0x09ab('0x14')]);});});}function getEndUser(_0x388454,_0x1497d2,_0x5a43bc,_0x488946,_0x3b7e4f,_0x2e24e8){return new BPromise(function(_0x4ab4c1,_0xc02be0){return getAuthToken(_0x1497d2,_0x5a43bc,_0x2e24e8)[_0x09ab('0x15')](function(_0x80d2fa){var _0x552537={'method':_0x09ab('0x16'),'uri':_0x488946+_0x09ab('0x32'),'headers':{'Authorization':_0x09ab('0x2c')+_0x80d2fa,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x552537);})['then'](function(_0x1a225c){var _0x2141a3=null;if(_0x1a225c){var _0x33af6c=_0x1a225c[_0x09ab('0x19')];var _0x156263=![];for(_0x2141a3=0x0;_0x2141a3<_0x33af6c['length'];_0x2141a3++){var _0x307aca=_0x2e24e8[_0x09ab('0x27')]()==='outbound'?_0x3b7e4f[_0x09ab('0x33')]:_0x3b7e4f[_0x09ab('0x29')];if(_0x33af6c[_0x2141a3]['telephone1']===_0x307aca){_0x156263=!![];_0x388454['enduserId']=_0x33af6c[_0x2141a3]['contactid'];}}if(_0x156263){_0x4ab4c1(_0x388454);}else{return createEndUser(_0x388454,_0x1497d2,_0x5a43bc,_0x488946,_0x3b7e4f,_0x2e24e8)['then'](function(_0x32ee86){logger[_0x09ab('0x1f')]('['+[_0x2e24e8['toUpperCase']()]+_0x09ab('0x34'),_0x32ee86[_0x09ab('0x31')]);_0x4ab4c1(_0x32ee86);});}}else{return createEndUser(_0x388454,_0x1497d2,_0x5a43bc,_0x488946,_0x3b7e4f,_0x2e24e8)[_0x09ab('0x15')](function(_0x175371){logger['info']('['+[_0x2e24e8[_0x09ab('0x12')]()]+_0x09ab('0x35'),_0x175371[_0x09ab('0x31')]);_0x4ab4c1(_0x175371);});}});});}function getCustomFields(_0x12c432,_0x36195c,_0x41f449){var _0xc78d79={};if(_0x12c432[_0x09ab('0x1d')]>0x0){_[_0x09ab('0x36')](_0x12c432,function(_0x2beb36){if(_[_0x09ab('0x37')]([_0x09ab('0x38'),'picklist'],_0x2beb36[_0x09ab('0x39')])&&_0x2beb36[_0x09ab('0x3a')]&&!_0x2beb36[_0x09ab('0x3b')]){var _0x162f69=_0x2beb36[_0x09ab('0x3c')]['toLowerCase']();var _0xa4a211=_0x162f69['substring'](0x0,_0x162f69[_0x09ab('0x3d')]('_'));var _0x317dcf=_0x162f69[_0x09ab('0x2f')](_0x162f69[_0x09ab('0x3d')]('_')+0x1);if(_0xa4a211===_0x41f449){_0xc78d79[_0x317dcf]=_0x2beb36[_0x09ab('0x3e')];}}});}return _0xc78d79;}function getTicket(_0x5ded5d,_0x171383,_0x277ea6,_0x4430f2,_0x187378,_0x2ab35c,_0x3572f2){return new BPromise(function(_0x14e82c,_0x75feeb){var _0x1e8189;return getAuthToken(_0x171383,_0x277ea6,_0x3572f2)[_0x09ab('0x15')](function(_0x44a820){if(_0x2ab35c[_0x09ab('0x3f')]===_0x09ab('0x40')){_0x1e8189={'method':_0x09ab('0xc'),'uri':_0x4430f2+_0x09ab('0x41'),'body':Object[_0x09ab('0x42')]({},{'title':intUtil[_0x09ab('0x43')](_0x2ab35c[_0x09ab('0x44')],_0x187378,'\x20'),'description':intUtil[_0x09ab('0x43')](_0x2ab35c['Descriptions'],_0x187378,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x5ded5d[_0x09ab('0x31')]+')','ownerid@odata.bind':_0x09ab('0x2b')+_0x5ded5d['userId']+')','caseorigincode':'1'},getCustomFields(_0x2ab35c[_0x09ab('0x45')],_0x187378,_0x2ab35c[_0x09ab('0x3f')])),'headers':{'Authorization':'Bearer\x20'+_0x44a820,'OData-Version':_0x09ab('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2ab35c[_0x09ab('0x3f')]==='phonecall'){_0x1e8189={'method':_0x09ab('0xc'),'uri':_0x4430f2+_0x09ab('0x46'),'body':Object[_0x09ab('0x42')]({},{'subject':intUtil[_0x09ab('0x43')](_0x2ab35c[_0x09ab('0x44')],_0x187378,'\x20'),'phonenumber':String(_0x187378[_0x09ab('0x29')]),'description':intUtil[_0x09ab('0x43')](_0x2ab35c[_0x09ab('0x47')],_0x187378,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x5ded5d[_0x09ab('0x31')]+')','ownerid@odata.bind':_0x09ab('0x2b')+_0x5ded5d[_0x09ab('0x22')]+')','directioncode':_0x5ded5d['callDirection']===_0x09ab('0x48')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x09ab('0x2b')+_0x5ded5d[_0x09ab('0x22')]+')','participationtypemask':_0x5ded5d[_0x09ab('0x49')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x5ded5d['enduserId']+')','participationtypemask':_0x5ded5d['callDirection']===_0x09ab('0x48')?0x1:0x2}]},getCustomFields(_0x2ab35c[_0x09ab('0x45')],_0x187378,_0x2ab35c[_0x09ab('0x3f')])),'headers':{'Authorization':'Bearer\x20'+_0x44a820,'OData-Version':_0x09ab('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1e8189);})[_0x09ab('0x15')](function(_0x5e3257){var _0x21b10c=_0x5e3257[_0x09ab('0x2d')][_0x09ab('0x2e')];var _0x3eb8ab=_0x21b10c['substring'](_0x21b10c[_0x09ab('0x30')]('(')+0x1,_0x21b10c[_0x09ab('0x30')](')'));_0x5ded5d[_0x09ab('0x4a')]=_0x3eb8ab;_0x14e82c(_0x5ded5d);})[_0x09ab('0x11')](function(_0x2002c2){_0x75feeb(_0x2002c2['message']);});});}function emit(_0x3a3ae3,_0x14f64d,_0x278b98,_0x1064ed){var _0x47139a={'uri':util[_0x09ab('0x4b')](_0x09ab('0x4c'),_0x3a3ae3,_0x278b98,_0x1064ed)};io['to'](util[_0x09ab('0x4b')](_0x09ab('0x4d'),_0x14f64d))[_0x09ab('0x4e')]('trigger:browser:url',_0x47139a);}exports['cs']=function(_0x10f318,_0x27df69,_0x1953b0,_0x42ec49,_0x5237b8,_0x307579,_0x66711a,_0x2540a2){var _0x2cec4c={};_0x307579['remoteUri']=intUtil[_0x09ab('0x4f')](_0x307579[_0x09ab('0xd')]);_0x307579['serverUrl']=intUtil[_0x09ab('0x4f')](_0x307579['serverUrl']);_0x2cec4c['callDirection']=_0x2540a2===_0x09ab('0x48')||_0x2540a2===_0x09ab('0x50')?_0x09ab('0x48'):'outbound';var _0x593ca2=util[_0x09ab('0x4b')](_0x09ab('0x51'),_0x307579['remoteUri']);var _0x149943=util[_0x09ab('0x4b')](_0x09ab('0x52'),_0x307579[_0x09ab('0x53')]);var _0x1e11ad=util[_0x09ab('0x4b')](_0x09ab('0x54'),_0x307579['serverUrl'],_0x27df69[_0x09ab('0x55')],md5(_0x27df69[_0x09ab('0x55')]));if(_0x5237b8&&_0x5237b8[_0x09ab('0x56')]){logger[_0x09ab('0x1f')](_0x09ab('0x57'),_0x09ab('0x58'));_0x27df69[_0x09ab('0x59')]=_0x1e11ad;}else if(_0x66711a&&_0x66711a[_0x09ab('0x5a')]&&_0x66711a[_0x09ab('0x5a')]!==_0x09ab('0x5b')){logger['info'](_0x09ab('0x5c'),_0x09ab('0x58'));_0x27df69[_0x09ab('0x59')]=_0x1e11ad;}else{_0x27df69['recordingURL']='';}return getUser(_0x2cec4c,_0x307579,_0x42ec49,_0x149943,_0x593ca2,_0x2540a2)['then'](function(_0x2506f7){logger[_0x09ab('0x1f')]('['+_0x2540a2[_0x09ab('0x12')]()+_0x09ab('0x5d'),_0x2506f7[_0x09ab('0x22')]);logger['info']('['+_0x2540a2[_0x09ab('0x12')]()+_0x09ab('0x5e'),_0x2506f7[_0x09ab('0x24')]);return getEndUser(_0x2506f7,_0x307579,_0x149943,_0x593ca2,_0x27df69,_0x2540a2);})[_0x09ab('0x15')](function(_0x12c72a){logger['info']('['+_0x2540a2['toUpperCase']()+_0x09ab('0x5f'),_0x12c72a[_0x09ab('0x31')]);logger[_0x09ab('0x1f')]('['+_0x2540a2[_0x09ab('0x12')]()+_0x09ab('0x60'),_0x27df69[_0x09ab('0x29')]);return getTicket(_0x12c72a,_0x307579,_0x149943,_0x593ca2,_0x27df69,_0x1953b0,_0x2540a2);})[_0x09ab('0x15')](function(_0x4cc417){logger[_0x09ab('0x1f')](util['format']('['+_0x2540a2[_0x09ab('0x12')]()+_0x09ab('0x61'),_0x1953b0['ticketType'],_0x4cc417[_0x09ab('0x4a')]));logger['info'](util[_0x09ab('0x4b')]('['+_0x2540a2[_0x09ab('0x12')]()+_0x09ab('0x62'),_0x2540a2));if(_0x2540a2!=='unmanaged'){logger[_0x09ab('0x1f')]('['+_0x2540a2['toUpperCase']()+']',_0x09ab('0x63'));emit(_0x307579['remoteUri'],_0x42ec49[_0x09ab('0x64')],_0x1953b0[_0x09ab('0x3f')],_0x4cc417[_0x09ab('0x4a')]);}})['catch'](function(_0x4c83d9){logger[_0x09ab('0x65')]('['+_0x2540a2[_0x09ab('0x12')]()+_0x09ab('0x66'),util[_0x09ab('0x67')](_0x4c83d9,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7412=['remoteUri','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','outbound','calleridnum','POST','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','message','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','picklist','type','nameField','customField','idField','toLowerCase','indexOf','content','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls','callDirection','queue','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','format','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','util','md5','redis','localhost','socket.io-emitter','clientId'];(function(_0x106b42,_0x44ff5e){var _0x110207=function(_0x1c379c){while(--_0x1c379c){_0x106b42['push'](_0x106b42['shift']());}};_0x110207(++_0x44ff5e);}(_0x7412,0x161));var _0x2741=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x7412[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x2741('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var util=require(_0x2741('0x1'));var intUtil=require('./util');var md5=require(_0x2741('0x2'));var Redis=require('ioredis');var logger=require('../../../../config/logger')('dynamics365');var config=require('../../../../config/environment');config['redis']=_['defaults'](config[_0x2741('0x3')],{'host':_0x2741('0x4'),'port':0x18eb});var io=require(_0x2741('0x5'))(new Redis(config['redis']));function getAuthToken(_0x1f1f0d,_0x1f1451,_0x3883ec){var _0x2f3fb1={'method':'POST','uri':_0x1f1451,'form':{'client_id':_0x1f1f0d[_0x2741('0x6')],'resource':_0x1f1f0d[_0x2741('0x7')],'username':_0x1f1f0d[_0x2741('0x8')],'password':_0x1f1f0d[_0x2741('0x9')],'grant_type':_0x2741('0x9'),'client_secret':_0x1f1f0d['clientSecret']},'json':!![]};return rp(_0x2f3fb1)[_0x2741('0xa')](function(_0x105c01){return _0x105c01[_0x2741('0xb')];})[_0x2741('0xc')](function(_0x3c83ba){logger[_0x2741('0xd')]('['+[_0x3883ec[_0x2741('0xe')]()]+_0x2741('0xf'));return _0x3c83ba['message'];});}function getUser(_0x2311f2,_0xecf933,_0xc75fb5,_0x4347d5,_0x494073,_0xc535ee){return new BPromise(function(_0x1738fa,_0x29838b){return getAuthToken(_0xecf933,_0x4347d5,_0xc535ee)[_0x2741('0xa')](function(_0x56a04c){var _0x1f7ef5={'method':_0x2741('0x10'),'uri':_0x494073+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x2741('0x11')+_0x56a04c,'OData-Version':_0x2741('0x12')},'json':!![]};return rp(_0x1f7ef5);})['then'](function(_0x482f99){var _0x2b4f91=_0x482f99[_0x2741('0x13')];var _0x14cfa8=![];var _0x27feb7=null;if(!_[_0x2741('0x14')](_0xc75fb5)){if(intUtil[_0x2741('0x15')](_0xc75fb5[_0x2741('0x16')])){_0x2311f2[_0x2741('0x17')]=_0xc75fb5['email'];for(_0x27feb7=0x0;_0x27feb7<_0x2b4f91[_0x2741('0x18')];_0x27feb7++){if(_0x2b4f91[_0x27feb7]['internalemailaddress']===_0xc75fb5[_0x2741('0x16')]&&!_0x2b4f91[_0x27feb7]['isdisabled']){_0x14cfa8=!![];logger['info']('['+[_0xc535ee[_0x2741('0xe')]()]+_0x2741('0x19')+_0x2b4f91[_0x27feb7][_0x2741('0x1a')]+'!');_0x2311f2['userId']=_0x2b4f91[_0x27feb7][_0x2741('0x1a')];}}}}if(!_0x14cfa8){logger[_0x2741('0x1b')]('['+[_0xc535ee[_0x2741('0xe')]()]+_0x2741('0x1c'));_0x2311f2['userEmail']=_0xecf933[_0x2741('0x8')];for(_0x27feb7=0x0;_0x27feb7<_0x2b4f91[_0x2741('0x18')];_0x27feb7++){if(_0x2b4f91[_0x27feb7]['internalemailaddress']===_0xecf933['username']){_0x2311f2[_0x2741('0x1d')]=_0x2b4f91[_0x27feb7]['systemuserid'];}}}_0x1738fa(_0x2311f2);})['catch'](function(_0x303d6e){_0x29838b(_0x303d6e['message']);});});}function createEndUser(_0x52f2ab,_0x23cb80,_0x3ff705,_0x1e95d8,_0x40bfd5,_0x53aab8){return new BPromise(function(_0x14a9ab,_0x41cb7b){return getAuthToken(_0x23cb80,_0x3ff705,_0x53aab8)['then'](function(_0x355327){var _0x3a11ae=_0x53aab8['toLowerCase']()===_0x2741('0x1e')?_0x40bfd5['destcalleridnum']:_0x40bfd5[_0x2741('0x1f')];var _0x57b16d={'method':_0x2741('0x20'),'uri':_0x1e95d8+'contacts','body':{'telephone1':_0x3a11ae,'fullname':_0x3a11ae,'firstname':_0x3a11ae,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2741('0x21')+_0x52f2ab[_0x2741('0x1d')]+')'},'headers':{'Authorization':_0x2741('0x11')+_0x355327,'OData-Version':_0x2741('0x12')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x57b16d);})[_0x2741('0xa')](function(_0x29e4c5){var _0x3c0283=_0x29e4c5[_0x2741('0x22')][_0x2741('0x23')];var _0x28fc1a=_0x3c0283[_0x2741('0x24')](_0x3c0283['lastIndexOf']('(')+0x1,_0x3c0283[_0x2741('0x25')](')'));_0x52f2ab[_0x2741('0x26')]=_0x28fc1a;_0x14a9ab(_0x52f2ab);})[_0x2741('0xc')](function(_0x90ec2f){_0x41cb7b(_0x90ec2f[_0x2741('0x27')]);});});}function getEndUser(_0x47512d,_0x593e57,_0x3c2559,_0x5700db,_0x4ab122,_0x652e6a){return new BPromise(function(_0x4c48e6,_0x36758b){return getAuthToken(_0x593e57,_0x3c2559,_0x652e6a)[_0x2741('0xa')](function(_0x1c4bb1){var _0x549e28={'method':_0x2741('0x10'),'uri':_0x5700db+'contacts?$select=telephone1','headers':{'Authorization':_0x2741('0x11')+_0x1c4bb1,'If-None-Match':null,'OData-Version':_0x2741('0x12')},'json':!![]};return rp(_0x549e28);})[_0x2741('0xa')](function(_0x489e11){var _0x5684b0=null;if(_0x489e11){var _0x3c9752=_0x489e11[_0x2741('0x13')];var _0x1fbd52=![];for(_0x5684b0=0x0;_0x5684b0<_0x3c9752[_0x2741('0x18')];_0x5684b0++){var _0x22c455=_0x652e6a['toLowerCase']()===_0x2741('0x1e')?_0x4ab122['destcalleridnum']:_0x4ab122[_0x2741('0x1f')];if(_0x3c9752[_0x5684b0][_0x2741('0x28')]===_0x22c455){_0x1fbd52=!![];_0x47512d[_0x2741('0x26')]=_0x3c9752[_0x5684b0][_0x2741('0x29')];}}if(_0x1fbd52){_0x4c48e6(_0x47512d);}else{return createEndUser(_0x47512d,_0x593e57,_0x3c2559,_0x5700db,_0x4ab122,_0x652e6a)['then'](function(_0x3ccc96){logger[_0x2741('0x1b')]('['+[_0x652e6a[_0x2741('0xe')]()]+_0x2741('0x2a'),_0x3ccc96[_0x2741('0x26')]);_0x4c48e6(_0x3ccc96);});}}else{return createEndUser(_0x47512d,_0x593e57,_0x3c2559,_0x5700db,_0x4ab122,_0x652e6a)['then'](function(_0x412284){logger[_0x2741('0x1b')]('['+[_0x652e6a[_0x2741('0xe')]()]+_0x2741('0x2b'),_0x412284['enduserId']);_0x4c48e6(_0x412284);});}});});}function getCustomFields(_0x1a4ab9,_0x3b6d2c,_0x2eb065){var _0x45e33b={};if(_0x1a4ab9[_0x2741('0x18')]>0x0){_['forEach'](_0x1a4ab9,function(_0x4df6ea){if(_['includes'](['string',_0x2741('0x2c')],_0x4df6ea[_0x2741('0x2d')])&&_0x4df6ea[_0x2741('0x2e')]&&!_0x4df6ea[_0x2741('0x2f')]){var _0x329ef3=_0x4df6ea[_0x2741('0x30')][_0x2741('0x31')]();var _0x5dd1b6=_0x329ef3[_0x2741('0x24')](0x0,_0x329ef3[_0x2741('0x32')]('_'));var _0x56b903=_0x329ef3[_0x2741('0x24')](_0x329ef3[_0x2741('0x32')]('_')+0x1);if(_0x5dd1b6===_0x2eb065){_0x45e33b[_0x56b903]=_0x4df6ea[_0x2741('0x33')];}}});}return _0x45e33b;}function getTicket(_0x106b26,_0x1ac4c2,_0x4dc9fa,_0x35c218,_0x29e4b3,_0x5f046a,_0x2ef85f){return new BPromise(function(_0x1a943e,_0x4fabae){var _0x37a55e;return getAuthToken(_0x1ac4c2,_0x4dc9fa,_0x2ef85f)['then'](function(_0x46f45f){if(_0x5f046a['ticketType']===_0x2741('0x34')){_0x37a55e={'method':'POST','uri':_0x35c218+_0x2741('0x35'),'body':Object[_0x2741('0x36')]({},{'title':intUtil[_0x2741('0x37')](_0x5f046a[_0x2741('0x38')],_0x29e4b3,'\x20'),'description':intUtil[_0x2741('0x37')](_0x5f046a[_0x2741('0x39')],_0x29e4b3,'\x0a'),'customerid_contact@odata.bind':_0x2741('0x3a')+_0x106b26['enduserId']+')','ownerid@odata.bind':_0x2741('0x21')+_0x106b26[_0x2741('0x1d')]+')','caseorigincode':'1'},getCustomFields(_0x5f046a[_0x2741('0x3b')],_0x29e4b3,_0x5f046a[_0x2741('0x3c')])),'headers':{'Authorization':_0x2741('0x11')+_0x46f45f,'OData-Version':_0x2741('0x12')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5f046a[_0x2741('0x3c')]===_0x2741('0x3d')){_0x37a55e={'method':_0x2741('0x20'),'uri':_0x35c218+_0x2741('0x3e'),'body':Object[_0x2741('0x36')]({},{'subject':intUtil[_0x2741('0x37')](_0x5f046a[_0x2741('0x38')],_0x29e4b3,'\x20'),'phonenumber':String(_0x29e4b3['calleridnum']),'description':intUtil[_0x2741('0x37')](_0x5f046a['Descriptions'],_0x29e4b3,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2741('0x3a')+_0x106b26[_0x2741('0x26')]+')','ownerid@odata.bind':'/systemusers('+_0x106b26[_0x2741('0x1d')]+')','directioncode':_0x106b26[_0x2741('0x3f')]===_0x2741('0x40')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x106b26[_0x2741('0x1d')]+')','participationtypemask':_0x106b26[_0x2741('0x3f')]===_0x2741('0x40')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x106b26['enduserId']+')','participationtypemask':_0x106b26[_0x2741('0x3f')]===_0x2741('0x40')?0x1:0x2}]},getCustomFields(_0x5f046a['Fields'],_0x29e4b3,_0x5f046a[_0x2741('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x46f45f,'OData-Version':_0x2741('0x12')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x37a55e);})[_0x2741('0xa')](function(_0x5ba5d){var _0x38a43f=_0x5ba5d[_0x2741('0x22')][_0x2741('0x23')];var _0x9bc596=_0x38a43f[_0x2741('0x24')](_0x38a43f[_0x2741('0x25')]('(')+0x1,_0x38a43f[_0x2741('0x25')](')'));_0x106b26[_0x2741('0x41')]=_0x9bc596;_0x1a943e(_0x106b26);})[_0x2741('0xc')](function(_0x453cdc){_0x4fabae(_0x453cdc['message']);});});}function emit(_0x8b5e57,_0x403cb9,_0x19a0aa,_0x117bc5){var _0x4534bd={'uri':util['format'](_0x2741('0x42'),_0x8b5e57,_0x19a0aa,_0x117bc5)};io['to'](util['format']('user:%s',_0x403cb9))[_0x2741('0x43')](_0x2741('0x44'),_0x4534bd);}exports['cs']=function(_0x4a28d7,_0xfc9b96,_0x43e62c,_0x1fa33b,_0x188253,_0x1635e5,_0x301849,_0x35a420){var _0x2c5e2e={};_0x1635e5[_0x2741('0x7')]=intUtil[_0x2741('0x45')](_0x1635e5['remoteUri']);_0x1635e5[_0x2741('0x46')]=intUtil[_0x2741('0x45')](_0x1635e5[_0x2741('0x46')]);_0x2c5e2e[_0x2741('0x3f')]=_0x35a420===_0x2741('0x40')||_0x35a420===_0x2741('0x47')?_0x2741('0x40'):'outbound';var _0xd66ee9=util[_0x2741('0x48')](_0x2741('0x49'),_0x1635e5[_0x2741('0x7')]);var _0x55daeb=util[_0x2741('0x48')](_0x2741('0x4a'),_0x1635e5[_0x2741('0x4b')]);var _0x2093b5=util['format'](_0x2741('0x4c'),_0x1635e5[_0x2741('0x46')],_0xfc9b96[_0x2741('0x4d')],md5(_0xfc9b96[_0x2741('0x4d')]));if(_0x188253&&_0x188253['monitor_format']){logger[_0x2741('0x1b')](_0x2741('0x4e'),'Recording\x20is\x20enabled!');_0xfc9b96[_0x2741('0x4f')]=_0x2093b5;}else if(_0x301849&&_0x301849[_0x2741('0x50')]&&_0x301849[_0x2741('0x50')]!==_0x2741('0x51')){logger['info']('[OUTBOUND]',_0x2741('0x52'));_0xfc9b96[_0x2741('0x4f')]=_0x2093b5;}else{_0xfc9b96['recordingURL']='';}return getUser(_0x2c5e2e,_0x1635e5,_0x1fa33b,_0x55daeb,_0xd66ee9,_0x35a420)['then'](function(_0x3d1cc2){logger['info']('['+_0x35a420[_0x2741('0xe')]()+_0x2741('0x53'),_0x3d1cc2[_0x2741('0x1d')]);logger['info']('['+_0x35a420[_0x2741('0xe')]()+_0x2741('0x54'),_0x3d1cc2[_0x2741('0x17')]);return getEndUser(_0x3d1cc2,_0x1635e5,_0x55daeb,_0xd66ee9,_0xfc9b96,_0x35a420);})[_0x2741('0xa')](function(_0x16685a){logger[_0x2741('0x1b')]('['+_0x35a420[_0x2741('0xe')]()+_0x2741('0x55'),_0x16685a[_0x2741('0x26')]);logger[_0x2741('0x1b')]('['+_0x35a420[_0x2741('0xe')]()+']\x20The\x20Enduser\x20phone\x20is:',_0xfc9b96['calleridnum']);return getTicket(_0x16685a,_0x1635e5,_0x55daeb,_0xd66ee9,_0xfc9b96,_0x43e62c,_0x35a420);})[_0x2741('0xa')](function(_0x351568){logger[_0x2741('0x1b')](util[_0x2741('0x48')]('['+_0x35a420[_0x2741('0xe')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x43e62c[_0x2741('0x3c')],_0x351568['ticketId']));logger[_0x2741('0x1b')](util['format']('['+_0x35a420[_0x2741('0xe')]()+_0x2741('0x56'),_0x35a420));if(_0x35a420!==_0x2741('0x47')){logger['info']('['+_0x35a420['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1635e5[_0x2741('0x7')],_0x1fa33b[_0x2741('0x57')],_0x43e62c[_0x2741('0x3c')],_0x351568[_0x2741('0x41')]);}})[_0x2741('0xc')](function(_0x1bee36){logger['error']('['+_0x35a420[_0x2741('0xe')]()+_0x2741('0x58'),util[_0x2741('0x59')](_0x1bee36,{'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 3b4b17f..9db180f 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 _0x0b6f=['stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Descriptions','
','Tags','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20created.','Basic\x20%s','base64','debug','[HTTP]','GET','forEach','string','picklist','type','nameField','customField','content','toString','idField','push','variable','variableName','customVariable','Variable','queue'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x0b6f,0x134));var _0xf0b6=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x0b6f[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0xf0b6('0x0'));var rp=require(_0xf0b6('0x1'));var md5=require(_0xf0b6('0x2'));var util=require(_0xf0b6('0x3'));var Redis=require(_0xf0b6('0x4'));var intUtil=require(_0xf0b6('0x5'));var config=require(_0xf0b6('0x6'));var logger=require(_0xf0b6('0x7'))(_0xf0b6('0x8'));config[_0xf0b6('0x9')]=_[_0xf0b6('0xa')](config[_0xf0b6('0x9')],{'host':_0xf0b6('0xb'),'port':0x18eb});var io=require(_0xf0b6('0xc'))(new Redis(config['redis']));var headers={'Content-Type':_0xf0b6('0xd'),'Accept':_0xf0b6('0xd')};function emit(_0x107647,_0x3b9b22,_0x2ed100){io['to'](_0x107647)[_0xf0b6('0xe')](_0x3b9b22,_0x2ed100);}function getTicket(_0x5f1976,_0x4a0da4,_0x9e2e1c,_0x2c930f,_0x2f88df){logger[_0xf0b6('0xf')](_0xf0b6('0x10'));var _0xaf935c=_[_0xf0b6('0x11')]({'responder_id':_0x4a0da4['id'],'requester_id':_0x9e2e1c['id'],'name':util[_0xf0b6('0x12')]('Caller\x20-\x20%s',_0x2f88df[_0xf0b6('0x13')]),'phone':_0x2f88df[_0xf0b6('0x14')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf0b6('0x15')](_0x2c930f['Subjects'],_0x2f88df,'\x20'),'description':intUtil[_0xf0b6('0x15')](_0x2c930f[_0xf0b6('0x16')],_0x2f88df,_0xf0b6('0x17')),'tags':getTags(_0x2c930f[_0xf0b6('0x18')],_0xf0b6('0x19'))},getCustomFields(_0x2c930f['Fields'],_0x2f88df));_0xaf935c[_0xf0b6('0x1a')]=_[_0xf0b6('0x1b')](_[_0xf0b6('0x1c')](_0xaf935c[_0xf0b6('0x1a')],'id'),_0xf0b6('0x1d'));return request({'uri':util[_0xf0b6('0x12')](_0xf0b6('0x1e'),_0x5f1976[_0xf0b6('0x1f')]),'method':_0xf0b6('0x20'),'body':_0xaf935c})[_0xf0b6('0x21')](function(_0x1a4c7c){logger[_0xf0b6('0xf')](_0xf0b6('0x22'));return _0x1a4c7c;});}function getUser(_0x3fd9f9,_0xe7b74d){if(intUtil['validateEmail'](_0xe7b74d)){return request({'uri':util[_0xf0b6('0x12')](_0xf0b6('0x23'),_0x3fd9f9[_0xf0b6('0x1f')]),'qs':{'email':_0xe7b74d}})['then'](function(_0x482620){if(_0x482620[_0xf0b6('0x24')]){logger[_0xf0b6('0xf')](_0xf0b6('0x25'));return _['find'](_0x482620,function(_0x2dde1b){return _0x2dde1b[_0xf0b6('0x26')]['email']===_0xe7b74d;});}else{logger[_0xf0b6('0xf')](_0xf0b6('0x27'));return request({'uri':util[_0xf0b6('0x12')](_0xf0b6('0x28'),_0x3fd9f9[_0xf0b6('0x1f')])})[_0xf0b6('0x21')](function(_0x2a3069){logger[_0xf0b6('0xf')](_0xf0b6('0x29'));return _0x2a3069;});}});}else{logger[_0xf0b6('0xf')](_0xf0b6('0x2a'));return request({'uri':util[_0xf0b6('0x12')](_0xf0b6('0x28'),_0x3fd9f9[_0xf0b6('0x1f')])})[_0xf0b6('0x21')](function(_0x487ab7){logger[_0xf0b6('0xf')]('Admin\x20account\x20selected.');return _0x487ab7;});}}function getEndUser(_0x58ccc6,_0x80a48b,_0x229916){logger[_0xf0b6('0xf')](_0xf0b6('0x2b'),_0x229916);return request({'uri':util[_0xf0b6('0x12')](_0xf0b6('0x2c'),_0x58ccc6[_0xf0b6('0x1f')]),'qs':{'phone':_0x229916}})[_0xf0b6('0x21')](function(_0xac0dc1){if(_0xac0dc1[_0xf0b6('0x24')]){logger[_0xf0b6('0xf')](_0xf0b6('0x2d'));return _[_0xf0b6('0x2e')](_0xac0dc1,{'phone':_0x229916});}else{logger[_0xf0b6('0xf')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xf0b6('0x12')](_0xf0b6('0x2c'),_0x58ccc6[_0xf0b6('0x1f')]),'method':_0xf0b6('0x20'),'body':{'name':_0x80a48b,'phone':_0x229916}})[_0xf0b6('0x21')](function(_0x40223f){logger[_0xf0b6('0xf')](_0xf0b6('0x2f'));return _0x40223f;});}});}function getAuth(_0x14ffd8){return util[_0xf0b6('0x12')](_0xf0b6('0x30'),new Buffer(_0x14ffd8['apiKey']+':X')['toString'](_0xf0b6('0x31')));}function request(_0x39e362){logger[_0xf0b6('0x32')](_0xf0b6('0x33'),JSON['stringify'](_0x39e362));return rp(_[_0xf0b6('0xa')](_0x39e362,{'method':_0xf0b6('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x500c2c,_0x447086){var _0x5f5bf8=[];if(_0x500c2c&&_0x500c2c[_0xf0b6('0x24')]>0x0){_0x5f5bf8=_['map'](_0x500c2c,_0x447086);}return _0x5f5bf8;}function getCustomFields(_0x39d76c,_0x46c374){var _0x130f02=[];var _0xee2e6f={'custom_fields':[]};if(_0x39d76c[_0xf0b6('0x24')]>0x0){_[_0xf0b6('0x35')](_0x39d76c,function(_0x5d84b6){if(_['includes']([_0xf0b6('0x36'),_0xf0b6('0x37')],_0x5d84b6[_0xf0b6('0x38')])&&_0x5d84b6[_0xf0b6('0x39')]&&!_0x5d84b6[_0xf0b6('0x3a')]){_0xee2e6f[_0x5d84b6[_0xf0b6('0x39')]['toLowerCase']()]=_0x5d84b6[_0xf0b6('0x3b')][_0xf0b6('0x3c')]();}else if(_['includes']([_0xf0b6('0x36'),_0xf0b6('0x37')],_0x5d84b6[_0xf0b6('0x38')])&&_0x5d84b6[_0xf0b6('0x3d')]&&_0x5d84b6[_0xf0b6('0x3a')]){_0xee2e6f[_0xf0b6('0x1a')][_0xf0b6('0x3e')]({'id':_0x5d84b6[_0xf0b6('0x3d')],'value':_0x5d84b6[_0xf0b6('0x3b')][_0xf0b6('0x3c')]()});}else if(_0x5d84b6['type']===_0xf0b6('0x3f')&&_0x5d84b6[_0xf0b6('0x40')]&&_0x5d84b6[_0xf0b6('0x3d')]&&_0x5d84b6[_0xf0b6('0x3a')]){_0x46c374[_0x5d84b6[_0xf0b6('0x40')]]&&_0xee2e6f['custom_fields']['push']({'id':_0x5d84b6[_0xf0b6('0x3d')],'value':_0x46c374[_0x5d84b6[_0xf0b6('0x40')]][_0xf0b6('0x3c')]()});}else if(_0x5d84b6['type']===_0xf0b6('0x41')&&_0x5d84b6[_0xf0b6('0x42')]&&_0x5d84b6[_0xf0b6('0x42')][_0xf0b6('0x19')]&&_0x5d84b6['idField']&&_0x5d84b6[_0xf0b6('0x3a')]){_0x46c374[_0x5d84b6[_0xf0b6('0x42')][_0xf0b6('0x19')]['toLowerCase']()]&&_0xee2e6f['custom_fields']['push']({'id':_0x5d84b6[_0xf0b6('0x3d')],'value':_0x46c374[_0x5d84b6[_0xf0b6('0x42')]['name']['toLowerCase']()][_0xf0b6('0x3c')]()});}});}return _0xee2e6f;}exports[_0xf0b6('0x43')]=function(_0x5746a2,_0x48824d,_0x4e2903,_0x2d01fa,_0xea25b9,_0x4d1ea4){var _0x5ba3fc,_0x6be13a;_0x4d1ea4[_0xf0b6('0x1f')]=intUtil[_0xf0b6('0x44')](_0x4d1ea4['remoteUri']);_0x4d1ea4[_0xf0b6('0x45')]=intUtil[_0xf0b6('0x44')](_0x4d1ea4[_0xf0b6('0x45')]);if(_0xea25b9&&_0xea25b9[_0xf0b6('0x46')]){logger[_0xf0b6('0xf')](_0xf0b6('0x47'),_0xf0b6('0x48'));_0x48824d[_0xf0b6('0x49')]=util[_0xf0b6('0x12')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d1ea4['serverUrl'],_0x48824d[_0xf0b6('0x4a')],md5(_0x48824d['uniqueid']));}else{_0x48824d[_0xf0b6('0x49')]='';}headers['Authorization']=getAuth(_0x4d1ea4);return getUser(_0x4d1ea4,_0x2d01fa['email'])[_0xf0b6('0x21')](function(_0x193a38){_0x5ba3fc=_0x193a38;logger[_0xf0b6('0xf')]('The\x20User\x20ID\x20is:',_0x5ba3fc['id']);return getEndUser(_0x4d1ea4,_0x48824d['calleridname'],_0x48824d['calleridnum']);})[_0xf0b6('0x21')](function(_0x25a384){_0x6be13a=_0x25a384;logger[_0xf0b6('0xf')](_0xf0b6('0x4b'),_0x6be13a['id']);return getTicket(_0x4d1ea4,_0x5ba3fc,_0x6be13a,_0x4e2903,_0x48824d);})[_0xf0b6('0x21')](function(_0x5a0efa){if(_0x5a0efa&&_0x5a0efa['id']){logger[_0xf0b6('0xf')](_0xf0b6('0x22'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x5a0efa['id']);logger[_0xf0b6('0xf')](_0xf0b6('0x47'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf0b6('0x12')](_0xf0b6('0x4c'),_0x2d01fa['name']),_0xf0b6('0x4d'),{'uri':util['format'](_0xf0b6('0x4e'),_0x4d1ea4[_0xf0b6('0x1f')],_0x5a0efa['id'])});}})[_0xf0b6('0x4f')](function(_0x21bfdb){logger[_0xf0b6('0x50')](_0xf0b6('0x47'),JSON[_0xf0b6('0x51')](_0x21bfdb));});};exports[_0xf0b6('0x52')]=function(_0x4ea695,_0x55b764,_0xa34e3c,_0x5a8f4d,_0x29146a,_0x335e57,_0x37631b){var _0x4c5195,_0x55cb70;_0x335e57['remoteUri']=intUtil[_0xf0b6('0x44')](_0x335e57[_0xf0b6('0x1f')]);_0x335e57[_0xf0b6('0x45')]=intUtil['stripTrailingSlash'](_0x335e57[_0xf0b6('0x45')]);if(_0x37631b&&_0x37631b[_0xf0b6('0x53')]&&_0x37631b['recordingFormat']!==_0xf0b6('0x54')){logger[_0xf0b6('0xf')]('[OUTBOUND]',_0xf0b6('0x48'));_0x55b764[_0xf0b6('0x49')]=util['format'](_0xf0b6('0x55'),_0x335e57[_0xf0b6('0x45')],_0x55b764[_0xf0b6('0x4a')],md5(_0x55b764[_0xf0b6('0x4a')]));}headers[_0xf0b6('0x56')]=getAuth(_0x335e57);return getUser(_0x335e57,_0x5a8f4d['email'])[_0xf0b6('0x21')](function(_0x4f33ba){_0x4c5195=_0x4f33ba;logger[_0xf0b6('0xf')](_0xf0b6('0x57'),_0x4c5195['id']);return getEndUser(_0x335e57,_0x55b764['destcalleridname'],_0x55b764['destcalleridnum']);})['then'](function(_0x280caa){_0x55cb70=_0x280caa;logger[_0xf0b6('0xf')]('The\x20Enduser\x20ID\x20is:',_0x55cb70['id']);return getTicket(_0x335e57,_0x4c5195,_0x55cb70,_0xa34e3c,_0x55b764);})[_0xf0b6('0x21')](function(_0x1b3e38){if(_0x1b3e38&&_0x1b3e38['id']){logger[_0xf0b6('0xf')]('Ticket\x20created!');logger[_0xf0b6('0xf')](_0xf0b6('0x58'),_0x1b3e38['id']);logger[_0xf0b6('0xf')](_0xf0b6('0x59'),_0xf0b6('0x5a'));emit(util[_0xf0b6('0x12')](_0xf0b6('0x4c'),_0x5a8f4d[_0xf0b6('0x19')]),'trigger:browser:url',{'uri':util['format'](_0xf0b6('0x4e'),_0x335e57[_0xf0b6('0x1f')],_0x1b3e38['id'])});}})[_0xf0b6('0x4f')](function(_0xd1b785){logger[_0xf0b6('0x50')](_0xf0b6('0x59'),JSON[_0xf0b6('0x51')](_0xd1b785));});};exports[_0xf0b6('0x5b')]=function(_0x3703c4,_0x1c074f,_0x324393,_0x2e4d2d,_0x382976,_0x1708cd){var _0x2c62e9,_0x278e88;_0x1708cd['remoteUri']=intUtil['stripTrailingSlash'](_0x1708cd[_0xf0b6('0x1f')]);_0x1708cd[_0xf0b6('0x45')]=intUtil[_0xf0b6('0x44')](_0x1708cd['serverUrl']);if(_0x382976&&_0x382976['monitor_format']){logger['info']('['+_0x1c074f[_0xf0b6('0x5c')][_0xf0b6('0x5d')]()+']',_0xf0b6('0x48'));_0x1c074f[_0xf0b6('0x49')]=util[_0xf0b6('0x12')](_0xf0b6('0x55'),_0x1708cd[_0xf0b6('0x45')],_0x1c074f[_0xf0b6('0x4a')],md5(_0x1c074f[_0xf0b6('0x4a')]));}else{_0x1c074f[_0xf0b6('0x49')]='';}headers[_0xf0b6('0x56')]=getAuth(_0x1708cd);return getUser(_0x1708cd,'')['then'](function(_0x3e2d1a){_0x2c62e9=_0x3e2d1a;logger[_0xf0b6('0xf')]('The\x20User\x20ID\x20is:',_0x2c62e9['id']);return getEndUser(_0x1708cd,_0x1c074f[_0xf0b6('0x13')],_0x1c074f[_0xf0b6('0x14')]);})[_0xf0b6('0x21')](function(_0x4ffa47){_0x278e88=_0x4ffa47;logger[_0xf0b6('0xf')]('The\x20Enduser\x20ID\x20is:',_0x278e88['id']);return getTicket(_0x1708cd,_0x2c62e9,_0x278e88,_0x324393,_0x1c074f);})[_0xf0b6('0x21')](function(_0x1cf5e2){if(_0x1cf5e2){logger[_0xf0b6('0xf')](_0xf0b6('0x22'));logger[_0xf0b6('0xf')]('The\x20Ticket\x20ID\x20is:',_0x1cf5e2['id']);}})['catch'](function(_0xcd2a35){logger[_0xf0b6('0x50')]('['+_0x1c074f[_0xf0b6('0x5c')][_0xf0b6('0x5d')]()+']',JSON[_0xf0b6('0x51')](_0xcd2a35));});}; \ No newline at end of file +var _0x378c=['nameField','includes','idField','push','variable','variableName','customField','customVariable','Variable','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','[OUTBOUND]','recordingURL','destcalleridname','catch','unmanaged','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','name','custom_fields','keyBy','value','%s/api/v2/tickets','Ticket\x20created!','%s/api/v2/agents','remoteUri','then','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','type'];(function(_0x114b93,_0x5a4f2d){var _0x52f08a=function(_0x222167){while(--_0x222167){_0x114b93['push'](_0x114b93['shift']());}};_0x52f08a(++_0x5a4f2d);}(_0x378c,0x137));var _0xc378=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x378c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc378('0x0'));var rp=require(_0xc378('0x1'));var md5=require('md5');var util=require(_0xc378('0x2'));var Redis=require(_0xc378('0x3'));var intUtil=require(_0xc378('0x4'));var config=require(_0xc378('0x5'));var logger=require('../../../../config/logger')('freshdesk');config[_0xc378('0x6')]=_[_0xc378('0x7')](config[_0xc378('0x6')],{'host':_0xc378('0x8'),'port':0x18eb});var io=require(_0xc378('0x9'))(new Redis(config[_0xc378('0x6')]));var headers={'Content-Type':_0xc378('0xa'),'Accept':_0xc378('0xa')};function emit(_0x38a935,_0x55b9e7,_0x18ebed){io['to'](_0x38a935)[_0xc378('0xb')](_0x55b9e7,_0x18ebed);}function getTicket(_0x3334f2,_0x1ff7c2,_0x524999,_0x4c4a20,_0xf4cc3d){logger[_0xc378('0xc')](_0xc378('0xd'));var _0x2b1e0d=_['merge']({'responder_id':_0x1ff7c2['id'],'requester_id':_0x524999['id'],'name':util[_0xc378('0xe')](_0xc378('0xf'),_0xf4cc3d[_0xc378('0x10')]),'phone':_0xf4cc3d[_0xc378('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xc378('0x12')](_0x4c4a20[_0xc378('0x13')],_0xf4cc3d,'\x20'),'description':intUtil[_0xc378('0x12')](_0x4c4a20[_0xc378('0x14')],_0xf4cc3d,'
'),'tags':getTags(_0x4c4a20[_0xc378('0x15')],_0xc378('0x16'))},getCustomFields(_0x4c4a20['Fields'],_0xf4cc3d));_0x2b1e0d[_0xc378('0x17')]=_['mapValues'](_[_0xc378('0x18')](_0x2b1e0d['custom_fields'],'id'),_0xc378('0x19'));return request({'uri':util[_0xc378('0xe')](_0xc378('0x1a'),_0x3334f2['remoteUri']),'method':'POST','body':_0x2b1e0d})['then'](function(_0x5ee70b){logger['info'](_0xc378('0x1b'));return _0x5ee70b;});}function getUser(_0x5778aa,_0x2338d0){if(intUtil['validateEmail'](_0x2338d0)){return request({'uri':util[_0xc378('0xe')](_0xc378('0x1c'),_0x5778aa[_0xc378('0x1d')]),'qs':{'email':_0x2338d0}})[_0xc378('0x1e')](function(_0x228907){if(_0x228907[_0xc378('0x1f')]){logger[_0xc378('0xc')](_0xc378('0x20'));return _[_0xc378('0x21')](_0x228907,function(_0xbbe24a){return _0xbbe24a['contact'][_0xc378('0x22')]===_0x2338d0;});}else{logger['info'](_0xc378('0x23'));return request({'uri':util[_0xc378('0xe')]('%s/api/v2/agents/me',_0x5778aa[_0xc378('0x1d')])})[_0xc378('0x1e')](function(_0x44a8e9){logger['info']('Admin\x20account\x20selected.');return _0x44a8e9;});}});}else{logger[_0xc378('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xc378('0xe')](_0xc378('0x24'),_0x5778aa[_0xc378('0x1d')])})[_0xc378('0x1e')](function(_0x53c48a){logger[_0xc378('0xc')](_0xc378('0x25'));return _0x53c48a;});}}function getEndUser(_0x51fa04,_0x524a59,_0xac88f3){logger[_0xc378('0xc')](_0xc378('0x26'),_0xac88f3);return request({'uri':util['format'](_0xc378('0x27'),_0x51fa04['remoteUri']),'qs':{'phone':_0xac88f3}})[_0xc378('0x1e')](function(_0x5a1241){if(_0x5a1241[_0xc378('0x1f')]){logger['info'](_0xc378('0x28'));return _['find'](_0x5a1241,{'phone':_0xac88f3});}else{logger[_0xc378('0xc')](_0xc378('0x29'));return request({'uri':util[_0xc378('0xe')](_0xc378('0x27'),_0x51fa04[_0xc378('0x1d')]),'method':_0xc378('0x2a'),'body':{'name':_0x524a59,'phone':_0xac88f3}})[_0xc378('0x1e')](function(_0x42c0b8){logger[_0xc378('0xc')](_0xc378('0x2b'));return _0x42c0b8;});}});}function getAuth(_0x5b7b11){return util[_0xc378('0xe')](_0xc378('0x2c'),new Buffer(_0x5b7b11[_0xc378('0x2d')]+':X')[_0xc378('0x2e')](_0xc378('0x2f')));}function request(_0x538a27){logger[_0xc378('0x30')](_0xc378('0x31'),JSON[_0xc378('0x32')](_0x538a27));return rp(_[_0xc378('0x7')](_0x538a27,{'method':_0xc378('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x28d6a5,_0x1ee3e0){var _0x1de211=[];if(_0x28d6a5&&_0x28d6a5[_0xc378('0x1f')]>0x0){_0x1de211=_[_0xc378('0x34')](_0x28d6a5,_0x1ee3e0);}return _0x1de211;}function getCustomFields(_0x347297,_0x5ededa){var _0x2ba3d2=[];var _0x5a1f7b={'custom_fields':[]};if(_0x347297[_0xc378('0x1f')]>0x0){_[_0xc378('0x35')](_0x347297,function(_0x356606){if(_['includes']([_0xc378('0x36'),_0xc378('0x37')],_0x356606[_0xc378('0x38')])&&_0x356606[_0xc378('0x39')]&&!_0x356606['customField']){_0x5a1f7b[_0x356606[_0xc378('0x39')]['toLowerCase']()]=_0x356606['content'][_0xc378('0x2e')]();}else if(_[_0xc378('0x3a')]([_0xc378('0x36'),'picklist'],_0x356606['type'])&&_0x356606[_0xc378('0x3b')]&&_0x356606['customField']){_0x5a1f7b[_0xc378('0x17')][_0xc378('0x3c')]({'id':_0x356606[_0xc378('0x3b')],'value':_0x356606['content'][_0xc378('0x2e')]()});}else if(_0x356606[_0xc378('0x38')]===_0xc378('0x3d')&&_0x356606[_0xc378('0x3e')]&&_0x356606[_0xc378('0x3b')]&&_0x356606[_0xc378('0x3f')]){_0x5ededa[_0x356606[_0xc378('0x3e')]]&&_0x5a1f7b['custom_fields'][_0xc378('0x3c')]({'id':_0x356606[_0xc378('0x3b')],'value':_0x5ededa[_0x356606[_0xc378('0x3e')]][_0xc378('0x2e')]()});}else if(_0x356606[_0xc378('0x38')]===_0xc378('0x40')&&_0x356606[_0xc378('0x41')]&&_0x356606[_0xc378('0x41')][_0xc378('0x16')]&&_0x356606[_0xc378('0x3b')]&&_0x356606[_0xc378('0x3f')]){_0x5ededa[_0x356606[_0xc378('0x41')][_0xc378('0x16')][_0xc378('0x42')]()]&&_0x5a1f7b[_0xc378('0x17')][_0xc378('0x3c')]({'id':_0x356606['idField'],'value':_0x5ededa[_0x356606[_0xc378('0x41')][_0xc378('0x16')][_0xc378('0x42')]()]['toString']()});}});}return _0x5a1f7b;}exports['queue']=function(_0x4eac3c,_0x351c9f,_0x2a2a25,_0x4bc013,_0x15c232,_0x5b70fa){var _0x10e614,_0x34f76f;_0x5b70fa[_0xc378('0x1d')]=intUtil[_0xc378('0x43')](_0x5b70fa[_0xc378('0x1d')]);_0x5b70fa[_0xc378('0x44')]=intUtil['stripTrailingSlash'](_0x5b70fa[_0xc378('0x44')]);if(_0x15c232&&_0x15c232[_0xc378('0x45')]){logger[_0xc378('0xc')](_0xc378('0x46'),_0xc378('0x47'));_0x351c9f['recordingURL']=util[_0xc378('0xe')](_0xc378('0x48'),_0x5b70fa['serverUrl'],_0x351c9f['uniqueid'],md5(_0x351c9f[_0xc378('0x49')]));}else{_0x351c9f['recordingURL']='';}headers[_0xc378('0x4a')]=getAuth(_0x5b70fa);return getUser(_0x5b70fa,_0x4bc013['email'])[_0xc378('0x1e')](function(_0x23bb10){_0x10e614=_0x23bb10;logger[_0xc378('0xc')](_0xc378('0x4b'),_0x10e614['id']);return getEndUser(_0x5b70fa,_0x351c9f[_0xc378('0x10')],_0x351c9f[_0xc378('0x11')]);})[_0xc378('0x1e')](function(_0x2dc35b){_0x34f76f=_0x2dc35b;logger[_0xc378('0xc')](_0xc378('0x4c'),_0x34f76f['id']);return getTicket(_0x5b70fa,_0x10e614,_0x34f76f,_0x2a2a25,_0x351c9f);})[_0xc378('0x1e')](function(_0x3e5f8a){if(_0x3e5f8a&&_0x3e5f8a['id']){logger['info'](_0xc378('0x1b'));logger[_0xc378('0xc')](_0xc378('0x4d'),_0x3e5f8a['id']);logger['info']('[QUEUE]',_0xc378('0x4e'));emit(util[_0xc378('0xe')](_0xc378('0x4f'),_0x4bc013[_0xc378('0x16')]),_0xc378('0x50'),{'uri':util[_0xc378('0xe')](_0xc378('0x51'),_0x5b70fa[_0xc378('0x1d')],_0x3e5f8a['id'])});}})['catch'](function(_0x329d56){logger[_0xc378('0x52')]('[QUEUE]',JSON[_0xc378('0x32')](_0x329d56));});};exports[_0xc378('0x53')]=function(_0x2c1c9f,_0x884c14,_0xe329b4,_0x531446,_0x5aa438,_0x14c4be,_0x1f455d){var _0x9096a5,_0x172184;_0x14c4be['remoteUri']=intUtil[_0xc378('0x43')](_0x14c4be[_0xc378('0x1d')]);_0x14c4be[_0xc378('0x44')]=intUtil[_0xc378('0x43')](_0x14c4be[_0xc378('0x44')]);if(_0x1f455d&&_0x1f455d[_0xc378('0x54')]&&_0x1f455d[_0xc378('0x54')]!=='none'){logger[_0xc378('0xc')](_0xc378('0x55'),_0xc378('0x47'));_0x884c14[_0xc378('0x56')]=util[_0xc378('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x14c4be['serverUrl'],_0x884c14[_0xc378('0x49')],md5(_0x884c14[_0xc378('0x49')]));}headers[_0xc378('0x4a')]=getAuth(_0x14c4be);return getUser(_0x14c4be,_0x531446[_0xc378('0x22')])[_0xc378('0x1e')](function(_0x397ed4){_0x9096a5=_0x397ed4;logger[_0xc378('0xc')]('The\x20User\x20ID\x20is:',_0x9096a5['id']);return getEndUser(_0x14c4be,_0x884c14[_0xc378('0x57')],_0x884c14['destcalleridnum']);})[_0xc378('0x1e')](function(_0x11e8c4){_0x172184=_0x11e8c4;logger[_0xc378('0xc')](_0xc378('0x4c'),_0x172184['id']);return getTicket(_0x14c4be,_0x9096a5,_0x172184,_0xe329b4,_0x884c14);})['then'](function(_0x548cbd){if(_0x548cbd&&_0x548cbd['id']){logger['info'](_0xc378('0x1b'));logger['info'](_0xc378('0x4d'),_0x548cbd['id']);logger[_0xc378('0xc')]('[OUTBOUND]',_0xc378('0x4e'));emit(util[_0xc378('0xe')](_0xc378('0x4f'),_0x531446[_0xc378('0x16')]),'trigger:browser:url',{'uri':util[_0xc378('0xe')]('%s/helpdesk/tickets/%d',_0x14c4be[_0xc378('0x1d')],_0x548cbd['id'])});}})[_0xc378('0x58')](function(_0x4722df){logger['error']('[OUTBOUND]',JSON[_0xc378('0x32')](_0x4722df));});};exports[_0xc378('0x59')]=function(_0x453b31,_0x30ba7e,_0x41d4c8,_0x47bc1d,_0x3410c1,_0x17f733){var _0x4f746f,_0x55311a;_0x17f733['remoteUri']=intUtil[_0xc378('0x43')](_0x17f733[_0xc378('0x1d')]);_0x17f733['serverUrl']=intUtil[_0xc378('0x43')](_0x17f733[_0xc378('0x44')]);if(_0x3410c1&&_0x3410c1['monitor_format']){logger['info']('['+_0x30ba7e[_0xc378('0x5a')]['toUpperCase']()+']',_0xc378('0x47'));_0x30ba7e['recordingURL']=util[_0xc378('0xe')](_0xc378('0x48'),_0x17f733['serverUrl'],_0x30ba7e['uniqueid'],md5(_0x30ba7e[_0xc378('0x49')]));}else{_0x30ba7e['recordingURL']='';}headers['Authorization']=getAuth(_0x17f733);return getUser(_0x17f733,'')[_0xc378('0x1e')](function(_0x3bc76f){_0x4f746f=_0x3bc76f;logger[_0xc378('0xc')](_0xc378('0x4b'),_0x4f746f['id']);return getEndUser(_0x17f733,_0x30ba7e[_0xc378('0x10')],_0x30ba7e[_0xc378('0x11')]);})[_0xc378('0x1e')](function(_0x58a1d5){_0x55311a=_0x58a1d5;logger[_0xc378('0xc')](_0xc378('0x4c'),_0x55311a['id']);return getTicket(_0x17f733,_0x4f746f,_0x55311a,_0x41d4c8,_0x30ba7e);})['then'](function(_0x4bdfa1){if(_0x4bdfa1){logger[_0xc378('0xc')](_0xc378('0x1b'));logger[_0xc378('0xc')](_0xc378('0x4d'),_0x4bdfa1['id']);}})[_0xc378('0x58')](function(_0x3ce65f){logger[_0xc378('0x52')]('['+_0x30ba7e[_0xc378('0x5a')][_0xc378('0x5b')]()+']',JSON['stringify'](_0x3ce65f));});}; \ 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 2d8fc10..e2d3c1e 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 _0xed5f=['error','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','User\x20found:','userId','userEmail','adminEmail','toUpperCase','/api/lookup?q=','&f=','&entities=contact','contacts','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Descriptions','ticketId','task','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xed5f,0x1e6));var _0xfed5=function(_0x595106,_0x1cc044){_0x595106=_0x595106-0x0;var _0x595691=_0xed5f[_0x595106];return _0x595691;};'use strict';var _=require('lodash');var rp=require(_0xfed5('0x0'));var md5=require(_0xfed5('0x1'));var util=require(_0xfed5('0x2'));var moment=require('moment');var Promise=require(_0xfed5('0x3'));var Redis=require(_0xfed5('0x4'));var intUtil=require(_0xfed5('0x5'));var config=require(_0xfed5('0x6'));var logger=require('../../../../config/logger')(_0xfed5('0x7'));config[_0xfed5('0x8')]=_[_0xfed5('0x9')](config['redis'],{'host':_0xfed5('0xa'),'port':0x18eb});var io=require(_0xfed5('0xb'))(new Redis(config['redis']));function getAdminId(_0x299fb6,_0x4422e5,_0x1ea3c7,_0x314fa2){return new Promise(function(_0x38b02a,_0x2578c8){var _0x4443d8=![];var _0x445dd3={'method':_0xfed5('0xc'),'uri':_0x314fa2+_0xfed5('0xd'),'json':!![]};_0x445dd3[_0xfed5('0xe')]=_0x1ea3c7;logger[_0xfed5('0xf')]('Getting\x20admin\x20information');return rp(_0x445dd3)[_0xfed5('0x10')](function(_0xc02c5b){if(_0xc02c5b){var _0x3f2818=_0xc02c5b[_0xfed5('0x11')];var _0x4c6029=null;for(_0x4c6029=0x0;_0x4c6029<_0x3f2818[_0xfed5('0x12')];_0x4c6029++){if(_0x3f2818[_0x4c6029][_0xfed5('0x13')]===_0x299fb6['adminEmail']){_0x299fb6[_0xfed5('0x14')]=_0x3f2818[_0x4c6029]['id'];_0x4443d8=!![];}}if(_0x4443d8){logger[_0xfed5('0xf')](_0xfed5('0x15'),_0x299fb6[_0xfed5('0x14')]);_0x38b02a(_0x299fb6);}else{_0x2578c8({'statusCode':0x194,'message':_0xfed5('0x16')});}}else{_0x2578c8({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xfed5('0x17')](function(_0x53a3ed){logger[_0xfed5('0x18')]('['+[_0x4422e5['toUpperCase']()]+']',_0x53a3ed[_0xfed5('0x19')]);_0x2578c8(_0x53a3ed);});});}function getUser(_0x1a7990,_0x2a269f,_0x7688e8){return function(_0x3a0656){return new Promise(function(_0x1264cb,_0x35004e){var _0x3791fd={'method':_0xfed5('0xc'),'uri':_0x7688e8+_0xfed5('0xd'),'json':!![]};_0x3791fd[_0xfed5('0xe')]=_0x2a269f;logger[_0xfed5('0xf')](_0xfed5('0x1a'));return rp(_0x3791fd)[_0xfed5('0x10')](function(_0x50b640){if(_0x50b640){var _0x770d=_0x50b640['users'];var _0x3eff4b=![];var _0x201f79=null;if(_0x3a0656[_0xfed5('0x1b')]!==null){logger[_0xfed5('0xf')](_0xfed5('0x1c'),_0x3a0656[_0xfed5('0x1b')]);_0x3a0656['userEmail']=_0x3a0656[_0xfed5('0x1b')];for(_0x201f79=0x0;_0x201f79<_0x770d['length'];_0x201f79++){if(_0x770d[_0x201f79]['email']===_0x3a0656[_0xfed5('0x1b')]){_0x3eff4b=!![];_0x3a0656['userId']=_0x770d[_0x201f79]['id'];logger['info'](_0xfed5('0x1d'),_0x3a0656[_0xfed5('0x1e')]);}}}if(!_0x3eff4b){logger[_0xfed5('0xf')]('Admin\x20selected');_0x3a0656[_0xfed5('0x1f')]=_0x3a0656[_0xfed5('0x20')];_0x3a0656[_0xfed5('0x1e')]=_0x3a0656['adminId'];_0x3eff4b=!![];}if(_0x3eff4b){_0x1264cb(_0x3a0656);}else{_0x35004e({'statusCode':0x194,'message':_0xfed5('0x16')});}}else{_0x35004e({'statusCode':0x194,'message':_0xfed5('0x16')});}})['catch'](function(_0x298d40){logger['error']('['+[_0x1a7990[_0xfed5('0x21')]()]+']',_0x298d40[_0xfed5('0x19')]);_0x35004e(_0x298d40);});});};}function searchContact(_0x2268ba,_0x46e107,_0x4ee045,_0x12d991){return new Promise(function(_0x3793b5,_0x50dae4){var _0x2cde84={'method':_0xfed5('0xc'),'headers':_0x46e107,'uri':_0x2268ba+_0xfed5('0x22')+_0x12d991+_0xfed5('0x23')+_0x4ee045+_0xfed5('0x24'),'json':!![]};rp(_0x2cde84)[_0xfed5('0x10')](function(_0x332baa){var _0x213dbd=_['find'](_0x332baa['contacts'][_0xfed5('0x25')],[_0x4ee045,_0x12d991]);_0x3793b5(_0x213dbd);})[_0xfed5('0x17')](function(_0x54af65){_0x50dae4(_0x54af65);});});}function getEndUser(_0x1959c6,_0xd64d8a,_0x44d767){return function(_0x32eca8){return new Promise(function(_0x532ad4,_0x3639a4){logger[_0xfed5('0xf')](util['format'](_0xfed5('0x26'),_0x32eca8['contactNumber']));searchContact(_0x44d767,_0xd64d8a,_0xfed5('0x27'),_0x32eca8[_0xfed5('0x28')])[_0xfed5('0x10')](function(_0x189f91){if(_0x189f91){_0x32eca8[_0xfed5('0x29')]=_0x189f91['id'];logger[_0xfed5('0xf')](_0xfed5('0x2a'),_0x32eca8[_0xfed5('0x29')]);return _0x532ad4(_0x32eca8);}searchContact(_0x44d767,_0xd64d8a,_0xfed5('0x2b'),_0x32eca8[_0xfed5('0x28')])['then'](function(_0x300055){if(_0x300055){_0x32eca8[_0xfed5('0x29')]=_0x300055['id'];logger[_0xfed5('0xf')](_0xfed5('0x2c'),_0x32eca8['endUserId']);return _0x532ad4(_0x32eca8);}createEndUser(_0x32eca8,_0x1959c6,_0xd64d8a,_0x44d767)[_0xfed5('0x10')](function(_0x23eb77){logger[_0xfed5('0xf')](_0xfed5('0x2d'),_0x23eb77[_0xfed5('0x29')]);return _0x532ad4(_0x23eb77);});});})[_0xfed5('0x17')](function(_0x1f870d){_0x3639a4(_0x1f870d);});});};}function createEndUser(_0x3a9418,_0xd8b9f0,_0x274af4,_0x2163fd){return new Promise(function(_0x2dfc00,_0x1f6dcb){var _0x41b478=moment();var _0x57a1d5={'method':_0xfed5('0x2e'),'uri':_0x2163fd+_0xfed5('0x2f'),'body':{'contact':{'last_name':_0x3a9418['contactNumber'],'work_number':_0x3a9418[_0xfed5('0x28')],'mobile_number':_0x3a9418[_0xfed5('0x28')],'owner_id':_0x3a9418[_0xfed5('0x1e')],'created_at':_0x41b478[_0xfed5('0x30')](_0xfed5('0x31'))}},'json':!![]};_0x57a1d5['headers']=_0x274af4;logger[_0xfed5('0xf')](_0xfed5('0x32'));return rp(_0x57a1d5)[_0xfed5('0x10')](function(_0x5d017b){_0x3a9418[_0xfed5('0x29')]=_0x5d017b[_0xfed5('0x33')]['id'];_0x2dfc00(_0x3a9418);})[_0xfed5('0x17')](function(_0x237eb0){logger[_0xfed5('0x18')]('['+[_0xd8b9f0[_0xfed5('0x21')]()]+']',_0x237eb0[_0xfed5('0x19')]);_0x1f6dcb(_0x237eb0['message']);});});}function getTicket(_0x171e9e,_0x25b3ee,_0x5be9e3,_0x21f0fe,_0x2e2e56){return function(_0x135984){logger[_0xfed5('0xf')]('Creating\x20new\x20task');return new Promise(function(_0x1a299c,_0x476801){var _0x2cd60f=moment();var _0xaa9c37={'method':_0xfed5('0x2e'),'uri':_0x5be9e3+_0xfed5('0x34'),'body':{'title':intUtil[_0xfed5('0x35')](_0x21f0fe[_0xfed5('0x36')],_0x2e2e56,'\x20'),'description':intUtil[_0xfed5('0x35')](_0x21f0fe[_0xfed5('0x37')],_0x2e2e56,'\x0a'),'owner_id':_0x135984['userId'],'creater_id':_0x135984['adminId'],'targetable_id':_0x135984['endUserId'],'targetable_type':'Contact','created_at':_0x2cd60f[_0xfed5('0x30')](_0xfed5('0x31')),'due_date':_0x2cd60f['add'](0x1e,'m')[_0xfed5('0x30')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0xaa9c37[_0xfed5('0xe')]=_0x25b3ee;return rp(_0xaa9c37)[_0xfed5('0x10')](function(_0x4046ce){_0x135984[_0xfed5('0x38')]=_0x4046ce[_0xfed5('0x39')]['id'];logger[_0xfed5('0xf')]('Task\x20created:',_0x135984[_0xfed5('0x38')]);_0x1a299c(_0x135984);})[_0xfed5('0x17')](function(_0xfaf9be){logger[_0xfed5('0x18')]('['+[_0x171e9e[_0xfed5('0x21')]()]+']',_0xfaf9be['message']);_0x476801(_0xfaf9be[_0xfed5('0x19')]);});});};}function emit(_0xd18bcb,_0x217b0d,_0x59100f){var _0x350baa={'uri':_0xd18bcb+'/contacts/'+_0x59100f};io['to'](util['format'](_0xfed5('0x3a'),_0x217b0d))[_0xfed5('0x3b')](_0xfed5('0x3c'),_0x350baa);}exports['cs']=function(_0x4e25c9,_0x11eb11,_0x13779e,_0x7609b1,_0x2ff7be,_0x37da9d,_0x4d9c47,_0x2f451d){var _0x5f31cf={};var _0x37d98c={'Authorization':_0xfed5('0x3d')+_0x37da9d[_0xfed5('0x3e')]};_0x37da9d[_0xfed5('0x3f')]=intUtil['stripTrailingSlash'](_0x37da9d['remoteUri']);_0x37da9d['serverUrl']=intUtil[_0xfed5('0x40')](_0x37da9d[_0xfed5('0x41')]);var _0x29964f=_0x37da9d[_0xfed5('0x3f')];_0x5f31cf[_0xfed5('0x20')]=_0x37da9d[_0xfed5('0x42')];_0x5f31cf[_0xfed5('0x28')]=_0x2f451d[_0xfed5('0x43')]()===_0xfed5('0x44')?_0x11eb11[_0xfed5('0x45')]:_0x11eb11[_0xfed5('0x46')];_0x5f31cf[_0xfed5('0x47')]=_0x2f451d===_0xfed5('0x48')||_0x2f451d===_0xfed5('0x49')?'queue':'outbound';if(_0x7609b1){_0x5f31cf[_0xfed5('0x1b')]=_0x7609b1[_0xfed5('0x13')];}var _0x33dbe7=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x37da9d[_0xfed5('0x41')],_0x11eb11[_0xfed5('0x4a')],md5(_0x11eb11[_0xfed5('0x4a')]));if(_0x2ff7be&&_0x2ff7be[_0xfed5('0x4b')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x11eb11[_0xfed5('0x4c')]=_0x33dbe7;}else if(_0x4d9c47&&_0x4d9c47[_0xfed5('0x4d')]&&_0x4d9c47[_0xfed5('0x4d')]!==_0xfed5('0x4e')){logger[_0xfed5('0xf')](_0xfed5('0x4f'),_0xfed5('0x50'));_0x11eb11[_0xfed5('0x4c')]=_0x33dbe7;}else{_0x11eb11[_0xfed5('0x4c')]='';}return getAdminId(_0x5f31cf,_0x2f451d,_0x37d98c,_0x29964f)[_0xfed5('0x10')](getUser(_0x2f451d,_0x37d98c,_0x29964f))[_0xfed5('0x10')](getEndUser(_0x2f451d,_0x37d98c,_0x29964f))[_0xfed5('0x10')](getTicket(_0x2f451d,_0x37d98c,_0x29964f,_0x13779e,_0x11eb11))[_0xfed5('0x10')](function(_0x115b20){logger[_0xfed5('0xf')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x115b20[_0xfed5('0x38')]));if(_0x2f451d!==_0xfed5('0x49')){logger[_0xfed5('0xf')]('['+[_0x2f451d[_0xfed5('0x21')]()]+']',_0xfed5('0x51'));emit(_0x29964f,_0x7609b1[_0xfed5('0x52')],_0x115b20[_0xfed5('0x29')]);}})[_0xfed5('0x17')](function(_0x2d3da1){logger[_0xfed5('0x18')]('['+[_0x2f451d[_0xfed5('0x21')]()]+_0xfed5('0x53'),util[_0xfed5('0x54')](_0x2d3da1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x16cc=['Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','add','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','remoteUri','serverUrl','stripTrailingSlash','username','outbound','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','/api/selector/owners','headers','info','users','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','GET','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','email','userId','/api/lookup?q=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','Contact\x20found\x20mobile_number:','endUserId','work_number'];(function(_0x17b4a9,_0x2a440b){var _0x485859=function(_0x5ae014){while(--_0x5ae014){_0x17b4a9['push'](_0x17b4a9['shift']());}};_0x485859(++_0x2a440b);}(_0x16cc,0x120));var _0xc16c=function(_0x139851,_0x5f1fc0){_0x139851=_0x139851-0x0;var _0x115ea8=_0x16cc[_0x139851];return _0x115ea8;};'use strict';var _=require('lodash');var rp=require(_0xc16c('0x0'));var md5=require(_0xc16c('0x1'));var util=require(_0xc16c('0x2'));var moment=require(_0xc16c('0x3'));var Promise=require(_0xc16c('0x4'));var Redis=require(_0xc16c('0x5'));var intUtil=require(_0xc16c('0x6'));var config=require('../../../../config/environment');var logger=require(_0xc16c('0x7'))(_0xc16c('0x8'));config[_0xc16c('0x9')]=_[_0xc16c('0xa')](config['redis'],{'host':_0xc16c('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc16c('0x9')]));function getAdminId(_0x14d607,_0x37b245,_0x22ba35,_0x583c25){return new Promise(function(_0x27f3e6,_0x286c40){var _0x3f3ff4=![];var _0x462dcf={'method':'GET','uri':_0x583c25+_0xc16c('0xc'),'json':!![]};_0x462dcf[_0xc16c('0xd')]=_0x22ba35;logger[_0xc16c('0xe')]('Getting\x20admin\x20information');return rp(_0x462dcf)['then'](function(_0x333748){if(_0x333748){var _0x2cf236=_0x333748[_0xc16c('0xf')];var _0x5265f7=null;for(_0x5265f7=0x0;_0x5265f7<_0x2cf236['length'];_0x5265f7++){if(_0x2cf236[_0x5265f7]['email']===_0x14d607[_0xc16c('0x10')]){_0x14d607[_0xc16c('0x11')]=_0x2cf236[_0x5265f7]['id'];_0x3f3ff4=!![];}}if(_0x3f3ff4){logger[_0xc16c('0xe')](_0xc16c('0x12'),_0x14d607[_0xc16c('0x11')]);_0x27f3e6(_0x14d607);}else{_0x286c40({'statusCode':0x194,'message':_0xc16c('0x13')});}}else{_0x286c40({'statusCode':0x194,'message':_0xc16c('0x13')});}})[_0xc16c('0x14')](function(_0x200ec0){logger[_0xc16c('0x15')]('['+[_0x37b245[_0xc16c('0x16')]()]+']',_0x200ec0[_0xc16c('0x17')]);_0x286c40(_0x200ec0);});});}function getUser(_0x2818e,_0x2bf102,_0x431255){return function(_0x5535ee){return new Promise(function(_0x509e6b,_0x9017b2){var _0x201360={'method':_0xc16c('0x18'),'uri':_0x431255+_0xc16c('0xc'),'json':!![]};_0x201360[_0xc16c('0xd')]=_0x2bf102;logger[_0xc16c('0xe')](_0xc16c('0x19'));return rp(_0x201360)[_0xc16c('0x1a')](function(_0x55dc03){if(_0x55dc03){var _0x4770d2=_0x55dc03[_0xc16c('0xf')];var _0x121da2=![];var _0x290e9=null;if(_0x5535ee[_0xc16c('0x1b')]!==null){logger[_0xc16c('0xe')](_0xc16c('0x1c'),_0x5535ee[_0xc16c('0x1b')]);_0x5535ee[_0xc16c('0x1d')]=_0x5535ee[_0xc16c('0x1b')];for(_0x290e9=0x0;_0x290e9<_0x4770d2[_0xc16c('0x1e')];_0x290e9++){if(_0x4770d2[_0x290e9][_0xc16c('0x1f')]===_0x5535ee[_0xc16c('0x1b')]){_0x121da2=!![];_0x5535ee[_0xc16c('0x20')]=_0x4770d2[_0x290e9]['id'];logger[_0xc16c('0xe')]('User\x20found:',_0x5535ee['userId']);}}}if(!_0x121da2){logger[_0xc16c('0xe')]('Admin\x20selected');_0x5535ee[_0xc16c('0x1d')]=_0x5535ee[_0xc16c('0x10')];_0x5535ee['userId']=_0x5535ee[_0xc16c('0x11')];_0x121da2=!![];}if(_0x121da2){_0x509e6b(_0x5535ee);}else{_0x9017b2({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x9017b2({'statusCode':0x194,'message':_0xc16c('0x13')});}})[_0xc16c('0x14')](function(_0x5c57d4){logger[_0xc16c('0x15')]('['+[_0x2818e[_0xc16c('0x16')]()]+']',_0x5c57d4[_0xc16c('0x17')]);_0x9017b2(_0x5c57d4);});});};}function searchContact(_0x536bf1,_0x403c67,_0x29c413,_0x49d11e){return new Promise(function(_0x177622,_0x1457d4){var _0x4c25c7={'method':'GET','headers':_0x403c67,'uri':_0x536bf1+_0xc16c('0x21')+_0x49d11e+'&f='+_0x29c413+_0xc16c('0x22'),'json':!![]};rp(_0x4c25c7)[_0xc16c('0x1a')](function(_0x11805c){var _0x4f1889=_[_0xc16c('0x23')](_0x11805c[_0xc16c('0x24')][_0xc16c('0x24')],[_0x29c413,_0x49d11e]);_0x177622(_0x4f1889);})[_0xc16c('0x14')](function(_0xff021a){_0x1457d4(_0xff021a);});});}function getEndUser(_0x33f931,_0x154800,_0xe62e1e){return function(_0x2f28c1){return new Promise(function(_0x2687ec,_0x2b3d6d){logger[_0xc16c('0xe')](util[_0xc16c('0x25')](_0xc16c('0x26'),_0x2f28c1['contactNumber']));searchContact(_0xe62e1e,_0x154800,_0xc16c('0x27'),_0x2f28c1[_0xc16c('0x28')])[_0xc16c('0x1a')](function(_0x5c2d5b){if(_0x5c2d5b){_0x2f28c1['endUserId']=_0x5c2d5b['id'];logger['info'](_0xc16c('0x29'),_0x2f28c1[_0xc16c('0x2a')]);return _0x2687ec(_0x2f28c1);}searchContact(_0xe62e1e,_0x154800,_0xc16c('0x2b'),_0x2f28c1[_0xc16c('0x28')])[_0xc16c('0x1a')](function(_0xfc8552){if(_0xfc8552){_0x2f28c1[_0xc16c('0x2a')]=_0xfc8552['id'];logger[_0xc16c('0xe')](_0xc16c('0x2c'),_0x2f28c1['endUserId']);return _0x2687ec(_0x2f28c1);}createEndUser(_0x2f28c1,_0x33f931,_0x154800,_0xe62e1e)['then'](function(_0x754b07){logger[_0xc16c('0xe')](_0xc16c('0x2d'),_0x754b07[_0xc16c('0x2a')]);return _0x2687ec(_0x754b07);});});})[_0xc16c('0x14')](function(_0x13885f){_0x2b3d6d(_0x13885f);});});};}function createEndUser(_0x5309d6,_0x26581e,_0x20467e,_0x46b0d4){return new Promise(function(_0x1c170f,_0x4f233e){var _0xce0c1=moment();var _0x1255f9={'method':_0xc16c('0x2e'),'uri':_0x46b0d4+_0xc16c('0x2f'),'body':{'contact':{'last_name':_0x5309d6[_0xc16c('0x28')],'work_number':_0x5309d6[_0xc16c('0x28')],'mobile_number':_0x5309d6['contactNumber'],'owner_id':_0x5309d6[_0xc16c('0x20')],'created_at':_0xce0c1[_0xc16c('0x25')](_0xc16c('0x30'))}},'json':!![]};_0x1255f9[_0xc16c('0xd')]=_0x20467e;logger[_0xc16c('0xe')](_0xc16c('0x31'));return rp(_0x1255f9)[_0xc16c('0x1a')](function(_0x93f257){_0x5309d6[_0xc16c('0x2a')]=_0x93f257[_0xc16c('0x32')]['id'];_0x1c170f(_0x5309d6);})[_0xc16c('0x14')](function(_0x390ada){logger[_0xc16c('0x15')]('['+[_0x26581e[_0xc16c('0x16')]()]+']',_0x390ada[_0xc16c('0x17')]);_0x4f233e(_0x390ada[_0xc16c('0x17')]);});});}function getTicket(_0x241618,_0x42a1de,_0x4cac46,_0x1d5147,_0x5c91ea){return function(_0x46becc){logger['info'](_0xc16c('0x33'));return new Promise(function(_0x5bbcde,_0x4589ac){var _0x54ff19=moment();var _0x269185={'method':'POST','uri':_0x4cac46+_0xc16c('0x34'),'body':{'title':intUtil[_0xc16c('0x35')](_0x1d5147[_0xc16c('0x36')],_0x5c91ea,'\x20'),'description':intUtil[_0xc16c('0x35')](_0x1d5147[_0xc16c('0x37')],_0x5c91ea,'\x0a'),'owner_id':_0x46becc[_0xc16c('0x20')],'creater_id':_0x46becc['adminId'],'targetable_id':_0x46becc[_0xc16c('0x2a')],'targetable_type':'Contact','created_at':_0x54ff19[_0xc16c('0x25')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x54ff19[_0xc16c('0x38')](0x1e,'m')['format'](_0xc16c('0x30'))},'json':!![]};_0x269185[_0xc16c('0xd')]=_0x42a1de;return rp(_0x269185)[_0xc16c('0x1a')](function(_0x5a7b45){_0x46becc[_0xc16c('0x39')]=_0x5a7b45[_0xc16c('0x3a')]['id'];logger[_0xc16c('0xe')](_0xc16c('0x3b'),_0x46becc[_0xc16c('0x39')]);_0x5bbcde(_0x46becc);})[_0xc16c('0x14')](function(_0x2b7ee5){logger['error']('['+[_0x241618['toUpperCase']()]+']',_0x2b7ee5[_0xc16c('0x17')]);_0x4589ac(_0x2b7ee5['message']);});});};}function emit(_0x959d7b,_0x221358,_0x55b1ff){var _0xbdc0c7={'uri':_0x959d7b+'/contacts/'+_0x55b1ff};io['to'](util[_0xc16c('0x25')](_0xc16c('0x3c'),_0x221358))[_0xc16c('0x3d')](_0xc16c('0x3e'),_0xbdc0c7);}exports['cs']=function(_0x378aca,_0x2b66f1,_0x4fb9a2,_0xb54b05,_0x55607f,_0x39a6df,_0x538eed,_0x4f2f2b){var _0x15ff96={};var _0xd6524a={'Authorization':'Token\x20token='+_0x39a6df['apiKey']};_0x39a6df['remoteUri']=intUtil['stripTrailingSlash'](_0x39a6df[_0xc16c('0x3f')]);_0x39a6df[_0xc16c('0x40')]=intUtil[_0xc16c('0x41')](_0x39a6df['serverUrl']);var _0x46968e=_0x39a6df[_0xc16c('0x3f')];_0x15ff96[_0xc16c('0x10')]=_0x39a6df[_0xc16c('0x42')];_0x15ff96[_0xc16c('0x28')]=_0x4f2f2b['toLowerCase']()===_0xc16c('0x43')?_0x2b66f1['destcalleridnum']:_0x2b66f1['calleridnum'];_0x15ff96[_0xc16c('0x44')]=_0x4f2f2b===_0xc16c('0x45')||_0x4f2f2b===_0xc16c('0x46')?_0xc16c('0x45'):_0xc16c('0x43');if(_0xb54b05){_0x15ff96[_0xc16c('0x1b')]=_0xb54b05['email'];}var _0x1df687=util[_0xc16c('0x25')](_0xc16c('0x47'),_0x39a6df[_0xc16c('0x40')],_0x2b66f1[_0xc16c('0x48')],md5(_0x2b66f1[_0xc16c('0x48')]));if(_0x55607f&&_0x55607f[_0xc16c('0x49')]){logger[_0xc16c('0xe')]('[QUEUE]',_0xc16c('0x4a'));_0x2b66f1[_0xc16c('0x4b')]=_0x1df687;}else if(_0x538eed&&_0x538eed[_0xc16c('0x4c')]&&_0x538eed[_0xc16c('0x4c')]!==_0xc16c('0x4d')){logger[_0xc16c('0xe')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2b66f1[_0xc16c('0x4b')]=_0x1df687;}else{_0x2b66f1[_0xc16c('0x4b')]='';}return getAdminId(_0x15ff96,_0x4f2f2b,_0xd6524a,_0x46968e)[_0xc16c('0x1a')](getUser(_0x4f2f2b,_0xd6524a,_0x46968e))[_0xc16c('0x1a')](getEndUser(_0x4f2f2b,_0xd6524a,_0x46968e))['then'](getTicket(_0x4f2f2b,_0xd6524a,_0x46968e,_0x4fb9a2,_0x2b66f1))[_0xc16c('0x1a')](function(_0x510b32){logger[_0xc16c('0xe')](util[_0xc16c('0x25')](_0xc16c('0x4e'),_0x510b32[_0xc16c('0x39')]));if(_0x4f2f2b!==_0xc16c('0x46')){logger['info']('['+[_0x4f2f2b[_0xc16c('0x16')]()]+']',_0xc16c('0x4f'));emit(_0x46968e,_0xb54b05[_0xc16c('0x50')],_0x510b32[_0xc16c('0x2a')]);}})[_0xc16c('0x14')](function(_0x3632f7){logger[_0xc16c('0x15')]('['+[_0x4f2f2b[_0xc16c('0x16')]()]+_0xc16c('0x51'),util[_0xc16c('0x52')](_0x3632f7,{'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 dad378b..f21a981 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 _0x4024=['zendesk','salesforce','sugarcrm','zoho','dynamics365','exec','includes','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','desk','vtiger','servicenow','unknown\x20integration','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./zoho','./vtiger','./servicenow'];(function(_0x57bb83,_0x97a539){var _0x20ee48=function(_0x229cfe){while(--_0x229cfe){_0x57bb83['push'](_0x57bb83['shift']());}};_0x20ee48(++_0x97a539);}(_0x4024,0x89));var _0x4402=function(_0x17b911,_0xbd3ad7){_0x17b911=_0x17b911-0x0;var _0x72c3fe=_0x4024[_0x17b911];return _0x72c3fe;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x4402('0x2'));var sugarcrm=require(_0x4402('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0x4402('0x4'));var desk=require('./desk');var vtiger=require(_0x4402('0x5'));var servicenow=require(_0x4402('0x6'));var dynamics365=require('./dynamics365');var freshsales=require('./freshsales');var integrations=[_0x4402('0x7'),_0x4402('0x8'),_0x4402('0x9'),'freshdesk',_0x4402('0xa'),'desk','vtiger',_0x4402('0xb'),'freshsales','servicenow'];exports[_0x4402('0xc')]=function(_0x4f56aa,_0x1a4a47,_0x4e1a7e,_0x34b4a6,_0x525531,_0x3663e7){if(_0x4e1a7e){if(_[_0x4402('0xd')](integrations,_0x4f56aa['data1'][_0x4402('0xe')]())){try{var _0x302c4d=null;var _0xa819e9='';var _0x4c9032=_0x4e1a7e[_0x4f56aa[_0x4402('0xf')][_0x4402('0xe')]()];if(_0x4c9032){var _0x42f1b0=_0x4c9032[_0x4f56aa[_0x4402('0x10')]];if(_0x42f1b0){var _0x248ad9=_[_0x4402('0x11')](_0x42f1b0[_0x4402('0x12')],{'id':parseInt(_0x4f56aa[_0x4402('0x13')],0xa)});if(_0x248ad9){if(_0x34b4a6){if(_0x525531&&_0x1a4a47[_0x4402('0x14')]){_0xa819e9=_0x4402('0x14');}else if(_0x1a4a47[_0x4402('0x15')]){_0xa819e9=_0x4402('0x16');}else{console[_0x4402('0x17')](_0x4402('0x18'),_0x1a4a47);}}else{_0xa819e9=_0x4402('0x19');}switch(_0x4f56aa[_0x4402('0xf')][_0x4402('0xe')]()){case _0x4402('0x7'):zendesk[_0xa819e9](_0x4f56aa,_0x1a4a47,_0x248ad9,_0x34b4a6,_0x525531,_0x42f1b0,_0x3663e7);break;case _0x4402('0x8'):salesforce[_0xa819e9](_0x4f56aa,_0x1a4a47,_0x248ad9,_0x34b4a6,_0x525531,_0x42f1b0,_0x3663e7);break;case _0x4402('0x9'):sugarcrm[_0xa819e9](_0x4f56aa,_0x1a4a47,_0x248ad9,_0x34b4a6,_0x525531,_0x42f1b0,_0x3663e7);break;case'freshdesk':freshdesk[_0xa819e9](_0x4f56aa,_0x1a4a47,_0x248ad9,_0x34b4a6,_0x525531,_0x42f1b0,_0x3663e7);break;case'zoho':zoho[_0xa819e9](_0x4f56aa,_0x1a4a47,_0x248ad9,_0x34b4a6,_0x525531,_0x42f1b0,_0x3663e7);break;case _0x4402('0x1a'):desk[_0xa819e9](_0x4f56aa,_0x1a4a47,_0x248ad9,_0x34b4a6,_0x525531,_0x42f1b0,_0x3663e7);break;case _0x4402('0x1b'):vtiger[_0xa819e9](_0x4f56aa,_0x1a4a47,_0x248ad9,_0x34b4a6,_0x525531,_0x42f1b0,_0x3663e7);break;case'freshsales':freshsales['cs'](_0x4f56aa,_0x1a4a47,_0x248ad9,_0x34b4a6,_0x525531,_0x42f1b0,_0x3663e7,_0xa819e9);break;case _0x4402('0x1c'):servicenow['cs'](_0x4f56aa,_0x1a4a47,_0x248ad9,_0x34b4a6,_0x525531,_0x42f1b0,_0x3663e7,_0xa819e9);break;case _0x4402('0xb'):dynamics365['cs'](_0x4f56aa,_0x1a4a47,_0x248ad9,_0x34b4a6,_0x525531,_0x42f1b0,_0x3663e7,_0xa819e9);break;default:console['log'](_0x4402('0x1d'));}}else{_0x302c4d=require('../../../../config/logger')(_0x4f56aa['data1'][_0x4402('0xe')]());_0x302c4d[_0x4402('0x1e')](_0x4402('0x1f'),util['format'](_0x4402('0x20'),_0x4f56aa['data1']['toLowerCase'](),_0x4f56aa[_0x4402('0x13')]));}}else{_0x302c4d=require(_0x4402('0x21'))(_0x4f56aa[_0x4402('0xf')][_0x4402('0xe')]());_0x302c4d[_0x4402('0x1e')](_0x4402('0x1f'),util[_0x4402('0x22')](_0x4402('0x23'),_0x4f56aa[_0x4402('0xf')]['toLowerCase'](),_0x4f56aa[_0x4402('0x10')]));}}else{}}catch(_0x4e1c04){console[_0x4402('0x1e')](_0x4e1c04);}}}}; \ No newline at end of file +var _0x9ffd=['unknown\x20integration','error','../../../../config/logger','[EXEC]','format','lodash','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','includes','data1','toLowerCase','data2','Configurations','data3','queue','unmanaged','servicenow','log'];(function(_0x132889,_0x2207a8){var _0xd93752=function(_0x572faa){while(--_0x572faa){_0x132889['push'](_0x132889['shift']());}};_0xd93752(++_0x2207a8);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x45d87d,_0x2cbfa5){_0x45d87d=_0x45d87d-0x0;var _0x20c1d3=_0x9ffd[_0x45d87d];return _0x20c1d3;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var zendesk=require(_0xd9ff('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0xd9ff('0x3'));var freshdesk=require(_0xd9ff('0x4'));var zoho=require(_0xd9ff('0x5'));var desk=require(_0xd9ff('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0xd9ff('0x7'));var dynamics365=require(_0xd9ff('0x8'));var freshsales=require('./freshsales');var integrations=[_0xd9ff('0x9'),_0xd9ff('0xa'),_0xd9ff('0xb'),_0xd9ff('0xc'),_0xd9ff('0xd'),_0xd9ff('0xe'),_0xd9ff('0xf'),_0xd9ff('0x10'),_0xd9ff('0x11'),'servicenow'];exports['exec']=function(_0x567f79,_0x5aa954,_0x2355ab,_0x2fd77a,_0x193537,_0x32b48f){if(_0x2355ab){if(_[_0xd9ff('0x12')](integrations,_0x567f79[_0xd9ff('0x13')][_0xd9ff('0x14')]())){try{var _0x1c2a16=null;var _0x47d842='';var _0x47b0d7=_0x2355ab[_0x567f79[_0xd9ff('0x13')][_0xd9ff('0x14')]()];if(_0x47b0d7){var _0x415c58=_0x47b0d7[_0x567f79[_0xd9ff('0x15')]];if(_0x415c58){var _0x12c39a=_['find'](_0x415c58[_0xd9ff('0x16')],{'id':parseInt(_0x567f79[_0xd9ff('0x17')],0xa)});if(_0x12c39a){if(_0x2fd77a){if(_0x193537&&_0x5aa954['queue']){_0x47d842=_0xd9ff('0x18');}else if(_0x5aa954['routeId']){_0x47d842='outbound';}else{console['log']('EVENT\x20UNKNOWN',_0x5aa954);}}else{_0x47d842=_0xd9ff('0x19');}switch(_0x567f79['data1'][_0xd9ff('0x14')]()){case _0xd9ff('0x9'):zendesk[_0x47d842](_0x567f79,_0x5aa954,_0x12c39a,_0x2fd77a,_0x193537,_0x415c58,_0x32b48f);break;case _0xd9ff('0xa'):salesforce[_0x47d842](_0x567f79,_0x5aa954,_0x12c39a,_0x2fd77a,_0x193537,_0x415c58,_0x32b48f);break;case _0xd9ff('0xb'):sugarcrm[_0x47d842](_0x567f79,_0x5aa954,_0x12c39a,_0x2fd77a,_0x193537,_0x415c58,_0x32b48f);break;case _0xd9ff('0xc'):freshdesk[_0x47d842](_0x567f79,_0x5aa954,_0x12c39a,_0x2fd77a,_0x193537,_0x415c58,_0x32b48f);break;case _0xd9ff('0xd'):zoho[_0x47d842](_0x567f79,_0x5aa954,_0x12c39a,_0x2fd77a,_0x193537,_0x415c58,_0x32b48f);break;case _0xd9ff('0xe'):desk[_0x47d842](_0x567f79,_0x5aa954,_0x12c39a,_0x2fd77a,_0x193537,_0x415c58,_0x32b48f);break;case _0xd9ff('0xf'):vtiger[_0x47d842](_0x567f79,_0x5aa954,_0x12c39a,_0x2fd77a,_0x193537,_0x415c58,_0x32b48f);break;case _0xd9ff('0x11'):freshsales['cs'](_0x567f79,_0x5aa954,_0x12c39a,_0x2fd77a,_0x193537,_0x415c58,_0x32b48f,_0x47d842);break;case _0xd9ff('0x1a'):servicenow['cs'](_0x567f79,_0x5aa954,_0x12c39a,_0x2fd77a,_0x193537,_0x415c58,_0x32b48f,_0x47d842);break;case _0xd9ff('0x10'):dynamics365['cs'](_0x567f79,_0x5aa954,_0x12c39a,_0x2fd77a,_0x193537,_0x415c58,_0x32b48f,_0x47d842);break;default:console[_0xd9ff('0x1b')](_0xd9ff('0x1c'));}}else{_0x1c2a16=require('../../../../config/logger')(_0x567f79['data1'][_0xd9ff('0x14')]());_0x1c2a16[_0xd9ff('0x1d')]('[EXEC]',util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x567f79['data1'][_0xd9ff('0x14')](),_0x567f79['data3']));}}else{_0x1c2a16=require(_0xd9ff('0x1e'))(_0x567f79[_0xd9ff('0x13')][_0xd9ff('0x14')]());_0x1c2a16[_0xd9ff('0x1d')](_0xd9ff('0x1f'),util[_0xd9ff('0x20')]('%s\x20account\x20#%s\x20not\x20found',_0x567f79['data1'][_0xd9ff('0x14')](),_0x567f79['data2']));}}else{}}catch(_0x3ca906){console['error'](_0x3ca906);}}}}; \ 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 5b231ab..461ae2a 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 _0xacb3=['IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','Case','ContactId','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','ticketType','validateEmail','sobject','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','additionalSearchLead','merge','Lead','additionalSearchAccount','Account','first','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[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','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','trigger:browser:url','%s/%s/e','[OUTBOUND]','catch','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','moment','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','Subjects','getString','Descriptions','ActivityDate','utc'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xacb3,0x1f1));var _0x3acb=function(_0x406d39,_0xd3c8f1){_0x406d39=_0x406d39-0x0;var _0x2eb792=_0xacb3[_0x406d39];return _0x2eb792;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x3acb('0x0'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x3acb('0x1'));var util=require(_0x3acb('0x2'));var Redis=require(_0x3acb('0x3'));var intUtil=require(_0x3acb('0x4'));var config=require(_0x3acb('0x5'));var logger=require(_0x3acb('0x6'))(_0x3acb('0x7'));config[_0x3acb('0x8')]=_[_0x3acb('0x9')](config[_0x3acb('0x8')],{'host':_0x3acb('0xa'),'port':0x18eb});var io=require(_0x3acb('0xb'))(new Redis(config[_0x3acb('0x8')]));function emit(_0x5b09a2,_0x491bc5,_0x5a69b9){io['to'](_0x5b09a2)[_0x3acb('0xc')](_0x491bc5,_0x5a69b9);}function getTicket(_0x464f49,_0x1c9b5d,_0x541c4f,_0x2bec82,_0x846e74,_0x102c87,_0x203d32,_0x17fbca){var _0x4394f4=Object[_0x3acb('0xd')]({},{'OwnerId':_0x1c9b5d['id'],'Subject':intUtil['getString'](_0x2bec82[_0x3acb('0xe')],_0x846e74,'\x20'),'Description':intUtil[_0x3acb('0xf')](_0x2bec82[_0x3acb('0x10')],_0x846e74,'\x0a')},getCustomFields(_0x102c87,_0x846e74));if(_0x541c4f){if(_0x2bec82['ticketType']==='Task'){_0x4394f4[_0x3acb('0x11')]=moment[_0x3acb('0x12')]();_0x4394f4[_0x3acb('0x13')]=![];_0x4394f4[_0x3acb('0x14')]=![];if(_0x541c4f[_0x3acb('0x15')]===_0x3acb('0x16')||_0x541c4f[_0x3acb('0x15')]==='lead'){_0x4394f4[_0x3acb('0x17')]=_0x541c4f['id'];}else if(_0x541c4f[_0x3acb('0x15')]===_0x3acb('0x18')){_0x4394f4['WhatId']=_0x541c4f['id'];}}else if(_0x2bec82['ticketType']===_0x3acb('0x19')){if(_0x541c4f[_0x3acb('0x15')]==='contact'){_0x4394f4[_0x3acb('0x1a')]=_0x541c4f['id'];}else if(_0x541c4f[_0x3acb('0x15')]===_0x3acb('0x18')){_0x4394f4[_0x3acb('0x1b')]=_0x541c4f['id'];}else if(_0x541c4f[_0x3acb('0x15')]===_0x3acb('0x1c')&&_0x2bec82[_0x3acb('0x1d')]){_0x4394f4[_0x2bec82[_0x3acb('0x1d')]]=_0x541c4f['id'];}else{logger[_0x3acb('0x1e')](_0x3acb('0x1f'));}}}return _0x203d32['sobject'](_0x2bec82[_0x3acb('0x20')])['create'](_0x4394f4);}function getUser(_0x13d980,_0x2e74da,_0x43ed3a){if(!_['isNil'](_0x2e74da)&&intUtil[_0x3acb('0x21')](_0x2e74da)){var _0xee0d4a={'Email':_0x2e74da};var _0x5c5330={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x43ed3a[_0x3acb('0x22')](_0x3acb('0x23'))[_0x3acb('0x24')](_0xee0d4a,_0x5c5330)[_0x3acb('0x25')]()[_0x3acb('0x26')](function(_0x4b140c){if(_0x4b140c[_0x3acb('0x27')]){var _0x684157=_[_0x3acb('0x24')](_0x4b140c,function(_0x53d23c){return _0x53d23c[_0x3acb('0x28')]===_0x2e74da;});if(_0x684157){logger[_0x3acb('0x1e')](_0x3acb('0x29'),_0x2e74da);return BPromise[_0x3acb('0x2a')]({'id':_0x684157['Id'],'name':_0x684157[_0x3acb('0x2b')]});}}else{logger['info'](_0x3acb('0x2c'),_0x2e74da);return _0x43ed3a[_0x3acb('0x2d')]()['then'](function(_0x598543){return BPromise[_0x3acb('0x2a')]({'id':_0x598543[_0x3acb('0x2e')],'name':_0x598543['display_name']});});}});}else{logger[_0x3acb('0x1e')](_0x3acb('0x2c'),_0x2e74da);return _0x43ed3a[_0x3acb('0x2d')]()['then'](function(_0x1d3568){return BPromise['resolve']({'id':_0x1d3568['user_id'],'name':_0x1d3568[_0x3acb('0x2f')]});});}}function getEndUser(_0x3f2b36,_0x279a6a,_0x3ce77d,_0x3f420d,_0x4adf19){var _0x1e0c89={'$or':{'Phone':_0x3f420d}};var _0x39840a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x3acb('0x26')](function(){logger[_0x3acb('0x1e')](_0x3acb('0x30'),_0x3f420d,_0x279a6a[_0x3acb('0x31')]);switch(_0x279a6a[_0x3acb('0x31')]){case _0x3acb('0x32'):var _0x451d62=_[_0x3acb('0x33')](_0x1e0c89);if(_0x279a6a[_0x3acb('0x34')]){var _0x3c6916={};_0x3c6916[_0x279a6a[_0x3acb('0x34')]]=_0x3f420d;_['merge'](_0x451d62[_0x3acb('0x35')],_0x3c6916);}return _0x4adf19['sobject'](_0x3acb('0x36'))[_0x3acb('0x24')](_0x451d62,_0x39840a)[_0x3acb('0x25')]()[_0x3acb('0x26')](function(_0x387706){if(_0x387706&&_0x387706[_0x3acb('0x27')]){return _0x387706;}else{var _0x4bf265=_['cloneDeep'](_0x1e0c89);if(_0x279a6a['additionalSearchLead']){var _0x54c6b4={};_0x54c6b4[_0x279a6a[_0x3acb('0x37')]]=_0x3f420d;_[_0x3acb('0x38')](_0x4bf265['$or'],_0x54c6b4);}return _0x4adf19[_0x3acb('0x22')](_0x3acb('0x39'))[_0x3acb('0x24')](_0x4bf265,_0x39840a);}});case'account_contact_lead':var _0x5c1f14=_[_0x3acb('0x33')](_0x1e0c89);if(_0x279a6a['additionalSearchAccount']){var _0x3c6916={};_0x3c6916[_0x279a6a[_0x3acb('0x3a')]]=_0x3f420d;_['merge'](_0x5c1f14[_0x3acb('0x35')],_0x3c6916);}return _0x4adf19['sobject'](_0x3acb('0x3b'))[_0x3acb('0x24')](_0x5c1f14,_0x39840a)[_0x3acb('0x25')]()[_0x3acb('0x26')](function(_0x2fa0ec){if(_0x2fa0ec&&_0x2fa0ec[_0x3acb('0x27')]){return _0x2fa0ec;}else{var _0x1c9881=_[_0x3acb('0x33')](_0x1e0c89);if(_0x279a6a[_0x3acb('0x34')]){var _0x43cfce={};_0x43cfce[_0x279a6a['additionalSearchContact']]=_0x3f420d;_[_0x3acb('0x38')](_0x1c9881['$or'],_0x43cfce);}return _0x4adf19[_0x3acb('0x22')](_0x3acb('0x36'))[_0x3acb('0x24')](_0x1c9881,_0x39840a)['then'](function(_0x2b80e7){if(_0x2b80e7&&_0x2b80e7[_0x3acb('0x27')]){return _0x2b80e7;}else{var _0x2ce320=_[_0x3acb('0x33')](_0x1e0c89);if(_0x279a6a[_0x3acb('0x37')]){var _0x1e54f7={};_0x1e54f7[_0x279a6a[_0x3acb('0x37')]]=_0x3f420d;_[_0x3acb('0x38')](_0x2ce320[_0x3acb('0x35')],_0x1e54f7);}return _0x4adf19[_0x3acb('0x22')](_0x3acb('0x39'))['find'](_0x2ce320,_0x39840a);}});}});case _0x3acb('0x16'):var _0x451d62=_[_0x3acb('0x33')](_0x1e0c89);if(_0x279a6a[_0x3acb('0x34')]){var _0x3c6916={};_0x3c6916[_0x279a6a[_0x3acb('0x34')]]=_0x3f420d;_['merge'](_0x451d62[_0x3acb('0x35')],_0x3c6916);}return _0x4adf19[_0x3acb('0x22')](_0x3acb('0x36'))['find'](_0x451d62,_0x39840a)[_0x3acb('0x25')]();case _0x3acb('0x1c'):var _0x28cda4=_[_0x3acb('0x33')](_0x1e0c89);if(_0x279a6a[_0x3acb('0x37')]){var _0x3c6916={};_0x3c6916[_0x279a6a[_0x3acb('0x37')]]=_0x3f420d;_['merge'](_0x28cda4[_0x3acb('0x35')],_0x3c6916);}return _0x4adf19['sobject'](_0x3acb('0x39'))[_0x3acb('0x24')](_0x28cda4,_0x39840a);case'account':var _0x5c1f14=_[_0x3acb('0x33')](_0x1e0c89);if(_0x279a6a[_0x3acb('0x3a')]){var _0x3c6916={};_0x3c6916[_0x279a6a['additionalSearchAccount']]=_0x3f420d;_['merge'](_0x5c1f14[_0x3acb('0x35')],_0x3c6916);}return _0x4adf19[_0x3acb('0x22')]('Account')[_0x3acb('0x24')](_0x5c1f14,_0x39840a);default:return null;}})[_0x3acb('0x26')](function(_0x21e52f){if(_0x21e52f&&_0x21e52f[_0x3acb('0x27')]){var _0x26062c=_[_0x3acb('0x3c')](_0x21e52f);if(_0x26062c){return BPromise['resolve']({'id':_0x26062c['Id'],'name':_0x26062c['Name'],'phone':_0x26062c['Phone'],'endUserType':_0x26062c[_0x3acb('0x3d')][_0x3acb('0x3e')][_0x3acb('0x3f')]()});}}})[_0x3acb('0x26')](function(_0x1a2bd6){if(_0x1a2bd6){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x1a2bd6[_0x3acb('0x15')],_0x3f420d);return BPromise[_0x3acb('0x2a')](_0x1a2bd6);}else{logger['info'](_0x3acb('0x40'),_0x3f420d);var _0x3c17e9={'Phone':_0x3f420d};if(_0x279a6a['moduleCreate']){if(_0x279a6a['moduleCreate']===_0x3acb('0x16')){logger[_0x3acb('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3f420d,_0x279a6a[_0x3acb('0x41')]);_0x3c17e9[_0x3acb('0x42')]=_0x3ce77d!==_0x3acb('0x43')?_0x3ce77d:util[_0x3acb('0x44')](_0x3acb('0x45'),_0x3f420d);}else if(_0x279a6a[_0x3acb('0x41')]===_0x3acb('0x1c')){logger[_0x3acb('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3f420d,_0x279a6a[_0x3acb('0x41')]);_0x3c17e9['LastName']=_0x3ce77d!==''?_0x3ce77d:util[_0x3acb('0x44')]('Caller\x20-\x20%s',_0x3f420d);_0x3c17e9['Company']=_0x3acb('0x46');}else if(_0x279a6a[_0x3acb('0x41')]==='account'){logger[_0x3acb('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3f420d,_0x279a6a[_0x3acb('0x41')]);_0x3c17e9[_0x3acb('0x2b')]=_0x3ce77d!==_0x3acb('0x43')?_0x3ce77d:util[_0x3acb('0x44')](_0x3acb('0x45'),_0x3f420d);}else{return null;}}return _0x4adf19[_0x3acb('0x22')](_[_0x3acb('0x47')](_0x279a6a[_0x3acb('0x41')]))['create'](_0x3c17e9)[_0x3acb('0x26')](function(_0x332c5b){return BPromise[_0x3acb('0x2a')]({'id':_0x332c5b['id'],'endUserType':_0x279a6a[_0x3acb('0x41')]});});}});}function getCustomFields(_0x21d8c4,_0xe66a9c){var _0x150c18={};if(_0x21d8c4[_0x3acb('0x27')]>0x0){_[_0x3acb('0x48')](_0x21d8c4,function(_0x5c163a){if(_[_0x3acb('0x49')]([_0x3acb('0x4a'),_0x3acb('0x4b')],_0x5c163a[_0x3acb('0x3e')])&&_0x5c163a[_0x3acb('0x4c')]){_0x150c18[_0x5c163a[_0x3acb('0x4c')]]=_0x5c163a[_0x3acb('0x4d')][_0x3acb('0x4e')]();}else if(_0x5c163a['type']===_0x3acb('0x4f')&&_0x5c163a['variableName']&&_0x5c163a[_0x3acb('0x4c')]){_0xe66a9c[_0x5c163a[_0x3acb('0x50')]]&&(_0x150c18[_0x5c163a[_0x3acb('0x4c')]]=_0xe66a9c[_0x5c163a[_0x3acb('0x50')]][_0x3acb('0x4e')]());}else if(_0x5c163a[_0x3acb('0x3e')]===_0x3acb('0x51')&&_0x5c163a[_0x3acb('0x52')]&&_0x5c163a[_0x3acb('0x52')][_0x3acb('0x53')]&&_0x5c163a[_0x3acb('0x4c')]){_0xe66a9c[_0x5c163a[_0x3acb('0x52')][_0x3acb('0x53')][_0x3acb('0x3f')]()]&&(_0x150c18[_0x5c163a[_0x3acb('0x4c')]]=_0xe66a9c[_0x5c163a[_0x3acb('0x52')][_0x3acb('0x53')][_0x3acb('0x3f')]()][_0x3acb('0x4e')]());}});}return _0x150c18;}function getConnection(_0x4b4941){var _0x4049c1=_0x4b4941[_0x3acb('0x54')][_0x3acb('0x55')](_0x4b4941[_0x3acb('0x56')]);var _0x1c6c75=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4b4941[_0x3acb('0x57')]||_0x3acb('0x58'),'clientId':_0x4b4941[_0x3acb('0x59')],'clientSecret':_0x4b4941[_0x3acb('0x5a')]}});return _0x1c6c75[_0x3acb('0x5b')](_0x4b4941[_0x3acb('0x5c')],_0x4049c1)[_0x3acb('0x26')](function(){logger[_0x3acb('0x1e')](_0x3acb('0x5d'));return _0x1c6c75;});}exports[_0x3acb('0x5e')]=function(_0x5358fe,_0x367567,_0x4924aa,_0xafe31,_0xbc2132,_0x412f8d){var _0x984e6e,_0x483d51,_0x4dc6c3,_0x514ece;_0x412f8d['serverUrl']=intUtil['stripTrailingSlash'](_0x412f8d[_0x3acb('0x5f')]);_0x412f8d[_0x3acb('0x57')]=intUtil[_0x3acb('0x60')](_0x412f8d['remoteUri']);if(_0xbc2132&&_0xbc2132['monitor_format']){logger['info'](_0x3acb('0x61'),_0x3acb('0x62'));_0x367567[_0x3acb('0x63')]=util['format'](_0x3acb('0x64'),_0x412f8d['serverUrl'],_0x367567[_0x3acb('0x65')],md5(_0x367567[_0x3acb('0x65')]));}else{_0x367567[_0x3acb('0x63')]='';}return getConnection(_0x412f8d)[_0x3acb('0x26')](function(_0x4a5c82){_0x514ece=_0x4a5c82;return getUser(_0x412f8d,_0xafe31[_0x3acb('0x66')],_0x514ece);})[_0x3acb('0x26')](function(_0x220afe){_0x984e6e=_0x220afe;return getEndUser(_0x412f8d,_0x4924aa,_0x367567[_0x3acb('0x67')],_0x367567[_0x3acb('0x68')],_0x514ece);})['then'](function(_0x2c6663){_0x483d51=_0x2c6663;return getTicket(_0x412f8d,_0x984e6e,_0x483d51,_0x4924aa,_0x367567,_0x4924aa[_0x3acb('0x69')],_0x514ece,_0x3acb('0x5e'));})[_0x3acb('0x26')](function(_0x2f6817){_0x4dc6c3=_0x2f6817;logger['info'](_0x3acb('0x6a'),_0x4dc6c3['id']);logger[_0x3acb('0x1e')](_0x3acb('0x6b'),_0x4dc6c3['id'],_0xafe31['name'],_0x412f8d['type']);switch(_0x412f8d[_0x3acb('0x3e')]){case _0x3acb('0x6c'):emit(util[_0x3acb('0x44')](_0x3acb('0x6d'),_0xafe31[_0x3acb('0x53')]),_0x3acb('0x6e'),{'recordId':_0x4dc6c3['id']});break;case'newTab':emit(util['format'](_0x3acb('0x6d'),_0xafe31[_0x3acb('0x53')]),'trigger:browser:url',{'uri':util[_0x3acb('0x44')]('%s/%s/e',_0x514ece['instanceUrl'],_0x4dc6c3['id'])});break;default:logger[_0x3acb('0x6f')](_0x3acb('0x70'));}})['catch'](function(_0x1a5189){logger[_0x3acb('0x6f')](_0x3acb('0x61'),_0x1a5189);});};exports[_0x3acb('0x71')]=function(_0x4743e3,_0x249666,_0x5baa68,_0x220158,_0x4c0ad9,_0x1b495d,_0x2bfe83){var _0x3f3480,_0xd07870,_0x25201d,_0x56af6a;_0x1b495d['serverUrl']=intUtil[_0x3acb('0x60')](_0x1b495d[_0x3acb('0x5f')]);_0x1b495d[_0x3acb('0x57')]=intUtil[_0x3acb('0x60')](_0x1b495d[_0x3acb('0x57')]);if(_0x2bfe83&&_0x2bfe83['recordingFormat']&&_0x2bfe83[_0x3acb('0x72')]!=='none'){logger['info']('[OUTBOUND]',_0x3acb('0x62'));_0x249666[_0x3acb('0x63')]=util[_0x3acb('0x44')](_0x3acb('0x64'),_0x1b495d[_0x3acb('0x5f')],_0x249666[_0x3acb('0x65')],md5(_0x249666['uniqueid']));}return getConnection(_0x1b495d)['then'](function(_0x28fb56){_0x56af6a=_0x28fb56;return getUser(_0x1b495d,_0x220158['email'],_0x56af6a);})[_0x3acb('0x26')](function(_0x5a31ad){_0x3f3480=_0x5a31ad;return getEndUser(_0x1b495d,_0x5baa68,_0x249666[_0x3acb('0x73')],_0x249666[_0x3acb('0x74')],_0x56af6a);})[_0x3acb('0x26')](function(_0x4df98d){_0xd07870=_0x4df98d;return getTicket(_0x1b495d,_0x3f3480,_0xd07870,_0x5baa68,_0x249666,_0x5baa68[_0x3acb('0x69')],_0x56af6a,_0x3acb('0x71'));})[_0x3acb('0x26')](function(_0x24698d){_0x25201d=_0x24698d;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x25201d['id']);logger[_0x3acb('0x1e')](_0x3acb('0x75'),_0x25201d['id'],_0x220158[_0x3acb('0x53')],_0x1b495d[_0x3acb('0x3e')]);switch(_0x1b495d[_0x3acb('0x3e')]){case _0x3acb('0x6c'):emit(util['format'](_0x3acb('0x6d'),_0x220158[_0x3acb('0x53')]),_0x3acb('0x6e'),{'recordId':_0x25201d['id']});break;case _0x3acb('0x76'):emit(util[_0x3acb('0x44')](_0x3acb('0x6d'),_0x220158[_0x3acb('0x53')]),_0x3acb('0x77'),{'uri':util[_0x3acb('0x44')](_0x3acb('0x78'),_0x56af6a['instanceUrl'],_0x25201d['id'])});break;default:logger[_0x3acb('0x6f')](_0x3acb('0x79'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x3acb('0x7a')](function(_0x27c051){logger[_0x3acb('0x6f')]('[OUTBOUND]',_0x27c051);});};exports[_0x3acb('0x7b')]=function(_0x5dc673,_0x3f9838,_0x406304,_0x172eb2,_0x2e8fab,_0xa5c07){var _0x1dc0c1,_0x52094f,_0x355a3c,_0x37527e;_0xa5c07[_0x3acb('0x5f')]=intUtil[_0x3acb('0x60')](_0xa5c07['serverUrl']);_0xa5c07['remoteUri']=intUtil[_0x3acb('0x60')](_0xa5c07[_0x3acb('0x57')]);if(_0x2e8fab&&_0x2e8fab[_0x3acb('0x7c')]){logger['info']('['+_0x3f9838[_0x3acb('0x7d')][_0x3acb('0x7e')]()+']',_0x3acb('0x62'));_0x3f9838['recordingURL']=util[_0x3acb('0x44')](_0x3acb('0x64'),_0xa5c07[_0x3acb('0x5f')],_0x3f9838['uniqueid'],md5(_0x3f9838['uniqueid']));}else{_0x3f9838[_0x3acb('0x63')]='';}return getConnection(_0xa5c07)[_0x3acb('0x26')](function(_0xfe391d){_0x37527e=_0xfe391d;if(!_['isNil'](_0x172eb2)){return getUser(_0xa5c07,_0x172eb2['name'],_0x37527e);}else{return getUser(_0xa5c07,null,_0x37527e);}})[_0x3acb('0x26')](function(_0x27f303){_0x1dc0c1=_0x27f303;return getEndUser(_0xa5c07,_0x406304,_0x3f9838[_0x3acb('0x67')],_0x3f9838[_0x3acb('0x68')],_0x37527e);})[_0x3acb('0x26')](function(_0x4e053b){_0x52094f=_0x4e053b;return getTicket(_0xa5c07,_0x1dc0c1,_0x52094f,_0x406304,_0x3f9838,_0x406304[_0x3acb('0x69')],_0x37527e);})[_0x3acb('0x26')](function(_0x316047){_0x355a3c=_0x316047;logger[_0x3acb('0x1e')]('['+_0x3f9838[_0x3acb('0x7d')][_0x3acb('0x7e')]()+_0x3acb('0x7f'),_0x355a3c['id']);logger[_0x3acb('0x1e')]('['+_0x3f9838[_0x3acb('0x7d')]['toUpperCase']()+_0x3acb('0x80'),_0xa5c07[_0x3acb('0x3e')]);})[_0x3acb('0x7a')](function(_0x4fd2ad){logger['error']('['+_0x3f9838[_0x3acb('0x7d')][_0x3acb('0x7e')]()+']',_0x4fd2ad);});}; \ No newline at end of file +var _0x4601=['contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','No\x20Company','create','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','lead','account','WhatId','Case','ContactId','AccountId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4601,0x1cf));var _0x1460=function(_0x3a8809,_0x31e0c){_0x3a8809=_0x3a8809-0x0;var _0x46734f=_0x4601[_0x3a8809];return _0x46734f;};'use strict';var _=require(_0x1460('0x0'));var rp=require(_0x1460('0x1'));var moment=require(_0x1460('0x2'));var BPromise=require(_0x1460('0x3'));var md5=require(_0x1460('0x4'));var jsforce=require('jsforce');var util=require('util');var Redis=require(_0x1460('0x5'));var intUtil=require(_0x1460('0x6'));var config=require(_0x1460('0x7'));var logger=require('../../../../config/logger')(_0x1460('0x8'));config[_0x1460('0x9')]=_[_0x1460('0xa')](config[_0x1460('0x9')],{'host':_0x1460('0xb'),'port':0x18eb});var io=require(_0x1460('0xc'))(new Redis(config[_0x1460('0x9')]));function emit(_0x462b63,_0x3ce025,_0x18bf23){io['to'](_0x462b63)[_0x1460('0xd')](_0x3ce025,_0x18bf23);}function getTicket(_0x49b4eb,_0x306fe6,_0x42ae31,_0x5462e5,_0x108864,_0x4c01a7,_0x47166c,_0x4fe989){var _0x57216d=Object[_0x1460('0xe')]({},{'OwnerId':_0x306fe6['id'],'Subject':intUtil[_0x1460('0xf')](_0x5462e5[_0x1460('0x10')],_0x108864,'\x20'),'Description':intUtil['getString'](_0x5462e5[_0x1460('0x11')],_0x108864,'\x0a')},getCustomFields(_0x4c01a7,_0x108864));if(_0x42ae31){if(_0x5462e5[_0x1460('0x12')]===_0x1460('0x13')){_0x57216d[_0x1460('0x14')]=moment[_0x1460('0x15')]();_0x57216d['IsReminderSet']=![];_0x57216d[_0x1460('0x16')]=![];if(_0x42ae31[_0x1460('0x17')]===_0x1460('0x18')||_0x42ae31[_0x1460('0x17')]===_0x1460('0x19')){_0x57216d['WhoId']=_0x42ae31['id'];}else if(_0x42ae31[_0x1460('0x17')]===_0x1460('0x1a')){_0x57216d[_0x1460('0x1b')]=_0x42ae31['id'];}}else if(_0x5462e5[_0x1460('0x12')]===_0x1460('0x1c')){if(_0x42ae31['endUserType']==='contact'){_0x57216d[_0x1460('0x1d')]=_0x42ae31['id'];}else if(_0x42ae31['endUserType']===_0x1460('0x1a')){_0x57216d[_0x1460('0x1e')]=_0x42ae31['id'];}else if(_0x42ae31['endUserType']===_0x1460('0x19')&&_0x5462e5['leadId']){_0x57216d[_0x5462e5['leadId']]=_0x42ae31['id'];}else{logger[_0x1460('0x1f')](_0x1460('0x20'));}}}return _0x47166c[_0x1460('0x21')](_0x5462e5[_0x1460('0x12')])['create'](_0x57216d);}function getUser(_0x5aecfd,_0xfe118,_0x47326b){if(!_[_0x1460('0x22')](_0xfe118)&&intUtil['validateEmail'](_0xfe118)){var _0x4efec1={'Email':_0xfe118};var _0x1327a2={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x47326b[_0x1460('0x21')](_0x1460('0x23'))[_0x1460('0x24')](_0x4efec1,_0x1327a2)[_0x1460('0x25')]()[_0x1460('0x26')](function(_0x24fdf8){if(_0x24fdf8[_0x1460('0x27')]){var _0x32f9eb=_[_0x1460('0x24')](_0x24fdf8,function(_0x111f1b){return _0x111f1b[_0x1460('0x28')]===_0xfe118;});if(_0x32f9eb){logger[_0x1460('0x1f')](_0x1460('0x29'),_0xfe118);return BPromise[_0x1460('0x2a')]({'id':_0x32f9eb['Id'],'name':_0x32f9eb[_0x1460('0x2b')]});}}else{logger['info'](_0x1460('0x2c'),_0xfe118);return _0x47326b[_0x1460('0x2d')]()['then'](function(_0x1e8cbb){return BPromise['resolve']({'id':_0x1e8cbb['user_id'],'name':_0x1e8cbb['display_name']});});}});}else{logger['info'](_0x1460('0x2c'),_0xfe118);return _0x47326b[_0x1460('0x2d')]()[_0x1460('0x26')](function(_0xfdf6fc){return BPromise['resolve']({'id':_0xfdf6fc[_0x1460('0x2e')],'name':_0xfdf6fc['display_name']});});}}function getEndUser(_0x14ffaa,_0xcf7bc4,_0xefa8e7,_0x311197,_0x2e5f69){var _0x422016={'$or':{'Phone':_0x311197}};var _0x263fd8={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1460('0x2a')]()[_0x1460('0x26')](function(){logger[_0x1460('0x1f')](_0x1460('0x2f'),_0x311197,_0xcf7bc4[_0x1460('0x30')]);switch(_0xcf7bc4['moduleSearch']){case _0x1460('0x31'):var _0x21e023=_[_0x1460('0x32')](_0x422016);if(_0xcf7bc4[_0x1460('0x33')]){var _0x2fa786={};_0x2fa786[_0xcf7bc4['additionalSearchContact']]=_0x311197;_[_0x1460('0x34')](_0x21e023[_0x1460('0x35')],_0x2fa786);}return _0x2e5f69[_0x1460('0x21')](_0x1460('0x36'))[_0x1460('0x24')](_0x21e023,_0x263fd8)['execute']()[_0x1460('0x26')](function(_0x26919e){if(_0x26919e&&_0x26919e[_0x1460('0x27')]){return _0x26919e;}else{var _0x5f3bec=_[_0x1460('0x32')](_0x422016);if(_0xcf7bc4[_0x1460('0x37')]){var _0xf9fc67={};_0xf9fc67[_0xcf7bc4['additionalSearchLead']]=_0x311197;_['merge'](_0x5f3bec[_0x1460('0x35')],_0xf9fc67);}return _0x2e5f69[_0x1460('0x21')](_0x1460('0x38'))['find'](_0x5f3bec,_0x263fd8);}});case _0x1460('0x39'):var _0x5746c9=_[_0x1460('0x32')](_0x422016);if(_0xcf7bc4[_0x1460('0x3a')]){var _0x2fa786={};_0x2fa786[_0xcf7bc4[_0x1460('0x3a')]]=_0x311197;_[_0x1460('0x34')](_0x5746c9[_0x1460('0x35')],_0x2fa786);}return _0x2e5f69[_0x1460('0x21')](_0x1460('0x3b'))[_0x1460('0x24')](_0x5746c9,_0x263fd8)[_0x1460('0x25')]()[_0x1460('0x26')](function(_0x2b3c5d){if(_0x2b3c5d&&_0x2b3c5d['length']){return _0x2b3c5d;}else{var _0x378c88=_['cloneDeep'](_0x422016);if(_0xcf7bc4[_0x1460('0x33')]){var _0x2e2055={};_0x2e2055[_0xcf7bc4[_0x1460('0x33')]]=_0x311197;_[_0x1460('0x34')](_0x378c88['$or'],_0x2e2055);}return _0x2e5f69[_0x1460('0x21')](_0x1460('0x36'))[_0x1460('0x24')](_0x378c88,_0x263fd8)[_0x1460('0x26')](function(_0x4e5795){if(_0x4e5795&&_0x4e5795[_0x1460('0x27')]){return _0x4e5795;}else{var _0xe9afff=_['cloneDeep'](_0x422016);if(_0xcf7bc4[_0x1460('0x37')]){var _0x54d50c={};_0x54d50c[_0xcf7bc4[_0x1460('0x37')]]=_0x311197;_['merge'](_0xe9afff['$or'],_0x54d50c);}return _0x2e5f69[_0x1460('0x21')](_0x1460('0x38'))[_0x1460('0x24')](_0xe9afff,_0x263fd8);}});}});case _0x1460('0x18'):var _0x21e023=_['cloneDeep'](_0x422016);if(_0xcf7bc4[_0x1460('0x33')]){var _0x2fa786={};_0x2fa786[_0xcf7bc4[_0x1460('0x33')]]=_0x311197;_[_0x1460('0x34')](_0x21e023['$or'],_0x2fa786);}return _0x2e5f69['sobject'](_0x1460('0x36'))[_0x1460('0x24')](_0x21e023,_0x263fd8)['execute']();case _0x1460('0x19'):var _0x405281=_[_0x1460('0x32')](_0x422016);if(_0xcf7bc4[_0x1460('0x37')]){var _0x2fa786={};_0x2fa786[_0xcf7bc4[_0x1460('0x37')]]=_0x311197;_[_0x1460('0x34')](_0x405281[_0x1460('0x35')],_0x2fa786);}return _0x2e5f69['sobject'](_0x1460('0x38'))[_0x1460('0x24')](_0x405281,_0x263fd8);case _0x1460('0x1a'):var _0x5746c9=_['cloneDeep'](_0x422016);if(_0xcf7bc4[_0x1460('0x3a')]){var _0x2fa786={};_0x2fa786[_0xcf7bc4['additionalSearchAccount']]=_0x311197;_[_0x1460('0x34')](_0x5746c9[_0x1460('0x35')],_0x2fa786);}return _0x2e5f69['sobject'](_0x1460('0x3b'))['find'](_0x5746c9,_0x263fd8);default:return null;}})[_0x1460('0x26')](function(_0x5c733b){if(_0x5c733b&&_0x5c733b[_0x1460('0x27')]){var _0x53d4fc=_[_0x1460('0x3c')](_0x5c733b);if(_0x53d4fc){return BPromise[_0x1460('0x2a')]({'id':_0x53d4fc['Id'],'name':_0x53d4fc[_0x1460('0x2b')],'phone':_0x53d4fc['Phone'],'endUserType':_0x53d4fc[_0x1460('0x3d')][_0x1460('0x3e')][_0x1460('0x3f')]()});}}})['then'](function(_0x3ac9fd){if(_0x3ac9fd){logger[_0x1460('0x1f')](_0x1460('0x40'),_0x3ac9fd[_0x1460('0x17')],_0x311197);return BPromise['resolve'](_0x3ac9fd);}else{logger[_0x1460('0x1f')](_0x1460('0x41'),_0x311197);var _0x25dcb8={'Phone':_0x311197};if(_0xcf7bc4[_0x1460('0x42')]){if(_0xcf7bc4[_0x1460('0x42')]===_0x1460('0x18')){logger['info'](_0x1460('0x43'),_0x311197,_0xcf7bc4[_0x1460('0x42')]);_0x25dcb8[_0x1460('0x44')]=_0xefa8e7!==_0x1460('0x45')?_0xefa8e7:util[_0x1460('0x46')](_0x1460('0x47'),_0x311197);}else if(_0xcf7bc4[_0x1460('0x42')]===_0x1460('0x19')){logger[_0x1460('0x1f')](_0x1460('0x43'),_0x311197,_0xcf7bc4[_0x1460('0x42')]);_0x25dcb8[_0x1460('0x44')]=_0xefa8e7!==_0x1460('0x45')?_0xefa8e7:util[_0x1460('0x46')]('Caller\x20-\x20%s',_0x311197);_0x25dcb8['Company']=_0x1460('0x48');}else if(_0xcf7bc4[_0x1460('0x42')]===_0x1460('0x1a')){logger[_0x1460('0x1f')](_0x1460('0x43'),_0x311197,_0xcf7bc4[_0x1460('0x42')]);_0x25dcb8[_0x1460('0x2b')]=_0xefa8e7!==''?_0xefa8e7:util['format'](_0x1460('0x47'),_0x311197);}else{return null;}}return _0x2e5f69[_0x1460('0x21')](_['upperFirst'](_0xcf7bc4['moduleCreate']))[_0x1460('0x49')](_0x25dcb8)[_0x1460('0x26')](function(_0x3fa723){return BPromise[_0x1460('0x2a')]({'id':_0x3fa723['id'],'endUserType':_0xcf7bc4['moduleCreate']});});}});}function getCustomFields(_0x3700c4,_0x71b10e){var _0x4f1572={};if(_0x3700c4[_0x1460('0x27')]>0x0){_[_0x1460('0x4a')](_0x3700c4,function(_0xf8fca0){if(_[_0x1460('0x4b')]([_0x1460('0x4c'),_0x1460('0x4d')],_0xf8fca0[_0x1460('0x3e')])&&_0xf8fca0[_0x1460('0x4e')]){_0x4f1572[_0xf8fca0['idField']]=_0xf8fca0[_0x1460('0x4f')][_0x1460('0x50')]();}else if(_0xf8fca0[_0x1460('0x3e')]===_0x1460('0x51')&&_0xf8fca0[_0x1460('0x52')]&&_0xf8fca0[_0x1460('0x4e')]){_0x71b10e[_0xf8fca0[_0x1460('0x52')]]&&(_0x4f1572[_0xf8fca0['idField']]=_0x71b10e[_0xf8fca0['variableName']]['toString']());}else if(_0xf8fca0[_0x1460('0x3e')]===_0x1460('0x53')&&_0xf8fca0[_0x1460('0x54')]&&_0xf8fca0[_0x1460('0x54')][_0x1460('0x55')]&&_0xf8fca0[_0x1460('0x4e')]){_0x71b10e[_0xf8fca0[_0x1460('0x54')][_0x1460('0x55')][_0x1460('0x3f')]()]&&(_0x4f1572[_0xf8fca0[_0x1460('0x4e')]]=_0x71b10e[_0xf8fca0['Variable'][_0x1460('0x55')][_0x1460('0x3f')]()]['toString']());}});}return _0x4f1572;}function getConnection(_0x5580f8){var _0xe72614=_0x5580f8[_0x1460('0x56')]['concat'](_0x5580f8['securityToken']);var _0x5cb01a=new jsforce['Connection']({'oauth2':{'loginUrl':_0x5580f8[_0x1460('0x57')]||_0x1460('0x58'),'clientId':_0x5580f8[_0x1460('0x59')],'clientSecret':_0x5580f8[_0x1460('0x5a')]}});return _0x5cb01a['login'](_0x5580f8[_0x1460('0x5b')],_0xe72614)[_0x1460('0x26')](function(){logger['info']('Connection\x20established.');return _0x5cb01a;});}exports['queue']=function(_0x44f457,_0x3c5d8c,_0x49bf6b,_0x155a6d,_0x441416,_0x14d585){var _0x1b34f8,_0x377d47,_0x3de780,_0x4fe4da;_0x14d585['serverUrl']=intUtil[_0x1460('0x5c')](_0x14d585[_0x1460('0x5d')]);_0x14d585['remoteUri']=intUtil[_0x1460('0x5c')](_0x14d585[_0x1460('0x57')]);if(_0x441416&&_0x441416[_0x1460('0x5e')]){logger[_0x1460('0x1f')]('[QUEUE]',_0x1460('0x5f'));_0x3c5d8c['recordingURL']=util[_0x1460('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x14d585[_0x1460('0x5d')],_0x3c5d8c['uniqueid'],md5(_0x3c5d8c[_0x1460('0x60')]));}else{_0x3c5d8c['recordingURL']='';}return getConnection(_0x14d585)[_0x1460('0x26')](function(_0x3963f4){_0x4fe4da=_0x3963f4;return getUser(_0x14d585,_0x155a6d[_0x1460('0x61')],_0x4fe4da);})[_0x1460('0x26')](function(_0x23cad3){_0x1b34f8=_0x23cad3;return getEndUser(_0x14d585,_0x49bf6b,_0x3c5d8c[_0x1460('0x62')],_0x3c5d8c[_0x1460('0x63')],_0x4fe4da);})['then'](function(_0x47b32c){_0x377d47=_0x47b32c;return getTicket(_0x14d585,_0x1b34f8,_0x377d47,_0x49bf6b,_0x3c5d8c,_0x49bf6b[_0x1460('0x64')],_0x4fe4da,_0x1460('0x65'));})[_0x1460('0x26')](function(_0x556b35){_0x3de780=_0x556b35;logger[_0x1460('0x1f')](_0x1460('0x66'),_0x3de780['id']);logger[_0x1460('0x1f')](_0x1460('0x67'),_0x3de780['id'],_0x155a6d['name'],_0x14d585[_0x1460('0x3e')]);switch(_0x14d585[_0x1460('0x3e')]){case'integrationTab':emit(util['format']('user:%s',_0x155a6d[_0x1460('0x55')]),_0x1460('0x68'),{'recordId':_0x3de780['id']});break;case _0x1460('0x69'):emit(util[_0x1460('0x46')](_0x1460('0x6a'),_0x155a6d['name']),_0x1460('0x6b'),{'uri':util['format']('%s/%s/e',_0x4fe4da[_0x1460('0x6c')],_0x3de780['id'])});break;default:logger[_0x1460('0x6d')](_0x1460('0x6e'));}})[_0x1460('0x6f')](function(_0x505dd7){logger[_0x1460('0x6d')]('[QUEUE]',_0x505dd7);});};exports[_0x1460('0x70')]=function(_0x54b33a,_0x479b44,_0x5a49e7,_0x5a41e4,_0x6ea9b7,_0xd3c6ec,_0x118c98){var _0x4ce069,_0x35a657,_0x173794,_0x217939;_0xd3c6ec['serverUrl']=intUtil['stripTrailingSlash'](_0xd3c6ec[_0x1460('0x5d')]);_0xd3c6ec[_0x1460('0x57')]=intUtil[_0x1460('0x5c')](_0xd3c6ec[_0x1460('0x57')]);if(_0x118c98&&_0x118c98[_0x1460('0x71')]&&_0x118c98[_0x1460('0x71')]!==_0x1460('0x72')){logger[_0x1460('0x1f')](_0x1460('0x73'),_0x1460('0x5f'));_0x479b44[_0x1460('0x74')]=util[_0x1460('0x46')](_0x1460('0x75'),_0xd3c6ec[_0x1460('0x5d')],_0x479b44[_0x1460('0x60')],md5(_0x479b44['uniqueid']));}return getConnection(_0xd3c6ec)[_0x1460('0x26')](function(_0xc533b0){_0x217939=_0xc533b0;return getUser(_0xd3c6ec,_0x5a41e4[_0x1460('0x61')],_0x217939);})[_0x1460('0x26')](function(_0x4be5a9){_0x4ce069=_0x4be5a9;return getEndUser(_0xd3c6ec,_0x5a49e7,_0x479b44['destcalleridname'],_0x479b44[_0x1460('0x76')],_0x217939);})[_0x1460('0x26')](function(_0x2b16dc){_0x35a657=_0x2b16dc;return getTicket(_0xd3c6ec,_0x4ce069,_0x35a657,_0x5a49e7,_0x479b44,_0x5a49e7[_0x1460('0x64')],_0x217939,_0x1460('0x70'));})[_0x1460('0x26')](function(_0x20bef0){_0x173794=_0x20bef0;logger['info'](_0x1460('0x77'),_0x173794['id']);logger[_0x1460('0x1f')](_0x1460('0x78'),_0x173794['id'],_0x5a41e4[_0x1460('0x55')],_0xd3c6ec[_0x1460('0x3e')]);switch(_0xd3c6ec[_0x1460('0x3e')]){case _0x1460('0x79'):emit(util[_0x1460('0x46')](_0x1460('0x6a'),_0x5a41e4[_0x1460('0x55')]),'trigger:salesforce:display',{'recordId':_0x173794['id']});break;case'newTab':emit(util[_0x1460('0x46')](_0x1460('0x6a'),_0x5a41e4[_0x1460('0x55')]),_0x1460('0x6b'),{'uri':util[_0x1460('0x46')]('%s/%s/e',_0x217939[_0x1460('0x6c')],_0x173794['id'])});break;default:logger[_0x1460('0x6d')](_0x1460('0x73'),_0x1460('0x7a'));}})[_0x1460('0x6f')](function(_0xbe335a){logger[_0x1460('0x6d')]('[OUTBOUND]',_0xbe335a);});};exports[_0x1460('0x7b')]=function(_0x5370f2,_0x5b3cfd,_0x29e84d,_0xf7a8b,_0x5f02b9,_0x491df1){var _0x2480e9,_0x28698f,_0x4b06ae,_0x3eee94;_0x491df1[_0x1460('0x5d')]=intUtil[_0x1460('0x5c')](_0x491df1['serverUrl']);_0x491df1[_0x1460('0x57')]=intUtil[_0x1460('0x5c')](_0x491df1[_0x1460('0x57')]);if(_0x5f02b9&&_0x5f02b9[_0x1460('0x5e')]){logger[_0x1460('0x1f')]('['+_0x5b3cfd[_0x1460('0x7c')]['toUpperCase']()+']',_0x1460('0x5f'));_0x5b3cfd[_0x1460('0x74')]=util[_0x1460('0x46')](_0x1460('0x75'),_0x491df1[_0x1460('0x5d')],_0x5b3cfd[_0x1460('0x60')],md5(_0x5b3cfd[_0x1460('0x60')]));}else{_0x5b3cfd['recordingURL']='';}return getConnection(_0x491df1)[_0x1460('0x26')](function(_0x415476){_0x3eee94=_0x415476;if(!_[_0x1460('0x22')](_0xf7a8b)){return getUser(_0x491df1,_0xf7a8b[_0x1460('0x55')],_0x3eee94);}else{return getUser(_0x491df1,null,_0x3eee94);}})['then'](function(_0x213251){_0x2480e9=_0x213251;return getEndUser(_0x491df1,_0x29e84d,_0x5b3cfd[_0x1460('0x62')],_0x5b3cfd[_0x1460('0x63')],_0x3eee94);})[_0x1460('0x26')](function(_0x188d64){_0x28698f=_0x188d64;return getTicket(_0x491df1,_0x2480e9,_0x28698f,_0x29e84d,_0x5b3cfd,_0x29e84d['Fields'],_0x3eee94);})[_0x1460('0x26')](function(_0x59c1a3){_0x4b06ae=_0x59c1a3;logger[_0x1460('0x1f')]('['+_0x5b3cfd['lastevent'][_0x1460('0x7d')]()+_0x1460('0x7e'),_0x4b06ae['id']);logger[_0x1460('0x1f')]('['+_0x5b3cfd[_0x1460('0x7c')][_0x1460('0x7d')]()+_0x1460('0x7f'),_0x491df1[_0x1460('0x3e')]);})['catch'](function(_0x1f3727){logger['error']('['+_0x5b3cfd[_0x1460('0x7c')][_0x1460('0x7d')]()+']',_0x1f3727);});}; \ 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 2d65a8d..ea81535 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 _0x7708=['picklist','type','nameField','toString','customField','idField','content','variable','variableName','toLowerCase','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Fields','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','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','trigger:browser:url','username','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%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','inspect','lodash','bluebird','util','../../../../config/logger','servicenow','defaults','localhost','socket.io-emitter','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','sys_id','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','user','endUserNumber','System','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string'];(function(_0x384452,_0x5ebb37){var _0x1d8a9d=function(_0x167e3e){while(--_0x167e3e){_0x384452['push'](_0x384452['shift']());}};_0x1d8a9d(++_0x5ebb37);}(_0x7708,0x188));var _0x8770=function(_0x2ee790,_0x5a8661){_0x2ee790=_0x2ee790-0x0;var _0x5a54a5=_0x7708[_0x2ee790];return _0x5a54a5;};'use strict';var _=require(_0x8770('0x0'));var Promise=require(_0x8770('0x1'));var rp=require('request-promise');var util=require(_0x8770('0x2'));var md5=require('md5');var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x8770('0x3'))(_0x8770('0x4'));config['redis']=_[_0x8770('0x5')](config['redis'],{'host':_0x8770('0x6'),'port':0x18eb});var io=require(_0x8770('0x7'))(new Redis(config[_0x8770('0x8')]));function getAdminUser(_0x20e293,_0x212b12,_0x3e1113,_0x2d4a1d,_0x4fc512,_0x396322){return new Promise(function(_0x2ca830,_0x3f357a){var _0x4e4551={'method':_0x8770('0x9'),'uri':_0x2d4a1d+_0x8770('0xa')+'&'+_0x4fc512+'&'+_0x396322,'auth':_0x212b12,'json':!![]};return rp(_0x4e4551)[_0x8770('0xb')](function(_0x3d81ab){if(_0x3d81ab['result'][_0x8770('0xc')]>0x0){_0x3e1113[_0x8770('0xd')]=_0x3d81ab[_0x8770('0xe')][0x0]['sys_id'];}logger[_0x8770('0xf')]('['+[_0x20e293[_0x8770('0x10')]()]+_0x8770('0x11'),_0x3e1113);_0x2ca830(_0x3e1113);})[_0x8770('0x12')](function(_0x2f2571){logger[_0x8770('0x13')]('['+[_0x20e293[_0x8770('0x10')]()]+']',_0x2f2571[_0x8770('0x14')]);_0x3f357a(_0x2f2571['message']);});});}function getUser(_0x1d15d6,_0x106a20,_0x5dd4e7,_0x2f7918,_0x52254f){return function(_0x1c8ab6){logger['info']('['+[_0x1d15d6['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x1c8ab6);return new Promise(function(_0x155e83,_0x3b459a){if(intUtil[_0x8770('0x15')](_0x1c8ab6[_0x8770('0x16')])){var _0x4b0691={'method':'GET','uri':_0x5dd4e7+_0x8770('0x17')+_0x1c8ab6[_0x8770('0x16')]+'&'+_0x2f7918+'&'+_0x52254f,'auth':_0x106a20,'json':!![]};logger[_0x8770('0xf')]('['+[_0x1d15d6[_0x8770('0x10')]()]+_0x8770('0x18'),_0x4b0691);return rp(_0x4b0691)['then'](function(_0x3e1fe7){logger[_0x8770('0xf')]('['+[_0x1d15d6[_0x8770('0x10')]()]+_0x8770('0x19'),_0x3e1fe7);if(_0x3e1fe7['result']['length']>0x0&&String(_0x3e1fe7[_0x8770('0xe')][0x0][_0x8770('0x1a')])===_0x8770('0x1b')){_0x1c8ab6[_0x8770('0x1c')]=_0x3e1fe7[_0x8770('0xe')][0x0][_0x8770('0x1d')];}else{_0x1c8ab6['userId']=_0x1c8ab6[_0x8770('0xd')];_0x1c8ab6[_0x8770('0x16')]=_0x1c8ab6[_0x8770('0x1e')];}logger[_0x8770('0xf')]('['+[_0x1d15d6['toUpperCase']()]+_0x8770('0x1f'),_0x1c8ab6);_0x155e83(_0x1c8ab6);})['catch'](function(_0x7b4755){logger[_0x8770('0x13')]('['+[_0x1d15d6[_0x8770('0x10')]()]+']',_0x7b4755[_0x8770('0x14')]);_0x3b459a(_0x7b4755[_0x8770('0x14')]);});}else{logger[_0x8770('0xf')]('['+[_0x1d15d6[_0x8770('0x10')]()]+_0x8770('0x20'));_0x1c8ab6[_0x8770('0x1c')]=_0x1c8ab6[_0x8770('0xd')];_0x1c8ab6['userEmail']=_0x1c8ab6[_0x8770('0x1e')];_0x155e83(_0x1c8ab6);}});};}function createEndUser(_0x199b96,_0x1df627,_0x5c7bd,_0x246128,_0x200a82){logger['info']('['+[_0x199b96['toUpperCase']()]+_0x8770('0x21'),_0x5c7bd);return new Promise(function(_0x11de6e,_0x22f0b0){var _0x365080={'method':_0x8770('0x22'),'uri':_0x246128+'sys_user?'+_0x200a82,'body':{'user_name':_0x5c7bd['endUserNumber'],'roles':_0x8770('0x23'),'first_name':_0x5c7bd[_0x8770('0x24')],'active':_0x8770('0x1b'),'date_format':_0x8770('0x25'),'phone':_0x5c7bd['endUserNumber']},'auth':_0x1df627,'json':!![]};return rp(_0x365080)[_0x8770('0xb')](function(_0x501741){logger['info']('['+[_0x199b96[_0x8770('0x10')]()]+'],\x20EndUser\x20schema',_0x501741[_0x8770('0xe')]);_0x5c7bd[_0x8770('0x26')]=_0x501741[_0x8770('0xe')][_0x8770('0x1d')];_0x11de6e(_0x5c7bd);})[_0x8770('0x12')](function(_0x3862ad){logger[_0x8770('0x13')]('['+[_0x199b96[_0x8770('0x10')]()]+']',_0x3862ad[_0x8770('0x14')]);_0x22f0b0(_0x3862ad['message']);});});}function getEndUser(_0x971edb,_0xd35997,_0x1cfbf4,_0x5c627c,_0x5224ce){return function(_0x1b4b8f){logger[_0x8770('0xf')]('['+[_0x971edb[_0x8770('0x10')]()]+'],\x20getEndUser\x20input\x20crm',_0x1b4b8f);return new Promise(function(_0x157898,_0x59cb90){var _0x255746={'method':_0x8770('0x9'),'uri':_0x1cfbf4+_0x8770('0x27')+_0x1b4b8f[_0x8770('0x24')]+'&'+_0x5c627c+'&'+_0x5224ce,'auth':_0xd35997,'json':!![]};return rp(_0x255746)[_0x8770('0xb')](function(_0x25324c){if(_0x25324c[_0x8770('0xe')][_0x8770('0xc')]>0x0){_0x1b4b8f[_0x8770('0x26')]=_0x25324c[_0x8770('0xe')][0x0]['sys_id'];logger[_0x8770('0xf')]('['+[_0x971edb[_0x8770('0x10')]()]+_0x8770('0x28'),_0x1b4b8f);_0x157898(_0x1b4b8f);}else{return createEndUser(_0x971edb,_0xd35997,_0x1b4b8f,_0x1cfbf4,_0x5c627c)['then'](function(_0x37279b){logger[_0x8770('0xf')]('['+[_0x971edb[_0x8770('0x10')]()]+_0x8770('0x29'),_0x37279b);_0x157898(_0x37279b);});}})[_0x8770('0x12')](function(_0x3a50db){logger['error']('['+[_0x971edb[_0x8770('0x10')]()]+']',_0x3a50db['message']);_0x59cb90(_0x3a50db[_0x8770('0x14')]);});});};}function getCustomFields(_0x57f52e,_0x41134a){var _0x411c54={};if(_0x57f52e[_0x8770('0xc')]>0x0){_['forEach'](_0x57f52e,function(_0x13a909){if(_[_0x8770('0x2a')]([_0x8770('0x2b'),_0x8770('0x2c')],_0x13a909[_0x8770('0x2d')])&&_0x13a909[_0x8770('0x2e')]&&!_0x13a909['customField']){_0x411c54[_0x13a909[_0x8770('0x2e')]['toLowerCase']()]=_0x13a909['content'][_0x8770('0x2f')]();}else if(_[_0x8770('0x2a')]([_0x8770('0x2b'),_0x8770('0x2c')],_0x13a909[_0x8770('0x2d')])&&_0x13a909['idField']&&_0x13a909[_0x8770('0x30')]){_0x411c54[_0x13a909[_0x8770('0x31')]['toLowerCase']()]=_0x13a909[_0x8770('0x32')]['toString']();}else if(_0x13a909[_0x8770('0x2d')]===_0x8770('0x33')&&_0x13a909[_0x8770('0x34')]&&_0x13a909[_0x8770('0x31')]&&_0x13a909[_0x8770('0x30')]){_0x411c54[_0x13a909[_0x8770('0x31')][_0x8770('0x35')]()]=_0x41134a[_0x13a909[_0x8770('0x34')]][_0x8770('0x2f')]();}else if(_0x13a909[_0x8770('0x2d')]===_0x8770('0x36')&&_0x13a909['Variable']&&_0x13a909[_0x8770('0x37')][_0x8770('0x38')]&&_0x13a909[_0x8770('0x31')]&&_0x13a909[_0x8770('0x30')]){_0x411c54[_0x13a909[_0x8770('0x31')][_0x8770('0x35')]()]=_0x41134a[_0x13a909['Variable'][_0x8770('0x38')][_0x8770('0x35')]()][_0x8770('0x2f')]();}});}return _0x411c54;}function getTicket(_0x1c44bf,_0x76c319,_0x281f94,_0x165974,_0xe31cfb,_0x5cc8de){return function(_0x27b703){logger[_0x8770('0xf')]('['+[_0x1c44bf[_0x8770('0x10')]()]+_0x8770('0x39'),_0x27b703);return new Promise(function(_0x454496,_0x5d6bbe){var _0x5e49dc=_0x1c44bf[_0x8770('0x35')]()==='outbound'?_0x27b703[_0x8770('0x1c')]:_0x27b703['endUserId'];var _0x4f9e0b={'method':_0x8770('0x22'),'uri':_0x281f94+_0x8770('0x3a')+'?'+_0x5cc8de,'body':Object[_0x8770('0x3b')]({},{'active':_0x8770('0x1b'),'caller_id':_0x5e49dc,'assigned_to':_0x27b703['userId'],'short_description':intUtil[_0x8770('0x3c')](_0x165974[_0x8770('0x3d')],_0xe31cfb,'\x20'),'description':intUtil['getString'](_0x165974['Descriptions'],_0xe31cfb,'\x0a')},getCustomFields(_0x165974[_0x8770('0x3e')],_0xe31cfb)),'auth':_0x76c319,'json':!![]};return rp(_0x4f9e0b)[_0x8770('0xb')](function(_0x10890f){logger['info']('['+[_0x1c44bf[_0x8770('0x10')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x10890f[_0x8770('0xe')]);_0x27b703[_0x8770('0x3f')]=_0x10890f[_0x8770('0xe')]['sys_id'];_0x27b703[_0x8770('0x40')]=_0x10890f['result']['number'];logger['info']('['+[_0x1c44bf[_0x8770('0x10')]()]+_0x8770('0x41'),_0x27b703);_0x454496(_0x27b703);})[_0x8770('0x12')](function(_0x26b27c){logger[_0x8770('0x13')]('['+[_0x1c44bf[_0x8770('0x10')]()]+']',_0x26b27c['message']);_0x5d6bbe(_0x26b27c[_0x8770('0x14')]);});});};}function createRemoteTag(_0x56bf7b,_0x314e20,_0x3bcccc,_0x475e9d){return new Promise(function(_0x3e4f77,_0x5b5cce){var _0x1d17b7={'method':_0x8770('0x22'),'uri':_0x3bcccc+'label'+'?'+_0x475e9d,'body':{'short_description':_0x56bf7b,'global':!![],'active':!![],'name':_0x56bf7b},'auth':_0x314e20,'json':!![]};return rp(_0x1d17b7)['then'](function(_0x552cab){var _0x48f12c=_0x552cab[_0x8770('0xe')][_0x8770('0x1d')];_0x3e4f77(_0x48f12c);});});}function getRemoteTag(_0x5c772e,_0x471409,_0x38b68f,_0x435c23,_0x35340d){return new Promise(function(_0x217c9f,_0x2227fd){var _0x9c33dd={'method':_0x8770('0x9'),'uri':_0x38b68f+_0x8770('0x42')+_0x8770('0x43')+_0x5c772e+'&'+_0x435c23,'auth':_0x471409,'json':!![]};return rp(_0x9c33dd)[_0x8770('0xb')](function(_0x528f67){if(_0x528f67[_0x8770('0xe')][_0x8770('0xc')]>0x0){var _0x25dc3d=_0x528f67['result'][0x0][_0x8770('0x1d')];_0x217c9f(_0x25dc3d);}else{return createRemoteTag(_0x5c772e,_0x471409,_0x38b68f,_0x435c23)[_0x8770('0xb')](function(_0x2af03b){_0x217c9f(_0x2af03b);});}});});}function assignTagToIncident(_0x47e431,_0x2aecc0,_0xbe9c4c,_0x5b1548,_0x3a2070){return new Promise(function(_0x5c4277,_0x4b42b1){var _0x4e9fe5={'method':'POST','uri':_0xbe9c4c+_0x8770('0x44')+'?'+_0x3a2070,'body':{'label':_0x47e431,'table':_0x8770('0x3a'),'id_type':_0x8770('0x45'),'table_key':_0x5b1548[_0x8770('0x3f')],'title':_0x8770('0x46')+_0x5b1548[_0x8770('0x40')],'id_display':_0x5b1548[_0x8770('0x40')]},'auth':_0x2aecc0,'json':!![]};return rp(_0x4e9fe5)[_0x8770('0xb')](function(_0x535041){_0x5c4277();})[_0x8770('0x12')](function(){_0x5c4277();});});}function manageTags(_0x18a31d,_0x5cd7a1,_0x49295d,_0xe34666,_0x51bd21,_0x8e5aad,_0x6d7baf){return new Promise(function(_0x529359,_0x32d0d1){var _0x339d70=[];_0x5cd7a1[_0x8770('0x47')](function(_0x3cab84){_0x339d70[_0x8770('0x48')](getRemoteTag(_0x3cab84,_0x49295d,_0xe34666,_0x8e5aad,_0x6d7baf));});return Promise[_0x8770('0x49')](_0x339d70)[_0x8770('0xb')](function(_0x179df6){if(_0x179df6[_0x8770('0xc')]){logger[_0x8770('0xf')]('['+[_0x18a31d[_0x8770('0x10')]()]+_0x8770('0x4a'),_0x179df6);var _0x1dcb75=[];_0x179df6['forEach'](function(_0x2f3ae5){_0x1dcb75[_0x8770('0x48')](assignTagToIncident(_0x2f3ae5,_0x49295d,_0xe34666,_0x51bd21,_0x8e5aad));});return Promise[_0x8770('0x49')](_0x1dcb75)[_0x8770('0xb')](function(){_0x529359();})[_0x8770('0x12')](function(){_0x529359();});}else{_0x529359();}});});}function getTags(_0x6c24f7,_0x282b70,_0x6f549d,_0x396d47,_0x54cd82,_0xa4f4ce){return function(_0xaf7c89){return new Promise(function(_0x187c94,_0x4cd70a){var _0x2fb8b2=[];var _0x93d72a=_0x396d47['Tags'];if(_0x93d72a&&_0x93d72a[_0x8770('0xc')]>0x0){_0x2fb8b2=_[_0x8770('0x4b')](_0x93d72a,_0x8770('0x38'));}if(_0x2fb8b2[_0x8770('0xc')]>0x0){return manageTags(_0x6c24f7,_0x2fb8b2,_0x282b70,_0x6f549d,_0xaf7c89,_0x54cd82,_0xa4f4ce)[_0x8770('0xb')](function(){_0x187c94(_0xaf7c89);});}else{_0x187c94(_0xaf7c89);}});};}function emit(_0x5c7b88,_0x2e54ca,_0x4af913){var _0x2a45c8=_0x8770('0x4c')+_0x8770('0x4d')+_0x8770('0x4e')+_0x8770('0x4f');var _0x30a7c9={'uri':_0x5c7b88+_0x8770('0x50')+_0x4af913+_0x2a45c8};io['to'](util[_0x8770('0x51')](_0x8770('0x52'),_0x2e54ca))['emit'](_0x8770('0x53'),_0x30a7c9);}exports['cs']=function(_0x3fca1c,_0x305fa0,_0xdfefac,_0x2615ad,_0xe2ae6e,_0x11edd0,_0x1075cb,_0x3ad340){var _0x5bc91c={};var _0x5caef5={'user':_0x11edd0[_0x8770('0x54')],'pass':_0x11edd0['password']};var _0x20e51='sysparm_limit=1';var _0x49dc67='sysparm_display_value=true';_0x11edd0[_0x8770('0x55')]=intUtil[_0x8770('0x56')](_0x11edd0[_0x8770('0x55')]);_0x11edd0[_0x8770('0x57')]=intUtil[_0x8770('0x56')](_0x11edd0[_0x8770('0x57')]);var _0x19b2ed=util[_0x8770('0x51')](_0x8770('0x58'),_0x11edd0[_0x8770('0x55')]);_0x5bc91c[_0x8770('0x16')]=!_[_0x8770('0x59')](_0x2615ad)?_0x2615ad[_0x8770('0x5a')]:null;_0x5bc91c[_0x8770('0x1e')]=_0x11edd0[_0x8770('0x5a')];_0x5bc91c[_0x8770('0x24')]=_0x3ad340['toLowerCase']()===_0x8770('0x5b')?_0x305fa0[_0x8770('0x5c')]:_0x305fa0[_0x8770('0x5d')];_0x5bc91c[_0x8770('0x5e')]=_0x3ad340===_0x8770('0x5f')||_0x3ad340===_0x8770('0x60')?_0x8770('0x5f'):_0x8770('0x5b');var _0x2ab10c=util[_0x8770('0x51')](_0x8770('0x61'),_0x11edd0[_0x8770('0x57')],_0x305fa0[_0x8770('0x62')],md5(_0x305fa0['uniqueid']));if(_0xe2ae6e&&_0xe2ae6e[_0x8770('0x63')]){logger['info'](_0x8770('0x64'),_0x8770('0x65'));_0x305fa0['recordingURL']=_0x2ab10c;}else if(_0x1075cb&&_0x1075cb[_0x8770('0x66')]&&_0x1075cb[_0x8770('0x66')]!==_0x8770('0x67')){logger[_0x8770('0xf')](_0x8770('0x68'),_0x8770('0x65'));_0x305fa0[_0x8770('0x69')]=_0x2ab10c;}else{_0x305fa0['recordingURL']='';}return getAdminUser(_0x3ad340,_0x5caef5,_0x5bc91c,_0x19b2ed,_0x49dc67,_0x20e51)[_0x8770('0xb')](getUser(_0x3ad340,_0x5caef5,_0x19b2ed,_0x49dc67,_0x20e51))[_0x8770('0xb')](getEndUser(_0x3ad340,_0x5caef5,_0x19b2ed,_0x49dc67,_0x20e51))[_0x8770('0xb')](getTicket(_0x3ad340,_0x5caef5,_0x19b2ed,_0xdfefac,_0x305fa0,_0x49dc67))['then'](function(_0x42a413){logger[_0x8770('0xf')](util[_0x8770('0x51')](_0x8770('0x6a'),_0x42a413[_0x8770('0x3f')]));logger[_0x8770('0xf')](util[_0x8770('0x51')](_0x8770('0x6b'),_0x3ad340));if(_0x3ad340!==_0x8770('0x60')){logger[_0x8770('0xf')]('['+[_0x3ad340['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x11edd0[_0x8770('0x55')],_0x2615ad[_0x8770('0x38')],_0x42a413[_0x8770('0x3f')]);}})[_0x8770('0x12')](function(_0x5b930f){logger['error']('['+[_0x3ad340[_0x8770('0x10')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x8770('0x6c')](_0x5b930f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xfcbb=['number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','ticketNumber','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','queue','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','],\x20getAdminUser\x20crm','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','length','active','true','userId','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','toString','idField','type','variableName','customVariable','Variable','name','outbound','incident','assign','Subjects','Descriptions','ticketId'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x508293,_0x3ed3dd){_0x508293=_0x508293-0x0;var _0x42e494=_0xfcbb[_0x508293];return _0x42e494;};'use strict';var _=require(_0xbfcb('0x0'));var Promise=require(_0xbfcb('0x1'));var rp=require(_0xbfcb('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0xbfcb('0x3'));var intUtil=require(_0xbfcb('0x4'));var config=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));config['redis']=_['defaults'](config[_0xbfcb('0x8')],{'host':_0xbfcb('0x9'),'port':0x18eb});var io=require(_0xbfcb('0xa'))(new Redis(config[_0xbfcb('0x8')]));function getAdminUser(_0x288ee5,_0x2f875c,_0x49717b,_0x571001,_0x22cef4,_0x331173){return new Promise(function(_0x346685,_0x52b2f8){var _0x2c72f3={'method':_0xbfcb('0xb'),'uri':_0x571001+_0xbfcb('0xc')+'&'+_0x22cef4+'&'+_0x331173,'auth':_0x2f875c,'json':!![]};return rp(_0x2c72f3)[_0xbfcb('0xd')](function(_0x3df51a){if(_0x3df51a[_0xbfcb('0xe')]['length']>0x0){_0x49717b[_0xbfcb('0xf')]=_0x3df51a[_0xbfcb('0xe')][0x0][_0xbfcb('0x10')];}logger[_0xbfcb('0x11')]('['+[_0x288ee5['toUpperCase']()]+_0xbfcb('0x12'),_0x49717b);_0x346685(_0x49717b);})['catch'](function(_0x211a30){logger[_0xbfcb('0x13')]('['+[_0x288ee5[_0xbfcb('0x14')]()]+']',_0x211a30[_0xbfcb('0x15')]);_0x52b2f8(_0x211a30[_0xbfcb('0x15')]);});});}function getUser(_0xe47707,_0x71304e,_0x2d314a,_0x90ed8c,_0x339347){return function(_0x2c4a85){logger[_0xbfcb('0x11')]('['+[_0xe47707[_0xbfcb('0x14')]()]+_0xbfcb('0x16'),_0x2c4a85);return new Promise(function(_0x318d07,_0x1a4d75){if(intUtil[_0xbfcb('0x17')](_0x2c4a85[_0xbfcb('0x18')])){var _0x3404aa={'method':_0xbfcb('0xb'),'uri':_0x2d314a+_0xbfcb('0x19')+_0x2c4a85[_0xbfcb('0x18')]+'&'+_0x90ed8c+'&'+_0x339347,'auth':_0x71304e,'json':!![]};logger['info']('['+[_0xe47707[_0xbfcb('0x14')]()]+_0xbfcb('0x1a'),_0x3404aa);return rp(_0x3404aa)['then'](function(_0xa3c089){logger[_0xbfcb('0x11')]('['+[_0xe47707['toUpperCase']()]+'],\x20getUser\x20entity',_0xa3c089);if(_0xa3c089[_0xbfcb('0xe')][_0xbfcb('0x1b')]>0x0&&String(_0xa3c089[_0xbfcb('0xe')][0x0][_0xbfcb('0x1c')])===_0xbfcb('0x1d')){_0x2c4a85['userId']=_0xa3c089[_0xbfcb('0xe')][0x0][_0xbfcb('0x10')];}else{_0x2c4a85[_0xbfcb('0x1e')]=_0x2c4a85[_0xbfcb('0xf')];_0x2c4a85[_0xbfcb('0x18')]=_0x2c4a85[_0xbfcb('0x1f')];}logger[_0xbfcb('0x11')]('['+[_0xe47707[_0xbfcb('0x14')]()]+_0xbfcb('0x20'),_0x2c4a85);_0x318d07(_0x2c4a85);})[_0xbfcb('0x21')](function(_0x1ca8c3){logger[_0xbfcb('0x13')]('['+[_0xe47707[_0xbfcb('0x14')]()]+']',_0x1ca8c3[_0xbfcb('0x15')]);_0x1a4d75(_0x1ca8c3[_0xbfcb('0x15')]);});}else{logger[_0xbfcb('0x11')]('['+[_0xe47707['toUpperCase']()]+_0xbfcb('0x22'));_0x2c4a85[_0xbfcb('0x1e')]=_0x2c4a85['adminId'];_0x2c4a85[_0xbfcb('0x18')]=_0x2c4a85[_0xbfcb('0x1f')];_0x318d07(_0x2c4a85);}});};}function createEndUser(_0x781773,_0xa57d71,_0xf4b944,_0x3542e9,_0x4069a7){logger[_0xbfcb('0x11')]('['+[_0x781773[_0xbfcb('0x14')]()]+_0xbfcb('0x23'),_0xf4b944);return new Promise(function(_0x59719b,_0x17cd0e){var _0x3aa3cd={'method':_0xbfcb('0x24'),'uri':_0x3542e9+_0xbfcb('0x25')+_0x4069a7,'body':{'user_name':_0xf4b944[_0xbfcb('0x26')],'roles':_0xbfcb('0x27'),'first_name':_0xf4b944[_0xbfcb('0x26')],'active':_0xbfcb('0x1d'),'date_format':_0xbfcb('0x28'),'phone':_0xf4b944['endUserNumber']},'auth':_0xa57d71,'json':!![]};return rp(_0x3aa3cd)[_0xbfcb('0xd')](function(_0xaa6ae6){logger[_0xbfcb('0x11')]('['+[_0x781773[_0xbfcb('0x14')]()]+'],\x20EndUser\x20schema',_0xaa6ae6['result']);_0xf4b944[_0xbfcb('0x29')]=_0xaa6ae6[_0xbfcb('0xe')][_0xbfcb('0x10')];_0x59719b(_0xf4b944);})[_0xbfcb('0x21')](function(_0x32d9a2){logger[_0xbfcb('0x13')]('['+[_0x781773[_0xbfcb('0x14')]()]+']',_0x32d9a2['message']);_0x17cd0e(_0x32d9a2['message']);});});}function getEndUser(_0x5243ee,_0x1eab10,_0x552a22,_0xda9f61,_0x410948){return function(_0x505b0d){logger['info']('['+[_0x5243ee[_0xbfcb('0x14')]()]+_0xbfcb('0x2a'),_0x505b0d);return new Promise(function(_0x12deab,_0x156b1e){var _0x530208={'method':_0xbfcb('0xb'),'uri':_0x552a22+_0xbfcb('0x2b')+_0x505b0d['endUserNumber']+'&'+_0xda9f61+'&'+_0x410948,'auth':_0x1eab10,'json':!![]};return rp(_0x530208)['then'](function(_0x2cf31f){if(_0x2cf31f['result']['length']>0x0){_0x505b0d[_0xbfcb('0x29')]=_0x2cf31f[_0xbfcb('0xe')][0x0][_0xbfcb('0x10')];logger[_0xbfcb('0x11')]('['+[_0x5243ee['toUpperCase']()]+_0xbfcb('0x2c'),_0x505b0d);_0x12deab(_0x505b0d);}else{return createEndUser(_0x5243ee,_0x1eab10,_0x505b0d,_0x552a22,_0xda9f61)[_0xbfcb('0xd')](function(_0x369c96){logger[_0xbfcb('0x11')]('['+[_0x5243ee[_0xbfcb('0x14')]()]+_0xbfcb('0x2d'),_0x369c96);_0x12deab(_0x369c96);});}})['catch'](function(_0x2fc01f){logger['error']('['+[_0x5243ee[_0xbfcb('0x14')]()]+']',_0x2fc01f['message']);_0x156b1e(_0x2fc01f[_0xbfcb('0x15')]);});});};}function getCustomFields(_0x2e4406,_0xe719cd){var _0x1d083b={};if(_0x2e4406[_0xbfcb('0x1b')]>0x0){_[_0xbfcb('0x2e')](_0x2e4406,function(_0x453714){if(_[_0xbfcb('0x2f')]([_0xbfcb('0x30'),_0xbfcb('0x31')],_0x453714['type'])&&_0x453714[_0xbfcb('0x32')]&&!_0x453714[_0xbfcb('0x33')]){_0x1d083b[_0x453714['nameField'][_0xbfcb('0x34')]()]=_0x453714[_0xbfcb('0x35')][_0xbfcb('0x36')]();}else if(_[_0xbfcb('0x2f')]([_0xbfcb('0x30'),_0xbfcb('0x31')],_0x453714['type'])&&_0x453714[_0xbfcb('0x37')]&&_0x453714[_0xbfcb('0x33')]){_0x1d083b[_0x453714[_0xbfcb('0x37')]['toLowerCase']()]=_0x453714[_0xbfcb('0x35')][_0xbfcb('0x36')]();}else if(_0x453714[_0xbfcb('0x38')]==='variable'&&_0x453714[_0xbfcb('0x39')]&&_0x453714[_0xbfcb('0x37')]&&_0x453714['customField']){_0x1d083b[_0x453714['idField'][_0xbfcb('0x34')]()]=_0xe719cd[_0x453714[_0xbfcb('0x39')]]['toString']();}else if(_0x453714[_0xbfcb('0x38')]===_0xbfcb('0x3a')&&_0x453714['Variable']&&_0x453714[_0xbfcb('0x3b')][_0xbfcb('0x3c')]&&_0x453714[_0xbfcb('0x37')]&&_0x453714[_0xbfcb('0x33')]){_0x1d083b[_0x453714[_0xbfcb('0x37')][_0xbfcb('0x34')]()]=_0xe719cd[_0x453714[_0xbfcb('0x3b')][_0xbfcb('0x3c')][_0xbfcb('0x34')]()][_0xbfcb('0x36')]();}});}return _0x1d083b;}function getTicket(_0x2c0f18,_0x2e5911,_0x5f307b,_0x12889b,_0x3f7282,_0x124293){return function(_0x4c83fc){logger[_0xbfcb('0x11')]('['+[_0x2c0f18['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x4c83fc);return new Promise(function(_0x2dcfb3,_0x20918c){var _0x8948f6=_0x2c0f18['toLowerCase']()===_0xbfcb('0x3d')?_0x4c83fc['userId']:_0x4c83fc['endUserId'];var _0x33725a={'method':'POST','uri':_0x5f307b+_0xbfcb('0x3e')+'?'+_0x124293,'body':Object[_0xbfcb('0x3f')]({},{'active':'true','caller_id':_0x8948f6,'assigned_to':_0x4c83fc[_0xbfcb('0x1e')],'short_description':intUtil['getString'](_0x12889b[_0xbfcb('0x40')],_0x3f7282,'\x20'),'description':intUtil['getString'](_0x12889b[_0xbfcb('0x41')],_0x3f7282,'\x0a')},getCustomFields(_0x12889b['Fields'],_0x3f7282)),'auth':_0x2e5911,'json':!![]};return rp(_0x33725a)[_0xbfcb('0xd')](function(_0x423822){logger['info']('['+[_0x2c0f18[_0xbfcb('0x14')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x423822['result']);_0x4c83fc[_0xbfcb('0x42')]=_0x423822[_0xbfcb('0xe')][_0xbfcb('0x10')];_0x4c83fc['ticketNumber']=_0x423822['result'][_0xbfcb('0x43')];logger[_0xbfcb('0x11')]('['+[_0x2c0f18[_0xbfcb('0x14')]()]+_0xbfcb('0x44'),_0x4c83fc);_0x2dcfb3(_0x4c83fc);})[_0xbfcb('0x21')](function(_0x5aadfe){logger[_0xbfcb('0x13')]('['+[_0x2c0f18[_0xbfcb('0x14')]()]+']',_0x5aadfe[_0xbfcb('0x15')]);_0x20918c(_0x5aadfe[_0xbfcb('0x15')]);});});};}function createRemoteTag(_0x4d1264,_0x4f50be,_0xbcb336,_0x50f9f7){return new Promise(function(_0x9cc2bd,_0x5e5a76){var _0x485cbf={'method':_0xbfcb('0x24'),'uri':_0xbcb336+'label'+'?'+_0x50f9f7,'body':{'short_description':_0x4d1264,'global':!![],'active':!![],'name':_0x4d1264},'auth':_0x4f50be,'json':!![]};return rp(_0x485cbf)['then'](function(_0x27058a){var _0x53842f=_0x27058a[_0xbfcb('0xe')]['sys_id'];_0x9cc2bd(_0x53842f);});});}function getRemoteTag(_0xafb570,_0x3ce078,_0x593f4e,_0x35cd27,_0x5ac9bc){return new Promise(function(_0x33f97a,_0x578ade){var _0x3cd568={'method':_0xbfcb('0xb'),'uri':_0x593f4e+_0xbfcb('0x45')+_0xbfcb('0x46')+_0xafb570+'&'+_0x35cd27,'auth':_0x3ce078,'json':!![]};return rp(_0x3cd568)[_0xbfcb('0xd')](function(_0x4421fc){if(_0x4421fc[_0xbfcb('0xe')]['length']>0x0){var _0x9c9b13=_0x4421fc['result'][0x0][_0xbfcb('0x10')];_0x33f97a(_0x9c9b13);}else{return createRemoteTag(_0xafb570,_0x3ce078,_0x593f4e,_0x35cd27)[_0xbfcb('0xd')](function(_0x2e840e){_0x33f97a(_0x2e840e);});}});});}function assignTagToIncident(_0x112f7d,_0x5eaf39,_0x558da0,_0x3a0945,_0x48c7b4){return new Promise(function(_0x2c0cbe,_0x1802f4){var _0x29b410={'method':_0xbfcb('0x24'),'uri':_0x558da0+_0xbfcb('0x47')+'?'+_0x48c7b4,'body':{'label':_0x112f7d,'table':_0xbfcb('0x3e'),'id_type':'Incident','table_key':_0x3a0945[_0xbfcb('0x42')],'title':_0xbfcb('0x48')+_0x3a0945[_0xbfcb('0x49')],'id_display':_0x3a0945[_0xbfcb('0x49')]},'auth':_0x5eaf39,'json':!![]};return rp(_0x29b410)[_0xbfcb('0xd')](function(_0x1b5ec2){_0x2c0cbe();})[_0xbfcb('0x21')](function(){_0x2c0cbe();});});}function manageTags(_0x5d847c,_0x538200,_0x506aa8,_0x2b9a96,_0x14014d,_0x29f445,_0x548083){return new Promise(function(_0xbd3b3b,_0x3f230e){var _0x4e549=[];_0x538200['forEach'](function(_0x547d26){_0x4e549['push'](getRemoteTag(_0x547d26,_0x506aa8,_0x2b9a96,_0x29f445,_0x548083));});return Promise[_0xbfcb('0x4a')](_0x4e549)[_0xbfcb('0xd')](function(_0x13dc5e){if(_0x13dc5e[_0xbfcb('0x1b')]){logger['info']('['+[_0x5d847c[_0xbfcb('0x14')]()]+_0xbfcb('0x4b'),_0x13dc5e);var _0x39a3cf=[];_0x13dc5e['forEach'](function(_0x4bf71a){_0x39a3cf[_0xbfcb('0x4c')](assignTagToIncident(_0x4bf71a,_0x506aa8,_0x2b9a96,_0x14014d,_0x29f445));});return Promise[_0xbfcb('0x4a')](_0x39a3cf)['then'](function(){_0xbd3b3b();})['catch'](function(){_0xbd3b3b();});}else{_0xbd3b3b();}});});}function getTags(_0x4866ef,_0x526563,_0x1866f5,_0x21d070,_0x3c3ab5,_0x2d77f9){return function(_0x3f4e1f){return new Promise(function(_0x44ec09,_0x2ea974){var _0x299e63=[];var _0x55d70e=_0x21d070[_0xbfcb('0x4d')];if(_0x55d70e&&_0x55d70e[_0xbfcb('0x1b')]>0x0){_0x299e63=_[_0xbfcb('0x4e')](_0x55d70e,_0xbfcb('0x3c'));}if(_0x299e63[_0xbfcb('0x1b')]>0x0){return manageTags(_0x4866ef,_0x299e63,_0x526563,_0x1866f5,_0x3f4e1f,_0x3c3ab5,_0x2d77f9)[_0xbfcb('0xd')](function(){_0x44ec09(_0x3f4e1f);});}else{_0x44ec09(_0x3f4e1f);}});};}function emit(_0x20946e,_0x43f60b,_0x582b60){var _0xe35368='%26sysparm_record_target%3Dincident'+_0xbfcb('0x4f')+_0xbfcb('0x50')+_0xbfcb('0x51');var _0x2f0934={'uri':_0x20946e+_0xbfcb('0x52')+_0x582b60+_0xe35368};io['to'](util['format'](_0xbfcb('0x53'),_0x43f60b))[_0xbfcb('0x54')](_0xbfcb('0x55'),_0x2f0934);}exports['cs']=function(_0x1bca83,_0x8d012d,_0x4c01ff,_0x362d57,_0x2132d6,_0x1a6f5e,_0x25abf3,_0x51d6a5){var _0x503a2f={};var _0x467f17={'user':_0x1a6f5e[_0xbfcb('0x56')],'pass':_0x1a6f5e[_0xbfcb('0x57')]};var _0x404395=_0xbfcb('0x58');var _0x238f74=_0xbfcb('0x59');_0x1a6f5e[_0xbfcb('0x5a')]=intUtil[_0xbfcb('0x5b')](_0x1a6f5e[_0xbfcb('0x5a')]);_0x1a6f5e[_0xbfcb('0x5c')]=intUtil[_0xbfcb('0x5b')](_0x1a6f5e[_0xbfcb('0x5c')]);var _0x1acada=util['format'](_0xbfcb('0x5d'),_0x1a6f5e['remoteUri']);_0x503a2f[_0xbfcb('0x18')]=!_[_0xbfcb('0x5e')](_0x362d57)?_0x362d57['email']:null;_0x503a2f[_0xbfcb('0x1f')]=_0x1a6f5e[_0xbfcb('0x5f')];_0x503a2f[_0xbfcb('0x26')]=_0x51d6a5[_0xbfcb('0x34')]()==='outbound'?_0x8d012d[_0xbfcb('0x60')]:_0x8d012d['calleridnum'];_0x503a2f[_0xbfcb('0x61')]=_0x51d6a5===_0xbfcb('0x62')||_0x51d6a5==='unmanaged'?'queue':_0xbfcb('0x3d');var _0x31355a=util[_0xbfcb('0x63')](_0xbfcb('0x64'),_0x1a6f5e[_0xbfcb('0x5c')],_0x8d012d['uniqueid'],md5(_0x8d012d['uniqueid']));if(_0x2132d6&&_0x2132d6[_0xbfcb('0x65')]){logger['info']('[QUEUE]',_0xbfcb('0x66'));_0x8d012d[_0xbfcb('0x67')]=_0x31355a;}else if(_0x25abf3&&_0x25abf3['recordingFormat']&&_0x25abf3[_0xbfcb('0x68')]!==_0xbfcb('0x69')){logger['info'](_0xbfcb('0x6a'),_0xbfcb('0x66'));_0x8d012d[_0xbfcb('0x67')]=_0x31355a;}else{_0x8d012d[_0xbfcb('0x67')]='';}return getAdminUser(_0x51d6a5,_0x467f17,_0x503a2f,_0x1acada,_0x238f74,_0x404395)['then'](getUser(_0x51d6a5,_0x467f17,_0x1acada,_0x238f74,_0x404395))[_0xbfcb('0xd')](getEndUser(_0x51d6a5,_0x467f17,_0x1acada,_0x238f74,_0x404395))[_0xbfcb('0xd')](getTicket(_0x51d6a5,_0x467f17,_0x1acada,_0x4c01ff,_0x8d012d,_0x238f74))[_0xbfcb('0xd')](function(_0x4256c4){logger[_0xbfcb('0x11')](util[_0xbfcb('0x63')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4256c4[_0xbfcb('0x42')]));logger[_0xbfcb('0x11')](util[_0xbfcb('0x63')](_0xbfcb('0x6b'),_0x51d6a5));if(_0x51d6a5!==_0xbfcb('0x6c')){logger[_0xbfcb('0x11')]('['+[_0x51d6a5[_0xbfcb('0x14')]()]+']',_0xbfcb('0x6d'));emit(_0x1a6f5e[_0xbfcb('0x5a')],_0x362d57[_0xbfcb('0x3c')],_0x4256c4[_0xbfcb('0x42')]);}})[_0xbfcb('0x21')](function(_0x5c4ecb){logger['error']('['+[_0x51d6a5[_0xbfcb('0x14')]()]+_0xbfcb('0x6e'),util[_0xbfcb('0x6f')](_0x5c4ecb,{'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 61627c5..0a067f8 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 _0x54b5=['forEach','type','string','customField','nameField','toLowerCase','content','idField','custom_fields','variable','Variable','login','username','password','sessionID','set_relationship','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','none','Outbound','[OUTBOUND]','unmanaged','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Fields','Inbound','contacts','lastevent','lodash','request-promise','bluebird','util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','variableName','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','Agent\x20found!','resolve','value','user_id','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map'];(function(_0x16b33e,_0x56420a){var _0x53b975=function(_0x505085){while(--_0x505085){_0x16b33e['push'](_0x16b33e['shift']());}};_0x53b975(++_0x56420a);}(_0x54b5,0xad));var _0x554b=function(_0x5edee5,_0x437968){_0x5edee5=_0x5edee5-0x0;var _0x12de55=_0x54b5[_0x5edee5];return _0x12de55;};'use strict';var _=require(_0x554b('0x0'));var rp=require(_0x554b('0x1'));var BPromise=require(_0x554b('0x2'));var md5=require('md5');var util=require(_0x554b('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x554b('0x4'));var logger=require(_0x554b('0x5'))(_0x554b('0x6'));config[_0x554b('0x7')]=_[_0x554b('0x8')](config[_0x554b('0x7')],{'host':_0x554b('0x9'),'port':0x18eb});var io=require(_0x554b('0xa'))(new Redis(config[_0x554b('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x5d6dd7,_0x55d785,_0x29f5cb){io['to'](_0x5d6dd7)[_0x554b('0xb')](_0x55d785,_0x29f5cb);}function getTicket(_0x51d274,_0x45b732,_0x350c7a,_0x586538,_0x754473,_0x3b206d,_0x52f5ab,_0x576af5){logger[_0x554b('0xc')](_0x554b('0xd'));var _0x593dc1=new Date();var _0x219934=[{'name':_0x554b('0xe'),'value':intUtil[_0x554b('0xf')](_0x586538[_0x554b('0x10')],_0x754473,'\x20')},{'name':'assigned_user_id','value':_0x45b732['id']},{'name':_0x554b('0x11'),'value':_0x45b732['id']},{'name':_0x554b('0x12'),'value':intUtil['getString'](_0x586538[_0x554b('0x13')],_0x754473,'\x0a')},{'name':_0x554b('0x14'),'value':_0x593dc1[_0x554b('0x15')]()[_0x554b('0x16')](0x0,0x13)[_0x554b('0x17')]('T','\x20')},{'name':_0x554b('0x18'),'value':'0'},{'name':_0x554b('0x19'),'value':'15'},{'name':_0x554b('0x1a'),'value':_0x350c7a['id']},{'name':_0x554b('0x1b'),'value':'Contacts'},{'name':_0x554b('0x1c'),'value':_0x350c7a[_0x554b('0xe')]},{'name':_0x554b('0x1d'),'value':_0x576af5}];if(_0x3b206d[_0x554b('0x1e')]){_['forEach'](_0x3b206d,function(_0x1bc7a2){if(_0x754473[_0x1bc7a2[_0x554b('0x1f')]]){_0x219934[_0x554b('0x20')]({'name':_0x1bc7a2['idField'],'value':_0x754473[_0x1bc7a2[_0x554b('0x1f')]]});}});}return request({'form':{'method':_0x554b('0x21'),'input_type':_0x554b('0x22'),'response_type':_0x554b('0x22'),'rest_data':JSON[_0x554b('0x23')]({'session':_0x52f5ab['id'],'module_name':_0x554b('0x24'),'name_value_list':_0x219934})}});}function getAuth(_0xaaf970){return util[_0x554b('0x25')](_0x554b('0x26'),new Buffer(_0xaaf970[_0x554b('0x27')]+':X')[_0x554b('0x28')](_0x554b('0x29')));}function getServerInfo(_0x3c0089){return request({'form':{'method':_0x554b('0x2a'),'input_type':_0x554b('0x22'),'response_type':_0x554b('0x22'),'rest_data':JSON['stringify']({'session':_0x3c0089['id']})}});}function getUser(_0x153a64,_0x60d68e,_0x54986d){if(!_[_0x554b('0x2b')](_0x60d68e)){logger[_0x554b('0xc')](_0x554b('0x2c'),_0x60d68e);return request({'form':{'method':_0x554b('0x2d'),'input_type':'JSON','response_type':_0x554b('0x22'),'rest_data':JSON[_0x554b('0x23')]({'session':_0x54986d['id'],'module_name':'Employees','query':util[_0x554b('0x25')](_0x554b('0x2e'),_0x60d68e),'order_by':'','offset':'0','select_fields':['id',_0x554b('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x554b('0x2f')](function(_0x6ca112){if(_0x6ca112[_0x554b('0x30')][_0x554b('0x1e')]){var _0x135ecc=_[_0x554b('0x31')](_0x6ca112['entry_list'],function(_0x2509d3){return _0x2509d3[_0x554b('0x32')]['user_name']['value']===_0x60d68e;});if(_0x135ecc){logger[_0x554b('0xc')](_0x554b('0x33'));return BPromise[_0x554b('0x34')]({'id':_0x135ecc[_0x554b('0x32')]['id'][_0x554b('0x35')],'name':_0x135ecc['name_value_list'][_0x554b('0xe')][_0x554b('0x35')]});}}logger[_0x554b('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x54986d['name_value_list'][_0x554b('0x36')][_0x554b('0x35')],'name':_0x54986d[_0x554b('0x32')][_0x554b('0x37')][_0x554b('0x35')]});});}else{logger['info'](_0x554b('0x38'));return BPromise['resolve']({'id':_0x54986d[_0x554b('0x32')]['user_id'][_0x554b('0x35')],'name':_0x54986d[_0x554b('0x32')][_0x554b('0x37')][_0x554b('0x35')]});}}function getEndUser(_0x5e8e52,_0x324060,_0x247b1a,_0x31221a){logger[_0x554b('0xc')](_0x554b('0x39'),_0x247b1a);return request({'form':{'method':_0x554b('0x2d'),'input_type':_0x554b('0x22'),'response_type':_0x554b('0x22'),'rest_data':JSON[_0x554b('0x23')]({'session':_0x31221a['id'],'module_name':_0x554b('0x3a'),'query':util[_0x554b('0x25')](_0x554b('0x3b'),_0x247b1a),'order_by':'','offset':'0','select_fields':['id',_0x554b('0xe'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2e2d40){if(_0x2e2d40[_0x554b('0x30')][_0x554b('0x1e')]){var _0x284911=_[_0x554b('0x31')](_0x2e2d40[_0x554b('0x30')],function(_0x5578df){return _0x5578df['name_value_list'][_0x554b('0x3c')][_0x554b('0x35')]===_0x247b1a;});if(_0x284911){logger[_0x554b('0xc')]('Enduser\x20found!');return BPromise[_0x554b('0x34')]({'id':_0x284911[_0x554b('0x32')]['id']['value'],'name':_0x284911[_0x554b('0x32')][_0x554b('0xe')]['value'],'phone':_0x284911[_0x554b('0x32')]['phone_home'][_0x554b('0x35')]});}}else{logger['info'](_0x554b('0x3d'));return request({'form':{'method':_0x554b('0x21'),'input_type':_0x554b('0x22'),'response_type':_0x554b('0x22'),'rest_data':JSON['stringify']({'session':_0x31221a['id'],'module_name':_0x554b('0x3a'),'name_value_list':[{'name':_0x554b('0x3e'),'value':_0x324060!==_0x554b('0x3f')?_0x324060:util[_0x554b('0x25')](_0x554b('0x40'),_0x247b1a)},{'name':_0x554b('0x3c'),'value':_0x247b1a}]})}})[_0x554b('0x2f')](function(_0x34e1ed){logger[_0x554b('0xc')](_0x554b('0x41'));return BPromise[_0x554b('0x34')]({'id':_0x34e1ed['id'],'name':_0x34e1ed['entry_list'][_0x554b('0x3e')][_0x554b('0x35')],'phone':_0x34e1ed['entry_list']['phone_home'][_0x554b('0x35')]});});}});}function request(_0x32f875){logger['debug'](_0x554b('0x42'),JSON['stringify'](_0x32f875));return rp(_[_0x554b('0x43')](def,_0x32f875));}function getTags(_0x17d206,_0xfaef70){var _0x1194b0=[];if(_0x17d206&&_0x17d206[_0x554b('0x1e')]>0x0){_0x1194b0=_[_0x554b('0x44')](_0x17d206,_0xfaef70);}return _0x1194b0;}function getCustomFields(_0x5d435c,_0x14d043){var _0x4200f2=[];var _0x577afc={'custom_fields':[]};if(_0x5d435c['length']>0x0){_[_0x554b('0x45')](_0x5d435c,function(_0xda4810){if(_0xda4810[_0x554b('0x46')]===_0x554b('0x47')&&_0xda4810['nameField']&&!_0xda4810[_0x554b('0x48')]){_0x577afc[_0xda4810[_0x554b('0x49')][_0x554b('0x4a')]()]=_0xda4810[_0x554b('0x4b')]['toString']();}else if(_0xda4810[_0x554b('0x46')]===_0x554b('0x47')&&_0xda4810[_0x554b('0x4c')]&&_0xda4810['customField']){_0x577afc[_0x554b('0x4d')]['push']({'id':_0xda4810['idField'],'value':_0xda4810[_0x554b('0x4b')][_0x554b('0x28')]()});}else if(_0xda4810[_0x554b('0x46')]===_0x554b('0x4e')&&_0xda4810[_0x554b('0x1f')]&&_0xda4810[_0x554b('0x4c')]&&_0xda4810[_0x554b('0x48')]){_0x14d043[_0xda4810[_0x554b('0x1f')]]&&_0x577afc[_0x554b('0x4d')][_0x554b('0x20')]({'id':_0xda4810['idField'],'value':_0x14d043[_0xda4810[_0x554b('0x1f')]][_0x554b('0x28')]()});}else if(_0xda4810['type']==='customVariable'&&_0xda4810[_0x554b('0x4f')]&&_0xda4810[_0x554b('0x4f')][_0x554b('0xe')]&&_0xda4810[_0x554b('0x4c')]&&_0xda4810[_0x554b('0x48')]){_0x14d043[_0xda4810[_0x554b('0x4f')]['name'][_0x554b('0x4a')]()]&&_0x577afc['custom_fields']['push']({'id':_0xda4810[_0x554b('0x4c')],'value':_0x14d043[_0xda4810[_0x554b('0x4f')][_0x554b('0xe')][_0x554b('0x4a')]()][_0x554b('0x28')]()});}});}return _0x577afc;}function getConnection(_0x1b52d1){return request({'method':'POST','form':{'method':_0x554b('0x50'),'input_type':_0x554b('0x22'),'response_type':_0x554b('0x22'),'rest_data':JSON[_0x554b('0x23')]({'user_auth':{'user_name':_0x1b52d1[_0x554b('0x51')],'password':_0x1b52d1[_0x554b('0x52')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0x554b('0x2f')](function(_0x3d1abd){var _0x17dacb=_0x3d1abd;if(_0x17dacb['id']){def[_0x554b('0x53')]=_0x17dacb['id'];return BPromise[_0x554b('0x34')](_0x17dacb);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x1b52d1['id']));}});}function setRelationship(_0x2ea845,_0x23b676,_0x430c88,_0x2bb99f){return request({'form':{'method':_0x554b('0x54'),'input_type':_0x554b('0x22'),'response_type':_0x554b('0x22'),'rest_data':JSON['stringify']({'session':_0x2ea845['id'],'module_name':'Calls','module_id':_0x430c88['id'],'link_field_name':_0x2bb99f,'related_ids':[_0x23b676['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x23886f,_0x34faf8,_0x2ed9ae,_0xee5ea6,_0x4d37c4,_0x550ba1){var _0x28ac0c,_0xbba34d,_0x16101a,_0x430dbd;_0x550ba1['remoteUri']=intUtil[_0x554b('0x55')](_0x550ba1['remoteUri']);_0x550ba1[_0x554b('0x56')]=intUtil[_0x554b('0x55')](_0x550ba1[_0x554b('0x56')]);def[_0x554b('0x57')]=util[_0x554b('0x25')](_0x554b('0x58'),_0x550ba1[_0x554b('0x59')]);if(_0x4d37c4&&_0x4d37c4[_0x554b('0x5a')]){logger[_0x554b('0xc')](_0x554b('0x5b'),_0x554b('0x5c'));_0x34faf8[_0x554b('0x5d')]=util[_0x554b('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x550ba1['serverUrl'],_0x34faf8[_0x554b('0x5e')],md5(_0x34faf8['uniqueid']));}else{_0x34faf8['recordingURL']='';}return getConnection(_0x550ba1)['then'](function(_0x3337c5){_0x430dbd=_0x3337c5;return getUser(_0x550ba1,_0xee5ea6[_0x554b('0xe')],_0x430dbd);})[_0x554b('0x2f')](function(_0x3eddb3){_0x28ac0c=_0x3eddb3;logger[_0x554b('0xc')](_0x554b('0x5f'),_0x28ac0c['id']);return getEndUser(_0x550ba1,_0x34faf8[_0x554b('0x60')],_0x34faf8['calleridnum'],_0x430dbd);})['then'](function(_0xfbaccb){_0xbba34d=_0xfbaccb;logger[_0x554b('0xc')](_0x554b('0x61'),_0xbba34d['id']);return getTicket(_0x550ba1,_0x28ac0c,_0xbba34d,_0x2ed9ae,_0x34faf8,_0x2ed9ae['Fields'],_0x430dbd,'Inbound');})[_0x554b('0x2f')](function(_0x30b4de){_0x16101a=_0x30b4de;logger[_0x554b('0xc')](_0x554b('0x62'));logger[_0x554b('0xc')](_0x554b('0x63'),_0x16101a['id']);return setRelationship(_0x430dbd,_0x28ac0c,_0x16101a,_0x554b('0x64'));})[_0x554b('0x2f')](function(){return setRelationship(_0x430dbd,_0xbba34d,_0x16101a,'contacts');})['then'](function(){return getServerInfo(_0x430dbd);})[_0x554b('0x2f')](function(_0x59238a){var _0x39f476=parseInt(_0x59238a[_0x554b('0x65')][_0x554b('0x66')](0x0));var _0x4eb53c=util[_0x554b('0x25')](_0x554b('0x67'),_0x550ba1[_0x554b('0x59')],_0x16101a['id']);if(_0x39f476>0x6){_0x4eb53c=util[_0x554b('0x25')](_0x554b('0x68'),_0x550ba1[_0x554b('0x59')],_0x16101a['id']);}logger['info']('[QUEUE]',_0x554b('0x69'));emit(util[_0x554b('0x25')](_0x554b('0x6a'),_0xee5ea6[_0x554b('0xe')]),_0x554b('0x6b'),{'uri':_0x4eb53c});})[_0x554b('0x6c')](function(_0x280a27){logger[_0x554b('0x6d')](_0x554b('0x5b'),JSON['stringify'](_0x280a27));});};exports['outbound']=function(_0x31218f,_0x5d3301,_0x3dc465,_0x129f79,_0xc7a35b,_0x10225c,_0x3a76a5){var _0x298116,_0x4a5731,_0xd22b42,_0x37f62d;_0x10225c['remoteUri']=intUtil['stripTrailingSlash'](_0x10225c[_0x554b('0x59')]);_0x10225c[_0x554b('0x56')]=intUtil[_0x554b('0x55')](_0x10225c['serverUrl']);def['uri']=util[_0x554b('0x25')]('%s/service/v4_1/rest.php',_0x10225c[_0x554b('0x59')]);if(_0x3a76a5&&_0x3a76a5[_0x554b('0x6e')]&&_0x3a76a5[_0x554b('0x6e')]!==_0x554b('0x6f')){logger[_0x554b('0xc')]('[OUTBOUND]',_0x554b('0x5c'));_0x5d3301[_0x554b('0x5d')]=util[_0x554b('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x10225c[_0x554b('0x56')],_0x5d3301[_0x554b('0x5e')],md5(_0x5d3301[_0x554b('0x5e')]));}return getConnection(_0x10225c)[_0x554b('0x2f')](function(_0x4a10c8){_0x37f62d=_0x4a10c8;return getUser(_0x10225c,_0x129f79['name'],_0x37f62d);})['then'](function(_0x38c9f3){_0x298116=_0x38c9f3;logger[_0x554b('0xc')](_0x554b('0x5f'),_0x298116['id']);return getEndUser(_0x10225c,_0x5d3301['destcalleridname'],_0x5d3301['destcalleridnum'],_0x37f62d);})[_0x554b('0x2f')](function(_0x3521bb){_0x4a5731=_0x3521bb;logger[_0x554b('0xc')](_0x554b('0x61'),_0x4a5731['id']);return getTicket(_0x10225c,_0x298116,_0x4a5731,_0x3dc465,_0x5d3301,_0x3dc465['Fields'],_0x37f62d,_0x554b('0x70'));})[_0x554b('0x2f')](function(_0x53841b){_0xd22b42=_0x53841b;logger[_0x554b('0xc')](_0x554b('0x62'));logger[_0x554b('0xc')](_0x554b('0x63'),_0xd22b42['id']);return setRelationship(_0x37f62d,_0x298116,_0xd22b42,_0x554b('0x64'));})[_0x554b('0x2f')](function(){return setRelationship(_0x37f62d,_0x4a5731,_0xd22b42,'contacts');})['then'](function(){return getServerInfo(_0x37f62d);})['then'](function(_0xd9b21a){var _0x3ea178=parseInt(_0xd9b21a['version'][_0x554b('0x66')](0x0));var _0xfd2e76=util[_0x554b('0x25')](_0x554b('0x67'),_0x10225c[_0x554b('0x59')],_0xd22b42['id']);if(_0x3ea178>0x6){_0xfd2e76=util[_0x554b('0x25')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x10225c[_0x554b('0x59')],_0xd22b42['id']);}logger[_0x554b('0xc')]('[OUTBOUND]',_0x554b('0x69'));emit(util[_0x554b('0x25')]('user:%s',_0x129f79['name']),_0x554b('0x6b'),{'uri':_0xfd2e76});})[_0x554b('0x6c')](function(_0x22c429){logger[_0x554b('0x6d')](_0x554b('0x71'),JSON[_0x554b('0x23')](_0x22c429));});};exports[_0x554b('0x72')]=function(_0x2eb9de,_0x1ed7fe,_0x5795d0,_0x1a522f,_0x542de0,_0x5abb80){var _0x3b338b,_0x482568,_0x320cab,_0x365377;_0x5abb80[_0x554b('0x59')]=intUtil['stripTrailingSlash'](_0x5abb80[_0x554b('0x59')]);_0x5abb80[_0x554b('0x56')]=intUtil[_0x554b('0x55')](_0x5abb80[_0x554b('0x56')]);def[_0x554b('0x57')]=util['format'](_0x554b('0x58'),_0x5abb80[_0x554b('0x59')]);if(_0x542de0&&_0x542de0[_0x554b('0x5a')]){logger['info']('['+_0x1ed7fe['lastevent'][_0x554b('0x73')]()+']','Recording\x20is\x20enabled!');_0x1ed7fe[_0x554b('0x5d')]=util[_0x554b('0x25')](_0x554b('0x74'),_0x5abb80['serverUrl'],_0x1ed7fe[_0x554b('0x5e')],md5(_0x1ed7fe['uniqueid']));}else{_0x1ed7fe[_0x554b('0x5d')]='';}return getConnection(_0x5abb80)[_0x554b('0x2f')](function(_0x37f398){_0x365377=_0x37f398;if(!_['isNil'](_0x1a522f)){return getUser(_0x5abb80,_0x1a522f[_0x554b('0xe')],_0x365377);}else{return getUser(_0x5abb80,null,_0x365377);}})['then'](function(_0x1a82c4){_0x3b338b=_0x1a82c4;logger[_0x554b('0xc')](_0x554b('0x5f'),_0x3b338b['id']);return getEndUser(_0x5abb80,_0x1ed7fe['calleridname'],_0x1ed7fe['calleridnum'],_0x365377);})[_0x554b('0x2f')](function(_0x4e41d3){_0x482568=_0x4e41d3;logger['info'](_0x554b('0x61'),_0x482568['id']);return getTicket(_0x5abb80,_0x3b338b,_0x482568,_0x5795d0,_0x1ed7fe,_0x5795d0[_0x554b('0x75')],_0x365377,_0x554b('0x76'));})['then'](function(_0x3cdb1c){_0x320cab=_0x3cdb1c;logger[_0x554b('0xc')](_0x554b('0x62'));logger['info'](_0x554b('0x63'),_0x320cab['id']);return setRelationship(_0x365377,_0x3b338b,_0x320cab,_0x554b('0x64'));})[_0x554b('0x2f')](function(){return setRelationship(_0x365377,_0x482568,_0x320cab,_0x554b('0x77'));})['then'](function(){return getServerInfo(_0x365377);})[_0x554b('0x6c')](function(_0x2d4766){logger[_0x554b('0x6d')]('['+_0x1ed7fe[_0x554b('0x78')][_0x554b('0x73')]()+']',JSON[_0x554b('0x23')](_0x2d4766));});}; \ No newline at end of file +var _0x38e7=['Outbound','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_type','Contacts','name','length','forEach','variableName','push','idField','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','value','Agent\x20found!','resolve','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!','set_entry','first_name','','Enduser\x20created.','debug','[HTTP]','merge','map','nameField','customField','toLowerCase','content','type','custom_fields','customVariable','Variable','login','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum'];(function(_0x42d2af,_0x3961b5){var _0x1d6d63=function(_0x10833e){while(--_0x10833e){_0x42d2af['push'](_0x42d2af['shift']());}};_0x1d6d63(++_0x3961b5);}(_0x38e7,0x1eb));var _0x738e=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x38e7[_0x45783c];return _0x1161da;};'use strict';var _=require(_0x738e('0x0'));var rp=require(_0x738e('0x1'));var BPromise=require(_0x738e('0x2'));var md5=require(_0x738e('0x3'));var util=require(_0x738e('0x4'));var Redis=require(_0x738e('0x5'));var intUtil=require(_0x738e('0x6'));var config=require(_0x738e('0x7'));var logger=require(_0x738e('0x8'))(_0x738e('0x9'));config[_0x738e('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x738e('0xb'))(new Redis(config[_0x738e('0xa')]));var def={'method':_0x738e('0xc'),'json':!![]};function emit(_0x287d50,_0x160926,_0x236c7b){io['to'](_0x287d50)[_0x738e('0xd')](_0x160926,_0x236c7b);}function getTicket(_0x36f796,_0x46c692,_0x1e0d5b,_0x2cc1d1,_0x5100f9,_0x585883,_0x4478f4,_0x512ba5){logger[_0x738e('0xe')](_0x738e('0xf'));var _0x4d1615=new Date();var _0xd0134=[{'name':'name','value':intUtil[_0x738e('0x10')](_0x2cc1d1[_0x738e('0x11')],_0x5100f9,'\x20')},{'name':_0x738e('0x12'),'value':_0x46c692['id']},{'name':_0x738e('0x13'),'value':_0x46c692['id']},{'name':_0x738e('0x14'),'value':intUtil[_0x738e('0x10')](_0x2cc1d1['Descriptions'],_0x5100f9,'\x0a')},{'name':_0x738e('0x15'),'value':_0x4d1615[_0x738e('0x16')]()[_0x738e('0x17')](0x0,0x13)[_0x738e('0x18')]('T','\x20')},{'name':_0x738e('0x19'),'value':'0'},{'name':_0x738e('0x1a'),'value':'15'},{'name':'parent_id','value':_0x1e0d5b['id']},{'name':_0x738e('0x1b'),'value':_0x738e('0x1c')},{'name':'parent_name','value':_0x1e0d5b[_0x738e('0x1d')]},{'name':'direction','value':_0x512ba5}];if(_0x585883[_0x738e('0x1e')]){_[_0x738e('0x1f')](_0x585883,function(_0x4618a4){if(_0x5100f9[_0x4618a4[_0x738e('0x20')]]){_0xd0134[_0x738e('0x21')]({'name':_0x4618a4[_0x738e('0x22')],'value':_0x5100f9[_0x4618a4[_0x738e('0x20')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x738e('0x23'),'response_type':'JSON','rest_data':JSON[_0x738e('0x24')]({'session':_0x4478f4['id'],'module_name':_0x738e('0x25'),'name_value_list':_0xd0134})}});}function getAuth(_0xb1d393){return util['format'](_0x738e('0x26'),new Buffer(_0xb1d393[_0x738e('0x27')]+':X')[_0x738e('0x28')](_0x738e('0x29')));}function getServerInfo(_0xca9396){return request({'form':{'method':_0x738e('0x2a'),'input_type':_0x738e('0x23'),'response_type':_0x738e('0x23'),'rest_data':JSON[_0x738e('0x24')]({'session':_0xca9396['id']})}});}function getUser(_0x500473,_0x309187,_0x609ed6){if(!_[_0x738e('0x2b')](_0x309187)){logger['info'](_0x738e('0x2c'),_0x309187);return request({'form':{'method':_0x738e('0x2d'),'input_type':'JSON','response_type':_0x738e('0x23'),'rest_data':JSON['stringify']({'session':_0x609ed6['id'],'module_name':'Employees','query':util[_0x738e('0x2e')](_0x738e('0x2f'),_0x309187),'order_by':'','offset':'0','select_fields':['id',_0x738e('0x1d'),_0x738e('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3c6efd){if(_0x3c6efd[_0x738e('0x31')][_0x738e('0x1e')]){var _0x471af6=_[_0x738e('0x32')](_0x3c6efd[_0x738e('0x31')],function(_0x2e3a94){return _0x2e3a94[_0x738e('0x33')][_0x738e('0x30')][_0x738e('0x34')]===_0x309187;});if(_0x471af6){logger[_0x738e('0xe')](_0x738e('0x35'));return BPromise[_0x738e('0x36')]({'id':_0x471af6[_0x738e('0x33')]['id'][_0x738e('0x34')],'name':_0x471af6['name_value_list'][_0x738e('0x1d')][_0x738e('0x34')]});}}logger[_0x738e('0xe')](_0x738e('0x37'));return BPromise['resolve']({'id':_0x609ed6['name_value_list'][_0x738e('0x38')][_0x738e('0x34')],'name':_0x609ed6['name_value_list'][_0x738e('0x30')][_0x738e('0x34')]});});}else{logger[_0x738e('0xe')](_0x738e('0x39'));return BPromise[_0x738e('0x36')]({'id':_0x609ed6[_0x738e('0x33')][_0x738e('0x38')]['value'],'name':_0x609ed6[_0x738e('0x33')][_0x738e('0x30')][_0x738e('0x34')]});}}function getEndUser(_0x34cfe2,_0x227522,_0x134094,_0x345ca7){logger[_0x738e('0xe')](_0x738e('0x3a'),_0x134094);return request({'form':{'method':_0x738e('0x2d'),'input_type':'JSON','response_type':_0x738e('0x23'),'rest_data':JSON[_0x738e('0x24')]({'session':_0x345ca7['id'],'module_name':_0x738e('0x1c'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x134094),'order_by':'','offset':'0','select_fields':['id',_0x738e('0x1d'),_0x738e('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x738e('0x3c')](function(_0x170c4d){if(_0x170c4d[_0x738e('0x31')][_0x738e('0x1e')]){var _0x2df6e9=_['find'](_0x170c4d['entry_list'],function(_0x1ebebd){return _0x1ebebd['name_value_list'][_0x738e('0x3b')][_0x738e('0x34')]===_0x134094;});if(_0x2df6e9){logger['info'](_0x738e('0x3d'));return BPromise[_0x738e('0x36')]({'id':_0x2df6e9['name_value_list']['id'][_0x738e('0x34')],'name':_0x2df6e9[_0x738e('0x33')][_0x738e('0x1d')][_0x738e('0x34')],'phone':_0x2df6e9[_0x738e('0x33')][_0x738e('0x3b')][_0x738e('0x34')]});}}else{logger[_0x738e('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x738e('0x3e'),'input_type':_0x738e('0x23'),'response_type':_0x738e('0x23'),'rest_data':JSON[_0x738e('0x24')]({'session':_0x345ca7['id'],'module_name':_0x738e('0x1c'),'name_value_list':[{'name':_0x738e('0x3f'),'value':_0x227522!==_0x738e('0x40')?_0x227522:util['format']('Caller\x20-\x20%s',_0x134094)},{'name':'phone_home','value':_0x134094}]})}})[_0x738e('0x3c')](function(_0x5cac25){logger['info'](_0x738e('0x41'));return BPromise[_0x738e('0x36')]({'id':_0x5cac25['id'],'name':_0x5cac25['entry_list']['first_name'][_0x738e('0x34')],'phone':_0x5cac25[_0x738e('0x31')]['phone_home'][_0x738e('0x34')]});});}});}function request(_0x5e5d37){logger[_0x738e('0x42')](_0x738e('0x43'),JSON['stringify'](_0x5e5d37));return rp(_[_0x738e('0x44')](def,_0x5e5d37));}function getTags(_0x3950b1,_0x2dd327){var _0x51f1a5=[];if(_0x3950b1&&_0x3950b1[_0x738e('0x1e')]>0x0){_0x51f1a5=_[_0x738e('0x45')](_0x3950b1,_0x2dd327);}return _0x51f1a5;}function getCustomFields(_0x3c4c3e,_0x19645e){var _0x902d46=[];var _0x448eb0={'custom_fields':[]};if(_0x3c4c3e['length']>0x0){_[_0x738e('0x1f')](_0x3c4c3e,function(_0x5cbdad){if(_0x5cbdad['type']==='string'&&_0x5cbdad[_0x738e('0x46')]&&!_0x5cbdad[_0x738e('0x47')]){_0x448eb0[_0x5cbdad[_0x738e('0x46')][_0x738e('0x48')]()]=_0x5cbdad[_0x738e('0x49')][_0x738e('0x28')]();}else if(_0x5cbdad[_0x738e('0x4a')]==='string'&&_0x5cbdad[_0x738e('0x22')]&&_0x5cbdad['customField']){_0x448eb0['custom_fields']['push']({'id':_0x5cbdad[_0x738e('0x22')],'value':_0x5cbdad['content']['toString']()});}else if(_0x5cbdad[_0x738e('0x4a')]==='variable'&&_0x5cbdad['variableName']&&_0x5cbdad[_0x738e('0x22')]&&_0x5cbdad[_0x738e('0x47')]){_0x19645e[_0x5cbdad['variableName']]&&_0x448eb0[_0x738e('0x4b')][_0x738e('0x21')]({'id':_0x5cbdad[_0x738e('0x22')],'value':_0x19645e[_0x5cbdad[_0x738e('0x20')]][_0x738e('0x28')]()});}else if(_0x5cbdad['type']===_0x738e('0x4c')&&_0x5cbdad['Variable']&&_0x5cbdad[_0x738e('0x4d')][_0x738e('0x1d')]&&_0x5cbdad['idField']&&_0x5cbdad[_0x738e('0x47')]){_0x19645e[_0x5cbdad['Variable'][_0x738e('0x1d')]['toLowerCase']()]&&_0x448eb0[_0x738e('0x4b')][_0x738e('0x21')]({'id':_0x5cbdad['idField'],'value':_0x19645e[_0x5cbdad['Variable'][_0x738e('0x1d')][_0x738e('0x48')]()][_0x738e('0x28')]()});}});}return _0x448eb0;}function getConnection(_0x15af5d){return request({'method':_0x738e('0xc'),'form':{'method':_0x738e('0x4e'),'input_type':'JSON','response_type':_0x738e('0x23'),'rest_data':JSON[_0x738e('0x24')]({'user_auth':{'user_name':_0x15af5d['username'],'password':_0x15af5d['password'],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x846cde){var _0x47effb=_0x846cde;if(_0x47effb['id']){def[_0x738e('0x4f')]=_0x47effb['id'];return BPromise[_0x738e('0x36')](_0x47effb);}else{throw new Error(util['format'](_0x738e('0x50'),_0x15af5d['id']));}});}function setRelationship(_0x36561d,_0x17c3d5,_0x51111e,_0x2730e8){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x738e('0x24')]({'session':_0x36561d['id'],'module_name':'Calls','module_id':_0x51111e['id'],'link_field_name':_0x2730e8,'related_ids':[_0x17c3d5['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x738e('0x51')]=function(_0x5df7a9,_0x4bf7d2,_0x385458,_0x7b29a1,_0x13029d,_0x2d3068){var _0x5cd068,_0x5e1481,_0x581583,_0xd211db;_0x2d3068[_0x738e('0x52')]=intUtil[_0x738e('0x53')](_0x2d3068[_0x738e('0x52')]);_0x2d3068[_0x738e('0x54')]=intUtil['stripTrailingSlash'](_0x2d3068[_0x738e('0x54')]);def[_0x738e('0x55')]=util[_0x738e('0x2e')](_0x738e('0x56'),_0x2d3068[_0x738e('0x52')]);if(_0x13029d&&_0x13029d[_0x738e('0x57')]){logger[_0x738e('0xe')](_0x738e('0x58'),_0x738e('0x59'));_0x4bf7d2[_0x738e('0x5a')]=util[_0x738e('0x2e')](_0x738e('0x5b'),_0x2d3068[_0x738e('0x54')],_0x4bf7d2[_0x738e('0x5c')],md5(_0x4bf7d2[_0x738e('0x5c')]));}else{_0x4bf7d2[_0x738e('0x5a')]='';}return getConnection(_0x2d3068)['then'](function(_0xcd9404){_0xd211db=_0xcd9404;return getUser(_0x2d3068,_0x7b29a1[_0x738e('0x1d')],_0xd211db);})[_0x738e('0x3c')](function(_0x1d4166){_0x5cd068=_0x1d4166;logger[_0x738e('0xe')](_0x738e('0x5d'),_0x5cd068['id']);return getEndUser(_0x2d3068,_0x4bf7d2['calleridname'],_0x4bf7d2[_0x738e('0x5e')],_0xd211db);})[_0x738e('0x3c')](function(_0x17951d){_0x5e1481=_0x17951d;logger[_0x738e('0xe')](_0x738e('0x5f'),_0x5e1481['id']);return getTicket(_0x2d3068,_0x5cd068,_0x5e1481,_0x385458,_0x4bf7d2,_0x385458[_0x738e('0x60')],_0xd211db,_0x738e('0x61'));})[_0x738e('0x3c')](function(_0xe18662){_0x581583=_0xe18662;logger[_0x738e('0xe')](_0x738e('0x62'));logger['info'](_0x738e('0x63'),_0x581583['id']);return setRelationship(_0xd211db,_0x5cd068,_0x581583,_0x738e('0x64'));})[_0x738e('0x3c')](function(){return setRelationship(_0xd211db,_0x5e1481,_0x581583,_0x738e('0x65'));})['then'](function(){return getServerInfo(_0xd211db);})[_0x738e('0x3c')](function(_0x44b9e0){var _0x4741bc=parseInt(_0x44b9e0[_0x738e('0x66')][_0x738e('0x67')](0x0));var _0x334346=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2d3068[_0x738e('0x52')],_0x581583['id']);if(_0x4741bc>0x6){_0x334346=util[_0x738e('0x2e')](_0x738e('0x68'),_0x2d3068[_0x738e('0x52')],_0x581583['id']);}logger[_0x738e('0xe')](_0x738e('0x58'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x738e('0x2e')](_0x738e('0x69'),_0x7b29a1[_0x738e('0x1d')]),_0x738e('0x6a'),{'uri':_0x334346});})[_0x738e('0x6b')](function(_0x17aecc){logger[_0x738e('0x6c')]('[QUEUE]',JSON[_0x738e('0x24')](_0x17aecc));});};exports[_0x738e('0x6d')]=function(_0x1c8fa4,_0x4a6a42,_0x4298e1,_0x281dd0,_0x250682,_0x3586a7,_0x499c04){var _0x3274ef,_0x32356e,_0x257eb3,_0x7f5076;_0x3586a7[_0x738e('0x52')]=intUtil['stripTrailingSlash'](_0x3586a7['remoteUri']);_0x3586a7[_0x738e('0x54')]=intUtil['stripTrailingSlash'](_0x3586a7[_0x738e('0x54')]);def[_0x738e('0x55')]=util[_0x738e('0x2e')](_0x738e('0x56'),_0x3586a7['remoteUri']);if(_0x499c04&&_0x499c04[_0x738e('0x6e')]&&_0x499c04[_0x738e('0x6e')]!=='none'){logger[_0x738e('0xe')](_0x738e('0x6f'),'Recording\x20is\x20enabled!');_0x4a6a42[_0x738e('0x5a')]=util[_0x738e('0x2e')](_0x738e('0x5b'),_0x3586a7[_0x738e('0x54')],_0x4a6a42[_0x738e('0x5c')],md5(_0x4a6a42[_0x738e('0x5c')]));}return getConnection(_0x3586a7)[_0x738e('0x3c')](function(_0x2281e5){_0x7f5076=_0x2281e5;return getUser(_0x3586a7,_0x281dd0[_0x738e('0x1d')],_0x7f5076);})[_0x738e('0x3c')](function(_0x43dba9){_0x3274ef=_0x43dba9;logger[_0x738e('0xe')](_0x738e('0x5d'),_0x3274ef['id']);return getEndUser(_0x3586a7,_0x4a6a42[_0x738e('0x70')],_0x4a6a42[_0x738e('0x71')],_0x7f5076);})[_0x738e('0x3c')](function(_0x1a8448){_0x32356e=_0x1a8448;logger[_0x738e('0xe')](_0x738e('0x5f'),_0x32356e['id']);return getTicket(_0x3586a7,_0x3274ef,_0x32356e,_0x4298e1,_0x4a6a42,_0x4298e1[_0x738e('0x60')],_0x7f5076,_0x738e('0x72'));})[_0x738e('0x3c')](function(_0x356ebc){_0x257eb3=_0x356ebc;logger[_0x738e('0xe')](_0x738e('0x62'));logger[_0x738e('0xe')](_0x738e('0x63'),_0x257eb3['id']);return setRelationship(_0x7f5076,_0x3274ef,_0x257eb3,_0x738e('0x64'));})[_0x738e('0x3c')](function(){return setRelationship(_0x7f5076,_0x32356e,_0x257eb3,_0x738e('0x65'));})[_0x738e('0x3c')](function(){return getServerInfo(_0x7f5076);})[_0x738e('0x3c')](function(_0x7a227a){var _0x5a80b5=parseInt(_0x7a227a[_0x738e('0x66')][_0x738e('0x67')](0x0));var _0x2194ad=util[_0x738e('0x2e')](_0x738e('0x73'),_0x3586a7[_0x738e('0x52')],_0x257eb3['id']);if(_0x5a80b5>0x6){_0x2194ad=util[_0x738e('0x2e')](_0x738e('0x68'),_0x3586a7[_0x738e('0x52')],_0x257eb3['id']);}logger[_0x738e('0xe')](_0x738e('0x6f'),_0x738e('0x74'));emit(util['format'](_0x738e('0x69'),_0x281dd0['name']),_0x738e('0x6a'),{'uri':_0x2194ad});})[_0x738e('0x6b')](function(_0x41883c){logger[_0x738e('0x6c')]('[OUTBOUND]',JSON['stringify'](_0x41883c));});};exports[_0x738e('0x75')]=function(_0x58161e,_0x5eda75,_0x2cff02,_0x42fa39,_0x5a986f,_0x498721){var _0x40067a,_0x3a490f,_0xd88356,_0x512492;_0x498721[_0x738e('0x52')]=intUtil['stripTrailingSlash'](_0x498721['remoteUri']);_0x498721['serverUrl']=intUtil['stripTrailingSlash'](_0x498721[_0x738e('0x54')]);def[_0x738e('0x55')]=util[_0x738e('0x2e')](_0x738e('0x56'),_0x498721[_0x738e('0x52')]);if(_0x5a986f&&_0x5a986f[_0x738e('0x57')]){logger[_0x738e('0xe')]('['+_0x5eda75['lastevent'][_0x738e('0x76')]()+']',_0x738e('0x59'));_0x5eda75[_0x738e('0x5a')]=util['format'](_0x738e('0x5b'),_0x498721[_0x738e('0x54')],_0x5eda75[_0x738e('0x5c')],md5(_0x5eda75[_0x738e('0x5c')]));}else{_0x5eda75['recordingURL']='';}return getConnection(_0x498721)[_0x738e('0x3c')](function(_0x4725c3){_0x512492=_0x4725c3;if(!_[_0x738e('0x2b')](_0x42fa39)){return getUser(_0x498721,_0x42fa39[_0x738e('0x1d')],_0x512492);}else{return getUser(_0x498721,null,_0x512492);}})[_0x738e('0x3c')](function(_0x38b5f4){_0x40067a=_0x38b5f4;logger[_0x738e('0xe')](_0x738e('0x5d'),_0x40067a['id']);return getEndUser(_0x498721,_0x5eda75[_0x738e('0x77')],_0x5eda75[_0x738e('0x5e')],_0x512492);})[_0x738e('0x3c')](function(_0x411b35){_0x3a490f=_0x411b35;logger['info'](_0x738e('0x5f'),_0x3a490f['id']);return getTicket(_0x498721,_0x40067a,_0x3a490f,_0x2cff02,_0x5eda75,_0x2cff02['Fields'],_0x512492,_0x738e('0x61'));})['then'](function(_0x2d8b09){_0xd88356=_0x2d8b09;logger[_0x738e('0xe')]('Ticket\x20created!');logger['info'](_0x738e('0x63'),_0xd88356['id']);return setRelationship(_0x512492,_0x40067a,_0xd88356,_0x738e('0x64'));})[_0x738e('0x3c')](function(){return setRelationship(_0x512492,_0x3a490f,_0xd88356,'contacts');})['then'](function(){return getServerInfo(_0x512492);})[_0x738e('0x6b')](function(_0x39586b){logger[_0x738e('0x6c')]('['+_0x5eda75[_0x738e('0x78')]['toUpperCase']()+']',JSON[_0x738e('0x24')](_0x39586b));});}; \ 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 bc89f48..7272aae 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 _0x1d08=['format','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','test','lodash','util','sortBy','length','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','%s:\x20%s','keyContent','key'];(function(_0x37b36e,_0x348636){var _0x5b912a=function(_0x161d00){while(--_0x161d00){_0x37b36e['push'](_0x37b36e['shift']());}};_0x5b912a(++_0x348636);}(_0x1d08,0x174));var _0x81d0=function(_0x57eb9d,_0x30bfc2){_0x57eb9d=_0x57eb9d-0x0;var _0xee75c1=_0x1d08[_0x57eb9d];return _0xee75c1;};'use strict';var _=require(_0x81d0('0x0'));var util=require(_0x81d0('0x1'));exports['getString']=function(_0xb759a8,_0x168d60,_0x1c2c43){var _0x5e95d5=[];if(_0xb759a8['length']>0x0){var _0x3427fb=_[_0x81d0('0x2')](_0xb759a8,['id']);for(var _0x5a9b08=0x0;_0x5a9b08<_0x3427fb[_0x81d0('0x3')];_0x5a9b08++){var _0x21a1f4=_0x3427fb[_0x5a9b08];if(_0x21a1f4[_0x81d0('0x4')]===_0x81d0('0x5')){_0x5e95d5[_0x81d0('0x6')](_0x21a1f4[_0x81d0('0x7')]);}else if(_0x21a1f4[_0x81d0('0x4')]===_0x81d0('0x8')&&_0x21a1f4[_0x81d0('0x9')]){_0x168d60[_0x21a1f4[_0x81d0('0x9')]]&&_0x5e95d5[_0x81d0('0x6')](_0x168d60[_0x21a1f4['variableName']][_0x81d0('0xa')]());}else if(_0x21a1f4[_0x81d0('0x4')]===_0x81d0('0xb')&&_0x21a1f4[_0x81d0('0xc')]&&_0x21a1f4['Variable'][_0x81d0('0xd')]){_0x168d60[_0x21a1f4[_0x81d0('0xc')]['name'][_0x81d0('0xe')]()]&&_0x5e95d5[_0x81d0('0x6')](_0x168d60[_0x21a1f4[_0x81d0('0xc')][_0x81d0('0xd')][_0x81d0('0xe')]()][_0x81d0('0xa')]());}else if(_0x21a1f4['type']===_0x81d0('0xf')){if(_0x21a1f4[_0x81d0('0x10')]==='string'&&_0x21a1f4['key']){_0x5e95d5[_0x81d0('0x6')](util['format'](_0x81d0('0x11'),_0x21a1f4['key'],_0x21a1f4[_0x81d0('0x12')]));}else if(_0x21a1f4['keyType']===_0x81d0('0x8')&&_0x21a1f4[_0x81d0('0x9')]&&_0x21a1f4[_0x81d0('0x13')]){_0x168d60[_0x21a1f4[_0x81d0('0x9')]]&&_0x5e95d5[_0x81d0('0x6')](util[_0x81d0('0x14')](_0x81d0('0x11'),_0x21a1f4[_0x81d0('0x13')],_0x168d60[_0x21a1f4['variableName']]));}else if(_0x21a1f4[_0x81d0('0x10')]===_0x81d0('0xb')&&_0x21a1f4[_0x81d0('0xc')]&&_0x21a1f4[_0x81d0('0xc')][_0x81d0('0xd')]&&_0x21a1f4[_0x81d0('0x13')]){_0x168d60[_0x21a1f4[_0x81d0('0xc')][_0x81d0('0xd')][_0x81d0('0xe')]()]&&_0x5e95d5['push'](util[_0x81d0('0x14')](_0x81d0('0x11'),_0x21a1f4[_0x81d0('0x13')],_0x168d60[_0x21a1f4[_0x81d0('0xc')][_0x81d0('0xd')][_0x81d0('0xe')]()]));}}}}return _0x5e95d5[_0x81d0('0x15')](_0x1c2c43);};exports[_0x81d0('0x16')]=function(_0x2e2973){var _0x287e86=_0x2e2973[_0x81d0('0x17')](-0x1);if(_0x287e86==='/'){_0x2e2973=_0x2e2973[_0x81d0('0x18')](0x0,_0x2e2973[_0x81d0('0x19')](_0x287e86));}return _0x2e2973;};exports[_0x81d0('0x1a')]=function(_0x5d7048){if(!_['isNil'](_0x5d7048)&&_0x5d7048!==''){var _0x13c53c=/^(([^<>()\[\]\\.,;:\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 _0x13c53c[_0x81d0('0x1b')](String(_0x5d7048)[_0x81d0('0xe')]());}else{return![];}}; \ No newline at end of file +var _0x6136=['toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','variable','join','stripTrailingSlash','slice','substring','isNil','lodash','getString','length','sortBy','type','push','content','variableName','customVariable','Variable','name'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x6136,0x13a));var _0x6613=function(_0x45366f,_0x563bf1){_0x45366f=_0x45366f-0x0;var _0x45f129=_0x6136[_0x45366f];return _0x45f129;};'use strict';var _=require(_0x6613('0x0'));var util=require('util');exports[_0x6613('0x1')]=function(_0x13020a,_0x505d4a,_0xd32345){var _0x3b1c99=[];if(_0x13020a[_0x6613('0x2')]>0x0){var _0x504e97=_[_0x6613('0x3')](_0x13020a,['id']);for(var _0x35d17d=0x0;_0x35d17d<_0x504e97['length'];_0x35d17d++){var _0x3d8bb5=_0x504e97[_0x35d17d];if(_0x3d8bb5[_0x6613('0x4')]==='string'){_0x3b1c99[_0x6613('0x5')](_0x3d8bb5[_0x6613('0x6')]);}else if(_0x3d8bb5[_0x6613('0x4')]==='variable'&&_0x3d8bb5[_0x6613('0x7')]){_0x505d4a[_0x3d8bb5[_0x6613('0x7')]]&&_0x3b1c99['push'](_0x505d4a[_0x3d8bb5[_0x6613('0x7')]]['toString']());}else if(_0x3d8bb5[_0x6613('0x4')]===_0x6613('0x8')&&_0x3d8bb5[_0x6613('0x9')]&&_0x3d8bb5[_0x6613('0x9')][_0x6613('0xa')]){_0x505d4a[_0x3d8bb5[_0x6613('0x9')][_0x6613('0xa')][_0x6613('0xb')]()]&&_0x3b1c99[_0x6613('0x5')](_0x505d4a[_0x3d8bb5[_0x6613('0x9')]['name'][_0x6613('0xb')]()]['toString']());}else if(_0x3d8bb5[_0x6613('0x4')]===_0x6613('0xc')){if(_0x3d8bb5[_0x6613('0xd')]===_0x6613('0xe')&&_0x3d8bb5[_0x6613('0xf')]){_0x3b1c99['push'](util[_0x6613('0x10')](_0x6613('0x11'),_0x3d8bb5[_0x6613('0xf')],_0x3d8bb5[_0x6613('0x12')]));}else if(_0x3d8bb5[_0x6613('0xd')]===_0x6613('0x13')&&_0x3d8bb5[_0x6613('0x7')]&&_0x3d8bb5[_0x6613('0xf')]){_0x505d4a[_0x3d8bb5[_0x6613('0x7')]]&&_0x3b1c99[_0x6613('0x5')](util[_0x6613('0x10')]('%s:\x20%s',_0x3d8bb5[_0x6613('0xf')],_0x505d4a[_0x3d8bb5['variableName']]));}else if(_0x3d8bb5['keyType']===_0x6613('0x8')&&_0x3d8bb5[_0x6613('0x9')]&&_0x3d8bb5[_0x6613('0x9')][_0x6613('0xa')]&&_0x3d8bb5['key']){_0x505d4a[_0x3d8bb5[_0x6613('0x9')][_0x6613('0xa')][_0x6613('0xb')]()]&&_0x3b1c99['push'](util[_0x6613('0x10')](_0x6613('0x11'),_0x3d8bb5['key'],_0x505d4a[_0x3d8bb5[_0x6613('0x9')][_0x6613('0xa')][_0x6613('0xb')]()]));}}}}return _0x3b1c99[_0x6613('0x14')](_0xd32345);};exports[_0x6613('0x15')]=function(_0x221fe0){var _0x4cd980=_0x221fe0[_0x6613('0x16')](-0x1);if(_0x4cd980==='/'){_0x221fe0=_0x221fe0[_0x6613('0x17')](0x0,_0x221fe0['lastIndexOf'](_0x4cd980));}return _0x221fe0;};exports['validateEmail']=function(_0x4d459c){if(!_[_0x6613('0x18')](_0x4d459c)&&_0x4d459c!==''){var _0x2f2db6=/^(([^<>()\[\]\\.,;:\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 _0x2f2db6['test'](String(_0x4d459c)[_0x6613('0xb')]());}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 398f2c9..acece75 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 _0xcae2=['token','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','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','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Subjects','getString','format','%s/webservice.php','username','sessionName','HelpDesk','stringify','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','last_name','admin','[vTiger],\x20%s,\x20%s,\x20%s','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','create','Contacts','getEndUser','POST','login'];(function(_0x16decf,_0x5efedd){var _0x4829f1=function(_0x561f48){while(--_0x561f48){_0x16decf['push'](_0x16decf['shift']());}};_0x4829f1(++_0x5efedd);}(_0xcae2,0x143));var _0x2cae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcae2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cae('0x0'));var rp=require(_0x2cae('0x1'));var BPromise=require(_0x2cae('0x2'));var md5=require(_0x2cae('0x3'));var util=require(_0x2cae('0x4'));var Redis=require(_0x2cae('0x5'));var intUtil=require(_0x2cae('0x6'));var config=require('../../../../config/environment');var logger=require(_0x2cae('0x7'))(_0x2cae('0x8'));config[_0x2cae('0x9')]=_[_0x2cae('0xa')](config['redis'],{'host':_0x2cae('0xb'),'port':0x18eb});var io=require(_0x2cae('0xc'))(new Redis(config[_0x2cae('0x9')]));function emit(_0x25b6a2,_0x2e7498,_0x49e1d1){io['to'](_0x25b6a2)['emit'](_0x2e7498,_0x49e1d1);}function getCustomFields(_0x4933f4,_0x49f0d3){var _0x460ed2={};if(_0x4933f4[_0x2cae('0xd')]>0x0){_[_0x2cae('0xe')](_0x4933f4,function(_0x3212ec){if(_[_0x2cae('0xf')]([_0x2cae('0x10'),'picklist'],_0x3212ec[_0x2cae('0x11')])&&_0x3212ec['idField']){_0x460ed2[_0x3212ec[_0x2cae('0x12')]]=_0x3212ec[_0x2cae('0x13')][_0x2cae('0x14')]();}else if(_0x3212ec[_0x2cae('0x11')]===_0x2cae('0x15')&&_0x3212ec[_0x2cae('0x16')]&&_0x3212ec['idField']&&_0x49f0d3[_0x3212ec[_0x2cae('0x16')]]){_0x460ed2[_0x3212ec['idField']]=_0x49f0d3[_0x3212ec[_0x2cae('0x16')]][_0x2cae('0x14')]();}else if(_0x3212ec['type']===_0x2cae('0x17')&&_0x3212ec[_0x2cae('0x18')]&&_0x3212ec[_0x2cae('0x18')][_0x2cae('0x19')]&&_0x3212ec['idField']&&_0x49f0d3[_0x3212ec[_0x2cae('0x18')][_0x2cae('0x19')]['toLowerCase']()]){_0x460ed2[_0x3212ec[_0x2cae('0x12')]]=_0x49f0d3[_0x3212ec[_0x2cae('0x18')][_0x2cae('0x19')][_0x2cae('0x1a')]()][_0x2cae('0x14')]();}});}return _0x460ed2;}function createTicket(_0x164aee,_0x398290,_0x3d5834,_0x57268d,_0x5cb971,_0x276ed4,_0x602f9b){logger[_0x2cae('0x1b')](_0x2cae('0x1c'));var _0x2f4f5c=_[_0x2cae('0x1d')]({'parent_id':'','assigned_user_id':_0x398290['id'],'ticketpriorities':_0x2cae('0x1e'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x57268d[_0x2cae('0x1f')],_0x5cb971,'\x20'),'description':intUtil[_0x2cae('0x20')](_0x57268d['Descriptions'],_0x5cb971,'\x0a'),'contact_id':_0x3d5834['id']},getCustomFields(_0x276ed4,_0x5cb971));var _0x4b2f85={'method':'POST','uri':util[_0x2cae('0x21')](_0x2cae('0x22'),_0x164aee['remoteUri']),'form':{'operation':'create','username':_0x164aee[_0x2cae('0x23')],'sessionName':_0x602f9b[_0x2cae('0x24')],'elementType':_0x2cae('0x25'),'element':JSON[_0x2cae('0x26')](_0x2f4f5c)},'json':!![]};return request(_0x4b2f85)[_0x2cae('0x27')](function(_0x447c72){if(_0x447c72[_0x2cae('0x28')]){return BPromise[_0x2cae('0x29')]({'id':_0x447c72[_0x2cae('0x2a')]['id']});}else{throw new Error(util[_0x2cae('0x21')](_0x2cae('0x2b'),JSON[_0x2cae('0x26')](_0x447c72[_0x2cae('0x2c')])));}})[_0x2cae('0x2d')](function(_0x3422bb){var _0x2d8e66=_0x3422bb['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x2d8e66,JSON[_0x2cae('0x26')](_0x3422bb));});}function getUser(_0x427ace,_0x3a16b6,_0x508069){if(intUtil['validateEmail'](_0x3a16b6)){logger[_0x2cae('0x1b')](_0x2cae('0x2e'),_0x3a16b6);return request({'method':_0x2cae('0x2f'),'uri':util['format'](_0x2cae('0x22'),_0x427ace['remoteUri']),'qs':{'operation':_0x2cae('0x30'),'username':_0x427ace['username'],'sessionName':_0x508069[_0x2cae('0x24')],'query':util[_0x2cae('0x21')](_0x2cae('0x31'),_0x3a16b6)},'json':!![]})['then'](function(_0x335345){if(_0x335345[_0x2cae('0x28')]&&_0x335345[_0x2cae('0x2a')][_0x2cae('0xd')]){logger[_0x2cae('0x1b')](_0x2cae('0x32'));return BPromise['resolve']({'id':_0x335345['result'][0x0]['id'],'email':_0x335345[_0x2cae('0x2a')][0x0][_0x2cae('0x33')],'name':_0x335345['result'][0x0]['first_name']+'\x20'+_0x335345['result'][_0x2cae('0x34')]});}else{logger[_0x2cae('0x1b')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x508069['userId'],'email':_0x427ace[_0x2cae('0x23')],'name':_0x2cae('0x35')});}})[_0x2cae('0x2d')](function(_0x34d3c1){var _0x150092=_0x34d3c1['statusCode']||0x1f4;logger[_0x2cae('0x2c')](_0x2cae('0x36'),'getUser',_0x150092,JSON[_0x2cae('0x26')](_0x34d3c1));});}else{logger[_0x2cae('0x1b')](_0x2cae('0x37'));return BPromise[_0x2cae('0x29')]({'id':_0x508069[_0x2cae('0x38')],'email':_0x427ace[_0x2cae('0x23')],'name':'admin'})[_0x2cae('0x2d')](function(_0x3d25c4){var _0x4c733f=_0x3d25c4[_0x2cae('0x39')]||0x1f4;logger[_0x2cae('0x2c')](_0x2cae('0x36'),_0x2cae('0x3a'),_0x4c733f,JSON[_0x2cae('0x26')](_0x3d25c4));});}}function getEndUser(_0x4d8037,_0x4c3d4e,_0x391892,_0x112003){logger['info'](_0x2cae('0x3b'),_0x391892);return request({'method':_0x2cae('0x2f'),'uri':util[_0x2cae('0x21')](_0x2cae('0x22'),_0x4d8037[_0x2cae('0x3c')]),'qs':{'operation':_0x2cae('0x30'),'username':_0x4d8037[_0x2cae('0x23')],'sessionName':_0x112003['sessionName'],'query':util[_0x2cae('0x21')](_0x2cae('0x3d'),_0x391892,_0x391892,_0x391892,_0x391892,_0x391892)},'json':!![]})[_0x2cae('0x27')](function(_0x2d6e01){if(_0x2d6e01[_0x2cae('0x28')]&&_0x2d6e01['result']['length']){logger[_0x2cae('0x1b')](_0x2cae('0x3e'));return BPromise[_0x2cae('0x29')]({'id':_0x2d6e01[_0x2cae('0x2a')][0x0]['id'],'name':_0x2d6e01['result'][0x0][_0x2cae('0x3f')]+'\x20'+_0x2d6e01['result'][0x0]['lastname'],'phone':_0x391892});}else{logger[_0x2cae('0x1b')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util[_0x2cae('0x21')](_0x2cae('0x22'),_0x4d8037[_0x2cae('0x3c')]),'form':{'operation':_0x2cae('0x40'),'sessionName':_0x112003[_0x2cae('0x24')],'elementType':_0x2cae('0x41'),'element':JSON[_0x2cae('0x26')]({'lastname':_0x4c3d4e,'phone':_0x391892,'assigned_user_id':'\x20'})},'json':!![]})[_0x2cae('0x27')](function(_0x4a21d4){logger['info']('Enduser\x20created.');return BPromise[_0x2cae('0x29')]({'id':_0x4a21d4['result']['id'],'name':_0x4a21d4[_0x2cae('0x2a')]['lastname'],'phone':_0x4a21d4[_0x2cae('0x2a')]['phone']});})[_0x2cae('0x2d')](function(_0x189de8){var _0xbdf67=_0x189de8[_0x2cae('0x39')]||0x1f4;logger[_0x2cae('0x2c')](_0x2cae('0x36'),_0x2cae('0x42'),_0xbdf67,JSON[_0x2cae('0x26')](_0x189de8));});}});}function getConnection(_0x241340){var _0x5a3400=_0x241340[_0x2cae('0x23')];var _0x5e38b2=_0x241340['accessKey'];return request({'method':_0x2cae('0x2f'),'uri':util[_0x2cae('0x21')](_0x2cae('0x22'),_0x241340['remoteUri']),'qs':{'operation':'getchallenge','username':_0x5a3400},'json':!![]})[_0x2cae('0x27')](function(_0x2ce455){if(_0x2ce455[_0x2cae('0x28')]){return request({'method':_0x2cae('0x43'),'uri':util[_0x2cae('0x21')](_0x2cae('0x22'),_0x241340[_0x2cae('0x3c')]),'form':{'operation':_0x2cae('0x44'),'username':_0x5a3400,'accessKey':md5(_0x2ce455[_0x2cae('0x2a')][_0x2cae('0x45')]+_0x5e38b2)},'json':!![]});}})['then'](function(_0x1a20d6){if(_0x1a20d6[_0x2cae('0x28')]){return BPromise['resolve'](_0x1a20d6[_0x2cae('0x2a')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x241340['id']));}})[_0x2cae('0x2d')](function(_0x37b03e){var _0x30054b=_0x37b03e[_0x2cae('0x39')]||0x1f4;logger['error'](_0x2cae('0x36'),_0x2cae('0x46'),_0x30054b,JSON[_0x2cae('0x26')](_0x37b03e));});}function request(_0x3cb9de){logger[_0x2cae('0x1b')](_0x2cae('0x47'),JSON[_0x2cae('0x26')](_0x3cb9de));return rp(_0x3cb9de);}exports[_0x2cae('0x48')]=function(_0x2eb66f,_0x1a77f9,_0x2b77cb,_0xc60da8,_0x5de245,_0x23a069){var _0x15cfdb,_0x2a607b,_0x5889dc,_0x5a57c2;_0x23a069[_0x2cae('0x3c')]=intUtil[_0x2cae('0x49')](_0x23a069['remoteUri']);if(_0x5de245&&_0x5de245['monitor_format']){logger[_0x2cae('0x1b')](_0x2cae('0x4a'),_0x2cae('0x4b'));_0x1a77f9[_0x2cae('0x4c')]=util[_0x2cae('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x23a069[_0x2cae('0x4d')],_0x1a77f9[_0x2cae('0x4e')],md5(_0x1a77f9[_0x2cae('0x4e')]));}else{_0x1a77f9[_0x2cae('0x4c')]='';}return getConnection(_0x23a069)[_0x2cae('0x27')](function(_0x235fc3){_0x5a57c2=_0x235fc3;return getUser(_0x23a069,_0xc60da8['email'],_0x5a57c2);})['then'](function(_0x272486){_0x15cfdb=_0x272486;logger[_0x2cae('0x1b')](_0x2cae('0x4f'),_0x15cfdb['id']);return getEndUser(_0x23a069,_0x1a77f9[_0x2cae('0x50')],_0x1a77f9[_0x2cae('0x51')],_0x5a57c2);})[_0x2cae('0x27')](function(_0x72ab57){_0x2a607b=_0x72ab57;logger[_0x2cae('0x1b')]('The\x20Enduser\x20ID\x20is:',_0x2a607b['id']);return createTicket(_0x23a069,_0x15cfdb,_0x2a607b,_0x2b77cb,_0x1a77f9,_0x2b77cb[_0x2cae('0x52')],_0x5a57c2);})[_0x2cae('0x27')](function(_0x38ffe5){_0x5889dc=_0x38ffe5;logger[_0x2cae('0x1b')](_0x2cae('0x53'));logger[_0x2cae('0x1b')](_0x2cae('0x54'),_0x5889dc['id']);var _0x57bef1=util['format'](_0x2cae('0x55'),_0x23a069[_0x2cae('0x3c')],_[_0x2cae('0x56')](_0x5889dc['id'],'x')[0x1]);logger['info'](_0x2cae('0x4a'),_0x2cae('0x57'));emit(util[_0x2cae('0x21')](_0x2cae('0x58'),_0xc60da8[_0x2cae('0x19')]),_0x2cae('0x59'),{'uri':_0x57bef1});})[_0x2cae('0x2d')](function(_0x10fe0a){logger[_0x2cae('0x2c')]('[QUEUE]',JSON[_0x2cae('0x26')](_0x10fe0a));});};exports['outbound']=function(_0x3a6192,_0x4f7c79,_0x259b54,_0x28487a,_0x18d2e8,_0x1f4c8d,_0x409eb8){var _0x27c1cc,_0x25fa09,_0x109f87,_0x26571b;_0x1f4c8d[_0x2cae('0x3c')]=intUtil[_0x2cae('0x49')](_0x1f4c8d['remoteUri']);_0x1f4c8d['serverUrl']=intUtil['stripTrailingSlash'](_0x1f4c8d['serverUrl']);if(_0x409eb8&&_0x409eb8[_0x2cae('0x5a')]&&_0x409eb8[_0x2cae('0x5a')]!=='none'){logger['info'](_0x2cae('0x5b'),_0x2cae('0x4b'));_0x4f7c79[_0x2cae('0x4c')]=util[_0x2cae('0x21')](_0x2cae('0x5c'),_0x1f4c8d[_0x2cae('0x4d')],_0x4f7c79[_0x2cae('0x4e')],md5(_0x4f7c79[_0x2cae('0x4e')]));}return getConnection(_0x1f4c8d)[_0x2cae('0x27')](function(_0x1dee17){_0x26571b=_0x1dee17;return getUser(_0x1f4c8d,_0x28487a[_0x2cae('0x5d')],_0x26571b);})[_0x2cae('0x27')](function(_0x589768){_0x27c1cc=_0x589768;logger[_0x2cae('0x1b')](_0x2cae('0x4f'),_0x27c1cc['id']);return getEndUser(_0x1f4c8d,_0x4f7c79[_0x2cae('0x5e')],_0x4f7c79[_0x2cae('0x5f')],_0x26571b);})[_0x2cae('0x27')](function(_0x36c7e6){_0x25fa09=_0x36c7e6;logger[_0x2cae('0x1b')](_0x2cae('0x60'),_0x25fa09['id']);return createTicket(_0x1f4c8d,_0x27c1cc,_0x25fa09,_0x259b54,_0x4f7c79,_0x259b54[_0x2cae('0x52')],_0x26571b);})[_0x2cae('0x27')](function(_0x4c1a2f){_0x109f87=_0x4c1a2f;logger[_0x2cae('0x1b')](_0x2cae('0x53'));logger[_0x2cae('0x1b')](_0x2cae('0x54'),_0x109f87['id']);var _0x2d984f=util[_0x2cae('0x21')](_0x2cae('0x55'),_0x1f4c8d[_0x2cae('0x3c')],_[_0x2cae('0x56')](_0x109f87['id'],'x')[0x1]);logger[_0x2cae('0x1b')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2cae('0x21')](_0x2cae('0x58'),_0x28487a[_0x2cae('0x19')]),_0x2cae('0x59'),{'uri':_0x2d984f});})[_0x2cae('0x2d')](function(_0x2a03df){logger[_0x2cae('0x2c')](_0x2cae('0x5b'),JSON[_0x2cae('0x26')](_0x2a03df));});};exports['unmanaged']=function(_0x237291,_0x12588b,_0x2be6a4,_0x3fedd7,_0x5b0a14,_0x52cf2c){var _0x28d917,_0x3b22d0,_0x2b7ba4,_0x77a27a;_0x52cf2c[_0x2cae('0x3c')]=intUtil['stripTrailingSlash'](_0x52cf2c[_0x2cae('0x3c')]);_0x52cf2c[_0x2cae('0x4d')]=intUtil['stripTrailingSlash'](_0x52cf2c[_0x2cae('0x4d')]);if(_0x5b0a14&&_0x5b0a14['monitor_format']){logger[_0x2cae('0x1b')]('['+_0x12588b[_0x2cae('0x61')]['toUpperCase']()+']',_0x2cae('0x4b'));_0x12588b[_0x2cae('0x4c')]=util['format'](_0x2cae('0x5c'),_0x52cf2c[_0x2cae('0x4d')],_0x12588b[_0x2cae('0x4e')],md5(_0x12588b[_0x2cae('0x4e')]));}else{_0x12588b['recordingURL']='';}return getConnection(_0x52cf2c)[_0x2cae('0x27')](function(_0x4a830f){_0x77a27a=_0x4a830f;return getUser(_0x52cf2c,'',_0x77a27a);})[_0x2cae('0x27')](function(_0x5cd227){_0x28d917=_0x5cd227;logger[_0x2cae('0x1b')](_0x2cae('0x4f'),_0x28d917['id']);return getEndUser(_0x52cf2c,_0x12588b[_0x2cae('0x50')],_0x12588b[_0x2cae('0x51')],_0x77a27a);})[_0x2cae('0x27')](function(_0x2bfc5a){_0x3b22d0=_0x2bfc5a;logger[_0x2cae('0x1b')](_0x2cae('0x60'),_0x3b22d0['id']);return createTicket(_0x52cf2c,_0x28d917,_0x3b22d0,_0x2be6a4,_0x12588b,_0x2be6a4['Fields'],_0x77a27a);})['then'](function(_0x44e389){_0x2b7ba4=_0x44e389;logger['info'](_0x2cae('0x53'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2b7ba4['id']);})[_0x2cae('0x2d')](function(_0x24127b){logger[_0x2cae('0x2c')]('['+_0x12588b[_0x2cae('0x61')]['toUpperCase']()+']',JSON[_0x2cae('0x26')](_0x24127b));});}; \ No newline at end of file +var _0x9767=['getString','Subjects','POST','format','%s/webservice.php','remoteUri','username','sessionName','stringify','then','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','info','Getting\x20agent\x20with\x20email','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','result','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','catch','Searching\x20end\x20user\x20with\x20phone','GET','query','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','create','Enduser\x20created.','phone','getEndUser','accessKey','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','unmanaged','stripTrailingSlash','monitor_format','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20Ticket\x20ID\x20is:','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','Open'];(function(_0x48e497,_0x5ef79a){var _0x1aabc8=function(_0x147839){while(--_0x147839){_0x48e497['push'](_0x48e497['shift']());}};_0x1aabc8(++_0x5ef79a);}(_0x9767,0xb9));var _0x7976=function(_0x2216b3,_0x2892b3){_0x2216b3=_0x2216b3-0x0;var _0x514d21=_0x9767[_0x2216b3];return _0x514d21;};'use strict';var _=require(_0x7976('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x7976('0x1'));var util=require(_0x7976('0x2'));var Redis=require(_0x7976('0x3'));var intUtil=require(_0x7976('0x4'));var config=require(_0x7976('0x5'));var logger=require(_0x7976('0x6'))(_0x7976('0x7'));config[_0x7976('0x8')]=_['defaults'](config[_0x7976('0x8')],{'host':_0x7976('0x9'),'port':0x18eb});var io=require(_0x7976('0xa'))(new Redis(config[_0x7976('0x8')]));function emit(_0x1a8dc6,_0x24bb6b,_0x357e5f){io['to'](_0x1a8dc6)[_0x7976('0xb')](_0x24bb6b,_0x357e5f);}function getCustomFields(_0x5ce2be,_0xaa9292){var _0x1d1198={};if(_0x5ce2be['length']>0x0){_[_0x7976('0xc')](_0x5ce2be,function(_0x4ee13a){if(_[_0x7976('0xd')]([_0x7976('0xe'),_0x7976('0xf')],_0x4ee13a[_0x7976('0x10')])&&_0x4ee13a[_0x7976('0x11')]){_0x1d1198[_0x4ee13a[_0x7976('0x11')]]=_0x4ee13a['content'][_0x7976('0x12')]();}else if(_0x4ee13a[_0x7976('0x10')]===_0x7976('0x13')&&_0x4ee13a[_0x7976('0x14')]&&_0x4ee13a[_0x7976('0x11')]&&_0xaa9292[_0x4ee13a[_0x7976('0x14')]]){_0x1d1198[_0x4ee13a[_0x7976('0x11')]]=_0xaa9292[_0x4ee13a[_0x7976('0x14')]][_0x7976('0x12')]();}else if(_0x4ee13a[_0x7976('0x10')]===_0x7976('0x15')&&_0x4ee13a[_0x7976('0x16')]&&_0x4ee13a[_0x7976('0x16')][_0x7976('0x17')]&&_0x4ee13a[_0x7976('0x11')]&&_0xaa9292[_0x4ee13a['Variable'][_0x7976('0x17')][_0x7976('0x18')]()]){_0x1d1198[_0x4ee13a[_0x7976('0x11')]]=_0xaa9292[_0x4ee13a['Variable'][_0x7976('0x17')][_0x7976('0x18')]()][_0x7976('0x12')]();}});}return _0x1d1198;}function createTicket(_0xc8bd1e,_0x181cb8,_0x4c7f29,_0x586ebd,_0x4a2023,_0x464cc8,_0x14a86d){logger['info'](_0x7976('0x19'));var _0x6d808f=_['merge']({'parent_id':'','assigned_user_id':_0x181cb8['id'],'ticketpriorities':'Normal','ticketstatus':_0x7976('0x1a'),'ticket_title':intUtil[_0x7976('0x1b')](_0x586ebd[_0x7976('0x1c')],_0x4a2023,'\x20'),'description':intUtil[_0x7976('0x1b')](_0x586ebd['Descriptions'],_0x4a2023,'\x0a'),'contact_id':_0x4c7f29['id']},getCustomFields(_0x464cc8,_0x4a2023));var _0x24d2eb={'method':_0x7976('0x1d'),'uri':util[_0x7976('0x1e')](_0x7976('0x1f'),_0xc8bd1e[_0x7976('0x20')]),'form':{'operation':'create','username':_0xc8bd1e[_0x7976('0x21')],'sessionName':_0x14a86d[_0x7976('0x22')],'elementType':'HelpDesk','element':JSON[_0x7976('0x23')](_0x6d808f)},'json':!![]};return request(_0x24d2eb)[_0x7976('0x24')](function(_0x38cc2d){if(_0x38cc2d['success']){return BPromise[_0x7976('0x25')]({'id':_0x38cc2d['result']['id']});}else{throw new Error(util['format'](_0x7976('0x26'),JSON[_0x7976('0x23')](_0x38cc2d['error'])));}})['catch'](function(_0x41b496){var _0x2dfe1d=_0x41b496[_0x7976('0x27')]||0x1f4;logger[_0x7976('0x28')](_0x7976('0x29'),_0x7976('0x2a'),_0x2dfe1d,JSON[_0x7976('0x23')](_0x41b496));});}function getUser(_0x4fb1b5,_0x1a095f,_0x397742){if(intUtil[_0x7976('0x2b')](_0x1a095f)){logger[_0x7976('0x2c')](_0x7976('0x2d'),_0x1a095f);return request({'method':'GET','uri':util[_0x7976('0x1e')]('%s/webservice.php',_0x4fb1b5[_0x7976('0x20')]),'qs':{'operation':'query','username':_0x4fb1b5['username'],'sessionName':_0x397742[_0x7976('0x22')],'query':util['format'](_0x7976('0x2e'),_0x1a095f)},'json':!![]})[_0x7976('0x24')](function(_0x3a9821){if(_0x3a9821[_0x7976('0x2f')]&&_0x3a9821[_0x7976('0x30')][_0x7976('0x31')]){logger[_0x7976('0x2c')](_0x7976('0x32'));return BPromise[_0x7976('0x25')]({'id':_0x3a9821['result'][0x0]['id'],'email':_0x3a9821[_0x7976('0x30')][0x0][_0x7976('0x33')],'name':_0x3a9821[_0x7976('0x30')][0x0][_0x7976('0x34')]+'\x20'+_0x3a9821[_0x7976('0x30')][_0x7976('0x35')]});}else{logger[_0x7976('0x2c')](_0x7976('0x36'));return BPromise[_0x7976('0x25')]({'id':_0x397742[_0x7976('0x37')],'email':_0x4fb1b5[_0x7976('0x21')],'name':'admin'});}})['catch'](function(_0x54d884){var _0x5edff5=_0x54d884[_0x7976('0x27')]||0x1f4;logger[_0x7976('0x28')](_0x7976('0x29'),_0x7976('0x38'),_0x5edff5,JSON[_0x7976('0x23')](_0x54d884));});}else{logger[_0x7976('0x2c')](_0x7976('0x36'));return BPromise[_0x7976('0x25')]({'id':_0x397742[_0x7976('0x37')],'email':_0x4fb1b5[_0x7976('0x21')],'name':_0x7976('0x39')})[_0x7976('0x3a')](function(_0x564dd5){var _0x3f0b13=_0x564dd5['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0x7976('0x38'),_0x3f0b13,JSON[_0x7976('0x23')](_0x564dd5));});}}function getEndUser(_0x29a5f1,_0x15bd30,_0xf613db,_0x4ae8ba){logger[_0x7976('0x2c')](_0x7976('0x3b'),_0xf613db);return request({'method':_0x7976('0x3c'),'uri':util[_0x7976('0x1e')]('%s/webservice.php',_0x29a5f1[_0x7976('0x20')]),'qs':{'operation':_0x7976('0x3d'),'username':_0x29a5f1[_0x7976('0x21')],'sessionName':_0x4ae8ba['sessionName'],'query':util[_0x7976('0x1e')](_0x7976('0x3e'),_0xf613db,_0xf613db,_0xf613db,_0xf613db,_0xf613db)},'json':!![]})['then'](function(_0x4078f4){if(_0x4078f4[_0x7976('0x2f')]&&_0x4078f4['result']['length']){logger['info'](_0x7976('0x3f'));return BPromise['resolve']({'id':_0x4078f4[_0x7976('0x30')][0x0]['id'],'name':_0x4078f4[_0x7976('0x30')][0x0][_0x7976('0x40')]+'\x20'+_0x4078f4['result'][0x0][_0x7976('0x41')],'phone':_0xf613db});}else{logger[_0x7976('0x2c')](_0x7976('0x42'));return request({'method':_0x7976('0x1d'),'uri':util['format'](_0x7976('0x1f'),_0x29a5f1[_0x7976('0x20')]),'form':{'operation':_0x7976('0x43'),'sessionName':_0x4ae8ba[_0x7976('0x22')],'elementType':'Contacts','element':JSON[_0x7976('0x23')]({'lastname':_0x15bd30,'phone':_0xf613db,'assigned_user_id':'\x20'})},'json':!![]})[_0x7976('0x24')](function(_0x1e23b8){logger[_0x7976('0x2c')](_0x7976('0x44'));return BPromise[_0x7976('0x25')]({'id':_0x1e23b8[_0x7976('0x30')]['id'],'name':_0x1e23b8[_0x7976('0x30')][_0x7976('0x41')],'phone':_0x1e23b8[_0x7976('0x30')][_0x7976('0x45')]});})[_0x7976('0x3a')](function(_0x2c3a97){var _0x27f848=_0x2c3a97[_0x7976('0x27')]||0x1f4;logger['error'](_0x7976('0x29'),_0x7976('0x46'),_0x27f848,JSON[_0x7976('0x23')](_0x2c3a97));});}});}function getConnection(_0x472747){var _0x362d18=_0x472747[_0x7976('0x21')];var _0x58b972=_0x472747[_0x7976('0x47')];return request({'method':'GET','uri':util['format'](_0x7976('0x1f'),_0x472747[_0x7976('0x20')]),'qs':{'operation':'getchallenge','username':_0x362d18},'json':!![]})[_0x7976('0x24')](function(_0x540d19){if(_0x540d19[_0x7976('0x2f')]){return request({'method':_0x7976('0x1d'),'uri':util[_0x7976('0x1e')](_0x7976('0x1f'),_0x472747[_0x7976('0x20')]),'form':{'operation':_0x7976('0x48'),'username':_0x362d18,'accessKey':md5(_0x540d19[_0x7976('0x30')][_0x7976('0x49')]+_0x58b972)},'json':!![]});}})[_0x7976('0x24')](function(_0x2caf93){if(_0x2caf93[_0x7976('0x2f')]){return BPromise[_0x7976('0x25')](_0x2caf93[_0x7976('0x30')]);}else{throw new Error(util[_0x7976('0x1e')](_0x7976('0x4a'),_0x472747['id']));}})[_0x7976('0x3a')](function(_0x4f6055){var _0x224d62=_0x4f6055[_0x7976('0x27')]||0x1f4;logger['error'](_0x7976('0x29'),_0x7976('0x4b'),_0x224d62,JSON[_0x7976('0x23')](_0x4f6055));});}function request(_0x459eb0){logger[_0x7976('0x2c')](_0x7976('0x4c'),JSON[_0x7976('0x23')](_0x459eb0));return rp(_0x459eb0);}exports[_0x7976('0x4d')]=function(_0x564e1f,_0x1ad1e6,_0x1cd873,_0x312f6a,_0x1e5bd9,_0x2b5809){var _0x5113cd,_0x3cbd0e,_0x3cdfc7,_0xb14f08;_0x2b5809[_0x7976('0x20')]=intUtil['stripTrailingSlash'](_0x2b5809[_0x7976('0x20')]);if(_0x1e5bd9&&_0x1e5bd9['monitor_format']){logger[_0x7976('0x2c')](_0x7976('0x4e'),_0x7976('0x4f'));_0x1ad1e6[_0x7976('0x50')]=util[_0x7976('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b5809['serverUrl'],_0x1ad1e6[_0x7976('0x51')],md5(_0x1ad1e6['uniqueid']));}else{_0x1ad1e6[_0x7976('0x50')]='';}return getConnection(_0x2b5809)['then'](function(_0x222b55){_0xb14f08=_0x222b55;return getUser(_0x2b5809,_0x312f6a[_0x7976('0x52')],_0xb14f08);})[_0x7976('0x24')](function(_0x4d1df5){_0x5113cd=_0x4d1df5;logger['info']('The\x20User\x20ID\x20is:',_0x5113cd['id']);return getEndUser(_0x2b5809,_0x1ad1e6['calleridname'],_0x1ad1e6[_0x7976('0x53')],_0xb14f08);})[_0x7976('0x24')](function(_0x5ccd4a){_0x3cbd0e=_0x5ccd4a;logger[_0x7976('0x2c')](_0x7976('0x54'),_0x3cbd0e['id']);return createTicket(_0x2b5809,_0x5113cd,_0x3cbd0e,_0x1cd873,_0x1ad1e6,_0x1cd873[_0x7976('0x55')],_0xb14f08);})[_0x7976('0x24')](function(_0x38e486){_0x3cdfc7=_0x38e486;logger[_0x7976('0x2c')](_0x7976('0x56'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3cdfc7['id']);var _0x2dc986=util['format'](_0x7976('0x57'),_0x2b5809[_0x7976('0x20')],_[_0x7976('0x58')](_0x3cdfc7['id'],'x')[0x1]);logger[_0x7976('0x2c')](_0x7976('0x4e'),_0x7976('0x59'));emit(util[_0x7976('0x1e')](_0x7976('0x5a'),_0x312f6a['name']),_0x7976('0x5b'),{'uri':_0x2dc986});})['catch'](function(_0x16c018){logger[_0x7976('0x28')](_0x7976('0x4e'),JSON['stringify'](_0x16c018));});};exports[_0x7976('0x5c')]=function(_0x2acfdb,_0x2a8f20,_0xfc7c14,_0x1666a5,_0x175654,_0x5619a3,_0x317930){var _0x37e5d6,_0x26c412,_0x322da4,_0x30dcb1;_0x5619a3['remoteUri']=intUtil['stripTrailingSlash'](_0x5619a3[_0x7976('0x20')]);_0x5619a3[_0x7976('0x5d')]=intUtil['stripTrailingSlash'](_0x5619a3[_0x7976('0x5d')]);if(_0x317930&&_0x317930[_0x7976('0x5e')]&&_0x317930[_0x7976('0x5e')]!==_0x7976('0x5f')){logger['info'](_0x7976('0x60'),'Recording\x20is\x20enabled!');_0x2a8f20[_0x7976('0x50')]=util[_0x7976('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5619a3[_0x7976('0x5d')],_0x2a8f20[_0x7976('0x51')],md5(_0x2a8f20[_0x7976('0x51')]));}return getConnection(_0x5619a3)[_0x7976('0x24')](function(_0x3cd9bd){_0x30dcb1=_0x3cd9bd;return getUser(_0x5619a3,_0x1666a5[_0x7976('0x52')],_0x30dcb1);})['then'](function(_0x394717){_0x37e5d6=_0x394717;logger['info'](_0x7976('0x61'),_0x37e5d6['id']);return getEndUser(_0x5619a3,_0x2a8f20[_0x7976('0x62')],_0x2a8f20[_0x7976('0x63')],_0x30dcb1);})['then'](function(_0x51f25b){_0x26c412=_0x51f25b;logger[_0x7976('0x2c')](_0x7976('0x54'),_0x26c412['id']);return createTicket(_0x5619a3,_0x37e5d6,_0x26c412,_0xfc7c14,_0x2a8f20,_0xfc7c14[_0x7976('0x55')],_0x30dcb1);})['then'](function(_0x12fb65){_0x322da4=_0x12fb65;logger['info'](_0x7976('0x56'));logger[_0x7976('0x2c')]('The\x20Ticket\x20ID\x20is:',_0x322da4['id']);var _0x2ab374=util[_0x7976('0x1e')](_0x7976('0x57'),_0x5619a3[_0x7976('0x20')],_[_0x7976('0x58')](_0x322da4['id'],'x')[0x1]);logger[_0x7976('0x2c')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7976('0x1e')](_0x7976('0x5a'),_0x1666a5[_0x7976('0x17')]),_0x7976('0x5b'),{'uri':_0x2ab374});})[_0x7976('0x3a')](function(_0x1c2ea4){logger[_0x7976('0x28')](_0x7976('0x60'),JSON['stringify'](_0x1c2ea4));});};exports[_0x7976('0x64')]=function(_0xe7468f,_0x3c2686,_0x2dfbf5,_0x588dcc,_0x24987b,_0x2efbe4){var _0x187040,_0x2c41d7,_0x294a80,_0xf33063;_0x2efbe4[_0x7976('0x20')]=intUtil[_0x7976('0x65')](_0x2efbe4[_0x7976('0x20')]);_0x2efbe4['serverUrl']=intUtil[_0x7976('0x65')](_0x2efbe4[_0x7976('0x5d')]);if(_0x24987b&&_0x24987b[_0x7976('0x66')]){logger[_0x7976('0x2c')]('['+_0x3c2686['lastevent'][_0x7976('0x67')]()+']','Recording\x20is\x20enabled!');_0x3c2686[_0x7976('0x50')]=util[_0x7976('0x1e')](_0x7976('0x68'),_0x2efbe4[_0x7976('0x5d')],_0x3c2686['uniqueid'],md5(_0x3c2686[_0x7976('0x51')]));}else{_0x3c2686['recordingURL']='';}return getConnection(_0x2efbe4)['then'](function(_0x207ae8){_0xf33063=_0x207ae8;return getUser(_0x2efbe4,'',_0xf33063);})['then'](function(_0x42f900){_0x187040=_0x42f900;logger[_0x7976('0x2c')](_0x7976('0x61'),_0x187040['id']);return getEndUser(_0x2efbe4,_0x3c2686['calleridname'],_0x3c2686['calleridnum'],_0xf33063);})[_0x7976('0x24')](function(_0x12c34a){_0x2c41d7=_0x12c34a;logger[_0x7976('0x2c')]('The\x20Enduser\x20ID\x20is:',_0x2c41d7['id']);return createTicket(_0x2efbe4,_0x187040,_0x2c41d7,_0x2dfbf5,_0x3c2686,_0x2dfbf5['Fields'],_0xf33063);})['then'](function(_0x354d29){_0x294a80=_0x354d29;logger[_0x7976('0x2c')](_0x7976('0x56'));logger[_0x7976('0x2c')](_0x7976('0x69'),_0x294a80['id']);})[_0x7976('0x3a')](function(_0x1c7c74){logger[_0x7976('0x28')]('['+_0x3c2686['lastevent'][_0x7976('0x67')]()+']',JSON['stringify'](_0x1c7c74));});}; \ 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 58cf6d1..64e51fe 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 _0xf024=['forEach','string','picklist','type','nameField','customField','toLowerCase','content','includes','idField','custom_fields','push','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','[OUTBOUND]','%s/agent/tickets/%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','toUpperCase','calleridnum','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map'];(function(_0x31be28,_0x598de7){var _0x4d23f2=function(_0x53828e){while(--_0x53828e){_0x31be28['push'](_0x31be28['shift']());}};_0x4d23f2(++_0x598de7);}(_0xf024,0x18e));var _0x4f02=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xf024[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x4f02('0x0'));var rp=require(_0x4f02('0x1'));var md5=require('md5');var util=require(_0x4f02('0x2'));var Redis=require(_0x4f02('0x3'));var intUtil=require(_0x4f02('0x4'));var config=require(_0x4f02('0x5'));var logger=require(_0x4f02('0x6'))(_0x4f02('0x7'));config[_0x4f02('0x8')]=_[_0x4f02('0x9')](config[_0x4f02('0x8')],{'host':_0x4f02('0xa'),'port':0x18eb});var io=require(_0x4f02('0xb'))(new Redis(config[_0x4f02('0x8')]));function emit(_0x584b45,_0x1304e1,_0x45c542){io['to'](_0x584b45)[_0x4f02('0xc')](_0x1304e1,_0x45c542);}var headers={'Content-Type':_0x4f02('0xd'),'Accept':_0x4f02('0xd')};function getTicket(_0x2be7bb,_0x59ab9c,_0x33cb71,_0x9e7f43,_0x10e332){logger[_0x4f02('0xe')](_0x4f02('0xf'));return request({'uri':util[_0x4f02('0x10')](_0x4f02('0x11'),_0x2be7bb[_0x4f02('0x12')]),'method':_0x4f02('0x13'),'body':{'ticket':_['merge']({'requester_id':_0x33cb71['id'],'submitter_id':_0x59ab9c?_0x59ab9c['id']:undefined,'assignee_id':_0x59ab9c?_0x59ab9c['id']:undefined,'tags':getTags(_0x9e7f43[_0x4f02('0x14')],_0x4f02('0x15')),'subject':intUtil[_0x4f02('0x16')](_0x9e7f43['Subjects'],_0x10e332,'\x20'),'description':intUtil[_0x4f02('0x16')](_0x9e7f43[_0x4f02('0x17')],_0x10e332,'\x0a'),'comment':{'public':![],'body':intUtil[_0x4f02('0x16')](_0x9e7f43[_0x4f02('0x17')],_0x10e332,'\x0a')}},getCustomFields(_0x9e7f43[_0x4f02('0x18')],_0x10e332))}})[_0x4f02('0x19')](function(_0x5bf847){logger[_0x4f02('0xe')](_0x4f02('0x1a'));return _0x5bf847[_0x4f02('0x1b')];});}function getUser(_0x8070b,_0x3c9a79){if(intUtil[_0x4f02('0x1c')](_0x3c9a79)){logger[_0x4f02('0xe')](_0x4f02('0x1d'),_0x3c9a79);return request({'uri':util['format']('%s/search.json',_0x8070b[_0x4f02('0x12')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x3c9a79)}})['then'](function(_0x233f20){if(_0x233f20[_0x4f02('0x1e')]){logger['info'](_0x4f02('0x1f'));return _[_0x4f02('0x20')](_0x233f20[_0x4f02('0x21')],{'email':_0x3c9a79,'role':'agent'});}else{logger[_0x4f02('0xe')](_0x4f02('0x22'));return request({'uri':util[_0x4f02('0x10')](_0x4f02('0x23'),_0x8070b[_0x4f02('0x12')])})['then'](function(_0x252466){logger[_0x4f02('0xe')](_0x4f02('0x24'));return _0x252466[_0x4f02('0x25')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x4f02('0x23'),_0x8070b[_0x4f02('0x12')])})[_0x4f02('0x19')](function(_0x2b3fef){logger[_0x4f02('0xe')]('Admin\x20account\x20selected.');return _0x2b3fef['user'];});}}function getEndUser(_0x452299,_0x28a9a4,_0x5efeb0){logger['info'](_0x4f02('0x26'),_0x5efeb0);return request({'uri':util[_0x4f02('0x10')](_0x4f02('0x27'),_0x452299[_0x4f02('0x12')]),'qs':{'query':util[_0x4f02('0x10')](_0x4f02('0x28'),_0x5efeb0)}})['then'](function(_0x226c2c){var _0x52bb85;if(_0x226c2c[_0x4f02('0x21')][_0x4f02('0x29')]){_0x226c2c[_0x4f02('0x21')]=_[_0x4f02('0x2a')](_0x226c2c['results'],{'suspended':![],'role':_0x4f02('0x2b')});if(_0x226c2c[_0x4f02('0x21')][_0x4f02('0x29')]){_0x52bb85=_[_0x4f02('0x2c')](_0x226c2c[_0x4f02('0x21')]);}}if(_0x52bb85){logger[_0x4f02('0xe')](_0x4f02('0x2d'));return _0x52bb85;}else{logger[_0x4f02('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x4f02('0x10')]('%s/users.json',_0x452299['remoteUri']),'method':_0x4f02('0x13'),'body':{'user':{'role':_0x4f02('0x2b'),'name':util[_0x4f02('0x10')](_0x4f02('0x2e'),_0x28a9a4||_0x5efeb0),'phone':_0x5efeb0}}})['then'](function(_0x3fe2f0){logger[_0x4f02('0xe')](_0x4f02('0x2f'));return _0x3fe2f0['user'];});}});}function getAuth(_0x1187c2){var _0x380c39;if(_0x1187c2[_0x4f02('0x30')]==='password'){_0x380c39=util['format'](_0x4f02('0x31'),_0x1187c2[_0x4f02('0x32')],_0x1187c2[_0x4f02('0x33')]);}else if(_0x1187c2[_0x4f02('0x30')]===_0x4f02('0x34')){_0x380c39=util[_0x4f02('0x10')](_0x4f02('0x35'),_0x1187c2[_0x4f02('0x32')],_0x1187c2[_0x4f02('0x34')]);}return util['format'](_0x4f02('0x36'),new Buffer(_0x380c39)[_0x4f02('0x37')](_0x4f02('0x38')));}function request(_0x383373){logger[_0x4f02('0x39')](_0x4f02('0x3a'),JSON[_0x4f02('0x3b')](_0x383373));return rp(_['defaults'](_0x383373,{'method':_0x4f02('0x3c'),'headers':headers,'json':!![]}));}function getTags(_0x4079b8,_0x1aae7d){var _0x5f876d=[];if(_0x4079b8&&_0x4079b8[_0x4f02('0x29')]>0x0){_0x5f876d=_[_0x4f02('0x3d')](_0x4079b8,_0x1aae7d);}return _0x5f876d;}function getCustomFields(_0xbea01e,_0x40f9c9){var _0x3e48ba=[];var _0x1e3262={'custom_fields':[]};if(_0xbea01e[_0x4f02('0x29')]>0x0){_[_0x4f02('0x3e')](_0xbea01e,function(_0x95df2c){if(_['includes']([_0x4f02('0x3f'),_0x4f02('0x40')],_0x95df2c[_0x4f02('0x41')])&&_0x95df2c[_0x4f02('0x42')]&&!_0x95df2c[_0x4f02('0x43')]){_0x1e3262[_0x95df2c[_0x4f02('0x42')][_0x4f02('0x44')]()]=_0x95df2c[_0x4f02('0x45')][_0x4f02('0x37')]();}else if(_[_0x4f02('0x46')]([_0x4f02('0x3f'),_0x4f02('0x40')],_0x95df2c[_0x4f02('0x41')])&&_0x95df2c[_0x4f02('0x47')]&&_0x95df2c['customField']){_0x1e3262[_0x4f02('0x48')][_0x4f02('0x49')]({'id':_0x95df2c[_0x4f02('0x47')],'value':_0x95df2c[_0x4f02('0x45')]['toString']()});}else if(_0x95df2c['type']==='variable'&&_0x95df2c[_0x4f02('0x4a')]&&_0x95df2c[_0x4f02('0x47')]&&_0x95df2c[_0x4f02('0x43')]){_0x40f9c9[_0x95df2c[_0x4f02('0x4a')]]&&_0x1e3262[_0x4f02('0x48')][_0x4f02('0x49')]({'id':_0x95df2c[_0x4f02('0x47')],'value':_0x40f9c9[_0x95df2c[_0x4f02('0x4a')]][_0x4f02('0x37')]()});}else if(_0x95df2c[_0x4f02('0x41')]===_0x4f02('0x4b')&&_0x95df2c[_0x4f02('0x4c')]&&_0x95df2c[_0x4f02('0x4c')]['name']&&_0x95df2c[_0x4f02('0x47')]&&_0x95df2c[_0x4f02('0x43')]){_0x40f9c9[_0x95df2c[_0x4f02('0x4c')]['name'][_0x4f02('0x44')]()]&&_0x1e3262[_0x4f02('0x48')][_0x4f02('0x49')]({'id':_0x95df2c[_0x4f02('0x47')],'value':_0x40f9c9[_0x95df2c['Variable'][_0x4f02('0x15')][_0x4f02('0x44')]()][_0x4f02('0x37')]()});}});}return _0x1e3262;}exports['queue']=function(_0x1d678c,_0x4cb109,_0x379b3d,_0x252983,_0x271bd9,_0x436cf7){var _0x2bd497,_0xd96755;_0x436cf7['remoteUri']=intUtil[_0x4f02('0x4d')](_0x436cf7[_0x4f02('0x12')]);_0x436cf7[_0x4f02('0x4e')]=intUtil[_0x4f02('0x4d')](_0x436cf7[_0x4f02('0x4e')]);if(_0x271bd9&&_0x271bd9[_0x4f02('0x4f')]){logger[_0x4f02('0xe')]('[QUEUE]','Recording\x20is\x20enabled!');_0x4cb109[_0x4f02('0x50')]=util['format'](_0x4f02('0x51'),_0x436cf7['serverUrl'],_0x4cb109[_0x4f02('0x52')],md5(_0x4cb109[_0x4f02('0x52')]));}else{_0x4cb109[_0x4f02('0x50')]='';}headers[_0x4f02('0x53')]=getAuth(_0x436cf7);return getUser(_0x436cf7,_0x252983[_0x4f02('0x54')])[_0x4f02('0x19')](function(_0x2fce9d){_0x2bd497=_0x2fce9d;logger[_0x4f02('0xe')](_0x4f02('0x55'),_0x2bd497['id']);return getEndUser(_0x436cf7,_0x4cb109[_0x4f02('0x56')],_0x4cb109['calleridnum']);})[_0x4f02('0x19')](function(_0x1e9c86){_0xd96755=_0x1e9c86;logger[_0x4f02('0xe')](_0x4f02('0x57'),_0xd96755['id']);return getTicket(_0x436cf7,_0x2bd497,_0xd96755,_0x379b3d,_0x4cb109);})[_0x4f02('0x19')](function(_0x186494){if(_0x186494){logger[_0x4f02('0xe')](_0x4f02('0x58'),_0x186494['id']);switch(_0x436cf7[_0x4f02('0x41')]){case _0x4f02('0x59'):logger['info']('[QUEUE]',_0x4f02('0x5a'));return request({'uri':util[_0x4f02('0x10')](_0x4f02('0x5b'),_0x436cf7[_0x4f02('0x12')],_0x2bd497['id'],_0x186494['id']),'method':'POST'});case _0x4f02('0x5c'):logger[_0x4f02('0xe')](_0x4f02('0x5d'),_0x4f02('0x5e'));emit(util[_0x4f02('0x10')]('user:%s',_0x252983[_0x4f02('0x15')]),_0x4f02('0x5f'),{'uri':util['format']('%s/agent/tickets/%s',_0x436cf7['remoteUri'][_0x4f02('0x60')](_0x4f02('0x61'),''),_0x186494['id'])});break;default:logger[_0x4f02('0x62')](_0x4f02('0x5d'),_0x4f02('0x63'));}}})['catch'](function(_0x34164f){logger[_0x4f02('0x62')](_0x4f02('0x64'),util[_0x4f02('0x65')](_0x34164f,{'showHidden':!![],'depth':null}));});};exports[_0x4f02('0x66')]=function(_0x51ded8,_0x2da84c,_0x4dee96,_0x3b294e,_0x3e3f3f,_0x285233,_0x101512){var _0x57567f,_0x5614fc;_0x285233[_0x4f02('0x12')]=intUtil['stripTrailingSlash'](_0x285233[_0x4f02('0x12')]);_0x285233['serverUrl']=intUtil['stripTrailingSlash'](_0x285233['serverUrl']);if(_0x101512&&_0x101512[_0x4f02('0x67')]&&_0x101512[_0x4f02('0x67')]!==_0x4f02('0x68')){logger[_0x4f02('0xe')]('[OUTBOUND]',_0x4f02('0x69'));_0x2da84c['recordingURL']=util[_0x4f02('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x285233[_0x4f02('0x4e')],_0x2da84c['uniqueid'],md5(_0x2da84c[_0x4f02('0x52')]));}headers[_0x4f02('0x53')]=getAuth(_0x285233);return getUser(_0x285233,_0x3b294e[_0x4f02('0x54')])[_0x4f02('0x19')](function(_0x57a15e){_0x57567f=_0x57a15e;logger[_0x4f02('0xe')](_0x4f02('0x55'),_0x57567f['id']);return getEndUser(_0x285233,_0x2da84c[_0x4f02('0x6a')],_0x2da84c['destcalleridnum']);})[_0x4f02('0x19')](function(_0x40b11d){_0x5614fc=_0x40b11d;logger['info'](_0x4f02('0x57'),_0x5614fc['id']);return getTicket(_0x285233,_0x57567f,_0x5614fc,_0x4dee96,_0x2da84c);})['then'](function(_0x3393c9){if(_0x3393c9){logger[_0x4f02('0xe')](_0x4f02('0x58'),_0x3393c9['id']);switch(_0x285233[_0x4f02('0x41')]){case _0x4f02('0x59'):logger[_0x4f02('0xe')]('[OUTBOUND]',_0x4f02('0x5a'));return request({'uri':util[_0x4f02('0x10')](_0x4f02('0x5b'),_0x285233[_0x4f02('0x12')],_0x57567f['id'],_0x3393c9['id']),'method':_0x4f02('0x13')});case _0x4f02('0x5c'):logger[_0x4f02('0xe')](_0x4f02('0x6b'),_0x4f02('0x5e'));emit(util[_0x4f02('0x10')]('user:%s',_0x3b294e[_0x4f02('0x15')]),'trigger:browser:url',{'uri':util[_0x4f02('0x10')](_0x4f02('0x6c'),_0x285233['remoteUri'][_0x4f02('0x60')]('/api/v2',''),_0x3393c9['id'])});break;default:logger[_0x4f02('0x62')](_0x4f02('0x6b'),_0x4f02('0x63'));}}})[_0x4f02('0x6d')](function(_0x96afd9){logger[_0x4f02('0x62')](_0x4f02('0x6e'),util[_0x4f02('0x65')](_0x96afd9,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x55647f,_0x1d28f6,_0xedc7c0,_0x13928a,_0x9e7daa,_0x552a08){var _0x368296,_0x536c6b;_0x552a08['remoteUri']=intUtil['stripTrailingSlash'](_0x552a08[_0x4f02('0x12')]);_0x552a08[_0x4f02('0x4e')]=intUtil['stripTrailingSlash'](_0x552a08[_0x4f02('0x4e')]);if(_0x9e7daa&&_0x9e7daa['monitor_format']){logger[_0x4f02('0xe')]('['+_0x1d28f6['lastevent'][_0x4f02('0x6f')]()+']',_0x4f02('0x69'));_0x1d28f6[_0x4f02('0x50')]=util[_0x4f02('0x10')](_0x4f02('0x51'),_0x552a08[_0x4f02('0x4e')],_0x1d28f6[_0x4f02('0x52')],md5(_0x1d28f6[_0x4f02('0x52')]));}else{_0x1d28f6[_0x4f02('0x50')]='';}headers[_0x4f02('0x53')]=getAuth(_0x552a08);return getUser(_0x552a08)[_0x4f02('0x19')](function(_0xa59832){_0x368296=_0xa59832;logger[_0x4f02('0xe')](_0x4f02('0x55'),_0x368296['id']);return getEndUser(_0x552a08,_0x1d28f6[_0x4f02('0x56')],_0x1d28f6[_0x4f02('0x70')]);})[_0x4f02('0x19')](function(_0x5990af){_0x536c6b=_0x5990af;logger[_0x4f02('0xe')](_0x4f02('0x57'),_0x536c6b['id']);return getTicket(_0x552a08,_0x368296,_0x536c6b,_0xedc7c0,_0x1d28f6);})[_0x4f02('0x19')](function(_0x13ff04){if(_0x13ff04){logger[_0x4f02('0xe')]('The\x20Ticket\x20ID\x20is:',_0x13ff04['id']);}})['catch'](function(_0x180587){logger[_0x4f02('0x62')]('['+_0x1d28f6[_0x4f02('0x71')][_0x4f02('0x6f')]()+']'+_0x4f02('0x72'),util[_0x4f02('0x65')](_0x180587,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xdc08=['destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lodash','request-promise','md5','util','./util','../../../../config/logger','zendesk','localhost','socket.io-emitter','redis','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','Getting\x20agent\x20with\x20email','%s/search.json','format','then','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','%s/token:%s','toString','debug','stringify','map','forEach','includes','type','customField','toLowerCase','picklist','idField','push','content','variable','variableName','custom_fields','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','Authorization'];(function(_0x52666e,_0x5b3776){var _0x515330=function(_0x29cd4f){while(--_0x29cd4f){_0x52666e['push'](_0x52666e['shift']());}};_0x515330(++_0x5b3776);}(_0xdc08,0x77));var _0x8dc0=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xdc08[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x8dc0('0x0'));var rp=require(_0x8dc0('0x1'));var md5=require(_0x8dc0('0x2'));var util=require(_0x8dc0('0x3'));var Redis=require('ioredis');var intUtil=require(_0x8dc0('0x4'));var config=require('../../../../config/environment');var logger=require(_0x8dc0('0x5'))(_0x8dc0('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x8dc0('0x7'),'port':0x18eb});var io=require(_0x8dc0('0x8'))(new Redis(config[_0x8dc0('0x9')]));function emit(_0x1c95a2,_0x27da51,_0x4e5760){io['to'](_0x1c95a2)[_0x8dc0('0xa')](_0x27da51,_0x4e5760);}var headers={'Content-Type':_0x8dc0('0xb'),'Accept':_0x8dc0('0xb')};function getTicket(_0x301bc1,_0x49bd04,_0x46452b,_0x1a331d,_0x8ddf1b){logger[_0x8dc0('0xc')](_0x8dc0('0xd'));return request({'uri':util['format'](_0x8dc0('0xe'),_0x301bc1[_0x8dc0('0xf')]),'method':_0x8dc0('0x10'),'body':{'ticket':_['merge']({'requester_id':_0x46452b['id'],'submitter_id':_0x49bd04?_0x49bd04['id']:undefined,'assignee_id':_0x49bd04?_0x49bd04['id']:undefined,'tags':getTags(_0x1a331d[_0x8dc0('0x11')],_0x8dc0('0x12')),'subject':intUtil[_0x8dc0('0x13')](_0x1a331d[_0x8dc0('0x14')],_0x8ddf1b,'\x20'),'description':intUtil[_0x8dc0('0x13')](_0x1a331d[_0x8dc0('0x15')],_0x8ddf1b,'\x0a'),'comment':{'public':![],'body':intUtil[_0x8dc0('0x13')](_0x1a331d['Descriptions'],_0x8ddf1b,'\x0a')}},getCustomFields(_0x1a331d[_0x8dc0('0x16')],_0x8ddf1b))}})['then'](function(_0x37c98e){logger[_0x8dc0('0xc')](_0x8dc0('0x17'));return _0x37c98e['ticket'];});}function getUser(_0x37671c,_0x2d3c04){if(intUtil['validateEmail'](_0x2d3c04)){logger[_0x8dc0('0xc')](_0x8dc0('0x18'),_0x2d3c04);return request({'uri':util['format'](_0x8dc0('0x19'),_0x37671c[_0x8dc0('0xf')]),'qs':{'query':util[_0x8dc0('0x1a')]('type:user\x20role:agent\x20email:%s',_0x2d3c04)}})[_0x8dc0('0x1b')](function(_0x567306){if(_0x567306[_0x8dc0('0x1c')]){logger['info'](_0x8dc0('0x1d'));return _[_0x8dc0('0x1e')](_0x567306[_0x8dc0('0x1f')],{'email':_0x2d3c04,'role':_0x8dc0('0x20')});}else{logger[_0x8dc0('0xc')](_0x8dc0('0x21'));return request({'uri':util[_0x8dc0('0x1a')](_0x8dc0('0x22'),_0x37671c[_0x8dc0('0xf')])})[_0x8dc0('0x1b')](function(_0x1bb64b){logger[_0x8dc0('0xc')](_0x8dc0('0x23'));return _0x1bb64b[_0x8dc0('0x24')];});}});}else{logger[_0x8dc0('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8dc0('0x1a')](_0x8dc0('0x22'),_0x37671c[_0x8dc0('0xf')])})['then'](function(_0x52be3c){logger['info'](_0x8dc0('0x23'));return _0x52be3c[_0x8dc0('0x24')];});}}function getEndUser(_0x477060,_0x4a5173,_0x537c66){logger[_0x8dc0('0xc')](_0x8dc0('0x25'),_0x537c66);return request({'uri':util['format'](_0x8dc0('0x19'),_0x477060['remoteUri']),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x537c66)}})[_0x8dc0('0x1b')](function(_0x2f0a57){var _0xda4f70;if(_0x2f0a57[_0x8dc0('0x1f')][_0x8dc0('0x26')]){_0x2f0a57[_0x8dc0('0x1f')]=_[_0x8dc0('0x27')](_0x2f0a57['results'],{'suspended':![],'role':_0x8dc0('0x28')});if(_0x2f0a57[_0x8dc0('0x1f')][_0x8dc0('0x26')]){_0xda4f70=_[_0x8dc0('0x29')](_0x2f0a57[_0x8dc0('0x1f')]);}}if(_0xda4f70){logger[_0x8dc0('0xc')](_0x8dc0('0x2a'));return _0xda4f70;}else{logger[_0x8dc0('0xc')](_0x8dc0('0x2b'));return request({'uri':util[_0x8dc0('0x1a')](_0x8dc0('0x2c'),_0x477060[_0x8dc0('0xf')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x8dc0('0x1a')](_0x8dc0('0x2d'),_0x4a5173||_0x537c66),'phone':_0x537c66}}})[_0x8dc0('0x1b')](function(_0x77d470){logger[_0x8dc0('0xc')](_0x8dc0('0x2e'));return _0x77d470[_0x8dc0('0x24')];});}});}function getAuth(_0x3c3372){var _0x1eeef9;if(_0x3c3372[_0x8dc0('0x2f')]===_0x8dc0('0x30')){_0x1eeef9=util[_0x8dc0('0x1a')]('%s:%s',_0x3c3372[_0x8dc0('0x31')],_0x3c3372[_0x8dc0('0x30')]);}else if(_0x3c3372[_0x8dc0('0x2f')]===_0x8dc0('0x32')){_0x1eeef9=util[_0x8dc0('0x1a')](_0x8dc0('0x33'),_0x3c3372[_0x8dc0('0x31')],_0x3c3372[_0x8dc0('0x32')]);}return util['format']('Basic\x20%s',new Buffer(_0x1eeef9)[_0x8dc0('0x34')]('base64'));}function request(_0x290589){logger[_0x8dc0('0x35')]('[HTTP]',JSON[_0x8dc0('0x36')](_0x290589));return rp(_['defaults'](_0x290589,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4d7829,_0x15a25e){var _0x184a8d=[];if(_0x4d7829&&_0x4d7829[_0x8dc0('0x26')]>0x0){_0x184a8d=_[_0x8dc0('0x37')](_0x4d7829,_0x15a25e);}return _0x184a8d;}function getCustomFields(_0x4a7a0d,_0x315412){var _0x42c126=[];var _0xe0b035={'custom_fields':[]};if(_0x4a7a0d[_0x8dc0('0x26')]>0x0){_[_0x8dc0('0x38')](_0x4a7a0d,function(_0x17308a){if(_[_0x8dc0('0x39')](['string','picklist'],_0x17308a[_0x8dc0('0x3a')])&&_0x17308a['nameField']&&!_0x17308a[_0x8dc0('0x3b')]){_0xe0b035[_0x17308a['nameField'][_0x8dc0('0x3c')]()]=_0x17308a['content']['toString']();}else if(_[_0x8dc0('0x39')](['string',_0x8dc0('0x3d')],_0x17308a['type'])&&_0x17308a[_0x8dc0('0x3e')]&&_0x17308a['customField']){_0xe0b035['custom_fields'][_0x8dc0('0x3f')]({'id':_0x17308a[_0x8dc0('0x3e')],'value':_0x17308a[_0x8dc0('0x40')][_0x8dc0('0x34')]()});}else if(_0x17308a[_0x8dc0('0x3a')]===_0x8dc0('0x41')&&_0x17308a[_0x8dc0('0x42')]&&_0x17308a[_0x8dc0('0x3e')]&&_0x17308a[_0x8dc0('0x3b')]){_0x315412[_0x17308a[_0x8dc0('0x42')]]&&_0xe0b035[_0x8dc0('0x43')]['push']({'id':_0x17308a[_0x8dc0('0x3e')],'value':_0x315412[_0x17308a[_0x8dc0('0x42')]][_0x8dc0('0x34')]()});}else if(_0x17308a[_0x8dc0('0x3a')]==='customVariable'&&_0x17308a[_0x8dc0('0x44')]&&_0x17308a['Variable'][_0x8dc0('0x12')]&&_0x17308a['idField']&&_0x17308a[_0x8dc0('0x3b')]){_0x315412[_0x17308a[_0x8dc0('0x44')][_0x8dc0('0x12')][_0x8dc0('0x3c')]()]&&_0xe0b035[_0x8dc0('0x43')][_0x8dc0('0x3f')]({'id':_0x17308a[_0x8dc0('0x3e')],'value':_0x315412[_0x17308a[_0x8dc0('0x44')][_0x8dc0('0x12')][_0x8dc0('0x3c')]()][_0x8dc0('0x34')]()});}});}return _0xe0b035;}exports[_0x8dc0('0x45')]=function(_0xa89e47,_0xe85157,_0x3e8427,_0x172402,_0x3dee6e,_0x38086c){var _0x47f2c7,_0x10f3af;_0x38086c[_0x8dc0('0xf')]=intUtil[_0x8dc0('0x46')](_0x38086c[_0x8dc0('0xf')]);_0x38086c[_0x8dc0('0x47')]=intUtil[_0x8dc0('0x46')](_0x38086c[_0x8dc0('0x47')]);if(_0x3dee6e&&_0x3dee6e[_0x8dc0('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0xe85157['recordingURL']=util[_0x8dc0('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38086c[_0x8dc0('0x47')],_0xe85157[_0x8dc0('0x49')],md5(_0xe85157[_0x8dc0('0x49')]));}else{_0xe85157[_0x8dc0('0x4a')]='';}headers['Authorization']=getAuth(_0x38086c);return getUser(_0x38086c,_0x172402[_0x8dc0('0x4b')])[_0x8dc0('0x1b')](function(_0x3197a8){_0x47f2c7=_0x3197a8;logger[_0x8dc0('0xc')](_0x8dc0('0x4c'),_0x47f2c7['id']);return getEndUser(_0x38086c,_0xe85157[_0x8dc0('0x4d')],_0xe85157[_0x8dc0('0x4e')]);})[_0x8dc0('0x1b')](function(_0x29058e){_0x10f3af=_0x29058e;logger[_0x8dc0('0xc')](_0x8dc0('0x4f'),_0x10f3af['id']);return getTicket(_0x38086c,_0x47f2c7,_0x10f3af,_0x3e8427,_0xe85157);})[_0x8dc0('0x1b')](function(_0x1c164b){if(_0x1c164b){logger[_0x8dc0('0xc')]('The\x20Ticket\x20ID\x20is:',_0x1c164b['id']);switch(_0x38086c[_0x8dc0('0x3a')]){case _0x8dc0('0x50'):logger['info']('[QUEUE]',_0x8dc0('0x51'));return request({'uri':util[_0x8dc0('0x1a')](_0x8dc0('0x52'),_0x38086c[_0x8dc0('0xf')],_0x47f2c7['id'],_0x1c164b['id']),'method':'POST'});case _0x8dc0('0x53'):logger[_0x8dc0('0xc')](_0x8dc0('0x54'),_0x8dc0('0x55'));emit(util[_0x8dc0('0x1a')](_0x8dc0('0x56'),_0x172402[_0x8dc0('0x12')]),_0x8dc0('0x57'),{'uri':util[_0x8dc0('0x1a')](_0x8dc0('0x58'),_0x38086c[_0x8dc0('0xf')][_0x8dc0('0x59')](_0x8dc0('0x5a'),''),_0x1c164b['id'])});break;default:logger[_0x8dc0('0x5b')](_0x8dc0('0x54'),_0x8dc0('0x5c'));}}})[_0x8dc0('0x5d')](function(_0x5859f8){logger[_0x8dc0('0x5b')](_0x8dc0('0x5e'),util['inspect'](_0x5859f8,{'showHidden':!![],'depth':null}));});};exports[_0x8dc0('0x5f')]=function(_0x227402,_0x379637,_0x24dd2e,_0x4dd885,_0x1ec38f,_0x3f3da7,_0x279df0){var _0xa0b21c,_0xb117ba;_0x3f3da7[_0x8dc0('0xf')]=intUtil['stripTrailingSlash'](_0x3f3da7[_0x8dc0('0xf')]);_0x3f3da7['serverUrl']=intUtil[_0x8dc0('0x46')](_0x3f3da7[_0x8dc0('0x47')]);if(_0x279df0&&_0x279df0[_0x8dc0('0x60')]&&_0x279df0[_0x8dc0('0x60')]!==_0x8dc0('0x61')){logger[_0x8dc0('0xc')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x379637['recordingURL']=util[_0x8dc0('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3f3da7[_0x8dc0('0x47')],_0x379637[_0x8dc0('0x49')],md5(_0x379637['uniqueid']));}headers[_0x8dc0('0x62')]=getAuth(_0x3f3da7);return getUser(_0x3f3da7,_0x4dd885[_0x8dc0('0x4b')])[_0x8dc0('0x1b')](function(_0x4a0c43){_0xa0b21c=_0x4a0c43;logger['info'](_0x8dc0('0x4c'),_0xa0b21c['id']);return getEndUser(_0x3f3da7,_0x379637[_0x8dc0('0x63')],_0x379637[_0x8dc0('0x64')]);})[_0x8dc0('0x1b')](function(_0x35e4ed){_0xb117ba=_0x35e4ed;logger['info'](_0x8dc0('0x4f'),_0xb117ba['id']);return getTicket(_0x3f3da7,_0xa0b21c,_0xb117ba,_0x24dd2e,_0x379637);})['then'](function(_0x300206){if(_0x300206){logger[_0x8dc0('0xc')](_0x8dc0('0x65'),_0x300206['id']);switch(_0x3f3da7[_0x8dc0('0x3a')]){case'integrationTab':logger['info'](_0x8dc0('0x66'),_0x8dc0('0x51'));return request({'uri':util[_0x8dc0('0x1a')](_0x8dc0('0x52'),_0x3f3da7[_0x8dc0('0xf')],_0xa0b21c['id'],_0x300206['id']),'method':_0x8dc0('0x10')});case _0x8dc0('0x53'):logger[_0x8dc0('0xc')]('[OUTBOUND]',_0x8dc0('0x55'));emit(util[_0x8dc0('0x1a')](_0x8dc0('0x56'),_0x4dd885[_0x8dc0('0x12')]),'trigger:browser:url',{'uri':util[_0x8dc0('0x1a')](_0x8dc0('0x58'),_0x3f3da7['remoteUri'][_0x8dc0('0x59')](_0x8dc0('0x5a'),''),_0x300206['id'])});break;default:logger[_0x8dc0('0x5b')](_0x8dc0('0x66'),_0x8dc0('0x5c'));}}})[_0x8dc0('0x5d')](function(_0x496fca){logger[_0x8dc0('0x5b')](_0x8dc0('0x67'),util[_0x8dc0('0x68')](_0x496fca,{'showHidden':!![],'depth':null}));});};exports[_0x8dc0('0x69')]=function(_0xac317d,_0x4da0cd,_0x8e79a8,_0x40cdf4,_0xd2780d,_0x19782e){var _0x49ff2e,_0x12c5bb;_0x19782e[_0x8dc0('0xf')]=intUtil[_0x8dc0('0x46')](_0x19782e[_0x8dc0('0xf')]);_0x19782e[_0x8dc0('0x47')]=intUtil[_0x8dc0('0x46')](_0x19782e[_0x8dc0('0x47')]);if(_0xd2780d&&_0xd2780d['monitor_format']){logger[_0x8dc0('0xc')]('['+_0x4da0cd[_0x8dc0('0x6a')][_0x8dc0('0x6b')]()+']','Recording\x20is\x20enabled!');_0x4da0cd[_0x8dc0('0x4a')]=util['format'](_0x8dc0('0x6c'),_0x19782e['serverUrl'],_0x4da0cd[_0x8dc0('0x49')],md5(_0x4da0cd['uniqueid']));}else{_0x4da0cd['recordingURL']='';}headers[_0x8dc0('0x62')]=getAuth(_0x19782e);return getUser(_0x19782e)[_0x8dc0('0x1b')](function(_0x56d806){_0x49ff2e=_0x56d806;logger[_0x8dc0('0xc')](_0x8dc0('0x4c'),_0x49ff2e['id']);return getEndUser(_0x19782e,_0x4da0cd['calleridname'],_0x4da0cd['calleridnum']);})[_0x8dc0('0x1b')](function(_0x3bd1d9){_0x12c5bb=_0x3bd1d9;logger[_0x8dc0('0xc')](_0x8dc0('0x4f'),_0x12c5bb['id']);return getTicket(_0x19782e,_0x49ff2e,_0x12c5bb,_0x8e79a8,_0x4da0cd);})['then'](function(_0x576833){if(_0x576833){logger[_0x8dc0('0xc')](_0x8dc0('0x65'),_0x576833['id']);}})[_0x8dc0('0x5d')](function(_0x5a1840){logger[_0x8dc0('0x5b')]('['+_0x4da0cd[_0x8dc0('0x6a')][_0x8dc0('0x6b')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x8dc0('0x68')](_0x5a1840,{'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 205e90f..65acc98 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 _0xf4eb=['code','SUCCESS','details','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Owner','Subject','Subjects','getString','Who_Id','Full_Name','Last_Name','What_Id','First_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','complete','connect','Answered','rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','com','destcalleridname','destcalleridnum','Outbound','unmanaged','monitor_format','toUpperCase','calleridname','lodash','moment','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','length','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','refresh_token','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','isArrayLikeObject','findIndex','Using\x20the\x20admin\x20account!','profile','Administrator','users','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data'];(function(_0xbc9fcf,_0x39b48e){var _0x2b4d87=function(_0x4fe924){while(--_0x4fe924){_0xbc9fcf['push'](_0xbc9fcf['shift']());}};_0x2b4d87(++_0x39b48e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x827d80,_0x43b6ce){_0x827d80=_0x827d80-0x0;var _0x476f33=_0xf4eb[_0x827d80];return _0x476f33;};'use strict';var _=require(_0xbf4e('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var intUtil=require('./util');var moment=require(_0xbf4e('0x1'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0xbf4e('0x2'));var logger=require(_0xbf4e('0x3'))(_0xbf4e('0x4'));config[_0xbf4e('0x5')]=_[_0xbf4e('0x6')](config[_0xbf4e('0x5')],{'host':_0xbf4e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbf4e('0x5')]));function emit(_0x5013c2,_0x5e23d4,_0xa4280c){io['to'](_0x5013c2)[_0xbf4e('0x8')](_0x5e23d4,_0xa4280c);}function request(_0xcc4097){logger[_0xbf4e('0x9')](_0xbf4e('0xa'),JSON[_0xbf4e('0xb')](_0xcc4097));return rp(_0xcc4097);}function getCustomFields(_0x177342,_0x580a26){var _0x4d9a07={};if(_0x177342[_0xbf4e('0xc')]>0x0){_['forEach'](_0x177342,function(_0x448788){if(_[_0xbf4e('0xd')](['string',_0xbf4e('0xe')],_0x448788['type'])&&_0x448788['idField']){_0x4d9a07[_0x448788[_0xbf4e('0xf')]]=_0x448788[_0xbf4e('0x10')][_0xbf4e('0x11')]();}else if(_0x448788[_0xbf4e('0x12')]===_0xbf4e('0x13')&&_0x448788[_0xbf4e('0x14')]&&_0x448788['idField']&&_0x580a26[_0x448788['variableName']]){_0x4d9a07[_0x448788[_0xbf4e('0xf')]]=_0x580a26[_0x448788[_0xbf4e('0x14')]][_0xbf4e('0x11')]();}else if(_0x448788['type']===_0xbf4e('0x15')&&_0x448788[_0xbf4e('0x16')]&&_0x448788[_0xbf4e('0x16')][_0xbf4e('0x17')]&&_0x448788['idField']&&_0x580a26[_0x448788[_0xbf4e('0x16')]['name']['toLowerCase']()]){_0x4d9a07[_0x448788['idField']]=_0x580a26[_0x448788['Variable'][_0xbf4e('0x17')][_0xbf4e('0x18')]()][_0xbf4e('0x11')]();}});}return _0x4d9a07;}function getName(_0x4d9c2a){if(_0x4d9c2a['indexOf']('\x20')>0x0){var _0x3d1aa7=_0x4d9c2a[_0xbf4e('0x19')](/ (.+)/);if(_0x3d1aa7[0x1]){return _0x3d1aa7;}}return[_0x4d9c2a,_0x4d9c2a];}var accountsTokens={};function getAccessToken(_0x3be138){return new Promise(function(_0x3a875b,_0x344727){if(!_[_0xbf4e('0x1a')](accountsTokens[_0x3be138['id']])&&!_[_0xbf4e('0x1a')](accountsTokens[_0x3be138['id']][_0xbf4e('0x1b')])){if(moment()[_0xbf4e('0x1c')](accountsTokens[_0x3be138['id']][_0xbf4e('0x1d')])){_0x3a875b(accountsTokens[_0x3be138['id']][_0xbf4e('0x1b')]);}}var _0x59bd84;switch(_0x3be138[_0xbf4e('0x1e')]){case'US':_0x59bd84=_0xbf4e('0x1f');break;case'AU':_0x59bd84='https://accounts.zoho.com.au';break;case'EU':_0x59bd84=_0xbf4e('0x20');break;case'IN':_0x59bd84=_0xbf4e('0x21');break;case'CN':_0x59bd84=_0xbf4e('0x22');break;default:_0x59bd84=_0xbf4e('0x20');break;}var _0x3a5d72={'method':'POST','uri':_0x59bd84+_0xbf4e('0x23'),'qs':{'refresh_token':_0x3be138[_0xbf4e('0x24')],'client_id':_0x3be138[_0xbf4e('0x25')],'client_secret':_0x3be138['clientSecret'],'grant_type':_0xbf4e('0x26')},'json':!![]};return rp(_0x3a5d72)['then'](function(_0x5bcf71){accountsTokens[_0x3be138['id']]={'access_token':_0x5bcf71[_0xbf4e('0x1b')],'expires_in':moment()['add'](_0x5bcf71[_0xbf4e('0x1d')],_0xbf4e('0x27'))};_0x3a875b(_0x5bcf71[_0xbf4e('0x1b')]);})[_0xbf4e('0x28')](function(_0x5c912f){logger[_0xbf4e('0x29')](_0xbf4e('0x2a'),_0x5c912f[_0xbf4e('0x2b')]);_0x344727(_0x5c912f);});});}function getUser(_0x4cd4a1,_0x681c3b,_0x590c85,_0x1dfa81){logger[_0xbf4e('0x2c')](_0xbf4e('0x2d'));return request({'method':'GET','uri':util[_0xbf4e('0x2e')](_0xbf4e('0x2f'),_0x681c3b),'qs':{'type':_0xbf4e('0x30')},'headers':{'Authorization':_0xbf4e('0x31')+_0x4cd4a1},'json':!![]})[_0xbf4e('0x32')](function(_0x3b5776){if(_0x3b5776['users']){var _0x35c82d=-0x1;if(_[_0xbf4e('0x33')](_0x3b5776['users'])){if(!_[_0xbf4e('0x1a')](_0x1dfa81)){_0x35c82d=_[_0xbf4e('0x34')](_0x3b5776['users'],function(_0x23d769){return _0x23d769['email']===_0x1dfa81;});}if(_0x35c82d>=0x0){logger[_0xbf4e('0x2c')]('Agent\x20found!');}else{logger[_0xbf4e('0x2c')](_0xbf4e('0x35'));_0x35c82d=_[_0xbf4e('0x34')](_0x3b5776['users'],function(_0x2716b7){return _0x2716b7[_0xbf4e('0x36')][_0xbf4e('0x17')]===_0xbf4e('0x37');});}return _0x3b5776[_0xbf4e('0x38')][_0x35c82d];}else{if(_0x3b5776[_0xbf4e('0x39')]['profile'][_0xbf4e('0x17')]===_0xbf4e('0x37')){logger[_0xbf4e('0x2c')](_0xbf4e('0x35'));user=_0x3b5776[_0xbf4e('0x39')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x3b5776));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xbf4e('0xb')](_0x3b5776));}}}else{logger[_0xbf4e('0x29')](_0xbf4e('0x3a'),JSON[_0xbf4e('0xb')](_0x3b5776));throw new Error(_0xbf4e('0x3b')+JSON[_0xbf4e('0xb')](_0x3b5776));}})[_0xbf4e('0x28')](function(_0x467b74){console[_0xbf4e('0x29')](_0x467b74);});}function getZohoUser(_0x54527d,_0x4f6e93){return new BPromise(function(_0x303fd8,_0x2b25d2){request(_0x54527d)[_0xbf4e('0x32')](function(_0x4ae676){var _0x3f46f1=null;if(_0x4ae676){_0x3f46f1=_0x4ae676['data'][0x0];_0x3f46f1[_0xbf4e('0x3c')]=_0x4f6e93;}_0x303fd8(_0x3f46f1);})[_0xbf4e('0x28')](function(_0xd0bcf0){_0x2b25d2(_0xd0bcf0);});});}function createEndUser(_0xb30f90,_0x5ce339,_0x31d8dc,_0x78ab2d,_0x3aa308,_0x3d5123){var _0x31d8dc=getName(_0x31d8dc);return request({'method':_0xbf4e('0x3d'),'uri':_0xbf4e('0x3e')+_0x5ce339+_0xbf4e('0x3f')+_[_0xbf4e('0x40')](_0x3d5123[_0xbf4e('0x41')])+'s','body':{'data':[{'Last_Name':_0x31d8dc[0x1],'First_Name':_0x31d8dc[0x0],'Phone':_0x78ab2d,'Owner':{'name':!_[_0xbf4e('0x1a')](_0x3aa308[_0xbf4e('0x42')]['name'])?_0x3aa308[_0xbf4e('0x42')][_0xbf4e('0x17')]:!_['isNil'](_0x3aa308['first_name'])?_0x3aa308[_0xbf4e('0x43')]+'\x20'+_0x3aa308[_0xbf4e('0x44')]:_0x3aa308['last_name'],'id':_0x3aa308['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xb30f90},'json':!![]})[_0xbf4e('0x32')](function(_0x150224){if(_0x150224&&_0x150224[_0xbf4e('0x45')][0x0][_0xbf4e('0x46')]===_0xbf4e('0x47')){var _0x3ad0a4=_0x150224['data'][0x0][_0xbf4e('0x48')];_0x3ad0a4[_0xbf4e('0x3c')]=_['startCase'](_0x3d5123['moduleCreate'])+'s';return _0x3ad0a4;}logger['error']('The\x20failing\x20result\x20is',JSON[_0xbf4e('0xb')](data));throw new Error('Error:\x20'+JSON[_0xbf4e('0xb')](data));})[_0xbf4e('0x28')](function(_0x527bfb){console['log'](_0xbf4e('0x49'),_0x527bfb);});}function getEndUser(_0x2a3fe2,_0x46967c,_0x40c147,_0x8ab634,_0x52cf6a,_0x2b20d3,_0x3e8ade){var _0xd3a88a={'method':_0xbf4e('0x4a'),'uri':'','headers':{'Authorization':_0xbf4e('0x31')+_0x2a3fe2},'json':!![]};switch(_0x3e8ade[_0xbf4e('0x4b')]){case _0xbf4e('0x4c'):_0xd3a88a[_0xbf4e('0x4d')]='https://www.zohoapis.'+_0x46967c+_0xbf4e('0x4e')+_0x52cf6a+'))';return getZohoUser(_0xd3a88a,_0xbf4e('0x4f'))[_0xbf4e('0x32')](function(_0x32bed6){if(_0x32bed6)return _0x32bed6;_0xd3a88a[_0xbf4e('0x4d')]=_0xbf4e('0x3e')+_0x46967c+_0xbf4e('0x50')+_0x52cf6a+'))';return getZohoUser(_0xd3a88a,_0xbf4e('0x51'))[_0xbf4e('0x32')](function(_0x3447ab){if(_0x3447ab)return _0x3447ab;if(_0x3e8ade[_0xbf4e('0x41')]!=_0xbf4e('0x52')){return createEndUser(_0x2a3fe2,_0x46967c,_0x8ab634,_0x52cf6a,_0x2b20d3,_0x3e8ade);}else{return{};}});});break;case _0xbf4e('0x53'):_0xd3a88a[_0xbf4e('0x4d')]=_0xbf4e('0x3e')+_0x46967c+_0xbf4e('0x4e')+_0x52cf6a+'))';return getZohoUser(_0xd3a88a,_0xbf4e('0x4f'))['then'](function(_0x22d8ef){if(_0x22d8ef)return _0x22d8ef;if(_0x3e8ade[_0xbf4e('0x41')]!=_0xbf4e('0x52')){return createEndUser(_0x2a3fe2,_0x46967c,_0x8ab634,_0x52cf6a,_0x2b20d3,_0x3e8ade);}else{return{};}});break;case'lead':_0xd3a88a[_0xbf4e('0x4d')]='https://www.zohoapis.'+_0x46967c+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x52cf6a+'))';return getZohoUser(_0xd3a88a,_0xbf4e('0x51'))[_0xbf4e('0x32')](function(_0x4d32b3){if(_0x4d32b3)return _0x4d32b3;if(_0x3e8ade[_0xbf4e('0x41')]!=_0xbf4e('0x52')){return createEndUser(_0x2a3fe2,_0x46967c,_0x8ab634,_0x52cf6a,_0x2b20d3,_0x3e8ade);}else{return{};}});break;}}function getCall(_0x31d779,_0xa7af68,_0x42eef6,_0x2ac2c8,_0x419969,_0x1cdd8c,_0x3cd61b,_0xc058e1){logger[_0xbf4e('0x2c')]('Creating\x20new\x20call...');var _0x5d6324={};_0x5d6324[_0xbf4e('0x54')]={'name':!_[_0xbf4e('0x1a')](_0x2ac2c8[_0xbf4e('0x42')]['name'])&&!_[_0xbf4e('0x1a')](_0x2ac2c8[_0xbf4e('0x36')]['name'])&&_0x2ac2c8['profile'][_0xbf4e('0x17')]==='administrator'?_0x2ac2c8['role'][_0xbf4e('0x17')]:!_[_0xbf4e('0x1a')](_0x2ac2c8[_0xbf4e('0x43')])?_0x2ac2c8[_0xbf4e('0x43')]+'\x20'+_0x2ac2c8[_0xbf4e('0x44')]:_0x2ac2c8['last_name'],'id':_0x2ac2c8['id']};_0x5d6324[_0xbf4e('0x55')]=intUtil['getString'](_0x1cdd8c[_0xbf4e('0x56')],_0x3cd61b,'\x20');_0x5d6324['Description']=intUtil[_0xbf4e('0x57')](_0x1cdd8c['Descriptions'],_0x3cd61b,'\x0a');if(_0x419969[_0xbf4e('0x3c')]===_0xbf4e('0x4f')){_0x5d6324[_0xbf4e('0x58')]={'name':!_[_0xbf4e('0x1a')](_0x419969[_0xbf4e('0x59')])?_0x419969['Full_Name']:!_['isNil'](_0x419969['First_Name'])?_0x419969['First_Name']+'\x20'+_0x419969[_0xbf4e('0x5a')]:_0x419969[_0xbf4e('0x5a')],'id':_0x419969['id']};}if(_0x419969['enduserType']===_0xbf4e('0x51')){_0x5d6324[_0xbf4e('0x5b')]={'name':!_[_0xbf4e('0x1a')](_0x419969[_0xbf4e('0x59')])?_0x419969[_0xbf4e('0x59')]:!_[_0xbf4e('0x1a')](_0x419969[_0xbf4e('0x5c')])?_0x419969['First_Name']+'\x20'+_0x419969[_0xbf4e('0x5a')]:_0x419969[_0xbf4e('0x5a')],'id':_0x419969['id']};_0x5d6324[_0xbf4e('0x5d')]=_['startCase'](_0x419969['enduserType']);}if(_0x3cd61b[_0xbf4e('0x5e')]){_0x5d6324[_0xbf4e('0x5f')]=moment[_0xbf4e('0x60')](parseInt(_0x3cd61b['talktime'])*0x3e8)[_0xbf4e('0x2e')](_0xbf4e('0x61'));}else if(_0x3cd61b[_0xbf4e('0x62')]&&_0x3cd61b[_0xbf4e('0x63')]){_0x5d6324[_0xbf4e('0x5f')]=moment[_0xbf4e('0x60')](moment(_0x3cd61b[_0xbf4e('0x63')],_0xbf4e('0x64'))[_0xbf4e('0x65')](moment(_0x3cd61b[_0xbf4e('0x66')],_0xbf4e('0x64'))))[_0xbf4e('0x2e')]('mm:ss');}switch(_0x3cd61b[_0xbf4e('0x67')]){case'called':_0x5d6324[_0xbf4e('0x68')]=_0xbf4e('0x69');break;case _0xbf4e('0x6a'):case _0xbf4e('0x6b'):_0x5d6324[_0xbf4e('0x68')]=_0xbf4e('0x6c');break;case _0xbf4e('0x6d'):_0x5d6324[_0xbf4e('0x68')]='Rejected';break;case _0xbf4e('0x6e'):_0x5d6324[_0xbf4e('0x68')]=_0xbf4e('0x6f');break;case _0xbf4e('0x70'):_0x5d6324[_0xbf4e('0x68')]='Timeout';default:}_0x5d6324[_0xbf4e('0x71')]=(_0xc058e1===_0xbf4e('0x72')?moment(_0x3cd61b[_0xbf4e('0x66')])[_0xbf4e('0x2e')](_0xbf4e('0x64')):moment(_0x3cd61b[_0xbf4e('0x73')])['format'](_0xbf4e('0x64')))||moment()['format'](_0xbf4e('0x64'));_0x5d6324[_0xbf4e('0x74')]=_0xc058e1||_0xbf4e('0x75');_0x5d6324=_[_0xbf4e('0x76')](_0x5d6324,getCustomFields(_0x1cdd8c['Fields'],_0x3cd61b));return request({'method':_0xbf4e('0x3d'),'uri':'https://www.zohoapis.'+_0xa7af68+'/crm/v2/Calls','headers':{'Authorization':_0xbf4e('0x31')+_0x31d779},'body':{'data':[_0x5d6324]},'json':!![]})[_0xbf4e('0x32')](function(_0x3a00ca){if(_0x3a00ca&&_0x3a00ca['data'][0x0][_0xbf4e('0x46')]===_0xbf4e('0x47')){logger['info'](_0xbf4e('0x77'));return{'id':_0x3a00ca[_0xbf4e('0x45')][0x0][_0xbf4e('0x48')]['id']};}})[_0xbf4e('0x28')](function(_0x260e3a){logger[_0xbf4e('0x2c')](_0xbf4e('0x78'),_0x260e3a[_0xbf4e('0x2b')]);console[_0xbf4e('0x79')]('err',_0x260e3a);});}exports[_0xbf4e('0x7a')]=function(_0x1e77bf,_0x2b2545,_0x11008d,_0x54f450,_0x29a55f,_0x667836){var _0x40e566,_0x25ce0d,_0x3067fb;_0x667836[_0xbf4e('0x7b')]=intUtil[_0xbf4e('0x7c')](_0x667836[_0xbf4e('0x7b')]);_0x667836[_0xbf4e('0x7d')]=intUtil['stripTrailingSlash'](_0x667836[_0xbf4e('0x7d')]);if(_0x29a55f&&_0x29a55f['monitor_format']){logger[_0xbf4e('0x2c')](_0xbf4e('0x7e'),_0xbf4e('0x7f'));_0x2b2545[_0xbf4e('0x80')]=_0x667836[_0xbf4e('0x7d')]+'/api/voice/recordings/'+_0x2b2545[_0xbf4e('0x81')]+_0xbf4e('0x82')+md5(_0x2b2545[_0xbf4e('0x81')]);}else{_0x2b2545['recordingURL']='';}var _0x471028=_0x667836[_0xbf4e('0x7b')]===_0xbf4e('0x83')?'eu':'com';return getAccessToken(_0x667836)[_0xbf4e('0x32')](function(_0x468f43){_0x3067fb=_0x468f43;return getUser(_0x3067fb,_0x471028,_0x667836,_0x54f450[_0xbf4e('0x84')]);})[_0xbf4e('0x32')](function(_0x3defaf){_0x40e566=_0x3defaf;logger['info'](_0xbf4e('0x85'),_0x40e566['id']);return getEndUser(_0x3067fb,_0x471028,_0x667836,_0x2b2545['calleridname'],_0x2b2545[_0xbf4e('0x86')],_0x40e566,_0x11008d);})['then'](function(_0x19a7e9){_0x25ce0d=_0x19a7e9;return getCall(_0x3067fb,_0x471028,_0x667836,_0x40e566,_0x25ce0d,_0x11008d,_0x2b2545,'Inbound');})[_0xbf4e('0x32')](function(_0x52d706){if(_0x52d706){logger[_0xbf4e('0x2c')](_0xbf4e('0x87'),_0x52d706['id']);logger[_0xbf4e('0x2c')](_0xbf4e('0x7e'),_0xbf4e('0x88'));emit(util[_0xbf4e('0x2e')](_0xbf4e('0x89'),_0x54f450['name']),_0xbf4e('0x8a'),{'uri':_0xbf4e('0x8b')+_0x667836[_0xbf4e('0x7b')]+_0xbf4e('0x8c')+_0x52d706['id']});}})[_0xbf4e('0x28')](function(_0x3af0f4){logger['error'](_0xbf4e('0x7e'),JSON[_0xbf4e('0xb')](_0x3af0f4));});};exports['outbound']=function(_0x2e72cb,_0x64ac05,_0x2650d8,_0xb6d122,_0x19ec7e,_0x3c5d85,_0xbc56b7){var _0x1e7b1a,_0x33cb38,_0x5bdc1c;_0x3c5d85[_0xbf4e('0x7b')]=intUtil[_0xbf4e('0x7c')](_0x3c5d85[_0xbf4e('0x7b')]);_0x3c5d85['serverUrl']=intUtil[_0xbf4e('0x7c')](_0x3c5d85[_0xbf4e('0x7d')]);if(_0xbc56b7&&_0xbc56b7['recordingFormat']&&_0xbc56b7[_0xbf4e('0x8d')]!==_0xbf4e('0x8e')){logger[_0xbf4e('0x2c')](_0xbf4e('0x8f'),_0xbf4e('0x7f'));_0x64ac05[_0xbf4e('0x80')]=_0x3c5d85[_0xbf4e('0x7d')]+_0xbf4e('0x90')+_0x64ac05[_0xbf4e('0x81')]+_0xbf4e('0x82')+md5(_0x64ac05['uniqueid']);}var _0x57ca27=_0x3c5d85[_0xbf4e('0x7b')]===_0xbf4e('0x83')?'eu':_0xbf4e('0x91');return getAccessToken(_0x3c5d85)[_0xbf4e('0x32')](function(_0x49bd50){_0x5bdc1c=_0x49bd50;return getUser(_0x5bdc1c,_0x57ca27,_0x3c5d85,_0xb6d122[_0xbf4e('0x84')]);})[_0xbf4e('0x32')](function(_0x299af9){_0x1e7b1a=_0x299af9;logger[_0xbf4e('0x2c')](_0xbf4e('0x85'),_0x1e7b1a['id']);return getEndUser(_0x5bdc1c,_0x57ca27,_0x3c5d85,_0x64ac05[_0xbf4e('0x92')],_0x64ac05[_0xbf4e('0x93')],_0x1e7b1a,_0x2650d8);})['then'](function(_0x34b766){_0x33cb38=_0x34b766;return getCall(_0x5bdc1c,_0x57ca27,_0x3c5d85,_0x1e7b1a,_0x33cb38,_0x2650d8,_0x64ac05,_0xbf4e('0x94'));})[_0xbf4e('0x32')](function(_0x1fc4da){if(_0x1fc4da){logger[_0xbf4e('0x2c')](_0xbf4e('0x87'),_0x1fc4da['id']);logger['info'](_0xbf4e('0x8f'),_0xbf4e('0x88'));emit(util[_0xbf4e('0x2e')](_0xbf4e('0x89'),_0xb6d122[_0xbf4e('0x17')]),_0xbf4e('0x8a'),{'uri':_0xbf4e('0x8b')+_0x3c5d85['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x1fc4da['id']});}})[_0xbf4e('0x28')](function(_0x471235){logger[_0xbf4e('0x29')](_0xbf4e('0x8f'),JSON[_0xbf4e('0xb')](_0x471235));});};exports[_0xbf4e('0x95')]=function(_0x38e3ee,_0x49b1e8,_0xb4f4a3,_0x3ade16,_0x2c9be5,_0x54ee1a){var _0x4ed161,_0x10a4b6,_0x3dcef2;_0x54ee1a[_0xbf4e('0x7b')]=intUtil['stripTrailingSlash'](_0x54ee1a[_0xbf4e('0x7b')]);_0x54ee1a[_0xbf4e('0x7d')]=intUtil[_0xbf4e('0x7c')](_0x54ee1a['serverUrl']);if(_0x2c9be5&&_0x2c9be5[_0xbf4e('0x96')]){logger[_0xbf4e('0x2c')]('['+_0x49b1e8[_0xbf4e('0x67')][_0xbf4e('0x97')]()+']',_0xbf4e('0x7f'));_0x49b1e8[_0xbf4e('0x80')]=_0x54ee1a[_0xbf4e('0x7d')]+_0xbf4e('0x90')+_0x49b1e8[_0xbf4e('0x81')]+_0xbf4e('0x82')+md5(_0x49b1e8[_0xbf4e('0x81')]);}else{_0x49b1e8['recordingURL']='';}var _0x30fe07=_0x54ee1a['host']===_0xbf4e('0x83')?'eu':_0xbf4e('0x91');return getAccessToken(_0x54ee1a)[_0xbf4e('0x32')](function(_0x28bbd6){_0x3dcef2=_0x28bbd6;return getUser(_0x3dcef2,_0x30fe07,_0x54ee1a);})['then'](function(_0x84239d){_0x4ed161=_0x84239d;logger[_0xbf4e('0x2c')]('The\x20User\x20ID\x20is:',_0x4ed161['id']);return getEndUser(_0x3dcef2,_0x30fe07,_0x54ee1a,_0x49b1e8[_0xbf4e('0x98')],_0x49b1e8[_0xbf4e('0x86')],_0x4ed161,_0xb4f4a3);})[_0xbf4e('0x32')](function(_0x25b29c){_0x10a4b6=_0x25b29c;return getCall(_0x3dcef2,_0x30fe07,_0x54ee1a,_0x4ed161,_0x10a4b6,_0xb4f4a3,_0x49b1e8,_0xbf4e('0x75'));})[_0xbf4e('0x32')](function(_0x197fdf){if(_0x197fdf){logger[_0xbf4e('0x2c')](_0xbf4e('0x87'),_0x197fdf['id']);}})['catch'](function(_0x426445){logger[_0xbf4e('0x29')]('['+_0x49b1e8['lastevent'][_0xbf4e('0x97')]()+']',JSON[_0xbf4e('0xb')](_0x426445));});}; \ No newline at end of file +var _0xeffd=['refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','findIndex','users','Agent\x20found!','Using\x20the\x20admin\x20account!','user','profile','Administrator','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','enduserType','POST','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','GET','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','nothing','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','Description','getString','Full_Name','First_Name','Last_Name','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','format','lastevent','Call_Result','Called','connect','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','email','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','zoho.eu','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lodash','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','stringify','length','forEach','includes','picklist','type','idField','variable','variableName','toString','customVariable','Variable','toLowerCase','name','indexOf','split','isNil','isBefore','expires_in','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret'];(function(_0x1c40b1,_0x196db1){var _0x165dc2=function(_0x53e16f){while(--_0x53e16f){_0x1c40b1['push'](_0x1c40b1['shift']());}};_0x165dc2(++_0x196db1);}(_0xeffd,0x6b));var _0xdeff=function(_0x3aab2b,_0x3f0a17){_0x3aab2b=_0x3aab2b-0x0;var _0x3a9159=_0xeffd[_0x3aab2b];return _0x3a9159;};'use strict';var _=require(_0xdeff('0x0'));var rp=require('request-promise');var md5=require(_0xdeff('0x1'));var util=require(_0xdeff('0x2'));var intUtil=require(_0xdeff('0x3'));var moment=require(_0xdeff('0x4'));var Redis=require(_0xdeff('0x5'));var BPromise=require(_0xdeff('0x6'));var config=require(_0xdeff('0x7'));var logger=require(_0xdeff('0x8'))(_0xdeff('0x9'));config[_0xdeff('0xa')]=_[_0xdeff('0xb')](config[_0xdeff('0xa')],{'host':_0xdeff('0xc'),'port':0x18eb});var io=require(_0xdeff('0xd'))(new Redis(config[_0xdeff('0xa')]));function emit(_0x12e953,_0x24897a,_0x540ae6){io['to'](_0x12e953)[_0xdeff('0xe')](_0x24897a,_0x540ae6);}function request(_0x45a8a6){logger[_0xdeff('0xf')]('[HTTP]',JSON[_0xdeff('0x10')](_0x45a8a6));return rp(_0x45a8a6);}function getCustomFields(_0x4423e9,_0x3c1482){var _0x192195={};if(_0x4423e9[_0xdeff('0x11')]>0x0){_[_0xdeff('0x12')](_0x4423e9,function(_0x2e9783){if(_[_0xdeff('0x13')](['string',_0xdeff('0x14')],_0x2e9783[_0xdeff('0x15')])&&_0x2e9783['idField']){_0x192195[_0x2e9783[_0xdeff('0x16')]]=_0x2e9783['content']['toString']();}else if(_0x2e9783[_0xdeff('0x15')]===_0xdeff('0x17')&&_0x2e9783[_0xdeff('0x18')]&&_0x2e9783[_0xdeff('0x16')]&&_0x3c1482[_0x2e9783['variableName']]){_0x192195[_0x2e9783[_0xdeff('0x16')]]=_0x3c1482[_0x2e9783[_0xdeff('0x18')]][_0xdeff('0x19')]();}else if(_0x2e9783[_0xdeff('0x15')]===_0xdeff('0x1a')&&_0x2e9783[_0xdeff('0x1b')]&&_0x2e9783['Variable']['name']&&_0x2e9783[_0xdeff('0x16')]&&_0x3c1482[_0x2e9783['Variable']['name'][_0xdeff('0x1c')]()]){_0x192195[_0x2e9783[_0xdeff('0x16')]]=_0x3c1482[_0x2e9783['Variable'][_0xdeff('0x1d')][_0xdeff('0x1c')]()][_0xdeff('0x19')]();}});}return _0x192195;}function getName(_0x3a677a){if(_0x3a677a[_0xdeff('0x1e')]('\x20')>0x0){var _0x299cc5=_0x3a677a[_0xdeff('0x1f')](/ (.+)/);if(_0x299cc5[0x1]){return _0x299cc5;}}return[_0x3a677a,_0x3a677a];}var accountsTokens={};function getAccessToken(_0x919c93){return new Promise(function(_0x488faa,_0x5591fa){if(!_['isNil'](accountsTokens[_0x919c93['id']])&&!_[_0xdeff('0x20')](accountsTokens[_0x919c93['id']]['access_token'])){if(moment()[_0xdeff('0x21')](accountsTokens[_0x919c93['id']][_0xdeff('0x22')])){_0x488faa(accountsTokens[_0x919c93['id']]['access_token']);}}var _0x18338c;switch(_0x919c93[_0xdeff('0x23')]){case'US':_0x18338c='https://accounts.zoho.com';break;case'AU':_0x18338c='https://accounts.zoho.com.au';break;case'EU':_0x18338c=_0xdeff('0x24');break;case'IN':_0x18338c=_0xdeff('0x25');break;case'CN':_0x18338c=_0xdeff('0x26');break;default:_0x18338c=_0xdeff('0x24');break;}var _0x32add9={'method':'POST','uri':_0x18338c+_0xdeff('0x27'),'qs':{'refresh_token':_0x919c93[_0xdeff('0x28')],'client_id':_0x919c93[_0xdeff('0x29')],'client_secret':_0x919c93[_0xdeff('0x2a')],'grant_type':_0xdeff('0x2b')},'json':!![]};return rp(_0x32add9)[_0xdeff('0x2c')](function(_0x3d0111){accountsTokens[_0x919c93['id']]={'access_token':_0x3d0111['access_token'],'expires_in':moment()[_0xdeff('0x2d')](_0x3d0111[_0xdeff('0x22')],'seconds')};_0x488faa(_0x3d0111['access_token']);})[_0xdeff('0x2e')](function(_0x2ea8e9){logger[_0xdeff('0x2f')](_0xdeff('0x30'),_0x2ea8e9[_0xdeff('0x31')]);_0x5591fa(_0x2ea8e9);});});}function getUser(_0xf9b278,_0xbc75ee,_0x4e0ff2,_0x331ddc){logger[_0xdeff('0x32')](_0xdeff('0x33'));return request({'method':'GET','uri':util['format'](_0xdeff('0x34'),_0xbc75ee),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xdeff('0x35')+_0xf9b278},'json':!![]})[_0xdeff('0x2c')](function(_0x44a8b3){if(_0x44a8b3['users']){var _0x189a51=-0x1;if(_['isArrayLikeObject'](_0x44a8b3['users'])){if(!_[_0xdeff('0x20')](_0x331ddc)){_0x189a51=_[_0xdeff('0x36')](_0x44a8b3[_0xdeff('0x37')],function(_0x240459){return _0x240459['email']===_0x331ddc;});}if(_0x189a51>=0x0){logger[_0xdeff('0x32')](_0xdeff('0x38'));}else{logger[_0xdeff('0x32')](_0xdeff('0x39'));_0x189a51=_[_0xdeff('0x36')](_0x44a8b3[_0xdeff('0x37')],function(_0x321ef0){return _0x321ef0['profile'][_0xdeff('0x1d')]==='Administrator';});}return _0x44a8b3[_0xdeff('0x37')][_0x189a51];}else{if(_0x44a8b3[_0xdeff('0x3a')][_0xdeff('0x3b')][_0xdeff('0x1d')]===_0xdeff('0x3c')){logger[_0xdeff('0x32')]('Using\x20the\x20admin\x20account!');user=_0x44a8b3[_0xdeff('0x3a')];return user;}else{logger[_0xdeff('0x2f')]('The\x20failing\x20result\x20is',JSON[_0xdeff('0x10')](_0x44a8b3));throw new Error(_0xdeff('0x3d')+JSON[_0xdeff('0x10')](_0x44a8b3));}}}else{logger[_0xdeff('0x2f')](_0xdeff('0x3e'),JSON[_0xdeff('0x10')](_0x44a8b3));throw new Error(_0xdeff('0x3d')+JSON[_0xdeff('0x10')](_0x44a8b3));}})['catch'](function(_0x118752){console['error'](_0x118752);});}function getZohoUser(_0x231893,_0x345032){return new BPromise(function(_0x30f442,_0x5f368d){request(_0x231893)[_0xdeff('0x2c')](function(_0x280a86){var _0x31dd4a=null;if(_0x280a86){_0x31dd4a=_0x280a86[_0xdeff('0x3f')][0x0];_0x31dd4a[_0xdeff('0x40')]=_0x345032;}_0x30f442(_0x31dd4a);})['catch'](function(_0x1c87bd){_0x5f368d(_0x1c87bd);});});}function createEndUser(_0x4d9985,_0x393d75,_0x14f1d0,_0x518280,_0x30609b,_0x13e25e){var _0x14f1d0=getName(_0x14f1d0);return request({'method':_0xdeff('0x41'),'uri':_0xdeff('0x42')+_0x393d75+'/crm/v2/'+_[_0xdeff('0x43')](_0x13e25e[_0xdeff('0x44')])+'s','body':{'data':[{'Last_Name':_0x14f1d0[0x1],'First_Name':_0x14f1d0[0x0],'Phone':_0x518280,'Owner':{'name':!_[_0xdeff('0x20')](_0x30609b[_0xdeff('0x45')][_0xdeff('0x1d')])?_0x30609b['role']['name']:!_[_0xdeff('0x20')](_0x30609b[_0xdeff('0x46')])?_0x30609b[_0xdeff('0x46')]+'\x20'+_0x30609b[_0xdeff('0x47')]:_0x30609b[_0xdeff('0x47')],'id':_0x30609b['id']}}]},'headers':{'Authorization':_0xdeff('0x35')+_0x4d9985},'json':!![]})[_0xdeff('0x2c')](function(_0x4f02f5){if(_0x4f02f5&&_0x4f02f5[_0xdeff('0x3f')][0x0][_0xdeff('0x48')]===_0xdeff('0x49')){var _0x54fa5b=_0x4f02f5[_0xdeff('0x3f')][0x0][_0xdeff('0x4a')];_0x54fa5b[_0xdeff('0x40')]=_[_0xdeff('0x43')](_0x13e25e['moduleCreate'])+'s';return _0x54fa5b;}logger[_0xdeff('0x2f')](_0xdeff('0x3e'),JSON[_0xdeff('0x10')](data));throw new Error(_0xdeff('0x4b')+JSON[_0xdeff('0x10')](data));})[_0xdeff('0x2e')](function(_0x3fe2e4){console[_0xdeff('0x4c')]('CREATE\x20ERROR',_0x3fe2e4);});}function getEndUser(_0x251737,_0x259631,_0xc23310,_0x473d32,_0x21c18a,_0x4d2dd3,_0x25a84f){var _0x15642a={'method':_0xdeff('0x4d'),'uri':'','headers':{'Authorization':_0xdeff('0x35')+_0x251737},'json':!![]};switch(_0x25a84f[_0xdeff('0x4e')]){case'contact_lead':_0x15642a[_0xdeff('0x4f')]='https://www.zohoapis.'+_0x259631+_0xdeff('0x50')+_0x21c18a+'))';return getZohoUser(_0x15642a,_0xdeff('0x51'))[_0xdeff('0x2c')](function(_0x46c428){if(_0x46c428)return _0x46c428;_0x15642a[_0xdeff('0x4f')]=_0xdeff('0x42')+_0x259631+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x21c18a+'))';return getZohoUser(_0x15642a,'Leads')[_0xdeff('0x2c')](function(_0xf91a72){if(_0xf91a72)return _0xf91a72;if(_0x25a84f[_0xdeff('0x44')]!='nothing'){return createEndUser(_0x251737,_0x259631,_0x473d32,_0x21c18a,_0x4d2dd3,_0x25a84f);}else{return{};}});});break;case'contact':_0x15642a[_0xdeff('0x4f')]=_0xdeff('0x42')+_0x259631+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x21c18a+'))';return getZohoUser(_0x15642a,_0xdeff('0x51'))[_0xdeff('0x2c')](function(_0xb84cfa){if(_0xb84cfa)return _0xb84cfa;if(_0x25a84f['moduleCreate']!=_0xdeff('0x52')){return createEndUser(_0x251737,_0x259631,_0x473d32,_0x21c18a,_0x4d2dd3,_0x25a84f);}else{return{};}});break;case _0xdeff('0x53'):_0x15642a[_0xdeff('0x4f')]='https://www.zohoapis.'+_0x259631+_0xdeff('0x54')+_0x21c18a+'))';return getZohoUser(_0x15642a,_0xdeff('0x55'))[_0xdeff('0x2c')](function(_0x23cec3){if(_0x23cec3)return _0x23cec3;if(_0x25a84f[_0xdeff('0x44')]!=_0xdeff('0x52')){return createEndUser(_0x251737,_0x259631,_0x473d32,_0x21c18a,_0x4d2dd3,_0x25a84f);}else{return{};}});break;}}function getCall(_0x2c7fa4,_0x578185,_0x4517d1,_0x1b90a9,_0x5e0c60,_0xe5a773,_0x1b676b,_0x2967b4){logger[_0xdeff('0x32')](_0xdeff('0x56'));var _0xfb097c={};_0xfb097c[_0xdeff('0x57')]={'name':!_[_0xdeff('0x20')](_0x1b90a9['role'][_0xdeff('0x1d')])&&!_[_0xdeff('0x20')](_0x1b90a9[_0xdeff('0x3b')]['name'])&&_0x1b90a9['profile'][_0xdeff('0x1d')]===_0xdeff('0x58')?_0x1b90a9[_0xdeff('0x45')][_0xdeff('0x1d')]:!_[_0xdeff('0x20')](_0x1b90a9[_0xdeff('0x46')])?_0x1b90a9['first_name']+'\x20'+_0x1b90a9['last_name']:_0x1b90a9[_0xdeff('0x47')],'id':_0x1b90a9['id']};_0xfb097c[_0xdeff('0x59')]=intUtil['getString'](_0xe5a773['Subjects'],_0x1b676b,'\x20');_0xfb097c[_0xdeff('0x5a')]=intUtil[_0xdeff('0x5b')](_0xe5a773['Descriptions'],_0x1b676b,'\x0a');if(_0x5e0c60[_0xdeff('0x40')]===_0xdeff('0x51')){_0xfb097c['Who_Id']={'name':!_[_0xdeff('0x20')](_0x5e0c60[_0xdeff('0x5c')])?_0x5e0c60['Full_Name']:!_[_0xdeff('0x20')](_0x5e0c60[_0xdeff('0x5d')])?_0x5e0c60['First_Name']+'\x20'+_0x5e0c60[_0xdeff('0x5e')]:_0x5e0c60[_0xdeff('0x5e')],'id':_0x5e0c60['id']};}if(_0x5e0c60[_0xdeff('0x40')]==='Leads'){_0xfb097c['What_Id']={'name':!_[_0xdeff('0x20')](_0x5e0c60['Full_Name'])?_0x5e0c60[_0xdeff('0x5c')]:!_[_0xdeff('0x20')](_0x5e0c60[_0xdeff('0x5d')])?_0x5e0c60[_0xdeff('0x5d')]+'\x20'+_0x5e0c60[_0xdeff('0x5e')]:_0x5e0c60['Last_Name'],'id':_0x5e0c60['id']};_0xfb097c['$se_module']=_[_0xdeff('0x43')](_0x5e0c60[_0xdeff('0x40')]);}if(_0x1b676b[_0xdeff('0x5f')]){_0xfb097c[_0xdeff('0x60')]=moment[_0xdeff('0x61')](parseInt(_0x1b676b[_0xdeff('0x5f')])*0x3e8)['format'](_0xdeff('0x62'));}else if(_0x1b676b['answertime']&&_0x1b676b[_0xdeff('0x63')]){_0xfb097c[_0xdeff('0x60')]=moment[_0xdeff('0x61')](moment(_0x1b676b[_0xdeff('0x63')],_0xdeff('0x64'))[_0xdeff('0x65')](moment(_0x1b676b[_0xdeff('0x66')],_0xdeff('0x64'))))[_0xdeff('0x67')]('mm:ss');}switch(_0x1b676b[_0xdeff('0x68')]){case'called':_0xfb097c[_0xdeff('0x69')]=_0xdeff('0x6a');break;case'complete':case _0xdeff('0x6b'):_0xfb097c['Call_Result']=_0xdeff('0x6c');break;case'rejected':_0xfb097c['Call_Result']=_0xdeff('0x6d');break;case _0xdeff('0x6e'):_0xfb097c['Call_Result']=_0xdeff('0x6f');break;case _0xdeff('0x70'):_0xfb097c[_0xdeff('0x69')]=_0xdeff('0x71');default:}_0xfb097c[_0xdeff('0x72')]=(_0x2967b4===_0xdeff('0x73')?moment(_0x1b676b[_0xdeff('0x66')])[_0xdeff('0x67')](_0xdeff('0x64')):moment(_0x1b676b['agentcalledAt'])[_0xdeff('0x67')](_0xdeff('0x64')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0xfb097c[_0xdeff('0x74')]=_0x2967b4||_0xdeff('0x75');_0xfb097c=_['merge'](_0xfb097c,getCustomFields(_0xe5a773[_0xdeff('0x76')],_0x1b676b));return request({'method':_0xdeff('0x41'),'uri':_0xdeff('0x42')+_0x578185+_0xdeff('0x77'),'headers':{'Authorization':_0xdeff('0x35')+_0x2c7fa4},'body':{'data':[_0xfb097c]},'json':!![]})[_0xdeff('0x2c')](function(_0xa5f4a0){if(_0xa5f4a0&&_0xa5f4a0[_0xdeff('0x3f')][0x0][_0xdeff('0x48')]===_0xdeff('0x49')){logger['info'](_0xdeff('0x78'));return{'id':_0xa5f4a0[_0xdeff('0x3f')][0x0][_0xdeff('0x4a')]['id']};}})[_0xdeff('0x2e')](function(_0x4539c8){logger['info']('err',_0x4539c8['stack']);console[_0xdeff('0x4c')](_0xdeff('0x79'),_0x4539c8);});}exports[_0xdeff('0x7a')]=function(_0x5e85dc,_0x4ea57d,_0x5c718a,_0x19de80,_0x1a6fbe,_0x46e1d5){var _0x3b67e1,_0x118aa0,_0x19ab0f;_0x46e1d5[_0xdeff('0x7b')]=intUtil[_0xdeff('0x7c')](_0x46e1d5['host']);_0x46e1d5[_0xdeff('0x7d')]=intUtil[_0xdeff('0x7c')](_0x46e1d5[_0xdeff('0x7d')]);if(_0x1a6fbe&&_0x1a6fbe[_0xdeff('0x7e')]){logger[_0xdeff('0x32')](_0xdeff('0x7f'),_0xdeff('0x80'));_0x4ea57d[_0xdeff('0x81')]=_0x46e1d5[_0xdeff('0x7d')]+_0xdeff('0x82')+_0x4ea57d[_0xdeff('0x83')]+_0xdeff('0x84')+md5(_0x4ea57d['uniqueid']);}else{_0x4ea57d[_0xdeff('0x81')]='';}var _0xa46f6c=_0x46e1d5[_0xdeff('0x7b')]==='zoho.eu'?'eu':_0xdeff('0x85');return getAccessToken(_0x46e1d5)[_0xdeff('0x2c')](function(_0x39416){_0x19ab0f=_0x39416;return getUser(_0x19ab0f,_0xa46f6c,_0x46e1d5,_0x19de80[_0xdeff('0x86')]);})['then'](function(_0x2811e5){_0x3b67e1=_0x2811e5;logger[_0xdeff('0x32')]('The\x20User\x20ID\x20is:',_0x3b67e1['id']);return getEndUser(_0x19ab0f,_0xa46f6c,_0x46e1d5,_0x4ea57d[_0xdeff('0x87')],_0x4ea57d[_0xdeff('0x88')],_0x3b67e1,_0x5c718a);})[_0xdeff('0x2c')](function(_0x1cc1d3){_0x118aa0=_0x1cc1d3;return getCall(_0x19ab0f,_0xa46f6c,_0x46e1d5,_0x3b67e1,_0x118aa0,_0x5c718a,_0x4ea57d,_0xdeff('0x75'));})['then'](function(_0x1ee669){if(_0x1ee669){logger[_0xdeff('0x32')](_0xdeff('0x89'),_0x1ee669['id']);logger[_0xdeff('0x32')](_0xdeff('0x7f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdeff('0x67')](_0xdeff('0x8a'),_0x19de80['name']),_0xdeff('0x8b'),{'uri':_0xdeff('0x8c')+_0x46e1d5[_0xdeff('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x1ee669['id']});}})[_0xdeff('0x2e')](function(_0xea0d77){logger['error'](_0xdeff('0x7f'),JSON[_0xdeff('0x10')](_0xea0d77));});};exports[_0xdeff('0x73')]=function(_0x18e96c,_0x4cacbd,_0x39e307,_0x3b8f20,_0x14a77f,_0x184cb2,_0x13bc9f){var _0x69e0f9,_0x7b5b7b,_0x3e3fd4;_0x184cb2[_0xdeff('0x7b')]=intUtil['stripTrailingSlash'](_0x184cb2[_0xdeff('0x7b')]);_0x184cb2['serverUrl']=intUtil[_0xdeff('0x7c')](_0x184cb2['serverUrl']);if(_0x13bc9f&&_0x13bc9f['recordingFormat']&&_0x13bc9f[_0xdeff('0x8d')]!==_0xdeff('0x8e')){logger['info'](_0xdeff('0x8f'),_0xdeff('0x80'));_0x4cacbd[_0xdeff('0x81')]=_0x184cb2[_0xdeff('0x7d')]+'/api/voice/recordings/'+_0x4cacbd[_0xdeff('0x83')]+_0xdeff('0x84')+md5(_0x4cacbd['uniqueid']);}var _0x3dca7f=_0x184cb2[_0xdeff('0x7b')]===_0xdeff('0x90')?'eu':_0xdeff('0x85');return getAccessToken(_0x184cb2)[_0xdeff('0x2c')](function(_0x377733){_0x3e3fd4=_0x377733;return getUser(_0x3e3fd4,_0x3dca7f,_0x184cb2,_0x3b8f20[_0xdeff('0x86')]);})[_0xdeff('0x2c')](function(_0x5ada1e){_0x69e0f9=_0x5ada1e;logger['info'](_0xdeff('0x91'),_0x69e0f9['id']);return getEndUser(_0x3e3fd4,_0x3dca7f,_0x184cb2,_0x4cacbd['destcalleridname'],_0x4cacbd[_0xdeff('0x92')],_0x69e0f9,_0x39e307);})[_0xdeff('0x2c')](function(_0x5e9c02){_0x7b5b7b=_0x5e9c02;return getCall(_0x3e3fd4,_0x3dca7f,_0x184cb2,_0x69e0f9,_0x7b5b7b,_0x39e307,_0x4cacbd,_0xdeff('0x93'));})[_0xdeff('0x2c')](function(_0x232d7e){if(_0x232d7e){logger['info'](_0xdeff('0x89'),_0x232d7e['id']);logger[_0xdeff('0x32')](_0xdeff('0x8f'),_0xdeff('0x94'));emit(util['format'](_0xdeff('0x8a'),_0x3b8f20['name']),_0xdeff('0x8b'),{'uri':'https://crm.'+_0x184cb2[_0xdeff('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x232d7e['id']});}})[_0xdeff('0x2e')](function(_0x27c2ce){logger[_0xdeff('0x2f')]('[OUTBOUND]',JSON[_0xdeff('0x10')](_0x27c2ce));});};exports[_0xdeff('0x95')]=function(_0x202682,_0x5491e2,_0x4be90d,_0x4d301d,_0x292681,_0x385903){var _0x94ad85,_0x676ac1,_0x17e961;_0x385903[_0xdeff('0x7b')]=intUtil['stripTrailingSlash'](_0x385903[_0xdeff('0x7b')]);_0x385903[_0xdeff('0x7d')]=intUtil[_0xdeff('0x7c')](_0x385903['serverUrl']);if(_0x292681&&_0x292681['monitor_format']){logger[_0xdeff('0x32')]('['+_0x5491e2[_0xdeff('0x68')]['toUpperCase']()+']',_0xdeff('0x80'));_0x5491e2[_0xdeff('0x81')]=_0x385903[_0xdeff('0x7d')]+_0xdeff('0x82')+_0x5491e2[_0xdeff('0x83')]+_0xdeff('0x84')+md5(_0x5491e2['uniqueid']);}else{_0x5491e2[_0xdeff('0x81')]='';}var _0x186139=_0x385903[_0xdeff('0x7b')]==='zoho.eu'?'eu':_0xdeff('0x85');return getAccessToken(_0x385903)['then'](function(_0x2a555f){_0x17e961=_0x2a555f;return getUser(_0x17e961,_0x186139,_0x385903);})[_0xdeff('0x2c')](function(_0x51caa7){_0x94ad85=_0x51caa7;logger[_0xdeff('0x32')](_0xdeff('0x91'),_0x94ad85['id']);return getEndUser(_0x17e961,_0x186139,_0x385903,_0x5491e2[_0xdeff('0x87')],_0x5491e2['calleridnum'],_0x94ad85,_0x4be90d);})[_0xdeff('0x2c')](function(_0x1046a6){_0x676ac1=_0x1046a6;return getCall(_0x17e961,_0x186139,_0x385903,_0x94ad85,_0x676ac1,_0x4be90d,_0x5491e2,'Inbound');})[_0xdeff('0x2c')](function(_0x14d2db){if(_0x14d2db){logger[_0xdeff('0x32')](_0xdeff('0x89'),_0x14d2db['id']);}})[_0xdeff('0x2e')](function(_0x265e1b){logger[_0xdeff('0x2f')]('['+_0x5491e2['lastevent']['toUpperCase']()+']',JSON[_0xdeff('0x10')](_0x265e1b));});}; \ 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 3ba3cad..90a8a42 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(_0x1913af,_0xc878e0){var _0x11bad8=function(_0x577f55){while(--_0x577f55){_0x1913af['push'](_0x1913af['shift']());}};_0x11bad8(++_0xc878e0);}(_0x7a54,0x106));var _0x47a5=function(_0x5461cf,_0x17482a){_0x5461cf=_0x5461cf-0x0;var _0x14323c=_0x7a54[_0x5461cf];return _0x14323c;};'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(_0x5f3505,_0x37eeb5){var _0x35a2a9=function(_0x17a526){while(--_0x17a526){_0x5f3505['push'](_0x5f3505['shift']());}};_0x35a2a9(++_0x37eeb5);}(_0x7a54,0x106));var _0x47a5=function(_0x597559,_0x43ea69){_0x597559=_0x597559-0x0;var _0x3e4760=_0x7a54[_0x597559];return _0x3e4760;};'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 efc7ded..d7d6c0c 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 _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x58d461,_0x1bf049){var _0x1b099c=function(_0x226f77){while(--_0x226f77){_0x58d461['push'](_0x58d461['shift']());}};_0x1b099c(++_0x1bf049);}(_0x7a54,0x106));var _0x47a5=function(_0x58d24d,_0x2f9936){_0x58d24d=_0x58d24d-0x0;var _0x1386c5=_0x7a54[_0x58d24d];return _0x1386c5;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x1&&parseInt(_0x5f7f12['data5'])<=0xa?parseInt(_0x5f7f12['data5'])*0x3e8:0x5*0x3e8};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});}; \ No newline at end of file +var _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0xce06a0,_0x1f2883){var _0x1c7647=function(_0x5b977a){while(--_0x5b977a){_0xce06a0['push'](_0xce06a0['shift']());}};_0x1c7647(++_0x1f2883);}(_0x7a54,0x106));var _0x47a5=function(_0x4b7a3b,_0x4ff6ce){_0x4b7a3b=_0x4b7a3b-0x0;var _0x10188d=_0x7a54[_0x4b7a3b];return _0x10188d;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x1&&parseInt(_0x5f7f12['data5'])<=0xa?parseInt(_0x5f7f12['data5'])*0x3e8:0x5*0x3e8};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 8a6095b..eddc096 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 _0xd0bb=['exports','jayson/promise','bluebird','../../config/logger','client','Request','request','then','debug','rpc','error','routing','message','result'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x50fb34,_0x56b847){_0x50fb34=_0x50fb34-0x0;var _0x478797=_0xd0bb[_0x50fb34];return _0x478797;};'use strict';var jayson=require(_0xbd0b('0x0'));var BPromise=require(_0xbd0b('0x1'));var logger=require(_0xbd0b('0x2'))('routing');var client=jayson[_0xbd0b('0x3')]['http']({'port':0x2329});client[_0xbd0b('0x4')]=function(_0x1f6ec3,_0x53e6ce){return new BPromise(function(_0x432acf,_0x508d53){return client[_0xbd0b('0x5')](_0x1f6ec3,_0x53e6ce)[_0xbd0b('0x6')](function(_0x158b5c){logger[_0xbd0b('0x7')](_0xbd0b('0x8'),'routing',_0x1f6ec3,_0x53e6ce,_0x158b5c);if(_0x158b5c[_0xbd0b('0x9')]){logger[_0xbd0b('0x9')](_0xbd0b('0x8'),_0xbd0b('0xa'),_0x1f6ec3,_0x158b5c[_0xbd0b('0x9')]['message'],_0x53e6ce);return _0x508d53(_0x158b5c['error'][_0xbd0b('0xb')]);}else{return _0x432acf(_0x158b5c[_0xbd0b('0xc')]);}})['catch'](function(_0x26b834){logger[_0xbd0b('0x9')]('rpc',_0xbd0b('0xa'),_0x1f6ec3,_0x26b834,_0x53e6ce);return _0x508d53(_0x26b834);});});};module[_0xbd0b('0xd')]=client; \ No newline at end of file +var _0x4f29=['exports','bluebird','../../config/logger','routing','client','http','Request','request','debug','rpc','error','message','result','catch'];(function(_0x275dc3,_0x9ab43){var _0xb57494=function(_0x160841){while(--_0x160841){_0x275dc3['push'](_0x275dc3['shift']());}};_0xb57494(++_0x9ab43);}(_0x4f29,0xfd));var _0x94f2=function(_0x537235,_0x47706b){_0x537235=_0x537235-0x0;var _0x31aa62=_0x4f29[_0x537235];return _0x31aa62;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x94f2('0x0'));var logger=require(_0x94f2('0x1'))(_0x94f2('0x2'));var client=jayson[_0x94f2('0x3')][_0x94f2('0x4')]({'port':0x2329});client[_0x94f2('0x5')]=function(_0x338fe2,_0x2a6535){return new BPromise(function(_0x106798,_0x4edf68){return client[_0x94f2('0x6')](_0x338fe2,_0x2a6535)['then'](function(_0x5e9216){logger[_0x94f2('0x7')](_0x94f2('0x8'),_0x94f2('0x2'),_0x338fe2,_0x2a6535,_0x5e9216);if(_0x5e9216[_0x94f2('0x9')]){logger[_0x94f2('0x9')]('rpc','routing',_0x338fe2,_0x5e9216['error'][_0x94f2('0xa')],_0x2a6535);return _0x4edf68(_0x5e9216['error'][_0x94f2('0xa')]);}else{return _0x106798(_0x5e9216[_0x94f2('0xb')]);}})[_0x94f2('0xc')](function(_0x117396){logger['error'](_0x94f2('0x8'),_0x94f2('0x2'),_0x338fe2,_0x117396,_0x2a6535);return _0x4edf68(_0x117396);});});};module[_0x94f2('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index b19b6c9..32dfee3 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 _0x4df8=['./rpc/setting','resolve','then','getMailAccounts','refresh','listen','getSettings','loginMailFrequency','log','bluebird','./realtime','./lib/email','./rpc/mailAccount'];(function(_0x3e2c1e,_0x1e8d40){var _0x1c6666=function(_0x190b73){while(--_0x190b73){_0x3e2c1e['push'](_0x3e2c1e['shift']());}};_0x1c6666(++_0x1e8d40);}(_0x4df8,0xcc));var _0x84df=function(_0x556231,_0x2cb901){_0x556231=_0x556231-0x0;var _0x22a24a=_0x4df8[_0x556231];return _0x22a24a;};'use strict';var BPromise=require(_0x84df('0x0'));var server=require('./server');var Realtime=require(_0x84df('0x1'));var EmailChannel=require(_0x84df('0x2'));var mailAccount=require(_0x84df('0x3'));var setting=require(_0x84df('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x84df('0x5')]()[_0x84df('0x6')](mailAccount[_0x84df('0x7')]())[_0x84df('0x6')](realtime['initMailAccounts']())[_0x84df('0x6')](function(){email[_0x84df('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x84df('0x9')](realtime,email)[_0x84df('0x6')](function(){return initRealtime();})[_0x84df('0x6')](function(){return setting[_0x84df('0xa')]();})[_0x84df('0x6')](function(_0x4df12b){return setInterval(initRealtime,_0x4df12b[_0x84df('0xb')]*0x3e8);})['catch'](function(_0x2c2141){console[_0x84df('0xc')](_0x2c2141);});}main(); \ No newline at end of file +var _0xe3a2=['loginMailFrequency','catch','bluebird','./server','./realtime','./lib/email','./rpc/setting','then','getMailAccounts','listen','getSettings'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3a2,0x14c));var _0x2e3a=function(_0x137815,_0x78dd4b){_0x137815=_0x137815-0x0;var _0x29ded1=_0xe3a2[_0x137815];return _0x29ded1;};'use strict';var BPromise=require(_0x2e3a('0x0'));var server=require(_0x2e3a('0x1'));var Realtime=require(_0x2e3a('0x2'));var EmailChannel=require(_0x2e3a('0x3'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x2e3a('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x2e3a('0x5')](mailAccount[_0x2e3a('0x6')]())[_0x2e3a('0x5')](realtime['initMailAccounts']())[_0x2e3a('0x5')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x2e3a('0x7')](realtime,email)[_0x2e3a('0x5')](function(){return initRealtime();})['then'](function(){return setting[_0x2e3a('0x8')]();})['then'](function(_0x4c1bf0){return setInterval(initRealtime,_0x4c1bf0[_0x2e3a('0x9')]*0x3e8);})[_0x2e3a('0xa')](function(_0x24ae66){console['log'](_0x24ae66);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 513f888..1c37415 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 _0x422c=['isNil','stringify','mailAccount:update','hasOwnProperty','box','bind','handleImapEmail','end','error','handleImapError','disabled','handleImapBox','status','connected','messages','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','send','verifySmtp','Smtp','verified','lodash','bluebird','md5','ioredis','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total'];(function(_0x19cce8,_0x23a814){var _0x575f93=function(_0x515f8b){while(--_0x515f8b){_0x19cce8['push'](_0x19cce8['shift']());}};_0x575f93(++_0x23a814);}(_0x422c,0x15b));var _0xc422=function(_0x24a370,_0x155519){_0x24a370=_0x24a370-0x0;var _0x3deaa3=_0x422c[_0x24a370];return _0x3deaa3;};'use strict';var _=require(_0xc422('0x0'));var moment=require('moment');var BPromise=require(_0xc422('0x1'));var md5=require(_0xc422('0x2'));var Redis=require(_0xc422('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xc422('0x4'));config[_0xc422('0x5')]=_['defaults'](config[_0xc422('0x5')],{'host':_0xc422('0x6'),'port':0x18eb});var io=require(_0xc422('0x7'))(new Redis(config[_0xc422('0x5')]));var EmailImap=require(_0xc422('0x8'));var EmailSmtp=require(_0xc422('0x9'));var mailAccount=require(_0xc422('0xa'));var md5Accounts={};function EmailChannel(_0x298ddd){logger[_0xc422('0xb')](_0xc422('0xc'));this[_0xc422('0xd')]=_0x298ddd[_0xc422('0xd')];this[_0xc422('0xe')]={};this[_0xc422('0xf')]=new EmailSmtp();}EmailChannel[_0xc422('0x10')][_0xc422('0x11')]=function(_0x8c83c5){var _0x5735f2=this[_0xc422('0xd')][_0x8c83c5];var _0xb2a1a8={'id':_0x5735f2['id'],'name':_0x5735f2[_0xc422('0x12')],'key':_0x5735f2[_0xc422('0x13')],'active':_0x5735f2[_0xc422('0x14')],'Imap':{'status':_0x5735f2[_0xc422('0x15')]['status'],'messageStatus':_0x5735f2[_0xc422('0x15')][_0xc422('0x16')],'total':_0x5735f2[_0xc422('0x15')][_0xc422('0x17')]}};if(_[_0xc422('0x18')](md5Accounts[_0x8c83c5])){md5Accounts[_0x8c83c5]={};}var _0x30fe19=md5(JSON[_0xc422('0x19')](_0xb2a1a8));if(md5Accounts[_0x8c83c5][_0xc422('0x2')]!==_0x30fe19){md5Accounts[_0x8c83c5][_0xc422('0x2')]=_0x30fe19;io[_0xc422('0x11')](_0xc422('0x1a'),_0xb2a1a8);}};EmailChannel[_0xc422('0x10')]['refresh']=function(_0x32cff4){for(var _0x4c755f in _0x32cff4){if(_0x32cff4[_0xc422('0x1b')](_0x4c755f)){if(_0x32cff4[_0x4c755f][_0xc422('0x15')]&&_0x32cff4[_0x4c755f]['active']){var _0x187313=_0x32cff4[_0x4c755f][_0xc422('0x15')];if(!this[_0xc422('0xe')][_0xc422('0x1b')](_0x187313['id'])){this[_0xc422('0xe')][_0x187313['id']]=new EmailImap(_0x187313,_0x32cff4[_0x4c755f][_0xc422('0x4')]);this['imapAccounts'][_0x187313['id']]['on'](_0xc422('0x1c'),this['handleImapBox'][_0xc422('0x1d')](this,_0x4c755f));this['imapAccounts'][_0x187313['id']]['on'](_0xc422('0x4'),this[_0xc422('0x1e')][_0xc422('0x1d')](this,_0x4c755f));this['imapAccounts'][_0x187313['id']]['on'](_0xc422('0x1f'),this['handleImapEnd'][_0xc422('0x1d')](this,_0x4c755f));this[_0xc422('0xe')][_0x187313['id']]['on'](_0xc422('0x20'),this[_0xc422('0x21')][_0xc422('0x1d')](this,_0x4c755f));}}else{if(_[_0xc422('0x18')](this[_0xc422('0xd')][_0x4c755f][_0xc422('0x15')])){this[_0xc422('0xd')][_0x4c755f][_0xc422('0x15')]={};}this[_0xc422('0xd')][_0x4c755f]['Imap']['status']=_0xc422('0x22');this[_0xc422('0xd')][_0x4c755f]['Imap']['messageStatus']='';this[_0xc422('0x11')](_0x4c755f);}}}};EmailChannel['prototype'][_0xc422('0x23')]=function(_0x1f7a18,_0x44f464){if(this['mailAccounts'][_0x1f7a18]){this[_0xc422('0xd')][_0x1f7a18][_0xc422('0x15')][_0xc422('0x24')]=_0xc422('0x25');this[_0xc422('0xd')][_0x1f7a18]['Imap'][_0xc422('0x16')]=_0x44f464[_0xc422('0x12')];if(_0x44f464[_0xc422('0x26')]){this['mailAccounts'][_0x1f7a18][_0xc422('0x15')][_0xc422('0x17')]=_0x44f464['messages'][_0xc422('0x17')];}return this[_0xc422('0x11')](_0x1f7a18);}};EmailChannel[_0xc422('0x10')][_0xc422('0x1e')]=function(_0x241cf3,_0x3d2ca3){logger[_0xc422('0xb')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3d2ca3[_0xc422('0x27')],_0x3d2ca3[_0xc422('0x28')],_0x3d2ca3[_0xc422('0x29')],_0x241cf3);if(this[_0xc422('0xd')][_0x241cf3]){return mailAccount['notify'](_0x241cf3,_0x3d2ca3)[_0xc422('0x2a')](function(_0x3da661){if(_0x3da661){logger[_0xc422('0xb')](_0xc422('0x2b'));}})[_0xc422('0x2c')](function(_0x57dfc2){logger[_0xc422('0x20')](_0xc422('0x2d'),JSON[_0xc422('0x19')](_0x57dfc2));});}};EmailChannel[_0xc422('0x10')][_0xc422('0x2e')]=function(_0x4f1046){if(this[_0xc422('0xd')][_0x4f1046]&&this[_0xc422('0xd')][_0x4f1046][_0xc422('0x15')]){if(this[_0xc422('0xe')][this[_0xc422('0xd')][_0x4f1046][_0xc422('0x15')]['id']]){delete this['imapAccounts'][this[_0xc422('0xd')][_0x4f1046][_0xc422('0x15')]['id']];}this['mailAccounts'][_0x4f1046][_0xc422('0x15')][_0xc422('0x2f')]=moment();this['emit'](_0x4f1046);}};EmailChannel[_0xc422('0x10')][_0xc422('0x21')]=function(_0x147a66,_0x4a6ef0){if(this[_0xc422('0xd')][_0x147a66]){this[_0xc422('0xd')][_0x147a66][_0xc422('0x15')]['status']='error';this[_0xc422('0xd')][_0x147a66][_0xc422('0x15')][_0xc422('0x16')]=_0x4a6ef0;return this['emit'](_0x147a66);}};EmailChannel[_0xc422('0x10')][_0xc422('0x30')]=function(_0x1e9d19,_0x2f94ac){return this[_0xc422('0xf')][_0xc422('0x31')](_0x1e9d19,_0x2f94ac);};EmailChannel['prototype'][_0xc422('0x32')]=function(_0x2494f0){var _0x1a5192=this;if(this[_0xc422('0xd')][_0x2494f0['id']]){if(_[_0xc422('0x18')](this[_0xc422('0xd')][_0x2494f0['id']][_0xc422('0x33')])){this[_0xc422('0xd')][_0x2494f0['id']][_0xc422('0x33')]={};}this[_0xc422('0xd')][_0x2494f0['id']][_0xc422('0x33')][_0xc422('0x2f')]=moment();return new BPromise(function(_0x23b89e,_0x5eaafc){return _0x1a5192['smtp']['verify'](_0x2494f0)[_0xc422('0x2a')](function(_0x5be76f){_0x1a5192[_0xc422('0xd')][_0x2494f0['id']]['Smtp']['status']=_0xc422('0x34');_0x1a5192[_0xc422('0xd')][_0x2494f0['id']][_0xc422('0x33')][_0xc422('0x16')]='';_0x1a5192[_0xc422('0x11')](_0x2494f0['id']);_0x23b89e(_0x5be76f);})['catch'](function(_0x1b18a6){_0x1a5192[_0xc422('0xd')][_0x2494f0['id']]['Smtp'][_0xc422('0x24')]='error';_0x1a5192[_0xc422('0xd')][_0x2494f0['id']][_0xc422('0x33')][_0xc422('0x16')]=_0x1b18a6;_0x1a5192[_0xc422('0x11')](_0x2494f0['id']);_0x5eaafc(_0x1b18a6);});});}return this[_0xc422('0xf')]['verify'](_0x2494f0);};module['exports']=EmailChannel; \ No newline at end of file +var _0x4018=['then','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','ioredis','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','status','Imap','messageStatus','total','isNil','stringify','md5','refresh','hasOwnProperty','box','handleImapBox','bind','end','handleImapEnd','handleImapError','connected','messages','handleImapEmail','firstName','from','notify'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x4018,0x186));var _0x8401=function(_0x58af75,_0x1a6a22){_0x58af75=_0x58af75-0x0;var _0x32a5ad=_0x4018[_0x58af75];return _0x32a5ad;};'use strict';var _=require(_0x8401('0x0'));var moment=require(_0x8401('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0x8401('0x2'));var config=require('../../../config/environment');var logger=require(_0x8401('0x3'))(_0x8401('0x4'));config[_0x8401('0x5')]=_[_0x8401('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8401('0x7'))(new Redis(config[_0x8401('0x5')]));var EmailImap=require(_0x8401('0x8'));var EmailSmtp=require(_0x8401('0x9'));var mailAccount=require(_0x8401('0xa'));var md5Accounts={};function EmailChannel(_0x13cb5f){logger[_0x8401('0xb')](_0x8401('0xc'));this[_0x8401('0xd')]=_0x13cb5f[_0x8401('0xd')];this[_0x8401('0xe')]={};this[_0x8401('0xf')]=new EmailSmtp();}EmailChannel[_0x8401('0x10')][_0x8401('0x11')]=function(_0x4a56c4){var _0x38a73f=this['mailAccounts'][_0x4a56c4];var _0x1a993b={'id':_0x38a73f['id'],'name':_0x38a73f[_0x8401('0x12')],'key':_0x38a73f[_0x8401('0x13')],'active':_0x38a73f[_0x8401('0x14')],'Imap':{'status':_0x38a73f['Imap'][_0x8401('0x15')],'messageStatus':_0x38a73f[_0x8401('0x16')][_0x8401('0x17')],'total':_0x38a73f[_0x8401('0x16')][_0x8401('0x18')]}};if(_[_0x8401('0x19')](md5Accounts[_0x4a56c4])){md5Accounts[_0x4a56c4]={};}var _0x5e1b37=md5(JSON[_0x8401('0x1a')](_0x1a993b));if(md5Accounts[_0x4a56c4][_0x8401('0x1b')]!==_0x5e1b37){md5Accounts[_0x4a56c4][_0x8401('0x1b')]=_0x5e1b37;io[_0x8401('0x11')]('mailAccount:update',_0x1a993b);}};EmailChannel[_0x8401('0x10')][_0x8401('0x1c')]=function(_0x390279){for(var _0x2e0943 in _0x390279){if(_0x390279[_0x8401('0x1d')](_0x2e0943)){if(_0x390279[_0x2e0943][_0x8401('0x16')]&&_0x390279[_0x2e0943][_0x8401('0x14')]){var _0x2ae802=_0x390279[_0x2e0943]['Imap'];if(!this['imapAccounts']['hasOwnProperty'](_0x2ae802['id'])){this['imapAccounts'][_0x2ae802['id']]=new EmailImap(_0x2ae802,_0x390279[_0x2e0943][_0x8401('0x4')]);this[_0x8401('0xe')][_0x2ae802['id']]['on'](_0x8401('0x1e'),this[_0x8401('0x1f')][_0x8401('0x20')](this,_0x2e0943));this[_0x8401('0xe')][_0x2ae802['id']]['on'](_0x8401('0x4'),this['handleImapEmail'][_0x8401('0x20')](this,_0x2e0943));this[_0x8401('0xe')][_0x2ae802['id']]['on'](_0x8401('0x21'),this[_0x8401('0x22')][_0x8401('0x20')](this,_0x2e0943));this[_0x8401('0xe')][_0x2ae802['id']]['on']('error',this[_0x8401('0x23')][_0x8401('0x20')](this,_0x2e0943));}}else{if(_[_0x8401('0x19')](this[_0x8401('0xd')][_0x2e0943][_0x8401('0x16')])){this[_0x8401('0xd')][_0x2e0943][_0x8401('0x16')]={};}this[_0x8401('0xd')][_0x2e0943]['Imap'][_0x8401('0x15')]='disabled';this['mailAccounts'][_0x2e0943][_0x8401('0x16')][_0x8401('0x17')]='';this['emit'](_0x2e0943);}}}};EmailChannel['prototype']['handleImapBox']=function(_0xfe8a0d,_0x5b490d){if(this[_0x8401('0xd')][_0xfe8a0d]){this['mailAccounts'][_0xfe8a0d]['Imap'][_0x8401('0x15')]=_0x8401('0x24');this['mailAccounts'][_0xfe8a0d][_0x8401('0x16')][_0x8401('0x17')]=_0x5b490d['name'];if(_0x5b490d[_0x8401('0x25')]){this[_0x8401('0xd')][_0xfe8a0d][_0x8401('0x16')]['total']=_0x5b490d['messages'][_0x8401('0x18')];}return this[_0x8401('0x11')](_0xfe8a0d);}};EmailChannel['prototype'][_0x8401('0x26')]=function(_0x1adf74,_0xc2b94b){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0xc2b94b[_0x8401('0x27')],_0xc2b94b['lastName'],_0xc2b94b[_0x8401('0x28')],_0x1adf74);if(this[_0x8401('0xd')][_0x1adf74]){return mailAccount[_0x8401('0x29')](_0x1adf74,_0xc2b94b)[_0x8401('0x2a')](function(_0x43a380){if(_0x43a380){logger[_0x8401('0xb')]('Mail\x20accepted\x20from\x20routing');}})[_0x8401('0x2b')](function(_0x113d1d){logger[_0x8401('0x2c')](_0x8401('0x2d'),JSON[_0x8401('0x1a')](_0x113d1d));});}};EmailChannel[_0x8401('0x10')][_0x8401('0x22')]=function(_0x19e46c){if(this['mailAccounts'][_0x19e46c]&&this['mailAccounts'][_0x19e46c][_0x8401('0x16')]){if(this[_0x8401('0xe')][this[_0x8401('0xd')][_0x19e46c][_0x8401('0x16')]['id']]){delete this['imapAccounts'][this[_0x8401('0xd')][_0x19e46c][_0x8401('0x16')]['id']];}this[_0x8401('0xd')][_0x19e46c][_0x8401('0x16')][_0x8401('0x2e')]=moment();this[_0x8401('0x11')](_0x19e46c);}};EmailChannel['prototype'][_0x8401('0x23')]=function(_0x3588b6,_0x30dcd2){if(this[_0x8401('0xd')][_0x3588b6]){this[_0x8401('0xd')][_0x3588b6][_0x8401('0x16')][_0x8401('0x15')]=_0x8401('0x2c');this['mailAccounts'][_0x3588b6][_0x8401('0x16')]['messageStatus']=_0x30dcd2;return this[_0x8401('0x11')](_0x3588b6);}};EmailChannel[_0x8401('0x10')][_0x8401('0x2f')]=function(_0x3c5d33,_0x27f877){return this[_0x8401('0xf')][_0x8401('0x30')](_0x3c5d33,_0x27f877);};EmailChannel[_0x8401('0x10')][_0x8401('0x31')]=function(_0x56782b){var _0x312c9a=this;if(this[_0x8401('0xd')][_0x56782b['id']]){if(_[_0x8401('0x19')](this[_0x8401('0xd')][_0x56782b['id']][_0x8401('0x32')])){this['mailAccounts'][_0x56782b['id']][_0x8401('0x32')]={};}this[_0x8401('0xd')][_0x56782b['id']][_0x8401('0x32')][_0x8401('0x2e')]=moment();return new BPromise(function(_0x23bf25,_0x5667e2){return _0x312c9a[_0x8401('0xf')][_0x8401('0x33')](_0x56782b)[_0x8401('0x2a')](function(_0x3c73d6){_0x312c9a['mailAccounts'][_0x56782b['id']]['Smtp']['status']=_0x8401('0x34');_0x312c9a['mailAccounts'][_0x56782b['id']][_0x8401('0x32')][_0x8401('0x17')]='';_0x312c9a[_0x8401('0x11')](_0x56782b['id']);_0x23bf25(_0x3c73d6);})[_0x8401('0x2b')](function(_0x3b972f){_0x312c9a['mailAccounts'][_0x56782b['id']]['Smtp']['status']='error';_0x312c9a[_0x8401('0xd')][_0x56782b['id']][_0x8401('0x32')][_0x8401('0x17')]=_0x3b972f;_0x312c9a[_0x8401('0x11')](_0x56782b['id']);_0x5667e2(_0x3b972f);});});}return this[_0x8401('0xf')][_0x8401('0x33')](_0x56782b);};module[_0x8401('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index e4f25b1..76b0572 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 _0x32f4=['getAccount','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','required','getHost','prototype','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','end','search','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','email','stringify','textCode','upperFirst','exports','path','util','imap','lodash','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','account','once','ready','bind','handleEnd','error','handleError','connect'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x32f4,0x154));var _0x432f=function(_0x14991d,_0x1e10e6){_0x14991d=_0x14991d-0x0;var _0x3b2047=_0x32f4[_0x14991d];return _0x3b2047;};'use strict';var fs=require('fs');var path=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var Imap=require(_0x432f('0x2'));var _=require(_0x432f('0x3'));var rs=require('randomstring');var simpleParser=require(_0x432f('0x4'))[_0x432f('0x5')];var Iconv=require('iconv')[_0x432f('0x6')];var EventEmitter=require(_0x432f('0x7'))[_0x432f('0x8')];var utils=require(_0x432f('0x9'));var logger=require(_0x432f('0xa'))('email');function EmailImap(_0x5b5f08,_0x2f66fd){this[_0x432f('0xb')]='INBOX';this[_0x432f('0xc')]=this['getAccount'](_0x5b5f08,_0x2f66fd);this[_0x432f('0x2')]=new Imap(this[_0x432f('0xc')]);this[_0x432f('0x2')][_0x432f('0xd')](_0x432f('0xe'),this['handleReady'][_0x432f('0xf')](this));this['imap'][_0x432f('0xd')]('end',this[_0x432f('0x10')][_0x432f('0xf')](this));this['imap']['on'](_0x432f('0x11'),this[_0x432f('0x12')]['bind'](this));this[_0x432f('0x2')][_0x432f('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x432f('0x14')]=function(_0x44756d,_0x34add6){var _0x453725={'connTimeout':_0x44756d[_0x432f('0x15')]?_0x44756d['connTimeout']*0x3e8:0x2710,'authTimeout':_0x44756d[_0x432f('0x16')]?_0x44756d[_0x432f('0x16')]*0x3e8:0x1388};if(_[_0x432f('0x17')](_0x44756d[_0x432f('0x18')])){if(_0x44756d['authentication']){_0x453725[_0x432f('0x19')]=_0x44756d[_0x432f('0x19')];_0x453725[_0x432f('0x1a')]=_0x44756d[_0x432f('0x1a')];}_0x453725[_0x432f('0x1b')]=_0x44756d[_0x432f('0x1b')];_0x453725['port']=_0x44756d[_0x432f('0x1c')]||0x3e1;if(_0x44756d['tls']){_0x453725[_0x432f('0x1d')]=!![];}else{_0x453725[_0x432f('0x1d')]=![];_0x453725[_0x432f('0x1e')]=_0x432f('0x1f');}}else{_0x453725[_0x432f('0x19')]=_0x44756d[_0x432f('0x19')];_0x453725[_0x432f('0x1a')]=_0x44756d[_0x432f('0x1a')];_0x453725[_0x432f('0x1b')]=utils[_0x432f('0x20')](_0x44756d[_0x432f('0x18')]);_0x453725[_0x432f('0x1c')]=0x3e1;_0x453725['tls']=!![];}_0x453725['email']=_0x34add6||_0x44756d[_0x432f('0x19')]||'anonymous@xcally.com';return _0x453725;};EmailImap[_0x432f('0x21')]['handleReady']=function(){this[_0x432f('0x2')][_0x432f('0x22')](this[_0x432f('0xb')],![],this[_0x432f('0x23')][_0x432f('0xf')](this));};EmailImap[_0x432f('0x21')]['handleOpenBox']=function(_0x252b3b,_0x33edec){if(_0x252b3b){this['handleError'](_0x252b3b,!![]);}else{this[_0x432f('0x24')](_0x432f('0x25'),_0x33edec);this[_0x432f('0x26')]();}};EmailImap[_0x432f('0x21')][_0x432f('0x27')]=function(_0x781862){if(_0x781862){this[_0x432f('0x12')](_0x781862,!![]);}else{this['imap'][_0x432f('0x28')]();}};EmailImap['prototype'][_0x432f('0x26')]=function(){this['imap'][_0x432f('0x29')](['UNSEEN'],this[_0x432f('0x2a')]['bind'](this));};EmailImap[_0x432f('0x21')][_0x432f('0x2a')]=function(_0x263cd8,_0x59c1ab){if(_0x263cd8){this[_0x432f('0x12')](_0x263cd8,!![]);}else{if(_0x59c1ab[_0x432f('0x2b')]){try{var _0x48139b=this['imap'][_0x432f('0x2c')](_0x59c1ab,{'bodies':'','markSeen':!![]});_0x48139b['on'](_0x432f('0x2d'),this[_0x432f('0x2e')][_0x432f('0xf')](this));_0x48139b[_0x432f('0xd')](_0x432f('0x11'),this['handleFetchError']['bind'](this));_0x48139b[_0x432f('0xd')](_0x432f('0x28'),this[_0x432f('0x2f')]['bind'](this));}catch(_0xb7c1dd){logger[_0x432f('0x11')](_0xb7c1dd);}}else{this[_0x432f('0x2')][_0x432f('0x30')](!![],this[_0x432f('0x27')][_0x432f('0xf')](this));}}};EmailImap[_0x432f('0x21')][_0x432f('0x2e')]=function(_0x4c480a,_0x47a693){_0x4c480a['on'](_0x432f('0x31'),this[_0x432f('0x32')]['bind'](this));_0x4c480a['once']('attributes',this[_0x432f('0x33')][_0x432f('0xf')](this));_0x4c480a['once'](_0x432f('0x28'),this[_0x432f('0x34')][_0x432f('0xf')](this));};EmailImap['prototype'][_0x432f('0x32')]=function(_0x440420,_0x499e58){simpleParser(_0x440420,{'Iconv':Iconv},this[_0x432f('0x35')][_0x432f('0xf')](this));};EmailImap['prototype'][_0x432f('0x33')]=function(_0x41b292){};EmailImap[_0x432f('0x21')][_0x432f('0x34')]=function(){};EmailImap[_0x432f('0x21')][_0x432f('0x35')]=function(_0xbef36e,_0x2d0d80){if(_0xbef36e){logger[_0x432f('0x11')](_0xbef36e);}else{var _0x2545b7=this;utils[_0x432f('0x36')](this['account'],_0x2d0d80,function(_0x3d835e){_0x2545b7['emit'](_0x432f('0x37'),_0x3d835e);});}};EmailImap[_0x432f('0x21')]['handleFetchEnd']=function(){this[_0x432f('0x2')]['closeBox'](!![],this[_0x432f('0x27')][_0x432f('0xf')](this));};EmailImap['prototype']['handleFetchError']=function(_0xbd4240){this[_0x432f('0x12')](_0xbd4240);this[_0x432f('0x2')][_0x432f('0x30')](!![],this[_0x432f('0x27')]['bind'](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x432f('0x24')](_0x432f('0x28'));};EmailImap['prototype'][_0x432f('0x12')]=function(_0x841572,_0x41c90c){logger[_0x432f('0x11')](_0x432f('0x12'),this[_0x432f('0xc')][_0x432f('0x37')],JSON[_0x432f('0x38')](_0x841572));var _0x1c5f87='';if(_0x841572){if(_0x841572['textCode']){_0x1c5f87=_0x841572[_0x432f('0x39')];}else{for(var _0xd8264f in _0x841572){if(_0x841572['hasOwnProperty'](_0xd8264f)){_0x1c5f87+=_[_0x432f('0x3a')](_0xd8264f)+':\x20'+_0x841572[_0xd8264f]+'\x0a';}}}}if(_0x41c90c){this[_0x432f('0x2')][_0x432f('0x28')]();}else{this[_0x432f('0x24')](_0x432f('0x11'),_0x1c5f87);this[_0x432f('0x24')](_0x432f('0x28'));}};module[_0x432f('0x3b')]=EmailImap; \ No newline at end of file +var _0x2e02=['EventEmitter','../../../config/logger','mailbox','account','getAccount','imap','once','ready','handleReady','bind','end','handleEnd','handleError','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','email','anonymous@xcally.com','handleOpenBox','emit','box','readUnseen','prototype','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','error','handleFetchError','handleFetchEnd','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','stringify','textCode','hasOwnProperty','upperFirst','exports','util','randomstring','Iconv','events'];(function(_0x35a647,_0x23a5e5){var _0x398e27=function(_0x22bdbc){while(--_0x22bdbc){_0x35a647['push'](_0x35a647['shift']());}};_0x398e27(++_0x23a5e5);}(_0x2e02,0xd8));var _0x22e0=function(_0x5645e0,_0x212666){_0x5645e0=_0x5645e0-0x0;var _0x1faabc=_0x2e02[_0x5645e0];return _0x1faabc;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x22e0('0x0'));var Imap=require('imap');var _=require('lodash');var rs=require(_0x22e0('0x1'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require('iconv')[_0x22e0('0x2')];var EventEmitter=require(_0x22e0('0x3'))[_0x22e0('0x4')];var utils=require('./utils');var logger=require(_0x22e0('0x5'))('email');function EmailImap(_0x216576,_0x1de9c6){this[_0x22e0('0x6')]='INBOX';this[_0x22e0('0x7')]=this[_0x22e0('0x8')](_0x216576,_0x1de9c6);this[_0x22e0('0x9')]=new Imap(this[_0x22e0('0x7')]);this[_0x22e0('0x9')][_0x22e0('0xa')](_0x22e0('0xb'),this[_0x22e0('0xc')][_0x22e0('0xd')](this));this[_0x22e0('0x9')][_0x22e0('0xa')](_0x22e0('0xe'),this[_0x22e0('0xf')]['bind'](this));this[_0x22e0('0x9')]['on']('error',this[_0x22e0('0x10')][_0x22e0('0xd')](this));this[_0x22e0('0x9')][_0x22e0('0x11')]();}util[_0x22e0('0x12')](EmailImap,EventEmitter);EmailImap['prototype'][_0x22e0('0x8')]=function(_0x190003,_0x3c12cc){var _0x383f69={'connTimeout':_0x190003[_0x22e0('0x13')]?_0x190003[_0x22e0('0x13')]*0x3e8:0x2710,'authTimeout':_0x190003[_0x22e0('0x14')]?_0x190003[_0x22e0('0x14')]*0x3e8:0x1388};if(_[_0x22e0('0x15')](_0x190003[_0x22e0('0x16')])){if(_0x190003[_0x22e0('0x17')]){_0x383f69[_0x22e0('0x18')]=_0x190003[_0x22e0('0x18')];_0x383f69[_0x22e0('0x19')]=_0x190003[_0x22e0('0x19')];}_0x383f69['host']=_0x190003[_0x22e0('0x1a')];_0x383f69[_0x22e0('0x1b')]=_0x190003[_0x22e0('0x1b')]||0x3e1;if(_0x190003[_0x22e0('0x1c')]){_0x383f69[_0x22e0('0x1c')]=!![];}else{_0x383f69[_0x22e0('0x1c')]=![];_0x383f69['autotls']='required';}}else{_0x383f69[_0x22e0('0x18')]=_0x190003[_0x22e0('0x18')];_0x383f69[_0x22e0('0x19')]=_0x190003[_0x22e0('0x19')];_0x383f69['host']=utils['getHost'](_0x190003['service']);_0x383f69[_0x22e0('0x1b')]=0x3e1;_0x383f69[_0x22e0('0x1c')]=!![];}_0x383f69[_0x22e0('0x1d')]=_0x3c12cc||_0x190003[_0x22e0('0x18')]||_0x22e0('0x1e');return _0x383f69;};EmailImap['prototype']['handleReady']=function(){this[_0x22e0('0x9')]['openBox'](this['mailbox'],![],this[_0x22e0('0x1f')][_0x22e0('0xd')](this));};EmailImap['prototype'][_0x22e0('0x1f')]=function(_0x3846e2,_0x249ba6){if(_0x3846e2){this[_0x22e0('0x10')](_0x3846e2,!![]);}else{this[_0x22e0('0x20')](_0x22e0('0x21'),_0x249ba6);this[_0x22e0('0x22')]();}};EmailImap[_0x22e0('0x23')][_0x22e0('0x24')]=function(_0x3ff4e4){if(_0x3ff4e4){this['handleError'](_0x3ff4e4,!![]);}else{this['imap']['end']();}};EmailImap[_0x22e0('0x23')][_0x22e0('0x22')]=function(){this[_0x22e0('0x9')][_0x22e0('0x25')]([_0x22e0('0x26')],this[_0x22e0('0x27')][_0x22e0('0xd')](this));};EmailImap[_0x22e0('0x23')][_0x22e0('0x27')]=function(_0x1c2903,_0x4fb920){if(_0x1c2903){this[_0x22e0('0x10')](_0x1c2903,!![]);}else{if(_0x4fb920['length']){try{var _0x52262c=this[_0x22e0('0x9')][_0x22e0('0x28')](_0x4fb920,{'bodies':'','markSeen':!![]});_0x52262c['on']('message',this['handleFetchMessage'][_0x22e0('0xd')](this));_0x52262c[_0x22e0('0xa')](_0x22e0('0x29'),this[_0x22e0('0x2a')][_0x22e0('0xd')](this));_0x52262c[_0x22e0('0xa')]('end',this[_0x22e0('0x2b')][_0x22e0('0xd')](this));}catch(_0x2ddecc){logger[_0x22e0('0x29')](_0x2ddecc);}}else{this[_0x22e0('0x9')]['closeBox'](!![],this[_0x22e0('0x24')][_0x22e0('0xd')](this));}}};EmailImap[_0x22e0('0x23')]['handleFetchMessage']=function(_0x3cd19a,_0x48ed0b){_0x3cd19a['on']('body',this[_0x22e0('0x2c')][_0x22e0('0xd')](this));_0x3cd19a['once']('attributes',this[_0x22e0('0x2d')][_0x22e0('0xd')](this));_0x3cd19a[_0x22e0('0xa')](_0x22e0('0xe'),this[_0x22e0('0x2e')][_0x22e0('0xd')](this));};EmailImap['prototype'][_0x22e0('0x2c')]=function(_0x5dbe3b,_0x3da193){simpleParser(_0x5dbe3b,{'Iconv':Iconv},this[_0x22e0('0x2f')][_0x22e0('0xd')](this));};EmailImap[_0x22e0('0x23')]['handleMessageAttributes']=function(_0x3b2f8d){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap[_0x22e0('0x23')][_0x22e0('0x2f')]=function(_0x141e33,_0x8f576e){if(_0x141e33){logger[_0x22e0('0x29')](_0x141e33);}else{var _0x49f1ae=this;utils[_0x22e0('0x30')](this[_0x22e0('0x7')],_0x8f576e,function(_0x58c548){_0x49f1ae[_0x22e0('0x20')](_0x22e0('0x1d'),_0x58c548);});}};EmailImap[_0x22e0('0x23')][_0x22e0('0x2b')]=function(){this['imap']['closeBox'](!![],this[_0x22e0('0x24')][_0x22e0('0xd')](this));};EmailImap[_0x22e0('0x23')][_0x22e0('0x2a')]=function(_0x99b528){this[_0x22e0('0x10')](_0x99b528);this[_0x22e0('0x9')][_0x22e0('0x31')](!![],this[_0x22e0('0x24')]['bind'](this));};EmailImap[_0x22e0('0x23')][_0x22e0('0xf')]=function(){this[_0x22e0('0x20')](_0x22e0('0xe'));};EmailImap[_0x22e0('0x23')][_0x22e0('0x10')]=function(_0x353d77,_0x142066){logger['error'](_0x22e0('0x10'),this[_0x22e0('0x7')][_0x22e0('0x1d')],JSON[_0x22e0('0x32')](_0x353d77));var _0x3b46b5='';if(_0x353d77){if(_0x353d77[_0x22e0('0x33')]){_0x3b46b5=_0x353d77[_0x22e0('0x33')];}else{for(var _0x18eae9 in _0x353d77){if(_0x353d77[_0x22e0('0x34')](_0x18eae9)){_0x3b46b5+=_[_0x22e0('0x35')](_0x18eae9)+':\x20'+_0x353d77[_0x18eae9]+'\x0a';}}}}if(_0x142066){this[_0x22e0('0x9')][_0x22e0('0xe')]();}else{this[_0x22e0('0x20')](_0x22e0('0x29'),_0x3b46b5);this[_0x22e0('0x20')](_0x22e0('0xe'));}};module[_0x22e0('0x36')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 16846c8..3aa2d6b 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 _0x8b29=['compile','sendMail','toString','verify','exports','nodemailer','bluebird','prototype','send','createTransport','use'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8b29,0xaa));var _0x98b2=function(_0x5adf30,_0x4c0436){_0x5adf30=_0x5adf30-0x0;var _0x1d7468=_0x8b29[_0x5adf30];return _0x1d7468;};'use strict';var nodemailer=require(_0x98b2('0x0'));var BPromise=require(_0x98b2('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x98b2('0x2')][_0x98b2('0x3')]=function(_0x509834,_0x21fecf){return new BPromise(function(_0x15cdf6,_0x177cb4){var _0x28e5b2=nodemailer[_0x98b2('0x4')](_0x509834);_0x28e5b2[_0x98b2('0x5')](_0x98b2('0x6'),inlineBase64());_0x28e5b2[_0x98b2('0x7')](_0x21fecf,function(_0x10413b,_0x3f5e7d){if(_0x10413b){_0x177cb4(_0x10413b[_0x98b2('0x8')]());}else{_0x15cdf6(_0x3f5e7d);}});});};EmailSmtp[_0x98b2('0x2')][_0x98b2('0x9')]=function(_0x29e317){return new BPromise(function(_0x471719,_0x1c195f){var _0x574c9a=nodemailer[_0x98b2('0x4')](_0x29e317);_0x574c9a[_0x98b2('0x9')](function(_0xe117b9,_0x35f1a3){if(_0xe117b9){_0x1c195f(_0xe117b9[_0x98b2('0x8')]());}else{if(_0x35f1a3){_0x471719(_0x35f1a3);}else{_0x1c195f('Not\x20verifired');}}});});};module[_0x98b2('0xa')]=EmailSmtp; \ No newline at end of file +var _0x6feb=['createTransport','use','sendMail','prototype','verify','toString','Not\x20verifired','nodemailer','bluebird','send'];(function(_0x403cff,_0x1cf463){var _0x5a7c56=function(_0x1bab9d){while(--_0x1bab9d){_0x403cff['push'](_0x403cff['shift']());}};_0x5a7c56(++_0x1cf463);}(_0x6feb,0x1bf));var _0xb6fe=function(_0x3d2ab8,_0x388f58){_0x3d2ab8=_0x3d2ab8-0x0;var _0x3c2b53=_0x6feb[_0x3d2ab8];return _0x3c2b53;};'use strict';var nodemailer=require(_0xb6fe('0x0'));var BPromise=require(_0xb6fe('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xb6fe('0x2')]=function(_0x17831b,_0x5c0fb4){return new BPromise(function(_0x488549,_0x52e342){var _0x4cd3c3=nodemailer[_0xb6fe('0x3')](_0x17831b);_0x4cd3c3[_0xb6fe('0x4')]('compile',inlineBase64());_0x4cd3c3[_0xb6fe('0x5')](_0x5c0fb4,function(_0x1cf62d,_0xf7e78e){if(_0x1cf62d){_0x52e342(_0x1cf62d['toString']());}else{_0x488549(_0xf7e78e);}});});};EmailSmtp[_0xb6fe('0x6')][_0xb6fe('0x7')]=function(_0x3015ab){return new BPromise(function(_0x135f3a,_0x549410){var _0x9a8170=nodemailer[_0xb6fe('0x3')](_0x3015ab);_0x9a8170[_0xb6fe('0x7')](function(_0xc2b35a,_0x18f80f){if(_0xc2b35a){_0x549410(_0xc2b35a[_0xb6fe('0x8')]());}else{if(_0x18f80f){_0x135f3a(_0x18f80f);}else{_0x549410(_0xb6fe('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 5c5443a..d168708 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 _0xa83a=['slice','join','Anonymous','length','pop','isEmpty','anonymous','generate','@xcally.com','test','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x30939b[_0xaa83('0x10')]():'';}return'';}function getMails(_0x59830c,_0x2995d3){var _0x44695c='';for(var _0x2545ba=0x0;_0x2545ba<_0x2995d3[_0xaa83('0x8')][_0xaa83('0xf')];_0x2545ba+=0x1){if(_0x2995d3[_0xaa83('0x8')][_0x2545ba][_0xaa83('0x9')]!==_0x59830c){if(!_[_0xaa83('0x11')](_0x44695c)){_0x44695c+=',';}_0x44695c+=_0x2995d3[_0xaa83('0x8')][_0x2545ba][_0xaa83('0xa')]||_0x2995d3[_0xaa83('0x8')][_0x2545ba][_0xaa83('0x9')]||'';_0x44695c+='\x20<';_0x44695c+=_0x2995d3['value'][_0x2545ba]['address']?_0x2995d3[_0xaa83('0x8')][_0x2545ba][_0xaa83('0x9')]:_0xaa83('0x12')+random[_0xaa83('0x13')](0x6)+_0xaa83('0x14');_0x44695c+='>';}}return _0x44695c;}function parseEmail(_0x5b2739,_0x3f4312,_0x27a7bb){if(_0x3f4312['html']){var _0x59c784=/)<[^<]*)*<\/script>/gi;while(_0x59c784[_0xaa83('0x15')](_0x3f4312[_0xaa83('0x16')])){_0x3f4312[_0xaa83('0x16')]=_0x3f4312['html'][_0xaa83('0x17')](_0x59c784,'');}if(_0x3f4312[_0xaa83('0x16')][_0xaa83('0x18')](_0xaa83('0x19'))){var _0x278160=[];_0x3f4312[_0xaa83('0x1a')][_0xaa83('0x1b')](_0x4003d1=>{_0x278160[_0xaa83('0x1c')](_0x4003d1[_0xaa83('0x1d')]);});var _0x46d1d6=/]+>/g;var _0x458428=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x53d4a9=_0x3f4312[_0xaa83('0x16')][_0xaa83('0x17')](_0x458428,'_SRC');var _0x328a11=_0x53d4a9[_0xaa83('0x17')](_0x46d1d6,_0xaa83('0x1e'));for(let _0x22cad2=0x0;_0x22cad2<_0x278160[_0xaa83('0xf')];_0x22cad2++){var _0x4b7fe5=_0x328a11[_0xaa83('0x17')]('_IMG',_0xaa83('0x1f')+_0x278160[_0x22cad2]+_0xaa83('0x20'));_0x328a11=_0x4b7fe5;}_0x3f4312['html']=_0x328a11;}_0x27a7bb[_0xaa83('0x21')]=_0x3f4312[_0xaa83('0x16')];}else{_0x27a7bb['body']=_0x3f4312[_0xaa83('0x22')];}if(_0x27a7bb[_0xaa83('0x21')]){_0x27a7bb[_0xaa83('0x21')]=_0x27a7bb['body'][_0xaa83('0x17')](/Empty\x20message

';if(_0x3dffe9[_0xaa83('0x3e')]){for(var _0x534286=0x0;_0x534286<_0x3dffe9[_0xaa83('0x3e')][_0xaa83('0xf')];_0x534286++){var _0x15ecc9=_0x3dffe9[_0xaa83('0x3e')][_0x534286];_0x2a3ec5[_0xaa83('0x24')][_0xaa83('0x1a')][_0xaa83('0x1c')]({'filename':_0x15ecc9['Title'],'content':new Buffer(_0x15ecc9[_0xaa83('0x3f')])});}}}_0x50da05(parseEmail(_0x1f56f9,_0x4844f1,_0x2a3ec5));});}else{_0x4844f1[_0xaa83('0x16')]='

Empty\x20message

';_0x50da05(parseEmail(_0x1f56f9,_0x4844f1,_0x2a3ec5));}}else{_0x50da05(parseEmail(_0x1f56f9,_0x4844f1,_0x2a3ec5));}};exports[_0xaa83('0x40')]=function(_0x1c3331){switch(_0x1c3331){case _0xaa83('0x41'):return _0xaa83('0x42');case _0xaa83('0x43'):return _0xaa83('0x44');case _0xaa83('0x45'):return _0xaa83('0x46');case _0xaa83('0x47'):return _0xaa83('0x48');}return _0xaa83('0x49');}; \ No newline at end of file +var _0x4864=['../../../config/logger','email','value','address','anonymous','generate','@xcally.com','head','name','length','slice','Anonymous','split','pop','html','test','replace','includes','forEach','push','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','randomstring','path','util','node-tnef'];(function(_0x1bdaf7,_0x49e4d3){var _0x1ca543=function(_0x39bdc5){while(--_0x39bdc5){_0x1bdaf7['push'](_0x1bdaf7['shift']());}};_0x1ca543(++_0x49e4d3);}(_0x4864,0x10c));var _0x4486=function(_0x3a7368,_0x185789){_0x3a7368=_0x3a7368-0x0;var _0x1aa883=_0x4864[_0x3a7368];return _0x1aa883;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x4486('0x0'));var fs=require('fs');var path=require(_0x4486('0x1'));var util=require(_0x4486('0x2'));var tnef=require(_0x4486('0x3'));var logger=require(_0x4486('0x4'))(_0x4486('0x5'));var config=require('../../../config/environment');function getAddress(_0x2857e4){var _0x1503c0=_['head'](_0x2857e4[_0x4486('0x6')]);return _0x1503c0&&_0x1503c0[_0x4486('0x7')]?_0x1503c0[_0x4486('0x7')]:_0x4486('0x8')+random[_0x4486('0x9')](0x6)+_0x4486('0xa');}function getFirstName(_0x27f71f){var _0x158968=_[_0x4486('0xb')](_0x27f71f[_0x4486('0x6')]);if(_0x158968&&_0x158968['name']){var _0x55ac93=_0x158968[_0x4486('0xc')]['split'](/\s+/);return _0x55ac93[_0x4486('0xd')]?_0x55ac93[_0x4486('0xe')](0x0,-0x1)['join']('\x20'):_0x158968[_0x4486('0xc')];}return _0x4486('0xf');}function getLastName(_0x6f442d){var _0x2f5e56=_[_0x4486('0xb')](_0x6f442d[_0x4486('0x6')]);if(_0x2f5e56&&_0x2f5e56['name']){var _0x4be7c4=_0x2f5e56['name'][_0x4486('0x10')](/\s+/);return _0x4be7c4['length']>0x1?_0x4be7c4[_0x4486('0x11')]():'';}return'';}function getMails(_0x26f34c,_0x2a36a6){var _0xc0a139='';for(var _0x287b22=0x0;_0x287b22<_0x2a36a6[_0x4486('0x6')][_0x4486('0xd')];_0x287b22+=0x1){if(_0x2a36a6[_0x4486('0x6')][_0x287b22]['address']!==_0x26f34c){if(!_['isEmpty'](_0xc0a139)){_0xc0a139+=',';}_0xc0a139+=_0x2a36a6[_0x4486('0x6')][_0x287b22]['name']||_0x2a36a6[_0x4486('0x6')][_0x287b22][_0x4486('0x7')]||'';_0xc0a139+='\x20<';_0xc0a139+=_0x2a36a6['value'][_0x287b22][_0x4486('0x7')]?_0x2a36a6[_0x4486('0x6')][_0x287b22][_0x4486('0x7')]:'anonymous'+random[_0x4486('0x9')](0x6)+'@xcally.com';_0xc0a139+='>';}}return _0xc0a139;}function parseEmail(_0x32d5c4,_0x294772,_0x3914a9){if(_0x294772[_0x4486('0x12')]){var _0x21f1a8=/)<[^<]*)*<\/script>/gi;while(_0x21f1a8[_0x4486('0x13')](_0x294772[_0x4486('0x12')])){_0x294772[_0x4486('0x12')]=_0x294772[_0x4486('0x12')][_0x4486('0x14')](_0x21f1a8,'');}if(_0x294772[_0x4486('0x12')][_0x4486('0x15')]('{_0x14854f[_0x4486('0x17')](_0x2ca30b['filename']);});var _0x4a11a1=/]+>/g;var _0x317aff=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x5197f2=_0x294772[_0x4486('0x12')][_0x4486('0x14')](_0x317aff,_0x4486('0x18'));var _0x3543bd=_0x5197f2[_0x4486('0x14')](_0x4a11a1,_0x4486('0x19'));for(let _0x41c95c=0x0;_0x41c95c<_0x14854f[_0x4486('0xd')];_0x41c95c++){var _0x39b0c4=_0x3543bd[_0x4486('0x14')](_0x4486('0x19'),_0x4486('0x1a')+_0x14854f[_0x41c95c]+_0x4486('0x1b'));_0x3543bd=_0x39b0c4;}_0x294772[_0x4486('0x12')]=_0x3543bd;}_0x3914a9['body']=_0x294772[_0x4486('0x12')];}else{_0x3914a9[_0x4486('0x1c')]=_0x294772[_0x4486('0x1d')];}if(_0x3914a9[_0x4486('0x1c')]){_0x3914a9[_0x4486('0x1c')]=_0x3914a9[_0x4486('0x1c')][_0x4486('0x14')](/0x0){if(this[_0x484be2+_0x9722('0x2c')]>0x0&&this[_0x484be2+_0x9722('0x2b')]>=this[_0x484be2+_0x9722('0x2c')]){return _0x9722('0x2d');}else{return _0x9722('0x2e');}}else{return'idle';}};Agent[_0x9722('0x29')][_0x9722('0x28')]=function(){var _0xdc3330=[_0x9722('0x2f'),_0x9722('0x30'),_0x9722('0x31'),_0x9722('0x32'),_0x9722('0x33'),'whatsapp'];for(var _0x1ae537=0x0;_0x1ae537<_0xdc3330['length'];_0x1ae537+=0x1){var _0x141c7d=this[_0x9722('0x2a')](_0xdc3330[_0x1ae537]);if(this[_0xdc3330[_0x1ae537]+_0x9722('0x34')]!==_0x141c7d){this[_0xdc3330[_0x1ae537]+_0x9722('0x35')]=_[_0x9722('0x36')](moment()[_0x9722('0x37')]('x'));}this[_0xdc3330[_0x1ae537]+_0x9722('0x34')]=_0x141c7d;}var _0x390f79={'id':this['id'],'name':this['name'],'online':this[_0x9722('0x9')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this[_0x9722('0xc')],'smsPause':this[_0x9722('0xe')],'faxPause':this['faxPause'],'openchannelPause':this[_0x9722('0xf')],'chatStatus':this[_0x9722('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x9722('0x14')],'mailStatus':this[_0x9722('0x15')],'mailStatusTime':this[_0x9722('0x38')],'mailCapacity':this[_0x9722('0x16')],'mailCurrentCapacity':this[_0x9722('0x17')],'faxStatus':this[_0x9722('0x18')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x9722('0x19')],'faxCurrentCapacity':this[_0x9722('0x1a')],'smsStatus':this[_0x9722('0x39')],'smsStatusTime':this[_0x9722('0x1b')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x9722('0x1d')],'whatsappStatus':this[_0x9722('0x1e')],'whatsappStatusTime':this[_0x9722('0x1f')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x9722('0x22')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x9722('0x24')],'openchannelCurrentCapacity':this[_0x9722('0x25')],'busy':this[_0x9722('0x26')],'busyQueue':this[_0x9722('0x27')]};var _0x1df56b=md5(JSON[_0x9722('0x3a')](_0x390f79));if(this[_0x9722('0x2')]!==_0x1df56b){this[_0x9722('0x2')]=_0x1df56b;io[_0x9722('0x3b')](_0x9722('0x3c'),_0x390f79);}};module[_0x9722('0x3d')]=Agent; \ No newline at end of file +var _0x66d3=['mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','working','idle','prototype','chat','openchannel','fax','sms','length','StatusTime','toNumber','format','Status','chatCapacity','mailCurrentCapacity','faxStatusTime','faxCurrentCapacity','smsCurrentCapacity','openchannelStatusTime','stringify','user:save','exports','lodash','md5','../../../config/environment','redis','socket.io-emitter','name','online','voicePause','chatPause'];(function(_0x97a2c4,_0x3de24e){var _0x2e1ddc=function(_0x3663b3){while(--_0x3663b3){_0x97a2c4['push'](_0x97a2c4['shift']());}};_0x2e1ddc(++_0x3de24e);}(_0x66d3,0x10f));var _0x366d=function(_0x1f5541,_0x28fc66){_0x1f5541=_0x1f5541-0x0;var _0x59e68d=_0x66d3[_0x1f5541];return _0x59e68d;};'use strict';var _=require(_0x366d('0x0'));var moment=require('moment');var md5=require(_0x366d('0x1'));var Redis=require('ioredis');var config=require(_0x366d('0x2'));config[_0x366d('0x3')]=_['defaults'](config[_0x366d('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x366d('0x4'))(new Redis(config['redis']));function Agent(_0x33a0c2){this['id']=_0x33a0c2['id']||0x0;this[_0x366d('0x5')]=_0x33a0c2[_0x366d('0x5')]||'';this[_0x366d('0x6')]=_0x33a0c2[_0x366d('0x6')]||!![];this[_0x366d('0x7')]=_0x33a0c2[_0x366d('0x7')]||![];this[_0x366d('0x8')]=_0x33a0c2[_0x366d('0x8')]||![];this[_0x366d('0x9')]=_0x33a0c2[_0x366d('0x9')]||![];this['faxPause']=_0x33a0c2[_0x366d('0xa')]||![];this[_0x366d('0xb')]=_0x33a0c2[_0x366d('0xb')]||![];this[_0x366d('0xc')]=_0x33a0c2[_0x366d('0xc')]||![];this[_0x366d('0xd')]=_0x366d('0xe');this[_0x366d('0xf')]=0x0;this['chatCapacity']=_0x33a0c2['chatCapacity']||0x0;this[_0x366d('0x10')]=0x0;this[_0x366d('0x11')]=_0x366d('0xe');this[_0x366d('0x12')]=0x0;this[_0x366d('0x13')]=_0x33a0c2[_0x366d('0x13')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x366d('0x14')]=_0x366d('0xe');this['faxStatusTime']=0x0;this[_0x366d('0x15')]=_0x33a0c2[_0x366d('0x15')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x366d('0x16')]=_0x366d('0xe');this[_0x366d('0x17')]=0x0;this['smsCapacity']=_0x33a0c2[_0x366d('0x18')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x366d('0x19')]=_0x366d('0xe');this['whatsappStatusTime']=0x0;this[_0x366d('0x1a')]=_0x33a0c2[_0x366d('0x1a')]||0x0;this[_0x366d('0x1b')]=0x0;this[_0x366d('0x1c')]=_0x366d('0xe');this['openchannelStatusTime']=0x0;this[_0x366d('0x1d')]=_0x33a0c2['openchannelCapacity']||0x0;this[_0x366d('0x1e')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x366d('0x1')]='';this[_0x366d('0x1f')]();}Agent['prototype'][_0x366d('0x20')]=function(_0x37ec6d){if(this[_0x37ec6d+_0x366d('0x21')]>0x0){if(this[_0x37ec6d+_0x366d('0x22')]>0x0&&this[_0x37ec6d+_0x366d('0x21')]>=this[_0x37ec6d+_0x366d('0x22')]){return'maxcapacity';}else{return _0x366d('0x23');}}else{return _0x366d('0x24');}};Agent[_0x366d('0x25')][_0x366d('0x1f')]=function(){var _0x46bf52=['mail',_0x366d('0x26'),_0x366d('0x27'),_0x366d('0x28'),_0x366d('0x29'),'whatsapp'];for(var _0x5aec17=0x0;_0x5aec17<_0x46bf52[_0x366d('0x2a')];_0x5aec17+=0x1){var _0x40f3df=this['getChannelStatus'](_0x46bf52[_0x5aec17]);if(this[_0x46bf52[_0x5aec17]+'Status']!==_0x40f3df){this[_0x46bf52[_0x5aec17]+_0x366d('0x2b')]=_[_0x366d('0x2c')](moment()[_0x366d('0x2d')]('x'));}this[_0x46bf52[_0x5aec17]+_0x366d('0x2e')]=_0x40f3df;}var _0x552c86={'id':this['id'],'name':this[_0x366d('0x5')],'online':this['online'],'voicePause':this[_0x366d('0x7')],'chatPause':this[_0x366d('0x8')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0x366d('0xa')],'openchannelPause':this[_0x366d('0xc')],'chatStatus':this[_0x366d('0xd')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x366d('0x2f')],'chatCurrentCapacity':this[_0x366d('0x10')],'mailStatus':this[_0x366d('0x11')],'mailStatusTime':this[_0x366d('0x12')],'mailCapacity':this[_0x366d('0x13')],'mailCurrentCapacity':this[_0x366d('0x30')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x366d('0x31')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x366d('0x32')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x366d('0x17')],'smsCapacity':this[_0x366d('0x18')],'smsCurrentCapacity':this[_0x366d('0x33')],'whatsappStatus':this[_0x366d('0x19')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x366d('0x1a')],'whatsappCurrentCapacity':this[_0x366d('0x1b')],'openchannelStatus':this[_0x366d('0x1c')],'openchannelStatusTime':this[_0x366d('0x34')],'openchannelCapacity':this[_0x366d('0x1d')],'openchannelCurrentCapacity':this[_0x366d('0x1e')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0xb1797=md5(JSON[_0x366d('0x35')](_0x552c86));if(this[_0x366d('0x1')]!==_0xb1797){this[_0x366d('0x1')]=_0xb1797;io['emit'](_0x366d('0x36'),_0x552c86);}};module[_0x366d('0x37')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 794b3ef..72aefea 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 _0xa84a=['stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','chatPause','available'];(function(_0x3414d0,_0x4c5265){var _0x10ac00=function(_0x194380){while(--_0x194380){_0x3414d0['push'](_0x3414d0['shift']());}};_0x10ac00(++_0x4c5265);}(_0xa84a,0x15b));var _0xaa84=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xa84a[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0xaa84('0x0'));var md5=require(_0xaa84('0x1'));var util=require(_0xaa84('0x2'));var Redis=require(_0xaa84('0x3'));var config=require(_0xaa84('0x4'));config[_0xaa84('0x5')]=_['defaults'](config[_0xaa84('0x5')],{'host':_0xaa84('0x6'),'port':0x18eb});var io=require(_0xaa84('0x7'))(new Redis(config[_0xaa84('0x5')]));function ChatQueue(_0x730b3f){this['id']=_0x730b3f['id']||0x0;this['name']=_0x730b3f[_0xaa84('0x8')]||'';this[_0xaa84('0x9')]=_0x730b3f[_0xaa84('0x9')]||0xa;this[_0xaa84('0xa')]=_0x730b3f['strategy']||'beepall';this[_0xaa84('0xb')]=_0x730b3f[_0xaa84('0xb')];this[_0xaa84('0xc')]={};this[_0xaa84('0xd')]=0x0;this['md5']='';this[_0xaa84('0xe')]();this[_0xaa84('0xf')]();}ChatQueue[_0xaa84('0x10')][_0xaa84('0xe')]=function(){var _0x1a4d9e=this[_0xaa84('0xc')][_0xaa84('0x11')];this[_0xaa84('0xc')]=_[_0xaa84('0x12')](this[_0xaa84('0xb')],'id');this['mapAgentsId'][_0xaa84('0x11')]=_0x1a4d9e;};ChatQueue[_0xaa84('0x10')][_0xaa84('0xf')]=function(){this[_0xaa84('0x13')]=0x0;this[_0xaa84('0x14')]=0x0;for(var _0x225f97=0x0;_0x225f97=0x0?this[_0xaa84('0x18')]:0x0;var _0x2ed8a3={'id':this['id'],'available':this[_0xaa84('0x18')],'loggedIn':this[_0xaa84('0x13')],'name':this[_0xaa84('0x8')],'paused':this[_0xaa84('0x14')],'waiting':this['waiting']};var _0x527d9f=md5(JSON[_0xaa84('0x19')](_0x2ed8a3));if(this['md5']!==_0x527d9f){this[_0xaa84('0x1')]=_0x527d9f;io['to'](util[_0xaa84('0x1a')](_0xaa84('0x1b'),_0x2ed8a3[_0xaa84('0x8')]))[_0xaa84('0x1c')](_0xaa84('0x1d'),_0x2ed8a3);}};module[_0xaa84('0x1e')]=ChatQueue; \ No newline at end of file +var _0x08e0=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','online','paused','available','stringify','format','chat:queue:%s','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x08e0,0x66));var _0x008e=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0x08e0[_0x680821];return _0x3f132c;};'use strict';var _=require('lodash');var md5=require(_0x008e('0x0'));var util=require(_0x008e('0x1'));var Redis=require(_0x008e('0x2'));var config=require(_0x008e('0x3'));config[_0x008e('0x4')]=_[_0x008e('0x5')](config['redis'],{'host':_0x008e('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x008e('0x4')]));function ChatQueue(_0x3cfec3){this['id']=_0x3cfec3['id']||0x0;this[_0x008e('0x7')]=_0x3cfec3[_0x008e('0x7')]||'';this[_0x008e('0x8')]=_0x3cfec3['timeout']||0xa;this[_0x008e('0x9')]=_0x3cfec3[_0x008e('0x9')]||_0x008e('0xa');this[_0x008e('0xb')]=_0x3cfec3[_0x008e('0xb')];this[_0x008e('0xc')]={};this[_0x008e('0xd')]=0x0;this[_0x008e('0x0')]='';this[_0x008e('0xe')]();this[_0x008e('0xf')]();}ChatQueue[_0x008e('0x10')]['updateRouting']=function(){var _0x19b72c=this[_0x008e('0xc')][_0x008e('0x11')];this[_0x008e('0xc')]=_[_0x008e('0x12')](this[_0x008e('0xb')],'id');this[_0x008e('0xc')]['_rr']=_0x19b72c;};ChatQueue[_0x008e('0x10')]['updateRealtime']=function(){this[_0x008e('0x13')]=0x0;this['paused']=0x0;for(var _0x5bd219=0x0;_0x5bd219=0x0?this['available']:0x0;var _0x31b655={'id':this['id'],'available':this['available'],'loggedIn':this[_0x008e('0x13')],'name':this['name'],'paused':this[_0x008e('0x15')],'waiting':this[_0x008e('0xd')]};var _0x1da3e5=md5(JSON[_0x008e('0x17')](_0x31b655));if(this[_0x008e('0x0')]!==_0x1da3e5){this['md5']=_0x1da3e5;io['to'](util[_0x008e('0x18')](_0x008e('0x19'),_0x31b655['name']))['emit'](_0x008e('0x1a'),_0x31b655);}};module[_0x008e('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 7ee71e7..516a67a 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(_0x3d1adc,_0x397a0d){var _0x4d6eaa=function(_0x4ff818){while(--_0x4ff818){_0x3d1adc['push'](_0x3d1adc['shift']());}};_0x4d6eaa(++_0x397a0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0xd582ac,_0x4c28f3){var _0x52d5fc=function(_0x4e32d1){while(--_0x4e32d1){_0xd582ac['push'](_0xd582ac['shift']());}};_0x52d5fc(++_0x4c28f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 d60e54b..96e79d3 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 _0x1ebe=['name','Intervals','exports'];(function(_0x8c8176,_0x5360a1){var _0x4dc47b=function(_0x1a7f65){while(--_0x1a7f65){_0x8c8176['push'](_0x8c8176['shift']());}};_0x4dc47b(++_0x5360a1);}(_0x1ebe,0x1e6));var _0xe1eb=function(_0x2cf966,_0x5cb664){_0x2cf966=_0x2cf966-0x0;var _0x6c35b4=_0x1ebe[_0x2cf966];return _0x6c35b4;};'use strict';function Interval(_0x4cf89a){this['id']=_0x4cf89a['id']||0x0;this[_0xe1eb('0x0')]=_0x4cf89a[_0xe1eb('0x0')]||'';this[_0xe1eb('0x1')]=_0x4cf89a[_0xe1eb('0x1')]||{};}module[_0xe1eb('0x2')]=Interval; \ No newline at end of file +var _0xf9fa=['name','Intervals','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf9fa,0x1b6));var _0xaf9f=function(_0x5d395d,_0x5b35da){_0x5d395d=_0x5d395d-0x0;var _0x290fad=_0xf9fa[_0x5d395d];return _0x290fad;};'use strict';function Interval(_0x2f7a1b){this['id']=_0x2f7a1b['id']||0x0;this[_0xaf9f('0x0')]=_0x2f7a1b[_0xaf9f('0x0')]||'';this[_0xaf9f('0x1')]=_0x2f7a1b[_0xaf9f('0x1')]||{};}module[_0xaf9f('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 4dd6b13..a8303f8 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 _0x6c79=['_rr','map','updateRealtime','loggedIn','paused','available','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting'];(function(_0x5d5011,_0x23f8f4){var _0x23c817=function(_0x15cb26){while(--_0x15cb26){_0x5d5011['push'](_0x5d5011['shift']());}};_0x23c817(++_0x23f8f4);}(_0x6c79,0x184));var _0x96c7=function(_0x112929,_0x7da466){_0x112929=_0x112929-0x0;var _0x333c16=_0x6c79[_0x112929];return _0x333c16;};'use strict';var _=require(_0x96c7('0x0'));var md5=require(_0x96c7('0x1'));var util=require(_0x96c7('0x2'));var Redis=require(_0x96c7('0x3'));var config=require(_0x96c7('0x4'));config['redis']=_[_0x96c7('0x5')](config['redis'],{'host':_0x96c7('0x6'),'port':0x18eb});var io=require(_0x96c7('0x7'))(new Redis(config[_0x96c7('0x8')]));function MailQueue(_0xc723cc){this['id']=_0xc723cc['id']||0x0;this[_0x96c7('0x9')]=_0xc723cc['name']||'';this[_0x96c7('0xa')]=_0xc723cc[_0x96c7('0xa')]||0xa;this[_0x96c7('0xb')]=_0xc723cc[_0x96c7('0xb')]||_0x96c7('0xc');this['Agents']=_0xc723cc[_0x96c7('0xd')];this[_0x96c7('0xe')]={};this[_0x96c7('0xf')]=0x0;this[_0x96c7('0x1')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x96c7('0x10')][_0x96c7('0x11')]=function(){var _0x53231d=this[_0x96c7('0xe')][_0x96c7('0x12')];this['mapAgentsId']=_[_0x96c7('0x13')](this[_0x96c7('0xd')],'id');this['mapAgentsId'][_0x96c7('0x12')]=_0x53231d;};MailQueue['prototype'][_0x96c7('0x14')]=function(){this[_0x96c7('0x15')]=0x0;this[_0x96c7('0x16')]=0x0;for(var _0x29ebe3=0x0;_0x29ebe3=0x0?this[_0x96c7('0x17')]:0x0;var _0x99a337={'id':this['id'],'available':this[_0x96c7('0x17')],'loggedIn':this[_0x96c7('0x15')],'name':this[_0x96c7('0x9')],'paused':this[_0x96c7('0x16')],'waiting':this[_0x96c7('0xf')]};var _0x1cbe0c=md5(JSON['stringify'](_0x99a337));if(this[_0x96c7('0x1')]!==_0x1cbe0c){this[_0x96c7('0x1')]=_0x1cbe0c;io['to'](util[_0x96c7('0x18')](_0x96c7('0x19'),_0x99a337['name']))[_0x96c7('0x1a')](_0x96c7('0x1b'),_0x99a337);}};module[_0x96c7('0x1c')]=MailQueue; \ No newline at end of file +var _0x3dda=['emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','_rr','mapAgentsId','prototype','loggedIn','paused','length','online','mailPause','available','stringify','format'];(function(_0x239220,_0x3f21d2){var _0x1151cd=function(_0x4077fb){while(--_0x4077fb){_0x239220['push'](_0x239220['shift']());}};_0x1151cd(++_0x3f21d2);}(_0x3dda,0x1a7));var _0xa3dd=function(_0x6bddc3,_0x36563e){_0x6bddc3=_0x6bddc3-0x0;var _0x868581=_0x3dda[_0x6bddc3];return _0x868581;};'use strict';var _=require(_0xa3dd('0x0'));var md5=require(_0xa3dd('0x1'));var util=require(_0xa3dd('0x2'));var Redis=require(_0xa3dd('0x3'));var config=require(_0xa3dd('0x4'));config[_0xa3dd('0x5')]=_[_0xa3dd('0x6')](config['redis'],{'host':_0xa3dd('0x7'),'port':0x18eb});var io=require(_0xa3dd('0x8'))(new Redis(config[_0xa3dd('0x5')]));function MailQueue(_0x350fa2){this['id']=_0x350fa2['id']||0x0;this['name']=_0x350fa2[_0xa3dd('0x9')]||'';this[_0xa3dd('0xa')]=_0x350fa2[_0xa3dd('0xa')]||0xa;this[_0xa3dd('0xb')]=_0x350fa2[_0xa3dd('0xb')]||_0xa3dd('0xc');this['Agents']=_0x350fa2[_0xa3dd('0xd')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xa3dd('0x1')]='';this[_0xa3dd('0xe')]();this[_0xa3dd('0xf')]();}MailQueue['prototype'][_0xa3dd('0xe')]=function(){var _0x10919e=this['mapAgentsId'][_0xa3dd('0x10')];this[_0xa3dd('0x11')]=_['map'](this[_0xa3dd('0xd')],'id');this[_0xa3dd('0x11')][_0xa3dd('0x10')]=_0x10919e;};MailQueue[_0xa3dd('0x12')][_0xa3dd('0xf')]=function(){this[_0xa3dd('0x13')]=0x0;this[_0xa3dd('0x14')]=0x0;for(var _0x1791ed=0x0;_0x1791ed=0x0?this['available']:0x0;var _0x3733ec={'id':this['id'],'available':this[_0xa3dd('0x18')],'loggedIn':this[_0xa3dd('0x13')],'name':this[_0xa3dd('0x9')],'paused':this[_0xa3dd('0x14')],'waiting':this['waiting']};var _0x86eae0=md5(JSON[_0xa3dd('0x19')](_0x3733ec));if(this[_0xa3dd('0x1')]!==_0x86eae0){this['md5']=_0x86eae0;io['to'](util[_0xa3dd('0x1a')]('mail:queue:%s',_0x3733ec[_0xa3dd('0x9')]))[_0xa3dd('0x1b')](_0xa3dd('0x1c'),_0x3733ec);}};module[_0xa3dd('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 2f3de1c..11b0c02 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 _0x7722=['emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','strategy','Agents','waiting','updateRouting','mapAgentsId','_rr','prototype','loggedIn','length','online','openchannelPause','paused','available','stringify'];(function(_0x251bdf,_0x29f5b3){var _0x1cf087=function(_0x5749e1){while(--_0x5749e1){_0x251bdf['push'](_0x251bdf['shift']());}};_0x1cf087(++_0x29f5b3);}(_0x7722,0x67));var _0x2772=function(_0x1a87cd,_0x2a244f){_0x1a87cd=_0x1a87cd-0x0;var _0x4af60e=_0x7722[_0x1a87cd];return _0x4af60e;};'use strict';var _=require(_0x2772('0x0'));var md5=require(_0x2772('0x1'));var util=require('util');var Redis=require(_0x2772('0x2'));var config=require(_0x2772('0x3'));config['redis']=_['defaults'](config['redis'],{'host':_0x2772('0x4'),'port':0x18eb});var io=require(_0x2772('0x5'))(new Redis(config[_0x2772('0x6')]));function OpenchannelQueue(_0x3e75e8){this['id']=_0x3e75e8['id']||0x0;this[_0x2772('0x7')]=_0x3e75e8[_0x2772('0x7')]||'';this['timeout']=_0x3e75e8['timeout']||0xa;this[_0x2772('0x8')]=_0x3e75e8['strategy']||'beepall';this[_0x2772('0x9')]=_0x3e75e8[_0x2772('0x9')];this['mapAgentsId']={};this[_0x2772('0xa')]=0x0;this[_0x2772('0x1')]='';this[_0x2772('0xb')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x2772('0xb')]=function(){var _0xc71915=this[_0x2772('0xc')][_0x2772('0xd')];this['mapAgentsId']=_['map'](this['Agents'],'id');this['mapAgentsId'][_0x2772('0xd')]=_0xc71915;};OpenchannelQueue[_0x2772('0xe')]['updateRealtime']=function(){this[_0x2772('0xf')]=0x0;this['paused']=0x0;for(var _0x56bc3b=0x0;_0x56bc3b=0x0?this[_0x2772('0x14')]:0x0;var _0x2dbd71={'id':this['id'],'available':this[_0x2772('0x14')],'loggedIn':this[_0x2772('0xf')],'name':this[_0x2772('0x7')],'paused':this[_0x2772('0x13')],'waiting':this[_0x2772('0xa')]};var _0x189d0d=md5(JSON[_0x2772('0x15')](_0x2dbd71));if(this['md5']!==_0x189d0d){this[_0x2772('0x1')]=_0x189d0d;io['to'](util['format']('openchannel:queue:%s',_0x2dbd71['name']))[_0x2772('0x16')](_0x2772('0x17'),_0x2dbd71);}};module[_0x2772('0x18')]=OpenchannelQueue; \ No newline at end of file +var _0x43ea=['emit','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','openchannelPause','paused','available','stringify','format','openchannel:queue:%s'];(function(_0x1ccb95,_0x1b3be8){var _0x1a9725=function(_0x1a6bf7){while(--_0x1a6bf7){_0x1ccb95['push'](_0x1ccb95['shift']());}};_0x1a9725(++_0x1b3be8);}(_0x43ea,0x189));var _0xa43e=function(_0x14cbd5,_0x14f59e){_0x14cbd5=_0x14cbd5-0x0;var _0x50f998=_0x43ea[_0x14cbd5];return _0x50f998;};'use strict';var _=require(_0xa43e('0x0'));var md5=require(_0xa43e('0x1'));var util=require(_0xa43e('0x2'));var Redis=require(_0xa43e('0x3'));var config=require(_0xa43e('0x4'));config[_0xa43e('0x5')]=_[_0xa43e('0x6')](config[_0xa43e('0x5')],{'host':_0xa43e('0x7'),'port':0x18eb});var io=require(_0xa43e('0x8'))(new Redis(config[_0xa43e('0x5')]));function OpenchannelQueue(_0x33851c){this['id']=_0x33851c['id']||0x0;this[_0xa43e('0x9')]=_0x33851c[_0xa43e('0x9')]||'';this[_0xa43e('0xa')]=_0x33851c[_0xa43e('0xa')]||0xa;this[_0xa43e('0xb')]=_0x33851c['strategy']||_0xa43e('0xc');this['Agents']=_0x33851c[_0xa43e('0xd')];this['mapAgentsId']={};this[_0xa43e('0xe')]=0x0;this[_0xa43e('0x1')]='';this[_0xa43e('0xf')]();this[_0xa43e('0x10')]();}OpenchannelQueue[_0xa43e('0x11')]['updateRouting']=function(){var _0xaec412=this[_0xa43e('0x12')][_0xa43e('0x13')];this[_0xa43e('0x12')]=_['map'](this['Agents'],'id');this[_0xa43e('0x12')][_0xa43e('0x13')]=_0xaec412;};OpenchannelQueue[_0xa43e('0x11')][_0xa43e('0x10')]=function(){this[_0xa43e('0x14')]=0x0;this['paused']=0x0;for(var _0x1e969d=0x0;_0x1e969d=0x0?this[_0xa43e('0x17')]:0x0;var _0x38040b={'id':this['id'],'available':this[_0xa43e('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xa43e('0x9')],'paused':this[_0xa43e('0x16')],'waiting':this[_0xa43e('0xe')]};var _0x130a43=md5(JSON[_0xa43e('0x18')](_0x38040b));if(this[_0xa43e('0x1')]!==_0x130a43){this[_0xa43e('0x1')]=_0x130a43;io['to'](util[_0xa43e('0x19')](_0xa43e('0x1a'),_0x38040b[_0xa43e('0x9')]))[_0xa43e('0x1b')](_0xa43e('0x1c'),_0x38040b);}};module[_0xa43e('0x1d')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index c03914a..86eff10 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(_0x3cdcaa,_0x2ae868){var _0x621ff7=function(_0x117124){while(--_0x117124){_0x3cdcaa['push'](_0x3cdcaa['shift']());}};_0x621ff7(++_0x2ae868);}(_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(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0xb10b,0x12a));var _0xbb10=function(_0x355de0,_0x3e1d21){_0x355de0=_0x355de0-0x0;var _0xad0de2=_0xb10b[_0x355de0];return _0xad0de2;};'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/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index aae6d5d..cacdf2e 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf03d=['beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','whatsappPause','available','waiting','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','timeout','strategy'];(function(_0xc2a990,_0x2c3741){var _0x3f8b2f=function(_0x469910){while(--_0x469910){_0xc2a990['push'](_0xc2a990['shift']());}};_0x3f8b2f(++_0x2c3741);}(_0xf03d,0x1f4));var _0xdf03=function(_0x28eeb5,_0x5aca76){_0x28eeb5=_0x28eeb5-0x0;var _0x7fd68b=_0xf03d[_0x28eeb5];return _0x7fd68b;};'use strict';var _=require(_0xdf03('0x0'));var md5=require(_0xdf03('0x1'));var util=require('util');var Redis=require(_0xdf03('0x2'));var config=require(_0xdf03('0x3'));config['redis']=_['defaults'](config['redis'],{'host':_0xdf03('0x4'),'port':0x18eb});var io=require(_0xdf03('0x5'))(new Redis(config[_0xdf03('0x6')]));function WhatsappQueue(_0x5820de){this['id']=_0x5820de['id']||0x0;this['name']=_0x5820de[_0xdf03('0x7')]||'';this[_0xdf03('0x8')]=_0x5820de[_0xdf03('0x8')]||0xa;this[_0xdf03('0x9')]=_0x5820de['strategy']||_0xdf03('0xa');this[_0xdf03('0xb')]=_0x5820de['Agents'];this[_0xdf03('0xc')]={};this['waiting']=0x0;this[_0xdf03('0x1')]='';this[_0xdf03('0xd')]();this[_0xdf03('0xe')]();}WhatsappQueue[_0xdf03('0xf')][_0xdf03('0xd')]=function(){var _0x6f8564=this[_0xdf03('0xc')]['_rr'];this[_0xdf03('0xc')]=_[_0xdf03('0x10')](this['Agents'],'id');this[_0xdf03('0xc')][_0xdf03('0x11')]=_0x6f8564;};WhatsappQueue[_0xdf03('0xf')]['updateRealtime']=function(){this[_0xdf03('0x12')]=0x0;this[_0xdf03('0x13')]=0x0;for(var _0x515b9f=0x0;_0x515b9f=0x0?this[_0xdf03('0x17')]:0x0;var _0x2b68af={'id':this['id'],'available':this[_0xdf03('0x17')],'loggedIn':this[_0xdf03('0x12')],'name':this[_0xdf03('0x7')],'paused':this[_0xdf03('0x13')],'waiting':this[_0xdf03('0x18')]};var _0x3b61f5=md5(JSON['stringify'](_0x2b68af));if(this['md5']!==_0x3b61f5){this['md5']=_0x3b61f5;io['to'](util[_0xdf03('0x19')](_0xdf03('0x1a'),_0x2b68af['name']))[_0xdf03('0x1b')](_0xdf03('0x1c'),_0x2b68af);}};module[_0xdf03('0x1d')]=WhatsappQueue; \ No newline at end of file +var _0x231d=['exports','lodash','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','whatsappPause','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x231d,0x1b1));var _0xd231=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x231d[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xd231('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xd231('0x1')]=_['defaults'](config[_0xd231('0x1')],{'host':_0xd231('0x2'),'port':0x18eb});var io=require(_0xd231('0x3'))(new Redis(config[_0xd231('0x1')]));function WhatsappQueue(_0x380543){this['id']=_0x380543['id']||0x0;this[_0xd231('0x4')]=_0x380543['name']||'';this[_0xd231('0x5')]=_0x380543['timeout']||0xa;this['strategy']=_0x380543[_0xd231('0x6')]||_0xd231('0x7');this[_0xd231('0x8')]=_0x380543[_0xd231('0x8')];this[_0xd231('0x9')]={};this[_0xd231('0xa')]=0x0;this[_0xd231('0xb')]='';this[_0xd231('0xc')]();this[_0xd231('0xd')]();}WhatsappQueue[_0xd231('0xe')][_0xd231('0xc')]=function(){var _0x106f88=this[_0xd231('0x9')][_0xd231('0xf')];this[_0xd231('0x9')]=_['map'](this[_0xd231('0x8')],'id');this[_0xd231('0x9')][_0xd231('0xf')]=_0x106f88;};WhatsappQueue['prototype'][_0xd231('0xd')]=function(){this[_0xd231('0x10')]=0x0;this[_0xd231('0x11')]=0x0;for(var _0x372f62=0x0;_0x372f62=0x0?this[_0xd231('0x15')]:0x0;var _0xfcd30c={'id':this['id'],'available':this[_0xd231('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xd231('0x11')],'waiting':this[_0xd231('0xa')]};var _0x4d1f93=md5(JSON[_0xd231('0x16')](_0xfcd30c));if(this[_0xd231('0xb')]!==_0x4d1f93){this['md5']=_0x4d1f93;io['to'](util['format'](_0xd231('0x17'),_0xfcd30c[_0xd231('0x4')]))[_0xd231('0x18')](_0xd231('0x19'),_0xfcd30c);}};module[_0xd231('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index f6acfdd..a975e71 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 _0x6aa7=['agents','openchannelQueues','chatQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','mapKeys','prototype','mergeFromDatabase','initAgents','length','intervals','isUndefined','updateRealtime','initChatQueues','updateRouting','initMailQueues','mailQueues','initWhatsappQueues','bluebird','lodash','moment','../model/agent','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x6aa7,0x178));var _0x76aa=function(_0xbff7a7,_0x27d768){_0xbff7a7=_0xbff7a7-0x0;var _0x3ab379=_0x6aa7[_0xbff7a7];return _0x3ab379;};'use strict';var BPromise=require(_0x76aa('0x0'));var util=require('util');var _=require(_0x76aa('0x1'));var moment=require(_0x76aa('0x2'));var Agent=require(_0x76aa('0x3'));var Interval=require(_0x76aa('0x4'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x76aa('0x5'));var SmsQueue=require(_0x76aa('0x6'));var MailQueue=require(_0x76aa('0x7'));var FaxQueue=require('../model/faxQueue');var WhatsappQueue=require('../model/whatsappQueue');var Realtime=function(){this[_0x76aa('0x8')]={};this['intervals']={};this[_0x76aa('0x9')]={};this[_0x76aa('0xa')]={};this[_0x76aa('0xb')]={};this['mailQueues']={};this[_0x76aa('0xc')]={};this[_0x76aa('0xd')]={};this[_0x76aa('0xe')]={};this['mailQueuesWaitingInteractions']={};this[_0x76aa('0xf')]={};this[_0x76aa('0x10')]={};this[_0x76aa('0x11')]={};this[_0x76aa('0x12')]={};};function freeIsNotKey(_0x37f1ab,_0x128435,_0x2c5075){var _0x8dc35c=_[_0x76aa('0x13')](_0x37f1ab,function(_0x17a417,_0x5e5f47){return _0x17a417[_0x2c5075];});for(var _0x112c39 in _0x128435){if(_0x128435['hasOwnProperty'](_0x112c39)){if(!_0x8dc35c[_0x112c39]){delete _0x128435[_0x112c39];}}}}Realtime[_0x76aa('0x14')][_0x76aa('0x15')]=function(_0x3f8f6b,_0x8e44ed){for(var _0x10432c in _0x8e44ed){if(_0x3f8f6b['hasOwnProperty'](_0x10432c)){_0x3f8f6b[_0x10432c]=_0x8e44ed[_0x10432c];}}};Realtime['prototype'][_0x76aa('0x16')]=function(){var _0x4cfc34=this;return function(_0x180d92){if(_0x180d92){freeIsNotKey(_0x180d92,_0x4cfc34[_0x76aa('0x8')],'id');for(var _0x5cf594=0x0,_0x2111c7={},_0x550d9a={};_0x5cf594<_0x180d92[_0x76aa('0x17')];_0x5cf594+=0x1){_0x2111c7=_0x180d92[_0x5cf594];if(_['isUndefined'](_0x4cfc34[_0x76aa('0x8')][_0x2111c7['id']])){_0x4cfc34[_0x76aa('0x8')][_0x2111c7['id']]=new Agent(_0x2111c7);}else{_0x4cfc34[_0x76aa('0x15')](_0x4cfc34[_0x76aa('0x8')][_0x2111c7['id']],_0x2111c7);}}}return _0x4cfc34[_0x76aa('0x8')];};};Realtime[_0x76aa('0x14')]['initIntervals']=function(){var _0x5d6202=this;return function(_0x256636){if(_0x256636){freeIsNotKey(_0x256636,_0x5d6202[_0x76aa('0x18')],'id');for(var _0xf0711=0x0,_0x15b931={},_0x15109b={};_0xf0711<_0x256636[_0x76aa('0x17')];_0xf0711+=0x1){_0x15b931=_0x256636[_0xf0711];if(_[_0x76aa('0x19')](_0x5d6202[_0x76aa('0x18')][_0x15b931['id']])){_0x5d6202[_0x76aa('0x18')][_0x15b931['id']]=new Interval(_0x15b931);}else{_0x5d6202['mergeFromDatabase'](_0x5d6202[_0x76aa('0x18')][_0x15b931['id']],_0x15b931);}}}return _0x5d6202[_0x76aa('0x18')];};};Realtime[_0x76aa('0x14')]['initOpenchannelQueues']=function(){var _0x41463a=this;return function(_0x189cb6){if(_0x189cb6){freeIsNotKey(_0x189cb6,_0x41463a[_0x76aa('0x9')],'id');for(var _0x2bd2c6=0x0,_0x29c50c={},_0xc1044c={};_0x2bd2c6<_0x189cb6[_0x76aa('0x17')];_0x2bd2c6+=0x1){_0x29c50c=_0x189cb6[_0x2bd2c6];if(_[_0x76aa('0x19')](_0x41463a[_0x76aa('0x9')][_0x29c50c['id']])){_0x41463a[_0x76aa('0x9')][_0x29c50c['id']]=new OpenchannelQueue(_0x29c50c);}else{_0x41463a[_0x76aa('0x15')](_0x41463a[_0x76aa('0x9')][_0x29c50c['id']],_0x29c50c);}_0x41463a[_0x76aa('0x9')][_0x29c50c['id']]['updateRouting']();_0x41463a[_0x76aa('0x9')][_0x29c50c['id']][_0x76aa('0x1a')]();}}return _0x41463a[_0x76aa('0x9')];};};Realtime[_0x76aa('0x14')][_0x76aa('0x1b')]=function(){var _0x2f9316=this;return function(_0x25a803){if(_0x25a803){freeIsNotKey(_0x25a803,_0x2f9316[_0x76aa('0xa')],'id');for(var _0xd12a99=0x0,_0x1bdc3d={},_0x545b06={};_0xd12a99<_0x25a803[_0x76aa('0x17')];_0xd12a99+=0x1){_0x1bdc3d=_0x25a803[_0xd12a99];if(_['isUndefined'](_0x2f9316[_0x76aa('0xa')][_0x1bdc3d['id']])){_0x2f9316[_0x76aa('0xa')][_0x1bdc3d['id']]=new ChatQueue(_0x1bdc3d);}else{_0x2f9316[_0x76aa('0x15')](_0x2f9316[_0x76aa('0xa')][_0x1bdc3d['id']],_0x1bdc3d);}_0x2f9316[_0x76aa('0xa')][_0x1bdc3d['id']][_0x76aa('0x1c')]();_0x2f9316[_0x76aa('0xa')][_0x1bdc3d['id']][_0x76aa('0x1a')]();}}return _0x2f9316[_0x76aa('0xa')];};};Realtime[_0x76aa('0x14')]['initSmsQueues']=function(){var _0x430ad6=this;return function(_0x5532c7){if(_0x5532c7){freeIsNotKey(_0x5532c7,_0x430ad6[_0x76aa('0xb')],'id');for(var _0x928ccf=0x0,_0x458ac3={},_0x38ecd1={};_0x928ccf<_0x5532c7[_0x76aa('0x17')];_0x928ccf+=0x1){_0x458ac3=_0x5532c7[_0x928ccf];if(_['isUndefined'](_0x430ad6[_0x76aa('0xb')][_0x458ac3['id']])){_0x430ad6[_0x76aa('0xb')][_0x458ac3['id']]=new SmsQueue(_0x458ac3);}else{_0x430ad6['mergeFromDatabase'](_0x430ad6[_0x76aa('0xb')][_0x458ac3['id']],_0x458ac3);}_0x430ad6['smsQueues'][_0x458ac3['id']][_0x76aa('0x1c')]();_0x430ad6['smsQueues'][_0x458ac3['id']][_0x76aa('0x1a')]();}}return _0x430ad6['smsQueues'];};};Realtime['prototype'][_0x76aa('0x1d')]=function(){var _0x282c56=this;return function(_0x198fcb){if(_0x198fcb){freeIsNotKey(_0x198fcb,_0x282c56[_0x76aa('0x1e')],'id');for(var _0x595a0f=0x0,_0x592596={},_0xdb18d3={};_0x595a0f<_0x198fcb[_0x76aa('0x17')];_0x595a0f+=0x1){_0x592596=_0x198fcb[_0x595a0f];if(_[_0x76aa('0x19')](_0x282c56[_0x76aa('0x1e')][_0x592596['id']])){_0x282c56[_0x76aa('0x1e')][_0x592596['id']]=new MailQueue(_0x592596);}else{_0x282c56['mergeFromDatabase'](_0x282c56[_0x76aa('0x1e')][_0x592596['id']],_0x592596);}_0x282c56['mailQueues'][_0x592596['id']]['updateRouting']();_0x282c56[_0x76aa('0x1e')][_0x592596['id']][_0x76aa('0x1a')]();}}return _0x282c56[_0x76aa('0x1e')];};};Realtime[_0x76aa('0x14')]['initFaxQueues']=function(){var _0x401c07=this;return function(_0x1c22f7){if(_0x1c22f7){freeIsNotKey(_0x1c22f7,_0x401c07[_0x76aa('0xc')],'id');for(var _0x4e131a=0x0,_0x113770={},_0x1638db={};_0x4e131a<_0x1c22f7[_0x76aa('0x17')];_0x4e131a+=0x1){_0x113770=_0x1c22f7[_0x4e131a];if(_[_0x76aa('0x19')](_0x401c07[_0x76aa('0xc')][_0x113770['id']])){_0x401c07[_0x76aa('0xc')][_0x113770['id']]=new FaxQueue(_0x113770);}else{_0x401c07[_0x76aa('0x15')](_0x401c07[_0x76aa('0xc')][_0x113770['id']],_0x113770);}_0x401c07[_0x76aa('0xc')][_0x113770['id']]['updateRouting']();_0x401c07[_0x76aa('0xc')][_0x113770['id']][_0x76aa('0x1a')]();}}return _0x401c07[_0x76aa('0xc')];};};Realtime[_0x76aa('0x14')][_0x76aa('0x1f')]=function(){var _0x2957aa=this;return function(_0x572fdb){if(_0x572fdb){freeIsNotKey(_0x572fdb,_0x2957aa['whatsappQueues'],'id');for(var _0x153a47=0x0,_0x262906={},_0x426454={};_0x153a47<_0x572fdb[_0x76aa('0x17')];_0x153a47+=0x1){_0x262906=_0x572fdb[_0x153a47];if(_['isUndefined'](_0x2957aa[_0x76aa('0xd')][_0x262906['id']])){_0x2957aa[_0x76aa('0xd')][_0x262906['id']]=new WhatsappQueue(_0x262906);}else{_0x2957aa[_0x76aa('0x15')](_0x2957aa[_0x76aa('0xd')][_0x262906['id']],_0x262906);}_0x2957aa[_0x76aa('0xd')][_0x262906['id']]['updateRouting']();_0x2957aa[_0x76aa('0xd')][_0x262906['id']]['updateRealtime']();}}return _0x2957aa[_0x76aa('0xd')];};};module['exports']=Realtime; \ No newline at end of file +var _0x55ca=['initAgents','length','isUndefined','mergeFromDatabase','initIntervals','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','chatQueues','initSmsQueues','initFaxQueues','faxQueues','exports','bluebird','util','../model/interval','../model/openchannelQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','agents','intervals','openchannelQueues','smsQueues','mailQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','mapKeys','prototype','hasOwnProperty'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x55ca,0x126));var _0xa55c=function(_0x48b4a1,_0x3c2bf4){_0x48b4a1=_0x48b4a1-0x0;var _0x2df379=_0x55ca[_0x48b4a1];return _0x2df379;};'use strict';var BPromise=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0xa55c('0x2'));var OpenchannelQueue=require(_0xa55c('0x3'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0xa55c('0x4'));var MailQueue=require(_0xa55c('0x5'));var FaxQueue=require(_0xa55c('0x6'));var WhatsappQueue=require(_0xa55c('0x7'));var Realtime=function(){this[_0xa55c('0x8')]={};this[_0xa55c('0x9')]={};this[_0xa55c('0xa')]={};this['chatQueues']={};this[_0xa55c('0xb')]={};this[_0xa55c('0xc')]={};this['faxQueues']={};this[_0xa55c('0xd')]={};this[_0xa55c('0xe')]={};this['mailQueuesWaitingInteractions']={};this['openchannelQueuesWaitingInteractions']={};this[_0xa55c('0xf')]={};this[_0xa55c('0x10')]={};this[_0xa55c('0x11')]={};};function freeIsNotKey(_0x5d8e5a,_0x31646d,_0xe6d826){var _0x508342=_[_0xa55c('0x12')](_0x5d8e5a,function(_0x3998f7,_0x15eec8){return _0x3998f7[_0xe6d826];});for(var _0x5d47ff in _0x31646d){if(_0x31646d['hasOwnProperty'](_0x5d47ff)){if(!_0x508342[_0x5d47ff]){delete _0x31646d[_0x5d47ff];}}}}Realtime[_0xa55c('0x13')]['mergeFromDatabase']=function(_0x5a3672,_0x59ea8d){for(var _0x18ee85 in _0x59ea8d){if(_0x5a3672[_0xa55c('0x14')](_0x18ee85)){_0x5a3672[_0x18ee85]=_0x59ea8d[_0x18ee85];}}};Realtime[_0xa55c('0x13')][_0xa55c('0x15')]=function(){var _0x458480=this;return function(_0x247e77){if(_0x247e77){freeIsNotKey(_0x247e77,_0x458480['agents'],'id');for(var _0x3ccf65=0x0,_0x3dcf4f={},_0x25934f={};_0x3ccf65<_0x247e77[_0xa55c('0x16')];_0x3ccf65+=0x1){_0x3dcf4f=_0x247e77[_0x3ccf65];if(_[_0xa55c('0x17')](_0x458480[_0xa55c('0x8')][_0x3dcf4f['id']])){_0x458480[_0xa55c('0x8')][_0x3dcf4f['id']]=new Agent(_0x3dcf4f);}else{_0x458480[_0xa55c('0x18')](_0x458480[_0xa55c('0x8')][_0x3dcf4f['id']],_0x3dcf4f);}}}return _0x458480['agents'];};};Realtime[_0xa55c('0x13')][_0xa55c('0x19')]=function(){var _0x461284=this;return function(_0x358b61){if(_0x358b61){freeIsNotKey(_0x358b61,_0x461284[_0xa55c('0x9')],'id');for(var _0x5426e5=0x0,_0x4c0daf={},_0x5f5158={};_0x5426e5<_0x358b61[_0xa55c('0x16')];_0x5426e5+=0x1){_0x4c0daf=_0x358b61[_0x5426e5];if(_[_0xa55c('0x17')](_0x461284[_0xa55c('0x9')][_0x4c0daf['id']])){_0x461284['intervals'][_0x4c0daf['id']]=new Interval(_0x4c0daf);}else{_0x461284[_0xa55c('0x18')](_0x461284[_0xa55c('0x9')][_0x4c0daf['id']],_0x4c0daf);}}}return _0x461284['intervals'];};};Realtime[_0xa55c('0x13')][_0xa55c('0x1a')]=function(){var _0x940f28=this;return function(_0x1965f1){if(_0x1965f1){freeIsNotKey(_0x1965f1,_0x940f28[_0xa55c('0xa')],'id');for(var _0x49ed04=0x0,_0x1fc828={},_0x504c24={};_0x49ed04<_0x1965f1['length'];_0x49ed04+=0x1){_0x1fc828=_0x1965f1[_0x49ed04];if(_['isUndefined'](_0x940f28[_0xa55c('0xa')][_0x1fc828['id']])){_0x940f28['openchannelQueues'][_0x1fc828['id']]=new OpenchannelQueue(_0x1fc828);}else{_0x940f28[_0xa55c('0x18')](_0x940f28[_0xa55c('0xa')][_0x1fc828['id']],_0x1fc828);}_0x940f28[_0xa55c('0xa')][_0x1fc828['id']][_0xa55c('0x1b')]();_0x940f28[_0xa55c('0xa')][_0x1fc828['id']][_0xa55c('0x1c')]();}}return _0x940f28[_0xa55c('0xa')];};};Realtime[_0xa55c('0x13')][_0xa55c('0x1d')]=function(){var _0x3cd152=this;return function(_0x1273d7){if(_0x1273d7){freeIsNotKey(_0x1273d7,_0x3cd152['chatQueues'],'id');for(var _0x430d55=0x0,_0x28814f={},_0x1c9f6b={};_0x430d55<_0x1273d7[_0xa55c('0x16')];_0x430d55+=0x1){_0x28814f=_0x1273d7[_0x430d55];if(_['isUndefined'](_0x3cd152[_0xa55c('0x1e')][_0x28814f['id']])){_0x3cd152[_0xa55c('0x1e')][_0x28814f['id']]=new ChatQueue(_0x28814f);}else{_0x3cd152[_0xa55c('0x18')](_0x3cd152[_0xa55c('0x1e')][_0x28814f['id']],_0x28814f);}_0x3cd152[_0xa55c('0x1e')][_0x28814f['id']][_0xa55c('0x1b')]();_0x3cd152['chatQueues'][_0x28814f['id']][_0xa55c('0x1c')]();}}return _0x3cd152['chatQueues'];};};Realtime[_0xa55c('0x13')][_0xa55c('0x1f')]=function(){var _0x1cc53e=this;return function(_0x223813){if(_0x223813){freeIsNotKey(_0x223813,_0x1cc53e['smsQueues'],'id');for(var _0x3d28fb=0x0,_0x2096ae={},_0x331e58={};_0x3d28fb<_0x223813[_0xa55c('0x16')];_0x3d28fb+=0x1){_0x2096ae=_0x223813[_0x3d28fb];if(_[_0xa55c('0x17')](_0x1cc53e[_0xa55c('0xb')][_0x2096ae['id']])){_0x1cc53e[_0xa55c('0xb')][_0x2096ae['id']]=new SmsQueue(_0x2096ae);}else{_0x1cc53e[_0xa55c('0x18')](_0x1cc53e[_0xa55c('0xb')][_0x2096ae['id']],_0x2096ae);}_0x1cc53e[_0xa55c('0xb')][_0x2096ae['id']][_0xa55c('0x1b')]();_0x1cc53e['smsQueues'][_0x2096ae['id']]['updateRealtime']();}}return _0x1cc53e[_0xa55c('0xb')];};};Realtime[_0xa55c('0x13')]['initMailQueues']=function(){var _0x30fadd=this;return function(_0x2f0110){if(_0x2f0110){freeIsNotKey(_0x2f0110,_0x30fadd[_0xa55c('0xc')],'id');for(var _0x1839ac=0x0,_0x30d4f8={},_0x38ff96={};_0x1839ac<_0x2f0110[_0xa55c('0x16')];_0x1839ac+=0x1){_0x30d4f8=_0x2f0110[_0x1839ac];if(_[_0xa55c('0x17')](_0x30fadd[_0xa55c('0xc')][_0x30d4f8['id']])){_0x30fadd['mailQueues'][_0x30d4f8['id']]=new MailQueue(_0x30d4f8);}else{_0x30fadd['mergeFromDatabase'](_0x30fadd['mailQueues'][_0x30d4f8['id']],_0x30d4f8);}_0x30fadd[_0xa55c('0xc')][_0x30d4f8['id']][_0xa55c('0x1b')]();_0x30fadd[_0xa55c('0xc')][_0x30d4f8['id']]['updateRealtime']();}}return _0x30fadd[_0xa55c('0xc')];};};Realtime['prototype'][_0xa55c('0x20')]=function(){var _0x4ad813=this;return function(_0x18c6f1){if(_0x18c6f1){freeIsNotKey(_0x18c6f1,_0x4ad813[_0xa55c('0x21')],'id');for(var _0x3c0ec1=0x0,_0x4d3eb5={},_0x7c4a47={};_0x3c0ec1<_0x18c6f1[_0xa55c('0x16')];_0x3c0ec1+=0x1){_0x4d3eb5=_0x18c6f1[_0x3c0ec1];if(_['isUndefined'](_0x4ad813[_0xa55c('0x21')][_0x4d3eb5['id']])){_0x4ad813[_0xa55c('0x21')][_0x4d3eb5['id']]=new FaxQueue(_0x4d3eb5);}else{_0x4ad813['mergeFromDatabase'](_0x4ad813['faxQueues'][_0x4d3eb5['id']],_0x4d3eb5);}_0x4ad813[_0xa55c('0x21')][_0x4d3eb5['id']]['updateRouting']();_0x4ad813[_0xa55c('0x21')][_0x4d3eb5['id']][_0xa55c('0x1c')]();}}return _0x4ad813['faxQueues'];};};Realtime['prototype']['initWhatsappQueues']=function(){var _0x4de781=this;return function(_0x3b3308){if(_0x3b3308){freeIsNotKey(_0x3b3308,_0x4de781[_0xa55c('0xd')],'id');for(var _0x429336=0x0,_0x99c4f8={},_0x2d8cbf={};_0x429336<_0x3b3308['length'];_0x429336+=0x1){_0x99c4f8=_0x3b3308[_0x429336];if(_[_0xa55c('0x17')](_0x4de781[_0xa55c('0xd')][_0x99c4f8['id']])){_0x4de781[_0xa55c('0xd')][_0x99c4f8['id']]=new WhatsappQueue(_0x99c4f8);}else{_0x4de781[_0xa55c('0x18')](_0x4de781[_0xa55c('0xd')][_0x99c4f8['id']],_0x99c4f8);}_0x4de781[_0xa55c('0xd')][_0x99c4f8['id']]['updateRouting']();_0x4de781[_0xa55c('0xd')][_0x99c4f8['id']]['updateRealtime']();}}return _0x4de781['whatsappQueues'];};};module[_0xa55c('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 913849f..811d5af 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 _0x3aa4=['Request','../client','update','updateChatInteraction','addTags'];(function(_0x4ca40b,_0x531ba9){var _0x81cf70=function(_0xe26faa){while(--_0xe26faa){_0x4ca40b['push'](_0x4ca40b['shift']());}};_0x81cf70(++_0x531ba9);}(_0x3aa4,0xe2));var _0x43aa=function(_0x4d4c17,_0xb27e10){_0x4d4c17=_0x4d4c17-0x0;var _0x27018c=_0x3aa4[_0x4d4c17];return _0x27018c;};'use strict';var client=require(_0x43aa('0x0'));exports[_0x43aa('0x1')]=function(_0x42476b,_0x43c64c){return client['Request']('UpdateChatInteraction',{'body':_0x43c64c,'options':{'where':{'id':_0x42476b}},'log':_0x43aa('0x2')});};exports[_0x43aa('0x3')]=function(_0x3915f1,_0x5570a3){return client[_0x43aa('0x4')]('AddTagsToChatInteraction',{'body':_0x5570a3,'options':{'where':{'id':_0x3915f1}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x868d=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x868d,0xd2));var _0xd868=function(_0x334cc8,_0xeb25ff){_0x334cc8=_0x334cc8-0x0;var _0x4cf940=_0x868d[_0x334cc8];return _0x4cf940;};'use strict';var client=require(_0xd868('0x0'));exports[_0xd868('0x1')]=function(_0x425631,_0x3299f2){return client[_0xd868('0x2')](_0xd868('0x3'),{'body':_0x3299f2,'options':{'where':{'id':_0x425631}},'log':_0xd868('0x4')});};exports[_0xd868('0x5')]=function(_0x2a1da5,_0x578310){return client[_0xd868('0x2')](_0xd868('0x6'),{'body':_0x578310,'options':{'where':{'id':_0x2a1da5}},'log':_0xd868('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 9d62100..a6ab919 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 _0x66bc=['create','Request','CreateChatMessage','../client'];(function(_0x431ff8,_0x4085dd){var _0x84ccd4=function(_0x1fd1b5){while(--_0x1fd1b5){_0x431ff8['push'](_0x431ff8['shift']());}};_0x84ccd4(++_0x4085dd);}(_0x66bc,0x16b));var _0xc66b=function(_0x4d0416,_0x4f2bb6){_0x4d0416=_0x4d0416-0x0;var _0x173e01=_0x66bc[_0x4d0416];return _0x173e01;};'use strict';var client=require(_0xc66b('0x0'));exports[_0xc66b('0x1')]=function(_0x131def){return client[_0xc66b('0x2')](_0xc66b('0x3'),{'body':_0x131def,'log':'createChatMessage'});}; \ No newline at end of file +var _0x3bf3=['CreateChatMessage','../client','create','Request'];(function(_0x4b8817,_0x4ba882){var _0x306949=function(_0x4fd847){while(--_0x4fd847){_0x4b8817['push'](_0x4b8817['shift']());}};_0x306949(++_0x4ba882);}(_0x3bf3,0xd5));var _0x33bf=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0x3bf3[_0xf26c2e];return _0x46ecb4;};'use strict';var client=require(_0x33bf('0x0'));exports[_0x33bf('0x1')]=function(_0x3c7340){return client[_0x33bf('0x2')](_0x33bf('0x3'),{'body':_0x3c7340,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index efe10d6..5f62b16 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 _0x7b2c=['../client','getChatQueues','name','User','Agents'];(function(_0x3c995a,_0xa5c1c9){var _0x19afad=function(_0xca220d){while(--_0xca220d){_0x3c995a['push'](_0x3c995a['shift']());}};_0x19afad(++_0xa5c1c9);}(_0x7b2c,0x1ef));var _0xc7b2=function(_0x3e64b6,_0x490eee){_0x3e64b6=_0x3e64b6-0x0;var _0xc1fe54=_0x7b2c[_0x3e64b6];return _0xc1fe54;};'use strict';var client=require(_0xc7b2('0x0'));exports[_0xc7b2('0x1')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xc7b2('0x2'),'timeout','strategy'],'include':[{'model':_0xc7b2('0x3'),'as':_0xc7b2('0x4'),'attributes':['id',_0xc7b2('0x2'),'online','chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x2a41=['Request','GetChatQueue','timeout','User','chatPause','getChatQueues'];(function(_0x4f8457,_0x4175af){var _0x720f1d=function(_0x5d7541){while(--_0x5d7541){_0x4f8457['push'](_0x4f8457['shift']());}};_0x720f1d(++_0x4175af);}(_0x2a41,0xcb));var _0x12a4=function(_0x25b274,_0x578748){_0x25b274=_0x25b274-0x0;var _0x367046=_0x2a41[_0x25b274];return _0x367046;};'use strict';var client=require('../client');exports[_0x12a4('0x0')]=function(){return function(){return client[_0x12a4('0x1')](_0x12a4('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x12a4('0x3'),'strategy'],'include':[{'model':_0x12a4('0x4'),'as':'Agents','attributes':['id','name','online',_0x12a4('0x5')]}]},'log':_0x12a4('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 1384c9b..3940a89 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 _0x04d0=['UpdateChatQueueReport','Request','CreateChatQueueReport','update','DESC'];(function(_0x8f4c74,_0x3ff3d4){var _0x18d162=function(_0x583445){while(--_0x583445){_0x8f4c74['push'](_0x8f4c74['shift']());}};_0x18d162(++_0x3ff3d4);}(_0x04d0,0x10a));var _0x004d=function(_0x341797,_0x184ff3){_0x341797=_0x341797-0x0;var _0x322260=_0x04d0[_0x341797];return _0x322260;};'use strict';var client=require('../client');exports['create']=function(_0x3189a3){return client[_0x004d('0x0')](_0x004d('0x1'),{'body':_0x3189a3,'log':_0x004d('0x1')});};exports[_0x004d('0x2')]=function(_0x5f000c,_0x516d73){return client[_0x004d('0x0')]('UpdateChatQueueReport',{'body':_0x516d73,'options':{'where':{'uniqueid':_0x5f000c},'order':[['id',_0x004d('0x3')]],'limit':0x1},'log':_0x004d('0x4')});}; \ No newline at end of file +var _0x0851=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x0851,0x8a));var _0x1085=function(_0x39dae4,_0x58a305){_0x39dae4=_0x39dae4-0x0;var _0x39ab08=_0x0851[_0x39dae4];return _0x39ab08;};'use strict';var client=require(_0x1085('0x0'));exports[_0x1085('0x1')]=function(_0x219feb){return client[_0x1085('0x2')]('CreateChatQueueReport',{'body':_0x219feb,'log':_0x1085('0x3')});};exports[_0x1085('0x4')]=function(_0x2de96f,_0x3cbd88){return client[_0x1085('0x2')](_0x1085('0x5'),{'body':_0x3cbd88,'options':{'where':{'uniqueid':_0x2de96f},'order':[['id',_0x1085('0x6')]],'limit':0x1},'log':_0x1085('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 3e1b229..a6e726d 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 _0x8bb8=['addTagsToFaxInteraction','update','Request','AddTagsToFaxInteraction'];(function(_0x8c1f7c,_0x1e1ae3){var _0x483f44=function(_0x2b562a){while(--_0x2b562a){_0x8c1f7c['push'](_0x8c1f7c['shift']());}};_0x483f44(++_0x1e1ae3);}(_0x8bb8,0x115));var _0x88bb=function(_0x3251d0,_0x5279a8){_0x3251d0=_0x3251d0-0x0;var _0x47522b=_0x8bb8[_0x3251d0];return _0x47522b;};'use strict';var client=require('../client');exports[_0x88bb('0x0')]=function(_0x281b1d,_0x15af22){return client[_0x88bb('0x1')]('UpdateFaxInteraction',{'body':_0x15af22,'options':{'where':{'id':_0x281b1d}},'log':'updateFaxInteraction'});};exports['addTags']=function(_0x13b389,_0x40fe8b){return client[_0x88bb('0x1')](_0x88bb('0x2'),{'body':_0x40fe8b,'options':{'where':{'id':_0x13b389}},'log':_0x88bb('0x3')});}; \ No newline at end of file +var _0x74d2=['Request','UpdateFaxInteraction','updateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x2a12c1,_0x20dd3d){var _0xd296c4=function(_0x2e5e6e){while(--_0x2e5e6e){_0x2a12c1['push'](_0x2a12c1['shift']());}};_0xd296c4(++_0x20dd3d);}(_0x74d2,0xad));var _0x274d=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0x74d2[_0x1627ae];return _0x34b38f;};'use strict';var client=require(_0x274d('0x0'));exports[_0x274d('0x1')]=function(_0x15a341,_0x6b0677){return client[_0x274d('0x2')](_0x274d('0x3'),{'body':_0x6b0677,'options':{'where':{'id':_0x15a341}},'log':_0x274d('0x4')});};exports[_0x274d('0x5')]=function(_0x471860,_0x2016af){return client['Request'](_0x274d('0x6'),{'body':_0x2016af,'options':{'where':{'id':_0x471860}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index dc7c48f..bcb8e77 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 _0x716c=['../client','Request','CreateFaxMessage','createFaxMessage'];(function(_0x4dbf9e,_0x1cced2){var _0x44cf06=function(_0x25dcd2){while(--_0x25dcd2){_0x4dbf9e['push'](_0x4dbf9e['shift']());}};_0x44cf06(++_0x1cced2);}(_0x716c,0x144));var _0xc716=function(_0x239c17,_0x236b0f){_0x239c17=_0x239c17-0x0;var _0x13ae4d=_0x716c[_0x239c17];return _0x13ae4d;};'use strict';var client=require(_0xc716('0x0'));exports['create']=function(_0x1ce8ec){return client[_0xc716('0x1')](_0xc716('0x2'),{'body':_0x1ce8ec,'log':_0xc716('0x3')});}; \ No newline at end of file +var _0xc491=['createFaxMessage','../client','create','Request'];(function(_0xa11ec3,_0xf1e98a){var _0x298824=function(_0x3987ef){while(--_0x3987ef){_0xa11ec3['push'](_0xa11ec3['shift']());}};_0x298824(++_0xf1e98a);}(_0xc491,0x159));var _0x1c49=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0xc491[_0xf5d71c];return _0x5af672;};'use strict';var client=require(_0x1c49('0x0'));exports[_0x1c49('0x1')]=function(_0x190e99){return client[_0x1c49('0x2')]('CreateFaxMessage',{'body':_0x190e99,'log':_0x1c49('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 4b75c4b..ed65252 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 _0x7741=['name','strategy','User','online','faxPause','getFaxQueues','Request','GetFaxQueue'];(function(_0x10db36,_0x1d0aca){var _0x24357c=function(_0x192b20){while(--_0x192b20){_0x10db36['push'](_0x10db36['shift']());}};_0x24357c(++_0x1d0aca);}(_0x7741,0x75));var _0x1774=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7741[_0xa464c9];return _0x3d73c4;};'use strict';var client=require('../client');exports[_0x1774('0x0')]=function(){return function(){return client[_0x1774('0x1')](_0x1774('0x2'),{'options':{'raw':![],'attributes':['id',_0x1774('0x3'),'timeout',_0x1774('0x4')],'include':[{'model':_0x1774('0x5'),'as':'Agents','attributes':['id',_0x1774('0x3'),_0x1774('0x6'),_0x1774('0x7')]}]},'log':_0x1774('0x0')});};}; \ No newline at end of file +var _0x4567=['Request','GetFaxQueue','name','timeout','User','Agents','online','getFaxQueues'];(function(_0x9db6d3,_0x134781){var _0x527965=function(_0x2b411f){while(--_0x2b411f){_0x9db6d3['push'](_0x9db6d3['shift']());}};_0x527965(++_0x134781);}(_0x4567,0x137));var _0x7456=function(_0xa2ffa1,_0x58efc0){_0xa2ffa1=_0xa2ffa1-0x0;var _0x56a576=_0x4567[_0xa2ffa1];return _0x56a576;};'use strict';var client=require('../client');exports[_0x7456('0x0')]=function(){return function(){return client[_0x7456('0x1')](_0x7456('0x2'),{'options':{'raw':![],'attributes':['id',_0x7456('0x3'),_0x7456('0x4'),'strategy'],'include':[{'model':_0x7456('0x5'),'as':_0x7456('0x6'),'attributes':['id',_0x7456('0x3'),_0x7456('0x7'),'faxPause']}]},'log':_0x7456('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 568d542..8fca642 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 _0x0176=['CreateFaxQueueReport','UpdateFaxQueueReport','DESC','Request'];(function(_0x290c31,_0x534b8a){var _0x2eb0ac=function(_0x54bd7){while(--_0x54bd7){_0x290c31['push'](_0x290c31['shift']());}};_0x2eb0ac(++_0x534b8a);}(_0x0176,0x163));var _0x6017=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0176[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports['create']=function(_0x274cb1){return client[_0x6017('0x0')](_0x6017('0x1'),{'body':_0x274cb1,'log':_0x6017('0x1')});};exports['update']=function(_0x115a4d,_0x13bf0d){return client[_0x6017('0x0')](_0x6017('0x2'),{'body':_0x13bf0d,'options':{'where':{'uniqueid':_0x115a4d},'order':[['id',_0x6017('0x3')]],'limit':0x1},'log':_0x6017('0x2')});}; \ No newline at end of file +var _0xb8b3=['update','UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport'];(function(_0x39766e,_0x530368){var _0xfddd51=function(_0x20d1f9){while(--_0x20d1f9){_0x39766e['push'](_0x39766e['shift']());}};_0xfddd51(++_0x530368);}(_0xb8b3,0x1a0));var _0x3b8b=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0xb8b3[_0x2a9f4];return _0x3c39e0;};'use strict';var client=require(_0x3b8b('0x0'));exports[_0x3b8b('0x1')]=function(_0x18d043){return client[_0x3b8b('0x2')](_0x3b8b('0x3'),{'body':_0x18d043,'log':'CreateFaxQueueReport'});};exports[_0x3b8b('0x4')]=function(_0x44dc82,_0x5196cb){return client['Request'](_0x3b8b('0x5'),{'body':_0x5196cb,'options':{'where':{'uniqueid':_0x44dc82},'order':[['id',_0x3b8b('0x6')]],'limit':0x1},'log':_0x3b8b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 13821af..a6f0995 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 _0xccde=['getIntervals','../client','Request','name','Interval','interval'];(function(_0x1e3c02,_0x5c07a2){var _0x4d26d7=function(_0x367ed9){while(--_0x367ed9){_0x1e3c02['push'](_0x1e3c02['shift']());}};_0x4d26d7(++_0x5c07a2);}(_0xccde,0x1e1));var _0xeccd=function(_0x1a89ca,_0x27394b){_0x1a89ca=_0x1a89ca-0x0;var _0x29cbb2=_0xccde[_0x1a89ca];return _0x29cbb2;};'use strict';var client=require(_0xeccd('0x0'));exports['getIntervals']=function(){return function(){return client[_0xeccd('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xeccd('0x2')],'include':[{'model':_0xeccd('0x3'),'as':'Intervals','attributes':['id','name',_0xeccd('0x4')]}]},'log':_0xeccd('0x5')});};}; \ No newline at end of file +var _0x235a=['name','Intervals','interval','../client','getIntervals','Request'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x235a,0x1ef));var _0xa235=function(_0x1ec28b,_0x31ab59){_0x1ec28b=_0x1ec28b-0x0;var _0x2eac36=_0x235a[_0x1ec28b];return _0x2eac36;};'use strict';var client=require(_0xa235('0x0'));exports[_0xa235('0x1')]=function(){return function(){return client[_0xa235('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xa235('0x3')],'include':[{'model':'Interval','as':_0xa235('0x4'),'attributes':['id',_0xa235('0x3'),_0xa235('0x5')]}]},'log':_0xa235('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 0c8f45f..e8d7dde 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 _0x5d7d=['addTags','AddTagsToMailInteraction','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x431dc5,_0x297727){var _0x426629=function(_0x3098eb){while(--_0x3098eb){_0x431dc5['push'](_0x431dc5['shift']());}};_0x426629(++_0x297727);}(_0x5d7d,0xa7));var _0xd5d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d7d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['update']=function(_0x21241a,_0xc2d8cd){return client[_0xd5d7('0x0')](_0xd5d7('0x1'),{'body':_0xc2d8cd,'options':{'where':{'id':_0x21241a}},'log':_0xd5d7('0x2')});};exports[_0xd5d7('0x3')]=function(_0x5389a2,_0x35963c){return client[_0xd5d7('0x0')](_0xd5d7('0x4'),{'body':_0x35963c,'options':{'where':{'id':_0x5389a2}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x9c04=['addTagsToChatInteraction','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction'];(function(_0x2408ad,_0x15e41b){var _0xca0349=function(_0x3c0937){while(--_0x3c0937){_0x2408ad['push'](_0x2408ad['shift']());}};_0xca0349(++_0x15e41b);}(_0x9c04,0x100));var _0x49c0=function(_0x3213b7,_0x6789ca){_0x3213b7=_0x3213b7-0x0;var _0xb960bf=_0x9c04[_0x3213b7];return _0xb960bf;};'use strict';var client=require('../client');exports['update']=function(_0x2631be,_0xba1529){return client[_0x49c0('0x0')](_0x49c0('0x1'),{'body':_0xba1529,'options':{'where':{'id':_0x2631be}},'log':_0x49c0('0x2')});};exports['addTags']=function(_0x2bfc20,_0x1b97d5){return client['Request'](_0x49c0('0x3'),{'body':_0x1b97d5,'options':{'where':{'id':_0x2bfc20}},'log':_0x49c0('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 35bc640..ce6fce1 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 _0xf75d=['CreateMailMessage','../client','Request'];(function(_0xa1c9aa,_0xd8f1df){var _0x2deb01=function(_0x4eb25b){while(--_0x4eb25b){_0xa1c9aa['push'](_0xa1c9aa['shift']());}};_0x2deb01(++_0xd8f1df);}(_0xf75d,0x199));var _0xdf75=function(_0xe455e7,_0x29fb65){_0xe455e7=_0xe455e7-0x0;var _0xfc683e=_0xf75d[_0xe455e7];return _0xfc683e;};'use strict';var client=require(_0xdf75('0x0'));exports['create']=function(_0x2af174){return client[_0xdf75('0x1')](_0xdf75('0x2'),{'body':_0x2af174,'log':'createMailMessage'});}; \ No newline at end of file +var _0x58b3=['../client'];(function(_0x2c8c5e,_0x4f23ed){var _0x52408a=function(_0x3fc180){while(--_0x3fc180){_0x2c8c5e['push'](_0x2c8c5e['shift']());}};_0x52408a(++_0x4f23ed);}(_0x58b3,0xa1));var _0x358b=function(_0x31985c,_0x17812b){_0x31985c=_0x31985c-0x0;var _0x41eba2=_0x58b3[_0x31985c];return _0x41eba2;};'use strict';var client=require(_0x358b('0x0'));exports['create']=function(_0x3168f9){return client['Request']('CreateMailMessage',{'body':_0x3168f9,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 0cb5dcd..bc3b003 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 _0xae83=['name','timeout','User','Agents','mailPause','getMailQueues'];(function(_0x102b48,_0x1ffa36){var _0x1819c4=function(_0xc1c6dc){while(--_0xc1c6dc){_0x102b48['push'](_0x102b48['shift']());}};_0x1819c4(++_0x1ffa36);}(_0xae83,0x1f1));var _0x3ae8=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xae83[_0x19950b];return _0x3c6b41;};'use strict';var client=require('../client');exports[_0x3ae8('0x0')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x3ae8('0x1'),_0x3ae8('0x2'),'strategy'],'include':[{'model':_0x3ae8('0x3'),'as':_0x3ae8('0x4'),'attributes':['id',_0x3ae8('0x1'),'online',_0x3ae8('0x5')]}]},'log':_0x3ae8('0x0')});};}; \ No newline at end of file +var _0x2859=['online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','strategy','User'];(function(_0x4e21f1,_0x24e736){var _0x370ebe=function(_0x10d562){while(--_0x10d562){_0x4e21f1['push'](_0x4e21f1['shift']());}};_0x370ebe(++_0x24e736);}(_0x2859,0xe3));var _0x9285=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x2859[_0x49ca18];return _0x145d54;};'use strict';var client=require(_0x9285('0x0'));exports[_0x9285('0x1')]=function(){return function(){return client[_0x9285('0x2')](_0x9285('0x3'),{'options':{'raw':![],'attributes':['id',_0x9285('0x4'),'timeout',_0x9285('0x5')],'include':[{'model':_0x9285('0x6'),'as':'Agents','attributes':['id','name',_0x9285('0x7'),_0x9285('0x8')]}]},'log':_0x9285('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 4a72839..c67b29f 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 _0x1f0e=['DESC','../client','create','CreateMailQueueReport','update','Request','UpdateMailQueueReport'];(function(_0x57c26c,_0x5d067e){var _0x31df90=function(_0x1216bc){while(--_0x1216bc){_0x57c26c['push'](_0x57c26c['shift']());}};_0x31df90(++_0x5d067e);}(_0x1f0e,0xb7));var _0xe1f0=function(_0x2b1f79,_0x8cfab1){_0x2b1f79=_0x2b1f79-0x0;var _0x40079e=_0x1f0e[_0x2b1f79];return _0x40079e;};'use strict';var client=require(_0xe1f0('0x0'));exports[_0xe1f0('0x1')]=function(_0x460c1b){return client['Request'](_0xe1f0('0x2'),{'body':_0x460c1b,'log':_0xe1f0('0x2')});};exports[_0xe1f0('0x3')]=function(_0x5064f2,_0x4441c6){return client[_0xe1f0('0x4')](_0xe1f0('0x5'),{'body':_0x4441c6,'options':{'where':{'uniqueid':_0x5064f2},'order':[['id',_0xe1f0('0x6')]],'limit':0x1},'log':_0xe1f0('0x5')});}; \ No newline at end of file +var _0x1b49=['../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x1b49,0x1c0));var _0x91b4=function(_0xb1b7b,_0x13eaa0){_0xb1b7b=_0xb1b7b-0x0;var _0x339c3b=_0x1b49[_0xb1b7b];return _0x339c3b;};'use strict';var client=require(_0x91b4('0x0'));exports[_0x91b4('0x1')]=function(_0x4d3463){return client[_0x91b4('0x2')]('CreateMailQueueReport',{'body':_0x4d3463,'log':_0x91b4('0x3')});};exports[_0x91b4('0x4')]=function(_0x4129f6,_0x44968e){return client[_0x91b4('0x2')](_0x91b4('0x5'),{'body':_0x44968e,'options':{'where':{'uniqueid':_0x4129f6},'order':[['id',_0x91b4('0x6')]],'limit':0x1},'log':_0x91b4('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 467c25c..50e9bc1 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 _0xe785=['addTagsToChatInteraction','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xe785,0x197));var _0x5e78=function(_0x1c471b,_0xa2d18c){_0x1c471b=_0x1c471b-0x0;var _0x48656f=_0xe785[_0x1c471b];return _0x48656f;};'use strict';var client=require('../client');exports[_0x5e78('0x0')]=function(_0x4535d1,_0x590d10){return client['Request'](_0x5e78('0x1'),{'body':_0x590d10,'options':{'where':{'id':_0x4535d1}},'log':_0x5e78('0x2')});};exports[_0x5e78('0x3')]=function(_0x2e3af0,_0x4f3895){return client[_0x5e78('0x4')](_0x5e78('0x5'),{'body':_0x4f3895,'options':{'where':{'id':_0x2e3af0}},'log':_0x5e78('0x6')});}; \ No newline at end of file +var _0x6069=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x4591f2,_0xe4f302){var _0x3fe70e=function(_0x5580e0){while(--_0x5580e0){_0x4591f2['push'](_0x4591f2['shift']());}};_0x3fe70e(++_0xe4f302);}(_0x6069,0x66));var _0x9606=function(_0x481161,_0x1915cd){_0x481161=_0x481161-0x0;var _0x55a271=_0x6069[_0x481161];return _0x55a271;};'use strict';var client=require(_0x9606('0x0'));exports[_0x9606('0x1')]=function(_0x13a9cb,_0x194f54){return client[_0x9606('0x2')](_0x9606('0x3'),{'body':_0x194f54,'options':{'where':{'id':_0x13a9cb}},'log':_0x9606('0x4')});};exports[_0x9606('0x5')]=function(_0x246237,_0x564570){return client['Request'](_0x9606('0x6'),{'body':_0x564570,'options':{'where':{'id':_0x246237}},'log':_0x9606('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 9490fc7..ea9b1f6 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 _0xcb91=['CreateOpenchannelMessage','createOpenchannelMessage','Request'];(function(_0x4f6eb1,_0x144e49){var _0x1ea245=function(_0x199e64){while(--_0x199e64){_0x4f6eb1['push'](_0x4f6eb1['shift']());}};_0x1ea245(++_0x144e49);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xcb91[_0x609988];return _0x159984;};'use strict';var client=require('../client');exports['create']=function(_0x26fe42){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'body':_0x26fe42,'log':_0x1cb9('0x2')});}; \ No newline at end of file +var _0x34e8=['../client','create','Request','createOpenchannelMessage'];(function(_0x16450b,_0x3d76bd){var _0x1eec2c=function(_0x313d48){while(--_0x313d48){_0x16450b['push'](_0x16450b['shift']());}};_0x1eec2c(++_0x3d76bd);}(_0x34e8,0x12c));var _0x834e=function(_0x12f82a,_0x13cc8c){_0x12f82a=_0x12f82a-0x0;var _0x4627fc=_0x34e8[_0x12f82a];return _0x4627fc;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateOpenchannelMessage',{'body':_0x8b339,'log':_0x834e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 091ea75..aa67a77 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 _0x77e3=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','openchannelPause','../client'];(function(_0x193701,_0x271245){var _0x439b28=function(_0x4bd529){while(--_0x4bd529){_0x193701['push'](_0x193701['shift']());}};_0x439b28(++_0x271245);}(_0x77e3,0x1e9));var _0x377e=function(_0x51951b,_0x5d1a16){_0x51951b=_0x51951b-0x0;var _0x17dc1a=_0x77e3[_0x51951b];return _0x17dc1a;};'use strict';var client=require(_0x377e('0x0'));exports[_0x377e('0x1')]=function(){return function(){return client[_0x377e('0x2')](_0x377e('0x3'),{'options':{'raw':![],'attributes':['id',_0x377e('0x4'),_0x377e('0x5'),_0x377e('0x6')],'include':[{'model':_0x377e('0x7'),'as':_0x377e('0x8'),'attributes':['id',_0x377e('0x4'),'online',_0x377e('0x9')]}]},'log':_0x377e('0x1')});};}; \ No newline at end of file +var _0x552f=['../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','online','openchannelPause'];(function(_0x2beeb2,_0x1dd947){var _0xed1d02=function(_0x3dd90f){while(--_0x3dd90f){_0x2beeb2['push'](_0x2beeb2['shift']());}};_0xed1d02(++_0x1dd947);}(_0x552f,0x14a));var _0xf552=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0x552f[_0x1304c6];return _0x2e6654;};'use strict';var client=require(_0xf552('0x0'));exports[_0xf552('0x1')]=function(){return function(){return client[_0xf552('0x2')](_0xf552('0x3'),{'options':{'raw':![],'attributes':['id',_0xf552('0x4'),_0xf552('0x5'),_0xf552('0x6')],'include':[{'model':_0xf552('0x7'),'as':'Agents','attributes':['id',_0xf552('0x4'),_0xf552('0x8'),_0xf552('0x9')]}]},'log':_0xf552('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 6ac1c72..8434ef3 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 _0x6143=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','Request'];(function(_0x4cd2b2,_0x1217b6){var _0x3179ea=function(_0x28bfc4){while(--_0x28bfc4){_0x4cd2b2['push'](_0x4cd2b2['shift']());}};_0x3179ea(++_0x1217b6);}(_0x6143,0x1c6));var _0x3614=function(_0x23e7ad,_0x38d922){_0x23e7ad=_0x23e7ad-0x0;var _0x5c492f=_0x6143[_0x23e7ad];return _0x5c492f;};'use strict';var client=require(_0x3614('0x0'));exports['create']=function(_0x1d0e4d){return client[_0x3614('0x1')]('CreateOpenchannelQueueReport',{'body':_0x1d0e4d,'log':_0x3614('0x2')});};exports[_0x3614('0x3')]=function(_0x1e7777,_0x2ed94d){return client[_0x3614('0x1')](_0x3614('0x4'),{'body':_0x2ed94d,'options':{'where':{'uniqueid':_0x1e7777},'order':[['id',_0x3614('0x5')]],'limit':0x1},'log':_0x3614('0x4')});}; \ No newline at end of file +var _0xc106=['../client','create','CreateOpenchannelQueueReport','update','DESC'];(function(_0x3f5bc5,_0x378fde){var _0x25979c=function(_0x4c4b70){while(--_0x4c4b70){_0x3f5bc5['push'](_0x3f5bc5['shift']());}};_0x25979c(++_0x378fde);}(_0xc106,0x154));var _0x6c10=function(_0x188626,_0xfa082c){_0x188626=_0x188626-0x0;var _0x448a8c=_0xc106[_0x188626];return _0x448a8c;};'use strict';var client=require(_0x6c10('0x0'));exports[_0x6c10('0x1')]=function(_0xabdc96){return client['Request']('CreateOpenchannelQueueReport',{'body':_0xabdc96,'log':_0x6c10('0x2')});};exports[_0x6c10('0x3')]=function(_0x89511c,_0x173fc1){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x173fc1,'options':{'where':{'uniqueid':_0x89511c},'order':[['id',_0x6c10('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 9ecedd7..0d17d57 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 _0x6b52=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6b52,0xdf));var _0x26b5=function(_0x1e04e3,_0x55c35b){_0x1e04e3=_0x1e04e3-0x0;var _0x50899b=_0x6b52[_0x1e04e3];return _0x50899b;};'use strict';var client=require(_0x26b5('0x0'));exports[_0x26b5('0x1')]=function(_0x4d0332,_0x228ad1){return client[_0x26b5('0x2')](_0x26b5('0x3'),{'body':_0x228ad1,'options':{'where':{'id':_0x4d0332}},'log':_0x26b5('0x4')});};exports[_0x26b5('0x5')]=function(_0x42e8e1,_0x1a284c){return client['Request'](_0x26b5('0x6'),{'body':_0x1a284c,'options':{'where':{'id':_0x42e8e1}},'log':_0x26b5('0x7')});}; \ No newline at end of file +var _0x6b18=['UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','../client','update'];(function(_0x325bc4,_0x4df462){var _0x330091=function(_0x22db60){while(--_0x22db60){_0x325bc4['push'](_0x325bc4['shift']());}};_0x330091(++_0x4df462);}(_0x6b18,0x67));var _0x86b1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6b18[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x86b1('0x0'));exports[_0x86b1('0x1')]=function(_0x7cec55,_0x3b1839){return client['Request'](_0x86b1('0x2'),{'body':_0x3b1839,'options':{'where':{'id':_0x7cec55}},'log':_0x86b1('0x3')});};exports[_0x86b1('0x4')]=function(_0x12b4a4,_0x1d0a7e){return client[_0x86b1('0x5')](_0x86b1('0x6'),{'body':_0x1d0a7e,'options':{'where':{'id':_0x12b4a4}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 9b2f758..097f162 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 _0x34b3=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34b3,0x1b2));var _0x334b=function(_0x4b14cb,_0x32bf27){_0x4b14cb=_0x4b14cb-0x0;var _0x337a01=_0x34b3[_0x4b14cb];return _0x337a01;};'use strict';var client=require(_0x334b('0x0'));exports[_0x334b('0x1')]=function(_0x1cc33f){return client[_0x334b('0x2')](_0x334b('0x3'),{'body':_0x1cc33f,'log':_0x334b('0x4')});}; \ No newline at end of file +var _0x4ca7=['createSmsMessage','../client','create','CreateSmsMessage'];(function(_0x57a1ab,_0x1d21f7){var _0x121051=function(_0x19dc43){while(--_0x19dc43){_0x57a1ab['push'](_0x57a1ab['shift']());}};_0x121051(++_0x1d21f7);}(_0x4ca7,0x165));var _0x74ca=function(_0x2e059b,_0x1ad03a){_0x2e059b=_0x2e059b-0x0;var _0x56369d=_0x4ca7[_0x2e059b];return _0x56369d;};'use strict';var client=require(_0x74ca('0x0'));exports[_0x74ca('0x1')]=function(_0x12701b){return client['Request'](_0x74ca('0x2'),{'body':_0x12701b,'log':_0x74ca('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 0df4a1c..bd441ad 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 _0xd868=['User','name','online','getSmsQueues','../client','Request','timeout','strategy'];(function(_0x3e5deb,_0x27793d){var _0x4c5c6b=function(_0x1986ea){while(--_0x1986ea){_0x3e5deb['push'](_0x3e5deb['shift']());}};_0x4c5c6b(++_0x27793d);}(_0xd868,0x1ec));var _0x8d86=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xd868[_0x4c7fb5];return _0x2e10ac;};'use strict';var client=require(_0x8d86('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x8d86('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x8d86('0x2'),_0x8d86('0x3')],'include':[{'model':_0x8d86('0x4'),'as':'Agents','attributes':['id',_0x8d86('0x5'),_0x8d86('0x6'),'smsPause']}]},'log':_0x8d86('0x7')});};}; \ No newline at end of file +var _0xdb6a=['getSmsQueues','timeout','User','Agents','name','smsPause','../client'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xdb6a,0x102));var _0xadb6=function(_0x46870f,_0x458ab7){_0x46870f=_0x46870f-0x0;var _0x350f14=_0xdb6a[_0x46870f];return _0x350f14;};'use strict';var client=require(_0xadb6('0x0'));exports[_0xadb6('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0xadb6('0x2'),'strategy'],'include':[{'model':_0xadb6('0x3'),'as':_0xadb6('0x4'),'attributes':['id',_0xadb6('0x5'),'online',_0xadb6('0x6')]}]},'log':_0xadb6('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 5f52024..2f23064 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 _0xf482=['UpdateSmsQueueReport','DESC','../client','create','Request','CreateSmsQueueReport','update'];(function(_0x547278,_0x45fe5b){var _0xdb7e9=function(_0x4f557d){while(--_0x4f557d){_0x547278['push'](_0x547278['shift']());}};_0xdb7e9(++_0x45fe5b);}(_0xf482,0xf0));var _0x2f48=function(_0x2003cb,_0x54e34){_0x2003cb=_0x2003cb-0x0;var _0x5c004d=_0xf482[_0x2003cb];return _0x5c004d;};'use strict';var client=require(_0x2f48('0x0'));exports[_0x2f48('0x1')]=function(_0x199c62){return client[_0x2f48('0x2')](_0x2f48('0x3'),{'body':_0x199c62,'log':_0x2f48('0x3')});};exports[_0x2f48('0x4')]=function(_0x5c022c,_0x296174){return client[_0x2f48('0x2')](_0x2f48('0x5'),{'body':_0x296174,'options':{'where':{'uniqueid':_0x5c022c},'order':[['id',_0x2f48('0x6')]],'limit':0x1},'log':_0x2f48('0x5')});}; \ No newline at end of file +var _0xa848=['create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC','../client'];(function(_0x17c1a4,_0x195273){var _0x2ecdee=function(_0x3d6b93){while(--_0x3d6b93){_0x17c1a4['push'](_0x17c1a4['shift']());}};_0x2ecdee(++_0x195273);}(_0xa848,0x99));var _0x8a84=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa848[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0x8a84('0x0'));exports[_0x8a84('0x1')]=function(_0xb1a7c0){return client['Request'](_0x8a84('0x2'),{'body':_0xb1a7c0,'log':_0x8a84('0x2')});};exports[_0x8a84('0x3')]=function(_0x1864ea,_0x2a1376){return client[_0x8a84('0x4')](_0x8a84('0x5'),{'body':_0x2a1376,'options':{'where':{'uniqueid':_0x1864ea},'order':[['id',_0x8a84('0x6')]],'limit':0x1},'log':_0x8a84('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index d0c12a6..6c8457f 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 _0x383d=['GetUser','agent','name','pauseType','lastPauseAt','mailPause','faxPause','whatsappPause','chatCapacity','openchannelCapacity','../client','getAgents'];(function(_0x4810d3,_0x241220){var _0x2c823f=function(_0x3f77a9){while(--_0x3f77a9){_0x4810d3['push'](_0x4810d3['shift']());}};_0x2c823f(++_0x241220);}(_0x383d,0xa6));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xd383('0x0'));exports[_0xd383('0x1')]=function(){return function(){return client['Request'](_0xd383('0x2'),{'options':{'raw':!![],'where':{'role':_0xd383('0x3')},'attributes':['id',_0xd383('0x4'),'online',_0xd383('0x5'),_0xd383('0x6'),'voicePause','chatPause',_0xd383('0x7'),_0xd383('0x8'),'smsPause',_0xd383('0x9'),'openchannelPause',_0xd383('0xa'),'mailCapacity','faxCapacity','smsCapacity','whatsappCapacity',_0xd383('0xb')]},'log':_0xd383('0x1')});};}; \ No newline at end of file +var _0xb502=['GetUser','name','online','lastPauseAt','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','whatsappCapacity','openchannelCapacity','getAgents','Request'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xb502,0x163));var _0x2b50=function(_0x4f17b1,_0x293750){_0x4f17b1=_0x4f17b1-0x0;var _0x4c3e69=_0xb502[_0x4f17b1];return _0x4c3e69;};'use strict';var client=require('../client');exports[_0x2b50('0x0')]=function(){return function(){return client[_0x2b50('0x1')](_0x2b50('0x2'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x2b50('0x3'),_0x2b50('0x4'),'pauseType',_0x2b50('0x5'),_0x2b50('0x6'),'chatPause',_0x2b50('0x7'),_0x2b50('0x8'),_0x2b50('0x9'),'whatsappPause',_0x2b50('0xa'),_0x2b50('0xb'),_0x2b50('0xc'),_0x2b50('0xd'),_0x2b50('0xe'),_0x2b50('0xf'),_0x2b50('0x10')]},'log':_0x2b50('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index b115342..68043b1 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d5b=['Request','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client','update'];(function(_0x1e9857,_0x537143){var _0x3ec8b1=function(_0x169726){while(--_0x169726){_0x1e9857['push'](_0x1e9857['shift']());}};_0x3ec8b1(++_0x537143);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x280cc8,_0x10b396){_0x280cc8=_0x280cc8-0x0;var _0x46b1a0=_0x1d5b[_0x280cc8];return _0x46b1a0;};'use strict';var client=require(_0xb1d5('0x0'));exports[_0xb1d5('0x1')]=function(_0x1a1089,_0x4a5a6c){return client[_0xb1d5('0x2')]('UpdateWhatsappInteraction',{'body':_0x4a5a6c,'options':{'where':{'id':_0x1a1089}},'log':_0xb1d5('0x3')});};exports[_0xb1d5('0x4')]=function(_0xa12a1e,_0x3ee65c){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x3ee65c,'options':{'where':{'id':_0xa12a1e}},'log':_0xb1d5('0x5')});}; \ No newline at end of file +var _0x26bc=['../client','update','Request','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction'];(function(_0x532e8d,_0x284b3e){var _0x27857d=function(_0x30f802){while(--_0x30f802){_0x532e8d['push'](_0x532e8d['shift']());}};_0x27857d(++_0x284b3e);}(_0x26bc,0x162));var _0xc26b=function(_0x1a6753,_0x4f7b56){_0x1a6753=_0x1a6753-0x0;var _0x134a99=_0x26bc[_0x1a6753];return _0x134a99;};'use strict';var client=require(_0xc26b('0x0'));exports[_0xc26b('0x1')]=function(_0x24bff6,_0x3b0ec1){return client[_0xc26b('0x2')]('UpdateWhatsappInteraction',{'body':_0x3b0ec1,'options':{'where':{'id':_0x24bff6}},'log':_0xc26b('0x3')});};exports[_0xc26b('0x4')]=function(_0x381ceb,_0x4d8d28){return client[_0xc26b('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x4d8d28,'options':{'where':{'id':_0x381ceb}},'log':_0xc26b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 06767f4..66f3958 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98be=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x15f77f,_0x599788){var _0x1f35cc=function(_0x1004b0){while(--_0x1004b0){_0x15f77f['push'](_0x15f77f['shift']());}};_0x1f35cc(++_0x599788);}(_0x98be,0xe2));var _0xe98b=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x98be[_0x40bffc];return _0x3007e9;};'use strict';var client=require(_0xe98b('0x0'));exports[_0xe98b('0x1')]=function(_0x2b3d8a){return client[_0xe98b('0x2')](_0xe98b('0x3'),{'body':_0x2b3d8a,'log':_0xe98b('0x4')});}; \ No newline at end of file +var _0xa575=['../client','create','Request'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0xa575,0x177));var _0x5a57=function(_0x1562a2,_0x2e4655){_0x1562a2=_0x1562a2-0x0;var _0x39a636=_0xa575[_0x1562a2];return _0x39a636;};'use strict';var client=require(_0x5a57('0x0'));exports[_0x5a57('0x1')]=function(_0x12cf32){return client[_0x5a57('0x2')]('CreateWhatsappMessage',{'body':_0x12cf32,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 8f4eb54..e99869b 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26f9=['getWhatsappQueues','GetWhatsappQueue','strategy','User','name','online','whatsappPause','../client'];(function(_0x13b7fd,_0x4eaf7f){var _0x32a74a=function(_0x2c5d80){while(--_0x2c5d80){_0x13b7fd['push'](_0x13b7fd['shift']());}};_0x32a74a(++_0x4eaf7f);}(_0x26f9,0x16f));var _0x926f=function(_0x26a810,_0x247776){_0x26a810=_0x26a810-0x0;var _0x4758a3=_0x26f9[_0x26a810];return _0x4758a3;};'use strict';var client=require(_0x926f('0x0'));exports[_0x926f('0x1')]=function(){return function(){return client['Request'](_0x926f('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x926f('0x3')],'include':[{'model':_0x926f('0x4'),'as':'Agents','attributes':['id',_0x926f('0x5'),_0x926f('0x6'),_0x926f('0x7')]}]},'log':_0x926f('0x1')});};}; \ No newline at end of file +var _0x6cb4=['timeout','strategy','User','Agents','online','../client','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cb4,0xff));var _0x46cb=function(_0x5ba7bd,_0x2de643){_0x5ba7bd=_0x5ba7bd-0x0;var _0x3aaa26=_0x6cb4[_0x5ba7bd];return _0x3aaa26;};'use strict';var client=require(_0x46cb('0x0'));exports[_0x46cb('0x1')]=function(){return function(){return client[_0x46cb('0x2')](_0x46cb('0x3'),{'options':{'raw':![],'attributes':['id',_0x46cb('0x4'),_0x46cb('0x5'),_0x46cb('0x6')],'include':[{'model':_0x46cb('0x7'),'as':_0x46cb('0x8'),'attributes':['id','name',_0x46cb('0x9'),'whatsappPause']}]},'log':_0x46cb('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 4182469..5b014bc 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb8=['UpdateWhatsappQueueReport','DESC','create','CreateWhatsappQueueReport','update','Request'];(function(_0xa3c024,_0x275fc3){var _0x3c1b58=function(_0x3cdde7){while(--_0x3cdde7){_0xa3c024['push'](_0xa3c024['shift']());}};_0x3c1b58(++_0x275fc3);}(_0x1cb8,0x14c));var _0x81cb=function(_0x1b6fe1,_0x21bb65){_0x1b6fe1=_0x1b6fe1-0x0;var _0x307e9b=_0x1cb8[_0x1b6fe1];return _0x307e9b;};'use strict';var client=require('../client');exports[_0x81cb('0x0')]=function(_0x135d26){return client['Request'](_0x81cb('0x1'),{'body':_0x135d26,'log':_0x81cb('0x1')});};exports[_0x81cb('0x2')]=function(_0x4bd9a3,_0x4bdbde){return client[_0x81cb('0x3')](_0x81cb('0x4'),{'body':_0x4bdbde,'options':{'where':{'uniqueid':_0x4bd9a3},'order':[['id',_0x81cb('0x5')]],'limit':0x1},'log':_0x81cb('0x4')});}; \ No newline at end of file +var _0x4c80=['../client','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x4e14a5,_0x2c85ab){var _0x5767d1=function(_0x47dc67){while(--_0x47dc67){_0x4e14a5['push'](_0x4e14a5['shift']());}};_0x5767d1(++_0x2c85ab);}(_0x4c80,0x66));var _0x04c8=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x4c80[_0x1caf6a];return _0x1bf493;};'use strict';var client=require(_0x04c8('0x0'));exports['create']=function(_0x32c825){return client[_0x04c8('0x1')](_0x04c8('0x2'),{'body':_0x32c825,'log':_0x04c8('0x2')});};exports[_0x04c8('0x3')]=function(_0x5a16c7,_0x56ced7){return client[_0x04c8('0x1')](_0x04c8('0x4'),{'body':_0x56ced7,'options':{'where':{'uniqueid':_0x5a16c7},'order':[['id',_0x04c8('0x5')]],'limit':0x1},'log':_0x04c8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index c3eea2d..27d8dd5 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 _0x9d36=['string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','message','join','stop','find','agents','timeout','channel','end','close','rules','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','./strategy'];(function(_0x183256,_0x1a596d){var _0x5394a2=function(_0x192025){while(--_0x192025){_0x183256['push'](_0x183256['shift']());}};_0x5394a2(++_0x1a596d);}(_0x9d36,0x1b5));var _0x69d3=function(_0x1aab89,_0x1c9d54){_0x1aab89=_0x1aab89-0x0;var _0x168bc0=_0x9d36[_0x1aab89];return _0x168bc0;};'use strict';var schema=require('validate');var _=require(_0x69d3('0x0'));var util=require(_0x69d3('0x1'));var seqqueue=require(_0x69d3('0x2'));var logger=require(_0x69d3('0x3'))('routing');var strategy=require(_0x69d3('0x4'));var queue=schema({'name':{'type':_0x69d3('0x5'),'required':!![],'message':_0x69d3('0x6')},'timeout':{'type':_0x69d3('0x7'),'message':_0x69d3('0x8')}});function writeLog(_0x20cbd1,_0x449fd6,_0x51abef){return logger[_0x69d3('0x9')](util[_0x69d3('0xa')](_0x69d3('0xb'),_0x20cbd1,_0x449fd6[_0x69d3('0xc')],_0x51abef));}function handleFindAgent(_0x1e885e){return function(_0xa0dde1){return _0xa0dde1[_0x69d3('0xc')][_0x69d3('0xd')]()===_0x1e885e[_0x69d3('0xd')]();};}exports[_0x69d3('0xe')]=function(_0x4ca6bb,_0x57af44,_0x4d642b,_0xf4f80e){return function(_0x20325b){try{var _0x433c15={'name':_0x57af44[0x0],'timeout':_0x57af44[0x1]};var _0x37ab30=queue['validate'](_0x433c15,{'typecast':!![]});if(_0x37ab30[_0x69d3('0xf')]){logger['error'](_0x69d3('0x10'),_0x4ca6bb,_['map'](_0x37ab30,_0x69d3('0x11'))[_0x69d3('0x12')](',\x20'));_0x20325b[_0x69d3('0x13')]();}else{var _0x1c3b7d=_[_0x69d3('0x14')](_0x4d642b[_0x69d3('0x15')],handleFindAgent(_0x433c15[_0x69d3('0xc')]));if(_0x1c3b7d){var _0xbbc693=(_0x433c15[_0x69d3('0x16')]||0xa)*0x3e8;var _0x3093fd,_0x1d44e3;var _0x3fc0d1=seqqueue['createQueue'](_0xbbc693);_0x3fc0d1['id']=_0x4ca6bb;_0x3fc0d1['atimeout']=_0xbbc693;_0x3fc0d1[_0x69d3('0x17')]=_0xf4f80e[_0x69d3('0x17')];writeLog(_0x4ca6bb,_0x1c3b7d,util[_0x69d3('0xa')]('START:%s',_0xbbc693));_0x4d642b['rules'][_0x4ca6bb]['on'](_0x69d3('0x18'),function(){logger[_0x69d3('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x4ca6bb);clearTimeout(_0x1d44e3);_0x1d44e3=undefined;_0x3fc0d1[_0x69d3('0x19')]();if(_0x4d642b[_0x69d3('0x1a')][_0x4ca6bb]){delete _0x4d642b[_0x69d3('0x1a')][_0x4ca6bb];}_0x20325b[_0x69d3('0x13')]();});_0x4d642b[_0x69d3('0x1a')][_0x4ca6bb]['on']('complete',function(){if(_0x4d642b[_0x69d3('0x1a')][_0x4ca6bb]){delete _0x4d642b[_0x69d3('0x1a')][_0x4ca6bb];}});_0x1d44e3=setTimeout(function(){logger[_0x69d3('0x9')](_0x69d3('0x1b'),_0x4ca6bb);clearTimeout(_0x1d44e3);_0x3fc0d1[_0x69d3('0x19')]();_0x20325b[_0x69d3('0x1c')]();},_0xbbc693);strategy[_0x69d3('0x1d')](_0x3fc0d1,_0x1c3b7d,_0x4d642b,_0xf4f80e);}else{logger[_0x69d3('0x1e')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x4ca6bb,_0x433c15['name']);_0x20325b[_0x69d3('0x13')]();}}}catch(_0x1d0b4b){console[_0x69d3('0x1f')](_0x1d0b4b);logger[_0x69d3('0x1e')](_0x69d3('0x20'),_0x4ca6bb,_0x1d0b4b[_0x69d3('0x21')]);_0x20325b[_0x69d3('0x13')]();}};}; \ No newline at end of file +var _0x7fa3=['createQueue','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','util','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','length','map','message','join','stop','agents'];(function(_0x56ab71,_0x40df33){var _0x44bafc=function(_0x13cf3e){while(--_0x13cf3e){_0x56ab71['push'](_0x56ab71['shift']());}};_0x44bafc(++_0x40df33);}(_0x7fa3,0x138));var _0x37fa=function(_0x27179a,_0x1583a3){_0x27179a=_0x27179a-0x0;var _0x355b44=_0x7fa3[_0x27179a];return _0x355b44;};'use strict';var schema=require(_0x37fa('0x0'));var _=require('lodash');var util=require(_0x37fa('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x37fa('0x2'))(_0x37fa('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x37fa('0x4'),'required':!![],'message':_0x37fa('0x5')},'timeout':{'type':_0x37fa('0x6'),'message':_0x37fa('0x7')}});function writeLog(_0x56c0a7,_0x1348b1,_0x4078a7){return logger[_0x37fa('0x8')](util[_0x37fa('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x56c0a7,_0x1348b1['name'],_0x4078a7));}function handleFindAgent(_0x3d1e52){return function(_0x462c7c){return _0x462c7c[_0x37fa('0xa')]['toLowerCase']()===_0x3d1e52[_0x37fa('0xb')]();};}exports['consequence']=function(_0x3133ba,_0x44652c,_0x47c436,_0x2b4f0a){return function(_0x4277d0){try{var _0x6103a0={'name':_0x44652c[0x0],'timeout':_0x44652c[0x1]};var _0x2f380a=queue[_0x37fa('0x0')](_0x6103a0,{'typecast':!![]});if(_0x2f380a[_0x37fa('0xc')]){logger['error']('[%s][AGENT]\x20%s',_0x3133ba,_[_0x37fa('0xd')](_0x2f380a,_0x37fa('0xe'))[_0x37fa('0xf')](',\x20'));_0x4277d0[_0x37fa('0x10')]();}else{var _0x46d068=_['find'](_0x47c436[_0x37fa('0x11')],handleFindAgent(_0x6103a0[_0x37fa('0xa')]));if(_0x46d068){var _0x3378b7=(_0x6103a0['timeout']||0xa)*0x3e8;var _0x24d5cd,_0x5599d9;var _0x17c427=seqqueue[_0x37fa('0x12')](_0x3378b7);_0x17c427['id']=_0x3133ba;_0x17c427[_0x37fa('0x13')]=_0x3378b7;_0x17c427[_0x37fa('0x14')]=_0x2b4f0a[_0x37fa('0x14')];writeLog(_0x3133ba,_0x46d068,util[_0x37fa('0x9')](_0x37fa('0x15'),_0x3378b7));_0x47c436[_0x37fa('0x16')][_0x3133ba]['on']('end',function(){logger[_0x37fa('0x8')](_0x37fa('0x17'),_0x3133ba);clearTimeout(_0x5599d9);_0x5599d9=undefined;_0x17c427['close']();if(_0x47c436['rules'][_0x3133ba]){delete _0x47c436[_0x37fa('0x16')][_0x3133ba];}_0x4277d0[_0x37fa('0x10')]();});_0x47c436[_0x37fa('0x16')][_0x3133ba]['on'](_0x37fa('0x18'),function(){if(_0x47c436[_0x37fa('0x16')][_0x3133ba]){delete _0x47c436['rules'][_0x3133ba];}});_0x5599d9=setTimeout(function(){logger[_0x37fa('0x8')](_0x37fa('0x19'),_0x3133ba);clearTimeout(_0x5599d9);_0x17c427[_0x37fa('0x1a')]();_0x4277d0[_0x37fa('0x1b')]();},_0x3378b7);strategy[_0x37fa('0x1c')](_0x17c427,_0x46d068,_0x47c436,_0x2b4f0a);}else{logger[_0x37fa('0x1d')](_0x37fa('0x1e'),_0x3133ba,_0x6103a0[_0x37fa('0xa')]);_0x4277d0['stop']();}}}catch(_0x555b9d){console[_0x37fa('0x1f')](_0x555b9d);logger[_0x37fa('0x1d')]('[%s][QUEUE]\x20%s',_0x3133ba,_0x555b9d[_0x37fa('0x20')]);_0x4277d0[_0x37fa('0x10')]();}};}; \ 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 f819b12..80b9e7d 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 _0xdb03=['amazonlex','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','interaction','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','body','Message','[%s][AMAZONLEX]\x20%s','catch','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','toString','postText','message','providerName'];(function(_0x4acf6f,_0x5072e5){var _0x3c6d3a=function(_0x4c72a6){while(--_0x4c72a6){_0x4acf6f['push'](_0x4acf6f['shift']());}};_0x3c6d3a(++_0x5072e5);}(_0xdb03,0x10a));var _0x3db0=function(_0x26cba5,_0x1a63b0){_0x26cba5=_0x26cba5-0x0;var _0x21dff3=_0xdb03[_0x26cba5];return _0x21dff3;};'use strict';var _=require(_0x3db0('0x0'));var moment=require(_0x3db0('0x1'));var AWS=require(_0x3db0('0x2'));var utils=require(_0x3db0('0x3'));var logger=require(_0x3db0('0x4'))(_0x3db0('0x5'));var rpc={'chatMessage':require(_0x3db0('0x6')),'openchannelMessage':require(_0x3db0('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x3db0('0x8')),'faxMessage':require(_0x3db0('0x9')),'whatsappMessage':require(_0x3db0('0xa'))};exports[_0x3db0('0xb')]=function(_0x39bcb9,_0x4d822d){return function(_0x677c7d){try{if(!_[_0x3db0('0xc')](this['interaction'][_0x3db0('0xd')])){logger[_0x3db0('0xe')]('[%s][AMAZONLEX]\x20%s',_0x39bcb9,_0x3db0('0xf'));return _0x677c7d[_0x3db0('0x10')]();}var _0x23c4e1={'ContactId':this['contact']['id'],'sentAt':moment()[_0x3db0('0x11')](_0x3db0('0x12')),'direction':'out'};if(this[_0x3db0('0x13')]===_0x3db0('0x14')||this[_0x3db0('0x13')]==='whatsapp'){_0x23c4e1['phone']=this[_0x3db0('0x15')]['phone'];}var _0xa3e889=this[_0x3db0('0x13')];if(_0xa3e889===_0x3db0('0x16')){_0x23c4e1[_0x3db0('0x17')]=this[_0x3db0('0x18')]['id'];}else{_0x23c4e1[_[_0x3db0('0x19')](_0xa3e889)+'AccountId']=this[_0x3db0('0x18')]['id'];}_0x23c4e1[_['upperFirst'](_0xa3e889)+'InteractionId']=this[_0x3db0('0x15')]['id'];if(this['interaction'][_0x3db0('0x1a')]){var _0x1f908b=_0x4d822d[0x4];if(!_[_0x3db0('0x1b')](_0x1f908b)){_0x23c4e1[_0x3db0('0x1c')]=utils['getMustacheRender'](_0x1f908b,this);return rpc[_0xa3e889+_0x3db0('0x1d')]['create'](_0x23c4e1)['then'](function(_0xd7eef9){logger[_0x3db0('0xe')](_0x3db0('0x1e'),_0x39bcb9,_0x23c4e1[_0x3db0('0x1c')]);})[_0x3db0('0x1f')](function(_0x1a3bc0){logger[_0x3db0('0x20')]('[%s][AMAZONLEX]\x20%s',_0x39bcb9,JSON[_0x3db0('0x21')](_0x1a3bc0));})[_0x3db0('0x22')](function(){logger[_0x3db0('0xe')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x39bcb9);_0x677c7d[_0x3db0('0x23')]();});}else{logger[_0x3db0('0xe')](_0x3db0('0x24'),_0x39bcb9);_0x677c7d['stop']();}}else{var _0x3848bd=this;var _0x2b4100=new AWS['LexRuntime']({'accessKeyId':_0x4d822d[0x0],'secretAccessKey':_0x4d822d[0x1],'region':_0x4d822d[0x2]});var _0x2010fe={'botAlias':_0x3db0('0x25'),'botName':_0x4d822d[0x3],'inputText':this['message']['body'],'userId':this[_0x3db0('0x13')]+':'+this[_0x3db0('0x15')]['id'][_0x3db0('0x26')]()};_0x2b4100[_0x3db0('0x27')](_0x2010fe,function(_0xbdf588,_0x57923d){if(_0xbdf588){logger['error']('[%s][AMAZONLEX]\x20%s',_0x39bcb9,_0xbdf588['message']);_0x677c7d[_0x3db0('0x10')]();}else if(_0x57923d&&_0x57923d[_0x3db0('0x28')]){_0x3848bd[_0x3db0('0x1c')]['amazonlex']=_0x57923d;_0x23c4e1[_0x3db0('0x1c')]=_0x57923d['message'];_0x23c4e1[_0x3db0('0x29')]=_0x3db0('0x2a');_0x23c4e1['providerResponse']=JSON[_0x3db0('0x21')](_0x57923d);return rpc[_0xa3e889+_0x3db0('0x1d')]['create'](_0x23c4e1)['then'](function(_0x495a75){logger['info'](_0x3db0('0x1e'),_0x39bcb9,_0x23c4e1[_0x3db0('0x1c')]);if(_0x57923d['dialogState']==_0x3db0('0x2b')){_0x677c7d[_0x3db0('0x10')]();}else{_0x677c7d[_0x3db0('0x23')]();}})[_0x3db0('0x1f')](function(_0x359a42){logger[_0x3db0('0x20')]('[%s][AMAZONLEX]\x20%s',_0x39bcb9,JSON[_0x3db0('0x21')](_0x359a42));_0x677c7d[_0x3db0('0x10')]();});}else{_0x677c7d[_0x3db0('0x10')]();}});}}catch(_0x175903){logger[_0x3db0('0x20')](_0x3db0('0x1e'),_0x39bcb9,JSON[_0x3db0('0x21')](_0x175903));_0x677c7d[_0x3db0('0x23')]();}};}; \ No newline at end of file +var _0xf4db=['aws-sdk','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','ChatWebsiteId','account','AccountId','InteractionId','created','isEmpty','then','[%s][AMAZONLEX]\x20%s','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','LexRuntime','body','toString','postText','error','message','amazonlex','providerName','providerResponse','Message','create','dialogState','Failed','stop','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4db,0x112));var _0xbf4d=function(_0x1740ae,_0x5889d2){_0x1740ae=_0x1740ae-0x0;var _0x2eddc6=_0xf4db[_0x1740ae];return _0x2eddc6;};'use strict';var _=require(_0xbf4d('0x0'));var moment=require(_0xbf4d('0x1'));var AWS=require(_0xbf4d('0x2'));var utils=require('./utils');var logger=require(_0xbf4d('0x3'))(_0xbf4d('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xbf4d('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xbf4d('0x6')),'whatsappMessage':require(_0xbf4d('0x7'))};exports[_0xbf4d('0x8')]=function(_0xaff4cc,_0x1946f1){return function(_0x57ca4a){try{if(!_['isNil'](this[_0xbf4d('0x9')][_0xbf4d('0xa')])){logger[_0xbf4d('0xb')]('[%s][AMAZONLEX]\x20%s',_0xaff4cc,_0xbf4d('0xc'));return _0x57ca4a[_0xbf4d('0xd')]();}var _0x2a34e8={'ContactId':this[_0xbf4d('0xe')]['id'],'sentAt':moment()[_0xbf4d('0xf')](_0xbf4d('0x10')),'direction':_0xbf4d('0x11')};if(this[_0xbf4d('0x12')]===_0xbf4d('0x13')||this['channel']==='whatsapp'){_0x2a34e8['phone']=this['interaction'][_0xbf4d('0x14')];}var _0x4e342e=this[_0xbf4d('0x12')];if(_0x4e342e==='chat'){_0x2a34e8[_0xbf4d('0x15')]=this[_0xbf4d('0x16')]['id'];}else{_0x2a34e8[_['upperFirst'](_0x4e342e)+_0xbf4d('0x17')]=this[_0xbf4d('0x16')]['id'];}_0x2a34e8[_['upperFirst'](_0x4e342e)+_0xbf4d('0x18')]=this[_0xbf4d('0x9')]['id'];if(this[_0xbf4d('0x9')][_0xbf4d('0x19')]){var _0x39bbce=_0x1946f1[0x4];if(!_[_0xbf4d('0x1a')](_0x39bbce)){_0x2a34e8['body']=utils['getMustacheRender'](_0x39bbce,this);return rpc[_0x4e342e+'Message']['create'](_0x2a34e8)[_0xbf4d('0x1b')](function(_0x37e988){logger['info'](_0xbf4d('0x1c'),_0xaff4cc,_0x2a34e8['body']);})['catch'](function(_0x2f751a){logger['error'](_0xbf4d('0x1c'),_0xaff4cc,JSON[_0xbf4d('0x1d')](_0x2f751a));})[_0xbf4d('0x1e')](function(){logger[_0xbf4d('0xb')](_0xbf4d('0x1f'),_0xaff4cc);_0x57ca4a['stop']();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0xaff4cc);_0x57ca4a['stop']();}}else{var _0x4adbbd=this;var _0x38d28f=new AWS[(_0xbf4d('0x20'))]({'accessKeyId':_0x1946f1[0x0],'secretAccessKey':_0x1946f1[0x1],'region':_0x1946f1[0x2]});var _0xff735a={'botAlias':'$LATEST','botName':_0x1946f1[0x3],'inputText':this['message'][_0xbf4d('0x21')],'userId':this['channel']+':'+this[_0xbf4d('0x9')]['id'][_0xbf4d('0x22')]()};_0x38d28f[_0xbf4d('0x23')](_0xff735a,function(_0x11d829,_0x1ab824){if(_0x11d829){logger[_0xbf4d('0x24')](_0xbf4d('0x1c'),_0xaff4cc,_0x11d829[_0xbf4d('0x25')]);_0x57ca4a[_0xbf4d('0xd')]();}else if(_0x1ab824&&_0x1ab824['message']){_0x4adbbd[_0xbf4d('0x21')][_0xbf4d('0x26')]=_0x1ab824;_0x2a34e8[_0xbf4d('0x21')]=_0x1ab824[_0xbf4d('0x25')];_0x2a34e8[_0xbf4d('0x27')]=_0xbf4d('0x26');_0x2a34e8[_0xbf4d('0x28')]=JSON['stringify'](_0x1ab824);return rpc[_0x4e342e+_0xbf4d('0x29')][_0xbf4d('0x2a')](_0x2a34e8)[_0xbf4d('0x1b')](function(_0x37cf1e){logger[_0xbf4d('0xb')](_0xbf4d('0x1c'),_0xaff4cc,_0x2a34e8['body']);if(_0x1ab824[_0xbf4d('0x2b')]==_0xbf4d('0x2c')){_0x57ca4a[_0xbf4d('0xd')]();}else{_0x57ca4a[_0xbf4d('0x2d')]();}})['catch'](function(_0x20ff2b){logger[_0xbf4d('0x24')](_0xbf4d('0x1c'),_0xaff4cc,JSON[_0xbf4d('0x1d')](_0x20ff2b));_0x57ca4a[_0xbf4d('0xd')]();});}else{_0x57ca4a['next']();}});}}catch(_0x26cc3c){logger[_0xbf4d('0x24')](_0xbf4d('0x1c'),_0xaff4cc,JSON[_0xbf4d('0x1d')](_0x26cc3c));_0x57ca4a['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 7136e3d..bbc78d6 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 _0x85e6=['','headers','auto-replied','All','auto_reply','then','info','Message','create','stringify','[RPC][%s][AUTOREPLY]\x20%s','finally','error','stop','lodash','moment','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','next','channel','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','body','getMustacheRender','message','from','phone','read','subject','startsWith','chat','account','upperFirst','service','Smtp','host','port','secure','authentication','auth','pass','inReplyTo','messageId','html','replace'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x85e6,0x1a5));var _0x685e=function(_0x450500,_0x422687){_0x450500=_0x450500-0x0;var _0x710ab7=_0x85e6[_0x450500];return _0x710ab7;};'use strict';var _=require(_0x685e('0x0'));var moment=require(_0x685e('0x1'));var utils=require('./utils');var logger=require(_0x685e('0x2'))(_0x685e('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x685e('0x4')),'mailMessage':require(_0x685e('0x5')),'smsMessage':require(_0x685e('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x685e('0x7'))};var mailRpc=require('../../mailRpc');exports[_0x685e('0x8')]=function(_0x41f13f,_0x3cde2c){return function(_0x55e0de){try{if(_0x3cde2c[0x0]==='1'&&(_[_0x685e('0x9')](this[_0x685e('0xa')][_0x685e('0xb')])||!this[_0x685e('0xa')][_0x685e('0xb')])){logger['info'](_0x685e('0xc'),_0x41f13f,'Autoreply\x20already\x20sent');return _0x55e0de[_0x685e('0xd')]();}var _0x4c0df1=this[_0x685e('0xe')];var _0xfc5a40={'ContactId':this[_0x685e('0xf')]['id'],'sentAt':moment()[_0x685e('0x10')](_0x685e('0x11')),'direction':_0x685e('0x12')};if(this[_0x685e('0xe')]===_0x685e('0x13')){_0xfc5a40[_0x685e('0x14')]=utils[_0x685e('0x15')](_0x3cde2c[0x2],this);}else{_0xfc5a40[_0x685e('0x14')]=utils[_0x685e('0x15')](_0x3cde2c[0x1],this);}if(this[_0x685e('0x16')]){_0xfc5a40['to']=this[_0x685e('0x16')][_0x685e('0x17')]||'';if(this[_0x685e('0xe')]==='mail'&&_0x3cde2c[0x1]==='1'){_0xfc5a40['cc']=this[_0x685e('0x16')]['cc']||'';}_0xfc5a40[_0x685e('0x17')]=this[_0x685e('0x16')]['to']||'';_0xfc5a40[_0x685e('0x18')]=this[_0x685e('0x16')]['phone']||'';_0xfc5a40[_0x685e('0x19')]=!![];if(this[_0x685e('0x16')][_0x685e('0x1a')]){_0xfc5a40[_0x685e('0x1a')]='';_0xfc5a40[_0x685e('0x1a')]+=_[_0x685e('0x1b')](this['message'][_0x685e('0x1a')],'Re:')?'':'Re:\x20';_0xfc5a40[_0x685e('0x1a')]+=this[_0x685e('0x16')][_0x685e('0x1a')];}}if(this[_0x685e('0xe')]===_0x685e('0x1c')){_0xfc5a40['ChatWebsiteId']=this[_0x685e('0x1d')]['id'];}else{_0xfc5a40[_[_0x685e('0x1e')](this[_0x685e('0xe')])+'AccountId']=this[_0x685e('0x1d')]['id'];}_0xfc5a40[_['upperFirst'](this[_0x685e('0xe')])+'InteractionId']=this[_0x685e('0xa')]['id'];if(rpc[this[_0x685e('0xe')]+'Message']){if(this[_0x685e('0xe')]===_0x685e('0x13')){var _0x3f55a6={'tls':{'rejectUnauthorized':![]}};if(this[_0x685e('0x1d')]['Smtp'][_0x685e('0x1f')]){_0x3f55a6[_0x685e('0x1f')]=this[_0x685e('0x1d')][_0x685e('0x20')][_0x685e('0x1f')];}else{_0x3f55a6[_0x685e('0x21')]=this[_0x685e('0x1d')][_0x685e('0x20')]['host'];_0x3f55a6['port']=this[_0x685e('0x1d')][_0x685e('0x20')][_0x685e('0x22')];_0x3f55a6[_0x685e('0x23')]=this['account'][_0x685e('0x20')][_0x685e('0x23')];}if(this[_0x685e('0x1d')]['Smtp'][_0x685e('0x24')]){_0x3f55a6[_0x685e('0x25')]={'user':this[_0x685e('0x1d')][_0x685e('0x20')]['user'],'pass':this[_0x685e('0x1d')][_0x685e('0x20')][_0x685e('0x26')]};}_0xfc5a40[_0x685e('0x27')]=this['message'][_0x685e('0x28')];_0xfc5a40[_0x685e('0x29')]=''+_[_0x685e('0x2a')](_0xfc5a40[_0x685e('0x14')],_0x685e('0x2b'),'','replace','','headers','auto-replied','auto_reply','info','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','catch','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','next','error','stop','lodash','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../mailRpc','consequence','interaction','created','[%s][AUTOREPLY]\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','mail','body','getMustacheRender','message','from','phone'];(function(_0x16c5f6,_0x17ae03){var _0x4e6fce=function(_0x21ae49){while(--_0x21ae49){_0x16c5f6['push'](_0x16c5f6['shift']());}};_0x4e6fce(++_0x17ae03);}(_0xc891,0x152));var _0x1c89=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xc891[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x1c89('0x0'));var moment=require('moment');var utils=require('./utils');var logger=require(_0x1c89('0x1'))('routing');var rpc={'chatMessage':require(_0x1c89('0x2')),'openchannelMessage':require(_0x1c89('0x3')),'mailMessage':require(_0x1c89('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1c89('0x5')),'whatsappMessage':require(_0x1c89('0x6'))};var mailRpc=require(_0x1c89('0x7'));exports[_0x1c89('0x8')]=function(_0x5c9cb9,_0x14436b){return function(_0x30aa4d){try{if(_0x14436b[0x0]==='1'&&(_['isNil'](this[_0x1c89('0x9')][_0x1c89('0xa')])||!this['interaction'][_0x1c89('0xa')])){logger['info'](_0x1c89('0xb'),_0x5c9cb9,'Autoreply\x20already\x20sent');return _0x30aa4d['next']();}var _0x4c69e3=this['channel'];var _0xbd061={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1c89('0xc')](_0x1c89('0xd')),'direction':_0x1c89('0xe')};if(this[_0x1c89('0xf')]===_0x1c89('0x10')){_0xbd061[_0x1c89('0x11')]=utils[_0x1c89('0x12')](_0x14436b[0x2],this);}else{_0xbd061[_0x1c89('0x11')]=utils['getMustacheRender'](_0x14436b[0x1],this);}if(this[_0x1c89('0x13')]){_0xbd061['to']=this['message'][_0x1c89('0x14')]||'';if(this[_0x1c89('0xf')]===_0x1c89('0x10')&&_0x14436b[0x1]==='1'){_0xbd061['cc']=this['message']['cc']||'';}_0xbd061[_0x1c89('0x14')]=this[_0x1c89('0x13')]['to']||'';_0xbd061[_0x1c89('0x15')]=this['message'][_0x1c89('0x15')]||'';_0xbd061[_0x1c89('0x16')]=!![];if(this[_0x1c89('0x13')][_0x1c89('0x17')]){_0xbd061[_0x1c89('0x17')]='';_0xbd061[_0x1c89('0x17')]+=_[_0x1c89('0x18')](this[_0x1c89('0x13')][_0x1c89('0x17')],_0x1c89('0x19'))?'':_0x1c89('0x1a');_0xbd061['subject']+=this[_0x1c89('0x13')][_0x1c89('0x17')];}}if(this['channel']===_0x1c89('0x1b')){_0xbd061[_0x1c89('0x1c')]=this[_0x1c89('0x1d')]['id'];}else{_0xbd061[_[_0x1c89('0x1e')](this['channel'])+'AccountId']=this[_0x1c89('0x1d')]['id'];}_0xbd061[_[_0x1c89('0x1e')](this[_0x1c89('0xf')])+_0x1c89('0x1f')]=this['interaction']['id'];if(rpc[this[_0x1c89('0xf')]+_0x1c89('0x20')]){if(this['channel']===_0x1c89('0x10')){var _0x26a1cc={'tls':{'rejectUnauthorized':![]}};if(this[_0x1c89('0x1d')]['Smtp'][_0x1c89('0x21')]){_0x26a1cc[_0x1c89('0x21')]=this[_0x1c89('0x1d')]['Smtp'][_0x1c89('0x21')];}else{_0x26a1cc['host']=this['account'][_0x1c89('0x22')][_0x1c89('0x23')];_0x26a1cc['port']=this['account']['Smtp'][_0x1c89('0x24')];_0x26a1cc['secure']=this['account'][_0x1c89('0x22')]['secure'];}if(this[_0x1c89('0x1d')]['Smtp']['authentication']){_0x26a1cc[_0x1c89('0x25')]={'user':this[_0x1c89('0x1d')][_0x1c89('0x22')]['user'],'pass':this[_0x1c89('0x1d')][_0x1c89('0x22')]['pass']};}_0xbd061[_0x1c89('0x26')]=this['message'][_0x1c89('0x27')];_0xbd061[_0x1c89('0x28')]=_0x1c89('0x29')+_[_0x1c89('0x2a')](_0xbd061[_0x1c89('0x11')],_0x1c89('0x2b'),_0x1c89('0x2c'))+_0x1c89('0x2d');_0xbd061[_0x1c89('0x2e')]={'Auto-Submitted':_0x1c89('0x2f'),'X-Auto-Response-Suppress':'All','Precedence':_0x1c89('0x30')};return mailRpc['sendMailMessage'](_0x26a1cc,_0xbd061)['then'](function(_0x2425c6){logger[_0x1c89('0x31')](_0x1c89('0x32'),_0x5c9cb9);_0xbd061[_0x1c89('0x27')]=_0x2425c6[_0x1c89('0x13')][_0x1c89('0x27')];return rpc[_0x4c69e3+_0x1c89('0x20')][_0x1c89('0x33')](_0xbd061);})[_0x1c89('0x34')](function(_0x47210a){logger[_0x1c89('0x31')]('[%s][AUTOREPLY]\x20%s',_0x5c9cb9,JSON['stringify'](_0x47210a));})[_0x1c89('0x35')](function(_0x495a4a){logger['error'](_0x1c89('0x36'),_0x5c9cb9,JSON[_0x1c89('0x37')](_0x495a4a));})[_0x1c89('0x38')](function(){_0x30aa4d[_0x1c89('0x39')]();});}else{return rpc[this[_0x1c89('0xf')]+_0x1c89('0x20')][_0x1c89('0x33')](_0xbd061)['then'](function(_0x38699b){logger[_0x1c89('0x31')]('[%s][AUTOREPLY]\x20%s',_0x5c9cb9,_0xbd061[_0x1c89('0x11')]);})[_0x1c89('0x35')](function(_0x7427b4){logger[_0x1c89('0x3a')](_0x1c89('0xb'),_0x5c9cb9,JSON['stringify'](_0x7427b4));})[_0x1c89('0x38')](function(){_0x30aa4d[_0x1c89('0x39')]();});}}}catch(_0x31375a){logger['error'](_0x1c89('0xb'),_0x5c9cb9,JSON['stringify'](_0x31375a));_0x30aa4d[_0x1c89('0x3b')]();}};}; \ 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 dac1d50..eed6fc9 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 _0xf95f=['channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','stringify','[%s][CLOSE]\x20%s','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xf95f,0x142));var _0xff95=function(_0x44650b,_0x5af069){_0x44650b=_0x44650b-0x0;var _0x13b205=_0xf95f[_0x44650b];return _0x13b205;};'use strict';var moment=require(_0xff95('0x0'));var logger=require(_0xff95('0x1'))(_0xff95('0x2'));var rpc={'chatInteraction':require(_0xff95('0x3')),'openchannelInteraction':require(_0xff95('0x4')),'smsInteraction':require(_0xff95('0x5')),'mailInteraction':require(_0xff95('0x6')),'faxInteraction':require(_0xff95('0x7')),'whatsappInteraction':require(_0xff95('0x8'))};exports['consequence']=function(_0x46d787,_0x5da81b,_0x3f72b4,_0x4fb1ed){return function(_0x314fb4){try{logger[_0xff95('0x9')](_0xff95('0xa'),_0x46d787,_0x5da81b[0x0]);var _0x1a42b2={'closed':0x1,'closedAt':moment()[_0xff95('0xb')](_0xff95('0xc')),'closeReason':_0xff95('0xd'),'disposition':_0x5da81b[0x0]};if(rpc[_0x4fb1ed[_0xff95('0xe')]+'Interaction']){rpc[_0x4fb1ed['channel']+_0xff95('0xf')][_0xff95('0x10')](_0x4fb1ed[_0xff95('0x11')]['id'],_0x1a42b2)[_0xff95('0x12')](function(_0x2c9e56){logger[_0xff95('0x9')](_0xff95('0x13'),_0x46d787,_0x4fb1ed['interaction']['id']);})['catch'](function(_0x30fb50){logger[_0xff95('0x14')]('[%s][CLOSE]\x20%s',_0x46d787,JSON[_0xff95('0x15')](_0x30fb50));})['finally'](function(){_0x314fb4['stop']();});}}catch(_0x5d8005){logger[_0xff95('0x14')](_0xff95('0x16'),_0x46d787,JSON[_0xff95('0x15')](_0x5d8005));_0x314fb4[_0xff95('0x17')]();}};}; \ No newline at end of file +var _0xd819=['channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stringify','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0x26fade,_0x27bddd){var _0xc649f4=function(_0xd1f861){while(--_0xd1f861){_0x26fade['push'](_0x26fade['shift']());}};_0xc649f4(++_0x27bddd);}(_0xd819,0x181));var _0x9d81=function(_0x149de2,_0x5cbeec){_0x149de2=_0x149de2-0x0;var _0x59ffeb=_0xd819[_0x149de2];return _0x59ffeb;};'use strict';var moment=require('moment');var logger=require(_0x9d81('0x0'))(_0x9d81('0x1'));var rpc={'chatInteraction':require(_0x9d81('0x2')),'openchannelInteraction':require(_0x9d81('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x9d81('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x9d81('0x5'))};exports['consequence']=function(_0x382cc1,_0x239432,_0x3a4899,_0x565411){return function(_0xfc583e){try{logger[_0x9d81('0x6')](_0x9d81('0x7'),_0x382cc1,_0x239432[0x0]);var _0x1e1329={'closed':0x1,'closedAt':moment()[_0x9d81('0x8')](_0x9d81('0x9')),'closeReason':_0x9d81('0xa'),'disposition':_0x239432[0x0]};if(rpc[_0x565411[_0x9d81('0xb')]+_0x9d81('0xc')]){rpc[_0x565411[_0x9d81('0xb')]+_0x9d81('0xc')][_0x9d81('0xd')](_0x565411[_0x9d81('0xe')]['id'],_0x1e1329)[_0x9d81('0xf')](function(_0x53951a){logger[_0x9d81('0x6')](_0x9d81('0x10'),_0x382cc1,_0x565411['interaction']['id']);})[_0x9d81('0x11')](function(_0x3fb6b5){logger[_0x9d81('0x12')](_0x9d81('0x13'),_0x382cc1,JSON['stringify'](_0x3fb6b5));})[_0x9d81('0x14')](function(){_0xfc583e['stop']();});}}catch(_0x228553){logger['error'](_0x9d81('0x13'),_0x382cc1,JSON[_0x9d81('0x15')](_0x228553));_0xfc583e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 632e478..f74eea7 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 _0x8150=['out','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','create','then','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','dialogflow','result','fulfillment','providerName','providerResponse','Message','metadata','stop','catch','error','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0x8150,0x1a7));var _0x0815=function(_0x167145,_0x99f324){_0x167145=_0x167145-0x0;var _0x4f3c42=_0x8150[_0x167145];return _0x4f3c42;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0x0815('0x0'));var utils=require(_0x0815('0x1'));var logger=require(_0x0815('0x2'))(_0x0815('0x3'));var rpc={'chatMessage':require(_0x0815('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0815('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x0815('0x6')),'whatsappMessage':require(_0x0815('0x7'))};exports[_0x0815('0x8')]=function(_0x47cf9c,_0x3c2014){return function(_0x37c337){try{if(!_[_0x0815('0x9')](this[_0x0815('0xa')][_0x0815('0xb')])){logger[_0x0815('0xc')](_0x0815('0xd'),_0x47cf9c,_0x0815('0xe'));return _0x37c337[_0x0815('0xf')]();}var _0xc87972={'ContactId':this[_0x0815('0x10')]['id'],'sentAt':moment()[_0x0815('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x0815('0x12')};if(this[_0x0815('0x13')]==='sms'||this[_0x0815('0x13')]===_0x0815('0x14')){_0xc87972[_0x0815('0x15')]=this['interaction'][_0x0815('0x15')];}var _0x20fe78=this[_0x0815('0x13')];if(_0x20fe78===_0x0815('0x16')){_0xc87972[_0x0815('0x17')]=this['account']['id'];}else{_0xc87972[_[_0x0815('0x18')](_0x20fe78)+_0x0815('0x19')]=this[_0x0815('0x1a')]['id'];}_0xc87972[_[_0x0815('0x18')](_0x20fe78)+_0x0815('0x1b')]=this[_0x0815('0xa')]['id'];if(this[_0x0815('0xa')][_0x0815('0x1c')]){var _0x255a9c=_0x3c2014[0x2];if(!_[_0x0815('0x1d')](_0x255a9c)){_0xc87972[_0x0815('0x1e')]=utils[_0x0815('0x1f')](_0x255a9c,this);return rpc[_0x20fe78+'Message'][_0x0815('0x20')](_0xc87972)[_0x0815('0x21')](function(_0x5d6dc9){logger[_0x0815('0xc')](_0x0815('0xd'),_0x47cf9c,_0xc87972[_0x0815('0x1e')]);})['catch'](function(_0x3fac16){logger['error'](_0x0815('0xd'),_0x47cf9c,JSON[_0x0815('0x22')](_0x3fac16));})[_0x0815('0x23')](function(){logger[_0x0815('0xc')](_0x0815('0x24'),_0x47cf9c);_0x37c337['stop']();});}else{logger['info'](_0x0815('0x25'),_0x47cf9c);_0x37c337['stop']();}}else{var _0x417ca4=this;var _0x3e6bcf=apiai(_0x3c2014[0x0],{'language':_0x3c2014[0x1]||'en'});return _0x3e6bcf['textRequest'](this[_0x0815('0x26')][_0x0815('0x1e')],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0x9042ed){_0x417ca4[_0x0815('0x1e')][_0x0815('0x27')]=_0x9042ed;_0xc87972['body']=_0x9042ed[_0x0815('0x28')][_0x0815('0x29')]['speech'];_0xc87972[_0x0815('0x2a')]=_0x0815('0x27');_0xc87972[_0x0815('0x2b')]=JSON[_0x0815('0x22')](_0x9042ed);return rpc[_0x20fe78+_0x0815('0x2c')]['create'](_0xc87972)[_0x0815('0x21')](function(_0x3bc37a){logger[_0x0815('0xc')](_0x0815('0xd'),_0x47cf9c,_0xc87972[_0x0815('0x1e')]);if(_0x9042ed['result'][_0x0815('0x2d')]['endConversation']){_0x37c337['next']();}else{_0x37c337[_0x0815('0x2e')]();}})[_0x0815('0x2f')](function(_0x6369e7){logger[_0x0815('0x30')](_0x0815('0xd'),_0x47cf9c,JSON['stringify'](_0x6369e7));_0x37c337['next']();});})[_0x0815('0x2f')](function(_0xeefd29){logger['error'](_0x0815('0xd'),_0x47cf9c,_0xeefd29[_0x0815('0x26')]);_0x37c337[_0x0815('0xf')]();});}}catch(_0x53b2f8){logger[_0x0815('0x30')](_0x0815('0xd'),_0x47cf9c,JSON[_0x0815('0x22')](_0x53b2f8));_0x37c337[_0x0815('0x2e')]();}};}; \ No newline at end of file +var _0xbb98=['YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','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!','dialogflow','result','fulfillment','speech','providerName','metadata','endConversation','next','message','lodash','moment','apiai-promise','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','contact','format'];(function(_0x355f07,_0x4606eb){var _0x12b0d3=function(_0x3ad78a){while(--_0x3ad78a){_0x355f07['push'](_0x355f07['shift']());}};_0x12b0d3(++_0x4606eb);}(_0xbb98,0x140));var _0x8bb9=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0xbb98[_0x3e0b8f];return _0x22f742;};'use strict';var _=require(_0x8bb9('0x0'));var moment=require(_0x8bb9('0x1'));var apiai=require(_0x8bb9('0x2'));var md5=require('md5');var utils=require('./utils');var logger=require(_0x8bb9('0x3'))(_0x8bb9('0x4'));var rpc={'chatMessage':require(_0x8bb9('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8bb9('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8bb9('0x7')),'whatsappMessage':require(_0x8bb9('0x8'))};exports[_0x8bb9('0x9')]=function(_0xb341ef,_0x24e8b1){return function(_0x58967d){try{if(!_['isNil'](this[_0x8bb9('0xa')][_0x8bb9('0xb')])){logger[_0x8bb9('0xc')](_0x8bb9('0xd'),_0xb341ef,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x58967d['next']();}var _0x5bbb1e={'ContactId':this[_0x8bb9('0xe')]['id'],'sentAt':moment()[_0x8bb9('0xf')](_0x8bb9('0x10')),'direction':_0x8bb9('0x11')};if(this['channel']==='sms'||this[_0x8bb9('0x12')]==='whatsapp'){_0x5bbb1e[_0x8bb9('0x13')]=this[_0x8bb9('0xa')]['phone'];}var _0x61bf4a=this[_0x8bb9('0x12')];if(_0x61bf4a===_0x8bb9('0x14')){_0x5bbb1e[_0x8bb9('0x15')]=this[_0x8bb9('0x16')]['id'];}else{_0x5bbb1e[_[_0x8bb9('0x17')](_0x61bf4a)+_0x8bb9('0x18')]=this[_0x8bb9('0x16')]['id'];}_0x5bbb1e[_[_0x8bb9('0x17')](_0x61bf4a)+_0x8bb9('0x19')]=this['interaction']['id'];if(this[_0x8bb9('0xa')]['created']){var _0x324c73=_0x24e8b1[0x2];if(!_[_0x8bb9('0x1a')](_0x324c73)){_0x5bbb1e[_0x8bb9('0x1b')]=utils[_0x8bb9('0x1c')](_0x324c73,this);return rpc[_0x61bf4a+_0x8bb9('0x1d')][_0x8bb9('0x1e')](_0x5bbb1e)[_0x8bb9('0x1f')](function(_0x38b5fc){logger[_0x8bb9('0xc')]('[%s][DIALOGFLOW]\x20%s',_0xb341ef,_0x5bbb1e[_0x8bb9('0x1b')]);})[_0x8bb9('0x20')](function(_0x4806be){logger[_0x8bb9('0x21')](_0x8bb9('0xd'),_0xb341ef,JSON[_0x8bb9('0x22')](_0x4806be));})[_0x8bb9('0x23')](function(){logger[_0x8bb9('0xc')](_0x8bb9('0x24'),_0xb341ef);_0x58967d[_0x8bb9('0x25')]();});}else{logger[_0x8bb9('0xc')](_0x8bb9('0x26'),_0xb341ef);_0x58967d[_0x8bb9('0x25')]();}}else{var _0x22688d=this;var _0x24d33a=apiai(_0x24e8b1[0x0],{'language':_0x24e8b1[0x1]||'en'});return _0x24d33a['textRequest'](this['message']['body'],{'sessionId':md5(this[_0x8bb9('0xa')]['id'])})[_0x8bb9('0x1f')](function(_0x361da8){_0x22688d['body'][_0x8bb9('0x27')]=_0x361da8;_0x5bbb1e['body']=_0x361da8[_0x8bb9('0x28')][_0x8bb9('0x29')][_0x8bb9('0x2a')];_0x5bbb1e[_0x8bb9('0x2b')]=_0x8bb9('0x27');_0x5bbb1e['providerResponse']=JSON[_0x8bb9('0x22')](_0x361da8);return rpc[_0x61bf4a+_0x8bb9('0x1d')][_0x8bb9('0x1e')](_0x5bbb1e)[_0x8bb9('0x1f')](function(_0x4575a7){logger[_0x8bb9('0xc')](_0x8bb9('0xd'),_0xb341ef,_0x5bbb1e[_0x8bb9('0x1b')]);if(_0x361da8[_0x8bb9('0x28')][_0x8bb9('0x2c')][_0x8bb9('0x2d')]){_0x58967d[_0x8bb9('0x2e')]();}else{_0x58967d['stop']();}})[_0x8bb9('0x20')](function(_0x5ca9bf){logger['error'](_0x8bb9('0xd'),_0xb341ef,JSON[_0x8bb9('0x22')](_0x5ca9bf));_0x58967d['next']();});})[_0x8bb9('0x20')](function(_0x5bd44f){logger[_0x8bb9('0x21')](_0x8bb9('0xd'),_0xb341ef,_0x5bd44f[_0x8bb9('0x2f')]);_0x58967d[_0x8bb9('0x2e')]();});}}catch(_0x167d94){logger[_0x8bb9('0x21')](_0x8bb9('0xd'),_0xb341ef,JSON[_0x8bb9('0x22')](_0x167d94));_0x58967d[_0x8bb9('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 7456e4e..adf4608 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c4d=['DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','stop','lodash','dialogflow','moment','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','error','stringify','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','info','catch','finally','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','diagnosticInfo','fields','queryResult','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','displayName','intent','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText'];(function(_0x1ff68a,_0x30028d){var _0x4f5dd0=function(_0x11e783){while(--_0x11e783){_0x1ff68a['push'](_0x1ff68a['shift']());}};_0x4f5dd0(++_0x30028d);}(_0x1c4d,0x19f));var _0xd1c4=function(_0x405e1a,_0x59ec1d){_0x405e1a=_0x405e1a-0x0;var _0x56e7d5=_0x1c4d[_0x405e1a];return _0x56e7d5;};'use strict';var _=require(_0xd1c4('0x0'));var dialogflow=require(_0xd1c4('0x1'));var md5=require('md5');var moment=require(_0xd1c4('0x2'));var Promise=require('bluebird');var logger=require(_0xd1c4('0x3'))('routing');var utils=require(_0xd1c4('0x4'));var rpc={'chatMessage':require(_0xd1c4('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xd1c4('0x6')),'smsMessage':require(_0xd1c4('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xd1c4('0x8'))};function createMessage(_0x2c8efa,_0x2412ed,_0x422230,_0x1fd559){return new Promise(function(_0x13942c,_0x54ffa6){var _0x780340=_[_0xd1c4('0x9')](_0x422230);_0x780340[_0xd1c4('0xa')]=_0x1fd559;return rpc[_0x2412ed+_0xd1c4('0xb')][_0xd1c4('0xc')](_0x780340)[_0xd1c4('0xd')](function(){logger['info'](_0xd1c4('0xe'),_0x2c8efa,_0x780340[_0xd1c4('0xa')]);_0x13942c();})['catch'](function(_0x47e825){logger[_0xd1c4('0xf')](_0xd1c4('0xe'),_0x2c8efa,JSON[_0xd1c4('0x10')](_0x47e825));_0x54ffa6(_0x47e825);});});}exports['consequence']=function(_0xf8e2bf,_0x5919e8){return function(_0x4b8138){try{if(!_[_0xd1c4('0x11')](this[_0xd1c4('0x12')][_0xd1c4('0x13')])){logger['info'](_0xd1c4('0xe'),_0xf8e2bf,_0xd1c4('0x14'));return _0x4b8138[_0xd1c4('0x15')]();}var _0x59a4f7={'ContactId':this['contact']['id'],'sentAt':moment()[_0xd1c4('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xd1c4('0x17')};if(this[_0xd1c4('0x18')]==='sms'||this[_0xd1c4('0x18')]===_0xd1c4('0x19')){_0x59a4f7['phone']=this[_0xd1c4('0x12')][_0xd1c4('0x1a')];}var _0x5f48c8=this['channel'];if(_0x5f48c8===_0xd1c4('0x1b')){_0x59a4f7[_0xd1c4('0x1c')]=this[_0xd1c4('0x1d')]['id'];}else{_0x59a4f7[_[_0xd1c4('0x1e')](_0x5f48c8)+_0xd1c4('0x1f')]=this['account']['id'];}_0x59a4f7[_['upperFirst'](_0x5f48c8)+_0xd1c4('0x20')]=this[_0xd1c4('0x12')]['id'];if(this[_0xd1c4('0x12')][_0xd1c4('0x21')]){var _0x13d61d=_0x5919e8[0x4];if(!_[_0xd1c4('0x22')](_0x13d61d)){_0x59a4f7[_0xd1c4('0xa')]=utils[_0xd1c4('0x23')](_0x13d61d,this);return rpc[_0x5f48c8+_0xd1c4('0xb')][_0xd1c4('0xc')](_0x59a4f7)[_0xd1c4('0xd')](function(_0x2ecaca){logger[_0xd1c4('0x24')](_0xd1c4('0xe'),_0xf8e2bf,_0x59a4f7[_0xd1c4('0xa')]);})[_0xd1c4('0x25')](function(_0x2670c1){logger[_0xd1c4('0xf')](_0xd1c4('0xe'),_0xf8e2bf,JSON[_0xd1c4('0x10')](_0x2670c1));})[_0xd1c4('0x26')](function(){logger[_0xd1c4('0x24')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xf8e2bf);_0x4b8138['stop']();});}else{logger[_0xd1c4('0x24')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0xf8e2bf);_0x4b8138['stop']();}}else{var _0x343068=this;var _0x3e2949=_0x5919e8[0x2][_0xd1c4('0x27')](/\\n/g,'\x0a');var _0x1a9c7f={'credentials':{'private_key':_0x3e2949,'client_email':_0x5919e8[0x1]}};var _0x5a41f0=new dialogflow[(_0xd1c4('0x28'))](_0x1a9c7f);var _0x50b5a4=_0x5a41f0[_0xd1c4('0x29')](_0x5919e8[0x0],md5(_0x343068[_0xd1c4('0x12')]['id']));var _0x356a90={'session':_0x50b5a4,'queryInput':{'text':{'text':_0x343068[_0xd1c4('0x2a')][_0xd1c4('0xa')],'languageCode':_0x5919e8[0x3]||'en'}}};return _0x5a41f0[_0xd1c4('0x2b')](_0x356a90)[_0xd1c4('0xd')](function(_0x591be8){if(_0x591be8&&_0x591be8[_0xd1c4('0x2c')]){_0x343068['body'][_0xd1c4('0x2d')]=_0x591be8;var _0x1287ad=_0x591be8[0x0];var _0x327997=_0x1287ad['queryResult']['diagnosticInfo']&&_0x1287ad['queryResult'][_0xd1c4('0x2e')][_0xd1c4('0x2f')]?_0x1287ad[_0xd1c4('0x30')][_0xd1c4('0x2e')][_0xd1c4('0x2f')]['end_conversation'][_0xd1c4('0x31')]:![];_0x343068[_0xd1c4('0xa')]['DIALOGFLOWV2_ACTION']=_0x1287ad[_0xd1c4('0x30')][_0xd1c4('0x32')];_0x343068[_0xd1c4('0xa')][_0xd1c4('0x33')]=_0x1287ad['queryResult'][_0xd1c4('0x34')];_0x343068[_0xd1c4('0xa')][_0xd1c4('0x35')]=_0x1287ad['queryResult'][_0xd1c4('0x2e')]&&_0x1287ad[_0xd1c4('0x30')]['diagnosticInfo'][_0xd1c4('0x2f')]?_0x1287ad['queryResult'][_0xd1c4('0x2e')][_0xd1c4('0x2f')]['end_conversation'][_0xd1c4('0x31')]:![];_0x343068[_0xd1c4('0xa')]['DIALOGFLOWV2_INTENTNAME']=_0x1287ad[_0xd1c4('0x30')]['intent']['name'];_0x343068[_0xd1c4('0xa')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x1287ad[_0xd1c4('0x30')]['intent'][_0xd1c4('0x36')];_0x343068[_0xd1c4('0xa')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x1287ad['queryResult'][_0xd1c4('0x37')][_0xd1c4('0x38')];_0x343068[_0xd1c4('0xa')][_0xd1c4('0x39')]=_0x1287ad[_0xd1c4('0x30')][_0xd1c4('0x3a')];_0x343068[_0xd1c4('0xa')][_0xd1c4('0x3b')]=_0x1287ad['queryResult'][_0xd1c4('0x3c')];_0x343068[_0xd1c4('0xa')][_0xd1c4('0x3d')]=_0x1287ad[_0xd1c4('0x30')][_0xd1c4('0x3e')];_0x59a4f7[_0xd1c4('0x3f')]='dialogflowV2';_0x59a4f7[_0xd1c4('0x40')]=JSON[_0xd1c4('0x10')](_0x591be8);var _0xe48144=[];for(var _0x53ada7=0x0;_0x53ada7<_0x591be8['length'];_0x53ada7++){var _0x20f752=_0x591be8[_0x53ada7];if(_0x20f752&&_0x20f752[_0xd1c4('0x30')]&&_0x20f752[_0xd1c4('0x30')][_0xd1c4('0x41')]){_0xe48144[_0xd1c4('0x42')](createMessage(_0xf8e2bf,_0x5f48c8,_0x59a4f7,_0x20f752[_0xd1c4('0x30')][_0xd1c4('0x41')]));}}return Promise['all'](_0xe48144)[_0xd1c4('0xd')](function(){if(_0x327997){_0x4b8138['next']();}else{_0x4b8138['stop']();}})['catch'](function(_0x427b7f){logger[_0xd1c4('0xf')](_0xd1c4('0xe'),_0xf8e2bf,JSON['stringify'](_0x427b7f));_0x4b8138[_0xd1c4('0x15')]();});}})[_0xd1c4('0x25')](function(_0xa0719d){logger['error'](_0xd1c4('0xe'),_0xf8e2bf,_0xa0719d[_0xd1c4('0x2a')]);_0x4b8138['next']();});}}catch(_0x46f103){logger[_0xd1c4('0xf')](_0xd1c4('0xe'),_0xf8e2bf,JSON['stringify'](_0x46f103));_0x4b8138[_0xd1c4('0x43')]();}};}; \ No newline at end of file +var _0xa1e0=['dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','clone','body','Message','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','created','getMustacheRender','create','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','fulfillmentText','push','all','then','next','message','lodash'];(function(_0x436bed,_0x5d3387){var _0x5dc636=function(_0x21b5b6){while(--_0x21b5b6){_0x436bed['push'](_0x436bed['shift']());}};_0x5dc636(++_0x5d3387);}(_0xa1e0,0x1bb));var _0x0a1e=function(_0x3d0cd0,_0x48719b){_0x3d0cd0=_0x3d0cd0-0x0;var _0x205d7c=_0xa1e0[_0x3d0cd0];return _0x205d7c;};'use strict';var _=require(_0x0a1e('0x0'));var dialogflow=require(_0x0a1e('0x1'));var md5=require(_0x0a1e('0x2'));var moment=require(_0x0a1e('0x3'));var Promise=require(_0x0a1e('0x4'));var logger=require(_0x0a1e('0x5'))(_0x0a1e('0x6'));var utils=require(_0x0a1e('0x7'));var rpc={'chatMessage':require(_0x0a1e('0x8')),'openchannelMessage':require(_0x0a1e('0x9')),'mailMessage':require(_0x0a1e('0xa')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x0a1e('0xb'))};function createMessage(_0x5c10c9,_0x505afa,_0x34981e,_0x5e121d){return new Promise(function(_0x4fd1e0,_0x4342db){var _0x1c5477=_[_0x0a1e('0xc')](_0x34981e);_0x1c5477[_0x0a1e('0xd')]=_0x5e121d;return rpc[_0x505afa+_0x0a1e('0xe')]['create'](_0x1c5477)['then'](function(){logger[_0x0a1e('0xf')](_0x0a1e('0x10'),_0x5c10c9,_0x1c5477[_0x0a1e('0xd')]);_0x4fd1e0();})[_0x0a1e('0x11')](function(_0x20698e){logger[_0x0a1e('0x12')](_0x0a1e('0x10'),_0x5c10c9,JSON[_0x0a1e('0x13')](_0x20698e));_0x4342db(_0x20698e);});});}exports['consequence']=function(_0x3bd9d7,_0x295dce){return function(_0x42af83){try{if(!_[_0x0a1e('0x14')](this['interaction'][_0x0a1e('0x15')])){logger['info'](_0x0a1e('0x10'),_0x3bd9d7,_0x0a1e('0x16'));return _0x42af83['next']();}var _0xc4f08e={'ContactId':this[_0x0a1e('0x17')]['id'],'sentAt':moment()[_0x0a1e('0x18')](_0x0a1e('0x19')),'direction':_0x0a1e('0x1a')};if(this['channel']===_0x0a1e('0x1b')||this[_0x0a1e('0x1c')]==='whatsapp'){_0xc4f08e[_0x0a1e('0x1d')]=this[_0x0a1e('0x1e')][_0x0a1e('0x1d')];}var _0x30e77c=this[_0x0a1e('0x1c')];if(_0x30e77c===_0x0a1e('0x1f')){_0xc4f08e[_0x0a1e('0x20')]=this[_0x0a1e('0x21')]['id'];}else{_0xc4f08e[_[_0x0a1e('0x22')](_0x30e77c)+_0x0a1e('0x23')]=this['account']['id'];}_0xc4f08e[_[_0x0a1e('0x22')](_0x30e77c)+'InteractionId']=this['interaction']['id'];if(this[_0x0a1e('0x1e')][_0x0a1e('0x24')]){var _0x420026=_0x295dce[0x4];if(!_['isEmpty'](_0x420026)){_0xc4f08e['body']=utils[_0x0a1e('0x25')](_0x420026,this);return rpc[_0x30e77c+_0x0a1e('0xe')][_0x0a1e('0x26')](_0xc4f08e)['then'](function(_0x216b19){logger[_0x0a1e('0xf')](_0x0a1e('0x10'),_0x3bd9d7,_0xc4f08e[_0x0a1e('0xd')]);})['catch'](function(_0x438e71){logger[_0x0a1e('0x12')](_0x0a1e('0x10'),_0x3bd9d7,JSON[_0x0a1e('0x13')](_0x438e71));})[_0x0a1e('0x27')](function(){logger['info'](_0x0a1e('0x28'),_0x3bd9d7);_0x42af83[_0x0a1e('0x29')]();});}else{logger[_0x0a1e('0xf')](_0x0a1e('0x2a'),_0x3bd9d7);_0x42af83[_0x0a1e('0x29')]();}}else{var _0x55525a=this;var _0x4da163=_0x295dce[0x2][_0x0a1e('0x2b')](/\\n/g,'\x0a');var _0x279fc5={'credentials':{'private_key':_0x4da163,'client_email':_0x295dce[0x1]}};var _0x53664a=new dialogflow[(_0x0a1e('0x2c'))](_0x279fc5);var _0x556eeb=_0x53664a[_0x0a1e('0x2d')](_0x295dce[0x0],md5(_0x55525a[_0x0a1e('0x1e')]['id']));var _0x290941={'session':_0x556eeb,'queryInput':{'text':{'text':_0x55525a['message']['body'],'languageCode':_0x295dce[0x3]||'en'}}};return _0x53664a[_0x0a1e('0x2e')](_0x290941)['then'](function(_0x314578){if(_0x314578&&_0x314578[_0x0a1e('0x2f')]){_0x55525a[_0x0a1e('0xd')][_0x0a1e('0x30')]=_0x314578;var _0x3e79f7=_0x314578[0x0];var _0x35d7b5=_0x3e79f7[_0x0a1e('0x31')][_0x0a1e('0x32')]&&_0x3e79f7[_0x0a1e('0x31')][_0x0a1e('0x32')]['fields']?_0x3e79f7['queryResult']['diagnosticInfo'][_0x0a1e('0x33')]['end_conversation'][_0x0a1e('0x34')]:![];_0x55525a[_0x0a1e('0xd')][_0x0a1e('0x35')]=_0x3e79f7['queryResult']['action'];_0x55525a[_0x0a1e('0xd')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x3e79f7[_0x0a1e('0x31')][_0x0a1e('0x36')];_0x55525a[_0x0a1e('0xd')][_0x0a1e('0x37')]=_0x3e79f7[_0x0a1e('0x31')][_0x0a1e('0x32')]&&_0x3e79f7[_0x0a1e('0x31')][_0x0a1e('0x32')][_0x0a1e('0x33')]?_0x3e79f7[_0x0a1e('0x31')][_0x0a1e('0x32')][_0x0a1e('0x33')][_0x0a1e('0x38')][_0x0a1e('0x34')]:![];_0x55525a[_0x0a1e('0xd')]['DIALOGFLOWV2_INTENTNAME']=_0x3e79f7[_0x0a1e('0x31')][_0x0a1e('0x39')][_0x0a1e('0x3a')];_0x55525a[_0x0a1e('0xd')][_0x0a1e('0x3b')]=_0x3e79f7[_0x0a1e('0x31')][_0x0a1e('0x39')][_0x0a1e('0x3c')];_0x55525a[_0x0a1e('0xd')][_0x0a1e('0x3d')]=_0x3e79f7['queryResult']['intent'][_0x0a1e('0x3e')];_0x55525a['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x3e79f7[_0x0a1e('0x31')][_0x0a1e('0x3f')];_0x55525a['body'][_0x0a1e('0x40')]=_0x3e79f7[_0x0a1e('0x31')][_0x0a1e('0x41')];_0x55525a[_0x0a1e('0xd')]['DIALOGFLOWV2_SCORE']=_0x3e79f7['queryResult'][_0x0a1e('0x42')];_0xc4f08e[_0x0a1e('0x43')]='dialogflowV2';_0xc4f08e['providerResponse']=JSON[_0x0a1e('0x13')](_0x314578);var _0x336a79=[];for(var _0x5edb26=0x0;_0x5edb26<_0x314578[_0x0a1e('0x2f')];_0x5edb26++){var _0x309e9d=_0x314578[_0x5edb26];if(_0x309e9d&&_0x309e9d[_0x0a1e('0x31')]&&_0x309e9d[_0x0a1e('0x31')][_0x0a1e('0x44')]){_0x336a79[_0x0a1e('0x45')](createMessage(_0x3bd9d7,_0x30e77c,_0xc4f08e,_0x309e9d[_0x0a1e('0x31')][_0x0a1e('0x44')]));}}return Promise[_0x0a1e('0x46')](_0x336a79)[_0x0a1e('0x47')](function(){if(_0x35d7b5){_0x42af83[_0x0a1e('0x48')]();}else{_0x42af83[_0x0a1e('0x29')]();}})['catch'](function(_0x42b2d7){logger[_0x0a1e('0x12')](_0x0a1e('0x10'),_0x3bd9d7,JSON['stringify'](_0x42b2d7));_0x42af83[_0x0a1e('0x48')]();});}})['catch'](function(_0x45a068){logger[_0x0a1e('0x12')](_0x0a1e('0x10'),_0x3bd9d7,_0x45a068[_0x0a1e('0x49')]);_0x42af83[_0x0a1e('0x48')]();});}}catch(_0xf04fc2){logger[_0x0a1e('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x3bd9d7,JSON['stringify'](_0xf04fc2));_0x42af83[_0x0a1e('0x29')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 13db0e5..b53590f 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 _0x7b97=['condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','validate','length','error','[%s][GOTOIF]\x20%s','map','message','stop'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7b97,0x67));var _0x77b9=function(_0x242566,_0x4ec88d){_0x242566=_0x242566-0x0;var _0x1bc410=_0x7b97[_0x242566];return _0x1bc410;};'use strict';var schema=require('validate');var _=require(_0x77b9('0x0'));var htmlToText=require(_0x77b9('0x1'));var utils=require(_0x77b9('0x2'));var logger=require(_0x77b9('0x3'))(_0x77b9('0x4'));var gotoif=schema({'condition':{'type':_0x77b9('0x5'),'required':!![],'message':_0x77b9('0x6')},'priorityTrue':{'type':_0x77b9('0x7'),'message':_0x77b9('0x8')},'priorityFalse':{'type':'number','message':_0x77b9('0x9')}});exports[_0x77b9('0xa')]=function(_0x3c92df,_0x3d0ca8){return function(_0x4fd0e4){try{var _0x483236={'condition':htmlToText[_0x77b9('0xb')](utils[_0x77b9('0xc')](_0x3d0ca8[0x0],this),{'wordwrap':![]})[_0x77b9('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3d0ca8[0x1],'priorityFalse':_0x3d0ca8[0x2]};var _0x53fca9=gotoif[_0x77b9('0xe')](_0x483236,{'typecast':!![]});if(_0x53fca9[_0x77b9('0xf')]){logger[_0x77b9('0x10')](_0x77b9('0x11'),_0x3c92df,_[_0x77b9('0x12')](_0x53fca9,_0x77b9('0x13'))['join'](',\x20'));_0x4fd0e4[_0x77b9('0x14')]();}else{try{var _0x56cb33=eval('('+_0x483236[_0x77b9('0x15')]+')');var _0x39fe25=_0x56cb33?_0x483236['priorityTrue']:_0x483236[_0x77b9('0x16')];logger[_0x77b9('0x17')](_0x77b9('0x18'),_0x3c92df,_0x483236[_0x77b9('0x15')],_0x56cb33,_0x39fe25||_0x77b9('0x19'));if(_0x39fe25){var _0x19c177=_[_0x77b9('0x1a')](_0x4fd0e4[_0x77b9('0x1b')](),{'p':_0x39fe25});if(_0x19c177>=0x0){logger[_0x77b9('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3c92df,_0x39fe25||_0x77b9('0x19'),_0x19c177);_0x4fd0e4[_0x77b9('0x19')](_0x19c177);}else{logger[_0x77b9('0x17')](_0x77b9('0x1c'),_0x3c92df,_0x39fe25||_0x77b9('0x19'));_0x4fd0e4[_0x77b9('0x14')]();}}else{_0x4fd0e4[_0x77b9('0x19')]();}}catch(_0x5a443a){logger[_0x77b9('0x10')](_0x77b9('0x1d'),_0x3c92df,_0x5a443a[_0x77b9('0x13')]);_0x4fd0e4[_0x77b9('0x14')]();}}}catch(_0x550f24){logger[_0x77b9('0x10')]('[%s][GOTOIF]\x20%s',_0x3c92df,JSON[_0x77b9('0x1e')](_0x550f24));_0x4fd0e4[_0x77b9('0x14')]();}};}; \ No newline at end of file +var _0x8344=['../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','error','map','message','join','stop','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','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text'];(function(_0x41b0f6,_0x5c51eb){var _0x112ce2=function(_0x127843){while(--_0x127843){_0x41b0f6['push'](_0x41b0f6['shift']());}};_0x112ce2(++_0x5c51eb);}(_0x8344,0x131));var _0x4834=function(_0x157ade,_0x22fa84){_0x157ade=_0x157ade-0x0;var _0x3b60a9=_0x8344[_0x157ade];return _0x3b60a9;};'use strict';var schema=require(_0x4834('0x0'));var _=require(_0x4834('0x1'));var htmlToText=require(_0x4834('0x2'));var utils=require('./utils');var logger=require(_0x4834('0x3'))(_0x4834('0x4'));var gotoif=schema({'condition':{'type':_0x4834('0x5'),'required':!![],'message':_0x4834('0x6')},'priorityTrue':{'type':'number','message':_0x4834('0x7')},'priorityFalse':{'type':'number','message':_0x4834('0x8')}});exports[_0x4834('0x9')]=function(_0x307663,_0x22bfd9){return function(_0x9ef5ff){try{var _0x3033be={'condition':htmlToText[_0x4834('0xa')](utils['getMustacheRender'](_0x22bfd9[0x0],this),{'wordwrap':![]})[_0x4834('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x22bfd9[0x1],'priorityFalse':_0x22bfd9[0x2]};var _0xee88e=gotoif[_0x4834('0x0')](_0x3033be,{'typecast':!![]});if(_0xee88e['length']){logger[_0x4834('0xc')]('[%s][GOTOIF]\x20%s',_0x307663,_[_0x4834('0xd')](_0xee88e,_0x4834('0xe'))[_0x4834('0xf')](',\x20'));_0x9ef5ff[_0x4834('0x10')]();}else{try{var _0x53025f=eval('('+_0x3033be['condition']+')');var _0x47d6d2=_0x53025f?_0x3033be[_0x4834('0x11')]:_0x3033be[_0x4834('0x12')];logger[_0x4834('0x13')](_0x4834('0x14'),_0x307663,_0x3033be[_0x4834('0x15')],_0x53025f,_0x47d6d2||_0x4834('0x16'));if(_0x47d6d2){var _0x2393d5=_[_0x4834('0x17')](_0x9ef5ff[_0x4834('0x18')](),{'p':_0x47d6d2});if(_0x2393d5>=0x0){logger[_0x4834('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x307663,_0x47d6d2||_0x4834('0x16'),_0x2393d5);_0x9ef5ff[_0x4834('0x16')](_0x2393d5);}else{logger[_0x4834('0x13')](_0x4834('0x19'),_0x307663,_0x47d6d2||_0x4834('0x16'));_0x9ef5ff['stop']();}}else{_0x9ef5ff[_0x4834('0x16')]();}}catch(_0x5c5596){logger[_0x4834('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x307663,_0x5c5596[_0x4834('0xe')]);_0x9ef5ff[_0x4834('0x10')]();}}}catch(_0x4df12d){logger[_0x4834('0xc')](_0x4834('0x1a'),_0x307663,JSON[_0x4834('0x1b')](_0x4df12d));_0x9ef5ff['stop']();}};}; \ 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 95af27e..ec8865a 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 _0xad8e=['consequence','length','error','[%s][GOTOP]\x20%s','map','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x218d7d,_0x4bad5b){var _0x6817c1=function(_0x46776a){while(--_0x46776a){_0x218d7d['push'](_0x218d7d['shift']());}};_0x6817c1(++_0x4bad5b);}(_0xad8e,0x73));var _0xead8=function(_0x182d39,_0x5739a5){_0x182d39=_0x182d39-0x0;var _0x3b75eb=_0xad8e[_0x182d39];return _0x3b75eb;};'use strict';var schema=require(_0xead8('0x0'));var _=require(_0xead8('0x1'));var logger=require(_0xead8('0x2'))('routing');var gotop=schema({'priority':{'type':_0xead8('0x3'),'required':!![],'message':_0xead8('0x4')}});exports[_0xead8('0x5')]=function(_0x39eb1a,_0x19f66b){return function(_0x3e8988){try{var _0x53d836={'priority':_0x19f66b[0x0]};var _0x1f5d7f=gotop['validate'](_0x53d836,{'typecast':!![]});if(_0x1f5d7f[_0xead8('0x6')]){logger[_0xead8('0x7')](_0xead8('0x8'),_0x39eb1a,_[_0xead8('0x9')](_0x1f5d7f,'message')['join'](',\x20'));_0x3e8988[_0xead8('0xa')]();}else{logger[_0xead8('0xb')](_0xead8('0xc'),_0x39eb1a,_0x53d836[_0xead8('0xd')]);if(_0x53d836[_0xead8('0xd')]){var _0x27086a=_[_0xead8('0xe')](_0x3e8988[_0xead8('0xf')](),{'p':_0x53d836[_0xead8('0xd')]});if(_0x27086a>=0x0){logger['info'](_0xead8('0x10'),_0x39eb1a,_0x53d836['priority']||_0xead8('0x11'),_0x27086a);_0x3e8988['next'](_0x27086a);}else{logger[_0xead8('0xb')](_0xead8('0x12'),_0x39eb1a,_0x53d836[_0xead8('0xd')]||_0xead8('0x11'));_0x3e8988['stop']();}}else{_0x3e8988[_0xead8('0x11')]();}}}catch(_0x25909e){logger[_0xead8('0x7')](_0xead8('0x8'),_0x39eb1a,JSON[_0xead8('0x13')](_0x25909e));_0x3e8988[_0xead8('0xa')]();}};}; \ No newline at end of file +var _0xf566=['stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf566,0x109));var _0x6f56=function(_0x337d86,_0x12d2d4){_0x337d86=_0x337d86-0x0;var _0x22fd02=_0xf566[_0x337d86];return _0x22fd02;};'use strict';var schema=require(_0x6f56('0x0'));var _=require(_0x6f56('0x1'));var logger=require(_0x6f56('0x2'))(_0x6f56('0x3'));var gotop=schema({'priority':{'type':_0x6f56('0x4'),'required':!![],'message':_0x6f56('0x5')}});exports[_0x6f56('0x6')]=function(_0x3f5c25,_0x291aa8){return function(_0x221961){try{var _0x195704={'priority':_0x291aa8[0x0]};var _0x4080ba=gotop[_0x6f56('0x0')](_0x195704,{'typecast':!![]});if(_0x4080ba['length']){logger[_0x6f56('0x7')](_0x6f56('0x8'),_0x3f5c25,_[_0x6f56('0x9')](_0x4080ba,_0x6f56('0xa'))[_0x6f56('0xb')](',\x20'));_0x221961[_0x6f56('0xc')]();}else{logger['info'](_0x6f56('0xd'),_0x3f5c25,_0x195704[_0x6f56('0xe')]);if(_0x195704[_0x6f56('0xe')]){var _0xa50079=_[_0x6f56('0xf')](_0x221961[_0x6f56('0x10')](),{'p':_0x195704[_0x6f56('0xe')]});if(_0xa50079>=0x0){logger['info'](_0x6f56('0x11'),_0x3f5c25,_0x195704['priority']||_0x6f56('0x12'),_0xa50079);_0x221961['next'](_0xa50079);}else{logger[_0x6f56('0x13')](_0x6f56('0x14'),_0x3f5c25,_0x195704['priority']||_0x6f56('0x12'));_0x221961[_0x6f56('0xc')]();}}else{_0x221961[_0x6f56('0x12')]();}}}catch(_0x308265){logger[_0x6f56('0x7')](_0x6f56('0x8'),_0x3f5c25,JSON[_0x6f56('0x15')](_0x308265));_0x221961[_0x6f56('0xc')]();}};}; \ 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 b8cd7ba..055de0e 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 _0xe1bf=['create','then','info','body','next','catch','[%s][MESSAGE]\x20%s','stringify','stop','error','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message'];(function(_0x5c92f7,_0x17381f){var _0x452cc1=function(_0x374c83){while(--_0x374c83){_0x5c92f7['push'](_0x5c92f7['shift']());}};_0x452cc1(++_0x17381f);}(_0xe1bf,0x1e6));var _0xfe1b=function(_0x338f4e,_0x4e9802){_0x338f4e=_0x338f4e-0x0;var _0x28bf05=_0xe1bf[_0x338f4e];return _0x28bf05;};'use strict';var _=require(_0xfe1b('0x0'));var utils=require('./utils');var logger=require(_0xfe1b('0x1'))(_0xfe1b('0x2'));var rpc={'chatMessage':require(_0xfe1b('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xfe1b('0x4')),'smsMessage':require(_0xfe1b('0x5')),'faxMessage':require(_0xfe1b('0x6')),'whatsappMessage':require(_0xfe1b('0x7'))};exports['consequence']=function(_0x1ea1d3,_0x135d5e){return function(_0x169261){try{var _0x1aafd4={'body':utils[_0xfe1b('0x8')](_0x135d5e[0x0],this),'ContactId':this['contact']['id']};if(this[_0xfe1b('0x9')]===_0xfe1b('0xa')){_0x1aafd4[_0xfe1b('0xb')]=this[_0xfe1b('0xc')]['id'];}else{_0x1aafd4[_[_0xfe1b('0xd')](this[_0xfe1b('0x9')])+_0xfe1b('0xe')]=this[_0xfe1b('0xc')]['id'];}_0x1aafd4[_[_0xfe1b('0xd')](this[_0xfe1b('0x9')])+_0xfe1b('0xf')]=this[_0xfe1b('0x10')]['id'];if(rpc[this[_0xfe1b('0x9')]+_0xfe1b('0x11')]){return rpc[this['channel']+_0xfe1b('0x11')][_0xfe1b('0x12')](_0x1aafd4)[_0xfe1b('0x13')](function(_0x8aa44f){logger[_0xfe1b('0x14')]('[%s][MESSAGE]\x20%s',_0x1ea1d3,_0x1aafd4[_0xfe1b('0x15')]);_0x169261[_0xfe1b('0x16')]();})[_0xfe1b('0x17')](function(_0x359f5b){logger['error'](_0xfe1b('0x18'),_0x1ea1d3,JSON[_0xfe1b('0x19')](_0x359f5b));_0x169261[_0xfe1b('0x1a')]();});}}catch(_0x570855){logger[_0xfe1b('0x1b')](_0xfe1b('0x18'),_0x1ea1d3,JSON[_0xfe1b('0x19')](_0x570855));_0x169261[_0xfe1b('0x1a')]();}};}; \ No newline at end of file +var _0x18d6=['account','upperFirst','InteractionId','interaction','Message','create','then','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','contact','channel','chat'];(function(_0x104226,_0x43da79){var _0x19584c=function(_0x31da4e){while(--_0x31da4e){_0x104226['push'](_0x104226['shift']());}};_0x19584c(++_0x43da79);}(_0x18d6,0x91));var _0x618d=function(_0x48fa1b,_0x369aa5){_0x48fa1b=_0x48fa1b-0x0;var _0x6b81a5=_0x18d6[_0x48fa1b];return _0x6b81a5;};'use strict';var _=require('lodash');var utils=require(_0x618d('0x0'));var logger=require(_0x618d('0x1'))(_0x618d('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x618d('0x3')),'mailMessage':require(_0x618d('0x4')),'smsMessage':require(_0x618d('0x5')),'faxMessage':require(_0x618d('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x618d('0x7')]=function(_0x29c7d4,_0x280f74){return function(_0xcfc2bf){try{var _0x95a1ed={'body':utils['getMustacheRender'](_0x280f74[0x0],this),'ContactId':this[_0x618d('0x8')]['id']};if(this[_0x618d('0x9')]===_0x618d('0xa')){_0x95a1ed['ChatWebsiteId']=this[_0x618d('0xb')]['id'];}else{_0x95a1ed[_['upperFirst'](this[_0x618d('0x9')])+'AccountId']=this[_0x618d('0xb')]['id'];}_0x95a1ed[_[_0x618d('0xc')](this[_0x618d('0x9')])+_0x618d('0xd')]=this[_0x618d('0xe')]['id'];if(rpc[this[_0x618d('0x9')]+_0x618d('0xf')]){return rpc[this[_0x618d('0x9')]+_0x618d('0xf')][_0x618d('0x10')](_0x95a1ed)[_0x618d('0x11')](function(_0x303d49){logger[_0x618d('0x12')]('[%s][MESSAGE]\x20%s',_0x29c7d4,_0x95a1ed[_0x618d('0x13')]);_0xcfc2bf[_0x618d('0x14')]();})[_0x618d('0x15')](function(_0x6fc1b7){logger[_0x618d('0x16')](_0x618d('0x17'),_0x29c7d4,JSON[_0x618d('0x18')](_0x6fc1b7));_0xcfc2bf[_0x618d('0x19')]();});}}catch(_0x133a1c){logger['error'](_0x618d('0x17'),_0x29c7d4,JSON['stringify'](_0x133a1c));_0xcfc2bf[_0x618d('0x19')]();}};}; \ 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 682f945..d4942ea 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 _0x934a=['error','stringify','stop','consequence','info','next'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0x934a,0x69));var _0xa934=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x934a[_0x2aa0e7];return _0x1472c0;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')('routing');exports[_0xa934('0x0')]=function(_0x2442f3,_0x13c992){return function(_0x3fdf73){try{logger[_0xa934('0x1')]('[%s][NOOP]\x20%s',_0x2442f3,utils['getMustacheRender'](_0x13c992[0x0],this));_0x3fdf73[_0xa934('0x2')]();}catch(_0x5afbd9){logger[_0xa934('0x3')]('[%s][NOOP]\x20%s',_0x2442f3,JSON[_0xa934('0x4')](_0x5afbd9));_0x3fdf73[_0xa934('0x5')]();}};}; \ No newline at end of file +var _0xbd65=['consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop','./utils','../../../../config/logger','routing'];(function(_0x2519d7,_0x13c5ef){var _0x579eda=function(_0x14a8b2){while(--_0x14a8b2){_0x2519d7['push'](_0x2519d7['shift']());}};_0x579eda(++_0x13c5ef);}(_0xbd65,0x1b5));var _0x5bd6=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xbd65[_0x422905];return _0x33dc6c;};'use strict';var utils=require(_0x5bd6('0x0'));var logger=require(_0x5bd6('0x1'))(_0x5bd6('0x2'));exports[_0x5bd6('0x3')]=function(_0x1dd0df,_0x3d079f){return function(_0x26b00b){try{logger[_0x5bd6('0x4')](_0x5bd6('0x5'),_0x1dd0df,utils[_0x5bd6('0x6')](_0x3d079f[0x0],this));_0x26b00b[_0x5bd6('0x7')]();}catch(_0x31bc63){logger['error'](_0x5bd6('0x5'),_0x1dd0df,JSON[_0x5bd6('0x8')](_0x31bc63));_0x26b00b[_0x5bd6('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index d0b61c1..b4a880f 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 _0x9c44=['[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','atimeout','rules','end','close','complete','next','strategy','rrmemory','beepall','log','stack','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','queue_id','queue','from','joinAt','emit','clone','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','list','QueueId','upperFirst','channel','InteractionId','message','AccountId','info','name','QueueReport','create','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','catch','error','update\x20queue\x20report','timeout'];(function(_0x134d5e,_0x2a47d8){var _0x1e166a=function(_0x53f10d){while(--_0x53f10d){_0x134d5e['push'](_0x134d5e['shift']());}};_0x1e166a(++_0x2a47d8);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x49c4('0x0'));var seqqueue=require(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var config=require(_0x49c4('0x4'));var logger=require(_0x49c4('0x5'))('routing');var strategy=require('./strategy');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));var attributes=['id',_0x49c4('0x9'),'account',_0x49c4('0xa'),_0x49c4('0xb'),_0x49c4('0xc')];function emit(_0x4487ca,_0x4c7d3a,_0x5ab4a3){io['to'](_0x4487ca)[_0x49c4('0xd')](_0x4c7d3a,_0x5ab4a3);}function emitChannelQueueInteraction(_0x313e73,_0x58cad7,_0xb611a1,_0x459d09,_0x4adb3c,_0x536d42,_0x1d19bf,_0x6d1b08){var _0x5487cd=_[_0x49c4('0xe')](_0xb611a1);_0x5487cd[_0x49c4('0x9')]=_0x6d1b08;_0x5487cd['queue']=_0x58cad7;_0x5487cd[_0x49c4('0xf')]=_0x459d09;_0x5487cd['id']=_0x4adb3c;if(_0x536d42){_0x1d19bf[util[_0x49c4('0x10')](_0x49c4('0x11'),_0x313e73)][_0x4adb3c]=_[_0x49c4('0x12')](_0x5487cd,attributes);}else{delete _0x1d19bf[util[_0x49c4('0x10')](_0x49c4('0x11'),_0x313e73)][_0x4adb3c];}emit(util[_0x49c4('0x10')](_0x49c4('0x13'),_0x313e73,_0x58cad7),util['format'](_0x49c4('0x14'),_0x313e73,_0x536d42?_0x49c4('0x15'):_0x49c4('0x16')),_[_0x49c4('0x12')](_0x5487cd,attributes));}var rpc={'openchannelQueueReport':require(_0x49c4('0x17')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x49c4('0x18')),'smsQueueReport':require(_0x49c4('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x49c4('0x1a'),'required':!![],'message':_0x49c4('0x1b')},'timeout':{'type':_0x49c4('0x1c'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x24856d,_0x50b151,_0x2cbd50,_0x1806c2){if(_0x24856d&&_0x50b151&&_0x2cbd50){_0x50b151[_0x49c4('0x1d')]+=0x1;var _0x291526={'uniqueid':_0x24856d,'from':_0x2cbd50[_0x49c4('0x1e')]?_0x2cbd50[_0x49c4('0x1e')][_0x49c4('0xb')]:'','joinAt':moment()[_0x49c4('0x10')](_0x49c4('0x1f')),'ContactId':_0x2cbd50['contact']?_0x2cbd50['contact']['id']:null,'ListId':_0x2cbd50['list']?_0x2cbd50[_0x49c4('0x20')]['id']:null};_0x291526[_['upperFirst'](_0x2cbd50['channel'])+_0x49c4('0x21')]=_0x50b151['id']||null;_0x291526[_[_0x49c4('0x22')](_0x2cbd50[_0x49c4('0x23')])+_0x49c4('0x24')]=_0x2cbd50['interaction']?_0x2cbd50['interaction']['id']:null;_0x291526[_[_0x49c4('0x22')](_0x2cbd50[_0x49c4('0x23')])+'MessageId']=_0x2cbd50[_0x49c4('0x25')]?_0x2cbd50[_0x49c4('0x25')]['id']:null;_0x291526[_[_0x49c4('0x22')](_0x2cbd50[_0x49c4('0x23')])+(_0x2cbd50['channel']!=='chat'?_0x49c4('0x26'):'WebsiteId')]=_0x2cbd50[_0x49c4('0xf')]?_0x2cbd50[_0x49c4('0xf')]['id']:null;logger[_0x49c4('0x27')](util[_0x49c4('0x10')]('[%s][START:QUEUE][NAME:%s]',_0x24856d,_0x50b151[_0x49c4('0x28')]));emitChannelQueueInteraction(_0x2cbd50[_0x49c4('0x23')],_0x50b151[_0x49c4('0x28')],_0x291526,_0x2cbd50[_0x49c4('0xf')][_0x49c4('0x28')],_0x2cbd50[_0x49c4('0x25')]['id'],!![],_0x1806c2,_0x50b151['id']);if(rpc[_0x2cbd50[_0x49c4('0x23')]+_0x49c4('0x29')]){return rpc[_0x2cbd50[_0x49c4('0x23')]+_0x49c4('0x29')][_0x49c4('0x2a')](_0x291526)['catch'](function(_0x4f4495){logger['error'](_0x49c4('0x2b'));});}}}function stopRouting(_0x7ee704,_0x1eb035,_0x27e467,_0x28eb47){if(_0x7ee704&&_0x1eb035){_0x1eb035['waiting']-=0x1;var _0x38ad77={'leaveAt':moment()[_0x49c4('0x10')](_0x49c4('0x1f')),'acceptAt':moment()[_0x49c4('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x49c4('0x27')](util[_0x49c4('0x10')](_0x49c4('0x2c'),_0x7ee704,_0x1eb035[_0x49c4('0x28')]));emitChannelQueueInteraction(_0x27e467[_0x49c4('0x23')],_0x1eb035['name'],_0x27e467[_0x49c4('0x1e')],_0x27e467[_0x49c4('0xf')][_0x49c4('0x28')],_0x27e467['message']['id'],![],_0x28eb47,_0x1eb035['id']);if(rpc[_0x27e467['channel']+_0x49c4('0x29')]){return rpc[_0x27e467[_0x49c4('0x23')]+_0x49c4('0x29')][_0x49c4('0x2d')](_0x7ee704,_0x38ad77)[_0x49c4('0x2e')](function(_0x2cf897){logger[_0x49c4('0x2f')](_0x49c4('0x30'));});}}}function endRouting(_0x3209cd,_0x4e0209,_0x2d34ca,_0x5b96df){if(_0x3209cd&&_0x4e0209){_0x4e0209[_0x49c4('0x1d')]-=0x1;var _0x349791={'leaveAt':moment()[_0x49c4('0x10')](_0x49c4('0x1f')),'exitAt':moment()['format'](_0x49c4('0x1f')),'reason':_0x49c4('0x31')};logger[_0x49c4('0x27')](util['format'](_0x49c4('0x32'),_0x3209cd,_0x4e0209[_0x49c4('0x28')]));emitChannelQueueInteraction(_0x2d34ca[_0x49c4('0x23')],_0x4e0209[_0x49c4('0x28')],_0x2d34ca[_0x49c4('0x1e')],_0x2d34ca[_0x49c4('0xf')][_0x49c4('0x28')],_0x2d34ca[_0x49c4('0x25')]['id'],![],_0x5b96df);if(rpc[_0x2d34ca[_0x49c4('0x23')]+_0x49c4('0x29')]){return rpc[_0x2d34ca[_0x49c4('0x23')]+'QueueReport'][_0x49c4('0x2d')](_0x3209cd,_0x349791)[_0x49c4('0x2e')](function(_0x32b172){logger[_0x49c4('0x2f')](_0x49c4('0x30'));});}}}function handleFindQueue(_0x29dd5d){return function(_0x1be62d){return _0x1be62d[_0x49c4('0x28')][_0x49c4('0x33')]()===_0x29dd5d[_0x49c4('0x33')]();};}exports[_0x49c4('0x34')]=function(_0xa3d59e,_0x326142,_0x4e38bc,_0x212366){return function(_0x49829e){try{var _0x104efb={'name':_0x326142[0x0],'timeout':_0x326142[0x1]};var _0x4915bc=queue[_0x49c4('0x35')](_0x104efb,{'typecast':!![]});if(_0x4915bc[_0x49c4('0x36')]){logger[_0x49c4('0x2f')](_0x49c4('0x37'),_0xa3d59e,_['map'](_0x4915bc,'message')[_0x49c4('0x38')](',\x20'));_0x49829e[_0x49c4('0x39')]();}else{var _0x38349b=_[_0x49c4('0x3a')](_0x4e38bc[_0x212366['channel']+_0x49c4('0x3b')],handleFindQueue(_0x104efb[_0x49c4('0x28')]));if(_0x38349b){startRouting(_0xa3d59e,_0x38349b,_0x212366,_0x4e38bc);var _0x2ccd47=(_0x38349b[_0x49c4('0x31')]||0xa)*0x3e8;var _0x81a674=(_0x104efb[_0x49c4('0x31')]||0x14)*0x3e8;var _0x1a9593,_0x3351c1;if(_0x2ccd47>_0x81a674){_0x81a674=_0x2ccd47;}var _0x3c4a1d=seqqueue['createQueue'](_0x2ccd47);_0x3c4a1d['id']=_0xa3d59e;_0x3c4a1d[_0x49c4('0x3c')]=_0x2ccd47;_0x3c4a1d['qtimeout']=_0x81a674;_0x3c4a1d[_0x49c4('0x23')]=_0x212366[_0x49c4('0x23')];_0x4e38bc[_0x49c4('0x3d')][_0xa3d59e]['on'](_0x49c4('0x3e'),function(){logger[_0x49c4('0x27')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0xa3d59e);stopRouting(_0xa3d59e,_0x38349b,_0x212366,_0x4e38bc);clearTimeout(_0x1a9593);_0x1a9593=undefined;_0x3c4a1d[_0x49c4('0x3f')](!![]);if(_0x4e38bc[_0x49c4('0x3d')][_0xa3d59e]){delete _0x4e38bc[_0x49c4('0x3d')][_0xa3d59e];}_0x49829e[_0x49c4('0x39')]();});_0x4e38bc[_0x49c4('0x3d')][_0xa3d59e]['on'](_0x49c4('0x40'),function(){if(_0x4e38bc[_0x49c4('0x3d')][_0xa3d59e]){delete _0x4e38bc['rules'][_0xa3d59e];}});_0x1a9593=setTimeout(function(){logger[_0x49c4('0x27')]('[%s][QUEUE]\x20APPLICATION\x20END',_0xa3d59e);endRouting(_0xa3d59e,_0x38349b,_0x212366,_0x4e38bc);clearTimeout(_0x1a9593);_0x3c4a1d[_0x49c4('0x3f')](!![]);_0x49829e[_0x49c4('0x41')]();},_0x81a674);switch(_0x38349b[_0x49c4('0x42')]){case _0x49c4('0x43'):strategy[_0x49c4('0x43')](_0x3c4a1d,_0x38349b,_0x4e38bc,_0x212366);break;default:strategy[_0x49c4('0x44')](_0x3c4a1d,_0x38349b,_0x4e38bc,_0x212366);}}else{logger[_0x49c4('0x2f')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0xa3d59e,_0x104efb[_0x49c4('0x28')]);_0x49829e[_0x49c4('0x39')]();}}}catch(_0x4a5c34){console[_0x49c4('0x45')](_0x4a5c34);logger[_0x49c4('0x2f')](_0x49c4('0x37'),_0xa3d59e,_0x4a5c34[_0x49c4('0x46')]);_0x49829e['stop']();}};}; \ No newline at end of file +var _0x55ca=['../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','QueueId','interaction','channel','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','create','catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','map','join','find','Queues','createQueue','atimeout','rules','end','close','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove'];(function(_0x576cdf,_0x303073){var _0x50d181=function(_0x573f73){while(--_0x573f73){_0x576cdf['push'](_0x576cdf['shift']());}};_0x50d181(++_0x303073);}(_0x55ca,0x126));var _0xa55c=function(_0x2d2e85,_0x22faa9){_0x2d2e85=_0x2d2e85-0x0;var _0x3e9f5e=_0x55ca[_0x2d2e85];return _0x3e9f5e;};'use strict';var schema=require(_0xa55c('0x0'));var _=require(_0xa55c('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));var strategy=require(_0xa55c('0x5'));config[_0xa55c('0x6')]=_[_0xa55c('0x7')](config[_0xa55c('0x6')],{'host':_0xa55c('0x8'),'port':0x18eb});var io=require(_0xa55c('0x9'))(new Redis(config['redis']));var attributes=['id',_0xa55c('0xa'),_0xa55c('0xb'),'queue',_0xa55c('0xc'),_0xa55c('0xd')];function emit(_0x52a3bc,_0x5849ad,_0x473d0e){io['to'](_0x52a3bc)[_0xa55c('0xe')](_0x5849ad,_0x473d0e);}function emitChannelQueueInteraction(_0x381d07,_0x5d8e5a,_0x31646d,_0xe6d826,_0x508342,_0x70c2de,_0x3998f7,_0x15eec8){var _0x5d47ff=_['clone'](_0x31646d);_0x5d47ff[_0xa55c('0xa')]=_0x15eec8;_0x5d47ff['queue']=_0x5d8e5a;_0x5d47ff['account']=_0xe6d826;_0x5d47ff['id']=_0x508342;if(_0x70c2de){_0x3998f7[util['format'](_0xa55c('0xf'),_0x381d07)][_0x508342]=_[_0xa55c('0x10')](_0x5d47ff,attributes);}else{delete _0x3998f7[util[_0xa55c('0x11')](_0xa55c('0xf'),_0x381d07)][_0x508342];}emit(util[_0xa55c('0x11')](_0xa55c('0x12'),_0x381d07,_0x5d8e5a),util['format'](_0xa55c('0x13'),_0x381d07,_0x70c2de?_0xa55c('0x14'):_0xa55c('0x15')),_[_0xa55c('0x10')](_0x5d47ff,attributes));}var rpc={'openchannelQueueReport':require(_0xa55c('0x16')),'mailQueueReport':require(_0xa55c('0x17')),'chatQueueReport':require(_0xa55c('0x18')),'smsQueueReport':require(_0xa55c('0x19')),'faxQueueReport':require(_0xa55c('0x1a')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xa55c('0x1b'),'required':!![],'message':_0xa55c('0x1c')},'timeout':{'type':_0xa55c('0x1d'),'message':_0xa55c('0x1e')}});function startRouting(_0x23a1ae,_0x5426e5,_0x4c0daf,_0x5f5158){if(_0x23a1ae&&_0x5426e5&&_0x4c0daf){_0x5426e5[_0xa55c('0x1f')]+=0x1;var _0x3776ac={'uniqueid':_0x23a1ae,'from':_0x4c0daf[_0xa55c('0x20')]?_0x4c0daf['body'][_0xa55c('0xc')]:'','joinAt':moment()[_0xa55c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c0daf[_0xa55c('0x21')]?_0x4c0daf[_0xa55c('0x21')]['id']:null,'ListId':_0x4c0daf[_0xa55c('0x22')]?_0x4c0daf[_0xa55c('0x22')]['id']:null};_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf['channel'])+_0xa55c('0x24')]=_0x5426e5['id']||null;_0x3776ac[_['upperFirst'](_0x4c0daf['channel'])+'InteractionId']=_0x4c0daf[_0xa55c('0x25')]?_0x4c0daf['interaction']['id']:null;_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf[_0xa55c('0x26')])+_0xa55c('0x27')]=_0x4c0daf[_0xa55c('0x28')]?_0x4c0daf[_0xa55c('0x28')]['id']:null;_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf[_0xa55c('0x26')])+(_0x4c0daf[_0xa55c('0x26')]!==_0xa55c('0x29')?_0xa55c('0x2a'):_0xa55c('0x2b'))]=_0x4c0daf['account']?_0x4c0daf[_0xa55c('0xb')]['id']:null;logger[_0xa55c('0x2c')](util[_0xa55c('0x11')](_0xa55c('0x2d'),_0x23a1ae,_0x5426e5['name']));emitChannelQueueInteraction(_0x4c0daf[_0xa55c('0x26')],_0x5426e5[_0xa55c('0x2e')],_0x3776ac,_0x4c0daf[_0xa55c('0xb')][_0xa55c('0x2e')],_0x4c0daf[_0xa55c('0x28')]['id'],!![],_0x5f5158,_0x5426e5['id']);if(rpc[_0x4c0daf[_0xa55c('0x26')]+'QueueReport']){return rpc[_0x4c0daf[_0xa55c('0x26')]+'QueueReport'][_0xa55c('0x2f')](_0x3776ac)[_0xa55c('0x30')](function(_0x1cc53e){logger[_0xa55c('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x3d28fb,_0x2096ae,_0x331e58,_0x20da31){if(_0x3d28fb&&_0x2096ae){_0x2096ae[_0xa55c('0x1f')]-=0x1;var _0x1225c3={'leaveAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'acceptAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'reason':_0xa55c('0x33')};logger['info'](util['format'](_0xa55c('0x34'),_0x3d28fb,_0x2096ae[_0xa55c('0x2e')]));emitChannelQueueInteraction(_0x331e58['channel'],_0x2096ae[_0xa55c('0x2e')],_0x331e58[_0xa55c('0x20')],_0x331e58[_0xa55c('0xb')][_0xa55c('0x2e')],_0x331e58[_0xa55c('0x28')]['id'],![],_0x20da31,_0x2096ae['id']);if(rpc[_0x331e58[_0xa55c('0x26')]+_0xa55c('0x35')]){return rpc[_0x331e58[_0xa55c('0x26')]+_0xa55c('0x35')]['update'](_0x3d28fb,_0x1225c3)['catch'](function(_0x4b23d3){logger[_0xa55c('0x31')](_0xa55c('0x36'));});}}}function endRouting(_0x2bb4f0,_0x5802e4,_0x768408,_0x547930){if(_0x2bb4f0&&_0x5802e4){_0x5802e4[_0xa55c('0x1f')]-=0x1;var _0x4ad813={'leaveAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'exitAt':moment()[_0xa55c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa55c('0x37')};logger[_0xa55c('0x2c')](util['format'](_0xa55c('0x38'),_0x2bb4f0,_0x5802e4[_0xa55c('0x2e')]));emitChannelQueueInteraction(_0x768408['channel'],_0x5802e4['name'],_0x768408[_0xa55c('0x20')],_0x768408['account'][_0xa55c('0x2e')],_0x768408[_0xa55c('0x28')]['id'],![],_0x547930);if(rpc[_0x768408['channel']+'QueueReport']){return rpc[_0x768408['channel']+'QueueReport'][_0xa55c('0x39')](_0x2bb4f0,_0x4ad813)[_0xa55c('0x30')](function(_0x429336){logger[_0xa55c('0x31')](_0xa55c('0x36'));});}}}function handleFindQueue(_0x56d17c){return function(_0x3d52d8){return _0x3d52d8[_0xa55c('0x2e')][_0xa55c('0x3a')]()===_0x56d17c[_0xa55c('0x3a')]();};}exports[_0xa55c('0x3b')]=function(_0x23cef5,_0x554620,_0x386e34,_0x5ee63d){return function(_0x57a972){try{var _0x404e7f={'name':_0x554620[0x0],'timeout':_0x554620[0x1]};var _0x1f63d8=queue['validate'](_0x404e7f,{'typecast':!![]});if(_0x1f63d8[_0xa55c('0x3c')]){logger['error']('[%s][QUEUE]\x20%s',_0x23cef5,_[_0xa55c('0x3d')](_0x1f63d8,_0xa55c('0x28'))[_0xa55c('0x3e')](',\x20'));_0x57a972['stop']();}else{var _0x1b2708=_[_0xa55c('0x3f')](_0x386e34[_0x5ee63d['channel']+_0xa55c('0x40')],handleFindQueue(_0x404e7f['name']));if(_0x1b2708){startRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);var _0x39886a=(_0x1b2708[_0xa55c('0x37')]||0xa)*0x3e8;var _0x5be43f=(_0x404e7f[_0xa55c('0x37')]||0x14)*0x3e8;var _0x1dae70,_0x5d834d;if(_0x39886a>_0x5be43f){_0x5be43f=_0x39886a;}var _0x40c352=seqqueue[_0xa55c('0x41')](_0x39886a);_0x40c352['id']=_0x23cef5;_0x40c352[_0xa55c('0x42')]=_0x39886a;_0x40c352['qtimeout']=_0x5be43f;_0x40c352[_0xa55c('0x26')]=_0x5ee63d['channel'];_0x386e34[_0xa55c('0x43')][_0x23cef5]['on'](_0xa55c('0x44'),function(){logger[_0xa55c('0x2c')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x23cef5);stopRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);clearTimeout(_0x1dae70);_0x1dae70=undefined;_0x40c352[_0xa55c('0x45')](!![]);if(_0x386e34[_0xa55c('0x43')][_0x23cef5]){delete _0x386e34['rules'][_0x23cef5];}_0x57a972[_0xa55c('0x46')]();});_0x386e34[_0xa55c('0x43')][_0x23cef5]['on']('complete',function(){if(_0x386e34[_0xa55c('0x43')][_0x23cef5]){delete _0x386e34[_0xa55c('0x43')][_0x23cef5];}});_0x1dae70=setTimeout(function(){logger['info'](_0xa55c('0x47'),_0x23cef5);endRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);clearTimeout(_0x1dae70);_0x40c352[_0xa55c('0x45')](!![]);_0x57a972[_0xa55c('0x48')]();},_0x5be43f);switch(_0x1b2708[_0xa55c('0x49')]){case'rrmemory':strategy[_0xa55c('0x4a')](_0x40c352,_0x1b2708,_0x386e34,_0x5ee63d);break;default:strategy['beepall'](_0x40c352,_0x1b2708,_0x386e34,_0x5ee63d);}}else{logger[_0xa55c('0x31')](_0xa55c('0x4b'),_0x23cef5,_0x404e7f[_0xa55c('0x2e')]);_0x57a972['stop']();}}}catch(_0x39bd3d){console[_0xa55c('0x4c')](_0x39bd3d);logger['error'](_0xa55c('0x4d'),_0x23cef5,_0x39bd3d[_0xa55c('0x4e')]);_0x57a972[_0xa55c('0x46')]();}};}; \ 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 7765543..7785fe0 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 _0xa29e=[':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','TIMEOUT','exports','./util','../../../../../config/logger','routing','notificationId','agent','squeue','push','bind','handleTimeout','timeout','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busyQueue','showNotification','writeLog'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xa29e,0x168));var _0xea29=function(_0x37222f,_0x25a5ab){_0x37222f=_0x37222f-0x0;var _0x5c5a6d=_0xa29e[_0x37222f];return _0x5c5a6d;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0xea29('0x0'));var logger=require(_0xea29('0x1'))(_0xea29('0x2'));var Agent=function(_0xb46426,_0x4ef587,_0x2c564b,_0x5882d7){this[_0xea29('0x3')]=uuid['v4']();this['squeue']=_0xb46426;this[_0xea29('0x4')]=_0x4ef587;this['realtime']=_0x2c564b;this[_0xea29('0x2')]=_0x5882d7;this[_0xea29('0x5')][_0xea29('0x6')](this['handleRun'][_0xea29('0x7')](this),this[_0xea29('0x8')][_0xea29('0x7')](this));this[_0xea29('0x5')]['on'](_0xea29('0x9'),this[_0xea29('0x8')][_0xea29('0x7')](this));this['squeue']['on']('drained',this[_0xea29('0xa')]['bind'](this));};Agent[_0xea29('0xb')][_0xea29('0x6')]=function(){this[_0xea29('0x5')]['push'](this[_0xea29('0xc')][_0xea29('0x7')](this),this['handleTimeout'][_0xea29('0x7')](this));};Agent[_0xea29('0xb')][_0xea29('0xa')]=function(){this[_0xea29('0x8')](!![]);};Agent['prototype'][_0xea29('0xc')]=function(_0x4acb57){logger[_0xea29('0xd')](_0xea29('0xe'),this['squeue']['id'],this[_0xea29('0x4')]['id']);if(_[_0xea29('0xf')](this[_0xea29('0x10')][_0xea29('0x11')][this[_0xea29('0x4')]['id']])){logger[_0xea29('0xd')](_0xea29('0x12'),this['squeue']['id'],this[_0xea29('0x4')]['id']);setTimeout(this['push'][_0xea29('0x7')](this),0x3e8);}else{if(this[_0xea29('0x2')][_0xea29('0x13')]||util['isAgentAvailable'](this[_0xea29('0x5')]['id'],this[_0xea29('0x10')]['agents'][this[_0xea29('0x4')]['id']],this[_0xea29('0x5')][_0xea29('0x14')],![])){this[_0xea29('0x10')]['agents'][this[_0xea29('0x4')]['id']]['busy']=!![];this[_0xea29('0x10')][_0xea29('0x11')][this[_0xea29('0x4')]['id']][_0xea29('0x15')]=undefined;util[_0xea29('0x16')](this[_0xea29('0x3')],this[_0xea29('0x5')]['id'],this[_0xea29('0x10')]['agents'][this[_0xea29('0x4')]['id']],null,this[_0xea29('0x2')]);util[_0xea29('0x17')](this[_0xea29('0x5')]['id'],this[_0xea29('0x10')]['agents'][this[_0xea29('0x4')]['id']],'RINGING'+(this[_0xea29('0x2')]['forcedOwnership']?_0xea29('0x18'):''));}else{logger[_0xea29('0xd')](_0xea29('0x19'),this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0xea29('0x7')](this),0x3e8);}}};Agent[_0xea29('0xb')][_0xea29('0x8')]=function(_0x337085){if(_['isNil'](this[_0xea29('0x10')]['agents'][this[_0xea29('0x4')]['id']])){return logger[_0xea29('0xd')](_0xea29('0x12'),this[_0xea29('0x5')]['id'],this['agent']['id']);}else{logger[_0xea29('0xd')](_0xea29('0x1a'),this['squeue']['id'],this[_0xea29('0x4')]['id']);util[_0xea29('0x1b')](this[_0xea29('0x3')],this['squeue']['id'],this[_0xea29('0x10')][_0xea29('0x11')][this[_0xea29('0x4')]['id']],null,this[_0xea29('0x2')]);this[_0xea29('0x10')][_0xea29('0x11')][this[_0xea29('0x4')]['id']][_0xea29('0x1c')]=![];this[_0xea29('0x10')]['agents'][this[_0xea29('0x4')]['id']][_0xea29('0x15')]=undefined;util['writeLog'](this[_0xea29('0x5')]['id'],this[_0xea29('0x10')][_0xea29('0x11')][this[_0xea29('0x4')]['id']],_0x337085?_0xea29('0x1d'):_0xea29('0x1e'));}if(!_0x337085){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x4f4f7f,_0x15ca75,_0x460377,_0x39f1ea){return new Agent(_0x4f4f7f,_0x15ca75,_0x460377,_0x39f1ea);}module[_0xea29('0x1f')]=agent; \ No newline at end of file +var _0xd8e5=['isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleTimeout','bind','drained','handleRun','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x2fc251,_0x1eb198){var _0x2024dd=function(_0x1795c0){while(--_0x1795c0){_0x2fc251['push'](_0x2fc251['shift']());}};_0x2024dd(++_0x1eb198);}(_0xd8e5,0x6b));var _0x5d8e=function(_0x40e5f0,_0x1d4acb){_0x40e5f0=_0x40e5f0-0x0;var _0x56945d=_0xd8e5[_0x40e5f0];return _0x56945d;};'use strict';var _=require('lodash');var uuid=require(_0x5d8e('0x0'));var util=require(_0x5d8e('0x1'));var logger=require(_0x5d8e('0x2'))(_0x5d8e('0x3'));var Agent=function(_0x2bca6f,_0x2d8b4a,_0x45fdbc,_0x5d5426){this[_0x5d8e('0x4')]=uuid['v4']();this[_0x5d8e('0x5')]=_0x2bca6f;this[_0x5d8e('0x6')]=_0x2d8b4a;this[_0x5d8e('0x7')]=_0x45fdbc;this['routing']=_0x5d5426;this['squeue'][_0x5d8e('0x8')](this['handleRun']['bind'](this),this[_0x5d8e('0x9')][_0x5d8e('0xa')](this));this[_0x5d8e('0x5')]['on']('timeout',this['handleTimeout'][_0x5d8e('0xa')](this));this[_0x5d8e('0x5')]['on'](_0x5d8e('0xb'),this['handleDrained']['bind'](this));};Agent['prototype'][_0x5d8e('0x8')]=function(){this['squeue'][_0x5d8e('0x8')](this[_0x5d8e('0xc')][_0x5d8e('0xa')](this),this[_0x5d8e('0x9')][_0x5d8e('0xa')](this));};Agent[_0x5d8e('0xd')][_0x5d8e('0xe')]=function(){this['handleTimeout'](!![]);};Agent[_0x5d8e('0xd')][_0x5d8e('0xc')]=function(_0xa4dbdb){logger[_0x5d8e('0xf')](_0x5d8e('0x10'),this['squeue']['id'],this[_0x5d8e('0x6')]['id']);if(_[_0x5d8e('0x11')](this[_0x5d8e('0x7')][_0x5d8e('0x12')][this[_0x5d8e('0x6')]['id']])){logger['info'](_0x5d8e('0x13'),this[_0x5d8e('0x5')]['id'],this[_0x5d8e('0x6')]['id']);setTimeout(this['push'][_0x5d8e('0xa')](this),0x3e8);}else{if(this[_0x5d8e('0x3')][_0x5d8e('0x14')]||util[_0x5d8e('0x15')](this['squeue']['id'],this[_0x5d8e('0x7')]['agents'][this['agent']['id']],this[_0x5d8e('0x5')][_0x5d8e('0x16')],![])){this[_0x5d8e('0x7')][_0x5d8e('0x12')][this[_0x5d8e('0x6')]['id']][_0x5d8e('0x17')]=!![];this[_0x5d8e('0x7')]['agents'][this[_0x5d8e('0x6')]['id']][_0x5d8e('0x18')]=undefined;util['showNotification'](this[_0x5d8e('0x4')],this[_0x5d8e('0x5')]['id'],this[_0x5d8e('0x7')][_0x5d8e('0x12')][this[_0x5d8e('0x6')]['id']],null,this[_0x5d8e('0x3')]);util[_0x5d8e('0x19')](this[_0x5d8e('0x5')]['id'],this[_0x5d8e('0x7')][_0x5d8e('0x12')][this[_0x5d8e('0x6')]['id']],_0x5d8e('0x1a')+(this[_0x5d8e('0x3')][_0x5d8e('0x14')]?_0x5d8e('0x1b'):''));}else{logger[_0x5d8e('0xf')](_0x5d8e('0x1c'),this[_0x5d8e('0x5')]['id'],this[_0x5d8e('0x6')]['id']);setTimeout(this[_0x5d8e('0x8')][_0x5d8e('0xa')](this),0x3e8);}}};Agent[_0x5d8e('0xd')][_0x5d8e('0x9')]=function(_0x2bbab7){if(_[_0x5d8e('0x11')](this[_0x5d8e('0x7')][_0x5d8e('0x12')][this[_0x5d8e('0x6')]['id']])){return logger[_0x5d8e('0xf')](_0x5d8e('0x13'),this['squeue']['id'],this[_0x5d8e('0x6')]['id']);}else{logger[_0x5d8e('0xf')](_0x5d8e('0x1d'),this[_0x5d8e('0x5')]['id'],this['agent']['id']);util[_0x5d8e('0x1e')](this[_0x5d8e('0x4')],this[_0x5d8e('0x5')]['id'],this[_0x5d8e('0x7')]['agents'][this[_0x5d8e('0x6')]['id']],null,this[_0x5d8e('0x3')]);this[_0x5d8e('0x7')][_0x5d8e('0x12')][this[_0x5d8e('0x6')]['id']][_0x5d8e('0x17')]=![];this['realtime'][_0x5d8e('0x12')][this[_0x5d8e('0x6')]['id']][_0x5d8e('0x18')]=undefined;util['writeLog'](this['squeue']['id'],this['realtime'][_0x5d8e('0x12')][this[_0x5d8e('0x6')]['id']],_0x2bbab7?'STOP':'TIMEOUT');}if(!_0x2bbab7){setTimeout(this[_0x5d8e('0x8')][_0x5d8e('0xa')](this),0x3e8);}};function agent(_0x293c7d,_0x3d6845,_0x5a4cf7,_0x257bdd){return new Agent(_0x293c7d,_0x3d6845,_0x5a4cf7,_0x257bdd);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index d0bc352..205e6b0 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 _0x1497=['../../../../../config/logger','notificationId','squeue','queue','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','exports','lodash','uuid'];(function(_0x5f746f,_0x5b05ab){var _0x198d15=function(_0x58c7e7){while(--_0x58c7e7){_0x5f746f['push'](_0x5f746f['shift']());}};_0x198d15(++_0x5b05ab);}(_0x1497,0x148));var _0x7149=function(_0x3a4acf,_0x5491ea){_0x3a4acf=_0x3a4acf-0x0;var _0x846014=_0x1497[_0x3a4acf];return _0x846014;};'use strict';var _=require(_0x7149('0x0'));var uuid=require(_0x7149('0x1'));var util=require('./util');var logger=require(_0x7149('0x2'))('routing');var Beepall=function(_0x5d2c57,_0x2aaf88,_0x5905c5,_0x32d077){this[_0x7149('0x3')]=uuid['v4']();this[_0x7149('0x4')]=_0x5d2c57;this[_0x7149('0x5')]=_0x2aaf88;this[_0x7149('0x6')]=_0x5905c5;this[_0x7149('0x7')]=_0x32d077;this['squeue'][_0x7149('0x8')](this[_0x7149('0x9')][_0x7149('0xa')](this),this[_0x7149('0xb')][_0x7149('0xa')](this));this['squeue']['on'](_0x7149('0xc'),this[_0x7149('0xb')][_0x7149('0xa')](this));this['squeue']['on'](_0x7149('0xd'),this[_0x7149('0xe')][_0x7149('0xa')](this));};Beepall[_0x7149('0xf')][_0x7149('0x8')]=function(){this[_0x7149('0x4')][_0x7149('0x8')](this[_0x7149('0x9')][_0x7149('0xa')](this),this[_0x7149('0xb')]['bind'](this));};Beepall['prototype'][_0x7149('0xe')]=function(_0x305191){this[_0x7149('0xb')](!![]);};Beepall[_0x7149('0xf')][_0x7149('0x9')]=function(_0x23d01d){var _0x487890=!![];if(!_[_0x7149('0x10')](this[_0x7149('0x5')])&&!_['isNil'](this[_0x7149('0x5')][_0x7149('0x11')])&&this[_0x7149('0x5')][_0x7149('0x11')]['length']>0x0){for(var _0x3e0269=0x0,_0x1a6664;_0x3e02690x0){for(var _0x4b3aee=0x0,_0x250f6d;_0x4b3aee0x0&&_0xfdbd60[_0x299eb7+_0xf7a4('0x25')]>=_0xfdbd60[_0x299eb7+_0xf7a4('0x23')]){writeLog(_0x2a59ae,_0xfdbd60,_0x299eb7['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xf7a4('0x26')]=function(_0x4984f5,_0x4df6d9,_0x1e242c,_0x5e8409,_0xeef2d5){return sendNotification(!![],_0x4984f5,_0x4df6d9,_0x1e242c,_0x5e8409,_0xeef2d5);};exports['hideNotification']=function(_0x20f533,_0x3b5615,_0x5f1eb3,_0x2dadb0,_0x142835){return sendNotification(![],_0x20f533,_0x3b5615,_0x5f1eb3,_0x2dadb0,_0x142835);};exports[_0xf7a4('0x27')]=writeLog; \ No newline at end of file +var _0xa737=['format','user:%s','name','emit','user:save','split','notificationSound','account','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','error','message','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','routing','defaults','redis','localhost','socket.io-emitter'];(function(_0x3c6d44,_0x17b9d4){var _0x4aae83=function(_0x1d9004){while(--_0x1d9004){_0x3c6d44['push'](_0x3c6d44['shift']());}};_0x4aae83(++_0x17b9d4);}(_0xa737,0x154));var _0x7a73=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xa737[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0x7a73('0x0'));var util=require(_0x7a73('0x1'));var utils=require(_0x7a73('0x2'));var Mustache=require(_0x7a73('0x3'));var Redis=require(_0x7a73('0x4'));var config=require(_0x7a73('0x5'));var logger=require('../../../../../config/logger')(_0x7a73('0x6'));config['redis']=_[_0x7a73('0x7')](config[_0x7a73('0x8')],{'host':_0x7a73('0x9'),'port':0x18eb});var io=require(_0x7a73('0xa'))(new Redis(config[_0x7a73('0x8')]));function emit(_0xcffeb9,_0x5d66f4,_0x186e8b){io['to'](_0xcffeb9)['emit'](_0x5d66f4,_0x186e8b);}function sendNotification(_0x45afe4,_0x1cac79,_0x184169,_0x3c51de,_0x4f3106,_0xf9a8c){io['to'](util[_0x7a73('0xb')](_0x7a73('0xc'),_0x3c51de[_0x7a73('0xd')]))[_0x7a73('0xe')](_0x7a73('0xf'),_0x3c51de);var _0x7659cb=_0xf9a8c||{};var _0x236f3c=_0x184169[_0x7a73('0x10')]('.');var _0x2fe021={'uniqueid':_0x1cac79,'channel':_0x236f3c[0x0],'id':_0x236f3c[0x1],'title':_0x236f3c[0x0]+'\x20interaction','interactionId':_0x236f3c[0x2],'queue':_0x4f3106?_0x4f3106[_0x7a73('0xd')]:null,'sound':_0x7659cb['account'][_0x7a73('0x11')],'shake':_0x7659cb[_0x7a73('0x12')][_0x7a73('0x13')]};try{if(!_0x7659cb[_0x7a73('0x14')]){_0x7659cb['body']={};}if(_0x4f3106){_0x7659cb[_0x7a73('0x14')][_0x7a73('0x15')]=_0x4f3106;}else if(_0x7659cb[_0x7a73('0x14')][_0x7a73('0x15')]){delete _0x7659cb[_0x7a73('0x14')][_0x7a73('0x15')];}_0x2fe021[_0x7a73('0x16')]=utils['getMustacheRender'](_0x7659cb[_0x7a73('0x12')]['notificationTemplate'],_0x7659cb);}catch(_0x28456d){_0x2fe021['msg']=_0x7a73('0x17');logger[_0x7a73('0x18')](util[_0x7a73('0xb')]('[%s][QUEUE]\x20%s',_0x1cac79,_0x28456d[_0x7a73('0x19')]));}io['to'](util['format']('user:%s',_0x3c51de[_0x7a73('0xd')]))[_0x7a73('0xe')](util[_0x7a73('0xb')]('notification:%s',_0x45afe4?_0x7a73('0x1a'):_0x7a73('0x1b')),_0x2fe021);}function writeLog(_0x3ecb70,_0x4818ed,_0x4741d7){return logger[_0x7a73('0x1c')](util[_0x7a73('0xb')](_0x7a73('0x1d'),_0x3ecb70,_0x4818ed[_0x7a73('0xd')],_0x4741d7));}exports[_0x7a73('0x1e')]=function(_0x16dc41,_0x1db791,_0x27ee73,_0x22576e){if(_0x1db791['busy']){writeLog(_0x16dc41,_0x1db791,_0x7a73('0x1f'));return![];}if(!_0x1db791[_0x7a73('0x20')]){writeLog(_0x16dc41,_0x1db791,'OFFLINE');return![];}if(_0x1db791[_0x27ee73+'Pause']){writeLog(_0x16dc41,_0x1db791,_0x7a73('0x21'));return![];}if(_0x22576e&&_0x1db791[_0x7a73('0x22')](_0x27ee73+_0x7a73('0x23'))&&_0x1db791['hasOwnProperty'](_0x27ee73+_0x7a73('0x24'))){if(_0x1db791[_0x27ee73+_0x7a73('0x23')]>0x0&&_0x1db791[_0x27ee73+_0x7a73('0x24')]>=_0x1db791[_0x27ee73+_0x7a73('0x23')]){writeLog(_0x16dc41,_0x1db791,_0x27ee73[_0x7a73('0x25')]()+_0x7a73('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x17fb84,_0x2c49bf,_0x4d1f94,_0x325d23,_0x2eedd3){return sendNotification(!![],_0x17fb84,_0x2c49bf,_0x4d1f94,_0x325d23,_0x2eedd3);};exports['hideNotification']=function(_0x348c10,_0x2fe28e,_0x10a403,_0x203bd8,_0xdc6a6f){return sendNotification(![],_0x348c10,_0x2fe28e,_0x10a403,_0x203bd8,_0xdc6a6f);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 40e8204..56a622c 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 _0xa159=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','isObject','stringify','lodash','./utils','../../../../config/logger','routing','string'];(function(_0x3af138,_0x369701){var _0xacb8b3=function(_0x5e69d9){while(--_0x5e69d9){_0x3af138['push'](_0x3af138['shift']());}};_0xacb8b3(++_0x369701);}(_0xa159,0x190));var _0x9a15=function(_0x157ff3,_0x338da9){_0x157ff3=_0x157ff3-0x0;var _0x1b6d23=_0xa159[_0x157ff3];return _0x1b6d23;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x9a15('0x0'));var utils=require(_0x9a15('0x1'));var logger=require(_0x9a15('0x2'))(_0x9a15('0x3'));var system=schema({'command':{'type':_0x9a15('0x4'),'required':!![],'message':_0x9a15('0x5')}});exports[_0x9a15('0x6')]=function(_0x1953d3,_0x239c2b){return function(_0x2ae184){try{var _0x2927aa={'command':_0x239c2b[0x0]};var _0x29dbf9=system[_0x9a15('0x7')](_0x2927aa,{'typecast':!![]});if(_0x29dbf9['length']){logger[_0x9a15('0x8')](_0x9a15('0x9'),_0x1953d3,_[_0x9a15('0xa')](_0x29dbf9,_0x9a15('0xb'))[_0x9a15('0xc')](',\x20'));logger[_0x9a15('0xd')](_0x9a15('0xe'),_0x1953d3);_0x2ae184['next']();}else{var _0x5674ef=this;var _0x539e3f=utils[_0x9a15('0xf')](_0x239c2b[0x0],this);logger[_0x9a15('0xd')](_0x9a15('0x10'),_0x1953d3,_0x539e3f);sh[_0x9a15('0x11')](_[_0x9a15('0x12')](_0x539e3f),function(_0xca439f,_0x4b4f02){logger[_0x9a15('0xd')](_0x9a15('0x13'),_0x1953d3,_0xca439f);if(_0xca439f==0x0){var _0x4db4c2=_0x4b4f02[_0x9a15('0x14')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x239c2b[0x1])||_[_0x9a15('0x15')](_0x239c2b[0x1])){logger[_0x9a15('0xd')](_0x9a15('0x16'),_0x1953d3);_0x5674ef['body'][_0x239c2b[0x1]]=_0x4db4c2;}else{logger[_0x9a15('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x1953d3,_0x239c2b[0x1],_0x4db4c2);_0x5674ef[_0x9a15('0x17')][_0x239c2b[0x1]]=_0x4db4c2;}}_0x2ae184[_0x9a15('0x18')]();});}}catch(_0x1fb5fa){logger[_0x9a15('0x8')]('[%s][SYSTEM]\x20%s',_0x1953d3,_[_0x9a15('0x19')](_0x1fb5fa)?JSON[_0x9a15('0x1a')](_0x1fb5fa):_0x1fb5fa);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1953d3);_0x2ae184['next']();}};}; \ No newline at end of file +var _0x46cb=['../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][SYSTEM]\x20%s','map','message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','lodash'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0x46cb,0x167));var _0xb46c=function(_0x2166a3,_0x237c50){_0x2166a3=_0x2166a3-0x0;var _0x260035=_0x46cb[_0x2166a3];return _0x260035;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0xb46c('0x0'));var utils=require('./utils');var logger=require(_0xb46c('0x1'))('routing');var system=schema({'command':{'type':_0xb46c('0x2'),'required':!![],'message':_0xb46c('0x3')}});exports[_0xb46c('0x4')]=function(_0x161361,_0x4b6a88){return function(_0x5dfa8b){try{var _0x18ccf2={'command':_0x4b6a88[0x0]};var _0x257561=system[_0xb46c('0x5')](_0x18ccf2,{'typecast':!![]});if(_0x257561['length']){logger[_0xb46c('0x6')](_0xb46c('0x7'),_0x161361,_[_0xb46c('0x8')](_0x257561,_0xb46c('0x9'))[_0xb46c('0xa')](',\x20'));logger[_0xb46c('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x161361);_0x5dfa8b[_0xb46c('0xc')]();}else{var _0x50f2e4=this;var _0x2a66be=utils[_0xb46c('0xd')](_0x4b6a88[0x0],this);logger[_0xb46c('0xb')](_0xb46c('0xe'),_0x161361,_0x2a66be);sh[_0xb46c('0xf')](_[_0xb46c('0x10')](_0x2a66be),function(_0x214e7c,_0x5317f8){logger[_0xb46c('0xb')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x161361,_0x214e7c);if(_0x214e7c==0x0){var _0x23369f=_0x5317f8[_0xb46c('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xb46c('0x12')](_0x4b6a88[0x1])||_[_0xb46c('0x13')](_0x4b6a88[0x1])){logger[_0xb46c('0xb')](_0xb46c('0x14'),_0x161361);_0x50f2e4[_0xb46c('0x15')][_0x4b6a88[0x1]]=_0x23369f;}else{logger['info'](_0xb46c('0x16'),_0x161361,_0x4b6a88[0x1],_0x23369f);_0x50f2e4[_0xb46c('0x15')][_0x4b6a88[0x1]]=_0x23369f;}}_0x5dfa8b[_0xb46c('0xc')]();});}}catch(_0x37d1e3){logger[_0xb46c('0x6')](_0xb46c('0x7'),_0x161361,_[_0xb46c('0x17')](_0x37d1e3)?JSON['stringify'](_0x37d1e3):_0x37d1e3);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x161361);_0x5dfa8b[_0xb46c('0xc')]();}};}; \ 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 f06f4a0..ce283bb 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 _0xe55f=['join','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','finally','isObject','validate','lodash','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x3e8fbd,_0x4c963e){var _0x336f26=function(_0x22b361){while(--_0x22b361){_0x3e8fbd['push'](_0x3e8fbd['shift']());}};_0x336f26(++_0x4c963e);}(_0xe55f,0xc9));var _0xfe55=function(_0x309df4,_0x3391db){_0x309df4=_0x309df4-0x0;var _0x4be8fc=_0xe55f[_0x309df4];return _0x4be8fc;};'use strict';var schema=require(_0xfe55('0x0'));var _=require(_0xfe55('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xfe55('0x2')),'faxInteraction':require(_0xfe55('0x3')),'whatsappInteraction':require(_0xfe55('0x4'))};var logger=require(_0xfe55('0x5'))(_0xfe55('0x6'));var tag=schema({'tag':{'type':_0xfe55('0x7'),'required':!![],'message':_0xfe55('0x8')}});exports[_0xfe55('0x9')]=function(_0xceabed,_0x581946,_0x545f1b,_0x2c58d3){return function(_0x332277){try{var _0x44fff7={'tag':_0x581946[0x0]};var _0x47e40d=tag[_0xfe55('0x0')](_0x44fff7,{'typecast':!![]});if(_0x47e40d[_0xfe55('0xa')]){logger[_0xfe55('0xb')](_0xfe55('0xc'),_0xceabed,_[_0xfe55('0xd')](_0x47e40d,_0xfe55('0xe'))[_0xfe55('0xf')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xceabed);_0x332277[_0xfe55('0x10')]();}else{var _0x10e157={'ids':[_0x581946[0x0]]};if(rpc[_0x2c58d3[_0xfe55('0x11')]+_0xfe55('0x12')]){rpc[_0x2c58d3[_0xfe55('0x11')]+'Interaction'][_0xfe55('0x13')](_0x2c58d3[_0xfe55('0x14')]['id'],_0x10e157)[_0xfe55('0x15')](function(_0x5df822){logger[_0xfe55('0x16')](_0xfe55('0x17'),_0xceabed,_0x581946[0x1],_0x2c58d3[_0xfe55('0x11')],_0x2c58d3[_0xfe55('0x14')]['id']);})[_0xfe55('0x18')](function(_0x5eb8a0){logger[_0xfe55('0xb')](_0xfe55('0xc'),_0xceabed,JSON['stringify'](_0x5eb8a0));logger[_0xfe55('0x16')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xceabed);})[_0xfe55('0x19')](function(){_0x332277['next']();});}}}catch(_0x473743){logger[_0xfe55('0xb')](_0xfe55('0xc'),_0xceabed,_[_0xfe55('0x1a')](_0x473743)?JSON['stringify'](_0x473743):_0x473743);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xceabed);_0x332277[_0xfe55('0x10')]();}};}; \ No newline at end of file +var _0x35b1=['consequence','validate','length','error','[%s][TAG]\x20%s','map','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number'];(function(_0x1762b7,_0x50b92f){var _0x3a6f8b=function(_0x3d6aab){while(--_0x3d6aab){_0x1762b7['push'](_0x1762b7['shift']());}};_0x3a6f8b(++_0x50b92f);}(_0x35b1,0x18d));var _0x135b=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x35b1[_0x172133];return _0x2460e5;};'use strict';var schema=require('validate');var _=require(_0x135b('0x0'));var rpc={'chatInteraction':require(_0x135b('0x1')),'openchannelInteraction':require(_0x135b('0x2')),'smsInteraction':require(_0x135b('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x135b('0x4'))};var logger=require(_0x135b('0x5'))(_0x135b('0x6'));var tag=schema({'tag':{'type':_0x135b('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x135b('0x8')]=function(_0x108d73,_0x2fc941,_0xe8731a,_0x5cee2d){return function(_0x5958e8){try{var _0x4f23e0={'tag':_0x2fc941[0x0]};var _0x4fea61=tag[_0x135b('0x9')](_0x4f23e0,{'typecast':!![]});if(_0x4fea61[_0x135b('0xa')]){logger[_0x135b('0xb')](_0x135b('0xc'),_0x108d73,_[_0x135b('0xd')](_0x4fea61,'message')['join'](',\x20'));logger[_0x135b('0xe')](_0x135b('0xf'),_0x108d73);_0x5958e8[_0x135b('0x10')]();}else{var _0xc84370={'ids':[_0x2fc941[0x0]]};if(rpc[_0x5cee2d[_0x135b('0x11')]+_0x135b('0x12')]){rpc[_0x5cee2d[_0x135b('0x11')]+_0x135b('0x12')][_0x135b('0x13')](_0x5cee2d[_0x135b('0x14')]['id'],_0xc84370)[_0x135b('0x15')](function(_0x42a6d3){logger[_0x135b('0xe')](_0x135b('0x16'),_0x108d73,_0x2fc941[0x1],_0x5cee2d[_0x135b('0x11')],_0x5cee2d[_0x135b('0x14')]['id']);})[_0x135b('0x17')](function(_0x15d3e9){logger[_0x135b('0xb')]('[%s][TAG]\x20%s',_0x108d73,JSON[_0x135b('0x18')](_0x15d3e9));logger[_0x135b('0xe')](_0x135b('0xf'),_0x108d73);})[_0x135b('0x19')](function(){_0x5958e8[_0x135b('0x10')]();});}}}catch(_0x2f3f16){logger['error'](_0x135b('0xc'),_0x108d73,_[_0x135b('0x1a')](_0x2f3f16)?JSON[_0x135b('0x18')](_0x2f3f16):_0x2f3f16);logger['info'](_0x135b('0xf'),_0x108d73);_0x5958e8[_0x135b('0x10')]();}};}; \ 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 d539025..245c9de 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 _0x35aa=['list','lodash','exports','merge','body','contact','message','account','interaction'];(function(_0x2fc1f6,_0x51543e){var _0x7a3346=function(_0x589b08){while(--_0x589b08){_0x2fc1f6['push'](_0x2fc1f6['shift']());}};_0x7a3346(++_0x51543e);}(_0x35aa,0xbe));var _0xa35a=function(_0x106c88,_0x1de8f1){_0x106c88=_0x106c88-0x0;var _0x264319=_0x35aa[_0x106c88];return _0x264319;};'use strict';var Mustache=require('mustache');var _=require(_0xa35a('0x0'));module[_0xa35a('0x1')]={'getMustacheRender':function(_0x9a3c63,_0x3518ac){return Mustache['render'](_0x9a3c63,_[_0xa35a('0x2')](_0x3518ac[_0xa35a('0x3')],{'contact':_0x3518ac[_0xa35a('0x4')],'message':_0x3518ac[_0xa35a('0x5')],'account':_0x3518ac[_0xa35a('0x6')],'interaction':_0x3518ac[_0xa35a('0x7')],'list':_0x3518ac[_0xa35a('0x8')]}))||'';}}; \ No newline at end of file +var _0xa739=['body','contact','account','interaction','list','lodash','merge'];(function(_0x918ba5,_0xa1c15b){var _0x4ed341=function(_0x590f60){while(--_0x590f60){_0x918ba5['push'](_0x918ba5['shift']());}};_0x4ed341(++_0xa1c15b);}(_0xa739,0x1e1));var _0x9a73=function(_0x4c9f71,_0x1232bc){_0x4c9f71=_0x4c9f71-0x0;var _0x8f5298=_0xa739[_0x4c9f71];return _0x8f5298;};'use strict';var Mustache=require('mustache');var _=require(_0x9a73('0x0'));module['exports']={'getMustacheRender':function(_0x147c85,_0x33c203){return Mustache['render'](_0x147c85,_[_0x9a73('0x1')](_0x33c203[_0x9a73('0x2')],{'contact':_0x33c203[_0x9a73('0x3')],'message':_0x33c203['message'],'account':_0x33c203[_0x9a73('0x4')],'interaction':_0x33c203[_0x9a73('0x5')],'list':_0x33c203[_0x9a73('0x6')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index d15dfbf..195d3ae 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 _0x0f9f=['applications','length','app','.js','autoreply','appdata','split','push','join','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','busy','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction'];(function(_0x5dd32f,_0x2f7c80){var _0x3764f8=function(_0xa4b0f8){while(--_0xa4b0f8){_0x5dd32f['push'](_0x5dd32f['shift']());}};_0x3764f8(++_0x2f7c80);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x288602,_0x56f26f){_0x288602=_0x288602-0x0;var _0x46420c=_0x0f9f[_0x288602];return _0x46420c;};'use strict';var _=require('lodash');var util=require(_0xf0f9('0x0'));var path=require(_0xf0f9('0x1'));var fs=require('fs');var jayson=require(_0xf0f9('0x2'));var BPromise=require('bluebird');var uuid=require(_0xf0f9('0x3'));var config=require(_0xf0f9('0x4'));var logger=require(_0xf0f9('0x5'))(_0xf0f9('0x6'));var rpc={'openchannelQueueReport':require(_0xf0f9('0x7')),'mailQueueReport':require(_0xf0f9('0x8')),'chatQueueReport':require(_0xf0f9('0x9')),'smsQueueReport':require(_0xf0f9('0xa')),'faxQueueReport':require(_0xf0f9('0xb')),'whatsappQueueReport':require(_0xf0f9('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x448cf5,_0x294b42,_0x5d1753){return util[_0xf0f9('0xd')](_0xf0f9('0xe'),_0x448cf5,_0x294b42||0x0,_0x5d1753||0x0);}function getIntervals(_0x2d72c9,_0x5ab12e){var _0x196f21=[];if(!_[_0xf0f9('0xf')](_0x5ab12e[_0xf0f9('0x10')])&&!_['isNil'](_0x2d72c9[_0x5ab12e['IntervalId']])&&!_[_0xf0f9('0xf')](_0x2d72c9[_0x5ab12e[_0xf0f9('0x10')]][_0xf0f9('0x11')])){_0x196f21=_[_0xf0f9('0x12')](_0x2d72c9[_0x5ab12e[_0xf0f9('0x10')]][_0xf0f9('0x11')],_0xf0f9('0x13'));}else if(!_['isNil'](_0x5ab12e[_0xf0f9('0x13')])){_0x196f21=[_0x5ab12e[_0xf0f9('0x13')]];}return _0x196f21;}exports[_0xf0f9('0x14')]=function(_0x200514){_0x200514[_0xf0f9('0x15')]={};return new BPromise(function(_0x51d78a,_0x459c76){var _0x35aa5d={'Start':function(_0xa7d48c){var _0x2e2955=this;return new Promise(function(_0x2b05e3,_0x2f5bec){if(_0xa7d48c){try{var _0x2f75da=[];var _0x16a928=getId(_0xa7d48c[_0xf0f9('0x16')],_0xa7d48c[_0xf0f9('0x17')]?_0xa7d48c['message']['id']:0x0,_0xa7d48c['interaction']?_0xa7d48c[_0xf0f9('0x18')]['id']:0x0);if(_0xa7d48c[_0xf0f9('0x19')]&&_['isArray'](_0xa7d48c[_0xf0f9('0x19')])&&_0xa7d48c['applications']['length']){for(var _0x42c157=0x0;_0x42c157<_0xa7d48c[_0xf0f9('0x19')][_0xf0f9('0x1a')];_0x42c157+=0x1){var _0x1432f7=_0xa7d48c[_0xf0f9('0x19')][_0x42c157];if(fs['existsSync'](path['join'](__dirname,'applications',_0x1432f7[_0xf0f9('0x1b')]+_0xf0f9('0x1c')))){var _0x126ba7=[];switch(_0x1432f7['app']['toLowerCase']()){case _0xf0f9('0x1d'):var _0x550728=_0x1432f7[_0xf0f9('0x1e')][_0xf0f9('0x1f')](',');if(_0xa7d48c[_0xf0f9('0x16')]==='mail'){_0x126ba7[_0xf0f9('0x20')](_0x550728[0x0]);_0x126ba7[_0xf0f9('0x20')](_0x550728[0x1]);_0x126ba7[_0xf0f9('0x20')](_0x550728['slice'](0x2,_0x550728[_0xf0f9('0x1a')])[_0xf0f9('0x21')](','));}else{_0x126ba7[_0xf0f9('0x20')](_0x550728[0x0]);_0x126ba7[_0xf0f9('0x20')](_0x550728[_0xf0f9('0x22')](0x1,_0x550728[_0xf0f9('0x1a')])['join'](','));}break;case _0xf0f9('0x23'):var _0x56663e=_0x1432f7[_0xf0f9('0x1e')][_0xf0f9('0x1f')](',');_0x126ba7['push'](_0x56663e[0x0]);_0x126ba7['push'](_0x56663e[0x1]);_0x126ba7[_0xf0f9('0x20')](_0x56663e['slice'](0x2,_0x56663e[_0xf0f9('0x1a')])[_0xf0f9('0x21')](','));break;case _0xf0f9('0x24'):var _0x353502=_0x1432f7[_0xf0f9('0x1e')][_0xf0f9('0x1f')](',');_0x126ba7[_0xf0f9('0x20')](_0x353502[0x0]);_0x126ba7[_0xf0f9('0x20')](_0x353502[0x1]);_0x126ba7[_0xf0f9('0x20')](_0x353502[0x2]);_0x126ba7['push'](_0x353502[0x3]);_0x126ba7[_0xf0f9('0x20')](_0x353502[_0xf0f9('0x22')](0x4,_0x353502['length'])['join'](','));break;case _0xf0f9('0x25'):var _0x49d3bc=_0x1432f7['appdata'][_0xf0f9('0x1f')](',');_0x126ba7['push'](_0x49d3bc[0x0]);_0x126ba7[_0xf0f9('0x20')](_0x49d3bc[0x1]);_0x126ba7[_0xf0f9('0x20')](_0x49d3bc[0x2]);_0x126ba7['push'](_0x49d3bc[0x3]);_0x126ba7['push'](_0x49d3bc[_0xf0f9('0x22')](0x4,_0x49d3bc[_0xf0f9('0x1a')])[_0xf0f9('0x21')](','));break;case _0xf0f9('0x17'):_0x126ba7[_0xf0f9('0x20')](_0x1432f7[_0xf0f9('0x1e')]);break;case _0xf0f9('0x26'):_0x126ba7[_0xf0f9('0x20')](_0x1432f7[_0xf0f9('0x27')]);_0x126ba7[_0xf0f9('0x20')](_0x1432f7[_0xf0f9('0x1e')]);break;default:_0x126ba7=_[_0xf0f9('0xf')](_0x1432f7[_0xf0f9('0x1e')])?[]:_0x1432f7['appdata'][_0xf0f9('0x1f')](',');}var _0x5c7028={'id':util[_0xf0f9('0xd')](_0xf0f9('0x28'),_0x16a928,_0x1432f7['id'],_0x1432f7[_0xf0f9('0x1b')]),'condition':require(_0xf0f9('0x29'))[_0xf0f9('0x2a')](_0x16a928,getIntervals(_0x200514[_0xf0f9('0x2b')],_0x1432f7),_0x200514),'consequence':require(_0xf0f9('0x2c')+_0x1432f7['app'])['consequence'](_0x16a928,_0x126ba7,_0x200514,_0xa7d48c),'p':_0x1432f7[_0xf0f9('0x2d')]||0x0};logger[_0xf0f9('0x2e')](_0xf0f9('0x2f'),_0x5c7028['id'],_0xf0f9('0x30'),getIntervals(_0x200514[_0xf0f9('0x2b')],_0x1432f7)['join'](_0xf0f9('0x31')));_0x2f75da[_0xf0f9('0x20')](_0x5c7028);}else{logger[_0xf0f9('0x32')](_0xf0f9('0x33'),path[_0xf0f9('0x21')](__dirname,'applications',_0x1432f7[_0xf0f9('0x1b')]+_0xf0f9('0x1c')));}}_0x200514[_0xf0f9('0x15')][_0x16a928]=new RuleEngine(_0x2f75da);_0x200514[_0xf0f9('0x15')][_0x16a928][_0xf0f9('0x34')](_0xa7d48c,function(_0x3054d6){logger['info'](_0xf0f9('0x35'),JSON[_0xf0f9('0x36')](_0x3054d6[_0xf0f9('0x37')]));if(_0x200514['rules'][_0x16a928]){_0x200514[_0xf0f9('0x15')][_0x16a928][_0xf0f9('0x38')](_0xf0f9('0x39'));}});return _0x2b05e3({'code':0xc8,'message':_0xa7d48c});}else{logger[_0xf0f9('0x2e')](_0xf0f9('0x3a'));return _0x2b05e3({'code':0xc8,'message':_0xa7d48c});}}catch(_0xcf7fb1){logger[_0xf0f9('0x32')](_0xcf7fb1[_0xf0f9('0x3b')]);return _0x2f5bec(_0x2e2955[_0xf0f9('0x32')](0x1f4,_0xcf7fb1));}}return _0x2f5bec(_0xf0f9('0x3c'));});},'AcceptMessage':function(_0x26694a){var _0x149870=this;return new Promise(function(_0x21672e,_0x5153b5){if(_0x26694a['agent']&&_0x26694a[_0xf0f9('0x3d')]['id']){if(_0x200514['agents'][_0x26694a['agent']['id']]){_0x200514['agents'][_0x26694a[_0xf0f9('0x3d')]['id']][_0xf0f9('0x3e')]=![];_0x200514[_0xf0f9('0x3f')][_0x26694a[_0xf0f9('0x3d')]['id']][_0xf0f9('0x40')]=undefined;}}if(_0x26694a[_0xf0f9('0x17')]&&_0x26694a[_0xf0f9('0x17')]['id']){try{var _0x2e1556=getId(_0x26694a[_0xf0f9('0x16')],_0x26694a['message']?_0x26694a[_0xf0f9('0x17')]['id']:0x0,_0x26694a[_0xf0f9('0x18')]?_0x26694a[_0xf0f9('0x18')]['id']:0x0);if(_0x200514['rules'][_0x2e1556]){_0x200514[_0xf0f9('0x15')][_0x2e1556][_0xf0f9('0x38')](_0xf0f9('0x41'));if(rpc[_0x26694a['channel']+_0xf0f9('0x42')]){rpc[_0x26694a[_0xf0f9('0x16')]+'QueueReport'][_0xf0f9('0x43')](_0x2e1556,{'UserId':_0x26694a[_0xf0f9('0x17')][_0xf0f9('0x44')]})[_0xf0f9('0x45')](function(_0x4be16e){logger[_0xf0f9('0x32')](_0xf0f9('0x46'));});}}return _0x21672e({'code':0xc8,'message':_0x26694a});}catch(_0xc29196){logger[_0xf0f9('0x32')](_0xc29196[_0xf0f9('0x3b')]);return _0x5153b5(_0x149870[_0xf0f9('0x32')](0x1f4,_0xc29196));}}logger['error'](_0xf0f9('0x47'));return _0x5153b5(_0x149870['error'](0x1f4,_0xf0f9('0x47')));});},'RejectMessage':function(_0x38956b){var _0x130fc8=this;return new Promise(function(_0x314e0c,_0x44b00d){if(_0x38956b[_0xf0f9('0x3d')]&&_0x38956b[_0xf0f9('0x3d')]['id']){try{if(_0x200514[_0xf0f9('0x3f')][_0x38956b[_0xf0f9('0x3d')]['id']]){_0x200514[_0xf0f9('0x3f')][_0x38956b[_0xf0f9('0x3d')]['id']][_0xf0f9('0x3e')]=![];_0x200514[_0xf0f9('0x3f')][_0x38956b[_0xf0f9('0x3d')]['id']][_0xf0f9('0x40')]=undefined;}return _0x314e0c({'code':0xc8,'message':_0x38956b});}catch(_0x3cb91a){logger[_0xf0f9('0x32')](_0x3cb91a[_0xf0f9('0x3b')]);return _0x44b00d(_0x130fc8[_0xf0f9('0x32')](0x1f4,_0x3cb91a));}}logger[_0xf0f9('0x32')](_0xf0f9('0x47'));return _0x44b00d(_0x130fc8[_0xf0f9('0x32')](0x1f4,_0xf0f9('0x47')));});},'AbandonInteraction':function(_0x37a928){var _0x53aedf=this;return new Promise(function(_0x5b4a52,_0x2eb8b4){if(_0x37a928['channel']&&_0x37a928[_0xf0f9('0x18')]&&_0x37a928[_0xf0f9('0x18')]['id']){try{var _0x1821bc=getId(_0x37a928['channel'],_0x37a928[_0xf0f9('0x17')]?_0x37a928['message']['id']:0x0,_0x37a928[_0xf0f9('0x18')]?_0x37a928[_0xf0f9('0x18')]['id']:0x0);if(_0x200514[_0xf0f9('0x15')][_0x1821bc]){_0x200514[_0xf0f9('0x15')][_0x1821bc][_0xf0f9('0x38')]('end');}return _0x5b4a52({'code':0xc8,'message':_0x37a928});}catch(_0x422e72){logger['error'](_0x422e72[_0xf0f9('0x3b')]);return _0x2eb8b4(_0x53aedf[_0xf0f9('0x32')](0x1f4,_0x422e72));}}logger[_0xf0f9('0x32')](_0xf0f9('0x47'));return _0x2eb8b4(_0x53aedf[_0xf0f9('0x32')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x4d1ab6){var _0x3b78aa=this;return new Promise(function(_0x1d30fb,_0x391ad0){if(_0x200514[_0xf0f9('0x3f')][_0xf0f9('0x48')](_0x4d1ab6['id'])){for(var _0x243626 in _0x4d1ab6[_0xf0f9('0x49')]){if(_0x4d1ab6[_0xf0f9('0x49')][_0xf0f9('0x48')](_0x243626)){if(_0x200514[_0xf0f9('0x3f')][_0x4d1ab6['id']][_0xf0f9('0x48')](_0x243626+_0xf0f9('0x4a'))){_0x200514[_0xf0f9('0x3f')][_0x4d1ab6['id']][_0x243626+'CurrentCapacity']=parseInt(_0x4d1ab6[_0xf0f9('0x49')][_0x243626],0xa);}}}_0x200514[_0xf0f9('0x3f')][_0x4d1ab6['id']][_0xf0f9('0x4b')]();return _0x1d30fb({'code':0xc8,'message':_0x200514['agents'][_0x4d1ab6['id']]});}else{return _0x391ad0(_0x3b78aa[_0xf0f9('0x32')](0x1f4,_0xf0f9('0x4c')));}});},'Agents':function(_0x22fe30){return new Promise(function(_0x115d02,_0x6979f){var _0x586022=_[_0xf0f9('0x4d')](_0x200514[_0xf0f9('0x3f')]);_0x115d02({'count':_0x586022[_0xf0f9('0x1a')],'rows':_0x586022});});},'ChatQueues':function(_0x2f3cfb){return new Promise(function(_0x2807f9,_0x445c85){var _0x1f263a=[];for(var _0x411e09 in _0x200514[_0xf0f9('0x4e')]){if(_0x200514[_0xf0f9('0x4e')]['hasOwnProperty'](_0x411e09)){var _0x3777ae=_0x200514[_0xf0f9('0x4e')][_0x411e09];var _0x51f80a={'id':_0x3777ae['id'],'available':_0x3777ae[_0xf0f9('0x4f')],'loggedIn':_0x3777ae['loggedIn'],'name':_0x3777ae[_0xf0f9('0x50')],'paused':_0x3777ae[_0xf0f9('0x51')],'waiting':_0x3777ae[_0xf0f9('0x52')]};_0x1f263a['push'](_0x51f80a);}}_0x2807f9({'count':_0x1f263a[_0xf0f9('0x1a')],'rows':_0x1f263a});});},'MailQueues':function(_0x41e895){return new Promise(function(_0x28879c,_0x142984){var _0x60dcbc=[];for(var _0xbca4b3 in _0x200514[_0xf0f9('0x53')]){if(_0x200514[_0xf0f9('0x53')][_0xf0f9('0x48')](_0xbca4b3)){var _0x12bf05=_0x200514[_0xf0f9('0x53')][_0xbca4b3];var _0x162305={'id':_0x12bf05['id'],'available':_0x12bf05['available'],'loggedIn':_0x12bf05[_0xf0f9('0x54')],'name':_0x12bf05[_0xf0f9('0x50')],'paused':_0x12bf05[_0xf0f9('0x51')],'waiting':_0x12bf05[_0xf0f9('0x52')]};_0x60dcbc['push'](_0x162305);}}_0x28879c({'count':_0x60dcbc[_0xf0f9('0x1a')],'rows':_0x60dcbc});});},'OpenchannelQueues':function(_0xb29b92){return new Promise(function(_0xb47567,_0x4ca78c){var _0x344a2b=[];for(var _0x359838 in _0x200514['openchannelQueues']){if(_0x200514[_0xf0f9('0x55')][_0xf0f9('0x48')](_0x359838)){var _0x5b3b40=_0x200514[_0xf0f9('0x55')][_0x359838];var _0x205480={'id':_0x5b3b40['id'],'available':_0x5b3b40[_0xf0f9('0x4f')],'loggedIn':_0x5b3b40[_0xf0f9('0x54')],'name':_0x5b3b40[_0xf0f9('0x50')],'paused':_0x5b3b40[_0xf0f9('0x51')],'waiting':_0x5b3b40[_0xf0f9('0x52')]};_0x344a2b['push'](_0x205480);}}_0xb47567({'count':_0x344a2b[_0xf0f9('0x1a')],'rows':_0x344a2b});});},'SmsQueues':function(_0x33f71c){return new Promise(function(_0x5cd450,_0x1ac791){var _0x539ac6=[];for(var _0x5bb76b in _0x200514[_0xf0f9('0x56')]){if(_0x200514[_0xf0f9('0x56')]['hasOwnProperty'](_0x5bb76b)){var _0x180c37=_0x200514['smsQueues'][_0x5bb76b];var _0x45606a={'id':_0x180c37['id'],'available':_0x180c37[_0xf0f9('0x4f')],'loggedIn':_0x180c37[_0xf0f9('0x54')],'name':_0x180c37['name'],'paused':_0x180c37[_0xf0f9('0x51')],'waiting':_0x180c37[_0xf0f9('0x52')]};_0x539ac6[_0xf0f9('0x20')](_0x45606a);}}_0x5cd450({'count':_0x539ac6[_0xf0f9('0x1a')],'rows':_0x539ac6});});},'FaxQueues':function(_0x4fb990){return new Promise(function(_0x1e64a5,_0x1e5018){var _0xc45b52=[];for(var _0x1541c8 in _0x200514[_0xf0f9('0x57')]){if(_0x200514[_0xf0f9('0x57')]['hasOwnProperty'](_0x1541c8)){var _0x451346=_0x200514[_0xf0f9('0x57')][_0x1541c8];var _0x12bfb0={'id':_0x451346['id'],'available':_0x451346[_0xf0f9('0x4f')],'loggedIn':_0x451346['loggedIn'],'name':_0x451346[_0xf0f9('0x50')],'paused':_0x451346['paused'],'waiting':_0x451346[_0xf0f9('0x52')]};_0xc45b52[_0xf0f9('0x20')](_0x12bfb0);}}_0x1e64a5({'count':_0xc45b52[_0xf0f9('0x1a')],'rows':_0xc45b52});});},'WhatsappQueues':function(_0x434ea0){return new Promise(function(_0x149f47,_0x166d02){var _0x3b8233=[];for(var _0x44eea9 in _0x200514[_0xf0f9('0x58')]){if(_0x200514[_0xf0f9('0x58')][_0xf0f9('0x48')](_0x44eea9)){var _0x12a3b0=_0x200514['whatsappQueues'][_0x44eea9];var _0x27c566={'id':_0x12a3b0['id'],'available':_0x12a3b0[_0xf0f9('0x4f')],'loggedIn':_0x12a3b0['loggedIn'],'name':_0x12a3b0[_0xf0f9('0x50')],'paused':_0x12a3b0[_0xf0f9('0x51')],'waiting':_0x12a3b0['waiting']};_0x3b8233['push'](_0x27c566);}}_0x149f47({'count':_0x3b8233[_0xf0f9('0x1a')],'rows':_0x3b8233});});},'ChatQueuesWaitingInteractions':function(_0xb1f145){return new Promise(function(_0x299c58,_0x1cba61){var _0x287b01=_[_0xf0f9('0x4d')](_0x200514['chatQueuesWaitingInteractions']);_0x299c58({'count':_0x287b01[_0xf0f9('0x1a')],'rows':_0x287b01});});},'MailQueuesWaitingInteractions':function(_0x3aa811){return new Promise(function(_0x126954,_0x3862a2){var _0x4826e4=_[_0xf0f9('0x4d')](_0x200514[_0xf0f9('0x59')]);_0x126954({'count':_0x4826e4[_0xf0f9('0x1a')],'rows':_0x4826e4});});},'OpenchannelQueuesWaitingInteractions':function(_0x5cee0d){return new Promise(function(_0x471e7d,_0x2c4171){var _0x5fcf00=_[_0xf0f9('0x4d')](_0x200514['openchannelQueuesWaitingInteractions']);_0x471e7d({'count':_0x5fcf00['length'],'rows':_0x5fcf00});});},'SmsQueuesWaitingInteractions':function(_0x3c1426){return new Promise(function(_0x104b27,_0x5bd5d0){var _0x475eac=_[_0xf0f9('0x4d')](_0x200514[_0xf0f9('0x5a')]);_0x104b27({'count':_0x475eac['length'],'rows':_0x475eac});});},'FaxQueuesWaitingInteractions':function(_0x65efa9){return new Promise(function(_0x370bf6,_0x53828b){var _0x34b032=_[_0xf0f9('0x4d')](_0x200514['faxQueuesWaitingInteractions']);_0x370bf6({'count':_0x34b032[_0xf0f9('0x1a')],'rows':_0x34b032});});},'WhatsappQueuesWaitingInteractions':function(_0xb3ab9b){return new Promise(function(_0x338e66,_0x18dff0){var _0x5047e2=_[_0xf0f9('0x4d')](_0x200514[_0xf0f9('0x5b')]);_0x338e66({'count':_0x5047e2[_0xf0f9('0x1a')],'rows':_0x5047e2});});}};var _0x4ce4e9=jayson['server'](_0x35aa5d)[_0xf0f9('0x5c')]();_0x4ce4e9['on']('error',function(_0x18e56b){logger[_0xf0f9('0x32')](JSON[_0xf0f9('0x36')](_0x18e56b));return _0x459c76(_0x18e56b);});_0x4ce4e9[_0xf0f9('0x14')](0x232c,_0xf0f9('0x5d'),function(){console[_0xf0f9('0x5e')](_0xf0f9('0x5f'),0x232c);return _0x51d78a(_0xf0f9('0x60')+0x232c);});});}; \ No newline at end of file +var _0x99e9=['stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','../../../config/environment','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','applications','isArray','length','existsSync','app','.js','toLowerCase','autoreply','split','push','slice','join','dialogflow','appdata','amazonlex','TagId','%s:%s:%s','condition','intervals','consequence','info','\x20|\x20','error','rules','execute','Applications\x20executed','matchPath','emit','stack','agent','agents','busy','busyQueue','interaction','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server'];(function(_0x3db12e,_0x24b91a){var _0x1fa7ef=function(_0x32a744){while(--_0x32a744){_0x3db12e['push'](_0x3db12e['shift']());}};_0x1fa7ef(++_0x24b91a);}(_0x99e9,0xb4));var _0x999e=function(_0x37a0ce,_0x28dc04){_0x37a0ce=_0x37a0ce-0x0;var _0x569f4e=_0x99e9[_0x37a0ce];return _0x569f4e;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var path=require(_0x999e('0x1'));var fs=require('fs');var jayson=require(_0x999e('0x2'));var BPromise=require(_0x999e('0x3'));var uuid=require('uuid');var config=require(_0x999e('0x4'));var logger=require(_0x999e('0x5'))(_0x999e('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x999e('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x999e('0x8')),'faxQueueReport':require(_0x999e('0x9')),'whatsappQueueReport':require(_0x999e('0xa'))};var RuleEngine=require(_0x999e('0xb'));function getId(_0x5c1c17,_0x46aeae,_0x38a692){return util[_0x999e('0xc')](_0x999e('0xd'),_0x5c1c17,_0x46aeae||0x0,_0x38a692||0x0);}function getIntervals(_0x2c38cf,_0x175042){var _0x3f2c24=[];if(!_[_0x999e('0xe')](_0x175042[_0x999e('0xf')])&&!_[_0x999e('0xe')](_0x2c38cf[_0x175042[_0x999e('0xf')]])&&!_[_0x999e('0xe')](_0x2c38cf[_0x175042[_0x999e('0xf')]][_0x999e('0x10')])){_0x3f2c24=_[_0x999e('0x11')](_0x2c38cf[_0x175042[_0x999e('0xf')]][_0x999e('0x10')],'interval');}else if(!_[_0x999e('0xe')](_0x175042['interval'])){_0x3f2c24=[_0x175042[_0x999e('0x12')]];}return _0x3f2c24;}exports[_0x999e('0x13')]=function(_0x2fbc3e){_0x2fbc3e['rules']={};return new BPromise(function(_0x28bdd1,_0x4d1716){var _0xa44e4c={'Start':function(_0x539598){var _0x549ad4=this;return new Promise(function(_0x1eee64,_0x22feac){if(_0x539598){try{var _0x2dd5f4=[];var _0x289e0e=getId(_0x539598[_0x999e('0x14')],_0x539598[_0x999e('0x15')]?_0x539598['message']['id']:0x0,_0x539598['interaction']?_0x539598['interaction']['id']:0x0);if(_0x539598[_0x999e('0x16')]&&_[_0x999e('0x17')](_0x539598[_0x999e('0x16')])&&_0x539598[_0x999e('0x16')][_0x999e('0x18')]){for(var _0x3ece5e=0x0;_0x3ece5e<_0x539598['applications']['length'];_0x3ece5e+=0x1){var _0xc20d3e=_0x539598[_0x999e('0x16')][_0x3ece5e];if(fs[_0x999e('0x19')](path['join'](__dirname,_0x999e('0x16'),_0xc20d3e[_0x999e('0x1a')]+_0x999e('0x1b')))){var _0x36fce4=[];switch(_0xc20d3e[_0x999e('0x1a')][_0x999e('0x1c')]()){case _0x999e('0x1d'):var _0x4d4474=_0xc20d3e['appdata'][_0x999e('0x1e')](',');if(_0x539598[_0x999e('0x14')]==='mail'){_0x36fce4[_0x999e('0x1f')](_0x4d4474[0x0]);_0x36fce4[_0x999e('0x1f')](_0x4d4474[0x1]);_0x36fce4[_0x999e('0x1f')](_0x4d4474[_0x999e('0x20')](0x2,_0x4d4474[_0x999e('0x18')])[_0x999e('0x21')](','));}else{_0x36fce4['push'](_0x4d4474[0x0]);_0x36fce4[_0x999e('0x1f')](_0x4d4474[_0x999e('0x20')](0x1,_0x4d4474[_0x999e('0x18')])[_0x999e('0x21')](','));}break;case _0x999e('0x22'):var _0x1d2dc6=_0xc20d3e[_0x999e('0x23')]['split'](',');_0x36fce4[_0x999e('0x1f')](_0x1d2dc6[0x0]);_0x36fce4['push'](_0x1d2dc6[0x1]);_0x36fce4['push'](_0x1d2dc6[_0x999e('0x20')](0x2,_0x1d2dc6[_0x999e('0x18')])[_0x999e('0x21')](','));break;case'dialogflowv2':var _0x1ea0e4=_0xc20d3e[_0x999e('0x23')][_0x999e('0x1e')](',');_0x36fce4[_0x999e('0x1f')](_0x1ea0e4[0x0]);_0x36fce4[_0x999e('0x1f')](_0x1ea0e4[0x1]);_0x36fce4[_0x999e('0x1f')](_0x1ea0e4[0x2]);_0x36fce4[_0x999e('0x1f')](_0x1ea0e4[0x3]);_0x36fce4[_0x999e('0x1f')](_0x1ea0e4[_0x999e('0x20')](0x4,_0x1ea0e4[_0x999e('0x18')])['join'](','));break;case _0x999e('0x24'):var _0x1cd206=_0xc20d3e[_0x999e('0x23')]['split'](',');_0x36fce4[_0x999e('0x1f')](_0x1cd206[0x0]);_0x36fce4['push'](_0x1cd206[0x1]);_0x36fce4['push'](_0x1cd206[0x2]);_0x36fce4[_0x999e('0x1f')](_0x1cd206[0x3]);_0x36fce4[_0x999e('0x1f')](_0x1cd206['slice'](0x4,_0x1cd206['length'])[_0x999e('0x21')](','));break;case _0x999e('0x15'):_0x36fce4[_0x999e('0x1f')](_0xc20d3e[_0x999e('0x23')]);break;case'tag':_0x36fce4[_0x999e('0x1f')](_0xc20d3e[_0x999e('0x25')]);_0x36fce4[_0x999e('0x1f')](_0xc20d3e[_0x999e('0x23')]);break;default:_0x36fce4=_['isNil'](_0xc20d3e['appdata'])?[]:_0xc20d3e[_0x999e('0x23')]['split'](',');}var _0xd7f2a9={'id':util[_0x999e('0xc')](_0x999e('0x26'),_0x289e0e,_0xc20d3e['id'],_0xc20d3e[_0x999e('0x1a')]),'condition':require('./interval')[_0x999e('0x27')](_0x289e0e,getIntervals(_0x2fbc3e[_0x999e('0x28')],_0xc20d3e),_0x2fbc3e),'consequence':require('./applications/'+_0xc20d3e['app'])[_0x999e('0x29')](_0x289e0e,_0x36fce4,_0x2fbc3e,_0x539598),'p':_0xc20d3e['priority']||0x0};logger[_0x999e('0x2a')]('Push\x20new\x20rule',_0xd7f2a9['id'],'on\x20interval',getIntervals(_0x2fbc3e['intervals'],_0xc20d3e)['join'](_0x999e('0x2b')));_0x2dd5f4['push'](_0xd7f2a9);}else{logger[_0x999e('0x2c')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,'applications',_0xc20d3e[_0x999e('0x1a')]+_0x999e('0x1b')));}}_0x2fbc3e[_0x999e('0x2d')][_0x289e0e]=new RuleEngine(_0x2dd5f4);_0x2fbc3e[_0x999e('0x2d')][_0x289e0e][_0x999e('0x2e')](_0x539598,function(_0x368183){logger[_0x999e('0x2a')](_0x999e('0x2f'),JSON['stringify'](_0x368183[_0x999e('0x30')]));if(_0x2fbc3e[_0x999e('0x2d')][_0x289e0e]){_0x2fbc3e[_0x999e('0x2d')][_0x289e0e][_0x999e('0x31')]('complete');}});return _0x1eee64({'code':0xc8,'message':_0x539598});}else{logger[_0x999e('0x2a')]('No\x20applications\x20to\x20execute');return _0x1eee64({'code':0xc8,'message':_0x539598});}}catch(_0x36194c){logger[_0x999e('0x2c')](_0x36194c[_0x999e('0x32')]);return _0x22feac(_0x549ad4[_0x999e('0x2c')](0x1f4,_0x36194c));}}return _0x22feac('routing\x20is\x20empty');});},'AcceptMessage':function(_0x155dae){var _0x108c96=this;return new Promise(function(_0x1bc78e,_0x494222){if(_0x155dae['agent']&&_0x155dae[_0x999e('0x33')]['id']){if(_0x2fbc3e[_0x999e('0x34')][_0x155dae[_0x999e('0x33')]['id']]){_0x2fbc3e[_0x999e('0x34')][_0x155dae[_0x999e('0x33')]['id']][_0x999e('0x35')]=![];_0x2fbc3e[_0x999e('0x34')][_0x155dae[_0x999e('0x33')]['id']][_0x999e('0x36')]=undefined;}}if(_0x155dae[_0x999e('0x15')]&&_0x155dae['message']['id']){try{var _0x4c8b36=getId(_0x155dae[_0x999e('0x14')],_0x155dae[_0x999e('0x15')]?_0x155dae[_0x999e('0x15')]['id']:0x0,_0x155dae[_0x999e('0x37')]?_0x155dae[_0x999e('0x37')]['id']:0x0);if(_0x2fbc3e[_0x999e('0x2d')][_0x4c8b36]){_0x2fbc3e['rules'][_0x4c8b36][_0x999e('0x31')]('end');if(rpc[_0x155dae['channel']+_0x999e('0x38')]){rpc[_0x155dae['channel']+'QueueReport']['update'](_0x4c8b36,{'UserId':_0x155dae['message'][_0x999e('0x39')]})[_0x999e('0x3a')](function(_0x5e50f5){logger[_0x999e('0x2c')](_0x999e('0x3b'));});}}return _0x1bc78e({'code':0xc8,'message':_0x155dae});}catch(_0x2aa9ca){logger['error'](_0x2aa9ca['stack']);return _0x494222(_0x108c96[_0x999e('0x2c')](0x1f4,_0x2aa9ca));}}logger[_0x999e('0x2c')](_0x999e('0x3c'));return _0x494222(_0x108c96['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x4d0358){var _0x5ee14d=this;return new Promise(function(_0x8f1afa,_0x56a064){if(_0x4d0358['agent']&&_0x4d0358[_0x999e('0x33')]['id']){try{if(_0x2fbc3e[_0x999e('0x34')][_0x4d0358['agent']['id']]){_0x2fbc3e[_0x999e('0x34')][_0x4d0358[_0x999e('0x33')]['id']]['busy']=![];_0x2fbc3e[_0x999e('0x34')][_0x4d0358['agent']['id']][_0x999e('0x36')]=undefined;}return _0x8f1afa({'code':0xc8,'message':_0x4d0358});}catch(_0x42dfea){logger['error'](_0x42dfea[_0x999e('0x32')]);return _0x56a064(_0x5ee14d[_0x999e('0x2c')](0x1f4,_0x42dfea));}}logger['error']('message\x20is\x20empty');return _0x56a064(_0x5ee14d[_0x999e('0x2c')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x5ebc95){var _0x4de2e8=this;return new Promise(function(_0x1f85dd,_0x3b2023){if(_0x5ebc95[_0x999e('0x14')]&&_0x5ebc95[_0x999e('0x37')]&&_0x5ebc95[_0x999e('0x37')]['id']){try{var _0x14c01c=getId(_0x5ebc95['channel'],_0x5ebc95[_0x999e('0x15')]?_0x5ebc95[_0x999e('0x15')]['id']:0x0,_0x5ebc95['interaction']?_0x5ebc95[_0x999e('0x37')]['id']:0x0);if(_0x2fbc3e[_0x999e('0x2d')][_0x14c01c]){_0x2fbc3e[_0x999e('0x2d')][_0x14c01c][_0x999e('0x31')](_0x999e('0x3d'));}return _0x1f85dd({'code':0xc8,'message':_0x5ebc95});}catch(_0x334d19){logger[_0x999e('0x2c')](_0x334d19[_0x999e('0x32')]);return _0x3b2023(_0x4de2e8[_0x999e('0x2c')](0x1f4,_0x334d19));}}logger['error'](_0x999e('0x3c'));return _0x3b2023(_0x4de2e8[_0x999e('0x2c')](0x1f4,_0x999e('0x3c')));});},'AgentCapacity':function(_0x71df6c){var _0x525191=this;return new Promise(function(_0x392324,_0x24cc60){if(_0x2fbc3e[_0x999e('0x34')][_0x999e('0x3e')](_0x71df6c['id'])){for(var _0x3e475b in _0x71df6c[_0x999e('0x3f')]){if(_0x71df6c[_0x999e('0x3f')][_0x999e('0x3e')](_0x3e475b)){if(_0x2fbc3e['agents'][_0x71df6c['id']]['hasOwnProperty'](_0x3e475b+_0x999e('0x40'))){_0x2fbc3e[_0x999e('0x34')][_0x71df6c['id']][_0x3e475b+_0x999e('0x40')]=parseInt(_0x71df6c[_0x999e('0x3f')][_0x3e475b],0xa);}}}_0x2fbc3e[_0x999e('0x34')][_0x71df6c['id']][_0x999e('0x41')]();return _0x392324({'code':0xc8,'message':_0x2fbc3e[_0x999e('0x34')][_0x71df6c['id']]});}else{return _0x24cc60(_0x525191['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xb9d60b){return new Promise(function(_0x55ae5,_0x36c3dc){var _0x3e9531=_[_0x999e('0x42')](_0x2fbc3e['agents']);_0x55ae5({'count':_0x3e9531[_0x999e('0x18')],'rows':_0x3e9531});});},'ChatQueues':function(_0x1e7ad2){return new Promise(function(_0x30a49d,_0x3c8ecf){var _0x502c9=[];for(var _0x434e13 in _0x2fbc3e[_0x999e('0x43')]){if(_0x2fbc3e['chatQueues'][_0x999e('0x3e')](_0x434e13)){var _0x521b7a=_0x2fbc3e[_0x999e('0x43')][_0x434e13];var _0x43217e={'id':_0x521b7a['id'],'available':_0x521b7a[_0x999e('0x44')],'loggedIn':_0x521b7a[_0x999e('0x45')],'name':_0x521b7a[_0x999e('0x46')],'paused':_0x521b7a[_0x999e('0x47')],'waiting':_0x521b7a['waiting']};_0x502c9[_0x999e('0x1f')](_0x43217e);}}_0x30a49d({'count':_0x502c9[_0x999e('0x18')],'rows':_0x502c9});});},'MailQueues':function(_0xf3116c){return new Promise(function(_0xe39e00,_0x470e51){var _0x121110=[];for(var _0x23fd58 in _0x2fbc3e[_0x999e('0x48')]){if(_0x2fbc3e[_0x999e('0x48')][_0x999e('0x3e')](_0x23fd58)){var _0x8ac47d=_0x2fbc3e[_0x999e('0x48')][_0x23fd58];var _0x77a387={'id':_0x8ac47d['id'],'available':_0x8ac47d[_0x999e('0x44')],'loggedIn':_0x8ac47d[_0x999e('0x45')],'name':_0x8ac47d['name'],'paused':_0x8ac47d[_0x999e('0x47')],'waiting':_0x8ac47d[_0x999e('0x49')]};_0x121110[_0x999e('0x1f')](_0x77a387);}}_0xe39e00({'count':_0x121110[_0x999e('0x18')],'rows':_0x121110});});},'OpenchannelQueues':function(_0x4e5e6e){return new Promise(function(_0x4871c9,_0x21c8be){var _0x2d398f=[];for(var _0x67267d in _0x2fbc3e[_0x999e('0x4a')]){if(_0x2fbc3e[_0x999e('0x4a')][_0x999e('0x3e')](_0x67267d)){var _0x1596bb=_0x2fbc3e[_0x999e('0x4a')][_0x67267d];var _0x2bf43d={'id':_0x1596bb['id'],'available':_0x1596bb['available'],'loggedIn':_0x1596bb[_0x999e('0x45')],'name':_0x1596bb['name'],'paused':_0x1596bb[_0x999e('0x47')],'waiting':_0x1596bb[_0x999e('0x49')]};_0x2d398f['push'](_0x2bf43d);}}_0x4871c9({'count':_0x2d398f[_0x999e('0x18')],'rows':_0x2d398f});});},'SmsQueues':function(_0x175904){return new Promise(function(_0x35fbf6,_0xcbe77a){var _0x17beed=[];for(var _0x4ba9cd in _0x2fbc3e[_0x999e('0x4b')]){if(_0x2fbc3e[_0x999e('0x4b')]['hasOwnProperty'](_0x4ba9cd)){var _0x4f9218=_0x2fbc3e['smsQueues'][_0x4ba9cd];var _0x43ec04={'id':_0x4f9218['id'],'available':_0x4f9218[_0x999e('0x44')],'loggedIn':_0x4f9218[_0x999e('0x45')],'name':_0x4f9218[_0x999e('0x46')],'paused':_0x4f9218[_0x999e('0x47')],'waiting':_0x4f9218['waiting']};_0x17beed['push'](_0x43ec04);}}_0x35fbf6({'count':_0x17beed['length'],'rows':_0x17beed});});},'FaxQueues':function(_0x49293d){return new Promise(function(_0x513580,_0x53ba16){var _0x397488=[];for(var _0x59429f in _0x2fbc3e[_0x999e('0x4c')]){if(_0x2fbc3e[_0x999e('0x4c')][_0x999e('0x3e')](_0x59429f)){var _0x5b8a0d=_0x2fbc3e[_0x999e('0x4c')][_0x59429f];var _0x3c2bce={'id':_0x5b8a0d['id'],'available':_0x5b8a0d[_0x999e('0x44')],'loggedIn':_0x5b8a0d[_0x999e('0x45')],'name':_0x5b8a0d[_0x999e('0x46')],'paused':_0x5b8a0d[_0x999e('0x47')],'waiting':_0x5b8a0d[_0x999e('0x49')]};_0x397488['push'](_0x3c2bce);}}_0x513580({'count':_0x397488[_0x999e('0x18')],'rows':_0x397488});});},'WhatsappQueues':function(_0x397935){return new Promise(function(_0x193c80,_0x5781d2){var _0x2a7150=[];for(var _0x12d040 in _0x2fbc3e['whatsappQueues']){if(_0x2fbc3e[_0x999e('0x4d')][_0x999e('0x3e')](_0x12d040)){var _0x3a404d=_0x2fbc3e[_0x999e('0x4d')][_0x12d040];var _0xc02339={'id':_0x3a404d['id'],'available':_0x3a404d[_0x999e('0x44')],'loggedIn':_0x3a404d[_0x999e('0x45')],'name':_0x3a404d[_0x999e('0x46')],'paused':_0x3a404d[_0x999e('0x47')],'waiting':_0x3a404d['waiting']};_0x2a7150[_0x999e('0x1f')](_0xc02339);}}_0x193c80({'count':_0x2a7150[_0x999e('0x18')],'rows':_0x2a7150});});},'ChatQueuesWaitingInteractions':function(_0x3ec467){return new Promise(function(_0x58a51e,_0x46365a){var _0x48e0ca=_[_0x999e('0x42')](_0x2fbc3e[_0x999e('0x4e')]);_0x58a51e({'count':_0x48e0ca[_0x999e('0x18')],'rows':_0x48e0ca});});},'MailQueuesWaitingInteractions':function(_0x4e6c30){return new Promise(function(_0x43377d,_0xbde93c){var _0x1d6b40=_[_0x999e('0x42')](_0x2fbc3e[_0x999e('0x4f')]);_0x43377d({'count':_0x1d6b40[_0x999e('0x18')],'rows':_0x1d6b40});});},'OpenchannelQueuesWaitingInteractions':function(_0x5c4a50){return new Promise(function(_0x13823c,_0x498e70){var _0x34f25c=_['values'](_0x2fbc3e['openchannelQueuesWaitingInteractions']);_0x13823c({'count':_0x34f25c[_0x999e('0x18')],'rows':_0x34f25c});});},'SmsQueuesWaitingInteractions':function(_0x5d136c){return new Promise(function(_0x3c5d8d,_0x234921){var _0x5adf0c=_[_0x999e('0x42')](_0x2fbc3e[_0x999e('0x50')]);_0x3c5d8d({'count':_0x5adf0c['length'],'rows':_0x5adf0c});});},'FaxQueuesWaitingInteractions':function(_0x2a4d85){return new Promise(function(_0x6492cc,_0x17a764){var _0x224242=_[_0x999e('0x42')](_0x2fbc3e[_0x999e('0x51')]);_0x6492cc({'count':_0x224242[_0x999e('0x18')],'rows':_0x224242});});},'WhatsappQueuesWaitingInteractions':function(_0x25b243){return new Promise(function(_0x5cdf6d,_0x496aba){var _0x34541f=_[_0x999e('0x42')](_0x2fbc3e[_0x999e('0x52')]);_0x5cdf6d({'count':_0x34541f[_0x999e('0x18')],'rows':_0x34541f});});}};var _0x142843=jayson[_0x999e('0x53')](_0xa44e4c)['http']();_0x142843['on'](_0x999e('0x2c'),function(_0x19cb19){logger['error'](JSON[_0x999e('0x54')](_0x19cb19));return _0x4d1716(_0x19cb19);});_0x142843[_0x999e('0x13')](0x232c,_0x999e('0x55'),function(){console['log'](_0x999e('0x56'),0x232c);return _0x28bdd1(_0x999e('0x57')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 827541e..5009956 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 _0x3daf=['[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','when','catch','\x20|\x20','stop','util','bluebird','lodash','../../../config/logger','routing','client','request','then','error','message','result','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','format','iftime\x20%s','indexOf'];(function(_0x239cb5,_0x57f91f){var _0x109195=function(_0x5a0b25){while(--_0x5a0b25){_0x239cb5['push'](_0x239cb5['shift']());}};_0x109195(++_0x57f91f);}(_0x3daf,0x95));var _0xf3da=function(_0x1ab324,_0x2f57f0){_0x1ab324=_0x1ab324-0x0;var _0x201c68=_0x3daf[_0x1ab324];return _0x201c68;};'use strict';var util=require(_0xf3da('0x0'));var BPromise=require(_0xf3da('0x1'));var jayson=require('jayson/promise');var _=require(_0xf3da('0x2'));var logger=require(_0xf3da('0x3'))(_0xf3da('0x4'));var client=jayson[_0xf3da('0x5')]['http']({'port':0x232a});function request(_0x575da6,_0x389879){return new BPromise(function(_0x4a49dd,_0x31333a){return client[_0xf3da('0x6')](_0x575da6,_0x389879)[_0xf3da('0x7')](function(_0x1b5b86){if(_0x1b5b86['error']){return _0x31333a(_0x1b5b86[_0xf3da('0x8')][_0xf3da('0x9')]);}else{return _0x4a49dd(_0x1b5b86[_0xf3da('0xa')]);}})['catch'](function(_0x14850c){return _0x31333a(_0x14850c);});});}exports['condition']=function(_0x434e9d,_0x3379d6,_0xbbe163){return function(_0x4bd176){if(_0xbbe163['rules']&&!_0xbbe163[_0xf3da('0xb')][_0x434e9d]){logger['info'](_0xf3da('0xc'),_0x434e9d);return _0x4bd176['stop']();}var _0x54af83=[];for(var _0x3a6fb1=0x0;_0x3a6fb1<_0x3379d6[_0xf3da('0xd')];_0x3a6fb1+=0x1){_0x54af83[_0xf3da('0xe')](request(_0xf3da('0xf'),{'command':util[_0xf3da('0x10')](_0xf3da('0x11'),_0x3379d6[_0x3a6fb1])})[_0xf3da('0x7')](function(_0x40a741){return _0x40a741&&_0x40a741[_0xf3da('0x9')]&&_0x40a741['message'][_0xf3da('0x12')]('true')>=0x0?!![]:![];})['catch'](function(_0x41a734){logger[_0xf3da('0x8')](_0xf3da('0x13'),_0x434e9d,_0x3379d6[_0x3a6fb1]);}));}BPromise[_0xf3da('0x14')](_0x54af83)[_0xf3da('0x7')](function(_0x558cbf){var _0x52a92f=_[_0xf3da('0x15')](_0x558cbf);logger[_0xf3da('0x16')](_0xf3da('0x17'),_0x434e9d,_0x3379d6['join']('\x20|\x20'),_0x52a92f);_0x4bd176[_0xf3da('0x18')](_0x52a92f);})[_0xf3da('0x19')](function(_0x135c13){console['log'](_0x135c13);logger[_0xf3da('0x8')](_0xf3da('0x17'),_0x434e9d,_0x3379d6['join'](_0xf3da('0x1a')),_0x135c13['stack']);_0x4bd176[_0xf3da('0x1b')]();});};}; \ No newline at end of file +var _0x14f7=['format','indexOf','catch','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','\x20|\x20','stack','util','bluebird','lodash','../../../config/logger','routing','client','http','request','then','error','message','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x14f7,0x119));var _0x714f=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x14f7[_0x2763f2];return _0x3ef471;};'use strict';var util=require(_0x714f('0x0'));var BPromise=require(_0x714f('0x1'));var jayson=require('jayson/promise');var _=require(_0x714f('0x2'));var logger=require(_0x714f('0x3'))(_0x714f('0x4'));var client=jayson[_0x714f('0x5')][_0x714f('0x6')]({'port':0x232a});function request(_0x10c7d6,_0x17a792){return new BPromise(function(_0x37ef7d,_0x593833){return client[_0x714f('0x7')](_0x10c7d6,_0x17a792)[_0x714f('0x8')](function(_0x2cce93){if(_0x2cce93[_0x714f('0x9')]){return _0x593833(_0x2cce93[_0x714f('0x9')][_0x714f('0xa')]);}else{return _0x37ef7d(_0x2cce93['result']);}})['catch'](function(_0x5b5734){return _0x593833(_0x5b5734);});});}exports[_0x714f('0xb')]=function(_0x59c2f5,_0x186a19,_0xb53b89){return function(_0x1422d5){if(_0xb53b89['rules']&&!_0xb53b89[_0x714f('0xc')][_0x59c2f5]){logger[_0x714f('0xd')](_0x714f('0xe'),_0x59c2f5);return _0x1422d5[_0x714f('0xf')]();}var _0x2fca56=[];for(var _0x4e4756=0x0;_0x4e4756<_0x186a19[_0x714f('0x10')];_0x4e4756+=0x1){_0x2fca56[_0x714f('0x11')](request(_0x714f('0x12'),{'command':util[_0x714f('0x13')]('iftime\x20%s',_0x186a19[_0x4e4756])})[_0x714f('0x8')](function(_0x22a24e){return _0x22a24e&&_0x22a24e['message']&&_0x22a24e['message'][_0x714f('0x14')]('true')>=0x0?!![]:![];})[_0x714f('0x15')](function(_0xb28ad7){logger[_0x714f('0x9')](_0x714f('0x16'),_0x59c2f5,_0x186a19[_0x4e4756]);}));}BPromise['all'](_0x2fca56)['then'](function(_0xd46161){var _0x3a3bb9=_[_0x714f('0x17')](_0xd46161);logger[_0x714f('0xd')](_0x714f('0x18'),_0x59c2f5,_0x186a19[_0x714f('0x19')]('\x20|\x20'),_0x3a3bb9);_0x1422d5[_0x714f('0x1a')](_0x3a3bb9);})[_0x714f('0x15')](function(_0x5ec1a7){console[_0x714f('0x1b')](_0x5ec1a7);logger[_0x714f('0x9')](_0x714f('0x18'),_0x59c2f5,_0x186a19[_0x714f('0x19')](_0x714f('0x1c')),_0x5ec1a7[_0x714f('0x1d')]);_0x1422d5['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index ecab7b0..7fb1748 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 _0xb9e1=['type','agentacw','acw','acwtime','request','CreateVoiceAgentReport','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','queuecallerabandon','forIn','includes','debug','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','abandoned','[%s][agents][queuecallerabandon]','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','diffTime','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName'];(function(_0x19dac3,_0x179387){var _0x3be408=function(_0x10a398){while(--_0x10a398){_0x19dac3['push'](_0x19dac3['shift']());}};_0x3be408(++_0x179387);}(_0xb9e1,0x1eb));var _0x1b9e=function(_0x25601e,_0x3bd0f4){_0x25601e=_0x25601e-0x0;var _0x54d208=_0xb9e1[_0x25601e];return _0x54d208;};'use strict';var _=require(_0x1b9e('0x0'));var util=require('util');var utils=require(_0x1b9e('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x24c854,_0xd88176){utils[_0x1b9e('0x2')](util[_0x1b9e('0x3')](_0x1b9e('0x4'),_0x24c854[_0x1b9e('0x5')],_0x24c854[_0x1b9e('0x6')],_0x24c854[_0x1b9e('0x7')],_0x24c854[_0x1b9e('0x8')],_0x24c854['interface'],_0x24c854[_0x1b9e('0x9')],_0x24c854[_0x1b9e('0xa')],_0x24c854[_0x1b9e('0xb')]));if(_0x24c854[_0x1b9e('0x7')]){utils[_0x1b9e('0xc')](_0x24c854[_0x1b9e('0x7')])['then'](function(_0x2ef5d0){if(_0x2ef5d0){_0x24c854[_0x1b9e('0xd')]=_0x2ef5d0['type'];_0x24c854[_0x1b9e('0xe')]=_0x24c854['agentcomplete']?_0x2ef5d0[_0x1b9e('0xf')]:![];_0x24c854[_0x1b9e('0x10')]=_0x24c854[_0x1b9e('0xe')]?_0x2ef5d0['acwTimeout']:0x0;}utils[_0x1b9e('0x11')](_0x1b9e('0x12'),_0x24c854);});}else{utils[_0x1b9e('0x11')](_0x1b9e('0x12'),_0x24c854);}if(_0xd88176){delete transfers[_0x24c854[_0x1b9e('0x5')]];}else{delete agents[_0x24c854['destuniqueid']];}}exports['agentcalled']=function(_0x3b75d1){try{utils['debug'](util['format'](_0x1b9e('0x13'),_0x3b75d1[_0x1b9e('0x5')]),_0x3b75d1);agents[_0x3b75d1[_0x1b9e('0x14')]]=_0x3b75d1;agents[_0x3b75d1[_0x1b9e('0x14')]][_0x1b9e('0x15')]=utils[_0x1b9e('0x16')]();agents[_0x3b75d1['destuniqueid']][_0x1b9e('0xb')]=_0x1b9e('0x17');agents[_0x3b75d1[_0x1b9e('0x14')]]['connectedlinenum']=null;agents[_0x3b75d1['destuniqueid']]['connectedlinename']=null;utils[_0x1b9e('0x2')](util['format'](_0x1b9e('0x18'),_0x3b75d1[_0x1b9e('0x5')],agents[_0x3b75d1[_0x1b9e('0x14')]][_0x1b9e('0x8')],_0x3b75d1[_0x1b9e('0x14')]));}catch(_0x3617c1){utils[_0x1b9e('0x19')](util[_0x1b9e('0x3')](_0x1b9e('0x13'),_0x3b75d1[_0x1b9e('0x5')]),_0x3617c1);}};exports['agentringnoanswer']=function(_0x554a28){try{if(!_[_0x1b9e('0x1a')](agents[_0x554a28['destuniqueid']])){utils['debug'](util[_0x1b9e('0x3')](_0x1b9e('0x1b'),_0x554a28['uniqueid']),_0x554a28);utils['info'](util[_0x1b9e('0x3')](_0x1b9e('0x1c'),_0x554a28[_0x1b9e('0x5')],agents[_0x554a28[_0x1b9e('0x14')]][_0x1b9e('0x8')],_0x554a28['destuniqueid']));agents[_0x554a28[_0x1b9e('0x14')]][_0x1b9e('0x1d')]=!![];agents[_0x554a28[_0x1b9e('0x14')]][_0x1b9e('0x1e')]=utils[_0x1b9e('0x16')]();agents[_0x554a28[_0x1b9e('0x14')]][_0x1b9e('0xb')]=_0x1b9e('0x1f');agents[_0x554a28[_0x1b9e('0x14')]]['reason']=_0x1b9e('0x1f');agents[_0x554a28['destuniqueid']][_0x1b9e('0x20')]=_0x554a28[_0x1b9e('0x21')]?parseInt(_0x554a28['ringtime'])/0x3e8:0x0;agents[_0x554a28['destuniqueid']][_0x1b9e('0x22')]=0x0;unanswered['push'](_0x554a28[_0x1b9e('0x14')]);}}catch(_0x389382){utils[_0x1b9e('0x19')](util[_0x1b9e('0x3')](_0x1b9e('0x1b'),_0x554a28[_0x1b9e('0x5')]),_0x389382);}};exports[_0x1b9e('0x23')]=function(_0x5b250c){try{_[_0x1b9e('0x24')](agents,function(_0x10e71b,_0x33fda3){if(_0x10e71b[_0x1b9e('0x5')]==_0x5b250c['uniqueid']&&!_[_0x1b9e('0x25')](unanswered,_0x10e71b[_0x1b9e('0x14')])){utils[_0x1b9e('0x26')](util[_0x1b9e('0x3')]('[%s][agents][queuecallerabandon]',_0x5b250c[_0x1b9e('0x5')]),_0x5b250c);utils[_0x1b9e('0x2')](util[_0x1b9e('0x3')](_0x1b9e('0x27'),_0x5b250c[_0x1b9e('0x5')],_0x10e71b[_0x1b9e('0x8')],_0x10e71b[_0x1b9e('0x14')]));_0x10e71b[_0x1b9e('0x1d')]=!![];_0x10e71b[_0x1b9e('0x1e')]=utils[_0x1b9e('0x16')]();_0x10e71b[_0x1b9e('0xb')]='abandoned';_0x10e71b[_0x1b9e('0x28')]=_0x1b9e('0x29');_0x10e71b['holdtime']=_0x5b250c['holdtime'];_0x10e71b[_0x1b9e('0x22')]=0x0;writeDB(_0x10e71b);}});}catch(_0x10cd48){utils[_0x1b9e('0x19')](util[_0x1b9e('0x3')](_0x1b9e('0x2a'),_0x5b250c[_0x1b9e('0x5')]),_0x10cd48);}};exports['agentconnect']=function(_0x349059){try{if(agents[_0x349059[_0x1b9e('0x14')]]){utils['debug'](util[_0x1b9e('0x3')](_0x1b9e('0x2b'),_0x349059[_0x1b9e('0x5')]),_0x349059);utils[_0x1b9e('0x2')](util[_0x1b9e('0x3')](_0x1b9e('0x2c'),_0x349059[_0x1b9e('0x5')],agents[_0x349059[_0x1b9e('0x14')]][_0x1b9e('0x8')],_0x349059[_0x1b9e('0x14')]));agents[_0x349059[_0x1b9e('0x14')]][_0x1b9e('0x2d')]=utils[_0x1b9e('0x16')]();agents[_0x349059['destuniqueid']][_0x1b9e('0xa')]=_0x349059[_0x1b9e('0xa')];agents[_0x349059[_0x1b9e('0x14')]]['connectedlinename']=_0x349059[_0x1b9e('0x2e')];agents[_0x349059[_0x1b9e('0x14')]][_0x1b9e('0x20')]=_0x349059[_0x1b9e('0x21')];agents[_0x349059['destuniqueid']]['lastevent']='connect';_[_0x1b9e('0x24')](agents,function(_0x56842f,_0x53a117){if(_0x56842f[_0x1b9e('0x14')]!=_0x349059[_0x1b9e('0x14')]&&_0x56842f[_0x1b9e('0x5')]==_0x349059[_0x1b9e('0x5')]){_0x56842f['talktime']=0x0;_0x56842f[_0x1b9e('0x20')]=_0x349059[_0x1b9e('0x21')];_0x56842f[_0x1b9e('0x1d')]=!![];_0x56842f[_0x1b9e('0x1e')]=utils[_0x1b9e('0x16')]();_0x56842f['lastevent']='answered_elsewhere';_0x56842f[_0x1b9e('0x28')]=_0x1b9e('0x2f');_0x56842f[_0x1b9e('0x30')]=_0x349059[_0x1b9e('0x14')];_0x56842f[_0x1b9e('0x31')]=_0x349059[_0x1b9e('0x8')];writeDB(_0x56842f);}});}}catch(_0x43f633){utils[_0x1b9e('0x19')](util[_0x1b9e('0x3')](_0x1b9e('0x2b'),_0x349059[_0x1b9e('0x5')]),_0x43f633);}};exports[_0x1b9e('0x32')]=function(_0x550344){try{if(!_[_0x1b9e('0x1a')](agents[_0x550344[_0x1b9e('0x14')]])){utils['debug'](util['format']('[%s][agents][agentcomplete]',_0x550344[_0x1b9e('0x5')]),_0x550344);utils[_0x1b9e('0x2')](util[_0x1b9e('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x550344[_0x1b9e('0x5')],agents[_0x550344['destuniqueid']][_0x1b9e('0x8')],_0x550344[_0x1b9e('0x14')]));agents[_0x550344[_0x1b9e('0x14')]][_0x1b9e('0x32')]=!![];agents[_0x550344['destuniqueid']]['agentcompleteAt']=utils[_0x1b9e('0x16')]();agents[_0x550344['destuniqueid']]['talktime']=utils[_0x1b9e('0x33')](agents[_0x550344[_0x1b9e('0x14')]][_0x1b9e('0x34')],agents[_0x550344[_0x1b9e('0x14')]][_0x1b9e('0x2d')]);agents[_0x550344[_0x1b9e('0x14')]]['reason']=_0x550344[_0x1b9e('0x28')];agents[_0x550344[_0x1b9e('0x14')]][_0x1b9e('0xb')]=_0x1b9e('0x35');writeDB(agents[_0x550344[_0x1b9e('0x14')]]);}}catch(_0x4fdfe5){utils[_0x1b9e('0x19')](util[_0x1b9e('0x3')](_0x1b9e('0x36'),_0x550344[_0x1b9e('0x5')]),_0x4fdfe5);}};exports[_0x1b9e('0x37')]=function(_0x3fb3a2){try{if(!_[_0x1b9e('0x1a')](agents[_0x3fb3a2['transfereruniqueid']])){utils['debug'](util[_0x1b9e('0x3')](_0x1b9e('0x38'),_0x3fb3a2[_0x1b9e('0x5')]),_0x3fb3a2);utils[_0x1b9e('0x2')](util[_0x1b9e('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x3fb3a2[_0x1b9e('0x5')],agents[_0x3fb3a2[_0x1b9e('0x39')]][_0x1b9e('0x8')],agents[_0x3fb3a2[_0x1b9e('0x39')]][_0x1b9e('0x5')]));agents[_0x3fb3a2[_0x1b9e('0x39')]][_0x1b9e('0x3a')]=!![];agents[_0x3fb3a2['transfereruniqueid']][_0x1b9e('0x3b')]=_0x1b9e('0x3c');agents[_0x3fb3a2[_0x1b9e('0x39')]][_0x1b9e('0x3d')]=_0x3fb3a2[_0x1b9e('0x3e')];agents[_0x3fb3a2['transfereruniqueid']][_0x1b9e('0x3f')]=agents[_0x3fb3a2['transfereruniqueid']][_0x1b9e('0x5')];}}catch(_0x1a5837){utils[_0x1b9e('0x19')](util[_0x1b9e('0x3')](_0x1b9e('0x38'),_0x3fb3a2['uniqueid']),_0x1a5837);}};exports[_0x1b9e('0x40')]=function(_0x28c727){try{utils['debug'](util['format'](_0x1b9e('0x41'),_0x28c727[_0x1b9e('0x42')]),_0x28c727);if(_0x28c727[_0x1b9e('0x42')]==_0x28c727['origtransfererlinkedid']){if(!_['isNil'](agents[_0x28c727['secondtransfereruniqueid']])){utils[_0x1b9e('0x2')](util[_0x1b9e('0x3')](_0x1b9e('0x43'),_0x28c727[_0x1b9e('0x42')],agents[_0x28c727[_0x1b9e('0x44')]][_0x1b9e('0x8')]));agents[_0x28c727[_0x1b9e('0x44')]][_0x1b9e('0x3a')]=!![];agents[_0x28c727[_0x1b9e('0x44')]]['transfertype']=_0x1b9e('0x45');agents[_0x28c727[_0x1b9e('0x44')]][_0x1b9e('0x3d')]=_0x28c727['origtransfererexten'];agents[_0x28c727[_0x1b9e('0x44')]][_0x1b9e('0x3f')]=_0x28c727[_0x1b9e('0x42')];}if(_0x28c727['transfereeuniqueid']&&agents[_0x28c727[_0x1b9e('0x46')]]){agents[_0x28c727[_0x1b9e('0x46')]][_0x1b9e('0x47')]=0x1;transfers[_0x28c727['transfereeuniqueid']]=_['clone'](agents[_0x28c727[_0x1b9e('0x46')]]);transfers[_0x28c727[_0x1b9e('0x46')]][_0x1b9e('0x9')]=agents[_0x28c727[_0x1b9e('0x44')]][_0x1b9e('0x9')];transfers[_0x28c727['transfereeuniqueid']][_0x1b9e('0x48')]=agents[_0x28c727[_0x1b9e('0x44')]][_0x1b9e('0x48')];transfers[_0x28c727['transfereeuniqueid']][_0x1b9e('0x15')]=utils[_0x1b9e('0x16')]();transfers[_0x28c727['transfereeuniqueid']][_0x1b9e('0x2d')]=utils[_0x1b9e('0x16')]();transfers[_0x28c727[_0x1b9e('0x46')]][_0x1b9e('0x20')]=0x0;transfers[_0x28c727['transfereeuniqueid']][_0x1b9e('0x47')]=0x2;}}else if(_0x28c727[_0x1b9e('0x44')]==_0x28c727[_0x1b9e('0x49')]){if(!_['isNil'](agents[_0x28c727['origtransfereruniqueid']])){utils['info'](util[_0x1b9e('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x28c727[_0x1b9e('0x42')],agents[_0x28c727[_0x1b9e('0x42')]][_0x1b9e('0x8')]));agents[_0x28c727[_0x1b9e('0x42')]][_0x1b9e('0x3a')]=!![];agents[_0x28c727['origtransfereruniqueid']][_0x1b9e('0x3b')]='ATTENDED';agents[_0x28c727[_0x1b9e('0x42')]][_0x1b9e('0x3d')]=_0x28c727[_0x1b9e('0x4a')];agents[_0x28c727[_0x1b9e('0x42')]][_0x1b9e('0x3f')]=_0x28c727[_0x1b9e('0x44')];}if(_0x28c727[_0x1b9e('0x4b')]&&agents[_0x28c727[_0x1b9e('0x4b')]]){agents[_0x28c727[_0x1b9e('0x4b')]][_0x1b9e('0x47')]=0x1;transfers[_0x28c727[_0x1b9e('0x4b')]]=_[_0x1b9e('0x4c')](agents[_0x28c727['transfertargetuniqueid']]);transfers[_0x28c727[_0x1b9e('0x4b')]][_0x1b9e('0x9')]=agents[_0x28c727[_0x1b9e('0x42')]][_0x1b9e('0x9')];transfers[_0x28c727[_0x1b9e('0x4b')]][_0x1b9e('0x48')]=agents[_0x28c727[_0x1b9e('0x42')]][_0x1b9e('0x48')];transfers[_0x28c727[_0x1b9e('0x4b')]]['agentcalledAt']=utils['now']();transfers[_0x28c727[_0x1b9e('0x4b')]]['agentconnectAt']=utils[_0x1b9e('0x16')]();transfers[_0x28c727[_0x1b9e('0x4b')]]['holdtime']=0x0;transfers[_0x28c727[_0x1b9e('0x4b')]][_0x1b9e('0x47')]=0x2;}}}catch(_0x456f0f){utils['error'](util[_0x1b9e('0x3')](_0x1b9e('0x41'),_0x28c727[_0x1b9e('0x42')]),_0x456f0f);}};exports[_0x1b9e('0x4d')]=function(_0x5a62cd){try{utils[_0x1b9e('0x26')](util[_0x1b9e('0x3')](_0x1b9e('0x4e'),_0x5a62cd[_0x1b9e('0x5')]),_0x5a62cd);if(agents[_0x5a62cd[_0x1b9e('0x5')]]&&agents[_0x5a62cd['uniqueid']][_0x1b9e('0x28')]==='timeout'){if(_0x5a62cd[_0x1b9e('0x4f')]==='21'){agents[_0x5a62cd[_0x1b9e('0x5')]]['reason']=_0x1b9e('0x50');agents[_0x5a62cd[_0x1b9e('0x5')]][_0x1b9e('0xb')]='rejected';}utils[_0x1b9e('0x2')](util[_0x1b9e('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5a62cd[_0x1b9e('0x5')],agents[_0x5a62cd[_0x1b9e('0x5')]][_0x1b9e('0x8')],agents[_0x5a62cd[_0x1b9e('0x5')]][_0x1b9e('0x28')],agents[_0x5a62cd[_0x1b9e('0x5')]]['lastevent']));writeDB(agents[_0x5a62cd[_0x1b9e('0x5')]]);var _0x2a8a55=unanswered[_0x1b9e('0x51')](_0x5a62cd[_0x1b9e('0x5')]);if(_0x2a8a55>-0x1){unanswered[_0x1b9e('0x52')](_0x2a8a55,0x1);}}if(transfers[_0x5a62cd[_0x1b9e('0x5')]]){transfers[_0x5a62cd[_0x1b9e('0x5')]][_0x1b9e('0x32')]=!![];transfers[_0x5a62cd[_0x1b9e('0x5')]][_0x1b9e('0x34')]=utils['now']();transfers[_0x5a62cd[_0x1b9e('0x5')]][_0x1b9e('0x22')]=utils[_0x1b9e('0x33')](transfers[_0x5a62cd[_0x1b9e('0x5')]]['agentcompleteAt'],transfers[_0x5a62cd['uniqueid']][_0x1b9e('0x2d')]);transfers[_0x5a62cd['uniqueid']]['reason']='agent';transfers[_0x5a62cd['uniqueid']][_0x1b9e('0xb')]='complete';utils['info'](util[_0x1b9e('0x3')](_0x1b9e('0x53'),_0x5a62cd[_0x1b9e('0x5')],transfers[_0x5a62cd[_0x1b9e('0x5')]][_0x1b9e('0x8')],transfers[_0x5a62cd['uniqueid']]['reason'],transfers[_0x5a62cd[_0x1b9e('0x5')]][_0x1b9e('0xb')]));writeDB(transfers[_0x5a62cd[_0x1b9e('0x5')]],!![]);}if(agents[_0x5a62cd[_0x1b9e('0x5')]]&&agents[_0x5a62cd[_0x1b9e('0x5')]][_0x1b9e('0x2d')]){agents[_0x5a62cd[_0x1b9e('0x5')]]['agentcomplete']=!![];agents[_0x5a62cd['uniqueid']][_0x1b9e('0x34')]=utils[_0x1b9e('0x16')]();agents[_0x5a62cd[_0x1b9e('0x5')]][_0x1b9e('0x22')]=utils[_0x1b9e('0x33')](agents[_0x5a62cd['uniqueid']][_0x1b9e('0x34')],agents[_0x5a62cd[_0x1b9e('0x5')]][_0x1b9e('0x2d')]);agents[_0x5a62cd['uniqueid']][_0x1b9e('0x28')]=agents[_0x5a62cd[_0x1b9e('0x5')]][_0x1b9e('0x3a')]?_0x1b9e('0x3a'):'agent';agents[_0x5a62cd[_0x1b9e('0x5')]]['lastevent']=_0x1b9e('0x35');utils[_0x1b9e('0x2')](util['format'](_0x1b9e('0x53'),_0x5a62cd[_0x1b9e('0x5')],agents[_0x5a62cd[_0x1b9e('0x5')]]['membername'],agents[_0x5a62cd[_0x1b9e('0x5')]]['reason'],agents[_0x5a62cd[_0x1b9e('0x5')]][_0x1b9e('0xb')]));writeDB(agents[_0x5a62cd['uniqueid']]);}}catch(_0x3c9105){utils[_0x1b9e('0x19')](util[_0x1b9e('0x3')](_0x1b9e('0x4e'),_0x5a62cd[_0x1b9e('0x5')]),_0x3c9105);}}; \ No newline at end of file +var _0xed79=['origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','diffTime','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','lastevent','getVoiceQueueByName','then','type','agentacw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','connectedlinenum','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','ringtime','talktime','push','[%s][agents][agentringnoanswer]','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','holdtime','error','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcomplete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','transferexten','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid'];(function(_0xcf581b,_0x4359dd){var _0x4f454d=function(_0x182d58){while(--_0x182d58){_0xcf581b['push'](_0xcf581b['shift']());}};_0x4f454d(++_0x4359dd);}(_0xed79,0x17e));var _0x9ed7=function(_0x1acfdc,_0x594588){_0x1acfdc=_0x1acfdc-0x0;var _0x2dccef=_0xed79[_0x1acfdc];return _0x2dccef;};'use strict';var _=require('lodash');var util=require(_0x9ed7('0x0'));var utils=require(_0x9ed7('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x10034f,_0x372f74){utils[_0x9ed7('0x2')](util[_0x9ed7('0x3')](_0x9ed7('0x4'),_0x10034f[_0x9ed7('0x5')],_0x10034f[_0x9ed7('0x6')],_0x10034f[_0x9ed7('0x7')],_0x10034f[_0x9ed7('0x8')],_0x10034f[_0x9ed7('0x9')],_0x10034f[_0x9ed7('0xa')],_0x10034f['connectedlinenum'],_0x10034f[_0x9ed7('0xb')]));if(_0x10034f[_0x9ed7('0x7')]){utils[_0x9ed7('0xc')](_0x10034f[_0x9ed7('0x7')])[_0x9ed7('0xd')](function(_0x2df951){if(_0x2df951){_0x10034f[_0x9ed7('0xe')]=_0x2df951['type'];_0x10034f[_0x9ed7('0xf')]=_0x10034f['agentcomplete']?_0x2df951['acw']:![];_0x10034f[_0x9ed7('0x10')]=_0x10034f[_0x9ed7('0xf')]?_0x2df951[_0x9ed7('0x11')]:0x0;}utils[_0x9ed7('0x12')]('CreateVoiceAgentReport',_0x10034f);});}else{utils['request'](_0x9ed7('0x13'),_0x10034f);}if(_0x372f74){delete transfers[_0x10034f[_0x9ed7('0x5')]];}else{delete agents[_0x10034f['destuniqueid']];}}exports[_0x9ed7('0x14')]=function(_0x12766e){try{utils[_0x9ed7('0x15')](util[_0x9ed7('0x3')](_0x9ed7('0x16'),_0x12766e[_0x9ed7('0x5')]),_0x12766e);agents[_0x12766e[_0x9ed7('0x17')]]=_0x12766e;agents[_0x12766e[_0x9ed7('0x17')]][_0x9ed7('0x18')]=utils[_0x9ed7('0x19')]();agents[_0x12766e['destuniqueid']]['lastevent']=_0x9ed7('0x1a');agents[_0x12766e[_0x9ed7('0x17')]][_0x9ed7('0x1b')]=null;agents[_0x12766e[_0x9ed7('0x17')]]['connectedlinename']=null;utils[_0x9ed7('0x2')](util[_0x9ed7('0x3')](_0x9ed7('0x1c'),_0x12766e[_0x9ed7('0x5')],agents[_0x12766e['destuniqueid']][_0x9ed7('0x8')],_0x12766e[_0x9ed7('0x17')]));}catch(_0x32b29e){utils['error'](util[_0x9ed7('0x3')](_0x9ed7('0x16'),_0x12766e[_0x9ed7('0x5')]),_0x32b29e);}};exports[_0x9ed7('0x1d')]=function(_0x9e42d6){try{if(!_[_0x9ed7('0x1e')](agents[_0x9e42d6[_0x9ed7('0x17')]])){utils['debug'](util[_0x9ed7('0x3')]('[%s][agents][agentringnoanswer]',_0x9e42d6[_0x9ed7('0x5')]),_0x9e42d6);utils[_0x9ed7('0x2')](util[_0x9ed7('0x3')](_0x9ed7('0x1f'),_0x9e42d6[_0x9ed7('0x5')],agents[_0x9e42d6[_0x9ed7('0x17')]][_0x9ed7('0x8')],_0x9e42d6[_0x9ed7('0x17')]));agents[_0x9e42d6[_0x9ed7('0x17')]][_0x9ed7('0x1d')]=!![];agents[_0x9e42d6[_0x9ed7('0x17')]]['agentringnoanswerAt']=utils[_0x9ed7('0x19')]();agents[_0x9e42d6[_0x9ed7('0x17')]][_0x9ed7('0xb')]=_0x9ed7('0x20');agents[_0x9e42d6[_0x9ed7('0x17')]][_0x9ed7('0x21')]='timeout';agents[_0x9e42d6[_0x9ed7('0x17')]]['holdtime']=_0x9e42d6[_0x9ed7('0x22')]?parseInt(_0x9e42d6[_0x9ed7('0x22')])/0x3e8:0x0;agents[_0x9e42d6[_0x9ed7('0x17')]][_0x9ed7('0x23')]=0x0;unanswered[_0x9ed7('0x24')](_0x9e42d6[_0x9ed7('0x17')]);}}catch(_0x2fedda){utils['error'](util[_0x9ed7('0x3')](_0x9ed7('0x25'),_0x9e42d6[_0x9ed7('0x5')]),_0x2fedda);}};exports['queuecallerabandon']=function(_0x1c738e){try{_[_0x9ed7('0x26')](agents,function(_0x6905b7,_0x368b11){if(_0x6905b7[_0x9ed7('0x5')]==_0x1c738e[_0x9ed7('0x5')]&&!_['includes'](unanswered,_0x6905b7[_0x9ed7('0x17')])){utils[_0x9ed7('0x15')](util[_0x9ed7('0x3')](_0x9ed7('0x27'),_0x1c738e[_0x9ed7('0x5')]),_0x1c738e);utils[_0x9ed7('0x2')](util[_0x9ed7('0x3')](_0x9ed7('0x28'),_0x1c738e['uniqueid'],_0x6905b7[_0x9ed7('0x8')],_0x6905b7['destuniqueid']));_0x6905b7[_0x9ed7('0x1d')]=!![];_0x6905b7[_0x9ed7('0x29')]=utils[_0x9ed7('0x19')]();_0x6905b7[_0x9ed7('0xb')]=_0x9ed7('0x2a');_0x6905b7[_0x9ed7('0x21')]=_0x9ed7('0x2a');_0x6905b7[_0x9ed7('0x2b')]=_0x1c738e[_0x9ed7('0x2b')];_0x6905b7[_0x9ed7('0x23')]=0x0;writeDB(_0x6905b7);}});}catch(_0x26a7b3){utils[_0x9ed7('0x2c')](util[_0x9ed7('0x3')](_0x9ed7('0x27'),_0x1c738e[_0x9ed7('0x5')]),_0x26a7b3);}};exports[_0x9ed7('0x2d')]=function(_0x3c28ae){try{if(agents[_0x3c28ae['destuniqueid']]){utils['debug'](util[_0x9ed7('0x3')](_0x9ed7('0x2e'),_0x3c28ae[_0x9ed7('0x5')]),_0x3c28ae);utils[_0x9ed7('0x2')](util['format'](_0x9ed7('0x2f'),_0x3c28ae[_0x9ed7('0x5')],agents[_0x3c28ae[_0x9ed7('0x17')]][_0x9ed7('0x8')],_0x3c28ae[_0x9ed7('0x17')]));agents[_0x3c28ae[_0x9ed7('0x17')]][_0x9ed7('0x30')]=utils[_0x9ed7('0x19')]();agents[_0x3c28ae[_0x9ed7('0x17')]][_0x9ed7('0x1b')]=_0x3c28ae[_0x9ed7('0x1b')];agents[_0x3c28ae['destuniqueid']]['connectedlinename']=_0x3c28ae['connectedlinename'];agents[_0x3c28ae[_0x9ed7('0x17')]][_0x9ed7('0x2b')]=_0x3c28ae[_0x9ed7('0x22')];agents[_0x3c28ae['destuniqueid']][_0x9ed7('0xb')]=_0x9ed7('0x31');_[_0x9ed7('0x26')](agents,function(_0x5d1497,_0x32dae1){if(_0x5d1497['destuniqueid']!=_0x3c28ae[_0x9ed7('0x17')]&&_0x5d1497['uniqueid']==_0x3c28ae['uniqueid']){_0x5d1497[_0x9ed7('0x23')]=0x0;_0x5d1497[_0x9ed7('0x2b')]=_0x3c28ae[_0x9ed7('0x22')];_0x5d1497[_0x9ed7('0x1d')]=!![];_0x5d1497[_0x9ed7('0x29')]=utils[_0x9ed7('0x19')]();_0x5d1497[_0x9ed7('0xb')]=_0x9ed7('0x32');_0x5d1497[_0x9ed7('0x21')]=_0x9ed7('0x32');_0x5d1497[_0x9ed7('0x33')]=_0x3c28ae[_0x9ed7('0x17')];_0x5d1497[_0x9ed7('0x34')]=_0x3c28ae[_0x9ed7('0x8')];writeDB(_0x5d1497);}});}}catch(_0x4ec4ae){utils[_0x9ed7('0x2c')](util[_0x9ed7('0x3')]('[%s][agents][agentconnect]',_0x3c28ae['uniqueid']),_0x4ec4ae);}};exports['agentcomplete']=function(_0x80b18c){try{if(!_[_0x9ed7('0x1e')](agents[_0x80b18c['destuniqueid']])){utils[_0x9ed7('0x15')](util[_0x9ed7('0x3')](_0x9ed7('0x35'),_0x80b18c[_0x9ed7('0x5')]),_0x80b18c);utils[_0x9ed7('0x2')](util[_0x9ed7('0x3')](_0x9ed7('0x36'),_0x80b18c[_0x9ed7('0x5')],agents[_0x80b18c[_0x9ed7('0x17')]][_0x9ed7('0x8')],_0x80b18c[_0x9ed7('0x17')]));agents[_0x80b18c['destuniqueid']][_0x9ed7('0x37')]=!![];agents[_0x80b18c[_0x9ed7('0x17')]][_0x9ed7('0x38')]=utils['now']();agents[_0x80b18c['destuniqueid']][_0x9ed7('0x23')]=utils['diffTime'](agents[_0x80b18c['destuniqueid']][_0x9ed7('0x38')],agents[_0x80b18c['destuniqueid']]['agentconnectAt']);agents[_0x80b18c['destuniqueid']]['reason']=_0x80b18c[_0x9ed7('0x21')];agents[_0x80b18c[_0x9ed7('0x17')]][_0x9ed7('0xb')]=_0x9ed7('0x39');writeDB(agents[_0x80b18c[_0x9ed7('0x17')]]);}}catch(_0x5c25ca){utils[_0x9ed7('0x2c')](util[_0x9ed7('0x3')](_0x9ed7('0x35'),_0x80b18c[_0x9ed7('0x5')]),_0x5c25ca);}};exports[_0x9ed7('0x3a')]=function(_0xb1a569){try{if(!_[_0x9ed7('0x1e')](agents[_0xb1a569[_0x9ed7('0x3b')]])){utils[_0x9ed7('0x15')](util['format']('[%s][agents][blindtransfer]',_0xb1a569[_0x9ed7('0x5')]),_0xb1a569);utils['info'](util[_0x9ed7('0x3')](_0x9ed7('0x3c'),_0xb1a569[_0x9ed7('0x5')],agents[_0xb1a569[_0x9ed7('0x3b')]]['membername'],agents[_0xb1a569[_0x9ed7('0x3b')]][_0x9ed7('0x5')]));agents[_0xb1a569[_0x9ed7('0x3b')]]['transfer']=!![];agents[_0xb1a569[_0x9ed7('0x3b')]][_0x9ed7('0x3d')]='blind';agents[_0xb1a569['transfereruniqueid']][_0x9ed7('0x3e')]=_0xb1a569['extension'];agents[_0xb1a569[_0x9ed7('0x3b')]][_0x9ed7('0x3f')]=agents[_0xb1a569['transfereruniqueid']][_0x9ed7('0x5')];}}catch(_0x581a72){utils[_0x9ed7('0x2c')](util[_0x9ed7('0x3')](_0x9ed7('0x40'),_0xb1a569[_0x9ed7('0x5')]),_0x581a72);}};exports[_0x9ed7('0x41')]=function(_0x10140a){try{utils[_0x9ed7('0x15')](util[_0x9ed7('0x3')](_0x9ed7('0x42'),_0x10140a['origtransfereruniqueid']),_0x10140a);if(_0x10140a[_0x9ed7('0x43')]==_0x10140a[_0x9ed7('0x44')]){if(!_[_0x9ed7('0x1e')](agents[_0x10140a[_0x9ed7('0x45')]])){utils[_0x9ed7('0x2')](util[_0x9ed7('0x3')](_0x9ed7('0x46'),_0x10140a[_0x9ed7('0x43')],agents[_0x10140a[_0x9ed7('0x45')]]['membername']));agents[_0x10140a['secondtransfereruniqueid']][_0x9ed7('0x47')]=!![];agents[_0x10140a[_0x9ed7('0x45')]][_0x9ed7('0x3d')]='ATTENDED';agents[_0x10140a[_0x9ed7('0x45')]][_0x9ed7('0x3e')]=_0x10140a[_0x9ed7('0x48')];agents[_0x10140a[_0x9ed7('0x45')]][_0x9ed7('0x3f')]=_0x10140a['origtransfereruniqueid'];}if(_0x10140a[_0x9ed7('0x49')]&&agents[_0x10140a[_0x9ed7('0x49')]]){agents[_0x10140a[_0x9ed7('0x49')]][_0x9ed7('0x4a')]=0x1;transfers[_0x10140a['transfereeuniqueid']]=_['clone'](agents[_0x10140a['transfereeuniqueid']]);transfers[_0x10140a[_0x9ed7('0x49')]]['calleridnum']=agents[_0x10140a['secondtransfereruniqueid']]['calleridnum'];transfers[_0x10140a[_0x9ed7('0x49')]][_0x9ed7('0x4b')]=agents[_0x10140a[_0x9ed7('0x45')]][_0x9ed7('0x4b')];transfers[_0x10140a[_0x9ed7('0x49')]][_0x9ed7('0x18')]=utils[_0x9ed7('0x19')]();transfers[_0x10140a[_0x9ed7('0x49')]][_0x9ed7('0x30')]=utils[_0x9ed7('0x19')]();transfers[_0x10140a[_0x9ed7('0x49')]][_0x9ed7('0x2b')]=0x0;transfers[_0x10140a['transfereeuniqueid']][_0x9ed7('0x4a')]=0x2;}}else if(_0x10140a['secondtransfereruniqueid']==_0x10140a[_0x9ed7('0x4c')]){if(!_[_0x9ed7('0x1e')](agents[_0x10140a[_0x9ed7('0x43')]])){utils[_0x9ed7('0x2')](util[_0x9ed7('0x3')](_0x9ed7('0x46'),_0x10140a[_0x9ed7('0x43')],agents[_0x10140a['origtransfereruniqueid']]['membername']));agents[_0x10140a[_0x9ed7('0x43')]][_0x9ed7('0x47')]=!![];agents[_0x10140a[_0x9ed7('0x43')]][_0x9ed7('0x3d')]=_0x9ed7('0x4d');agents[_0x10140a[_0x9ed7('0x43')]][_0x9ed7('0x3e')]=_0x10140a[_0x9ed7('0x4e')];agents[_0x10140a[_0x9ed7('0x43')]][_0x9ed7('0x3f')]=_0x10140a[_0x9ed7('0x45')];}if(_0x10140a[_0x9ed7('0x4f')]&&agents[_0x10140a[_0x9ed7('0x4f')]]){agents[_0x10140a['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x10140a['transfertargetuniqueid']]=_[_0x9ed7('0x50')](agents[_0x10140a[_0x9ed7('0x4f')]]);transfers[_0x10140a[_0x9ed7('0x4f')]][_0x9ed7('0xa')]=agents[_0x10140a[_0x9ed7('0x43')]][_0x9ed7('0xa')];transfers[_0x10140a[_0x9ed7('0x4f')]]['calleridname']=agents[_0x10140a[_0x9ed7('0x43')]]['calleridname'];transfers[_0x10140a[_0x9ed7('0x4f')]][_0x9ed7('0x18')]=utils[_0x9ed7('0x19')]();transfers[_0x10140a[_0x9ed7('0x4f')]][_0x9ed7('0x30')]=utils[_0x9ed7('0x19')]();transfers[_0x10140a['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x10140a['transfertargetuniqueid']][_0x9ed7('0x4a')]=0x2;}}}catch(_0x5e9261){utils['error'](util[_0x9ed7('0x3')](_0x9ed7('0x42'),_0x10140a[_0x9ed7('0x43')]),_0x5e9261);}};exports[_0x9ed7('0x51')]=function(_0x1bc727){try{utils[_0x9ed7('0x15')](util[_0x9ed7('0x3')](_0x9ed7('0x52'),_0x1bc727[_0x9ed7('0x5')]),_0x1bc727);if(agents[_0x1bc727[_0x9ed7('0x5')]]&&agents[_0x1bc727[_0x9ed7('0x5')]]['reason']===_0x9ed7('0x20')){if(_0x1bc727[_0x9ed7('0x53')]==='21'){agents[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0x21')]=_0x9ed7('0x54');agents[_0x1bc727[_0x9ed7('0x5')]]['lastevent']=_0x9ed7('0x54');}utils[_0x9ed7('0x2')](util[_0x9ed7('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1bc727[_0x9ed7('0x5')],agents[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0x8')],agents[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0x21')],agents[_0x1bc727['uniqueid']]['lastevent']));writeDB(agents[_0x1bc727[_0x9ed7('0x5')]]);var _0x43b90a=unanswered[_0x9ed7('0x55')](_0x1bc727['uniqueid']);if(_0x43b90a>-0x1){unanswered[_0x9ed7('0x56')](_0x43b90a,0x1);}}if(transfers[_0x1bc727[_0x9ed7('0x5')]]){transfers[_0x1bc727[_0x9ed7('0x5')]]['agentcomplete']=!![];transfers[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0x38')]=utils[_0x9ed7('0x19')]();transfers[_0x1bc727['uniqueid']][_0x9ed7('0x23')]=utils[_0x9ed7('0x57')](transfers[_0x1bc727[_0x9ed7('0x5')]]['agentcompleteAt'],transfers[_0x1bc727['uniqueid']][_0x9ed7('0x30')]);transfers[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0x21')]=_0x9ed7('0x58');transfers[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0xb')]=_0x9ed7('0x39');utils[_0x9ed7('0x2')](util[_0x9ed7('0x3')](_0x9ed7('0x59'),_0x1bc727[_0x9ed7('0x5')],transfers[_0x1bc727[_0x9ed7('0x5')]]['membername'],transfers[_0x1bc727[_0x9ed7('0x5')]]['reason'],transfers[_0x1bc727['uniqueid']]['lastevent']));writeDB(transfers[_0x1bc727[_0x9ed7('0x5')]],!![]);}if(agents[_0x1bc727[_0x9ed7('0x5')]]&&agents[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0x30')]){agents[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0x37')]=!![];agents[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0x38')]=utils[_0x9ed7('0x19')]();agents[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0x23')]=utils['diffTime'](agents[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0x38')],agents[_0x1bc727['uniqueid']][_0x9ed7('0x30')]);agents[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0x21')]=agents[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0x47')]?'transfer':'agent';agents[_0x1bc727['uniqueid']][_0x9ed7('0xb')]=_0x9ed7('0x39');utils[_0x9ed7('0x2')](util['format'](_0x9ed7('0x59'),_0x1bc727[_0x9ed7('0x5')],agents[_0x1bc727['uniqueid']]['membername'],agents[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0x21')],agents[_0x1bc727[_0x9ed7('0x5')]][_0x9ed7('0xb')]));writeDB(agents[_0x1bc727[_0x9ed7('0x5')]]);}}catch(_0x4e0175){utils[_0x9ed7('0x2c')](util['format']('[%s][agents][hangup]',_0x1bc727[_0x9ed7('0x5')]),_0x4e0175);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 3480283..ec94a0c 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 _0x8d26=['xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','outboundrouteid','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','split','lastIndexOf','includes','noop','execif','gotoif','lastdata','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','CreateVoiceCallReport','request','debug','[%s][calls][newchannel]','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','answertime','toNumber','error','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','_attended','origtransfererchannel','destinationchannel','userfield','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstop]','mohtime','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid-preview','xmd-callerid','xmd-queue'];(function(_0x3315ff,_0x321860){var _0xec5af2=function(_0x5b1a6d){while(--_0x5b1a6d){_0x3315ff['push'](_0x3315ff['shift']());}};_0xec5af2(++_0x321860);}(_0x8d26,0x147));var _0x68d2=function(_0x2703cf,_0x526b31){_0x2703cf=_0x2703cf-0x0;var _0x28f18a=_0x8d26[_0x2703cf];return _0x28f18a;};'use strict';var _=require(_0x68d2('0x0'));var util=require(_0x68d2('0x1'));var utils=require(_0x68d2('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x68d2('0x3'),_0x68d2('0x4'),_0x68d2('0x4'),_0x68d2('0x3'),_0x68d2('0x3'),'NO\x20ANSWER',_0x68d2('0x5'),_0x68d2('0x6'),_0x68d2('0x4'),_0x68d2('0x4'),'FAILED'];var channels={};function writeDB(_0x23573e){var _0x731c8b;if(transfers[_0x68d2('0x7')][_0x23573e[_0x68d2('0x8')]]){_0x731c8b=_0x23573e['uniqueid'];_0x23573e[_0x68d2('0x8')]=transfers[_0x68d2('0x7')][_0x23573e[_0x68d2('0x8')]][_0x68d2('0x9')];}utils[_0x68d2('0xa')](util[_0x68d2('0xb')](_0x68d2('0xc'),_0x23573e[_0x68d2('0x8')],_0x23573e[_0x68d2('0xd')],_0x23573e[_0x68d2('0xe')],_0x23573e[_0x68d2('0xf')],_0x23573e[_0x68d2('0x10')],_0x23573e[_0x68d2('0x11')],_0x23573e[_0x68d2('0x12')],_0x23573e[_0x68d2('0x13')]));if(_0x23573e[_0x68d2('0x14')]){utils[_0x68d2('0x15')](_0x23573e[_0x68d2('0x14')])[_0x68d2('0x16')](function(_0x4ecdfd){if(_0x4ecdfd){_0x23573e['UserId']=_0x4ecdfd['id'];}utils['request'](_0x68d2('0x17'),_0x23573e);});}else{utils[_0x68d2('0x18')](_0x68d2('0x17'),_0x23573e);}if(channels[_0x23573e[_0x68d2('0x8')]]){delete channels[_0x23573e[_0x68d2('0x8')]];}else if(_0x731c8b&&channels[_0x731c8b]){delete transfers[_0x68d2('0x7')][_0x731c8b];delete channels[_0x731c8b];}}exports['newchannel']=function(_0x5cb255){try{utils[_0x68d2('0x19')](util['format'](_0x68d2('0x1a'),_0x5cb255[_0x68d2('0x8')]),_0x5cb255);if(_0x5cb255[_0x68d2('0x8')]==_0x5cb255['linkedid']&&_0x5cb255[_0x68d2('0xd')]!='OutgoingSpoolFailed'){utils[_0x68d2('0xa')](util[_0x68d2('0xb')](_0x68d2('0x1b'),_0x5cb255['uniqueid'],_0x5cb255[_0x68d2('0x1c')],_0x5cb255[_0x68d2('0x1d')]));channels[_0x5cb255['uniqueid']]={'uniqueid':_0x5cb255[_0x68d2('0x8')],'accountcode':_0x5cb255[_0x68d2('0x14')],'source':_0x5cb255[_0x68d2('0x11')],'destination':_0x5cb255[_0x68d2('0x1d')],'destinationcontext':_0x5cb255[_0x68d2('0x1c')],'channel':_0x5cb255[_0x68d2('0xd')],'starttime':utils[_0x68d2('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x68d2('0x3'),'amaflags':_0x68d2('0x1f')};}}catch(_0x4148bc){utils['error'](util[_0x68d2('0xb')](_0x68d2('0x1a'),_0x5cb255[_0x68d2('0x8')]),_0x4148bc);}};exports[_0x68d2('0x20')]=function(_0x2ab09f){try{utils[_0x68d2('0x19')](util[_0x68d2('0xb')]('[%s][calls][newstate]',_0x2ab09f['uniqueid']),_0x2ab09f);if(!_[_0x68d2('0x21')](channels[_0x2ab09f[_0x68d2('0x8')]])&&_0x2ab09f[_0x68d2('0x22')]==0x6){utils[_0x68d2('0xa')](util['format'](_0x68d2('0x23'),_0x2ab09f[_0x68d2('0x8')],_0x2ab09f[_0x68d2('0x1c')],_0x2ab09f[_0x68d2('0xd')]));if(_[_0x68d2('0x21')](channels[_0x2ab09f[_0x68d2('0x8')]][_0x68d2('0x24')])){channels[_0x2ab09f[_0x68d2('0x8')]][_0x68d2('0x24')]=utils['now']();}}else if(!_[_0x68d2('0x21')](channels[_0x2ab09f[_0x68d2('0x25')]])&&_0x2ab09f[_0x68d2('0x22')]==0x6&&_0x2ab09f[_0x68d2('0x1c')]!='transfer'){utils[_0x68d2('0xa')](util[_0x68d2('0xb')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2ab09f[_0x68d2('0x8')],_0x2ab09f[_0x68d2('0x25')],_0x2ab09f[_0x68d2('0x1c')],_0x2ab09f['channel']));channels[_0x2ab09f['linkedid']][_0x68d2('0x14')]=_0x2ab09f[_0x68d2('0x14')];channels[_0x2ab09f[_0x68d2('0x25')]]['destinationchannel']=_0x2ab09f['channel'];if(_['isNil'](channels[_0x2ab09f['linkedid']][_0x68d2('0x26')])){channels[_0x2ab09f[_0x68d2('0x25')]]['answertime']=utils['now']();}channels[_0x2ab09f[_0x68d2('0x25')]]['disposition']=dispositions[_[_0x68d2('0x27')](_0x2ab09f[_0x68d2('0x22')])]||_0x68d2('0x5');}}catch(_0x298473){utils[_0x68d2('0x28')](util[_0x68d2('0xb')]('[%s][calls][newstate]',_0x2ab09f['uniqueid']),_0x298473);}};exports[_0x68d2('0x29')]=function(_0x2e67f5){try{if(!_[_0x68d2('0x21')](channels[_0x2e67f5[_0x68d2('0x8')]])){utils[_0x68d2('0x19')](util['format'](_0x68d2('0x2a'),_0x2e67f5[_0x68d2('0x8')]),_0x2e67f5);if(_[_0x68d2('0x21')](channels[_0x2e67f5[_0x68d2('0x8')]][_0x68d2('0x2b')])){channels[_0x2e67f5[_0x68d2('0x8')]]['callerid']=_0x2e67f5[_0x68d2('0x2c')]+'\x20<'+_0x2e67f5[_0x68d2('0x11')]+'>';}utils['info'](util[_0x68d2('0xb')](_0x68d2('0x2d'),_0x2e67f5[_0x68d2('0x8')],channels[_0x2e67f5[_0x68d2('0x8')]][_0x68d2('0x2b')],_0x2e67f5[_0x68d2('0x2e')]));channels[_0x2e67f5[_0x68d2('0x8')]]['endtime']=utils['now']();channels[_0x2e67f5['uniqueid']][_0x68d2('0x2f')]=utils[_0x68d2('0x30')](channels[_0x2e67f5[_0x68d2('0x8')]][_0x68d2('0x31')],channels[_0x2e67f5[_0x68d2('0x8')]][_0x68d2('0x32')]);channels[_0x2e67f5['uniqueid']][_0x68d2('0x33')]=channels[_0x2e67f5[_0x68d2('0x8')]][_0x68d2('0x26')]?utils[_0x68d2('0x30')](channels[_0x2e67f5[_0x68d2('0x8')]][_0x68d2('0x31')],channels[_0x2e67f5[_0x68d2('0x8')]][_0x68d2('0x26')]):0x0;writeDB(channels[_0x2e67f5[_0x68d2('0x8')]]);}}catch(_0x491e16){utils[_0x68d2('0x28')](util['format']('[%s][calls][hangup]',_0x2e67f5[_0x68d2('0x8')]),_0x491e16);}};exports[_0x68d2('0x34')]=function(_0x3341a7){try{if(!_[_0x68d2('0x21')](channels[_0x3341a7['localtwolinkedid']])){utils[_0x68d2('0x19')](util['format'](_0x68d2('0x35'),_0x3341a7[_0x68d2('0x36')]),_0x3341a7);if(channels[_0x3341a7['localtwolinkedid']][_0x68d2('0xd')]==_0x3341a7[_0x68d2('0x37')]){utils[_0x68d2('0xa')](util[_0x68d2('0xb')](_0x68d2('0x38'),_0x3341a7['origtransfereruniqueid'],_0x3341a7[_0x68d2('0x39')],_0x3341a7[_0x68d2('0x3a')]));channels[_0x3341a7['localtwolinkedid']]['destinationchannel']=_0x3341a7['secondtransfererchannel'];channels[_0x3341a7['localtwolinkedid']]['userfield']=_0x68d2('0x3b');}else if(channels[_0x3341a7[_0x68d2('0x39')]][_0x68d2('0xd')]=_0x3341a7['transfertargetchannel']){utils['info'](util[_0x68d2('0xb')](_0x68d2('0x38'),_0x3341a7['origtransfereruniqueid'],_0x3341a7['localtwolinkedid'],_0x3341a7[_0x68d2('0x3c')]));channels[_0x3341a7[_0x68d2('0x39')]][_0x68d2('0x3d')]=_0x3341a7[_0x68d2('0x3c')];channels[_0x3341a7[_0x68d2('0x39')]][_0x68d2('0x3e')]=_0x68d2('0x3b');}}}catch(_0xe20375){utils[_0x68d2('0x28')](util[_0x68d2('0xb')]('[%s][calls][attendedtransfer]',_0x3341a7[_0x68d2('0x36')]),_0xe20375);}};exports[_0x68d2('0x3f')]=function(_0x3fd5fd){try{if(!_[_0x68d2('0x21')](channels[_0x3fd5fd[_0x68d2('0x8')]])){utils[_0x68d2('0x19')](util[_0x68d2('0xb')]('[%s][calls][musiconholdstart]',_0x3fd5fd[_0x68d2('0x8')]),_0x3fd5fd);channels[_0x3fd5fd['uniqueid']][_0x68d2('0x40')]=utils['now']();utils[_0x68d2('0xa')](util[_0x68d2('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x3fd5fd[_0x68d2('0x8')],channels[_0x3fd5fd[_0x68d2('0x8')]][_0x68d2('0x40')]));}}catch(_0x3bad03){utils[_0x68d2('0x28')](util['format'](_0x68d2('0x41'),_0x3fd5fd['uniqueid']),_0x3bad03);}};exports['musiconholdstop']=function(_0x4dca54){try{if(!_[_0x68d2('0x21')](channels[_0x4dca54[_0x68d2('0x8')]])){utils[_0x68d2('0x19')](util[_0x68d2('0xb')](_0x68d2('0x42'),_0x4dca54['uniqueid']),_0x4dca54);if(!_[_0x68d2('0x21')](channels[_0x4dca54['uniqueid']][_0x68d2('0x40')])){channels[_0x4dca54[_0x68d2('0x8')]][_0x68d2('0x43')]+=utils['diffTime'](utils[_0x68d2('0x1e')](),channels[_0x4dca54['uniqueid']][_0x68d2('0x40')]);utils[_0x68d2('0xa')](util[_0x68d2('0xb')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x4dca54[_0x68d2('0x8')],channels[_0x4dca54[_0x68d2('0x8')]][_0x68d2('0x43')]));delete channels[_0x4dca54['uniqueid']][_0x68d2('0x40')];}}}catch(_0x409359){utils[_0x68d2('0x28')](util['format'](_0x68d2('0x42'),_0x4dca54[_0x68d2('0x8')]),_0x409359);}};exports['varset']=function(_0x5e532d){try{if(!_[_0x68d2('0x21')](channels[_0x5e532d[_0x68d2('0x8')]])){utils[_0x68d2('0x19')](util['format']('[%s][calls][varset]',_0x5e532d['uniqueid']),_0x5e532d);if(!_[_0x68d2('0x21')](_0x5e532d[_0x68d2('0x44')][_0x68d2('0x45')])){utils[_0x68d2('0xa')](util[_0x68d2('0xb')](_0x68d2('0x46'),_0x5e532d[_0x68d2('0x8')],_0x5e532d[_0x68d2('0x47')]));channels[_0x5e532d[_0x68d2('0x8')]][_0x68d2('0x48')]=_0x5e532d[_0x68d2('0x47')];}if(!_[_0x68d2('0x21')](_0x5e532d[_0x68d2('0x44')]['xmd-phone'])){utils[_0x68d2('0xa')](util[_0x68d2('0xb')](_0x68d2('0x49'),_0x5e532d[_0x68d2('0x8')],_0x5e532d[_0x68d2('0x47')]));channels[_0x5e532d[_0x68d2('0x8')]]['destination']=_0x5e532d[_0x68d2('0x47')];channels[_0x5e532d['uniqueid']][_0x68d2('0x2b')]='\x22'+_0x5e532d[_0x68d2('0x47')]+'\x22\x20<'+_0x5e532d['value']+'>';}if(!_[_0x68d2('0x21')](_0x5e532d['variable'][_0x68d2('0x4a')])||!_['isNil'](_0x5e532d['variable'][_0x68d2('0x4b')])){utils[_0x68d2('0xa')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5e532d[_0x68d2('0x8')],!_['isNil'](_0x5e532d[_0x68d2('0x44')][_0x68d2('0x4a')])?_0x68d2('0x4a'):_0x68d2('0x4b'),_0x5e532d['value']));channels[_0x5e532d[_0x68d2('0x8')]]['callerid']=_0x5e532d['value'];}if(!_[_0x68d2('0x21')](_0x5e532d[_0x68d2('0x44')][_0x68d2('0x4c')])||!_['isNil'](_0x5e532d[_0x68d2('0x44')]['xmcs-queue'])){utils[_0x68d2('0xa')](util[_0x68d2('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5e532d[_0x68d2('0x8')],!_[_0x68d2('0x21')](_0x5e532d['variable'][_0x68d2('0x4c')])?_0x68d2('0x4c'):_0x68d2('0x4d'),_0x5e532d[_0x68d2('0x47')]));channels[_0x5e532d['uniqueid']][_0x68d2('0x4e')]=_0x68d2('0x4f');channels[_0x5e532d[_0x68d2('0x8')]]['lastdata']=_0x5e532d[_0x68d2('0x47')];channels[_0x5e532d[_0x68d2('0x8')]]['queue']=!![];}if(!_[_0x68d2('0x21')](_0x5e532d[_0x68d2('0x44')][_0x68d2('0x50')])){utils[_0x68d2('0xa')](util['format'](_0x68d2('0x51'),_0x5e532d[_0x68d2('0x8')],_0x5e532d[_0x68d2('0x47')]));channels[_0x5e532d[_0x68d2('0x8')]][_0x68d2('0x52')]=_0x5e532d['value'];}if(!_[_0x68d2('0x21')](_0x5e532d['variable'][_0x68d2('0x53')])){utils[_0x68d2('0xa')](util[_0x68d2('0xb')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x5e532d['uniqueid'],_0x5e532d[_0x68d2('0x47')]));channels[_0x5e532d[_0x68d2('0x8')]]['type']=_0x5e532d[_0x68d2('0x47')];}if(!_['isNil'](_0x5e532d[_0x68d2('0x44')][_0x68d2('0x54')])){utils[_0x68d2('0xa')](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x5e532d[_0x68d2('0x8')],_0x5e532d[_0x68d2('0x47')]));channels[_0x5e532d[_0x68d2('0x8')]]['routeid']=_0x5e532d[_0x68d2('0x47')];}if(!_['isNil'](_0x5e532d[_0x68d2('0x44')]['sipcallid'])){utils['info'](util[_0x68d2('0xb')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x5e532d[_0x68d2('0x8')],_0x5e532d[_0x68d2('0x47')]));channels[_0x5e532d['uniqueid']][_0x68d2('0x55')]=_0x5e532d[_0x68d2('0x47')];}}}catch(_0x35947e){utils[_0x68d2('0x28')](util[_0x68d2('0xb')](_0x68d2('0x56'),_0x5e532d['uniqueid']),_0x35947e);}};exports[_0x68d2('0x57')]=function(_0x103137){try{if(!_[_0x68d2('0x21')](channels[_0x103137[_0x68d2('0x8')]])){utils['debug'](util[_0x68d2('0xb')](_0x68d2('0x58'),_0x103137[_0x68d2('0x8')]),_0x103137);utils[_0x68d2('0xa')](util[_0x68d2('0xb')](_0x68d2('0x59'),_0x103137['uniqueid'],_0x103137[_0x68d2('0x5a')],_0x103137[_0x68d2('0x5b')]));if(_0x103137[_0x68d2('0x5a')][_0x68d2('0x5c')]()==_0x68d2('0x5d')&&_['startsWith'](_0x103137['appdata'][_0x68d2('0x5c')](),'cdr')){var _0x48cf5e=_0x103137[_0x68d2('0x5b')][_0x68d2('0x5e')]('=');var _0x276dce=_0x48cf5e[0x0]['substring'](_0x48cf5e[0x0][_0x68d2('0x5f')]('(')+0x1,_0x48cf5e[0x0][_0x68d2('0x5f')](')'));var _0x1964cf=_0x48cf5e[0x1];channels[_0x103137[_0x68d2('0x8')]][_0x276dce]=_0x1964cf;}if(!_[_0x68d2('0x60')]([_0x68d2('0x29'),_0x68d2('0x61'),_0x68d2('0x62'),'set',_0x68d2('0x63')],_0x103137[_0x68d2('0x5a')][_0x68d2('0x5c')]())){channels[_0x103137['uniqueid']][_0x68d2('0x4e')]=_0x103137['application'];channels[_0x103137[_0x68d2('0x8')]][_0x68d2('0x64')]=_0x103137[_0x68d2('0x5b')];}}}catch(_0x2b9c4b){utils[_0x68d2('0x28')](util[_0x68d2('0xb')](_0x68d2('0x58'),_0x103137[_0x68d2('0x8')]),_0x2b9c4b);}}; \ No newline at end of file +var _0x18e7=['cause-txt','endtime','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','origtransfereruniqueid','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','xmd-originatecalleridnum','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','substring','lastIndexOf','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','lastevent','getUserByInternal','then','UserId','request','CreateVoiceCallReport','debug','OutgoingSpoolFailed','context','accountcode','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','ANSWERED','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s'];(function(_0x1354ea,_0x24c484){var _0x505693=function(_0xf0fa67){while(--_0xf0fa67){_0x1354ea['push'](_0x1354ea['shift']());}};_0x505693(++_0x24c484);}(_0x18e7,0x1ef));var _0x718e=function(_0x1c6006,_0x42b6c9){_0x1c6006=_0x1c6006-0x0;var _0x223659=_0x18e7[_0x1c6006];return _0x223659;};'use strict';var _=require(_0x718e('0x0'));var util=require(_0x718e('0x1'));var utils=require(_0x718e('0x2'));var transfers=require(_0x718e('0x3'));var dispositions=['NO\x20ANSWER',_0x718e('0x4'),_0x718e('0x4'),'NO\x20ANSWER',_0x718e('0x5'),_0x718e('0x5'),'ANSWERED',_0x718e('0x6'),_0x718e('0x4'),_0x718e('0x4'),'FAILED'];var channels={};function writeDB(_0x29b6c6){var _0x274191;if(transfers[_0x718e('0x7')][_0x29b6c6[_0x718e('0x8')]]){_0x274191=_0x29b6c6[_0x718e('0x8')];_0x29b6c6[_0x718e('0x8')]=transfers['blinds'][_0x29b6c6[_0x718e('0x8')]][_0x718e('0x9')];}utils[_0x718e('0xa')](util[_0x718e('0xb')](_0x718e('0xc'),_0x29b6c6[_0x718e('0x8')],_0x29b6c6[_0x718e('0xd')],_0x29b6c6[_0x718e('0xe')],_0x29b6c6[_0x718e('0xf')],_0x29b6c6[_0x718e('0x10')],_0x29b6c6[_0x718e('0x11')],_0x29b6c6['connectedlinenum'],_0x29b6c6[_0x718e('0x12')]));if(_0x29b6c6['accountcode']){utils[_0x718e('0x13')](_0x29b6c6['accountcode'])[_0x718e('0x14')](function(_0x73e7d1){if(_0x73e7d1){_0x29b6c6[_0x718e('0x15')]=_0x73e7d1['id'];}utils[_0x718e('0x16')](_0x718e('0x17'),_0x29b6c6);});}else{utils['request'](_0x718e('0x17'),_0x29b6c6);}if(channels[_0x29b6c6[_0x718e('0x8')]]){delete channels[_0x29b6c6[_0x718e('0x8')]];}else if(_0x274191&&channels[_0x274191]){delete transfers['blinds'][_0x274191];delete channels[_0x274191];}}exports['newchannel']=function(_0x4601b9){try{utils[_0x718e('0x18')](util[_0x718e('0xb')]('[%s][calls][newchannel]',_0x4601b9[_0x718e('0x8')]),_0x4601b9);if(_0x4601b9[_0x718e('0x8')]==_0x4601b9['linkedid']&&_0x4601b9['channel']!=_0x718e('0x19')){utils[_0x718e('0xa')](util[_0x718e('0xb')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x4601b9['uniqueid'],_0x4601b9[_0x718e('0x1a')],_0x4601b9['exten']));channels[_0x4601b9['uniqueid']]={'uniqueid':_0x4601b9[_0x718e('0x8')],'accountcode':_0x4601b9[_0x718e('0x1b')],'source':_0x4601b9[_0x718e('0x11')],'destination':_0x4601b9[_0x718e('0x1c')],'destinationcontext':_0x4601b9[_0x718e('0x1a')],'channel':_0x4601b9[_0x718e('0xd')],'starttime':utils[_0x718e('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x718e('0x5'),'amaflags':_0x718e('0x1e')};}}catch(_0x3a6bb3){utils[_0x718e('0x1f')](util[_0x718e('0xb')](_0x718e('0x20'),_0x4601b9[_0x718e('0x8')]),_0x3a6bb3);}};exports[_0x718e('0x21')]=function(_0x10b5df){try{utils['debug'](util[_0x718e('0xb')](_0x718e('0x22'),_0x10b5df[_0x718e('0x8')]),_0x10b5df);if(!_[_0x718e('0x23')](channels[_0x10b5df[_0x718e('0x8')]])&&_0x10b5df[_0x718e('0x24')]==0x6){utils[_0x718e('0xa')](util[_0x718e('0xb')](_0x718e('0x25'),_0x10b5df[_0x718e('0x8')],_0x10b5df[_0x718e('0x1a')],_0x10b5df[_0x718e('0xd')]));if(_[_0x718e('0x23')](channels[_0x10b5df[_0x718e('0x8')]][_0x718e('0x26')])){channels[_0x10b5df[_0x718e('0x8')]][_0x718e('0x26')]=utils[_0x718e('0x1d')]();}}else if(!_[_0x718e('0x23')](channels[_0x10b5df[_0x718e('0x27')]])&&_0x10b5df[_0x718e('0x24')]==0x6&&_0x10b5df['context']!=_0x718e('0x28')){utils[_0x718e('0xa')](util[_0x718e('0xb')](_0x718e('0x29'),_0x10b5df['uniqueid'],_0x10b5df['linkedid'],_0x10b5df['context'],_0x10b5df[_0x718e('0xd')]));channels[_0x10b5df[_0x718e('0x27')]][_0x718e('0x1b')]=_0x10b5df[_0x718e('0x1b')];channels[_0x10b5df['linkedid']][_0x718e('0x2a')]=_0x10b5df[_0x718e('0xd')];if(_[_0x718e('0x23')](channels[_0x10b5df['linkedid']][_0x718e('0x2b')])){channels[_0x10b5df['linkedid']][_0x718e('0x2b')]=utils[_0x718e('0x1d')]();}channels[_0x10b5df[_0x718e('0x27')]]['disposition']=dispositions[_['toNumber'](_0x10b5df[_0x718e('0x24')])]||_0x718e('0x2c');}}catch(_0x16d0e6){utils[_0x718e('0x1f')](util[_0x718e('0xb')](_0x718e('0x22'),_0x10b5df[_0x718e('0x8')]),_0x16d0e6);}};exports[_0x718e('0x2d')]=function(_0x2fe802){try{if(!_[_0x718e('0x23')](channels[_0x2fe802[_0x718e('0x8')]])){utils[_0x718e('0x18')](util[_0x718e('0xb')](_0x718e('0x2e'),_0x2fe802['uniqueid']),_0x2fe802);if(_[_0x718e('0x23')](channels[_0x2fe802[_0x718e('0x8')]][_0x718e('0x2f')])){channels[_0x2fe802[_0x718e('0x8')]][_0x718e('0x2f')]=_0x2fe802[_0x718e('0x30')]+'\x20<'+_0x2fe802[_0x718e('0x11')]+'>';}utils[_0x718e('0xa')](util[_0x718e('0xb')](_0x718e('0x31'),_0x2fe802['uniqueid'],channels[_0x2fe802[_0x718e('0x8')]]['callerid'],_0x2fe802[_0x718e('0x32')]));channels[_0x2fe802['uniqueid']][_0x718e('0x33')]=utils[_0x718e('0x1d')]();channels[_0x2fe802['uniqueid']]['duration']=utils['diffTime'](channels[_0x2fe802[_0x718e('0x8')]][_0x718e('0x33')],channels[_0x2fe802[_0x718e('0x8')]][_0x718e('0x34')]);channels[_0x2fe802[_0x718e('0x8')]][_0x718e('0x35')]=channels[_0x2fe802[_0x718e('0x8')]][_0x718e('0x2b')]?utils[_0x718e('0x36')](channels[_0x2fe802[_0x718e('0x8')]][_0x718e('0x33')],channels[_0x2fe802[_0x718e('0x8')]][_0x718e('0x2b')]):0x0;writeDB(channels[_0x2fe802[_0x718e('0x8')]]);}}catch(_0x2340a0){utils[_0x718e('0x1f')](util[_0x718e('0xb')](_0x718e('0x2e'),_0x2fe802[_0x718e('0x8')]),_0x2340a0);}};exports[_0x718e('0x37')]=function(_0x471097){try{if(!_[_0x718e('0x23')](channels[_0x471097['localtwolinkedid']])){utils['debug'](util[_0x718e('0xb')]('[%s][calls][attendedtransfer]',_0x471097['origtransfereruniqueid']),_0x471097);if(channels[_0x471097[_0x718e('0x38')]][_0x718e('0xd')]==_0x471097[_0x718e('0x39')]){utils['info'](util[_0x718e('0xb')](_0x718e('0x3a'),_0x471097['origtransfereruniqueid'],_0x471097[_0x718e('0x38')],_0x471097[_0x718e('0x3b')]));channels[_0x471097['localtwolinkedid']][_0x718e('0x2a')]=_0x471097['secondtransfererchannel'];channels[_0x471097[_0x718e('0x38')]][_0x718e('0x3c')]=_0x718e('0x3d');}else if(channels[_0x471097['localtwolinkedid']][_0x718e('0xd')]=_0x471097['transfertargetchannel']){utils[_0x718e('0xa')](util[_0x718e('0xb')](_0x718e('0x3a'),_0x471097[_0x718e('0x3e')],_0x471097[_0x718e('0x38')],_0x471097[_0x718e('0x3f')]));channels[_0x471097['localtwolinkedid']][_0x718e('0x2a')]=_0x471097['origtransfererchannel'];channels[_0x471097[_0x718e('0x38')]][_0x718e('0x3c')]=_0x718e('0x3d');}}}catch(_0x1c1e31){utils[_0x718e('0x1f')](util[_0x718e('0xb')](_0x718e('0x40'),_0x471097['origtransfereruniqueid']),_0x1c1e31);}};exports[_0x718e('0x41')]=function(_0x3a51fe){try{if(!_[_0x718e('0x23')](channels[_0x3a51fe['uniqueid']])){utils['debug'](util[_0x718e('0xb')](_0x718e('0x42'),_0x3a51fe['uniqueid']),_0x3a51fe);channels[_0x3a51fe[_0x718e('0x8')]]['musiconholdstartAt']=utils[_0x718e('0x1d')]();utils['info'](util[_0x718e('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x3a51fe[_0x718e('0x8')],channels[_0x3a51fe['uniqueid']][_0x718e('0x43')]));}}catch(_0x527b9f){utils[_0x718e('0x1f')](util[_0x718e('0xb')]('[%s][calls][musiconholdstart]',_0x3a51fe[_0x718e('0x8')]),_0x527b9f);}};exports['musiconholdstop']=function(_0x292d2c){try{if(!_[_0x718e('0x23')](channels[_0x292d2c[_0x718e('0x8')]])){utils[_0x718e('0x18')](util[_0x718e('0xb')]('[%s][calls][musiconholdstop]',_0x292d2c[_0x718e('0x8')]),_0x292d2c);if(!_[_0x718e('0x23')](channels[_0x292d2c[_0x718e('0x8')]][_0x718e('0x43')])){channels[_0x292d2c['uniqueid']][_0x718e('0x44')]+=utils['diffTime'](utils['now'](),channels[_0x292d2c[_0x718e('0x8')]][_0x718e('0x43')]);utils[_0x718e('0xa')](util[_0x718e('0xb')](_0x718e('0x45'),_0x292d2c[_0x718e('0x8')],channels[_0x292d2c['uniqueid']][_0x718e('0x44')]));delete channels[_0x292d2c[_0x718e('0x8')]][_0x718e('0x43')];}}}catch(_0x54fd65){utils[_0x718e('0x1f')](util[_0x718e('0xb')](_0x718e('0x46'),_0x292d2c[_0x718e('0x8')]),_0x54fd65);}};exports[_0x718e('0x47')]=function(_0x375c1f){try{if(!_['isNil'](channels[_0x375c1f[_0x718e('0x8')]])){utils[_0x718e('0x18')](util[_0x718e('0xb')](_0x718e('0x48'),_0x375c1f[_0x718e('0x8')]),_0x375c1f);if(!_[_0x718e('0x23')](_0x375c1f['variable'][_0x718e('0x49')])){utils[_0x718e('0xa')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x375c1f[_0x718e('0x8')],_0x375c1f[_0x718e('0x4a')]));channels[_0x375c1f[_0x718e('0x8')]][_0x718e('0x4b')]=_0x375c1f[_0x718e('0x4a')];}if(!_[_0x718e('0x23')](_0x375c1f[_0x718e('0x4c')][_0x718e('0x4d')])){utils[_0x718e('0xa')](util['format'](_0x718e('0x4e'),_0x375c1f['uniqueid'],_0x375c1f[_0x718e('0x4a')]));channels[_0x375c1f[_0x718e('0x8')]][_0x718e('0x4f')]=_0x375c1f[_0x718e('0x4a')];channels[_0x375c1f[_0x718e('0x8')]]['callerid']='\x22'+_0x375c1f[_0x718e('0x4a')]+_0x718e('0x50')+_0x375c1f[_0x718e('0x4a')]+'>';}if(!_[_0x718e('0x23')](_0x375c1f[_0x718e('0x4c')][_0x718e('0x51')])||!_['isNil'](_0x375c1f[_0x718e('0x4c')][_0x718e('0x52')])){utils[_0x718e('0xa')](util[_0x718e('0xb')](_0x718e('0x53'),_0x375c1f['uniqueid'],!_['isNil'](_0x375c1f[_0x718e('0x4c')]['xmd-callerid-preview'])?'xmd-callerid-preview':_0x718e('0x52'),_0x375c1f[_0x718e('0x4a')]));channels[_0x375c1f[_0x718e('0x8')]][_0x718e('0x2f')]=_0x375c1f['value'];}if(!_[_0x718e('0x23')](_0x375c1f[_0x718e('0x4c')][_0x718e('0x54')])||!_[_0x718e('0x23')](_0x375c1f[_0x718e('0x4c')]['xmcs-queue'])){utils[_0x718e('0xa')](util[_0x718e('0xb')](_0x718e('0x53'),_0x375c1f['uniqueid'],!_[_0x718e('0x23')](_0x375c1f[_0x718e('0x4c')][_0x718e('0x54')])?_0x718e('0x54'):_0x718e('0x55'),_0x375c1f[_0x718e('0x4a')]));channels[_0x375c1f[_0x718e('0x8')]][_0x718e('0x56')]=_0x718e('0x57');channels[_0x375c1f['uniqueid']][_0x718e('0x58')]=_0x375c1f['value'];channels[_0x375c1f[_0x718e('0x8')]]['queue']=!![];}if(!_['isNil'](_0x375c1f[_0x718e('0x4c')][_0x718e('0x59')])){utils[_0x718e('0xa')](util[_0x718e('0xb')](_0x718e('0x5a'),_0x375c1f[_0x718e('0x8')],_0x375c1f[_0x718e('0x4a')]));channels[_0x375c1f[_0x718e('0x8')]]['ContactId']=_0x375c1f[_0x718e('0x4a')];}if(!_[_0x718e('0x23')](_0x375c1f[_0x718e('0x4c')]['xmd-cdrtype'])){utils['info'](util[_0x718e('0xb')](_0x718e('0x5b'),_0x375c1f[_0x718e('0x8')],_0x375c1f[_0x718e('0x4a')]));channels[_0x375c1f['uniqueid']][_0x718e('0x5c')]=_0x375c1f[_0x718e('0x4a')];}if(!_['isNil'](_0x375c1f['variable']['outboundrouteid'])){utils[_0x718e('0xa')](util[_0x718e('0xb')](_0x718e('0x5d'),_0x375c1f[_0x718e('0x8')],_0x375c1f[_0x718e('0x4a')]));channels[_0x375c1f[_0x718e('0x8')]][_0x718e('0x5e')]=_0x375c1f[_0x718e('0x4a')];}if(!_['isNil'](_0x375c1f[_0x718e('0x4c')][_0x718e('0x5f')])){utils[_0x718e('0xa')](util['format'](_0x718e('0x60'),_0x375c1f[_0x718e('0x8')],_0x375c1f[_0x718e('0x4a')]));channels[_0x375c1f[_0x718e('0x8')]]['sipcallid']=_0x375c1f['value'];}}}catch(_0x3d7c5e){utils[_0x718e('0x1f')](util[_0x718e('0xb')]('[%s][calls][varset]',_0x375c1f[_0x718e('0x8')]),_0x3d7c5e);}};exports['newexten']=function(_0x140dab){try{if(!_[_0x718e('0x23')](channels[_0x140dab[_0x718e('0x8')]])){utils[_0x718e('0x18')](util[_0x718e('0xb')](_0x718e('0x61'),_0x140dab[_0x718e('0x8')]),_0x140dab);utils['info'](util[_0x718e('0xb')](_0x718e('0x62'),_0x140dab['uniqueid'],_0x140dab[_0x718e('0x63')],_0x140dab[_0x718e('0x64')]));if(_0x140dab[_0x718e('0x63')][_0x718e('0x65')]()==_0x718e('0x66')&&_['startsWith'](_0x140dab[_0x718e('0x64')][_0x718e('0x65')](),_0x718e('0x67'))){var _0x480c85=_0x140dab[_0x718e('0x64')]['split']('=');var _0x46c28c=_0x480c85[0x0][_0x718e('0x68')](_0x480c85[0x0][_0x718e('0x69')]('(')+0x1,_0x480c85[0x0][_0x718e('0x69')](')'));var _0x2f2380=_0x480c85[0x1];channels[_0x140dab[_0x718e('0x8')]][_0x46c28c]=_0x2f2380;}if(!_['includes']([_0x718e('0x2d'),_0x718e('0x6a'),_0x718e('0x6b'),_0x718e('0x66'),_0x718e('0x6c')],_0x140dab[_0x718e('0x63')][_0x718e('0x65')]())){channels[_0x140dab[_0x718e('0x8')]]['lastapplication']=_0x140dab[_0x718e('0x63')];channels[_0x140dab[_0x718e('0x8')]][_0x718e('0x58')]=_0x140dab[_0x718e('0x64')];}}}catch(_0x3e052d){utils['error'](util[_0x718e('0xb')](_0x718e('0x61'),_0x140dab[_0x718e('0x8')]),_0x3e052d);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index aa2728b..3190a1b 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 _0xee5e=['connect','info','[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils'];(function(_0x4fde38,_0x219ff9){var _0x46bd89=function(_0x293cf7){while(--_0x293cf7){_0x4fde38['push'](_0x4fde38['shift']());}};_0x46bd89(++_0x219ff9);}(_0xee5e,0x83));var _0xeee5=function(_0x2187d4,_0x57aabe){_0x2187d4=_0x2187d4-0x0;var _0x13e1bb=_0xee5e[_0x2187d4];return _0x13e1bb;};'use strict';var utils=require(_0xeee5('0x0'));exports[_0xeee5('0x1')]=function(){utils[_0xeee5('0x2')](_0xeee5('0x3'));};exports[_0xeee5('0x4')]=function(){utils[_0xeee5('0x2')]('[core]\x20shutdown');};exports[_0xeee5('0x5')]=function(){utils['info'](_0xeee5('0x6'));};exports[_0xeee5('0x7')]=function(_0xed765a){utils['error'](_0xeee5('0x8'),_0xed765a);};exports[_0xeee5('0x9')]=function(){utils[_0xeee5('0x2')](_0xeee5('0xa'));};exports[_0xeee5('0xb')]=function(_0xfeea00){}; \ No newline at end of file +var _0x9dcc=['[core]\x20error','[core]\x20close','managerevent','connect','info','[core]\x20connected','shutdown','fullybooted'];(function(_0x51e2cb,_0x148c10){var _0x4fc6e3=function(_0x5e257e){while(--_0x5e257e){_0x51e2cb['push'](_0x51e2cb['shift']());}};_0x4fc6e3(++_0x148c10);}(_0x9dcc,0x103));var _0xc9dc=function(_0x1348e5,_0x1e9c93){_0x1348e5=_0x1348e5-0x0;var _0x3ae8af=_0x9dcc[_0x1348e5];return _0x3ae8af;};'use strict';var utils=require('./utils');exports[_0xc9dc('0x0')]=function(){utils[_0xc9dc('0x1')](_0xc9dc('0x2'));};exports[_0xc9dc('0x3')]=function(){utils[_0xc9dc('0x1')]('[core]\x20shutdown');};exports[_0xc9dc('0x4')]=function(){utils['info']('[core]\x20fullybooted');};exports['error']=function(_0x1a8b56){utils['error'](_0xc9dc('0x5'),_0x1a8b56);};exports['close']=function(){utils[_0xc9dc('0x1')](_0xc9dc('0x6'));};exports[_0xc9dc('0x7')]=function(_0x20b0d7){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index b16958f..5b3af1e 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 _0x634b=['[%s][dials][varset]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','[%s][dials][dialend]','ANSWER','connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','calleridname','cause-txt','now','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum','connectedlinenum','dialstatus','request','uniqueid','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr(routeid)','error','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x634b,0x130));var _0xb634=function(_0x78cf63,_0x34de9e){_0x78cf63=_0x78cf63-0x0;var _0x361e27=_0x634b[_0x78cf63];return _0x361e27;};'use strict';var _=require(_0xb634('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0xd7b501){utils[_0xb634('0x1')](util[_0xb634('0x2')](_0xb634('0x3'),_0xd7b501['uniqueid'],_0xd7b501['channel'],_0xd7b501[_0xb634('0x4')],_0xd7b501[_0xb634('0x5')],_0xd7b501[_0xb634('0x6')],_0xd7b501[_0xb634('0x7')]));utils[_0xb634('0x8')]('CreateVoiceDialReport',_0xd7b501);delete dials[_0xd7b501[_0xb634('0x9')]];}exports[_0xb634('0xa')]=function(_0x2c1868){try{utils[_0xb634('0xb')](util[_0xb634('0x2')](_0xb634('0xc'),_0x2c1868[_0xb634('0x9')]),_0x2c1868);utils[_0xb634('0x1')](util[_0xb634('0x2')](_0xb634('0xd'),_0x2c1868[_0xb634('0x9')],_0x2c1868[_0xb634('0xe')],_0x2c1868[_0xb634('0xf')]));if(_0x2c1868[_0xb634('0xe')][_0xb634('0x10')]()==_0xb634('0x11')&&_['startsWith'](_0x2c1868[_0xb634('0xf')][_0xb634('0x10')](),_0xb634('0x12'))){var _0x5e46f1=_0x2c1868[_0xb634('0xf')]['split']('=');dials[_0x2c1868['uniqueid']]={'routeId':_0x5e46f1[0x1]};}}catch(_0x4712cd){utils[_0xb634('0x13')](util[_0xb634('0x2')](_0xb634('0xc'),_0x2c1868[_0xb634('0x9')]),_0x4712cd);}};exports['varset']=function(_0x3ada30){try{utils['debug'](util[_0xb634('0x2')]('[%s][dials][varset]',_0x3ada30[_0xb634('0x9')]),_0x3ada30);if(!_[_0xb634('0x14')](_0x3ada30[_0xb634('0x15')][_0xb634('0x16')])){utils['info'](util['format'](_0xb634('0x17'),_0x3ada30[_0xb634('0x9')],_0x3ada30['value']));dials[_0x3ada30[_0xb634('0x9')]]={'routeId':_0x3ada30[_0xb634('0x18')]};}}catch(_0x3385b1){utils[_0xb634('0x13')](util['format'](_0xb634('0x19'),_0x3ada30[_0xb634('0x9')]),_0x3385b1);}};exports['dialbegin']=function(_0x114615){try{if(!_[_0xb634('0x14')](dials[_0x114615['uniqueid']])){utils[_0xb634('0xb')](util['format']('[%s][dials][dialbegin]',_0x114615[_0xb634('0x9')]),_0x114615);dials[_0x114615['uniqueid']]=_[_0xb634('0x1a')](dials[_0x114615[_0xb634('0x9')]],_0x114615);dials[_0x114615['uniqueid']][_0xb634('0x1b')]=utils['now']();dials[_0x114615[_0xb634('0x9')]][_0xb634('0x1c')]=_0xb634('0x1d');utils[_0xb634('0x1')](util[_0xb634('0x2')](_0xb634('0x1e'),_0x114615[_0xb634('0x9')],dials[_0x114615[_0xb634('0x9')]][_0xb634('0x1b')]));}}catch(_0x772ee5){utils[_0xb634('0x13')](util[_0xb634('0x2')](_0xb634('0x1f'),_0x114615[_0xb634('0x9')]),_0x772ee5);}};exports['dialend']=function(_0x3ac81f){try{if(!_[_0xb634('0x14')](dials[_0x3ac81f[_0xb634('0x9')]])){utils[_0xb634('0xb')](util[_0xb634('0x2')](_0xb634('0x20'),_0x3ac81f[_0xb634('0x9')]),_0x3ac81f);dials[_0x3ac81f[_0xb634('0x9')]]['dialstatus']=_0x3ac81f[_0xb634('0x7')];if(_0x3ac81f[_0xb634('0x7')]==_0xb634('0x21')){dials[_0x3ac81f[_0xb634('0x9')]]=_['assign'](dials[_0x3ac81f[_0xb634('0x9')]],_0x3ac81f);dials[_0x3ac81f[_0xb634('0x9')]]['answertime']=utils['now']();dials[_0x3ac81f[_0xb634('0x9')]][_0xb634('0x1c')]=_0xb634('0x22');utils[_0xb634('0x1')](util[_0xb634('0x2')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x3ac81f[_0xb634('0x9')],_0x3ac81f[_0xb634('0x7')],dials[_0x3ac81f[_0xb634('0x9')]][_0xb634('0x23')]));}else{utils[_0xb634('0x1')](util[_0xb634('0x2')](_0xb634('0x24'),_0x3ac81f[_0xb634('0x9')],_0x3ac81f[_0xb634('0x7')]));}}}catch(_0x201d78){utils[_0xb634('0x13')](util['format']('[%s][dials][dialend]',_0x3ac81f[_0xb634('0x9')]),_0x201d78);}};exports['hangup']=function(_0x34fcdc){try{if(!_[_0xb634('0x14')](dials[_0x34fcdc[_0xb634('0x9')]])){utils[_0xb634('0xb')](util[_0xb634('0x2')](_0xb634('0x25'),_0x34fcdc[_0xb634('0x9')]),_0x34fcdc);utils['info'](util[_0xb634('0x2')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x34fcdc[_0xb634('0x9')],_0x34fcdc[_0xb634('0x5')],_0x34fcdc[_0xb634('0x26')],_0x34fcdc[_0xb634('0x27')]));dials[_0x34fcdc[_0xb634('0x9')]]=_[_0xb634('0x1a')](dials[_0x34fcdc[_0xb634('0x9')]],{'endtime':utils[_0xb634('0x28')](),'lastevent':_0xb634('0x29')});dials[_0x34fcdc[_0xb634('0x9')]][_0xb634('0x2a')]=utils[_0xb634('0x2b')](dials[_0x34fcdc[_0xb634('0x9')]][_0xb634('0x2c')],dials[_0x34fcdc[_0xb634('0x9')]][_0xb634('0x1b')]);dials[_0x34fcdc[_0xb634('0x9')]][_0xb634('0x2d')]=utils[_0xb634('0x2b')](dials[_0x34fcdc[_0xb634('0x9')]]['answertime']||dials[_0x34fcdc[_0xb634('0x9')]][_0xb634('0x2c')],dials[_0x34fcdc[_0xb634('0x9')]][_0xb634('0x1b')]);dials[_0x34fcdc[_0xb634('0x9')]][_0xb634('0x2e')]=dials[_0x34fcdc['uniqueid']][_0xb634('0x23')]?utils['diffTime'](dials[_0x34fcdc['uniqueid']][_0xb634('0x2c')],dials[_0x34fcdc[_0xb634('0x9')]][_0xb634('0x23')]):0x0;writeDB(dials[_0x34fcdc['uniqueid']]);}}catch(_0xabc95b){utils[_0xb634('0x13')](util['format'](_0xb634('0x25'),_0x34fcdc[_0xb634('0x9')]),_0xabc95b);}}; \ No newline at end of file +var _0x7820=['CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','isNil','variable','outboundrouteid','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','[%s][dials][dialend]','dialstatus','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','calleridname','cause-txt','complete','duration','diffTime','holdtime','endtime','lodash','util','./utils','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','request'];(function(_0x541b45,_0x3bc9de){var _0x1c1ce9=function(_0x2e5334){while(--_0x2e5334){_0x541b45['push'](_0x541b45['shift']());}};_0x1c1ce9(++_0x3bc9de);}(_0x7820,0x96));var _0x0782=function(_0x25badc,_0xf437fd){_0x25badc=_0x25badc-0x0;var _0x1eb093=_0x7820[_0x25badc];return _0x1eb093;};'use strict';var _=require(_0x0782('0x0'));var util=require(_0x0782('0x1'));var utils=require(_0x0782('0x2'));var dials={};function writeDB(_0x3fc134){utils['info'](util['format'](_0x0782('0x3'),_0x3fc134[_0x0782('0x4')],_0x3fc134[_0x0782('0x5')],_0x3fc134['dialstring'],_0x3fc134[_0x0782('0x6')],_0x3fc134[_0x0782('0x7')],_0x3fc134['dialstatus']));utils[_0x0782('0x8')](_0x0782('0x9'),_0x3fc134);delete dials[_0x3fc134['uniqueid']];}exports[_0x0782('0xa')]=function(_0x1d45ab){try{utils[_0x0782('0xb')](util[_0x0782('0xc')](_0x0782('0xd'),_0x1d45ab['uniqueid']),_0x1d45ab);utils[_0x0782('0xe')](util['format'](_0x0782('0xf'),_0x1d45ab[_0x0782('0x4')],_0x1d45ab['application'],_0x1d45ab[_0x0782('0x10')]));if(_0x1d45ab[_0x0782('0x11')][_0x0782('0x12')]()==_0x0782('0x13')&&_[_0x0782('0x14')](_0x1d45ab[_0x0782('0x10')][_0x0782('0x12')](),_0x0782('0x15'))){var _0x484763=_0x1d45ab['appdata'][_0x0782('0x16')]('=');dials[_0x1d45ab[_0x0782('0x4')]]={'routeId':_0x484763[0x1]};}}catch(_0x6f4bee){utils[_0x0782('0x17')](util[_0x0782('0xc')]('[%s][dials][newexten]',_0x1d45ab['uniqueid']),_0x6f4bee);}};exports[_0x0782('0x18')]=function(_0x4bc4b8){try{utils['debug'](util['format']('[%s][dials][varset]',_0x4bc4b8[_0x0782('0x4')]),_0x4bc4b8);if(!_[_0x0782('0x19')](_0x4bc4b8[_0x0782('0x1a')][_0x0782('0x1b')])){utils['info'](util[_0x0782('0xc')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x4bc4b8['uniqueid'],_0x4bc4b8[_0x0782('0x1c')]));dials[_0x4bc4b8[_0x0782('0x4')]]={'routeId':_0x4bc4b8['value']};}}catch(_0x1aa338){utils[_0x0782('0x17')](util[_0x0782('0xc')](_0x0782('0x1d'),_0x4bc4b8[_0x0782('0x4')]),_0x1aa338);}};exports[_0x0782('0x1e')]=function(_0x1e651e){try{if(!_[_0x0782('0x19')](dials[_0x1e651e['uniqueid']])){utils['debug'](util[_0x0782('0xc')](_0x0782('0x1f'),_0x1e651e[_0x0782('0x4')]),_0x1e651e);dials[_0x1e651e[_0x0782('0x4')]]=_[_0x0782('0x20')](dials[_0x1e651e[_0x0782('0x4')]],_0x1e651e);dials[_0x1e651e[_0x0782('0x4')]]['starttime']=utils[_0x0782('0x21')]();dials[_0x1e651e[_0x0782('0x4')]][_0x0782('0x22')]=_0x0782('0x23');utils[_0x0782('0xe')](util[_0x0782('0xc')](_0x0782('0x24'),_0x1e651e[_0x0782('0x4')],dials[_0x1e651e['uniqueid']][_0x0782('0x25')]));}}catch(_0x552734){utils['error'](util['format'](_0x0782('0x1f'),_0x1e651e['uniqueid']),_0x552734);}};exports['dialend']=function(_0x80abe7){try{if(!_[_0x0782('0x19')](dials[_0x80abe7['uniqueid']])){utils['debug'](util['format'](_0x0782('0x26'),_0x80abe7[_0x0782('0x4')]),_0x80abe7);dials[_0x80abe7[_0x0782('0x4')]][_0x0782('0x27')]=_0x80abe7[_0x0782('0x27')];if(_0x80abe7['dialstatus']=='ANSWER'){dials[_0x80abe7[_0x0782('0x4')]]=_[_0x0782('0x20')](dials[_0x80abe7['uniqueid']],_0x80abe7);dials[_0x80abe7[_0x0782('0x4')]][_0x0782('0x28')]=utils[_0x0782('0x21')]();dials[_0x80abe7[_0x0782('0x4')]][_0x0782('0x22')]=_0x0782('0x29');utils[_0x0782('0xe')](util[_0x0782('0xc')](_0x0782('0x2a'),_0x80abe7[_0x0782('0x4')],_0x80abe7[_0x0782('0x27')],dials[_0x80abe7['uniqueid']][_0x0782('0x28')]));}else{utils[_0x0782('0xe')](util[_0x0782('0xc')](_0x0782('0x2b'),_0x80abe7[_0x0782('0x4')],_0x80abe7[_0x0782('0x27')]));}}}catch(_0x496580){utils[_0x0782('0x17')](util['format']('[%s][dials][dialend]',_0x80abe7[_0x0782('0x4')]),_0x496580);}};exports[_0x0782('0x2c')]=function(_0x5c8b04){try{if(!_[_0x0782('0x19')](dials[_0x5c8b04['uniqueid']])){utils[_0x0782('0xb')](util[_0x0782('0xc')](_0x0782('0x2d'),_0x5c8b04[_0x0782('0x4')]),_0x5c8b04);utils['info'](util[_0x0782('0xc')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x5c8b04[_0x0782('0x4')],_0x5c8b04[_0x0782('0x6')],_0x5c8b04[_0x0782('0x2e')],_0x5c8b04[_0x0782('0x2f')]));dials[_0x5c8b04[_0x0782('0x4')]]=_['assign'](dials[_0x5c8b04['uniqueid']],{'endtime':utils['now'](),'lastevent':_0x0782('0x30')});dials[_0x5c8b04['uniqueid']][_0x0782('0x31')]=utils[_0x0782('0x32')](dials[_0x5c8b04['uniqueid']]['endtime'],dials[_0x5c8b04[_0x0782('0x4')]][_0x0782('0x25')]);dials[_0x5c8b04[_0x0782('0x4')]][_0x0782('0x33')]=utils[_0x0782('0x32')](dials[_0x5c8b04[_0x0782('0x4')]][_0x0782('0x28')]||dials[_0x5c8b04[_0x0782('0x4')]]['endtime'],dials[_0x5c8b04[_0x0782('0x4')]]['starttime']);dials[_0x5c8b04[_0x0782('0x4')]]['billableseconds']=dials[_0x5c8b04[_0x0782('0x4')]][_0x0782('0x28')]?utils[_0x0782('0x32')](dials[_0x5c8b04[_0x0782('0x4')]][_0x0782('0x34')],dials[_0x5c8b04[_0x0782('0x4')]][_0x0782('0x28')]):0x0;writeDB(dials[_0x5c8b04[_0x0782('0x4')]]);}}catch(_0x29e030){utils[_0x0782('0x17')](util[_0x0782('0xc')](_0x0782('0x2d'),_0x5c8b04['uniqueid']),_0x29e030);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 846d6db..56eaace 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 _0x2d7e=['[%s][index][dialend]','../../config/environment','./utils','util','asterisk','port','password','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2d7e,0x10d));var _0xe2d7=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x2d7e[_0x484c03];return _0x294127;};var AsteriskManager=require('asterisk-manager');var config=require(_0xe2d7('0x0'));var utils=require(_0xe2d7('0x1'));var util=require(_0xe2d7('0x2'));var ami=new AsteriskManager(config[_0xe2d7('0x3')][_0xe2d7('0x4')],config[_0xe2d7('0x3')]['ip'],config[_0xe2d7('0x3')]['username'],config[_0xe2d7('0x3')][_0xe2d7('0x5')],!![]);ami['keepConnected']();if(config[_0xe2d7('0x6')]&&config[_0xe2d7('0x6')][_0xe2d7('0x7')]){utils[_0xe2d7('0x8')](_0xe2d7('0x9'));}else{var agents=require(_0xe2d7('0xa'));var calls=require(_0xe2d7('0xb'));var queues=require(_0xe2d7('0xc'));var recordings=require(_0xe2d7('0xd'));var members=require(_0xe2d7('0xe'));var dials=require(_0xe2d7('0xf'));var transfers=require(_0xe2d7('0x10'));var core=require('./core.controller');ami['on'](_0xe2d7('0x11'),core['connect']);ami['on'](_0xe2d7('0x12'),core[_0xe2d7('0x12')]);ami['on'](_0xe2d7('0x13'),core['fullybooted']);ami['on'](_0xe2d7('0x14'),core[_0xe2d7('0x14')]);ami['on']('close',core[_0xe2d7('0x15')]);ami['on'](_0xe2d7('0x16'),core[_0xe2d7('0x16')]);ami['on'](_0xe2d7('0x17'),function(_0x7766f){try{utils[_0xe2d7('0x18')](util[_0xe2d7('0x19')](_0xe2d7('0x1a'),_0x7766f[_0xe2d7('0x1b')]),_0x7766f);members[_0xe2d7('0x17')](_0x7766f);}catch(_0x2aedba){utils[_0xe2d7('0x14')](util['format'](_0xe2d7('0x1a'),_0x7766f['device']),_0x2aedba);}});ami['on']('agentcalled',function(_0x5abd76){try{utils[_0xe2d7('0x18')](util[_0xe2d7('0x19')](_0xe2d7('0x1c'),_0x5abd76[_0xe2d7('0x1d')]),_0x5abd76);agents[_0xe2d7('0x1e')](_0x5abd76);}catch(_0x4d2ec0){utils[_0xe2d7('0x14')](util[_0xe2d7('0x19')]('[%s][index][agentcalled]',_0x5abd76[_0xe2d7('0x1d')]),_0x4d2ec0);}});ami['on'](_0xe2d7('0x1f'),function(_0x4b3fe7){try{utils[_0xe2d7('0x18')](util[_0xe2d7('0x19')](_0xe2d7('0x20'),_0x4b3fe7[_0xe2d7('0x1d')]),_0x4b3fe7);agents[_0xe2d7('0x1f')](_0x4b3fe7);}catch(_0x82c36a){utils[_0xe2d7('0x14')](util[_0xe2d7('0x19')](_0xe2d7('0x20'),_0x4b3fe7[_0xe2d7('0x1d')]),_0x82c36a);}});ami['on'](_0xe2d7('0x21'),function(_0x361fd0){try{utils[_0xe2d7('0x18')](util[_0xe2d7('0x19')](_0xe2d7('0x22'),_0x361fd0[_0xe2d7('0x1d')]),_0x361fd0);agents['agentconnect'](_0x361fd0);queues[_0xe2d7('0x21')](_0x361fd0);}catch(_0x2b72ee){utils['error'](util['format'](_0xe2d7('0x22'),_0x361fd0[_0xe2d7('0x1d')]),_0x2b72ee);}});ami['on']('agentcomplete',function(_0x407148){try{utils['debug'](util[_0xe2d7('0x19')](_0xe2d7('0x23'),_0x407148[_0xe2d7('0x1d')]),_0x407148);agents['agentcomplete'](_0x407148);queues[_0xe2d7('0x24')](_0x407148);members['agentcomplete'](_0x407148);}catch(_0x3d5396){utils[_0xe2d7('0x14')](util['format'](_0xe2d7('0x23'),_0x407148[_0xe2d7('0x1d')]),_0x3d5396);}});ami['on'](_0xe2d7('0x25'),function(_0x444108){try{utils[_0xe2d7('0x18')](util[_0xe2d7('0x19')](_0xe2d7('0x26'),_0x444108[_0xe2d7('0x1d')]),_0x444108);agents[_0xe2d7('0x25')](_0x444108);queues[_0xe2d7('0x25')](_0x444108);}catch(_0x43e8b1){utils[_0xe2d7('0x14')](util['format']('[%s][index][queuecallerabandon]',_0x444108[_0xe2d7('0x1d')]),_0x43e8b1);}});ami['on'](_0xe2d7('0x27'),function(_0x24d13e){try{utils[_0xe2d7('0x18')](util[_0xe2d7('0x19')](_0xe2d7('0x28'),_0x24d13e[_0xe2d7('0x1d')]),_0x24d13e);queues[_0xe2d7('0x27')](_0x24d13e);recordings['queuecallerjoin'](_0x24d13e);}catch(_0xd3ab17){utils[_0xe2d7('0x14')](util[_0xe2d7('0x19')](_0xe2d7('0x28'),_0x24d13e[_0xe2d7('0x1d')]),_0xd3ab17);}});ami['on'](_0xe2d7('0x29'),function(_0x8ebc99){try{utils[_0xe2d7('0x18')](util['format'](_0xe2d7('0x2a'),_0x8ebc99[_0xe2d7('0x1d')]),_0x8ebc99);queues[_0xe2d7('0x29')](_0x8ebc99);}catch(_0x4bb303){utils[_0xe2d7('0x14')](util[_0xe2d7('0x19')](_0xe2d7('0x2a'),_0x8ebc99[_0xe2d7('0x1d')]),_0x4bb303);}});ami['on']('musiconholdstart',function(_0x28cc34){try{utils['debug'](util[_0xe2d7('0x19')]('[%s][index][musiconholdstart]',_0x28cc34[_0xe2d7('0x1d')]),_0x28cc34);queues['musiconholdstart'](_0x28cc34);calls['musiconholdstart'](_0x28cc34);}catch(_0x1c5f42){utils[_0xe2d7('0x14')](util[_0xe2d7('0x19')](_0xe2d7('0x2b'),_0x28cc34[_0xe2d7('0x1d')]),_0x1c5f42);}});ami['on'](_0xe2d7('0x2c'),function(_0xaaa8a9){try{utils[_0xe2d7('0x18')](util['format']('[%s][index][musiconholdstop]',_0xaaa8a9[_0xe2d7('0x1d')]),_0xaaa8a9);queues['musiconholdstop'](_0xaaa8a9);calls[_0xe2d7('0x2c')](_0xaaa8a9);}catch(_0xe3a7c){utils[_0xe2d7('0x14')](util['format']('[%s][index][musiconholdstop]',_0xaaa8a9[_0xe2d7('0x1d')]),_0xe3a7c);}});ami['on'](_0xe2d7('0x2d'),function(_0x490145){try{utils[_0xe2d7('0x18')](util[_0xe2d7('0x19')](_0xe2d7('0x2e'),_0x490145['uniqueid']),_0x490145);calls[_0xe2d7('0x2d')](_0x490145);recordings[_0xe2d7('0x2d')](_0x490145);}catch(_0x3a1921){utils[_0xe2d7('0x14')](util['format'](_0xe2d7('0x2e'),_0x490145[_0xe2d7('0x1d')]),_0x3a1921);}});ami['on'](_0xe2d7('0x2f'),function(_0x15960a){try{utils[_0xe2d7('0x18')](util[_0xe2d7('0x19')](_0xe2d7('0x30'),_0x15960a[_0xe2d7('0x1d')]),_0x15960a);calls['hangup'](_0x15960a);recordings[_0xe2d7('0x2f')](_0x15960a);dials[_0xe2d7('0x2f')](_0x15960a);agents[_0xe2d7('0x2f')](_0x15960a);queues[_0xe2d7('0x2f')](_0x15960a);}catch(_0x496ab9){utils[_0xe2d7('0x14')](util[_0xe2d7('0x19')]('[%s][index][hangup]',_0x15960a['uniqueid']),_0x496ab9);}});ami['on'](_0xe2d7('0x31'),function(_0x4156ce){try{utils[_0xe2d7('0x18')](util['format']('[%s][index][cdr]',_0x4156ce[_0xe2d7('0x1d')]),_0x4156ce);members[_0xe2d7('0x31')](_0x4156ce);}catch(_0x38f66d){utils[_0xe2d7('0x14')](util[_0xe2d7('0x19')](_0xe2d7('0x32'),_0x4156ce[_0xe2d7('0x1d')]),_0x38f66d);}});ami['on'](_0xe2d7('0x33'),function(_0x352598){try{utils[_0xe2d7('0x18')](util[_0xe2d7('0x19')](_0xe2d7('0x34'),_0x352598['uniqueid']),_0x352598);queues[_0xe2d7('0x33')](_0x352598);agents[_0xe2d7('0x33')](_0x352598);transfers[_0xe2d7('0x33')](_0x352598);}catch(_0x151c11){utils[_0xe2d7('0x14')](util[_0xe2d7('0x19')](_0xe2d7('0x34'),_0x352598[_0xe2d7('0x1d')]),_0x151c11);}});ami['on'](_0xe2d7('0x35'),function(_0x19e1d5){try{utils['debug'](util[_0xe2d7('0x19')]('[%s][index][attendedtransfer]',_0x19e1d5[_0xe2d7('0x36')]),_0x19e1d5);queues[_0xe2d7('0x35')](_0x19e1d5);transfers[_0xe2d7('0x35')](_0x19e1d5);agents[_0xe2d7('0x35')](_0x19e1d5);calls[_0xe2d7('0x35')](_0x19e1d5);}catch(_0x17d7a1){utils['error'](util[_0xe2d7('0x19')](_0xe2d7('0x37'),_0x19e1d5[_0xe2d7('0x36')]),_0x17d7a1);}});ami['on'](_0xe2d7('0x38'),function(_0x6d4cb2){try{utils[_0xe2d7('0x18')](util[_0xe2d7('0x19')](_0xe2d7('0x39'),_0x6d4cb2[_0xe2d7('0x1d')]),_0x6d4cb2);queues['varset'](_0x6d4cb2);recordings[_0xe2d7('0x38')](_0x6d4cb2);calls['varset'](_0x6d4cb2);dials[_0xe2d7('0x38')](_0x6d4cb2);}catch(_0x1a4a86){utils[_0xe2d7('0x14')](util[_0xe2d7('0x19')](_0xe2d7('0x39'),_0x6d4cb2[_0xe2d7('0x1d')]),_0x1a4a86);}});ami['on'](_0xe2d7('0x3a'),function(_0x53748f){try{utils[_0xe2d7('0x18')](util[_0xe2d7('0x19')]('[%s][index][newexten]',_0x53748f['uniqueid']),_0x53748f);calls[_0xe2d7('0x3a')](_0x53748f);recordings[_0xe2d7('0x3a')](_0x53748f);dials['newexten'](_0x53748f);}catch(_0x5f4da8){utils['error'](util['format'](_0xe2d7('0x3b'),_0x53748f['uniqueid']),_0x5f4da8);}});ami['on'](_0xe2d7('0x3c'),function(_0x14255a){try{utils[_0xe2d7('0x18')](util['format'](_0xe2d7('0x3d'),_0x14255a['uniqueid']),_0x14255a);calls[_0xe2d7('0x3c')](_0x14255a);recordings[_0xe2d7('0x3c')](_0x14255a);}catch(_0x1e3ae7){utils[_0xe2d7('0x14')](util[_0xe2d7('0x19')](_0xe2d7('0x3d'),_0x14255a[_0xe2d7('0x1d')]),_0x1e3ae7);}});ami['on']('dialbegin',function(_0x4f5849){try{utils[_0xe2d7('0x18')](util['format'](_0xe2d7('0x3e'),_0x4f5849[_0xe2d7('0x1d')]),_0x4f5849);dials[_0xe2d7('0x3f')](_0x4f5849);}catch(_0x39a22c){utils['error'](util[_0xe2d7('0x19')](_0xe2d7('0x40'),_0x4f5849[_0xe2d7('0x1d')]),_0x39a22c);}});ami['on'](_0xe2d7('0x41'),function(_0x5c4100){try{utils[_0xe2d7('0x18')](util[_0xe2d7('0x19')](_0xe2d7('0x42'),_0x5c4100[_0xe2d7('0x1d')]),_0x5c4100);dials['dialend'](_0x5c4100);}catch(_0x27dc90){utils['error'](util[_0xe2d7('0x19')](_0xe2d7('0x42'),_0x5c4100[_0xe2d7('0x1d')]),_0x27dc90);}});} \ No newline at end of file +var _0xd455=['[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','[%s][index][newexten]','newexten','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','username','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer'];(function(_0x1c8c07,_0x2579af){var _0x4aa88f=function(_0x2ad13d){while(--_0x2ad13d){_0x1c8c07['push'](_0x1c8c07['shift']());}};_0x4aa88f(++_0x2579af);}(_0xd455,0x13c));var _0x5d45=function(_0x29291e,_0x3b5334){_0x29291e=_0x29291e-0x0;var _0x95e8cf=_0xd455[_0x29291e];return _0x95e8cf;};var AsteriskManager=require(_0x5d45('0x0'));var config=require(_0x5d45('0x1'));var utils=require(_0x5d45('0x2'));var util=require(_0x5d45('0x3'));var ami=new AsteriskManager(config[_0x5d45('0x4')][_0x5d45('0x5')],config[_0x5d45('0x4')]['ip'],config[_0x5d45('0x4')][_0x5d45('0x6')],config['asterisk'][_0x5d45('0x7')],!![]);ami[_0x5d45('0x8')]();if(config[_0x5d45('0x9')]&&config[_0x5d45('0x9')][_0x5d45('0xa')]){utils['info'](_0x5d45('0xb'));}else{var agents=require('./agents.controller');var calls=require(_0x5d45('0xc'));var queues=require(_0x5d45('0xd'));var recordings=require(_0x5d45('0xe'));var members=require(_0x5d45('0xf'));var dials=require(_0x5d45('0x10'));var transfers=require(_0x5d45('0x11'));var core=require(_0x5d45('0x12'));ami['on'](_0x5d45('0x13'),core[_0x5d45('0x13')]);ami['on'](_0x5d45('0x14'),core[_0x5d45('0x14')]);ami['on'](_0x5d45('0x15'),core[_0x5d45('0x15')]);ami['on']('error',core[_0x5d45('0x16')]);ami['on'](_0x5d45('0x17'),core[_0x5d45('0x17')]);ami['on'](_0x5d45('0x18'),core['managerevent']);ami['on'](_0x5d45('0x19'),function(_0x1ff3e4){try{utils[_0x5d45('0x1a')](util[_0x5d45('0x1b')](_0x5d45('0x1c'),_0x1ff3e4[_0x5d45('0x1d')]),_0x1ff3e4);members[_0x5d45('0x19')](_0x1ff3e4);}catch(_0x5de83b){utils[_0x5d45('0x16')](util[_0x5d45('0x1b')]('[%s][index][devicestatechange]',_0x1ff3e4[_0x5d45('0x1d')]),_0x5de83b);}});ami['on'](_0x5d45('0x1e'),function(_0x16e1e0){try{utils[_0x5d45('0x1a')](util[_0x5d45('0x1b')]('[%s][index][agentcalled]',_0x16e1e0[_0x5d45('0x1f')]),_0x16e1e0);agents['agentcalled'](_0x16e1e0);}catch(_0x4bccc9){utils[_0x5d45('0x16')](util[_0x5d45('0x1b')](_0x5d45('0x20'),_0x16e1e0[_0x5d45('0x1f')]),_0x4bccc9);}});ami['on'](_0x5d45('0x21'),function(_0x57381a){try{utils[_0x5d45('0x1a')](util[_0x5d45('0x1b')](_0x5d45('0x22'),_0x57381a['uniqueid']),_0x57381a);agents[_0x5d45('0x21')](_0x57381a);}catch(_0x5d6bcf){utils['error'](util[_0x5d45('0x1b')](_0x5d45('0x22'),_0x57381a[_0x5d45('0x1f')]),_0x5d6bcf);}});ami['on'](_0x5d45('0x23'),function(_0x18bba3){try{utils[_0x5d45('0x1a')](util[_0x5d45('0x1b')](_0x5d45('0x24'),_0x18bba3['uniqueid']),_0x18bba3);agents[_0x5d45('0x23')](_0x18bba3);queues[_0x5d45('0x23')](_0x18bba3);}catch(_0x2e2a73){utils[_0x5d45('0x16')](util[_0x5d45('0x1b')](_0x5d45('0x24'),_0x18bba3[_0x5d45('0x1f')]),_0x2e2a73);}});ami['on']('agentcomplete',function(_0x10fad8){try{utils[_0x5d45('0x1a')](util['format'](_0x5d45('0x25'),_0x10fad8[_0x5d45('0x1f')]),_0x10fad8);agents[_0x5d45('0x26')](_0x10fad8);queues[_0x5d45('0x26')](_0x10fad8);members[_0x5d45('0x26')](_0x10fad8);}catch(_0x16e618){utils['error'](util[_0x5d45('0x1b')](_0x5d45('0x25'),_0x10fad8[_0x5d45('0x1f')]),_0x16e618);}});ami['on'](_0x5d45('0x27'),function(_0x1b5603){try{utils['debug'](util[_0x5d45('0x1b')]('[%s][index][queuecallerabandon]',_0x1b5603[_0x5d45('0x1f')]),_0x1b5603);agents[_0x5d45('0x27')](_0x1b5603);queues[_0x5d45('0x27')](_0x1b5603);}catch(_0x4741df){utils[_0x5d45('0x16')](util[_0x5d45('0x1b')]('[%s][index][queuecallerabandon]',_0x1b5603[_0x5d45('0x1f')]),_0x4741df);}});ami['on'](_0x5d45('0x28'),function(_0xb9d019){try{utils['debug'](util['format'](_0x5d45('0x29'),_0xb9d019[_0x5d45('0x1f')]),_0xb9d019);queues[_0x5d45('0x28')](_0xb9d019);recordings[_0x5d45('0x28')](_0xb9d019);}catch(_0x3a985c){utils[_0x5d45('0x16')](util[_0x5d45('0x1b')]('[%s][index][queuecallerjoin]',_0xb9d019[_0x5d45('0x1f')]),_0x3a985c);}});ami['on'](_0x5d45('0x2a'),function(_0x5c6118){try{utils[_0x5d45('0x1a')](util[_0x5d45('0x1b')](_0x5d45('0x2b'),_0x5c6118['uniqueid']),_0x5c6118);queues[_0x5d45('0x2a')](_0x5c6118);}catch(_0x3fccf2){utils[_0x5d45('0x16')](util['format'](_0x5d45('0x2b'),_0x5c6118[_0x5d45('0x1f')]),_0x3fccf2);}});ami['on'](_0x5d45('0x2c'),function(_0x75f2d6){try{utils[_0x5d45('0x1a')](util[_0x5d45('0x1b')](_0x5d45('0x2d'),_0x75f2d6['uniqueid']),_0x75f2d6);queues[_0x5d45('0x2c')](_0x75f2d6);calls[_0x5d45('0x2c')](_0x75f2d6);}catch(_0x458fe8){utils[_0x5d45('0x16')](util['format'](_0x5d45('0x2d'),_0x75f2d6['uniqueid']),_0x458fe8);}});ami['on'](_0x5d45('0x2e'),function(_0x45f545){try{utils[_0x5d45('0x1a')](util['format'](_0x5d45('0x2f'),_0x45f545[_0x5d45('0x1f')]),_0x45f545);queues[_0x5d45('0x2e')](_0x45f545);calls[_0x5d45('0x2e')](_0x45f545);}catch(_0x860d2f){utils[_0x5d45('0x16')](util[_0x5d45('0x1b')](_0x5d45('0x2f'),_0x45f545[_0x5d45('0x1f')]),_0x860d2f);}});ami['on'](_0x5d45('0x30'),function(_0x75b584){try{utils[_0x5d45('0x1a')](util[_0x5d45('0x1b')](_0x5d45('0x31'),_0x75b584['uniqueid']),_0x75b584);calls[_0x5d45('0x30')](_0x75b584);recordings['newstate'](_0x75b584);}catch(_0x192532){utils[_0x5d45('0x16')](util['format']('[%s][index][newstate]',_0x75b584[_0x5d45('0x1f')]),_0x192532);}});ami['on'](_0x5d45('0x32'),function(_0x20e556){try{utils[_0x5d45('0x1a')](util[_0x5d45('0x1b')]('[%s][index][hangup]',_0x20e556[_0x5d45('0x1f')]),_0x20e556);calls[_0x5d45('0x32')](_0x20e556);recordings[_0x5d45('0x32')](_0x20e556);dials['hangup'](_0x20e556);agents['hangup'](_0x20e556);queues[_0x5d45('0x32')](_0x20e556);}catch(_0xe589d3){utils['error'](util[_0x5d45('0x1b')](_0x5d45('0x33'),_0x20e556['uniqueid']),_0xe589d3);}});ami['on']('cdr',function(_0x23a784){try{utils['debug'](util[_0x5d45('0x1b')](_0x5d45('0x34'),_0x23a784[_0x5d45('0x1f')]),_0x23a784);members[_0x5d45('0x35')](_0x23a784);}catch(_0x5a7475){utils[_0x5d45('0x16')](util[_0x5d45('0x1b')](_0x5d45('0x34'),_0x23a784['uniqueid']),_0x5a7475);}});ami['on'](_0x5d45('0x36'),function(_0x225ef3){try{utils[_0x5d45('0x1a')](util['format'](_0x5d45('0x37'),_0x225ef3[_0x5d45('0x1f')]),_0x225ef3);queues[_0x5d45('0x36')](_0x225ef3);agents['blindtransfer'](_0x225ef3);transfers[_0x5d45('0x36')](_0x225ef3);}catch(_0x4c203f){utils[_0x5d45('0x16')](util[_0x5d45('0x1b')](_0x5d45('0x37'),_0x225ef3[_0x5d45('0x1f')]),_0x4c203f);}});ami['on']('attendedtransfer',function(_0x4b0835){try{utils[_0x5d45('0x1a')](util['format'](_0x5d45('0x38'),_0x4b0835[_0x5d45('0x39')]),_0x4b0835);queues['attendedtransfer'](_0x4b0835);transfers[_0x5d45('0x3a')](_0x4b0835);agents[_0x5d45('0x3a')](_0x4b0835);calls['attendedtransfer'](_0x4b0835);}catch(_0xfcab65){utils[_0x5d45('0x16')](util[_0x5d45('0x1b')]('[%s][index][attendedtransfer]',_0x4b0835[_0x5d45('0x39')]),_0xfcab65);}});ami['on'](_0x5d45('0x3b'),function(_0x4b9d7a){try{utils['debug'](util[_0x5d45('0x1b')](_0x5d45('0x3c'),_0x4b9d7a['uniqueid']),_0x4b9d7a);queues['varset'](_0x4b9d7a);recordings['varset'](_0x4b9d7a);calls[_0x5d45('0x3b')](_0x4b9d7a);dials[_0x5d45('0x3b')](_0x4b9d7a);}catch(_0x368ce4){utils['error'](util['format'](_0x5d45('0x3c'),_0x4b9d7a[_0x5d45('0x1f')]),_0x368ce4);}});ami['on']('newexten',function(_0x253405){try{utils[_0x5d45('0x1a')](util[_0x5d45('0x1b')](_0x5d45('0x3d'),_0x253405['uniqueid']),_0x253405);calls[_0x5d45('0x3e')](_0x253405);recordings[_0x5d45('0x3e')](_0x253405);dials[_0x5d45('0x3e')](_0x253405);}catch(_0x1ae387){utils['error'](util[_0x5d45('0x1b')](_0x5d45('0x3d'),_0x253405[_0x5d45('0x1f')]),_0x1ae387);}});ami['on']('newchannel',function(_0x1c7d53){try{utils[_0x5d45('0x1a')](util[_0x5d45('0x1b')](_0x5d45('0x3f'),_0x1c7d53[_0x5d45('0x1f')]),_0x1c7d53);calls[_0x5d45('0x40')](_0x1c7d53);recordings[_0x5d45('0x40')](_0x1c7d53);}catch(_0x5d9edf){utils[_0x5d45('0x16')](util['format'](_0x5d45('0x3f'),_0x1c7d53['uniqueid']),_0x5d9edf);}});ami['on'](_0x5d45('0x41'),function(_0x74054a){try{utils[_0x5d45('0x1a')](util['format'](_0x5d45('0x42'),_0x74054a['uniqueid']),_0x74054a);dials[_0x5d45('0x41')](_0x74054a);}catch(_0x47c5e8){utils['error'](util[_0x5d45('0x1b')](_0x5d45('0x43'),_0x74054a[_0x5d45('0x1f')]),_0x47c5e8);}});ami['on'](_0x5d45('0x44'),function(_0xe587be){try{utils[_0x5d45('0x1a')](util[_0x5d45('0x1b')]('[%s][index][dialend]',_0xe587be[_0x5d45('0x1f')]),_0xe587be);dials[_0x5d45('0x44')](_0xe587be);}catch(_0x245f0b){utils['error'](util[_0x5d45('0x1b')](_0x5d45('0x45'),_0xe587be[_0x5d45('0x1f')]),_0x245f0b);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index f443180..e4627a7 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 _0x6ba5=['some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','source','data3','destination','destinationchannel','data1','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Local/_attended@transfer','Queue:','info','interface','channel','data2','type','then','membername','name','internal','request','CreateMemberReport','split','catch','error','format','uniqueid'];(function(_0x592960,_0x57bcc6){var _0x2c7ea2=function(_0x3dc96a){while(--_0x3dc96a){_0x592960['push'](_0x592960['shift']());}};_0x2c7ea2(++_0x57bcc6);}(_0x6ba5,0x1bf));var _0x56ba=function(_0x132d12,_0x2c9799){_0x132d12=_0x132d12-0x0;var _0x1c3163=_0x6ba5[_0x132d12];return _0x1c3163;};'use strict';var _=require(_0x56ba('0x0'));var util=require(_0x56ba('0x1'));var utils=require(_0x56ba('0x2'));var members={};var exclude=[_0x56ba('0x3'),_0x56ba('0x4')];function writeDB(_0x516c21){utils[_0x56ba('0x5')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x516c21['uniqueid'],_0x516c21[_0x56ba('0x6')],_0x516c21[_0x56ba('0x7')],_0x516c21[_0x56ba('0x8')],_0x516c21['membername'],_0x516c21[_0x56ba('0x9')]));if(_0x516c21['interface']){utils['getUserByInterface'](_0x516c21[_0x56ba('0x6')])[_0x56ba('0xa')](function(_0x5d506c){if(_0x5d506c){_0x516c21[_0x56ba('0xb')]=_0x5d506c[_0x56ba('0xc')];_0x516c21[_0x56ba('0xd')]=_0x5d506c['internal'];utils[_0x56ba('0xe')](_0x56ba('0xf'),_0x516c21);}else{utils['getUserByName'](_0x516c21[_0x56ba('0x6')][_0x56ba('0x10')]('/')[0x1])[_0x56ba('0xa')](function(_0x53cb53){if(_0x53cb53){_0x516c21['membername']=_0x53cb53[_0x56ba('0xc')];_0x516c21['internal']=_0x53cb53[_0x56ba('0xd')];utils[_0x56ba('0xe')](_0x56ba('0xf'),_0x516c21);}});}})[_0x56ba('0x11')](function(_0x15ac99){utils[_0x56ba('0x12')](util[_0x56ba('0x13')]('[%s][members][writeDB]',_0x516c21[_0x56ba('0x14')]),_0x15ac99);});}delete members[_0x516c21[_0x56ba('0x6')]];}function startsWith(_0x5c9d7b,_0xa36f00){return _[_0x56ba('0x15')](_0x5c9d7b,function(_0x5216a9){return _[_0x56ba('0x16')](_0xa36f00,_0x5216a9);});}exports[_0x56ba('0x17')]=function(_0x4e3ab2){try{utils[_0x56ba('0x18')](util[_0x56ba('0x13')](_0x56ba('0x19'),members[_0x4e3ab2['device']]?members[_0x4e3ab2[_0x56ba('0x1a')]][_0x56ba('0x14')]:_0x4e3ab2[_0x56ba('0x1a')]),_0x4e3ab2);utils[_0x56ba('0x5')](util[_0x56ba('0x13')](_0x56ba('0x1b'),members[_0x4e3ab2['device']]?members[_0x4e3ab2[_0x56ba('0x1a')]][_0x56ba('0x14')]:_0x4e3ab2['device'],_0x4e3ab2[_0x56ba('0x1c')],_0x4e3ab2[_0x56ba('0x1a')]));switch(_0x4e3ab2[_0x56ba('0x1c')]){case _0x56ba('0x1d'):case _0x56ba('0x1e'):if(!startsWith(exclude,_0x4e3ab2[_0x56ba('0x1a')])){members[_0x4e3ab2[_0x56ba('0x1a')]]={'channel':_0x56ba('0x1f'),'interface':_0x4e3ab2['device'],'type':_0x56ba('0x20'),'enterAt':utils[_0x56ba('0x21')](),'role':_0x56ba('0x22')};}break;case _0x56ba('0x23'):if(!_[_0x56ba('0x24')](members[_0x4e3ab2[_0x56ba('0x1a')]])){members[_0x4e3ab2['device']][_0x56ba('0x25')]=utils['now']();members[_0x4e3ab2[_0x56ba('0x1a')]]['duration']=utils[_0x56ba('0x26')](members[_0x4e3ab2[_0x56ba('0x1a')]][_0x56ba('0x25')],members[_0x4e3ab2['device']][_0x56ba('0x27')]);if(members[_0x4e3ab2['device']]['uniqueid']){writeDB(members[_0x4e3ab2['device']]);}}break;default:break;}}catch(_0x7a49ee){utils['error'](util[_0x56ba('0x13')](_0x56ba('0x19'),members[_0x4e3ab2[_0x56ba('0x1a')]]?members[_0x4e3ab2[_0x56ba('0x1a')]][_0x56ba('0x14')]:_0x4e3ab2['device']),_0x7a49ee);}};exports[_0x56ba('0x28')]=function(_0x11a34e){try{if(!_[_0x56ba('0x24')](members[_0x11a34e['interface']])){utils[_0x56ba('0x18')](util[_0x56ba('0x13')]('[%s][members][agentcomplete]',_0x11a34e[_0x56ba('0x14')]),_0x11a34e);utils[_0x56ba('0x5')](util[_0x56ba('0x13')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x11a34e[_0x56ba('0x14')],_0x11a34e[_0x56ba('0x6')],_0x11a34e[_0x56ba('0x29')]));members[_0x11a34e[_0x56ba('0x6')]]=_[_0x56ba('0x2a')](members[_0x11a34e[_0x56ba('0x6')]],{'data4':_0x11a34e[_0x56ba('0x29')],'uniqueid':_0x11a34e['uniqueid']});}}catch(_0x20802e){utils[_0x56ba('0x12')](util[_0x56ba('0x13')](_0x56ba('0x2b'),_0x11a34e['uniqueid']),_0x20802e);}};exports[_0x56ba('0x2c')]=function(_0x30579f){try{utils[_0x56ba('0x18')](util['format'](_0x56ba('0x2d'),_0x30579f[_0x56ba('0x14')]),_0x30579f);if(_0x30579f['channel']){var _0x2d52dc=_0x30579f[_0x56ba('0x7')]['split']('-')[0x0];if(!_[_0x56ba('0x24')](members[_0x2d52dc])){members[_0x2d52dc]=_['assign'](members[_0x2d52dc],{'data1':members[_0x2d52dc]['data1']||_0x30579f[_0x56ba('0x9')],'data2':members[_0x2d52dc][_0x56ba('0x8')]||_0x30579f[_0x56ba('0x2e')],'data3':members[_0x2d52dc][_0x56ba('0x2f')]||_0x30579f[_0x56ba('0x30')],'uniqueid':members[_0x2d52dc]['uniqueid']||_0x30579f[_0x56ba('0x14')]});utils[_0x56ba('0x5')](util[_0x56ba('0x13')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x30579f[_0x56ba('0x14')],members[_0x2d52dc]['data1'],members[_0x2d52dc][_0x56ba('0x8')],members[_0x2d52dc][_0x56ba('0x2f')]));if(members[_0x2d52dc][_0x56ba('0x25')]){writeDB(members[_0x2d52dc]);}}}if(_0x30579f[_0x56ba('0x31')]){var _0x417fa3=_0x30579f[_0x56ba('0x31')][_0x56ba('0x10')]('-')[0x0];if(!_['isNil'](members[_0x417fa3])){members[_0x417fa3]=_[_0x56ba('0x2a')](members[_0x417fa3],{'data1':members[_0x417fa3][_0x56ba('0x32')]||_0x30579f['type'],'data2':members[_0x417fa3][_0x56ba('0x8')]||_0x30579f[_0x56ba('0x2e')],'data3':members[_0x417fa3]['data3']||_0x30579f['destination'],'uniqueid':members[_0x417fa3]['uniqueid']||_0x30579f[_0x56ba('0x14')]});utils[_0x56ba('0x5')](util[_0x56ba('0x13')](_0x56ba('0x33'),_0x30579f[_0x56ba('0x14')],members[_0x417fa3][_0x56ba('0x32')],members[_0x417fa3][_0x56ba('0x8')],members[_0x417fa3][_0x56ba('0x2f')]));if(members[_0x417fa3]['exitAt']){writeDB(members[_0x417fa3]);}}}}catch(_0x473abd){utils[_0x56ba('0x12')](util[_0x56ba('0x13')](_0x56ba('0x2d'),_0x30579f[_0x56ba('0x14')]),_0x473abd);}}; \ No newline at end of file +var _0x1391=['diffTime','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','cdr','assign','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','type','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','membername','interface','then','name','internal','getUserByName','split','request','catch','error','[%s][members][writeDB]','some','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','isNil','exitAt'];(function(_0x2d04a6,_0x5bbf0a){var _0x3cd00e=function(_0x38887c){while(--_0x38887c){_0x2d04a6['push'](_0x2d04a6['shift']());}};_0x3cd00e(++_0x5bbf0a);}(_0x1391,0x174));var _0x1139=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x1391[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x1139('0x0'));var util=require(_0x1139('0x1'));var utils=require(_0x1139('0x2'));var members={};var exclude=[_0x1139('0x3'),_0x1139('0x4')];function writeDB(_0x384d50){utils[_0x1139('0x5')](util[_0x1139('0x6')](_0x1139('0x7'),_0x384d50[_0x1139('0x8')],_0x384d50['interface'],_0x384d50[_0x1139('0x9')],_0x384d50[_0x1139('0xa')],_0x384d50[_0x1139('0xb')],_0x384d50['type']));if(_0x384d50[_0x1139('0xc')]){utils['getUserByInterface'](_0x384d50[_0x1139('0xc')])[_0x1139('0xd')](function(_0x23d70d){if(_0x23d70d){_0x384d50[_0x1139('0xb')]=_0x23d70d[_0x1139('0xe')];_0x384d50[_0x1139('0xf')]=_0x23d70d[_0x1139('0xf')];utils['request']('CreateMemberReport',_0x384d50);}else{utils[_0x1139('0x10')](_0x384d50[_0x1139('0xc')][_0x1139('0x11')]('/')[0x1])[_0x1139('0xd')](function(_0x1f8d78){if(_0x1f8d78){_0x384d50['membername']=_0x1f8d78[_0x1139('0xe')];_0x384d50[_0x1139('0xf')]=_0x1f8d78[_0x1139('0xf')];utils[_0x1139('0x12')]('CreateMemberReport',_0x384d50);}});}})[_0x1139('0x13')](function(_0xe8b157){utils[_0x1139('0x14')](util[_0x1139('0x6')](_0x1139('0x15'),_0x384d50[_0x1139('0x8')]),_0xe8b157);});}delete members[_0x384d50['interface']];}function startsWith(_0x30ff6b,_0x399ff2){return _[_0x1139('0x16')](_0x30ff6b,function(_0x422ca8){return _['startsWith'](_0x399ff2,_0x422ca8);});}exports['devicestatechange']=function(_0x16b4cd){try{utils[_0x1139('0x17')](util[_0x1139('0x6')](_0x1139('0x18'),members[_0x16b4cd[_0x1139('0x19')]]?members[_0x16b4cd['device']]['uniqueid']:_0x16b4cd['device']),_0x16b4cd);utils['info'](util[_0x1139('0x6')](_0x1139('0x1a'),members[_0x16b4cd[_0x1139('0x19')]]?members[_0x16b4cd['device']]['uniqueid']:_0x16b4cd[_0x1139('0x19')],_0x16b4cd[_0x1139('0x1b')],_0x16b4cd['device']));switch(_0x16b4cd[_0x1139('0x1b')]){case _0x1139('0x1c'):case _0x1139('0x1d'):if(!startsWith(exclude,_0x16b4cd['device'])){members[_0x16b4cd['device']]={'channel':_0x1139('0x1e'),'interface':_0x16b4cd[_0x1139('0x19')],'type':_0x1139('0x1f'),'enterAt':utils[_0x1139('0x20')](),'role':_0x1139('0x21')};}break;case'NOT_INUSE':if(!_[_0x1139('0x22')](members[_0x16b4cd['device']])){members[_0x16b4cd['device']][_0x1139('0x23')]=utils['now']();members[_0x16b4cd[_0x1139('0x19')]]['duration']=utils[_0x1139('0x24')](members[_0x16b4cd[_0x1139('0x19')]][_0x1139('0x23')],members[_0x16b4cd[_0x1139('0x19')]]['enterAt']);if(members[_0x16b4cd['device']][_0x1139('0x8')]){writeDB(members[_0x16b4cd[_0x1139('0x19')]]);}}break;default:break;}}catch(_0x5bdeaf){utils[_0x1139('0x14')](util[_0x1139('0x6')](_0x1139('0x18'),members[_0x16b4cd[_0x1139('0x19')]]?members[_0x16b4cd[_0x1139('0x19')]][_0x1139('0x8')]:_0x16b4cd['device']),_0x5bdeaf);}};exports[_0x1139('0x25')]=function(_0x4b5b46){try{if(!_[_0x1139('0x22')](members[_0x4b5b46[_0x1139('0xc')]])){utils[_0x1139('0x17')](util[_0x1139('0x6')]('[%s][members][agentcomplete]',_0x4b5b46[_0x1139('0x8')]),_0x4b5b46);utils[_0x1139('0x5')](util[_0x1139('0x6')](_0x1139('0x26'),_0x4b5b46[_0x1139('0x8')],_0x4b5b46[_0x1139('0xc')],_0x4b5b46[_0x1139('0x27')]));members[_0x4b5b46[_0x1139('0xc')]]=_['assign'](members[_0x4b5b46[_0x1139('0xc')]],{'data4':_0x4b5b46[_0x1139('0x27')],'uniqueid':_0x4b5b46[_0x1139('0x8')]});}}catch(_0x292c91){utils['error'](util[_0x1139('0x6')](_0x1139('0x28'),_0x4b5b46[_0x1139('0x8')]),_0x292c91);}};exports[_0x1139('0x29')]=function(_0x1b94e2){try{utils['debug'](util['format']('[%s][members][cdr]',_0x1b94e2[_0x1139('0x8')]),_0x1b94e2);if(_0x1b94e2[_0x1139('0x9')]){var _0x1afc08=_0x1b94e2[_0x1139('0x9')][_0x1139('0x11')]('-')[0x0];if(!_[_0x1139('0x22')](members[_0x1afc08])){members[_0x1afc08]=_[_0x1139('0x2a')](members[_0x1afc08],{'data1':members[_0x1afc08][_0x1139('0x2b')]||_0x1b94e2['type'],'data2':members[_0x1afc08]['data2']||_0x1b94e2[_0x1139('0x2c')],'data3':members[_0x1afc08][_0x1139('0x2d')]||_0x1b94e2[_0x1139('0x2e')],'uniqueid':members[_0x1afc08][_0x1139('0x8')]||_0x1b94e2[_0x1139('0x8')]});utils[_0x1139('0x5')](util[_0x1139('0x6')](_0x1139('0x2f'),_0x1b94e2[_0x1139('0x8')],members[_0x1afc08][_0x1139('0x2b')],members[_0x1afc08][_0x1139('0xa')],members[_0x1afc08][_0x1139('0x2d')]));if(members[_0x1afc08][_0x1139('0x23')]){writeDB(members[_0x1afc08]);}}}if(_0x1b94e2[_0x1139('0x30')]){var _0x42cabc=_0x1b94e2[_0x1139('0x30')][_0x1139('0x11')]('-')[0x0];if(!_[_0x1139('0x22')](members[_0x42cabc])){members[_0x42cabc]=_[_0x1139('0x2a')](members[_0x42cabc],{'data1':members[_0x42cabc][_0x1139('0x2b')]||_0x1b94e2[_0x1139('0x31')],'data2':members[_0x42cabc]['data2']||_0x1b94e2['source'],'data3':members[_0x42cabc][_0x1139('0x2d')]||_0x1b94e2[_0x1139('0x2e')],'uniqueid':members[_0x42cabc]['uniqueid']||_0x1b94e2['uniqueid']});utils[_0x1139('0x5')](util[_0x1139('0x6')](_0x1139('0x2f'),_0x1b94e2[_0x1139('0x8')],members[_0x42cabc][_0x1139('0x2b')],members[_0x42cabc][_0x1139('0xa')],members[_0x42cabc][_0x1139('0x2d')]));if(members[_0x42cabc]['exitAt']){writeDB(members[_0x42cabc]);}}}}catch(_0x3353ef){utils[_0x1139('0x14')](util[_0x1139('0x6')](_0x1139('0x32'),_0x1b94e2[_0x1139('0x8')]),_0x3353ef);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 723d1c0..96fdae1 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 _0x8325=['[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','isNil','[%s][queues][hangup]','queuecallerleaveAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','queuecallerenterreason','error','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','name','variable','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','holdtime','queuecallerjoinAt','count','connectedlinename','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','secondtransfereruniqueid','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','format','[%s][queues][queuecallerjoin]'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8325,0x1f1));var _0x5832=function(_0x5c5d43,_0xc79d25){_0x5c5d43=_0x5c5d43-0x0;var _0x11b27d=_0x8325[_0x5c5d43];return _0x11b27d;};'use strict';var _=require(_0x5832('0x0'));var util=require('util');var utils=require(_0x5832('0x1'));var queues={};function writeDB(_0x51c901){utils[_0x5832('0x2')](util['format'](_0x5832('0x3'),_0x51c901[_0x5832('0x4')],_0x51c901[_0x5832('0x5')],_0x51c901[_0x5832('0x6')],_0x51c901['lastAssignedTo'],_0x51c901['calleridnum'],_0x51c901[_0x5832('0x7')],_0x51c901[_0x5832('0x8')]));if(_0x51c901[_0x5832('0x6')]){utils[_0x5832('0x9')](_0x51c901[_0x5832('0x6')])[_0x5832('0xa')](function(_0x495531){if(_0x495531){_0x51c901[_0x5832('0xb')]=_0x495531[_0x5832('0xb')];}utils[_0x5832('0xc')](_0x5832('0xd'),_0x51c901);});}else{utils[_0x5832('0xc')](_0x5832('0xd'),_0x51c901);}if(_0x51c901[_0x5832('0xe')]){delete queues[_0x51c901[_0x5832('0xe')]];}else{delete queues[_0x51c901[_0x5832('0x4')]];}}exports['queuecallerjoin']=function(_0x5b8ed3){try{utils[_0x5832('0xf')](util[_0x5832('0x10')](_0x5832('0x11'),_0x5b8ed3[_0x5832('0x4')]),_0x5b8ed3);utils['info'](util['format'](_0x5832('0x12'),_0x5b8ed3[_0x5832('0x4')],_0x5b8ed3[_0x5832('0x6')],_0x5b8ed3[_0x5832('0x13')]));queues[_0x5b8ed3['uniqueid']]=_[_0x5832('0x14')](_0x5b8ed3,{'originalposition':_0x5b8ed3[_0x5832('0x13')],'queuecallerjoinAt':utils[_0x5832('0x15')](),'mohtime':0x0});}catch(_0x15ef7f){utils['error'](util[_0x5832('0x10')](_0x5832('0x11'),_0x5b8ed3[_0x5832('0x4')]),_0x15ef7f);}};exports['hangup']=function(_0x32d360){try{if(!_[_0x5832('0x16')](queues[_0x32d360[_0x5832('0x4')]])){utils[_0x5832('0xf')](util[_0x5832('0x10')](_0x5832('0x17'),_0x32d360[_0x5832('0x4')]),_0x32d360);if(queues[_0x32d360[_0x5832('0x4')]][_0x5832('0x18')]){if(!queues[_0x32d360[_0x5832('0x4')]]['queuecallerabandon']&&!queues[_0x32d360[_0x5832('0x4')]]['queuecallerexit']){queues[_0x32d360['uniqueid']]['queuecallercomplete']=!![];queues[_0x32d360[_0x5832('0x4')]]['queuecallercompleteAt']=utils['now']();queues[_0x32d360['uniqueid']]['queuecallerexitreason']=_0x5832('0x19');}utils['info'](util['format'](_0x5832('0x1a'),_0x32d360['uniqueid'],queues[_0x32d360[_0x5832('0x4')]]['name'],queues[_0x32d360['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x32d360[_0x5832('0x4')]]);}else if(queues[_0x32d360[_0x5832('0x4')]][_0x5832('0xe')]){utils[_0x5832('0x2')](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x32d360[_0x5832('0x4')],queues[_0x32d360[_0x5832('0x4')]]['name'],queues[_0x32d360[_0x5832('0x4')]][_0x5832('0xe')]));queues[queues[_0x32d360['uniqueid']][_0x5832('0xe')]]=queues[_0x32d360[_0x5832('0x4')]];queues[queues[_0x32d360[_0x5832('0x4')]][_0x5832('0xe')]][_0x5832('0x1b')]=0x2;delete queues[_0x32d360[_0x5832('0x4')]];}}}catch(_0x301444){utils[_0x5832('0x1c')](util[_0x5832('0x10')](_0x5832('0x17'),_0x32d360[_0x5832('0x4')]),_0x301444);}};exports['varset']=function(_0x1bfef0){try{utils[_0x5832('0xf')](util[_0x5832('0x10')]('[%s][queues][varset]',_0x1bfef0[_0x5832('0x4')]),_0x1bfef0);if(!_['isNil'](_0x1bfef0['variable'][_0x5832('0x1d')])&&_0x1bfef0[_0x5832('0x1e')][_0x5832('0x1f')]()!==_0x5832('0x20')){if(!_['isNil'](queues[_0x1bfef0[_0x5832('0x4')]])){queues[_0x1bfef0['uniqueid']][_0x5832('0x21')]=![];queues[_0x1bfef0[_0x5832('0x4')]][_0x5832('0x22')]=null;queues[_0x1bfef0[_0x5832('0x4')]][_0x5832('0x23')]=!![];queues[_0x1bfef0[_0x5832('0x4')]]['queuecallerexitAt']=utils[_0x5832('0x15')]();queues[_0x1bfef0['uniqueid']]['queuecallerexitreason']=_0x1bfef0[_0x5832('0x1e')][_0x5832('0x1f')]();utils[_0x5832('0x2')](util[_0x5832('0x10')](_0x5832('0x24'),_0x1bfef0[_0x5832('0x4')],queues[_0x1bfef0[_0x5832('0x4')]][_0x5832('0x25')],_0x1bfef0['value'],queues[_0x1bfef0[_0x5832('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x1bfef0[_0x5832('0x4')]]);}}else if(!_[_0x5832('0x16')](_0x1bfef0[_0x5832('0x26')][_0x5832('0x27')])){if(!_['isNil'](queues[_0x1bfef0[_0x5832('0x4')]])&&!queues[_0x1bfef0[_0x5832('0x4')]][_0x5832('0x21')]){queues[_0x1bfef0[_0x5832('0x4')]][_0x5832('0x21')]=![];queues[_0x1bfef0[_0x5832('0x4')]][_0x5832('0x22')]=null;queues[_0x1bfef0[_0x5832('0x4')]]['queuecallerexit']=!![];queues[_0x1bfef0['uniqueid']][_0x5832('0x28')]=utils['now']();queues[_0x1bfef0[_0x5832('0x4')]][_0x5832('0x8')]=_0x5832('0x29');utils[_0x5832('0x2')](util[_0x5832('0x10')](_0x5832('0x2a'),_0x1bfef0['uniqueid'],queues[_0x1bfef0[_0x5832('0x4')]]['name'],_0x1bfef0['value'],queues[_0x1bfef0['uniqueid']][_0x5832('0x8')]));}}}catch(_0x188632){utils['error'](util[_0x5832('0x10')](_0x5832('0x2b'),_0x1bfef0[_0x5832('0x4')]),_0x188632);}};exports['queuecallerabandon']=function(_0x182841){try{if(!_['isNil'](queues[_0x182841[_0x5832('0x4')]])){utils[_0x5832('0xf')](util[_0x5832('0x10')](_0x5832('0x2c'),_0x182841['uniqueid']),_0x182841);queues[_0x182841[_0x5832('0x4')]]['queuecallerexit']=![];queues[_0x182841[_0x5832('0x4')]][_0x5832('0x28')]=null;queues[_0x182841['uniqueid']][_0x5832('0x21')]=!![];queues[_0x182841['uniqueid']][_0x5832('0x22')]=utils['now']();queues[_0x182841[_0x5832('0x4')]][_0x5832('0x8')]=_0x5832('0x2d');utils['info'](util[_0x5832('0x10')](_0x5832('0x2e'),_0x182841[_0x5832('0x4')],queues[_0x182841[_0x5832('0x4')]][_0x5832('0x25')],queues[_0x182841['uniqueid']][_0x5832('0x8')]));}}catch(_0x1e5900){utils[_0x5832('0x1c')](util['format'](_0x5832('0x2c'),_0x182841[_0x5832('0x4')]),_0x1e5900);}};exports[_0x5832('0x2f')]=function(_0x5c6df6){try{if(!_['isNil'](queues[_0x5c6df6[_0x5832('0x4')]])){utils[_0x5832('0xf')](util[_0x5832('0x10')](_0x5832('0x30'),_0x5c6df6[_0x5832('0x4')]),_0x5c6df6);utils['info'](util['format'](_0x5832('0x31'),_0x5c6df6['uniqueid'],queues[_0x5c6df6['uniqueid']][_0x5832('0x25')],_0x5c6df6['connectedlinenum'],_0x5c6df6['connectedlinename']));queues[_0x5c6df6[_0x5832('0x4')]]['queuecallerleave']=!![];queues[_0x5c6df6[_0x5832('0x4')]][_0x5832('0x18')]=utils[_0x5832('0x15')]();queues[_0x5c6df6[_0x5832('0x4')]][_0x5832('0x32')]=utils['diffTime'](queues[_0x5c6df6[_0x5832('0x4')]]['queuecallerleaveAt'],queues[_0x5c6df6[_0x5832('0x4')]][_0x5832('0x33')]);queues[_0x5c6df6['uniqueid']][_0x5832('0x13')]=_0x5c6df6[_0x5832('0x13')];queues[_0x5c6df6[_0x5832('0x4')]][_0x5832('0x34')]=_0x5c6df6[_0x5832('0x34')];queues[_0x5c6df6[_0x5832('0x4')]]['connectedlinenum']=_0x5c6df6['connectedlinenum'];queues[_0x5c6df6[_0x5832('0x4')]][_0x5832('0x35')]=_0x5c6df6[_0x5832('0x35')];}}catch(_0x43300b){utils[_0x5832('0x1c')](util[_0x5832('0x10')]('[%s][queues][queuecallerleave]',_0x5c6df6['uniqueid']),_0x43300b);}};exports['agentconnect']=function(_0x595b09){try{if(!_[_0x5832('0x16')](queues[_0x595b09[_0x5832('0x4')]])){utils[_0x5832('0xf')](util[_0x5832('0x10')](_0x5832('0x36'),_0x595b09['uniqueid']),_0x595b09);utils['info'](util[_0x5832('0x10')](_0x5832('0x37'),_0x595b09['uniqueid'],queues[_0x595b09[_0x5832('0x4')]][_0x5832('0x25')],_0x595b09[_0x5832('0x38')],_0x595b09[_0x5832('0x39')]));queues[_0x595b09[_0x5832('0x4')]][_0x5832('0x21')]=![];queues[_0x595b09[_0x5832('0x4')]][_0x5832('0x21')]=![];queues[_0x595b09[_0x5832('0x4')]][_0x5832('0x22')]=null;queues[_0x595b09[_0x5832('0x4')]][_0x5832('0x23')]=![];queues[_0x595b09['uniqueid']]['queuecallerexitreason']=null;queues[_0x595b09[_0x5832('0x4')]][_0x5832('0x28')]=null;queues[_0x595b09[_0x5832('0x4')]][_0x5832('0x3a')]=!![];queues[_0x595b09['uniqueid']][_0x5832('0x7')]=_0x595b09[_0x5832('0x39')];queues[_0x595b09[_0x5832('0x4')]][_0x5832('0x3b')]=_0x595b09[_0x5832('0x38')];}}catch(_0x3a85c9){utils['error'](util[_0x5832('0x10')](_0x5832('0x36'),_0x595b09['uniqueid']),_0x3a85c9);}};exports[_0x5832('0x3c')]=function(_0x3a1d49){try{if(!_['isNil'](queues[_0x3a1d49[_0x5832('0x4')]])){if(queues[_0x3a1d49[_0x5832('0x4')]][_0x5832('0x18')]){utils[_0x5832('0xf')](util[_0x5832('0x10')](_0x5832('0x3d'),_0x3a1d49[_0x5832('0x4')]),_0x3a1d49);queues[_0x3a1d49[_0x5832('0x4')]][_0x5832('0x21')]=![];queues[_0x3a1d49[_0x5832('0x4')]][_0x5832('0x21')]=![];queues[_0x3a1d49['uniqueid']][_0x5832('0x22')]=null;queues[_0x3a1d49[_0x5832('0x4')]][_0x5832('0x23')]=![];queues[_0x3a1d49[_0x5832('0x4')]][_0x5832('0x28')]=null;queues[_0x3a1d49[_0x5832('0x4')]][_0x5832('0x3a')]=!![];queues[_0x3a1d49[_0x5832('0x4')]]['lastAssignedTo']=_0x3a1d49[_0x5832('0x38')];queues[_0x3a1d49['uniqueid']][_0x5832('0x3e')]=!![];queues[_0x3a1d49['uniqueid']]['queuecallercompleteAt']=utils['now']();if(_0x3a1d49[_0x5832('0x3f')]==_0x5832('0x40')){if(!queues[_0x3a1d49[_0x5832('0x4')]][_0x5832('0x40')]){queues[_0x3a1d49[_0x5832('0x4')]]['queuecallerexitreason']=_0x5832('0x41');}}else{queues[_0x3a1d49['uniqueid']]['queuecallerexitreason']='COMPLETEDBY'+_0x3a1d49[_0x5832('0x3f')][_0x5832('0x1f')]();}utils[_0x5832('0x2')](util[_0x5832('0x10')](_0x5832('0x42'),_0x3a1d49[_0x5832('0x4')],queues[_0x3a1d49[_0x5832('0x4')]]['name'],_0x3a1d49[_0x5832('0x38')],queues[_0x3a1d49[_0x5832('0x4')]][_0x5832('0x8')]));writeDB(queues[_0x3a1d49[_0x5832('0x4')]]);}}}catch(_0x4dff6b){utils[_0x5832('0x1c')](util[_0x5832('0x10')](_0x5832('0x3d'),_0x3a1d49[_0x5832('0x4')]),_0x4dff6b);}};exports[_0x5832('0x43')]=function(_0x39f9b3){try{if(!_[_0x5832('0x16')](queues[_0x39f9b3[_0x5832('0x44')]])){utils[_0x5832('0xf')](util[_0x5832('0x10')]('[%s][queues][blindtransfer]',_0x39f9b3[_0x5832('0x4')]),_0x39f9b3);queues[_0x39f9b3[_0x5832('0x44')]]['transfer']=!![];queues[_0x39f9b3[_0x5832('0x44')]][_0x5832('0x45')]='BLIND';queues[_0x39f9b3[_0x5832('0x44')]][_0x5832('0x46')]=_0x39f9b3[_0x5832('0x47')];queues[_0x39f9b3[_0x5832('0x44')]][_0x5832('0x48')]=_0x39f9b3['transfereeuniqueid'];queues[_0x39f9b3['transfereeuniqueid']][_0x5832('0x8')]='BLINDTRANSFER';utils['info'](util[_0x5832('0x10')](_0x5832('0x49'),_0x39f9b3[_0x5832('0x4')],queues[_0x39f9b3[_0x5832('0x44')]]['name'],_0x39f9b3[_0x5832('0x44')],_0x39f9b3['extension']));}}catch(_0x25d2ea){utils[_0x5832('0x1c')](util['format'](_0x5832('0x4a'),_0x39f9b3[_0x5832('0x4')]),_0x25d2ea);}};exports[_0x5832('0x4b')]=function(_0x4d32ef){try{utils[_0x5832('0xf')](util[_0x5832('0x10')](_0x5832('0x4c'),_0x4d32ef['origtransfereruniqueid']),_0x4d32ef);if(_0x4d32ef[_0x5832('0x4d')]==_0x4d32ef[_0x5832('0x4e')]){if(!_[_0x5832('0x16')](queues[_0x4d32ef[_0x5832('0x4f')]])){utils[_0x5832('0x2')](util[_0x5832('0x10')](_0x5832('0x50'),_0x4d32ef[_0x5832('0x4d')],queues[_0x4d32ef['secondtransfererlinkedid']]['name'],_0x4d32ef[_0x5832('0x51')]));queues[_0x4d32ef[_0x5832('0x4f')]][_0x5832('0x40')]=!![];queues[_0x4d32ef['secondtransfererlinkedid']][_0x5832('0x45')]=_0x5832('0x52');queues[_0x4d32ef[_0x5832('0x4f')]][_0x5832('0x46')]=_0x4d32ef['origtransfererexten'];queues[_0x4d32ef[_0x5832('0x4f')]]['transferuniqueid']=_0x4d32ef[_0x5832('0x4d')];queues[_0x4d32ef[_0x5832('0x4f')]]['queuecallerexitreason']=_0x5832('0x53');}if(!_[_0x5832('0x16')](queues[_0x4d32ef['origtransfererlinkedid']])){if(_0x4d32ef[_0x5832('0x54')]&&queues[_0x4d32ef[_0x5832('0x54')]]){queues[_0x4d32ef[_0x5832('0x54')]]['queuecallerenterreason']=0x1;queues[_0x4d32ef[_0x5832('0x44')]]=_[_0x5832('0x55')](queues[_0x4d32ef[_0x5832('0x54')]]);queues[_0x4d32ef[_0x5832('0x44')]][_0x5832('0xe')]=_0x4d32ef[_0x5832('0x56')];queues[_0x4d32ef[_0x5832('0x44')]]['queuecallerenterreason']=0x2;queues[_0x4d32ef['transfereeuniqueid']][_0x5832('0x57')]=queues[_0x4d32ef[_0x5832('0x4f')]]['calleridnum'];queues[_0x4d32ef['transfereeuniqueid']]['calleridname']=queues[_0x4d32ef[_0x5832('0x4f')]][_0x5832('0x58')];queues[_0x4d32ef[_0x5832('0x44')]][_0x5832('0x33')]=utils['now']();queues[_0x4d32ef[_0x5832('0x44')]]['queuecallerleaveAt']=utils['now']();queues[_0x4d32ef[_0x5832('0x44')]][_0x5832('0x32')]=0x0;queues[_0x4d32ef[_0x5832('0x44')]][_0x5832('0x59')]=0x0;utils[_0x5832('0x2')](util['format'](_0x5832('0x5a'),_0x4d32ef['origtransfereruniqueid'],queues[_0x4d32ef[_0x5832('0x44')]][_0x5832('0x25')],queues[_0x4d32ef[_0x5832('0x44')]][_0x5832('0x57')],queues[_0x4d32ef[_0x5832('0x44')]]['calleridname']));}else{utils[_0x5832('0x2')](util[_0x5832('0x10')](_0x5832('0x5b'),_0x4d32ef[_0x5832('0x4d')],queues[_0x4d32ef[_0x5832('0x4e')]]['name'],_0x4d32ef[_0x5832('0x4f')]));queues[_0x4d32ef[_0x5832('0x4e')]][_0x5832('0xe')]=_0x4d32ef[_0x5832('0x4f')];}}}else if(_0x4d32ef['secondtransfereruniqueid']==_0x4d32ef[_0x5832('0x4f')]){if(!_['isNil'](queues[_0x4d32ef[_0x5832('0x4e')]])){utils[_0x5832('0x2')](util[_0x5832('0x10')](_0x5832('0x5c'),_0x4d32ef[_0x5832('0x4d')],queues[_0x4d32ef['origtransfererlinkedid']][_0x5832('0x25')],_0x4d32ef['secondtransfereruniqueid'],_0x4d32ef[_0x5832('0x5d')]));queues[_0x4d32ef[_0x5832('0x4e')]][_0x5832('0x40')]=!![];queues[_0x4d32ef[_0x5832('0x4e')]][_0x5832('0x45')]=_0x5832('0x52');queues[_0x4d32ef[_0x5832('0x4e')]][_0x5832('0x46')]=_0x4d32ef[_0x5832('0x5d')];queues[_0x4d32ef[_0x5832('0x4e')]][_0x5832('0x48')]=_0x4d32ef[_0x5832('0x5e')];queues[_0x4d32ef[_0x5832('0x4e')]][_0x5832('0x8')]=_0x5832('0x53');}if(!_[_0x5832('0x16')](queues[_0x4d32ef[_0x5832('0x4f')]])){if(_0x4d32ef[_0x5832('0x5f')]&&queues[_0x4d32ef[_0x5832('0x5f')]]){queues[_0x4d32ef[_0x5832('0x5f')]][_0x5832('0x1b')]=0x1;queues[_0x4d32ef[_0x5832('0x56')]]=_['clone'](queues[_0x4d32ef['transfertargetlinkedid']]);queues[_0x4d32ef['transfertargetuniqueid']][_0x5832('0xe')]=_0x4d32ef[_0x5832('0x56')];queues[_0x4d32ef[_0x5832('0x56')]]['queuecallerenterreason']=0x2;queues[_0x4d32ef[_0x5832('0x56')]][_0x5832('0x57')]=queues[_0x4d32ef[_0x5832('0x4e')]][_0x5832('0x57')];queues[_0x4d32ef['transfertargetuniqueid']]['calleridname']=queues[_0x4d32ef[_0x5832('0x4e')]][_0x5832('0x58')];queues[_0x4d32ef['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0x5832('0x15')]();queues[_0x4d32ef[_0x5832('0x56')]][_0x5832('0x18')]=utils[_0x5832('0x15')]();queues[_0x4d32ef[_0x5832('0x56')]][_0x5832('0x32')]=0x0;queues[_0x4d32ef[_0x5832('0x56')]][_0x5832('0x59')]=0x0;utils['info'](util[_0x5832('0x10')](_0x5832('0x60'),_0x4d32ef[_0x5832('0x4d')],queues[_0x4d32ef[_0x5832('0x56')]][_0x5832('0x25')],queues[_0x4d32ef[_0x5832('0x56')]][_0x5832('0xe')],queues[_0x4d32ef[_0x5832('0x56')]][_0x5832('0x57')],queues[_0x4d32ef[_0x5832('0x56')]][_0x5832('0x58')]));}else{utils[_0x5832('0x2')](util[_0x5832('0x10')](_0x5832('0x5b'),_0x4d32ef['origtransfereruniqueid'],queues[_0x4d32ef[_0x5832('0x4f')]][_0x5832('0x25')],_0x4d32ef[_0x5832('0x4e')]));queues[_0x4d32ef[_0x5832('0x4f')]][_0x5832('0xe')]=_0x4d32ef[_0x5832('0x4e')];}}}}catch(_0x1106e2){utils[_0x5832('0x1c')](util['format'](_0x5832('0x4c'),_0x4d32ef[_0x5832('0x4d')]),_0x1106e2);}};exports['musiconholdstart']=function(_0x5b2baa){try{if(!_[_0x5832('0x16')](queues[_0x5b2baa['uniqueid']])){utils['debug'](util[_0x5832('0x10')]('[%s][queues][musiconholdstart]',_0x5b2baa[_0x5832('0x4')]),_0x5b2baa);queues[_0x5b2baa[_0x5832('0x4')]][_0x5832('0x61')]=utils['now']();utils['info'](util[_0x5832('0x10')](_0x5832('0x62'),_0x5b2baa[_0x5832('0x4')],queues[_0x5b2baa['uniqueid']][_0x5832('0x25')],queues[_0x5b2baa[_0x5832('0x4')]][_0x5832('0x61')]));}}catch(_0x27a1e9){utils[_0x5832('0x1c')](util[_0x5832('0x10')](_0x5832('0x63'),_0x5b2baa[_0x5832('0x4')]),_0x27a1e9);}};exports[_0x5832('0x64')]=function(_0x30ec8a){try{if(!_[_0x5832('0x16')](queues[_0x30ec8a[_0x5832('0x4')]])){if(!_[_0x5832('0x16')](queues[_0x30ec8a[_0x5832('0x4')]]['musiconholdstartAt'])){utils[_0x5832('0xf')](util['format'](_0x5832('0x65'),_0x30ec8a['uniqueid']),_0x30ec8a);queues[_0x30ec8a[_0x5832('0x4')]]['mohtime']+=utils['diffTime'](utils[_0x5832('0x15')](),queues[_0x30ec8a['uniqueid']][_0x5832('0x61')]);utils[_0x5832('0x2')](util['format'](_0x5832('0x66'),_0x30ec8a[_0x5832('0x4')],queues[_0x30ec8a[_0x5832('0x4')]][_0x5832('0x25')],queues[_0x30ec8a['uniqueid']]['mohtime']));delete queues[_0x30ec8a[_0x5832('0x4')]]['musiconholdstartAt'];}}}catch(_0x563224){utils[_0x5832('0x1c')](util[_0x5832('0x10')](_0x5832('0x65'),_0x30ec8a[_0x5832('0x4')]),_0x563224);}}; \ No newline at end of file +var _0xf8f2=['calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','info','assign','position','now','hangup','isNil','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','error','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','[%s][queues][agentconnect]','membername','destaccountcode','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','assigned','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','queuecallerenterreason','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0xf8f2,0xc2));var _0x2f8f=function(_0x1d5fa9,_0xe54e51){_0x1d5fa9=_0x1d5fa9-0x0;var _0x30587d=_0xf8f2[_0x1d5fa9];return _0x30587d;};'use strict';var _=require(_0x2f8f('0x0'));var util=require(_0x2f8f('0x1'));var utils=require(_0x2f8f('0x2'));var queues={};function writeDB(_0xbe501e){utils['info'](util[_0x2f8f('0x3')](_0x2f8f('0x4'),_0xbe501e[_0x2f8f('0x5')],_0xbe501e[_0x2f8f('0x6')],_0xbe501e[_0x2f8f('0x7')],_0xbe501e['lastAssignedTo'],_0xbe501e[_0x2f8f('0x8')],_0xbe501e[_0x2f8f('0x9')],_0xbe501e[_0x2f8f('0xa')]));if(_0xbe501e[_0x2f8f('0x7')]){utils[_0x2f8f('0xb')](_0xbe501e[_0x2f8f('0x7')])[_0x2f8f('0xc')](function(_0x1237d5){if(_0x1237d5){_0xbe501e['type']=_0x1237d5[_0x2f8f('0xd')];}utils[_0x2f8f('0xe')](_0x2f8f('0xf'),_0xbe501e);});}else{utils[_0x2f8f('0xe')]('CreateVoiceQueueReport',_0xbe501e);}if(_0xbe501e[_0x2f8f('0x10')]){delete queues[_0xbe501e[_0x2f8f('0x10')]];}else{delete queues[_0xbe501e['uniqueid']];}}exports[_0x2f8f('0x11')]=function(_0x88dde7){try{utils[_0x2f8f('0x12')](util[_0x2f8f('0x3')]('[%s][queues][queuecallerjoin]',_0x88dde7[_0x2f8f('0x5')]),_0x88dde7);utils[_0x2f8f('0x13')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x88dde7[_0x2f8f('0x5')],_0x88dde7[_0x2f8f('0x7')],_0x88dde7['position']));queues[_0x88dde7[_0x2f8f('0x5')]]=_[_0x2f8f('0x14')](_0x88dde7,{'originalposition':_0x88dde7[_0x2f8f('0x15')],'queuecallerjoinAt':utils[_0x2f8f('0x16')](),'mohtime':0x0});}catch(_0x1e0492){utils['error'](util['format']('[%s][queues][queuecallerjoin]',_0x88dde7['uniqueid']),_0x1e0492);}};exports[_0x2f8f('0x17')]=function(_0xee85bb){try{if(!_[_0x2f8f('0x18')](queues[_0xee85bb[_0x2f8f('0x5')]])){utils[_0x2f8f('0x12')](util['format']('[%s][queues][hangup]',_0xee85bb[_0x2f8f('0x5')]),_0xee85bb);if(queues[_0xee85bb['uniqueid']]['queuecallerleaveAt']){if(!queues[_0xee85bb[_0x2f8f('0x5')]][_0x2f8f('0x19')]&&!queues[_0xee85bb[_0x2f8f('0x5')]][_0x2f8f('0x1a')]){queues[_0xee85bb[_0x2f8f('0x5')]][_0x2f8f('0x1b')]=!![];queues[_0xee85bb[_0x2f8f('0x5')]][_0x2f8f('0x1c')]=utils['now']();queues[_0xee85bb[_0x2f8f('0x5')]][_0x2f8f('0xa')]='COMPLETEDBYAGENT';}utils['info'](util[_0x2f8f('0x3')](_0x2f8f('0x1d'),_0xee85bb[_0x2f8f('0x5')],queues[_0xee85bb[_0x2f8f('0x5')]][_0x2f8f('0x1e')],queues[_0xee85bb[_0x2f8f('0x5')]][_0x2f8f('0xa')]));writeDB(queues[_0xee85bb[_0x2f8f('0x5')]]);}else if(queues[_0xee85bb[_0x2f8f('0x5')]][_0x2f8f('0x10')]){utils[_0x2f8f('0x13')](util[_0x2f8f('0x3')](_0x2f8f('0x1f'),_0xee85bb['uniqueid'],queues[_0xee85bb[_0x2f8f('0x5')]][_0x2f8f('0x1e')],queues[_0xee85bb[_0x2f8f('0x5')]][_0x2f8f('0x10')]));queues[queues[_0xee85bb[_0x2f8f('0x5')]]['transfereduniqueid']]=queues[_0xee85bb[_0x2f8f('0x5')]];queues[queues[_0xee85bb[_0x2f8f('0x5')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0xee85bb['uniqueid']];}}}catch(_0x74d4af){utils['error'](util[_0x2f8f('0x3')](_0x2f8f('0x20'),_0xee85bb[_0x2f8f('0x5')]),_0x74d4af);}};exports[_0x2f8f('0x21')]=function(_0x2ffba2){try{utils[_0x2f8f('0x12')](util[_0x2f8f('0x3')](_0x2f8f('0x22'),_0x2ffba2['uniqueid']),_0x2ffba2);if(!_[_0x2f8f('0x18')](_0x2ffba2[_0x2f8f('0x23')][_0x2f8f('0x24')])&&_0x2ffba2[_0x2f8f('0x25')][_0x2f8f('0x26')]()!==_0x2f8f('0x27')){if(!_[_0x2f8f('0x18')](queues[_0x2ffba2[_0x2f8f('0x5')]])){queues[_0x2ffba2[_0x2f8f('0x5')]]['queuecallerabandon']=![];queues[_0x2ffba2[_0x2f8f('0x5')]][_0x2f8f('0x28')]=null;queues[_0x2ffba2[_0x2f8f('0x5')]][_0x2f8f('0x1a')]=!![];queues[_0x2ffba2['uniqueid']][_0x2f8f('0x29')]=utils[_0x2f8f('0x16')]();queues[_0x2ffba2[_0x2f8f('0x5')]][_0x2f8f('0xa')]=_0x2ffba2[_0x2f8f('0x25')][_0x2f8f('0x26')]();utils['info'](util[_0x2f8f('0x3')](_0x2f8f('0x2a'),_0x2ffba2[_0x2f8f('0x5')],queues[_0x2ffba2[_0x2f8f('0x5')]][_0x2f8f('0x1e')],_0x2ffba2[_0x2f8f('0x25')],queues[_0x2ffba2['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x2ffba2['uniqueid']]);}}else if(!_['isNil'](_0x2ffba2[_0x2f8f('0x23')][_0x2f8f('0x2b')])){if(!_[_0x2f8f('0x18')](queues[_0x2ffba2[_0x2f8f('0x5')]])&&!queues[_0x2ffba2[_0x2f8f('0x5')]][_0x2f8f('0x19')]){queues[_0x2ffba2[_0x2f8f('0x5')]]['queuecallerabandon']=![];queues[_0x2ffba2[_0x2f8f('0x5')]][_0x2f8f('0x28')]=null;queues[_0x2ffba2[_0x2f8f('0x5')]][_0x2f8f('0x1a')]=!![];queues[_0x2ffba2['uniqueid']][_0x2f8f('0x29')]=utils['now']();queues[_0x2ffba2['uniqueid']]['queuecallerexitreason']=_0x2f8f('0x2c');utils[_0x2f8f('0x13')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x2ffba2[_0x2f8f('0x5')],queues[_0x2ffba2['uniqueid']][_0x2f8f('0x1e')],_0x2ffba2['value'],queues[_0x2ffba2['uniqueid']][_0x2f8f('0xa')]));}}}catch(_0x57654c){utils['error'](util[_0x2f8f('0x3')](_0x2f8f('0x22'),_0x2ffba2[_0x2f8f('0x5')]),_0x57654c);}};exports['queuecallerabandon']=function(_0x3ca3d3){try{if(!_[_0x2f8f('0x18')](queues[_0x3ca3d3[_0x2f8f('0x5')]])){utils[_0x2f8f('0x12')](util[_0x2f8f('0x3')](_0x2f8f('0x2d'),_0x3ca3d3[_0x2f8f('0x5')]),_0x3ca3d3);queues[_0x3ca3d3[_0x2f8f('0x5')]][_0x2f8f('0x1a')]=![];queues[_0x3ca3d3[_0x2f8f('0x5')]]['queuecallerexitAt']=null;queues[_0x3ca3d3[_0x2f8f('0x5')]]['queuecallerabandon']=!![];queues[_0x3ca3d3['uniqueid']][_0x2f8f('0x28')]=utils['now']();queues[_0x3ca3d3['uniqueid']][_0x2f8f('0xa')]='ABANDONED';utils[_0x2f8f('0x13')](util[_0x2f8f('0x3')](_0x2f8f('0x2e'),_0x3ca3d3[_0x2f8f('0x5')],queues[_0x3ca3d3[_0x2f8f('0x5')]][_0x2f8f('0x1e')],queues[_0x3ca3d3[_0x2f8f('0x5')]][_0x2f8f('0xa')]));}}catch(_0x2629eb){utils[_0x2f8f('0x2f')](util[_0x2f8f('0x3')](_0x2f8f('0x2d'),_0x3ca3d3[_0x2f8f('0x5')]),_0x2629eb);}};exports[_0x2f8f('0x30')]=function(_0x2b0b76){try{if(!_[_0x2f8f('0x18')](queues[_0x2b0b76[_0x2f8f('0x5')]])){utils[_0x2f8f('0x12')](util[_0x2f8f('0x3')](_0x2f8f('0x31'),_0x2b0b76[_0x2f8f('0x5')]),_0x2b0b76);utils[_0x2f8f('0x13')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2b0b76[_0x2f8f('0x5')],queues[_0x2b0b76['uniqueid']][_0x2f8f('0x1e')],_0x2b0b76[_0x2f8f('0x32')],_0x2b0b76['connectedlinename']));queues[_0x2b0b76['uniqueid']]['queuecallerleave']=!![];queues[_0x2b0b76[_0x2f8f('0x5')]][_0x2f8f('0x33')]=utils[_0x2f8f('0x16')]();queues[_0x2b0b76['uniqueid']][_0x2f8f('0x34')]=utils[_0x2f8f('0x35')](queues[_0x2b0b76[_0x2f8f('0x5')]][_0x2f8f('0x33')],queues[_0x2b0b76[_0x2f8f('0x5')]][_0x2f8f('0x36')]);queues[_0x2b0b76['uniqueid']]['position']=_0x2b0b76['position'];queues[_0x2b0b76[_0x2f8f('0x5')]][_0x2f8f('0x37')]=_0x2b0b76[_0x2f8f('0x37')];queues[_0x2b0b76[_0x2f8f('0x5')]][_0x2f8f('0x32')]=_0x2b0b76[_0x2f8f('0x32')];queues[_0x2b0b76[_0x2f8f('0x5')]][_0x2f8f('0x38')]=_0x2b0b76[_0x2f8f('0x38')];}}catch(_0x34bcdc){utils[_0x2f8f('0x2f')](util[_0x2f8f('0x3')](_0x2f8f('0x31'),_0x2b0b76[_0x2f8f('0x5')]),_0x34bcdc);}};exports['agentconnect']=function(_0x3e12bb){try{if(!_['isNil'](queues[_0x3e12bb['uniqueid']])){utils[_0x2f8f('0x12')](util[_0x2f8f('0x3')](_0x2f8f('0x39'),_0x3e12bb[_0x2f8f('0x5')]),_0x3e12bb);utils['info'](util[_0x2f8f('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x3e12bb[_0x2f8f('0x5')],queues[_0x3e12bb['uniqueid']][_0x2f8f('0x1e')],_0x3e12bb[_0x2f8f('0x3a')],_0x3e12bb[_0x2f8f('0x3b')]));queues[_0x3e12bb[_0x2f8f('0x5')]][_0x2f8f('0x19')]=![];queues[_0x3e12bb['uniqueid']]['queuecallerabandon']=![];queues[_0x3e12bb['uniqueid']][_0x2f8f('0x28')]=null;queues[_0x3e12bb[_0x2f8f('0x5')]][_0x2f8f('0x1a')]=![];queues[_0x3e12bb[_0x2f8f('0x5')]][_0x2f8f('0xa')]=null;queues[_0x3e12bb[_0x2f8f('0x5')]]['queuecallerexitAt']=null;queues[_0x3e12bb[_0x2f8f('0x5')]]['assigned']=!![];queues[_0x3e12bb[_0x2f8f('0x5')]]['accountcode']=_0x3e12bb[_0x2f8f('0x3b')];queues[_0x3e12bb[_0x2f8f('0x5')]][_0x2f8f('0x3c')]=_0x3e12bb['membername'];}}catch(_0x1391a5){utils[_0x2f8f('0x2f')](util[_0x2f8f('0x3')]('[%s][queues][agentconnect]',_0x3e12bb[_0x2f8f('0x5')]),_0x1391a5);}};exports[_0x2f8f('0x3d')]=function(_0x41647b){try{if(!_[_0x2f8f('0x18')](queues[_0x41647b[_0x2f8f('0x5')]])){if(queues[_0x41647b[_0x2f8f('0x5')]][_0x2f8f('0x33')]){utils[_0x2f8f('0x12')](util['format'](_0x2f8f('0x3e'),_0x41647b[_0x2f8f('0x5')]),_0x41647b);queues[_0x41647b['uniqueid']]['queuecallerabandon']=![];queues[_0x41647b[_0x2f8f('0x5')]]['queuecallerabandon']=![];queues[_0x41647b[_0x2f8f('0x5')]][_0x2f8f('0x28')]=null;queues[_0x41647b['uniqueid']][_0x2f8f('0x1a')]=![];queues[_0x41647b[_0x2f8f('0x5')]][_0x2f8f('0x29')]=null;queues[_0x41647b[_0x2f8f('0x5')]][_0x2f8f('0x3f')]=!![];queues[_0x41647b[_0x2f8f('0x5')]][_0x2f8f('0x3c')]=_0x41647b[_0x2f8f('0x3a')];queues[_0x41647b[_0x2f8f('0x5')]][_0x2f8f('0x1b')]=!![];queues[_0x41647b[_0x2f8f('0x5')]][_0x2f8f('0x1c')]=utils[_0x2f8f('0x16')]();if(_0x41647b[_0x2f8f('0x40')]==_0x2f8f('0x41')){if(!queues[_0x41647b[_0x2f8f('0x5')]][_0x2f8f('0x41')]){queues[_0x41647b[_0x2f8f('0x5')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x41647b['uniqueid']]['queuecallerexitreason']=_0x2f8f('0x42')+_0x41647b[_0x2f8f('0x40')][_0x2f8f('0x26')]();}utils[_0x2f8f('0x13')](util['format'](_0x2f8f('0x43'),_0x41647b[_0x2f8f('0x5')],queues[_0x41647b[_0x2f8f('0x5')]][_0x2f8f('0x1e')],_0x41647b['membername'],queues[_0x41647b[_0x2f8f('0x5')]][_0x2f8f('0xa')]));writeDB(queues[_0x41647b['uniqueid']]);}}}catch(_0x5925a2){utils[_0x2f8f('0x2f')](util[_0x2f8f('0x3')](_0x2f8f('0x3e'),_0x41647b['uniqueid']),_0x5925a2);}};exports['blindtransfer']=function(_0x273bfe){try{if(!_[_0x2f8f('0x18')](queues[_0x273bfe[_0x2f8f('0x44')]])){utils[_0x2f8f('0x12')](util[_0x2f8f('0x3')]('[%s][queues][blindtransfer]',_0x273bfe[_0x2f8f('0x5')]),_0x273bfe);queues[_0x273bfe['transfereeuniqueid']][_0x2f8f('0x41')]=!![];queues[_0x273bfe[_0x2f8f('0x44')]][_0x2f8f('0x45')]='BLIND';queues[_0x273bfe[_0x2f8f('0x44')]][_0x2f8f('0x46')]=_0x273bfe[_0x2f8f('0x47')];queues[_0x273bfe['transfereeuniqueid']][_0x2f8f('0x48')]=_0x273bfe['transfereeuniqueid'];queues[_0x273bfe[_0x2f8f('0x44')]][_0x2f8f('0xa')]=_0x2f8f('0x49');utils[_0x2f8f('0x13')](util[_0x2f8f('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x273bfe[_0x2f8f('0x5')],queues[_0x273bfe[_0x2f8f('0x44')]][_0x2f8f('0x1e')],_0x273bfe[_0x2f8f('0x44')],_0x273bfe[_0x2f8f('0x47')]));}}catch(_0x232b5d){utils[_0x2f8f('0x2f')](util[_0x2f8f('0x3')]('[%s][queues][blindtransfer]',_0x273bfe['uniqueid']),_0x232b5d);}};exports[_0x2f8f('0x4a')]=function(_0x2853b7){try{utils['debug'](util[_0x2f8f('0x3')](_0x2f8f('0x4b'),_0x2853b7[_0x2f8f('0x4c')]),_0x2853b7);if(_0x2853b7[_0x2f8f('0x4c')]==_0x2853b7['origtransfererlinkedid']){if(!_[_0x2f8f('0x18')](queues[_0x2853b7[_0x2f8f('0x4d')]])){utils[_0x2f8f('0x13')](util[_0x2f8f('0x3')](_0x2f8f('0x4e'),_0x2853b7[_0x2f8f('0x4c')],queues[_0x2853b7[_0x2f8f('0x4d')]][_0x2f8f('0x1e')],_0x2853b7[_0x2f8f('0x4f')]));queues[_0x2853b7[_0x2f8f('0x4d')]]['transfer']=!![];queues[_0x2853b7['secondtransfererlinkedid']][_0x2f8f('0x45')]='ATTENDED';queues[_0x2853b7[_0x2f8f('0x4d')]]['transferexten']=_0x2853b7[_0x2f8f('0x4f')];queues[_0x2853b7['secondtransfererlinkedid']][_0x2f8f('0x48')]=_0x2853b7[_0x2f8f('0x4c')];queues[_0x2853b7[_0x2f8f('0x4d')]]['queuecallerexitreason']=_0x2f8f('0x50');}if(!_[_0x2f8f('0x18')](queues[_0x2853b7[_0x2f8f('0x51')]])){if(_0x2853b7[_0x2f8f('0x52')]&&queues[_0x2853b7['transfereelinkedid']]){queues[_0x2853b7['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x2853b7['transfereeuniqueid']]=_[_0x2f8f('0x53')](queues[_0x2853b7[_0x2f8f('0x52')]]);queues[_0x2853b7['transfereeuniqueid']][_0x2f8f('0x10')]=_0x2853b7[_0x2f8f('0x54')];queues[_0x2853b7['transfereeuniqueid']][_0x2f8f('0x55')]=0x2;queues[_0x2853b7[_0x2f8f('0x44')]][_0x2f8f('0x8')]=queues[_0x2853b7[_0x2f8f('0x4d')]]['calleridnum'];queues[_0x2853b7[_0x2f8f('0x44')]][_0x2f8f('0x56')]=queues[_0x2853b7[_0x2f8f('0x4d')]][_0x2f8f('0x56')];queues[_0x2853b7[_0x2f8f('0x44')]]['queuecallerjoinAt']=utils[_0x2f8f('0x16')]();queues[_0x2853b7['transfereeuniqueid']][_0x2f8f('0x33')]=utils[_0x2f8f('0x16')]();queues[_0x2853b7['transfereeuniqueid']][_0x2f8f('0x34')]=0x0;queues[_0x2853b7['transfereeuniqueid']]['mohtime']=0x0;utils[_0x2f8f('0x13')](util['format'](_0x2f8f('0x57'),_0x2853b7[_0x2f8f('0x4c')],queues[_0x2853b7[_0x2f8f('0x44')]][_0x2f8f('0x1e')],queues[_0x2853b7[_0x2f8f('0x44')]]['calleridnum'],queues[_0x2853b7[_0x2f8f('0x44')]][_0x2f8f('0x56')]));}else{utils[_0x2f8f('0x13')](util['format'](_0x2f8f('0x58'),_0x2853b7[_0x2f8f('0x4c')],queues[_0x2853b7[_0x2f8f('0x51')]][_0x2f8f('0x1e')],_0x2853b7[_0x2f8f('0x4d')]));queues[_0x2853b7[_0x2f8f('0x51')]][_0x2f8f('0x10')]=_0x2853b7[_0x2f8f('0x4d')];}}}else if(_0x2853b7[_0x2f8f('0x59')]==_0x2853b7[_0x2f8f('0x4d')]){if(!_[_0x2f8f('0x18')](queues[_0x2853b7[_0x2f8f('0x51')]])){utils['info'](util[_0x2f8f('0x3')](_0x2f8f('0x5a'),_0x2853b7[_0x2f8f('0x4c')],queues[_0x2853b7[_0x2f8f('0x51')]][_0x2f8f('0x1e')],_0x2853b7[_0x2f8f('0x59')],_0x2853b7['secondtransfererexten']));queues[_0x2853b7[_0x2f8f('0x51')]][_0x2f8f('0x41')]=!![];queues[_0x2853b7[_0x2f8f('0x51')]][_0x2f8f('0x45')]='ATTENDED';queues[_0x2853b7[_0x2f8f('0x51')]]['transferexten']=_0x2853b7[_0x2f8f('0x5b')];queues[_0x2853b7['origtransfererlinkedid']][_0x2f8f('0x48')]=_0x2853b7[_0x2f8f('0x59')];queues[_0x2853b7['origtransfererlinkedid']]['queuecallerexitreason']=_0x2f8f('0x50');}if(!_[_0x2f8f('0x18')](queues[_0x2853b7[_0x2f8f('0x4d')]])){if(_0x2853b7[_0x2f8f('0x5c')]&&queues[_0x2853b7[_0x2f8f('0x5c')]]){queues[_0x2853b7[_0x2f8f('0x5c')]][_0x2f8f('0x55')]=0x1;queues[_0x2853b7[_0x2f8f('0x54')]]=_['clone'](queues[_0x2853b7[_0x2f8f('0x5c')]]);queues[_0x2853b7['transfertargetuniqueid']][_0x2f8f('0x10')]=_0x2853b7[_0x2f8f('0x54')];queues[_0x2853b7['transfertargetuniqueid']][_0x2f8f('0x55')]=0x2;queues[_0x2853b7[_0x2f8f('0x54')]][_0x2f8f('0x8')]=queues[_0x2853b7[_0x2f8f('0x51')]][_0x2f8f('0x8')];queues[_0x2853b7[_0x2f8f('0x54')]]['calleridname']=queues[_0x2853b7[_0x2f8f('0x51')]]['calleridname'];queues[_0x2853b7[_0x2f8f('0x54')]][_0x2f8f('0x36')]=utils[_0x2f8f('0x16')]();queues[_0x2853b7[_0x2f8f('0x54')]][_0x2f8f('0x33')]=utils[_0x2f8f('0x16')]();queues[_0x2853b7[_0x2f8f('0x54')]][_0x2f8f('0x34')]=0x0;queues[_0x2853b7[_0x2f8f('0x54')]][_0x2f8f('0x5d')]=0x0;utils[_0x2f8f('0x13')](util[_0x2f8f('0x3')](_0x2f8f('0x5e'),_0x2853b7[_0x2f8f('0x4c')],queues[_0x2853b7['transfertargetuniqueid']][_0x2f8f('0x1e')],queues[_0x2853b7[_0x2f8f('0x54')]][_0x2f8f('0x10')],queues[_0x2853b7[_0x2f8f('0x54')]]['calleridnum'],queues[_0x2853b7[_0x2f8f('0x54')]][_0x2f8f('0x56')]));}else{utils[_0x2f8f('0x13')](util[_0x2f8f('0x3')](_0x2f8f('0x58'),_0x2853b7[_0x2f8f('0x4c')],queues[_0x2853b7['secondtransfererlinkedid']][_0x2f8f('0x1e')],_0x2853b7[_0x2f8f('0x51')]));queues[_0x2853b7['secondtransfererlinkedid']][_0x2f8f('0x10')]=_0x2853b7['origtransfererlinkedid'];}}}}catch(_0x3a39c9){utils[_0x2f8f('0x2f')](util[_0x2f8f('0x3')](_0x2f8f('0x4b'),_0x2853b7['origtransfereruniqueid']),_0x3a39c9);}};exports[_0x2f8f('0x5f')]=function(_0x53d4d2){try{if(!_[_0x2f8f('0x18')](queues[_0x53d4d2[_0x2f8f('0x5')]])){utils[_0x2f8f('0x12')](util[_0x2f8f('0x3')](_0x2f8f('0x60'),_0x53d4d2[_0x2f8f('0x5')]),_0x53d4d2);queues[_0x53d4d2[_0x2f8f('0x5')]][_0x2f8f('0x61')]=utils[_0x2f8f('0x16')]();utils['info'](util[_0x2f8f('0x3')](_0x2f8f('0x62'),_0x53d4d2[_0x2f8f('0x5')],queues[_0x53d4d2[_0x2f8f('0x5')]]['name'],queues[_0x53d4d2['uniqueid']]['musiconholdstartAt']));}}catch(_0x232d0e){utils[_0x2f8f('0x2f')](util['format']('[%s][queues][musiconholdstart]',_0x53d4d2[_0x2f8f('0x5')]),_0x232d0e);}};exports['musiconholdstop']=function(_0x1c67e4){try{if(!_['isNil'](queues[_0x1c67e4[_0x2f8f('0x5')]])){if(!_['isNil'](queues[_0x1c67e4[_0x2f8f('0x5')]][_0x2f8f('0x61')])){utils[_0x2f8f('0x12')](util[_0x2f8f('0x3')](_0x2f8f('0x63'),_0x1c67e4['uniqueid']),_0x1c67e4);queues[_0x1c67e4['uniqueid']][_0x2f8f('0x5d')]+=utils[_0x2f8f('0x35')](utils['now'](),queues[_0x1c67e4['uniqueid']][_0x2f8f('0x61')]);utils['info'](util[_0x2f8f('0x3')](_0x2f8f('0x64'),_0x1c67e4[_0x2f8f('0x5')],queues[_0x1c67e4[_0x2f8f('0x5')]][_0x2f8f('0x1e')],queues[_0x1c67e4[_0x2f8f('0x5')]]['mohtime']));delete queues[_0x1c67e4['uniqueid']]['musiconholdstartAt'];}}}catch(_0x39c939){utils[_0x2f8f('0x2f')](util[_0x2f8f('0x3')](_0x2f8f('0x63'),_0x1c67e4[_0x2f8f('0x5')]),_0x39c939);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 100b0d9..a31d569 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 _0x3e35=['appdata','toLowerCase','set','startsWith','split','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','uniqueid','accountcode','getUserByInternal','then','membername','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','replace','.wav49','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','clone','newexten','[%s][recordings][newexten]','application'];(function(_0x407e53,_0x28c7bb){var _0x4b7088=function(_0x465143){while(--_0x465143){_0x407e53['push'](_0x407e53['shift']());}};_0x4b7088(++_0x28c7bb);}(_0x3e35,0x1ad));var _0x53e3=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x3e35[_0x503950];return _0x1657a9;};'use strict';var _=require(_0x53e3('0x0'));var util=require(_0x53e3('0x1'));var utils=require(_0x53e3('0x2'));var recordings={};function writeDB(_0x402cc7){utils[_0x53e3('0x3')](util[_0x53e3('0x4')]('[%s][recordings][writeDB]',_0x402cc7[_0x53e3('0x5')]));if(_0x402cc7[_0x53e3('0x6')]){utils[_0x53e3('0x7')](_0x402cc7['accountcode'])[_0x53e3('0x8')](function(_0x402881){if(_0x402881){_0x402cc7[_0x53e3('0x9')]=_0x402881['name'];_0x402cc7[_0x53e3('0xa')]=_0x402881['id'];}utils[_0x53e3('0xb')](_0x53e3('0xc'),_0x402cc7);});}else{utils[_0x53e3('0xb')](_0x53e3('0xc'),_0x402cc7);}}exports[_0x53e3('0xd')]=function(_0x2379ac){try{utils[_0x53e3('0xe')](util[_0x53e3('0x4')]('[%s][recordings][newchannel]',_0x2379ac[_0x53e3('0x5')]),_0x2379ac);if(_0x2379ac[_0x53e3('0x5')]==_0x2379ac[_0x53e3('0xf')]){utils[_0x53e3('0x3')](util[_0x53e3('0x4')](_0x53e3('0x10'),_0x2379ac[_0x53e3('0x5')],_0x2379ac['context'],_0x2379ac['exten']));recordings[_0x2379ac[_0x53e3('0x5')]]={'uniqueid':_0x2379ac['uniqueid'],'accountcode':_0x2379ac['accountcode'],'exten':_0x2379ac[_0x53e3('0x11')],'context':_0x2379ac[_0x53e3('0x12')],'channel':_0x2379ac[_0x53e3('0x13')],'monitors':[]};}}catch(_0x9ce769){utils[_0x53e3('0x14')](util['format'](_0x53e3('0x15'),_0x2379ac[_0x53e3('0x5')]),_0x9ce769);}};exports[_0x53e3('0x16')]=function(_0x13ab67){try{utils[_0x53e3('0xe')](util[_0x53e3('0x4')](_0x53e3('0x17'),_0x13ab67[_0x53e3('0x5')]),_0x13ab67);if(!_[_0x53e3('0x18')](recordings[_0x13ab67['uniqueid']])&&_0x13ab67[_0x53e3('0x19')]==0x6){utils[_0x53e3('0x3')](util[_0x53e3('0x4')](_0x53e3('0x1a'),_0x13ab67[_0x53e3('0x5')],_0x13ab67['context'],_0x13ab67[_0x53e3('0x13')]));}else if(!_[_0x53e3('0x18')](recordings[_0x13ab67['linkedid']])&&_0x13ab67[_0x53e3('0x19')]==0x6&&_0x13ab67[_0x53e3('0x12')]!=_0x53e3('0x1b')){utils['info'](util['format'](_0x53e3('0x1c'),_0x13ab67[_0x53e3('0x5')],_0x13ab67[_0x53e3('0xf')],_0x13ab67[_0x53e3('0x12')],_0x13ab67['channel']));recordings[_0x13ab67[_0x53e3('0xf')]][_0x53e3('0x6')]=_0x13ab67['accountcode'];}}catch(_0x15666b){utils[_0x53e3('0x14')](util[_0x53e3('0x4')](_0x53e3('0x17'),_0x13ab67[_0x53e3('0x5')]),_0x15666b);}};exports[_0x53e3('0x1d')]=function(_0x365e96){try{if(!_[_0x53e3('0x18')](_0x365e96[_0x53e3('0x1e')])&&!_[_0x53e3('0x18')](_0x365e96[_0x53e3('0x1e')][_0x53e3('0x1f')])){utils[_0x53e3('0xe')](util[_0x53e3('0x4')](_0x53e3('0x20'),_0x365e96[_0x53e3('0x5')]),_0x365e96);utils[_0x53e3('0x3')](util[_0x53e3('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x365e96[_0x53e3('0x5')],_0x365e96['variable'],_0x365e96[_0x53e3('0x21')]));if(_['endsWith'](_0x365e96[_0x53e3('0x21')],'.wav49')){_0x365e96[_0x53e3('0x21')]=_0x365e96[_0x53e3('0x21')][_0x53e3('0x22')](_0x53e3('0x23'),_0x53e3('0x24'));}if(recordings[_0x365e96[_0x53e3('0xf')]]){var _0x3ac135=_[_0x53e3('0x25')](recordings[_0x365e96[_0x53e3('0xf')]][_0x53e3('0x26')],{'value':_0x365e96[_0x53e3('0x21')]});if(_[_0x53e3('0x18')](_0x3ac135)){recordings[_0x365e96[_0x53e3('0xf')]][_0x53e3('0x26')]['push']({'value':_0x365e96[_0x53e3('0x21')]});}}}}catch(_0x22b152){utils['error'](util['format'](_0x53e3('0x20'),_0x365e96[_0x53e3('0x5')]),_0x22b152);}};exports[_0x53e3('0x27')]=function(_0x15e1e9){try{if(!_[_0x53e3('0x18')](recordings[_0x15e1e9[_0x53e3('0x5')]])){utils[_0x53e3('0xe')](util['format'](_0x53e3('0x28'),_0x15e1e9[_0x53e3('0x5')]),_0x15e1e9);utils[_0x53e3('0x3')](util[_0x53e3('0x4')](_0x53e3('0x29'),_0x15e1e9[_0x53e3('0x5')],_0x15e1e9[_0x53e3('0x2a')],_0x15e1e9[_0x53e3('0x2b')],_0x15e1e9['cause-txt']));recordings[_0x15e1e9['uniqueid']][_0x53e3('0x2a')]=_0x15e1e9[_0x53e3('0x2a')];recordings[_0x15e1e9[_0x53e3('0x5')]]['calleridname']=_0x15e1e9[_0x53e3('0x2b')];recordings[_0x15e1e9[_0x53e3('0x5')]][_0x53e3('0x2c')]=_0x15e1e9[_0x53e3('0x2c')];recordings[_0x15e1e9[_0x53e3('0x5')]][_0x53e3('0x2d')]=_0x15e1e9[_0x53e3('0x2d')];if(recordings[_0x15e1e9[_0x53e3('0x5')]][_0x53e3('0x2e')]=='outbound'&&recordings[_0x15e1e9[_0x53e3('0x5')]]['accountcode']){recordings[_0x15e1e9[_0x53e3('0x5')]]['connectedlinenum']=recordings[_0x15e1e9['uniqueid']][_0x53e3('0x6')];recordings[_0x15e1e9[_0x53e3('0x5')]][_0x53e3('0x2d')]='';}recordings[_0x15e1e9['uniqueid']]['monitors']['forEach'](function(_0x45f333){var _0x41e84f=_[_0x53e3('0x2f')](recordings[_0x15e1e9[_0x53e3('0x5')]]);_0x41e84f[_0x53e3('0x21')]=_0x45f333[_0x53e3('0x21')];writeDB(_0x41e84f);});delete recordings[_0x15e1e9[_0x53e3('0x5')]];}}catch(_0xfb41da){utils['error'](util[_0x53e3('0x4')](_0x53e3('0x28'),_0x15e1e9[_0x53e3('0x5')]),_0xfb41da);}};exports[_0x53e3('0x30')]=function(_0x1e0fc4){try{if(!_['isNil'](recordings[_0x1e0fc4['uniqueid']])){utils[_0x53e3('0xe')](util['format'](_0x53e3('0x31'),_0x1e0fc4[_0x53e3('0x5')]),_0x1e0fc4);utils[_0x53e3('0x3')](util[_0x53e3('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x1e0fc4[_0x53e3('0x5')],_0x1e0fc4[_0x53e3('0x32')],_0x1e0fc4[_0x53e3('0x33')]));if(_0x1e0fc4[_0x53e3('0x32')][_0x53e3('0x34')]()==_0x53e3('0x35')&&_[_0x53e3('0x36')](_0x1e0fc4[_0x53e3('0x33')][_0x53e3('0x34')](),'cdr')){var _0x59a600=_0x1e0fc4['appdata'][_0x53e3('0x37')]('=');var _0x48235c=_0x59a600[0x0]['substring'](_0x59a600[0x0]['lastIndexOf']('(')+0x1,_0x59a600[0x0]['lastIndexOf'](')'));var _0x2967fb=_0x59a600[0x1];recordings[_0x1e0fc4[_0x53e3('0x5')]][_0x48235c]=_0x2967fb;}}}catch(_0x5e8612){utils[_0x53e3('0x14')](util[_0x53e3('0x4')](_0x53e3('0x31'),_0x1e0fc4['uniqueid']),_0x5e8612);}};exports[_0x53e3('0x38')]=function(_0x153244){try{if(!_[_0x53e3('0x18')](recordings[_0x153244[_0x53e3('0x5')]])){utils[_0x53e3('0xe')](util[_0x53e3('0x4')](_0x53e3('0x39'),_0x153244[_0x53e3('0x5')]),_0x153244);utils[_0x53e3('0x3')](util[_0x53e3('0x4')](_0x53e3('0x3a'),_0x153244['uniqueid'],_0x153244[_0x53e3('0x3b')]));recordings[_0x153244[_0x53e3('0x5')]][_0x53e3('0x3b')]=_0x153244[_0x53e3('0x3b')];}}catch(_0x4d98c3){utils[_0x53e3('0x14')](util[_0x53e3('0x4')]('[%s][recordings][queuecallerjoin]',_0x153244['uniqueid']),_0x4d98c3);}}; \ No newline at end of file +var _0xc975=['forEach','clone','newexten','application','startsWith','appdata','toLowerCase','split','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','[%s][recordings][newstate]','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','mixmonitor_filename','debug','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type'];(function(_0x26ac85,_0x33c581){var _0x3dcf9e=function(_0x1c50ac){while(--_0x1c50ac){_0x26ac85['push'](_0x26ac85['shift']());}};_0x3dcf9e(++_0x33c581);}(_0xc975,0x1ce));var _0x5c97=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc975[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x5c97('0x0'));var util=require(_0x5c97('0x1'));var utils=require(_0x5c97('0x2'));var recordings={};function writeDB(_0xa1fd20){utils[_0x5c97('0x3')](util[_0x5c97('0x4')]('[%s][recordings][writeDB]',_0xa1fd20[_0x5c97('0x5')]));if(_0xa1fd20[_0x5c97('0x6')]){utils[_0x5c97('0x7')](_0xa1fd20[_0x5c97('0x6')])[_0x5c97('0x8')](function(_0xd9da2f){if(_0xd9da2f){_0xa1fd20[_0x5c97('0x9')]=_0xd9da2f[_0x5c97('0xa')];_0xa1fd20[_0x5c97('0xb')]=_0xd9da2f['id'];}utils[_0x5c97('0xc')](_0x5c97('0xd'),_0xa1fd20);});}else{utils[_0x5c97('0xc')](_0x5c97('0xd'),_0xa1fd20);}}exports[_0x5c97('0xe')]=function(_0x1f7579){try{utils['debug'](util[_0x5c97('0x4')](_0x5c97('0xf'),_0x1f7579['uniqueid']),_0x1f7579);if(_0x1f7579[_0x5c97('0x5')]==_0x1f7579[_0x5c97('0x10')]){utils['info'](util[_0x5c97('0x4')](_0x5c97('0x11'),_0x1f7579['uniqueid'],_0x1f7579['context'],_0x1f7579[_0x5c97('0x12')]));recordings[_0x1f7579[_0x5c97('0x5')]]={'uniqueid':_0x1f7579['uniqueid'],'accountcode':_0x1f7579[_0x5c97('0x6')],'exten':_0x1f7579[_0x5c97('0x12')],'context':_0x1f7579[_0x5c97('0x13')],'channel':_0x1f7579[_0x5c97('0x14')],'monitors':[]};}}catch(_0x39ae7e){utils['error'](util[_0x5c97('0x4')](_0x5c97('0xf'),_0x1f7579[_0x5c97('0x5')]),_0x39ae7e);}};exports['newstate']=function(_0x541017){try{utils['debug'](util[_0x5c97('0x4')](_0x5c97('0x15'),_0x541017[_0x5c97('0x5')]),_0x541017);if(!_['isNil'](recordings[_0x541017['uniqueid']])&&_0x541017['channelstate']==0x6){utils['info'](util['format'](_0x5c97('0x16'),_0x541017[_0x5c97('0x5')],_0x541017['context'],_0x541017['channel']));}else if(!_[_0x5c97('0x17')](recordings[_0x541017['linkedid']])&&_0x541017['channelstate']==0x6&&_0x541017[_0x5c97('0x13')]!=_0x5c97('0x18')){utils['info'](util[_0x5c97('0x4')](_0x5c97('0x19'),_0x541017[_0x5c97('0x5')],_0x541017[_0x5c97('0x10')],_0x541017[_0x5c97('0x13')],_0x541017['channel']));recordings[_0x541017[_0x5c97('0x10')]][_0x5c97('0x6')]=_0x541017[_0x5c97('0x6')];}}catch(_0x21fb3c){utils[_0x5c97('0x1a')](util[_0x5c97('0x4')](_0x5c97('0x15'),_0x541017[_0x5c97('0x5')]),_0x21fb3c);}};exports[_0x5c97('0x1b')]=function(_0x5b1de7){try{if(!_[_0x5c97('0x17')](_0x5b1de7[_0x5c97('0x1c')])&&!_[_0x5c97('0x17')](_0x5b1de7[_0x5c97('0x1c')][_0x5c97('0x1d')])){utils[_0x5c97('0x1e')](util[_0x5c97('0x4')](_0x5c97('0x1f'),_0x5b1de7[_0x5c97('0x5')]),_0x5b1de7);utils['info'](util['format'](_0x5c97('0x20'),_0x5b1de7[_0x5c97('0x5')],_0x5b1de7[_0x5c97('0x1c')],_0x5b1de7[_0x5c97('0x21')]));if(_[_0x5c97('0x22')](_0x5b1de7[_0x5c97('0x21')],'.wav49')){_0x5b1de7[_0x5c97('0x21')]=_0x5b1de7[_0x5c97('0x21')][_0x5c97('0x23')](_0x5c97('0x24'),_0x5c97('0x25'));}if(recordings[_0x5b1de7[_0x5c97('0x10')]]){var _0x2b2901=_[_0x5c97('0x26')](recordings[_0x5b1de7[_0x5c97('0x10')]][_0x5c97('0x27')],{'value':_0x5b1de7['value']});if(_['isNil'](_0x2b2901)){recordings[_0x5b1de7[_0x5c97('0x10')]]['monitors'][_0x5c97('0x28')]({'value':_0x5b1de7[_0x5c97('0x21')]});}}}}catch(_0x2bd326){utils[_0x5c97('0x1a')](util[_0x5c97('0x4')](_0x5c97('0x1f'),_0x5b1de7[_0x5c97('0x5')]),_0x2bd326);}};exports[_0x5c97('0x29')]=function(_0x4e8c10){try{if(!_['isNil'](recordings[_0x4e8c10['uniqueid']])){utils[_0x5c97('0x1e')](util[_0x5c97('0x4')](_0x5c97('0x2a'),_0x4e8c10[_0x5c97('0x5')]),_0x4e8c10);utils['info'](util[_0x5c97('0x4')](_0x5c97('0x2b'),_0x4e8c10['uniqueid'],_0x4e8c10[_0x5c97('0x2c')],_0x4e8c10['calleridname'],_0x4e8c10[_0x5c97('0x2d')]));recordings[_0x4e8c10[_0x5c97('0x5')]][_0x5c97('0x2c')]=_0x4e8c10[_0x5c97('0x2c')];recordings[_0x4e8c10[_0x5c97('0x5')]][_0x5c97('0x2e')]=_0x4e8c10[_0x5c97('0x2e')];recordings[_0x4e8c10[_0x5c97('0x5')]][_0x5c97('0x2f')]=_0x4e8c10[_0x5c97('0x2f')];recordings[_0x4e8c10[_0x5c97('0x5')]][_0x5c97('0x30')]=_0x4e8c10[_0x5c97('0x30')];if(recordings[_0x4e8c10[_0x5c97('0x5')]][_0x5c97('0x31')]=='outbound'&&recordings[_0x4e8c10[_0x5c97('0x5')]]['accountcode']){recordings[_0x4e8c10['uniqueid']][_0x5c97('0x2f')]=recordings[_0x4e8c10[_0x5c97('0x5')]]['accountcode'];recordings[_0x4e8c10['uniqueid']][_0x5c97('0x30')]='';}recordings[_0x4e8c10[_0x5c97('0x5')]][_0x5c97('0x27')][_0x5c97('0x32')](function(_0x120402){var _0x3641f1=_[_0x5c97('0x33')](recordings[_0x4e8c10[_0x5c97('0x5')]]);_0x3641f1[_0x5c97('0x21')]=_0x120402[_0x5c97('0x21')];writeDB(_0x3641f1);});delete recordings[_0x4e8c10[_0x5c97('0x5')]];}}catch(_0x25156d){utils[_0x5c97('0x1a')](util[_0x5c97('0x4')](_0x5c97('0x2a'),_0x4e8c10['uniqueid']),_0x25156d);}};exports[_0x5c97('0x34')]=function(_0x493249){try{if(!_[_0x5c97('0x17')](recordings[_0x493249[_0x5c97('0x5')]])){utils['debug'](util[_0x5c97('0x4')]('[%s][recordings][newexten]',_0x493249['uniqueid']),_0x493249);utils['info'](util[_0x5c97('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x493249[_0x5c97('0x5')],_0x493249[_0x5c97('0x35')],_0x493249['appdata']));if(_0x493249[_0x5c97('0x35')]['toLowerCase']()=='set'&&_[_0x5c97('0x36')](_0x493249[_0x5c97('0x37')][_0x5c97('0x38')](),'cdr')){var _0x259806=_0x493249[_0x5c97('0x37')][_0x5c97('0x39')]('=');var _0x27511b=_0x259806[0x0]['substring'](_0x259806[0x0][_0x5c97('0x3a')]('(')+0x1,_0x259806[0x0][_0x5c97('0x3a')](')'));var _0x52c27c=_0x259806[0x1];recordings[_0x493249[_0x5c97('0x5')]][_0x27511b]=_0x52c27c;}}}catch(_0x5b6e79){utils['error'](util[_0x5c97('0x4')](_0x5c97('0x3b'),_0x493249['uniqueid']),_0x5b6e79);}};exports[_0x5c97('0x3c')]=function(_0x2c2a66){try{if(!_[_0x5c97('0x17')](recordings[_0x2c2a66[_0x5c97('0x5')]])){utils[_0x5c97('0x1e')](util[_0x5c97('0x4')](_0x5c97('0x3d'),_0x2c2a66[_0x5c97('0x5')]),_0x2c2a66);utils[_0x5c97('0x3')](util[_0x5c97('0x4')](_0x5c97('0x3e'),_0x2c2a66[_0x5c97('0x5')],_0x2c2a66[_0x5c97('0x3f')]));recordings[_0x2c2a66[_0x5c97('0x5')]][_0x5c97('0x3f')]=_0x2c2a66[_0x5c97('0x3f')];}}catch(_0xbdc8e0){utils[_0x5c97('0x1a')](util['format'](_0x5c97('0x3d'),_0x2c2a66[_0x5c97('0x5')]),_0xbdc8e0);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 5122277..b7f7e5e 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 _0x07b6=['transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname'];(function(_0x11b062,_0x2366ac){var _0xbc771d=function(_0x3d33ba){while(--_0x3d33ba){_0x11b062['push'](_0x11b062['shift']());}};_0xbc771d(++_0x2366ac);}(_0x07b6,0xa6));var _0x607b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x07b6[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x607b('0x0'));var utils=require(_0x607b('0x1'));function writeDB(_0x5a5537){utils[_0x607b('0x2')](util[_0x607b('0x3')](_0x607b('0x4'),_0x5a5537[_0x607b('0x5')]===_0x607b('0x6')?_0x5a5537[_0x607b('0x7')]:_0x5a5537[_0x607b('0x8')],_0x5a5537[_0x607b('0x5')]));utils[_0x607b('0x9')](_0x607b('0xa'),_0x5a5537);}exports[_0x607b('0xb')]={};exports[_0x607b('0xc')]=function(_0x4b2a5a){try{utils[_0x607b('0xd')](util['format'](_0x607b('0xe'),_0x4b2a5a[_0x607b('0x8')]),_0x4b2a5a);utils[_0x607b('0x2')](util[_0x607b('0x3')](_0x607b('0xf'),_0x4b2a5a[_0x607b('0x8')],_0x4b2a5a[_0x607b('0x10')],_0x4b2a5a[_0x607b('0x11')],_0x4b2a5a[_0x607b('0x12')],_0x4b2a5a[_0x607b('0x13')]));_0x4b2a5a['type']=_0x607b('0x14');exports[_0x607b('0xb')][_0x4b2a5a['transfereruniqueid']]=_0x4b2a5a;writeDB(_0x4b2a5a);}catch(_0x1319c4){utils[_0x607b('0x15')](util[_0x607b('0x3')](_0x607b('0xe'),_0x4b2a5a[_0x607b('0x8')]),_0x1319c4);}};exports[_0x607b('0x16')]=function(_0x219335){try{utils[_0x607b('0xd')](util[_0x607b('0x3')](_0x607b('0x17'),_0x219335[_0x607b('0x7')]),_0x219335);utils[_0x607b('0x2')](util[_0x607b('0x3')](_0x607b('0x18'),_0x219335['origtransfereruniqueid'],_0x219335[_0x607b('0x19')],_0x219335[_0x607b('0x1a')],_0x219335[_0x607b('0x1b')],_0x219335[_0x607b('0x1c')]));_0x219335=_[_0x607b('0x1d')](_0x219335,{'transfererchannel':_0x219335[_0x607b('0x1e')],'transferercalleridnum':_0x219335[_0x607b('0x19')],'transferercalleridname':_0x219335[_0x607b('0x1a')],'transfererconnectedlinenum':_0x219335[_0x607b('0x1f')],'transfererconnectedlinename':_0x219335[_0x607b('0x20')],'transfereraccountcode':_0x219335[_0x607b('0x21')],'transferercontext':_0x219335[_0x607b('0x22')],'transfererexten':_0x219335[_0x607b('0x23')],'transfererlinkedid':_0x219335[_0x607b('0x24')],'context':_0x219335[_0x607b('0x25')],'extension':_0x219335[_0x607b('0x26')],'type':'attended'});if(_[_0x607b('0x27')](_0x219335[_0x607b('0x28')])){_0x219335=_[_0x607b('0x1d')](_0x219335,{'transfereechannel':_0x219335['transfertargetchannel'],'transfereecalleridnum':_0x219335['transfertargetcalleridnum'],'transfereecalleridname':_0x219335['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x219335['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x219335[_0x607b('0x29')],'transfereeaccountcode':_0x219335[_0x607b('0x2a')],'transfereecontext':_0x219335[_0x607b('0x2b')],'transfereeexten':_0x219335[_0x607b('0x2c')],'transfereelinkedid':_0x219335[_0x607b('0x2d')]});}writeDB(_0x219335);}catch(_0x3944c3){utils[_0x607b('0x15')](util[_0x607b('0x3')](_0x607b('0x17'),_0x219335[_0x607b('0x7')]),_0x3944c3);}}; \ No newline at end of file +var _0x711a=['origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','assign','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','error','lodash','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x37e09b,_0x4c5ee9){var _0x26a1ed=function(_0x5c1d86){while(--_0x5c1d86){_0x37e09b['push'](_0x37e09b['shift']());}};_0x26a1ed(++_0x4c5ee9);}(_0x711a,0x8a));var _0xa711=function(_0x3bbef1,_0x25d2f0){_0x3bbef1=_0x3bbef1-0x0;var _0x50abfb=_0x711a[_0x3bbef1];return _0x50abfb;};'use strict';var _=require(_0xa711('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x153fc2){utils[_0xa711('0x1')](util[_0xa711('0x2')](_0xa711('0x3'),_0x153fc2[_0xa711('0x4')]===_0xa711('0x5')?_0x153fc2[_0xa711('0x6')]:_0x153fc2[_0xa711('0x7')],_0x153fc2[_0xa711('0x4')]));utils['request'](_0xa711('0x8'),_0x153fc2);}exports[_0xa711('0x9')]={};exports[_0xa711('0xa')]=function(_0x35a3ff){try{utils['debug'](util[_0xa711('0x2')](_0xa711('0xb'),_0x35a3ff[_0xa711('0x7')]),_0x35a3ff);utils[_0xa711('0x1')](util[_0xa711('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x35a3ff[_0xa711('0x7')],_0x35a3ff[_0xa711('0xc')],_0x35a3ff[_0xa711('0xd')],_0x35a3ff[_0xa711('0xe')],_0x35a3ff[_0xa711('0xf')]));_0x35a3ff[_0xa711('0x4')]=_0xa711('0x10');exports[_0xa711('0x9')][_0x35a3ff[_0xa711('0x11')]]=_0x35a3ff;writeDB(_0x35a3ff);}catch(_0x59ad5e){utils['error'](util[_0xa711('0x2')]('[%s][transfers][blindtransfer]',_0x35a3ff[_0xa711('0x7')]),_0x59ad5e);}};exports[_0xa711('0x12')]=function(_0x4aa53a){try{utils[_0xa711('0x13')](util['format'](_0xa711('0x14'),_0x4aa53a[_0xa711('0x6')]),_0x4aa53a);utils[_0xa711('0x1')](util[_0xa711('0x2')](_0xa711('0x15'),_0x4aa53a['origtransfereruniqueid'],_0x4aa53a[_0xa711('0x16')],_0x4aa53a[_0xa711('0x17')],_0x4aa53a[_0xa711('0x18')],_0x4aa53a[_0xa711('0x19')]));_0x4aa53a=_['assign'](_0x4aa53a,{'transfererchannel':_0x4aa53a[_0xa711('0x1a')],'transferercalleridnum':_0x4aa53a[_0xa711('0x16')],'transferercalleridname':_0x4aa53a[_0xa711('0x17')],'transfererconnectedlinenum':_0x4aa53a[_0xa711('0x1b')],'transfererconnectedlinename':_0x4aa53a[_0xa711('0x1c')],'transfereraccountcode':_0x4aa53a[_0xa711('0x1d')],'transferercontext':_0x4aa53a['secondtransferercontext'],'transfererexten':_0x4aa53a[_0xa711('0x1e')],'transfererlinkedid':_0x4aa53a[_0xa711('0x1f')],'context':_0x4aa53a[_0xa711('0x20')],'extension':_0x4aa53a[_0xa711('0x21')],'type':_0xa711('0x5')});if(_['isNil'](_0x4aa53a[_0xa711('0x22')])){_0x4aa53a=_[_0xa711('0x23')](_0x4aa53a,{'transfereechannel':_0x4aa53a['transfertargetchannel'],'transfereecalleridnum':_0x4aa53a['transfertargetcalleridnum'],'transfereecalleridname':_0x4aa53a['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x4aa53a[_0xa711('0x24')],'transfereeconnectedlinename':_0x4aa53a[_0xa711('0x25')],'transfereeaccountcode':_0x4aa53a['transfertargetaccountcode'],'transfereecontext':_0x4aa53a['transfertargetcontext'],'transfereeexten':_0x4aa53a[_0xa711('0x26')],'transfereelinkedid':_0x4aa53a['transfertargetlinkedid']});}writeDB(_0x4aa53a);}catch(_0xb364c8){utils[_0xa711('0x27')](util[_0xa711('0x2')](_0xa711('0x14'),_0x4aa53a['origtransfereruniqueid']),_0xb364c8);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 8433f84..d7dbd86 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 _0xb10b=['util','client','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','now','isAfter','isBefore','bluebird','moment'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b5c23,_0x101faa){_0x4b5c23=_0x4b5c23-0x0;var _0x262cfd=_0xb10b[_0x4b5c23];return _0x262cfd;};'use strict';var BPromise=require(_0xbb10('0x0'));var jayson=require('jayson/promise');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var client=jayson[_0xbb10('0x3')]['http']({'port':0x2329});var logger=require(_0xbb10('0x4'))(_0xbb10('0x5'));exports[_0xbb10('0x6')]=function(_0x22320e,_0x49baf4){logger[_0xbb10('0x6')](_0x22320e,_0x49baf4?util['inspect'](_0x49baf4,{'showHidden':![],'depth':null}):'');};exports[_0xbb10('0x7')]=function(_0x3cdd53,_0x513741){logger[_0xbb10('0x7')](_0x3cdd53,_0x513741?util[_0xbb10('0x8')](_0x513741,{'showHidden':![],'depth':null}):'');};exports[_0xbb10('0x9')]=function(_0x1c3ee5,_0x2353ef){logger[_0xbb10('0x9')](_0x1c3ee5,_0x2353ef?util[_0xbb10('0x8')](_0x2353ef,{'showHidden':![],'depth':null}):'');};exports[_0xbb10('0xa')]=function(_0x5ab04a,_0x4e47f8){return client[_0xbb10('0xa')](_0x5ab04a,{'body':_0x4e47f8})[_0xbb10('0xb')](function(_0xce64f3){logger['debug'](_0xbb10('0xc'),_0x5ab04a,_0xce64f3?util['inspect'](_0xce64f3,{'showHidden':![],'depth':null}):'');})[_0xbb10('0xd')](function(_0x916a32){logger[_0xbb10('0x9')](_0xbb10('0xc'),_0x5ab04a,_0x916a32?util[_0xbb10('0x8')](_0x916a32,{'showHidden':![],'depth':null}):'');});};function getUser(_0x147230){return client['request'](_0xbb10('0xe'),{'options':{'raw':!![],'attributes':['id',_0xbb10('0xf'),_0xbb10('0x10'),_0xbb10('0x11')],'where':_0x147230,'limit':0x1}})[_0xbb10('0xb')](function(_0x2f2ebf){logger[_0xbb10('0x7')](_0xbb10('0x12'),JSON[_0xbb10('0x13')](_0x147230),_0x2f2ebf?util[_0xbb10('0x8')](_0x2f2ebf,{'showHidden':![],'depth':null}):'');return _0x2f2ebf['result'][_0xbb10('0x14')]?_0x2f2ebf[_0xbb10('0x15')][0x0]:null;});}exports[_0xbb10('0x16')]=function(_0x42db98){return new BPromise(function(_0x378da8,_0x1682a4){if(_0x42db98){return getUser({'internal':_0x42db98})[_0xbb10('0xb')](function(_0x30efc6){logger[_0xbb10('0x6')](_0xbb10('0x17'),_0x42db98,_0x30efc6?'found':_0xbb10('0x18'));return _0x378da8(_0x30efc6);})[_0xbb10('0xd')](function(_0x388fab){logger[_0xbb10('0x9')](_0xbb10('0x19'),_0x388fab?util[_0xbb10('0x8')](_0x388fab,{'showHidden':![],'depth':null}):'');return _0x378da8(null);});}return _0x378da8(null);});};exports['getUserByInterface']=function(_0x12f888){return new BPromise(function(_0x12ef77,_0x50aea1){if(_0x12f888){return getUser({'interface':_0x12f888})['then'](function(_0x8e2b97){logger[_0xbb10('0x6')](_0xbb10('0x1a'),_0x12f888,_0x8e2b97?_0xbb10('0x1b'):_0xbb10('0x18'));return _0x12ef77(_0x8e2b97);})[_0xbb10('0xd')](function(_0x407cb4){logger[_0xbb10('0x9')](_0xbb10('0x1c'),_0x407cb4?util[_0xbb10('0x8')](_0x407cb4,{'showHidden':![],'depth':null}):'');return _0x12ef77(null);});}return _0x12ef77(null);});};exports[_0xbb10('0x1d')]=function(_0x26ad93){return new BPromise(function(_0x537898,_0x4fedac){if(_0x26ad93){return getUser({'name':_0x26ad93})['then'](function(_0xc93a04){logger[_0xbb10('0x6')](_0xbb10('0x1e'),_0x26ad93,_0xc93a04?'found':_0xbb10('0x18'));return _0x537898(_0xc93a04);})[_0xbb10('0xd')](function(_0x6ed43b){logger[_0xbb10('0x9')](_0xbb10('0x1f'),_0x6ed43b?util[_0xbb10('0x8')](_0x6ed43b,{'showHidden':![],'depth':null}):'');return _0x537898(null);});}return _0x537898(null);});};exports[_0xbb10('0x20')]=function(_0x4aabb9){return new BPromise(function(_0x3796c7,_0x21ac54){if(_0x4aabb9){return client[_0xbb10('0xa')](_0xbb10('0x21'),{'options':{'raw':!![],'attributes':['id',_0xbb10('0x10'),_0xbb10('0x22'),'acw',_0xbb10('0x23')],'where':{'name':_0x4aabb9},'limit':0x1}})['then'](function(_0x448d5c){logger['debug'](_0xbb10('0x24'),_0x4aabb9,_0x448d5c?util[_0xbb10('0x8')](_0x448d5c,{'showHidden':![],'depth':null}):'');logger[_0xbb10('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x4aabb9,_0x448d5c?'found':_0xbb10('0x18'));return _0x3796c7(_0x448d5c[_0xbb10('0x15')]['length']?_0x448d5c[_0xbb10('0x15')][0x0]:null);})[_0xbb10('0xd')](function(_0x2f653f){logger[_0xbb10('0x9')](_0xbb10('0x25'),_0x2f653f?util[_0xbb10('0x8')](_0x2f653f,{'showHidden':![],'depth':null}):'');return _0x3796c7(null);});}return _0x3796c7(null);});};exports[_0xbb10('0x26')]=function(_0x4975f5,_0x25acb3){return moment(_0x4975f5)[_0xbb10('0x27')](_0x25acb3,_0xbb10('0x28'))[_0xbb10('0x29')](_0xbb10('0x2a'));};exports[_0xbb10('0x2b')]=function(_0x188cbd,_0x10202c){return moment(_0x188cbd)[_0xbb10('0x2c')](_0x10202c,'seconds')[_0xbb10('0x29')](_0xbb10('0x2a'));};exports[_0xbb10('0x2d')]=function(_0x3c3c45,_0x570f5a){return moment(_0x3c3c45)[_0xbb10('0x2e')](moment(_0x570f5a),'seconds');};exports['sumTime']=function(_0x3eb3cc,_0x40c164){return parseInt(_0x3eb3cc,0xa)+parseInt(_0x40c164,0xa);};exports[_0xbb10('0x2f')]=function(){return moment()[_0xbb10('0x29')](_0xbb10('0x2a'));};exports[_0xbb10('0x30')]=function(_0x547062,_0x1e5bbd){if(_0x1e5bbd){return moment(_0x547062)[_0xbb10('0x30')](_0x1e5bbd);}return!![];};exports['isBefore']=function(_0x5e3fbd,_0x5cd55f){if(_0x5cd55f){return moment(_0x5e3fbd)[_0xbb10('0x31')](_0x5cd55f);}else if(_0x5e3fbd){return!![];}return![];}; \ No newline at end of file +var _0x7a54=['result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','YYYY-MM-DD\x20HH:mm:ss','subtract','format','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','xdr','info','debug','error','inspect','request','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','then','[utils][getUser]\x20where:%s','stringify'];(function(_0x2c54db,_0x4decb4){var _0x40c4e4=function(_0x22acbc){while(--_0x22acbc){_0x2c54db['push'](_0x2c54db['shift']());}};_0x40c4e4(++_0x4decb4);}(_0x7a54,0x106));var _0x47a5=function(_0x11c167,_0x1cba6d){_0x11c167=_0x11c167-0x0;var _0x36f30b=_0x7a54[_0x11c167];return _0x36f30b;};'use strict';var BPromise=require(_0x47a5('0x0'));var jayson=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var util=require('util');var client=jayson[_0x47a5('0x3')][_0x47a5('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0x47a5('0x5'));exports[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){logger[_0x47a5('0x6')](_0x2a1a7e,_0x3717e1?util['inspect'](_0x3717e1,{'showHidden':![],'depth':null}):'');};exports[_0x47a5('0x7')]=function(_0x59199c,_0x343372){logger[_0x47a5('0x7')](_0x59199c,_0x343372?util['inspect'](_0x343372,{'showHidden':![],'depth':null}):'');};exports[_0x47a5('0x8')]=function(_0x5077f3,_0x5d90b3){logger['error'](_0x5077f3,_0x5d90b3?util[_0x47a5('0x9')](_0x5d90b3,{'showHidden':![],'depth':null}):'');};exports[_0x47a5('0xa')]=function(_0x5e31dd,_0x2eb0dd){return client['request'](_0x5e31dd,{'body':_0x2eb0dd})['then'](function(_0x1f47f4){logger[_0x47a5('0x7')](_0x47a5('0xb'),_0x5e31dd,_0x1f47f4?util[_0x47a5('0x9')](_0x1f47f4,{'showHidden':![],'depth':null}):'');})[_0x47a5('0xc')](function(_0xd308b8){logger[_0x47a5('0x8')]('[utils][request]\x20name:%s',_0x5e31dd,_0xd308b8?util[_0x47a5('0x9')](_0xd308b8,{'showHidden':![],'depth':null}):'');});};function getUser(_0x221b54){return client[_0x47a5('0xa')](_0x47a5('0xd'),{'options':{'raw':!![],'attributes':['id',_0x47a5('0xe'),_0x47a5('0xf'),_0x47a5('0x10')],'where':_0x221b54,'limit':0x1}})[_0x47a5('0x11')](function(_0x4e99a8){logger[_0x47a5('0x7')](_0x47a5('0x12'),JSON[_0x47a5('0x13')](_0x221b54),_0x4e99a8?util[_0x47a5('0x9')](_0x4e99a8,{'showHidden':![],'depth':null}):'');return _0x4e99a8[_0x47a5('0x14')]['length']?_0x4e99a8['result'][0x0]:null;});}exports[_0x47a5('0x15')]=function(_0x4b966e){return new BPromise(function(_0x5247fd,_0x423a81){if(_0x4b966e){return getUser({'internal':_0x4b966e})[_0x47a5('0x11')](function(_0x2ce454){logger[_0x47a5('0x6')](_0x47a5('0x16'),_0x4b966e,_0x2ce454?_0x47a5('0x17'):_0x47a5('0x18'));return _0x5247fd(_0x2ce454);})[_0x47a5('0xc')](function(_0x3aed38){logger['error'](_0x47a5('0x19'),_0x3aed38?util[_0x47a5('0x9')](_0x3aed38,{'showHidden':![],'depth':null}):'');return _0x5247fd(null);});}return _0x5247fd(null);});};exports['getUserByInterface']=function(_0x2b0360){return new BPromise(function(_0x1f03f7,_0x36874d){if(_0x2b0360){return getUser({'interface':_0x2b0360})['then'](function(_0xb8ae6c){logger[_0x47a5('0x6')](_0x47a5('0x1a'),_0x2b0360,_0xb8ae6c?_0x47a5('0x17'):'notfound');return _0x1f03f7(_0xb8ae6c);})[_0x47a5('0xc')](function(_0x385687){logger['error'](_0x47a5('0x1b'),_0x385687?util[_0x47a5('0x9')](_0x385687,{'showHidden':![],'depth':null}):'');return _0x1f03f7(null);});}return _0x1f03f7(null);});};exports[_0x47a5('0x1c')]=function(_0x129ce5){return new BPromise(function(_0x3abd6a,_0x50bf17){if(_0x129ce5){return getUser({'name':_0x129ce5})['then'](function(_0x136745){logger['info'](_0x47a5('0x1d'),_0x129ce5,_0x136745?'found':_0x47a5('0x18'));return _0x3abd6a(_0x136745);})[_0x47a5('0xc')](function(_0x36ad34){logger[_0x47a5('0x8')](_0x47a5('0x1e'),_0x36ad34?util[_0x47a5('0x9')](_0x36ad34,{'showHidden':![],'depth':null}):'');return _0x3abd6a(null);});}return _0x3abd6a(null);});};exports[_0x47a5('0x1f')]=function(_0x136b14){return new BPromise(function(_0x16631f,_0x361bfa){if(_0x136b14){return client[_0x47a5('0xa')](_0x47a5('0x20'),{'options':{'raw':!![],'attributes':['id',_0x47a5('0xf'),'type',_0x47a5('0x21'),'acwTimeout'],'where':{'name':_0x136b14},'limit':0x1}})[_0x47a5('0x11')](function(_0x9ac908){logger[_0x47a5('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x136b14,_0x9ac908?util[_0x47a5('0x9')](_0x9ac908,{'showHidden':![],'depth':null}):'');logger[_0x47a5('0x6')](_0x47a5('0x22'),_0x136b14,_0x9ac908?_0x47a5('0x17'):'notfound');return _0x16631f(_0x9ac908['result'][_0x47a5('0x23')]?_0x9ac908[_0x47a5('0x14')][0x0]:null);})['catch'](function(_0x4e1006){logger[_0x47a5('0x8')](_0x47a5('0x24'),_0x4e1006?util['inspect'](_0x4e1006,{'showHidden':![],'depth':null}):'');return _0x16631f(null);});}return _0x16631f(null);});};exports[_0x47a5('0x25')]=function(_0x53119b,_0x122ed6){return moment(_0x53119b)[_0x47a5('0x26')](_0x122ed6,'seconds')['format'](_0x47a5('0x27'));};exports['subtractTime']=function(_0x403028,_0x87e4c9){return moment(_0x403028)[_0x47a5('0x28')](_0x87e4c9,'seconds')[_0x47a5('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x65542e,_0x5a8a7c){return moment(_0x65542e)[_0x47a5('0x2a')](moment(_0x5a8a7c),'seconds');};exports[_0x47a5('0x2b')]=function(_0x3534cb,_0x38c8d4){return parseInt(_0x3534cb,0xa)+parseInt(_0x38c8d4,0xa);};exports[_0x47a5('0x2c')]=function(){return moment()[_0x47a5('0x29')](_0x47a5('0x27'));};exports[_0x47a5('0x2d')]=function(_0x452be5,_0x1a0d23){if(_0x1a0d23){return moment(_0x452be5)['isAfter'](_0x1a0d23);}return!![];};exports[_0x47a5('0x2e')]=function(_0x10f136,_0x511c06){if(_0x511c06){return moment(_0x10f136)[_0x47a5('0x2e')](_0x511c06);}else if(_0x10f136){return!![];}return![];}; \ No newline at end of file